yyy{"files":{"@tootallnate":{"files":{"once":{"files":{"package.json":{"size":1209,"offset":"0"},"dist":{"files":{"index.js":{"size":1220,"offset":"1209"}}}}}}},"agent-base":{"files":{"dist":{"files":{"src":{"files":{"index.js":{"size":7916,"offset":"2429"},"promisify.js":{"size":616,"offset":"10345"}}}}},"node_modules":{"files":{"debug":{"files":{"LICENSE":{"size":1107,"offset":"10961"},"package.json":{"size":1746,"offset":"12068"},"dist":{"files":{"debug.js":{"size":27572,"offset":"13814"}}},"src":{"files":{"browser.js":{"size":5831,"offset":"41386"},"common.js":{"size":5930,"offset":"47217"},"index.js":{"size":314,"offset":"53147"},"node.js":{"size":4475,"offset":"53461"}}}}}}},"package.json":{"size":1636,"offset":"57936"}}},"bindings":{"files":{"bindings.js":{"size":5986,"offset":"59572"},"LICENSE.md":{"size":1108,"offset":"65558"},"package.json":{"size":660,"offset":"66666"}}},"chownr":{"files":{"chownr.js":{"size":4275,"offset":"67326"},"LICENSE":{"size":765,"offset":"71601"},"package.json":{"size":649,"offset":"72366"}}},"debug":{"files":{"LICENSE":{"size":1107,"offset":"73015"},"package.json":{"size":1376,"offset":"74122"},"src":{"files":{"browser.js":{"size":6010,"offset":"75498"},"common.js":{"size":6029,"offset":"81508"},"index.js":{"size":314,"offset":"87537"},"node.js":{"size":4685,"offset":"87851"}}},"node_modules":{"files":{"ms":{"files":{"index.js":{"size":3023,"offset":"92536"},"license.md":{"size":1077,"offset":"95559"},"package.json":{"size":705,"offset":"96636"}}}}}}},"lru-cache":{"files":{"index.js":{"size":8186,"offset":"97341"},"LICENSE":{"size":765,"offset":"105527"},"package.json":{"size":705,"offset":"106292"}}},"minipass":{"files":{"index.js":{"size":14282,"offset":"106997"},"LICENSE":{"size":756,"offset":"121279"},"package.json":{"size":808,"offset":"122035"}}},"mkdirp":{"files":{"index.js":{"size":1029,"offset":"122843"},"LICENSE":{"size":1166,"offset":"123872"},"package.json":{"size":804,"offset":"125038"},"bin":{"files":{"cmd.js":{"size":1830,"offset":"125842"}}},"lib":{"files":{"find-made.js":{"size":763,"offset":"127672"},"mkdirp-manual.js":{"size":1610,"offset":"128435"},"mkdirp-native.js":{"size":969,"offset":"130045"},"opts-arg.js":{"size":784,"offset":"131014"},"path-arg.js":{"size":730,"offset":"131798"},"use-native.js":{"size":448,"offset":"132528"}}}}},"ms":{"files":{"index.js":{"size":3024,"offset":"132976"},"license.md":{"size":1079,"offset":"136000"},"package.json":{"size":732,"offset":"137079"}}},"readable-stream":{"files":{"duplex-browser.js":{"size":53,"offset":"137811"},"duplex.js":{"size":46,"offset":"137864"},"GOVERNANCE.md":{"size":5550,"offset":"137910"},"LICENSE":{"size":2337,"offset":"143460"},"package.json":{"size":1370,"offset":"145797"},"passthrough.js":{"size":51,"offset":"147167"},"readable-browser.js":{"size":351,"offset":"147218"},"readable.js":{"size":771,"offset":"147569"},"transform.js":{"size":49,"offset":"148340"},"writable-browser.js":{"size":55,"offset":"148389"},"writable.js":{"size":229,"offset":"148444"},"lib":{"files":{"_stream_duplex.js":{"size":4015,"offset":"148673"},"_stream_passthrough.js":{"size":1753,"offset":"152688"},"_stream_readable.js":{"size":31324,"offset":"154441"},"_stream_transform.js":{"size":7742,"offset":"185765"},"_stream_writable.js":{"size":20317,"offset":"193507"},"internal":{"files":{"streams":{"files":{"BufferList.js":{"size":2059,"offset":"222630"},"destroy.js":{"size":1849,"offset":"224689"},"stream-browser.js":{"size":49,"offset":"226538"},"stream.js":{"size":36,"offset":"226587"}}}}}}},"doc":{"files":{"wg-meetings":{"files":{"2015-01-30.md":{"size":2280,"offset":"213824"}}}}},"node_modules":{"files":{"safe-buffer":{"files":{"index.js":{"size":1529,"offset":"216104"},"LICENSE":{"size":1081,"offset":"217633"},"package.json":{"size":783,"offset":"218714"}}},"string_decoder":{"files":{"LICENSE":{"size":2338,"offset":"219497"},"package.json":{"size":795,"offset":"221835"},"lib":{"files":{"string_decoder.js":{"size":9465,"offset":"226623"}}}}}}}}},"safe-buffer":{"files":{"index.js":{"size":1670,"offset":"236088"},"LICENSE":{"size":1081,"offset":"237758"},"package.json":{"size":1057,"offset":"238839"}}},"string-width":{"files":{"index.js":{"size":879,"offset":"239896"},"license":{"size":1109,"offset":"240775"},"package.json":{"size":941,"offset":"241884"},"node_modules":{"files":{"ansi-regex":{"files":{"index.js":{"size":317,"offset":"242825"},"license":{"size":1109,"offset":"243142"},"package.json":{"size":841,"offset":"244251"}}},"is-fullwidth-code-point":{"files":{"index.js":{"size":1756,"offset":"245092"},"license":{"size":1109,"offset":"246848"},"package.json":{"size":737,"offset":"247957"}}},"strip-ansi":{"files":{"index.js":{"size":154,"offset":"248694"},"license":{"size":1109,"offset":"248848"},"package.json":{"size":798,"offset":"249957"}}}}}}},"strip-ansi":{"files":{"index.js":{"size":161,"offset":"250755"},"license":{"size":1119,"offset":"250916"},"package.json":{"size":1023,"offset":"252035"}}},"@microsoft":{"files":{"1ds-core-js":{"files":{"LICENSE.TXT":{"size":1093,"offset":"253058"},"package.json":{"size":1407,"offset":"254151"},"tsconfig.json":{"size":631,"offset":"255558"},"bundle":{"files":{"ms.core-3.2.2.gbl.js":{"size":205580,"offset":"256189"},"ms.core-3.2.2.gbl.min.js":{"size":54254,"offset":"461769"},"ms.core-3.2.2.integrity.json":{"size":2872,"offset":"516023"},"ms.core-3.2.2.js":{"size":205871,"offset":"518895"},"ms.core-3.2.2.min.js":{"size":54439,"offset":"724766"},"ms.core.gbl.js":{"size":205574,"offset":"779205"},"ms.core.gbl.min.js":{"size":54248,"offset":"984779"},"ms.core.integrity.json":{"size":2848,"offset":"1039027"},"ms.core.js":{"size":205865,"offset":"1041875"},"ms.core.min.js":{"size":54433,"offset":"1247740"}}},"dist":{"files":{"ms.core.js":{"size":62074,"offset":"1302173"},"ms.core.min.js":{"size":19680,"offset":"1364247"}}},"dist-esm":{"files":{"src":{"files":{"AppInsightsCore.js":{"size":6593,"offset":"1383927"},"BaseCore.js":{"size":2652,"offset":"1390520"},"DataModels.js":{"size":315,"offset":"1393172"},"Enums.js":{"size":4440,"offset":"1393487"},"ESPromise.js":{"size":14058,"offset":"1397927"},"ESPromiseScheduler.js":{"size":14291,"offset":"1411985"},"Index.js":{"size":3671,"offset":"1426276"},"Utils.js":{"size":21035,"offset":"1429947"},"ValueSanitizer.js":{"size":10577,"offset":"1450982"}}}}}}},"1ds-post-js":{"files":{"LICENSE.TXT":{"size":1093,"offset":"1461559"},"package.json":{"size":1236,"offset":"1462652"},"tsconfig.json":{"size":631,"offset":"1463888"},"bundle":{"files":{"ms.post-3.2.2.gbl.js":{"size":196868,"offset":"1464519"},"ms.post-3.2.2.gbl.min.js":{"size":43331,"offset":"1661387"},"ms.post-3.2.2.integrity.json":{"size":2872,"offset":"1704718"},"ms.post-3.2.2.js":{"size":197159,"offset":"1707590"},"ms.post-3.2.2.min.js":{"size":43516,"offset":"1904749"},"ms.post.gbl.js":{"size":196862,"offset":"1948265"},"ms.post.gbl.min.js":{"size":43325,"offset":"2145127"},"ms.post.integrity.json":{"size":2848,"offset":"2188452"},"ms.post.js":{"size":197153,"offset":"2191300"},"ms.post.min.js":{"size":43510,"offset":"2388453"}}},"dist":{"files":{"ms.post.js":{"size":110705,"offset":"2431963"},"ms.post.min.js":{"size":24157,"offset":"2542668"}}},"dist-esm":{"files":{"src":{"files":{"BatchNotificationActions.js":{"size":336,"offset":"2566825"},"ClockSkewManager.js":{"size":3717,"offset":"2567161"},"Constants.js":{"size":1497,"offset":"2570878"},"DataModels.js":{"size":840,"offset":"2572375"},"EventBatch.js":{"size":3394,"offset":"2573215"},"HttpManager.js":{"size":61146,"offset":"2576609"},"Index.js":{"size":608,"offset":"2637755"},"KillSwitch.js":{"size":2549,"offset":"2638363"},"PostChannel.js":{"size":49139,"offset":"2640912"},"RetryPolicy.js":{"size":2408,"offset":"2690051"},"Serializer.js":{"size":17317,"offset":"2692459"},"TimeoutOverrideWrapper.js":{"size":963,"offset":"2709776"},"typings":{"files":{"XDomainRequest.js":{"size":451,"offset":"2710739"}}}}}}}}},"applicationinsights-core-js":{"files":{"LICENSE":{"size":1183,"offset":"6947116"},"package.json":{"size":2598,"offset":"6948299"},"tsconfig.json":{"size":877,"offset":"6950897"},"browser":{"files":{"applicationinsights-core-js.integrity.json":{"size":1510,"offset":"6951774"},"applicationinsights-core-js.js":{"size":169169,"offset":"6953284"},"applicationinsights-core-js.min.js":{"size":44675,"offset":"7122453"}}},"dist":{"files":{"applicationinsights-core-js.api.json":{"size":869992,"offset":"7167128"},"applicationinsights-core-js.api.md":{"size":44077,"offset":"8037120"},"applicationinsights-core-js.js":{"size":169166,"offset":"8081197"},"applicationinsights-core-js.min.js":{"size":44672,"offset":"8250363"}}},"dist-esm":{"files":{"applicationinsights-core-js.js":{"size":4038,"offset":"8295035"},"JavaScriptSDK":{"files":{"AppInsightsCore.js":{"size":2715,"offset":"8299413"},"BaseCore.js":{"size":30604,"offset":"8302128"},"BaseTelemetryPlugin.js":{"size":9809,"offset":"8332732"},"ChannelController.js":{"size":9387,"offset":"8342541"},"Constants.js":{"size":412,"offset":"8351928"},"CookieMgr.js":{"size":14727,"offset":"8352340"},"CoreUtils.js":{"size":7869,"offset":"8367067"},"DataCacheHelper.js":{"size":3270,"offset":"8374936"},"DbgExtensionUtils.js":{"size":1655,"offset":"8378206"},"DiagnosticLogger.js":{"size":11822,"offset":"8379861"},"EnvUtils.js":{"size":13614,"offset":"8391683"},"EventHelpers.js":{"size":25029,"offset":"8405297"},"HelperFuncs.js":{"size":35260,"offset":"8430326"},"InstrumentHooks.js":{"size":9244,"offset":"8465586"},"InternalConstants.js":{"size":1400,"offset":"8474830"},"NotificationManager.js":{"size":5072,"offset":"8476230"},"PerfManager.js":{"size":8554,"offset":"8481302"},"ProcessTelemetryContext.js":{"size":21492,"offset":"8489856"},"RandomHelper.js":{"size":5410,"offset":"8511348"},"TelemetryHelpers.js":{"size":4826,"offset":"8516758"},"TelemetryInitializerPlugin.js":{"size":3909,"offset":"8521584"},"UnloadHandlerContainer.js":{"size":1178,"offset":"8525493"}}},"JavaScriptSDK.Enums":{"files":{"EnumHelperFuncs.js":{"size":2006,"offset":"8526671"},"EventsDiscardedReason.js":{"size":1198,"offset":"8528677"},"LoggingEnums.js":{"size":5959,"offset":"8529875"},"SendRequestReason.js":{"size":352,"offset":"8535834"},"TelemetryUnloadReason.js":{"size":360,"offset":"8536186"},"TelemetryUpdateReason.js":{"size":360,"offset":"8536546"}}},"JavaScriptSDK.Interfaces":{"files":{"IAppInsightsCore.js":{"size":356,"offset":"8536906"},"IChannelControls.js":{"size":396,"offset":"8537262"},"IConfiguration.js":{"size":369,"offset":"8537658"},"ICookieMgr.js":{"size":354,"offset":"8538027"},"IDbgExtension.js":{"size":357,"offset":"8538381"},"IDiagnosticLogger.js":{"size":372,"offset":"8538738"},"IInstrumentHooks.js":{"size":360,"offset":"8539110"},"INotificationListener.js":{"size":380,"offset":"8539470"},"INotificationManager.js":{"size":360,"offset":"8539850"},"IPerfEvent.js":{"size":354,"offset":"8540210"},"IPerfManager.js":{"size":352,"offset":"8540564"},"IProcessTelemetryContext.js":{"size":383,"offset":"8540916"},"ITelemetryInitializers.js":{"size":362,"offset":"8541299"},"ITelemetryItem.js":{"size":373,"offset":"8541661"},"ITelemetryPlugin.js":{"size":375,"offset":"8542034"},"ITelemetryPluginChain.js":{"size":365,"offset":"8542409"},"ITelemetryUnloadState.js":{"size":365,"offset":"8542774"},"ITelemetryUpdateState.js":{"size":365,"offset":"8543139"},"IUnloadableComponent.js":{"size":360,"offset":"8543504"}}}}},"types":{"files":{"tsdoc-metadata.json":{"size":340,"offset":"8299073"}}}}},"applicationinsights-shims":{"files":{"LICENSE":{"size":1183,"offset":"8543864"},"package.json":{"size":1932,"offset":"8545047"},"tsconfig.json":{"size":668,"offset":"8546979"},"browser":{"files":{"applicationinsights-shims.js":{"size":14767,"offset":"8547647"},"applicationinsights-shims.min.js":{"size":4344,"offset":"8562414"}}},"dist-esm":{"files":{"applicationinsights-shims.js":{"size":893,"offset":"8566758"},"Constants.js":{"size":835,"offset":"8567651"},"Helpers.js":{"size":2830,"offset":"8568486"},"TsLibGlobals.js":{"size":1544,"offset":"8571316"},"TsLibShims.js":{"size":7852,"offset":"8572860"}}},"dist":{"files":{"esm":{"files":{"applicationinsights-shims.js":{"size":11756,"offset":"8580712"},"applicationinsights-shims.min.js":{"size":11756,"offset":"8592468"}}},"umd":{"files":{"applicationinsights-shims.js":{"size":14767,"offset":"8604224"},"applicationinsights-shims.min.js":{"size":4344,"offset":"8618991"}}}}}}},"dynamicproto-js":{"files":{"LICENSE":{"size":1162,"offset":"8623335"},"microsoft-dynamicproto-js-1.1.6.tgz":{"size":610022,"offset":"8624497"},"package.json":{"size":2364,"offset":"9234519"},"RELEASES.md":{"size":3255,"offset":"9236883"},"SECURITY.md":{"size":2865,"offset":"9240138"},"lib":{"files":{"dist":{"files":{"amd":{"files":{"dynamicproto-js.js":{"size":26498,"offset":"9243003"},"dynamicproto-js.min.js":{"size":2768,"offset":"9269501"}}},"esm":{"files":{"dynamicproto-js.js":{"size":24418,"offset":"9272269"},"dynamicproto-js.min.js":{"size":24422,"offset":"9296687"}}},"iife":{"files":{"dynamicproto-js.js":{"size":26572,"offset":"9321109"},"dynamicproto-js.min.js":{"size":2831,"offset":"9347681"}}},"cjs":{"files":{"dynamicproto-js.js":{"size":24428,"offset":"9350512"},"dynamicproto-js.min.js":{"size":2756,"offset":"9374940"}}},"node":{"files":{"dynamicproto-js.js":{"size":26868,"offset":"9377696"},"dynamicproto-js.min.js":{"size":3011,"offset":"9404564"}}},"system":{"files":{"dynamicproto-js.js":{"size":30734,"offset":"9407575"},"dynamicproto-js.min.js":{"size":2850,"offset":"9438309"}}},"umd":{"files":{"dynamicproto-js.js":{"size":26867,"offset":"9441159"},"dynamicproto-js.min.js":{"size":3010,"offset":"9468026"}}}}}}},"tools":{"files":{"rollup":{"files":{"esm":{"files":{"removedynamic.js":{"size":35105,"offset":"9471036"}}},"node":{"files":{"removedynamic.js":{"size":39554,"offset":"9506141"}}}}}}}}}}},"@parcel":{"files":{"watcher":{"files":{"index.js":{"size":1051,"offset":"2711190"},"index.js.flow":{"size":949,"offset":"2712241"},"LICENSE":{"size":1077,"offset":"2713190"},"package.json":{"size":1436,"offset":"2714267"},"build":{"files":{"Release":{"files":{"watcher.node":{"size":1474048,"unpacked":true}}}}}}}}},"@vscode":{"files":{"iconv-lite-umd":{"files":{"LICENSE":{"size":1141,"offset":"2715703"},"package.json":{"size":961,"offset":"2716844"},"lib":{"files":{"iconv-lite-umd.js":{"size":295312,"offset":"2717805"}}}}},"ripgrep":{"files":{"jsconfig.json":{"size":117,"offset":"3013117"},"LICENSE":{"size":1113,"offset":"3013234"},"package.json":{"size":588,"offset":"3014347"},"SECURITY.md":{"size":2779,"offset":"3014935"},"bin":{"files":{"rg.exe":{"size":4719616,"unpacked":true}}},"lib":{"files":{"download.js":{"size":9931,"offset":"3017714"},"index.js":{"size":149,"offset":"3027645"},"postinstall.js":{"size":2584,"offset":"3027794"}}},"node_modules":{"files":{"debug":{"files":{"LICENSE":{"size":1107,"offset":"3030378"},"package.json":{"size":1746,"offset":"3031485"},"dist":{"files":{"debug.js":{"size":27572,"offset":"3034636"}}},"src":{"files":{"browser.js":{"size":5831,"offset":"3062208"},"common.js":{"size":5930,"offset":"3068039"},"index.js":{"size":314,"offset":"3073969"},"node.js":{"size":4475,"offset":"3074283"}}}}},"https-proxy-agent":{"files":{"package.json":{"size":1405,"offset":"3033231"},"dist":{"files":{"agent.js":{"size":8113,"offset":"3078758"},"index.js":{"size":732,"offset":"3086871"},"parse-proxy-response.js":{"size":2613,"offset":"3087603"}}}}}}}}},"sqlite3":{"files":{"Dockerfile":{"size":2627,"offset":"3090216"},"LICENSE":{"size":1460,"offset":"3092843"},"package.json":{"size":1907,"offset":"3094303"},"SECURITY.md":{"size":2780,"offset":"3096210"},"sqlite3.js":{"size":43,"offset":"3098990"},"lib":{"files":{"index.js":{"size":39,"offset":"3099033"},"sqlite3-binding.js":{"size":263,"offset":"3099072"},"sqlite3.js":{"size":6309,"offset":"3099335"},"trace.js":{"size":1346,"offset":"3105644"}}},"build":{"files":{"Release":{"files":{"vscode-sqlite3.node":{"size":2922496,"unpacked":true}}}}},"tools":{"files":{"docker":{"files":{"architecture":{"files":{"linux-arm":{"files":{"Dockerfile":{"size":2494,"offset":"3106990"},"run.sh":{"size":1955,"offset":"3109484"}}},"linux-arm64":{"files":{"Dockerfile":{"size":2531,"offset":"3111439"},"run.sh":{"size":1982,"offset":"3113970"}}}}}}}}}}},"sudo-prompt":{"files":{"index.js":{"size":35440,"offset":"3115952"},"LICENSE":{"size":1084,"offset":"3151392"},"package.json":{"size":873,"offset":"3152476"},"test-concurrent.js":{"size":664,"offset":"3153349"},"test.js":{"size":1846,"offset":"3154013"}}},"vscode-languagedetection":{"files":{"LICENSE":{"size":1141,"offset":"3155859"},"package.json":{"size":1557,"offset":"3157000"},"SECURITY.md":{"size":2780,"offset":"3158557"},"cli":{"files":{"index.js":{"size":773,"offset":"3161337"}}},"model":{"files":{"group1-shard1of1.bin":{"size":715908,"offset":"3162110"},"model.json":{"size":242642,"offset":"3878018"}}},"dist":{"files":{"lib":{"files":{"index.js":{"size":518447,"offset":"4120660"},"index.js.LICENSE.txt":{"size":6356,"offset":"4639107"}}}}}}},"windows-registry":{"files":{"License.txt":{"size":1110,"offset":"6921568"},"package.json":{"size":862,"offset":"6922678"},"dist":{"files":{"index.js":{"size":1039,"offset":"6923540"}}},"build":{"files":{"Release":{"files":{"winregistry.node":{"size":724480,"unpacked":true}}}}}}}}},"graceful-fs":{"files":{"clone.js":{"size":496,"offset":"4645463"},"graceful-fs.js":{"size":12164,"offset":"4645959"},"legacy-streams.js":{"size":2655,"offset":"4658123"},"LICENSE":{"size":781,"offset":"4660778"},"package.json":{"size":988,"offset":"4661559"},"polyfills.js":{"size":9740,"offset":"4662547"}}},"http-proxy-agent":{"files":{"index.js":{"size":3499,"offset":"4672287"},"package.json":{"size":754,"offset":"4675786"},"node_modules":{"files":{"agent-base":{"files":{"index.js":{"size":4147,"offset":"4676540"},"package.json":{"size":729,"offset":"4680687"},"patch-core.js":{"size":962,"offset":"4681416"}}},"debug":{"files":{"karma.conf.js":{"size":1736,"offset":"4682378"},"LICENSE":{"size":1107,"offset":"4684114"},"Makefile":{"size":1234,"offset":"4685221"},"node.js":{"size":40,"offset":"4686455"},"package.json":{"size":1021,"offset":"4686495"},"src":{"files":{"browser.js":{"size":5707,"offset":"4692061"},"debug.js":{"size":4889,"offset":"4697768"},"index.js":{"size":263,"offset":"4702657"},"node.js":{"size":4339,"offset":"4702920"}}}}},"ms":{"files":{"index.js":{"size":2764,"offset":"4687516"},"license.md":{"size":1077,"offset":"4690280"},"package.json":{"size":704,"offset":"4691357"}}}}}}},"https-proxy-agent":{"files":{"index.js":{"size":6351,"offset":"4707259"},"package.json":{"size":792,"offset":"4713610"},"node_modules":{"files":{"debug":{"files":{"LICENSE":{"size":1107,"offset":"4714402"},"node.js":{"size":40,"offset":"4715509"},"package.json":{"size":1153,"offset":"4715549"},"dist":{"files":{"debug.js":{"size":26324,"offset":"4723330"}}},"src":{"files":{"browser.js":{"size":6285,"offset":"4749654"},"common.js":{"size":5929,"offset":"4755939"},"index.js":{"size":331,"offset":"4761868"},"node.js":{"size":4361,"offset":"4762199"}}}}},"agent-base":{"files":{"index.js":{"size":4407,"offset":"4716702"},"package.json":{"size":797,"offset":"4721109"},"patch-core.js":{"size":1424,"offset":"4721906"}}}}}}},"jschardet":{"files":{"CONTRIBUTORS":{"size":230,"offset":"4766560"},"LICENSE":{"size":26461,"offset":"4766790"},"package.json":{"size":1022,"offset":"4793251"},"dist":{"files":{"jschardet.min.js":{"size":335803,"offset":"4794273"}}}}},"keytar":{"files":{"LICENSE.md":{"size":1055,"offset":"5130076"},"package.json":{"size":1741,"offset":"5131131"},"lib":{"files":{"keytar.js":{"size":1038,"offset":"5132872"}}},"build":{"files":{"Release":{"files":{"keytar.node":{"size":707584,"unpacked":true}}}}}}},"minimist":{"files":{"index.js":{"size":7807,"offset":"5133910"},"LICENSE":{"size":1073,"offset":"5141717"},"package.json":{"size":883,"offset":"5142790"}}},"native-is-elevated":{"files":{"index.js":{"size":594,"offset":"5143673"},"LICENSE":{"size":1070,"offset":"5144267"},"package.json":{"size":708,"offset":"5145337"},"tst":{"files":{"iselevated.test.js":{"size":289,"offset":"5146045"}}},"build":{"files":{"Release":{"files":{"iselevated.node":{"size":633856,"unpacked":true}}}}}}},"native-keymap":{"files":{"index.js":{"size":1769,"offset":"5146334"},"License.txt":{"size":1094,"offset":"5148103"},"package.json":{"size":517,"offset":"5149197"},"SECURITY.md":{"size":2780,"offset":"5149714"},"ThirdPartyNotices.txt":{"size":2514,"offset":"5152494"},"build":{"files":{"Release":{"files":{"keymapping.node":{"size":756224,"unpacked":true}}}}}}},"native-watchdog":{"files":{"index.js":{"size":783,"offset":"5155008"},"LICENSE":{"size":1162,"offset":"5155791"},"package.json":{"size":587,"offset":"5156953"},"SECURITY.md":{"size":2780,"offset":"5157540"},"build":{"files":{"Release":{"files":{"watchdog.node":{"size":706560,"unpacked":true}}}}}}},"node-pty":{"files":{"LICENSE":{"size":3326,"offset":"5160320"},"package.json":{"size":1468,"offset":"5163646"},"lib":{"files":{"conpty_console_list_agent.js":{"size":889,"offset":"5165114"},"eventEmitter2.js":{"size":1714,"offset":"5166003"},"index.js":{"size":2086,"offset":"5167717"},"interfaces.js":{"size":347,"offset":"5169803"},"terminal.js":{"size":7281,"offset":"5170150"},"types.js":{"size":342,"offset":"5177431"},"unixTerminal.js":{"size":10096,"offset":"5177773"},"utils.js":{"size":694,"offset":"5187869"},"windowsConoutConnection.js":{"size":6131,"offset":"5188563"},"windowsPtyAgent.js":{"size":12358,"offset":"5194694"},"windowsTerminal.js":{"size":7522,"offset":"5207052"},"shared":{"files":{"conout.js":{"size":469,"unpacked":true}}},"worker":{"files":{"conoutSocketWorker.js":{"size":861,"unpacked":true}}}}},"build":{"files":{"Release":{"files":{"conpty.node":{"size":1199616,"unpacked":true},"conpty_console_list.node":{"size":653312,"unpacked":true},"pty.node":{"size":1188352,"unpacked":true},"winpty-agent.exe":{"size":871936,"unpacked":true},"winpty.dll":{"size":762368,"unpacked":true}}}}}}},"node-vsce-sign":{"files":{"package.json":{"size":526,"offset":"5214574"},"bin":{"files":{"vsce-sign.exe":{"size":10044304,"unpacked":true}}},"src":{"files":{"main.js":{"size":5264,"offset":"5215100"}}}}},"spdlog":{"files":{"index.js":{"size":985,"offset":"5220364"},"LICENSE":{"size":1162,"offset":"5221349"},"package.json":{"size":884,"offset":"5222511"},"build":{"files":{"Release":{"files":{"spdlog.node":{"size":1568768,"unpacked":true}}}}},"node_modules":{"files":{"mkdirp":{"files":{"index.js":{"size":2644,"offset":"5223395"},"LICENSE":{"size":1141,"offset":"5226039"},"package.json":{"size":647,"offset":"5227180"},"bin":{"files":{"cmd.js":{"size":731,"offset":"5227827"},"usage.txt":{"size":315,"offset":"5228558"}}}}}}}}},"tas-client-umd":{"files":{"LICENSE":{"size":1183,"offset":"5228873"},"package.json":{"size":521,"offset":"5230056"},"lib":{"files":{"tas-client-umd.js":{"size":27591,"offset":"5230577"}}}}},"v8-inspect-profiler":{"files":{"index.js":{"size":3301,"offset":"5258168"},"LICENSE.txt":{"size":1110,"offset":"5261469"},"package.json":{"size":390,"offset":"5262579"}}},"vscode-oniguruma":{"files":{"LICENSE.txt":{"size":1102,"offset":"5262969"},"NOTICES.txt":{"size":2273,"offset":"5264071"},"package.json":{"size":1039,"offset":"5266344"},"release":{"files":{"main.js":{"size":12428,"offset":"5267383"},"onig.wasm":{"size":471543,"unpacked":true}}}}},"vscode-policy-watcher":{"files":{"index.js":{"size":625,"offset":"5279811"},"LICENSE":{"size":1141,"offset":"5280436"},"package.json":{"size":822,"offset":"5281577"},"build":{"files":{"Release":{"files":{"vscode-policy-watcher.node":{"size":776192,"unpacked":true}}}}}}},"vscode-proxy-agent":{"files":{"LICENSE.md":{"size":1235,"offset":"5282399"},"package.json":{"size":1216,"offset":"5283634"},"out":{"files":{"agent.js":{"size":7425,"offset":"5284850"},"index.js":{"size":18792,"offset":"5292275"}}},"node_modules":{"files":{"agent-base":{"files":{"package.json":{"size":1635,"offset":"5311067"},"node_modules":{"files":{"debug":{"files":{"LICENSE":{"size":1107,"offset":"5334481"},"package.json":{"size":1746,"offset":"5335588"},"dist":{"files":{"debug.js":{"size":27572,"offset":"5355023"}}},"src":{"files":{"browser.js":{"size":5831,"offset":"5382595"},"common.js":{"size":5930,"offset":"5388426"},"index.js":{"size":314,"offset":"5394356"},"node.js":{"size":4475,"offset":"5394670"}}}}}}},"dist":{"files":{"src":{"files":{"index.js":{"size":8063,"offset":"5337334"},"promisify.js":{"size":648,"offset":"5345397"}}}}}}},"https-proxy-agent":{"files":{"package.json":{"size":1405,"offset":"5312702"},"dist":{"files":{"agent.js":{"size":8116,"offset":"5315533"},"index.js":{"size":735,"offset":"5323649"},"parse-proxy-response.js":{"size":2616,"offset":"5324384"}}},"node_modules":{"files":{"agent-base":{"files":{"package.json":{"size":1636,"offset":"5346045"},"dist":{"files":{"src":{"files":{"index.js":{"size":7979,"offset":"5487389"},"promisify.js":{"size":679,"offset":"5495368"}}}}}}},"debug":{"files":{"LICENSE":{"size":1107,"offset":"5347681"},"package.json":{"size":1746,"offset":"5348788"},"dist":{"files":{"debug.js":{"size":27572,"offset":"5399145"}}},"src":{"files":{"browser.js":{"size":5831,"offset":"5426717"},"common.js":{"size":5930,"offset":"5432548"},"index.js":{"size":314,"offset":"5438478"},"node.js":{"size":4475,"offset":"5438792"}}}}}}}}},"http-proxy-agent":{"files":{"package.json":{"size":1426,"offset":"5314107"},"dist":{"files":{"agent.js":{"size":6755,"offset":"5327000"},"index.js":{"size":726,"offset":"5333755"}}},"node_modules":{"files":{"agent-base":{"files":{"package.json":{"size":1636,"offset":"5350534"},"dist":{"files":{"src":{"files":{"index.js":{"size":7978,"offset":"5496047"},"promisify.js":{"size":678,"offset":"5504025"}}}}}}},"debug":{"files":{"LICENSE":{"size":1107,"offset":"5352170"},"package.json":{"size":1746,"offset":"5353277"},"dist":{"files":{"debug.js":{"size":27572,"offset":"5443267"}}},"src":{"files":{"browser.js":{"size":5831,"offset":"5470839"},"common.js":{"size":5930,"offset":"5476670"},"index.js":{"size":314,"offset":"5482600"},"node.js":{"size":4475,"offset":"5482914"}}}}}}}}}}}}},"vscode-regexpp":{"files":{"index.js":{"size":77034,"offset":"5504703"},"index.mjs":{"size":76685,"offset":"5581737"},"index.mjs.map":{"size":67006,"offset":"5658422"},"LICENSE":{"size":1071,"offset":"5725428"},"package.json":{"size":2527,"offset":"5726499"}}},"vscode-textmate":{"files":{"LICENSE.md":{"size":1083,"offset":"5729026"},"package.json":{"size":1123,"offset":"5730109"},"SECURITY.md":{"size":2780,"offset":"5731232"},"release":{"files":{"main.js":{"size":61878,"offset":"5734012"}}}}},"xterm":{"files":{"LICENSE":{"size":1261,"offset":"5795890"},"package.json":{"size":3210,"offset":"5797151"},"css":{"files":{"xterm.css":{"size":4632,"offset":"5800361"}}},"lib":{"files":{"xterm.js":{"size":273913,"offset":"5804993"}}}}},"xterm-addon-canvas":{"files":{"LICENSE":{"size":1103,"offset":"6078906"},"package.json":{"size":637,"offset":"6080009"},"lib":{"files":{"xterm-addon-canvas.js":{"size":82694,"offset":"6080646"}}}}},"xterm-addon-search":{"files":{"LICENSE":{"size":1103,"offset":"6163340"},"package.json":{"size":623,"offset":"6164443"},"lib":{"files":{"xterm-addon-search.js":{"size":13159,"offset":"6165066"}}}}},"xterm-addon-serialize":{"files":{"package.json":{"size":1147,"offset":"6178225"},"lib":{"files":{"xterm-addon-serialize.js":{"size":10360,"offset":"6179372"}}}}},"xterm-addon-unicode11":{"files":{"LICENSE":{"size":1103,"offset":"6189732"},"package.json":{"size":631,"offset":"6190835"},"lib":{"files":{"xterm-addon-unicode11.js":{"size":7831,"offset":"6191466"}}}}},"xterm-addon-webgl":{"files":{"LICENSE":{"size":1103,"offset":"6199297"},"package.json":{"size":634,"offset":"6200400"},"lib":{"files":{"xterm-addon-webgl.js":{"size":87944,"offset":"6201034"}}}}},"xterm-headless":{"files":{"package.json":{"size":498,"offset":"6288978"},"lib-headless":{"files":{"xterm-headless.js":{"size":138130,"offset":"6289476"}}}}},"yauzl":{"files":{"index.js":{"size":33069,"offset":"6427606"},"LICENSE":{"size":1077,"offset":"6460675"},"package.json":{"size":881,"offset":"6461752"}}},"vscode-encrypt":{"files":{"getOpenSSL.sh":{"size":828,"offset":"6462633"},"LICENSE":{"size":1162,"offset":"6463461"},"package.json":{"size":613,"offset":"6464623"},"SECURITY.md":{"size":2820,"offset":"6465236"},"tsconfig.json":{"size":255,"offset":"6468056"},"tslint.json":{"size":1758,"offset":"6468311"},"azure-pipelines":{"files":{"main.yml":{"size":681,"offset":"6470069"},"posix.yml":{"size":1010,"offset":"6470750"},"windows.yml":{"size":916,"offset":"6471760"}}},"lib":{"files":{"index.js":{"size":652,"offset":"6472676"}}},"rs":{"files":{"build.rs":{"size":1646,"offset":"6473328"},"Cargo.toml":{"size":390,"offset":"6474974"},"src":{"files":{"lib.cc":{"size":1069,"offset":"6475557"},"lib.h":{"size":250,"offset":"6476626"},"lib.rs":{"size":1324,"offset":"6476876"}}}}},"rs-pure":{"files":{"Cargo.toml":{"size":193,"offset":"6475364"},"src":{"files":{"lib.rs":{"size":6039,"offset":"6478200"}}}}},"build":{"files":{"Release":{"files":{"vscode-encrypt-native.node":{"size":766464,"unpacked":true}}}}}}},"vscode-regexp-languagedetection":{"files":{"package.json":{"size":384,"offset":"6484239"},"dist":{"files":{"index.js":{"size":406792,"offset":"6484623"}}}}},"vsda":{"files":{"index.js":{"size":49,"offset":"6891415"},"package.json":{"size":542,"offset":"6891464"},"test.js":{"size":1882,"offset":"6892006"},"build":{"files":{"Release":{"files":{"vsda.node":{"size":1282560,"unpacked":true}}}}}}},"yazl":{"files":{"index.js":{"size":25909,"offset":"6893888"},"LICENSE":{"size":1077,"offset":"6919797"},"package.json":{"size":694,"offset":"6920874"}}},"windows-foreground-love":{"files":{"index.js":{"size":516,"offset":"6924579"},"LICENSE":{"size":1071,"offset":"6925095"},"package.json":{"size":648,"offset":"6926166"},"build":{"files":{"Release":{"files":{"foreground_love.node":{"size":635392,"unpacked":true}}}}}}},"windows-mutex":{"files":{"azure-pipelines.yml":{"size":625,"offset":"6926814"},"index.js":{"size":52,"offset":"6927439"},"LICENSE":{"size":1119,"offset":"6927491"},"package.json":{"size":614,"offset":"6928610"},"build":{"files":{"Release":{"files":{"CreateMutex.node":{"size":670208,"unpacked":true}}}}},"node_modules":{"files":{"bindings":{"files":{"bindings.js":{"size":4858,"offset":"6929224"},"package.json":{"size":603,"offset":"6934082"}}}}}}},"windows-process-tree":{"files":{"LICENSE":{"size":1161,"offset":"6934685"},"package.json":{"size":932,"offset":"6935846"},"SECURITY.md":{"size":2757,"offset":"6936778"},"tsconfig.json":{"size":279,"offset":"6939535"},"tslint.json":{"size":1651,"offset":"6939814"},"lib":{"files":{"index.js":{"size":5651,"offset":"6941465"}}},"build":{"files":{"Release":{"files":{"windows_process_tree.node":{"size":733696,"unpacked":true}}}}}}},"ansi-regex":{"files":{"index.js":{"size":135,"offset":"9545695"},"license":{"size":1119,"offset":"9545830"},"package.json":{"size":1189,"offset":"9546949"}}},"buffer-crc32":{"files":{"index.js":{"size":4517,"offset":"9548138"},"LICENSE":{"size":1085,"offset":"9552655"},"package.json":{"size":892,"offset":"9553740"}}},"chrome-remote-interface":{"files":{"chrome-remote-interface.js":{"size":543791,"offset":"9554632"},"index.js":{"size":1045,"offset":"10098423"},"LICENSE":{"size":1080,"offset":"10099468"},"package.json":{"size":1596,"offset":"10100548"},"webpack.config.js":{"size":596,"offset":"10102144"},"bin":{"files":{"client.js":{"size":8085,"offset":"10102740"}}},"lib":{"files":{"api.js":{"size":2453,"offset":"10110825"},"chrome.js":{"size":10216,"offset":"10113278"},"defaults.js":{"size":78,"offset":"10123494"},"devtools.js":{"size":3784,"offset":"10123572"},"external-request.js":{"size":1374,"offset":"10127356"},"protocol.json":{"size":818794,"offset":"10128730"},"websocket-wrapper.js":{"size":894,"offset":"10947524"}}},"node_modules":{"files":{"commander":{"files":{"index.js":{"size":25583,"offset":"10948418"},"LICENSE":{"size":1098,"offset":"10974001"},"package.json":{"size":563,"offset":"10975099"},"Readme.md":{"size":10275,"offset":"10975662"}}}}}}},"emoji-regex":{"files":{"index.js":{"size":10286,"offset":"10985937"},"LICENSE-MIT.txt":{"size":1077,"offset":"10996223"},"package.json":{"size":1278,"offset":"10997300"},"text.js":{"size":10287,"offset":"10998578"},"es2015":{"files":{"index.js":{"size":11104,"offset":"11008865"},"text.js":{"size":11105,"offset":"11019969"}}}}},"fd-slicer":{"files":{"index.js":{"size":7756,"offset":"11031074"},"LICENSE":{"size":1057,"offset":"11038830"},"package.json":{"size":1047,"offset":"11039887"}}},"file-uri-to-path":{"files":{"index.js":{"size":1723,"offset":"11040934"},"LICENSE":{"size":1083,"offset":"11042657"},"package.json":{"size":717,"offset":"11043740"}}},"inherits":{"files":{"inherits.js":{"size":250,"offset":"11044457"},"inherits_browser.js":{"size":753,"offset":"11044707"},"LICENSE":{"size":749,"offset":"11045460"},"package.json":{"size":581,"offset":"11046209"}}},"is-fullwidth-code-point":{"files":{"index.js":{"size":1393,"offset":"11046790"},"license":{"size":1119,"offset":"11048183"},"package.json":{"size":788,"offset":"11049302"}}},"node-gyp-build":{"files":{"bin.js":{"size":1977,"offset":"11050090"},"build-test.js":{"size":398,"offset":"11052067"},"index.js":{"size":5859,"offset":"11052465"},"LICENSE":{"size":1079,"offset":"11058324"},"optional.js":{"size":143,"offset":"11059403"},"package.json":{"size":772,"offset":"11059546"}}},"node-gyp":{"files":{"addon.gypi":{"size":5425,"offset":"11060318"},"LICENSE":{"size":1102,"offset":"11065743"},"macOS_Catalina.md":{"size":6665,"offset":"11066845"},"macOS_Catalina_acid_test.sh":{"size":495,"offset":"11073510"},"package.json":{"size":1122,"offset":"11074005"},"SECURITY.md":{"size":151,"offset":"11075127"},"update-gyp.py":{"size":1618,"offset":"11075278"},"bin":{"files":{"node-gyp.js":{"size":3506,"offset":"11076896"}}},"lib":{"files":{"build.js":{"size":5504,"offset":"11080402"},"clean.js":{"size":355,"offset":"11085906"},"configure.js":{"size":9479,"offset":"11086261"},"create-config-gypi.js":{"size":4698,"offset":"11095740"},"find-node-directory.js":{"size":2373,"offset":"11100438"},"find-python.js":{"size":12133,"offset":"11102811"},"Find-VisualStudio.cs":{"size":7931,"offset":"11114944"},"find-visualstudio.js":{"size":14242,"offset":"11122875"},"install.js":{"size":12111,"offset":"11137117"},"list.js":{"size":641,"offset":"11149228"},"node-gyp.js":{"size":4893,"offset":"11149869"},"process-release.js":{"size":5787,"offset":"11154762"},"rebuild.js":{"size":314,"offset":"11160549"},"remove.js":{"size":1308,"offset":"11160863"},"util.js":{"size":1914,"offset":"11162171"}}},"gyp":{"files":{"AUTHORS":{"size":514,"offset":"11164085"},"gyp":{"size":240,"offset":"11164599"},"gyp.bat":{"size":201,"offset":"11164839"},"gyp_main.py":{"size":1250,"offset":"11165040"},"LICENSE":{"size":1537,"offset":"11166290"},"requirements_dev.txt":{"size":14,"offset":"11167827"},"setup.py":{"size":1443,"offset":"11167841"},"test_gyp.py":{"size":7660,"offset":"11169284"},"tools":{"files":{"graphviz.py":{"size":3063,"offset":"11177816"},"pretty_gyp.py":{"size":5028,"offset":"11180879"},"pretty_sln.py":{"size":5482,"offset":"11185907"},"pretty_vcproj.py":{"size":10633,"offset":"11191389"},"README":{"size":838,"offset":"11202022"},"emacs":{"files":{"gyp-tests.el":{"size":2182,"offset":"11994506"},"gyp.el":{"size":12181,"offset":"11996688"},"README":{"size":410,"offset":"12008869"},"run-unit-tests.sh":{"size":306,"offset":"12009279"},"testdata":{"files":{"media.gyp":{"size":37163,"offset":"12937167"},"media.gyp.fontified":{"size":162854,"offset":"12974330"}}}}},"Xcode":{"files":{"README":{"size":289,"offset":"12009585"},"Specifications":{"files":{"gyp.pbfilespec":{"size":701,"offset":"13137184"},"gyp.xclangspec":{"size":5088,"offset":"13137885"}}}}}}},"data":{"files":{"win":{"files":{"large-pdb-shim.cc":{"size":653,"offset":"11289193"}}}}},"pylib":{"files":{"gyp":{"files":{"common.py":{"size":22622,"offset":"11289846"},"common_test.py":{"size":2162,"offset":"11312468"},"easy_xml.py":{"size":5287,"offset":"11314630"},"easy_xml_test.py":{"size":3709,"offset":"11319917"},"flock_tool.py":{"size":1859,"offset":"11323626"},"input.py":{"size":127052,"offset":"11325485"},"input_test.py":{"size":3425,"offset":"11452537"},"mac_tool.py":{"size":30260,"offset":"11455962"},"MSVSNew.py":{"size":13095,"offset":"11486222"},"MSVSProject.py":{"size":6743,"offset":"11499317"},"MSVSSettings.py":{"size":45350,"offset":"11506060"},"MSVSSettings_test.py":{"size":74297,"offset":"11551410"},"MSVSToolFile.py":{"size":1789,"offset":"11625707"},"MSVSUserFile.py":{"size":5333,"offset":"11627496"},"MSVSUtil.py":{"size":10231,"offset":"11632829"},"MSVSVersion.py":{"size":19742,"offset":"11643060"},"msvs_emulation.py":{"size":54358,"offset":"11662802"},"ninja_syntax.py":{"size":5640,"offset":"11717160"},"simple_copy.py":{"size":1293,"offset":"11722800"},"win_tool.py":{"size":15164,"offset":"11724093"},"xcodeproj_file.py":{"size":135717,"offset":"11739257"},"xcode_emulation.py":{"size":81834,"offset":"11874974"},"xcode_ninja.py":{"size":12124,"offset":"11956808"},"xml_fix.py":{"size":2245,"offset":"11968932"},"__init__.py":{"size":23329,"offset":"11971177"},"generator":{"files":{"analyzer.py":{"size":31684,"offset":"12078548"},"android.py":{"size":49966,"offset":"12110232"},"cmake.py":{"size":49248,"offset":"12160198"},"compile_commands_json.py":{"size":4591,"offset":"12209446"},"dump_dependency_json.py":{"size":3101,"offset":"12214037"},"eclipse.py":{"size":17554,"offset":"12217138"},"gypd.py":{"size":3505,"offset":"12234692"},"gypsh.py":{"size":1713,"offset":"12238197"},"make.py":{"size":102224,"offset":"12239910"},"msvs.py":{"size":150465,"offset":"12342134"},"msvs_test.py":{"size":1266,"offset":"12492599"},"ninja.py":{"size":118398,"offset":"12493865"},"ninja_test.py":{"size":1910,"offset":"12612263"},"xcode.py":{"size":66115,"offset":"12614173"},"xcode_test.py":{"size":672,"offset":"12680288"},"__init__.py":{"size":0,"offset":"12680960"},"__pycache__":{"files":{"msvs.cpython-310.pyc":{"size":87213,"offset":"13183839"},"ninja.cpython-310.pyc":{"size":60047,"offset":"13271052"},"__init__.cpython-310.pyc":{"size":165,"offset":"13331099"}}}}},"__pycache__":{"files":{"common.cpython-310.pyc":{"size":15086,"offset":"12680960"},"easy_xml.cpython-310.pyc":{"size":4478,"offset":"12696046"},"input.cpython-310.pyc":{"size":51766,"offset":"12700524"},"MSVSNew.cpython-310.pyc":{"size":8418,"offset":"12752290"},"MSVSProject.cpython-310.pyc":{"size":5970,"offset":"12760708"},"MSVSSettings.cpython-310.pyc":{"size":29349,"offset":"12766678"},"MSVSToolFile.cpython-310.pyc":{"size":1813,"offset":"12796027"},"MSVSUserFile.cpython-310.pyc":{"size":4102,"offset":"12797840"},"MSVSUtil.cpython-310.pyc":{"size":6281,"offset":"12801942"},"MSVSVersion.cpython-310.pyc":{"size":12907,"offset":"12808223"},"msvs_emulation.cpython-310.pyc":{"size":41063,"offset":"12821130"},"ninja_syntax.cpython-310.pyc":{"size":4689,"offset":"12862193"},"simple_copy.cpython-310.pyc":{"size":1734,"offset":"12866882"},"xcode_emulation.cpython-310.pyc":{"size":55296,"offset":"12868616"},"__init__.cpython-310.pyc":{"size":13255,"offset":"12923912"}}}}}}}}},"src":{"files":{"win_delay_load_hook.cc":{"size":872,"offset":"11176944"}}},"node_modules":{"files":{"glob":{"files":{"changelog.md":{"size":1430,"offset":"11202860"},"common.js":{"size":6167,"offset":"11204290"},"glob.js":{"size":19433,"offset":"11210457"},"LICENSE":{"size":976,"offset":"11229890"},"package.json":{"size":1082,"offset":"11230866"},"sync.js":{"size":12002,"offset":"11231948"}}},"graceful-fs":{"files":{"clone.js":{"size":496,"offset":"11243950"},"graceful-fs.js":{"size":12164,"offset":"11244446"},"legacy-streams.js":{"size":2655,"offset":"11256610"},"LICENSE":{"size":781,"offset":"11259265"},"package.json":{"size":988,"offset":"11260046"},"polyfills.js":{"size":9771,"offset":"11261034"}}},"npmlog":{"files":{"LICENSE.md":{"size":798,"offset":"11270805"},"package.json":{"size":1102,"offset":"11271603"},"lib":{"files":{"log.js":{"size":9046,"offset":"12009874"}}}}},"rimraf":{"files":{"bin.js":{"size":1878,"offset":"11272705"},"LICENSE":{"size":765,"offset":"11274583"},"package.json":{"size":729,"offset":"11275348"},"rimraf.js":{"size":8866,"offset":"11276077"},"node_modules":{"files":{"glob":{"files":{"changelog.md":{"size":1430,"offset":"13142973"},"common.js":{"size":5996,"offset":"13144403"},"glob.js":{"size":19365,"offset":"13150399"},"LICENSE":{"size":976,"offset":"13169764"},"package.json":{"size":1165,"offset":"13170740"},"sync.js":{"size":11934,"offset":"13171905"}}}}}}},"semver":{"files":{"index.js":{"size":1982,"offset":"11284943"},"LICENSE":{"size":765,"offset":"11286925"},"package.json":{"size":815,"offset":"11287690"},"preload.js":{"size":69,"offset":"11288505"},"range.bnf":{"size":619,"offset":"11288574"},"bin":{"files":{"semver.js":{"size":4363,"offset":"12018920"}}},"classes":{"files":{"comparator.js":{"size":3606,"offset":"12023283"},"index.js":{"size":128,"offset":"12026889"},"range.js":{"size":13989,"offset":"12027017"},"semver.js":{"size":7985,"offset":"12041006"}}},"functions":{"files":{"clean.js":{"size":191,"offset":"12048991"},"cmp.js":{"size":907,"offset":"12049182"},"coerce.js":{"size":1497,"offset":"12050089"},"compare-build.js":{"size":267,"offset":"12051586"},"compare-loose.js":{"size":118,"offset":"12051853"},"compare.js":{"size":156,"offset":"12051971"},"diff.js":{"size":634,"offset":"12052127"},"eq.js":{"size":112,"offset":"12052761"},"gt.js":{"size":110,"offset":"12052873"},"gte.js":{"size":113,"offset":"12052983"},"inc.js":{"size":336,"offset":"12053096"},"lt.js":{"size":110,"offset":"12053432"},"lte.js":{"size":113,"offset":"12053542"},"major.js":{"size":122,"offset":"12053655"},"minor.js":{"size":122,"offset":"12053777"},"neq.js":{"size":114,"offset":"12053899"},"parse.js":{"size":660,"offset":"12054013"},"patch.js":{"size":122,"offset":"12054673"},"prerelease.js":{"size":220,"offset":"12054795"},"rcompare.js":{"size":118,"offset":"12055015"},"rsort.js":{"size":149,"offset":"12055133"},"satisfies.js":{"size":233,"offset":"12055282"},"sort.js":{"size":147,"offset":"12055515"},"valid.js":{"size":162,"offset":"12055662"}}},"internal":{"files":{"constants.js":{"size":468,"offset":"12055824"},"debug.js":{"size":226,"offset":"12056292"},"identifiers.js":{"size":409,"offset":"12056518"},"parse-options.js":{"size":401,"offset":"12056927"},"re.js":{"size":6662,"offset":"12057328"}}},"ranges":{"files":{"gtr.js":{"size":217,"offset":"12063990"},"intersects.js":{"size":201,"offset":"12064207"},"ltr.js":{"size":213,"offset":"12064408"},"max-satisfying.js":{"size":579,"offset":"12064621"},"min-satisfying.js":{"size":577,"offset":"12065200"},"min-version.js":{"size":1492,"offset":"12065777"},"outside.js":{"size":2188,"offset":"12067269"},"simplify.js":{"size":1287,"offset":"12069457"},"subset.js":{"size":7224,"offset":"12070744"},"to-comparators.js":{"size":268,"offset":"12077968"},"valid.js":{"size":312,"offset":"12078236"}}}}}}}}},"proxy-from-env":{"files":{"index.js":{"size":3348,"offset":"13331264"},"LICENSE":{"size":1087,"offset":"13334612"},"package.json":{"size":956,"offset":"13335699"},"test.js":{"size":17720,"offset":"13336655"}}},"socks-proxy-agent":{"files":{"package.json":{"size":1591,"offset":"13354375"},"dist":{"files":{"agent.js":{"size":6237,"offset":"13355966"},"index.js":{"size":703,"offset":"13362203"}}},"node_modules":{"files":{"debug":{"files":{"LICENSE":{"size":1107,"offset":"13362906"},"package.json":{"size":1746,"offset":"13364013"},"dist":{"files":{"debug.js":{"size":27572,"offset":"13365759"}}},"src":{"files":{"browser.js":{"size":5831,"offset":"13393331"},"common.js":{"size":5930,"offset":"13399162"},"index.js":{"size":314,"offset":"13405092"},"node.js":{"size":4475,"offset":"13405406"}}}}}}}}},"string_decoder":{"files":{"LICENSE":{"size":2338,"offset":"13409881"},"package.json":{"size":823,"offset":"13412219"},"lib":{"files":{"string_decoder.js":{"size":9465,"offset":"13413042"}}}}},"util-deprecate":{"files":{"browser.js":{"size":1614,"offset":"13422507"},"LICENSE":{"size":1102,"offset":"13424121"},"node.js":{"size":123,"offset":"13425223"},"package.json":{"size":694,"offset":"13425346"}}},"vscode-windows-ca-certs":{"files":{"package.json":{"size":960,"offset":"13426040"},"build":{"files":{"Release":{"files":{"crypt32.node":{"size":668672,"unpacked":true}}}}}}},"yallist":{"files":{"iterator.js":{"size":207,"offset":"13427000"},"LICENSE":{"size":765,"offset":"13427207"},"package.json":{"size":652,"offset":"13427972"},"yallist.js":{"size":8411,"offset":"13428624"}}},"commander":{"files":{"index.js":{"size":27849,"offset":"13437035"},"LICENSE":{"size":1098,"offset":"13464884"},"package.json":{"size":864,"offset":"13465982"},"Readme.md":{"size":12783,"offset":"13466846"}}},"detect-libc":{"files":{"LICENSE":{"size":11357,"offset":"13479629"},"package.json":{"size":817,"offset":"13490986"},"lib":{"files":{"detect-libc.js":{"size":3916,"offset":"13491803"},"process.js":{"size":315,"offset":"13495719"}}}}},"env-paths":{"files":{"index.js":{"size":2155,"offset":"13496034"},"license":{"size":1109,"offset":"13498189"},"package.json":{"size":698,"offset":"13499298"}}},"es6-promisify":{"files":{"package.json":{"size":946,"offset":"13499996"},"dist":{"files":{"promise.js":{"size":1987,"offset":"13500942"},"promisify.js":{"size":2950,"offset":"13502929"}}}}},"expand-template":{"files":{"index.js":{"size":672,"offset":"13505879"},"LICENSE":{"size":1082,"offset":"13506551"},"package.json":{"size":647,"offset":"13507633"},"test.js":{"size":1762,"offset":"13508280"}}},"github-from-package":{"files":{"index.js":{"size":406,"offset":"13510042"},"LICENSE":{"size":1073,"offset":"13510448"},"package.json":{"size":753,"offset":"13511521"}}},"glob":{"files":{"common.js":{"size":6155,"offset":"13512274"},"glob.js":{"size":18625,"offset":"13518429"},"LICENSE":{"size":765,"offset":"13537054"},"package.json":{"size":985,"offset":"13537819"},"sync.js":{"size":11461,"offset":"13538804"}}},"make-fetch-happen":{"files":{"LICENSE":{"size":765,"offset":"13550265"},"package.json":{"size":1779,"offset":"13551030"},"lib":{"files":{"agent.js":{"size":5543,"offset":"13552809"},"fetch.js":{"size":3947,"offset":"13558352"},"index.js":{"size":1055,"offset":"13562299"},"options.js":{"size":1356,"offset":"13563354"},"remote.js":{"size":3489,"offset":"13564710"},"cache":{"files":{"entry.js":{"size":17089,"offset":"13568199"},"errors.js":{"size":284,"offset":"13585288"},"index.js":{"size":1786,"offset":"13585572"},"key.js":{"size":430,"offset":"13587358"},"policy.js":{"size":4527,"offset":"13587788"}}}}},"node_modules":{"files":{"cacache":{"files":{"LICENSE.md":{"size":755,"offset":"13592315"},"package.json":{"size":2158,"offset":"13593070"},"lib":{"files":{"entry-index.js":{"size":11221,"offset":"13722920"},"get.js":{"size":6319,"offset":"13734141"},"index.js":{"size":1383,"offset":"13740460"},"memoization.js":{"size":1471,"offset":"13741843"},"put.js":{"size":2055,"offset":"13743314"},"rm.js":{"size":664,"offset":"13745369"},"verify.js":{"size":7986,"offset":"13746033"},"content":{"files":{"path.js":{"size":737,"offset":"13901922"},"read.js":{"size":6560,"offset":"13902659"},"rm.js":{"size":511,"offset":"13909219"},"write.js":{"size":5205,"offset":"13909730"}}},"util":{"files":{"disposer.js":{"size":812,"offset":"13914935"},"fix-owner.js":{"size":3503,"offset":"13915747"},"hash-to-segments.js":{"size":143,"offset":"13919250"},"move-file.js":{"size":2407,"offset":"13919393"},"tmp.js":{"size":839,"offset":"13921800"}}}}}}},"debug":{"files":{"LICENSE":{"size":1107,"offset":"13595228"},"package.json":{"size":1746,"offset":"13596335"},"dist":{"files":{"debug.js":{"size":27572,"offset":"13754019"}}},"src":{"files":{"browser.js":{"size":5831,"offset":"13781591"},"common.js":{"size":5930,"offset":"13787422"},"index.js":{"size":314,"offset":"13793352"},"node.js":{"size":4475,"offset":"13793666"}}},"node_modules":{"files":{"ms":{"files":{"index.js":{"size":3024,"offset":"13922639"},"license.md":{"size":1079,"offset":"13925663"},"package.json":{"size":732,"offset":"13926742"}}}}}}},"glob":{"files":{"common.js":{"size":6048,"offset":"13598081"},"glob.js":{"size":19362,"offset":"13604129"},"LICENSE":{"size":976,"offset":"13623491"},"package.json":{"size":1188,"offset":"13624467"},"sync.js":{"size":11931,"offset":"13625655"}}},"http-proxy-agent":{"files":{"package.json":{"size":1425,"offset":"13637586"},"dist":{"files":{"agent.js":{"size":6762,"offset":"13798141"},"index.js":{"size":725,"offset":"13804903"}}}}},"https-proxy-agent":{"files":{"package.json":{"size":1405,"offset":"13639011"},"dist":{"files":{"agent.js":{"size":8115,"offset":"13805628"},"index.js":{"size":734,"offset":"13813743"},"parse-proxy-response.js":{"size":2615,"offset":"13814477"}}}}},"ip":{"files":{"package.json":{"size":560,"offset":"13640416"},"lib":{"files":{"ip.js":{"size":10251,"offset":"13817092"}}}}},"lru-cache":{"files":{"index.js":{"size":20864,"offset":"13640976"},"LICENSE":{"size":775,"offset":"13661840"},"package.json":{"size":907,"offset":"13662615"}}},"minipass":{"files":{"index.js":{"size":14799,"offset":"13663522"},"LICENSE":{"size":756,"offset":"13678321"},"package.json":{"size":808,"offset":"13679077"}}},"ms":{"files":{"index.js":{"size":3023,"offset":"13679885"},"license.md":{"size":1077,"offset":"13682908"},"package.json":{"size":705,"offset":"13683985"}}},"negotiator":{"files":{"HISTORY.md":{"size":2499,"offset":"13684690"},"index.js":{"size":2451,"offset":"13687189"},"LICENSE":{"size":1177,"offset":"13689640"},"package.json":{"size":993,"offset":"13690817"},"lib":{"files":{"charset.js":{"size":3081,"offset":"13827343"},"encoding.js":{"size":3506,"offset":"13830424"},"language.js":{"size":3409,"offset":"13833930"},"mediaType.js":{"size":5358,"offset":"13837339"}}}}},"rimraf":{"files":{"bin.js":{"size":1878,"offset":"13691810"},"LICENSE":{"size":765,"offset":"13693688"},"package.json":{"size":729,"offset":"13694453"},"rimraf.js":{"size":8866,"offset":"13695182"},"node_modules":{"files":{"glob":{"files":{"changelog.md":{"size":1430,"offset":"13927474"},"common.js":{"size":5996,"offset":"13928904"},"glob.js":{"size":19365,"offset":"13934900"},"LICENSE":{"size":976,"offset":"13954265"},"package.json":{"size":1165,"offset":"13955241"},"sync.js":{"size":11934,"offset":"13956406"}}}}}}},"smart-buffer":{"files":{"LICENSE":{"size":1087,"offset":"13704048"},"package.json":{"size":1969,"offset":"13705135"},"build":{"files":{"smartbuffer.js":{"size":44651,"offset":"13842697"},"utils.js":{"size":4424,"offset":"13887348"}}}}},"socks-proxy-agent":{"files":{"package.json":{"size":4467,"offset":"13707104"},"dist":{"files":{"index.js":{"size":7613,"offset":"13891772"}}},"node_modules":{"files":{"agent-base":{"files":{"package.json":{"size":1635,"offset":"13968340"},"dist":{"files":{"src":{"files":{"index.js":{"size":8093,"offset":"14041237"},"promisify.js":{"size":678,"offset":"14049330"}}}}},"node_modules":{"files":{"ms":{"files":{"index.js":{"size":3024,"offset":"14050008"},"license.md":{"size":1079,"offset":"14053032"},"package.json":{"size":732,"offset":"14054111"}}},"debug":{"files":{"LICENSE":{"size":1107,"offset":"14054843"},"package.json":{"size":1746,"offset":"14055950"},"src":{"files":{"browser.js":{"size":5831,"offset":"14057696"},"common.js":{"size":5930,"offset":"14063527"},"index.js":{"size":314,"offset":"14069457"},"node.js":{"size":4475,"offset":"14069771"}}},"dist":{"files":{"debug.js":{"size":27572,"offset":"14074246"}}}}}}}}},"debug":{"files":{"LICENSE":{"size":1139,"offset":"13969975"},"package.json":{"size":1419,"offset":"13971114"},"src":{"files":{"browser.js":{"size":6010,"offset":"14023939"},"common.js":{"size":6289,"offset":"14029949"},"index.js":{"size":314,"offset":"14036238"},"node.js":{"size":4685,"offset":"14036552"}}}}}}}}},"socks":{"files":{"LICENSE":{"size":1082,"offset":"13711571"},"package.json":{"size":1609,"offset":"13712653"},"build":{"files":{"index.js":{"size":990,"offset":"13899385"},"client":{"files":{"socksclient.js":{"size":35606,"offset":"13972533"}}},"common":{"files":{"constants.js":{"size":7594,"offset":"14008139"},"helpers.js":{"size":5657,"offset":"14015733"},"receivebuffer.js":{"size":1700,"offset":"14021390"},"util.js":{"size":849,"offset":"14023090"}}}}}}},"@npmcli":{"files":{"move-file":{"files":{"index.js":{"size":4630,"offset":"13714262"},"LICENSE.md":{"size":1141,"offset":"13718892"},"package.json":{"size":665,"offset":"13720033"}}}}},"@tootallnate":{"files":{"once":{"files":{"LICENSE":{"size":1071,"offset":"13720698"},"package.json":{"size":1151,"offset":"13721769"},"dist":{"files":{"index.js":{"size":1001,"offset":"13900375"},"overloaded-parameters.js":{"size":281,"offset":"13901376"},"types.js":{"size":265,"offset":"13901657"}}}}}}}}}}},"mkdirp-classic":{"files":{"index.js":{"size":2630,"offset":"14101818"},"LICENSE":{"size":1118,"offset":"14104448"},"package.json":{"size":471,"offset":"14105566"}}},"napi-build-utils":{"files":{"index.js":{"size":7206,"offset":"14106037"},"index.md":{"size":3767,"offset":"14113243"},"LICENSE":{"size":1069,"offset":"14117010"},"package.json":{"size":1047,"offset":"14118079"}}},"node-abi":{"files":{"abi_registry.json":{"size":3092,"offset":"14119126"},"index.js":{"size":6488,"offset":"14122218"},"LICENSE":{"size":1069,"offset":"14128706"},"package.json":{"size":932,"offset":"14129775"},"scripts":{"files":{"update-abi-registry.js":{"size":3318,"offset":"14130707"}}},"node_modules":{"files":{"semver":{"files":{"index.js":{"size":1982,"offset":"14134025"},"LICENSE":{"size":765,"offset":"14136007"},"package.json":{"size":815,"offset":"14136772"},"preload.js":{"size":69,"offset":"14137587"},"range.bnf":{"size":619,"offset":"14137656"},"bin":{"files":{"semver.js":{"size":4363,"offset":"14138275"}}},"classes":{"files":{"comparator.js":{"size":3606,"offset":"14142638"},"index.js":{"size":128,"offset":"14146244"},"range.js":{"size":13989,"offset":"14146372"},"semver.js":{"size":7985,"offset":"14160361"}}},"functions":{"files":{"clean.js":{"size":191,"offset":"14168346"},"cmp.js":{"size":907,"offset":"14168537"},"coerce.js":{"size":1497,"offset":"14169444"},"compare-build.js":{"size":267,"offset":"14170941"},"compare-loose.js":{"size":118,"offset":"14171208"},"compare.js":{"size":156,"offset":"14171326"},"diff.js":{"size":634,"offset":"14171482"},"eq.js":{"size":112,"offset":"14172116"},"gt.js":{"size":110,"offset":"14172228"},"gte.js":{"size":113,"offset":"14172338"},"inc.js":{"size":336,"offset":"14172451"},"lt.js":{"size":110,"offset":"14172787"},"lte.js":{"size":113,"offset":"14172897"},"major.js":{"size":122,"offset":"14173010"},"minor.js":{"size":122,"offset":"14173132"},"neq.js":{"size":114,"offset":"14173254"},"parse.js":{"size":660,"offset":"14173368"},"patch.js":{"size":122,"offset":"14174028"},"prerelease.js":{"size":220,"offset":"14174150"},"rcompare.js":{"size":118,"offset":"14174370"},"rsort.js":{"size":149,"offset":"14174488"},"satisfies.js":{"size":233,"offset":"14174637"},"sort.js":{"size":147,"offset":"14174870"},"valid.js":{"size":162,"offset":"14175017"}}},"internal":{"files":{"constants.js":{"size":468,"offset":"14175179"},"debug.js":{"size":226,"offset":"14175647"},"identifiers.js":{"size":409,"offset":"14175873"},"parse-options.js":{"size":401,"offset":"14176282"},"re.js":{"size":6662,"offset":"14176683"}}},"ranges":{"files":{"gtr.js":{"size":217,"offset":"14183345"},"intersects.js":{"size":201,"offset":"14183562"},"ltr.js":{"size":213,"offset":"14183763"},"max-satisfying.js":{"size":579,"offset":"14183976"},"min-satisfying.js":{"size":577,"offset":"14184555"},"min-version.js":{"size":1492,"offset":"14185132"},"outside.js":{"size":2188,"offset":"14186624"},"simplify.js":{"size":1287,"offset":"14188812"},"subset.js":{"size":7224,"offset":"14190099"},"to-comparators.js":{"size":268,"offset":"14197323"},"valid.js":{"size":312,"offset":"14197591"}}}}}}}}},"nopt":{"files":{"LICENSE":{"size":765,"offset":"14197903"},"package.json":{"size":714,"offset":"14198668"},"bin":{"files":{"nopt.js":{"size":1549,"offset":"14199382"}}},"lib":{"files":{"nopt.js":{"size":12220,"offset":"14200931"}}}}},"npmlog":{"files":{"LICENSE":{"size":765,"offset":"14213151"},"log.js":{"size":8615,"offset":"14213916"},"package.json":{"size":593,"offset":"14222531"},"node_modules":{"files":{"are-we-there-yet":{"files":{"CHANGES.md":{"size":1324,"offset":"14223124"},"index.js":{"size":163,"offset":"14224448"},"LICENSE":{"size":733,"offset":"14224611"},"package.json":{"size":834,"offset":"14225344"},"tracker-base.js":{"size":274,"offset":"14226178"},"tracker-group.js":{"size":3231,"offset":"14226452"},"tracker-stream.js":{"size":963,"offset":"14229683"},"tracker.js":{"size":826,"offset":"14230646"}}},"is-fullwidth-code-point":{"files":{"index.js":{"size":1463,"offset":"14231472"},"license":{"size":1119,"offset":"14232935"},"package.json":{"size":837,"offset":"14234054"}}},"gauge":{"files":{"base-theme.js":{"size":395,"offset":"14234891"},"error.js":{"size":616,"offset":"14235286"},"has-color.js":{"size":292,"offset":"14235902"},"index.js":{"size":6999,"offset":"14236194"},"LICENSE":{"size":751,"offset":"14243193"},"package.json":{"size":1383,"offset":"14243944"},"plumbing.js":{"size":1269,"offset":"14245327"},"process.js":{"size":89,"offset":"14246596"},"progress-bar.js":{"size":998,"offset":"14246685"},"render-template.js":{"size":5739,"offset":"14247683"},"set-immediate.js":{"size":139,"offset":"14253422"},"set-interval.js":{"size":93,"offset":"14253561"},"spin.js":{"size":105,"offset":"14253654"},"template-item.js":{"size":1904,"offset":"14253759"},"theme-set.js":{"size":3693,"offset":"14255663"},"themes.js":{"size":1543,"offset":"14259356"},"wide-truncate.js":{"size":828,"offset":"14260899"}}},"string-width":{"files":{"index.js":{"size":741,"offset":"14261727"},"license":{"size":1119,"offset":"14262468"},"package.json":{"size":1003,"offset":"14263587"}}}}}}},"pend":{"files":{"index.js":{"size":1101,"offset":"14264590"},"LICENSE":{"size":1082,"offset":"14265691"},"package.json":{"size":410,"offset":"14266773"},"test.js":{"size":2449,"offset":"14267183"}}},"pump":{"files":{"index.js":{"size":2078,"offset":"14269632"},"LICENSE":{"size":1078,"offset":"14271710"},"package.json":{"size":501,"offset":"14272788"},"test-browser.js":{"size":1030,"offset":"14273289"},"test.js":{"size":845,"offset":"14274319"}}},"rc":{"files":{"browser.js":{"size":137,"offset":"14275164"},"cli.js":{"size":109,"offset":"14275301"},"index.js":{"size":1503,"offset":"14275410"},"LICENSE.APACHE2":{"size":586,"offset":"14276913"},"LICENSE.BSD":{"size":1516,"offset":"14277499"},"LICENSE.MIT":{"size":1088,"offset":"14279015"},"package.json":{"size":695,"offset":"14280103"},"lib":{"files":{"utils.js":{"size":2759,"offset":"14280798"}}},"node_modules":{"files":{"strip-json-comments":{"files":{"index.js":{"size":1700,"offset":"14283557"},"license":{"size":1119,"offset":"14285257"},"package.json":{"size":749,"offset":"14286376"}}}}}}},"rimraf":{"files":{"bin.js":{"size":1196,"offset":"14287125"},"LICENSE":{"size":765,"offset":"14288321"},"package.json":{"size":677,"offset":"14289086"},"rimraf.js":{"size":9225,"offset":"14289763"},"node_modules":{"files":{"glob":{"files":{"changelog.md":{"size":1430,"offset":"14298988"},"common.js":{"size":5996,"offset":"14300418"},"glob.js":{"size":19365,"offset":"14306414"},"LICENSE":{"size":976,"offset":"14325779"},"package.json":{"size":1165,"offset":"14326755"},"sync.js":{"size":11934,"offset":"14327920"}}}}}}},"semver":{"files":{"LICENSE":{"size":765,"offset":"14339854"},"package.json":{"size":578,"offset":"14340619"},"range.bnf":{"size":619,"offset":"14341197"},"semver.js":{"size":38803,"offset":"14341816"},"bin":{"files":{"semver":{"size":4418,"offset":"14380619"}}}}},"simple-get":{"files":{"index.js":{"size":4057,"offset":"14385037"},"LICENSE":{"size":1081,"offset":"14389094"},"package.json":{"size":1444,"offset":"14390175"},"node_modules":{"files":{"decompress-response":{"files":{"index.js":{"size":1320,"offset":"14391619"},"license":{"size":1117,"offset":"14392939"},"package.json":{"size":985,"offset":"14394056"}}},"mimic-response":{"files":{"index.js":{"size":1581,"offset":"14395041"},"license":{"size":1117,"offset":"14396622"},"package.json":{"size":768,"offset":"14397739"}}}}}}},"socks":{"files":{"LICENSE":{"size":1082,"offset":"14398507"},"package.json":{"size":2122,"offset":"14399589"},"build":{"files":{"index.js":{"size":791,"offset":"14401711"},"client":{"files":{"socksclient.js":{"size":35129,"offset":"14402502"}}},"common":{"files":{"constants.js":{"size":7563,"offset":"14437631"},"helpers.js":{"size":5626,"offset":"14445194"},"receivebuffer.js":{"size":1669,"offset":"14450820"},"util.js":{"size":873,"offset":"14452489"}}}}}}},"tar-fs":{"files":{"index.js":{"size":9587,"offset":"14453362"},"LICENSE":{"size":1078,"offset":"14462949"},"package.json":{"size":828,"offset":"14464027"},"node_modules":{"files":{"chownr":{"files":{"chownr.js":{"size":4275,"offset":"14464855"},"LICENSE":{"size":765,"offset":"14469130"},"package.json":{"size":610,"offset":"14469895"}}},"pump":{"files":{"index.js":{"size":2224,"offset":"14470505"},"LICENSE":{"size":1078,"offset":"14472729"},"package.json":{"size":530,"offset":"14473807"},"test-browser.js":{"size":1172,"offset":"14474337"},"test-node.js":{"size":992,"offset":"14475509"}}},"readable-stream":{"files":{"errors-browser.js":{"size":4197,"offset":"14476501"},"errors.js":{"size":3715,"offset":"14480698"},"experimentalWarning.js":{"size":460,"offset":"14484413"},"GOVERNANCE.md":{"size":5550,"offset":"14484873"},"LICENSE":{"size":2337,"offset":"14490423"},"package.json":{"size":1886,"offset":"14492760"},"readable-browser.js":{"size":488,"offset":"14494646"},"readable.js":{"size":729,"offset":"14495134"},"lib":{"files":{"_stream_duplex.js":{"size":4399,"offset":"14518291"},"_stream_passthrough.js":{"size":1630,"offset":"14522690"},"_stream_readable.js":{"size":35972,"offset":"14524320"},"_stream_transform.js":{"size":7947,"offset":"14560292"},"_stream_writable.js":{"size":21821,"offset":"14568239"},"internal":{"files":{"streams":{"files":{"async_iterator.js":{"size":5957,"offset":"14590060"},"buffer_list.js":{"size":6335,"offset":"14596017"},"destroy.js":{"size":3117,"offset":"14602352"},"end-of-stream.js":{"size":3102,"offset":"14605469"},"from-browser.js":{"size":101,"offset":"14608571"},"from.js":{"size":3137,"offset":"14608672"},"pipeline.js":{"size":2428,"offset":"14611809"},"state.js":{"size":749,"offset":"14614237"},"stream-browser.js":{"size":49,"offset":"14614986"},"stream.js":{"size":36,"offset":"14615035"}}}}}}}}},"tar-stream":{"files":{"extract.js":{"size":5960,"offset":"14495863"},"headers.js":{"size":7969,"offset":"14501823"},"index.js":{"size":72,"offset":"14509792"},"LICENSE":{"size":1078,"offset":"14509864"},"pack.js":{"size":5626,"offset":"14510942"},"package.json":{"size":1352,"offset":"14516568"},"sandbox.js":{"size":371,"offset":"14517920"}}}}}}},"tar":{"files":{"index.js":{"size":683,"offset":"14615071"},"LICENSE":{"size":765,"offset":"14615754"},"package.json":{"size":1603,"offset":"14616519"},"lib":{"files":{"create.js":{"size":2351,"offset":"14618122"},"extract.js":{"size":2804,"offset":"14620473"},"get-write-flag.js":{"size":921,"offset":"14623277"},"header.js":{"size":8979,"offset":"14624198"},"high-level-opt.js":{"size":760,"offset":"14633177"},"large-numbers.js":{"size":2179,"offset":"14633937"},"list.js":{"size":3166,"offset":"14636116"},"mkdir.js":{"size":5337,"offset":"14639282"},"mode-fix.js":{"size":619,"offset":"14644619"},"normalize-unicode.js":{"size":405,"offset":"14645238"},"normalize-windows-path.js":{"size":410,"offset":"14645643"},"pack.js":{"size":9443,"offset":"14646053"},"parse.js":{"size":14189,"offset":"14655496"},"path-reservations.js":{"size":4306,"offset":"14669685"},"pax.js":{"size":4017,"offset":"14673991"},"read-entry.js":{"size":2780,"offset":"14678008"},"replace.js":{"size":5477,"offset":"14680788"},"strip-absolute-path.js":{"size":918,"offset":"14686265"},"strip-trailing-slashes.js":{"size":394,"offset":"14687183"},"types.js":{"size":1096,"offset":"14687577"},"unpack.js":{"size":25047,"offset":"14688673"},"update.js":{"size":842,"offset":"14713720"},"warn-mixin.js":{"size":697,"offset":"14714562"},"winchars.js":{"size":535,"offset":"14715259"},"write-entry.js":{"size":15111,"offset":"14715794"}}}}},"tunnel-agent":{"files":{"index.js":{"size":6884,"offset":"14730905"},"LICENSE":{"size":9140,"offset":"14737789"},"package.json":{"size":542,"offset":"14746929"}}},"which":{"files":{"LICENSE":{"size":765,"offset":"14747471"},"package.json":{"size":1043,"offset":"14748236"},"which.js":{"size":3163,"offset":"14749279"},"bin":{"files":{"node-which":{"size":985,"offset":"14752442"}}}}},"ws":{"files":{"browser.js":{"size":176,"offset":"14753427"},"index.js":{"size":296,"offset":"14753603"},"LICENSE":{"size":1106,"offset":"14753899"},"package.json":{"size":1463,"offset":"14755005"},"lib":{"files":{"buffer-util.js":{"size":3044,"offset":"14756468"},"constants.js":{"size":268,"offset":"14759512"},"event-target.js":{"size":4396,"offset":"14759780"},"extension.js":{"size":6883,"offset":"14764176"},"limiter.js":{"size":1034,"offset":"14771059"},"permessage-deflate.js":{"size":14255,"offset":"14772093"},"receiver.js":{"size":12431,"offset":"14786348"},"sender.js":{"size":10679,"offset":"14798779"},"stream.js":{"size":3938,"offset":"14809458"},"validation.js":{"size":2494,"offset":"14813396"},"websocket-server.js":{"size":11768,"offset":"14815890"},"websocket.js":{"size":25137,"offset":"14827658"}}}}},"abbrev":{"files":{"abbrev.js":{"size":1763,"offset":"14852795"},"LICENSE":{"size":2011,"offset":"14854558"},"package.json":{"size":509,"offset":"14856569"}}},"agentkeepalive":{"files":{"browser.js":{"size":144,"offset":"14857078"},"index.js":{"size":169,"offset":"14857222"},"LICENSE":{"size":1144,"offset":"14857391"},"package.json":{"size":1471,"offset":"14858535"},"lib":{"files":{"agent.js":{"size":15228,"offset":"14860006"},"constants.js":{"size":559,"offset":"14875234"},"https_agent.js":{"size":1244,"offset":"14875793"}}},"node_modules":{"files":{"depd":{"files":{"index.js":{"size":10669,"offset":"14877037"},"LICENSE":{"size":1094,"offset":"14887706"},"package.json":{"size":1135,"offset":"14888800"},"Readme.md":{"size":10025,"offset":"14889935"},"lib":{"files":{"browser":{"files":{"index.js":{"size":1512,"offset":"14899960"}}},"compat":{"files":{"callsite-tostring.js":{"size":2229,"offset":"14901472"},"event-listener-count.js":{"size":338,"offset":"14903701"},"index.js":{"size":1421,"offset":"14904039"}}}}}}}}}}},"are-we-there-yet":{"files":{"LICENSE.md":{"size":717,"offset":"14905460"},"package.json":{"size":1400,"offset":"14906177"},"lib":{"files":{"index.js":{"size":163,"offset":"14907577"},"tracker-base.js":{"size":274,"offset":"14907740"},"tracker-group.js":{"size":3281,"offset":"14908014"},"tracker-stream.js":{"size":963,"offset":"14911295"},"tracker.js":{"size":836,"offset":"14912258"}}},"node_modules":{"files":{"readable-stream":{"files":{"errors-browser.js":{"size":4197,"offset":"14913094"},"errors.js":{"size":3715,"offset":"14917291"},"experimentalWarning.js":{"size":460,"offset":"14921006"},"GOVERNANCE.md":{"size":5550,"offset":"14921466"},"LICENSE":{"size":2337,"offset":"14927016"},"package.json":{"size":1886,"offset":"14929353"},"readable-browser.js":{"size":488,"offset":"14931239"},"readable.js":{"size":729,"offset":"14931727"},"lib":{"files":{"_stream_duplex.js":{"size":4399,"offset":"14932456"},"_stream_passthrough.js":{"size":1630,"offset":"14936855"},"_stream_readable.js":{"size":35972,"offset":"14938485"},"_stream_transform.js":{"size":7947,"offset":"14974457"},"_stream_writable.js":{"size":21821,"offset":"14982404"},"internal":{"files":{"streams":{"files":{"async_iterator.js":{"size":5957,"offset":"15004225"},"buffer_list.js":{"size":6335,"offset":"15010182"},"destroy.js":{"size":3117,"offset":"15016517"},"end-of-stream.js":{"size":3102,"offset":"15019634"},"from-browser.js":{"size":101,"offset":"15022736"},"from.js":{"size":3137,"offset":"15022837"},"pipeline.js":{"size":2428,"offset":"15025974"},"state.js":{"size":749,"offset":"15028402"},"stream-browser.js":{"size":49,"offset":"15029151"},"stream.js":{"size":36,"offset":"15029200"}}}}}}}}}}}}},"cacache":{"files":{"get.js":{"size":6732,"offset":"15029236"},"index.js":{"size":1253,"offset":"15035968"},"LICENSE.md":{"size":755,"offset":"15037221"},"ls.js":{"size":123,"offset":"15037976"},"package.json":{"size":2200,"offset":"15038099"},"put.js":{"size":2062,"offset":"15040299"},"rm.js":{"size":664,"offset":"15042361"},"verify.js":{"size":55,"offset":"15043025"},"lib":{"files":{"entry-index.js":{"size":7706,"offset":"15043080"},"memoization.js":{"size":1486,"offset":"15050786"},"verify.js":{"size":7975,"offset":"15052272"},"content":{"files":{"path.js":{"size":737,"offset":"15060247"},"read.js":{"size":6501,"offset":"15060984"},"rm.js":{"size":511,"offset":"15067485"},"write.js":{"size":5136,"offset":"15067996"}}},"util":{"files":{"disposer.js":{"size":811,"offset":"15073132"},"fix-owner.js":{"size":3500,"offset":"15073943"},"hash-to-segments.js":{"size":143,"offset":"15077443"},"move-file.js":{"size":2406,"offset":"15077586"},"tmp.js":{"size":800,"offset":"15079992"}}}}},"node_modules":{"files":{"glob":{"files":{"changelog.md":{"size":1430,"offset":"15080792"},"common.js":{"size":6167,"offset":"15082222"},"glob.js":{"size":19433,"offset":"15088389"},"LICENSE":{"size":976,"offset":"15107822"},"package.json":{"size":1082,"offset":"15108798"},"sync.js":{"size":12002,"offset":"15109880"}}},"tar":{"files":{"index.js":{"size":683,"offset":"15121882"},"LICENSE":{"size":765,"offset":"15122565"},"package.json":{"size":1155,"offset":"15123330"},"lib":{"files":{"create.js":{"size":2374,"offset":"15136723"},"extract.js":{"size":2824,"offset":"15139097"},"get-write-flag.js":{"size":921,"offset":"15141921"},"header.js":{"size":9006,"offset":"15142842"},"high-level-opt.js":{"size":772,"offset":"15151848"},"large-numbers.js":{"size":2198,"offset":"15152620"},"list.js":{"size":3113,"offset":"15154818"},"mkdir.js":{"size":5211,"offset":"15157931"},"mode-fix.js":{"size":624,"offset":"15163142"},"pack.js":{"size":9658,"offset":"15163766"},"parse.js":{"size":14236,"offset":"15173424"},"path-reservations.js":{"size":3318,"offset":"15187660"},"pax.js":{"size":4032,"offset":"15190978"},"read-entry.js":{"size":2673,"offset":"15195010"},"replace.js":{"size":5454,"offset":"15197683"},"types.js":{"size":1095,"offset":"15203137"},"unpack.js":{"size":18814,"offset":"15204232"},"update.js":{"size":852,"offset":"15223046"},"warn-mixin.js":{"size":701,"offset":"15223898"},"winchars.js":{"size":533,"offset":"15224599"},"write-entry.js":{"size":12680,"offset":"15225132"}}}}},"rimraf":{"files":{"bin.js":{"size":1878,"offset":"15124485"},"LICENSE":{"size":765,"offset":"15126363"},"package.json":{"size":729,"offset":"15127128"},"rimraf.js":{"size":8866,"offset":"15127857"},"node_modules":{"files":{"glob":{"files":{"changelog.md":{"size":1430,"offset":"15237812"},"common.js":{"size":5996,"offset":"15239242"},"glob.js":{"size":19365,"offset":"15245238"},"LICENSE":{"size":976,"offset":"15264603"},"package.json":{"size":1165,"offset":"15265579"},"sync.js":{"size":11934,"offset":"15266744"}}}}}}}}}}},"console-control-strings":{"files":{"index.js":{"size":2339,"offset":"15278678"},"LICENSE":{"size":751,"offset":"15281017"},"package.json":{"size":791,"offset":"15281768"},"README.md~":{"size":4313,"offset":"15282559"}}},"decompress-response":{"files":{"index.js":{"size":628,"offset":"15286872"},"license":{"size":1120,"offset":"15287500"},"package.json":{"size":951,"offset":"15288620"}}},"deep-extend":{"files":{"index.js":{"size":47,"offset":"15289571"},"LICENSE":{"size":1093,"offset":"15289618"},"package.json":{"size":1312,"offset":"15290711"},"lib":{"files":{"deep-extend.js":{"size":4293,"offset":"15292023"}}}}},"end-of-stream":{"files":{"index.js":{"size":2678,"offset":"15296316"},"LICENSE":{"size":1078,"offset":"15298994"},"package.json":{"size":777,"offset":"15300072"}}},"es6-promise":{"files":{"auto.js":{"size":179,"offset":"15300849"},"LICENSE":{"size":1097,"offset":"15301028"},"package.json":{"size":2369,"offset":"15302125"},"dist":{"files":{"es6-promise.auto.js":{"size":29434,"offset":"15304494"},"es6-promise.auto.map":{"size":50029,"offset":"15333928"},"es6-promise.auto.min.js":{"size":6584,"offset":"15383957"},"es6-promise.auto.min.map":{"size":50033,"offset":"15390541"},"es6-promise.js":{"size":29406,"offset":"15440574"},"es6-promise.map":{"size":49880,"offset":"15469980"},"es6-promise.min.js":{"size":6570,"offset":"15519860"},"es6-promise.min.map":{"size":49884,"offset":"15526430"}}}}},"fs-minipass":{"files":{"index.js":{"size":9990,"offset":"15576314"},"LICENSE":{"size":765,"offset":"15586304"},"package.json":{"size":865,"offset":"15587069"}}},"fs.realpath":{"files":{"index.js":{"size":1308,"offset":"15587934"},"LICENSE":{"size":2125,"offset":"15589242"},"old.js":{"size":8542,"offset":"15591367"},"package.json":{"size":577,"offset":"15599909"}}},"gauge":{"files":{"LICENSE.md":{"size":798,"offset":"15600486"},"package.json":{"size":1432,"offset":"15601284"},"lib":{"files":{"base-theme.js":{"size":424,"offset":"15602716"},"error.js":{"size":616,"offset":"15603140"},"has-color.js":{"size":99,"offset":"15603756"},"index.js":{"size":7303,"offset":"15603855"},"plumbing.js":{"size":1279,"offset":"15611158"},"process.js":{"size":89,"offset":"15612437"},"progress-bar.js":{"size":1035,"offset":"15612526"},"render-template.js":{"size":5950,"offset":"15613561"},"set-immediate.js":{"size":139,"offset":"15619511"},"set-interval.js":{"size":93,"offset":"15619650"},"spin.js":{"size":105,"offset":"15619743"},"template-item.js":{"size":1977,"offset":"15619848"},"theme-set.js":{"size":3720,"offset":"15621825"},"themes.js":{"size":1667,"offset":"15625545"},"wide-truncate.js":{"size":858,"offset":"15627212"}}},"node_modules":{"files":{"ansi-regex":{"files":{"index.js":{"size":350,"offset":"15628070"},"license":{"size":1109,"offset":"15628420"},"package.json":{"size":841,"offset":"15629529"}}},"aproba":{"files":{"index.js":{"size":3644,"offset":"15630370"},"LICENSE":{"size":752,"offset":"15634014"},"package.json":{"size":740,"offset":"15634766"}}},"signal-exit":{"files":{"index.js":{"size":5708,"offset":"15635506"},"LICENSE.txt":{"size":748,"offset":"15641214"},"package.json":{"size":864,"offset":"15641962"},"signals.js":{"size":1295,"offset":"15642826"}}},"is-fullwidth-code-point":{"files":{"index.js":{"size":1756,"offset":"15644121"},"license":{"size":1109,"offset":"15645877"},"package.json":{"size":737,"offset":"15646986"}}},"string-width":{"files":{"index.js":{"size":923,"offset":"15647723"},"license":{"size":1109,"offset":"15648646"},"package.json":{"size":941,"offset":"15649755"}}},"strip-ansi":{"files":{"index.js":{"size":154,"offset":"15650696"},"license":{"size":1109,"offset":"15650850"},"package.json":{"size":798,"offset":"15651959"}}},"wide-align":{"files":{"align.js":{"size":1428,"offset":"15652757"},"LICENSE":{"size":752,"offset":"15654185"},"package.json":{"size":736,"offset":"15654937"}}}}}}},"http-cache-semantics":{"files":{"index.js":{"size":23786,"offset":"15655673"},"LICENSE":{"size":1274,"offset":"15679459"},"package.json":{"size":733,"offset":"15680733"}}},"inflight":{"files":{"inflight.js":{"size":1365,"offset":"15681466"},"LICENSE":{"size":748,"offset":"15682831"},"package.json":{"size":658,"offset":"15683579"}}},"ini":{"files":{"ini.js":{"size":4976,"offset":"15684237"},"LICENSE":{"size":765,"offset":"15689213"},"package.json":{"size":845,"offset":"15689978"}}},"ip":{"files":{"package.json":{"size":532,"offset":"15690823"},"lib":{"files":{"ip.js":{"size":10274,"offset":"15691355"}}}}},"is-lambda":{"files":{"index.js":{"size":114,"offset":"15701629"},"LICENSE":{"size":1091,"offset":"15701743"},"package.json":{"size":773,"offset":"15702834"},"test.js":{"size":321,"offset":"15703607"}}},"isexe":{"files":{"index.js":{"size":1192,"offset":"15703928"},"LICENSE":{"size":765,"offset":"15705120"},"mode.js":{"size":909,"offset":"15705885"},"package.json":{"size":786,"offset":"15706794"},"windows.js":{"size":890,"offset":"15707580"}}},"minimatch":{"files":{"LICENSE":{"size":765,"offset":"15708470"},"minimatch.js":{"size":25347,"offset":"15709235"},"package.json":{"size":667,"offset":"15734582"}}},"minipass-collect":{"files":{"index.js":{"size":1990,"offset":"15735249"},"LICENSE":{"size":765,"offset":"15737239"},"package.json":{"size":609,"offset":"15738004"}}},"minipass-fetch":{"files":{"LICENSE":{"size":1308,"offset":"15738613"},"package.json":{"size":1529,"offset":"15739921"},"lib":{"files":{"abort-error.js":{"size":362,"offset":"15741450"},"blob.js":{"size":2330,"offset":"15741812"},"body.js":{"size":10315,"offset":"15744142"},"fetch-error.js":{"size":713,"offset":"15754457"},"headers.js":{"size":6547,"offset":"15755170"},"index.js":{"size":12637,"offset":"15761717"},"request.js":{"size":7137,"offset":"15774354"},"response.js":{"size":1952,"offset":"15781491"}}},"node_modules":{"files":{"minipass":{"files":{"index.js":{"size":14799,"offset":"15783443"},"LICENSE":{"size":756,"offset":"15798242"},"package.json":{"size":808,"offset":"15798998"}}}}}}},"minipass-flush":{"files":{"index.js":{"size":1011,"offset":"15799806"},"LICENSE":{"size":765,"offset":"15800817"},"package.json":{"size":799,"offset":"15801582"}}},"minipass-pipeline":{"files":{"index.js":{"size":3412,"offset":"15802381"},"LICENSE":{"size":765,"offset":"15805793"},"package.json":{"size":588,"offset":"15806558"}}},"minizlib":{"files":{"constants.js":{"size":3740,"offset":"15807146"},"index.js":{"size":9444,"offset":"15810886"},"LICENSE":{"size":1297,"offset":"15820330"},"package.json":{"size":907,"offset":"15821627"}}},"negotiator":{"files":{"HISTORY.md":{"size":2406,"offset":"15822534"},"index.js":{"size":3344,"offset":"15824940"},"LICENSE":{"size":1177,"offset":"15828284"},"package.json":{"size":1011,"offset":"15829461"},"lib":{"files":{"charset.js":{"size":3081,"offset":"15830472"},"encoding.js":{"size":3506,"offset":"15833553"},"language.js":{"size":3408,"offset":"15837059"},"mediaType.js":{"size":5358,"offset":"15840467"}}}}},"once":{"files":{"LICENSE":{"size":765,"offset":"15845825"},"once.js":{"size":935,"offset":"15846590"},"package.json":{"size":574,"offset":"15847525"}}},"path-is-absolute":{"files":{"index.js":{"size":611,"offset":"15848099"},"license":{"size":1119,"offset":"15848710"},"package.json":{"size":733,"offset":"15849829"}}},"promise-retry":{"files":{"index.js":{"size":1378,"offset":"15850562"},"LICENSE":{"size":1056,"offset":"15851940"},"package.json":{"size":843,"offset":"15852996"}}},"set-blocking":{"files":{"index.js":{"size":252,"offset":"15853839"},"LICENSE.txt":{"size":731,"offset":"15854091"},"package.json":{"size":985,"offset":"15854822"}}},"simple-concat":{"files":{"index.js":{"size":392,"offset":"15855807"},"LICENSE":{"size":1081,"offset":"15856199"},"package.json":{"size":1032,"offset":"15857280"}}},"smart-buffer":{"files":{"LICENSE":{"size":1087,"offset":"15858312"},"package.json":{"size":1939,"offset":"15859399"},"build":{"files":{"smartbuffer.js":{"size":44621,"offset":"15861338"},"utils.js":{"size":4393,"offset":"15905959"}}}}},"ssri":{"files":{"index.js":{"size":13775,"offset":"15910352"},"LICENSE.md":{"size":755,"offset":"15924127"},"package.json":{"size":1129,"offset":"15924882"}}},"strip-json-comments":{"files":{"index.js":{"size":2219,"offset":"15926011"},"license":{"size":1117,"offset":"15928230"},"package.json":{"size":855,"offset":"15929347"}}},"tar-stream":{"files":{"extract.js":{"size":5928,"offset":"15930202"},"headers.js":{"size":7419,"offset":"15936130"},"index.js":{"size":72,"offset":"15943549"},"LICENSE":{"size":1078,"offset":"15943621"},"pack.js":{"size":5633,"offset":"15944699"},"package.json":{"size":1411,"offset":"15950332"},"node_modules":{"files":{"bl":{"files":{"bl.js":{"size":6733,"offset":"15951743"},"LICENSE.md":{"size":1216,"offset":"15958476"},"package.json":{"size":886,"offset":"15959692"}}}}}}},"@npmcli":{"files":{"fs":{"files":{"LICENSE.md":{"size":798,"offset":"15960578"},"package.json":{"size":846,"offset":"15961376"},"lib":{"files":{"copy-file.js":{"size":607,"offset":"15962222"},"errors.js":{"size":3396,"offset":"15962829"},"fs.js":{"size":377,"offset":"15966225"},"index.js":{"size":310,"offset":"15966602"},"mkdtemp.js":{"size":891,"offset":"15966912"},"with-temp-dir.js":{"size":1009,"offset":"15967803"},"write-file.js":{"size":507,"offset":"15968812"},"common":{"files":{"get-options.js":{"size":528,"offset":"15969319"},"node.js":{"size":181,"offset":"15969847"},"owner.js":{"size":2188,"offset":"15970028"},"file-url-to-path":{"files":{"index.js":{"size":450,"offset":"16001108"},"polyfill.js":{"size":3137,"offset":"16001558"}}}}},"cp":{"files":{"index.js":{"size":692,"offset":"15972216"},"LICENSE":{"size":1084,"offset":"15972908"},"polyfill.js":{"size":12239,"offset":"15973992"}}},"mkdir":{"files":{"index.js":{"size":981,"offset":"15986231"},"polyfill.js":{"size":2437,"offset":"15987212"}}},"rm":{"files":{"index.js":{"size":695,"offset":"15989649"},"polyfill.js":{"size":6514,"offset":"15990344"}}}}},"node_modules":{"files":{"semver":{"files":{"index.js":{"size":1982,"offset":"15996858"},"LICENSE":{"size":765,"offset":"15998840"},"package.json":{"size":815,"offset":"15999605"},"preload.js":{"size":69,"offset":"16000420"},"range.bnf":{"size":619,"offset":"16000489"},"bin":{"files":{"semver.js":{"size":4363,"offset":"16004695"}}},"classes":{"files":{"comparator.js":{"size":3606,"offset":"16009058"},"index.js":{"size":128,"offset":"16012664"},"range.js":{"size":13989,"offset":"16012792"},"semver.js":{"size":7985,"offset":"16026781"}}},"functions":{"files":{"clean.js":{"size":191,"offset":"16034766"},"cmp.js":{"size":907,"offset":"16034957"},"coerce.js":{"size":1497,"offset":"16035864"},"compare-build.js":{"size":267,"offset":"16037361"},"compare-loose.js":{"size":118,"offset":"16037628"},"compare.js":{"size":156,"offset":"16037746"},"diff.js":{"size":634,"offset":"16037902"},"eq.js":{"size":112,"offset":"16038536"},"gt.js":{"size":110,"offset":"16038648"},"gte.js":{"size":113,"offset":"16038758"},"inc.js":{"size":336,"offset":"16038871"},"lt.js":{"size":110,"offset":"16039207"},"lte.js":{"size":113,"offset":"16039317"},"major.js":{"size":122,"offset":"16039430"},"minor.js":{"size":122,"offset":"16039552"},"neq.js":{"size":114,"offset":"16039674"},"parse.js":{"size":660,"offset":"16039788"},"patch.js":{"size":122,"offset":"16040448"},"prerelease.js":{"size":220,"offset":"16040570"},"rcompare.js":{"size":118,"offset":"16040790"},"rsort.js":{"size":149,"offset":"16040908"},"satisfies.js":{"size":233,"offset":"16041057"},"sort.js":{"size":147,"offset":"16041290"},"valid.js":{"size":162,"offset":"16041437"}}},"internal":{"files":{"constants.js":{"size":468,"offset":"16041599"},"debug.js":{"size":226,"offset":"16042067"},"identifiers.js":{"size":409,"offset":"16042293"},"parse-options.js":{"size":401,"offset":"16042702"},"re.js":{"size":6662,"offset":"16043103"}}},"ranges":{"files":{"gtr.js":{"size":217,"offset":"16049765"},"intersects.js":{"size":201,"offset":"16049982"},"ltr.js":{"size":213,"offset":"16050183"},"max-satisfying.js":{"size":579,"offset":"16050396"},"min-satisfying.js":{"size":577,"offset":"16050975"},"min-version.js":{"size":1492,"offset":"16051552"},"outside.js":{"size":2188,"offset":"16053044"},"simplify.js":{"size":1287,"offset":"16055232"},"subset.js":{"size":7224,"offset":"16056519"},"to-comparators.js":{"size":268,"offset":"16063743"},"valid.js":{"size":312,"offset":"16064011"}}}}}}}}},"move-file":{"files":{"index.js":{"size":1893,"offset":"16064323"},"LICENSE.md":{"size":1141,"offset":"16066216"},"package.json":{"size":641,"offset":"16067357"}}}}},"aproba":{"files":{"index.js":{"size":3966,"offset":"16067998"},"LICENSE":{"size":752,"offset":"16071964"},"package.json":{"size":720,"offset":"16072716"}}},"bl":{"files":{"bl.js":{"size":2043,"offset":"16073436"},"BufferList.js":{"size":9524,"offset":"16075479"},"LICENSE.md":{"size":1216,"offset":"16085003"},"package.json":{"size":964,"offset":"16086219"},"node_modules":{"files":{"readable-stream":{"files":{"errors-browser.js":{"size":4197,"offset":"16087183"},"errors.js":{"size":3715,"offset":"16091380"},"experimentalWarning.js":{"size":460,"offset":"16095095"},"GOVERNANCE.md":{"size":5550,"offset":"16095555"},"LICENSE":{"size":2337,"offset":"16101105"},"package.json":{"size":1886,"offset":"16103442"},"readable-browser.js":{"size":488,"offset":"16105328"},"readable.js":{"size":729,"offset":"16105816"},"lib":{"files":{"_stream_duplex.js":{"size":4399,"offset":"16106545"},"_stream_passthrough.js":{"size":1630,"offset":"16110944"},"_stream_readable.js":{"size":35972,"offset":"16112574"},"_stream_transform.js":{"size":7947,"offset":"16148546"},"_stream_writable.js":{"size":21821,"offset":"16156493"},"internal":{"files":{"streams":{"files":{"async_iterator.js":{"size":5957,"offset":"16178314"},"buffer_list.js":{"size":6335,"offset":"16184271"},"destroy.js":{"size":3117,"offset":"16190606"},"end-of-stream.js":{"size":3102,"offset":"16193723"},"from-browser.js":{"size":101,"offset":"16196825"},"from.js":{"size":3137,"offset":"16196926"},"pipeline.js":{"size":2428,"offset":"16200063"},"state.js":{"size":749,"offset":"16202491"},"stream-browser.js":{"size":49,"offset":"16203240"},"stream.js":{"size":36,"offset":"16203289"}}}}}}}}}}}}},"brace-expansion":{"files":{"index.js":{"size":4792,"offset":"16203325"},"LICENSE":{"size":1096,"offset":"16208117"},"package.json":{"size":1113,"offset":"16209213"}}},"color-support":{"files":{"bin.js":{"size":127,"offset":"16210326"},"browser.js":{"size":299,"offset":"16210453"},"index.js":{"size":2644,"offset":"16210752"},"LICENSE":{"size":765,"offset":"16213396"},"package.json":{"size":816,"offset":"16214161"}}},"delegates":{"files":{"index.js":{"size":2065,"offset":"16214977"},"License":{"size":1079,"offset":"16217042"},"Makefile":{"size":100,"offset":"16218121"},"package.json":{"size":313,"offset":"16218221"},"Readme.md":{"size":1768,"offset":"16218534"}}},"depd":{"files":{"index.js":{"size":10932,"offset":"16220302"},"LICENSE":{"size":1094,"offset":"16231234"},"package.json":{"size":1335,"offset":"16232328"},"Readme.md":{"size":9988,"offset":"16233663"},"lib":{"files":{"browser":{"files":{"index.js":{"size":1512,"offset":"16243651"}}}}}}},"encoding":{"files":{"LICENSE":{"size":935,"offset":"16245163"},"package.json":{"size":432,"offset":"16246098"},"lib":{"files":{"encoding.js":{"size":2116,"offset":"16246530"}}},"node_modules":{"files":{"iconv-lite":{"files":{"Changelog.md":{"size":6581,"offset":"16248646"},"LICENSE":{"size":1064,"offset":"16255227"},"package.json":{"size":1131,"offset":"16256291"},"encodings":{"files":{"dbcs-codec.js":{"size":23065,"offset":"16257422"},"dbcs-data.js":{"size":9389,"offset":"16280487"},"index.js":{"size":733,"offset":"16289876"},"internal.js":{"size":6309,"offset":"16290609"},"sbcs-codec.js":{"size":2191,"offset":"16296918"},"sbcs-data-generated.js":{"size":32034,"offset":"16299109"},"sbcs-data.js":{"size":5116,"offset":"16331143"},"utf16.js":{"size":5502,"offset":"16336259"},"utf32.js":{"size":9982,"offset":"16341761"},"utf7.js":{"size":9283,"offset":"16351743"},"tables":{"files":{"big5-added.json":{"size":17717,"offset":"16371836"},"cp936.json":{"size":47320,"offset":"16389553"},"cp949.json":{"size":38122,"offset":"16436873"},"cp950.json":{"size":42356,"offset":"16474995"},"eucjp.json":{"size":41064,"offset":"16517351"},"gb18030-ranges.json":{"size":2216,"offset":"16558415"},"gbk-added.json":{"size":1247,"offset":"16560631"},"shiftjis.json":{"size":23782,"offset":"16561878"}}}}},"lib":{"files":{"bom-handling.js":{"size":1109,"offset":"16361026"},"index.js":{"size":6321,"offset":"16362135"},"streams.js":{"size":3380,"offset":"16368456"}}}}}}}}},"err-code":{"files":{"bower.json":{"size":589,"offset":"16585660"},"index.js":{"size":933,"offset":"16586249"},"index.umd.js":{"size":1821,"offset":"16587182"},"package.json":{"size":844,"offset":"16589003"}}},"fs-constants":{"files":{"browser.js":{"size":38,"offset":"16589847"},"index.js":{"size":65,"offset":"16589885"},"LICENSE":{"size":1079,"offset":"16589950"},"package.json":{"size":513,"offset":"16591029"}}},"has-unicode":{"files":{"index.js":{"size":657,"offset":"16591542"},"LICENSE":{"size":752,"offset":"16592199"},"package.json":{"size":639,"offset":"16592951"}}},"humanize-ms":{"files":{"index.js":{"size":442,"offset":"16593590"},"LICENSE":{"size":1023,"offset":"16594032"},"package.json":{"size":686,"offset":"16595055"}}},"infer-owner":{"files":{"index.js":{"size":1729,"offset":"16595741"},"LICENSE":{"size":756,"offset":"16597470"},"package.json":{"size":688,"offset":"16598226"}}},"mimic-response":{"files":{"index.js":{"size":758,"offset":"16598914"},"license":{"size":1109,"offset":"16599672"},"package.json":{"size":651,"offset":"16600781"}}},"minipass-sized":{"files":{"index.js":{"size":1785,"offset":"16601432"},"LICENSE":{"size":765,"offset":"16603217"},"package.json":{"size":831,"offset":"16603982"}}},"object-assign":{"files":{"index.js":{"size":2108,"offset":"16604813"},"license":{"size":1119,"offset":"16606921"},"package.json":{"size":764,"offset":"16608040"}}},"p-map":{"files":{"index.js":{"size":1640,"offset":"16608804"},"license":{"size":1117,"offset":"16610444"},"package.json":{"size":911,"offset":"16611561"}}},"promise-inflight":{"files":{"inflight.js":{"size":842,"offset":"16612472"},"LICENSE":{"size":752,"offset":"16613314"},"package.json":{"size":669,"offset":"16614066"}}},"retry":{"files":{"equation.gif":{"size":1209,"offset":"16614735"},"index.js":{"size":40,"offset":"16615944"},"License":{"size":1139,"offset":"16615984"},"Makefile":{"size":312,"offset":"16617123"},"package.json":{"size":1022,"offset":"16617435"},"lib":{"files":{"retry.js":{"size":2298,"offset":"16618457"},"retry_operation.js":{"size":3657,"offset":"16620755"}}}}},"signal-exit":{"files":{"index.js":{"size":4124,"offset":"16624412"},"LICENSE.txt":{"size":748,"offset":"16628536"},"package.json":{"size":909,"offset":"16629284"},"signals.js":{"size":1295,"offset":"16630193"}}},"unique-filename":{"files":{"index.js":{"size":215,"offset":"16631488"},"LICENSE":{"size":717,"offset":"16631703"},"package.json":{"size":694,"offset":"16632420"},"coverage":{"files":{"base.css":{"size":4756,"offset":"16633114"},"index.html":{"size":3122,"offset":"16637870"},"prettify.css":{"size":676,"offset":"16640992"},"prettify.js":{"size":17569,"offset":"16641668"},"sort-arrow-sprite.png":{"size":209,"offset":"16659237"},"sorter.js":{"size":5041,"offset":"16659446"},"__root__":{"files":{"index.html":{"size":3183,"offset":"16664487"},"index.js.html":{"size":2427,"offset":"16667670"}}}}}}},"wide-align":{"files":{"align.js":{"size":1428,"offset":"16670097"},"LICENSE":{"size":752,"offset":"16671525"},"package.json":{"size":820,"offset":"16672277"},"node_modules":{"files":{"ansi-regex":{"files":{"index.js":{"size":253,"offset":"16673097"},"license":{"size":1109,"offset":"16673350"},"package.json":{"size":873,"offset":"16674459"}}},"string-width":{"files":{"index.js":{"size":649,"offset":"16675332"},"license":{"size":1109,"offset":"16675981"},"package.json":{"size":880,"offset":"16677090"}}},"strip-ansi":{"files":{"index.js":{"size":150,"offset":"16677970"},"license":{"size":1109,"offset":"16678120"},"package.json":{"size":811,"offset":"16679229"}}}}}}},"wrappy":{"files":{"LICENSE":{"size":765,"offset":"16680040"},"package.json":{"size":606,"offset":"16680805"},"wrappy.js":{"size":905,"offset":"16681411"}}},"@gar":{"files":{"promisify":{"files":{"index.js":{"size":967,"offset":"16682316"},"LICENSE.md":{"size":1094,"offset":"16683283"},"package.json":{"size":665,"offset":"16684377"}}}}},"aggregate-error":{"files":{"index.js":{"size":1252,"offset":"16685042"},"license":{"size":1109,"offset":"16686294"},"package.json":{"size":694,"offset":"16687403"}}},"balanced-match":{"files":{"index.js":{"size":1219,"offset":"16688097"},"LICENSE.md":{"size":1096,"offset":"16689316"},"package.json":{"size":1069,"offset":"16690412"}}},"buffer":{"files":{"AUTHORS.md":{"size":2672,"offset":"16691481"},"index.js":{"size":50097,"offset":"16694153"},"LICENSE":{"size":1106,"offset":"16744250"},"package.json":{"size":2597,"offset":"16745356"}}},"code-point-at":{"files":{"index.js":{"size":610,"offset":"16747953"},"license":{"size":1119,"offset":"16748563"},"package.json":{"size":648,"offset":"16749682"}}},"concat-map":{"files":{"index.js":{"size":345,"offset":"16750330"},"LICENSE":{"size":1073,"offset":"16750675"},"package.json":{"size":989,"offset":"16751748"},"README.markdown":{"size":1165,"offset":"16752737"}}},"core-util-is":{"files":{"float.patch":{"size":16278,"offset":"16753902"},"LICENSE":{"size":1077,"offset":"16770180"},"package.json":{"size":651,"offset":"16771257"},"test.js":{"size":2101,"offset":"16771908"},"lib":{"files":{"util.js":{"size":3021,"offset":"16774009"}}}}},"iconv-lite":{"files":{"Changelog.md":{"size":3478,"offset":"16777030"},"LICENSE":{"size":1064,"offset":"16780508"},"package.json":{"size":1788,"offset":"16781572"},"encodings":{"files":{"dbcs-codec.js":{"size":21400,"offset":"16783360"},"dbcs-data.js":{"size":8291,"offset":"16804760"},"index.js":{"size":710,"offset":"16813051"},"internal.js":{"size":6103,"offset":"16813761"},"sbcs-codec.js":{"size":2198,"offset":"16819864"},"sbcs-data-generated.js":{"size":32034,"offset":"16822062"},"sbcs-data.js":{"size":4321,"offset":"16854096"},"utf16.js":{"size":5002,"offset":"16858417"},"utf7.js":{"size":9196,"offset":"16863419"},"tables":{"files":{"big5-added.json":{"size":17717,"offset":"16890589"},"cp936.json":{"size":47320,"offset":"16908306"},"cp949.json":{"size":38122,"offset":"16955626"},"cp950.json":{"size":42356,"offset":"16993748"},"eucjp.json":{"size":41064,"offset":"17036104"},"gb18030-ranges.json":{"size":2216,"offset":"17077168"},"gbk-added.json":{"size":1227,"offset":"17079384"},"shiftjis.json":{"size":23782,"offset":"17080611"}}}}},"lib":{"files":{"bom-handling.js":{"size":1109,"offset":"16872615"},"extend-node.js":{"size":8553,"offset":"16873724"},"index.js":{"size":4925,"offset":"16882277"},"streams.js":{"size":3387,"offset":"16887202"}}}}},"isarray":{"files":{"component.json":{"size":470,"offset":"17104393"},"index.js":{"size":132,"offset":"17104863"},"Makefile":{"size":55,"offset":"17104995"},"package.json":{"size":958,"offset":"17105050"},"test.js":{"size":320,"offset":"17106008"}}},"process-nextick-args":{"files":{"index.js":{"size":1083,"offset":"17106328"},"license.md":{"size":1064,"offset":"17107411"},"package.json":{"size":578,"offset":"17108475"}}},"unique-slug":{"files":{"index.js":{"size":287,"offset":"17109053"},"LICENSE":{"size":734,"offset":"17109340"},"package.json":{"size":560,"offset":"17110074"}}},"base64-js":{"files":{"base64js.min.js":{"size":2192,"offset":"17110634"},"index.js":{"size":3932,"offset":"17112826"},"LICENSE":{"size":1081,"offset":"17116758"},"package.json":{"size":1115,"offset":"17117839"}}},"clean-stack":{"files":{"index.js":{"size":1055,"offset":"17118954"},"license":{"size":1109,"offset":"17120009"},"package.json":{"size":603,"offset":"17121118"}}},"ieee754":{"files":{"index.js":{"size":2154,"offset":"17121721"},"LICENSE":{"size":1465,"offset":"17123875"},"package.json":{"size":1194,"offset":"17125340"}}},"imurmurhash":{"files":{"imurmurhash.js":{"size":4412,"offset":"17126534"},"imurmurhash.min.js":{"size":1894,"offset":"17130946"},"package.json":{"size":818,"offset":"17132840"}}},"indent-string":{"files":{"index.js":{"size":743,"offset":"17133658"},"license":{"size":1109,"offset":"17134401"},"package.json":{"size":582,"offset":"17135510"}}},"number-is-nan":{"files":{"index.js":{"size":82,"offset":"17136092"},"license":{"size":1119,"offset":"17136174"},"package.json":{"size":585,"offset":"17137293"}}},"safer-buffer":{"files":{"dangerous.js":{"size":1483,"offset":"17137878"},"LICENSE":{"size":1094,"offset":"17139361"},"package.json":{"size":822,"offset":"17140455"},"Porting-Buffer.md":{"size":12794,"offset":"17141277"},"Readme.md":{"size":8261,"offset":"17154071"},"safer.js":{"size":2110,"offset":"17162332"},"tests.js":{"size":15735,"offset":"17164442"}}}}}{ "name": "@tootallnate/once", "version": "1.1.2", "description": "Creates a Promise that waits for a single event", "main": "./dist/index.js", "types": "./dist/index.d.ts", "files": [ "dist" ], "scripts": { "prebuild": "rimraf dist", "build": "tsc", "test": "mocha --reporter spec", "test-lint": "eslint src --ext .js,.ts", "prepublishOnly": "npm run build" }, "repository": { "type": "git", "url": "git://github.com/TooTallNate/once.git" }, "keywords": [], "author": "Nathan Rajlich (http://n8.io/)", "license": "MIT", "bugs": { "url": "https://github.com/TooTallNate/once/issues" }, "devDependencies": { "@types/node": "^12.12.11", "@typescript-eslint/eslint-plugin": "1.6.0", "@typescript-eslint/parser": "1.1.0", "eslint": "5.16.0", "eslint-config-airbnb": "17.1.0", "eslint-config-prettier": "4.1.0", "eslint-import-resolver-typescript": "1.1.1", "eslint-plugin-import": "2.16.0", "eslint-plugin-jsx-a11y": "6.2.1", "eslint-plugin-react": "7.12.4", "mocha": "^6.2.2", "rimraf": "^3.0.0", "typescript": "^3.7.3" }, "engines": { "node": ">= 6" } } "use strict"; function noop() { } function once(emitter, name) { const o = once.spread(emitter, name); const r = o.then((args) => args[0]); r.cancel = o.cancel; return r; } (function (once) { function spread(emitter, name) { let c = null; const p = new Promise((resolve, reject) => { function cancel() { emitter.removeListener(name, onEvent); emitter.removeListener('error', onError); p.cancel = noop; } function onEvent(...args) { cancel(); resolve(args); } function onError(err) { cancel(); reject(err); } c = cancel; emitter.on(name, onEvent); emitter.on('error', onError); }); if (!c) { throw new TypeError('Could not get `cancel()` function'); } p.cancel = c; return p; } once.spread = spread; })(once || (once = {})); module.exports = once;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@tootallnate/once/dist/index.js.map"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; const events_1 = require("events"); const debug_1 = __importDefault(require("debug")); const promisify_1 = __importDefault(require("./promisify")); const debug = debug_1.default('agent-base'); function isAgent(v) { return Boolean(v) && typeof v.addRequest === 'function'; } function isSecureEndpoint() { const { stack } = new Error(); if (typeof stack !== 'string') return false; return stack.split('\n').some(l => l.indexOf('(https.js:') !== -1); } function createAgent(callback, opts) { return new createAgent.Agent(callback, opts); } (function (createAgent) { /** * Base `http.Agent` implementation. * No pooling/keep-alive is implemented by default. * * @param {Function} callback * @api public */ class Agent extends events_1.EventEmitter { constructor(callback, _opts) { super(); let opts = _opts; if (typeof callback === 'function') { this.callback = callback; } else if (callback) { opts = callback; } // Timeout for the socket to be returned from the callback this.timeout = null; if (opts && typeof opts.timeout === 'number') { this.timeout = opts.timeout; } // These aren't actually used by `agent-base`, but are required // for the TypeScript definition files in `@types/node` :/ this.maxFreeSockets = 1; this.maxSockets = 1; this.sockets = {}; this.requests = {}; this.options = {}; } get defaultPort() { if (typeof this.explicitDefaultPort === 'number') { return this.explicitDefaultPort; } return isSecureEndpoint() ? 443 : 80; } set defaultPort(v) { this.explicitDefaultPort = v; } get protocol() { if (typeof this.explicitProtocol === 'string') { return this.explicitProtocol; } return isSecureEndpoint() ? 'https:' : 'http:'; } set protocol(v) { this.explicitProtocol = v; } callback(req, opts, fn) { throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`'); } /** * Called by node-core's "_http_client.js" module when creating * a new HTTP request with this Agent instance. * * @api public */ addRequest(req, _opts) { const opts = Object.assign({}, _opts); if (typeof opts.secureEndpoint !== 'boolean') { opts.secureEndpoint = isSecureEndpoint(); } if (opts.host == null) { opts.host = 'localhost'; } if (opts.port == null) { opts.port = opts.secureEndpoint ? 443 : 80; } if (opts.protocol == null) { opts.protocol = opts.secureEndpoint ? 'https:' : 'http:'; } if (opts.host && opts.path) { // If both a `host` and `path` are specified then it's most // likely the result of a `url.parse()` call... we need to // remove the `path` portion so that `net.connect()` doesn't // attempt to open that as a unix socket file. delete opts.path; } delete opts.agent; delete opts.hostname; delete opts._defaultAgent; delete opts.defaultPort; delete opts.createConnection; // Hint to use "Connection: close" // XXX: non-documented `http` module API :( req._last = true; req.shouldKeepAlive = false; let timedOut = false; let timeoutId = null; const timeoutMs = opts.timeout || this.timeout; const onerror = (err) => { if (req._hadError) return; req.emit('error', err); // For Safety. Some additional errors might fire later on // and we need to make sure we don't double-fire the error event. req._hadError = true; }; const ontimeout = () => { timeoutId = null; timedOut = true; const err = new Error(`A "socket" was not created for HTTP request before ${timeoutMs}ms`); err.code = 'ETIMEOUT'; onerror(err); }; const callbackError = (err) => { if (timedOut) return; if (timeoutId !== null) { clearTimeout(timeoutId); timeoutId = null; } onerror(err); }; const onsocket = (socket) => { if (timedOut) return; if (timeoutId != null) { clearTimeout(timeoutId); timeoutId = null; } if (isAgent(socket)) { // `socket` is actually an `http.Agent` instance, so // relinquish responsibility for this `req` to the Agent // from here on debug('Callback returned another Agent instance %o', socket.constructor.name); socket.addRequest(req, opts); return; } if (socket) { socket.once('free', () => { this.freeSocket(socket, opts); }); req.onSocket(socket); return; } const err = new Error(`no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\``); onerror(err); }; if (typeof this.callback !== 'function') { onerror(new Error('`callback` is not defined')); return; } if (!this.promisifiedCallback) { if (this.callback.length >= 3) { debug('Converting legacy callback function to promise'); this.promisifiedCallback = promisify_1.default(this.callback); } else { this.promisifiedCallback = this.callback; } } if (typeof timeoutMs === 'number' && timeoutMs > 0) { timeoutId = setTimeout(ontimeout, timeoutMs); } if ('port' in opts && typeof opts.port !== 'number') { opts.port = Number(opts.port); } try { debug('Resolving socket for %o request: %o', opts.protocol, `${req.method} ${req.path}`); Promise.resolve(this.promisifiedCallback(req, opts)).then(onsocket, callbackError); } catch (err) { Promise.reject(err).catch(callbackError); } } freeSocket(socket, opts) { debug('Freeing socket %o %o', socket.constructor.name, opts); socket.destroy(); } destroy() { debug('Destroying agent %o', this.constructor.name); } } createAgent.Agent = Agent; // So that `instanceof` works correctly createAgent.prototype = createAgent.Agent.prototype; })(createAgent || (createAgent = {})); module.exports = createAgent;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/agent-base/dist/src/index.js.map"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function promisify(fn) { return function (req, opts) { return new Promise((resolve, reject) => { fn.call(this, req, opts, (err, rtn) => { if (err) { reject(err); } else { resolve(rtn); } }); }); }; } exports.default = promisify;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/agent-base/dist/src/promisify.js.map(The MIT License) Copyright (c) 2014 TJ Holowaychuk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "debug", "version": "4.1.1", "repository": { "type": "git", "url": "git://github.com/visionmedia/debug.git" }, "description": "small debugging utility", "keywords": [ "debug", "log", "debugger" ], "files": [ "src", "dist/debug.js", "LICENSE", "README.md" ], "author": "TJ Holowaychuk ", "contributors": [ "Nathan Rajlich (http://n8.io)", "Andrew Rhyne " ], "license": "MIT", "scripts": { "lint": "xo", "test": "npm run test:node && npm run test:browser", "test:node": "istanbul cover _mocha -- test.js", "pretest:browser": "npm run build", "test:browser": "karma start --single-run", "prebuild:debug": "mkdir -p dist && browserify --standalone debug -o dist/debug.es6.js .", "build:debug": "babel -o dist/debug.js dist/debug.es6.js > dist/debug.js", "build:test": "babel -d dist test.js", "build": "npm run build:debug && npm run build:test", "clean": "rimraf dist coverage", "test:coverage": "cat ./coverage/lcov.info | coveralls" }, "dependencies": { "ms": "^2.1.1" }, "devDependencies": { "@babel/cli": "^7.0.0", "@babel/core": "^7.0.0", "@babel/preset-env": "^7.0.0", "browserify": "14.4.0", "chai": "^3.5.0", "concurrently": "^3.1.0", "coveralls": "^3.0.2", "istanbul": "^0.4.5", "karma": "^3.0.0", "karma-chai": "^0.1.0", "karma-mocha": "^1.3.0", "karma-phantomjs-launcher": "^1.0.2", "mocha": "^5.2.0", "mocha-lcov-reporter": "^1.2.0", "rimraf": "^2.5.4", "xo": "^0.23.0" }, "main": "./src/index.js", "browser": "./src/browser.js", "unpkg": "./dist/debug.js" } "use strict"; function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } (function (f) { if ((typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined") { module.exports = f(); } else if (typeof define === "function" && define.amd) { define([], f); } else { var g; if (typeof window !== "undefined") { g = window; } else if (typeof global !== "undefined") { g = global; } else if (typeof self !== "undefined") { g = self; } else { g = this; } g.debug = f(); } })(function () { var define, module, exports; return function () { function r(e, n, t) { function o(i, f) { if (!n[i]) { if (!e[i]) { var c = "function" == typeof require && require; if (!f && c) return c(i, !0); if (u) return u(i, !0); var a = new Error("Cannot find module '" + i + "'"); throw a.code = "MODULE_NOT_FOUND", a; } var p = n[i] = { exports: {} }; e[i][0].call(p.exports, function (r) { var n = e[i][1][r]; return o(n || r); }, p, p.exports, r, e, n, t); } return n[i].exports; } for (var u = "function" == typeof require && require, i = 0; i < t.length; i++) { o(t[i]); } return o; } return r; }()({ 1: [function (require, module, exports) { /** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; var w = d * 7; var y = d * 365.25; /** * Parse or format the given `val`. * * Options: * * - `long` verbose formatting [false] * * @param {String|Number} val * @param {Object} [options] * @throws {Error} throw an error if val is not a non-empty string or a number * @return {String|Number} * @api public */ module.exports = function (val, options) { options = options || {}; var type = _typeof(val); if (type === 'string' && val.length > 0) { return parse(val); } else if (type === 'number' && isNaN(val) === false) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val)); }; /** * Parse the given `str` and return milliseconds. * * @param {String} str * @return {Number} * @api private */ function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'yrs': case 'yr': case 'y': return n * y; case 'weeks': case 'week': case 'w': return n * w; case 'days': case 'day': case 'd': return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': return n * m; case 'seconds': case 'second': case 'secs': case 'sec': case 's': return n * s; case 'milliseconds': case 'millisecond': case 'msecs': case 'msec': case 'ms': return n; default: return undefined; } } /** * Short format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtShort(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return Math.round(ms / d) + 'd'; } if (msAbs >= h) { return Math.round(ms / h) + 'h'; } if (msAbs >= m) { return Math.round(ms / m) + 'm'; } if (msAbs >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtLong(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return plural(ms, msAbs, d, 'day'); } if (msAbs >= h) { return plural(ms, msAbs, h, 'hour'); } if (msAbs >= m) { return plural(ms, msAbs, m, 'minute'); } if (msAbs >= s) { return plural(ms, msAbs, s, 'second'); } return ms + ' ms'; } /** * Pluralization helper. */ function plural(ms, msAbs, n, name) { var isPlural = msAbs >= n * 1.5; return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); } }, {}], 2: [function (require, module, exports) { // shim for using process in browser var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it // don't break things. But we need to wrap it in a try catch in case it is // wrapped in strict mode code which doesn't define any globals. It's inside a // function because try/catches deoptimize in certain engines. var cachedSetTimeout; var cachedClearTimeout; function defaultSetTimout() { throw new Error('setTimeout has not been defined'); } function defaultClearTimeout() { throw new Error('clearTimeout has not been defined'); } (function () { try { if (typeof setTimeout === 'function') { cachedSetTimeout = setTimeout; } else { cachedSetTimeout = defaultSetTimout; } } catch (e) { cachedSetTimeout = defaultSetTimout; } try { if (typeof clearTimeout === 'function') { cachedClearTimeout = clearTimeout; } else { cachedClearTimeout = defaultClearTimeout; } } catch (e) { cachedClearTimeout = defaultClearTimeout; } })(); function runTimeout(fun) { if (cachedSetTimeout === setTimeout) { //normal enviroments in sane situations return setTimeout(fun, 0); } // if setTimeout wasn't available but was latter defined if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout; return setTimeout(fun, 0); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedSetTimeout(fun, 0); } catch (e) { try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedSetTimeout.call(null, fun, 0); } catch (e) { // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { //normal enviroments in sane situations return clearTimeout(marker); } // if clearTimeout wasn't available but was latter defined if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout; return clearTimeout(marker); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedClearTimeout(marker); } catch (e) { try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedClearTimeout.call(null, marker); } catch (e) { // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. // Some versions of I.E. have different rules for clearTimeout vs setTimeout return cachedClearTimeout.call(this, marker); } } } var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; while (len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; runClearTimeout(timeout); } process.nextTick = function (fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { runTimeout(drainQueue); } }; // v8 likes predictible objects function Item(fun, array) { this.fun = fun; this.array = array; } Item.prototype.run = function () { this.fun.apply(null, this.array); }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues process.versions = {}; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.prependListener = noop; process.prependOnceListener = noop; process.listeners = function (name) { return []; }; process.binding = function (name) { throw new Error('process.binding is not supported'); }; process.cwd = function () { return '/'; }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; process.umask = function () { return 0; }; }, {}], 3: [function (require, module, exports) { /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. */ function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = require('ms'); Object.keys(env).forEach(function (key) { createDebug[key] = env[key]; }); /** * Active `debug` instances. */ createDebug.instances = []; /** * The currently active debug mode names, and names to skip. */ createDebug.names = []; createDebug.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ createDebug.formatters = {}; /** * Selects a color for a debug namespace * @param {String} namespace The namespace string for the for the debug instance to be colored * @return {Number|String} An ANSI color code for the given namespace * @api private */ function selectColor(namespace) { var hash = 0; for (var i = 0; i < namespace.length; i++) { hash = (hash << 5) - hash + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { var prevTime; function debug() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } // Disabled? if (!debug.enabled) { return; } var self = debug; // Set `diff` timestamp var curr = Number(new Date()); var ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== 'string') { // Anything else let's inspect with %O args.unshift('%O'); } // Apply any `formatters` transformations var index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) { // If we encounter an escaped % then don't increase the array index if (match === '%%') { return match; } index++; var formatter = createDebug.formatters[format]; if (typeof formatter === 'function') { var val = args[index]; match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // Apply env-specific formatting (colors, etc.) createDebug.formatArgs.call(self, args); var logFn = self.log || createDebug.log; logFn.apply(self, args); } debug.namespace = namespace; debug.enabled = createDebug.enabled(namespace); debug.useColors = createDebug.useColors(); debug.color = selectColor(namespace); debug.destroy = destroy; debug.extend = extend; // Debug.formatArgs = formatArgs; // debug.rawLog = rawLog; // env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } createDebug.instances.push(debug); return debug; } function destroy() { var index = createDebug.instances.indexOf(this); if (index !== -1) { createDebug.instances.splice(index, 1); return true; } return false; } function extend(namespace, delimiter) { var newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); newDebug.log = this.log; return newDebug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { createDebug.save(namespaces); createDebug.names = []; createDebug.skips = []; var i; var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); var len = split.length; for (i = 0; i < len; i++) { if (!split[i]) { // ignore empty strings continue; } namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else { createDebug.names.push(new RegExp('^' + namespaces + '$')); } } for (i = 0; i < createDebug.instances.length; i++) { var instance = createDebug.instances[i]; instance.enabled = createDebug.enabled(instance.namespace); } } /** * Disable debug output. * * @return {String} namespaces * @api public */ function disable() { var namespaces = [].concat(_toConsumableArray(createDebug.names.map(toNamespace)), _toConsumableArray(createDebug.skips.map(toNamespace).map(function (namespace) { return '-' + namespace; }))).join(','); createDebug.enable(''); return namespaces; } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { if (name[name.length - 1] === '*') { return true; } var i; var len; for (i = 0, len = createDebug.skips.length; i < len; i++) { if (createDebug.skips[i].test(name)) { return false; } } for (i = 0, len = createDebug.names.length; i < len; i++) { if (createDebug.names[i].test(name)) { return true; } } return false; } /** * Convert regexp to namespace * * @param {RegExp} regxep * @return {String} namespace * @api private */ function toNamespace(regexp) { return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, '*'); } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } createDebug.enable(createDebug.load()); return createDebug; } module.exports = setup; }, { "ms": 1 }], 4: [function (require, module, exports) { (function (process) { /* eslint-env browser */ /** * This is the web browser implementation of `debug()`. */ exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); /** * Colors. */ exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33']; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ // eslint-disable-next-line complexity function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { return true; } // Internet Explorer and Edge do not support colors. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); } /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); if (!this.useColors) { return; } var c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into var index = 0; var lastC = 0; args[0].replace(/%[a-zA-Z%]/g, function (match) { if (match === '%%') { return; } index++; if (match === '%c') { // We only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.log()` when available. * No-op when `console.log` is not a "function". * * @api public */ function log() { var _console; // This hackery is required for IE8/9, where // the `console.log` function doesn't have 'apply' return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (namespaces) { exports.storage.setItem('debug', namespaces); } else { exports.storage.removeItem('debug'); } } catch (error) {// Swallow // XXX (@Qix-) should we be logging these? } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { var r; try { r = exports.storage.getItem('debug'); } catch (error) {} // Swallow // XXX (@Qix-) should we be logging these? // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context // The Browser also has localStorage in the global context. return localStorage; } catch (error) {// Swallow // XXX (@Qix-) should we be logging these? } } module.exports = require('./common')(exports); var formatters = module.exports.formatters; /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ formatters.j = function (v) { try { return JSON.stringify(v); } catch (error) { return '[UnexpectedJSONParseError]: ' + error.message; } }; }).call(this, require('_process')); }, { "./common": 3, "_process": 2 }] }, {}, [4])(4); }); /* eslint-env browser */ /** * This is the web browser implementation of `debug()`. */ exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); /** * Colors. */ exports.colors = [ '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33' ]; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ // eslint-disable-next-line complexity function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { return true; } // Internet Explorer and Edge do not support colors. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || // Is firebug? http://stackoverflow.com/a/398120/376773 (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || // Double check webkit in userAgent just in case we are in a worker (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); } /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); if (!this.useColors) { return; } const c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into let index = 0; let lastC = 0; args[0].replace(/%[a-zA-Z%]/g, match => { if (match === '%%') { return; } index++; if (match === '%c') { // We only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.log()` when available. * No-op when `console.log` is not a "function". * * @api public */ function log(...args) { // This hackery is required for IE8/9, where // the `console.log` function doesn't have 'apply' return typeof console === 'object' && console.log && console.log(...args); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (namespaces) { exports.storage.setItem('debug', namespaces); } else { exports.storage.removeItem('debug'); } } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { let r; try { r = exports.storage.getItem('debug'); } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context // The Browser also has localStorage in the global context. return localStorage; } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } module.exports = require('./common')(exports); const {formatters} = module.exports; /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ formatters.j = function (v) { try { return JSON.stringify(v); } catch (error) { return '[UnexpectedJSONParseError]: ' + error.message; } }; /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. */ function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = require('ms'); Object.keys(env).forEach(key => { createDebug[key] = env[key]; }); /** * Active `debug` instances. */ createDebug.instances = []; /** * The currently active debug mode names, and names to skip. */ createDebug.names = []; createDebug.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ createDebug.formatters = {}; /** * Selects a color for a debug namespace * @param {String} namespace The namespace string for the for the debug instance to be colored * @return {Number|String} An ANSI color code for the given namespace * @api private */ function selectColor(namespace) { let hash = 0; for (let i = 0; i < namespace.length; i++) { hash = ((hash << 5) - hash) + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { let prevTime; function debug(...args) { // Disabled? if (!debug.enabled) { return; } const self = debug; // Set `diff` timestamp const curr = Number(new Date()); const ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== 'string') { // Anything else let's inspect with %O args.unshift('%O'); } // Apply any `formatters` transformations let index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { // If we encounter an escaped % then don't increase the array index if (match === '%%') { return match; } index++; const formatter = createDebug.formatters[format]; if (typeof formatter === 'function') { const val = args[index]; match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // Apply env-specific formatting (colors, etc.) createDebug.formatArgs.call(self, args); const logFn = self.log || createDebug.log; logFn.apply(self, args); } debug.namespace = namespace; debug.enabled = createDebug.enabled(namespace); debug.useColors = createDebug.useColors(); debug.color = selectColor(namespace); debug.destroy = destroy; debug.extend = extend; // Debug.formatArgs = formatArgs; // debug.rawLog = rawLog; // env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } createDebug.instances.push(debug); return debug; } function destroy() { const index = createDebug.instances.indexOf(this); if (index !== -1) { createDebug.instances.splice(index, 1); return true; } return false; } function extend(namespace, delimiter) { const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); newDebug.log = this.log; return newDebug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { createDebug.save(namespaces); createDebug.names = []; createDebug.skips = []; let i; const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); const len = split.length; for (i = 0; i < len; i++) { if (!split[i]) { // ignore empty strings continue; } namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else { createDebug.names.push(new RegExp('^' + namespaces + '$')); } } for (i = 0; i < createDebug.instances.length; i++) { const instance = createDebug.instances[i]; instance.enabled = createDebug.enabled(instance.namespace); } } /** * Disable debug output. * * @return {String} namespaces * @api public */ function disable() { const namespaces = [ ...createDebug.names.map(toNamespace), ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) ].join(','); createDebug.enable(''); return namespaces; } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { if (name[name.length - 1] === '*') { return true; } let i; let len; for (i = 0, len = createDebug.skips.length; i < len; i++) { if (createDebug.skips[i].test(name)) { return false; } } for (i = 0, len = createDebug.names.length; i < len; i++) { if (createDebug.names[i].test(name)) { return true; } } return false; } /** * Convert regexp to namespace * * @param {RegExp} regxep * @return {String} namespace * @api private */ function toNamespace(regexp) { return regexp.toString() .substring(2, regexp.toString().length - 2) .replace(/\.\*\?$/, '*'); } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } createDebug.enable(createDebug.load()); return createDebug; } module.exports = setup; /** * Detect Electron renderer / nwjs process, which is node, but we should * treat as a browser. */ if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { module.exports = require('./browser.js'); } else { module.exports = require('./node.js'); } /** * Module dependencies. */ const tty = require('tty'); const util = require('util'); /** * This is the Node.js implementation of `debug()`. */ exports.init = init; exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; /** * Colors. */ exports.colors = [6, 2, 3, 4, 5, 1]; try { // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) // eslint-disable-next-line import/no-extraneous-dependencies const supportsColor = require('supports-color'); if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { exports.colors = [ 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221 ]; } } catch (error) { // Swallow - we only care if `supports-color` is available; it doesn't have to be. } /** * Build up the default `inspectOpts` object from the environment variables. * * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js */ exports.inspectOpts = Object.keys(process.env).filter(key => { return /^debug_/i.test(key); }).reduce((obj, key) => { // Camel-case const prop = key .substring(6) .toLowerCase() .replace(/_([a-z])/g, (_, k) => { return k.toUpperCase(); }); // Coerce string value into JS value let val = process.env[key]; if (/^(yes|on|true|enabled)$/i.test(val)) { val = true; } else if (/^(no|off|false|disabled)$/i.test(val)) { val = false; } else if (val === 'null') { val = null; } else { val = Number(val); } obj[prop] = val; return obj; }, {}); /** * Is stdout a TTY? Colored output is enabled when `true`. */ function useColors() { return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd); } /** * Adds ANSI color escape codes if enabled. * * @api public */ function formatArgs(args) { const {namespace: name, useColors} = this; if (useColors) { const c = this.color; const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); const prefix = ` ${colorCode};1m${name} \u001B[0m`; args[0] = prefix + args[0].split('\n').join('\n' + prefix); args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); } else { args[0] = getDate() + name + ' ' + args[0]; } } function getDate() { if (exports.inspectOpts.hideDate) { return ''; } return new Date().toISOString() + ' '; } /** * Invokes `util.format()` with the specified arguments and writes to stderr. */ function log(...args) { return process.stderr.write(util.format(...args) + '\n'); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { if (namespaces) { process.env.DEBUG = namespaces; } else { // If you set a process.env field to null or undefined, it gets cast to the // string 'null' or 'undefined'. Just delete instead. delete process.env.DEBUG; } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { return process.env.DEBUG; } /** * Init logic for `debug` instances. * * Create a new `inspectOpts` object in case `useColors` is set * differently for a particular `debug` instance. */ function init(debug) { debug.inspectOpts = {}; const keys = Object.keys(exports.inspectOpts); for (let i = 0; i < keys.length; i++) { debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; } } module.exports = require('./common')(exports); const {formatters} = module.exports; /** * Map %o to `util.inspect()`, all on a single line. */ formatters.o = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts) .replace(/\s*\n\s*/g, ' '); }; /** * Map %O to `util.inspect()`, allowing multiple lines if needed. */ formatters.O = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts); }; { "name": "agent-base", "version": "6.0.1", "description": "Turn a function into an `http.Agent` instance", "main": "dist/src/index", "typings": "dist/src/index", "files": [ "dist/src", "src" ], "scripts": { "prebuild": "rimraf dist", "build": "tsc", "postbuild": "cpy --parents src test '!**/*.ts' dist", "test": "mocha --reporter spec dist/test/*.js", "test-lint": "eslint src --ext .js,.ts", "prepublishOnly": "npm run build" }, "repository": { "type": "git", "url": "git://github.com/TooTallNate/node-agent-base.git" }, "keywords": [ "http", "agent", "base", "barebones", "https" ], "author": "Nathan Rajlich (http://n8.io/)", "license": "MIT", "bugs": { "url": "https://github.com/TooTallNate/node-agent-base/issues" }, "dependencies": { "debug": "4" }, "devDependencies": { "@types/debug": "4", "@types/mocha": "^5.2.7", "@types/node": "^12.12.17", "@types/semver": "^7.1.0", "@types/ws": "^6.0.3", "@typescript-eslint/eslint-plugin": "1.6.0", "@typescript-eslint/parser": "1.1.0", "async-listen": "^1.2.0", "cpy-cli": "^2.0.0", "eslint": "5.16.0", "eslint-config-airbnb": "17.1.0", "eslint-config-prettier": "4.1.0", "eslint-import-resolver-typescript": "1.1.1", "eslint-plugin-import": "2.16.0", "eslint-plugin-jsx-a11y": "6.2.1", "eslint-plugin-react": "7.12.4", "mocha": "^6.2.0", "rimraf": "^3.0.0", "semver": "^7.1.2", "typescript": "^3.5.3", "ws": "^3.0.0" }, "engines": { "node": ">= 6.0.0" } } /** * Module dependencies. */ var fs = require('fs'), path = require('path'), fileURLToPath = require('file-uri-to-path'), join = path.join, dirname = path.dirname, exists = (fs.accessSync && function(path) { try { fs.accessSync(path); } catch (e) { return false; } return true; }) || fs.existsSync || path.existsSync, defaults = { arrow: process.env.NODE_BINDINGS_ARROW || ' → ', compiled: process.env.NODE_BINDINGS_COMPILED_DIR || 'compiled', platform: process.platform, arch: process.arch, nodePreGyp: 'node-v' + process.versions.modules + '-' + process.platform + '-' + process.arch, version: process.versions.node, bindings: 'bindings.node', try: [ // node-gyp's linked version in the "build" dir ['module_root', 'build', 'bindings'], // node-waf and gyp_addon (a.k.a node-gyp) ['module_root', 'build', 'Debug', 'bindings'], ['module_root', 'build', 'Release', 'bindings'], // Debug files, for development (legacy behavior, remove for node v0.9) ['module_root', 'out', 'Debug', 'bindings'], ['module_root', 'Debug', 'bindings'], // Release files, but manually compiled (legacy behavior, remove for node v0.9) ['module_root', 'out', 'Release', 'bindings'], ['module_root', 'Release', 'bindings'], // Legacy from node-waf, node <= 0.4.x ['module_root', 'build', 'default', 'bindings'], // Production "Release" buildtype binary (meh...) ['module_root', 'compiled', 'version', 'platform', 'arch', 'bindings'], // node-qbs builds ['module_root', 'addon-build', 'release', 'install-root', 'bindings'], ['module_root', 'addon-build', 'debug', 'install-root', 'bindings'], ['module_root', 'addon-build', 'default', 'install-root', 'bindings'], // node-pre-gyp path ./lib/binding/{node_abi}-{platform}-{arch} ['module_root', 'lib', 'binding', 'nodePreGyp', 'bindings'] ] }; /** * The main `bindings()` function loads the compiled bindings for a given module. * It uses V8's Error API to determine the parent filename that this function is * being invoked from, which is then used to find the root directory. */ function bindings(opts) { // Argument surgery if (typeof opts == 'string') { opts = { bindings: opts }; } else if (!opts) { opts = {}; } // maps `defaults` onto `opts` object Object.keys(defaults).map(function(i) { if (!(i in opts)) opts[i] = defaults[i]; }); // Get the module root if (!opts.module_root) { opts.module_root = exports.getRoot(exports.getFileName()); } // Ensure the given bindings name ends with .node if (path.extname(opts.bindings) != '.node') { opts.bindings += '.node'; } // https://github.com/webpack/webpack/issues/4175#issuecomment-342931035 var requireFunc = typeof __webpack_require__ === 'function' ? __non_webpack_require__ : require; var tries = [], i = 0, l = opts.try.length, n, b, err; for (; i < l; i++) { n = join.apply( null, opts.try[i].map(function(p) { return opts[p] || p; }) ); tries.push(n); try { b = opts.path ? requireFunc.resolve(n) : requireFunc(n); if (!opts.path) { b.path = n; } return b; } catch (e) { if (e.code !== 'MODULE_NOT_FOUND' && e.code !== 'QUALIFIED_PATH_RESOLUTION_FAILED' && !/not find/i.test(e.message)) { throw e; } } } err = new Error( 'Could not locate the bindings file. Tried:\n' + tries .map(function(a) { return opts.arrow + a; }) .join('\n') ); err.tries = tries; throw err; } module.exports = exports = bindings; /** * Gets the filename of the JavaScript file that invokes this function. * Used to help find the root directory of a module. * Optionally accepts an filename argument to skip when searching for the invoking filename */ exports.getFileName = function getFileName(calling_file) { var origPST = Error.prepareStackTrace, origSTL = Error.stackTraceLimit, dummy = {}, fileName; Error.stackTraceLimit = 10; Error.prepareStackTrace = function(e, st) { for (var i = 0, l = st.length; i < l; i++) { fileName = st[i].getFileName(); if (fileName !== __filename) { if (calling_file) { if (fileName !== calling_file) { return; } } else { return; } } } }; // run the 'prepareStackTrace' function above Error.captureStackTrace(dummy); dummy.stack; // cleanup Error.prepareStackTrace = origPST; Error.stackTraceLimit = origSTL; // handle filename that starts with "file://" var fileSchema = 'file://'; if (fileName.indexOf(fileSchema) === 0) { fileName = fileURLToPath(fileName); } return fileName; }; /** * Gets the root directory of a module, given an arbitrary filename * somewhere in the module tree. The "root directory" is the directory * containing the `package.json` file. * * In: /home/nate/node-native-module/lib/index.js * Out: /home/nate/node-native-module */ exports.getRoot = function getRoot(file) { var dir = dirname(file), prev; while (true) { if (dir === '.') { // Avoids an infinite loop in rare cases, like the REPL dir = process.cwd(); } if ( exists(join(dir, 'package.json')) || exists(join(dir, 'node_modules')) ) { // Found the 'package.json' file or 'node_modules' dir; we're done return dir; } if (prev === dir) { // Got to the top throw new Error( 'Could not find module root given file: "' + file + '". Do you have a `package.json` file? ' ); } // Try the parent dir next prev = dir; dir = join(dir, '..'); } }; (The MIT License) Copyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "bindings", "description": "Helper module for loading your native module's .node file", "keywords": [ "native", "addon", "bindings", "gyp", "waf", "c", "c++" ], "version": "1.5.0", "author": "Nathan Rajlich (http://tootallnate.net)", "repository": { "type": "git", "url": "git://github.com/TooTallNate/node-bindings.git" }, "main": "./bindings.js", "bugs": { "url": "https://github.com/TooTallNate/node-bindings/issues" }, "homepage": "https://github.com/TooTallNate/node-bindings", "license": "MIT", "dependencies": { "file-uri-to-path": "1.0.0" } } 'use strict' const fs = require('fs') const path = require('path') /* istanbul ignore next */ const LCHOWN = fs.lchown ? 'lchown' : 'chown' /* istanbul ignore next */ const LCHOWNSYNC = fs.lchownSync ? 'lchownSync' : 'chownSync' /* istanbul ignore next */ const needEISDIRHandled = fs.lchown && !process.version.match(/v1[1-9]+\./) && !process.version.match(/v10\.[6-9]/) const lchownSync = (path, uid, gid) => { try { return fs[LCHOWNSYNC](path, uid, gid) } catch (er) { if (er.code !== 'ENOENT') throw er } } /* istanbul ignore next */ const chownSync = (path, uid, gid) => { try { return fs.chownSync(path, uid, gid) } catch (er) { if (er.code !== 'ENOENT') throw er } } /* istanbul ignore next */ const handleEISDIR = needEISDIRHandled ? (path, uid, gid, cb) => er => { // Node prior to v10 had a very questionable implementation of // fs.lchown, which would always try to call fs.open on a directory // Fall back to fs.chown in those cases. if (!er || er.code !== 'EISDIR') cb(er) else fs.chown(path, uid, gid, cb) } : (_, __, ___, cb) => cb /* istanbul ignore next */ const handleEISDirSync = needEISDIRHandled ? (path, uid, gid) => { try { return lchownSync(path, uid, gid) } catch (er) { if (er.code !== 'EISDIR') throw er chownSync(path, uid, gid) } } : (path, uid, gid) => lchownSync(path, uid, gid) // fs.readdir could only accept an options object as of node v6 const nodeVersion = process.version let readdir = (path, options, cb) => fs.readdir(path, options, cb) let readdirSync = (path, options) => fs.readdirSync(path, options) /* istanbul ignore next */ if (/^v4\./.test(nodeVersion)) readdir = (path, options, cb) => fs.readdir(path, cb) const chown = (cpath, uid, gid, cb) => { fs[LCHOWN](cpath, uid, gid, handleEISDIR(cpath, uid, gid, er => { // Skip ENOENT error cb(er && er.code !== 'ENOENT' ? er : null) })) } const chownrKid = (p, child, uid, gid, cb) => { if (typeof child === 'string') return fs.lstat(path.resolve(p, child), (er, stats) => { // Skip ENOENT error if (er) return cb(er.code !== 'ENOENT' ? er : null) stats.name = child chownrKid(p, stats, uid, gid, cb) }) if (child.isDirectory()) { chownr(path.resolve(p, child.name), uid, gid, er => { if (er) return cb(er) const cpath = path.resolve(p, child.name) chown(cpath, uid, gid, cb) }) } else { const cpath = path.resolve(p, child.name) chown(cpath, uid, gid, cb) } } const chownr = (p, uid, gid, cb) => { readdir(p, { withFileTypes: true }, (er, children) => { // any error other than ENOTDIR or ENOTSUP means it's not readable, // or doesn't exist. give up. if (er) { if (er.code === 'ENOENT') return cb() else if (er.code !== 'ENOTDIR' && er.code !== 'ENOTSUP') return cb(er) } if (er || !children.length) return chown(p, uid, gid, cb) let len = children.length let errState = null const then = er => { if (errState) return if (er) return cb(errState = er) if (-- len === 0) return chown(p, uid, gid, cb) } children.forEach(child => chownrKid(p, child, uid, gid, then)) }) } const chownrKidSync = (p, child, uid, gid) => { if (typeof child === 'string') { try { const stats = fs.lstatSync(path.resolve(p, child)) stats.name = child child = stats } catch (er) { if (er.code === 'ENOENT') return else throw er } } if (child.isDirectory()) chownrSync(path.resolve(p, child.name), uid, gid) handleEISDirSync(path.resolve(p, child.name), uid, gid) } const chownrSync = (p, uid, gid) => { let children try { children = readdirSync(p, { withFileTypes: true }) } catch (er) { if (er.code === 'ENOENT') return else if (er.code === 'ENOTDIR' || er.code === 'ENOTSUP') return handleEISDirSync(p, uid, gid) else throw er } if (children && children.length) children.forEach(child => chownrKidSync(p, child, uid, gid)) return handleEISDirSync(p, uid, gid) } module.exports = chownr chownr.sync = chownrSync The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "name": "chownr", "description": "like `chown -R`", "version": "2.0.0", "repository": { "type": "git", "url": "git://github.com/isaacs/chownr.git" }, "main": "chownr.js", "files": [ "chownr.js" ], "devDependencies": { "mkdirp": "0.3", "rimraf": "^2.7.1", "tap": "^14.10.6" }, "tap": { "check-coverage": true }, "scripts": { "test": "tap", "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags" }, "license": "ISC", "engines": { "node": ">=10" } } (The MIT License) Copyright (c) 2014 TJ Holowaychuk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "debug", "version": "4.3.1", "repository": { "type": "git", "url": "git://github.com/visionmedia/debug.git" }, "description": "small debugging utility", "keywords": [ "debug", "log", "debugger" ], "files": [ "src", "LICENSE", "README.md" ], "author": "TJ Holowaychuk ", "contributors": [ "Nathan Rajlich (http://n8.io)", "Andrew Rhyne ", "Josh Junon " ], "license": "MIT", "scripts": { "lint": "xo", "test": "npm run test:node && npm run test:browser && npm run lint", "test:node": "istanbul cover _mocha -- test.js", "test:browser": "karma start --single-run", "test:coverage": "cat ./coverage/lcov.info | coveralls" }, "dependencies": { "ms": "2.1.2" }, "devDependencies": { "brfs": "^2.0.1", "browserify": "^16.2.3", "coveralls": "^3.0.2", "istanbul": "^0.4.5", "karma": "^3.1.4", "karma-browserify": "^6.0.0", "karma-chrome-launcher": "^2.2.0", "karma-mocha": "^1.3.0", "mocha": "^5.2.0", "mocha-lcov-reporter": "^1.2.0", "xo": "^0.23.0" }, "peerDependenciesMeta": { "supports-color": { "optional": true } }, "main": "./src/index.js", "browser": "./src/browser.js", "engines": { "node": ">=6.0" } } /* eslint-env browser */ /** * This is the web browser implementation of `debug()`. */ exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); exports.destroy = (() => { let warned = false; return () => { if (!warned) { warned = true; console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); } }; })(); /** * Colors. */ exports.colors = [ '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33' ]; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ // eslint-disable-next-line complexity function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { return true; } // Internet Explorer and Edge do not support colors. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || // Is firebug? http://stackoverflow.com/a/398120/376773 (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || // Double check webkit in userAgent just in case we are in a worker (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); } /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); if (!this.useColors) { return; } const c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into let index = 0; let lastC = 0; args[0].replace(/%[a-zA-Z%]/g, match => { if (match === '%%') { return; } index++; if (match === '%c') { // We only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.debug()` when available. * No-op when `console.debug` is not a "function". * If `console.debug` is not available, falls back * to `console.log`. * * @api public */ exports.log = console.debug || console.log || (() => {}); /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (namespaces) { exports.storage.setItem('debug', namespaces); } else { exports.storage.removeItem('debug'); } } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { let r; try { r = exports.storage.getItem('debug'); } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context // The Browser also has localStorage in the global context. return localStorage; } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } module.exports = require('./common')(exports); const {formatters} = module.exports; /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ formatters.j = function (v) { try { return JSON.stringify(v); } catch (error) { return '[UnexpectedJSONParseError]: ' + error.message; } }; /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. */ function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = require('ms'); createDebug.destroy = destroy; Object.keys(env).forEach(key => { createDebug[key] = env[key]; }); /** * The currently active debug mode names, and names to skip. */ createDebug.names = []; createDebug.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ createDebug.formatters = {}; /** * Selects a color for a debug namespace * @param {String} namespace The namespace string for the for the debug instance to be colored * @return {Number|String} An ANSI color code for the given namespace * @api private */ function selectColor(namespace) { let hash = 0; for (let i = 0; i < namespace.length; i++) { hash = ((hash << 5) - hash) + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { let prevTime; let enableOverride = null; function debug(...args) { // Disabled? if (!debug.enabled) { return; } const self = debug; // Set `diff` timestamp const curr = Number(new Date()); const ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== 'string') { // Anything else let's inspect with %O args.unshift('%O'); } // Apply any `formatters` transformations let index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { // If we encounter an escaped % then don't increase the array index if (match === '%%') { return '%'; } index++; const formatter = createDebug.formatters[format]; if (typeof formatter === 'function') { const val = args[index]; match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // Apply env-specific formatting (colors, etc.) createDebug.formatArgs.call(self, args); const logFn = self.log || createDebug.log; logFn.apply(self, args); } debug.namespace = namespace; debug.useColors = createDebug.useColors(); debug.color = createDebug.selectColor(namespace); debug.extend = extend; debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. Object.defineProperty(debug, 'enabled', { enumerable: true, configurable: false, get: () => enableOverride === null ? createDebug.enabled(namespace) : enableOverride, set: v => { enableOverride = v; } }); // Env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } return debug; } function extend(namespace, delimiter) { const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); newDebug.log = this.log; return newDebug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { createDebug.save(namespaces); createDebug.names = []; createDebug.skips = []; let i; const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); const len = split.length; for (i = 0; i < len; i++) { if (!split[i]) { // ignore empty strings continue; } namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else { createDebug.names.push(new RegExp('^' + namespaces + '$')); } } } /** * Disable debug output. * * @return {String} namespaces * @api public */ function disable() { const namespaces = [ ...createDebug.names.map(toNamespace), ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) ].join(','); createDebug.enable(''); return namespaces; } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { if (name[name.length - 1] === '*') { return true; } let i; let len; for (i = 0, len = createDebug.skips.length; i < len; i++) { if (createDebug.skips[i].test(name)) { return false; } } for (i = 0, len = createDebug.names.length; i < len; i++) { if (createDebug.names[i].test(name)) { return true; } } return false; } /** * Convert regexp to namespace * * @param {RegExp} regxep * @return {String} namespace * @api private */ function toNamespace(regexp) { return regexp.toString() .substring(2, regexp.toString().length - 2) .replace(/\.\*\?$/, '*'); } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } /** * XXX DO NOT USE. This is a temporary stub function. * XXX It WILL be removed in the next major release. */ function destroy() { console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); } createDebug.enable(createDebug.load()); return createDebug; } module.exports = setup; /** * Detect Electron renderer / nwjs process, which is node, but we should * treat as a browser. */ if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { module.exports = require('./browser.js'); } else { module.exports = require('./node.js'); } /** * Module dependencies. */ const tty = require('tty'); const util = require('util'); /** * This is the Node.js implementation of `debug()`. */ exports.init = init; exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.destroy = util.deprecate( () => {}, 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' ); /** * Colors. */ exports.colors = [6, 2, 3, 4, 5, 1]; try { // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) // eslint-disable-next-line import/no-extraneous-dependencies const supportsColor = require('supports-color'); if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { exports.colors = [ 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221 ]; } } catch (error) { // Swallow - we only care if `supports-color` is available; it doesn't have to be. } /** * Build up the default `inspectOpts` object from the environment variables. * * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js */ exports.inspectOpts = Object.keys(process.env).filter(key => { return /^debug_/i.test(key); }).reduce((obj, key) => { // Camel-case const prop = key .substring(6) .toLowerCase() .replace(/_([a-z])/g, (_, k) => { return k.toUpperCase(); }); // Coerce string value into JS value let val = process.env[key]; if (/^(yes|on|true|enabled)$/i.test(val)) { val = true; } else if (/^(no|off|false|disabled)$/i.test(val)) { val = false; } else if (val === 'null') { val = null; } else { val = Number(val); } obj[prop] = val; return obj; }, {}); /** * Is stdout a TTY? Colored output is enabled when `true`. */ function useColors() { return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd); } /** * Adds ANSI color escape codes if enabled. * * @api public */ function formatArgs(args) { const {namespace: name, useColors} = this; if (useColors) { const c = this.color; const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); const prefix = ` ${colorCode};1m${name} \u001B[0m`; args[0] = prefix + args[0].split('\n').join('\n' + prefix); args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); } else { args[0] = getDate() + name + ' ' + args[0]; } } function getDate() { if (exports.inspectOpts.hideDate) { return ''; } return new Date().toISOString() + ' '; } /** * Invokes `util.format()` with the specified arguments and writes to stderr. */ function log(...args) { return process.stderr.write(util.format(...args) + '\n'); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { if (namespaces) { process.env.DEBUG = namespaces; } else { // If you set a process.env field to null or undefined, it gets cast to the // string 'null' or 'undefined'. Just delete instead. delete process.env.DEBUG; } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { return process.env.DEBUG; } /** * Init logic for `debug` instances. * * Create a new `inspectOpts` object in case `useColors` is set * differently for a particular `debug` instance. */ function init(debug) { debug.inspectOpts = {}; const keys = Object.keys(exports.inspectOpts); for (let i = 0; i < keys.length; i++) { debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; } } module.exports = require('./common')(exports); const {formatters} = module.exports; /** * Map %o to `util.inspect()`, all on a single line. */ formatters.o = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts) .split('\n') .map(str => str.trim()) .join(' '); }; /** * Map %O to `util.inspect()`, allowing multiple lines if needed. */ formatters.O = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts); }; /** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; var w = d * 7; var y = d * 365.25; /** * Parse or format the given `val`. * * Options: * * - `long` verbose formatting [false] * * @param {String|Number} val * @param {Object} [options] * @throws {Error} throw an error if val is not a non-empty string or a number * @return {String|Number} * @api public */ module.exports = function(val, options) { options = options || {}; var type = typeof val; if (type === 'string' && val.length > 0) { return parse(val); } else if (type === 'number' && isFinite(val)) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error( 'val is not a non-empty string or a valid number. val=' + JSON.stringify(val) ); }; /** * Parse the given `str` and return milliseconds. * * @param {String} str * @return {Number} * @api private */ function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( str ); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'yrs': case 'yr': case 'y': return n * y; case 'weeks': case 'week': case 'w': return n * w; case 'days': case 'day': case 'd': return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': return n * m; case 'seconds': case 'second': case 'secs': case 'sec': case 's': return n * s; case 'milliseconds': case 'millisecond': case 'msecs': case 'msec': case 'ms': return n; default: return undefined; } } /** * Short format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtShort(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return Math.round(ms / d) + 'd'; } if (msAbs >= h) { return Math.round(ms / h) + 'h'; } if (msAbs >= m) { return Math.round(ms / m) + 'm'; } if (msAbs >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtLong(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return plural(ms, msAbs, d, 'day'); } if (msAbs >= h) { return plural(ms, msAbs, h, 'hour'); } if (msAbs >= m) { return plural(ms, msAbs, m, 'minute'); } if (msAbs >= s) { return plural(ms, msAbs, s, 'second'); } return ms + ' ms'; } /** * Pluralization helper. */ function plural(ms, msAbs, n, name) { var isPlural = msAbs >= n * 1.5; return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); } The MIT License (MIT) Copyright (c) 2016 Zeit, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "ms", "version": "2.1.2", "description": "Tiny millisecond conversion utility", "repository": "zeit/ms", "main": "./index", "files": [ "index.js" ], "scripts": { "precommit": "lint-staged", "lint": "eslint lib/* bin/*", "test": "mocha tests.js" }, "eslintConfig": { "extends": "eslint:recommended", "env": { "node": true, "es6": true } }, "lint-staged": { "*.js": [ "npm run lint", "prettier --single-quote --write", "git add" ] }, "license": "MIT", "devDependencies": { "eslint": "4.12.1", "expect.js": "0.3.1", "husky": "0.14.3", "lint-staged": "5.0.0", "mocha": "4.0.1" } } 'use strict' // A linked list to keep track of recently-used-ness const Yallist = require('yallist') const MAX = Symbol('max') const LENGTH = Symbol('length') const LENGTH_CALCULATOR = Symbol('lengthCalculator') const ALLOW_STALE = Symbol('allowStale') const MAX_AGE = Symbol('maxAge') const DISPOSE = Symbol('dispose') const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet') const LRU_LIST = Symbol('lruList') const CACHE = Symbol('cache') const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet') const naiveLength = () => 1 // lruList is a yallist where the head is the youngest // item, and the tail is the oldest. the list contains the Hit // objects as the entries. // Each Hit object has a reference to its Yallist.Node. This // never changes. // // cache is a Map (or PseudoMap) that matches the keys to // the Yallist.Node object. class LRUCache { constructor (options) { if (typeof options === 'number') options = { max: options } if (!options) options = {} if (options.max && (typeof options.max !== 'number' || options.max < 0)) throw new TypeError('max must be a non-negative number') // Kind of weird to have a default max of Infinity, but oh well. const max = this[MAX] = options.max || Infinity const lc = options.length || naiveLength this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc this[ALLOW_STALE] = options.stale || false if (options.maxAge && typeof options.maxAge !== 'number') throw new TypeError('maxAge must be a number') this[MAX_AGE] = options.maxAge || 0 this[DISPOSE] = options.dispose this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false this.reset() } // resize the cache when the max changes. set max (mL) { if (typeof mL !== 'number' || mL < 0) throw new TypeError('max must be a non-negative number') this[MAX] = mL || Infinity trim(this) } get max () { return this[MAX] } set allowStale (allowStale) { this[ALLOW_STALE] = !!allowStale } get allowStale () { return this[ALLOW_STALE] } set maxAge (mA) { if (typeof mA !== 'number') throw new TypeError('maxAge must be a non-negative number') this[MAX_AGE] = mA trim(this) } get maxAge () { return this[MAX_AGE] } // resize the cache when the lengthCalculator changes. set lengthCalculator (lC) { if (typeof lC !== 'function') lC = naiveLength if (lC !== this[LENGTH_CALCULATOR]) { this[LENGTH_CALCULATOR] = lC this[LENGTH] = 0 this[LRU_LIST].forEach(hit => { hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key) this[LENGTH] += hit.length }) } trim(this) } get lengthCalculator () { return this[LENGTH_CALCULATOR] } get length () { return this[LENGTH] } get itemCount () { return this[LRU_LIST].length } rforEach (fn, thisp) { thisp = thisp || this for (let walker = this[LRU_LIST].tail; walker !== null;) { const prev = walker.prev forEachStep(this, fn, walker, thisp) walker = prev } } forEach (fn, thisp) { thisp = thisp || this for (let walker = this[LRU_LIST].head; walker !== null;) { const next = walker.next forEachStep(this, fn, walker, thisp) walker = next } } keys () { return this[LRU_LIST].toArray().map(k => k.key) } values () { return this[LRU_LIST].toArray().map(k => k.value) } reset () { if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) { this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value)) } this[CACHE] = new Map() // hash of items by key this[LRU_LIST] = new Yallist() // list of items in order of use recency this[LENGTH] = 0 // length of items in the list } dump () { return this[LRU_LIST].map(hit => isStale(this, hit) ? false : { k: hit.key, v: hit.value, e: hit.now + (hit.maxAge || 0) }).toArray().filter(h => h) } dumpLru () { return this[LRU_LIST] } set (key, value, maxAge) { maxAge = maxAge || this[MAX_AGE] if (maxAge && typeof maxAge !== 'number') throw new TypeError('maxAge must be a number') const now = maxAge ? Date.now() : 0 const len = this[LENGTH_CALCULATOR](value, key) if (this[CACHE].has(key)) { if (len > this[MAX]) { del(this, this[CACHE].get(key)) return false } const node = this[CACHE].get(key) const item = node.value // dispose of the old one before overwriting // split out into 2 ifs for better coverage tracking if (this[DISPOSE]) { if (!this[NO_DISPOSE_ON_SET]) this[DISPOSE](key, item.value) } item.now = now item.maxAge = maxAge item.value = value this[LENGTH] += len - item.length item.length = len this.get(key) trim(this) return true } const hit = new Entry(key, value, len, now, maxAge) // oversized objects fall out of cache automatically. if (hit.length > this[MAX]) { if (this[DISPOSE]) this[DISPOSE](key, value) return false } this[LENGTH] += hit.length this[LRU_LIST].unshift(hit) this[CACHE].set(key, this[LRU_LIST].head) trim(this) return true } has (key) { if (!this[CACHE].has(key)) return false const hit = this[CACHE].get(key).value return !isStale(this, hit) } get (key) { return get(this, key, true) } peek (key) { return get(this, key, false) } pop () { const node = this[LRU_LIST].tail if (!node) return null del(this, node) return node.value } del (key) { del(this, this[CACHE].get(key)) } load (arr) { // reset the cache this.reset() const now = Date.now() // A previous serialized cache has the most recent items first for (let l = arr.length - 1; l >= 0; l--) { const hit = arr[l] const expiresAt = hit.e || 0 if (expiresAt === 0) // the item was created without expiration in a non aged cache this.set(hit.k, hit.v) else { const maxAge = expiresAt - now // dont add already expired items if (maxAge > 0) { this.set(hit.k, hit.v, maxAge) } } } } prune () { this[CACHE].forEach((value, key) => get(this, key, false)) } } const get = (self, key, doUse) => { const node = self[CACHE].get(key) if (node) { const hit = node.value if (isStale(self, hit)) { del(self, node) if (!self[ALLOW_STALE]) return undefined } else { if (doUse) { if (self[UPDATE_AGE_ON_GET]) node.value.now = Date.now() self[LRU_LIST].unshiftNode(node) } } return hit.value } } const isStale = (self, hit) => { if (!hit || (!hit.maxAge && !self[MAX_AGE])) return false const diff = Date.now() - hit.now return hit.maxAge ? diff > hit.maxAge : self[MAX_AGE] && (diff > self[MAX_AGE]) } const trim = self => { if (self[LENGTH] > self[MAX]) { for (let walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null;) { // We know that we're about to delete this one, and also // what the next least recently used key will be, so just // go ahead and set it now. const prev = walker.prev del(self, walker) walker = prev } } } const del = (self, node) => { if (node) { const hit = node.value if (self[DISPOSE]) self[DISPOSE](hit.key, hit.value) self[LENGTH] -= hit.length self[CACHE].delete(hit.key) self[LRU_LIST].removeNode(node) } } class Entry { constructor (key, value, length, now, maxAge) { this.key = key this.value = value this.length = length this.now = now this.maxAge = maxAge || 0 } } const forEachStep = (self, fn, node, thisp) => { let hit = node.value if (isStale(self, hit)) { del(self, node) if (!self[ALLOW_STALE]) hit = undefined } if (hit) fn.call(thisp, hit.value, hit.key, self) } module.exports = LRUCache The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "lru-cache", "description": "A cache object that deletes the least-recently-used items.", "version": "6.0.0", "author": "Isaac Z. Schlueter ", "keywords": [ "mru", "lru", "cache" ], "scripts": { "test": "tap", "snap": "tap", "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags" }, "main": "index.js", "repository": "git://github.com/isaacs/node-lru-cache.git", "devDependencies": { "benchmark": "^2.1.4", "tap": "^14.10.7" }, "license": "ISC", "dependencies": { "yallist": "^4.0.0" }, "files": [ "index.js" ], "engines": { "node": ">=10" } } 'use strict' const EE = require('events') const Stream = require('stream') const Yallist = require('yallist') const SD = require('string_decoder').StringDecoder const EOF = Symbol('EOF') const MAYBE_EMIT_END = Symbol('maybeEmitEnd') const EMITTED_END = Symbol('emittedEnd') const EMITTING_END = Symbol('emittingEnd') const CLOSED = Symbol('closed') const READ = Symbol('read') const FLUSH = Symbol('flush') const FLUSHCHUNK = Symbol('flushChunk') const ENCODING = Symbol('encoding') const DECODER = Symbol('decoder') const FLOWING = Symbol('flowing') const PAUSED = Symbol('paused') const RESUME = Symbol('resume') const BUFFERLENGTH = Symbol('bufferLength') const BUFFERPUSH = Symbol('bufferPush') const BUFFERSHIFT = Symbol('bufferShift') const OBJECTMODE = Symbol('objectMode') const DESTROYED = Symbol('destroyed') // TODO remove when Node v8 support drops const doIter = global._MP_NO_ITERATOR_SYMBOLS_ !== '1' const ASYNCITERATOR = doIter && Symbol.asyncIterator || Symbol('asyncIterator not implemented') const ITERATOR = doIter && Symbol.iterator || Symbol('iterator not implemented') // events that mean 'the stream is over' // these are treated specially, and re-emitted // if they are listened for after emitting. const isEndish = ev => ev === 'end' || ev === 'finish' || ev === 'prefinish' const isArrayBuffer = b => b instanceof ArrayBuffer || typeof b === 'object' && b.constructor && b.constructor.name === 'ArrayBuffer' && b.byteLength >= 0 const isArrayBufferView = b => !Buffer.isBuffer(b) && ArrayBuffer.isView(b) module.exports = class Minipass extends Stream { constructor (options) { super() this[FLOWING] = false // whether we're explicitly paused this[PAUSED] = false this.pipes = new Yallist() this.buffer = new Yallist() this[OBJECTMODE] = options && options.objectMode || false if (this[OBJECTMODE]) this[ENCODING] = null else this[ENCODING] = options && options.encoding || null if (this[ENCODING] === 'buffer') this[ENCODING] = null this[DECODER] = this[ENCODING] ? new SD(this[ENCODING]) : null this[EOF] = false this[EMITTED_END] = false this[EMITTING_END] = false this[CLOSED] = false this.writable = true this.readable = true this[BUFFERLENGTH] = 0 this[DESTROYED] = false } get bufferLength () { return this[BUFFERLENGTH] } get encoding () { return this[ENCODING] } set encoding (enc) { if (this[OBJECTMODE]) throw new Error('cannot set encoding in objectMode') if (this[ENCODING] && enc !== this[ENCODING] && (this[DECODER] && this[DECODER].lastNeed || this[BUFFERLENGTH])) throw new Error('cannot change encoding') if (this[ENCODING] !== enc) { this[DECODER] = enc ? new SD(enc) : null if (this.buffer.length) this.buffer = this.buffer.map(chunk => this[DECODER].write(chunk)) } this[ENCODING] = enc } setEncoding (enc) { this.encoding = enc } get objectMode () { return this[OBJECTMODE] } set objectMode (om) { this[OBJECTMODE] = this[OBJECTMODE] || !!om } write (chunk, encoding, cb) { if (this[EOF]) throw new Error('write after end') if (this[DESTROYED]) { this.emit('error', Object.assign( new Error('Cannot call write after a stream was destroyed'), { code: 'ERR_STREAM_DESTROYED' } )) return true } if (typeof encoding === 'function') cb = encoding, encoding = 'utf8' if (!encoding) encoding = 'utf8' // convert array buffers and typed array views into buffers // at some point in the future, we may want to do the opposite! // leave strings and buffers as-is // anything else switches us into object mode if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) { if (isArrayBufferView(chunk)) chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength) else if (isArrayBuffer(chunk)) chunk = Buffer.from(chunk) else if (typeof chunk !== 'string') // use the setter so we throw if we have encoding set this.objectMode = true } // this ensures at this point that the chunk is a buffer or string // don't buffer it up or send it to the decoder if (!this.objectMode && !chunk.length) { if (this[BUFFERLENGTH] !== 0) this.emit('readable') if (cb) cb() return this.flowing } // fast-path writing strings of same encoding to a stream with // an empty buffer, skipping the buffer/decoder dance if (typeof chunk === 'string' && !this[OBJECTMODE] && // unless it is a string already ready for us to use !(encoding === this[ENCODING] && !this[DECODER].lastNeed)) { chunk = Buffer.from(chunk, encoding) } if (Buffer.isBuffer(chunk) && this[ENCODING]) chunk = this[DECODER].write(chunk) if (this.flowing) { // if we somehow have something in the buffer, but we think we're // flowing, then we need to flush all that out first, or we get // chunks coming in out of order. Can't emit 'drain' here though, // because we're mid-write, so that'd be bad. if (this[BUFFERLENGTH] !== 0) this[FLUSH](true) this.emit('data', chunk) } else this[BUFFERPUSH](chunk) if (this[BUFFERLENGTH] !== 0) this.emit('readable') if (cb) cb() return this.flowing } read (n) { if (this[DESTROYED]) return null try { if (this[BUFFERLENGTH] === 0 || n === 0 || n > this[BUFFERLENGTH]) return null if (this[OBJECTMODE]) n = null if (this.buffer.length > 1 && !this[OBJECTMODE]) { if (this.encoding) this.buffer = new Yallist([ Array.from(this.buffer).join('') ]) else this.buffer = new Yallist([ Buffer.concat(Array.from(this.buffer), this[BUFFERLENGTH]) ]) } return this[READ](n || null, this.buffer.head.value) } finally { this[MAYBE_EMIT_END]() } } [READ] (n, chunk) { if (n === chunk.length || n === null) this[BUFFERSHIFT]() else { this.buffer.head.value = chunk.slice(n) chunk = chunk.slice(0, n) this[BUFFERLENGTH] -= n } this.emit('data', chunk) if (!this.buffer.length && !this[EOF]) this.emit('drain') return chunk } end (chunk, encoding, cb) { if (typeof chunk === 'function') cb = chunk, chunk = null if (typeof encoding === 'function') cb = encoding, encoding = 'utf8' if (chunk) this.write(chunk, encoding) if (cb) this.once('end', cb) this[EOF] = true this.writable = false // if we haven't written anything, then go ahead and emit, // even if we're not reading. // we'll re-emit if a new 'end' listener is added anyway. // This makes MP more suitable to write-only use cases. if (this.flowing || !this[PAUSED]) this[MAYBE_EMIT_END]() return this } // don't let the internal resume be overwritten [RESUME] () { if (this[DESTROYED]) return this[PAUSED] = false this[FLOWING] = true this.emit('resume') if (this.buffer.length) this[FLUSH]() else if (this[EOF]) this[MAYBE_EMIT_END]() else this.emit('drain') } resume () { return this[RESUME]() } pause () { this[FLOWING] = false this[PAUSED] = true } get destroyed () { return this[DESTROYED] } get flowing () { return this[FLOWING] } get paused () { return this[PAUSED] } [BUFFERPUSH] (chunk) { if (this[OBJECTMODE]) this[BUFFERLENGTH] += 1 else this[BUFFERLENGTH] += chunk.length return this.buffer.push(chunk) } [BUFFERSHIFT] () { if (this.buffer.length) { if (this[OBJECTMODE]) this[BUFFERLENGTH] -= 1 else this[BUFFERLENGTH] -= this.buffer.head.value.length } return this.buffer.shift() } [FLUSH] (noDrain) { do {} while (this[FLUSHCHUNK](this[BUFFERSHIFT]())) if (!noDrain && !this.buffer.length && !this[EOF]) this.emit('drain') } [FLUSHCHUNK] (chunk) { return chunk ? (this.emit('data', chunk), this.flowing) : false } pipe (dest, opts) { if (this[DESTROYED]) return const ended = this[EMITTED_END] opts = opts || {} if (dest === process.stdout || dest === process.stderr) opts.end = false else opts.end = opts.end !== false const p = { dest: dest, opts: opts, ondrain: _ => this[RESUME]() } this.pipes.push(p) dest.on('drain', p.ondrain) this[RESUME]() // piping an ended stream ends immediately if (ended && p.opts.end) p.dest.end() return dest } addListener (ev, fn) { return this.on(ev, fn) } on (ev, fn) { try { return super.on(ev, fn) } finally { if (ev === 'data' && !this.pipes.length && !this.flowing) this[RESUME]() else if (isEndish(ev) && this[EMITTED_END]) { super.emit(ev) this.removeAllListeners(ev) } } } get emittedEnd () { return this[EMITTED_END] } [MAYBE_EMIT_END] () { if (!this[EMITTING_END] && !this[EMITTED_END] && !this[DESTROYED] && this.buffer.length === 0 && this[EOF]) { this[EMITTING_END] = true this.emit('end') this.emit('prefinish') this.emit('finish') if (this[CLOSED]) this.emit('close') this[EMITTING_END] = false } } emit (ev, data) { // error and close are only events allowed after calling destroy() if (ev !== 'error' && ev !== 'close' && ev !== DESTROYED && this[DESTROYED]) return else if (ev === 'data') { if (!data) return if (this.pipes.length) this.pipes.forEach(p => p.dest.write(data) === false && this.pause()) } else if (ev === 'end') { // only actual end gets this treatment if (this[EMITTED_END] === true) return this[EMITTED_END] = true this.readable = false if (this[DECODER]) { data = this[DECODER].end() if (data) { this.pipes.forEach(p => p.dest.write(data)) super.emit('data', data) } } this.pipes.forEach(p => { p.dest.removeListener('drain', p.ondrain) if (p.opts.end) p.dest.end() }) } else if (ev === 'close') { this[CLOSED] = true // don't emit close before 'end' and 'finish' if (!this[EMITTED_END] && !this[DESTROYED]) return } // TODO: replace with a spread operator when Node v4 support drops const args = new Array(arguments.length) args[0] = ev args[1] = data if (arguments.length > 2) { for (let i = 2; i < arguments.length; i++) { args[i] = arguments[i] } } try { return super.emit.apply(this, args) } finally { if (!isEndish(ev)) this[MAYBE_EMIT_END]() else this.removeAllListeners(ev) } } // const all = await stream.collect() collect () { const buf = [] if (!this[OBJECTMODE]) buf.dataLength = 0 // set the promise first, in case an error is raised // by triggering the flow here. const p = this.promise() this.on('data', c => { buf.push(c) if (!this[OBJECTMODE]) buf.dataLength += c.length }) return p.then(() => buf) } // const data = await stream.concat() concat () { return this[OBJECTMODE] ? Promise.reject(new Error('cannot concat in objectMode')) : this.collect().then(buf => this[OBJECTMODE] ? Promise.reject(new Error('cannot concat in objectMode')) : this[ENCODING] ? buf.join('') : Buffer.concat(buf, buf.dataLength)) } // stream.promise().then(() => done, er => emitted error) promise () { return new Promise((resolve, reject) => { this.on(DESTROYED, () => reject(new Error('stream destroyed'))) this.on('end', () => resolve()) this.on('error', er => reject(er)) }) } // for await (let chunk of stream) [ASYNCITERATOR] () { const next = () => { const res = this.read() if (res !== null) return Promise.resolve({ done: false, value: res }) if (this[EOF]) return Promise.resolve({ done: true }) let resolve = null let reject = null const onerr = er => { this.removeListener('data', ondata) this.removeListener('end', onend) reject(er) } const ondata = value => { this.removeListener('error', onerr) this.removeListener('end', onend) this.pause() resolve({ value: value, done: !!this[EOF] }) } const onend = () => { this.removeListener('error', onerr) this.removeListener('data', ondata) resolve({ done: true }) } const ondestroy = () => onerr(new Error('stream destroyed')) return new Promise((res, rej) => { reject = rej resolve = res this.once(DESTROYED, ondestroy) this.once('error', onerr) this.once('end', onend) this.once('data', ondata) }) } return { next } } // for (let chunk of stream) [ITERATOR] () { const next = () => { const value = this.read() const done = value === null return { value, done } } return { next } } destroy (er) { if (this[DESTROYED]) { if (er) this.emit('error', er) else this.emit(DESTROYED) return this } this[DESTROYED] = true // throw away all buffered data, it's never coming out this.buffer = new Yallist() this[BUFFERLENGTH] = 0 if (typeof this.close === 'function' && !this[CLOSED]) this.close() if (er) this.emit('error', er) else // if no error to emit, still reject pending promises this.emit(DESTROYED) return this } static isStream (s) { return !!s && (s instanceof Minipass || s instanceof Stream || s instanceof EE && ( typeof s.pipe === 'function' || // readable (typeof s.write === 'function' && typeof s.end === 'function') // writable )) } } The ISC License Copyright (c) npm, Inc. and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "minipass", "version": "3.1.3", "description": "minimal implementation of a PassThrough stream", "main": "index.js", "dependencies": { "yallist": "^4.0.0" }, "devDependencies": { "end-of-stream": "^1.4.0", "tap": "^14.6.5", "through2": "^2.0.3" }, "scripts": { "test": "tap", "preversion": "npm test", "postversion": "npm publish --tag=next", "postpublish": "git push origin --follow-tags" }, "repository": { "type": "git", "url": "git+https://github.com/isaacs/minipass.git" }, "keywords": [ "passthrough", "stream" ], "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "license": "ISC", "files": [ "index.js" ], "tap": { "check-coverage": true }, "engines": { "node": ">=8" } } const optsArg = require('./lib/opts-arg.js') const pathArg = require('./lib/path-arg.js') const {mkdirpNative, mkdirpNativeSync} = require('./lib/mkdirp-native.js') const {mkdirpManual, mkdirpManualSync} = require('./lib/mkdirp-manual.js') const {useNative, useNativeSync} = require('./lib/use-native.js') const mkdirp = (path, opts) => { path = pathArg(path) opts = optsArg(opts) return useNative(opts) ? mkdirpNative(path, opts) : mkdirpManual(path, opts) } const mkdirpSync = (path, opts) => { path = pathArg(path) opts = optsArg(opts) return useNativeSync(opts) ? mkdirpNativeSync(path, opts) : mkdirpManualSync(path, opts) } mkdirp.sync = mkdirpSync mkdirp.native = (path, opts) => mkdirpNative(pathArg(path), optsArg(opts)) mkdirp.manual = (path, opts) => mkdirpManual(pathArg(path), optsArg(opts)) mkdirp.nativeSync = (path, opts) => mkdirpNativeSync(pathArg(path), optsArg(opts)) mkdirp.manualSync = (path, opts) => mkdirpManualSync(pathArg(path), optsArg(opts)) module.exports = mkdirp Copyright James Halliday (mail@substack.net) and Isaac Z. Schlueter (i@izs.me) This project is free software released under the MIT license: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "mkdirp", "description": "Recursively mkdir, like `mkdir -p`", "version": "1.0.4", "main": "index.js", "keywords": [ "mkdir", "directory", "make dir", "make", "dir", "recursive", "native" ], "repository": { "type": "git", "url": "https://github.com/isaacs/node-mkdirp.git" }, "scripts": { "test": "tap", "snap": "tap", "preversion": "npm test", "postversion": "npm publish", "postpublish": "git push origin --follow-tags" }, "tap": { "check-coverage": true, "coverage-map": "map.js" }, "devDependencies": { "require-inject": "^1.4.4", "tap": "^14.10.7" }, "bin": "bin/cmd.js", "license": "MIT", "engines": { "node": ">=10" }, "files": [ "bin", "lib", "index.js" ] } #!/usr/bin/env node const usage = () => ` usage: mkdirp [DIR1,DIR2..] {OPTIONS} Create each supplied directory including any necessary parent directories that don't yet exist. If the directory already exists, do nothing. OPTIONS are: -m If a directory needs to be created, set the mode as an octal --mode= permission string. -v --version Print the mkdirp version number -h --help Print this helpful banner -p --print Print the first directories created for each path provided --manual Use manual implementation, even if native is available ` const dirs = [] const opts = {} let print = false let dashdash = false let manual = false for (const arg of process.argv.slice(2)) { if (dashdash) dirs.push(arg) else if (arg === '--') dashdash = true else if (arg === '--manual') manual = true else if (/^-h/.test(arg) || /^--help/.test(arg)) { console.log(usage()) process.exit(0) } else if (arg === '-v' || arg === '--version') { console.log(require('../package.json').version) process.exit(0) } else if (arg === '-p' || arg === '--print') { print = true } else if (/^-m/.test(arg) || /^--mode=/.test(arg)) { const mode = parseInt(arg.replace(/^(-m|--mode=)/, ''), 8) if (isNaN(mode)) { console.error(`invalid mode argument: ${arg}\nMust be an octal number.`) process.exit(1) } opts.mode = mode } else dirs.push(arg) } const mkdirp = require('../') const impl = manual ? mkdirp.manual : mkdirp if (dirs.length === 0) console.error(usage()) Promise.all(dirs.map(dir => impl(dir, opts))) .then(made => print ? made.forEach(m => m && console.log(m)) : null) .catch(er => { console.error(er.message) if (er.code) console.error(' code: ' + er.code) process.exit(1) }) const {dirname} = require('path') const findMade = (opts, parent, path = undefined) => { // we never want the 'made' return value to be a root directory if (path === parent) return Promise.resolve() return opts.statAsync(parent).then( st => st.isDirectory() ? path : undefined, // will fail later er => er.code === 'ENOENT' ? findMade(opts, dirname(parent), parent) : undefined ) } const findMadeSync = (opts, parent, path = undefined) => { if (path === parent) return undefined try { return opts.statSync(parent).isDirectory() ? path : undefined } catch (er) { return er.code === 'ENOENT' ? findMadeSync(opts, dirname(parent), parent) : undefined } } module.exports = {findMade, findMadeSync} const {dirname} = require('path') const mkdirpManual = (path, opts, made) => { opts.recursive = false const parent = dirname(path) if (parent === path) { return opts.mkdirAsync(path, opts).catch(er => { // swallowed by recursive implementation on posix systems // any other error is a failure if (er.code !== 'EISDIR') throw er }) } return opts.mkdirAsync(path, opts).then(() => made || path, er => { if (er.code === 'ENOENT') return mkdirpManual(parent, opts) .then(made => mkdirpManual(path, opts, made)) if (er.code !== 'EEXIST' && er.code !== 'EROFS') throw er return opts.statAsync(path).then(st => { if (st.isDirectory()) return made else throw er }, () => { throw er }) }) } const mkdirpManualSync = (path, opts, made) => { const parent = dirname(path) opts.recursive = false if (parent === path) { try { return opts.mkdirSync(path, opts) } catch (er) { // swallowed by recursive implementation on posix systems // any other error is a failure if (er.code !== 'EISDIR') throw er else return } } try { opts.mkdirSync(path, opts) return made || path } catch (er) { if (er.code === 'ENOENT') return mkdirpManualSync(path, opts, mkdirpManualSync(parent, opts, made)) if (er.code !== 'EEXIST' && er.code !== 'EROFS') throw er try { if (!opts.statSync(path).isDirectory()) throw er } catch (_) { throw er } } } module.exports = {mkdirpManual, mkdirpManualSync} const {dirname} = require('path') const {findMade, findMadeSync} = require('./find-made.js') const {mkdirpManual, mkdirpManualSync} = require('./mkdirp-manual.js') const mkdirpNative = (path, opts) => { opts.recursive = true const parent = dirname(path) if (parent === path) return opts.mkdirAsync(path, opts) return findMade(opts, path).then(made => opts.mkdirAsync(path, opts).then(() => made) .catch(er => { if (er.code === 'ENOENT') return mkdirpManual(path, opts) else throw er })) } const mkdirpNativeSync = (path, opts) => { opts.recursive = true const parent = dirname(path) if (parent === path) return opts.mkdirSync(path, opts) const made = findMadeSync(opts, path) try { opts.mkdirSync(path, opts) return made } catch (er) { if (er.code === 'ENOENT') return mkdirpManualSync(path, opts) else throw er } } module.exports = {mkdirpNative, mkdirpNativeSync} const { promisify } = require('util') const fs = require('fs') const optsArg = opts => { if (!opts) opts = { mode: 0o777, fs } else if (typeof opts === 'object') opts = { mode: 0o777, fs, ...opts } else if (typeof opts === 'number') opts = { mode: opts, fs } else if (typeof opts === 'string') opts = { mode: parseInt(opts, 8), fs } else throw new TypeError('invalid options argument') opts.mkdir = opts.mkdir || opts.fs.mkdir || fs.mkdir opts.mkdirAsync = promisify(opts.mkdir) opts.stat = opts.stat || opts.fs.stat || fs.stat opts.statAsync = promisify(opts.stat) opts.statSync = opts.statSync || opts.fs.statSync || fs.statSync opts.mkdirSync = opts.mkdirSync || opts.fs.mkdirSync || fs.mkdirSync return opts } module.exports = optsArg const platform = process.env.__TESTING_MKDIRP_PLATFORM__ || process.platform const { resolve, parse } = require('path') const pathArg = path => { if (/\0/.test(path)) { // simulate same failure that node raises throw Object.assign( new TypeError('path must be a string without null bytes'), { path, code: 'ERR_INVALID_ARG_VALUE', } ) } path = resolve(path) if (platform === 'win32') { const badWinChars = /[*|"<>?:]/ const {root} = parse(path) if (badWinChars.test(path.substr(root.length))) { throw Object.assign(new Error('Illegal characters in path.'), { path, code: 'EINVAL', }) } } return path } module.exports = pathArg const fs = require('fs') const version = process.env.__TESTING_MKDIRP_NODE_VERSION__ || process.version const versArr = version.replace(/^v/, '').split('.') const hasNative = +versArr[0] > 10 || +versArr[0] === 10 && +versArr[1] >= 12 const useNative = !hasNative ? () => false : opts => opts.mkdir === fs.mkdir const useNativeSync = !hasNative ? () => false : opts => opts.mkdirSync === fs.mkdirSync module.exports = {useNative, useNativeSync} /** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; var w = d * 7; var y = d * 365.25; /** * Parse or format the given `val`. * * Options: * * - `long` verbose formatting [false] * * @param {String|Number} val * @param {Object} [options] * @throws {Error} throw an error if val is not a non-empty string or a number * @return {String|Number} * @api public */ module.exports = function (val, options) { options = options || {}; var type = typeof val; if (type === 'string' && val.length > 0) { return parse(val); } else if (type === 'number' && isFinite(val)) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error( 'val is not a non-empty string or a valid number. val=' + JSON.stringify(val) ); }; /** * Parse the given `str` and return milliseconds. * * @param {String} str * @return {Number} * @api private */ function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( str ); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'yrs': case 'yr': case 'y': return n * y; case 'weeks': case 'week': case 'w': return n * w; case 'days': case 'day': case 'd': return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': return n * m; case 'seconds': case 'second': case 'secs': case 'sec': case 's': return n * s; case 'milliseconds': case 'millisecond': case 'msecs': case 'msec': case 'ms': return n; default: return undefined; } } /** * Short format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtShort(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return Math.round(ms / d) + 'd'; } if (msAbs >= h) { return Math.round(ms / h) + 'h'; } if (msAbs >= m) { return Math.round(ms / m) + 'm'; } if (msAbs >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtLong(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return plural(ms, msAbs, d, 'day'); } if (msAbs >= h) { return plural(ms, msAbs, h, 'hour'); } if (msAbs >= m) { return plural(ms, msAbs, m, 'minute'); } if (msAbs >= s) { return plural(ms, msAbs, s, 'second'); } return ms + ' ms'; } /** * Pluralization helper. */ function plural(ms, msAbs, n, name) { var isPlural = msAbs >= n * 1.5; return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); } The MIT License (MIT) Copyright (c) 2020 Vercel, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "ms", "version": "2.1.3", "description": "Tiny millisecond conversion utility", "repository": "vercel/ms", "main": "./index", "files": [ "index.js" ], "scripts": { "precommit": "lint-staged", "lint": "eslint lib/* bin/*", "test": "mocha tests.js" }, "eslintConfig": { "extends": "eslint:recommended", "env": { "node": true, "es6": true } }, "lint-staged": { "*.js": [ "npm run lint", "prettier --single-quote --write", "git add" ] }, "license": "MIT", "devDependencies": { "eslint": "4.18.2", "expect.js": "0.3.1", "husky": "0.14.3", "lint-staged": "5.0.0", "mocha": "4.0.1", "prettier": "2.0.5" } } module.exports = require('./lib/_stream_duplex.js'); module.exports = require('./readable').Duplex ### Streams Working Group The Node.js Streams is jointly governed by a Working Group (WG) that is responsible for high-level guidance of the project. The WG has final authority over this project including: * Technical direction * Project governance and process (including this policy) * Contribution policy * GitHub repository hosting * Conduct guidelines * Maintaining the list of additional Collaborators For the current list of WG members, see the project [README.md](./README.md#current-project-team-members). ### Collaborators The readable-stream GitHub repository is maintained by the WG and additional Collaborators who are added by the WG on an ongoing basis. Individuals making significant and valuable contributions are made Collaborators and given commit-access to the project. These individuals are identified by the WG and their addition as Collaborators is discussed during the WG meeting. _Note:_ If you make a significant contribution and are not considered for commit-access log an issue or contact a WG member directly and it will be brought up in the next WG meeting. Modifications of the contents of the readable-stream repository are made on a collaborative basis. Anybody with a GitHub account may propose a modification via pull request and it will be considered by the project Collaborators. All pull requests must be reviewed and accepted by a Collaborator with sufficient expertise who is able to take full responsibility for the change. In the case of pull requests proposed by an existing Collaborator, an additional Collaborator is required for sign-off. Consensus should be sought if additional Collaborators participate and there is disagreement around a particular modification. See _Consensus Seeking Process_ below for further detail on the consensus model used for governance. Collaborators may opt to elevate significant or controversial modifications, or modifications that have not found consensus to the WG for discussion by assigning the ***WG-agenda*** tag to a pull request or issue. The WG should serve as the final arbiter where required. For the current list of Collaborators, see the project [README.md](./README.md#members). ### WG Membership WG seats are not time-limited. There is no fixed size of the WG. However, the expected target is between 6 and 12, to ensure adequate coverage of important areas of expertise, balanced with the ability to make decisions efficiently. There is no specific set of requirements or qualifications for WG membership beyond these rules. The WG may add additional members to the WG by unanimous consensus. A WG member may be removed from the WG by voluntary resignation, or by unanimous consensus of all other WG members. Changes to WG membership should be posted in the agenda, and may be suggested as any other agenda item (see "WG Meetings" below). If an addition or removal is proposed during a meeting, and the full WG is not in attendance to participate, then the addition or removal is added to the agenda for the subsequent meeting. This is to ensure that all members are given the opportunity to participate in all membership decisions. If a WG member is unable to attend a meeting where a planned membership decision is being made, then their consent is assumed. No more than 1/3 of the WG members may be affiliated with the same employer. If removal or resignation of a WG member, or a change of employment by a WG member, creates a situation where more than 1/3 of the WG membership shares an employer, then the situation must be immediately remedied by the resignation or removal of one or more WG members affiliated with the over-represented employer(s). ### WG Meetings The WG meets occasionally on a Google Hangout On Air. A designated moderator approved by the WG runs the meeting. Each meeting should be published to YouTube. Items are added to the WG agenda that are considered contentious or are modifications of governance, contribution policy, WG membership, or release process. The intention of the agenda is not to approve or review all patches; that should happen continuously on GitHub and be handled by the larger group of Collaborators. Any community member or contributor can ask that something be added to the next meeting's agenda by logging a GitHub Issue. Any Collaborator, WG member or the moderator can add the item to the agenda by adding the ***WG-agenda*** tag to the issue. Prior to each WG meeting the moderator will share the Agenda with members of the WG. WG members can add any items they like to the agenda at the beginning of each meeting. The moderator and the WG cannot veto or remove items. The WG may invite persons or representatives from certain projects to participate in a non-voting capacity. The moderator is responsible for summarizing the discussion of each agenda item and sends it as a pull request after the meeting. ### Consensus Seeking Process The WG follows a [Consensus Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making) decision-making model. When an agenda item has appeared to reach a consensus the moderator will ask "Does anyone object?" as a final call for dissent from the consensus. If an agenda item cannot reach a consensus a WG member can call for either a closing vote or a vote to table the issue to the next meeting. The call for a vote must be seconded by a majority of the WG or else the discussion will continue. Simple majority wins. Note that changes to WG membership require a majority consensus. See "WG Membership" above. Node.js is licensed for use as follows: """ Copyright Node.js contributors. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ This license applies to parts of Node.js originating from the https://github.com/joyent/node repository: """ Copyright Joyent, Inc. and other Node contributors. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ { "name": "readable-stream", "version": "2.3.7", "description": "Streams3, a user-land copy of the stream library from Node.js", "main": "readable.js", "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", "isarray": "~1.0.0", "process-nextick-args": "~2.0.0", "safe-buffer": "~5.1.1", "string_decoder": "~1.1.1", "util-deprecate": "~1.0.1" }, "devDependencies": { "assert": "^1.4.0", "babel-polyfill": "^6.9.1", "buffer": "^4.9.0", "lolex": "^2.3.2", "nyc": "^6.4.0", "tap": "^0.7.0", "tape": "^4.8.0" }, "scripts": { "test": "tap test/parallel/*.js test/ours/*.js && node test/verify-dependencies.js", "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", "cover": "nyc npm test", "report": "nyc report --reporter=lcov" }, "repository": { "type": "git", "url": "git://github.com/nodejs/readable-stream" }, "keywords": [ "readable", "stream", "pipe" ], "browser": { "util": false, "./readable.js": "./readable-browser.js", "./writable.js": "./writable-browser.js", "./duplex.js": "./duplex-browser.js", "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js" }, "nyc": { "include": [ "lib/**.js" ] }, "license": "MIT" } module.exports = require('./readable').PassThrough exports = module.exports = require('./lib/_stream_readable.js'); exports.Stream = exports; exports.Readable = exports; exports.Writable = require('./lib/_stream_writable.js'); exports.Duplex = require('./lib/_stream_duplex.js'); exports.Transform = require('./lib/_stream_transform.js'); exports.PassThrough = require('./lib/_stream_passthrough.js'); var Stream = require('stream'); if (process.env.READABLE_STREAM === 'disable' && Stream) { module.exports = Stream; exports = module.exports = Stream.Readable; exports.Readable = Stream.Readable; exports.Writable = Stream.Writable; exports.Duplex = Stream.Duplex; exports.Transform = Stream.Transform; exports.PassThrough = Stream.PassThrough; exports.Stream = Stream; } else { exports = module.exports = require('./lib/_stream_readable.js'); exports.Stream = Stream || exports; exports.Readable = exports; exports.Writable = require('./lib/_stream_writable.js'); exports.Duplex = require('./lib/_stream_duplex.js'); exports.Transform = require('./lib/_stream_transform.js'); exports.PassThrough = require('./lib/_stream_passthrough.js'); } module.exports = require('./readable').Transform module.exports = require('./lib/_stream_writable.js'); var Stream = require("stream") var Writable = require("./lib/_stream_writable.js") if (process.env.READABLE_STREAM === 'disable') { module.exports = Stream && Stream.Writable || Writable } else { module.exports = Writable } // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // a duplex stream is just a stream that is both readable and writable. // Since JS doesn't have multiple prototypal inheritance, this class // prototypally inherits from Readable, and then parasitically from // Writable. 'use strict'; /**/ var pna = require('process-nextick-args'); /**/ /**/ var objectKeys = Object.keys || function (obj) { var keys = []; for (var key in obj) { keys.push(key); }return keys; }; /**/ module.exports = Duplex; /**/ var util = Object.create(require('core-util-is')); util.inherits = require('inherits'); /**/ var Readable = require('./_stream_readable'); var Writable = require('./_stream_writable'); util.inherits(Duplex, Readable); { // avoid scope creep, the keys array can then be collected var keys = objectKeys(Writable.prototype); for (var v = 0; v < keys.length; v++) { var method = keys[v]; if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; } } function Duplex(options) { if (!(this instanceof Duplex)) return new Duplex(options); Readable.call(this, options); Writable.call(this, options); if (options && options.readable === false) this.readable = false; if (options && options.writable === false) this.writable = false; this.allowHalfOpen = true; if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; this.once('end', onend); } Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function () { return this._writableState.highWaterMark; } }); // the no-half-open enforcer function onend() { // if we allow half-open state, or if the writable side ended, // then we're ok. if (this.allowHalfOpen || this._writableState.ended) return; // no more data can be written. // But allow more writes to happen in this tick. pna.nextTick(onEndNT, this); } function onEndNT(self) { self.end(); } Object.defineProperty(Duplex.prototype, 'destroyed', { get: function () { if (this._readableState === undefined || this._writableState === undefined) { return false; } return this._readableState.destroyed && this._writableState.destroyed; }, set: function (value) { // we ignore the value if the stream // has not been initialized yet if (this._readableState === undefined || this._writableState === undefined) { return; } // backward compatibility, the user is explicitly // managing destroyed this._readableState.destroyed = value; this._writableState.destroyed = value; } }); Duplex.prototype._destroy = function (err, cb) { this.push(null); this.end(); pna.nextTick(cb, err); };// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // a passthrough stream. // basically just the most minimal sort of Transform stream. // Every written chunk gets output as-is. 'use strict'; module.exports = PassThrough; var Transform = require('./_stream_transform'); /**/ var util = Object.create(require('core-util-is')); util.inherits = require('inherits'); /**/ util.inherits(PassThrough, Transform); function PassThrough(options) { if (!(this instanceof PassThrough)) return new PassThrough(options); Transform.call(this, options); } PassThrough.prototype._transform = function (chunk, encoding, cb) { cb(null, chunk); };// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; /**/ var pna = require('process-nextick-args'); /**/ module.exports = Readable; /**/ var isArray = require('isarray'); /**/ /**/ var Duplex; /**/ Readable.ReadableState = ReadableState; /**/ var EE = require('events').EventEmitter; var EElistenerCount = function (emitter, type) { return emitter.listeners(type).length; }; /**/ /**/ var Stream = require('./internal/streams/stream'); /**/ /**/ var Buffer = require('safe-buffer').Buffer; var OurUint8Array = global.Uint8Array || function () {}; function _uint8ArrayToBuffer(chunk) { return Buffer.from(chunk); } function _isUint8Array(obj) { return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; } /**/ /**/ var util = Object.create(require('core-util-is')); util.inherits = require('inherits'); /**/ /**/ var debugUtil = require('util'); var debug = void 0; if (debugUtil && debugUtil.debuglog) { debug = debugUtil.debuglog('stream'); } else { debug = function () {}; } /**/ var BufferList = require('./internal/streams/BufferList'); var destroyImpl = require('./internal/streams/destroy'); var StringDecoder; util.inherits(Readable, Stream); var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; function prependListener(emitter, event, fn) { // Sadly this is not cacheable as some libraries bundle their own // event emitter implementation with them. if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); // This is a hack to make sure that our error handler is attached before any // userland ones. NEVER DO THIS. This is here only because this code needs // to continue to work with older versions of Node.js that do not include // the prependListener() method. The goal is to eventually remove this hack. if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; } function ReadableState(options, stream) { Duplex = Duplex || require('./_stream_duplex'); options = options || {}; // Duplex streams are both readable and writable, but share // the same options object. // However, some cases require setting options to different // values for the readable and the writable sides of the duplex stream. // These options can be provided separately as readableXXX and writableXXX. var isDuplex = stream instanceof Duplex; // object stream flag. Used to make read(n) ignore n and to // make all the buffer merging and length checks go away this.objectMode = !!options.objectMode; if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer // Note: 0 is a valid value, means "don't call _read preemptively ever" var hwm = options.highWaterMark; var readableHwm = options.readableHighWaterMark; var defaultHwm = this.objectMode ? 16 : 16 * 1024; if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; // cast to ints. this.highWaterMark = Math.floor(this.highWaterMark); // A linked list is used to store data chunks instead of an array because the // linked list can remove elements from the beginning faster than // array.shift() this.buffer = new BufferList(); this.length = 0; this.pipes = null; this.pipesCount = 0; this.flowing = null; this.ended = false; this.endEmitted = false; this.reading = false; // a flag to be able to tell if the event 'readable'/'data' is emitted // immediately, or on a later tick. We set this to true at first, because // any actions that shouldn't happen until "later" should generally also // not happen before the first read call. this.sync = true; // whenever we return null, then we set a flag to say // that we're awaiting a 'readable' event emission. this.needReadable = false; this.emittedReadable = false; this.readableListening = false; this.resumeScheduled = false; // has it been destroyed this.destroyed = false; // Crypto is kind of old and crusty. Historically, its default string // encoding is 'binary' so we have to make this configurable. // Everything else in the universe uses 'utf8', though. this.defaultEncoding = options.defaultEncoding || 'utf8'; // the number of writers that are awaiting a drain event in .pipe()s this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled this.readingMore = false; this.decoder = null; this.encoding = null; if (options.encoding) { if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; this.decoder = new StringDecoder(options.encoding); this.encoding = options.encoding; } } function Readable(options) { Duplex = Duplex || require('./_stream_duplex'); if (!(this instanceof Readable)) return new Readable(options); this._readableState = new ReadableState(options, this); // legacy this.readable = true; if (options) { if (typeof options.read === 'function') this._read = options.read; if (typeof options.destroy === 'function') this._destroy = options.destroy; } Stream.call(this); } Object.defineProperty(Readable.prototype, 'destroyed', { get: function () { if (this._readableState === undefined) { return false; } return this._readableState.destroyed; }, set: function (value) { // we ignore the value if the stream // has not been initialized yet if (!this._readableState) { return; } // backward compatibility, the user is explicitly // managing destroyed this._readableState.destroyed = value; } }); Readable.prototype.destroy = destroyImpl.destroy; Readable.prototype._undestroy = destroyImpl.undestroy; Readable.prototype._destroy = function (err, cb) { this.push(null); cb(err); }; // Manually shove something into the read() buffer. // This returns true if the highWaterMark has not been hit yet, // similar to how Writable.write() returns true if you should // write() some more. Readable.prototype.push = function (chunk, encoding) { var state = this._readableState; var skipChunkCheck; if (!state.objectMode) { if (typeof chunk === 'string') { encoding = encoding || state.defaultEncoding; if (encoding !== state.encoding) { chunk = Buffer.from(chunk, encoding); encoding = ''; } skipChunkCheck = true; } } else { skipChunkCheck = true; } return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); }; // Unshift should *always* be something directly out of read() Readable.prototype.unshift = function (chunk) { return readableAddChunk(this, chunk, null, true, false); }; function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { var state = stream._readableState; if (chunk === null) { state.reading = false; onEofChunk(stream, state); } else { var er; if (!skipChunkCheck) er = chunkInvalid(state, chunk); if (er) { stream.emit('error', er); } else if (state.objectMode || chunk && chunk.length > 0) { if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { chunk = _uint8ArrayToBuffer(chunk); } if (addToFront) { if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); } else if (state.ended) { stream.emit('error', new Error('stream.push() after EOF')); } else { state.reading = false; if (state.decoder && !encoding) { chunk = state.decoder.write(chunk); if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); } else { addChunk(stream, state, chunk, false); } } } else if (!addToFront) { state.reading = false; } } return needMoreData(state); } function addChunk(stream, state, chunk, addToFront) { if (state.flowing && state.length === 0 && !state.sync) { stream.emit('data', chunk); stream.read(0); } else { // update the buffer info. state.length += state.objectMode ? 1 : chunk.length; if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); if (state.needReadable) emitReadable(stream); } maybeReadMore(stream, state); } function chunkInvalid(state, chunk) { var er; if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { er = new TypeError('Invalid non-string/buffer chunk'); } return er; } // if it's past the high water mark, we can push in some more. // Also, if we have no data yet, we can stand some // more bytes. This is to work around cases where hwm=0, // such as the repl. Also, if the push() triggered a // readable event, and the user called read(largeNumber) such that // needReadable was set, then we ought to push more, so that another // 'readable' event will be triggered. function needMoreData(state) { return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); } Readable.prototype.isPaused = function () { return this._readableState.flowing === false; }; // backwards compatibility. Readable.prototype.setEncoding = function (enc) { if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; this._readableState.decoder = new StringDecoder(enc); this._readableState.encoding = enc; return this; }; // Don't raise the hwm > 8MB var MAX_HWM = 0x800000; function computeNewHighWaterMark(n) { if (n >= MAX_HWM) { n = MAX_HWM; } else { // Get the next highest power of 2 to prevent increasing hwm excessively in // tiny amounts n--; n |= n >>> 1; n |= n >>> 2; n |= n >>> 4; n |= n >>> 8; n |= n >>> 16; n++; } return n; } // This function is designed to be inlinable, so please take care when making // changes to the function body. function howMuchToRead(n, state) { if (n <= 0 || state.length === 0 && state.ended) return 0; if (state.objectMode) return 1; if (n !== n) { // Only flow one buffer at a time if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; } // If we're asking for more than the current hwm, then raise the hwm. if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); if (n <= state.length) return n; // Don't have enough if (!state.ended) { state.needReadable = true; return 0; } return state.length; } // you can override either this method, or the async _read(n) below. Readable.prototype.read = function (n) { debug('read', n); n = parseInt(n, 10); var state = this._readableState; var nOrig = n; if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we // already have a bunch of data in the buffer, then just trigger // the 'readable' event and move on. if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { debug('read: emitReadable', state.length, state.ended); if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); return null; } n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up. if (n === 0 && state.ended) { if (state.length === 0) endReadable(this); return null; } // All the actual chunk generation logic needs to be // *below* the call to _read. The reason is that in certain // synthetic stream cases, such as passthrough streams, _read // may be a completely synchronous operation which may change // the state of the read buffer, providing enough data when // before there was *not* enough. // // So, the steps are: // 1. Figure out what the state of things will be after we do // a read from the buffer. // // 2. If that resulting state will trigger a _read, then call _read. // Note that this may be asynchronous, or synchronous. Yes, it is // deeply ugly to write APIs this way, but that still doesn't mean // that the Readable class should behave improperly, as streams are // designed to be sync/async agnostic. // Take note if the _read call is sync or async (ie, if the read call // has returned yet), so that we know whether or not it's safe to emit // 'readable' etc. // // 3. Actually pull the requested chunks out of the buffer and return. // if we need a readable event, then we need to do some reading. var doRead = state.needReadable; debug('need readable', doRead); // if we currently have less than the highWaterMark, then also read some if (state.length === 0 || state.length - n < state.highWaterMark) { doRead = true; debug('length less than watermark', doRead); } // however, if we've ended, then there's no point, and if we're already // reading, then it's unnecessary. if (state.ended || state.reading) { doRead = false; debug('reading or ended', doRead); } else if (doRead) { debug('do read'); state.reading = true; state.sync = true; // if the length is currently zero, then we *need* a readable event. if (state.length === 0) state.needReadable = true; // call internal read method this._read(state.highWaterMark); state.sync = false; // If _read pushed data synchronously, then `reading` will be false, // and we need to re-evaluate how much data we can return to the user. if (!state.reading) n = howMuchToRead(nOrig, state); } var ret; if (n > 0) ret = fromList(n, state);else ret = null; if (ret === null) { state.needReadable = true; n = 0; } else { state.length -= n; } if (state.length === 0) { // If we have nothing in the buffer, then we want to know // as soon as we *do* get something into the buffer. if (!state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick. if (nOrig !== n && state.ended) endReadable(this); } if (ret !== null) this.emit('data', ret); return ret; }; function onEofChunk(stream, state) { if (state.ended) return; if (state.decoder) { var chunk = state.decoder.end(); if (chunk && chunk.length) { state.buffer.push(chunk); state.length += state.objectMode ? 1 : chunk.length; } } state.ended = true; // emit 'readable' now to make sure it gets picked up. emitReadable(stream); } // Don't emit readable right away in sync mode, because this can trigger // another read() call => stack overflow. This way, it might trigger // a nextTick recursion warning, but that's not so bad. function emitReadable(stream) { var state = stream._readableState; state.needReadable = false; if (!state.emittedReadable) { debug('emitReadable', state.flowing); state.emittedReadable = true; if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); } } function emitReadable_(stream) { debug('emit readable'); stream.emit('readable'); flow(stream); } // at this point, the user has presumably seen the 'readable' event, // and called read() to consume some data. that may have triggered // in turn another _read(n) call, in which case reading = true if // it's in progress. // However, if we're not ended, or reading, and the length < hwm, // then go ahead and try to read some more preemptively. function maybeReadMore(stream, state) { if (!state.readingMore) { state.readingMore = true; pna.nextTick(maybeReadMore_, stream, state); } } function maybeReadMore_(stream, state) { var len = state.length; while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { debug('maybeReadMore read 0'); stream.read(0); if (len === state.length) // didn't get any data, stop spinning. break;else len = state.length; } state.readingMore = false; } // abstract method. to be overridden in specific implementation classes. // call cb(er, data) where data is <= n in length. // for virtual (non-string, non-buffer) streams, "length" is somewhat // arbitrary, and perhaps not very meaningful. Readable.prototype._read = function (n) { this.emit('error', new Error('_read() is not implemented')); }; Readable.prototype.pipe = function (dest, pipeOpts) { var src = this; var state = this._readableState; switch (state.pipesCount) { case 0: state.pipes = dest; break; case 1: state.pipes = [state.pipes, dest]; break; default: state.pipes.push(dest); break; } state.pipesCount += 1; debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; var endFn = doEnd ? onend : unpipe; if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn); dest.on('unpipe', onunpipe); function onunpipe(readable, unpipeInfo) { debug('onunpipe'); if (readable === src) { if (unpipeInfo && unpipeInfo.hasUnpiped === false) { unpipeInfo.hasUnpiped = true; cleanup(); } } } function onend() { debug('onend'); dest.end(); } // when the dest drains, it reduces the awaitDrain counter // on the source. This would be more elegant with a .once() // handler in flow(), but adding and removing repeatedly is // too slow. var ondrain = pipeOnDrain(src); dest.on('drain', ondrain); var cleanedUp = false; function cleanup() { debug('cleanup'); // cleanup event handlers once the pipe is broken dest.removeListener('close', onclose); dest.removeListener('finish', onfinish); dest.removeListener('drain', ondrain); dest.removeListener('error', onerror); dest.removeListener('unpipe', onunpipe); src.removeListener('end', onend); src.removeListener('end', unpipe); src.removeListener('data', ondata); cleanedUp = true; // if the reader is waiting for a drain event from this // specific writer, then it would cause it to never start // flowing again. // So, if this is awaiting a drain, then we just call it now. // If we don't know, then assume that we are waiting for one. if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); } // If the user pushes more data while we're writing to dest then we'll end up // in ondata again. However, we only want to increase awaitDrain once because // dest will only emit one 'drain' event for the multiple writes. // => Introduce a guard on increasing awaitDrain. var increasedAwaitDrain = false; src.on('data', ondata); function ondata(chunk) { debug('ondata'); increasedAwaitDrain = false; var ret = dest.write(chunk); if (false === ret && !increasedAwaitDrain) { // If the user unpiped during `dest.write()`, it is possible // to get stuck in a permanently paused state if that write // also returned false. // => Check whether `dest` is still a piping destination. if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { debug('false write response, pause', src._readableState.awaitDrain); src._readableState.awaitDrain++; increasedAwaitDrain = true; } src.pause(); } } // if the dest has an error, then stop piping into it. // however, don't suppress the throwing behavior for this. function onerror(er) { debug('onerror', er); unpipe(); dest.removeListener('error', onerror); if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); } // Make sure our error handler is attached before userland ones. prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once. function onclose() { dest.removeListener('finish', onfinish); unpipe(); } dest.once('close', onclose); function onfinish() { debug('onfinish'); dest.removeListener('close', onclose); unpipe(); } dest.once('finish', onfinish); function unpipe() { debug('unpipe'); src.unpipe(dest); } // tell the dest that it's being piped to dest.emit('pipe', src); // start the flow if it hasn't been started already. if (!state.flowing) { debug('pipe resume'); src.resume(); } return dest; }; function pipeOnDrain(src) { return function () { var state = src._readableState; debug('pipeOnDrain', state.awaitDrain); if (state.awaitDrain) state.awaitDrain--; if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { state.flowing = true; flow(src); } }; } Readable.prototype.unpipe = function (dest) { var state = this._readableState; var unpipeInfo = { hasUnpiped: false }; // if we're not piping anywhere, then do nothing. if (state.pipesCount === 0) return this; // just one destination. most common case. if (state.pipesCount === 1) { // passed in one, but it's not the right one. if (dest && dest !== state.pipes) return this; if (!dest) dest = state.pipes; // got a match. state.pipes = null; state.pipesCount = 0; state.flowing = false; if (dest) dest.emit('unpipe', this, unpipeInfo); return this; } // slow case. multiple pipe destinations. if (!dest) { // remove all. var dests = state.pipes; var len = state.pipesCount; state.pipes = null; state.pipesCount = 0; state.flowing = false; for (var i = 0; i < len; i++) { dests[i].emit('unpipe', this, unpipeInfo); }return this; } // try to find the right one. var index = indexOf(state.pipes, dest); if (index === -1) return this; state.pipes.splice(index, 1); state.pipesCount -= 1; if (state.pipesCount === 1) state.pipes = state.pipes[0]; dest.emit('unpipe', this, unpipeInfo); return this; }; // set up data events if they are asked for // Ensure readable listeners eventually get something Readable.prototype.on = function (ev, fn) { var res = Stream.prototype.on.call(this, ev, fn); if (ev === 'data') { // Start flowing on next tick if stream isn't explicitly paused if (this._readableState.flowing !== false) this.resume(); } else if (ev === 'readable') { var state = this._readableState; if (!state.endEmitted && !state.readableListening) { state.readableListening = state.needReadable = true; state.emittedReadable = false; if (!state.reading) { pna.nextTick(nReadingNextTick, this); } else if (state.length) { emitReadable(this); } } } return res; }; Readable.prototype.addListener = Readable.prototype.on; function nReadingNextTick(self) { debug('readable nexttick read 0'); self.read(0); } // pause() and resume() are remnants of the legacy readable stream API // If the user uses them, then switch into old mode. Readable.prototype.resume = function () { var state = this._readableState; if (!state.flowing) { debug('resume'); state.flowing = true; resume(this, state); } return this; }; function resume(stream, state) { if (!state.resumeScheduled) { state.resumeScheduled = true; pna.nextTick(resume_, stream, state); } } function resume_(stream, state) { if (!state.reading) { debug('resume read 0'); stream.read(0); } state.resumeScheduled = false; state.awaitDrain = 0; stream.emit('resume'); flow(stream); if (state.flowing && !state.reading) stream.read(0); } Readable.prototype.pause = function () { debug('call pause flowing=%j', this._readableState.flowing); if (false !== this._readableState.flowing) { debug('pause'); this._readableState.flowing = false; this.emit('pause'); } return this; }; function flow(stream) { var state = stream._readableState; debug('flow', state.flowing); while (state.flowing && stream.read() !== null) {} } // wrap an old-style stream as the async data source. // This is *not* part of the readable stream interface. // It is an ugly unfortunate mess of history. Readable.prototype.wrap = function (stream) { var _this = this; var state = this._readableState; var paused = false; stream.on('end', function () { debug('wrapped end'); if (state.decoder && !state.ended) { var chunk = state.decoder.end(); if (chunk && chunk.length) _this.push(chunk); } _this.push(null); }); stream.on('data', function (chunk) { debug('wrapped data'); if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; var ret = _this.push(chunk); if (!ret) { paused = true; stream.pause(); } }); // proxy all the other methods. // important when wrapping filters and duplexes. for (var i in stream) { if (this[i] === undefined && typeof stream[i] === 'function') { this[i] = function (method) { return function () { return stream[method].apply(stream, arguments); }; }(i); } } // proxy certain important events. for (var n = 0; n < kProxyEvents.length; n++) { stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); } // when we try to consume some more bytes, simply unpause the // underlying stream. this._read = function (n) { debug('wrapped _read', n); if (paused) { paused = false; stream.resume(); } }; return this; }; Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function () { return this._readableState.highWaterMark; } }); // exposed for testing purposes only. Readable._fromList = fromList; // Pluck off n bytes from an array of buffers. // Length is the combined lengths of all the buffers in the list. // This function is designed to be inlinable, so please take care when making // changes to the function body. function fromList(n, state) { // nothing buffered if (state.length === 0) return null; var ret; if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { // read it all, truncate the list if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); state.buffer.clear(); } else { // read part of list ret = fromListPartial(n, state.buffer, state.decoder); } return ret; } // Extracts only enough buffered data to satisfy the amount requested. // This function is designed to be inlinable, so please take care when making // changes to the function body. function fromListPartial(n, list, hasStrings) { var ret; if (n < list.head.data.length) { // slice is the same for buffers and strings ret = list.head.data.slice(0, n); list.head.data = list.head.data.slice(n); } else if (n === list.head.data.length) { // first chunk is a perfect match ret = list.shift(); } else { // result spans more than one buffer ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); } return ret; } // Copies a specified amount of characters from the list of buffered data // chunks. // This function is designed to be inlinable, so please take care when making // changes to the function body. function copyFromBufferString(n, list) { var p = list.head; var c = 1; var ret = p.data; n -= ret.length; while (p = p.next) { var str = p.data; var nb = n > str.length ? str.length : n; if (nb === str.length) ret += str;else ret += str.slice(0, n); n -= nb; if (n === 0) { if (nb === str.length) { ++c; if (p.next) list.head = p.next;else list.head = list.tail = null; } else { list.head = p; p.data = str.slice(nb); } break; } ++c; } list.length -= c; return ret; } // Copies a specified amount of bytes from the list of buffered data chunks. // This function is designed to be inlinable, so please take care when making // changes to the function body. function copyFromBuffer(n, list) { var ret = Buffer.allocUnsafe(n); var p = list.head; var c = 1; p.data.copy(ret); n -= p.data.length; while (p = p.next) { var buf = p.data; var nb = n > buf.length ? buf.length : n; buf.copy(ret, ret.length - n, 0, nb); n -= nb; if (n === 0) { if (nb === buf.length) { ++c; if (p.next) list.head = p.next;else list.head = list.tail = null; } else { list.head = p; p.data = buf.slice(nb); } break; } ++c; } list.length -= c; return ret; } function endReadable(stream) { var state = stream._readableState; // If we get here before consuming all the bytes, then that is a // bug in node. Should never happen. if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); if (!state.endEmitted) { state.ended = true; pna.nextTick(endReadableNT, state, stream); } } function endReadableNT(state, stream) { // Check that we didn't get one last unshift. if (!state.endEmitted && state.length === 0) { state.endEmitted = true; stream.readable = false; stream.emit('end'); } } function indexOf(xs, x) { for (var i = 0, l = xs.length; i < l; i++) { if (xs[i] === x) return i; } return -1; }// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // a transform stream is a readable/writable stream where you do // something with the data. Sometimes it's called a "filter", // but that's not a great name for it, since that implies a thing where // some bits pass through, and others are simply ignored. (That would // be a valid example of a transform, of course.) // // While the output is causally related to the input, it's not a // necessarily symmetric or synchronous transformation. For example, // a zlib stream might take multiple plain-text writes(), and then // emit a single compressed chunk some time in the future. // // Here's how this works: // // The Transform stream has all the aspects of the readable and writable // stream classes. When you write(chunk), that calls _write(chunk,cb) // internally, and returns false if there's a lot of pending writes // buffered up. When you call read(), that calls _read(n) until // there's enough pending readable data buffered up. // // In a transform stream, the written data is placed in a buffer. When // _read(n) is called, it transforms the queued up data, calling the // buffered _write cb's as it consumes chunks. If consuming a single // written chunk would result in multiple output chunks, then the first // outputted bit calls the readcb, and subsequent chunks just go into // the read buffer, and will cause it to emit 'readable' if necessary. // // This way, back-pressure is actually determined by the reading side, // since _read has to be called to start processing a new chunk. However, // a pathological inflate type of transform can cause excessive buffering // here. For example, imagine a stream where every byte of input is // interpreted as an integer from 0-255, and then results in that many // bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in // 1kb of data being output. In this case, you could write a very small // amount of input, and end up with a very large amount of output. In // such a pathological inflating mechanism, there'd be no way to tell // the system to stop doing the transform. A single 4MB write could // cause the system to run out of memory. // // However, even in such a pathological case, only a single written chunk // would be consumed, and then the rest would wait (un-transformed) until // the results of the previous transformed chunk were consumed. 'use strict'; module.exports = Transform; var Duplex = require('./_stream_duplex'); /**/ var util = Object.create(require('core-util-is')); util.inherits = require('inherits'); /**/ util.inherits(Transform, Duplex); function afterTransform(er, data) { var ts = this._transformState; ts.transforming = false; var cb = ts.writecb; if (!cb) { return this.emit('error', new Error('write callback called multiple times')); } ts.writechunk = null; ts.writecb = null; if (data != null) // single equals check for both `null` and `undefined` this.push(data); cb(er); var rs = this._readableState; rs.reading = false; if (rs.needReadable || rs.length < rs.highWaterMark) { this._read(rs.highWaterMark); } } function Transform(options) { if (!(this instanceof Transform)) return new Transform(options); Duplex.call(this, options); this._transformState = { afterTransform: afterTransform.bind(this), needTransform: false, transforming: false, writecb: null, writechunk: null, writeencoding: null }; // start out asking for a readable event once data is transformed. this._readableState.needReadable = true; // we have implemented the _read method, and done the other things // that Readable wants before the first _read call, so unset the // sync guard flag. this._readableState.sync = false; if (options) { if (typeof options.transform === 'function') this._transform = options.transform; if (typeof options.flush === 'function') this._flush = options.flush; } // When the writable side finishes, then flush out anything remaining. this.on('prefinish', prefinish); } function prefinish() { var _this = this; if (typeof this._flush === 'function') { this._flush(function (er, data) { done(_this, er, data); }); } else { done(this, null, null); } } Transform.prototype.push = function (chunk, encoding) { this._transformState.needTransform = false; return Duplex.prototype.push.call(this, chunk, encoding); }; // This is the part where you do stuff! // override this function in implementation classes. // 'chunk' is an input chunk. // // Call `push(newChunk)` to pass along transformed output // to the readable side. You may call 'push' zero or more times. // // Call `cb(err)` when you are done with this chunk. If you pass // an error, then that'll put the hurt on the whole operation. If you // never call cb(), then you'll never get another chunk. Transform.prototype._transform = function (chunk, encoding, cb) { throw new Error('_transform() is not implemented'); }; Transform.prototype._write = function (chunk, encoding, cb) { var ts = this._transformState; ts.writecb = cb; ts.writechunk = chunk; ts.writeencoding = encoding; if (!ts.transforming) { var rs = this._readableState; if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); } }; // Doesn't matter what the args are here. // _transform does all the work. // That we got here means that the readable side wants more data. Transform.prototype._read = function (n) { var ts = this._transformState; if (ts.writechunk !== null && ts.writecb && !ts.transforming) { ts.transforming = true; this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); } else { // mark that we need a transform, so that any data that comes in // will get processed, now that we've asked for it. ts.needTransform = true; } }; Transform.prototype._destroy = function (err, cb) { var _this2 = this; Duplex.prototype._destroy.call(this, err, function (err2) { cb(err2); _this2.emit('close'); }); }; function done(stream, er, data) { if (er) return stream.emit('error', er); if (data != null) // single equals check for both `null` and `undefined` stream.push(data); // if there's nothing in the write buffer, then that means // that nothing more will ever be provided if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); return stream.push(null); }// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // A bit simpler than readable streams. // Implement an async ._write(chunk, encoding, cb), and it'll handle all // the drain event emission and buffering. 'use strict'; /**/ var pna = require('process-nextick-args'); /**/ module.exports = Writable; /* */ function WriteReq(chunk, encoding, cb) { this.chunk = chunk; this.encoding = encoding; this.callback = cb; this.next = null; } // It seems a linked list but it is not // there will be only 2 of these for each stream function CorkedRequest(state) { var _this = this; this.next = null; this.entry = null; this.finish = function () { onCorkedFinish(_this, state); }; } /* */ /**/ var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; /**/ /**/ var Duplex; /**/ Writable.WritableState = WritableState; /**/ var util = Object.create(require('core-util-is')); util.inherits = require('inherits'); /**/ /**/ var internalUtil = { deprecate: require('util-deprecate') }; /**/ /**/ var Stream = require('./internal/streams/stream'); /**/ /**/ var Buffer = require('safe-buffer').Buffer; var OurUint8Array = global.Uint8Array || function () {}; function _uint8ArrayToBuffer(chunk) { return Buffer.from(chunk); } function _isUint8Array(obj) { return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; } /**/ var destroyImpl = require('./internal/streams/destroy'); util.inherits(Writable, Stream); function nop() {} function WritableState(options, stream) { Duplex = Duplex || require('./_stream_duplex'); options = options || {}; // Duplex streams are both readable and writable, but share // the same options object. // However, some cases require setting options to different // values for the readable and the writable sides of the duplex stream. // These options can be provided separately as readableXXX and writableXXX. var isDuplex = stream instanceof Duplex; // object stream flag to indicate whether or not this stream // contains buffers or objects. this.objectMode = !!options.objectMode; if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; // the point at which write() starts returning false // Note: 0 is a valid value, means that we always return false if // the entire buffer is not flushed immediately on write() var hwm = options.highWaterMark; var writableHwm = options.writableHighWaterMark; var defaultHwm = this.objectMode ? 16 : 16 * 1024; if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; // cast to ints. this.highWaterMark = Math.floor(this.highWaterMark); // if _final has been called this.finalCalled = false; // drain event flag. this.needDrain = false; // at the start of calling end() this.ending = false; // when end() has been called, and returned this.ended = false; // when 'finish' is emitted this.finished = false; // has it been destroyed this.destroyed = false; // should we decode strings into buffers before passing to _write? // this is here so that some node-core streams can optimize string // handling at a lower level. var noDecode = options.decodeStrings === false; this.decodeStrings = !noDecode; // Crypto is kind of old and crusty. Historically, its default string // encoding is 'binary' so we have to make this configurable. // Everything else in the universe uses 'utf8', though. this.defaultEncoding = options.defaultEncoding || 'utf8'; // not an actual buffer we keep track of, but a measurement // of how much we're waiting to get pushed to some underlying // socket or file. this.length = 0; // a flag to see when we're in the middle of a write. this.writing = false; // when true all writes will be buffered until .uncork() call this.corked = 0; // a flag to be able to tell if the onwrite cb is called immediately, // or on a later tick. We set this to true at first, because any // actions that shouldn't happen until "later" should generally also // not happen before the first write call. this.sync = true; // a flag to know if we're processing previously buffered items, which // may call the _write() callback in the same tick, so that we don't // end up in an overlapped onwrite situation. this.bufferProcessing = false; // the callback that's passed to _write(chunk,cb) this.onwrite = function (er) { onwrite(stream, er); }; // the callback that the user supplies to write(chunk,encoding,cb) this.writecb = null; // the amount that is being written when _write is called. this.writelen = 0; this.bufferedRequest = null; this.lastBufferedRequest = null; // number of pending user-supplied write callbacks // this must be 0 before 'finish' can be emitted this.pendingcb = 0; // emit prefinish if the only thing we're waiting for is _write cbs // This is relevant for synchronous Transform streams this.prefinished = false; // True if the error was already emitted and should not be thrown again this.errorEmitted = false; // count buffered requests this.bufferedRequestCount = 0; // allocate the first CorkedRequest, there is always // one allocated and free to use, and we maintain at most two this.corkedRequestsFree = new CorkedRequest(this); } WritableState.prototype.getBuffer = function getBuffer() { var current = this.bufferedRequest; var out = []; while (current) { out.push(current); current = current.next; } return out; }; (function () { try { Object.defineProperty(WritableState.prototype, 'buffer', { get: internalUtil.deprecate(function () { return this.getBuffer(); }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') }); } catch (_) {} })(); // Test _writableState for inheritance to account for Duplex streams, // whose prototype chain only points to Readable. var realHasInstance; if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { realHasInstance = Function.prototype[Symbol.hasInstance]; Object.defineProperty(Writable, Symbol.hasInstance, { value: function (object) { if (realHasInstance.call(this, object)) return true; if (this !== Writable) return false; return object && object._writableState instanceof WritableState; } }); } else { realHasInstance = function (object) { return object instanceof this; }; } function Writable(options) { Duplex = Duplex || require('./_stream_duplex'); // Writable ctor is applied to Duplexes, too. // `realHasInstance` is necessary because using plain `instanceof` // would return false, as no `_writableState` property is attached. // Trying to use the custom `instanceof` for Writable here will also break the // Node.js LazyTransform implementation, which has a non-trivial getter for // `_writableState` that would lead to infinite recursion. if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { return new Writable(options); } this._writableState = new WritableState(options, this); // legacy. this.writable = true; if (options) { if (typeof options.write === 'function') this._write = options.write; if (typeof options.writev === 'function') this._writev = options.writev; if (typeof options.destroy === 'function') this._destroy = options.destroy; if (typeof options.final === 'function') this._final = options.final; } Stream.call(this); } // Otherwise people can pipe Writable streams, which is just wrong. Writable.prototype.pipe = function () { this.emit('error', new Error('Cannot pipe, not readable')); }; function writeAfterEnd(stream, cb) { var er = new Error('write after end'); // TODO: defer error events consistently everywhere, not just the cb stream.emit('error', er); pna.nextTick(cb, er); } // Checks that a user-supplied chunk is valid, especially for the particular // mode the stream is in. Currently this means that `null` is never accepted // and undefined/non-string values are only allowed in object mode. function validChunk(stream, state, chunk, cb) { var valid = true; var er = false; if (chunk === null) { er = new TypeError('May not write null values to stream'); } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { er = new TypeError('Invalid non-string/buffer chunk'); } if (er) { stream.emit('error', er); pna.nextTick(cb, er); valid = false; } return valid; } Writable.prototype.write = function (chunk, encoding, cb) { var state = this._writableState; var ret = false; var isBuf = !state.objectMode && _isUint8Array(chunk); if (isBuf && !Buffer.isBuffer(chunk)) { chunk = _uint8ArrayToBuffer(chunk); } if (typeof encoding === 'function') { cb = encoding; encoding = null; } if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; if (typeof cb !== 'function') cb = nop; if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { state.pendingcb++; ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); } return ret; }; Writable.prototype.cork = function () { var state = this._writableState; state.corked++; }; Writable.prototype.uncork = function () { var state = this._writableState; if (state.corked) { state.corked--; if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); } }; Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { // node::ParseEncoding() requires lower case. if (typeof encoding === 'string') encoding = encoding.toLowerCase(); if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); this._writableState.defaultEncoding = encoding; return this; }; function decodeChunk(state, chunk, encoding) { if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { chunk = Buffer.from(chunk, encoding); } return chunk; } Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function () { return this._writableState.highWaterMark; } }); // if we're already writing something, then just put this // in the queue, and wait our turn. Otherwise, call _write // If we return false, then we need a drain event, so set that flag. function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { if (!isBuf) { var newChunk = decodeChunk(state, chunk, encoding); if (chunk !== newChunk) { isBuf = true; encoding = 'buffer'; chunk = newChunk; } } var len = state.objectMode ? 1 : chunk.length; state.length += len; var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false. if (!ret) state.needDrain = true; if (state.writing || state.corked) { var last = state.lastBufferedRequest; state.lastBufferedRequest = { chunk: chunk, encoding: encoding, isBuf: isBuf, callback: cb, next: null }; if (last) { last.next = state.lastBufferedRequest; } else { state.bufferedRequest = state.lastBufferedRequest; } state.bufferedRequestCount += 1; } else { doWrite(stream, state, false, len, chunk, encoding, cb); } return ret; } function doWrite(stream, state, writev, len, chunk, encoding, cb) { state.writelen = len; state.writecb = cb; state.writing = true; state.sync = true; if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); state.sync = false; } function onwriteError(stream, state, sync, er, cb) { --state.pendingcb; if (sync) { // defer the callback if we are being called synchronously // to avoid piling up things on the stack pna.nextTick(cb, er); // this can emit finish, and it will always happen // after error pna.nextTick(finishMaybe, stream, state); stream._writableState.errorEmitted = true; stream.emit('error', er); } else { // the caller expect this to happen before if // it is async cb(er); stream._writableState.errorEmitted = true; stream.emit('error', er); // this can emit finish, but finish must // always follow error finishMaybe(stream, state); } } function onwriteStateUpdate(state) { state.writing = false; state.writecb = null; state.length -= state.writelen; state.writelen = 0; } function onwrite(stream, er) { var state = stream._writableState; var sync = state.sync; var cb = state.writecb; onwriteStateUpdate(state); if (er) onwriteError(stream, state, sync, er, cb);else { // Check if we're actually ready to finish, but don't emit yet var finished = needFinish(state); if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { clearBuffer(stream, state); } if (sync) { /**/ asyncWrite(afterWrite, stream, state, finished, cb); /**/ } else { afterWrite(stream, state, finished, cb); } } } function afterWrite(stream, state, finished, cb) { if (!finished) onwriteDrain(stream, state); state.pendingcb--; cb(); finishMaybe(stream, state); } // Must force callback to be called on nextTick, so that we don't // emit 'drain' before the write() consumer gets the 'false' return // value, and has a chance to attach a 'drain' listener. function onwriteDrain(stream, state) { if (state.length === 0 && state.needDrain) { state.needDrain = false; stream.emit('drain'); } } // if there's something in the buffer waiting, then process it function clearBuffer(stream, state) { state.bufferProcessing = true; var entry = state.bufferedRequest; if (stream._writev && entry && entry.next) { // Fast case, write everything using _writev() var l = state.bufferedRequestCount; var buffer = new Array(l); var holder = state.corkedRequestsFree; holder.entry = entry; var count = 0; var allBuffers = true; while (entry) { buffer[count] = entry; if (!entry.isBuf) allBuffers = false; entry = entry.next; count += 1; } buffer.allBuffers = allBuffers; doWrite(stream, state, true, state.length, buffer, '', holder.finish); // doWrite is almost always async, defer these to save a bit of time // as the hot path ends with doWrite state.pendingcb++; state.lastBufferedRequest = null; if (holder.next) { state.corkedRequestsFree = holder.next; holder.next = null; } else { state.corkedRequestsFree = new CorkedRequest(state); } state.bufferedRequestCount = 0; } else { // Slow case, write chunks one-by-one while (entry) { var chunk = entry.chunk; var encoding = entry.encoding; var cb = entry.callback; var len = state.objectMode ? 1 : chunk.length; doWrite(stream, state, false, len, chunk, encoding, cb); entry = entry.next; state.bufferedRequestCount--; // if we didn't call the onwrite immediately, then // it means that we need to wait until it does. // also, that means that the chunk and cb are currently // being processed, so move the buffer counter past them. if (state.writing) { break; } } if (entry === null) state.lastBufferedRequest = null; } state.bufferedRequest = entry; state.bufferProcessing = false; } Writable.prototype._write = function (chunk, encoding, cb) { cb(new Error('_write() is not implemented')); }; Writable.prototype._writev = null; Writable.prototype.end = function (chunk, encoding, cb) { var state = this._writableState; if (typeof chunk === 'function') { cb = chunk; chunk = null; encoding = null; } else if (typeof encoding === 'function') { cb = encoding; encoding = null; } if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); // .end() fully uncorks if (state.corked) { state.corked = 1; this.uncork(); } // ignore unnecessary end() calls. if (!state.ending && !state.finished) endWritable(this, state, cb); }; function needFinish(state) { return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; } function callFinal(stream, state) { stream._final(function (err) { state.pendingcb--; if (err) { stream.emit('error', err); } state.prefinished = true; stream.emit('prefinish'); finishMaybe(stream, state); }); } function prefinish(stream, state) { if (!state.prefinished && !state.finalCalled) { if (typeof stream._final === 'function') { state.pendingcb++; state.finalCalled = true; pna.nextTick(callFinal, stream, state); } else { state.prefinished = true; stream.emit('prefinish'); } } } function finishMaybe(stream, state) { var need = needFinish(state); if (need) { prefinish(stream, state); if (state.pendingcb === 0) { state.finished = true; stream.emit('finish'); } } return need; } function endWritable(stream, state, cb) { state.ending = true; finishMaybe(stream, state); if (cb) { if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); } state.ended = true; stream.writable = false; } function onCorkedFinish(corkReq, state, err) { var entry = corkReq.entry; corkReq.entry = null; while (entry) { var cb = entry.callback; state.pendingcb--; cb(err); entry = entry.next; } if (state.corkedRequestsFree) { state.corkedRequestsFree.next = corkReq; } else { state.corkedRequestsFree = corkReq; } } Object.defineProperty(Writable.prototype, 'destroyed', { get: function () { if (this._writableState === undefined) { return false; } return this._writableState.destroyed; }, set: function (value) { // we ignore the value if the stream // has not been initialized yet if (!this._writableState) { return; } // backward compatibility, the user is explicitly // managing destroyed this._writableState.destroyed = value; } }); Writable.prototype.destroy = destroyImpl.destroy; Writable.prototype._undestroy = destroyImpl.undestroy; Writable.prototype._destroy = function (err, cb) { this.end(); cb(err); };# streams WG Meeting 2015-01-30 ## Links * **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg * **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106 * **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/ ## Agenda Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting. * adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105) * release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101) * simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102) * proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99) ## Minutes ### adopt a charter * group: +1's all around ### What versioning scheme should be adopted? * group: +1’s 3.0.0 * domenic+group: pulling in patches from other sources where appropriate * mikeal: version independently, suggesting versions for io.js * mikeal+domenic: work with TC to notify in advance of changes simpler stream creation ### streamline creation of streams * sam: streamline creation of streams * domenic: nice simple solution posted but, we lose the opportunity to change the model may not be backwards incompatible (double check keys) **action item:** domenic will check ### remove implicit flowing of streams on(‘data’) * add isFlowing / isPaused * mikeal: worrying that we’re documenting polyfill methods – confuses users * domenic: more reflective API is probably good, with warning labels for users * new section for mad scientists (reflective stream access) * calvin: name the “third state” * mikeal: maybe borrow the name from whatwg? * domenic: we’re missing the “third state” * consensus: kind of difficult to name the third state * mikeal: figure out differences in states / compat * mathias: always flow on data – eliminates third state * explore what it breaks **action items:** * ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream) * ask rod/build for infrastructure * **chris**: explore the “flow on data” approach * add isPaused/isFlowing * add new docs section * move isPaused to that section /* eslint-disable node/no-deprecated-api */ var buffer = require('buffer') var Buffer = buffer.Buffer // alternative to using Object.keys for old browsers function copyProps (src, dst) { for (var key in src) { dst[key] = src[key] } } if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { module.exports = buffer } else { // Copy properties from require('buffer') copyProps(buffer, exports) exports.Buffer = SafeBuffer } function SafeBuffer (arg, encodingOrOffset, length) { return Buffer(arg, encodingOrOffset, length) } // Copy static methods from Buffer copyProps(Buffer, SafeBuffer) SafeBuffer.from = function (arg, encodingOrOffset, length) { if (typeof arg === 'number') { throw new TypeError('Argument must not be a number') } return Buffer(arg, encodingOrOffset, length) } SafeBuffer.alloc = function (size, fill, encoding) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } var buf = Buffer(size) if (fill !== undefined) { if (typeof encoding === 'string') { buf.fill(fill, encoding) } else { buf.fill(fill) } } else { buf.fill(0) } return buf } SafeBuffer.allocUnsafe = function (size) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } return Buffer(size) } SafeBuffer.allocUnsafeSlow = function (size) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } return buffer.SlowBuffer(size) } The MIT License (MIT) Copyright (c) Feross Aboukhadijeh Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "safe-buffer", "description": "Safer Node.js Buffer API", "version": "5.1.2", "author": { "name": "Feross Aboukhadijeh", "email": "feross@feross.org", "url": "http://feross.org" }, "bugs": { "url": "https://github.com/feross/safe-buffer/issues" }, "devDependencies": { "standard": "*", "tape": "^4.0.0" }, "homepage": "https://github.com/feross/safe-buffer", "keywords": [ "buffer", "buffer allocate", "node security", "safe", "safe-buffer", "security", "uninitialized" ], "license": "MIT", "main": "index.js", "types": "index.d.ts", "repository": { "type": "git", "url": "git://github.com/feross/safe-buffer.git" }, "scripts": { "test": "standard && tape test/*.js" } } Node.js is licensed for use as follows: """ Copyright Node.js contributors. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ This license applies to parts of Node.js originating from the https://github.com/joyent/node repository: """ Copyright Joyent, Inc. and other Node contributors. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ { "name": "string_decoder", "version": "1.1.1", "description": "The string_decoder module from Node core", "main": "lib/string_decoder.js", "dependencies": { "safe-buffer": "~5.1.0" }, "devDependencies": { "babel-polyfill": "^6.23.0", "core-util-is": "^1.0.2", "inherits": "^2.0.3", "tap": "~0.4.8" }, "scripts": { "test": "tap test/parallel/*.js && node test/verify-dependencies", "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js" }, "repository": { "type": "git", "url": "git://github.com/nodejs/string_decoder.git" }, "homepage": "https://github.com/nodejs/string_decoder", "keywords": [ "string", "decoder", "browser", "browserify" ], "license": "MIT" } 'use strict'; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Buffer = require('safe-buffer').Buffer; var util = require('util'); function copyBuffer(src, target, offset) { src.copy(target, offset); } module.exports = function () { function BufferList() { _classCallCheck(this, BufferList); this.head = null; this.tail = null; this.length = 0; } BufferList.prototype.push = function push(v) { var entry = { data: v, next: null }; if (this.length > 0) this.tail.next = entry;else this.head = entry; this.tail = entry; ++this.length; }; BufferList.prototype.unshift = function unshift(v) { var entry = { data: v, next: this.head }; if (this.length === 0) this.tail = entry; this.head = entry; ++this.length; }; BufferList.prototype.shift = function shift() { if (this.length === 0) return; var ret = this.head.data; if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; --this.length; return ret; }; BufferList.prototype.clear = function clear() { this.head = this.tail = null; this.length = 0; }; BufferList.prototype.join = function join(s) { if (this.length === 0) return ''; var p = this.head; var ret = '' + p.data; while (p = p.next) { ret += s + p.data; }return ret; }; BufferList.prototype.concat = function concat(n) { if (this.length === 0) return Buffer.alloc(0); if (this.length === 1) return this.head.data; var ret = Buffer.allocUnsafe(n >>> 0); var p = this.head; var i = 0; while (p) { copyBuffer(p.data, ret, i); i += p.data.length; p = p.next; } return ret; }; return BufferList; }(); if (util && util.inspect && util.inspect.custom) { module.exports.prototype[util.inspect.custom] = function () { var obj = util.inspect({ length: this.length }); return this.constructor.name + ' ' + obj; }; }'use strict'; /**/ var pna = require('process-nextick-args'); /**/ // undocumented cb() API, needed for core, not for public API function destroy(err, cb) { var _this = this; var readableDestroyed = this._readableState && this._readableState.destroyed; var writableDestroyed = this._writableState && this._writableState.destroyed; if (readableDestroyed || writableDestroyed) { if (cb) { cb(err); } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { pna.nextTick(emitErrorNT, this, err); } return this; } // we set destroyed to true before firing error callbacks in order // to make it re-entrance safe in case destroy() is called within callbacks if (this._readableState) { this._readableState.destroyed = true; } // if this is a duplex stream mark the writable part as destroyed as well if (this._writableState) { this._writableState.destroyed = true; } this._destroy(err || null, function (err) { if (!cb && err) { pna.nextTick(emitErrorNT, _this, err); if (_this._writableState) { _this._writableState.errorEmitted = true; } } else if (cb) { cb(err); } }); return this; } function undestroy() { if (this._readableState) { this._readableState.destroyed = false; this._readableState.reading = false; this._readableState.ended = false; this._readableState.endEmitted = false; } if (this._writableState) { this._writableState.destroyed = false; this._writableState.ended = false; this._writableState.ending = false; this._writableState.finished = false; this._writableState.errorEmitted = false; } } function emitErrorNT(self, err) { self.emit('error', err); } module.exports = { destroy: destroy, undestroy: undestroy };module.exports = require('events').EventEmitter; module.exports = require('stream'); // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; /**/ var Buffer = require('safe-buffer').Buffer; /**/ var isEncoding = Buffer.isEncoding || function (encoding) { encoding = '' + encoding; switch (encoding && encoding.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 true; default: return false; } }; function _normalizeEncoding(enc) { if (!enc) return 'utf8'; var retried; while (true) { switch (enc) { 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 enc; default: if (retried) return; // undefined enc = ('' + enc).toLowerCase(); retried = true; } } }; // Do not cache `Buffer.isEncoding` when checking encoding names as some // modules monkey-patch it to support additional encodings function normalizeEncoding(enc) { var nenc = _normalizeEncoding(enc); if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); return nenc || enc; } // StringDecoder provides an interface for efficiently splitting a series of // buffers into a series of JS strings without breaking apart multi-byte // characters. exports.StringDecoder = StringDecoder; function StringDecoder(encoding) { this.encoding = normalizeEncoding(encoding); var nb; switch (this.encoding) { case 'utf16le': this.text = utf16Text; this.end = utf16End; nb = 4; break; case 'utf8': this.fillLast = utf8FillLast; nb = 4; break; case 'base64': this.text = base64Text; this.end = base64End; nb = 3; break; default: this.write = simpleWrite; this.end = simpleEnd; return; } this.lastNeed = 0; this.lastTotal = 0; this.lastChar = Buffer.allocUnsafe(nb); } StringDecoder.prototype.write = function (buf) { if (buf.length === 0) return ''; var r; var i; if (this.lastNeed) { r = this.fillLast(buf); if (r === undefined) return ''; i = this.lastNeed; this.lastNeed = 0; } else { i = 0; } if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); return r || ''; }; StringDecoder.prototype.end = utf8End; // Returns only complete characters in a Buffer StringDecoder.prototype.text = utf8Text; // Attempts to complete a partial non-UTF-8 character using bytes from a Buffer StringDecoder.prototype.fillLast = function (buf) { if (this.lastNeed <= buf.length) { buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); return this.lastChar.toString(this.encoding, 0, this.lastTotal); } buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); this.lastNeed -= buf.length; }; // Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a // continuation byte. If an invalid byte is detected, -2 is returned. function utf8CheckByte(byte) { if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; return byte >> 6 === 0x02 ? -1 : -2; } // Checks at most 3 bytes at the end of a Buffer in order to detect an // incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) // needed to complete the UTF-8 character (if applicable) are returned. function utf8CheckIncomplete(self, buf, i) { var j = buf.length - 1; if (j < i) return 0; var nb = utf8CheckByte(buf[j]); if (nb >= 0) { if (nb > 0) self.lastNeed = nb - 1; return nb; } if (--j < i || nb === -2) return 0; nb = utf8CheckByte(buf[j]); if (nb >= 0) { if (nb > 0) self.lastNeed = nb - 2; return nb; } if (--j < i || nb === -2) return 0; nb = utf8CheckByte(buf[j]); if (nb >= 0) { if (nb > 0) { if (nb === 2) nb = 0;else self.lastNeed = nb - 3; } return nb; } return 0; } // Validates as many continuation bytes for a multi-byte UTF-8 character as // needed or are available. If we see a non-continuation byte where we expect // one, we "replace" the validated continuation bytes we've seen so far with // a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding // behavior. The continuation byte check is included three times in the case // where all of the continuation bytes for a character exist in the same buffer. // It is also done this way as a slight performance increase instead of using a // loop. function utf8CheckExtraBytes(self, buf, p) { if ((buf[0] & 0xC0) !== 0x80) { self.lastNeed = 0; return '\ufffd'; } if (self.lastNeed > 1 && buf.length > 1) { if ((buf[1] & 0xC0) !== 0x80) { self.lastNeed = 1; return '\ufffd'; } if (self.lastNeed > 2 && buf.length > 2) { if ((buf[2] & 0xC0) !== 0x80) { self.lastNeed = 2; return '\ufffd'; } } } } // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. function utf8FillLast(buf) { var p = this.lastTotal - this.lastNeed; var r = utf8CheckExtraBytes(this, buf, p); if (r !== undefined) return r; if (this.lastNeed <= buf.length) { buf.copy(this.lastChar, p, 0, this.lastNeed); return this.lastChar.toString(this.encoding, 0, this.lastTotal); } buf.copy(this.lastChar, p, 0, buf.length); this.lastNeed -= buf.length; } // Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a // partial character, the character's bytes are buffered until the required // number of bytes are available. function utf8Text(buf, i) { var total = utf8CheckIncomplete(this, buf, i); if (!this.lastNeed) return buf.toString('utf8', i); this.lastTotal = total; var end = buf.length - (total - this.lastNeed); buf.copy(this.lastChar, 0, end); return buf.toString('utf8', i, end); } // For UTF-8, a replacement character is added when ending on a partial // character. function utf8End(buf) { var r = buf && buf.length ? this.write(buf) : ''; if (this.lastNeed) return r + '\ufffd'; return r; } // UTF-16LE typically needs two bytes per character, but even if we have an even // number of bytes available, we need to check if we end on a leading/high // surrogate. In that case, we need to wait for the next two bytes in order to // decode the last character properly. function utf16Text(buf, i) { if ((buf.length - i) % 2 === 0) { var r = buf.toString('utf16le', i); if (r) { var c = r.charCodeAt(r.length - 1); if (c >= 0xD800 && c <= 0xDBFF) { this.lastNeed = 2; this.lastTotal = 4; this.lastChar[0] = buf[buf.length - 2]; this.lastChar[1] = buf[buf.length - 1]; return r.slice(0, -1); } } return r; } this.lastNeed = 1; this.lastTotal = 2; this.lastChar[0] = buf[buf.length - 1]; return buf.toString('utf16le', i, buf.length - 1); } // For UTF-16LE we do not explicitly append special replacement characters if we // end on a partial character, we simply let v8 handle that. function utf16End(buf) { var r = buf && buf.length ? this.write(buf) : ''; if (this.lastNeed) { var end = this.lastTotal - this.lastNeed; return r + this.lastChar.toString('utf16le', 0, end); } return r; } function base64Text(buf, i) { var n = (buf.length - i) % 3; if (n === 0) return buf.toString('base64', i); this.lastNeed = 3 - n; this.lastTotal = 3; if (n === 1) { this.lastChar[0] = buf[buf.length - 1]; } else { this.lastChar[0] = buf[buf.length - 2]; this.lastChar[1] = buf[buf.length - 1]; } return buf.toString('base64', i, buf.length - n); } function base64End(buf) { var r = buf && buf.length ? this.write(buf) : ''; if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); return r; } // Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) function simpleWrite(buf) { return buf.toString(this.encoding); } function simpleEnd(buf) { return buf && buf.length ? this.write(buf) : ''; }/*! safe-buffer. MIT License. Feross Aboukhadijeh */ /* eslint-disable node/no-deprecated-api */ var buffer = require('buffer') var Buffer = buffer.Buffer // alternative to using Object.keys for old browsers function copyProps (src, dst) { for (var key in src) { dst[key] = src[key] } } if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { module.exports = buffer } else { // Copy properties from require('buffer') copyProps(buffer, exports) exports.Buffer = SafeBuffer } function SafeBuffer (arg, encodingOrOffset, length) { return Buffer(arg, encodingOrOffset, length) } SafeBuffer.prototype = Object.create(Buffer.prototype) // Copy static methods from Buffer copyProps(Buffer, SafeBuffer) SafeBuffer.from = function (arg, encodingOrOffset, length) { if (typeof arg === 'number') { throw new TypeError('Argument must not be a number') } return Buffer(arg, encodingOrOffset, length) } SafeBuffer.alloc = function (size, fill, encoding) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } var buf = Buffer(size) if (fill !== undefined) { if (typeof encoding === 'string') { buf.fill(fill, encoding) } else { buf.fill(fill) } } else { buf.fill(0) } return buf } SafeBuffer.allocUnsafe = function (size) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } return Buffer(size) } SafeBuffer.allocUnsafeSlow = function (size) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } return buffer.SlowBuffer(size) } The MIT License (MIT) Copyright (c) Feross Aboukhadijeh Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "safe-buffer", "description": "Safer Node.js Buffer API", "version": "5.2.1", "author": { "name": "Feross Aboukhadijeh", "email": "feross@feross.org", "url": "https://feross.org" }, "bugs": { "url": "https://github.com/feross/safe-buffer/issues" }, "devDependencies": { "standard": "*", "tape": "^5.0.0" }, "homepage": "https://github.com/feross/safe-buffer", "keywords": [ "buffer", "buffer allocate", "node security", "safe", "safe-buffer", "security", "uninitialized" ], "license": "MIT", "main": "index.js", "types": "index.d.ts", "repository": { "type": "git", "url": "git://github.com/feross/safe-buffer.git" }, "scripts": { "test": "standard && tape test/*.js" }, "funding": [ { "type": "github", "url": "https://github.com/sponsors/feross" }, { "type": "patreon", "url": "https://www.patreon.com/feross" }, { "type": "consulting", "url": "https://feross.org/support" } ] } 'use strict'; const stripAnsi = require('strip-ansi'); const isFullwidthCodePoint = require('is-fullwidth-code-point'); const emojiRegex = require('emoji-regex'); const stringWidth = string => { string = string.replace(emojiRegex(), ' '); if (typeof string !== 'string' || string.length === 0) { return 0; } string = stripAnsi(string); let width = 0; for (let i = 0; i < string.length; i++) { const code = string.codePointAt(i); // Ignore control characters if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) { continue; } // Ignore combining characters if (code >= 0x300 && code <= 0x36F) { continue; } // Surrogates if (code > 0xFFFF) { i++; } width += isFullwidthCodePoint(code) ? 2 : 1; } return width; }; module.exports = stringWidth; // TODO: remove this in the next major version module.exports.default = stringWidth; MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "string-width", "version": "4.2.0", "description": "Get the visual width of a string - the number of columns required to display it", "license": "MIT", "repository": "sindresorhus/string-width", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=8" }, "scripts": { "test": "xo && ava && tsd" }, "files": [ "index.js", "index.d.ts" ], "keywords": [ "string", "character", "unicode", "width", "visual", "column", "columns", "fullwidth", "full-width", "full", "ansi", "escape", "codes", "cli", "command-line", "terminal", "console", "cjk", "chinese", "japanese", "korean", "fixed-width" ], "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.0" }, "devDependencies": { "ava": "^1.4.1", "tsd": "^0.7.1", "xo": "^0.24.0" } } 'use strict'; module.exports = ({onlyFirst = false} = {}) => { const pattern = [ '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' ].join('|'); return new RegExp(pattern, onlyFirst ? undefined : 'g'); }; MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "ansi-regex", "version": "5.0.0", "description": "Regular expression for matching ANSI escape codes", "license": "MIT", "repository": "chalk/ansi-regex", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=8" }, "scripts": { "test": "xo && ava && tsd", "view-supported": "node fixtures/view-codes.js" }, "files": [ "index.js", "index.d.ts" ], "keywords": [ "ansi", "styles", "color", "colour", "colors", "terminal", "console", "cli", "string", "tty", "escape", "formatting", "rgb", "256", "shell", "xterm", "command-line", "text", "regex", "regexp", "re", "match", "test", "find", "pattern" ], "devDependencies": { "ava": "^2.4.0", "tsd": "^0.9.0", "xo": "^0.25.3" } } /* eslint-disable yoda */ 'use strict'; const isFullwidthCodePoint = codePoint => { if (Number.isNaN(codePoint)) { return false; } // Code points are derived from: // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt if ( codePoint >= 0x1100 && ( codePoint <= 0x115F || // Hangul Jamo codePoint === 0x2329 || // LEFT-POINTING ANGLE BRACKET codePoint === 0x232A || // RIGHT-POINTING ANGLE BRACKET // CJK Radicals Supplement .. Enclosed CJK Letters and Months (0x2E80 <= codePoint && codePoint <= 0x3247 && codePoint !== 0x303F) || // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A (0x3250 <= codePoint && codePoint <= 0x4DBF) || // CJK Unified Ideographs .. Yi Radicals (0x4E00 <= codePoint && codePoint <= 0xA4C6) || // Hangul Jamo Extended-A (0xA960 <= codePoint && codePoint <= 0xA97C) || // Hangul Syllables (0xAC00 <= codePoint && codePoint <= 0xD7A3) || // CJK Compatibility Ideographs (0xF900 <= codePoint && codePoint <= 0xFAFF) || // Vertical Forms (0xFE10 <= codePoint && codePoint <= 0xFE19) || // CJK Compatibility Forms .. Small Form Variants (0xFE30 <= codePoint && codePoint <= 0xFE6B) || // Halfwidth and Fullwidth Forms (0xFF01 <= codePoint && codePoint <= 0xFF60) || (0xFFE0 <= codePoint && codePoint <= 0xFFE6) || // Kana Supplement (0x1B000 <= codePoint && codePoint <= 0x1B001) || // Enclosed Ideographic Supplement (0x1F200 <= codePoint && codePoint <= 0x1F251) || // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane (0x20000 <= codePoint && codePoint <= 0x3FFFD) ) ) { return true; } return false; }; module.exports = isFullwidthCodePoint; module.exports.default = isFullwidthCodePoint; MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "is-fullwidth-code-point", "version": "3.0.0", "description": "Check if the character represented by a given Unicode code point is fullwidth", "license": "MIT", "repository": "sindresorhus/is-fullwidth-code-point", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=8" }, "scripts": { "test": "xo && ava && tsd-check" }, "files": [ "index.js", "index.d.ts" ], "keywords": [ "fullwidth", "full-width", "full", "width", "unicode", "character", "string", "codepoint", "code", "point", "is", "detect", "check" ], "devDependencies": { "ava": "^1.3.1", "tsd-check": "^0.5.0", "xo": "^0.24.0" } } 'use strict'; const ansiRegex = require('ansi-regex'); module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "strip-ansi", "version": "6.0.0", "description": "Strip ANSI escape codes from a string", "license": "MIT", "repository": "chalk/strip-ansi", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=8" }, "scripts": { "test": "xo && ava && tsd" }, "files": [ "index.js", "index.d.ts" ], "keywords": [ "strip", "trim", "remove", "ansi", "styles", "color", "colour", "colors", "terminal", "console", "string", "tty", "escape", "formatting", "rgb", "256", "shell", "xterm", "log", "logging", "command-line", "text" ], "dependencies": { "ansi-regex": "^5.0.0" }, "devDependencies": { "ava": "^2.4.0", "tsd": "^0.10.0", "xo": "^0.25.3" } } 'use strict'; var ansiRegex = require('ansi-regex')(); module.exports = function (str) { return typeof str === 'string' ? str.replace(ansiRegex, '') : str; }; The MIT License (MIT) Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "strip-ansi", "version": "3.0.1", "description": "Strip ANSI escape codes", "license": "MIT", "repository": "chalk/strip-ansi", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "maintainers": [ "Sindre Sorhus (sindresorhus.com)", "Joshua Boy Nicolai Appelman (jbna.nl)", "JD Ballard (github.com/qix-)" ], "engines": { "node": ">=0.10.0" }, "scripts": { "test": "xo && ava" }, "files": [ "index.js" ], "keywords": [ "strip", "trim", "remove", "ansi", "styles", "color", "colour", "colors", "terminal", "console", "string", "tty", "escape", "formatting", "rgb", "256", "shell", "xterm", "log", "logging", "command-line", "text" ], "dependencies": { "ansi-regex": "^2.0.0" }, "devDependencies": { "ava": "*", "xo": "*" } } Copyright (c) Microsoft Corporation. MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.{ "name": "@microsoft/1ds-core-js", "version": "3.2.2", "description": "Microsoft Application Insights JavaScript SDK - 1ds-core-js extensions", "author": "Microsoft Application Insights Team", "homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme", "license": "MIT", "sideEffects": false, "scripts": { "publishPackage": "npm publish", "docs": "typedoc --out docs docs --excludePrivate --excludeProtected --tsconfig lib/tsconfig.json --theme minimal", "sri": "node ../../tools/subResourceIntegrity/generateIntegrityFile.js" }, "publishConfig": { "registry": "https://registry.npmjs.org" }, "repository": { "type": "git", "url": "https://github.com/microsoft/ApplicationInsights-JS" }, "main": "dist/ms.core.js", "module": "dist-esm/src/Index.js", "keywords": [ "1ds", "azure", "cloud", "script errors", "microsoft", "application insights", "Js", "SDK" ], "types": "dist-esm/src/Index.d.ts", "dependencies": { "@microsoft/applicationinsights-shims": "^2.0.1", "@microsoft/applicationinsights-core-js": "2.8.3", "@microsoft/dynamicproto-js": "^1.1.6" }, "devDependencies": { "grunt": "^1.4.1", "typedoc": "^0.22.13", "typescript": "^4.3.5" } }{ "compilerOptions": { "sourceMap": true, "inlineSources": true, "module": "es6", "moduleResolution": "Node", "target": "es3", "alwaysStrict": true, "strictNullChecks": false, "suppressImplicitAnyIndexErrors": true, "allowSyntheticDefaultImports": true, "importHelpers": true, "noEmitHelpers": true, "forceConsistentCasingInFileNames": true, "declaration": true, "outDir": "dist-esm/src/" }, "include": [ "./src/**/*.ts" ], "exclude": [ "node_modules/" ] }/*! * 1DS JS SDK Core, 3.2.2 * Copyright (c) Microsoft and contributors. All rights reserved. * (Microsoft Internal Only) */ (function (exports) { 'use strict'; var strShimFunction = "function"; var strShimObject = "object"; var strShimUndefined = "undefined"; var strShimPrototype = "prototype"; var strShimHasOwnProperty = "hasOwnProperty"; var ObjClass = Object; var ObjProto = ObjClass[strShimPrototype]; var ObjAssign = ObjClass["assign"]; var ObjCreate = ObjClass["create"]; var ObjDefineProperty = ObjClass["defineProperty"]; var ObjHasOwnProperty = ObjProto[strShimHasOwnProperty]; var _cachedGlobal = null; function getGlobal(useCached) { if (useCached === void 0) { useCached = true; } if (!_cachedGlobal || !useCached) { if (typeof globalThis !== strShimUndefined && globalThis) { _cachedGlobal = globalThis; } if (typeof self !== strShimUndefined && self) { _cachedGlobal = self; } if (typeof window !== strShimUndefined && window) { _cachedGlobal = window; } if (typeof global !== strShimUndefined && global) { _cachedGlobal = global; } } return _cachedGlobal; } function throwTypeError(message) { throw new TypeError(message); } function objCreateFn(obj) { var func = ObjCreate; if (func) { return func(obj); } if (obj == null) { return {}; } var type = typeof obj; if (type !== strShimObject && type !== strShimFunction) { throwTypeError("Object prototype may only be an Object:" + obj); } function tmpFunc() { } tmpFunc[strShimPrototype] = obj; return new tmpFunc(); } (getGlobal() || {})["Symbol"]; (getGlobal() || {})["Reflect"]; var __objAssignFnImpl = function (t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) { if (ObjProto[strShimHasOwnProperty].call(s, p)) { t[p] = s[p]; } } } return t; }; var __assignFn = ObjAssign || __objAssignFnImpl; var extendStaticsFn = function (d, b) { extendStaticsFn = ObjClass["setPrototypeOf"] || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) { if (b[strShimHasOwnProperty](p)) { d[p] = b[p]; } } }; return extendStaticsFn(d, b); }; function __extendsFn(d, b) { if (typeof b !== strShimFunction && b !== null) { throwTypeError("Class extends value " + String(b) + " is not a constructor or null"); } extendStaticsFn(d, b); function __() { this.constructor = d; } d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new __()); } function __spreadArrayFn(to, from) { for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) { to[j] = from[i]; } return to; } var MinChannelPriorty = 100; var strEmpty = ""; var strProcessTelemetry = "processTelemetry"; var strPriority = "priority"; var strSetNextPlugin = "setNextPlugin"; var strIsInitialized = "isInitialized"; var strTeardown = "teardown"; var strCore = "core"; var strUpdate = "update"; var strDisabled = "disabled"; var strDoTeardown = "_doTeardown"; var strProcessNext = "processNext"; var strResume = "resume"; var strPause = "pause"; var strNotificationListener = "NotificationListener"; var strAddNotificationListener = "add" + strNotificationListener; var strRemoveNotificationListener = "remove" + strNotificationListener; var strEventsSent = "eventsSent"; var strEventsDiscarded = "eventsDiscarded"; var strEventsSendRequest = "eventsSendRequest"; var strPerfEvent = "perfEvent"; var strToISOString = "toISOString"; var cStrEndsWith = "endsWith"; var cStrStartsWith = "startsWith"; var strIndexOf = "indexOf"; var strMap = "map"; var strReduce = "reduce"; var cStrTrim = "trim"; var strToString = "toString"; var str__Proto$1 = "__proto__"; var strConstructor = "constructor"; var _objDefineProperty$1 = ObjDefineProperty; var _objFreeze = ObjClass.freeze; var _objSeal = ObjClass.seal; var _objKeys = ObjClass.keys; var StringProto = String[strShimPrototype]; var _strTrim = StringProto[cStrTrim]; var _strEndsWith = StringProto[cStrEndsWith]; var _strStartsWith = StringProto[cStrStartsWith]; var DateProto = Date[strShimPrototype]; var _dataToISOString = DateProto[strToISOString]; var _isArray = Array.isArray; var _objToString = ObjProto[strToString]; var _fnToString = ObjHasOwnProperty[strToString]; var _objFunctionString = _fnToString.call(ObjClass); var rCamelCase = /-([a-z])/g; var rNormalizeInvalid = /([^\w\d_$])/g; var rLeadingNumeric = /^(\d+[\w\d_$])/; var _objGetPrototypeOf$1 = Object["getPrototypeOf"]; function _getObjProto$1(target) { if (target) { if (_objGetPrototypeOf$1) { return _objGetPrototypeOf$1(target); } var newProto = target[str__Proto$1] || target[strShimPrototype] || target[strConstructor]; if (newProto) { return newProto; } } return null; } function isTypeof(value, theType) { return typeof value === theType; } function isUndefined(value) { return value === undefined || typeof value === strShimUndefined; } function isNullOrUndefined(value) { return (value === null || isUndefined(value)); } function isNotNullOrUndefined(value) { return !isNullOrUndefined(value); } function hasOwnProperty(obj, prop) { return !!(obj && ObjHasOwnProperty.call(obj, prop)); } function isObject(value) { return !!(value && typeof value === strShimObject); } function isFunction(value) { return !!(value && typeof value === strShimFunction); } function normalizeJsName(name) { var value = name; if (value && isString(value)) { value = value.replace(rCamelCase, function (_all, letter) { return letter.toUpperCase(); }); value = value.replace(rNormalizeInvalid, "_"); value = value.replace(rLeadingNumeric, function (_all, match) { return "_" + match; }); } return value; } function objForEachKey(target, callbackfn) { if (target) { for (var prop in target) { if (ObjHasOwnProperty.call(target, prop)) { callbackfn.call(target, prop, target[prop]); } } } } function strEndsWith(value, search) { var result = false; if (value && search && !(result = value === search)) { result = _strEndsWith ? value[cStrEndsWith](search) : _strEndsWithPoly(value, search); } return result; } function _strEndsWithPoly(value, search) { var result = false; var searchLen = search ? search.length : 0; var valLen = value ? value.length : 0; if (searchLen && valLen && valLen >= searchLen && !(result = value === search)) { var pos = valLen - 1; for (var lp = searchLen - 1; lp >= 0; lp--) { if (value[pos] != search[lp]) { return false; } pos--; } result = true; } return result; } function strStartsWith(value, checkValue) { var result = false; if (value && checkValue && !(result = value === checkValue)) { result = _strStartsWith ? value[cStrStartsWith](checkValue) : _strStartsWithPoly(value, checkValue); } return result; } function _strStartsWithPoly(value, checkValue) { var result = false; var chkLen = checkValue ? checkValue.length : 0; if (value && chkLen && value.length >= chkLen && !(result = value === checkValue)) { for (var lp = 0; lp < chkLen; lp++) { if (value[lp] !== checkValue[lp]) { return false; } } result = true; } return result; } function strContains(value, search) { if (value && search) { return value.indexOf(search) !== -1; } return false; } function isDate(obj) { return !!(obj && _objToString.call(obj) === "[object Date]"); } var isArray = _isArray || _isArrayPoly; function _isArrayPoly(obj) { return !!(obj && _objToString.call(obj) === "[object Array]"); } function isError(obj) { return !!(obj && _objToString.call(obj) === "[object Error]"); } function isString(value) { return typeof value === "string"; } function isNumber(value) { return typeof value === "number"; } function isBoolean(value) { return typeof value === "boolean"; } function isPlainObject(value) { var result = false; if (value && typeof value === "object") { var proto = _objGetPrototypeOf$1 ? _objGetPrototypeOf$1(value) : _getObjProto$1(value); if (!proto) { result = true; } else { if (proto[strConstructor] && ObjHasOwnProperty.call(proto, strConstructor)) { proto = proto[strConstructor]; } result = typeof proto === strShimFunction && _fnToString.call(proto) === _objFunctionString; } } return result; } function toISOString(date) { if (date) { return _dataToISOString ? date[strToISOString]() : _toISOStringPoly(date); } } function _toISOStringPoly(date) { if (date && date.getUTCFullYear) { var pad = function (num) { var r = String(num); if (r.length === 1) { r = "0" + r; } return r; }; return date.getUTCFullYear() + "-" + pad(date.getUTCMonth() + 1) + "-" + pad(date.getUTCDate()) + "T" + pad(date.getUTCHours()) + ":" + pad(date.getUTCMinutes()) + ":" + pad(date.getUTCSeconds()) + "." + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5) + "Z"; } } function arrForEach(arr, callbackfn, thisArg) { var len = arr.length; try { for (var idx = 0; idx < len; idx++) { if (idx in arr) { if (callbackfn.call(thisArg || arr, arr[idx], idx, arr) === -1) { break; } } } } catch (e) { } } function arrIndexOf(arr, searchElement, fromIndex) { if (arr) { if (arr[strIndexOf]) { return arr[strIndexOf](searchElement, fromIndex); } var len = arr.length; var from = fromIndex || 0; try { for (var lp = Math.max(from >= 0 ? from : len - Math.abs(from), 0); lp < len; lp++) { if (lp in arr && arr[lp] === searchElement) { return lp; } } } catch (e) { } } return -1; } function arrMap(arr, callbackfn, thisArg) { var results; if (arr) { if (arr[strMap]) { return arr[strMap](callbackfn, thisArg); } var len = arr.length; var _this = thisArg || arr; results = new Array(len); try { for (var lp = 0; lp < len; lp++) { if (lp in arr) { results[lp] = callbackfn.call(_this, arr[lp], arr); } } } catch (e) { } } return results; } function arrReduce(arr, callbackfn, initialValue) { var value; if (arr) { if (arr[strReduce]) { return arr[strReduce](callbackfn, initialValue); } var len = arr.length; var lp = 0; if (arguments.length >= 3) { value = arguments[2]; } else { while (lp < len && !(lp in arr)) { lp++; } value = arr[lp++]; } while (lp < len) { if (lp in arr) { value = callbackfn(value, arr[lp], lp, arr); } lp++; } } return value; } function strTrim(str) { if (str) { str = (_strTrim && str[cStrTrim]) ? str[cStrTrim]() : (str.replace ? str.replace(/^\s+|\s+$/g, "") : str); } return str; } var _objKeysHasDontEnumBug = !({ toString: null }).propertyIsEnumerable("toString"); var _objKeysDontEnums = [ "toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor" ]; function objKeys(obj) { var objType = typeof obj; if (objType !== strShimFunction && (objType !== strShimObject || obj === null)) { throwTypeError("objKeys called on non-object"); } if (!_objKeysHasDontEnumBug && _objKeys) { return _objKeys(obj); } var result = []; for (var prop in obj) { if (obj && ObjHasOwnProperty.call(obj, prop)) { result.push(prop); } } if (_objKeysHasDontEnumBug) { var dontEnumsLength = _objKeysDontEnums.length; for (var lp = 0; lp < dontEnumsLength; lp++) { if (obj && ObjHasOwnProperty.call(obj, _objKeysDontEnums[lp])) { result.push(_objKeysDontEnums[lp]); } } } return result; } function objDefineAccessors(target, prop, getProp, setProp) { if (_objDefineProperty$1) { try { var descriptor = { enumerable: true, configurable: true }; if (getProp) { descriptor.get = getProp; } if (setProp) { descriptor.set = setProp; } _objDefineProperty$1(target, prop, descriptor); return true; } catch (e) { } } return false; } function _doNothing(value) { return value; } function deepFreeze(obj) { if (_objFreeze) { objForEachKey(obj, function (name, value) { if (isArray(value) || isObject(value)) { _objFreeze(value); } }); } return objFreeze(obj); } var objFreeze = _objFreeze || _doNothing; var objSeal = _objSeal || _doNothing; function dateNow() { var dt = Date; return dt.now ? dt.now() : new dt().getTime(); } function getExceptionName(object) { if (isError(object)) { return object.name; } return strEmpty; } function setValue(target, field, value, valChk, srcChk) { var theValue = value; if (target) { theValue = target[field]; if (theValue !== value && (!srcChk || srcChk(theValue)) && (!valChk || valChk(value))) { theValue = value; target[field] = theValue; } } return theValue; } function getSetValue(target, field, defValue) { var theValue; if (target) { theValue = target[field]; if (!theValue && isNullOrUndefined(theValue)) { theValue = !isUndefined(defValue) ? defValue : {}; target[field] = theValue; } } else { theValue = !isUndefined(defValue) ? defValue : {}; } return theValue; } function isNotTruthy(value) { return !value; } function isTruthy(value) { return !!value; } function throwError(message) { throw new Error(message); } function _createProxyFunction(source, funcName) { var srcFunc = null; var src = null; if (isFunction(source)) { srcFunc = source; } else { src = source; } return function () { var originalArguments = arguments; if (srcFunc) { src = srcFunc(); } if (src) { return src[funcName].apply(src, originalArguments); } }; } function proxyAssign(target, source, chkSet) { if (target && source && isObject(target) && isObject(source)) { var _loop_1 = function (field) { if (isString(field)) { var value = source[field]; if (isFunction(value)) { if (!chkSet || chkSet(field, true, source, target)) { target[field] = _createProxyFunction(source, field); } } else if (!chkSet || chkSet(field, false, source, target)) { if (hasOwnProperty(target, field)) { delete target[field]; } if (!objDefineAccessors(target, field, function () { return source[field]; }, function (theValue) { source[field] = theValue; })) { target[field] = value; } } } }; for (var field in source) { _loop_1(field); } } return target; } function proxyFunctionAs(target, name, source, theFunc, overwriteTarget) { if (target && name && source) { if (overwriteTarget !== false || isUndefined(target[name])) { target[name] = _createProxyFunction(source, theFunc); } } } function proxyFunctions(target, source, functionsToProxy, overwriteTarget) { if (target && source && isObject(target) && isArray(functionsToProxy)) { arrForEach(functionsToProxy, function (theFuncName) { if (isString(theFuncName)) { proxyFunctionAs(target, theFuncName, source, theFuncName, overwriteTarget); } }); } return target; } function optimizeObject(theObject) { if (theObject && ObjAssign) { theObject = ObjClass(ObjAssign({}, theObject)); } return theObject; } function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) { var theArgs = arguments; var extended = theArgs[0] || {}; var argLen = theArgs.length; var deep = false; var idx = 1; if (argLen > 0 && isBoolean(extended)) { deep = extended; extended = theArgs[idx] || {}; idx++; } if (!isObject(extended)) { extended = {}; } for (; idx < argLen; idx++) { var arg = theArgs[idx]; var isArgArray = isArray(arg); var isArgObj = isObject(arg); for (var prop in arg) { var propOk = (isArgArray && (prop in arg)) || (isArgObj && (ObjHasOwnProperty.call(arg, prop))); if (!propOk) { continue; } var newValue = arg[prop]; var isNewArray = void 0; if (deep && newValue && ((isNewArray = isArray(newValue)) || isPlainObject(newValue))) { var clone = extended[prop]; if (isNewArray) { if (!isArray(clone)) { clone = []; } } else if (!isPlainObject(clone)) { clone = {}; } newValue = objExtend(deep, clone, newValue); } if (newValue !== undefined) { extended[prop] = newValue; } } } return extended; } function createEnumStyle(values) { var enumClass = {}; objForEachKey(values, function (field, value) { enumClass[field] = value; enumClass[value] = field; }); return deepFreeze(enumClass); } var EventsDiscardedReason = createEnumStyle({ Unknown: 0 , NonRetryableStatus: 1 , InvalidEvent: 2 , SizeLimitExceeded: 3 , KillSwitch: 4 , QueueFull: 5 }); /*! * Microsoft Dynamic Proto Utility, 1.1.6 * Copyright (c) Microsoft and contributors. All rights reserved. */ var Constructor = 'constructor'; var Prototype = 'prototype'; var strFunction = 'function'; var DynInstFuncTable = '_dynInstFuncs'; var DynProxyTag = '_isDynProxy'; var DynClassName = '_dynClass'; var DynClassNamePrefix = '_dynCls$'; var DynInstChkTag = '_dynInstChk'; var DynAllowInstChkTag = DynInstChkTag; var DynProtoDefaultOptions = '_dfOpts'; var UnknownValue = '_unknown_'; var str__Proto = "__proto__"; var DynProtoBaseProto = "_dyn" + str__Proto; var DynProtoCurrent = "_dynInstProto"; var strUseBaseInst = 'useBaseInst'; var strSetInstFuncs = 'setInstFuncs'; var Obj = Object; var _objGetPrototypeOf = Obj["getPrototypeOf"]; var _objGetOwnProps = Obj["getOwnPropertyNames"]; var _dynamicNames = 0; function _hasOwnProperty(obj, prop) { return obj && Obj[Prototype].hasOwnProperty.call(obj, prop); } function _isObjectOrArrayPrototype(target) { return target && (target === Obj[Prototype] || target === Array[Prototype]); } function _isObjectArrayOrFunctionPrototype(target) { return _isObjectOrArrayPrototype(target) || target === Function[Prototype]; } function _getObjProto(target) { var newProto; if (target) { if (_objGetPrototypeOf) { return _objGetPrototypeOf(target); } var curProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null); newProto = target[DynProtoBaseProto] || curProto; if (!_hasOwnProperty(target, DynProtoBaseProto)) { delete target[DynProtoCurrent]; newProto = target[DynProtoBaseProto] = target[DynProtoCurrent] || target[DynProtoBaseProto]; target[DynProtoCurrent] = curProto; } } return newProto; } function _forEachProp(target, func) { var props = []; if (_objGetOwnProps) { props = _objGetOwnProps(target); } else { for (var name_1 in target) { if (typeof name_1 === "string" && _hasOwnProperty(target, name_1)) { props.push(name_1); } } } if (props && props.length > 0) { for (var lp = 0; lp < props.length; lp++) { func(props[lp]); } } } function _isDynamicCandidate(target, funcName, skipOwn) { return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName))); } function _throwTypeError(message) { throw new TypeError("DynamicProto: " + message); } function _getInstanceFuncs(thisTarget) { var instFuncs = {}; _forEachProp(thisTarget, function (name) { if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) { instFuncs[name] = thisTarget[name]; } }); return instFuncs; } function _hasVisited(values, value) { for (var lp = values.length - 1; lp >= 0; lp--) { if (values[lp] === value) { return true; } } return false; } function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) { function _instFuncProxy(target, funcHost, funcName) { var theFunc = funcHost[funcName]; if (theFunc[DynProxyTag] && useBaseInst) { var instFuncTable = target[DynInstFuncTable] || {}; if (instFuncTable[DynAllowInstChkTag] !== false) { theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc; } } return function () { return theFunc.apply(target, arguments); }; } var baseFuncs = {}; _forEachProp(instFuncs, function (name) { baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name); }); var baseProto = _getObjProto(classProto); var visited = []; while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) { _forEachProp(baseProto, function (name) { if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) { baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name); } }); visited.push(baseProto); baseProto = _getObjProto(baseProto); } return baseFuncs; } function _getInstFunc(target, funcName, proto, currentDynProtoProxy) { var instFunc = null; if (target && _hasOwnProperty(proto, DynClassName)) { var instFuncTable = target[DynInstFuncTable] || {}; instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName]; if (!instFunc) { _throwTypeError("Missing [" + funcName + "] " + strFunction); } if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) { var canAddInst = !_hasOwnProperty(target, funcName); var objProto = _getObjProto(target); var visited = []; while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) { var protoFunc = objProto[funcName]; if (protoFunc) { canAddInst = (protoFunc === currentDynProtoProxy); break; } visited.push(objProto); objProto = _getObjProto(objProto); } try { if (canAddInst) { target[funcName] = instFunc; } instFunc[DynInstChkTag] = 1; } catch (e) { instFuncTable[DynAllowInstChkTag] = false; } } } return instFunc; } function _getProtoFunc(funcName, proto, currentDynProtoProxy) { var protoFunc = proto[funcName]; if (protoFunc === currentDynProtoProxy) { protoFunc = _getObjProto(proto)[funcName]; } if (typeof protoFunc !== strFunction) { _throwTypeError("[" + funcName + "] is not a " + strFunction); } return protoFunc; } function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) { function _createDynamicPrototype(proto, funcName) { var dynProtoProxy = function () { var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy); return instFunc.apply(this, arguments); }; dynProtoProxy[DynProxyTag] = 1; return dynProtoProxy; } if (!_isObjectOrArrayPrototype(proto)) { var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {}; var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {}); if (instFuncTable[DynAllowInstChkTag] !== false) { instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc; } _forEachProp(target, function (name) { if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) { instFuncs_1[name] = target[name]; delete target[name]; if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) { proto[name] = _createDynamicPrototype(proto, name); } } }); } } function _checkPrototype(classProto, thisTarget) { if (_objGetPrototypeOf) { var visited = []; var thisProto = _getObjProto(thisTarget); while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) { if (thisProto === classProto) { return true; } visited.push(thisProto); thisProto = _getObjProto(thisProto); } return false; } return true; } function _getObjName(target, unknownValue) { if (_hasOwnProperty(target, Prototype)) { return target.name || unknownValue || UnknownValue; } return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue; } function dynamicProto(theClass, target, delegateFunc, options) { if (!_hasOwnProperty(theClass, Prototype)) { _throwTypeError("theClass is an invalid class definition."); } var classProto = theClass[Prototype]; if (!_checkPrototype(classProto, target)) { _throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]"); } var className = null; if (_hasOwnProperty(classProto, DynClassName)) { className = classProto[DynClassName]; } else { className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _dynamicNames; _dynamicNames++; classProto[DynClassName] = className; } var perfOptions = dynamicProto[DynProtoDefaultOptions]; var useBaseInst = !!perfOptions[strUseBaseInst]; if (useBaseInst && options && options[strUseBaseInst] !== undefined) { useBaseInst = !!options[strUseBaseInst]; } var instFuncs = _getInstanceFuncs(target); var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst); delegateFunc(target, baseFuncs); var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs]; if (setInstanceFunc && options) { setInstanceFunc = !!options[strSetInstFuncs]; } _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false); } var perfDefaults = { setInstFuncs: true, useBaseInst: true }; dynamicProto[DynProtoDefaultOptions] = perfDefaults; var strWindow = "window"; var strDocument = "document"; var strDocumentMode = "documentMode"; var strNavigator = "navigator"; var strHistory = "history"; var strLocation = "location"; var strConsole = "console"; var strPerformance = "performance"; var strJSON = "JSON"; var strCrypto = "crypto"; var strMsCrypto = "msCrypto"; var strReactNative = "ReactNative"; var strMsie = "msie"; var strTrident = "trident/"; var strXMLHttpRequest = "XMLHttpRequest"; var _isTrident = null; var _navUserAgentCheck = null; var _enableMocks = false; var _useXDomainRequest = null; var _beaconsSupported = null; function _hasProperty(theClass, property) { var supported = false; if (theClass) { try { supported = property in theClass; if (!supported) { var proto = theClass[strShimPrototype]; if (proto) { supported = property in proto; } } } catch (e) { } if (!supported) { try { var tmp = new theClass(); supported = !isUndefined(tmp[property]); } catch (e) { } } } return supported; } function setEnableEnvMocks(enabled) { _enableMocks = enabled; } function getGlobalInst(name) { var gbl = getGlobal(); if (gbl && gbl[name]) { return gbl[name]; } if (name === strWindow && hasWindow()) { return window; } return null; } function hasWindow() { return Boolean(typeof window === strShimObject && window); } function getWindow() { if (hasWindow()) { return window; } return getGlobalInst(strWindow); } function hasDocument() { return Boolean(typeof document === strShimObject && document); } function getDocument() { if (hasDocument()) { return document; } return getGlobalInst(strDocument); } function hasNavigator() { return Boolean(typeof navigator === strShimObject && navigator); } function getNavigator() { if (hasNavigator()) { return navigator; } return getGlobalInst(strNavigator); } function hasHistory() { return Boolean(typeof history === strShimObject && history); } function getHistory() { if (hasHistory()) { return history; } return getGlobalInst(strHistory); } function getLocation(checkForMock) { if (checkForMock && _enableMocks) { var mockLocation = getGlobalInst("__mockLocation"); if (mockLocation) { return mockLocation; } } if (typeof location === strShimObject && location) { return location; } return getGlobalInst(strLocation); } function getConsole() { if (typeof console !== strShimUndefined) { return console; } return getGlobalInst(strConsole); } function getPerformance() { return getGlobalInst(strPerformance); } function hasJSON() { return Boolean((typeof JSON === strShimObject && JSON) || getGlobalInst(strJSON) !== null); } function getJSON() { if (hasJSON()) { return JSON || getGlobalInst(strJSON); } return null; } function getCrypto() { return getGlobalInst(strCrypto); } function getMsCrypto() { return getGlobalInst(strMsCrypto); } function isReactNative() { var nav = getNavigator(); if (nav && nav.product) { return nav.product === strReactNative; } return false; } function isIE() { var nav = getNavigator(); if (nav && (nav.userAgent !== _navUserAgentCheck || _isTrident === null)) { _navUserAgentCheck = nav.userAgent; var userAgent = (_navUserAgentCheck || strEmpty).toLowerCase(); _isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident)); } return _isTrident; } function getIEVersion(userAgentStr) { if (userAgentStr === void 0) { userAgentStr = null; } if (!userAgentStr) { var navigator_1 = getNavigator() || {}; userAgentStr = navigator_1 ? (navigator_1.userAgent || strEmpty).toLowerCase() : strEmpty; } var ua = (userAgentStr || strEmpty).toLowerCase(); if (strContains(ua, strMsie)) { var doc = getDocument() || {}; return Math.max(parseInt(ua.split(strMsie)[1]), (doc[strDocumentMode] || 0)); } else if (strContains(ua, strTrident)) { var tridentVer = parseInt(ua.split(strTrident)[1]); if (tridentVer) { return tridentVer + 4; } } return null; } function dumpObj(object) { var objectTypeDump = Object[strShimPrototype].toString.call(object); var propertyValueDump = strEmpty; if (objectTypeDump === "[object Error]") { propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'"; } else if (hasJSON()) { propertyValueDump = getJSON().stringify(object); } return objectTypeDump + propertyValueDump; } function isBeaconsSupported() { if (_beaconsSupported === null) { _beaconsSupported = hasNavigator() && Boolean(getNavigator().sendBeacon); } return _beaconsSupported; } function isFetchSupported(withKeepAlive) { var isSupported = false; try { isSupported = !!getGlobalInst("fetch"); var request = getGlobalInst("Request"); if (isSupported && withKeepAlive && request) { isSupported = _hasProperty(request, "keepalive"); } } catch (e) { } return isSupported; } function useXDomainRequest() { if (_useXDomainRequest === null) { _useXDomainRequest = (typeof XDomainRequest !== strShimUndefined); if (_useXDomainRequest && isXhrSupported()) { _useXDomainRequest = _useXDomainRequest && !_hasProperty(getGlobalInst(strXMLHttpRequest), "withCredentials"); } } return _useXDomainRequest; } function isXhrSupported() { var isSupported = false; try { var xmlHttpRequest = getGlobalInst(strXMLHttpRequest); isSupported = !!xmlHttpRequest; } catch (e) { } return isSupported; } var listenerFuncs = ["eventsSent", "eventsDiscarded", "eventsSendRequest", "perfEvent"]; var _aiNamespace = null; var _debugListener; function _listenerProxyFunc(name, config) { return function () { var args = arguments; var dbgExt = getDebugExt(config); if (dbgExt) { var listener = dbgExt.listener; if (listener && listener[name]) { listener[name].apply(listener, args); } } }; } function _getExtensionNamespace() { var target = getGlobalInst("Microsoft"); if (target) { _aiNamespace = target["ApplicationInsights"]; } return _aiNamespace; } function getDebugExt(config) { var ns = _aiNamespace; if (!ns && config.disableDbgExt !== true) { ns = _aiNamespace || _getExtensionNamespace(); } return ns ? ns["ChromeDbgExt"] : null; } function getDebugListener(config) { if (!_debugListener) { _debugListener = {}; for (var lp = 0; lp < listenerFuncs.length; lp++) { _debugListener[listenerFuncs[lp]] = _listenerProxyFunc(listenerFuncs[lp], config); } } return _debugListener; } var AiNonUserActionablePrefix = "AI (Internal): "; var AiUserActionablePrefix = "AI: "; var AIInternalMessagePrefix = "AITR_"; var strErrorToConsole = "errorToConsole"; var strWarnToConsole = "warnToConsole"; function _sanitizeDiagnosticText(text) { if (text) { return "\"" + text.replace(/\"/g, strEmpty) + "\""; } return strEmpty; } function _logToConsole(func, message) { var theConsole = getConsole(); if (!!theConsole) { var logFunc = "log"; if (theConsole[func]) { logFunc = func; } if (isFunction(theConsole[logFunc])) { theConsole[logFunc](message); } } } var _InternalLogMessage = /** @class */ (function () { function _InternalLogMessage(msgId, msg, isUserAct, properties) { if (isUserAct === void 0) { isUserAct = false; } var _self = this; _self.messageId = msgId; _self.message = (isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) + msgId; var strProps = strEmpty; if (hasJSON()) { strProps = getJSON().stringify(properties); } var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : strEmpty) + (properties ? " props:" + _sanitizeDiagnosticText(strProps) : strEmpty); _self.message += diagnosticText; } _InternalLogMessage.dataType = "MessageData"; return _InternalLogMessage; }()); function safeGetLogger(core, config) { return (core || {}).logger || new DiagnosticLogger(config); } var DiagnosticLogger = /** @class */ (function () { function DiagnosticLogger(config) { this.identifier = "DiagnosticLogger"; this.queue = []; var _messageCount = 0; var _messageLogged = {}; dynamicProto(DiagnosticLogger, this, function (_self) { if (isNullOrUndefined(config)) { config = {}; } _self.consoleLoggingLevel = function () { return _getConfigValue("loggingLevelConsole", 0); }; _self.telemetryLoggingLevel = function () { return _getConfigValue("loggingLevelTelemetry", 1); }; _self.maxInternalMessageLimit = function () { return _getConfigValue("maxMessageLimit", 25); }; _self.enableDebugExceptions = function () { return _getConfigValue("enableDebugExceptions", false); }; _self.throwInternal = function (severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } var message = new _InternalLogMessage(msgId, msg, isUserAct, properties); if (_self.enableDebugExceptions()) { throw dumpObj(message); } else { var logFunc = severity === 1 ? strErrorToConsole : strWarnToConsole; if (!isUndefined(message.message)) { var logLevel = _self.consoleLoggingLevel(); if (isUserAct) { var messageKey = +message.messageId; if (!_messageLogged[messageKey] && logLevel >= severity) { _self[logFunc](message.message); _messageLogged[messageKey] = true; } } else { if (logLevel >= severity) { _self[logFunc](message.message); } } _self.logInternalMessage(severity, message); } else { _debugExtMsg("throw" + (severity === 1 ? "Critical" : "Warning"), message); } } }; _self.warnToConsole = function (message) { _logToConsole("warn", message); _debugExtMsg("warning", message); }; _self.errorToConsole = function (message) { _logToConsole("error", message); _debugExtMsg("error", message); }; _self.resetInternalMessageCount = function () { _messageCount = 0; _messageLogged = {}; }; _self.logInternalMessage = function (severity, message) { if (_areInternalMessagesThrottled()) { return; } var logMessage = true; var messageKey = AIInternalMessagePrefix + message.messageId; if (_messageLogged[messageKey]) { logMessage = false; } else { _messageLogged[messageKey] = true; } if (logMessage) { if (severity <= _self.telemetryLoggingLevel()) { _self.queue.push(message); _messageCount++; _debugExtMsg((severity === 1 ? "error" : "warn"), message); } if (_messageCount === _self.maxInternalMessageLimit()) { var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app."; var throttleMessage = new _InternalLogMessage(23 , throttleLimitMessage, false); _self.queue.push(throttleMessage); if (severity === 1 ) { _self.errorToConsole(throttleLimitMessage); } else { _self.warnToConsole(throttleLimitMessage); } } } }; function _getConfigValue(name, defValue) { var value = config[name]; if (!isNullOrUndefined(value)) { return value; } return defValue; } function _areInternalMessagesThrottled() { return _messageCount >= _self.maxInternalMessageLimit(); } function _debugExtMsg(name, data) { var dbgExt = getDebugExt(config); if (dbgExt && dbgExt.diagLog) { dbgExt.diagLog(name, data); } } }); } return DiagnosticLogger; }()); function _getLogger(logger) { return (logger || new DiagnosticLogger()); } function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } (logger || new DiagnosticLogger()).throwInternal(severity, msgId, msg, properties, isUserAct); } function _warnToConsole(logger, message) { _getLogger(logger).warnToConsole(message); } var strExecutionContextKey = "ctx"; var _defaultPerfManager = null; var PerfEvent = /** @class */ (function () { function PerfEvent(name, payloadDetails, isAsync) { var _self = this; var accessorDefined = false; _self.start = dateNow(); _self.name = name; _self.isAsync = isAsync; _self.isChildEvt = function () { return false; }; if (isFunction(payloadDetails)) { var theDetails_1; accessorDefined = objDefineAccessors(_self, "payload", function () { if (!theDetails_1 && isFunction(payloadDetails)) { theDetails_1 = payloadDetails(); payloadDetails = null; } return theDetails_1; }); } _self.getCtx = function (key) { if (key) { if (key === PerfEvent.ParentContextKey || key === PerfEvent.ChildrenContextKey) { return _self[key]; } return (_self[strExecutionContextKey] || {})[key]; } return null; }; _self.setCtx = function (key, value) { if (key) { if (key === PerfEvent.ParentContextKey) { if (!_self[key]) { _self.isChildEvt = function () { return true; }; } _self[key] = value; } else if (key === PerfEvent.ChildrenContextKey) { _self[key] = value; } else { var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {}; ctx[key] = value; } } }; _self.complete = function () { var childTime = 0; var childEvts = _self.getCtx(PerfEvent.ChildrenContextKey); if (isArray(childEvts)) { for (var lp = 0; lp < childEvts.length; lp++) { var childEvt = childEvts[lp]; if (childEvt) { childTime += childEvt.time; } } } _self.time = dateNow() - _self.start; _self.exTime = _self.time - childTime; _self.complete = function () { }; if (!accessorDefined && isFunction(payloadDetails)) { _self.payload = payloadDetails(); } }; } PerfEvent.ParentContextKey = "parent"; PerfEvent.ChildrenContextKey = "childEvts"; return PerfEvent; }()); var PerfManager = /** @class */ (function () { function PerfManager(manager) { this.ctx = {}; dynamicProto(PerfManager, this, function (_self) { _self.create = function (src, payloadDetails, isAsync) { return new PerfEvent(src, payloadDetails, isAsync); }; _self.fire = function (perfEvent) { if (perfEvent) { perfEvent.complete(); if (manager && isFunction(manager.perfEvent)) { manager.perfEvent(perfEvent); } } }; _self.setCtx = function (key, value) { if (key) { var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {}; ctx[key] = value; } }; _self.getCtx = function (key) { return (_self[strExecutionContextKey] || {})[key]; }; }); } return PerfManager; }()); var doPerfActiveKey = "CoreUtils.doPerf"; function doPerf(mgrSource, getSource, func, details, isAsync) { if (mgrSource) { var perfMgr = mgrSource; if (isFunction(perfMgr["getPerfMgr"])) { perfMgr = perfMgr["getPerfMgr"](); } if (perfMgr) { var perfEvt = void 0; var currentActive = perfMgr.getCtx(doPerfActiveKey); try { perfEvt = perfMgr.create(getSource(), details, isAsync); if (perfEvt) { if (currentActive && perfEvt.setCtx) { perfEvt.setCtx(PerfEvent.ParentContextKey, currentActive); if (currentActive.getCtx && currentActive.setCtx) { var children = currentActive.getCtx(PerfEvent.ChildrenContextKey); if (!children) { children = []; currentActive.setCtx(PerfEvent.ChildrenContextKey, children); } children.push(perfEvt); } } perfMgr.setCtx(doPerfActiveKey, perfEvt); return func(perfEvt); } } catch (ex) { if (perfEvt && perfEvt.setCtx) { perfEvt.setCtx("exception", ex); } } finally { if (perfEvt) { perfMgr.fire(perfEvt); } perfMgr.setCtx(doPerfActiveKey, currentActive); } } } return func(); } function getGblPerfMgr() { return _defaultPerfManager; } var UInt32Mask = 0x100000000; var MaxUInt32 = 0xffffffff; var _mwcSeeded = false; var _mwcW = 123456789; var _mwcZ = 987654321; function _mwcSeed(seedValue) { if (seedValue < 0) { seedValue >>>= 0; } _mwcW = (123456789 + seedValue) & MaxUInt32; _mwcZ = (987654321 - seedValue) & MaxUInt32; _mwcSeeded = true; } function _autoSeedMwc() { try { var now = dateNow() & 0x7fffffff; _mwcSeed(((Math.random() * UInt32Mask) ^ now) + now); } catch (e) { } } function randomValue(maxValue) { if (maxValue > 0) { return Math.floor((random32() / MaxUInt32) * (maxValue + 1)) >>> 0; } return 0; } function random32(signed) { var value = 0; var c = getCrypto() || getMsCrypto(); if (c && c.getRandomValues) { value = c.getRandomValues(new Uint32Array(1))[0] & MaxUInt32; } if (value === 0 && isIE()) { if (!_mwcSeeded) { _autoSeedMwc(); } value = mwcRandom32() & MaxUInt32; } if (value === 0) { value = Math.floor((UInt32Mask * Math.random()) | 0); } if (!signed) { value >>>= 0; } return value; } function mwcRandomSeed(value) { if (!value) { _autoSeedMwc(); } else { _mwcSeed(value); } } function mwcRandom32(signed) { _mwcZ = (36969 * (_mwcZ & 0xFFFF) + (_mwcZ >> 16)) & MaxUInt32; _mwcW = (18000 * (_mwcW & 0xFFFF) + (_mwcW >> 16)) & MaxUInt32; var value = (((_mwcZ << 16) + (_mwcW & 0xFFFF)) >>> 0) & MaxUInt32 | 0; if (!signed) { value >>>= 0; } return value; } function newId(maxLength) { if (maxLength === void 0) { maxLength = 22; } var base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; var number = random32() >>> 0; var chars = 0; var result = strEmpty; while (result.length < maxLength) { chars++; result += base64chars.charAt(number & 0x3F); number >>>= 6; if (chars === 5) { number = (((random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0; chars = 0; } } return result; } var _objDefineProperty = ObjDefineProperty; var version = "2.8.3"; var instanceName = "." + newId(6); var _dataUid = 0; function _createAccessor(target, prop, value) { if (_objDefineProperty) { try { _objDefineProperty(target, prop, { value: value, enumerable: false, configurable: true }); return true; } catch (e) { } } return false; } function _canAcceptData(target) { return target.nodeType === 1 || target.nodeType === 9 || !(+target.nodeType); } function _getCache(data, target) { var theCache = target[data.id]; if (!theCache) { theCache = {}; try { if (_canAcceptData(target)) { if (!_createAccessor(target, data.id, theCache)) { target[data.id] = theCache; } } } catch (e) { } } return theCache; } function createUniqueNamespace(name, includeVersion) { if (includeVersion === void 0) { includeVersion = false; } return normalizeJsName(name + (_dataUid++) + (includeVersion ? "." + version : "") + instanceName); } function createElmNodeData(name) { var data = { id: createUniqueNamespace("_aiData-" + (name || "") + "." + version), accept: function (target) { return _canAcceptData(target); }, get: function (target, name, defValue, addDefault) { var theCache = target[data.id]; if (!theCache) { if (addDefault) { theCache = _getCache(data, target); theCache[normalizeJsName(name)] = defValue; } return defValue; } return theCache[normalizeJsName(name)]; }, kill: function (target, name) { if (target && target[name]) { try { delete target[name]; } catch (e) { } } } }; return data; } var pluginStateData = createElmNodeData("plugin"); function _getPluginState(plugin) { return pluginStateData.get(plugin, "state", {}, true); } function initializePlugins(processContext, extensions) { var initPlugins = []; var lastPlugin = null; var proxy = processContext.getNext(); var pluginState; while (proxy) { var thePlugin = proxy.getPlugin(); if (thePlugin) { if (lastPlugin && isFunction(lastPlugin[strSetNextPlugin]) && isFunction(thePlugin[strProcessTelemetry])) { lastPlugin[strSetNextPlugin](thePlugin); } var isInitialized = false; if (isFunction(thePlugin[strIsInitialized])) { isInitialized = thePlugin[strIsInitialized](); } else { pluginState = _getPluginState(thePlugin); isInitialized = pluginState[strIsInitialized]; } if (!isInitialized) { initPlugins.push(thePlugin); } lastPlugin = thePlugin; proxy = proxy.getNext(); } } arrForEach(initPlugins, function (thePlugin) { var core = processContext.core(); thePlugin.initialize(processContext.getCfg(), core, extensions, processContext.getNext()); pluginState = _getPluginState(thePlugin); if (!thePlugin[strCore] && !pluginState[strCore]) { pluginState[strCore] = core; } pluginState[strIsInitialized] = true; delete pluginState[strTeardown]; }); } function sortPlugins(plugins) { return plugins.sort(function (extA, extB) { var result = 0; var bHasProcess = isFunction(extB[strProcessTelemetry]); if (isFunction(extA[strProcessTelemetry])) { result = bHasProcess ? extA[strPriority] - extB[strPriority] : 1; } else if (bHasProcess) { result = -1; } return result; }); } var strTelemetryPluginChain = "TelemetryPluginChain"; var strHasRunFlags = "_hasRun"; var strGetTelCtx = "_getTelCtx"; var _chainId = 0; function _getNextProxyStart(proxy, core, startAt) { while (proxy) { if (proxy.getPlugin() === startAt) { return proxy; } proxy = proxy.getNext(); } return createTelemetryProxyChain([startAt], core.config || {}, core); } function _createInternalContext(telemetryChain, config, core, startAt) { var _nextProxy = null; var _onComplete = []; if (startAt !== null) { _nextProxy = startAt ? _getNextProxyStart(telemetryChain, core, startAt) : telemetryChain; } var context = { _next: _moveNext, ctx: { core: function () { return core; }, diagLog: function () { return safeGetLogger(core, config); }, getCfg: function () { return config; }, getExtCfg: _getExtCfg, getConfig: _getConfig, hasNext: function () { return !!_nextProxy; }, getNext: function () { return _nextProxy; }, setNext: function (nextPlugin) { _nextProxy = nextPlugin; }, iterate: _iterateChain, onComplete: _addOnComplete } }; function _addOnComplete(onComplete, that) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } if (onComplete) { _onComplete.push({ func: onComplete, self: !isUndefined(that) ? that : context.ctx, args: args }); } } function _moveNext() { var nextProxy = _nextProxy; _nextProxy = nextProxy ? nextProxy.getNext() : null; if (!nextProxy) { var onComplete = _onComplete; if (onComplete && onComplete.length > 0) { arrForEach(onComplete, function (completeDetails) { try { completeDetails.func.call(completeDetails.self, completeDetails.args); } catch (e) { _throwInternal(core.logger, 2 , 73 , "Unexpected Exception during onComplete - " + dumpObj(e)); } }); _onComplete = []; } } return nextProxy; } function _getExtCfg(identifier, defaultValue, mergeDefault) { if (defaultValue === void 0) { defaultValue = {}; } if (mergeDefault === void 0) { mergeDefault = 0 ; } var theConfig; if (config) { var extConfig = config.extensionConfig; if (extConfig && identifier) { theConfig = extConfig[identifier]; } } if (!theConfig) { theConfig = defaultValue; } else if (isObject(defaultValue)) { if (mergeDefault !== 0 ) { var newConfig_1 = objExtend(true, defaultValue, theConfig); if (config && mergeDefault === 2 ) { objForEachKey(defaultValue, function (field) { if (isNullOrUndefined(newConfig_1[field])) { var cfgValue = config[field]; if (!isNullOrUndefined(cfgValue)) { newConfig_1[field] = cfgValue; } } }); } theConfig = newConfig_1; } } return theConfig; } function _getConfig(identifier, field, defaultValue) { if (defaultValue === void 0) { defaultValue = false; } var theValue; var extConfig = _getExtCfg(identifier, null); if (extConfig && !isNullOrUndefined(extConfig[field])) { theValue = extConfig[field]; } else if (config && !isNullOrUndefined(config[field])) { theValue = config[field]; } return !isNullOrUndefined(theValue) ? theValue : defaultValue; } function _iterateChain(cb) { var nextPlugin; while (!!(nextPlugin = context._next())) { var plugin = nextPlugin.getPlugin(); if (plugin) { cb(plugin); } } } return context; } function createProcessTelemetryContext(telemetryChain, config, core, startAt) { var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(env) { var nextPlugin = internalContext._next(); nextPlugin && nextPlugin.processTelemetry(env, context); return !nextPlugin; } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryContext(plugins || context.getNext(), config, core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } function createProcessTelemetryUnloadContext(telemetryChain, core, startAt) { var config = core.config || {}; var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(unloadState) { var nextPlugin = internalContext._next(); nextPlugin && nextPlugin.unload(context, unloadState); return !nextPlugin; } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryUnloadContext(plugins || context.getNext(), core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } function createProcessTelemetryUpdateContext(telemetryChain, core, startAt) { var config = core.config || {}; var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(updateState) { return context.iterate(function (plugin) { if (isFunction(plugin.update)) { plugin.update(context, updateState); } }); } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryUpdateContext(plugins || context.getNext(), core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } function createTelemetryProxyChain(plugins, config, core, startAt) { var firstProxy = null; var add = startAt ? false : true; if (isArray(plugins) && plugins.length > 0) { var lastProxy_1 = null; arrForEach(plugins, function (thePlugin) { if (!add && startAt === thePlugin) { add = true; } if (add && thePlugin && isFunction(thePlugin.processTelemetry)) { var newProxy = createTelemetryPluginProxy(thePlugin, config, core); if (!firstProxy) { firstProxy = newProxy; } if (lastProxy_1) { lastProxy_1._setNext(newProxy); } lastProxy_1 = newProxy; } }); } if (startAt && !firstProxy) { return createTelemetryProxyChain([startAt], config, core); } return firstProxy; } function createTelemetryPluginProxy(plugin, config, core) { var nextProxy = null; var hasProcessTelemetry = isFunction(plugin.processTelemetry); var hasSetNext = isFunction(plugin.setNextPlugin); var chainId; if (plugin) { chainId = plugin.identifier + "-" + plugin.priority + "-" + _chainId++; } else { chainId = "Unknown-0-" + _chainId++; } var proxyChain = { getPlugin: function () { return plugin; }, getNext: function () { return nextProxy; }, processTelemetry: _processTelemetry, unload: _unloadPlugin, update: _updatePlugin, _id: chainId, _setNext: function (nextPlugin) { nextProxy = nextPlugin; } }; function _getTelCtx() { var itemCtx; if (plugin && isFunction(plugin[strGetTelCtx])) { itemCtx = plugin[strGetTelCtx](); } if (!itemCtx) { itemCtx = createProcessTelemetryContext(proxyChain, config, core); } return itemCtx; } function _processChain(itemCtx, processPluginFn, name, details, isAsync) { var hasRun = false; var identifier = plugin ? plugin.identifier : strTelemetryPluginChain; var hasRunContext = itemCtx[strHasRunFlags]; if (!hasRunContext) { hasRunContext = itemCtx[strHasRunFlags] = {}; } itemCtx.setNext(nextProxy); if (plugin) { doPerf(itemCtx[strCore](), function () { return identifier + ":" + name; }, function () { hasRunContext[chainId] = true; try { var nextId = nextProxy ? nextProxy._id : strEmpty; if (nextId) { hasRunContext[nextId] = false; } hasRun = processPluginFn(itemCtx); } catch (error) { var hasNextRun = nextProxy ? hasRunContext[nextProxy._id] : true; if (hasNextRun) { hasRun = true; } if (!nextProxy || !hasNextRun) { _throwInternal(itemCtx.diagLog(), 1 , 73 , "Plugin [" + identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext)); } } }, details, isAsync); } return hasRun; } function _processTelemetry(env, itemCtx) { itemCtx = itemCtx || _getTelCtx(); function _callProcessTelemetry(itemCtx) { if (!plugin || !hasProcessTelemetry) { return false; } var pluginState = _getPluginState(plugin); if (pluginState.teardown || pluginState[strDisabled]) { return false; } if (hasSetNext) { plugin.setNextPlugin(nextProxy); } plugin.processTelemetry(env, itemCtx); return true; } if (!_processChain(itemCtx, _callProcessTelemetry, "processTelemetry", function () { return ({ item: env }); }, !(env.sync))) { itemCtx.processNext(env); } } function _unloadPlugin(unloadCtx, unloadState) { function _callTeardown() { var hasRun = false; if (plugin) { var pluginState = _getPluginState(plugin); var pluginCore = plugin[strCore] || pluginState.core; if (plugin && (!pluginCore || pluginCore === unloadCtx[strCore]()) && !pluginState[strTeardown]) { pluginState[strCore] = null; pluginState[strTeardown] = true; pluginState[strIsInitialized] = false; if (plugin[strTeardown] && plugin[strTeardown](unloadCtx, unloadState) === true) { hasRun = true; } } } return hasRun; } if (!_processChain(unloadCtx, _callTeardown, "unload", function () { }, unloadState.isAsync)) { unloadCtx.processNext(unloadState); } } function _updatePlugin(updateCtx, updateState) { function _callUpdate() { var hasRun = false; if (plugin) { var pluginState = _getPluginState(plugin); var pluginCore = plugin[strCore] || pluginState.core; if (plugin && (!pluginCore || pluginCore === updateCtx[strCore]()) && !pluginState[strTeardown]) { if (plugin[strUpdate] && plugin[strUpdate](updateCtx, updateState) === true) { hasRun = true; } } } return hasRun; } if (!_processChain(updateCtx, _callUpdate, "update", function () { }, false)) { updateCtx.processNext(updateState); } } return objFreeze(proxyChain); } var ProcessTelemetryContext = /** @class */ (function () { function ProcessTelemetryContext(pluginChain, config, core, startAt) { var _self = this; var context = createProcessTelemetryContext(pluginChain, config, core, startAt); proxyFunctions(_self, context, objKeys(context)); } return ProcessTelemetryContext; }()); var strToGMTString = "toGMTString"; var strToUTCString = "toUTCString"; var strCookie = "cookie"; var strExpires = "expires"; var strEnabled = "enabled"; var strIsCookieUseDisabled = "isCookieUseDisabled"; var strDisableCookiesUsage = "disableCookiesUsage"; var strConfigCookieMgr = "_ckMgr"; var _supportsCookies = null; var _allowUaSameSite = null; var _parsedCookieValue = null; var _doc = getDocument(); var _cookieCache = {}; var _globalCookieConfig = {}; function _gblCookieMgr(config, logger) { var inst = createCookieMgr[strConfigCookieMgr] || _globalCookieConfig[strConfigCookieMgr]; if (!inst) { inst = createCookieMgr[strConfigCookieMgr] = createCookieMgr(config, logger); _globalCookieConfig[strConfigCookieMgr] = inst; } return inst; } function _isMgrEnabled(cookieMgr) { if (cookieMgr) { return cookieMgr.isEnabled(); } return true; } function _createCookieMgrConfig(rootConfig) { var cookieMgrCfg = rootConfig.cookieCfg = rootConfig.cookieCfg || {}; setValue(cookieMgrCfg, "domain", rootConfig.cookieDomain, isNotNullOrUndefined, isNullOrUndefined); setValue(cookieMgrCfg, "path", rootConfig.cookiePath || "/", null, isNullOrUndefined); if (isNullOrUndefined(cookieMgrCfg[strEnabled])) { var cookieEnabled = void 0; if (!isUndefined(rootConfig[strIsCookieUseDisabled])) { cookieEnabled = !rootConfig[strIsCookieUseDisabled]; } if (!isUndefined(rootConfig[strDisableCookiesUsage])) { cookieEnabled = !rootConfig[strDisableCookiesUsage]; } cookieMgrCfg[strEnabled] = cookieEnabled; } return cookieMgrCfg; } function safeGetCookieMgr(core, config) { var cookieMgr; if (core) { cookieMgr = core.getCookieMgr(); } else if (config) { var cookieCfg = config.cookieCfg; if (cookieCfg[strConfigCookieMgr]) { cookieMgr = cookieCfg[strConfigCookieMgr]; } else { cookieMgr = createCookieMgr(config); } } if (!cookieMgr) { cookieMgr = _gblCookieMgr(config, (core || {}).logger); } return cookieMgr; } function createCookieMgr(rootConfig, logger) { var cookieMgrConfig = _createCookieMgrConfig(rootConfig || _globalCookieConfig); var _path = cookieMgrConfig.path || "/"; var _domain = cookieMgrConfig.domain; var _enabled = cookieMgrConfig[strEnabled] !== false; var cookieMgr = { isEnabled: function () { var enabled = _enabled && areCookiesSupported(logger); var gblManager = _globalCookieConfig[strConfigCookieMgr]; if (enabled && gblManager && cookieMgr !== gblManager) { enabled = _isMgrEnabled(gblManager); } return enabled; }, setEnabled: function (value) { _enabled = value !== false; }, set: function (name, value, maxAgeSec, domain, path) { var result = false; if (_isMgrEnabled(cookieMgr)) { var values = {}; var theValue = strTrim(value || strEmpty); var idx = theValue.indexOf(";"); if (idx !== -1) { theValue = strTrim(value.substring(0, idx)); values = _extractParts(value.substring(idx + 1)); } setValue(values, "domain", domain || _domain, isTruthy, isUndefined); if (!isNullOrUndefined(maxAgeSec)) { var _isIE = isIE(); if (isUndefined(values[strExpires])) { var nowMs = dateNow(); var expireMs = nowMs + (maxAgeSec * 1000); if (expireMs > 0) { var expiry = new Date(); expiry.setTime(expireMs); setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || strEmpty, isTruthy); } } if (!_isIE) { setValue(values, "max-age", strEmpty + maxAgeSec, null, isUndefined); } } var location_1 = getLocation(); if (location_1 && location_1.protocol === "https:") { setValue(values, "secure", null, null, isUndefined); if (_allowUaSameSite === null) { _allowUaSameSite = !uaDisallowsSameSiteNone((getNavigator() || {}).userAgent); } if (_allowUaSameSite) { setValue(values, "SameSite", "None", null, isUndefined); } } setValue(values, "path", path || _path, null, isUndefined); var setCookieFn = cookieMgrConfig.setCookie || _setCookieValue; setCookieFn(name, _formatCookieValue(theValue, values)); result = true; } return result; }, get: function (name) { var value = strEmpty; if (_isMgrEnabled(cookieMgr)) { value = (cookieMgrConfig.getCookie || _getCookieValue)(name); } return value; }, del: function (name, path) { var result = false; if (_isMgrEnabled(cookieMgr)) { result = cookieMgr.purge(name, path); } return result; }, purge: function (name, path) { var _a; var result = false; if (areCookiesSupported(logger)) { var values = (_a = {}, _a["path"] = path ? path : "/", _a[strExpires] = "Thu, 01 Jan 1970 00:00:01 GMT", _a); if (!isIE()) { values["max-age"] = "0"; } var delCookie = cookieMgrConfig.delCookie || _setCookieValue; delCookie(name, _formatCookieValue(strEmpty, values)); result = true; } return result; } }; cookieMgr[strConfigCookieMgr] = cookieMgr; return cookieMgr; } function areCookiesSupported(logger) { if (_supportsCookies === null) { _supportsCookies = false; try { var doc = _doc || {}; _supportsCookies = doc[strCookie] !== undefined; } catch (e) { _throwInternal(logger, 2 , 68 , "Cannot access document.cookie - " + getExceptionName(e), { exception: dumpObj(e) }); } } return _supportsCookies; } function _extractParts(theValue) { var values = {}; if (theValue && theValue.length) { var parts = strTrim(theValue).split(";"); arrForEach(parts, function (thePart) { thePart = strTrim(thePart || strEmpty); if (thePart) { var idx = thePart.indexOf("="); if (idx === -1) { values[thePart] = null; } else { values[strTrim(thePart.substring(0, idx))] = strTrim(thePart.substring(idx + 1)); } } }); } return values; } function _formatDate(theDate, func) { if (isFunction(theDate[func])) { return theDate[func](); } return null; } function _formatCookieValue(value, values) { var cookieValue = value || strEmpty; objForEachKey(values, function (name, theValue) { cookieValue += "; " + name + (!isNullOrUndefined(theValue) ? "=" + theValue : strEmpty); }); return cookieValue; } function _getCookieValue(name) { var cookieValue = strEmpty; if (_doc) { var theCookie = _doc[strCookie] || strEmpty; if (_parsedCookieValue !== theCookie) { _cookieCache = _extractParts(theCookie); _parsedCookieValue = theCookie; } cookieValue = strTrim(_cookieCache[name] || strEmpty); } return cookieValue; } function _setCookieValue(name, cookieValue) { if (_doc) { _doc[strCookie] = name + "=" + cookieValue; } } function uaDisallowsSameSiteNone(userAgent) { if (!isString(userAgent)) { return false; } if (strContains(userAgent, "CPU iPhone OS 12") || strContains(userAgent, "iPad; CPU OS 12")) { return true; } if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strContains(userAgent, "Version/") && strContains(userAgent, "Safari")) { return true; } if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strEndsWith(userAgent, "AppleWebKit/605.1.15 (KHTML, like Gecko)")) { return true; } if (strContains(userAgent, "Chrome/5") || strContains(userAgent, "Chrome/6")) { return true; } if (strContains(userAgent, "UnrealEngine") && !strContains(userAgent, "Chrome")) { return true; } if (strContains(userAgent, "UCBrowser/12") || strContains(userAgent, "UCBrowser/11")) { return true; } return false; } var strIKey = "iKey"; var strExtensionConfig = "extensionConfig"; var ChannelControllerPriority = 500; var ChannelValidationMessage = "Channel has invalid priority - "; function _addChannelQueue(channelQueue, queue, config, core) { if (queue && isArray(queue) && queue.length > 0) { queue = queue.sort(function (a, b) { return a.priority - b.priority; }); arrForEach(queue, function (queueItem) { if (queueItem.priority < ChannelControllerPriority) { throwError(ChannelValidationMessage + queueItem.identifier); } }); channelQueue.push({ queue: objFreeze(queue), chain: createTelemetryProxyChain(queue, config, core) }); } } function createChannelControllerPlugin(channelQueue, core) { var _a; function _getTelCtx() { return createProcessTelemetryContext(null, core.config, core, null); } function _processChannelQueue(theChannels, itemCtx, processFn, onComplete) { var waiting = theChannels ? (theChannels.length + 1) : 1; function _runChainOnComplete() { waiting--; if (waiting === 0) { onComplete && onComplete(); onComplete = null; } } if (waiting > 0) { arrForEach(theChannels, function (channels) { if (channels && channels.queue.length > 0) { var channelChain = channels.chain; var chainCtx = itemCtx.createNew(channelChain); chainCtx.onComplete(_runChainOnComplete); processFn(chainCtx); } else { waiting--; } }); } _runChainOnComplete(); } function _doUpdate(updateCtx, updateState) { var theUpdateState = updateState || { reason: 0 }; _processChannelQueue(channelQueue, updateCtx, function (chainCtx) { chainCtx[strProcessNext](theUpdateState); }, function () { updateCtx[strProcessNext](theUpdateState); }); return true; } function _doTeardown(unloadCtx, unloadState) { var theUnloadState = unloadState || { reason: 0 , isAsync: false }; _processChannelQueue(channelQueue, unloadCtx, function (chainCtx) { chainCtx[strProcessNext](theUnloadState); }, function () { unloadCtx[strProcessNext](theUnloadState); isInitialized = false; }); return true; } function _getChannel(pluginIdentifier) { var thePlugin = null; if (channelQueue && channelQueue.length > 0) { arrForEach(channelQueue, function (channels) { if (channels && channels.queue.length > 0) { arrForEach(channels.queue, function (ext) { if (ext.identifier === pluginIdentifier) { thePlugin = ext; return -1; } }); if (thePlugin) { return -1; } } }); } return thePlugin; } var isInitialized = false; var channelController = (_a = { identifier: "ChannelControllerPlugin", priority: ChannelControllerPriority, initialize: function (config, core, extensions, pluginChain) { isInitialized = true; arrForEach(channelQueue, function (channels) { if (channels && channels.queue.length > 0) { initializePlugins(createProcessTelemetryContext(channels.chain, config, core), extensions); } }); }, isInitialized: function () { return isInitialized; }, processTelemetry: function (item, itemCtx) { _processChannelQueue(channelQueue, itemCtx || _getTelCtx(), function (chainCtx) { chainCtx[strProcessNext](item); }, function () { itemCtx[strProcessNext](item); }); }, update: _doUpdate }, _a[strPause] = function () { _processChannelQueue(channelQueue, _getTelCtx(), function (chainCtx) { chainCtx.iterate(function (plugin) { plugin[strPause] && plugin[strPause](); }); }, null); }, _a[strResume] = function () { _processChannelQueue(channelQueue, _getTelCtx(), function (chainCtx) { chainCtx.iterate(function (plugin) { plugin[strResume] && plugin[strResume](); }); }, null); }, _a[strTeardown] = _doTeardown, _a.getChannel = _getChannel, _a.flush = function (isAsync, callBack, sendReason, cbTimeout) { var waiting = 1; var doneIterating = false; var cbTimer = null; cbTimeout = cbTimeout || 5000; function doCallback() { waiting--; if (doneIterating && waiting === 0) { if (cbTimer) { clearTimeout(cbTimer); cbTimer = null; } callBack && callBack(doneIterating); callBack = null; } } _processChannelQueue(channelQueue, _getTelCtx(), function (chainCtx) { chainCtx.iterate(function (plugin) { if (plugin.flush) { waiting++; var handled_1 = false; if (!plugin.flush(isAsync, function () { handled_1 = true; doCallback(); }, sendReason)) { if (!handled_1) { if (isAsync && cbTimer == null) { cbTimer = setTimeout(function () { cbTimer = null; doCallback(); }, cbTimeout); } else { doCallback(); } } } } }); }, function () { doneIterating = true; doCallback(); }); return true; }, _a._setQueue = function (queue) { channelQueue = queue; }, _a); return channelController; } function createChannelQueues(channels, extensions, config, core) { var channelQueue = []; if (channels) { arrForEach(channels, function (queue) { return _addChannelQueue(channelQueue, queue, config, core); }); } if (extensions) { var extensionQueue_1 = []; arrForEach(extensions, function (plugin) { if (plugin.priority > ChannelControllerPriority) { extensionQueue_1.push(plugin); } }); _addChannelQueue(channelQueue, extensionQueue_1, config, core); } return channelQueue; } function createUnloadHandlerContainer() { var handlers = []; function _addHandler(handler) { if (handler) { handlers.push(handler); } } function _runHandlers(unloadCtx, unloadState) { arrForEach(handlers, function (handler) { try { handler(unloadCtx, unloadState); } catch (e) { _throwInternal(unloadCtx.diagLog(), 2 , 73 , "Unexpected error calling unload handler - " + dumpObj(e)); } }); handlers = []; } return { add: _addHandler, run: _runHandlers }; } var strGetPlugin = "getPlugin"; var BaseTelemetryPlugin = /** @class */ (function () { function BaseTelemetryPlugin() { var _self = this; var _isinitialized; var _rootCtx; var _nextPlugin; var _unloadHandlerContainer; var _hooks; _initDefaults(); dynamicProto(BaseTelemetryPlugin, _self, function (_self) { _self.initialize = function (config, core, extensions, pluginChain) { _setDefaults(config, core, pluginChain); _isinitialized = true; }; _self.teardown = function (unloadCtx, unloadState) { var core = _self.core; if (!core || (unloadCtx && core !== unloadCtx.core())) { return; } var result; var unloadDone = false; var theUnloadCtx = unloadCtx || createProcessTelemetryUnloadContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin); var theUnloadState = unloadState || { reason: 0 , isAsync: false }; function _unloadCallback() { if (!unloadDone) { unloadDone = true; _unloadHandlerContainer.run(theUnloadCtx, unloadState); arrForEach(_hooks, function (fn) { fn.rm(); }); _hooks = []; if (result === true) { theUnloadCtx.processNext(theUnloadState); } _initDefaults(); } } if (!_self[strDoTeardown] || _self[strDoTeardown](theUnloadCtx, theUnloadState, _unloadCallback) !== true) { _unloadCallback(); } else { result = true; } return result; }; _self.update = function (updateCtx, updateState) { var core = _self.core; if (!core || (updateCtx && core !== updateCtx.core())) { return; } var result; var updateDone = false; var theUpdateCtx = updateCtx || createProcessTelemetryUpdateContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin); var theUpdateState = updateState || { reason: 0 }; function _updateCallback() { if (!updateDone) { updateDone = true; _setDefaults(theUpdateCtx.getCfg(), theUpdateCtx.core(), theUpdateCtx.getNext()); } } if (!_self._doUpdate || _self._doUpdate(theUpdateCtx, theUpdateState, _updateCallback) !== true) { _updateCallback(); } else { result = true; } return result; }; _self._addHook = function (hooks) { if (hooks) { if (isArray(hooks)) { _hooks = _hooks.concat(hooks); } else { _hooks.push(hooks); } } }; proxyFunctionAs(_self, "_addUnloadCb", function () { return _unloadHandlerContainer; }, "add"); }); _self.diagLog = function (itemCtx) { return _getTelCtx(itemCtx).diagLog(); }; _self[strIsInitialized] = function () { return _isinitialized; }; _self.setInitialized = function (isInitialized) { _isinitialized = isInitialized; }; _self[strSetNextPlugin] = function (next) { _nextPlugin = next; }; _self.processNext = function (env, itemCtx) { if (itemCtx) { itemCtx.processNext(env); } else if (_nextPlugin && isFunction(_nextPlugin.processTelemetry)) { _nextPlugin.processTelemetry(env, null); } }; _self._getTelCtx = _getTelCtx; function _getTelCtx(currentCtx) { if (currentCtx === void 0) { currentCtx = null; } var itemCtx = currentCtx; if (!itemCtx) { var rootCtx = _rootCtx || createProcessTelemetryContext(null, {}, _self.core); if (_nextPlugin && _nextPlugin[strGetPlugin]) { itemCtx = rootCtx.createNew(null, _nextPlugin[strGetPlugin]); } else { itemCtx = rootCtx.createNew(null, _nextPlugin); } } return itemCtx; } function _setDefaults(config, core, pluginChain) { if (config) { setValue(config, strExtensionConfig, [], null, isNullOrUndefined); } if (!pluginChain && core) { pluginChain = core.getProcessTelContext().getNext(); } var nextPlugin = _nextPlugin; if (_nextPlugin && _nextPlugin[strGetPlugin]) { nextPlugin = _nextPlugin[strGetPlugin](); } _self.core = core; _rootCtx = createProcessTelemetryContext(pluginChain, config, core, nextPlugin); } function _initDefaults() { _isinitialized = false; _self.core = null; _rootCtx = null; _nextPlugin = null; _hooks = []; _unloadHandlerContainer = createUnloadHandlerContainer(); } } return BaseTelemetryPlugin; }()); var TelemetryInitializerPlugin = /** @class */ (function (_super) { __extendsFn(TelemetryInitializerPlugin, _super); function TelemetryInitializerPlugin() { var _this = _super.call(this) || this; _this.identifier = "TelemetryInitializerPlugin"; _this.priority = 199; var _id; var _initializers; _initDefaults(); dynamicProto(TelemetryInitializerPlugin, _this, function (_self, _base) { _self.addTelemetryInitializer = function (telemetryInitializer) { var theInitializer = { id: _id++, fn: telemetryInitializer }; _initializers.push(theInitializer); var handler = { remove: function () { arrForEach(_initializers, function (initializer, idx) { if (initializer.id === theInitializer.id) { _initializers.splice(idx, 1); return -1; } }); } }; return handler; }; _self.processTelemetry = function (item, itemCtx) { var doNotSendItem = false; var telemetryInitializersCount = _initializers.length; for (var i = 0; i < telemetryInitializersCount; ++i) { var telemetryInitializer = _initializers[i]; if (telemetryInitializer) { try { if (telemetryInitializer.fn.apply(null, [item]) === false) { doNotSendItem = true; break; } } catch (e) { _throwInternal(itemCtx.diagLog(), 1 , 64 , "One of telemetry initializers failed, telemetry item will not be sent: " + getExceptionName(e), { exception: dumpObj(e) }, true); } } } if (!doNotSendItem) { _self.processNext(item, itemCtx); } }; _self[strDoTeardown] = function () { _initDefaults(); }; }); function _initDefaults() { _id = 0; _initializers = []; } return _this; } return TelemetryInitializerPlugin; }(BaseTelemetryPlugin)); var strValidationError = "Plugins must provide initialize method"; var strNotificationManager = "_notificationManager"; var strSdkUnloadingError = "SDK is still unloading..."; var strSdkNotInitialized = "SDK is not initialized"; var defaultInitConfig = { loggingLevelConsole: 1 }; function _createPerfManager(core, notificationMgr) { return new PerfManager(notificationMgr); } function _validateExtensions(logger, channelPriority, allExtensions) { var coreExtensions = []; var extPriorities = {}; arrForEach(allExtensions, function (ext) { if (isNullOrUndefined(ext) || isNullOrUndefined(ext.initialize)) { throwError(strValidationError); } var extPriority = ext.priority; var identifier = ext.identifier; if (ext && extPriority) { if (!isNullOrUndefined(extPriorities[extPriority])) { _warnToConsole(logger, "Two extensions have same priority #" + extPriority + " - " + extPriorities[extPriority] + ", " + identifier); } else { extPriorities[extPriority] = identifier; } } if (!extPriority || extPriority < channelPriority) { coreExtensions.push(ext); } }); return { all: allExtensions, core: coreExtensions }; } function _isPluginPresent(thePlugin, plugins) { var exists = false; arrForEach(plugins, function (plugin) { if (plugin === thePlugin) { exists = true; return -1; } }); return exists; } function _createDummyNotificationManager() { var _a; return objCreateFn((_a = {}, _a[strAddNotificationListener] = function (listener) { }, _a[strRemoveNotificationListener] = function (listener) { }, _a[strEventsSent] = function (events) { }, _a[strEventsDiscarded] = function (events, reason) { }, _a[strEventsSendRequest] = function (sendReason, isAsync) { }, _a)); } var BaseCore$2 = /** @class */ (function () { function BaseCore() { var _isInitialized; var _eventQueue; var _notificationManager; var _perfManager; var _cfgPerfManager; var _cookieManager; var _pluginChain; var _configExtensions; var _coreExtensions; var _channelControl; var _channelConfig; var _channelQueue; var _isUnloading; var _telemetryInitializerPlugin; var _internalLogsEventName; var _evtNamespace; var _unloadHandlers; var _debugListener; var _internalLogPoller = 0; dynamicProto(BaseCore, this, function (_self) { _initDefaults(); _self.isInitialized = function () { return _isInitialized; }; _self.initialize = function (config, extensions, logger, notificationManager) { if (_isUnloading) { throwError(strSdkUnloadingError); } if (_self.isInitialized()) { throwError("Core should not be initialized more than once"); } if (!config || isNullOrUndefined(config.instrumentationKey)) { throwError("Please provide instrumentation key"); } _notificationManager = notificationManager; _self[strNotificationManager] = notificationManager; _self.config = config || {}; _initDebugListener(config); _initPerfManager(config); config.extensions = isNullOrUndefined(config.extensions) ? [] : config.extensions; _initExtConfig(config); if (logger) { _self.logger = logger; } _configExtensions = []; _configExtensions.push.apply(_configExtensions, __spreadArrayFn(__spreadArrayFn([], extensions, false), config.extensions)); _channelConfig = (config || {}).channels; _initPluginChain(config, null); if (!_channelQueue || _channelQueue.length === 0) { throwError("No channels available"); } _isInitialized = true; _self.releaseQueue(); }; _self.getTransmissionControls = function () { var controls = []; if (_channelQueue) { arrForEach(_channelQueue, function (channels) { controls.push(channels.queue); }); } return objFreeze(controls); }; _self.track = function (telemetryItem) { setValue(telemetryItem, strIKey, _self.config.instrumentationKey, null, isNotTruthy); setValue(telemetryItem, "time", toISOString(new Date()), null, isNotTruthy); setValue(telemetryItem, "ver", "4.0", null, isNullOrUndefined); if (!_isUnloading && _self.isInitialized()) { _createTelCtx().processNext(telemetryItem); } else { _eventQueue.push(telemetryItem); } }; _self.getProcessTelContext = _createTelCtx; _self.getNotifyMgr = function () { if (!_notificationManager) { _notificationManager = _createDummyNotificationManager(); _self[strNotificationManager] = _notificationManager; } return _notificationManager; }; _self[strAddNotificationListener] = function (listener) { if (_notificationManager) { _notificationManager[strAddNotificationListener](listener); } }; _self[strRemoveNotificationListener] = function (listener) { if (_notificationManager) { _notificationManager[strRemoveNotificationListener](listener); } }; _self.getCookieMgr = function () { if (!_cookieManager) { _cookieManager = createCookieMgr(_self.config, _self.logger); } return _cookieManager; }; _self.setCookieMgr = function (cookieMgr) { _cookieManager = cookieMgr; }; _self.getPerfMgr = function () { if (!_perfManager && !_cfgPerfManager) { if (_self.config && _self.config.enablePerfMgr && isFunction(_self.config.createPerfMgr)) { _cfgPerfManager = _self.config.createPerfMgr(_self, _self.getNotifyMgr()); } } return _perfManager || _cfgPerfManager || getGblPerfMgr(); }; _self.setPerfMgr = function (perfMgr) { _perfManager = perfMgr; }; _self.eventCnt = function () { return _eventQueue.length; }; _self.releaseQueue = function () { if (_isInitialized && _eventQueue.length > 0) { var eventQueue = _eventQueue; _eventQueue = []; arrForEach(eventQueue, function (event) { _createTelCtx().processNext(event); }); } }; _self.pollInternalLogs = function (eventName) { _internalLogsEventName = eventName || null; var interval = _self.config.diagnosticLogInterval; if (!interval || !(interval > 0)) { interval = 10000; } if (_internalLogPoller) { clearInterval(_internalLogPoller); } _internalLogPoller = setInterval(function () { _flushInternalLogs(); }, interval); return _internalLogPoller; }; _self.stopPollingInternalLogs = function () { if (_internalLogPoller) { clearInterval(_internalLogPoller); _internalLogPoller = 0; _flushInternalLogs(); } }; proxyFunctions(_self, function () { return _telemetryInitializerPlugin; }, ["addTelemetryInitializer"]); _self.unload = function (isAsync, unloadComplete, cbTimeout) { if (isAsync === void 0) { isAsync = true; } if (!_isInitialized) { throwError(strSdkNotInitialized); } if (_isUnloading) { throwError(strSdkUnloadingError); } var unloadState = { reason: 50 , isAsync: isAsync, flushComplete: false }; var processUnloadCtx = createProcessTelemetryUnloadContext(_getPluginChain(), _self); processUnloadCtx.onComplete(function () { _initDefaults(); unloadComplete && unloadComplete(unloadState); }, _self); function _doUnload(flushComplete) { unloadState.flushComplete = flushComplete; _isUnloading = true; _unloadHandlers.run(processUnloadCtx, unloadState); _self.stopPollingInternalLogs(); processUnloadCtx.processNext(unloadState); } if (!_flushChannels(isAsync, _doUnload, 6 , cbTimeout)) { _doUnload(false); } }; _self.getPlugin = _getPlugin; _self.addPlugin = function (plugin, replaceExisting, isAsync, addCb) { if (!plugin) { addCb && addCb(false); _logOrThrowError(strValidationError); return; } var existingPlugin = _getPlugin(plugin.identifier); if (existingPlugin && !replaceExisting) { addCb && addCb(false); _logOrThrowError("Plugin [" + plugin.identifier + "] is already loaded!"); return; } var updateState = { reason: 16 }; function _addPlugin(removed) { _configExtensions.push(plugin); updateState.added = [plugin]; _initPluginChain(_self.config, updateState); addCb && addCb(true); } if (existingPlugin) { var removedPlugins_1 = [existingPlugin.plugin]; var unloadState = { reason: 2 , isAsync: !!isAsync }; _removePlugins(removedPlugins_1, unloadState, function (removed) { if (!removed) { addCb && addCb(false); } else { updateState.removed = removedPlugins_1; updateState.reason |= 32 ; _addPlugin(); } }); } else { _addPlugin(); } }; _self.evtNamespace = function () { return _evtNamespace; }; _self.flush = _flushChannels; proxyFunctionAs(_self, "addUnloadCb", function () { return _unloadHandlers; }, "add"); function _initDefaults() { _isInitialized = false; _self.config = objExtend(true, {}, defaultInitConfig); _self.logger = new DiagnosticLogger(_self.config); _self._extensions = []; _telemetryInitializerPlugin = new TelemetryInitializerPlugin(); _eventQueue = []; _notificationManager = null; _perfManager = null; _cfgPerfManager = null; _cookieManager = null; _pluginChain = null; _coreExtensions = null; _configExtensions = []; _channelControl = null; _channelConfig = null; _channelQueue = null; _isUnloading = false; _internalLogsEventName = null; _evtNamespace = createUniqueNamespace("AIBaseCore", true); _unloadHandlers = createUnloadHandlerContainer(); } function _createTelCtx() { return createProcessTelemetryContext(_getPluginChain(), _self.config, _self); } function _initPluginChain(config, updateState) { var theExtensions = _validateExtensions(_self.logger, ChannelControllerPriority, _configExtensions); _coreExtensions = theExtensions.core; _pluginChain = null; var allExtensions = theExtensions.all; _channelQueue = objFreeze(createChannelQueues(_channelConfig, allExtensions, config, _self)); if (_channelControl) { var idx = arrIndexOf(allExtensions, _channelControl); if (idx !== -1) { allExtensions.splice(idx, 1); } idx = arrIndexOf(_coreExtensions, _channelControl); if (idx !== -1) { _coreExtensions.splice(idx, 1); } _channelControl._setQueue(_channelQueue); } else { _channelControl = createChannelControllerPlugin(_channelQueue, _self); } allExtensions.push(_channelControl); _coreExtensions.push(_channelControl); _self._extensions = sortPlugins(allExtensions); _channelControl.initialize(config, _self, allExtensions); initializePlugins(_createTelCtx(), allExtensions); _self._extensions = objFreeze(sortPlugins(_coreExtensions || [])).slice(); if (updateState) { _doUpdate(updateState); } } function _getPlugin(pluginIdentifier) { var theExt = null; var thePlugin = null; arrForEach(_self._extensions, function (ext) { if (ext.identifier === pluginIdentifier && ext !== _channelControl && ext !== _telemetryInitializerPlugin) { thePlugin = ext; return -1; } }); if (!thePlugin && _channelControl) { thePlugin = _channelControl.getChannel(pluginIdentifier); } if (thePlugin) { theExt = { plugin: thePlugin, setEnabled: function (enabled) { _getPluginState(thePlugin)[strDisabled] = !enabled; }, isEnabled: function () { var pluginState = _getPluginState(thePlugin); return !pluginState[strTeardown] && !pluginState[strDisabled]; }, remove: function (isAsync, removeCb) { if (isAsync === void 0) { isAsync = true; } var pluginsToRemove = [thePlugin]; var unloadState = { reason: 1 , isAsync: isAsync }; _removePlugins(pluginsToRemove, unloadState, function (removed) { if (removed) { _initPluginChain(_self.config, { reason: 32 , removed: pluginsToRemove }); } removeCb && removeCb(removed); }); } }; } return theExt; } function _getPluginChain() { if (!_pluginChain) { var extensions = (_coreExtensions || []).slice(); if (arrIndexOf(extensions, _telemetryInitializerPlugin) === -1) { extensions.push(_telemetryInitializerPlugin); } _pluginChain = createTelemetryProxyChain(sortPlugins(extensions), _self.config, _self); } return _pluginChain; } function _removePlugins(thePlugins, unloadState, removeComplete) { if (thePlugins && thePlugins.length > 0) { var unloadChain = createTelemetryProxyChain(thePlugins, _self.config, _self); var unloadCtx = createProcessTelemetryUnloadContext(unloadChain, _self); unloadCtx.onComplete(function () { var removed = false; var newConfigExtensions = []; arrForEach(_configExtensions, function (plugin, idx) { if (!_isPluginPresent(plugin, thePlugins)) { newConfigExtensions.push(plugin); } else { removed = true; } }); _configExtensions = newConfigExtensions; var newChannelConfig = []; if (_channelConfig) { arrForEach(_channelConfig, function (queue, idx) { var newQueue = []; arrForEach(queue, function (channel) { if (!_isPluginPresent(channel, thePlugins)) { newQueue.push(channel); } else { removed = true; } }); newChannelConfig.push(newQueue); }); _channelConfig = newChannelConfig; } removeComplete && removeComplete(removed); }); unloadCtx.processNext(unloadState); } else { removeComplete(false); } } function _flushInternalLogs() { var queue = _self.logger ? _self.logger.queue : []; if (queue) { arrForEach(queue, function (logMessage) { var item = { name: _internalLogsEventName ? _internalLogsEventName : "InternalMessageId: " + logMessage.messageId, iKey: _self.config.instrumentationKey, time: toISOString(new Date()), baseType: _InternalLogMessage.dataType, baseData: { message: logMessage.message } }; _self.track(item); }); queue.length = 0; } } function _flushChannels(isAsync, callBack, sendReason, cbTimeout) { if (_channelControl) { return _channelControl.flush(isAsync, callBack, sendReason || 6 , cbTimeout); } callBack && callBack(false); return true; } function _initDebugListener(config) { if (config.disableDbgExt === true && _debugListener) { _notificationManager[strRemoveNotificationListener](_debugListener); _debugListener = null; } if (_notificationManager && !_debugListener && config.disableDbgExt !== true) { _debugListener = getDebugListener(config); _notificationManager[strAddNotificationListener](_debugListener); } } function _initPerfManager(config) { if (!config.enablePerfMgr && _cfgPerfManager) { _cfgPerfManager = null; } if (config.enablePerfMgr) { setValue(_self.config, "createPerfMgr", _createPerfManager); } } function _initExtConfig(config) { var extConfig = getSetValue(config, strExtensionConfig); extConfig.NotificationManager = _notificationManager; } function _doUpdate(updateState) { var updateCtx = createProcessTelemetryUpdateContext(_getPluginChain(), _self); if (!_self._updateHook || _self._updateHook(updateCtx, updateState) !== true) { updateCtx.processNext(updateState); } } function _logOrThrowError(message) { var logger = _self.logger; if (logger) { _throwInternal(logger, 2 , 73 , message); } else { throwError(message); } } }); } return BaseCore; }()); function _runListeners(listeners, name, isAsync, callback) { arrForEach(listeners, function (listener) { if (listener && listener[name]) { if (isAsync) { setTimeout(function () { return callback(listener); }, 0); } else { try { callback(listener); } catch (e) { } } } }); } var NotificationManager = /** @class */ (function () { function NotificationManager(config) { this.listeners = []; var perfEvtsSendAll = !!(config || {}).perfEvtsSendAll; dynamicProto(NotificationManager, this, function (_self) { _self[strAddNotificationListener] = function (listener) { _self.listeners.push(listener); }; _self[strRemoveNotificationListener] = function (listener) { var index = arrIndexOf(_self.listeners, listener); while (index > -1) { _self.listeners.splice(index, 1); index = arrIndexOf(_self.listeners, listener); } }; _self[strEventsSent] = function (events) { _runListeners(_self.listeners, strEventsSent, true, function (listener) { listener[strEventsSent](events); }); }; _self[strEventsDiscarded] = function (events, reason) { _runListeners(_self.listeners, strEventsDiscarded, true, function (listener) { listener[strEventsDiscarded](events, reason); }); }; _self[strEventsSendRequest] = function (sendReason, isAsync) { _runListeners(_self.listeners, strEventsSendRequest, isAsync, function (listener) { listener[strEventsSendRequest](sendReason, isAsync); }); }; _self[strPerfEvent] = function (perfEvent) { if (perfEvent) { if (perfEvtsSendAll || !perfEvent.isChildEvt()) { _runListeners(_self.listeners, strPerfEvent, false, function (listener) { if (perfEvent.isAsync) { setTimeout(function () { return listener[strPerfEvent](perfEvent); }, 0); } else { listener[strPerfEvent](perfEvent); } }); } } }; }); } return NotificationManager; }()); var AppInsightsCore$2 = /** @class */ (function (_super) { __extendsFn(AppInsightsCore, _super); function AppInsightsCore() { var _this = _super.call(this) || this; dynamicProto(AppInsightsCore, _this, function (_self, _base) { _self.initialize = function (config, extensions, logger, notificationManager) { _base.initialize(config, extensions, logger || new DiagnosticLogger(config), notificationManager || new NotificationManager(config)); }; _self.track = function (telemetryItem) { doPerf(_self.getPerfMgr(), function () { return "AppInsightsCore:track"; }, function () { if (telemetryItem === null) { _notifyInvalidEvent(telemetryItem); throwError("Invalid telemetry item"); } _validateTelemetryItem(telemetryItem); _base.track(telemetryItem); }, function () { return ({ item: telemetryItem }); }, !(telemetryItem.sync)); }; function _validateTelemetryItem(telemetryItem) { if (isNullOrUndefined(telemetryItem.name)) { _notifyInvalidEvent(telemetryItem); throwError("telemetry name required"); } } function _notifyInvalidEvent(telemetryItem) { var manager = _self.getNotifyMgr(); if (manager) { manager.eventsDiscarded([telemetryItem], 2 ); } } }); return _this; } return AppInsightsCore; }(BaseCore$2)); var strOnPrefix = "on"; var strAttachEvent = "attachEvent"; var strAddEventHelper = "addEventListener"; var strDetachEvent = "detachEvent"; var strRemoveEventListener = "removeEventListener"; var strEvents = "events"; var strVisibilityChangeEvt = "visibilitychange"; var strPageHide = "pagehide"; var strPageShow = "pageshow"; var strUnload = "unload"; var strBeforeUnload = "beforeunload"; var strPageHideNamespace = createUniqueNamespace("aiEvtPageHide"); var strPageShowNamespace = createUniqueNamespace("aiEvtPageShow"); var rRemoveEmptyNs = /\.[\.]+/g; var rRemoveTrailingEmptyNs = /[\.]+$/; var _guid = 1; var elmNodeData = createElmNodeData("events"); var eventNamespace = /^([^.]*)(?:\.(.+)|)/; function _normalizeNamespace(name) { if (name && name.replace) { return name.replace(/^\s*\.*|\.*\s*$/g, ""); } return name; } function _getEvtNamespace(eventName, evtNamespace) { if (evtNamespace) { var theNamespace_1 = ""; if (isArray(evtNamespace)) { theNamespace_1 = ""; arrForEach(evtNamespace, function (name) { name = _normalizeNamespace(name); if (name) { if (name[0] !== ".") { name = "." + name; } theNamespace_1 += name; } }); } else { theNamespace_1 = _normalizeNamespace(evtNamespace); } if (theNamespace_1) { if (theNamespace_1[0] !== ".") { theNamespace_1 = "." + theNamespace_1; } eventName = (eventName || "") + theNamespace_1; } } var parsedEvent = (eventNamespace.exec(eventName || "") || []); return { type: parsedEvent[1], ns: ((parsedEvent[2] || "").replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, "").split(".").sort()).join(".") }; } function __getRegisteredEvents(target, eventName, evtNamespace) { var theEvents = []; var eventCache = elmNodeData.get(target, strEvents, {}, false); var evtName = _getEvtNamespace(eventName, evtNamespace); objForEachKey(eventCache, function (evtType, registeredEvents) { arrForEach(registeredEvents, function (value) { if (!evtName.type || evtName.type === value.evtName.type) { if (!evtName.ns || evtName.ns === evtName.ns) { theEvents.push({ name: value.evtName.type + (value.evtName.ns ? "." + value.evtName.ns : ""), handler: value.handler }); } } }); }); return theEvents; } function _getRegisteredEvents(target, evtName, addDefault) { if (addDefault === void 0) { addDefault = true; } var aiEvts = elmNodeData.get(target, strEvents, {}, addDefault); var registeredEvents = aiEvts[evtName]; if (!registeredEvents) { registeredEvents = aiEvts[evtName] = []; } return registeredEvents; } function _doDetach(obj, evtName, handlerRef, useCapture) { if (obj && evtName && evtName.type) { if (obj[strRemoveEventListener]) { obj[strRemoveEventListener](evtName.type, handlerRef, useCapture); } else if (obj[strDetachEvent]) { obj[strDetachEvent](strOnPrefix + evtName.type, handlerRef); } } } function _doAttach(obj, evtName, handlerRef, useCapture) { var result = false; if (obj && evtName && evtName.type && handlerRef) { if (obj[strAddEventHelper]) { obj[strAddEventHelper](evtName.type, handlerRef, useCapture); result = true; } else if (obj[strAttachEvent]) { obj[strAttachEvent](strOnPrefix + evtName.type, handlerRef); result = true; } } return result; } function _doUnregister(target, events, evtName, unRegFn) { var idx = events.length; while (idx--) { var theEvent = events[idx]; if (theEvent) { if (!evtName.ns || evtName.ns === theEvent.evtName.ns) { if (!unRegFn || unRegFn(theEvent)) { _doDetach(target, theEvent.evtName, theEvent.handler, theEvent.capture); events.splice(idx, 1); } } } } } function _unregisterEvents(target, evtName, unRegFn) { if (evtName.type) { _doUnregister(target, _getRegisteredEvents(target, evtName.type), evtName, unRegFn); } else { var eventCache = elmNodeData.get(target, strEvents, {}); objForEachKey(eventCache, function (evtType, events) { _doUnregister(target, events, evtName, unRegFn); }); if (objKeys(eventCache).length === 0) { elmNodeData.kill(target, strEvents); } } } function mergeEvtNamespace(theNamespace, namespaces) { var newNamespaces; if (namespaces) { if (isArray(namespaces)) { newNamespaces = [theNamespace].concat(namespaces); } else { newNamespaces = [theNamespace, namespaces]; } newNamespaces = (_getEvtNamespace("xx", newNamespaces).ns).split("."); } else { newNamespaces = theNamespace; } return newNamespaces; } function eventOn(target, eventName, handlerRef, evtNamespace, useCapture) { if (useCapture === void 0) { useCapture = false; } var result = false; if (target) { try { var evtName = _getEvtNamespace(eventName, evtNamespace); result = _doAttach(target, evtName, handlerRef, useCapture); if (result && elmNodeData.accept(target)) { var registeredEvent = { guid: _guid++, evtName: evtName, handler: handlerRef, capture: useCapture }; _getRegisteredEvents(target, evtName.type).push(registeredEvent); } } catch (e) { } } return result; } function eventOff(target, eventName, handlerRef, evtNamespace, useCapture) { if (useCapture === void 0) { useCapture = false; } if (target) { try { var evtName_1 = _getEvtNamespace(eventName, evtNamespace); var found_1 = false; _unregisterEvents(target, evtName_1, function (regEvent) { if ((evtName_1.ns && !handlerRef) || regEvent.handler === handlerRef) { found_1 = true; return true; } return false; }); if (!found_1) { _doDetach(target, evtName_1, handlerRef, useCapture); } } catch (e) { } } } function attachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) { if (useCapture === void 0) { useCapture = false; } return eventOn(obj, eventNameWithoutOn, handlerRef, null, useCapture); } function detachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) { if (useCapture === void 0) { useCapture = false; } eventOff(obj, eventNameWithoutOn, handlerRef, null, useCapture); } function addEventHandler(eventName, callback, evtNamespace) { var result = false; var w = getWindow(); if (w) { result = eventOn(w, eventName, callback, evtNamespace); result = eventOn(w["body"], eventName, callback, evtNamespace) || result; } var doc = getDocument(); if (doc) { result = eventOn(doc, eventName, callback, evtNamespace) || result; } return result; } function removeEventHandler(eventName, callback, evtNamespace) { var w = getWindow(); if (w) { eventOff(w, eventName, callback, evtNamespace); eventOff(w["body"], eventName, callback, evtNamespace); } var doc = getDocument(); if (doc) { eventOff(doc, eventName, callback, evtNamespace); } } function _addEventListeners(events, listener, excludeEvents, evtNamespace) { var added = false; if (listener && events && events.length > 0) { arrForEach(events, function (name) { if (name) { if (!excludeEvents || arrIndexOf(excludeEvents, name) === -1) { added = addEventHandler(name, listener, evtNamespace) || added; } } }); } return added; } function addEventListeners(events, listener, excludeEvents, evtNamespace) { var added = false; if (listener && events && isArray(events)) { added = _addEventListeners(events, listener, excludeEvents, evtNamespace); if (!added && excludeEvents && excludeEvents.length > 0) { added = _addEventListeners(events, listener, null, evtNamespace); } } return added; } function removeEventListeners(events, listener, evtNamespace) { if (events && isArray(events)) { arrForEach(events, function (name) { if (name) { removeEventHandler(name, listener, evtNamespace); } }); } } function addPageUnloadEventListener(listener, excludeEvents, evtNamespace) { return addEventListeners([strBeforeUnload, strUnload, strPageHide], listener, excludeEvents, evtNamespace); } function removePageUnloadEventListener(listener, evtNamespace) { removeEventListeners([strBeforeUnload, strUnload, strPageHide], listener, evtNamespace); } function addPageHideEventListener(listener, excludeEvents, evtNamespace) { function _handlePageVisibility(evt) { var doc = getDocument(); if (listener && doc && doc.visibilityState === "hidden") { listener(evt); } } var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace); var pageUnloadAdded = _addEventListeners([strPageHide], listener, excludeEvents, newNamespaces); if (!excludeEvents || arrIndexOf(excludeEvents, strVisibilityChangeEvt) === -1) { pageUnloadAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageUnloadAdded; } if (!pageUnloadAdded && excludeEvents) { pageUnloadAdded = addPageHideEventListener(listener, null, evtNamespace); } return pageUnloadAdded; } function removePageHideEventListener(listener, evtNamespace) { var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace); removeEventListeners([strPageHide], listener, newNamespaces); removeEventListeners([strVisibilityChangeEvt], null, newNamespaces); } function addPageShowEventListener(listener, excludeEvents, evtNamespace) { function _handlePageVisibility(evt) { var doc = getDocument(); if (listener && doc && doc.visibilityState === "visible") { listener(evt); } } var newNamespaces = mergeEvtNamespace(strPageShowNamespace, evtNamespace); var pageShowAdded = _addEventListeners([strPageShow], listener, excludeEvents, newNamespaces); pageShowAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageShowAdded; if (!pageShowAdded && excludeEvents) { pageShowAdded = addPageShowEventListener(listener, null, evtNamespace); } return pageShowAdded; } function removePageShowEventListener(listener, evtNamespace) { var newNamespaces = mergeEvtNamespace(strPageShowNamespace, evtNamespace); removeEventListeners([strPageShow], listener, newNamespaces); removeEventListeners([strVisibilityChangeEvt], null, newNamespaces); } function newGuid() { function randomHexDigit() { return randomValue(15); } return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(GuidRegex, function (c) { var r = (randomHexDigit() | 0), v = (c === "x" ? r : r & 0x3 | 0x8); return v.toString(16); }); } function perfNow() { var perf = getPerformance(); if (perf && perf.now) { return perf.now(); } return dateNow(); } function generateW3CId() { var hexValues = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]; var oct = strEmpty, tmp; for (var a = 0; a < 4; a++) { tmp = random32(); oct += hexValues[tmp & 0xF] + hexValues[tmp >> 4 & 0xF] + hexValues[tmp >> 8 & 0xF] + hexValues[tmp >> 12 & 0xF] + hexValues[tmp >> 16 & 0xF] + hexValues[tmp >> 20 & 0xF] + hexValues[tmp >> 24 & 0xF] + hexValues[tmp >> 28 & 0xF]; } var clockSequenceHi = hexValues[8 + (random32() & 0x03) | 0]; return oct.substr(0, 8) + oct.substr(9, 4) + "4" + oct.substr(13, 3) + clockSequenceHi + oct.substr(16, 3) + oct.substr(19, 12); } var GuidRegex = /[xy]/g; var EventHelper = { Attach: attachEvent, AttachEvent: attachEvent, Detach: detachEvent, DetachEvent: detachEvent }; var LoggingSeverity = createEnumStyle({ CRITICAL: 1 , WARNING: 2 }); var _InternalMessageId = createEnumStyle({ BrowserDoesNotSupportLocalStorage: 0 , BrowserCannotReadLocalStorage: 1 , BrowserCannotReadSessionStorage: 2 , BrowserCannotWriteLocalStorage: 3 , BrowserCannotWriteSessionStorage: 4 , BrowserFailedRemovalFromLocalStorage: 5 , BrowserFailedRemovalFromSessionStorage: 6 , CannotSendEmptyTelemetry: 7 , ClientPerformanceMathError: 8 , ErrorParsingAISessionCookie: 9 , ErrorPVCalc: 10 , ExceptionWhileLoggingError: 11 , FailedAddingTelemetryToBuffer: 12 , FailedMonitorAjaxAbort: 13 , FailedMonitorAjaxDur: 14 , FailedMonitorAjaxOpen: 15 , FailedMonitorAjaxRSC: 16 , FailedMonitorAjaxSend: 17 , FailedMonitorAjaxGetCorrelationHeader: 18 , FailedToAddHandlerForOnBeforeUnload: 19 , FailedToSendQueuedTelemetry: 20 , FailedToReportDataLoss: 21 , FlushFailed: 22 , MessageLimitPerPVExceeded: 23 , MissingRequiredFieldSpecification: 24 , NavigationTimingNotSupported: 25 , OnError: 26 , SessionRenewalDateIsZero: 27 , SenderNotInitialized: 28 , StartTrackEventFailed: 29 , StopTrackEventFailed: 30 , StartTrackFailed: 31 , StopTrackFailed: 32 , TelemetrySampledAndNotSent: 33 , TrackEventFailed: 34 , TrackExceptionFailed: 35 , TrackMetricFailed: 36 , TrackPVFailed: 37 , TrackPVFailedCalc: 38 , TrackTraceFailed: 39 , TransmissionFailed: 40 , FailedToSetStorageBuffer: 41 , FailedToRestoreStorageBuffer: 42 , InvalidBackendResponse: 43 , FailedToFixDepricatedValues: 44 , InvalidDurationValue: 45 , TelemetryEnvelopeInvalid: 46 , CreateEnvelopeError: 47 , CannotSerializeObject: 48 , CannotSerializeObjectNonSerializable: 49 , CircularReferenceDetected: 50 , ClearAuthContextFailed: 51 , ExceptionTruncated: 52 , IllegalCharsInName: 53 , ItemNotInArray: 54 , MaxAjaxPerPVExceeded: 55 , MessageTruncated: 56 , NameTooLong: 57 , SampleRateOutOfRange: 58 , SetAuthContextFailed: 59 , SetAuthContextFailedAccountName: 60 , StringValueTooLong: 61 , StartCalledMoreThanOnce: 62 , StopCalledWithoutStart: 63 , TelemetryInitializerFailed: 64 , TrackArgumentsNotSpecified: 65 , UrlTooLong: 66 , SessionStorageBufferFull: 67 , CannotAccessCookie: 68 , IdTooLong: 69 , InvalidEvent: 70 , FailedMonitorAjaxSetRequestHeader: 71 , SendBrowserInfoOnUserInit: 72 , PluginException: 73 , NotificationException: 74 , SnippetScriptLoadFailure: 99 , InvalidInstrumentationKey: 100 , CannotParseAiBlobValue: 101 , InvalidContentBlob: 102 , TrackPageActionEventFailed: 103 , FailedAddingCustomDefinedRequestContext: 104 , InMemoryStorageBufferFull: 105 }); var ValueKind = createEnumStyle({ NotSet: 0 , Pii_DistinguishedName: 1 , Pii_GenericData: 2 , Pii_IPV4Address: 3 , Pii_IPv6Address: 4 , Pii_MailSubject: 5 , Pii_PhoneNumber: 6 , Pii_QueryString: 7 , Pii_SipAddress: 8 , Pii_SmtpAddress: 9 , Pii_Identity: 10 , Pii_Uri: 11 , Pii_Fqdn: 12 , Pii_IPV4AddressLegacy: 13 , CustomerContent_GenericContent: 32 }); var EventLatency = createEnumStyle({ Normal: 1 , CostDeferred: 2 , RealTime: 3 , Immediate: 4 }); var EventPropertyType = createEnumStyle({ Unspecified: 0 , String: 1 , Int32: 2 , UInt32: 3 , Int64: 4 , UInt64: 5 , Double: 6 , Bool: 7 , Guid: 8 , DateTime: 9 }); var EventPersistence = createEnumStyle({ Normal: 1 , Critical: 2 }); var TraceLevel = createEnumStyle({ NONE: 0 , ERROR: 1 , WARNING: 2 , INFORMATION: 3 }); var _ExtendedInternalMessageId = objFreeze(__assignFn(__assignFn({}, _InternalMessageId), createEnumStyle({ AuthHandShakeError: 501 , AuthRedirectFail: 502 , BrowserCannotReadLocalStorage: 503 , BrowserCannotWriteLocalStorage: 504 , BrowserDoesNotSupportLocalStorage: 505 , CannotParseBiBlobValue: 506 , CannotParseDataAttribute: 507 , CVPluginNotAvailable: 508 , DroppedEvent: 509 , ErrorParsingAISessionCookie: 510 , ErrorProvidedChannels: 511 , FailedToGetCookies: 512 , FailedToInitializeCorrelationVector: 513 , FailedToInitializeSDK: 514 , InvalidContentBlob: 515 , InvalidCorrelationValue: 516 , SessionRenewalDateIsZero: 517 , SendPostOnCompleteFailure: 518 , PostResponseHandler: 519 , SDKNotInitialized: 520 }))); var _a; var Version = '3.2.2'; var FullVersionString = "1DS-Web-JS-" + Version; var strDisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation"; var strWithCredentials = "withCredentials"; var strTimeout = "timeout"; var _fieldTypeEventPropMap = (_a = {}, _a[0 ] = 0 , _a[2 ] = 6 , _a[1 ] = 1 , _a[3 ] = 7 , _a[4096 | 2 ] = 6 , _a[4096 | 1 ] = 1 , _a[4096 | 3 ] = 7 , _a); var uInt8ArraySupported = null; var isDocumentObjectAvailable = Boolean(getDocument()); var isWindowObjectAvailable = Boolean(getWindow()); function isValueAssigned(value) { return !(value === "" || isNullOrUndefined(value)); } function getTenantId(apiKey) { if (apiKey) { var indexTenantId = apiKey.indexOf("-"); if (indexTenantId > -1) { return apiKey.substring(0, indexTenantId); } } return ""; } function isUint8ArrayAvailable() { if (uInt8ArraySupported === null) { uInt8ArraySupported = !isUndefined(Uint8Array) && !isSafariOrFirefox() && !isReactNative(); } return uInt8ArraySupported; } function isLatency(value) { if (value && isNumber(value) && value >= 1 && value <= 4 ) { return true; } return false; } function sanitizeProperty(name, property, stringifyObjects) { if ((!property && !isValueAssigned(property)) || typeof name !== "string") { return null; } var propType = typeof property; if (propType === "string" || propType === "number" || propType === "boolean" || isArray(property)) { property = { value: property }; } else if (propType === "object" && !property.hasOwnProperty("value")) { property = { value: stringifyObjects ? JSON.stringify(property) : property }; } else if (isNullOrUndefined(property.value) || property.value === "" || (!isString(property.value) && !isNumber(property.value) && !isBoolean(property.value) && !isArray(property.value))) { return null; } if (isArray(property.value) && !isArrayValid(property.value)) { return null; } if (!isNullOrUndefined(property.kind)) { if (isArray(property.value) || !isValueKind(property.kind)) { return null; } property.value = property.value.toString(); } return property; } function getCommonSchemaMetaData(value, kind, type) { var encodedTypeValue = -1; if (!isUndefined(value)) { if (kind > 0) { if (kind === 32) { encodedTypeValue = (1 << 13); } else if (kind <= 13) { encodedTypeValue = (kind << 5); } } if (isDataType(type)) { if (encodedTypeValue === -1) { encodedTypeValue = 0; } encodedTypeValue |= type; } else { var propType = _fieldTypeEventPropMap[getFieldValueType(value)] || -1; if (encodedTypeValue !== -1 && propType !== -1) { encodedTypeValue |= propType; } else if (propType === 6 ) { encodedTypeValue = propType; } } } return encodedTypeValue; } function disableCookies() { safeGetCookieMgr(null).setEnabled(false); } function setCookie(name, value, days) { if (areCookiesSupported(null)) { safeGetCookieMgr(null).set(name, value, days * 86400, null, "/"); } } function deleteCookie(name) { if (areCookiesSupported(null)) { safeGetCookieMgr(null).del(name); } } function getCookie(name) { if (areCookiesSupported(null)) { return getCookieValue(safeGetCookieMgr(null), name); } return ""; } function getCookieValue(cookieMgr, name, decode) { if (decode === void 0) { decode = true; } var cookieValue; if (cookieMgr) { cookieValue = cookieMgr.get(name); if (decode && cookieValue && decodeURIComponent) { cookieValue = decodeURIComponent(cookieValue); } } return cookieValue || ""; } function createGuid(style) { if (style === void 0) { style = "D" ; } var theGuid = newGuid(); if (style === "B" ) { theGuid = "{" + theGuid + "}"; } else if (style === "P" ) { theGuid = "(" + theGuid + ")"; } else if (style === "N" ) { theGuid = theGuid.replace(/-/g, ""); } return theGuid; } function extend(obj, obj2, obj3, obj4, obj5) { var extended = {}; var deep = false; var i = 0; var length = arguments.length; var objProto = Object[strShimPrototype]; var theArgs = arguments; if (objProto.toString.call(theArgs[0]) === "[object Boolean]") { deep = theArgs[0]; i++; } for (; i < length; i++) { var obj = theArgs[i]; objForEachKey(obj, function (prop, value) { if (deep && value && isObject(value)) { if (isArray(value)) { extended[prop] = extended[prop] || []; arrForEach(value, function (arrayValue, arrayIndex) { if (arrayValue && isObject(arrayValue)) { extended[prop][arrayIndex] = extend(true, extended[prop][arrayIndex], arrayValue); } else { extended[prop][arrayIndex] = arrayValue; } }); } else { extended[prop] = extend(true, extended[prop], value); } } else { extended[prop] = value; } }); } return extended; } var getTime = perfNow; function isValueKind(value) { if (value === 0 || ((value > 0 && value <= 13 ) || value === 32 )) { return true; } return false; } function isDataType(value) { if (value >= 0 && value <= 9) { return true; } return false; } function isSafariOrFirefox() { var nav = getNavigator(); if (!isUndefined(nav) && nav.userAgent) { var ua = nav.userAgent.toLowerCase(); if ((ua.indexOf("safari") >= 0 || ua.indexOf("firefox") >= 0) && ua.indexOf("chrome") < 0) { return true; } } return false; } function isArrayValid(value) { return value.length > 0; } function setProcessTelemetryTimings(event, identifier) { var evt = event; evt.timings = evt.timings || {}; evt.timings.processTelemetryStart = evt.timings.processTelemetryStart || {}; evt.timings.processTelemetryStart[identifier] = getTime(); } function getFieldValueType(value) { var theType = 0 ; if (value !== null && value !== undefined) { var objType = typeof value; if (objType === "string") { theType = 1 ; } else if (objType === "number") { theType = 2 ; } else if (objType === "boolean") { theType = 3 ; } else if (objType === strShimObject) { theType = 4 ; if (isArray(value)) { theType = 4096 ; if (value.length > 0) { theType |= getFieldValueType(value[0]); } } else if (hasOwnProperty(value, "value")) { theType = 8192 | getFieldValueType(value.value); } } } return theType; } var Utils = { Version: Version, FullVersionString: FullVersionString, strUndefined: strShimUndefined, strObject: strShimObject, Undefined: strShimUndefined, arrForEach: arrForEach, arrIndexOf: arrIndexOf, arrMap: arrMap, arrReduce: arrReduce, objKeys: objKeys, toISOString: toISOString, isReactNative: isReactNative, isString: isString, isNumber: isNumber, isBoolean: isBoolean, isFunction: isFunction, isArray: isArray, isObject: isObject, strTrim: strTrim, isDocumentObjectAvailable: isDocumentObjectAvailable, isWindowObjectAvailable: isWindowObjectAvailable, isValueAssigned: isValueAssigned, getTenantId: getTenantId, isBeaconsSupported: isBeaconsSupported, isUint8ArrayAvailable: isUint8ArrayAvailable, isLatency: isLatency, sanitizeProperty: sanitizeProperty, getISOString: toISOString, useXDomainRequest: useXDomainRequest, getCommonSchemaMetaData: getCommonSchemaMetaData, cookieAvailable: areCookiesSupported, disallowsSameSiteNone: uaDisallowsSameSiteNone, setCookie: setCookie, deleteCookie: deleteCookie, getCookie: getCookie, createGuid: createGuid, extend: extend, getTime: getTime, isValueKind: isValueKind, isArrayValid: isArrayValid, objDefineAccessors: objDefineAccessors, addPageUnloadEventListener: addPageUnloadEventListener, setProcessTelemetryTimings: setProcessTelemetryTimings, addEventHandler: addEventHandler, getFieldValueType: getFieldValueType, strEndsWith: strEndsWith, objForEachKey: objForEachKey }; var CoreUtils = { _canUseCookies: undefined, isTypeof: isTypeof, isUndefined: isUndefined, isNullOrUndefined: isNullOrUndefined, hasOwnProperty: hasOwnProperty, isFunction: isFunction, isObject: isObject, isDate: isDate, isArray: isArray, isError: isError, isString: isString, isNumber: isNumber, isBoolean: isBoolean, toISOString: toISOString, arrForEach: arrForEach, arrIndexOf: arrIndexOf, arrMap: arrMap, arrReduce: arrReduce, strTrim: strTrim, objCreate: objCreateFn, objKeys: objKeys, objDefineAccessors: objDefineAccessors, addEventHandler: addEventHandler, dateNow: dateNow, isIE: isIE, disableCookies: disableCookies, newGuid: newGuid, perfNow: perfNow, newId: newId, randomValue: randomValue, random32: random32, mwcRandomSeed: mwcRandomSeed, mwcRandom32: mwcRandom32, generateW3CId: generateW3CId }; function isChromium() { return !!getGlobalInst("chrome"); } function openXhr(method, urlString, withCredentials, disabled, isSync, timeout) { if (disabled === void 0) { disabled = false; } if (isSync === void 0) { isSync = false; } function _wrapSetXhrProp(xhr, prop, value) { try { xhr[prop] = value; } catch (e) { } } var xhr = new XMLHttpRequest(); if (disabled) { _wrapSetXhrProp(xhr, strDisabledPropertyName, disabled); } if (withCredentials) { _wrapSetXhrProp(xhr, strWithCredentials, withCredentials); } xhr.open(method, urlString, !isSync); if (withCredentials) { _wrapSetXhrProp(xhr, strWithCredentials, withCredentials); } if (!isSync && timeout) { _wrapSetXhrProp(xhr, strTimeout, timeout); } return xhr; } var PropVersion = "version"; var properties = "properties"; var AppInsightsCore = /** @class */ (function (_super) { __extendsFn(AppInsightsCore, _super); function AppInsightsCore() { var _this = _super.call(this) || this; _this.pluginVersionStringArr = []; _this.pluginVersionString = ""; dynamicProto(AppInsightsCore, _this, function (_self, _base) { if (!_self.logger || !_self.logger.queue) { _self.logger = new DiagnosticLogger({ loggingLevelConsole: 1 }); } _self.initialize = function (config, extensions, logger, notificationManager) { doPerf(_self, function () { return "AppInsightsCore.initialize"; }, function () { if (config) { if (!config.endpointUrl) { config.endpointUrl = "https://browser.events.data.microsoft.com/OneCollector/1.0/"; } var propertyStorageOverride = config.propertyStorageOverride; if (propertyStorageOverride && (!propertyStorageOverride.getProperty || !propertyStorageOverride.setProperty)) { throw new Error("Invalid property storage override passed."); } if (config.channels) { arrForEach(config.channels, function (channels) { if (channels) { arrForEach(channels, function (channel) { if (channel.identifier && channel.version) { var ver = channel.identifier + "=" + channel.version; _self.pluginVersionStringArr.push(ver); } }); } }); } } _self.getWParam = function () { return typeof document !== "undefined" ? 0 : -1; }; if (extensions) { arrForEach(extensions, function (ext) { if (ext && ext.identifier && ext.version) { var ver = ext.identifier + "=" + ext.version; _self.pluginVersionStringArr.push(ver); } }); } _self.pluginVersionString = _self.pluginVersionStringArr.join(";"); try { _base.initialize(config, extensions, logger, notificationManager); _self.pollInternalLogs("InternalLog"); } catch (e) { var logger_1 = _self.logger; var message = dumpObj(e); if (message.indexOf("channels") !== -1) { message += "\n - Channels must be provided through config.channels only!"; } logger_1.throwInternal(1 , 514 , "SDK Initialization Failed - no telemetry will be sent: " + message); } }, function () { return ({ config: config, extensions: extensions, logger: logger, notificationManager: notificationManager }); }); }; _self.track = function (item) { doPerf(_self, function () { return "AppInsightsCore.track"; }, function () { var telemetryItem = item; if (telemetryItem) { telemetryItem.timings = telemetryItem.timings || {}; telemetryItem.timings.trackStart = getTime(); if (!isLatency(telemetryItem.latency)) { telemetryItem.latency = 1 ; } var itemExt = telemetryItem.ext = telemetryItem.ext || {}; itemExt.sdk = itemExt.sdk || {}; itemExt.sdk.ver = FullVersionString; var baseData = telemetryItem.baseData = telemetryItem.baseData || {}; if (!baseData[properties]) { baseData[properties] = {}; } var itemProperties = baseData[properties]; if (!itemProperties[PropVersion]) { itemProperties[PropVersion] = ""; } if (_self.pluginVersionString !== "") { itemProperties[PropVersion] = _self.pluginVersionString; } } _base.track(telemetryItem); }, function () { return ({ item: item }); }, !(item.sync)); }; }); return _this; } return AppInsightsCore; }(AppInsightsCore$2)); var AppInsightsCore$1 = AppInsightsCore; var BaseCore = /** @class */ (function (_super) { __extendsFn(BaseCore, _super); function BaseCore() { var _this = _super.call(this) || this; dynamicProto(BaseCore, _this, function (_self, _base) { _self.initialize = function (config, extensions, logger, notificationManager) { if (config && !config.endpointUrl) { config.endpointUrl = "https://browser.events.data.microsoft.com/OneCollector/1.0/"; } _self.getWParam = function () { return isDocumentObjectAvailable ? 0 : -1; }; try { _base.initialize(config, extensions, logger, notificationManager); } catch (e) { _throwInternal(_self.logger, 1 , 514 , "Initialization Failed: " + dumpObj(e) + "\n - Note: Channels must be provided through config.channels only"); } }; _self.track = function (item) { var telemetryItem = item; if (telemetryItem) { var ext = telemetryItem.ext = telemetryItem.ext || {}; ext.sdk = ext.sdk || {}; ext.sdk.ver = FullVersionString; } _base.track(telemetryItem); }; }); return _this; } return BaseCore; }(BaseCore$2)); var BaseCore$1 = BaseCore; var _isFunction = isFunction; function _createPromiseAllOnResolvedFunction(values, index, resolvedCallback) { return function (value) { values[index] = value; resolvedCallback(); }; } var ESPromise = /** @class */ (function () { function ESPromise(resolverFunc) { var _state = 0 ; var _settledValue = null; var _queue = []; dynamicProto(ESPromise, this, function (_this) { _this.then = function (onResolved, onRejected) { return new ESPromise(function (resolve, reject) { _enqueue(onResolved, onRejected, resolve, reject); }); }; _this["catch"] = function (onRejected) { return _this.then(null, onRejected); }; }); function _enqueue(onResolved, onRejected, resolve, reject) { _queue.push(function () { var value; try { if (_state === 1 ) { value = _isFunction(onResolved) ? onResolved(_settledValue) : _settledValue; } else { value = _isFunction(onRejected) ? onRejected(_settledValue) : _settledValue; } if (value instanceof ESPromise) { value.then(resolve, reject); } else if (_state === 2 && !_isFunction(onRejected)) { reject(value); } else { resolve(value); } } catch (error) { reject(error); return; } }); if (_state !== 0 ) { _processQueue(); } } function _processQueue() { if (_queue.length > 0) { var pending_1 = _queue.slice(); _queue = []; setTimeout(function () { for (var i = 0, len = pending_1.length; i < len; ++i) { try { pending_1[i](); } catch (e) { } } }, 0); } } function _resolve(value) { if (_state === 0 ) { _settledValue = value; _state = 1 ; _processQueue(); } } function _reject(reason) { if (_state === 0 ) { _settledValue = reason; _state = 2 ; _processQueue(); } } (function _initialize() { if (!_isFunction(resolverFunc)) { throw new TypeError("ESPromise: resolvedFunc argument is not a Function"); } try { resolverFunc(_resolve, _reject); } catch (error) { _reject(error); } })(); } ESPromise.resolve = function (value) { if (value instanceof ESPromise) { return value; } else if (value && _isFunction(value.then)) { return new ESPromise(function (resolve, reject) { try { value.then(resolve, reject); } catch (error) { reject(error); } }); } return new ESPromise(function (resolve) { resolve(value); }); }; ESPromise.reject = function (reason) { return new ESPromise(function (resolve, reject) { reject(reason); }); }; ESPromise.all = function (iterable) { if (!iterable || !iterable.length) { return; } return new ESPromise(function (resolve, reject) { try { var values_1 = []; var pending_2 = 0; for (var lp = 0; lp < iterable.length; lp++) { var item = iterable[lp]; if (item && _isFunction(item.then)) { pending_2++; item.then(_createPromiseAllOnResolvedFunction(values_1, lp, function () { if (--pending_2 === 0) { resolve(values_1); } }), reject); } else { values_1[lp] = item; } } if (pending_2 === 0) { setTimeout(function () { resolve(values_1); }, 0); } } catch (error) { reject(error); } }); }; ESPromise.race = function (iterable) { return new ESPromise(function (resolve, reject) { if (!iterable || !iterable.length) { return; } try { var _loop_1 = function (lp) { var item = iterable[lp]; if (item && _isFunction(item.then)) { item.then(resolve, reject); } else { setTimeout(function () { resolve(item); }, 0); } }; for (var lp = 0; lp < iterable.length; lp++) { _loop_1(lp); } } catch (error) { reject(error); } }); }; return ESPromise; }()); var ESPromise$1 = ESPromise; var LazyRejectPeriod = 600000; var _schedulerId = 0; var _running = []; var _waiting = []; var _timedOut = []; function _getTime() { return new Date().getTime(); } var ESPromiseScheduler = /** @class */ (function () { function ESPromiseScheduler(name, diagLog) { var _promiseId = 0; var _scheduledName = (name || "") + "." + _schedulerId; _schedulerId++; dynamicProto(ESPromiseScheduler, this, function (_this) { var _lastEvent = null; var _eventCount = 0; _this.scheduleEvent = function (startEventAction, eventName, timeout) { var uniqueId = _scheduledName + "." + _eventCount; _eventCount++; if (eventName) { uniqueId += "-(" + eventName + ")"; } var uniqueEventId = uniqueId + "{" + _promiseId + "}"; _promiseId++; var newScheduledEvent = { evt: null, tm: _getTime(), id: uniqueEventId, isRunning: false, isAborted: false }; if (!_lastEvent) { newScheduledEvent.evt = _startWaitingEvent(newScheduledEvent); } else { newScheduledEvent.evt = _waitForPreviousEvent(newScheduledEvent, _lastEvent); } _lastEvent = newScheduledEvent; _lastEvent.evt._schId = uniqueEventId; return newScheduledEvent.evt; function _abortAndRemoveOldEvents(eventQueue) { var now = _getTime(); var expired = now - LazyRejectPeriod; var len = eventQueue.length; var lp = 0; while (lp < len) { var evt = eventQueue[lp]; if (evt && evt.tm < expired) { var message = null; if (evt.abort) { message = "Aborting [" + evt.id + "] due to Excessive runtime (" + (now - evt.tm) + " ms)"; evt.abort(message); } else { message = "Removing [" + evt.id + "] due to Excessive runtime (" + (now - evt.tm) + " ms)"; } _warnLog(message); eventQueue.splice(lp, 1); len--; } else { lp++; } } } function _cleanup(eventId, completed) { var toQueue = false; var removed = _removeQueuedEvent(_running, eventId); if (!removed) { removed = _removeQueuedEvent(_timedOut, eventId); toQueue = true; } if (removed) { if (removed.to) { clearTimeout(removed.to); removed.to = null; } var tm = _getTime() - removed.tm; if (completed) { if (!toQueue) { _debugLog("Promise [" + eventId + "] Complete -- " + tm + " ms"); } else { _warnLog("Timed out event [" + eventId + "] finally complete -- " + tm + " ms"); } } else { _timedOut.push(removed); _warnLog("Event [" + eventId + "] Timed out and removed -- " + tm + " ms"); } } else { _debugLog("Failed to remove [" + eventId + "] from running queue"); } if (_lastEvent && _lastEvent.id === eventId) { _lastEvent = null; } _abortAndRemoveOldEvents(_running); _abortAndRemoveOldEvents(_waiting); _abortAndRemoveOldEvents(_timedOut); } function _removeScheduledEvent(eventId, callback) { return function (value) { _cleanup(eventId, true); callback && callback(value); return value; }; } function _waitForFinalResult(eventId, startResult, schEventResolve, schEventReject) { startResult.then(function (value) { if (value instanceof ESPromise$1) { _debugLog("Event [" + eventId + "] returned a promise -- waiting"); _waitForFinalResult(eventId, value, schEventResolve, schEventReject); return value; } else { return _removeScheduledEvent(eventId, schEventResolve)(value); } }, _removeScheduledEvent(eventId, schEventReject)); } function _createScheduledEvent(eventDetails, startEvent) { var eventId = eventDetails.id; return new ESPromise$1(function (schEventResolve, schEventReject) { _debugLog("Event [" + eventId + "] Starting -- waited for " + (eventDetails.wTm || "--") + " ms"); eventDetails.isRunning = true; eventDetails.abort = function (message) { eventDetails.abort = null; eventDetails.isAborted = true; _cleanup(eventId, false); schEventReject(new Error(message)); }; var startResult = startEvent(eventId); if (startResult instanceof ESPromise$1) { if (timeout) { eventDetails.to = setTimeout(function () { _cleanup(eventId, false); schEventReject(new Error("Timed out after [" + timeout + "] ms")); }, timeout); } _waitForFinalResult(eventId, startResult, function (theResult) { _debugLog("Event [" + eventId + "] Resolving after " + (_getTime() - eventDetails.tm) + " ms"); schEventResolve(theResult); }, schEventReject); } else { _debugLog("Promise [" + eventId + "] Auto completed as the start action did not return a promise"); schEventResolve(); } }); } function _startWaitingEvent(eventDetails) { var now = _getTime(); eventDetails.wTm = now - eventDetails.tm; eventDetails.tm = now; if (eventDetails.isAborted) { return ESPromise$1.reject(new Error("[" + uniqueId + "] was aborted")); } _running.push(eventDetails); return _createScheduledEvent(eventDetails, startEventAction); } function _waitForPreviousEvent(eventDetails, waitForEvent) { var waitEvent = new ESPromise$1(function (waitResolve, waitReject) { var runTime = _getTime() - waitForEvent.tm; var prevId = waitForEvent.id; _debugLog("[" + uniqueId + "] is waiting for [" + prevId + ":" + runTime + " ms] to complete before starting -- [" + _waiting.length + "] waiting and [" + _running.length + "] running"); eventDetails.abort = function (message) { eventDetails.abort = null; _removeQueuedEvent(_waiting, uniqueId); eventDetails.isAborted = true; waitReject(new Error(message)); }; waitForEvent.evt.then(function (value) { _removeQueuedEvent(_waiting, uniqueId); _startWaitingEvent(eventDetails).then(waitResolve, waitReject); }, function (reason) { _removeQueuedEvent(_waiting, uniqueId); _startWaitingEvent(eventDetails).then(waitResolve, waitReject); }); }); _waiting.push(eventDetails); return waitEvent; } }; function _removeQueuedEvent(queue, eventId) { for (var lp = 0; lp < queue.length; lp++) { if (queue[lp].id === eventId) { return queue.splice(lp, 1)[0]; } } return null; } }); function _debugLog(message) { var global = getGlobal(); if (global && global["QUnit"]) { console && console.log("ESPromiseScheduler[" + _scheduledName + "] " + message); } } function _warnLog(message) { diagLog && diagLog.warnToConsole("ESPromiseScheduler[" + _scheduledName + "] " + message); } } ESPromiseScheduler.incomplete = function () { return _running; }; ESPromiseScheduler.waitingToStart = function () { return _waiting; }; return ESPromiseScheduler; }()); var ESPromiseScheduler$1 = ESPromiseScheduler; var ValueSanitizer = /** @class */ (function () { function ValueSanitizer(fieldSanitizerProvider) { var _self = this; var _sanitizerMap = {}; var _sanitizers = []; var _fieldSanitizers = []; if (fieldSanitizerProvider) { _fieldSanitizers.push(fieldSanitizerProvider); } function _getFieldSanitizer(path, name) { var result; var fieldLookup = _sanitizerMap[path]; if (fieldLookup) { result = fieldLookup[name]; } if (!result && result !== null) { if (isString(path) && isString(name)) { if (_fieldSanitizers.length > 0) { for (var lp = 0; lp < _fieldSanitizers.length; lp++) { if (_fieldSanitizers[lp].handleField(path, name)) { result = { canHandle: true, fieldHandler: _fieldSanitizers[lp] }; break; } } } else if (_sanitizers.length === 0) { result = { canHandle: true }; } } if (!result && result !== null) { result = null; for (var lp = 0; lp < _sanitizers.length; lp++) { if (_sanitizers[lp].handleField(path, name)) { result = { canHandle: true, handler: _sanitizers[lp], fieldHandler: null }; break; } } } if (!fieldLookup) { fieldLookup = _sanitizerMap[path] = {}; } fieldLookup[name] = result; } return result; } _self.addSanitizer = function (newSanitizer) { if (newSanitizer) { _sanitizers.push(newSanitizer); _sanitizerMap = {}; } }; _self.addFieldSanitizer = function (fieldSanitizer) { if (fieldSanitizer) { _fieldSanitizers.push(fieldSanitizer); _sanitizerMap = {}; } }; _self.handleField = function (path, name) { var mapValue = _getFieldSanitizer(path, name); return mapValue ? mapValue.canHandle : false; }; _self.value = function (path, name, value, stringifyObjects) { var mapValue = _getFieldSanitizer(path, name); if (mapValue && mapValue.canHandle) { if (!mapValue || !mapValue.canHandle) { return null; } if (mapValue.handler) { return mapValue.handler.value(path, name, value, stringifyObjects); } if (!isString(name) || isNullOrUndefined(value) || value === "") { return null; } var property = null; var fieldType = getFieldValueType(value); if ((fieldType & 8192 ) === 8192 ) { var subType = fieldType & ~8192 ; property = value; if (!isValueAssigned(property.value) || (subType !== 1 && subType !== 2 && subType !== 3 && (subType & 4096 ) !== 4096 )) { return null; } } else if (fieldType === 1 || fieldType === 2 || fieldType === 3 || (fieldType & 4096 ) === 4096 ) { property = _convertToProperty(path, name, value); } else if (fieldType === 4 ) { property = _convertToProperty(path, name, !!stringifyObjects ? JSON.stringify(value) : value); } if (property) { return _handleProperty(mapValue, path, name, fieldType, property, stringifyObjects); } } return null; }; _self.property = function (path, name, property, stringifyObjects) { var mapValue = _getFieldSanitizer(path, name); if (!mapValue || !mapValue.canHandle) { return null; } if (!isString(name) || isNullOrUndefined(property) || !isValueAssigned(property.value)) { return null; } var fieldType = getFieldValueType(property.value); if (fieldType === 0 ) { return null; } return _handleProperty(mapValue, path, name, fieldType, property, stringifyObjects); }; function _handleProperty(mapValue, path, name, fieldType, property, stringifyObjects) { if (mapValue.handler) { return mapValue.handler.property(path, name, property, stringifyObjects); } if (!isNullOrUndefined(property.kind)) { if ((fieldType & 4096 ) === 4096 || !isValueKind(property.kind)) { return null; } property.value = property.value.toString(); } return _callFieldSanitizer(mapValue.fieldHandler, path, name, fieldType, property); } function _convertToProperty(path, name, value) { if (isValueAssigned(value)) { return { value: value }; } return null; } function _callFieldSanitizer(fieldProvider, path, name, theType, property) { if (property && fieldProvider) { var sanitizer = fieldProvider.getSanitizer(path, name, theType, property.kind, property.propertyType); if (sanitizer) { if (theType === 4 ) { var newValue_1 = {}; var propValue = property.value; objForEachKey(propValue, function (propKey, theValue) { var newPath = path + "." + name; if (isValueAssigned(theValue)) { var newProp = _convertToProperty(newPath, propKey, theValue); newProp = _callFieldSanitizer(fieldProvider, newPath, propKey, getFieldValueType(theValue), newProp); if (newProp) { newValue_1[propKey] = newProp.value; } } }); property.value = newValue_1; } else { var details = { path: path, name: name, type: theType, prop: property, sanitizer: _self }; property = sanitizer.call(_self, details); } } } return property; } } ValueSanitizer.getFieldType = getFieldValueType; return ValueSanitizer; }()); exports.AppInsightsCore = AppInsightsCore$1; exports.BaseCore = BaseCore$1; exports.BaseTelemetryPlugin = BaseTelemetryPlugin; exports.CoreUtils = CoreUtils; exports.DiagnosticLogger = DiagnosticLogger; exports.ESPromise = ESPromise$1; exports.ESPromiseScheduler = ESPromiseScheduler$1; exports.EventHelper = EventHelper; exports.EventLatency = EventLatency; exports.EventPersistence = EventPersistence; exports.EventPropertyType = EventPropertyType; exports.EventsDiscardedReason = EventsDiscardedReason; exports.FullVersionString = FullVersionString; exports.InternalAppInsightsCore = AppInsightsCore$2; exports.InternalBaseCore = BaseCore$2; exports.LoggingSeverity = LoggingSeverity; exports.MinChannelPriorty = MinChannelPriorty; exports.NotificationManager = NotificationManager; exports.PerfEvent = PerfEvent; exports.PerfManager = PerfManager; exports.ProcessTelemetryContext = ProcessTelemetryContext; exports.TraceLevel = TraceLevel; exports.Undefined = strShimUndefined; exports.Utils = Utils; exports.ValueKind = ValueKind; exports.ValueSanitizer = ValueSanitizer; exports.Version = Version; exports._ExtendedInternalMessageId = _ExtendedInternalMessageId; exports._InternalLogMessage = _InternalLogMessage; exports._InternalMessageId = _InternalMessageId; exports.__getRegisteredEvents = __getRegisteredEvents; exports._throwInternal = _throwInternal; exports.addEventHandler = addEventHandler; exports.addEventListeners = addEventListeners; exports.addPageHideEventListener = addPageHideEventListener; exports.addPageShowEventListener = addPageShowEventListener; exports.addPageUnloadEventListener = addPageUnloadEventListener; exports.areCookiesSupported = areCookiesSupported; exports.arrForEach = arrForEach; exports.arrIndexOf = arrIndexOf; exports.arrMap = arrMap; exports.arrReduce = arrReduce; exports.attachEvent = attachEvent; exports.cookieAvailable = areCookiesSupported; exports.createCookieMgr = createCookieMgr; exports.createEnumStyle = createEnumStyle; exports.createGuid = createGuid; exports.createProcessTelemetryContext = createProcessTelemetryContext; exports.createUniqueNamespace = createUniqueNamespace; exports.createUnloadHandlerContainer = createUnloadHandlerContainer; exports.dateNow = dateNow; exports.deleteCookie = deleteCookie; exports.detachEvent = detachEvent; exports.disableCookies = disableCookies; exports.disallowsSameSiteNone = uaDisallowsSameSiteNone; exports.doPerf = doPerf; exports.dumpObj = dumpObj; exports.eventOff = eventOff; exports.eventOn = eventOn; exports.extend = extend; exports.generateW3CId = generateW3CId; exports.getCommonSchemaMetaData = getCommonSchemaMetaData; exports.getConsole = getConsole; exports.getCookie = getCookie; exports.getCookieValue = getCookieValue; exports.getCrypto = getCrypto; exports.getDocument = getDocument; exports.getExceptionName = getExceptionName; exports.getFieldValueType = getFieldValueType; exports.getGlobal = getGlobal; exports.getGlobalInst = getGlobalInst; exports.getHistory = getHistory; exports.getIEVersion = getIEVersion; exports.getISOString = toISOString; exports.getJSON = getJSON; exports.getLocation = getLocation; exports.getMsCrypto = getMsCrypto; exports.getNavigator = getNavigator; exports.getPerformance = getPerformance; exports.getSetValue = getSetValue; exports.getTenantId = getTenantId; exports.getTime = getTime; exports.getWindow = getWindow; exports.hasDocument = hasDocument; exports.hasHistory = hasHistory; exports.hasJSON = hasJSON; exports.hasNavigator = hasNavigator; exports.hasOwnProperty = hasOwnProperty; exports.hasWindow = hasWindow; exports.isArray = isArray; exports.isArrayValid = isArrayValid; exports.isBeaconsSupported = isBeaconsSupported; exports.isBoolean = isBoolean; exports.isChromium = isChromium; exports.isDate = isDate; exports.isDocumentObjectAvailable = isDocumentObjectAvailable; exports.isError = isError; exports.isFetchSupported = isFetchSupported; exports.isFunction = isFunction; exports.isIE = isIE; exports.isLatency = isLatency; exports.isNotTruthy = isNotTruthy; exports.isNullOrUndefined = isNullOrUndefined; exports.isNumber = isNumber; exports.isObject = isObject; exports.isReactNative = isReactNative; exports.isString = isString; exports.isTruthy = isTruthy; exports.isTypeof = isTypeof; exports.isUint8ArrayAvailable = isUint8ArrayAvailable; exports.isUndefined = isUndefined; exports.isValueAssigned = isValueAssigned; exports.isValueKind = isValueKind; exports.isWindowObjectAvailable = isWindowObjectAvailable; exports.isXhrSupported = isXhrSupported; exports.mergeEvtNamespace = mergeEvtNamespace; exports.newGuid = newGuid; exports.newId = newId; exports.normalizeJsName = normalizeJsName; exports.objCreate = objCreateFn; exports.objDefineAccessors = objDefineAccessors; exports.objForEachKey = objForEachKey; exports.objFreeze = objFreeze; exports.objKeys = objKeys; exports.objSeal = objSeal; exports.openXhr = openXhr; exports.optimizeObject = optimizeObject; exports.perfNow = perfNow; exports.proxyAssign = proxyAssign; exports.proxyFunctionAs = proxyFunctionAs; exports.proxyFunctions = proxyFunctions; exports.random32 = random32; exports.randomValue = randomValue; exports.removeEventHandler = removeEventHandler; exports.removeEventListeners = removeEventListeners; exports.removePageHideEventListener = removePageHideEventListener; exports.removePageShowEventListener = removePageShowEventListener; exports.removePageUnloadEventListener = removePageUnloadEventListener; exports.safeGetCookieMgr = safeGetCookieMgr; exports.safeGetLogger = safeGetLogger; exports.sanitizeProperty = sanitizeProperty; exports.setCookie = setCookie; exports.setEnableEnvMocks = setEnableEnvMocks; exports.setProcessTelemetryTimings = setProcessTelemetryTimings; exports.setValue = setValue; exports.strContains = strContains; exports.strEndsWith = strEndsWith; exports.strFunction = strShimFunction; exports.strObject = strShimObject; exports.strPrototype = strShimPrototype; exports.strStartsWith = strStartsWith; exports.strTrim = strTrim; exports.strUndefined = strShimUndefined; exports.throwError = throwError; exports.toISOString = toISOString; exports.useXDomainRequest = useXDomainRequest; (function(obj, prop, descriptor) { /* ai_es3_polyfil defineProperty */ var func = Object["defineProperty"]; if (func) { try { return func(obj, prop, descriptor); } catch(e) { /* IE8 defines defineProperty, but will throw */ } } if (descriptor && typeof descriptor.value !== undefined) { obj[prop] = descriptor.value; } return obj; })(exports, '__esModule', { value: true }); })(this.oneDS = this.oneDS || {});//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/1ds-core-js/bundle/ms.core-3.2.2.gbl.js.map /*! * 1DS JS SDK Core, 3.2.2 * Copyright (c) Microsoft and contributors. All rights reserved. * (Microsoft Internal Only) */ !function(n){"use strict";var I="function",u="object",e="undefined",f="prototype",P="hasOwnProperty",t=Object,E=t[f],N=t.assign,z=t.create,V=t.defineProperty,B=E[P],H=null;function K(n){return void 0===n&&(n=!0),H&&n||(typeof globalThis!==e&&globalThis&&(H=globalThis),typeof self!==e&&self&&(H=self),typeof window!==e&&window&&(H=window),typeof global!==e&&global&&(H=global)),H}function q(n){throw new TypeError(n)}function W(n){if(z)return z(n);if(null==n)return{};var e=typeof n;function t(){}return e!==u&&e!==I&&q("Object prototype may only be an Object:"+n),t[f]=n,new t}(K()||{}).Symbol,(K()||{}).Reflect;var G=N||function(n){for(var e,t=1,r=arguments.length;t=o.maxInternalMessageLimit()||(r=!0,t="AITR_"+e.messageId,a[t]?r=!1:a[t]=!0,r&&(n<=o.telemetryLoggingLevel()&&(o.queue.push(e),i++,u(1===n?"error":"warn",e)),i===o.maxInternalMessageLimit()&&(r=new wt(23,t="Internal events throttle limit per PageView reached for this app.",!1),o.queue.push(r),1===n?o.errorToConsole(t):o.warnToConsole(t))))}})};function j(n,e,t,r,i,o){void 0===o&&(o=!1),(n||new Pt).throwInternal(e,t,r,i,o)}l.ParentContextKey="parent",l.ChildrenContextKey="childEvts";var Et=l;function l(n,i,e){var t,o=this,u=!1;o.start=te(),o.name=n,o.isAsync=e,o.isChildEvt=function(){return!1},_(i)&&(u=ne(o,"payload",function(){return!t&&_(i)&&(t=i(),i=null),t})),o.getCtx=function(n){return n?(n===l.ParentContextKey||n===l.ChildrenContextKey?o:o.ctx||{})[n]:null},o.setCtx=function(n,e){n&&(n===l.ParentContextKey?(o[n]||(o.isChildEvt=function(){return!0}),o[n]=e):n===l.ChildrenContextKey?o[n]=e:(o.ctx=o.ctx||{})[n]=e)},o.complete=function(){var n=0,e=o.getCtx(l.ChildrenContextKey);if(m(e))for(var t=0;t>>=0),Ft=123456789+n&c,Ot=987654321-n&c,Mt=!0}function Dt(){try{var n=2147483647&te();Lt((Math.random()*_t^n)+n)}catch(e){}}function Ut(n){return 0>>0:0}function jt(n){var e=0,t=st()||ft();return 0===(e=t&&t.getRandomValues?t.getRandomValues(new Uint32Array(1))[0]&c:e)&>()&&(Mt||Dt(),e=Rt()&c),0===e&&(e=Math.floor(_t*Math.random()|0)),n||(e>>>=0),e}function Rt(n){var e=((Ot=36969*(65535&Ot)+(Ot>>16)&c)<<16)+(65535&(Ft=18e3*(65535&Ft)+(Ft>>16)&c))>>>0&c|0;return n||(e>>>=0),e}function zt(n){void 0===n&&(n=22);for(var e=jt()>>>0,t=0,r=g;r.length>>=6,5==++t&&(e=(jt()<<2&4294967295|3&e)>>>0,t=0);return r}var Vt=V,Bt="2.8.3",Ht="."+zt(6),Kt=0;function qt(n){return 1===n.nodeType||9===n.nodeType||!+n.nodeType}function Wt(n,e){return Vn(n+Kt+++((e=void 0!==e&&e)?"."+Bt:"")+Ht)}function Gt(n){var o={id:Wt("_aiData-"+(n||"")+"."+Bt),accept:qt,get:function(n,e,t,r){var i=n[o.id];return i?i[Vn(e)]:(r&&((i=function(n,e){var t=e[n.id];if(!t){t={};try{qt(e)&&!function(n,e,t){if(Vt)try{return Vt(n,e,{value:t,enumerable:!1,configurable:!0}),1}catch(r){}}(e,n.id,t)&&(e[n.id]=t)}catch(r){}}return t}(o,n))[Vn(e)]=t),t)},kill:function(n,e){if(n&&n[e])try{delete n[e]}catch(t){}}};return o}var Jt=Gt("plugin");function Xt(n){return Jt.get(n,"state",{},!0)}function Qt(t,r){for(var i,n=[],e=null,o=t.getNext();o;){var u=o.getPlugin();u&&(e&&_(e[Y])&&_(u[$])&&e[Y](u),(_(u[nn])?u[nn]():(i=Xt(u))[nn])||n.push(u),e=u,o=o.getNext())}M(n,function(n){var e=t.core();n.initialize(t.getCfg(),e,r,t.getNext()),i=Xt(n),n[d]||i[d]||(i[d]=e),i[nn]=!0,delete i[A]})}function $t(n){return n.sort(function(n,e){var t=0,r=_(e[$]);return _(n[$])?t=r?n[Z]-e[Z]:1:r&&(t=-1),t})}var Zt="TelemetryPluginChain",Yt="_hasRun",nr="_getTelCtx",er=0;function tr(n,u,t,e){var r=null,i=[],o=(null!==e&&(r=e?function(n,e,t){for(;n;){if(n.getPlugin()===t)return n;n=n.getNext()}return or([t],e.config||{},e)}(n,t,e):n),{_next:function(){var n,e=r;return r=e?e.getNext():null,e||(n=i)&&0_r&&l.push(n)}),Fr(c,l,t,a)),c)),w?(-1!==(d=F(v,w))&&v.splice(d,1),-1!==(d=F(b,w))&&b.splice(d,1),w._setQueue(I)):(s=I,f=m,g=!1,(d={identifier:"ChannelControllerPlugin",priority:_r,initialize:function(e,t,r,n){g=!0,M(s,function(n){n&&0>4&15]+e[n>>8&15]+e[n>>12&15]+e[n>>16&15]+e[n>>20&15]+e[n>>24&15]+e[n>>28&15];var i=e[8+(3&jt())|0];return t.substr(0,8)+t.substr(9,4)+"4"+t.substr(13,3)+i+t.substr(16,3)+t.substr(19,12)}var Mi=/[xy]/g,Fi={Attach:Si,AttachEvent:Si,Detach:bi,DetachEvent:bi},Oi=i({CRITICAL:1,WARNING:2}),Li=i({BrowserDoesNotSupportLocalStorage:0,BrowserCannotReadLocalStorage:1,BrowserCannotReadSessionStorage:2,BrowserCannotWriteLocalStorage:3,BrowserCannotWriteSessionStorage:4,BrowserFailedRemovalFromLocalStorage:5,BrowserFailedRemovalFromSessionStorage:6,CannotSendEmptyTelemetry:7,ClientPerformanceMathError:8,ErrorParsingAISessionCookie:9,ErrorPVCalc:10,ExceptionWhileLoggingError:11,FailedAddingTelemetryToBuffer:12,FailedMonitorAjaxAbort:13,FailedMonitorAjaxDur:14,FailedMonitorAjaxOpen:15,FailedMonitorAjaxRSC:16,FailedMonitorAjaxSend:17,FailedMonitorAjaxGetCorrelationHeader:18,FailedToAddHandlerForOnBeforeUnload:19,FailedToSendQueuedTelemetry:20,FailedToReportDataLoss:21,FlushFailed:22,MessageLimitPerPVExceeded:23,MissingRequiredFieldSpecification:24,NavigationTimingNotSupported:25,OnError:26,SessionRenewalDateIsZero:27,SenderNotInitialized:28,StartTrackEventFailed:29,StopTrackEventFailed:30,StartTrackFailed:31,StopTrackFailed:32,TelemetrySampledAndNotSent:33,TrackEventFailed:34,TrackExceptionFailed:35,TrackMetricFailed:36,TrackPVFailed:37,TrackPVFailedCalc:38,TrackTraceFailed:39,TransmissionFailed:40,FailedToSetStorageBuffer:41,FailedToRestoreStorageBuffer:42,InvalidBackendResponse:43,FailedToFixDepricatedValues:44,InvalidDurationValue:45,TelemetryEnvelopeInvalid:46,CreateEnvelopeError:47,CannotSerializeObject:48,CannotSerializeObjectNonSerializable:49,CircularReferenceDetected:50,ClearAuthContextFailed:51,ExceptionTruncated:52,IllegalCharsInName:53,ItemNotInArray:54,MaxAjaxPerPVExceeded:55,MessageTruncated:56,NameTooLong:57,SampleRateOutOfRange:58,SetAuthContextFailed:59,SetAuthContextFailedAccountName:60,StringValueTooLong:61,StartCalledMoreThanOnce:62,StopCalledWithoutStart:63,TelemetryInitializerFailed:64,TrackArgumentsNotSpecified:65,UrlTooLong:66,SessionStorageBufferFull:67,CannotAccessCookie:68,IdTooLong:69,InvalidEvent:70,FailedMonitorAjaxSetRequestHeader:71,SendBrowserInfoOnUserInit:72,PluginException:73,NotificationException:74,SnippetScriptLoadFailure:99,InvalidInstrumentationKey:100,CannotParseAiBlobValue:101,InvalidContentBlob:102,TrackPageActionEventFailed:103,FailedAddingCustomDefinedRequestContext:104,InMemoryStorageBufferFull:105}),Di=i({NotSet:0,Pii_DistinguishedName:1,Pii_GenericData:2,Pii_IPV4Address:3,Pii_IPv6Address:4,Pii_MailSubject:5,Pii_PhoneNumber:6,Pii_QueryString:7,Pii_SipAddress:8,Pii_SmtpAddress:9,Pii_Identity:10,Pii_Uri:11,Pii_Fqdn:12,Pii_IPV4AddressLegacy:13,CustomerContent_GenericContent:32}),Ui=i({Normal:1,CostDeferred:2,RealTime:3,Immediate:4}),ji=i({Unspecified:0,String:1,Int32:2,UInt32:3,Int64:4,UInt64:5,Double:6,Bool:7,Guid:8,DateTime:9}),Ri=i({Normal:1,Critical:2}),zi=i({NONE:0,ERROR:1,WARNING:2,INFORMATION:3}),G=O(G(G({},Li),i({AuthHandShakeError:501,AuthRedirectFail:502,BrowserCannotReadLocalStorage:503,BrowserCannotWriteLocalStorage:504,BrowserDoesNotSupportLocalStorage:505,CannotParseBiBlobValue:506,CannotParseDataAttribute:507,CVPluginNotAvailable:508,DroppedEvent:509,ErrorParsingAISessionCookie:510,ErrorProvidedChannels:511,FailedToGetCookies:512,FailedToInitializeCorrelationVector:513,FailedToInitializeSDK:514,InvalidContentBlob:515,InvalidCorrelationValue:516,SessionRenewalDateIsZero:517,SendPostOnCompleteFailure:518,PostResponseHandler:519,SDKNotInitialized:520}))),Vi="3.2.2",Bi="1DS-Web-JS-"+Vi,Hi="withCredentials",Ki=((s={})[0]=0,s[2]=6,s[1]=1,s[3]=7,s[4098]=6,s[4097]=1,s[4099]=7,s),qi=null,Wi=!!a(),s=!!nt();function Gi(n){return!(""===n||k(n))}function Ji(n){if(n){var e=n.indexOf("-");if(-1")+"."+wo;function y(n){var e=K();e&&e.QUnit&&console&&console.log("ESPromiseScheduler["+m+"] "+n)}function C(n){e&&e.warnToConsole("ESPromiseScheduler["+m+"] "+n)}wo++,U(No,this,function(n){var g=null,v=0;function p(n,e){for(var t=0;t=o&&!(n=r===i)){for(var u=0;u= searchLen && !(result = value === search)) { var pos = valLen - 1; for (var lp = searchLen - 1; lp >= 0; lp--) { if (value[pos] != search[lp]) { return false; } pos--; } result = true; } return result; } function strStartsWith(value, checkValue) { var result = false; if (value && checkValue && !(result = value === checkValue)) { result = _strStartsWith ? value[cStrStartsWith](checkValue) : _strStartsWithPoly(value, checkValue); } return result; } function _strStartsWithPoly(value, checkValue) { var result = false; var chkLen = checkValue ? checkValue.length : 0; if (value && chkLen && value.length >= chkLen && !(result = value === checkValue)) { for (var lp = 0; lp < chkLen; lp++) { if (value[lp] !== checkValue[lp]) { return false; } } result = true; } return result; } function strContains(value, search) { if (value && search) { return value.indexOf(search) !== -1; } return false; } function isDate(obj) { return !!(obj && _objToString.call(obj) === "[object Date]"); } var isArray = _isArray || _isArrayPoly; function _isArrayPoly(obj) { return !!(obj && _objToString.call(obj) === "[object Array]"); } function isError(obj) { return !!(obj && _objToString.call(obj) === "[object Error]"); } function isString(value) { return typeof value === "string"; } function isNumber(value) { return typeof value === "number"; } function isBoolean(value) { return typeof value === "boolean"; } function isPlainObject(value) { var result = false; if (value && typeof value === "object") { var proto = _objGetPrototypeOf$1 ? _objGetPrototypeOf$1(value) : _getObjProto$1(value); if (!proto) { result = true; } else { if (proto[strConstructor] && ObjHasOwnProperty.call(proto, strConstructor)) { proto = proto[strConstructor]; } result = typeof proto === strShimFunction && _fnToString.call(proto) === _objFunctionString; } } return result; } function toISOString(date) { if (date) { return _dataToISOString ? date[strToISOString]() : _toISOStringPoly(date); } } function _toISOStringPoly(date) { if (date && date.getUTCFullYear) { var pad = function (num) { var r = String(num); if (r.length === 1) { r = "0" + r; } return r; }; return date.getUTCFullYear() + "-" + pad(date.getUTCMonth() + 1) + "-" + pad(date.getUTCDate()) + "T" + pad(date.getUTCHours()) + ":" + pad(date.getUTCMinutes()) + ":" + pad(date.getUTCSeconds()) + "." + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5) + "Z"; } } function arrForEach(arr, callbackfn, thisArg) { var len = arr.length; try { for (var idx = 0; idx < len; idx++) { if (idx in arr) { if (callbackfn.call(thisArg || arr, arr[idx], idx, arr) === -1) { break; } } } } catch (e) { } } function arrIndexOf(arr, searchElement, fromIndex) { if (arr) { if (arr[strIndexOf]) { return arr[strIndexOf](searchElement, fromIndex); } var len = arr.length; var from = fromIndex || 0; try { for (var lp = Math.max(from >= 0 ? from : len - Math.abs(from), 0); lp < len; lp++) { if (lp in arr && arr[lp] === searchElement) { return lp; } } } catch (e) { } } return -1; } function arrMap(arr, callbackfn, thisArg) { var results; if (arr) { if (arr[strMap]) { return arr[strMap](callbackfn, thisArg); } var len = arr.length; var _this = thisArg || arr; results = new Array(len); try { for (var lp = 0; lp < len; lp++) { if (lp in arr) { results[lp] = callbackfn.call(_this, arr[lp], arr); } } } catch (e) { } } return results; } function arrReduce(arr, callbackfn, initialValue) { var value; if (arr) { if (arr[strReduce]) { return arr[strReduce](callbackfn, initialValue); } var len = arr.length; var lp = 0; if (arguments.length >= 3) { value = arguments[2]; } else { while (lp < len && !(lp in arr)) { lp++; } value = arr[lp++]; } while (lp < len) { if (lp in arr) { value = callbackfn(value, arr[lp], lp, arr); } lp++; } } return value; } function strTrim(str) { if (str) { str = (_strTrim && str[cStrTrim]) ? str[cStrTrim]() : (str.replace ? str.replace(/^\s+|\s+$/g, "") : str); } return str; } var _objKeysHasDontEnumBug = !({ toString: null }).propertyIsEnumerable("toString"); var _objKeysDontEnums = [ "toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor" ]; function objKeys(obj) { var objType = typeof obj; if (objType !== strShimFunction && (objType !== strShimObject || obj === null)) { throwTypeError("objKeys called on non-object"); } if (!_objKeysHasDontEnumBug && _objKeys) { return _objKeys(obj); } var result = []; for (var prop in obj) { if (obj && ObjHasOwnProperty.call(obj, prop)) { result.push(prop); } } if (_objKeysHasDontEnumBug) { var dontEnumsLength = _objKeysDontEnums.length; for (var lp = 0; lp < dontEnumsLength; lp++) { if (obj && ObjHasOwnProperty.call(obj, _objKeysDontEnums[lp])) { result.push(_objKeysDontEnums[lp]); } } } return result; } function objDefineAccessors(target, prop, getProp, setProp) { if (_objDefineProperty$1) { try { var descriptor = { enumerable: true, configurable: true }; if (getProp) { descriptor.get = getProp; } if (setProp) { descriptor.set = setProp; } _objDefineProperty$1(target, prop, descriptor); return true; } catch (e) { } } return false; } function _doNothing(value) { return value; } function deepFreeze(obj) { if (_objFreeze) { objForEachKey(obj, function (name, value) { if (isArray(value) || isObject(value)) { _objFreeze(value); } }); } return objFreeze(obj); } var objFreeze = _objFreeze || _doNothing; var objSeal = _objSeal || _doNothing; function dateNow() { var dt = Date; return dt.now ? dt.now() : new dt().getTime(); } function getExceptionName(object) { if (isError(object)) { return object.name; } return strEmpty; } function setValue(target, field, value, valChk, srcChk) { var theValue = value; if (target) { theValue = target[field]; if (theValue !== value && (!srcChk || srcChk(theValue)) && (!valChk || valChk(value))) { theValue = value; target[field] = theValue; } } return theValue; } function getSetValue(target, field, defValue) { var theValue; if (target) { theValue = target[field]; if (!theValue && isNullOrUndefined(theValue)) { theValue = !isUndefined(defValue) ? defValue : {}; target[field] = theValue; } } else { theValue = !isUndefined(defValue) ? defValue : {}; } return theValue; } function isNotTruthy(value) { return !value; } function isTruthy(value) { return !!value; } function throwError(message) { throw new Error(message); } function _createProxyFunction(source, funcName) { var srcFunc = null; var src = null; if (isFunction(source)) { srcFunc = source; } else { src = source; } return function () { var originalArguments = arguments; if (srcFunc) { src = srcFunc(); } if (src) { return src[funcName].apply(src, originalArguments); } }; } function proxyAssign(target, source, chkSet) { if (target && source && isObject(target) && isObject(source)) { var _loop_1 = function (field) { if (isString(field)) { var value = source[field]; if (isFunction(value)) { if (!chkSet || chkSet(field, true, source, target)) { target[field] = _createProxyFunction(source, field); } } else if (!chkSet || chkSet(field, false, source, target)) { if (hasOwnProperty(target, field)) { delete target[field]; } if (!objDefineAccessors(target, field, function () { return source[field]; }, function (theValue) { source[field] = theValue; })) { target[field] = value; } } } }; for (var field in source) { _loop_1(field); } } return target; } function proxyFunctionAs(target, name, source, theFunc, overwriteTarget) { if (target && name && source) { if (overwriteTarget !== false || isUndefined(target[name])) { target[name] = _createProxyFunction(source, theFunc); } } } function proxyFunctions(target, source, functionsToProxy, overwriteTarget) { if (target && source && isObject(target) && isArray(functionsToProxy)) { arrForEach(functionsToProxy, function (theFuncName) { if (isString(theFuncName)) { proxyFunctionAs(target, theFuncName, source, theFuncName, overwriteTarget); } }); } return target; } function optimizeObject(theObject) { if (theObject && ObjAssign) { theObject = ObjClass(ObjAssign({}, theObject)); } return theObject; } function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) { var theArgs = arguments; var extended = theArgs[0] || {}; var argLen = theArgs.length; var deep = false; var idx = 1; if (argLen > 0 && isBoolean(extended)) { deep = extended; extended = theArgs[idx] || {}; idx++; } if (!isObject(extended)) { extended = {}; } for (; idx < argLen; idx++) { var arg = theArgs[idx]; var isArgArray = isArray(arg); var isArgObj = isObject(arg); for (var prop in arg) { var propOk = (isArgArray && (prop in arg)) || (isArgObj && (ObjHasOwnProperty.call(arg, prop))); if (!propOk) { continue; } var newValue = arg[prop]; var isNewArray = void 0; if (deep && newValue && ((isNewArray = isArray(newValue)) || isPlainObject(newValue))) { var clone = extended[prop]; if (isNewArray) { if (!isArray(clone)) { clone = []; } } else if (!isPlainObject(clone)) { clone = {}; } newValue = objExtend(deep, clone, newValue); } if (newValue !== undefined) { extended[prop] = newValue; } } } return extended; } function createEnumStyle(values) { var enumClass = {}; objForEachKey(values, function (field, value) { enumClass[field] = value; enumClass[value] = field; }); return deepFreeze(enumClass); } var EventsDiscardedReason = createEnumStyle({ Unknown: 0 , NonRetryableStatus: 1 , InvalidEvent: 2 , SizeLimitExceeded: 3 , KillSwitch: 4 , QueueFull: 5 }); /*! * Microsoft Dynamic Proto Utility, 1.1.6 * Copyright (c) Microsoft and contributors. All rights reserved. */ var Constructor = 'constructor'; var Prototype = 'prototype'; var strFunction = 'function'; var DynInstFuncTable = '_dynInstFuncs'; var DynProxyTag = '_isDynProxy'; var DynClassName = '_dynClass'; var DynClassNamePrefix = '_dynCls$'; var DynInstChkTag = '_dynInstChk'; var DynAllowInstChkTag = DynInstChkTag; var DynProtoDefaultOptions = '_dfOpts'; var UnknownValue = '_unknown_'; var str__Proto = "__proto__"; var DynProtoBaseProto = "_dyn" + str__Proto; var DynProtoCurrent = "_dynInstProto"; var strUseBaseInst = 'useBaseInst'; var strSetInstFuncs = 'setInstFuncs'; var Obj = Object; var _objGetPrototypeOf = Obj["getPrototypeOf"]; var _objGetOwnProps = Obj["getOwnPropertyNames"]; var _dynamicNames = 0; function _hasOwnProperty(obj, prop) { return obj && Obj[Prototype].hasOwnProperty.call(obj, prop); } function _isObjectOrArrayPrototype(target) { return target && (target === Obj[Prototype] || target === Array[Prototype]); } function _isObjectArrayOrFunctionPrototype(target) { return _isObjectOrArrayPrototype(target) || target === Function[Prototype]; } function _getObjProto(target) { var newProto; if (target) { if (_objGetPrototypeOf) { return _objGetPrototypeOf(target); } var curProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null); newProto = target[DynProtoBaseProto] || curProto; if (!_hasOwnProperty(target, DynProtoBaseProto)) { delete target[DynProtoCurrent]; newProto = target[DynProtoBaseProto] = target[DynProtoCurrent] || target[DynProtoBaseProto]; target[DynProtoCurrent] = curProto; } } return newProto; } function _forEachProp(target, func) { var props = []; if (_objGetOwnProps) { props = _objGetOwnProps(target); } else { for (var name_1 in target) { if (typeof name_1 === "string" && _hasOwnProperty(target, name_1)) { props.push(name_1); } } } if (props && props.length > 0) { for (var lp = 0; lp < props.length; lp++) { func(props[lp]); } } } function _isDynamicCandidate(target, funcName, skipOwn) { return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName))); } function _throwTypeError(message) { throw new TypeError("DynamicProto: " + message); } function _getInstanceFuncs(thisTarget) { var instFuncs = {}; _forEachProp(thisTarget, function (name) { if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) { instFuncs[name] = thisTarget[name]; } }); return instFuncs; } function _hasVisited(values, value) { for (var lp = values.length - 1; lp >= 0; lp--) { if (values[lp] === value) { return true; } } return false; } function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) { function _instFuncProxy(target, funcHost, funcName) { var theFunc = funcHost[funcName]; if (theFunc[DynProxyTag] && useBaseInst) { var instFuncTable = target[DynInstFuncTable] || {}; if (instFuncTable[DynAllowInstChkTag] !== false) { theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc; } } return function () { return theFunc.apply(target, arguments); }; } var baseFuncs = {}; _forEachProp(instFuncs, function (name) { baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name); }); var baseProto = _getObjProto(classProto); var visited = []; while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) { _forEachProp(baseProto, function (name) { if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) { baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name); } }); visited.push(baseProto); baseProto = _getObjProto(baseProto); } return baseFuncs; } function _getInstFunc(target, funcName, proto, currentDynProtoProxy) { var instFunc = null; if (target && _hasOwnProperty(proto, DynClassName)) { var instFuncTable = target[DynInstFuncTable] || {}; instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName]; if (!instFunc) { _throwTypeError("Missing [" + funcName + "] " + strFunction); } if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) { var canAddInst = !_hasOwnProperty(target, funcName); var objProto = _getObjProto(target); var visited = []; while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) { var protoFunc = objProto[funcName]; if (protoFunc) { canAddInst = (protoFunc === currentDynProtoProxy); break; } visited.push(objProto); objProto = _getObjProto(objProto); } try { if (canAddInst) { target[funcName] = instFunc; } instFunc[DynInstChkTag] = 1; } catch (e) { instFuncTable[DynAllowInstChkTag] = false; } } } return instFunc; } function _getProtoFunc(funcName, proto, currentDynProtoProxy) { var protoFunc = proto[funcName]; if (protoFunc === currentDynProtoProxy) { protoFunc = _getObjProto(proto)[funcName]; } if (typeof protoFunc !== strFunction) { _throwTypeError("[" + funcName + "] is not a " + strFunction); } return protoFunc; } function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) { function _createDynamicPrototype(proto, funcName) { var dynProtoProxy = function () { var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy); return instFunc.apply(this, arguments); }; dynProtoProxy[DynProxyTag] = 1; return dynProtoProxy; } if (!_isObjectOrArrayPrototype(proto)) { var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {}; var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {}); if (instFuncTable[DynAllowInstChkTag] !== false) { instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc; } _forEachProp(target, function (name) { if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) { instFuncs_1[name] = target[name]; delete target[name]; if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) { proto[name] = _createDynamicPrototype(proto, name); } } }); } } function _checkPrototype(classProto, thisTarget) { if (_objGetPrototypeOf) { var visited = []; var thisProto = _getObjProto(thisTarget); while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) { if (thisProto === classProto) { return true; } visited.push(thisProto); thisProto = _getObjProto(thisProto); } return false; } return true; } function _getObjName(target, unknownValue) { if (_hasOwnProperty(target, Prototype)) { return target.name || unknownValue || UnknownValue; } return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue; } function dynamicProto(theClass, target, delegateFunc, options) { if (!_hasOwnProperty(theClass, Prototype)) { _throwTypeError("theClass is an invalid class definition."); } var classProto = theClass[Prototype]; if (!_checkPrototype(classProto, target)) { _throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]"); } var className = null; if (_hasOwnProperty(classProto, DynClassName)) { className = classProto[DynClassName]; } else { className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _dynamicNames; _dynamicNames++; classProto[DynClassName] = className; } var perfOptions = dynamicProto[DynProtoDefaultOptions]; var useBaseInst = !!perfOptions[strUseBaseInst]; if (useBaseInst && options && options[strUseBaseInst] !== undefined) { useBaseInst = !!options[strUseBaseInst]; } var instFuncs = _getInstanceFuncs(target); var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst); delegateFunc(target, baseFuncs); var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs]; if (setInstanceFunc && options) { setInstanceFunc = !!options[strSetInstFuncs]; } _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false); } var perfDefaults = { setInstFuncs: true, useBaseInst: true }; dynamicProto[DynProtoDefaultOptions] = perfDefaults; var strWindow = "window"; var strDocument = "document"; var strDocumentMode = "documentMode"; var strNavigator = "navigator"; var strHistory = "history"; var strLocation = "location"; var strConsole = "console"; var strPerformance = "performance"; var strJSON = "JSON"; var strCrypto = "crypto"; var strMsCrypto = "msCrypto"; var strReactNative = "ReactNative"; var strMsie = "msie"; var strTrident = "trident/"; var strXMLHttpRequest = "XMLHttpRequest"; var _isTrident = null; var _navUserAgentCheck = null; var _enableMocks = false; var _useXDomainRequest = null; var _beaconsSupported = null; function _hasProperty(theClass, property) { var supported = false; if (theClass) { try { supported = property in theClass; if (!supported) { var proto = theClass[strShimPrototype]; if (proto) { supported = property in proto; } } } catch (e) { } if (!supported) { try { var tmp = new theClass(); supported = !isUndefined(tmp[property]); } catch (e) { } } } return supported; } function setEnableEnvMocks(enabled) { _enableMocks = enabled; } function getGlobalInst(name) { var gbl = getGlobal(); if (gbl && gbl[name]) { return gbl[name]; } if (name === strWindow && hasWindow()) { return window; } return null; } function hasWindow() { return Boolean(typeof window === strShimObject && window); } function getWindow() { if (hasWindow()) { return window; } return getGlobalInst(strWindow); } function hasDocument() { return Boolean(typeof document === strShimObject && document); } function getDocument() { if (hasDocument()) { return document; } return getGlobalInst(strDocument); } function hasNavigator() { return Boolean(typeof navigator === strShimObject && navigator); } function getNavigator() { if (hasNavigator()) { return navigator; } return getGlobalInst(strNavigator); } function hasHistory() { return Boolean(typeof history === strShimObject && history); } function getHistory() { if (hasHistory()) { return history; } return getGlobalInst(strHistory); } function getLocation(checkForMock) { if (checkForMock && _enableMocks) { var mockLocation = getGlobalInst("__mockLocation"); if (mockLocation) { return mockLocation; } } if (typeof location === strShimObject && location) { return location; } return getGlobalInst(strLocation); } function getConsole() { if (typeof console !== strShimUndefined) { return console; } return getGlobalInst(strConsole); } function getPerformance() { return getGlobalInst(strPerformance); } function hasJSON() { return Boolean((typeof JSON === strShimObject && JSON) || getGlobalInst(strJSON) !== null); } function getJSON() { if (hasJSON()) { return JSON || getGlobalInst(strJSON); } return null; } function getCrypto() { return getGlobalInst(strCrypto); } function getMsCrypto() { return getGlobalInst(strMsCrypto); } function isReactNative() { var nav = getNavigator(); if (nav && nav.product) { return nav.product === strReactNative; } return false; } function isIE() { var nav = getNavigator(); if (nav && (nav.userAgent !== _navUserAgentCheck || _isTrident === null)) { _navUserAgentCheck = nav.userAgent; var userAgent = (_navUserAgentCheck || strEmpty).toLowerCase(); _isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident)); } return _isTrident; } function getIEVersion(userAgentStr) { if (userAgentStr === void 0) { userAgentStr = null; } if (!userAgentStr) { var navigator_1 = getNavigator() || {}; userAgentStr = navigator_1 ? (navigator_1.userAgent || strEmpty).toLowerCase() : strEmpty; } var ua = (userAgentStr || strEmpty).toLowerCase(); if (strContains(ua, strMsie)) { var doc = getDocument() || {}; return Math.max(parseInt(ua.split(strMsie)[1]), (doc[strDocumentMode] || 0)); } else if (strContains(ua, strTrident)) { var tridentVer = parseInt(ua.split(strTrident)[1]); if (tridentVer) { return tridentVer + 4; } } return null; } function dumpObj(object) { var objectTypeDump = Object[strShimPrototype].toString.call(object); var propertyValueDump = strEmpty; if (objectTypeDump === "[object Error]") { propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'"; } else if (hasJSON()) { propertyValueDump = getJSON().stringify(object); } return objectTypeDump + propertyValueDump; } function isBeaconsSupported() { if (_beaconsSupported === null) { _beaconsSupported = hasNavigator() && Boolean(getNavigator().sendBeacon); } return _beaconsSupported; } function isFetchSupported(withKeepAlive) { var isSupported = false; try { isSupported = !!getGlobalInst("fetch"); var request = getGlobalInst("Request"); if (isSupported && withKeepAlive && request) { isSupported = _hasProperty(request, "keepalive"); } } catch (e) { } return isSupported; } function useXDomainRequest() { if (_useXDomainRequest === null) { _useXDomainRequest = (typeof XDomainRequest !== strShimUndefined); if (_useXDomainRequest && isXhrSupported()) { _useXDomainRequest = _useXDomainRequest && !_hasProperty(getGlobalInst(strXMLHttpRequest), "withCredentials"); } } return _useXDomainRequest; } function isXhrSupported() { var isSupported = false; try { var xmlHttpRequest = getGlobalInst(strXMLHttpRequest); isSupported = !!xmlHttpRequest; } catch (e) { } return isSupported; } var listenerFuncs = ["eventsSent", "eventsDiscarded", "eventsSendRequest", "perfEvent"]; var _aiNamespace = null; var _debugListener; function _listenerProxyFunc(name, config) { return function () { var args = arguments; var dbgExt = getDebugExt(config); if (dbgExt) { var listener = dbgExt.listener; if (listener && listener[name]) { listener[name].apply(listener, args); } } }; } function _getExtensionNamespace() { var target = getGlobalInst("Microsoft"); if (target) { _aiNamespace = target["ApplicationInsights"]; } return _aiNamespace; } function getDebugExt(config) { var ns = _aiNamespace; if (!ns && config.disableDbgExt !== true) { ns = _aiNamespace || _getExtensionNamespace(); } return ns ? ns["ChromeDbgExt"] : null; } function getDebugListener(config) { if (!_debugListener) { _debugListener = {}; for (var lp = 0; lp < listenerFuncs.length; lp++) { _debugListener[listenerFuncs[lp]] = _listenerProxyFunc(listenerFuncs[lp], config); } } return _debugListener; } var AiNonUserActionablePrefix = "AI (Internal): "; var AiUserActionablePrefix = "AI: "; var AIInternalMessagePrefix = "AITR_"; var strErrorToConsole = "errorToConsole"; var strWarnToConsole = "warnToConsole"; function _sanitizeDiagnosticText(text) { if (text) { return "\"" + text.replace(/\"/g, strEmpty) + "\""; } return strEmpty; } function _logToConsole(func, message) { var theConsole = getConsole(); if (!!theConsole) { var logFunc = "log"; if (theConsole[func]) { logFunc = func; } if (isFunction(theConsole[logFunc])) { theConsole[logFunc](message); } } } var _InternalLogMessage = /** @class */ (function () { function _InternalLogMessage(msgId, msg, isUserAct, properties) { if (isUserAct === void 0) { isUserAct = false; } var _self = this; _self.messageId = msgId; _self.message = (isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) + msgId; var strProps = strEmpty; if (hasJSON()) { strProps = getJSON().stringify(properties); } var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : strEmpty) + (properties ? " props:" + _sanitizeDiagnosticText(strProps) : strEmpty); _self.message += diagnosticText; } _InternalLogMessage.dataType = "MessageData"; return _InternalLogMessage; }()); function safeGetLogger(core, config) { return (core || {}).logger || new DiagnosticLogger(config); } var DiagnosticLogger = /** @class */ (function () { function DiagnosticLogger(config) { this.identifier = "DiagnosticLogger"; this.queue = []; var _messageCount = 0; var _messageLogged = {}; dynamicProto(DiagnosticLogger, this, function (_self) { if (isNullOrUndefined(config)) { config = {}; } _self.consoleLoggingLevel = function () { return _getConfigValue("loggingLevelConsole", 0); }; _self.telemetryLoggingLevel = function () { return _getConfigValue("loggingLevelTelemetry", 1); }; _self.maxInternalMessageLimit = function () { return _getConfigValue("maxMessageLimit", 25); }; _self.enableDebugExceptions = function () { return _getConfigValue("enableDebugExceptions", false); }; _self.throwInternal = function (severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } var message = new _InternalLogMessage(msgId, msg, isUserAct, properties); if (_self.enableDebugExceptions()) { throw dumpObj(message); } else { var logFunc = severity === 1 ? strErrorToConsole : strWarnToConsole; if (!isUndefined(message.message)) { var logLevel = _self.consoleLoggingLevel(); if (isUserAct) { var messageKey = +message.messageId; if (!_messageLogged[messageKey] && logLevel >= severity) { _self[logFunc](message.message); _messageLogged[messageKey] = true; } } else { if (logLevel >= severity) { _self[logFunc](message.message); } } _self.logInternalMessage(severity, message); } else { _debugExtMsg("throw" + (severity === 1 ? "Critical" : "Warning"), message); } } }; _self.warnToConsole = function (message) { _logToConsole("warn", message); _debugExtMsg("warning", message); }; _self.errorToConsole = function (message) { _logToConsole("error", message); _debugExtMsg("error", message); }; _self.resetInternalMessageCount = function () { _messageCount = 0; _messageLogged = {}; }; _self.logInternalMessage = function (severity, message) { if (_areInternalMessagesThrottled()) { return; } var logMessage = true; var messageKey = AIInternalMessagePrefix + message.messageId; if (_messageLogged[messageKey]) { logMessage = false; } else { _messageLogged[messageKey] = true; } if (logMessage) { if (severity <= _self.telemetryLoggingLevel()) { _self.queue.push(message); _messageCount++; _debugExtMsg((severity === 1 ? "error" : "warn"), message); } if (_messageCount === _self.maxInternalMessageLimit()) { var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app."; var throttleMessage = new _InternalLogMessage(23 , throttleLimitMessage, false); _self.queue.push(throttleMessage); if (severity === 1 ) { _self.errorToConsole(throttleLimitMessage); } else { _self.warnToConsole(throttleLimitMessage); } } } }; function _getConfigValue(name, defValue) { var value = config[name]; if (!isNullOrUndefined(value)) { return value; } return defValue; } function _areInternalMessagesThrottled() { return _messageCount >= _self.maxInternalMessageLimit(); } function _debugExtMsg(name, data) { var dbgExt = getDebugExt(config); if (dbgExt && dbgExt.diagLog) { dbgExt.diagLog(name, data); } } }); } return DiagnosticLogger; }()); function _getLogger(logger) { return (logger || new DiagnosticLogger()); } function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } (logger || new DiagnosticLogger()).throwInternal(severity, msgId, msg, properties, isUserAct); } function _warnToConsole(logger, message) { _getLogger(logger).warnToConsole(message); } var strExecutionContextKey = "ctx"; var _defaultPerfManager = null; var PerfEvent = /** @class */ (function () { function PerfEvent(name, payloadDetails, isAsync) { var _self = this; var accessorDefined = false; _self.start = dateNow(); _self.name = name; _self.isAsync = isAsync; _self.isChildEvt = function () { return false; }; if (isFunction(payloadDetails)) { var theDetails_1; accessorDefined = objDefineAccessors(_self, "payload", function () { if (!theDetails_1 && isFunction(payloadDetails)) { theDetails_1 = payloadDetails(); payloadDetails = null; } return theDetails_1; }); } _self.getCtx = function (key) { if (key) { if (key === PerfEvent.ParentContextKey || key === PerfEvent.ChildrenContextKey) { return _self[key]; } return (_self[strExecutionContextKey] || {})[key]; } return null; }; _self.setCtx = function (key, value) { if (key) { if (key === PerfEvent.ParentContextKey) { if (!_self[key]) { _self.isChildEvt = function () { return true; }; } _self[key] = value; } else if (key === PerfEvent.ChildrenContextKey) { _self[key] = value; } else { var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {}; ctx[key] = value; } } }; _self.complete = function () { var childTime = 0; var childEvts = _self.getCtx(PerfEvent.ChildrenContextKey); if (isArray(childEvts)) { for (var lp = 0; lp < childEvts.length; lp++) { var childEvt = childEvts[lp]; if (childEvt) { childTime += childEvt.time; } } } _self.time = dateNow() - _self.start; _self.exTime = _self.time - childTime; _self.complete = function () { }; if (!accessorDefined && isFunction(payloadDetails)) { _self.payload = payloadDetails(); } }; } PerfEvent.ParentContextKey = "parent"; PerfEvent.ChildrenContextKey = "childEvts"; return PerfEvent; }()); var PerfManager = /** @class */ (function () { function PerfManager(manager) { this.ctx = {}; dynamicProto(PerfManager, this, function (_self) { _self.create = function (src, payloadDetails, isAsync) { return new PerfEvent(src, payloadDetails, isAsync); }; _self.fire = function (perfEvent) { if (perfEvent) { perfEvent.complete(); if (manager && isFunction(manager.perfEvent)) { manager.perfEvent(perfEvent); } } }; _self.setCtx = function (key, value) { if (key) { var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {}; ctx[key] = value; } }; _self.getCtx = function (key) { return (_self[strExecutionContextKey] || {})[key]; }; }); } return PerfManager; }()); var doPerfActiveKey = "CoreUtils.doPerf"; function doPerf(mgrSource, getSource, func, details, isAsync) { if (mgrSource) { var perfMgr = mgrSource; if (isFunction(perfMgr["getPerfMgr"])) { perfMgr = perfMgr["getPerfMgr"](); } if (perfMgr) { var perfEvt = void 0; var currentActive = perfMgr.getCtx(doPerfActiveKey); try { perfEvt = perfMgr.create(getSource(), details, isAsync); if (perfEvt) { if (currentActive && perfEvt.setCtx) { perfEvt.setCtx(PerfEvent.ParentContextKey, currentActive); if (currentActive.getCtx && currentActive.setCtx) { var children = currentActive.getCtx(PerfEvent.ChildrenContextKey); if (!children) { children = []; currentActive.setCtx(PerfEvent.ChildrenContextKey, children); } children.push(perfEvt); } } perfMgr.setCtx(doPerfActiveKey, perfEvt); return func(perfEvt); } } catch (ex) { if (perfEvt && perfEvt.setCtx) { perfEvt.setCtx("exception", ex); } } finally { if (perfEvt) { perfMgr.fire(perfEvt); } perfMgr.setCtx(doPerfActiveKey, currentActive); } } } return func(); } function getGblPerfMgr() { return _defaultPerfManager; } var UInt32Mask = 0x100000000; var MaxUInt32 = 0xffffffff; var _mwcSeeded = false; var _mwcW = 123456789; var _mwcZ = 987654321; function _mwcSeed(seedValue) { if (seedValue < 0) { seedValue >>>= 0; } _mwcW = (123456789 + seedValue) & MaxUInt32; _mwcZ = (987654321 - seedValue) & MaxUInt32; _mwcSeeded = true; } function _autoSeedMwc() { try { var now = dateNow() & 0x7fffffff; _mwcSeed(((Math.random() * UInt32Mask) ^ now) + now); } catch (e) { } } function randomValue(maxValue) { if (maxValue > 0) { return Math.floor((random32() / MaxUInt32) * (maxValue + 1)) >>> 0; } return 0; } function random32(signed) { var value = 0; var c = getCrypto() || getMsCrypto(); if (c && c.getRandomValues) { value = c.getRandomValues(new Uint32Array(1))[0] & MaxUInt32; } if (value === 0 && isIE()) { if (!_mwcSeeded) { _autoSeedMwc(); } value = mwcRandom32() & MaxUInt32; } if (value === 0) { value = Math.floor((UInt32Mask * Math.random()) | 0); } if (!signed) { value >>>= 0; } return value; } function mwcRandomSeed(value) { if (!value) { _autoSeedMwc(); } else { _mwcSeed(value); } } function mwcRandom32(signed) { _mwcZ = (36969 * (_mwcZ & 0xFFFF) + (_mwcZ >> 16)) & MaxUInt32; _mwcW = (18000 * (_mwcW & 0xFFFF) + (_mwcW >> 16)) & MaxUInt32; var value = (((_mwcZ << 16) + (_mwcW & 0xFFFF)) >>> 0) & MaxUInt32 | 0; if (!signed) { value >>>= 0; } return value; } function newId(maxLength) { if (maxLength === void 0) { maxLength = 22; } var base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; var number = random32() >>> 0; var chars = 0; var result = strEmpty; while (result.length < maxLength) { chars++; result += base64chars.charAt(number & 0x3F); number >>>= 6; if (chars === 5) { number = (((random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0; chars = 0; } } return result; } var _objDefineProperty = ObjDefineProperty; var version = "2.8.3"; var instanceName = "." + newId(6); var _dataUid = 0; function _createAccessor(target, prop, value) { if (_objDefineProperty) { try { _objDefineProperty(target, prop, { value: value, enumerable: false, configurable: true }); return true; } catch (e) { } } return false; } function _canAcceptData(target) { return target.nodeType === 1 || target.nodeType === 9 || !(+target.nodeType); } function _getCache(data, target) { var theCache = target[data.id]; if (!theCache) { theCache = {}; try { if (_canAcceptData(target)) { if (!_createAccessor(target, data.id, theCache)) { target[data.id] = theCache; } } } catch (e) { } } return theCache; } function createUniqueNamespace(name, includeVersion) { if (includeVersion === void 0) { includeVersion = false; } return normalizeJsName(name + (_dataUid++) + (includeVersion ? "." + version : "") + instanceName); } function createElmNodeData(name) { var data = { id: createUniqueNamespace("_aiData-" + (name || "") + "." + version), accept: function (target) { return _canAcceptData(target); }, get: function (target, name, defValue, addDefault) { var theCache = target[data.id]; if (!theCache) { if (addDefault) { theCache = _getCache(data, target); theCache[normalizeJsName(name)] = defValue; } return defValue; } return theCache[normalizeJsName(name)]; }, kill: function (target, name) { if (target && target[name]) { try { delete target[name]; } catch (e) { } } } }; return data; } var pluginStateData = createElmNodeData("plugin"); function _getPluginState(plugin) { return pluginStateData.get(plugin, "state", {}, true); } function initializePlugins(processContext, extensions) { var initPlugins = []; var lastPlugin = null; var proxy = processContext.getNext(); var pluginState; while (proxy) { var thePlugin = proxy.getPlugin(); if (thePlugin) { if (lastPlugin && isFunction(lastPlugin[strSetNextPlugin]) && isFunction(thePlugin[strProcessTelemetry])) { lastPlugin[strSetNextPlugin](thePlugin); } var isInitialized = false; if (isFunction(thePlugin[strIsInitialized])) { isInitialized = thePlugin[strIsInitialized](); } else { pluginState = _getPluginState(thePlugin); isInitialized = pluginState[strIsInitialized]; } if (!isInitialized) { initPlugins.push(thePlugin); } lastPlugin = thePlugin; proxy = proxy.getNext(); } } arrForEach(initPlugins, function (thePlugin) { var core = processContext.core(); thePlugin.initialize(processContext.getCfg(), core, extensions, processContext.getNext()); pluginState = _getPluginState(thePlugin); if (!thePlugin[strCore] && !pluginState[strCore]) { pluginState[strCore] = core; } pluginState[strIsInitialized] = true; delete pluginState[strTeardown]; }); } function sortPlugins(plugins) { return plugins.sort(function (extA, extB) { var result = 0; var bHasProcess = isFunction(extB[strProcessTelemetry]); if (isFunction(extA[strProcessTelemetry])) { result = bHasProcess ? extA[strPriority] - extB[strPriority] : 1; } else if (bHasProcess) { result = -1; } return result; }); } var strTelemetryPluginChain = "TelemetryPluginChain"; var strHasRunFlags = "_hasRun"; var strGetTelCtx = "_getTelCtx"; var _chainId = 0; function _getNextProxyStart(proxy, core, startAt) { while (proxy) { if (proxy.getPlugin() === startAt) { return proxy; } proxy = proxy.getNext(); } return createTelemetryProxyChain([startAt], core.config || {}, core); } function _createInternalContext(telemetryChain, config, core, startAt) { var _nextProxy = null; var _onComplete = []; if (startAt !== null) { _nextProxy = startAt ? _getNextProxyStart(telemetryChain, core, startAt) : telemetryChain; } var context = { _next: _moveNext, ctx: { core: function () { return core; }, diagLog: function () { return safeGetLogger(core, config); }, getCfg: function () { return config; }, getExtCfg: _getExtCfg, getConfig: _getConfig, hasNext: function () { return !!_nextProxy; }, getNext: function () { return _nextProxy; }, setNext: function (nextPlugin) { _nextProxy = nextPlugin; }, iterate: _iterateChain, onComplete: _addOnComplete } }; function _addOnComplete(onComplete, that) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } if (onComplete) { _onComplete.push({ func: onComplete, self: !isUndefined(that) ? that : context.ctx, args: args }); } } function _moveNext() { var nextProxy = _nextProxy; _nextProxy = nextProxy ? nextProxy.getNext() : null; if (!nextProxy) { var onComplete = _onComplete; if (onComplete && onComplete.length > 0) { arrForEach(onComplete, function (completeDetails) { try { completeDetails.func.call(completeDetails.self, completeDetails.args); } catch (e) { _throwInternal(core.logger, 2 , 73 , "Unexpected Exception during onComplete - " + dumpObj(e)); } }); _onComplete = []; } } return nextProxy; } function _getExtCfg(identifier, defaultValue, mergeDefault) { if (defaultValue === void 0) { defaultValue = {}; } if (mergeDefault === void 0) { mergeDefault = 0 ; } var theConfig; if (config) { var extConfig = config.extensionConfig; if (extConfig && identifier) { theConfig = extConfig[identifier]; } } if (!theConfig) { theConfig = defaultValue; } else if (isObject(defaultValue)) { if (mergeDefault !== 0 ) { var newConfig_1 = objExtend(true, defaultValue, theConfig); if (config && mergeDefault === 2 ) { objForEachKey(defaultValue, function (field) { if (isNullOrUndefined(newConfig_1[field])) { var cfgValue = config[field]; if (!isNullOrUndefined(cfgValue)) { newConfig_1[field] = cfgValue; } } }); } theConfig = newConfig_1; } } return theConfig; } function _getConfig(identifier, field, defaultValue) { if (defaultValue === void 0) { defaultValue = false; } var theValue; var extConfig = _getExtCfg(identifier, null); if (extConfig && !isNullOrUndefined(extConfig[field])) { theValue = extConfig[field]; } else if (config && !isNullOrUndefined(config[field])) { theValue = config[field]; } return !isNullOrUndefined(theValue) ? theValue : defaultValue; } function _iterateChain(cb) { var nextPlugin; while (!!(nextPlugin = context._next())) { var plugin = nextPlugin.getPlugin(); if (plugin) { cb(plugin); } } } return context; } function createProcessTelemetryContext(telemetryChain, config, core, startAt) { var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(env) { var nextPlugin = internalContext._next(); nextPlugin && nextPlugin.processTelemetry(env, context); return !nextPlugin; } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryContext(plugins || context.getNext(), config, core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } function createProcessTelemetryUnloadContext(telemetryChain, core, startAt) { var config = core.config || {}; var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(unloadState) { var nextPlugin = internalContext._next(); nextPlugin && nextPlugin.unload(context, unloadState); return !nextPlugin; } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryUnloadContext(plugins || context.getNext(), core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } function createProcessTelemetryUpdateContext(telemetryChain, core, startAt) { var config = core.config || {}; var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(updateState) { return context.iterate(function (plugin) { if (isFunction(plugin.update)) { plugin.update(context, updateState); } }); } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryUpdateContext(plugins || context.getNext(), core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } function createTelemetryProxyChain(plugins, config, core, startAt) { var firstProxy = null; var add = startAt ? false : true; if (isArray(plugins) && plugins.length > 0) { var lastProxy_1 = null; arrForEach(plugins, function (thePlugin) { if (!add && startAt === thePlugin) { add = true; } if (add && thePlugin && isFunction(thePlugin.processTelemetry)) { var newProxy = createTelemetryPluginProxy(thePlugin, config, core); if (!firstProxy) { firstProxy = newProxy; } if (lastProxy_1) { lastProxy_1._setNext(newProxy); } lastProxy_1 = newProxy; } }); } if (startAt && !firstProxy) { return createTelemetryProxyChain([startAt], config, core); } return firstProxy; } function createTelemetryPluginProxy(plugin, config, core) { var nextProxy = null; var hasProcessTelemetry = isFunction(plugin.processTelemetry); var hasSetNext = isFunction(plugin.setNextPlugin); var chainId; if (plugin) { chainId = plugin.identifier + "-" + plugin.priority + "-" + _chainId++; } else { chainId = "Unknown-0-" + _chainId++; } var proxyChain = { getPlugin: function () { return plugin; }, getNext: function () { return nextProxy; }, processTelemetry: _processTelemetry, unload: _unloadPlugin, update: _updatePlugin, _id: chainId, _setNext: function (nextPlugin) { nextProxy = nextPlugin; } }; function _getTelCtx() { var itemCtx; if (plugin && isFunction(plugin[strGetTelCtx])) { itemCtx = plugin[strGetTelCtx](); } if (!itemCtx) { itemCtx = createProcessTelemetryContext(proxyChain, config, core); } return itemCtx; } function _processChain(itemCtx, processPluginFn, name, details, isAsync) { var hasRun = false; var identifier = plugin ? plugin.identifier : strTelemetryPluginChain; var hasRunContext = itemCtx[strHasRunFlags]; if (!hasRunContext) { hasRunContext = itemCtx[strHasRunFlags] = {}; } itemCtx.setNext(nextProxy); if (plugin) { doPerf(itemCtx[strCore](), function () { return identifier + ":" + name; }, function () { hasRunContext[chainId] = true; try { var nextId = nextProxy ? nextProxy._id : strEmpty; if (nextId) { hasRunContext[nextId] = false; } hasRun = processPluginFn(itemCtx); } catch (error) { var hasNextRun = nextProxy ? hasRunContext[nextProxy._id] : true; if (hasNextRun) { hasRun = true; } if (!nextProxy || !hasNextRun) { _throwInternal(itemCtx.diagLog(), 1 , 73 , "Plugin [" + identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext)); } } }, details, isAsync); } return hasRun; } function _processTelemetry(env, itemCtx) { itemCtx = itemCtx || _getTelCtx(); function _callProcessTelemetry(itemCtx) { if (!plugin || !hasProcessTelemetry) { return false; } var pluginState = _getPluginState(plugin); if (pluginState.teardown || pluginState[strDisabled]) { return false; } if (hasSetNext) { plugin.setNextPlugin(nextProxy); } plugin.processTelemetry(env, itemCtx); return true; } if (!_processChain(itemCtx, _callProcessTelemetry, "processTelemetry", function () { return ({ item: env }); }, !(env.sync))) { itemCtx.processNext(env); } } function _unloadPlugin(unloadCtx, unloadState) { function _callTeardown() { var hasRun = false; if (plugin) { var pluginState = _getPluginState(plugin); var pluginCore = plugin[strCore] || pluginState.core; if (plugin && (!pluginCore || pluginCore === unloadCtx[strCore]()) && !pluginState[strTeardown]) { pluginState[strCore] = null; pluginState[strTeardown] = true; pluginState[strIsInitialized] = false; if (plugin[strTeardown] && plugin[strTeardown](unloadCtx, unloadState) === true) { hasRun = true; } } } return hasRun; } if (!_processChain(unloadCtx, _callTeardown, "unload", function () { }, unloadState.isAsync)) { unloadCtx.processNext(unloadState); } } function _updatePlugin(updateCtx, updateState) { function _callUpdate() { var hasRun = false; if (plugin) { var pluginState = _getPluginState(plugin); var pluginCore = plugin[strCore] || pluginState.core; if (plugin && (!pluginCore || pluginCore === updateCtx[strCore]()) && !pluginState[strTeardown]) { if (plugin[strUpdate] && plugin[strUpdate](updateCtx, updateState) === true) { hasRun = true; } } } return hasRun; } if (!_processChain(updateCtx, _callUpdate, "update", function () { }, false)) { updateCtx.processNext(updateState); } } return objFreeze(proxyChain); } var ProcessTelemetryContext = /** @class */ (function () { function ProcessTelemetryContext(pluginChain, config, core, startAt) { var _self = this; var context = createProcessTelemetryContext(pluginChain, config, core, startAt); proxyFunctions(_self, context, objKeys(context)); } return ProcessTelemetryContext; }()); var strToGMTString = "toGMTString"; var strToUTCString = "toUTCString"; var strCookie = "cookie"; var strExpires = "expires"; var strEnabled = "enabled"; var strIsCookieUseDisabled = "isCookieUseDisabled"; var strDisableCookiesUsage = "disableCookiesUsage"; var strConfigCookieMgr = "_ckMgr"; var _supportsCookies = null; var _allowUaSameSite = null; var _parsedCookieValue = null; var _doc = getDocument(); var _cookieCache = {}; var _globalCookieConfig = {}; function _gblCookieMgr(config, logger) { var inst = createCookieMgr[strConfigCookieMgr] || _globalCookieConfig[strConfigCookieMgr]; if (!inst) { inst = createCookieMgr[strConfigCookieMgr] = createCookieMgr(config, logger); _globalCookieConfig[strConfigCookieMgr] = inst; } return inst; } function _isMgrEnabled(cookieMgr) { if (cookieMgr) { return cookieMgr.isEnabled(); } return true; } function _createCookieMgrConfig(rootConfig) { var cookieMgrCfg = rootConfig.cookieCfg = rootConfig.cookieCfg || {}; setValue(cookieMgrCfg, "domain", rootConfig.cookieDomain, isNotNullOrUndefined, isNullOrUndefined); setValue(cookieMgrCfg, "path", rootConfig.cookiePath || "/", null, isNullOrUndefined); if (isNullOrUndefined(cookieMgrCfg[strEnabled])) { var cookieEnabled = void 0; if (!isUndefined(rootConfig[strIsCookieUseDisabled])) { cookieEnabled = !rootConfig[strIsCookieUseDisabled]; } if (!isUndefined(rootConfig[strDisableCookiesUsage])) { cookieEnabled = !rootConfig[strDisableCookiesUsage]; } cookieMgrCfg[strEnabled] = cookieEnabled; } return cookieMgrCfg; } function safeGetCookieMgr(core, config) { var cookieMgr; if (core) { cookieMgr = core.getCookieMgr(); } else if (config) { var cookieCfg = config.cookieCfg; if (cookieCfg[strConfigCookieMgr]) { cookieMgr = cookieCfg[strConfigCookieMgr]; } else { cookieMgr = createCookieMgr(config); } } if (!cookieMgr) { cookieMgr = _gblCookieMgr(config, (core || {}).logger); } return cookieMgr; } function createCookieMgr(rootConfig, logger) { var cookieMgrConfig = _createCookieMgrConfig(rootConfig || _globalCookieConfig); var _path = cookieMgrConfig.path || "/"; var _domain = cookieMgrConfig.domain; var _enabled = cookieMgrConfig[strEnabled] !== false; var cookieMgr = { isEnabled: function () { var enabled = _enabled && areCookiesSupported(logger); var gblManager = _globalCookieConfig[strConfigCookieMgr]; if (enabled && gblManager && cookieMgr !== gblManager) { enabled = _isMgrEnabled(gblManager); } return enabled; }, setEnabled: function (value) { _enabled = value !== false; }, set: function (name, value, maxAgeSec, domain, path) { var result = false; if (_isMgrEnabled(cookieMgr)) { var values = {}; var theValue = strTrim(value || strEmpty); var idx = theValue.indexOf(";"); if (idx !== -1) { theValue = strTrim(value.substring(0, idx)); values = _extractParts(value.substring(idx + 1)); } setValue(values, "domain", domain || _domain, isTruthy, isUndefined); if (!isNullOrUndefined(maxAgeSec)) { var _isIE = isIE(); if (isUndefined(values[strExpires])) { var nowMs = dateNow(); var expireMs = nowMs + (maxAgeSec * 1000); if (expireMs > 0) { var expiry = new Date(); expiry.setTime(expireMs); setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || strEmpty, isTruthy); } } if (!_isIE) { setValue(values, "max-age", strEmpty + maxAgeSec, null, isUndefined); } } var location_1 = getLocation(); if (location_1 && location_1.protocol === "https:") { setValue(values, "secure", null, null, isUndefined); if (_allowUaSameSite === null) { _allowUaSameSite = !uaDisallowsSameSiteNone((getNavigator() || {}).userAgent); } if (_allowUaSameSite) { setValue(values, "SameSite", "None", null, isUndefined); } } setValue(values, "path", path || _path, null, isUndefined); var setCookieFn = cookieMgrConfig.setCookie || _setCookieValue; setCookieFn(name, _formatCookieValue(theValue, values)); result = true; } return result; }, get: function (name) { var value = strEmpty; if (_isMgrEnabled(cookieMgr)) { value = (cookieMgrConfig.getCookie || _getCookieValue)(name); } return value; }, del: function (name, path) { var result = false; if (_isMgrEnabled(cookieMgr)) { result = cookieMgr.purge(name, path); } return result; }, purge: function (name, path) { var _a; var result = false; if (areCookiesSupported(logger)) { var values = (_a = {}, _a["path"] = path ? path : "/", _a[strExpires] = "Thu, 01 Jan 1970 00:00:01 GMT", _a); if (!isIE()) { values["max-age"] = "0"; } var delCookie = cookieMgrConfig.delCookie || _setCookieValue; delCookie(name, _formatCookieValue(strEmpty, values)); result = true; } return result; } }; cookieMgr[strConfigCookieMgr] = cookieMgr; return cookieMgr; } function areCookiesSupported(logger) { if (_supportsCookies === null) { _supportsCookies = false; try { var doc = _doc || {}; _supportsCookies = doc[strCookie] !== undefined; } catch (e) { _throwInternal(logger, 2 , 68 , "Cannot access document.cookie - " + getExceptionName(e), { exception: dumpObj(e) }); } } return _supportsCookies; } function _extractParts(theValue) { var values = {}; if (theValue && theValue.length) { var parts = strTrim(theValue).split(";"); arrForEach(parts, function (thePart) { thePart = strTrim(thePart || strEmpty); if (thePart) { var idx = thePart.indexOf("="); if (idx === -1) { values[thePart] = null; } else { values[strTrim(thePart.substring(0, idx))] = strTrim(thePart.substring(idx + 1)); } } }); } return values; } function _formatDate(theDate, func) { if (isFunction(theDate[func])) { return theDate[func](); } return null; } function _formatCookieValue(value, values) { var cookieValue = value || strEmpty; objForEachKey(values, function (name, theValue) { cookieValue += "; " + name + (!isNullOrUndefined(theValue) ? "=" + theValue : strEmpty); }); return cookieValue; } function _getCookieValue(name) { var cookieValue = strEmpty; if (_doc) { var theCookie = _doc[strCookie] || strEmpty; if (_parsedCookieValue !== theCookie) { _cookieCache = _extractParts(theCookie); _parsedCookieValue = theCookie; } cookieValue = strTrim(_cookieCache[name] || strEmpty); } return cookieValue; } function _setCookieValue(name, cookieValue) { if (_doc) { _doc[strCookie] = name + "=" + cookieValue; } } function uaDisallowsSameSiteNone(userAgent) { if (!isString(userAgent)) { return false; } if (strContains(userAgent, "CPU iPhone OS 12") || strContains(userAgent, "iPad; CPU OS 12")) { return true; } if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strContains(userAgent, "Version/") && strContains(userAgent, "Safari")) { return true; } if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strEndsWith(userAgent, "AppleWebKit/605.1.15 (KHTML, like Gecko)")) { return true; } if (strContains(userAgent, "Chrome/5") || strContains(userAgent, "Chrome/6")) { return true; } if (strContains(userAgent, "UnrealEngine") && !strContains(userAgent, "Chrome")) { return true; } if (strContains(userAgent, "UCBrowser/12") || strContains(userAgent, "UCBrowser/11")) { return true; } return false; } var strIKey = "iKey"; var strExtensionConfig = "extensionConfig"; var ChannelControllerPriority = 500; var ChannelValidationMessage = "Channel has invalid priority - "; function _addChannelQueue(channelQueue, queue, config, core) { if (queue && isArray(queue) && queue.length > 0) { queue = queue.sort(function (a, b) { return a.priority - b.priority; }); arrForEach(queue, function (queueItem) { if (queueItem.priority < ChannelControllerPriority) { throwError(ChannelValidationMessage + queueItem.identifier); } }); channelQueue.push({ queue: objFreeze(queue), chain: createTelemetryProxyChain(queue, config, core) }); } } function createChannelControllerPlugin(channelQueue, core) { var _a; function _getTelCtx() { return createProcessTelemetryContext(null, core.config, core, null); } function _processChannelQueue(theChannels, itemCtx, processFn, onComplete) { var waiting = theChannels ? (theChannels.length + 1) : 1; function _runChainOnComplete() { waiting--; if (waiting === 0) { onComplete && onComplete(); onComplete = null; } } if (waiting > 0) { arrForEach(theChannels, function (channels) { if (channels && channels.queue.length > 0) { var channelChain = channels.chain; var chainCtx = itemCtx.createNew(channelChain); chainCtx.onComplete(_runChainOnComplete); processFn(chainCtx); } else { waiting--; } }); } _runChainOnComplete(); } function _doUpdate(updateCtx, updateState) { var theUpdateState = updateState || { reason: 0 }; _processChannelQueue(channelQueue, updateCtx, function (chainCtx) { chainCtx[strProcessNext](theUpdateState); }, function () { updateCtx[strProcessNext](theUpdateState); }); return true; } function _doTeardown(unloadCtx, unloadState) { var theUnloadState = unloadState || { reason: 0 , isAsync: false }; _processChannelQueue(channelQueue, unloadCtx, function (chainCtx) { chainCtx[strProcessNext](theUnloadState); }, function () { unloadCtx[strProcessNext](theUnloadState); isInitialized = false; }); return true; } function _getChannel(pluginIdentifier) { var thePlugin = null; if (channelQueue && channelQueue.length > 0) { arrForEach(channelQueue, function (channels) { if (channels && channels.queue.length > 0) { arrForEach(channels.queue, function (ext) { if (ext.identifier === pluginIdentifier) { thePlugin = ext; return -1; } }); if (thePlugin) { return -1; } } }); } return thePlugin; } var isInitialized = false; var channelController = (_a = { identifier: "ChannelControllerPlugin", priority: ChannelControllerPriority, initialize: function (config, core, extensions, pluginChain) { isInitialized = true; arrForEach(channelQueue, function (channels) { if (channels && channels.queue.length > 0) { initializePlugins(createProcessTelemetryContext(channels.chain, config, core), extensions); } }); }, isInitialized: function () { return isInitialized; }, processTelemetry: function (item, itemCtx) { _processChannelQueue(channelQueue, itemCtx || _getTelCtx(), function (chainCtx) { chainCtx[strProcessNext](item); }, function () { itemCtx[strProcessNext](item); }); }, update: _doUpdate }, _a[strPause] = function () { _processChannelQueue(channelQueue, _getTelCtx(), function (chainCtx) { chainCtx.iterate(function (plugin) { plugin[strPause] && plugin[strPause](); }); }, null); }, _a[strResume] = function () { _processChannelQueue(channelQueue, _getTelCtx(), function (chainCtx) { chainCtx.iterate(function (plugin) { plugin[strResume] && plugin[strResume](); }); }, null); }, _a[strTeardown] = _doTeardown, _a.getChannel = _getChannel, _a.flush = function (isAsync, callBack, sendReason, cbTimeout) { var waiting = 1; var doneIterating = false; var cbTimer = null; cbTimeout = cbTimeout || 5000; function doCallback() { waiting--; if (doneIterating && waiting === 0) { if (cbTimer) { clearTimeout(cbTimer); cbTimer = null; } callBack && callBack(doneIterating); callBack = null; } } _processChannelQueue(channelQueue, _getTelCtx(), function (chainCtx) { chainCtx.iterate(function (plugin) { if (plugin.flush) { waiting++; var handled_1 = false; if (!plugin.flush(isAsync, function () { handled_1 = true; doCallback(); }, sendReason)) { if (!handled_1) { if (isAsync && cbTimer == null) { cbTimer = setTimeout(function () { cbTimer = null; doCallback(); }, cbTimeout); } else { doCallback(); } } } } }); }, function () { doneIterating = true; doCallback(); }); return true; }, _a._setQueue = function (queue) { channelQueue = queue; }, _a); return channelController; } function createChannelQueues(channels, extensions, config, core) { var channelQueue = []; if (channels) { arrForEach(channels, function (queue) { return _addChannelQueue(channelQueue, queue, config, core); }); } if (extensions) { var extensionQueue_1 = []; arrForEach(extensions, function (plugin) { if (plugin.priority > ChannelControllerPriority) { extensionQueue_1.push(plugin); } }); _addChannelQueue(channelQueue, extensionQueue_1, config, core); } return channelQueue; } function createUnloadHandlerContainer() { var handlers = []; function _addHandler(handler) { if (handler) { handlers.push(handler); } } function _runHandlers(unloadCtx, unloadState) { arrForEach(handlers, function (handler) { try { handler(unloadCtx, unloadState); } catch (e) { _throwInternal(unloadCtx.diagLog(), 2 , 73 , "Unexpected error calling unload handler - " + dumpObj(e)); } }); handlers = []; } return { add: _addHandler, run: _runHandlers }; } var strGetPlugin = "getPlugin"; var BaseTelemetryPlugin = /** @class */ (function () { function BaseTelemetryPlugin() { var _self = this; var _isinitialized; var _rootCtx; var _nextPlugin; var _unloadHandlerContainer; var _hooks; _initDefaults(); dynamicProto(BaseTelemetryPlugin, _self, function (_self) { _self.initialize = function (config, core, extensions, pluginChain) { _setDefaults(config, core, pluginChain); _isinitialized = true; }; _self.teardown = function (unloadCtx, unloadState) { var core = _self.core; if (!core || (unloadCtx && core !== unloadCtx.core())) { return; } var result; var unloadDone = false; var theUnloadCtx = unloadCtx || createProcessTelemetryUnloadContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin); var theUnloadState = unloadState || { reason: 0 , isAsync: false }; function _unloadCallback() { if (!unloadDone) { unloadDone = true; _unloadHandlerContainer.run(theUnloadCtx, unloadState); arrForEach(_hooks, function (fn) { fn.rm(); }); _hooks = []; if (result === true) { theUnloadCtx.processNext(theUnloadState); } _initDefaults(); } } if (!_self[strDoTeardown] || _self[strDoTeardown](theUnloadCtx, theUnloadState, _unloadCallback) !== true) { _unloadCallback(); } else { result = true; } return result; }; _self.update = function (updateCtx, updateState) { var core = _self.core; if (!core || (updateCtx && core !== updateCtx.core())) { return; } var result; var updateDone = false; var theUpdateCtx = updateCtx || createProcessTelemetryUpdateContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin); var theUpdateState = updateState || { reason: 0 }; function _updateCallback() { if (!updateDone) { updateDone = true; _setDefaults(theUpdateCtx.getCfg(), theUpdateCtx.core(), theUpdateCtx.getNext()); } } if (!_self._doUpdate || _self._doUpdate(theUpdateCtx, theUpdateState, _updateCallback) !== true) { _updateCallback(); } else { result = true; } return result; }; _self._addHook = function (hooks) { if (hooks) { if (isArray(hooks)) { _hooks = _hooks.concat(hooks); } else { _hooks.push(hooks); } } }; proxyFunctionAs(_self, "_addUnloadCb", function () { return _unloadHandlerContainer; }, "add"); }); _self.diagLog = function (itemCtx) { return _getTelCtx(itemCtx).diagLog(); }; _self[strIsInitialized] = function () { return _isinitialized; }; _self.setInitialized = function (isInitialized) { _isinitialized = isInitialized; }; _self[strSetNextPlugin] = function (next) { _nextPlugin = next; }; _self.processNext = function (env, itemCtx) { if (itemCtx) { itemCtx.processNext(env); } else if (_nextPlugin && isFunction(_nextPlugin.processTelemetry)) { _nextPlugin.processTelemetry(env, null); } }; _self._getTelCtx = _getTelCtx; function _getTelCtx(currentCtx) { if (currentCtx === void 0) { currentCtx = null; } var itemCtx = currentCtx; if (!itemCtx) { var rootCtx = _rootCtx || createProcessTelemetryContext(null, {}, _self.core); if (_nextPlugin && _nextPlugin[strGetPlugin]) { itemCtx = rootCtx.createNew(null, _nextPlugin[strGetPlugin]); } else { itemCtx = rootCtx.createNew(null, _nextPlugin); } } return itemCtx; } function _setDefaults(config, core, pluginChain) { if (config) { setValue(config, strExtensionConfig, [], null, isNullOrUndefined); } if (!pluginChain && core) { pluginChain = core.getProcessTelContext().getNext(); } var nextPlugin = _nextPlugin; if (_nextPlugin && _nextPlugin[strGetPlugin]) { nextPlugin = _nextPlugin[strGetPlugin](); } _self.core = core; _rootCtx = createProcessTelemetryContext(pluginChain, config, core, nextPlugin); } function _initDefaults() { _isinitialized = false; _self.core = null; _rootCtx = null; _nextPlugin = null; _hooks = []; _unloadHandlerContainer = createUnloadHandlerContainer(); } } return BaseTelemetryPlugin; }()); var TelemetryInitializerPlugin = /** @class */ (function (_super) { __extendsFn(TelemetryInitializerPlugin, _super); function TelemetryInitializerPlugin() { var _this = _super.call(this) || this; _this.identifier = "TelemetryInitializerPlugin"; _this.priority = 199; var _id; var _initializers; _initDefaults(); dynamicProto(TelemetryInitializerPlugin, _this, function (_self, _base) { _self.addTelemetryInitializer = function (telemetryInitializer) { var theInitializer = { id: _id++, fn: telemetryInitializer }; _initializers.push(theInitializer); var handler = { remove: function () { arrForEach(_initializers, function (initializer, idx) { if (initializer.id === theInitializer.id) { _initializers.splice(idx, 1); return -1; } }); } }; return handler; }; _self.processTelemetry = function (item, itemCtx) { var doNotSendItem = false; var telemetryInitializersCount = _initializers.length; for (var i = 0; i < telemetryInitializersCount; ++i) { var telemetryInitializer = _initializers[i]; if (telemetryInitializer) { try { if (telemetryInitializer.fn.apply(null, [item]) === false) { doNotSendItem = true; break; } } catch (e) { _throwInternal(itemCtx.diagLog(), 1 , 64 , "One of telemetry initializers failed, telemetry item will not be sent: " + getExceptionName(e), { exception: dumpObj(e) }, true); } } } if (!doNotSendItem) { _self.processNext(item, itemCtx); } }; _self[strDoTeardown] = function () { _initDefaults(); }; }); function _initDefaults() { _id = 0; _initializers = []; } return _this; } return TelemetryInitializerPlugin; }(BaseTelemetryPlugin)); var strValidationError = "Plugins must provide initialize method"; var strNotificationManager = "_notificationManager"; var strSdkUnloadingError = "SDK is still unloading..."; var strSdkNotInitialized = "SDK is not initialized"; var defaultInitConfig = { loggingLevelConsole: 1 }; function _createPerfManager(core, notificationMgr) { return new PerfManager(notificationMgr); } function _validateExtensions(logger, channelPriority, allExtensions) { var coreExtensions = []; var extPriorities = {}; arrForEach(allExtensions, function (ext) { if (isNullOrUndefined(ext) || isNullOrUndefined(ext.initialize)) { throwError(strValidationError); } var extPriority = ext.priority; var identifier = ext.identifier; if (ext && extPriority) { if (!isNullOrUndefined(extPriorities[extPriority])) { _warnToConsole(logger, "Two extensions have same priority #" + extPriority + " - " + extPriorities[extPriority] + ", " + identifier); } else { extPriorities[extPriority] = identifier; } } if (!extPriority || extPriority < channelPriority) { coreExtensions.push(ext); } }); return { all: allExtensions, core: coreExtensions }; } function _isPluginPresent(thePlugin, plugins) { var exists = false; arrForEach(plugins, function (plugin) { if (plugin === thePlugin) { exists = true; return -1; } }); return exists; } function _createDummyNotificationManager() { var _a; return objCreateFn((_a = {}, _a[strAddNotificationListener] = function (listener) { }, _a[strRemoveNotificationListener] = function (listener) { }, _a[strEventsSent] = function (events) { }, _a[strEventsDiscarded] = function (events, reason) { }, _a[strEventsSendRequest] = function (sendReason, isAsync) { }, _a)); } var BaseCore$2 = /** @class */ (function () { function BaseCore() { var _isInitialized; var _eventQueue; var _notificationManager; var _perfManager; var _cfgPerfManager; var _cookieManager; var _pluginChain; var _configExtensions; var _coreExtensions; var _channelControl; var _channelConfig; var _channelQueue; var _isUnloading; var _telemetryInitializerPlugin; var _internalLogsEventName; var _evtNamespace; var _unloadHandlers; var _debugListener; var _internalLogPoller = 0; dynamicProto(BaseCore, this, function (_self) { _initDefaults(); _self.isInitialized = function () { return _isInitialized; }; _self.initialize = function (config, extensions, logger, notificationManager) { if (_isUnloading) { throwError(strSdkUnloadingError); } if (_self.isInitialized()) { throwError("Core should not be initialized more than once"); } if (!config || isNullOrUndefined(config.instrumentationKey)) { throwError("Please provide instrumentation key"); } _notificationManager = notificationManager; _self[strNotificationManager] = notificationManager; _self.config = config || {}; _initDebugListener(config); _initPerfManager(config); config.extensions = isNullOrUndefined(config.extensions) ? [] : config.extensions; _initExtConfig(config); if (logger) { _self.logger = logger; } _configExtensions = []; _configExtensions.push.apply(_configExtensions, __spreadArrayFn(__spreadArrayFn([], extensions, false), config.extensions)); _channelConfig = (config || {}).channels; _initPluginChain(config, null); if (!_channelQueue || _channelQueue.length === 0) { throwError("No channels available"); } _isInitialized = true; _self.releaseQueue(); }; _self.getTransmissionControls = function () { var controls = []; if (_channelQueue) { arrForEach(_channelQueue, function (channels) { controls.push(channels.queue); }); } return objFreeze(controls); }; _self.track = function (telemetryItem) { setValue(telemetryItem, strIKey, _self.config.instrumentationKey, null, isNotTruthy); setValue(telemetryItem, "time", toISOString(new Date()), null, isNotTruthy); setValue(telemetryItem, "ver", "4.0", null, isNullOrUndefined); if (!_isUnloading && _self.isInitialized()) { _createTelCtx().processNext(telemetryItem); } else { _eventQueue.push(telemetryItem); } }; _self.getProcessTelContext = _createTelCtx; _self.getNotifyMgr = function () { if (!_notificationManager) { _notificationManager = _createDummyNotificationManager(); _self[strNotificationManager] = _notificationManager; } return _notificationManager; }; _self[strAddNotificationListener] = function (listener) { if (_notificationManager) { _notificationManager[strAddNotificationListener](listener); } }; _self[strRemoveNotificationListener] = function (listener) { if (_notificationManager) { _notificationManager[strRemoveNotificationListener](listener); } }; _self.getCookieMgr = function () { if (!_cookieManager) { _cookieManager = createCookieMgr(_self.config, _self.logger); } return _cookieManager; }; _self.setCookieMgr = function (cookieMgr) { _cookieManager = cookieMgr; }; _self.getPerfMgr = function () { if (!_perfManager && !_cfgPerfManager) { if (_self.config && _self.config.enablePerfMgr && isFunction(_self.config.createPerfMgr)) { _cfgPerfManager = _self.config.createPerfMgr(_self, _self.getNotifyMgr()); } } return _perfManager || _cfgPerfManager || getGblPerfMgr(); }; _self.setPerfMgr = function (perfMgr) { _perfManager = perfMgr; }; _self.eventCnt = function () { return _eventQueue.length; }; _self.releaseQueue = function () { if (_isInitialized && _eventQueue.length > 0) { var eventQueue = _eventQueue; _eventQueue = []; arrForEach(eventQueue, function (event) { _createTelCtx().processNext(event); }); } }; _self.pollInternalLogs = function (eventName) { _internalLogsEventName = eventName || null; var interval = _self.config.diagnosticLogInterval; if (!interval || !(interval > 0)) { interval = 10000; } if (_internalLogPoller) { clearInterval(_internalLogPoller); } _internalLogPoller = setInterval(function () { _flushInternalLogs(); }, interval); return _internalLogPoller; }; _self.stopPollingInternalLogs = function () { if (_internalLogPoller) { clearInterval(_internalLogPoller); _internalLogPoller = 0; _flushInternalLogs(); } }; proxyFunctions(_self, function () { return _telemetryInitializerPlugin; }, ["addTelemetryInitializer"]); _self.unload = function (isAsync, unloadComplete, cbTimeout) { if (isAsync === void 0) { isAsync = true; } if (!_isInitialized) { throwError(strSdkNotInitialized); } if (_isUnloading) { throwError(strSdkUnloadingError); } var unloadState = { reason: 50 , isAsync: isAsync, flushComplete: false }; var processUnloadCtx = createProcessTelemetryUnloadContext(_getPluginChain(), _self); processUnloadCtx.onComplete(function () { _initDefaults(); unloadComplete && unloadComplete(unloadState); }, _self); function _doUnload(flushComplete) { unloadState.flushComplete = flushComplete; _isUnloading = true; _unloadHandlers.run(processUnloadCtx, unloadState); _self.stopPollingInternalLogs(); processUnloadCtx.processNext(unloadState); } if (!_flushChannels(isAsync, _doUnload, 6 , cbTimeout)) { _doUnload(false); } }; _self.getPlugin = _getPlugin; _self.addPlugin = function (plugin, replaceExisting, isAsync, addCb) { if (!plugin) { addCb && addCb(false); _logOrThrowError(strValidationError); return; } var existingPlugin = _getPlugin(plugin.identifier); if (existingPlugin && !replaceExisting) { addCb && addCb(false); _logOrThrowError("Plugin [" + plugin.identifier + "] is already loaded!"); return; } var updateState = { reason: 16 }; function _addPlugin(removed) { _configExtensions.push(plugin); updateState.added = [plugin]; _initPluginChain(_self.config, updateState); addCb && addCb(true); } if (existingPlugin) { var removedPlugins_1 = [existingPlugin.plugin]; var unloadState = { reason: 2 , isAsync: !!isAsync }; _removePlugins(removedPlugins_1, unloadState, function (removed) { if (!removed) { addCb && addCb(false); } else { updateState.removed = removedPlugins_1; updateState.reason |= 32 ; _addPlugin(); } }); } else { _addPlugin(); } }; _self.evtNamespace = function () { return _evtNamespace; }; _self.flush = _flushChannels; proxyFunctionAs(_self, "addUnloadCb", function () { return _unloadHandlers; }, "add"); function _initDefaults() { _isInitialized = false; _self.config = objExtend(true, {}, defaultInitConfig); _self.logger = new DiagnosticLogger(_self.config); _self._extensions = []; _telemetryInitializerPlugin = new TelemetryInitializerPlugin(); _eventQueue = []; _notificationManager = null; _perfManager = null; _cfgPerfManager = null; _cookieManager = null; _pluginChain = null; _coreExtensions = null; _configExtensions = []; _channelControl = null; _channelConfig = null; _channelQueue = null; _isUnloading = false; _internalLogsEventName = null; _evtNamespace = createUniqueNamespace("AIBaseCore", true); _unloadHandlers = createUnloadHandlerContainer(); } function _createTelCtx() { return createProcessTelemetryContext(_getPluginChain(), _self.config, _self); } function _initPluginChain(config, updateState) { var theExtensions = _validateExtensions(_self.logger, ChannelControllerPriority, _configExtensions); _coreExtensions = theExtensions.core; _pluginChain = null; var allExtensions = theExtensions.all; _channelQueue = objFreeze(createChannelQueues(_channelConfig, allExtensions, config, _self)); if (_channelControl) { var idx = arrIndexOf(allExtensions, _channelControl); if (idx !== -1) { allExtensions.splice(idx, 1); } idx = arrIndexOf(_coreExtensions, _channelControl); if (idx !== -1) { _coreExtensions.splice(idx, 1); } _channelControl._setQueue(_channelQueue); } else { _channelControl = createChannelControllerPlugin(_channelQueue, _self); } allExtensions.push(_channelControl); _coreExtensions.push(_channelControl); _self._extensions = sortPlugins(allExtensions); _channelControl.initialize(config, _self, allExtensions); initializePlugins(_createTelCtx(), allExtensions); _self._extensions = objFreeze(sortPlugins(_coreExtensions || [])).slice(); if (updateState) { _doUpdate(updateState); } } function _getPlugin(pluginIdentifier) { var theExt = null; var thePlugin = null; arrForEach(_self._extensions, function (ext) { if (ext.identifier === pluginIdentifier && ext !== _channelControl && ext !== _telemetryInitializerPlugin) { thePlugin = ext; return -1; } }); if (!thePlugin && _channelControl) { thePlugin = _channelControl.getChannel(pluginIdentifier); } if (thePlugin) { theExt = { plugin: thePlugin, setEnabled: function (enabled) { _getPluginState(thePlugin)[strDisabled] = !enabled; }, isEnabled: function () { var pluginState = _getPluginState(thePlugin); return !pluginState[strTeardown] && !pluginState[strDisabled]; }, remove: function (isAsync, removeCb) { if (isAsync === void 0) { isAsync = true; } var pluginsToRemove = [thePlugin]; var unloadState = { reason: 1 , isAsync: isAsync }; _removePlugins(pluginsToRemove, unloadState, function (removed) { if (removed) { _initPluginChain(_self.config, { reason: 32 , removed: pluginsToRemove }); } removeCb && removeCb(removed); }); } }; } return theExt; } function _getPluginChain() { if (!_pluginChain) { var extensions = (_coreExtensions || []).slice(); if (arrIndexOf(extensions, _telemetryInitializerPlugin) === -1) { extensions.push(_telemetryInitializerPlugin); } _pluginChain = createTelemetryProxyChain(sortPlugins(extensions), _self.config, _self); } return _pluginChain; } function _removePlugins(thePlugins, unloadState, removeComplete) { if (thePlugins && thePlugins.length > 0) { var unloadChain = createTelemetryProxyChain(thePlugins, _self.config, _self); var unloadCtx = createProcessTelemetryUnloadContext(unloadChain, _self); unloadCtx.onComplete(function () { var removed = false; var newConfigExtensions = []; arrForEach(_configExtensions, function (plugin, idx) { if (!_isPluginPresent(plugin, thePlugins)) { newConfigExtensions.push(plugin); } else { removed = true; } }); _configExtensions = newConfigExtensions; var newChannelConfig = []; if (_channelConfig) { arrForEach(_channelConfig, function (queue, idx) { var newQueue = []; arrForEach(queue, function (channel) { if (!_isPluginPresent(channel, thePlugins)) { newQueue.push(channel); } else { removed = true; } }); newChannelConfig.push(newQueue); }); _channelConfig = newChannelConfig; } removeComplete && removeComplete(removed); }); unloadCtx.processNext(unloadState); } else { removeComplete(false); } } function _flushInternalLogs() { var queue = _self.logger ? _self.logger.queue : []; if (queue) { arrForEach(queue, function (logMessage) { var item = { name: _internalLogsEventName ? _internalLogsEventName : "InternalMessageId: " + logMessage.messageId, iKey: _self.config.instrumentationKey, time: toISOString(new Date()), baseType: _InternalLogMessage.dataType, baseData: { message: logMessage.message } }; _self.track(item); }); queue.length = 0; } } function _flushChannels(isAsync, callBack, sendReason, cbTimeout) { if (_channelControl) { return _channelControl.flush(isAsync, callBack, sendReason || 6 , cbTimeout); } callBack && callBack(false); return true; } function _initDebugListener(config) { if (config.disableDbgExt === true && _debugListener) { _notificationManager[strRemoveNotificationListener](_debugListener); _debugListener = null; } if (_notificationManager && !_debugListener && config.disableDbgExt !== true) { _debugListener = getDebugListener(config); _notificationManager[strAddNotificationListener](_debugListener); } } function _initPerfManager(config) { if (!config.enablePerfMgr && _cfgPerfManager) { _cfgPerfManager = null; } if (config.enablePerfMgr) { setValue(_self.config, "createPerfMgr", _createPerfManager); } } function _initExtConfig(config) { var extConfig = getSetValue(config, strExtensionConfig); extConfig.NotificationManager = _notificationManager; } function _doUpdate(updateState) { var updateCtx = createProcessTelemetryUpdateContext(_getPluginChain(), _self); if (!_self._updateHook || _self._updateHook(updateCtx, updateState) !== true) { updateCtx.processNext(updateState); } } function _logOrThrowError(message) { var logger = _self.logger; if (logger) { _throwInternal(logger, 2 , 73 , message); } else { throwError(message); } } }); } return BaseCore; }()); function _runListeners(listeners, name, isAsync, callback) { arrForEach(listeners, function (listener) { if (listener && listener[name]) { if (isAsync) { setTimeout(function () { return callback(listener); }, 0); } else { try { callback(listener); } catch (e) { } } } }); } var NotificationManager = /** @class */ (function () { function NotificationManager(config) { this.listeners = []; var perfEvtsSendAll = !!(config || {}).perfEvtsSendAll; dynamicProto(NotificationManager, this, function (_self) { _self[strAddNotificationListener] = function (listener) { _self.listeners.push(listener); }; _self[strRemoveNotificationListener] = function (listener) { var index = arrIndexOf(_self.listeners, listener); while (index > -1) { _self.listeners.splice(index, 1); index = arrIndexOf(_self.listeners, listener); } }; _self[strEventsSent] = function (events) { _runListeners(_self.listeners, strEventsSent, true, function (listener) { listener[strEventsSent](events); }); }; _self[strEventsDiscarded] = function (events, reason) { _runListeners(_self.listeners, strEventsDiscarded, true, function (listener) { listener[strEventsDiscarded](events, reason); }); }; _self[strEventsSendRequest] = function (sendReason, isAsync) { _runListeners(_self.listeners, strEventsSendRequest, isAsync, function (listener) { listener[strEventsSendRequest](sendReason, isAsync); }); }; _self[strPerfEvent] = function (perfEvent) { if (perfEvent) { if (perfEvtsSendAll || !perfEvent.isChildEvt()) { _runListeners(_self.listeners, strPerfEvent, false, function (listener) { if (perfEvent.isAsync) { setTimeout(function () { return listener[strPerfEvent](perfEvent); }, 0); } else { listener[strPerfEvent](perfEvent); } }); } } }; }); } return NotificationManager; }()); var AppInsightsCore$2 = /** @class */ (function (_super) { __extendsFn(AppInsightsCore, _super); function AppInsightsCore() { var _this = _super.call(this) || this; dynamicProto(AppInsightsCore, _this, function (_self, _base) { _self.initialize = function (config, extensions, logger, notificationManager) { _base.initialize(config, extensions, logger || new DiagnosticLogger(config), notificationManager || new NotificationManager(config)); }; _self.track = function (telemetryItem) { doPerf(_self.getPerfMgr(), function () { return "AppInsightsCore:track"; }, function () { if (telemetryItem === null) { _notifyInvalidEvent(telemetryItem); throwError("Invalid telemetry item"); } _validateTelemetryItem(telemetryItem); _base.track(telemetryItem); }, function () { return ({ item: telemetryItem }); }, !(telemetryItem.sync)); }; function _validateTelemetryItem(telemetryItem) { if (isNullOrUndefined(telemetryItem.name)) { _notifyInvalidEvent(telemetryItem); throwError("telemetry name required"); } } function _notifyInvalidEvent(telemetryItem) { var manager = _self.getNotifyMgr(); if (manager) { manager.eventsDiscarded([telemetryItem], 2 ); } } }); return _this; } return AppInsightsCore; }(BaseCore$2)); var strOnPrefix = "on"; var strAttachEvent = "attachEvent"; var strAddEventHelper = "addEventListener"; var strDetachEvent = "detachEvent"; var strRemoveEventListener = "removeEventListener"; var strEvents = "events"; var strVisibilityChangeEvt = "visibilitychange"; var strPageHide = "pagehide"; var strPageShow = "pageshow"; var strUnload = "unload"; var strBeforeUnload = "beforeunload"; var strPageHideNamespace = createUniqueNamespace("aiEvtPageHide"); var strPageShowNamespace = createUniqueNamespace("aiEvtPageShow"); var rRemoveEmptyNs = /\.[\.]+/g; var rRemoveTrailingEmptyNs = /[\.]+$/; var _guid = 1; var elmNodeData = createElmNodeData("events"); var eventNamespace = /^([^.]*)(?:\.(.+)|)/; function _normalizeNamespace(name) { if (name && name.replace) { return name.replace(/^\s*\.*|\.*\s*$/g, ""); } return name; } function _getEvtNamespace(eventName, evtNamespace) { if (evtNamespace) { var theNamespace_1 = ""; if (isArray(evtNamespace)) { theNamespace_1 = ""; arrForEach(evtNamespace, function (name) { name = _normalizeNamespace(name); if (name) { if (name[0] !== ".") { name = "." + name; } theNamespace_1 += name; } }); } else { theNamespace_1 = _normalizeNamespace(evtNamespace); } if (theNamespace_1) { if (theNamespace_1[0] !== ".") { theNamespace_1 = "." + theNamespace_1; } eventName = (eventName || "") + theNamespace_1; } } var parsedEvent = (eventNamespace.exec(eventName || "") || []); return { type: parsedEvent[1], ns: ((parsedEvent[2] || "").replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, "").split(".").sort()).join(".") }; } function __getRegisteredEvents(target, eventName, evtNamespace) { var theEvents = []; var eventCache = elmNodeData.get(target, strEvents, {}, false); var evtName = _getEvtNamespace(eventName, evtNamespace); objForEachKey(eventCache, function (evtType, registeredEvents) { arrForEach(registeredEvents, function (value) { if (!evtName.type || evtName.type === value.evtName.type) { if (!evtName.ns || evtName.ns === evtName.ns) { theEvents.push({ name: value.evtName.type + (value.evtName.ns ? "." + value.evtName.ns : ""), handler: value.handler }); } } }); }); return theEvents; } function _getRegisteredEvents(target, evtName, addDefault) { if (addDefault === void 0) { addDefault = true; } var aiEvts = elmNodeData.get(target, strEvents, {}, addDefault); var registeredEvents = aiEvts[evtName]; if (!registeredEvents) { registeredEvents = aiEvts[evtName] = []; } return registeredEvents; } function _doDetach(obj, evtName, handlerRef, useCapture) { if (obj && evtName && evtName.type) { if (obj[strRemoveEventListener]) { obj[strRemoveEventListener](evtName.type, handlerRef, useCapture); } else if (obj[strDetachEvent]) { obj[strDetachEvent](strOnPrefix + evtName.type, handlerRef); } } } function _doAttach(obj, evtName, handlerRef, useCapture) { var result = false; if (obj && evtName && evtName.type && handlerRef) { if (obj[strAddEventHelper]) { obj[strAddEventHelper](evtName.type, handlerRef, useCapture); result = true; } else if (obj[strAttachEvent]) { obj[strAttachEvent](strOnPrefix + evtName.type, handlerRef); result = true; } } return result; } function _doUnregister(target, events, evtName, unRegFn) { var idx = events.length; while (idx--) { var theEvent = events[idx]; if (theEvent) { if (!evtName.ns || evtName.ns === theEvent.evtName.ns) { if (!unRegFn || unRegFn(theEvent)) { _doDetach(target, theEvent.evtName, theEvent.handler, theEvent.capture); events.splice(idx, 1); } } } } } function _unregisterEvents(target, evtName, unRegFn) { if (evtName.type) { _doUnregister(target, _getRegisteredEvents(target, evtName.type), evtName, unRegFn); } else { var eventCache = elmNodeData.get(target, strEvents, {}); objForEachKey(eventCache, function (evtType, events) { _doUnregister(target, events, evtName, unRegFn); }); if (objKeys(eventCache).length === 0) { elmNodeData.kill(target, strEvents); } } } function mergeEvtNamespace(theNamespace, namespaces) { var newNamespaces; if (namespaces) { if (isArray(namespaces)) { newNamespaces = [theNamespace].concat(namespaces); } else { newNamespaces = [theNamespace, namespaces]; } newNamespaces = (_getEvtNamespace("xx", newNamespaces).ns).split("."); } else { newNamespaces = theNamespace; } return newNamespaces; } function eventOn(target, eventName, handlerRef, evtNamespace, useCapture) { if (useCapture === void 0) { useCapture = false; } var result = false; if (target) { try { var evtName = _getEvtNamespace(eventName, evtNamespace); result = _doAttach(target, evtName, handlerRef, useCapture); if (result && elmNodeData.accept(target)) { var registeredEvent = { guid: _guid++, evtName: evtName, handler: handlerRef, capture: useCapture }; _getRegisteredEvents(target, evtName.type).push(registeredEvent); } } catch (e) { } } return result; } function eventOff(target, eventName, handlerRef, evtNamespace, useCapture) { if (useCapture === void 0) { useCapture = false; } if (target) { try { var evtName_1 = _getEvtNamespace(eventName, evtNamespace); var found_1 = false; _unregisterEvents(target, evtName_1, function (regEvent) { if ((evtName_1.ns && !handlerRef) || regEvent.handler === handlerRef) { found_1 = true; return true; } return false; }); if (!found_1) { _doDetach(target, evtName_1, handlerRef, useCapture); } } catch (e) { } } } function attachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) { if (useCapture === void 0) { useCapture = false; } return eventOn(obj, eventNameWithoutOn, handlerRef, null, useCapture); } function detachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) { if (useCapture === void 0) { useCapture = false; } eventOff(obj, eventNameWithoutOn, handlerRef, null, useCapture); } function addEventHandler(eventName, callback, evtNamespace) { var result = false; var w = getWindow(); if (w) { result = eventOn(w, eventName, callback, evtNamespace); result = eventOn(w["body"], eventName, callback, evtNamespace) || result; } var doc = getDocument(); if (doc) { result = eventOn(doc, eventName, callback, evtNamespace) || result; } return result; } function removeEventHandler(eventName, callback, evtNamespace) { var w = getWindow(); if (w) { eventOff(w, eventName, callback, evtNamespace); eventOff(w["body"], eventName, callback, evtNamespace); } var doc = getDocument(); if (doc) { eventOff(doc, eventName, callback, evtNamespace); } } function _addEventListeners(events, listener, excludeEvents, evtNamespace) { var added = false; if (listener && events && events.length > 0) { arrForEach(events, function (name) { if (name) { if (!excludeEvents || arrIndexOf(excludeEvents, name) === -1) { added = addEventHandler(name, listener, evtNamespace) || added; } } }); } return added; } function addEventListeners(events, listener, excludeEvents, evtNamespace) { var added = false; if (listener && events && isArray(events)) { added = _addEventListeners(events, listener, excludeEvents, evtNamespace); if (!added && excludeEvents && excludeEvents.length > 0) { added = _addEventListeners(events, listener, null, evtNamespace); } } return added; } function removeEventListeners(events, listener, evtNamespace) { if (events && isArray(events)) { arrForEach(events, function (name) { if (name) { removeEventHandler(name, listener, evtNamespace); } }); } } function addPageUnloadEventListener(listener, excludeEvents, evtNamespace) { return addEventListeners([strBeforeUnload, strUnload, strPageHide], listener, excludeEvents, evtNamespace); } function removePageUnloadEventListener(listener, evtNamespace) { removeEventListeners([strBeforeUnload, strUnload, strPageHide], listener, evtNamespace); } function addPageHideEventListener(listener, excludeEvents, evtNamespace) { function _handlePageVisibility(evt) { var doc = getDocument(); if (listener && doc && doc.visibilityState === "hidden") { listener(evt); } } var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace); var pageUnloadAdded = _addEventListeners([strPageHide], listener, excludeEvents, newNamespaces); if (!excludeEvents || arrIndexOf(excludeEvents, strVisibilityChangeEvt) === -1) { pageUnloadAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageUnloadAdded; } if (!pageUnloadAdded && excludeEvents) { pageUnloadAdded = addPageHideEventListener(listener, null, evtNamespace); } return pageUnloadAdded; } function removePageHideEventListener(listener, evtNamespace) { var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace); removeEventListeners([strPageHide], listener, newNamespaces); removeEventListeners([strVisibilityChangeEvt], null, newNamespaces); } function addPageShowEventListener(listener, excludeEvents, evtNamespace) { function _handlePageVisibility(evt) { var doc = getDocument(); if (listener && doc && doc.visibilityState === "visible") { listener(evt); } } var newNamespaces = mergeEvtNamespace(strPageShowNamespace, evtNamespace); var pageShowAdded = _addEventListeners([strPageShow], listener, excludeEvents, newNamespaces); pageShowAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageShowAdded; if (!pageShowAdded && excludeEvents) { pageShowAdded = addPageShowEventListener(listener, null, evtNamespace); } return pageShowAdded; } function removePageShowEventListener(listener, evtNamespace) { var newNamespaces = mergeEvtNamespace(strPageShowNamespace, evtNamespace); removeEventListeners([strPageShow], listener, newNamespaces); removeEventListeners([strVisibilityChangeEvt], null, newNamespaces); } function newGuid() { function randomHexDigit() { return randomValue(15); } return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(GuidRegex, function (c) { var r = (randomHexDigit() | 0), v = (c === "x" ? r : r & 0x3 | 0x8); return v.toString(16); }); } function perfNow() { var perf = getPerformance(); if (perf && perf.now) { return perf.now(); } return dateNow(); } function generateW3CId() { var hexValues = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]; var oct = strEmpty, tmp; for (var a = 0; a < 4; a++) { tmp = random32(); oct += hexValues[tmp & 0xF] + hexValues[tmp >> 4 & 0xF] + hexValues[tmp >> 8 & 0xF] + hexValues[tmp >> 12 & 0xF] + hexValues[tmp >> 16 & 0xF] + hexValues[tmp >> 20 & 0xF] + hexValues[tmp >> 24 & 0xF] + hexValues[tmp >> 28 & 0xF]; } var clockSequenceHi = hexValues[8 + (random32() & 0x03) | 0]; return oct.substr(0, 8) + oct.substr(9, 4) + "4" + oct.substr(13, 3) + clockSequenceHi + oct.substr(16, 3) + oct.substr(19, 12); } var GuidRegex = /[xy]/g; var EventHelper = { Attach: attachEvent, AttachEvent: attachEvent, Detach: detachEvent, DetachEvent: detachEvent }; var LoggingSeverity = createEnumStyle({ CRITICAL: 1 , WARNING: 2 }); var _InternalMessageId = createEnumStyle({ BrowserDoesNotSupportLocalStorage: 0 , BrowserCannotReadLocalStorage: 1 , BrowserCannotReadSessionStorage: 2 , BrowserCannotWriteLocalStorage: 3 , BrowserCannotWriteSessionStorage: 4 , BrowserFailedRemovalFromLocalStorage: 5 , BrowserFailedRemovalFromSessionStorage: 6 , CannotSendEmptyTelemetry: 7 , ClientPerformanceMathError: 8 , ErrorParsingAISessionCookie: 9 , ErrorPVCalc: 10 , ExceptionWhileLoggingError: 11 , FailedAddingTelemetryToBuffer: 12 , FailedMonitorAjaxAbort: 13 , FailedMonitorAjaxDur: 14 , FailedMonitorAjaxOpen: 15 , FailedMonitorAjaxRSC: 16 , FailedMonitorAjaxSend: 17 , FailedMonitorAjaxGetCorrelationHeader: 18 , FailedToAddHandlerForOnBeforeUnload: 19 , FailedToSendQueuedTelemetry: 20 , FailedToReportDataLoss: 21 , FlushFailed: 22 , MessageLimitPerPVExceeded: 23 , MissingRequiredFieldSpecification: 24 , NavigationTimingNotSupported: 25 , OnError: 26 , SessionRenewalDateIsZero: 27 , SenderNotInitialized: 28 , StartTrackEventFailed: 29 , StopTrackEventFailed: 30 , StartTrackFailed: 31 , StopTrackFailed: 32 , TelemetrySampledAndNotSent: 33 , TrackEventFailed: 34 , TrackExceptionFailed: 35 , TrackMetricFailed: 36 , TrackPVFailed: 37 , TrackPVFailedCalc: 38 , TrackTraceFailed: 39 , TransmissionFailed: 40 , FailedToSetStorageBuffer: 41 , FailedToRestoreStorageBuffer: 42 , InvalidBackendResponse: 43 , FailedToFixDepricatedValues: 44 , InvalidDurationValue: 45 , TelemetryEnvelopeInvalid: 46 , CreateEnvelopeError: 47 , CannotSerializeObject: 48 , CannotSerializeObjectNonSerializable: 49 , CircularReferenceDetected: 50 , ClearAuthContextFailed: 51 , ExceptionTruncated: 52 , IllegalCharsInName: 53 , ItemNotInArray: 54 , MaxAjaxPerPVExceeded: 55 , MessageTruncated: 56 , NameTooLong: 57 , SampleRateOutOfRange: 58 , SetAuthContextFailed: 59 , SetAuthContextFailedAccountName: 60 , StringValueTooLong: 61 , StartCalledMoreThanOnce: 62 , StopCalledWithoutStart: 63 , TelemetryInitializerFailed: 64 , TrackArgumentsNotSpecified: 65 , UrlTooLong: 66 , SessionStorageBufferFull: 67 , CannotAccessCookie: 68 , IdTooLong: 69 , InvalidEvent: 70 , FailedMonitorAjaxSetRequestHeader: 71 , SendBrowserInfoOnUserInit: 72 , PluginException: 73 , NotificationException: 74 , SnippetScriptLoadFailure: 99 , InvalidInstrumentationKey: 100 , CannotParseAiBlobValue: 101 , InvalidContentBlob: 102 , TrackPageActionEventFailed: 103 , FailedAddingCustomDefinedRequestContext: 104 , InMemoryStorageBufferFull: 105 }); var ValueKind = createEnumStyle({ NotSet: 0 , Pii_DistinguishedName: 1 , Pii_GenericData: 2 , Pii_IPV4Address: 3 , Pii_IPv6Address: 4 , Pii_MailSubject: 5 , Pii_PhoneNumber: 6 , Pii_QueryString: 7 , Pii_SipAddress: 8 , Pii_SmtpAddress: 9 , Pii_Identity: 10 , Pii_Uri: 11 , Pii_Fqdn: 12 , Pii_IPV4AddressLegacy: 13 , CustomerContent_GenericContent: 32 }); var EventLatency = createEnumStyle({ Normal: 1 , CostDeferred: 2 , RealTime: 3 , Immediate: 4 }); var EventPropertyType = createEnumStyle({ Unspecified: 0 , String: 1 , Int32: 2 , UInt32: 3 , Int64: 4 , UInt64: 5 , Double: 6 , Bool: 7 , Guid: 8 , DateTime: 9 }); var EventPersistence = createEnumStyle({ Normal: 1 , Critical: 2 }); var TraceLevel = createEnumStyle({ NONE: 0 , ERROR: 1 , WARNING: 2 , INFORMATION: 3 }); var _ExtendedInternalMessageId = objFreeze(__assignFn(__assignFn({}, _InternalMessageId), createEnumStyle({ AuthHandShakeError: 501 , AuthRedirectFail: 502 , BrowserCannotReadLocalStorage: 503 , BrowserCannotWriteLocalStorage: 504 , BrowserDoesNotSupportLocalStorage: 505 , CannotParseBiBlobValue: 506 , CannotParseDataAttribute: 507 , CVPluginNotAvailable: 508 , DroppedEvent: 509 , ErrorParsingAISessionCookie: 510 , ErrorProvidedChannels: 511 , FailedToGetCookies: 512 , FailedToInitializeCorrelationVector: 513 , FailedToInitializeSDK: 514 , InvalidContentBlob: 515 , InvalidCorrelationValue: 516 , SessionRenewalDateIsZero: 517 , SendPostOnCompleteFailure: 518 , PostResponseHandler: 519 , SDKNotInitialized: 520 }))); var _a; var Version = '3.2.2'; var FullVersionString = "1DS-Web-JS-" + Version; var strDisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation"; var strWithCredentials = "withCredentials"; var strTimeout = "timeout"; var _fieldTypeEventPropMap = (_a = {}, _a[0 ] = 0 , _a[2 ] = 6 , _a[1 ] = 1 , _a[3 ] = 7 , _a[4096 | 2 ] = 6 , _a[4096 | 1 ] = 1 , _a[4096 | 3 ] = 7 , _a); var uInt8ArraySupported = null; var isDocumentObjectAvailable = Boolean(getDocument()); var isWindowObjectAvailable = Boolean(getWindow()); function isValueAssigned(value) { return !(value === "" || isNullOrUndefined(value)); } function getTenantId(apiKey) { if (apiKey) { var indexTenantId = apiKey.indexOf("-"); if (indexTenantId > -1) { return apiKey.substring(0, indexTenantId); } } return ""; } function isUint8ArrayAvailable() { if (uInt8ArraySupported === null) { uInt8ArraySupported = !isUndefined(Uint8Array) && !isSafariOrFirefox() && !isReactNative(); } return uInt8ArraySupported; } function isLatency(value) { if (value && isNumber(value) && value >= 1 && value <= 4 ) { return true; } return false; } function sanitizeProperty(name, property, stringifyObjects) { if ((!property && !isValueAssigned(property)) || typeof name !== "string") { return null; } var propType = typeof property; if (propType === "string" || propType === "number" || propType === "boolean" || isArray(property)) { property = { value: property }; } else if (propType === "object" && !property.hasOwnProperty("value")) { property = { value: stringifyObjects ? JSON.stringify(property) : property }; } else if (isNullOrUndefined(property.value) || property.value === "" || (!isString(property.value) && !isNumber(property.value) && !isBoolean(property.value) && !isArray(property.value))) { return null; } if (isArray(property.value) && !isArrayValid(property.value)) { return null; } if (!isNullOrUndefined(property.kind)) { if (isArray(property.value) || !isValueKind(property.kind)) { return null; } property.value = property.value.toString(); } return property; } function getCommonSchemaMetaData(value, kind, type) { var encodedTypeValue = -1; if (!isUndefined(value)) { if (kind > 0) { if (kind === 32) { encodedTypeValue = (1 << 13); } else if (kind <= 13) { encodedTypeValue = (kind << 5); } } if (isDataType(type)) { if (encodedTypeValue === -1) { encodedTypeValue = 0; } encodedTypeValue |= type; } else { var propType = _fieldTypeEventPropMap[getFieldValueType(value)] || -1; if (encodedTypeValue !== -1 && propType !== -1) { encodedTypeValue |= propType; } else if (propType === 6 ) { encodedTypeValue = propType; } } } return encodedTypeValue; } function disableCookies() { safeGetCookieMgr(null).setEnabled(false); } function setCookie(name, value, days) { if (areCookiesSupported(null)) { safeGetCookieMgr(null).set(name, value, days * 86400, null, "/"); } } function deleteCookie(name) { if (areCookiesSupported(null)) { safeGetCookieMgr(null).del(name); } } function getCookie(name) { if (areCookiesSupported(null)) { return getCookieValue(safeGetCookieMgr(null), name); } return ""; } function getCookieValue(cookieMgr, name, decode) { if (decode === void 0) { decode = true; } var cookieValue; if (cookieMgr) { cookieValue = cookieMgr.get(name); if (decode && cookieValue && decodeURIComponent) { cookieValue = decodeURIComponent(cookieValue); } } return cookieValue || ""; } function createGuid(style) { if (style === void 0) { style = "D" ; } var theGuid = newGuid(); if (style === "B" ) { theGuid = "{" + theGuid + "}"; } else if (style === "P" ) { theGuid = "(" + theGuid + ")"; } else if (style === "N" ) { theGuid = theGuid.replace(/-/g, ""); } return theGuid; } function extend(obj, obj2, obj3, obj4, obj5) { var extended = {}; var deep = false; var i = 0; var length = arguments.length; var objProto = Object[strShimPrototype]; var theArgs = arguments; if (objProto.toString.call(theArgs[0]) === "[object Boolean]") { deep = theArgs[0]; i++; } for (; i < length; i++) { var obj = theArgs[i]; objForEachKey(obj, function (prop, value) { if (deep && value && isObject(value)) { if (isArray(value)) { extended[prop] = extended[prop] || []; arrForEach(value, function (arrayValue, arrayIndex) { if (arrayValue && isObject(arrayValue)) { extended[prop][arrayIndex] = extend(true, extended[prop][arrayIndex], arrayValue); } else { extended[prop][arrayIndex] = arrayValue; } }); } else { extended[prop] = extend(true, extended[prop], value); } } else { extended[prop] = value; } }); } return extended; } var getTime = perfNow; function isValueKind(value) { if (value === 0 || ((value > 0 && value <= 13 ) || value === 32 )) { return true; } return false; } function isDataType(value) { if (value >= 0 && value <= 9) { return true; } return false; } function isSafariOrFirefox() { var nav = getNavigator(); if (!isUndefined(nav) && nav.userAgent) { var ua = nav.userAgent.toLowerCase(); if ((ua.indexOf("safari") >= 0 || ua.indexOf("firefox") >= 0) && ua.indexOf("chrome") < 0) { return true; } } return false; } function isArrayValid(value) { return value.length > 0; } function setProcessTelemetryTimings(event, identifier) { var evt = event; evt.timings = evt.timings || {}; evt.timings.processTelemetryStart = evt.timings.processTelemetryStart || {}; evt.timings.processTelemetryStart[identifier] = getTime(); } function getFieldValueType(value) { var theType = 0 ; if (value !== null && value !== undefined) { var objType = typeof value; if (objType === "string") { theType = 1 ; } else if (objType === "number") { theType = 2 ; } else if (objType === "boolean") { theType = 3 ; } else if (objType === strShimObject) { theType = 4 ; if (isArray(value)) { theType = 4096 ; if (value.length > 0) { theType |= getFieldValueType(value[0]); } } else if (hasOwnProperty(value, "value")) { theType = 8192 | getFieldValueType(value.value); } } } return theType; } var Utils = { Version: Version, FullVersionString: FullVersionString, strUndefined: strShimUndefined, strObject: strShimObject, Undefined: strShimUndefined, arrForEach: arrForEach, arrIndexOf: arrIndexOf, arrMap: arrMap, arrReduce: arrReduce, objKeys: objKeys, toISOString: toISOString, isReactNative: isReactNative, isString: isString, isNumber: isNumber, isBoolean: isBoolean, isFunction: isFunction, isArray: isArray, isObject: isObject, strTrim: strTrim, isDocumentObjectAvailable: isDocumentObjectAvailable, isWindowObjectAvailable: isWindowObjectAvailable, isValueAssigned: isValueAssigned, getTenantId: getTenantId, isBeaconsSupported: isBeaconsSupported, isUint8ArrayAvailable: isUint8ArrayAvailable, isLatency: isLatency, sanitizeProperty: sanitizeProperty, getISOString: toISOString, useXDomainRequest: useXDomainRequest, getCommonSchemaMetaData: getCommonSchemaMetaData, cookieAvailable: areCookiesSupported, disallowsSameSiteNone: uaDisallowsSameSiteNone, setCookie: setCookie, deleteCookie: deleteCookie, getCookie: getCookie, createGuid: createGuid, extend: extend, getTime: getTime, isValueKind: isValueKind, isArrayValid: isArrayValid, objDefineAccessors: objDefineAccessors, addPageUnloadEventListener: addPageUnloadEventListener, setProcessTelemetryTimings: setProcessTelemetryTimings, addEventHandler: addEventHandler, getFieldValueType: getFieldValueType, strEndsWith: strEndsWith, objForEachKey: objForEachKey }; var CoreUtils = { _canUseCookies: undefined, isTypeof: isTypeof, isUndefined: isUndefined, isNullOrUndefined: isNullOrUndefined, hasOwnProperty: hasOwnProperty, isFunction: isFunction, isObject: isObject, isDate: isDate, isArray: isArray, isError: isError, isString: isString, isNumber: isNumber, isBoolean: isBoolean, toISOString: toISOString, arrForEach: arrForEach, arrIndexOf: arrIndexOf, arrMap: arrMap, arrReduce: arrReduce, strTrim: strTrim, objCreate: objCreateFn, objKeys: objKeys, objDefineAccessors: objDefineAccessors, addEventHandler: addEventHandler, dateNow: dateNow, isIE: isIE, disableCookies: disableCookies, newGuid: newGuid, perfNow: perfNow, newId: newId, randomValue: randomValue, random32: random32, mwcRandomSeed: mwcRandomSeed, mwcRandom32: mwcRandom32, generateW3CId: generateW3CId }; function isChromium() { return !!getGlobalInst("chrome"); } function openXhr(method, urlString, withCredentials, disabled, isSync, timeout) { if (disabled === void 0) { disabled = false; } if (isSync === void 0) { isSync = false; } function _wrapSetXhrProp(xhr, prop, value) { try { xhr[prop] = value; } catch (e) { } } var xhr = new XMLHttpRequest(); if (disabled) { _wrapSetXhrProp(xhr, strDisabledPropertyName, disabled); } if (withCredentials) { _wrapSetXhrProp(xhr, strWithCredentials, withCredentials); } xhr.open(method, urlString, !isSync); if (withCredentials) { _wrapSetXhrProp(xhr, strWithCredentials, withCredentials); } if (!isSync && timeout) { _wrapSetXhrProp(xhr, strTimeout, timeout); } return xhr; } var PropVersion = "version"; var properties = "properties"; var AppInsightsCore = /** @class */ (function (_super) { __extendsFn(AppInsightsCore, _super); function AppInsightsCore() { var _this = _super.call(this) || this; _this.pluginVersionStringArr = []; _this.pluginVersionString = ""; dynamicProto(AppInsightsCore, _this, function (_self, _base) { if (!_self.logger || !_self.logger.queue) { _self.logger = new DiagnosticLogger({ loggingLevelConsole: 1 }); } _self.initialize = function (config, extensions, logger, notificationManager) { doPerf(_self, function () { return "AppInsightsCore.initialize"; }, function () { if (config) { if (!config.endpointUrl) { config.endpointUrl = "https://browser.events.data.microsoft.com/OneCollector/1.0/"; } var propertyStorageOverride = config.propertyStorageOverride; if (propertyStorageOverride && (!propertyStorageOverride.getProperty || !propertyStorageOverride.setProperty)) { throw new Error("Invalid property storage override passed."); } if (config.channels) { arrForEach(config.channels, function (channels) { if (channels) { arrForEach(channels, function (channel) { if (channel.identifier && channel.version) { var ver = channel.identifier + "=" + channel.version; _self.pluginVersionStringArr.push(ver); } }); } }); } } _self.getWParam = function () { return typeof document !== "undefined" ? 0 : -1; }; if (extensions) { arrForEach(extensions, function (ext) { if (ext && ext.identifier && ext.version) { var ver = ext.identifier + "=" + ext.version; _self.pluginVersionStringArr.push(ver); } }); } _self.pluginVersionString = _self.pluginVersionStringArr.join(";"); try { _base.initialize(config, extensions, logger, notificationManager); _self.pollInternalLogs("InternalLog"); } catch (e) { var logger_1 = _self.logger; var message = dumpObj(e); if (message.indexOf("channels") !== -1) { message += "\n - Channels must be provided through config.channels only!"; } logger_1.throwInternal(1 , 514 , "SDK Initialization Failed - no telemetry will be sent: " + message); } }, function () { return ({ config: config, extensions: extensions, logger: logger, notificationManager: notificationManager }); }); }; _self.track = function (item) { doPerf(_self, function () { return "AppInsightsCore.track"; }, function () { var telemetryItem = item; if (telemetryItem) { telemetryItem.timings = telemetryItem.timings || {}; telemetryItem.timings.trackStart = getTime(); if (!isLatency(telemetryItem.latency)) { telemetryItem.latency = 1 ; } var itemExt = telemetryItem.ext = telemetryItem.ext || {}; itemExt.sdk = itemExt.sdk || {}; itemExt.sdk.ver = FullVersionString; var baseData = telemetryItem.baseData = telemetryItem.baseData || {}; if (!baseData[properties]) { baseData[properties] = {}; } var itemProperties = baseData[properties]; if (!itemProperties[PropVersion]) { itemProperties[PropVersion] = ""; } if (_self.pluginVersionString !== "") { itemProperties[PropVersion] = _self.pluginVersionString; } } _base.track(telemetryItem); }, function () { return ({ item: item }); }, !(item.sync)); }; }); return _this; } return AppInsightsCore; }(AppInsightsCore$2)); var AppInsightsCore$1 = AppInsightsCore; var BaseCore = /** @class */ (function (_super) { __extendsFn(BaseCore, _super); function BaseCore() { var _this = _super.call(this) || this; dynamicProto(BaseCore, _this, function (_self, _base) { _self.initialize = function (config, extensions, logger, notificationManager) { if (config && !config.endpointUrl) { config.endpointUrl = "https://browser.events.data.microsoft.com/OneCollector/1.0/"; } _self.getWParam = function () { return isDocumentObjectAvailable ? 0 : -1; }; try { _base.initialize(config, extensions, logger, notificationManager); } catch (e) { _throwInternal(_self.logger, 1 , 514 , "Initialization Failed: " + dumpObj(e) + "\n - Note: Channels must be provided through config.channels only"); } }; _self.track = function (item) { var telemetryItem = item; if (telemetryItem) { var ext = telemetryItem.ext = telemetryItem.ext || {}; ext.sdk = ext.sdk || {}; ext.sdk.ver = FullVersionString; } _base.track(telemetryItem); }; }); return _this; } return BaseCore; }(BaseCore$2)); var BaseCore$1 = BaseCore; var _isFunction = isFunction; function _createPromiseAllOnResolvedFunction(values, index, resolvedCallback) { return function (value) { values[index] = value; resolvedCallback(); }; } var ESPromise = /** @class */ (function () { function ESPromise(resolverFunc) { var _state = 0 ; var _settledValue = null; var _queue = []; dynamicProto(ESPromise, this, function (_this) { _this.then = function (onResolved, onRejected) { return new ESPromise(function (resolve, reject) { _enqueue(onResolved, onRejected, resolve, reject); }); }; _this["catch"] = function (onRejected) { return _this.then(null, onRejected); }; }); function _enqueue(onResolved, onRejected, resolve, reject) { _queue.push(function () { var value; try { if (_state === 1 ) { value = _isFunction(onResolved) ? onResolved(_settledValue) : _settledValue; } else { value = _isFunction(onRejected) ? onRejected(_settledValue) : _settledValue; } if (value instanceof ESPromise) { value.then(resolve, reject); } else if (_state === 2 && !_isFunction(onRejected)) { reject(value); } else { resolve(value); } } catch (error) { reject(error); return; } }); if (_state !== 0 ) { _processQueue(); } } function _processQueue() { if (_queue.length > 0) { var pending_1 = _queue.slice(); _queue = []; setTimeout(function () { for (var i = 0, len = pending_1.length; i < len; ++i) { try { pending_1[i](); } catch (e) { } } }, 0); } } function _resolve(value) { if (_state === 0 ) { _settledValue = value; _state = 1 ; _processQueue(); } } function _reject(reason) { if (_state === 0 ) { _settledValue = reason; _state = 2 ; _processQueue(); } } (function _initialize() { if (!_isFunction(resolverFunc)) { throw new TypeError("ESPromise: resolvedFunc argument is not a Function"); } try { resolverFunc(_resolve, _reject); } catch (error) { _reject(error); } })(); } ESPromise.resolve = function (value) { if (value instanceof ESPromise) { return value; } else if (value && _isFunction(value.then)) { return new ESPromise(function (resolve, reject) { try { value.then(resolve, reject); } catch (error) { reject(error); } }); } return new ESPromise(function (resolve) { resolve(value); }); }; ESPromise.reject = function (reason) { return new ESPromise(function (resolve, reject) { reject(reason); }); }; ESPromise.all = function (iterable) { if (!iterable || !iterable.length) { return; } return new ESPromise(function (resolve, reject) { try { var values_1 = []; var pending_2 = 0; for (var lp = 0; lp < iterable.length; lp++) { var item = iterable[lp]; if (item && _isFunction(item.then)) { pending_2++; item.then(_createPromiseAllOnResolvedFunction(values_1, lp, function () { if (--pending_2 === 0) { resolve(values_1); } }), reject); } else { values_1[lp] = item; } } if (pending_2 === 0) { setTimeout(function () { resolve(values_1); }, 0); } } catch (error) { reject(error); } }); }; ESPromise.race = function (iterable) { return new ESPromise(function (resolve, reject) { if (!iterable || !iterable.length) { return; } try { var _loop_1 = function (lp) { var item = iterable[lp]; if (item && _isFunction(item.then)) { item.then(resolve, reject); } else { setTimeout(function () { resolve(item); }, 0); } }; for (var lp = 0; lp < iterable.length; lp++) { _loop_1(lp); } } catch (error) { reject(error); } }); }; return ESPromise; }()); var ESPromise$1 = ESPromise; var LazyRejectPeriod = 600000; var _schedulerId = 0; var _running = []; var _waiting = []; var _timedOut = []; function _getTime() { return new Date().getTime(); } var ESPromiseScheduler = /** @class */ (function () { function ESPromiseScheduler(name, diagLog) { var _promiseId = 0; var _scheduledName = (name || "") + "." + _schedulerId; _schedulerId++; dynamicProto(ESPromiseScheduler, this, function (_this) { var _lastEvent = null; var _eventCount = 0; _this.scheduleEvent = function (startEventAction, eventName, timeout) { var uniqueId = _scheduledName + "." + _eventCount; _eventCount++; if (eventName) { uniqueId += "-(" + eventName + ")"; } var uniqueEventId = uniqueId + "{" + _promiseId + "}"; _promiseId++; var newScheduledEvent = { evt: null, tm: _getTime(), id: uniqueEventId, isRunning: false, isAborted: false }; if (!_lastEvent) { newScheduledEvent.evt = _startWaitingEvent(newScheduledEvent); } else { newScheduledEvent.evt = _waitForPreviousEvent(newScheduledEvent, _lastEvent); } _lastEvent = newScheduledEvent; _lastEvent.evt._schId = uniqueEventId; return newScheduledEvent.evt; function _abortAndRemoveOldEvents(eventQueue) { var now = _getTime(); var expired = now - LazyRejectPeriod; var len = eventQueue.length; var lp = 0; while (lp < len) { var evt = eventQueue[lp]; if (evt && evt.tm < expired) { var message = null; if (evt.abort) { message = "Aborting [" + evt.id + "] due to Excessive runtime (" + (now - evt.tm) + " ms)"; evt.abort(message); } else { message = "Removing [" + evt.id + "] due to Excessive runtime (" + (now - evt.tm) + " ms)"; } _warnLog(message); eventQueue.splice(lp, 1); len--; } else { lp++; } } } function _cleanup(eventId, completed) { var toQueue = false; var removed = _removeQueuedEvent(_running, eventId); if (!removed) { removed = _removeQueuedEvent(_timedOut, eventId); toQueue = true; } if (removed) { if (removed.to) { clearTimeout(removed.to); removed.to = null; } var tm = _getTime() - removed.tm; if (completed) { if (!toQueue) { _debugLog("Promise [" + eventId + "] Complete -- " + tm + " ms"); } else { _warnLog("Timed out event [" + eventId + "] finally complete -- " + tm + " ms"); } } else { _timedOut.push(removed); _warnLog("Event [" + eventId + "] Timed out and removed -- " + tm + " ms"); } } else { _debugLog("Failed to remove [" + eventId + "] from running queue"); } if (_lastEvent && _lastEvent.id === eventId) { _lastEvent = null; } _abortAndRemoveOldEvents(_running); _abortAndRemoveOldEvents(_waiting); _abortAndRemoveOldEvents(_timedOut); } function _removeScheduledEvent(eventId, callback) { return function (value) { _cleanup(eventId, true); callback && callback(value); return value; }; } function _waitForFinalResult(eventId, startResult, schEventResolve, schEventReject) { startResult.then(function (value) { if (value instanceof ESPromise$1) { _debugLog("Event [" + eventId + "] returned a promise -- waiting"); _waitForFinalResult(eventId, value, schEventResolve, schEventReject); return value; } else { return _removeScheduledEvent(eventId, schEventResolve)(value); } }, _removeScheduledEvent(eventId, schEventReject)); } function _createScheduledEvent(eventDetails, startEvent) { var eventId = eventDetails.id; return new ESPromise$1(function (schEventResolve, schEventReject) { _debugLog("Event [" + eventId + "] Starting -- waited for " + (eventDetails.wTm || "--") + " ms"); eventDetails.isRunning = true; eventDetails.abort = function (message) { eventDetails.abort = null; eventDetails.isAborted = true; _cleanup(eventId, false); schEventReject(new Error(message)); }; var startResult = startEvent(eventId); if (startResult instanceof ESPromise$1) { if (timeout) { eventDetails.to = setTimeout(function () { _cleanup(eventId, false); schEventReject(new Error("Timed out after [" + timeout + "] ms")); }, timeout); } _waitForFinalResult(eventId, startResult, function (theResult) { _debugLog("Event [" + eventId + "] Resolving after " + (_getTime() - eventDetails.tm) + " ms"); schEventResolve(theResult); }, schEventReject); } else { _debugLog("Promise [" + eventId + "] Auto completed as the start action did not return a promise"); schEventResolve(); } }); } function _startWaitingEvent(eventDetails) { var now = _getTime(); eventDetails.wTm = now - eventDetails.tm; eventDetails.tm = now; if (eventDetails.isAborted) { return ESPromise$1.reject(new Error("[" + uniqueId + "] was aborted")); } _running.push(eventDetails); return _createScheduledEvent(eventDetails, startEventAction); } function _waitForPreviousEvent(eventDetails, waitForEvent) { var waitEvent = new ESPromise$1(function (waitResolve, waitReject) { var runTime = _getTime() - waitForEvent.tm; var prevId = waitForEvent.id; _debugLog("[" + uniqueId + "] is waiting for [" + prevId + ":" + runTime + " ms] to complete before starting -- [" + _waiting.length + "] waiting and [" + _running.length + "] running"); eventDetails.abort = function (message) { eventDetails.abort = null; _removeQueuedEvent(_waiting, uniqueId); eventDetails.isAborted = true; waitReject(new Error(message)); }; waitForEvent.evt.then(function (value) { _removeQueuedEvent(_waiting, uniqueId); _startWaitingEvent(eventDetails).then(waitResolve, waitReject); }, function (reason) { _removeQueuedEvent(_waiting, uniqueId); _startWaitingEvent(eventDetails).then(waitResolve, waitReject); }); }); _waiting.push(eventDetails); return waitEvent; } }; function _removeQueuedEvent(queue, eventId) { for (var lp = 0; lp < queue.length; lp++) { if (queue[lp].id === eventId) { return queue.splice(lp, 1)[0]; } } return null; } }); function _debugLog(message) { var global = getGlobal(); if (global && global["QUnit"]) { console && console.log("ESPromiseScheduler[" + _scheduledName + "] " + message); } } function _warnLog(message) { diagLog && diagLog.warnToConsole("ESPromiseScheduler[" + _scheduledName + "] " + message); } } ESPromiseScheduler.incomplete = function () { return _running; }; ESPromiseScheduler.waitingToStart = function () { return _waiting; }; return ESPromiseScheduler; }()); var ESPromiseScheduler$1 = ESPromiseScheduler; var ValueSanitizer = /** @class */ (function () { function ValueSanitizer(fieldSanitizerProvider) { var _self = this; var _sanitizerMap = {}; var _sanitizers = []; var _fieldSanitizers = []; if (fieldSanitizerProvider) { _fieldSanitizers.push(fieldSanitizerProvider); } function _getFieldSanitizer(path, name) { var result; var fieldLookup = _sanitizerMap[path]; if (fieldLookup) { result = fieldLookup[name]; } if (!result && result !== null) { if (isString(path) && isString(name)) { if (_fieldSanitizers.length > 0) { for (var lp = 0; lp < _fieldSanitizers.length; lp++) { if (_fieldSanitizers[lp].handleField(path, name)) { result = { canHandle: true, fieldHandler: _fieldSanitizers[lp] }; break; } } } else if (_sanitizers.length === 0) { result = { canHandle: true }; } } if (!result && result !== null) { result = null; for (var lp = 0; lp < _sanitizers.length; lp++) { if (_sanitizers[lp].handleField(path, name)) { result = { canHandle: true, handler: _sanitizers[lp], fieldHandler: null }; break; } } } if (!fieldLookup) { fieldLookup = _sanitizerMap[path] = {}; } fieldLookup[name] = result; } return result; } _self.addSanitizer = function (newSanitizer) { if (newSanitizer) { _sanitizers.push(newSanitizer); _sanitizerMap = {}; } }; _self.addFieldSanitizer = function (fieldSanitizer) { if (fieldSanitizer) { _fieldSanitizers.push(fieldSanitizer); _sanitizerMap = {}; } }; _self.handleField = function (path, name) { var mapValue = _getFieldSanitizer(path, name); return mapValue ? mapValue.canHandle : false; }; _self.value = function (path, name, value, stringifyObjects) { var mapValue = _getFieldSanitizer(path, name); if (mapValue && mapValue.canHandle) { if (!mapValue || !mapValue.canHandle) { return null; } if (mapValue.handler) { return mapValue.handler.value(path, name, value, stringifyObjects); } if (!isString(name) || isNullOrUndefined(value) || value === "") { return null; } var property = null; var fieldType = getFieldValueType(value); if ((fieldType & 8192 ) === 8192 ) { var subType = fieldType & ~8192 ; property = value; if (!isValueAssigned(property.value) || (subType !== 1 && subType !== 2 && subType !== 3 && (subType & 4096 ) !== 4096 )) { return null; } } else if (fieldType === 1 || fieldType === 2 || fieldType === 3 || (fieldType & 4096 ) === 4096 ) { property = _convertToProperty(path, name, value); } else if (fieldType === 4 ) { property = _convertToProperty(path, name, !!stringifyObjects ? JSON.stringify(value) : value); } if (property) { return _handleProperty(mapValue, path, name, fieldType, property, stringifyObjects); } } return null; }; _self.property = function (path, name, property, stringifyObjects) { var mapValue = _getFieldSanitizer(path, name); if (!mapValue || !mapValue.canHandle) { return null; } if (!isString(name) || isNullOrUndefined(property) || !isValueAssigned(property.value)) { return null; } var fieldType = getFieldValueType(property.value); if (fieldType === 0 ) { return null; } return _handleProperty(mapValue, path, name, fieldType, property, stringifyObjects); }; function _handleProperty(mapValue, path, name, fieldType, property, stringifyObjects) { if (mapValue.handler) { return mapValue.handler.property(path, name, property, stringifyObjects); } if (!isNullOrUndefined(property.kind)) { if ((fieldType & 4096 ) === 4096 || !isValueKind(property.kind)) { return null; } property.value = property.value.toString(); } return _callFieldSanitizer(mapValue.fieldHandler, path, name, fieldType, property); } function _convertToProperty(path, name, value) { if (isValueAssigned(value)) { return { value: value }; } return null; } function _callFieldSanitizer(fieldProvider, path, name, theType, property) { if (property && fieldProvider) { var sanitizer = fieldProvider.getSanitizer(path, name, theType, property.kind, property.propertyType); if (sanitizer) { if (theType === 4 ) { var newValue_1 = {}; var propValue = property.value; objForEachKey(propValue, function (propKey, theValue) { var newPath = path + "." + name; if (isValueAssigned(theValue)) { var newProp = _convertToProperty(newPath, propKey, theValue); newProp = _callFieldSanitizer(fieldProvider, newPath, propKey, getFieldValueType(theValue), newProp); if (newProp) { newValue_1[propKey] = newProp.value; } } }); property.value = newValue_1; } else { var details = { path: path, name: name, type: theType, prop: property, sanitizer: _self }; property = sanitizer.call(_self, details); } } } return property; } } ValueSanitizer.getFieldType = getFieldValueType; return ValueSanitizer; }()); exports.AppInsightsCore = AppInsightsCore$1; exports.BaseCore = BaseCore$1; exports.BaseTelemetryPlugin = BaseTelemetryPlugin; exports.CoreUtils = CoreUtils; exports.DiagnosticLogger = DiagnosticLogger; exports.ESPromise = ESPromise$1; exports.ESPromiseScheduler = ESPromiseScheduler$1; exports.EventHelper = EventHelper; exports.EventLatency = EventLatency; exports.EventPersistence = EventPersistence; exports.EventPropertyType = EventPropertyType; exports.EventsDiscardedReason = EventsDiscardedReason; exports.FullVersionString = FullVersionString; exports.InternalAppInsightsCore = AppInsightsCore$2; exports.InternalBaseCore = BaseCore$2; exports.LoggingSeverity = LoggingSeverity; exports.MinChannelPriorty = MinChannelPriorty; exports.NotificationManager = NotificationManager; exports.PerfEvent = PerfEvent; exports.PerfManager = PerfManager; exports.ProcessTelemetryContext = ProcessTelemetryContext; exports.TraceLevel = TraceLevel; exports.Undefined = strShimUndefined; exports.Utils = Utils; exports.ValueKind = ValueKind; exports.ValueSanitizer = ValueSanitizer; exports.Version = Version; exports._ExtendedInternalMessageId = _ExtendedInternalMessageId; exports._InternalLogMessage = _InternalLogMessage; exports._InternalMessageId = _InternalMessageId; exports.__getRegisteredEvents = __getRegisteredEvents; exports._throwInternal = _throwInternal; exports.addEventHandler = addEventHandler; exports.addEventListeners = addEventListeners; exports.addPageHideEventListener = addPageHideEventListener; exports.addPageShowEventListener = addPageShowEventListener; exports.addPageUnloadEventListener = addPageUnloadEventListener; exports.areCookiesSupported = areCookiesSupported; exports.arrForEach = arrForEach; exports.arrIndexOf = arrIndexOf; exports.arrMap = arrMap; exports.arrReduce = arrReduce; exports.attachEvent = attachEvent; exports.cookieAvailable = areCookiesSupported; exports.createCookieMgr = createCookieMgr; exports.createEnumStyle = createEnumStyle; exports.createGuid = createGuid; exports.createProcessTelemetryContext = createProcessTelemetryContext; exports.createUniqueNamespace = createUniqueNamespace; exports.createUnloadHandlerContainer = createUnloadHandlerContainer; exports.dateNow = dateNow; exports.deleteCookie = deleteCookie; exports.detachEvent = detachEvent; exports.disableCookies = disableCookies; exports.disallowsSameSiteNone = uaDisallowsSameSiteNone; exports.doPerf = doPerf; exports.dumpObj = dumpObj; exports.eventOff = eventOff; exports.eventOn = eventOn; exports.extend = extend; exports.generateW3CId = generateW3CId; exports.getCommonSchemaMetaData = getCommonSchemaMetaData; exports.getConsole = getConsole; exports.getCookie = getCookie; exports.getCookieValue = getCookieValue; exports.getCrypto = getCrypto; exports.getDocument = getDocument; exports.getExceptionName = getExceptionName; exports.getFieldValueType = getFieldValueType; exports.getGlobal = getGlobal; exports.getGlobalInst = getGlobalInst; exports.getHistory = getHistory; exports.getIEVersion = getIEVersion; exports.getISOString = toISOString; exports.getJSON = getJSON; exports.getLocation = getLocation; exports.getMsCrypto = getMsCrypto; exports.getNavigator = getNavigator; exports.getPerformance = getPerformance; exports.getSetValue = getSetValue; exports.getTenantId = getTenantId; exports.getTime = getTime; exports.getWindow = getWindow; exports.hasDocument = hasDocument; exports.hasHistory = hasHistory; exports.hasJSON = hasJSON; exports.hasNavigator = hasNavigator; exports.hasOwnProperty = hasOwnProperty; exports.hasWindow = hasWindow; exports.isArray = isArray; exports.isArrayValid = isArrayValid; exports.isBeaconsSupported = isBeaconsSupported; exports.isBoolean = isBoolean; exports.isChromium = isChromium; exports.isDate = isDate; exports.isDocumentObjectAvailable = isDocumentObjectAvailable; exports.isError = isError; exports.isFetchSupported = isFetchSupported; exports.isFunction = isFunction; exports.isIE = isIE; exports.isLatency = isLatency; exports.isNotTruthy = isNotTruthy; exports.isNullOrUndefined = isNullOrUndefined; exports.isNumber = isNumber; exports.isObject = isObject; exports.isReactNative = isReactNative; exports.isString = isString; exports.isTruthy = isTruthy; exports.isTypeof = isTypeof; exports.isUint8ArrayAvailable = isUint8ArrayAvailable; exports.isUndefined = isUndefined; exports.isValueAssigned = isValueAssigned; exports.isValueKind = isValueKind; exports.isWindowObjectAvailable = isWindowObjectAvailable; exports.isXhrSupported = isXhrSupported; exports.mergeEvtNamespace = mergeEvtNamespace; exports.newGuid = newGuid; exports.newId = newId; exports.normalizeJsName = normalizeJsName; exports.objCreate = objCreateFn; exports.objDefineAccessors = objDefineAccessors; exports.objForEachKey = objForEachKey; exports.objFreeze = objFreeze; exports.objKeys = objKeys; exports.objSeal = objSeal; exports.openXhr = openXhr; exports.optimizeObject = optimizeObject; exports.perfNow = perfNow; exports.proxyAssign = proxyAssign; exports.proxyFunctionAs = proxyFunctionAs; exports.proxyFunctions = proxyFunctions; exports.random32 = random32; exports.randomValue = randomValue; exports.removeEventHandler = removeEventHandler; exports.removeEventListeners = removeEventListeners; exports.removePageHideEventListener = removePageHideEventListener; exports.removePageShowEventListener = removePageShowEventListener; exports.removePageUnloadEventListener = removePageUnloadEventListener; exports.safeGetCookieMgr = safeGetCookieMgr; exports.safeGetLogger = safeGetLogger; exports.sanitizeProperty = sanitizeProperty; exports.setCookie = setCookie; exports.setEnableEnvMocks = setEnableEnvMocks; exports.setProcessTelemetryTimings = setProcessTelemetryTimings; exports.setValue = setValue; exports.strContains = strContains; exports.strEndsWith = strEndsWith; exports.strFunction = strShimFunction; exports.strObject = strShimObject; exports.strPrototype = strShimPrototype; exports.strStartsWith = strStartsWith; exports.strTrim = strTrim; exports.strUndefined = strShimUndefined; exports.throwError = throwError; exports.toISOString = toISOString; exports.useXDomainRequest = useXDomainRequest; (function(obj, prop, descriptor) { /* ai_es3_polyfil defineProperty */ var func = Object["defineProperty"]; if (func) { try { return func(obj, prop, descriptor); } catch(e) { /* IE8 defines defineProperty, but will throw */ } } if (descriptor && typeof descriptor.value !== undefined) { obj[prop] = descriptor.value; } return obj; })(exports, '__esModule', { value: true }); }));//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/1ds-core-js/bundle/ms.core-3.2.2.js.map /*! * 1DS JS SDK Core, 3.2.2 * Copyright (c) Microsoft and contributors. All rights reserved. * (Microsoft Internal Only) */ var n=this,e=function(n){"use strict";var I="function",u="object",e="undefined",f="prototype",P="hasOwnProperty",t=Object,E=t[f],N=t.assign,z=t.create,V=t.defineProperty,B=E[P],H=null;function K(n){return void 0===n&&(n=!0),H&&n||(typeof globalThis!==e&&globalThis&&(H=globalThis),typeof self!==e&&self&&(H=self),typeof window!==e&&window&&(H=window),typeof global!==e&&global&&(H=global)),H}function q(n){throw new TypeError(n)}function W(n){if(z)return z(n);if(null==n)return{};var e=typeof n;function t(){}return e!==u&&e!==I&&q("Object prototype may only be an Object:"+n),t[f]=n,new t}(K()||{}).Symbol,(K()||{}).Reflect;var G=N||function(n){for(var e,t=1,r=arguments.length;t=o.maxInternalMessageLimit()||(r=!0,t="AITR_"+e.messageId,a[t]?r=!1:a[t]=!0,r&&(n<=o.telemetryLoggingLevel()&&(o.queue.push(e),i++,u(1===n?"error":"warn",e)),i===o.maxInternalMessageLimit()&&(r=new wt(23,t="Internal events throttle limit per PageView reached for this app.",!1),o.queue.push(r),1===n?o.errorToConsole(t):o.warnToConsole(t))))}})};function j(n,e,t,r,i,o){void 0===o&&(o=!1),(n||new Pt).throwInternal(e,t,r,i,o)}l.ParentContextKey="parent",l.ChildrenContextKey="childEvts";var Et=l;function l(n,i,e){var t,o=this,u=!1;o.start=te(),o.name=n,o.isAsync=e,o.isChildEvt=function(){return!1},_(i)&&(u=ne(o,"payload",function(){return!t&&_(i)&&(t=i(),i=null),t})),o.getCtx=function(n){return n?(n===l.ParentContextKey||n===l.ChildrenContextKey?o:o.ctx||{})[n]:null},o.setCtx=function(n,e){n&&(n===l.ParentContextKey?(o[n]||(o.isChildEvt=function(){return!0}),o[n]=e):n===l.ChildrenContextKey?o[n]=e:(o.ctx=o.ctx||{})[n]=e)},o.complete=function(){var n=0,e=o.getCtx(l.ChildrenContextKey);if(m(e))for(var t=0;t>>=0),Ft=123456789+n&c,Ot=987654321-n&c,Mt=!0}function Dt(){try{var n=2147483647&te();Lt((Math.random()*_t^n)+n)}catch(e){}}function Ut(n){return 0>>0:0}function jt(n){var e=0,t=st()||ft();return 0===(e=t&&t.getRandomValues?t.getRandomValues(new Uint32Array(1))[0]&c:e)&>()&&(Mt||Dt(),e=Rt()&c),0===e&&(e=Math.floor(_t*Math.random()|0)),n||(e>>>=0),e}function Rt(n){var e=((Ot=36969*(65535&Ot)+(Ot>>16)&c)<<16)+(65535&(Ft=18e3*(65535&Ft)+(Ft>>16)&c))>>>0&c|0;return n||(e>>>=0),e}function zt(n){void 0===n&&(n=22);for(var e=jt()>>>0,t=0,r=g;r.length>>=6,5==++t&&(e=(jt()<<2&4294967295|3&e)>>>0,t=0);return r}var Vt=V,Bt="2.8.3",Ht="."+zt(6),Kt=0;function qt(n){return 1===n.nodeType||9===n.nodeType||!+n.nodeType}function Wt(n,e){return Vn(n+Kt+++((e=void 0!==e&&e)?"."+Bt:"")+Ht)}function Gt(n){var o={id:Wt("_aiData-"+(n||"")+"."+Bt),accept:qt,get:function(n,e,t,r){var i=n[o.id];return i?i[Vn(e)]:(r&&((i=function(n,e){var t=e[n.id];if(!t){t={};try{qt(e)&&!function(n,e,t){if(Vt)try{return Vt(n,e,{value:t,enumerable:!1,configurable:!0}),1}catch(r){}}(e,n.id,t)&&(e[n.id]=t)}catch(r){}}return t}(o,n))[Vn(e)]=t),t)},kill:function(n,e){if(n&&n[e])try{delete n[e]}catch(t){}}};return o}var Jt=Gt("plugin");function Xt(n){return Jt.get(n,"state",{},!0)}function Qt(t,r){for(var i,n=[],e=null,o=t.getNext();o;){var u=o.getPlugin();u&&(e&&_(e[Y])&&_(u[$])&&e[Y](u),(_(u[nn])?u[nn]():(i=Xt(u))[nn])||n.push(u),e=u,o=o.getNext())}M(n,function(n){var e=t.core();n.initialize(t.getCfg(),e,r,t.getNext()),i=Xt(n),n[d]||i[d]||(i[d]=e),i[nn]=!0,delete i[A]})}function $t(n){return n.sort(function(n,e){var t=0,r=_(e[$]);return _(n[$])?t=r?n[Z]-e[Z]:1:r&&(t=-1),t})}var Zt="TelemetryPluginChain",Yt="_hasRun",nr="_getTelCtx",er=0;function tr(n,u,t,e){var r=null,i=[],o=(null!==e&&(r=e?function(n,e,t){for(;n;){if(n.getPlugin()===t)return n;n=n.getNext()}return or([t],e.config||{},e)}(n,t,e):n),{_next:function(){var n,e=r;return r=e?e.getNext():null,e||(n=i)&&0_r&&l.push(n)}),Fr(c,l,t,a)),c)),w?(-1!==(d=F(v,w))&&v.splice(d,1),-1!==(d=F(b,w))&&b.splice(d,1),w._setQueue(I)):(s=I,f=m,g=!1,(d={identifier:"ChannelControllerPlugin",priority:_r,initialize:function(e,t,r,n){g=!0,M(s,function(n){n&&0>4&15]+e[n>>8&15]+e[n>>12&15]+e[n>>16&15]+e[n>>20&15]+e[n>>24&15]+e[n>>28&15];var i=e[8+(3&jt())|0];return t.substr(0,8)+t.substr(9,4)+"4"+t.substr(13,3)+i+t.substr(16,3)+t.substr(19,12)}var Mi=/[xy]/g,Fi={Attach:Si,AttachEvent:Si,Detach:bi,DetachEvent:bi},Oi=i({CRITICAL:1,WARNING:2}),Li=i({BrowserDoesNotSupportLocalStorage:0,BrowserCannotReadLocalStorage:1,BrowserCannotReadSessionStorage:2,BrowserCannotWriteLocalStorage:3,BrowserCannotWriteSessionStorage:4,BrowserFailedRemovalFromLocalStorage:5,BrowserFailedRemovalFromSessionStorage:6,CannotSendEmptyTelemetry:7,ClientPerformanceMathError:8,ErrorParsingAISessionCookie:9,ErrorPVCalc:10,ExceptionWhileLoggingError:11,FailedAddingTelemetryToBuffer:12,FailedMonitorAjaxAbort:13,FailedMonitorAjaxDur:14,FailedMonitorAjaxOpen:15,FailedMonitorAjaxRSC:16,FailedMonitorAjaxSend:17,FailedMonitorAjaxGetCorrelationHeader:18,FailedToAddHandlerForOnBeforeUnload:19,FailedToSendQueuedTelemetry:20,FailedToReportDataLoss:21,FlushFailed:22,MessageLimitPerPVExceeded:23,MissingRequiredFieldSpecification:24,NavigationTimingNotSupported:25,OnError:26,SessionRenewalDateIsZero:27,SenderNotInitialized:28,StartTrackEventFailed:29,StopTrackEventFailed:30,StartTrackFailed:31,StopTrackFailed:32,TelemetrySampledAndNotSent:33,TrackEventFailed:34,TrackExceptionFailed:35,TrackMetricFailed:36,TrackPVFailed:37,TrackPVFailedCalc:38,TrackTraceFailed:39,TransmissionFailed:40,FailedToSetStorageBuffer:41,FailedToRestoreStorageBuffer:42,InvalidBackendResponse:43,FailedToFixDepricatedValues:44,InvalidDurationValue:45,TelemetryEnvelopeInvalid:46,CreateEnvelopeError:47,CannotSerializeObject:48,CannotSerializeObjectNonSerializable:49,CircularReferenceDetected:50,ClearAuthContextFailed:51,ExceptionTruncated:52,IllegalCharsInName:53,ItemNotInArray:54,MaxAjaxPerPVExceeded:55,MessageTruncated:56,NameTooLong:57,SampleRateOutOfRange:58,SetAuthContextFailed:59,SetAuthContextFailedAccountName:60,StringValueTooLong:61,StartCalledMoreThanOnce:62,StopCalledWithoutStart:63,TelemetryInitializerFailed:64,TrackArgumentsNotSpecified:65,UrlTooLong:66,SessionStorageBufferFull:67,CannotAccessCookie:68,IdTooLong:69,InvalidEvent:70,FailedMonitorAjaxSetRequestHeader:71,SendBrowserInfoOnUserInit:72,PluginException:73,NotificationException:74,SnippetScriptLoadFailure:99,InvalidInstrumentationKey:100,CannotParseAiBlobValue:101,InvalidContentBlob:102,TrackPageActionEventFailed:103,FailedAddingCustomDefinedRequestContext:104,InMemoryStorageBufferFull:105}),Di=i({NotSet:0,Pii_DistinguishedName:1,Pii_GenericData:2,Pii_IPV4Address:3,Pii_IPv6Address:4,Pii_MailSubject:5,Pii_PhoneNumber:6,Pii_QueryString:7,Pii_SipAddress:8,Pii_SmtpAddress:9,Pii_Identity:10,Pii_Uri:11,Pii_Fqdn:12,Pii_IPV4AddressLegacy:13,CustomerContent_GenericContent:32}),Ui=i({Normal:1,CostDeferred:2,RealTime:3,Immediate:4}),ji=i({Unspecified:0,String:1,Int32:2,UInt32:3,Int64:4,UInt64:5,Double:6,Bool:7,Guid:8,DateTime:9}),Ri=i({Normal:1,Critical:2}),zi=i({NONE:0,ERROR:1,WARNING:2,INFORMATION:3}),G=O(G(G({},Li),i({AuthHandShakeError:501,AuthRedirectFail:502,BrowserCannotReadLocalStorage:503,BrowserCannotWriteLocalStorage:504,BrowserDoesNotSupportLocalStorage:505,CannotParseBiBlobValue:506,CannotParseDataAttribute:507,CVPluginNotAvailable:508,DroppedEvent:509,ErrorParsingAISessionCookie:510,ErrorProvidedChannels:511,FailedToGetCookies:512,FailedToInitializeCorrelationVector:513,FailedToInitializeSDK:514,InvalidContentBlob:515,InvalidCorrelationValue:516,SessionRenewalDateIsZero:517,SendPostOnCompleteFailure:518,PostResponseHandler:519,SDKNotInitialized:520}))),Vi="3.2.2",Bi="1DS-Web-JS-"+Vi,Hi="withCredentials",Ki=((s={})[0]=0,s[2]=6,s[1]=1,s[3]=7,s[4098]=6,s[4097]=1,s[4099]=7,s),qi=null,Wi=!!a(),s=!!nt();function Gi(n){return!(""===n||k(n))}function Ji(n){if(n){var e=n.indexOf("-");if(-1")+"."+wo;function y(n){var e=K();e&&e.QUnit&&console&&console.log("ESPromiseScheduler["+m+"] "+n)}function C(n){e&&e.warnToConsole("ESPromiseScheduler["+m+"] "+n)}wo++,U(No,this,function(n){var g=null,v=0;function p(n,e){for(var t=0;t=o&&!(n=r===i)){for(var u=0;u= searchLen && !(result = value === search)) { var pos = valLen - 1; for (var lp = searchLen - 1; lp >= 0; lp--) { if (value[pos] != search[lp]) { return false; } pos--; } result = true; } return result; } function strStartsWith(value, checkValue) { var result = false; if (value && checkValue && !(result = value === checkValue)) { result = _strStartsWith ? value[cStrStartsWith](checkValue) : _strStartsWithPoly(value, checkValue); } return result; } function _strStartsWithPoly(value, checkValue) { var result = false; var chkLen = checkValue ? checkValue.length : 0; if (value && chkLen && value.length >= chkLen && !(result = value === checkValue)) { for (var lp = 0; lp < chkLen; lp++) { if (value[lp] !== checkValue[lp]) { return false; } } result = true; } return result; } function strContains(value, search) { if (value && search) { return value.indexOf(search) !== -1; } return false; } function isDate(obj) { return !!(obj && _objToString.call(obj) === "[object Date]"); } var isArray = _isArray || _isArrayPoly; function _isArrayPoly(obj) { return !!(obj && _objToString.call(obj) === "[object Array]"); } function isError(obj) { return !!(obj && _objToString.call(obj) === "[object Error]"); } function isString(value) { return typeof value === "string"; } function isNumber(value) { return typeof value === "number"; } function isBoolean(value) { return typeof value === "boolean"; } function isPlainObject(value) { var result = false; if (value && typeof value === "object") { var proto = _objGetPrototypeOf$1 ? _objGetPrototypeOf$1(value) : _getObjProto$1(value); if (!proto) { result = true; } else { if (proto[strConstructor] && ObjHasOwnProperty.call(proto, strConstructor)) { proto = proto[strConstructor]; } result = typeof proto === strShimFunction && _fnToString.call(proto) === _objFunctionString; } } return result; } function toISOString(date) { if (date) { return _dataToISOString ? date[strToISOString]() : _toISOStringPoly(date); } } function _toISOStringPoly(date) { if (date && date.getUTCFullYear) { var pad = function (num) { var r = String(num); if (r.length === 1) { r = "0" + r; } return r; }; return date.getUTCFullYear() + "-" + pad(date.getUTCMonth() + 1) + "-" + pad(date.getUTCDate()) + "T" + pad(date.getUTCHours()) + ":" + pad(date.getUTCMinutes()) + ":" + pad(date.getUTCSeconds()) + "." + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5) + "Z"; } } function arrForEach(arr, callbackfn, thisArg) { var len = arr.length; try { for (var idx = 0; idx < len; idx++) { if (idx in arr) { if (callbackfn.call(thisArg || arr, arr[idx], idx, arr) === -1) { break; } } } } catch (e) { } } function arrIndexOf(arr, searchElement, fromIndex) { if (arr) { if (arr[strIndexOf]) { return arr[strIndexOf](searchElement, fromIndex); } var len = arr.length; var from = fromIndex || 0; try { for (var lp = Math.max(from >= 0 ? from : len - Math.abs(from), 0); lp < len; lp++) { if (lp in arr && arr[lp] === searchElement) { return lp; } } } catch (e) { } } return -1; } function arrMap(arr, callbackfn, thisArg) { var results; if (arr) { if (arr[strMap]) { return arr[strMap](callbackfn, thisArg); } var len = arr.length; var _this = thisArg || arr; results = new Array(len); try { for (var lp = 0; lp < len; lp++) { if (lp in arr) { results[lp] = callbackfn.call(_this, arr[lp], arr); } } } catch (e) { } } return results; } function arrReduce(arr, callbackfn, initialValue) { var value; if (arr) { if (arr[strReduce]) { return arr[strReduce](callbackfn, initialValue); } var len = arr.length; var lp = 0; if (arguments.length >= 3) { value = arguments[2]; } else { while (lp < len && !(lp in arr)) { lp++; } value = arr[lp++]; } while (lp < len) { if (lp in arr) { value = callbackfn(value, arr[lp], lp, arr); } lp++; } } return value; } function strTrim(str) { if (str) { str = (_strTrim && str[cStrTrim]) ? str[cStrTrim]() : (str.replace ? str.replace(/^\s+|\s+$/g, "") : str); } return str; } var _objKeysHasDontEnumBug = !({ toString: null }).propertyIsEnumerable("toString"); var _objKeysDontEnums = [ "toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor" ]; function objKeys(obj) { var objType = typeof obj; if (objType !== strShimFunction && (objType !== strShimObject || obj === null)) { throwTypeError("objKeys called on non-object"); } if (!_objKeysHasDontEnumBug && _objKeys) { return _objKeys(obj); } var result = []; for (var prop in obj) { if (obj && ObjHasOwnProperty.call(obj, prop)) { result.push(prop); } } if (_objKeysHasDontEnumBug) { var dontEnumsLength = _objKeysDontEnums.length; for (var lp = 0; lp < dontEnumsLength; lp++) { if (obj && ObjHasOwnProperty.call(obj, _objKeysDontEnums[lp])) { result.push(_objKeysDontEnums[lp]); } } } return result; } function objDefineAccessors(target, prop, getProp, setProp) { if (_objDefineProperty$1) { try { var descriptor = { enumerable: true, configurable: true }; if (getProp) { descriptor.get = getProp; } if (setProp) { descriptor.set = setProp; } _objDefineProperty$1(target, prop, descriptor); return true; } catch (e) { } } return false; } function _doNothing(value) { return value; } function deepFreeze(obj) { if (_objFreeze) { objForEachKey(obj, function (name, value) { if (isArray(value) || isObject(value)) { _objFreeze(value); } }); } return objFreeze(obj); } var objFreeze = _objFreeze || _doNothing; var objSeal = _objSeal || _doNothing; function dateNow() { var dt = Date; return dt.now ? dt.now() : new dt().getTime(); } function getExceptionName(object) { if (isError(object)) { return object.name; } return strEmpty; } function setValue(target, field, value, valChk, srcChk) { var theValue = value; if (target) { theValue = target[field]; if (theValue !== value && (!srcChk || srcChk(theValue)) && (!valChk || valChk(value))) { theValue = value; target[field] = theValue; } } return theValue; } function getSetValue(target, field, defValue) { var theValue; if (target) { theValue = target[field]; if (!theValue && isNullOrUndefined(theValue)) { theValue = !isUndefined(defValue) ? defValue : {}; target[field] = theValue; } } else { theValue = !isUndefined(defValue) ? defValue : {}; } return theValue; } function isNotTruthy(value) { return !value; } function isTruthy(value) { return !!value; } function throwError(message) { throw new Error(message); } function _createProxyFunction(source, funcName) { var srcFunc = null; var src = null; if (isFunction(source)) { srcFunc = source; } else { src = source; } return function () { var originalArguments = arguments; if (srcFunc) { src = srcFunc(); } if (src) { return src[funcName].apply(src, originalArguments); } }; } function proxyAssign(target, source, chkSet) { if (target && source && isObject(target) && isObject(source)) { var _loop_1 = function (field) { if (isString(field)) { var value = source[field]; if (isFunction(value)) { if (!chkSet || chkSet(field, true, source, target)) { target[field] = _createProxyFunction(source, field); } } else if (!chkSet || chkSet(field, false, source, target)) { if (hasOwnProperty(target, field)) { delete target[field]; } if (!objDefineAccessors(target, field, function () { return source[field]; }, function (theValue) { source[field] = theValue; })) { target[field] = value; } } } }; for (var field in source) { _loop_1(field); } } return target; } function proxyFunctionAs(target, name, source, theFunc, overwriteTarget) { if (target && name && source) { if (overwriteTarget !== false || isUndefined(target[name])) { target[name] = _createProxyFunction(source, theFunc); } } } function proxyFunctions(target, source, functionsToProxy, overwriteTarget) { if (target && source && isObject(target) && isArray(functionsToProxy)) { arrForEach(functionsToProxy, function (theFuncName) { if (isString(theFuncName)) { proxyFunctionAs(target, theFuncName, source, theFuncName, overwriteTarget); } }); } return target; } function optimizeObject(theObject) { if (theObject && ObjAssign) { theObject = ObjClass(ObjAssign({}, theObject)); } return theObject; } function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) { var theArgs = arguments; var extended = theArgs[0] || {}; var argLen = theArgs.length; var deep = false; var idx = 1; if (argLen > 0 && isBoolean(extended)) { deep = extended; extended = theArgs[idx] || {}; idx++; } if (!isObject(extended)) { extended = {}; } for (; idx < argLen; idx++) { var arg = theArgs[idx]; var isArgArray = isArray(arg); var isArgObj = isObject(arg); for (var prop in arg) { var propOk = (isArgArray && (prop in arg)) || (isArgObj && (ObjHasOwnProperty.call(arg, prop))); if (!propOk) { continue; } var newValue = arg[prop]; var isNewArray = void 0; if (deep && newValue && ((isNewArray = isArray(newValue)) || isPlainObject(newValue))) { var clone = extended[prop]; if (isNewArray) { if (!isArray(clone)) { clone = []; } } else if (!isPlainObject(clone)) { clone = {}; } newValue = objExtend(deep, clone, newValue); } if (newValue !== undefined) { extended[prop] = newValue; } } } return extended; } function createEnumStyle(values) { var enumClass = {}; objForEachKey(values, function (field, value) { enumClass[field] = value; enumClass[value] = field; }); return deepFreeze(enumClass); } var EventsDiscardedReason = createEnumStyle({ Unknown: 0 , NonRetryableStatus: 1 , InvalidEvent: 2 , SizeLimitExceeded: 3 , KillSwitch: 4 , QueueFull: 5 }); /*! * Microsoft Dynamic Proto Utility, 1.1.6 * Copyright (c) Microsoft and contributors. All rights reserved. */ var Constructor = 'constructor'; var Prototype = 'prototype'; var strFunction = 'function'; var DynInstFuncTable = '_dynInstFuncs'; var DynProxyTag = '_isDynProxy'; var DynClassName = '_dynClass'; var DynClassNamePrefix = '_dynCls$'; var DynInstChkTag = '_dynInstChk'; var DynAllowInstChkTag = DynInstChkTag; var DynProtoDefaultOptions = '_dfOpts'; var UnknownValue = '_unknown_'; var str__Proto = "__proto__"; var DynProtoBaseProto = "_dyn" + str__Proto; var DynProtoCurrent = "_dynInstProto"; var strUseBaseInst = 'useBaseInst'; var strSetInstFuncs = 'setInstFuncs'; var Obj = Object; var _objGetPrototypeOf = Obj["getPrototypeOf"]; var _objGetOwnProps = Obj["getOwnPropertyNames"]; var _dynamicNames = 0; function _hasOwnProperty(obj, prop) { return obj && Obj[Prototype].hasOwnProperty.call(obj, prop); } function _isObjectOrArrayPrototype(target) { return target && (target === Obj[Prototype] || target === Array[Prototype]); } function _isObjectArrayOrFunctionPrototype(target) { return _isObjectOrArrayPrototype(target) || target === Function[Prototype]; } function _getObjProto(target) { var newProto; if (target) { if (_objGetPrototypeOf) { return _objGetPrototypeOf(target); } var curProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null); newProto = target[DynProtoBaseProto] || curProto; if (!_hasOwnProperty(target, DynProtoBaseProto)) { delete target[DynProtoCurrent]; newProto = target[DynProtoBaseProto] = target[DynProtoCurrent] || target[DynProtoBaseProto]; target[DynProtoCurrent] = curProto; } } return newProto; } function _forEachProp(target, func) { var props = []; if (_objGetOwnProps) { props = _objGetOwnProps(target); } else { for (var name_1 in target) { if (typeof name_1 === "string" && _hasOwnProperty(target, name_1)) { props.push(name_1); } } } if (props && props.length > 0) { for (var lp = 0; lp < props.length; lp++) { func(props[lp]); } } } function _isDynamicCandidate(target, funcName, skipOwn) { return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName))); } function _throwTypeError(message) { throw new TypeError("DynamicProto: " + message); } function _getInstanceFuncs(thisTarget) { var instFuncs = {}; _forEachProp(thisTarget, function (name) { if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) { instFuncs[name] = thisTarget[name]; } }); return instFuncs; } function _hasVisited(values, value) { for (var lp = values.length - 1; lp >= 0; lp--) { if (values[lp] === value) { return true; } } return false; } function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) { function _instFuncProxy(target, funcHost, funcName) { var theFunc = funcHost[funcName]; if (theFunc[DynProxyTag] && useBaseInst) { var instFuncTable = target[DynInstFuncTable] || {}; if (instFuncTable[DynAllowInstChkTag] !== false) { theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc; } } return function () { return theFunc.apply(target, arguments); }; } var baseFuncs = {}; _forEachProp(instFuncs, function (name) { baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name); }); var baseProto = _getObjProto(classProto); var visited = []; while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) { _forEachProp(baseProto, function (name) { if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) { baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name); } }); visited.push(baseProto); baseProto = _getObjProto(baseProto); } return baseFuncs; } function _getInstFunc(target, funcName, proto, currentDynProtoProxy) { var instFunc = null; if (target && _hasOwnProperty(proto, DynClassName)) { var instFuncTable = target[DynInstFuncTable] || {}; instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName]; if (!instFunc) { _throwTypeError("Missing [" + funcName + "] " + strFunction); } if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) { var canAddInst = !_hasOwnProperty(target, funcName); var objProto = _getObjProto(target); var visited = []; while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) { var protoFunc = objProto[funcName]; if (protoFunc) { canAddInst = (protoFunc === currentDynProtoProxy); break; } visited.push(objProto); objProto = _getObjProto(objProto); } try { if (canAddInst) { target[funcName] = instFunc; } instFunc[DynInstChkTag] = 1; } catch (e) { instFuncTable[DynAllowInstChkTag] = false; } } } return instFunc; } function _getProtoFunc(funcName, proto, currentDynProtoProxy) { var protoFunc = proto[funcName]; if (protoFunc === currentDynProtoProxy) { protoFunc = _getObjProto(proto)[funcName]; } if (typeof protoFunc !== strFunction) { _throwTypeError("[" + funcName + "] is not a " + strFunction); } return protoFunc; } function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) { function _createDynamicPrototype(proto, funcName) { var dynProtoProxy = function () { var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy); return instFunc.apply(this, arguments); }; dynProtoProxy[DynProxyTag] = 1; return dynProtoProxy; } if (!_isObjectOrArrayPrototype(proto)) { var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {}; var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {}); if (instFuncTable[DynAllowInstChkTag] !== false) { instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc; } _forEachProp(target, function (name) { if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) { instFuncs_1[name] = target[name]; delete target[name]; if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) { proto[name] = _createDynamicPrototype(proto, name); } } }); } } function _checkPrototype(classProto, thisTarget) { if (_objGetPrototypeOf) { var visited = []; var thisProto = _getObjProto(thisTarget); while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) { if (thisProto === classProto) { return true; } visited.push(thisProto); thisProto = _getObjProto(thisProto); } return false; } return true; } function _getObjName(target, unknownValue) { if (_hasOwnProperty(target, Prototype)) { return target.name || unknownValue || UnknownValue; } return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue; } function dynamicProto(theClass, target, delegateFunc, options) { if (!_hasOwnProperty(theClass, Prototype)) { _throwTypeError("theClass is an invalid class definition."); } var classProto = theClass[Prototype]; if (!_checkPrototype(classProto, target)) { _throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]"); } var className = null; if (_hasOwnProperty(classProto, DynClassName)) { className = classProto[DynClassName]; } else { className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _dynamicNames; _dynamicNames++; classProto[DynClassName] = className; } var perfOptions = dynamicProto[DynProtoDefaultOptions]; var useBaseInst = !!perfOptions[strUseBaseInst]; if (useBaseInst && options && options[strUseBaseInst] !== undefined) { useBaseInst = !!options[strUseBaseInst]; } var instFuncs = _getInstanceFuncs(target); var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst); delegateFunc(target, baseFuncs); var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs]; if (setInstanceFunc && options) { setInstanceFunc = !!options[strSetInstFuncs]; } _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false); } var perfDefaults = { setInstFuncs: true, useBaseInst: true }; dynamicProto[DynProtoDefaultOptions] = perfDefaults; var strWindow = "window"; var strDocument = "document"; var strDocumentMode = "documentMode"; var strNavigator = "navigator"; var strHistory = "history"; var strLocation = "location"; var strConsole = "console"; var strPerformance = "performance"; var strJSON = "JSON"; var strCrypto = "crypto"; var strMsCrypto = "msCrypto"; var strReactNative = "ReactNative"; var strMsie = "msie"; var strTrident = "trident/"; var strXMLHttpRequest = "XMLHttpRequest"; var _isTrident = null; var _navUserAgentCheck = null; var _enableMocks = false; var _useXDomainRequest = null; var _beaconsSupported = null; function _hasProperty(theClass, property) { var supported = false; if (theClass) { try { supported = property in theClass; if (!supported) { var proto = theClass[strShimPrototype]; if (proto) { supported = property in proto; } } } catch (e) { } if (!supported) { try { var tmp = new theClass(); supported = !isUndefined(tmp[property]); } catch (e) { } } } return supported; } function setEnableEnvMocks(enabled) { _enableMocks = enabled; } function getGlobalInst(name) { var gbl = getGlobal(); if (gbl && gbl[name]) { return gbl[name]; } if (name === strWindow && hasWindow()) { return window; } return null; } function hasWindow() { return Boolean(typeof window === strShimObject && window); } function getWindow() { if (hasWindow()) { return window; } return getGlobalInst(strWindow); } function hasDocument() { return Boolean(typeof document === strShimObject && document); } function getDocument() { if (hasDocument()) { return document; } return getGlobalInst(strDocument); } function hasNavigator() { return Boolean(typeof navigator === strShimObject && navigator); } function getNavigator() { if (hasNavigator()) { return navigator; } return getGlobalInst(strNavigator); } function hasHistory() { return Boolean(typeof history === strShimObject && history); } function getHistory() { if (hasHistory()) { return history; } return getGlobalInst(strHistory); } function getLocation(checkForMock) { if (checkForMock && _enableMocks) { var mockLocation = getGlobalInst("__mockLocation"); if (mockLocation) { return mockLocation; } } if (typeof location === strShimObject && location) { return location; } return getGlobalInst(strLocation); } function getConsole() { if (typeof console !== strShimUndefined) { return console; } return getGlobalInst(strConsole); } function getPerformance() { return getGlobalInst(strPerformance); } function hasJSON() { return Boolean((typeof JSON === strShimObject && JSON) || getGlobalInst(strJSON) !== null); } function getJSON() { if (hasJSON()) { return JSON || getGlobalInst(strJSON); } return null; } function getCrypto() { return getGlobalInst(strCrypto); } function getMsCrypto() { return getGlobalInst(strMsCrypto); } function isReactNative() { var nav = getNavigator(); if (nav && nav.product) { return nav.product === strReactNative; } return false; } function isIE() { var nav = getNavigator(); if (nav && (nav.userAgent !== _navUserAgentCheck || _isTrident === null)) { _navUserAgentCheck = nav.userAgent; var userAgent = (_navUserAgentCheck || strEmpty).toLowerCase(); _isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident)); } return _isTrident; } function getIEVersion(userAgentStr) { if (userAgentStr === void 0) { userAgentStr = null; } if (!userAgentStr) { var navigator_1 = getNavigator() || {}; userAgentStr = navigator_1 ? (navigator_1.userAgent || strEmpty).toLowerCase() : strEmpty; } var ua = (userAgentStr || strEmpty).toLowerCase(); if (strContains(ua, strMsie)) { var doc = getDocument() || {}; return Math.max(parseInt(ua.split(strMsie)[1]), (doc[strDocumentMode] || 0)); } else if (strContains(ua, strTrident)) { var tridentVer = parseInt(ua.split(strTrident)[1]); if (tridentVer) { return tridentVer + 4; } } return null; } function dumpObj(object) { var objectTypeDump = Object[strShimPrototype].toString.call(object); var propertyValueDump = strEmpty; if (objectTypeDump === "[object Error]") { propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'"; } else if (hasJSON()) { propertyValueDump = getJSON().stringify(object); } return objectTypeDump + propertyValueDump; } function isBeaconsSupported() { if (_beaconsSupported === null) { _beaconsSupported = hasNavigator() && Boolean(getNavigator().sendBeacon); } return _beaconsSupported; } function isFetchSupported(withKeepAlive) { var isSupported = false; try { isSupported = !!getGlobalInst("fetch"); var request = getGlobalInst("Request"); if (isSupported && withKeepAlive && request) { isSupported = _hasProperty(request, "keepalive"); } } catch (e) { } return isSupported; } function useXDomainRequest() { if (_useXDomainRequest === null) { _useXDomainRequest = (typeof XDomainRequest !== strShimUndefined); if (_useXDomainRequest && isXhrSupported()) { _useXDomainRequest = _useXDomainRequest && !_hasProperty(getGlobalInst(strXMLHttpRequest), "withCredentials"); } } return _useXDomainRequest; } function isXhrSupported() { var isSupported = false; try { var xmlHttpRequest = getGlobalInst(strXMLHttpRequest); isSupported = !!xmlHttpRequest; } catch (e) { } return isSupported; } var listenerFuncs = ["eventsSent", "eventsDiscarded", "eventsSendRequest", "perfEvent"]; var _aiNamespace = null; var _debugListener; function _listenerProxyFunc(name, config) { return function () { var args = arguments; var dbgExt = getDebugExt(config); if (dbgExt) { var listener = dbgExt.listener; if (listener && listener[name]) { listener[name].apply(listener, args); } } }; } function _getExtensionNamespace() { var target = getGlobalInst("Microsoft"); if (target) { _aiNamespace = target["ApplicationInsights"]; } return _aiNamespace; } function getDebugExt(config) { var ns = _aiNamespace; if (!ns && config.disableDbgExt !== true) { ns = _aiNamespace || _getExtensionNamespace(); } return ns ? ns["ChromeDbgExt"] : null; } function getDebugListener(config) { if (!_debugListener) { _debugListener = {}; for (var lp = 0; lp < listenerFuncs.length; lp++) { _debugListener[listenerFuncs[lp]] = _listenerProxyFunc(listenerFuncs[lp], config); } } return _debugListener; } var AiNonUserActionablePrefix = "AI (Internal): "; var AiUserActionablePrefix = "AI: "; var AIInternalMessagePrefix = "AITR_"; var strErrorToConsole = "errorToConsole"; var strWarnToConsole = "warnToConsole"; function _sanitizeDiagnosticText(text) { if (text) { return "\"" + text.replace(/\"/g, strEmpty) + "\""; } return strEmpty; } function _logToConsole(func, message) { var theConsole = getConsole(); if (!!theConsole) { var logFunc = "log"; if (theConsole[func]) { logFunc = func; } if (isFunction(theConsole[logFunc])) { theConsole[logFunc](message); } } } var _InternalLogMessage = /** @class */ (function () { function _InternalLogMessage(msgId, msg, isUserAct, properties) { if (isUserAct === void 0) { isUserAct = false; } var _self = this; _self.messageId = msgId; _self.message = (isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) + msgId; var strProps = strEmpty; if (hasJSON()) { strProps = getJSON().stringify(properties); } var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : strEmpty) + (properties ? " props:" + _sanitizeDiagnosticText(strProps) : strEmpty); _self.message += diagnosticText; } _InternalLogMessage.dataType = "MessageData"; return _InternalLogMessage; }()); function safeGetLogger(core, config) { return (core || {}).logger || new DiagnosticLogger(config); } var DiagnosticLogger = /** @class */ (function () { function DiagnosticLogger(config) { this.identifier = "DiagnosticLogger"; this.queue = []; var _messageCount = 0; var _messageLogged = {}; dynamicProto(DiagnosticLogger, this, function (_self) { if (isNullOrUndefined(config)) { config = {}; } _self.consoleLoggingLevel = function () { return _getConfigValue("loggingLevelConsole", 0); }; _self.telemetryLoggingLevel = function () { return _getConfigValue("loggingLevelTelemetry", 1); }; _self.maxInternalMessageLimit = function () { return _getConfigValue("maxMessageLimit", 25); }; _self.enableDebugExceptions = function () { return _getConfigValue("enableDebugExceptions", false); }; _self.throwInternal = function (severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } var message = new _InternalLogMessage(msgId, msg, isUserAct, properties); if (_self.enableDebugExceptions()) { throw dumpObj(message); } else { var logFunc = severity === 1 ? strErrorToConsole : strWarnToConsole; if (!isUndefined(message.message)) { var logLevel = _self.consoleLoggingLevel(); if (isUserAct) { var messageKey = +message.messageId; if (!_messageLogged[messageKey] && logLevel >= severity) { _self[logFunc](message.message); _messageLogged[messageKey] = true; } } else { if (logLevel >= severity) { _self[logFunc](message.message); } } _self.logInternalMessage(severity, message); } else { _debugExtMsg("throw" + (severity === 1 ? "Critical" : "Warning"), message); } } }; _self.warnToConsole = function (message) { _logToConsole("warn", message); _debugExtMsg("warning", message); }; _self.errorToConsole = function (message) { _logToConsole("error", message); _debugExtMsg("error", message); }; _self.resetInternalMessageCount = function () { _messageCount = 0; _messageLogged = {}; }; _self.logInternalMessage = function (severity, message) { if (_areInternalMessagesThrottled()) { return; } var logMessage = true; var messageKey = AIInternalMessagePrefix + message.messageId; if (_messageLogged[messageKey]) { logMessage = false; } else { _messageLogged[messageKey] = true; } if (logMessage) { if (severity <= _self.telemetryLoggingLevel()) { _self.queue.push(message); _messageCount++; _debugExtMsg((severity === 1 ? "error" : "warn"), message); } if (_messageCount === _self.maxInternalMessageLimit()) { var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app."; var throttleMessage = new _InternalLogMessage(23 , throttleLimitMessage, false); _self.queue.push(throttleMessage); if (severity === 1 ) { _self.errorToConsole(throttleLimitMessage); } else { _self.warnToConsole(throttleLimitMessage); } } } }; function _getConfigValue(name, defValue) { var value = config[name]; if (!isNullOrUndefined(value)) { return value; } return defValue; } function _areInternalMessagesThrottled() { return _messageCount >= _self.maxInternalMessageLimit(); } function _debugExtMsg(name, data) { var dbgExt = getDebugExt(config); if (dbgExt && dbgExt.diagLog) { dbgExt.diagLog(name, data); } } }); } return DiagnosticLogger; }()); function _getLogger(logger) { return (logger || new DiagnosticLogger()); } function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } (logger || new DiagnosticLogger()).throwInternal(severity, msgId, msg, properties, isUserAct); } function _warnToConsole(logger, message) { _getLogger(logger).warnToConsole(message); } var strExecutionContextKey = "ctx"; var _defaultPerfManager = null; var PerfEvent = /** @class */ (function () { function PerfEvent(name, payloadDetails, isAsync) { var _self = this; var accessorDefined = false; _self.start = dateNow(); _self.name = name; _self.isAsync = isAsync; _self.isChildEvt = function () { return false; }; if (isFunction(payloadDetails)) { var theDetails_1; accessorDefined = objDefineAccessors(_self, "payload", function () { if (!theDetails_1 && isFunction(payloadDetails)) { theDetails_1 = payloadDetails(); payloadDetails = null; } return theDetails_1; }); } _self.getCtx = function (key) { if (key) { if (key === PerfEvent.ParentContextKey || key === PerfEvent.ChildrenContextKey) { return _self[key]; } return (_self[strExecutionContextKey] || {})[key]; } return null; }; _self.setCtx = function (key, value) { if (key) { if (key === PerfEvent.ParentContextKey) { if (!_self[key]) { _self.isChildEvt = function () { return true; }; } _self[key] = value; } else if (key === PerfEvent.ChildrenContextKey) { _self[key] = value; } else { var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {}; ctx[key] = value; } } }; _self.complete = function () { var childTime = 0; var childEvts = _self.getCtx(PerfEvent.ChildrenContextKey); if (isArray(childEvts)) { for (var lp = 0; lp < childEvts.length; lp++) { var childEvt = childEvts[lp]; if (childEvt) { childTime += childEvt.time; } } } _self.time = dateNow() - _self.start; _self.exTime = _self.time - childTime; _self.complete = function () { }; if (!accessorDefined && isFunction(payloadDetails)) { _self.payload = payloadDetails(); } }; } PerfEvent.ParentContextKey = "parent"; PerfEvent.ChildrenContextKey = "childEvts"; return PerfEvent; }()); var PerfManager = /** @class */ (function () { function PerfManager(manager) { this.ctx = {}; dynamicProto(PerfManager, this, function (_self) { _self.create = function (src, payloadDetails, isAsync) { return new PerfEvent(src, payloadDetails, isAsync); }; _self.fire = function (perfEvent) { if (perfEvent) { perfEvent.complete(); if (manager && isFunction(manager.perfEvent)) { manager.perfEvent(perfEvent); } } }; _self.setCtx = function (key, value) { if (key) { var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {}; ctx[key] = value; } }; _self.getCtx = function (key) { return (_self[strExecutionContextKey] || {})[key]; }; }); } return PerfManager; }()); var doPerfActiveKey = "CoreUtils.doPerf"; function doPerf(mgrSource, getSource, func, details, isAsync) { if (mgrSource) { var perfMgr = mgrSource; if (isFunction(perfMgr["getPerfMgr"])) { perfMgr = perfMgr["getPerfMgr"](); } if (perfMgr) { var perfEvt = void 0; var currentActive = perfMgr.getCtx(doPerfActiveKey); try { perfEvt = perfMgr.create(getSource(), details, isAsync); if (perfEvt) { if (currentActive && perfEvt.setCtx) { perfEvt.setCtx(PerfEvent.ParentContextKey, currentActive); if (currentActive.getCtx && currentActive.setCtx) { var children = currentActive.getCtx(PerfEvent.ChildrenContextKey); if (!children) { children = []; currentActive.setCtx(PerfEvent.ChildrenContextKey, children); } children.push(perfEvt); } } perfMgr.setCtx(doPerfActiveKey, perfEvt); return func(perfEvt); } } catch (ex) { if (perfEvt && perfEvt.setCtx) { perfEvt.setCtx("exception", ex); } } finally { if (perfEvt) { perfMgr.fire(perfEvt); } perfMgr.setCtx(doPerfActiveKey, currentActive); } } } return func(); } function getGblPerfMgr() { return _defaultPerfManager; } var UInt32Mask = 0x100000000; var MaxUInt32 = 0xffffffff; var _mwcSeeded = false; var _mwcW = 123456789; var _mwcZ = 987654321; function _mwcSeed(seedValue) { if (seedValue < 0) { seedValue >>>= 0; } _mwcW = (123456789 + seedValue) & MaxUInt32; _mwcZ = (987654321 - seedValue) & MaxUInt32; _mwcSeeded = true; } function _autoSeedMwc() { try { var now = dateNow() & 0x7fffffff; _mwcSeed(((Math.random() * UInt32Mask) ^ now) + now); } catch (e) { } } function randomValue(maxValue) { if (maxValue > 0) { return Math.floor((random32() / MaxUInt32) * (maxValue + 1)) >>> 0; } return 0; } function random32(signed) { var value = 0; var c = getCrypto() || getMsCrypto(); if (c && c.getRandomValues) { value = c.getRandomValues(new Uint32Array(1))[0] & MaxUInt32; } if (value === 0 && isIE()) { if (!_mwcSeeded) { _autoSeedMwc(); } value = mwcRandom32() & MaxUInt32; } if (value === 0) { value = Math.floor((UInt32Mask * Math.random()) | 0); } if (!signed) { value >>>= 0; } return value; } function mwcRandomSeed(value) { if (!value) { _autoSeedMwc(); } else { _mwcSeed(value); } } function mwcRandom32(signed) { _mwcZ = (36969 * (_mwcZ & 0xFFFF) + (_mwcZ >> 16)) & MaxUInt32; _mwcW = (18000 * (_mwcW & 0xFFFF) + (_mwcW >> 16)) & MaxUInt32; var value = (((_mwcZ << 16) + (_mwcW & 0xFFFF)) >>> 0) & MaxUInt32 | 0; if (!signed) { value >>>= 0; } return value; } function newId(maxLength) { if (maxLength === void 0) { maxLength = 22; } var base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; var number = random32() >>> 0; var chars = 0; var result = strEmpty; while (result.length < maxLength) { chars++; result += base64chars.charAt(number & 0x3F); number >>>= 6; if (chars === 5) { number = (((random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0; chars = 0; } } return result; } var _objDefineProperty = ObjDefineProperty; var version = "2.8.3"; var instanceName = "." + newId(6); var _dataUid = 0; function _createAccessor(target, prop, value) { if (_objDefineProperty) { try { _objDefineProperty(target, prop, { value: value, enumerable: false, configurable: true }); return true; } catch (e) { } } return false; } function _canAcceptData(target) { return target.nodeType === 1 || target.nodeType === 9 || !(+target.nodeType); } function _getCache(data, target) { var theCache = target[data.id]; if (!theCache) { theCache = {}; try { if (_canAcceptData(target)) { if (!_createAccessor(target, data.id, theCache)) { target[data.id] = theCache; } } } catch (e) { } } return theCache; } function createUniqueNamespace(name, includeVersion) { if (includeVersion === void 0) { includeVersion = false; } return normalizeJsName(name + (_dataUid++) + (includeVersion ? "." + version : "") + instanceName); } function createElmNodeData(name) { var data = { id: createUniqueNamespace("_aiData-" + (name || "") + "." + version), accept: function (target) { return _canAcceptData(target); }, get: function (target, name, defValue, addDefault) { var theCache = target[data.id]; if (!theCache) { if (addDefault) { theCache = _getCache(data, target); theCache[normalizeJsName(name)] = defValue; } return defValue; } return theCache[normalizeJsName(name)]; }, kill: function (target, name) { if (target && target[name]) { try { delete target[name]; } catch (e) { } } } }; return data; } var pluginStateData = createElmNodeData("plugin"); function _getPluginState(plugin) { return pluginStateData.get(plugin, "state", {}, true); } function initializePlugins(processContext, extensions) { var initPlugins = []; var lastPlugin = null; var proxy = processContext.getNext(); var pluginState; while (proxy) { var thePlugin = proxy.getPlugin(); if (thePlugin) { if (lastPlugin && isFunction(lastPlugin[strSetNextPlugin]) && isFunction(thePlugin[strProcessTelemetry])) { lastPlugin[strSetNextPlugin](thePlugin); } var isInitialized = false; if (isFunction(thePlugin[strIsInitialized])) { isInitialized = thePlugin[strIsInitialized](); } else { pluginState = _getPluginState(thePlugin); isInitialized = pluginState[strIsInitialized]; } if (!isInitialized) { initPlugins.push(thePlugin); } lastPlugin = thePlugin; proxy = proxy.getNext(); } } arrForEach(initPlugins, function (thePlugin) { var core = processContext.core(); thePlugin.initialize(processContext.getCfg(), core, extensions, processContext.getNext()); pluginState = _getPluginState(thePlugin); if (!thePlugin[strCore] && !pluginState[strCore]) { pluginState[strCore] = core; } pluginState[strIsInitialized] = true; delete pluginState[strTeardown]; }); } function sortPlugins(plugins) { return plugins.sort(function (extA, extB) { var result = 0; var bHasProcess = isFunction(extB[strProcessTelemetry]); if (isFunction(extA[strProcessTelemetry])) { result = bHasProcess ? extA[strPriority] - extB[strPriority] : 1; } else if (bHasProcess) { result = -1; } return result; }); } var strTelemetryPluginChain = "TelemetryPluginChain"; var strHasRunFlags = "_hasRun"; var strGetTelCtx = "_getTelCtx"; var _chainId = 0; function _getNextProxyStart(proxy, core, startAt) { while (proxy) { if (proxy.getPlugin() === startAt) { return proxy; } proxy = proxy.getNext(); } return createTelemetryProxyChain([startAt], core.config || {}, core); } function _createInternalContext(telemetryChain, config, core, startAt) { var _nextProxy = null; var _onComplete = []; if (startAt !== null) { _nextProxy = startAt ? _getNextProxyStart(telemetryChain, core, startAt) : telemetryChain; } var context = { _next: _moveNext, ctx: { core: function () { return core; }, diagLog: function () { return safeGetLogger(core, config); }, getCfg: function () { return config; }, getExtCfg: _getExtCfg, getConfig: _getConfig, hasNext: function () { return !!_nextProxy; }, getNext: function () { return _nextProxy; }, setNext: function (nextPlugin) { _nextProxy = nextPlugin; }, iterate: _iterateChain, onComplete: _addOnComplete } }; function _addOnComplete(onComplete, that) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } if (onComplete) { _onComplete.push({ func: onComplete, self: !isUndefined(that) ? that : context.ctx, args: args }); } } function _moveNext() { var nextProxy = _nextProxy; _nextProxy = nextProxy ? nextProxy.getNext() : null; if (!nextProxy) { var onComplete = _onComplete; if (onComplete && onComplete.length > 0) { arrForEach(onComplete, function (completeDetails) { try { completeDetails.func.call(completeDetails.self, completeDetails.args); } catch (e) { _throwInternal(core.logger, 2 , 73 , "Unexpected Exception during onComplete - " + dumpObj(e)); } }); _onComplete = []; } } return nextProxy; } function _getExtCfg(identifier, defaultValue, mergeDefault) { if (defaultValue === void 0) { defaultValue = {}; } if (mergeDefault === void 0) { mergeDefault = 0 ; } var theConfig; if (config) { var extConfig = config.extensionConfig; if (extConfig && identifier) { theConfig = extConfig[identifier]; } } if (!theConfig) { theConfig = defaultValue; } else if (isObject(defaultValue)) { if (mergeDefault !== 0 ) { var newConfig_1 = objExtend(true, defaultValue, theConfig); if (config && mergeDefault === 2 ) { objForEachKey(defaultValue, function (field) { if (isNullOrUndefined(newConfig_1[field])) { var cfgValue = config[field]; if (!isNullOrUndefined(cfgValue)) { newConfig_1[field] = cfgValue; } } }); } theConfig = newConfig_1; } } return theConfig; } function _getConfig(identifier, field, defaultValue) { if (defaultValue === void 0) { defaultValue = false; } var theValue; var extConfig = _getExtCfg(identifier, null); if (extConfig && !isNullOrUndefined(extConfig[field])) { theValue = extConfig[field]; } else if (config && !isNullOrUndefined(config[field])) { theValue = config[field]; } return !isNullOrUndefined(theValue) ? theValue : defaultValue; } function _iterateChain(cb) { var nextPlugin; while (!!(nextPlugin = context._next())) { var plugin = nextPlugin.getPlugin(); if (plugin) { cb(plugin); } } } return context; } function createProcessTelemetryContext(telemetryChain, config, core, startAt) { var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(env) { var nextPlugin = internalContext._next(); nextPlugin && nextPlugin.processTelemetry(env, context); return !nextPlugin; } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryContext(plugins || context.getNext(), config, core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } function createProcessTelemetryUnloadContext(telemetryChain, core, startAt) { var config = core.config || {}; var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(unloadState) { var nextPlugin = internalContext._next(); nextPlugin && nextPlugin.unload(context, unloadState); return !nextPlugin; } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryUnloadContext(plugins || context.getNext(), core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } function createProcessTelemetryUpdateContext(telemetryChain, core, startAt) { var config = core.config || {}; var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(updateState) { return context.iterate(function (plugin) { if (isFunction(plugin.update)) { plugin.update(context, updateState); } }); } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryUpdateContext(plugins || context.getNext(), core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } function createTelemetryProxyChain(plugins, config, core, startAt) { var firstProxy = null; var add = startAt ? false : true; if (isArray(plugins) && plugins.length > 0) { var lastProxy_1 = null; arrForEach(plugins, function (thePlugin) { if (!add && startAt === thePlugin) { add = true; } if (add && thePlugin && isFunction(thePlugin.processTelemetry)) { var newProxy = createTelemetryPluginProxy(thePlugin, config, core); if (!firstProxy) { firstProxy = newProxy; } if (lastProxy_1) { lastProxy_1._setNext(newProxy); } lastProxy_1 = newProxy; } }); } if (startAt && !firstProxy) { return createTelemetryProxyChain([startAt], config, core); } return firstProxy; } function createTelemetryPluginProxy(plugin, config, core) { var nextProxy = null; var hasProcessTelemetry = isFunction(plugin.processTelemetry); var hasSetNext = isFunction(plugin.setNextPlugin); var chainId; if (plugin) { chainId = plugin.identifier + "-" + plugin.priority + "-" + _chainId++; } else { chainId = "Unknown-0-" + _chainId++; } var proxyChain = { getPlugin: function () { return plugin; }, getNext: function () { return nextProxy; }, processTelemetry: _processTelemetry, unload: _unloadPlugin, update: _updatePlugin, _id: chainId, _setNext: function (nextPlugin) { nextProxy = nextPlugin; } }; function _getTelCtx() { var itemCtx; if (plugin && isFunction(plugin[strGetTelCtx])) { itemCtx = plugin[strGetTelCtx](); } if (!itemCtx) { itemCtx = createProcessTelemetryContext(proxyChain, config, core); } return itemCtx; } function _processChain(itemCtx, processPluginFn, name, details, isAsync) { var hasRun = false; var identifier = plugin ? plugin.identifier : strTelemetryPluginChain; var hasRunContext = itemCtx[strHasRunFlags]; if (!hasRunContext) { hasRunContext = itemCtx[strHasRunFlags] = {}; } itemCtx.setNext(nextProxy); if (plugin) { doPerf(itemCtx[strCore](), function () { return identifier + ":" + name; }, function () { hasRunContext[chainId] = true; try { var nextId = nextProxy ? nextProxy._id : strEmpty; if (nextId) { hasRunContext[nextId] = false; } hasRun = processPluginFn(itemCtx); } catch (error) { var hasNextRun = nextProxy ? hasRunContext[nextProxy._id] : true; if (hasNextRun) { hasRun = true; } if (!nextProxy || !hasNextRun) { _throwInternal(itemCtx.diagLog(), 1 , 73 , "Plugin [" + identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext)); } } }, details, isAsync); } return hasRun; } function _processTelemetry(env, itemCtx) { itemCtx = itemCtx || _getTelCtx(); function _callProcessTelemetry(itemCtx) { if (!plugin || !hasProcessTelemetry) { return false; } var pluginState = _getPluginState(plugin); if (pluginState.teardown || pluginState[strDisabled]) { return false; } if (hasSetNext) { plugin.setNextPlugin(nextProxy); } plugin.processTelemetry(env, itemCtx); return true; } if (!_processChain(itemCtx, _callProcessTelemetry, "processTelemetry", function () { return ({ item: env }); }, !(env.sync))) { itemCtx.processNext(env); } } function _unloadPlugin(unloadCtx, unloadState) { function _callTeardown() { var hasRun = false; if (plugin) { var pluginState = _getPluginState(plugin); var pluginCore = plugin[strCore] || pluginState.core; if (plugin && (!pluginCore || pluginCore === unloadCtx[strCore]()) && !pluginState[strTeardown]) { pluginState[strCore] = null; pluginState[strTeardown] = true; pluginState[strIsInitialized] = false; if (plugin[strTeardown] && plugin[strTeardown](unloadCtx, unloadState) === true) { hasRun = true; } } } return hasRun; } if (!_processChain(unloadCtx, _callTeardown, "unload", function () { }, unloadState.isAsync)) { unloadCtx.processNext(unloadState); } } function _updatePlugin(updateCtx, updateState) { function _callUpdate() { var hasRun = false; if (plugin) { var pluginState = _getPluginState(plugin); var pluginCore = plugin[strCore] || pluginState.core; if (plugin && (!pluginCore || pluginCore === updateCtx[strCore]()) && !pluginState[strTeardown]) { if (plugin[strUpdate] && plugin[strUpdate](updateCtx, updateState) === true) { hasRun = true; } } } return hasRun; } if (!_processChain(updateCtx, _callUpdate, "update", function () { }, false)) { updateCtx.processNext(updateState); } } return objFreeze(proxyChain); } var ProcessTelemetryContext = /** @class */ (function () { function ProcessTelemetryContext(pluginChain, config, core, startAt) { var _self = this; var context = createProcessTelemetryContext(pluginChain, config, core, startAt); proxyFunctions(_self, context, objKeys(context)); } return ProcessTelemetryContext; }()); var strToGMTString = "toGMTString"; var strToUTCString = "toUTCString"; var strCookie = "cookie"; var strExpires = "expires"; var strEnabled = "enabled"; var strIsCookieUseDisabled = "isCookieUseDisabled"; var strDisableCookiesUsage = "disableCookiesUsage"; var strConfigCookieMgr = "_ckMgr"; var _supportsCookies = null; var _allowUaSameSite = null; var _parsedCookieValue = null; var _doc = getDocument(); var _cookieCache = {}; var _globalCookieConfig = {}; function _gblCookieMgr(config, logger) { var inst = createCookieMgr[strConfigCookieMgr] || _globalCookieConfig[strConfigCookieMgr]; if (!inst) { inst = createCookieMgr[strConfigCookieMgr] = createCookieMgr(config, logger); _globalCookieConfig[strConfigCookieMgr] = inst; } return inst; } function _isMgrEnabled(cookieMgr) { if (cookieMgr) { return cookieMgr.isEnabled(); } return true; } function _createCookieMgrConfig(rootConfig) { var cookieMgrCfg = rootConfig.cookieCfg = rootConfig.cookieCfg || {}; setValue(cookieMgrCfg, "domain", rootConfig.cookieDomain, isNotNullOrUndefined, isNullOrUndefined); setValue(cookieMgrCfg, "path", rootConfig.cookiePath || "/", null, isNullOrUndefined); if (isNullOrUndefined(cookieMgrCfg[strEnabled])) { var cookieEnabled = void 0; if (!isUndefined(rootConfig[strIsCookieUseDisabled])) { cookieEnabled = !rootConfig[strIsCookieUseDisabled]; } if (!isUndefined(rootConfig[strDisableCookiesUsage])) { cookieEnabled = !rootConfig[strDisableCookiesUsage]; } cookieMgrCfg[strEnabled] = cookieEnabled; } return cookieMgrCfg; } function safeGetCookieMgr(core, config) { var cookieMgr; if (core) { cookieMgr = core.getCookieMgr(); } else if (config) { var cookieCfg = config.cookieCfg; if (cookieCfg[strConfigCookieMgr]) { cookieMgr = cookieCfg[strConfigCookieMgr]; } else { cookieMgr = createCookieMgr(config); } } if (!cookieMgr) { cookieMgr = _gblCookieMgr(config, (core || {}).logger); } return cookieMgr; } function createCookieMgr(rootConfig, logger) { var cookieMgrConfig = _createCookieMgrConfig(rootConfig || _globalCookieConfig); var _path = cookieMgrConfig.path || "/"; var _domain = cookieMgrConfig.domain; var _enabled = cookieMgrConfig[strEnabled] !== false; var cookieMgr = { isEnabled: function () { var enabled = _enabled && areCookiesSupported(logger); var gblManager = _globalCookieConfig[strConfigCookieMgr]; if (enabled && gblManager && cookieMgr !== gblManager) { enabled = _isMgrEnabled(gblManager); } return enabled; }, setEnabled: function (value) { _enabled = value !== false; }, set: function (name, value, maxAgeSec, domain, path) { var result = false; if (_isMgrEnabled(cookieMgr)) { var values = {}; var theValue = strTrim(value || strEmpty); var idx = theValue.indexOf(";"); if (idx !== -1) { theValue = strTrim(value.substring(0, idx)); values = _extractParts(value.substring(idx + 1)); } setValue(values, "domain", domain || _domain, isTruthy, isUndefined); if (!isNullOrUndefined(maxAgeSec)) { var _isIE = isIE(); if (isUndefined(values[strExpires])) { var nowMs = dateNow(); var expireMs = nowMs + (maxAgeSec * 1000); if (expireMs > 0) { var expiry = new Date(); expiry.setTime(expireMs); setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || strEmpty, isTruthy); } } if (!_isIE) { setValue(values, "max-age", strEmpty + maxAgeSec, null, isUndefined); } } var location_1 = getLocation(); if (location_1 && location_1.protocol === "https:") { setValue(values, "secure", null, null, isUndefined); if (_allowUaSameSite === null) { _allowUaSameSite = !uaDisallowsSameSiteNone((getNavigator() || {}).userAgent); } if (_allowUaSameSite) { setValue(values, "SameSite", "None", null, isUndefined); } } setValue(values, "path", path || _path, null, isUndefined); var setCookieFn = cookieMgrConfig.setCookie || _setCookieValue; setCookieFn(name, _formatCookieValue(theValue, values)); result = true; } return result; }, get: function (name) { var value = strEmpty; if (_isMgrEnabled(cookieMgr)) { value = (cookieMgrConfig.getCookie || _getCookieValue)(name); } return value; }, del: function (name, path) { var result = false; if (_isMgrEnabled(cookieMgr)) { result = cookieMgr.purge(name, path); } return result; }, purge: function (name, path) { var _a; var result = false; if (areCookiesSupported(logger)) { var values = (_a = {}, _a["path"] = path ? path : "/", _a[strExpires] = "Thu, 01 Jan 1970 00:00:01 GMT", _a); if (!isIE()) { values["max-age"] = "0"; } var delCookie = cookieMgrConfig.delCookie || _setCookieValue; delCookie(name, _formatCookieValue(strEmpty, values)); result = true; } return result; } }; cookieMgr[strConfigCookieMgr] = cookieMgr; return cookieMgr; } function areCookiesSupported(logger) { if (_supportsCookies === null) { _supportsCookies = false; try { var doc = _doc || {}; _supportsCookies = doc[strCookie] !== undefined; } catch (e) { _throwInternal(logger, 2 , 68 , "Cannot access document.cookie - " + getExceptionName(e), { exception: dumpObj(e) }); } } return _supportsCookies; } function _extractParts(theValue) { var values = {}; if (theValue && theValue.length) { var parts = strTrim(theValue).split(";"); arrForEach(parts, function (thePart) { thePart = strTrim(thePart || strEmpty); if (thePart) { var idx = thePart.indexOf("="); if (idx === -1) { values[thePart] = null; } else { values[strTrim(thePart.substring(0, idx))] = strTrim(thePart.substring(idx + 1)); } } }); } return values; } function _formatDate(theDate, func) { if (isFunction(theDate[func])) { return theDate[func](); } return null; } function _formatCookieValue(value, values) { var cookieValue = value || strEmpty; objForEachKey(values, function (name, theValue) { cookieValue += "; " + name + (!isNullOrUndefined(theValue) ? "=" + theValue : strEmpty); }); return cookieValue; } function _getCookieValue(name) { var cookieValue = strEmpty; if (_doc) { var theCookie = _doc[strCookie] || strEmpty; if (_parsedCookieValue !== theCookie) { _cookieCache = _extractParts(theCookie); _parsedCookieValue = theCookie; } cookieValue = strTrim(_cookieCache[name] || strEmpty); } return cookieValue; } function _setCookieValue(name, cookieValue) { if (_doc) { _doc[strCookie] = name + "=" + cookieValue; } } function uaDisallowsSameSiteNone(userAgent) { if (!isString(userAgent)) { return false; } if (strContains(userAgent, "CPU iPhone OS 12") || strContains(userAgent, "iPad; CPU OS 12")) { return true; } if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strContains(userAgent, "Version/") && strContains(userAgent, "Safari")) { return true; } if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strEndsWith(userAgent, "AppleWebKit/605.1.15 (KHTML, like Gecko)")) { return true; } if (strContains(userAgent, "Chrome/5") || strContains(userAgent, "Chrome/6")) { return true; } if (strContains(userAgent, "UnrealEngine") && !strContains(userAgent, "Chrome")) { return true; } if (strContains(userAgent, "UCBrowser/12") || strContains(userAgent, "UCBrowser/11")) { return true; } return false; } var strIKey = "iKey"; var strExtensionConfig = "extensionConfig"; var ChannelControllerPriority = 500; var ChannelValidationMessage = "Channel has invalid priority - "; function _addChannelQueue(channelQueue, queue, config, core) { if (queue && isArray(queue) && queue.length > 0) { queue = queue.sort(function (a, b) { return a.priority - b.priority; }); arrForEach(queue, function (queueItem) { if (queueItem.priority < ChannelControllerPriority) { throwError(ChannelValidationMessage + queueItem.identifier); } }); channelQueue.push({ queue: objFreeze(queue), chain: createTelemetryProxyChain(queue, config, core) }); } } function createChannelControllerPlugin(channelQueue, core) { var _a; function _getTelCtx() { return createProcessTelemetryContext(null, core.config, core, null); } function _processChannelQueue(theChannels, itemCtx, processFn, onComplete) { var waiting = theChannels ? (theChannels.length + 1) : 1; function _runChainOnComplete() { waiting--; if (waiting === 0) { onComplete && onComplete(); onComplete = null; } } if (waiting > 0) { arrForEach(theChannels, function (channels) { if (channels && channels.queue.length > 0) { var channelChain = channels.chain; var chainCtx = itemCtx.createNew(channelChain); chainCtx.onComplete(_runChainOnComplete); processFn(chainCtx); } else { waiting--; } }); } _runChainOnComplete(); } function _doUpdate(updateCtx, updateState) { var theUpdateState = updateState || { reason: 0 }; _processChannelQueue(channelQueue, updateCtx, function (chainCtx) { chainCtx[strProcessNext](theUpdateState); }, function () { updateCtx[strProcessNext](theUpdateState); }); return true; } function _doTeardown(unloadCtx, unloadState) { var theUnloadState = unloadState || { reason: 0 , isAsync: false }; _processChannelQueue(channelQueue, unloadCtx, function (chainCtx) { chainCtx[strProcessNext](theUnloadState); }, function () { unloadCtx[strProcessNext](theUnloadState); isInitialized = false; }); return true; } function _getChannel(pluginIdentifier) { var thePlugin = null; if (channelQueue && channelQueue.length > 0) { arrForEach(channelQueue, function (channels) { if (channels && channels.queue.length > 0) { arrForEach(channels.queue, function (ext) { if (ext.identifier === pluginIdentifier) { thePlugin = ext; return -1; } }); if (thePlugin) { return -1; } } }); } return thePlugin; } var isInitialized = false; var channelController = (_a = { identifier: "ChannelControllerPlugin", priority: ChannelControllerPriority, initialize: function (config, core, extensions, pluginChain) { isInitialized = true; arrForEach(channelQueue, function (channels) { if (channels && channels.queue.length > 0) { initializePlugins(createProcessTelemetryContext(channels.chain, config, core), extensions); } }); }, isInitialized: function () { return isInitialized; }, processTelemetry: function (item, itemCtx) { _processChannelQueue(channelQueue, itemCtx || _getTelCtx(), function (chainCtx) { chainCtx[strProcessNext](item); }, function () { itemCtx[strProcessNext](item); }); }, update: _doUpdate }, _a[strPause] = function () { _processChannelQueue(channelQueue, _getTelCtx(), function (chainCtx) { chainCtx.iterate(function (plugin) { plugin[strPause] && plugin[strPause](); }); }, null); }, _a[strResume] = function () { _processChannelQueue(channelQueue, _getTelCtx(), function (chainCtx) { chainCtx.iterate(function (plugin) { plugin[strResume] && plugin[strResume](); }); }, null); }, _a[strTeardown] = _doTeardown, _a.getChannel = _getChannel, _a.flush = function (isAsync, callBack, sendReason, cbTimeout) { var waiting = 1; var doneIterating = false; var cbTimer = null; cbTimeout = cbTimeout || 5000; function doCallback() { waiting--; if (doneIterating && waiting === 0) { if (cbTimer) { clearTimeout(cbTimer); cbTimer = null; } callBack && callBack(doneIterating); callBack = null; } } _processChannelQueue(channelQueue, _getTelCtx(), function (chainCtx) { chainCtx.iterate(function (plugin) { if (plugin.flush) { waiting++; var handled_1 = false; if (!plugin.flush(isAsync, function () { handled_1 = true; doCallback(); }, sendReason)) { if (!handled_1) { if (isAsync && cbTimer == null) { cbTimer = setTimeout(function () { cbTimer = null; doCallback(); }, cbTimeout); } else { doCallback(); } } } } }); }, function () { doneIterating = true; doCallback(); }); return true; }, _a._setQueue = function (queue) { channelQueue = queue; }, _a); return channelController; } function createChannelQueues(channels, extensions, config, core) { var channelQueue = []; if (channels) { arrForEach(channels, function (queue) { return _addChannelQueue(channelQueue, queue, config, core); }); } if (extensions) { var extensionQueue_1 = []; arrForEach(extensions, function (plugin) { if (plugin.priority > ChannelControllerPriority) { extensionQueue_1.push(plugin); } }); _addChannelQueue(channelQueue, extensionQueue_1, config, core); } return channelQueue; } function createUnloadHandlerContainer() { var handlers = []; function _addHandler(handler) { if (handler) { handlers.push(handler); } } function _runHandlers(unloadCtx, unloadState) { arrForEach(handlers, function (handler) { try { handler(unloadCtx, unloadState); } catch (e) { _throwInternal(unloadCtx.diagLog(), 2 , 73 , "Unexpected error calling unload handler - " + dumpObj(e)); } }); handlers = []; } return { add: _addHandler, run: _runHandlers }; } var strGetPlugin = "getPlugin"; var BaseTelemetryPlugin = /** @class */ (function () { function BaseTelemetryPlugin() { var _self = this; var _isinitialized; var _rootCtx; var _nextPlugin; var _unloadHandlerContainer; var _hooks; _initDefaults(); dynamicProto(BaseTelemetryPlugin, _self, function (_self) { _self.initialize = function (config, core, extensions, pluginChain) { _setDefaults(config, core, pluginChain); _isinitialized = true; }; _self.teardown = function (unloadCtx, unloadState) { var core = _self.core; if (!core || (unloadCtx && core !== unloadCtx.core())) { return; } var result; var unloadDone = false; var theUnloadCtx = unloadCtx || createProcessTelemetryUnloadContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin); var theUnloadState = unloadState || { reason: 0 , isAsync: false }; function _unloadCallback() { if (!unloadDone) { unloadDone = true; _unloadHandlerContainer.run(theUnloadCtx, unloadState); arrForEach(_hooks, function (fn) { fn.rm(); }); _hooks = []; if (result === true) { theUnloadCtx.processNext(theUnloadState); } _initDefaults(); } } if (!_self[strDoTeardown] || _self[strDoTeardown](theUnloadCtx, theUnloadState, _unloadCallback) !== true) { _unloadCallback(); } else { result = true; } return result; }; _self.update = function (updateCtx, updateState) { var core = _self.core; if (!core || (updateCtx && core !== updateCtx.core())) { return; } var result; var updateDone = false; var theUpdateCtx = updateCtx || createProcessTelemetryUpdateContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin); var theUpdateState = updateState || { reason: 0 }; function _updateCallback() { if (!updateDone) { updateDone = true; _setDefaults(theUpdateCtx.getCfg(), theUpdateCtx.core(), theUpdateCtx.getNext()); } } if (!_self._doUpdate || _self._doUpdate(theUpdateCtx, theUpdateState, _updateCallback) !== true) { _updateCallback(); } else { result = true; } return result; }; _self._addHook = function (hooks) { if (hooks) { if (isArray(hooks)) { _hooks = _hooks.concat(hooks); } else { _hooks.push(hooks); } } }; proxyFunctionAs(_self, "_addUnloadCb", function () { return _unloadHandlerContainer; }, "add"); }); _self.diagLog = function (itemCtx) { return _getTelCtx(itemCtx).diagLog(); }; _self[strIsInitialized] = function () { return _isinitialized; }; _self.setInitialized = function (isInitialized) { _isinitialized = isInitialized; }; _self[strSetNextPlugin] = function (next) { _nextPlugin = next; }; _self.processNext = function (env, itemCtx) { if (itemCtx) { itemCtx.processNext(env); } else if (_nextPlugin && isFunction(_nextPlugin.processTelemetry)) { _nextPlugin.processTelemetry(env, null); } }; _self._getTelCtx = _getTelCtx; function _getTelCtx(currentCtx) { if (currentCtx === void 0) { currentCtx = null; } var itemCtx = currentCtx; if (!itemCtx) { var rootCtx = _rootCtx || createProcessTelemetryContext(null, {}, _self.core); if (_nextPlugin && _nextPlugin[strGetPlugin]) { itemCtx = rootCtx.createNew(null, _nextPlugin[strGetPlugin]); } else { itemCtx = rootCtx.createNew(null, _nextPlugin); } } return itemCtx; } function _setDefaults(config, core, pluginChain) { if (config) { setValue(config, strExtensionConfig, [], null, isNullOrUndefined); } if (!pluginChain && core) { pluginChain = core.getProcessTelContext().getNext(); } var nextPlugin = _nextPlugin; if (_nextPlugin && _nextPlugin[strGetPlugin]) { nextPlugin = _nextPlugin[strGetPlugin](); } _self.core = core; _rootCtx = createProcessTelemetryContext(pluginChain, config, core, nextPlugin); } function _initDefaults() { _isinitialized = false; _self.core = null; _rootCtx = null; _nextPlugin = null; _hooks = []; _unloadHandlerContainer = createUnloadHandlerContainer(); } } return BaseTelemetryPlugin; }()); var TelemetryInitializerPlugin = /** @class */ (function (_super) { __extendsFn(TelemetryInitializerPlugin, _super); function TelemetryInitializerPlugin() { var _this = _super.call(this) || this; _this.identifier = "TelemetryInitializerPlugin"; _this.priority = 199; var _id; var _initializers; _initDefaults(); dynamicProto(TelemetryInitializerPlugin, _this, function (_self, _base) { _self.addTelemetryInitializer = function (telemetryInitializer) { var theInitializer = { id: _id++, fn: telemetryInitializer }; _initializers.push(theInitializer); var handler = { remove: function () { arrForEach(_initializers, function (initializer, idx) { if (initializer.id === theInitializer.id) { _initializers.splice(idx, 1); return -1; } }); } }; return handler; }; _self.processTelemetry = function (item, itemCtx) { var doNotSendItem = false; var telemetryInitializersCount = _initializers.length; for (var i = 0; i < telemetryInitializersCount; ++i) { var telemetryInitializer = _initializers[i]; if (telemetryInitializer) { try { if (telemetryInitializer.fn.apply(null, [item]) === false) { doNotSendItem = true; break; } } catch (e) { _throwInternal(itemCtx.diagLog(), 1 , 64 , "One of telemetry initializers failed, telemetry item will not be sent: " + getExceptionName(e), { exception: dumpObj(e) }, true); } } } if (!doNotSendItem) { _self.processNext(item, itemCtx); } }; _self[strDoTeardown] = function () { _initDefaults(); }; }); function _initDefaults() { _id = 0; _initializers = []; } return _this; } return TelemetryInitializerPlugin; }(BaseTelemetryPlugin)); var strValidationError = "Plugins must provide initialize method"; var strNotificationManager = "_notificationManager"; var strSdkUnloadingError = "SDK is still unloading..."; var strSdkNotInitialized = "SDK is not initialized"; var defaultInitConfig = { loggingLevelConsole: 1 }; function _createPerfManager(core, notificationMgr) { return new PerfManager(notificationMgr); } function _validateExtensions(logger, channelPriority, allExtensions) { var coreExtensions = []; var extPriorities = {}; arrForEach(allExtensions, function (ext) { if (isNullOrUndefined(ext) || isNullOrUndefined(ext.initialize)) { throwError(strValidationError); } var extPriority = ext.priority; var identifier = ext.identifier; if (ext && extPriority) { if (!isNullOrUndefined(extPriorities[extPriority])) { _warnToConsole(logger, "Two extensions have same priority #" + extPriority + " - " + extPriorities[extPriority] + ", " + identifier); } else { extPriorities[extPriority] = identifier; } } if (!extPriority || extPriority < channelPriority) { coreExtensions.push(ext); } }); return { all: allExtensions, core: coreExtensions }; } function _isPluginPresent(thePlugin, plugins) { var exists = false; arrForEach(plugins, function (plugin) { if (plugin === thePlugin) { exists = true; return -1; } }); return exists; } function _createDummyNotificationManager() { var _a; return objCreateFn((_a = {}, _a[strAddNotificationListener] = function (listener) { }, _a[strRemoveNotificationListener] = function (listener) { }, _a[strEventsSent] = function (events) { }, _a[strEventsDiscarded] = function (events, reason) { }, _a[strEventsSendRequest] = function (sendReason, isAsync) { }, _a)); } var BaseCore$2 = /** @class */ (function () { function BaseCore() { var _isInitialized; var _eventQueue; var _notificationManager; var _perfManager; var _cfgPerfManager; var _cookieManager; var _pluginChain; var _configExtensions; var _coreExtensions; var _channelControl; var _channelConfig; var _channelQueue; var _isUnloading; var _telemetryInitializerPlugin; var _internalLogsEventName; var _evtNamespace; var _unloadHandlers; var _debugListener; var _internalLogPoller = 0; dynamicProto(BaseCore, this, function (_self) { _initDefaults(); _self.isInitialized = function () { return _isInitialized; }; _self.initialize = function (config, extensions, logger, notificationManager) { if (_isUnloading) { throwError(strSdkUnloadingError); } if (_self.isInitialized()) { throwError("Core should not be initialized more than once"); } if (!config || isNullOrUndefined(config.instrumentationKey)) { throwError("Please provide instrumentation key"); } _notificationManager = notificationManager; _self[strNotificationManager] = notificationManager; _self.config = config || {}; _initDebugListener(config); _initPerfManager(config); config.extensions = isNullOrUndefined(config.extensions) ? [] : config.extensions; _initExtConfig(config); if (logger) { _self.logger = logger; } _configExtensions = []; _configExtensions.push.apply(_configExtensions, __spreadArrayFn(__spreadArrayFn([], extensions, false), config.extensions)); _channelConfig = (config || {}).channels; _initPluginChain(config, null); if (!_channelQueue || _channelQueue.length === 0) { throwError("No channels available"); } _isInitialized = true; _self.releaseQueue(); }; _self.getTransmissionControls = function () { var controls = []; if (_channelQueue) { arrForEach(_channelQueue, function (channels) { controls.push(channels.queue); }); } return objFreeze(controls); }; _self.track = function (telemetryItem) { setValue(telemetryItem, strIKey, _self.config.instrumentationKey, null, isNotTruthy); setValue(telemetryItem, "time", toISOString(new Date()), null, isNotTruthy); setValue(telemetryItem, "ver", "4.0", null, isNullOrUndefined); if (!_isUnloading && _self.isInitialized()) { _createTelCtx().processNext(telemetryItem); } else { _eventQueue.push(telemetryItem); } }; _self.getProcessTelContext = _createTelCtx; _self.getNotifyMgr = function () { if (!_notificationManager) { _notificationManager = _createDummyNotificationManager(); _self[strNotificationManager] = _notificationManager; } return _notificationManager; }; _self[strAddNotificationListener] = function (listener) { if (_notificationManager) { _notificationManager[strAddNotificationListener](listener); } }; _self[strRemoveNotificationListener] = function (listener) { if (_notificationManager) { _notificationManager[strRemoveNotificationListener](listener); } }; _self.getCookieMgr = function () { if (!_cookieManager) { _cookieManager = createCookieMgr(_self.config, _self.logger); } return _cookieManager; }; _self.setCookieMgr = function (cookieMgr) { _cookieManager = cookieMgr; }; _self.getPerfMgr = function () { if (!_perfManager && !_cfgPerfManager) { if (_self.config && _self.config.enablePerfMgr && isFunction(_self.config.createPerfMgr)) { _cfgPerfManager = _self.config.createPerfMgr(_self, _self.getNotifyMgr()); } } return _perfManager || _cfgPerfManager || getGblPerfMgr(); }; _self.setPerfMgr = function (perfMgr) { _perfManager = perfMgr; }; _self.eventCnt = function () { return _eventQueue.length; }; _self.releaseQueue = function () { if (_isInitialized && _eventQueue.length > 0) { var eventQueue = _eventQueue; _eventQueue = []; arrForEach(eventQueue, function (event) { _createTelCtx().processNext(event); }); } }; _self.pollInternalLogs = function (eventName) { _internalLogsEventName = eventName || null; var interval = _self.config.diagnosticLogInterval; if (!interval || !(interval > 0)) { interval = 10000; } if (_internalLogPoller) { clearInterval(_internalLogPoller); } _internalLogPoller = setInterval(function () { _flushInternalLogs(); }, interval); return _internalLogPoller; }; _self.stopPollingInternalLogs = function () { if (_internalLogPoller) { clearInterval(_internalLogPoller); _internalLogPoller = 0; _flushInternalLogs(); } }; proxyFunctions(_self, function () { return _telemetryInitializerPlugin; }, ["addTelemetryInitializer"]); _self.unload = function (isAsync, unloadComplete, cbTimeout) { if (isAsync === void 0) { isAsync = true; } if (!_isInitialized) { throwError(strSdkNotInitialized); } if (_isUnloading) { throwError(strSdkUnloadingError); } var unloadState = { reason: 50 , isAsync: isAsync, flushComplete: false }; var processUnloadCtx = createProcessTelemetryUnloadContext(_getPluginChain(), _self); processUnloadCtx.onComplete(function () { _initDefaults(); unloadComplete && unloadComplete(unloadState); }, _self); function _doUnload(flushComplete) { unloadState.flushComplete = flushComplete; _isUnloading = true; _unloadHandlers.run(processUnloadCtx, unloadState); _self.stopPollingInternalLogs(); processUnloadCtx.processNext(unloadState); } if (!_flushChannels(isAsync, _doUnload, 6 , cbTimeout)) { _doUnload(false); } }; _self.getPlugin = _getPlugin; _self.addPlugin = function (plugin, replaceExisting, isAsync, addCb) { if (!plugin) { addCb && addCb(false); _logOrThrowError(strValidationError); return; } var existingPlugin = _getPlugin(plugin.identifier); if (existingPlugin && !replaceExisting) { addCb && addCb(false); _logOrThrowError("Plugin [" + plugin.identifier + "] is already loaded!"); return; } var updateState = { reason: 16 }; function _addPlugin(removed) { _configExtensions.push(plugin); updateState.added = [plugin]; _initPluginChain(_self.config, updateState); addCb && addCb(true); } if (existingPlugin) { var removedPlugins_1 = [existingPlugin.plugin]; var unloadState = { reason: 2 , isAsync: !!isAsync }; _removePlugins(removedPlugins_1, unloadState, function (removed) { if (!removed) { addCb && addCb(false); } else { updateState.removed = removedPlugins_1; updateState.reason |= 32 ; _addPlugin(); } }); } else { _addPlugin(); } }; _self.evtNamespace = function () { return _evtNamespace; }; _self.flush = _flushChannels; proxyFunctionAs(_self, "addUnloadCb", function () { return _unloadHandlers; }, "add"); function _initDefaults() { _isInitialized = false; _self.config = objExtend(true, {}, defaultInitConfig); _self.logger = new DiagnosticLogger(_self.config); _self._extensions = []; _telemetryInitializerPlugin = new TelemetryInitializerPlugin(); _eventQueue = []; _notificationManager = null; _perfManager = null; _cfgPerfManager = null; _cookieManager = null; _pluginChain = null; _coreExtensions = null; _configExtensions = []; _channelControl = null; _channelConfig = null; _channelQueue = null; _isUnloading = false; _internalLogsEventName = null; _evtNamespace = createUniqueNamespace("AIBaseCore", true); _unloadHandlers = createUnloadHandlerContainer(); } function _createTelCtx() { return createProcessTelemetryContext(_getPluginChain(), _self.config, _self); } function _initPluginChain(config, updateState) { var theExtensions = _validateExtensions(_self.logger, ChannelControllerPriority, _configExtensions); _coreExtensions = theExtensions.core; _pluginChain = null; var allExtensions = theExtensions.all; _channelQueue = objFreeze(createChannelQueues(_channelConfig, allExtensions, config, _self)); if (_channelControl) { var idx = arrIndexOf(allExtensions, _channelControl); if (idx !== -1) { allExtensions.splice(idx, 1); } idx = arrIndexOf(_coreExtensions, _channelControl); if (idx !== -1) { _coreExtensions.splice(idx, 1); } _channelControl._setQueue(_channelQueue); } else { _channelControl = createChannelControllerPlugin(_channelQueue, _self); } allExtensions.push(_channelControl); _coreExtensions.push(_channelControl); _self._extensions = sortPlugins(allExtensions); _channelControl.initialize(config, _self, allExtensions); initializePlugins(_createTelCtx(), allExtensions); _self._extensions = objFreeze(sortPlugins(_coreExtensions || [])).slice(); if (updateState) { _doUpdate(updateState); } } function _getPlugin(pluginIdentifier) { var theExt = null; var thePlugin = null; arrForEach(_self._extensions, function (ext) { if (ext.identifier === pluginIdentifier && ext !== _channelControl && ext !== _telemetryInitializerPlugin) { thePlugin = ext; return -1; } }); if (!thePlugin && _channelControl) { thePlugin = _channelControl.getChannel(pluginIdentifier); } if (thePlugin) { theExt = { plugin: thePlugin, setEnabled: function (enabled) { _getPluginState(thePlugin)[strDisabled] = !enabled; }, isEnabled: function () { var pluginState = _getPluginState(thePlugin); return !pluginState[strTeardown] && !pluginState[strDisabled]; }, remove: function (isAsync, removeCb) { if (isAsync === void 0) { isAsync = true; } var pluginsToRemove = [thePlugin]; var unloadState = { reason: 1 , isAsync: isAsync }; _removePlugins(pluginsToRemove, unloadState, function (removed) { if (removed) { _initPluginChain(_self.config, { reason: 32 , removed: pluginsToRemove }); } removeCb && removeCb(removed); }); } }; } return theExt; } function _getPluginChain() { if (!_pluginChain) { var extensions = (_coreExtensions || []).slice(); if (arrIndexOf(extensions, _telemetryInitializerPlugin) === -1) { extensions.push(_telemetryInitializerPlugin); } _pluginChain = createTelemetryProxyChain(sortPlugins(extensions), _self.config, _self); } return _pluginChain; } function _removePlugins(thePlugins, unloadState, removeComplete) { if (thePlugins && thePlugins.length > 0) { var unloadChain = createTelemetryProxyChain(thePlugins, _self.config, _self); var unloadCtx = createProcessTelemetryUnloadContext(unloadChain, _self); unloadCtx.onComplete(function () { var removed = false; var newConfigExtensions = []; arrForEach(_configExtensions, function (plugin, idx) { if (!_isPluginPresent(plugin, thePlugins)) { newConfigExtensions.push(plugin); } else { removed = true; } }); _configExtensions = newConfigExtensions; var newChannelConfig = []; if (_channelConfig) { arrForEach(_channelConfig, function (queue, idx) { var newQueue = []; arrForEach(queue, function (channel) { if (!_isPluginPresent(channel, thePlugins)) { newQueue.push(channel); } else { removed = true; } }); newChannelConfig.push(newQueue); }); _channelConfig = newChannelConfig; } removeComplete && removeComplete(removed); }); unloadCtx.processNext(unloadState); } else { removeComplete(false); } } function _flushInternalLogs() { var queue = _self.logger ? _self.logger.queue : []; if (queue) { arrForEach(queue, function (logMessage) { var item = { name: _internalLogsEventName ? _internalLogsEventName : "InternalMessageId: " + logMessage.messageId, iKey: _self.config.instrumentationKey, time: toISOString(new Date()), baseType: _InternalLogMessage.dataType, baseData: { message: logMessage.message } }; _self.track(item); }); queue.length = 0; } } function _flushChannels(isAsync, callBack, sendReason, cbTimeout) { if (_channelControl) { return _channelControl.flush(isAsync, callBack, sendReason || 6 , cbTimeout); } callBack && callBack(false); return true; } function _initDebugListener(config) { if (config.disableDbgExt === true && _debugListener) { _notificationManager[strRemoveNotificationListener](_debugListener); _debugListener = null; } if (_notificationManager && !_debugListener && config.disableDbgExt !== true) { _debugListener = getDebugListener(config); _notificationManager[strAddNotificationListener](_debugListener); } } function _initPerfManager(config) { if (!config.enablePerfMgr && _cfgPerfManager) { _cfgPerfManager = null; } if (config.enablePerfMgr) { setValue(_self.config, "createPerfMgr", _createPerfManager); } } function _initExtConfig(config) { var extConfig = getSetValue(config, strExtensionConfig); extConfig.NotificationManager = _notificationManager; } function _doUpdate(updateState) { var updateCtx = createProcessTelemetryUpdateContext(_getPluginChain(), _self); if (!_self._updateHook || _self._updateHook(updateCtx, updateState) !== true) { updateCtx.processNext(updateState); } } function _logOrThrowError(message) { var logger = _self.logger; if (logger) { _throwInternal(logger, 2 , 73 , message); } else { throwError(message); } } }); } return BaseCore; }()); function _runListeners(listeners, name, isAsync, callback) { arrForEach(listeners, function (listener) { if (listener && listener[name]) { if (isAsync) { setTimeout(function () { return callback(listener); }, 0); } else { try { callback(listener); } catch (e) { } } } }); } var NotificationManager = /** @class */ (function () { function NotificationManager(config) { this.listeners = []; var perfEvtsSendAll = !!(config || {}).perfEvtsSendAll; dynamicProto(NotificationManager, this, function (_self) { _self[strAddNotificationListener] = function (listener) { _self.listeners.push(listener); }; _self[strRemoveNotificationListener] = function (listener) { var index = arrIndexOf(_self.listeners, listener); while (index > -1) { _self.listeners.splice(index, 1); index = arrIndexOf(_self.listeners, listener); } }; _self[strEventsSent] = function (events) { _runListeners(_self.listeners, strEventsSent, true, function (listener) { listener[strEventsSent](events); }); }; _self[strEventsDiscarded] = function (events, reason) { _runListeners(_self.listeners, strEventsDiscarded, true, function (listener) { listener[strEventsDiscarded](events, reason); }); }; _self[strEventsSendRequest] = function (sendReason, isAsync) { _runListeners(_self.listeners, strEventsSendRequest, isAsync, function (listener) { listener[strEventsSendRequest](sendReason, isAsync); }); }; _self[strPerfEvent] = function (perfEvent) { if (perfEvent) { if (perfEvtsSendAll || !perfEvent.isChildEvt()) { _runListeners(_self.listeners, strPerfEvent, false, function (listener) { if (perfEvent.isAsync) { setTimeout(function () { return listener[strPerfEvent](perfEvent); }, 0); } else { listener[strPerfEvent](perfEvent); } }); } } }; }); } return NotificationManager; }()); var AppInsightsCore$2 = /** @class */ (function (_super) { __extendsFn(AppInsightsCore, _super); function AppInsightsCore() { var _this = _super.call(this) || this; dynamicProto(AppInsightsCore, _this, function (_self, _base) { _self.initialize = function (config, extensions, logger, notificationManager) { _base.initialize(config, extensions, logger || new DiagnosticLogger(config), notificationManager || new NotificationManager(config)); }; _self.track = function (telemetryItem) { doPerf(_self.getPerfMgr(), function () { return "AppInsightsCore:track"; }, function () { if (telemetryItem === null) { _notifyInvalidEvent(telemetryItem); throwError("Invalid telemetry item"); } _validateTelemetryItem(telemetryItem); _base.track(telemetryItem); }, function () { return ({ item: telemetryItem }); }, !(telemetryItem.sync)); }; function _validateTelemetryItem(telemetryItem) { if (isNullOrUndefined(telemetryItem.name)) { _notifyInvalidEvent(telemetryItem); throwError("telemetry name required"); } } function _notifyInvalidEvent(telemetryItem) { var manager = _self.getNotifyMgr(); if (manager) { manager.eventsDiscarded([telemetryItem], 2 ); } } }); return _this; } return AppInsightsCore; }(BaseCore$2)); var strOnPrefix = "on"; var strAttachEvent = "attachEvent"; var strAddEventHelper = "addEventListener"; var strDetachEvent = "detachEvent"; var strRemoveEventListener = "removeEventListener"; var strEvents = "events"; var strVisibilityChangeEvt = "visibilitychange"; var strPageHide = "pagehide"; var strPageShow = "pageshow"; var strUnload = "unload"; var strBeforeUnload = "beforeunload"; var strPageHideNamespace = createUniqueNamespace("aiEvtPageHide"); var strPageShowNamespace = createUniqueNamespace("aiEvtPageShow"); var rRemoveEmptyNs = /\.[\.]+/g; var rRemoveTrailingEmptyNs = /[\.]+$/; var _guid = 1; var elmNodeData = createElmNodeData("events"); var eventNamespace = /^([^.]*)(?:\.(.+)|)/; function _normalizeNamespace(name) { if (name && name.replace) { return name.replace(/^\s*\.*|\.*\s*$/g, ""); } return name; } function _getEvtNamespace(eventName, evtNamespace) { if (evtNamespace) { var theNamespace_1 = ""; if (isArray(evtNamespace)) { theNamespace_1 = ""; arrForEach(evtNamespace, function (name) { name = _normalizeNamespace(name); if (name) { if (name[0] !== ".") { name = "." + name; } theNamespace_1 += name; } }); } else { theNamespace_1 = _normalizeNamespace(evtNamespace); } if (theNamespace_1) { if (theNamespace_1[0] !== ".") { theNamespace_1 = "." + theNamespace_1; } eventName = (eventName || "") + theNamespace_1; } } var parsedEvent = (eventNamespace.exec(eventName || "") || []); return { type: parsedEvent[1], ns: ((parsedEvent[2] || "").replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, "").split(".").sort()).join(".") }; } function __getRegisteredEvents(target, eventName, evtNamespace) { var theEvents = []; var eventCache = elmNodeData.get(target, strEvents, {}, false); var evtName = _getEvtNamespace(eventName, evtNamespace); objForEachKey(eventCache, function (evtType, registeredEvents) { arrForEach(registeredEvents, function (value) { if (!evtName.type || evtName.type === value.evtName.type) { if (!evtName.ns || evtName.ns === evtName.ns) { theEvents.push({ name: value.evtName.type + (value.evtName.ns ? "." + value.evtName.ns : ""), handler: value.handler }); } } }); }); return theEvents; } function _getRegisteredEvents(target, evtName, addDefault) { if (addDefault === void 0) { addDefault = true; } var aiEvts = elmNodeData.get(target, strEvents, {}, addDefault); var registeredEvents = aiEvts[evtName]; if (!registeredEvents) { registeredEvents = aiEvts[evtName] = []; } return registeredEvents; } function _doDetach(obj, evtName, handlerRef, useCapture) { if (obj && evtName && evtName.type) { if (obj[strRemoveEventListener]) { obj[strRemoveEventListener](evtName.type, handlerRef, useCapture); } else if (obj[strDetachEvent]) { obj[strDetachEvent](strOnPrefix + evtName.type, handlerRef); } } } function _doAttach(obj, evtName, handlerRef, useCapture) { var result = false; if (obj && evtName && evtName.type && handlerRef) { if (obj[strAddEventHelper]) { obj[strAddEventHelper](evtName.type, handlerRef, useCapture); result = true; } else if (obj[strAttachEvent]) { obj[strAttachEvent](strOnPrefix + evtName.type, handlerRef); result = true; } } return result; } function _doUnregister(target, events, evtName, unRegFn) { var idx = events.length; while (idx--) { var theEvent = events[idx]; if (theEvent) { if (!evtName.ns || evtName.ns === theEvent.evtName.ns) { if (!unRegFn || unRegFn(theEvent)) { _doDetach(target, theEvent.evtName, theEvent.handler, theEvent.capture); events.splice(idx, 1); } } } } } function _unregisterEvents(target, evtName, unRegFn) { if (evtName.type) { _doUnregister(target, _getRegisteredEvents(target, evtName.type), evtName, unRegFn); } else { var eventCache = elmNodeData.get(target, strEvents, {}); objForEachKey(eventCache, function (evtType, events) { _doUnregister(target, events, evtName, unRegFn); }); if (objKeys(eventCache).length === 0) { elmNodeData.kill(target, strEvents); } } } function mergeEvtNamespace(theNamespace, namespaces) { var newNamespaces; if (namespaces) { if (isArray(namespaces)) { newNamespaces = [theNamespace].concat(namespaces); } else { newNamespaces = [theNamespace, namespaces]; } newNamespaces = (_getEvtNamespace("xx", newNamespaces).ns).split("."); } else { newNamespaces = theNamespace; } return newNamespaces; } function eventOn(target, eventName, handlerRef, evtNamespace, useCapture) { if (useCapture === void 0) { useCapture = false; } var result = false; if (target) { try { var evtName = _getEvtNamespace(eventName, evtNamespace); result = _doAttach(target, evtName, handlerRef, useCapture); if (result && elmNodeData.accept(target)) { var registeredEvent = { guid: _guid++, evtName: evtName, handler: handlerRef, capture: useCapture }; _getRegisteredEvents(target, evtName.type).push(registeredEvent); } } catch (e) { } } return result; } function eventOff(target, eventName, handlerRef, evtNamespace, useCapture) { if (useCapture === void 0) { useCapture = false; } if (target) { try { var evtName_1 = _getEvtNamespace(eventName, evtNamespace); var found_1 = false; _unregisterEvents(target, evtName_1, function (regEvent) { if ((evtName_1.ns && !handlerRef) || regEvent.handler === handlerRef) { found_1 = true; return true; } return false; }); if (!found_1) { _doDetach(target, evtName_1, handlerRef, useCapture); } } catch (e) { } } } function attachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) { if (useCapture === void 0) { useCapture = false; } return eventOn(obj, eventNameWithoutOn, handlerRef, null, useCapture); } function detachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) { if (useCapture === void 0) { useCapture = false; } eventOff(obj, eventNameWithoutOn, handlerRef, null, useCapture); } function addEventHandler(eventName, callback, evtNamespace) { var result = false; var w = getWindow(); if (w) { result = eventOn(w, eventName, callback, evtNamespace); result = eventOn(w["body"], eventName, callback, evtNamespace) || result; } var doc = getDocument(); if (doc) { result = eventOn(doc, eventName, callback, evtNamespace) || result; } return result; } function removeEventHandler(eventName, callback, evtNamespace) { var w = getWindow(); if (w) { eventOff(w, eventName, callback, evtNamespace); eventOff(w["body"], eventName, callback, evtNamespace); } var doc = getDocument(); if (doc) { eventOff(doc, eventName, callback, evtNamespace); } } function _addEventListeners(events, listener, excludeEvents, evtNamespace) { var added = false; if (listener && events && events.length > 0) { arrForEach(events, function (name) { if (name) { if (!excludeEvents || arrIndexOf(excludeEvents, name) === -1) { added = addEventHandler(name, listener, evtNamespace) || added; } } }); } return added; } function addEventListeners(events, listener, excludeEvents, evtNamespace) { var added = false; if (listener && events && isArray(events)) { added = _addEventListeners(events, listener, excludeEvents, evtNamespace); if (!added && excludeEvents && excludeEvents.length > 0) { added = _addEventListeners(events, listener, null, evtNamespace); } } return added; } function removeEventListeners(events, listener, evtNamespace) { if (events && isArray(events)) { arrForEach(events, function (name) { if (name) { removeEventHandler(name, listener, evtNamespace); } }); } } function addPageUnloadEventListener(listener, excludeEvents, evtNamespace) { return addEventListeners([strBeforeUnload, strUnload, strPageHide], listener, excludeEvents, evtNamespace); } function removePageUnloadEventListener(listener, evtNamespace) { removeEventListeners([strBeforeUnload, strUnload, strPageHide], listener, evtNamespace); } function addPageHideEventListener(listener, excludeEvents, evtNamespace) { function _handlePageVisibility(evt) { var doc = getDocument(); if (listener && doc && doc.visibilityState === "hidden") { listener(evt); } } var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace); var pageUnloadAdded = _addEventListeners([strPageHide], listener, excludeEvents, newNamespaces); if (!excludeEvents || arrIndexOf(excludeEvents, strVisibilityChangeEvt) === -1) { pageUnloadAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageUnloadAdded; } if (!pageUnloadAdded && excludeEvents) { pageUnloadAdded = addPageHideEventListener(listener, null, evtNamespace); } return pageUnloadAdded; } function removePageHideEventListener(listener, evtNamespace) { var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace); removeEventListeners([strPageHide], listener, newNamespaces); removeEventListeners([strVisibilityChangeEvt], null, newNamespaces); } function addPageShowEventListener(listener, excludeEvents, evtNamespace) { function _handlePageVisibility(evt) { var doc = getDocument(); if (listener && doc && doc.visibilityState === "visible") { listener(evt); } } var newNamespaces = mergeEvtNamespace(strPageShowNamespace, evtNamespace); var pageShowAdded = _addEventListeners([strPageShow], listener, excludeEvents, newNamespaces); pageShowAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageShowAdded; if (!pageShowAdded && excludeEvents) { pageShowAdded = addPageShowEventListener(listener, null, evtNamespace); } return pageShowAdded; } function removePageShowEventListener(listener, evtNamespace) { var newNamespaces = mergeEvtNamespace(strPageShowNamespace, evtNamespace); removeEventListeners([strPageShow], listener, newNamespaces); removeEventListeners([strVisibilityChangeEvt], null, newNamespaces); } function newGuid() { function randomHexDigit() { return randomValue(15); } return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(GuidRegex, function (c) { var r = (randomHexDigit() | 0), v = (c === "x" ? r : r & 0x3 | 0x8); return v.toString(16); }); } function perfNow() { var perf = getPerformance(); if (perf && perf.now) { return perf.now(); } return dateNow(); } function generateW3CId() { var hexValues = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]; var oct = strEmpty, tmp; for (var a = 0; a < 4; a++) { tmp = random32(); oct += hexValues[tmp & 0xF] + hexValues[tmp >> 4 & 0xF] + hexValues[tmp >> 8 & 0xF] + hexValues[tmp >> 12 & 0xF] + hexValues[tmp >> 16 & 0xF] + hexValues[tmp >> 20 & 0xF] + hexValues[tmp >> 24 & 0xF] + hexValues[tmp >> 28 & 0xF]; } var clockSequenceHi = hexValues[8 + (random32() & 0x03) | 0]; return oct.substr(0, 8) + oct.substr(9, 4) + "4" + oct.substr(13, 3) + clockSequenceHi + oct.substr(16, 3) + oct.substr(19, 12); } var GuidRegex = /[xy]/g; var EventHelper = { Attach: attachEvent, AttachEvent: attachEvent, Detach: detachEvent, DetachEvent: detachEvent }; var LoggingSeverity = createEnumStyle({ CRITICAL: 1 , WARNING: 2 }); var _InternalMessageId = createEnumStyle({ BrowserDoesNotSupportLocalStorage: 0 , BrowserCannotReadLocalStorage: 1 , BrowserCannotReadSessionStorage: 2 , BrowserCannotWriteLocalStorage: 3 , BrowserCannotWriteSessionStorage: 4 , BrowserFailedRemovalFromLocalStorage: 5 , BrowserFailedRemovalFromSessionStorage: 6 , CannotSendEmptyTelemetry: 7 , ClientPerformanceMathError: 8 , ErrorParsingAISessionCookie: 9 , ErrorPVCalc: 10 , ExceptionWhileLoggingError: 11 , FailedAddingTelemetryToBuffer: 12 , FailedMonitorAjaxAbort: 13 , FailedMonitorAjaxDur: 14 , FailedMonitorAjaxOpen: 15 , FailedMonitorAjaxRSC: 16 , FailedMonitorAjaxSend: 17 , FailedMonitorAjaxGetCorrelationHeader: 18 , FailedToAddHandlerForOnBeforeUnload: 19 , FailedToSendQueuedTelemetry: 20 , FailedToReportDataLoss: 21 , FlushFailed: 22 , MessageLimitPerPVExceeded: 23 , MissingRequiredFieldSpecification: 24 , NavigationTimingNotSupported: 25 , OnError: 26 , SessionRenewalDateIsZero: 27 , SenderNotInitialized: 28 , StartTrackEventFailed: 29 , StopTrackEventFailed: 30 , StartTrackFailed: 31 , StopTrackFailed: 32 , TelemetrySampledAndNotSent: 33 , TrackEventFailed: 34 , TrackExceptionFailed: 35 , TrackMetricFailed: 36 , TrackPVFailed: 37 , TrackPVFailedCalc: 38 , TrackTraceFailed: 39 , TransmissionFailed: 40 , FailedToSetStorageBuffer: 41 , FailedToRestoreStorageBuffer: 42 , InvalidBackendResponse: 43 , FailedToFixDepricatedValues: 44 , InvalidDurationValue: 45 , TelemetryEnvelopeInvalid: 46 , CreateEnvelopeError: 47 , CannotSerializeObject: 48 , CannotSerializeObjectNonSerializable: 49 , CircularReferenceDetected: 50 , ClearAuthContextFailed: 51 , ExceptionTruncated: 52 , IllegalCharsInName: 53 , ItemNotInArray: 54 , MaxAjaxPerPVExceeded: 55 , MessageTruncated: 56 , NameTooLong: 57 , SampleRateOutOfRange: 58 , SetAuthContextFailed: 59 , SetAuthContextFailedAccountName: 60 , StringValueTooLong: 61 , StartCalledMoreThanOnce: 62 , StopCalledWithoutStart: 63 , TelemetryInitializerFailed: 64 , TrackArgumentsNotSpecified: 65 , UrlTooLong: 66 , SessionStorageBufferFull: 67 , CannotAccessCookie: 68 , IdTooLong: 69 , InvalidEvent: 70 , FailedMonitorAjaxSetRequestHeader: 71 , SendBrowserInfoOnUserInit: 72 , PluginException: 73 , NotificationException: 74 , SnippetScriptLoadFailure: 99 , InvalidInstrumentationKey: 100 , CannotParseAiBlobValue: 101 , InvalidContentBlob: 102 , TrackPageActionEventFailed: 103 , FailedAddingCustomDefinedRequestContext: 104 , InMemoryStorageBufferFull: 105 }); var ValueKind = createEnumStyle({ NotSet: 0 , Pii_DistinguishedName: 1 , Pii_GenericData: 2 , Pii_IPV4Address: 3 , Pii_IPv6Address: 4 , Pii_MailSubject: 5 , Pii_PhoneNumber: 6 , Pii_QueryString: 7 , Pii_SipAddress: 8 , Pii_SmtpAddress: 9 , Pii_Identity: 10 , Pii_Uri: 11 , Pii_Fqdn: 12 , Pii_IPV4AddressLegacy: 13 , CustomerContent_GenericContent: 32 }); var EventLatency = createEnumStyle({ Normal: 1 , CostDeferred: 2 , RealTime: 3 , Immediate: 4 }); var EventPropertyType = createEnumStyle({ Unspecified: 0 , String: 1 , Int32: 2 , UInt32: 3 , Int64: 4 , UInt64: 5 , Double: 6 , Bool: 7 , Guid: 8 , DateTime: 9 }); var EventPersistence = createEnumStyle({ Normal: 1 , Critical: 2 }); var TraceLevel = createEnumStyle({ NONE: 0 , ERROR: 1 , WARNING: 2 , INFORMATION: 3 }); var _ExtendedInternalMessageId = objFreeze(__assignFn(__assignFn({}, _InternalMessageId), createEnumStyle({ AuthHandShakeError: 501 , AuthRedirectFail: 502 , BrowserCannotReadLocalStorage: 503 , BrowserCannotWriteLocalStorage: 504 , BrowserDoesNotSupportLocalStorage: 505 , CannotParseBiBlobValue: 506 , CannotParseDataAttribute: 507 , CVPluginNotAvailable: 508 , DroppedEvent: 509 , ErrorParsingAISessionCookie: 510 , ErrorProvidedChannels: 511 , FailedToGetCookies: 512 , FailedToInitializeCorrelationVector: 513 , FailedToInitializeSDK: 514 , InvalidContentBlob: 515 , InvalidCorrelationValue: 516 , SessionRenewalDateIsZero: 517 , SendPostOnCompleteFailure: 518 , PostResponseHandler: 519 , SDKNotInitialized: 520 }))); var _a; var Version = '3.2.2'; var FullVersionString = "1DS-Web-JS-" + Version; var strDisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation"; var strWithCredentials = "withCredentials"; var strTimeout = "timeout"; var _fieldTypeEventPropMap = (_a = {}, _a[0 ] = 0 , _a[2 ] = 6 , _a[1 ] = 1 , _a[3 ] = 7 , _a[4096 | 2 ] = 6 , _a[4096 | 1 ] = 1 , _a[4096 | 3 ] = 7 , _a); var uInt8ArraySupported = null; var isDocumentObjectAvailable = Boolean(getDocument()); var isWindowObjectAvailable = Boolean(getWindow()); function isValueAssigned(value) { return !(value === "" || isNullOrUndefined(value)); } function getTenantId(apiKey) { if (apiKey) { var indexTenantId = apiKey.indexOf("-"); if (indexTenantId > -1) { return apiKey.substring(0, indexTenantId); } } return ""; } function isUint8ArrayAvailable() { if (uInt8ArraySupported === null) { uInt8ArraySupported = !isUndefined(Uint8Array) && !isSafariOrFirefox() && !isReactNative(); } return uInt8ArraySupported; } function isLatency(value) { if (value && isNumber(value) && value >= 1 && value <= 4 ) { return true; } return false; } function sanitizeProperty(name, property, stringifyObjects) { if ((!property && !isValueAssigned(property)) || typeof name !== "string") { return null; } var propType = typeof property; if (propType === "string" || propType === "number" || propType === "boolean" || isArray(property)) { property = { value: property }; } else if (propType === "object" && !property.hasOwnProperty("value")) { property = { value: stringifyObjects ? JSON.stringify(property) : property }; } else if (isNullOrUndefined(property.value) || property.value === "" || (!isString(property.value) && !isNumber(property.value) && !isBoolean(property.value) && !isArray(property.value))) { return null; } if (isArray(property.value) && !isArrayValid(property.value)) { return null; } if (!isNullOrUndefined(property.kind)) { if (isArray(property.value) || !isValueKind(property.kind)) { return null; } property.value = property.value.toString(); } return property; } function getCommonSchemaMetaData(value, kind, type) { var encodedTypeValue = -1; if (!isUndefined(value)) { if (kind > 0) { if (kind === 32) { encodedTypeValue = (1 << 13); } else if (kind <= 13) { encodedTypeValue = (kind << 5); } } if (isDataType(type)) { if (encodedTypeValue === -1) { encodedTypeValue = 0; } encodedTypeValue |= type; } else { var propType = _fieldTypeEventPropMap[getFieldValueType(value)] || -1; if (encodedTypeValue !== -1 && propType !== -1) { encodedTypeValue |= propType; } else if (propType === 6 ) { encodedTypeValue = propType; } } } return encodedTypeValue; } function disableCookies() { safeGetCookieMgr(null).setEnabled(false); } function setCookie(name, value, days) { if (areCookiesSupported(null)) { safeGetCookieMgr(null).set(name, value, days * 86400, null, "/"); } } function deleteCookie(name) { if (areCookiesSupported(null)) { safeGetCookieMgr(null).del(name); } } function getCookie(name) { if (areCookiesSupported(null)) { return getCookieValue(safeGetCookieMgr(null), name); } return ""; } function getCookieValue(cookieMgr, name, decode) { if (decode === void 0) { decode = true; } var cookieValue; if (cookieMgr) { cookieValue = cookieMgr.get(name); if (decode && cookieValue && decodeURIComponent) { cookieValue = decodeURIComponent(cookieValue); } } return cookieValue || ""; } function createGuid(style) { if (style === void 0) { style = "D" ; } var theGuid = newGuid(); if (style === "B" ) { theGuid = "{" + theGuid + "}"; } else if (style === "P" ) { theGuid = "(" + theGuid + ")"; } else if (style === "N" ) { theGuid = theGuid.replace(/-/g, ""); } return theGuid; } function extend(obj, obj2, obj3, obj4, obj5) { var extended = {}; var deep = false; var i = 0; var length = arguments.length; var objProto = Object[strShimPrototype]; var theArgs = arguments; if (objProto.toString.call(theArgs[0]) === "[object Boolean]") { deep = theArgs[0]; i++; } for (; i < length; i++) { var obj = theArgs[i]; objForEachKey(obj, function (prop, value) { if (deep && value && isObject(value)) { if (isArray(value)) { extended[prop] = extended[prop] || []; arrForEach(value, function (arrayValue, arrayIndex) { if (arrayValue && isObject(arrayValue)) { extended[prop][arrayIndex] = extend(true, extended[prop][arrayIndex], arrayValue); } else { extended[prop][arrayIndex] = arrayValue; } }); } else { extended[prop] = extend(true, extended[prop], value); } } else { extended[prop] = value; } }); } return extended; } var getTime = perfNow; function isValueKind(value) { if (value === 0 || ((value > 0 && value <= 13 ) || value === 32 )) { return true; } return false; } function isDataType(value) { if (value >= 0 && value <= 9) { return true; } return false; } function isSafariOrFirefox() { var nav = getNavigator(); if (!isUndefined(nav) && nav.userAgent) { var ua = nav.userAgent.toLowerCase(); if ((ua.indexOf("safari") >= 0 || ua.indexOf("firefox") >= 0) && ua.indexOf("chrome") < 0) { return true; } } return false; } function isArrayValid(value) { return value.length > 0; } function setProcessTelemetryTimings(event, identifier) { var evt = event; evt.timings = evt.timings || {}; evt.timings.processTelemetryStart = evt.timings.processTelemetryStart || {}; evt.timings.processTelemetryStart[identifier] = getTime(); } function getFieldValueType(value) { var theType = 0 ; if (value !== null && value !== undefined) { var objType = typeof value; if (objType === "string") { theType = 1 ; } else if (objType === "number") { theType = 2 ; } else if (objType === "boolean") { theType = 3 ; } else if (objType === strShimObject) { theType = 4 ; if (isArray(value)) { theType = 4096 ; if (value.length > 0) { theType |= getFieldValueType(value[0]); } } else if (hasOwnProperty(value, "value")) { theType = 8192 | getFieldValueType(value.value); } } } return theType; } var Utils = { Version: Version, FullVersionString: FullVersionString, strUndefined: strShimUndefined, strObject: strShimObject, Undefined: strShimUndefined, arrForEach: arrForEach, arrIndexOf: arrIndexOf, arrMap: arrMap, arrReduce: arrReduce, objKeys: objKeys, toISOString: toISOString, isReactNative: isReactNative, isString: isString, isNumber: isNumber, isBoolean: isBoolean, isFunction: isFunction, isArray: isArray, isObject: isObject, strTrim: strTrim, isDocumentObjectAvailable: isDocumentObjectAvailable, isWindowObjectAvailable: isWindowObjectAvailable, isValueAssigned: isValueAssigned, getTenantId: getTenantId, isBeaconsSupported: isBeaconsSupported, isUint8ArrayAvailable: isUint8ArrayAvailable, isLatency: isLatency, sanitizeProperty: sanitizeProperty, getISOString: toISOString, useXDomainRequest: useXDomainRequest, getCommonSchemaMetaData: getCommonSchemaMetaData, cookieAvailable: areCookiesSupported, disallowsSameSiteNone: uaDisallowsSameSiteNone, setCookie: setCookie, deleteCookie: deleteCookie, getCookie: getCookie, createGuid: createGuid, extend: extend, getTime: getTime, isValueKind: isValueKind, isArrayValid: isArrayValid, objDefineAccessors: objDefineAccessors, addPageUnloadEventListener: addPageUnloadEventListener, setProcessTelemetryTimings: setProcessTelemetryTimings, addEventHandler: addEventHandler, getFieldValueType: getFieldValueType, strEndsWith: strEndsWith, objForEachKey: objForEachKey }; var CoreUtils = { _canUseCookies: undefined, isTypeof: isTypeof, isUndefined: isUndefined, isNullOrUndefined: isNullOrUndefined, hasOwnProperty: hasOwnProperty, isFunction: isFunction, isObject: isObject, isDate: isDate, isArray: isArray, isError: isError, isString: isString, isNumber: isNumber, isBoolean: isBoolean, toISOString: toISOString, arrForEach: arrForEach, arrIndexOf: arrIndexOf, arrMap: arrMap, arrReduce: arrReduce, strTrim: strTrim, objCreate: objCreateFn, objKeys: objKeys, objDefineAccessors: objDefineAccessors, addEventHandler: addEventHandler, dateNow: dateNow, isIE: isIE, disableCookies: disableCookies, newGuid: newGuid, perfNow: perfNow, newId: newId, randomValue: randomValue, random32: random32, mwcRandomSeed: mwcRandomSeed, mwcRandom32: mwcRandom32, generateW3CId: generateW3CId }; function isChromium() { return !!getGlobalInst("chrome"); } function openXhr(method, urlString, withCredentials, disabled, isSync, timeout) { if (disabled === void 0) { disabled = false; } if (isSync === void 0) { isSync = false; } function _wrapSetXhrProp(xhr, prop, value) { try { xhr[prop] = value; } catch (e) { } } var xhr = new XMLHttpRequest(); if (disabled) { _wrapSetXhrProp(xhr, strDisabledPropertyName, disabled); } if (withCredentials) { _wrapSetXhrProp(xhr, strWithCredentials, withCredentials); } xhr.open(method, urlString, !isSync); if (withCredentials) { _wrapSetXhrProp(xhr, strWithCredentials, withCredentials); } if (!isSync && timeout) { _wrapSetXhrProp(xhr, strTimeout, timeout); } return xhr; } var PropVersion = "version"; var properties = "properties"; var AppInsightsCore = /** @class */ (function (_super) { __extendsFn(AppInsightsCore, _super); function AppInsightsCore() { var _this = _super.call(this) || this; _this.pluginVersionStringArr = []; _this.pluginVersionString = ""; dynamicProto(AppInsightsCore, _this, function (_self, _base) { if (!_self.logger || !_self.logger.queue) { _self.logger = new DiagnosticLogger({ loggingLevelConsole: 1 }); } _self.initialize = function (config, extensions, logger, notificationManager) { doPerf(_self, function () { return "AppInsightsCore.initialize"; }, function () { if (config) { if (!config.endpointUrl) { config.endpointUrl = "https://browser.events.data.microsoft.com/OneCollector/1.0/"; } var propertyStorageOverride = config.propertyStorageOverride; if (propertyStorageOverride && (!propertyStorageOverride.getProperty || !propertyStorageOverride.setProperty)) { throw new Error("Invalid property storage override passed."); } if (config.channels) { arrForEach(config.channels, function (channels) { if (channels) { arrForEach(channels, function (channel) { if (channel.identifier && channel.version) { var ver = channel.identifier + "=" + channel.version; _self.pluginVersionStringArr.push(ver); } }); } }); } } _self.getWParam = function () { return typeof document !== "undefined" ? 0 : -1; }; if (extensions) { arrForEach(extensions, function (ext) { if (ext && ext.identifier && ext.version) { var ver = ext.identifier + "=" + ext.version; _self.pluginVersionStringArr.push(ver); } }); } _self.pluginVersionString = _self.pluginVersionStringArr.join(";"); try { _base.initialize(config, extensions, logger, notificationManager); _self.pollInternalLogs("InternalLog"); } catch (e) { var logger_1 = _self.logger; var message = dumpObj(e); if (message.indexOf("channels") !== -1) { message += "\n - Channels must be provided through config.channels only!"; } logger_1.throwInternal(1 , 514 , "SDK Initialization Failed - no telemetry will be sent: " + message); } }, function () { return ({ config: config, extensions: extensions, logger: logger, notificationManager: notificationManager }); }); }; _self.track = function (item) { doPerf(_self, function () { return "AppInsightsCore.track"; }, function () { var telemetryItem = item; if (telemetryItem) { telemetryItem.timings = telemetryItem.timings || {}; telemetryItem.timings.trackStart = getTime(); if (!isLatency(telemetryItem.latency)) { telemetryItem.latency = 1 ; } var itemExt = telemetryItem.ext = telemetryItem.ext || {}; itemExt.sdk = itemExt.sdk || {}; itemExt.sdk.ver = FullVersionString; var baseData = telemetryItem.baseData = telemetryItem.baseData || {}; if (!baseData[properties]) { baseData[properties] = {}; } var itemProperties = baseData[properties]; if (!itemProperties[PropVersion]) { itemProperties[PropVersion] = ""; } if (_self.pluginVersionString !== "") { itemProperties[PropVersion] = _self.pluginVersionString; } } _base.track(telemetryItem); }, function () { return ({ item: item }); }, !(item.sync)); }; }); return _this; } return AppInsightsCore; }(AppInsightsCore$2)); var AppInsightsCore$1 = AppInsightsCore; var BaseCore = /** @class */ (function (_super) { __extendsFn(BaseCore, _super); function BaseCore() { var _this = _super.call(this) || this; dynamicProto(BaseCore, _this, function (_self, _base) { _self.initialize = function (config, extensions, logger, notificationManager) { if (config && !config.endpointUrl) { config.endpointUrl = "https://browser.events.data.microsoft.com/OneCollector/1.0/"; } _self.getWParam = function () { return isDocumentObjectAvailable ? 0 : -1; }; try { _base.initialize(config, extensions, logger, notificationManager); } catch (e) { _throwInternal(_self.logger, 1 , 514 , "Initialization Failed: " + dumpObj(e) + "\n - Note: Channels must be provided through config.channels only"); } }; _self.track = function (item) { var telemetryItem = item; if (telemetryItem) { var ext = telemetryItem.ext = telemetryItem.ext || {}; ext.sdk = ext.sdk || {}; ext.sdk.ver = FullVersionString; } _base.track(telemetryItem); }; }); return _this; } return BaseCore; }(BaseCore$2)); var BaseCore$1 = BaseCore; var _isFunction = isFunction; function _createPromiseAllOnResolvedFunction(values, index, resolvedCallback) { return function (value) { values[index] = value; resolvedCallback(); }; } var ESPromise = /** @class */ (function () { function ESPromise(resolverFunc) { var _state = 0 ; var _settledValue = null; var _queue = []; dynamicProto(ESPromise, this, function (_this) { _this.then = function (onResolved, onRejected) { return new ESPromise(function (resolve, reject) { _enqueue(onResolved, onRejected, resolve, reject); }); }; _this["catch"] = function (onRejected) { return _this.then(null, onRejected); }; }); function _enqueue(onResolved, onRejected, resolve, reject) { _queue.push(function () { var value; try { if (_state === 1 ) { value = _isFunction(onResolved) ? onResolved(_settledValue) : _settledValue; } else { value = _isFunction(onRejected) ? onRejected(_settledValue) : _settledValue; } if (value instanceof ESPromise) { value.then(resolve, reject); } else if (_state === 2 && !_isFunction(onRejected)) { reject(value); } else { resolve(value); } } catch (error) { reject(error); return; } }); if (_state !== 0 ) { _processQueue(); } } function _processQueue() { if (_queue.length > 0) { var pending_1 = _queue.slice(); _queue = []; setTimeout(function () { for (var i = 0, len = pending_1.length; i < len; ++i) { try { pending_1[i](); } catch (e) { } } }, 0); } } function _resolve(value) { if (_state === 0 ) { _settledValue = value; _state = 1 ; _processQueue(); } } function _reject(reason) { if (_state === 0 ) { _settledValue = reason; _state = 2 ; _processQueue(); } } (function _initialize() { if (!_isFunction(resolverFunc)) { throw new TypeError("ESPromise: resolvedFunc argument is not a Function"); } try { resolverFunc(_resolve, _reject); } catch (error) { _reject(error); } })(); } ESPromise.resolve = function (value) { if (value instanceof ESPromise) { return value; } else if (value && _isFunction(value.then)) { return new ESPromise(function (resolve, reject) { try { value.then(resolve, reject); } catch (error) { reject(error); } }); } return new ESPromise(function (resolve) { resolve(value); }); }; ESPromise.reject = function (reason) { return new ESPromise(function (resolve, reject) { reject(reason); }); }; ESPromise.all = function (iterable) { if (!iterable || !iterable.length) { return; } return new ESPromise(function (resolve, reject) { try { var values_1 = []; var pending_2 = 0; for (var lp = 0; lp < iterable.length; lp++) { var item = iterable[lp]; if (item && _isFunction(item.then)) { pending_2++; item.then(_createPromiseAllOnResolvedFunction(values_1, lp, function () { if (--pending_2 === 0) { resolve(values_1); } }), reject); } else { values_1[lp] = item; } } if (pending_2 === 0) { setTimeout(function () { resolve(values_1); }, 0); } } catch (error) { reject(error); } }); }; ESPromise.race = function (iterable) { return new ESPromise(function (resolve, reject) { if (!iterable || !iterable.length) { return; } try { var _loop_1 = function (lp) { var item = iterable[lp]; if (item && _isFunction(item.then)) { item.then(resolve, reject); } else { setTimeout(function () { resolve(item); }, 0); } }; for (var lp = 0; lp < iterable.length; lp++) { _loop_1(lp); } } catch (error) { reject(error); } }); }; return ESPromise; }()); var ESPromise$1 = ESPromise; var LazyRejectPeriod = 600000; var _schedulerId = 0; var _running = []; var _waiting = []; var _timedOut = []; function _getTime() { return new Date().getTime(); } var ESPromiseScheduler = /** @class */ (function () { function ESPromiseScheduler(name, diagLog) { var _promiseId = 0; var _scheduledName = (name || "") + "." + _schedulerId; _schedulerId++; dynamicProto(ESPromiseScheduler, this, function (_this) { var _lastEvent = null; var _eventCount = 0; _this.scheduleEvent = function (startEventAction, eventName, timeout) { var uniqueId = _scheduledName + "." + _eventCount; _eventCount++; if (eventName) { uniqueId += "-(" + eventName + ")"; } var uniqueEventId = uniqueId + "{" + _promiseId + "}"; _promiseId++; var newScheduledEvent = { evt: null, tm: _getTime(), id: uniqueEventId, isRunning: false, isAborted: false }; if (!_lastEvent) { newScheduledEvent.evt = _startWaitingEvent(newScheduledEvent); } else { newScheduledEvent.evt = _waitForPreviousEvent(newScheduledEvent, _lastEvent); } _lastEvent = newScheduledEvent; _lastEvent.evt._schId = uniqueEventId; return newScheduledEvent.evt; function _abortAndRemoveOldEvents(eventQueue) { var now = _getTime(); var expired = now - LazyRejectPeriod; var len = eventQueue.length; var lp = 0; while (lp < len) { var evt = eventQueue[lp]; if (evt && evt.tm < expired) { var message = null; if (evt.abort) { message = "Aborting [" + evt.id + "] due to Excessive runtime (" + (now - evt.tm) + " ms)"; evt.abort(message); } else { message = "Removing [" + evt.id + "] due to Excessive runtime (" + (now - evt.tm) + " ms)"; } _warnLog(message); eventQueue.splice(lp, 1); len--; } else { lp++; } } } function _cleanup(eventId, completed) { var toQueue = false; var removed = _removeQueuedEvent(_running, eventId); if (!removed) { removed = _removeQueuedEvent(_timedOut, eventId); toQueue = true; } if (removed) { if (removed.to) { clearTimeout(removed.to); removed.to = null; } var tm = _getTime() - removed.tm; if (completed) { if (!toQueue) { _debugLog("Promise [" + eventId + "] Complete -- " + tm + " ms"); } else { _warnLog("Timed out event [" + eventId + "] finally complete -- " + tm + " ms"); } } else { _timedOut.push(removed); _warnLog("Event [" + eventId + "] Timed out and removed -- " + tm + " ms"); } } else { _debugLog("Failed to remove [" + eventId + "] from running queue"); } if (_lastEvent && _lastEvent.id === eventId) { _lastEvent = null; } _abortAndRemoveOldEvents(_running); _abortAndRemoveOldEvents(_waiting); _abortAndRemoveOldEvents(_timedOut); } function _removeScheduledEvent(eventId, callback) { return function (value) { _cleanup(eventId, true); callback && callback(value); return value; }; } function _waitForFinalResult(eventId, startResult, schEventResolve, schEventReject) { startResult.then(function (value) { if (value instanceof ESPromise$1) { _debugLog("Event [" + eventId + "] returned a promise -- waiting"); _waitForFinalResult(eventId, value, schEventResolve, schEventReject); return value; } else { return _removeScheduledEvent(eventId, schEventResolve)(value); } }, _removeScheduledEvent(eventId, schEventReject)); } function _createScheduledEvent(eventDetails, startEvent) { var eventId = eventDetails.id; return new ESPromise$1(function (schEventResolve, schEventReject) { _debugLog("Event [" + eventId + "] Starting -- waited for " + (eventDetails.wTm || "--") + " ms"); eventDetails.isRunning = true; eventDetails.abort = function (message) { eventDetails.abort = null; eventDetails.isAborted = true; _cleanup(eventId, false); schEventReject(new Error(message)); }; var startResult = startEvent(eventId); if (startResult instanceof ESPromise$1) { if (timeout) { eventDetails.to = setTimeout(function () { _cleanup(eventId, false); schEventReject(new Error("Timed out after [" + timeout + "] ms")); }, timeout); } _waitForFinalResult(eventId, startResult, function (theResult) { _debugLog("Event [" + eventId + "] Resolving after " + (_getTime() - eventDetails.tm) + " ms"); schEventResolve(theResult); }, schEventReject); } else { _debugLog("Promise [" + eventId + "] Auto completed as the start action did not return a promise"); schEventResolve(); } }); } function _startWaitingEvent(eventDetails) { var now = _getTime(); eventDetails.wTm = now - eventDetails.tm; eventDetails.tm = now; if (eventDetails.isAborted) { return ESPromise$1.reject(new Error("[" + uniqueId + "] was aborted")); } _running.push(eventDetails); return _createScheduledEvent(eventDetails, startEventAction); } function _waitForPreviousEvent(eventDetails, waitForEvent) { var waitEvent = new ESPromise$1(function (waitResolve, waitReject) { var runTime = _getTime() - waitForEvent.tm; var prevId = waitForEvent.id; _debugLog("[" + uniqueId + "] is waiting for [" + prevId + ":" + runTime + " ms] to complete before starting -- [" + _waiting.length + "] waiting and [" + _running.length + "] running"); eventDetails.abort = function (message) { eventDetails.abort = null; _removeQueuedEvent(_waiting, uniqueId); eventDetails.isAborted = true; waitReject(new Error(message)); }; waitForEvent.evt.then(function (value) { _removeQueuedEvent(_waiting, uniqueId); _startWaitingEvent(eventDetails).then(waitResolve, waitReject); }, function (reason) { _removeQueuedEvent(_waiting, uniqueId); _startWaitingEvent(eventDetails).then(waitResolve, waitReject); }); }); _waiting.push(eventDetails); return waitEvent; } }; function _removeQueuedEvent(queue, eventId) { for (var lp = 0; lp < queue.length; lp++) { if (queue[lp].id === eventId) { return queue.splice(lp, 1)[0]; } } return null; } }); function _debugLog(message) { var global = getGlobal(); if (global && global["QUnit"]) { console && console.log("ESPromiseScheduler[" + _scheduledName + "] " + message); } } function _warnLog(message) { diagLog && diagLog.warnToConsole("ESPromiseScheduler[" + _scheduledName + "] " + message); } } ESPromiseScheduler.incomplete = function () { return _running; }; ESPromiseScheduler.waitingToStart = function () { return _waiting; }; return ESPromiseScheduler; }()); var ESPromiseScheduler$1 = ESPromiseScheduler; var ValueSanitizer = /** @class */ (function () { function ValueSanitizer(fieldSanitizerProvider) { var _self = this; var _sanitizerMap = {}; var _sanitizers = []; var _fieldSanitizers = []; if (fieldSanitizerProvider) { _fieldSanitizers.push(fieldSanitizerProvider); } function _getFieldSanitizer(path, name) { var result; var fieldLookup = _sanitizerMap[path]; if (fieldLookup) { result = fieldLookup[name]; } if (!result && result !== null) { if (isString(path) && isString(name)) { if (_fieldSanitizers.length > 0) { for (var lp = 0; lp < _fieldSanitizers.length; lp++) { if (_fieldSanitizers[lp].handleField(path, name)) { result = { canHandle: true, fieldHandler: _fieldSanitizers[lp] }; break; } } } else if (_sanitizers.length === 0) { result = { canHandle: true }; } } if (!result && result !== null) { result = null; for (var lp = 0; lp < _sanitizers.length; lp++) { if (_sanitizers[lp].handleField(path, name)) { result = { canHandle: true, handler: _sanitizers[lp], fieldHandler: null }; break; } } } if (!fieldLookup) { fieldLookup = _sanitizerMap[path] = {}; } fieldLookup[name] = result; } return result; } _self.addSanitizer = function (newSanitizer) { if (newSanitizer) { _sanitizers.push(newSanitizer); _sanitizerMap = {}; } }; _self.addFieldSanitizer = function (fieldSanitizer) { if (fieldSanitizer) { _fieldSanitizers.push(fieldSanitizer); _sanitizerMap = {}; } }; _self.handleField = function (path, name) { var mapValue = _getFieldSanitizer(path, name); return mapValue ? mapValue.canHandle : false; }; _self.value = function (path, name, value, stringifyObjects) { var mapValue = _getFieldSanitizer(path, name); if (mapValue && mapValue.canHandle) { if (!mapValue || !mapValue.canHandle) { return null; } if (mapValue.handler) { return mapValue.handler.value(path, name, value, stringifyObjects); } if (!isString(name) || isNullOrUndefined(value) || value === "") { return null; } var property = null; var fieldType = getFieldValueType(value); if ((fieldType & 8192 ) === 8192 ) { var subType = fieldType & ~8192 ; property = value; if (!isValueAssigned(property.value) || (subType !== 1 && subType !== 2 && subType !== 3 && (subType & 4096 ) !== 4096 )) { return null; } } else if (fieldType === 1 || fieldType === 2 || fieldType === 3 || (fieldType & 4096 ) === 4096 ) { property = _convertToProperty(path, name, value); } else if (fieldType === 4 ) { property = _convertToProperty(path, name, !!stringifyObjects ? JSON.stringify(value) : value); } if (property) { return _handleProperty(mapValue, path, name, fieldType, property, stringifyObjects); } } return null; }; _self.property = function (path, name, property, stringifyObjects) { var mapValue = _getFieldSanitizer(path, name); if (!mapValue || !mapValue.canHandle) { return null; } if (!isString(name) || isNullOrUndefined(property) || !isValueAssigned(property.value)) { return null; } var fieldType = getFieldValueType(property.value); if (fieldType === 0 ) { return null; } return _handleProperty(mapValue, path, name, fieldType, property, stringifyObjects); }; function _handleProperty(mapValue, path, name, fieldType, property, stringifyObjects) { if (mapValue.handler) { return mapValue.handler.property(path, name, property, stringifyObjects); } if (!isNullOrUndefined(property.kind)) { if ((fieldType & 4096 ) === 4096 || !isValueKind(property.kind)) { return null; } property.value = property.value.toString(); } return _callFieldSanitizer(mapValue.fieldHandler, path, name, fieldType, property); } function _convertToProperty(path, name, value) { if (isValueAssigned(value)) { return { value: value }; } return null; } function _callFieldSanitizer(fieldProvider, path, name, theType, property) { if (property && fieldProvider) { var sanitizer = fieldProvider.getSanitizer(path, name, theType, property.kind, property.propertyType); if (sanitizer) { if (theType === 4 ) { var newValue_1 = {}; var propValue = property.value; objForEachKey(propValue, function (propKey, theValue) { var newPath = path + "." + name; if (isValueAssigned(theValue)) { var newProp = _convertToProperty(newPath, propKey, theValue); newProp = _callFieldSanitizer(fieldProvider, newPath, propKey, getFieldValueType(theValue), newProp); if (newProp) { newValue_1[propKey] = newProp.value; } } }); property.value = newValue_1; } else { var details = { path: path, name: name, type: theType, prop: property, sanitizer: _self }; property = sanitizer.call(_self, details); } } } return property; } } ValueSanitizer.getFieldType = getFieldValueType; return ValueSanitizer; }()); exports.AppInsightsCore = AppInsightsCore$1; exports.BaseCore = BaseCore$1; exports.BaseTelemetryPlugin = BaseTelemetryPlugin; exports.CoreUtils = CoreUtils; exports.DiagnosticLogger = DiagnosticLogger; exports.ESPromise = ESPromise$1; exports.ESPromiseScheduler = ESPromiseScheduler$1; exports.EventHelper = EventHelper; exports.EventLatency = EventLatency; exports.EventPersistence = EventPersistence; exports.EventPropertyType = EventPropertyType; exports.EventsDiscardedReason = EventsDiscardedReason; exports.FullVersionString = FullVersionString; exports.InternalAppInsightsCore = AppInsightsCore$2; exports.InternalBaseCore = BaseCore$2; exports.LoggingSeverity = LoggingSeverity; exports.MinChannelPriorty = MinChannelPriorty; exports.NotificationManager = NotificationManager; exports.PerfEvent = PerfEvent; exports.PerfManager = PerfManager; exports.ProcessTelemetryContext = ProcessTelemetryContext; exports.TraceLevel = TraceLevel; exports.Undefined = strShimUndefined; exports.Utils = Utils; exports.ValueKind = ValueKind; exports.ValueSanitizer = ValueSanitizer; exports.Version = Version; exports._ExtendedInternalMessageId = _ExtendedInternalMessageId; exports._InternalLogMessage = _InternalLogMessage; exports._InternalMessageId = _InternalMessageId; exports.__getRegisteredEvents = __getRegisteredEvents; exports._throwInternal = _throwInternal; exports.addEventHandler = addEventHandler; exports.addEventListeners = addEventListeners; exports.addPageHideEventListener = addPageHideEventListener; exports.addPageShowEventListener = addPageShowEventListener; exports.addPageUnloadEventListener = addPageUnloadEventListener; exports.areCookiesSupported = areCookiesSupported; exports.arrForEach = arrForEach; exports.arrIndexOf = arrIndexOf; exports.arrMap = arrMap; exports.arrReduce = arrReduce; exports.attachEvent = attachEvent; exports.cookieAvailable = areCookiesSupported; exports.createCookieMgr = createCookieMgr; exports.createEnumStyle = createEnumStyle; exports.createGuid = createGuid; exports.createProcessTelemetryContext = createProcessTelemetryContext; exports.createUniqueNamespace = createUniqueNamespace; exports.createUnloadHandlerContainer = createUnloadHandlerContainer; exports.dateNow = dateNow; exports.deleteCookie = deleteCookie; exports.detachEvent = detachEvent; exports.disableCookies = disableCookies; exports.disallowsSameSiteNone = uaDisallowsSameSiteNone; exports.doPerf = doPerf; exports.dumpObj = dumpObj; exports.eventOff = eventOff; exports.eventOn = eventOn; exports.extend = extend; exports.generateW3CId = generateW3CId; exports.getCommonSchemaMetaData = getCommonSchemaMetaData; exports.getConsole = getConsole; exports.getCookie = getCookie; exports.getCookieValue = getCookieValue; exports.getCrypto = getCrypto; exports.getDocument = getDocument; exports.getExceptionName = getExceptionName; exports.getFieldValueType = getFieldValueType; exports.getGlobal = getGlobal; exports.getGlobalInst = getGlobalInst; exports.getHistory = getHistory; exports.getIEVersion = getIEVersion; exports.getISOString = toISOString; exports.getJSON = getJSON; exports.getLocation = getLocation; exports.getMsCrypto = getMsCrypto; exports.getNavigator = getNavigator; exports.getPerformance = getPerformance; exports.getSetValue = getSetValue; exports.getTenantId = getTenantId; exports.getTime = getTime; exports.getWindow = getWindow; exports.hasDocument = hasDocument; exports.hasHistory = hasHistory; exports.hasJSON = hasJSON; exports.hasNavigator = hasNavigator; exports.hasOwnProperty = hasOwnProperty; exports.hasWindow = hasWindow; exports.isArray = isArray; exports.isArrayValid = isArrayValid; exports.isBeaconsSupported = isBeaconsSupported; exports.isBoolean = isBoolean; exports.isChromium = isChromium; exports.isDate = isDate; exports.isDocumentObjectAvailable = isDocumentObjectAvailable; exports.isError = isError; exports.isFetchSupported = isFetchSupported; exports.isFunction = isFunction; exports.isIE = isIE; exports.isLatency = isLatency; exports.isNotTruthy = isNotTruthy; exports.isNullOrUndefined = isNullOrUndefined; exports.isNumber = isNumber; exports.isObject = isObject; exports.isReactNative = isReactNative; exports.isString = isString; exports.isTruthy = isTruthy; exports.isTypeof = isTypeof; exports.isUint8ArrayAvailable = isUint8ArrayAvailable; exports.isUndefined = isUndefined; exports.isValueAssigned = isValueAssigned; exports.isValueKind = isValueKind; exports.isWindowObjectAvailable = isWindowObjectAvailable; exports.isXhrSupported = isXhrSupported; exports.mergeEvtNamespace = mergeEvtNamespace; exports.newGuid = newGuid; exports.newId = newId; exports.normalizeJsName = normalizeJsName; exports.objCreate = objCreateFn; exports.objDefineAccessors = objDefineAccessors; exports.objForEachKey = objForEachKey; exports.objFreeze = objFreeze; exports.objKeys = objKeys; exports.objSeal = objSeal; exports.openXhr = openXhr; exports.optimizeObject = optimizeObject; exports.perfNow = perfNow; exports.proxyAssign = proxyAssign; exports.proxyFunctionAs = proxyFunctionAs; exports.proxyFunctions = proxyFunctions; exports.random32 = random32; exports.randomValue = randomValue; exports.removeEventHandler = removeEventHandler; exports.removeEventListeners = removeEventListeners; exports.removePageHideEventListener = removePageHideEventListener; exports.removePageShowEventListener = removePageShowEventListener; exports.removePageUnloadEventListener = removePageUnloadEventListener; exports.safeGetCookieMgr = safeGetCookieMgr; exports.safeGetLogger = safeGetLogger; exports.sanitizeProperty = sanitizeProperty; exports.setCookie = setCookie; exports.setEnableEnvMocks = setEnableEnvMocks; exports.setProcessTelemetryTimings = setProcessTelemetryTimings; exports.setValue = setValue; exports.strContains = strContains; exports.strEndsWith = strEndsWith; exports.strFunction = strShimFunction; exports.strObject = strShimObject; exports.strPrototype = strShimPrototype; exports.strStartsWith = strStartsWith; exports.strTrim = strTrim; exports.strUndefined = strShimUndefined; exports.throwError = throwError; exports.toISOString = toISOString; exports.useXDomainRequest = useXDomainRequest; (function(obj, prop, descriptor) { /* ai_es3_polyfil defineProperty */ var func = Object["defineProperty"]; if (func) { try { return func(obj, prop, descriptor); } catch(e) { /* IE8 defines defineProperty, but will throw */ } } if (descriptor && typeof descriptor.value !== undefined) { obj[prop] = descriptor.value; } return obj; })(exports, '__esModule', { value: true }); })(this.oneDS = this.oneDS || {});//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/1ds-core-js/bundle/ms.core.gbl.js.map /*! * 1DS JS SDK Core, 3.2.2 * Copyright (c) Microsoft and contributors. All rights reserved. * (Microsoft Internal Only) */ !function(n){"use strict";var I="function",u="object",e="undefined",f="prototype",P="hasOwnProperty",t=Object,E=t[f],N=t.assign,z=t.create,V=t.defineProperty,B=E[P],H=null;function K(n){return void 0===n&&(n=!0),H&&n||(typeof globalThis!==e&&globalThis&&(H=globalThis),typeof self!==e&&self&&(H=self),typeof window!==e&&window&&(H=window),typeof global!==e&&global&&(H=global)),H}function q(n){throw new TypeError(n)}function W(n){if(z)return z(n);if(null==n)return{};var e=typeof n;function t(){}return e!==u&&e!==I&&q("Object prototype may only be an Object:"+n),t[f]=n,new t}(K()||{}).Symbol,(K()||{}).Reflect;var G=N||function(n){for(var e,t=1,r=arguments.length;t=o.maxInternalMessageLimit()||(r=!0,t="AITR_"+e.messageId,a[t]?r=!1:a[t]=!0,r&&(n<=o.telemetryLoggingLevel()&&(o.queue.push(e),i++,u(1===n?"error":"warn",e)),i===o.maxInternalMessageLimit()&&(r=new wt(23,t="Internal events throttle limit per PageView reached for this app.",!1),o.queue.push(r),1===n?o.errorToConsole(t):o.warnToConsole(t))))}})};function j(n,e,t,r,i,o){void 0===o&&(o=!1),(n||new Pt).throwInternal(e,t,r,i,o)}l.ParentContextKey="parent",l.ChildrenContextKey="childEvts";var Et=l;function l(n,i,e){var t,o=this,u=!1;o.start=te(),o.name=n,o.isAsync=e,o.isChildEvt=function(){return!1},_(i)&&(u=ne(o,"payload",function(){return!t&&_(i)&&(t=i(),i=null),t})),o.getCtx=function(n){return n?(n===l.ParentContextKey||n===l.ChildrenContextKey?o:o.ctx||{})[n]:null},o.setCtx=function(n,e){n&&(n===l.ParentContextKey?(o[n]||(o.isChildEvt=function(){return!0}),o[n]=e):n===l.ChildrenContextKey?o[n]=e:(o.ctx=o.ctx||{})[n]=e)},o.complete=function(){var n=0,e=o.getCtx(l.ChildrenContextKey);if(m(e))for(var t=0;t>>=0),Ft=123456789+n&c,Ot=987654321-n&c,Mt=!0}function Dt(){try{var n=2147483647&te();Lt((Math.random()*_t^n)+n)}catch(e){}}function Ut(n){return 0>>0:0}function jt(n){var e=0,t=st()||ft();return 0===(e=t&&t.getRandomValues?t.getRandomValues(new Uint32Array(1))[0]&c:e)&>()&&(Mt||Dt(),e=Rt()&c),0===e&&(e=Math.floor(_t*Math.random()|0)),n||(e>>>=0),e}function Rt(n){var e=((Ot=36969*(65535&Ot)+(Ot>>16)&c)<<16)+(65535&(Ft=18e3*(65535&Ft)+(Ft>>16)&c))>>>0&c|0;return n||(e>>>=0),e}function zt(n){void 0===n&&(n=22);for(var e=jt()>>>0,t=0,r=g;r.length>>=6,5==++t&&(e=(jt()<<2&4294967295|3&e)>>>0,t=0);return r}var Vt=V,Bt="2.8.3",Ht="."+zt(6),Kt=0;function qt(n){return 1===n.nodeType||9===n.nodeType||!+n.nodeType}function Wt(n,e){return Vn(n+Kt+++((e=void 0!==e&&e)?"."+Bt:"")+Ht)}function Gt(n){var o={id:Wt("_aiData-"+(n||"")+"."+Bt),accept:qt,get:function(n,e,t,r){var i=n[o.id];return i?i[Vn(e)]:(r&&((i=function(n,e){var t=e[n.id];if(!t){t={};try{qt(e)&&!function(n,e,t){if(Vt)try{return Vt(n,e,{value:t,enumerable:!1,configurable:!0}),1}catch(r){}}(e,n.id,t)&&(e[n.id]=t)}catch(r){}}return t}(o,n))[Vn(e)]=t),t)},kill:function(n,e){if(n&&n[e])try{delete n[e]}catch(t){}}};return o}var Jt=Gt("plugin");function Xt(n){return Jt.get(n,"state",{},!0)}function Qt(t,r){for(var i,n=[],e=null,o=t.getNext();o;){var u=o.getPlugin();u&&(e&&_(e[Y])&&_(u[$])&&e[Y](u),(_(u[nn])?u[nn]():(i=Xt(u))[nn])||n.push(u),e=u,o=o.getNext())}M(n,function(n){var e=t.core();n.initialize(t.getCfg(),e,r,t.getNext()),i=Xt(n),n[d]||i[d]||(i[d]=e),i[nn]=!0,delete i[A]})}function $t(n){return n.sort(function(n,e){var t=0,r=_(e[$]);return _(n[$])?t=r?n[Z]-e[Z]:1:r&&(t=-1),t})}var Zt="TelemetryPluginChain",Yt="_hasRun",nr="_getTelCtx",er=0;function tr(n,u,t,e){var r=null,i=[],o=(null!==e&&(r=e?function(n,e,t){for(;n;){if(n.getPlugin()===t)return n;n=n.getNext()}return or([t],e.config||{},e)}(n,t,e):n),{_next:function(){var n,e=r;return r=e?e.getNext():null,e||(n=i)&&0_r&&l.push(n)}),Fr(c,l,t,a)),c)),w?(-1!==(d=F(v,w))&&v.splice(d,1),-1!==(d=F(b,w))&&b.splice(d,1),w._setQueue(I)):(s=I,f=m,g=!1,(d={identifier:"ChannelControllerPlugin",priority:_r,initialize:function(e,t,r,n){g=!0,M(s,function(n){n&&0>4&15]+e[n>>8&15]+e[n>>12&15]+e[n>>16&15]+e[n>>20&15]+e[n>>24&15]+e[n>>28&15];var i=e[8+(3&jt())|0];return t.substr(0,8)+t.substr(9,4)+"4"+t.substr(13,3)+i+t.substr(16,3)+t.substr(19,12)}var Mi=/[xy]/g,Fi={Attach:Si,AttachEvent:Si,Detach:bi,DetachEvent:bi},Oi=i({CRITICAL:1,WARNING:2}),Li=i({BrowserDoesNotSupportLocalStorage:0,BrowserCannotReadLocalStorage:1,BrowserCannotReadSessionStorage:2,BrowserCannotWriteLocalStorage:3,BrowserCannotWriteSessionStorage:4,BrowserFailedRemovalFromLocalStorage:5,BrowserFailedRemovalFromSessionStorage:6,CannotSendEmptyTelemetry:7,ClientPerformanceMathError:8,ErrorParsingAISessionCookie:9,ErrorPVCalc:10,ExceptionWhileLoggingError:11,FailedAddingTelemetryToBuffer:12,FailedMonitorAjaxAbort:13,FailedMonitorAjaxDur:14,FailedMonitorAjaxOpen:15,FailedMonitorAjaxRSC:16,FailedMonitorAjaxSend:17,FailedMonitorAjaxGetCorrelationHeader:18,FailedToAddHandlerForOnBeforeUnload:19,FailedToSendQueuedTelemetry:20,FailedToReportDataLoss:21,FlushFailed:22,MessageLimitPerPVExceeded:23,MissingRequiredFieldSpecification:24,NavigationTimingNotSupported:25,OnError:26,SessionRenewalDateIsZero:27,SenderNotInitialized:28,StartTrackEventFailed:29,StopTrackEventFailed:30,StartTrackFailed:31,StopTrackFailed:32,TelemetrySampledAndNotSent:33,TrackEventFailed:34,TrackExceptionFailed:35,TrackMetricFailed:36,TrackPVFailed:37,TrackPVFailedCalc:38,TrackTraceFailed:39,TransmissionFailed:40,FailedToSetStorageBuffer:41,FailedToRestoreStorageBuffer:42,InvalidBackendResponse:43,FailedToFixDepricatedValues:44,InvalidDurationValue:45,TelemetryEnvelopeInvalid:46,CreateEnvelopeError:47,CannotSerializeObject:48,CannotSerializeObjectNonSerializable:49,CircularReferenceDetected:50,ClearAuthContextFailed:51,ExceptionTruncated:52,IllegalCharsInName:53,ItemNotInArray:54,MaxAjaxPerPVExceeded:55,MessageTruncated:56,NameTooLong:57,SampleRateOutOfRange:58,SetAuthContextFailed:59,SetAuthContextFailedAccountName:60,StringValueTooLong:61,StartCalledMoreThanOnce:62,StopCalledWithoutStart:63,TelemetryInitializerFailed:64,TrackArgumentsNotSpecified:65,UrlTooLong:66,SessionStorageBufferFull:67,CannotAccessCookie:68,IdTooLong:69,InvalidEvent:70,FailedMonitorAjaxSetRequestHeader:71,SendBrowserInfoOnUserInit:72,PluginException:73,NotificationException:74,SnippetScriptLoadFailure:99,InvalidInstrumentationKey:100,CannotParseAiBlobValue:101,InvalidContentBlob:102,TrackPageActionEventFailed:103,FailedAddingCustomDefinedRequestContext:104,InMemoryStorageBufferFull:105}),Di=i({NotSet:0,Pii_DistinguishedName:1,Pii_GenericData:2,Pii_IPV4Address:3,Pii_IPv6Address:4,Pii_MailSubject:5,Pii_PhoneNumber:6,Pii_QueryString:7,Pii_SipAddress:8,Pii_SmtpAddress:9,Pii_Identity:10,Pii_Uri:11,Pii_Fqdn:12,Pii_IPV4AddressLegacy:13,CustomerContent_GenericContent:32}),Ui=i({Normal:1,CostDeferred:2,RealTime:3,Immediate:4}),ji=i({Unspecified:0,String:1,Int32:2,UInt32:3,Int64:4,UInt64:5,Double:6,Bool:7,Guid:8,DateTime:9}),Ri=i({Normal:1,Critical:2}),zi=i({NONE:0,ERROR:1,WARNING:2,INFORMATION:3}),G=O(G(G({},Li),i({AuthHandShakeError:501,AuthRedirectFail:502,BrowserCannotReadLocalStorage:503,BrowserCannotWriteLocalStorage:504,BrowserDoesNotSupportLocalStorage:505,CannotParseBiBlobValue:506,CannotParseDataAttribute:507,CVPluginNotAvailable:508,DroppedEvent:509,ErrorParsingAISessionCookie:510,ErrorProvidedChannels:511,FailedToGetCookies:512,FailedToInitializeCorrelationVector:513,FailedToInitializeSDK:514,InvalidContentBlob:515,InvalidCorrelationValue:516,SessionRenewalDateIsZero:517,SendPostOnCompleteFailure:518,PostResponseHandler:519,SDKNotInitialized:520}))),Vi="3.2.2",Bi="1DS-Web-JS-"+Vi,Hi="withCredentials",Ki=((s={})[0]=0,s[2]=6,s[1]=1,s[3]=7,s[4098]=6,s[4097]=1,s[4099]=7,s),qi=null,Wi=!!a(),s=!!nt();function Gi(n){return!(""===n||k(n))}function Ji(n){if(n){var e=n.indexOf("-");if(-1")+"."+wo;function y(n){var e=K();e&&e.QUnit&&console&&console.log("ESPromiseScheduler["+m+"] "+n)}function C(n){e&&e.warnToConsole("ESPromiseScheduler["+m+"] "+n)}wo++,U(No,this,function(n){var g=null,v=0;function p(n,e){for(var t=0;t=o&&!(n=r===i)){for(var u=0;u= searchLen && !(result = value === search)) { var pos = valLen - 1; for (var lp = searchLen - 1; lp >= 0; lp--) { if (value[pos] != search[lp]) { return false; } pos--; } result = true; } return result; } function strStartsWith(value, checkValue) { var result = false; if (value && checkValue && !(result = value === checkValue)) { result = _strStartsWith ? value[cStrStartsWith](checkValue) : _strStartsWithPoly(value, checkValue); } return result; } function _strStartsWithPoly(value, checkValue) { var result = false; var chkLen = checkValue ? checkValue.length : 0; if (value && chkLen && value.length >= chkLen && !(result = value === checkValue)) { for (var lp = 0; lp < chkLen; lp++) { if (value[lp] !== checkValue[lp]) { return false; } } result = true; } return result; } function strContains(value, search) { if (value && search) { return value.indexOf(search) !== -1; } return false; } function isDate(obj) { return !!(obj && _objToString.call(obj) === "[object Date]"); } var isArray = _isArray || _isArrayPoly; function _isArrayPoly(obj) { return !!(obj && _objToString.call(obj) === "[object Array]"); } function isError(obj) { return !!(obj && _objToString.call(obj) === "[object Error]"); } function isString(value) { return typeof value === "string"; } function isNumber(value) { return typeof value === "number"; } function isBoolean(value) { return typeof value === "boolean"; } function isPlainObject(value) { var result = false; if (value && typeof value === "object") { var proto = _objGetPrototypeOf$1 ? _objGetPrototypeOf$1(value) : _getObjProto$1(value); if (!proto) { result = true; } else { if (proto[strConstructor] && ObjHasOwnProperty.call(proto, strConstructor)) { proto = proto[strConstructor]; } result = typeof proto === strShimFunction && _fnToString.call(proto) === _objFunctionString; } } return result; } function toISOString(date) { if (date) { return _dataToISOString ? date[strToISOString]() : _toISOStringPoly(date); } } function _toISOStringPoly(date) { if (date && date.getUTCFullYear) { var pad = function (num) { var r = String(num); if (r.length === 1) { r = "0" + r; } return r; }; return date.getUTCFullYear() + "-" + pad(date.getUTCMonth() + 1) + "-" + pad(date.getUTCDate()) + "T" + pad(date.getUTCHours()) + ":" + pad(date.getUTCMinutes()) + ":" + pad(date.getUTCSeconds()) + "." + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5) + "Z"; } } function arrForEach(arr, callbackfn, thisArg) { var len = arr.length; try { for (var idx = 0; idx < len; idx++) { if (idx in arr) { if (callbackfn.call(thisArg || arr, arr[idx], idx, arr) === -1) { break; } } } } catch (e) { } } function arrIndexOf(arr, searchElement, fromIndex) { if (arr) { if (arr[strIndexOf]) { return arr[strIndexOf](searchElement, fromIndex); } var len = arr.length; var from = fromIndex || 0; try { for (var lp = Math.max(from >= 0 ? from : len - Math.abs(from), 0); lp < len; lp++) { if (lp in arr && arr[lp] === searchElement) { return lp; } } } catch (e) { } } return -1; } function arrMap(arr, callbackfn, thisArg) { var results; if (arr) { if (arr[strMap]) { return arr[strMap](callbackfn, thisArg); } var len = arr.length; var _this = thisArg || arr; results = new Array(len); try { for (var lp = 0; lp < len; lp++) { if (lp in arr) { results[lp] = callbackfn.call(_this, arr[lp], arr); } } } catch (e) { } } return results; } function arrReduce(arr, callbackfn, initialValue) { var value; if (arr) { if (arr[strReduce]) { return arr[strReduce](callbackfn, initialValue); } var len = arr.length; var lp = 0; if (arguments.length >= 3) { value = arguments[2]; } else { while (lp < len && !(lp in arr)) { lp++; } value = arr[lp++]; } while (lp < len) { if (lp in arr) { value = callbackfn(value, arr[lp], lp, arr); } lp++; } } return value; } function strTrim(str) { if (str) { str = (_strTrim && str[cStrTrim]) ? str[cStrTrim]() : (str.replace ? str.replace(/^\s+|\s+$/g, "") : str); } return str; } var _objKeysHasDontEnumBug = !({ toString: null }).propertyIsEnumerable("toString"); var _objKeysDontEnums = [ "toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor" ]; function objKeys(obj) { var objType = typeof obj; if (objType !== strShimFunction && (objType !== strShimObject || obj === null)) { throwTypeError("objKeys called on non-object"); } if (!_objKeysHasDontEnumBug && _objKeys) { return _objKeys(obj); } var result = []; for (var prop in obj) { if (obj && ObjHasOwnProperty.call(obj, prop)) { result.push(prop); } } if (_objKeysHasDontEnumBug) { var dontEnumsLength = _objKeysDontEnums.length; for (var lp = 0; lp < dontEnumsLength; lp++) { if (obj && ObjHasOwnProperty.call(obj, _objKeysDontEnums[lp])) { result.push(_objKeysDontEnums[lp]); } } } return result; } function objDefineAccessors(target, prop, getProp, setProp) { if (_objDefineProperty$1) { try { var descriptor = { enumerable: true, configurable: true }; if (getProp) { descriptor.get = getProp; } if (setProp) { descriptor.set = setProp; } _objDefineProperty$1(target, prop, descriptor); return true; } catch (e) { } } return false; } function _doNothing(value) { return value; } function deepFreeze(obj) { if (_objFreeze) { objForEachKey(obj, function (name, value) { if (isArray(value) || isObject(value)) { _objFreeze(value); } }); } return objFreeze(obj); } var objFreeze = _objFreeze || _doNothing; var objSeal = _objSeal || _doNothing; function dateNow() { var dt = Date; return dt.now ? dt.now() : new dt().getTime(); } function getExceptionName(object) { if (isError(object)) { return object.name; } return strEmpty; } function setValue(target, field, value, valChk, srcChk) { var theValue = value; if (target) { theValue = target[field]; if (theValue !== value && (!srcChk || srcChk(theValue)) && (!valChk || valChk(value))) { theValue = value; target[field] = theValue; } } return theValue; } function getSetValue(target, field, defValue) { var theValue; if (target) { theValue = target[field]; if (!theValue && isNullOrUndefined(theValue)) { theValue = !isUndefined(defValue) ? defValue : {}; target[field] = theValue; } } else { theValue = !isUndefined(defValue) ? defValue : {}; } return theValue; } function isNotTruthy(value) { return !value; } function isTruthy(value) { return !!value; } function throwError(message) { throw new Error(message); } function _createProxyFunction(source, funcName) { var srcFunc = null; var src = null; if (isFunction(source)) { srcFunc = source; } else { src = source; } return function () { var originalArguments = arguments; if (srcFunc) { src = srcFunc(); } if (src) { return src[funcName].apply(src, originalArguments); } }; } function proxyAssign(target, source, chkSet) { if (target && source && isObject(target) && isObject(source)) { var _loop_1 = function (field) { if (isString(field)) { var value = source[field]; if (isFunction(value)) { if (!chkSet || chkSet(field, true, source, target)) { target[field] = _createProxyFunction(source, field); } } else if (!chkSet || chkSet(field, false, source, target)) { if (hasOwnProperty(target, field)) { delete target[field]; } if (!objDefineAccessors(target, field, function () { return source[field]; }, function (theValue) { source[field] = theValue; })) { target[field] = value; } } } }; for (var field in source) { _loop_1(field); } } return target; } function proxyFunctionAs(target, name, source, theFunc, overwriteTarget) { if (target && name && source) { if (overwriteTarget !== false || isUndefined(target[name])) { target[name] = _createProxyFunction(source, theFunc); } } } function proxyFunctions(target, source, functionsToProxy, overwriteTarget) { if (target && source && isObject(target) && isArray(functionsToProxy)) { arrForEach(functionsToProxy, function (theFuncName) { if (isString(theFuncName)) { proxyFunctionAs(target, theFuncName, source, theFuncName, overwriteTarget); } }); } return target; } function optimizeObject(theObject) { if (theObject && ObjAssign) { theObject = ObjClass(ObjAssign({}, theObject)); } return theObject; } function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) { var theArgs = arguments; var extended = theArgs[0] || {}; var argLen = theArgs.length; var deep = false; var idx = 1; if (argLen > 0 && isBoolean(extended)) { deep = extended; extended = theArgs[idx] || {}; idx++; } if (!isObject(extended)) { extended = {}; } for (; idx < argLen; idx++) { var arg = theArgs[idx]; var isArgArray = isArray(arg); var isArgObj = isObject(arg); for (var prop in arg) { var propOk = (isArgArray && (prop in arg)) || (isArgObj && (ObjHasOwnProperty.call(arg, prop))); if (!propOk) { continue; } var newValue = arg[prop]; var isNewArray = void 0; if (deep && newValue && ((isNewArray = isArray(newValue)) || isPlainObject(newValue))) { var clone = extended[prop]; if (isNewArray) { if (!isArray(clone)) { clone = []; } } else if (!isPlainObject(clone)) { clone = {}; } newValue = objExtend(deep, clone, newValue); } if (newValue !== undefined) { extended[prop] = newValue; } } } return extended; } function createEnumStyle(values) { var enumClass = {}; objForEachKey(values, function (field, value) { enumClass[field] = value; enumClass[value] = field; }); return deepFreeze(enumClass); } var EventsDiscardedReason = createEnumStyle({ Unknown: 0 , NonRetryableStatus: 1 , InvalidEvent: 2 , SizeLimitExceeded: 3 , KillSwitch: 4 , QueueFull: 5 }); /*! * Microsoft Dynamic Proto Utility, 1.1.6 * Copyright (c) Microsoft and contributors. All rights reserved. */ var Constructor = 'constructor'; var Prototype = 'prototype'; var strFunction = 'function'; var DynInstFuncTable = '_dynInstFuncs'; var DynProxyTag = '_isDynProxy'; var DynClassName = '_dynClass'; var DynClassNamePrefix = '_dynCls$'; var DynInstChkTag = '_dynInstChk'; var DynAllowInstChkTag = DynInstChkTag; var DynProtoDefaultOptions = '_dfOpts'; var UnknownValue = '_unknown_'; var str__Proto = "__proto__"; var DynProtoBaseProto = "_dyn" + str__Proto; var DynProtoCurrent = "_dynInstProto"; var strUseBaseInst = 'useBaseInst'; var strSetInstFuncs = 'setInstFuncs'; var Obj = Object; var _objGetPrototypeOf = Obj["getPrototypeOf"]; var _objGetOwnProps = Obj["getOwnPropertyNames"]; var _dynamicNames = 0; function _hasOwnProperty(obj, prop) { return obj && Obj[Prototype].hasOwnProperty.call(obj, prop); } function _isObjectOrArrayPrototype(target) { return target && (target === Obj[Prototype] || target === Array[Prototype]); } function _isObjectArrayOrFunctionPrototype(target) { return _isObjectOrArrayPrototype(target) || target === Function[Prototype]; } function _getObjProto(target) { var newProto; if (target) { if (_objGetPrototypeOf) { return _objGetPrototypeOf(target); } var curProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null); newProto = target[DynProtoBaseProto] || curProto; if (!_hasOwnProperty(target, DynProtoBaseProto)) { delete target[DynProtoCurrent]; newProto = target[DynProtoBaseProto] = target[DynProtoCurrent] || target[DynProtoBaseProto]; target[DynProtoCurrent] = curProto; } } return newProto; } function _forEachProp(target, func) { var props = []; if (_objGetOwnProps) { props = _objGetOwnProps(target); } else { for (var name_1 in target) { if (typeof name_1 === "string" && _hasOwnProperty(target, name_1)) { props.push(name_1); } } } if (props && props.length > 0) { for (var lp = 0; lp < props.length; lp++) { func(props[lp]); } } } function _isDynamicCandidate(target, funcName, skipOwn) { return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName))); } function _throwTypeError(message) { throw new TypeError("DynamicProto: " + message); } function _getInstanceFuncs(thisTarget) { var instFuncs = {}; _forEachProp(thisTarget, function (name) { if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) { instFuncs[name] = thisTarget[name]; } }); return instFuncs; } function _hasVisited(values, value) { for (var lp = values.length - 1; lp >= 0; lp--) { if (values[lp] === value) { return true; } } return false; } function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) { function _instFuncProxy(target, funcHost, funcName) { var theFunc = funcHost[funcName]; if (theFunc[DynProxyTag] && useBaseInst) { var instFuncTable = target[DynInstFuncTable] || {}; if (instFuncTable[DynAllowInstChkTag] !== false) { theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc; } } return function () { return theFunc.apply(target, arguments); }; } var baseFuncs = {}; _forEachProp(instFuncs, function (name) { baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name); }); var baseProto = _getObjProto(classProto); var visited = []; while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) { _forEachProp(baseProto, function (name) { if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) { baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name); } }); visited.push(baseProto); baseProto = _getObjProto(baseProto); } return baseFuncs; } function _getInstFunc(target, funcName, proto, currentDynProtoProxy) { var instFunc = null; if (target && _hasOwnProperty(proto, DynClassName)) { var instFuncTable = target[DynInstFuncTable] || {}; instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName]; if (!instFunc) { _throwTypeError("Missing [" + funcName + "] " + strFunction); } if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) { var canAddInst = !_hasOwnProperty(target, funcName); var objProto = _getObjProto(target); var visited = []; while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) { var protoFunc = objProto[funcName]; if (protoFunc) { canAddInst = (protoFunc === currentDynProtoProxy); break; } visited.push(objProto); objProto = _getObjProto(objProto); } try { if (canAddInst) { target[funcName] = instFunc; } instFunc[DynInstChkTag] = 1; } catch (e) { instFuncTable[DynAllowInstChkTag] = false; } } } return instFunc; } function _getProtoFunc(funcName, proto, currentDynProtoProxy) { var protoFunc = proto[funcName]; if (protoFunc === currentDynProtoProxy) { protoFunc = _getObjProto(proto)[funcName]; } if (typeof protoFunc !== strFunction) { _throwTypeError("[" + funcName + "] is not a " + strFunction); } return protoFunc; } function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) { function _createDynamicPrototype(proto, funcName) { var dynProtoProxy = function () { var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy); return instFunc.apply(this, arguments); }; dynProtoProxy[DynProxyTag] = 1; return dynProtoProxy; } if (!_isObjectOrArrayPrototype(proto)) { var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {}; var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {}); if (instFuncTable[DynAllowInstChkTag] !== false) { instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc; } _forEachProp(target, function (name) { if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) { instFuncs_1[name] = target[name]; delete target[name]; if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) { proto[name] = _createDynamicPrototype(proto, name); } } }); } } function _checkPrototype(classProto, thisTarget) { if (_objGetPrototypeOf) { var visited = []; var thisProto = _getObjProto(thisTarget); while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) { if (thisProto === classProto) { return true; } visited.push(thisProto); thisProto = _getObjProto(thisProto); } return false; } return true; } function _getObjName(target, unknownValue) { if (_hasOwnProperty(target, Prototype)) { return target.name || unknownValue || UnknownValue; } return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue; } function dynamicProto(theClass, target, delegateFunc, options) { if (!_hasOwnProperty(theClass, Prototype)) { _throwTypeError("theClass is an invalid class definition."); } var classProto = theClass[Prototype]; if (!_checkPrototype(classProto, target)) { _throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]"); } var className = null; if (_hasOwnProperty(classProto, DynClassName)) { className = classProto[DynClassName]; } else { className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _dynamicNames; _dynamicNames++; classProto[DynClassName] = className; } var perfOptions = dynamicProto[DynProtoDefaultOptions]; var useBaseInst = !!perfOptions[strUseBaseInst]; if (useBaseInst && options && options[strUseBaseInst] !== undefined) { useBaseInst = !!options[strUseBaseInst]; } var instFuncs = _getInstanceFuncs(target); var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst); delegateFunc(target, baseFuncs); var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs]; if (setInstanceFunc && options) { setInstanceFunc = !!options[strSetInstFuncs]; } _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false); } var perfDefaults = { setInstFuncs: true, useBaseInst: true }; dynamicProto[DynProtoDefaultOptions] = perfDefaults; var strWindow = "window"; var strDocument = "document"; var strDocumentMode = "documentMode"; var strNavigator = "navigator"; var strHistory = "history"; var strLocation = "location"; var strConsole = "console"; var strPerformance = "performance"; var strJSON = "JSON"; var strCrypto = "crypto"; var strMsCrypto = "msCrypto"; var strReactNative = "ReactNative"; var strMsie = "msie"; var strTrident = "trident/"; var strXMLHttpRequest = "XMLHttpRequest"; var _isTrident = null; var _navUserAgentCheck = null; var _enableMocks = false; var _useXDomainRequest = null; var _beaconsSupported = null; function _hasProperty(theClass, property) { var supported = false; if (theClass) { try { supported = property in theClass; if (!supported) { var proto = theClass[strShimPrototype]; if (proto) { supported = property in proto; } } } catch (e) { } if (!supported) { try { var tmp = new theClass(); supported = !isUndefined(tmp[property]); } catch (e) { } } } return supported; } function setEnableEnvMocks(enabled) { _enableMocks = enabled; } function getGlobalInst(name) { var gbl = getGlobal(); if (gbl && gbl[name]) { return gbl[name]; } if (name === strWindow && hasWindow()) { return window; } return null; } function hasWindow() { return Boolean(typeof window === strShimObject && window); } function getWindow() { if (hasWindow()) { return window; } return getGlobalInst(strWindow); } function hasDocument() { return Boolean(typeof document === strShimObject && document); } function getDocument() { if (hasDocument()) { return document; } return getGlobalInst(strDocument); } function hasNavigator() { return Boolean(typeof navigator === strShimObject && navigator); } function getNavigator() { if (hasNavigator()) { return navigator; } return getGlobalInst(strNavigator); } function hasHistory() { return Boolean(typeof history === strShimObject && history); } function getHistory() { if (hasHistory()) { return history; } return getGlobalInst(strHistory); } function getLocation(checkForMock) { if (checkForMock && _enableMocks) { var mockLocation = getGlobalInst("__mockLocation"); if (mockLocation) { return mockLocation; } } if (typeof location === strShimObject && location) { return location; } return getGlobalInst(strLocation); } function getConsole() { if (typeof console !== strShimUndefined) { return console; } return getGlobalInst(strConsole); } function getPerformance() { return getGlobalInst(strPerformance); } function hasJSON() { return Boolean((typeof JSON === strShimObject && JSON) || getGlobalInst(strJSON) !== null); } function getJSON() { if (hasJSON()) { return JSON || getGlobalInst(strJSON); } return null; } function getCrypto() { return getGlobalInst(strCrypto); } function getMsCrypto() { return getGlobalInst(strMsCrypto); } function isReactNative() { var nav = getNavigator(); if (nav && nav.product) { return nav.product === strReactNative; } return false; } function isIE() { var nav = getNavigator(); if (nav && (nav.userAgent !== _navUserAgentCheck || _isTrident === null)) { _navUserAgentCheck = nav.userAgent; var userAgent = (_navUserAgentCheck || strEmpty).toLowerCase(); _isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident)); } return _isTrident; } function getIEVersion(userAgentStr) { if (userAgentStr === void 0) { userAgentStr = null; } if (!userAgentStr) { var navigator_1 = getNavigator() || {}; userAgentStr = navigator_1 ? (navigator_1.userAgent || strEmpty).toLowerCase() : strEmpty; } var ua = (userAgentStr || strEmpty).toLowerCase(); if (strContains(ua, strMsie)) { var doc = getDocument() || {}; return Math.max(parseInt(ua.split(strMsie)[1]), (doc[strDocumentMode] || 0)); } else if (strContains(ua, strTrident)) { var tridentVer = parseInt(ua.split(strTrident)[1]); if (tridentVer) { return tridentVer + 4; } } return null; } function dumpObj(object) { var objectTypeDump = Object[strShimPrototype].toString.call(object); var propertyValueDump = strEmpty; if (objectTypeDump === "[object Error]") { propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'"; } else if (hasJSON()) { propertyValueDump = getJSON().stringify(object); } return objectTypeDump + propertyValueDump; } function isBeaconsSupported() { if (_beaconsSupported === null) { _beaconsSupported = hasNavigator() && Boolean(getNavigator().sendBeacon); } return _beaconsSupported; } function isFetchSupported(withKeepAlive) { var isSupported = false; try { isSupported = !!getGlobalInst("fetch"); var request = getGlobalInst("Request"); if (isSupported && withKeepAlive && request) { isSupported = _hasProperty(request, "keepalive"); } } catch (e) { } return isSupported; } function useXDomainRequest() { if (_useXDomainRequest === null) { _useXDomainRequest = (typeof XDomainRequest !== strShimUndefined); if (_useXDomainRequest && isXhrSupported()) { _useXDomainRequest = _useXDomainRequest && !_hasProperty(getGlobalInst(strXMLHttpRequest), "withCredentials"); } } return _useXDomainRequest; } function isXhrSupported() { var isSupported = false; try { var xmlHttpRequest = getGlobalInst(strXMLHttpRequest); isSupported = !!xmlHttpRequest; } catch (e) { } return isSupported; } var listenerFuncs = ["eventsSent", "eventsDiscarded", "eventsSendRequest", "perfEvent"]; var _aiNamespace = null; var _debugListener; function _listenerProxyFunc(name, config) { return function () { var args = arguments; var dbgExt = getDebugExt(config); if (dbgExt) { var listener = dbgExt.listener; if (listener && listener[name]) { listener[name].apply(listener, args); } } }; } function _getExtensionNamespace() { var target = getGlobalInst("Microsoft"); if (target) { _aiNamespace = target["ApplicationInsights"]; } return _aiNamespace; } function getDebugExt(config) { var ns = _aiNamespace; if (!ns && config.disableDbgExt !== true) { ns = _aiNamespace || _getExtensionNamespace(); } return ns ? ns["ChromeDbgExt"] : null; } function getDebugListener(config) { if (!_debugListener) { _debugListener = {}; for (var lp = 0; lp < listenerFuncs.length; lp++) { _debugListener[listenerFuncs[lp]] = _listenerProxyFunc(listenerFuncs[lp], config); } } return _debugListener; } var AiNonUserActionablePrefix = "AI (Internal): "; var AiUserActionablePrefix = "AI: "; var AIInternalMessagePrefix = "AITR_"; var strErrorToConsole = "errorToConsole"; var strWarnToConsole = "warnToConsole"; function _sanitizeDiagnosticText(text) { if (text) { return "\"" + text.replace(/\"/g, strEmpty) + "\""; } return strEmpty; } function _logToConsole(func, message) { var theConsole = getConsole(); if (!!theConsole) { var logFunc = "log"; if (theConsole[func]) { logFunc = func; } if (isFunction(theConsole[logFunc])) { theConsole[logFunc](message); } } } var _InternalLogMessage = /** @class */ (function () { function _InternalLogMessage(msgId, msg, isUserAct, properties) { if (isUserAct === void 0) { isUserAct = false; } var _self = this; _self.messageId = msgId; _self.message = (isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) + msgId; var strProps = strEmpty; if (hasJSON()) { strProps = getJSON().stringify(properties); } var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : strEmpty) + (properties ? " props:" + _sanitizeDiagnosticText(strProps) : strEmpty); _self.message += diagnosticText; } _InternalLogMessage.dataType = "MessageData"; return _InternalLogMessage; }()); function safeGetLogger(core, config) { return (core || {}).logger || new DiagnosticLogger(config); } var DiagnosticLogger = /** @class */ (function () { function DiagnosticLogger(config) { this.identifier = "DiagnosticLogger"; this.queue = []; var _messageCount = 0; var _messageLogged = {}; dynamicProto(DiagnosticLogger, this, function (_self) { if (isNullOrUndefined(config)) { config = {}; } _self.consoleLoggingLevel = function () { return _getConfigValue("loggingLevelConsole", 0); }; _self.telemetryLoggingLevel = function () { return _getConfigValue("loggingLevelTelemetry", 1); }; _self.maxInternalMessageLimit = function () { return _getConfigValue("maxMessageLimit", 25); }; _self.enableDebugExceptions = function () { return _getConfigValue("enableDebugExceptions", false); }; _self.throwInternal = function (severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } var message = new _InternalLogMessage(msgId, msg, isUserAct, properties); if (_self.enableDebugExceptions()) { throw dumpObj(message); } else { var logFunc = severity === 1 ? strErrorToConsole : strWarnToConsole; if (!isUndefined(message.message)) { var logLevel = _self.consoleLoggingLevel(); if (isUserAct) { var messageKey = +message.messageId; if (!_messageLogged[messageKey] && logLevel >= severity) { _self[logFunc](message.message); _messageLogged[messageKey] = true; } } else { if (logLevel >= severity) { _self[logFunc](message.message); } } _self.logInternalMessage(severity, message); } else { _debugExtMsg("throw" + (severity === 1 ? "Critical" : "Warning"), message); } } }; _self.warnToConsole = function (message) { _logToConsole("warn", message); _debugExtMsg("warning", message); }; _self.errorToConsole = function (message) { _logToConsole("error", message); _debugExtMsg("error", message); }; _self.resetInternalMessageCount = function () { _messageCount = 0; _messageLogged = {}; }; _self.logInternalMessage = function (severity, message) { if (_areInternalMessagesThrottled()) { return; } var logMessage = true; var messageKey = AIInternalMessagePrefix + message.messageId; if (_messageLogged[messageKey]) { logMessage = false; } else { _messageLogged[messageKey] = true; } if (logMessage) { if (severity <= _self.telemetryLoggingLevel()) { _self.queue.push(message); _messageCount++; _debugExtMsg((severity === 1 ? "error" : "warn"), message); } if (_messageCount === _self.maxInternalMessageLimit()) { var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app."; var throttleMessage = new _InternalLogMessage(23 , throttleLimitMessage, false); _self.queue.push(throttleMessage); if (severity === 1 ) { _self.errorToConsole(throttleLimitMessage); } else { _self.warnToConsole(throttleLimitMessage); } } } }; function _getConfigValue(name, defValue) { var value = config[name]; if (!isNullOrUndefined(value)) { return value; } return defValue; } function _areInternalMessagesThrottled() { return _messageCount >= _self.maxInternalMessageLimit(); } function _debugExtMsg(name, data) { var dbgExt = getDebugExt(config); if (dbgExt && dbgExt.diagLog) { dbgExt.diagLog(name, data); } } }); } return DiagnosticLogger; }()); function _getLogger(logger) { return (logger || new DiagnosticLogger()); } function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } (logger || new DiagnosticLogger()).throwInternal(severity, msgId, msg, properties, isUserAct); } function _warnToConsole(logger, message) { _getLogger(logger).warnToConsole(message); } var strExecutionContextKey = "ctx"; var _defaultPerfManager = null; var PerfEvent = /** @class */ (function () { function PerfEvent(name, payloadDetails, isAsync) { var _self = this; var accessorDefined = false; _self.start = dateNow(); _self.name = name; _self.isAsync = isAsync; _self.isChildEvt = function () { return false; }; if (isFunction(payloadDetails)) { var theDetails_1; accessorDefined = objDefineAccessors(_self, "payload", function () { if (!theDetails_1 && isFunction(payloadDetails)) { theDetails_1 = payloadDetails(); payloadDetails = null; } return theDetails_1; }); } _self.getCtx = function (key) { if (key) { if (key === PerfEvent.ParentContextKey || key === PerfEvent.ChildrenContextKey) { return _self[key]; } return (_self[strExecutionContextKey] || {})[key]; } return null; }; _self.setCtx = function (key, value) { if (key) { if (key === PerfEvent.ParentContextKey) { if (!_self[key]) { _self.isChildEvt = function () { return true; }; } _self[key] = value; } else if (key === PerfEvent.ChildrenContextKey) { _self[key] = value; } else { var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {}; ctx[key] = value; } } }; _self.complete = function () { var childTime = 0; var childEvts = _self.getCtx(PerfEvent.ChildrenContextKey); if (isArray(childEvts)) { for (var lp = 0; lp < childEvts.length; lp++) { var childEvt = childEvts[lp]; if (childEvt) { childTime += childEvt.time; } } } _self.time = dateNow() - _self.start; _self.exTime = _self.time - childTime; _self.complete = function () { }; if (!accessorDefined && isFunction(payloadDetails)) { _self.payload = payloadDetails(); } }; } PerfEvent.ParentContextKey = "parent"; PerfEvent.ChildrenContextKey = "childEvts"; return PerfEvent; }()); var PerfManager = /** @class */ (function () { function PerfManager(manager) { this.ctx = {}; dynamicProto(PerfManager, this, function (_self) { _self.create = function (src, payloadDetails, isAsync) { return new PerfEvent(src, payloadDetails, isAsync); }; _self.fire = function (perfEvent) { if (perfEvent) { perfEvent.complete(); if (manager && isFunction(manager.perfEvent)) { manager.perfEvent(perfEvent); } } }; _self.setCtx = function (key, value) { if (key) { var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {}; ctx[key] = value; } }; _self.getCtx = function (key) { return (_self[strExecutionContextKey] || {})[key]; }; }); } return PerfManager; }()); var doPerfActiveKey = "CoreUtils.doPerf"; function doPerf(mgrSource, getSource, func, details, isAsync) { if (mgrSource) { var perfMgr = mgrSource; if (isFunction(perfMgr["getPerfMgr"])) { perfMgr = perfMgr["getPerfMgr"](); } if (perfMgr) { var perfEvt = void 0; var currentActive = perfMgr.getCtx(doPerfActiveKey); try { perfEvt = perfMgr.create(getSource(), details, isAsync); if (perfEvt) { if (currentActive && perfEvt.setCtx) { perfEvt.setCtx(PerfEvent.ParentContextKey, currentActive); if (currentActive.getCtx && currentActive.setCtx) { var children = currentActive.getCtx(PerfEvent.ChildrenContextKey); if (!children) { children = []; currentActive.setCtx(PerfEvent.ChildrenContextKey, children); } children.push(perfEvt); } } perfMgr.setCtx(doPerfActiveKey, perfEvt); return func(perfEvt); } } catch (ex) { if (perfEvt && perfEvt.setCtx) { perfEvt.setCtx("exception", ex); } } finally { if (perfEvt) { perfMgr.fire(perfEvt); } perfMgr.setCtx(doPerfActiveKey, currentActive); } } } return func(); } function getGblPerfMgr() { return _defaultPerfManager; } var UInt32Mask = 0x100000000; var MaxUInt32 = 0xffffffff; var _mwcSeeded = false; var _mwcW = 123456789; var _mwcZ = 987654321; function _mwcSeed(seedValue) { if (seedValue < 0) { seedValue >>>= 0; } _mwcW = (123456789 + seedValue) & MaxUInt32; _mwcZ = (987654321 - seedValue) & MaxUInt32; _mwcSeeded = true; } function _autoSeedMwc() { try { var now = dateNow() & 0x7fffffff; _mwcSeed(((Math.random() * UInt32Mask) ^ now) + now); } catch (e) { } } function randomValue(maxValue) { if (maxValue > 0) { return Math.floor((random32() / MaxUInt32) * (maxValue + 1)) >>> 0; } return 0; } function random32(signed) { var value = 0; var c = getCrypto() || getMsCrypto(); if (c && c.getRandomValues) { value = c.getRandomValues(new Uint32Array(1))[0] & MaxUInt32; } if (value === 0 && isIE()) { if (!_mwcSeeded) { _autoSeedMwc(); } value = mwcRandom32() & MaxUInt32; } if (value === 0) { value = Math.floor((UInt32Mask * Math.random()) | 0); } if (!signed) { value >>>= 0; } return value; } function mwcRandomSeed(value) { if (!value) { _autoSeedMwc(); } else { _mwcSeed(value); } } function mwcRandom32(signed) { _mwcZ = (36969 * (_mwcZ & 0xFFFF) + (_mwcZ >> 16)) & MaxUInt32; _mwcW = (18000 * (_mwcW & 0xFFFF) + (_mwcW >> 16)) & MaxUInt32; var value = (((_mwcZ << 16) + (_mwcW & 0xFFFF)) >>> 0) & MaxUInt32 | 0; if (!signed) { value >>>= 0; } return value; } function newId(maxLength) { if (maxLength === void 0) { maxLength = 22; } var base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; var number = random32() >>> 0; var chars = 0; var result = strEmpty; while (result.length < maxLength) { chars++; result += base64chars.charAt(number & 0x3F); number >>>= 6; if (chars === 5) { number = (((random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0; chars = 0; } } return result; } var _objDefineProperty = ObjDefineProperty; var version = "2.8.3"; var instanceName = "." + newId(6); var _dataUid = 0; function _createAccessor(target, prop, value) { if (_objDefineProperty) { try { _objDefineProperty(target, prop, { value: value, enumerable: false, configurable: true }); return true; } catch (e) { } } return false; } function _canAcceptData(target) { return target.nodeType === 1 || target.nodeType === 9 || !(+target.nodeType); } function _getCache(data, target) { var theCache = target[data.id]; if (!theCache) { theCache = {}; try { if (_canAcceptData(target)) { if (!_createAccessor(target, data.id, theCache)) { target[data.id] = theCache; } } } catch (e) { } } return theCache; } function createUniqueNamespace(name, includeVersion) { if (includeVersion === void 0) { includeVersion = false; } return normalizeJsName(name + (_dataUid++) + (includeVersion ? "." + version : "") + instanceName); } function createElmNodeData(name) { var data = { id: createUniqueNamespace("_aiData-" + (name || "") + "." + version), accept: function (target) { return _canAcceptData(target); }, get: function (target, name, defValue, addDefault) { var theCache = target[data.id]; if (!theCache) { if (addDefault) { theCache = _getCache(data, target); theCache[normalizeJsName(name)] = defValue; } return defValue; } return theCache[normalizeJsName(name)]; }, kill: function (target, name) { if (target && target[name]) { try { delete target[name]; } catch (e) { } } } }; return data; } var pluginStateData = createElmNodeData("plugin"); function _getPluginState(plugin) { return pluginStateData.get(plugin, "state", {}, true); } function initializePlugins(processContext, extensions) { var initPlugins = []; var lastPlugin = null; var proxy = processContext.getNext(); var pluginState; while (proxy) { var thePlugin = proxy.getPlugin(); if (thePlugin) { if (lastPlugin && isFunction(lastPlugin[strSetNextPlugin]) && isFunction(thePlugin[strProcessTelemetry])) { lastPlugin[strSetNextPlugin](thePlugin); } var isInitialized = false; if (isFunction(thePlugin[strIsInitialized])) { isInitialized = thePlugin[strIsInitialized](); } else { pluginState = _getPluginState(thePlugin); isInitialized = pluginState[strIsInitialized]; } if (!isInitialized) { initPlugins.push(thePlugin); } lastPlugin = thePlugin; proxy = proxy.getNext(); } } arrForEach(initPlugins, function (thePlugin) { var core = processContext.core(); thePlugin.initialize(processContext.getCfg(), core, extensions, processContext.getNext()); pluginState = _getPluginState(thePlugin); if (!thePlugin[strCore] && !pluginState[strCore]) { pluginState[strCore] = core; } pluginState[strIsInitialized] = true; delete pluginState[strTeardown]; }); } function sortPlugins(plugins) { return plugins.sort(function (extA, extB) { var result = 0; var bHasProcess = isFunction(extB[strProcessTelemetry]); if (isFunction(extA[strProcessTelemetry])) { result = bHasProcess ? extA[strPriority] - extB[strPriority] : 1; } else if (bHasProcess) { result = -1; } return result; }); } var strTelemetryPluginChain = "TelemetryPluginChain"; var strHasRunFlags = "_hasRun"; var strGetTelCtx = "_getTelCtx"; var _chainId = 0; function _getNextProxyStart(proxy, core, startAt) { while (proxy) { if (proxy.getPlugin() === startAt) { return proxy; } proxy = proxy.getNext(); } return createTelemetryProxyChain([startAt], core.config || {}, core); } function _createInternalContext(telemetryChain, config, core, startAt) { var _nextProxy = null; var _onComplete = []; if (startAt !== null) { _nextProxy = startAt ? _getNextProxyStart(telemetryChain, core, startAt) : telemetryChain; } var context = { _next: _moveNext, ctx: { core: function () { return core; }, diagLog: function () { return safeGetLogger(core, config); }, getCfg: function () { return config; }, getExtCfg: _getExtCfg, getConfig: _getConfig, hasNext: function () { return !!_nextProxy; }, getNext: function () { return _nextProxy; }, setNext: function (nextPlugin) { _nextProxy = nextPlugin; }, iterate: _iterateChain, onComplete: _addOnComplete } }; function _addOnComplete(onComplete, that) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } if (onComplete) { _onComplete.push({ func: onComplete, self: !isUndefined(that) ? that : context.ctx, args: args }); } } function _moveNext() { var nextProxy = _nextProxy; _nextProxy = nextProxy ? nextProxy.getNext() : null; if (!nextProxy) { var onComplete = _onComplete; if (onComplete && onComplete.length > 0) { arrForEach(onComplete, function (completeDetails) { try { completeDetails.func.call(completeDetails.self, completeDetails.args); } catch (e) { _throwInternal(core.logger, 2 , 73 , "Unexpected Exception during onComplete - " + dumpObj(e)); } }); _onComplete = []; } } return nextProxy; } function _getExtCfg(identifier, defaultValue, mergeDefault) { if (defaultValue === void 0) { defaultValue = {}; } if (mergeDefault === void 0) { mergeDefault = 0 ; } var theConfig; if (config) { var extConfig = config.extensionConfig; if (extConfig && identifier) { theConfig = extConfig[identifier]; } } if (!theConfig) { theConfig = defaultValue; } else if (isObject(defaultValue)) { if (mergeDefault !== 0 ) { var newConfig_1 = objExtend(true, defaultValue, theConfig); if (config && mergeDefault === 2 ) { objForEachKey(defaultValue, function (field) { if (isNullOrUndefined(newConfig_1[field])) { var cfgValue = config[field]; if (!isNullOrUndefined(cfgValue)) { newConfig_1[field] = cfgValue; } } }); } theConfig = newConfig_1; } } return theConfig; } function _getConfig(identifier, field, defaultValue) { if (defaultValue === void 0) { defaultValue = false; } var theValue; var extConfig = _getExtCfg(identifier, null); if (extConfig && !isNullOrUndefined(extConfig[field])) { theValue = extConfig[field]; } else if (config && !isNullOrUndefined(config[field])) { theValue = config[field]; } return !isNullOrUndefined(theValue) ? theValue : defaultValue; } function _iterateChain(cb) { var nextPlugin; while (!!(nextPlugin = context._next())) { var plugin = nextPlugin.getPlugin(); if (plugin) { cb(plugin); } } } return context; } function createProcessTelemetryContext(telemetryChain, config, core, startAt) { var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(env) { var nextPlugin = internalContext._next(); nextPlugin && nextPlugin.processTelemetry(env, context); return !nextPlugin; } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryContext(plugins || context.getNext(), config, core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } function createProcessTelemetryUnloadContext(telemetryChain, core, startAt) { var config = core.config || {}; var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(unloadState) { var nextPlugin = internalContext._next(); nextPlugin && nextPlugin.unload(context, unloadState); return !nextPlugin; } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryUnloadContext(plugins || context.getNext(), core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } function createProcessTelemetryUpdateContext(telemetryChain, core, startAt) { var config = core.config || {}; var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(updateState) { return context.iterate(function (plugin) { if (isFunction(plugin.update)) { plugin.update(context, updateState); } }); } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryUpdateContext(plugins || context.getNext(), core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } function createTelemetryProxyChain(plugins, config, core, startAt) { var firstProxy = null; var add = startAt ? false : true; if (isArray(plugins) && plugins.length > 0) { var lastProxy_1 = null; arrForEach(plugins, function (thePlugin) { if (!add && startAt === thePlugin) { add = true; } if (add && thePlugin && isFunction(thePlugin.processTelemetry)) { var newProxy = createTelemetryPluginProxy(thePlugin, config, core); if (!firstProxy) { firstProxy = newProxy; } if (lastProxy_1) { lastProxy_1._setNext(newProxy); } lastProxy_1 = newProxy; } }); } if (startAt && !firstProxy) { return createTelemetryProxyChain([startAt], config, core); } return firstProxy; } function createTelemetryPluginProxy(plugin, config, core) { var nextProxy = null; var hasProcessTelemetry = isFunction(plugin.processTelemetry); var hasSetNext = isFunction(plugin.setNextPlugin); var chainId; if (plugin) { chainId = plugin.identifier + "-" + plugin.priority + "-" + _chainId++; } else { chainId = "Unknown-0-" + _chainId++; } var proxyChain = { getPlugin: function () { return plugin; }, getNext: function () { return nextProxy; }, processTelemetry: _processTelemetry, unload: _unloadPlugin, update: _updatePlugin, _id: chainId, _setNext: function (nextPlugin) { nextProxy = nextPlugin; } }; function _getTelCtx() { var itemCtx; if (plugin && isFunction(plugin[strGetTelCtx])) { itemCtx = plugin[strGetTelCtx](); } if (!itemCtx) { itemCtx = createProcessTelemetryContext(proxyChain, config, core); } return itemCtx; } function _processChain(itemCtx, processPluginFn, name, details, isAsync) { var hasRun = false; var identifier = plugin ? plugin.identifier : strTelemetryPluginChain; var hasRunContext = itemCtx[strHasRunFlags]; if (!hasRunContext) { hasRunContext = itemCtx[strHasRunFlags] = {}; } itemCtx.setNext(nextProxy); if (plugin) { doPerf(itemCtx[strCore](), function () { return identifier + ":" + name; }, function () { hasRunContext[chainId] = true; try { var nextId = nextProxy ? nextProxy._id : strEmpty; if (nextId) { hasRunContext[nextId] = false; } hasRun = processPluginFn(itemCtx); } catch (error) { var hasNextRun = nextProxy ? hasRunContext[nextProxy._id] : true; if (hasNextRun) { hasRun = true; } if (!nextProxy || !hasNextRun) { _throwInternal(itemCtx.diagLog(), 1 , 73 , "Plugin [" + identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext)); } } }, details, isAsync); } return hasRun; } function _processTelemetry(env, itemCtx) { itemCtx = itemCtx || _getTelCtx(); function _callProcessTelemetry(itemCtx) { if (!plugin || !hasProcessTelemetry) { return false; } var pluginState = _getPluginState(plugin); if (pluginState.teardown || pluginState[strDisabled]) { return false; } if (hasSetNext) { plugin.setNextPlugin(nextProxy); } plugin.processTelemetry(env, itemCtx); return true; } if (!_processChain(itemCtx, _callProcessTelemetry, "processTelemetry", function () { return ({ item: env }); }, !(env.sync))) { itemCtx.processNext(env); } } function _unloadPlugin(unloadCtx, unloadState) { function _callTeardown() { var hasRun = false; if (plugin) { var pluginState = _getPluginState(plugin); var pluginCore = plugin[strCore] || pluginState.core; if (plugin && (!pluginCore || pluginCore === unloadCtx[strCore]()) && !pluginState[strTeardown]) { pluginState[strCore] = null; pluginState[strTeardown] = true; pluginState[strIsInitialized] = false; if (plugin[strTeardown] && plugin[strTeardown](unloadCtx, unloadState) === true) { hasRun = true; } } } return hasRun; } if (!_processChain(unloadCtx, _callTeardown, "unload", function () { }, unloadState.isAsync)) { unloadCtx.processNext(unloadState); } } function _updatePlugin(updateCtx, updateState) { function _callUpdate() { var hasRun = false; if (plugin) { var pluginState = _getPluginState(plugin); var pluginCore = plugin[strCore] || pluginState.core; if (plugin && (!pluginCore || pluginCore === updateCtx[strCore]()) && !pluginState[strTeardown]) { if (plugin[strUpdate] && plugin[strUpdate](updateCtx, updateState) === true) { hasRun = true; } } } return hasRun; } if (!_processChain(updateCtx, _callUpdate, "update", function () { }, false)) { updateCtx.processNext(updateState); } } return objFreeze(proxyChain); } var ProcessTelemetryContext = /** @class */ (function () { function ProcessTelemetryContext(pluginChain, config, core, startAt) { var _self = this; var context = createProcessTelemetryContext(pluginChain, config, core, startAt); proxyFunctions(_self, context, objKeys(context)); } return ProcessTelemetryContext; }()); var strToGMTString = "toGMTString"; var strToUTCString = "toUTCString"; var strCookie = "cookie"; var strExpires = "expires"; var strEnabled = "enabled"; var strIsCookieUseDisabled = "isCookieUseDisabled"; var strDisableCookiesUsage = "disableCookiesUsage"; var strConfigCookieMgr = "_ckMgr"; var _supportsCookies = null; var _allowUaSameSite = null; var _parsedCookieValue = null; var _doc = getDocument(); var _cookieCache = {}; var _globalCookieConfig = {}; function _gblCookieMgr(config, logger) { var inst = createCookieMgr[strConfigCookieMgr] || _globalCookieConfig[strConfigCookieMgr]; if (!inst) { inst = createCookieMgr[strConfigCookieMgr] = createCookieMgr(config, logger); _globalCookieConfig[strConfigCookieMgr] = inst; } return inst; } function _isMgrEnabled(cookieMgr) { if (cookieMgr) { return cookieMgr.isEnabled(); } return true; } function _createCookieMgrConfig(rootConfig) { var cookieMgrCfg = rootConfig.cookieCfg = rootConfig.cookieCfg || {}; setValue(cookieMgrCfg, "domain", rootConfig.cookieDomain, isNotNullOrUndefined, isNullOrUndefined); setValue(cookieMgrCfg, "path", rootConfig.cookiePath || "/", null, isNullOrUndefined); if (isNullOrUndefined(cookieMgrCfg[strEnabled])) { var cookieEnabled = void 0; if (!isUndefined(rootConfig[strIsCookieUseDisabled])) { cookieEnabled = !rootConfig[strIsCookieUseDisabled]; } if (!isUndefined(rootConfig[strDisableCookiesUsage])) { cookieEnabled = !rootConfig[strDisableCookiesUsage]; } cookieMgrCfg[strEnabled] = cookieEnabled; } return cookieMgrCfg; } function safeGetCookieMgr(core, config) { var cookieMgr; if (core) { cookieMgr = core.getCookieMgr(); } else if (config) { var cookieCfg = config.cookieCfg; if (cookieCfg[strConfigCookieMgr]) { cookieMgr = cookieCfg[strConfigCookieMgr]; } else { cookieMgr = createCookieMgr(config); } } if (!cookieMgr) { cookieMgr = _gblCookieMgr(config, (core || {}).logger); } return cookieMgr; } function createCookieMgr(rootConfig, logger) { var cookieMgrConfig = _createCookieMgrConfig(rootConfig || _globalCookieConfig); var _path = cookieMgrConfig.path || "/"; var _domain = cookieMgrConfig.domain; var _enabled = cookieMgrConfig[strEnabled] !== false; var cookieMgr = { isEnabled: function () { var enabled = _enabled && areCookiesSupported(logger); var gblManager = _globalCookieConfig[strConfigCookieMgr]; if (enabled && gblManager && cookieMgr !== gblManager) { enabled = _isMgrEnabled(gblManager); } return enabled; }, setEnabled: function (value) { _enabled = value !== false; }, set: function (name, value, maxAgeSec, domain, path) { var result = false; if (_isMgrEnabled(cookieMgr)) { var values = {}; var theValue = strTrim(value || strEmpty); var idx = theValue.indexOf(";"); if (idx !== -1) { theValue = strTrim(value.substring(0, idx)); values = _extractParts(value.substring(idx + 1)); } setValue(values, "domain", domain || _domain, isTruthy, isUndefined); if (!isNullOrUndefined(maxAgeSec)) { var _isIE = isIE(); if (isUndefined(values[strExpires])) { var nowMs = dateNow(); var expireMs = nowMs + (maxAgeSec * 1000); if (expireMs > 0) { var expiry = new Date(); expiry.setTime(expireMs); setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || strEmpty, isTruthy); } } if (!_isIE) { setValue(values, "max-age", strEmpty + maxAgeSec, null, isUndefined); } } var location_1 = getLocation(); if (location_1 && location_1.protocol === "https:") { setValue(values, "secure", null, null, isUndefined); if (_allowUaSameSite === null) { _allowUaSameSite = !uaDisallowsSameSiteNone((getNavigator() || {}).userAgent); } if (_allowUaSameSite) { setValue(values, "SameSite", "None", null, isUndefined); } } setValue(values, "path", path || _path, null, isUndefined); var setCookieFn = cookieMgrConfig.setCookie || _setCookieValue; setCookieFn(name, _formatCookieValue(theValue, values)); result = true; } return result; }, get: function (name) { var value = strEmpty; if (_isMgrEnabled(cookieMgr)) { value = (cookieMgrConfig.getCookie || _getCookieValue)(name); } return value; }, del: function (name, path) { var result = false; if (_isMgrEnabled(cookieMgr)) { result = cookieMgr.purge(name, path); } return result; }, purge: function (name, path) { var _a; var result = false; if (areCookiesSupported(logger)) { var values = (_a = {}, _a["path"] = path ? path : "/", _a[strExpires] = "Thu, 01 Jan 1970 00:00:01 GMT", _a); if (!isIE()) { values["max-age"] = "0"; } var delCookie = cookieMgrConfig.delCookie || _setCookieValue; delCookie(name, _formatCookieValue(strEmpty, values)); result = true; } return result; } }; cookieMgr[strConfigCookieMgr] = cookieMgr; return cookieMgr; } function areCookiesSupported(logger) { if (_supportsCookies === null) { _supportsCookies = false; try { var doc = _doc || {}; _supportsCookies = doc[strCookie] !== undefined; } catch (e) { _throwInternal(logger, 2 , 68 , "Cannot access document.cookie - " + getExceptionName(e), { exception: dumpObj(e) }); } } return _supportsCookies; } function _extractParts(theValue) { var values = {}; if (theValue && theValue.length) { var parts = strTrim(theValue).split(";"); arrForEach(parts, function (thePart) { thePart = strTrim(thePart || strEmpty); if (thePart) { var idx = thePart.indexOf("="); if (idx === -1) { values[thePart] = null; } else { values[strTrim(thePart.substring(0, idx))] = strTrim(thePart.substring(idx + 1)); } } }); } return values; } function _formatDate(theDate, func) { if (isFunction(theDate[func])) { return theDate[func](); } return null; } function _formatCookieValue(value, values) { var cookieValue = value || strEmpty; objForEachKey(values, function (name, theValue) { cookieValue += "; " + name + (!isNullOrUndefined(theValue) ? "=" + theValue : strEmpty); }); return cookieValue; } function _getCookieValue(name) { var cookieValue = strEmpty; if (_doc) { var theCookie = _doc[strCookie] || strEmpty; if (_parsedCookieValue !== theCookie) { _cookieCache = _extractParts(theCookie); _parsedCookieValue = theCookie; } cookieValue = strTrim(_cookieCache[name] || strEmpty); } return cookieValue; } function _setCookieValue(name, cookieValue) { if (_doc) { _doc[strCookie] = name + "=" + cookieValue; } } function uaDisallowsSameSiteNone(userAgent) { if (!isString(userAgent)) { return false; } if (strContains(userAgent, "CPU iPhone OS 12") || strContains(userAgent, "iPad; CPU OS 12")) { return true; } if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strContains(userAgent, "Version/") && strContains(userAgent, "Safari")) { return true; } if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strEndsWith(userAgent, "AppleWebKit/605.1.15 (KHTML, like Gecko)")) { return true; } if (strContains(userAgent, "Chrome/5") || strContains(userAgent, "Chrome/6")) { return true; } if (strContains(userAgent, "UnrealEngine") && !strContains(userAgent, "Chrome")) { return true; } if (strContains(userAgent, "UCBrowser/12") || strContains(userAgent, "UCBrowser/11")) { return true; } return false; } var strIKey = "iKey"; var strExtensionConfig = "extensionConfig"; var ChannelControllerPriority = 500; var ChannelValidationMessage = "Channel has invalid priority - "; function _addChannelQueue(channelQueue, queue, config, core) { if (queue && isArray(queue) && queue.length > 0) { queue = queue.sort(function (a, b) { return a.priority - b.priority; }); arrForEach(queue, function (queueItem) { if (queueItem.priority < ChannelControllerPriority) { throwError(ChannelValidationMessage + queueItem.identifier); } }); channelQueue.push({ queue: objFreeze(queue), chain: createTelemetryProxyChain(queue, config, core) }); } } function createChannelControllerPlugin(channelQueue, core) { var _a; function _getTelCtx() { return createProcessTelemetryContext(null, core.config, core, null); } function _processChannelQueue(theChannels, itemCtx, processFn, onComplete) { var waiting = theChannels ? (theChannels.length + 1) : 1; function _runChainOnComplete() { waiting--; if (waiting === 0) { onComplete && onComplete(); onComplete = null; } } if (waiting > 0) { arrForEach(theChannels, function (channels) { if (channels && channels.queue.length > 0) { var channelChain = channels.chain; var chainCtx = itemCtx.createNew(channelChain); chainCtx.onComplete(_runChainOnComplete); processFn(chainCtx); } else { waiting--; } }); } _runChainOnComplete(); } function _doUpdate(updateCtx, updateState) { var theUpdateState = updateState || { reason: 0 }; _processChannelQueue(channelQueue, updateCtx, function (chainCtx) { chainCtx[strProcessNext](theUpdateState); }, function () { updateCtx[strProcessNext](theUpdateState); }); return true; } function _doTeardown(unloadCtx, unloadState) { var theUnloadState = unloadState || { reason: 0 , isAsync: false }; _processChannelQueue(channelQueue, unloadCtx, function (chainCtx) { chainCtx[strProcessNext](theUnloadState); }, function () { unloadCtx[strProcessNext](theUnloadState); isInitialized = false; }); return true; } function _getChannel(pluginIdentifier) { var thePlugin = null; if (channelQueue && channelQueue.length > 0) { arrForEach(channelQueue, function (channels) { if (channels && channels.queue.length > 0) { arrForEach(channels.queue, function (ext) { if (ext.identifier === pluginIdentifier) { thePlugin = ext; return -1; } }); if (thePlugin) { return -1; } } }); } return thePlugin; } var isInitialized = false; var channelController = (_a = { identifier: "ChannelControllerPlugin", priority: ChannelControllerPriority, initialize: function (config, core, extensions, pluginChain) { isInitialized = true; arrForEach(channelQueue, function (channels) { if (channels && channels.queue.length > 0) { initializePlugins(createProcessTelemetryContext(channels.chain, config, core), extensions); } }); }, isInitialized: function () { return isInitialized; }, processTelemetry: function (item, itemCtx) { _processChannelQueue(channelQueue, itemCtx || _getTelCtx(), function (chainCtx) { chainCtx[strProcessNext](item); }, function () { itemCtx[strProcessNext](item); }); }, update: _doUpdate }, _a[strPause] = function () { _processChannelQueue(channelQueue, _getTelCtx(), function (chainCtx) { chainCtx.iterate(function (plugin) { plugin[strPause] && plugin[strPause](); }); }, null); }, _a[strResume] = function () { _processChannelQueue(channelQueue, _getTelCtx(), function (chainCtx) { chainCtx.iterate(function (plugin) { plugin[strResume] && plugin[strResume](); }); }, null); }, _a[strTeardown] = _doTeardown, _a.getChannel = _getChannel, _a.flush = function (isAsync, callBack, sendReason, cbTimeout) { var waiting = 1; var doneIterating = false; var cbTimer = null; cbTimeout = cbTimeout || 5000; function doCallback() { waiting--; if (doneIterating && waiting === 0) { if (cbTimer) { clearTimeout(cbTimer); cbTimer = null; } callBack && callBack(doneIterating); callBack = null; } } _processChannelQueue(channelQueue, _getTelCtx(), function (chainCtx) { chainCtx.iterate(function (plugin) { if (plugin.flush) { waiting++; var handled_1 = false; if (!plugin.flush(isAsync, function () { handled_1 = true; doCallback(); }, sendReason)) { if (!handled_1) { if (isAsync && cbTimer == null) { cbTimer = setTimeout(function () { cbTimer = null; doCallback(); }, cbTimeout); } else { doCallback(); } } } } }); }, function () { doneIterating = true; doCallback(); }); return true; }, _a._setQueue = function (queue) { channelQueue = queue; }, _a); return channelController; } function createChannelQueues(channels, extensions, config, core) { var channelQueue = []; if (channels) { arrForEach(channels, function (queue) { return _addChannelQueue(channelQueue, queue, config, core); }); } if (extensions) { var extensionQueue_1 = []; arrForEach(extensions, function (plugin) { if (plugin.priority > ChannelControllerPriority) { extensionQueue_1.push(plugin); } }); _addChannelQueue(channelQueue, extensionQueue_1, config, core); } return channelQueue; } function createUnloadHandlerContainer() { var handlers = []; function _addHandler(handler) { if (handler) { handlers.push(handler); } } function _runHandlers(unloadCtx, unloadState) { arrForEach(handlers, function (handler) { try { handler(unloadCtx, unloadState); } catch (e) { _throwInternal(unloadCtx.diagLog(), 2 , 73 , "Unexpected error calling unload handler - " + dumpObj(e)); } }); handlers = []; } return { add: _addHandler, run: _runHandlers }; } var strGetPlugin = "getPlugin"; var BaseTelemetryPlugin = /** @class */ (function () { function BaseTelemetryPlugin() { var _self = this; var _isinitialized; var _rootCtx; var _nextPlugin; var _unloadHandlerContainer; var _hooks; _initDefaults(); dynamicProto(BaseTelemetryPlugin, _self, function (_self) { _self.initialize = function (config, core, extensions, pluginChain) { _setDefaults(config, core, pluginChain); _isinitialized = true; }; _self.teardown = function (unloadCtx, unloadState) { var core = _self.core; if (!core || (unloadCtx && core !== unloadCtx.core())) { return; } var result; var unloadDone = false; var theUnloadCtx = unloadCtx || createProcessTelemetryUnloadContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin); var theUnloadState = unloadState || { reason: 0 , isAsync: false }; function _unloadCallback() { if (!unloadDone) { unloadDone = true; _unloadHandlerContainer.run(theUnloadCtx, unloadState); arrForEach(_hooks, function (fn) { fn.rm(); }); _hooks = []; if (result === true) { theUnloadCtx.processNext(theUnloadState); } _initDefaults(); } } if (!_self[strDoTeardown] || _self[strDoTeardown](theUnloadCtx, theUnloadState, _unloadCallback) !== true) { _unloadCallback(); } else { result = true; } return result; }; _self.update = function (updateCtx, updateState) { var core = _self.core; if (!core || (updateCtx && core !== updateCtx.core())) { return; } var result; var updateDone = false; var theUpdateCtx = updateCtx || createProcessTelemetryUpdateContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin); var theUpdateState = updateState || { reason: 0 }; function _updateCallback() { if (!updateDone) { updateDone = true; _setDefaults(theUpdateCtx.getCfg(), theUpdateCtx.core(), theUpdateCtx.getNext()); } } if (!_self._doUpdate || _self._doUpdate(theUpdateCtx, theUpdateState, _updateCallback) !== true) { _updateCallback(); } else { result = true; } return result; }; _self._addHook = function (hooks) { if (hooks) { if (isArray(hooks)) { _hooks = _hooks.concat(hooks); } else { _hooks.push(hooks); } } }; proxyFunctionAs(_self, "_addUnloadCb", function () { return _unloadHandlerContainer; }, "add"); }); _self.diagLog = function (itemCtx) { return _getTelCtx(itemCtx).diagLog(); }; _self[strIsInitialized] = function () { return _isinitialized; }; _self.setInitialized = function (isInitialized) { _isinitialized = isInitialized; }; _self[strSetNextPlugin] = function (next) { _nextPlugin = next; }; _self.processNext = function (env, itemCtx) { if (itemCtx) { itemCtx.processNext(env); } else if (_nextPlugin && isFunction(_nextPlugin.processTelemetry)) { _nextPlugin.processTelemetry(env, null); } }; _self._getTelCtx = _getTelCtx; function _getTelCtx(currentCtx) { if (currentCtx === void 0) { currentCtx = null; } var itemCtx = currentCtx; if (!itemCtx) { var rootCtx = _rootCtx || createProcessTelemetryContext(null, {}, _self.core); if (_nextPlugin && _nextPlugin[strGetPlugin]) { itemCtx = rootCtx.createNew(null, _nextPlugin[strGetPlugin]); } else { itemCtx = rootCtx.createNew(null, _nextPlugin); } } return itemCtx; } function _setDefaults(config, core, pluginChain) { if (config) { setValue(config, strExtensionConfig, [], null, isNullOrUndefined); } if (!pluginChain && core) { pluginChain = core.getProcessTelContext().getNext(); } var nextPlugin = _nextPlugin; if (_nextPlugin && _nextPlugin[strGetPlugin]) { nextPlugin = _nextPlugin[strGetPlugin](); } _self.core = core; _rootCtx = createProcessTelemetryContext(pluginChain, config, core, nextPlugin); } function _initDefaults() { _isinitialized = false; _self.core = null; _rootCtx = null; _nextPlugin = null; _hooks = []; _unloadHandlerContainer = createUnloadHandlerContainer(); } } return BaseTelemetryPlugin; }()); var TelemetryInitializerPlugin = /** @class */ (function (_super) { __extendsFn(TelemetryInitializerPlugin, _super); function TelemetryInitializerPlugin() { var _this = _super.call(this) || this; _this.identifier = "TelemetryInitializerPlugin"; _this.priority = 199; var _id; var _initializers; _initDefaults(); dynamicProto(TelemetryInitializerPlugin, _this, function (_self, _base) { _self.addTelemetryInitializer = function (telemetryInitializer) { var theInitializer = { id: _id++, fn: telemetryInitializer }; _initializers.push(theInitializer); var handler = { remove: function () { arrForEach(_initializers, function (initializer, idx) { if (initializer.id === theInitializer.id) { _initializers.splice(idx, 1); return -1; } }); } }; return handler; }; _self.processTelemetry = function (item, itemCtx) { var doNotSendItem = false; var telemetryInitializersCount = _initializers.length; for (var i = 0; i < telemetryInitializersCount; ++i) { var telemetryInitializer = _initializers[i]; if (telemetryInitializer) { try { if (telemetryInitializer.fn.apply(null, [item]) === false) { doNotSendItem = true; break; } } catch (e) { _throwInternal(itemCtx.diagLog(), 1 , 64 , "One of telemetry initializers failed, telemetry item will not be sent: " + getExceptionName(e), { exception: dumpObj(e) }, true); } } } if (!doNotSendItem) { _self.processNext(item, itemCtx); } }; _self[strDoTeardown] = function () { _initDefaults(); }; }); function _initDefaults() { _id = 0; _initializers = []; } return _this; } return TelemetryInitializerPlugin; }(BaseTelemetryPlugin)); var strValidationError = "Plugins must provide initialize method"; var strNotificationManager = "_notificationManager"; var strSdkUnloadingError = "SDK is still unloading..."; var strSdkNotInitialized = "SDK is not initialized"; var defaultInitConfig = { loggingLevelConsole: 1 }; function _createPerfManager(core, notificationMgr) { return new PerfManager(notificationMgr); } function _validateExtensions(logger, channelPriority, allExtensions) { var coreExtensions = []; var extPriorities = {}; arrForEach(allExtensions, function (ext) { if (isNullOrUndefined(ext) || isNullOrUndefined(ext.initialize)) { throwError(strValidationError); } var extPriority = ext.priority; var identifier = ext.identifier; if (ext && extPriority) { if (!isNullOrUndefined(extPriorities[extPriority])) { _warnToConsole(logger, "Two extensions have same priority #" + extPriority + " - " + extPriorities[extPriority] + ", " + identifier); } else { extPriorities[extPriority] = identifier; } } if (!extPriority || extPriority < channelPriority) { coreExtensions.push(ext); } }); return { all: allExtensions, core: coreExtensions }; } function _isPluginPresent(thePlugin, plugins) { var exists = false; arrForEach(plugins, function (plugin) { if (plugin === thePlugin) { exists = true; return -1; } }); return exists; } function _createDummyNotificationManager() { var _a; return objCreateFn((_a = {}, _a[strAddNotificationListener] = function (listener) { }, _a[strRemoveNotificationListener] = function (listener) { }, _a[strEventsSent] = function (events) { }, _a[strEventsDiscarded] = function (events, reason) { }, _a[strEventsSendRequest] = function (sendReason, isAsync) { }, _a)); } var BaseCore$2 = /** @class */ (function () { function BaseCore() { var _isInitialized; var _eventQueue; var _notificationManager; var _perfManager; var _cfgPerfManager; var _cookieManager; var _pluginChain; var _configExtensions; var _coreExtensions; var _channelControl; var _channelConfig; var _channelQueue; var _isUnloading; var _telemetryInitializerPlugin; var _internalLogsEventName; var _evtNamespace; var _unloadHandlers; var _debugListener; var _internalLogPoller = 0; dynamicProto(BaseCore, this, function (_self) { _initDefaults(); _self.isInitialized = function () { return _isInitialized; }; _self.initialize = function (config, extensions, logger, notificationManager) { if (_isUnloading) { throwError(strSdkUnloadingError); } if (_self.isInitialized()) { throwError("Core should not be initialized more than once"); } if (!config || isNullOrUndefined(config.instrumentationKey)) { throwError("Please provide instrumentation key"); } _notificationManager = notificationManager; _self[strNotificationManager] = notificationManager; _self.config = config || {}; _initDebugListener(config); _initPerfManager(config); config.extensions = isNullOrUndefined(config.extensions) ? [] : config.extensions; _initExtConfig(config); if (logger) { _self.logger = logger; } _configExtensions = []; _configExtensions.push.apply(_configExtensions, __spreadArrayFn(__spreadArrayFn([], extensions, false), config.extensions)); _channelConfig = (config || {}).channels; _initPluginChain(config, null); if (!_channelQueue || _channelQueue.length === 0) { throwError("No channels available"); } _isInitialized = true; _self.releaseQueue(); }; _self.getTransmissionControls = function () { var controls = []; if (_channelQueue) { arrForEach(_channelQueue, function (channels) { controls.push(channels.queue); }); } return objFreeze(controls); }; _self.track = function (telemetryItem) { setValue(telemetryItem, strIKey, _self.config.instrumentationKey, null, isNotTruthy); setValue(telemetryItem, "time", toISOString(new Date()), null, isNotTruthy); setValue(telemetryItem, "ver", "4.0", null, isNullOrUndefined); if (!_isUnloading && _self.isInitialized()) { _createTelCtx().processNext(telemetryItem); } else { _eventQueue.push(telemetryItem); } }; _self.getProcessTelContext = _createTelCtx; _self.getNotifyMgr = function () { if (!_notificationManager) { _notificationManager = _createDummyNotificationManager(); _self[strNotificationManager] = _notificationManager; } return _notificationManager; }; _self[strAddNotificationListener] = function (listener) { if (_notificationManager) { _notificationManager[strAddNotificationListener](listener); } }; _self[strRemoveNotificationListener] = function (listener) { if (_notificationManager) { _notificationManager[strRemoveNotificationListener](listener); } }; _self.getCookieMgr = function () { if (!_cookieManager) { _cookieManager = createCookieMgr(_self.config, _self.logger); } return _cookieManager; }; _self.setCookieMgr = function (cookieMgr) { _cookieManager = cookieMgr; }; _self.getPerfMgr = function () { if (!_perfManager && !_cfgPerfManager) { if (_self.config && _self.config.enablePerfMgr && isFunction(_self.config.createPerfMgr)) { _cfgPerfManager = _self.config.createPerfMgr(_self, _self.getNotifyMgr()); } } return _perfManager || _cfgPerfManager || getGblPerfMgr(); }; _self.setPerfMgr = function (perfMgr) { _perfManager = perfMgr; }; _self.eventCnt = function () { return _eventQueue.length; }; _self.releaseQueue = function () { if (_isInitialized && _eventQueue.length > 0) { var eventQueue = _eventQueue; _eventQueue = []; arrForEach(eventQueue, function (event) { _createTelCtx().processNext(event); }); } }; _self.pollInternalLogs = function (eventName) { _internalLogsEventName = eventName || null; var interval = _self.config.diagnosticLogInterval; if (!interval || !(interval > 0)) { interval = 10000; } if (_internalLogPoller) { clearInterval(_internalLogPoller); } _internalLogPoller = setInterval(function () { _flushInternalLogs(); }, interval); return _internalLogPoller; }; _self.stopPollingInternalLogs = function () { if (_internalLogPoller) { clearInterval(_internalLogPoller); _internalLogPoller = 0; _flushInternalLogs(); } }; proxyFunctions(_self, function () { return _telemetryInitializerPlugin; }, ["addTelemetryInitializer"]); _self.unload = function (isAsync, unloadComplete, cbTimeout) { if (isAsync === void 0) { isAsync = true; } if (!_isInitialized) { throwError(strSdkNotInitialized); } if (_isUnloading) { throwError(strSdkUnloadingError); } var unloadState = { reason: 50 , isAsync: isAsync, flushComplete: false }; var processUnloadCtx = createProcessTelemetryUnloadContext(_getPluginChain(), _self); processUnloadCtx.onComplete(function () { _initDefaults(); unloadComplete && unloadComplete(unloadState); }, _self); function _doUnload(flushComplete) { unloadState.flushComplete = flushComplete; _isUnloading = true; _unloadHandlers.run(processUnloadCtx, unloadState); _self.stopPollingInternalLogs(); processUnloadCtx.processNext(unloadState); } if (!_flushChannels(isAsync, _doUnload, 6 , cbTimeout)) { _doUnload(false); } }; _self.getPlugin = _getPlugin; _self.addPlugin = function (plugin, replaceExisting, isAsync, addCb) { if (!plugin) { addCb && addCb(false); _logOrThrowError(strValidationError); return; } var existingPlugin = _getPlugin(plugin.identifier); if (existingPlugin && !replaceExisting) { addCb && addCb(false); _logOrThrowError("Plugin [" + plugin.identifier + "] is already loaded!"); return; } var updateState = { reason: 16 }; function _addPlugin(removed) { _configExtensions.push(plugin); updateState.added = [plugin]; _initPluginChain(_self.config, updateState); addCb && addCb(true); } if (existingPlugin) { var removedPlugins_1 = [existingPlugin.plugin]; var unloadState = { reason: 2 , isAsync: !!isAsync }; _removePlugins(removedPlugins_1, unloadState, function (removed) { if (!removed) { addCb && addCb(false); } else { updateState.removed = removedPlugins_1; updateState.reason |= 32 ; _addPlugin(); } }); } else { _addPlugin(); } }; _self.evtNamespace = function () { return _evtNamespace; }; _self.flush = _flushChannels; proxyFunctionAs(_self, "addUnloadCb", function () { return _unloadHandlers; }, "add"); function _initDefaults() { _isInitialized = false; _self.config = objExtend(true, {}, defaultInitConfig); _self.logger = new DiagnosticLogger(_self.config); _self._extensions = []; _telemetryInitializerPlugin = new TelemetryInitializerPlugin(); _eventQueue = []; _notificationManager = null; _perfManager = null; _cfgPerfManager = null; _cookieManager = null; _pluginChain = null; _coreExtensions = null; _configExtensions = []; _channelControl = null; _channelConfig = null; _channelQueue = null; _isUnloading = false; _internalLogsEventName = null; _evtNamespace = createUniqueNamespace("AIBaseCore", true); _unloadHandlers = createUnloadHandlerContainer(); } function _createTelCtx() { return createProcessTelemetryContext(_getPluginChain(), _self.config, _self); } function _initPluginChain(config, updateState) { var theExtensions = _validateExtensions(_self.logger, ChannelControllerPriority, _configExtensions); _coreExtensions = theExtensions.core; _pluginChain = null; var allExtensions = theExtensions.all; _channelQueue = objFreeze(createChannelQueues(_channelConfig, allExtensions, config, _self)); if (_channelControl) { var idx = arrIndexOf(allExtensions, _channelControl); if (idx !== -1) { allExtensions.splice(idx, 1); } idx = arrIndexOf(_coreExtensions, _channelControl); if (idx !== -1) { _coreExtensions.splice(idx, 1); } _channelControl._setQueue(_channelQueue); } else { _channelControl = createChannelControllerPlugin(_channelQueue, _self); } allExtensions.push(_channelControl); _coreExtensions.push(_channelControl); _self._extensions = sortPlugins(allExtensions); _channelControl.initialize(config, _self, allExtensions); initializePlugins(_createTelCtx(), allExtensions); _self._extensions = objFreeze(sortPlugins(_coreExtensions || [])).slice(); if (updateState) { _doUpdate(updateState); } } function _getPlugin(pluginIdentifier) { var theExt = null; var thePlugin = null; arrForEach(_self._extensions, function (ext) { if (ext.identifier === pluginIdentifier && ext !== _channelControl && ext !== _telemetryInitializerPlugin) { thePlugin = ext; return -1; } }); if (!thePlugin && _channelControl) { thePlugin = _channelControl.getChannel(pluginIdentifier); } if (thePlugin) { theExt = { plugin: thePlugin, setEnabled: function (enabled) { _getPluginState(thePlugin)[strDisabled] = !enabled; }, isEnabled: function () { var pluginState = _getPluginState(thePlugin); return !pluginState[strTeardown] && !pluginState[strDisabled]; }, remove: function (isAsync, removeCb) { if (isAsync === void 0) { isAsync = true; } var pluginsToRemove = [thePlugin]; var unloadState = { reason: 1 , isAsync: isAsync }; _removePlugins(pluginsToRemove, unloadState, function (removed) { if (removed) { _initPluginChain(_self.config, { reason: 32 , removed: pluginsToRemove }); } removeCb && removeCb(removed); }); } }; } return theExt; } function _getPluginChain() { if (!_pluginChain) { var extensions = (_coreExtensions || []).slice(); if (arrIndexOf(extensions, _telemetryInitializerPlugin) === -1) { extensions.push(_telemetryInitializerPlugin); } _pluginChain = createTelemetryProxyChain(sortPlugins(extensions), _self.config, _self); } return _pluginChain; } function _removePlugins(thePlugins, unloadState, removeComplete) { if (thePlugins && thePlugins.length > 0) { var unloadChain = createTelemetryProxyChain(thePlugins, _self.config, _self); var unloadCtx = createProcessTelemetryUnloadContext(unloadChain, _self); unloadCtx.onComplete(function () { var removed = false; var newConfigExtensions = []; arrForEach(_configExtensions, function (plugin, idx) { if (!_isPluginPresent(plugin, thePlugins)) { newConfigExtensions.push(plugin); } else { removed = true; } }); _configExtensions = newConfigExtensions; var newChannelConfig = []; if (_channelConfig) { arrForEach(_channelConfig, function (queue, idx) { var newQueue = []; arrForEach(queue, function (channel) { if (!_isPluginPresent(channel, thePlugins)) { newQueue.push(channel); } else { removed = true; } }); newChannelConfig.push(newQueue); }); _channelConfig = newChannelConfig; } removeComplete && removeComplete(removed); }); unloadCtx.processNext(unloadState); } else { removeComplete(false); } } function _flushInternalLogs() { var queue = _self.logger ? _self.logger.queue : []; if (queue) { arrForEach(queue, function (logMessage) { var item = { name: _internalLogsEventName ? _internalLogsEventName : "InternalMessageId: " + logMessage.messageId, iKey: _self.config.instrumentationKey, time: toISOString(new Date()), baseType: _InternalLogMessage.dataType, baseData: { message: logMessage.message } }; _self.track(item); }); queue.length = 0; } } function _flushChannels(isAsync, callBack, sendReason, cbTimeout) { if (_channelControl) { return _channelControl.flush(isAsync, callBack, sendReason || 6 , cbTimeout); } callBack && callBack(false); return true; } function _initDebugListener(config) { if (config.disableDbgExt === true && _debugListener) { _notificationManager[strRemoveNotificationListener](_debugListener); _debugListener = null; } if (_notificationManager && !_debugListener && config.disableDbgExt !== true) { _debugListener = getDebugListener(config); _notificationManager[strAddNotificationListener](_debugListener); } } function _initPerfManager(config) { if (!config.enablePerfMgr && _cfgPerfManager) { _cfgPerfManager = null; } if (config.enablePerfMgr) { setValue(_self.config, "createPerfMgr", _createPerfManager); } } function _initExtConfig(config) { var extConfig = getSetValue(config, strExtensionConfig); extConfig.NotificationManager = _notificationManager; } function _doUpdate(updateState) { var updateCtx = createProcessTelemetryUpdateContext(_getPluginChain(), _self); if (!_self._updateHook || _self._updateHook(updateCtx, updateState) !== true) { updateCtx.processNext(updateState); } } function _logOrThrowError(message) { var logger = _self.logger; if (logger) { _throwInternal(logger, 2 , 73 , message); } else { throwError(message); } } }); } return BaseCore; }()); function _runListeners(listeners, name, isAsync, callback) { arrForEach(listeners, function (listener) { if (listener && listener[name]) { if (isAsync) { setTimeout(function () { return callback(listener); }, 0); } else { try { callback(listener); } catch (e) { } } } }); } var NotificationManager = /** @class */ (function () { function NotificationManager(config) { this.listeners = []; var perfEvtsSendAll = !!(config || {}).perfEvtsSendAll; dynamicProto(NotificationManager, this, function (_self) { _self[strAddNotificationListener] = function (listener) { _self.listeners.push(listener); }; _self[strRemoveNotificationListener] = function (listener) { var index = arrIndexOf(_self.listeners, listener); while (index > -1) { _self.listeners.splice(index, 1); index = arrIndexOf(_self.listeners, listener); } }; _self[strEventsSent] = function (events) { _runListeners(_self.listeners, strEventsSent, true, function (listener) { listener[strEventsSent](events); }); }; _self[strEventsDiscarded] = function (events, reason) { _runListeners(_self.listeners, strEventsDiscarded, true, function (listener) { listener[strEventsDiscarded](events, reason); }); }; _self[strEventsSendRequest] = function (sendReason, isAsync) { _runListeners(_self.listeners, strEventsSendRequest, isAsync, function (listener) { listener[strEventsSendRequest](sendReason, isAsync); }); }; _self[strPerfEvent] = function (perfEvent) { if (perfEvent) { if (perfEvtsSendAll || !perfEvent.isChildEvt()) { _runListeners(_self.listeners, strPerfEvent, false, function (listener) { if (perfEvent.isAsync) { setTimeout(function () { return listener[strPerfEvent](perfEvent); }, 0); } else { listener[strPerfEvent](perfEvent); } }); } } }; }); } return NotificationManager; }()); var AppInsightsCore$2 = /** @class */ (function (_super) { __extendsFn(AppInsightsCore, _super); function AppInsightsCore() { var _this = _super.call(this) || this; dynamicProto(AppInsightsCore, _this, function (_self, _base) { _self.initialize = function (config, extensions, logger, notificationManager) { _base.initialize(config, extensions, logger || new DiagnosticLogger(config), notificationManager || new NotificationManager(config)); }; _self.track = function (telemetryItem) { doPerf(_self.getPerfMgr(), function () { return "AppInsightsCore:track"; }, function () { if (telemetryItem === null) { _notifyInvalidEvent(telemetryItem); throwError("Invalid telemetry item"); } _validateTelemetryItem(telemetryItem); _base.track(telemetryItem); }, function () { return ({ item: telemetryItem }); }, !(telemetryItem.sync)); }; function _validateTelemetryItem(telemetryItem) { if (isNullOrUndefined(telemetryItem.name)) { _notifyInvalidEvent(telemetryItem); throwError("telemetry name required"); } } function _notifyInvalidEvent(telemetryItem) { var manager = _self.getNotifyMgr(); if (manager) { manager.eventsDiscarded([telemetryItem], 2 ); } } }); return _this; } return AppInsightsCore; }(BaseCore$2)); var strOnPrefix = "on"; var strAttachEvent = "attachEvent"; var strAddEventHelper = "addEventListener"; var strDetachEvent = "detachEvent"; var strRemoveEventListener = "removeEventListener"; var strEvents = "events"; var strVisibilityChangeEvt = "visibilitychange"; var strPageHide = "pagehide"; var strPageShow = "pageshow"; var strUnload = "unload"; var strBeforeUnload = "beforeunload"; var strPageHideNamespace = createUniqueNamespace("aiEvtPageHide"); var strPageShowNamespace = createUniqueNamespace("aiEvtPageShow"); var rRemoveEmptyNs = /\.[\.]+/g; var rRemoveTrailingEmptyNs = /[\.]+$/; var _guid = 1; var elmNodeData = createElmNodeData("events"); var eventNamespace = /^([^.]*)(?:\.(.+)|)/; function _normalizeNamespace(name) { if (name && name.replace) { return name.replace(/^\s*\.*|\.*\s*$/g, ""); } return name; } function _getEvtNamespace(eventName, evtNamespace) { if (evtNamespace) { var theNamespace_1 = ""; if (isArray(evtNamespace)) { theNamespace_1 = ""; arrForEach(evtNamespace, function (name) { name = _normalizeNamespace(name); if (name) { if (name[0] !== ".") { name = "." + name; } theNamespace_1 += name; } }); } else { theNamespace_1 = _normalizeNamespace(evtNamespace); } if (theNamespace_1) { if (theNamespace_1[0] !== ".") { theNamespace_1 = "." + theNamespace_1; } eventName = (eventName || "") + theNamespace_1; } } var parsedEvent = (eventNamespace.exec(eventName || "") || []); return { type: parsedEvent[1], ns: ((parsedEvent[2] || "").replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, "").split(".").sort()).join(".") }; } function __getRegisteredEvents(target, eventName, evtNamespace) { var theEvents = []; var eventCache = elmNodeData.get(target, strEvents, {}, false); var evtName = _getEvtNamespace(eventName, evtNamespace); objForEachKey(eventCache, function (evtType, registeredEvents) { arrForEach(registeredEvents, function (value) { if (!evtName.type || evtName.type === value.evtName.type) { if (!evtName.ns || evtName.ns === evtName.ns) { theEvents.push({ name: value.evtName.type + (value.evtName.ns ? "." + value.evtName.ns : ""), handler: value.handler }); } } }); }); return theEvents; } function _getRegisteredEvents(target, evtName, addDefault) { if (addDefault === void 0) { addDefault = true; } var aiEvts = elmNodeData.get(target, strEvents, {}, addDefault); var registeredEvents = aiEvts[evtName]; if (!registeredEvents) { registeredEvents = aiEvts[evtName] = []; } return registeredEvents; } function _doDetach(obj, evtName, handlerRef, useCapture) { if (obj && evtName && evtName.type) { if (obj[strRemoveEventListener]) { obj[strRemoveEventListener](evtName.type, handlerRef, useCapture); } else if (obj[strDetachEvent]) { obj[strDetachEvent](strOnPrefix + evtName.type, handlerRef); } } } function _doAttach(obj, evtName, handlerRef, useCapture) { var result = false; if (obj && evtName && evtName.type && handlerRef) { if (obj[strAddEventHelper]) { obj[strAddEventHelper](evtName.type, handlerRef, useCapture); result = true; } else if (obj[strAttachEvent]) { obj[strAttachEvent](strOnPrefix + evtName.type, handlerRef); result = true; } } return result; } function _doUnregister(target, events, evtName, unRegFn) { var idx = events.length; while (idx--) { var theEvent = events[idx]; if (theEvent) { if (!evtName.ns || evtName.ns === theEvent.evtName.ns) { if (!unRegFn || unRegFn(theEvent)) { _doDetach(target, theEvent.evtName, theEvent.handler, theEvent.capture); events.splice(idx, 1); } } } } } function _unregisterEvents(target, evtName, unRegFn) { if (evtName.type) { _doUnregister(target, _getRegisteredEvents(target, evtName.type), evtName, unRegFn); } else { var eventCache = elmNodeData.get(target, strEvents, {}); objForEachKey(eventCache, function (evtType, events) { _doUnregister(target, events, evtName, unRegFn); }); if (objKeys(eventCache).length === 0) { elmNodeData.kill(target, strEvents); } } } function mergeEvtNamespace(theNamespace, namespaces) { var newNamespaces; if (namespaces) { if (isArray(namespaces)) { newNamespaces = [theNamespace].concat(namespaces); } else { newNamespaces = [theNamespace, namespaces]; } newNamespaces = (_getEvtNamespace("xx", newNamespaces).ns).split("."); } else { newNamespaces = theNamespace; } return newNamespaces; } function eventOn(target, eventName, handlerRef, evtNamespace, useCapture) { if (useCapture === void 0) { useCapture = false; } var result = false; if (target) { try { var evtName = _getEvtNamespace(eventName, evtNamespace); result = _doAttach(target, evtName, handlerRef, useCapture); if (result && elmNodeData.accept(target)) { var registeredEvent = { guid: _guid++, evtName: evtName, handler: handlerRef, capture: useCapture }; _getRegisteredEvents(target, evtName.type).push(registeredEvent); } } catch (e) { } } return result; } function eventOff(target, eventName, handlerRef, evtNamespace, useCapture) { if (useCapture === void 0) { useCapture = false; } if (target) { try { var evtName_1 = _getEvtNamespace(eventName, evtNamespace); var found_1 = false; _unregisterEvents(target, evtName_1, function (regEvent) { if ((evtName_1.ns && !handlerRef) || regEvent.handler === handlerRef) { found_1 = true; return true; } return false; }); if (!found_1) { _doDetach(target, evtName_1, handlerRef, useCapture); } } catch (e) { } } } function attachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) { if (useCapture === void 0) { useCapture = false; } return eventOn(obj, eventNameWithoutOn, handlerRef, null, useCapture); } function detachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) { if (useCapture === void 0) { useCapture = false; } eventOff(obj, eventNameWithoutOn, handlerRef, null, useCapture); } function addEventHandler(eventName, callback, evtNamespace) { var result = false; var w = getWindow(); if (w) { result = eventOn(w, eventName, callback, evtNamespace); result = eventOn(w["body"], eventName, callback, evtNamespace) || result; } var doc = getDocument(); if (doc) { result = eventOn(doc, eventName, callback, evtNamespace) || result; } return result; } function removeEventHandler(eventName, callback, evtNamespace) { var w = getWindow(); if (w) { eventOff(w, eventName, callback, evtNamespace); eventOff(w["body"], eventName, callback, evtNamespace); } var doc = getDocument(); if (doc) { eventOff(doc, eventName, callback, evtNamespace); } } function _addEventListeners(events, listener, excludeEvents, evtNamespace) { var added = false; if (listener && events && events.length > 0) { arrForEach(events, function (name) { if (name) { if (!excludeEvents || arrIndexOf(excludeEvents, name) === -1) { added = addEventHandler(name, listener, evtNamespace) || added; } } }); } return added; } function addEventListeners(events, listener, excludeEvents, evtNamespace) { var added = false; if (listener && events && isArray(events)) { added = _addEventListeners(events, listener, excludeEvents, evtNamespace); if (!added && excludeEvents && excludeEvents.length > 0) { added = _addEventListeners(events, listener, null, evtNamespace); } } return added; } function removeEventListeners(events, listener, evtNamespace) { if (events && isArray(events)) { arrForEach(events, function (name) { if (name) { removeEventHandler(name, listener, evtNamespace); } }); } } function addPageUnloadEventListener(listener, excludeEvents, evtNamespace) { return addEventListeners([strBeforeUnload, strUnload, strPageHide], listener, excludeEvents, evtNamespace); } function removePageUnloadEventListener(listener, evtNamespace) { removeEventListeners([strBeforeUnload, strUnload, strPageHide], listener, evtNamespace); } function addPageHideEventListener(listener, excludeEvents, evtNamespace) { function _handlePageVisibility(evt) { var doc = getDocument(); if (listener && doc && doc.visibilityState === "hidden") { listener(evt); } } var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace); var pageUnloadAdded = _addEventListeners([strPageHide], listener, excludeEvents, newNamespaces); if (!excludeEvents || arrIndexOf(excludeEvents, strVisibilityChangeEvt) === -1) { pageUnloadAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageUnloadAdded; } if (!pageUnloadAdded && excludeEvents) { pageUnloadAdded = addPageHideEventListener(listener, null, evtNamespace); } return pageUnloadAdded; } function removePageHideEventListener(listener, evtNamespace) { var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace); removeEventListeners([strPageHide], listener, newNamespaces); removeEventListeners([strVisibilityChangeEvt], null, newNamespaces); } function addPageShowEventListener(listener, excludeEvents, evtNamespace) { function _handlePageVisibility(evt) { var doc = getDocument(); if (listener && doc && doc.visibilityState === "visible") { listener(evt); } } var newNamespaces = mergeEvtNamespace(strPageShowNamespace, evtNamespace); var pageShowAdded = _addEventListeners([strPageShow], listener, excludeEvents, newNamespaces); pageShowAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageShowAdded; if (!pageShowAdded && excludeEvents) { pageShowAdded = addPageShowEventListener(listener, null, evtNamespace); } return pageShowAdded; } function removePageShowEventListener(listener, evtNamespace) { var newNamespaces = mergeEvtNamespace(strPageShowNamespace, evtNamespace); removeEventListeners([strPageShow], listener, newNamespaces); removeEventListeners([strVisibilityChangeEvt], null, newNamespaces); } function newGuid() { function randomHexDigit() { return randomValue(15); } return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(GuidRegex, function (c) { var r = (randomHexDigit() | 0), v = (c === "x" ? r : r & 0x3 | 0x8); return v.toString(16); }); } function perfNow() { var perf = getPerformance(); if (perf && perf.now) { return perf.now(); } return dateNow(); } function generateW3CId() { var hexValues = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]; var oct = strEmpty, tmp; for (var a = 0; a < 4; a++) { tmp = random32(); oct += hexValues[tmp & 0xF] + hexValues[tmp >> 4 & 0xF] + hexValues[tmp >> 8 & 0xF] + hexValues[tmp >> 12 & 0xF] + hexValues[tmp >> 16 & 0xF] + hexValues[tmp >> 20 & 0xF] + hexValues[tmp >> 24 & 0xF] + hexValues[tmp >> 28 & 0xF]; } var clockSequenceHi = hexValues[8 + (random32() & 0x03) | 0]; return oct.substr(0, 8) + oct.substr(9, 4) + "4" + oct.substr(13, 3) + clockSequenceHi + oct.substr(16, 3) + oct.substr(19, 12); } var GuidRegex = /[xy]/g; var EventHelper = { Attach: attachEvent, AttachEvent: attachEvent, Detach: detachEvent, DetachEvent: detachEvent }; var LoggingSeverity = createEnumStyle({ CRITICAL: 1 , WARNING: 2 }); var _InternalMessageId = createEnumStyle({ BrowserDoesNotSupportLocalStorage: 0 , BrowserCannotReadLocalStorage: 1 , BrowserCannotReadSessionStorage: 2 , BrowserCannotWriteLocalStorage: 3 , BrowserCannotWriteSessionStorage: 4 , BrowserFailedRemovalFromLocalStorage: 5 , BrowserFailedRemovalFromSessionStorage: 6 , CannotSendEmptyTelemetry: 7 , ClientPerformanceMathError: 8 , ErrorParsingAISessionCookie: 9 , ErrorPVCalc: 10 , ExceptionWhileLoggingError: 11 , FailedAddingTelemetryToBuffer: 12 , FailedMonitorAjaxAbort: 13 , FailedMonitorAjaxDur: 14 , FailedMonitorAjaxOpen: 15 , FailedMonitorAjaxRSC: 16 , FailedMonitorAjaxSend: 17 , FailedMonitorAjaxGetCorrelationHeader: 18 , FailedToAddHandlerForOnBeforeUnload: 19 , FailedToSendQueuedTelemetry: 20 , FailedToReportDataLoss: 21 , FlushFailed: 22 , MessageLimitPerPVExceeded: 23 , MissingRequiredFieldSpecification: 24 , NavigationTimingNotSupported: 25 , OnError: 26 , SessionRenewalDateIsZero: 27 , SenderNotInitialized: 28 , StartTrackEventFailed: 29 , StopTrackEventFailed: 30 , StartTrackFailed: 31 , StopTrackFailed: 32 , TelemetrySampledAndNotSent: 33 , TrackEventFailed: 34 , TrackExceptionFailed: 35 , TrackMetricFailed: 36 , TrackPVFailed: 37 , TrackPVFailedCalc: 38 , TrackTraceFailed: 39 , TransmissionFailed: 40 , FailedToSetStorageBuffer: 41 , FailedToRestoreStorageBuffer: 42 , InvalidBackendResponse: 43 , FailedToFixDepricatedValues: 44 , InvalidDurationValue: 45 , TelemetryEnvelopeInvalid: 46 , CreateEnvelopeError: 47 , CannotSerializeObject: 48 , CannotSerializeObjectNonSerializable: 49 , CircularReferenceDetected: 50 , ClearAuthContextFailed: 51 , ExceptionTruncated: 52 , IllegalCharsInName: 53 , ItemNotInArray: 54 , MaxAjaxPerPVExceeded: 55 , MessageTruncated: 56 , NameTooLong: 57 , SampleRateOutOfRange: 58 , SetAuthContextFailed: 59 , SetAuthContextFailedAccountName: 60 , StringValueTooLong: 61 , StartCalledMoreThanOnce: 62 , StopCalledWithoutStart: 63 , TelemetryInitializerFailed: 64 , TrackArgumentsNotSpecified: 65 , UrlTooLong: 66 , SessionStorageBufferFull: 67 , CannotAccessCookie: 68 , IdTooLong: 69 , InvalidEvent: 70 , FailedMonitorAjaxSetRequestHeader: 71 , SendBrowserInfoOnUserInit: 72 , PluginException: 73 , NotificationException: 74 , SnippetScriptLoadFailure: 99 , InvalidInstrumentationKey: 100 , CannotParseAiBlobValue: 101 , InvalidContentBlob: 102 , TrackPageActionEventFailed: 103 , FailedAddingCustomDefinedRequestContext: 104 , InMemoryStorageBufferFull: 105 }); var ValueKind = createEnumStyle({ NotSet: 0 , Pii_DistinguishedName: 1 , Pii_GenericData: 2 , Pii_IPV4Address: 3 , Pii_IPv6Address: 4 , Pii_MailSubject: 5 , Pii_PhoneNumber: 6 , Pii_QueryString: 7 , Pii_SipAddress: 8 , Pii_SmtpAddress: 9 , Pii_Identity: 10 , Pii_Uri: 11 , Pii_Fqdn: 12 , Pii_IPV4AddressLegacy: 13 , CustomerContent_GenericContent: 32 }); var EventLatency = createEnumStyle({ Normal: 1 , CostDeferred: 2 , RealTime: 3 , Immediate: 4 }); var EventPropertyType = createEnumStyle({ Unspecified: 0 , String: 1 , Int32: 2 , UInt32: 3 , Int64: 4 , UInt64: 5 , Double: 6 , Bool: 7 , Guid: 8 , DateTime: 9 }); var EventPersistence = createEnumStyle({ Normal: 1 , Critical: 2 }); var TraceLevel = createEnumStyle({ NONE: 0 , ERROR: 1 , WARNING: 2 , INFORMATION: 3 }); var _ExtendedInternalMessageId = objFreeze(__assignFn(__assignFn({}, _InternalMessageId), createEnumStyle({ AuthHandShakeError: 501 , AuthRedirectFail: 502 , BrowserCannotReadLocalStorage: 503 , BrowserCannotWriteLocalStorage: 504 , BrowserDoesNotSupportLocalStorage: 505 , CannotParseBiBlobValue: 506 , CannotParseDataAttribute: 507 , CVPluginNotAvailable: 508 , DroppedEvent: 509 , ErrorParsingAISessionCookie: 510 , ErrorProvidedChannels: 511 , FailedToGetCookies: 512 , FailedToInitializeCorrelationVector: 513 , FailedToInitializeSDK: 514 , InvalidContentBlob: 515 , InvalidCorrelationValue: 516 , SessionRenewalDateIsZero: 517 , SendPostOnCompleteFailure: 518 , PostResponseHandler: 519 , SDKNotInitialized: 520 }))); var _a; var Version = '3.2.2'; var FullVersionString = "1DS-Web-JS-" + Version; var strDisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation"; var strWithCredentials = "withCredentials"; var strTimeout = "timeout"; var _fieldTypeEventPropMap = (_a = {}, _a[0 ] = 0 , _a[2 ] = 6 , _a[1 ] = 1 , _a[3 ] = 7 , _a[4096 | 2 ] = 6 , _a[4096 | 1 ] = 1 , _a[4096 | 3 ] = 7 , _a); var uInt8ArraySupported = null; var isDocumentObjectAvailable = Boolean(getDocument()); var isWindowObjectAvailable = Boolean(getWindow()); function isValueAssigned(value) { return !(value === "" || isNullOrUndefined(value)); } function getTenantId(apiKey) { if (apiKey) { var indexTenantId = apiKey.indexOf("-"); if (indexTenantId > -1) { return apiKey.substring(0, indexTenantId); } } return ""; } function isUint8ArrayAvailable() { if (uInt8ArraySupported === null) { uInt8ArraySupported = !isUndefined(Uint8Array) && !isSafariOrFirefox() && !isReactNative(); } return uInt8ArraySupported; } function isLatency(value) { if (value && isNumber(value) && value >= 1 && value <= 4 ) { return true; } return false; } function sanitizeProperty(name, property, stringifyObjects) { if ((!property && !isValueAssigned(property)) || typeof name !== "string") { return null; } var propType = typeof property; if (propType === "string" || propType === "number" || propType === "boolean" || isArray(property)) { property = { value: property }; } else if (propType === "object" && !property.hasOwnProperty("value")) { property = { value: stringifyObjects ? JSON.stringify(property) : property }; } else if (isNullOrUndefined(property.value) || property.value === "" || (!isString(property.value) && !isNumber(property.value) && !isBoolean(property.value) && !isArray(property.value))) { return null; } if (isArray(property.value) && !isArrayValid(property.value)) { return null; } if (!isNullOrUndefined(property.kind)) { if (isArray(property.value) || !isValueKind(property.kind)) { return null; } property.value = property.value.toString(); } return property; } function getCommonSchemaMetaData(value, kind, type) { var encodedTypeValue = -1; if (!isUndefined(value)) { if (kind > 0) { if (kind === 32) { encodedTypeValue = (1 << 13); } else if (kind <= 13) { encodedTypeValue = (kind << 5); } } if (isDataType(type)) { if (encodedTypeValue === -1) { encodedTypeValue = 0; } encodedTypeValue |= type; } else { var propType = _fieldTypeEventPropMap[getFieldValueType(value)] || -1; if (encodedTypeValue !== -1 && propType !== -1) { encodedTypeValue |= propType; } else if (propType === 6 ) { encodedTypeValue = propType; } } } return encodedTypeValue; } function disableCookies() { safeGetCookieMgr(null).setEnabled(false); } function setCookie(name, value, days) { if (areCookiesSupported(null)) { safeGetCookieMgr(null).set(name, value, days * 86400, null, "/"); } } function deleteCookie(name) { if (areCookiesSupported(null)) { safeGetCookieMgr(null).del(name); } } function getCookie(name) { if (areCookiesSupported(null)) { return getCookieValue(safeGetCookieMgr(null), name); } return ""; } function getCookieValue(cookieMgr, name, decode) { if (decode === void 0) { decode = true; } var cookieValue; if (cookieMgr) { cookieValue = cookieMgr.get(name); if (decode && cookieValue && decodeURIComponent) { cookieValue = decodeURIComponent(cookieValue); } } return cookieValue || ""; } function createGuid(style) { if (style === void 0) { style = "D" ; } var theGuid = newGuid(); if (style === "B" ) { theGuid = "{" + theGuid + "}"; } else if (style === "P" ) { theGuid = "(" + theGuid + ")"; } else if (style === "N" ) { theGuid = theGuid.replace(/-/g, ""); } return theGuid; } function extend(obj, obj2, obj3, obj4, obj5) { var extended = {}; var deep = false; var i = 0; var length = arguments.length; var objProto = Object[strShimPrototype]; var theArgs = arguments; if (objProto.toString.call(theArgs[0]) === "[object Boolean]") { deep = theArgs[0]; i++; } for (; i < length; i++) { var obj = theArgs[i]; objForEachKey(obj, function (prop, value) { if (deep && value && isObject(value)) { if (isArray(value)) { extended[prop] = extended[prop] || []; arrForEach(value, function (arrayValue, arrayIndex) { if (arrayValue && isObject(arrayValue)) { extended[prop][arrayIndex] = extend(true, extended[prop][arrayIndex], arrayValue); } else { extended[prop][arrayIndex] = arrayValue; } }); } else { extended[prop] = extend(true, extended[prop], value); } } else { extended[prop] = value; } }); } return extended; } var getTime = perfNow; function isValueKind(value) { if (value === 0 || ((value > 0 && value <= 13 ) || value === 32 )) { return true; } return false; } function isDataType(value) { if (value >= 0 && value <= 9) { return true; } return false; } function isSafariOrFirefox() { var nav = getNavigator(); if (!isUndefined(nav) && nav.userAgent) { var ua = nav.userAgent.toLowerCase(); if ((ua.indexOf("safari") >= 0 || ua.indexOf("firefox") >= 0) && ua.indexOf("chrome") < 0) { return true; } } return false; } function isArrayValid(value) { return value.length > 0; } function setProcessTelemetryTimings(event, identifier) { var evt = event; evt.timings = evt.timings || {}; evt.timings.processTelemetryStart = evt.timings.processTelemetryStart || {}; evt.timings.processTelemetryStart[identifier] = getTime(); } function getFieldValueType(value) { var theType = 0 ; if (value !== null && value !== undefined) { var objType = typeof value; if (objType === "string") { theType = 1 ; } else if (objType === "number") { theType = 2 ; } else if (objType === "boolean") { theType = 3 ; } else if (objType === strShimObject) { theType = 4 ; if (isArray(value)) { theType = 4096 ; if (value.length > 0) { theType |= getFieldValueType(value[0]); } } else if (hasOwnProperty(value, "value")) { theType = 8192 | getFieldValueType(value.value); } } } return theType; } var Utils = { Version: Version, FullVersionString: FullVersionString, strUndefined: strShimUndefined, strObject: strShimObject, Undefined: strShimUndefined, arrForEach: arrForEach, arrIndexOf: arrIndexOf, arrMap: arrMap, arrReduce: arrReduce, objKeys: objKeys, toISOString: toISOString, isReactNative: isReactNative, isString: isString, isNumber: isNumber, isBoolean: isBoolean, isFunction: isFunction, isArray: isArray, isObject: isObject, strTrim: strTrim, isDocumentObjectAvailable: isDocumentObjectAvailable, isWindowObjectAvailable: isWindowObjectAvailable, isValueAssigned: isValueAssigned, getTenantId: getTenantId, isBeaconsSupported: isBeaconsSupported, isUint8ArrayAvailable: isUint8ArrayAvailable, isLatency: isLatency, sanitizeProperty: sanitizeProperty, getISOString: toISOString, useXDomainRequest: useXDomainRequest, getCommonSchemaMetaData: getCommonSchemaMetaData, cookieAvailable: areCookiesSupported, disallowsSameSiteNone: uaDisallowsSameSiteNone, setCookie: setCookie, deleteCookie: deleteCookie, getCookie: getCookie, createGuid: createGuid, extend: extend, getTime: getTime, isValueKind: isValueKind, isArrayValid: isArrayValid, objDefineAccessors: objDefineAccessors, addPageUnloadEventListener: addPageUnloadEventListener, setProcessTelemetryTimings: setProcessTelemetryTimings, addEventHandler: addEventHandler, getFieldValueType: getFieldValueType, strEndsWith: strEndsWith, objForEachKey: objForEachKey }; var CoreUtils = { _canUseCookies: undefined, isTypeof: isTypeof, isUndefined: isUndefined, isNullOrUndefined: isNullOrUndefined, hasOwnProperty: hasOwnProperty, isFunction: isFunction, isObject: isObject, isDate: isDate, isArray: isArray, isError: isError, isString: isString, isNumber: isNumber, isBoolean: isBoolean, toISOString: toISOString, arrForEach: arrForEach, arrIndexOf: arrIndexOf, arrMap: arrMap, arrReduce: arrReduce, strTrim: strTrim, objCreate: objCreateFn, objKeys: objKeys, objDefineAccessors: objDefineAccessors, addEventHandler: addEventHandler, dateNow: dateNow, isIE: isIE, disableCookies: disableCookies, newGuid: newGuid, perfNow: perfNow, newId: newId, randomValue: randomValue, random32: random32, mwcRandomSeed: mwcRandomSeed, mwcRandom32: mwcRandom32, generateW3CId: generateW3CId }; function isChromium() { return !!getGlobalInst("chrome"); } function openXhr(method, urlString, withCredentials, disabled, isSync, timeout) { if (disabled === void 0) { disabled = false; } if (isSync === void 0) { isSync = false; } function _wrapSetXhrProp(xhr, prop, value) { try { xhr[prop] = value; } catch (e) { } } var xhr = new XMLHttpRequest(); if (disabled) { _wrapSetXhrProp(xhr, strDisabledPropertyName, disabled); } if (withCredentials) { _wrapSetXhrProp(xhr, strWithCredentials, withCredentials); } xhr.open(method, urlString, !isSync); if (withCredentials) { _wrapSetXhrProp(xhr, strWithCredentials, withCredentials); } if (!isSync && timeout) { _wrapSetXhrProp(xhr, strTimeout, timeout); } return xhr; } var PropVersion = "version"; var properties = "properties"; var AppInsightsCore = /** @class */ (function (_super) { __extendsFn(AppInsightsCore, _super); function AppInsightsCore() { var _this = _super.call(this) || this; _this.pluginVersionStringArr = []; _this.pluginVersionString = ""; dynamicProto(AppInsightsCore, _this, function (_self, _base) { if (!_self.logger || !_self.logger.queue) { _self.logger = new DiagnosticLogger({ loggingLevelConsole: 1 }); } _self.initialize = function (config, extensions, logger, notificationManager) { doPerf(_self, function () { return "AppInsightsCore.initialize"; }, function () { if (config) { if (!config.endpointUrl) { config.endpointUrl = "https://browser.events.data.microsoft.com/OneCollector/1.0/"; } var propertyStorageOverride = config.propertyStorageOverride; if (propertyStorageOverride && (!propertyStorageOverride.getProperty || !propertyStorageOverride.setProperty)) { throw new Error("Invalid property storage override passed."); } if (config.channels) { arrForEach(config.channels, function (channels) { if (channels) { arrForEach(channels, function (channel) { if (channel.identifier && channel.version) { var ver = channel.identifier + "=" + channel.version; _self.pluginVersionStringArr.push(ver); } }); } }); } } _self.getWParam = function () { return typeof document !== "undefined" ? 0 : -1; }; if (extensions) { arrForEach(extensions, function (ext) { if (ext && ext.identifier && ext.version) { var ver = ext.identifier + "=" + ext.version; _self.pluginVersionStringArr.push(ver); } }); } _self.pluginVersionString = _self.pluginVersionStringArr.join(";"); try { _base.initialize(config, extensions, logger, notificationManager); _self.pollInternalLogs("InternalLog"); } catch (e) { var logger_1 = _self.logger; var message = dumpObj(e); if (message.indexOf("channels") !== -1) { message += "\n - Channels must be provided through config.channels only!"; } logger_1.throwInternal(1 , 514 , "SDK Initialization Failed - no telemetry will be sent: " + message); } }, function () { return ({ config: config, extensions: extensions, logger: logger, notificationManager: notificationManager }); }); }; _self.track = function (item) { doPerf(_self, function () { return "AppInsightsCore.track"; }, function () { var telemetryItem = item; if (telemetryItem) { telemetryItem.timings = telemetryItem.timings || {}; telemetryItem.timings.trackStart = getTime(); if (!isLatency(telemetryItem.latency)) { telemetryItem.latency = 1 ; } var itemExt = telemetryItem.ext = telemetryItem.ext || {}; itemExt.sdk = itemExt.sdk || {}; itemExt.sdk.ver = FullVersionString; var baseData = telemetryItem.baseData = telemetryItem.baseData || {}; if (!baseData[properties]) { baseData[properties] = {}; } var itemProperties = baseData[properties]; if (!itemProperties[PropVersion]) { itemProperties[PropVersion] = ""; } if (_self.pluginVersionString !== "") { itemProperties[PropVersion] = _self.pluginVersionString; } } _base.track(telemetryItem); }, function () { return ({ item: item }); }, !(item.sync)); }; }); return _this; } return AppInsightsCore; }(AppInsightsCore$2)); var AppInsightsCore$1 = AppInsightsCore; var BaseCore = /** @class */ (function (_super) { __extendsFn(BaseCore, _super); function BaseCore() { var _this = _super.call(this) || this; dynamicProto(BaseCore, _this, function (_self, _base) { _self.initialize = function (config, extensions, logger, notificationManager) { if (config && !config.endpointUrl) { config.endpointUrl = "https://browser.events.data.microsoft.com/OneCollector/1.0/"; } _self.getWParam = function () { return isDocumentObjectAvailable ? 0 : -1; }; try { _base.initialize(config, extensions, logger, notificationManager); } catch (e) { _throwInternal(_self.logger, 1 , 514 , "Initialization Failed: " + dumpObj(e) + "\n - Note: Channels must be provided through config.channels only"); } }; _self.track = function (item) { var telemetryItem = item; if (telemetryItem) { var ext = telemetryItem.ext = telemetryItem.ext || {}; ext.sdk = ext.sdk || {}; ext.sdk.ver = FullVersionString; } _base.track(telemetryItem); }; }); return _this; } return BaseCore; }(BaseCore$2)); var BaseCore$1 = BaseCore; var _isFunction = isFunction; function _createPromiseAllOnResolvedFunction(values, index, resolvedCallback) { return function (value) { values[index] = value; resolvedCallback(); }; } var ESPromise = /** @class */ (function () { function ESPromise(resolverFunc) { var _state = 0 ; var _settledValue = null; var _queue = []; dynamicProto(ESPromise, this, function (_this) { _this.then = function (onResolved, onRejected) { return new ESPromise(function (resolve, reject) { _enqueue(onResolved, onRejected, resolve, reject); }); }; _this["catch"] = function (onRejected) { return _this.then(null, onRejected); }; }); function _enqueue(onResolved, onRejected, resolve, reject) { _queue.push(function () { var value; try { if (_state === 1 ) { value = _isFunction(onResolved) ? onResolved(_settledValue) : _settledValue; } else { value = _isFunction(onRejected) ? onRejected(_settledValue) : _settledValue; } if (value instanceof ESPromise) { value.then(resolve, reject); } else if (_state === 2 && !_isFunction(onRejected)) { reject(value); } else { resolve(value); } } catch (error) { reject(error); return; } }); if (_state !== 0 ) { _processQueue(); } } function _processQueue() { if (_queue.length > 0) { var pending_1 = _queue.slice(); _queue = []; setTimeout(function () { for (var i = 0, len = pending_1.length; i < len; ++i) { try { pending_1[i](); } catch (e) { } } }, 0); } } function _resolve(value) { if (_state === 0 ) { _settledValue = value; _state = 1 ; _processQueue(); } } function _reject(reason) { if (_state === 0 ) { _settledValue = reason; _state = 2 ; _processQueue(); } } (function _initialize() { if (!_isFunction(resolverFunc)) { throw new TypeError("ESPromise: resolvedFunc argument is not a Function"); } try { resolverFunc(_resolve, _reject); } catch (error) { _reject(error); } })(); } ESPromise.resolve = function (value) { if (value instanceof ESPromise) { return value; } else if (value && _isFunction(value.then)) { return new ESPromise(function (resolve, reject) { try { value.then(resolve, reject); } catch (error) { reject(error); } }); } return new ESPromise(function (resolve) { resolve(value); }); }; ESPromise.reject = function (reason) { return new ESPromise(function (resolve, reject) { reject(reason); }); }; ESPromise.all = function (iterable) { if (!iterable || !iterable.length) { return; } return new ESPromise(function (resolve, reject) { try { var values_1 = []; var pending_2 = 0; for (var lp = 0; lp < iterable.length; lp++) { var item = iterable[lp]; if (item && _isFunction(item.then)) { pending_2++; item.then(_createPromiseAllOnResolvedFunction(values_1, lp, function () { if (--pending_2 === 0) { resolve(values_1); } }), reject); } else { values_1[lp] = item; } } if (pending_2 === 0) { setTimeout(function () { resolve(values_1); }, 0); } } catch (error) { reject(error); } }); }; ESPromise.race = function (iterable) { return new ESPromise(function (resolve, reject) { if (!iterable || !iterable.length) { return; } try { var _loop_1 = function (lp) { var item = iterable[lp]; if (item && _isFunction(item.then)) { item.then(resolve, reject); } else { setTimeout(function () { resolve(item); }, 0); } }; for (var lp = 0; lp < iterable.length; lp++) { _loop_1(lp); } } catch (error) { reject(error); } }); }; return ESPromise; }()); var ESPromise$1 = ESPromise; var LazyRejectPeriod = 600000; var _schedulerId = 0; var _running = []; var _waiting = []; var _timedOut = []; function _getTime() { return new Date().getTime(); } var ESPromiseScheduler = /** @class */ (function () { function ESPromiseScheduler(name, diagLog) { var _promiseId = 0; var _scheduledName = (name || "") + "." + _schedulerId; _schedulerId++; dynamicProto(ESPromiseScheduler, this, function (_this) { var _lastEvent = null; var _eventCount = 0; _this.scheduleEvent = function (startEventAction, eventName, timeout) { var uniqueId = _scheduledName + "." + _eventCount; _eventCount++; if (eventName) { uniqueId += "-(" + eventName + ")"; } var uniqueEventId = uniqueId + "{" + _promiseId + "}"; _promiseId++; var newScheduledEvent = { evt: null, tm: _getTime(), id: uniqueEventId, isRunning: false, isAborted: false }; if (!_lastEvent) { newScheduledEvent.evt = _startWaitingEvent(newScheduledEvent); } else { newScheduledEvent.evt = _waitForPreviousEvent(newScheduledEvent, _lastEvent); } _lastEvent = newScheduledEvent; _lastEvent.evt._schId = uniqueEventId; return newScheduledEvent.evt; function _abortAndRemoveOldEvents(eventQueue) { var now = _getTime(); var expired = now - LazyRejectPeriod; var len = eventQueue.length; var lp = 0; while (lp < len) { var evt = eventQueue[lp]; if (evt && evt.tm < expired) { var message = null; if (evt.abort) { message = "Aborting [" + evt.id + "] due to Excessive runtime (" + (now - evt.tm) + " ms)"; evt.abort(message); } else { message = "Removing [" + evt.id + "] due to Excessive runtime (" + (now - evt.tm) + " ms)"; } _warnLog(message); eventQueue.splice(lp, 1); len--; } else { lp++; } } } function _cleanup(eventId, completed) { var toQueue = false; var removed = _removeQueuedEvent(_running, eventId); if (!removed) { removed = _removeQueuedEvent(_timedOut, eventId); toQueue = true; } if (removed) { if (removed.to) { clearTimeout(removed.to); removed.to = null; } var tm = _getTime() - removed.tm; if (completed) { if (!toQueue) { _debugLog("Promise [" + eventId + "] Complete -- " + tm + " ms"); } else { _warnLog("Timed out event [" + eventId + "] finally complete -- " + tm + " ms"); } } else { _timedOut.push(removed); _warnLog("Event [" + eventId + "] Timed out and removed -- " + tm + " ms"); } } else { _debugLog("Failed to remove [" + eventId + "] from running queue"); } if (_lastEvent && _lastEvent.id === eventId) { _lastEvent = null; } _abortAndRemoveOldEvents(_running); _abortAndRemoveOldEvents(_waiting); _abortAndRemoveOldEvents(_timedOut); } function _removeScheduledEvent(eventId, callback) { return function (value) { _cleanup(eventId, true); callback && callback(value); return value; }; } function _waitForFinalResult(eventId, startResult, schEventResolve, schEventReject) { startResult.then(function (value) { if (value instanceof ESPromise$1) { _debugLog("Event [" + eventId + "] returned a promise -- waiting"); _waitForFinalResult(eventId, value, schEventResolve, schEventReject); return value; } else { return _removeScheduledEvent(eventId, schEventResolve)(value); } }, _removeScheduledEvent(eventId, schEventReject)); } function _createScheduledEvent(eventDetails, startEvent) { var eventId = eventDetails.id; return new ESPromise$1(function (schEventResolve, schEventReject) { _debugLog("Event [" + eventId + "] Starting -- waited for " + (eventDetails.wTm || "--") + " ms"); eventDetails.isRunning = true; eventDetails.abort = function (message) { eventDetails.abort = null; eventDetails.isAborted = true; _cleanup(eventId, false); schEventReject(new Error(message)); }; var startResult = startEvent(eventId); if (startResult instanceof ESPromise$1) { if (timeout) { eventDetails.to = setTimeout(function () { _cleanup(eventId, false); schEventReject(new Error("Timed out after [" + timeout + "] ms")); }, timeout); } _waitForFinalResult(eventId, startResult, function (theResult) { _debugLog("Event [" + eventId + "] Resolving after " + (_getTime() - eventDetails.tm) + " ms"); schEventResolve(theResult); }, schEventReject); } else { _debugLog("Promise [" + eventId + "] Auto completed as the start action did not return a promise"); schEventResolve(); } }); } function _startWaitingEvent(eventDetails) { var now = _getTime(); eventDetails.wTm = now - eventDetails.tm; eventDetails.tm = now; if (eventDetails.isAborted) { return ESPromise$1.reject(new Error("[" + uniqueId + "] was aborted")); } _running.push(eventDetails); return _createScheduledEvent(eventDetails, startEventAction); } function _waitForPreviousEvent(eventDetails, waitForEvent) { var waitEvent = new ESPromise$1(function (waitResolve, waitReject) { var runTime = _getTime() - waitForEvent.tm; var prevId = waitForEvent.id; _debugLog("[" + uniqueId + "] is waiting for [" + prevId + ":" + runTime + " ms] to complete before starting -- [" + _waiting.length + "] waiting and [" + _running.length + "] running"); eventDetails.abort = function (message) { eventDetails.abort = null; _removeQueuedEvent(_waiting, uniqueId); eventDetails.isAborted = true; waitReject(new Error(message)); }; waitForEvent.evt.then(function (value) { _removeQueuedEvent(_waiting, uniqueId); _startWaitingEvent(eventDetails).then(waitResolve, waitReject); }, function (reason) { _removeQueuedEvent(_waiting, uniqueId); _startWaitingEvent(eventDetails).then(waitResolve, waitReject); }); }); _waiting.push(eventDetails); return waitEvent; } }; function _removeQueuedEvent(queue, eventId) { for (var lp = 0; lp < queue.length; lp++) { if (queue[lp].id === eventId) { return queue.splice(lp, 1)[0]; } } return null; } }); function _debugLog(message) { var global = getGlobal(); if (global && global["QUnit"]) { console && console.log("ESPromiseScheduler[" + _scheduledName + "] " + message); } } function _warnLog(message) { diagLog && diagLog.warnToConsole("ESPromiseScheduler[" + _scheduledName + "] " + message); } } ESPromiseScheduler.incomplete = function () { return _running; }; ESPromiseScheduler.waitingToStart = function () { return _waiting; }; return ESPromiseScheduler; }()); var ESPromiseScheduler$1 = ESPromiseScheduler; var ValueSanitizer = /** @class */ (function () { function ValueSanitizer(fieldSanitizerProvider) { var _self = this; var _sanitizerMap = {}; var _sanitizers = []; var _fieldSanitizers = []; if (fieldSanitizerProvider) { _fieldSanitizers.push(fieldSanitizerProvider); } function _getFieldSanitizer(path, name) { var result; var fieldLookup = _sanitizerMap[path]; if (fieldLookup) { result = fieldLookup[name]; } if (!result && result !== null) { if (isString(path) && isString(name)) { if (_fieldSanitizers.length > 0) { for (var lp = 0; lp < _fieldSanitizers.length; lp++) { if (_fieldSanitizers[lp].handleField(path, name)) { result = { canHandle: true, fieldHandler: _fieldSanitizers[lp] }; break; } } } else if (_sanitizers.length === 0) { result = { canHandle: true }; } } if (!result && result !== null) { result = null; for (var lp = 0; lp < _sanitizers.length; lp++) { if (_sanitizers[lp].handleField(path, name)) { result = { canHandle: true, handler: _sanitizers[lp], fieldHandler: null }; break; } } } if (!fieldLookup) { fieldLookup = _sanitizerMap[path] = {}; } fieldLookup[name] = result; } return result; } _self.addSanitizer = function (newSanitizer) { if (newSanitizer) { _sanitizers.push(newSanitizer); _sanitizerMap = {}; } }; _self.addFieldSanitizer = function (fieldSanitizer) { if (fieldSanitizer) { _fieldSanitizers.push(fieldSanitizer); _sanitizerMap = {}; } }; _self.handleField = function (path, name) { var mapValue = _getFieldSanitizer(path, name); return mapValue ? mapValue.canHandle : false; }; _self.value = function (path, name, value, stringifyObjects) { var mapValue = _getFieldSanitizer(path, name); if (mapValue && mapValue.canHandle) { if (!mapValue || !mapValue.canHandle) { return null; } if (mapValue.handler) { return mapValue.handler.value(path, name, value, stringifyObjects); } if (!isString(name) || isNullOrUndefined(value) || value === "") { return null; } var property = null; var fieldType = getFieldValueType(value); if ((fieldType & 8192 ) === 8192 ) { var subType = fieldType & ~8192 ; property = value; if (!isValueAssigned(property.value) || (subType !== 1 && subType !== 2 && subType !== 3 && (subType & 4096 ) !== 4096 )) { return null; } } else if (fieldType === 1 || fieldType === 2 || fieldType === 3 || (fieldType & 4096 ) === 4096 ) { property = _convertToProperty(path, name, value); } else if (fieldType === 4 ) { property = _convertToProperty(path, name, !!stringifyObjects ? JSON.stringify(value) : value); } if (property) { return _handleProperty(mapValue, path, name, fieldType, property, stringifyObjects); } } return null; }; _self.property = function (path, name, property, stringifyObjects) { var mapValue = _getFieldSanitizer(path, name); if (!mapValue || !mapValue.canHandle) { return null; } if (!isString(name) || isNullOrUndefined(property) || !isValueAssigned(property.value)) { return null; } var fieldType = getFieldValueType(property.value); if (fieldType === 0 ) { return null; } return _handleProperty(mapValue, path, name, fieldType, property, stringifyObjects); }; function _handleProperty(mapValue, path, name, fieldType, property, stringifyObjects) { if (mapValue.handler) { return mapValue.handler.property(path, name, property, stringifyObjects); } if (!isNullOrUndefined(property.kind)) { if ((fieldType & 4096 ) === 4096 || !isValueKind(property.kind)) { return null; } property.value = property.value.toString(); } return _callFieldSanitizer(mapValue.fieldHandler, path, name, fieldType, property); } function _convertToProperty(path, name, value) { if (isValueAssigned(value)) { return { value: value }; } return null; } function _callFieldSanitizer(fieldProvider, path, name, theType, property) { if (property && fieldProvider) { var sanitizer = fieldProvider.getSanitizer(path, name, theType, property.kind, property.propertyType); if (sanitizer) { if (theType === 4 ) { var newValue_1 = {}; var propValue = property.value; objForEachKey(propValue, function (propKey, theValue) { var newPath = path + "." + name; if (isValueAssigned(theValue)) { var newProp = _convertToProperty(newPath, propKey, theValue); newProp = _callFieldSanitizer(fieldProvider, newPath, propKey, getFieldValueType(theValue), newProp); if (newProp) { newValue_1[propKey] = newProp.value; } } }); property.value = newValue_1; } else { var details = { path: path, name: name, type: theType, prop: property, sanitizer: _self }; property = sanitizer.call(_self, details); } } } return property; } } ValueSanitizer.getFieldType = getFieldValueType; return ValueSanitizer; }()); exports.AppInsightsCore = AppInsightsCore$1; exports.BaseCore = BaseCore$1; exports.BaseTelemetryPlugin = BaseTelemetryPlugin; exports.CoreUtils = CoreUtils; exports.DiagnosticLogger = DiagnosticLogger; exports.ESPromise = ESPromise$1; exports.ESPromiseScheduler = ESPromiseScheduler$1; exports.EventHelper = EventHelper; exports.EventLatency = EventLatency; exports.EventPersistence = EventPersistence; exports.EventPropertyType = EventPropertyType; exports.EventsDiscardedReason = EventsDiscardedReason; exports.FullVersionString = FullVersionString; exports.InternalAppInsightsCore = AppInsightsCore$2; exports.InternalBaseCore = BaseCore$2; exports.LoggingSeverity = LoggingSeverity; exports.MinChannelPriorty = MinChannelPriorty; exports.NotificationManager = NotificationManager; exports.PerfEvent = PerfEvent; exports.PerfManager = PerfManager; exports.ProcessTelemetryContext = ProcessTelemetryContext; exports.TraceLevel = TraceLevel; exports.Undefined = strShimUndefined; exports.Utils = Utils; exports.ValueKind = ValueKind; exports.ValueSanitizer = ValueSanitizer; exports.Version = Version; exports._ExtendedInternalMessageId = _ExtendedInternalMessageId; exports._InternalLogMessage = _InternalLogMessage; exports._InternalMessageId = _InternalMessageId; exports.__getRegisteredEvents = __getRegisteredEvents; exports._throwInternal = _throwInternal; exports.addEventHandler = addEventHandler; exports.addEventListeners = addEventListeners; exports.addPageHideEventListener = addPageHideEventListener; exports.addPageShowEventListener = addPageShowEventListener; exports.addPageUnloadEventListener = addPageUnloadEventListener; exports.areCookiesSupported = areCookiesSupported; exports.arrForEach = arrForEach; exports.arrIndexOf = arrIndexOf; exports.arrMap = arrMap; exports.arrReduce = arrReduce; exports.attachEvent = attachEvent; exports.cookieAvailable = areCookiesSupported; exports.createCookieMgr = createCookieMgr; exports.createEnumStyle = createEnumStyle; exports.createGuid = createGuid; exports.createProcessTelemetryContext = createProcessTelemetryContext; exports.createUniqueNamespace = createUniqueNamespace; exports.createUnloadHandlerContainer = createUnloadHandlerContainer; exports.dateNow = dateNow; exports.deleteCookie = deleteCookie; exports.detachEvent = detachEvent; exports.disableCookies = disableCookies; exports.disallowsSameSiteNone = uaDisallowsSameSiteNone; exports.doPerf = doPerf; exports.dumpObj = dumpObj; exports.eventOff = eventOff; exports.eventOn = eventOn; exports.extend = extend; exports.generateW3CId = generateW3CId; exports.getCommonSchemaMetaData = getCommonSchemaMetaData; exports.getConsole = getConsole; exports.getCookie = getCookie; exports.getCookieValue = getCookieValue; exports.getCrypto = getCrypto; exports.getDocument = getDocument; exports.getExceptionName = getExceptionName; exports.getFieldValueType = getFieldValueType; exports.getGlobal = getGlobal; exports.getGlobalInst = getGlobalInst; exports.getHistory = getHistory; exports.getIEVersion = getIEVersion; exports.getISOString = toISOString; exports.getJSON = getJSON; exports.getLocation = getLocation; exports.getMsCrypto = getMsCrypto; exports.getNavigator = getNavigator; exports.getPerformance = getPerformance; exports.getSetValue = getSetValue; exports.getTenantId = getTenantId; exports.getTime = getTime; exports.getWindow = getWindow; exports.hasDocument = hasDocument; exports.hasHistory = hasHistory; exports.hasJSON = hasJSON; exports.hasNavigator = hasNavigator; exports.hasOwnProperty = hasOwnProperty; exports.hasWindow = hasWindow; exports.isArray = isArray; exports.isArrayValid = isArrayValid; exports.isBeaconsSupported = isBeaconsSupported; exports.isBoolean = isBoolean; exports.isChromium = isChromium; exports.isDate = isDate; exports.isDocumentObjectAvailable = isDocumentObjectAvailable; exports.isError = isError; exports.isFetchSupported = isFetchSupported; exports.isFunction = isFunction; exports.isIE = isIE; exports.isLatency = isLatency; exports.isNotTruthy = isNotTruthy; exports.isNullOrUndefined = isNullOrUndefined; exports.isNumber = isNumber; exports.isObject = isObject; exports.isReactNative = isReactNative; exports.isString = isString; exports.isTruthy = isTruthy; exports.isTypeof = isTypeof; exports.isUint8ArrayAvailable = isUint8ArrayAvailable; exports.isUndefined = isUndefined; exports.isValueAssigned = isValueAssigned; exports.isValueKind = isValueKind; exports.isWindowObjectAvailable = isWindowObjectAvailable; exports.isXhrSupported = isXhrSupported; exports.mergeEvtNamespace = mergeEvtNamespace; exports.newGuid = newGuid; exports.newId = newId; exports.normalizeJsName = normalizeJsName; exports.objCreate = objCreateFn; exports.objDefineAccessors = objDefineAccessors; exports.objForEachKey = objForEachKey; exports.objFreeze = objFreeze; exports.objKeys = objKeys; exports.objSeal = objSeal; exports.openXhr = openXhr; exports.optimizeObject = optimizeObject; exports.perfNow = perfNow; exports.proxyAssign = proxyAssign; exports.proxyFunctionAs = proxyFunctionAs; exports.proxyFunctions = proxyFunctions; exports.random32 = random32; exports.randomValue = randomValue; exports.removeEventHandler = removeEventHandler; exports.removeEventListeners = removeEventListeners; exports.removePageHideEventListener = removePageHideEventListener; exports.removePageShowEventListener = removePageShowEventListener; exports.removePageUnloadEventListener = removePageUnloadEventListener; exports.safeGetCookieMgr = safeGetCookieMgr; exports.safeGetLogger = safeGetLogger; exports.sanitizeProperty = sanitizeProperty; exports.setCookie = setCookie; exports.setEnableEnvMocks = setEnableEnvMocks; exports.setProcessTelemetryTimings = setProcessTelemetryTimings; exports.setValue = setValue; exports.strContains = strContains; exports.strEndsWith = strEndsWith; exports.strFunction = strShimFunction; exports.strObject = strShimObject; exports.strPrototype = strShimPrototype; exports.strStartsWith = strStartsWith; exports.strTrim = strTrim; exports.strUndefined = strShimUndefined; exports.throwError = throwError; exports.toISOString = toISOString; exports.useXDomainRequest = useXDomainRequest; (function(obj, prop, descriptor) { /* ai_es3_polyfil defineProperty */ var func = Object["defineProperty"]; if (func) { try { return func(obj, prop, descriptor); } catch(e) { /* IE8 defines defineProperty, but will throw */ } } if (descriptor && typeof descriptor.value !== undefined) { obj[prop] = descriptor.value; } return obj; })(exports, '__esModule', { value: true }); }));//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/1ds-core-js/bundle/ms.core.js.map /*! * 1DS JS SDK Core, 3.2.2 * Copyright (c) Microsoft and contributors. All rights reserved. * (Microsoft Internal Only) */ var n=this,e=function(n){"use strict";var I="function",u="object",e="undefined",f="prototype",P="hasOwnProperty",t=Object,E=t[f],N=t.assign,z=t.create,V=t.defineProperty,B=E[P],H=null;function K(n){return void 0===n&&(n=!0),H&&n||(typeof globalThis!==e&&globalThis&&(H=globalThis),typeof self!==e&&self&&(H=self),typeof window!==e&&window&&(H=window),typeof global!==e&&global&&(H=global)),H}function q(n){throw new TypeError(n)}function W(n){if(z)return z(n);if(null==n)return{};var e=typeof n;function t(){}return e!==u&&e!==I&&q("Object prototype may only be an Object:"+n),t[f]=n,new t}(K()||{}).Symbol,(K()||{}).Reflect;var G=N||function(n){for(var e,t=1,r=arguments.length;t=o.maxInternalMessageLimit()||(r=!0,t="AITR_"+e.messageId,a[t]?r=!1:a[t]=!0,r&&(n<=o.telemetryLoggingLevel()&&(o.queue.push(e),i++,u(1===n?"error":"warn",e)),i===o.maxInternalMessageLimit()&&(r=new wt(23,t="Internal events throttle limit per PageView reached for this app.",!1),o.queue.push(r),1===n?o.errorToConsole(t):o.warnToConsole(t))))}})};function j(n,e,t,r,i,o){void 0===o&&(o=!1),(n||new Pt).throwInternal(e,t,r,i,o)}l.ParentContextKey="parent",l.ChildrenContextKey="childEvts";var Et=l;function l(n,i,e){var t,o=this,u=!1;o.start=te(),o.name=n,o.isAsync=e,o.isChildEvt=function(){return!1},_(i)&&(u=ne(o,"payload",function(){return!t&&_(i)&&(t=i(),i=null),t})),o.getCtx=function(n){return n?(n===l.ParentContextKey||n===l.ChildrenContextKey?o:o.ctx||{})[n]:null},o.setCtx=function(n,e){n&&(n===l.ParentContextKey?(o[n]||(o.isChildEvt=function(){return!0}),o[n]=e):n===l.ChildrenContextKey?o[n]=e:(o.ctx=o.ctx||{})[n]=e)},o.complete=function(){var n=0,e=o.getCtx(l.ChildrenContextKey);if(m(e))for(var t=0;t>>=0),Ft=123456789+n&c,Ot=987654321-n&c,Mt=!0}function Dt(){try{var n=2147483647&te();Lt((Math.random()*_t^n)+n)}catch(e){}}function Ut(n){return 0>>0:0}function jt(n){var e=0,t=st()||ft();return 0===(e=t&&t.getRandomValues?t.getRandomValues(new Uint32Array(1))[0]&c:e)&>()&&(Mt||Dt(),e=Rt()&c),0===e&&(e=Math.floor(_t*Math.random()|0)),n||(e>>>=0),e}function Rt(n){var e=((Ot=36969*(65535&Ot)+(Ot>>16)&c)<<16)+(65535&(Ft=18e3*(65535&Ft)+(Ft>>16)&c))>>>0&c|0;return n||(e>>>=0),e}function zt(n){void 0===n&&(n=22);for(var e=jt()>>>0,t=0,r=g;r.length>>=6,5==++t&&(e=(jt()<<2&4294967295|3&e)>>>0,t=0);return r}var Vt=V,Bt="2.8.3",Ht="."+zt(6),Kt=0;function qt(n){return 1===n.nodeType||9===n.nodeType||!+n.nodeType}function Wt(n,e){return Vn(n+Kt+++((e=void 0!==e&&e)?"."+Bt:"")+Ht)}function Gt(n){var o={id:Wt("_aiData-"+(n||"")+"."+Bt),accept:qt,get:function(n,e,t,r){var i=n[o.id];return i?i[Vn(e)]:(r&&((i=function(n,e){var t=e[n.id];if(!t){t={};try{qt(e)&&!function(n,e,t){if(Vt)try{return Vt(n,e,{value:t,enumerable:!1,configurable:!0}),1}catch(r){}}(e,n.id,t)&&(e[n.id]=t)}catch(r){}}return t}(o,n))[Vn(e)]=t),t)},kill:function(n,e){if(n&&n[e])try{delete n[e]}catch(t){}}};return o}var Jt=Gt("plugin");function Xt(n){return Jt.get(n,"state",{},!0)}function Qt(t,r){for(var i,n=[],e=null,o=t.getNext();o;){var u=o.getPlugin();u&&(e&&_(e[Y])&&_(u[$])&&e[Y](u),(_(u[nn])?u[nn]():(i=Xt(u))[nn])||n.push(u),e=u,o=o.getNext())}M(n,function(n){var e=t.core();n.initialize(t.getCfg(),e,r,t.getNext()),i=Xt(n),n[d]||i[d]||(i[d]=e),i[nn]=!0,delete i[A]})}function $t(n){return n.sort(function(n,e){var t=0,r=_(e[$]);return _(n[$])?t=r?n[Z]-e[Z]:1:r&&(t=-1),t})}var Zt="TelemetryPluginChain",Yt="_hasRun",nr="_getTelCtx",er=0;function tr(n,u,t,e){var r=null,i=[],o=(null!==e&&(r=e?function(n,e,t){for(;n;){if(n.getPlugin()===t)return n;n=n.getNext()}return or([t],e.config||{},e)}(n,t,e):n),{_next:function(){var n,e=r;return r=e?e.getNext():null,e||(n=i)&&0_r&&l.push(n)}),Fr(c,l,t,a)),c)),w?(-1!==(d=F(v,w))&&v.splice(d,1),-1!==(d=F(b,w))&&b.splice(d,1),w._setQueue(I)):(s=I,f=m,g=!1,(d={identifier:"ChannelControllerPlugin",priority:_r,initialize:function(e,t,r,n){g=!0,M(s,function(n){n&&0>4&15]+e[n>>8&15]+e[n>>12&15]+e[n>>16&15]+e[n>>20&15]+e[n>>24&15]+e[n>>28&15];var i=e[8+(3&jt())|0];return t.substr(0,8)+t.substr(9,4)+"4"+t.substr(13,3)+i+t.substr(16,3)+t.substr(19,12)}var Mi=/[xy]/g,Fi={Attach:Si,AttachEvent:Si,Detach:bi,DetachEvent:bi},Oi=i({CRITICAL:1,WARNING:2}),Li=i({BrowserDoesNotSupportLocalStorage:0,BrowserCannotReadLocalStorage:1,BrowserCannotReadSessionStorage:2,BrowserCannotWriteLocalStorage:3,BrowserCannotWriteSessionStorage:4,BrowserFailedRemovalFromLocalStorage:5,BrowserFailedRemovalFromSessionStorage:6,CannotSendEmptyTelemetry:7,ClientPerformanceMathError:8,ErrorParsingAISessionCookie:9,ErrorPVCalc:10,ExceptionWhileLoggingError:11,FailedAddingTelemetryToBuffer:12,FailedMonitorAjaxAbort:13,FailedMonitorAjaxDur:14,FailedMonitorAjaxOpen:15,FailedMonitorAjaxRSC:16,FailedMonitorAjaxSend:17,FailedMonitorAjaxGetCorrelationHeader:18,FailedToAddHandlerForOnBeforeUnload:19,FailedToSendQueuedTelemetry:20,FailedToReportDataLoss:21,FlushFailed:22,MessageLimitPerPVExceeded:23,MissingRequiredFieldSpecification:24,NavigationTimingNotSupported:25,OnError:26,SessionRenewalDateIsZero:27,SenderNotInitialized:28,StartTrackEventFailed:29,StopTrackEventFailed:30,StartTrackFailed:31,StopTrackFailed:32,TelemetrySampledAndNotSent:33,TrackEventFailed:34,TrackExceptionFailed:35,TrackMetricFailed:36,TrackPVFailed:37,TrackPVFailedCalc:38,TrackTraceFailed:39,TransmissionFailed:40,FailedToSetStorageBuffer:41,FailedToRestoreStorageBuffer:42,InvalidBackendResponse:43,FailedToFixDepricatedValues:44,InvalidDurationValue:45,TelemetryEnvelopeInvalid:46,CreateEnvelopeError:47,CannotSerializeObject:48,CannotSerializeObjectNonSerializable:49,CircularReferenceDetected:50,ClearAuthContextFailed:51,ExceptionTruncated:52,IllegalCharsInName:53,ItemNotInArray:54,MaxAjaxPerPVExceeded:55,MessageTruncated:56,NameTooLong:57,SampleRateOutOfRange:58,SetAuthContextFailed:59,SetAuthContextFailedAccountName:60,StringValueTooLong:61,StartCalledMoreThanOnce:62,StopCalledWithoutStart:63,TelemetryInitializerFailed:64,TrackArgumentsNotSpecified:65,UrlTooLong:66,SessionStorageBufferFull:67,CannotAccessCookie:68,IdTooLong:69,InvalidEvent:70,FailedMonitorAjaxSetRequestHeader:71,SendBrowserInfoOnUserInit:72,PluginException:73,NotificationException:74,SnippetScriptLoadFailure:99,InvalidInstrumentationKey:100,CannotParseAiBlobValue:101,InvalidContentBlob:102,TrackPageActionEventFailed:103,FailedAddingCustomDefinedRequestContext:104,InMemoryStorageBufferFull:105}),Di=i({NotSet:0,Pii_DistinguishedName:1,Pii_GenericData:2,Pii_IPV4Address:3,Pii_IPv6Address:4,Pii_MailSubject:5,Pii_PhoneNumber:6,Pii_QueryString:7,Pii_SipAddress:8,Pii_SmtpAddress:9,Pii_Identity:10,Pii_Uri:11,Pii_Fqdn:12,Pii_IPV4AddressLegacy:13,CustomerContent_GenericContent:32}),Ui=i({Normal:1,CostDeferred:2,RealTime:3,Immediate:4}),ji=i({Unspecified:0,String:1,Int32:2,UInt32:3,Int64:4,UInt64:5,Double:6,Bool:7,Guid:8,DateTime:9}),Ri=i({Normal:1,Critical:2}),zi=i({NONE:0,ERROR:1,WARNING:2,INFORMATION:3}),G=O(G(G({},Li),i({AuthHandShakeError:501,AuthRedirectFail:502,BrowserCannotReadLocalStorage:503,BrowserCannotWriteLocalStorage:504,BrowserDoesNotSupportLocalStorage:505,CannotParseBiBlobValue:506,CannotParseDataAttribute:507,CVPluginNotAvailable:508,DroppedEvent:509,ErrorParsingAISessionCookie:510,ErrorProvidedChannels:511,FailedToGetCookies:512,FailedToInitializeCorrelationVector:513,FailedToInitializeSDK:514,InvalidContentBlob:515,InvalidCorrelationValue:516,SessionRenewalDateIsZero:517,SendPostOnCompleteFailure:518,PostResponseHandler:519,SDKNotInitialized:520}))),Vi="3.2.2",Bi="1DS-Web-JS-"+Vi,Hi="withCredentials",Ki=((s={})[0]=0,s[2]=6,s[1]=1,s[3]=7,s[4098]=6,s[4097]=1,s[4099]=7,s),qi=null,Wi=!!a(),s=!!nt();function Gi(n){return!(""===n||k(n))}function Ji(n){if(n){var e=n.indexOf("-");if(-1")+"."+wo;function y(n){var e=K();e&&e.QUnit&&console&&console.log("ESPromiseScheduler["+m+"] "+n)}function C(n){e&&e.warnToConsole("ESPromiseScheduler["+m+"] "+n)}wo++,U(No,this,function(n){var g=null,v=0;function p(n,e){for(var t=0;t=o&&!(n=r===i)){for(var u=0;u -1) { return apiKey.substring(0, indexTenantId); } } return ""; } function isUint8ArrayAvailable() { if (uInt8ArraySupported === null) { uInt8ArraySupported = !applicationinsightsCoreJs.isUndefined(Uint8Array) && !isSafariOrFirefox() && !applicationinsightsCoreJs.isReactNative(); } return uInt8ArraySupported; } function isLatency(value) { if (value && applicationinsightsCoreJs.isNumber(value) && value >= 1 && value <= 4 ) { return true; } return false; } function sanitizeProperty(name, property, stringifyObjects) { if ((!property && !isValueAssigned(property)) || typeof name !== "string") { return null; } var propType = typeof property; if (propType === "string" || propType === "number" || propType === "boolean" || applicationinsightsCoreJs.isArray(property)) { property = { value: property }; } else if (propType === "object" && !property.hasOwnProperty("value")) { property = { value: stringifyObjects ? JSON.stringify(property) : property }; } else if (applicationinsightsCoreJs.isNullOrUndefined(property.value) || property.value === "" || (!applicationinsightsCoreJs.isString(property.value) && !applicationinsightsCoreJs.isNumber(property.value) && !applicationinsightsCoreJs.isBoolean(property.value) && !applicationinsightsCoreJs.isArray(property.value))) { return null; } if (applicationinsightsCoreJs.isArray(property.value) && !isArrayValid(property.value)) { return null; } if (!applicationinsightsCoreJs.isNullOrUndefined(property.kind)) { if (applicationinsightsCoreJs.isArray(property.value) || !isValueKind(property.kind)) { return null; } property.value = property.value.toString(); } return property; } function getCommonSchemaMetaData(value, kind, type) { var encodedTypeValue = -1; if (!applicationinsightsCoreJs.isUndefined(value)) { if (kind > 0) { if (kind === 32) { encodedTypeValue = (1 << 13); } else if (kind <= 13) { encodedTypeValue = (kind << 5); } } if (isDataType(type)) { if (encodedTypeValue === -1) { encodedTypeValue = 0; } encodedTypeValue |= type; } else { var propType = _fieldTypeEventPropMap[getFieldValueType(value)] || -1; if (encodedTypeValue !== -1 && propType !== -1) { encodedTypeValue |= propType; } else if (propType === 6 ) { encodedTypeValue = propType; } } } return encodedTypeValue; } function disableCookies() { applicationinsightsCoreJs.safeGetCookieMgr(null).setEnabled(false); } function setCookie(name, value, days) { if (applicationinsightsCoreJs.areCookiesSupported(null)) { applicationinsightsCoreJs.safeGetCookieMgr(null).set(name, value, days * 86400, null, "/"); } } function deleteCookie(name) { if (applicationinsightsCoreJs.areCookiesSupported(null)) { applicationinsightsCoreJs.safeGetCookieMgr(null).del(name); } } function getCookie(name) { if (applicationinsightsCoreJs.areCookiesSupported(null)) { return getCookieValue(applicationinsightsCoreJs.safeGetCookieMgr(null), name); } return ""; } function getCookieValue(cookieMgr, name, decode) { if (decode === void 0) { decode = true; } var cookieValue; if (cookieMgr) { cookieValue = cookieMgr.get(name); if (decode && cookieValue && decodeURIComponent) { cookieValue = decodeURIComponent(cookieValue); } } return cookieValue || ""; } function createGuid(style) { if (style === void 0) { style = "D" ; } var theGuid = applicationinsightsCoreJs.newGuid(); if (style === "B" ) { theGuid = "{" + theGuid + "}"; } else if (style === "P" ) { theGuid = "(" + theGuid + ")"; } else if (style === "N" ) { theGuid = theGuid.replace(/-/g, ""); } return theGuid; } function extend(obj, obj2, obj3, obj4, obj5) { var extended = {}; var deep = false; var i = 0; var length = arguments.length; var objProto = Object[applicationinsightsCoreJs.strPrototype]; var theArgs = arguments; if (objProto.toString.call(theArgs[0]) === "[object Boolean]") { deep = theArgs[0]; i++; } for (; i < length; i++) { var obj = theArgs[i]; applicationinsightsCoreJs.objForEachKey(obj, function (prop, value) { if (deep && value && applicationinsightsCoreJs.isObject(value)) { if (applicationinsightsCoreJs.isArray(value)) { extended[prop] = extended[prop] || []; applicationinsightsCoreJs.arrForEach(value, function (arrayValue, arrayIndex) { if (arrayValue && applicationinsightsCoreJs.isObject(arrayValue)) { extended[prop][arrayIndex] = extend(true, extended[prop][arrayIndex], arrayValue); } else { extended[prop][arrayIndex] = arrayValue; } }); } else { extended[prop] = extend(true, extended[prop], value); } } else { extended[prop] = value; } }); } return extended; } var getTime = applicationinsightsCoreJs.perfNow; function isValueKind(value) { if (value === 0 || ((value > 0 && value <= 13 ) || value === 32 )) { return true; } return false; } function isDataType(value) { if (value >= 0 && value <= 9) { return true; } return false; } function isSafariOrFirefox() { var nav = applicationinsightsCoreJs.getNavigator(); if (!applicationinsightsCoreJs.isUndefined(nav) && nav.userAgent) { var ua = nav.userAgent.toLowerCase(); if ((ua.indexOf("safari") >= 0 || ua.indexOf("firefox") >= 0) && ua.indexOf("chrome") < 0) { return true; } } return false; } function isArrayValid(value) { return value.length > 0; } function setProcessTelemetryTimings(event, identifier) { var evt = event; evt.timings = evt.timings || {}; evt.timings.processTelemetryStart = evt.timings.processTelemetryStart || {}; evt.timings.processTelemetryStart[identifier] = getTime(); } function getFieldValueType(value) { var theType = 0 ; if (value !== null && value !== undefined) { var objType = typeof value; if (objType === "string") { theType = 1 ; } else if (objType === "number") { theType = 2 ; } else if (objType === "boolean") { theType = 3 ; } else if (objType === applicationinsightsShims.strShimObject) { theType = 4 ; if (applicationinsightsCoreJs.isArray(value)) { theType = 4096 ; if (value.length > 0) { theType |= getFieldValueType(value[0]); } } else if (applicationinsightsCoreJs.hasOwnProperty(value, "value")) { theType = 8192 | getFieldValueType(value.value); } } } return theType; } var Utils = { Version: Version, FullVersionString: FullVersionString, strUndefined: applicationinsightsCoreJs.strUndefined, strObject: applicationinsightsCoreJs.strObject, Undefined: applicationinsightsCoreJs.strUndefined, arrForEach: applicationinsightsCoreJs.arrForEach, arrIndexOf: applicationinsightsCoreJs.arrIndexOf, arrMap: applicationinsightsCoreJs.arrMap, arrReduce: applicationinsightsCoreJs.arrReduce, objKeys: applicationinsightsCoreJs.objKeys, toISOString: applicationinsightsCoreJs.toISOString, isReactNative: applicationinsightsCoreJs.isReactNative, isString: applicationinsightsCoreJs.isString, isNumber: applicationinsightsCoreJs.isNumber, isBoolean: applicationinsightsCoreJs.isBoolean, isFunction: applicationinsightsCoreJs.isFunction, isArray: applicationinsightsCoreJs.isArray, isObject: applicationinsightsCoreJs.isObject, strTrim: applicationinsightsCoreJs.strTrim, isDocumentObjectAvailable: isDocumentObjectAvailable, isWindowObjectAvailable: isWindowObjectAvailable, isValueAssigned: isValueAssigned, getTenantId: getTenantId, isBeaconsSupported: applicationinsightsCoreJs.isBeaconsSupported, isUint8ArrayAvailable: isUint8ArrayAvailable, isLatency: isLatency, sanitizeProperty: sanitizeProperty, getISOString: applicationinsightsCoreJs.toISOString, useXDomainRequest: applicationinsightsCoreJs.useXDomainRequest, getCommonSchemaMetaData: getCommonSchemaMetaData, cookieAvailable: applicationinsightsCoreJs.areCookiesSupported, disallowsSameSiteNone: applicationinsightsCoreJs.uaDisallowsSameSiteNone, setCookie: setCookie, deleteCookie: deleteCookie, getCookie: getCookie, createGuid: createGuid, extend: extend, getTime: getTime, isValueKind: isValueKind, isArrayValid: isArrayValid, objDefineAccessors: applicationinsightsCoreJs.objDefineAccessors, addPageUnloadEventListener: applicationinsightsCoreJs.addPageUnloadEventListener, setProcessTelemetryTimings: setProcessTelemetryTimings, addEventHandler: applicationinsightsCoreJs.addEventHandler, getFieldValueType: getFieldValueType, strEndsWith: applicationinsightsCoreJs.strEndsWith, objForEachKey: applicationinsightsCoreJs.objForEachKey }; var CoreUtils = { _canUseCookies: undefined, isTypeof: applicationinsightsCoreJs.isTypeof, isUndefined: applicationinsightsCoreJs.isUndefined, isNullOrUndefined: applicationinsightsCoreJs.isNullOrUndefined, hasOwnProperty: applicationinsightsCoreJs.hasOwnProperty, isFunction: applicationinsightsCoreJs.isFunction, isObject: applicationinsightsCoreJs.isObject, isDate: applicationinsightsCoreJs.isDate, isArray: applicationinsightsCoreJs.isArray, isError: applicationinsightsCoreJs.isError, isString: applicationinsightsCoreJs.isString, isNumber: applicationinsightsCoreJs.isNumber, isBoolean: applicationinsightsCoreJs.isBoolean, toISOString: applicationinsightsCoreJs.toISOString, arrForEach: applicationinsightsCoreJs.arrForEach, arrIndexOf: applicationinsightsCoreJs.arrIndexOf, arrMap: applicationinsightsCoreJs.arrMap, arrReduce: applicationinsightsCoreJs.arrReduce, strTrim: applicationinsightsCoreJs.strTrim, objCreate: applicationinsightsShims.objCreateFn, objKeys: applicationinsightsCoreJs.objKeys, objDefineAccessors: applicationinsightsCoreJs.objDefineAccessors, addEventHandler: applicationinsightsCoreJs.addEventHandler, dateNow: applicationinsightsCoreJs.dateNow, isIE: applicationinsightsCoreJs.isIE, disableCookies: disableCookies, newGuid: applicationinsightsCoreJs.newGuid, perfNow: applicationinsightsCoreJs.perfNow, newId: applicationinsightsCoreJs.newId, randomValue: applicationinsightsCoreJs.randomValue, random32: applicationinsightsCoreJs.random32, mwcRandomSeed: applicationinsightsCoreJs.mwcRandomSeed, mwcRandom32: applicationinsightsCoreJs.mwcRandom32, generateW3CId: applicationinsightsCoreJs.generateW3CId }; function isChromium() { return !!applicationinsightsCoreJs.getGlobalInst("chrome"); } function openXhr(method, urlString, withCredentials, disabled, isSync, timeout) { if (disabled === void 0) { disabled = false; } if (isSync === void 0) { isSync = false; } function _wrapSetXhrProp(xhr, prop, value) { try { xhr[prop] = value; } catch (e) { } } var xhr = new XMLHttpRequest(); if (disabled) { _wrapSetXhrProp(xhr, strDisabledPropertyName, disabled); } if (withCredentials) { _wrapSetXhrProp(xhr, strWithCredentials, withCredentials); } xhr.open(method, urlString, !isSync); if (withCredentials) { _wrapSetXhrProp(xhr, strWithCredentials, withCredentials); } if (!isSync && timeout) { _wrapSetXhrProp(xhr, strTimeout, timeout); } return xhr; } var PropVersion = "version"; var properties = "properties"; var AppInsightsCore = /** @class */ (function (_super) { applicationinsightsShims.__extendsFn(AppInsightsCore, _super); function AppInsightsCore() { var _this = _super.call(this) || this; _this.pluginVersionStringArr = []; _this.pluginVersionString = ""; dynamicProto__default(AppInsightsCore, _this, function (_self, _base) { if (!_self.logger || !_self.logger.queue) { _self.logger = new applicationinsightsCoreJs.DiagnosticLogger({ loggingLevelConsole: 1 }); } _self.initialize = function (config, extensions, logger, notificationManager) { applicationinsightsCoreJs.doPerf(_self, function () { return "AppInsightsCore.initialize"; }, function () { if (config) { if (!config.endpointUrl) { config.endpointUrl = "https://browser.events.data.microsoft.com/OneCollector/1.0/"; } var propertyStorageOverride = config.propertyStorageOverride; if (propertyStorageOverride && (!propertyStorageOverride.getProperty || !propertyStorageOverride.setProperty)) { throw new Error("Invalid property storage override passed."); } if (config.channels) { applicationinsightsCoreJs.arrForEach(config.channels, function (channels) { if (channels) { applicationinsightsCoreJs.arrForEach(channels, function (channel) { if (channel.identifier && channel.version) { var ver = channel.identifier + "=" + channel.version; _self.pluginVersionStringArr.push(ver); } }); } }); } } _self.getWParam = function () { return typeof document !== "undefined" ? 0 : -1; }; if (extensions) { applicationinsightsCoreJs.arrForEach(extensions, function (ext) { if (ext && ext.identifier && ext.version) { var ver = ext.identifier + "=" + ext.version; _self.pluginVersionStringArr.push(ver); } }); } _self.pluginVersionString = _self.pluginVersionStringArr.join(";"); try { _base.initialize(config, extensions, logger, notificationManager); _self.pollInternalLogs("InternalLog"); } catch (e) { var logger_1 = _self.logger; var message = applicationinsightsCoreJs.dumpObj(e); if (message.indexOf("channels") !== -1) { message += "\n - Channels must be provided through config.channels only!"; } logger_1.throwInternal(1 , 514 , "SDK Initialization Failed - no telemetry will be sent: " + message); } }, function () { return ({ config: config, extensions: extensions, logger: logger, notificationManager: notificationManager }); }); }; _self.track = function (item) { applicationinsightsCoreJs.doPerf(_self, function () { return "AppInsightsCore.track"; }, function () { var telemetryItem = item; if (telemetryItem) { telemetryItem.timings = telemetryItem.timings || {}; telemetryItem.timings.trackStart = getTime(); if (!isLatency(telemetryItem.latency)) { telemetryItem.latency = 1 ; } var itemExt = telemetryItem.ext = telemetryItem.ext || {}; itemExt.sdk = itemExt.sdk || {}; itemExt.sdk.ver = FullVersionString; var baseData = telemetryItem.baseData = telemetryItem.baseData || {}; if (!baseData[properties]) { baseData[properties] = {}; } var itemProperties = baseData[properties]; if (!itemProperties[PropVersion]) { itemProperties[PropVersion] = ""; } if (_self.pluginVersionString !== "") { itemProperties[PropVersion] = _self.pluginVersionString; } } _base.track(telemetryItem); }, function () { return ({ item: item }); }, !(item.sync)); }; }); return _this; } return AppInsightsCore; }(applicationinsightsCoreJs.AppInsightsCore)); var BaseCore = /** @class */ (function (_super) { applicationinsightsShims.__extendsFn(BaseCore, _super); function BaseCore() { var _this = _super.call(this) || this; dynamicProto__default(BaseCore, _this, function (_self, _base) { _self.initialize = function (config, extensions, logger, notificationManager) { if (config && !config.endpointUrl) { config.endpointUrl = "https://browser.events.data.microsoft.com/OneCollector/1.0/"; } _self.getWParam = function () { return isDocumentObjectAvailable ? 0 : -1; }; try { _base.initialize(config, extensions, logger, notificationManager); } catch (e) { applicationinsightsCoreJs._throwInternal(_self.logger, 1 , 514 , "Initialization Failed: " + applicationinsightsCoreJs.dumpObj(e) + "\n - Note: Channels must be provided through config.channels only"); } }; _self.track = function (item) { var telemetryItem = item; if (telemetryItem) { var ext = telemetryItem.ext = telemetryItem.ext || {}; ext.sdk = ext.sdk || {}; ext.sdk.ver = FullVersionString; } _base.track(telemetryItem); }; }); return _this; } return BaseCore; }(applicationinsightsCoreJs.BaseCore)); var _isFunction = applicationinsightsCoreJs.isFunction; function _createPromiseAllOnResolvedFunction(values, index, resolvedCallback) { return function (value) { values[index] = value; resolvedCallback(); }; } var ESPromise = /** @class */ (function () { function ESPromise(resolverFunc) { var _state = 0 ; var _settledValue = null; var _queue = []; dynamicProto__default(ESPromise, this, function (_this) { _this.then = function (onResolved, onRejected) { return new ESPromise(function (resolve, reject) { _enqueue(onResolved, onRejected, resolve, reject); }); }; _this["catch"] = function (onRejected) { return _this.then(null, onRejected); }; }); function _enqueue(onResolved, onRejected, resolve, reject) { _queue.push(function () { var value; try { if (_state === 1 ) { value = _isFunction(onResolved) ? onResolved(_settledValue) : _settledValue; } else { value = _isFunction(onRejected) ? onRejected(_settledValue) : _settledValue; } if (value instanceof ESPromise) { value.then(resolve, reject); } else if (_state === 2 && !_isFunction(onRejected)) { reject(value); } else { resolve(value); } } catch (error) { reject(error); return; } }); if (_state !== 0 ) { _processQueue(); } } function _processQueue() { if (_queue.length > 0) { var pending_1 = _queue.slice(); _queue = []; setTimeout(function () { for (var i = 0, len = pending_1.length; i < len; ++i) { try { pending_1[i](); } catch (e) { } } }, 0); } } function _resolve(value) { if (_state === 0 ) { _settledValue = value; _state = 1 ; _processQueue(); } } function _reject(reason) { if (_state === 0 ) { _settledValue = reason; _state = 2 ; _processQueue(); } } (function _initialize() { if (!_isFunction(resolverFunc)) { throw new TypeError("ESPromise: resolvedFunc argument is not a Function"); } try { resolverFunc(_resolve, _reject); } catch (error) { _reject(error); } })(); } ESPromise.resolve = function (value) { if (value instanceof ESPromise) { return value; } else if (value && _isFunction(value.then)) { return new ESPromise(function (resolve, reject) { try { value.then(resolve, reject); } catch (error) { reject(error); } }); } return new ESPromise(function (resolve) { resolve(value); }); }; ESPromise.reject = function (reason) { return new ESPromise(function (resolve, reject) { reject(reason); }); }; ESPromise.all = function (iterable) { if (!iterable || !iterable.length) { return; } return new ESPromise(function (resolve, reject) { try { var values_1 = []; var pending_2 = 0; for (var lp = 0; lp < iterable.length; lp++) { var item = iterable[lp]; if (item && _isFunction(item.then)) { pending_2++; item.then(_createPromiseAllOnResolvedFunction(values_1, lp, function () { if (--pending_2 === 0) { resolve(values_1); } }), reject); } else { values_1[lp] = item; } } if (pending_2 === 0) { setTimeout(function () { resolve(values_1); }, 0); } } catch (error) { reject(error); } }); }; ESPromise.race = function (iterable) { return new ESPromise(function (resolve, reject) { if (!iterable || !iterable.length) { return; } try { var _loop_1 = function (lp) { var item = iterable[lp]; if (item && _isFunction(item.then)) { item.then(resolve, reject); } else { setTimeout(function () { resolve(item); }, 0); } }; for (var lp = 0; lp < iterable.length; lp++) { _loop_1(lp); } } catch (error) { reject(error); } }); }; return ESPromise; }()); var LazyRejectPeriod = 600000; var _schedulerId = 0; var _running = []; var _waiting = []; var _timedOut = []; function _getTime() { return new Date().getTime(); } var ESPromiseScheduler = /** @class */ (function () { function ESPromiseScheduler(name, diagLog) { var _promiseId = 0; var _scheduledName = (name || "") + "." + _schedulerId; _schedulerId++; dynamicProto__default(ESPromiseScheduler, this, function (_this) { var _lastEvent = null; var _eventCount = 0; _this.scheduleEvent = function (startEventAction, eventName, timeout) { var uniqueId = _scheduledName + "." + _eventCount; _eventCount++; if (eventName) { uniqueId += "-(" + eventName + ")"; } var uniqueEventId = uniqueId + "{" + _promiseId + "}"; _promiseId++; var newScheduledEvent = { evt: null, tm: _getTime(), id: uniqueEventId, isRunning: false, isAborted: false }; if (!_lastEvent) { newScheduledEvent.evt = _startWaitingEvent(newScheduledEvent); } else { newScheduledEvent.evt = _waitForPreviousEvent(newScheduledEvent, _lastEvent); } _lastEvent = newScheduledEvent; _lastEvent.evt._schId = uniqueEventId; return newScheduledEvent.evt; function _abortAndRemoveOldEvents(eventQueue) { var now = _getTime(); var expired = now - LazyRejectPeriod; var len = eventQueue.length; var lp = 0; while (lp < len) { var evt = eventQueue[lp]; if (evt && evt.tm < expired) { var message = null; if (evt.abort) { message = "Aborting [" + evt.id + "] due to Excessive runtime (" + (now - evt.tm) + " ms)"; evt.abort(message); } else { message = "Removing [" + evt.id + "] due to Excessive runtime (" + (now - evt.tm) + " ms)"; } _warnLog(message); eventQueue.splice(lp, 1); len--; } else { lp++; } } } function _cleanup(eventId, completed) { var toQueue = false; var removed = _removeQueuedEvent(_running, eventId); if (!removed) { removed = _removeQueuedEvent(_timedOut, eventId); toQueue = true; } if (removed) { if (removed.to) { clearTimeout(removed.to); removed.to = null; } var tm = _getTime() - removed.tm; if (completed) { if (!toQueue) { _debugLog("Promise [" + eventId + "] Complete -- " + tm + " ms"); } else { _warnLog("Timed out event [" + eventId + "] finally complete -- " + tm + " ms"); } } else { _timedOut.push(removed); _warnLog("Event [" + eventId + "] Timed out and removed -- " + tm + " ms"); } } else { _debugLog("Failed to remove [" + eventId + "] from running queue"); } if (_lastEvent && _lastEvent.id === eventId) { _lastEvent = null; } _abortAndRemoveOldEvents(_running); _abortAndRemoveOldEvents(_waiting); _abortAndRemoveOldEvents(_timedOut); } function _removeScheduledEvent(eventId, callback) { return function (value) { _cleanup(eventId, true); callback && callback(value); return value; }; } function _waitForFinalResult(eventId, startResult, schEventResolve, schEventReject) { startResult.then(function (value) { if (value instanceof ESPromise) { _debugLog("Event [" + eventId + "] returned a promise -- waiting"); _waitForFinalResult(eventId, value, schEventResolve, schEventReject); return value; } else { return _removeScheduledEvent(eventId, schEventResolve)(value); } }, _removeScheduledEvent(eventId, schEventReject)); } function _createScheduledEvent(eventDetails, startEvent) { var eventId = eventDetails.id; return new ESPromise(function (schEventResolve, schEventReject) { _debugLog("Event [" + eventId + "] Starting -- waited for " + (eventDetails.wTm || "--") + " ms"); eventDetails.isRunning = true; eventDetails.abort = function (message) { eventDetails.abort = null; eventDetails.isAborted = true; _cleanup(eventId, false); schEventReject(new Error(message)); }; var startResult = startEvent(eventId); if (startResult instanceof ESPromise) { if (timeout) { eventDetails.to = setTimeout(function () { _cleanup(eventId, false); schEventReject(new Error("Timed out after [" + timeout + "] ms")); }, timeout); } _waitForFinalResult(eventId, startResult, function (theResult) { _debugLog("Event [" + eventId + "] Resolving after " + (_getTime() - eventDetails.tm) + " ms"); schEventResolve(theResult); }, schEventReject); } else { _debugLog("Promise [" + eventId + "] Auto completed as the start action did not return a promise"); schEventResolve(); } }); } function _startWaitingEvent(eventDetails) { var now = _getTime(); eventDetails.wTm = now - eventDetails.tm; eventDetails.tm = now; if (eventDetails.isAborted) { return ESPromise.reject(new Error("[" + uniqueId + "] was aborted")); } _running.push(eventDetails); return _createScheduledEvent(eventDetails, startEventAction); } function _waitForPreviousEvent(eventDetails, waitForEvent) { var waitEvent = new ESPromise(function (waitResolve, waitReject) { var runTime = _getTime() - waitForEvent.tm; var prevId = waitForEvent.id; _debugLog("[" + uniqueId + "] is waiting for [" + prevId + ":" + runTime + " ms] to complete before starting -- [" + _waiting.length + "] waiting and [" + _running.length + "] running"); eventDetails.abort = function (message) { eventDetails.abort = null; _removeQueuedEvent(_waiting, uniqueId); eventDetails.isAborted = true; waitReject(new Error(message)); }; waitForEvent.evt.then(function (value) { _removeQueuedEvent(_waiting, uniqueId); _startWaitingEvent(eventDetails).then(waitResolve, waitReject); }, function (reason) { _removeQueuedEvent(_waiting, uniqueId); _startWaitingEvent(eventDetails).then(waitResolve, waitReject); }); }); _waiting.push(eventDetails); return waitEvent; } }; function _removeQueuedEvent(queue, eventId) { for (var lp = 0; lp < queue.length; lp++) { if (queue[lp].id === eventId) { return queue.splice(lp, 1)[0]; } } return null; } }); function _debugLog(message) { var global = applicationinsightsCoreJs.getGlobal(); if (global && global["QUnit"]) { console && console.log("ESPromiseScheduler[" + _scheduledName + "] " + message); } } function _warnLog(message) { diagLog && diagLog.warnToConsole("ESPromiseScheduler[" + _scheduledName + "] " + message); } } ESPromiseScheduler.incomplete = function () { return _running; }; ESPromiseScheduler.waitingToStart = function () { return _waiting; }; return ESPromiseScheduler; }()); var ValueSanitizer = /** @class */ (function () { function ValueSanitizer(fieldSanitizerProvider) { var _self = this; var _sanitizerMap = {}; var _sanitizers = []; var _fieldSanitizers = []; if (fieldSanitizerProvider) { _fieldSanitizers.push(fieldSanitizerProvider); } function _getFieldSanitizer(path, name) { var result; var fieldLookup = _sanitizerMap[path]; if (fieldLookup) { result = fieldLookup[name]; } if (!result && result !== null) { if (applicationinsightsCoreJs.isString(path) && applicationinsightsCoreJs.isString(name)) { if (_fieldSanitizers.length > 0) { for (var lp = 0; lp < _fieldSanitizers.length; lp++) { if (_fieldSanitizers[lp].handleField(path, name)) { result = { canHandle: true, fieldHandler: _fieldSanitizers[lp] }; break; } } } else if (_sanitizers.length === 0) { result = { canHandle: true }; } } if (!result && result !== null) { result = null; for (var lp = 0; lp < _sanitizers.length; lp++) { if (_sanitizers[lp].handleField(path, name)) { result = { canHandle: true, handler: _sanitizers[lp], fieldHandler: null }; break; } } } if (!fieldLookup) { fieldLookup = _sanitizerMap[path] = {}; } fieldLookup[name] = result; } return result; } _self.addSanitizer = function (newSanitizer) { if (newSanitizer) { _sanitizers.push(newSanitizer); _sanitizerMap = {}; } }; _self.addFieldSanitizer = function (fieldSanitizer) { if (fieldSanitizer) { _fieldSanitizers.push(fieldSanitizer); _sanitizerMap = {}; } }; _self.handleField = function (path, name) { var mapValue = _getFieldSanitizer(path, name); return mapValue ? mapValue.canHandle : false; }; _self.value = function (path, name, value, stringifyObjects) { var mapValue = _getFieldSanitizer(path, name); if (mapValue && mapValue.canHandle) { if (!mapValue || !mapValue.canHandle) { return null; } if (mapValue.handler) { return mapValue.handler.value(path, name, value, stringifyObjects); } if (!applicationinsightsCoreJs.isString(name) || applicationinsightsCoreJs.isNullOrUndefined(value) || value === "") { return null; } var property = null; var fieldType = getFieldValueType(value); if ((fieldType & 8192 ) === 8192 ) { var subType = fieldType & ~8192 ; property = value; if (!isValueAssigned(property.value) || (subType !== 1 && subType !== 2 && subType !== 3 && (subType & 4096 ) !== 4096 )) { return null; } } else if (fieldType === 1 || fieldType === 2 || fieldType === 3 || (fieldType & 4096 ) === 4096 ) { property = _convertToProperty(path, name, value); } else if (fieldType === 4 ) { property = _convertToProperty(path, name, !!stringifyObjects ? JSON.stringify(value) : value); } if (property) { return _handleProperty(mapValue, path, name, fieldType, property, stringifyObjects); } } return null; }; _self.property = function (path, name, property, stringifyObjects) { var mapValue = _getFieldSanitizer(path, name); if (!mapValue || !mapValue.canHandle) { return null; } if (!applicationinsightsCoreJs.isString(name) || applicationinsightsCoreJs.isNullOrUndefined(property) || !isValueAssigned(property.value)) { return null; } var fieldType = getFieldValueType(property.value); if (fieldType === 0 ) { return null; } return _handleProperty(mapValue, path, name, fieldType, property, stringifyObjects); }; function _handleProperty(mapValue, path, name, fieldType, property, stringifyObjects) { if (mapValue.handler) { return mapValue.handler.property(path, name, property, stringifyObjects); } if (!applicationinsightsCoreJs.isNullOrUndefined(property.kind)) { if ((fieldType & 4096 ) === 4096 || !isValueKind(property.kind)) { return null; } property.value = property.value.toString(); } return _callFieldSanitizer(mapValue.fieldHandler, path, name, fieldType, property); } function _convertToProperty(path, name, value) { if (isValueAssigned(value)) { return { value: value }; } return null; } function _callFieldSanitizer(fieldProvider, path, name, theType, property) { if (property && fieldProvider) { var sanitizer = fieldProvider.getSanitizer(path, name, theType, property.kind, property.propertyType); if (sanitizer) { if (theType === 4 ) { var newValue_1 = {}; var propValue = property.value; applicationinsightsCoreJs.objForEachKey(propValue, function (propKey, theValue) { var newPath = path + "." + name; if (isValueAssigned(theValue)) { var newProp = _convertToProperty(newPath, propKey, theValue); newProp = _callFieldSanitizer(fieldProvider, newPath, propKey, getFieldValueType(theValue), newProp); if (newProp) { newValue_1[propKey] = newProp.value; } } }); property.value = newValue_1; } else { var details = { path: path, name: name, type: theType, prop: property, sanitizer: _self }; property = sanitizer.call(_self, details); } } } return property; } } ValueSanitizer.getFieldType = getFieldValueType; return ValueSanitizer; }()); exports.BaseTelemetryPlugin = applicationinsightsCoreJs.BaseTelemetryPlugin; exports.DiagnosticLogger = applicationinsightsCoreJs.DiagnosticLogger; exports.EventHelper = applicationinsightsCoreJs.EventHelper; exports.EventsDiscardedReason = applicationinsightsCoreJs.EventsDiscardedReason; exports.InternalAppInsightsCore = applicationinsightsCoreJs.AppInsightsCore; exports.InternalBaseCore = applicationinsightsCoreJs.BaseCore; exports.LoggingSeverity = applicationinsightsCoreJs.LoggingSeverity; exports.MinChannelPriorty = applicationinsightsCoreJs.MinChannelPriorty; exports.NotificationManager = applicationinsightsCoreJs.NotificationManager; exports.PerfEvent = applicationinsightsCoreJs.PerfEvent; exports.PerfManager = applicationinsightsCoreJs.PerfManager; exports.ProcessTelemetryContext = applicationinsightsCoreJs.ProcessTelemetryContext; exports.Undefined = applicationinsightsCoreJs.strUndefined; exports._InternalLogMessage = applicationinsightsCoreJs._InternalLogMessage; exports._InternalMessageId = applicationinsightsCoreJs._InternalMessageId; exports.__getRegisteredEvents = applicationinsightsCoreJs.__getRegisteredEvents; exports._throwInternal = applicationinsightsCoreJs._throwInternal; exports.addEventHandler = applicationinsightsCoreJs.addEventHandler; exports.addEventListeners = applicationinsightsCoreJs.addEventListeners; exports.addPageHideEventListener = applicationinsightsCoreJs.addPageHideEventListener; exports.addPageShowEventListener = applicationinsightsCoreJs.addPageShowEventListener; exports.addPageUnloadEventListener = applicationinsightsCoreJs.addPageUnloadEventListener; exports.areCookiesSupported = applicationinsightsCoreJs.areCookiesSupported; exports.arrForEach = applicationinsightsCoreJs.arrForEach; exports.arrIndexOf = applicationinsightsCoreJs.arrIndexOf; exports.arrMap = applicationinsightsCoreJs.arrMap; exports.arrReduce = applicationinsightsCoreJs.arrReduce; exports.attachEvent = applicationinsightsCoreJs.attachEvent; exports.cookieAvailable = applicationinsightsCoreJs.areCookiesSupported; exports.createCookieMgr = applicationinsightsCoreJs.createCookieMgr; exports.createEnumStyle = applicationinsightsCoreJs.createEnumStyle; exports.createProcessTelemetryContext = applicationinsightsCoreJs.createProcessTelemetryContext; exports.createUniqueNamespace = applicationinsightsCoreJs.createUniqueNamespace; exports.createUnloadHandlerContainer = applicationinsightsCoreJs.createUnloadHandlerContainer; exports.dateNow = applicationinsightsCoreJs.dateNow; exports.detachEvent = applicationinsightsCoreJs.detachEvent; exports.disallowsSameSiteNone = applicationinsightsCoreJs.uaDisallowsSameSiteNone; exports.doPerf = applicationinsightsCoreJs.doPerf; exports.dumpObj = applicationinsightsCoreJs.dumpObj; exports.eventOff = applicationinsightsCoreJs.eventOff; exports.eventOn = applicationinsightsCoreJs.eventOn; exports.generateW3CId = applicationinsightsCoreJs.generateW3CId; exports.getConsole = applicationinsightsCoreJs.getConsole; exports.getCrypto = applicationinsightsCoreJs.getCrypto; exports.getDocument = applicationinsightsCoreJs.getDocument; exports.getExceptionName = applicationinsightsCoreJs.getExceptionName; exports.getGlobal = applicationinsightsCoreJs.getGlobal; exports.getGlobalInst = applicationinsightsCoreJs.getGlobalInst; exports.getHistory = applicationinsightsCoreJs.getHistory; exports.getIEVersion = applicationinsightsCoreJs.getIEVersion; exports.getISOString = applicationinsightsCoreJs.toISOString; exports.getJSON = applicationinsightsCoreJs.getJSON; exports.getLocation = applicationinsightsCoreJs.getLocation; exports.getMsCrypto = applicationinsightsCoreJs.getMsCrypto; exports.getNavigator = applicationinsightsCoreJs.getNavigator; exports.getPerformance = applicationinsightsCoreJs.getPerformance; exports.getSetValue = applicationinsightsCoreJs.getSetValue; exports.getWindow = applicationinsightsCoreJs.getWindow; exports.hasDocument = applicationinsightsCoreJs.hasDocument; exports.hasHistory = applicationinsightsCoreJs.hasHistory; exports.hasJSON = applicationinsightsCoreJs.hasJSON; exports.hasNavigator = applicationinsightsCoreJs.hasNavigator; exports.hasOwnProperty = applicationinsightsCoreJs.hasOwnProperty; exports.hasWindow = applicationinsightsCoreJs.hasWindow; exports.isArray = applicationinsightsCoreJs.isArray; exports.isBeaconsSupported = applicationinsightsCoreJs.isBeaconsSupported; exports.isBoolean = applicationinsightsCoreJs.isBoolean; exports.isDate = applicationinsightsCoreJs.isDate; exports.isError = applicationinsightsCoreJs.isError; exports.isFetchSupported = applicationinsightsCoreJs.isFetchSupported; exports.isFunction = applicationinsightsCoreJs.isFunction; exports.isIE = applicationinsightsCoreJs.isIE; exports.isNotTruthy = applicationinsightsCoreJs.isNotTruthy; exports.isNullOrUndefined = applicationinsightsCoreJs.isNullOrUndefined; exports.isNumber = applicationinsightsCoreJs.isNumber; exports.isObject = applicationinsightsCoreJs.isObject; exports.isReactNative = applicationinsightsCoreJs.isReactNative; exports.isString = applicationinsightsCoreJs.isString; exports.isTruthy = applicationinsightsCoreJs.isTruthy; exports.isTypeof = applicationinsightsCoreJs.isTypeof; exports.isUndefined = applicationinsightsCoreJs.isUndefined; exports.isXhrSupported = applicationinsightsCoreJs.isXhrSupported; exports.mergeEvtNamespace = applicationinsightsCoreJs.mergeEvtNamespace; exports.newGuid = applicationinsightsCoreJs.newGuid; exports.newId = applicationinsightsCoreJs.newId; exports.normalizeJsName = applicationinsightsCoreJs.normalizeJsName; exports.objCreate = applicationinsightsCoreJs.objCreate; exports.objDefineAccessors = applicationinsightsCoreJs.objDefineAccessors; exports.objForEachKey = applicationinsightsCoreJs.objForEachKey; exports.objFreeze = applicationinsightsCoreJs.objFreeze; exports.objKeys = applicationinsightsCoreJs.objKeys; exports.objSeal = applicationinsightsCoreJs.objSeal; exports.optimizeObject = applicationinsightsCoreJs.optimizeObject; exports.perfNow = applicationinsightsCoreJs.perfNow; exports.proxyAssign = applicationinsightsCoreJs.proxyAssign; exports.proxyFunctionAs = applicationinsightsCoreJs.proxyFunctionAs; exports.proxyFunctions = applicationinsightsCoreJs.proxyFunctions; exports.random32 = applicationinsightsCoreJs.random32; exports.randomValue = applicationinsightsCoreJs.randomValue; exports.removeEventHandler = applicationinsightsCoreJs.removeEventHandler; exports.removeEventListeners = applicationinsightsCoreJs.removeEventListeners; exports.removePageHideEventListener = applicationinsightsCoreJs.removePageHideEventListener; exports.removePageShowEventListener = applicationinsightsCoreJs.removePageShowEventListener; exports.removePageUnloadEventListener = applicationinsightsCoreJs.removePageUnloadEventListener; exports.safeGetCookieMgr = applicationinsightsCoreJs.safeGetCookieMgr; exports.safeGetLogger = applicationinsightsCoreJs.safeGetLogger; exports.setEnableEnvMocks = applicationinsightsCoreJs.setEnableEnvMocks; exports.setValue = applicationinsightsCoreJs.setValue; exports.strContains = applicationinsightsCoreJs.strContains; exports.strEndsWith = applicationinsightsCoreJs.strEndsWith; exports.strFunction = applicationinsightsCoreJs.strFunction; exports.strObject = applicationinsightsCoreJs.strObject; exports.strPrototype = applicationinsightsCoreJs.strPrototype; exports.strStartsWith = applicationinsightsCoreJs.strStartsWith; exports.strTrim = applicationinsightsCoreJs.strTrim; exports.strUndefined = applicationinsightsCoreJs.strUndefined; exports.throwError = applicationinsightsCoreJs.throwError; exports.toISOString = applicationinsightsCoreJs.toISOString; exports.useXDomainRequest = applicationinsightsCoreJs.useXDomainRequest; exports.AppInsightsCore = AppInsightsCore; exports.BaseCore = BaseCore; exports.CoreUtils = CoreUtils; exports.ESPromise = ESPromise; exports.ESPromiseScheduler = ESPromiseScheduler; exports.EventLatency = EventLatency; exports.EventPersistence = EventPersistence; exports.EventPropertyType = EventPropertyType; exports.FullVersionString = FullVersionString; exports.TraceLevel = TraceLevel; exports.Utils = Utils; exports.ValueKind = ValueKind; exports.ValueSanitizer = ValueSanitizer; exports.Version = Version; exports._ExtendedInternalMessageId = _ExtendedInternalMessageId; exports.createGuid = createGuid; exports.deleteCookie = deleteCookie; exports.disableCookies = disableCookies; exports.extend = extend; exports.getCommonSchemaMetaData = getCommonSchemaMetaData; exports.getCookie = getCookie; exports.getCookieValue = getCookieValue; exports.getFieldValueType = getFieldValueType; exports.getTenantId = getTenantId; exports.getTime = getTime; exports.isArrayValid = isArrayValid; exports.isChromium = isChromium; exports.isDocumentObjectAvailable = isDocumentObjectAvailable; exports.isLatency = isLatency; exports.isUint8ArrayAvailable = isUint8ArrayAvailable; exports.isValueAssigned = isValueAssigned; exports.isValueKind = isValueKind; exports.isWindowObjectAvailable = isWindowObjectAvailable; exports.openXhr = openXhr; exports.sanitizeProperty = sanitizeProperty; exports.setCookie = setCookie; exports.setProcessTelemetryTimings = setProcessTelemetryTimings; (function(obj, prop, descriptor) { /* ai_es3_polyfil defineProperty */ var func = Object["defineProperty"]; if (func) { try { return func(obj, prop, descriptor); } catch(e) { /* IE8 defines defineProperty, but will throw */ } } if (descriptor && typeof descriptor.value !== undefined) { obj[prop] = descriptor.value; } return obj; })(exports, '__esModule', { value: true }); }));//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/1ds-core-js/dist/ms.core.js.map /*! * 1DS JS SDK Core, 3.2.2 * Copyright (c) Microsoft and contributors. All rights reserved. * (Microsoft Internal Only) */ var e=this,n=function(e,r,f,n){"use strict";function _(e){return e&&"object"==typeof e&&"default"in e?e["default"]:e}var o=_(n),n=f.createEnumStyle({NotSet:0,Pii_DistinguishedName:1,Pii_GenericData:2,Pii_IPV4Address:3,Pii_IPv6Address:4,Pii_MailSubject:5,Pii_PhoneNumber:6,Pii_QueryString:7,Pii_SipAddress:8,Pii_SmtpAddress:9,Pii_Identity:10,Pii_Uri:11,Pii_Fqdn:12,Pii_IPV4AddressLegacy:13,CustomerContent_GenericContent:32}),x=f.createEnumStyle({Normal:1,CostDeferred:2,RealTime:3,Immediate:4}),R=f.createEnumStyle({Unspecified:0,String:1,Int32:2,UInt32:3,Int64:4,UInt64:5,Double:6,Bool:7,Guid:8,DateTime:9}),V=f.createEnumStyle({Normal:1,Critical:2}),M=f.createEnumStyle({NONE:0,ERROR:1,WARNING:2,INFORMATION:3}),H=f.objFreeze(r.__assignFn(r.__assignFn({},f._InternalMessageId),f.createEnumStyle({AuthHandShakeError:501,AuthRedirectFail:502,BrowserCannotReadLocalStorage:503,BrowserCannotWriteLocalStorage:504,BrowserDoesNotSupportLocalStorage:505,CannotParseBiBlobValue:506,CannotParseDataAttribute:507,CVPluginNotAvailable:508,DroppedEvent:509,ErrorParsingAISessionCookie:510,ErrorProvidedChannels:511,FailedToGetCookies:512,FailedToInitializeCorrelationVector:513,FailedToInitializeSDK:514,InvalidContentBlob:515,InvalidCorrelationValue:516,SessionRenewalDateIsZero:517,SendPostOnCompleteFailure:518,PostResponseHandler:519,SDKNotInitialized:520}))),t="3.2.2",i="1DS-Web-JS-"+t,l="withCredentials",B=((u={})[0]=0,u[2]=6,u[1]=1,u[3]=7,u[4098]=6,u[4097]=1,u[4099]=7,u),a=null,s=!!f.getDocument(),u=!!f.getWindow();function g(e){return!(""===e||f.isNullOrUndefined(e))}function G(e){if(e){var n=e.indexOf("-");if(-1")+"."+ne;function y(e){var n=f.getGlobal();n&&n.QUnit&&console&&console.log("ESPromiseScheduler["+h+"] "+e)}function S(e){n&&n.warnToConsole("ESPromiseScheduler["+h+"] "+e)}ne++,o(L,this,function(e){var g=null,m=0;function v(e,n){for(var t=0;t 0) { // The onFulfilled and onRejected handlers must be called asynchronously. Thus, // we make a copy of the queue and work on it once the current call stack unwinds. var pending_1 = _queue.slice(); _queue = []; setTimeout(function () { for (var i = 0, len = pending_1.length; i < len; ++i) { try { pending_1[i](); } catch (e) { // Don't let 1 failing handler break all others // TODO (newylie): Add some form of error reporting (i.e. Call any registered JS error handler so the error is reported) } } }, 0); } } function _resolve(value) { if (_state === 0 /* Pending */) { _settledValue = value; _state = 1 /* Resolved */; _processQueue(); } } function _reject(reason) { if (_state === 0 /* Pending */) { _settledValue = reason; _state = 2 /* Rejected */; _processQueue(); } } (function _initialize() { if (!_isFunction(resolverFunc)) { throw new TypeError("ESPromise: resolvedFunc argument is not a Function"); } try { resolverFunc(_resolve, _reject); } catch (error) { // This promise will immediately reject if any exception is thrown // from within the executor function. _reject(error); } })(); } /** * The Promise.resolve() method returns a Promise object that is resolved with a given value. If the value is a promise, that promise is returned; * if the value is a thenable (i.e. has a "then" method), the returned promise will "follow" that thenable, adopting its eventual state; otherwise * the returned promise will be fulfilled with the value. This function flattens nested layers of promise-like objects (e.g. a promise that resolves * to a promise that resolves to something) into a single layer. * @param value Argument to be resolved by this Promise. Can also be a Promise or a thenable to resolve. */ ESPromise.resolve = function (value) { if (value instanceof ESPromise) { // Value is a Promise so just return it return value; } else if (value && _isFunction(value.then)) { // Value looks like a promise or thenable (has a then function) return new ESPromise(function (resolve, reject) { try { value.then(resolve, reject); } catch (error) { reject(error); } }); } return new ESPromise(function (resolve) { resolve(value); }); }; /** * The Promise.reject() method returns a Promise object that is rejected with a given reason. * @param reason The reason why this Promise rejected. */ ESPromise.reject = function (reason) { return new ESPromise(function (resolve, reject) { reject(reason); }); }; /** * The Promise.all() method returns a single Promise that resolves when all of the promises passed as an iterable * have resolved or when the iterable contains no promises. It rejects with the reason of the first promise that * rejects. There is no implied ordering in the execution of the array of Promises given. On some computers, they * may be executed in parallel, or in some sense concurrently, while on others they may be executed serially. For * this reason, there must be no dependency in any Promise on the order of execution of the Promises. * This method can be useful for aggregating the results of multiple promises. * FulfillmentSection - The returned promise is fulfilled with an array containing all the values of the iterable * passed as argument (also non-promise values). * If an empty iterable is passed, then this method returns (synchronously) an already resolved promise. * If all of the passed-in promises fulfill, or are not promises, the promise returned by Promise.all is fulfilled * asynchronously. * RejectionSection - If any of the passed-in promises reject, Promise.all asynchronously rejects with the value of * the promise that rejected, whether or not the other promises have resolved. * @param iterable */ ESPromise.all = function (iterable) { if (!iterable || !iterable.length) { return; } return new ESPromise(function (resolve, reject) { try { var values_1 = []; var pending_2 = 0; for (var lp = 0; lp < iterable.length; lp++) { var item = iterable[lp]; // Quick and direct check for a Promise (will also catch a thenable) if (item && _isFunction(item.then)) { pending_2++; item.then(_createPromiseAllOnResolvedFunction(values_1, lp, function () { if (--pending_2 === 0) { resolve(values_1); } }), reject); } else { values_1[lp] = item; } } if (pending_2 === 0) { // All promises were either resolved or where not a promise setTimeout(function () { resolve(values_1); }, 0); } } catch (error) { reject(error); } }); }; /** * The race function returns a Promise that is settled the same way (and takes the same value) as the first promise * that settles amongst the promises of the iterable passed as an argument. * If the iterable passed is empty, the promise returned will be forever pending. * If the iterable contains one or more non-promise value and/or an already settled promise, then Promise.race will * resolve to the first of these values found in the iterable. * @param iterable */ ESPromise.race = function (iterable) { return new ESPromise(function (resolve, reject) { if (!iterable || !iterable.length) { return; } try { var _loop_1 = function (lp) { var item = iterable[lp]; // Quick and direct check for a Promise (will also catch a thenable) if (item && _isFunction(item.then)) { item.then(resolve, reject); } else { setTimeout(function () { resolve(item); }, 0); } }; for (var lp = 0; lp < iterable.length; lp++) { _loop_1(lp); } } catch (error) { reject(error); } }); }; // Removed Stub for ESPromise.prototype.then. // Removed Stub for ESPromise.prototype["catch"]. return ESPromise; }()); export default ESPromise; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/1ds-core-js/dist-esm/src/ESPromise.js.map/* * 1DS JS SDK Core, 3.2.2 * Copyright (c) Microsoft and contributors. All rights reserved. * (Microsoft Internal Only) */ /** * ESPromiseScheduler.ts * @author Nev Wylie (newylie) * @copyright Microsoft 2019 */ import ESPromise from "./ESPromise"; import { getGlobal } from "@microsoft/applicationinsights-core-js"; import dynamicProto from "@microsoft/dynamicproto-js"; /** This is a default timeout that will cause outstanding running promises to be removed/rejected to avoid filling up memory with blocked events */ var LazyRejectPeriod = 600000; // 10 Minutes // These are global variables that are shared across ALL instances of the scheduler /** * @ignore */ var _schedulerId = 0; /** * @ignore */ var _running = []; /** * @ignore */ var _waiting = []; /** * @ignore */ var _timedOut = []; /** * @ignore */ function _getTime() { return new Date().getTime(); } /** * Provides a simple mechanism queueing mechanism for scheduling events based on the ESPromise callbacks, this is used to ensure * order of async operations that are required to be executed in a specific order. */ var ESPromiseScheduler = /** @class */ (function () { function ESPromiseScheduler(name, diagLog) { var _promiseId = 0; var _scheduledName = (name || "") + "." + _schedulerId; _schedulerId++; dynamicProto(ESPromiseScheduler, this, function (_this) { var _lastEvent = null; var _eventCount = 0; _this.scheduleEvent = function (startEventAction, eventName, timeout) { var uniqueId = _scheduledName + "." + _eventCount; _eventCount++; if (eventName) { uniqueId += "-(" + eventName + ")"; } var uniqueEventId = uniqueId + "{" + _promiseId + "}"; _promiseId++; // Create the next scheduled event details var newScheduledEvent = { evt: null, tm: _getTime(), id: uniqueEventId, isRunning: false, isAborted: false }; if (!_lastEvent) { // We don't have any currently running event, so just start the next event newScheduledEvent.evt = _startWaitingEvent(newScheduledEvent); } else { // Start a new promise which will wait until all current active events are complete before starting // the new event, it does not resolve this scheduled event until after the new event is resolve to // ensure that all scheduled events are completed in the correct order newScheduledEvent.evt = _waitForPreviousEvent(newScheduledEvent, _lastEvent); } // Set this new event as the last one, so that any future events will wait for this one _lastEvent = newScheduledEvent; _lastEvent.evt._schId = uniqueEventId; return newScheduledEvent.evt; function _abortAndRemoveOldEvents(eventQueue) { var now = _getTime(); var expired = now - LazyRejectPeriod; var len = eventQueue.length; var lp = 0; while (lp < len) { var evt = eventQueue[lp]; if (evt && evt.tm < expired) { var message = null; if (evt.abort) { message = "Aborting [" + evt.id + "] due to Excessive runtime (" + (now - evt.tm) + " ms)"; evt.abort(message); } else { message = "Removing [" + evt.id + "] due to Excessive runtime (" + (now - evt.tm) + " ms)"; } _warnLog(message); eventQueue.splice(lp, 1); len--; } else { lp++; } } } function _cleanup(eventId, completed) { var toQueue = false; var removed = _removeQueuedEvent(_running, eventId); if (!removed) { removed = _removeQueuedEvent(_timedOut, eventId); toQueue = true; } if (removed) { if (removed.to) { // If there was a timeout stop it clearTimeout(removed.to); removed.to = null; } // TODO (newylie): Convert this into reportable metrics var tm = _getTime() - removed.tm; if (completed) { if (!toQueue) { _debugLog("Promise [" + eventId + "] Complete -- " + tm + " ms"); } else { _warnLog("Timed out event [" + eventId + "] finally complete -- " + tm + " ms"); } } else { _timedOut.push(removed); _warnLog("Event [" + eventId + "] Timed out and removed -- " + tm + " ms"); } } else { _debugLog("Failed to remove [" + eventId + "] from running queue"); } // Also if the last scheduled event was this event then clear it as we are now finished if (_lastEvent && _lastEvent.id === eventId) { _lastEvent = null; } _abortAndRemoveOldEvents(_running); _abortAndRemoveOldEvents(_waiting); _abortAndRemoveOldEvents(_timedOut); } // Return a callback function that will be called when the waiting promise is resolved or rejected to ensure // that any outer promise is also resolved or rejected function _removeScheduledEvent(eventId, callback) { return function (value) { _cleanup(eventId, true); callback && callback(value); return value; }; } function _waitForFinalResult(eventId, startResult, schEventResolve, schEventReject) { startResult.then(function (value) { if (value instanceof ESPromise) { // If the result is a promise then this appears to be a chained result, so wait for this promise to complete _debugLog("Event [" + eventId + "] returned a promise -- waiting"); _waitForFinalResult(eventId, value, schEventResolve, schEventReject); return value; } else { return _removeScheduledEvent(eventId, schEventResolve)(value); } }, _removeScheduledEvent(eventId, schEventReject)); } // Add the passed event to the active event list with resolve and reject callbacks that will remove // it from the active event list function _createScheduledEvent(eventDetails, startEvent) { var eventId = eventDetails.id; return new ESPromise(function (schEventResolve, schEventReject) { _debugLog("Event [" + eventId + "] Starting -- waited for " + (eventDetails.wTm || "--") + " ms"); eventDetails.isRunning = true; eventDetails.abort = function (message) { eventDetails.abort = null; eventDetails.isAborted = true; _cleanup(eventId, false); schEventReject(new Error(message)); }; var startResult = startEvent(eventId); if (startResult instanceof ESPromise) { if (timeout) { // Note: Only starting a timer if a timeout was specified eventDetails.to = setTimeout(function () { _cleanup(eventId, false); // Cause the listeners to reject (Note: We can't actually reject the waiting event) schEventReject(new Error("Timed out after [" + timeout + "] ms")); }, timeout); } _waitForFinalResult(eventId, startResult, function (theResult) { _debugLog("Event [" + eventId + "] Resolving after " + (_getTime() - eventDetails.tm) + " ms"); schEventResolve(theResult); }, schEventReject); } else { // The startEvent didn't return a promise so just return a resolved promise _debugLog("Promise [" + eventId + "] Auto completed as the start action did not return a promise"); schEventResolve(); } }); } function _startWaitingEvent(eventDetails) { var now = _getTime(); eventDetails.wTm = now - eventDetails.tm; eventDetails.tm = now; if (eventDetails.isAborted) { return ESPromise.reject(new Error("[" + uniqueId + "] was aborted")); } _running.push(eventDetails); return _createScheduledEvent(eventDetails, startEventAction); } // Start a new promise which will wait until all current active events are complete before starting // the new event, it does not resolve this scheduled event until after the new event is resolve to // ensure that all scheduled events are completed in the correct order function _waitForPreviousEvent(eventDetails, waitForEvent) { var waitEvent = new ESPromise(function (waitResolve, waitReject) { var runTime = _getTime() - waitForEvent.tm; var prevId = waitForEvent.id; _debugLog("[" + uniqueId + "] is waiting for [" + prevId + ":" + runTime + " ms] to complete before starting -- [" + _waiting.length + "] waiting and [" + _running.length + "] running"); eventDetails.abort = function (message) { eventDetails.abort = null; _removeQueuedEvent(_waiting, uniqueId); eventDetails.isAborted = true; waitReject(new Error(message)); }; // Wait for the previous event to complete waitForEvent.evt.then(function (value) { _removeQueuedEvent(_waiting, uniqueId); // Wait for the last event to complete before starting the new one, this ensures the execution // order so that we don't try and remove events that havn't been committed yet _startWaitingEvent(eventDetails).then(waitResolve, waitReject); }, function (reason) { _removeQueuedEvent(_waiting, uniqueId); // Wait for the last event to complete before starting the new one, this ensures the execution // order so that we don't try and remove events that havn't been committed yet _startWaitingEvent(eventDetails).then(waitResolve, waitReject); }); }); _waiting.push(eventDetails); return waitEvent; } }; function _removeQueuedEvent(queue, eventId) { for (var lp = 0; lp < queue.length; lp++) { if (queue[lp].id === eventId) { return queue.splice(lp, 1)[0]; } } return null; } }); function _debugLog(message) { // Only log if running within test harness var global = getGlobal(); if (global && global["QUnit"]) { // tslint:disable-next-line:no-console console && console.log("ESPromiseScheduler[" + _scheduledName + "] " + message); } } function _warnLog(message) { diagLog && diagLog.warnToConsole("ESPromiseScheduler[" + _scheduledName + "] " + message); } } ESPromiseScheduler.incomplete = function () { return _running; }; ESPromiseScheduler.waitingToStart = function () { return _waiting; }; // Removed Stub for ESPromiseScheduler.prototype.scheduleEvent. return ESPromiseScheduler; }()); export default ESPromiseScheduler; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/1ds-core-js/dist-esm/src/ESPromiseScheduler.js.map/* * 1DS JS SDK Core, 3.2.2 * Copyright (c) Microsoft and contributors. All rights reserved. * (Microsoft Internal Only) */ /** * Index.ts * @author Abhilash Panwar (abpanwar) * @copyright Microsoft 2018 * File to export public classes, interfaces and enums. */ import { ValueKind, EventLatency, EventPersistence, TraceLevel, EventPropertyType, _ExtendedInternalMessageId } from "./Enums"; import AppInsightsCore from "./AppInsightsCore"; import BaseCore from "./BaseCore"; import ESPromise from "./ESPromise"; import ESPromiseScheduler from "./ESPromiseScheduler"; import { ValueSanitizer } from "./ValueSanitizer"; export { ValueKind, EventLatency, EventPersistence, TraceLevel, AppInsightsCore, BaseCore, _ExtendedInternalMessageId, EventPropertyType, ESPromise, ESPromiseScheduler, ValueSanitizer }; export { NotificationManager, BaseTelemetryPlugin, ProcessTelemetryContext, MinChannelPriorty, EventsDiscardedReason, DiagnosticLogger, LoggingSeverity, PerfEvent, PerfManager, doPerf, EventHelper, AppInsightsCore as InternalAppInsightsCore, BaseCore as InternalBaseCore, _InternalLogMessage, _InternalMessageId, createEnumStyle, _throwInternal, // _warnToConsole, _logInternalMessage // The HelperFuncs functions isTypeof, isUndefined, isNullOrUndefined, hasOwnProperty, isObject, isFunction, attachEvent, detachEvent, normalizeJsName, objForEachKey, strStartsWith, strEndsWith, strContains, strTrim, isDate, isArray, isError, isString, isNumber, isBoolean, toISOString, arrForEach, arrIndexOf, arrMap, arrReduce, objKeys, objDefineAccessors, dateNow, getExceptionName, throwError, setValue, getSetValue, isNotTruthy, isTruthy, proxyAssign, proxyFunctions, proxyFunctionAs, optimizeObject, objCreate, addEventHandler, newGuid, perfNow, newId, generateW3CId, safeGetLogger, objFreeze, objSeal, // EnvUtils getGlobal, getGlobalInst, hasWindow, getWindow, hasDocument, getDocument, getCrypto, getMsCrypto, hasNavigator, getNavigator, hasHistory, getHistory, getLocation, getPerformance, hasJSON, getJSON, isReactNative, getConsole, dumpObj, isIE, getIEVersion, strUndefined, strObject, strPrototype, strFunction, setEnableEnvMocks, strUndefined as Undefined, // Random randomValue, random32, uaDisallowsSameSiteNone as disallowsSameSiteNone, areCookiesSupported, areCookiesSupported as cookieAvailable, createCookieMgr, safeGetCookieMgr, // Aliases toISOString as getISOString, isBeaconsSupported, isFetchSupported, isXhrSupported, useXDomainRequest, addPageHideEventListener, addPageShowEventListener, addEventListeners, addPageUnloadEventListener, removeEventHandler, removeEventListeners, removePageUnloadEventListener, removePageHideEventListener, removePageShowEventListener, eventOn, eventOff, mergeEvtNamespace, createUniqueNamespace, __getRegisteredEvents, createProcessTelemetryContext, createUnloadHandlerContainer } from "@microsoft/applicationinsights-core-js"; export { isValueAssigned, isLatency, isUint8ArrayAvailable, getTenantId, sanitizeProperty, Version, FullVersionString, getCommonSchemaMetaData, getCookie, setCookie, deleteCookie, getCookieValue, extend, createGuid, isDocumentObjectAvailable, isWindowObjectAvailable, setProcessTelemetryTimings, getTime, isArrayValid, isValueKind, getFieldValueType, CoreUtils, disableCookies, // exporting the overridden version for tree-shaking Utils, // Replacement for import * as Utils from "./Utils"; isChromium, // Replace with ai-core version once published in ai-core openXhr } from "./Utils"; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/1ds-core-js/dist-esm/src/Index.js.map/* * 1DS JS SDK Core, 3.2.2 * Copyright (c) Microsoft and contributors. All rights reserved. * (Microsoft Internal Only) */ var _a; /** * Utils.ts * @author Abhilash Panwar (abpanwar) Hector Hernandez (hectorh) * @copyright Microsoft 2018 * File containing utility functions. */ import { objCreateFn, strShimObject } from "@microsoft/applicationinsights-shims"; import { getDocument, getNavigator, getWindow, getGlobalInst, objForEachKey, isUndefined, isNullOrUndefined, isNumber, isReactNative, isString, isBoolean, isArray, newGuid, isObject, perfNow, hasOwnProperty, addEventHandler, uaDisallowsSameSiteNone, strPrototype, objDefineAccessors, toISOString, strTrim, isFunction, objKeys, arrReduce, arrMap, arrIndexOf, arrForEach, strUndefined, strObject, areCookiesSupported, safeGetCookieMgr, generateW3CId, mwcRandom32, mwcRandomSeed, random32, randomValue, newId, isIE, dateNow, isError, isDate, isTypeof, strEndsWith, useXDomainRequest, isBeaconsSupported, addPageUnloadEventListener, } from "@microsoft/applicationinsights-core-js"; export var Version = '3.2.2'; export var FullVersionString = "1DS-Web-JS-" + Version; // Defining here so we don't need to take (import) the ApplicationInsights Common module var strDisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation"; var strWithCredentials = "withCredentials"; var strTimeout = "timeout"; // If value is array just get the type for the first element var _fieldTypeEventPropMap = (_a = {}, _a[0 /* NotSet */] = 0 /* Unspecified */, _a[2 /* Number */] = 6 /* Double */, _a[1 /* String */] = 1 /* String */, _a[3 /* Boolean */] = 7 /* Bool */, _a[4096 /* Array */ | 2 /* Number */] = 6 /* Double */, _a[4096 /* Array */ | 1 /* String */] = 1 /* String */, _a[4096 /* Array */ | 3 /* Boolean */] = 7 /* Bool */, _a); /** * @ignore */ // let _uaDisallowsSameSiteNone = null; var uInt8ArraySupported = null; // var _areCookiesAvailable: boolean | undefined; /** * Checks if document object is available */ export var isDocumentObjectAvailable = Boolean(getDocument()); /** * Checks if window object is available */ export var isWindowObjectAvailable = Boolean(getWindow()); /** * Checks if value is assigned to the given param. * @param value - The token from which the tenant id is to be extracted. * @returns True/false denoting if value is assigned to the param. */ export function isValueAssigned(value) { /// takes a value and checks for undefined, null and empty string /// value to be tested /// true if value is null undefined or emptyString return !(value === "" || isNullOrUndefined(value)); } /** * Gets the tenant id from the tenant token. * @param apiKey - The token from which the tenant id is to be extracted. * @returns The tenant id. */ export function getTenantId(apiKey) { if (apiKey) { var indexTenantId = apiKey.indexOf("-"); if (indexTenantId > -1) { return apiKey.substring(0, indexTenantId); } } return ""; } /** * Checks if Uint8Array are available in the current environment. Safari and Firefox along with * ReactNative are known to not support Uint8Array properly. * @returns True if available, false otherwise. */ export function isUint8ArrayAvailable() { if (uInt8ArraySupported === null) { uInt8ArraySupported = !isUndefined(Uint8Array) && !isSafariOrFirefox() && !isReactNative(); } return uInt8ArraySupported; } /** * Checks if the value is a valid EventLatency. * @param value - The value that needs to be checked. * @returns True if the value is in AWTEventLatency, false otherwise. */ export function isLatency(value) { if (value && isNumber(value) && value >= 1 /* Normal */ && value <= 4 /* Immediate */) { return true; } return false; } /** * Sanitizes the Property. It checks the that the property name and value are valid. It also * checks/populates the correct type and pii of the property value. * @param name - property name - The property name. * @param property - The property value or an IEventProperty containing value, * type ,pii and customer content. * @returns IEventProperty containing valid name, value, pii and type or null if invalid. */ export function sanitizeProperty(name, property, stringifyObjects) { // Check that property is valid if ((!property && !isValueAssigned(property)) || typeof name !== "string") { return null; } // Perf optimization -- only need to get the type once not multiple times var propType = typeof property; // If the property isn't IEventProperty (and is either string, number, boolean or array), convert it into one. if (propType === "string" || propType === "number" || propType === "boolean" || isArray(property)) { property = { value: property }; } else if (propType === "object" && !property.hasOwnProperty("value")) { property = { value: stringifyObjects ? JSON.stringify(property) : property }; } else if (isNullOrUndefined(property.value) || property.value === "" || (!isString(property.value) && !isNumber(property.value) && !isBoolean(property.value) && !isArray(property.value))) { // Since property is IEventProperty, we need to validate its value return null; } // We need to check that if the property value is an array, it is valid if (isArray(property.value) && !isArrayValid(property.value)) { return null; } // If either pii or cc is set convert value to string (since only string pii/cc is allowed). // If the value is a complex type like an array that can't be converted to string we will drop // the property. if (!isNullOrUndefined(property.kind)) { if (isArray(property.value) || !isValueKind(property.kind)) { return null; } property.value = property.value.toString(); } return property; } export function getCommonSchemaMetaData(value, kind, type) { var encodedTypeValue = -1; if (!isUndefined(value)) { if (kind > 0) { if (kind === 32) { // encode customer content. Value can only be string. bit 13-16 are for cc encodedTypeValue = (1 << 13); } else if (kind <= 13) { // encode PII. Value can only be string. bits 5-12 are for Pii encodedTypeValue = (kind << 5); } } // isDataType checks that the "type" is a number so we don't need to check for undefined if (isDataType(type)) { // Data Type is provided and valid, so use that if (encodedTypeValue === -1) { // Don't return -1 encodedTypeValue = 0; } encodedTypeValue |= type; } else { var propType = _fieldTypeEventPropMap[getFieldValueType(value)] || -1; if (encodedTypeValue !== -1 && propType !== -1) { // pii exists so we must return correct type encodedTypeValue |= propType; } else if (propType === 6 /* Double */) { encodedTypeValue = propType; } } } return encodedTypeValue; } /** * @deprecated - Use the core.getCookieMgr().disable() * Force the SDK not to store and read any data from cookies. * Overriding the applicationinsights-core version for tree-shaking */ export function disableCookies() { safeGetCookieMgr(null).setEnabled(false); } /** * @deprecated - Use the oneDs.getCookieMgr().set() * Sets the value of a cookie. * @param name - Cookie name. * @param value - Cookie value. * @param days - Expiration days. */ export function setCookie(name, value, days) { if (areCookiesSupported(null)) { safeGetCookieMgr(null).set(name, value, days * 86400, null, "/"); } } /** * @deprecated - Use the oneDs.getCookieMgr().del() * Deletes a cookie, by setting its expiration to -1. * @param name - Cookie name to delete. */ export function deleteCookie(name) { if (areCookiesSupported(null)) { safeGetCookieMgr(null).del(name); } } /** * @deprecated - Use the oneDs.getCookieMgr().get() * Gets the cookie value for the specified cookie. * if value is k1=v1&k2==v2 then will return 'v1' for key 'k1' * @param cookieName - Cookie name. */ export function getCookie(name) { if (areCookiesSupported(null)) { return getCookieValue(safeGetCookieMgr(null), name); } return ""; } /** * Helper to get and decode the cookie value using decodeURIComponent, this is for historical * backward compatibility where the document.cookie value was decoded before parsing. * @param cookieMgr - The cookie manager to use * @param name - The name of the cookie to get * @param decode - A flag to indicate whether the cookie value should be decoded * @returns The decoded cookie value (if available) otherwise an empty string. */ export function getCookieValue(cookieMgr, name, decode) { if (decode === void 0) { decode = true; } var cookieValue; if (cookieMgr) { cookieValue = cookieMgr.get(name); if (decode && cookieValue && decodeURIComponent) { cookieValue = decodeURIComponent(cookieValue); } } return cookieValue || ""; } /** * Create a new guid. * @param style - The style of guid to generated, defaults to Digits * Digits (Default) : 32 digits separated by hyphens: 00000000-0000-0000-0000-000000000000 * Braces - 32 digits separated by hyphens, enclosed in braces: {00000000-0000-0000-0000-000000000000} * Parentheses - 32 digits separated by hyphens, enclosed in parentheses: (00000000-0000-0000-0000-000000000000) * Numeric - 32 digits: 00000000000000000000000000000000 * @returns The formatted guid. */ export function createGuid(style) { if (style === void 0) { style = "D" /* Digits */; } var theGuid = newGuid(); if (style === "B" /* Braces */) { theGuid = "{" + theGuid + "}"; } else if (style === "P" /* Parentheses */) { theGuid = "(" + theGuid + ")"; } else if (style === "N" /* Numeric */) { theGuid = theGuid.replace(/-/g, ""); } return theGuid; } /** * Pass in the objects to merge as arguments. * @param obj1 - object to merge. Set this argument to 'true' for a deep extend. * @param obj2 - object to merge. * @param obj3 - object to merge. * @param obj4 - object to merge. * @param obj5 - object to merge. * @returns The extended object. */ export function extend(obj, obj2, obj3, obj4, obj5) { // Variables var extended = {}; var deep = false; var i = 0; var length = arguments.length; var objProto = Object[strPrototype]; var theArgs = arguments; // Check if a deep merge if (objProto.toString.call(theArgs[0]) === "[object Boolean]") { deep = theArgs[0]; i++; } // Loop through each object and conduct a merge for (; i < length; i++) { var obj = theArgs[i]; objForEachKey(obj, function (prop, value) { // If deep merge and property is an object, merge properties if (deep && value && isObject(value)) { if (isArray(value)) { extended[prop] = extended[prop] || []; arrForEach(value, function (arrayValue, arrayIndex) { if (arrayValue && isObject(arrayValue)) { extended[prop][arrayIndex] = extend(true, extended[prop][arrayIndex], arrayValue); } else { extended[prop][arrayIndex] = arrayValue; } }); } else { extended[prop] = extend(true, extended[prop], value); } } else { extended[prop] = value; } }); } return extended; } export var getTime = perfNow; export function isValueKind(value) { // Always assume that it's a number (no type checking) for performance as this is used during the JSON serialization if (value === 0 /* NotSet */ || ((value > 0 /* NotSet */ && value <= 13 /* Pii_IPV4AddressLegacy */) || value === 32 /* CustomerContent_GenericContent */)) { return true; } return false; } function isDataType(value) { // Remark: 0 returns false, but it doesn't affect encoding anyways // Always assume that it's a number (no type checking) for performance as this is used during the JSON serialization if (value >= 0 && value <= 9) { return true; } return false; } function isSafariOrFirefox() { var nav = getNavigator(); // If non-browser navigator will be undefined if (!isUndefined(nav) && nav.userAgent) { var ua = nav.userAgent.toLowerCase(); if ((ua.indexOf("safari") >= 0 || ua.indexOf("firefox") >= 0) && ua.indexOf("chrome") < 0) { return true; } } return false; } export function isArrayValid(value) { return value.length > 0; } export function setProcessTelemetryTimings(event, identifier) { var evt = event; evt.timings = evt.timings || {}; evt.timings.processTelemetryStart = evt.timings.processTelemetryStart || {}; evt.timings.processTelemetryStart[identifier] = getTime(); } /** * Returns a bitwise value for the FieldValueSanitizerType enum representing the decoded type of the passed value * @param value The value to determine the type */ export function getFieldValueType(value) { var theType = 0 /* NotSet */; if (value !== null && value !== undefined) { var objType = typeof value; if (objType === "string") { theType = 1 /* String */; } else if (objType === "number") { theType = 2 /* Number */; } else if (objType === "boolean") { theType = 3 /* Boolean */; } else if (objType === strShimObject) { theType = 4 /* Object */; if (isArray(value)) { theType = 4096 /* Array */; if (value.length > 0) { // Empty arrays are not supported and are considered to be the same as null theType |= getFieldValueType(value[0]); } } else if (hasOwnProperty(value, "value")) { // Looks like an IEventProperty theType = 8192 /* EventProperty */ | getFieldValueType(value.value); } } } return theType; } export var Utils = { Version: Version, FullVersionString: FullVersionString, strUndefined: strUndefined, strObject: strObject, Undefined: strUndefined, arrForEach: arrForEach, arrIndexOf: arrIndexOf, arrMap: arrMap, arrReduce: arrReduce, objKeys: objKeys, toISOString: toISOString, isReactNative: isReactNative, isString: isString, isNumber: isNumber, isBoolean: isBoolean, isFunction: isFunction, isArray: isArray, isObject: isObject, strTrim: strTrim, isDocumentObjectAvailable: isDocumentObjectAvailable, isWindowObjectAvailable: isWindowObjectAvailable, isValueAssigned: isValueAssigned, getTenantId: getTenantId, isBeaconsSupported: isBeaconsSupported, isUint8ArrayAvailable: isUint8ArrayAvailable, isLatency: isLatency, sanitizeProperty: sanitizeProperty, getISOString: toISOString, useXDomainRequest: useXDomainRequest, getCommonSchemaMetaData: getCommonSchemaMetaData, cookieAvailable: areCookiesSupported, disallowsSameSiteNone: uaDisallowsSameSiteNone, setCookie: setCookie, deleteCookie: deleteCookie, getCookie: getCookie, createGuid: createGuid, extend: extend, getTime: getTime, isValueKind: isValueKind, isArrayValid: isArrayValid, objDefineAccessors: objDefineAccessors, addPageUnloadEventListener: addPageUnloadEventListener, setProcessTelemetryTimings: setProcessTelemetryTimings, addEventHandler: addEventHandler, getFieldValueType: getFieldValueType, strEndsWith: strEndsWith, objForEachKey: objForEachKey }; /** * Provides a collection of utility functions, included for backward compatibility with previous releases. * @deprecated Marking this instance as deprecated in favor of direct usage of the helper functions * as direct usage provides better tree-shaking and minification by avoiding the inclusion of the unused items * in your resulting code. * Overriding the applicationinsights-core version for tree-shaking */ export var CoreUtils = { _canUseCookies: undefined, isTypeof: isTypeof, isUndefined: isUndefined, isNullOrUndefined: isNullOrUndefined, hasOwnProperty: hasOwnProperty, isFunction: isFunction, isObject: isObject, isDate: isDate, isArray: isArray, isError: isError, isString: isString, isNumber: isNumber, isBoolean: isBoolean, toISOString: toISOString, arrForEach: arrForEach, arrIndexOf: arrIndexOf, arrMap: arrMap, arrReduce: arrReduce, strTrim: strTrim, objCreate: objCreateFn, objKeys: objKeys, objDefineAccessors: objDefineAccessors, addEventHandler: addEventHandler, dateNow: dateNow, isIE: isIE, disableCookies: disableCookies, newGuid: newGuid, perfNow: perfNow, newId: newId, randomValue: randomValue, random32: random32, mwcRandomSeed: mwcRandomSeed, mwcRandom32: mwcRandom32, generateW3CId: generateW3CId }; /** * Helper to identify whether we are running in a chromium based browser environment */ export function isChromium() { return !!getGlobalInst("chrome"); } /** * Create and open an XMLHttpRequest object * @param method - The request method * @param urlString - The url * @param withCredentials - Option flag indicating that credentials should be sent * @param disabled - Optional flag indicating that the XHR object should be marked as disabled and not tracked (default is false) * @param isSync - Optional flag indicating if the instance should be a synchronous request (defaults to false) * @param timeout - Optional value identifying the timeout value that should be assigned to the XHR request * @returns A new opened XHR request */ export function openXhr(method, urlString, withCredentials, disabled, isSync, timeout) { if (disabled === void 0) { disabled = false; } if (isSync === void 0) { isSync = false; } function _wrapSetXhrProp(xhr, prop, value) { try { xhr[prop] = value; } catch (e) { // - Wrapping as depending on the environment setting the property may fail (non-terminally) } } var xhr = new XMLHttpRequest(); if (disabled) { // Tag the instance so it's not tracked (trackDependency) // If the environment has locked down the XMLHttpRequest (preventExtensions and/or freeze), this would // cause the request to fail and we no telemetry would be sent _wrapSetXhrProp(xhr, strDisabledPropertyName, disabled); } if (withCredentials) { // Some libraries require that the withCredentials flag is set "before" open and // - Wrapping as IE 10 has started throwing when setting before open _wrapSetXhrProp(xhr, strWithCredentials, withCredentials); } xhr.open(method, urlString, !isSync); if (withCredentials) { // withCredentials should be set AFTER open (https://xhr.spec.whatwg.org/#the-withcredentials-attribute) // And older firefox instances from 11+ will throw for sync events (current versions don't) which happens during unload processing _wrapSetXhrProp(xhr, strWithCredentials, withCredentials); } // Only set the timeout for asynchronous requests as // "Timeout shouldn't be used for synchronous XMLHttpRequests requests used in a document environment or it will throw an InvalidAccessError exception."" // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/timeout if (!isSync && timeout) { _wrapSetXhrProp(xhr, strTimeout, timeout); } return xhr; } //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/1ds-core-js/dist-esm/src/Utils.js.map/* * 1DS JS SDK Core, 3.2.2 * Copyright (c) Microsoft and contributors. All rights reserved. * (Microsoft Internal Only) */ import { isNullOrUndefined, objForEachKey, isString } from "@microsoft/applicationinsights-core-js"; import { isValueKind, isValueAssigned, getFieldValueType } from "./Utils"; var ValueSanitizer = /** @class */ (function () { function ValueSanitizer(fieldSanitizerProvider) { var _self = this; // To aid with performance this is a lookup map to check if the field value sanitizer supports this field var _sanitizerMap = {}; var _sanitizers = []; var _fieldSanitizers = []; if (fieldSanitizerProvider) { _fieldSanitizers.push(fieldSanitizerProvider); } function _getFieldSanitizer(path, name) { var result; var fieldLookup = _sanitizerMap[path]; if (fieldLookup) { result = fieldLookup[name]; } if (!result && result !== null) { // Null is a valid result indicating that the value sanitizer does not support this field if (isString(path) && isString(name)) { if (_fieldSanitizers.length > 0) { for (var lp = 0; lp < _fieldSanitizers.length; lp++) { if (_fieldSanitizers[lp].handleField(path, name)) { result = { canHandle: true, fieldHandler: _fieldSanitizers[lp] }; break; } } } else if (_sanitizers.length === 0) { // Special use-case where there is no sanitizer to pass on to, so just resolving the field // and returning the resulting value (same as sanitizeProperty()) result = { canHandle: true }; } } // We still don't have a handler so lets lookup the providers if (!result && result !== null) { // Setting the result to null -- which means we and any contained sanitizers can't handle this field result = null; for (var lp = 0; lp < _sanitizers.length; lp++) { if (_sanitizers[lp].handleField(path, name)) { result = { canHandle: true, handler: _sanitizers[lp], fieldHandler: null }; break; } } } if (!fieldLookup) { fieldLookup = _sanitizerMap[path] = {}; } fieldLookup[name] = result; } return result; } _self.addSanitizer = function (newSanitizer) { if (newSanitizer) { _sanitizers.push(newSanitizer); // Invalidate any previously mapped fields _sanitizerMap = {}; } }; _self.addFieldSanitizer = function (fieldSanitizer) { if (fieldSanitizer) { _fieldSanitizers.push(fieldSanitizer); // Invalidate any previously mapped fields _sanitizerMap = {}; } }; _self.handleField = function (path, name) { var mapValue = _getFieldSanitizer(path, name); return mapValue ? mapValue.canHandle : false; }; _self.value = function (path, name, value, stringifyObjects) { var mapValue = _getFieldSanitizer(path, name); if (mapValue && mapValue.canHandle) { if (!mapValue || !mapValue.canHandle) { return null; } if (mapValue.handler) { // This value sanitizer can't handle this field so pass it only the next one return mapValue.handler.value(path, name, value, stringifyObjects); } // Check that property is valid if (!isString(name) || isNullOrUndefined(value) || value === "") { return null; } var property = null; var fieldType = getFieldValueType(value); if ((fieldType & 8192 /* EventProperty */) === 8192 /* EventProperty */) { var subType = fieldType & ~8192 /* EventProperty */; property = value; if (!isValueAssigned(property.value) || (subType !== 1 /* String */ && subType !== 2 /* Number */ && subType !== 3 /* Boolean */ && (subType & 4096 /* Array */) !== 4096 /* Array */)) { // Not a supported IEventProperty type to be able to sanitize return null; } } else if (fieldType === 1 /* String */ || fieldType === 2 /* Number */ || fieldType === 3 /* Boolean */ || (fieldType & 4096 /* Array */) === 4096 /* Array */) { // If the property isn't IEventProperty (and is either string, number, boolean or array), convert it into one. property = _convertToProperty(path, name, value); } else if (fieldType === 4 /* Object */) { property = _convertToProperty(path, name, !!stringifyObjects ? JSON.stringify(value) : value); } if (property) { return _handleProperty(mapValue, path, name, fieldType, property, stringifyObjects); } } return null; }; _self.property = function (path, name, property, stringifyObjects) { var mapValue = _getFieldSanitizer(path, name); if (!mapValue || !mapValue.canHandle) { return null; } // Check that property is valid if (!isString(name) || isNullOrUndefined(property) || !isValueAssigned(property.value)) { return null; } var fieldType = getFieldValueType(property.value); if (fieldType === 0 /* NotSet */) { // Not a supported field that we can sanitize or serialize return null; } return _handleProperty(mapValue, path, name, fieldType, property, stringifyObjects); }; function _handleProperty(mapValue, path, name, fieldType, property, stringifyObjects) { if (mapValue.handler) { // This value sanitizer can't handle this field so pass it only the next one return mapValue.handler.property(path, name, property, stringifyObjects); } // If either pii or cc is set convert value to string (since only string pii/cc is allowed). // If the value is a complex type like an array that can't be converted to string we will drop // the property. if (!isNullOrUndefined(property.kind)) { if ((fieldType & 4096 /* Array */) === 4096 /* Array */ || !isValueKind(property.kind)) { return null; } // Convert the value to a string and assign back to the original value property.value = property.value.toString(); } return _callFieldSanitizer(mapValue.fieldHandler, path, name, fieldType, property); } function _convertToProperty(path, name, value) { if (isValueAssigned(value)) { return { value: value }; } return null; } function _callFieldSanitizer(fieldProvider, path, name, theType, property) { if (property && fieldProvider) { var sanitizer = fieldProvider.getSanitizer(path, name, theType, property.kind, property.propertyType); if (sanitizer) { // This is where we the field will call the handler to "scrub" the value. This the primary hook for the ClientHashing Plugin to // be able to apply the hashFunc() / Sha256 conversion of the properties value if (theType === 4 /* Object */) { // Special case of an embedded object (ext.metadata, data.properties) var newValue_1 = {}; var propValue = property.value; objForEachKey(propValue, function (propKey, theValue) { var newPath = path + "." + name; if (isValueAssigned(theValue)) { var newProp = _convertToProperty(newPath, propKey, theValue); newProp = _callFieldSanitizer(fieldProvider, newPath, propKey, getFieldValueType(theValue), newProp); if (newProp) { newValue_1[propKey] = newProp.value; } } }); property.value = newValue_1; } else { var details = { path: path, name: name, type: theType, prop: property, sanitizer: _self }; property = sanitizer.call(_self, details); } } } return property; } } ValueSanitizer.getFieldType = getFieldValueType; return ValueSanitizer; }()); export { ValueSanitizer }; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/1ds-core-js/dist-esm/src/ValueSanitizer.js.mapCopyright (c) Microsoft Corporation. MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.{ "name": "@microsoft/1ds-post-js", "version": "3.2.2", "description": "Microsoft Application Insights JavaScript SDK - 1ds-post-js extensions", "author": "Microsoft Application Insights Team", "homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme", "license": "MIT", "sideEffects": false, "scripts": { "publishPackage": "npm publish", "sri": "node ../../tools/subResourceIntegrity/generateIntegrityFile.js" }, "publishConfig": { "registry": "https://registry.npmjs.org" }, "dependencies": { "@microsoft/applicationinsights-shims": "^2.0.1", "@microsoft/dynamicproto-js": "^1.1.6", "@microsoft/1ds-core-js": "3.2.2" }, "devDependencies": { "grunt": "^1.4.1", "typescript": "^4.3.5" }, "repository": { "type": "git", "url": "https://github.com/microsoft/ApplicationInsights-JS" }, "main": "dist/ms.post.js", "module": "dist-esm/src/Index.js", "keywords": [ "1ds", "azure", "cloud", "script errors", "microsoft", "application insights", "Js", "SDK" ], "types": "dist-esm/src/Index.d.ts" }{ "compilerOptions": { "sourceMap": true, "inlineSources": true, "module": "es6", "moduleResolution": "Node", "target": "es3", "alwaysStrict": true, "strictNullChecks": false, "suppressImplicitAnyIndexErrors": true, "allowSyntheticDefaultImports": true, "importHelpers": true, "noEmitHelpers": true, "forceConsistentCasingInFileNames": true, "declaration": true, "outDir": "dist-esm/src/" }, "include": [ "./src/**/*.ts" ], "exclude": [ "node_modules/" ] }/*! * 1DS JS SDK POST plugin, 3.2.2 * Copyright (c) Microsoft and contributors. All rights reserved. * (Microsoft Internal Only) */ (function (exports) { 'use strict'; var strShimFunction = "function"; var strShimObject = "object"; var strShimUndefined = "undefined"; var strShimPrototype = "prototype"; var strShimHasOwnProperty = "hasOwnProperty"; var ObjClass = Object; var ObjProto = ObjClass[strShimPrototype]; var ObjAssign = ObjClass["assign"]; var ObjCreate = ObjClass["create"]; var ObjDefineProperty = ObjClass["defineProperty"]; var ObjHasOwnProperty = ObjProto[strShimHasOwnProperty]; var _cachedGlobal = null; function getGlobal(useCached) { if (useCached === void 0) { useCached = true; } if (!_cachedGlobal || !useCached) { if (typeof globalThis !== strShimUndefined && globalThis) { _cachedGlobal = globalThis; } if (typeof self !== strShimUndefined && self) { _cachedGlobal = self; } if (typeof window !== strShimUndefined && window) { _cachedGlobal = window; } if (typeof global !== strShimUndefined && global) { _cachedGlobal = global; } } return _cachedGlobal; } function throwTypeError(message) { throw new TypeError(message); } function objCreateFn(obj) { var func = ObjCreate; if (func) { return func(obj); } if (obj == null) { return {}; } var type = typeof obj; if (type !== strShimObject && type !== strShimFunction) { throwTypeError("Object prototype may only be an Object:" + obj); } function tmpFunc() { } tmpFunc[strShimPrototype] = obj; return new tmpFunc(); } (getGlobal() || {})["Symbol"]; (getGlobal() || {})["Reflect"]; var extendStaticsFn = function (d, b) { extendStaticsFn = ObjClass["setPrototypeOf"] || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) { if (b[strShimHasOwnProperty](p)) { d[p] = b[p]; } } }; return extendStaticsFn(d, b); }; function __extendsFn(d, b) { if (typeof b !== strShimFunction && b !== null) { throwTypeError("Class extends value " + String(b) + " is not a constructor or null"); } extendStaticsFn(d, b); function __() { this.constructor = d; } d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new __()); } /*! * Microsoft Dynamic Proto Utility, 1.1.6 * Copyright (c) Microsoft and contributors. All rights reserved. */ var Constructor = 'constructor'; var Prototype = 'prototype'; var strFunction = 'function'; var DynInstFuncTable = '_dynInstFuncs'; var DynProxyTag = '_isDynProxy'; var DynClassName = '_dynClass'; var DynClassNamePrefix = '_dynCls$'; var DynInstChkTag = '_dynInstChk'; var DynAllowInstChkTag = DynInstChkTag; var DynProtoDefaultOptions = '_dfOpts'; var UnknownValue = '_unknown_'; var str__Proto$1 = "__proto__"; var DynProtoBaseProto = "_dyn" + str__Proto$1; var DynProtoCurrent = "_dynInstProto"; var strUseBaseInst = 'useBaseInst'; var strSetInstFuncs = 'setInstFuncs'; var Obj = Object; var _objGetPrototypeOf$1 = Obj["getPrototypeOf"]; var _objGetOwnProps = Obj["getOwnPropertyNames"]; var _dynamicNames = 0; function _hasOwnProperty(obj, prop) { return obj && Obj[Prototype].hasOwnProperty.call(obj, prop); } function _isObjectOrArrayPrototype(target) { return target && (target === Obj[Prototype] || target === Array[Prototype]); } function _isObjectArrayOrFunctionPrototype(target) { return _isObjectOrArrayPrototype(target) || target === Function[Prototype]; } function _getObjProto$1(target) { var newProto; if (target) { if (_objGetPrototypeOf$1) { return _objGetPrototypeOf$1(target); } var curProto = target[str__Proto$1] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null); newProto = target[DynProtoBaseProto] || curProto; if (!_hasOwnProperty(target, DynProtoBaseProto)) { delete target[DynProtoCurrent]; newProto = target[DynProtoBaseProto] = target[DynProtoCurrent] || target[DynProtoBaseProto]; target[DynProtoCurrent] = curProto; } } return newProto; } function _forEachProp(target, func) { var props = []; if (_objGetOwnProps) { props = _objGetOwnProps(target); } else { for (var name_1 in target) { if (typeof name_1 === "string" && _hasOwnProperty(target, name_1)) { props.push(name_1); } } } if (props && props.length > 0) { for (var lp = 0; lp < props.length; lp++) { func(props[lp]); } } } function _isDynamicCandidate(target, funcName, skipOwn) { return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName))); } function _throwTypeError(message) { throw new TypeError("DynamicProto: " + message); } function _getInstanceFuncs(thisTarget) { var instFuncs = {}; _forEachProp(thisTarget, function (name) { if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) { instFuncs[name] = thisTarget[name]; } }); return instFuncs; } function _hasVisited(values, value) { for (var lp = values.length - 1; lp >= 0; lp--) { if (values[lp] === value) { return true; } } return false; } function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) { function _instFuncProxy(target, funcHost, funcName) { var theFunc = funcHost[funcName]; if (theFunc[DynProxyTag] && useBaseInst) { var instFuncTable = target[DynInstFuncTable] || {}; if (instFuncTable[DynAllowInstChkTag] !== false) { theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc; } } return function () { return theFunc.apply(target, arguments); }; } var baseFuncs = {}; _forEachProp(instFuncs, function (name) { baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name); }); var baseProto = _getObjProto$1(classProto); var visited = []; while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) { _forEachProp(baseProto, function (name) { if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf$1)) { baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name); } }); visited.push(baseProto); baseProto = _getObjProto$1(baseProto); } return baseFuncs; } function _getInstFunc(target, funcName, proto, currentDynProtoProxy) { var instFunc = null; if (target && _hasOwnProperty(proto, DynClassName)) { var instFuncTable = target[DynInstFuncTable] || {}; instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName]; if (!instFunc) { _throwTypeError("Missing [" + funcName + "] " + strFunction); } if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) { var canAddInst = !_hasOwnProperty(target, funcName); var objProto = _getObjProto$1(target); var visited = []; while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) { var protoFunc = objProto[funcName]; if (protoFunc) { canAddInst = (protoFunc === currentDynProtoProxy); break; } visited.push(objProto); objProto = _getObjProto$1(objProto); } try { if (canAddInst) { target[funcName] = instFunc; } instFunc[DynInstChkTag] = 1; } catch (e) { instFuncTable[DynAllowInstChkTag] = false; } } } return instFunc; } function _getProtoFunc(funcName, proto, currentDynProtoProxy) { var protoFunc = proto[funcName]; if (protoFunc === currentDynProtoProxy) { protoFunc = _getObjProto$1(proto)[funcName]; } if (typeof protoFunc !== strFunction) { _throwTypeError("[" + funcName + "] is not a " + strFunction); } return protoFunc; } function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) { function _createDynamicPrototype(proto, funcName) { var dynProtoProxy = function () { var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy); return instFunc.apply(this, arguments); }; dynProtoProxy[DynProxyTag] = 1; return dynProtoProxy; } if (!_isObjectOrArrayPrototype(proto)) { var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {}; var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {}); if (instFuncTable[DynAllowInstChkTag] !== false) { instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc; } _forEachProp(target, function (name) { if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) { instFuncs_1[name] = target[name]; delete target[name]; if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) { proto[name] = _createDynamicPrototype(proto, name); } } }); } } function _checkPrototype(classProto, thisTarget) { if (_objGetPrototypeOf$1) { var visited = []; var thisProto = _getObjProto$1(thisTarget); while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) { if (thisProto === classProto) { return true; } visited.push(thisProto); thisProto = _getObjProto$1(thisProto); } return false; } return true; } function _getObjName(target, unknownValue) { if (_hasOwnProperty(target, Prototype)) { return target.name || unknownValue || UnknownValue; } return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue; } function dynamicProto(theClass, target, delegateFunc, options) { if (!_hasOwnProperty(theClass, Prototype)) { _throwTypeError("theClass is an invalid class definition."); } var classProto = theClass[Prototype]; if (!_checkPrototype(classProto, target)) { _throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]"); } var className = null; if (_hasOwnProperty(classProto, DynClassName)) { className = classProto[DynClassName]; } else { className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _dynamicNames; _dynamicNames++; classProto[DynClassName] = className; } var perfOptions = dynamicProto[DynProtoDefaultOptions]; var useBaseInst = !!perfOptions[strUseBaseInst]; if (useBaseInst && options && options[strUseBaseInst] !== undefined) { useBaseInst = !!options[strUseBaseInst]; } var instFuncs = _getInstanceFuncs(target); var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst); delegateFunc(target, baseFuncs); var setInstanceFunc = !!_objGetPrototypeOf$1 && !!perfOptions[strSetInstFuncs]; if (setInstanceFunc && options) { setInstanceFunc = !!options[strSetInstFuncs]; } _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false); } var perfDefaults = { setInstFuncs: true, useBaseInst: true }; dynamicProto[DynProtoDefaultOptions] = perfDefaults; var strEmpty = ""; var strSetNextPlugin = "setNextPlugin"; var strIsInitialized = "isInitialized"; var strTeardown = "teardown"; var strCore = "core"; var strUpdate = "update"; var strDisabled = "disabled"; var strDoTeardown = "_doTeardown"; var cStrStartsWith = "startsWith"; var strIndexOf = "indexOf"; var cStrTrim = "trim"; var strToString = "toString"; var str__Proto = "__proto__"; var strConstructor = "constructor"; var _objDefineProperty$1 = ObjDefineProperty; var _objFreeze = ObjClass.freeze; var _objKeys = ObjClass.keys; var StringProto = String[strShimPrototype]; var _strTrim = StringProto[cStrTrim]; var _strStartsWith = StringProto[cStrStartsWith]; var _isArray = Array.isArray; var _objToString = ObjProto[strToString]; var _fnToString = ObjHasOwnProperty[strToString]; var _objFunctionString = _fnToString.call(ObjClass); var rCamelCase = /-([a-z])/g; var rNormalizeInvalid = /([^\w\d_$])/g; var rLeadingNumeric = /^(\d+[\w\d_$])/; var _objGetPrototypeOf = Object["getPrototypeOf"]; function _getObjProto(target) { if (target) { if (_objGetPrototypeOf) { return _objGetPrototypeOf(target); } var newProto = target[str__Proto] || target[strShimPrototype] || target[strConstructor]; if (newProto) { return newProto; } } return null; } function isUndefined(value) { return value === undefined || typeof value === strShimUndefined; } function isNullOrUndefined(value) { return (value === null || isUndefined(value)); } function hasOwnProperty(obj, prop) { return !!(obj && ObjHasOwnProperty.call(obj, prop)); } function isObject(value) { return !!(value && typeof value === strShimObject); } function isFunction(value) { return !!(value && typeof value === strShimFunction); } function normalizeJsName(name) { var value = name; if (value && isString(value)) { value = value.replace(rCamelCase, function (_all, letter) { return letter.toUpperCase(); }); value = value.replace(rNormalizeInvalid, "_"); value = value.replace(rLeadingNumeric, function (_all, match) { return "_" + match; }); } return value; } function objForEachKey(target, callbackfn) { if (target) { for (var prop in target) { if (ObjHasOwnProperty.call(target, prop)) { callbackfn.call(target, prop, target[prop]); } } } } function strStartsWith(value, checkValue) { var result = false; if (value && checkValue && !(result = value === checkValue)) { result = _strStartsWith ? value[cStrStartsWith](checkValue) : _strStartsWithPoly(value, checkValue); } return result; } function _strStartsWithPoly(value, checkValue) { var result = false; var chkLen = checkValue ? checkValue.length : 0; if (value && chkLen && value.length >= chkLen && !(result = value === checkValue)) { for (var lp = 0; lp < chkLen; lp++) { if (value[lp] !== checkValue[lp]) { return false; } } result = true; } return result; } function strContains(value, search) { if (value && search) { return value.indexOf(search) !== -1; } return false; } var isArray = _isArray || _isArrayPoly; function _isArrayPoly(obj) { return !!(obj && _objToString.call(obj) === "[object Array]"); } function isString(value) { return typeof value === "string"; } function isNumber(value) { return typeof value === "number"; } function isBoolean(value) { return typeof value === "boolean"; } function isPlainObject(value) { var result = false; if (value && typeof value === "object") { var proto = _objGetPrototypeOf ? _objGetPrototypeOf(value) : _getObjProto(value); if (!proto) { result = true; } else { if (proto[strConstructor] && ObjHasOwnProperty.call(proto, strConstructor)) { proto = proto[strConstructor]; } result = typeof proto === strShimFunction && _fnToString.call(proto) === _objFunctionString; } } return result; } function arrForEach(arr, callbackfn, thisArg) { var len = arr.length; try { for (var idx = 0; idx < len; idx++) { if (idx in arr) { if (callbackfn.call(thisArg || arr, arr[idx], idx, arr) === -1) { break; } } } } catch (e) { } } function arrIndexOf(arr, searchElement, fromIndex) { if (arr) { if (arr[strIndexOf]) { return arr[strIndexOf](searchElement, fromIndex); } var len = arr.length; var from = fromIndex || 0; try { for (var lp = Math.max(from >= 0 ? from : len - Math.abs(from), 0); lp < len; lp++) { if (lp in arr && arr[lp] === searchElement) { return lp; } } } catch (e) { } } return -1; } function strTrim(str) { if (str) { str = (_strTrim && str[cStrTrim]) ? str[cStrTrim]() : (str.replace ? str.replace(/^\s+|\s+$/g, "") : str); } return str; } var _objKeysHasDontEnumBug = !({ toString: null }).propertyIsEnumerable("toString"); var _objKeysDontEnums = [ "toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor" ]; function objKeys(obj) { var objType = typeof obj; if (objType !== strShimFunction && (objType !== strShimObject || obj === null)) { throwTypeError("objKeys called on non-object"); } if (!_objKeysHasDontEnumBug && _objKeys) { return _objKeys(obj); } var result = []; for (var prop in obj) { if (obj && ObjHasOwnProperty.call(obj, prop)) { result.push(prop); } } if (_objKeysHasDontEnumBug) { var dontEnumsLength = _objKeysDontEnums.length; for (var lp = 0; lp < dontEnumsLength; lp++) { if (obj && ObjHasOwnProperty.call(obj, _objKeysDontEnums[lp])) { result.push(_objKeysDontEnums[lp]); } } } return result; } function objDefineAccessors(target, prop, getProp, setProp) { if (_objDefineProperty$1) { try { var descriptor = { enumerable: true, configurable: true }; if (getProp) { descriptor.get = getProp; } if (setProp) { descriptor.set = setProp; } _objDefineProperty$1(target, prop, descriptor); return true; } catch (e) { } } return false; } function _doNothing(value) { return value; } function deepFreeze(obj) { if (_objFreeze) { objForEachKey(obj, function (name, value) { if (isArray(value) || isObject(value)) { _objFreeze(value); } }); } return objFreeze(obj); } var objFreeze = _objFreeze || _doNothing; function dateNow() { var dt = Date; return dt.now ? dt.now() : new dt().getTime(); } function setValue(target, field, value, valChk, srcChk) { var theValue = value; if (target) { theValue = target[field]; if (theValue !== value && (!srcChk || srcChk(theValue)) && (!valChk || valChk(value))) { theValue = value; target[field] = theValue; } } return theValue; } function _createProxyFunction(source, funcName) { var srcFunc = null; var src = null; if (isFunction(source)) { srcFunc = source; } else { src = source; } return function () { var originalArguments = arguments; if (srcFunc) { src = srcFunc(); } if (src) { return src[funcName].apply(src, originalArguments); } }; } function proxyFunctionAs(target, name, source, theFunc, overwriteTarget) { if (target && name && source) { if (overwriteTarget !== false || isUndefined(target[name])) { target[name] = _createProxyFunction(source, theFunc); } } } function optimizeObject(theObject) { if (theObject && ObjAssign) { theObject = ObjClass(ObjAssign({}, theObject)); } return theObject; } function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) { var theArgs = arguments; var extended = theArgs[0] || {}; var argLen = theArgs.length; var deep = false; var idx = 1; if (argLen > 0 && isBoolean(extended)) { deep = extended; extended = theArgs[idx] || {}; idx++; } if (!isObject(extended)) { extended = {}; } for (; idx < argLen; idx++) { var arg = theArgs[idx]; var isArgArray = isArray(arg); var isArgObj = isObject(arg); for (var prop in arg) { var propOk = (isArgArray && (prop in arg)) || (isArgObj && (ObjHasOwnProperty.call(arg, prop))); if (!propOk) { continue; } var newValue = arg[prop]; var isNewArray = void 0; if (deep && newValue && ((isNewArray = isArray(newValue)) || isPlainObject(newValue))) { var clone = extended[prop]; if (isNewArray) { if (!isArray(clone)) { clone = []; } } else if (!isPlainObject(clone)) { clone = {}; } newValue = objExtend(deep, clone, newValue); } if (newValue !== undefined) { extended[prop] = newValue; } } } return extended; } function createEnumStyle(values) { var enumClass = {}; objForEachKey(values, function (field, value) { enumClass[field] = value; enumClass[value] = field; }); return deepFreeze(enumClass); } var EventsDiscardedReason = createEnumStyle({ Unknown: 0 , NonRetryableStatus: 1 , InvalidEvent: 2 , SizeLimitExceeded: 3 , KillSwitch: 4 , QueueFull: 5 }); var strWindow = "window"; var strDocument = "document"; var strNavigator = "navigator"; var strLocation = "location"; var strConsole = "console"; var strPerformance = "performance"; var strJSON = "JSON"; var strCrypto = "crypto"; var strMsCrypto = "msCrypto"; var strReactNative = "ReactNative"; var strMsie = "msie"; var strTrident = "trident/"; var strXMLHttpRequest = "XMLHttpRequest"; var _isTrident = null; var _navUserAgentCheck = null; var _enableMocks = false; var _useXDomainRequest = null; var _beaconsSupported = null; function _hasProperty(theClass, property) { var supported = false; if (theClass) { try { supported = property in theClass; if (!supported) { var proto = theClass[strShimPrototype]; if (proto) { supported = property in proto; } } } catch (e) { } if (!supported) { try { var tmp = new theClass(); supported = !isUndefined(tmp[property]); } catch (e) { } } } return supported; } function getGlobalInst(name) { var gbl = getGlobal(); if (gbl && gbl[name]) { return gbl[name]; } if (name === strWindow && hasWindow()) { return window; } return null; } function hasWindow() { return Boolean(typeof window === strShimObject && window); } function getWindow() { if (hasWindow()) { return window; } return getGlobalInst(strWindow); } function hasDocument() { return Boolean(typeof document === strShimObject && document); } function getDocument() { if (hasDocument()) { return document; } return getGlobalInst(strDocument); } function hasNavigator() { return Boolean(typeof navigator === strShimObject && navigator); } function getNavigator() { if (hasNavigator()) { return navigator; } return getGlobalInst(strNavigator); } function getLocation(checkForMock) { if (checkForMock && _enableMocks) { var mockLocation = getGlobalInst("__mockLocation"); if (mockLocation) { return mockLocation; } } if (typeof location === strShimObject && location) { return location; } return getGlobalInst(strLocation); } function getConsole() { if (typeof console !== strShimUndefined) { return console; } return getGlobalInst(strConsole); } function getPerformance() { return getGlobalInst(strPerformance); } function hasJSON() { return Boolean((typeof JSON === strShimObject && JSON) || getGlobalInst(strJSON) !== null); } function getJSON() { if (hasJSON()) { return JSON || getGlobalInst(strJSON); } return null; } function getCrypto() { return getGlobalInst(strCrypto); } function getMsCrypto() { return getGlobalInst(strMsCrypto); } function isReactNative() { var nav = getNavigator(); if (nav && nav.product) { return nav.product === strReactNative; } return false; } function isIE() { var nav = getNavigator(); if (nav && (nav.userAgent !== _navUserAgentCheck || _isTrident === null)) { _navUserAgentCheck = nav.userAgent; var userAgent = (_navUserAgentCheck || strEmpty).toLowerCase(); _isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident)); } return _isTrident; } function dumpObj(object) { var objectTypeDump = Object[strShimPrototype].toString.call(object); var propertyValueDump = strEmpty; if (objectTypeDump === "[object Error]") { propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'"; } else if (hasJSON()) { propertyValueDump = getJSON().stringify(object); } return objectTypeDump + propertyValueDump; } function isBeaconsSupported() { if (_beaconsSupported === null) { _beaconsSupported = hasNavigator() && Boolean(getNavigator().sendBeacon); } return _beaconsSupported; } function isFetchSupported(withKeepAlive) { var isSupported = false; try { isSupported = !!getGlobalInst("fetch"); var request = getGlobalInst("Request"); if (isSupported && withKeepAlive && request) { isSupported = _hasProperty(request, "keepalive"); } } catch (e) { } return isSupported; } function useXDomainRequest() { if (_useXDomainRequest === null) { _useXDomainRequest = (typeof XDomainRequest !== strShimUndefined); if (_useXDomainRequest && isXhrSupported()) { _useXDomainRequest = _useXDomainRequest && !_hasProperty(getGlobalInst(strXMLHttpRequest), "withCredentials"); } } return _useXDomainRequest; } function isXhrSupported() { var isSupported = false; try { var xmlHttpRequest = getGlobalInst(strXMLHttpRequest); isSupported = !!xmlHttpRequest; } catch (e) { } return isSupported; } var _aiNamespace = null; function _getExtensionNamespace() { var target = getGlobalInst("Microsoft"); if (target) { _aiNamespace = target["ApplicationInsights"]; } return _aiNamespace; } function getDebugExt(config) { var ns = _aiNamespace; if (!ns && config.disableDbgExt !== true) { ns = _aiNamespace || _getExtensionNamespace(); } return ns ? ns["ChromeDbgExt"] : null; } var AiNonUserActionablePrefix = "AI (Internal): "; var AiUserActionablePrefix = "AI: "; var AIInternalMessagePrefix = "AITR_"; var strErrorToConsole = "errorToConsole"; var strWarnToConsole = "warnToConsole"; function _sanitizeDiagnosticText(text) { if (text) { return "\"" + text.replace(/\"/g, strEmpty) + "\""; } return strEmpty; } function _logToConsole(func, message) { var theConsole = getConsole(); if (!!theConsole) { var logFunc = "log"; if (theConsole[func]) { logFunc = func; } if (isFunction(theConsole[logFunc])) { theConsole[logFunc](message); } } } var _InternalLogMessage = /** @class */ (function () { function _InternalLogMessage(msgId, msg, isUserAct, properties) { if (isUserAct === void 0) { isUserAct = false; } var _self = this; _self.messageId = msgId; _self.message = (isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) + msgId; var strProps = strEmpty; if (hasJSON()) { strProps = getJSON().stringify(properties); } var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : strEmpty) + (properties ? " props:" + _sanitizeDiagnosticText(strProps) : strEmpty); _self.message += diagnosticText; } _InternalLogMessage.dataType = "MessageData"; return _InternalLogMessage; }()); function safeGetLogger(core, config) { return (core || {}).logger || new DiagnosticLogger(config); } var DiagnosticLogger = /** @class */ (function () { function DiagnosticLogger(config) { this.identifier = "DiagnosticLogger"; this.queue = []; var _messageCount = 0; var _messageLogged = {}; dynamicProto(DiagnosticLogger, this, function (_self) { if (isNullOrUndefined(config)) { config = {}; } _self.consoleLoggingLevel = function () { return _getConfigValue("loggingLevelConsole", 0); }; _self.telemetryLoggingLevel = function () { return _getConfigValue("loggingLevelTelemetry", 1); }; _self.maxInternalMessageLimit = function () { return _getConfigValue("maxMessageLimit", 25); }; _self.enableDebugExceptions = function () { return _getConfigValue("enableDebugExceptions", false); }; _self.throwInternal = function (severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } var message = new _InternalLogMessage(msgId, msg, isUserAct, properties); if (_self.enableDebugExceptions()) { throw dumpObj(message); } else { var logFunc = severity === 1 ? strErrorToConsole : strWarnToConsole; if (!isUndefined(message.message)) { var logLevel = _self.consoleLoggingLevel(); if (isUserAct) { var messageKey = +message.messageId; if (!_messageLogged[messageKey] && logLevel >= severity) { _self[logFunc](message.message); _messageLogged[messageKey] = true; } } else { if (logLevel >= severity) { _self[logFunc](message.message); } } _self.logInternalMessage(severity, message); } else { _debugExtMsg("throw" + (severity === 1 ? "Critical" : "Warning"), message); } } }; _self.warnToConsole = function (message) { _logToConsole("warn", message); _debugExtMsg("warning", message); }; _self.errorToConsole = function (message) { _logToConsole("error", message); _debugExtMsg("error", message); }; _self.resetInternalMessageCount = function () { _messageCount = 0; _messageLogged = {}; }; _self.logInternalMessage = function (severity, message) { if (_areInternalMessagesThrottled()) { return; } var logMessage = true; var messageKey = AIInternalMessagePrefix + message.messageId; if (_messageLogged[messageKey]) { logMessage = false; } else { _messageLogged[messageKey] = true; } if (logMessage) { if (severity <= _self.telemetryLoggingLevel()) { _self.queue.push(message); _messageCount++; _debugExtMsg((severity === 1 ? "error" : "warn"), message); } if (_messageCount === _self.maxInternalMessageLimit()) { var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app."; var throttleMessage = new _InternalLogMessage(23 , throttleLimitMessage, false); _self.queue.push(throttleMessage); if (severity === 1 ) { _self.errorToConsole(throttleLimitMessage); } else { _self.warnToConsole(throttleLimitMessage); } } } }; function _getConfigValue(name, defValue) { var value = config[name]; if (!isNullOrUndefined(value)) { return value; } return defValue; } function _areInternalMessagesThrottled() { return _messageCount >= _self.maxInternalMessageLimit(); } function _debugExtMsg(name, data) { var dbgExt = getDebugExt(config); if (dbgExt && dbgExt.diagLog) { dbgExt.diagLog(name, data); } } }); } return DiagnosticLogger; }()); function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } (logger || new DiagnosticLogger()).throwInternal(severity, msgId, msg, properties, isUserAct); } var strExecutionContextKey = "ctx"; var PerfEvent = /** @class */ (function () { function PerfEvent(name, payloadDetails, isAsync) { var _self = this; var accessorDefined = false; _self.start = dateNow(); _self.name = name; _self.isAsync = isAsync; _self.isChildEvt = function () { return false; }; if (isFunction(payloadDetails)) { var theDetails_1; accessorDefined = objDefineAccessors(_self, "payload", function () { if (!theDetails_1 && isFunction(payloadDetails)) { theDetails_1 = payloadDetails(); payloadDetails = null; } return theDetails_1; }); } _self.getCtx = function (key) { if (key) { if (key === PerfEvent.ParentContextKey || key === PerfEvent.ChildrenContextKey) { return _self[key]; } return (_self[strExecutionContextKey] || {})[key]; } return null; }; _self.setCtx = function (key, value) { if (key) { if (key === PerfEvent.ParentContextKey) { if (!_self[key]) { _self.isChildEvt = function () { return true; }; } _self[key] = value; } else if (key === PerfEvent.ChildrenContextKey) { _self[key] = value; } else { var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {}; ctx[key] = value; } } }; _self.complete = function () { var childTime = 0; var childEvts = _self.getCtx(PerfEvent.ChildrenContextKey); if (isArray(childEvts)) { for (var lp = 0; lp < childEvts.length; lp++) { var childEvt = childEvts[lp]; if (childEvt) { childTime += childEvt.time; } } } _self.time = dateNow() - _self.start; _self.exTime = _self.time - childTime; _self.complete = function () { }; if (!accessorDefined && isFunction(payloadDetails)) { _self.payload = payloadDetails(); } }; } PerfEvent.ParentContextKey = "parent"; PerfEvent.ChildrenContextKey = "childEvts"; return PerfEvent; }()); var doPerfActiveKey = "CoreUtils.doPerf"; function doPerf(mgrSource, getSource, func, details, isAsync) { if (mgrSource) { var perfMgr = mgrSource; if (isFunction(perfMgr["getPerfMgr"])) { perfMgr = perfMgr["getPerfMgr"](); } if (perfMgr) { var perfEvt = void 0; var currentActive = perfMgr.getCtx(doPerfActiveKey); try { perfEvt = perfMgr.create(getSource(), details, isAsync); if (perfEvt) { if (currentActive && perfEvt.setCtx) { perfEvt.setCtx(PerfEvent.ParentContextKey, currentActive); if (currentActive.getCtx && currentActive.setCtx) { var children = currentActive.getCtx(PerfEvent.ChildrenContextKey); if (!children) { children = []; currentActive.setCtx(PerfEvent.ChildrenContextKey, children); } children.push(perfEvt); } } perfMgr.setCtx(doPerfActiveKey, perfEvt); return func(perfEvt); } } catch (ex) { if (perfEvt && perfEvt.setCtx) { perfEvt.setCtx("exception", ex); } } finally { if (perfEvt) { perfMgr.fire(perfEvt); } perfMgr.setCtx(doPerfActiveKey, currentActive); } } } return func(); } var UInt32Mask = 0x100000000; var MaxUInt32 = 0xffffffff; var _mwcSeeded = false; var _mwcW = 123456789; var _mwcZ = 987654321; function _mwcSeed(seedValue) { if (seedValue < 0) { seedValue >>>= 0; } _mwcW = (123456789 + seedValue) & MaxUInt32; _mwcZ = (987654321 - seedValue) & MaxUInt32; _mwcSeeded = true; } function _autoSeedMwc() { try { var now = dateNow() & 0x7fffffff; _mwcSeed(((Math.random() * UInt32Mask) ^ now) + now); } catch (e) { } } function random32(signed) { var value = 0; var c = getCrypto() || getMsCrypto(); if (c && c.getRandomValues) { value = c.getRandomValues(new Uint32Array(1))[0] & MaxUInt32; } if (value === 0 && isIE()) { if (!_mwcSeeded) { _autoSeedMwc(); } value = mwcRandom32() & MaxUInt32; } if (value === 0) { value = Math.floor((UInt32Mask * Math.random()) | 0); } if (!signed) { value >>>= 0; } return value; } function mwcRandom32(signed) { _mwcZ = (36969 * (_mwcZ & 0xFFFF) + (_mwcZ >> 16)) & MaxUInt32; _mwcW = (18000 * (_mwcW & 0xFFFF) + (_mwcW >> 16)) & MaxUInt32; var value = (((_mwcZ << 16) + (_mwcW & 0xFFFF)) >>> 0) & MaxUInt32 | 0; if (!signed) { value >>>= 0; } return value; } function newId(maxLength) { if (maxLength === void 0) { maxLength = 22; } var base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; var number = random32() >>> 0; var chars = 0; var result = strEmpty; while (result.length < maxLength) { chars++; result += base64chars.charAt(number & 0x3F); number >>>= 6; if (chars === 5) { number = (((random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0; chars = 0; } } return result; } var _objDefineProperty = ObjDefineProperty; var version = "2.8.3"; var instanceName = "." + newId(6); var _dataUid = 0; function _createAccessor(target, prop, value) { if (_objDefineProperty) { try { _objDefineProperty(target, prop, { value: value, enumerable: false, configurable: true }); return true; } catch (e) { } } return false; } function _canAcceptData(target) { return target.nodeType === 1 || target.nodeType === 9 || !(+target.nodeType); } function _getCache(data, target) { var theCache = target[data.id]; if (!theCache) { theCache = {}; try { if (_canAcceptData(target)) { if (!_createAccessor(target, data.id, theCache)) { target[data.id] = theCache; } } } catch (e) { } } return theCache; } function createUniqueNamespace(name, includeVersion) { if (includeVersion === void 0) { includeVersion = false; } return normalizeJsName(name + (_dataUid++) + (includeVersion ? "." + version : "") + instanceName); } function createElmNodeData(name) { var data = { id: createUniqueNamespace("_aiData-" + (name || "") + "." + version), accept: function (target) { return _canAcceptData(target); }, get: function (target, name, defValue, addDefault) { var theCache = target[data.id]; if (!theCache) { if (addDefault) { theCache = _getCache(data, target); theCache[normalizeJsName(name)] = defValue; } return defValue; } return theCache[normalizeJsName(name)]; }, kill: function (target, name) { if (target && target[name]) { try { delete target[name]; } catch (e) { } } } }; return data; } var pluginStateData = createElmNodeData("plugin"); function _getPluginState(plugin) { return pluginStateData.get(plugin, "state", {}, true); } var strTelemetryPluginChain = "TelemetryPluginChain"; var strHasRunFlags = "_hasRun"; var strGetTelCtx = "_getTelCtx"; var _chainId = 0; function _getNextProxyStart(proxy, core, startAt) { while (proxy) { if (proxy.getPlugin() === startAt) { return proxy; } proxy = proxy.getNext(); } return createTelemetryProxyChain([startAt], core.config || {}, core); } function _createInternalContext(telemetryChain, config, core, startAt) { var _nextProxy = null; var _onComplete = []; if (startAt !== null) { _nextProxy = startAt ? _getNextProxyStart(telemetryChain, core, startAt) : telemetryChain; } var context = { _next: _moveNext, ctx: { core: function () { return core; }, diagLog: function () { return safeGetLogger(core, config); }, getCfg: function () { return config; }, getExtCfg: _getExtCfg, getConfig: _getConfig, hasNext: function () { return !!_nextProxy; }, getNext: function () { return _nextProxy; }, setNext: function (nextPlugin) { _nextProxy = nextPlugin; }, iterate: _iterateChain, onComplete: _addOnComplete } }; function _addOnComplete(onComplete, that) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } if (onComplete) { _onComplete.push({ func: onComplete, self: !isUndefined(that) ? that : context.ctx, args: args }); } } function _moveNext() { var nextProxy = _nextProxy; _nextProxy = nextProxy ? nextProxy.getNext() : null; if (!nextProxy) { var onComplete = _onComplete; if (onComplete && onComplete.length > 0) { arrForEach(onComplete, function (completeDetails) { try { completeDetails.func.call(completeDetails.self, completeDetails.args); } catch (e) { _throwInternal(core.logger, 2 , 73 , "Unexpected Exception during onComplete - " + dumpObj(e)); } }); _onComplete = []; } } return nextProxy; } function _getExtCfg(identifier, defaultValue, mergeDefault) { if (defaultValue === void 0) { defaultValue = {}; } if (mergeDefault === void 0) { mergeDefault = 0 ; } var theConfig; if (config) { var extConfig = config.extensionConfig; if (extConfig && identifier) { theConfig = extConfig[identifier]; } } if (!theConfig) { theConfig = defaultValue; } else if (isObject(defaultValue)) { if (mergeDefault !== 0 ) { var newConfig_1 = objExtend(true, defaultValue, theConfig); if (config && mergeDefault === 2 ) { objForEachKey(defaultValue, function (field) { if (isNullOrUndefined(newConfig_1[field])) { var cfgValue = config[field]; if (!isNullOrUndefined(cfgValue)) { newConfig_1[field] = cfgValue; } } }); } theConfig = newConfig_1; } } return theConfig; } function _getConfig(identifier, field, defaultValue) { if (defaultValue === void 0) { defaultValue = false; } var theValue; var extConfig = _getExtCfg(identifier, null); if (extConfig && !isNullOrUndefined(extConfig[field])) { theValue = extConfig[field]; } else if (config && !isNullOrUndefined(config[field])) { theValue = config[field]; } return !isNullOrUndefined(theValue) ? theValue : defaultValue; } function _iterateChain(cb) { var nextPlugin; while (!!(nextPlugin = context._next())) { var plugin = nextPlugin.getPlugin(); if (plugin) { cb(plugin); } } } return context; } function createProcessTelemetryContext(telemetryChain, config, core, startAt) { var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(env) { var nextPlugin = internalContext._next(); nextPlugin && nextPlugin.processTelemetry(env, context); return !nextPlugin; } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryContext(plugins || context.getNext(), config, core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } function createProcessTelemetryUnloadContext(telemetryChain, core, startAt) { var config = core.config || {}; var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(unloadState) { var nextPlugin = internalContext._next(); nextPlugin && nextPlugin.unload(context, unloadState); return !nextPlugin; } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryUnloadContext(plugins || context.getNext(), core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } function createProcessTelemetryUpdateContext(telemetryChain, core, startAt) { var config = core.config || {}; var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(updateState) { return context.iterate(function (plugin) { if (isFunction(plugin.update)) { plugin.update(context, updateState); } }); } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryUpdateContext(plugins || context.getNext(), core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } function createTelemetryProxyChain(plugins, config, core, startAt) { var firstProxy = null; var add = startAt ? false : true; if (isArray(plugins) && plugins.length > 0) { var lastProxy_1 = null; arrForEach(plugins, function (thePlugin) { if (!add && startAt === thePlugin) { add = true; } if (add && thePlugin && isFunction(thePlugin.processTelemetry)) { var newProxy = createTelemetryPluginProxy(thePlugin, config, core); if (!firstProxy) { firstProxy = newProxy; } if (lastProxy_1) { lastProxy_1._setNext(newProxy); } lastProxy_1 = newProxy; } }); } if (startAt && !firstProxy) { return createTelemetryProxyChain([startAt], config, core); } return firstProxy; } function createTelemetryPluginProxy(plugin, config, core) { var nextProxy = null; var hasProcessTelemetry = isFunction(plugin.processTelemetry); var hasSetNext = isFunction(plugin.setNextPlugin); var chainId; if (plugin) { chainId = plugin.identifier + "-" + plugin.priority + "-" + _chainId++; } else { chainId = "Unknown-0-" + _chainId++; } var proxyChain = { getPlugin: function () { return plugin; }, getNext: function () { return nextProxy; }, processTelemetry: _processTelemetry, unload: _unloadPlugin, update: _updatePlugin, _id: chainId, _setNext: function (nextPlugin) { nextProxy = nextPlugin; } }; function _getTelCtx() { var itemCtx; if (plugin && isFunction(plugin[strGetTelCtx])) { itemCtx = plugin[strGetTelCtx](); } if (!itemCtx) { itemCtx = createProcessTelemetryContext(proxyChain, config, core); } return itemCtx; } function _processChain(itemCtx, processPluginFn, name, details, isAsync) { var hasRun = false; var identifier = plugin ? plugin.identifier : strTelemetryPluginChain; var hasRunContext = itemCtx[strHasRunFlags]; if (!hasRunContext) { hasRunContext = itemCtx[strHasRunFlags] = {}; } itemCtx.setNext(nextProxy); if (plugin) { doPerf(itemCtx[strCore](), function () { return identifier + ":" + name; }, function () { hasRunContext[chainId] = true; try { var nextId = nextProxy ? nextProxy._id : strEmpty; if (nextId) { hasRunContext[nextId] = false; } hasRun = processPluginFn(itemCtx); } catch (error) { var hasNextRun = nextProxy ? hasRunContext[nextProxy._id] : true; if (hasNextRun) { hasRun = true; } if (!nextProxy || !hasNextRun) { _throwInternal(itemCtx.diagLog(), 1 , 73 , "Plugin [" + identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext)); } } }, details, isAsync); } return hasRun; } function _processTelemetry(env, itemCtx) { itemCtx = itemCtx || _getTelCtx(); function _callProcessTelemetry(itemCtx) { if (!plugin || !hasProcessTelemetry) { return false; } var pluginState = _getPluginState(plugin); if (pluginState.teardown || pluginState[strDisabled]) { return false; } if (hasSetNext) { plugin.setNextPlugin(nextProxy); } plugin.processTelemetry(env, itemCtx); return true; } if (!_processChain(itemCtx, _callProcessTelemetry, "processTelemetry", function () { return ({ item: env }); }, !(env.sync))) { itemCtx.processNext(env); } } function _unloadPlugin(unloadCtx, unloadState) { function _callTeardown() { var hasRun = false; if (plugin) { var pluginState = _getPluginState(plugin); var pluginCore = plugin[strCore] || pluginState.core; if (plugin && (!pluginCore || pluginCore === unloadCtx[strCore]()) && !pluginState[strTeardown]) { pluginState[strCore] = null; pluginState[strTeardown] = true; pluginState[strIsInitialized] = false; if (plugin[strTeardown] && plugin[strTeardown](unloadCtx, unloadState) === true) { hasRun = true; } } } return hasRun; } if (!_processChain(unloadCtx, _callTeardown, "unload", function () { }, unloadState.isAsync)) { unloadCtx.processNext(unloadState); } } function _updatePlugin(updateCtx, updateState) { function _callUpdate() { var hasRun = false; if (plugin) { var pluginState = _getPluginState(plugin); var pluginCore = plugin[strCore] || pluginState.core; if (plugin && (!pluginCore || pluginCore === updateCtx[strCore]()) && !pluginState[strTeardown]) { if (plugin[strUpdate] && plugin[strUpdate](updateCtx, updateState) === true) { hasRun = true; } } } return hasRun; } if (!_processChain(updateCtx, _callUpdate, "update", function () { }, false)) { updateCtx.processNext(updateState); } } return objFreeze(proxyChain); } var strExtensionConfig = "extensionConfig"; function createUnloadHandlerContainer() { var handlers = []; function _addHandler(handler) { if (handler) { handlers.push(handler); } } function _runHandlers(unloadCtx, unloadState) { arrForEach(handlers, function (handler) { try { handler(unloadCtx, unloadState); } catch (e) { _throwInternal(unloadCtx.diagLog(), 2 , 73 , "Unexpected error calling unload handler - " + dumpObj(e)); } }); handlers = []; } return { add: _addHandler, run: _runHandlers }; } var strGetPlugin = "getPlugin"; var BaseTelemetryPlugin = /** @class */ (function () { function BaseTelemetryPlugin() { var _self = this; var _isinitialized; var _rootCtx; var _nextPlugin; var _unloadHandlerContainer; var _hooks; _initDefaults(); dynamicProto(BaseTelemetryPlugin, _self, function (_self) { _self.initialize = function (config, core, extensions, pluginChain) { _setDefaults(config, core, pluginChain); _isinitialized = true; }; _self.teardown = function (unloadCtx, unloadState) { var core = _self.core; if (!core || (unloadCtx && core !== unloadCtx.core())) { return; } var result; var unloadDone = false; var theUnloadCtx = unloadCtx || createProcessTelemetryUnloadContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin); var theUnloadState = unloadState || { reason: 0 , isAsync: false }; function _unloadCallback() { if (!unloadDone) { unloadDone = true; _unloadHandlerContainer.run(theUnloadCtx, unloadState); arrForEach(_hooks, function (fn) { fn.rm(); }); _hooks = []; if (result === true) { theUnloadCtx.processNext(theUnloadState); } _initDefaults(); } } if (!_self[strDoTeardown] || _self[strDoTeardown](theUnloadCtx, theUnloadState, _unloadCallback) !== true) { _unloadCallback(); } else { result = true; } return result; }; _self.update = function (updateCtx, updateState) { var core = _self.core; if (!core || (updateCtx && core !== updateCtx.core())) { return; } var result; var updateDone = false; var theUpdateCtx = updateCtx || createProcessTelemetryUpdateContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin); var theUpdateState = updateState || { reason: 0 }; function _updateCallback() { if (!updateDone) { updateDone = true; _setDefaults(theUpdateCtx.getCfg(), theUpdateCtx.core(), theUpdateCtx.getNext()); } } if (!_self._doUpdate || _self._doUpdate(theUpdateCtx, theUpdateState, _updateCallback) !== true) { _updateCallback(); } else { result = true; } return result; }; _self._addHook = function (hooks) { if (hooks) { if (isArray(hooks)) { _hooks = _hooks.concat(hooks); } else { _hooks.push(hooks); } } }; proxyFunctionAs(_self, "_addUnloadCb", function () { return _unloadHandlerContainer; }, "add"); }); _self.diagLog = function (itemCtx) { return _getTelCtx(itemCtx).diagLog(); }; _self[strIsInitialized] = function () { return _isinitialized; }; _self.setInitialized = function (isInitialized) { _isinitialized = isInitialized; }; _self[strSetNextPlugin] = function (next) { _nextPlugin = next; }; _self.processNext = function (env, itemCtx) { if (itemCtx) { itemCtx.processNext(env); } else if (_nextPlugin && isFunction(_nextPlugin.processTelemetry)) { _nextPlugin.processTelemetry(env, null); } }; _self._getTelCtx = _getTelCtx; function _getTelCtx(currentCtx) { if (currentCtx === void 0) { currentCtx = null; } var itemCtx = currentCtx; if (!itemCtx) { var rootCtx = _rootCtx || createProcessTelemetryContext(null, {}, _self.core); if (_nextPlugin && _nextPlugin[strGetPlugin]) { itemCtx = rootCtx.createNew(null, _nextPlugin[strGetPlugin]); } else { itemCtx = rootCtx.createNew(null, _nextPlugin); } } return itemCtx; } function _setDefaults(config, core, pluginChain) { if (config) { setValue(config, strExtensionConfig, [], null, isNullOrUndefined); } if (!pluginChain && core) { pluginChain = core.getProcessTelContext().getNext(); } var nextPlugin = _nextPlugin; if (_nextPlugin && _nextPlugin[strGetPlugin]) { nextPlugin = _nextPlugin[strGetPlugin](); } _self.core = core; _rootCtx = createProcessTelemetryContext(pluginChain, config, core, nextPlugin); } function _initDefaults() { _isinitialized = false; _self.core = null; _rootCtx = null; _nextPlugin = null; _hooks = []; _unloadHandlerContainer = createUnloadHandlerContainer(); } } return BaseTelemetryPlugin; }()); var strOnPrefix = "on"; var strAttachEvent = "attachEvent"; var strAddEventHelper = "addEventListener"; var strDetachEvent = "detachEvent"; var strRemoveEventListener = "removeEventListener"; var strEvents = "events"; var strVisibilityChangeEvt = "visibilitychange"; var strPageHide = "pagehide"; var strPageShow = "pageshow"; var strUnload = "unload"; var strBeforeUnload = "beforeunload"; var strPageHideNamespace = createUniqueNamespace("aiEvtPageHide"); var strPageShowNamespace = createUniqueNamespace("aiEvtPageShow"); var rRemoveEmptyNs = /\.[\.]+/g; var rRemoveTrailingEmptyNs = /[\.]+$/; var _guid = 1; var elmNodeData = createElmNodeData("events"); var eventNamespace = /^([^.]*)(?:\.(.+)|)/; function _normalizeNamespace(name) { if (name && name.replace) { return name.replace(/^\s*\.*|\.*\s*$/g, ""); } return name; } function _getEvtNamespace(eventName, evtNamespace) { if (evtNamespace) { var theNamespace_1 = ""; if (isArray(evtNamespace)) { theNamespace_1 = ""; arrForEach(evtNamespace, function (name) { name = _normalizeNamespace(name); if (name) { if (name[0] !== ".") { name = "." + name; } theNamespace_1 += name; } }); } else { theNamespace_1 = _normalizeNamespace(evtNamespace); } if (theNamespace_1) { if (theNamespace_1[0] !== ".") { theNamespace_1 = "." + theNamespace_1; } eventName = (eventName || "") + theNamespace_1; } } var parsedEvent = (eventNamespace.exec(eventName || "") || []); return { type: parsedEvent[1], ns: ((parsedEvent[2] || "").replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, "").split(".").sort()).join(".") }; } function _getRegisteredEvents(target, evtName, addDefault) { if (addDefault === void 0) { addDefault = true; } var aiEvts = elmNodeData.get(target, strEvents, {}, addDefault); var registeredEvents = aiEvts[evtName]; if (!registeredEvents) { registeredEvents = aiEvts[evtName] = []; } return registeredEvents; } function _doDetach(obj, evtName, handlerRef, useCapture) { if (obj && evtName && evtName.type) { if (obj[strRemoveEventListener]) { obj[strRemoveEventListener](evtName.type, handlerRef, useCapture); } else if (obj[strDetachEvent]) { obj[strDetachEvent](strOnPrefix + evtName.type, handlerRef); } } } function _doAttach(obj, evtName, handlerRef, useCapture) { var result = false; if (obj && evtName && evtName.type && handlerRef) { if (obj[strAddEventHelper]) { obj[strAddEventHelper](evtName.type, handlerRef, useCapture); result = true; } else if (obj[strAttachEvent]) { obj[strAttachEvent](strOnPrefix + evtName.type, handlerRef); result = true; } } return result; } function _doUnregister(target, events, evtName, unRegFn) { var idx = events.length; while (idx--) { var theEvent = events[idx]; if (theEvent) { if (!evtName.ns || evtName.ns === theEvent.evtName.ns) { if (!unRegFn || unRegFn(theEvent)) { _doDetach(target, theEvent.evtName, theEvent.handler, theEvent.capture); events.splice(idx, 1); } } } } } function _unregisterEvents(target, evtName, unRegFn) { if (evtName.type) { _doUnregister(target, _getRegisteredEvents(target, evtName.type), evtName, unRegFn); } else { var eventCache = elmNodeData.get(target, strEvents, {}); objForEachKey(eventCache, function (evtType, events) { _doUnregister(target, events, evtName, unRegFn); }); if (objKeys(eventCache).length === 0) { elmNodeData.kill(target, strEvents); } } } function mergeEvtNamespace(theNamespace, namespaces) { var newNamespaces; if (namespaces) { if (isArray(namespaces)) { newNamespaces = [theNamespace].concat(namespaces); } else { newNamespaces = [theNamespace, namespaces]; } newNamespaces = (_getEvtNamespace("xx", newNamespaces).ns).split("."); } else { newNamespaces = theNamespace; } return newNamespaces; } function eventOn(target, eventName, handlerRef, evtNamespace, useCapture) { if (useCapture === void 0) { useCapture = false; } var result = false; if (target) { try { var evtName = _getEvtNamespace(eventName, evtNamespace); result = _doAttach(target, evtName, handlerRef, useCapture); if (result && elmNodeData.accept(target)) { var registeredEvent = { guid: _guid++, evtName: evtName, handler: handlerRef, capture: useCapture }; _getRegisteredEvents(target, evtName.type).push(registeredEvent); } } catch (e) { } } return result; } function eventOff(target, eventName, handlerRef, evtNamespace, useCapture) { if (useCapture === void 0) { useCapture = false; } if (target) { try { var evtName_1 = _getEvtNamespace(eventName, evtNamespace); var found_1 = false; _unregisterEvents(target, evtName_1, function (regEvent) { if ((evtName_1.ns && !handlerRef) || regEvent.handler === handlerRef) { found_1 = true; return true; } return false; }); if (!found_1) { _doDetach(target, evtName_1, handlerRef, useCapture); } } catch (e) { } } } function addEventHandler(eventName, callback, evtNamespace) { var result = false; var w = getWindow(); if (w) { result = eventOn(w, eventName, callback, evtNamespace); result = eventOn(w["body"], eventName, callback, evtNamespace) || result; } var doc = getDocument(); if (doc) { result = eventOn(doc, eventName, callback, evtNamespace) || result; } return result; } function removeEventHandler(eventName, callback, evtNamespace) { var w = getWindow(); if (w) { eventOff(w, eventName, callback, evtNamespace); eventOff(w["body"], eventName, callback, evtNamespace); } var doc = getDocument(); if (doc) { eventOff(doc, eventName, callback, evtNamespace); } } function _addEventListeners(events, listener, excludeEvents, evtNamespace) { var added = false; if (listener && events && events.length > 0) { arrForEach(events, function (name) { if (name) { if (!excludeEvents || arrIndexOf(excludeEvents, name) === -1) { added = addEventHandler(name, listener, evtNamespace) || added; } } }); } return added; } function addEventListeners(events, listener, excludeEvents, evtNamespace) { var added = false; if (listener && events && isArray(events)) { added = _addEventListeners(events, listener, excludeEvents, evtNamespace); if (!added && excludeEvents && excludeEvents.length > 0) { added = _addEventListeners(events, listener, null, evtNamespace); } } return added; } function removeEventListeners(events, listener, evtNamespace) { if (events && isArray(events)) { arrForEach(events, function (name) { if (name) { removeEventHandler(name, listener, evtNamespace); } }); } } function addPageUnloadEventListener(listener, excludeEvents, evtNamespace) { return addEventListeners([strBeforeUnload, strUnload, strPageHide], listener, excludeEvents, evtNamespace); } function removePageUnloadEventListener(listener, evtNamespace) { removeEventListeners([strBeforeUnload, strUnload, strPageHide], listener, evtNamespace); } function addPageHideEventListener(listener, excludeEvents, evtNamespace) { function _handlePageVisibility(evt) { var doc = getDocument(); if (listener && doc && doc.visibilityState === "hidden") { listener(evt); } } var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace); var pageUnloadAdded = _addEventListeners([strPageHide], listener, excludeEvents, newNamespaces); if (!excludeEvents || arrIndexOf(excludeEvents, strVisibilityChangeEvt) === -1) { pageUnloadAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageUnloadAdded; } if (!pageUnloadAdded && excludeEvents) { pageUnloadAdded = addPageHideEventListener(listener, null, evtNamespace); } return pageUnloadAdded; } function removePageHideEventListener(listener, evtNamespace) { var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace); removeEventListeners([strPageHide], listener, newNamespaces); removeEventListeners([strVisibilityChangeEvt], null, newNamespaces); } function addPageShowEventListener(listener, excludeEvents, evtNamespace) { function _handlePageVisibility(evt) { var doc = getDocument(); if (listener && doc && doc.visibilityState === "visible") { listener(evt); } } var newNamespaces = mergeEvtNamespace(strPageShowNamespace, evtNamespace); var pageShowAdded = _addEventListeners([strPageShow], listener, excludeEvents, newNamespaces); pageShowAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageShowAdded; if (!pageShowAdded && excludeEvents) { pageShowAdded = addPageShowEventListener(listener, null, evtNamespace); } return pageShowAdded; } function removePageShowEventListener(listener, evtNamespace) { var newNamespaces = mergeEvtNamespace(strPageShowNamespace, evtNamespace); removeEventListeners([strPageShow], listener, newNamespaces); removeEventListeners([strVisibilityChangeEvt], null, newNamespaces); } function perfNow() { var perf = getPerformance(); if (perf && perf.now) { return perf.now(); } return dateNow(); } var _a$1; var Version = '3.2.2'; var FullVersionString = "1DS-Web-JS-" + Version; var strDisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation"; var strWithCredentials = "withCredentials"; var strTimeout = "timeout"; var _fieldTypeEventPropMap = (_a$1 = {}, _a$1[0 ] = 0 , _a$1[2 ] = 6 , _a$1[1 ] = 1 , _a$1[3 ] = 7 , _a$1[4096 | 2 ] = 6 , _a$1[4096 | 1 ] = 1 , _a$1[4096 | 3 ] = 7 , _a$1); Boolean(getDocument()); Boolean(getWindow()); function isValueAssigned(value) { return !(value === "" || isNullOrUndefined(value)); } function getTenantId(apiKey) { if (apiKey) { var indexTenantId = apiKey.indexOf("-"); if (indexTenantId > -1) { return apiKey.substring(0, indexTenantId); } } return ""; } function sanitizeProperty(name, property, stringifyObjects) { if ((!property && !isValueAssigned(property)) || typeof name !== "string") { return null; } var propType = typeof property; if (propType === "string" || propType === "number" || propType === "boolean" || isArray(property)) { property = { value: property }; } else if (propType === "object" && !property.hasOwnProperty("value")) { property = { value: stringifyObjects ? JSON.stringify(property) : property }; } else if (isNullOrUndefined(property.value) || property.value === "" || (!isString(property.value) && !isNumber(property.value) && !isBoolean(property.value) && !isArray(property.value))) { return null; } if (isArray(property.value) && !isArrayValid(property.value)) { return null; } if (!isNullOrUndefined(property.kind)) { if (isArray(property.value) || !isValueKind(property.kind)) { return null; } property.value = property.value.toString(); } return property; } function getCommonSchemaMetaData(value, kind, type) { var encodedTypeValue = -1; if (!isUndefined(value)) { if (kind > 0) { if (kind === 32) { encodedTypeValue = (1 << 13); } else if (kind <= 13) { encodedTypeValue = (kind << 5); } } if (isDataType(type)) { if (encodedTypeValue === -1) { encodedTypeValue = 0; } encodedTypeValue |= type; } else { var propType = _fieldTypeEventPropMap[getFieldValueType(value)] || -1; if (encodedTypeValue !== -1 && propType !== -1) { encodedTypeValue |= propType; } else if (propType === 6 ) { encodedTypeValue = propType; } } } return encodedTypeValue; } function extend(obj, obj2, obj3, obj4, obj5) { var extended = {}; var deep = false; var i = 0; var length = arguments.length; var objProto = Object[strShimPrototype]; var theArgs = arguments; if (objProto.toString.call(theArgs[0]) === "[object Boolean]") { deep = theArgs[0]; i++; } for (; i < length; i++) { var obj = theArgs[i]; objForEachKey(obj, function (prop, value) { if (deep && value && isObject(value)) { if (isArray(value)) { extended[prop] = extended[prop] || []; arrForEach(value, function (arrayValue, arrayIndex) { if (arrayValue && isObject(arrayValue)) { extended[prop][arrayIndex] = extend(true, extended[prop][arrayIndex], arrayValue); } else { extended[prop][arrayIndex] = arrayValue; } }); } else { extended[prop] = extend(true, extended[prop], value); } } else { extended[prop] = value; } }); } return extended; } var getTime = perfNow; function isValueKind(value) { if (value === 0 || ((value > 0 && value <= 13 ) || value === 32 )) { return true; } return false; } function isDataType(value) { if (value >= 0 && value <= 9) { return true; } return false; } function isArrayValid(value) { return value.length > 0; } function setProcessTelemetryTimings(event, identifier) { var evt = event; evt.timings = evt.timings || {}; evt.timings.processTelemetryStart = evt.timings.processTelemetryStart || {}; evt.timings.processTelemetryStart[identifier] = getTime(); } function getFieldValueType(value) { var theType = 0 ; if (value !== null && value !== undefined) { var objType = typeof value; if (objType === "string") { theType = 1 ; } else if (objType === "number") { theType = 2 ; } else if (objType === "boolean") { theType = 3 ; } else if (objType === strShimObject) { theType = 4 ; if (isArray(value)) { theType = 4096 ; if (value.length > 0) { theType |= getFieldValueType(value[0]); } } else if (hasOwnProperty(value, "value")) { theType = 8192 | getFieldValueType(value.value); } } } return theType; } function isChromium() { return !!getGlobalInst("chrome"); } function openXhr(method, urlString, withCredentials, disabled, isSync, timeout) { if (disabled === void 0) { disabled = false; } if (isSync === void 0) { isSync = false; } function _wrapSetXhrProp(xhr, prop, value) { try { xhr[prop] = value; } catch (e) { } } var xhr = new XMLHttpRequest(); if (disabled) { _wrapSetXhrProp(xhr, strDisabledPropertyName, disabled); } if (withCredentials) { _wrapSetXhrProp(xhr, strWithCredentials, withCredentials); } xhr.open(method, urlString, !isSync); if (withCredentials) { _wrapSetXhrProp(xhr, strWithCredentials, withCredentials); } if (!isSync && timeout) { _wrapSetXhrProp(xhr, strTimeout, timeout); } return xhr; } var RT_PROFILE = "REAL_TIME"; var NRT_PROFILE = "NEAR_REAL_TIME"; var BE_PROFILE = "BEST_EFFORT"; var Method = "POST"; var DisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation"; var strDropped = "drop"; var strSending = "send"; var strRequeue = "requeue"; var strResponseFail = "rspFail"; var strOther = "oth"; var defaultCacheControl = "no-cache, no-store"; var defaultContentType = "application/x-json-stream"; var strCacheControl = "cache-control"; var strContentTypeHeader = "content-type"; var strKillTokensHeader = "kill-tokens"; var strKillDurationHeader = "kill-duration"; var strKillDurationSecondsHeader = "kill-duration-seconds"; var strTimeDeltaHeader = "time-delta-millis"; var strClientVersion = "client-version"; var strClientId = "client-id"; var strTimeDeltaToApply = "time-delta-to-apply-millis"; var strUploadTime = "upload-time"; var strApiKey = "apikey"; var strMsaDeviceTicket = "AuthMsaDeviceTicket"; var strAuthXToken = "AuthXToken"; var strNoResponseBody = "NoResponseBody"; var strMsfpc = "msfpc"; function _getEventMsfpc(theEvent) { var intWeb = ((theEvent.ext || {})["intweb"]); if (intWeb && isValueAssigned(intWeb[strMsfpc])) { return intWeb[strMsfpc]; } return null; } function _getMsfpc(theEvents) { var msfpc = null; for (var lp = 0; msfpc === null && lp < theEvents.length; lp++) { msfpc = _getEventMsfpc(theEvents[lp]); } return msfpc; } var EventBatch = /** @class */ (function () { function EventBatch(iKey, addEvents) { var events = addEvents ? [].concat(addEvents) : []; var _self = this; var _msfpc = _getMsfpc(events); _self.iKey = function () { return iKey; }; _self.Msfpc = function () { return _msfpc || ""; }; _self.count = function () { return events.length; }; _self.events = function () { return events; }; _self.addEvent = function (theEvent) { if (theEvent) { events.push(theEvent); if (!_msfpc) { _msfpc = _getEventMsfpc(theEvent); } return true; } return false; }; _self.split = function (fromEvent, numEvents) { var theEvents; if (fromEvent < events.length) { var cnt = events.length - fromEvent; if (!isNullOrUndefined(numEvents)) { cnt = numEvents < cnt ? numEvents : cnt; } theEvents = events.splice(fromEvent, cnt); _msfpc = _getMsfpc(events); } return new EventBatch(iKey, theEvents); }; } EventBatch.create = function (iKey, theEvents) { return new EventBatch(iKey, theEvents); }; return EventBatch; }()); var _MAX_STRING_JOINS = 20; var RequestSizeLimitBytes = 3984588; var BeaconRequestSizeLimitBytes = 65000; var MaxRecordSize = 2000000; var MaxBeaconRecordSize = Math.min(MaxRecordSize, BeaconRequestSizeLimitBytes); var metadata = "metadata"; var f = "f"; var rCheckDot = /\./; var Serializer = /** @class */ (function () { function Serializer(perfManager, valueSanitizer, stringifyObjects, enableCompoundKey) { var strData = "data"; var strBaseData = "baseData"; var strExt = "ext"; var _checkForCompoundkey = !!enableCompoundKey; var _processSubMetaData = true; var _theSanitizer = valueSanitizer; var _isReservedCache = {}; dynamicProto(Serializer, this, function (_self) { _self.createPayload = function (retryCnt, isTeardown, isSync, useSendBeacon, sendReason, sendType) { return { apiKeys: [], payloadBlob: "", overflow: null, sizeExceed: [], failedEvts: [], batches: [], numEvents: 0, retryCnt: retryCnt, isTeardown: isTeardown, isSync: isSync, isBeacon: useSendBeacon, sendType: sendType, sendReason: sendReason }; }; _self.appendPayload = function (payload, theBatch, maxEventsPerBatch) { var canAddEvents = payload && theBatch && !payload.overflow; if (canAddEvents) { doPerf(perfManager, function () { return "Serializer:appendPayload"; }, function () { var theEvents = theBatch.events(); var payloadBlob = payload.payloadBlob; var payloadEvents = payload.numEvents; var eventsAdded = false; var sizeExceeded = []; var failedEvts = []; var isBeaconPayload = payload.isBeacon; var requestMaxSize = isBeaconPayload ? BeaconRequestSizeLimitBytes : RequestSizeLimitBytes; var recordMaxSize = isBeaconPayload ? MaxBeaconRecordSize : MaxRecordSize; var lp = 0; var joinCount = 0; while (lp < theEvents.length) { var theEvent = theEvents[lp]; if (theEvent) { if (payloadEvents >= maxEventsPerBatch) { payload.overflow = theBatch.split(lp); break; } var eventBlob = _self.getEventBlob(theEvent); if (eventBlob && eventBlob.length <= recordMaxSize) { var blobLength = eventBlob.length; var currentSize = payloadBlob.length; if (currentSize + blobLength > requestMaxSize) { payload.overflow = theBatch.split(lp); break; } if (payloadBlob) { payloadBlob += "\n"; } payloadBlob += eventBlob; joinCount++; if (joinCount > _MAX_STRING_JOINS) { payloadBlob.substr(0, 1); joinCount = 0; } eventsAdded = true; payloadEvents++; } else { if (eventBlob) { sizeExceeded.push(theEvent); } else { failedEvts.push(theEvent); } theEvents.splice(lp, 1); lp--; } } lp++; } if (sizeExceeded && sizeExceeded.length > 0) { payload.sizeExceed.push(EventBatch.create(theBatch.iKey(), sizeExceeded)); } if (failedEvts && failedEvts.length > 0) { payload.failedEvts.push(EventBatch.create(theBatch.iKey(), failedEvts)); } if (eventsAdded) { payload.batches.push(theBatch); payload.payloadBlob = payloadBlob; payload.numEvents = payloadEvents; var apiKey = theBatch.iKey(); if (arrIndexOf(payload.apiKeys, apiKey) === -1) { payload.apiKeys.push(apiKey); } } }, function () { return ({ payload: payload, theBatch: { iKey: theBatch.iKey(), evts: theBatch.events() }, max: maxEventsPerBatch }); }); } return canAddEvents; }; _self.getEventBlob = function (eventData) { try { return doPerf(perfManager, function () { return "Serializer.getEventBlob"; }, function () { var serializedEvent = {}; serializedEvent.name = eventData.name; serializedEvent.time = eventData.time; serializedEvent.ver = eventData.ver; serializedEvent.iKey = "o:" + getTenantId(eventData.iKey); var serializedExt = {}; var eventExt = eventData[strExt]; if (eventExt) { serializedEvent[strExt] = serializedExt; objForEachKey(eventExt, function (key, value) { var data = serializedExt[key] = {}; _processPathKeys(value, data, "ext." + key, true, null, null, true); }); } var serializedData = serializedEvent[strData] = {}; serializedData.baseType = eventData.baseType; var serializedBaseData = serializedData[strBaseData] = {}; _processPathKeys(eventData.baseData, serializedBaseData, strBaseData, false, [strBaseData], function (pathKeys, name, value) { _addJSONPropertyMetaData(serializedExt, pathKeys, name, value); }, _processSubMetaData); _processPathKeys(eventData.data, serializedData, strData, false, [], function (pathKeys, name, value) { _addJSONPropertyMetaData(serializedExt, pathKeys, name, value); }, _processSubMetaData); return JSON.stringify(serializedEvent); }, function () { return ({ item: eventData }); }); } catch (e) { return null; } }; function _isReservedField(path, name) { var result = _isReservedCache[path]; if (result === undefined) { if (path.length >= 7) { result = strStartsWith(path, "ext.metadata") || strStartsWith(path, "ext.web"); } _isReservedCache[path] = result; } return result; } function _processPathKeys(srcObj, target, thePath, checkReserved, metadataPathKeys, metadataCallback, processSubKeys) { objForEachKey(srcObj, function (key, srcValue) { var prop = null; if (srcValue || isValueAssigned(srcValue)) { var path = thePath; var name_1 = key; var theMetaPathKeys = metadataPathKeys; var destObj = target; if (_checkForCompoundkey && !checkReserved && rCheckDot.test(key)) { var subKeys = key.split("."); var keyLen = subKeys.length; if (keyLen > 1) { if (theMetaPathKeys) { theMetaPathKeys = theMetaPathKeys.slice(); } for (var lp = 0; lp < keyLen - 1; lp++) { var subKey = subKeys[lp]; destObj = destObj[subKey] = destObj[subKey] || {}; path += "." + subKey; if (theMetaPathKeys) { theMetaPathKeys.push(subKey); } } name_1 = subKeys[keyLen - 1]; } } var isReserved = checkReserved && _isReservedField(path); if (!isReserved && _theSanitizer && _theSanitizer.handleField(path, name_1)) { prop = _theSanitizer.value(path, name_1, srcValue, stringifyObjects); } else { prop = sanitizeProperty(name_1, srcValue, stringifyObjects); } if (prop) { var newValue = prop.value; destObj[name_1] = newValue; if (metadataCallback) { metadataCallback(theMetaPathKeys, name_1, prop); } if (processSubKeys && typeof newValue === "object" && !isArray(newValue)) { var newPath = theMetaPathKeys; if (newPath) { newPath = newPath.slice(); newPath.push(name_1); } _processPathKeys(srcValue, newValue, path + "." + name_1, checkReserved, newPath, metadataCallback, processSubKeys); } } } }); } }); } return Serializer; }()); function _addJSONPropertyMetaData(json, propKeys, name, propertyValue) { if (propertyValue && json) { var encodedTypeValue = getCommonSchemaMetaData(propertyValue.value, propertyValue.kind, propertyValue.propertyType); if (encodedTypeValue > -1) { var metaData = json[metadata]; if (!metaData) { metaData = json[metadata] = { f: {} }; } var metaTarget = metaData[f]; if (!metaTarget) { metaTarget = metaData[f] = {}; } if (propKeys) { for (var lp = 0; lp < propKeys.length; lp++) { var key = propKeys[lp]; if (!metaTarget[key]) { metaTarget[key] = { f: {} }; } var newTarget = metaTarget[key][f]; if (!newTarget) { newTarget = metaTarget[key][f] = {}; } metaTarget = newTarget; } } metaTarget = metaTarget[name] = {}; if (isArray(propertyValue.value)) { metaTarget["a"] = { t: encodedTypeValue }; } else { metaTarget["t"] = encodedTypeValue; } } } } var RandomizationLowerThreshold = 0.8; var RandomizationUpperThreshold = 1.2; var BaseBackoff = 3000; var MaxBackoff = 600000; function retryPolicyShouldRetryForStatus(httpStatusCode) { return !((httpStatusCode >= 300 && httpStatusCode < 500 && httpStatusCode != 408 && httpStatusCode != 429) || (httpStatusCode == 501) || (httpStatusCode == 505)); } function retryPolicyGetMillisToBackoffForRetry(retriesSoFar) { var waitDuration = 0; var minBackoff = BaseBackoff * RandomizationLowerThreshold; var maxBackoff = BaseBackoff * RandomizationUpperThreshold; var randomBackoff = Math.floor(Math.random() * (maxBackoff - minBackoff)) + minBackoff; waitDuration = Math.pow(2, retriesSoFar) * randomBackoff; return Math.min(waitDuration, MaxBackoff); } var SecToMsMultiplier = 1000; var KillSwitch = /** @class */ (function () { function KillSwitch() { var _killedTokenDictionary = {}; function _normalizeTenants(values) { var result = []; if (values) { arrForEach(values, function (value) { result.push(strTrim(value)); }); } return result; } dynamicProto(KillSwitch, this, function (_self) { _self.setKillSwitchTenants = function (killTokens, killDuration) { if (killTokens && killDuration) { try { var killedTokens = _normalizeTenants(killTokens.split(",")); if (killDuration === "this-request-only") { return killedTokens; } var durationMs = parseInt(killDuration, 10) * SecToMsMultiplier; for (var i = 0; i < killedTokens.length; ++i) { _killedTokenDictionary[killedTokens[i]] = dateNow() + durationMs; } } catch (ex) { return []; } } return []; }; _self.isTenantKilled = function (tenantToken) { var killDictionary = _killedTokenDictionary; var name = strTrim(tenantToken); if (killDictionary[name] !== undefined && killDictionary[name] > dateNow()) { return true; } delete killDictionary[name]; return false; }; }); } return KillSwitch; }()); var EVTKillSwitch = KillSwitch; var ClockSkewManager = /** @class */ (function () { function ClockSkewManager() { var _allowRequestSending = true; var _shouldAddClockSkewHeaders = true; var _isFirstRequest = true; var _clockSkewHeaderValue = "use-collector-delta"; var _clockSkewSet = false; dynamicProto(ClockSkewManager, this, function (_self) { _self.allowRequestSending = function () { return _allowRequestSending; }; _self.firstRequestSent = function () { if (_isFirstRequest) { _isFirstRequest = false; if (!_clockSkewSet) { _allowRequestSending = false; } } }; _self.shouldAddClockSkewHeaders = function () { return _shouldAddClockSkewHeaders; }; _self.getClockSkewHeaderValue = function () { return _clockSkewHeaderValue; }; _self.setClockSkew = function (timeDeltaInMillis) { if (!_clockSkewSet) { if (timeDeltaInMillis) { _clockSkewHeaderValue = timeDeltaInMillis; _shouldAddClockSkewHeaders = true; _clockSkewSet = true; } else { _shouldAddClockSkewHeaders = false; } _allowRequestSending = true; } }; }); } return ClockSkewManager; }()); var EVTClockSkewManager = ClockSkewManager; var _a; var strSendAttempt = "sendAttempt"; var _noResponseQs = "&" + strNoResponseBody + "=true"; var _eventActionMap = (_a = {}, _a[1 ] = strRequeue, _a[100 ] = strRequeue, _a[200 ] = "sent", _a[8004 ] = strDropped, _a[8003 ] = strDropped, _a); var _collectorQsHeaders = {}; var _collectorHeaderToQs = {}; function _addCollectorHeaderQsMapping(qsName, headerName, allowQs) { _collectorQsHeaders[qsName] = headerName; if (allowQs !== false) { _collectorHeaderToQs[headerName] = qsName; } } _addCollectorHeaderQsMapping(strMsaDeviceTicket, strMsaDeviceTicket, false); _addCollectorHeaderQsMapping(strClientVersion, strClientVersion); _addCollectorHeaderQsMapping(strClientId, "Client-Id"); _addCollectorHeaderQsMapping(strApiKey, strApiKey); _addCollectorHeaderQsMapping(strTimeDeltaToApply, strTimeDeltaToApply); _addCollectorHeaderQsMapping(strUploadTime, strUploadTime); _addCollectorHeaderQsMapping(strAuthXToken, strAuthXToken); function _getResponseText(xhr) { try { return xhr.responseText; } catch (e) { } return ""; } function _hasHeader(headers, header) { var hasHeader = false; if (headers && header) { var keys = objKeys(headers); if (keys && keys.length > 0) { var lowerHeader = header.toLowerCase(); for (var lp = 0; lp < keys.length; lp++) { var value = keys[lp]; if (value && hasOwnProperty(header, value) && value.toLowerCase() === lowerHeader) { hasHeader = true; break; } } } } return hasHeader; } function _addRequestDetails(details, name, value, useHeaders) { if (name && value && value.length > 0) { if (useHeaders && _collectorQsHeaders[name]) { details.hdrs[_collectorQsHeaders[name]] = value; details.useHdrs = true; } else { details.url += "&" + name + "=" + value; } } } var HttpManager = /** @class */ (function () { function HttpManager(maxEventsPerBatch, maxConnections, maxRequestRetriesBeforeBackoff, actions, timeoutOverride) { this._responseHandlers = []; var _urlString = "?cors=true&" + strContentTypeHeader.toLowerCase() + "=" + defaultContentType; var _killSwitch = new EVTKillSwitch(); var _paused = false; var _clockSkewManager = new EVTClockSkewManager(); var _useBeacons = false; var _outstandingRequests = 0; var _postManager; var _sendInterfaces; var _core; var _customHttpInterface = true; var _queryStringParameters = []; var _headers = {}; var _batchQueue = []; var _serializer = null; var _enableEventTimings = false; var _cookieMgr; var _isUnloading = false; var _useHeaders = false; var _xhrTimeout; var _disableXhrSync; dynamicProto(HttpManager, this, function (_self) { var _sendCredentials = true; _self.initialize = function (endpointUrl, core, postChannel, httpInterface, channelConfig) { var _a; if (!channelConfig) { channelConfig = {}; } _urlString = endpointUrl + _urlString; _useHeaders = !isUndefined(channelConfig.avoidOptions) ? !channelConfig.avoidOptions : true; _core = core; _cookieMgr = core.getCookieMgr(); _enableEventTimings = !_core.config.disableEventTimings; var enableCompoundKey = !!_core.config.enableCompoundKey; _postManager = postChannel; var valueSanitizer = channelConfig.valueSanitizer; var stringifyObjects = channelConfig.stringifyObjects; if (!isUndefined(channelConfig.enableCompoundKey)) { enableCompoundKey = !!channelConfig.enableCompoundKey; } _xhrTimeout = channelConfig.xhrTimeout; _disableXhrSync = channelConfig.disableXhrSync; _useBeacons = !isReactNative(); _serializer = new Serializer(_core, valueSanitizer, stringifyObjects, enableCompoundKey); var syncHttpInterface = httpInterface; var beaconHttpInterface = channelConfig.alwaysUseXhrOverride ? httpInterface : null; var fetchSyncHttpInterface = channelConfig.alwaysUseXhrOverride ? httpInterface : null; if (!httpInterface) { _customHttpInterface = false; var location_1 = getLocation(); if (location_1 && location_1.protocol && location_1.protocol.toLowerCase() === "file:") { _sendCredentials = false; } var theTransports = []; if (isReactNative()) { theTransports = [2 , 1 ]; } else { theTransports = [1 , 2 , 3 ]; } var configTransports = channelConfig.transports; if (configTransports) { if (isNumber(configTransports)) { theTransports = [configTransports].concat(theTransports); } else if (isArray(configTransports)) { theTransports = configTransports.concat(theTransports); } } httpInterface = _getSenderInterface(theTransports, false); syncHttpInterface = _getSenderInterface(theTransports, true); if (!httpInterface) { _postManager.diagLog().warnToConsole("No available transport to send events"); } } _sendInterfaces = (_a = {}, _a[0 ] = httpInterface, _a[1 ] = syncHttpInterface || _getSenderInterface([1 , 2 , 3 ], true), _a[2 ] = beaconHttpInterface || _getSenderInterface([3 , 2 ], true) || syncHttpInterface || _getSenderInterface([1 ], true), _a[3 ] = fetchSyncHttpInterface || _getSenderInterface([2 , 3 ], true) || syncHttpInterface || _getSenderInterface([1 ], true), _a); }; function _getSenderInterface(transports, syncSupport) { var transportType = 0 ; var sendPostFunc = null; var lp = 0; while (sendPostFunc == null && lp < transports.length) { transportType = transports[lp]; if (transportType === 1 ) { if (useXDomainRequest()) { sendPostFunc = _xdrSendPost; } else if (isXhrSupported()) { sendPostFunc = _xhrSendPost; } } else if (transportType === 2 && isFetchSupported(syncSupport)) { sendPostFunc = _fetchSendPost; } else if (_useBeacons && transportType === 3 && isBeaconsSupported()) { sendPostFunc = _beaconSendPost; } lp++; } if (sendPostFunc) { return { _transport: transportType, _isSync: syncSupport, sendPOST: sendPostFunc }; } return null; } _self["_getDbgPlgTargets"] = function () { return [_sendInterfaces[0 ], _killSwitch, _serializer, _sendInterfaces]; }; function _xdrSendPost(payload, oncomplete, sync) { var xdr = new XDomainRequest(); xdr.open(Method, payload.urlString); if (payload.timeout) { xdr.timeout = payload.timeout; } xdr.onload = function () { var response = _getResponseText(xdr); _doOnComplete(oncomplete, 200, {}, response); _handleCollectorResponse(response); }; xdr.onerror = function () { _doOnComplete(oncomplete, 400, {}); }; xdr.ontimeout = function () { _doOnComplete(oncomplete, 500, {}); }; xdr.onprogress = function () { }; if (sync) { xdr.send(payload.data); } else { timeoutOverride.set(function () { xdr.send(payload.data); }, 0); } } function _fetchSendPost(payload, oncomplete, sync) { var _a; var theUrl = payload.urlString; var ignoreResponse = false; var responseHandled = false; var requestInit = (_a = { body: payload.data, method: Method }, _a[DisabledPropertyName] = true, _a); if (sync) { requestInit.keepalive = true; if (payload._sendReason === 2 ) { ignoreResponse = true; theUrl += _noResponseQs; } } if (_sendCredentials) { requestInit.credentials = "include"; } if (payload.headers && objKeys(payload.headers).length > 0) { requestInit.headers = payload.headers; } fetch(theUrl, requestInit).then(function (response) { var headerMap = {}; var responseText = ""; if (response.headers) { response.headers.forEach(function (value, name) { headerMap[name] = value; }); } if (response.body) { response.text().then(function (text) { responseText = text; }); } if (!responseHandled) { responseHandled = true; _doOnComplete(oncomplete, response.status, headerMap, responseText); _handleCollectorResponse(responseText); } })["catch"](function (error) { if (!responseHandled) { responseHandled = true; _doOnComplete(oncomplete, 0, {}); } }); if (ignoreResponse && !responseHandled) { responseHandled = true; _doOnComplete(oncomplete, 200, {}); } if (!responseHandled && payload.timeout > 0) { timeoutOverride.set(function () { if (!responseHandled) { responseHandled = true; _doOnComplete(oncomplete, 500, {}); } }, payload.timeout); } } function _xhrSendPost(payload, oncomplete, sync) { var theUrl = payload.urlString; function _appendHeader(theHeaders, xhr, name) { if (!theHeaders[name] && xhr && xhr.getResponseHeader) { var value = xhr.getResponseHeader(name); if (value) { theHeaders[name] = strTrim(value); } } return theHeaders; } function _getAllResponseHeaders(xhr) { var theHeaders = {}; if (!xhr.getAllResponseHeaders) { theHeaders = _appendHeader(theHeaders, xhr, strTimeDeltaHeader); theHeaders = _appendHeader(theHeaders, xhr, strKillDurationHeader); theHeaders = _appendHeader(theHeaders, xhr, strKillDurationSecondsHeader); } else { theHeaders = _convertAllHeadersToMap(xhr.getAllResponseHeaders()); } return theHeaders; } function xhrComplete(xhr, responseTxt) { _doOnComplete(oncomplete, xhr.status, _getAllResponseHeaders(xhr), responseTxt); } if (sync && payload.disableXhrSync) { sync = false; } var xhrRequest = openXhr(Method, theUrl, _sendCredentials, true, sync, payload.timeout); objForEachKey(payload.headers, function (name, value) { xhrRequest.setRequestHeader(name, value); }); xhrRequest.onload = function () { var response = _getResponseText(xhrRequest); xhrComplete(xhrRequest, response); _handleCollectorResponse(response); }; xhrRequest.onerror = function () { xhrComplete(xhrRequest); }; xhrRequest.ontimeout = function () { xhrComplete(xhrRequest); }; xhrRequest.send(payload.data); } function _doOnComplete(oncomplete, status, headers, response) { try { oncomplete(status, headers, response); } catch (e) { _throwInternal(_postManager.diagLog(), 2 , 518 , dumpObj(e)); } } function _beaconSendPost(payload, oncomplete, sync) { var internalPayloadData = payload; var status = 200; var thePayload = internalPayloadData._thePayload; var theUrl = payload.urlString + _noResponseQs; try { var nav_1 = getNavigator(); if (!nav_1.sendBeacon(theUrl, payload.data)) { if (thePayload) { var droppedBatches_1 = []; arrForEach(thePayload.batches, function (theBatch) { if (droppedBatches_1 && theBatch && theBatch.count() > 0) { var theEvents = theBatch.events(); for (var lp = 0; lp < theEvents.length; lp++) { if (!nav_1.sendBeacon(theUrl, _serializer.getEventBlob(theEvents[lp]))) { droppedBatches_1.push(theBatch.split(lp)); break; } } } else { droppedBatches_1.push(theBatch.split(0)); } }); _sendBatchesNotification(droppedBatches_1, 8003 , thePayload.sendType, true); } else { status = 0; } } } catch (ex) { _postManager.diagLog().warnToConsole("Failed to send telemetry using sendBeacon API. Ex:" + dumpObj(ex)); status = 0; } finally { _doOnComplete(oncomplete, status, {}, ""); } } function _isBeaconPayload(sendType) { return sendType === 2 || sendType === 3 ; } function _adjustSendType(sendType) { if (_isUnloading && _isBeaconPayload(sendType)) { sendType = 2 ; } return sendType; } _self.addQueryStringParameter = function (name, value) { for (var i = 0; i < _queryStringParameters.length; i++) { if (_queryStringParameters[i].name === name) { _queryStringParameters[i].value = value; return; } } _queryStringParameters.push({ name: name, value: value }); }; _self.addHeader = function (name, value) { _headers[name] = value; }; _self.canSendRequest = function () { return _hasIdleConnection() && _clockSkewManager.allowRequestSending(); }; _self.sendQueuedRequests = function (sendType, sendReason) { if (isUndefined(sendType)) { sendType = 0 ; } if (_isUnloading) { sendType = _adjustSendType(sendType); sendReason = 2 ; } if (_canSendPayload(_batchQueue, sendType, 0)) { _sendBatches(_clearQueue(), 0, false, sendType, sendReason || 0 ); } }; _self.isCompletelyIdle = function () { return !_paused && _outstandingRequests === 0 && _batchQueue.length === 0; }; _self.setUnloading = function (value) { _isUnloading = value; }; _self.addBatch = function (theBatch) { if (theBatch && theBatch.count() > 0) { if (_killSwitch.isTenantKilled(theBatch.iKey())) { return false; } _batchQueue.push(theBatch); } return true; }; _self.teardown = function () { if (_batchQueue.length > 0) { _sendBatches(_clearQueue(), 0, true, 2 , 2 ); } }; _self.pause = function () { _paused = true; }; _self.resume = function () { _paused = false; _self.sendQueuedRequests(0 , 4 ); }; _self.sendSynchronousBatch = function (batch, sendType, sendReason) { if (batch && batch.count() > 0) { if (isNullOrUndefined(sendType)) { sendType = 1 ; } if (_isUnloading) { sendType = _adjustSendType(sendType); sendReason = 2 ; } _sendBatches([batch], 0, false, sendType, sendReason || 0 ); } }; function _hasIdleConnection() { return !_paused && _outstandingRequests < maxConnections; } function _clearQueue() { var theQueue = _batchQueue; _batchQueue = []; return theQueue; } function _canSendPayload(theBatches, sendType, retryCnt) { var result = false; if (theBatches && theBatches.length > 0 && !_paused && _sendInterfaces[sendType] && _serializer) { result = (sendType !== 0 ) || (_hasIdleConnection() && (retryCnt > 0 || _clockSkewManager.allowRequestSending())); } return result; } function _createDebugBatches(theBatches) { var values = {}; if (theBatches) { arrForEach(theBatches, function (theBatch, idx) { values[idx] = { iKey: theBatch.iKey(), evts: theBatch.events() }; }); } return values; } function _sendBatches(theBatches, retryCount, isTeardown, sendType, sendReason) { if (!theBatches || theBatches.length === 0) { return; } if (_paused) { _sendBatchesNotification(theBatches, 1 , sendType); return; } sendType = _adjustSendType(sendType); try { var orgBatches_1 = theBatches; var isSynchronous_1 = sendType !== 0 ; doPerf(_core, function () { return "HttpManager:_sendBatches"; }, function (perfEvt) { if (perfEvt) { theBatches = theBatches.slice(0); } var droppedBatches = []; var thePayload = null; var serializationStart = getTime(); var sendInterface = _sendInterfaces[sendType] || (isSynchronous_1 ? _sendInterfaces[1 ] : _sendInterfaces[0 ]); var isBeaconTransport = (_isUnloading || _isBeaconPayload(sendType) || (sendInterface && sendInterface._transport === 3 )) && _canUseSendBeaconApi(); while (_canSendPayload(theBatches, sendType, retryCount)) { var theBatch = theBatches.shift(); if (theBatch && theBatch.count() > 0) { if (!_killSwitch.isTenantKilled(theBatch.iKey())) { thePayload = thePayload || _serializer.createPayload(retryCount, isTeardown, isSynchronous_1, isBeaconTransport, sendReason, sendType); if (!_serializer.appendPayload(thePayload, theBatch, maxEventsPerBatch)) { _doPayloadSend(thePayload, serializationStart, getTime(), sendReason); serializationStart = getTime(); theBatches = [theBatch].concat(theBatches); thePayload = null; } else if (thePayload.overflow !== null) { theBatches = [thePayload.overflow].concat(theBatches); thePayload.overflow = null; _doPayloadSend(thePayload, serializationStart, getTime(), sendReason); serializationStart = getTime(); thePayload = null; } } else { droppedBatches.push(theBatch); } } } if (thePayload) { _doPayloadSend(thePayload, serializationStart, getTime(), sendReason); } if (theBatches.length > 0) { _batchQueue = theBatches.concat(_batchQueue); } _sendBatchesNotification(droppedBatches, 8004 , sendType); }, function () { return ({ batches: _createDebugBatches(orgBatches_1), retryCount: retryCount, isTeardown: isTeardown, isSynchronous: isSynchronous_1, sendReason: sendReason, useSendBeacon: _isBeaconPayload(sendType), sendType: sendType }); }, !isSynchronous_1); } catch (ex) { _throwInternal(_postManager.diagLog(), 2 , 48 , "Unexpected Exception sending batch: " + dumpObj(ex)); } } function _buildRequestDetails(thePayload, useHeaders) { var requestDetails = { url: _urlString, hdrs: {}, useHdrs: false }; if (!useHeaders) { objForEachKey(_headers, function (name, value) { if (_collectorHeaderToQs[name]) { _addRequestDetails(requestDetails, _collectorHeaderToQs[name], value, false); } else { requestDetails.hdrs[name] = value; requestDetails.useHdrs = true; } }); } else { requestDetails.hdrs = extend(requestDetails.hdrs, _headers); requestDetails.useHdrs = (objKeys(requestDetails.hdrs).length > 0); } _addRequestDetails(requestDetails, strClientId, "NO_AUTH", useHeaders); _addRequestDetails(requestDetails, strClientVersion, FullVersionString, useHeaders); var apiQsKeys = ""; arrForEach(thePayload.apiKeys, function (apiKey) { if (apiQsKeys.length > 0) { apiQsKeys += ","; } apiQsKeys += apiKey; }); _addRequestDetails(requestDetails, strApiKey, apiQsKeys, useHeaders); _addRequestDetails(requestDetails, strUploadTime, dateNow().toString(), useHeaders); var msfpc = _getMsfpc(thePayload); if (isValueAssigned(msfpc)) { requestDetails.url += "&ext.intweb.msfpc=" + msfpc; } if (_clockSkewManager.shouldAddClockSkewHeaders()) { _addRequestDetails(requestDetails, strTimeDeltaToApply, _clockSkewManager.getClockSkewHeaderValue(), useHeaders); } if (_core.getWParam) { var wParam = _core.getWParam(); if (wParam >= 0) { requestDetails.url += "&w=" + wParam; } } for (var i = 0; i < _queryStringParameters.length; i++) { requestDetails.url += "&" + _queryStringParameters[i].name + "=" + _queryStringParameters[i].value; } return requestDetails; } function _canUseSendBeaconApi() { return !_customHttpInterface && _useBeacons && isBeaconsSupported(); } function _setTimingValue(timings, name, value) { timings[name] = timings[name] || {}; timings[name][_postManager.identifier] = value; } function _doPayloadSend(thePayload, serializationStart, serializationCompleted, sendReason) { if (thePayload && thePayload.payloadBlob && thePayload.payloadBlob.length > 0) { var useSendHook_1 = !!_self.sendHook; var sendInterface_1 = _sendInterfaces[thePayload.sendType]; if (!_isBeaconPayload(thePayload.sendType) && thePayload.isBeacon && thePayload.sendReason === 2 ) { sendInterface_1 = _sendInterfaces[2 ] || _sendInterfaces[3 ] || sendInterface_1; } var useHeaders_1 = _useHeaders; if (thePayload.isBeacon || sendInterface_1._transport === 3 ) { useHeaders_1 = false; } var requestDetails_1 = _buildRequestDetails(thePayload, useHeaders_1); useHeaders_1 = useHeaders_1 || requestDetails_1.useHdrs; var sendEventStart_1 = getTime(); doPerf(_core, function () { return "HttpManager:_doPayloadSend"; }, function () { for (var batchLp = 0; batchLp < thePayload.batches.length; batchLp++) { var theBatch = thePayload.batches[batchLp]; var theEvents = theBatch.events(); for (var evtLp = 0; evtLp < theEvents.length; evtLp++) { var telemetryItem = theEvents[evtLp]; if (_enableEventTimings) { var timings = telemetryItem.timings = telemetryItem.timings || {}; _setTimingValue(timings, "sendEventStart", sendEventStart_1); _setTimingValue(timings, "serializationStart", serializationStart); _setTimingValue(timings, "serializationCompleted", serializationCompleted); } telemetryItem[strSendAttempt] > 0 ? telemetryItem[strSendAttempt]++ : telemetryItem[strSendAttempt] = 1; } } _sendBatchesNotification(thePayload.batches, (1000 + (sendReason || 0 )), thePayload.sendType, true); var orgPayloadData = { data: thePayload.payloadBlob, urlString: requestDetails_1.url, headers: requestDetails_1.hdrs, _thePayload: thePayload, _sendReason: sendReason, timeout: _xhrTimeout }; if (!isUndefined(_disableXhrSync)) { orgPayloadData.disableXhrSync = !!_disableXhrSync; } if (useHeaders_1) { if (!_hasHeader(orgPayloadData.headers, strCacheControl)) { orgPayloadData.headers[strCacheControl] = defaultCacheControl; } if (!_hasHeader(orgPayloadData.headers, strContentTypeHeader)) { orgPayloadData.headers[strContentTypeHeader] = defaultContentType; } } var sender = null; if (sendInterface_1) { sender = function (payload) { _clockSkewManager.firstRequestSent(); var onComplete = function (status, headers) { _retryRequestIfNeeded(status, headers, thePayload, sendReason); }; var isSync = thePayload.isTeardown || thePayload.isSync; try { sendInterface_1.sendPOST(payload, onComplete, isSync); if (_self.sendListener) { _self.sendListener(orgPayloadData, payload, isSync, thePayload.isBeacon); } } catch (ex) { _postManager.diagLog().warnToConsole("Unexpected exception sending payload. Ex:" + dumpObj(ex)); _doOnComplete(onComplete, 0, {}); } }; } doPerf(_core, function () { return "HttpManager:_doPayloadSend.sender"; }, function () { if (sender) { if (thePayload.sendType === 0 ) { _outstandingRequests++; } if (useSendHook_1 && !thePayload.isBeacon && sendInterface_1._transport !== 3 ) { var hookData_1 = { data: orgPayloadData.data, urlString: orgPayloadData.urlString, headers: extend({}, orgPayloadData.headers), timeout: orgPayloadData.timeout, disableXhrSync: orgPayloadData.disableXhrSync }; var senderCalled_1 = false; doPerf(_core, function () { return "HttpManager:_doPayloadSend.sendHook"; }, function () { try { _self.sendHook(hookData_1, function (payload) { senderCalled_1 = true; if (!_customHttpInterface && !payload._thePayload) { payload._thePayload = payload._thePayload || orgPayloadData._thePayload; payload._sendReason = payload._sendReason || orgPayloadData._sendReason; } sender(payload); }, thePayload.isSync || thePayload.isTeardown); } catch (ex) { if (!senderCalled_1) { sender(orgPayloadData); } } }); } else { sender(orgPayloadData); } } }); }, function () { return ({ thePayload: thePayload, serializationStart: serializationStart, serializationCompleted: serializationCompleted, sendReason: sendReason }); }, thePayload.isSync); } if (thePayload.sizeExceed && thePayload.sizeExceed.length > 0) { _sendBatchesNotification(thePayload.sizeExceed, 8003 , thePayload.sendType); } if (thePayload.failedEvts && thePayload.failedEvts.length > 0) { _sendBatchesNotification(thePayload.failedEvts, 8002 , thePayload.sendType); } } function _addEventCompletedTimings(theEvents, sendEventCompleted) { if (_enableEventTimings) { arrForEach(theEvents, function (theEvent) { var timings = theEvent.timings = theEvent.timings || {}; _setTimingValue(timings, "sendEventCompleted", sendEventCompleted); }); } } function _retryRequestIfNeeded(status, headers, thePayload, sendReason) { var reason = 9000 ; var droppedBatches = null; var isRetrying = false; var backOffTrans = false; try { var shouldRetry = true; if (typeof status !== strShimUndefined) { if (headers) { _clockSkewManager.setClockSkew(headers[strTimeDeltaHeader]); var killDuration = headers[strKillDurationHeader] || headers["kill-duration-seconds"]; arrForEach(_killSwitch.setKillSwitchTenants(headers[strKillTokensHeader], killDuration), function (killToken) { arrForEach(thePayload.batches, function (theBatch) { if (theBatch.iKey() === killToken) { droppedBatches = droppedBatches || []; var removedEvents = theBatch.split(0); thePayload.numEvents -= removedEvents.count(); droppedBatches.push(removedEvents); } }); }); } if (status == 200 || status == 204) { reason = 200 ; return; } if (!retryPolicyShouldRetryForStatus(status) || thePayload.numEvents <= 0) { shouldRetry = false; } reason = 9000 + (status % 1000); } if (shouldRetry) { reason = 100 ; var retryCount_1 = thePayload.retryCnt; if (thePayload.sendType === 0 ) { if (retryCount_1 < maxRequestRetriesBeforeBackoff) { isRetrying = true; _doAction(function () { if (thePayload.sendType === 0 ) { _outstandingRequests--; } _sendBatches(thePayload.batches, retryCount_1 + 1, thePayload.isTeardown, _isUnloading ? 2 : thePayload.sendType, 5 ); }, _isUnloading, retryPolicyGetMillisToBackoffForRetry(retryCount_1)); } else { backOffTrans = true; if (_isUnloading) { reason = 8001 ; } } } } } finally { if (!isRetrying) { _clockSkewManager.setClockSkew(); _handleRequestFinished(thePayload, reason, sendReason, backOffTrans); } _sendBatchesNotification(droppedBatches, 8004 , thePayload.sendType); } } function _handleRequestFinished(thePayload, batchReason, sendReason, backOffTrans) { try { if (backOffTrans) { _postManager._backOffTransmission(); } if (batchReason === 200 ) { if (!backOffTrans && !thePayload.isSync) { _postManager._clearBackOff(); } _addCompleteTimings(thePayload.batches); } _sendBatchesNotification(thePayload.batches, batchReason, thePayload.sendType, true); } finally { if (thePayload.sendType === 0 ) { _outstandingRequests--; if (sendReason !== 5 ) { _self.sendQueuedRequests(thePayload.sendType, sendReason); } } } } function _addCompleteTimings(theBatches) { if (_enableEventTimings) { var sendEventCompleted_1 = getTime(); arrForEach(theBatches, function (theBatch) { if (theBatch && theBatch.count() > 0) { _addEventCompletedTimings(theBatch.events(), sendEventCompleted_1); } }); } } function _doAction(cb, isSync, interval) { if (isSync) { cb(); } else { timeoutOverride.set(cb, interval); } } function _convertAllHeadersToMap(headersString) { var headers = {}; if (isString(headersString)) { var headersArray = strTrim(headersString).split(/[\r\n]+/); arrForEach(headersArray, function (headerEntry) { if (headerEntry) { var idx = headerEntry.indexOf(": "); if (idx !== -1) { var header = strTrim(headerEntry.substring(0, idx)).toLowerCase(); var value = strTrim(headerEntry.substring(idx + 1)); headers[header] = value; } else { headers[strTrim(headerEntry)] = 1; } } }); } return headers; } function _getMsfpc(thePayload) { for (var lp = 0; lp < thePayload.batches.length; lp++) { var msfpc = thePayload.batches[lp].Msfpc(); if (msfpc) { return encodeURIComponent(msfpc); } } return ""; } function _handleCollectorResponse(responseText) { var responseHandlers = _self._responseHandlers; try { for (var i = 0; i < responseHandlers.length; i++) { try { responseHandlers[i](responseText); } catch (e) { _throwInternal(_postManager.diagLog(), 1 , 519 , "Response handler failed: " + e); } } if (responseText) { var response = JSON.parse(responseText); if (isValueAssigned(response.webResult) && isValueAssigned(response.webResult[strMsfpc])) { _cookieMgr.set("MSFPC", response.webResult[strMsfpc], 365 * 86400); } } } catch (ex) { } } function _sendBatchesNotification(theBatches, batchReason, sendType, sendSync) { if (theBatches && theBatches.length > 0 && actions) { var theAction_1 = actions[_getNotificationAction(batchReason)]; if (theAction_1) { var isSyncRequest_1 = sendType !== 0 ; doPerf(_core, function () { return "HttpManager:_sendBatchesNotification"; }, function () { _doAction(function () { try { theAction_1.call(actions, theBatches, batchReason, isSyncRequest_1, sendType); } catch (e) { _throwInternal(_postManager.diagLog(), 1 , 74 , "send request notification failed: " + e); } }, sendSync || isSyncRequest_1, 0); }, function () { return ({ batches: _createDebugBatches(theBatches), reason: batchReason, isSync: isSyncRequest_1, sendSync: sendSync, sendType: sendType }); }, !isSyncRequest_1); } } } function _getNotificationAction(reason) { var action = _eventActionMap[reason]; if (!isValueAssigned(action)) { action = strOther; if (reason >= 9000 && reason <= 9999 ) { action = strResponseFail; } else if (reason >= 8000 && reason <= 8999 ) { action = strDropped; } else if (reason >= 1000 && reason <= 1999 ) { action = strSending; } } return action; } }); } return HttpManager; }()); function defaultSetTimeout(callback, ms) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } return setTimeout(callback, ms, args); } function defaultClearTimeout(timeoutId) { clearTimeout(timeoutId); } function createTimeoutWrapper(argSetTimeout, argClearTimeout) { return { set: argSetTimeout || defaultSetTimeout, clear: argClearTimeout || defaultClearTimeout }; } var FlushCheckTimer = 0.250; var MaxNumberEventPerBatch = 500; var EventsDroppedAtOneTime = 20; var MaxSendAttempts = 6; var MaxSyncUnloadSendAttempts = 2; var MaxBackoffCount = 4; var MaxConnections = 2; var MaxRequestRetriesBeforeBackoff = 1; var strEventsDiscarded = "eventsDiscarded"; var strOverrideInstrumentationKey = "overrideInstrumentationKey"; var strMaxEventRetryAttempts = "maxEventRetryAttempts"; var strMaxUnloadEventRetryAttempts = "maxUnloadEventRetryAttempts"; var strAddUnloadCb = "addUnloadCb"; var PostChannel = /** @class */ (function (_super) { __extendsFn(PostChannel, _super); function PostChannel() { var _this = _super.call(this) || this; _this.identifier = "PostChannel"; _this.priority = 1011; _this.version = '3.2.2'; var _config; var _isTeardownCalled = false; var _flushCallbackQueue = []; var _flushCallbackTimerId = null; var _paused = false; var _immediateQueueSize = 0; var _immediateQueueSizeLimit = 500; var _queueSize = 0; var _queueSizeLimit = 10000; var _profiles = {}; var _currentProfile = RT_PROFILE; var _scheduledTimerId = null; var _immediateTimerId = null; var _currentBackoffCount = 0; var _timerCount = 0; var _xhrOverride; var _httpManager; var _batchQueues = {}; var _autoFlushEventsLimit; var _autoFlushBatchLimit; var _delayedBatchSendLatency = -1; var _delayedBatchReason; var _optimizeObject = true; var _isPageUnloadTriggered = false; var _disableXhrSync = false; var _maxEventSendAttempts = MaxSendAttempts; var _maxUnloadEventSendAttempts = MaxSyncUnloadSendAttempts; var _evtNamespace; var _timeoutWrapper; dynamicProto(PostChannel, _this, function (_self, _base) { _initDefaults(); _self["_getDbgPlgTargets"] = function () { return [_httpManager]; }; _self.initialize = function (coreConfig, core, extensions) { doPerf(core, function () { return "PostChannel:initialize"; }, function () { var extendedCore = core; _base.initialize(coreConfig, core, extensions); try { var hasAddUnloadCb = !!core[strAddUnloadCb]; _evtNamespace = mergeEvtNamespace(createUniqueNamespace(_self.identifier), core.evtNamespace && core.evtNamespace()); var ctx = _self._getTelCtx(); coreConfig.extensionConfig[_self.identifier] = coreConfig.extensionConfig[_self.identifier] || {}; _config = ctx.getExtCfg(_self.identifier); _timeoutWrapper = createTimeoutWrapper(_config.setTimeoutOverride, _config.clearTimeoutOverride); _optimizeObject = !_config.disableOptimizeObj && isChromium(); _hookWParam(extendedCore); if (_config.eventsLimitInMem > 0) { _queueSizeLimit = _config.eventsLimitInMem; } if (_config.immediateEventLimit > 0) { _immediateQueueSizeLimit = _config.immediateEventLimit; } if (_config.autoFlushEventsLimit > 0) { _autoFlushEventsLimit = _config.autoFlushEventsLimit; } _disableXhrSync = _config.disableXhrSync; if (isNumber(_config[strMaxEventRetryAttempts])) { _maxEventSendAttempts = _config[strMaxEventRetryAttempts]; } if (isNumber(_config[strMaxUnloadEventRetryAttempts])) { _maxUnloadEventSendAttempts = _config[strMaxUnloadEventRetryAttempts]; } _setAutoLimits(); if (_config.httpXHROverride && _config.httpXHROverride.sendPOST) { _xhrOverride = _config.httpXHROverride; } if (isValueAssigned(coreConfig.anonCookieName)) { _httpManager.addQueryStringParameter("anoncknm", coreConfig.anonCookieName); } _httpManager.sendHook = _config.payloadPreprocessor; _httpManager.sendListener = _config.payloadListener; var endpointUrl = _config.overrideEndpointUrl ? _config.overrideEndpointUrl : coreConfig.endpointUrl; _self._notificationManager = coreConfig.extensionConfig.NotificationManager; _httpManager.initialize(endpointUrl, _self.core, _self, _xhrOverride, _config); var excludePageUnloadEvents = coreConfig.disablePageUnloadEvents || []; addPageUnloadEventListener(_handleUnloadEvents, excludePageUnloadEvents, _evtNamespace); addPageHideEventListener(_handleUnloadEvents, excludePageUnloadEvents, _evtNamespace); addPageShowEventListener(_handleShowEvents, coreConfig.disablePageShowEvents, _evtNamespace); } catch (e) { _self.setInitialized(false); throw e; } }, function () { return ({ coreConfig: coreConfig, core: core, extensions: extensions }); }); }; _self.processTelemetry = function (ev, itemCtx) { setProcessTelemetryTimings(ev, _self.identifier); itemCtx = _self._getTelCtx(itemCtx); var channelConfig = itemCtx.getExtCfg(_self.identifier); var disableTelemetry = !!_config.disableTelemetry; if (channelConfig) { disableTelemetry = disableTelemetry || !!channelConfig.disableTelemetry; } var event = ev; if (!disableTelemetry && !_isTeardownCalled) { if (_config[strOverrideInstrumentationKey]) { event.iKey = _config[strOverrideInstrumentationKey]; } if (channelConfig && channelConfig[strOverrideInstrumentationKey]) { event.iKey = channelConfig[strOverrideInstrumentationKey]; } _addEventToQueues(event, true); if (_isPageUnloadTriggered) { _releaseAllQueues(2 , 2 ); } else { _scheduleTimer(); } } _self.processNext(event, itemCtx); }; _self._doTeardown = function (unloadCtx, unloadState) { _releaseAllQueues(2 , 2 ); _isTeardownCalled = true; _httpManager.teardown(); removePageUnloadEventListener(null, _evtNamespace); removePageHideEventListener(null, _evtNamespace); removePageShowEventListener(null, _evtNamespace); _initDefaults(); }; function _hookWParam(extendedCore) { var existingGetWParamMethod = extendedCore.getWParam; extendedCore.getWParam = function () { var wparam = 0; if (_config.ignoreMc1Ms0CookieProcessing) { wparam = wparam | 2; } return wparam | existingGetWParamMethod(); }; } function _handleUnloadEvents(evt) { var theEvt = evt || getWindow().event; if (theEvt.type !== "beforeunload") { _isPageUnloadTriggered = true; _httpManager.setUnloading(_isPageUnloadTriggered); } _releaseAllQueues(2 , 2 ); } function _handleShowEvents(evt) { _isPageUnloadTriggered = false; _httpManager.setUnloading(_isPageUnloadTriggered); } function _addEventToQueues(event, append) { if (!event.sendAttempt) { event.sendAttempt = 0; } if (!event.latency) { event.latency = 1 ; } if (event.ext && event.ext["trace"]) { delete (event.ext["trace"]); } if (event.ext && event.ext["user"] && event.ext["user"]["id"]) { delete (event.ext["user"]["id"]); } if (_optimizeObject) { event.ext = optimizeObject(event.ext); if (event.baseData) { event.baseData = optimizeObject(event.baseData); } if (event.data) { event.data = optimizeObject(event.data); } } if (event.sync) { if (_currentBackoffCount || _paused) { event.latency = 3 ; event.sync = false; } else { if (_httpManager) { if (_optimizeObject) { event = optimizeObject(event); } _httpManager.sendSynchronousBatch(EventBatch.create(event.iKey, [event]), event.sync === true ? 1 : event.sync, 3 ); return; } } } var evtLatency = event.latency; var queueSize = _queueSize; var queueLimit = _queueSizeLimit; if (evtLatency === 4 ) { queueSize = _immediateQueueSize; queueLimit = _immediateQueueSizeLimit; } var eventDropped = false; if (queueSize < queueLimit) { eventDropped = !_addEventToProperQueue(event, append); } else { var dropLatency = 1 ; var dropNumber = EventsDroppedAtOneTime; if (evtLatency === 4 ) { dropLatency = 4 ; dropNumber = 1; } eventDropped = true; if (_dropEventWithLatencyOrLess(event.iKey, event.latency, dropLatency, dropNumber)) { eventDropped = !_addEventToProperQueue(event, append); } } if (eventDropped) { _notifyEvents(strEventsDiscarded, [event], EventsDiscardedReason.QueueFull); } } _self.setEventQueueLimits = function (eventLimit, autoFlushLimit) { _queueSizeLimit = eventLimit > 0 ? eventLimit : 10000; _autoFlushEventsLimit = autoFlushLimit > 0 ? autoFlushLimit : 0; _setAutoLimits(); var doFlush = _queueSize > eventLimit; if (!doFlush && _autoFlushBatchLimit > 0) { for (var latency = 1 ; !doFlush && latency <= 3 ; latency++) { var batchQueue = _batchQueues[latency]; if (batchQueue && batchQueue.batches) { arrForEach(batchQueue.batches, function (theBatch) { if (theBatch && theBatch.count() >= _autoFlushBatchLimit) { doFlush = true; } }); } } } _performAutoFlush(true, doFlush); }; _self.pause = function () { _clearScheduledTimer(); _paused = true; _httpManager.pause(); }; _self.resume = function () { _paused = false; _httpManager.resume(); _scheduleTimer(); }; _self.addResponseHandler = function (responseHandler) { _httpManager._responseHandlers.push(responseHandler); }; _self._loadTransmitProfiles = function (profiles) { _resetTransmitProfiles(); objForEachKey(profiles, function (profileName, profileValue) { var profLen = profileValue.length; if (profLen >= 2) { var directValue = (profLen > 2 ? profileValue[2] : 0); profileValue.splice(0, profLen - 2); if (profileValue[1] < 0) { profileValue[0] = -1; } if (profileValue[1] > 0 && profileValue[0] > 0) { var timerMultiplier = profileValue[0] / profileValue[1]; profileValue[0] = Math.ceil(timerMultiplier) * profileValue[1]; } if (directValue >= 0 && profileValue[1] >= 0 && directValue > profileValue[1]) { directValue = profileValue[1]; } profileValue.push(directValue); _profiles[profileName] = profileValue; } }); }; _self.flush = function (async, callback, sendReason) { if (async === void 0) { async = true; } if (!_paused) { _clearScheduledTimer(); sendReason = sendReason || 1 ; if (async) { _queueBatches(1 , 0 , sendReason); _resetQueueCounts(); if (_flushCallbackTimerId == null) { _flushCallbackTimerId = _createTimer(function () { _flushImpl(callback, sendReason); }, 0); } else { _flushCallbackQueue.push(callback); } } else { _sendEventsForLatencyAndAbove(1 , 1 , sendReason); if (callback !== null && callback !== undefined) { callback(); } } } }; _self.setMsaAuthTicket = function (ticket) { _httpManager.addHeader(strMsaDeviceTicket, ticket); }; _self.hasEvents = _hasEvents; _self._setTransmitProfile = function (profileName) { if (_currentProfile !== profileName && _profiles[profileName] !== undefined) { _clearScheduledTimer(); _currentProfile = profileName; _scheduleTimer(); } }; function _sendEventsForLatencyAndAbove(latency, sendType, sendReason) { var queued = _queueBatches(latency, sendType, sendReason); _httpManager.sendQueuedRequests(sendType, sendReason); return queued; } function _hasEvents() { return _queueSize > 0; } function _scheduleTimer() { if (_delayedBatchSendLatency >= 0 && _queueBatches(_delayedBatchSendLatency, 0 , _delayedBatchReason)) { _httpManager.sendQueuedRequests(0 , _delayedBatchReason); } if (_immediateQueueSize > 0 && !_immediateTimerId && !_paused) { var immediateTimeOut = _profiles[_currentProfile][2]; if (immediateTimeOut >= 0) { _immediateTimerId = _createTimer(function () { _immediateTimerId = null; _sendEventsForLatencyAndAbove(4 , 0 , 1 ); _scheduleTimer(); }, immediateTimeOut); } } var timeOut = _profiles[_currentProfile][1]; if (!_scheduledTimerId && !_flushCallbackTimerId && timeOut >= 0 && !_paused) { if (_hasEvents()) { _scheduledTimerId = _createTimer(function () { _scheduledTimerId = null; _sendEventsForLatencyAndAbove(_timerCount === 0 ? 3 : 1 , 0 , 1 ); _timerCount++; _timerCount %= 2; _scheduleTimer(); }, timeOut); } else { _timerCount = 0; } } } _self._backOffTransmission = function () { if (_currentBackoffCount < MaxBackoffCount) { _currentBackoffCount++; _clearScheduledTimer(); _scheduleTimer(); } }; _self._clearBackOff = function () { if (_currentBackoffCount) { _currentBackoffCount = 0; _clearScheduledTimer(); _scheduleTimer(); } }; function _initDefaults() { _config = null; _isTeardownCalled = false; _flushCallbackQueue = []; _flushCallbackTimerId = null; _paused = false; _immediateQueueSize = 0; _immediateQueueSizeLimit = 500; _queueSize = 0; _queueSizeLimit = 10000; _profiles = {}; _currentProfile = RT_PROFILE; _scheduledTimerId = null; _immediateTimerId = null; _currentBackoffCount = 0; _timerCount = 0; _xhrOverride = null; _batchQueues = {}; _autoFlushEventsLimit = undefined; _autoFlushBatchLimit = 0; _delayedBatchSendLatency = -1; _delayedBatchReason = null; _optimizeObject = true; _isPageUnloadTriggered = false; _disableXhrSync = false; _maxEventSendAttempts = MaxSendAttempts; _maxUnloadEventSendAttempts = MaxSyncUnloadSendAttempts; _evtNamespace = null; _timeoutWrapper = createTimeoutWrapper(); _httpManager = new HttpManager(MaxNumberEventPerBatch, MaxConnections, MaxRequestRetriesBeforeBackoff, { requeue: _requeueEvents, send: _sendingEvent, sent: _eventsSentEvent, drop: _eventsDropped, rspFail: _eventsResponseFail, oth: _otherEvent }, _timeoutWrapper); _initializeProfiles(); _clearQueues(); _setAutoLimits(); } function _createTimer(theTimerFunc, timeOut) { if (timeOut === 0 && _currentBackoffCount) { timeOut = 1; } var timerMultiplier = 1000; if (_currentBackoffCount) { timerMultiplier = retryPolicyGetMillisToBackoffForRetry(_currentBackoffCount - 1); } return _timeoutWrapper.set(theTimerFunc, timeOut * timerMultiplier); } function _clearScheduledTimer() { if (_scheduledTimerId !== null) { _timeoutWrapper.clear(_scheduledTimerId); _scheduledTimerId = null; _timerCount = 0; } } function _releaseAllQueues(sendType, sendReason) { _clearScheduledTimer(); if (_flushCallbackTimerId) { _timeoutWrapper.clear(_flushCallbackTimerId); _flushCallbackTimerId = null; } if (!_paused) { _sendEventsForLatencyAndAbove(1 , sendType, sendReason); } } function _clearQueues() { _batchQueues[4 ] = { batches: [], iKeyMap: {} }; _batchQueues[3 ] = { batches: [], iKeyMap: {} }; _batchQueues[2 ] = { batches: [], iKeyMap: {} }; _batchQueues[1 ] = { batches: [], iKeyMap: {} }; } function _getEventBatch(iKey, latency, create) { var batchQueue = _batchQueues[latency]; if (!batchQueue) { latency = 1 ; batchQueue = _batchQueues[latency]; } var eventBatch = batchQueue.iKeyMap[iKey]; if (!eventBatch && create) { eventBatch = EventBatch.create(iKey); batchQueue.batches.push(eventBatch); batchQueue.iKeyMap[iKey] = eventBatch; } return eventBatch; } function _performAutoFlush(isAsync, doFlush) { if (_httpManager.canSendRequest() && !_currentBackoffCount) { if (_autoFlushEventsLimit > 0 && _queueSize > _autoFlushEventsLimit) { doFlush = true; } if (doFlush && _flushCallbackTimerId == null) { _self.flush(isAsync, null, 20 ); } } } function _addEventToProperQueue(event, append) { if (_optimizeObject) { event = optimizeObject(event); } var latency = event.latency; var eventBatch = _getEventBatch(event.iKey, latency, true); if (eventBatch.addEvent(event)) { if (latency !== 4 ) { _queueSize++; if (append && event.sendAttempt === 0) { _performAutoFlush(!event.sync, _autoFlushBatchLimit > 0 && eventBatch.count() >= _autoFlushBatchLimit); } } else { _immediateQueueSize++; } return true; } return false; } function _dropEventWithLatencyOrLess(iKey, latency, currentLatency, dropNumber) { while (currentLatency <= latency) { var eventBatch = _getEventBatch(iKey, latency, true); if (eventBatch && eventBatch.count() > 0) { var droppedEvents = eventBatch.split(0, dropNumber); var droppedCount = droppedEvents.count(); if (droppedCount > 0) { if (currentLatency === 4 ) { _immediateQueueSize -= droppedCount; } else { _queueSize -= droppedCount; } _notifyBatchEvents(strEventsDiscarded, [droppedEvents], EventsDiscardedReason.QueueFull); return true; } } currentLatency++; } _resetQueueCounts(); return false; } function _resetQueueCounts() { var immediateQueue = 0; var normalQueue = 0; var _loop_1 = function (latency) { var batchQueue = _batchQueues[latency]; if (batchQueue && batchQueue.batches) { arrForEach(batchQueue.batches, function (theBatch) { if (latency === 4 ) { immediateQueue += theBatch.count(); } else { normalQueue += theBatch.count(); } }); } }; for (var latency = 1 ; latency <= 4 ; latency++) { _loop_1(latency); } _queueSize = normalQueue; _immediateQueueSize = immediateQueue; } function _queueBatches(latency, sendType, sendReason) { var eventsQueued = false; var isAsync = sendType === 0 ; if (!isAsync || _httpManager.canSendRequest()) { doPerf(_self.core, function () { return "PostChannel._queueBatches"; }, function () { var droppedEvents = []; var latencyToProcess = 4 ; while (latencyToProcess >= latency) { var batchQueue = _batchQueues[latencyToProcess]; if (batchQueue && batchQueue.batches && batchQueue.batches.length > 0) { arrForEach(batchQueue.batches, function (theBatch) { if (!_httpManager.addBatch(theBatch)) { droppedEvents = droppedEvents.concat(theBatch.events()); } else { eventsQueued = eventsQueued || (theBatch && theBatch.count() > 0); } if (latencyToProcess === 4 ) { _immediateQueueSize -= theBatch.count(); } else { _queueSize -= theBatch.count(); } }); batchQueue.batches = []; batchQueue.iKeyMap = {}; } latencyToProcess--; } if (droppedEvents.length > 0) { _notifyEvents(strEventsDiscarded, droppedEvents, EventsDiscardedReason.KillSwitch); } if (eventsQueued && _delayedBatchSendLatency >= latency) { _delayedBatchSendLatency = -1; _delayedBatchReason = 0 ; } }, function () { return ({ latency: latency, sendType: sendType, sendReason: sendReason }); }, !isAsync); } else { _delayedBatchSendLatency = _delayedBatchSendLatency >= 0 ? Math.min(_delayedBatchSendLatency, latency) : latency; _delayedBatchReason = Math.max(_delayedBatchReason, sendReason); } return eventsQueued; } function _flushImpl(callback, sendReason) { _sendEventsForLatencyAndAbove(1 , 0 , sendReason); _waitForIdleManager(function () { if (callback) { callback(); } if (_flushCallbackQueue.length > 0) { _flushCallbackTimerId = _createTimer(function () { return _flushImpl(_flushCallbackQueue.shift(), sendReason); }, 0); } else { _flushCallbackTimerId = null; if (_hasEvents()) { _scheduleTimer(); } } }); } function _waitForIdleManager(callback) { if (_httpManager.isCompletelyIdle()) { callback(); } else { _flushCallbackTimerId = _createTimer(function () { _waitForIdleManager(callback); }, FlushCheckTimer); } } function _resetTransmitProfiles() { _clearScheduledTimer(); _initializeProfiles(); _currentProfile = RT_PROFILE; _scheduleTimer(); } function _initializeProfiles() { _profiles = {}; _profiles[RT_PROFILE] = [2, 1, 0]; _profiles[NRT_PROFILE] = [6, 3, 0]; _profiles[BE_PROFILE] = [18, 9, 0]; } function _requeueEvents(batches, reason) { var droppedEvents = []; var maxSendAttempts = _maxEventSendAttempts; if (_isPageUnloadTriggered) { maxSendAttempts = _maxUnloadEventSendAttempts; } arrForEach(batches, function (theBatch) { if (theBatch && theBatch.count() > 0) { arrForEach(theBatch.events(), function (theEvent) { if (theEvent) { if (theEvent.sync) { theEvent.latency = 4 ; theEvent.sync = false; } if (theEvent.sendAttempt < maxSendAttempts) { setProcessTelemetryTimings(theEvent, _self.identifier); _addEventToQueues(theEvent, false); } else { droppedEvents.push(theEvent); } } }); } }); if (droppedEvents.length > 0) { _notifyEvents(strEventsDiscarded, droppedEvents, EventsDiscardedReason.NonRetryableStatus); } if (_isPageUnloadTriggered) { _releaseAllQueues(2 , 2 ); } } function _callNotification(evtName, theArgs) { var manager = (_self._notificationManager || {}); var notifyFunc = manager[evtName]; if (notifyFunc) { try { notifyFunc.apply(manager, theArgs); } catch (e) { _throwInternal(_self.diagLog(), 1 , 74 , evtName + " notification failed: " + e); } } } function _notifyEvents(evtName, theEvents) { var extraArgs = []; for (var _i = 2; _i < arguments.length; _i++) { extraArgs[_i - 2] = arguments[_i]; } if (theEvents && theEvents.length > 0) { _callNotification(evtName, [theEvents].concat(extraArgs)); } } function _notifyBatchEvents(evtName, batches) { var extraArgs = []; for (var _i = 2; _i < arguments.length; _i++) { extraArgs[_i - 2] = arguments[_i]; } if (batches && batches.length > 0) { arrForEach(batches, function (theBatch) { if (theBatch && theBatch.count() > 0) { _callNotification(evtName, [theBatch.events()].concat(extraArgs)); } }); } } function _sendingEvent(batches, reason, isSyncRequest) { if (batches && batches.length > 0) { _callNotification("eventsSendRequest", [(reason >= 1000 && reason <= 1999 ? reason - 1000 : 0 ), isSyncRequest !== true]); } } function _eventsSentEvent(batches, reason) { _notifyBatchEvents("eventsSent", batches, reason); _scheduleTimer(); } function _eventsDropped(batches, reason) { _notifyBatchEvents(strEventsDiscarded, batches, (reason >= 8000 && reason <= 8999 ? reason - 8000 : EventsDiscardedReason.Unknown)); } function _eventsResponseFail(batches) { _notifyBatchEvents(strEventsDiscarded, batches, EventsDiscardedReason.NonRetryableStatus); _scheduleTimer(); } function _otherEvent(batches, reason) { _notifyBatchEvents(strEventsDiscarded, batches, EventsDiscardedReason.Unknown); _scheduleTimer(); } function _setAutoLimits() { if (!_config || !_config.disableAutoBatchFlushLimit) { _autoFlushBatchLimit = Math.max(MaxNumberEventPerBatch * (MaxConnections + 1), _queueSizeLimit / 6); } else { _autoFlushBatchLimit = 0; } } objDefineAccessors(_self, "_setTimeoutOverride", function () { return _timeoutWrapper.set; }, function (value) { _timeoutWrapper = createTimeoutWrapper(value, _timeoutWrapper.clear); }); objDefineAccessors(_self, "_clearTimeoutOverride", function () { return _timeoutWrapper.clear; }, function (value) { _timeoutWrapper = createTimeoutWrapper(_timeoutWrapper.set, value); }); }); return _this; } return PostChannel; }(BaseTelemetryPlugin)); var PostChannel$1 = PostChannel; exports.BE_PROFILE = BE_PROFILE; exports.NRT_PROFILE = NRT_PROFILE; exports.PostChannel = PostChannel$1; exports.RT_PROFILE = RT_PROFILE; (function(obj, prop, descriptor) { /* ai_es3_polyfil defineProperty */ var func = Object["defineProperty"]; if (func) { try { return func(obj, prop, descriptor); } catch(e) { /* IE8 defines defineProperty, but will throw */ } } if (descriptor && typeof descriptor.value !== undefined) { obj[prop] = descriptor.value; } return obj; })(exports, '__esModule', { value: true }); })(this.oneDS = this.oneDS || {});//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/1ds-post-js/bundle/ms.post-3.2.2.gbl.js.map /*! * 1DS JS SDK POST plugin, 3.2.2 * Copyright (c) Microsoft and contributors. All rights reserved. * (Microsoft Internal Only) */ !function(s){"use strict";var l="function",Q="object",J="undefined",a="prototype",f="hasOwnProperty",t=Object,n=t[a],C=t.assign,e=(t.create,t.defineProperty),v=n[f],r=null;function T(n){return void 0===n&&(n=!0),r&&n||(typeof globalThis!==J&&globalThis&&(r=globalThis),typeof self!==J&&self&&(r=self),typeof window!==J&&window&&(r=window),typeof global!==J&&global&&(r=global)),r}function _(n){throw new TypeError(n)}(T()||{}).Symbol,(T()||{}).Reflect;var S=function(n,e){return(S=t.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var t in e)e[f](t)&&(n[t]=e[t])})(n,e)},E="constructor",g="prototype",P="function",R="_dynInstFuncs",L="_isDynProxy",p="_dynClass",M="_dynInstChk",N=M,k="_dfOpts",O="_unknown_",K="__proto__",I="_dyn"+K,A="_dynInstProto",B="useBaseInst",H="setInstFuncs",q=Object,U=q.getPrototypeOf,z=q.getOwnPropertyNames,D=0;function h(n,e){return n&&q[g].hasOwnProperty.call(n,e)}function F(n){return n&&(n===q[g]||n===Array[g])}function j(n){return F(n)||n===Function[g]}function y(n){if(n){if(U)return U(n);var e=n[K]||n[g]||(n[E]?n[E][g]:null),t=n[I]||e;h(n,I)||(delete n[A],t=n[I]=n[A]||n[I],n[A]=e)}return t}function X(n,e){var t=[];if(z)t=z(n);else for(var r in n)"string"==typeof r&&h(n,r)&&t.push(r);if(t&&0=o&&!(n=r===i)){for(var a=0;a=o.maxInternalMessageLimit()||(r=!0,t="AITR_"+e.messageId,c[t]?r=!1:c[t]=!0,r&&(n<=o.telemetryLoggingLevel()&&(o.queue.push(e),u++,a(1===n?"error":"warn",e)),u===o.maxInternalMessageLimit()&&(r=new _e(23,t="Internal events throttle limit per PageView reached for this app.",!1),o.queue.push(r),1===n?o.errorToConsole(t):o.warnToConsole(t))))}})};function un(n,e,t,r,i,o){void 0===o&&(o=!1),(n||new Ee).throwInternal(e,t,r,i,o)}u.ParentContextKey="parent",u.ChildrenContextKey="childEvts";var Pe=u;function u(n,i,e){var t,o=this,a=!1;o.start=G(),o.name=n,o.isAsync=e,o.isChildEvt=function(){return!1},x(i)&&(a=$n(o,"payload",function(){return!t&&x(i)&&(t=i(),i=null),t})),o.getCtx=function(n){return n?(n===u.ParentContextKey||n===u.ChildrenContextKey?o:o.ctx||{})[n]:null},o.setCtx=function(n,e){n&&(n===u.ParentContextKey?(o[n]||(o.isChildEvt=function(){return!0}),o[n]=e):n===u.ChildrenContextKey?o[n]=e:(o.ctx=o.ctx||{})[n]=e)},o.complete=function(){var n=0,e=o.getCtx(u.ChildrenContextKey);if(tn(e))for(var t=0;t>>=0),Ne=123456789+e&c,ke=987654321-e&c,Me=!0}catch(o){}r=((ke=36969*(65535&ke)+(ke>>16)&c)<<16)+(65535&(Ne=18e3*(65535&Ne)+(Ne>>16)&c))>>>0&c|0,t=(r>>>=0)&c}return 0===t&&(t=Math.floor(Le*Math.random()|0)),n||(t>>>=0),t}var Ke=e,Ie="2.8.3",Ae="."+function(n){void 0===n&&(n=22);for(var e=Oe()>>>0,t=0,r=d;r.length>>=6,5==++t&&(e=(Oe()<<2&4294967295|3&e)>>>0,t=0);return r}(6),Be=0;function He(n){return 1===n.nodeType||9===n.nodeType||!+n.nodeType}function qe(n,e){return Hn(n+Be+++((e=void 0!==e&&e)?"."+Ie:"")+Ae)}function Ue(n){var o={id:qe("_aiData-"+(n||"")+"."+Ie),accept:He,get:function(n,e,t,r){var i=n[o.id];return i?i[Hn(e)]:(r&&((i=function(n,e){var t=e[n.id];if(!t){t={};try{He(e)&&!function(n,e,t){if(Ke)try{return Ke(n,e,{value:t,enumerable:!1,configurable:!0}),1}catch(r){}}(e,n.id,t)&&(e[n.id]=t)}catch(r){}}return t}(o,n))[Hn(e)]=t),t)},kill:function(n,e){if(n&&n[e])try{delete n[e]}catch(t){}}};return o}var ze=Ue("plugin");function De(n){return ze.get(n,"state",{},!0)}var Fe="TelemetryPluginChain",je="_hasRun",Xe="_getTelCtx",Qe=0;function Je(n,a,t,e){var r=null,i=[],o=(null!==e&&(r=e?function(n,e,t){for(;n;){if(n.getPlugin()===t)return n;n=n.getNext()}return $e([t],e.config||{},e)}(n,t,e):n),{_next:function(){var n,e=r;return r=e?e.getNext():null,e||(n=i)&&0G()||(delete e[n],!1)}})},ar=function Mr(){var e=!0,t=!0,r=!0,i="use-collector-delta",o=!1;m(Mr,this,function(n){n.allowRequestSending=function(){return e},n.firstRequestSent=function(){r&&(r=!1,o||(e=!1))},n.shouldAddClockSkewHeaders=function(){return t},n.getClockSkewHeaderValue=function(){return i},n.setClockSkew=function(n){o||(n?(i=n,o=t=!0):t=!1,e=!0)}})},ur="sendAttempt",cr="&NoResponseBody=true",sr=((i={})[1]=n,i[100]=n,i[200]="sent",i[8004]=Ot,i[8003]=Ot,i),lr={},fr={};function o(n,e,t){lr[n]=e,!1!==t&&(fr[e]=n)}function dr(n){try{return n.responseText}catch(e){}return""}function vr(n,e){var t=!1;if(n&&e){var r=Wn(n);if(r&&0=N)):q++,1)}function v(){for(var t=0,r=0,n=1;n<=4;n++)!function(e){var n=$[e];n&&n.batches&&rn(n.batches,function(n){4===e?t+=n.count():r+=n.count()})}(n);z=r,q=t}function g(r,n,e){var i=!1,t=0===n;return!t||L.canSendRequest()?cn(p.core,function(){return"PostChannel._queueBatches"},function(){for(var e=[],t=4;r<=t;){var n=$[t];n&&n.batches&&0=N&&(t=!0)})}f(!0,t)},p.pause=function(){c(),H=!0,L.pause()},p.resume=function(){H=!1,L.resume(),a()},p.addResponseHandler=function(n){L._responseHandlers.push(n)},p._loadTransmitProfiles=function(n){c(),e(),j=Nt,a(),en(n,function(n,e){var t,r=e.length;2<=r&&(t=2e[1]&&(t=e[1]),e.push(t),F[n]=e)})},p.flush=function(n,e,t){void 0===n&&(n=!0),H||(c(),t=t||1,n?(g(1,0,t),v(),null==B?B=u(function(){!function r(n,e){o(1,0,e),function t(n){L.isCompletelyIdle()?n():B=u(function(){t(n)},.25)}(function(){n&&n(),0 0) { for (var lp = 0; lp < props.length; lp++) { func(props[lp]); } } } function _isDynamicCandidate(target, funcName, skipOwn) { return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName))); } function _throwTypeError(message) { throw new TypeError("DynamicProto: " + message); } function _getInstanceFuncs(thisTarget) { var instFuncs = {}; _forEachProp(thisTarget, function (name) { if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) { instFuncs[name] = thisTarget[name]; } }); return instFuncs; } function _hasVisited(values, value) { for (var lp = values.length - 1; lp >= 0; lp--) { if (values[lp] === value) { return true; } } return false; } function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) { function _instFuncProxy(target, funcHost, funcName) { var theFunc = funcHost[funcName]; if (theFunc[DynProxyTag] && useBaseInst) { var instFuncTable = target[DynInstFuncTable] || {}; if (instFuncTable[DynAllowInstChkTag] !== false) { theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc; } } return function () { return theFunc.apply(target, arguments); }; } var baseFuncs = {}; _forEachProp(instFuncs, function (name) { baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name); }); var baseProto = _getObjProto$1(classProto); var visited = []; while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) { _forEachProp(baseProto, function (name) { if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf$1)) { baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name); } }); visited.push(baseProto); baseProto = _getObjProto$1(baseProto); } return baseFuncs; } function _getInstFunc(target, funcName, proto, currentDynProtoProxy) { var instFunc = null; if (target && _hasOwnProperty(proto, DynClassName)) { var instFuncTable = target[DynInstFuncTable] || {}; instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName]; if (!instFunc) { _throwTypeError("Missing [" + funcName + "] " + strFunction); } if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) { var canAddInst = !_hasOwnProperty(target, funcName); var objProto = _getObjProto$1(target); var visited = []; while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) { var protoFunc = objProto[funcName]; if (protoFunc) { canAddInst = (protoFunc === currentDynProtoProxy); break; } visited.push(objProto); objProto = _getObjProto$1(objProto); } try { if (canAddInst) { target[funcName] = instFunc; } instFunc[DynInstChkTag] = 1; } catch (e) { instFuncTable[DynAllowInstChkTag] = false; } } } return instFunc; } function _getProtoFunc(funcName, proto, currentDynProtoProxy) { var protoFunc = proto[funcName]; if (protoFunc === currentDynProtoProxy) { protoFunc = _getObjProto$1(proto)[funcName]; } if (typeof protoFunc !== strFunction) { _throwTypeError("[" + funcName + "] is not a " + strFunction); } return protoFunc; } function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) { function _createDynamicPrototype(proto, funcName) { var dynProtoProxy = function () { var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy); return instFunc.apply(this, arguments); }; dynProtoProxy[DynProxyTag] = 1; return dynProtoProxy; } if (!_isObjectOrArrayPrototype(proto)) { var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {}; var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {}); if (instFuncTable[DynAllowInstChkTag] !== false) { instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc; } _forEachProp(target, function (name) { if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) { instFuncs_1[name] = target[name]; delete target[name]; if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) { proto[name] = _createDynamicPrototype(proto, name); } } }); } } function _checkPrototype(classProto, thisTarget) { if (_objGetPrototypeOf$1) { var visited = []; var thisProto = _getObjProto$1(thisTarget); while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) { if (thisProto === classProto) { return true; } visited.push(thisProto); thisProto = _getObjProto$1(thisProto); } return false; } return true; } function _getObjName(target, unknownValue) { if (_hasOwnProperty(target, Prototype)) { return target.name || unknownValue || UnknownValue; } return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue; } function dynamicProto(theClass, target, delegateFunc, options) { if (!_hasOwnProperty(theClass, Prototype)) { _throwTypeError("theClass is an invalid class definition."); } var classProto = theClass[Prototype]; if (!_checkPrototype(classProto, target)) { _throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]"); } var className = null; if (_hasOwnProperty(classProto, DynClassName)) { className = classProto[DynClassName]; } else { className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _dynamicNames; _dynamicNames++; classProto[DynClassName] = className; } var perfOptions = dynamicProto[DynProtoDefaultOptions]; var useBaseInst = !!perfOptions[strUseBaseInst]; if (useBaseInst && options && options[strUseBaseInst] !== undefined) { useBaseInst = !!options[strUseBaseInst]; } var instFuncs = _getInstanceFuncs(target); var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst); delegateFunc(target, baseFuncs); var setInstanceFunc = !!_objGetPrototypeOf$1 && !!perfOptions[strSetInstFuncs]; if (setInstanceFunc && options) { setInstanceFunc = !!options[strSetInstFuncs]; } _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false); } var perfDefaults = { setInstFuncs: true, useBaseInst: true }; dynamicProto[DynProtoDefaultOptions] = perfDefaults; var strEmpty = ""; var strSetNextPlugin = "setNextPlugin"; var strIsInitialized = "isInitialized"; var strTeardown = "teardown"; var strCore = "core"; var strUpdate = "update"; var strDisabled = "disabled"; var strDoTeardown = "_doTeardown"; var cStrStartsWith = "startsWith"; var strIndexOf = "indexOf"; var cStrTrim = "trim"; var strToString = "toString"; var str__Proto = "__proto__"; var strConstructor = "constructor"; var _objDefineProperty$1 = ObjDefineProperty; var _objFreeze = ObjClass.freeze; var _objKeys = ObjClass.keys; var StringProto = String[strShimPrototype]; var _strTrim = StringProto[cStrTrim]; var _strStartsWith = StringProto[cStrStartsWith]; var _isArray = Array.isArray; var _objToString = ObjProto[strToString]; var _fnToString = ObjHasOwnProperty[strToString]; var _objFunctionString = _fnToString.call(ObjClass); var rCamelCase = /-([a-z])/g; var rNormalizeInvalid = /([^\w\d_$])/g; var rLeadingNumeric = /^(\d+[\w\d_$])/; var _objGetPrototypeOf = Object["getPrototypeOf"]; function _getObjProto(target) { if (target) { if (_objGetPrototypeOf) { return _objGetPrototypeOf(target); } var newProto = target[str__Proto] || target[strShimPrototype] || target[strConstructor]; if (newProto) { return newProto; } } return null; } function isUndefined(value) { return value === undefined || typeof value === strShimUndefined; } function isNullOrUndefined(value) { return (value === null || isUndefined(value)); } function hasOwnProperty(obj, prop) { return !!(obj && ObjHasOwnProperty.call(obj, prop)); } function isObject(value) { return !!(value && typeof value === strShimObject); } function isFunction(value) { return !!(value && typeof value === strShimFunction); } function normalizeJsName(name) { var value = name; if (value && isString(value)) { value = value.replace(rCamelCase, function (_all, letter) { return letter.toUpperCase(); }); value = value.replace(rNormalizeInvalid, "_"); value = value.replace(rLeadingNumeric, function (_all, match) { return "_" + match; }); } return value; } function objForEachKey(target, callbackfn) { if (target) { for (var prop in target) { if (ObjHasOwnProperty.call(target, prop)) { callbackfn.call(target, prop, target[prop]); } } } } function strStartsWith(value, checkValue) { var result = false; if (value && checkValue && !(result = value === checkValue)) { result = _strStartsWith ? value[cStrStartsWith](checkValue) : _strStartsWithPoly(value, checkValue); } return result; } function _strStartsWithPoly(value, checkValue) { var result = false; var chkLen = checkValue ? checkValue.length : 0; if (value && chkLen && value.length >= chkLen && !(result = value === checkValue)) { for (var lp = 0; lp < chkLen; lp++) { if (value[lp] !== checkValue[lp]) { return false; } } result = true; } return result; } function strContains(value, search) { if (value && search) { return value.indexOf(search) !== -1; } return false; } var isArray = _isArray || _isArrayPoly; function _isArrayPoly(obj) { return !!(obj && _objToString.call(obj) === "[object Array]"); } function isString(value) { return typeof value === "string"; } function isNumber(value) { return typeof value === "number"; } function isBoolean(value) { return typeof value === "boolean"; } function isPlainObject(value) { var result = false; if (value && typeof value === "object") { var proto = _objGetPrototypeOf ? _objGetPrototypeOf(value) : _getObjProto(value); if (!proto) { result = true; } else { if (proto[strConstructor] && ObjHasOwnProperty.call(proto, strConstructor)) { proto = proto[strConstructor]; } result = typeof proto === strShimFunction && _fnToString.call(proto) === _objFunctionString; } } return result; } function arrForEach(arr, callbackfn, thisArg) { var len = arr.length; try { for (var idx = 0; idx < len; idx++) { if (idx in arr) { if (callbackfn.call(thisArg || arr, arr[idx], idx, arr) === -1) { break; } } } } catch (e) { } } function arrIndexOf(arr, searchElement, fromIndex) { if (arr) { if (arr[strIndexOf]) { return arr[strIndexOf](searchElement, fromIndex); } var len = arr.length; var from = fromIndex || 0; try { for (var lp = Math.max(from >= 0 ? from : len - Math.abs(from), 0); lp < len; lp++) { if (lp in arr && arr[lp] === searchElement) { return lp; } } } catch (e) { } } return -1; } function strTrim(str) { if (str) { str = (_strTrim && str[cStrTrim]) ? str[cStrTrim]() : (str.replace ? str.replace(/^\s+|\s+$/g, "") : str); } return str; } var _objKeysHasDontEnumBug = !({ toString: null }).propertyIsEnumerable("toString"); var _objKeysDontEnums = [ "toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor" ]; function objKeys(obj) { var objType = typeof obj; if (objType !== strShimFunction && (objType !== strShimObject || obj === null)) { throwTypeError("objKeys called on non-object"); } if (!_objKeysHasDontEnumBug && _objKeys) { return _objKeys(obj); } var result = []; for (var prop in obj) { if (obj && ObjHasOwnProperty.call(obj, prop)) { result.push(prop); } } if (_objKeysHasDontEnumBug) { var dontEnumsLength = _objKeysDontEnums.length; for (var lp = 0; lp < dontEnumsLength; lp++) { if (obj && ObjHasOwnProperty.call(obj, _objKeysDontEnums[lp])) { result.push(_objKeysDontEnums[lp]); } } } return result; } function objDefineAccessors(target, prop, getProp, setProp) { if (_objDefineProperty$1) { try { var descriptor = { enumerable: true, configurable: true }; if (getProp) { descriptor.get = getProp; } if (setProp) { descriptor.set = setProp; } _objDefineProperty$1(target, prop, descriptor); return true; } catch (e) { } } return false; } function _doNothing(value) { return value; } function deepFreeze(obj) { if (_objFreeze) { objForEachKey(obj, function (name, value) { if (isArray(value) || isObject(value)) { _objFreeze(value); } }); } return objFreeze(obj); } var objFreeze = _objFreeze || _doNothing; function dateNow() { var dt = Date; return dt.now ? dt.now() : new dt().getTime(); } function setValue(target, field, value, valChk, srcChk) { var theValue = value; if (target) { theValue = target[field]; if (theValue !== value && (!srcChk || srcChk(theValue)) && (!valChk || valChk(value))) { theValue = value; target[field] = theValue; } } return theValue; } function _createProxyFunction(source, funcName) { var srcFunc = null; var src = null; if (isFunction(source)) { srcFunc = source; } else { src = source; } return function () { var originalArguments = arguments; if (srcFunc) { src = srcFunc(); } if (src) { return src[funcName].apply(src, originalArguments); } }; } function proxyFunctionAs(target, name, source, theFunc, overwriteTarget) { if (target && name && source) { if (overwriteTarget !== false || isUndefined(target[name])) { target[name] = _createProxyFunction(source, theFunc); } } } function optimizeObject(theObject) { if (theObject && ObjAssign) { theObject = ObjClass(ObjAssign({}, theObject)); } return theObject; } function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) { var theArgs = arguments; var extended = theArgs[0] || {}; var argLen = theArgs.length; var deep = false; var idx = 1; if (argLen > 0 && isBoolean(extended)) { deep = extended; extended = theArgs[idx] || {}; idx++; } if (!isObject(extended)) { extended = {}; } for (; idx < argLen; idx++) { var arg = theArgs[idx]; var isArgArray = isArray(arg); var isArgObj = isObject(arg); for (var prop in arg) { var propOk = (isArgArray && (prop in arg)) || (isArgObj && (ObjHasOwnProperty.call(arg, prop))); if (!propOk) { continue; } var newValue = arg[prop]; var isNewArray = void 0; if (deep && newValue && ((isNewArray = isArray(newValue)) || isPlainObject(newValue))) { var clone = extended[prop]; if (isNewArray) { if (!isArray(clone)) { clone = []; } } else if (!isPlainObject(clone)) { clone = {}; } newValue = objExtend(deep, clone, newValue); } if (newValue !== undefined) { extended[prop] = newValue; } } } return extended; } function createEnumStyle(values) { var enumClass = {}; objForEachKey(values, function (field, value) { enumClass[field] = value; enumClass[value] = field; }); return deepFreeze(enumClass); } var EventsDiscardedReason = createEnumStyle({ Unknown: 0 , NonRetryableStatus: 1 , InvalidEvent: 2 , SizeLimitExceeded: 3 , KillSwitch: 4 , QueueFull: 5 }); var strWindow = "window"; var strDocument = "document"; var strNavigator = "navigator"; var strLocation = "location"; var strConsole = "console"; var strPerformance = "performance"; var strJSON = "JSON"; var strCrypto = "crypto"; var strMsCrypto = "msCrypto"; var strReactNative = "ReactNative"; var strMsie = "msie"; var strTrident = "trident/"; var strXMLHttpRequest = "XMLHttpRequest"; var _isTrident = null; var _navUserAgentCheck = null; var _enableMocks = false; var _useXDomainRequest = null; var _beaconsSupported = null; function _hasProperty(theClass, property) { var supported = false; if (theClass) { try { supported = property in theClass; if (!supported) { var proto = theClass[strShimPrototype]; if (proto) { supported = property in proto; } } } catch (e) { } if (!supported) { try { var tmp = new theClass(); supported = !isUndefined(tmp[property]); } catch (e) { } } } return supported; } function getGlobalInst(name) { var gbl = getGlobal(); if (gbl && gbl[name]) { return gbl[name]; } if (name === strWindow && hasWindow()) { return window; } return null; } function hasWindow() { return Boolean(typeof window === strShimObject && window); } function getWindow() { if (hasWindow()) { return window; } return getGlobalInst(strWindow); } function hasDocument() { return Boolean(typeof document === strShimObject && document); } function getDocument() { if (hasDocument()) { return document; } return getGlobalInst(strDocument); } function hasNavigator() { return Boolean(typeof navigator === strShimObject && navigator); } function getNavigator() { if (hasNavigator()) { return navigator; } return getGlobalInst(strNavigator); } function getLocation(checkForMock) { if (checkForMock && _enableMocks) { var mockLocation = getGlobalInst("__mockLocation"); if (mockLocation) { return mockLocation; } } if (typeof location === strShimObject && location) { return location; } return getGlobalInst(strLocation); } function getConsole() { if (typeof console !== strShimUndefined) { return console; } return getGlobalInst(strConsole); } function getPerformance() { return getGlobalInst(strPerformance); } function hasJSON() { return Boolean((typeof JSON === strShimObject && JSON) || getGlobalInst(strJSON) !== null); } function getJSON() { if (hasJSON()) { return JSON || getGlobalInst(strJSON); } return null; } function getCrypto() { return getGlobalInst(strCrypto); } function getMsCrypto() { return getGlobalInst(strMsCrypto); } function isReactNative() { var nav = getNavigator(); if (nav && nav.product) { return nav.product === strReactNative; } return false; } function isIE() { var nav = getNavigator(); if (nav && (nav.userAgent !== _navUserAgentCheck || _isTrident === null)) { _navUserAgentCheck = nav.userAgent; var userAgent = (_navUserAgentCheck || strEmpty).toLowerCase(); _isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident)); } return _isTrident; } function dumpObj(object) { var objectTypeDump = Object[strShimPrototype].toString.call(object); var propertyValueDump = strEmpty; if (objectTypeDump === "[object Error]") { propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'"; } else if (hasJSON()) { propertyValueDump = getJSON().stringify(object); } return objectTypeDump + propertyValueDump; } function isBeaconsSupported() { if (_beaconsSupported === null) { _beaconsSupported = hasNavigator() && Boolean(getNavigator().sendBeacon); } return _beaconsSupported; } function isFetchSupported(withKeepAlive) { var isSupported = false; try { isSupported = !!getGlobalInst("fetch"); var request = getGlobalInst("Request"); if (isSupported && withKeepAlive && request) { isSupported = _hasProperty(request, "keepalive"); } } catch (e) { } return isSupported; } function useXDomainRequest() { if (_useXDomainRequest === null) { _useXDomainRequest = (typeof XDomainRequest !== strShimUndefined); if (_useXDomainRequest && isXhrSupported()) { _useXDomainRequest = _useXDomainRequest && !_hasProperty(getGlobalInst(strXMLHttpRequest), "withCredentials"); } } return _useXDomainRequest; } function isXhrSupported() { var isSupported = false; try { var xmlHttpRequest = getGlobalInst(strXMLHttpRequest); isSupported = !!xmlHttpRequest; } catch (e) { } return isSupported; } var _aiNamespace = null; function _getExtensionNamespace() { var target = getGlobalInst("Microsoft"); if (target) { _aiNamespace = target["ApplicationInsights"]; } return _aiNamespace; } function getDebugExt(config) { var ns = _aiNamespace; if (!ns && config.disableDbgExt !== true) { ns = _aiNamespace || _getExtensionNamespace(); } return ns ? ns["ChromeDbgExt"] : null; } var AiNonUserActionablePrefix = "AI (Internal): "; var AiUserActionablePrefix = "AI: "; var AIInternalMessagePrefix = "AITR_"; var strErrorToConsole = "errorToConsole"; var strWarnToConsole = "warnToConsole"; function _sanitizeDiagnosticText(text) { if (text) { return "\"" + text.replace(/\"/g, strEmpty) + "\""; } return strEmpty; } function _logToConsole(func, message) { var theConsole = getConsole(); if (!!theConsole) { var logFunc = "log"; if (theConsole[func]) { logFunc = func; } if (isFunction(theConsole[logFunc])) { theConsole[logFunc](message); } } } var _InternalLogMessage = /** @class */ (function () { function _InternalLogMessage(msgId, msg, isUserAct, properties) { if (isUserAct === void 0) { isUserAct = false; } var _self = this; _self.messageId = msgId; _self.message = (isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) + msgId; var strProps = strEmpty; if (hasJSON()) { strProps = getJSON().stringify(properties); } var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : strEmpty) + (properties ? " props:" + _sanitizeDiagnosticText(strProps) : strEmpty); _self.message += diagnosticText; } _InternalLogMessage.dataType = "MessageData"; return _InternalLogMessage; }()); function safeGetLogger(core, config) { return (core || {}).logger || new DiagnosticLogger(config); } var DiagnosticLogger = /** @class */ (function () { function DiagnosticLogger(config) { this.identifier = "DiagnosticLogger"; this.queue = []; var _messageCount = 0; var _messageLogged = {}; dynamicProto(DiagnosticLogger, this, function (_self) { if (isNullOrUndefined(config)) { config = {}; } _self.consoleLoggingLevel = function () { return _getConfigValue("loggingLevelConsole", 0); }; _self.telemetryLoggingLevel = function () { return _getConfigValue("loggingLevelTelemetry", 1); }; _self.maxInternalMessageLimit = function () { return _getConfigValue("maxMessageLimit", 25); }; _self.enableDebugExceptions = function () { return _getConfigValue("enableDebugExceptions", false); }; _self.throwInternal = function (severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } var message = new _InternalLogMessage(msgId, msg, isUserAct, properties); if (_self.enableDebugExceptions()) { throw dumpObj(message); } else { var logFunc = severity === 1 ? strErrorToConsole : strWarnToConsole; if (!isUndefined(message.message)) { var logLevel = _self.consoleLoggingLevel(); if (isUserAct) { var messageKey = +message.messageId; if (!_messageLogged[messageKey] && logLevel >= severity) { _self[logFunc](message.message); _messageLogged[messageKey] = true; } } else { if (logLevel >= severity) { _self[logFunc](message.message); } } _self.logInternalMessage(severity, message); } else { _debugExtMsg("throw" + (severity === 1 ? "Critical" : "Warning"), message); } } }; _self.warnToConsole = function (message) { _logToConsole("warn", message); _debugExtMsg("warning", message); }; _self.errorToConsole = function (message) { _logToConsole("error", message); _debugExtMsg("error", message); }; _self.resetInternalMessageCount = function () { _messageCount = 0; _messageLogged = {}; }; _self.logInternalMessage = function (severity, message) { if (_areInternalMessagesThrottled()) { return; } var logMessage = true; var messageKey = AIInternalMessagePrefix + message.messageId; if (_messageLogged[messageKey]) { logMessage = false; } else { _messageLogged[messageKey] = true; } if (logMessage) { if (severity <= _self.telemetryLoggingLevel()) { _self.queue.push(message); _messageCount++; _debugExtMsg((severity === 1 ? "error" : "warn"), message); } if (_messageCount === _self.maxInternalMessageLimit()) { var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app."; var throttleMessage = new _InternalLogMessage(23 , throttleLimitMessage, false); _self.queue.push(throttleMessage); if (severity === 1 ) { _self.errorToConsole(throttleLimitMessage); } else { _self.warnToConsole(throttleLimitMessage); } } } }; function _getConfigValue(name, defValue) { var value = config[name]; if (!isNullOrUndefined(value)) { return value; } return defValue; } function _areInternalMessagesThrottled() { return _messageCount >= _self.maxInternalMessageLimit(); } function _debugExtMsg(name, data) { var dbgExt = getDebugExt(config); if (dbgExt && dbgExt.diagLog) { dbgExt.diagLog(name, data); } } }); } return DiagnosticLogger; }()); function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } (logger || new DiagnosticLogger()).throwInternal(severity, msgId, msg, properties, isUserAct); } var strExecutionContextKey = "ctx"; var PerfEvent = /** @class */ (function () { function PerfEvent(name, payloadDetails, isAsync) { var _self = this; var accessorDefined = false; _self.start = dateNow(); _self.name = name; _self.isAsync = isAsync; _self.isChildEvt = function () { return false; }; if (isFunction(payloadDetails)) { var theDetails_1; accessorDefined = objDefineAccessors(_self, "payload", function () { if (!theDetails_1 && isFunction(payloadDetails)) { theDetails_1 = payloadDetails(); payloadDetails = null; } return theDetails_1; }); } _self.getCtx = function (key) { if (key) { if (key === PerfEvent.ParentContextKey || key === PerfEvent.ChildrenContextKey) { return _self[key]; } return (_self[strExecutionContextKey] || {})[key]; } return null; }; _self.setCtx = function (key, value) { if (key) { if (key === PerfEvent.ParentContextKey) { if (!_self[key]) { _self.isChildEvt = function () { return true; }; } _self[key] = value; } else if (key === PerfEvent.ChildrenContextKey) { _self[key] = value; } else { var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {}; ctx[key] = value; } } }; _self.complete = function () { var childTime = 0; var childEvts = _self.getCtx(PerfEvent.ChildrenContextKey); if (isArray(childEvts)) { for (var lp = 0; lp < childEvts.length; lp++) { var childEvt = childEvts[lp]; if (childEvt) { childTime += childEvt.time; } } } _self.time = dateNow() - _self.start; _self.exTime = _self.time - childTime; _self.complete = function () { }; if (!accessorDefined && isFunction(payloadDetails)) { _self.payload = payloadDetails(); } }; } PerfEvent.ParentContextKey = "parent"; PerfEvent.ChildrenContextKey = "childEvts"; return PerfEvent; }()); var doPerfActiveKey = "CoreUtils.doPerf"; function doPerf(mgrSource, getSource, func, details, isAsync) { if (mgrSource) { var perfMgr = mgrSource; if (isFunction(perfMgr["getPerfMgr"])) { perfMgr = perfMgr["getPerfMgr"](); } if (perfMgr) { var perfEvt = void 0; var currentActive = perfMgr.getCtx(doPerfActiveKey); try { perfEvt = perfMgr.create(getSource(), details, isAsync); if (perfEvt) { if (currentActive && perfEvt.setCtx) { perfEvt.setCtx(PerfEvent.ParentContextKey, currentActive); if (currentActive.getCtx && currentActive.setCtx) { var children = currentActive.getCtx(PerfEvent.ChildrenContextKey); if (!children) { children = []; currentActive.setCtx(PerfEvent.ChildrenContextKey, children); } children.push(perfEvt); } } perfMgr.setCtx(doPerfActiveKey, perfEvt); return func(perfEvt); } } catch (ex) { if (perfEvt && perfEvt.setCtx) { perfEvt.setCtx("exception", ex); } } finally { if (perfEvt) { perfMgr.fire(perfEvt); } perfMgr.setCtx(doPerfActiveKey, currentActive); } } } return func(); } var UInt32Mask = 0x100000000; var MaxUInt32 = 0xffffffff; var _mwcSeeded = false; var _mwcW = 123456789; var _mwcZ = 987654321; function _mwcSeed(seedValue) { if (seedValue < 0) { seedValue >>>= 0; } _mwcW = (123456789 + seedValue) & MaxUInt32; _mwcZ = (987654321 - seedValue) & MaxUInt32; _mwcSeeded = true; } function _autoSeedMwc() { try { var now = dateNow() & 0x7fffffff; _mwcSeed(((Math.random() * UInt32Mask) ^ now) + now); } catch (e) { } } function random32(signed) { var value = 0; var c = getCrypto() || getMsCrypto(); if (c && c.getRandomValues) { value = c.getRandomValues(new Uint32Array(1))[0] & MaxUInt32; } if (value === 0 && isIE()) { if (!_mwcSeeded) { _autoSeedMwc(); } value = mwcRandom32() & MaxUInt32; } if (value === 0) { value = Math.floor((UInt32Mask * Math.random()) | 0); } if (!signed) { value >>>= 0; } return value; } function mwcRandom32(signed) { _mwcZ = (36969 * (_mwcZ & 0xFFFF) + (_mwcZ >> 16)) & MaxUInt32; _mwcW = (18000 * (_mwcW & 0xFFFF) + (_mwcW >> 16)) & MaxUInt32; var value = (((_mwcZ << 16) + (_mwcW & 0xFFFF)) >>> 0) & MaxUInt32 | 0; if (!signed) { value >>>= 0; } return value; } function newId(maxLength) { if (maxLength === void 0) { maxLength = 22; } var base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; var number = random32() >>> 0; var chars = 0; var result = strEmpty; while (result.length < maxLength) { chars++; result += base64chars.charAt(number & 0x3F); number >>>= 6; if (chars === 5) { number = (((random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0; chars = 0; } } return result; } var _objDefineProperty = ObjDefineProperty; var version = "2.8.3"; var instanceName = "." + newId(6); var _dataUid = 0; function _createAccessor(target, prop, value) { if (_objDefineProperty) { try { _objDefineProperty(target, prop, { value: value, enumerable: false, configurable: true }); return true; } catch (e) { } } return false; } function _canAcceptData(target) { return target.nodeType === 1 || target.nodeType === 9 || !(+target.nodeType); } function _getCache(data, target) { var theCache = target[data.id]; if (!theCache) { theCache = {}; try { if (_canAcceptData(target)) { if (!_createAccessor(target, data.id, theCache)) { target[data.id] = theCache; } } } catch (e) { } } return theCache; } function createUniqueNamespace(name, includeVersion) { if (includeVersion === void 0) { includeVersion = false; } return normalizeJsName(name + (_dataUid++) + (includeVersion ? "." + version : "") + instanceName); } function createElmNodeData(name) { var data = { id: createUniqueNamespace("_aiData-" + (name || "") + "." + version), accept: function (target) { return _canAcceptData(target); }, get: function (target, name, defValue, addDefault) { var theCache = target[data.id]; if (!theCache) { if (addDefault) { theCache = _getCache(data, target); theCache[normalizeJsName(name)] = defValue; } return defValue; } return theCache[normalizeJsName(name)]; }, kill: function (target, name) { if (target && target[name]) { try { delete target[name]; } catch (e) { } } } }; return data; } var pluginStateData = createElmNodeData("plugin"); function _getPluginState(plugin) { return pluginStateData.get(plugin, "state", {}, true); } var strTelemetryPluginChain = "TelemetryPluginChain"; var strHasRunFlags = "_hasRun"; var strGetTelCtx = "_getTelCtx"; var _chainId = 0; function _getNextProxyStart(proxy, core, startAt) { while (proxy) { if (proxy.getPlugin() === startAt) { return proxy; } proxy = proxy.getNext(); } return createTelemetryProxyChain([startAt], core.config || {}, core); } function _createInternalContext(telemetryChain, config, core, startAt) { var _nextProxy = null; var _onComplete = []; if (startAt !== null) { _nextProxy = startAt ? _getNextProxyStart(telemetryChain, core, startAt) : telemetryChain; } var context = { _next: _moveNext, ctx: { core: function () { return core; }, diagLog: function () { return safeGetLogger(core, config); }, getCfg: function () { return config; }, getExtCfg: _getExtCfg, getConfig: _getConfig, hasNext: function () { return !!_nextProxy; }, getNext: function () { return _nextProxy; }, setNext: function (nextPlugin) { _nextProxy = nextPlugin; }, iterate: _iterateChain, onComplete: _addOnComplete } }; function _addOnComplete(onComplete, that) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } if (onComplete) { _onComplete.push({ func: onComplete, self: !isUndefined(that) ? that : context.ctx, args: args }); } } function _moveNext() { var nextProxy = _nextProxy; _nextProxy = nextProxy ? nextProxy.getNext() : null; if (!nextProxy) { var onComplete = _onComplete; if (onComplete && onComplete.length > 0) { arrForEach(onComplete, function (completeDetails) { try { completeDetails.func.call(completeDetails.self, completeDetails.args); } catch (e) { _throwInternal(core.logger, 2 , 73 , "Unexpected Exception during onComplete - " + dumpObj(e)); } }); _onComplete = []; } } return nextProxy; } function _getExtCfg(identifier, defaultValue, mergeDefault) { if (defaultValue === void 0) { defaultValue = {}; } if (mergeDefault === void 0) { mergeDefault = 0 ; } var theConfig; if (config) { var extConfig = config.extensionConfig; if (extConfig && identifier) { theConfig = extConfig[identifier]; } } if (!theConfig) { theConfig = defaultValue; } else if (isObject(defaultValue)) { if (mergeDefault !== 0 ) { var newConfig_1 = objExtend(true, defaultValue, theConfig); if (config && mergeDefault === 2 ) { objForEachKey(defaultValue, function (field) { if (isNullOrUndefined(newConfig_1[field])) { var cfgValue = config[field]; if (!isNullOrUndefined(cfgValue)) { newConfig_1[field] = cfgValue; } } }); } theConfig = newConfig_1; } } return theConfig; } function _getConfig(identifier, field, defaultValue) { if (defaultValue === void 0) { defaultValue = false; } var theValue; var extConfig = _getExtCfg(identifier, null); if (extConfig && !isNullOrUndefined(extConfig[field])) { theValue = extConfig[field]; } else if (config && !isNullOrUndefined(config[field])) { theValue = config[field]; } return !isNullOrUndefined(theValue) ? theValue : defaultValue; } function _iterateChain(cb) { var nextPlugin; while (!!(nextPlugin = context._next())) { var plugin = nextPlugin.getPlugin(); if (plugin) { cb(plugin); } } } return context; } function createProcessTelemetryContext(telemetryChain, config, core, startAt) { var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(env) { var nextPlugin = internalContext._next(); nextPlugin && nextPlugin.processTelemetry(env, context); return !nextPlugin; } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryContext(plugins || context.getNext(), config, core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } function createProcessTelemetryUnloadContext(telemetryChain, core, startAt) { var config = core.config || {}; var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(unloadState) { var nextPlugin = internalContext._next(); nextPlugin && nextPlugin.unload(context, unloadState); return !nextPlugin; } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryUnloadContext(plugins || context.getNext(), core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } function createProcessTelemetryUpdateContext(telemetryChain, core, startAt) { var config = core.config || {}; var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(updateState) { return context.iterate(function (plugin) { if (isFunction(plugin.update)) { plugin.update(context, updateState); } }); } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryUpdateContext(plugins || context.getNext(), core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } function createTelemetryProxyChain(plugins, config, core, startAt) { var firstProxy = null; var add = startAt ? false : true; if (isArray(plugins) && plugins.length > 0) { var lastProxy_1 = null; arrForEach(plugins, function (thePlugin) { if (!add && startAt === thePlugin) { add = true; } if (add && thePlugin && isFunction(thePlugin.processTelemetry)) { var newProxy = createTelemetryPluginProxy(thePlugin, config, core); if (!firstProxy) { firstProxy = newProxy; } if (lastProxy_1) { lastProxy_1._setNext(newProxy); } lastProxy_1 = newProxy; } }); } if (startAt && !firstProxy) { return createTelemetryProxyChain([startAt], config, core); } return firstProxy; } function createTelemetryPluginProxy(plugin, config, core) { var nextProxy = null; var hasProcessTelemetry = isFunction(plugin.processTelemetry); var hasSetNext = isFunction(plugin.setNextPlugin); var chainId; if (plugin) { chainId = plugin.identifier + "-" + plugin.priority + "-" + _chainId++; } else { chainId = "Unknown-0-" + _chainId++; } var proxyChain = { getPlugin: function () { return plugin; }, getNext: function () { return nextProxy; }, processTelemetry: _processTelemetry, unload: _unloadPlugin, update: _updatePlugin, _id: chainId, _setNext: function (nextPlugin) { nextProxy = nextPlugin; } }; function _getTelCtx() { var itemCtx; if (plugin && isFunction(plugin[strGetTelCtx])) { itemCtx = plugin[strGetTelCtx](); } if (!itemCtx) { itemCtx = createProcessTelemetryContext(proxyChain, config, core); } return itemCtx; } function _processChain(itemCtx, processPluginFn, name, details, isAsync) { var hasRun = false; var identifier = plugin ? plugin.identifier : strTelemetryPluginChain; var hasRunContext = itemCtx[strHasRunFlags]; if (!hasRunContext) { hasRunContext = itemCtx[strHasRunFlags] = {}; } itemCtx.setNext(nextProxy); if (plugin) { doPerf(itemCtx[strCore](), function () { return identifier + ":" + name; }, function () { hasRunContext[chainId] = true; try { var nextId = nextProxy ? nextProxy._id : strEmpty; if (nextId) { hasRunContext[nextId] = false; } hasRun = processPluginFn(itemCtx); } catch (error) { var hasNextRun = nextProxy ? hasRunContext[nextProxy._id] : true; if (hasNextRun) { hasRun = true; } if (!nextProxy || !hasNextRun) { _throwInternal(itemCtx.diagLog(), 1 , 73 , "Plugin [" + identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext)); } } }, details, isAsync); } return hasRun; } function _processTelemetry(env, itemCtx) { itemCtx = itemCtx || _getTelCtx(); function _callProcessTelemetry(itemCtx) { if (!plugin || !hasProcessTelemetry) { return false; } var pluginState = _getPluginState(plugin); if (pluginState.teardown || pluginState[strDisabled]) { return false; } if (hasSetNext) { plugin.setNextPlugin(nextProxy); } plugin.processTelemetry(env, itemCtx); return true; } if (!_processChain(itemCtx, _callProcessTelemetry, "processTelemetry", function () { return ({ item: env }); }, !(env.sync))) { itemCtx.processNext(env); } } function _unloadPlugin(unloadCtx, unloadState) { function _callTeardown() { var hasRun = false; if (plugin) { var pluginState = _getPluginState(plugin); var pluginCore = plugin[strCore] || pluginState.core; if (plugin && (!pluginCore || pluginCore === unloadCtx[strCore]()) && !pluginState[strTeardown]) { pluginState[strCore] = null; pluginState[strTeardown] = true; pluginState[strIsInitialized] = false; if (plugin[strTeardown] && plugin[strTeardown](unloadCtx, unloadState) === true) { hasRun = true; } } } return hasRun; } if (!_processChain(unloadCtx, _callTeardown, "unload", function () { }, unloadState.isAsync)) { unloadCtx.processNext(unloadState); } } function _updatePlugin(updateCtx, updateState) { function _callUpdate() { var hasRun = false; if (plugin) { var pluginState = _getPluginState(plugin); var pluginCore = plugin[strCore] || pluginState.core; if (plugin && (!pluginCore || pluginCore === updateCtx[strCore]()) && !pluginState[strTeardown]) { if (plugin[strUpdate] && plugin[strUpdate](updateCtx, updateState) === true) { hasRun = true; } } } return hasRun; } if (!_processChain(updateCtx, _callUpdate, "update", function () { }, false)) { updateCtx.processNext(updateState); } } return objFreeze(proxyChain); } var strExtensionConfig = "extensionConfig"; function createUnloadHandlerContainer() { var handlers = []; function _addHandler(handler) { if (handler) { handlers.push(handler); } } function _runHandlers(unloadCtx, unloadState) { arrForEach(handlers, function (handler) { try { handler(unloadCtx, unloadState); } catch (e) { _throwInternal(unloadCtx.diagLog(), 2 , 73 , "Unexpected error calling unload handler - " + dumpObj(e)); } }); handlers = []; } return { add: _addHandler, run: _runHandlers }; } var strGetPlugin = "getPlugin"; var BaseTelemetryPlugin = /** @class */ (function () { function BaseTelemetryPlugin() { var _self = this; var _isinitialized; var _rootCtx; var _nextPlugin; var _unloadHandlerContainer; var _hooks; _initDefaults(); dynamicProto(BaseTelemetryPlugin, _self, function (_self) { _self.initialize = function (config, core, extensions, pluginChain) { _setDefaults(config, core, pluginChain); _isinitialized = true; }; _self.teardown = function (unloadCtx, unloadState) { var core = _self.core; if (!core || (unloadCtx && core !== unloadCtx.core())) { return; } var result; var unloadDone = false; var theUnloadCtx = unloadCtx || createProcessTelemetryUnloadContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin); var theUnloadState = unloadState || { reason: 0 , isAsync: false }; function _unloadCallback() { if (!unloadDone) { unloadDone = true; _unloadHandlerContainer.run(theUnloadCtx, unloadState); arrForEach(_hooks, function (fn) { fn.rm(); }); _hooks = []; if (result === true) { theUnloadCtx.processNext(theUnloadState); } _initDefaults(); } } if (!_self[strDoTeardown] || _self[strDoTeardown](theUnloadCtx, theUnloadState, _unloadCallback) !== true) { _unloadCallback(); } else { result = true; } return result; }; _self.update = function (updateCtx, updateState) { var core = _self.core; if (!core || (updateCtx && core !== updateCtx.core())) { return; } var result; var updateDone = false; var theUpdateCtx = updateCtx || createProcessTelemetryUpdateContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin); var theUpdateState = updateState || { reason: 0 }; function _updateCallback() { if (!updateDone) { updateDone = true; _setDefaults(theUpdateCtx.getCfg(), theUpdateCtx.core(), theUpdateCtx.getNext()); } } if (!_self._doUpdate || _self._doUpdate(theUpdateCtx, theUpdateState, _updateCallback) !== true) { _updateCallback(); } else { result = true; } return result; }; _self._addHook = function (hooks) { if (hooks) { if (isArray(hooks)) { _hooks = _hooks.concat(hooks); } else { _hooks.push(hooks); } } }; proxyFunctionAs(_self, "_addUnloadCb", function () { return _unloadHandlerContainer; }, "add"); }); _self.diagLog = function (itemCtx) { return _getTelCtx(itemCtx).diagLog(); }; _self[strIsInitialized] = function () { return _isinitialized; }; _self.setInitialized = function (isInitialized) { _isinitialized = isInitialized; }; _self[strSetNextPlugin] = function (next) { _nextPlugin = next; }; _self.processNext = function (env, itemCtx) { if (itemCtx) { itemCtx.processNext(env); } else if (_nextPlugin && isFunction(_nextPlugin.processTelemetry)) { _nextPlugin.processTelemetry(env, null); } }; _self._getTelCtx = _getTelCtx; function _getTelCtx(currentCtx) { if (currentCtx === void 0) { currentCtx = null; } var itemCtx = currentCtx; if (!itemCtx) { var rootCtx = _rootCtx || createProcessTelemetryContext(null, {}, _self.core); if (_nextPlugin && _nextPlugin[strGetPlugin]) { itemCtx = rootCtx.createNew(null, _nextPlugin[strGetPlugin]); } else { itemCtx = rootCtx.createNew(null, _nextPlugin); } } return itemCtx; } function _setDefaults(config, core, pluginChain) { if (config) { setValue(config, strExtensionConfig, [], null, isNullOrUndefined); } if (!pluginChain && core) { pluginChain = core.getProcessTelContext().getNext(); } var nextPlugin = _nextPlugin; if (_nextPlugin && _nextPlugin[strGetPlugin]) { nextPlugin = _nextPlugin[strGetPlugin](); } _self.core = core; _rootCtx = createProcessTelemetryContext(pluginChain, config, core, nextPlugin); } function _initDefaults() { _isinitialized = false; _self.core = null; _rootCtx = null; _nextPlugin = null; _hooks = []; _unloadHandlerContainer = createUnloadHandlerContainer(); } } return BaseTelemetryPlugin; }()); var strOnPrefix = "on"; var strAttachEvent = "attachEvent"; var strAddEventHelper = "addEventListener"; var strDetachEvent = "detachEvent"; var strRemoveEventListener = "removeEventListener"; var strEvents = "events"; var strVisibilityChangeEvt = "visibilitychange"; var strPageHide = "pagehide"; var strPageShow = "pageshow"; var strUnload = "unload"; var strBeforeUnload = "beforeunload"; var strPageHideNamespace = createUniqueNamespace("aiEvtPageHide"); var strPageShowNamespace = createUniqueNamespace("aiEvtPageShow"); var rRemoveEmptyNs = /\.[\.]+/g; var rRemoveTrailingEmptyNs = /[\.]+$/; var _guid = 1; var elmNodeData = createElmNodeData("events"); var eventNamespace = /^([^.]*)(?:\.(.+)|)/; function _normalizeNamespace(name) { if (name && name.replace) { return name.replace(/^\s*\.*|\.*\s*$/g, ""); } return name; } function _getEvtNamespace(eventName, evtNamespace) { if (evtNamespace) { var theNamespace_1 = ""; if (isArray(evtNamespace)) { theNamespace_1 = ""; arrForEach(evtNamespace, function (name) { name = _normalizeNamespace(name); if (name) { if (name[0] !== ".") { name = "." + name; } theNamespace_1 += name; } }); } else { theNamespace_1 = _normalizeNamespace(evtNamespace); } if (theNamespace_1) { if (theNamespace_1[0] !== ".") { theNamespace_1 = "." + theNamespace_1; } eventName = (eventName || "") + theNamespace_1; } } var parsedEvent = (eventNamespace.exec(eventName || "") || []); return { type: parsedEvent[1], ns: ((parsedEvent[2] || "").replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, "").split(".").sort()).join(".") }; } function _getRegisteredEvents(target, evtName, addDefault) { if (addDefault === void 0) { addDefault = true; } var aiEvts = elmNodeData.get(target, strEvents, {}, addDefault); var registeredEvents = aiEvts[evtName]; if (!registeredEvents) { registeredEvents = aiEvts[evtName] = []; } return registeredEvents; } function _doDetach(obj, evtName, handlerRef, useCapture) { if (obj && evtName && evtName.type) { if (obj[strRemoveEventListener]) { obj[strRemoveEventListener](evtName.type, handlerRef, useCapture); } else if (obj[strDetachEvent]) { obj[strDetachEvent](strOnPrefix + evtName.type, handlerRef); } } } function _doAttach(obj, evtName, handlerRef, useCapture) { var result = false; if (obj && evtName && evtName.type && handlerRef) { if (obj[strAddEventHelper]) { obj[strAddEventHelper](evtName.type, handlerRef, useCapture); result = true; } else if (obj[strAttachEvent]) { obj[strAttachEvent](strOnPrefix + evtName.type, handlerRef); result = true; } } return result; } function _doUnregister(target, events, evtName, unRegFn) { var idx = events.length; while (idx--) { var theEvent = events[idx]; if (theEvent) { if (!evtName.ns || evtName.ns === theEvent.evtName.ns) { if (!unRegFn || unRegFn(theEvent)) { _doDetach(target, theEvent.evtName, theEvent.handler, theEvent.capture); events.splice(idx, 1); } } } } } function _unregisterEvents(target, evtName, unRegFn) { if (evtName.type) { _doUnregister(target, _getRegisteredEvents(target, evtName.type), evtName, unRegFn); } else { var eventCache = elmNodeData.get(target, strEvents, {}); objForEachKey(eventCache, function (evtType, events) { _doUnregister(target, events, evtName, unRegFn); }); if (objKeys(eventCache).length === 0) { elmNodeData.kill(target, strEvents); } } } function mergeEvtNamespace(theNamespace, namespaces) { var newNamespaces; if (namespaces) { if (isArray(namespaces)) { newNamespaces = [theNamespace].concat(namespaces); } else { newNamespaces = [theNamespace, namespaces]; } newNamespaces = (_getEvtNamespace("xx", newNamespaces).ns).split("."); } else { newNamespaces = theNamespace; } return newNamespaces; } function eventOn(target, eventName, handlerRef, evtNamespace, useCapture) { if (useCapture === void 0) { useCapture = false; } var result = false; if (target) { try { var evtName = _getEvtNamespace(eventName, evtNamespace); result = _doAttach(target, evtName, handlerRef, useCapture); if (result && elmNodeData.accept(target)) { var registeredEvent = { guid: _guid++, evtName: evtName, handler: handlerRef, capture: useCapture }; _getRegisteredEvents(target, evtName.type).push(registeredEvent); } } catch (e) { } } return result; } function eventOff(target, eventName, handlerRef, evtNamespace, useCapture) { if (useCapture === void 0) { useCapture = false; } if (target) { try { var evtName_1 = _getEvtNamespace(eventName, evtNamespace); var found_1 = false; _unregisterEvents(target, evtName_1, function (regEvent) { if ((evtName_1.ns && !handlerRef) || regEvent.handler === handlerRef) { found_1 = true; return true; } return false; }); if (!found_1) { _doDetach(target, evtName_1, handlerRef, useCapture); } } catch (e) { } } } function addEventHandler(eventName, callback, evtNamespace) { var result = false; var w = getWindow(); if (w) { result = eventOn(w, eventName, callback, evtNamespace); result = eventOn(w["body"], eventName, callback, evtNamespace) || result; } var doc = getDocument(); if (doc) { result = eventOn(doc, eventName, callback, evtNamespace) || result; } return result; } function removeEventHandler(eventName, callback, evtNamespace) { var w = getWindow(); if (w) { eventOff(w, eventName, callback, evtNamespace); eventOff(w["body"], eventName, callback, evtNamespace); } var doc = getDocument(); if (doc) { eventOff(doc, eventName, callback, evtNamespace); } } function _addEventListeners(events, listener, excludeEvents, evtNamespace) { var added = false; if (listener && events && events.length > 0) { arrForEach(events, function (name) { if (name) { if (!excludeEvents || arrIndexOf(excludeEvents, name) === -1) { added = addEventHandler(name, listener, evtNamespace) || added; } } }); } return added; } function addEventListeners(events, listener, excludeEvents, evtNamespace) { var added = false; if (listener && events && isArray(events)) { added = _addEventListeners(events, listener, excludeEvents, evtNamespace); if (!added && excludeEvents && excludeEvents.length > 0) { added = _addEventListeners(events, listener, null, evtNamespace); } } return added; } function removeEventListeners(events, listener, evtNamespace) { if (events && isArray(events)) { arrForEach(events, function (name) { if (name) { removeEventHandler(name, listener, evtNamespace); } }); } } function addPageUnloadEventListener(listener, excludeEvents, evtNamespace) { return addEventListeners([strBeforeUnload, strUnload, strPageHide], listener, excludeEvents, evtNamespace); } function removePageUnloadEventListener(listener, evtNamespace) { removeEventListeners([strBeforeUnload, strUnload, strPageHide], listener, evtNamespace); } function addPageHideEventListener(listener, excludeEvents, evtNamespace) { function _handlePageVisibility(evt) { var doc = getDocument(); if (listener && doc && doc.visibilityState === "hidden") { listener(evt); } } var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace); var pageUnloadAdded = _addEventListeners([strPageHide], listener, excludeEvents, newNamespaces); if (!excludeEvents || arrIndexOf(excludeEvents, strVisibilityChangeEvt) === -1) { pageUnloadAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageUnloadAdded; } if (!pageUnloadAdded && excludeEvents) { pageUnloadAdded = addPageHideEventListener(listener, null, evtNamespace); } return pageUnloadAdded; } function removePageHideEventListener(listener, evtNamespace) { var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace); removeEventListeners([strPageHide], listener, newNamespaces); removeEventListeners([strVisibilityChangeEvt], null, newNamespaces); } function addPageShowEventListener(listener, excludeEvents, evtNamespace) { function _handlePageVisibility(evt) { var doc = getDocument(); if (listener && doc && doc.visibilityState === "visible") { listener(evt); } } var newNamespaces = mergeEvtNamespace(strPageShowNamespace, evtNamespace); var pageShowAdded = _addEventListeners([strPageShow], listener, excludeEvents, newNamespaces); pageShowAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageShowAdded; if (!pageShowAdded && excludeEvents) { pageShowAdded = addPageShowEventListener(listener, null, evtNamespace); } return pageShowAdded; } function removePageShowEventListener(listener, evtNamespace) { var newNamespaces = mergeEvtNamespace(strPageShowNamespace, evtNamespace); removeEventListeners([strPageShow], listener, newNamespaces); removeEventListeners([strVisibilityChangeEvt], null, newNamespaces); } function perfNow() { var perf = getPerformance(); if (perf && perf.now) { return perf.now(); } return dateNow(); } var _a$1; var Version = '3.2.2'; var FullVersionString = "1DS-Web-JS-" + Version; var strDisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation"; var strWithCredentials = "withCredentials"; var strTimeout = "timeout"; var _fieldTypeEventPropMap = (_a$1 = {}, _a$1[0 ] = 0 , _a$1[2 ] = 6 , _a$1[1 ] = 1 , _a$1[3 ] = 7 , _a$1[4096 | 2 ] = 6 , _a$1[4096 | 1 ] = 1 , _a$1[4096 | 3 ] = 7 , _a$1); Boolean(getDocument()); Boolean(getWindow()); function isValueAssigned(value) { return !(value === "" || isNullOrUndefined(value)); } function getTenantId(apiKey) { if (apiKey) { var indexTenantId = apiKey.indexOf("-"); if (indexTenantId > -1) { return apiKey.substring(0, indexTenantId); } } return ""; } function sanitizeProperty(name, property, stringifyObjects) { if ((!property && !isValueAssigned(property)) || typeof name !== "string") { return null; } var propType = typeof property; if (propType === "string" || propType === "number" || propType === "boolean" || isArray(property)) { property = { value: property }; } else if (propType === "object" && !property.hasOwnProperty("value")) { property = { value: stringifyObjects ? JSON.stringify(property) : property }; } else if (isNullOrUndefined(property.value) || property.value === "" || (!isString(property.value) && !isNumber(property.value) && !isBoolean(property.value) && !isArray(property.value))) { return null; } if (isArray(property.value) && !isArrayValid(property.value)) { return null; } if (!isNullOrUndefined(property.kind)) { if (isArray(property.value) || !isValueKind(property.kind)) { return null; } property.value = property.value.toString(); } return property; } function getCommonSchemaMetaData(value, kind, type) { var encodedTypeValue = -1; if (!isUndefined(value)) { if (kind > 0) { if (kind === 32) { encodedTypeValue = (1 << 13); } else if (kind <= 13) { encodedTypeValue = (kind << 5); } } if (isDataType(type)) { if (encodedTypeValue === -1) { encodedTypeValue = 0; } encodedTypeValue |= type; } else { var propType = _fieldTypeEventPropMap[getFieldValueType(value)] || -1; if (encodedTypeValue !== -1 && propType !== -1) { encodedTypeValue |= propType; } else if (propType === 6 ) { encodedTypeValue = propType; } } } return encodedTypeValue; } function extend(obj, obj2, obj3, obj4, obj5) { var extended = {}; var deep = false; var i = 0; var length = arguments.length; var objProto = Object[strShimPrototype]; var theArgs = arguments; if (objProto.toString.call(theArgs[0]) === "[object Boolean]") { deep = theArgs[0]; i++; } for (; i < length; i++) { var obj = theArgs[i]; objForEachKey(obj, function (prop, value) { if (deep && value && isObject(value)) { if (isArray(value)) { extended[prop] = extended[prop] || []; arrForEach(value, function (arrayValue, arrayIndex) { if (arrayValue && isObject(arrayValue)) { extended[prop][arrayIndex] = extend(true, extended[prop][arrayIndex], arrayValue); } else { extended[prop][arrayIndex] = arrayValue; } }); } else { extended[prop] = extend(true, extended[prop], value); } } else { extended[prop] = value; } }); } return extended; } var getTime = perfNow; function isValueKind(value) { if (value === 0 || ((value > 0 && value <= 13 ) || value === 32 )) { return true; } return false; } function isDataType(value) { if (value >= 0 && value <= 9) { return true; } return false; } function isArrayValid(value) { return value.length > 0; } function setProcessTelemetryTimings(event, identifier) { var evt = event; evt.timings = evt.timings || {}; evt.timings.processTelemetryStart = evt.timings.processTelemetryStart || {}; evt.timings.processTelemetryStart[identifier] = getTime(); } function getFieldValueType(value) { var theType = 0 ; if (value !== null && value !== undefined) { var objType = typeof value; if (objType === "string") { theType = 1 ; } else if (objType === "number") { theType = 2 ; } else if (objType === "boolean") { theType = 3 ; } else if (objType === strShimObject) { theType = 4 ; if (isArray(value)) { theType = 4096 ; if (value.length > 0) { theType |= getFieldValueType(value[0]); } } else if (hasOwnProperty(value, "value")) { theType = 8192 | getFieldValueType(value.value); } } } return theType; } function isChromium() { return !!getGlobalInst("chrome"); } function openXhr(method, urlString, withCredentials, disabled, isSync, timeout) { if (disabled === void 0) { disabled = false; } if (isSync === void 0) { isSync = false; } function _wrapSetXhrProp(xhr, prop, value) { try { xhr[prop] = value; } catch (e) { } } var xhr = new XMLHttpRequest(); if (disabled) { _wrapSetXhrProp(xhr, strDisabledPropertyName, disabled); } if (withCredentials) { _wrapSetXhrProp(xhr, strWithCredentials, withCredentials); } xhr.open(method, urlString, !isSync); if (withCredentials) { _wrapSetXhrProp(xhr, strWithCredentials, withCredentials); } if (!isSync && timeout) { _wrapSetXhrProp(xhr, strTimeout, timeout); } return xhr; } var RT_PROFILE = "REAL_TIME"; var NRT_PROFILE = "NEAR_REAL_TIME"; var BE_PROFILE = "BEST_EFFORT"; var Method = "POST"; var DisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation"; var strDropped = "drop"; var strSending = "send"; var strRequeue = "requeue"; var strResponseFail = "rspFail"; var strOther = "oth"; var defaultCacheControl = "no-cache, no-store"; var defaultContentType = "application/x-json-stream"; var strCacheControl = "cache-control"; var strContentTypeHeader = "content-type"; var strKillTokensHeader = "kill-tokens"; var strKillDurationHeader = "kill-duration"; var strKillDurationSecondsHeader = "kill-duration-seconds"; var strTimeDeltaHeader = "time-delta-millis"; var strClientVersion = "client-version"; var strClientId = "client-id"; var strTimeDeltaToApply = "time-delta-to-apply-millis"; var strUploadTime = "upload-time"; var strApiKey = "apikey"; var strMsaDeviceTicket = "AuthMsaDeviceTicket"; var strAuthXToken = "AuthXToken"; var strNoResponseBody = "NoResponseBody"; var strMsfpc = "msfpc"; function _getEventMsfpc(theEvent) { var intWeb = ((theEvent.ext || {})["intweb"]); if (intWeb && isValueAssigned(intWeb[strMsfpc])) { return intWeb[strMsfpc]; } return null; } function _getMsfpc(theEvents) { var msfpc = null; for (var lp = 0; msfpc === null && lp < theEvents.length; lp++) { msfpc = _getEventMsfpc(theEvents[lp]); } return msfpc; } var EventBatch = /** @class */ (function () { function EventBatch(iKey, addEvents) { var events = addEvents ? [].concat(addEvents) : []; var _self = this; var _msfpc = _getMsfpc(events); _self.iKey = function () { return iKey; }; _self.Msfpc = function () { return _msfpc || ""; }; _self.count = function () { return events.length; }; _self.events = function () { return events; }; _self.addEvent = function (theEvent) { if (theEvent) { events.push(theEvent); if (!_msfpc) { _msfpc = _getEventMsfpc(theEvent); } return true; } return false; }; _self.split = function (fromEvent, numEvents) { var theEvents; if (fromEvent < events.length) { var cnt = events.length - fromEvent; if (!isNullOrUndefined(numEvents)) { cnt = numEvents < cnt ? numEvents : cnt; } theEvents = events.splice(fromEvent, cnt); _msfpc = _getMsfpc(events); } return new EventBatch(iKey, theEvents); }; } EventBatch.create = function (iKey, theEvents) { return new EventBatch(iKey, theEvents); }; return EventBatch; }()); var _MAX_STRING_JOINS = 20; var RequestSizeLimitBytes = 3984588; var BeaconRequestSizeLimitBytes = 65000; var MaxRecordSize = 2000000; var MaxBeaconRecordSize = Math.min(MaxRecordSize, BeaconRequestSizeLimitBytes); var metadata = "metadata"; var f = "f"; var rCheckDot = /\./; var Serializer = /** @class */ (function () { function Serializer(perfManager, valueSanitizer, stringifyObjects, enableCompoundKey) { var strData = "data"; var strBaseData = "baseData"; var strExt = "ext"; var _checkForCompoundkey = !!enableCompoundKey; var _processSubMetaData = true; var _theSanitizer = valueSanitizer; var _isReservedCache = {}; dynamicProto(Serializer, this, function (_self) { _self.createPayload = function (retryCnt, isTeardown, isSync, useSendBeacon, sendReason, sendType) { return { apiKeys: [], payloadBlob: "", overflow: null, sizeExceed: [], failedEvts: [], batches: [], numEvents: 0, retryCnt: retryCnt, isTeardown: isTeardown, isSync: isSync, isBeacon: useSendBeacon, sendType: sendType, sendReason: sendReason }; }; _self.appendPayload = function (payload, theBatch, maxEventsPerBatch) { var canAddEvents = payload && theBatch && !payload.overflow; if (canAddEvents) { doPerf(perfManager, function () { return "Serializer:appendPayload"; }, function () { var theEvents = theBatch.events(); var payloadBlob = payload.payloadBlob; var payloadEvents = payload.numEvents; var eventsAdded = false; var sizeExceeded = []; var failedEvts = []; var isBeaconPayload = payload.isBeacon; var requestMaxSize = isBeaconPayload ? BeaconRequestSizeLimitBytes : RequestSizeLimitBytes; var recordMaxSize = isBeaconPayload ? MaxBeaconRecordSize : MaxRecordSize; var lp = 0; var joinCount = 0; while (lp < theEvents.length) { var theEvent = theEvents[lp]; if (theEvent) { if (payloadEvents >= maxEventsPerBatch) { payload.overflow = theBatch.split(lp); break; } var eventBlob = _self.getEventBlob(theEvent); if (eventBlob && eventBlob.length <= recordMaxSize) { var blobLength = eventBlob.length; var currentSize = payloadBlob.length; if (currentSize + blobLength > requestMaxSize) { payload.overflow = theBatch.split(lp); break; } if (payloadBlob) { payloadBlob += "\n"; } payloadBlob += eventBlob; joinCount++; if (joinCount > _MAX_STRING_JOINS) { payloadBlob.substr(0, 1); joinCount = 0; } eventsAdded = true; payloadEvents++; } else { if (eventBlob) { sizeExceeded.push(theEvent); } else { failedEvts.push(theEvent); } theEvents.splice(lp, 1); lp--; } } lp++; } if (sizeExceeded && sizeExceeded.length > 0) { payload.sizeExceed.push(EventBatch.create(theBatch.iKey(), sizeExceeded)); } if (failedEvts && failedEvts.length > 0) { payload.failedEvts.push(EventBatch.create(theBatch.iKey(), failedEvts)); } if (eventsAdded) { payload.batches.push(theBatch); payload.payloadBlob = payloadBlob; payload.numEvents = payloadEvents; var apiKey = theBatch.iKey(); if (arrIndexOf(payload.apiKeys, apiKey) === -1) { payload.apiKeys.push(apiKey); } } }, function () { return ({ payload: payload, theBatch: { iKey: theBatch.iKey(), evts: theBatch.events() }, max: maxEventsPerBatch }); }); } return canAddEvents; }; _self.getEventBlob = function (eventData) { try { return doPerf(perfManager, function () { return "Serializer.getEventBlob"; }, function () { var serializedEvent = {}; serializedEvent.name = eventData.name; serializedEvent.time = eventData.time; serializedEvent.ver = eventData.ver; serializedEvent.iKey = "o:" + getTenantId(eventData.iKey); var serializedExt = {}; var eventExt = eventData[strExt]; if (eventExt) { serializedEvent[strExt] = serializedExt; objForEachKey(eventExt, function (key, value) { var data = serializedExt[key] = {}; _processPathKeys(value, data, "ext." + key, true, null, null, true); }); } var serializedData = serializedEvent[strData] = {}; serializedData.baseType = eventData.baseType; var serializedBaseData = serializedData[strBaseData] = {}; _processPathKeys(eventData.baseData, serializedBaseData, strBaseData, false, [strBaseData], function (pathKeys, name, value) { _addJSONPropertyMetaData(serializedExt, pathKeys, name, value); }, _processSubMetaData); _processPathKeys(eventData.data, serializedData, strData, false, [], function (pathKeys, name, value) { _addJSONPropertyMetaData(serializedExt, pathKeys, name, value); }, _processSubMetaData); return JSON.stringify(serializedEvent); }, function () { return ({ item: eventData }); }); } catch (e) { return null; } }; function _isReservedField(path, name) { var result = _isReservedCache[path]; if (result === undefined) { if (path.length >= 7) { result = strStartsWith(path, "ext.metadata") || strStartsWith(path, "ext.web"); } _isReservedCache[path] = result; } return result; } function _processPathKeys(srcObj, target, thePath, checkReserved, metadataPathKeys, metadataCallback, processSubKeys) { objForEachKey(srcObj, function (key, srcValue) { var prop = null; if (srcValue || isValueAssigned(srcValue)) { var path = thePath; var name_1 = key; var theMetaPathKeys = metadataPathKeys; var destObj = target; if (_checkForCompoundkey && !checkReserved && rCheckDot.test(key)) { var subKeys = key.split("."); var keyLen = subKeys.length; if (keyLen > 1) { if (theMetaPathKeys) { theMetaPathKeys = theMetaPathKeys.slice(); } for (var lp = 0; lp < keyLen - 1; lp++) { var subKey = subKeys[lp]; destObj = destObj[subKey] = destObj[subKey] || {}; path += "." + subKey; if (theMetaPathKeys) { theMetaPathKeys.push(subKey); } } name_1 = subKeys[keyLen - 1]; } } var isReserved = checkReserved && _isReservedField(path); if (!isReserved && _theSanitizer && _theSanitizer.handleField(path, name_1)) { prop = _theSanitizer.value(path, name_1, srcValue, stringifyObjects); } else { prop = sanitizeProperty(name_1, srcValue, stringifyObjects); } if (prop) { var newValue = prop.value; destObj[name_1] = newValue; if (metadataCallback) { metadataCallback(theMetaPathKeys, name_1, prop); } if (processSubKeys && typeof newValue === "object" && !isArray(newValue)) { var newPath = theMetaPathKeys; if (newPath) { newPath = newPath.slice(); newPath.push(name_1); } _processPathKeys(srcValue, newValue, path + "." + name_1, checkReserved, newPath, metadataCallback, processSubKeys); } } } }); } }); } return Serializer; }()); function _addJSONPropertyMetaData(json, propKeys, name, propertyValue) { if (propertyValue && json) { var encodedTypeValue = getCommonSchemaMetaData(propertyValue.value, propertyValue.kind, propertyValue.propertyType); if (encodedTypeValue > -1) { var metaData = json[metadata]; if (!metaData) { metaData = json[metadata] = { f: {} }; } var metaTarget = metaData[f]; if (!metaTarget) { metaTarget = metaData[f] = {}; } if (propKeys) { for (var lp = 0; lp < propKeys.length; lp++) { var key = propKeys[lp]; if (!metaTarget[key]) { metaTarget[key] = { f: {} }; } var newTarget = metaTarget[key][f]; if (!newTarget) { newTarget = metaTarget[key][f] = {}; } metaTarget = newTarget; } } metaTarget = metaTarget[name] = {}; if (isArray(propertyValue.value)) { metaTarget["a"] = { t: encodedTypeValue }; } else { metaTarget["t"] = encodedTypeValue; } } } } var RandomizationLowerThreshold = 0.8; var RandomizationUpperThreshold = 1.2; var BaseBackoff = 3000; var MaxBackoff = 600000; function retryPolicyShouldRetryForStatus(httpStatusCode) { return !((httpStatusCode >= 300 && httpStatusCode < 500 && httpStatusCode != 408 && httpStatusCode != 429) || (httpStatusCode == 501) || (httpStatusCode == 505)); } function retryPolicyGetMillisToBackoffForRetry(retriesSoFar) { var waitDuration = 0; var minBackoff = BaseBackoff * RandomizationLowerThreshold; var maxBackoff = BaseBackoff * RandomizationUpperThreshold; var randomBackoff = Math.floor(Math.random() * (maxBackoff - minBackoff)) + minBackoff; waitDuration = Math.pow(2, retriesSoFar) * randomBackoff; return Math.min(waitDuration, MaxBackoff); } var SecToMsMultiplier = 1000; var KillSwitch = /** @class */ (function () { function KillSwitch() { var _killedTokenDictionary = {}; function _normalizeTenants(values) { var result = []; if (values) { arrForEach(values, function (value) { result.push(strTrim(value)); }); } return result; } dynamicProto(KillSwitch, this, function (_self) { _self.setKillSwitchTenants = function (killTokens, killDuration) { if (killTokens && killDuration) { try { var killedTokens = _normalizeTenants(killTokens.split(",")); if (killDuration === "this-request-only") { return killedTokens; } var durationMs = parseInt(killDuration, 10) * SecToMsMultiplier; for (var i = 0; i < killedTokens.length; ++i) { _killedTokenDictionary[killedTokens[i]] = dateNow() + durationMs; } } catch (ex) { return []; } } return []; }; _self.isTenantKilled = function (tenantToken) { var killDictionary = _killedTokenDictionary; var name = strTrim(tenantToken); if (killDictionary[name] !== undefined && killDictionary[name] > dateNow()) { return true; } delete killDictionary[name]; return false; }; }); } return KillSwitch; }()); var EVTKillSwitch = KillSwitch; var ClockSkewManager = /** @class */ (function () { function ClockSkewManager() { var _allowRequestSending = true; var _shouldAddClockSkewHeaders = true; var _isFirstRequest = true; var _clockSkewHeaderValue = "use-collector-delta"; var _clockSkewSet = false; dynamicProto(ClockSkewManager, this, function (_self) { _self.allowRequestSending = function () { return _allowRequestSending; }; _self.firstRequestSent = function () { if (_isFirstRequest) { _isFirstRequest = false; if (!_clockSkewSet) { _allowRequestSending = false; } } }; _self.shouldAddClockSkewHeaders = function () { return _shouldAddClockSkewHeaders; }; _self.getClockSkewHeaderValue = function () { return _clockSkewHeaderValue; }; _self.setClockSkew = function (timeDeltaInMillis) { if (!_clockSkewSet) { if (timeDeltaInMillis) { _clockSkewHeaderValue = timeDeltaInMillis; _shouldAddClockSkewHeaders = true; _clockSkewSet = true; } else { _shouldAddClockSkewHeaders = false; } _allowRequestSending = true; } }; }); } return ClockSkewManager; }()); var EVTClockSkewManager = ClockSkewManager; var _a; var strSendAttempt = "sendAttempt"; var _noResponseQs = "&" + strNoResponseBody + "=true"; var _eventActionMap = (_a = {}, _a[1 ] = strRequeue, _a[100 ] = strRequeue, _a[200 ] = "sent", _a[8004 ] = strDropped, _a[8003 ] = strDropped, _a); var _collectorQsHeaders = {}; var _collectorHeaderToQs = {}; function _addCollectorHeaderQsMapping(qsName, headerName, allowQs) { _collectorQsHeaders[qsName] = headerName; if (allowQs !== false) { _collectorHeaderToQs[headerName] = qsName; } } _addCollectorHeaderQsMapping(strMsaDeviceTicket, strMsaDeviceTicket, false); _addCollectorHeaderQsMapping(strClientVersion, strClientVersion); _addCollectorHeaderQsMapping(strClientId, "Client-Id"); _addCollectorHeaderQsMapping(strApiKey, strApiKey); _addCollectorHeaderQsMapping(strTimeDeltaToApply, strTimeDeltaToApply); _addCollectorHeaderQsMapping(strUploadTime, strUploadTime); _addCollectorHeaderQsMapping(strAuthXToken, strAuthXToken); function _getResponseText(xhr) { try { return xhr.responseText; } catch (e) { } return ""; } function _hasHeader(headers, header) { var hasHeader = false; if (headers && header) { var keys = objKeys(headers); if (keys && keys.length > 0) { var lowerHeader = header.toLowerCase(); for (var lp = 0; lp < keys.length; lp++) { var value = keys[lp]; if (value && hasOwnProperty(header, value) && value.toLowerCase() === lowerHeader) { hasHeader = true; break; } } } } return hasHeader; } function _addRequestDetails(details, name, value, useHeaders) { if (name && value && value.length > 0) { if (useHeaders && _collectorQsHeaders[name]) { details.hdrs[_collectorQsHeaders[name]] = value; details.useHdrs = true; } else { details.url += "&" + name + "=" + value; } } } var HttpManager = /** @class */ (function () { function HttpManager(maxEventsPerBatch, maxConnections, maxRequestRetriesBeforeBackoff, actions, timeoutOverride) { this._responseHandlers = []; var _urlString = "?cors=true&" + strContentTypeHeader.toLowerCase() + "=" + defaultContentType; var _killSwitch = new EVTKillSwitch(); var _paused = false; var _clockSkewManager = new EVTClockSkewManager(); var _useBeacons = false; var _outstandingRequests = 0; var _postManager; var _sendInterfaces; var _core; var _customHttpInterface = true; var _queryStringParameters = []; var _headers = {}; var _batchQueue = []; var _serializer = null; var _enableEventTimings = false; var _cookieMgr; var _isUnloading = false; var _useHeaders = false; var _xhrTimeout; var _disableXhrSync; dynamicProto(HttpManager, this, function (_self) { var _sendCredentials = true; _self.initialize = function (endpointUrl, core, postChannel, httpInterface, channelConfig) { var _a; if (!channelConfig) { channelConfig = {}; } _urlString = endpointUrl + _urlString; _useHeaders = !isUndefined(channelConfig.avoidOptions) ? !channelConfig.avoidOptions : true; _core = core; _cookieMgr = core.getCookieMgr(); _enableEventTimings = !_core.config.disableEventTimings; var enableCompoundKey = !!_core.config.enableCompoundKey; _postManager = postChannel; var valueSanitizer = channelConfig.valueSanitizer; var stringifyObjects = channelConfig.stringifyObjects; if (!isUndefined(channelConfig.enableCompoundKey)) { enableCompoundKey = !!channelConfig.enableCompoundKey; } _xhrTimeout = channelConfig.xhrTimeout; _disableXhrSync = channelConfig.disableXhrSync; _useBeacons = !isReactNative(); _serializer = new Serializer(_core, valueSanitizer, stringifyObjects, enableCompoundKey); var syncHttpInterface = httpInterface; var beaconHttpInterface = channelConfig.alwaysUseXhrOverride ? httpInterface : null; var fetchSyncHttpInterface = channelConfig.alwaysUseXhrOverride ? httpInterface : null; if (!httpInterface) { _customHttpInterface = false; var location_1 = getLocation(); if (location_1 && location_1.protocol && location_1.protocol.toLowerCase() === "file:") { _sendCredentials = false; } var theTransports = []; if (isReactNative()) { theTransports = [2 , 1 ]; } else { theTransports = [1 , 2 , 3 ]; } var configTransports = channelConfig.transports; if (configTransports) { if (isNumber(configTransports)) { theTransports = [configTransports].concat(theTransports); } else if (isArray(configTransports)) { theTransports = configTransports.concat(theTransports); } } httpInterface = _getSenderInterface(theTransports, false); syncHttpInterface = _getSenderInterface(theTransports, true); if (!httpInterface) { _postManager.diagLog().warnToConsole("No available transport to send events"); } } _sendInterfaces = (_a = {}, _a[0 ] = httpInterface, _a[1 ] = syncHttpInterface || _getSenderInterface([1 , 2 , 3 ], true), _a[2 ] = beaconHttpInterface || _getSenderInterface([3 , 2 ], true) || syncHttpInterface || _getSenderInterface([1 ], true), _a[3 ] = fetchSyncHttpInterface || _getSenderInterface([2 , 3 ], true) || syncHttpInterface || _getSenderInterface([1 ], true), _a); }; function _getSenderInterface(transports, syncSupport) { var transportType = 0 ; var sendPostFunc = null; var lp = 0; while (sendPostFunc == null && lp < transports.length) { transportType = transports[lp]; if (transportType === 1 ) { if (useXDomainRequest()) { sendPostFunc = _xdrSendPost; } else if (isXhrSupported()) { sendPostFunc = _xhrSendPost; } } else if (transportType === 2 && isFetchSupported(syncSupport)) { sendPostFunc = _fetchSendPost; } else if (_useBeacons && transportType === 3 && isBeaconsSupported()) { sendPostFunc = _beaconSendPost; } lp++; } if (sendPostFunc) { return { _transport: transportType, _isSync: syncSupport, sendPOST: sendPostFunc }; } return null; } _self["_getDbgPlgTargets"] = function () { return [_sendInterfaces[0 ], _killSwitch, _serializer, _sendInterfaces]; }; function _xdrSendPost(payload, oncomplete, sync) { var xdr = new XDomainRequest(); xdr.open(Method, payload.urlString); if (payload.timeout) { xdr.timeout = payload.timeout; } xdr.onload = function () { var response = _getResponseText(xdr); _doOnComplete(oncomplete, 200, {}, response); _handleCollectorResponse(response); }; xdr.onerror = function () { _doOnComplete(oncomplete, 400, {}); }; xdr.ontimeout = function () { _doOnComplete(oncomplete, 500, {}); }; xdr.onprogress = function () { }; if (sync) { xdr.send(payload.data); } else { timeoutOverride.set(function () { xdr.send(payload.data); }, 0); } } function _fetchSendPost(payload, oncomplete, sync) { var _a; var theUrl = payload.urlString; var ignoreResponse = false; var responseHandled = false; var requestInit = (_a = { body: payload.data, method: Method }, _a[DisabledPropertyName] = true, _a); if (sync) { requestInit.keepalive = true; if (payload._sendReason === 2 ) { ignoreResponse = true; theUrl += _noResponseQs; } } if (_sendCredentials) { requestInit.credentials = "include"; } if (payload.headers && objKeys(payload.headers).length > 0) { requestInit.headers = payload.headers; } fetch(theUrl, requestInit).then(function (response) { var headerMap = {}; var responseText = ""; if (response.headers) { response.headers.forEach(function (value, name) { headerMap[name] = value; }); } if (response.body) { response.text().then(function (text) { responseText = text; }); } if (!responseHandled) { responseHandled = true; _doOnComplete(oncomplete, response.status, headerMap, responseText); _handleCollectorResponse(responseText); } })["catch"](function (error) { if (!responseHandled) { responseHandled = true; _doOnComplete(oncomplete, 0, {}); } }); if (ignoreResponse && !responseHandled) { responseHandled = true; _doOnComplete(oncomplete, 200, {}); } if (!responseHandled && payload.timeout > 0) { timeoutOverride.set(function () { if (!responseHandled) { responseHandled = true; _doOnComplete(oncomplete, 500, {}); } }, payload.timeout); } } function _xhrSendPost(payload, oncomplete, sync) { var theUrl = payload.urlString; function _appendHeader(theHeaders, xhr, name) { if (!theHeaders[name] && xhr && xhr.getResponseHeader) { var value = xhr.getResponseHeader(name); if (value) { theHeaders[name] = strTrim(value); } } return theHeaders; } function _getAllResponseHeaders(xhr) { var theHeaders = {}; if (!xhr.getAllResponseHeaders) { theHeaders = _appendHeader(theHeaders, xhr, strTimeDeltaHeader); theHeaders = _appendHeader(theHeaders, xhr, strKillDurationHeader); theHeaders = _appendHeader(theHeaders, xhr, strKillDurationSecondsHeader); } else { theHeaders = _convertAllHeadersToMap(xhr.getAllResponseHeaders()); } return theHeaders; } function xhrComplete(xhr, responseTxt) { _doOnComplete(oncomplete, xhr.status, _getAllResponseHeaders(xhr), responseTxt); } if (sync && payload.disableXhrSync) { sync = false; } var xhrRequest = openXhr(Method, theUrl, _sendCredentials, true, sync, payload.timeout); objForEachKey(payload.headers, function (name, value) { xhrRequest.setRequestHeader(name, value); }); xhrRequest.onload = function () { var response = _getResponseText(xhrRequest); xhrComplete(xhrRequest, response); _handleCollectorResponse(response); }; xhrRequest.onerror = function () { xhrComplete(xhrRequest); }; xhrRequest.ontimeout = function () { xhrComplete(xhrRequest); }; xhrRequest.send(payload.data); } function _doOnComplete(oncomplete, status, headers, response) { try { oncomplete(status, headers, response); } catch (e) { _throwInternal(_postManager.diagLog(), 2 , 518 , dumpObj(e)); } } function _beaconSendPost(payload, oncomplete, sync) { var internalPayloadData = payload; var status = 200; var thePayload = internalPayloadData._thePayload; var theUrl = payload.urlString + _noResponseQs; try { var nav_1 = getNavigator(); if (!nav_1.sendBeacon(theUrl, payload.data)) { if (thePayload) { var droppedBatches_1 = []; arrForEach(thePayload.batches, function (theBatch) { if (droppedBatches_1 && theBatch && theBatch.count() > 0) { var theEvents = theBatch.events(); for (var lp = 0; lp < theEvents.length; lp++) { if (!nav_1.sendBeacon(theUrl, _serializer.getEventBlob(theEvents[lp]))) { droppedBatches_1.push(theBatch.split(lp)); break; } } } else { droppedBatches_1.push(theBatch.split(0)); } }); _sendBatchesNotification(droppedBatches_1, 8003 , thePayload.sendType, true); } else { status = 0; } } } catch (ex) { _postManager.diagLog().warnToConsole("Failed to send telemetry using sendBeacon API. Ex:" + dumpObj(ex)); status = 0; } finally { _doOnComplete(oncomplete, status, {}, ""); } } function _isBeaconPayload(sendType) { return sendType === 2 || sendType === 3 ; } function _adjustSendType(sendType) { if (_isUnloading && _isBeaconPayload(sendType)) { sendType = 2 ; } return sendType; } _self.addQueryStringParameter = function (name, value) { for (var i = 0; i < _queryStringParameters.length; i++) { if (_queryStringParameters[i].name === name) { _queryStringParameters[i].value = value; return; } } _queryStringParameters.push({ name: name, value: value }); }; _self.addHeader = function (name, value) { _headers[name] = value; }; _self.canSendRequest = function () { return _hasIdleConnection() && _clockSkewManager.allowRequestSending(); }; _self.sendQueuedRequests = function (sendType, sendReason) { if (isUndefined(sendType)) { sendType = 0 ; } if (_isUnloading) { sendType = _adjustSendType(sendType); sendReason = 2 ; } if (_canSendPayload(_batchQueue, sendType, 0)) { _sendBatches(_clearQueue(), 0, false, sendType, sendReason || 0 ); } }; _self.isCompletelyIdle = function () { return !_paused && _outstandingRequests === 0 && _batchQueue.length === 0; }; _self.setUnloading = function (value) { _isUnloading = value; }; _self.addBatch = function (theBatch) { if (theBatch && theBatch.count() > 0) { if (_killSwitch.isTenantKilled(theBatch.iKey())) { return false; } _batchQueue.push(theBatch); } return true; }; _self.teardown = function () { if (_batchQueue.length > 0) { _sendBatches(_clearQueue(), 0, true, 2 , 2 ); } }; _self.pause = function () { _paused = true; }; _self.resume = function () { _paused = false; _self.sendQueuedRequests(0 , 4 ); }; _self.sendSynchronousBatch = function (batch, sendType, sendReason) { if (batch && batch.count() > 0) { if (isNullOrUndefined(sendType)) { sendType = 1 ; } if (_isUnloading) { sendType = _adjustSendType(sendType); sendReason = 2 ; } _sendBatches([batch], 0, false, sendType, sendReason || 0 ); } }; function _hasIdleConnection() { return !_paused && _outstandingRequests < maxConnections; } function _clearQueue() { var theQueue = _batchQueue; _batchQueue = []; return theQueue; } function _canSendPayload(theBatches, sendType, retryCnt) { var result = false; if (theBatches && theBatches.length > 0 && !_paused && _sendInterfaces[sendType] && _serializer) { result = (sendType !== 0 ) || (_hasIdleConnection() && (retryCnt > 0 || _clockSkewManager.allowRequestSending())); } return result; } function _createDebugBatches(theBatches) { var values = {}; if (theBatches) { arrForEach(theBatches, function (theBatch, idx) { values[idx] = { iKey: theBatch.iKey(), evts: theBatch.events() }; }); } return values; } function _sendBatches(theBatches, retryCount, isTeardown, sendType, sendReason) { if (!theBatches || theBatches.length === 0) { return; } if (_paused) { _sendBatchesNotification(theBatches, 1 , sendType); return; } sendType = _adjustSendType(sendType); try { var orgBatches_1 = theBatches; var isSynchronous_1 = sendType !== 0 ; doPerf(_core, function () { return "HttpManager:_sendBatches"; }, function (perfEvt) { if (perfEvt) { theBatches = theBatches.slice(0); } var droppedBatches = []; var thePayload = null; var serializationStart = getTime(); var sendInterface = _sendInterfaces[sendType] || (isSynchronous_1 ? _sendInterfaces[1 ] : _sendInterfaces[0 ]); var isBeaconTransport = (_isUnloading || _isBeaconPayload(sendType) || (sendInterface && sendInterface._transport === 3 )) && _canUseSendBeaconApi(); while (_canSendPayload(theBatches, sendType, retryCount)) { var theBatch = theBatches.shift(); if (theBatch && theBatch.count() > 0) { if (!_killSwitch.isTenantKilled(theBatch.iKey())) { thePayload = thePayload || _serializer.createPayload(retryCount, isTeardown, isSynchronous_1, isBeaconTransport, sendReason, sendType); if (!_serializer.appendPayload(thePayload, theBatch, maxEventsPerBatch)) { _doPayloadSend(thePayload, serializationStart, getTime(), sendReason); serializationStart = getTime(); theBatches = [theBatch].concat(theBatches); thePayload = null; } else if (thePayload.overflow !== null) { theBatches = [thePayload.overflow].concat(theBatches); thePayload.overflow = null; _doPayloadSend(thePayload, serializationStart, getTime(), sendReason); serializationStart = getTime(); thePayload = null; } } else { droppedBatches.push(theBatch); } } } if (thePayload) { _doPayloadSend(thePayload, serializationStart, getTime(), sendReason); } if (theBatches.length > 0) { _batchQueue = theBatches.concat(_batchQueue); } _sendBatchesNotification(droppedBatches, 8004 , sendType); }, function () { return ({ batches: _createDebugBatches(orgBatches_1), retryCount: retryCount, isTeardown: isTeardown, isSynchronous: isSynchronous_1, sendReason: sendReason, useSendBeacon: _isBeaconPayload(sendType), sendType: sendType }); }, !isSynchronous_1); } catch (ex) { _throwInternal(_postManager.diagLog(), 2 , 48 , "Unexpected Exception sending batch: " + dumpObj(ex)); } } function _buildRequestDetails(thePayload, useHeaders) { var requestDetails = { url: _urlString, hdrs: {}, useHdrs: false }; if (!useHeaders) { objForEachKey(_headers, function (name, value) { if (_collectorHeaderToQs[name]) { _addRequestDetails(requestDetails, _collectorHeaderToQs[name], value, false); } else { requestDetails.hdrs[name] = value; requestDetails.useHdrs = true; } }); } else { requestDetails.hdrs = extend(requestDetails.hdrs, _headers); requestDetails.useHdrs = (objKeys(requestDetails.hdrs).length > 0); } _addRequestDetails(requestDetails, strClientId, "NO_AUTH", useHeaders); _addRequestDetails(requestDetails, strClientVersion, FullVersionString, useHeaders); var apiQsKeys = ""; arrForEach(thePayload.apiKeys, function (apiKey) { if (apiQsKeys.length > 0) { apiQsKeys += ","; } apiQsKeys += apiKey; }); _addRequestDetails(requestDetails, strApiKey, apiQsKeys, useHeaders); _addRequestDetails(requestDetails, strUploadTime, dateNow().toString(), useHeaders); var msfpc = _getMsfpc(thePayload); if (isValueAssigned(msfpc)) { requestDetails.url += "&ext.intweb.msfpc=" + msfpc; } if (_clockSkewManager.shouldAddClockSkewHeaders()) { _addRequestDetails(requestDetails, strTimeDeltaToApply, _clockSkewManager.getClockSkewHeaderValue(), useHeaders); } if (_core.getWParam) { var wParam = _core.getWParam(); if (wParam >= 0) { requestDetails.url += "&w=" + wParam; } } for (var i = 0; i < _queryStringParameters.length; i++) { requestDetails.url += "&" + _queryStringParameters[i].name + "=" + _queryStringParameters[i].value; } return requestDetails; } function _canUseSendBeaconApi() { return !_customHttpInterface && _useBeacons && isBeaconsSupported(); } function _setTimingValue(timings, name, value) { timings[name] = timings[name] || {}; timings[name][_postManager.identifier] = value; } function _doPayloadSend(thePayload, serializationStart, serializationCompleted, sendReason) { if (thePayload && thePayload.payloadBlob && thePayload.payloadBlob.length > 0) { var useSendHook_1 = !!_self.sendHook; var sendInterface_1 = _sendInterfaces[thePayload.sendType]; if (!_isBeaconPayload(thePayload.sendType) && thePayload.isBeacon && thePayload.sendReason === 2 ) { sendInterface_1 = _sendInterfaces[2 ] || _sendInterfaces[3 ] || sendInterface_1; } var useHeaders_1 = _useHeaders; if (thePayload.isBeacon || sendInterface_1._transport === 3 ) { useHeaders_1 = false; } var requestDetails_1 = _buildRequestDetails(thePayload, useHeaders_1); useHeaders_1 = useHeaders_1 || requestDetails_1.useHdrs; var sendEventStart_1 = getTime(); doPerf(_core, function () { return "HttpManager:_doPayloadSend"; }, function () { for (var batchLp = 0; batchLp < thePayload.batches.length; batchLp++) { var theBatch = thePayload.batches[batchLp]; var theEvents = theBatch.events(); for (var evtLp = 0; evtLp < theEvents.length; evtLp++) { var telemetryItem = theEvents[evtLp]; if (_enableEventTimings) { var timings = telemetryItem.timings = telemetryItem.timings || {}; _setTimingValue(timings, "sendEventStart", sendEventStart_1); _setTimingValue(timings, "serializationStart", serializationStart); _setTimingValue(timings, "serializationCompleted", serializationCompleted); } telemetryItem[strSendAttempt] > 0 ? telemetryItem[strSendAttempt]++ : telemetryItem[strSendAttempt] = 1; } } _sendBatchesNotification(thePayload.batches, (1000 + (sendReason || 0 )), thePayload.sendType, true); var orgPayloadData = { data: thePayload.payloadBlob, urlString: requestDetails_1.url, headers: requestDetails_1.hdrs, _thePayload: thePayload, _sendReason: sendReason, timeout: _xhrTimeout }; if (!isUndefined(_disableXhrSync)) { orgPayloadData.disableXhrSync = !!_disableXhrSync; } if (useHeaders_1) { if (!_hasHeader(orgPayloadData.headers, strCacheControl)) { orgPayloadData.headers[strCacheControl] = defaultCacheControl; } if (!_hasHeader(orgPayloadData.headers, strContentTypeHeader)) { orgPayloadData.headers[strContentTypeHeader] = defaultContentType; } } var sender = null; if (sendInterface_1) { sender = function (payload) { _clockSkewManager.firstRequestSent(); var onComplete = function (status, headers) { _retryRequestIfNeeded(status, headers, thePayload, sendReason); }; var isSync = thePayload.isTeardown || thePayload.isSync; try { sendInterface_1.sendPOST(payload, onComplete, isSync); if (_self.sendListener) { _self.sendListener(orgPayloadData, payload, isSync, thePayload.isBeacon); } } catch (ex) { _postManager.diagLog().warnToConsole("Unexpected exception sending payload. Ex:" + dumpObj(ex)); _doOnComplete(onComplete, 0, {}); } }; } doPerf(_core, function () { return "HttpManager:_doPayloadSend.sender"; }, function () { if (sender) { if (thePayload.sendType === 0 ) { _outstandingRequests++; } if (useSendHook_1 && !thePayload.isBeacon && sendInterface_1._transport !== 3 ) { var hookData_1 = { data: orgPayloadData.data, urlString: orgPayloadData.urlString, headers: extend({}, orgPayloadData.headers), timeout: orgPayloadData.timeout, disableXhrSync: orgPayloadData.disableXhrSync }; var senderCalled_1 = false; doPerf(_core, function () { return "HttpManager:_doPayloadSend.sendHook"; }, function () { try { _self.sendHook(hookData_1, function (payload) { senderCalled_1 = true; if (!_customHttpInterface && !payload._thePayload) { payload._thePayload = payload._thePayload || orgPayloadData._thePayload; payload._sendReason = payload._sendReason || orgPayloadData._sendReason; } sender(payload); }, thePayload.isSync || thePayload.isTeardown); } catch (ex) { if (!senderCalled_1) { sender(orgPayloadData); } } }); } else { sender(orgPayloadData); } } }); }, function () { return ({ thePayload: thePayload, serializationStart: serializationStart, serializationCompleted: serializationCompleted, sendReason: sendReason }); }, thePayload.isSync); } if (thePayload.sizeExceed && thePayload.sizeExceed.length > 0) { _sendBatchesNotification(thePayload.sizeExceed, 8003 , thePayload.sendType); } if (thePayload.failedEvts && thePayload.failedEvts.length > 0) { _sendBatchesNotification(thePayload.failedEvts, 8002 , thePayload.sendType); } } function _addEventCompletedTimings(theEvents, sendEventCompleted) { if (_enableEventTimings) { arrForEach(theEvents, function (theEvent) { var timings = theEvent.timings = theEvent.timings || {}; _setTimingValue(timings, "sendEventCompleted", sendEventCompleted); }); } } function _retryRequestIfNeeded(status, headers, thePayload, sendReason) { var reason = 9000 ; var droppedBatches = null; var isRetrying = false; var backOffTrans = false; try { var shouldRetry = true; if (typeof status !== strShimUndefined) { if (headers) { _clockSkewManager.setClockSkew(headers[strTimeDeltaHeader]); var killDuration = headers[strKillDurationHeader] || headers["kill-duration-seconds"]; arrForEach(_killSwitch.setKillSwitchTenants(headers[strKillTokensHeader], killDuration), function (killToken) { arrForEach(thePayload.batches, function (theBatch) { if (theBatch.iKey() === killToken) { droppedBatches = droppedBatches || []; var removedEvents = theBatch.split(0); thePayload.numEvents -= removedEvents.count(); droppedBatches.push(removedEvents); } }); }); } if (status == 200 || status == 204) { reason = 200 ; return; } if (!retryPolicyShouldRetryForStatus(status) || thePayload.numEvents <= 0) { shouldRetry = false; } reason = 9000 + (status % 1000); } if (shouldRetry) { reason = 100 ; var retryCount_1 = thePayload.retryCnt; if (thePayload.sendType === 0 ) { if (retryCount_1 < maxRequestRetriesBeforeBackoff) { isRetrying = true; _doAction(function () { if (thePayload.sendType === 0 ) { _outstandingRequests--; } _sendBatches(thePayload.batches, retryCount_1 + 1, thePayload.isTeardown, _isUnloading ? 2 : thePayload.sendType, 5 ); }, _isUnloading, retryPolicyGetMillisToBackoffForRetry(retryCount_1)); } else { backOffTrans = true; if (_isUnloading) { reason = 8001 ; } } } } } finally { if (!isRetrying) { _clockSkewManager.setClockSkew(); _handleRequestFinished(thePayload, reason, sendReason, backOffTrans); } _sendBatchesNotification(droppedBatches, 8004 , thePayload.sendType); } } function _handleRequestFinished(thePayload, batchReason, sendReason, backOffTrans) { try { if (backOffTrans) { _postManager._backOffTransmission(); } if (batchReason === 200 ) { if (!backOffTrans && !thePayload.isSync) { _postManager._clearBackOff(); } _addCompleteTimings(thePayload.batches); } _sendBatchesNotification(thePayload.batches, batchReason, thePayload.sendType, true); } finally { if (thePayload.sendType === 0 ) { _outstandingRequests--; if (sendReason !== 5 ) { _self.sendQueuedRequests(thePayload.sendType, sendReason); } } } } function _addCompleteTimings(theBatches) { if (_enableEventTimings) { var sendEventCompleted_1 = getTime(); arrForEach(theBatches, function (theBatch) { if (theBatch && theBatch.count() > 0) { _addEventCompletedTimings(theBatch.events(), sendEventCompleted_1); } }); } } function _doAction(cb, isSync, interval) { if (isSync) { cb(); } else { timeoutOverride.set(cb, interval); } } function _convertAllHeadersToMap(headersString) { var headers = {}; if (isString(headersString)) { var headersArray = strTrim(headersString).split(/[\r\n]+/); arrForEach(headersArray, function (headerEntry) { if (headerEntry) { var idx = headerEntry.indexOf(": "); if (idx !== -1) { var header = strTrim(headerEntry.substring(0, idx)).toLowerCase(); var value = strTrim(headerEntry.substring(idx + 1)); headers[header] = value; } else { headers[strTrim(headerEntry)] = 1; } } }); } return headers; } function _getMsfpc(thePayload) { for (var lp = 0; lp < thePayload.batches.length; lp++) { var msfpc = thePayload.batches[lp].Msfpc(); if (msfpc) { return encodeURIComponent(msfpc); } } return ""; } function _handleCollectorResponse(responseText) { var responseHandlers = _self._responseHandlers; try { for (var i = 0; i < responseHandlers.length; i++) { try { responseHandlers[i](responseText); } catch (e) { _throwInternal(_postManager.diagLog(), 1 , 519 , "Response handler failed: " + e); } } if (responseText) { var response = JSON.parse(responseText); if (isValueAssigned(response.webResult) && isValueAssigned(response.webResult[strMsfpc])) { _cookieMgr.set("MSFPC", response.webResult[strMsfpc], 365 * 86400); } } } catch (ex) { } } function _sendBatchesNotification(theBatches, batchReason, sendType, sendSync) { if (theBatches && theBatches.length > 0 && actions) { var theAction_1 = actions[_getNotificationAction(batchReason)]; if (theAction_1) { var isSyncRequest_1 = sendType !== 0 ; doPerf(_core, function () { return "HttpManager:_sendBatchesNotification"; }, function () { _doAction(function () { try { theAction_1.call(actions, theBatches, batchReason, isSyncRequest_1, sendType); } catch (e) { _throwInternal(_postManager.diagLog(), 1 , 74 , "send request notification failed: " + e); } }, sendSync || isSyncRequest_1, 0); }, function () { return ({ batches: _createDebugBatches(theBatches), reason: batchReason, isSync: isSyncRequest_1, sendSync: sendSync, sendType: sendType }); }, !isSyncRequest_1); } } } function _getNotificationAction(reason) { var action = _eventActionMap[reason]; if (!isValueAssigned(action)) { action = strOther; if (reason >= 9000 && reason <= 9999 ) { action = strResponseFail; } else if (reason >= 8000 && reason <= 8999 ) { action = strDropped; } else if (reason >= 1000 && reason <= 1999 ) { action = strSending; } } return action; } }); } return HttpManager; }()); function defaultSetTimeout(callback, ms) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } return setTimeout(callback, ms, args); } function defaultClearTimeout(timeoutId) { clearTimeout(timeoutId); } function createTimeoutWrapper(argSetTimeout, argClearTimeout) { return { set: argSetTimeout || defaultSetTimeout, clear: argClearTimeout || defaultClearTimeout }; } var FlushCheckTimer = 0.250; var MaxNumberEventPerBatch = 500; var EventsDroppedAtOneTime = 20; var MaxSendAttempts = 6; var MaxSyncUnloadSendAttempts = 2; var MaxBackoffCount = 4; var MaxConnections = 2; var MaxRequestRetriesBeforeBackoff = 1; var strEventsDiscarded = "eventsDiscarded"; var strOverrideInstrumentationKey = "overrideInstrumentationKey"; var strMaxEventRetryAttempts = "maxEventRetryAttempts"; var strMaxUnloadEventRetryAttempts = "maxUnloadEventRetryAttempts"; var strAddUnloadCb = "addUnloadCb"; var PostChannel = /** @class */ (function (_super) { __extendsFn(PostChannel, _super); function PostChannel() { var _this = _super.call(this) || this; _this.identifier = "PostChannel"; _this.priority = 1011; _this.version = '3.2.2'; var _config; var _isTeardownCalled = false; var _flushCallbackQueue = []; var _flushCallbackTimerId = null; var _paused = false; var _immediateQueueSize = 0; var _immediateQueueSizeLimit = 500; var _queueSize = 0; var _queueSizeLimit = 10000; var _profiles = {}; var _currentProfile = RT_PROFILE; var _scheduledTimerId = null; var _immediateTimerId = null; var _currentBackoffCount = 0; var _timerCount = 0; var _xhrOverride; var _httpManager; var _batchQueues = {}; var _autoFlushEventsLimit; var _autoFlushBatchLimit; var _delayedBatchSendLatency = -1; var _delayedBatchReason; var _optimizeObject = true; var _isPageUnloadTriggered = false; var _disableXhrSync = false; var _maxEventSendAttempts = MaxSendAttempts; var _maxUnloadEventSendAttempts = MaxSyncUnloadSendAttempts; var _evtNamespace; var _timeoutWrapper; dynamicProto(PostChannel, _this, function (_self, _base) { _initDefaults(); _self["_getDbgPlgTargets"] = function () { return [_httpManager]; }; _self.initialize = function (coreConfig, core, extensions) { doPerf(core, function () { return "PostChannel:initialize"; }, function () { var extendedCore = core; _base.initialize(coreConfig, core, extensions); try { var hasAddUnloadCb = !!core[strAddUnloadCb]; _evtNamespace = mergeEvtNamespace(createUniqueNamespace(_self.identifier), core.evtNamespace && core.evtNamespace()); var ctx = _self._getTelCtx(); coreConfig.extensionConfig[_self.identifier] = coreConfig.extensionConfig[_self.identifier] || {}; _config = ctx.getExtCfg(_self.identifier); _timeoutWrapper = createTimeoutWrapper(_config.setTimeoutOverride, _config.clearTimeoutOverride); _optimizeObject = !_config.disableOptimizeObj && isChromium(); _hookWParam(extendedCore); if (_config.eventsLimitInMem > 0) { _queueSizeLimit = _config.eventsLimitInMem; } if (_config.immediateEventLimit > 0) { _immediateQueueSizeLimit = _config.immediateEventLimit; } if (_config.autoFlushEventsLimit > 0) { _autoFlushEventsLimit = _config.autoFlushEventsLimit; } _disableXhrSync = _config.disableXhrSync; if (isNumber(_config[strMaxEventRetryAttempts])) { _maxEventSendAttempts = _config[strMaxEventRetryAttempts]; } if (isNumber(_config[strMaxUnloadEventRetryAttempts])) { _maxUnloadEventSendAttempts = _config[strMaxUnloadEventRetryAttempts]; } _setAutoLimits(); if (_config.httpXHROverride && _config.httpXHROverride.sendPOST) { _xhrOverride = _config.httpXHROverride; } if (isValueAssigned(coreConfig.anonCookieName)) { _httpManager.addQueryStringParameter("anoncknm", coreConfig.anonCookieName); } _httpManager.sendHook = _config.payloadPreprocessor; _httpManager.sendListener = _config.payloadListener; var endpointUrl = _config.overrideEndpointUrl ? _config.overrideEndpointUrl : coreConfig.endpointUrl; _self._notificationManager = coreConfig.extensionConfig.NotificationManager; _httpManager.initialize(endpointUrl, _self.core, _self, _xhrOverride, _config); var excludePageUnloadEvents = coreConfig.disablePageUnloadEvents || []; addPageUnloadEventListener(_handleUnloadEvents, excludePageUnloadEvents, _evtNamespace); addPageHideEventListener(_handleUnloadEvents, excludePageUnloadEvents, _evtNamespace); addPageShowEventListener(_handleShowEvents, coreConfig.disablePageShowEvents, _evtNamespace); } catch (e) { _self.setInitialized(false); throw e; } }, function () { return ({ coreConfig: coreConfig, core: core, extensions: extensions }); }); }; _self.processTelemetry = function (ev, itemCtx) { setProcessTelemetryTimings(ev, _self.identifier); itemCtx = _self._getTelCtx(itemCtx); var channelConfig = itemCtx.getExtCfg(_self.identifier); var disableTelemetry = !!_config.disableTelemetry; if (channelConfig) { disableTelemetry = disableTelemetry || !!channelConfig.disableTelemetry; } var event = ev; if (!disableTelemetry && !_isTeardownCalled) { if (_config[strOverrideInstrumentationKey]) { event.iKey = _config[strOverrideInstrumentationKey]; } if (channelConfig && channelConfig[strOverrideInstrumentationKey]) { event.iKey = channelConfig[strOverrideInstrumentationKey]; } _addEventToQueues(event, true); if (_isPageUnloadTriggered) { _releaseAllQueues(2 , 2 ); } else { _scheduleTimer(); } } _self.processNext(event, itemCtx); }; _self._doTeardown = function (unloadCtx, unloadState) { _releaseAllQueues(2 , 2 ); _isTeardownCalled = true; _httpManager.teardown(); removePageUnloadEventListener(null, _evtNamespace); removePageHideEventListener(null, _evtNamespace); removePageShowEventListener(null, _evtNamespace); _initDefaults(); }; function _hookWParam(extendedCore) { var existingGetWParamMethod = extendedCore.getWParam; extendedCore.getWParam = function () { var wparam = 0; if (_config.ignoreMc1Ms0CookieProcessing) { wparam = wparam | 2; } return wparam | existingGetWParamMethod(); }; } function _handleUnloadEvents(evt) { var theEvt = evt || getWindow().event; if (theEvt.type !== "beforeunload") { _isPageUnloadTriggered = true; _httpManager.setUnloading(_isPageUnloadTriggered); } _releaseAllQueues(2 , 2 ); } function _handleShowEvents(evt) { _isPageUnloadTriggered = false; _httpManager.setUnloading(_isPageUnloadTriggered); } function _addEventToQueues(event, append) { if (!event.sendAttempt) { event.sendAttempt = 0; } if (!event.latency) { event.latency = 1 ; } if (event.ext && event.ext["trace"]) { delete (event.ext["trace"]); } if (event.ext && event.ext["user"] && event.ext["user"]["id"]) { delete (event.ext["user"]["id"]); } if (_optimizeObject) { event.ext = optimizeObject(event.ext); if (event.baseData) { event.baseData = optimizeObject(event.baseData); } if (event.data) { event.data = optimizeObject(event.data); } } if (event.sync) { if (_currentBackoffCount || _paused) { event.latency = 3 ; event.sync = false; } else { if (_httpManager) { if (_optimizeObject) { event = optimizeObject(event); } _httpManager.sendSynchronousBatch(EventBatch.create(event.iKey, [event]), event.sync === true ? 1 : event.sync, 3 ); return; } } } var evtLatency = event.latency; var queueSize = _queueSize; var queueLimit = _queueSizeLimit; if (evtLatency === 4 ) { queueSize = _immediateQueueSize; queueLimit = _immediateQueueSizeLimit; } var eventDropped = false; if (queueSize < queueLimit) { eventDropped = !_addEventToProperQueue(event, append); } else { var dropLatency = 1 ; var dropNumber = EventsDroppedAtOneTime; if (evtLatency === 4 ) { dropLatency = 4 ; dropNumber = 1; } eventDropped = true; if (_dropEventWithLatencyOrLess(event.iKey, event.latency, dropLatency, dropNumber)) { eventDropped = !_addEventToProperQueue(event, append); } } if (eventDropped) { _notifyEvents(strEventsDiscarded, [event], EventsDiscardedReason.QueueFull); } } _self.setEventQueueLimits = function (eventLimit, autoFlushLimit) { _queueSizeLimit = eventLimit > 0 ? eventLimit : 10000; _autoFlushEventsLimit = autoFlushLimit > 0 ? autoFlushLimit : 0; _setAutoLimits(); var doFlush = _queueSize > eventLimit; if (!doFlush && _autoFlushBatchLimit > 0) { for (var latency = 1 ; !doFlush && latency <= 3 ; latency++) { var batchQueue = _batchQueues[latency]; if (batchQueue && batchQueue.batches) { arrForEach(batchQueue.batches, function (theBatch) { if (theBatch && theBatch.count() >= _autoFlushBatchLimit) { doFlush = true; } }); } } } _performAutoFlush(true, doFlush); }; _self.pause = function () { _clearScheduledTimer(); _paused = true; _httpManager.pause(); }; _self.resume = function () { _paused = false; _httpManager.resume(); _scheduleTimer(); }; _self.addResponseHandler = function (responseHandler) { _httpManager._responseHandlers.push(responseHandler); }; _self._loadTransmitProfiles = function (profiles) { _resetTransmitProfiles(); objForEachKey(profiles, function (profileName, profileValue) { var profLen = profileValue.length; if (profLen >= 2) { var directValue = (profLen > 2 ? profileValue[2] : 0); profileValue.splice(0, profLen - 2); if (profileValue[1] < 0) { profileValue[0] = -1; } if (profileValue[1] > 0 && profileValue[0] > 0) { var timerMultiplier = profileValue[0] / profileValue[1]; profileValue[0] = Math.ceil(timerMultiplier) * profileValue[1]; } if (directValue >= 0 && profileValue[1] >= 0 && directValue > profileValue[1]) { directValue = profileValue[1]; } profileValue.push(directValue); _profiles[profileName] = profileValue; } }); }; _self.flush = function (async, callback, sendReason) { if (async === void 0) { async = true; } if (!_paused) { _clearScheduledTimer(); sendReason = sendReason || 1 ; if (async) { _queueBatches(1 , 0 , sendReason); _resetQueueCounts(); if (_flushCallbackTimerId == null) { _flushCallbackTimerId = _createTimer(function () { _flushImpl(callback, sendReason); }, 0); } else { _flushCallbackQueue.push(callback); } } else { _sendEventsForLatencyAndAbove(1 , 1 , sendReason); if (callback !== null && callback !== undefined) { callback(); } } } }; _self.setMsaAuthTicket = function (ticket) { _httpManager.addHeader(strMsaDeviceTicket, ticket); }; _self.hasEvents = _hasEvents; _self._setTransmitProfile = function (profileName) { if (_currentProfile !== profileName && _profiles[profileName] !== undefined) { _clearScheduledTimer(); _currentProfile = profileName; _scheduleTimer(); } }; function _sendEventsForLatencyAndAbove(latency, sendType, sendReason) { var queued = _queueBatches(latency, sendType, sendReason); _httpManager.sendQueuedRequests(sendType, sendReason); return queued; } function _hasEvents() { return _queueSize > 0; } function _scheduleTimer() { if (_delayedBatchSendLatency >= 0 && _queueBatches(_delayedBatchSendLatency, 0 , _delayedBatchReason)) { _httpManager.sendQueuedRequests(0 , _delayedBatchReason); } if (_immediateQueueSize > 0 && !_immediateTimerId && !_paused) { var immediateTimeOut = _profiles[_currentProfile][2]; if (immediateTimeOut >= 0) { _immediateTimerId = _createTimer(function () { _immediateTimerId = null; _sendEventsForLatencyAndAbove(4 , 0 , 1 ); _scheduleTimer(); }, immediateTimeOut); } } var timeOut = _profiles[_currentProfile][1]; if (!_scheduledTimerId && !_flushCallbackTimerId && timeOut >= 0 && !_paused) { if (_hasEvents()) { _scheduledTimerId = _createTimer(function () { _scheduledTimerId = null; _sendEventsForLatencyAndAbove(_timerCount === 0 ? 3 : 1 , 0 , 1 ); _timerCount++; _timerCount %= 2; _scheduleTimer(); }, timeOut); } else { _timerCount = 0; } } } _self._backOffTransmission = function () { if (_currentBackoffCount < MaxBackoffCount) { _currentBackoffCount++; _clearScheduledTimer(); _scheduleTimer(); } }; _self._clearBackOff = function () { if (_currentBackoffCount) { _currentBackoffCount = 0; _clearScheduledTimer(); _scheduleTimer(); } }; function _initDefaults() { _config = null; _isTeardownCalled = false; _flushCallbackQueue = []; _flushCallbackTimerId = null; _paused = false; _immediateQueueSize = 0; _immediateQueueSizeLimit = 500; _queueSize = 0; _queueSizeLimit = 10000; _profiles = {}; _currentProfile = RT_PROFILE; _scheduledTimerId = null; _immediateTimerId = null; _currentBackoffCount = 0; _timerCount = 0; _xhrOverride = null; _batchQueues = {}; _autoFlushEventsLimit = undefined; _autoFlushBatchLimit = 0; _delayedBatchSendLatency = -1; _delayedBatchReason = null; _optimizeObject = true; _isPageUnloadTriggered = false; _disableXhrSync = false; _maxEventSendAttempts = MaxSendAttempts; _maxUnloadEventSendAttempts = MaxSyncUnloadSendAttempts; _evtNamespace = null; _timeoutWrapper = createTimeoutWrapper(); _httpManager = new HttpManager(MaxNumberEventPerBatch, MaxConnections, MaxRequestRetriesBeforeBackoff, { requeue: _requeueEvents, send: _sendingEvent, sent: _eventsSentEvent, drop: _eventsDropped, rspFail: _eventsResponseFail, oth: _otherEvent }, _timeoutWrapper); _initializeProfiles(); _clearQueues(); _setAutoLimits(); } function _createTimer(theTimerFunc, timeOut) { if (timeOut === 0 && _currentBackoffCount) { timeOut = 1; } var timerMultiplier = 1000; if (_currentBackoffCount) { timerMultiplier = retryPolicyGetMillisToBackoffForRetry(_currentBackoffCount - 1); } return _timeoutWrapper.set(theTimerFunc, timeOut * timerMultiplier); } function _clearScheduledTimer() { if (_scheduledTimerId !== null) { _timeoutWrapper.clear(_scheduledTimerId); _scheduledTimerId = null; _timerCount = 0; } } function _releaseAllQueues(sendType, sendReason) { _clearScheduledTimer(); if (_flushCallbackTimerId) { _timeoutWrapper.clear(_flushCallbackTimerId); _flushCallbackTimerId = null; } if (!_paused) { _sendEventsForLatencyAndAbove(1 , sendType, sendReason); } } function _clearQueues() { _batchQueues[4 ] = { batches: [], iKeyMap: {} }; _batchQueues[3 ] = { batches: [], iKeyMap: {} }; _batchQueues[2 ] = { batches: [], iKeyMap: {} }; _batchQueues[1 ] = { batches: [], iKeyMap: {} }; } function _getEventBatch(iKey, latency, create) { var batchQueue = _batchQueues[latency]; if (!batchQueue) { latency = 1 ; batchQueue = _batchQueues[latency]; } var eventBatch = batchQueue.iKeyMap[iKey]; if (!eventBatch && create) { eventBatch = EventBatch.create(iKey); batchQueue.batches.push(eventBatch); batchQueue.iKeyMap[iKey] = eventBatch; } return eventBatch; } function _performAutoFlush(isAsync, doFlush) { if (_httpManager.canSendRequest() && !_currentBackoffCount) { if (_autoFlushEventsLimit > 0 && _queueSize > _autoFlushEventsLimit) { doFlush = true; } if (doFlush && _flushCallbackTimerId == null) { _self.flush(isAsync, null, 20 ); } } } function _addEventToProperQueue(event, append) { if (_optimizeObject) { event = optimizeObject(event); } var latency = event.latency; var eventBatch = _getEventBatch(event.iKey, latency, true); if (eventBatch.addEvent(event)) { if (latency !== 4 ) { _queueSize++; if (append && event.sendAttempt === 0) { _performAutoFlush(!event.sync, _autoFlushBatchLimit > 0 && eventBatch.count() >= _autoFlushBatchLimit); } } else { _immediateQueueSize++; } return true; } return false; } function _dropEventWithLatencyOrLess(iKey, latency, currentLatency, dropNumber) { while (currentLatency <= latency) { var eventBatch = _getEventBatch(iKey, latency, true); if (eventBatch && eventBatch.count() > 0) { var droppedEvents = eventBatch.split(0, dropNumber); var droppedCount = droppedEvents.count(); if (droppedCount > 0) { if (currentLatency === 4 ) { _immediateQueueSize -= droppedCount; } else { _queueSize -= droppedCount; } _notifyBatchEvents(strEventsDiscarded, [droppedEvents], EventsDiscardedReason.QueueFull); return true; } } currentLatency++; } _resetQueueCounts(); return false; } function _resetQueueCounts() { var immediateQueue = 0; var normalQueue = 0; var _loop_1 = function (latency) { var batchQueue = _batchQueues[latency]; if (batchQueue && batchQueue.batches) { arrForEach(batchQueue.batches, function (theBatch) { if (latency === 4 ) { immediateQueue += theBatch.count(); } else { normalQueue += theBatch.count(); } }); } }; for (var latency = 1 ; latency <= 4 ; latency++) { _loop_1(latency); } _queueSize = normalQueue; _immediateQueueSize = immediateQueue; } function _queueBatches(latency, sendType, sendReason) { var eventsQueued = false; var isAsync = sendType === 0 ; if (!isAsync || _httpManager.canSendRequest()) { doPerf(_self.core, function () { return "PostChannel._queueBatches"; }, function () { var droppedEvents = []; var latencyToProcess = 4 ; while (latencyToProcess >= latency) { var batchQueue = _batchQueues[latencyToProcess]; if (batchQueue && batchQueue.batches && batchQueue.batches.length > 0) { arrForEach(batchQueue.batches, function (theBatch) { if (!_httpManager.addBatch(theBatch)) { droppedEvents = droppedEvents.concat(theBatch.events()); } else { eventsQueued = eventsQueued || (theBatch && theBatch.count() > 0); } if (latencyToProcess === 4 ) { _immediateQueueSize -= theBatch.count(); } else { _queueSize -= theBatch.count(); } }); batchQueue.batches = []; batchQueue.iKeyMap = {}; } latencyToProcess--; } if (droppedEvents.length > 0) { _notifyEvents(strEventsDiscarded, droppedEvents, EventsDiscardedReason.KillSwitch); } if (eventsQueued && _delayedBatchSendLatency >= latency) { _delayedBatchSendLatency = -1; _delayedBatchReason = 0 ; } }, function () { return ({ latency: latency, sendType: sendType, sendReason: sendReason }); }, !isAsync); } else { _delayedBatchSendLatency = _delayedBatchSendLatency >= 0 ? Math.min(_delayedBatchSendLatency, latency) : latency; _delayedBatchReason = Math.max(_delayedBatchReason, sendReason); } return eventsQueued; } function _flushImpl(callback, sendReason) { _sendEventsForLatencyAndAbove(1 , 0 , sendReason); _waitForIdleManager(function () { if (callback) { callback(); } if (_flushCallbackQueue.length > 0) { _flushCallbackTimerId = _createTimer(function () { return _flushImpl(_flushCallbackQueue.shift(), sendReason); }, 0); } else { _flushCallbackTimerId = null; if (_hasEvents()) { _scheduleTimer(); } } }); } function _waitForIdleManager(callback) { if (_httpManager.isCompletelyIdle()) { callback(); } else { _flushCallbackTimerId = _createTimer(function () { _waitForIdleManager(callback); }, FlushCheckTimer); } } function _resetTransmitProfiles() { _clearScheduledTimer(); _initializeProfiles(); _currentProfile = RT_PROFILE; _scheduleTimer(); } function _initializeProfiles() { _profiles = {}; _profiles[RT_PROFILE] = [2, 1, 0]; _profiles[NRT_PROFILE] = [6, 3, 0]; _profiles[BE_PROFILE] = [18, 9, 0]; } function _requeueEvents(batches, reason) { var droppedEvents = []; var maxSendAttempts = _maxEventSendAttempts; if (_isPageUnloadTriggered) { maxSendAttempts = _maxUnloadEventSendAttempts; } arrForEach(batches, function (theBatch) { if (theBatch && theBatch.count() > 0) { arrForEach(theBatch.events(), function (theEvent) { if (theEvent) { if (theEvent.sync) { theEvent.latency = 4 ; theEvent.sync = false; } if (theEvent.sendAttempt < maxSendAttempts) { setProcessTelemetryTimings(theEvent, _self.identifier); _addEventToQueues(theEvent, false); } else { droppedEvents.push(theEvent); } } }); } }); if (droppedEvents.length > 0) { _notifyEvents(strEventsDiscarded, droppedEvents, EventsDiscardedReason.NonRetryableStatus); } if (_isPageUnloadTriggered) { _releaseAllQueues(2 , 2 ); } } function _callNotification(evtName, theArgs) { var manager = (_self._notificationManager || {}); var notifyFunc = manager[evtName]; if (notifyFunc) { try { notifyFunc.apply(manager, theArgs); } catch (e) { _throwInternal(_self.diagLog(), 1 , 74 , evtName + " notification failed: " + e); } } } function _notifyEvents(evtName, theEvents) { var extraArgs = []; for (var _i = 2; _i < arguments.length; _i++) { extraArgs[_i - 2] = arguments[_i]; } if (theEvents && theEvents.length > 0) { _callNotification(evtName, [theEvents].concat(extraArgs)); } } function _notifyBatchEvents(evtName, batches) { var extraArgs = []; for (var _i = 2; _i < arguments.length; _i++) { extraArgs[_i - 2] = arguments[_i]; } if (batches && batches.length > 0) { arrForEach(batches, function (theBatch) { if (theBatch && theBatch.count() > 0) { _callNotification(evtName, [theBatch.events()].concat(extraArgs)); } }); } } function _sendingEvent(batches, reason, isSyncRequest) { if (batches && batches.length > 0) { _callNotification("eventsSendRequest", [(reason >= 1000 && reason <= 1999 ? reason - 1000 : 0 ), isSyncRequest !== true]); } } function _eventsSentEvent(batches, reason) { _notifyBatchEvents("eventsSent", batches, reason); _scheduleTimer(); } function _eventsDropped(batches, reason) { _notifyBatchEvents(strEventsDiscarded, batches, (reason >= 8000 && reason <= 8999 ? reason - 8000 : EventsDiscardedReason.Unknown)); } function _eventsResponseFail(batches) { _notifyBatchEvents(strEventsDiscarded, batches, EventsDiscardedReason.NonRetryableStatus); _scheduleTimer(); } function _otherEvent(batches, reason) { _notifyBatchEvents(strEventsDiscarded, batches, EventsDiscardedReason.Unknown); _scheduleTimer(); } function _setAutoLimits() { if (!_config || !_config.disableAutoBatchFlushLimit) { _autoFlushBatchLimit = Math.max(MaxNumberEventPerBatch * (MaxConnections + 1), _queueSizeLimit / 6); } else { _autoFlushBatchLimit = 0; } } objDefineAccessors(_self, "_setTimeoutOverride", function () { return _timeoutWrapper.set; }, function (value) { _timeoutWrapper = createTimeoutWrapper(value, _timeoutWrapper.clear); }); objDefineAccessors(_self, "_clearTimeoutOverride", function () { return _timeoutWrapper.clear; }, function (value) { _timeoutWrapper = createTimeoutWrapper(_timeoutWrapper.set, value); }); }); return _this; } return PostChannel; }(BaseTelemetryPlugin)); var PostChannel$1 = PostChannel; exports.BE_PROFILE = BE_PROFILE; exports.NRT_PROFILE = NRT_PROFILE; exports.PostChannel = PostChannel$1; exports.RT_PROFILE = RT_PROFILE; (function(obj, prop, descriptor) { /* ai_es3_polyfil defineProperty */ var func = Object["defineProperty"]; if (func) { try { return func(obj, prop, descriptor); } catch(e) { /* IE8 defines defineProperty, but will throw */ } } if (descriptor && typeof descriptor.value !== undefined) { obj[prop] = descriptor.value; } return obj; })(exports, '__esModule', { value: true }); }));//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/1ds-post-js/bundle/ms.post-3.2.2.js.map /*! * 1DS JS SDK POST plugin, 3.2.2 * Copyright (c) Microsoft and contributors. All rights reserved. * (Microsoft Internal Only) */ var n=this,e=function(s){"use strict";var l="function",Q="object",J="undefined",a="prototype",f="hasOwnProperty",t=Object,n=t[a],C=t.assign,e=(t.create,t.defineProperty),v=n[f],r=null;function T(n){return void 0===n&&(n=!0),r&&n||(typeof globalThis!==J&&globalThis&&(r=globalThis),typeof self!==J&&self&&(r=self),typeof window!==J&&window&&(r=window),typeof global!==J&&global&&(r=global)),r}function _(n){throw new TypeError(n)}(T()||{}).Symbol,(T()||{}).Reflect;var S=function(n,e){return(S=t.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var t in e)e[f](t)&&(n[t]=e[t])})(n,e)},E="constructor",g="prototype",P="function",R="_dynInstFuncs",L="_isDynProxy",p="_dynClass",M="_dynInstChk",N=M,k="_dfOpts",O="_unknown_",K="__proto__",I="_dyn"+K,A="_dynInstProto",B="useBaseInst",H="setInstFuncs",q=Object,U=q.getPrototypeOf,z=q.getOwnPropertyNames,D=0;function h(n,e){return n&&q[g].hasOwnProperty.call(n,e)}function j(n){return n&&(n===q[g]||n===Array[g])}function F(n){return j(n)||n===Function[g]}function y(n){if(n){if(U)return U(n);var e=n[K]||n[g]||(n[E]?n[E][g]:null),t=n[I]||e;h(n,I)||(delete n[A],t=n[I]=n[A]||n[I],n[A]=e)}return t}function X(n,e){var t=[];if(z)t=z(n);else for(var r in n)"string"==typeof r&&h(n,r)&&t.push(r);if(t&&0=o&&!(n=r===i)){for(var a=0;a=o.maxInternalMessageLimit()||(r=!0,t="AITR_"+e.messageId,c[t]?r=!1:c[t]=!0,r&&(n<=o.telemetryLoggingLevel()&&(o.queue.push(e),u++,a(1===n?"error":"warn",e)),u===o.maxInternalMessageLimit()&&(r=new _e(23,t="Internal events throttle limit per PageView reached for this app.",!1),o.queue.push(r),1===n?o.errorToConsole(t):o.warnToConsole(t))))}})};function un(n,e,t,r,i,o){void 0===o&&(o=!1),(n||new Ee).throwInternal(e,t,r,i,o)}u.ParentContextKey="parent",u.ChildrenContextKey="childEvts";var Pe=u;function u(n,i,e){var t,o=this,a=!1;o.start=G(),o.name=n,o.isAsync=e,o.isChildEvt=function(){return!1},x(i)&&(a=$n(o,"payload",function(){return!t&&x(i)&&(t=i(),i=null),t})),o.getCtx=function(n){return n?(n===u.ParentContextKey||n===u.ChildrenContextKey?o:o.ctx||{})[n]:null},o.setCtx=function(n,e){n&&(n===u.ParentContextKey?(o[n]||(o.isChildEvt=function(){return!0}),o[n]=e):n===u.ChildrenContextKey?o[n]=e:(o.ctx=o.ctx||{})[n]=e)},o.complete=function(){var n=0,e=o.getCtx(u.ChildrenContextKey);if(tn(e))for(var t=0;t>>=0),Ne=123456789+e&c,ke=987654321-e&c,Me=!0}catch(o){}r=((ke=36969*(65535&ke)+(ke>>16)&c)<<16)+(65535&(Ne=18e3*(65535&Ne)+(Ne>>16)&c))>>>0&c|0,t=(r>>>=0)&c}return 0===t&&(t=Math.floor(Le*Math.random()|0)),n||(t>>>=0),t}var Ke=e,Ie="2.8.3",Ae="."+function(n){void 0===n&&(n=22);for(var e=Oe()>>>0,t=0,r=d;r.length>>=6,5==++t&&(e=(Oe()<<2&4294967295|3&e)>>>0,t=0);return r}(6),Be=0;function He(n){return 1===n.nodeType||9===n.nodeType||!+n.nodeType}function qe(n,e){return Hn(n+Be+++((e=void 0!==e&&e)?"."+Ie:"")+Ae)}function Ue(n){var o={id:qe("_aiData-"+(n||"")+"."+Ie),accept:He,get:function(n,e,t,r){var i=n[o.id];return i?i[Hn(e)]:(r&&((i=function(n,e){var t=e[n.id];if(!t){t={};try{He(e)&&!function(n,e,t){if(Ke)try{return Ke(n,e,{value:t,enumerable:!1,configurable:!0}),1}catch(r){}}(e,n.id,t)&&(e[n.id]=t)}catch(r){}}return t}(o,n))[Hn(e)]=t),t)},kill:function(n,e){if(n&&n[e])try{delete n[e]}catch(t){}}};return o}var ze=Ue("plugin");function De(n){return ze.get(n,"state",{},!0)}var je="TelemetryPluginChain",Fe="_hasRun",Xe="_getTelCtx",Qe=0;function Je(n,a,t,e){var r=null,i=[],o=(null!==e&&(r=e?function(n,e,t){for(;n;){if(n.getPlugin()===t)return n;n=n.getNext()}return $e([t],e.config||{},e)}(n,t,e):n),{_next:function(){var n,e=r;return r=e?e.getNext():null,e||(n=i)&&0G()||(delete e[n],!1)}})},ar=function Mr(){var e=!0,t=!0,r=!0,i="use-collector-delta",o=!1;m(Mr,this,function(n){n.allowRequestSending=function(){return e},n.firstRequestSent=function(){r&&(r=!1,o||(e=!1))},n.shouldAddClockSkewHeaders=function(){return t},n.getClockSkewHeaderValue=function(){return i},n.setClockSkew=function(n){o||(n?(i=n,o=t=!0):t=!1,e=!0)}})},ur="sendAttempt",cr="&NoResponseBody=true",sr=((i={})[1]=n,i[100]=n,i[200]="sent",i[8004]=Ot,i[8003]=Ot,i),lr={},fr={};function o(n,e,t){lr[n]=e,!1!==t&&(fr[e]=n)}function dr(n){try{return n.responseText}catch(e){}return""}function vr(n,e){var t=!1;if(n&&e){var r=Wn(n);if(r&&0=N)):q++,1)}function v(){for(var t=0,r=0,n=1;n<=4;n++)!function(e){var n=$[e];n&&n.batches&&rn(n.batches,function(n){4===e?t+=n.count():r+=n.count()})}(n);z=r,q=t}function g(r,n,e){var i=!1,t=0===n;return!t||L.canSendRequest()?cn(p.core,function(){return"PostChannel._queueBatches"},function(){for(var e=[],t=4;r<=t;){var n=$[t];n&&n.batches&&0=N&&(t=!0)})}f(!0,t)},p.pause=function(){c(),H=!0,L.pause()},p.resume=function(){H=!1,L.resume(),a()},p.addResponseHandler=function(n){L._responseHandlers.push(n)},p._loadTransmitProfiles=function(n){c(),e(),F=Nt,a(),en(n,function(n,e){var t,r=e.length;2<=r&&(t=2e[1]&&(t=e[1]),e.push(t),j[n]=e)})},p.flush=function(n,e,t){void 0===n&&(n=!0),H||(c(),t=t||1,n?(g(1,0,t),v(),null==B?B=u(function(){!function r(n,e){o(1,0,e),function t(n){L.isCompletelyIdle()?n():B=u(function(){t(n)},.25)}(function(){n&&n(),0 0) { for (var lp = 0; lp < props.length; lp++) { func(props[lp]); } } } function _isDynamicCandidate(target, funcName, skipOwn) { return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName))); } function _throwTypeError(message) { throw new TypeError("DynamicProto: " + message); } function _getInstanceFuncs(thisTarget) { var instFuncs = {}; _forEachProp(thisTarget, function (name) { if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) { instFuncs[name] = thisTarget[name]; } }); return instFuncs; } function _hasVisited(values, value) { for (var lp = values.length - 1; lp >= 0; lp--) { if (values[lp] === value) { return true; } } return false; } function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) { function _instFuncProxy(target, funcHost, funcName) { var theFunc = funcHost[funcName]; if (theFunc[DynProxyTag] && useBaseInst) { var instFuncTable = target[DynInstFuncTable] || {}; if (instFuncTable[DynAllowInstChkTag] !== false) { theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc; } } return function () { return theFunc.apply(target, arguments); }; } var baseFuncs = {}; _forEachProp(instFuncs, function (name) { baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name); }); var baseProto = _getObjProto$1(classProto); var visited = []; while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) { _forEachProp(baseProto, function (name) { if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf$1)) { baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name); } }); visited.push(baseProto); baseProto = _getObjProto$1(baseProto); } return baseFuncs; } function _getInstFunc(target, funcName, proto, currentDynProtoProxy) { var instFunc = null; if (target && _hasOwnProperty(proto, DynClassName)) { var instFuncTable = target[DynInstFuncTable] || {}; instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName]; if (!instFunc) { _throwTypeError("Missing [" + funcName + "] " + strFunction); } if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) { var canAddInst = !_hasOwnProperty(target, funcName); var objProto = _getObjProto$1(target); var visited = []; while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) { var protoFunc = objProto[funcName]; if (protoFunc) { canAddInst = (protoFunc === currentDynProtoProxy); break; } visited.push(objProto); objProto = _getObjProto$1(objProto); } try { if (canAddInst) { target[funcName] = instFunc; } instFunc[DynInstChkTag] = 1; } catch (e) { instFuncTable[DynAllowInstChkTag] = false; } } } return instFunc; } function _getProtoFunc(funcName, proto, currentDynProtoProxy) { var protoFunc = proto[funcName]; if (protoFunc === currentDynProtoProxy) { protoFunc = _getObjProto$1(proto)[funcName]; } if (typeof protoFunc !== strFunction) { _throwTypeError("[" + funcName + "] is not a " + strFunction); } return protoFunc; } function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) { function _createDynamicPrototype(proto, funcName) { var dynProtoProxy = function () { var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy); return instFunc.apply(this, arguments); }; dynProtoProxy[DynProxyTag] = 1; return dynProtoProxy; } if (!_isObjectOrArrayPrototype(proto)) { var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {}; var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {}); if (instFuncTable[DynAllowInstChkTag] !== false) { instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc; } _forEachProp(target, function (name) { if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) { instFuncs_1[name] = target[name]; delete target[name]; if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) { proto[name] = _createDynamicPrototype(proto, name); } } }); } } function _checkPrototype(classProto, thisTarget) { if (_objGetPrototypeOf$1) { var visited = []; var thisProto = _getObjProto$1(thisTarget); while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) { if (thisProto === classProto) { return true; } visited.push(thisProto); thisProto = _getObjProto$1(thisProto); } return false; } return true; } function _getObjName(target, unknownValue) { if (_hasOwnProperty(target, Prototype)) { return target.name || unknownValue || UnknownValue; } return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue; } function dynamicProto(theClass, target, delegateFunc, options) { if (!_hasOwnProperty(theClass, Prototype)) { _throwTypeError("theClass is an invalid class definition."); } var classProto = theClass[Prototype]; if (!_checkPrototype(classProto, target)) { _throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]"); } var className = null; if (_hasOwnProperty(classProto, DynClassName)) { className = classProto[DynClassName]; } else { className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _dynamicNames; _dynamicNames++; classProto[DynClassName] = className; } var perfOptions = dynamicProto[DynProtoDefaultOptions]; var useBaseInst = !!perfOptions[strUseBaseInst]; if (useBaseInst && options && options[strUseBaseInst] !== undefined) { useBaseInst = !!options[strUseBaseInst]; } var instFuncs = _getInstanceFuncs(target); var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst); delegateFunc(target, baseFuncs); var setInstanceFunc = !!_objGetPrototypeOf$1 && !!perfOptions[strSetInstFuncs]; if (setInstanceFunc && options) { setInstanceFunc = !!options[strSetInstFuncs]; } _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false); } var perfDefaults = { setInstFuncs: true, useBaseInst: true }; dynamicProto[DynProtoDefaultOptions] = perfDefaults; var strEmpty = ""; var strSetNextPlugin = "setNextPlugin"; var strIsInitialized = "isInitialized"; var strTeardown = "teardown"; var strCore = "core"; var strUpdate = "update"; var strDisabled = "disabled"; var strDoTeardown = "_doTeardown"; var cStrStartsWith = "startsWith"; var strIndexOf = "indexOf"; var cStrTrim = "trim"; var strToString = "toString"; var str__Proto = "__proto__"; var strConstructor = "constructor"; var _objDefineProperty$1 = ObjDefineProperty; var _objFreeze = ObjClass.freeze; var _objKeys = ObjClass.keys; var StringProto = String[strShimPrototype]; var _strTrim = StringProto[cStrTrim]; var _strStartsWith = StringProto[cStrStartsWith]; var _isArray = Array.isArray; var _objToString = ObjProto[strToString]; var _fnToString = ObjHasOwnProperty[strToString]; var _objFunctionString = _fnToString.call(ObjClass); var rCamelCase = /-([a-z])/g; var rNormalizeInvalid = /([^\w\d_$])/g; var rLeadingNumeric = /^(\d+[\w\d_$])/; var _objGetPrototypeOf = Object["getPrototypeOf"]; function _getObjProto(target) { if (target) { if (_objGetPrototypeOf) { return _objGetPrototypeOf(target); } var newProto = target[str__Proto] || target[strShimPrototype] || target[strConstructor]; if (newProto) { return newProto; } } return null; } function isUndefined(value) { return value === undefined || typeof value === strShimUndefined; } function isNullOrUndefined(value) { return (value === null || isUndefined(value)); } function hasOwnProperty(obj, prop) { return !!(obj && ObjHasOwnProperty.call(obj, prop)); } function isObject(value) { return !!(value && typeof value === strShimObject); } function isFunction(value) { return !!(value && typeof value === strShimFunction); } function normalizeJsName(name) { var value = name; if (value && isString(value)) { value = value.replace(rCamelCase, function (_all, letter) { return letter.toUpperCase(); }); value = value.replace(rNormalizeInvalid, "_"); value = value.replace(rLeadingNumeric, function (_all, match) { return "_" + match; }); } return value; } function objForEachKey(target, callbackfn) { if (target) { for (var prop in target) { if (ObjHasOwnProperty.call(target, prop)) { callbackfn.call(target, prop, target[prop]); } } } } function strStartsWith(value, checkValue) { var result = false; if (value && checkValue && !(result = value === checkValue)) { result = _strStartsWith ? value[cStrStartsWith](checkValue) : _strStartsWithPoly(value, checkValue); } return result; } function _strStartsWithPoly(value, checkValue) { var result = false; var chkLen = checkValue ? checkValue.length : 0; if (value && chkLen && value.length >= chkLen && !(result = value === checkValue)) { for (var lp = 0; lp < chkLen; lp++) { if (value[lp] !== checkValue[lp]) { return false; } } result = true; } return result; } function strContains(value, search) { if (value && search) { return value.indexOf(search) !== -1; } return false; } var isArray = _isArray || _isArrayPoly; function _isArrayPoly(obj) { return !!(obj && _objToString.call(obj) === "[object Array]"); } function isString(value) { return typeof value === "string"; } function isNumber(value) { return typeof value === "number"; } function isBoolean(value) { return typeof value === "boolean"; } function isPlainObject(value) { var result = false; if (value && typeof value === "object") { var proto = _objGetPrototypeOf ? _objGetPrototypeOf(value) : _getObjProto(value); if (!proto) { result = true; } else { if (proto[strConstructor] && ObjHasOwnProperty.call(proto, strConstructor)) { proto = proto[strConstructor]; } result = typeof proto === strShimFunction && _fnToString.call(proto) === _objFunctionString; } } return result; } function arrForEach(arr, callbackfn, thisArg) { var len = arr.length; try { for (var idx = 0; idx < len; idx++) { if (idx in arr) { if (callbackfn.call(thisArg || arr, arr[idx], idx, arr) === -1) { break; } } } } catch (e) { } } function arrIndexOf(arr, searchElement, fromIndex) { if (arr) { if (arr[strIndexOf]) { return arr[strIndexOf](searchElement, fromIndex); } var len = arr.length; var from = fromIndex || 0; try { for (var lp = Math.max(from >= 0 ? from : len - Math.abs(from), 0); lp < len; lp++) { if (lp in arr && arr[lp] === searchElement) { return lp; } } } catch (e) { } } return -1; } function strTrim(str) { if (str) { str = (_strTrim && str[cStrTrim]) ? str[cStrTrim]() : (str.replace ? str.replace(/^\s+|\s+$/g, "") : str); } return str; } var _objKeysHasDontEnumBug = !({ toString: null }).propertyIsEnumerable("toString"); var _objKeysDontEnums = [ "toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor" ]; function objKeys(obj) { var objType = typeof obj; if (objType !== strShimFunction && (objType !== strShimObject || obj === null)) { throwTypeError("objKeys called on non-object"); } if (!_objKeysHasDontEnumBug && _objKeys) { return _objKeys(obj); } var result = []; for (var prop in obj) { if (obj && ObjHasOwnProperty.call(obj, prop)) { result.push(prop); } } if (_objKeysHasDontEnumBug) { var dontEnumsLength = _objKeysDontEnums.length; for (var lp = 0; lp < dontEnumsLength; lp++) { if (obj && ObjHasOwnProperty.call(obj, _objKeysDontEnums[lp])) { result.push(_objKeysDontEnums[lp]); } } } return result; } function objDefineAccessors(target, prop, getProp, setProp) { if (_objDefineProperty$1) { try { var descriptor = { enumerable: true, configurable: true }; if (getProp) { descriptor.get = getProp; } if (setProp) { descriptor.set = setProp; } _objDefineProperty$1(target, prop, descriptor); return true; } catch (e) { } } return false; } function _doNothing(value) { return value; } function deepFreeze(obj) { if (_objFreeze) { objForEachKey(obj, function (name, value) { if (isArray(value) || isObject(value)) { _objFreeze(value); } }); } return objFreeze(obj); } var objFreeze = _objFreeze || _doNothing; function dateNow() { var dt = Date; return dt.now ? dt.now() : new dt().getTime(); } function setValue(target, field, value, valChk, srcChk) { var theValue = value; if (target) { theValue = target[field]; if (theValue !== value && (!srcChk || srcChk(theValue)) && (!valChk || valChk(value))) { theValue = value; target[field] = theValue; } } return theValue; } function _createProxyFunction(source, funcName) { var srcFunc = null; var src = null; if (isFunction(source)) { srcFunc = source; } else { src = source; } return function () { var originalArguments = arguments; if (srcFunc) { src = srcFunc(); } if (src) { return src[funcName].apply(src, originalArguments); } }; } function proxyFunctionAs(target, name, source, theFunc, overwriteTarget) { if (target && name && source) { if (overwriteTarget !== false || isUndefined(target[name])) { target[name] = _createProxyFunction(source, theFunc); } } } function optimizeObject(theObject) { if (theObject && ObjAssign) { theObject = ObjClass(ObjAssign({}, theObject)); } return theObject; } function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) { var theArgs = arguments; var extended = theArgs[0] || {}; var argLen = theArgs.length; var deep = false; var idx = 1; if (argLen > 0 && isBoolean(extended)) { deep = extended; extended = theArgs[idx] || {}; idx++; } if (!isObject(extended)) { extended = {}; } for (; idx < argLen; idx++) { var arg = theArgs[idx]; var isArgArray = isArray(arg); var isArgObj = isObject(arg); for (var prop in arg) { var propOk = (isArgArray && (prop in arg)) || (isArgObj && (ObjHasOwnProperty.call(arg, prop))); if (!propOk) { continue; } var newValue = arg[prop]; var isNewArray = void 0; if (deep && newValue && ((isNewArray = isArray(newValue)) || isPlainObject(newValue))) { var clone = extended[prop]; if (isNewArray) { if (!isArray(clone)) { clone = []; } } else if (!isPlainObject(clone)) { clone = {}; } newValue = objExtend(deep, clone, newValue); } if (newValue !== undefined) { extended[prop] = newValue; } } } return extended; } function createEnumStyle(values) { var enumClass = {}; objForEachKey(values, function (field, value) { enumClass[field] = value; enumClass[value] = field; }); return deepFreeze(enumClass); } var EventsDiscardedReason = createEnumStyle({ Unknown: 0 , NonRetryableStatus: 1 , InvalidEvent: 2 , SizeLimitExceeded: 3 , KillSwitch: 4 , QueueFull: 5 }); var strWindow = "window"; var strDocument = "document"; var strNavigator = "navigator"; var strLocation = "location"; var strConsole = "console"; var strPerformance = "performance"; var strJSON = "JSON"; var strCrypto = "crypto"; var strMsCrypto = "msCrypto"; var strReactNative = "ReactNative"; var strMsie = "msie"; var strTrident = "trident/"; var strXMLHttpRequest = "XMLHttpRequest"; var _isTrident = null; var _navUserAgentCheck = null; var _enableMocks = false; var _useXDomainRequest = null; var _beaconsSupported = null; function _hasProperty(theClass, property) { var supported = false; if (theClass) { try { supported = property in theClass; if (!supported) { var proto = theClass[strShimPrototype]; if (proto) { supported = property in proto; } } } catch (e) { } if (!supported) { try { var tmp = new theClass(); supported = !isUndefined(tmp[property]); } catch (e) { } } } return supported; } function getGlobalInst(name) { var gbl = getGlobal(); if (gbl && gbl[name]) { return gbl[name]; } if (name === strWindow && hasWindow()) { return window; } return null; } function hasWindow() { return Boolean(typeof window === strShimObject && window); } function getWindow() { if (hasWindow()) { return window; } return getGlobalInst(strWindow); } function hasDocument() { return Boolean(typeof document === strShimObject && document); } function getDocument() { if (hasDocument()) { return document; } return getGlobalInst(strDocument); } function hasNavigator() { return Boolean(typeof navigator === strShimObject && navigator); } function getNavigator() { if (hasNavigator()) { return navigator; } return getGlobalInst(strNavigator); } function getLocation(checkForMock) { if (checkForMock && _enableMocks) { var mockLocation = getGlobalInst("__mockLocation"); if (mockLocation) { return mockLocation; } } if (typeof location === strShimObject && location) { return location; } return getGlobalInst(strLocation); } function getConsole() { if (typeof console !== strShimUndefined) { return console; } return getGlobalInst(strConsole); } function getPerformance() { return getGlobalInst(strPerformance); } function hasJSON() { return Boolean((typeof JSON === strShimObject && JSON) || getGlobalInst(strJSON) !== null); } function getJSON() { if (hasJSON()) { return JSON || getGlobalInst(strJSON); } return null; } function getCrypto() { return getGlobalInst(strCrypto); } function getMsCrypto() { return getGlobalInst(strMsCrypto); } function isReactNative() { var nav = getNavigator(); if (nav && nav.product) { return nav.product === strReactNative; } return false; } function isIE() { var nav = getNavigator(); if (nav && (nav.userAgent !== _navUserAgentCheck || _isTrident === null)) { _navUserAgentCheck = nav.userAgent; var userAgent = (_navUserAgentCheck || strEmpty).toLowerCase(); _isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident)); } return _isTrident; } function dumpObj(object) { var objectTypeDump = Object[strShimPrototype].toString.call(object); var propertyValueDump = strEmpty; if (objectTypeDump === "[object Error]") { propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'"; } else if (hasJSON()) { propertyValueDump = getJSON().stringify(object); } return objectTypeDump + propertyValueDump; } function isBeaconsSupported() { if (_beaconsSupported === null) { _beaconsSupported = hasNavigator() && Boolean(getNavigator().sendBeacon); } return _beaconsSupported; } function isFetchSupported(withKeepAlive) { var isSupported = false; try { isSupported = !!getGlobalInst("fetch"); var request = getGlobalInst("Request"); if (isSupported && withKeepAlive && request) { isSupported = _hasProperty(request, "keepalive"); } } catch (e) { } return isSupported; } function useXDomainRequest() { if (_useXDomainRequest === null) { _useXDomainRequest = (typeof XDomainRequest !== strShimUndefined); if (_useXDomainRequest && isXhrSupported()) { _useXDomainRequest = _useXDomainRequest && !_hasProperty(getGlobalInst(strXMLHttpRequest), "withCredentials"); } } return _useXDomainRequest; } function isXhrSupported() { var isSupported = false; try { var xmlHttpRequest = getGlobalInst(strXMLHttpRequest); isSupported = !!xmlHttpRequest; } catch (e) { } return isSupported; } var _aiNamespace = null; function _getExtensionNamespace() { var target = getGlobalInst("Microsoft"); if (target) { _aiNamespace = target["ApplicationInsights"]; } return _aiNamespace; } function getDebugExt(config) { var ns = _aiNamespace; if (!ns && config.disableDbgExt !== true) { ns = _aiNamespace || _getExtensionNamespace(); } return ns ? ns["ChromeDbgExt"] : null; } var AiNonUserActionablePrefix = "AI (Internal): "; var AiUserActionablePrefix = "AI: "; var AIInternalMessagePrefix = "AITR_"; var strErrorToConsole = "errorToConsole"; var strWarnToConsole = "warnToConsole"; function _sanitizeDiagnosticText(text) { if (text) { return "\"" + text.replace(/\"/g, strEmpty) + "\""; } return strEmpty; } function _logToConsole(func, message) { var theConsole = getConsole(); if (!!theConsole) { var logFunc = "log"; if (theConsole[func]) { logFunc = func; } if (isFunction(theConsole[logFunc])) { theConsole[logFunc](message); } } } var _InternalLogMessage = /** @class */ (function () { function _InternalLogMessage(msgId, msg, isUserAct, properties) { if (isUserAct === void 0) { isUserAct = false; } var _self = this; _self.messageId = msgId; _self.message = (isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) + msgId; var strProps = strEmpty; if (hasJSON()) { strProps = getJSON().stringify(properties); } var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : strEmpty) + (properties ? " props:" + _sanitizeDiagnosticText(strProps) : strEmpty); _self.message += diagnosticText; } _InternalLogMessage.dataType = "MessageData"; return _InternalLogMessage; }()); function safeGetLogger(core, config) { return (core || {}).logger || new DiagnosticLogger(config); } var DiagnosticLogger = /** @class */ (function () { function DiagnosticLogger(config) { this.identifier = "DiagnosticLogger"; this.queue = []; var _messageCount = 0; var _messageLogged = {}; dynamicProto(DiagnosticLogger, this, function (_self) { if (isNullOrUndefined(config)) { config = {}; } _self.consoleLoggingLevel = function () { return _getConfigValue("loggingLevelConsole", 0); }; _self.telemetryLoggingLevel = function () { return _getConfigValue("loggingLevelTelemetry", 1); }; _self.maxInternalMessageLimit = function () { return _getConfigValue("maxMessageLimit", 25); }; _self.enableDebugExceptions = function () { return _getConfigValue("enableDebugExceptions", false); }; _self.throwInternal = function (severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } var message = new _InternalLogMessage(msgId, msg, isUserAct, properties); if (_self.enableDebugExceptions()) { throw dumpObj(message); } else { var logFunc = severity === 1 ? strErrorToConsole : strWarnToConsole; if (!isUndefined(message.message)) { var logLevel = _self.consoleLoggingLevel(); if (isUserAct) { var messageKey = +message.messageId; if (!_messageLogged[messageKey] && logLevel >= severity) { _self[logFunc](message.message); _messageLogged[messageKey] = true; } } else { if (logLevel >= severity) { _self[logFunc](message.message); } } _self.logInternalMessage(severity, message); } else { _debugExtMsg("throw" + (severity === 1 ? "Critical" : "Warning"), message); } } }; _self.warnToConsole = function (message) { _logToConsole("warn", message); _debugExtMsg("warning", message); }; _self.errorToConsole = function (message) { _logToConsole("error", message); _debugExtMsg("error", message); }; _self.resetInternalMessageCount = function () { _messageCount = 0; _messageLogged = {}; }; _self.logInternalMessage = function (severity, message) { if (_areInternalMessagesThrottled()) { return; } var logMessage = true; var messageKey = AIInternalMessagePrefix + message.messageId; if (_messageLogged[messageKey]) { logMessage = false; } else { _messageLogged[messageKey] = true; } if (logMessage) { if (severity <= _self.telemetryLoggingLevel()) { _self.queue.push(message); _messageCount++; _debugExtMsg((severity === 1 ? "error" : "warn"), message); } if (_messageCount === _self.maxInternalMessageLimit()) { var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app."; var throttleMessage = new _InternalLogMessage(23 , throttleLimitMessage, false); _self.queue.push(throttleMessage); if (severity === 1 ) { _self.errorToConsole(throttleLimitMessage); } else { _self.warnToConsole(throttleLimitMessage); } } } }; function _getConfigValue(name, defValue) { var value = config[name]; if (!isNullOrUndefined(value)) { return value; } return defValue; } function _areInternalMessagesThrottled() { return _messageCount >= _self.maxInternalMessageLimit(); } function _debugExtMsg(name, data) { var dbgExt = getDebugExt(config); if (dbgExt && dbgExt.diagLog) { dbgExt.diagLog(name, data); } } }); } return DiagnosticLogger; }()); function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } (logger || new DiagnosticLogger()).throwInternal(severity, msgId, msg, properties, isUserAct); } var strExecutionContextKey = "ctx"; var PerfEvent = /** @class */ (function () { function PerfEvent(name, payloadDetails, isAsync) { var _self = this; var accessorDefined = false; _self.start = dateNow(); _self.name = name; _self.isAsync = isAsync; _self.isChildEvt = function () { return false; }; if (isFunction(payloadDetails)) { var theDetails_1; accessorDefined = objDefineAccessors(_self, "payload", function () { if (!theDetails_1 && isFunction(payloadDetails)) { theDetails_1 = payloadDetails(); payloadDetails = null; } return theDetails_1; }); } _self.getCtx = function (key) { if (key) { if (key === PerfEvent.ParentContextKey || key === PerfEvent.ChildrenContextKey) { return _self[key]; } return (_self[strExecutionContextKey] || {})[key]; } return null; }; _self.setCtx = function (key, value) { if (key) { if (key === PerfEvent.ParentContextKey) { if (!_self[key]) { _self.isChildEvt = function () { return true; }; } _self[key] = value; } else if (key === PerfEvent.ChildrenContextKey) { _self[key] = value; } else { var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {}; ctx[key] = value; } } }; _self.complete = function () { var childTime = 0; var childEvts = _self.getCtx(PerfEvent.ChildrenContextKey); if (isArray(childEvts)) { for (var lp = 0; lp < childEvts.length; lp++) { var childEvt = childEvts[lp]; if (childEvt) { childTime += childEvt.time; } } } _self.time = dateNow() - _self.start; _self.exTime = _self.time - childTime; _self.complete = function () { }; if (!accessorDefined && isFunction(payloadDetails)) { _self.payload = payloadDetails(); } }; } PerfEvent.ParentContextKey = "parent"; PerfEvent.ChildrenContextKey = "childEvts"; return PerfEvent; }()); var doPerfActiveKey = "CoreUtils.doPerf"; function doPerf(mgrSource, getSource, func, details, isAsync) { if (mgrSource) { var perfMgr = mgrSource; if (isFunction(perfMgr["getPerfMgr"])) { perfMgr = perfMgr["getPerfMgr"](); } if (perfMgr) { var perfEvt = void 0; var currentActive = perfMgr.getCtx(doPerfActiveKey); try { perfEvt = perfMgr.create(getSource(), details, isAsync); if (perfEvt) { if (currentActive && perfEvt.setCtx) { perfEvt.setCtx(PerfEvent.ParentContextKey, currentActive); if (currentActive.getCtx && currentActive.setCtx) { var children = currentActive.getCtx(PerfEvent.ChildrenContextKey); if (!children) { children = []; currentActive.setCtx(PerfEvent.ChildrenContextKey, children); } children.push(perfEvt); } } perfMgr.setCtx(doPerfActiveKey, perfEvt); return func(perfEvt); } } catch (ex) { if (perfEvt && perfEvt.setCtx) { perfEvt.setCtx("exception", ex); } } finally { if (perfEvt) { perfMgr.fire(perfEvt); } perfMgr.setCtx(doPerfActiveKey, currentActive); } } } return func(); } var UInt32Mask = 0x100000000; var MaxUInt32 = 0xffffffff; var _mwcSeeded = false; var _mwcW = 123456789; var _mwcZ = 987654321; function _mwcSeed(seedValue) { if (seedValue < 0) { seedValue >>>= 0; } _mwcW = (123456789 + seedValue) & MaxUInt32; _mwcZ = (987654321 - seedValue) & MaxUInt32; _mwcSeeded = true; } function _autoSeedMwc() { try { var now = dateNow() & 0x7fffffff; _mwcSeed(((Math.random() * UInt32Mask) ^ now) + now); } catch (e) { } } function random32(signed) { var value = 0; var c = getCrypto() || getMsCrypto(); if (c && c.getRandomValues) { value = c.getRandomValues(new Uint32Array(1))[0] & MaxUInt32; } if (value === 0 && isIE()) { if (!_mwcSeeded) { _autoSeedMwc(); } value = mwcRandom32() & MaxUInt32; } if (value === 0) { value = Math.floor((UInt32Mask * Math.random()) | 0); } if (!signed) { value >>>= 0; } return value; } function mwcRandom32(signed) { _mwcZ = (36969 * (_mwcZ & 0xFFFF) + (_mwcZ >> 16)) & MaxUInt32; _mwcW = (18000 * (_mwcW & 0xFFFF) + (_mwcW >> 16)) & MaxUInt32; var value = (((_mwcZ << 16) + (_mwcW & 0xFFFF)) >>> 0) & MaxUInt32 | 0; if (!signed) { value >>>= 0; } return value; } function newId(maxLength) { if (maxLength === void 0) { maxLength = 22; } var base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; var number = random32() >>> 0; var chars = 0; var result = strEmpty; while (result.length < maxLength) { chars++; result += base64chars.charAt(number & 0x3F); number >>>= 6; if (chars === 5) { number = (((random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0; chars = 0; } } return result; } var _objDefineProperty = ObjDefineProperty; var version = "2.8.3"; var instanceName = "." + newId(6); var _dataUid = 0; function _createAccessor(target, prop, value) { if (_objDefineProperty) { try { _objDefineProperty(target, prop, { value: value, enumerable: false, configurable: true }); return true; } catch (e) { } } return false; } function _canAcceptData(target) { return target.nodeType === 1 || target.nodeType === 9 || !(+target.nodeType); } function _getCache(data, target) { var theCache = target[data.id]; if (!theCache) { theCache = {}; try { if (_canAcceptData(target)) { if (!_createAccessor(target, data.id, theCache)) { target[data.id] = theCache; } } } catch (e) { } } return theCache; } function createUniqueNamespace(name, includeVersion) { if (includeVersion === void 0) { includeVersion = false; } return normalizeJsName(name + (_dataUid++) + (includeVersion ? "." + version : "") + instanceName); } function createElmNodeData(name) { var data = { id: createUniqueNamespace("_aiData-" + (name || "") + "." + version), accept: function (target) { return _canAcceptData(target); }, get: function (target, name, defValue, addDefault) { var theCache = target[data.id]; if (!theCache) { if (addDefault) { theCache = _getCache(data, target); theCache[normalizeJsName(name)] = defValue; } return defValue; } return theCache[normalizeJsName(name)]; }, kill: function (target, name) { if (target && target[name]) { try { delete target[name]; } catch (e) { } } } }; return data; } var pluginStateData = createElmNodeData("plugin"); function _getPluginState(plugin) { return pluginStateData.get(plugin, "state", {}, true); } var strTelemetryPluginChain = "TelemetryPluginChain"; var strHasRunFlags = "_hasRun"; var strGetTelCtx = "_getTelCtx"; var _chainId = 0; function _getNextProxyStart(proxy, core, startAt) { while (proxy) { if (proxy.getPlugin() === startAt) { return proxy; } proxy = proxy.getNext(); } return createTelemetryProxyChain([startAt], core.config || {}, core); } function _createInternalContext(telemetryChain, config, core, startAt) { var _nextProxy = null; var _onComplete = []; if (startAt !== null) { _nextProxy = startAt ? _getNextProxyStart(telemetryChain, core, startAt) : telemetryChain; } var context = { _next: _moveNext, ctx: { core: function () { return core; }, diagLog: function () { return safeGetLogger(core, config); }, getCfg: function () { return config; }, getExtCfg: _getExtCfg, getConfig: _getConfig, hasNext: function () { return !!_nextProxy; }, getNext: function () { return _nextProxy; }, setNext: function (nextPlugin) { _nextProxy = nextPlugin; }, iterate: _iterateChain, onComplete: _addOnComplete } }; function _addOnComplete(onComplete, that) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } if (onComplete) { _onComplete.push({ func: onComplete, self: !isUndefined(that) ? that : context.ctx, args: args }); } } function _moveNext() { var nextProxy = _nextProxy; _nextProxy = nextProxy ? nextProxy.getNext() : null; if (!nextProxy) { var onComplete = _onComplete; if (onComplete && onComplete.length > 0) { arrForEach(onComplete, function (completeDetails) { try { completeDetails.func.call(completeDetails.self, completeDetails.args); } catch (e) { _throwInternal(core.logger, 2 , 73 , "Unexpected Exception during onComplete - " + dumpObj(e)); } }); _onComplete = []; } } return nextProxy; } function _getExtCfg(identifier, defaultValue, mergeDefault) { if (defaultValue === void 0) { defaultValue = {}; } if (mergeDefault === void 0) { mergeDefault = 0 ; } var theConfig; if (config) { var extConfig = config.extensionConfig; if (extConfig && identifier) { theConfig = extConfig[identifier]; } } if (!theConfig) { theConfig = defaultValue; } else if (isObject(defaultValue)) { if (mergeDefault !== 0 ) { var newConfig_1 = objExtend(true, defaultValue, theConfig); if (config && mergeDefault === 2 ) { objForEachKey(defaultValue, function (field) { if (isNullOrUndefined(newConfig_1[field])) { var cfgValue = config[field]; if (!isNullOrUndefined(cfgValue)) { newConfig_1[field] = cfgValue; } } }); } theConfig = newConfig_1; } } return theConfig; } function _getConfig(identifier, field, defaultValue) { if (defaultValue === void 0) { defaultValue = false; } var theValue; var extConfig = _getExtCfg(identifier, null); if (extConfig && !isNullOrUndefined(extConfig[field])) { theValue = extConfig[field]; } else if (config && !isNullOrUndefined(config[field])) { theValue = config[field]; } return !isNullOrUndefined(theValue) ? theValue : defaultValue; } function _iterateChain(cb) { var nextPlugin; while (!!(nextPlugin = context._next())) { var plugin = nextPlugin.getPlugin(); if (plugin) { cb(plugin); } } } return context; } function createProcessTelemetryContext(telemetryChain, config, core, startAt) { var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(env) { var nextPlugin = internalContext._next(); nextPlugin && nextPlugin.processTelemetry(env, context); return !nextPlugin; } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryContext(plugins || context.getNext(), config, core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } function createProcessTelemetryUnloadContext(telemetryChain, core, startAt) { var config = core.config || {}; var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(unloadState) { var nextPlugin = internalContext._next(); nextPlugin && nextPlugin.unload(context, unloadState); return !nextPlugin; } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryUnloadContext(plugins || context.getNext(), core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } function createProcessTelemetryUpdateContext(telemetryChain, core, startAt) { var config = core.config || {}; var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(updateState) { return context.iterate(function (plugin) { if (isFunction(plugin.update)) { plugin.update(context, updateState); } }); } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryUpdateContext(plugins || context.getNext(), core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } function createTelemetryProxyChain(plugins, config, core, startAt) { var firstProxy = null; var add = startAt ? false : true; if (isArray(plugins) && plugins.length > 0) { var lastProxy_1 = null; arrForEach(plugins, function (thePlugin) { if (!add && startAt === thePlugin) { add = true; } if (add && thePlugin && isFunction(thePlugin.processTelemetry)) { var newProxy = createTelemetryPluginProxy(thePlugin, config, core); if (!firstProxy) { firstProxy = newProxy; } if (lastProxy_1) { lastProxy_1._setNext(newProxy); } lastProxy_1 = newProxy; } }); } if (startAt && !firstProxy) { return createTelemetryProxyChain([startAt], config, core); } return firstProxy; } function createTelemetryPluginProxy(plugin, config, core) { var nextProxy = null; var hasProcessTelemetry = isFunction(plugin.processTelemetry); var hasSetNext = isFunction(plugin.setNextPlugin); var chainId; if (plugin) { chainId = plugin.identifier + "-" + plugin.priority + "-" + _chainId++; } else { chainId = "Unknown-0-" + _chainId++; } var proxyChain = { getPlugin: function () { return plugin; }, getNext: function () { return nextProxy; }, processTelemetry: _processTelemetry, unload: _unloadPlugin, update: _updatePlugin, _id: chainId, _setNext: function (nextPlugin) { nextProxy = nextPlugin; } }; function _getTelCtx() { var itemCtx; if (plugin && isFunction(plugin[strGetTelCtx])) { itemCtx = plugin[strGetTelCtx](); } if (!itemCtx) { itemCtx = createProcessTelemetryContext(proxyChain, config, core); } return itemCtx; } function _processChain(itemCtx, processPluginFn, name, details, isAsync) { var hasRun = false; var identifier = plugin ? plugin.identifier : strTelemetryPluginChain; var hasRunContext = itemCtx[strHasRunFlags]; if (!hasRunContext) { hasRunContext = itemCtx[strHasRunFlags] = {}; } itemCtx.setNext(nextProxy); if (plugin) { doPerf(itemCtx[strCore](), function () { return identifier + ":" + name; }, function () { hasRunContext[chainId] = true; try { var nextId = nextProxy ? nextProxy._id : strEmpty; if (nextId) { hasRunContext[nextId] = false; } hasRun = processPluginFn(itemCtx); } catch (error) { var hasNextRun = nextProxy ? hasRunContext[nextProxy._id] : true; if (hasNextRun) { hasRun = true; } if (!nextProxy || !hasNextRun) { _throwInternal(itemCtx.diagLog(), 1 , 73 , "Plugin [" + identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext)); } } }, details, isAsync); } return hasRun; } function _processTelemetry(env, itemCtx) { itemCtx = itemCtx || _getTelCtx(); function _callProcessTelemetry(itemCtx) { if (!plugin || !hasProcessTelemetry) { return false; } var pluginState = _getPluginState(plugin); if (pluginState.teardown || pluginState[strDisabled]) { return false; } if (hasSetNext) { plugin.setNextPlugin(nextProxy); } plugin.processTelemetry(env, itemCtx); return true; } if (!_processChain(itemCtx, _callProcessTelemetry, "processTelemetry", function () { return ({ item: env }); }, !(env.sync))) { itemCtx.processNext(env); } } function _unloadPlugin(unloadCtx, unloadState) { function _callTeardown() { var hasRun = false; if (plugin) { var pluginState = _getPluginState(plugin); var pluginCore = plugin[strCore] || pluginState.core; if (plugin && (!pluginCore || pluginCore === unloadCtx[strCore]()) && !pluginState[strTeardown]) { pluginState[strCore] = null; pluginState[strTeardown] = true; pluginState[strIsInitialized] = false; if (plugin[strTeardown] && plugin[strTeardown](unloadCtx, unloadState) === true) { hasRun = true; } } } return hasRun; } if (!_processChain(unloadCtx, _callTeardown, "unload", function () { }, unloadState.isAsync)) { unloadCtx.processNext(unloadState); } } function _updatePlugin(updateCtx, updateState) { function _callUpdate() { var hasRun = false; if (plugin) { var pluginState = _getPluginState(plugin); var pluginCore = plugin[strCore] || pluginState.core; if (plugin && (!pluginCore || pluginCore === updateCtx[strCore]()) && !pluginState[strTeardown]) { if (plugin[strUpdate] && plugin[strUpdate](updateCtx, updateState) === true) { hasRun = true; } } } return hasRun; } if (!_processChain(updateCtx, _callUpdate, "update", function () { }, false)) { updateCtx.processNext(updateState); } } return objFreeze(proxyChain); } var strExtensionConfig = "extensionConfig"; function createUnloadHandlerContainer() { var handlers = []; function _addHandler(handler) { if (handler) { handlers.push(handler); } } function _runHandlers(unloadCtx, unloadState) { arrForEach(handlers, function (handler) { try { handler(unloadCtx, unloadState); } catch (e) { _throwInternal(unloadCtx.diagLog(), 2 , 73 , "Unexpected error calling unload handler - " + dumpObj(e)); } }); handlers = []; } return { add: _addHandler, run: _runHandlers }; } var strGetPlugin = "getPlugin"; var BaseTelemetryPlugin = /** @class */ (function () { function BaseTelemetryPlugin() { var _self = this; var _isinitialized; var _rootCtx; var _nextPlugin; var _unloadHandlerContainer; var _hooks; _initDefaults(); dynamicProto(BaseTelemetryPlugin, _self, function (_self) { _self.initialize = function (config, core, extensions, pluginChain) { _setDefaults(config, core, pluginChain); _isinitialized = true; }; _self.teardown = function (unloadCtx, unloadState) { var core = _self.core; if (!core || (unloadCtx && core !== unloadCtx.core())) { return; } var result; var unloadDone = false; var theUnloadCtx = unloadCtx || createProcessTelemetryUnloadContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin); var theUnloadState = unloadState || { reason: 0 , isAsync: false }; function _unloadCallback() { if (!unloadDone) { unloadDone = true; _unloadHandlerContainer.run(theUnloadCtx, unloadState); arrForEach(_hooks, function (fn) { fn.rm(); }); _hooks = []; if (result === true) { theUnloadCtx.processNext(theUnloadState); } _initDefaults(); } } if (!_self[strDoTeardown] || _self[strDoTeardown](theUnloadCtx, theUnloadState, _unloadCallback) !== true) { _unloadCallback(); } else { result = true; } return result; }; _self.update = function (updateCtx, updateState) { var core = _self.core; if (!core || (updateCtx && core !== updateCtx.core())) { return; } var result; var updateDone = false; var theUpdateCtx = updateCtx || createProcessTelemetryUpdateContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin); var theUpdateState = updateState || { reason: 0 }; function _updateCallback() { if (!updateDone) { updateDone = true; _setDefaults(theUpdateCtx.getCfg(), theUpdateCtx.core(), theUpdateCtx.getNext()); } } if (!_self._doUpdate || _self._doUpdate(theUpdateCtx, theUpdateState, _updateCallback) !== true) { _updateCallback(); } else { result = true; } return result; }; _self._addHook = function (hooks) { if (hooks) { if (isArray(hooks)) { _hooks = _hooks.concat(hooks); } else { _hooks.push(hooks); } } }; proxyFunctionAs(_self, "_addUnloadCb", function () { return _unloadHandlerContainer; }, "add"); }); _self.diagLog = function (itemCtx) { return _getTelCtx(itemCtx).diagLog(); }; _self[strIsInitialized] = function () { return _isinitialized; }; _self.setInitialized = function (isInitialized) { _isinitialized = isInitialized; }; _self[strSetNextPlugin] = function (next) { _nextPlugin = next; }; _self.processNext = function (env, itemCtx) { if (itemCtx) { itemCtx.processNext(env); } else if (_nextPlugin && isFunction(_nextPlugin.processTelemetry)) { _nextPlugin.processTelemetry(env, null); } }; _self._getTelCtx = _getTelCtx; function _getTelCtx(currentCtx) { if (currentCtx === void 0) { currentCtx = null; } var itemCtx = currentCtx; if (!itemCtx) { var rootCtx = _rootCtx || createProcessTelemetryContext(null, {}, _self.core); if (_nextPlugin && _nextPlugin[strGetPlugin]) { itemCtx = rootCtx.createNew(null, _nextPlugin[strGetPlugin]); } else { itemCtx = rootCtx.createNew(null, _nextPlugin); } } return itemCtx; } function _setDefaults(config, core, pluginChain) { if (config) { setValue(config, strExtensionConfig, [], null, isNullOrUndefined); } if (!pluginChain && core) { pluginChain = core.getProcessTelContext().getNext(); } var nextPlugin = _nextPlugin; if (_nextPlugin && _nextPlugin[strGetPlugin]) { nextPlugin = _nextPlugin[strGetPlugin](); } _self.core = core; _rootCtx = createProcessTelemetryContext(pluginChain, config, core, nextPlugin); } function _initDefaults() { _isinitialized = false; _self.core = null; _rootCtx = null; _nextPlugin = null; _hooks = []; _unloadHandlerContainer = createUnloadHandlerContainer(); } } return BaseTelemetryPlugin; }()); var strOnPrefix = "on"; var strAttachEvent = "attachEvent"; var strAddEventHelper = "addEventListener"; var strDetachEvent = "detachEvent"; var strRemoveEventListener = "removeEventListener"; var strEvents = "events"; var strVisibilityChangeEvt = "visibilitychange"; var strPageHide = "pagehide"; var strPageShow = "pageshow"; var strUnload = "unload"; var strBeforeUnload = "beforeunload"; var strPageHideNamespace = createUniqueNamespace("aiEvtPageHide"); var strPageShowNamespace = createUniqueNamespace("aiEvtPageShow"); var rRemoveEmptyNs = /\.[\.]+/g; var rRemoveTrailingEmptyNs = /[\.]+$/; var _guid = 1; var elmNodeData = createElmNodeData("events"); var eventNamespace = /^([^.]*)(?:\.(.+)|)/; function _normalizeNamespace(name) { if (name && name.replace) { return name.replace(/^\s*\.*|\.*\s*$/g, ""); } return name; } function _getEvtNamespace(eventName, evtNamespace) { if (evtNamespace) { var theNamespace_1 = ""; if (isArray(evtNamespace)) { theNamespace_1 = ""; arrForEach(evtNamespace, function (name) { name = _normalizeNamespace(name); if (name) { if (name[0] !== ".") { name = "." + name; } theNamespace_1 += name; } }); } else { theNamespace_1 = _normalizeNamespace(evtNamespace); } if (theNamespace_1) { if (theNamespace_1[0] !== ".") { theNamespace_1 = "." + theNamespace_1; } eventName = (eventName || "") + theNamespace_1; } } var parsedEvent = (eventNamespace.exec(eventName || "") || []); return { type: parsedEvent[1], ns: ((parsedEvent[2] || "").replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, "").split(".").sort()).join(".") }; } function _getRegisteredEvents(target, evtName, addDefault) { if (addDefault === void 0) { addDefault = true; } var aiEvts = elmNodeData.get(target, strEvents, {}, addDefault); var registeredEvents = aiEvts[evtName]; if (!registeredEvents) { registeredEvents = aiEvts[evtName] = []; } return registeredEvents; } function _doDetach(obj, evtName, handlerRef, useCapture) { if (obj && evtName && evtName.type) { if (obj[strRemoveEventListener]) { obj[strRemoveEventListener](evtName.type, handlerRef, useCapture); } else if (obj[strDetachEvent]) { obj[strDetachEvent](strOnPrefix + evtName.type, handlerRef); } } } function _doAttach(obj, evtName, handlerRef, useCapture) { var result = false; if (obj && evtName && evtName.type && handlerRef) { if (obj[strAddEventHelper]) { obj[strAddEventHelper](evtName.type, handlerRef, useCapture); result = true; } else if (obj[strAttachEvent]) { obj[strAttachEvent](strOnPrefix + evtName.type, handlerRef); result = true; } } return result; } function _doUnregister(target, events, evtName, unRegFn) { var idx = events.length; while (idx--) { var theEvent = events[idx]; if (theEvent) { if (!evtName.ns || evtName.ns === theEvent.evtName.ns) { if (!unRegFn || unRegFn(theEvent)) { _doDetach(target, theEvent.evtName, theEvent.handler, theEvent.capture); events.splice(idx, 1); } } } } } function _unregisterEvents(target, evtName, unRegFn) { if (evtName.type) { _doUnregister(target, _getRegisteredEvents(target, evtName.type), evtName, unRegFn); } else { var eventCache = elmNodeData.get(target, strEvents, {}); objForEachKey(eventCache, function (evtType, events) { _doUnregister(target, events, evtName, unRegFn); }); if (objKeys(eventCache).length === 0) { elmNodeData.kill(target, strEvents); } } } function mergeEvtNamespace(theNamespace, namespaces) { var newNamespaces; if (namespaces) { if (isArray(namespaces)) { newNamespaces = [theNamespace].concat(namespaces); } else { newNamespaces = [theNamespace, namespaces]; } newNamespaces = (_getEvtNamespace("xx", newNamespaces).ns).split("."); } else { newNamespaces = theNamespace; } return newNamespaces; } function eventOn(target, eventName, handlerRef, evtNamespace, useCapture) { if (useCapture === void 0) { useCapture = false; } var result = false; if (target) { try { var evtName = _getEvtNamespace(eventName, evtNamespace); result = _doAttach(target, evtName, handlerRef, useCapture); if (result && elmNodeData.accept(target)) { var registeredEvent = { guid: _guid++, evtName: evtName, handler: handlerRef, capture: useCapture }; _getRegisteredEvents(target, evtName.type).push(registeredEvent); } } catch (e) { } } return result; } function eventOff(target, eventName, handlerRef, evtNamespace, useCapture) { if (useCapture === void 0) { useCapture = false; } if (target) { try { var evtName_1 = _getEvtNamespace(eventName, evtNamespace); var found_1 = false; _unregisterEvents(target, evtName_1, function (regEvent) { if ((evtName_1.ns && !handlerRef) || regEvent.handler === handlerRef) { found_1 = true; return true; } return false; }); if (!found_1) { _doDetach(target, evtName_1, handlerRef, useCapture); } } catch (e) { } } } function addEventHandler(eventName, callback, evtNamespace) { var result = false; var w = getWindow(); if (w) { result = eventOn(w, eventName, callback, evtNamespace); result = eventOn(w["body"], eventName, callback, evtNamespace) || result; } var doc = getDocument(); if (doc) { result = eventOn(doc, eventName, callback, evtNamespace) || result; } return result; } function removeEventHandler(eventName, callback, evtNamespace) { var w = getWindow(); if (w) { eventOff(w, eventName, callback, evtNamespace); eventOff(w["body"], eventName, callback, evtNamespace); } var doc = getDocument(); if (doc) { eventOff(doc, eventName, callback, evtNamespace); } } function _addEventListeners(events, listener, excludeEvents, evtNamespace) { var added = false; if (listener && events && events.length > 0) { arrForEach(events, function (name) { if (name) { if (!excludeEvents || arrIndexOf(excludeEvents, name) === -1) { added = addEventHandler(name, listener, evtNamespace) || added; } } }); } return added; } function addEventListeners(events, listener, excludeEvents, evtNamespace) { var added = false; if (listener && events && isArray(events)) { added = _addEventListeners(events, listener, excludeEvents, evtNamespace); if (!added && excludeEvents && excludeEvents.length > 0) { added = _addEventListeners(events, listener, null, evtNamespace); } } return added; } function removeEventListeners(events, listener, evtNamespace) { if (events && isArray(events)) { arrForEach(events, function (name) { if (name) { removeEventHandler(name, listener, evtNamespace); } }); } } function addPageUnloadEventListener(listener, excludeEvents, evtNamespace) { return addEventListeners([strBeforeUnload, strUnload, strPageHide], listener, excludeEvents, evtNamespace); } function removePageUnloadEventListener(listener, evtNamespace) { removeEventListeners([strBeforeUnload, strUnload, strPageHide], listener, evtNamespace); } function addPageHideEventListener(listener, excludeEvents, evtNamespace) { function _handlePageVisibility(evt) { var doc = getDocument(); if (listener && doc && doc.visibilityState === "hidden") { listener(evt); } } var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace); var pageUnloadAdded = _addEventListeners([strPageHide], listener, excludeEvents, newNamespaces); if (!excludeEvents || arrIndexOf(excludeEvents, strVisibilityChangeEvt) === -1) { pageUnloadAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageUnloadAdded; } if (!pageUnloadAdded && excludeEvents) { pageUnloadAdded = addPageHideEventListener(listener, null, evtNamespace); } return pageUnloadAdded; } function removePageHideEventListener(listener, evtNamespace) { var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace); removeEventListeners([strPageHide], listener, newNamespaces); removeEventListeners([strVisibilityChangeEvt], null, newNamespaces); } function addPageShowEventListener(listener, excludeEvents, evtNamespace) { function _handlePageVisibility(evt) { var doc = getDocument(); if (listener && doc && doc.visibilityState === "visible") { listener(evt); } } var newNamespaces = mergeEvtNamespace(strPageShowNamespace, evtNamespace); var pageShowAdded = _addEventListeners([strPageShow], listener, excludeEvents, newNamespaces); pageShowAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageShowAdded; if (!pageShowAdded && excludeEvents) { pageShowAdded = addPageShowEventListener(listener, null, evtNamespace); } return pageShowAdded; } function removePageShowEventListener(listener, evtNamespace) { var newNamespaces = mergeEvtNamespace(strPageShowNamespace, evtNamespace); removeEventListeners([strPageShow], listener, newNamespaces); removeEventListeners([strVisibilityChangeEvt], null, newNamespaces); } function perfNow() { var perf = getPerformance(); if (perf && perf.now) { return perf.now(); } return dateNow(); } var _a$1; var Version = '3.2.2'; var FullVersionString = "1DS-Web-JS-" + Version; var strDisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation"; var strWithCredentials = "withCredentials"; var strTimeout = "timeout"; var _fieldTypeEventPropMap = (_a$1 = {}, _a$1[0 ] = 0 , _a$1[2 ] = 6 , _a$1[1 ] = 1 , _a$1[3 ] = 7 , _a$1[4096 | 2 ] = 6 , _a$1[4096 | 1 ] = 1 , _a$1[4096 | 3 ] = 7 , _a$1); Boolean(getDocument()); Boolean(getWindow()); function isValueAssigned(value) { return !(value === "" || isNullOrUndefined(value)); } function getTenantId(apiKey) { if (apiKey) { var indexTenantId = apiKey.indexOf("-"); if (indexTenantId > -1) { return apiKey.substring(0, indexTenantId); } } return ""; } function sanitizeProperty(name, property, stringifyObjects) { if ((!property && !isValueAssigned(property)) || typeof name !== "string") { return null; } var propType = typeof property; if (propType === "string" || propType === "number" || propType === "boolean" || isArray(property)) { property = { value: property }; } else if (propType === "object" && !property.hasOwnProperty("value")) { property = { value: stringifyObjects ? JSON.stringify(property) : property }; } else if (isNullOrUndefined(property.value) || property.value === "" || (!isString(property.value) && !isNumber(property.value) && !isBoolean(property.value) && !isArray(property.value))) { return null; } if (isArray(property.value) && !isArrayValid(property.value)) { return null; } if (!isNullOrUndefined(property.kind)) { if (isArray(property.value) || !isValueKind(property.kind)) { return null; } property.value = property.value.toString(); } return property; } function getCommonSchemaMetaData(value, kind, type) { var encodedTypeValue = -1; if (!isUndefined(value)) { if (kind > 0) { if (kind === 32) { encodedTypeValue = (1 << 13); } else if (kind <= 13) { encodedTypeValue = (kind << 5); } } if (isDataType(type)) { if (encodedTypeValue === -1) { encodedTypeValue = 0; } encodedTypeValue |= type; } else { var propType = _fieldTypeEventPropMap[getFieldValueType(value)] || -1; if (encodedTypeValue !== -1 && propType !== -1) { encodedTypeValue |= propType; } else if (propType === 6 ) { encodedTypeValue = propType; } } } return encodedTypeValue; } function extend(obj, obj2, obj3, obj4, obj5) { var extended = {}; var deep = false; var i = 0; var length = arguments.length; var objProto = Object[strShimPrototype]; var theArgs = arguments; if (objProto.toString.call(theArgs[0]) === "[object Boolean]") { deep = theArgs[0]; i++; } for (; i < length; i++) { var obj = theArgs[i]; objForEachKey(obj, function (prop, value) { if (deep && value && isObject(value)) { if (isArray(value)) { extended[prop] = extended[prop] || []; arrForEach(value, function (arrayValue, arrayIndex) { if (arrayValue && isObject(arrayValue)) { extended[prop][arrayIndex] = extend(true, extended[prop][arrayIndex], arrayValue); } else { extended[prop][arrayIndex] = arrayValue; } }); } else { extended[prop] = extend(true, extended[prop], value); } } else { extended[prop] = value; } }); } return extended; } var getTime = perfNow; function isValueKind(value) { if (value === 0 || ((value > 0 && value <= 13 ) || value === 32 )) { return true; } return false; } function isDataType(value) { if (value >= 0 && value <= 9) { return true; } return false; } function isArrayValid(value) { return value.length > 0; } function setProcessTelemetryTimings(event, identifier) { var evt = event; evt.timings = evt.timings || {}; evt.timings.processTelemetryStart = evt.timings.processTelemetryStart || {}; evt.timings.processTelemetryStart[identifier] = getTime(); } function getFieldValueType(value) { var theType = 0 ; if (value !== null && value !== undefined) { var objType = typeof value; if (objType === "string") { theType = 1 ; } else if (objType === "number") { theType = 2 ; } else if (objType === "boolean") { theType = 3 ; } else if (objType === strShimObject) { theType = 4 ; if (isArray(value)) { theType = 4096 ; if (value.length > 0) { theType |= getFieldValueType(value[0]); } } else if (hasOwnProperty(value, "value")) { theType = 8192 | getFieldValueType(value.value); } } } return theType; } function isChromium() { return !!getGlobalInst("chrome"); } function openXhr(method, urlString, withCredentials, disabled, isSync, timeout) { if (disabled === void 0) { disabled = false; } if (isSync === void 0) { isSync = false; } function _wrapSetXhrProp(xhr, prop, value) { try { xhr[prop] = value; } catch (e) { } } var xhr = new XMLHttpRequest(); if (disabled) { _wrapSetXhrProp(xhr, strDisabledPropertyName, disabled); } if (withCredentials) { _wrapSetXhrProp(xhr, strWithCredentials, withCredentials); } xhr.open(method, urlString, !isSync); if (withCredentials) { _wrapSetXhrProp(xhr, strWithCredentials, withCredentials); } if (!isSync && timeout) { _wrapSetXhrProp(xhr, strTimeout, timeout); } return xhr; } var RT_PROFILE = "REAL_TIME"; var NRT_PROFILE = "NEAR_REAL_TIME"; var BE_PROFILE = "BEST_EFFORT"; var Method = "POST"; var DisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation"; var strDropped = "drop"; var strSending = "send"; var strRequeue = "requeue"; var strResponseFail = "rspFail"; var strOther = "oth"; var defaultCacheControl = "no-cache, no-store"; var defaultContentType = "application/x-json-stream"; var strCacheControl = "cache-control"; var strContentTypeHeader = "content-type"; var strKillTokensHeader = "kill-tokens"; var strKillDurationHeader = "kill-duration"; var strKillDurationSecondsHeader = "kill-duration-seconds"; var strTimeDeltaHeader = "time-delta-millis"; var strClientVersion = "client-version"; var strClientId = "client-id"; var strTimeDeltaToApply = "time-delta-to-apply-millis"; var strUploadTime = "upload-time"; var strApiKey = "apikey"; var strMsaDeviceTicket = "AuthMsaDeviceTicket"; var strAuthXToken = "AuthXToken"; var strNoResponseBody = "NoResponseBody"; var strMsfpc = "msfpc"; function _getEventMsfpc(theEvent) { var intWeb = ((theEvent.ext || {})["intweb"]); if (intWeb && isValueAssigned(intWeb[strMsfpc])) { return intWeb[strMsfpc]; } return null; } function _getMsfpc(theEvents) { var msfpc = null; for (var lp = 0; msfpc === null && lp < theEvents.length; lp++) { msfpc = _getEventMsfpc(theEvents[lp]); } return msfpc; } var EventBatch = /** @class */ (function () { function EventBatch(iKey, addEvents) { var events = addEvents ? [].concat(addEvents) : []; var _self = this; var _msfpc = _getMsfpc(events); _self.iKey = function () { return iKey; }; _self.Msfpc = function () { return _msfpc || ""; }; _self.count = function () { return events.length; }; _self.events = function () { return events; }; _self.addEvent = function (theEvent) { if (theEvent) { events.push(theEvent); if (!_msfpc) { _msfpc = _getEventMsfpc(theEvent); } return true; } return false; }; _self.split = function (fromEvent, numEvents) { var theEvents; if (fromEvent < events.length) { var cnt = events.length - fromEvent; if (!isNullOrUndefined(numEvents)) { cnt = numEvents < cnt ? numEvents : cnt; } theEvents = events.splice(fromEvent, cnt); _msfpc = _getMsfpc(events); } return new EventBatch(iKey, theEvents); }; } EventBatch.create = function (iKey, theEvents) { return new EventBatch(iKey, theEvents); }; return EventBatch; }()); var _MAX_STRING_JOINS = 20; var RequestSizeLimitBytes = 3984588; var BeaconRequestSizeLimitBytes = 65000; var MaxRecordSize = 2000000; var MaxBeaconRecordSize = Math.min(MaxRecordSize, BeaconRequestSizeLimitBytes); var metadata = "metadata"; var f = "f"; var rCheckDot = /\./; var Serializer = /** @class */ (function () { function Serializer(perfManager, valueSanitizer, stringifyObjects, enableCompoundKey) { var strData = "data"; var strBaseData = "baseData"; var strExt = "ext"; var _checkForCompoundkey = !!enableCompoundKey; var _processSubMetaData = true; var _theSanitizer = valueSanitizer; var _isReservedCache = {}; dynamicProto(Serializer, this, function (_self) { _self.createPayload = function (retryCnt, isTeardown, isSync, useSendBeacon, sendReason, sendType) { return { apiKeys: [], payloadBlob: "", overflow: null, sizeExceed: [], failedEvts: [], batches: [], numEvents: 0, retryCnt: retryCnt, isTeardown: isTeardown, isSync: isSync, isBeacon: useSendBeacon, sendType: sendType, sendReason: sendReason }; }; _self.appendPayload = function (payload, theBatch, maxEventsPerBatch) { var canAddEvents = payload && theBatch && !payload.overflow; if (canAddEvents) { doPerf(perfManager, function () { return "Serializer:appendPayload"; }, function () { var theEvents = theBatch.events(); var payloadBlob = payload.payloadBlob; var payloadEvents = payload.numEvents; var eventsAdded = false; var sizeExceeded = []; var failedEvts = []; var isBeaconPayload = payload.isBeacon; var requestMaxSize = isBeaconPayload ? BeaconRequestSizeLimitBytes : RequestSizeLimitBytes; var recordMaxSize = isBeaconPayload ? MaxBeaconRecordSize : MaxRecordSize; var lp = 0; var joinCount = 0; while (lp < theEvents.length) { var theEvent = theEvents[lp]; if (theEvent) { if (payloadEvents >= maxEventsPerBatch) { payload.overflow = theBatch.split(lp); break; } var eventBlob = _self.getEventBlob(theEvent); if (eventBlob && eventBlob.length <= recordMaxSize) { var blobLength = eventBlob.length; var currentSize = payloadBlob.length; if (currentSize + blobLength > requestMaxSize) { payload.overflow = theBatch.split(lp); break; } if (payloadBlob) { payloadBlob += "\n"; } payloadBlob += eventBlob; joinCount++; if (joinCount > _MAX_STRING_JOINS) { payloadBlob.substr(0, 1); joinCount = 0; } eventsAdded = true; payloadEvents++; } else { if (eventBlob) { sizeExceeded.push(theEvent); } else { failedEvts.push(theEvent); } theEvents.splice(lp, 1); lp--; } } lp++; } if (sizeExceeded && sizeExceeded.length > 0) { payload.sizeExceed.push(EventBatch.create(theBatch.iKey(), sizeExceeded)); } if (failedEvts && failedEvts.length > 0) { payload.failedEvts.push(EventBatch.create(theBatch.iKey(), failedEvts)); } if (eventsAdded) { payload.batches.push(theBatch); payload.payloadBlob = payloadBlob; payload.numEvents = payloadEvents; var apiKey = theBatch.iKey(); if (arrIndexOf(payload.apiKeys, apiKey) === -1) { payload.apiKeys.push(apiKey); } } }, function () { return ({ payload: payload, theBatch: { iKey: theBatch.iKey(), evts: theBatch.events() }, max: maxEventsPerBatch }); }); } return canAddEvents; }; _self.getEventBlob = function (eventData) { try { return doPerf(perfManager, function () { return "Serializer.getEventBlob"; }, function () { var serializedEvent = {}; serializedEvent.name = eventData.name; serializedEvent.time = eventData.time; serializedEvent.ver = eventData.ver; serializedEvent.iKey = "o:" + getTenantId(eventData.iKey); var serializedExt = {}; var eventExt = eventData[strExt]; if (eventExt) { serializedEvent[strExt] = serializedExt; objForEachKey(eventExt, function (key, value) { var data = serializedExt[key] = {}; _processPathKeys(value, data, "ext." + key, true, null, null, true); }); } var serializedData = serializedEvent[strData] = {}; serializedData.baseType = eventData.baseType; var serializedBaseData = serializedData[strBaseData] = {}; _processPathKeys(eventData.baseData, serializedBaseData, strBaseData, false, [strBaseData], function (pathKeys, name, value) { _addJSONPropertyMetaData(serializedExt, pathKeys, name, value); }, _processSubMetaData); _processPathKeys(eventData.data, serializedData, strData, false, [], function (pathKeys, name, value) { _addJSONPropertyMetaData(serializedExt, pathKeys, name, value); }, _processSubMetaData); return JSON.stringify(serializedEvent); }, function () { return ({ item: eventData }); }); } catch (e) { return null; } }; function _isReservedField(path, name) { var result = _isReservedCache[path]; if (result === undefined) { if (path.length >= 7) { result = strStartsWith(path, "ext.metadata") || strStartsWith(path, "ext.web"); } _isReservedCache[path] = result; } return result; } function _processPathKeys(srcObj, target, thePath, checkReserved, metadataPathKeys, metadataCallback, processSubKeys) { objForEachKey(srcObj, function (key, srcValue) { var prop = null; if (srcValue || isValueAssigned(srcValue)) { var path = thePath; var name_1 = key; var theMetaPathKeys = metadataPathKeys; var destObj = target; if (_checkForCompoundkey && !checkReserved && rCheckDot.test(key)) { var subKeys = key.split("."); var keyLen = subKeys.length; if (keyLen > 1) { if (theMetaPathKeys) { theMetaPathKeys = theMetaPathKeys.slice(); } for (var lp = 0; lp < keyLen - 1; lp++) { var subKey = subKeys[lp]; destObj = destObj[subKey] = destObj[subKey] || {}; path += "." + subKey; if (theMetaPathKeys) { theMetaPathKeys.push(subKey); } } name_1 = subKeys[keyLen - 1]; } } var isReserved = checkReserved && _isReservedField(path); if (!isReserved && _theSanitizer && _theSanitizer.handleField(path, name_1)) { prop = _theSanitizer.value(path, name_1, srcValue, stringifyObjects); } else { prop = sanitizeProperty(name_1, srcValue, stringifyObjects); } if (prop) { var newValue = prop.value; destObj[name_1] = newValue; if (metadataCallback) { metadataCallback(theMetaPathKeys, name_1, prop); } if (processSubKeys && typeof newValue === "object" && !isArray(newValue)) { var newPath = theMetaPathKeys; if (newPath) { newPath = newPath.slice(); newPath.push(name_1); } _processPathKeys(srcValue, newValue, path + "." + name_1, checkReserved, newPath, metadataCallback, processSubKeys); } } } }); } }); } return Serializer; }()); function _addJSONPropertyMetaData(json, propKeys, name, propertyValue) { if (propertyValue && json) { var encodedTypeValue = getCommonSchemaMetaData(propertyValue.value, propertyValue.kind, propertyValue.propertyType); if (encodedTypeValue > -1) { var metaData = json[metadata]; if (!metaData) { metaData = json[metadata] = { f: {} }; } var metaTarget = metaData[f]; if (!metaTarget) { metaTarget = metaData[f] = {}; } if (propKeys) { for (var lp = 0; lp < propKeys.length; lp++) { var key = propKeys[lp]; if (!metaTarget[key]) { metaTarget[key] = { f: {} }; } var newTarget = metaTarget[key][f]; if (!newTarget) { newTarget = metaTarget[key][f] = {}; } metaTarget = newTarget; } } metaTarget = metaTarget[name] = {}; if (isArray(propertyValue.value)) { metaTarget["a"] = { t: encodedTypeValue }; } else { metaTarget["t"] = encodedTypeValue; } } } } var RandomizationLowerThreshold = 0.8; var RandomizationUpperThreshold = 1.2; var BaseBackoff = 3000; var MaxBackoff = 600000; function retryPolicyShouldRetryForStatus(httpStatusCode) { return !((httpStatusCode >= 300 && httpStatusCode < 500 && httpStatusCode != 408 && httpStatusCode != 429) || (httpStatusCode == 501) || (httpStatusCode == 505)); } function retryPolicyGetMillisToBackoffForRetry(retriesSoFar) { var waitDuration = 0; var minBackoff = BaseBackoff * RandomizationLowerThreshold; var maxBackoff = BaseBackoff * RandomizationUpperThreshold; var randomBackoff = Math.floor(Math.random() * (maxBackoff - minBackoff)) + minBackoff; waitDuration = Math.pow(2, retriesSoFar) * randomBackoff; return Math.min(waitDuration, MaxBackoff); } var SecToMsMultiplier = 1000; var KillSwitch = /** @class */ (function () { function KillSwitch() { var _killedTokenDictionary = {}; function _normalizeTenants(values) { var result = []; if (values) { arrForEach(values, function (value) { result.push(strTrim(value)); }); } return result; } dynamicProto(KillSwitch, this, function (_self) { _self.setKillSwitchTenants = function (killTokens, killDuration) { if (killTokens && killDuration) { try { var killedTokens = _normalizeTenants(killTokens.split(",")); if (killDuration === "this-request-only") { return killedTokens; } var durationMs = parseInt(killDuration, 10) * SecToMsMultiplier; for (var i = 0; i < killedTokens.length; ++i) { _killedTokenDictionary[killedTokens[i]] = dateNow() + durationMs; } } catch (ex) { return []; } } return []; }; _self.isTenantKilled = function (tenantToken) { var killDictionary = _killedTokenDictionary; var name = strTrim(tenantToken); if (killDictionary[name] !== undefined && killDictionary[name] > dateNow()) { return true; } delete killDictionary[name]; return false; }; }); } return KillSwitch; }()); var EVTKillSwitch = KillSwitch; var ClockSkewManager = /** @class */ (function () { function ClockSkewManager() { var _allowRequestSending = true; var _shouldAddClockSkewHeaders = true; var _isFirstRequest = true; var _clockSkewHeaderValue = "use-collector-delta"; var _clockSkewSet = false; dynamicProto(ClockSkewManager, this, function (_self) { _self.allowRequestSending = function () { return _allowRequestSending; }; _self.firstRequestSent = function () { if (_isFirstRequest) { _isFirstRequest = false; if (!_clockSkewSet) { _allowRequestSending = false; } } }; _self.shouldAddClockSkewHeaders = function () { return _shouldAddClockSkewHeaders; }; _self.getClockSkewHeaderValue = function () { return _clockSkewHeaderValue; }; _self.setClockSkew = function (timeDeltaInMillis) { if (!_clockSkewSet) { if (timeDeltaInMillis) { _clockSkewHeaderValue = timeDeltaInMillis; _shouldAddClockSkewHeaders = true; _clockSkewSet = true; } else { _shouldAddClockSkewHeaders = false; } _allowRequestSending = true; } }; }); } return ClockSkewManager; }()); var EVTClockSkewManager = ClockSkewManager; var _a; var strSendAttempt = "sendAttempt"; var _noResponseQs = "&" + strNoResponseBody + "=true"; var _eventActionMap = (_a = {}, _a[1 ] = strRequeue, _a[100 ] = strRequeue, _a[200 ] = "sent", _a[8004 ] = strDropped, _a[8003 ] = strDropped, _a); var _collectorQsHeaders = {}; var _collectorHeaderToQs = {}; function _addCollectorHeaderQsMapping(qsName, headerName, allowQs) { _collectorQsHeaders[qsName] = headerName; if (allowQs !== false) { _collectorHeaderToQs[headerName] = qsName; } } _addCollectorHeaderQsMapping(strMsaDeviceTicket, strMsaDeviceTicket, false); _addCollectorHeaderQsMapping(strClientVersion, strClientVersion); _addCollectorHeaderQsMapping(strClientId, "Client-Id"); _addCollectorHeaderQsMapping(strApiKey, strApiKey); _addCollectorHeaderQsMapping(strTimeDeltaToApply, strTimeDeltaToApply); _addCollectorHeaderQsMapping(strUploadTime, strUploadTime); _addCollectorHeaderQsMapping(strAuthXToken, strAuthXToken); function _getResponseText(xhr) { try { return xhr.responseText; } catch (e) { } return ""; } function _hasHeader(headers, header) { var hasHeader = false; if (headers && header) { var keys = objKeys(headers); if (keys && keys.length > 0) { var lowerHeader = header.toLowerCase(); for (var lp = 0; lp < keys.length; lp++) { var value = keys[lp]; if (value && hasOwnProperty(header, value) && value.toLowerCase() === lowerHeader) { hasHeader = true; break; } } } } return hasHeader; } function _addRequestDetails(details, name, value, useHeaders) { if (name && value && value.length > 0) { if (useHeaders && _collectorQsHeaders[name]) { details.hdrs[_collectorQsHeaders[name]] = value; details.useHdrs = true; } else { details.url += "&" + name + "=" + value; } } } var HttpManager = /** @class */ (function () { function HttpManager(maxEventsPerBatch, maxConnections, maxRequestRetriesBeforeBackoff, actions, timeoutOverride) { this._responseHandlers = []; var _urlString = "?cors=true&" + strContentTypeHeader.toLowerCase() + "=" + defaultContentType; var _killSwitch = new EVTKillSwitch(); var _paused = false; var _clockSkewManager = new EVTClockSkewManager(); var _useBeacons = false; var _outstandingRequests = 0; var _postManager; var _sendInterfaces; var _core; var _customHttpInterface = true; var _queryStringParameters = []; var _headers = {}; var _batchQueue = []; var _serializer = null; var _enableEventTimings = false; var _cookieMgr; var _isUnloading = false; var _useHeaders = false; var _xhrTimeout; var _disableXhrSync; dynamicProto(HttpManager, this, function (_self) { var _sendCredentials = true; _self.initialize = function (endpointUrl, core, postChannel, httpInterface, channelConfig) { var _a; if (!channelConfig) { channelConfig = {}; } _urlString = endpointUrl + _urlString; _useHeaders = !isUndefined(channelConfig.avoidOptions) ? !channelConfig.avoidOptions : true; _core = core; _cookieMgr = core.getCookieMgr(); _enableEventTimings = !_core.config.disableEventTimings; var enableCompoundKey = !!_core.config.enableCompoundKey; _postManager = postChannel; var valueSanitizer = channelConfig.valueSanitizer; var stringifyObjects = channelConfig.stringifyObjects; if (!isUndefined(channelConfig.enableCompoundKey)) { enableCompoundKey = !!channelConfig.enableCompoundKey; } _xhrTimeout = channelConfig.xhrTimeout; _disableXhrSync = channelConfig.disableXhrSync; _useBeacons = !isReactNative(); _serializer = new Serializer(_core, valueSanitizer, stringifyObjects, enableCompoundKey); var syncHttpInterface = httpInterface; var beaconHttpInterface = channelConfig.alwaysUseXhrOverride ? httpInterface : null; var fetchSyncHttpInterface = channelConfig.alwaysUseXhrOverride ? httpInterface : null; if (!httpInterface) { _customHttpInterface = false; var location_1 = getLocation(); if (location_1 && location_1.protocol && location_1.protocol.toLowerCase() === "file:") { _sendCredentials = false; } var theTransports = []; if (isReactNative()) { theTransports = [2 , 1 ]; } else { theTransports = [1 , 2 , 3 ]; } var configTransports = channelConfig.transports; if (configTransports) { if (isNumber(configTransports)) { theTransports = [configTransports].concat(theTransports); } else if (isArray(configTransports)) { theTransports = configTransports.concat(theTransports); } } httpInterface = _getSenderInterface(theTransports, false); syncHttpInterface = _getSenderInterface(theTransports, true); if (!httpInterface) { _postManager.diagLog().warnToConsole("No available transport to send events"); } } _sendInterfaces = (_a = {}, _a[0 ] = httpInterface, _a[1 ] = syncHttpInterface || _getSenderInterface([1 , 2 , 3 ], true), _a[2 ] = beaconHttpInterface || _getSenderInterface([3 , 2 ], true) || syncHttpInterface || _getSenderInterface([1 ], true), _a[3 ] = fetchSyncHttpInterface || _getSenderInterface([2 , 3 ], true) || syncHttpInterface || _getSenderInterface([1 ], true), _a); }; function _getSenderInterface(transports, syncSupport) { var transportType = 0 ; var sendPostFunc = null; var lp = 0; while (sendPostFunc == null && lp < transports.length) { transportType = transports[lp]; if (transportType === 1 ) { if (useXDomainRequest()) { sendPostFunc = _xdrSendPost; } else if (isXhrSupported()) { sendPostFunc = _xhrSendPost; } } else if (transportType === 2 && isFetchSupported(syncSupport)) { sendPostFunc = _fetchSendPost; } else if (_useBeacons && transportType === 3 && isBeaconsSupported()) { sendPostFunc = _beaconSendPost; } lp++; } if (sendPostFunc) { return { _transport: transportType, _isSync: syncSupport, sendPOST: sendPostFunc }; } return null; } _self["_getDbgPlgTargets"] = function () { return [_sendInterfaces[0 ], _killSwitch, _serializer, _sendInterfaces]; }; function _xdrSendPost(payload, oncomplete, sync) { var xdr = new XDomainRequest(); xdr.open(Method, payload.urlString); if (payload.timeout) { xdr.timeout = payload.timeout; } xdr.onload = function () { var response = _getResponseText(xdr); _doOnComplete(oncomplete, 200, {}, response); _handleCollectorResponse(response); }; xdr.onerror = function () { _doOnComplete(oncomplete, 400, {}); }; xdr.ontimeout = function () { _doOnComplete(oncomplete, 500, {}); }; xdr.onprogress = function () { }; if (sync) { xdr.send(payload.data); } else { timeoutOverride.set(function () { xdr.send(payload.data); }, 0); } } function _fetchSendPost(payload, oncomplete, sync) { var _a; var theUrl = payload.urlString; var ignoreResponse = false; var responseHandled = false; var requestInit = (_a = { body: payload.data, method: Method }, _a[DisabledPropertyName] = true, _a); if (sync) { requestInit.keepalive = true; if (payload._sendReason === 2 ) { ignoreResponse = true; theUrl += _noResponseQs; } } if (_sendCredentials) { requestInit.credentials = "include"; } if (payload.headers && objKeys(payload.headers).length > 0) { requestInit.headers = payload.headers; } fetch(theUrl, requestInit).then(function (response) { var headerMap = {}; var responseText = ""; if (response.headers) { response.headers.forEach(function (value, name) { headerMap[name] = value; }); } if (response.body) { response.text().then(function (text) { responseText = text; }); } if (!responseHandled) { responseHandled = true; _doOnComplete(oncomplete, response.status, headerMap, responseText); _handleCollectorResponse(responseText); } })["catch"](function (error) { if (!responseHandled) { responseHandled = true; _doOnComplete(oncomplete, 0, {}); } }); if (ignoreResponse && !responseHandled) { responseHandled = true; _doOnComplete(oncomplete, 200, {}); } if (!responseHandled && payload.timeout > 0) { timeoutOverride.set(function () { if (!responseHandled) { responseHandled = true; _doOnComplete(oncomplete, 500, {}); } }, payload.timeout); } } function _xhrSendPost(payload, oncomplete, sync) { var theUrl = payload.urlString; function _appendHeader(theHeaders, xhr, name) { if (!theHeaders[name] && xhr && xhr.getResponseHeader) { var value = xhr.getResponseHeader(name); if (value) { theHeaders[name] = strTrim(value); } } return theHeaders; } function _getAllResponseHeaders(xhr) { var theHeaders = {}; if (!xhr.getAllResponseHeaders) { theHeaders = _appendHeader(theHeaders, xhr, strTimeDeltaHeader); theHeaders = _appendHeader(theHeaders, xhr, strKillDurationHeader); theHeaders = _appendHeader(theHeaders, xhr, strKillDurationSecondsHeader); } else { theHeaders = _convertAllHeadersToMap(xhr.getAllResponseHeaders()); } return theHeaders; } function xhrComplete(xhr, responseTxt) { _doOnComplete(oncomplete, xhr.status, _getAllResponseHeaders(xhr), responseTxt); } if (sync && payload.disableXhrSync) { sync = false; } var xhrRequest = openXhr(Method, theUrl, _sendCredentials, true, sync, payload.timeout); objForEachKey(payload.headers, function (name, value) { xhrRequest.setRequestHeader(name, value); }); xhrRequest.onload = function () { var response = _getResponseText(xhrRequest); xhrComplete(xhrRequest, response); _handleCollectorResponse(response); }; xhrRequest.onerror = function () { xhrComplete(xhrRequest); }; xhrRequest.ontimeout = function () { xhrComplete(xhrRequest); }; xhrRequest.send(payload.data); } function _doOnComplete(oncomplete, status, headers, response) { try { oncomplete(status, headers, response); } catch (e) { _throwInternal(_postManager.diagLog(), 2 , 518 , dumpObj(e)); } } function _beaconSendPost(payload, oncomplete, sync) { var internalPayloadData = payload; var status = 200; var thePayload = internalPayloadData._thePayload; var theUrl = payload.urlString + _noResponseQs; try { var nav_1 = getNavigator(); if (!nav_1.sendBeacon(theUrl, payload.data)) { if (thePayload) { var droppedBatches_1 = []; arrForEach(thePayload.batches, function (theBatch) { if (droppedBatches_1 && theBatch && theBatch.count() > 0) { var theEvents = theBatch.events(); for (var lp = 0; lp < theEvents.length; lp++) { if (!nav_1.sendBeacon(theUrl, _serializer.getEventBlob(theEvents[lp]))) { droppedBatches_1.push(theBatch.split(lp)); break; } } } else { droppedBatches_1.push(theBatch.split(0)); } }); _sendBatchesNotification(droppedBatches_1, 8003 , thePayload.sendType, true); } else { status = 0; } } } catch (ex) { _postManager.diagLog().warnToConsole("Failed to send telemetry using sendBeacon API. Ex:" + dumpObj(ex)); status = 0; } finally { _doOnComplete(oncomplete, status, {}, ""); } } function _isBeaconPayload(sendType) { return sendType === 2 || sendType === 3 ; } function _adjustSendType(sendType) { if (_isUnloading && _isBeaconPayload(sendType)) { sendType = 2 ; } return sendType; } _self.addQueryStringParameter = function (name, value) { for (var i = 0; i < _queryStringParameters.length; i++) { if (_queryStringParameters[i].name === name) { _queryStringParameters[i].value = value; return; } } _queryStringParameters.push({ name: name, value: value }); }; _self.addHeader = function (name, value) { _headers[name] = value; }; _self.canSendRequest = function () { return _hasIdleConnection() && _clockSkewManager.allowRequestSending(); }; _self.sendQueuedRequests = function (sendType, sendReason) { if (isUndefined(sendType)) { sendType = 0 ; } if (_isUnloading) { sendType = _adjustSendType(sendType); sendReason = 2 ; } if (_canSendPayload(_batchQueue, sendType, 0)) { _sendBatches(_clearQueue(), 0, false, sendType, sendReason || 0 ); } }; _self.isCompletelyIdle = function () { return !_paused && _outstandingRequests === 0 && _batchQueue.length === 0; }; _self.setUnloading = function (value) { _isUnloading = value; }; _self.addBatch = function (theBatch) { if (theBatch && theBatch.count() > 0) { if (_killSwitch.isTenantKilled(theBatch.iKey())) { return false; } _batchQueue.push(theBatch); } return true; }; _self.teardown = function () { if (_batchQueue.length > 0) { _sendBatches(_clearQueue(), 0, true, 2 , 2 ); } }; _self.pause = function () { _paused = true; }; _self.resume = function () { _paused = false; _self.sendQueuedRequests(0 , 4 ); }; _self.sendSynchronousBatch = function (batch, sendType, sendReason) { if (batch && batch.count() > 0) { if (isNullOrUndefined(sendType)) { sendType = 1 ; } if (_isUnloading) { sendType = _adjustSendType(sendType); sendReason = 2 ; } _sendBatches([batch], 0, false, sendType, sendReason || 0 ); } }; function _hasIdleConnection() { return !_paused && _outstandingRequests < maxConnections; } function _clearQueue() { var theQueue = _batchQueue; _batchQueue = []; return theQueue; } function _canSendPayload(theBatches, sendType, retryCnt) { var result = false; if (theBatches && theBatches.length > 0 && !_paused && _sendInterfaces[sendType] && _serializer) { result = (sendType !== 0 ) || (_hasIdleConnection() && (retryCnt > 0 || _clockSkewManager.allowRequestSending())); } return result; } function _createDebugBatches(theBatches) { var values = {}; if (theBatches) { arrForEach(theBatches, function (theBatch, idx) { values[idx] = { iKey: theBatch.iKey(), evts: theBatch.events() }; }); } return values; } function _sendBatches(theBatches, retryCount, isTeardown, sendType, sendReason) { if (!theBatches || theBatches.length === 0) { return; } if (_paused) { _sendBatchesNotification(theBatches, 1 , sendType); return; } sendType = _adjustSendType(sendType); try { var orgBatches_1 = theBatches; var isSynchronous_1 = sendType !== 0 ; doPerf(_core, function () { return "HttpManager:_sendBatches"; }, function (perfEvt) { if (perfEvt) { theBatches = theBatches.slice(0); } var droppedBatches = []; var thePayload = null; var serializationStart = getTime(); var sendInterface = _sendInterfaces[sendType] || (isSynchronous_1 ? _sendInterfaces[1 ] : _sendInterfaces[0 ]); var isBeaconTransport = (_isUnloading || _isBeaconPayload(sendType) || (sendInterface && sendInterface._transport === 3 )) && _canUseSendBeaconApi(); while (_canSendPayload(theBatches, sendType, retryCount)) { var theBatch = theBatches.shift(); if (theBatch && theBatch.count() > 0) { if (!_killSwitch.isTenantKilled(theBatch.iKey())) { thePayload = thePayload || _serializer.createPayload(retryCount, isTeardown, isSynchronous_1, isBeaconTransport, sendReason, sendType); if (!_serializer.appendPayload(thePayload, theBatch, maxEventsPerBatch)) { _doPayloadSend(thePayload, serializationStart, getTime(), sendReason); serializationStart = getTime(); theBatches = [theBatch].concat(theBatches); thePayload = null; } else if (thePayload.overflow !== null) { theBatches = [thePayload.overflow].concat(theBatches); thePayload.overflow = null; _doPayloadSend(thePayload, serializationStart, getTime(), sendReason); serializationStart = getTime(); thePayload = null; } } else { droppedBatches.push(theBatch); } } } if (thePayload) { _doPayloadSend(thePayload, serializationStart, getTime(), sendReason); } if (theBatches.length > 0) { _batchQueue = theBatches.concat(_batchQueue); } _sendBatchesNotification(droppedBatches, 8004 , sendType); }, function () { return ({ batches: _createDebugBatches(orgBatches_1), retryCount: retryCount, isTeardown: isTeardown, isSynchronous: isSynchronous_1, sendReason: sendReason, useSendBeacon: _isBeaconPayload(sendType), sendType: sendType }); }, !isSynchronous_1); } catch (ex) { _throwInternal(_postManager.diagLog(), 2 , 48 , "Unexpected Exception sending batch: " + dumpObj(ex)); } } function _buildRequestDetails(thePayload, useHeaders) { var requestDetails = { url: _urlString, hdrs: {}, useHdrs: false }; if (!useHeaders) { objForEachKey(_headers, function (name, value) { if (_collectorHeaderToQs[name]) { _addRequestDetails(requestDetails, _collectorHeaderToQs[name], value, false); } else { requestDetails.hdrs[name] = value; requestDetails.useHdrs = true; } }); } else { requestDetails.hdrs = extend(requestDetails.hdrs, _headers); requestDetails.useHdrs = (objKeys(requestDetails.hdrs).length > 0); } _addRequestDetails(requestDetails, strClientId, "NO_AUTH", useHeaders); _addRequestDetails(requestDetails, strClientVersion, FullVersionString, useHeaders); var apiQsKeys = ""; arrForEach(thePayload.apiKeys, function (apiKey) { if (apiQsKeys.length > 0) { apiQsKeys += ","; } apiQsKeys += apiKey; }); _addRequestDetails(requestDetails, strApiKey, apiQsKeys, useHeaders); _addRequestDetails(requestDetails, strUploadTime, dateNow().toString(), useHeaders); var msfpc = _getMsfpc(thePayload); if (isValueAssigned(msfpc)) { requestDetails.url += "&ext.intweb.msfpc=" + msfpc; } if (_clockSkewManager.shouldAddClockSkewHeaders()) { _addRequestDetails(requestDetails, strTimeDeltaToApply, _clockSkewManager.getClockSkewHeaderValue(), useHeaders); } if (_core.getWParam) { var wParam = _core.getWParam(); if (wParam >= 0) { requestDetails.url += "&w=" + wParam; } } for (var i = 0; i < _queryStringParameters.length; i++) { requestDetails.url += "&" + _queryStringParameters[i].name + "=" + _queryStringParameters[i].value; } return requestDetails; } function _canUseSendBeaconApi() { return !_customHttpInterface && _useBeacons && isBeaconsSupported(); } function _setTimingValue(timings, name, value) { timings[name] = timings[name] || {}; timings[name][_postManager.identifier] = value; } function _doPayloadSend(thePayload, serializationStart, serializationCompleted, sendReason) { if (thePayload && thePayload.payloadBlob && thePayload.payloadBlob.length > 0) { var useSendHook_1 = !!_self.sendHook; var sendInterface_1 = _sendInterfaces[thePayload.sendType]; if (!_isBeaconPayload(thePayload.sendType) && thePayload.isBeacon && thePayload.sendReason === 2 ) { sendInterface_1 = _sendInterfaces[2 ] || _sendInterfaces[3 ] || sendInterface_1; } var useHeaders_1 = _useHeaders; if (thePayload.isBeacon || sendInterface_1._transport === 3 ) { useHeaders_1 = false; } var requestDetails_1 = _buildRequestDetails(thePayload, useHeaders_1); useHeaders_1 = useHeaders_1 || requestDetails_1.useHdrs; var sendEventStart_1 = getTime(); doPerf(_core, function () { return "HttpManager:_doPayloadSend"; }, function () { for (var batchLp = 0; batchLp < thePayload.batches.length; batchLp++) { var theBatch = thePayload.batches[batchLp]; var theEvents = theBatch.events(); for (var evtLp = 0; evtLp < theEvents.length; evtLp++) { var telemetryItem = theEvents[evtLp]; if (_enableEventTimings) { var timings = telemetryItem.timings = telemetryItem.timings || {}; _setTimingValue(timings, "sendEventStart", sendEventStart_1); _setTimingValue(timings, "serializationStart", serializationStart); _setTimingValue(timings, "serializationCompleted", serializationCompleted); } telemetryItem[strSendAttempt] > 0 ? telemetryItem[strSendAttempt]++ : telemetryItem[strSendAttempt] = 1; } } _sendBatchesNotification(thePayload.batches, (1000 + (sendReason || 0 )), thePayload.sendType, true); var orgPayloadData = { data: thePayload.payloadBlob, urlString: requestDetails_1.url, headers: requestDetails_1.hdrs, _thePayload: thePayload, _sendReason: sendReason, timeout: _xhrTimeout }; if (!isUndefined(_disableXhrSync)) { orgPayloadData.disableXhrSync = !!_disableXhrSync; } if (useHeaders_1) { if (!_hasHeader(orgPayloadData.headers, strCacheControl)) { orgPayloadData.headers[strCacheControl] = defaultCacheControl; } if (!_hasHeader(orgPayloadData.headers, strContentTypeHeader)) { orgPayloadData.headers[strContentTypeHeader] = defaultContentType; } } var sender = null; if (sendInterface_1) { sender = function (payload) { _clockSkewManager.firstRequestSent(); var onComplete = function (status, headers) { _retryRequestIfNeeded(status, headers, thePayload, sendReason); }; var isSync = thePayload.isTeardown || thePayload.isSync; try { sendInterface_1.sendPOST(payload, onComplete, isSync); if (_self.sendListener) { _self.sendListener(orgPayloadData, payload, isSync, thePayload.isBeacon); } } catch (ex) { _postManager.diagLog().warnToConsole("Unexpected exception sending payload. Ex:" + dumpObj(ex)); _doOnComplete(onComplete, 0, {}); } }; } doPerf(_core, function () { return "HttpManager:_doPayloadSend.sender"; }, function () { if (sender) { if (thePayload.sendType === 0 ) { _outstandingRequests++; } if (useSendHook_1 && !thePayload.isBeacon && sendInterface_1._transport !== 3 ) { var hookData_1 = { data: orgPayloadData.data, urlString: orgPayloadData.urlString, headers: extend({}, orgPayloadData.headers), timeout: orgPayloadData.timeout, disableXhrSync: orgPayloadData.disableXhrSync }; var senderCalled_1 = false; doPerf(_core, function () { return "HttpManager:_doPayloadSend.sendHook"; }, function () { try { _self.sendHook(hookData_1, function (payload) { senderCalled_1 = true; if (!_customHttpInterface && !payload._thePayload) { payload._thePayload = payload._thePayload || orgPayloadData._thePayload; payload._sendReason = payload._sendReason || orgPayloadData._sendReason; } sender(payload); }, thePayload.isSync || thePayload.isTeardown); } catch (ex) { if (!senderCalled_1) { sender(orgPayloadData); } } }); } else { sender(orgPayloadData); } } }); }, function () { return ({ thePayload: thePayload, serializationStart: serializationStart, serializationCompleted: serializationCompleted, sendReason: sendReason }); }, thePayload.isSync); } if (thePayload.sizeExceed && thePayload.sizeExceed.length > 0) { _sendBatchesNotification(thePayload.sizeExceed, 8003 , thePayload.sendType); } if (thePayload.failedEvts && thePayload.failedEvts.length > 0) { _sendBatchesNotification(thePayload.failedEvts, 8002 , thePayload.sendType); } } function _addEventCompletedTimings(theEvents, sendEventCompleted) { if (_enableEventTimings) { arrForEach(theEvents, function (theEvent) { var timings = theEvent.timings = theEvent.timings || {}; _setTimingValue(timings, "sendEventCompleted", sendEventCompleted); }); } } function _retryRequestIfNeeded(status, headers, thePayload, sendReason) { var reason = 9000 ; var droppedBatches = null; var isRetrying = false; var backOffTrans = false; try { var shouldRetry = true; if (typeof status !== strShimUndefined) { if (headers) { _clockSkewManager.setClockSkew(headers[strTimeDeltaHeader]); var killDuration = headers[strKillDurationHeader] || headers["kill-duration-seconds"]; arrForEach(_killSwitch.setKillSwitchTenants(headers[strKillTokensHeader], killDuration), function (killToken) { arrForEach(thePayload.batches, function (theBatch) { if (theBatch.iKey() === killToken) { droppedBatches = droppedBatches || []; var removedEvents = theBatch.split(0); thePayload.numEvents -= removedEvents.count(); droppedBatches.push(removedEvents); } }); }); } if (status == 200 || status == 204) { reason = 200 ; return; } if (!retryPolicyShouldRetryForStatus(status) || thePayload.numEvents <= 0) { shouldRetry = false; } reason = 9000 + (status % 1000); } if (shouldRetry) { reason = 100 ; var retryCount_1 = thePayload.retryCnt; if (thePayload.sendType === 0 ) { if (retryCount_1 < maxRequestRetriesBeforeBackoff) { isRetrying = true; _doAction(function () { if (thePayload.sendType === 0 ) { _outstandingRequests--; } _sendBatches(thePayload.batches, retryCount_1 + 1, thePayload.isTeardown, _isUnloading ? 2 : thePayload.sendType, 5 ); }, _isUnloading, retryPolicyGetMillisToBackoffForRetry(retryCount_1)); } else { backOffTrans = true; if (_isUnloading) { reason = 8001 ; } } } } } finally { if (!isRetrying) { _clockSkewManager.setClockSkew(); _handleRequestFinished(thePayload, reason, sendReason, backOffTrans); } _sendBatchesNotification(droppedBatches, 8004 , thePayload.sendType); } } function _handleRequestFinished(thePayload, batchReason, sendReason, backOffTrans) { try { if (backOffTrans) { _postManager._backOffTransmission(); } if (batchReason === 200 ) { if (!backOffTrans && !thePayload.isSync) { _postManager._clearBackOff(); } _addCompleteTimings(thePayload.batches); } _sendBatchesNotification(thePayload.batches, batchReason, thePayload.sendType, true); } finally { if (thePayload.sendType === 0 ) { _outstandingRequests--; if (sendReason !== 5 ) { _self.sendQueuedRequests(thePayload.sendType, sendReason); } } } } function _addCompleteTimings(theBatches) { if (_enableEventTimings) { var sendEventCompleted_1 = getTime(); arrForEach(theBatches, function (theBatch) { if (theBatch && theBatch.count() > 0) { _addEventCompletedTimings(theBatch.events(), sendEventCompleted_1); } }); } } function _doAction(cb, isSync, interval) { if (isSync) { cb(); } else { timeoutOverride.set(cb, interval); } } function _convertAllHeadersToMap(headersString) { var headers = {}; if (isString(headersString)) { var headersArray = strTrim(headersString).split(/[\r\n]+/); arrForEach(headersArray, function (headerEntry) { if (headerEntry) { var idx = headerEntry.indexOf(": "); if (idx !== -1) { var header = strTrim(headerEntry.substring(0, idx)).toLowerCase(); var value = strTrim(headerEntry.substring(idx + 1)); headers[header] = value; } else { headers[strTrim(headerEntry)] = 1; } } }); } return headers; } function _getMsfpc(thePayload) { for (var lp = 0; lp < thePayload.batches.length; lp++) { var msfpc = thePayload.batches[lp].Msfpc(); if (msfpc) { return encodeURIComponent(msfpc); } } return ""; } function _handleCollectorResponse(responseText) { var responseHandlers = _self._responseHandlers; try { for (var i = 0; i < responseHandlers.length; i++) { try { responseHandlers[i](responseText); } catch (e) { _throwInternal(_postManager.diagLog(), 1 , 519 , "Response handler failed: " + e); } } if (responseText) { var response = JSON.parse(responseText); if (isValueAssigned(response.webResult) && isValueAssigned(response.webResult[strMsfpc])) { _cookieMgr.set("MSFPC", response.webResult[strMsfpc], 365 * 86400); } } } catch (ex) { } } function _sendBatchesNotification(theBatches, batchReason, sendType, sendSync) { if (theBatches && theBatches.length > 0 && actions) { var theAction_1 = actions[_getNotificationAction(batchReason)]; if (theAction_1) { var isSyncRequest_1 = sendType !== 0 ; doPerf(_core, function () { return "HttpManager:_sendBatchesNotification"; }, function () { _doAction(function () { try { theAction_1.call(actions, theBatches, batchReason, isSyncRequest_1, sendType); } catch (e) { _throwInternal(_postManager.diagLog(), 1 , 74 , "send request notification failed: " + e); } }, sendSync || isSyncRequest_1, 0); }, function () { return ({ batches: _createDebugBatches(theBatches), reason: batchReason, isSync: isSyncRequest_1, sendSync: sendSync, sendType: sendType }); }, !isSyncRequest_1); } } } function _getNotificationAction(reason) { var action = _eventActionMap[reason]; if (!isValueAssigned(action)) { action = strOther; if (reason >= 9000 && reason <= 9999 ) { action = strResponseFail; } else if (reason >= 8000 && reason <= 8999 ) { action = strDropped; } else if (reason >= 1000 && reason <= 1999 ) { action = strSending; } } return action; } }); } return HttpManager; }()); function defaultSetTimeout(callback, ms) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } return setTimeout(callback, ms, args); } function defaultClearTimeout(timeoutId) { clearTimeout(timeoutId); } function createTimeoutWrapper(argSetTimeout, argClearTimeout) { return { set: argSetTimeout || defaultSetTimeout, clear: argClearTimeout || defaultClearTimeout }; } var FlushCheckTimer = 0.250; var MaxNumberEventPerBatch = 500; var EventsDroppedAtOneTime = 20; var MaxSendAttempts = 6; var MaxSyncUnloadSendAttempts = 2; var MaxBackoffCount = 4; var MaxConnections = 2; var MaxRequestRetriesBeforeBackoff = 1; var strEventsDiscarded = "eventsDiscarded"; var strOverrideInstrumentationKey = "overrideInstrumentationKey"; var strMaxEventRetryAttempts = "maxEventRetryAttempts"; var strMaxUnloadEventRetryAttempts = "maxUnloadEventRetryAttempts"; var strAddUnloadCb = "addUnloadCb"; var PostChannel = /** @class */ (function (_super) { __extendsFn(PostChannel, _super); function PostChannel() { var _this = _super.call(this) || this; _this.identifier = "PostChannel"; _this.priority = 1011; _this.version = '3.2.2'; var _config; var _isTeardownCalled = false; var _flushCallbackQueue = []; var _flushCallbackTimerId = null; var _paused = false; var _immediateQueueSize = 0; var _immediateQueueSizeLimit = 500; var _queueSize = 0; var _queueSizeLimit = 10000; var _profiles = {}; var _currentProfile = RT_PROFILE; var _scheduledTimerId = null; var _immediateTimerId = null; var _currentBackoffCount = 0; var _timerCount = 0; var _xhrOverride; var _httpManager; var _batchQueues = {}; var _autoFlushEventsLimit; var _autoFlushBatchLimit; var _delayedBatchSendLatency = -1; var _delayedBatchReason; var _optimizeObject = true; var _isPageUnloadTriggered = false; var _disableXhrSync = false; var _maxEventSendAttempts = MaxSendAttempts; var _maxUnloadEventSendAttempts = MaxSyncUnloadSendAttempts; var _evtNamespace; var _timeoutWrapper; dynamicProto(PostChannel, _this, function (_self, _base) { _initDefaults(); _self["_getDbgPlgTargets"] = function () { return [_httpManager]; }; _self.initialize = function (coreConfig, core, extensions) { doPerf(core, function () { return "PostChannel:initialize"; }, function () { var extendedCore = core; _base.initialize(coreConfig, core, extensions); try { var hasAddUnloadCb = !!core[strAddUnloadCb]; _evtNamespace = mergeEvtNamespace(createUniqueNamespace(_self.identifier), core.evtNamespace && core.evtNamespace()); var ctx = _self._getTelCtx(); coreConfig.extensionConfig[_self.identifier] = coreConfig.extensionConfig[_self.identifier] || {}; _config = ctx.getExtCfg(_self.identifier); _timeoutWrapper = createTimeoutWrapper(_config.setTimeoutOverride, _config.clearTimeoutOverride); _optimizeObject = !_config.disableOptimizeObj && isChromium(); _hookWParam(extendedCore); if (_config.eventsLimitInMem > 0) { _queueSizeLimit = _config.eventsLimitInMem; } if (_config.immediateEventLimit > 0) { _immediateQueueSizeLimit = _config.immediateEventLimit; } if (_config.autoFlushEventsLimit > 0) { _autoFlushEventsLimit = _config.autoFlushEventsLimit; } _disableXhrSync = _config.disableXhrSync; if (isNumber(_config[strMaxEventRetryAttempts])) { _maxEventSendAttempts = _config[strMaxEventRetryAttempts]; } if (isNumber(_config[strMaxUnloadEventRetryAttempts])) { _maxUnloadEventSendAttempts = _config[strMaxUnloadEventRetryAttempts]; } _setAutoLimits(); if (_config.httpXHROverride && _config.httpXHROverride.sendPOST) { _xhrOverride = _config.httpXHROverride; } if (isValueAssigned(coreConfig.anonCookieName)) { _httpManager.addQueryStringParameter("anoncknm", coreConfig.anonCookieName); } _httpManager.sendHook = _config.payloadPreprocessor; _httpManager.sendListener = _config.payloadListener; var endpointUrl = _config.overrideEndpointUrl ? _config.overrideEndpointUrl : coreConfig.endpointUrl; _self._notificationManager = coreConfig.extensionConfig.NotificationManager; _httpManager.initialize(endpointUrl, _self.core, _self, _xhrOverride, _config); var excludePageUnloadEvents = coreConfig.disablePageUnloadEvents || []; addPageUnloadEventListener(_handleUnloadEvents, excludePageUnloadEvents, _evtNamespace); addPageHideEventListener(_handleUnloadEvents, excludePageUnloadEvents, _evtNamespace); addPageShowEventListener(_handleShowEvents, coreConfig.disablePageShowEvents, _evtNamespace); } catch (e) { _self.setInitialized(false); throw e; } }, function () { return ({ coreConfig: coreConfig, core: core, extensions: extensions }); }); }; _self.processTelemetry = function (ev, itemCtx) { setProcessTelemetryTimings(ev, _self.identifier); itemCtx = _self._getTelCtx(itemCtx); var channelConfig = itemCtx.getExtCfg(_self.identifier); var disableTelemetry = !!_config.disableTelemetry; if (channelConfig) { disableTelemetry = disableTelemetry || !!channelConfig.disableTelemetry; } var event = ev; if (!disableTelemetry && !_isTeardownCalled) { if (_config[strOverrideInstrumentationKey]) { event.iKey = _config[strOverrideInstrumentationKey]; } if (channelConfig && channelConfig[strOverrideInstrumentationKey]) { event.iKey = channelConfig[strOverrideInstrumentationKey]; } _addEventToQueues(event, true); if (_isPageUnloadTriggered) { _releaseAllQueues(2 , 2 ); } else { _scheduleTimer(); } } _self.processNext(event, itemCtx); }; _self._doTeardown = function (unloadCtx, unloadState) { _releaseAllQueues(2 , 2 ); _isTeardownCalled = true; _httpManager.teardown(); removePageUnloadEventListener(null, _evtNamespace); removePageHideEventListener(null, _evtNamespace); removePageShowEventListener(null, _evtNamespace); _initDefaults(); }; function _hookWParam(extendedCore) { var existingGetWParamMethod = extendedCore.getWParam; extendedCore.getWParam = function () { var wparam = 0; if (_config.ignoreMc1Ms0CookieProcessing) { wparam = wparam | 2; } return wparam | existingGetWParamMethod(); }; } function _handleUnloadEvents(evt) { var theEvt = evt || getWindow().event; if (theEvt.type !== "beforeunload") { _isPageUnloadTriggered = true; _httpManager.setUnloading(_isPageUnloadTriggered); } _releaseAllQueues(2 , 2 ); } function _handleShowEvents(evt) { _isPageUnloadTriggered = false; _httpManager.setUnloading(_isPageUnloadTriggered); } function _addEventToQueues(event, append) { if (!event.sendAttempt) { event.sendAttempt = 0; } if (!event.latency) { event.latency = 1 ; } if (event.ext && event.ext["trace"]) { delete (event.ext["trace"]); } if (event.ext && event.ext["user"] && event.ext["user"]["id"]) { delete (event.ext["user"]["id"]); } if (_optimizeObject) { event.ext = optimizeObject(event.ext); if (event.baseData) { event.baseData = optimizeObject(event.baseData); } if (event.data) { event.data = optimizeObject(event.data); } } if (event.sync) { if (_currentBackoffCount || _paused) { event.latency = 3 ; event.sync = false; } else { if (_httpManager) { if (_optimizeObject) { event = optimizeObject(event); } _httpManager.sendSynchronousBatch(EventBatch.create(event.iKey, [event]), event.sync === true ? 1 : event.sync, 3 ); return; } } } var evtLatency = event.latency; var queueSize = _queueSize; var queueLimit = _queueSizeLimit; if (evtLatency === 4 ) { queueSize = _immediateQueueSize; queueLimit = _immediateQueueSizeLimit; } var eventDropped = false; if (queueSize < queueLimit) { eventDropped = !_addEventToProperQueue(event, append); } else { var dropLatency = 1 ; var dropNumber = EventsDroppedAtOneTime; if (evtLatency === 4 ) { dropLatency = 4 ; dropNumber = 1; } eventDropped = true; if (_dropEventWithLatencyOrLess(event.iKey, event.latency, dropLatency, dropNumber)) { eventDropped = !_addEventToProperQueue(event, append); } } if (eventDropped) { _notifyEvents(strEventsDiscarded, [event], EventsDiscardedReason.QueueFull); } } _self.setEventQueueLimits = function (eventLimit, autoFlushLimit) { _queueSizeLimit = eventLimit > 0 ? eventLimit : 10000; _autoFlushEventsLimit = autoFlushLimit > 0 ? autoFlushLimit : 0; _setAutoLimits(); var doFlush = _queueSize > eventLimit; if (!doFlush && _autoFlushBatchLimit > 0) { for (var latency = 1 ; !doFlush && latency <= 3 ; latency++) { var batchQueue = _batchQueues[latency]; if (batchQueue && batchQueue.batches) { arrForEach(batchQueue.batches, function (theBatch) { if (theBatch && theBatch.count() >= _autoFlushBatchLimit) { doFlush = true; } }); } } } _performAutoFlush(true, doFlush); }; _self.pause = function () { _clearScheduledTimer(); _paused = true; _httpManager.pause(); }; _self.resume = function () { _paused = false; _httpManager.resume(); _scheduleTimer(); }; _self.addResponseHandler = function (responseHandler) { _httpManager._responseHandlers.push(responseHandler); }; _self._loadTransmitProfiles = function (profiles) { _resetTransmitProfiles(); objForEachKey(profiles, function (profileName, profileValue) { var profLen = profileValue.length; if (profLen >= 2) { var directValue = (profLen > 2 ? profileValue[2] : 0); profileValue.splice(0, profLen - 2); if (profileValue[1] < 0) { profileValue[0] = -1; } if (profileValue[1] > 0 && profileValue[0] > 0) { var timerMultiplier = profileValue[0] / profileValue[1]; profileValue[0] = Math.ceil(timerMultiplier) * profileValue[1]; } if (directValue >= 0 && profileValue[1] >= 0 && directValue > profileValue[1]) { directValue = profileValue[1]; } profileValue.push(directValue); _profiles[profileName] = profileValue; } }); }; _self.flush = function (async, callback, sendReason) { if (async === void 0) { async = true; } if (!_paused) { _clearScheduledTimer(); sendReason = sendReason || 1 ; if (async) { _queueBatches(1 , 0 , sendReason); _resetQueueCounts(); if (_flushCallbackTimerId == null) { _flushCallbackTimerId = _createTimer(function () { _flushImpl(callback, sendReason); }, 0); } else { _flushCallbackQueue.push(callback); } } else { _sendEventsForLatencyAndAbove(1 , 1 , sendReason); if (callback !== null && callback !== undefined) { callback(); } } } }; _self.setMsaAuthTicket = function (ticket) { _httpManager.addHeader(strMsaDeviceTicket, ticket); }; _self.hasEvents = _hasEvents; _self._setTransmitProfile = function (profileName) { if (_currentProfile !== profileName && _profiles[profileName] !== undefined) { _clearScheduledTimer(); _currentProfile = profileName; _scheduleTimer(); } }; function _sendEventsForLatencyAndAbove(latency, sendType, sendReason) { var queued = _queueBatches(latency, sendType, sendReason); _httpManager.sendQueuedRequests(sendType, sendReason); return queued; } function _hasEvents() { return _queueSize > 0; } function _scheduleTimer() { if (_delayedBatchSendLatency >= 0 && _queueBatches(_delayedBatchSendLatency, 0 , _delayedBatchReason)) { _httpManager.sendQueuedRequests(0 , _delayedBatchReason); } if (_immediateQueueSize > 0 && !_immediateTimerId && !_paused) { var immediateTimeOut = _profiles[_currentProfile][2]; if (immediateTimeOut >= 0) { _immediateTimerId = _createTimer(function () { _immediateTimerId = null; _sendEventsForLatencyAndAbove(4 , 0 , 1 ); _scheduleTimer(); }, immediateTimeOut); } } var timeOut = _profiles[_currentProfile][1]; if (!_scheduledTimerId && !_flushCallbackTimerId && timeOut >= 0 && !_paused) { if (_hasEvents()) { _scheduledTimerId = _createTimer(function () { _scheduledTimerId = null; _sendEventsForLatencyAndAbove(_timerCount === 0 ? 3 : 1 , 0 , 1 ); _timerCount++; _timerCount %= 2; _scheduleTimer(); }, timeOut); } else { _timerCount = 0; } } } _self._backOffTransmission = function () { if (_currentBackoffCount < MaxBackoffCount) { _currentBackoffCount++; _clearScheduledTimer(); _scheduleTimer(); } }; _self._clearBackOff = function () { if (_currentBackoffCount) { _currentBackoffCount = 0; _clearScheduledTimer(); _scheduleTimer(); } }; function _initDefaults() { _config = null; _isTeardownCalled = false; _flushCallbackQueue = []; _flushCallbackTimerId = null; _paused = false; _immediateQueueSize = 0; _immediateQueueSizeLimit = 500; _queueSize = 0; _queueSizeLimit = 10000; _profiles = {}; _currentProfile = RT_PROFILE; _scheduledTimerId = null; _immediateTimerId = null; _currentBackoffCount = 0; _timerCount = 0; _xhrOverride = null; _batchQueues = {}; _autoFlushEventsLimit = undefined; _autoFlushBatchLimit = 0; _delayedBatchSendLatency = -1; _delayedBatchReason = null; _optimizeObject = true; _isPageUnloadTriggered = false; _disableXhrSync = false; _maxEventSendAttempts = MaxSendAttempts; _maxUnloadEventSendAttempts = MaxSyncUnloadSendAttempts; _evtNamespace = null; _timeoutWrapper = createTimeoutWrapper(); _httpManager = new HttpManager(MaxNumberEventPerBatch, MaxConnections, MaxRequestRetriesBeforeBackoff, { requeue: _requeueEvents, send: _sendingEvent, sent: _eventsSentEvent, drop: _eventsDropped, rspFail: _eventsResponseFail, oth: _otherEvent }, _timeoutWrapper); _initializeProfiles(); _clearQueues(); _setAutoLimits(); } function _createTimer(theTimerFunc, timeOut) { if (timeOut === 0 && _currentBackoffCount) { timeOut = 1; } var timerMultiplier = 1000; if (_currentBackoffCount) { timerMultiplier = retryPolicyGetMillisToBackoffForRetry(_currentBackoffCount - 1); } return _timeoutWrapper.set(theTimerFunc, timeOut * timerMultiplier); } function _clearScheduledTimer() { if (_scheduledTimerId !== null) { _timeoutWrapper.clear(_scheduledTimerId); _scheduledTimerId = null; _timerCount = 0; } } function _releaseAllQueues(sendType, sendReason) { _clearScheduledTimer(); if (_flushCallbackTimerId) { _timeoutWrapper.clear(_flushCallbackTimerId); _flushCallbackTimerId = null; } if (!_paused) { _sendEventsForLatencyAndAbove(1 , sendType, sendReason); } } function _clearQueues() { _batchQueues[4 ] = { batches: [], iKeyMap: {} }; _batchQueues[3 ] = { batches: [], iKeyMap: {} }; _batchQueues[2 ] = { batches: [], iKeyMap: {} }; _batchQueues[1 ] = { batches: [], iKeyMap: {} }; } function _getEventBatch(iKey, latency, create) { var batchQueue = _batchQueues[latency]; if (!batchQueue) { latency = 1 ; batchQueue = _batchQueues[latency]; } var eventBatch = batchQueue.iKeyMap[iKey]; if (!eventBatch && create) { eventBatch = EventBatch.create(iKey); batchQueue.batches.push(eventBatch); batchQueue.iKeyMap[iKey] = eventBatch; } return eventBatch; } function _performAutoFlush(isAsync, doFlush) { if (_httpManager.canSendRequest() && !_currentBackoffCount) { if (_autoFlushEventsLimit > 0 && _queueSize > _autoFlushEventsLimit) { doFlush = true; } if (doFlush && _flushCallbackTimerId == null) { _self.flush(isAsync, null, 20 ); } } } function _addEventToProperQueue(event, append) { if (_optimizeObject) { event = optimizeObject(event); } var latency = event.latency; var eventBatch = _getEventBatch(event.iKey, latency, true); if (eventBatch.addEvent(event)) { if (latency !== 4 ) { _queueSize++; if (append && event.sendAttempt === 0) { _performAutoFlush(!event.sync, _autoFlushBatchLimit > 0 && eventBatch.count() >= _autoFlushBatchLimit); } } else { _immediateQueueSize++; } return true; } return false; } function _dropEventWithLatencyOrLess(iKey, latency, currentLatency, dropNumber) { while (currentLatency <= latency) { var eventBatch = _getEventBatch(iKey, latency, true); if (eventBatch && eventBatch.count() > 0) { var droppedEvents = eventBatch.split(0, dropNumber); var droppedCount = droppedEvents.count(); if (droppedCount > 0) { if (currentLatency === 4 ) { _immediateQueueSize -= droppedCount; } else { _queueSize -= droppedCount; } _notifyBatchEvents(strEventsDiscarded, [droppedEvents], EventsDiscardedReason.QueueFull); return true; } } currentLatency++; } _resetQueueCounts(); return false; } function _resetQueueCounts() { var immediateQueue = 0; var normalQueue = 0; var _loop_1 = function (latency) { var batchQueue = _batchQueues[latency]; if (batchQueue && batchQueue.batches) { arrForEach(batchQueue.batches, function (theBatch) { if (latency === 4 ) { immediateQueue += theBatch.count(); } else { normalQueue += theBatch.count(); } }); } }; for (var latency = 1 ; latency <= 4 ; latency++) { _loop_1(latency); } _queueSize = normalQueue; _immediateQueueSize = immediateQueue; } function _queueBatches(latency, sendType, sendReason) { var eventsQueued = false; var isAsync = sendType === 0 ; if (!isAsync || _httpManager.canSendRequest()) { doPerf(_self.core, function () { return "PostChannel._queueBatches"; }, function () { var droppedEvents = []; var latencyToProcess = 4 ; while (latencyToProcess >= latency) { var batchQueue = _batchQueues[latencyToProcess]; if (batchQueue && batchQueue.batches && batchQueue.batches.length > 0) { arrForEach(batchQueue.batches, function (theBatch) { if (!_httpManager.addBatch(theBatch)) { droppedEvents = droppedEvents.concat(theBatch.events()); } else { eventsQueued = eventsQueued || (theBatch && theBatch.count() > 0); } if (latencyToProcess === 4 ) { _immediateQueueSize -= theBatch.count(); } else { _queueSize -= theBatch.count(); } }); batchQueue.batches = []; batchQueue.iKeyMap = {}; } latencyToProcess--; } if (droppedEvents.length > 0) { _notifyEvents(strEventsDiscarded, droppedEvents, EventsDiscardedReason.KillSwitch); } if (eventsQueued && _delayedBatchSendLatency >= latency) { _delayedBatchSendLatency = -1; _delayedBatchReason = 0 ; } }, function () { return ({ latency: latency, sendType: sendType, sendReason: sendReason }); }, !isAsync); } else { _delayedBatchSendLatency = _delayedBatchSendLatency >= 0 ? Math.min(_delayedBatchSendLatency, latency) : latency; _delayedBatchReason = Math.max(_delayedBatchReason, sendReason); } return eventsQueued; } function _flushImpl(callback, sendReason) { _sendEventsForLatencyAndAbove(1 , 0 , sendReason); _waitForIdleManager(function () { if (callback) { callback(); } if (_flushCallbackQueue.length > 0) { _flushCallbackTimerId = _createTimer(function () { return _flushImpl(_flushCallbackQueue.shift(), sendReason); }, 0); } else { _flushCallbackTimerId = null; if (_hasEvents()) { _scheduleTimer(); } } }); } function _waitForIdleManager(callback) { if (_httpManager.isCompletelyIdle()) { callback(); } else { _flushCallbackTimerId = _createTimer(function () { _waitForIdleManager(callback); }, FlushCheckTimer); } } function _resetTransmitProfiles() { _clearScheduledTimer(); _initializeProfiles(); _currentProfile = RT_PROFILE; _scheduleTimer(); } function _initializeProfiles() { _profiles = {}; _profiles[RT_PROFILE] = [2, 1, 0]; _profiles[NRT_PROFILE] = [6, 3, 0]; _profiles[BE_PROFILE] = [18, 9, 0]; } function _requeueEvents(batches, reason) { var droppedEvents = []; var maxSendAttempts = _maxEventSendAttempts; if (_isPageUnloadTriggered) { maxSendAttempts = _maxUnloadEventSendAttempts; } arrForEach(batches, function (theBatch) { if (theBatch && theBatch.count() > 0) { arrForEach(theBatch.events(), function (theEvent) { if (theEvent) { if (theEvent.sync) { theEvent.latency = 4 ; theEvent.sync = false; } if (theEvent.sendAttempt < maxSendAttempts) { setProcessTelemetryTimings(theEvent, _self.identifier); _addEventToQueues(theEvent, false); } else { droppedEvents.push(theEvent); } } }); } }); if (droppedEvents.length > 0) { _notifyEvents(strEventsDiscarded, droppedEvents, EventsDiscardedReason.NonRetryableStatus); } if (_isPageUnloadTriggered) { _releaseAllQueues(2 , 2 ); } } function _callNotification(evtName, theArgs) { var manager = (_self._notificationManager || {}); var notifyFunc = manager[evtName]; if (notifyFunc) { try { notifyFunc.apply(manager, theArgs); } catch (e) { _throwInternal(_self.diagLog(), 1 , 74 , evtName + " notification failed: " + e); } } } function _notifyEvents(evtName, theEvents) { var extraArgs = []; for (var _i = 2; _i < arguments.length; _i++) { extraArgs[_i - 2] = arguments[_i]; } if (theEvents && theEvents.length > 0) { _callNotification(evtName, [theEvents].concat(extraArgs)); } } function _notifyBatchEvents(evtName, batches) { var extraArgs = []; for (var _i = 2; _i < arguments.length; _i++) { extraArgs[_i - 2] = arguments[_i]; } if (batches && batches.length > 0) { arrForEach(batches, function (theBatch) { if (theBatch && theBatch.count() > 0) { _callNotification(evtName, [theBatch.events()].concat(extraArgs)); } }); } } function _sendingEvent(batches, reason, isSyncRequest) { if (batches && batches.length > 0) { _callNotification("eventsSendRequest", [(reason >= 1000 && reason <= 1999 ? reason - 1000 : 0 ), isSyncRequest !== true]); } } function _eventsSentEvent(batches, reason) { _notifyBatchEvents("eventsSent", batches, reason); _scheduleTimer(); } function _eventsDropped(batches, reason) { _notifyBatchEvents(strEventsDiscarded, batches, (reason >= 8000 && reason <= 8999 ? reason - 8000 : EventsDiscardedReason.Unknown)); } function _eventsResponseFail(batches) { _notifyBatchEvents(strEventsDiscarded, batches, EventsDiscardedReason.NonRetryableStatus); _scheduleTimer(); } function _otherEvent(batches, reason) { _notifyBatchEvents(strEventsDiscarded, batches, EventsDiscardedReason.Unknown); _scheduleTimer(); } function _setAutoLimits() { if (!_config || !_config.disableAutoBatchFlushLimit) { _autoFlushBatchLimit = Math.max(MaxNumberEventPerBatch * (MaxConnections + 1), _queueSizeLimit / 6); } else { _autoFlushBatchLimit = 0; } } objDefineAccessors(_self, "_setTimeoutOverride", function () { return _timeoutWrapper.set; }, function (value) { _timeoutWrapper = createTimeoutWrapper(value, _timeoutWrapper.clear); }); objDefineAccessors(_self, "_clearTimeoutOverride", function () { return _timeoutWrapper.clear; }, function (value) { _timeoutWrapper = createTimeoutWrapper(_timeoutWrapper.set, value); }); }); return _this; } return PostChannel; }(BaseTelemetryPlugin)); var PostChannel$1 = PostChannel; exports.BE_PROFILE = BE_PROFILE; exports.NRT_PROFILE = NRT_PROFILE; exports.PostChannel = PostChannel$1; exports.RT_PROFILE = RT_PROFILE; (function(obj, prop, descriptor) { /* ai_es3_polyfil defineProperty */ var func = Object["defineProperty"]; if (func) { try { return func(obj, prop, descriptor); } catch(e) { /* IE8 defines defineProperty, but will throw */ } } if (descriptor && typeof descriptor.value !== undefined) { obj[prop] = descriptor.value; } return obj; })(exports, '__esModule', { value: true }); })(this.oneDS = this.oneDS || {});//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/1ds-post-js/bundle/ms.post.gbl.js.map /*! * 1DS JS SDK POST plugin, 3.2.2 * Copyright (c) Microsoft and contributors. All rights reserved. * (Microsoft Internal Only) */ !function(s){"use strict";var l="function",Q="object",J="undefined",a="prototype",f="hasOwnProperty",t=Object,n=t[a],C=t.assign,e=(t.create,t.defineProperty),v=n[f],r=null;function T(n){return void 0===n&&(n=!0),r&&n||(typeof globalThis!==J&&globalThis&&(r=globalThis),typeof self!==J&&self&&(r=self),typeof window!==J&&window&&(r=window),typeof global!==J&&global&&(r=global)),r}function _(n){throw new TypeError(n)}(T()||{}).Symbol,(T()||{}).Reflect;var S=function(n,e){return(S=t.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var t in e)e[f](t)&&(n[t]=e[t])})(n,e)},E="constructor",g="prototype",P="function",R="_dynInstFuncs",L="_isDynProxy",p="_dynClass",M="_dynInstChk",N=M,k="_dfOpts",O="_unknown_",K="__proto__",I="_dyn"+K,A="_dynInstProto",B="useBaseInst",H="setInstFuncs",q=Object,U=q.getPrototypeOf,z=q.getOwnPropertyNames,D=0;function h(n,e){return n&&q[g].hasOwnProperty.call(n,e)}function F(n){return n&&(n===q[g]||n===Array[g])}function j(n){return F(n)||n===Function[g]}function y(n){if(n){if(U)return U(n);var e=n[K]||n[g]||(n[E]?n[E][g]:null),t=n[I]||e;h(n,I)||(delete n[A],t=n[I]=n[A]||n[I],n[A]=e)}return t}function X(n,e){var t=[];if(z)t=z(n);else for(var r in n)"string"==typeof r&&h(n,r)&&t.push(r);if(t&&0=o&&!(n=r===i)){for(var a=0;a=o.maxInternalMessageLimit()||(r=!0,t="AITR_"+e.messageId,c[t]?r=!1:c[t]=!0,r&&(n<=o.telemetryLoggingLevel()&&(o.queue.push(e),u++,a(1===n?"error":"warn",e)),u===o.maxInternalMessageLimit()&&(r=new _e(23,t="Internal events throttle limit per PageView reached for this app.",!1),o.queue.push(r),1===n?o.errorToConsole(t):o.warnToConsole(t))))}})};function un(n,e,t,r,i,o){void 0===o&&(o=!1),(n||new Ee).throwInternal(e,t,r,i,o)}u.ParentContextKey="parent",u.ChildrenContextKey="childEvts";var Pe=u;function u(n,i,e){var t,o=this,a=!1;o.start=G(),o.name=n,o.isAsync=e,o.isChildEvt=function(){return!1},x(i)&&(a=$n(o,"payload",function(){return!t&&x(i)&&(t=i(),i=null),t})),o.getCtx=function(n){return n?(n===u.ParentContextKey||n===u.ChildrenContextKey?o:o.ctx||{})[n]:null},o.setCtx=function(n,e){n&&(n===u.ParentContextKey?(o[n]||(o.isChildEvt=function(){return!0}),o[n]=e):n===u.ChildrenContextKey?o[n]=e:(o.ctx=o.ctx||{})[n]=e)},o.complete=function(){var n=0,e=o.getCtx(u.ChildrenContextKey);if(tn(e))for(var t=0;t>>=0),Ne=123456789+e&c,ke=987654321-e&c,Me=!0}catch(o){}r=((ke=36969*(65535&ke)+(ke>>16)&c)<<16)+(65535&(Ne=18e3*(65535&Ne)+(Ne>>16)&c))>>>0&c|0,t=(r>>>=0)&c}return 0===t&&(t=Math.floor(Le*Math.random()|0)),n||(t>>>=0),t}var Ke=e,Ie="2.8.3",Ae="."+function(n){void 0===n&&(n=22);for(var e=Oe()>>>0,t=0,r=d;r.length>>=6,5==++t&&(e=(Oe()<<2&4294967295|3&e)>>>0,t=0);return r}(6),Be=0;function He(n){return 1===n.nodeType||9===n.nodeType||!+n.nodeType}function qe(n,e){return Hn(n+Be+++((e=void 0!==e&&e)?"."+Ie:"")+Ae)}function Ue(n){var o={id:qe("_aiData-"+(n||"")+"."+Ie),accept:He,get:function(n,e,t,r){var i=n[o.id];return i?i[Hn(e)]:(r&&((i=function(n,e){var t=e[n.id];if(!t){t={};try{He(e)&&!function(n,e,t){if(Ke)try{return Ke(n,e,{value:t,enumerable:!1,configurable:!0}),1}catch(r){}}(e,n.id,t)&&(e[n.id]=t)}catch(r){}}return t}(o,n))[Hn(e)]=t),t)},kill:function(n,e){if(n&&n[e])try{delete n[e]}catch(t){}}};return o}var ze=Ue("plugin");function De(n){return ze.get(n,"state",{},!0)}var Fe="TelemetryPluginChain",je="_hasRun",Xe="_getTelCtx",Qe=0;function Je(n,a,t,e){var r=null,i=[],o=(null!==e&&(r=e?function(n,e,t){for(;n;){if(n.getPlugin()===t)return n;n=n.getNext()}return $e([t],e.config||{},e)}(n,t,e):n),{_next:function(){var n,e=r;return r=e?e.getNext():null,e||(n=i)&&0G()||(delete e[n],!1)}})},ar=function Mr(){var e=!0,t=!0,r=!0,i="use-collector-delta",o=!1;m(Mr,this,function(n){n.allowRequestSending=function(){return e},n.firstRequestSent=function(){r&&(r=!1,o||(e=!1))},n.shouldAddClockSkewHeaders=function(){return t},n.getClockSkewHeaderValue=function(){return i},n.setClockSkew=function(n){o||(n?(i=n,o=t=!0):t=!1,e=!0)}})},ur="sendAttempt",cr="&NoResponseBody=true",sr=((i={})[1]=n,i[100]=n,i[200]="sent",i[8004]=Ot,i[8003]=Ot,i),lr={},fr={};function o(n,e,t){lr[n]=e,!1!==t&&(fr[e]=n)}function dr(n){try{return n.responseText}catch(e){}return""}function vr(n,e){var t=!1;if(n&&e){var r=Wn(n);if(r&&0=N)):q++,1)}function v(){for(var t=0,r=0,n=1;n<=4;n++)!function(e){var n=$[e];n&&n.batches&&rn(n.batches,function(n){4===e?t+=n.count():r+=n.count()})}(n);z=r,q=t}function g(r,n,e){var i=!1,t=0===n;return!t||L.canSendRequest()?cn(p.core,function(){return"PostChannel._queueBatches"},function(){for(var e=[],t=4;r<=t;){var n=$[t];n&&n.batches&&0=N&&(t=!0)})}f(!0,t)},p.pause=function(){c(),H=!0,L.pause()},p.resume=function(){H=!1,L.resume(),a()},p.addResponseHandler=function(n){L._responseHandlers.push(n)},p._loadTransmitProfiles=function(n){c(),e(),j=Nt,a(),en(n,function(n,e){var t,r=e.length;2<=r&&(t=2e[1]&&(t=e[1]),e.push(t),F[n]=e)})},p.flush=function(n,e,t){void 0===n&&(n=!0),H||(c(),t=t||1,n?(g(1,0,t),v(),null==B?B=u(function(){!function r(n,e){o(1,0,e),function t(n){L.isCompletelyIdle()?n():B=u(function(){t(n)},.25)}(function(){n&&n(),0 0) { for (var lp = 0; lp < props.length; lp++) { func(props[lp]); } } } function _isDynamicCandidate(target, funcName, skipOwn) { return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName))); } function _throwTypeError(message) { throw new TypeError("DynamicProto: " + message); } function _getInstanceFuncs(thisTarget) { var instFuncs = {}; _forEachProp(thisTarget, function (name) { if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) { instFuncs[name] = thisTarget[name]; } }); return instFuncs; } function _hasVisited(values, value) { for (var lp = values.length - 1; lp >= 0; lp--) { if (values[lp] === value) { return true; } } return false; } function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) { function _instFuncProxy(target, funcHost, funcName) { var theFunc = funcHost[funcName]; if (theFunc[DynProxyTag] && useBaseInst) { var instFuncTable = target[DynInstFuncTable] || {}; if (instFuncTable[DynAllowInstChkTag] !== false) { theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc; } } return function () { return theFunc.apply(target, arguments); }; } var baseFuncs = {}; _forEachProp(instFuncs, function (name) { baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name); }); var baseProto = _getObjProto$1(classProto); var visited = []; while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) { _forEachProp(baseProto, function (name) { if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf$1)) { baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name); } }); visited.push(baseProto); baseProto = _getObjProto$1(baseProto); } return baseFuncs; } function _getInstFunc(target, funcName, proto, currentDynProtoProxy) { var instFunc = null; if (target && _hasOwnProperty(proto, DynClassName)) { var instFuncTable = target[DynInstFuncTable] || {}; instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName]; if (!instFunc) { _throwTypeError("Missing [" + funcName + "] " + strFunction); } if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) { var canAddInst = !_hasOwnProperty(target, funcName); var objProto = _getObjProto$1(target); var visited = []; while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) { var protoFunc = objProto[funcName]; if (protoFunc) { canAddInst = (protoFunc === currentDynProtoProxy); break; } visited.push(objProto); objProto = _getObjProto$1(objProto); } try { if (canAddInst) { target[funcName] = instFunc; } instFunc[DynInstChkTag] = 1; } catch (e) { instFuncTable[DynAllowInstChkTag] = false; } } } return instFunc; } function _getProtoFunc(funcName, proto, currentDynProtoProxy) { var protoFunc = proto[funcName]; if (protoFunc === currentDynProtoProxy) { protoFunc = _getObjProto$1(proto)[funcName]; } if (typeof protoFunc !== strFunction) { _throwTypeError("[" + funcName + "] is not a " + strFunction); } return protoFunc; } function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) { function _createDynamicPrototype(proto, funcName) { var dynProtoProxy = function () { var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy); return instFunc.apply(this, arguments); }; dynProtoProxy[DynProxyTag] = 1; return dynProtoProxy; } if (!_isObjectOrArrayPrototype(proto)) { var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {}; var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {}); if (instFuncTable[DynAllowInstChkTag] !== false) { instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc; } _forEachProp(target, function (name) { if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) { instFuncs_1[name] = target[name]; delete target[name]; if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) { proto[name] = _createDynamicPrototype(proto, name); } } }); } } function _checkPrototype(classProto, thisTarget) { if (_objGetPrototypeOf$1) { var visited = []; var thisProto = _getObjProto$1(thisTarget); while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) { if (thisProto === classProto) { return true; } visited.push(thisProto); thisProto = _getObjProto$1(thisProto); } return false; } return true; } function _getObjName(target, unknownValue) { if (_hasOwnProperty(target, Prototype)) { return target.name || unknownValue || UnknownValue; } return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue; } function dynamicProto(theClass, target, delegateFunc, options) { if (!_hasOwnProperty(theClass, Prototype)) { _throwTypeError("theClass is an invalid class definition."); } var classProto = theClass[Prototype]; if (!_checkPrototype(classProto, target)) { _throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]"); } var className = null; if (_hasOwnProperty(classProto, DynClassName)) { className = classProto[DynClassName]; } else { className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _dynamicNames; _dynamicNames++; classProto[DynClassName] = className; } var perfOptions = dynamicProto[DynProtoDefaultOptions]; var useBaseInst = !!perfOptions[strUseBaseInst]; if (useBaseInst && options && options[strUseBaseInst] !== undefined) { useBaseInst = !!options[strUseBaseInst]; } var instFuncs = _getInstanceFuncs(target); var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst); delegateFunc(target, baseFuncs); var setInstanceFunc = !!_objGetPrototypeOf$1 && !!perfOptions[strSetInstFuncs]; if (setInstanceFunc && options) { setInstanceFunc = !!options[strSetInstFuncs]; } _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false); } var perfDefaults = { setInstFuncs: true, useBaseInst: true }; dynamicProto[DynProtoDefaultOptions] = perfDefaults; var strEmpty = ""; var strSetNextPlugin = "setNextPlugin"; var strIsInitialized = "isInitialized"; var strTeardown = "teardown"; var strCore = "core"; var strUpdate = "update"; var strDisabled = "disabled"; var strDoTeardown = "_doTeardown"; var cStrStartsWith = "startsWith"; var strIndexOf = "indexOf"; var cStrTrim = "trim"; var strToString = "toString"; var str__Proto = "__proto__"; var strConstructor = "constructor"; var _objDefineProperty$1 = ObjDefineProperty; var _objFreeze = ObjClass.freeze; var _objKeys = ObjClass.keys; var StringProto = String[strShimPrototype]; var _strTrim = StringProto[cStrTrim]; var _strStartsWith = StringProto[cStrStartsWith]; var _isArray = Array.isArray; var _objToString = ObjProto[strToString]; var _fnToString = ObjHasOwnProperty[strToString]; var _objFunctionString = _fnToString.call(ObjClass); var rCamelCase = /-([a-z])/g; var rNormalizeInvalid = /([^\w\d_$])/g; var rLeadingNumeric = /^(\d+[\w\d_$])/; var _objGetPrototypeOf = Object["getPrototypeOf"]; function _getObjProto(target) { if (target) { if (_objGetPrototypeOf) { return _objGetPrototypeOf(target); } var newProto = target[str__Proto] || target[strShimPrototype] || target[strConstructor]; if (newProto) { return newProto; } } return null; } function isUndefined(value) { return value === undefined || typeof value === strShimUndefined; } function isNullOrUndefined(value) { return (value === null || isUndefined(value)); } function hasOwnProperty(obj, prop) { return !!(obj && ObjHasOwnProperty.call(obj, prop)); } function isObject(value) { return !!(value && typeof value === strShimObject); } function isFunction(value) { return !!(value && typeof value === strShimFunction); } function normalizeJsName(name) { var value = name; if (value && isString(value)) { value = value.replace(rCamelCase, function (_all, letter) { return letter.toUpperCase(); }); value = value.replace(rNormalizeInvalid, "_"); value = value.replace(rLeadingNumeric, function (_all, match) { return "_" + match; }); } return value; } function objForEachKey(target, callbackfn) { if (target) { for (var prop in target) { if (ObjHasOwnProperty.call(target, prop)) { callbackfn.call(target, prop, target[prop]); } } } } function strStartsWith(value, checkValue) { var result = false; if (value && checkValue && !(result = value === checkValue)) { result = _strStartsWith ? value[cStrStartsWith](checkValue) : _strStartsWithPoly(value, checkValue); } return result; } function _strStartsWithPoly(value, checkValue) { var result = false; var chkLen = checkValue ? checkValue.length : 0; if (value && chkLen && value.length >= chkLen && !(result = value === checkValue)) { for (var lp = 0; lp < chkLen; lp++) { if (value[lp] !== checkValue[lp]) { return false; } } result = true; } return result; } function strContains(value, search) { if (value && search) { return value.indexOf(search) !== -1; } return false; } var isArray = _isArray || _isArrayPoly; function _isArrayPoly(obj) { return !!(obj && _objToString.call(obj) === "[object Array]"); } function isString(value) { return typeof value === "string"; } function isNumber(value) { return typeof value === "number"; } function isBoolean(value) { return typeof value === "boolean"; } function isPlainObject(value) { var result = false; if (value && typeof value === "object") { var proto = _objGetPrototypeOf ? _objGetPrototypeOf(value) : _getObjProto(value); if (!proto) { result = true; } else { if (proto[strConstructor] && ObjHasOwnProperty.call(proto, strConstructor)) { proto = proto[strConstructor]; } result = typeof proto === strShimFunction && _fnToString.call(proto) === _objFunctionString; } } return result; } function arrForEach(arr, callbackfn, thisArg) { var len = arr.length; try { for (var idx = 0; idx < len; idx++) { if (idx in arr) { if (callbackfn.call(thisArg || arr, arr[idx], idx, arr) === -1) { break; } } } } catch (e) { } } function arrIndexOf(arr, searchElement, fromIndex) { if (arr) { if (arr[strIndexOf]) { return arr[strIndexOf](searchElement, fromIndex); } var len = arr.length; var from = fromIndex || 0; try { for (var lp = Math.max(from >= 0 ? from : len - Math.abs(from), 0); lp < len; lp++) { if (lp in arr && arr[lp] === searchElement) { return lp; } } } catch (e) { } } return -1; } function strTrim(str) { if (str) { str = (_strTrim && str[cStrTrim]) ? str[cStrTrim]() : (str.replace ? str.replace(/^\s+|\s+$/g, "") : str); } return str; } var _objKeysHasDontEnumBug = !({ toString: null }).propertyIsEnumerable("toString"); var _objKeysDontEnums = [ "toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor" ]; function objKeys(obj) { var objType = typeof obj; if (objType !== strShimFunction && (objType !== strShimObject || obj === null)) { throwTypeError("objKeys called on non-object"); } if (!_objKeysHasDontEnumBug && _objKeys) { return _objKeys(obj); } var result = []; for (var prop in obj) { if (obj && ObjHasOwnProperty.call(obj, prop)) { result.push(prop); } } if (_objKeysHasDontEnumBug) { var dontEnumsLength = _objKeysDontEnums.length; for (var lp = 0; lp < dontEnumsLength; lp++) { if (obj && ObjHasOwnProperty.call(obj, _objKeysDontEnums[lp])) { result.push(_objKeysDontEnums[lp]); } } } return result; } function objDefineAccessors(target, prop, getProp, setProp) { if (_objDefineProperty$1) { try { var descriptor = { enumerable: true, configurable: true }; if (getProp) { descriptor.get = getProp; } if (setProp) { descriptor.set = setProp; } _objDefineProperty$1(target, prop, descriptor); return true; } catch (e) { } } return false; } function _doNothing(value) { return value; } function deepFreeze(obj) { if (_objFreeze) { objForEachKey(obj, function (name, value) { if (isArray(value) || isObject(value)) { _objFreeze(value); } }); } return objFreeze(obj); } var objFreeze = _objFreeze || _doNothing; function dateNow() { var dt = Date; return dt.now ? dt.now() : new dt().getTime(); } function setValue(target, field, value, valChk, srcChk) { var theValue = value; if (target) { theValue = target[field]; if (theValue !== value && (!srcChk || srcChk(theValue)) && (!valChk || valChk(value))) { theValue = value; target[field] = theValue; } } return theValue; } function _createProxyFunction(source, funcName) { var srcFunc = null; var src = null; if (isFunction(source)) { srcFunc = source; } else { src = source; } return function () { var originalArguments = arguments; if (srcFunc) { src = srcFunc(); } if (src) { return src[funcName].apply(src, originalArguments); } }; } function proxyFunctionAs(target, name, source, theFunc, overwriteTarget) { if (target && name && source) { if (overwriteTarget !== false || isUndefined(target[name])) { target[name] = _createProxyFunction(source, theFunc); } } } function optimizeObject(theObject) { if (theObject && ObjAssign) { theObject = ObjClass(ObjAssign({}, theObject)); } return theObject; } function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) { var theArgs = arguments; var extended = theArgs[0] || {}; var argLen = theArgs.length; var deep = false; var idx = 1; if (argLen > 0 && isBoolean(extended)) { deep = extended; extended = theArgs[idx] || {}; idx++; } if (!isObject(extended)) { extended = {}; } for (; idx < argLen; idx++) { var arg = theArgs[idx]; var isArgArray = isArray(arg); var isArgObj = isObject(arg); for (var prop in arg) { var propOk = (isArgArray && (prop in arg)) || (isArgObj && (ObjHasOwnProperty.call(arg, prop))); if (!propOk) { continue; } var newValue = arg[prop]; var isNewArray = void 0; if (deep && newValue && ((isNewArray = isArray(newValue)) || isPlainObject(newValue))) { var clone = extended[prop]; if (isNewArray) { if (!isArray(clone)) { clone = []; } } else if (!isPlainObject(clone)) { clone = {}; } newValue = objExtend(deep, clone, newValue); } if (newValue !== undefined) { extended[prop] = newValue; } } } return extended; } function createEnumStyle(values) { var enumClass = {}; objForEachKey(values, function (field, value) { enumClass[field] = value; enumClass[value] = field; }); return deepFreeze(enumClass); } var EventsDiscardedReason = createEnumStyle({ Unknown: 0 , NonRetryableStatus: 1 , InvalidEvent: 2 , SizeLimitExceeded: 3 , KillSwitch: 4 , QueueFull: 5 }); var strWindow = "window"; var strDocument = "document"; var strNavigator = "navigator"; var strLocation = "location"; var strConsole = "console"; var strPerformance = "performance"; var strJSON = "JSON"; var strCrypto = "crypto"; var strMsCrypto = "msCrypto"; var strReactNative = "ReactNative"; var strMsie = "msie"; var strTrident = "trident/"; var strXMLHttpRequest = "XMLHttpRequest"; var _isTrident = null; var _navUserAgentCheck = null; var _enableMocks = false; var _useXDomainRequest = null; var _beaconsSupported = null; function _hasProperty(theClass, property) { var supported = false; if (theClass) { try { supported = property in theClass; if (!supported) { var proto = theClass[strShimPrototype]; if (proto) { supported = property in proto; } } } catch (e) { } if (!supported) { try { var tmp = new theClass(); supported = !isUndefined(tmp[property]); } catch (e) { } } } return supported; } function getGlobalInst(name) { var gbl = getGlobal(); if (gbl && gbl[name]) { return gbl[name]; } if (name === strWindow && hasWindow()) { return window; } return null; } function hasWindow() { return Boolean(typeof window === strShimObject && window); } function getWindow() { if (hasWindow()) { return window; } return getGlobalInst(strWindow); } function hasDocument() { return Boolean(typeof document === strShimObject && document); } function getDocument() { if (hasDocument()) { return document; } return getGlobalInst(strDocument); } function hasNavigator() { return Boolean(typeof navigator === strShimObject && navigator); } function getNavigator() { if (hasNavigator()) { return navigator; } return getGlobalInst(strNavigator); } function getLocation(checkForMock) { if (checkForMock && _enableMocks) { var mockLocation = getGlobalInst("__mockLocation"); if (mockLocation) { return mockLocation; } } if (typeof location === strShimObject && location) { return location; } return getGlobalInst(strLocation); } function getConsole() { if (typeof console !== strShimUndefined) { return console; } return getGlobalInst(strConsole); } function getPerformance() { return getGlobalInst(strPerformance); } function hasJSON() { return Boolean((typeof JSON === strShimObject && JSON) || getGlobalInst(strJSON) !== null); } function getJSON() { if (hasJSON()) { return JSON || getGlobalInst(strJSON); } return null; } function getCrypto() { return getGlobalInst(strCrypto); } function getMsCrypto() { return getGlobalInst(strMsCrypto); } function isReactNative() { var nav = getNavigator(); if (nav && nav.product) { return nav.product === strReactNative; } return false; } function isIE() { var nav = getNavigator(); if (nav && (nav.userAgent !== _navUserAgentCheck || _isTrident === null)) { _navUserAgentCheck = nav.userAgent; var userAgent = (_navUserAgentCheck || strEmpty).toLowerCase(); _isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident)); } return _isTrident; } function dumpObj(object) { var objectTypeDump = Object[strShimPrototype].toString.call(object); var propertyValueDump = strEmpty; if (objectTypeDump === "[object Error]") { propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'"; } else if (hasJSON()) { propertyValueDump = getJSON().stringify(object); } return objectTypeDump + propertyValueDump; } function isBeaconsSupported() { if (_beaconsSupported === null) { _beaconsSupported = hasNavigator() && Boolean(getNavigator().sendBeacon); } return _beaconsSupported; } function isFetchSupported(withKeepAlive) { var isSupported = false; try { isSupported = !!getGlobalInst("fetch"); var request = getGlobalInst("Request"); if (isSupported && withKeepAlive && request) { isSupported = _hasProperty(request, "keepalive"); } } catch (e) { } return isSupported; } function useXDomainRequest() { if (_useXDomainRequest === null) { _useXDomainRequest = (typeof XDomainRequest !== strShimUndefined); if (_useXDomainRequest && isXhrSupported()) { _useXDomainRequest = _useXDomainRequest && !_hasProperty(getGlobalInst(strXMLHttpRequest), "withCredentials"); } } return _useXDomainRequest; } function isXhrSupported() { var isSupported = false; try { var xmlHttpRequest = getGlobalInst(strXMLHttpRequest); isSupported = !!xmlHttpRequest; } catch (e) { } return isSupported; } var _aiNamespace = null; function _getExtensionNamespace() { var target = getGlobalInst("Microsoft"); if (target) { _aiNamespace = target["ApplicationInsights"]; } return _aiNamespace; } function getDebugExt(config) { var ns = _aiNamespace; if (!ns && config.disableDbgExt !== true) { ns = _aiNamespace || _getExtensionNamespace(); } return ns ? ns["ChromeDbgExt"] : null; } var AiNonUserActionablePrefix = "AI (Internal): "; var AiUserActionablePrefix = "AI: "; var AIInternalMessagePrefix = "AITR_"; var strErrorToConsole = "errorToConsole"; var strWarnToConsole = "warnToConsole"; function _sanitizeDiagnosticText(text) { if (text) { return "\"" + text.replace(/\"/g, strEmpty) + "\""; } return strEmpty; } function _logToConsole(func, message) { var theConsole = getConsole(); if (!!theConsole) { var logFunc = "log"; if (theConsole[func]) { logFunc = func; } if (isFunction(theConsole[logFunc])) { theConsole[logFunc](message); } } } var _InternalLogMessage = /** @class */ (function () { function _InternalLogMessage(msgId, msg, isUserAct, properties) { if (isUserAct === void 0) { isUserAct = false; } var _self = this; _self.messageId = msgId; _self.message = (isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) + msgId; var strProps = strEmpty; if (hasJSON()) { strProps = getJSON().stringify(properties); } var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : strEmpty) + (properties ? " props:" + _sanitizeDiagnosticText(strProps) : strEmpty); _self.message += diagnosticText; } _InternalLogMessage.dataType = "MessageData"; return _InternalLogMessage; }()); function safeGetLogger(core, config) { return (core || {}).logger || new DiagnosticLogger(config); } var DiagnosticLogger = /** @class */ (function () { function DiagnosticLogger(config) { this.identifier = "DiagnosticLogger"; this.queue = []; var _messageCount = 0; var _messageLogged = {}; dynamicProto(DiagnosticLogger, this, function (_self) { if (isNullOrUndefined(config)) { config = {}; } _self.consoleLoggingLevel = function () { return _getConfigValue("loggingLevelConsole", 0); }; _self.telemetryLoggingLevel = function () { return _getConfigValue("loggingLevelTelemetry", 1); }; _self.maxInternalMessageLimit = function () { return _getConfigValue("maxMessageLimit", 25); }; _self.enableDebugExceptions = function () { return _getConfigValue("enableDebugExceptions", false); }; _self.throwInternal = function (severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } var message = new _InternalLogMessage(msgId, msg, isUserAct, properties); if (_self.enableDebugExceptions()) { throw dumpObj(message); } else { var logFunc = severity === 1 ? strErrorToConsole : strWarnToConsole; if (!isUndefined(message.message)) { var logLevel = _self.consoleLoggingLevel(); if (isUserAct) { var messageKey = +message.messageId; if (!_messageLogged[messageKey] && logLevel >= severity) { _self[logFunc](message.message); _messageLogged[messageKey] = true; } } else { if (logLevel >= severity) { _self[logFunc](message.message); } } _self.logInternalMessage(severity, message); } else { _debugExtMsg("throw" + (severity === 1 ? "Critical" : "Warning"), message); } } }; _self.warnToConsole = function (message) { _logToConsole("warn", message); _debugExtMsg("warning", message); }; _self.errorToConsole = function (message) { _logToConsole("error", message); _debugExtMsg("error", message); }; _self.resetInternalMessageCount = function () { _messageCount = 0; _messageLogged = {}; }; _self.logInternalMessage = function (severity, message) { if (_areInternalMessagesThrottled()) { return; } var logMessage = true; var messageKey = AIInternalMessagePrefix + message.messageId; if (_messageLogged[messageKey]) { logMessage = false; } else { _messageLogged[messageKey] = true; } if (logMessage) { if (severity <= _self.telemetryLoggingLevel()) { _self.queue.push(message); _messageCount++; _debugExtMsg((severity === 1 ? "error" : "warn"), message); } if (_messageCount === _self.maxInternalMessageLimit()) { var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app."; var throttleMessage = new _InternalLogMessage(23 , throttleLimitMessage, false); _self.queue.push(throttleMessage); if (severity === 1 ) { _self.errorToConsole(throttleLimitMessage); } else { _self.warnToConsole(throttleLimitMessage); } } } }; function _getConfigValue(name, defValue) { var value = config[name]; if (!isNullOrUndefined(value)) { return value; } return defValue; } function _areInternalMessagesThrottled() { return _messageCount >= _self.maxInternalMessageLimit(); } function _debugExtMsg(name, data) { var dbgExt = getDebugExt(config); if (dbgExt && dbgExt.diagLog) { dbgExt.diagLog(name, data); } } }); } return DiagnosticLogger; }()); function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } (logger || new DiagnosticLogger()).throwInternal(severity, msgId, msg, properties, isUserAct); } var strExecutionContextKey = "ctx"; var PerfEvent = /** @class */ (function () { function PerfEvent(name, payloadDetails, isAsync) { var _self = this; var accessorDefined = false; _self.start = dateNow(); _self.name = name; _self.isAsync = isAsync; _self.isChildEvt = function () { return false; }; if (isFunction(payloadDetails)) { var theDetails_1; accessorDefined = objDefineAccessors(_self, "payload", function () { if (!theDetails_1 && isFunction(payloadDetails)) { theDetails_1 = payloadDetails(); payloadDetails = null; } return theDetails_1; }); } _self.getCtx = function (key) { if (key) { if (key === PerfEvent.ParentContextKey || key === PerfEvent.ChildrenContextKey) { return _self[key]; } return (_self[strExecutionContextKey] || {})[key]; } return null; }; _self.setCtx = function (key, value) { if (key) { if (key === PerfEvent.ParentContextKey) { if (!_self[key]) { _self.isChildEvt = function () { return true; }; } _self[key] = value; } else if (key === PerfEvent.ChildrenContextKey) { _self[key] = value; } else { var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {}; ctx[key] = value; } } }; _self.complete = function () { var childTime = 0; var childEvts = _self.getCtx(PerfEvent.ChildrenContextKey); if (isArray(childEvts)) { for (var lp = 0; lp < childEvts.length; lp++) { var childEvt = childEvts[lp]; if (childEvt) { childTime += childEvt.time; } } } _self.time = dateNow() - _self.start; _self.exTime = _self.time - childTime; _self.complete = function () { }; if (!accessorDefined && isFunction(payloadDetails)) { _self.payload = payloadDetails(); } }; } PerfEvent.ParentContextKey = "parent"; PerfEvent.ChildrenContextKey = "childEvts"; return PerfEvent; }()); var doPerfActiveKey = "CoreUtils.doPerf"; function doPerf(mgrSource, getSource, func, details, isAsync) { if (mgrSource) { var perfMgr = mgrSource; if (isFunction(perfMgr["getPerfMgr"])) { perfMgr = perfMgr["getPerfMgr"](); } if (perfMgr) { var perfEvt = void 0; var currentActive = perfMgr.getCtx(doPerfActiveKey); try { perfEvt = perfMgr.create(getSource(), details, isAsync); if (perfEvt) { if (currentActive && perfEvt.setCtx) { perfEvt.setCtx(PerfEvent.ParentContextKey, currentActive); if (currentActive.getCtx && currentActive.setCtx) { var children = currentActive.getCtx(PerfEvent.ChildrenContextKey); if (!children) { children = []; currentActive.setCtx(PerfEvent.ChildrenContextKey, children); } children.push(perfEvt); } } perfMgr.setCtx(doPerfActiveKey, perfEvt); return func(perfEvt); } } catch (ex) { if (perfEvt && perfEvt.setCtx) { perfEvt.setCtx("exception", ex); } } finally { if (perfEvt) { perfMgr.fire(perfEvt); } perfMgr.setCtx(doPerfActiveKey, currentActive); } } } return func(); } var UInt32Mask = 0x100000000; var MaxUInt32 = 0xffffffff; var _mwcSeeded = false; var _mwcW = 123456789; var _mwcZ = 987654321; function _mwcSeed(seedValue) { if (seedValue < 0) { seedValue >>>= 0; } _mwcW = (123456789 + seedValue) & MaxUInt32; _mwcZ = (987654321 - seedValue) & MaxUInt32; _mwcSeeded = true; } function _autoSeedMwc() { try { var now = dateNow() & 0x7fffffff; _mwcSeed(((Math.random() * UInt32Mask) ^ now) + now); } catch (e) { } } function random32(signed) { var value = 0; var c = getCrypto() || getMsCrypto(); if (c && c.getRandomValues) { value = c.getRandomValues(new Uint32Array(1))[0] & MaxUInt32; } if (value === 0 && isIE()) { if (!_mwcSeeded) { _autoSeedMwc(); } value = mwcRandom32() & MaxUInt32; } if (value === 0) { value = Math.floor((UInt32Mask * Math.random()) | 0); } if (!signed) { value >>>= 0; } return value; } function mwcRandom32(signed) { _mwcZ = (36969 * (_mwcZ & 0xFFFF) + (_mwcZ >> 16)) & MaxUInt32; _mwcW = (18000 * (_mwcW & 0xFFFF) + (_mwcW >> 16)) & MaxUInt32; var value = (((_mwcZ << 16) + (_mwcW & 0xFFFF)) >>> 0) & MaxUInt32 | 0; if (!signed) { value >>>= 0; } return value; } function newId(maxLength) { if (maxLength === void 0) { maxLength = 22; } var base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; var number = random32() >>> 0; var chars = 0; var result = strEmpty; while (result.length < maxLength) { chars++; result += base64chars.charAt(number & 0x3F); number >>>= 6; if (chars === 5) { number = (((random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0; chars = 0; } } return result; } var _objDefineProperty = ObjDefineProperty; var version = "2.8.3"; var instanceName = "." + newId(6); var _dataUid = 0; function _createAccessor(target, prop, value) { if (_objDefineProperty) { try { _objDefineProperty(target, prop, { value: value, enumerable: false, configurable: true }); return true; } catch (e) { } } return false; } function _canAcceptData(target) { return target.nodeType === 1 || target.nodeType === 9 || !(+target.nodeType); } function _getCache(data, target) { var theCache = target[data.id]; if (!theCache) { theCache = {}; try { if (_canAcceptData(target)) { if (!_createAccessor(target, data.id, theCache)) { target[data.id] = theCache; } } } catch (e) { } } return theCache; } function createUniqueNamespace(name, includeVersion) { if (includeVersion === void 0) { includeVersion = false; } return normalizeJsName(name + (_dataUid++) + (includeVersion ? "." + version : "") + instanceName); } function createElmNodeData(name) { var data = { id: createUniqueNamespace("_aiData-" + (name || "") + "." + version), accept: function (target) { return _canAcceptData(target); }, get: function (target, name, defValue, addDefault) { var theCache = target[data.id]; if (!theCache) { if (addDefault) { theCache = _getCache(data, target); theCache[normalizeJsName(name)] = defValue; } return defValue; } return theCache[normalizeJsName(name)]; }, kill: function (target, name) { if (target && target[name]) { try { delete target[name]; } catch (e) { } } } }; return data; } var pluginStateData = createElmNodeData("plugin"); function _getPluginState(plugin) { return pluginStateData.get(plugin, "state", {}, true); } var strTelemetryPluginChain = "TelemetryPluginChain"; var strHasRunFlags = "_hasRun"; var strGetTelCtx = "_getTelCtx"; var _chainId = 0; function _getNextProxyStart(proxy, core, startAt) { while (proxy) { if (proxy.getPlugin() === startAt) { return proxy; } proxy = proxy.getNext(); } return createTelemetryProxyChain([startAt], core.config || {}, core); } function _createInternalContext(telemetryChain, config, core, startAt) { var _nextProxy = null; var _onComplete = []; if (startAt !== null) { _nextProxy = startAt ? _getNextProxyStart(telemetryChain, core, startAt) : telemetryChain; } var context = { _next: _moveNext, ctx: { core: function () { return core; }, diagLog: function () { return safeGetLogger(core, config); }, getCfg: function () { return config; }, getExtCfg: _getExtCfg, getConfig: _getConfig, hasNext: function () { return !!_nextProxy; }, getNext: function () { return _nextProxy; }, setNext: function (nextPlugin) { _nextProxy = nextPlugin; }, iterate: _iterateChain, onComplete: _addOnComplete } }; function _addOnComplete(onComplete, that) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } if (onComplete) { _onComplete.push({ func: onComplete, self: !isUndefined(that) ? that : context.ctx, args: args }); } } function _moveNext() { var nextProxy = _nextProxy; _nextProxy = nextProxy ? nextProxy.getNext() : null; if (!nextProxy) { var onComplete = _onComplete; if (onComplete && onComplete.length > 0) { arrForEach(onComplete, function (completeDetails) { try { completeDetails.func.call(completeDetails.self, completeDetails.args); } catch (e) { _throwInternal(core.logger, 2 , 73 , "Unexpected Exception during onComplete - " + dumpObj(e)); } }); _onComplete = []; } } return nextProxy; } function _getExtCfg(identifier, defaultValue, mergeDefault) { if (defaultValue === void 0) { defaultValue = {}; } if (mergeDefault === void 0) { mergeDefault = 0 ; } var theConfig; if (config) { var extConfig = config.extensionConfig; if (extConfig && identifier) { theConfig = extConfig[identifier]; } } if (!theConfig) { theConfig = defaultValue; } else if (isObject(defaultValue)) { if (mergeDefault !== 0 ) { var newConfig_1 = objExtend(true, defaultValue, theConfig); if (config && mergeDefault === 2 ) { objForEachKey(defaultValue, function (field) { if (isNullOrUndefined(newConfig_1[field])) { var cfgValue = config[field]; if (!isNullOrUndefined(cfgValue)) { newConfig_1[field] = cfgValue; } } }); } theConfig = newConfig_1; } } return theConfig; } function _getConfig(identifier, field, defaultValue) { if (defaultValue === void 0) { defaultValue = false; } var theValue; var extConfig = _getExtCfg(identifier, null); if (extConfig && !isNullOrUndefined(extConfig[field])) { theValue = extConfig[field]; } else if (config && !isNullOrUndefined(config[field])) { theValue = config[field]; } return !isNullOrUndefined(theValue) ? theValue : defaultValue; } function _iterateChain(cb) { var nextPlugin; while (!!(nextPlugin = context._next())) { var plugin = nextPlugin.getPlugin(); if (plugin) { cb(plugin); } } } return context; } function createProcessTelemetryContext(telemetryChain, config, core, startAt) { var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(env) { var nextPlugin = internalContext._next(); nextPlugin && nextPlugin.processTelemetry(env, context); return !nextPlugin; } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryContext(plugins || context.getNext(), config, core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } function createProcessTelemetryUnloadContext(telemetryChain, core, startAt) { var config = core.config || {}; var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(unloadState) { var nextPlugin = internalContext._next(); nextPlugin && nextPlugin.unload(context, unloadState); return !nextPlugin; } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryUnloadContext(plugins || context.getNext(), core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } function createProcessTelemetryUpdateContext(telemetryChain, core, startAt) { var config = core.config || {}; var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(updateState) { return context.iterate(function (plugin) { if (isFunction(plugin.update)) { plugin.update(context, updateState); } }); } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryUpdateContext(plugins || context.getNext(), core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } function createTelemetryProxyChain(plugins, config, core, startAt) { var firstProxy = null; var add = startAt ? false : true; if (isArray(plugins) && plugins.length > 0) { var lastProxy_1 = null; arrForEach(plugins, function (thePlugin) { if (!add && startAt === thePlugin) { add = true; } if (add && thePlugin && isFunction(thePlugin.processTelemetry)) { var newProxy = createTelemetryPluginProxy(thePlugin, config, core); if (!firstProxy) { firstProxy = newProxy; } if (lastProxy_1) { lastProxy_1._setNext(newProxy); } lastProxy_1 = newProxy; } }); } if (startAt && !firstProxy) { return createTelemetryProxyChain([startAt], config, core); } return firstProxy; } function createTelemetryPluginProxy(plugin, config, core) { var nextProxy = null; var hasProcessTelemetry = isFunction(plugin.processTelemetry); var hasSetNext = isFunction(plugin.setNextPlugin); var chainId; if (plugin) { chainId = plugin.identifier + "-" + plugin.priority + "-" + _chainId++; } else { chainId = "Unknown-0-" + _chainId++; } var proxyChain = { getPlugin: function () { return plugin; }, getNext: function () { return nextProxy; }, processTelemetry: _processTelemetry, unload: _unloadPlugin, update: _updatePlugin, _id: chainId, _setNext: function (nextPlugin) { nextProxy = nextPlugin; } }; function _getTelCtx() { var itemCtx; if (plugin && isFunction(plugin[strGetTelCtx])) { itemCtx = plugin[strGetTelCtx](); } if (!itemCtx) { itemCtx = createProcessTelemetryContext(proxyChain, config, core); } return itemCtx; } function _processChain(itemCtx, processPluginFn, name, details, isAsync) { var hasRun = false; var identifier = plugin ? plugin.identifier : strTelemetryPluginChain; var hasRunContext = itemCtx[strHasRunFlags]; if (!hasRunContext) { hasRunContext = itemCtx[strHasRunFlags] = {}; } itemCtx.setNext(nextProxy); if (plugin) { doPerf(itemCtx[strCore](), function () { return identifier + ":" + name; }, function () { hasRunContext[chainId] = true; try { var nextId = nextProxy ? nextProxy._id : strEmpty; if (nextId) { hasRunContext[nextId] = false; } hasRun = processPluginFn(itemCtx); } catch (error) { var hasNextRun = nextProxy ? hasRunContext[nextProxy._id] : true; if (hasNextRun) { hasRun = true; } if (!nextProxy || !hasNextRun) { _throwInternal(itemCtx.diagLog(), 1 , 73 , "Plugin [" + identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext)); } } }, details, isAsync); } return hasRun; } function _processTelemetry(env, itemCtx) { itemCtx = itemCtx || _getTelCtx(); function _callProcessTelemetry(itemCtx) { if (!plugin || !hasProcessTelemetry) { return false; } var pluginState = _getPluginState(plugin); if (pluginState.teardown || pluginState[strDisabled]) { return false; } if (hasSetNext) { plugin.setNextPlugin(nextProxy); } plugin.processTelemetry(env, itemCtx); return true; } if (!_processChain(itemCtx, _callProcessTelemetry, "processTelemetry", function () { return ({ item: env }); }, !(env.sync))) { itemCtx.processNext(env); } } function _unloadPlugin(unloadCtx, unloadState) { function _callTeardown() { var hasRun = false; if (plugin) { var pluginState = _getPluginState(plugin); var pluginCore = plugin[strCore] || pluginState.core; if (plugin && (!pluginCore || pluginCore === unloadCtx[strCore]()) && !pluginState[strTeardown]) { pluginState[strCore] = null; pluginState[strTeardown] = true; pluginState[strIsInitialized] = false; if (plugin[strTeardown] && plugin[strTeardown](unloadCtx, unloadState) === true) { hasRun = true; } } } return hasRun; } if (!_processChain(unloadCtx, _callTeardown, "unload", function () { }, unloadState.isAsync)) { unloadCtx.processNext(unloadState); } } function _updatePlugin(updateCtx, updateState) { function _callUpdate() { var hasRun = false; if (plugin) { var pluginState = _getPluginState(plugin); var pluginCore = plugin[strCore] || pluginState.core; if (plugin && (!pluginCore || pluginCore === updateCtx[strCore]()) && !pluginState[strTeardown]) { if (plugin[strUpdate] && plugin[strUpdate](updateCtx, updateState) === true) { hasRun = true; } } } return hasRun; } if (!_processChain(updateCtx, _callUpdate, "update", function () { }, false)) { updateCtx.processNext(updateState); } } return objFreeze(proxyChain); } var strExtensionConfig = "extensionConfig"; function createUnloadHandlerContainer() { var handlers = []; function _addHandler(handler) { if (handler) { handlers.push(handler); } } function _runHandlers(unloadCtx, unloadState) { arrForEach(handlers, function (handler) { try { handler(unloadCtx, unloadState); } catch (e) { _throwInternal(unloadCtx.diagLog(), 2 , 73 , "Unexpected error calling unload handler - " + dumpObj(e)); } }); handlers = []; } return { add: _addHandler, run: _runHandlers }; } var strGetPlugin = "getPlugin"; var BaseTelemetryPlugin = /** @class */ (function () { function BaseTelemetryPlugin() { var _self = this; var _isinitialized; var _rootCtx; var _nextPlugin; var _unloadHandlerContainer; var _hooks; _initDefaults(); dynamicProto(BaseTelemetryPlugin, _self, function (_self) { _self.initialize = function (config, core, extensions, pluginChain) { _setDefaults(config, core, pluginChain); _isinitialized = true; }; _self.teardown = function (unloadCtx, unloadState) { var core = _self.core; if (!core || (unloadCtx && core !== unloadCtx.core())) { return; } var result; var unloadDone = false; var theUnloadCtx = unloadCtx || createProcessTelemetryUnloadContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin); var theUnloadState = unloadState || { reason: 0 , isAsync: false }; function _unloadCallback() { if (!unloadDone) { unloadDone = true; _unloadHandlerContainer.run(theUnloadCtx, unloadState); arrForEach(_hooks, function (fn) { fn.rm(); }); _hooks = []; if (result === true) { theUnloadCtx.processNext(theUnloadState); } _initDefaults(); } } if (!_self[strDoTeardown] || _self[strDoTeardown](theUnloadCtx, theUnloadState, _unloadCallback) !== true) { _unloadCallback(); } else { result = true; } return result; }; _self.update = function (updateCtx, updateState) { var core = _self.core; if (!core || (updateCtx && core !== updateCtx.core())) { return; } var result; var updateDone = false; var theUpdateCtx = updateCtx || createProcessTelemetryUpdateContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin); var theUpdateState = updateState || { reason: 0 }; function _updateCallback() { if (!updateDone) { updateDone = true; _setDefaults(theUpdateCtx.getCfg(), theUpdateCtx.core(), theUpdateCtx.getNext()); } } if (!_self._doUpdate || _self._doUpdate(theUpdateCtx, theUpdateState, _updateCallback) !== true) { _updateCallback(); } else { result = true; } return result; }; _self._addHook = function (hooks) { if (hooks) { if (isArray(hooks)) { _hooks = _hooks.concat(hooks); } else { _hooks.push(hooks); } } }; proxyFunctionAs(_self, "_addUnloadCb", function () { return _unloadHandlerContainer; }, "add"); }); _self.diagLog = function (itemCtx) { return _getTelCtx(itemCtx).diagLog(); }; _self[strIsInitialized] = function () { return _isinitialized; }; _self.setInitialized = function (isInitialized) { _isinitialized = isInitialized; }; _self[strSetNextPlugin] = function (next) { _nextPlugin = next; }; _self.processNext = function (env, itemCtx) { if (itemCtx) { itemCtx.processNext(env); } else if (_nextPlugin && isFunction(_nextPlugin.processTelemetry)) { _nextPlugin.processTelemetry(env, null); } }; _self._getTelCtx = _getTelCtx; function _getTelCtx(currentCtx) { if (currentCtx === void 0) { currentCtx = null; } var itemCtx = currentCtx; if (!itemCtx) { var rootCtx = _rootCtx || createProcessTelemetryContext(null, {}, _self.core); if (_nextPlugin && _nextPlugin[strGetPlugin]) { itemCtx = rootCtx.createNew(null, _nextPlugin[strGetPlugin]); } else { itemCtx = rootCtx.createNew(null, _nextPlugin); } } return itemCtx; } function _setDefaults(config, core, pluginChain) { if (config) { setValue(config, strExtensionConfig, [], null, isNullOrUndefined); } if (!pluginChain && core) { pluginChain = core.getProcessTelContext().getNext(); } var nextPlugin = _nextPlugin; if (_nextPlugin && _nextPlugin[strGetPlugin]) { nextPlugin = _nextPlugin[strGetPlugin](); } _self.core = core; _rootCtx = createProcessTelemetryContext(pluginChain, config, core, nextPlugin); } function _initDefaults() { _isinitialized = false; _self.core = null; _rootCtx = null; _nextPlugin = null; _hooks = []; _unloadHandlerContainer = createUnloadHandlerContainer(); } } return BaseTelemetryPlugin; }()); var strOnPrefix = "on"; var strAttachEvent = "attachEvent"; var strAddEventHelper = "addEventListener"; var strDetachEvent = "detachEvent"; var strRemoveEventListener = "removeEventListener"; var strEvents = "events"; var strVisibilityChangeEvt = "visibilitychange"; var strPageHide = "pagehide"; var strPageShow = "pageshow"; var strUnload = "unload"; var strBeforeUnload = "beforeunload"; var strPageHideNamespace = createUniqueNamespace("aiEvtPageHide"); var strPageShowNamespace = createUniqueNamespace("aiEvtPageShow"); var rRemoveEmptyNs = /\.[\.]+/g; var rRemoveTrailingEmptyNs = /[\.]+$/; var _guid = 1; var elmNodeData = createElmNodeData("events"); var eventNamespace = /^([^.]*)(?:\.(.+)|)/; function _normalizeNamespace(name) { if (name && name.replace) { return name.replace(/^\s*\.*|\.*\s*$/g, ""); } return name; } function _getEvtNamespace(eventName, evtNamespace) { if (evtNamespace) { var theNamespace_1 = ""; if (isArray(evtNamespace)) { theNamespace_1 = ""; arrForEach(evtNamespace, function (name) { name = _normalizeNamespace(name); if (name) { if (name[0] !== ".") { name = "." + name; } theNamespace_1 += name; } }); } else { theNamespace_1 = _normalizeNamespace(evtNamespace); } if (theNamespace_1) { if (theNamespace_1[0] !== ".") { theNamespace_1 = "." + theNamespace_1; } eventName = (eventName || "") + theNamespace_1; } } var parsedEvent = (eventNamespace.exec(eventName || "") || []); return { type: parsedEvent[1], ns: ((parsedEvent[2] || "").replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, "").split(".").sort()).join(".") }; } function _getRegisteredEvents(target, evtName, addDefault) { if (addDefault === void 0) { addDefault = true; } var aiEvts = elmNodeData.get(target, strEvents, {}, addDefault); var registeredEvents = aiEvts[evtName]; if (!registeredEvents) { registeredEvents = aiEvts[evtName] = []; } return registeredEvents; } function _doDetach(obj, evtName, handlerRef, useCapture) { if (obj && evtName && evtName.type) { if (obj[strRemoveEventListener]) { obj[strRemoveEventListener](evtName.type, handlerRef, useCapture); } else if (obj[strDetachEvent]) { obj[strDetachEvent](strOnPrefix + evtName.type, handlerRef); } } } function _doAttach(obj, evtName, handlerRef, useCapture) { var result = false; if (obj && evtName && evtName.type && handlerRef) { if (obj[strAddEventHelper]) { obj[strAddEventHelper](evtName.type, handlerRef, useCapture); result = true; } else if (obj[strAttachEvent]) { obj[strAttachEvent](strOnPrefix + evtName.type, handlerRef); result = true; } } return result; } function _doUnregister(target, events, evtName, unRegFn) { var idx = events.length; while (idx--) { var theEvent = events[idx]; if (theEvent) { if (!evtName.ns || evtName.ns === theEvent.evtName.ns) { if (!unRegFn || unRegFn(theEvent)) { _doDetach(target, theEvent.evtName, theEvent.handler, theEvent.capture); events.splice(idx, 1); } } } } } function _unregisterEvents(target, evtName, unRegFn) { if (evtName.type) { _doUnregister(target, _getRegisteredEvents(target, evtName.type), evtName, unRegFn); } else { var eventCache = elmNodeData.get(target, strEvents, {}); objForEachKey(eventCache, function (evtType, events) { _doUnregister(target, events, evtName, unRegFn); }); if (objKeys(eventCache).length === 0) { elmNodeData.kill(target, strEvents); } } } function mergeEvtNamespace(theNamespace, namespaces) { var newNamespaces; if (namespaces) { if (isArray(namespaces)) { newNamespaces = [theNamespace].concat(namespaces); } else { newNamespaces = [theNamespace, namespaces]; } newNamespaces = (_getEvtNamespace("xx", newNamespaces).ns).split("."); } else { newNamespaces = theNamespace; } return newNamespaces; } function eventOn(target, eventName, handlerRef, evtNamespace, useCapture) { if (useCapture === void 0) { useCapture = false; } var result = false; if (target) { try { var evtName = _getEvtNamespace(eventName, evtNamespace); result = _doAttach(target, evtName, handlerRef, useCapture); if (result && elmNodeData.accept(target)) { var registeredEvent = { guid: _guid++, evtName: evtName, handler: handlerRef, capture: useCapture }; _getRegisteredEvents(target, evtName.type).push(registeredEvent); } } catch (e) { } } return result; } function eventOff(target, eventName, handlerRef, evtNamespace, useCapture) { if (useCapture === void 0) { useCapture = false; } if (target) { try { var evtName_1 = _getEvtNamespace(eventName, evtNamespace); var found_1 = false; _unregisterEvents(target, evtName_1, function (regEvent) { if ((evtName_1.ns && !handlerRef) || regEvent.handler === handlerRef) { found_1 = true; return true; } return false; }); if (!found_1) { _doDetach(target, evtName_1, handlerRef, useCapture); } } catch (e) { } } } function addEventHandler(eventName, callback, evtNamespace) { var result = false; var w = getWindow(); if (w) { result = eventOn(w, eventName, callback, evtNamespace); result = eventOn(w["body"], eventName, callback, evtNamespace) || result; } var doc = getDocument(); if (doc) { result = eventOn(doc, eventName, callback, evtNamespace) || result; } return result; } function removeEventHandler(eventName, callback, evtNamespace) { var w = getWindow(); if (w) { eventOff(w, eventName, callback, evtNamespace); eventOff(w["body"], eventName, callback, evtNamespace); } var doc = getDocument(); if (doc) { eventOff(doc, eventName, callback, evtNamespace); } } function _addEventListeners(events, listener, excludeEvents, evtNamespace) { var added = false; if (listener && events && events.length > 0) { arrForEach(events, function (name) { if (name) { if (!excludeEvents || arrIndexOf(excludeEvents, name) === -1) { added = addEventHandler(name, listener, evtNamespace) || added; } } }); } return added; } function addEventListeners(events, listener, excludeEvents, evtNamespace) { var added = false; if (listener && events && isArray(events)) { added = _addEventListeners(events, listener, excludeEvents, evtNamespace); if (!added && excludeEvents && excludeEvents.length > 0) { added = _addEventListeners(events, listener, null, evtNamespace); } } return added; } function removeEventListeners(events, listener, evtNamespace) { if (events && isArray(events)) { arrForEach(events, function (name) { if (name) { removeEventHandler(name, listener, evtNamespace); } }); } } function addPageUnloadEventListener(listener, excludeEvents, evtNamespace) { return addEventListeners([strBeforeUnload, strUnload, strPageHide], listener, excludeEvents, evtNamespace); } function removePageUnloadEventListener(listener, evtNamespace) { removeEventListeners([strBeforeUnload, strUnload, strPageHide], listener, evtNamespace); } function addPageHideEventListener(listener, excludeEvents, evtNamespace) { function _handlePageVisibility(evt) { var doc = getDocument(); if (listener && doc && doc.visibilityState === "hidden") { listener(evt); } } var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace); var pageUnloadAdded = _addEventListeners([strPageHide], listener, excludeEvents, newNamespaces); if (!excludeEvents || arrIndexOf(excludeEvents, strVisibilityChangeEvt) === -1) { pageUnloadAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageUnloadAdded; } if (!pageUnloadAdded && excludeEvents) { pageUnloadAdded = addPageHideEventListener(listener, null, evtNamespace); } return pageUnloadAdded; } function removePageHideEventListener(listener, evtNamespace) { var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace); removeEventListeners([strPageHide], listener, newNamespaces); removeEventListeners([strVisibilityChangeEvt], null, newNamespaces); } function addPageShowEventListener(listener, excludeEvents, evtNamespace) { function _handlePageVisibility(evt) { var doc = getDocument(); if (listener && doc && doc.visibilityState === "visible") { listener(evt); } } var newNamespaces = mergeEvtNamespace(strPageShowNamespace, evtNamespace); var pageShowAdded = _addEventListeners([strPageShow], listener, excludeEvents, newNamespaces); pageShowAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageShowAdded; if (!pageShowAdded && excludeEvents) { pageShowAdded = addPageShowEventListener(listener, null, evtNamespace); } return pageShowAdded; } function removePageShowEventListener(listener, evtNamespace) { var newNamespaces = mergeEvtNamespace(strPageShowNamespace, evtNamespace); removeEventListeners([strPageShow], listener, newNamespaces); removeEventListeners([strVisibilityChangeEvt], null, newNamespaces); } function perfNow() { var perf = getPerformance(); if (perf && perf.now) { return perf.now(); } return dateNow(); } var _a$1; var Version = '3.2.2'; var FullVersionString = "1DS-Web-JS-" + Version; var strDisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation"; var strWithCredentials = "withCredentials"; var strTimeout = "timeout"; var _fieldTypeEventPropMap = (_a$1 = {}, _a$1[0 ] = 0 , _a$1[2 ] = 6 , _a$1[1 ] = 1 , _a$1[3 ] = 7 , _a$1[4096 | 2 ] = 6 , _a$1[4096 | 1 ] = 1 , _a$1[4096 | 3 ] = 7 , _a$1); Boolean(getDocument()); Boolean(getWindow()); function isValueAssigned(value) { return !(value === "" || isNullOrUndefined(value)); } function getTenantId(apiKey) { if (apiKey) { var indexTenantId = apiKey.indexOf("-"); if (indexTenantId > -1) { return apiKey.substring(0, indexTenantId); } } return ""; } function sanitizeProperty(name, property, stringifyObjects) { if ((!property && !isValueAssigned(property)) || typeof name !== "string") { return null; } var propType = typeof property; if (propType === "string" || propType === "number" || propType === "boolean" || isArray(property)) { property = { value: property }; } else if (propType === "object" && !property.hasOwnProperty("value")) { property = { value: stringifyObjects ? JSON.stringify(property) : property }; } else if (isNullOrUndefined(property.value) || property.value === "" || (!isString(property.value) && !isNumber(property.value) && !isBoolean(property.value) && !isArray(property.value))) { return null; } if (isArray(property.value) && !isArrayValid(property.value)) { return null; } if (!isNullOrUndefined(property.kind)) { if (isArray(property.value) || !isValueKind(property.kind)) { return null; } property.value = property.value.toString(); } return property; } function getCommonSchemaMetaData(value, kind, type) { var encodedTypeValue = -1; if (!isUndefined(value)) { if (kind > 0) { if (kind === 32) { encodedTypeValue = (1 << 13); } else if (kind <= 13) { encodedTypeValue = (kind << 5); } } if (isDataType(type)) { if (encodedTypeValue === -1) { encodedTypeValue = 0; } encodedTypeValue |= type; } else { var propType = _fieldTypeEventPropMap[getFieldValueType(value)] || -1; if (encodedTypeValue !== -1 && propType !== -1) { encodedTypeValue |= propType; } else if (propType === 6 ) { encodedTypeValue = propType; } } } return encodedTypeValue; } function extend(obj, obj2, obj3, obj4, obj5) { var extended = {}; var deep = false; var i = 0; var length = arguments.length; var objProto = Object[strShimPrototype]; var theArgs = arguments; if (objProto.toString.call(theArgs[0]) === "[object Boolean]") { deep = theArgs[0]; i++; } for (; i < length; i++) { var obj = theArgs[i]; objForEachKey(obj, function (prop, value) { if (deep && value && isObject(value)) { if (isArray(value)) { extended[prop] = extended[prop] || []; arrForEach(value, function (arrayValue, arrayIndex) { if (arrayValue && isObject(arrayValue)) { extended[prop][arrayIndex] = extend(true, extended[prop][arrayIndex], arrayValue); } else { extended[prop][arrayIndex] = arrayValue; } }); } else { extended[prop] = extend(true, extended[prop], value); } } else { extended[prop] = value; } }); } return extended; } var getTime = perfNow; function isValueKind(value) { if (value === 0 || ((value > 0 && value <= 13 ) || value === 32 )) { return true; } return false; } function isDataType(value) { if (value >= 0 && value <= 9) { return true; } return false; } function isArrayValid(value) { return value.length > 0; } function setProcessTelemetryTimings(event, identifier) { var evt = event; evt.timings = evt.timings || {}; evt.timings.processTelemetryStart = evt.timings.processTelemetryStart || {}; evt.timings.processTelemetryStart[identifier] = getTime(); } function getFieldValueType(value) { var theType = 0 ; if (value !== null && value !== undefined) { var objType = typeof value; if (objType === "string") { theType = 1 ; } else if (objType === "number") { theType = 2 ; } else if (objType === "boolean") { theType = 3 ; } else if (objType === strShimObject) { theType = 4 ; if (isArray(value)) { theType = 4096 ; if (value.length > 0) { theType |= getFieldValueType(value[0]); } } else if (hasOwnProperty(value, "value")) { theType = 8192 | getFieldValueType(value.value); } } } return theType; } function isChromium() { return !!getGlobalInst("chrome"); } function openXhr(method, urlString, withCredentials, disabled, isSync, timeout) { if (disabled === void 0) { disabled = false; } if (isSync === void 0) { isSync = false; } function _wrapSetXhrProp(xhr, prop, value) { try { xhr[prop] = value; } catch (e) { } } var xhr = new XMLHttpRequest(); if (disabled) { _wrapSetXhrProp(xhr, strDisabledPropertyName, disabled); } if (withCredentials) { _wrapSetXhrProp(xhr, strWithCredentials, withCredentials); } xhr.open(method, urlString, !isSync); if (withCredentials) { _wrapSetXhrProp(xhr, strWithCredentials, withCredentials); } if (!isSync && timeout) { _wrapSetXhrProp(xhr, strTimeout, timeout); } return xhr; } var RT_PROFILE = "REAL_TIME"; var NRT_PROFILE = "NEAR_REAL_TIME"; var BE_PROFILE = "BEST_EFFORT"; var Method = "POST"; var DisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation"; var strDropped = "drop"; var strSending = "send"; var strRequeue = "requeue"; var strResponseFail = "rspFail"; var strOther = "oth"; var defaultCacheControl = "no-cache, no-store"; var defaultContentType = "application/x-json-stream"; var strCacheControl = "cache-control"; var strContentTypeHeader = "content-type"; var strKillTokensHeader = "kill-tokens"; var strKillDurationHeader = "kill-duration"; var strKillDurationSecondsHeader = "kill-duration-seconds"; var strTimeDeltaHeader = "time-delta-millis"; var strClientVersion = "client-version"; var strClientId = "client-id"; var strTimeDeltaToApply = "time-delta-to-apply-millis"; var strUploadTime = "upload-time"; var strApiKey = "apikey"; var strMsaDeviceTicket = "AuthMsaDeviceTicket"; var strAuthXToken = "AuthXToken"; var strNoResponseBody = "NoResponseBody"; var strMsfpc = "msfpc"; function _getEventMsfpc(theEvent) { var intWeb = ((theEvent.ext || {})["intweb"]); if (intWeb && isValueAssigned(intWeb[strMsfpc])) { return intWeb[strMsfpc]; } return null; } function _getMsfpc(theEvents) { var msfpc = null; for (var lp = 0; msfpc === null && lp < theEvents.length; lp++) { msfpc = _getEventMsfpc(theEvents[lp]); } return msfpc; } var EventBatch = /** @class */ (function () { function EventBatch(iKey, addEvents) { var events = addEvents ? [].concat(addEvents) : []; var _self = this; var _msfpc = _getMsfpc(events); _self.iKey = function () { return iKey; }; _self.Msfpc = function () { return _msfpc || ""; }; _self.count = function () { return events.length; }; _self.events = function () { return events; }; _self.addEvent = function (theEvent) { if (theEvent) { events.push(theEvent); if (!_msfpc) { _msfpc = _getEventMsfpc(theEvent); } return true; } return false; }; _self.split = function (fromEvent, numEvents) { var theEvents; if (fromEvent < events.length) { var cnt = events.length - fromEvent; if (!isNullOrUndefined(numEvents)) { cnt = numEvents < cnt ? numEvents : cnt; } theEvents = events.splice(fromEvent, cnt); _msfpc = _getMsfpc(events); } return new EventBatch(iKey, theEvents); }; } EventBatch.create = function (iKey, theEvents) { return new EventBatch(iKey, theEvents); }; return EventBatch; }()); var _MAX_STRING_JOINS = 20; var RequestSizeLimitBytes = 3984588; var BeaconRequestSizeLimitBytes = 65000; var MaxRecordSize = 2000000; var MaxBeaconRecordSize = Math.min(MaxRecordSize, BeaconRequestSizeLimitBytes); var metadata = "metadata"; var f = "f"; var rCheckDot = /\./; var Serializer = /** @class */ (function () { function Serializer(perfManager, valueSanitizer, stringifyObjects, enableCompoundKey) { var strData = "data"; var strBaseData = "baseData"; var strExt = "ext"; var _checkForCompoundkey = !!enableCompoundKey; var _processSubMetaData = true; var _theSanitizer = valueSanitizer; var _isReservedCache = {}; dynamicProto(Serializer, this, function (_self) { _self.createPayload = function (retryCnt, isTeardown, isSync, useSendBeacon, sendReason, sendType) { return { apiKeys: [], payloadBlob: "", overflow: null, sizeExceed: [], failedEvts: [], batches: [], numEvents: 0, retryCnt: retryCnt, isTeardown: isTeardown, isSync: isSync, isBeacon: useSendBeacon, sendType: sendType, sendReason: sendReason }; }; _self.appendPayload = function (payload, theBatch, maxEventsPerBatch) { var canAddEvents = payload && theBatch && !payload.overflow; if (canAddEvents) { doPerf(perfManager, function () { return "Serializer:appendPayload"; }, function () { var theEvents = theBatch.events(); var payloadBlob = payload.payloadBlob; var payloadEvents = payload.numEvents; var eventsAdded = false; var sizeExceeded = []; var failedEvts = []; var isBeaconPayload = payload.isBeacon; var requestMaxSize = isBeaconPayload ? BeaconRequestSizeLimitBytes : RequestSizeLimitBytes; var recordMaxSize = isBeaconPayload ? MaxBeaconRecordSize : MaxRecordSize; var lp = 0; var joinCount = 0; while (lp < theEvents.length) { var theEvent = theEvents[lp]; if (theEvent) { if (payloadEvents >= maxEventsPerBatch) { payload.overflow = theBatch.split(lp); break; } var eventBlob = _self.getEventBlob(theEvent); if (eventBlob && eventBlob.length <= recordMaxSize) { var blobLength = eventBlob.length; var currentSize = payloadBlob.length; if (currentSize + blobLength > requestMaxSize) { payload.overflow = theBatch.split(lp); break; } if (payloadBlob) { payloadBlob += "\n"; } payloadBlob += eventBlob; joinCount++; if (joinCount > _MAX_STRING_JOINS) { payloadBlob.substr(0, 1); joinCount = 0; } eventsAdded = true; payloadEvents++; } else { if (eventBlob) { sizeExceeded.push(theEvent); } else { failedEvts.push(theEvent); } theEvents.splice(lp, 1); lp--; } } lp++; } if (sizeExceeded && sizeExceeded.length > 0) { payload.sizeExceed.push(EventBatch.create(theBatch.iKey(), sizeExceeded)); } if (failedEvts && failedEvts.length > 0) { payload.failedEvts.push(EventBatch.create(theBatch.iKey(), failedEvts)); } if (eventsAdded) { payload.batches.push(theBatch); payload.payloadBlob = payloadBlob; payload.numEvents = payloadEvents; var apiKey = theBatch.iKey(); if (arrIndexOf(payload.apiKeys, apiKey) === -1) { payload.apiKeys.push(apiKey); } } }, function () { return ({ payload: payload, theBatch: { iKey: theBatch.iKey(), evts: theBatch.events() }, max: maxEventsPerBatch }); }); } return canAddEvents; }; _self.getEventBlob = function (eventData) { try { return doPerf(perfManager, function () { return "Serializer.getEventBlob"; }, function () { var serializedEvent = {}; serializedEvent.name = eventData.name; serializedEvent.time = eventData.time; serializedEvent.ver = eventData.ver; serializedEvent.iKey = "o:" + getTenantId(eventData.iKey); var serializedExt = {}; var eventExt = eventData[strExt]; if (eventExt) { serializedEvent[strExt] = serializedExt; objForEachKey(eventExt, function (key, value) { var data = serializedExt[key] = {}; _processPathKeys(value, data, "ext." + key, true, null, null, true); }); } var serializedData = serializedEvent[strData] = {}; serializedData.baseType = eventData.baseType; var serializedBaseData = serializedData[strBaseData] = {}; _processPathKeys(eventData.baseData, serializedBaseData, strBaseData, false, [strBaseData], function (pathKeys, name, value) { _addJSONPropertyMetaData(serializedExt, pathKeys, name, value); }, _processSubMetaData); _processPathKeys(eventData.data, serializedData, strData, false, [], function (pathKeys, name, value) { _addJSONPropertyMetaData(serializedExt, pathKeys, name, value); }, _processSubMetaData); return JSON.stringify(serializedEvent); }, function () { return ({ item: eventData }); }); } catch (e) { return null; } }; function _isReservedField(path, name) { var result = _isReservedCache[path]; if (result === undefined) { if (path.length >= 7) { result = strStartsWith(path, "ext.metadata") || strStartsWith(path, "ext.web"); } _isReservedCache[path] = result; } return result; } function _processPathKeys(srcObj, target, thePath, checkReserved, metadataPathKeys, metadataCallback, processSubKeys) { objForEachKey(srcObj, function (key, srcValue) { var prop = null; if (srcValue || isValueAssigned(srcValue)) { var path = thePath; var name_1 = key; var theMetaPathKeys = metadataPathKeys; var destObj = target; if (_checkForCompoundkey && !checkReserved && rCheckDot.test(key)) { var subKeys = key.split("."); var keyLen = subKeys.length; if (keyLen > 1) { if (theMetaPathKeys) { theMetaPathKeys = theMetaPathKeys.slice(); } for (var lp = 0; lp < keyLen - 1; lp++) { var subKey = subKeys[lp]; destObj = destObj[subKey] = destObj[subKey] || {}; path += "." + subKey; if (theMetaPathKeys) { theMetaPathKeys.push(subKey); } } name_1 = subKeys[keyLen - 1]; } } var isReserved = checkReserved && _isReservedField(path); if (!isReserved && _theSanitizer && _theSanitizer.handleField(path, name_1)) { prop = _theSanitizer.value(path, name_1, srcValue, stringifyObjects); } else { prop = sanitizeProperty(name_1, srcValue, stringifyObjects); } if (prop) { var newValue = prop.value; destObj[name_1] = newValue; if (metadataCallback) { metadataCallback(theMetaPathKeys, name_1, prop); } if (processSubKeys && typeof newValue === "object" && !isArray(newValue)) { var newPath = theMetaPathKeys; if (newPath) { newPath = newPath.slice(); newPath.push(name_1); } _processPathKeys(srcValue, newValue, path + "." + name_1, checkReserved, newPath, metadataCallback, processSubKeys); } } } }); } }); } return Serializer; }()); function _addJSONPropertyMetaData(json, propKeys, name, propertyValue) { if (propertyValue && json) { var encodedTypeValue = getCommonSchemaMetaData(propertyValue.value, propertyValue.kind, propertyValue.propertyType); if (encodedTypeValue > -1) { var metaData = json[metadata]; if (!metaData) { metaData = json[metadata] = { f: {} }; } var metaTarget = metaData[f]; if (!metaTarget) { metaTarget = metaData[f] = {}; } if (propKeys) { for (var lp = 0; lp < propKeys.length; lp++) { var key = propKeys[lp]; if (!metaTarget[key]) { metaTarget[key] = { f: {} }; } var newTarget = metaTarget[key][f]; if (!newTarget) { newTarget = metaTarget[key][f] = {}; } metaTarget = newTarget; } } metaTarget = metaTarget[name] = {}; if (isArray(propertyValue.value)) { metaTarget["a"] = { t: encodedTypeValue }; } else { metaTarget["t"] = encodedTypeValue; } } } } var RandomizationLowerThreshold = 0.8; var RandomizationUpperThreshold = 1.2; var BaseBackoff = 3000; var MaxBackoff = 600000; function retryPolicyShouldRetryForStatus(httpStatusCode) { return !((httpStatusCode >= 300 && httpStatusCode < 500 && httpStatusCode != 408 && httpStatusCode != 429) || (httpStatusCode == 501) || (httpStatusCode == 505)); } function retryPolicyGetMillisToBackoffForRetry(retriesSoFar) { var waitDuration = 0; var minBackoff = BaseBackoff * RandomizationLowerThreshold; var maxBackoff = BaseBackoff * RandomizationUpperThreshold; var randomBackoff = Math.floor(Math.random() * (maxBackoff - minBackoff)) + minBackoff; waitDuration = Math.pow(2, retriesSoFar) * randomBackoff; return Math.min(waitDuration, MaxBackoff); } var SecToMsMultiplier = 1000; var KillSwitch = /** @class */ (function () { function KillSwitch() { var _killedTokenDictionary = {}; function _normalizeTenants(values) { var result = []; if (values) { arrForEach(values, function (value) { result.push(strTrim(value)); }); } return result; } dynamicProto(KillSwitch, this, function (_self) { _self.setKillSwitchTenants = function (killTokens, killDuration) { if (killTokens && killDuration) { try { var killedTokens = _normalizeTenants(killTokens.split(",")); if (killDuration === "this-request-only") { return killedTokens; } var durationMs = parseInt(killDuration, 10) * SecToMsMultiplier; for (var i = 0; i < killedTokens.length; ++i) { _killedTokenDictionary[killedTokens[i]] = dateNow() + durationMs; } } catch (ex) { return []; } } return []; }; _self.isTenantKilled = function (tenantToken) { var killDictionary = _killedTokenDictionary; var name = strTrim(tenantToken); if (killDictionary[name] !== undefined && killDictionary[name] > dateNow()) { return true; } delete killDictionary[name]; return false; }; }); } return KillSwitch; }()); var EVTKillSwitch = KillSwitch; var ClockSkewManager = /** @class */ (function () { function ClockSkewManager() { var _allowRequestSending = true; var _shouldAddClockSkewHeaders = true; var _isFirstRequest = true; var _clockSkewHeaderValue = "use-collector-delta"; var _clockSkewSet = false; dynamicProto(ClockSkewManager, this, function (_self) { _self.allowRequestSending = function () { return _allowRequestSending; }; _self.firstRequestSent = function () { if (_isFirstRequest) { _isFirstRequest = false; if (!_clockSkewSet) { _allowRequestSending = false; } } }; _self.shouldAddClockSkewHeaders = function () { return _shouldAddClockSkewHeaders; }; _self.getClockSkewHeaderValue = function () { return _clockSkewHeaderValue; }; _self.setClockSkew = function (timeDeltaInMillis) { if (!_clockSkewSet) { if (timeDeltaInMillis) { _clockSkewHeaderValue = timeDeltaInMillis; _shouldAddClockSkewHeaders = true; _clockSkewSet = true; } else { _shouldAddClockSkewHeaders = false; } _allowRequestSending = true; } }; }); } return ClockSkewManager; }()); var EVTClockSkewManager = ClockSkewManager; var _a; var strSendAttempt = "sendAttempt"; var _noResponseQs = "&" + strNoResponseBody + "=true"; var _eventActionMap = (_a = {}, _a[1 ] = strRequeue, _a[100 ] = strRequeue, _a[200 ] = "sent", _a[8004 ] = strDropped, _a[8003 ] = strDropped, _a); var _collectorQsHeaders = {}; var _collectorHeaderToQs = {}; function _addCollectorHeaderQsMapping(qsName, headerName, allowQs) { _collectorQsHeaders[qsName] = headerName; if (allowQs !== false) { _collectorHeaderToQs[headerName] = qsName; } } _addCollectorHeaderQsMapping(strMsaDeviceTicket, strMsaDeviceTicket, false); _addCollectorHeaderQsMapping(strClientVersion, strClientVersion); _addCollectorHeaderQsMapping(strClientId, "Client-Id"); _addCollectorHeaderQsMapping(strApiKey, strApiKey); _addCollectorHeaderQsMapping(strTimeDeltaToApply, strTimeDeltaToApply); _addCollectorHeaderQsMapping(strUploadTime, strUploadTime); _addCollectorHeaderQsMapping(strAuthXToken, strAuthXToken); function _getResponseText(xhr) { try { return xhr.responseText; } catch (e) { } return ""; } function _hasHeader(headers, header) { var hasHeader = false; if (headers && header) { var keys = objKeys(headers); if (keys && keys.length > 0) { var lowerHeader = header.toLowerCase(); for (var lp = 0; lp < keys.length; lp++) { var value = keys[lp]; if (value && hasOwnProperty(header, value) && value.toLowerCase() === lowerHeader) { hasHeader = true; break; } } } } return hasHeader; } function _addRequestDetails(details, name, value, useHeaders) { if (name && value && value.length > 0) { if (useHeaders && _collectorQsHeaders[name]) { details.hdrs[_collectorQsHeaders[name]] = value; details.useHdrs = true; } else { details.url += "&" + name + "=" + value; } } } var HttpManager = /** @class */ (function () { function HttpManager(maxEventsPerBatch, maxConnections, maxRequestRetriesBeforeBackoff, actions, timeoutOverride) { this._responseHandlers = []; var _urlString = "?cors=true&" + strContentTypeHeader.toLowerCase() + "=" + defaultContentType; var _killSwitch = new EVTKillSwitch(); var _paused = false; var _clockSkewManager = new EVTClockSkewManager(); var _useBeacons = false; var _outstandingRequests = 0; var _postManager; var _sendInterfaces; var _core; var _customHttpInterface = true; var _queryStringParameters = []; var _headers = {}; var _batchQueue = []; var _serializer = null; var _enableEventTimings = false; var _cookieMgr; var _isUnloading = false; var _useHeaders = false; var _xhrTimeout; var _disableXhrSync; dynamicProto(HttpManager, this, function (_self) { var _sendCredentials = true; _self.initialize = function (endpointUrl, core, postChannel, httpInterface, channelConfig) { var _a; if (!channelConfig) { channelConfig = {}; } _urlString = endpointUrl + _urlString; _useHeaders = !isUndefined(channelConfig.avoidOptions) ? !channelConfig.avoidOptions : true; _core = core; _cookieMgr = core.getCookieMgr(); _enableEventTimings = !_core.config.disableEventTimings; var enableCompoundKey = !!_core.config.enableCompoundKey; _postManager = postChannel; var valueSanitizer = channelConfig.valueSanitizer; var stringifyObjects = channelConfig.stringifyObjects; if (!isUndefined(channelConfig.enableCompoundKey)) { enableCompoundKey = !!channelConfig.enableCompoundKey; } _xhrTimeout = channelConfig.xhrTimeout; _disableXhrSync = channelConfig.disableXhrSync; _useBeacons = !isReactNative(); _serializer = new Serializer(_core, valueSanitizer, stringifyObjects, enableCompoundKey); var syncHttpInterface = httpInterface; var beaconHttpInterface = channelConfig.alwaysUseXhrOverride ? httpInterface : null; var fetchSyncHttpInterface = channelConfig.alwaysUseXhrOverride ? httpInterface : null; if (!httpInterface) { _customHttpInterface = false; var location_1 = getLocation(); if (location_1 && location_1.protocol && location_1.protocol.toLowerCase() === "file:") { _sendCredentials = false; } var theTransports = []; if (isReactNative()) { theTransports = [2 , 1 ]; } else { theTransports = [1 , 2 , 3 ]; } var configTransports = channelConfig.transports; if (configTransports) { if (isNumber(configTransports)) { theTransports = [configTransports].concat(theTransports); } else if (isArray(configTransports)) { theTransports = configTransports.concat(theTransports); } } httpInterface = _getSenderInterface(theTransports, false); syncHttpInterface = _getSenderInterface(theTransports, true); if (!httpInterface) { _postManager.diagLog().warnToConsole("No available transport to send events"); } } _sendInterfaces = (_a = {}, _a[0 ] = httpInterface, _a[1 ] = syncHttpInterface || _getSenderInterface([1 , 2 , 3 ], true), _a[2 ] = beaconHttpInterface || _getSenderInterface([3 , 2 ], true) || syncHttpInterface || _getSenderInterface([1 ], true), _a[3 ] = fetchSyncHttpInterface || _getSenderInterface([2 , 3 ], true) || syncHttpInterface || _getSenderInterface([1 ], true), _a); }; function _getSenderInterface(transports, syncSupport) { var transportType = 0 ; var sendPostFunc = null; var lp = 0; while (sendPostFunc == null && lp < transports.length) { transportType = transports[lp]; if (transportType === 1 ) { if (useXDomainRequest()) { sendPostFunc = _xdrSendPost; } else if (isXhrSupported()) { sendPostFunc = _xhrSendPost; } } else if (transportType === 2 && isFetchSupported(syncSupport)) { sendPostFunc = _fetchSendPost; } else if (_useBeacons && transportType === 3 && isBeaconsSupported()) { sendPostFunc = _beaconSendPost; } lp++; } if (sendPostFunc) { return { _transport: transportType, _isSync: syncSupport, sendPOST: sendPostFunc }; } return null; } _self["_getDbgPlgTargets"] = function () { return [_sendInterfaces[0 ], _killSwitch, _serializer, _sendInterfaces]; }; function _xdrSendPost(payload, oncomplete, sync) { var xdr = new XDomainRequest(); xdr.open(Method, payload.urlString); if (payload.timeout) { xdr.timeout = payload.timeout; } xdr.onload = function () { var response = _getResponseText(xdr); _doOnComplete(oncomplete, 200, {}, response); _handleCollectorResponse(response); }; xdr.onerror = function () { _doOnComplete(oncomplete, 400, {}); }; xdr.ontimeout = function () { _doOnComplete(oncomplete, 500, {}); }; xdr.onprogress = function () { }; if (sync) { xdr.send(payload.data); } else { timeoutOverride.set(function () { xdr.send(payload.data); }, 0); } } function _fetchSendPost(payload, oncomplete, sync) { var _a; var theUrl = payload.urlString; var ignoreResponse = false; var responseHandled = false; var requestInit = (_a = { body: payload.data, method: Method }, _a[DisabledPropertyName] = true, _a); if (sync) { requestInit.keepalive = true; if (payload._sendReason === 2 ) { ignoreResponse = true; theUrl += _noResponseQs; } } if (_sendCredentials) { requestInit.credentials = "include"; } if (payload.headers && objKeys(payload.headers).length > 0) { requestInit.headers = payload.headers; } fetch(theUrl, requestInit).then(function (response) { var headerMap = {}; var responseText = ""; if (response.headers) { response.headers.forEach(function (value, name) { headerMap[name] = value; }); } if (response.body) { response.text().then(function (text) { responseText = text; }); } if (!responseHandled) { responseHandled = true; _doOnComplete(oncomplete, response.status, headerMap, responseText); _handleCollectorResponse(responseText); } })["catch"](function (error) { if (!responseHandled) { responseHandled = true; _doOnComplete(oncomplete, 0, {}); } }); if (ignoreResponse && !responseHandled) { responseHandled = true; _doOnComplete(oncomplete, 200, {}); } if (!responseHandled && payload.timeout > 0) { timeoutOverride.set(function () { if (!responseHandled) { responseHandled = true; _doOnComplete(oncomplete, 500, {}); } }, payload.timeout); } } function _xhrSendPost(payload, oncomplete, sync) { var theUrl = payload.urlString; function _appendHeader(theHeaders, xhr, name) { if (!theHeaders[name] && xhr && xhr.getResponseHeader) { var value = xhr.getResponseHeader(name); if (value) { theHeaders[name] = strTrim(value); } } return theHeaders; } function _getAllResponseHeaders(xhr) { var theHeaders = {}; if (!xhr.getAllResponseHeaders) { theHeaders = _appendHeader(theHeaders, xhr, strTimeDeltaHeader); theHeaders = _appendHeader(theHeaders, xhr, strKillDurationHeader); theHeaders = _appendHeader(theHeaders, xhr, strKillDurationSecondsHeader); } else { theHeaders = _convertAllHeadersToMap(xhr.getAllResponseHeaders()); } return theHeaders; } function xhrComplete(xhr, responseTxt) { _doOnComplete(oncomplete, xhr.status, _getAllResponseHeaders(xhr), responseTxt); } if (sync && payload.disableXhrSync) { sync = false; } var xhrRequest = openXhr(Method, theUrl, _sendCredentials, true, sync, payload.timeout); objForEachKey(payload.headers, function (name, value) { xhrRequest.setRequestHeader(name, value); }); xhrRequest.onload = function () { var response = _getResponseText(xhrRequest); xhrComplete(xhrRequest, response); _handleCollectorResponse(response); }; xhrRequest.onerror = function () { xhrComplete(xhrRequest); }; xhrRequest.ontimeout = function () { xhrComplete(xhrRequest); }; xhrRequest.send(payload.data); } function _doOnComplete(oncomplete, status, headers, response) { try { oncomplete(status, headers, response); } catch (e) { _throwInternal(_postManager.diagLog(), 2 , 518 , dumpObj(e)); } } function _beaconSendPost(payload, oncomplete, sync) { var internalPayloadData = payload; var status = 200; var thePayload = internalPayloadData._thePayload; var theUrl = payload.urlString + _noResponseQs; try { var nav_1 = getNavigator(); if (!nav_1.sendBeacon(theUrl, payload.data)) { if (thePayload) { var droppedBatches_1 = []; arrForEach(thePayload.batches, function (theBatch) { if (droppedBatches_1 && theBatch && theBatch.count() > 0) { var theEvents = theBatch.events(); for (var lp = 0; lp < theEvents.length; lp++) { if (!nav_1.sendBeacon(theUrl, _serializer.getEventBlob(theEvents[lp]))) { droppedBatches_1.push(theBatch.split(lp)); break; } } } else { droppedBatches_1.push(theBatch.split(0)); } }); _sendBatchesNotification(droppedBatches_1, 8003 , thePayload.sendType, true); } else { status = 0; } } } catch (ex) { _postManager.diagLog().warnToConsole("Failed to send telemetry using sendBeacon API. Ex:" + dumpObj(ex)); status = 0; } finally { _doOnComplete(oncomplete, status, {}, ""); } } function _isBeaconPayload(sendType) { return sendType === 2 || sendType === 3 ; } function _adjustSendType(sendType) { if (_isUnloading && _isBeaconPayload(sendType)) { sendType = 2 ; } return sendType; } _self.addQueryStringParameter = function (name, value) { for (var i = 0; i < _queryStringParameters.length; i++) { if (_queryStringParameters[i].name === name) { _queryStringParameters[i].value = value; return; } } _queryStringParameters.push({ name: name, value: value }); }; _self.addHeader = function (name, value) { _headers[name] = value; }; _self.canSendRequest = function () { return _hasIdleConnection() && _clockSkewManager.allowRequestSending(); }; _self.sendQueuedRequests = function (sendType, sendReason) { if (isUndefined(sendType)) { sendType = 0 ; } if (_isUnloading) { sendType = _adjustSendType(sendType); sendReason = 2 ; } if (_canSendPayload(_batchQueue, sendType, 0)) { _sendBatches(_clearQueue(), 0, false, sendType, sendReason || 0 ); } }; _self.isCompletelyIdle = function () { return !_paused && _outstandingRequests === 0 && _batchQueue.length === 0; }; _self.setUnloading = function (value) { _isUnloading = value; }; _self.addBatch = function (theBatch) { if (theBatch && theBatch.count() > 0) { if (_killSwitch.isTenantKilled(theBatch.iKey())) { return false; } _batchQueue.push(theBatch); } return true; }; _self.teardown = function () { if (_batchQueue.length > 0) { _sendBatches(_clearQueue(), 0, true, 2 , 2 ); } }; _self.pause = function () { _paused = true; }; _self.resume = function () { _paused = false; _self.sendQueuedRequests(0 , 4 ); }; _self.sendSynchronousBatch = function (batch, sendType, sendReason) { if (batch && batch.count() > 0) { if (isNullOrUndefined(sendType)) { sendType = 1 ; } if (_isUnloading) { sendType = _adjustSendType(sendType); sendReason = 2 ; } _sendBatches([batch], 0, false, sendType, sendReason || 0 ); } }; function _hasIdleConnection() { return !_paused && _outstandingRequests < maxConnections; } function _clearQueue() { var theQueue = _batchQueue; _batchQueue = []; return theQueue; } function _canSendPayload(theBatches, sendType, retryCnt) { var result = false; if (theBatches && theBatches.length > 0 && !_paused && _sendInterfaces[sendType] && _serializer) { result = (sendType !== 0 ) || (_hasIdleConnection() && (retryCnt > 0 || _clockSkewManager.allowRequestSending())); } return result; } function _createDebugBatches(theBatches) { var values = {}; if (theBatches) { arrForEach(theBatches, function (theBatch, idx) { values[idx] = { iKey: theBatch.iKey(), evts: theBatch.events() }; }); } return values; } function _sendBatches(theBatches, retryCount, isTeardown, sendType, sendReason) { if (!theBatches || theBatches.length === 0) { return; } if (_paused) { _sendBatchesNotification(theBatches, 1 , sendType); return; } sendType = _adjustSendType(sendType); try { var orgBatches_1 = theBatches; var isSynchronous_1 = sendType !== 0 ; doPerf(_core, function () { return "HttpManager:_sendBatches"; }, function (perfEvt) { if (perfEvt) { theBatches = theBatches.slice(0); } var droppedBatches = []; var thePayload = null; var serializationStart = getTime(); var sendInterface = _sendInterfaces[sendType] || (isSynchronous_1 ? _sendInterfaces[1 ] : _sendInterfaces[0 ]); var isBeaconTransport = (_isUnloading || _isBeaconPayload(sendType) || (sendInterface && sendInterface._transport === 3 )) && _canUseSendBeaconApi(); while (_canSendPayload(theBatches, sendType, retryCount)) { var theBatch = theBatches.shift(); if (theBatch && theBatch.count() > 0) { if (!_killSwitch.isTenantKilled(theBatch.iKey())) { thePayload = thePayload || _serializer.createPayload(retryCount, isTeardown, isSynchronous_1, isBeaconTransport, sendReason, sendType); if (!_serializer.appendPayload(thePayload, theBatch, maxEventsPerBatch)) { _doPayloadSend(thePayload, serializationStart, getTime(), sendReason); serializationStart = getTime(); theBatches = [theBatch].concat(theBatches); thePayload = null; } else if (thePayload.overflow !== null) { theBatches = [thePayload.overflow].concat(theBatches); thePayload.overflow = null; _doPayloadSend(thePayload, serializationStart, getTime(), sendReason); serializationStart = getTime(); thePayload = null; } } else { droppedBatches.push(theBatch); } } } if (thePayload) { _doPayloadSend(thePayload, serializationStart, getTime(), sendReason); } if (theBatches.length > 0) { _batchQueue = theBatches.concat(_batchQueue); } _sendBatchesNotification(droppedBatches, 8004 , sendType); }, function () { return ({ batches: _createDebugBatches(orgBatches_1), retryCount: retryCount, isTeardown: isTeardown, isSynchronous: isSynchronous_1, sendReason: sendReason, useSendBeacon: _isBeaconPayload(sendType), sendType: sendType }); }, !isSynchronous_1); } catch (ex) { _throwInternal(_postManager.diagLog(), 2 , 48 , "Unexpected Exception sending batch: " + dumpObj(ex)); } } function _buildRequestDetails(thePayload, useHeaders) { var requestDetails = { url: _urlString, hdrs: {}, useHdrs: false }; if (!useHeaders) { objForEachKey(_headers, function (name, value) { if (_collectorHeaderToQs[name]) { _addRequestDetails(requestDetails, _collectorHeaderToQs[name], value, false); } else { requestDetails.hdrs[name] = value; requestDetails.useHdrs = true; } }); } else { requestDetails.hdrs = extend(requestDetails.hdrs, _headers); requestDetails.useHdrs = (objKeys(requestDetails.hdrs).length > 0); } _addRequestDetails(requestDetails, strClientId, "NO_AUTH", useHeaders); _addRequestDetails(requestDetails, strClientVersion, FullVersionString, useHeaders); var apiQsKeys = ""; arrForEach(thePayload.apiKeys, function (apiKey) { if (apiQsKeys.length > 0) { apiQsKeys += ","; } apiQsKeys += apiKey; }); _addRequestDetails(requestDetails, strApiKey, apiQsKeys, useHeaders); _addRequestDetails(requestDetails, strUploadTime, dateNow().toString(), useHeaders); var msfpc = _getMsfpc(thePayload); if (isValueAssigned(msfpc)) { requestDetails.url += "&ext.intweb.msfpc=" + msfpc; } if (_clockSkewManager.shouldAddClockSkewHeaders()) { _addRequestDetails(requestDetails, strTimeDeltaToApply, _clockSkewManager.getClockSkewHeaderValue(), useHeaders); } if (_core.getWParam) { var wParam = _core.getWParam(); if (wParam >= 0) { requestDetails.url += "&w=" + wParam; } } for (var i = 0; i < _queryStringParameters.length; i++) { requestDetails.url += "&" + _queryStringParameters[i].name + "=" + _queryStringParameters[i].value; } return requestDetails; } function _canUseSendBeaconApi() { return !_customHttpInterface && _useBeacons && isBeaconsSupported(); } function _setTimingValue(timings, name, value) { timings[name] = timings[name] || {}; timings[name][_postManager.identifier] = value; } function _doPayloadSend(thePayload, serializationStart, serializationCompleted, sendReason) { if (thePayload && thePayload.payloadBlob && thePayload.payloadBlob.length > 0) { var useSendHook_1 = !!_self.sendHook; var sendInterface_1 = _sendInterfaces[thePayload.sendType]; if (!_isBeaconPayload(thePayload.sendType) && thePayload.isBeacon && thePayload.sendReason === 2 ) { sendInterface_1 = _sendInterfaces[2 ] || _sendInterfaces[3 ] || sendInterface_1; } var useHeaders_1 = _useHeaders; if (thePayload.isBeacon || sendInterface_1._transport === 3 ) { useHeaders_1 = false; } var requestDetails_1 = _buildRequestDetails(thePayload, useHeaders_1); useHeaders_1 = useHeaders_1 || requestDetails_1.useHdrs; var sendEventStart_1 = getTime(); doPerf(_core, function () { return "HttpManager:_doPayloadSend"; }, function () { for (var batchLp = 0; batchLp < thePayload.batches.length; batchLp++) { var theBatch = thePayload.batches[batchLp]; var theEvents = theBatch.events(); for (var evtLp = 0; evtLp < theEvents.length; evtLp++) { var telemetryItem = theEvents[evtLp]; if (_enableEventTimings) { var timings = telemetryItem.timings = telemetryItem.timings || {}; _setTimingValue(timings, "sendEventStart", sendEventStart_1); _setTimingValue(timings, "serializationStart", serializationStart); _setTimingValue(timings, "serializationCompleted", serializationCompleted); } telemetryItem[strSendAttempt] > 0 ? telemetryItem[strSendAttempt]++ : telemetryItem[strSendAttempt] = 1; } } _sendBatchesNotification(thePayload.batches, (1000 + (sendReason || 0 )), thePayload.sendType, true); var orgPayloadData = { data: thePayload.payloadBlob, urlString: requestDetails_1.url, headers: requestDetails_1.hdrs, _thePayload: thePayload, _sendReason: sendReason, timeout: _xhrTimeout }; if (!isUndefined(_disableXhrSync)) { orgPayloadData.disableXhrSync = !!_disableXhrSync; } if (useHeaders_1) { if (!_hasHeader(orgPayloadData.headers, strCacheControl)) { orgPayloadData.headers[strCacheControl] = defaultCacheControl; } if (!_hasHeader(orgPayloadData.headers, strContentTypeHeader)) { orgPayloadData.headers[strContentTypeHeader] = defaultContentType; } } var sender = null; if (sendInterface_1) { sender = function (payload) { _clockSkewManager.firstRequestSent(); var onComplete = function (status, headers) { _retryRequestIfNeeded(status, headers, thePayload, sendReason); }; var isSync = thePayload.isTeardown || thePayload.isSync; try { sendInterface_1.sendPOST(payload, onComplete, isSync); if (_self.sendListener) { _self.sendListener(orgPayloadData, payload, isSync, thePayload.isBeacon); } } catch (ex) { _postManager.diagLog().warnToConsole("Unexpected exception sending payload. Ex:" + dumpObj(ex)); _doOnComplete(onComplete, 0, {}); } }; } doPerf(_core, function () { return "HttpManager:_doPayloadSend.sender"; }, function () { if (sender) { if (thePayload.sendType === 0 ) { _outstandingRequests++; } if (useSendHook_1 && !thePayload.isBeacon && sendInterface_1._transport !== 3 ) { var hookData_1 = { data: orgPayloadData.data, urlString: orgPayloadData.urlString, headers: extend({}, orgPayloadData.headers), timeout: orgPayloadData.timeout, disableXhrSync: orgPayloadData.disableXhrSync }; var senderCalled_1 = false; doPerf(_core, function () { return "HttpManager:_doPayloadSend.sendHook"; }, function () { try { _self.sendHook(hookData_1, function (payload) { senderCalled_1 = true; if (!_customHttpInterface && !payload._thePayload) { payload._thePayload = payload._thePayload || orgPayloadData._thePayload; payload._sendReason = payload._sendReason || orgPayloadData._sendReason; } sender(payload); }, thePayload.isSync || thePayload.isTeardown); } catch (ex) { if (!senderCalled_1) { sender(orgPayloadData); } } }); } else { sender(orgPayloadData); } } }); }, function () { return ({ thePayload: thePayload, serializationStart: serializationStart, serializationCompleted: serializationCompleted, sendReason: sendReason }); }, thePayload.isSync); } if (thePayload.sizeExceed && thePayload.sizeExceed.length > 0) { _sendBatchesNotification(thePayload.sizeExceed, 8003 , thePayload.sendType); } if (thePayload.failedEvts && thePayload.failedEvts.length > 0) { _sendBatchesNotification(thePayload.failedEvts, 8002 , thePayload.sendType); } } function _addEventCompletedTimings(theEvents, sendEventCompleted) { if (_enableEventTimings) { arrForEach(theEvents, function (theEvent) { var timings = theEvent.timings = theEvent.timings || {}; _setTimingValue(timings, "sendEventCompleted", sendEventCompleted); }); } } function _retryRequestIfNeeded(status, headers, thePayload, sendReason) { var reason = 9000 ; var droppedBatches = null; var isRetrying = false; var backOffTrans = false; try { var shouldRetry = true; if (typeof status !== strShimUndefined) { if (headers) { _clockSkewManager.setClockSkew(headers[strTimeDeltaHeader]); var killDuration = headers[strKillDurationHeader] || headers["kill-duration-seconds"]; arrForEach(_killSwitch.setKillSwitchTenants(headers[strKillTokensHeader], killDuration), function (killToken) { arrForEach(thePayload.batches, function (theBatch) { if (theBatch.iKey() === killToken) { droppedBatches = droppedBatches || []; var removedEvents = theBatch.split(0); thePayload.numEvents -= removedEvents.count(); droppedBatches.push(removedEvents); } }); }); } if (status == 200 || status == 204) { reason = 200 ; return; } if (!retryPolicyShouldRetryForStatus(status) || thePayload.numEvents <= 0) { shouldRetry = false; } reason = 9000 + (status % 1000); } if (shouldRetry) { reason = 100 ; var retryCount_1 = thePayload.retryCnt; if (thePayload.sendType === 0 ) { if (retryCount_1 < maxRequestRetriesBeforeBackoff) { isRetrying = true; _doAction(function () { if (thePayload.sendType === 0 ) { _outstandingRequests--; } _sendBatches(thePayload.batches, retryCount_1 + 1, thePayload.isTeardown, _isUnloading ? 2 : thePayload.sendType, 5 ); }, _isUnloading, retryPolicyGetMillisToBackoffForRetry(retryCount_1)); } else { backOffTrans = true; if (_isUnloading) { reason = 8001 ; } } } } } finally { if (!isRetrying) { _clockSkewManager.setClockSkew(); _handleRequestFinished(thePayload, reason, sendReason, backOffTrans); } _sendBatchesNotification(droppedBatches, 8004 , thePayload.sendType); } } function _handleRequestFinished(thePayload, batchReason, sendReason, backOffTrans) { try { if (backOffTrans) { _postManager._backOffTransmission(); } if (batchReason === 200 ) { if (!backOffTrans && !thePayload.isSync) { _postManager._clearBackOff(); } _addCompleteTimings(thePayload.batches); } _sendBatchesNotification(thePayload.batches, batchReason, thePayload.sendType, true); } finally { if (thePayload.sendType === 0 ) { _outstandingRequests--; if (sendReason !== 5 ) { _self.sendQueuedRequests(thePayload.sendType, sendReason); } } } } function _addCompleteTimings(theBatches) { if (_enableEventTimings) { var sendEventCompleted_1 = getTime(); arrForEach(theBatches, function (theBatch) { if (theBatch && theBatch.count() > 0) { _addEventCompletedTimings(theBatch.events(), sendEventCompleted_1); } }); } } function _doAction(cb, isSync, interval) { if (isSync) { cb(); } else { timeoutOverride.set(cb, interval); } } function _convertAllHeadersToMap(headersString) { var headers = {}; if (isString(headersString)) { var headersArray = strTrim(headersString).split(/[\r\n]+/); arrForEach(headersArray, function (headerEntry) { if (headerEntry) { var idx = headerEntry.indexOf(": "); if (idx !== -1) { var header = strTrim(headerEntry.substring(0, idx)).toLowerCase(); var value = strTrim(headerEntry.substring(idx + 1)); headers[header] = value; } else { headers[strTrim(headerEntry)] = 1; } } }); } return headers; } function _getMsfpc(thePayload) { for (var lp = 0; lp < thePayload.batches.length; lp++) { var msfpc = thePayload.batches[lp].Msfpc(); if (msfpc) { return encodeURIComponent(msfpc); } } return ""; } function _handleCollectorResponse(responseText) { var responseHandlers = _self._responseHandlers; try { for (var i = 0; i < responseHandlers.length; i++) { try { responseHandlers[i](responseText); } catch (e) { _throwInternal(_postManager.diagLog(), 1 , 519 , "Response handler failed: " + e); } } if (responseText) { var response = JSON.parse(responseText); if (isValueAssigned(response.webResult) && isValueAssigned(response.webResult[strMsfpc])) { _cookieMgr.set("MSFPC", response.webResult[strMsfpc], 365 * 86400); } } } catch (ex) { } } function _sendBatchesNotification(theBatches, batchReason, sendType, sendSync) { if (theBatches && theBatches.length > 0 && actions) { var theAction_1 = actions[_getNotificationAction(batchReason)]; if (theAction_1) { var isSyncRequest_1 = sendType !== 0 ; doPerf(_core, function () { return "HttpManager:_sendBatchesNotification"; }, function () { _doAction(function () { try { theAction_1.call(actions, theBatches, batchReason, isSyncRequest_1, sendType); } catch (e) { _throwInternal(_postManager.diagLog(), 1 , 74 , "send request notification failed: " + e); } }, sendSync || isSyncRequest_1, 0); }, function () { return ({ batches: _createDebugBatches(theBatches), reason: batchReason, isSync: isSyncRequest_1, sendSync: sendSync, sendType: sendType }); }, !isSyncRequest_1); } } } function _getNotificationAction(reason) { var action = _eventActionMap[reason]; if (!isValueAssigned(action)) { action = strOther; if (reason >= 9000 && reason <= 9999 ) { action = strResponseFail; } else if (reason >= 8000 && reason <= 8999 ) { action = strDropped; } else if (reason >= 1000 && reason <= 1999 ) { action = strSending; } } return action; } }); } return HttpManager; }()); function defaultSetTimeout(callback, ms) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } return setTimeout(callback, ms, args); } function defaultClearTimeout(timeoutId) { clearTimeout(timeoutId); } function createTimeoutWrapper(argSetTimeout, argClearTimeout) { return { set: argSetTimeout || defaultSetTimeout, clear: argClearTimeout || defaultClearTimeout }; } var FlushCheckTimer = 0.250; var MaxNumberEventPerBatch = 500; var EventsDroppedAtOneTime = 20; var MaxSendAttempts = 6; var MaxSyncUnloadSendAttempts = 2; var MaxBackoffCount = 4; var MaxConnections = 2; var MaxRequestRetriesBeforeBackoff = 1; var strEventsDiscarded = "eventsDiscarded"; var strOverrideInstrumentationKey = "overrideInstrumentationKey"; var strMaxEventRetryAttempts = "maxEventRetryAttempts"; var strMaxUnloadEventRetryAttempts = "maxUnloadEventRetryAttempts"; var strAddUnloadCb = "addUnloadCb"; var PostChannel = /** @class */ (function (_super) { __extendsFn(PostChannel, _super); function PostChannel() { var _this = _super.call(this) || this; _this.identifier = "PostChannel"; _this.priority = 1011; _this.version = '3.2.2'; var _config; var _isTeardownCalled = false; var _flushCallbackQueue = []; var _flushCallbackTimerId = null; var _paused = false; var _immediateQueueSize = 0; var _immediateQueueSizeLimit = 500; var _queueSize = 0; var _queueSizeLimit = 10000; var _profiles = {}; var _currentProfile = RT_PROFILE; var _scheduledTimerId = null; var _immediateTimerId = null; var _currentBackoffCount = 0; var _timerCount = 0; var _xhrOverride; var _httpManager; var _batchQueues = {}; var _autoFlushEventsLimit; var _autoFlushBatchLimit; var _delayedBatchSendLatency = -1; var _delayedBatchReason; var _optimizeObject = true; var _isPageUnloadTriggered = false; var _disableXhrSync = false; var _maxEventSendAttempts = MaxSendAttempts; var _maxUnloadEventSendAttempts = MaxSyncUnloadSendAttempts; var _evtNamespace; var _timeoutWrapper; dynamicProto(PostChannel, _this, function (_self, _base) { _initDefaults(); _self["_getDbgPlgTargets"] = function () { return [_httpManager]; }; _self.initialize = function (coreConfig, core, extensions) { doPerf(core, function () { return "PostChannel:initialize"; }, function () { var extendedCore = core; _base.initialize(coreConfig, core, extensions); try { var hasAddUnloadCb = !!core[strAddUnloadCb]; _evtNamespace = mergeEvtNamespace(createUniqueNamespace(_self.identifier), core.evtNamespace && core.evtNamespace()); var ctx = _self._getTelCtx(); coreConfig.extensionConfig[_self.identifier] = coreConfig.extensionConfig[_self.identifier] || {}; _config = ctx.getExtCfg(_self.identifier); _timeoutWrapper = createTimeoutWrapper(_config.setTimeoutOverride, _config.clearTimeoutOverride); _optimizeObject = !_config.disableOptimizeObj && isChromium(); _hookWParam(extendedCore); if (_config.eventsLimitInMem > 0) { _queueSizeLimit = _config.eventsLimitInMem; } if (_config.immediateEventLimit > 0) { _immediateQueueSizeLimit = _config.immediateEventLimit; } if (_config.autoFlushEventsLimit > 0) { _autoFlushEventsLimit = _config.autoFlushEventsLimit; } _disableXhrSync = _config.disableXhrSync; if (isNumber(_config[strMaxEventRetryAttempts])) { _maxEventSendAttempts = _config[strMaxEventRetryAttempts]; } if (isNumber(_config[strMaxUnloadEventRetryAttempts])) { _maxUnloadEventSendAttempts = _config[strMaxUnloadEventRetryAttempts]; } _setAutoLimits(); if (_config.httpXHROverride && _config.httpXHROverride.sendPOST) { _xhrOverride = _config.httpXHROverride; } if (isValueAssigned(coreConfig.anonCookieName)) { _httpManager.addQueryStringParameter("anoncknm", coreConfig.anonCookieName); } _httpManager.sendHook = _config.payloadPreprocessor; _httpManager.sendListener = _config.payloadListener; var endpointUrl = _config.overrideEndpointUrl ? _config.overrideEndpointUrl : coreConfig.endpointUrl; _self._notificationManager = coreConfig.extensionConfig.NotificationManager; _httpManager.initialize(endpointUrl, _self.core, _self, _xhrOverride, _config); var excludePageUnloadEvents = coreConfig.disablePageUnloadEvents || []; addPageUnloadEventListener(_handleUnloadEvents, excludePageUnloadEvents, _evtNamespace); addPageHideEventListener(_handleUnloadEvents, excludePageUnloadEvents, _evtNamespace); addPageShowEventListener(_handleShowEvents, coreConfig.disablePageShowEvents, _evtNamespace); } catch (e) { _self.setInitialized(false); throw e; } }, function () { return ({ coreConfig: coreConfig, core: core, extensions: extensions }); }); }; _self.processTelemetry = function (ev, itemCtx) { setProcessTelemetryTimings(ev, _self.identifier); itemCtx = _self._getTelCtx(itemCtx); var channelConfig = itemCtx.getExtCfg(_self.identifier); var disableTelemetry = !!_config.disableTelemetry; if (channelConfig) { disableTelemetry = disableTelemetry || !!channelConfig.disableTelemetry; } var event = ev; if (!disableTelemetry && !_isTeardownCalled) { if (_config[strOverrideInstrumentationKey]) { event.iKey = _config[strOverrideInstrumentationKey]; } if (channelConfig && channelConfig[strOverrideInstrumentationKey]) { event.iKey = channelConfig[strOverrideInstrumentationKey]; } _addEventToQueues(event, true); if (_isPageUnloadTriggered) { _releaseAllQueues(2 , 2 ); } else { _scheduleTimer(); } } _self.processNext(event, itemCtx); }; _self._doTeardown = function (unloadCtx, unloadState) { _releaseAllQueues(2 , 2 ); _isTeardownCalled = true; _httpManager.teardown(); removePageUnloadEventListener(null, _evtNamespace); removePageHideEventListener(null, _evtNamespace); removePageShowEventListener(null, _evtNamespace); _initDefaults(); }; function _hookWParam(extendedCore) { var existingGetWParamMethod = extendedCore.getWParam; extendedCore.getWParam = function () { var wparam = 0; if (_config.ignoreMc1Ms0CookieProcessing) { wparam = wparam | 2; } return wparam | existingGetWParamMethod(); }; } function _handleUnloadEvents(evt) { var theEvt = evt || getWindow().event; if (theEvt.type !== "beforeunload") { _isPageUnloadTriggered = true; _httpManager.setUnloading(_isPageUnloadTriggered); } _releaseAllQueues(2 , 2 ); } function _handleShowEvents(evt) { _isPageUnloadTriggered = false; _httpManager.setUnloading(_isPageUnloadTriggered); } function _addEventToQueues(event, append) { if (!event.sendAttempt) { event.sendAttempt = 0; } if (!event.latency) { event.latency = 1 ; } if (event.ext && event.ext["trace"]) { delete (event.ext["trace"]); } if (event.ext && event.ext["user"] && event.ext["user"]["id"]) { delete (event.ext["user"]["id"]); } if (_optimizeObject) { event.ext = optimizeObject(event.ext); if (event.baseData) { event.baseData = optimizeObject(event.baseData); } if (event.data) { event.data = optimizeObject(event.data); } } if (event.sync) { if (_currentBackoffCount || _paused) { event.latency = 3 ; event.sync = false; } else { if (_httpManager) { if (_optimizeObject) { event = optimizeObject(event); } _httpManager.sendSynchronousBatch(EventBatch.create(event.iKey, [event]), event.sync === true ? 1 : event.sync, 3 ); return; } } } var evtLatency = event.latency; var queueSize = _queueSize; var queueLimit = _queueSizeLimit; if (evtLatency === 4 ) { queueSize = _immediateQueueSize; queueLimit = _immediateQueueSizeLimit; } var eventDropped = false; if (queueSize < queueLimit) { eventDropped = !_addEventToProperQueue(event, append); } else { var dropLatency = 1 ; var dropNumber = EventsDroppedAtOneTime; if (evtLatency === 4 ) { dropLatency = 4 ; dropNumber = 1; } eventDropped = true; if (_dropEventWithLatencyOrLess(event.iKey, event.latency, dropLatency, dropNumber)) { eventDropped = !_addEventToProperQueue(event, append); } } if (eventDropped) { _notifyEvents(strEventsDiscarded, [event], EventsDiscardedReason.QueueFull); } } _self.setEventQueueLimits = function (eventLimit, autoFlushLimit) { _queueSizeLimit = eventLimit > 0 ? eventLimit : 10000; _autoFlushEventsLimit = autoFlushLimit > 0 ? autoFlushLimit : 0; _setAutoLimits(); var doFlush = _queueSize > eventLimit; if (!doFlush && _autoFlushBatchLimit > 0) { for (var latency = 1 ; !doFlush && latency <= 3 ; latency++) { var batchQueue = _batchQueues[latency]; if (batchQueue && batchQueue.batches) { arrForEach(batchQueue.batches, function (theBatch) { if (theBatch && theBatch.count() >= _autoFlushBatchLimit) { doFlush = true; } }); } } } _performAutoFlush(true, doFlush); }; _self.pause = function () { _clearScheduledTimer(); _paused = true; _httpManager.pause(); }; _self.resume = function () { _paused = false; _httpManager.resume(); _scheduleTimer(); }; _self.addResponseHandler = function (responseHandler) { _httpManager._responseHandlers.push(responseHandler); }; _self._loadTransmitProfiles = function (profiles) { _resetTransmitProfiles(); objForEachKey(profiles, function (profileName, profileValue) { var profLen = profileValue.length; if (profLen >= 2) { var directValue = (profLen > 2 ? profileValue[2] : 0); profileValue.splice(0, profLen - 2); if (profileValue[1] < 0) { profileValue[0] = -1; } if (profileValue[1] > 0 && profileValue[0] > 0) { var timerMultiplier = profileValue[0] / profileValue[1]; profileValue[0] = Math.ceil(timerMultiplier) * profileValue[1]; } if (directValue >= 0 && profileValue[1] >= 0 && directValue > profileValue[1]) { directValue = profileValue[1]; } profileValue.push(directValue); _profiles[profileName] = profileValue; } }); }; _self.flush = function (async, callback, sendReason) { if (async === void 0) { async = true; } if (!_paused) { _clearScheduledTimer(); sendReason = sendReason || 1 ; if (async) { _queueBatches(1 , 0 , sendReason); _resetQueueCounts(); if (_flushCallbackTimerId == null) { _flushCallbackTimerId = _createTimer(function () { _flushImpl(callback, sendReason); }, 0); } else { _flushCallbackQueue.push(callback); } } else { _sendEventsForLatencyAndAbove(1 , 1 , sendReason); if (callback !== null && callback !== undefined) { callback(); } } } }; _self.setMsaAuthTicket = function (ticket) { _httpManager.addHeader(strMsaDeviceTicket, ticket); }; _self.hasEvents = _hasEvents; _self._setTransmitProfile = function (profileName) { if (_currentProfile !== profileName && _profiles[profileName] !== undefined) { _clearScheduledTimer(); _currentProfile = profileName; _scheduleTimer(); } }; function _sendEventsForLatencyAndAbove(latency, sendType, sendReason) { var queued = _queueBatches(latency, sendType, sendReason); _httpManager.sendQueuedRequests(sendType, sendReason); return queued; } function _hasEvents() { return _queueSize > 0; } function _scheduleTimer() { if (_delayedBatchSendLatency >= 0 && _queueBatches(_delayedBatchSendLatency, 0 , _delayedBatchReason)) { _httpManager.sendQueuedRequests(0 , _delayedBatchReason); } if (_immediateQueueSize > 0 && !_immediateTimerId && !_paused) { var immediateTimeOut = _profiles[_currentProfile][2]; if (immediateTimeOut >= 0) { _immediateTimerId = _createTimer(function () { _immediateTimerId = null; _sendEventsForLatencyAndAbove(4 , 0 , 1 ); _scheduleTimer(); }, immediateTimeOut); } } var timeOut = _profiles[_currentProfile][1]; if (!_scheduledTimerId && !_flushCallbackTimerId && timeOut >= 0 && !_paused) { if (_hasEvents()) { _scheduledTimerId = _createTimer(function () { _scheduledTimerId = null; _sendEventsForLatencyAndAbove(_timerCount === 0 ? 3 : 1 , 0 , 1 ); _timerCount++; _timerCount %= 2; _scheduleTimer(); }, timeOut); } else { _timerCount = 0; } } } _self._backOffTransmission = function () { if (_currentBackoffCount < MaxBackoffCount) { _currentBackoffCount++; _clearScheduledTimer(); _scheduleTimer(); } }; _self._clearBackOff = function () { if (_currentBackoffCount) { _currentBackoffCount = 0; _clearScheduledTimer(); _scheduleTimer(); } }; function _initDefaults() { _config = null; _isTeardownCalled = false; _flushCallbackQueue = []; _flushCallbackTimerId = null; _paused = false; _immediateQueueSize = 0; _immediateQueueSizeLimit = 500; _queueSize = 0; _queueSizeLimit = 10000; _profiles = {}; _currentProfile = RT_PROFILE; _scheduledTimerId = null; _immediateTimerId = null; _currentBackoffCount = 0; _timerCount = 0; _xhrOverride = null; _batchQueues = {}; _autoFlushEventsLimit = undefined; _autoFlushBatchLimit = 0; _delayedBatchSendLatency = -1; _delayedBatchReason = null; _optimizeObject = true; _isPageUnloadTriggered = false; _disableXhrSync = false; _maxEventSendAttempts = MaxSendAttempts; _maxUnloadEventSendAttempts = MaxSyncUnloadSendAttempts; _evtNamespace = null; _timeoutWrapper = createTimeoutWrapper(); _httpManager = new HttpManager(MaxNumberEventPerBatch, MaxConnections, MaxRequestRetriesBeforeBackoff, { requeue: _requeueEvents, send: _sendingEvent, sent: _eventsSentEvent, drop: _eventsDropped, rspFail: _eventsResponseFail, oth: _otherEvent }, _timeoutWrapper); _initializeProfiles(); _clearQueues(); _setAutoLimits(); } function _createTimer(theTimerFunc, timeOut) { if (timeOut === 0 && _currentBackoffCount) { timeOut = 1; } var timerMultiplier = 1000; if (_currentBackoffCount) { timerMultiplier = retryPolicyGetMillisToBackoffForRetry(_currentBackoffCount - 1); } return _timeoutWrapper.set(theTimerFunc, timeOut * timerMultiplier); } function _clearScheduledTimer() { if (_scheduledTimerId !== null) { _timeoutWrapper.clear(_scheduledTimerId); _scheduledTimerId = null; _timerCount = 0; } } function _releaseAllQueues(sendType, sendReason) { _clearScheduledTimer(); if (_flushCallbackTimerId) { _timeoutWrapper.clear(_flushCallbackTimerId); _flushCallbackTimerId = null; } if (!_paused) { _sendEventsForLatencyAndAbove(1 , sendType, sendReason); } } function _clearQueues() { _batchQueues[4 ] = { batches: [], iKeyMap: {} }; _batchQueues[3 ] = { batches: [], iKeyMap: {} }; _batchQueues[2 ] = { batches: [], iKeyMap: {} }; _batchQueues[1 ] = { batches: [], iKeyMap: {} }; } function _getEventBatch(iKey, latency, create) { var batchQueue = _batchQueues[latency]; if (!batchQueue) { latency = 1 ; batchQueue = _batchQueues[latency]; } var eventBatch = batchQueue.iKeyMap[iKey]; if (!eventBatch && create) { eventBatch = EventBatch.create(iKey); batchQueue.batches.push(eventBatch); batchQueue.iKeyMap[iKey] = eventBatch; } return eventBatch; } function _performAutoFlush(isAsync, doFlush) { if (_httpManager.canSendRequest() && !_currentBackoffCount) { if (_autoFlushEventsLimit > 0 && _queueSize > _autoFlushEventsLimit) { doFlush = true; } if (doFlush && _flushCallbackTimerId == null) { _self.flush(isAsync, null, 20 ); } } } function _addEventToProperQueue(event, append) { if (_optimizeObject) { event = optimizeObject(event); } var latency = event.latency; var eventBatch = _getEventBatch(event.iKey, latency, true); if (eventBatch.addEvent(event)) { if (latency !== 4 ) { _queueSize++; if (append && event.sendAttempt === 0) { _performAutoFlush(!event.sync, _autoFlushBatchLimit > 0 && eventBatch.count() >= _autoFlushBatchLimit); } } else { _immediateQueueSize++; } return true; } return false; } function _dropEventWithLatencyOrLess(iKey, latency, currentLatency, dropNumber) { while (currentLatency <= latency) { var eventBatch = _getEventBatch(iKey, latency, true); if (eventBatch && eventBatch.count() > 0) { var droppedEvents = eventBatch.split(0, dropNumber); var droppedCount = droppedEvents.count(); if (droppedCount > 0) { if (currentLatency === 4 ) { _immediateQueueSize -= droppedCount; } else { _queueSize -= droppedCount; } _notifyBatchEvents(strEventsDiscarded, [droppedEvents], EventsDiscardedReason.QueueFull); return true; } } currentLatency++; } _resetQueueCounts(); return false; } function _resetQueueCounts() { var immediateQueue = 0; var normalQueue = 0; var _loop_1 = function (latency) { var batchQueue = _batchQueues[latency]; if (batchQueue && batchQueue.batches) { arrForEach(batchQueue.batches, function (theBatch) { if (latency === 4 ) { immediateQueue += theBatch.count(); } else { normalQueue += theBatch.count(); } }); } }; for (var latency = 1 ; latency <= 4 ; latency++) { _loop_1(latency); } _queueSize = normalQueue; _immediateQueueSize = immediateQueue; } function _queueBatches(latency, sendType, sendReason) { var eventsQueued = false; var isAsync = sendType === 0 ; if (!isAsync || _httpManager.canSendRequest()) { doPerf(_self.core, function () { return "PostChannel._queueBatches"; }, function () { var droppedEvents = []; var latencyToProcess = 4 ; while (latencyToProcess >= latency) { var batchQueue = _batchQueues[latencyToProcess]; if (batchQueue && batchQueue.batches && batchQueue.batches.length > 0) { arrForEach(batchQueue.batches, function (theBatch) { if (!_httpManager.addBatch(theBatch)) { droppedEvents = droppedEvents.concat(theBatch.events()); } else { eventsQueued = eventsQueued || (theBatch && theBatch.count() > 0); } if (latencyToProcess === 4 ) { _immediateQueueSize -= theBatch.count(); } else { _queueSize -= theBatch.count(); } }); batchQueue.batches = []; batchQueue.iKeyMap = {}; } latencyToProcess--; } if (droppedEvents.length > 0) { _notifyEvents(strEventsDiscarded, droppedEvents, EventsDiscardedReason.KillSwitch); } if (eventsQueued && _delayedBatchSendLatency >= latency) { _delayedBatchSendLatency = -1; _delayedBatchReason = 0 ; } }, function () { return ({ latency: latency, sendType: sendType, sendReason: sendReason }); }, !isAsync); } else { _delayedBatchSendLatency = _delayedBatchSendLatency >= 0 ? Math.min(_delayedBatchSendLatency, latency) : latency; _delayedBatchReason = Math.max(_delayedBatchReason, sendReason); } return eventsQueued; } function _flushImpl(callback, sendReason) { _sendEventsForLatencyAndAbove(1 , 0 , sendReason); _waitForIdleManager(function () { if (callback) { callback(); } if (_flushCallbackQueue.length > 0) { _flushCallbackTimerId = _createTimer(function () { return _flushImpl(_flushCallbackQueue.shift(), sendReason); }, 0); } else { _flushCallbackTimerId = null; if (_hasEvents()) { _scheduleTimer(); } } }); } function _waitForIdleManager(callback) { if (_httpManager.isCompletelyIdle()) { callback(); } else { _flushCallbackTimerId = _createTimer(function () { _waitForIdleManager(callback); }, FlushCheckTimer); } } function _resetTransmitProfiles() { _clearScheduledTimer(); _initializeProfiles(); _currentProfile = RT_PROFILE; _scheduleTimer(); } function _initializeProfiles() { _profiles = {}; _profiles[RT_PROFILE] = [2, 1, 0]; _profiles[NRT_PROFILE] = [6, 3, 0]; _profiles[BE_PROFILE] = [18, 9, 0]; } function _requeueEvents(batches, reason) { var droppedEvents = []; var maxSendAttempts = _maxEventSendAttempts; if (_isPageUnloadTriggered) { maxSendAttempts = _maxUnloadEventSendAttempts; } arrForEach(batches, function (theBatch) { if (theBatch && theBatch.count() > 0) { arrForEach(theBatch.events(), function (theEvent) { if (theEvent) { if (theEvent.sync) { theEvent.latency = 4 ; theEvent.sync = false; } if (theEvent.sendAttempt < maxSendAttempts) { setProcessTelemetryTimings(theEvent, _self.identifier); _addEventToQueues(theEvent, false); } else { droppedEvents.push(theEvent); } } }); } }); if (droppedEvents.length > 0) { _notifyEvents(strEventsDiscarded, droppedEvents, EventsDiscardedReason.NonRetryableStatus); } if (_isPageUnloadTriggered) { _releaseAllQueues(2 , 2 ); } } function _callNotification(evtName, theArgs) { var manager = (_self._notificationManager || {}); var notifyFunc = manager[evtName]; if (notifyFunc) { try { notifyFunc.apply(manager, theArgs); } catch (e) { _throwInternal(_self.diagLog(), 1 , 74 , evtName + " notification failed: " + e); } } } function _notifyEvents(evtName, theEvents) { var extraArgs = []; for (var _i = 2; _i < arguments.length; _i++) { extraArgs[_i - 2] = arguments[_i]; } if (theEvents && theEvents.length > 0) { _callNotification(evtName, [theEvents].concat(extraArgs)); } } function _notifyBatchEvents(evtName, batches) { var extraArgs = []; for (var _i = 2; _i < arguments.length; _i++) { extraArgs[_i - 2] = arguments[_i]; } if (batches && batches.length > 0) { arrForEach(batches, function (theBatch) { if (theBatch && theBatch.count() > 0) { _callNotification(evtName, [theBatch.events()].concat(extraArgs)); } }); } } function _sendingEvent(batches, reason, isSyncRequest) { if (batches && batches.length > 0) { _callNotification("eventsSendRequest", [(reason >= 1000 && reason <= 1999 ? reason - 1000 : 0 ), isSyncRequest !== true]); } } function _eventsSentEvent(batches, reason) { _notifyBatchEvents("eventsSent", batches, reason); _scheduleTimer(); } function _eventsDropped(batches, reason) { _notifyBatchEvents(strEventsDiscarded, batches, (reason >= 8000 && reason <= 8999 ? reason - 8000 : EventsDiscardedReason.Unknown)); } function _eventsResponseFail(batches) { _notifyBatchEvents(strEventsDiscarded, batches, EventsDiscardedReason.NonRetryableStatus); _scheduleTimer(); } function _otherEvent(batches, reason) { _notifyBatchEvents(strEventsDiscarded, batches, EventsDiscardedReason.Unknown); _scheduleTimer(); } function _setAutoLimits() { if (!_config || !_config.disableAutoBatchFlushLimit) { _autoFlushBatchLimit = Math.max(MaxNumberEventPerBatch * (MaxConnections + 1), _queueSizeLimit / 6); } else { _autoFlushBatchLimit = 0; } } objDefineAccessors(_self, "_setTimeoutOverride", function () { return _timeoutWrapper.set; }, function (value) { _timeoutWrapper = createTimeoutWrapper(value, _timeoutWrapper.clear); }); objDefineAccessors(_self, "_clearTimeoutOverride", function () { return _timeoutWrapper.clear; }, function (value) { _timeoutWrapper = createTimeoutWrapper(_timeoutWrapper.set, value); }); }); return _this; } return PostChannel; }(BaseTelemetryPlugin)); var PostChannel$1 = PostChannel; exports.BE_PROFILE = BE_PROFILE; exports.NRT_PROFILE = NRT_PROFILE; exports.PostChannel = PostChannel$1; exports.RT_PROFILE = RT_PROFILE; (function(obj, prop, descriptor) { /* ai_es3_polyfil defineProperty */ var func = Object["defineProperty"]; if (func) { try { return func(obj, prop, descriptor); } catch(e) { /* IE8 defines defineProperty, but will throw */ } } if (descriptor && typeof descriptor.value !== undefined) { obj[prop] = descriptor.value; } return obj; })(exports, '__esModule', { value: true }); }));//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/1ds-post-js/bundle/ms.post.js.map /*! * 1DS JS SDK POST plugin, 3.2.2 * Copyright (c) Microsoft and contributors. All rights reserved. * (Microsoft Internal Only) */ var n=this,e=function(s){"use strict";var l="function",Q="object",J="undefined",a="prototype",f="hasOwnProperty",t=Object,n=t[a],C=t.assign,e=(t.create,t.defineProperty),v=n[f],r=null;function T(n){return void 0===n&&(n=!0),r&&n||(typeof globalThis!==J&&globalThis&&(r=globalThis),typeof self!==J&&self&&(r=self),typeof window!==J&&window&&(r=window),typeof global!==J&&global&&(r=global)),r}function _(n){throw new TypeError(n)}(T()||{}).Symbol,(T()||{}).Reflect;var S=function(n,e){return(S=t.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var t in e)e[f](t)&&(n[t]=e[t])})(n,e)},E="constructor",g="prototype",P="function",R="_dynInstFuncs",L="_isDynProxy",p="_dynClass",M="_dynInstChk",N=M,k="_dfOpts",O="_unknown_",K="__proto__",I="_dyn"+K,A="_dynInstProto",B="useBaseInst",H="setInstFuncs",q=Object,U=q.getPrototypeOf,z=q.getOwnPropertyNames,D=0;function h(n,e){return n&&q[g].hasOwnProperty.call(n,e)}function j(n){return n&&(n===q[g]||n===Array[g])}function F(n){return j(n)||n===Function[g]}function y(n){if(n){if(U)return U(n);var e=n[K]||n[g]||(n[E]?n[E][g]:null),t=n[I]||e;h(n,I)||(delete n[A],t=n[I]=n[A]||n[I],n[A]=e)}return t}function X(n,e){var t=[];if(z)t=z(n);else for(var r in n)"string"==typeof r&&h(n,r)&&t.push(r);if(t&&0=o&&!(n=r===i)){for(var a=0;a=o.maxInternalMessageLimit()||(r=!0,t="AITR_"+e.messageId,c[t]?r=!1:c[t]=!0,r&&(n<=o.telemetryLoggingLevel()&&(o.queue.push(e),u++,a(1===n?"error":"warn",e)),u===o.maxInternalMessageLimit()&&(r=new _e(23,t="Internal events throttle limit per PageView reached for this app.",!1),o.queue.push(r),1===n?o.errorToConsole(t):o.warnToConsole(t))))}})};function un(n,e,t,r,i,o){void 0===o&&(o=!1),(n||new Ee).throwInternal(e,t,r,i,o)}u.ParentContextKey="parent",u.ChildrenContextKey="childEvts";var Pe=u;function u(n,i,e){var t,o=this,a=!1;o.start=G(),o.name=n,o.isAsync=e,o.isChildEvt=function(){return!1},x(i)&&(a=$n(o,"payload",function(){return!t&&x(i)&&(t=i(),i=null),t})),o.getCtx=function(n){return n?(n===u.ParentContextKey||n===u.ChildrenContextKey?o:o.ctx||{})[n]:null},o.setCtx=function(n,e){n&&(n===u.ParentContextKey?(o[n]||(o.isChildEvt=function(){return!0}),o[n]=e):n===u.ChildrenContextKey?o[n]=e:(o.ctx=o.ctx||{})[n]=e)},o.complete=function(){var n=0,e=o.getCtx(u.ChildrenContextKey);if(tn(e))for(var t=0;t>>=0),Ne=123456789+e&c,ke=987654321-e&c,Me=!0}catch(o){}r=((ke=36969*(65535&ke)+(ke>>16)&c)<<16)+(65535&(Ne=18e3*(65535&Ne)+(Ne>>16)&c))>>>0&c|0,t=(r>>>=0)&c}return 0===t&&(t=Math.floor(Le*Math.random()|0)),n||(t>>>=0),t}var Ke=e,Ie="2.8.3",Ae="."+function(n){void 0===n&&(n=22);for(var e=Oe()>>>0,t=0,r=d;r.length>>=6,5==++t&&(e=(Oe()<<2&4294967295|3&e)>>>0,t=0);return r}(6),Be=0;function He(n){return 1===n.nodeType||9===n.nodeType||!+n.nodeType}function qe(n,e){return Hn(n+Be+++((e=void 0!==e&&e)?"."+Ie:"")+Ae)}function Ue(n){var o={id:qe("_aiData-"+(n||"")+"."+Ie),accept:He,get:function(n,e,t,r){var i=n[o.id];return i?i[Hn(e)]:(r&&((i=function(n,e){var t=e[n.id];if(!t){t={};try{He(e)&&!function(n,e,t){if(Ke)try{return Ke(n,e,{value:t,enumerable:!1,configurable:!0}),1}catch(r){}}(e,n.id,t)&&(e[n.id]=t)}catch(r){}}return t}(o,n))[Hn(e)]=t),t)},kill:function(n,e){if(n&&n[e])try{delete n[e]}catch(t){}}};return o}var ze=Ue("plugin");function De(n){return ze.get(n,"state",{},!0)}var je="TelemetryPluginChain",Fe="_hasRun",Xe="_getTelCtx",Qe=0;function Je(n,a,t,e){var r=null,i=[],o=(null!==e&&(r=e?function(n,e,t){for(;n;){if(n.getPlugin()===t)return n;n=n.getNext()}return $e([t],e.config||{},e)}(n,t,e):n),{_next:function(){var n,e=r;return r=e?e.getNext():null,e||(n=i)&&0G()||(delete e[n],!1)}})},ar=function Mr(){var e=!0,t=!0,r=!0,i="use-collector-delta",o=!1;m(Mr,this,function(n){n.allowRequestSending=function(){return e},n.firstRequestSent=function(){r&&(r=!1,o||(e=!1))},n.shouldAddClockSkewHeaders=function(){return t},n.getClockSkewHeaderValue=function(){return i},n.setClockSkew=function(n){o||(n?(i=n,o=t=!0):t=!1,e=!0)}})},ur="sendAttempt",cr="&NoResponseBody=true",sr=((i={})[1]=n,i[100]=n,i[200]="sent",i[8004]=Ot,i[8003]=Ot,i),lr={},fr={};function o(n,e,t){lr[n]=e,!1!==t&&(fr[e]=n)}function dr(n){try{return n.responseText}catch(e){}return""}function vr(n,e){var t=!1;if(n&&e){var r=Wn(n);if(r&&0=N)):q++,1)}function v(){for(var t=0,r=0,n=1;n<=4;n++)!function(e){var n=$[e];n&&n.batches&&rn(n.batches,function(n){4===e?t+=n.count():r+=n.count()})}(n);z=r,q=t}function g(r,n,e){var i=!1,t=0===n;return!t||L.canSendRequest()?cn(p.core,function(){return"PostChannel._queueBatches"},function(){for(var e=[],t=4;r<=t;){var n=$[t];n&&n.batches&&0=N&&(t=!0)})}f(!0,t)},p.pause=function(){c(),H=!0,L.pause()},p.resume=function(){H=!1,L.resume(),a()},p.addResponseHandler=function(n){L._responseHandlers.push(n)},p._loadTransmitProfiles=function(n){c(),e(),F=Nt,a(),en(n,function(n,e){var t,r=e.length;2<=r&&(t=2e[1]&&(t=e[1]),e.push(t),j[n]=e)})},p.flush=function(n,e,t){void 0===n&&(n=!0),H||(c(),t=t||1,n?(g(1,0,t),v(),null==B?B=u(function(){!function r(n,e){o(1,0,e),function t(n){L.isCompletelyIdle()?n():B=u(function(){t(n)},.25)}(function(){n&&n(),0= maxEventsPerBatch) { payload.overflow = theBatch.split(lp); break; } var eventBlob = _self.getEventBlob(theEvent); if (eventBlob && eventBlob.length <= recordMaxSize) { var blobLength = eventBlob.length; var currentSize = payloadBlob.length; if (currentSize + blobLength > requestMaxSize) { payload.overflow = theBatch.split(lp); break; } if (payloadBlob) { payloadBlob += "\n"; } payloadBlob += eventBlob; joinCount++; if (joinCount > _MAX_STRING_JOINS) { payloadBlob.substr(0, 1); joinCount = 0; } eventsAdded = true; payloadEvents++; } else { if (eventBlob) { sizeExceeded.push(theEvent); } else { failedEvts.push(theEvent); } theEvents.splice(lp, 1); lp--; } } lp++; } if (sizeExceeded && sizeExceeded.length > 0) { payload.sizeExceed.push(EventBatch.create(theBatch.iKey(), sizeExceeded)); } if (failedEvts && failedEvts.length > 0) { payload.failedEvts.push(EventBatch.create(theBatch.iKey(), failedEvts)); } if (eventsAdded) { payload.batches.push(theBatch); payload.payloadBlob = payloadBlob; payload.numEvents = payloadEvents; var apiKey = theBatch.iKey(); if (_1dsCoreJs.arrIndexOf(payload.apiKeys, apiKey) === -1) { payload.apiKeys.push(apiKey); } } }, function () { return ({ payload: payload, theBatch: { iKey: theBatch.iKey(), evts: theBatch.events() }, max: maxEventsPerBatch }); }); } return canAddEvents; }; _self.getEventBlob = function (eventData) { try { return _1dsCoreJs.doPerf(perfManager, function () { return "Serializer.getEventBlob"; }, function () { var serializedEvent = {}; serializedEvent.name = eventData.name; serializedEvent.time = eventData.time; serializedEvent.ver = eventData.ver; serializedEvent.iKey = "o:" + _1dsCoreJs.getTenantId(eventData.iKey); var serializedExt = {}; var eventExt = eventData[strExt]; if (eventExt) { serializedEvent[strExt] = serializedExt; _1dsCoreJs.objForEachKey(eventExt, function (key, value) { var data = serializedExt[key] = {}; _processPathKeys(value, data, "ext." + key, true, null, null, true); }); } var serializedData = serializedEvent[strData] = {}; serializedData.baseType = eventData.baseType; var serializedBaseData = serializedData[strBaseData] = {}; _processPathKeys(eventData.baseData, serializedBaseData, strBaseData, false, [strBaseData], function (pathKeys, name, value) { _addJSONPropertyMetaData(serializedExt, pathKeys, name, value); }, _processSubMetaData); _processPathKeys(eventData.data, serializedData, strData, false, [], function (pathKeys, name, value) { _addJSONPropertyMetaData(serializedExt, pathKeys, name, value); }, _processSubMetaData); return JSON.stringify(serializedEvent); }, function () { return ({ item: eventData }); }); } catch (e) { return null; } }; function _isReservedField(path, name) { var result = _isReservedCache[path]; if (result === undefined) { if (path.length >= 7) { result = _1dsCoreJs.strStartsWith(path, "ext.metadata") || _1dsCoreJs.strStartsWith(path, "ext.web"); } _isReservedCache[path] = result; } return result; } function _processPathKeys(srcObj, target, thePath, checkReserved, metadataPathKeys, metadataCallback, processSubKeys) { _1dsCoreJs.objForEachKey(srcObj, function (key, srcValue) { var prop = null; if (srcValue || _1dsCoreJs.isValueAssigned(srcValue)) { var path = thePath; var name_1 = key; var theMetaPathKeys = metadataPathKeys; var destObj = target; if (_checkForCompoundkey && !checkReserved && rCheckDot.test(key)) { var subKeys = key.split("."); var keyLen = subKeys.length; if (keyLen > 1) { if (theMetaPathKeys) { theMetaPathKeys = theMetaPathKeys.slice(); } for (var lp = 0; lp < keyLen - 1; lp++) { var subKey = subKeys[lp]; destObj = destObj[subKey] = destObj[subKey] || {}; path += "." + subKey; if (theMetaPathKeys) { theMetaPathKeys.push(subKey); } } name_1 = subKeys[keyLen - 1]; } } var isReserved = checkReserved && _isReservedField(path); if (!isReserved && _theSanitizer && _theSanitizer.handleField(path, name_1)) { prop = _theSanitizer.value(path, name_1, srcValue, stringifyObjects); } else { prop = _1dsCoreJs.sanitizeProperty(name_1, srcValue, stringifyObjects); } if (prop) { var newValue = prop.value; destObj[name_1] = newValue; if (metadataCallback) { metadataCallback(theMetaPathKeys, name_1, prop); } if (processSubKeys && typeof newValue === "object" && !_1dsCoreJs.isArray(newValue)) { var newPath = theMetaPathKeys; if (newPath) { newPath = newPath.slice(); newPath.push(name_1); } _processPathKeys(srcValue, newValue, path + "." + name_1, checkReserved, newPath, metadataCallback, processSubKeys); } } } }); } }); } return Serializer; }()); function _addJSONPropertyMetaData(json, propKeys, name, propertyValue) { if (propertyValue && json) { var encodedTypeValue = _1dsCoreJs.getCommonSchemaMetaData(propertyValue.value, propertyValue.kind, propertyValue.propertyType); if (encodedTypeValue > -1) { var metaData = json[metadata]; if (!metaData) { metaData = json[metadata] = { f: {} }; } var metaTarget = metaData[f]; if (!metaTarget) { metaTarget = metaData[f] = {}; } if (propKeys) { for (var lp = 0; lp < propKeys.length; lp++) { var key = propKeys[lp]; if (!metaTarget[key]) { metaTarget[key] = { f: {} }; } var newTarget = metaTarget[key][f]; if (!newTarget) { newTarget = metaTarget[key][f] = {}; } metaTarget = newTarget; } } metaTarget = metaTarget[name] = {}; if (_1dsCoreJs.isArray(propertyValue.value)) { metaTarget["a"] = { t: encodedTypeValue }; } else { metaTarget["t"] = encodedTypeValue; } } } } var RandomizationLowerThreshold = 0.8; var RandomizationUpperThreshold = 1.2; var BaseBackoff = 3000; var MaxBackoff = 600000; function retryPolicyShouldRetryForStatus(httpStatusCode) { return !((httpStatusCode >= 300 && httpStatusCode < 500 && httpStatusCode != 408 && httpStatusCode != 429) || (httpStatusCode == 501) || (httpStatusCode == 505)); } function retryPolicyGetMillisToBackoffForRetry(retriesSoFar) { var waitDuration = 0; var minBackoff = BaseBackoff * RandomizationLowerThreshold; var maxBackoff = BaseBackoff * RandomizationUpperThreshold; var randomBackoff = Math.floor(Math.random() * (maxBackoff - minBackoff)) + minBackoff; waitDuration = Math.pow(2, retriesSoFar) * randomBackoff; return Math.min(waitDuration, MaxBackoff); } var SecToMsMultiplier = 1000; var KillSwitch = /** @class */ (function () { function KillSwitch() { var _killedTokenDictionary = {}; function _normalizeTenants(values) { var result = []; if (values) { _1dsCoreJs.arrForEach(values, function (value) { result.push(_1dsCoreJs.strTrim(value)); }); } return result; } dynamicProto__default(KillSwitch, this, function (_self) { _self.setKillSwitchTenants = function (killTokens, killDuration) { if (killTokens && killDuration) { try { var killedTokens = _normalizeTenants(killTokens.split(",")); if (killDuration === "this-request-only") { return killedTokens; } var durationMs = parseInt(killDuration, 10) * SecToMsMultiplier; for (var i = 0; i < killedTokens.length; ++i) { _killedTokenDictionary[killedTokens[i]] = _1dsCoreJs.dateNow() + durationMs; } } catch (ex) { return []; } } return []; }; _self.isTenantKilled = function (tenantToken) { var killDictionary = _killedTokenDictionary; var name = _1dsCoreJs.strTrim(tenantToken); if (killDictionary[name] !== undefined && killDictionary[name] > _1dsCoreJs.dateNow()) { return true; } delete killDictionary[name]; return false; }; }); } return KillSwitch; }()); var ClockSkewManager = /** @class */ (function () { function ClockSkewManager() { var _allowRequestSending = true; var _shouldAddClockSkewHeaders = true; var _isFirstRequest = true; var _clockSkewHeaderValue = "use-collector-delta"; var _clockSkewSet = false; dynamicProto__default(ClockSkewManager, this, function (_self) { _self.allowRequestSending = function () { return _allowRequestSending; }; _self.firstRequestSent = function () { if (_isFirstRequest) { _isFirstRequest = false; if (!_clockSkewSet) { _allowRequestSending = false; } } }; _self.shouldAddClockSkewHeaders = function () { return _shouldAddClockSkewHeaders; }; _self.getClockSkewHeaderValue = function () { return _clockSkewHeaderValue; }; _self.setClockSkew = function (timeDeltaInMillis) { if (!_clockSkewSet) { if (timeDeltaInMillis) { _clockSkewHeaderValue = timeDeltaInMillis; _shouldAddClockSkewHeaders = true; _clockSkewSet = true; } else { _shouldAddClockSkewHeaders = false; } _allowRequestSending = true; } }; }); } return ClockSkewManager; }()); var _a; var strSendAttempt = "sendAttempt"; var _noResponseQs = "&" + strNoResponseBody + "=true"; var _eventActionMap = (_a = {}, _a[1 ] = strRequeue, _a[100 ] = strRequeue, _a[200 ] = "sent", _a[8004 ] = strDropped, _a[8003 ] = strDropped, _a); var _collectorQsHeaders = {}; var _collectorHeaderToQs = {}; function _addCollectorHeaderQsMapping(qsName, headerName, allowQs) { _collectorQsHeaders[qsName] = headerName; if (allowQs !== false) { _collectorHeaderToQs[headerName] = qsName; } } _addCollectorHeaderQsMapping(strMsaDeviceTicket, strMsaDeviceTicket, false); _addCollectorHeaderQsMapping(strClientVersion, strClientVersion); _addCollectorHeaderQsMapping(strClientId, "Client-Id"); _addCollectorHeaderQsMapping(strApiKey, strApiKey); _addCollectorHeaderQsMapping(strTimeDeltaToApply, strTimeDeltaToApply); _addCollectorHeaderQsMapping(strUploadTime, strUploadTime); _addCollectorHeaderQsMapping(strAuthXToken, strAuthXToken); function _getResponseText(xhr) { try { return xhr.responseText; } catch (e) { } return ""; } function _hasHeader(headers, header) { var hasHeader = false; if (headers && header) { var keys = _1dsCoreJs.objKeys(headers); if (keys && keys.length > 0) { var lowerHeader = header.toLowerCase(); for (var lp = 0; lp < keys.length; lp++) { var value = keys[lp]; if (value && _1dsCoreJs.hasOwnProperty(header, value) && value.toLowerCase() === lowerHeader) { hasHeader = true; break; } } } } return hasHeader; } function _addRequestDetails(details, name, value, useHeaders) { if (name && value && value.length > 0) { if (useHeaders && _collectorQsHeaders[name]) { details.hdrs[_collectorQsHeaders[name]] = value; details.useHdrs = true; } else { details.url += "&" + name + "=" + value; } } } var HttpManager = /** @class */ (function () { function HttpManager(maxEventsPerBatch, maxConnections, maxRequestRetriesBeforeBackoff, actions, timeoutOverride) { this._responseHandlers = []; var _urlString = "?cors=true&" + strContentTypeHeader.toLowerCase() + "=" + defaultContentType; var _killSwitch = new KillSwitch(); var _paused = false; var _clockSkewManager = new ClockSkewManager(); var _useBeacons = false; var _outstandingRequests = 0; var _postManager; var _sendInterfaces; var _core; var _customHttpInterface = true; var _queryStringParameters = []; var _headers = {}; var _batchQueue = []; var _serializer = null; var _enableEventTimings = false; var _cookieMgr; var _isUnloading = false; var _useHeaders = false; var _xhrTimeout; var _disableXhrSync; dynamicProto__default(HttpManager, this, function (_self) { var _sendCredentials = true; _self.initialize = function (endpointUrl, core, postChannel, httpInterface, channelConfig) { var _a; if (!channelConfig) { channelConfig = {}; } _urlString = endpointUrl + _urlString; _useHeaders = !_1dsCoreJs.isUndefined(channelConfig.avoidOptions) ? !channelConfig.avoidOptions : true; _core = core; _cookieMgr = core.getCookieMgr(); _enableEventTimings = !_core.config.disableEventTimings; var enableCompoundKey = !!_core.config.enableCompoundKey; _postManager = postChannel; var valueSanitizer = channelConfig.valueSanitizer; var stringifyObjects = channelConfig.stringifyObjects; if (!_1dsCoreJs.isUndefined(channelConfig.enableCompoundKey)) { enableCompoundKey = !!channelConfig.enableCompoundKey; } _xhrTimeout = channelConfig.xhrTimeout; _disableXhrSync = channelConfig.disableXhrSync; _useBeacons = !_1dsCoreJs.isReactNative(); _serializer = new Serializer(_core, valueSanitizer, stringifyObjects, enableCompoundKey); var syncHttpInterface = httpInterface; var beaconHttpInterface = channelConfig.alwaysUseXhrOverride ? httpInterface : null; var fetchSyncHttpInterface = channelConfig.alwaysUseXhrOverride ? httpInterface : null; if (!httpInterface) { _customHttpInterface = false; var location_1 = _1dsCoreJs.getLocation(); if (location_1 && location_1.protocol && location_1.protocol.toLowerCase() === "file:") { _sendCredentials = false; } var theTransports = []; if (_1dsCoreJs.isReactNative()) { theTransports = [2 , 1 ]; } else { theTransports = [1 , 2 , 3 ]; } var configTransports = channelConfig.transports; if (configTransports) { if (_1dsCoreJs.isNumber(configTransports)) { theTransports = [configTransports].concat(theTransports); } else if (_1dsCoreJs.isArray(configTransports)) { theTransports = configTransports.concat(theTransports); } } httpInterface = _getSenderInterface(theTransports, false); syncHttpInterface = _getSenderInterface(theTransports, true); if (!httpInterface) { _postManager.diagLog().warnToConsole("No available transport to send events"); } } _sendInterfaces = (_a = {}, _a[0 ] = httpInterface, _a[1 ] = syncHttpInterface || _getSenderInterface([1 , 2 , 3 ], true), _a[2 ] = beaconHttpInterface || _getSenderInterface([3 , 2 ], true) || syncHttpInterface || _getSenderInterface([1 ], true), _a[3 ] = fetchSyncHttpInterface || _getSenderInterface([2 , 3 ], true) || syncHttpInterface || _getSenderInterface([1 ], true), _a); }; function _getSenderInterface(transports, syncSupport) { var transportType = 0 ; var sendPostFunc = null; var lp = 0; while (sendPostFunc == null && lp < transports.length) { transportType = transports[lp]; if (transportType === 1 ) { if (_1dsCoreJs.useXDomainRequest()) { sendPostFunc = _xdrSendPost; } else if (_1dsCoreJs.isXhrSupported()) { sendPostFunc = _xhrSendPost; } } else if (transportType === 2 && _1dsCoreJs.isFetchSupported(syncSupport)) { sendPostFunc = _fetchSendPost; } else if (_useBeacons && transportType === 3 && _1dsCoreJs.isBeaconsSupported()) { sendPostFunc = _beaconSendPost; } lp++; } if (sendPostFunc) { return { _transport: transportType, _isSync: syncSupport, sendPOST: sendPostFunc }; } return null; } _self["_getDbgPlgTargets"] = function () { return [_sendInterfaces[0 ], _killSwitch, _serializer, _sendInterfaces]; }; function _xdrSendPost(payload, oncomplete, sync) { var xdr = new XDomainRequest(); xdr.open(Method, payload.urlString); if (payload.timeout) { xdr.timeout = payload.timeout; } xdr.onload = function () { var response = _getResponseText(xdr); _doOnComplete(oncomplete, 200, {}, response); _handleCollectorResponse(response); }; xdr.onerror = function () { _doOnComplete(oncomplete, 400, {}); }; xdr.ontimeout = function () { _doOnComplete(oncomplete, 500, {}); }; xdr.onprogress = function () { }; if (sync) { xdr.send(payload.data); } else { timeoutOverride.set(function () { xdr.send(payload.data); }, 0); } } function _fetchSendPost(payload, oncomplete, sync) { var _a; var theUrl = payload.urlString; var ignoreResponse = false; var responseHandled = false; var requestInit = (_a = { body: payload.data, method: Method }, _a[DisabledPropertyName] = true, _a); if (sync) { requestInit.keepalive = true; if (payload._sendReason === 2 ) { ignoreResponse = true; theUrl += _noResponseQs; } } if (_sendCredentials) { requestInit.credentials = "include"; } if (payload.headers && _1dsCoreJs.objKeys(payload.headers).length > 0) { requestInit.headers = payload.headers; } fetch(theUrl, requestInit).then(function (response) { var headerMap = {}; var responseText = ""; if (response.headers) { response.headers.forEach(function (value, name) { headerMap[name] = value; }); } if (response.body) { response.text().then(function (text) { responseText = text; }); } if (!responseHandled) { responseHandled = true; _doOnComplete(oncomplete, response.status, headerMap, responseText); _handleCollectorResponse(responseText); } })["catch"](function (error) { if (!responseHandled) { responseHandled = true; _doOnComplete(oncomplete, 0, {}); } }); if (ignoreResponse && !responseHandled) { responseHandled = true; _doOnComplete(oncomplete, 200, {}); } if (!responseHandled && payload.timeout > 0) { timeoutOverride.set(function () { if (!responseHandled) { responseHandled = true; _doOnComplete(oncomplete, 500, {}); } }, payload.timeout); } } function _xhrSendPost(payload, oncomplete, sync) { var theUrl = payload.urlString; function _appendHeader(theHeaders, xhr, name) { if (!theHeaders[name] && xhr && xhr.getResponseHeader) { var value = xhr.getResponseHeader(name); if (value) { theHeaders[name] = _1dsCoreJs.strTrim(value); } } return theHeaders; } function _getAllResponseHeaders(xhr) { var theHeaders = {}; if (!xhr.getAllResponseHeaders) { theHeaders = _appendHeader(theHeaders, xhr, strTimeDeltaHeader); theHeaders = _appendHeader(theHeaders, xhr, strKillDurationHeader); theHeaders = _appendHeader(theHeaders, xhr, strKillDurationSecondsHeader); } else { theHeaders = _convertAllHeadersToMap(xhr.getAllResponseHeaders()); } return theHeaders; } function xhrComplete(xhr, responseTxt) { _doOnComplete(oncomplete, xhr.status, _getAllResponseHeaders(xhr), responseTxt); } if (sync && payload.disableXhrSync) { sync = false; } var xhrRequest = _1dsCoreJs.openXhr(Method, theUrl, _sendCredentials, true, sync, payload.timeout); _1dsCoreJs.objForEachKey(payload.headers, function (name, value) { xhrRequest.setRequestHeader(name, value); }); xhrRequest.onload = function () { var response = _getResponseText(xhrRequest); xhrComplete(xhrRequest, response); _handleCollectorResponse(response); }; xhrRequest.onerror = function () { xhrComplete(xhrRequest); }; xhrRequest.ontimeout = function () { xhrComplete(xhrRequest); }; xhrRequest.send(payload.data); } function _doOnComplete(oncomplete, status, headers, response) { try { oncomplete(status, headers, response); } catch (e) { _1dsCoreJs._throwInternal(_postManager.diagLog(), 2 , 518 , _1dsCoreJs.dumpObj(e)); } } function _beaconSendPost(payload, oncomplete, sync) { var internalPayloadData = payload; var status = 200; var thePayload = internalPayloadData._thePayload; var theUrl = payload.urlString + _noResponseQs; try { var nav_1 = _1dsCoreJs.getNavigator(); if (!nav_1.sendBeacon(theUrl, payload.data)) { if (thePayload) { var droppedBatches_1 = []; _1dsCoreJs.arrForEach(thePayload.batches, function (theBatch) { if (droppedBatches_1 && theBatch && theBatch.count() > 0) { var theEvents = theBatch.events(); for (var lp = 0; lp < theEvents.length; lp++) { if (!nav_1.sendBeacon(theUrl, _serializer.getEventBlob(theEvents[lp]))) { droppedBatches_1.push(theBatch.split(lp)); break; } } } else { droppedBatches_1.push(theBatch.split(0)); } }); _sendBatchesNotification(droppedBatches_1, 8003 , thePayload.sendType, true); } else { status = 0; } } } catch (ex) { _postManager.diagLog().warnToConsole("Failed to send telemetry using sendBeacon API. Ex:" + _1dsCoreJs.dumpObj(ex)); status = 0; } finally { _doOnComplete(oncomplete, status, {}, ""); } } function _isBeaconPayload(sendType) { return sendType === 2 || sendType === 3 ; } function _adjustSendType(sendType) { if (_isUnloading && _isBeaconPayload(sendType)) { sendType = 2 ; } return sendType; } _self.addQueryStringParameter = function (name, value) { for (var i = 0; i < _queryStringParameters.length; i++) { if (_queryStringParameters[i].name === name) { _queryStringParameters[i].value = value; return; } } _queryStringParameters.push({ name: name, value: value }); }; _self.addHeader = function (name, value) { _headers[name] = value; }; _self.canSendRequest = function () { return _hasIdleConnection() && _clockSkewManager.allowRequestSending(); }; _self.sendQueuedRequests = function (sendType, sendReason) { if (_1dsCoreJs.isUndefined(sendType)) { sendType = 0 ; } if (_isUnloading) { sendType = _adjustSendType(sendType); sendReason = 2 ; } if (_canSendPayload(_batchQueue, sendType, 0)) { _sendBatches(_clearQueue(), 0, false, sendType, sendReason || 0 ); } }; _self.isCompletelyIdle = function () { return !_paused && _outstandingRequests === 0 && _batchQueue.length === 0; }; _self.setUnloading = function (value) { _isUnloading = value; }; _self.addBatch = function (theBatch) { if (theBatch && theBatch.count() > 0) { if (_killSwitch.isTenantKilled(theBatch.iKey())) { return false; } _batchQueue.push(theBatch); } return true; }; _self.teardown = function () { if (_batchQueue.length > 0) { _sendBatches(_clearQueue(), 0, true, 2 , 2 ); } }; _self.pause = function () { _paused = true; }; _self.resume = function () { _paused = false; _self.sendQueuedRequests(0 , 4 ); }; _self.sendSynchronousBatch = function (batch, sendType, sendReason) { if (batch && batch.count() > 0) { if (_1dsCoreJs.isNullOrUndefined(sendType)) { sendType = 1 ; } if (_isUnloading) { sendType = _adjustSendType(sendType); sendReason = 2 ; } _sendBatches([batch], 0, false, sendType, sendReason || 0 ); } }; function _hasIdleConnection() { return !_paused && _outstandingRequests < maxConnections; } function _clearQueue() { var theQueue = _batchQueue; _batchQueue = []; return theQueue; } function _canSendPayload(theBatches, sendType, retryCnt) { var result = false; if (theBatches && theBatches.length > 0 && !_paused && _sendInterfaces[sendType] && _serializer) { result = (sendType !== 0 ) || (_hasIdleConnection() && (retryCnt > 0 || _clockSkewManager.allowRequestSending())); } return result; } function _createDebugBatches(theBatches) { var values = {}; if (theBatches) { _1dsCoreJs.arrForEach(theBatches, function (theBatch, idx) { values[idx] = { iKey: theBatch.iKey(), evts: theBatch.events() }; }); } return values; } function _sendBatches(theBatches, retryCount, isTeardown, sendType, sendReason) { if (!theBatches || theBatches.length === 0) { return; } if (_paused) { _sendBatchesNotification(theBatches, 1 , sendType); return; } sendType = _adjustSendType(sendType); try { var orgBatches_1 = theBatches; var isSynchronous_1 = sendType !== 0 ; _1dsCoreJs.doPerf(_core, function () { return "HttpManager:_sendBatches"; }, function (perfEvt) { if (perfEvt) { theBatches = theBatches.slice(0); } var droppedBatches = []; var thePayload = null; var serializationStart = _1dsCoreJs.getTime(); var sendInterface = _sendInterfaces[sendType] || (isSynchronous_1 ? _sendInterfaces[1 ] : _sendInterfaces[0 ]); var isBeaconTransport = (_isUnloading || _isBeaconPayload(sendType) || (sendInterface && sendInterface._transport === 3 )) && _canUseSendBeaconApi(); while (_canSendPayload(theBatches, sendType, retryCount)) { var theBatch = theBatches.shift(); if (theBatch && theBatch.count() > 0) { if (!_killSwitch.isTenantKilled(theBatch.iKey())) { thePayload = thePayload || _serializer.createPayload(retryCount, isTeardown, isSynchronous_1, isBeaconTransport, sendReason, sendType); if (!_serializer.appendPayload(thePayload, theBatch, maxEventsPerBatch)) { _doPayloadSend(thePayload, serializationStart, _1dsCoreJs.getTime(), sendReason); serializationStart = _1dsCoreJs.getTime(); theBatches = [theBatch].concat(theBatches); thePayload = null; } else if (thePayload.overflow !== null) { theBatches = [thePayload.overflow].concat(theBatches); thePayload.overflow = null; _doPayloadSend(thePayload, serializationStart, _1dsCoreJs.getTime(), sendReason); serializationStart = _1dsCoreJs.getTime(); thePayload = null; } } else { droppedBatches.push(theBatch); } } } if (thePayload) { _doPayloadSend(thePayload, serializationStart, _1dsCoreJs.getTime(), sendReason); } if (theBatches.length > 0) { _batchQueue = theBatches.concat(_batchQueue); } _sendBatchesNotification(droppedBatches, 8004 , sendType); }, function () { return ({ batches: _createDebugBatches(orgBatches_1), retryCount: retryCount, isTeardown: isTeardown, isSynchronous: isSynchronous_1, sendReason: sendReason, useSendBeacon: _isBeaconPayload(sendType), sendType: sendType }); }, !isSynchronous_1); } catch (ex) { _1dsCoreJs._throwInternal(_postManager.diagLog(), 2 , 48 , "Unexpected Exception sending batch: " + _1dsCoreJs.dumpObj(ex)); } } function _buildRequestDetails(thePayload, useHeaders) { var requestDetails = { url: _urlString, hdrs: {}, useHdrs: false }; if (!useHeaders) { _1dsCoreJs.objForEachKey(_headers, function (name, value) { if (_collectorHeaderToQs[name]) { _addRequestDetails(requestDetails, _collectorHeaderToQs[name], value, false); } else { requestDetails.hdrs[name] = value; requestDetails.useHdrs = true; } }); } else { requestDetails.hdrs = _1dsCoreJs.extend(requestDetails.hdrs, _headers); requestDetails.useHdrs = (_1dsCoreJs.objKeys(requestDetails.hdrs).length > 0); } _addRequestDetails(requestDetails, strClientId, "NO_AUTH", useHeaders); _addRequestDetails(requestDetails, strClientVersion, _1dsCoreJs.FullVersionString, useHeaders); var apiQsKeys = ""; _1dsCoreJs.arrForEach(thePayload.apiKeys, function (apiKey) { if (apiQsKeys.length > 0) { apiQsKeys += ","; } apiQsKeys += apiKey; }); _addRequestDetails(requestDetails, strApiKey, apiQsKeys, useHeaders); _addRequestDetails(requestDetails, strUploadTime, _1dsCoreJs.dateNow().toString(), useHeaders); var msfpc = _getMsfpc(thePayload); if (_1dsCoreJs.isValueAssigned(msfpc)) { requestDetails.url += "&ext.intweb.msfpc=" + msfpc; } if (_clockSkewManager.shouldAddClockSkewHeaders()) { _addRequestDetails(requestDetails, strTimeDeltaToApply, _clockSkewManager.getClockSkewHeaderValue(), useHeaders); } if (_core.getWParam) { var wParam = _core.getWParam(); if (wParam >= 0) { requestDetails.url += "&w=" + wParam; } } for (var i = 0; i < _queryStringParameters.length; i++) { requestDetails.url += "&" + _queryStringParameters[i].name + "=" + _queryStringParameters[i].value; } return requestDetails; } function _canUseSendBeaconApi() { return !_customHttpInterface && _useBeacons && _1dsCoreJs.isBeaconsSupported(); } function _setTimingValue(timings, name, value) { timings[name] = timings[name] || {}; timings[name][_postManager.identifier] = value; } function _doPayloadSend(thePayload, serializationStart, serializationCompleted, sendReason) { if (thePayload && thePayload.payloadBlob && thePayload.payloadBlob.length > 0) { var useSendHook_1 = !!_self.sendHook; var sendInterface_1 = _sendInterfaces[thePayload.sendType]; if (!_isBeaconPayload(thePayload.sendType) && thePayload.isBeacon && thePayload.sendReason === 2 ) { sendInterface_1 = _sendInterfaces[2 ] || _sendInterfaces[3 ] || sendInterface_1; } var useHeaders_1 = _useHeaders; if (thePayload.isBeacon || sendInterface_1._transport === 3 ) { useHeaders_1 = false; } var requestDetails_1 = _buildRequestDetails(thePayload, useHeaders_1); useHeaders_1 = useHeaders_1 || requestDetails_1.useHdrs; var sendEventStart_1 = _1dsCoreJs.getTime(); _1dsCoreJs.doPerf(_core, function () { return "HttpManager:_doPayloadSend"; }, function () { for (var batchLp = 0; batchLp < thePayload.batches.length; batchLp++) { var theBatch = thePayload.batches[batchLp]; var theEvents = theBatch.events(); for (var evtLp = 0; evtLp < theEvents.length; evtLp++) { var telemetryItem = theEvents[evtLp]; if (_enableEventTimings) { var timings = telemetryItem.timings = telemetryItem.timings || {}; _setTimingValue(timings, "sendEventStart", sendEventStart_1); _setTimingValue(timings, "serializationStart", serializationStart); _setTimingValue(timings, "serializationCompleted", serializationCompleted); } telemetryItem[strSendAttempt] > 0 ? telemetryItem[strSendAttempt]++ : telemetryItem[strSendAttempt] = 1; } } _sendBatchesNotification(thePayload.batches, (1000 + (sendReason || 0 )), thePayload.sendType, true); var orgPayloadData = { data: thePayload.payloadBlob, urlString: requestDetails_1.url, headers: requestDetails_1.hdrs, _thePayload: thePayload, _sendReason: sendReason, timeout: _xhrTimeout }; if (!_1dsCoreJs.isUndefined(_disableXhrSync)) { orgPayloadData.disableXhrSync = !!_disableXhrSync; } if (useHeaders_1) { if (!_hasHeader(orgPayloadData.headers, strCacheControl)) { orgPayloadData.headers[strCacheControl] = defaultCacheControl; } if (!_hasHeader(orgPayloadData.headers, strContentTypeHeader)) { orgPayloadData.headers[strContentTypeHeader] = defaultContentType; } } var sender = null; if (sendInterface_1) { sender = function (payload) { _clockSkewManager.firstRequestSent(); var onComplete = function (status, headers) { _retryRequestIfNeeded(status, headers, thePayload, sendReason); }; var isSync = thePayload.isTeardown || thePayload.isSync; try { sendInterface_1.sendPOST(payload, onComplete, isSync); if (_self.sendListener) { _self.sendListener(orgPayloadData, payload, isSync, thePayload.isBeacon); } } catch (ex) { _postManager.diagLog().warnToConsole("Unexpected exception sending payload. Ex:" + _1dsCoreJs.dumpObj(ex)); _doOnComplete(onComplete, 0, {}); } }; } _1dsCoreJs.doPerf(_core, function () { return "HttpManager:_doPayloadSend.sender"; }, function () { if (sender) { if (thePayload.sendType === 0 ) { _outstandingRequests++; } if (useSendHook_1 && !thePayload.isBeacon && sendInterface_1._transport !== 3 ) { var hookData_1 = { data: orgPayloadData.data, urlString: orgPayloadData.urlString, headers: _1dsCoreJs.extend({}, orgPayloadData.headers), timeout: orgPayloadData.timeout, disableXhrSync: orgPayloadData.disableXhrSync }; var senderCalled_1 = false; _1dsCoreJs.doPerf(_core, function () { return "HttpManager:_doPayloadSend.sendHook"; }, function () { try { _self.sendHook(hookData_1, function (payload) { senderCalled_1 = true; if (!_customHttpInterface && !payload._thePayload) { payload._thePayload = payload._thePayload || orgPayloadData._thePayload; payload._sendReason = payload._sendReason || orgPayloadData._sendReason; } sender(payload); }, thePayload.isSync || thePayload.isTeardown); } catch (ex) { if (!senderCalled_1) { sender(orgPayloadData); } } }); } else { sender(orgPayloadData); } } }); }, function () { return ({ thePayload: thePayload, serializationStart: serializationStart, serializationCompleted: serializationCompleted, sendReason: sendReason }); }, thePayload.isSync); } if (thePayload.sizeExceed && thePayload.sizeExceed.length > 0) { _sendBatchesNotification(thePayload.sizeExceed, 8003 , thePayload.sendType); } if (thePayload.failedEvts && thePayload.failedEvts.length > 0) { _sendBatchesNotification(thePayload.failedEvts, 8002 , thePayload.sendType); } } function _addEventCompletedTimings(theEvents, sendEventCompleted) { if (_enableEventTimings) { _1dsCoreJs.arrForEach(theEvents, function (theEvent) { var timings = theEvent.timings = theEvent.timings || {}; _setTimingValue(timings, "sendEventCompleted", sendEventCompleted); }); } } function _retryRequestIfNeeded(status, headers, thePayload, sendReason) { var reason = 9000 ; var droppedBatches = null; var isRetrying = false; var backOffTrans = false; try { var shouldRetry = true; if (typeof status !== _1dsCoreJs.strUndefined) { if (headers) { _clockSkewManager.setClockSkew(headers[strTimeDeltaHeader]); var killDuration = headers[strKillDurationHeader] || headers["kill-duration-seconds"]; _1dsCoreJs.arrForEach(_killSwitch.setKillSwitchTenants(headers[strKillTokensHeader], killDuration), function (killToken) { _1dsCoreJs.arrForEach(thePayload.batches, function (theBatch) { if (theBatch.iKey() === killToken) { droppedBatches = droppedBatches || []; var removedEvents = theBatch.split(0); thePayload.numEvents -= removedEvents.count(); droppedBatches.push(removedEvents); } }); }); } if (status == 200 || status == 204) { reason = 200 ; return; } if (!retryPolicyShouldRetryForStatus(status) || thePayload.numEvents <= 0) { shouldRetry = false; } reason = 9000 + (status % 1000); } if (shouldRetry) { reason = 100 ; var retryCount_1 = thePayload.retryCnt; if (thePayload.sendType === 0 ) { if (retryCount_1 < maxRequestRetriesBeforeBackoff) { isRetrying = true; _doAction(function () { if (thePayload.sendType === 0 ) { _outstandingRequests--; } _sendBatches(thePayload.batches, retryCount_1 + 1, thePayload.isTeardown, _isUnloading ? 2 : thePayload.sendType, 5 ); }, _isUnloading, retryPolicyGetMillisToBackoffForRetry(retryCount_1)); } else { backOffTrans = true; if (_isUnloading) { reason = 8001 ; } } } } } finally { if (!isRetrying) { _clockSkewManager.setClockSkew(); _handleRequestFinished(thePayload, reason, sendReason, backOffTrans); } _sendBatchesNotification(droppedBatches, 8004 , thePayload.sendType); } } function _handleRequestFinished(thePayload, batchReason, sendReason, backOffTrans) { try { if (backOffTrans) { _postManager._backOffTransmission(); } if (batchReason === 200 ) { if (!backOffTrans && !thePayload.isSync) { _postManager._clearBackOff(); } _addCompleteTimings(thePayload.batches); } _sendBatchesNotification(thePayload.batches, batchReason, thePayload.sendType, true); } finally { if (thePayload.sendType === 0 ) { _outstandingRequests--; if (sendReason !== 5 ) { _self.sendQueuedRequests(thePayload.sendType, sendReason); } } } } function _addCompleteTimings(theBatches) { if (_enableEventTimings) { var sendEventCompleted_1 = _1dsCoreJs.getTime(); _1dsCoreJs.arrForEach(theBatches, function (theBatch) { if (theBatch && theBatch.count() > 0) { _addEventCompletedTimings(theBatch.events(), sendEventCompleted_1); } }); } } function _doAction(cb, isSync, interval) { if (isSync) { cb(); } else { timeoutOverride.set(cb, interval); } } function _convertAllHeadersToMap(headersString) { var headers = {}; if (_1dsCoreJs.isString(headersString)) { var headersArray = _1dsCoreJs.strTrim(headersString).split(/[\r\n]+/); _1dsCoreJs.arrForEach(headersArray, function (headerEntry) { if (headerEntry) { var idx = headerEntry.indexOf(": "); if (idx !== -1) { var header = _1dsCoreJs.strTrim(headerEntry.substring(0, idx)).toLowerCase(); var value = _1dsCoreJs.strTrim(headerEntry.substring(idx + 1)); headers[header] = value; } else { headers[_1dsCoreJs.strTrim(headerEntry)] = 1; } } }); } return headers; } function _getMsfpc(thePayload) { for (var lp = 0; lp < thePayload.batches.length; lp++) { var msfpc = thePayload.batches[lp].Msfpc(); if (msfpc) { return encodeURIComponent(msfpc); } } return ""; } function _handleCollectorResponse(responseText) { var responseHandlers = _self._responseHandlers; try { for (var i = 0; i < responseHandlers.length; i++) { try { responseHandlers[i](responseText); } catch (e) { _1dsCoreJs._throwInternal(_postManager.diagLog(), 1 , 519 , "Response handler failed: " + e); } } if (responseText) { var response = JSON.parse(responseText); if (_1dsCoreJs.isValueAssigned(response.webResult) && _1dsCoreJs.isValueAssigned(response.webResult[strMsfpc])) { _cookieMgr.set("MSFPC", response.webResult[strMsfpc], 365 * 86400); } } } catch (ex) { } } function _sendBatchesNotification(theBatches, batchReason, sendType, sendSync) { if (theBatches && theBatches.length > 0 && actions) { var theAction_1 = actions[_getNotificationAction(batchReason)]; if (theAction_1) { var isSyncRequest_1 = sendType !== 0 ; _1dsCoreJs.doPerf(_core, function () { return "HttpManager:_sendBatchesNotification"; }, function () { _doAction(function () { try { theAction_1.call(actions, theBatches, batchReason, isSyncRequest_1, sendType); } catch (e) { _1dsCoreJs._throwInternal(_postManager.diagLog(), 1 , 74 , "send request notification failed: " + e); } }, sendSync || isSyncRequest_1, 0); }, function () { return ({ batches: _createDebugBatches(theBatches), reason: batchReason, isSync: isSyncRequest_1, sendSync: sendSync, sendType: sendType }); }, !isSyncRequest_1); } } } function _getNotificationAction(reason) { var action = _eventActionMap[reason]; if (!_1dsCoreJs.isValueAssigned(action)) { action = strOther; if (reason >= 9000 && reason <= 9999 ) { action = strResponseFail; } else if (reason >= 8000 && reason <= 8999 ) { action = strDropped; } else if (reason >= 1000 && reason <= 1999 ) { action = strSending; } } return action; } }); } return HttpManager; }()); function defaultSetTimeout(callback, ms) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } return setTimeout(callback, ms, args); } function defaultClearTimeout(timeoutId) { clearTimeout(timeoutId); } function createTimeoutWrapper(argSetTimeout, argClearTimeout) { return { set: argSetTimeout || defaultSetTimeout, clear: argClearTimeout || defaultClearTimeout }; } var FlushCheckTimer = 0.250; var MaxNumberEventPerBatch = 500; var EventsDroppedAtOneTime = 20; var MaxSendAttempts = 6; var MaxSyncUnloadSendAttempts = 2; var MaxBackoffCount = 4; var MaxConnections = 2; var MaxRequestRetriesBeforeBackoff = 1; var strEventsDiscarded = "eventsDiscarded"; var strOverrideInstrumentationKey = "overrideInstrumentationKey"; var strMaxEventRetryAttempts = "maxEventRetryAttempts"; var strMaxUnloadEventRetryAttempts = "maxUnloadEventRetryAttempts"; var strAddUnloadCb = "addUnloadCb"; var PostChannel = /** @class */ (function (_super) { applicationinsightsShims.__extendsFn(PostChannel, _super); function PostChannel() { var _this = _super.call(this) || this; _this.identifier = "PostChannel"; _this.priority = 1011; _this.version = '3.2.2'; var _config; var _isTeardownCalled = false; var _flushCallbackQueue = []; var _flushCallbackTimerId = null; var _paused = false; var _immediateQueueSize = 0; var _immediateQueueSizeLimit = 500; var _queueSize = 0; var _queueSizeLimit = 10000; var _profiles = {}; var _currentProfile = RT_PROFILE; var _scheduledTimerId = null; var _immediateTimerId = null; var _currentBackoffCount = 0; var _timerCount = 0; var _xhrOverride; var _httpManager; var _batchQueues = {}; var _autoFlushEventsLimit; var _autoFlushBatchLimit; var _delayedBatchSendLatency = -1; var _delayedBatchReason; var _optimizeObject = true; var _isPageUnloadTriggered = false; var _disableXhrSync = false; var _maxEventSendAttempts = MaxSendAttempts; var _maxUnloadEventSendAttempts = MaxSyncUnloadSendAttempts; var _evtNamespace; var _timeoutWrapper; dynamicProto__default(PostChannel, _this, function (_self, _base) { _initDefaults(); _self["_getDbgPlgTargets"] = function () { return [_httpManager]; }; _self.initialize = function (coreConfig, core, extensions) { _1dsCoreJs.doPerf(core, function () { return "PostChannel:initialize"; }, function () { var extendedCore = core; _base.initialize(coreConfig, core, extensions); try { var hasAddUnloadCb = !!core[strAddUnloadCb]; _evtNamespace = _1dsCoreJs.mergeEvtNamespace(_1dsCoreJs.createUniqueNamespace(_self.identifier), core.evtNamespace && core.evtNamespace()); var ctx = _self._getTelCtx(); coreConfig.extensionConfig[_self.identifier] = coreConfig.extensionConfig[_self.identifier] || {}; _config = ctx.getExtCfg(_self.identifier); _timeoutWrapper = createTimeoutWrapper(_config.setTimeoutOverride, _config.clearTimeoutOverride); _optimizeObject = !_config.disableOptimizeObj && _1dsCoreJs.isChromium(); _hookWParam(extendedCore); if (_config.eventsLimitInMem > 0) { _queueSizeLimit = _config.eventsLimitInMem; } if (_config.immediateEventLimit > 0) { _immediateQueueSizeLimit = _config.immediateEventLimit; } if (_config.autoFlushEventsLimit > 0) { _autoFlushEventsLimit = _config.autoFlushEventsLimit; } _disableXhrSync = _config.disableXhrSync; if (_1dsCoreJs.isNumber(_config[strMaxEventRetryAttempts])) { _maxEventSendAttempts = _config[strMaxEventRetryAttempts]; } if (_1dsCoreJs.isNumber(_config[strMaxUnloadEventRetryAttempts])) { _maxUnloadEventSendAttempts = _config[strMaxUnloadEventRetryAttempts]; } _setAutoLimits(); if (_config.httpXHROverride && _config.httpXHROverride.sendPOST) { _xhrOverride = _config.httpXHROverride; } if (_1dsCoreJs.isValueAssigned(coreConfig.anonCookieName)) { _httpManager.addQueryStringParameter("anoncknm", coreConfig.anonCookieName); } _httpManager.sendHook = _config.payloadPreprocessor; _httpManager.sendListener = _config.payloadListener; var endpointUrl = _config.overrideEndpointUrl ? _config.overrideEndpointUrl : coreConfig.endpointUrl; _self._notificationManager = coreConfig.extensionConfig.NotificationManager; _httpManager.initialize(endpointUrl, _self.core, _self, _xhrOverride, _config); var excludePageUnloadEvents = coreConfig.disablePageUnloadEvents || []; _1dsCoreJs.addPageUnloadEventListener(_handleUnloadEvents, excludePageUnloadEvents, _evtNamespace); _1dsCoreJs.addPageHideEventListener(_handleUnloadEvents, excludePageUnloadEvents, _evtNamespace); _1dsCoreJs.addPageShowEventListener(_handleShowEvents, coreConfig.disablePageShowEvents, _evtNamespace); } catch (e) { _self.setInitialized(false); throw e; } }, function () { return ({ coreConfig: coreConfig, core: core, extensions: extensions }); }); }; _self.processTelemetry = function (ev, itemCtx) { _1dsCoreJs.setProcessTelemetryTimings(ev, _self.identifier); itemCtx = _self._getTelCtx(itemCtx); var channelConfig = itemCtx.getExtCfg(_self.identifier); var disableTelemetry = !!_config.disableTelemetry; if (channelConfig) { disableTelemetry = disableTelemetry || !!channelConfig.disableTelemetry; } var event = ev; if (!disableTelemetry && !_isTeardownCalled) { if (_config[strOverrideInstrumentationKey]) { event.iKey = _config[strOverrideInstrumentationKey]; } if (channelConfig && channelConfig[strOverrideInstrumentationKey]) { event.iKey = channelConfig[strOverrideInstrumentationKey]; } _addEventToQueues(event, true); if (_isPageUnloadTriggered) { _releaseAllQueues(2 , 2 ); } else { _scheduleTimer(); } } _self.processNext(event, itemCtx); }; _self._doTeardown = function (unloadCtx, unloadState) { _releaseAllQueues(2 , 2 ); _isTeardownCalled = true; _httpManager.teardown(); _1dsCoreJs.removePageUnloadEventListener(null, _evtNamespace); _1dsCoreJs.removePageHideEventListener(null, _evtNamespace); _1dsCoreJs.removePageShowEventListener(null, _evtNamespace); _initDefaults(); }; function _hookWParam(extendedCore) { var existingGetWParamMethod = extendedCore.getWParam; extendedCore.getWParam = function () { var wparam = 0; if (_config.ignoreMc1Ms0CookieProcessing) { wparam = wparam | 2; } return wparam | existingGetWParamMethod(); }; } function _handleUnloadEvents(evt) { var theEvt = evt || _1dsCoreJs.getWindow().event; if (theEvt.type !== "beforeunload") { _isPageUnloadTriggered = true; _httpManager.setUnloading(_isPageUnloadTriggered); } _releaseAllQueues(2 , 2 ); } function _handleShowEvents(evt) { _isPageUnloadTriggered = false; _httpManager.setUnloading(_isPageUnloadTriggered); } function _addEventToQueues(event, append) { if (!event.sendAttempt) { event.sendAttempt = 0; } if (!event.latency) { event.latency = 1 ; } if (event.ext && event.ext["trace"]) { delete (event.ext["trace"]); } if (event.ext && event.ext["user"] && event.ext["user"]["id"]) { delete (event.ext["user"]["id"]); } if (_optimizeObject) { event.ext = _1dsCoreJs.optimizeObject(event.ext); if (event.baseData) { event.baseData = _1dsCoreJs.optimizeObject(event.baseData); } if (event.data) { event.data = _1dsCoreJs.optimizeObject(event.data); } } if (event.sync) { if (_currentBackoffCount || _paused) { event.latency = 3 ; event.sync = false; } else { if (_httpManager) { if (_optimizeObject) { event = _1dsCoreJs.optimizeObject(event); } _httpManager.sendSynchronousBatch(EventBatch.create(event.iKey, [event]), event.sync === true ? 1 : event.sync, 3 ); return; } } } var evtLatency = event.latency; var queueSize = _queueSize; var queueLimit = _queueSizeLimit; if (evtLatency === 4 ) { queueSize = _immediateQueueSize; queueLimit = _immediateQueueSizeLimit; } var eventDropped = false; if (queueSize < queueLimit) { eventDropped = !_addEventToProperQueue(event, append); } else { var dropLatency = 1 ; var dropNumber = EventsDroppedAtOneTime; if (evtLatency === 4 ) { dropLatency = 4 ; dropNumber = 1; } eventDropped = true; if (_dropEventWithLatencyOrLess(event.iKey, event.latency, dropLatency, dropNumber)) { eventDropped = !_addEventToProperQueue(event, append); } } if (eventDropped) { _notifyEvents(strEventsDiscarded, [event], _1dsCoreJs.EventsDiscardedReason.QueueFull); } } _self.setEventQueueLimits = function (eventLimit, autoFlushLimit) { _queueSizeLimit = eventLimit > 0 ? eventLimit : 10000; _autoFlushEventsLimit = autoFlushLimit > 0 ? autoFlushLimit : 0; _setAutoLimits(); var doFlush = _queueSize > eventLimit; if (!doFlush && _autoFlushBatchLimit > 0) { for (var latency = 1 ; !doFlush && latency <= 3 ; latency++) { var batchQueue = _batchQueues[latency]; if (batchQueue && batchQueue.batches) { _1dsCoreJs.arrForEach(batchQueue.batches, function (theBatch) { if (theBatch && theBatch.count() >= _autoFlushBatchLimit) { doFlush = true; } }); } } } _performAutoFlush(true, doFlush); }; _self.pause = function () { _clearScheduledTimer(); _paused = true; _httpManager.pause(); }; _self.resume = function () { _paused = false; _httpManager.resume(); _scheduleTimer(); }; _self.addResponseHandler = function (responseHandler) { _httpManager._responseHandlers.push(responseHandler); }; _self._loadTransmitProfiles = function (profiles) { _resetTransmitProfiles(); _1dsCoreJs.objForEachKey(profiles, function (profileName, profileValue) { var profLen = profileValue.length; if (profLen >= 2) { var directValue = (profLen > 2 ? profileValue[2] : 0); profileValue.splice(0, profLen - 2); if (profileValue[1] < 0) { profileValue[0] = -1; } if (profileValue[1] > 0 && profileValue[0] > 0) { var timerMultiplier = profileValue[0] / profileValue[1]; profileValue[0] = Math.ceil(timerMultiplier) * profileValue[1]; } if (directValue >= 0 && profileValue[1] >= 0 && directValue > profileValue[1]) { directValue = profileValue[1]; } profileValue.push(directValue); _profiles[profileName] = profileValue; } }); }; _self.flush = function (async, callback, sendReason) { if (async === void 0) { async = true; } if (!_paused) { _clearScheduledTimer(); sendReason = sendReason || 1 ; if (async) { _queueBatches(1 , 0 , sendReason); _resetQueueCounts(); if (_flushCallbackTimerId == null) { _flushCallbackTimerId = _createTimer(function () { _flushImpl(callback, sendReason); }, 0); } else { _flushCallbackQueue.push(callback); } } else { _sendEventsForLatencyAndAbove(1 , 1 , sendReason); if (callback !== null && callback !== undefined) { callback(); } } } }; _self.setMsaAuthTicket = function (ticket) { _httpManager.addHeader(strMsaDeviceTicket, ticket); }; _self.hasEvents = _hasEvents; _self._setTransmitProfile = function (profileName) { if (_currentProfile !== profileName && _profiles[profileName] !== undefined) { _clearScheduledTimer(); _currentProfile = profileName; _scheduleTimer(); } }; function _sendEventsForLatencyAndAbove(latency, sendType, sendReason) { var queued = _queueBatches(latency, sendType, sendReason); _httpManager.sendQueuedRequests(sendType, sendReason); return queued; } function _hasEvents() { return _queueSize > 0; } function _scheduleTimer() { if (_delayedBatchSendLatency >= 0 && _queueBatches(_delayedBatchSendLatency, 0 , _delayedBatchReason)) { _httpManager.sendQueuedRequests(0 , _delayedBatchReason); } if (_immediateQueueSize > 0 && !_immediateTimerId && !_paused) { var immediateTimeOut = _profiles[_currentProfile][2]; if (immediateTimeOut >= 0) { _immediateTimerId = _createTimer(function () { _immediateTimerId = null; _sendEventsForLatencyAndAbove(4 , 0 , 1 ); _scheduleTimer(); }, immediateTimeOut); } } var timeOut = _profiles[_currentProfile][1]; if (!_scheduledTimerId && !_flushCallbackTimerId && timeOut >= 0 && !_paused) { if (_hasEvents()) { _scheduledTimerId = _createTimer(function () { _scheduledTimerId = null; _sendEventsForLatencyAndAbove(_timerCount === 0 ? 3 : 1 , 0 , 1 ); _timerCount++; _timerCount %= 2; _scheduleTimer(); }, timeOut); } else { _timerCount = 0; } } } _self._backOffTransmission = function () { if (_currentBackoffCount < MaxBackoffCount) { _currentBackoffCount++; _clearScheduledTimer(); _scheduleTimer(); } }; _self._clearBackOff = function () { if (_currentBackoffCount) { _currentBackoffCount = 0; _clearScheduledTimer(); _scheduleTimer(); } }; function _initDefaults() { _config = null; _isTeardownCalled = false; _flushCallbackQueue = []; _flushCallbackTimerId = null; _paused = false; _immediateQueueSize = 0; _immediateQueueSizeLimit = 500; _queueSize = 0; _queueSizeLimit = 10000; _profiles = {}; _currentProfile = RT_PROFILE; _scheduledTimerId = null; _immediateTimerId = null; _currentBackoffCount = 0; _timerCount = 0; _xhrOverride = null; _batchQueues = {}; _autoFlushEventsLimit = undefined; _autoFlushBatchLimit = 0; _delayedBatchSendLatency = -1; _delayedBatchReason = null; _optimizeObject = true; _isPageUnloadTriggered = false; _disableXhrSync = false; _maxEventSendAttempts = MaxSendAttempts; _maxUnloadEventSendAttempts = MaxSyncUnloadSendAttempts; _evtNamespace = null; _timeoutWrapper = createTimeoutWrapper(); _httpManager = new HttpManager(MaxNumberEventPerBatch, MaxConnections, MaxRequestRetriesBeforeBackoff, { requeue: _requeueEvents, send: _sendingEvent, sent: _eventsSentEvent, drop: _eventsDropped, rspFail: _eventsResponseFail, oth: _otherEvent }, _timeoutWrapper); _initializeProfiles(); _clearQueues(); _setAutoLimits(); } function _createTimer(theTimerFunc, timeOut) { if (timeOut === 0 && _currentBackoffCount) { timeOut = 1; } var timerMultiplier = 1000; if (_currentBackoffCount) { timerMultiplier = retryPolicyGetMillisToBackoffForRetry(_currentBackoffCount - 1); } return _timeoutWrapper.set(theTimerFunc, timeOut * timerMultiplier); } function _clearScheduledTimer() { if (_scheduledTimerId !== null) { _timeoutWrapper.clear(_scheduledTimerId); _scheduledTimerId = null; _timerCount = 0; } } function _releaseAllQueues(sendType, sendReason) { _clearScheduledTimer(); if (_flushCallbackTimerId) { _timeoutWrapper.clear(_flushCallbackTimerId); _flushCallbackTimerId = null; } if (!_paused) { _sendEventsForLatencyAndAbove(1 , sendType, sendReason); } } function _clearQueues() { _batchQueues[4 ] = { batches: [], iKeyMap: {} }; _batchQueues[3 ] = { batches: [], iKeyMap: {} }; _batchQueues[2 ] = { batches: [], iKeyMap: {} }; _batchQueues[1 ] = { batches: [], iKeyMap: {} }; } function _getEventBatch(iKey, latency, create) { var batchQueue = _batchQueues[latency]; if (!batchQueue) { latency = 1 ; batchQueue = _batchQueues[latency]; } var eventBatch = batchQueue.iKeyMap[iKey]; if (!eventBatch && create) { eventBatch = EventBatch.create(iKey); batchQueue.batches.push(eventBatch); batchQueue.iKeyMap[iKey] = eventBatch; } return eventBatch; } function _performAutoFlush(isAsync, doFlush) { if (_httpManager.canSendRequest() && !_currentBackoffCount) { if (_autoFlushEventsLimit > 0 && _queueSize > _autoFlushEventsLimit) { doFlush = true; } if (doFlush && _flushCallbackTimerId == null) { _self.flush(isAsync, null, 20 ); } } } function _addEventToProperQueue(event, append) { if (_optimizeObject) { event = _1dsCoreJs.optimizeObject(event); } var latency = event.latency; var eventBatch = _getEventBatch(event.iKey, latency, true); if (eventBatch.addEvent(event)) { if (latency !== 4 ) { _queueSize++; if (append && event.sendAttempt === 0) { _performAutoFlush(!event.sync, _autoFlushBatchLimit > 0 && eventBatch.count() >= _autoFlushBatchLimit); } } else { _immediateQueueSize++; } return true; } return false; } function _dropEventWithLatencyOrLess(iKey, latency, currentLatency, dropNumber) { while (currentLatency <= latency) { var eventBatch = _getEventBatch(iKey, latency, true); if (eventBatch && eventBatch.count() > 0) { var droppedEvents = eventBatch.split(0, dropNumber); var droppedCount = droppedEvents.count(); if (droppedCount > 0) { if (currentLatency === 4 ) { _immediateQueueSize -= droppedCount; } else { _queueSize -= droppedCount; } _notifyBatchEvents(strEventsDiscarded, [droppedEvents], _1dsCoreJs.EventsDiscardedReason.QueueFull); return true; } } currentLatency++; } _resetQueueCounts(); return false; } function _resetQueueCounts() { var immediateQueue = 0; var normalQueue = 0; var _loop_1 = function (latency) { var batchQueue = _batchQueues[latency]; if (batchQueue && batchQueue.batches) { _1dsCoreJs.arrForEach(batchQueue.batches, function (theBatch) { if (latency === 4 ) { immediateQueue += theBatch.count(); } else { normalQueue += theBatch.count(); } }); } }; for (var latency = 1 ; latency <= 4 ; latency++) { _loop_1(latency); } _queueSize = normalQueue; _immediateQueueSize = immediateQueue; } function _queueBatches(latency, sendType, sendReason) { var eventsQueued = false; var isAsync = sendType === 0 ; if (!isAsync || _httpManager.canSendRequest()) { _1dsCoreJs.doPerf(_self.core, function () { return "PostChannel._queueBatches"; }, function () { var droppedEvents = []; var latencyToProcess = 4 ; while (latencyToProcess >= latency) { var batchQueue = _batchQueues[latencyToProcess]; if (batchQueue && batchQueue.batches && batchQueue.batches.length > 0) { _1dsCoreJs.arrForEach(batchQueue.batches, function (theBatch) { if (!_httpManager.addBatch(theBatch)) { droppedEvents = droppedEvents.concat(theBatch.events()); } else { eventsQueued = eventsQueued || (theBatch && theBatch.count() > 0); } if (latencyToProcess === 4 ) { _immediateQueueSize -= theBatch.count(); } else { _queueSize -= theBatch.count(); } }); batchQueue.batches = []; batchQueue.iKeyMap = {}; } latencyToProcess--; } if (droppedEvents.length > 0) { _notifyEvents(strEventsDiscarded, droppedEvents, _1dsCoreJs.EventsDiscardedReason.KillSwitch); } if (eventsQueued && _delayedBatchSendLatency >= latency) { _delayedBatchSendLatency = -1; _delayedBatchReason = 0 ; } }, function () { return ({ latency: latency, sendType: sendType, sendReason: sendReason }); }, !isAsync); } else { _delayedBatchSendLatency = _delayedBatchSendLatency >= 0 ? Math.min(_delayedBatchSendLatency, latency) : latency; _delayedBatchReason = Math.max(_delayedBatchReason, sendReason); } return eventsQueued; } function _flushImpl(callback, sendReason) { _sendEventsForLatencyAndAbove(1 , 0 , sendReason); _waitForIdleManager(function () { if (callback) { callback(); } if (_flushCallbackQueue.length > 0) { _flushCallbackTimerId = _createTimer(function () { return _flushImpl(_flushCallbackQueue.shift(), sendReason); }, 0); } else { _flushCallbackTimerId = null; if (_hasEvents()) { _scheduleTimer(); } } }); } function _waitForIdleManager(callback) { if (_httpManager.isCompletelyIdle()) { callback(); } else { _flushCallbackTimerId = _createTimer(function () { _waitForIdleManager(callback); }, FlushCheckTimer); } } function _resetTransmitProfiles() { _clearScheduledTimer(); _initializeProfiles(); _currentProfile = RT_PROFILE; _scheduleTimer(); } function _initializeProfiles() { _profiles = {}; _profiles[RT_PROFILE] = [2, 1, 0]; _profiles[NRT_PROFILE] = [6, 3, 0]; _profiles[BE_PROFILE] = [18, 9, 0]; } function _requeueEvents(batches, reason) { var droppedEvents = []; var maxSendAttempts = _maxEventSendAttempts; if (_isPageUnloadTriggered) { maxSendAttempts = _maxUnloadEventSendAttempts; } _1dsCoreJs.arrForEach(batches, function (theBatch) { if (theBatch && theBatch.count() > 0) { _1dsCoreJs.arrForEach(theBatch.events(), function (theEvent) { if (theEvent) { if (theEvent.sync) { theEvent.latency = 4 ; theEvent.sync = false; } if (theEvent.sendAttempt < maxSendAttempts) { _1dsCoreJs.setProcessTelemetryTimings(theEvent, _self.identifier); _addEventToQueues(theEvent, false); } else { droppedEvents.push(theEvent); } } }); } }); if (droppedEvents.length > 0) { _notifyEvents(strEventsDiscarded, droppedEvents, _1dsCoreJs.EventsDiscardedReason.NonRetryableStatus); } if (_isPageUnloadTriggered) { _releaseAllQueues(2 , 2 ); } } function _callNotification(evtName, theArgs) { var manager = (_self._notificationManager || {}); var notifyFunc = manager[evtName]; if (notifyFunc) { try { notifyFunc.apply(manager, theArgs); } catch (e) { _1dsCoreJs._throwInternal(_self.diagLog(), 1 , 74 , evtName + " notification failed: " + e); } } } function _notifyEvents(evtName, theEvents) { var extraArgs = []; for (var _i = 2; _i < arguments.length; _i++) { extraArgs[_i - 2] = arguments[_i]; } if (theEvents && theEvents.length > 0) { _callNotification(evtName, [theEvents].concat(extraArgs)); } } function _notifyBatchEvents(evtName, batches) { var extraArgs = []; for (var _i = 2; _i < arguments.length; _i++) { extraArgs[_i - 2] = arguments[_i]; } if (batches && batches.length > 0) { _1dsCoreJs.arrForEach(batches, function (theBatch) { if (theBatch && theBatch.count() > 0) { _callNotification(evtName, [theBatch.events()].concat(extraArgs)); } }); } } function _sendingEvent(batches, reason, isSyncRequest) { if (batches && batches.length > 0) { _callNotification("eventsSendRequest", [(reason >= 1000 && reason <= 1999 ? reason - 1000 : 0 ), isSyncRequest !== true]); } } function _eventsSentEvent(batches, reason) { _notifyBatchEvents("eventsSent", batches, reason); _scheduleTimer(); } function _eventsDropped(batches, reason) { _notifyBatchEvents(strEventsDiscarded, batches, (reason >= 8000 && reason <= 8999 ? reason - 8000 : _1dsCoreJs.EventsDiscardedReason.Unknown)); } function _eventsResponseFail(batches) { _notifyBatchEvents(strEventsDiscarded, batches, _1dsCoreJs.EventsDiscardedReason.NonRetryableStatus); _scheduleTimer(); } function _otherEvent(batches, reason) { _notifyBatchEvents(strEventsDiscarded, batches, _1dsCoreJs.EventsDiscardedReason.Unknown); _scheduleTimer(); } function _setAutoLimits() { if (!_config || !_config.disableAutoBatchFlushLimit) { _autoFlushBatchLimit = Math.max(MaxNumberEventPerBatch * (MaxConnections + 1), _queueSizeLimit / 6); } else { _autoFlushBatchLimit = 0; } } _1dsCoreJs.objDefineAccessors(_self, "_setTimeoutOverride", function () { return _timeoutWrapper.set; }, function (value) { _timeoutWrapper = createTimeoutWrapper(value, _timeoutWrapper.clear); }); _1dsCoreJs.objDefineAccessors(_self, "_clearTimeoutOverride", function () { return _timeoutWrapper.clear; }, function (value) { _timeoutWrapper = createTimeoutWrapper(_timeoutWrapper.set, value); }); }); return _this; } return PostChannel; }(_1dsCoreJs.BaseTelemetryPlugin)); exports.BE_PROFILE = BE_PROFILE; exports.NRT_PROFILE = NRT_PROFILE; exports.PostChannel = PostChannel; exports.RT_PROFILE = RT_PROFILE; (function(obj, prop, descriptor) { /* ai_es3_polyfil defineProperty */ var func = Object["defineProperty"]; if (func) { try { return func(obj, prop, descriptor); } catch(e) { /* IE8 defines defineProperty, but will throw */ } } if (descriptor && typeof descriptor.value !== undefined) { obj[prop] = descriptor.value; } return obj; })(exports, '__esModule', { value: true }); }));//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/1ds-post-js/dist/ms.post.js.map /*! * 1DS JS SDK POST plugin, 3.2.2 * Copyright (c) Microsoft and contributors. All rights reserved. * (Microsoft Internal Only) */ var e=this,n=function(e,n,t,ne){"use strict";function p(e){return e&&"object"==typeof e&&"default"in e?e["default"]:e}var o=p(t),te="REAL_TIME",Q="POST",V="drop",t="requeue",W="application/x-json-stream",J="cache-control",G="content-type",Y="kill-duration",he="time-delta-millis",Z="client-version",ve="client-id",$="time-delta-to-apply-millis",ee="upload-time",ie="apikey",re="AuthMsaDeviceTicket",i="AuthXToken",ae="msfpc";function y(e){e=(e.ext||{}).intweb;return e&&ne.isValueAssigned(e[ae])?e[ae]:null}function g(e){for(var n=null,t=0;null===n&&tne.dateNow()||(delete n[e],!1)}})},me=function h(){var n=!0,t=!0,i=!0,r="use-collector-delta",a=!1;o(h,this,function(e){e.allowRequestSending=function(){return n},e.firstRequestSent=function(){i&&(i=!1,a||(n=!1))},e.shouldAddClockSkewHeaders=function(){return t},e.getClockSkewHeaderValue=function(){return r},e.setClockSkew=function(e){a||(e?(r=e,a=t=!0):t=!1,n=!0)}})},se="sendAttempt",be="&NoResponseBody=true",Te=((l={})[1]=t,l[100]=t,l[200]="sent",l[8004]=V,l[8003]=V,l),r={},ue={};function a(e,n,t){r[e]=n,!1!==t&&(ue[n]=e)}function Ee(e){try{return e.responseText}catch(n){}return""}function Se(e,n){var t=!1;if(e&&n){var i=ne.objKeys(e);if(i&&0=k)):N++,1)}function y(){for(var t=0,i=0,e=1;e<=4;e++)!function(n){var e=J[n];e&&e.batches&&ne.arrForEach(e.batches,function(e){4===n?t+=e.count():i+=e.count()})}(e);I=i,N=t}function g(i,e,n){var r=!1,t=0===e;return!t||K.canSendRequest()?ne.doPerf(c.core,function(){return"PostChannel._queueBatches"},function(){for(var n=[],t=4;i<=t;){var e=J[t];e&&e.batches&&0=k&&(t=!0)})}v(!0,t)},c.pause=function(){i(),j=!0,K.pause()},c.resume=function(){j=!1,K.resume(),o()},c.addResponseHandler=function(e){K._responseHandlers.push(e)},c._loadTransmitProfiles=function(e){i(),n(),D=te,o(),ne.objForEachKey(e,function(e,n){var t,i=n.length;2<=i&&(t=2n[1]&&(t=n[1]),n.push(t),z[e]=n)})},c.flush=function(e,n,t){void 0===e&&(e=!0),j||(i(),t=t||1,e?(g(1,0,t),y(),null==H?H=s(function(){!function i(e,n){a(1,0,n),function t(e){K.isCompletelyIdle()?e():H=s(function(){t(e)},.25)}(function(){e&&e(),0 0) { var lowerHeader = header.toLowerCase(); for (var lp = 0; lp < keys.length; lp++) { var value = keys[lp]; if (value && hasOwnProperty(header, value) && value.toLowerCase() === lowerHeader) { hasHeader = true; break; } } } } return hasHeader; } function _addRequestDetails(details, name, value, useHeaders) { if (name && value && value.length > 0) { if (useHeaders && _collectorQsHeaders[name]) { details.hdrs[_collectorQsHeaders[name]] = value; details.useHdrs = true; } else { details.url += "&" + name + "=" + value; } } } /** * Class managing the sending of requests. */ var HttpManager = /** @class */ (function () { /** * @constructor * @param requestQueue - The queue that contains the requests to be sent. */ function HttpManager(maxEventsPerBatch, maxConnections, maxRequestRetriesBeforeBackoff, actions, timeoutOverride) { this._responseHandlers = []; var _urlString = "?cors=true&" + strContentTypeHeader.toLowerCase() + "=" + defaultContentType; var _killSwitch = new EVTKillSwitch(); var _paused = false; var _clockSkewManager = new EVTClockSkewManager(); var _useBeacons = false; var _outstandingRequests = 0; // Holds the number of outstanding async requests that have not returned a response yet var _postManager; var _sendInterfaces; var _core; var _customHttpInterface = true; var _queryStringParameters = []; var _headers = {}; var _batchQueue = []; var _serializer = null; var _enableEventTimings = false; var _cookieMgr; var _isUnloading = false; var _useHeaders = false; var _xhrTimeout; var _disableXhrSync; dynamicProto(HttpManager, this, function (_self) { var _sendCredentials = true; _self.initialize = function (endpointUrl, core, postChannel, httpInterface, channelConfig) { var _a; if (!channelConfig) { channelConfig = {}; } _urlString = endpointUrl + _urlString; _useHeaders = !isUndefined(channelConfig.avoidOptions) ? !channelConfig.avoidOptions : true; _core = core; _cookieMgr = core.getCookieMgr(); _enableEventTimings = !_core.config.disableEventTimings; var enableCompoundKey = !!_core.config.enableCompoundKey; _postManager = postChannel; var valueSanitizer = channelConfig.valueSanitizer; var stringifyObjects = channelConfig.stringifyObjects; if (!isUndefined(channelConfig.enableCompoundKey)) { enableCompoundKey = !!channelConfig.enableCompoundKey; } _xhrTimeout = channelConfig.xhrTimeout; _disableXhrSync = channelConfig.disableXhrSync; _useBeacons = !isReactNative(); // Only use beacons if not running in React Native _serializer = new Serializer(_core, valueSanitizer, stringifyObjects, enableCompoundKey); var syncHttpInterface = httpInterface; var beaconHttpInterface = channelConfig.alwaysUseXhrOverride ? httpInterface : null; var fetchSyncHttpInterface = channelConfig.alwaysUseXhrOverride ? httpInterface : null; if (!httpInterface) { _customHttpInterface = false; var location_1 = getLocation(); if (location_1 && location_1.protocol && location_1.protocol.toLowerCase() === "file:") { // Special case where a local html file fails with a CORS error on Chromium browsers _sendCredentials = false; } var theTransports = []; if (isReactNative()) { // Use Fetch or XDR/XHR theTransports = [2 /* Fetch */, 1 /* Xhr */]; } else { // Use XDR/XHR, Fetch or beacons theTransports = [1 /* Xhr */, 2 /* Fetch */, 3 /* Beacon */]; } // Prefix any user requested transport(s) values var configTransports = channelConfig.transports; if (configTransports) { if (isNumber(configTransports)) { theTransports = [configTransports].concat(theTransports); } else if (isArray(configTransports)) { theTransports = configTransports.concat(theTransports); } } httpInterface = _getSenderInterface(theTransports, false); syncHttpInterface = _getSenderInterface(theTransports, true); if (!httpInterface) { _postManager.diagLog().warnToConsole("No available transport to send events"); } } _sendInterfaces = (_a = {}, _a[0 /* Batched */] = httpInterface, _a[1 /* Synchronous */] = syncHttpInterface || _getSenderInterface([1 /* Xhr */, 2 /* Fetch */, 3 /* Beacon */], true), _a[2 /* SendBeacon */] = beaconHttpInterface || _getSenderInterface([3 /* Beacon */, 2 /* Fetch */], true) || syncHttpInterface || _getSenderInterface([1 /* Xhr */], true), _a[3 /* SyncFetch */] = fetchSyncHttpInterface || _getSenderInterface([2 /* Fetch */, 3 /* Beacon */], true) || syncHttpInterface || _getSenderInterface([1 /* Xhr */], true), _a); }; // Special internal method to allow the DebugPlugin to hook embedded objects function _getSenderInterface(transports, syncSupport) { var transportType = 0 /* NotSet */; var sendPostFunc = null; var lp = 0; while (sendPostFunc == null && lp < transports.length) { transportType = transports[lp]; if (transportType === 1 /* Xhr */) { if (useXDomainRequest()) { sendPostFunc = _xdrSendPost; } else if (isXhrSupported()) { sendPostFunc = _xhrSendPost; } } else if (transportType === 2 /* Fetch */ && isFetchSupported(syncSupport)) { sendPostFunc = _fetchSendPost; } else if (_useBeacons && transportType === 3 /* Beacon */ && isBeaconsSupported()) { sendPostFunc = _beaconSendPost; } lp++; } if (sendPostFunc) { return { _transport: transportType, _isSync: syncSupport, sendPOST: sendPostFunc }; } return null; } _self["_getDbgPlgTargets"] = function () { return [_sendInterfaces[0 /* Batched */], _killSwitch, _serializer, _sendInterfaces]; }; function _xdrSendPost(payload, oncomplete, sync) { // It doesn't support custom headers, so no action is taken with current requestHeaders var xdr = new XDomainRequest(); xdr.open(Method, payload.urlString); if (payload.timeout) { xdr.timeout = payload.timeout; } // can't get the status code in xdr. xdr.onload = function () { // we will assume onload means the request succeeded. var response = _getResponseText(xdr); _doOnComplete(oncomplete, 200, {}, response); _handleCollectorResponse(response); }; // we will assume onerror means we need to drop the events. xdr.onerror = function () { _doOnComplete(oncomplete, 400, {}); }; // we will assume ontimeout means we need to retry the events. xdr.ontimeout = function () { _doOnComplete(oncomplete, 500, {}); }; // https://cypressnorth.com/web-programming-and-development/internet-explorer-aborting-ajax-requests-fixed/ // tslint:disable-next-line:no-empty xdr.onprogress = function () { }; if (sync) { xdr.send(payload.data); } else { timeoutOverride.set(function () { xdr.send(payload.data); }, 0); } } function _fetchSendPost(payload, oncomplete, sync) { var _a; var theUrl = payload.urlString; var ignoreResponse = false; var responseHandled = false; var requestInit = (_a = { body: payload.data, method: Method }, _a[DisabledPropertyName] = true, _a); if (sync) { requestInit.keepalive = true; if (payload._sendReason === 2 /* Unload */) { // As a sync request (during unload), it is unlikely that we will get a chance to process the response so // just like beacon send assume that the events have been accepted and processed ignoreResponse = true; theUrl += _noResponseQs; } } if (_sendCredentials) { // Don't send credentials when URL is file:// requestInit.credentials = "include"; } // Only add headers if there are headers to add, due to issue with some polyfills if (payload.headers && objKeys(payload.headers).length > 0) { requestInit.headers = payload.headers; } fetch(theUrl, requestInit).then(function (response) { var headerMap = {}; var responseText = ""; if (response.headers) { response.headers.forEach(function (value, name) { headerMap[name] = value; }); } if (response.body) { response.text().then(function (text) { responseText = text; }); } if (!responseHandled) { responseHandled = true; _doOnComplete(oncomplete, response.status, headerMap, responseText); _handleCollectorResponse(responseText); } })["catch"](function (error) { // In case there is an error in the request. Set the status to 0 // so that the events can be retried later. if (!responseHandled) { responseHandled = true; _doOnComplete(oncomplete, 0, {}); } }); if (ignoreResponse && !responseHandled) { // Assume success during unload processing responseHandled = true; _doOnComplete(oncomplete, 200, {}); } if (!responseHandled && payload.timeout > 0) { // Simulate timeout timeoutOverride.set(function () { if (!responseHandled) { // Assume a 500 response (which will cause a retry) responseHandled = true; _doOnComplete(oncomplete, 500, {}); } }, payload.timeout); } } function _xhrSendPost(payload, oncomplete, sync) { var theUrl = payload.urlString; function _appendHeader(theHeaders, xhr, name) { if (!theHeaders[name] && xhr && xhr.getResponseHeader) { var value = xhr.getResponseHeader(name); if (value) { theHeaders[name] = strTrim(value); } } return theHeaders; } function _getAllResponseHeaders(xhr) { var theHeaders = {}; if (!xhr.getAllResponseHeaders) { // Firefox 2-63 doesn't have getAllResponseHeaders function but it does have getResponseHeader // Only call these if getAllResponseHeaders doesn't exist, otherwise we can get invalid response errors // as collector is not currently returning the correct header to allow JS to access these headers theHeaders = _appendHeader(theHeaders, xhr, strTimeDeltaHeader); theHeaders = _appendHeader(theHeaders, xhr, strKillDurationHeader); theHeaders = _appendHeader(theHeaders, xhr, strKillDurationSecondsHeader); } else { theHeaders = _convertAllHeadersToMap(xhr.getAllResponseHeaders()); } return theHeaders; } function xhrComplete(xhr, responseTxt) { _doOnComplete(oncomplete, xhr.status, _getAllResponseHeaders(xhr), responseTxt); } if (sync && payload.disableXhrSync) { sync = false; } var xhrRequest = openXhr(Method, theUrl, _sendCredentials, true, sync, payload.timeout); // Set custom headers (e.g. gzip) here (after open()) objForEachKey(payload.headers, function (name, value) { xhrRequest.setRequestHeader(name, value); }); xhrRequest.onload = function () { var response = _getResponseText(xhrRequest); xhrComplete(xhrRequest, response); _handleCollectorResponse(response); }; xhrRequest.onerror = function () { xhrComplete(xhrRequest); }; xhrRequest.ontimeout = function () { xhrComplete(xhrRequest); }; xhrRequest.send(payload.data); } function _doOnComplete(oncomplete, status, headers, response) { try { oncomplete(status, headers, response); } catch (e) { _throwInternal(_postManager.diagLog(), 2 /* WARNING */, 518 /* SendPostOnCompleteFailure */, dumpObj(e)); } } function _beaconSendPost(payload, oncomplete, sync) { // Custom headers not supported in sendBeacon payload.headers would be ignored var internalPayloadData = payload; var status = 200; var thePayload = internalPayloadData._thePayload; var theUrl = payload.urlString + _noResponseQs; try { var nav_1 = getNavigator(); if (!nav_1.sendBeacon(theUrl, payload.data)) { if (thePayload) { // Failed to send entire payload so try and split data and try to send as much events as possible var droppedBatches_1 = []; arrForEach(thePayload.batches, function (theBatch) { if (droppedBatches_1 && theBatch && theBatch.count() > 0) { var theEvents = theBatch.events(); for (var lp = 0; lp < theEvents.length; lp++) { if (!nav_1.sendBeacon(theUrl, _serializer.getEventBlob(theEvents[lp]))) { // Can't send anymore, so split the batch and drop the rest droppedBatches_1.push(theBatch.split(lp)); break; } } } else { // Remove all of the events from the existing batch in the payload as the copy includes the original droppedBatches_1.push(theBatch.split(0)); } }); _sendBatchesNotification(droppedBatches_1, 8003 /* SizeLimitExceeded */, thePayload.sendType, true); } else { status = 0; } } } catch (ex) { _postManager.diagLog().warnToConsole("Failed to send telemetry using sendBeacon API. Ex:" + dumpObj(ex)); status = 0; } finally { _doOnComplete(oncomplete, status, {}, ""); } } function _isBeaconPayload(sendType) { // Sync Fetch has the same payload limitation as sendBeacon -- 64kb limit, so treat both as a beacon send return sendType === 2 /* SendBeacon */ || sendType === 3 /* SyncFetch */; } function _adjustSendType(sendType) { if (_isUnloading && _isBeaconPayload(sendType)) { sendType = 2 /* SendBeacon */; } return sendType; } _self.addQueryStringParameter = function (name, value) { for (var i = 0; i < _queryStringParameters.length; i++) { if (_queryStringParameters[i].name === name) { _queryStringParameters[i].value = value; return; } } _queryStringParameters.push({ name: name, value: value }); }; _self.addHeader = function (name, value) { _headers[name] = value; }; _self.canSendRequest = function () { return _hasIdleConnection() && _clockSkewManager.allowRequestSending(); }; _self.sendQueuedRequests = function (sendType, sendReason) { if (isUndefined(sendType)) { sendType = 0 /* Batched */; } if (_isUnloading) { sendType = _adjustSendType(sendType); sendReason = 2 /* Unload */; } if (_canSendPayload(_batchQueue, sendType, 0)) { _sendBatches(_clearQueue(), 0, false, sendType, sendReason || 0 /* Undefined */); } }; _self.isCompletelyIdle = function () { return !_paused && _outstandingRequests === 0 && _batchQueue.length === 0; }; _self.setUnloading = function (value) { _isUnloading = value; }; _self.addBatch = function (theBatch) { if (theBatch && theBatch.count() > 0) { // Try and kill the event faster if (_killSwitch.isTenantKilled(theBatch.iKey())) { return false; } _batchQueue.push(theBatch); } return true; }; /** * Queue all the remaining requests to be sent. The requests will be * sent using HTML5 Beacons if they are available. */ _self.teardown = function () { if (_batchQueue.length > 0) { _sendBatches(_clearQueue(), 0, true, 2 /* SendBeacon */, 2 /* Unload */); } }; /** * Pause the sending of requests. No new requests will be sent. */ _self.pause = function () { _paused = true; }; /** * Resume the sending of requests. */ _self.resume = function () { _paused = false; _self.sendQueuedRequests(0 /* Batched */, 4 /* Resumed */); }; /** * Sends a request synchronously to the Aria collector. This api is used to send * a request containing a single immediate event. * * @param batch - The request to be sent. * @param sendReason - The token used to send the request. */ _self.sendSynchronousBatch = function (batch, sendType, sendReason) { // This will not take into account the max connections restriction. Since this is sync, we can // only send one of this request at a time and thus should not worry about multiple connections // being used to send synchronous events. // Increment active connection since we are still going to use a connection to send the request. if (batch && batch.count() > 0) { if (isNullOrUndefined(sendType)) { sendType = 1 /* Synchronous */; } if (_isUnloading) { sendType = _adjustSendType(sendType); sendReason = 2 /* Unload */; } // For sync requests we will not wait for the clock skew. _sendBatches([batch], 0, false, sendType, sendReason || 0 /* Undefined */); } }; function _hasIdleConnection() { return !_paused && _outstandingRequests < maxConnections; } function _clearQueue() { var theQueue = _batchQueue; _batchQueue = []; return theQueue; } function _canSendPayload(theBatches, sendType, retryCnt) { var result = false; if (theBatches && theBatches.length > 0 && !_paused && _sendInterfaces[sendType] && _serializer) { // Always attempt to send synchronous events don't wait for idle or clockSkew // and don't block retry requests if clockSkew is not yet set result = (sendType !== 0 /* Batched */) || (_hasIdleConnection() && (retryCnt > 0 || _clockSkewManager.allowRequestSending())); } return result; } function _createDebugBatches(theBatches) { var values = {}; if (theBatches) { arrForEach(theBatches, function (theBatch, idx) { values[idx] = { iKey: theBatch.iKey(), evts: theBatch.events() }; }); } return values; } function _sendBatches(theBatches, retryCount, isTeardown, sendType, sendReason) { if (!theBatches || theBatches.length === 0) { // Nothing to do return; } if (_paused) { _sendBatchesNotification(theBatches, 1 /* Paused */, sendType); return; } // Make sure that if we are unloading the sendType is a supported version sendType = _adjustSendType(sendType); try { var orgBatches_1 = theBatches; var isSynchronous_1 = sendType !== 0 /* Batched */; doPerf(_core, function () { return "HttpManager:_sendBatches"; }, function (perfEvt) { if (perfEvt) { // Perf Monitoring is enabled, so create a "Quick" copy of the original batches so we still report // the original values as part of the perfEvent. This is because theBatches uses .shift() to remove each // batch as they are processed - removing from the original array, so by the time the _createDebugBatches() // function is called the passed in value has changed and therefore the reported value for the perfEvent is incorrect theBatches = theBatches.slice(0); } var droppedBatches = []; var thePayload = null; var serializationStart = getTime(); var sendInterface = _sendInterfaces[sendType] || (isSynchronous_1 ? _sendInterfaces[1 /* Synchronous */] : _sendInterfaces[0 /* Batched */]); // Sync Fetch has the same payload limitation as sendBeacon -- 64kb limit var isBeaconTransport = (_isUnloading || _isBeaconPayload(sendType) || (sendInterface && sendInterface._transport === 3 /* Beacon */)) && _canUseSendBeaconApi(); while (_canSendPayload(theBatches, sendType, retryCount)) { var theBatch = theBatches.shift(); if (theBatch && theBatch.count() > 0) { if (!_killSwitch.isTenantKilled(theBatch.iKey())) { // Make sure we have a payload object thePayload = thePayload || _serializer.createPayload(retryCount, isTeardown, isSynchronous_1, isBeaconTransport, sendReason, sendType); // Add the batch to the current payload if (!_serializer.appendPayload(thePayload, theBatch, maxEventsPerBatch)) { // Entire batch was not added so send the payload and retry adding this batch _doPayloadSend(thePayload, serializationStart, getTime(), sendReason); serializationStart = getTime(); theBatches = [theBatch].concat(theBatches); thePayload = null; } else if (thePayload.overflow !== null) { // Total Payload size was exceeded so send the payload and add the unsent as the next batch to send theBatches = [thePayload.overflow].concat(theBatches); thePayload.overflow = null; _doPayloadSend(thePayload, serializationStart, getTime(), sendReason); serializationStart = getTime(); thePayload = null; } } else { droppedBatches.push(theBatch); } } } // Make sure to flush any remaining payload if (thePayload) { _doPayloadSend(thePayload, serializationStart, getTime(), sendReason); } if (theBatches.length > 0) { // Add any unsent batches back to the head of the queue _batchQueue = theBatches.concat(_batchQueue); } // Now send notification about any dropped events _sendBatchesNotification(droppedBatches, 8004 /* KillSwitch */, sendType); }, function () { return ({ batches: _createDebugBatches(orgBatches_1), retryCount: retryCount, isTeardown: isTeardown, isSynchronous: isSynchronous_1, sendReason: sendReason, useSendBeacon: _isBeaconPayload(sendType), sendType: sendType }); }, !isSynchronous_1); } catch (ex) { _throwInternal(_postManager.diagLog(), 2 /* WARNING */, 48 /* CannotSerializeObject */, "Unexpected Exception sending batch: " + dumpObj(ex)); } } function _buildRequestDetails(thePayload, useHeaders) { var requestDetails = { url: _urlString, hdrs: {}, useHdrs: false // Assume no headers }; if (!useHeaders) { // Attempt to map headers to a query string if possible objForEachKey(_headers, function (name, value) { if (_collectorHeaderToQs[name]) { _addRequestDetails(requestDetails, _collectorHeaderToQs[name], value, false); } else { // No mapping, so just include in the headers anyway (may not get sent if using sendBeacon()) requestDetails.hdrs[name] = value; requestDetails.useHdrs = true; } }); } else { // Copy the pre-defined headers into the payload headers requestDetails.hdrs = extend(requestDetails.hdrs, _headers); requestDetails.useHdrs = (objKeys(requestDetails.hdrs).length > 0); } _addRequestDetails(requestDetails, strClientId, "NO_AUTH", useHeaders); _addRequestDetails(requestDetails, strClientVersion, FullVersionString, useHeaders); var apiQsKeys = ""; arrForEach(thePayload.apiKeys, function (apiKey) { if (apiQsKeys.length > 0) { apiQsKeys += ","; } apiQsKeys += apiKey; }); _addRequestDetails(requestDetails, strApiKey, apiQsKeys, useHeaders); _addRequestDetails(requestDetails, strUploadTime, dateNow().toString(), useHeaders); var msfpc = _getMsfpc(thePayload); if (isValueAssigned(msfpc)) { requestDetails.url += "&ext.intweb.msfpc=" + msfpc; } if (_clockSkewManager.shouldAddClockSkewHeaders()) { _addRequestDetails(requestDetails, strTimeDeltaToApply, _clockSkewManager.getClockSkewHeaderValue(), useHeaders); } if (_core.getWParam) { var wParam = _core.getWParam(); if (wParam >= 0) { requestDetails.url += "&w=" + wParam; } } for (var i = 0; i < _queryStringParameters.length; i++) { requestDetails.url += "&" + _queryStringParameters[i].name + "=" + _queryStringParameters[i].value; } return requestDetails; } function _canUseSendBeaconApi() { return !_customHttpInterface && _useBeacons && isBeaconsSupported(); } function _setTimingValue(timings, name, value) { timings[name] = timings[name] || {}; timings[name][_postManager.identifier] = value; } function _doPayloadSend(thePayload, serializationStart, serializationCompleted, sendReason) { if (thePayload && thePayload.payloadBlob && thePayload.payloadBlob.length > 0) { var useSendHook_1 = !!_self.sendHook; var sendInterface_1 = _sendInterfaces[thePayload.sendType]; // Send all data using a beacon style transport if closing mode is on or channel was teared down if (!_isBeaconPayload(thePayload.sendType) && thePayload.isBeacon && thePayload.sendReason === 2 /* Unload */) { sendInterface_1 = _sendInterfaces[2 /* SendBeacon */] || _sendInterfaces[3 /* SyncFetch */] || sendInterface_1; } var useHeaders_1 = _useHeaders; // Disable header usage if we know we are using sendBeacon as additional headers are not supported if (thePayload.isBeacon || sendInterface_1._transport === 3 /* Beacon */) { useHeaders_1 = false; } var requestDetails_1 = _buildRequestDetails(thePayload, useHeaders_1); useHeaders_1 = useHeaders_1 || requestDetails_1.useHdrs; var sendEventStart_1 = getTime(); doPerf(_core, function () { return "HttpManager:_doPayloadSend"; }, function () { // Increment the send attempt count and add timings after packaging (So it's not serialized in the 1st attempt) for (var batchLp = 0; batchLp < thePayload.batches.length; batchLp++) { var theBatch = thePayload.batches[batchLp]; var theEvents = theBatch.events(); for (var evtLp = 0; evtLp < theEvents.length; evtLp++) { var telemetryItem = theEvents[evtLp]; if (_enableEventTimings) { var timings = telemetryItem.timings = telemetryItem.timings || {}; _setTimingValue(timings, "sendEventStart", sendEventStart_1); _setTimingValue(timings, "serializationStart", serializationStart); _setTimingValue(timings, "serializationCompleted", serializationCompleted); } telemetryItem[strSendAttempt] > 0 ? telemetryItem[strSendAttempt]++ : telemetryItem[strSendAttempt] = 1; } } // Note: always sending this notification in a synchronous manner. _sendBatchesNotification(thePayload.batches, (1000 /* SendingUndefined */ + (sendReason || 0 /* Undefined */)), thePayload.sendType, true); // Disabling the use of const because of Issue: // - Task 9227844: [1DS] Some environments and packagers automatically "freeze" objects which are defined as const which causes any mutations to throw // eslint-disable-next-line prefer-const var orgPayloadData = { data: thePayload.payloadBlob, urlString: requestDetails_1.url, headers: requestDetails_1.hdrs, _thePayload: thePayload, _sendReason: sendReason, timeout: _xhrTimeout }; if (!isUndefined(_disableXhrSync)) { orgPayloadData.disableXhrSync = !!_disableXhrSync; } // Only automatically add the following headers if already sending headers and we are not attempting to avoid an options call if (useHeaders_1) { if (!_hasHeader(orgPayloadData.headers, strCacheControl)) { orgPayloadData.headers[strCacheControl] = defaultCacheControl; } if (!_hasHeader(orgPayloadData.headers, strContentTypeHeader)) { orgPayloadData.headers[strContentTypeHeader] = defaultContentType; } } var sender = null; if (sendInterface_1) { // Send sync requests if the request is immediate or we are tearing down telemetry. sender = function (payload) { // Notify the clock skew manager that we are sending the first request (Potentially blocking all further requests) _clockSkewManager.firstRequestSent(); var onComplete = function (status, headers) { _retryRequestIfNeeded(status, headers, thePayload, sendReason); }; var isSync = thePayload.isTeardown || thePayload.isSync; try { sendInterface_1.sendPOST(payload, onComplete, isSync); if (_self.sendListener) { // Send the original payload to the listener _self.sendListener(orgPayloadData, payload, isSync, thePayload.isBeacon); } } catch (ex) { _postManager.diagLog().warnToConsole("Unexpected exception sending payload. Ex:" + dumpObj(ex)); _doOnComplete(onComplete, 0, {}); } }; } doPerf(_core, function () { return "HttpManager:_doPayloadSend.sender"; }, function () { if (sender) { if (thePayload.sendType === 0 /* Batched */) { _outstandingRequests++; } // Only call the hook if it's defined and we are not using sendBeacon as additional headers are not supported if (useSendHook_1 && !thePayload.isBeacon && sendInterface_1._transport !== 3 /* Beacon */) { // Create a new IPayloadData that is sent into the hook method, so that the hook method // can't change the object references to the orgPayloadData (it can still change the content -- mainly the headers) // Disabling the use of const because of Issue: // - Task 9227844: [1DS] Some environments and packagers automatically "freeze" objects which are defined as const which causes any mutations to throw // eslint-disable-next-line prefer-const var hookData_1 = { data: orgPayloadData.data, urlString: orgPayloadData.urlString, headers: extend({}, orgPayloadData.headers), timeout: orgPayloadData.timeout, disableXhrSync: orgPayloadData.disableXhrSync }; var senderCalled_1 = false; doPerf(_core, function () { return "HttpManager:_doPayloadSend.sendHook"; }, function () { try { _self.sendHook(hookData_1, function (payload) { senderCalled_1 = true; // Add back the internal properties if (!_customHttpInterface && !payload._thePayload) { payload._thePayload = payload._thePayload || orgPayloadData._thePayload; payload._sendReason = payload._sendReason || orgPayloadData._sendReason; } sender(payload); }, thePayload.isSync || thePayload.isTeardown); } catch (ex) { if (!senderCalled_1) { // The hook never called the sender -- assume that it never will sender(orgPayloadData); } } }); } else { sender(orgPayloadData); } } }); }, function () { return ({ thePayload: thePayload, serializationStart: serializationStart, serializationCompleted: serializationCompleted, sendReason: sendReason }); }, thePayload.isSync); } if (thePayload.sizeExceed && thePayload.sizeExceed.length > 0) { // Ensure that we send any discard events for oversize events even when there was no payload to send _sendBatchesNotification(thePayload.sizeExceed, 8003 /* SizeLimitExceeded */, thePayload.sendType); } if (thePayload.failedEvts && thePayload.failedEvts.length > 0) { // Ensure that we send any discard events for events that could not be serialized even when there was no payload to send _sendBatchesNotification(thePayload.failedEvts, 8002 /* InvalidEvent */, thePayload.sendType); } } function _addEventCompletedTimings(theEvents, sendEventCompleted) { if (_enableEventTimings) { arrForEach(theEvents, function (theEvent) { var timings = theEvent.timings = theEvent.timings || {}; _setTimingValue(timings, "sendEventCompleted", sendEventCompleted); }); } } function _retryRequestIfNeeded(status, headers, thePayload, sendReason) { var reason = 9000 /* ResponseFailure */; var droppedBatches = null; var isRetrying = false; var backOffTrans = false; try { var shouldRetry = true; if (typeof status !== strUndefined) { if (headers) { _clockSkewManager.setClockSkew(headers[strTimeDeltaHeader]); var killDuration = headers[strKillDurationHeader] || headers["kill-duration-seconds"]; arrForEach(_killSwitch.setKillSwitchTenants(headers[strKillTokensHeader], killDuration), function (killToken) { arrForEach(thePayload.batches, function (theBatch) { if (theBatch.iKey() === killToken) { // Make sure we have initialized the array droppedBatches = droppedBatches || []; // Create a copy of the batch with all of the events (and more importantly the action functions) var removedEvents = theBatch.split(0); // And then remove the events for the payload batch and reduce the actual number of processed thePayload.numEvents -= removedEvents.count(); droppedBatches.push(removedEvents); } }); }); } // Disabling triple-equals rule to avoid httpOverrides from failing because they are returning a string value // tslint:disable-next-line:triple-equals if (status == 200 || status == 204) { // Response was successfully sent reason = 200 /* Complete */; return; } if (!retryPolicyShouldRetryForStatus(status) || thePayload.numEvents <= 0) { // Only retry for specific response codes and if there is still events after kill switch processing shouldRetry = false; } // Derive the notification response from the HttpStatus Code reason = 9000 /* ResponseFailure */ + (status % 1000); } if (shouldRetry) { // The events should be retried -- so change notification to requeue them reason = 100 /* RequeueEvents */; var retryCount_1 = thePayload.retryCnt; if (thePayload.sendType === 0 /* Batched */) { // attempt to resend the entire batch if (retryCount_1 < maxRequestRetriesBeforeBackoff) { isRetrying = true; _doAction(function () { // try to resend the same batches if (thePayload.sendType === 0 /* Batched */) { // Reduce the outstanding request count (if this was an async request) as we didn't reduce the count // previously and we are about to reschedule our retry attempt and we want an attempt to send // to occur, it's also required to ensure that a follow up handleRequestFinished() call occurs _outstandingRequests--; } _sendBatches(thePayload.batches, retryCount_1 + 1, thePayload.isTeardown, _isUnloading ? 2 /* SendBeacon */ : thePayload.sendType, 5 /* Retry */); }, _isUnloading, retryPolicyGetMillisToBackoffForRetry(retryCount_1)); } else { backOffTrans = true; if (_isUnloading) { // we are unloading so don't try and requeue the events otherwise let the events get requeued and resent during the backoff sending // This will also cause the events to be purged based on the priority (if necessary) reason = 8001 /* NonRetryableStatus */; } } } } } finally { if (!isRetrying) { // Make sure the clockSkewManager doesn't blocking further sending of requests once we have a proper response // This won't override any previously sent clock Skew value _clockSkewManager.setClockSkew(); _handleRequestFinished(thePayload, reason, sendReason, backOffTrans); } _sendBatchesNotification(droppedBatches, 8004 /* KillSwitch */, thePayload.sendType); } } function _handleRequestFinished(thePayload, batchReason, sendReason, backOffTrans) { try { if (backOffTrans) { // Slow down the transmission requests _postManager._backOffTransmission(); } if (batchReason === 200 /* Complete */) { if (!backOffTrans && !thePayload.isSync) { // We have a successful async response, so the lets open the floodgates // The reason for checking isSync is to avoid unblocking if beacon send occurred as it // doesn't wait for a response. _postManager._clearBackOff(); } _addCompleteTimings(thePayload.batches); } // Send the notifications synchronously _sendBatchesNotification(thePayload.batches, batchReason, thePayload.sendType, true); } finally { if (thePayload.sendType === 0 /* Batched */) { // we always need to decrement this value otherwise the httpmanager locks up and won't send any more events _outstandingRequests--; // Don't try to send additional queued events if this is a retry operation as the retried // response will eventually call _handleRequestFinished for the retried event if (sendReason !== 5 /* Retry */) { // Try and send any other queued batched events _self.sendQueuedRequests(thePayload.sendType, sendReason); } } } } function _addCompleteTimings(theBatches) { if (_enableEventTimings) { var sendEventCompleted_1 = getTime(); arrForEach(theBatches, function (theBatch) { if (theBatch && theBatch.count() > 0) { _addEventCompletedTimings(theBatch.events(), sendEventCompleted_1); } }); } } function _doAction(cb, isSync, interval) { if (isSync) { cb(); } else { timeoutOverride.set(cb, interval); } } /** * Converts the XHR getAllResponseHeaders to a map containing the header key and value. */ // tslint:disable-next-line: align function _convertAllHeadersToMap(headersString) { var headers = {}; if (isString(headersString)) { var headersArray = strTrim(headersString).split(/[\r\n]+/); arrForEach(headersArray, function (headerEntry) { if (headerEntry) { var idx = headerEntry.indexOf(": "); if (idx !== -1) { // The new spec has the headers returning all as lowercase -- but not all browsers do this yet var header = strTrim(headerEntry.substring(0, idx)).toLowerCase(); var value = strTrim(headerEntry.substring(idx + 1)); headers[header] = value; } else { headers[strTrim(headerEntry)] = 1; } } }); } return headers; } function _getMsfpc(thePayload) { for (var lp = 0; lp < thePayload.batches.length; lp++) { var msfpc = thePayload.batches[lp].Msfpc(); if (msfpc) { return encodeURIComponent(msfpc); } } return ""; } function _handleCollectorResponse(responseText) { var responseHandlers = _self._responseHandlers; try { for (var i = 0; i < responseHandlers.length; i++) { try { responseHandlers[i](responseText); } catch (e) { _throwInternal(_postManager.diagLog(), 1 /* CRITICAL */, 519 /* PostResponseHandler */, "Response handler failed: " + e); } } if (responseText) { var response = JSON.parse(responseText); if (isValueAssigned(response.webResult) && isValueAssigned(response.webResult[strMsfpc])) { // Set cookie _cookieMgr.set("MSFPC", response.webResult[strMsfpc], 365 * 86400); } } } catch (ex) { // Doing nothing } } function _sendBatchesNotification(theBatches, batchReason, sendType, sendSync) { if (theBatches && theBatches.length > 0 && actions) { var theAction_1 = actions[_getNotificationAction(batchReason)]; if (theAction_1) { var isSyncRequest_1 = sendType !== 0 /* Batched */; doPerf(_core, function () { return "HttpManager:_sendBatchesNotification"; }, function () { _doAction(function () { try { theAction_1.call(actions, theBatches, batchReason, isSyncRequest_1, sendType); } catch (e) { _throwInternal(_postManager.diagLog(), 1 /* CRITICAL */, 74 /* NotificationException */, "send request notification failed: " + e); } }, sendSync || isSyncRequest_1, 0); }, function () { return ({ batches: _createDebugBatches(theBatches), reason: batchReason, isSync: isSyncRequest_1, sendSync: sendSync, sendType: sendType }); }, !isSyncRequest_1); } } } function _getNotificationAction(reason) { var action = _eventActionMap[reason]; if (!isValueAssigned(action)) { action = strOther; if (reason >= 9000 /* ResponseFailure */ && reason <= 9999 /* ResponseFailureMax */) { action = strResponseFail; } else if (reason >= 8000 /* EventsDropped */ && reason <= 8999 /* EventsDroppedMax */) { action = strDropped; } else if (reason >= 1000 /* SendingUndefined */ && reason <= 1999 /* SendingEventMax */) { action = strSending; } } return action; } }); } // Removed Stub for HttpManager.prototype.initialize. // Removed Stub for HttpManager.prototype.addQueryStringParameter. // Removed Stub for HttpManager.prototype.addHeader. // Removed Stub for HttpManager.prototype.addBatch. // Removed Stub for HttpManager.prototype.canSendRequest. // Removed Stub for HttpManager.prototype.sendQueuedRequests. // Removed Stub for HttpManager.prototype.isCompletelyIdle. // Removed Stub for HttpManager.prototype.setUnloading. // Removed Stub for HttpManager.prototype.teardown. // Removed Stub for HttpManager.prototype.pause. // Removed Stub for HttpManager.prototype.resume. // Removed Stub for HttpManager.prototype.sendSynchronousBatch. return HttpManager; }()); export { HttpManager }; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/1ds-post-js/dist-esm/src/HttpManager.js.map/* * 1DS JS SDK POST plugin, 3.2.2 * Copyright (c) Microsoft and contributors. All rights reserved. * (Microsoft Internal Only) */ /** * @name Index.ts * @author Abhilash Panwar (abpanwar) * @copyright Microsoft 2018 * File to export public classes. */ import PostChannel from "./PostChannel"; import { BE_PROFILE, NRT_PROFILE, RT_PROFILE, } from "./DataModels"; export { PostChannel, BE_PROFILE, NRT_PROFILE, RT_PROFILE, }; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/1ds-post-js/dist-esm/src/Index.js.map/* * 1DS JS SDK POST plugin, 3.2.2 * Copyright (c) Microsoft and contributors. All rights reserved. * (Microsoft Internal Only) */ /** * KillSwitch.ts * @author Abhilash Panwar (abpanwar) * @copyright Microsoft 2018 */ import dynamicProto from "@microsoft/dynamicproto-js"; import { arrForEach, strTrim, dateNow } from "@microsoft/1ds-core-js"; var SecToMsMultiplier = 1000; /** * Class to stop certain tenants sending events. */ var KillSwitch = /** @class */ (function () { function KillSwitch() { var _killedTokenDictionary = {}; function _normalizeTenants(values) { var result = []; if (values) { arrForEach(values, function (value) { result.push(strTrim(value)); }); } return result; } dynamicProto(KillSwitch, this, function (_self) { _self.setKillSwitchTenants = function (killTokens, killDuration) { if (killTokens && killDuration) { try { var killedTokens = _normalizeTenants(killTokens.split(",")); if (killDuration === "this-request-only") { return killedTokens; } var durationMs = parseInt(killDuration, 10) * SecToMsMultiplier; for (var i = 0; i < killedTokens.length; ++i) { _killedTokenDictionary[killedTokens[i]] = dateNow() + durationMs; } } catch (ex) { return []; } } return []; }; _self.isTenantKilled = function (tenantToken) { var killDictionary = _killedTokenDictionary; var name = strTrim(tenantToken); if (killDictionary[name] !== undefined && killDictionary[name] > dateNow()) { return true; } delete killDictionary[name]; return false; }; }); } // Removed Stub for KillSwitch.prototype.setKillSwitchTenants. // Removed Stub for KillSwitch.prototype.isTenantKilled. return KillSwitch; }()); export default KillSwitch; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/1ds-post-js/dist-esm/src/KillSwitch.js.map/* * 1DS JS SDK POST plugin, 3.2.2 * Copyright (c) Microsoft and contributors. All rights reserved. * (Microsoft Internal Only) */ import { __extendsFn as __extends } from "@microsoft/applicationinsights-shims"; /** * PostManager.ts * @author Abhilash Panwar (abpanwar); Hector Hernandez (hectorh); Nev Wylie (newylie) * @copyright Microsoft 2018-2020 */ import dynamicProto from "@microsoft/dynamicproto-js"; import { BaseTelemetryPlugin, EventsDiscardedReason, isValueAssigned, setProcessTelemetryTimings, arrForEach, doPerf, objForEachKey, optimizeObject, isChromium, getWindow, isNumber, mergeEvtNamespace, createUniqueNamespace, addPageUnloadEventListener, addPageHideEventListener, addPageShowEventListener, removePageUnloadEventListener, removePageHideEventListener, removePageShowEventListener, _throwInternal, objDefineAccessors } from "@microsoft/1ds-core-js"; import { RT_PROFILE, NRT_PROFILE, BE_PROFILE, } from "./DataModels"; import { EventBatch } from "./EventBatch"; import { HttpManager } from "./HttpManager"; import { retryPolicyGetMillisToBackoffForRetry } from "./RetryPolicy"; import { strMsaDeviceTicket } from "./Constants"; import { createTimeoutWrapper } from "./TimeoutOverrideWrapper"; var FlushCheckTimer = 0.250; // This needs to be in seconds, so this is 250ms var MaxNumberEventPerBatch = 500; var EventsDroppedAtOneTime = 20; var MaxSendAttempts = 6; var MaxSyncUnloadSendAttempts = 2; // Assuming 2 based on beforeunload and unload var MaxBackoffCount = 4; var MaxConnections = 2; var MaxRequestRetriesBeforeBackoff = 1; var strEventsDiscarded = "eventsDiscarded"; var strOverrideInstrumentationKey = "overrideInstrumentationKey"; var strMaxEventRetryAttempts = "maxEventRetryAttempts"; var strMaxUnloadEventRetryAttempts = "maxUnloadEventRetryAttempts"; var strAddUnloadCb = "addUnloadCb"; /** * Class that manages adding events to inbound queues and batching of events * into requests. */ var PostChannel = /** @class */ (function (_super) { __extends(PostChannel, _super); function PostChannel() { var _this = _super.call(this) || this; _this.identifier = "PostChannel"; _this.priority = 1011; _this.version = '3.2.2'; var _config; var _isTeardownCalled = false; var _flushCallbackQueue = []; var _flushCallbackTimerId = null; var _paused = false; var _immediateQueueSize = 0; var _immediateQueueSizeLimit = 500; var _queueSize = 0; var _queueSizeLimit = 10000; var _profiles = {}; var _currentProfile = RT_PROFILE; var _scheduledTimerId = null; var _immediateTimerId = null; var _currentBackoffCount = 0; var _timerCount = 0; var _xhrOverride; var _httpManager; var _batchQueues = {}; var _autoFlushEventsLimit; // either MaxBatchSize * (1+ Max Connections) or _queueLimit / 6 (where 3 latency Queues [normal, realtime, cost deferred] * 2 [allow half full -- allow for retry]) var _autoFlushBatchLimit; var _delayedBatchSendLatency = -1; var _delayedBatchReason; var _optimizeObject = true; var _isPageUnloadTriggered = false; var _disableXhrSync = false; var _maxEventSendAttempts = MaxSendAttempts; var _maxUnloadEventSendAttempts = MaxSyncUnloadSendAttempts; var _evtNamespace; var _timeoutWrapper; dynamicProto(PostChannel, _this, function (_self, _base) { _initDefaults(); // Special internal method to allow the DebugPlugin to hook embedded objects _self["_getDbgPlgTargets"] = function () { return [_httpManager]; }; _self.initialize = function (coreConfig, core, extensions) { doPerf(core, function () { return "PostChannel:initialize"; }, function () { var extendedCore = core; _base.initialize(coreConfig, core, extensions); try { var hasAddUnloadCb = !!core[strAddUnloadCb]; _evtNamespace = mergeEvtNamespace(createUniqueNamespace(_self.identifier), core.evtNamespace && core.evtNamespace()); var ctx = _self._getTelCtx(); coreConfig.extensionConfig[_self.identifier] = coreConfig.extensionConfig[_self.identifier] || {}; _config = ctx.getExtCfg(_self.identifier); _timeoutWrapper = createTimeoutWrapper(_config.setTimeoutOverride, _config.clearTimeoutOverride); // Only try and use the optimizeObject() if this appears to be a chromium based browser and it has not been explicitly disabled _optimizeObject = !_config.disableOptimizeObj && isChromium(); _hookWParam(extendedCore); if (_config.eventsLimitInMem > 0) { _queueSizeLimit = _config.eventsLimitInMem; } if (_config.immediateEventLimit > 0) { _immediateQueueSizeLimit = _config.immediateEventLimit; } if (_config.autoFlushEventsLimit > 0) { _autoFlushEventsLimit = _config.autoFlushEventsLimit; } _disableXhrSync = _config.disableXhrSync; if (isNumber(_config[strMaxEventRetryAttempts])) { _maxEventSendAttempts = _config[strMaxEventRetryAttempts]; } if (isNumber(_config[strMaxUnloadEventRetryAttempts])) { _maxUnloadEventSendAttempts = _config[strMaxUnloadEventRetryAttempts]; } _setAutoLimits(); if (_config.httpXHROverride && _config.httpXHROverride.sendPOST) { _xhrOverride = _config.httpXHROverride; } if (isValueAssigned(coreConfig.anonCookieName)) { _httpManager.addQueryStringParameter("anoncknm", coreConfig.anonCookieName); } _httpManager.sendHook = _config.payloadPreprocessor; _httpManager.sendListener = _config.payloadListener; // Override endpointUrl if provided in Post config var endpointUrl = _config.overrideEndpointUrl ? _config.overrideEndpointUrl : coreConfig.endpointUrl; _self._notificationManager = coreConfig.extensionConfig.NotificationManager; _httpManager.initialize(endpointUrl, _self.core, _self, _xhrOverride, _config); var excludePageUnloadEvents = coreConfig.disablePageUnloadEvents || []; // When running in Web browsers try to send all telemetry if page is unloaded addPageUnloadEventListener(_handleUnloadEvents, excludePageUnloadEvents, _evtNamespace); addPageHideEventListener(_handleUnloadEvents, excludePageUnloadEvents, _evtNamespace); addPageShowEventListener(_handleShowEvents, coreConfig.disablePageShowEvents, _evtNamespace); } catch (e) { // resetting the initialized state because of failure _self.setInitialized(false); throw e; } }, function () { return ({ coreConfig: coreConfig, core: core, extensions: extensions }); }); }; _self.processTelemetry = function (ev, itemCtx) { setProcessTelemetryTimings(ev, _self.identifier); itemCtx = _self._getTelCtx(itemCtx); // Get the channel instance from the current request/instance var channelConfig = itemCtx.getExtCfg(_self.identifier); // DisableTelemetry was defined in the config provided during initialization var disableTelemetry = !!_config.disableTelemetry; if (channelConfig) { // DisableTelemetry is defined in the config for this request/instance disableTelemetry = disableTelemetry || !!channelConfig.disableTelemetry; } var event = ev; if (!disableTelemetry && !_isTeardownCalled) { // Override iKey if provided in Post config if provided for during initialization if (_config[strOverrideInstrumentationKey]) { event.iKey = _config[strOverrideInstrumentationKey]; } // Override iKey if provided in Post config if provided for this instance if (channelConfig && channelConfig[strOverrideInstrumentationKey]) { event.iKey = channelConfig[strOverrideInstrumentationKey]; } _addEventToQueues(event, true); if (_isPageUnloadTriggered) { // Unload event has been received so we need to try and flush new events _releaseAllQueues(2 /* SendBeacon */, 2 /* Unload */); } else { _scheduleTimer(); } } _self.processNext(event, itemCtx); }; _self._doTeardown = function (unloadCtx, unloadState) { _releaseAllQueues(2 /* SendBeacon */, 2 /* Unload */); _isTeardownCalled = true; _httpManager.teardown(); removePageUnloadEventListener(null, _evtNamespace); removePageHideEventListener(null, _evtNamespace); removePageShowEventListener(null, _evtNamespace); // Just register to remove all events associated with this namespace _initDefaults(); }; function _hookWParam(extendedCore) { var existingGetWParamMethod = extendedCore.getWParam; extendedCore.getWParam = function () { var wparam = 0; if (_config.ignoreMc1Ms0CookieProcessing) { wparam = wparam | 2; } return wparam | existingGetWParamMethod(); }; } // Moving event handlers out from the initialize closure so that any local variables can be garbage collected function _handleUnloadEvents(evt) { var theEvt = evt || getWindow().event; // IE 8 does not pass the event if (theEvt.type !== "beforeunload") { // Only set the unload trigger if not beforeunload event as beforeunload can be cancelled while the other events can't _isPageUnloadTriggered = true; _httpManager.setUnloading(_isPageUnloadTriggered); } _releaseAllQueues(2 /* SendBeacon */, 2 /* Unload */); } function _handleShowEvents(evt) { // Handle the page becoming visible again _isPageUnloadTriggered = false; _httpManager.setUnloading(_isPageUnloadTriggered); } function _addEventToQueues(event, append) { // If send attempt field is undefined we should set it to 0. if (!event.sendAttempt) { event.sendAttempt = 0; } // Add default latency if (!event.latency) { event.latency = 1 /* Normal */; } // Remove extra AI properties if present if (event.ext && event.ext["trace"]) { delete (event.ext["trace"]); } if (event.ext && event.ext["user"] && event.ext["user"]["id"]) { delete (event.ext["user"]["id"]); } // v8 performance optimization for iterating over the keys if (_optimizeObject) { event.ext = optimizeObject(event.ext); if (event.baseData) { event.baseData = optimizeObject(event.baseData); } if (event.data) { event.data = optimizeObject(event.data); } } if (event.sync) { // If the transmission is backed off then do not send synchronous events. // We will convert these events to Real time latency instead. if (_currentBackoffCount || _paused) { event.latency = 3 /* RealTime */; event.sync = false; } else { // Log the event synchronously if (_httpManager) { // v8 performance optimization for iterating over the keys if (_optimizeObject) { event = optimizeObject(event); } _httpManager.sendSynchronousBatch(EventBatch.create(event.iKey, [event]), event.sync === true ? 1 /* Synchronous */ : event.sync, 3 /* SyncEvent */); return; } } } var evtLatency = event.latency; var queueSize = _queueSize; var queueLimit = _queueSizeLimit; if (evtLatency === 4 /* Immediate */) { queueSize = _immediateQueueSize; queueLimit = _immediateQueueSizeLimit; } var eventDropped = false; // Only add the event if the queue isn't full or it's a direct event (which don't add to the queue sizes) if (queueSize < queueLimit) { eventDropped = !_addEventToProperQueue(event, append); } else { var dropLatency = 1 /* Normal */; var dropNumber = EventsDroppedAtOneTime; if (evtLatency === 4 /* Immediate */) { // Only drop other immediate events as they are not technically sharing the general queue dropLatency = 4 /* Immediate */; dropNumber = 1; } // Drop old event from lower or equal latency eventDropped = true; if (_dropEventWithLatencyOrLess(event.iKey, event.latency, dropLatency, dropNumber)) { eventDropped = !_addEventToProperQueue(event, append); } } if (eventDropped) { // Can't drop events from current queues because the all the slots are taken by queues that are being flushed. _notifyEvents(strEventsDiscarded, [event], EventsDiscardedReason.QueueFull); } } _self.setEventQueueLimits = function (eventLimit, autoFlushLimit) { _queueSizeLimit = eventLimit > 0 ? eventLimit : 10000; _autoFlushEventsLimit = autoFlushLimit > 0 ? autoFlushLimit : 0; _setAutoLimits(); // We only do this check here as during normal event addition if the queue is > then events start getting dropped var doFlush = _queueSize > eventLimit; if (!doFlush && _autoFlushBatchLimit > 0) { // Check the auto flush max batch size for (var latency = 1 /* Normal */; !doFlush && latency <= 3 /* RealTime */; latency++) { var batchQueue = _batchQueues[latency]; if (batchQueue && batchQueue.batches) { arrForEach(batchQueue.batches, function (theBatch) { if (theBatch && theBatch.count() >= _autoFlushBatchLimit) { // If any 1 batch is > than the limit then trigger an auto flush doFlush = true; } }); } } } _performAutoFlush(true, doFlush); }; _self.pause = function () { _clearScheduledTimer(); _paused = true; _httpManager.pause(); }; _self.resume = function () { _paused = false; _httpManager.resume(); _scheduleTimer(); }; _self.addResponseHandler = function (responseHandler) { _httpManager._responseHandlers.push(responseHandler); }; _self._loadTransmitProfiles = function (profiles) { _resetTransmitProfiles(); objForEachKey(profiles, function (profileName, profileValue) { var profLen = profileValue.length; if (profLen >= 2) { var directValue = (profLen > 2 ? profileValue[2] : 0); profileValue.splice(0, profLen - 2); // Make sure if a higher latency is set to not send then don't send lower latency if (profileValue[1] < 0) { profileValue[0] = -1; } // Make sure each latency is multiple of the latency higher then it. If not a multiple // we round up so that it becomes a multiple. if (profileValue[1] > 0 && profileValue[0] > 0) { var timerMultiplier = profileValue[0] / profileValue[1]; profileValue[0] = Math.ceil(timerMultiplier) * profileValue[1]; } // Add back the direct profile timeout if (directValue >= 0 && profileValue[1] >= 0 && directValue > profileValue[1]) { // Make sure if it's not disabled (< 0) then make sure it's not larger than RealTime directValue = profileValue[1]; } profileValue.push(directValue); _profiles[profileName] = profileValue; } }); }; _self.flush = function (async, callback, sendReason) { if (async === void 0) { async = true; } if (!_paused) { // Clear the normal schedule timer as we are going to try and flush ASAP _clearScheduledTimer(); sendReason = sendReason || 1 /* ManualFlush */; if (async) { // Move all queued events to the HttpManager _queueBatches(1 /* Normal */, 0 /* Batched */, sendReason); // All events (should) have been queue -- lets just make sure the queue counts are correct to avoid queue exhaustion (previous bug #9685112) _resetQueueCounts(); if (_flushCallbackTimerId == null) { _flushCallbackTimerId = _createTimer(function () { _flushImpl(callback, sendReason); }, 0); } else { // Even if null (no callback) this will ensure after the flushImpl finishes waiting // for a completely idle connection it will attempt to re-flush any queued events on the next cycle _flushCallbackQueue.push(callback); } } else { // Now cause all queued events to be sent synchronously _sendEventsForLatencyAndAbove(1 /* Normal */, 1 /* Synchronous */, sendReason); if (callback !== null && callback !== undefined) { callback(); } } } }; _self.setMsaAuthTicket = function (ticket) { _httpManager.addHeader(strMsaDeviceTicket, ticket); }; _self.hasEvents = _hasEvents; _self._setTransmitProfile = function (profileName) { if (_currentProfile !== profileName && _profiles[profileName] !== undefined) { _clearScheduledTimer(); _currentProfile = profileName; _scheduleTimer(); } }; /** * Batch and send events currently in the queue for the given latency. * @param latency - Latency for which to send events. */ function _sendEventsForLatencyAndAbove(latency, sendType, sendReason) { var queued = _queueBatches(latency, sendType, sendReason); // Always trigger the request as while the post channel may not have queued additional events, the httpManager may already have waiting events _httpManager.sendQueuedRequests(sendType, sendReason); return queued; } function _hasEvents() { return _queueSize > 0; } /** * Try to schedule the timer after which events will be sent. If there are * no events to be sent, or there is already a timer scheduled, or the * http manager doesn't have any idle connections this method is no-op. */ function _scheduleTimer() { // If we had previously attempted to send requests, but the http manager didn't have any idle connections then the requests where delayed // so try and requeue then again now if (_delayedBatchSendLatency >= 0 && _queueBatches(_delayedBatchSendLatency, 0 /* Batched */, _delayedBatchReason)) { _httpManager.sendQueuedRequests(0 /* Batched */, _delayedBatchReason); } if (_immediateQueueSize > 0 && !_immediateTimerId && !_paused) { // During initialization _profiles enforce that the direct [2] is less than real time [1] timer value // If the immediateTimeout is disabled the immediate events will be sent with Real Time events var immediateTimeOut = _profiles[_currentProfile][2]; if (immediateTimeOut >= 0) { _immediateTimerId = _createTimer(function () { _immediateTimerId = null; // Only try to send direct events _sendEventsForLatencyAndAbove(4 /* Immediate */, 0 /* Batched */, 1 /* NormalSchedule */); _scheduleTimer(); }, immediateTimeOut); } } // During initialization the _profiles enforce that the normal [0] is a multiple of the real time [1] timer value var timeOut = _profiles[_currentProfile][1]; if (!_scheduledTimerId && !_flushCallbackTimerId && timeOut >= 0 && !_paused) { if (_hasEvents()) { _scheduledTimerId = _createTimer(function () { _scheduledTimerId = null; _sendEventsForLatencyAndAbove(_timerCount === 0 ? 3 /* RealTime */ : 1 /* Normal */, 0 /* Batched */, 1 /* NormalSchedule */); // Increment the count for next cycle _timerCount++; _timerCount %= 2; _scheduleTimer(); }, timeOut); } else { _timerCount = 0; } } } _self._backOffTransmission = function () { if (_currentBackoffCount < MaxBackoffCount) { _currentBackoffCount++; _clearScheduledTimer(); _scheduleTimer(); } }; _self._clearBackOff = function () { if (_currentBackoffCount) { _currentBackoffCount = 0; _clearScheduledTimer(); _scheduleTimer(); } }; function _initDefaults() { _config = null; _isTeardownCalled = false; _flushCallbackQueue = []; _flushCallbackTimerId = null; _paused = false; _immediateQueueSize = 0; _immediateQueueSizeLimit = 500; _queueSize = 0; _queueSizeLimit = 10000; _profiles = {}; _currentProfile = RT_PROFILE; _scheduledTimerId = null; _immediateTimerId = null; _currentBackoffCount = 0; _timerCount = 0; _xhrOverride = null; _batchQueues = {}; _autoFlushEventsLimit = undefined; // either MaxBatchSize * (1+ Max Connections) or _queueLimit / 6 (where 3 latency Queues [normal, realtime, cost deferred] * 2 [allow half full -- allow for retry]) _autoFlushBatchLimit = 0; _delayedBatchSendLatency = -1; _delayedBatchReason = null; _optimizeObject = true; _isPageUnloadTriggered = false; _disableXhrSync = false; _maxEventSendAttempts = MaxSendAttempts; _maxUnloadEventSendAttempts = MaxSyncUnloadSendAttempts; _evtNamespace = null; _timeoutWrapper = createTimeoutWrapper(); _httpManager = new HttpManager(MaxNumberEventPerBatch, MaxConnections, MaxRequestRetriesBeforeBackoff, { requeue: _requeueEvents, send: _sendingEvent, sent: _eventsSentEvent, drop: _eventsDropped, rspFail: _eventsResponseFail, oth: _otherEvent }, _timeoutWrapper); _initializeProfiles(); _clearQueues(); _setAutoLimits(); } function _createTimer(theTimerFunc, timeOut) { // If the transmission is backed off make the timer at least 1 sec to allow for back off. if (timeOut === 0 && _currentBackoffCount) { timeOut = 1; } var timerMultiplier = 1000; if (_currentBackoffCount) { timerMultiplier = retryPolicyGetMillisToBackoffForRetry(_currentBackoffCount - 1); } return _timeoutWrapper.set(theTimerFunc, timeOut * timerMultiplier); } function _clearScheduledTimer() { if (_scheduledTimerId !== null) { _timeoutWrapper.clear(_scheduledTimerId); _scheduledTimerId = null; _timerCount = 0; } } // Try to send all queued events using beacons if available function _releaseAllQueues(sendType, sendReason) { _clearScheduledTimer(); // Cancel all flush callbacks if (_flushCallbackTimerId) { _timeoutWrapper.clear(_flushCallbackTimerId); _flushCallbackTimerId = null; } if (!_paused) { // Queue all the remaining requests to be sent. The requests will be sent using HTML5 Beacons if they are available. _sendEventsForLatencyAndAbove(1 /* Normal */, sendType, sendReason); } } /** * Add empty queues for all latencies in the inbound queues map. This is called * when Transmission Manager is being flushed. This ensures that new events added * after flush are stored separately till we flush the current events. */ function _clearQueues() { _batchQueues[4 /* Immediate */] = { batches: [], iKeyMap: {} }; _batchQueues[3 /* RealTime */] = { batches: [], iKeyMap: {} }; _batchQueues[2 /* CostDeferred */] = { batches: [], iKeyMap: {} }; _batchQueues[1 /* Normal */] = { batches: [], iKeyMap: {} }; } function _getEventBatch(iKey, latency, create) { var batchQueue = _batchQueues[latency]; if (!batchQueue) { latency = 1 /* Normal */; batchQueue = _batchQueues[latency]; } var eventBatch = batchQueue.iKeyMap[iKey]; if (!eventBatch && create) { eventBatch = EventBatch.create(iKey); batchQueue.batches.push(eventBatch); batchQueue.iKeyMap[iKey] = eventBatch; } return eventBatch; } function _performAutoFlush(isAsync, doFlush) { // Only perform the auto flush check if the httpManager has an idle connection and we are not in a backoff situation if (_httpManager.canSendRequest() && !_currentBackoffCount) { if (_autoFlushEventsLimit > 0 && _queueSize > _autoFlushEventsLimit) { // Force flushing doFlush = true; } if (doFlush && _flushCallbackTimerId == null) { // Auto flush the queue _self.flush(isAsync, null, 20 /* MaxQueuedEvents */); } } } function _addEventToProperQueue(event, append) { // v8 performance optimization for iterating over the keys if (_optimizeObject) { event = optimizeObject(event); } var latency = event.latency; var eventBatch = _getEventBatch(event.iKey, latency, true); if (eventBatch.addEvent(event)) { if (latency !== 4 /* Immediate */) { _queueSize++; // Check for auto flushing based on total events in the queue, but not for requeued or retry events if (append && event.sendAttempt === 0) { // Force the flushing of the batch if the batch (specific iKey / latency combination) reaches it's auto flush limit _performAutoFlush(!event.sync, _autoFlushBatchLimit > 0 && eventBatch.count() >= _autoFlushBatchLimit); } } else { // Direct events don't need auto flushing as they are scheduled (by default) for immediate delivery _immediateQueueSize++; } return true; } return false; } function _dropEventWithLatencyOrLess(iKey, latency, currentLatency, dropNumber) { while (currentLatency <= latency) { var eventBatch = _getEventBatch(iKey, latency, true); if (eventBatch && eventBatch.count() > 0) { // Dropped oldest events from lowest possible latency var droppedEvents = eventBatch.split(0, dropNumber); var droppedCount = droppedEvents.count(); if (droppedCount > 0) { if (currentLatency === 4 /* Immediate */) { _immediateQueueSize -= droppedCount; } else { _queueSize -= droppedCount; } _notifyBatchEvents(strEventsDiscarded, [droppedEvents], EventsDiscardedReason.QueueFull); return true; } } currentLatency++; } // Unable to drop any events -- lets just make sure the queue counts are correct to avoid exhaustion _resetQueueCounts(); return false; } /** * Internal helper to reset the queue counts, used as a backstop to avoid future queue exhaustion errors * that might occur because of counting issues. */ function _resetQueueCounts() { var immediateQueue = 0; var normalQueue = 0; var _loop_1 = function (latency) { var batchQueue = _batchQueues[latency]; if (batchQueue && batchQueue.batches) { arrForEach(batchQueue.batches, function (theBatch) { if (latency === 4 /* Immediate */) { immediateQueue += theBatch.count(); } else { normalQueue += theBatch.count(); } }); } }; for (var latency = 1 /* Normal */; latency <= 4 /* Immediate */; latency++) { _loop_1(latency); } _queueSize = normalQueue; _immediateQueueSize = immediateQueue; } function _queueBatches(latency, sendType, sendReason) { var eventsQueued = false; var isAsync = sendType === 0 /* Batched */; // Only queue batches (to the HttpManager) if this is a sync request or the httpManager has an idle connection // Thus keeping the events within the PostChannel until the HttpManager has a connection available // This is so we can drop "old" events if the queue is getting full because we can't successfully send events if (!isAsync || _httpManager.canSendRequest()) { doPerf(_self.core, function () { return "PostChannel._queueBatches"; }, function () { var droppedEvents = []; var latencyToProcess = 4 /* Immediate */; while (latencyToProcess >= latency) { var batchQueue = _batchQueues[latencyToProcess]; if (batchQueue && batchQueue.batches && batchQueue.batches.length > 0) { arrForEach(batchQueue.batches, function (theBatch) { // Add the batch to the http manager to send the requests if (!_httpManager.addBatch(theBatch)) { // The events from this iKey are being dropped (killed) droppedEvents = droppedEvents.concat(theBatch.events()); } else { eventsQueued = eventsQueued || (theBatch && theBatch.count() > 0); } if (latencyToProcess === 4 /* Immediate */) { _immediateQueueSize -= theBatch.count(); } else { _queueSize -= theBatch.count(); } }); // Remove all batches from this Queue batchQueue.batches = []; batchQueue.iKeyMap = {}; } latencyToProcess--; } if (droppedEvents.length > 0) { _notifyEvents(strEventsDiscarded, droppedEvents, EventsDiscardedReason.KillSwitch); } if (eventsQueued && _delayedBatchSendLatency >= latency) { // We have queued events at the same level as the delayed values so clear the setting _delayedBatchSendLatency = -1; _delayedBatchReason = 0 /* Undefined */; } }, function () { return ({ latency: latency, sendType: sendType, sendReason: sendReason }); }, !isAsync); } else { // remember the min latency so that we can re-trigger later _delayedBatchSendLatency = _delayedBatchSendLatency >= 0 ? Math.min(_delayedBatchSendLatency, latency) : latency; _delayedBatchReason = Math.max(_delayedBatchReason, sendReason); } return eventsQueued; } /** * This is the callback method is called as part of the manual flushing process. * @param callback * @param sendReason */ function _flushImpl(callback, sendReason) { // Add any additional queued events and cause all queued events to be sent asynchronously _sendEventsForLatencyAndAbove(1 /* Normal */, 0 /* Batched */, sendReason); _waitForIdleManager(function () { // Only called AFTER the httpManager does not have any outstanding requests if (callback) { callback(); } if (_flushCallbackQueue.length > 0) { _flushCallbackTimerId = _createTimer(function () { return _flushImpl(_flushCallbackQueue.shift(), sendReason); }, 0); } else { // No more flush requests _flushCallbackTimerId = null; if (_hasEvents()) { // We still have events, so restart the normal timer schedule _scheduleTimer(); } } }); } function _waitForIdleManager(callback) { if (_httpManager.isCompletelyIdle()) { callback(); } else { _flushCallbackTimerId = _createTimer(function () { _waitForIdleManager(callback); }, FlushCheckTimer); } } /** * Resets the transmit profiles to the default profiles of Real Time, Near Real Time * and Best Effort. This removes all the custom profiles that were loaded. */ function _resetTransmitProfiles() { _clearScheduledTimer(); _initializeProfiles(); _currentProfile = RT_PROFILE; _scheduleTimer(); } function _initializeProfiles() { _profiles = {}; _profiles[RT_PROFILE] = [2, 1, 0]; _profiles[NRT_PROFILE] = [6, 3, 0]; _profiles[BE_PROFILE] = [18, 9, 0]; } /** * The notification handler for requeue events * @ignore */ function _requeueEvents(batches, reason) { var droppedEvents = []; var maxSendAttempts = _maxEventSendAttempts; if (_isPageUnloadTriggered) { // If a page unlaod has been triggered reduce the number of times we try to "retry" maxSendAttempts = _maxUnloadEventSendAttempts; } arrForEach(batches, function (theBatch) { if (theBatch && theBatch.count() > 0) { arrForEach(theBatch.events(), function (theEvent) { if (theEvent) { // Check if the request being added back is for a sync event in which case mark it no longer a sync event if (theEvent.sync) { theEvent.latency = 4 /* Immediate */; theEvent.sync = false; } if (theEvent.sendAttempt < maxSendAttempts) { // Reset the event timings setProcessTelemetryTimings(theEvent, _self.identifier); _addEventToQueues(theEvent, false); } else { droppedEvents.push(theEvent); } } }); } }); if (droppedEvents.length > 0) { _notifyEvents(strEventsDiscarded, droppedEvents, EventsDiscardedReason.NonRetryableStatus); } if (_isPageUnloadTriggered) { // Unload event has been received so we need to try and flush new events _releaseAllQueues(2 /* SendBeacon */, 2 /* Unload */); } } function _callNotification(evtName, theArgs) { var manager = (_self._notificationManager || {}); var notifyFunc = manager[evtName]; if (notifyFunc) { try { notifyFunc.apply(manager, theArgs); } catch (e) { _throwInternal(_self.diagLog(), 1 /* CRITICAL */, 74 /* NotificationException */, evtName + " notification failed: " + e); } } } function _notifyEvents(evtName, theEvents) { var extraArgs = []; for (var _i = 2; _i < arguments.length; _i++) { extraArgs[_i - 2] = arguments[_i]; } if (theEvents && theEvents.length > 0) { _callNotification(evtName, [theEvents].concat(extraArgs)); } } function _notifyBatchEvents(evtName, batches) { var extraArgs = []; for (var _i = 2; _i < arguments.length; _i++) { extraArgs[_i - 2] = arguments[_i]; } if (batches && batches.length > 0) { arrForEach(batches, function (theBatch) { if (theBatch && theBatch.count() > 0) { _callNotification(evtName, [theBatch.events()].concat(extraArgs)); } }); } } /** * The notification handler for when batches are about to be sent * @ignore */ function _sendingEvent(batches, reason, isSyncRequest) { if (batches && batches.length > 0) { _callNotification("eventsSendRequest", [(reason >= 1000 /* SendingUndefined */ && reason <= 1999 /* SendingEventMax */ ? reason - 1000 /* SendingUndefined */ : 0 /* Undefined */), isSyncRequest !== true]); } } /** * This event represents that a batch of events have been successfully sent and a response received * @param batches The notification handler for when the batches have been successfully sent * @param reason For this event the reason will always be EventBatchNotificationReason.Complete */ function _eventsSentEvent(batches, reason) { _notifyBatchEvents("eventsSent", batches, reason); // Try and schedule the processing timer if we have events _scheduleTimer(); } function _eventsDropped(batches, reason) { _notifyBatchEvents(strEventsDiscarded, batches, (reason >= 8000 /* EventsDropped */ && reason <= 8999 /* EventsDroppedMax */ ? reason - 8000 /* EventsDropped */ : EventsDiscardedReason.Unknown)); } function _eventsResponseFail(batches) { _notifyBatchEvents(strEventsDiscarded, batches, EventsDiscardedReason.NonRetryableStatus); // Try and schedule the processing timer if we have events _scheduleTimer(); } function _otherEvent(batches, reason) { _notifyBatchEvents(strEventsDiscarded, batches, EventsDiscardedReason.Unknown); // Try and schedule the processing timer if we have events _scheduleTimer(); } function _setAutoLimits() { if (!_config || !_config.disableAutoBatchFlushLimit) { _autoFlushBatchLimit = Math.max(MaxNumberEventPerBatch * (MaxConnections + 1), _queueSizeLimit / 6); } else { _autoFlushBatchLimit = 0; } } // Provided for backward compatibility they are not "expected" to be in current use but they are public objDefineAccessors(_self, "_setTimeoutOverride", function () { return _timeoutWrapper.set; }, function (value) { // Recreate the timeout wrapper _timeoutWrapper = createTimeoutWrapper(value, _timeoutWrapper.clear); }); objDefineAccessors(_self, "_clearTimeoutOverride", function () { return _timeoutWrapper.clear; }, function (value) { // Recreate the timeout wrapper _timeoutWrapper = createTimeoutWrapper(_timeoutWrapper.set, value); }); }); return _this; } // Removed Stub for PostChannel.prototype.initialize. // Removed Stub for PostChannel.prototype.processTelemetry. // Removed Stub for PostChannel.prototype.setEventQueueLimits. // Removed Stub for PostChannel.prototype.pause. // Removed Stub for PostChannel.prototype.resume. // Removed Stub for PostChannel.prototype.addResponseHandler. // Removed Stub for PostChannel.prototype.flush. // Removed Stub for PostChannel.prototype.setMsaAuthTicket. // Removed Stub for PostChannel.prototype.hasEvents. // Removed Stub for PostChannel.prototype._loadTransmitProfiles. // Removed Stub for PostChannel.prototype._setTransmitProfile. // Removed Stub for PostChannel.prototype._backOffTransmission. // Removed Stub for PostChannel.prototype._clearBackOff. return PostChannel; }(BaseTelemetryPlugin)); export default PostChannel; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/1ds-post-js/dist-esm/src/PostChannel.js.map/* * 1DS JS SDK POST plugin, 3.2.2 * Copyright (c) Microsoft and contributors. All rights reserved. * (Microsoft Internal Only) */ /** * RetryPolicy.ts * @author Abhilash Panwar (abpanwar) * @copyright Microsoft 2018 */ var RandomizationLowerThreshold = 0.8; var RandomizationUpperThreshold = 1.2; var BaseBackoff = 3000; var MaxBackoff = 600000; /** * Determine if the request should be retried for the given status code. * The below expression reads that we should only retry for: * - HttpStatusCodes that are smaller than 300. * - HttpStatusCodes greater or equal to 500 (except for 501-NotImplement * and 505-HttpVersionNotSupport). * - HttpStatusCode 408-RequestTimeout. * - HttpStatusCode 429. * This is based on Microsoft.WindowsAzure.Storage.RetryPolicies.ExponentialRetry class * @param httpStatusCode - The status code returned for the request. * @returns True if request should be retried, false otherwise. */ export function retryPolicyShouldRetryForStatus(httpStatusCode) { /* tslint:disable:triple-equals */ // Disabling triple-equals rule to avoid httpOverrides from failing because they are returning a string value return !((httpStatusCode >= 300 && httpStatusCode < 500 && httpStatusCode != 408 && httpStatusCode != 429) || (httpStatusCode == 501) || (httpStatusCode == 505)); /* tslint:enable:triple-equals */ } /** * Gets the number of milliseconds to back off before retrying the request. The * back off duration is exponentially scaled based on the number of retries already * done for the request. * @param retriesSoFar - The number of times the request has already been retried. * @returns The back off duration for the request before it can be retried. */ export function retryPolicyGetMillisToBackoffForRetry(retriesSoFar) { var waitDuration = 0; var minBackoff = BaseBackoff * RandomizationLowerThreshold; var maxBackoff = BaseBackoff * RandomizationUpperThreshold; var randomBackoff = Math.floor(Math.random() * (maxBackoff - minBackoff)) + minBackoff; waitDuration = Math.pow(2, retriesSoFar) * randomBackoff; return Math.min(waitDuration, MaxBackoff); } //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/1ds-post-js/dist-esm/src/RetryPolicy.js.map/* * 1DS JS SDK POST plugin, 3.2.2 * Copyright (c) Microsoft and contributors. All rights reserved. * (Microsoft Internal Only) */ /** * Serializer.ts * @author Abhilash Panwar (abpanwar); Hector Hernandez (hectorh); Nev Wylie (newylie) * @copyright Microsoft 2018-2020 */ import { getTenantId, getCommonSchemaMetaData, isArray, sanitizeProperty, doPerf, isValueAssigned, strStartsWith, objForEachKey, arrIndexOf, } from "@microsoft/1ds-core-js"; import { EventBatch } from "./EventBatch"; import dynamicProto from "@microsoft/dynamicproto-js"; /** * Note: This is an optimization for V8-based browsers. When V8 concatenates a string, * the strings are only joined logically using a "cons string" or "constructed/concatenated * string". These containers keep references to one another and can result in very large * memory usage. For example, if a 2MB string is constructed by concatenating 4 bytes * together at a time, the memory usage will be ~44MB; so ~22x increase. The strings are * only joined together when an operation requiring their joining takes place, such as * substr(). This function is called when adding data to this buffer to ensure these * types of strings are periodically joined to reduce the memory footprint. * Setting to every 20 events as the JSON.stringify() may have joined many strings * and calling this too much causes a minor delay while processing. */ var _MAX_STRING_JOINS = 20; var RequestSizeLimitBytes = 3984588; // approx 3.8 Mb var BeaconRequestSizeLimitBytes = 65000; // approx 64kb (the current Edge, Firefox and Chrome max limit) var MaxRecordSize = 2000000; // approx 2 Mb var MaxBeaconRecordSize = Math.min(MaxRecordSize, BeaconRequestSizeLimitBytes); var metadata = "metadata"; var f = "f"; var rCheckDot = /\./; /** * Class to handle serialization of event and request. * Currently uses Bond for serialization. Please note that this may be subject to change. */ var Serializer = /** @class */ (function () { function Serializer(perfManager, valueSanitizer, stringifyObjects, enableCompoundKey) { var strData = "data"; var strBaseData = "baseData"; var strExt = "ext"; var _checkForCompoundkey = !!enableCompoundKey; var _processSubMetaData = true; var _theSanitizer = valueSanitizer; var _isReservedCache = {}; dynamicProto(Serializer, this, function (_self) { _self.createPayload = function (retryCnt, isTeardown, isSync, useSendBeacon, sendReason, sendType) { return { apiKeys: [], payloadBlob: "", overflow: null, sizeExceed: [], failedEvts: [], batches: [], numEvents: 0, retryCnt: retryCnt, isTeardown: isTeardown, isSync: isSync, isBeacon: useSendBeacon, sendType: sendType, sendReason: sendReason }; }; _self.appendPayload = function (payload, theBatch, maxEventsPerBatch) { var canAddEvents = payload && theBatch && !payload.overflow; if (canAddEvents) { doPerf(perfManager, function () { return "Serializer:appendPayload"; }, function () { var theEvents = theBatch.events(); var payloadBlob = payload.payloadBlob; var payloadEvents = payload.numEvents; var eventsAdded = false; var sizeExceeded = []; var failedEvts = []; var isBeaconPayload = payload.isBeacon; var requestMaxSize = isBeaconPayload ? BeaconRequestSizeLimitBytes : RequestSizeLimitBytes; var recordMaxSize = isBeaconPayload ? MaxBeaconRecordSize : MaxRecordSize; var lp = 0; var joinCount = 0; while (lp < theEvents.length) { var theEvent = theEvents[lp]; if (theEvent) { if (payloadEvents >= maxEventsPerBatch) { // Maximum events per payload reached, so don't add any more payload.overflow = theBatch.split(lp); break; } var eventBlob = _self.getEventBlob(theEvent); if (eventBlob && eventBlob.length <= recordMaxSize) { // This event will fit into the payload var blobLength = eventBlob.length; var currentSize = payloadBlob.length; if (currentSize + blobLength > requestMaxSize) { // Request or batch size exceeded, so don't add any more to the payload payload.overflow = theBatch.split(lp); break; } if (payloadBlob) { payloadBlob += "\n"; } payloadBlob += eventBlob; joinCount++; // v8 memory optimization only if (joinCount > _MAX_STRING_JOINS) { // this substr() should cause the constructed string to join payloadBlob.substr(0, 1); joinCount = 0; } eventsAdded = true; payloadEvents++; } else { if (eventBlob) { // Single event size exceeded so remove from the batch sizeExceeded.push(theEvent); } else { failedEvts.push(theEvent); } // We also need to remove this event from the existing array, otherwise a notification will be sent // indicating that it was successfully sent theEvents.splice(lp, 1); lp--; } } lp++; } if (sizeExceeded && sizeExceeded.length > 0) { payload.sizeExceed.push(EventBatch.create(theBatch.iKey(), sizeExceeded)); // Remove the exceeded events from the batch } if (failedEvts && failedEvts.length > 0) { payload.failedEvts.push(EventBatch.create(theBatch.iKey(), failedEvts)); // Remove the failed events from the batch } if (eventsAdded) { payload.batches.push(theBatch); payload.payloadBlob = payloadBlob; payload.numEvents = payloadEvents; var apiKey = theBatch.iKey(); if (arrIndexOf(payload.apiKeys, apiKey) === -1) { payload.apiKeys.push(apiKey); } } }, function () { return ({ payload: payload, theBatch: { iKey: theBatch.iKey(), evts: theBatch.events() }, max: maxEventsPerBatch }); }); } return canAddEvents; }; _self.getEventBlob = function (eventData) { try { return doPerf(perfManager, function () { return "Serializer.getEventBlob"; }, function () { var serializedEvent = {}; // Adding as dynamic keys for v8 performance serializedEvent.name = eventData.name; serializedEvent.time = eventData.time; serializedEvent.ver = eventData.ver; serializedEvent.iKey = "o:" + getTenantId(eventData.iKey); // Assigning local var so usage in part b/c don't throw if there is no ext var serializedExt = {}; // Part A var eventExt = eventData[strExt]; if (eventExt) { // Only assign ext if the event had one (There are tests covering this use case) serializedEvent[strExt] = serializedExt; objForEachKey(eventExt, function (key, value) { var data = serializedExt[key] = {}; // Don't include a metadata callback as we don't currently set metadata Part A fields _processPathKeys(value, data, "ext." + key, true, null, null, true); }); } var serializedData = serializedEvent[strData] = {}; serializedData.baseType = eventData.baseType; var serializedBaseData = serializedData[strBaseData] = {}; // Part B _processPathKeys(eventData.baseData, serializedBaseData, strBaseData, false, [strBaseData], function (pathKeys, name, value) { _addJSONPropertyMetaData(serializedExt, pathKeys, name, value); }, _processSubMetaData); // Part C _processPathKeys(eventData.data, serializedData, strData, false, [], function (pathKeys, name, value) { _addJSONPropertyMetaData(serializedExt, pathKeys, name, value); }, _processSubMetaData); return JSON.stringify(serializedEvent); }, function () { return ({ item: eventData }); }); } catch (e) { return null; } }; function _isReservedField(path, name) { var result = _isReservedCache[path]; if (result === undefined) { if (path.length >= 7) { // Do not allow the changing of fields located in the ext.metadata or ext.web extension result = strStartsWith(path, "ext.metadata") || strStartsWith(path, "ext.web"); } _isReservedCache[path] = result; } return result; } function _processPathKeys(srcObj, target, thePath, checkReserved, metadataPathKeys, metadataCallback, processSubKeys) { objForEachKey(srcObj, function (key, srcValue) { var prop = null; if (srcValue || isValueAssigned(srcValue)) { var path = thePath; var name_1 = key; var theMetaPathKeys = metadataPathKeys; var destObj = target; // Handle keys with embedded '.', like "TestObject.testProperty" if (_checkForCompoundkey && !checkReserved && rCheckDot.test(key)) { var subKeys = key.split("."); var keyLen = subKeys.length; if (keyLen > 1) { if (theMetaPathKeys) { // Create a copy of the meta path keys so we can add the extra ones theMetaPathKeys = theMetaPathKeys.slice(); } for (var lp = 0; lp < keyLen - 1; lp++) { var subKey = subKeys[lp]; // Add/reuse the sub key object destObj = destObj[subKey] = destObj[subKey] || {}; path += "." + subKey; if (theMetaPathKeys) { theMetaPathKeys.push(subKey); } } name_1 = subKeys[keyLen - 1]; } } var isReserved = checkReserved && _isReservedField(path, name_1); if (!isReserved && _theSanitizer && _theSanitizer.handleField(path, name_1)) { prop = _theSanitizer.value(path, name_1, srcValue, stringifyObjects); } else { prop = sanitizeProperty(name_1, srcValue, stringifyObjects); } if (prop) { // Set the value var newValue = prop.value; destObj[name_1] = newValue; if (metadataCallback) { metadataCallback(theMetaPathKeys, name_1, prop); } if (processSubKeys && typeof newValue === "object" && !isArray(newValue)) { var newPath = theMetaPathKeys; if (newPath) { newPath = newPath.slice(); newPath.push(name_1); } // Make sure we process sub objects as well (for value sanitization and metadata) _processPathKeys(srcValue, newValue, path + "." + name_1, checkReserved, newPath, metadataCallback, processSubKeys); } } } }); } }); } // Removed Stub for Serializer.prototype.createPayload. // Removed Stub for Serializer.prototype.appendPayload. // Removed Stub for Serializer.prototype.getEventBlob. // Removed Stub for Serializer.prototype.handleField. // Removed Stub for Serializer.prototype.getSanitizer. return Serializer; }()); export { Serializer }; /** * @ignore */ function _addJSONPropertyMetaData(json, propKeys, name, propertyValue) { if (propertyValue && json) { var encodedTypeValue = getCommonSchemaMetaData(propertyValue.value, propertyValue.kind, propertyValue.propertyType); if (encodedTypeValue > -1) { // Add the root metadata var metaData = json[metadata]; if (!metaData) { // Sets the root 'f' metaData = json[metadata] = { f: {} }; } var metaTarget = metaData[f]; if (!metaTarget) { // This can occur if someone has manually added an ext.metadata object // Such as ext.metadata.privLevel and ext.metadata.privTags metaTarget = metaData[f] = {}; } // Traverse the metadata path and build each object (contains an 'f' key) -- if required if (propKeys) { for (var lp = 0; lp < propKeys.length; lp++) { var key = propKeys[lp]; if (!metaTarget[key]) { metaTarget[key] = { f: {} }; } var newTarget = metaTarget[key][f]; if (!newTarget) { // Not expected, but can occur if the metadata context was pre-created as part of the event newTarget = metaTarget[key][f] = {}; } metaTarget = newTarget; } } metaTarget = metaTarget[name] = {}; if (isArray(propertyValue.value)) { metaTarget["a"] = { t: encodedTypeValue }; } else { metaTarget["t"] = encodedTypeValue; } } } } //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/1ds-post-js/dist-esm/src/Serializer.js.map/* * 1DS JS SDK POST plugin, 3.2.2 * Copyright (c) Microsoft and contributors. All rights reserved. * (Microsoft Internal Only) */ /** * TimeoutOverrideWrapper.ts * @author Nev Wylie (newylie) * @copyright Microsoft 2022 * Simple internal timeout wrapper */ export function defaultSetTimeout(callback, ms) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } return setTimeout(callback, ms, args); } export function defaultClearTimeout(timeoutId) { clearTimeout(timeoutId); } export function createTimeoutWrapper(argSetTimeout, argClearTimeout) { return { set: argSetTimeout || defaultSetTimeout, clear: argClearTimeout || defaultClearTimeout }; } //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/1ds-post-js/dist-esm/src/TimeoutOverrideWrapper.js.map/* * 1DS JS SDK POST plugin, 3.2.2 * Copyright (c) Microsoft and contributors. All rights reserved. * (Microsoft Internal Only) */ export {}; // export declare var XDomainRequest: { // prototype: IXDomainRequest; // new (): IXDomainRequest; // }; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/1ds-post-js/dist-esm/src/typings/XDomainRequest.js.mapconst binding = require('node-gyp-build')(__dirname); const path = require('path'); function normalizeOptions(dir, opts = {}) { if (Array.isArray(opts.ignore)) { opts = Object.assign({}, opts, { ignore: opts.ignore.map(ignore => path.resolve(dir, ignore)), }); } return opts; } exports.writeSnapshot = (dir, snapshot, opts) => { return binding.writeSnapshot( path.resolve(dir), path.resolve(snapshot), normalizeOptions(dir, opts), ); }; exports.getEventsSince = (dir, snapshot, opts) => { return binding.getEventsSince( path.resolve(dir), path.resolve(snapshot), normalizeOptions(dir, opts), ); }; exports.subscribe = async (dir, fn, opts) => { dir = path.resolve(dir); opts = normalizeOptions(dir, opts); await binding.subscribe(dir, fn, opts); return { unsubscribe() { return binding.unsubscribe(dir, fn, opts); }, }; }; exports.unsubscribe = (dir, fn, opts) => { return binding.unsubscribe( path.resolve(dir), fn, normalizeOptions(dir, opts), ); }; // @flow declare type FilePath = string; export type BackendType = | 'fs-events' | 'watchman' | 'inotify' | 'windows' | 'brute-force'; export type EventType = 'create' | 'update' | 'delete'; export interface Options { ignore?: Array, backend?: BackendType } export type SubscribeCallback = ( err: ?Error, events: Array ) => mixed; export interface AsyncSubscription { unsubscribe(): Promise } export interface Event { path: FilePath, type: EventType } declare module.exports: { getEventsSince( dir: FilePath, snapshot: FilePath, opts?: Options ): Promise>, subscribe( dir: FilePath, fn: SubscribeCallback, opts?: Options ): Promise, unsubscribe( dir: FilePath, fn: SubscribeCallback, opts?: Options ): Promise, writeSnapshot( dir: FilePath, snapshot: FilePath, opts?: Options ): Promise }MIT License Copyright (c) 2017-present Devon Govett Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "@parcel/watcher", "version": "2.0.5", "main": "index.js", "types": "index.d.ts", "repository": { "type": "git", "url": "https://github.com/parcel-bundler/watcher.git" }, "description": "A native C++ Node module for querying and subscribing to filesystem events. Used by Parcel 2.", "license": "MIT", "publishConfig": { "access": "public" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/parcel" }, "files": [ "src", "prebuilds", "index.js", "index.js.flow", "index.d.ts", "package.json", "binding.gyp", "README.md" ], "scripts": { "prebuild": "prebuildify --napi --strip --tag-libc -t 10.0.0", "format": "prettier --write \"./**/*.{js,json,md}\"", "install": "node-gyp-build", "rebuild": "node-gyp rebuild -j 8 --debug --verbose", "test": "mocha" }, "engines": { "node": ">= 10.0.0" }, "husky": { "hooks": { "pre-commit": "lint-staged" } }, "lint-staged": { "*.{js,json,md}": [ "prettier --write", "git add" ] }, "dependencies": { "node-addon-api": "^3.2.1", "node-gyp-build": "^4.3.0" }, "devDependencies": { "fs-extra": "^10.0.0", "husky": "^7.0.2", "mocha": "^9.1.1", "prebuildify": "^4.2.1", "lint-staged": "^11.1.2", "prettier": "^2.3.2" }, "binary": { "napi_versions": [ 3 ] } } MIT License Copyright (c) Microsoft Corporation. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE { "name": "@vscode/iconv-lite-umd", "version": "0.7.0", "description": "Iconv-lite as UMD module", "main": "lib/iconv-lite-umd.js", "typings": "iconv-lite-umd.d.ts", "scripts": { "build": "webpack", "prepublish": "webpack", "test": "mocha --reporter spec --grep ." }, "repository": { "type": "git", "url": "git+https://github.com/Microsoft/vscode-iconv-lite-umd.git" }, "keywords": [ "iconv-lite", "umd" ], "author": "Microsoft", "license": "MIT", "bugs": { "url": "https://github.com/Microsoft/vscode-iconv-lite-umd/issues" }, "homepage": "https://github.com/Microsoft/vscode-iconv-lite-umd#readme", "devDependencies": { "async": "^3.2.0", "c8": "^7.2.0", "errto": "^0.2.1", "iconv": "^2.3.5", "iconv-lite": "0.6.3", "mocha": "^3.5.3", "request": "^2.88.2", "semver": "^6.3.0", "unorm": "^1.6.0", "webpack": "^4.43.0", "webpack-cli": "^3.3.11" } } !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}("undefined"!=typeof self?self:this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=5)}([function(e,t,r){"use strict";(function(t){var n,i=r(2),a=i.Buffer,o={};for(n in i)i.hasOwnProperty(n)&&"SlowBuffer"!==n&&"Buffer"!==n&&(o[n]=i[n]);var s=o.Buffer={};for(n in a)a.hasOwnProperty(n)&&"allocUnsafe"!==n&&"allocUnsafeSlow"!==n&&(s[n]=a[n]);if(o.Buffer.prototype=a.prototype,s.from&&s.from!==Uint8Array.from||(s.from=function(e,t,r){if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&void 0===e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return a(e,t,r)}),s.alloc||(s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var n=a(e);return t&&0!==t.length?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n}),!o.kStringMaxLength)try{o.kStringMaxLength=t.binding("buffer").kStringMaxLength}catch(e){}o.constants||(o.constants={MAX_LENGTH:o.kMaxLength},o.kStringMaxLength&&(o.constants.MAX_STRING_LENGTH=o.kStringMaxLength)),e.exports=o}).call(this,r(6))},function(e){e.exports=JSON.parse('[["0","\\u0000",127,"€"],["8140","丂丄丅丆丏丒丗丟丠両丣並丩丮丯丱丳丵丷丼乀乁乂乄乆乊乑乕乗乚乛乢乣乤乥乧乨乪",5,"乲乴",9,"乿",6,"亇亊"],["8180","亐亖亗亙亜亝亞亣亪亯亰亱亴亶亷亸亹亼亽亾仈仌仏仐仒仚仛仜仠仢仦仧仩仭仮仯仱仴仸仹仺仼仾伀伂",6,"伋伌伒",4,"伜伝伡伣伨伩伬伭伮伱伳伵伷伹伻伾",4,"佄佅佇",5,"佒佔佖佡佢佦佨佪佫佭佮佱佲併佷佸佹佺佽侀侁侂侅來侇侊侌侎侐侒侓侕侖侘侙侚侜侞侟価侢"],["8240","侤侫侭侰",4,"侶",8,"俀俁係俆俇俈俉俋俌俍俒",4,"俙俛俠俢俤俥俧俫俬俰俲俴俵俶俷俹俻俼俽俿",11],["8280","個倎倐們倓倕倖倗倛倝倞倠倢倣値倧倫倯",10,"倻倽倿偀偁偂偄偅偆偉偊偋偍偐",4,"偖偗偘偙偛偝",7,"偦",5,"偭",8,"偸偹偺偼偽傁傂傃傄傆傇傉傊傋傌傎",20,"傤傦傪傫傭",4,"傳",6,"傼"],["8340","傽",17,"僐",5,"僗僘僙僛",10,"僨僩僪僫僯僰僱僲僴僶",4,"僼",9,"儈"],["8380","儉儊儌",5,"儓",13,"儢",28,"兂兇兊兌兎兏児兒兓兗兘兙兛兝",4,"兣兤兦內兩兪兯兲兺兾兿冃冄円冇冊冋冎冏冐冑冓冔冘冚冝冞冟冡冣冦",4,"冭冮冴冸冹冺冾冿凁凂凃凅凈凊凍凎凐凒",5],["8440","凘凙凚凜凞凟凢凣凥",5,"凬凮凱凲凴凷凾刄刅刉刋刌刏刐刓刔刕刜刞刟刡刢刣別刦刧刪刬刯刱刲刴刵刼刾剄",5,"剋剎剏剒剓剕剗剘"],["8480","剙剚剛剝剟剠剢剣剤剦剨剫剬剭剮剰剱剳",9,"剾劀劃",4,"劉",6,"劑劒劔",6,"劜劤劥劦劧劮劯劰労",9,"勀勁勂勄勅勆勈勊勌勍勎勏勑勓勔動勗務",5,"勠勡勢勣勥",10,"勱",7,"勻勼勽匁匂匃匄匇匉匊匋匌匎"],["8540","匑匒匓匔匘匛匜匞匟匢匤匥匧匨匩匫匬匭匯",9,"匼匽區卂卄卆卋卌卍卐協単卙卛卝卥卨卪卬卭卲卶卹卻卼卽卾厀厁厃厇厈厊厎厏"],["8580","厐",4,"厖厗厙厛厜厞厠厡厤厧厪厫厬厭厯",6,"厷厸厹厺厼厽厾叀參",4,"収叏叐叒叓叕叚叜叝叞叡叢叧叴叺叾叿吀吂吅吇吋吔吘吙吚吜吢吤吥吪吰吳吶吷吺吽吿呁呂呄呅呇呉呌呍呎呏呑呚呝",4,"呣呥呧呩",7,"呴呹呺呾呿咁咃咅咇咈咉咊咍咑咓咗咘咜咞咟咠咡"],["8640","咢咥咮咰咲咵咶咷咹咺咼咾哃哅哊哋哖哘哛哠",4,"哫哬哯哰哱哴",5,"哻哾唀唂唃唄唅唈唊",4,"唒唓唕",5,"唜唝唞唟唡唥唦"],["8680","唨唩唫唭唲唴唵唶唸唹唺唻唽啀啂啅啇啈啋",4,"啑啒啓啔啗",4,"啝啞啟啠啢啣啨啩啫啯",5,"啹啺啽啿喅喆喌喍喎喐喒喓喕喖喗喚喛喞喠",6,"喨",8,"喲喴営喸喺喼喿",4,"嗆嗇嗈嗊嗋嗎嗏嗐嗕嗗",4,"嗞嗠嗢嗧嗩嗭嗮嗰嗱嗴嗶嗸",4,"嗿嘂嘃嘄嘅"],["8740","嘆嘇嘊嘋嘍嘐",7,"嘙嘚嘜嘝嘠嘡嘢嘥嘦嘨嘩嘪嘫嘮嘯嘰嘳嘵嘷嘸嘺嘼嘽嘾噀",11,"噏",4,"噕噖噚噛噝",4],["8780","噣噥噦噧噭噮噯噰噲噳噴噵噷噸噹噺噽",7,"嚇",6,"嚐嚑嚒嚔",14,"嚤",10,"嚰",6,"嚸嚹嚺嚻嚽",12,"囋",8,"囕囖囘囙囜団囥",5,"囬囮囯囲図囶囷囸囻囼圀圁圂圅圇國",6],["8840","園",9,"圝圞圠圡圢圤圥圦圧圫圱圲圴",4,"圼圽圿坁坃坄坅坆坈坉坋坒",4,"坘坙坢坣坥坧坬坮坰坱坲坴坵坸坹坺坽坾坿垀"],["8880","垁垇垈垉垊垍",4,"垔",6,"垜垝垞垟垥垨垪垬垯垰垱垳垵垶垷垹",8,"埄",6,"埌埍埐埑埓埖埗埛埜埞埡埢埣埥",7,"埮埰埱埲埳埵埶執埻埼埾埿堁堃堄堅堈堉堊堌堎堏堐堒堓堔堖堗堘堚堛堜堝堟堢堣堥",4,"堫",4,"報堲堳場堶",7],["8940","堾",5,"塅",6,"塎塏塐塒塓塕塖塗塙",4,"塟",5,"塦",4,"塭",16,"塿墂墄墆墇墈墊墋墌"],["8980","墍",4,"墔",4,"墛墜墝墠",7,"墪",17,"墽墾墿壀壂壃壄壆",10,"壒壓壔壖",13,"壥",5,"壭壯壱売壴壵壷壸壺",7,"夃夅夆夈",4,"夎夐夑夒夓夗夘夛夝夞夠夡夢夣夦夨夬夰夲夳夵夶夻"],["8a40","夽夾夿奀奃奅奆奊奌奍奐奒奓奙奛",4,"奡奣奤奦",12,"奵奷奺奻奼奾奿妀妅妉妋妌妎妏妐妑妔妕妘妚妛妜妝妟妠妡妢妦"],["8a80","妧妬妭妰妱妳",5,"妺妼妽妿",6,"姇姈姉姌姍姎姏姕姖姙姛姞",4,"姤姦姧姩姪姫姭",11,"姺姼姽姾娀娂娊娋娍娎娏娐娒娔娕娖娗娙娚娛娝娞娡娢娤娦娧娨娪",6,"娳娵娷",4,"娽娾娿婁",4,"婇婈婋",9,"婖婗婘婙婛",5],["8b40","婡婣婤婥婦婨婩婫",8,"婸婹婻婼婽婾媀",17,"媓",6,"媜",13,"媫媬"],["8b80","媭",4,"媴媶媷媹",4,"媿嫀嫃",5,"嫊嫋嫍",4,"嫓嫕嫗嫙嫚嫛嫝嫞嫟嫢嫤嫥嫧嫨嫪嫬",4,"嫲",22,"嬊",11,"嬘",25,"嬳嬵嬶嬸",7,"孁",6],["8c40","孈",7,"孒孖孞孠孡孧孨孫孭孮孯孲孴孶孷學孹孻孼孾孿宂宆宊宍宎宐宑宒宔宖実宧宨宩宬宭宮宯宱宲宷宺宻宼寀寁寃寈寉寊寋寍寎寏"],["8c80","寑寔",8,"寠寢寣實寧審",4,"寯寱",6,"寽対尀専尃尅將專尋尌對導尐尒尓尗尙尛尞尟尠尡尣尦尨尩尪尫尭尮尯尰尲尳尵尶尷屃屄屆屇屌屍屒屓屔屖屗屘屚屛屜屝屟屢層屧",6,"屰屲",6,"屻屼屽屾岀岃",4,"岉岊岋岎岏岒岓岕岝",4,"岤",4],["8d40","岪岮岯岰岲岴岶岹岺岻岼岾峀峂峃峅",5,"峌",5,"峓",5,"峚",6,"峢峣峧峩峫峬峮峯峱",9,"峼",4],["8d80","崁崄崅崈",5,"崏",4,"崕崗崘崙崚崜崝崟",4,"崥崨崪崫崬崯",4,"崵",7,"崿",7,"嵈嵉嵍",10,"嵙嵚嵜嵞",10,"嵪嵭嵮嵰嵱嵲嵳嵵",12,"嶃",21,"嶚嶛嶜嶞嶟嶠"],["8e40","嶡",21,"嶸",12,"巆",6,"巎",12,"巜巟巠巣巤巪巬巭"],["8e80","巰巵巶巸",4,"巿帀帄帇帉帊帋帍帎帒帓帗帞",7,"帨",4,"帯帰帲",4,"帹帺帾帿幀幁幃幆",5,"幍",6,"幖",4,"幜幝幟幠幣",14,"幵幷幹幾庁庂広庅庈庉庌庍庎庒庘庛庝庡庢庣庤庨",4,"庮",4,"庴庺庻庼庽庿",6],["8f40","廆廇廈廋",5,"廔廕廗廘廙廚廜",11,"廩廫",8,"廵廸廹廻廼廽弅弆弇弉弌弍弎弐弒弔弖弙弚弜弝弞弡弢弣弤"],["8f80","弨弫弬弮弰弲",6,"弻弽弾弿彁",14,"彑彔彙彚彛彜彞彟彠彣彥彧彨彫彮彯彲彴彵彶彸彺彽彾彿徃徆徍徎徏徑従徔徖徚徛徝從徟徠徢",5,"復徫徬徯",5,"徶徸徹徺徻徾",4,"忇忈忊忋忎忓忔忕忚忛応忞忟忢忣忥忦忨忩忬忯忰忲忳忴忶忷忹忺忼怇"],["9040","怈怉怋怌怐怑怓怗怘怚怞怟怢怣怤怬怭怮怰",4,"怶",4,"怽怾恀恄",6,"恌恎恏恑恓恔恖恗恘恛恜恞恟恠恡恥恦恮恱恲恴恵恷恾悀"],["9080","悁悂悅悆悇悈悊悋悎悏悐悑悓悕悗悘悙悜悞悡悢悤悥悧悩悪悮悰悳悵悶悷悹悺悽",7,"惇惈惉惌",4,"惒惓惔惖惗惙惛惞惡",4,"惪惱惲惵惷惸惻",4,"愂愃愄愅愇愊愋愌愐",4,"愖愗愘愙愛愜愝愞愡愢愥愨愩愪愬",18,"慀",6],["9140","慇慉態慍慏慐慒慓慔慖",6,"慞慟慠慡慣慤慥慦慩",6,"慱慲慳慴慶慸",18,"憌憍憏",4,"憕"],["9180","憖",6,"憞",8,"憪憫憭",9,"憸",5,"憿懀懁懃",4,"應懌",4,"懓懕",16,"懧",13,"懶",8,"戀",5,"戇戉戓戔戙戜戝戞戠戣戦戧戨戩戫戭戯戰戱戲戵戶戸",4,"扂扄扅扆扊"],["9240","扏扐払扖扗扙扚扜",6,"扤扥扨扱扲扴扵扷扸扺扻扽抁抂抃抅抆抇抈抋",5,"抔抙抜抝択抣抦抧抩抪抭抮抯抰抲抳抴抶抷抸抺抾拀拁"],["9280","拃拋拏拑拕拝拞拠拡拤拪拫拰拲拵拸拹拺拻挀挃挄挅挆挊挋挌挍挏挐挒挓挔挕挗挘挙挜挦挧挩挬挭挮挰挱挳",5,"挻挼挾挿捀捁捄捇捈捊捑捒捓捔捖",7,"捠捤捥捦捨捪捫捬捯捰捲捳捴捵捸捹捼捽捾捿掁掃掄掅掆掋掍掑掓掔掕掗掙",6,"採掤掦掫掯掱掲掵掶掹掻掽掿揀"],["9340","揁揂揃揅揇揈揊揋揌揑揓揔揕揗",6,"揟揢揤",4,"揫揬揮揯揰揱揳揵揷揹揺揻揼揾搃搄搆",4,"損搎搑搒搕",5,"搝搟搢搣搤"],["9380","搥搧搨搩搫搮",5,"搵",4,"搻搼搾摀摂摃摉摋",6,"摓摕摖摗摙",4,"摟",7,"摨摪摫摬摮",9,"摻",6,"撃撆撈",8,"撓撔撗撘撚撛撜撝撟",4,"撥撦撧撨撪撫撯撱撲撳撴撶撹撻撽撾撿擁擃擄擆",6,"擏擑擓擔擕擖擙據"],["9440","擛擜擝擟擠擡擣擥擧",24,"攁",7,"攊",7,"攓",4,"攙",8],["9480","攢攣攤攦",4,"攬攭攰攱攲攳攷攺攼攽敀",4,"敆敇敊敋敍敎敐敒敓敔敗敘敚敜敟敠敡敤敥敧敨敩敪敭敮敯敱敳敵敶數",14,"斈斉斊斍斎斏斒斔斕斖斘斚斝斞斠斢斣斦斨斪斬斮斱",7,"斺斻斾斿旀旂旇旈旉旊旍旐旑旓旔旕旘",7,"旡旣旤旪旫"],["9540","旲旳旴旵旸旹旻",4,"昁昄昅昇昈昉昋昍昐昑昒昖昗昘昚昛昜昞昡昢昣昤昦昩昪昫昬昮昰昲昳昷",4,"昽昿晀時晄",6,"晍晎晐晑晘"],["9580","晙晛晜晝晞晠晢晣晥晧晩",4,"晱晲晳晵晸晹晻晼晽晿暀暁暃暅暆暈暉暊暋暍暎暏暐暒暓暔暕暘",4,"暞",8,"暩",4,"暯",4,"暵暶暷暸暺暻暼暽暿",25,"曚曞",7,"曧曨曪",5,"曱曵曶書曺曻曽朁朂會"],["9640","朄朅朆朇朌朎朏朑朒朓朖朘朙朚朜朞朠",5,"朧朩朮朰朲朳朶朷朸朹朻朼朾朿杁杄杅杇杊杋杍杒杔杕杗",4,"杝杢杣杤杦杧杫杬杮東杴杶"],["9680","杸杹杺杻杽枀枂枃枅枆枈枊枌枍枎枏枑枒枓枔枖枙枛枟枠枡枤枦枩枬枮枱枲枴枹",7,"柂柅",9,"柕柖柗柛柟柡柣柤柦柧柨柪柫柭柮柲柵",7,"柾栁栂栃栄栆栍栐栒栔栕栘",4,"栞栟栠栢",6,"栫",6,"栴栵栶栺栻栿桇桋桍桏桒桖",5],["9740","桜桝桞桟桪桬",7,"桵桸",8,"梂梄梇",7,"梐梑梒梔梕梖梘",9,"梣梤梥梩梪梫梬梮梱梲梴梶梷梸"],["9780","梹",6,"棁棃",5,"棊棌棎棏棐棑棓棔棖棗棙棛",4,"棡棢棤",9,"棯棲棳棴棶棷棸棻棽棾棿椀椂椃椄椆",4,"椌椏椑椓",11,"椡椢椣椥",7,"椮椯椱椲椳椵椶椷椸椺椻椼椾楀楁楃",16,"楕楖楘楙楛楜楟"],["9840","楡楢楤楥楧楨楩楪楬業楯楰楲",4,"楺楻楽楾楿榁榃榅榊榋榌榎",5,"榖榗榙榚榝",9,"榩榪榬榮榯榰榲榳榵榶榸榹榺榼榽"],["9880","榾榿槀槂",7,"構槍槏槑槒槓槕",5,"槜槝槞槡",11,"槮槯槰槱槳",9,"槾樀",9,"樋",11,"標",5,"樠樢",5,"権樫樬樭樮樰樲樳樴樶",6,"樿",4,"橅橆橈",7,"橑",6,"橚"],["9940","橜",4,"橢橣橤橦",10,"橲",6,"橺橻橽橾橿檁檂檃檅",8,"檏檒",4,"檘",7,"檡",5],["9980","檧檨檪檭",114,"欥欦欨",6],["9a40","欯欰欱欳欴欵欶欸欻欼欽欿歀歁歂歄歅歈歊歋歍",11,"歚",7,"歨歩歫",13,"歺歽歾歿殀殅殈"],["9a80","殌殎殏殐殑殔殕殗殘殙殜",4,"殢",7,"殫",7,"殶殸",6,"毀毃毄毆",4,"毌毎毐毑毘毚毜",4,"毢",7,"毬毭毮毰毱毲毴毶毷毸毺毻毼毾",6,"氈",4,"氎氒気氜氝氞氠氣氥氫氬氭氱氳氶氷氹氺氻氼氾氿汃汄汅汈汋",4,"汑汒汓汖汘"],["9b40","汙汚汢汣汥汦汧汫",4,"汱汳汵汷汸決汻汼汿沀沄沇沊沋沍沎沑沒沕沖沗沘沚沜沝沞沠沢沨沬沯沰沴沵沶沷沺泀況泂泃泆泇泈泋泍泎泏泑泒泘"],["9b80","泙泚泜泝泟泤泦泧泩泬泭泲泴泹泿洀洂洃洅洆洈洉洊洍洏洐洑洓洔洕洖洘洜洝洟",5,"洦洨洩洬洭洯洰洴洶洷洸洺洿浀浂浄浉浌浐浕浖浗浘浛浝浟浡浢浤浥浧浨浫浬浭浰浱浲浳浵浶浹浺浻浽",4,"涃涄涆涇涊涋涍涏涐涒涖",4,"涜涢涥涬涭涰涱涳涴涶涷涹",5,"淁淂淃淈淉淊"],["9c40","淍淎淏淐淒淓淔淕淗淚淛淜淟淢淣淥淧淨淩淪淭淯淰淲淴淵淶淸淺淽",7,"渆渇済渉渋渏渒渓渕渘渙減渜渞渟渢渦渧渨渪測渮渰渱渳渵"],["9c80","渶渷渹渻",7,"湅",7,"湏湐湑湒湕湗湙湚湜湝湞湠",10,"湬湭湯",14,"満溁溂溄溇溈溊",4,"溑",6,"溙溚溛溝溞溠溡溣溤溦溨溩溫溬溭溮溰溳溵溸溹溼溾溿滀滃滄滅滆滈滉滊滌滍滎滐滒滖滘滙滛滜滝滣滧滪",5],["9d40","滰滱滲滳滵滶滷滸滺",7,"漃漄漅漇漈漊",4,"漐漑漒漖",9,"漡漢漣漥漦漧漨漬漮漰漲漴漵漷",6,"漿潀潁潂"],["9d80","潃潄潅潈潉潊潌潎",9,"潙潚潛潝潟潠潡潣潤潥潧",5,"潯潰潱潳潵潶潷潹潻潽",6,"澅澆澇澊澋澏",12,"澝澞澟澠澢",4,"澨",10,"澴澵澷澸澺",5,"濁濃",5,"濊",6,"濓",10,"濟濢濣濤濥"],["9e40","濦",7,"濰",32,"瀒",7,"瀜",6,"瀤",6],["9e80","瀫",9,"瀶瀷瀸瀺",17,"灍灎灐",13,"灟",11,"灮灱灲灳灴灷灹灺灻災炁炂炃炄炆炇炈炋炌炍炏炐炑炓炗炘炚炛炞",12,"炰炲炴炵炶為炾炿烄烅烆烇烉烋",12,"烚"],["9f40","烜烝烞烠烡烢烣烥烪烮烰",6,"烸烺烻烼烾",10,"焋",4,"焑焒焔焗焛",10,"焧",7,"焲焳焴"],["9f80","焵焷",13,"煆煇煈煉煋煍煏",12,"煝煟",4,"煥煩",4,"煯煰煱煴煵煶煷煹煻煼煾",5,"熅",4,"熋熌熍熎熐熑熒熓熕熖熗熚",4,"熡",6,"熩熪熫熭",5,"熴熶熷熸熺",8,"燄",9,"燏",4],["a040","燖",9,"燡燢燣燤燦燨",5,"燯",9,"燺",11,"爇",19],["a080","爛爜爞",9,"爩爫爭爮爯爲爳爴爺爼爾牀",6,"牉牊牋牎牏牐牑牓牔牕牗牘牚牜牞牠牣牤牥牨牪牫牬牭牰牱牳牴牶牷牸牻牼牽犂犃犅",4,"犌犎犐犑犓",11,"犠",11,"犮犱犲犳犵犺",6,"狅狆狇狉狊狋狌狏狑狓狔狕狖狘狚狛"],["a1a1"," 、。·ˉˇ¨〃々—~‖…‘’“”〔〕〈",7,"〖〗【】±×÷∶∧∨∑∏∪∩∈∷√⊥∥∠⌒⊙∫∮≡≌≈∽∝≠≮≯≤≥∞∵∴♂♀°′″℃$¤¢£‰§№☆★○●◎◇◆□■△▲※→←↑↓〓"],["a2a1","ⅰ",9],["a2b1","⒈",19,"⑴",19,"①",9],["a2e5","㈠",9],["a2f1","Ⅰ",11],["a3a1","!"#¥%",88," ̄"],["a4a1","ぁ",82],["a5a1","ァ",85],["a6a1","Α",16,"Σ",6],["a6c1","α",16,"σ",6],["a6e0","︵︶︹︺︿﹀︽︾﹁﹂﹃﹄"],["a6ee","︻︼︷︸︱"],["a6f4","︳︴"],["a7a1","А",5,"ЁЖ",25],["a7d1","а",5,"ёж",25],["a840","ˊˋ˙–―‥‵℅℉↖↗↘↙∕∟∣≒≦≧⊿═",35,"▁",6],["a880","█",7,"▓▔▕▼▽◢◣◤◥☉⊕〒〝〞"],["a8a1","āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜüêɑ"],["a8bd","ńň"],["a8c0","ɡ"],["a8c5","ㄅ",36],["a940","〡",8,"㊣㎎㎏㎜㎝㎞㎡㏄㏎㏑㏒㏕︰¬¦"],["a959","℡㈱"],["a95c","‐"],["a960","ー゛゜ヽヾ〆ゝゞ﹉",9,"﹔﹕﹖﹗﹙",8],["a980","﹢",4,"﹨﹩﹪﹫"],["a996","〇"],["a9a4","─",75],["aa40","狜狝狟狢",5,"狪狫狵狶狹狽狾狿猀猂猄",5,"猋猌猍猏猐猑猒猔猘猙猚猟猠猣猤猦猧猨猭猯猰猲猳猵猶猺猻猼猽獀",8],["aa80","獉獊獋獌獎獏獑獓獔獕獖獘",7,"獡",10,"獮獰獱"],["ab40","獲",11,"獿",4,"玅玆玈玊玌玍玏玐玒玓玔玕玗玘玙玚玜玝玞玠玡玣",5,"玪玬玭玱玴玵玶玸玹玼玽玾玿珁珃",4],["ab80","珋珌珎珒",6,"珚珛珜珝珟珡珢珣珤珦珨珪珫珬珮珯珰珱珳",4],["ac40","珸",10,"琄琇琈琋琌琍琎琑",8,"琜",5,"琣琤琧琩琫琭琯琱琲琷",4,"琽琾琿瑀瑂",11],["ac80","瑎",6,"瑖瑘瑝瑠",12,"瑮瑯瑱",4,"瑸瑹瑺"],["ad40","瑻瑼瑽瑿璂璄璅璆璈璉璊璌璍璏璑",10,"璝璟",7,"璪",15,"璻",12],["ad80","瓈",9,"瓓",8,"瓝瓟瓡瓥瓧",6,"瓰瓱瓲"],["ae40","瓳瓵瓸",6,"甀甁甂甃甅",7,"甎甐甒甔甕甖甗甛甝甞甠",4,"甦甧甪甮甴甶甹甼甽甿畁畂畃畄畆畇畉畊畍畐畑畒畓畕畖畗畘"],["ae80","畝",7,"畧畨畩畫",6,"畳畵當畷畺",4,"疀疁疂疄疅疇"],["af40","疈疉疊疌疍疎疐疓疕疘疛疜疞疢疦",4,"疭疶疷疺疻疿痀痁痆痋痌痎痏痐痑痓痗痙痚痜痝痟痠痡痥痩痬痭痮痯痲痳痵痶痷痸痺痻痽痾瘂瘄瘆瘇"],["af80","瘈瘉瘋瘍瘎瘏瘑瘒瘓瘔瘖瘚瘜瘝瘞瘡瘣瘧瘨瘬瘮瘯瘱瘲瘶瘷瘹瘺瘻瘽癁療癄"],["b040","癅",6,"癎",5,"癕癗",4,"癝癟癠癡癢癤",6,"癬癭癮癰",7,"癹発發癿皀皁皃皅皉皊皌皍皏皐皒皔皕皗皘皚皛"],["b080","皜",7,"皥",8,"皯皰皳皵",9,"盀盁盃啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥"],["b140","盄盇盉盋盌盓盕盙盚盜盝盞盠",4,"盦",7,"盰盳盵盶盷盺盻盽盿眀眂眃眅眆眊県眎",10,"眛眜眝眞眡眣眤眥眧眪眫"],["b180","眬眮眰",4,"眹眻眽眾眿睂睄睅睆睈",7,"睒",7,"睜薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳"],["b240","睝睞睟睠睤睧睩睪睭",11,"睺睻睼瞁瞂瞃瞆",5,"瞏瞐瞓",11,"瞡瞣瞤瞦瞨瞫瞭瞮瞯瞱瞲瞴瞶",4],["b280","瞼瞾矀",12,"矎",8,"矘矙矚矝",4,"矤病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖"],["b340","矦矨矪矯矰矱矲矴矵矷矹矺矻矼砃",5,"砊砋砎砏砐砓砕砙砛砞砠砡砢砤砨砪砫砮砯砱砲砳砵砶砽砿硁硂硃硄硆硈硉硊硋硍硏硑硓硔硘硙硚"],["b380","硛硜硞",11,"硯",7,"硸硹硺硻硽",6,"场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚"],["b440","碄碅碆碈碊碋碏碐碒碔碕碖碙碝碞碠碢碤碦碨",7,"碵碶碷碸確碻碼碽碿磀磂磃磄磆磇磈磌磍磎磏磑磒磓磖磗磘磚",9],["b480","磤磥磦磧磩磪磫磭",4,"磳磵磶磸磹磻",5,"礂礃礄礆",6,"础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮"],["b540","礍",5,"礔",9,"礟",4,"礥",14,"礵",4,"礽礿祂祃祄祅祇祊",8,"祔祕祘祙祡祣"],["b580","祤祦祩祪祫祬祮祰",6,"祹祻",4,"禂禃禆禇禈禉禋禌禍禎禐禑禒怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠"],["b640","禓",6,"禛",11,"禨",10,"禴",4,"禼禿秂秄秅秇秈秊秌秎秏秐秓秔秖秗秙",5,"秠秡秢秥秨秪"],["b680","秬秮秱",6,"秹秺秼秾秿稁稄稅稇稈稉稊稌稏",4,"稕稖稘稙稛稜丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二"],["b740","稝稟稡稢稤",14,"稴稵稶稸稺稾穀",5,"穇",9,"穒",4,"穘",16],["b780","穩",6,"穱穲穳穵穻穼穽穾窂窅窇窉窊窋窌窎窏窐窓窔窙窚窛窞窡窢贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服"],["b840","窣窤窧窩窪窫窮",4,"窴",10,"竀",10,"竌",9,"竗竘竚竛竜竝竡竢竤竧",5,"竮竰竱竲竳"],["b880","竴",4,"竻竼竾笀笁笂笅笇笉笌笍笎笐笒笓笖笗笘笚笜笝笟笡笢笣笧笩笭浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹"],["b940","笯笰笲笴笵笶笷笹笻笽笿",5,"筆筈筊筍筎筓筕筗筙筜筞筟筡筣",10,"筯筰筳筴筶筸筺筼筽筿箁箂箃箄箆",6,"箎箏"],["b980","箑箒箓箖箘箙箚箛箞箟箠箣箤箥箮箯箰箲箳箵箶箷箹",7,"篂篃範埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈"],["ba40","篅篈築篊篋篍篎篏篐篒篔",4,"篛篜篞篟篠篢篣篤篧篨篩篫篬篭篯篰篲",4,"篸篹篺篻篽篿",7,"簈簉簊簍簎簐",5,"簗簘簙"],["ba80","簚",4,"簠",5,"簨簩簫",12,"簹",5,"籂骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖"],["bb40","籃",9,"籎",36,"籵",5,"籾",9],["bb80","粈粊",6,"粓粔粖粙粚粛粠粡粣粦粧粨粩粫粬粭粯粰粴",4,"粺粻弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕"],["bc40","粿糀糂糃糄糆糉糋糎",6,"糘糚糛糝糞糡",6,"糩",5,"糰",7,"糹糺糼",13,"紋",5],["bc80","紑",14,"紡紣紤紥紦紨紩紪紬紭紮細",6,"肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件"],["bd40","紷",54,"絯",7],["bd80","絸",32,"健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸"],["be40","継",12,"綧",6,"綯",42],["be80","線",32,"尽劲荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵觉决诀绝均菌钧军君峻"],["bf40","緻",62],["bf80","縺縼",4,"繂",4,"繈",21,"俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀"],["c040","繞",35,"纃",23,"纜纝纞"],["c080","纮纴纻纼绖绤绬绹缊缐缞缷缹缻",6,"罃罆",9,"罒罓馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐"],["c140","罖罙罛罜罝罞罠罣",4,"罫罬罭罯罰罳罵罶罷罸罺罻罼罽罿羀羂",7,"羋羍羏",4,"羕",4,"羛羜羠羢羣羥羦羨",6,"羱"],["c180","羳",4,"羺羻羾翀翂翃翄翆翇翈翉翋翍翏",4,"翖翗翙",5,"翢翣痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿"],["c240","翤翧翨翪翫翬翭翯翲翴",6,"翽翾翿耂耇耈耉耊耎耏耑耓耚耛耝耞耟耡耣耤耫",5,"耲耴耹耺耼耾聀聁聄聅聇聈聉聎聏聐聑聓聕聖聗"],["c280","聙聛",13,"聫",5,"聲",11,"隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫"],["c340","聾肁肂肅肈肊肍",5,"肔肕肗肙肞肣肦肧肨肬肰肳肵肶肸肹肻胅胇",4,"胏",6,"胘胟胠胢胣胦胮胵胷胹胻胾胿脀脁脃脄脅脇脈脋"],["c380","脌脕脗脙脛脜脝脟",12,"脭脮脰脳脴脵脷脹",4,"脿谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸"],["c440","腀",5,"腇腉腍腎腏腒腖腗腘腛",4,"腡腢腣腤腦腨腪腫腬腯腲腳腵腶腷腸膁膃",4,"膉膋膌膍膎膐膒",5,"膙膚膞",4,"膤膥"],["c480","膧膩膫",7,"膴",5,"膼膽膾膿臄臅臇臈臉臋臍",6,"摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁"],["c540","臔",14,"臤臥臦臨臩臫臮",4,"臵",5,"臽臿舃與",4,"舎舏舑舓舕",5,"舝舠舤舥舦舧舩舮舲舺舼舽舿"],["c580","艀艁艂艃艅艆艈艊艌艍艎艐",7,"艙艛艜艝艞艠",7,"艩拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗"],["c640","艪艫艬艭艱艵艶艷艸艻艼芀芁芃芅芆芇芉芌芐芓芔芕芖芚芛芞芠芢芣芧芲芵芶芺芻芼芿苀苂苃苅苆苉苐苖苙苚苝苢苧苨苩苪苬苭苮苰苲苳苵苶苸"],["c680","苺苼",4,"茊茋茍茐茒茓茖茘茙茝",9,"茩茪茮茰茲茷茻茽啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐"],["c740","茾茿荁荂荄荅荈荊",4,"荓荕",4,"荝荢荰",6,"荹荺荾",6,"莇莈莊莋莌莍莏莐莑莔莕莖莗莙莚莝莟莡",6,"莬莭莮"],["c780","莯莵莻莾莿菂菃菄菆菈菉菋菍菎菐菑菒菓菕菗菙菚菛菞菢菣菤菦菧菨菫菬菭恰洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠"],["c840","菮華菳",4,"菺菻菼菾菿萀萂萅萇萈萉萊萐萒",5,"萙萚萛萞",5,"萩",7,"萲",5,"萹萺萻萾",7,"葇葈葉"],["c880","葊",6,"葒",4,"葘葝葞葟葠葢葤",4,"葪葮葯葰葲葴葷葹葻葼取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁"],["c940","葽",4,"蒃蒄蒅蒆蒊蒍蒏",7,"蒘蒚蒛蒝蒞蒟蒠蒢",12,"蒰蒱蒳蒵蒶蒷蒻蒼蒾蓀蓂蓃蓅蓆蓇蓈蓋蓌蓎蓏蓒蓔蓕蓗"],["c980","蓘",4,"蓞蓡蓢蓤蓧",4,"蓭蓮蓯蓱",10,"蓽蓾蔀蔁蔂伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳"],["ca40","蔃",8,"蔍蔎蔏蔐蔒蔔蔕蔖蔘蔙蔛蔜蔝蔞蔠蔢",8,"蔭",9,"蔾",4,"蕄蕅蕆蕇蕋",10],["ca80","蕗蕘蕚蕛蕜蕝蕟",4,"蕥蕦蕧蕩",8,"蕳蕵蕶蕷蕸蕼蕽蕿薀薁省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱"],["cb40","薂薃薆薈",6,"薐",10,"薝",6,"薥薦薧薩薫薬薭薱",5,"薸薺",6,"藂",6,"藊",4,"藑藒"],["cb80","藔藖",5,"藝",6,"藥藦藧藨藪",14,"恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔"],["cc40","藹藺藼藽藾蘀",4,"蘆",10,"蘒蘓蘔蘕蘗",15,"蘨蘪",13,"蘹蘺蘻蘽蘾蘿虀"],["cc80","虁",11,"虒虓處",4,"虛虜虝號虠虡虣",7,"獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃"],["cd40","虭虯虰虲",6,"蚃",6,"蚎",4,"蚔蚖",5,"蚞",4,"蚥蚦蚫蚭蚮蚲蚳蚷蚸蚹蚻",4,"蛁蛂蛃蛅蛈蛌蛍蛒蛓蛕蛖蛗蛚蛜"],["cd80","蛝蛠蛡蛢蛣蛥蛦蛧蛨蛪蛫蛬蛯蛵蛶蛷蛺蛻蛼蛽蛿蜁蜄蜅蜆蜋蜌蜎蜏蜐蜑蜔蜖汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威"],["ce40","蜙蜛蜝蜟蜠蜤蜦蜧蜨蜪蜫蜬蜭蜯蜰蜲蜳蜵蜶蜸蜹蜺蜼蜽蝀",6,"蝊蝋蝍蝏蝐蝑蝒蝔蝕蝖蝘蝚",5,"蝡蝢蝦",7,"蝯蝱蝲蝳蝵"],["ce80","蝷蝸蝹蝺蝿螀螁螄螆螇螉螊螌螎",4,"螔螕螖螘",6,"螠",4,"巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺"],["cf40","螥螦螧螩螪螮螰螱螲螴螶螷螸螹螻螼螾螿蟁",4,"蟇蟈蟉蟌",4,"蟔",6,"蟜蟝蟞蟟蟡蟢蟣蟤蟦蟧蟨蟩蟫蟬蟭蟯",9],["cf80","蟺蟻蟼蟽蟿蠀蠁蠂蠄",5,"蠋",7,"蠔蠗蠘蠙蠚蠜",4,"蠣稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓"],["d040","蠤",13,"蠳",5,"蠺蠻蠽蠾蠿衁衂衃衆",5,"衎",5,"衕衖衘衚",6,"衦衧衪衭衯衱衳衴衵衶衸衹衺"],["d080","衻衼袀袃袆袇袉袊袌袎袏袐袑袓袔袕袗",4,"袝",4,"袣袥",5,"小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄"],["d140","袬袮袯袰袲",4,"袸袹袺袻袽袾袿裀裃裄裇裈裊裋裌裍裏裐裑裓裖裗裚",4,"裠裡裦裧裩",6,"裲裵裶裷裺裻製裿褀褁褃",5],["d180","褉褋",4,"褑褔",4,"褜",4,"褢褣褤褦褧褨褩褬褭褮褯褱褲褳褵褷选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶"],["d240","褸",8,"襂襃襅",24,"襠",5,"襧",19,"襼"],["d280","襽襾覀覂覄覅覇",26,"摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐"],["d340","覢",30,"觃觍觓觔觕觗觘觙觛觝觟觠觡觢觤觧觨觩觪觬觭觮觰觱觲觴",6],["d380","觻",4,"訁",5,"計",21,"印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉"],["d440","訞",31,"訿",8,"詉",21],["d480","詟",25,"詺",6,"浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧"],["d540","誁",7,"誋",7,"誔",46],["d580","諃",32,"铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政"],["d640","諤",34,"謈",27],["d680","謤謥謧",30,"帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑"],["d740","譆",31,"譧",4,"譭",25],["d780","讇",24,"讬讱讻诇诐诪谉谞住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座"],["d840","谸",8,"豂豃豄豅豈豊豋豍",7,"豖豗豘豙豛",5,"豣",6,"豬",6,"豴豵豶豷豻",6,"貃貄貆貇"],["d880","貈貋貍",6,"貕貖貗貙",20,"亍丌兀丐廿卅丕亘丞鬲孬噩丨禺丿匕乇夭爻卮氐囟胤馗毓睾鼗丶亟鼐乜乩亓芈孛啬嘏仄厍厝厣厥厮靥赝匚叵匦匮匾赜卦卣刂刈刎刭刳刿剀剌剞剡剜蒯剽劂劁劐劓冂罔亻仃仉仂仨仡仫仞伛仳伢佤仵伥伧伉伫佞佧攸佚佝"],["d940","貮",62],["d980","賭",32,"佟佗伲伽佶佴侑侉侃侏佾佻侪佼侬侔俦俨俪俅俚俣俜俑俟俸倩偌俳倬倏倮倭俾倜倌倥倨偾偃偕偈偎偬偻傥傧傩傺僖儆僭僬僦僮儇儋仝氽佘佥俎龠汆籴兮巽黉馘冁夔勹匍訇匐凫夙兕亠兖亳衮袤亵脔裒禀嬴蠃羸冫冱冽冼"],["da40","贎",14,"贠赑赒赗赟赥赨赩赪赬赮赯赱赲赸",8,"趂趃趆趇趈趉趌",4,"趒趓趕",9,"趠趡"],["da80","趢趤",12,"趲趶趷趹趻趽跀跁跂跅跇跈跉跊跍跐跒跓跔凇冖冢冥讠讦讧讪讴讵讷诂诃诋诏诎诒诓诔诖诘诙诜诟诠诤诨诩诮诰诳诶诹诼诿谀谂谄谇谌谏谑谒谔谕谖谙谛谘谝谟谠谡谥谧谪谫谮谯谲谳谵谶卩卺阝阢阡阱阪阽阼陂陉陔陟陧陬陲陴隈隍隗隰邗邛邝邙邬邡邴邳邶邺"],["db40","跕跘跙跜跠跡跢跥跦跧跩跭跮跰跱跲跴跶跼跾",6,"踆踇踈踋踍踎踐踑踒踓踕",7,"踠踡踤",4,"踫踭踰踲踳踴踶踷踸踻踼踾"],["db80","踿蹃蹅蹆蹌",4,"蹓",5,"蹚",11,"蹧蹨蹪蹫蹮蹱邸邰郏郅邾郐郄郇郓郦郢郜郗郛郫郯郾鄄鄢鄞鄣鄱鄯鄹酃酆刍奂劢劬劭劾哿勐勖勰叟燮矍廴凵凼鬯厶弁畚巯坌垩垡塾墼壅壑圩圬圪圳圹圮圯坜圻坂坩垅坫垆坼坻坨坭坶坳垭垤垌垲埏垧垴垓垠埕埘埚埙埒垸埴埯埸埤埝"],["dc40","蹳蹵蹷",4,"蹽蹾躀躂躃躄躆躈",6,"躑躒躓躕",6,"躝躟",11,"躭躮躰躱躳",6,"躻",7],["dc80","軃",10,"軏",21,"堋堍埽埭堀堞堙塄堠塥塬墁墉墚墀馨鼙懿艹艽艿芏芊芨芄芎芑芗芙芫芸芾芰苈苊苣芘芷芮苋苌苁芩芴芡芪芟苄苎芤苡茉苷苤茏茇苜苴苒苘茌苻苓茑茚茆茔茕苠苕茜荑荛荜茈莒茼茴茱莛荞茯荏荇荃荟荀茗荠茭茺茳荦荥"],["dd40","軥",62],["dd80","輤",32,"荨茛荩荬荪荭荮莰荸莳莴莠莪莓莜莅荼莶莩荽莸荻莘莞莨莺莼菁萁菥菘堇萘萋菝菽菖萜萸萑萆菔菟萏萃菸菹菪菅菀萦菰菡葜葑葚葙葳蒇蒈葺蒉葸萼葆葩葶蒌蒎萱葭蓁蓍蓐蓦蒽蓓蓊蒿蒺蓠蒡蒹蒴蒗蓥蓣蔌甍蔸蓰蔹蔟蔺"],["de40","轅",32,"轪辀辌辒辝辠辡辢辤辥辦辧辪辬辭辮辯農辳辴辵辷辸辺辻込辿迀迃迆"],["de80","迉",4,"迏迒迖迗迚迠迡迣迧迬迯迱迲迴迵迶迺迻迼迾迿逇逈逌逎逓逕逘蕖蔻蓿蓼蕙蕈蕨蕤蕞蕺瞢蕃蕲蕻薤薨薇薏蕹薮薜薅薹薷薰藓藁藜藿蘧蘅蘩蘖蘼廾弈夼奁耷奕奚奘匏尢尥尬尴扌扪抟抻拊拚拗拮挢拶挹捋捃掭揶捱捺掎掴捭掬掊捩掮掼揲揸揠揿揄揞揎摒揆掾摅摁搋搛搠搌搦搡摞撄摭撖"],["df40","這逜連逤逥逧",5,"逰",4,"逷逹逺逽逿遀遃遅遆遈",4,"過達違遖遙遚遜",5,"遤遦遧適遪遫遬遯",4,"遶",6,"遾邁"],["df80","還邅邆邇邉邊邌",4,"邒邔邖邘邚邜邞邟邠邤邥邧邨邩邫邭邲邷邼邽邿郀摺撷撸撙撺擀擐擗擤擢攉攥攮弋忒甙弑卟叱叽叩叨叻吒吖吆呋呒呓呔呖呃吡呗呙吣吲咂咔呷呱呤咚咛咄呶呦咝哐咭哂咴哒咧咦哓哔呲咣哕咻咿哌哙哚哜咩咪咤哝哏哞唛哧唠哽唔哳唢唣唏唑唧唪啧喏喵啉啭啁啕唿啐唼"],["e040","郂郃郆郈郉郋郌郍郒郔郕郖郘郙郚郞郟郠郣郤郥郩郪郬郮郰郱郲郳郵郶郷郹郺郻郼郿鄀鄁鄃鄅",19,"鄚鄛鄜"],["e080","鄝鄟鄠鄡鄤",10,"鄰鄲",6,"鄺",8,"酄唷啖啵啶啷唳唰啜喋嗒喃喱喹喈喁喟啾嗖喑啻嗟喽喾喔喙嗪嗷嗉嘟嗑嗫嗬嗔嗦嗝嗄嗯嗥嗲嗳嗌嗍嗨嗵嗤辔嘞嘈嘌嘁嘤嘣嗾嘀嘧嘭噘嘹噗嘬噍噢噙噜噌噔嚆噤噱噫噻噼嚅嚓嚯囔囗囝囡囵囫囹囿圄圊圉圜帏帙帔帑帱帻帼"],["e140","酅酇酈酑酓酔酕酖酘酙酛酜酟酠酦酧酨酫酭酳酺酻酼醀",4,"醆醈醊醎醏醓",6,"醜",5,"醤",5,"醫醬醰醱醲醳醶醷醸醹醻"],["e180","醼",10,"釈釋釐釒",9,"針",8,"帷幄幔幛幞幡岌屺岍岐岖岈岘岙岑岚岜岵岢岽岬岫岱岣峁岷峄峒峤峋峥崂崃崧崦崮崤崞崆崛嵘崾崴崽嵬嵛嵯嵝嵫嵋嵊嵩嵴嶂嶙嶝豳嶷巅彳彷徂徇徉後徕徙徜徨徭徵徼衢彡犭犰犴犷犸狃狁狎狍狒狨狯狩狲狴狷猁狳猃狺"],["e240","釦",62],["e280","鈥",32,"狻猗猓猡猊猞猝猕猢猹猥猬猸猱獐獍獗獠獬獯獾舛夥飧夤夂饣饧",5,"饴饷饽馀馄馇馊馍馐馑馓馔馕庀庑庋庖庥庠庹庵庾庳赓廒廑廛廨廪膺忄忉忖忏怃忮怄忡忤忾怅怆忪忭忸怙怵怦怛怏怍怩怫怊怿怡恸恹恻恺恂"],["e340","鉆",45,"鉵",16],["e380","銆",7,"銏",24,"恪恽悖悚悭悝悃悒悌悛惬悻悱惝惘惆惚悴愠愦愕愣惴愀愎愫慊慵憬憔憧憷懔懵忝隳闩闫闱闳闵闶闼闾阃阄阆阈阊阋阌阍阏阒阕阖阗阙阚丬爿戕氵汔汜汊沣沅沐沔沌汨汩汴汶沆沩泐泔沭泷泸泱泗沲泠泖泺泫泮沱泓泯泾"],["e440","銨",5,"銯",24,"鋉",31],["e480","鋩",32,"洹洧洌浃浈洇洄洙洎洫浍洮洵洚浏浒浔洳涑浯涞涠浞涓涔浜浠浼浣渚淇淅淞渎涿淠渑淦淝淙渖涫渌涮渫湮湎湫溲湟溆湓湔渲渥湄滟溱溘滠漭滢溥溧溽溻溷滗溴滏溏滂溟潢潆潇漤漕滹漯漶潋潴漪漉漩澉澍澌潸潲潼潺濑"],["e540","錊",51,"錿",10],["e580","鍊",31,"鍫濉澧澹澶濂濡濮濞濠濯瀚瀣瀛瀹瀵灏灞宀宄宕宓宥宸甯骞搴寤寮褰寰蹇謇辶迓迕迥迮迤迩迦迳迨逅逄逋逦逑逍逖逡逵逶逭逯遄遑遒遐遨遘遢遛暹遴遽邂邈邃邋彐彗彖彘尻咫屐屙孱屣屦羼弪弩弭艴弼鬻屮妁妃妍妩妪妣"],["e640","鍬",34,"鎐",27],["e680","鎬",29,"鏋鏌鏍妗姊妫妞妤姒妲妯姗妾娅娆姝娈姣姘姹娌娉娲娴娑娣娓婀婧婊婕娼婢婵胬媪媛婷婺媾嫫媲嫒嫔媸嫠嫣嫱嫖嫦嫘嫜嬉嬗嬖嬲嬷孀尕尜孚孥孳孑孓孢驵驷驸驺驿驽骀骁骅骈骊骐骒骓骖骘骛骜骝骟骠骢骣骥骧纟纡纣纥纨纩"],["e740","鏎",7,"鏗",54],["e780","鐎",32,"纭纰纾绀绁绂绉绋绌绐绔绗绛绠绡绨绫绮绯绱绲缍绶绺绻绾缁缂缃缇缈缋缌缏缑缒缗缙缜缛缟缡",6,"缪缫缬缭缯",4,"缵幺畿巛甾邕玎玑玮玢玟珏珂珑玷玳珀珉珈珥珙顼琊珩珧珞玺珲琏琪瑛琦琥琨琰琮琬"],["e840","鐯",14,"鐿",43,"鑬鑭鑮鑯"],["e880","鑰",20,"钑钖钘铇铏铓铔铚铦铻锜锠琛琚瑁瑜瑗瑕瑙瑷瑭瑾璜璎璀璁璇璋璞璨璩璐璧瓒璺韪韫韬杌杓杞杈杩枥枇杪杳枘枧杵枨枞枭枋杷杼柰栉柘栊柩枰栌柙枵柚枳柝栀柃枸柢栎柁柽栲栳桠桡桎桢桄桤梃栝桕桦桁桧桀栾桊桉栩梵梏桴桷梓桫棂楮棼椟椠棹"],["e940","锧锳锽镃镈镋镕镚镠镮镴镵長",7,"門",42],["e980","閫",32,"椤棰椋椁楗棣椐楱椹楠楂楝榄楫榀榘楸椴槌榇榈槎榉楦楣楹榛榧榻榫榭槔榱槁槊槟榕槠榍槿樯槭樗樘橥槲橄樾檠橐橛樵檎橹樽樨橘橼檑檐檩檗檫猷獒殁殂殇殄殒殓殍殚殛殡殪轫轭轱轲轳轵轶轸轷轹轺轼轾辁辂辄辇辋"],["ea40","闌",27,"闬闿阇阓阘阛阞阠阣",6,"阫阬阭阯阰阷阸阹阺阾陁陃陊陎陏陑陒陓陖陗"],["ea80","陘陙陚陜陝陞陠陣陥陦陫陭",4,"陳陸",12,"隇隉隊辍辎辏辘辚軎戋戗戛戟戢戡戥戤戬臧瓯瓴瓿甏甑甓攴旮旯旰昊昙杲昃昕昀炅曷昝昴昱昶昵耆晟晔晁晏晖晡晗晷暄暌暧暝暾曛曜曦曩贲贳贶贻贽赀赅赆赈赉赇赍赕赙觇觊觋觌觎觏觐觑牮犟牝牦牯牾牿犄犋犍犏犒挈挲掰"],["eb40","隌階隑隒隓隕隖隚際隝",9,"隨",7,"隱隲隴隵隷隸隺隻隿雂雃雈雊雋雐雑雓雔雖",9,"雡",6,"雫"],["eb80","雬雭雮雰雱雲雴雵雸雺電雼雽雿霂霃霅霊霋霌霐霑霒霔霕霗",4,"霝霟霠搿擘耄毪毳毽毵毹氅氇氆氍氕氘氙氚氡氩氤氪氲攵敕敫牍牒牖爰虢刖肟肜肓肼朊肽肱肫肭肴肷胧胨胩胪胛胂胄胙胍胗朐胝胫胱胴胭脍脎胲胼朕脒豚脶脞脬脘脲腈腌腓腴腙腚腱腠腩腼腽腭腧塍媵膈膂膑滕膣膪臌朦臊膻"],["ec40","霡",8,"霫霬霮霯霱霳",4,"霺霻霼霽霿",18,"靔靕靗靘靚靜靝靟靣靤靦靧靨靪",7],["ec80","靲靵靷",4,"靽",7,"鞆",4,"鞌鞎鞏鞐鞓鞕鞖鞗鞙",4,"臁膦欤欷欹歃歆歙飑飒飓飕飙飚殳彀毂觳斐齑斓於旆旄旃旌旎旒旖炀炜炖炝炻烀炷炫炱烨烊焐焓焖焯焱煳煜煨煅煲煊煸煺熘熳熵熨熠燠燔燧燹爝爨灬焘煦熹戾戽扃扈扉礻祀祆祉祛祜祓祚祢祗祠祯祧祺禅禊禚禧禳忑忐"],["ed40","鞞鞟鞡鞢鞤",6,"鞬鞮鞰鞱鞳鞵",46],["ed80","韤韥韨韮",4,"韴韷",23,"怼恝恚恧恁恙恣悫愆愍慝憩憝懋懑戆肀聿沓泶淼矶矸砀砉砗砘砑斫砭砜砝砹砺砻砟砼砥砬砣砩硎硭硖硗砦硐硇硌硪碛碓碚碇碜碡碣碲碹碥磔磙磉磬磲礅磴礓礤礞礴龛黹黻黼盱眄眍盹眇眈眚眢眙眭眦眵眸睐睑睇睃睚睨"],["ee40","頏",62],["ee80","顎",32,"睢睥睿瞍睽瞀瞌瞑瞟瞠瞰瞵瞽町畀畎畋畈畛畲畹疃罘罡罟詈罨罴罱罹羁罾盍盥蠲钅钆钇钋钊钌钍钏钐钔钗钕钚钛钜钣钤钫钪钭钬钯钰钲钴钶",4,"钼钽钿铄铈",6,"铐铑铒铕铖铗铙铘铛铞铟铠铢铤铥铧铨铪"],["ef40","顯",5,"颋颎颒颕颙颣風",37,"飏飐飔飖飗飛飜飝飠",4],["ef80","飥飦飩",30,"铩铫铮铯铳铴铵铷铹铼铽铿锃锂锆锇锉锊锍锎锏锒",4,"锘锛锝锞锟锢锪锫锩锬锱锲锴锶锷锸锼锾锿镂锵镄镅镆镉镌镎镏镒镓镔镖镗镘镙镛镞镟镝镡镢镤",8,"镯镱镲镳锺矧矬雉秕秭秣秫稆嵇稃稂稞稔"],["f040","餈",4,"餎餏餑",28,"餯",26],["f080","饊",9,"饖",12,"饤饦饳饸饹饻饾馂馃馉稹稷穑黏馥穰皈皎皓皙皤瓞瓠甬鸠鸢鸨",4,"鸲鸱鸶鸸鸷鸹鸺鸾鹁鹂鹄鹆鹇鹈鹉鹋鹌鹎鹑鹕鹗鹚鹛鹜鹞鹣鹦",6,"鹱鹭鹳疒疔疖疠疝疬疣疳疴疸痄疱疰痃痂痖痍痣痨痦痤痫痧瘃痱痼痿瘐瘀瘅瘌瘗瘊瘥瘘瘕瘙"],["f140","馌馎馚",10,"馦馧馩",47],["f180","駙",32,"瘛瘼瘢瘠癀瘭瘰瘿瘵癃瘾瘳癍癞癔癜癖癫癯翊竦穸穹窀窆窈窕窦窠窬窨窭窳衤衩衲衽衿袂袢裆袷袼裉裢裎裣裥裱褚裼裨裾裰褡褙褓褛褊褴褫褶襁襦襻疋胥皲皴矜耒耔耖耜耠耢耥耦耧耩耨耱耋耵聃聆聍聒聩聱覃顸颀颃"],["f240","駺",62],["f280","騹",32,"颉颌颍颏颔颚颛颞颟颡颢颥颦虍虔虬虮虿虺虼虻蚨蚍蚋蚬蚝蚧蚣蚪蚓蚩蚶蛄蚵蛎蚰蚺蚱蚯蛉蛏蚴蛩蛱蛲蛭蛳蛐蜓蛞蛴蛟蛘蛑蜃蜇蛸蜈蜊蜍蜉蜣蜻蜞蜥蜮蜚蜾蝈蜴蜱蜩蜷蜿螂蜢蝽蝾蝻蝠蝰蝌蝮螋蝓蝣蝼蝤蝙蝥螓螯螨蟒"],["f340","驚",17,"驲骃骉骍骎骔骕骙骦骩",6,"骲骳骴骵骹骻骽骾骿髃髄髆",4,"髍髎髏髐髒體髕髖髗髙髚髛髜"],["f380","髝髞髠髢髣髤髥髧髨髩髪髬髮髰",8,"髺髼",6,"鬄鬅鬆蟆螈螅螭螗螃螫蟥螬螵螳蟋蟓螽蟑蟀蟊蟛蟪蟠蟮蠖蠓蟾蠊蠛蠡蠹蠼缶罂罄罅舐竺竽笈笃笄笕笊笫笏筇笸笪笙笮笱笠笥笤笳笾笞筘筚筅筵筌筝筠筮筻筢筲筱箐箦箧箸箬箝箨箅箪箜箢箫箴篑篁篌篝篚篥篦篪簌篾篼簏簖簋"],["f440","鬇鬉",5,"鬐鬑鬒鬔",10,"鬠鬡鬢鬤",10,"鬰鬱鬳",7,"鬽鬾鬿魀魆魊魋魌魎魐魒魓魕",5],["f480","魛",32,"簟簪簦簸籁籀臾舁舂舄臬衄舡舢舣舭舯舨舫舸舻舳舴舾艄艉艋艏艚艟艨衾袅袈裘裟襞羝羟羧羯羰羲籼敉粑粝粜粞粢粲粼粽糁糇糌糍糈糅糗糨艮暨羿翎翕翥翡翦翩翮翳糸絷綦綮繇纛麸麴赳趄趔趑趱赧赭豇豉酊酐酎酏酤"],["f540","魼",62],["f580","鮻",32,"酢酡酰酩酯酽酾酲酴酹醌醅醐醍醑醢醣醪醭醮醯醵醴醺豕鹾趸跫踅蹙蹩趵趿趼趺跄跖跗跚跞跎跏跛跆跬跷跸跣跹跻跤踉跽踔踝踟踬踮踣踯踺蹀踹踵踽踱蹉蹁蹂蹑蹒蹊蹰蹶蹼蹯蹴躅躏躔躐躜躞豸貂貊貅貘貔斛觖觞觚觜"],["f640","鯜",62],["f680","鰛",32,"觥觫觯訾謦靓雩雳雯霆霁霈霏霎霪霭霰霾龀龃龅",5,"龌黾鼋鼍隹隼隽雎雒瞿雠銎銮鋈錾鍪鏊鎏鐾鑫鱿鲂鲅鲆鲇鲈稣鲋鲎鲐鲑鲒鲔鲕鲚鲛鲞",5,"鲥",4,"鲫鲭鲮鲰",7,"鲺鲻鲼鲽鳄鳅鳆鳇鳊鳋"],["f740","鰼",62],["f780","鱻鱽鱾鲀鲃鲄鲉鲊鲌鲏鲓鲖鲗鲘鲙鲝鲪鲬鲯鲹鲾",4,"鳈鳉鳑鳒鳚鳛鳠鳡鳌",4,"鳓鳔鳕鳗鳘鳙鳜鳝鳟鳢靼鞅鞑鞒鞔鞯鞫鞣鞲鞴骱骰骷鹘骶骺骼髁髀髅髂髋髌髑魅魃魇魉魈魍魑飨餍餮饕饔髟髡髦髯髫髻髭髹鬈鬏鬓鬟鬣麽麾縻麂麇麈麋麒鏖麝麟黛黜黝黠黟黢黩黧黥黪黯鼢鼬鼯鼹鼷鼽鼾齄"],["f840","鳣",62],["f880","鴢",32],["f940","鵃",62],["f980","鶂",32],["fa40","鶣",62],["fa80","鷢",32],["fb40","鸃",27,"鸤鸧鸮鸰鸴鸻鸼鹀鹍鹐鹒鹓鹔鹖鹙鹝鹟鹠鹡鹢鹥鹮鹯鹲鹴",9,"麀"],["fb80","麁麃麄麅麆麉麊麌",5,"麔",8,"麞麠",5,"麧麨麩麪"],["fc40","麫",8,"麵麶麷麹麺麼麿",4,"黅黆黇黈黊黋黌黐黒黓黕黖黗黙黚點黡黣黤黦黨黫黬黭黮黰",8,"黺黽黿",6],["fc80","鼆",4,"鼌鼏鼑鼒鼔鼕鼖鼘鼚",5,"鼡鼣",8,"鼭鼮鼰鼱"],["fd40","鼲",4,"鼸鼺鼼鼿",4,"齅",10,"齒",38],["fd80","齹",5,"龁龂龍",11,"龜龝龞龡",4,"郎凉秊裏隣"],["fe40","兀嗀﨎﨏﨑﨓﨔礼﨟蘒﨡﨣﨤﨧﨨﨩"]]')},function(e,t,r){"use strict";(function(e){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ var n=r(8),i=r(9),a=r(10);function o(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function l(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(e).length;default:if(n)return Y(e).length;t=(""+t).toLowerCase(),n=!0}}function b(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,r);case"utf8":case"utf-8":return A(this,t,r);case"ascii":return C(this,t,r);case"latin1":case"binary":return k(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,i);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,i){var a,o=1,s=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,c/=2,r/=2}function f(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var h=-1;for(a=r;as&&(r=s-c),a=r;a>=0;a--){for(var u=!0,d=0;di&&(n=i):n=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function T(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function A(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:f>223?3:f>191?2:1;if(i+u<=r)switch(u){case 1:f<128&&(h=f);break;case 2:128==(192&(a=e[i+1]))&&(c=(31&f)<<6|63&a)>127&&(h=c);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(c=(15&f)<<12|(63&a)<<6|63&o)>2047&&(c<55296||c>57343)&&(h=c);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(c=(15&f)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&c<1114112&&(h=c)}null===h?(h=65533,u=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=u}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},c.prototype.compare=function(e,t,r,n,i){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),f=this.slice(n,i),h=e.slice(t,r),u=0;ui)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return m(this,e,t,r);case"ascii":return _(this,e,t,r);case"latin1":case"binary":return S(this,e,t,r);case"base64":return E(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function C(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",a=t;ar)throw new RangeError("Trying to access beyond buffer length")}function x(e,t,r,n,i,a){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function O(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function N(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function I(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,n,a){return a||I(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function j(e,t,r,n,a){return a||I(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUInt8=function(e,t){return t||P(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||P(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||P(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||P(e,t,this.length);for(var n=this[e],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||P(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},c.prototype.readInt8=function(e,t){return t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||P(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){t||P(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||P(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||P(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||P(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||P(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||x(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a=0&&(a*=256);)this[t+i]=e/a&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):O(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):O(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):N(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);x(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);x(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):O(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):O(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):N(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||x(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return j(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return j(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(a<1e3||!c.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function q(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(M,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function z(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}}).call(this,r(7))},function(e){e.exports=JSON.parse('[["a140","",62],["a180","",32],["a240","",62],["a280","",32],["a2ab","",5],["a2e3","€"],["a2ef",""],["a2fd",""],["a340","",62],["a380","",31," "],["a440","",62],["a480","",32],["a4f4","",10],["a540","",62],["a580","",32],["a5f7","",7],["a640","",62],["a680","",32],["a6b9","",7],["a6d9","",6],["a6ec",""],["a6f3",""],["a6f6","",8],["a740","",62],["a780","",32],["a7c2","",14],["a7f2","",12],["a896","",10],["a8bc","ḿ"],["a8bf","ǹ"],["a8c1",""],["a8ea","",20],["a958",""],["a95b",""],["a95d",""],["a989","〾⿰",11],["a997","",12],["a9f0","",14],["aaa1","",93],["aba1","",93],["aca1","",93],["ada1","",93],["aea1","",93],["afa1","",93],["d7fa","",4],["f8a1","",93],["f9a1","",93],["faa1","",93],["fba1","",93],["fca1","",93],["fda1","",93],["fe50","⺁⺄㑳㑇⺈⺋㖞㘚㘎⺌⺗㥮㤘㧏㧟㩳㧐㭎㱮㳠⺧⺪䁖䅟⺮䌷⺳⺶⺷䎱䎬⺻䏝䓖䙡䙌"],["fe80","䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶䲣䲟䲠䲡䱷䲢䴓",6,"䶮",93],["8135f437",""]]')},function(e){e.exports=JSON.parse('[["0","\\u0000",127],["a140"," ,、。.‧;:?!︰…‥﹐﹑﹒·﹔﹕﹖﹗|–︱—︳╴︴﹏()︵︶{}︷︸〔〕︹︺【】︻︼《》︽︾〈〉︿﹀「」﹁﹂『』﹃﹄﹙﹚"],["a1a1","﹛﹜﹝﹞‘’“”〝〞‵′#&*※§〃○●△▲◎☆★◇◆□■▽▼㊣℅¯ ̄_ˍ﹉﹊﹍﹎﹋﹌﹟﹠﹡+-×÷±√<>=≦≧≠∞≒≡﹢",4,"~∩∪⊥∠∟⊿㏒㏑∫∮∵∴♀♂⊕⊙↑↓←→↖↗↙↘∥∣/"],["a240","\∕﹨$¥〒¢£%@℃℉﹩﹪﹫㏕㎜㎝㎞㏎㎡㎎㎏㏄°兙兛兞兝兡兣嗧瓩糎▁",7,"▏▎▍▌▋▊▉┼┴┬┤├▔─│▕┌┐└┘╭"],["a2a1","╮╰╯═╞╪╡◢◣◥◤╱╲╳0",9,"Ⅰ",9,"〡",8,"十卄卅A",25,"a",21],["a340","wxyzΑ",16,"Σ",6,"α",16,"σ",6,"ㄅ",10],["a3a1","ㄐ",25,"˙ˉˊˇˋ"],["a3e1","€"],["a440","一乙丁七乃九了二人儿入八几刀刁力匕十卜又三下丈上丫丸凡久么也乞于亡兀刃勺千叉口土士夕大女子孑孓寸小尢尸山川工己已巳巾干廾弋弓才"],["a4a1","丑丐不中丰丹之尹予云井互五亢仁什仃仆仇仍今介仄元允內六兮公冗凶分切刈勻勾勿化匹午升卅卞厄友及反壬天夫太夭孔少尤尺屯巴幻廿弔引心戈戶手扎支文斗斤方日曰月木欠止歹毋比毛氏水火爪父爻片牙牛犬王丙"],["a540","世丕且丘主乍乏乎以付仔仕他仗代令仙仞充兄冉冊冬凹出凸刊加功包匆北匝仟半卉卡占卯卮去可古右召叮叩叨叼司叵叫另只史叱台句叭叻四囚外"],["a5a1","央失奴奶孕它尼巨巧左市布平幼弁弘弗必戊打扔扒扑斥旦朮本未末札正母民氐永汁汀氾犯玄玉瓜瓦甘生用甩田由甲申疋白皮皿目矛矢石示禾穴立丞丟乒乓乩亙交亦亥仿伉伙伊伕伍伐休伏仲件任仰仳份企伋光兇兆先全"],["a640","共再冰列刑划刎刖劣匈匡匠印危吉吏同吊吐吁吋各向名合吃后吆吒因回囝圳地在圭圬圯圩夙多夷夸妄奸妃好她如妁字存宇守宅安寺尖屹州帆并年"],["a6a1","式弛忙忖戎戌戍成扣扛托收早旨旬旭曲曳有朽朴朱朵次此死氖汝汗汙江池汐汕污汛汍汎灰牟牝百竹米糸缶羊羽老考而耒耳聿肉肋肌臣自至臼舌舛舟艮色艾虫血行衣西阡串亨位住佇佗佞伴佛何估佐佑伽伺伸佃佔似但佣"],["a740","作你伯低伶余佝佈佚兌克免兵冶冷別判利刪刨劫助努劬匣即卵吝吭吞吾否呎吧呆呃吳呈呂君吩告吹吻吸吮吵吶吠吼呀吱含吟听囪困囤囫坊坑址坍"],["a7a1","均坎圾坐坏圻壯夾妝妒妨妞妣妙妖妍妤妓妊妥孝孜孚孛完宋宏尬局屁尿尾岐岑岔岌巫希序庇床廷弄弟彤形彷役忘忌志忍忱快忸忪戒我抄抗抖技扶抉扭把扼找批扳抒扯折扮投抓抑抆改攻攸旱更束李杏材村杜杖杞杉杆杠"],["a840","杓杗步每求汞沙沁沈沉沅沛汪決沐汰沌汨沖沒汽沃汲汾汴沆汶沍沔沘沂灶灼災灸牢牡牠狄狂玖甬甫男甸皂盯矣私秀禿究系罕肖肓肝肘肛肚育良芒"],["a8a1","芋芍見角言谷豆豕貝赤走足身車辛辰迂迆迅迄巡邑邢邪邦那酉釆里防阮阱阪阬並乖乳事些亞享京佯依侍佳使佬供例來侃佰併侈佩佻侖佾侏侑佺兔兒兕兩具其典冽函刻券刷刺到刮制剁劾劻卒協卓卑卦卷卸卹取叔受味呵"],["a940","咖呸咕咀呻呷咄咒咆呼咐呱呶和咚呢周咋命咎固垃坷坪坩坡坦坤坼夜奉奇奈奄奔妾妻委妹妮姑姆姐姍始姓姊妯妳姒姅孟孤季宗定官宜宙宛尚屈居"],["a9a1","屆岷岡岸岩岫岱岳帘帚帖帕帛帑幸庚店府底庖延弦弧弩往征彿彼忝忠忽念忿怏怔怯怵怖怪怕怡性怩怫怛或戕房戾所承拉拌拄抿拂抹拒招披拓拔拋拈抨抽押拐拙拇拍抵拚抱拘拖拗拆抬拎放斧於旺昔易昌昆昂明昀昏昕昊"],["aa40","昇服朋杭枋枕東果杳杷枇枝林杯杰板枉松析杵枚枓杼杪杲欣武歧歿氓氛泣注泳沱泌泥河沽沾沼波沫法泓沸泄油況沮泗泅泱沿治泡泛泊沬泯泜泖泠"],["aaa1","炕炎炒炊炙爬爭爸版牧物狀狎狙狗狐玩玨玟玫玥甽疝疙疚的盂盲直知矽社祀祁秉秈空穹竺糾罔羌羋者肺肥肢肱股肫肩肴肪肯臥臾舍芳芝芙芭芽芟芹花芬芥芯芸芣芰芾芷虎虱初表軋迎返近邵邸邱邶采金長門阜陀阿阻附"],["ab40","陂隹雨青非亟亭亮信侵侯便俠俑俏保促侶俘俟俊俗侮俐俄係俚俎俞侷兗冒冑冠剎剃削前剌剋則勇勉勃勁匍南卻厚叛咬哀咨哎哉咸咦咳哇哂咽咪品"],["aba1","哄哈咯咫咱咻咩咧咿囿垂型垠垣垢城垮垓奕契奏奎奐姜姘姿姣姨娃姥姪姚姦威姻孩宣宦室客宥封屎屏屍屋峙峒巷帝帥帟幽庠度建弈弭彥很待徊律徇後徉怒思怠急怎怨恍恰恨恢恆恃恬恫恪恤扁拜挖按拼拭持拮拽指拱拷"],["ac40","拯括拾拴挑挂政故斫施既春昭映昧是星昨昱昤曷柿染柱柔某柬架枯柵柩柯柄柑枴柚查枸柏柞柳枰柙柢柝柒歪殃殆段毒毗氟泉洋洲洪流津洌洱洞洗"],["aca1","活洽派洶洛泵洹洧洸洩洮洵洎洫炫為炳炬炯炭炸炮炤爰牲牯牴狩狠狡玷珊玻玲珍珀玳甚甭畏界畎畋疫疤疥疢疣癸皆皇皈盈盆盃盅省盹相眉看盾盼眇矜砂研砌砍祆祉祈祇禹禺科秒秋穿突竿竽籽紂紅紀紉紇約紆缸美羿耄"],["ad40","耐耍耑耶胖胥胚胃胄背胡胛胎胞胤胝致舢苧范茅苣苛苦茄若茂茉苒苗英茁苜苔苑苞苓苟苯茆虐虹虻虺衍衫要觔計訂訃貞負赴赳趴軍軌述迦迢迪迥"],["ada1","迭迫迤迨郊郎郁郃酋酊重閂限陋陌降面革韋韭音頁風飛食首香乘亳倌倍倣俯倦倥俸倩倖倆值借倚倒們俺倀倔倨俱倡個候倘俳修倭倪俾倫倉兼冤冥冢凍凌准凋剖剜剔剛剝匪卿原厝叟哨唐唁唷哼哥哲唆哺唔哩哭員唉哮哪"],["ae40","哦唧唇哽唏圃圄埂埔埋埃堉夏套奘奚娑娘娜娟娛娓姬娠娣娩娥娌娉孫屘宰害家宴宮宵容宸射屑展屐峭峽峻峪峨峰島崁峴差席師庫庭座弱徒徑徐恙"],["aea1","恣恥恐恕恭恩息悄悟悚悍悔悌悅悖扇拳挈拿捎挾振捕捂捆捏捉挺捐挽挪挫挨捍捌效敉料旁旅時晉晏晃晒晌晅晁書朔朕朗校核案框桓根桂桔栩梳栗桌桑栽柴桐桀格桃株桅栓栘桁殊殉殷氣氧氨氦氤泰浪涕消涇浦浸海浙涓"],["af40","浬涉浮浚浴浩涌涊浹涅浥涔烊烘烤烙烈烏爹特狼狹狽狸狷玆班琉珮珠珪珞畔畝畜畚留疾病症疲疳疽疼疹痂疸皋皰益盍盎眩真眠眨矩砰砧砸砝破砷"],["afa1","砥砭砠砟砲祕祐祠祟祖神祝祗祚秤秣秧租秦秩秘窄窈站笆笑粉紡紗紋紊素索純紐紕級紜納紙紛缺罟羔翅翁耆耘耕耙耗耽耿胱脂胰脅胭胴脆胸胳脈能脊胼胯臭臬舀舐航舫舨般芻茫荒荔荊茸荐草茵茴荏茲茹茶茗荀茱茨荃"],["b040","虔蚊蚪蚓蚤蚩蚌蚣蚜衰衷袁袂衽衹記訐討訌訕訊託訓訖訏訑豈豺豹財貢起躬軒軔軏辱送逆迷退迺迴逃追逅迸邕郡郝郢酒配酌釘針釗釜釙閃院陣陡"],["b0a1","陛陝除陘陞隻飢馬骨高鬥鬲鬼乾偺偽停假偃偌做偉健偶偎偕偵側偷偏倏偯偭兜冕凰剪副勒務勘動匐匏匙匿區匾參曼商啪啦啄啞啡啃啊唱啖問啕唯啤唸售啜唬啣唳啁啗圈國圉域堅堊堆埠埤基堂堵執培夠奢娶婁婉婦婪婀"],["b140","娼婢婚婆婊孰寇寅寄寂宿密尉專將屠屜屝崇崆崎崛崖崢崑崩崔崙崤崧崗巢常帶帳帷康庸庶庵庾張強彗彬彩彫得徙從徘御徠徜恿患悉悠您惋悴惦悽"],["b1a1","情悻悵惜悼惘惕惆惟悸惚惇戚戛扈掠控捲掖探接捷捧掘措捱掩掉掃掛捫推掄授掙採掬排掏掀捻捩捨捺敝敖救教敗啟敏敘敕敔斜斛斬族旋旌旎晝晚晤晨晦晞曹勗望梁梯梢梓梵桿桶梱梧梗械梃棄梭梆梅梔條梨梟梡梂欲殺"],["b240","毫毬氫涎涼淳淙液淡淌淤添淺清淇淋涯淑涮淞淹涸混淵淅淒渚涵淚淫淘淪深淮淨淆淄涪淬涿淦烹焉焊烽烯爽牽犁猜猛猖猓猙率琅琊球理現琍瓠瓶"],["b2a1","瓷甜產略畦畢異疏痔痕疵痊痍皎盔盒盛眷眾眼眶眸眺硫硃硎祥票祭移窒窕笠笨笛第符笙笞笮粒粗粕絆絃統紮紹紼絀細紳組累終紲紱缽羞羚翌翎習耜聊聆脯脖脣脫脩脰脤舂舵舷舶船莎莞莘荸莢莖莽莫莒莊莓莉莠荷荻荼"],["b340","莆莧處彪蛇蛀蚶蛄蚵蛆蛋蚱蚯蛉術袞袈被袒袖袍袋覓規訪訝訣訥許設訟訛訢豉豚販責貫貨貪貧赧赦趾趺軛軟這逍通逗連速逝逐逕逞造透逢逖逛途"],["b3a1","部郭都酗野釵釦釣釧釭釩閉陪陵陳陸陰陴陶陷陬雀雪雩章竟頂頃魚鳥鹵鹿麥麻傢傍傅備傑傀傖傘傚最凱割剴創剩勞勝勛博厥啻喀喧啼喊喝喘喂喜喪喔喇喋喃喳單喟唾喲喚喻喬喱啾喉喫喙圍堯堪場堤堰報堡堝堠壹壺奠"],["b440","婷媚婿媒媛媧孳孱寒富寓寐尊尋就嵌嵐崴嵇巽幅帽幀幃幾廊廁廂廄弼彭復循徨惑惡悲悶惠愜愣惺愕惰惻惴慨惱愎惶愉愀愒戟扉掣掌描揀揩揉揆揍"],["b4a1","插揣提握揖揭揮捶援揪換摒揚揹敞敦敢散斑斐斯普晰晴晶景暑智晾晷曾替期朝棺棕棠棘棗椅棟棵森棧棹棒棲棣棋棍植椒椎棉棚楮棻款欺欽殘殖殼毯氮氯氬港游湔渡渲湧湊渠渥渣減湛湘渤湖湮渭渦湯渴湍渺測湃渝渾滋"],["b540","溉渙湎湣湄湲湩湟焙焚焦焰無然煮焜牌犄犀猶猥猴猩琺琪琳琢琥琵琶琴琯琛琦琨甥甦畫番痢痛痣痙痘痞痠登發皖皓皴盜睏短硝硬硯稍稈程稅稀窘"],["b5a1","窗窖童竣等策筆筐筒答筍筋筏筑粟粥絞結絨絕紫絮絲絡給絢絰絳善翔翕耋聒肅腕腔腋腑腎脹腆脾腌腓腴舒舜菩萃菸萍菠菅萋菁華菱菴著萊菰萌菌菽菲菊萸萎萄菜萇菔菟虛蛟蛙蛭蛔蛛蛤蛐蛞街裁裂袱覃視註詠評詞証詁"],["b640","詔詛詐詆訴診訶詖象貂貯貼貳貽賁費賀貴買貶貿貸越超趁跎距跋跚跑跌跛跆軻軸軼辜逮逵週逸進逶鄂郵鄉郾酣酥量鈔鈕鈣鈉鈞鈍鈐鈇鈑閔閏開閑"],["b6a1","間閒閎隊階隋陽隅隆隍陲隄雁雅雄集雇雯雲韌項順須飧飪飯飩飲飭馮馭黃黍黑亂傭債傲傳僅傾催傷傻傯僇剿剷剽募勦勤勢勣匯嗟嗨嗓嗦嗎嗜嗇嗑嗣嗤嗯嗚嗡嗅嗆嗥嗉園圓塞塑塘塗塚塔填塌塭塊塢塒塋奧嫁嫉嫌媾媽媼"],["b740","媳嫂媲嵩嵯幌幹廉廈弒彙徬微愚意慈感想愛惹愁愈慎慌慄慍愾愴愧愍愆愷戡戢搓搾搞搪搭搽搬搏搜搔損搶搖搗搆敬斟新暗暉暇暈暖暄暘暍會榔業"],["b7a1","楚楷楠楔極椰概楊楨楫楞楓楹榆楝楣楛歇歲毀殿毓毽溢溯滓溶滂源溝滇滅溥溘溼溺溫滑準溜滄滔溪溧溴煎煙煩煤煉照煜煬煦煌煥煞煆煨煖爺牒猷獅猿猾瑯瑚瑕瑟瑞瑁琿瑙瑛瑜當畸瘀痰瘁痲痱痺痿痴痳盞盟睛睫睦睞督"],["b840","睹睪睬睜睥睨睢矮碎碰碗碘碌碉硼碑碓硿祺祿禁萬禽稜稚稠稔稟稞窟窠筷節筠筮筧粱粳粵經絹綑綁綏絛置罩罪署義羨群聖聘肆肄腱腰腸腥腮腳腫"],["b8a1","腹腺腦舅艇蒂葷落萱葵葦葫葉葬葛萼萵葡董葩葭葆虞虜號蛹蜓蜈蜇蜀蛾蛻蜂蜃蜆蜊衙裟裔裙補裘裝裡裊裕裒覜解詫該詳試詩詰誇詼詣誠話誅詭詢詮詬詹詻訾詨豢貊貉賊資賈賄貲賃賂賅跡跟跨路跳跺跪跤跦躲較載軾輊"],["b940","辟農運遊道遂達逼違遐遇遏過遍遑逾遁鄒鄗酬酪酩釉鈷鉗鈸鈽鉀鈾鉛鉋鉤鉑鈴鉉鉍鉅鈹鈿鉚閘隘隔隕雍雋雉雊雷電雹零靖靴靶預頑頓頊頒頌飼飴"],["b9a1","飽飾馳馱馴髡鳩麂鼎鼓鼠僧僮僥僖僭僚僕像僑僱僎僩兢凳劃劂匱厭嗾嘀嘛嘗嗽嘔嘆嘉嘍嘎嗷嘖嘟嘈嘐嗶團圖塵塾境墓墊塹墅塽壽夥夢夤奪奩嫡嫦嫩嫗嫖嫘嫣孵寞寧寡寥實寨寢寤察對屢嶄嶇幛幣幕幗幔廓廖弊彆彰徹慇"],["ba40","愿態慷慢慣慟慚慘慵截撇摘摔撤摸摟摺摑摧搴摭摻敲斡旗旖暢暨暝榜榨榕槁榮槓構榛榷榻榫榴槐槍榭槌榦槃榣歉歌氳漳演滾漓滴漩漾漠漬漏漂漢"],["baa1","滿滯漆漱漸漲漣漕漫漯澈漪滬漁滲滌滷熔熙煽熊熄熒爾犒犖獄獐瑤瑣瑪瑰瑭甄疑瘧瘍瘋瘉瘓盡監瞄睽睿睡磁碟碧碳碩碣禎福禍種稱窪窩竭端管箕箋筵算箝箔箏箸箇箄粹粽精綻綰綜綽綾綠緊綴網綱綺綢綿綵綸維緒緇綬"],["bb40","罰翠翡翟聞聚肇腐膀膏膈膊腿膂臧臺與舔舞艋蓉蒿蓆蓄蒙蒞蒲蒜蓋蒸蓀蓓蒐蒼蓑蓊蜿蜜蜻蜢蜥蜴蜘蝕蜷蜩裳褂裴裹裸製裨褚裯誦誌語誣認誡誓誤"],["bba1","說誥誨誘誑誚誧豪貍貌賓賑賒赫趙趕跼輔輒輕輓辣遠遘遜遣遙遞遢遝遛鄙鄘鄞酵酸酷酴鉸銀銅銘銖鉻銓銜銨鉼銑閡閨閩閣閥閤隙障際雌雒需靼鞅韶頗領颯颱餃餅餌餉駁骯骰髦魁魂鳴鳶鳳麼鼻齊億儀僻僵價儂儈儉儅凜"],["bc40","劇劈劉劍劊勰厲嘮嘻嘹嘲嘿嘴嘩噓噎噗噴嘶嘯嘰墀墟增墳墜墮墩墦奭嬉嫻嬋嫵嬌嬈寮寬審寫層履嶝嶔幢幟幡廢廚廟廝廣廠彈影德徵慶慧慮慝慕憂"],["bca1","慼慰慫慾憧憐憫憎憬憚憤憔憮戮摩摯摹撞撲撈撐撰撥撓撕撩撒撮播撫撚撬撙撢撳敵敷數暮暫暴暱樣樟槨樁樞標槽模樓樊槳樂樅槭樑歐歎殤毅毆漿潼澄潑潦潔澆潭潛潸潮澎潺潰潤澗潘滕潯潠潟熟熬熱熨牖犛獎獗瑩璋璃"],["bd40","瑾璀畿瘠瘩瘟瘤瘦瘡瘢皚皺盤瞎瞇瞌瞑瞋磋磅確磊碾磕碼磐稿稼穀稽稷稻窯窮箭箱範箴篆篇篁箠篌糊締練緯緻緘緬緝編緣線緞緩綞緙緲緹罵罷羯"],["bda1","翩耦膛膜膝膠膚膘蔗蔽蔚蓮蔬蔭蔓蔑蔣蔡蔔蓬蔥蓿蔆螂蝴蝶蝠蝦蝸蝨蝙蝗蝌蝓衛衝褐複褒褓褕褊誼諒談諄誕請諸課諉諂調誰論諍誶誹諛豌豎豬賠賞賦賤賬賭賢賣賜質賡赭趟趣踫踐踝踢踏踩踟踡踞躺輝輛輟輩輦輪輜輞"],["be40","輥適遮遨遭遷鄰鄭鄧鄱醇醉醋醃鋅銻銷鋪銬鋤鋁銳銼鋒鋇鋰銲閭閱霄霆震霉靠鞍鞋鞏頡頫頜颳養餓餒餘駝駐駟駛駑駕駒駙骷髮髯鬧魅魄魷魯鴆鴉"],["bea1","鴃麩麾黎墨齒儒儘儔儐儕冀冪凝劑劓勳噙噫噹噩噤噸噪器噥噱噯噬噢噶壁墾壇壅奮嬝嬴學寰導彊憲憑憩憊懍憶憾懊懈戰擅擁擋撻撼據擄擇擂操撿擒擔撾整曆曉暹曄曇暸樽樸樺橙橫橘樹橄橢橡橋橇樵機橈歙歷氅濂澱澡"],["bf40","濃澤濁澧澳激澹澶澦澠澴熾燉燐燒燈燕熹燎燙燜燃燄獨璜璣璘璟璞瓢甌甍瘴瘸瘺盧盥瞠瞞瞟瞥磨磚磬磧禦積穎穆穌穋窺篙簑築篤篛篡篩篦糕糖縊"],["bfa1","縑縈縛縣縞縝縉縐罹羲翰翱翮耨膳膩膨臻興艘艙蕊蕙蕈蕨蕩蕃蕉蕭蕪蕞螃螟螞螢融衡褪褲褥褫褡親覦諦諺諫諱謀諜諧諮諾謁謂諷諭諳諶諼豫豭貓賴蹄踱踴蹂踹踵輻輯輸輳辨辦遵遴選遲遼遺鄴醒錠錶鋸錳錯錢鋼錫錄錚"],["c040","錐錦錡錕錮錙閻隧隨險雕霎霑霖霍霓霏靛靜靦鞘頰頸頻頷頭頹頤餐館餞餛餡餚駭駢駱骸骼髻髭鬨鮑鴕鴣鴦鴨鴒鴛默黔龍龜優償儡儲勵嚎嚀嚐嚅嚇"],["c0a1","嚏壕壓壑壎嬰嬪嬤孺尷屨嶼嶺嶽嶸幫彌徽應懂懇懦懋戲戴擎擊擘擠擰擦擬擱擢擭斂斃曙曖檀檔檄檢檜櫛檣橾檗檐檠歜殮毚氈濘濱濟濠濛濤濫濯澀濬濡濩濕濮濰燧營燮燦燥燭燬燴燠爵牆獰獲璩環璦璨癆療癌盪瞳瞪瞰瞬"],["c140","瞧瞭矯磷磺磴磯礁禧禪穗窿簇簍篾篷簌篠糠糜糞糢糟糙糝縮績繆縷縲繃縫總縱繅繁縴縹繈縵縿縯罄翳翼聱聲聰聯聳臆臃膺臂臀膿膽臉膾臨舉艱薪"],["c1a1","薄蕾薜薑薔薯薛薇薨薊虧蟀蟑螳蟒蟆螫螻螺蟈蟋褻褶襄褸褽覬謎謗謙講謊謠謝謄謐豁谿豳賺賽購賸賻趨蹉蹋蹈蹊轄輾轂轅輿避遽還邁邂邀鄹醣醞醜鍍鎂錨鍵鍊鍥鍋錘鍾鍬鍛鍰鍚鍔闊闋闌闈闆隱隸雖霜霞鞠韓顆颶餵騁"],["c240","駿鮮鮫鮪鮭鴻鴿麋黏點黜黝黛鼾齋叢嚕嚮壙壘嬸彝懣戳擴擲擾攆擺擻擷斷曜朦檳檬櫃檻檸櫂檮檯歟歸殯瀉瀋濾瀆濺瀑瀏燻燼燾燸獷獵璧璿甕癖癘"],["c2a1","癒瞽瞿瞻瞼礎禮穡穢穠竄竅簫簧簪簞簣簡糧織繕繞繚繡繒繙罈翹翻職聶臍臏舊藏薩藍藐藉薰薺薹薦蟯蟬蟲蟠覆覲觴謨謹謬謫豐贅蹙蹣蹦蹤蹟蹕軀轉轍邇邃邈醫醬釐鎔鎊鎖鎢鎳鎮鎬鎰鎘鎚鎗闔闖闐闕離雜雙雛雞霤鞣鞦"],["c340","鞭韹額顏題顎顓颺餾餿餽餮馥騎髁鬃鬆魏魎魍鯊鯉鯽鯈鯀鵑鵝鵠黠鼕鼬儳嚥壞壟壢寵龐廬懲懷懶懵攀攏曠曝櫥櫝櫚櫓瀛瀟瀨瀚瀝瀕瀘爆爍牘犢獸"],["c3a1","獺璽瓊瓣疇疆癟癡矇礙禱穫穩簾簿簸簽簷籀繫繭繹繩繪羅繳羶羹羸臘藩藝藪藕藤藥藷蟻蠅蠍蟹蟾襠襟襖襞譁譜識證譚譎譏譆譙贈贊蹼蹲躇蹶蹬蹺蹴轔轎辭邊邋醱醮鏡鏑鏟鏃鏈鏜鏝鏖鏢鏍鏘鏤鏗鏨關隴難霪霧靡韜韻類"],["c440","願顛颼饅饉騖騙鬍鯨鯧鯖鯛鶉鵡鵲鵪鵬麒麗麓麴勸嚨嚷嚶嚴嚼壤孀孃孽寶巉懸懺攘攔攙曦朧櫬瀾瀰瀲爐獻瓏癢癥礦礪礬礫竇競籌籃籍糯糰辮繽繼"],["c4a1","纂罌耀臚艦藻藹蘑藺蘆蘋蘇蘊蠔蠕襤覺觸議譬警譯譟譫贏贍躉躁躅躂醴釋鐘鐃鏽闡霰飄饒饑馨騫騰騷騵鰓鰍鹹麵黨鼯齟齣齡儷儸囁囀囂夔屬巍懼懾攝攜斕曩櫻欄櫺殲灌爛犧瓖瓔癩矓籐纏續羼蘗蘭蘚蠣蠢蠡蠟襪襬覽譴"],["c540","護譽贓躊躍躋轟辯醺鐮鐳鐵鐺鐸鐲鐫闢霸霹露響顧顥饗驅驃驀騾髏魔魑鰭鰥鶯鶴鷂鶸麝黯鼙齜齦齧儼儻囈囊囉孿巔巒彎懿攤權歡灑灘玀瓤疊癮癬"],["c5a1","禳籠籟聾聽臟襲襯觼讀贖贗躑躓轡酈鑄鑑鑒霽霾韃韁顫饕驕驍髒鬚鱉鰱鰾鰻鷓鷗鼴齬齪龔囌巖戀攣攫攪曬欐瓚竊籤籣籥纓纖纔臢蘸蘿蠱變邐邏鑣鑠鑤靨顯饜驚驛驗髓體髑鱔鱗鱖鷥麟黴囑壩攬灞癱癲矗罐羈蠶蠹衢讓讒"],["c640","讖艷贛釀鑪靂靈靄韆顰驟鬢魘鱟鷹鷺鹼鹽鼇齷齲廳欖灣籬籮蠻觀躡釁鑲鑰顱饞髖鬣黌灤矚讚鑷韉驢驥纜讜躪釅鑽鑾鑼鱷鱸黷豔鑿鸚爨驪鬱鸛鸞籲"],["c940","乂乜凵匚厂万丌乇亍囗兀屮彳丏冇与丮亓仂仉仈冘勼卬厹圠夃夬尐巿旡殳毌气爿丱丼仨仜仩仡仝仚刌匜卌圢圣夗夯宁宄尒尻屴屳帄庀庂忉戉扐氕"],["c9a1","氶汃氿氻犮犰玊禸肊阞伎优伬仵伔仱伀价伈伝伂伅伢伓伄仴伒冱刓刉刐劦匢匟卍厊吇囡囟圮圪圴夼妀奼妅奻奾奷奿孖尕尥屼屺屻屾巟幵庄异弚彴忕忔忏扜扞扤扡扦扢扙扠扚扥旯旮朾朹朸朻机朿朼朳氘汆汒汜汏汊汔汋"],["ca40","汌灱牞犴犵玎甪癿穵网艸艼芀艽艿虍襾邙邗邘邛邔阢阤阠阣佖伻佢佉体佤伾佧佒佟佁佘伭伳伿佡冏冹刜刞刡劭劮匉卣卲厎厏吰吷吪呔呅吙吜吥吘"],["caa1","吽呏呁吨吤呇囮囧囥坁坅坌坉坋坒夆奀妦妘妠妗妎妢妐妏妧妡宎宒尨尪岍岏岈岋岉岒岊岆岓岕巠帊帎庋庉庌庈庍弅弝彸彶忒忑忐忭忨忮忳忡忤忣忺忯忷忻怀忴戺抃抌抎抏抔抇扱扻扺扰抁抈扷扽扲扴攷旰旴旳旲旵杅杇"],["cb40","杙杕杌杈杝杍杚杋毐氙氚汸汧汫沄沋沏汱汯汩沚汭沇沕沜汦汳汥汻沎灴灺牣犿犽狃狆狁犺狅玕玗玓玔玒町甹疔疕皁礽耴肕肙肐肒肜芐芏芅芎芑芓"],["cba1","芊芃芄豸迉辿邟邡邥邞邧邠阰阨阯阭丳侘佼侅佽侀侇佶佴侉侄佷佌侗佪侚佹侁佸侐侜侔侞侒侂侕佫佮冞冼冾刵刲刳剆刱劼匊匋匼厒厔咇呿咁咑咂咈呫呺呾呥呬呴呦咍呯呡呠咘呣呧呤囷囹坯坲坭坫坱坰坶垀坵坻坳坴坢"],["cc40","坨坽夌奅妵妺姏姎妲姌姁妶妼姃姖妱妽姀姈妴姇孢孥宓宕屄屇岮岤岠岵岯岨岬岟岣岭岢岪岧岝岥岶岰岦帗帔帙弨弢弣弤彔徂彾彽忞忥怭怦怙怲怋"],["cca1","怴怊怗怳怚怞怬怢怍怐怮怓怑怌怉怜戔戽抭抴拑抾抪抶拊抮抳抯抻抩抰抸攽斨斻昉旼昄昒昈旻昃昋昍昅旽昑昐曶朊枅杬枎枒杶杻枘枆构杴枍枌杺枟枑枙枃杽极杸杹枔欥殀歾毞氝沓泬泫泮泙沶泔沭泧沷泐泂沺泃泆泭泲"],["cd40","泒泝沴沊沝沀泞泀洰泍泇沰泹泏泩泑炔炘炅炓炆炄炑炖炂炚炃牪狖狋狘狉狜狒狔狚狌狑玤玡玭玦玢玠玬玝瓝瓨甿畀甾疌疘皯盳盱盰盵矸矼矹矻矺"],["cda1","矷祂礿秅穸穻竻籵糽耵肏肮肣肸肵肭舠芠苀芫芚芘芛芵芧芮芼芞芺芴芨芡芩苂芤苃芶芢虰虯虭虮豖迒迋迓迍迖迕迗邲邴邯邳邰阹阽阼阺陃俍俅俓侲俉俋俁俔俜俙侻侳俛俇俖侺俀侹俬剄剉勀勂匽卼厗厖厙厘咺咡咭咥哏"],["ce40","哃茍咷咮哖咶哅哆咠呰咼咢咾呲哞咰垵垞垟垤垌垗垝垛垔垘垏垙垥垚垕壴复奓姡姞姮娀姱姝姺姽姼姶姤姲姷姛姩姳姵姠姾姴姭宨屌峐峘峌峗峋峛"],["cea1","峞峚峉峇峊峖峓峔峏峈峆峎峟峸巹帡帢帣帠帤庰庤庢庛庣庥弇弮彖徆怷怹恔恲恞恅恓恇恉恛恌恀恂恟怤恄恘恦恮扂扃拏挍挋拵挎挃拫拹挏挌拸拶挀挓挔拺挕拻拰敁敃斪斿昶昡昲昵昜昦昢昳昫昺昝昴昹昮朏朐柁柲柈枺"],["cf40","柜枻柸柘柀枷柅柫柤柟枵柍枳柷柶柮柣柂枹柎柧柰枲柼柆柭柌枮柦柛柺柉柊柃柪柋欨殂殄殶毖毘毠氠氡洨洴洭洟洼洿洒洊泚洳洄洙洺洚洑洀洝浂"],["cfa1","洁洘洷洃洏浀洇洠洬洈洢洉洐炷炟炾炱炰炡炴炵炩牁牉牊牬牰牳牮狊狤狨狫狟狪狦狣玅珌珂珈珅玹玶玵玴珫玿珇玾珃珆玸珋瓬瓮甮畇畈疧疪癹盄眈眃眄眅眊盷盻盺矧矨砆砑砒砅砐砏砎砉砃砓祊祌祋祅祄秕种秏秖秎窀"],["d040","穾竑笀笁籺籸籹籿粀粁紃紈紁罘羑羍羾耇耎耏耔耷胘胇胠胑胈胂胐胅胣胙胜胊胕胉胏胗胦胍臿舡芔苙苾苹茇苨茀苕茺苫苖苴苬苡苲苵茌苻苶苰苪"],["d0a1","苤苠苺苳苭虷虴虼虳衁衎衧衪衩觓訄訇赲迣迡迮迠郱邽邿郕郅邾郇郋郈釔釓陔陏陑陓陊陎倞倅倇倓倢倰倛俵俴倳倷倬俶俷倗倜倠倧倵倯倱倎党冔冓凊凄凅凈凎剡剚剒剞剟剕剢勍匎厞唦哢唗唒哧哳哤唚哿唄唈哫唑唅哱"],["d140","唊哻哷哸哠唎唃唋圁圂埌堲埕埒垺埆垽垼垸垶垿埇埐垹埁夎奊娙娖娭娮娕娏娗娊娞娳孬宧宭宬尃屖屔峬峿峮峱峷崀峹帩帨庨庮庪庬弳弰彧恝恚恧"],["d1a1","恁悢悈悀悒悁悝悃悕悛悗悇悜悎戙扆拲挐捖挬捄捅挶捃揤挹捋捊挼挩捁挴捘捔捙挭捇挳捚捑挸捗捀捈敊敆旆旃旄旂晊晟晇晑朒朓栟栚桉栲栳栻桋桏栖栱栜栵栫栭栯桎桄栴栝栒栔栦栨栮桍栺栥栠欬欯欭欱欴歭肂殈毦毤"],["d240","毨毣毢毧氥浺浣浤浶洍浡涒浘浢浭浯涑涍淯浿涆浞浧浠涗浰浼浟涂涘洯浨涋浾涀涄洖涃浻浽浵涐烜烓烑烝烋缹烢烗烒烞烠烔烍烅烆烇烚烎烡牂牸"],["d2a1","牷牶猀狺狴狾狶狳狻猁珓珙珥珖玼珧珣珩珜珒珛珔珝珚珗珘珨瓞瓟瓴瓵甡畛畟疰痁疻痄痀疿疶疺皊盉眝眛眐眓眒眣眑眕眙眚眢眧砣砬砢砵砯砨砮砫砡砩砳砪砱祔祛祏祜祓祒祑秫秬秠秮秭秪秜秞秝窆窉窅窋窌窊窇竘笐"],["d340","笄笓笅笏笈笊笎笉笒粄粑粊粌粈粍粅紞紝紑紎紘紖紓紟紒紏紌罜罡罞罠罝罛羖羒翃翂翀耖耾耹胺胲胹胵脁胻脀舁舯舥茳茭荄茙荑茥荖茿荁茦茜茢"],["d3a1","荂荎茛茪茈茼荍茖茤茠茷茯茩荇荅荌荓茞茬荋茧荈虓虒蚢蚨蚖蚍蚑蚞蚇蚗蚆蚋蚚蚅蚥蚙蚡蚧蚕蚘蚎蚝蚐蚔衃衄衭衵衶衲袀衱衿衯袃衾衴衼訒豇豗豻貤貣赶赸趵趷趶軑軓迾迵适迿迻逄迼迶郖郠郙郚郣郟郥郘郛郗郜郤酐"],["d440","酎酏釕釢釚陜陟隼飣髟鬯乿偰偪偡偞偠偓偋偝偲偈偍偁偛偊偢倕偅偟偩偫偣偤偆偀偮偳偗偑凐剫剭剬剮勖勓匭厜啵啶唼啍啐唴唪啑啢唶唵唰啒啅"],["d4a1","唌唲啥啎唹啈唭唻啀啋圊圇埻堔埢埶埜埴堀埭埽堈埸堋埳埏堇埮埣埲埥埬埡堎埼堐埧堁堌埱埩埰堍堄奜婠婘婕婧婞娸娵婭婐婟婥婬婓婤婗婃婝婒婄婛婈媎娾婍娹婌婰婩婇婑婖婂婜孲孮寁寀屙崞崋崝崚崠崌崨崍崦崥崏"],["d540","崰崒崣崟崮帾帴庱庴庹庲庳弶弸徛徖徟悊悐悆悾悰悺惓惔惏惤惙惝惈悱惛悷惊悿惃惍惀挲捥掊掂捽掽掞掭掝掗掫掎捯掇掐据掯捵掜捭掮捼掤挻掟"],["d5a1","捸掅掁掑掍捰敓旍晥晡晛晙晜晢朘桹梇梐梜桭桮梮梫楖桯梣梬梩桵桴梲梏桷梒桼桫桲梪梀桱桾梛梖梋梠梉梤桸桻梑梌梊桽欶欳欷欸殑殏殍殎殌氪淀涫涴涳湴涬淩淢涷淶淔渀淈淠淟淖涾淥淜淝淛淴淊涽淭淰涺淕淂淏淉"],["d640","淐淲淓淽淗淍淣涻烺焍烷焗烴焌烰焄烳焐烼烿焆焓焀烸烶焋焂焎牾牻牼牿猝猗猇猑猘猊猈狿猏猞玈珶珸珵琄琁珽琇琀珺珼珿琌琋珴琈畤畣痎痒痏"],["d6a1","痋痌痑痐皏皉盓眹眯眭眱眲眴眳眽眥眻眵硈硒硉硍硊硌砦硅硐祤祧祩祪祣祫祡离秺秸秶秷窏窔窐笵筇笴笥笰笢笤笳笘笪笝笱笫笭笯笲笸笚笣粔粘粖粣紵紽紸紶紺絅紬紩絁絇紾紿絊紻紨罣羕羜羝羛翊翋翍翐翑翇翏翉耟"],["d740","耞耛聇聃聈脘脥脙脛脭脟脬脞脡脕脧脝脢舑舸舳舺舴舲艴莐莣莨莍荺荳莤荴莏莁莕莙荵莔莩荽莃莌莝莛莪莋荾莥莯莈莗莰荿莦莇莮荶莚虙虖蚿蚷"],["d7a1","蛂蛁蛅蚺蚰蛈蚹蚳蚸蛌蚴蚻蚼蛃蚽蚾衒袉袕袨袢袪袚袑袡袟袘袧袙袛袗袤袬袌袓袎覂觖觙觕訰訧訬訞谹谻豜豝豽貥赽赻赹趼跂趹趿跁軘軞軝軜軗軠軡逤逋逑逜逌逡郯郪郰郴郲郳郔郫郬郩酖酘酚酓酕釬釴釱釳釸釤釹釪"],["d840","釫釷釨釮镺閆閈陼陭陫陱陯隿靪頄飥馗傛傕傔傞傋傣傃傌傎傝偨傜傒傂傇兟凔匒匑厤厧喑喨喥喭啷噅喢喓喈喏喵喁喣喒喤啽喌喦啿喕喡喎圌堩堷"],["d8a1","堙堞堧堣堨埵塈堥堜堛堳堿堶堮堹堸堭堬堻奡媯媔媟婺媢媞婸媦婼媥媬媕媮娷媄媊媗媃媋媩婻婽媌媜媏媓媝寪寍寋寔寑寊寎尌尰崷嵃嵫嵁嵋崿崵嵑嵎嵕崳崺嵒崽崱嵙嵂崹嵉崸崼崲崶嵀嵅幄幁彘徦徥徫惉悹惌惢惎惄愔"],["d940","惲愊愖愅惵愓惸惼惾惁愃愘愝愐惿愄愋扊掔掱掰揎揥揨揯揃撝揳揊揠揶揕揲揵摡揟掾揝揜揄揘揓揂揇揌揋揈揰揗揙攲敧敪敤敜敨敥斌斝斞斮旐旒"],["d9a1","晼晬晻暀晱晹晪晲朁椌棓椄棜椪棬棪棱椏棖棷棫棤棶椓椐棳棡椇棌椈楰梴椑棯棆椔棸棐棽棼棨椋椊椗棎棈棝棞棦棴棑椆棔棩椕椥棇欹欻欿欼殔殗殙殕殽毰毲毳氰淼湆湇渟湉溈渼渽湅湢渫渿湁湝湳渜渳湋湀湑渻渃渮湞"],["da40","湨湜湡渱渨湠湱湫渹渢渰湓湥渧湸湤湷湕湹湒湦渵渶湚焠焞焯烻焮焱焣焥焢焲焟焨焺焛牋牚犈犉犆犅犋猒猋猰猢猱猳猧猲猭猦猣猵猌琮琬琰琫琖"],["daa1","琚琡琭琱琤琣琝琩琠琲瓻甯畯畬痧痚痡痦痝痟痤痗皕皒盚睆睇睄睍睅睊睎睋睌矞矬硠硤硥硜硭硱硪确硰硩硨硞硢祴祳祲祰稂稊稃稌稄窙竦竤筊笻筄筈筌筎筀筘筅粢粞粨粡絘絯絣絓絖絧絪絏絭絜絫絒絔絩絑絟絎缾缿罥"],["db40","罦羢羠羡翗聑聏聐胾胔腃腊腒腏腇脽腍脺臦臮臷臸臹舄舼舽舿艵茻菏菹萣菀菨萒菧菤菼菶萐菆菈菫菣莿萁菝菥菘菿菡菋菎菖菵菉萉萏菞萑萆菂菳"],["dba1","菕菺菇菑菪萓菃菬菮菄菻菗菢萛菛菾蛘蛢蛦蛓蛣蛚蛪蛝蛫蛜蛬蛩蛗蛨蛑衈衖衕袺裗袹袸裀袾袶袼袷袽袲褁裉覕覘覗觝觚觛詎詍訹詙詀詗詘詄詅詒詈詑詊詌詏豟貁貀貺貾貰貹貵趄趀趉跘跓跍跇跖跜跏跕跙跈跗跅軯軷軺"],["dc40","軹軦軮軥軵軧軨軶軫軱軬軴軩逭逴逯鄆鄬鄄郿郼鄈郹郻鄁鄀鄇鄅鄃酡酤酟酢酠鈁鈊鈥鈃鈚鈦鈏鈌鈀鈒釿釽鈆鈄鈧鈂鈜鈤鈙鈗鈅鈖镻閍閌閐隇陾隈"],["dca1","隉隃隀雂雈雃雱雰靬靰靮頇颩飫鳦黹亃亄亶傽傿僆傮僄僊傴僈僂傰僁傺傱僋僉傶傸凗剺剸剻剼嗃嗛嗌嗐嗋嗊嗝嗀嗔嗄嗩喿嗒喍嗏嗕嗢嗖嗈嗲嗍嗙嗂圔塓塨塤塏塍塉塯塕塎塝塙塥塛堽塣塱壼嫇嫄嫋媺媸媱媵媰媿嫈媻嫆"],["dd40","媷嫀嫊媴媶嫍媹媐寖寘寙尟尳嵱嵣嵊嵥嵲嵬嵞嵨嵧嵢巰幏幎幊幍幋廅廌廆廋廇彀徯徭惷慉慊愫慅愶愲愮慆愯慏愩慀戠酨戣戥戤揅揱揫搐搒搉搠搤"],["dda1","搳摃搟搕搘搹搷搢搣搌搦搰搨摁搵搯搊搚摀搥搧搋揧搛搮搡搎敯斒旓暆暌暕暐暋暊暙暔晸朠楦楟椸楎楢楱椿楅楪椹楂楗楙楺楈楉椵楬椳椽楥棰楸椴楩楀楯楄楶楘楁楴楌椻楋椷楜楏楑椲楒椯楻椼歆歅歃歂歈歁殛嗀毻毼"],["de40","毹毷毸溛滖滈溏滀溟溓溔溠溱溹滆滒溽滁溞滉溷溰滍溦滏溲溾滃滜滘溙溒溎溍溤溡溿溳滐滊溗溮溣煇煔煒煣煠煁煝煢煲煸煪煡煂煘煃煋煰煟煐煓"],["dea1","煄煍煚牏犍犌犑犐犎猼獂猻猺獀獊獉瑄瑊瑋瑒瑑瑗瑀瑏瑐瑎瑂瑆瑍瑔瓡瓿瓾瓽甝畹畷榃痯瘏瘃痷痾痼痹痸瘐痻痶痭痵痽皙皵盝睕睟睠睒睖睚睩睧睔睙睭矠碇碚碔碏碄碕碅碆碡碃硹碙碀碖硻祼禂祽祹稑稘稙稒稗稕稢稓"],["df40","稛稐窣窢窞竫筦筤筭筴筩筲筥筳筱筰筡筸筶筣粲粴粯綈綆綀綍絿綅絺綎絻綃絼綌綔綄絽綒罭罫罧罨罬羦羥羧翛翜耡腤腠腷腜腩腛腢腲朡腞腶腧腯"],["dfa1","腄腡舝艉艄艀艂艅蓱萿葖葶葹蒏蒍葥葑葀蒆葧萰葍葽葚葙葴葳葝蔇葞萷萺萴葺葃葸萲葅萩菙葋萯葂萭葟葰萹葎葌葒葯蓅蒎萻葇萶萳葨葾葄萫葠葔葮葐蜋蜄蛷蜌蛺蛖蛵蝍蛸蜎蜉蜁蛶蜍蜅裖裋裍裎裞裛裚裌裐覅覛觟觥觤"],["e040","觡觠觢觜触詶誆詿詡訿詷誂誄詵誃誁詴詺谼豋豊豥豤豦貆貄貅賌赨赩趑趌趎趏趍趓趔趐趒跰跠跬跱跮跐跩跣跢跧跲跫跴輆軿輁輀輅輇輈輂輋遒逿"],["e0a1","遄遉逽鄐鄍鄏鄑鄖鄔鄋鄎酮酯鉈鉒鈰鈺鉦鈳鉥鉞銃鈮鉊鉆鉭鉬鉏鉠鉧鉯鈶鉡鉰鈱鉔鉣鉐鉲鉎鉓鉌鉖鈲閟閜閞閛隒隓隑隗雎雺雽雸雵靳靷靸靲頏頍頎颬飶飹馯馲馰馵骭骫魛鳪鳭鳧麀黽僦僔僗僨僳僛僪僝僤僓僬僰僯僣僠"],["e140","凘劀劁勩勫匰厬嘧嘕嘌嘒嗼嘏嘜嘁嘓嘂嗺嘝嘄嗿嗹墉塼墐墘墆墁塿塴墋塺墇墑墎塶墂墈塻墔墏壾奫嫜嫮嫥嫕嫪嫚嫭嫫嫳嫢嫠嫛嫬嫞嫝嫙嫨嫟孷寠"],["e1a1","寣屣嶂嶀嵽嶆嵺嶁嵷嶊嶉嶈嵾嵼嶍嵹嵿幘幙幓廘廑廗廎廜廕廙廒廔彄彃彯徶愬愨慁慞慱慳慒慓慲慬憀慴慔慺慛慥愻慪慡慖戩戧戫搫摍摛摝摴摶摲摳摽摵摦撦摎撂摞摜摋摓摠摐摿搿摬摫摙摥摷敳斠暡暠暟朅朄朢榱榶槉"],["e240","榠槎榖榰榬榼榑榙榎榧榍榩榾榯榿槄榽榤槔榹槊榚槏榳榓榪榡榞槙榗榐槂榵榥槆歊歍歋殞殟殠毃毄毾滎滵滱漃漥滸漷滻漮漉潎漙漚漧漘漻漒滭漊"],["e2a1","漶潳滹滮漭潀漰漼漵滫漇漎潃漅滽滶漹漜滼漺漟漍漞漈漡熇熐熉熀熅熂熏煻熆熁熗牄牓犗犕犓獃獍獑獌瑢瑳瑱瑵瑲瑧瑮甀甂甃畽疐瘖瘈瘌瘕瘑瘊瘔皸瞁睼瞅瞂睮瞀睯睾瞃碲碪碴碭碨硾碫碞碥碠碬碢碤禘禊禋禖禕禔禓"],["e340","禗禈禒禐稫穊稰稯稨稦窨窫窬竮箈箜箊箑箐箖箍箌箛箎箅箘劄箙箤箂粻粿粼粺綧綷緂綣綪緁緀緅綝緎緄緆緋緌綯綹綖綼綟綦綮綩綡緉罳翢翣翥翞"],["e3a1","耤聝聜膉膆膃膇膍膌膋舕蒗蒤蒡蒟蒺蓎蓂蒬蒮蒫蒹蒴蓁蓍蒪蒚蒱蓐蒝蒧蒻蒢蒔蓇蓌蒛蒩蒯蒨蓖蒘蒶蓏蒠蓗蓔蓒蓛蒰蒑虡蜳蜣蜨蝫蝀蜮蜞蜡蜙蜛蝃蜬蝁蜾蝆蜠蜲蜪蜭蜼蜒蜺蜱蜵蝂蜦蜧蜸蜤蜚蜰蜑裷裧裱裲裺裾裮裼裶裻"],["e440","裰裬裫覝覡覟覞觩觫觨誫誙誋誒誏誖谽豨豩賕賏賗趖踉踂跿踍跽踊踃踇踆踅跾踀踄輐輑輎輍鄣鄜鄠鄢鄟鄝鄚鄤鄡鄛酺酲酹酳銥銤鉶銛鉺銠銔銪銍"],["e4a1","銦銚銫鉹銗鉿銣鋮銎銂銕銢鉽銈銡銊銆銌銙銧鉾銇銩銝銋鈭隞隡雿靘靽靺靾鞃鞀鞂靻鞄鞁靿韎韍頖颭颮餂餀餇馝馜駃馹馻馺駂馽駇骱髣髧鬾鬿魠魡魟鳱鳲鳵麧僿儃儰僸儆儇僶僾儋儌僽儊劋劌勱勯噈噂噌嘵噁噊噉噆噘"],["e540","噚噀嘳嘽嘬嘾嘸嘪嘺圚墫墝墱墠墣墯墬墥墡壿嫿嫴嫽嫷嫶嬃嫸嬂嫹嬁嬇嬅嬏屧嶙嶗嶟嶒嶢嶓嶕嶠嶜嶡嶚嶞幩幝幠幜緳廛廞廡彉徲憋憃慹憱憰憢憉"],["e5a1","憛憓憯憭憟憒憪憡憍慦憳戭摮摰撖撠撅撗撜撏撋撊撌撣撟摨撱撘敶敺敹敻斲斳暵暰暩暲暷暪暯樀樆樗槥槸樕槱槤樠槿槬槢樛樝槾樧槲槮樔槷槧橀樈槦槻樍槼槫樉樄樘樥樏槶樦樇槴樖歑殥殣殢殦氁氀毿氂潁漦潾澇濆澒"],["e640","澍澉澌潢潏澅潚澖潶潬澂潕潲潒潐潗澔澓潝漀潡潫潽潧澐潓澋潩潿澕潣潷潪潻熲熯熛熰熠熚熩熵熝熥熞熤熡熪熜熧熳犘犚獘獒獞獟獠獝獛獡獚獙"],["e6a1","獢璇璉璊璆璁瑽璅璈瑼瑹甈甇畾瘥瘞瘙瘝瘜瘣瘚瘨瘛皜皝皞皛瞍瞏瞉瞈磍碻磏磌磑磎磔磈磃磄磉禚禡禠禜禢禛歶稹窲窴窳箷篋箾箬篎箯箹篊箵糅糈糌糋緷緛緪緧緗緡縃緺緦緶緱緰緮緟罶羬羰羭翭翫翪翬翦翨聤聧膣膟"],["e740","膞膕膢膙膗舖艏艓艒艐艎艑蔤蔻蔏蔀蔩蔎蔉蔍蔟蔊蔧蔜蓻蔫蓺蔈蔌蓴蔪蓲蔕蓷蓫蓳蓼蔒蓪蓩蔖蓾蔨蔝蔮蔂蓽蔞蓶蔱蔦蓧蓨蓰蓯蓹蔘蔠蔰蔋蔙蔯虢"],["e7a1","蝖蝣蝤蝷蟡蝳蝘蝔蝛蝒蝡蝚蝑蝞蝭蝪蝐蝎蝟蝝蝯蝬蝺蝮蝜蝥蝏蝻蝵蝢蝧蝩衚褅褌褔褋褗褘褙褆褖褑褎褉覢覤覣觭觰觬諏諆誸諓諑諔諕誻諗誾諀諅諘諃誺誽諙谾豍貏賥賟賙賨賚賝賧趠趜趡趛踠踣踥踤踮踕踛踖踑踙踦踧"],["e840","踔踒踘踓踜踗踚輬輤輘輚輠輣輖輗遳遰遯遧遫鄯鄫鄩鄪鄲鄦鄮醅醆醊醁醂醄醀鋐鋃鋄鋀鋙銶鋏鋱鋟鋘鋩鋗鋝鋌鋯鋂鋨鋊鋈鋎鋦鋍鋕鋉鋠鋞鋧鋑鋓"],["e8a1","銵鋡鋆銴镼閬閫閮閰隤隢雓霅霈霂靚鞊鞎鞈韐韏頞頝頦頩頨頠頛頧颲餈飺餑餔餖餗餕駜駍駏駓駔駎駉駖駘駋駗駌骳髬髫髳髲髱魆魃魧魴魱魦魶魵魰魨魤魬鳼鳺鳽鳿鳷鴇鴀鳹鳻鴈鴅鴄麃黓鼏鼐儜儓儗儚儑凞匴叡噰噠噮"],["e940","噳噦噣噭噲噞噷圜圛壈墽壉墿墺壂墼壆嬗嬙嬛嬡嬔嬓嬐嬖嬨嬚嬠嬞寯嶬嶱嶩嶧嶵嶰嶮嶪嶨嶲嶭嶯嶴幧幨幦幯廩廧廦廨廥彋徼憝憨憖懅憴懆懁懌憺"],["e9a1","憿憸憌擗擖擐擏擉撽撉擃擛擳擙攳敿敼斢曈暾曀曊曋曏暽暻暺曌朣樴橦橉橧樲橨樾橝橭橶橛橑樨橚樻樿橁橪橤橐橏橔橯橩橠樼橞橖橕橍橎橆歕歔歖殧殪殫毈毇氄氃氆澭濋澣濇澼濎濈潞濄澽澞濊澨瀄澥澮澺澬澪濏澿澸"],["ea40","澢濉澫濍澯澲澰燅燂熿熸燖燀燁燋燔燊燇燏熽燘熼燆燚燛犝犞獩獦獧獬獥獫獪瑿璚璠璔璒璕璡甋疀瘯瘭瘱瘽瘳瘼瘵瘲瘰皻盦瞚瞝瞡瞜瞛瞢瞣瞕瞙"],["eaa1","瞗磝磩磥磪磞磣磛磡磢磭磟磠禤穄穈穇窶窸窵窱窷篞篣篧篝篕篥篚篨篹篔篪篢篜篫篘篟糒糔糗糐糑縒縡縗縌縟縠縓縎縜縕縚縢縋縏縖縍縔縥縤罃罻罼罺羱翯耪耩聬膱膦膮膹膵膫膰膬膴膲膷膧臲艕艖艗蕖蕅蕫蕍蕓蕡蕘"],["eb40","蕀蕆蕤蕁蕢蕄蕑蕇蕣蔾蕛蕱蕎蕮蕵蕕蕧蕠薌蕦蕝蕔蕥蕬虣虥虤螛螏螗螓螒螈螁螖螘蝹螇螣螅螐螑螝螄螔螜螚螉褞褦褰褭褮褧褱褢褩褣褯褬褟觱諠"],["eba1","諢諲諴諵諝謔諤諟諰諈諞諡諨諿諯諻貑貒貐賵賮賱賰賳赬赮趥趧踳踾踸蹀蹅踶踼踽蹁踰踿躽輶輮輵輲輹輷輴遶遹遻邆郺鄳鄵鄶醓醐醑醍醏錧錞錈錟錆錏鍺錸錼錛錣錒錁鍆錭錎錍鋋錝鋺錥錓鋹鋷錴錂錤鋿錩錹錵錪錔錌"],["ec40","錋鋾錉錀鋻錖閼闍閾閹閺閶閿閵閽隩雔霋霒霐鞙鞗鞔韰韸頵頯頲餤餟餧餩馞駮駬駥駤駰駣駪駩駧骹骿骴骻髶髺髹髷鬳鮀鮅鮇魼魾魻鮂鮓鮒鮐魺鮕"],["eca1","魽鮈鴥鴗鴠鴞鴔鴩鴝鴘鴢鴐鴙鴟麈麆麇麮麭黕黖黺鼒鼽儦儥儢儤儠儩勴嚓嚌嚍嚆嚄嚃噾嚂噿嚁壖壔壏壒嬭嬥嬲嬣嬬嬧嬦嬯嬮孻寱寲嶷幬幪徾徻懃憵憼懧懠懥懤懨懞擯擩擣擫擤擨斁斀斶旚曒檍檖檁檥檉檟檛檡檞檇檓檎"],["ed40","檕檃檨檤檑橿檦檚檅檌檒歛殭氉濌澩濴濔濣濜濭濧濦濞濲濝濢濨燡燱燨燲燤燰燢獳獮獯璗璲璫璐璪璭璱璥璯甐甑甒甏疄癃癈癉癇皤盩瞵瞫瞲瞷瞶"],["eda1","瞴瞱瞨矰磳磽礂磻磼磲礅磹磾礄禫禨穜穛穖穘穔穚窾竀竁簅簏篲簀篿篻簎篴簋篳簂簉簃簁篸篽簆篰篱簐簊糨縭縼繂縳顈縸縪繉繀繇縩繌縰縻縶繄縺罅罿罾罽翴翲耬膻臄臌臊臅臇膼臩艛艚艜薃薀薏薧薕薠薋薣蕻薤薚薞"],["ee40","蕷蕼薉薡蕺蕸蕗薎薖薆薍薙薝薁薢薂薈薅蕹蕶薘薐薟虨螾螪螭蟅螰螬螹螵螼螮蟉蟃蟂蟌螷螯蟄蟊螴螶螿螸螽蟞螲褵褳褼褾襁襒褷襂覭覯覮觲觳謞"],["eea1","謘謖謑謅謋謢謏謒謕謇謍謈謆謜謓謚豏豰豲豱豯貕貔賹赯蹎蹍蹓蹐蹌蹇轃轀邅遾鄸醚醢醛醙醟醡醝醠鎡鎃鎯鍤鍖鍇鍼鍘鍜鍶鍉鍐鍑鍠鍭鎏鍌鍪鍹鍗鍕鍒鍏鍱鍷鍻鍡鍞鍣鍧鎀鍎鍙闇闀闉闃闅閷隮隰隬霠霟霘霝霙鞚鞡鞜"],["ef40","鞞鞝韕韔韱顁顄顊顉顅顃餥餫餬餪餳餲餯餭餱餰馘馣馡騂駺駴駷駹駸駶駻駽駾駼騃骾髾髽鬁髼魈鮚鮨鮞鮛鮦鮡鮥鮤鮆鮢鮠鮯鴳鵁鵧鴶鴮鴯鴱鴸鴰"],["efa1","鵅鵂鵃鴾鴷鵀鴽翵鴭麊麉麍麰黈黚黻黿鼤鼣鼢齔龠儱儭儮嚘嚜嚗嚚嚝嚙奰嬼屩屪巀幭幮懘懟懭懮懱懪懰懫懖懩擿攄擽擸攁攃擼斔旛曚曛曘櫅檹檽櫡櫆檺檶檷櫇檴檭歞毉氋瀇瀌瀍瀁瀅瀔瀎濿瀀濻瀦濼濷瀊爁燿燹爃燽獶"],["f040","璸瓀璵瓁璾璶璻瓂甔甓癜癤癙癐癓癗癚皦皽盬矂瞺磿礌礓礔礉礐礒礑禭禬穟簜簩簙簠簟簭簝簦簨簢簥簰繜繐繖繣繘繢繟繑繠繗繓羵羳翷翸聵臑臒"],["f0a1","臐艟艞薴藆藀藃藂薳薵薽藇藄薿藋藎藈藅薱薶藒蘤薸薷薾虩蟧蟦蟢蟛蟫蟪蟥蟟蟳蟤蟔蟜蟓蟭蟘蟣螤蟗蟙蠁蟴蟨蟝襓襋襏襌襆襐襑襉謪謧謣謳謰謵譇謯謼謾謱謥謷謦謶謮謤謻謽謺豂豵貙貘貗賾贄贂贀蹜蹢蹠蹗蹖蹞蹥蹧"],["f140","蹛蹚蹡蹝蹩蹔轆轇轈轋鄨鄺鄻鄾醨醥醧醯醪鎵鎌鎒鎷鎛鎝鎉鎧鎎鎪鎞鎦鎕鎈鎙鎟鎍鎱鎑鎲鎤鎨鎴鎣鎥闒闓闑隳雗雚巂雟雘雝霣霢霥鞬鞮鞨鞫鞤鞪"],["f1a1","鞢鞥韗韙韖韘韺顐顑顒颸饁餼餺騏騋騉騍騄騑騊騅騇騆髀髜鬈鬄鬅鬩鬵魊魌魋鯇鯆鯃鮿鯁鮵鮸鯓鮶鯄鮹鮽鵜鵓鵏鵊鵛鵋鵙鵖鵌鵗鵒鵔鵟鵘鵚麎麌黟鼁鼀鼖鼥鼫鼪鼩鼨齌齕儴儵劖勷厴嚫嚭嚦嚧嚪嚬壚壝壛夒嬽嬾嬿巃幰"],["f240","徿懻攇攐攍攉攌攎斄旞旝曞櫧櫠櫌櫑櫙櫋櫟櫜櫐櫫櫏櫍櫞歠殰氌瀙瀧瀠瀖瀫瀡瀢瀣瀩瀗瀤瀜瀪爌爊爇爂爅犥犦犤犣犡瓋瓅璷瓃甖癠矉矊矄矱礝礛"],["f2a1","礡礜礗礞禰穧穨簳簼簹簬簻糬糪繶繵繸繰繷繯繺繲繴繨罋罊羃羆羷翽翾聸臗臕艤艡艣藫藱藭藙藡藨藚藗藬藲藸藘藟藣藜藑藰藦藯藞藢蠀蟺蠃蟶蟷蠉蠌蠋蠆蟼蠈蟿蠊蠂襢襚襛襗襡襜襘襝襙覈覷覶觶譐譈譊譀譓譖譔譋譕"],["f340","譑譂譒譗豃豷豶貚贆贇贉趬趪趭趫蹭蹸蹳蹪蹯蹻軂轒轑轏轐轓辴酀鄿醰醭鏞鏇鏏鏂鏚鏐鏹鏬鏌鏙鎩鏦鏊鏔鏮鏣鏕鏄鏎鏀鏒鏧镽闚闛雡霩霫霬霨霦"],["f3a1","鞳鞷鞶韝韞韟顜顙顝顗颿颽颻颾饈饇饃馦馧騚騕騥騝騤騛騢騠騧騣騞騜騔髂鬋鬊鬎鬌鬷鯪鯫鯠鯞鯤鯦鯢鯰鯔鯗鯬鯜鯙鯥鯕鯡鯚鵷鶁鶊鶄鶈鵱鶀鵸鶆鶋鶌鵽鵫鵴鵵鵰鵩鶅鵳鵻鶂鵯鵹鵿鶇鵨麔麑黀黼鼭齀齁齍齖齗齘匷嚲"],["f440","嚵嚳壣孅巆巇廮廯忀忁懹攗攖攕攓旟曨曣曤櫳櫰櫪櫨櫹櫱櫮櫯瀼瀵瀯瀷瀴瀱灂瀸瀿瀺瀹灀瀻瀳灁爓爔犨獽獼璺皫皪皾盭矌矎矏矍矲礥礣礧礨礤礩"],["f4a1","禲穮穬穭竷籉籈籊籇籅糮繻繾纁纀羺翿聹臛臙舋艨艩蘢藿蘁藾蘛蘀藶蘄蘉蘅蘌藽蠙蠐蠑蠗蠓蠖襣襦覹觷譠譪譝譨譣譥譧譭趮躆躈躄轙轖轗轕轘轚邍酃酁醷醵醲醳鐋鐓鏻鐠鐏鐔鏾鐕鐐鐨鐙鐍鏵鐀鏷鐇鐎鐖鐒鏺鐉鏸鐊鏿"],["f540","鏼鐌鏶鐑鐆闞闠闟霮霯鞹鞻韽韾顠顢顣顟飁飂饐饎饙饌饋饓騲騴騱騬騪騶騩騮騸騭髇髊髆鬐鬒鬑鰋鰈鯷鰅鰒鯸鱀鰇鰎鰆鰗鰔鰉鶟鶙鶤鶝鶒鶘鶐鶛"],["f5a1","鶠鶔鶜鶪鶗鶡鶚鶢鶨鶞鶣鶿鶩鶖鶦鶧麙麛麚黥黤黧黦鼰鼮齛齠齞齝齙龑儺儹劘劗囃嚽嚾孈孇巋巏廱懽攛欂櫼欃櫸欀灃灄灊灈灉灅灆爝爚爙獾甗癪矐礭礱礯籔籓糲纊纇纈纋纆纍罍羻耰臝蘘蘪蘦蘟蘣蘜蘙蘧蘮蘡蘠蘩蘞蘥"],["f640","蠩蠝蠛蠠蠤蠜蠫衊襭襩襮襫觺譹譸譅譺譻贐贔趯躎躌轞轛轝酆酄酅醹鐿鐻鐶鐩鐽鐼鐰鐹鐪鐷鐬鑀鐱闥闤闣霵霺鞿韡顤飉飆飀饘饖騹騽驆驄驂驁騺"],["f6a1","騿髍鬕鬗鬘鬖鬺魒鰫鰝鰜鰬鰣鰨鰩鰤鰡鶷鶶鶼鷁鷇鷊鷏鶾鷅鷃鶻鶵鷎鶹鶺鶬鷈鶱鶭鷌鶳鷍鶲鹺麜黫黮黭鼛鼘鼚鼱齎齥齤龒亹囆囅囋奱孋孌巕巑廲攡攠攦攢欋欈欉氍灕灖灗灒爞爟犩獿瓘瓕瓙瓗癭皭礵禴穰穱籗籜籙籛籚"],["f740","糴糱纑罏羇臞艫蘴蘵蘳蘬蘲蘶蠬蠨蠦蠪蠥襱覿覾觻譾讄讂讆讅譿贕躕躔躚躒躐躖躗轠轢酇鑌鑐鑊鑋鑏鑇鑅鑈鑉鑆霿韣顪顩飋饔饛驎驓驔驌驏驈驊"],["f7a1","驉驒驐髐鬙鬫鬻魖魕鱆鱈鰿鱄鰹鰳鱁鰼鰷鰴鰲鰽鰶鷛鷒鷞鷚鷋鷐鷜鷑鷟鷩鷙鷘鷖鷵鷕鷝麶黰鼵鼳鼲齂齫龕龢儽劙壨壧奲孍巘蠯彏戁戃戄攩攥斖曫欑欒欏毊灛灚爢玂玁玃癰矔籧籦纕艬蘺虀蘹蘼蘱蘻蘾蠰蠲蠮蠳襶襴襳觾"],["f840","讌讎讋讈豅贙躘轤轣醼鑢鑕鑝鑗鑞韄韅頀驖驙鬞鬟鬠鱒鱘鱐鱊鱍鱋鱕鱙鱌鱎鷻鷷鷯鷣鷫鷸鷤鷶鷡鷮鷦鷲鷰鷢鷬鷴鷳鷨鷭黂黐黲黳鼆鼜鼸鼷鼶齃齏"],["f8a1","齱齰齮齯囓囍孎屭攭曭曮欓灟灡灝灠爣瓛瓥矕礸禷禶籪纗羉艭虃蠸蠷蠵衋讔讕躞躟躠躝醾醽釂鑫鑨鑩雥靆靃靇韇韥驞髕魙鱣鱧鱦鱢鱞鱠鸂鷾鸇鸃鸆鸅鸀鸁鸉鷿鷽鸄麠鼞齆齴齵齶囔攮斸欘欙欗欚灢爦犪矘矙礹籩籫糶纚"],["f940","纘纛纙臠臡虆虇虈襹襺襼襻觿讘讙躥躤躣鑮鑭鑯鑱鑳靉顲饟鱨鱮鱭鸋鸍鸐鸏鸒鸑麡黵鼉齇齸齻齺齹圞灦籯蠼趲躦釃鑴鑸鑶鑵驠鱴鱳鱱鱵鸔鸓黶鼊"],["f9a1","龤灨灥糷虪蠾蠽蠿讞貜躩軉靋顳顴飌饡馫驤驦驧鬤鸕鸗齈戇欞爧虌躨钂钀钁驩驨鬮鸙爩虋讟钃鱹麷癵驫鱺鸝灩灪麤齾齉龘碁銹裏墻恒粧嫺╔╦╗╠╬╣╚╩╝╒╤╕╞╪╡╘╧╛╓╥╖╟╫╢╙╨╜║═╭╮╰╯▓"]]')},function(e,t,r){"use strict";var n,i=r(0).Buffer,a=r(11),o=e.exports;o.encodings=null,o.defaultCharUnicode="�",o.defaultCharSingleByte="?",o.encode=function(e,t,r){e=""+(e||"");var n=o.getEncoder(t,r),a=n.write(e),s=n.end();return s&&s.length>0?i.concat([a,s]):a},o.decode=function(e,t,r){"string"==typeof e&&(o.skipDecodeWarning||(console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding"),o.skipDecodeWarning=!0),e=i.from(""+(e||""),"binary"));var n=o.getDecoder(t,r),a=n.write(e),s=n.end();return s?a+s:a},o.encodingExists=function(e){try{return o.getCodec(e),!0}catch(e){return!1}},o.toEncoding=o.encode,o.fromEncoding=o.decode,o._codecDataCache={},o.getCodec=function(e){o.encodings||(o.encodings=r(12));for(var t=o._canonicalizeEncoding(e),n={};;){var i=o._codecDataCache[t];if(i)return i;var a=o.encodings[t];switch(typeof a){case"string":t=a;break;case"object":for(var s in a)n[s]=a[s];n.encodingName||(n.encodingName=t),t=a.type;break;case"function":return n.encodingName||(n.encodingName=t),i=new a(n,o),o._codecDataCache[n.encodingName]=i,i;default:throw new Error("Encoding not recognized: '"+e+"' (searched as: '"+t+"')")}}},o._canonicalizeEncoding=function(e){return(""+e).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g,"")},o.getEncoder=function(e,t){var r=o.getCodec(e),n=new r.encoder(t,r);return r.bomAware&&t&&t.addBOM&&(n=new a.PrependBOM(n,t)),n},o.getDecoder=function(e,t){var r=o.getCodec(e),n=new r.decoder(t,r);return!r.bomAware||t&&!1===t.stripBOM||(n=new a.StripBOM(n,t)),n},o.enableStreamingAPI=function(e){if(!o.supportsStreams){var t=r(29)(e);o.IconvLiteEncoderStream=t.IconvLiteEncoderStream,o.IconvLiteDecoderStream=t.IconvLiteDecoderStream,o.encodeStream=function(e,t){return new o.IconvLiteEncoderStream(o.getEncoder(e,t),t)},o.decodeStream=function(e,t){return new o.IconvLiteDecoderStream(o.getDecoder(e,t),t)},o.supportsStreams=!0}};try{n=r(30)}catch(e){}n&&n.Transform?o.enableStreamingAPI(n):o.encodeStream=o.decodeStream=function(){throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it.")}},function(e,t){var r,n,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(e){r=a}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var c,f=[],h=!1,u=-1;function d(){h&&c&&(h=!1,c.length?f=c.concat(f):u=-1,f.length&&p())}function p(){if(!h){var e=s(d);h=!0;for(var t=f.length;t;){for(c=f,f=[];++u1)for(var r=1;r0?o-4:o;for(r=0;r>16&255,c[h++]=t>>8&255,c[h++]=255&t;2===s&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,c[h++]=255&t);1===s&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,c[h++]=t>>8&255,c[h++]=255&t);return c},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,a=[],o=0,s=r-i;os?s:o+16383));1===i?(t=e[r-1],a.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],a.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return a.join("")};for(var n=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,c=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function h(e,t,r){for(var i,a,o=[],s=t;s>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ t.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,c=(1<>1,h=-7,u=r?i-1:0,d=r?-1:1,p=e[t+u];for(u+=d,a=p&(1<<-h)-1,p>>=-h,h+=s;h>0;a=256*a+e[t+u],u+=d,h-=8);for(o=a&(1<<-h)-1,a>>=-h,h+=n;h>0;o=256*o+e[t+u],u+=d,h-=8);if(0===a)a=1-f;else{if(a===c)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=f}return(p?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,c,f=8*a-i-1,h=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,l=n?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=h):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),(t+=o+u>=1?d/c:d*Math.pow(2,1-u))*c>=2&&(o++,c/=2),o+u>=h?(s=0,o=h):o+u>=1?(s=(t*c-1)*Math.pow(2,i),o+=u):(s=t*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;e[r+p]=255&s,p+=l,s/=256,i-=8);for(o=o<0;e[r+p]=255&o,p+=l,o/=256,f-=8);e[r+p-l]|=128*b}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){"use strict";function n(e,t){this.encoder=e,this.addBOM=!0}function i(e,t){this.decoder=e,this.pass=!1,this.options=t||{}}t.PrependBOM=n,n.prototype.write=function(e){return this.addBOM&&(e="\ufeff"+e,this.addBOM=!1),this.encoder.write(e)},n.prototype.end=function(){return this.encoder.end()},t.StripBOM=i,i.prototype.write=function(e){var t=this.decoder.write(e);return this.pass||!t||("\ufeff"===t[0]&&(t=t.slice(1),"function"==typeof this.options.stripBOM&&this.options.stripBOM()),this.pass=!0),t},i.prototype.end=function(){return this.decoder.end()}},function(e,t,r){"use strict";for(var n=[r(13),r(16),r(17),r(18),r(19),r(20),r(21),r(22),r(23)],i=0;i>>6),t[r++]=128+(63&a)):(t[r++]=224+(a>>>12),t[r++]=128+(a>>>6&63),t[r++]=128+(63&a))}return t.slice(0,r)},f.prototype.end=function(){},h.prototype.write=function(e){for(var t=this.acc,r=this.contBytes,n=this.accBytes,i="",a=0;a0&&(i+=this.defaultCharUnicode,r=0),o<128?i+=String.fromCharCode(o):o<224?(t=31&o,r=1,n=1):o<240?(t=15&o,r=2,n=1):i+=this.defaultCharUnicode):r>0?(t=t<<6|63&o,n++,0===--r&&(i+=2===n&&t<128&&t>0||3===n&&t<2048?this.defaultCharUnicode:String.fromCharCode(t))):i+=this.defaultCharUnicode}return this.acc=t,this.contBytes=r,this.accBytes=n,i},h.prototype.end=function(){var e=0;return this.contBytes>0&&(e+=this.defaultCharUnicode),e}},function(e,t,r){"use strict";var n=r(15).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.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 a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){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 e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=f,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=h,this.end=u,t=3;break;default:return this.write=d,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function f(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function h(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function u(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}t.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(e.lastNeed=i-1),i;if(--n=0)return i>0&&(e.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){ /*! safe-buffer. MIT License. Feross Aboukhadijeh */ var n=r(2),i=n.Buffer;function a(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(a(n,t),t.Buffer=o),o.prototype=Object.create(i.prototype),a(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t){},function(e,t,r){"use strict";var n=r(0).Buffer;function i(){}function a(){}function o(){this.overflowByte=-1}function s(e,t){this.iconv=t}function c(e,t){void 0===(e=e||{}).addBOM&&(e.addBOM=!0),this.encoder=t.iconv.getEncoder("utf-16le",e)}function f(e,t){this.decoder=null,this.initialBufs=[],this.initialBufsLen=0,this.options=e||{},this.iconv=t.iconv}function h(e,t){var r=[],n=0,i=0,a=0;e:for(var o=0;o=100)break e}return a>i?"utf-16be":a?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�"},ibm864:"cp864",csibm864:"cp864",cp865:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm865:"cp865",csibm865:"cp865",cp866:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ "},ibm866:"cp866",csibm866:"cp866",cp869:{type:"_sbcs",chars:"������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ "},ibm869:"cp869",csibm869:"cp869",cp922:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ"},ibm922:"cp922",csibm922:"cp922",cp1046:{type:"_sbcs",chars:"ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�"},ibm1046:"cp1046",csibm1046:"cp1046",cp1124:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ"},ibm1124:"cp1124",csibm1124:"cp1124",cp1125:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ "},ibm1125:"cp1125",csibm1125:"cp1125",cp1129:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"},ibm1129:"cp1129",csibm1129:"cp1129",cp1133:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�"},ibm1133:"cp1133",csibm1133:"cp1133",cp1161:{type:"_sbcs",chars:"��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ "},ibm1161:"cp1161",csibm1161:"cp1161",cp1162:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"},ibm1162:"cp1162",csibm1162:"cp1162",cp1163:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"},ibm1163:"cp1163",csibm1163:"cp1163",maccroatian:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ"},maccyrillic:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤"},macgreek:{type:"_sbcs",chars:"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�"},maciceland:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},macroman:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},macromania:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},macthai:{type:"_sbcs",chars:"«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู\ufeff​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����"},macturkish:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ"},macukraine:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤"},koi8r:{type:"_sbcs",chars:"─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"},koi8u:{type:"_sbcs",chars:"─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"},koi8ru:{type:"_sbcs",chars:"─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"},koi8t:{type:"_sbcs",chars:"қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"},armscii8:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�"},rk1048:{type:"_sbcs",chars:"ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"},tcvn:{type:"_sbcs",chars:"\0ÚỤỪỬỮ\b\t\n\v\f\rỨỰỲỶỸÝỴ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ"},georgianacademy:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},georgianps:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},pt154:{type:"_sbcs",chars:"ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"},viscii:{type:"_sbcs",chars:"\0ẲẴẪ\b\t\n\v\f\rỶỸỴ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ"},iso646cn:{type:"_sbcs",chars:"\0\b\t\n\v\f\r !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������"},iso646jp:{type:"_sbcs",chars:"\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������"},hproman8:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�"},macintosh:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},ascii:{type:"_sbcs",chars:"��������������������������������������������������������������������������������������������������������������������������������"},tis620:{type:"_sbcs",chars:"���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"}}},function(e,t,r){"use strict";var n=r(0).Buffer;t._dbcs=o;for(var i=new Array(256),a=0;a<256;a++)i[a]=-1;function o(e,t){if(this.encodingName=e.encodingName,!e)throw new Error("DBCS codec is called without the data.");if(!e.table)throw new Error("Encoding '"+this.encodingName+"' has no data.");var r=e.table();this.decodeTables=[],this.decodeTables[0]=i.slice(0),this.decodeTableSeq=[];for(var n=0;n-1e3)throw new Error("gb18030 decode tables conflict at byte 2");for(var h=this.decodeTables[-1e3-c[f]],u=129;u<=254;u++){if(-1===h[u])h[u]=-1e3-o;else{if(h[u]===-1e3-o)continue;if(h[u]>-1e3)throw new Error("gb18030 decode tables conflict at byte 3")}for(var d=this.decodeTables[-1e3-h[u]],p=48;p<=57;p++)-1===d[p]&&(d[p]=-2)}}}this.defaultCharUnicode=t.defaultCharUnicode,this.encodeTable=[],this.encodeTableSeq=[];var l={};if(e.encodeSkipVals)for(n=0;nt)return-1;for(var r=0,n=e.length;r>1);e[i]<=t?r=i:n=i}return r}o.prototype.encoder=s,o.prototype.decoder=c,o.prototype._getDecodeTrieNode=function(e){for(var t=[];e>0;e>>>=8)t.push(255&e);0==t.length&&t.push(0);for(var r=this.decodeTables[0],n=t.length-1;n>0;n--){var a=r[t[n]];if(-1==a)r[t[n]]=-1e3-this.decodeTables.length,this.decodeTables.push(r=i.slice(0));else{if(!(a<=-1e3))throw new Error("Overwrite byte in "+this.encodingName+", addr: "+e.toString(16));r=this.decodeTables[-1e3-a]}}return r},o.prototype._addDecodeChunk=function(e){var t=parseInt(e[0],16),r=this._getDecodeTrieNode(t);t&=255;for(var n=1;n255)throw new Error("Incorrect chunk in "+this.encodingName+" at addr "+e[0]+": too long"+t)},o.prototype._getEncodeBucket=function(e){var t=e>>8;return void 0===this.encodeTable[t]&&(this.encodeTable[t]=i.slice(0)),this.encodeTable[t]},o.prototype._setEncodeChar=function(e,t){var r=this._getEncodeBucket(e),n=255&e;r[n]<=-10?this.encodeTableSeq[-10-r[n]][-1]=t:-1==r[n]&&(r[n]=t)},o.prototype._setEncodeSequence=function(e,t){var r,n=e[0],i=this._getEncodeBucket(n),a=255&n;i[a]<=-10?r=this.encodeTableSeq[-10-i[a]]:(r={},-1!==i[a]&&(r[-1]=i[a]),i[a]=-10-this.encodeTableSeq.length,this.encodeTableSeq.push(r));for(var o=1;o=0)this._setEncodeChar(s,c),i=!0;else if(s<=-1e3){var f=-1e3-s;if(!a[f]){var h=c<<8>>>0;this._fillEncodeTable(f,h,r)?i=!0:a[f]=!0}}else s<=-10&&(this._setEncodeSequence(this.decodeTableSeq[-10-s],c),i=!0)}return i},s.prototype.write=function(e){for(var t=n.alloc(e.length*(this.gb18030?4:3)),r=this.leadSurrogate,i=this.seqObj,a=-1,o=0,s=0;;){if(-1===a){if(o==e.length)break;var c=e.charCodeAt(o++)}else{c=a;a=-1}if(55296<=c&&c<57344)if(c<56320){if(-1===r){r=c;continue}r=c,c=-1}else-1!==r?(c=65536+1024*(r-55296)+(c-56320),r=-1):c=-1;else-1!==r&&(a=c,c=-1,r=-1);var h=-1;if(void 0!==i&&-1!=c){var u=i[c];if("object"==typeof u){i=u;continue}"number"==typeof u?h=u:null==u&&void 0!==(u=i[-1])&&(h=u,a=c),i=void 0}else if(c>=0){var d=this.encodeTable[c>>8];if(void 0!==d&&(h=d[255&c]),h<=-10){i=this.encodeTableSeq[-10-h];continue}if(-1==h&&this.gb18030){var p=f(this.gb18030.uChars,c);if(-1!=p){h=this.gb18030.gbChars[p]+(c-this.gb18030.uChars[p]);t[s++]=129+Math.floor(h/12600),h%=12600,t[s++]=48+Math.floor(h/1260),h%=1260,t[s++]=129+Math.floor(h/10),h%=10,t[s++]=48+h;continue}}}-1===h&&(h=this.defaultCharSingleByte),h<256?t[s++]=h:h<65536?(t[s++]=h>>8,t[s++]=255&h):h<16777216?(t[s++]=h>>16,t[s++]=h>>8&255,t[s++]=255&h):(t[s++]=h>>>24,t[s++]=h>>>16&255,t[s++]=h>>>8&255,t[s++]=255&h)}return this.seqObj=i,this.leadSurrogate=r,t.slice(0,s)},s.prototype.end=function(){if(-1!==this.leadSurrogate||void 0!==this.seqObj){var e=n.alloc(10),t=0;if(this.seqObj){var r=this.seqObj[-1];void 0!==r&&(r<256?e[t++]=r:(e[t++]=r>>8,e[t++]=255&r)),this.seqObj=void 0}return-1!==this.leadSurrogate&&(e[t++]=this.defaultCharSingleByte,this.leadSurrogate=-1),e.slice(0,t)}},s.prototype.findIdx=f,c.prototype.write=function(e){for(var t=n.alloc(2*e.length),r=this.nodeIdx,i=this.prevBytes,a=this.prevBytes.length,o=-this.prevBytes.length,s=0,c=0;s=0?e[s]:i[s+a];if((h=this.decodeTables[r][u])>=0);else if(-1===h)h=this.defaultCharUnicode.charCodeAt(0),s=o;else if(-2===h){if(s>=3)var d=12600*(e[s-3]-129)+1260*(e[s-2]-48)+10*(e[s-1]-129)+(u-48);else d=12600*(i[s-3+a]-129)+1260*((s-2>=0?e[s-2]:i[s-2+a])-48)+10*((s-1>=0?e[s-1]:i[s-1+a])-129)+(u-48);var p=f(this.gb18030.gbChars,d);h=this.gb18030.uChars[p]+d-this.gb18030.gbChars[p]}else{if(h<=-1e3){r=-1e3-h;continue}if(!(h<=-10))throw new Error("iconv-lite internal error: invalid decoding table value "+h+" at "+r+"/"+u);for(var l=this.decodeTableSeq[-10-h],b=0;b>8;h=l[l.length-1]}if(h>=65536){var g=55296|(h-=65536)>>10;t[c++]=255&g,t[c++]=g>>8,h=56320|1023&h}t[c++]=255&h,t[c++]=h>>8,r=0,o=s+1}return this.nodeIdx=r,this.prevBytes=o>=0?Array.prototype.slice.call(e,o):i.slice(o+a).concat(Array.prototype.slice.call(e)),t.slice(0,c).toString("ucs2")},c.prototype.end=function(){for(var e="";this.prevBytes.length>0;){e+=this.defaultCharUnicode;var t=this.prevBytes.slice(1);this.prevBytes=[],this.nodeIdx=0,t.length>0&&(e+=this.write(t))}return this.prevBytes=[],this.nodeIdx=0,e}},function(e,t,r){"use strict";e.exports={shiftjis:{type:"_dbcs",table:function(){return r(24)},encodeAdd:{"¥":92,"‾":126},encodeSkipVals:[{from:60736,to:63808}]},csshiftjis:"shiftjis",mskanji:"shiftjis",sjis:"shiftjis",windows31j:"shiftjis",ms31j:"shiftjis",xsjis:"shiftjis",windows932:"shiftjis",ms932:"shiftjis",932:"shiftjis",cp932:"shiftjis",eucjp:{type:"_dbcs",table:function(){return r(25)},encodeAdd:{"¥":92,"‾":126}},gb2312:"cp936",gb231280:"cp936",gb23121980:"cp936",csgb2312:"cp936",csiso58gb231280:"cp936",euccn:"cp936",windows936:"cp936",ms936:"cp936",936:"cp936",cp936:{type:"_dbcs",table:function(){return r(1)}},gbk:{type:"_dbcs",table:function(){return r(1).concat(r(3))}},xgbk:"gbk",isoir58:"gbk",gb18030:{type:"_dbcs",table:function(){return r(1).concat(r(3))},gb18030:function(){return r(26)},encodeSkipVals:[128],encodeAdd:{"€":41699}},chinese:"gb18030",windows949:"cp949",ms949:"cp949",949:"cp949",cp949:{type:"_dbcs",table:function(){return r(27)}},cseuckr:"cp949",csksc56011987:"cp949",euckr:"cp949",isoir149:"cp949",korean:"cp949",ksc56011987:"cp949",ksc56011989:"cp949",ksc5601:"cp949",windows950:"cp950",ms950:"cp950",950:"cp950",cp950:{type:"_dbcs",table:function(){return r(4)}},big5:"big5hkscs",big5hkscs:{type:"_dbcs",table:function(){return r(4).concat(r(28))},encodeSkipVals:[36457,36463,36478,36523,36532,36557,36560,36695,36713,36718,36811,36862,36973,36986,37060,37084,37105,37311,37551,37552,37553,37554,37585,37959,38090,38361,38652,39285,39798,39800,39803,39878,39902,39916,39926,40002,40019,40034,40040,40043,40055,40124,40125,40144,40279,40282,40388,40431,40443,40617,40687,40701,40800,40907,41079,41180,41183,36812,37576,38468,38637,41636,41637,41639,41638,41676,41678]},cnbig5:"big5hkscs",csbig5:"big5hkscs",xxbig5:"big5hkscs"}},function(e){e.exports=JSON.parse('[["0","\\u0000",128],["a1","。",62],["8140"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×"],["8180","÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇◆□■△▲▽▼※〒→←↑↓〓"],["81b8","∈∋⊆⊇⊂⊃∪∩"],["81c8","∧∨¬⇒⇔∀∃"],["81da","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"],["81f0","ʼn♯♭♪†‡¶"],["81fc","◯"],["824f","0",9],["8260","A",25],["8281","a",25],["829f","ぁ",82],["8340","ァ",62],["8380","ム",22],["839f","Α",16,"Σ",6],["83bf","α",16,"σ",6],["8440","А",5,"ЁЖ",25],["8470","а",5,"ёж",7],["8480","о",17],["849f","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"],["8740","①",19,"Ⅰ",9],["875f","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"],["877e","㍻"],["8780","〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"],["889f","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"],["8940","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円"],["8980","園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"],["8a40","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫"],["8a80","橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"],["8b40","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救"],["8b80","朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"],["8c40","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨"],["8c80","劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"],["8d40","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降"],["8d80","項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"],["8e40","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止"],["8e80","死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"],["8f40","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳"],["8f80","準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"],["9040","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨"],["9080","逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"],["9140","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻"],["9180","操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"],["9240","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄"],["9280","逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"],["9340","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬"],["9380","凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"],["9440","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅"],["9480","楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"],["9540","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷"],["9580","斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"],["9640","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆"],["9680","摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"],["9740","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲"],["9780","沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"],["9840","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"],["989f","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"],["9940","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭"],["9980","凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"],["9a40","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸"],["9a80","噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"],["9b40","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀"],["9b80","它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"],["9c40","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠"],["9c80","怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"],["9d40","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫"],["9d80","捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"],["9e40","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎"],["9e80","梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"],["9f40","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯"],["9f80","麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"],["e040","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝"],["e080","烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"],["e140","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿"],["e180","痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"],["e240","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰"],["e280","窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"],["e340","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷"],["e380","縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"],["e440","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤"],["e480","艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"],["e540","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬"],["e580","蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"],["e640","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧"],["e680","諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"],["e740","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜"],["e780","轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"],["e840","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙"],["e880","閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"],["e940","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃"],["e980","騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"],["ea40","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯"],["ea80","黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠堯槇遙瑤凜熙"],["ed40","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏"],["ed80","塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"],["ee40","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙"],["ee80","蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"],["eeef","ⅰ",9,"¬¦'""],["f040","",62],["f080","",124],["f140","",62],["f180","",124],["f240","",62],["f280","",124],["f340","",62],["f380","",124],["f440","",62],["f480","",124],["f540","",62],["f580","",124],["f640","",62],["f680","",124],["f740","",62],["f780","",124],["f840","",62],["f880","",124],["f940",""],["fa40","ⅰ",9,"Ⅰ",9,"¬¦'"㈱№℡∵纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊"],["fa80","兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯"],["fb40","涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神"],["fb80","祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙"],["fc40","髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"]]')},function(e){e.exports=JSON.parse('[["0","\\u0000",127],["8ea1","。",62],["a1a1"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇"],["a2a1","◆□■△▲▽▼※〒→←↑↓〓"],["a2ba","∈∋⊆⊇⊂⊃∪∩"],["a2ca","∧∨¬⇒⇔∀∃"],["a2dc","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"],["a2f2","ʼn♯♭♪†‡¶"],["a2fe","◯"],["a3b0","0",9],["a3c1","A",25],["a3e1","a",25],["a4a1","ぁ",82],["a5a1","ァ",85],["a6a1","Α",16,"Σ",6],["a6c1","α",16,"σ",6],["a7a1","А",5,"ЁЖ",25],["a7d1","а",5,"ёж",25],["a8a1","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"],["ada1","①",19,"Ⅰ",9],["adc0","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"],["addf","㍻〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"],["b0a1","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"],["b1a1","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応"],["b2a1","押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"],["b3a1","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱"],["b4a1","粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"],["b5a1","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京"],["b6a1","供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"],["b7a1","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲"],["b8a1","検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"],["b9a1","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込"],["baa1","此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"],["bba1","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時"],["bca1","次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"],["bda1","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償"],["bea1","勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"],["bfa1","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾"],["c0a1","澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"],["c1a1","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎"],["c2a1","臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"],["c3a1","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵"],["c4a1","帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"],["c5a1","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到"],["c6a1","董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"],["c7a1","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦"],["c8a1","函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"],["c9a1","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服"],["caa1","福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"],["cba1","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満"],["cca1","漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"],["cda1","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃"],["cea1","痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"],["cfa1","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"],["d0a1","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"],["d1a1","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨"],["d2a1","辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"],["d3a1","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉"],["d4a1","圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"],["d5a1","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓"],["d6a1","屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"],["d7a1","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚"],["d8a1","悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"],["d9a1","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼"],["daa1","據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"],["dba1","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍"],["dca1","棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"],["dda1","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾"],["dea1","沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"],["dfa1","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼"],["e0a1","燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"],["e1a1","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰"],["e2a1","癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"],["e3a1","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐"],["e4a1","筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"],["e5a1","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺"],["e6a1","罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"],["e7a1","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙"],["e8a1","茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"],["e9a1","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙"],["eaa1","蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"],["eba1","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫"],["eca1","譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"],["eda1","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸"],["eea1","遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"],["efa1","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞"],["f0a1","陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"],["f1a1","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷"],["f2a1","髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"],["f3a1","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠"],["f4a1","堯槇遙瑤凜熙"],["f9a1","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德"],["faa1","忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"],["fba1","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚"],["fca1","釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"],["fcf1","ⅰ",9,"¬¦'""],["8fa2af","˘ˇ¸˙˝¯˛˚~΄΅"],["8fa2c2","¡¦¿"],["8fa2eb","ºª©®™¤№"],["8fa6e1","ΆΈΉΊΪ"],["8fa6e7","Ό"],["8fa6e9","ΎΫ"],["8fa6ec","Ώ"],["8fa6f1","άέήίϊΐόςύϋΰώ"],["8fa7c2","Ђ",10,"ЎЏ"],["8fa7f2","ђ",10,"ўџ"],["8fa9a1","ÆĐ"],["8fa9a4","Ħ"],["8fa9a6","IJ"],["8fa9a8","ŁĿ"],["8fa9ab","ŊØŒ"],["8fa9af","ŦÞ"],["8fa9c1","æđðħıijĸłŀʼnŋøœßŧþ"],["8faaa1","ÁÀÄÂĂǍĀĄÅÃĆĈČÇĊĎÉÈËÊĚĖĒĘ"],["8faaba","ĜĞĢĠĤÍÌÏÎǏİĪĮĨĴĶĹĽĻŃŇŅÑÓÒÖÔǑŐŌÕŔŘŖŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙǕŴÝŸŶŹŽŻ"],["8faba1","áàäâăǎāąåãćĉčçċďéèëêěėēęǵĝğ"],["8fabbd","ġĥíìïîǐ"],["8fabc5","īįĩĵķĺľļńňņñóòöôǒőōõŕřŗśŝšşťţúùüûŭǔűūųůũǘǜǚǖŵýÿŷźžż"],["8fb0a1","丂丄丅丌丒丟丣两丨丫丮丯丰丵乀乁乄乇乑乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘佟佣佪佬佮佱佷佸佹佺佽佾侁侂侄"],["8fb1a1","侅侉侊侌侎侐侒侓侔侗侙侚侞侟侲侷侹侻侼侽侾俀俁俅俆俈俉俋俌俍俏俒俜俠俢俰俲俼俽俿倀倁倄倇倊倌倎倐倓倗倘倛倜倝倞倢倧倮倰倲倳倵偀偁偂偅偆偊偌偎偑偒偓偗偙偟偠偢偣偦偧偪偭偰偱倻傁傃傄傆傊傎傏傐"],["8fb2a1","傒傓傔傖傛傜傞",4,"傪傯傰傹傺傽僀僃僄僇僌僎僐僓僔僘僜僝僟僢僤僦僨僩僯僱僶僺僾儃儆儇儈儋儌儍儎僲儐儗儙儛儜儝儞儣儧儨儬儭儯儱儳儴儵儸儹兂兊兏兓兕兗兘兟兤兦兾冃冄冋冎冘冝冡冣冭冸冺冼冾冿凂"],["8fb3a1","凈减凑凒凓凕凘凞凢凥凮凲凳凴凷刁刂刅划刓刕刖刘刢刨刱刲刵刼剅剉剕剗剘剚剜剟剠剡剦剮剷剸剹劀劂劅劊劌劓劕劖劗劘劚劜劤劥劦劧劯劰劶劷劸劺劻劽勀勄勆勈勌勏勑勔勖勛勜勡勥勨勩勪勬勰勱勴勶勷匀匃匊匋"],["8fb4a1","匌匑匓匘匛匜匞匟匥匧匨匩匫匬匭匰匲匵匼匽匾卂卌卋卙卛卡卣卥卬卭卲卹卾厃厇厈厎厓厔厙厝厡厤厪厫厯厲厴厵厷厸厺厽叀叅叏叒叓叕叚叝叞叠另叧叵吂吓吚吡吧吨吪启吱吴吵呃呄呇呍呏呞呢呤呦呧呩呫呭呮呴呿"],["8fb5a1","咁咃咅咈咉咍咑咕咖咜咟咡咦咧咩咪咭咮咱咷咹咺咻咿哆哊响哎哠哪哬哯哶哼哾哿唀唁唅唈唉唌唍唎唕唪唫唲唵唶唻唼唽啁啇啉啊啍啐啑啘啚啛啞啠啡啤啦啿喁喂喆喈喎喏喑喒喓喔喗喣喤喭喲喿嗁嗃嗆嗉嗋嗌嗎嗑嗒"],["8fb6a1","嗓嗗嗘嗛嗞嗢嗩嗶嗿嘅嘈嘊嘍",5,"嘙嘬嘰嘳嘵嘷嘹嘻嘼嘽嘿噀噁噃噄噆噉噋噍噏噔噞噠噡噢噣噦噩噭噯噱噲噵嚄嚅嚈嚋嚌嚕嚙嚚嚝嚞嚟嚦嚧嚨嚩嚫嚬嚭嚱嚳嚷嚾囅囉囊囋囏囐囌囍囙囜囝囟囡囤",4,"囱囫园"],["8fb7a1","囶囷圁圂圇圊圌圑圕圚圛圝圠圢圣圤圥圩圪圬圮圯圳圴圽圾圿坅坆坌坍坒坢坥坧坨坫坭",4,"坳坴坵坷坹坺坻坼坾垁垃垌垔垗垙垚垜垝垞垟垡垕垧垨垩垬垸垽埇埈埌埏埕埝埞埤埦埧埩埭埰埵埶埸埽埾埿堃堄堈堉埡"],["8fb8a1","堌堍堛堞堟堠堦堧堭堲堹堿塉塌塍塏塐塕塟塡塤塧塨塸塼塿墀墁墇墈墉墊墌墍墏墐墔墖墝墠墡墢墦墩墱墲壄墼壂壈壍壎壐壒壔壖壚壝壡壢壩壳夅夆夋夌夒夓夔虁夝夡夣夤夨夯夰夳夵夶夿奃奆奒奓奙奛奝奞奟奡奣奫奭"],["8fb9a1","奯奲奵奶她奻奼妋妌妎妒妕妗妟妤妧妭妮妯妰妳妷妺妼姁姃姄姈姊姍姒姝姞姟姣姤姧姮姯姱姲姴姷娀娄娌娍娎娒娓娞娣娤娧娨娪娭娰婄婅婇婈婌婐婕婞婣婥婧婭婷婺婻婾媋媐媓媖媙媜媞媟媠媢媧媬媱媲媳媵媸媺媻媿"],["8fbaa1","嫄嫆嫈嫏嫚嫜嫠嫥嫪嫮嫵嫶嫽嬀嬁嬈嬗嬴嬙嬛嬝嬡嬥嬭嬸孁孋孌孒孖孞孨孮孯孼孽孾孿宁宄宆宊宎宐宑宓宔宖宨宩宬宭宯宱宲宷宺宼寀寁寍寏寖",4,"寠寯寱寴寽尌尗尞尟尣尦尩尫尬尮尰尲尵尶屙屚屜屢屣屧屨屩"],["8fbba1","屭屰屴屵屺屻屼屽岇岈岊岏岒岝岟岠岢岣岦岪岲岴岵岺峉峋峒峝峗峮峱峲峴崁崆崍崒崫崣崤崦崧崱崴崹崽崿嵂嵃嵆嵈嵕嵑嵙嵊嵟嵠嵡嵢嵤嵪嵭嵰嵹嵺嵾嵿嶁嶃嶈嶊嶒嶓嶔嶕嶙嶛嶟嶠嶧嶫嶰嶴嶸嶹巃巇巋巐巎巘巙巠巤"],["8fbca1","巩巸巹帀帇帍帒帔帕帘帟帠帮帨帲帵帾幋幐幉幑幖幘幛幜幞幨幪",4,"幰庀庋庎庢庤庥庨庪庬庱庳庽庾庿廆廌廋廎廑廒廔廕廜廞廥廫异弆弇弈弎弙弜弝弡弢弣弤弨弫弬弮弰弴弶弻弽弿彀彄彅彇彍彐彔彘彛彠彣彤彧"],["8fbda1","彯彲彴彵彸彺彽彾徉徍徏徖徜徝徢徧徫徤徬徯徰徱徸忄忇忈忉忋忐",4,"忞忡忢忨忩忪忬忭忮忯忲忳忶忺忼怇怊怍怓怔怗怘怚怟怤怭怳怵恀恇恈恉恌恑恔恖恗恝恡恧恱恾恿悂悆悈悊悎悑悓悕悘悝悞悢悤悥您悰悱悷"],["8fbea1","悻悾惂惄惈惉惊惋惎惏惔惕惙惛惝惞惢惥惲惵惸惼惽愂愇愊愌愐",4,"愖愗愙愜愞愢愪愫愰愱愵愶愷愹慁慅慆慉慞慠慬慲慸慻慼慿憀憁憃憄憋憍憒憓憗憘憜憝憟憠憥憨憪憭憸憹憼懀懁懂懎懏懕懜懝懞懟懡懢懧懩懥"],["8fbfa1","懬懭懯戁戃戄戇戓戕戜戠戢戣戧戩戫戹戽扂扃扄扆扌扐扑扒扔扖扚扜扤扭扯扳扺扽抍抎抏抐抦抨抳抶抷抺抾抿拄拎拕拖拚拪拲拴拼拽挃挄挊挋挍挐挓挖挘挩挪挭挵挶挹挼捁捂捃捄捆捊捋捎捒捓捔捘捛捥捦捬捭捱捴捵"],["8fc0a1","捸捼捽捿掂掄掇掊掐掔掕掙掚掞掤掦掭掮掯掽揁揅揈揎揑揓揔揕揜揠揥揪揬揲揳揵揸揹搉搊搐搒搔搘搞搠搢搤搥搩搪搯搰搵搽搿摋摏摑摒摓摔摚摛摜摝摟摠摡摣摭摳摴摻摽撅撇撏撐撑撘撙撛撝撟撡撣撦撨撬撳撽撾撿"],["8fc1a1","擄擉擊擋擌擎擐擑擕擗擤擥擩擪擭擰擵擷擻擿攁攄攈攉攊攏攓攔攖攙攛攞攟攢攦攩攮攱攺攼攽敃敇敉敐敒敔敟敠敧敫敺敽斁斅斊斒斕斘斝斠斣斦斮斲斳斴斿旂旈旉旎旐旔旖旘旟旰旲旴旵旹旾旿昀昄昈昉昍昑昒昕昖昝"],["8fc2a1","昞昡昢昣昤昦昩昪昫昬昮昰昱昳昹昷晀晅晆晊晌晑晎晗晘晙晛晜晠晡曻晪晫晬晾晳晵晿晷晸晹晻暀晼暋暌暍暐暒暙暚暛暜暟暠暤暭暱暲暵暻暿曀曂曃曈曌曎曏曔曛曟曨曫曬曮曺朅朇朎朓朙朜朠朢朳朾杅杇杈杌杔杕杝"],["8fc3a1","杦杬杮杴杶杻极构枎枏枑枓枖枘枙枛枰枱枲枵枻枼枽柹柀柂柃柅柈柉柒柗柙柜柡柦柰柲柶柷桒栔栙栝栟栨栧栬栭栯栰栱栳栻栿桄桅桊桌桕桗桘桛桫桮",4,"桵桹桺桻桼梂梄梆梈梖梘梚梜梡梣梥梩梪梮梲梻棅棈棌棏"],["8fc4a1","棐棑棓棖棙棜棝棥棨棪棫棬棭棰棱棵棶棻棼棽椆椉椊椐椑椓椖椗椱椳椵椸椻楂楅楉楎楗楛楣楤楥楦楨楩楬楰楱楲楺楻楿榀榍榒榖榘榡榥榦榨榫榭榯榷榸榺榼槅槈槑槖槗槢槥槮槯槱槳槵槾樀樁樃樏樑樕樚樝樠樤樨樰樲"],["8fc5a1","樴樷樻樾樿橅橆橉橊橎橐橑橒橕橖橛橤橧橪橱橳橾檁檃檆檇檉檋檑檛檝檞檟檥檫檯檰檱檴檽檾檿櫆櫉櫈櫌櫐櫔櫕櫖櫜櫝櫤櫧櫬櫰櫱櫲櫼櫽欂欃欆欇欉欏欐欑欗欛欞欤欨欫欬欯欵欶欻欿歆歊歍歒歖歘歝歠歧歫歮歰歵歽"],["8fc6a1","歾殂殅殗殛殟殠殢殣殨殩殬殭殮殰殸殹殽殾毃毄毉毌毖毚毡毣毦毧毮毱毷毹毿氂氄氅氉氍氎氐氒氙氟氦氧氨氬氮氳氵氶氺氻氿汊汋汍汏汒汔汙汛汜汫汭汯汴汶汸汹汻沅沆沇沉沔沕沗沘沜沟沰沲沴泂泆泍泏泐泑泒泔泖"],["8fc7a1","泚泜泠泧泩泫泬泮泲泴洄洇洊洎洏洑洓洚洦洧洨汧洮洯洱洹洼洿浗浞浟浡浥浧浯浰浼涂涇涑涒涔涖涗涘涪涬涴涷涹涽涿淄淈淊淎淏淖淛淝淟淠淢淥淩淯淰淴淶淼渀渄渞渢渧渲渶渹渻渼湄湅湈湉湋湏湑湒湓湔湗湜湝湞"],["8fc8a1","湢湣湨湳湻湽溍溓溙溠溧溭溮溱溳溻溿滀滁滃滇滈滊滍滎滏滫滭滮滹滻滽漄漈漊漌漍漖漘漚漛漦漩漪漯漰漳漶漻漼漭潏潑潒潓潗潙潚潝潞潡潢潨潬潽潾澃澇澈澋澌澍澐澒澓澔澖澚澟澠澥澦澧澨澮澯澰澵澶澼濅濇濈濊"],["8fc9a1","濚濞濨濩濰濵濹濼濽瀀瀅瀆瀇瀍瀗瀠瀣瀯瀴瀷瀹瀼灃灄灈灉灊灋灔灕灝灞灎灤灥灬灮灵灶灾炁炅炆炔",4,"炛炤炫炰炱炴炷烊烑烓烔烕烖烘烜烤烺焃",4,"焋焌焏焞焠焫焭焯焰焱焸煁煅煆煇煊煋煐煒煗煚煜煞煠"],["8fcaa1","煨煹熀熅熇熌熒熚熛熠熢熯熰熲熳熺熿燀燁燄燋燌燓燖燙燚燜燸燾爀爇爈爉爓爗爚爝爟爤爫爯爴爸爹牁牂牃牅牎牏牐牓牕牖牚牜牞牠牣牨牫牮牯牱牷牸牻牼牿犄犉犍犎犓犛犨犭犮犱犴犾狁狇狉狌狕狖狘狟狥狳狴狺狻"],["8fcba1","狾猂猄猅猇猋猍猒猓猘猙猞猢猤猧猨猬猱猲猵猺猻猽獃獍獐獒獖獘獝獞獟獠獦獧獩獫獬獮獯獱獷獹獼玀玁玃玅玆玎玐玓玕玗玘玜玞玟玠玢玥玦玪玫玭玵玷玹玼玽玿珅珆珉珋珌珏珒珓珖珙珝珡珣珦珧珩珴珵珷珹珺珻珽"],["8fcca1","珿琀琁琄琇琊琑琚琛琤琦琨",9,"琹瑀瑃瑄瑆瑇瑋瑍瑑瑒瑗瑝瑢瑦瑧瑨瑫瑭瑮瑱瑲璀璁璅璆璇璉璏璐璑璒璘璙璚璜璟璠璡璣璦璨璩璪璫璮璯璱璲璵璹璻璿瓈瓉瓌瓐瓓瓘瓚瓛瓞瓟瓤瓨瓪瓫瓯瓴瓺瓻瓼瓿甆"],["8fcda1","甒甖甗甠甡甤甧甩甪甯甶甹甽甾甿畀畃畇畈畎畐畒畗畞畟畡畯畱畹",5,"疁疅疐疒疓疕疙疜疢疤疴疺疿痀痁痄痆痌痎痏痗痜痟痠痡痤痧痬痮痯痱痹瘀瘂瘃瘄瘇瘈瘊瘌瘏瘒瘓瘕瘖瘙瘛瘜瘝瘞瘣瘥瘦瘩瘭瘲瘳瘵瘸瘹"],["8fcea1","瘺瘼癊癀癁癃癄癅癉癋癕癙癟癤癥癭癮癯癱癴皁皅皌皍皕皛皜皝皟皠皢",6,"皪皭皽盁盅盉盋盌盎盔盙盠盦盨盬盰盱盶盹盼眀眆眊眎眒眔眕眗眙眚眜眢眨眭眮眯眴眵眶眹眽眾睂睅睆睊睍睎睏睒睖睗睜睞睟睠睢"],["8fcfa1","睤睧睪睬睰睲睳睴睺睽瞀瞄瞌瞍瞔瞕瞖瞚瞟瞢瞧瞪瞮瞯瞱瞵瞾矃矉矑矒矕矙矞矟矠矤矦矪矬矰矱矴矸矻砅砆砉砍砎砑砝砡砢砣砭砮砰砵砷硃硄硇硈硌硎硒硜硞硠硡硣硤硨硪确硺硾碊碏碔碘碡碝碞碟碤碨碬碭碰碱碲碳"],["8fd0a1","碻碽碿磇磈磉磌磎磒磓磕磖磤磛磟磠磡磦磪磲磳礀磶磷磺磻磿礆礌礐礚礜礞礟礠礥礧礩礭礱礴礵礻礽礿祄祅祆祊祋祏祑祔祘祛祜祧祩祫祲祹祻祼祾禋禌禑禓禔禕禖禘禛禜禡禨禩禫禯禱禴禸离秂秄秇秈秊秏秔秖秚秝秞"],["8fd1a1","秠秢秥秪秫秭秱秸秼稂稃稇稉稊稌稑稕稛稞稡稧稫稭稯稰稴稵稸稹稺穄穅穇穈穌穕穖穙穜穝穟穠穥穧穪穭穵穸穾窀窂窅窆窊窋窐窑窔窞窠窣窬窳窵窹窻窼竆竉竌竎竑竛竨竩竫竬竱竴竻竽竾笇笔笟笣笧笩笪笫笭笮笯笰"],["8fd2a1","笱笴笽笿筀筁筇筎筕筠筤筦筩筪筭筯筲筳筷箄箉箎箐箑箖箛箞箠箥箬箯箰箲箵箶箺箻箼箽篂篅篈篊篔篖篗篙篚篛篨篪篲篴篵篸篹篺篼篾簁簂簃簄簆簉簋簌簎簏簙簛簠簥簦簨簬簱簳簴簶簹簺籆籊籕籑籒籓籙",5],["8fd3a1","籡籣籧籩籭籮籰籲籹籼籽粆粇粏粔粞粠粦粰粶粷粺粻粼粿糄糇糈糉糍糏糓糔糕糗糙糚糝糦糩糫糵紃紇紈紉紏紑紒紓紖紝紞紣紦紪紭紱紼紽紾絀絁絇絈絍絑絓絗絙絚絜絝絥絧絪絰絸絺絻絿綁綂綃綅綆綈綋綌綍綑綖綗綝"],["8fd4a1","綞綦綧綪綳綶綷綹緂",4,"緌緍緎緗緙縀緢緥緦緪緫緭緱緵緶緹緺縈縐縑縕縗縜縝縠縧縨縬縭縯縳縶縿繄繅繇繎繐繒繘繟繡繢繥繫繮繯繳繸繾纁纆纇纊纍纑纕纘纚纝纞缼缻缽缾缿罃罄罇罏罒罓罛罜罝罡罣罤罥罦罭"],["8fd5a1","罱罽罾罿羀羋羍羏羐羑羖羗羜羡羢羦羪羭羴羼羿翀翃翈翎翏翛翟翣翥翨翬翮翯翲翺翽翾翿耇耈耊耍耎耏耑耓耔耖耝耞耟耠耤耦耬耮耰耴耵耷耹耺耼耾聀聄聠聤聦聭聱聵肁肈肎肜肞肦肧肫肸肹胈胍胏胒胔胕胗胘胠胭胮"],["8fd6a1","胰胲胳胶胹胺胾脃脋脖脗脘脜脞脠脤脧脬脰脵脺脼腅腇腊腌腒腗腠腡腧腨腩腭腯腷膁膐膄膅膆膋膎膖膘膛膞膢膮膲膴膻臋臃臅臊臎臏臕臗臛臝臞臡臤臫臬臰臱臲臵臶臸臹臽臿舀舃舏舓舔舙舚舝舡舢舨舲舴舺艃艄艅艆"],["8fd7a1","艋艎艏艑艖艜艠艣艧艭艴艻艽艿芀芁芃芄芇芉芊芎芑芔芖芘芚芛芠芡芣芤芧芨芩芪芮芰芲芴芷芺芼芾芿苆苐苕苚苠苢苤苨苪苭苯苶苷苽苾茀茁茇茈茊茋荔茛茝茞茟茡茢茬茭茮茰茳茷茺茼茽荂荃荄荇荍荎荑荕荖荗荰荸"],["8fd8a1","荽荿莀莂莄莆莍莒莔莕莘莙莛莜莝莦莧莩莬莾莿菀菇菉菏菐菑菔菝荓菨菪菶菸菹菼萁萆萊萏萑萕萙莭萯萹葅葇葈葊葍葏葑葒葖葘葙葚葜葠葤葥葧葪葰葳葴葶葸葼葽蒁蒅蒒蒓蒕蒞蒦蒨蒩蒪蒯蒱蒴蒺蒽蒾蓀蓂蓇蓈蓌蓏蓓"],["8fd9a1","蓜蓧蓪蓯蓰蓱蓲蓷蔲蓺蓻蓽蔂蔃蔇蔌蔎蔐蔜蔞蔢蔣蔤蔥蔧蔪蔫蔯蔳蔴蔶蔿蕆蕏",4,"蕖蕙蕜",6,"蕤蕫蕯蕹蕺蕻蕽蕿薁薅薆薉薋薌薏薓薘薝薟薠薢薥薧薴薶薷薸薼薽薾薿藂藇藊藋藎薭藘藚藟藠藦藨藭藳藶藼"],["8fdaa1","藿蘀蘄蘅蘍蘎蘐蘑蘒蘘蘙蘛蘞蘡蘧蘩蘶蘸蘺蘼蘽虀虂虆虒虓虖虗虘虙虝虠",4,"虩虬虯虵虶虷虺蚍蚑蚖蚘蚚蚜蚡蚦蚧蚨蚭蚱蚳蚴蚵蚷蚸蚹蚿蛀蛁蛃蛅蛑蛒蛕蛗蛚蛜蛠蛣蛥蛧蚈蛺蛼蛽蜄蜅蜇蜋蜎蜏蜐蜓蜔蜙蜞蜟蜡蜣"],["8fdba1","蜨蜮蜯蜱蜲蜹蜺蜼蜽蜾蝀蝃蝅蝍蝘蝝蝡蝤蝥蝯蝱蝲蝻螃",6,"螋螌螐螓螕螗螘螙螞螠螣螧螬螭螮螱螵螾螿蟁蟈蟉蟊蟎蟕蟖蟙蟚蟜蟟蟢蟣蟤蟪蟫蟭蟱蟳蟸蟺蟿蠁蠃蠆蠉蠊蠋蠐蠙蠒蠓蠔蠘蠚蠛蠜蠞蠟蠨蠭蠮蠰蠲蠵"],["8fdca1","蠺蠼衁衃衅衈衉衊衋衎衑衕衖衘衚衜衟衠衤衩衱衹衻袀袘袚袛袜袟袠袨袪袺袽袾裀裊",4,"裑裒裓裛裞裧裯裰裱裵裷褁褆褍褎褏褕褖褘褙褚褜褠褦褧褨褰褱褲褵褹褺褾襀襂襅襆襉襏襒襗襚襛襜襡襢襣襫襮襰襳襵襺"],["8fdda1","襻襼襽覉覍覐覔覕覛覜覟覠覥覰覴覵覶覷覼觔",4,"觥觩觫觭觱觳觶觹觽觿訄訅訇訏訑訒訔訕訞訠訢訤訦訫訬訯訵訷訽訾詀詃詅詇詉詍詎詓詖詗詘詜詝詡詥詧詵詶詷詹詺詻詾詿誀誃誆誋誏誐誒誖誗誙誟誧誩誮誯誳"],["8fdea1","誶誷誻誾諃諆諈諉諊諑諓諔諕諗諝諟諬諰諴諵諶諼諿謅謆謋謑謜謞謟謊謭謰謷謼譂",4,"譈譒譓譔譙譍譞譣譭譶譸譹譼譾讁讄讅讋讍讏讔讕讜讞讟谸谹谽谾豅豇豉豋豏豑豓豔豗豘豛豝豙豣豤豦豨豩豭豳豵豶豻豾貆"],["8fdfa1","貇貋貐貒貓貙貛貜貤貹貺賅賆賉賋賏賖賕賙賝賡賨賬賯賰賲賵賷賸賾賿贁贃贉贒贗贛赥赩赬赮赿趂趄趈趍趐趑趕趞趟趠趦趫趬趯趲趵趷趹趻跀跅跆跇跈跊跎跑跔跕跗跙跤跥跧跬跰趼跱跲跴跽踁踄踅踆踋踑踔踖踠踡踢"],["8fe0a1","踣踦踧踱踳踶踷踸踹踽蹀蹁蹋蹍蹎蹏蹔蹛蹜蹝蹞蹡蹢蹩蹬蹭蹯蹰蹱蹹蹺蹻躂躃躉躐躒躕躚躛躝躞躢躧躩躭躮躳躵躺躻軀軁軃軄軇軏軑軔軜軨軮軰軱軷軹軺軭輀輂輇輈輏輐輖輗輘輞輠輡輣輥輧輨輬輭輮輴輵輶輷輺轀轁"],["8fe1a1","轃轇轏轑",4,"轘轝轞轥辝辠辡辤辥辦辵辶辸达迀迁迆迊迋迍运迒迓迕迠迣迤迨迮迱迵迶迻迾适逄逈逌逘逛逨逩逯逪逬逭逳逴逷逿遃遄遌遛遝遢遦遧遬遰遴遹邅邈邋邌邎邐邕邗邘邙邛邠邡邢邥邰邲邳邴邶邽郌邾郃"],["8fe2a1","郄郅郇郈郕郗郘郙郜郝郟郥郒郶郫郯郰郴郾郿鄀鄄鄅鄆鄈鄍鄐鄔鄖鄗鄘鄚鄜鄞鄠鄥鄢鄣鄧鄩鄮鄯鄱鄴鄶鄷鄹鄺鄼鄽酃酇酈酏酓酗酙酚酛酡酤酧酭酴酹酺酻醁醃醅醆醊醎醑醓醔醕醘醞醡醦醨醬醭醮醰醱醲醳醶醻醼醽醿"],["8fe3a1","釂釃釅釓釔釗釙釚釞釤釥釩釪釬",5,"釷釹釻釽鈀鈁鈄鈅鈆鈇鈉鈊鈌鈐鈒鈓鈖鈘鈜鈝鈣鈤鈥鈦鈨鈮鈯鈰鈳鈵鈶鈸鈹鈺鈼鈾鉀鉂鉃鉆鉇鉊鉍鉎鉏鉑鉘鉙鉜鉝鉠鉡鉥鉧鉨鉩鉮鉯鉰鉵",4,"鉻鉼鉽鉿銈銉銊銍銎銒銗"],["8fe4a1","銙銟銠銤銥銧銨銫銯銲銶銸銺銻銼銽銿",4,"鋅鋆鋇鋈鋋鋌鋍鋎鋐鋓鋕鋗鋘鋙鋜鋝鋟鋠鋡鋣鋥鋧鋨鋬鋮鋰鋹鋻鋿錀錂錈錍錑錔錕錜錝錞錟錡錤錥錧錩錪錳錴錶錷鍇鍈鍉鍐鍑鍒鍕鍗鍘鍚鍞鍤鍥鍧鍩鍪鍭鍯鍰鍱鍳鍴鍶"],["8fe5a1","鍺鍽鍿鎀鎁鎂鎈鎊鎋鎍鎏鎒鎕鎘鎛鎞鎡鎣鎤鎦鎨鎫鎴鎵鎶鎺鎩鏁鏄鏅鏆鏇鏉",4,"鏓鏙鏜鏞鏟鏢鏦鏧鏹鏷鏸鏺鏻鏽鐁鐂鐄鐈鐉鐍鐎鐏鐕鐖鐗鐟鐮鐯鐱鐲鐳鐴鐻鐿鐽鑃鑅鑈鑊鑌鑕鑙鑜鑟鑡鑣鑨鑫鑭鑮鑯鑱鑲钄钃镸镹"],["8fe6a1","镾閄閈閌閍閎閝閞閟閡閦閩閫閬閴閶閺閽閿闆闈闉闋闐闑闒闓闙闚闝闞闟闠闤闦阝阞阢阤阥阦阬阱阳阷阸阹阺阼阽陁陒陔陖陗陘陡陮陴陻陼陾陿隁隂隃隄隉隑隖隚隝隟隤隥隦隩隮隯隳隺雊雒嶲雘雚雝雞雟雩雯雱雺霂"],["8fe7a1","霃霅霉霚霛霝霡霢霣霨霱霳靁靃靊靎靏靕靗靘靚靛靣靧靪靮靳靶靷靸靻靽靿鞀鞉鞕鞖鞗鞙鞚鞞鞟鞢鞬鞮鞱鞲鞵鞶鞸鞹鞺鞼鞾鞿韁韄韅韇韉韊韌韍韎韐韑韔韗韘韙韝韞韠韛韡韤韯韱韴韷韸韺頇頊頙頍頎頔頖頜頞頠頣頦"],["8fe8a1","頫頮頯頰頲頳頵頥頾顄顇顊顑顒顓顖顗顙顚顢顣顥顦顪顬颫颭颮颰颴颷颸颺颻颿飂飅飈飌飡飣飥飦飧飪飳飶餂餇餈餑餕餖餗餚餛餜餟餢餦餧餫餱",4,"餹餺餻餼饀饁饆饇饈饍饎饔饘饙饛饜饞饟饠馛馝馟馦馰馱馲馵"],["8fe9a1","馹馺馽馿駃駉駓駔駙駚駜駞駧駪駫駬駰駴駵駹駽駾騂騃騄騋騌騐騑騖騞騠騢騣騤騧騭騮騳騵騶騸驇驁驄驊驋驌驎驑驔驖驝骪骬骮骯骲骴骵骶骹骻骾骿髁髃髆髈髎髐髒髕髖髗髛髜髠髤髥髧髩髬髲髳髵髹髺髽髿",4],["8feaa1","鬄鬅鬈鬉鬋鬌鬍鬎鬐鬒鬖鬙鬛鬜鬠鬦鬫鬭鬳鬴鬵鬷鬹鬺鬽魈魋魌魕魖魗魛魞魡魣魥魦魨魪",4,"魳魵魷魸魹魿鮀鮄鮅鮆鮇鮉鮊鮋鮍鮏鮐鮔鮚鮝鮞鮦鮧鮩鮬鮰鮱鮲鮷鮸鮻鮼鮾鮿鯁鯇鯈鯎鯐鯗鯘鯝鯟鯥鯧鯪鯫鯯鯳鯷鯸"],["8feba1","鯹鯺鯽鯿鰀鰂鰋鰏鰑鰖鰘鰙鰚鰜鰞鰢鰣鰦",4,"鰱鰵鰶鰷鰽鱁鱃鱄鱅鱉鱊鱎鱏鱐鱓鱔鱖鱘鱛鱝鱞鱟鱣鱩鱪鱜鱫鱨鱮鱰鱲鱵鱷鱻鳦鳲鳷鳹鴋鴂鴑鴗鴘鴜鴝鴞鴯鴰鴲鴳鴴鴺鴼鵅鴽鵂鵃鵇鵊鵓鵔鵟鵣鵢鵥鵩鵪鵫鵰鵶鵷鵻"],["8feca1","鵼鵾鶃鶄鶆鶊鶍鶎鶒鶓鶕鶖鶗鶘鶡鶪鶬鶮鶱鶵鶹鶼鶿鷃鷇鷉鷊鷔鷕鷖鷗鷚鷞鷟鷠鷥鷧鷩鷫鷮鷰鷳鷴鷾鸊鸂鸇鸎鸐鸑鸒鸕鸖鸙鸜鸝鹺鹻鹼麀麂麃麄麅麇麎麏麖麘麛麞麤麨麬麮麯麰麳麴麵黆黈黋黕黟黤黧黬黭黮黰黱黲黵"],["8feda1","黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃",4,"齓齕齖齗齘齚齝齞齨齩齭",4,"齳齵齺齽龏龐龑龒龔龖龗龞龡龢龣龥"]]')},function(e){e.exports=JSON.parse('{"uChars":[128,165,169,178,184,216,226,235,238,244,248,251,253,258,276,284,300,325,329,334,364,463,465,467,469,471,473,475,477,506,594,610,712,716,730,930,938,962,970,1026,1104,1106,8209,8215,8218,8222,8231,8241,8244,8246,8252,8365,8452,8454,8458,8471,8482,8556,8570,8596,8602,8713,8720,8722,8726,8731,8737,8740,8742,8748,8751,8760,8766,8777,8781,8787,8802,8808,8816,8854,8858,8870,8896,8979,9322,9372,9548,9588,9616,9622,9634,9652,9662,9672,9676,9680,9702,9735,9738,9793,9795,11906,11909,11913,11917,11928,11944,11947,11951,11956,11960,11964,11979,12284,12292,12312,12319,12330,12351,12436,12447,12535,12543,12586,12842,12850,12964,13200,13215,13218,13253,13263,13267,13270,13384,13428,13727,13839,13851,14617,14703,14801,14816,14964,15183,15471,15585,16471,16736,17208,17325,17330,17374,17623,17997,18018,18212,18218,18301,18318,18760,18811,18814,18820,18823,18844,18848,18872,19576,19620,19738,19887,40870,59244,59336,59367,59413,59417,59423,59431,59437,59443,59452,59460,59478,59493,63789,63866,63894,63976,63986,64016,64018,64021,64025,64034,64037,64042,65074,65093,65107,65112,65127,65132,65375,65510,65536],"gbChars":[0,36,38,45,50,81,89,95,96,100,103,104,105,109,126,133,148,172,175,179,208,306,307,308,309,310,311,312,313,341,428,443,544,545,558,741,742,749,750,805,819,820,7922,7924,7925,7927,7934,7943,7944,7945,7950,8062,8148,8149,8152,8164,8174,8236,8240,8262,8264,8374,8380,8381,8384,8388,8390,8392,8393,8394,8396,8401,8406,8416,8419,8424,8437,8439,8445,8482,8485,8496,8521,8603,8936,8946,9046,9050,9063,9066,9076,9092,9100,9108,9111,9113,9131,9162,9164,9218,9219,11329,11331,11334,11336,11346,11361,11363,11366,11370,11372,11375,11389,11682,11686,11687,11692,11694,11714,11716,11723,11725,11730,11736,11982,11989,12102,12336,12348,12350,12384,12393,12395,12397,12510,12553,12851,12962,12973,13738,13823,13919,13933,14080,14298,14585,14698,15583,15847,16318,16434,16438,16481,16729,17102,17122,17315,17320,17402,17418,17859,17909,17911,17915,17916,17936,17939,17961,18664,18703,18814,18962,19043,33469,33470,33471,33484,33485,33490,33497,33501,33505,33513,33520,33536,33550,37845,37921,37948,38029,38038,38064,38065,38066,38069,38075,38076,38078,39108,39109,39113,39114,39115,39116,39265,39394,189000]}')},function(e){e.exports=JSON.parse('[["0","\\u0000",127],["8141","갂갃갅갆갋",4,"갘갞갟갡갢갣갥",6,"갮갲갳갴"],["8161","갵갶갷갺갻갽갾갿걁",9,"걌걎",5,"걕"],["8181","걖걗걙걚걛걝",18,"걲걳걵걶걹걻",4,"겂겇겈겍겎겏겑겒겓겕",6,"겞겢",5,"겫겭겮겱",6,"겺겾겿곀곂곃곅곆곇곉곊곋곍",7,"곖곘",7,"곢곣곥곦곩곫곭곮곲곴곷",4,"곾곿괁괂괃괅괇",4,"괎괐괒괓"],["8241","괔괕괖괗괙괚괛괝괞괟괡",7,"괪괫괮",5],["8261","괶괷괹괺괻괽",6,"굆굈굊",5,"굑굒굓굕굖굗"],["8281","굙",7,"굢굤",7,"굮굯굱굲굷굸굹굺굾궀궃",4,"궊궋궍궎궏궑",10,"궞",5,"궥",17,"궸",7,"귂귃귅귆귇귉",6,"귒귔",7,"귝귞귟귡귢귣귥",18],["8341","귺귻귽귾긂",5,"긊긌긎",5,"긕",7],["8361","긝",18,"긲긳긵긶긹긻긼"],["8381","긽긾긿깂깄깇깈깉깋깏깑깒깓깕깗",4,"깞깢깣깤깦깧깪깫깭깮깯깱",6,"깺깾",5,"꺆",5,"꺍",46,"꺿껁껂껃껅",6,"껎껒",5,"껚껛껝",8],["8441","껦껧껩껪껬껮",5,"껵껶껷껹껺껻껽",8],["8461","꼆꼉꼊꼋꼌꼎꼏꼑",18],["8481","꼤",7,"꼮꼯꼱꼳꼵",6,"꼾꽀꽄꽅꽆꽇꽊",5,"꽑",10,"꽞",5,"꽦",18,"꽺",5,"꾁꾂꾃꾅꾆꾇꾉",6,"꾒꾓꾔꾖",5,"꾝",26,"꾺꾻꾽꾾"],["8541","꾿꿁",5,"꿊꿌꿏",4,"꿕",6,"꿝",4],["8561","꿢",5,"꿪",5,"꿲꿳꿵꿶꿷꿹",6,"뀂뀃"],["8581","뀅",6,"뀍뀎뀏뀑뀒뀓뀕",6,"뀞",9,"뀩",26,"끆끇끉끋끍끏끐끑끒끖끘끚끛끜끞",29,"끾끿낁낂낃낅",6,"낎낐낒",5,"낛낝낞낣낤"],["8641","낥낦낧낪낰낲낶낷낹낺낻낽",6,"냆냊",5,"냒"],["8661","냓냕냖냗냙",6,"냡냢냣냤냦",10],["8681","냱",22,"넊넍넎넏넑넔넕넖넗넚넞",4,"넦넧넩넪넫넭",6,"넶넺",5,"녂녃녅녆녇녉",6,"녒녓녖녗녙녚녛녝녞녟녡",22,"녺녻녽녾녿놁놃",4,"놊놌놎놏놐놑놕놖놗놙놚놛놝"],["8741","놞",9,"놩",15],["8761","놹",18,"뇍뇎뇏뇑뇒뇓뇕"],["8781","뇖",5,"뇞뇠",7,"뇪뇫뇭뇮뇯뇱",7,"뇺뇼뇾",5,"눆눇눉눊눍",6,"눖눘눚",5,"눡",18,"눵",6,"눽",26,"뉙뉚뉛뉝뉞뉟뉡",6,"뉪",4],["8841","뉯",4,"뉶",5,"뉽",6,"늆늇늈늊",4],["8861","늏늒늓늕늖늗늛",4,"늢늤늧늨늩늫늭늮늯늱늲늳늵늶늷"],["8881","늸",15,"닊닋닍닎닏닑닓",4,"닚닜닞닟닠닡닣닧닩닪닰닱닲닶닼닽닾댂댃댅댆댇댉",6,"댒댖",5,"댝",54,"덗덙덚덝덠덡덢덣"],["8941","덦덨덪덬덭덯덲덳덵덶덷덹",6,"뎂뎆",5,"뎍"],["8961","뎎뎏뎑뎒뎓뎕",10,"뎢",5,"뎩뎪뎫뎭"],["8981","뎮",21,"돆돇돉돊돍돏돑돒돓돖돘돚돜돞돟돡돢돣돥돦돧돩",18,"돽",18,"됑",6,"됙됚됛됝됞됟됡",6,"됪됬",7,"됵",15],["8a41","둅",10,"둒둓둕둖둗둙",6,"둢둤둦"],["8a61","둧",4,"둭",18,"뒁뒂"],["8a81","뒃",4,"뒉",19,"뒞",5,"뒥뒦뒧뒩뒪뒫뒭",7,"뒶뒸뒺",5,"듁듂듃듅듆듇듉",6,"듑듒듓듔듖",5,"듞듟듡듢듥듧",4,"듮듰듲",5,"듹",26,"딖딗딙딚딝"],["8b41","딞",5,"딦딫",4,"딲딳딵딶딷딹",6,"땂땆"],["8b61","땇땈땉땊땎땏땑땒땓땕",6,"땞땢",8],["8b81","땫",52,"떢떣떥떦떧떩떬떭떮떯떲떶",4,"떾떿뗁뗂뗃뗅",6,"뗎뗒",5,"뗙",18,"뗭",18],["8c41","똀",15,"똒똓똕똖똗똙",4],["8c61","똞",6,"똦",5,"똭",6,"똵",5],["8c81","똻",12,"뙉",26,"뙥뙦뙧뙩",50,"뚞뚟뚡뚢뚣뚥",5,"뚭뚮뚯뚰뚲",16],["8d41","뛃",16,"뛕",8],["8d61","뛞",17,"뛱뛲뛳뛵뛶뛷뛹뛺"],["8d81","뛻",4,"뜂뜃뜄뜆",33,"뜪뜫뜭뜮뜱",6,"뜺뜼",7,"띅띆띇띉띊띋띍",6,"띖",9,"띡띢띣띥띦띧띩",6,"띲띴띶",5,"띾띿랁랂랃랅",6,"랎랓랔랕랚랛랝랞"],["8e41","랟랡",6,"랪랮",5,"랶랷랹",8],["8e61","럂",4,"럈럊",19],["8e81","럞",13,"럮럯럱럲럳럵",6,"럾렂",4,"렊렋렍렎렏렑",6,"렚렜렞",5,"렦렧렩렪렫렭",6,"렶렺",5,"롁롂롃롅",11,"롒롔",7,"롞롟롡롢롣롥",6,"롮롰롲",5,"롹롺롻롽",7],["8f41","뢅",7,"뢎",17],["8f61","뢠",7,"뢩",6,"뢱뢲뢳뢵뢶뢷뢹",4],["8f81","뢾뢿룂룄룆",5,"룍룎룏룑룒룓룕",7,"룞룠룢",5,"룪룫룭룮룯룱",6,"룺룼룾",5,"뤅",18,"뤙",6,"뤡",26,"뤾뤿륁륂륃륅",6,"륍륎륐륒",5],["9041","륚륛륝륞륟륡",6,"륪륬륮",5,"륶륷륹륺륻륽"],["9061","륾",5,"릆릈릋릌릏",15],["9081","릟",12,"릮릯릱릲릳릵",6,"릾맀맂",5,"맊맋맍맓",4,"맚맜맟맠맢맦맧맩맪맫맭",6,"맶맻",4,"먂",5,"먉",11,"먖",33,"먺먻먽먾먿멁멃멄멅멆"],["9141","멇멊멌멏멐멑멒멖멗멙멚멛멝",6,"멦멪",5],["9161","멲멳멵멶멷멹",9,"몆몈몉몊몋몍",5],["9181","몓",20,"몪몭몮몯몱몳",4,"몺몼몾",5,"뫅뫆뫇뫉",14,"뫚",33,"뫽뫾뫿묁묂묃묅",7,"묎묐묒",5,"묙묚묛묝묞묟묡",6],["9241","묨묪묬",7,"묷묹묺묿",4,"뭆뭈뭊뭋뭌뭎뭑뭒"],["9261","뭓뭕뭖뭗뭙",7,"뭢뭤",7,"뭭",4],["9281","뭲",21,"뮉뮊뮋뮍뮎뮏뮑",18,"뮥뮦뮧뮩뮪뮫뮭",6,"뮵뮶뮸",7,"믁믂믃믅믆믇믉",6,"믑믒믔",35,"믺믻믽믾밁"],["9341","밃",4,"밊밎밐밒밓밙밚밠밡밢밣밦밨밪밫밬밮밯밲밳밵"],["9361","밶밷밹",6,"뱂뱆뱇뱈뱊뱋뱎뱏뱑",8],["9381","뱚뱛뱜뱞",37,"벆벇벉벊벍벏",4,"벖벘벛",4,"벢벣벥벦벩",6,"벲벶",5,"벾벿볁볂볃볅",7,"볎볒볓볔볖볗볙볚볛볝",22,"볷볹볺볻볽"],["9441","볾",5,"봆봈봊",5,"봑봒봓봕",8],["9461","봞",5,"봥",6,"봭",12],["9481","봺",5,"뵁",6,"뵊뵋뵍뵎뵏뵑",6,"뵚",9,"뵥뵦뵧뵩",22,"붂붃붅붆붋",4,"붒붔붖붗붘붛붝",6,"붥",10,"붱",6,"붹",24],["9541","뷒뷓뷖뷗뷙뷚뷛뷝",11,"뷪",5,"뷱"],["9561","뷲뷳뷵뷶뷷뷹",6,"븁븂븄븆",5,"븎븏븑븒븓"],["9581","븕",6,"븞븠",35,"빆빇빉빊빋빍빏",4,"빖빘빜빝빞빟빢빣빥빦빧빩빫",4,"빲빶",4,"빾빿뺁뺂뺃뺅",6,"뺎뺒",5,"뺚",13,"뺩",14],["9641","뺸",23,"뻒뻓"],["9661","뻕뻖뻙",6,"뻡뻢뻦",5,"뻭",8],["9681","뻶",10,"뼂",5,"뼊",13,"뼚뼞",33,"뽂뽃뽅뽆뽇뽉",6,"뽒뽓뽔뽖",44],["9741","뾃",16,"뾕",8],["9761","뾞",17,"뾱",7],["9781","뾹",11,"뿆",5,"뿎뿏뿑뿒뿓뿕",6,"뿝뿞뿠뿢",89,"쀽쀾쀿"],["9841","쁀",16,"쁒",5,"쁙쁚쁛"],["9861","쁝쁞쁟쁡",6,"쁪",15],["9881","쁺",21,"삒삓삕삖삗삙",6,"삢삤삦",5,"삮삱삲삷",4,"삾샂샃샄샆샇샊샋샍샎샏샑",6,"샚샞",5,"샦샧샩샪샫샭",6,"샶샸샺",5,"섁섂섃섅섆섇섉",6,"섑섒섓섔섖",5,"섡섢섥섨섩섪섫섮"],["9941","섲섳섴섵섷섺섻섽섾섿셁",6,"셊셎",5,"셖셗"],["9961","셙셚셛셝",6,"셦셪",5,"셱셲셳셵셶셷셹셺셻"],["9981","셼",8,"솆",5,"솏솑솒솓솕솗",4,"솞솠솢솣솤솦솧솪솫솭솮솯솱",11,"솾",5,"쇅쇆쇇쇉쇊쇋쇍",6,"쇕쇖쇙",6,"쇡쇢쇣쇥쇦쇧쇩",6,"쇲쇴",7,"쇾쇿숁숂숃숅",6,"숎숐숒",5,"숚숛숝숞숡숢숣"],["9a41","숤숥숦숧숪숬숮숰숳숵",16],["9a61","쉆쉇쉉",6,"쉒쉓쉕쉖쉗쉙",6,"쉡쉢쉣쉤쉦"],["9a81","쉧",4,"쉮쉯쉱쉲쉳쉵",6,"쉾슀슂",5,"슊",5,"슑",6,"슙슚슜슞",5,"슦슧슩슪슫슮",5,"슶슸슺",33,"싞싟싡싢싥",5,"싮싰싲싳싴싵싷싺싽싾싿쌁",6,"쌊쌋쌎쌏"],["9b41","쌐쌑쌒쌖쌗쌙쌚쌛쌝",6,"쌦쌧쌪",8],["9b61","쌳",17,"썆",7],["9b81","썎",25,"썪썫썭썮썯썱썳",4,"썺썻썾",5,"쎅쎆쎇쎉쎊쎋쎍",50,"쏁",22,"쏚"],["9c41","쏛쏝쏞쏡쏣",4,"쏪쏫쏬쏮",5,"쏶쏷쏹",5],["9c61","쏿",8,"쐉",6,"쐑",9],["9c81","쐛",8,"쐥",6,"쐭쐮쐯쐱쐲쐳쐵",6,"쐾",9,"쑉",26,"쑦쑧쑩쑪쑫쑭",6,"쑶쑷쑸쑺",5,"쒁",18,"쒕",6,"쒝",12],["9d41","쒪",13,"쒹쒺쒻쒽",8],["9d61","쓆",25],["9d81","쓠",8,"쓪",5,"쓲쓳쓵쓶쓷쓹쓻쓼쓽쓾씂",9,"씍씎씏씑씒씓씕",6,"씝",10,"씪씫씭씮씯씱",6,"씺씼씾",5,"앆앇앋앏앐앑앒앖앚앛앜앟앢앣앥앦앧앩",6,"앲앶",5,"앾앿얁얂얃얅얆얈얉얊얋얎얐얒얓얔"],["9e41","얖얙얚얛얝얞얟얡",7,"얪",9,"얶"],["9e61","얷얺얿",4,"엋엍엏엒엓엕엖엗엙",6,"엢엤엦엧"],["9e81","엨엩엪엫엯엱엲엳엵엸엹엺엻옂옃옄옉옊옋옍옎옏옑",6,"옚옝",6,"옦옧옩옪옫옯옱옲옶옸옺옼옽옾옿왂왃왅왆왇왉",6,"왒왖",5,"왞왟왡",10,"왭왮왰왲",5,"왺왻왽왾왿욁",6,"욊욌욎",5,"욖욗욙욚욛욝",6,"욦"],["9f41","욨욪",5,"욲욳욵욶욷욻",4,"웂웄웆",5,"웎"],["9f61","웏웑웒웓웕",6,"웞웟웢",5,"웪웫웭웮웯웱웲"],["9f81","웳",4,"웺웻웼웾",5,"윆윇윉윊윋윍",6,"윖윘윚",5,"윢윣윥윦윧윩",6,"윲윴윶윸윹윺윻윾윿읁읂읃읅",4,"읋읎읐읙읚읛읝읞읟읡",6,"읩읪읬",7,"읶읷읹읺읻읿잀잁잂잆잋잌잍잏잒잓잕잙잛",4,"잢잧",4,"잮잯잱잲잳잵잶잷"],["a041","잸잹잺잻잾쟂",5,"쟊쟋쟍쟏쟑",6,"쟙쟚쟛쟜"],["a061","쟞",5,"쟥쟦쟧쟩쟪쟫쟭",13],["a081","쟻",4,"젂젃젅젆젇젉젋",4,"젒젔젗",4,"젞젟젡젢젣젥",6,"젮젰젲",5,"젹젺젻젽젾젿졁",6,"졊졋졎",5,"졕",26,"졲졳졵졶졷졹졻",4,"좂좄좈좉좊좎",5,"좕",7,"좞좠좢좣좤"],["a141","좥좦좧좩",18,"좾좿죀죁"],["a161","죂죃죅죆죇죉죊죋죍",6,"죖죘죚",5,"죢죣죥"],["a181","죦",14,"죶",5,"죾죿줁줂줃줇",4,"줎 、。·‥…¨〃­―∥\∼‘’“”〔〕〈",9,"±×÷≠≤≥∞∴°′″℃Å¢£¥♂♀∠⊥⌒∂∇≡≒§※☆★○●◎◇◆□■△▲▽▼→←↑↓↔〓≪≫√∽∝∵∫∬∈∋⊆⊇⊂⊃∪∩∧∨¬"],["a241","줐줒",5,"줙",18],["a261","줭",6,"줵",18],["a281","쥈",7,"쥒쥓쥕쥖쥗쥙",6,"쥢쥤",7,"쥭쥮쥯⇒⇔∀∃´~ˇ˘˝˚˙¸˛¡¿ː∮∑∏¤℉‰◁◀▷▶♤♠♡♥♧♣⊙◈▣◐◑▒▤▥▨▧▦▩♨☏☎☜☞¶†‡↕↗↙↖↘♭♩♪♬㉿㈜№㏇™㏂㏘℡€®"],["a341","쥱쥲쥳쥵",6,"쥽",10,"즊즋즍즎즏"],["a361","즑",6,"즚즜즞",16],["a381","즯",16,"짂짃짅짆짉짋",4,"짒짔짗짘짛!",58,"₩]",32," ̄"],["a441","짞짟짡짣짥짦짨짩짪짫짮짲",5,"짺짻짽짾짿쨁쨂쨃쨄"],["a461","쨅쨆쨇쨊쨎",5,"쨕쨖쨗쨙",12],["a481","쨦쨧쨨쨪",28,"ㄱ",93],["a541","쩇",4,"쩎쩏쩑쩒쩓쩕",6,"쩞쩢",5,"쩩쩪"],["a561","쩫",17,"쩾",5,"쪅쪆"],["a581","쪇",16,"쪙",14,"ⅰ",9],["a5b0","Ⅰ",9],["a5c1","Α",16,"Σ",6],["a5e1","α",16,"σ",6],["a641","쪨",19,"쪾쪿쫁쫂쫃쫅"],["a661","쫆",5,"쫎쫐쫒쫔쫕쫖쫗쫚",5,"쫡",6],["a681","쫨쫩쫪쫫쫭",6,"쫵",18,"쬉쬊─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂┒┑┚┙┖┕┎┍┞┟┡┢┦┧┩┪┭┮┱┲┵┶┹┺┽┾╀╁╃",7],["a741","쬋",4,"쬑쬒쬓쬕쬖쬗쬙",6,"쬢",7],["a761","쬪",22,"쭂쭃쭄"],["a781","쭅쭆쭇쭊쭋쭍쭎쭏쭑",6,"쭚쭛쭜쭞",5,"쭥",7,"㎕㎖㎗ℓ㎘㏄㎣㎤㎥㎦㎙",9,"㏊㎍㎎㎏㏏㎈㎉㏈㎧㎨㎰",9,"㎀",4,"㎺",5,"㎐",4,"Ω㏀㏁㎊㎋㎌㏖㏅㎭㎮㎯㏛㎩㎪㎫㎬㏝㏐㏓㏃㏉㏜㏆"],["a841","쭭",10,"쭺",14],["a861","쮉",18,"쮝",6],["a881","쮤",19,"쮹",11,"ÆÐªĦ"],["a8a6","IJ"],["a8a8","ĿŁØŒºÞŦŊ"],["a8b1","㉠",27,"ⓐ",25,"①",14,"½⅓⅔¼¾⅛⅜⅝⅞"],["a941","쯅",14,"쯕",10],["a961","쯠쯡쯢쯣쯥쯦쯨쯪",18],["a981","쯽",14,"찎찏찑찒찓찕",6,"찞찟찠찣찤æđðħıijĸŀłøœßþŧŋʼn㈀",27,"⒜",25,"⑴",14,"¹²³⁴ⁿ₁₂₃₄"],["aa41","찥찦찪찫찭찯찱",6,"찺찿",4,"챆챇챉챊챋챍챎"],["aa61","챏",4,"챖챚",5,"챡챢챣챥챧챩",6,"챱챲"],["aa81","챳챴챶",29,"ぁ",82],["ab41","첔첕첖첗첚첛첝첞첟첡",6,"첪첮",5,"첶첷첹"],["ab61","첺첻첽",6,"쳆쳈쳊",5,"쳑쳒쳓쳕",5],["ab81","쳛",8,"쳥",6,"쳭쳮쳯쳱",12,"ァ",85],["ac41","쳾쳿촀촂",5,"촊촋촍촎촏촑",6,"촚촜촞촟촠"],["ac61","촡촢촣촥촦촧촩촪촫촭",11,"촺",4],["ac81","촿",28,"쵝쵞쵟А",5,"ЁЖ",25],["acd1","а",5,"ёж",25],["ad41","쵡쵢쵣쵥",6,"쵮쵰쵲",5,"쵹",7],["ad61","춁",6,"춉",10,"춖춗춙춚춛춝춞춟"],["ad81","춠춡춢춣춦춨춪",5,"춱",18,"췅"],["ae41","췆",5,"췍췎췏췑",16],["ae61","췢",5,"췩췪췫췭췮췯췱",6,"췺췼췾",4],["ae81","츃츅츆츇츉츊츋츍",6,"츕츖츗츘츚",5,"츢츣츥츦츧츩츪츫"],["af41","츬츭츮츯츲츴츶",19],["af61","칊",13,"칚칛칝칞칢",5,"칪칬"],["af81","칮",5,"칶칷칹칺칻칽",6,"캆캈캊",5,"캒캓캕캖캗캙"],["b041","캚",5,"캢캦",5,"캮",12],["b061","캻",5,"컂",19],["b081","컖",13,"컦컧컩컪컭",6,"컶컺",5,"가각간갇갈갉갊감",7,"같",4,"갠갤갬갭갯갰갱갸갹갼걀걋걍걔걘걜거걱건걷걸걺검겁것겄겅겆겉겊겋게겐겔겜겝겟겠겡겨격겪견겯결겸겹겻겼경곁계곈곌곕곗고곡곤곧골곪곬곯곰곱곳공곶과곽관괄괆"],["b141","켂켃켅켆켇켉",6,"켒켔켖",5,"켝켞켟켡켢켣"],["b161","켥",6,"켮켲",5,"켹",11],["b181","콅",14,"콖콗콙콚콛콝",6,"콦콨콪콫콬괌괍괏광괘괜괠괩괬괭괴괵괸괼굄굅굇굉교굔굘굡굣구국군굳굴굵굶굻굼굽굿궁궂궈궉권궐궜궝궤궷귀귁귄귈귐귑귓규균귤그극근귿글긁금급긋긍긔기긱긴긷길긺김깁깃깅깆깊까깍깎깐깔깖깜깝깟깠깡깥깨깩깬깰깸"],["b241","콭콮콯콲콳콵콶콷콹",6,"쾁쾂쾃쾄쾆",5,"쾍"],["b261","쾎",18,"쾢",5,"쾩"],["b281","쾪",5,"쾱",18,"쿅",6,"깹깻깼깽꺄꺅꺌꺼꺽꺾껀껄껌껍껏껐껑께껙껜껨껫껭껴껸껼꼇꼈꼍꼐꼬꼭꼰꼲꼴꼼꼽꼿꽁꽂꽃꽈꽉꽐꽜꽝꽤꽥꽹꾀꾄꾈꾐꾑꾕꾜꾸꾹꾼꿀꿇꿈꿉꿋꿍꿎꿔꿜꿨꿩꿰꿱꿴꿸뀀뀁뀄뀌뀐뀔뀜뀝뀨끄끅끈끊끌끎끓끔끕끗끙"],["b341","쿌",19,"쿢쿣쿥쿦쿧쿩"],["b361","쿪",5,"쿲쿴쿶",5,"쿽쿾쿿퀁퀂퀃퀅",5],["b381","퀋",5,"퀒",5,"퀙",19,"끝끼끽낀낄낌낍낏낑나낙낚난낟날낡낢남납낫",4,"낱낳내낵낸낼냄냅냇냈냉냐냑냔냘냠냥너넉넋넌널넒넓넘넙넛넜넝넣네넥넨넬넴넵넷넸넹녀녁년녈념녑녔녕녘녜녠노녹논놀놂놈놉놋농높놓놔놘놜놨뇌뇐뇔뇜뇝"],["b441","퀮",5,"퀶퀷퀹퀺퀻퀽",6,"큆큈큊",5],["b461","큑큒큓큕큖큗큙",6,"큡",10,"큮큯"],["b481","큱큲큳큵",6,"큾큿킀킂",18,"뇟뇨뇩뇬뇰뇹뇻뇽누눅눈눋눌눔눕눗눙눠눴눼뉘뉜뉠뉨뉩뉴뉵뉼늄늅늉느늑는늘늙늚늠늡늣능늦늪늬늰늴니닉닌닐닒님닙닛닝닢다닥닦단닫",4,"닳담답닷",4,"닿대댁댄댈댐댑댓댔댕댜더덕덖던덛덜덞덟덤덥"],["b541","킕",14,"킦킧킩킪킫킭",5],["b561","킳킶킸킺",5,"탂탃탅탆탇탊",5,"탒탖",4],["b581","탛탞탟탡탢탣탥",6,"탮탲",5,"탹",11,"덧덩덫덮데덱덴델뎀뎁뎃뎄뎅뎌뎐뎔뎠뎡뎨뎬도독돈돋돌돎돐돔돕돗동돛돝돠돤돨돼됐되된될됨됩됫됴두둑둔둘둠둡둣둥둬뒀뒈뒝뒤뒨뒬뒵뒷뒹듀듄듈듐듕드득든듣들듦듬듭듯등듸디딕딘딛딜딤딥딧딨딩딪따딱딴딸"],["b641","턅",7,"턎",17],["b661","턠",15,"턲턳턵턶턷턹턻턼턽턾"],["b681","턿텂텆",5,"텎텏텑텒텓텕",6,"텞텠텢",5,"텩텪텫텭땀땁땃땄땅땋때땍땐땔땜땝땟땠땡떠떡떤떨떪떫떰떱떳떴떵떻떼떽뗀뗄뗌뗍뗏뗐뗑뗘뗬또똑똔똘똥똬똴뙈뙤뙨뚜뚝뚠뚤뚫뚬뚱뛔뛰뛴뛸뜀뜁뜅뜨뜩뜬뜯뜰뜸뜹뜻띄띈띌띔띕띠띤띨띰띱띳띵라락란랄람랍랏랐랑랒랖랗"],["b741","텮",13,"텽",6,"톅톆톇톉톊"],["b761","톋",20,"톢톣톥톦톧"],["b781","톩",6,"톲톴톶톷톸톹톻톽톾톿퇁",14,"래랙랜랠램랩랫랬랭랴략랸럇량러럭런럴럼럽럿렀렁렇레렉렌렐렘렙렛렝려력련렬렴렵렷렸령례롄롑롓로록론롤롬롭롯롱롸롼뢍뢨뢰뢴뢸룀룁룃룅료룐룔룝룟룡루룩룬룰룸룹룻룽뤄뤘뤠뤼뤽륀륄륌륏륑류륙륜률륨륩"],["b841","퇐",7,"퇙",17],["b861","퇫",8,"퇵퇶퇷퇹",13],["b881","툈툊",5,"툑",24,"륫륭르륵른를름릅릇릉릊릍릎리릭린릴림립릿링마막만많",4,"맘맙맛망맞맡맣매맥맨맬맴맵맷맸맹맺먀먁먈먕머먹먼멀멂멈멉멋멍멎멓메멕멘멜멤멥멧멨멩며멱면멸몃몄명몇몌모목몫몬몰몲몸몹못몽뫄뫈뫘뫙뫼"],["b941","툪툫툮툯툱툲툳툵",6,"툾퉀퉂",5,"퉉퉊퉋퉌"],["b961","퉍",14,"퉝",6,"퉥퉦퉧퉨"],["b981","퉩",22,"튂튃튅튆튇튉튊튋튌묀묄묍묏묑묘묜묠묩묫무묵묶문묻물묽묾뭄뭅뭇뭉뭍뭏뭐뭔뭘뭡뭣뭬뮈뮌뮐뮤뮨뮬뮴뮷므믄믈믐믓미믹민믿밀밂밈밉밋밌밍및밑바",4,"받",4,"밤밥밧방밭배백밴밸뱀뱁뱃뱄뱅뱉뱌뱍뱐뱝버벅번벋벌벎범법벗"],["ba41","튍튎튏튒튓튔튖",5,"튝튞튟튡튢튣튥",6,"튭"],["ba61","튮튯튰튲",5,"튺튻튽튾틁틃",4,"틊틌",5],["ba81","틒틓틕틖틗틙틚틛틝",6,"틦",9,"틲틳틵틶틷틹틺벙벚베벡벤벧벨벰벱벳벴벵벼벽변별볍볏볐병볕볘볜보복볶본볼봄봅봇봉봐봔봤봬뵀뵈뵉뵌뵐뵘뵙뵤뵨부북분붇불붉붊붐붑붓붕붙붚붜붤붰붸뷔뷕뷘뷜뷩뷰뷴뷸븀븃븅브븍븐블븜븝븟비빅빈빌빎빔빕빗빙빚빛빠빡빤"],["bb41","틻",4,"팂팄팆",5,"팏팑팒팓팕팗",4,"팞팢팣"],["bb61","팤팦팧팪팫팭팮팯팱",6,"팺팾",5,"퍆퍇퍈퍉"],["bb81","퍊",31,"빨빪빰빱빳빴빵빻빼빽뺀뺄뺌뺍뺏뺐뺑뺘뺙뺨뻐뻑뻔뻗뻘뻠뻣뻤뻥뻬뼁뼈뼉뼘뼙뼛뼜뼝뽀뽁뽄뽈뽐뽑뽕뾔뾰뿅뿌뿍뿐뿔뿜뿟뿡쀼쁑쁘쁜쁠쁨쁩삐삑삔삘삠삡삣삥사삭삯산삳살삵삶삼삽삿샀상샅새색샌샐샘샙샛샜생샤"],["bc41","퍪",17,"퍾퍿펁펂펃펅펆펇"],["bc61","펈펉펊펋펎펒",5,"펚펛펝펞펟펡",6,"펪펬펮"],["bc81","펯",4,"펵펶펷펹펺펻펽",6,"폆폇폊",5,"폑",5,"샥샨샬샴샵샷샹섀섄섈섐섕서",4,"섣설섦섧섬섭섯섰성섶세섹센셀셈셉셋셌셍셔셕션셜셤셥셧셨셩셰셴셸솅소속솎손솔솖솜솝솟송솥솨솩솬솰솽쇄쇈쇌쇔쇗쇘쇠쇤쇨쇰쇱쇳쇼쇽숀숄숌숍숏숑수숙순숟술숨숩숫숭"],["bd41","폗폙",7,"폢폤",7,"폮폯폱폲폳폵폶폷"],["bd61","폸폹폺폻폾퐀퐂",5,"퐉",13],["bd81","퐗",5,"퐞",25,"숯숱숲숴쉈쉐쉑쉔쉘쉠쉥쉬쉭쉰쉴쉼쉽쉿슁슈슉슐슘슛슝스슥슨슬슭슴습슷승시식신싣실싫심십싯싱싶싸싹싻싼쌀쌈쌉쌌쌍쌓쌔쌕쌘쌜쌤쌥쌨쌩썅써썩썬썰썲썸썹썼썽쎄쎈쎌쏀쏘쏙쏜쏟쏠쏢쏨쏩쏭쏴쏵쏸쐈쐐쐤쐬쐰"],["be41","퐸",7,"푁푂푃푅",14],["be61","푔",7,"푝푞푟푡푢푣푥",7,"푮푰푱푲"],["be81","푳",4,"푺푻푽푾풁풃",4,"풊풌풎",5,"풕",8,"쐴쐼쐽쑈쑤쑥쑨쑬쑴쑵쑹쒀쒔쒜쒸쒼쓩쓰쓱쓴쓸쓺쓿씀씁씌씐씔씜씨씩씬씰씸씹씻씽아악안앉않알앍앎앓암압앗았앙앝앞애액앤앨앰앱앳앴앵야약얀얄얇얌얍얏양얕얗얘얜얠얩어억언얹얻얼얽얾엄",6,"엌엎"],["bf41","풞",10,"풪",14],["bf61","풹",18,"퓍퓎퓏퓑퓒퓓퓕"],["bf81","퓖",5,"퓝퓞퓠",7,"퓩퓪퓫퓭퓮퓯퓱",6,"퓹퓺퓼에엑엔엘엠엡엣엥여역엮연열엶엷염",5,"옅옆옇예옌옐옘옙옛옜오옥온올옭옮옰옳옴옵옷옹옻와왁완왈왐왑왓왔왕왜왝왠왬왯왱외왹왼욀욈욉욋욍요욕욘욜욤욥욧용우욱운울욹욺움웁웃웅워웍원월웜웝웠웡웨"],["c041","퓾",5,"픅픆픇픉픊픋픍",6,"픖픘",5],["c061","픞",25],["c081","픸픹픺픻픾픿핁핂핃핅",6,"핎핐핒",5,"핚핛핝핞핟핡핢핣웩웬웰웸웹웽위윅윈윌윔윕윗윙유육윤율윰윱윳융윷으윽은을읊음읍읏응",7,"읜읠읨읫이익인일읽읾잃임입잇있잉잊잎자작잔잖잗잘잚잠잡잣잤장잦재잭잰잴잼잽잿쟀쟁쟈쟉쟌쟎쟐쟘쟝쟤쟨쟬저적전절젊"],["c141","핤핦핧핪핬핮",5,"핶핷핹핺핻핽",6,"햆햊햋"],["c161","햌햍햎햏햑",19,"햦햧"],["c181","햨",31,"점접젓정젖제젝젠젤젬젭젯젱져젼졀졈졉졌졍졔조족존졸졺좀좁좃종좆좇좋좌좍좔좝좟좡좨좼좽죄죈죌죔죕죗죙죠죡죤죵주죽준줄줅줆줌줍줏중줘줬줴쥐쥑쥔쥘쥠쥡쥣쥬쥰쥴쥼즈즉즌즐즘즙즛증지직진짇질짊짐집짓"],["c241","헊헋헍헎헏헑헓",4,"헚헜헞",5,"헦헧헩헪헫헭헮"],["c261","헯",4,"헶헸헺",5,"혂혃혅혆혇혉",6,"혒"],["c281","혖",5,"혝혞혟혡혢혣혥",7,"혮",9,"혺혻징짖짙짚짜짝짠짢짤짧짬짭짯짰짱째짹짼쨀쨈쨉쨋쨌쨍쨔쨘쨩쩌쩍쩐쩔쩜쩝쩟쩠쩡쩨쩽쪄쪘쪼쪽쫀쫄쫌쫍쫏쫑쫓쫘쫙쫠쫬쫴쬈쬐쬔쬘쬠쬡쭁쭈쭉쭌쭐쭘쭙쭝쭤쭸쭹쮜쮸쯔쯤쯧쯩찌찍찐찔찜찝찡찢찧차착찬찮찰참찹찻"],["c341","혽혾혿홁홂홃홄홆홇홊홌홎홏홐홒홓홖홗홙홚홛홝",4],["c361","홢",4,"홨홪",5,"홲홳홵",11],["c381","횁횂횄횆",5,"횎횏횑횒횓횕",7,"횞횠횢",5,"횩횪찼창찾채책챈챌챔챕챗챘챙챠챤챦챨챰챵처척천철첨첩첫첬청체첵첸첼쳄쳅쳇쳉쳐쳔쳤쳬쳰촁초촉촌촐촘촙촛총촤촨촬촹최쵠쵤쵬쵭쵯쵱쵸춈추축춘출춤춥춧충춰췄췌췐취췬췰췸췹췻췽츄츈츌츔츙츠측츤츨츰츱츳층"],["c441","횫횭횮횯횱",7,"횺횼",7,"훆훇훉훊훋"],["c461","훍훎훏훐훒훓훕훖훘훚",5,"훡훢훣훥훦훧훩",4],["c481","훮훯훱훲훳훴훶",5,"훾훿휁휂휃휅",11,"휒휓휔치칙친칟칠칡침칩칫칭카칵칸칼캄캅캇캉캐캑캔캘캠캡캣캤캥캬캭컁커컥컨컫컬컴컵컷컸컹케켁켄켈켐켑켓켕켜켠켤켬켭켯켰켱켸코콕콘콜콤콥콧콩콰콱콴콸쾀쾅쾌쾡쾨쾰쿄쿠쿡쿤쿨쿰쿱쿳쿵쿼퀀퀄퀑퀘퀭퀴퀵퀸퀼"],["c541","휕휖휗휚휛휝휞휟휡",6,"휪휬휮",5,"휶휷휹"],["c561","휺휻휽",6,"흅흆흈흊",5,"흒흓흕흚",4],["c581","흟흢흤흦흧흨흪흫흭흮흯흱흲흳흵",6,"흾흿힀힂",5,"힊힋큄큅큇큉큐큔큘큠크큭큰클큼큽킁키킥킨킬킴킵킷킹타탁탄탈탉탐탑탓탔탕태택탠탤탬탭탯탰탱탸턍터턱턴털턺텀텁텃텄텅테텍텐텔템텝텟텡텨텬텼톄톈토톡톤톨톰톱톳통톺톼퇀퇘퇴퇸툇툉툐투툭툰툴툼툽툿퉁퉈퉜"],["c641","힍힎힏힑",6,"힚힜힞",5],["c6a1","퉤튀튁튄튈튐튑튕튜튠튤튬튱트특튼튿틀틂틈틉틋틔틘틜틤틥티틱틴틸팀팁팃팅파팍팎판팔팖팜팝팟팠팡팥패팩팬팰팸팹팻팼팽퍄퍅퍼퍽펀펄펌펍펏펐펑페펙펜펠펨펩펫펭펴편펼폄폅폈평폐폘폡폣포폭폰폴폼폽폿퐁"],["c7a1","퐈퐝푀푄표푠푤푭푯푸푹푼푿풀풂품풉풋풍풔풩퓌퓐퓔퓜퓟퓨퓬퓰퓸퓻퓽프픈플픔픕픗피픽핀필핌핍핏핑하학한할핥함합핫항해핵핸핼햄햅햇했행햐향허헉헌헐헒험헙헛헝헤헥헨헬헴헵헷헹혀혁현혈혐협혓혔형혜혠"],["c8a1","혤혭호혹혼홀홅홈홉홋홍홑화확환활홧황홰홱홴횃횅회획횐횔횝횟횡효횬횰횹횻후훅훈훌훑훔훗훙훠훤훨훰훵훼훽휀휄휑휘휙휜휠휨휩휫휭휴휵휸휼흄흇흉흐흑흔흖흗흘흙흠흡흣흥흩희흰흴흼흽힁히힉힌힐힘힙힛힝"],["caa1","伽佳假價加可呵哥嘉嫁家暇架枷柯歌珂痂稼苛茄街袈訶賈跏軻迦駕刻却各恪慤殼珏脚覺角閣侃刊墾奸姦干幹懇揀杆柬桿澗癎看磵稈竿簡肝艮艱諫間乫喝曷渴碣竭葛褐蝎鞨勘坎堪嵌感憾戡敢柑橄減甘疳監瞰紺邯鑑鑒龕"],["cba1","匣岬甲胛鉀閘剛堈姜岡崗康强彊慷江畺疆糠絳綱羌腔舡薑襁講鋼降鱇介价個凱塏愷愾慨改槪漑疥皆盖箇芥蓋豈鎧開喀客坑更粳羹醵倨去居巨拒据據擧渠炬祛距踞車遽鉅鋸乾件健巾建愆楗腱虔蹇鍵騫乞傑杰桀儉劍劒檢"],["cca1","瞼鈐黔劫怯迲偈憩揭擊格檄激膈覡隔堅牽犬甄絹繭肩見譴遣鵑抉決潔結缺訣兼慊箝謙鉗鎌京俓倞傾儆勁勍卿坰境庚徑慶憬擎敬景暻更梗涇炅烱璟璥瓊痙硬磬竟競絅經耕耿脛莖警輕逕鏡頃頸驚鯨係啓堺契季屆悸戒桂械"],["cda1","棨溪界癸磎稽系繫繼計誡谿階鷄古叩告呱固姑孤尻庫拷攷故敲暠枯槁沽痼皐睾稿羔考股膏苦苽菰藁蠱袴誥賈辜錮雇顧高鼓哭斛曲梏穀谷鵠困坤崑昆梱棍滾琨袞鯤汨滑骨供公共功孔工恐恭拱控攻珙空蚣貢鞏串寡戈果瓜"],["cea1","科菓誇課跨過鍋顆廓槨藿郭串冠官寬慣棺款灌琯瓘管罐菅觀貫關館刮恝括适侊光匡壙廣曠洸炚狂珖筐胱鑛卦掛罫乖傀塊壞怪愧拐槐魁宏紘肱轟交僑咬喬嬌嶠巧攪敎校橋狡皎矯絞翹膠蕎蛟較轎郊餃驕鮫丘久九仇俱具勾"],["cfa1","區口句咎嘔坵垢寇嶇廐懼拘救枸柩構歐毆毬求溝灸狗玖球瞿矩究絿耉臼舅舊苟衢謳購軀逑邱鉤銶駒驅鳩鷗龜國局菊鞠鞫麴君窘群裙軍郡堀屈掘窟宮弓穹窮芎躬倦券勸卷圈拳捲權淃眷厥獗蕨蹶闕机櫃潰詭軌饋句晷歸貴"],["d0a1","鬼龜叫圭奎揆槻珪硅窺竅糾葵規赳逵閨勻均畇筠菌鈞龜橘克剋劇戟棘極隙僅劤勤懃斤根槿瑾筋芹菫覲謹近饉契今妗擒昑檎琴禁禽芩衾衿襟金錦伋及急扱汲級給亘兢矜肯企伎其冀嗜器圻基埼夔奇妓寄岐崎己幾忌技旗旣"],["d1a1","朞期杞棋棄機欺氣汽沂淇玘琦琪璂璣畸畿碁磯祁祇祈祺箕紀綺羈耆耭肌記譏豈起錡錤飢饑騎騏驥麒緊佶吉拮桔金喫儺喇奈娜懦懶拏拿癩",5,"那樂",4,"諾酪駱亂卵暖欄煖爛蘭難鸞捏捺南嵐枏楠湳濫男藍襤拉"],["d2a1","納臘蠟衲囊娘廊",4,"乃來內奈柰耐冷女年撚秊念恬拈捻寧寗努勞奴弩怒擄櫓爐瑙盧",5,"駑魯",10,"濃籠聾膿農惱牢磊腦賂雷尿壘",7,"嫩訥杻紐勒",5,"能菱陵尼泥匿溺多茶"],["d3a1","丹亶但單團壇彖斷旦檀段湍短端簞緞蛋袒鄲鍛撻澾獺疸達啖坍憺擔曇淡湛潭澹痰聃膽蕁覃談譚錟沓畓答踏遝唐堂塘幢戇撞棠當糖螳黨代垈坮大對岱帶待戴擡玳臺袋貸隊黛宅德悳倒刀到圖堵塗導屠島嶋度徒悼挑掉搗桃"],["d4a1","棹櫂淘渡滔濤燾盜睹禱稻萄覩賭跳蹈逃途道都鍍陶韜毒瀆牘犢獨督禿篤纛讀墩惇敦旽暾沌焞燉豚頓乭突仝冬凍動同憧東桐棟洞潼疼瞳童胴董銅兜斗杜枓痘竇荳讀豆逗頭屯臀芚遁遯鈍得嶝橙燈登等藤謄鄧騰喇懶拏癩羅"],["d5a1","蘿螺裸邏樂洛烙珞絡落諾酪駱丹亂卵欄欒瀾爛蘭鸞剌辣嵐擥攬欖濫籃纜藍襤覽拉臘蠟廊朗浪狼琅瑯螂郞來崍徠萊冷掠略亮倆兩凉梁樑粮粱糧良諒輛量侶儷勵呂廬慮戾旅櫚濾礪藜蠣閭驢驪麗黎力曆歷瀝礫轢靂憐戀攣漣"],["d6a1","煉璉練聯蓮輦連鍊冽列劣洌烈裂廉斂殮濂簾獵令伶囹寧岺嶺怜玲笭羚翎聆逞鈴零靈領齡例澧禮醴隷勞怒撈擄櫓潞瀘爐盧老蘆虜路輅露魯鷺鹵碌祿綠菉錄鹿麓論壟弄朧瀧瓏籠聾儡瀨牢磊賂賚賴雷了僚寮廖料燎療瞭聊蓼"],["d7a1","遼鬧龍壘婁屢樓淚漏瘻累縷蔞褸鏤陋劉旒柳榴流溜瀏琉瑠留瘤硫謬類六戮陸侖倫崙淪綸輪律慄栗率隆勒肋凜凌楞稜綾菱陵俚利厘吏唎履悧李梨浬犁狸理璃異痢籬罹羸莉裏裡里釐離鯉吝潾燐璘藺躪隣鱗麟林淋琳臨霖砬"],["d8a1","立笠粒摩瑪痲碼磨馬魔麻寞幕漠膜莫邈万卍娩巒彎慢挽晩曼滿漫灣瞞萬蔓蠻輓饅鰻唜抹末沫茉襪靺亡妄忘忙望網罔芒茫莽輞邙埋妹媒寐昧枚梅每煤罵買賣邁魅脈貊陌驀麥孟氓猛盲盟萌冪覓免冕勉棉沔眄眠綿緬面麵滅"],["d9a1","蔑冥名命明暝椧溟皿瞑茗蓂螟酩銘鳴袂侮冒募姆帽慕摸摹暮某模母毛牟牡瑁眸矛耗芼茅謀謨貌木沐牧目睦穆鶩歿沒夢朦蒙卯墓妙廟描昴杳渺猫竗苗錨務巫憮懋戊拇撫无楙武毋無珷畝繆舞茂蕪誣貿霧鵡墨默們刎吻問文"],["daa1","汶紊紋聞蚊門雯勿沕物味媚尾嵋彌微未梶楣渼湄眉米美薇謎迷靡黴岷悶愍憫敏旻旼民泯玟珉緡閔密蜜謐剝博拍搏撲朴樸泊珀璞箔粕縛膊舶薄迫雹駁伴半反叛拌搬攀斑槃泮潘班畔瘢盤盼磐磻礬絆般蟠返頒飯勃拔撥渤潑"],["dba1","發跋醱鉢髮魃倣傍坊妨尨幇彷房放方旁昉枋榜滂磅紡肪膀舫芳蒡蚌訪謗邦防龐倍俳北培徘拜排杯湃焙盃背胚裴裵褙賠輩配陪伯佰帛柏栢白百魄幡樊煩燔番磻繁蕃藩飜伐筏罰閥凡帆梵氾汎泛犯範范法琺僻劈壁擘檗璧癖"],["dca1","碧蘗闢霹便卞弁變辨辯邊別瞥鱉鼈丙倂兵屛幷昞昺柄棅炳甁病秉竝輧餠騈保堡報寶普步洑湺潽珤甫菩補褓譜輔伏僕匐卜宓復服福腹茯蔔複覆輹輻馥鰒本乶俸奉封峯峰捧棒烽熢琫縫蓬蜂逢鋒鳳不付俯傅剖副否咐埠夫婦"],["dda1","孚孵富府復扶敷斧浮溥父符簿缶腐腑膚艀芙莩訃負賦賻赴趺部釜阜附駙鳧北分吩噴墳奔奮忿憤扮昐汾焚盆粉糞紛芬賁雰不佛弗彿拂崩朋棚硼繃鵬丕備匕匪卑妃婢庇悲憊扉批斐枇榧比毖毗毘沸泌琵痺砒碑秕秘粃緋翡肥"],["dea1","脾臂菲蜚裨誹譬費鄙非飛鼻嚬嬪彬斌檳殯浜濱瀕牝玭貧賓頻憑氷聘騁乍事些仕伺似使俟僿史司唆嗣四士奢娑寫寺射巳師徙思捨斜斯柶査梭死沙泗渣瀉獅砂社祀祠私篩紗絲肆舍莎蓑蛇裟詐詞謝賜赦辭邪飼駟麝削數朔索"],["dfa1","傘刪山散汕珊産疝算蒜酸霰乷撒殺煞薩三參杉森渗芟蔘衫揷澁鈒颯上傷像償商喪嘗孀尙峠常床庠廂想桑橡湘爽牀狀相祥箱翔裳觴詳象賞霜塞璽賽嗇塞穡索色牲生甥省笙墅壻嶼序庶徐恕抒捿敍暑曙書栖棲犀瑞筮絮緖署"],["e0a1","胥舒薯西誓逝鋤黍鼠夕奭席惜昔晳析汐淅潟石碩蓆釋錫仙僊先善嬋宣扇敾旋渲煽琁瑄璇璿癬禪線繕羨腺膳船蘚蟬詵跣選銑鐥饍鮮卨屑楔泄洩渫舌薛褻設說雪齧剡暹殲纖蟾贍閃陝攝涉燮葉城姓宬性惺成星晟猩珹盛省筬"],["e1a1","聖聲腥誠醒世勢歲洗稅笹細說貰召嘯塑宵小少巢所掃搔昭梳沼消溯瀟炤燒甦疏疎瘙笑篠簫素紹蔬蕭蘇訴逍遡邵銷韶騷俗屬束涑粟續謖贖速孫巽損蓀遜飡率宋悚松淞訟誦送頌刷殺灑碎鎖衰釗修受嗽囚垂壽嫂守岫峀帥愁"],["e2a1","戍手授搜收數樹殊水洙漱燧狩獸琇璲瘦睡秀穗竪粹綏綬繡羞脩茱蒐蓚藪袖誰讐輸遂邃酬銖銹隋隧隨雖需須首髓鬚叔塾夙孰宿淑潚熟琡璹肅菽巡徇循恂旬栒楯橓殉洵淳珣盾瞬筍純脣舜荀蓴蕣詢諄醇錞順馴戌術述鉥崇崧"],["e3a1","嵩瑟膝蝨濕拾習褶襲丞乘僧勝升承昇繩蠅陞侍匙嘶始媤尸屎屍市弑恃施是時枾柴猜矢示翅蒔蓍視試詩諡豕豺埴寔式息拭植殖湜熄篒蝕識軾食飾伸侁信呻娠宸愼新晨燼申神紳腎臣莘薪藎蜃訊身辛辰迅失室實悉審尋心沁"],["e4a1","沈深瀋甚芯諶什十拾雙氏亞俄兒啞娥峨我牙芽莪蛾衙訝阿雅餓鴉鵝堊岳嶽幄惡愕握樂渥鄂鍔顎鰐齷安岸按晏案眼雁鞍顔鮟斡謁軋閼唵岩巖庵暗癌菴闇壓押狎鴨仰央怏昻殃秧鴦厓哀埃崖愛曖涯碍艾隘靄厄扼掖液縊腋額"],["e5a1","櫻罌鶯鸚也倻冶夜惹揶椰爺耶若野弱掠略約若葯蒻藥躍亮佯兩凉壤孃恙揚攘敭暘梁楊樣洋瀁煬痒瘍禳穰糧羊良襄諒讓釀陽量養圄御於漁瘀禦語馭魚齬億憶抑檍臆偃堰彦焉言諺孼蘖俺儼嚴奄掩淹嶪業円予余勵呂女如廬"],["e6a1","旅歟汝濾璵礖礪與艅茹輿轝閭餘驪麗黎亦力域役易曆歷疫繹譯轢逆驛嚥堧姸娟宴年延憐戀捐挻撚椽沇沿涎涓淵演漣烟然煙煉燃燕璉硏硯秊筵緣練縯聯衍軟輦蓮連鉛鍊鳶列劣咽悅涅烈熱裂說閱厭廉念捻染殮炎焰琰艶苒"],["e7a1","簾閻髥鹽曄獵燁葉令囹塋寧嶺嶸影怜映暎楹榮永泳渶潁濚瀛瀯煐營獰玲瑛瑩瓔盈穎纓羚聆英詠迎鈴鍈零霙靈領乂倪例刈叡曳汭濊猊睿穢芮藝蘂禮裔詣譽豫醴銳隸霓預五伍俉傲午吾吳嗚塢墺奧娛寤悟惡懊敖旿晤梧汚澳"],["e8a1","烏熬獒筽蜈誤鰲鼇屋沃獄玉鈺溫瑥瘟穩縕蘊兀壅擁瓮甕癰翁邕雍饔渦瓦窩窪臥蛙蝸訛婉完宛梡椀浣玩琓琬碗緩翫脘腕莞豌阮頑曰往旺枉汪王倭娃歪矮外嵬巍猥畏了僚僥凹堯夭妖姚寥寮尿嶢拗搖撓擾料曜樂橈燎燿瑤療"],["e9a1","窈窯繇繞耀腰蓼蟯要謠遙遼邀饒慾欲浴縟褥辱俑傭冗勇埇墉容庸慂榕涌湧溶熔瑢用甬聳茸蓉踊鎔鏞龍于佑偶優又友右宇寓尤愚憂旴牛玗瑀盂祐禑禹紆羽芋藕虞迂遇郵釪隅雨雩勖彧旭昱栯煜稶郁頊云暈橒殞澐熉耘芸蕓"],["eaa1","運隕雲韻蔚鬱亐熊雄元原員圓園垣媛嫄寃怨愿援沅洹湲源爰猿瑗苑袁轅遠阮院願鴛月越鉞位偉僞危圍委威尉慰暐渭爲瑋緯胃萎葦蔿蝟衛褘謂違韋魏乳侑儒兪劉唯喩孺宥幼幽庾悠惟愈愉揄攸有杻柔柚柳楡楢油洧流游溜"],["eba1","濡猶猷琉瑜由留癒硫紐維臾萸裕誘諛諭踰蹂遊逾遺酉釉鍮類六堉戮毓肉育陸倫允奫尹崙淪潤玧胤贇輪鈗閏律慄栗率聿戎瀜絨融隆垠恩慇殷誾銀隱乙吟淫蔭陰音飮揖泣邑凝應膺鷹依倚儀宜意懿擬椅毅疑矣義艤薏蟻衣誼"],["eca1","議醫二以伊利吏夷姨履已弛彛怡易李梨泥爾珥理異痍痢移罹而耳肄苡荑裏裡貽貳邇里離飴餌匿溺瀷益翊翌翼謚人仁刃印吝咽因姻寅引忍湮燐璘絪茵藺蚓認隣靭靷鱗麟一佚佾壹日溢逸鎰馹任壬妊姙恁林淋稔臨荏賃入卄"],["eda1","立笠粒仍剩孕芿仔刺咨姉姿子字孜恣慈滋炙煮玆瓷疵磁紫者自茨蔗藉諮資雌作勺嚼斫昨灼炸爵綽芍酌雀鵲孱棧殘潺盞岑暫潛箴簪蠶雜丈仗匠場墻壯奬將帳庄張掌暲杖樟檣欌漿牆狀獐璋章粧腸臟臧莊葬蔣薔藏裝贓醬長"],["eea1","障再哉在宰才材栽梓渽滓災縡裁財載齋齎爭箏諍錚佇低儲咀姐底抵杵楮樗沮渚狙猪疽箸紵苧菹著藷詛貯躇這邸雎齟勣吊嫡寂摘敵滴狄炙的積笛籍績翟荻謫賊赤跡蹟迪迹適鏑佃佺傳全典前剪塡塼奠專展廛悛戰栓殿氈澱"],["efa1","煎琠田甸畑癲筌箋箭篆纏詮輾轉鈿銓錢鐫電顚顫餞切截折浙癤竊節絶占岾店漸点粘霑鮎點接摺蝶丁井亭停偵呈姃定幀庭廷征情挺政整旌晶晸柾楨檉正汀淀淨渟湞瀞炡玎珽町睛碇禎程穽精綎艇訂諪貞鄭酊釘鉦鋌錠霆靖"],["f0a1","靜頂鼎制劑啼堤帝弟悌提梯濟祭第臍薺製諸蹄醍除際霽題齊俎兆凋助嘲弔彫措操早晁曺曹朝條棗槽漕潮照燥爪璪眺祖祚租稠窕粗糟組繰肇藻蚤詔調趙躁造遭釣阻雕鳥族簇足鏃存尊卒拙猝倧宗從悰慫棕淙琮種終綜縱腫"],["f1a1","踪踵鍾鐘佐坐左座挫罪主住侏做姝胄呪周嗾奏宙州廚晝朱柱株注洲湊澍炷珠疇籌紂紬綢舟蛛註誅走躊輳週酎酒鑄駐竹粥俊儁准埈寯峻晙樽浚準濬焌畯竣蠢逡遵雋駿茁中仲衆重卽櫛楫汁葺增憎曾拯烝甑症繒蒸證贈之只"],["f2a1","咫地址志持指摯支旨智枝枳止池沚漬知砥祉祗紙肢脂至芝芷蜘誌識贄趾遲直稙稷織職唇嗔塵振搢晉晋桭榛殄津溱珍瑨璡畛疹盡眞瞋秦縉縝臻蔯袗診賑軫辰進鎭陣陳震侄叱姪嫉帙桎瓆疾秩窒膣蛭質跌迭斟朕什執潗緝輯"],["f3a1","鏶集徵懲澄且侘借叉嗟嵯差次此磋箚茶蹉車遮捉搾着窄錯鑿齪撰澯燦璨瓚竄簒纂粲纘讚贊鑽餐饌刹察擦札紮僭參塹慘慙懺斬站讒讖倉倡創唱娼廠彰愴敞昌昶暢槍滄漲猖瘡窓脹艙菖蒼債埰寀寨彩採砦綵菜蔡采釵冊柵策"],["f4a1","責凄妻悽處倜刺剔尺慽戚拓擲斥滌瘠脊蹠陟隻仟千喘天川擅泉淺玔穿舛薦賤踐遷釧闡阡韆凸哲喆徹撤澈綴輟轍鐵僉尖沾添甛瞻簽籤詹諂堞妾帖捷牒疊睫諜貼輒廳晴淸聽菁請靑鯖切剃替涕滯締諦逮遞體初剿哨憔抄招梢"],["f5a1","椒楚樵炒焦硝礁礎秒稍肖艸苕草蕉貂超酢醋醮促囑燭矗蜀觸寸忖村邨叢塚寵悤憁摠總聰蔥銃撮催崔最墜抽推椎楸樞湫皺秋芻萩諏趨追鄒酋醜錐錘鎚雛騶鰍丑畜祝竺筑築縮蓄蹙蹴軸逐春椿瑃出朮黜充忠沖蟲衝衷悴膵萃"],["f6a1","贅取吹嘴娶就炊翠聚脆臭趣醉驟鷲側仄厠惻測層侈値嗤峙幟恥梔治淄熾痔痴癡稚穉緇緻置致蚩輜雉馳齒則勅飭親七柒漆侵寢枕沈浸琛砧針鍼蟄秤稱快他咤唾墮妥惰打拖朶楕舵陀馱駝倬卓啄坼度托拓擢晫柝濁濯琢琸託"],["f7a1","鐸呑嘆坦彈憚歎灘炭綻誕奪脫探眈耽貪塔搭榻宕帑湯糖蕩兌台太怠態殆汰泰笞胎苔跆邰颱宅擇澤撑攄兎吐土討慟桶洞痛筒統通堆槌腿褪退頹偸套妬投透鬪慝特闖坡婆巴把播擺杷波派爬琶破罷芭跛頗判坂板版瓣販辦鈑"],["f8a1","阪八叭捌佩唄悖敗沛浿牌狽稗覇貝彭澎烹膨愎便偏扁片篇編翩遍鞭騙貶坪平枰萍評吠嬖幣廢弊斃肺蔽閉陛佈包匍匏咆哺圃布怖抛抱捕暴泡浦疱砲胞脯苞葡蒲袍褒逋鋪飽鮑幅暴曝瀑爆輻俵剽彪慓杓標漂瓢票表豹飇飄驃"],["f9a1","品稟楓諷豊風馮彼披疲皮被避陂匹弼必泌珌畢疋筆苾馝乏逼下何厦夏廈昰河瑕荷蝦賀遐霞鰕壑學虐謔鶴寒恨悍旱汗漢澣瀚罕翰閑閒限韓割轄函含咸啣喊檻涵緘艦銜陷鹹合哈盒蛤閤闔陜亢伉姮嫦巷恒抗杭桁沆港缸肛航"],["faa1","行降項亥偕咳垓奚孩害懈楷海瀣蟹解該諧邂駭骸劾核倖幸杏荇行享向嚮珦鄕響餉饗香噓墟虛許憲櫶獻軒歇險驗奕爀赫革俔峴弦懸晛泫炫玄玹現眩睍絃絢縣舷衒見賢鉉顯孑穴血頁嫌俠協夾峽挾浹狹脅脇莢鋏頰亨兄刑型"],["fba1","形泂滎瀅灐炯熒珩瑩荊螢衡逈邢鎣馨兮彗惠慧暳蕙蹊醯鞋乎互呼壕壺好岵弧戶扈昊晧毫浩淏湖滸澔濠濩灝狐琥瑚瓠皓祜糊縞胡芦葫蒿虎號蝴護豪鎬頀顥惑或酷婚昏混渾琿魂忽惚笏哄弘汞泓洪烘紅虹訌鴻化和嬅樺火畵"],["fca1","禍禾花華話譁貨靴廓擴攫確碻穫丸喚奐宦幻患換歡晥桓渙煥環紈還驩鰥活滑猾豁闊凰幌徨恍惶愰慌晃晄榥況湟滉潢煌璜皇篁簧荒蝗遑隍黃匯回廻徊恢悔懷晦會檜淮澮灰獪繪膾茴蛔誨賄劃獲宖橫鐄哮嚆孝效斅曉梟涍淆"],["fda1","爻肴酵驍侯候厚后吼喉嗅帿後朽煦珝逅勛勳塤壎焄熏燻薰訓暈薨喧暄煊萱卉喙毁彙徽揮暉煇諱輝麾休携烋畦虧恤譎鷸兇凶匈洶胸黑昕欣炘痕吃屹紇訖欠欽歆吸恰洽翕興僖凞喜噫囍姬嬉希憙憘戱晞曦熙熹熺犧禧稀羲詰"]]')},function(e){e.exports=JSON.parse('[["8740","䏰䰲䘃䖦䕸𧉧䵷䖳𧲱䳢𧳅㮕䜶䝄䱇䱀𤊿𣘗𧍒𦺋𧃒䱗𪍑䝏䗚䲅𧱬䴇䪤䚡𦬣爥𥩔𡩣𣸆𣽡晍囻"],["8767","綕夝𨮹㷴霴𧯯寛𡵞媤㘥𩺰嫑宷峼杮薓𩥅瑡璝㡵𡵓𣚞𦀡㻬"],["87a1","𥣞㫵竼龗𤅡𨤍𣇪𠪊𣉞䌊蒄龖鐯䤰蘓墖靊鈘秐稲晠権袝瑌篅枂稬剏遆㓦珄𥶹瓆鿇垳䤯呌䄱𣚎堘穲𧭥讏䚮𦺈䆁𥶙箮𢒼鿈𢓁𢓉𢓌鿉蔄𣖻䂴鿊䓡𪷿拁灮鿋"],["8840","㇀",4,"𠄌㇅𠃑𠃍㇆㇇𠃋𡿨㇈𠃊㇉㇊㇋㇌𠄎㇍㇎ĀÁǍÀĒÉĚÈŌÓǑÒ࿿Ê̄Ế࿿Ê̌ỀÊāáǎàɑēéěèīíǐìōóǒòūúǔùǖǘǚ"],["88a1","ǜü࿿ê̄ế࿿ê̌ềêɡ⏚⏛"],["8940","𪎩𡅅"],["8943","攊"],["8946","丽滝鵎釟"],["894c","𧜵撑会伨侨兖兴农凤务动医华发变团声处备夲头学实実岚庆总斉柾栄桥济炼电纤纬纺织经统缆缷艺苏药视设询车轧轮"],["89a1","琑糼緍楆竉刧"],["89ab","醌碸酞肼"],["89b0","贋胶𠧧"],["89b5","肟黇䳍鷉鸌䰾𩷶𧀎鸊𪄳㗁"],["89c1","溚舾甙"],["89c5","䤑马骏龙禇𨑬𡷊𠗐𢫦两亁亀亇亿仫伷㑌侽㹈倃傈㑽㒓㒥円夅凛凼刅争剹劐匧㗇厩㕑厰㕓参吣㕭㕲㚁咓咣咴咹哐哯唘唣唨㖘唿㖥㖿嗗㗅"],["8a40","𧶄唥"],["8a43","𠱂𠴕𥄫喐𢳆㧬𠍁蹆𤶸𩓥䁓𨂾睺𢰸㨴䟕𨅝𦧲𤷪擝𠵼𠾴𠳕𡃴撍蹾𠺖𠰋𠽤𢲩𨉖𤓓"],["8a64","𠵆𩩍𨃩䟴𤺧𢳂骲㩧𩗴㿭㔆𥋇𩟔𧣈𢵄鵮頕"],["8a76","䏙𦂥撴哣𢵌𢯊𡁷㧻𡁯"],["8aa1","𦛚𦜖𧦠擪𥁒𠱃蹨𢆡𨭌𠜱"],["8aac","䠋𠆩㿺塳𢶍"],["8ab2","𤗈𠓼𦂗𠽌𠶖啹䂻䎺"],["8abb","䪴𢩦𡂝膪飵𠶜捹㧾𢝵跀嚡摼㹃"],["8ac9","𪘁𠸉𢫏𢳉"],["8ace","𡃈𣧂㦒㨆𨊛㕸𥹉𢃇噒𠼱𢲲𩜠㒼氽𤸻"],["8adf","𧕴𢺋𢈈𪙛𨳍𠹺𠰴𦠜羓𡃏𢠃𢤹㗻𥇣𠺌𠾍𠺪㾓𠼰𠵇𡅏𠹌"],["8af6","𠺫𠮩𠵈𡃀𡄽㿹𢚖搲𠾭"],["8b40","𣏴𧘹𢯎𠵾𠵿𢱑𢱕㨘𠺘𡃇𠼮𪘲𦭐𨳒𨶙𨳊閪哌苄喹"],["8b55","𩻃鰦骶𧝞𢷮煀腭胬尜𦕲脴㞗卟𨂽醶𠻺𠸏𠹷𠻻㗝𤷫㘉𠳖嚯𢞵𡃉𠸐𠹸𡁸𡅈𨈇𡑕𠹹𤹐𢶤婔𡀝𡀞𡃵𡃶垜𠸑"],["8ba1","𧚔𨋍𠾵𠹻𥅾㜃𠾶𡆀𥋘𪊽𤧚𡠺𤅷𨉼墙剨㘚𥜽箲孨䠀䬬鼧䧧鰟鮍𥭴𣄽嗻㗲嚉丨夂𡯁屮靑𠂆乛亻㔾尣彑忄㣺扌攵歺氵氺灬爫丬犭𤣩罒礻糹罓𦉪㓁"],["8bde","𦍋耂肀𦘒𦥑卝衤见𧢲讠贝钅镸长门𨸏韦页风飞饣𩠐鱼鸟黄歯龜丷𠂇阝户钢"],["8c40","倻淾𩱳龦㷉袏𤅎灷峵䬠𥇍㕙𥴰愢𨨲辧釶熑朙玺𣊁𪄇㲋𡦀䬐磤琂冮𨜏䀉橣𪊺䈣蘏𠩯稪𩥇𨫪靕灍匤𢁾鏴盙𨧣龧矝亣俰傼丯众龨吴綋墒壐𡶶庒庙忂𢜒斋"],["8ca1","𣏹椙橃𣱣泿"],["8ca7","爀𤔅玌㻛𤨓嬕璹讃𥲤𥚕窓篬糃繬苸薗龩袐龪躹龫迏蕟駠鈡龬𨶹𡐿䁱䊢娚"],["8cc9","顨杫䉶圽"],["8cce","藖𤥻芿𧄍䲁𦵴嵻𦬕𦾾龭龮宖龯曧繛湗秊㶈䓃𣉖𢞖䎚䔶"],["8ce6","峕𣬚諹屸㴒𣕑嵸龲煗䕘𤃬𡸣䱷㥸㑊𠆤𦱁諌侴𠈹妿腬顖𩣺弻"],["8d40","𠮟"],["8d42","𢇁𨥭䄂䚻𩁹㼇龳𪆵䃸㟖䛷𦱆䅼𨚲𧏿䕭㣔𥒚䕡䔛䶉䱻䵶䗪㿈𤬏㙡䓞䒽䇭崾嵈嵖㷼㠏嶤嶹㠠㠸幂庽弥徃㤈㤔㤿㥍惗愽峥㦉憷憹懏㦸戬抐拥挘㧸嚱"],["8da1","㨃揢揻搇摚㩋擀崕嘡龟㪗斆㪽旿晓㫲暒㬢朖㭂枤栀㭘桊梄㭲㭱㭻椉楃牜楤榟榅㮼槖㯝橥橴橱檂㯬檙㯲檫檵櫔櫶殁毁毪汵沪㳋洂洆洦涁㳯涤涱渕渘温溆𨧀溻滢滚齿滨滩漤漴㵆𣽁澁澾㵪㵵熷岙㶊瀬㶑灐灔灯灿炉𠌥䏁㗱𠻘"],["8e40","𣻗垾𦻓焾𥟠㙎榢𨯩孴穉𥣡𩓙穥穽𥦬窻窰竂竃燑𦒍䇊竚竝竪䇯咲𥰁笋筕笩𥌎𥳾箢筯莜𥮴𦱿篐萡箒箸𥴠㶭𥱥蒒篺簆簵𥳁籄粃𤢂粦晽𤕸糉糇糦籴糳糵糎"],["8ea1","繧䔝𦹄絝𦻖璍綉綫焵綳緒𤁗𦀩緤㴓緵𡟹緥𨍭縝𦄡𦅚繮纒䌫鑬縧罀罁罇礶𦋐駡羗𦍑羣𡙡𠁨䕜𣝦䔃𨌺翺𦒉者耈耝耨耯𪂇𦳃耻耼聡𢜔䦉𦘦𣷣𦛨朥肧𨩈脇脚墰𢛶汿𦒘𤾸擧𡒊舘𡡞橓𤩥𤪕䑺舩𠬍𦩒𣵾俹𡓽蓢荢𦬊𤦧𣔰𡝳𣷸芪椛芳䇛"],["8f40","蕋苐茚𠸖𡞴㛁𣅽𣕚艻苢茘𣺋𦶣𦬅𦮗𣗎㶿茝嗬莅䔋𦶥莬菁菓㑾𦻔橗蕚㒖𦹂𢻯葘𥯤葱㷓䓤檧葊𣲵祘蒨𦮖𦹷𦹃蓞萏莑䒠蒓蓤𥲑䉀𥳀䕃蔴嫲𦺙䔧蕳䔖枿蘖"],["8fa1","𨘥𨘻藁𧂈蘂𡖂𧃍䕫䕪蘨㙈𡢢号𧎚虾蝱𪃸蟮𢰧螱蟚蠏噡虬桖䘏衅衆𧗠𣶹𧗤衞袜䙛袴袵揁装睷𧜏覇覊覦覩覧覼𨨥觧𧤤𧪽誜瞓釾誐𧩙竩𧬺𣾏䜓𧬸煼謌謟𥐰𥕥謿譌譍誩𤩺讐讛誯𡛟䘕衏貛𧵔𧶏貫㜥𧵓賖𧶘𧶽贒贃𡤐賛灜贑𤳉㻐起"],["9040","趩𨀂𡀔𤦊㭼𨆼𧄌竧躭躶軃鋔輙輭𨍥𨐒辥錃𪊟𠩐辳䤪𨧞𨔽𣶻廸𣉢迹𪀔𨚼𨔁𢌥㦀𦻗逷𨔼𧪾遡𨕬𨘋邨𨜓郄𨛦邮都酧㫰醩釄粬𨤳𡺉鈎沟鉁鉢𥖹銹𨫆𣲛𨬌𥗛"],["90a1","𠴱錬鍫𨫡𨯫炏嫃𨫢𨫥䥥鉄𨯬𨰹𨯿鍳鑛躼閅閦鐦閠濶䊹𢙺𨛘𡉼𣸮䧟氜陻隖䅬隣𦻕懚隶磵𨫠隽双䦡𦲸𠉴𦐐𩂯𩃥𤫑𡤕𣌊霱虂霶䨏䔽䖅𤫩灵孁霛靜𩇕靗孊𩇫靟鐥僐𣂷𣂼鞉鞟鞱鞾韀韒韠𥑬韮琜𩐳響韵𩐝𧥺䫑頴頳顋顦㬎𧅵㵑𠘰𤅜"],["9140","𥜆飊颷飈飇䫿𦴧𡛓喰飡飦飬鍸餹𤨩䭲𩡗𩤅駵騌騻騐驘𥜥㛄𩂱𩯕髠髢𩬅髴䰎鬔鬭𨘀倴鬴𦦨㣃𣁽魐魀𩴾婅𡡣鮎𤉋鰂鯿鰌𩹨鷔𩾷𪆒𪆫𪃡𪄣𪇟鵾鶃𪄴鸎梈"],["91a1","鷄𢅛𪆓𪈠𡤻𪈳鴹𪂹𪊴麐麕麞麢䴴麪麯𤍤黁㭠㧥㴝伲㞾𨰫鼂鼈䮖鐤𦶢鼗鼖鼹嚟嚊齅馸𩂋韲葿齢齩竜龎爖䮾𤥵𤦻煷𤧸𤍈𤩑玞𨯚𡣺禟𨥾𨸶鍩鏳𨩄鋬鎁鏋𨥬𤒹爗㻫睲穃烐𤑳𤏸煾𡟯炣𡢾𣖙㻇𡢅𥐯𡟸㜢𡛻𡠹㛡𡝴𡣑𥽋㜣𡛀坛𤨥𡏾𡊨"],["9240","𡏆𡒶蔃𣚦蔃葕𤦔𧅥𣸱𥕜𣻻𧁒䓴𣛮𩦝𦼦柹㜳㰕㷧塬𡤢栐䁗𣜿𤃡𤂋𤄏𦰡哋嚞𦚱嚒𠿟𠮨𠸍鏆𨬓鎜仸儫㠙𤐶亼𠑥𠍿佋侊𥙑婨𠆫𠏋㦙𠌊𠐔㐵伩𠋀𨺳𠉵諚𠈌亘"],["92a1","働儍侢伃𤨎𣺊佂倮偬傁俌俥偘僼兙兛兝兞湶𣖕𣸹𣺿浲𡢄𣺉冨凃𠗠䓝𠒣𠒒𠒑赺𨪜𠜎剙劤𠡳勡鍮䙺熌𤎌𠰠𤦬𡃤槑𠸝瑹㻞璙琔瑖玘䮎𤪼𤂍叐㖄爏𤃉喴𠍅响𠯆圝鉝雴鍦埝垍坿㘾壋媙𨩆𡛺𡝯𡜐娬妸銏婾嫏娒𥥆𡧳𡡡𤊕㛵洅瑃娡𥺃"],["9340","媁𨯗𠐓鏠璌𡌃焅䥲鐈𨧻鎽㞠尞岞幞幈𡦖𡥼𣫮廍孏𡤃𡤄㜁𡢠㛝𡛾㛓脪𨩇𡶺𣑲𨦨弌弎𡤧𡞫婫𡜻孄蘔𧗽衠恾𢡠𢘫忛㺸𢖯𢖾𩂈𦽳懀𠀾𠁆𢘛憙憘恵𢲛𢴇𤛔𩅍"],["93a1","摱𤙥𢭪㨩𢬢𣑐𩣪𢹸挷𪑛撶挱揑𤧣𢵧护𢲡搻敫楲㯴𣂎𣊭𤦉𣊫唍𣋠𡣙𩐿曎𣊉𣆳㫠䆐𥖄𨬢𥖏𡛼𥕛𥐥磮𣄃𡠪𣈴㑤𣈏𣆂𤋉暎𦴤晫䮓昰𧡰𡷫晣𣋒𣋡昞𥡲㣑𣠺𣞼㮙𣞢𣏾瓐㮖枏𤘪梶栞㯄檾㡣𣟕𤒇樳橒櫉欅𡤒攑梘橌㯗橺歗𣿀𣲚鎠鋲𨯪𨫋"],["9440","銉𨀞𨧜鑧涥漋𤧬浧𣽿㶏渄𤀼娽渊塇洤硂焻𤌚𤉶烱牐犇犔𤞏𤜥兹𤪤𠗫瑺𣻸𣙟𤩊𤤗𥿡㼆㺱𤫟𨰣𣼵悧㻳瓌琼鎇琷䒟𦷪䕑疃㽣𤳙𤴆㽘畕癳𪗆㬙瑨𨫌𤦫𤦎㫻"],["94a1","㷍𤩎㻿𤧅𤣳釺圲鍂𨫣𡡤僟𥈡𥇧睸𣈲眎眏睻𤚗𣞁㩞𤣰琸璛㺿𤪺𤫇䃈𤪖𦆮錇𥖁砞碍碈磒珐祙𧝁𥛣䄎禛蒖禥樭𣻺稺秴䅮𡛦䄲鈵秱𠵌𤦌𠊙𣶺𡝮㖗啫㕰㚪𠇔𠰍竢婙𢛵𥪯𥪜娍𠉛磰娪𥯆竾䇹籝籭䈑𥮳𥺼𥺦糍𤧹𡞰粎籼粮檲緜縇緓罎𦉡"],["9540","𦅜𧭈綗𥺂䉪𦭵𠤖柖𠁎𣗏埄𦐒𦏸𤥢翝笧𠠬𥫩𥵃笌𥸎駦虅驣樜𣐿㧢𤧷𦖭騟𦖠蒀𧄧𦳑䓪脷䐂胆脉腂𦞴飃𦩂艢艥𦩑葓𦶧蘐𧈛媆䅿𡡀嬫𡢡嫤𡣘蚠蜨𣶏蠭𧐢娂"],["95a1","衮佅袇袿裦襥襍𥚃襔𧞅𧞄𨯵𨯙𨮜𨧹㺭蒣䛵䛏㟲訽訜𩑈彍鈫𤊄旔焩烄𡡅鵭貟賩𧷜妚矃姰䍮㛔踪躧𤰉輰轊䋴汘澻𢌡䢛潹溋𡟚鯩㚵𤤯邻邗啱䤆醻鐄𨩋䁢𨫼鐧𨰝𨰻蓥訫閙閧閗閖𨴴瑅㻂𤣿𤩂𤏪㻧𣈥随𨻧𨹦𨹥㻌𤧭𤩸𣿮琒瑫㻼靁𩂰"],["9640","桇䨝𩂓𥟟靝鍨𨦉𨰦𨬯𦎾銺嬑譩䤼珹𤈛鞛靱餸𠼦巁𨯅𤪲頟𩓚鋶𩗗釥䓀𨭐𤩧𨭤飜𨩅㼀鈪䤥萔餻饍𧬆㷽馛䭯馪驜𨭥𥣈檏騡嫾騯𩣱䮐𩥈馼䮽䮗鍽塲𡌂堢𤦸"],["96a1","𡓨硄𢜟𣶸棅㵽鑘㤧慐𢞁𢥫愇鱏鱓鱻鰵鰐魿鯏𩸭鮟𪇵𪃾鴡䲮𤄄鸘䲰鴌𪆴𪃭𪃳𩤯鶥蒽𦸒𦿟𦮂藼䔳𦶤𦺄𦷰萠藮𦸀𣟗𦁤秢𣖜𣙀䤭𤧞㵢鏛銾鍈𠊿碹鉷鑍俤㑀遤𥕝砽硔碶硋𡝗𣇉𤥁㚚佲濚濙瀞瀞吔𤆵垻壳垊鴖埗焴㒯𤆬燫𦱀𤾗嬨𡞵𨩉"],["9740","愌嫎娋䊼𤒈㜬䭻𨧼鎻鎸𡣖𠼝葲𦳀𡐓𤋺𢰦𤏁妔𣶷𦝁綨𦅛𦂤𤦹𤦋𨧺鋥珢㻩璴𨭣𡢟㻡𤪳櫘珳珻㻖𤨾𤪔𡟙𤩦𠎧𡐤𤧥瑈𤤖炥𤥶銄珦鍟𠓾錱𨫎𨨖鎆𨯧𥗕䤵𨪂煫"],["97a1","𤥃𠳿嚤𠘚𠯫𠲸唂秄𡟺緾𡛂𤩐𡡒䔮鐁㜊𨫀𤦭妰𡢿𡢃𧒄媡㛢𣵛㚰鉟婹𨪁𡡢鍴㳍𠪴䪖㦊僴㵩㵌𡎜煵䋻𨈘渏𩃤䓫浗𧹏灧沯㳖𣿭𣸭渂漌㵯𠏵畑㚼㓈䚀㻚䡱姄鉮䤾轁𨰜𦯀堒埈㛖𡑒烾𤍢𤩱𢿣𡊰𢎽梹楧𡎘𣓥𧯴𣛟𨪃𣟖𣏺𤲟樚𣚭𦲷萾䓟䓎"],["9840","𦴦𦵑𦲂𦿞漗𧄉茽𡜺菭𦲀𧁓𡟛妉媂𡞳婡婱𡤅𤇼㜭姯𡜼㛇熎鎐暚𤊥婮娫𤊓樫𣻹𧜶𤑛𤋊焝𤉙𨧡侰𦴨峂𤓎𧹍𤎽樌𤉖𡌄炦焳𤏩㶥泟勇𤩏繥姫崯㷳彜𤩝𡟟綤萦"],["98a1","咅𣫺𣌀𠈔坾𠣕𠘙㿥𡾞𪊶瀃𩅛嵰玏糓𨩙𩐠俈翧狍猐𧫴猸猹𥛶獁獈㺩𧬘遬燵𤣲珡臶㻊県㻑沢国琙琞琟㻢㻰㻴㻺瓓㼎㽓畂畭畲疍㽼痈痜㿀癍㿗癴㿜発𤽜熈嘣覀塩䀝睃䀹条䁅㗛瞘䁪䁯属瞾矋売砘点砜䂨砹硇硑硦葈𥔵礳栃礲䄃"],["9940","䄉禑禙辻稆込䅧窑䆲窼艹䇄竏竛䇏両筢筬筻簒簛䉠䉺类粜䊌粸䊔糭输烀𠳏総緔緐緽羮羴犟䎗耠耥笹耮耱联㷌垴炠肷胩䏭脌猪脎脒畠脔䐁㬹腖腙腚"],["99a1","䐓堺腼膄䐥膓䐭膥埯臁臤艔䒏芦艶苊苘苿䒰荗险榊萅烵葤惣蒈䔄蒾蓡蓸蔐蔸蕒䔻蕯蕰藠䕷虲蚒蚲蛯际螋䘆䘗袮裿褤襇覑𧥧訩訸誔誴豑賔賲贜䞘塟跃䟭仮踺嗘坔蹱嗵躰䠷軎転軤軭軲辷迁迊迌逳駄䢭飠鈓䤞鈨鉘鉫銱銮銿"],["9a40","鋣鋫鋳鋴鋽鍃鎄鎭䥅䥑麿鐗匁鐝鐭鐾䥪鑔鑹锭関䦧间阳䧥枠䨤靀䨵鞲韂噔䫤惨颹䬙飱塄餎餙冴餜餷饂饝饢䭰駅䮝騼鬏窃魩鮁鯝鯱鯴䱭鰠㝯𡯂鵉鰺"],["9aa1","黾噐鶓鶽鷀鷼银辶鹻麬麱麽黆铜黢黱黸竈齄𠂔𠊷𠎠椚铃妬𠓗塀铁㞹𠗕𠘕𠙶𡚺块煳𠫂𠫍𠮿呪吆𠯋咞𠯻𠰻𠱓𠱥𠱼惧𠲍噺𠲵𠳝𠳭𠵯𠶲𠷈楕鰯螥𠸄𠸎𠻗𠾐𠼭𠹳尠𠾼帋𡁜𡁏𡁶朞𡁻𡂈𡂖㙇𡂿𡃓𡄯𡄻卤蒭𡋣𡍵𡌶讁𡕷𡘙𡟃𡟇乸炻𡠭𡥪"],["9b40","𡨭𡩅𡰪𡱰𡲬𡻈拃𡻕𡼕熘桕𢁅槩㛈𢉼𢏗𢏺𢜪𢡱𢥏苽𢥧𢦓𢫕覥𢫨辠𢬎鞸𢬿顇骽𢱌"],["9b62","𢲈𢲷𥯨𢴈𢴒𢶷𢶕𢹂𢽴𢿌𣀳𣁦𣌟𣏞徱晈暿𧩹𣕧𣗳爁𤦺矗𣘚𣜖纇𠍆墵朎"],["9ba1","椘𣪧𧙗𥿢𣸑𣺹𧗾𢂚䣐䪸𤄙𨪚𤋮𤌍𤀻𤌴𤎖𤩅𠗊凒𠘑妟𡺨㮾𣳿𤐄𤓖垈𤙴㦛𤜯𨗨𩧉㝢𢇃譞𨭎駖𤠒𤣻𤨕爉𤫀𠱸奥𤺥𤾆𠝹軚𥀬劏圿煱𥊙𥐙𣽊𤪧喼𥑆𥑮𦭒釔㑳𥔿𧘲𥕞䜘𥕢𥕦𥟇𤤿𥡝偦㓻𣏌惞𥤃䝼𨥈𥪮𥮉𥰆𡶐垡煑澶𦄂𧰒遖𦆲𤾚譢𦐂𦑊"],["9c40","嵛𦯷輶𦒄𡤜諪𤧶𦒈𣿯𦔒䯀𦖿𦚵𢜛鑥𥟡憕娧晉侻嚹𤔡𦛼乪𤤴陖涏𦲽㘘襷𦞙𦡮𦐑𦡞營𦣇筂𩃀𠨑𦤦鄄𦤹穅鷰𦧺騦𦨭㙟𦑩𠀡禃𦨴𦭛崬𣔙菏𦮝䛐𦲤画补𦶮墶"],["9ca1","㜜𢖍𧁋𧇍㱔𧊀𧊅銁𢅺𧊋錰𧋦𤧐氹钟𧑐𠻸蠧裵𢤦𨑳𡞱溸𤨪𡠠㦤㚹尐秣䔿暶𩲭𩢤襃𧟌𧡘囖䃟𡘊㦡𣜯𨃨𡏅熭荦𧧝𩆨婧䲷𧂯𨦫𧧽𧨊𧬋𧵦𤅺筃祾𨀉澵𪋟樃𨌘厢𦸇鎿栶靝𨅯𨀣𦦵𡏭𣈯𨁈嶅𨰰𨂃圕頣𨥉嶫𤦈斾槕叒𤪥𣾁㰑朶𨂐𨃴𨄮𡾡𨅏"],["9d40","𨆉𨆯𨈚𨌆𨌯𨎊㗊𨑨𨚪䣺揦𨥖砈鉕𨦸䏲𨧧䏟𨧨𨭆𨯔姸𨰉輋𨿅𩃬筑𩄐𩄼㷷𩅞𤫊运犏嚋𩓧𩗩𩖰𩖸𩜲𩣑𩥉𩥪𩧃𩨨𩬎𩵚𩶛纟𩻸𩼣䲤镇𪊓熢𪋿䶑递𪗋䶜𠲜达嗁"],["9da1","辺𢒰边𤪓䔉繿潖檱仪㓤𨬬𧢝㜺躀𡟵𨀤𨭬𨮙𧨾𦚯㷫𧙕𣲷𥘵𥥖亚𥺁𦉘嚿𠹭踎孭𣺈𤲞揞拐𡟶𡡻攰嘭𥱊吚𥌑㷆𩶘䱽嘢嘞罉𥻘奵𣵀蝰东𠿪𠵉𣚺脗鵞贘瘻鱅癎瞹鍅吲腈苷嘥脲萘肽嗪祢噃吖𠺝㗎嘅嗱曱𨋢㘭甴嗰喺咗啲𠱁𠲖廐𥅈𠹶𢱢"],["9e40","𠺢麫絚嗞𡁵抝靭咔賍燶酶揼掹揾啩𢭃鱲𢺳冚㓟𠶧冧呍唞唓癦踭𦢊疱肶蠄螆裇膶萜𡃁䓬猄𤜆宐茋𦢓噻𢛴𧴯𤆣𧵳𦻐𧊶酰𡇙鈈𣳼𪚩𠺬𠻹牦𡲢䝎𤿂𧿹𠿫䃺"],["9ea1","鱝攟𢶠䣳𤟠𩵼𠿬𠸊恢𧖣𠿭"],["9ead","𦁈𡆇熣纎鵐业丄㕷嬍沲卧㚬㧜卽㚥𤘘墚𤭮舭呋垪𥪕𠥹"],["9ec5","㩒𢑥獴𩺬䴉鯭𣳾𩼰䱛𤾩𩖞𩿞葜𣶶𧊲𦞳𣜠挮紥𣻷𣸬㨪逈勌㹴㙺䗩𠒎癀嫰𠺶硺𧼮墧䂿噼鮋嵴癔𪐴麅䳡痹㟻愙𣃚𤏲"],["9ef5","噝𡊩垧𤥣𩸆刴𧂮㖭汊鵼"],["9f40","籖鬹埞𡝬屓擓𩓐𦌵𧅤蚭𠴨𦴢𤫢𠵱"],["9f4f","凾𡼏嶎霃𡷑麁遌笟鬂峑箣扨挵髿篏鬪籾鬮籂粆鰕篼鬉鼗鰛𤤾齚啳寃俽麘俲剠㸆勑坧偖妷帒韈鶫轜呩鞴饀鞺匬愰"],["9fa1","椬叚鰊鴂䰻陁榀傦畆𡝭駚剳"],["9fae","酙隁酜"],["9fb2","酑𨺗捿𦴣櫊嘑醎畺抅𠏼獏籰𥰡𣳽"],["9fc1","𤤙盖鮝个𠳔莾衂"],["9fc9","届槀僭坺刟巵从氱𠇲伹咜哚劚趂㗾弌㗳"],["9fdb","歒酼龥鮗頮颴骺麨麄煺笔"],["9fe7","毺蠘罸"],["9feb","嘠𪙊蹷齓"],["9ff0","跔蹏鸜踁抂𨍽踨蹵竓𤩷稾磘泪詧瘇"],["a040","𨩚鼦泎蟖痃𪊲硓咢贌狢獱謭猂瓱賫𤪻蘯徺袠䒷"],["a055","𡠻𦸅"],["a058","詾𢔛"],["a05b","惽癧髗鵄鍮鮏蟵"],["a063","蠏賷猬霡鮰㗖犲䰇籑饊𦅙慙䰄麖慽"],["a073","坟慯抦戹拎㩜懢厪𣏵捤栂㗒"],["a0a1","嵗𨯂迚𨸹"],["a0a6","僙𡵆礆匲阸𠼻䁥"],["a0ae","矾"],["a0b0","糂𥼚糚稭聦聣絍甅瓲覔舚朌聢𧒆聛瓰脃眤覉𦟌畓𦻑螩蟎臈螌詉貭譃眫瓸蓚㘵榲趦"],["a0d4","覩瑨涹蟁𤀑瓧㷛煶悤憜㳑煢恷"],["a0e2","罱𨬭牐惩䭾删㰘𣳇𥻗𧙖𥔱𡥄𡋾𩤃𦷜𧂭峁𦆭𨨏𣙷𠃮𦡆𤼎䕢嬟𦍌齐麦𦉫"],["a3c0","␀",31,"␡"],["c6a1","①",9,"⑴",9,"ⅰ",9,"丶丿亅亠冂冖冫勹匸卩厶夊宀巛⼳广廴彐彡攴无疒癶辵隶¨ˆヽヾゝゞ〃仝々〆〇ー[]✽ぁ",23],["c740","す",58,"ァアィイ"],["c7a1","ゥ",81,"А",5,"ЁЖ",4],["c840","Л",26,"ёж",25,"⇧↸↹㇏𠃌乚𠂊刂䒑"],["c8a1","龰冈龱𧘇"],["c8cd","¬¦'"㈱№℡゛゜⺀⺄⺆⺇⺈⺊⺌⺍⺕⺜⺝⺥⺧⺪⺬⺮⺶⺼⺾⻆⻊⻌⻍⻏⻖⻗⻞⻣"],["c8f5","ʃɐɛɔɵœøŋʊɪ"],["f9fe","■"],["fa40","𠕇鋛𠗟𣿅蕌䊵珯况㙉𤥂𨧤鍄𡧛苮𣳈砼杄拟𤤳𨦪𠊠𦮳𡌅侫𢓭倈𦴩𧪄𣘀𤪱𢔓倩𠍾徤𠎀𠍇滛𠐟偽儁㑺儎顬㝃萖𤦤𠒇兠𣎴兪𠯿𢃼𠋥𢔰𠖎𣈳𡦃宂蝽𠖳𣲙冲冸"],["faa1","鴴凉减凑㳜凓𤪦决凢卂凭菍椾𣜭彻刋刦刼劵剗劔効勅簕蕂勠蘍𦬓包𨫞啉滙𣾀𠥔𣿬匳卄𠯢泋𡜦栛珕恊㺪㣌𡛨燝䒢卭却𨚫卾卿𡖖𡘓矦厓𨪛厠厫厮玧𥝲㽙玜叁叅汉义埾叙㪫𠮏叠𣿫𢶣叶𠱷吓灹唫晗浛呭𦭓𠵴啝咏咤䞦𡜍𠻝㶴𠵍"],["fb40","𨦼𢚘啇䳭启琗喆喩嘅𡣗𤀺䕒𤐵暳𡂴嘷曍𣊊暤暭噍噏磱囱鞇叾圀囯园𨭦㘣𡉏坆𤆥汮炋坂㚱𦱾埦𡐖堃𡑔𤍣堦𤯵塜墪㕡壠壜𡈼壻寿坃𪅐𤉸鏓㖡够梦㛃湙"],["fba1","𡘾娤啓𡚒蔅姉𠵎𦲁𦴪𡟜姙𡟻𡞲𦶦浱𡠨𡛕姹𦹅媫婣㛦𤦩婷㜈媖瑥嫓𦾡𢕔㶅𡤑㜲𡚸広勐孶斈孼𧨎䀄䡝𠈄寕慠𡨴𥧌𠖥寳宝䴐尅𡭄尓珎尔𡲥𦬨屉䣝岅峩峯嶋𡷹𡸷崐崘嵆𡺤岺巗苼㠭𤤁𢁉𢅳芇㠶㯂帮檊幵幺𤒼𠳓厦亷廐厨𡝱帉廴𨒂"],["fc40","廹廻㢠廼栾鐛弍𠇁弢㫞䢮𡌺强𦢈𢏐彘𢑱彣鞽𦹮彲鍀𨨶徧嶶㵟𥉐𡽪𧃸𢙨釖𠊞𨨩怱暅𡡷㥣㷇㘹垐𢞴祱㹀悞悤悳𤦂𤦏𧩓璤僡媠慤萤慂慈𦻒憁凴𠙖憇宪𣾷"],["fca1","𢡟懓𨮝𩥝懐㤲𢦀𢣁怣慜攞掋𠄘担𡝰拕𢸍捬𤧟㨗搸揸𡎎𡟼撐澊𢸶頔𤂌𥜝擡擥鑻㩦携㩗敍漖𤨨𤨣斅敭敟𣁾斵𤥀䬷旑䃘𡠩无旣忟𣐀昘𣇷𣇸晄𣆤𣆥晋𠹵晧𥇦晳晴𡸽𣈱𨗴𣇈𥌓矅𢣷馤朂𤎜𤨡㬫槺𣟂杞杧杢𤇍𩃭柗䓩栢湐鈼栁𣏦𦶠桝"],["fd40","𣑯槡樋𨫟楳棃𣗍椁椀㴲㨁𣘼㮀枬楡𨩊䋼椶榘㮡𠏉荣傐槹𣙙𢄪橅𣜃檝㯳枱櫈𩆜㰍欝𠤣惞欵歴𢟍溵𣫛𠎵𡥘㝀吡𣭚毡𣻼毜氷𢒋𤣱𦭑汚舦汹𣶼䓅𣶽𤆤𤤌𤤀"],["fda1","𣳉㛥㳫𠴲鮃𣇹𢒑羏样𦴥𦶡𦷫涖浜湼漄𤥿𤂅𦹲蔳𦽴凇沜渝萮𨬡港𣸯瑓𣾂秌湏媑𣁋濸㜍澝𣸰滺𡒗𤀽䕕鏰潄潜㵎潴𩅰㴻澟𤅄濓𤂑𤅕𤀹𣿰𣾴𤄿凟𤅖𤅗𤅀𦇝灋灾炧炁烌烕烖烟䄄㷨熴熖𤉷焫煅媈煊煮岜𤍥煏鍢𤋁焬𤑚𤨧𤨢熺𨯨炽爎"],["fe40","鑂爕夑鑃爤鍁𥘅爮牀𤥴梽牕牗㹕𣁄栍漽犂猪猫𤠣𨠫䣭𨠄猨献珏玪𠰺𦨮珉瑉𤇢𡛧𤨤昣㛅𤦷𤦍𤧻珷琕椃𤨦琹𠗃㻗瑜𢢭瑠𨺲瑇珤瑶莹瑬㜰瑴鏱樬璂䥓𤪌"],["fea1","𤅟𤩹𨮏孆𨰃𡢞瓈𡦈甎瓩甞𨻙𡩋寗𨺬鎅畍畊畧畮𤾂㼄𤴓疎瑝疞疴瘂瘬癑癏癯癶𦏵皐臯㟸𦤑𦤎皡皥皷盌𦾟葢𥂝𥅽𡸜眞眦着撯𥈠睘𣊬瞯𨥤𨥨𡛁矴砉𡍶𤨒棊碯磇磓隥礮𥗠磗礴碱𧘌辸袄𨬫𦂃𢘜禆褀椂禀𥡗禝𧬹礼禩渪𧄦㺨秆𩄍秔"]]')},function(e,t,r){"use strict";var n=r(0).Buffer;e.exports=function(e){var t=e.Transform;function r(e,r){this.conv=e,(r=r||{}).decodeStrings=!1,t.call(this,r)}function i(e,r){this.conv=e,(r=r||{}).encoding=this.encoding="utf8",t.call(this,r)}return r.prototype=Object.create(t.prototype,{constructor:{value:r}}),r.prototype._transform=function(e,t,r){if("string"!=typeof e)return r(new Error("Iconv encoding stream needs strings as its input."));try{var n=this.conv.write(e);n&&n.length&&this.push(n),r()}catch(e){r(e)}},r.prototype._flush=function(e){try{var t=this.conv.end();t&&t.length&&this.push(t),e()}catch(t){e(t)}},r.prototype.collect=function(e){var t=[];return this.on("error",e),this.on("data",(function(e){t.push(e)})),this.on("end",(function(){e(null,n.concat(t))})),this},i.prototype=Object.create(t.prototype,{constructor:{value:i}}),i.prototype._transform=function(e,t,r){if(!(n.isBuffer(e)||e instanceof Uint8Array))return r(new Error("Iconv decoding stream needs buffers as its input."));try{var i=this.conv.write(e);i&&i.length&&this.push(i,this.encoding),r()}catch(e){r(e)}},i.prototype._flush=function(e){try{var t=this.conv.end();t&&t.length&&this.push(t,this.encoding),e()}catch(t){e(t)}},i.prototype.collect=function(e){var t="";return this.on("error",e),this.on("data",(function(e){t+=e})),this.on("end",(function(){e(null,t)})),this},{IconvLiteEncoderStream:r,IconvLiteDecoderStream:i}}},function(e,t){}])}));//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@vscode/iconv-lite-umd/lib/iconv-lite-umd.js.map{ "compilerOptions": { "resolveJsonModule": true, "lib": [ "esnext" ] } }vscode-ripgrep Copyright (c) Microsoft Corporation All rights reserved. MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "@vscode/ripgrep", "version": "1.14.2", "description": "A module for using ripgrep in a Node project", "main": "lib/index.js", "typings": "lib/index.d.ts", "repository": { "type": "git", "url": "https://github.com/microsoft/vscode-ripgrep" }, "scripts": { "postinstall": "node ./lib/postinstall.js" }, "author": "Rob Lourens", "license": "MIT", "dependencies": { "https-proxy-agent": "^5.0.0", "proxy-from-env": "^1.1.0" }, "overrides": { "agent-base": "^6.0.2" }, "devDependencies": { "@types/node": "^10.12.0" } } ## Security Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below. ## Reporting Security Issues **Please do not report security vulnerabilities through public GitHub issues.** Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) * Full paths of source file(s) related to the manifestation of the issue * The location of the affected source code (tag/branch/commit or direct URL) * Any special configuration required to reproduce the issue * Step-by-step instructions to reproduce the issue * Proof-of-concept or exploit code (if possible) * Impact of the issue, including how an attacker might exploit the issue This information will help us triage your report more quickly. If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. ## Preferred Languages We prefer all communications to be in English. ## Policy Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). // @ts-check 'use strict'; const path = require('path'); const fs = require('fs'); const os = require('os'); const https = require('https'); const util = require('util'); const url = require('url'); const URL = url.URL; const child_process = require('child_process'); const proxy_from_env = require('proxy-from-env'); const packageVersion = require('../package.json').version; const tmpDir = path.join(os.tmpdir(), `vscode-ripgrep-cache-${packageVersion}`); const fsUnlink = util.promisify(fs.unlink); const fsExists = util.promisify(fs.exists); const fsMkdir = util.promisify(fs.mkdir); const isWindows = os.platform() === 'win32'; const REPO = 'microsoft/ripgrep-prebuilt'; function isGithubUrl(_url) { return url.parse(_url).hostname === 'api.github.com'; } function downloadWin(url, dest, opts) { return new Promise((resolve, reject) => { let userAgent; if (opts.headers['user-agent']) { userAgent = opts.headers['user-agent']; delete opts.headers['user-agent']; } const headerValues = Object.keys(opts.headers) .map(key => `\\"${key}\\"=\\"${opts.headers[key]}\\"`) .join('; '); const headers = `@{${headerValues}}`; console.log('Downloading with Invoke-WebRequest'); dest = sanitizePathForPowershell(dest); let iwrCmd = `[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest -URI ${url} -UseBasicParsing -OutFile ${dest} -Headers ${headers}`; if (userAgent) { iwrCmd += ' -UserAgent ' + userAgent; } if (opts.proxy) { iwrCmd += ' -Proxy ' + opts.proxy; try { const { username, password } = new URL(opts.proxy); if (username && password) { const decodedPassword = decodeURIComponent(password); iwrCmd += ` -ProxyCredential (New-Object PSCredential ('${username}', (ConvertTo-SecureString '${decodedPassword}' -AsPlainText -Force)))`; } } catch (err) { reject(err); } } iwrCmd = `powershell "${iwrCmd}"`; child_process.exec(iwrCmd, err => { if (err) { reject(err); return; } resolve(); }); }); } function download(_url, dest, opts) { const proxy = proxy_from_env.getProxyForUrl(url.parse(_url)); if (proxy !== '') { var HttpsProxyAgent = require('https-proxy-agent'); opts = { ...opts, "agent": new HttpsProxyAgent(proxy), proxy }; } if (isWindows) { // This alternative strategy shouldn't be necessary but sometimes on Windows the file does not get closed, // so unzipping it fails, and I don't know why. return downloadWin(_url, dest, opts); } if (opts.headers && opts.headers.authorization && !isGithubUrl(_url)) { delete opts.headers.authorization; } return new Promise((resolve, reject) => { console.log(`Download options: ${JSON.stringify(opts)}`); const outFile = fs.createWriteStream(dest); const mergedOpts = { ...url.parse(_url), ...opts }; https.get(mergedOpts, response => { console.log('statusCode: ' + response.statusCode); if (response.statusCode === 302) { console.log('Following redirect to: ' + response.headers.location); return download(response.headers.location, dest, opts) .then(resolve, reject); } else if (response.statusCode !== 200) { reject(new Error('Download failed with ' + response.statusCode)); return; } response.pipe(outFile); outFile.on('finish', () => { resolve(); }); }).on('error', async err => { await fsUnlink(dest); reject(err); }); }); } function get(_url, opts) { console.log(`GET ${_url}`); const proxy = proxy_from_env.getProxyForUrl(url.parse(_url)); if (proxy !== '') { var HttpsProxyAgent = require('https-proxy-agent'); opts = { ...opts, "agent": new HttpsProxyAgent(proxy) }; } return new Promise((resolve, reject) => { let result = ''; opts = { ...url.parse(_url), ...opts }; https.get(opts, response => { if (response.statusCode !== 200) { reject(new Error('Request failed: ' + response.statusCode)); } response.on('data', d => { result += d.toString(); }); response.on('end', () => { resolve(result); }); response.on('error', e => { reject(e); }); }); }); } function getApiUrl(repo, tag) { return `https://api.github.com/repos/${repo}/releases/tags/${tag}`; } /** * @param {{ force: boolean; token: string; version: string; }} opts * @param {string} assetName * @param {string} downloadFolder */ async function getAssetFromGithubApi(opts, assetName, downloadFolder) { const assetDownloadPath = path.join(downloadFolder, assetName); // We can just use the cached binary if (!opts.force && await fsExists(assetDownloadPath)) { console.log('Using cached download: ' + assetDownloadPath); return assetDownloadPath; } const downloadOpts = { headers: { 'user-agent': 'vscode-ripgrep' } }; if (opts.token) { downloadOpts.headers.authorization = `token ${opts.token}`; } console.log(`Finding release for ${opts.version}`); const release = await get(getApiUrl(REPO, opts.version), downloadOpts); let jsonRelease; try { jsonRelease = JSON.parse(release); } catch (e) { throw new Error('Malformed API response: ' + e.stack); } if (!jsonRelease.assets) { throw new Error('Bad API response: ' + JSON.stringify(release)); } const asset = jsonRelease.assets.find(a => a.name === assetName); if (!asset) { throw new Error('Asset not found with name: ' + assetName); } console.log(`Downloading from ${asset.url}`); console.log(`Downloading to ${assetDownloadPath}`); downloadOpts.headers.accept = 'application/octet-stream'; await download(asset.url, assetDownloadPath, downloadOpts); } function unzipWindows(zipPath, destinationDir) { return new Promise((resolve, reject) => { zipPath = sanitizePathForPowershell(zipPath); destinationDir = sanitizePathForPowershell(destinationDir); const expandCmd = 'powershell -ExecutionPolicy Bypass -Command Expand-Archive ' + ['-Path', zipPath, '-DestinationPath', destinationDir, '-Force'].join(' '); child_process.exec(expandCmd, (err, _stdout, stderr) => { if (err) { reject(err); return; } if (stderr) { console.log(stderr); reject(new Error(stderr)); return; } console.log('Expand-Archive completed'); resolve(); }); }); } // Handle whitespace in filepath as powershell split's path with whitespaces function sanitizePathForPowershell(path) { path = path.replace(/ /g, '` '); // replace whitespace with "` " as solution provided here https://stackoverflow.com/a/18537344/7374562 return path; } function untar(zipPath, destinationDir) { return new Promise((resolve, reject) => { const unzipProc = child_process.spawn('tar', ['xvf', zipPath, '-C', destinationDir], { stdio: 'inherit' }); unzipProc.on('error', err => { reject(err); }); unzipProc.on('close', code => { console.log(`tar xvf exited with ${code}`); if (code !== 0) { reject(new Error(`tar xvf exited with ${code}`)); return; } resolve(); }); }); } async function unzipRipgrep(zipPath, destinationDir) { if (isWindows) { await unzipWindows(zipPath, destinationDir); } else { await untar(zipPath, destinationDir); } const expectedName = path.join(destinationDir, 'rg'); if (await fsExists(expectedName)) { return expectedName; } if (await fsExists(expectedName + '.exe')) { return expectedName + '.exe'; } throw new Error(`Expecting rg or rg.exe unzipped into ${destinationDir}, didn't find one.`); } module.exports = async opts => { if (!opts.version) { return Promise.reject(new Error('Missing version')); } if (!opts.target) { return Promise.reject(new Error('Missing target')); } const extension = isWindows ? '.zip' : '.tar.gz'; const assetName = ['ripgrep', opts.version, opts.target].join('-') + extension; if (!await fsExists(tmpDir)) { await fsMkdir(tmpDir); } const assetDownloadPath = path.join(tmpDir, assetName); try { await getAssetFromGithubApi(opts, assetName, tmpDir) } catch (e) { console.log('Deleting invalid download cache'); try { await fsUnlink(assetDownloadPath); } catch (e) { } throw e; } console.log(`Unzipping to ${opts.destDir}`); try { const destinationPath = await unzipRipgrep(assetDownloadPath, opts.destDir); if (!isWindows) { await util.promisify(fs.chmod)(destinationPath, '755'); } } catch (e) { console.log('Deleting invalid download'); try { await fsUnlink(assetDownloadPath); } catch (e) { } throw e; } }; 'use strict'; const path = require('path'); module.exports.rgPath = path.join(__dirname, `../bin/rg${process.platform === 'win32' ? '.exe' : ''}`);// @ts-check 'use strict'; const os = require('os'); const fs = require('fs'); const path = require('path'); const util = require('util'); const child_process = require('child_process'); const download = require('./download'); const fsExists = util.promisify(fs.exists); const mkdir = util.promisify(fs.mkdir); const exec = util.promisify(child_process.exec); const forceInstall = process.argv.includes('--force'); if (forceInstall) { console.log('--force, ignoring caches'); } const VERSION = 'v13.0.0-4'; const BIN_PATH = path.join(__dirname, '../bin'); process.on('unhandledRejection', (reason, promise) => { console.log('Unhandled rejection: ', promise, 'reason:', reason); }); async function isMusl() { let stderr; try { stderr = (await exec('ldd --version')).stderr; } catch (err) { stderr = err.stderr; } if(stderr.indexOf('musl') > -1) { return true; } return false; } async function getTarget() { const arch = process.env.npm_config_arch || os.arch(); switch (os.platform()) { case 'darwin': return arch === 'arm64' ? 'aarch64-apple-darwin' : 'x86_64-apple-darwin'; case 'win32': return arch === 'x64' ? 'x86_64-pc-windows-msvc' : arch === 'arm' ? 'aarch64-pc-windows-msvc' : 'i686-pc-windows-msvc'; case 'linux': return arch === 'x64' ? 'x86_64-unknown-linux-musl' : arch === 'arm' ? 'arm-unknown-linux-gnueabihf' : arch === 'armv7l' ? 'arm-unknown-linux-gnueabihf' : arch === 'arm64' ? await isMusl() ? 'aarch64-unknown-linux-musl' : 'aarch64-unknown-linux-gnu' : arch === 'ppc64' ? 'powerpc64le-unknown-linux-gnu' : arch === 's390x' ? 's390x-unknown-linux-gnu' : 'i686-unknown-linux-musl' default: throw new Error('Unknown platform: ' + os.platform()); } } async function main() { const binExists = await fsExists(BIN_PATH); if (!forceInstall && binExists) { console.log('bin/ folder already exists, exiting'); process.exit(0); } if (!binExists) { await mkdir(BIN_PATH); } const opts = { version: VERSION, token: process.env['GITHUB_TOKEN'], target: await getTarget(), destDir: BIN_PATH, force: forceInstall }; try { await download(opts); } catch (err) { console.error(`Downloading ripgrep failed: ${err.stack}`); process.exit(1); } } main(); (The MIT License) Copyright (c) 2014 TJ Holowaychuk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "debug", "version": "4.1.1", "repository": { "type": "git", "url": "git://github.com/visionmedia/debug.git" }, "description": "small debugging utility", "keywords": [ "debug", "log", "debugger" ], "files": [ "src", "dist/debug.js", "LICENSE", "README.md" ], "author": "TJ Holowaychuk ", "contributors": [ "Nathan Rajlich (http://n8.io)", "Andrew Rhyne " ], "license": "MIT", "scripts": { "lint": "xo", "test": "npm run test:node && npm run test:browser", "test:node": "istanbul cover _mocha -- test.js", "pretest:browser": "npm run build", "test:browser": "karma start --single-run", "prebuild:debug": "mkdir -p dist && browserify --standalone debug -o dist/debug.es6.js .", "build:debug": "babel -o dist/debug.js dist/debug.es6.js > dist/debug.js", "build:test": "babel -d dist test.js", "build": "npm run build:debug && npm run build:test", "clean": "rimraf dist coverage", "test:coverage": "cat ./coverage/lcov.info | coveralls" }, "dependencies": { "ms": "^2.1.1" }, "devDependencies": { "@babel/cli": "^7.0.0", "@babel/core": "^7.0.0", "@babel/preset-env": "^7.0.0", "browserify": "14.4.0", "chai": "^3.5.0", "concurrently": "^3.1.0", "coveralls": "^3.0.2", "istanbul": "^0.4.5", "karma": "^3.0.0", "karma-chai": "^0.1.0", "karma-mocha": "^1.3.0", "karma-phantomjs-launcher": "^1.0.2", "mocha": "^5.2.0", "mocha-lcov-reporter": "^1.2.0", "rimraf": "^2.5.4", "xo": "^0.23.0" }, "main": "./src/index.js", "browser": "./src/browser.js", "unpkg": "./dist/debug.js" } { "name": "https-proxy-agent", "version": "5.0.0", "description": "An HTTP(s) proxy `http.Agent` implementation for HTTPS", "main": "dist/index", "types": "dist/index", "files": [ "dist" ], "scripts": { "prebuild": "rimraf dist", "build": "tsc", "test": "mocha --reporter spec", "test-lint": "eslint src --ext .js,.ts", "prepublishOnly": "npm run build" }, "repository": { "type": "git", "url": "git://github.com/TooTallNate/node-https-proxy-agent.git" }, "keywords": [ "https", "proxy", "endpoint", "agent" ], "author": "Nathan Rajlich (http://n8.io/)", "license": "MIT", "bugs": { "url": "https://github.com/TooTallNate/node-https-proxy-agent/issues" }, "dependencies": { "agent-base": "6", "debug": "4" }, "devDependencies": { "@types/debug": "4", "@types/node": "^12.12.11", "@typescript-eslint/eslint-plugin": "1.6.0", "@typescript-eslint/parser": "1.1.0", "eslint": "5.16.0", "eslint-config-airbnb": "17.1.0", "eslint-config-prettier": "4.1.0", "eslint-import-resolver-typescript": "1.1.1", "eslint-plugin-import": "2.16.0", "eslint-plugin-jsx-a11y": "6.2.1", "eslint-plugin-react": "7.12.4", "mocha": "^6.2.2", "proxy": "1", "rimraf": "^3.0.0", "typescript": "^3.5.3" }, "engines": { "node": ">= 6" } } "use strict"; function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } (function (f) { if ((typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined") { module.exports = f(); } else if (typeof define === "function" && define.amd) { define([], f); } else { var g; if (typeof window !== "undefined") { g = window; } else if (typeof global !== "undefined") { g = global; } else if (typeof self !== "undefined") { g = self; } else { g = this; } g.debug = f(); } })(function () { var define, module, exports; return function () { function r(e, n, t) { function o(i, f) { if (!n[i]) { if (!e[i]) { var c = "function" == typeof require && require; if (!f && c) return c(i, !0); if (u) return u(i, !0); var a = new Error("Cannot find module '" + i + "'"); throw a.code = "MODULE_NOT_FOUND", a; } var p = n[i] = { exports: {} }; e[i][0].call(p.exports, function (r) { var n = e[i][1][r]; return o(n || r); }, p, p.exports, r, e, n, t); } return n[i].exports; } for (var u = "function" == typeof require && require, i = 0; i < t.length; i++) { o(t[i]); } return o; } return r; }()({ 1: [function (require, module, exports) { /** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; var w = d * 7; var y = d * 365.25; /** * Parse or format the given `val`. * * Options: * * - `long` verbose formatting [false] * * @param {String|Number} val * @param {Object} [options] * @throws {Error} throw an error if val is not a non-empty string or a number * @return {String|Number} * @api public */ module.exports = function (val, options) { options = options || {}; var type = _typeof(val); if (type === 'string' && val.length > 0) { return parse(val); } else if (type === 'number' && isNaN(val) === false) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val)); }; /** * Parse the given `str` and return milliseconds. * * @param {String} str * @return {Number} * @api private */ function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'yrs': case 'yr': case 'y': return n * y; case 'weeks': case 'week': case 'w': return n * w; case 'days': case 'day': case 'd': return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': return n * m; case 'seconds': case 'second': case 'secs': case 'sec': case 's': return n * s; case 'milliseconds': case 'millisecond': case 'msecs': case 'msec': case 'ms': return n; default: return undefined; } } /** * Short format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtShort(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return Math.round(ms / d) + 'd'; } if (msAbs >= h) { return Math.round(ms / h) + 'h'; } if (msAbs >= m) { return Math.round(ms / m) + 'm'; } if (msAbs >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtLong(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return plural(ms, msAbs, d, 'day'); } if (msAbs >= h) { return plural(ms, msAbs, h, 'hour'); } if (msAbs >= m) { return plural(ms, msAbs, m, 'minute'); } if (msAbs >= s) { return plural(ms, msAbs, s, 'second'); } return ms + ' ms'; } /** * Pluralization helper. */ function plural(ms, msAbs, n, name) { var isPlural = msAbs >= n * 1.5; return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); } }, {}], 2: [function (require, module, exports) { // shim for using process in browser var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it // don't break things. But we need to wrap it in a try catch in case it is // wrapped in strict mode code which doesn't define any globals. It's inside a // function because try/catches deoptimize in certain engines. var cachedSetTimeout; var cachedClearTimeout; function defaultSetTimout() { throw new Error('setTimeout has not been defined'); } function defaultClearTimeout() { throw new Error('clearTimeout has not been defined'); } (function () { try { if (typeof setTimeout === 'function') { cachedSetTimeout = setTimeout; } else { cachedSetTimeout = defaultSetTimout; } } catch (e) { cachedSetTimeout = defaultSetTimout; } try { if (typeof clearTimeout === 'function') { cachedClearTimeout = clearTimeout; } else { cachedClearTimeout = defaultClearTimeout; } } catch (e) { cachedClearTimeout = defaultClearTimeout; } })(); function runTimeout(fun) { if (cachedSetTimeout === setTimeout) { //normal enviroments in sane situations return setTimeout(fun, 0); } // if setTimeout wasn't available but was latter defined if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout; return setTimeout(fun, 0); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedSetTimeout(fun, 0); } catch (e) { try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedSetTimeout.call(null, fun, 0); } catch (e) { // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { //normal enviroments in sane situations return clearTimeout(marker); } // if clearTimeout wasn't available but was latter defined if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout; return clearTimeout(marker); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedClearTimeout(marker); } catch (e) { try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedClearTimeout.call(null, marker); } catch (e) { // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. // Some versions of I.E. have different rules for clearTimeout vs setTimeout return cachedClearTimeout.call(this, marker); } } } var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; while (len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; runClearTimeout(timeout); } process.nextTick = function (fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { runTimeout(drainQueue); } }; // v8 likes predictible objects function Item(fun, array) { this.fun = fun; this.array = array; } Item.prototype.run = function () { this.fun.apply(null, this.array); }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues process.versions = {}; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.prependListener = noop; process.prependOnceListener = noop; process.listeners = function (name) { return []; }; process.binding = function (name) { throw new Error('process.binding is not supported'); }; process.cwd = function () { return '/'; }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; process.umask = function () { return 0; }; }, {}], 3: [function (require, module, exports) { /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. */ function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = require('ms'); Object.keys(env).forEach(function (key) { createDebug[key] = env[key]; }); /** * Active `debug` instances. */ createDebug.instances = []; /** * The currently active debug mode names, and names to skip. */ createDebug.names = []; createDebug.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ createDebug.formatters = {}; /** * Selects a color for a debug namespace * @param {String} namespace The namespace string for the for the debug instance to be colored * @return {Number|String} An ANSI color code for the given namespace * @api private */ function selectColor(namespace) { var hash = 0; for (var i = 0; i < namespace.length; i++) { hash = (hash << 5) - hash + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { var prevTime; function debug() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } // Disabled? if (!debug.enabled) { return; } var self = debug; // Set `diff` timestamp var curr = Number(new Date()); var ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== 'string') { // Anything else let's inspect with %O args.unshift('%O'); } // Apply any `formatters` transformations var index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) { // If we encounter an escaped % then don't increase the array index if (match === '%%') { return match; } index++; var formatter = createDebug.formatters[format]; if (typeof formatter === 'function') { var val = args[index]; match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // Apply env-specific formatting (colors, etc.) createDebug.formatArgs.call(self, args); var logFn = self.log || createDebug.log; logFn.apply(self, args); } debug.namespace = namespace; debug.enabled = createDebug.enabled(namespace); debug.useColors = createDebug.useColors(); debug.color = selectColor(namespace); debug.destroy = destroy; debug.extend = extend; // Debug.formatArgs = formatArgs; // debug.rawLog = rawLog; // env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } createDebug.instances.push(debug); return debug; } function destroy() { var index = createDebug.instances.indexOf(this); if (index !== -1) { createDebug.instances.splice(index, 1); return true; } return false; } function extend(namespace, delimiter) { var newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); newDebug.log = this.log; return newDebug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { createDebug.save(namespaces); createDebug.names = []; createDebug.skips = []; var i; var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); var len = split.length; for (i = 0; i < len; i++) { if (!split[i]) { // ignore empty strings continue; } namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else { createDebug.names.push(new RegExp('^' + namespaces + '$')); } } for (i = 0; i < createDebug.instances.length; i++) { var instance = createDebug.instances[i]; instance.enabled = createDebug.enabled(instance.namespace); } } /** * Disable debug output. * * @return {String} namespaces * @api public */ function disable() { var namespaces = [].concat(_toConsumableArray(createDebug.names.map(toNamespace)), _toConsumableArray(createDebug.skips.map(toNamespace).map(function (namespace) { return '-' + namespace; }))).join(','); createDebug.enable(''); return namespaces; } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { if (name[name.length - 1] === '*') { return true; } var i; var len; for (i = 0, len = createDebug.skips.length; i < len; i++) { if (createDebug.skips[i].test(name)) { return false; } } for (i = 0, len = createDebug.names.length; i < len; i++) { if (createDebug.names[i].test(name)) { return true; } } return false; } /** * Convert regexp to namespace * * @param {RegExp} regxep * @return {String} namespace * @api private */ function toNamespace(regexp) { return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, '*'); } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } createDebug.enable(createDebug.load()); return createDebug; } module.exports = setup; }, { "ms": 1 }], 4: [function (require, module, exports) { (function (process) { /* eslint-env browser */ /** * This is the web browser implementation of `debug()`. */ exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); /** * Colors. */ exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33']; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ // eslint-disable-next-line complexity function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { return true; } // Internet Explorer and Edge do not support colors. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); } /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); if (!this.useColors) { return; } var c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into var index = 0; var lastC = 0; args[0].replace(/%[a-zA-Z%]/g, function (match) { if (match === '%%') { return; } index++; if (match === '%c') { // We only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.log()` when available. * No-op when `console.log` is not a "function". * * @api public */ function log() { var _console; // This hackery is required for IE8/9, where // the `console.log` function doesn't have 'apply' return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (namespaces) { exports.storage.setItem('debug', namespaces); } else { exports.storage.removeItem('debug'); } } catch (error) {// Swallow // XXX (@Qix-) should we be logging these? } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { var r; try { r = exports.storage.getItem('debug'); } catch (error) {} // Swallow // XXX (@Qix-) should we be logging these? // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context // The Browser also has localStorage in the global context. return localStorage; } catch (error) {// Swallow // XXX (@Qix-) should we be logging these? } } module.exports = require('./common')(exports); var formatters = module.exports.formatters; /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ formatters.j = function (v) { try { return JSON.stringify(v); } catch (error) { return '[UnexpectedJSONParseError]: ' + error.message; } }; }).call(this, require('_process')); }, { "./common": 3, "_process": 2 }] }, {}, [4])(4); }); /* eslint-env browser */ /** * This is the web browser implementation of `debug()`. */ exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); /** * Colors. */ exports.colors = [ '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33' ]; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ // eslint-disable-next-line complexity function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { return true; } // Internet Explorer and Edge do not support colors. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || // Is firebug? http://stackoverflow.com/a/398120/376773 (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || // Double check webkit in userAgent just in case we are in a worker (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); } /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); if (!this.useColors) { return; } const c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into let index = 0; let lastC = 0; args[0].replace(/%[a-zA-Z%]/g, match => { if (match === '%%') { return; } index++; if (match === '%c') { // We only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.log()` when available. * No-op when `console.log` is not a "function". * * @api public */ function log(...args) { // This hackery is required for IE8/9, where // the `console.log` function doesn't have 'apply' return typeof console === 'object' && console.log && console.log(...args); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (namespaces) { exports.storage.setItem('debug', namespaces); } else { exports.storage.removeItem('debug'); } } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { let r; try { r = exports.storage.getItem('debug'); } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context // The Browser also has localStorage in the global context. return localStorage; } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } module.exports = require('./common')(exports); const {formatters} = module.exports; /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ formatters.j = function (v) { try { return JSON.stringify(v); } catch (error) { return '[UnexpectedJSONParseError]: ' + error.message; } }; /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. */ function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = require('ms'); Object.keys(env).forEach(key => { createDebug[key] = env[key]; }); /** * Active `debug` instances. */ createDebug.instances = []; /** * The currently active debug mode names, and names to skip. */ createDebug.names = []; createDebug.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ createDebug.formatters = {}; /** * Selects a color for a debug namespace * @param {String} namespace The namespace string for the for the debug instance to be colored * @return {Number|String} An ANSI color code for the given namespace * @api private */ function selectColor(namespace) { let hash = 0; for (let i = 0; i < namespace.length; i++) { hash = ((hash << 5) - hash) + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { let prevTime; function debug(...args) { // Disabled? if (!debug.enabled) { return; } const self = debug; // Set `diff` timestamp const curr = Number(new Date()); const ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== 'string') { // Anything else let's inspect with %O args.unshift('%O'); } // Apply any `formatters` transformations let index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { // If we encounter an escaped % then don't increase the array index if (match === '%%') { return match; } index++; const formatter = createDebug.formatters[format]; if (typeof formatter === 'function') { const val = args[index]; match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // Apply env-specific formatting (colors, etc.) createDebug.formatArgs.call(self, args); const logFn = self.log || createDebug.log; logFn.apply(self, args); } debug.namespace = namespace; debug.enabled = createDebug.enabled(namespace); debug.useColors = createDebug.useColors(); debug.color = selectColor(namespace); debug.destroy = destroy; debug.extend = extend; // Debug.formatArgs = formatArgs; // debug.rawLog = rawLog; // env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } createDebug.instances.push(debug); return debug; } function destroy() { const index = createDebug.instances.indexOf(this); if (index !== -1) { createDebug.instances.splice(index, 1); return true; } return false; } function extend(namespace, delimiter) { const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); newDebug.log = this.log; return newDebug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { createDebug.save(namespaces); createDebug.names = []; createDebug.skips = []; let i; const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); const len = split.length; for (i = 0; i < len; i++) { if (!split[i]) { // ignore empty strings continue; } namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else { createDebug.names.push(new RegExp('^' + namespaces + '$')); } } for (i = 0; i < createDebug.instances.length; i++) { const instance = createDebug.instances[i]; instance.enabled = createDebug.enabled(instance.namespace); } } /** * Disable debug output. * * @return {String} namespaces * @api public */ function disable() { const namespaces = [ ...createDebug.names.map(toNamespace), ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) ].join(','); createDebug.enable(''); return namespaces; } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { if (name[name.length - 1] === '*') { return true; } let i; let len; for (i = 0, len = createDebug.skips.length; i < len; i++) { if (createDebug.skips[i].test(name)) { return false; } } for (i = 0, len = createDebug.names.length; i < len; i++) { if (createDebug.names[i].test(name)) { return true; } } return false; } /** * Convert regexp to namespace * * @param {RegExp} regxep * @return {String} namespace * @api private */ function toNamespace(regexp) { return regexp.toString() .substring(2, regexp.toString().length - 2) .replace(/\.\*\?$/, '*'); } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } createDebug.enable(createDebug.load()); return createDebug; } module.exports = setup; /** * Detect Electron renderer / nwjs process, which is node, but we should * treat as a browser. */ if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { module.exports = require('./browser.js'); } else { module.exports = require('./node.js'); } /** * Module dependencies. */ const tty = require('tty'); const util = require('util'); /** * This is the Node.js implementation of `debug()`. */ exports.init = init; exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; /** * Colors. */ exports.colors = [6, 2, 3, 4, 5, 1]; try { // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) // eslint-disable-next-line import/no-extraneous-dependencies const supportsColor = require('supports-color'); if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { exports.colors = [ 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221 ]; } } catch (error) { // Swallow - we only care if `supports-color` is available; it doesn't have to be. } /** * Build up the default `inspectOpts` object from the environment variables. * * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js */ exports.inspectOpts = Object.keys(process.env).filter(key => { return /^debug_/i.test(key); }).reduce((obj, key) => { // Camel-case const prop = key .substring(6) .toLowerCase() .replace(/_([a-z])/g, (_, k) => { return k.toUpperCase(); }); // Coerce string value into JS value let val = process.env[key]; if (/^(yes|on|true|enabled)$/i.test(val)) { val = true; } else if (/^(no|off|false|disabled)$/i.test(val)) { val = false; } else if (val === 'null') { val = null; } else { val = Number(val); } obj[prop] = val; return obj; }, {}); /** * Is stdout a TTY? Colored output is enabled when `true`. */ function useColors() { return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd); } /** * Adds ANSI color escape codes if enabled. * * @api public */ function formatArgs(args) { const {namespace: name, useColors} = this; if (useColors) { const c = this.color; const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); const prefix = ` ${colorCode};1m${name} \u001B[0m`; args[0] = prefix + args[0].split('\n').join('\n' + prefix); args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); } else { args[0] = getDate() + name + ' ' + args[0]; } } function getDate() { if (exports.inspectOpts.hideDate) { return ''; } return new Date().toISOString() + ' '; } /** * Invokes `util.format()` with the specified arguments and writes to stderr. */ function log(...args) { return process.stderr.write(util.format(...args) + '\n'); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { if (namespaces) { process.env.DEBUG = namespaces; } else { // If you set a process.env field to null or undefined, it gets cast to the // string 'null' or 'undefined'. Just delete instead. delete process.env.DEBUG; } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { return process.env.DEBUG; } /** * Init logic for `debug` instances. * * Create a new `inspectOpts` object in case `useColors` is set * differently for a particular `debug` instance. */ function init(debug) { debug.inspectOpts = {}; const keys = Object.keys(exports.inspectOpts); for (let i = 0; i < keys.length; i++) { debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; } } module.exports = require('./common')(exports); const {formatters} = module.exports; /** * Map %o to `util.inspect()`, all on a single line. */ formatters.o = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts) .replace(/\s*\n\s*/g, ' '); }; /** * Map %O to `util.inspect()`, allowing multiple lines if needed. */ formatters.O = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts); }; "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const net_1 = __importDefault(require("net")); const tls_1 = __importDefault(require("tls")); const url_1 = __importDefault(require("url")); const assert_1 = __importDefault(require("assert")); const debug_1 = __importDefault(require("debug")); const agent_base_1 = require("agent-base"); const parse_proxy_response_1 = __importDefault(require("./parse-proxy-response")); const debug = debug_1.default('https-proxy-agent:agent'); /** * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to * the specified "HTTP(s) proxy server" in order to proxy HTTPS requests. * * Outgoing HTTP requests are first tunneled through the proxy server using the * `CONNECT` HTTP request method to establish a connection to the proxy server, * and then the proxy server connects to the destination target and issues the * HTTP request from the proxy server. * * `https:` requests have their socket connection upgraded to TLS once * the connection to the proxy server has been established. * * @api public */ class HttpsProxyAgent extends agent_base_1.Agent { constructor(_opts) { let opts; if (typeof _opts === 'string') { opts = url_1.default.parse(_opts); } else { opts = _opts; } if (!opts) { throw new Error('an HTTP(S) proxy server `host` and `port` must be specified!'); } debug('creating new HttpsProxyAgent instance: %o', opts); super(opts); const proxy = Object.assign({}, opts); // If `true`, then connect to the proxy server over TLS. // Defaults to `false`. this.secureProxy = opts.secureProxy || isHTTPS(proxy.protocol); // Prefer `hostname` over `host`, and set the `port` if needed. proxy.host = proxy.hostname || proxy.host; if (typeof proxy.port === 'string') { proxy.port = parseInt(proxy.port, 10); } if (!proxy.port && proxy.host) { proxy.port = this.secureProxy ? 443 : 80; } // ALPN is supported by Node.js >= v5. // attempt to negotiate http/1.1 for proxy servers that support http/2 if (this.secureProxy && !('ALPNProtocols' in proxy)) { proxy.ALPNProtocols = ['http 1.1']; } if (proxy.host && proxy.path) { // If both a `host` and `path` are specified then it's most likely // the result of a `url.parse()` call... we need to remove the // `path` portion so that `net.connect()` doesn't attempt to open // that as a Unix socket file. delete proxy.path; delete proxy.pathname; } this.proxy = proxy; } /** * Called when the node-core HTTP client library is creating a * new HTTP request. * * @api protected */ callback(req, opts) { return __awaiter(this, void 0, void 0, function* () { const { proxy, secureProxy } = this; // Create a socket connection to the proxy server. let socket; if (secureProxy) { debug('Creating `tls.Socket`: %o', proxy); socket = tls_1.default.connect(proxy); } else { debug('Creating `net.Socket`: %o', proxy); socket = net_1.default.connect(proxy); } const headers = Object.assign({}, proxy.headers); const hostname = `${opts.host}:${opts.port}`; let payload = `CONNECT ${hostname} HTTP/1.1\r\n`; // Inject the `Proxy-Authorization` header if necessary. if (proxy.auth) { headers['Proxy-Authorization'] = `Basic ${Buffer.from(proxy.auth).toString('base64')}`; } // The `Host` header should only include the port // number when it is not the default port. let { host, port, secureEndpoint } = opts; if (!isDefaultPort(port, secureEndpoint)) { host += `:${port}`; } headers.Host = host; headers.Connection = 'close'; for (const name of Object.keys(headers)) { payload += `${name}: ${headers[name]}\r\n`; } const proxyResponsePromise = parse_proxy_response_1.default(socket); socket.write(`${payload}\r\n`); const { statusCode, buffered } = yield proxyResponsePromise; if (statusCode === 200) { req.once('socket', resume); if (opts.secureEndpoint) { const servername = opts.servername || opts.host; if (!servername) { throw new Error('Could not determine "servername"'); } // The proxy is connecting to a TLS server, so upgrade // this socket connection to a TLS connection. debug('Upgrading socket connection to TLS'); return tls_1.default.connect(Object.assign(Object.assign({}, omit(opts, 'host', 'hostname', 'path', 'port')), { socket, servername })); } return socket; } // Some other status code that's not 200... need to re-play the HTTP // header "data" events onto the socket once the HTTP machinery is // attached so that the node core `http` can parse and handle the // error status code. // Close the original socket, and a new "fake" socket is returned // instead, so that the proxy doesn't get the HTTP request // written to it (which may contain `Authorization` headers or other // sensitive data). // // See: https://hackerone.com/reports/541502 socket.destroy(); const fakeSocket = new net_1.default.Socket(); fakeSocket.readable = true; // Need to wait for the "socket" event to re-play the "data" events. req.once('socket', (s) => { debug('replaying proxy buffer for failed request'); assert_1.default(s.listenerCount('data') > 0); // Replay the "buffered" Buffer onto the fake `socket`, since at // this point the HTTP module machinery has been hooked up for // the user. s.push(buffered); s.push(null); }); return fakeSocket; }); } } exports.default = HttpsProxyAgent; function resume(socket) { socket.resume(); } function isDefaultPort(port, secure) { return Boolean((!secure && port === 80) || (secure && port === 443)); } function isHTTPS(protocol) { return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false; } function omit(obj, ...keys) { const ret = {}; let key; for (key in obj) { if (!keys.includes(key)) { ret[key] = obj[key]; } } return ret; }//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@vscode/ripgrep/node_modules/https-proxy-agent/dist/agent.js.map"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; const agent_1 = __importDefault(require("./agent")); function createHttpsProxyAgent(opts) { return new agent_1.default(opts); } (function (createHttpsProxyAgent) { createHttpsProxyAgent.HttpsProxyAgent = agent_1.default; createHttpsProxyAgent.prototype = agent_1.default.prototype; })(createHttpsProxyAgent || (createHttpsProxyAgent = {})); module.exports = createHttpsProxyAgent;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@vscode/ripgrep/node_modules/https-proxy-agent/dist/index.js.map"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const debug_1 = __importDefault(require("debug")); const debug = debug_1.default('https-proxy-agent:parse-proxy-response'); function parseProxyResponse(socket) { return new Promise((resolve, reject) => { // we need to buffer any HTTP traffic that happens with the proxy before we get // the CONNECT response, so that if the response is anything other than an "200" // response code, then we can re-play the "data" events on the socket once the // HTTP parser is hooked up... let buffersLength = 0; const buffers = []; function read() { const b = socket.read(); if (b) ondata(b); else socket.once('readable', read); } function cleanup() { socket.removeListener('end', onend); socket.removeListener('error', onerror); socket.removeListener('close', onclose); socket.removeListener('readable', read); } function onclose(err) { debug('onclose had error %o', err); } function onend() { debug('onend'); } function onerror(err) { cleanup(); debug('onerror %o', err); reject(err); } function ondata(b) { buffers.push(b); buffersLength += b.length; const buffered = Buffer.concat(buffers, buffersLength); const endOfHeaders = buffered.indexOf('\r\n\r\n'); if (endOfHeaders === -1) { // keep buffering debug('have not received end of HTTP headers yet...'); read(); return; } const firstLine = buffered.toString('ascii', 0, buffered.indexOf('\r\n')); const statusCode = +firstLine.split(' ')[1]; debug('got proxy server response: %o', firstLine); resolve({ statusCode, buffered }); } socket.on('error', onerror); socket.on('close', onclose); socket.on('end', onend); read(); }); } exports.default = parseProxyResponse;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@vscode/ripgrep/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map#!/bin/echo docker build . -f # -*- coding: utf-8 -*- #{ # ISC License # Copyright (c) 2004-2010 by Internet Systems Consortium, Inc. ("ISC") # Copyright (c) 1995-2003 by Internet Software Consortium # Permission to use, copy, modify, and /or distribute this software # for any purpose with or without fee is hereby granted, # provided that the above copyright notice # and this permission notice appear in all copies. # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS. # IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, # OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, # WHETHER IN AN ACTION OF CONTRACT, # NEGLIGENCE OR OTHER TORTIOUS ACTION, # ARISING OUT OF OR IN CONNECTION WITH THE USE # OR PERFORMANCE OF THIS SOFTWARE. #} FROM ubuntu:latest MAINTAINER Philippe Coval (p.coval@samsung.com) ENV DEBIAN_FRONTEND noninteractive ENV LC_ALL en_US.UTF-8 ENV LANG ${LC_ALL} RUN echo "#log: Configuring locales" \ && set -x \ && apt-get update -y \ && apt-get install -y locales \ && echo "${LC_ALL} UTF-8" | tee /etc/locale.gen \ && locale-gen ${LC_ALL} \ && dpkg-reconfigure locales \ && sync ENV project node-sqlite3 RUN echo "#log: ${project}: Setup system" \ && set -x \ && apt-get update -y \ && apt-get install -y \ curl \ sudo \ build-essential \ python \ && apt-get clean \ && NVM_VERSION="v0.33.8" \ && NODE_VERSION="--lts=carbon" \ && curl -o- https://raw.githubusercontent.com/creationix/nvm/${NVM_VERSION}/install.sh | bash \ && which nvm || . ~/.bashrc \ && nvm install ${NODE_VERSION} \ && nvm use ${NODE_VERSION} \ && sync ADD . /usr/local/${project}/${project} WORKDIR /usr/local/${project}/${project} RUN echo "#log: ${project}: Preparing sources" \ && set -x \ && which npm || . ~/.bashrc \ && npm install || cat npm-debug.log \ && npm install \ && npm install --unsafe-perm --build-from-source \ && sync WORKDIR /usr/local/${project}/${project} RUN echo "#log: ${project}: Building sources" \ && set -x \ && which npm || . ~/.bashrc \ && npm run pack \ && npm pack \ && find build/stage/ -type f \ && sync WORKDIR /usr/local/${project}/${project} RUN echo "#log: ${project}: Installing sources" \ && set -x \ && install -d /usr/local/src/${project}/deploy/ \ && install *.tgz /usr/local/src/${project}/deploy/ \ && cp -rfva ./build/stage/ /usr/local/src/${project}/deploy/ \ && find /usr/local/src/${project}/deploy/ -type f \ && sync Copyright (c) MapBox All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name "MapBox" nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.{ "name": "@vscode/sqlite3", "description": "Asynchronous, non-blocking SQLite3 bindings", "version": "5.0.8", "homepage": "https://github.com/mapbox/node-sqlite3", "author": { "name": "MapBox", "url": "https://mapbox.com/" }, "binary": { "module_name": "node_sqlite3", "module_path": "./lib/binding/napi-v{napi_build_version}-{platform}-{arch}", "host": "https://mapbox-node-binary.s3.amazonaws.com", "remote_path": "./{name}/v{version}/{toolset}/", "package_name": "napi-v{napi_build_version}-{platform}-{arch}.tar.gz", "napi_versions": [ 3 ] }, "contributors": [ "Konstantin Käfer ", "Dane Springmeyer ", "Will White ", "Orlando Vazquez ", "Artem Kustikov ", "Eric Fredricksen ", "John Wright ", "Ryan Dahl ", "Tom MacWright ", "Carter Thaxton ", "Audrius Kažukauskas ", "Johannes Schauer ", "Nathan Rajlich ", "AJ ONeal ", "Mithgol", "Ben Noordhuis " ], "repository": { "type": "git", "url": "git://github.com/mapbox/node-sqlite3.git" }, "dependencies": { "node-addon-api": "^4.2.0" }, "devDependencies": { "@mapbox/cloudfriend": "^1.9.0", "aws-sdk": "2.x", "electron": "17.1.2", "eslint": "^7.32.0", "mocha": "^5.2.0" }, "scripts": { "pretest": "node test/support/createdb.js", "test": "mocha -R spec --timeout 480000", "pack": "node-pre-gyp package" }, "license": "BSD-3-Clause", "keywords": [ "sql", "sqlite", "sqlite3", "database" ], "main": "./lib/sqlite3", "types": "index.d.ts" } ## Security Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below. ## Reporting Security Issues **Please do not report security vulnerabilities through public GitHub issues.** Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) * Full paths of source file(s) related to the manifestation of the issue * The location of the affected source code (tag/branch/commit or direct URL) * Any special configuration required to reproduce the issue * Step-by-step instructions to reproduce the issue * Proof-of-concept or exploit code (if possible) * Impact of the issue, including how an attacker might exploit the issue This information will help us triage your report more quickly. If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. ## Preferred Languages We prefer all communications to be in English. ## Policy Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). module.exports = require('./lib/sqlite3'); module.exports = require('./sqlite3'); /*var binary = require('@mapbox/node-pre-gyp'); var path = require('path'); var binding_path = binary.find(path.resolve(path.join(__dirname,'../package.json')));*/ var binding = require('../build/Release/vscode-sqlite3.node'); module.exports = exports = binding; var path = require('path'); var sqlite3 = require('./sqlite3-binding.js'); var EventEmitter = require('events').EventEmitter; module.exports = exports = sqlite3; function normalizeMethod (fn) { return function (sql) { var errBack; var args = Array.prototype.slice.call(arguments, 1); if (typeof args[args.length - 1] === 'function') { var callback = args[args.length - 1]; errBack = function(err) { if (err) { callback(err); } }; } var statement = new Statement(this, sql, errBack); return fn.call(this, statement, args); }; } function inherits(target, source) { for (var k in source.prototype) target.prototype[k] = source.prototype[k]; } sqlite3.cached = { Database: function(file, a, b) { if (file === '' || file === ':memory:') { // Don't cache special databases. return new Database(file, a, b); } var db; file = path.resolve(file); function cb() { callback.call(db, null); } if (!sqlite3.cached.objects[file]) { db = sqlite3.cached.objects[file] = new Database(file, a, b); } else { // Make sure the callback is called. db = sqlite3.cached.objects[file]; var callback = (typeof a === 'number') ? b : a; if (typeof callback === 'function') { if (db.open) process.nextTick(cb); else db.once('open', cb); } } return db; }, objects: {} }; var Database = sqlite3.Database; var Statement = sqlite3.Statement; var Backup = sqlite3.Backup; inherits(Database, EventEmitter); inherits(Statement, EventEmitter); inherits(Backup, EventEmitter); // Database#prepare(sql, [bind1, bind2, ...], [callback]) Database.prototype.prepare = normalizeMethod(function(statement, params) { return params.length ? statement.bind.apply(statement, params) : statement; }); // Database#run(sql, [bind1, bind2, ...], [callback]) Database.prototype.run = normalizeMethod(function(statement, params) { statement.run.apply(statement, params).finalize(); return this; }); // Database#get(sql, [bind1, bind2, ...], [callback]) Database.prototype.get = normalizeMethod(function(statement, params) { statement.get.apply(statement, params).finalize(); return this; }); // Database#all(sql, [bind1, bind2, ...], [callback]) Database.prototype.all = normalizeMethod(function(statement, params) { statement.all.apply(statement, params).finalize(); return this; }); // Database#each(sql, [bind1, bind2, ...], [callback], [complete]) Database.prototype.each = normalizeMethod(function(statement, params) { statement.each.apply(statement, params).finalize(); return this; }); Database.prototype.map = normalizeMethod(function(statement, params) { statement.map.apply(statement, params).finalize(); return this; }); // Database#backup(filename, [callback]) // Database#backup(filename, destName, sourceName, filenameIsDest, [callback]) Database.prototype.backup = function() { var backup; if (arguments.length <= 2) { // By default, we write the main database out to the main database of the named file. // This is the most likely use of the backup api. backup = new Backup(this, arguments[0], 'main', 'main', true, arguments[1]); } else { // Otherwise, give the user full control over the sqlite3_backup_init arguments. backup = new Backup(this, arguments[0], arguments[1], arguments[2], arguments[3], arguments[4]); } // Per the sqlite docs, exclude the following errors as non-fatal by default. backup.retryErrors = [sqlite3.BUSY, sqlite3.LOCKED]; return backup; }; Statement.prototype.map = function() { var params = Array.prototype.slice.call(arguments); var callback = params.pop(); params.push(function(err, rows) { if (err) return callback(err); var result = {}; if (rows.length) { var keys = Object.keys(rows[0]), key = keys[0]; if (keys.length > 2) { // Value is an object for (var i = 0; i < rows.length; i++) { result[rows[i][key]] = rows[i]; } } else { var value = keys[1]; // Value is a plain value for (i = 0; i < rows.length; i++) { result[rows[i][key]] = rows[i][value]; } } } callback(err, result); }); return this.all.apply(this, params); }; var isVerbose = false; var supportedEvents = [ 'trace', 'profile', 'insert', 'update', 'delete' ]; Database.prototype.addListener = Database.prototype.on = function(type) { var val = EventEmitter.prototype.addListener.apply(this, arguments); if (supportedEvents.indexOf(type) >= 0) { this.configure(type, true); } return val; }; Database.prototype.removeListener = function(type) { var val = EventEmitter.prototype.removeListener.apply(this, arguments); if (supportedEvents.indexOf(type) >= 0 && !this._events[type]) { this.configure(type, false); } return val; }; Database.prototype.removeAllListeners = function(type) { var val = EventEmitter.prototype.removeAllListeners.apply(this, arguments); if (supportedEvents.indexOf(type) >= 0) { this.configure(type, false); } return val; }; // Save the stack trace over EIO callbacks. sqlite3.verbose = function() { if (!isVerbose) { var trace = require('./trace'); [ 'prepare', 'get', 'run', 'all', 'each', 'map', 'close', 'exec' ].forEach(function (name) { trace.extendTrace(Database.prototype, name); }); [ 'bind', 'get', 'run', 'all', 'each', 'map', 'reset', 'finalize', ].forEach(function (name) { trace.extendTrace(Statement.prototype, name); }); isVerbose = true; } return this; }; // Inspired by https://github.com/tlrobinson/long-stack-traces var util = require('util'); function extendTrace(object, property, pos) { var old = object[property]; object[property] = function() { var error = new Error(); var name = object.constructor.name + '#' + property + '(' + Array.prototype.slice.call(arguments).map(function(el) { return util.inspect(el, false, 0); }).join(', ') + ')'; if (typeof pos === 'undefined') pos = -1; if (pos < 0) pos += arguments.length; var cb = arguments[pos]; if (typeof arguments[pos] === 'function') { arguments[pos] = function replacement() { var err = arguments[0]; if (err && err.stack && !err.__augmented) { err.stack = filter(err).join('\n'); err.stack += '\n--> in ' + name; err.stack += '\n' + filter(error).slice(1).join('\n'); err.__augmented = true; } return cb.apply(this, arguments); }; } return old.apply(this, arguments); }; } exports.extendTrace = extendTrace; function filter(error) { return error.stack.split('\n').filter(function(line) { return line.indexOf(__filename) < 0; }); } #!/bin/echo docker build . -f # -*- coding: utf-8 -*- # SPDX-License-Identifier: ISC # Copyright 2019-present Samsung Electronics Co., Ltd. and other contributors #{ # ISC License # Copyright (c) 2004-2010 by Internet Systems Consortium, Inc. ("ISC") # Copyright (c) 1995-2003 by Internet Software Consortium # Permission to use, copy, modify, and /or distribute this software # for any purpose with or without fee is hereby granted, # provided that the above copyright notice # and this permission notice appear in all copies. # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS. # IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, # OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, # WHETHER IN AN ACTION OF CONTRACT, # NEGLIGENCE OR OTHER TORTIOUS ACTION, # ARISING OUT OF OR IN CONNECTION WITH THE USE # OR PERFORMANCE OF THIS SOFTWARE. #} FROM resin/rpi-raspbian:stretch MAINTAINER Philippe Coval (p.coval@samsung.com) RUN [ "cross-build-start" ] ENV DEBIAN_FRONTEND noninteractive ENV LC_ALL en_US.UTF-8 ENV LANG ${LC_ALL} RUN echo "#log: Configuring locales" \ && set -x \ && apt-get update -y \ && apt-get install -y locales \ && echo "${LC_ALL} UTF-8" | tee /etc/locale.gen \ && locale-gen ${LC_ALL} \ && dpkg-reconfigure locales \ && sync ENV project node-sqlite3 RUN echo "#log: ${project}: Setup system" \ && set -x \ && apt-get update -y \ && apt-get install -y \ curl \ sudo \ build-essential \ python \ && apt-get clean \ && NVM_VERSION="v0.33.8" \ && NODE_VERSION="--lts=carbon" \ && curl -o- https://raw.githubusercontent.com/creationix/nvm/${NVM_VERSION}/install.sh | bash \ && which nvm || . ~/.bashrc \ && nvm install ${NODE_VERSION} \ && nvm use ${NODE_VERSION} \ && sync ADD . /usr/local/opt/${project}/src/${project} WORKDIR /usr/local/opt/${project}/src/${project} RUN echo "#log: ${project}: Preparing sources" \ && set -x \ && which npm || . ~/.bashrc \ && npm install || cat npm-debug.log \ && npm install \ && npm install --unsafe-perm --build-from-source \ && sync WORKDIR /usr/local/opt/${project}/src/${project} RUN echo "#log: ${project}: Building sources" \ && set -x \ && which npm || . ~/.bashrc \ && npm run pack \ && npm pack \ && find ${PWD}/build/stage/ -type f \ && sync RUN [ "cross-build-end" ] #!/bin/sh # -*- coding: utf-8 -*- # SPDX-License-Identifier: ISC # Copyright 2019-present Samsung Electronics Co., Ltd. and other contributors #{ # ISC License # Copyright (c) 2004-2010 by Internet Systems Consortium, Inc. ("ISC") # Copyright (c) 1995-2003 by Internet Software Consortium # Permission to use, copy, modify, and /or distribute this software # for any purpose with or without fee is hereby granted, # provided that the above copyright notice # and this permission notice appear in all copies. # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS. # IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, # OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, # WHETHER IN AN ACTION OF CONTRACT, # NEGLIGENCE OR OTHER TORTIOUS ACTION, # ARISING OUT OF OR IN CONNECTION WITH THE USE # OR PERFORMANCE OF THIS SOFTWARE. #} set -e set -x this_dir=$(dirname -- "$0") this_dir=$(realpath "${this_dir}") this_name=$(basename -- "$0") top_dir="${this_dir}/../../.." module_name="sqlite3" project="node-${module_name}" arch="arm" architecture=$(basename "${this_dir}") name="${project}-${architecture}" dir="/usr/local/opt/${project}/" dist_dir="${dir}/src/${project}/build" tag=$(git describe --tags || echo v0.0.0) version=$(echo "${tag}" | cut -dv -f2 | cut -d'-' -f1) mkdir -p "${this_dir}/local" "${this_dir}/tmp" cp -a "/usr/bin/qemu-${arch}-static" "${this_dir}/local" time docker build -t "${name}" -f "${this_dir}/Dockerfile" . container=$(docker create "${name}") mkdir -p "${this_dir}/tmp/${dist_dir}" rm -rf "${this_dir}/tmp/${dist_dir}" docker cp "${container}:${dist_dir}" "${this_dir}/tmp/${dist_dir}" file=$(ls "${this_dir}/tmp/${dist_dir}/stage/${module_name}/"*/*".tar.gz" | head -n1 \ || echo "/tmp/${USER}/failure.tmp") sha256sum "${file}" #!/bin/echo docker build . -f # -*- coding: utf-8 -*- # SPDX-License-Identifier: ISC # Copyright 2019-present Samsung Electronics Co., Ltd. and other contributors #{ # ISC License # Copyright (c) 2004-2010 by Internet Systems Consortium, Inc. ("ISC") # Copyright (c) 1995-2003 by Internet Software Consortium # Permission to use, copy, modify, and /or distribute this software # for any purpose with or without fee is hereby granted, # provided that the above copyright notice # and this permission notice appear in all copies. # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS. # IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, # OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, # WHETHER IN AN ACTION OF CONTRACT, # NEGLIGENCE OR OTHER TORTIOUS ACTION, # ARISING OUT OF OR IN CONNECTION WITH THE USE # OR PERFORMANCE OF THIS SOFTWARE. #} FROM arm64v8/node:carbon ADD tools/docker/architecture/linux-arm64/local/qemu-aarch64-static /usr/bin/qemu-aarch64-static MAINTAINER Philippe Coval (p.coval@samsung.com) ENV DEBIAN_FRONTEND noninteractive ENV LC_ALL en_US.UTF-8 ENV LANG ${LC_ALL} RUN echo "#log: Configuring locales" \ && set -x \ && apt-get update -y \ && apt-get install -y locales \ && echo "${LC_ALL} UTF-8" | tee /etc/locale.gen \ && locale-gen ${LC_ALL} \ && dpkg-reconfigure locales \ && sync ENV project node-sqlite3 RUN echo "#log: ${project}: Setup system" \ && set -x \ && apt-get update -y \ && apt-get install -y \ curl \ sudo \ build-essential \ python \ && apt-get clean \ && NVM_VERSION="v0.33.8" \ && NODE_VERSION="--lts=carbon" \ && curl -o- https://raw.githubusercontent.com/creationix/nvm/${NVM_VERSION}/install.sh | bash \ && which nvm || . ~/.bashrc \ && nvm install ${NODE_VERSION} \ && nvm use ${NODE_VERSION} \ && sync ADD . /usr/local/opt/${project}/src/${project} WORKDIR /usr/local/opt/${project}/src/${project} RUN echo "#log: ${project}: Preparing sources" \ && set -x \ && which npm || . ~/.bashrc \ && npm install || cat npm-debug.log \ && npm install \ && npm install --unsafe-perm --build-from-source \ && sync WORKDIR /usr/local/opt/${project}/src/${project} RUN echo "#log: ${project}: Building sources" \ && set -x \ && which npm || . ~/.bashrc \ && npm run pack \ && npm pack \ && find ${PWD}/build/stage/ -type f \ && sync #!/bin/sh # -*- coding: utf-8 -*- # SPDX-License-Identifier: ISC # Copyright 2019-present Samsung Electronics Co., Ltd. and other contributors #{ # ISC License # Copyright (c) 2004-2010 by Internet Systems Consortium, Inc. ("ISC") # Copyright (c) 1995-2003 by Internet Software Consortium # Permission to use, copy, modify, and /or distribute this software # for any purpose with or without fee is hereby granted, # provided that the above copyright notice # and this permission notice appear in all copies. # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS. # IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, # OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, # WHETHER IN AN ACTION OF CONTRACT, # NEGLIGENCE OR OTHER TORTIOUS ACTION, # ARISING OUT OF OR IN CONNECTION WITH THE USE # OR PERFORMANCE OF THIS SOFTWARE. #} set -e set -x this_dir=$(dirname -- "$0") this_dir=$(realpath "${this_dir}") this_name=$(basename -- "$0") top_dir="${this_dir}/../../.." module_name="sqlite3" project="node-${module_name}" arch="aarch64" # AKA: arm64, arm64v8 architecture=$(basename "${this_dir}") name="${project}-${architecture}" dir="/usr/local/opt/${project}/" dist_dir="${dir}/src/${project}/build" tag=$(git describe --tags || echo v0.0.0) version=$(echo "${tag}" | cut -dv -f2 | cut -d'-' -f1) mkdir -p "${this_dir}/local" "${this_dir}/tmp" cp -a "/usr/bin/qemu-${arch}-static" "${this_dir}/local" time docker build -t "${name}" -f "${this_dir}/Dockerfile" . container=$(docker create "${name}") mkdir -p "${this_dir}/tmp/${dist_dir}" rm -rf "${this_dir}/tmp/${dist_dir}" docker cp "${container}:${dist_dir}" "${this_dir}/tmp/${dist_dir}" file=$(ls "${this_dir}/tmp/${dist_dir}/stage/${module_name}/"*/*".tar.gz" | head -n1 \ || echo "/tmp/${USER}/failure.tmp") sha256sum "${file}" var Node = { child: require('child_process'), crypto: require('crypto'), fs: require('fs'), os: require('os'), path: require('path'), process: process, util: require('util') }; function Attempt(instance, end) { var platform = Node.process.platform; if (platform === 'darwin') return Mac(instance, end); if (platform === 'linux') return Linux(instance, end); if (platform === 'win32') return Windows(instance, end); end(new Error('Platform not yet supported.')); } function EscapeDoubleQuotes(string) { if (typeof string !== 'string') throw new Error('Expected a string.'); return string.replace(/"/g, '\\"'); } function Exec() { if (arguments.length < 1 || arguments.length > 3) { throw new Error('Wrong number of arguments.'); } var command = arguments[0]; var options = {}; var end = function() {}; if (typeof command !== 'string') { throw new Error('Command should be a string.'); } if (arguments.length === 2) { if (Node.util.isObject(arguments[1])) { options = arguments[1]; } else if (Node.util.isFunction(arguments[1])) { end = arguments[1]; } else { throw new Error('Expected options or callback.'); } } else if (arguments.length === 3) { if (Node.util.isObject(arguments[1])) { options = arguments[1]; } else { throw new Error('Expected options to be an object.'); } if (Node.util.isFunction(arguments[2])) { end = arguments[2]; } else { throw new Error('Expected callback to be a function.'); } } if (/^sudo/i.test(command)) { return end(new Error('Command should not be prefixed with "sudo".')); } if (typeof options.name === 'undefined') { var title = Node.process.title; if (ValidName(title)) { options.name = title; } else { return end(new Error('process.title cannot be used as a valid name.')); } } else if (!ValidName(options.name)) { var error = ''; error += 'options.name must be alphanumeric only '; error += '(spaces are allowed) and <= 70 characters.'; return end(new Error(error)); } if (typeof options.icns !== 'undefined') { if (typeof options.icns !== 'string') { return end(new Error('options.icns must be a string if provided.')); } else if (options.icns.trim().length === 0) { return end(new Error('options.icns must not be empty if provided.')); } } if (typeof options.env !== 'undefined') { if (typeof options.env !== 'object') { return end(new Error('options.env must be an object if provided.')); } else if (Object.keys(options.env).length === 0) { return end(new Error('options.env must not be empty if provided.')); } else { for (var key in options.env) { var value = options.env[key]; if (typeof key !== 'string' || typeof value !== 'string') { return end( new Error('options.env environment variables must be strings.') ); } // "Environment variable names used by the utilities in the Shell and // Utilities volume of IEEE Std 1003.1-2001 consist solely of uppercase // letters, digits, and the '_' (underscore) from the characters defined // in Portable Character Set and do not begin with a digit. Other // characters may be permitted by an implementation; applications shall // tolerate the presence of such names." if (!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(key)) { return end( new Error( 'options.env has an invalid environment variable name: ' + JSON.stringify(key) ) ); } if (/[\r\n]/.test(value)) { return end( new Error( 'options.env has an invalid environment variable value: ' + JSON.stringify(value) ) ); } } } } var platform = Node.process.platform; if (platform !== 'darwin' && platform !== 'linux' && platform !== 'win32') { return end(new Error('Platform not yet supported.')); } var instance = { command: command, options: options, uuid: undefined, path: undefined }; Attempt(instance, end); } function Linux(instance, end) { LinuxBinary(instance, function(error, binary) { if (error) return end(error); var command = []; // Preserve current working directory: command.push('cd "' + EscapeDoubleQuotes(Node.process.cwd()) + '";'); // Export environment variables: for (var key in instance.options.env) { var value = instance.options.env[key]; command.push('export ' + key + '="' + EscapeDoubleQuotes(value) + '";'); } command.push('"' + EscapeDoubleQuotes(binary) + '"'); if (/kdesudo/i.test(binary)) { command.push( '--comment', '"' + instance.options.name + ' wants to make changes. ' + 'Enter your password to allow this."' ); command.push('-d'); // Do not show the command to be run in the dialog. command.push('--'); } else if (/pkexec/i.test(binary)) { command.push('--disable-internal-agent'); } var magic = 'SUDOPROMPT\n'; command.push( '/bin/bash -c "echo ' + EscapeDoubleQuotes(magic.trim()) + '; ' + EscapeDoubleQuotes(instance.command) + '"' ); command = command.join(' '); Node.child.exec(command, { encoding: 'utf-8', maxBuffer: MAX_BUFFER }, function(error, stdout, stderr) { // ISSUE 88: // We must distinguish between elevation errors and command errors. // // KDESUDO: // kdesudo provides no way to do this. We add a magic marker to know // if elevation succeeded. Any error thereafter is a command error. // // PKEXEC: // "Upon successful completion, the return value is the return value of // PROGRAM. If the calling process is not authorized or an // authorization could not be obtained through authentication or an // error occured, pkexec exits with a return value of 127. If the // authorization could not be obtained because the user dismissed the // authentication dialog, pkexec exits with a return value of 126." // // However, we do not rely on pkexec's return of 127 since our magic // marker is more reliable, and we already use it for kdesudo. var elevated = stdout && stdout.slice(0, magic.length) === magic; if (elevated) stdout = stdout.slice(magic.length); // Only normalize the error if it is definitely not a command error: // In other words, if we know that the command was never elevated. // We do not inspect error messages beyond NO_POLKIT_AGENT. // We cannot rely on English errors because of internationalization. if (error && !elevated) { if (/No authentication agent found/.test(stderr)) { error.message = NO_POLKIT_AGENT; } else { error.message = PERMISSION_DENIED; } } end(error, stdout, stderr); } ); } ); } function LinuxBinary(instance, end) { var index = 0; // We used to prefer gksudo over pkexec since it enabled a better prompt. // However, gksudo cannot run multiple commands concurrently. var paths = ['/usr/bin/kdesudo', '/usr/bin/pkexec']; function test() { if (index === paths.length) { return end(new Error('Unable to find pkexec or kdesudo.')); } var path = paths[index++]; Node.fs.stat(path, function(error) { if (error) { if (error.code === 'ENOTDIR') return test(); if (error.code === 'ENOENT') return test(); end(error); } else { end(undefined, path); } } ); } test(); } function Mac(instance, callback) { var temp = Node.os.tmpdir(); if (!temp) return callback(new Error('os.tmpdir() not defined.')); var user = Node.process.env.USER; // Applet shell scripts require $USER. if (!user) return callback(new Error('env[\'USER\'] not defined.')); UUID(instance, function(error, uuid) { if (error) return callback(error); instance.uuid = uuid; instance.path = Node.path.join( temp, instance.uuid, instance.options.name + '.app' ); function end(error, stdout, stderr) { Remove(Node.path.dirname(instance.path), function(errorRemove) { if (error) return callback(error); if (errorRemove) return callback(errorRemove); callback(undefined, stdout, stderr); } ); } MacApplet(instance, function(error, stdout, stderr) { if (error) return end(error, stdout, stderr); MacIcon(instance, function(error) { if (error) return end(error); MacPropertyList(instance, function(error, stdout, stderr) { if (error) return end(error, stdout, stderr); MacCommand(instance, function(error) { if (error) return end(error); MacOpen(instance, function(error, stdout, stderr) { if (error) return end(error, stdout, stderr); MacResult(instance, end); } ); } ); } ); } ); } ); } ); } function MacApplet(instance, end) { var parent = Node.path.dirname(instance.path); Node.fs.mkdir(parent, function(error) { if (error) return end(error); var zip = Node.path.join(parent, 'sudo-prompt-applet.zip'); Node.fs.writeFile(zip, APPLET, 'base64', function(error) { if (error) return end(error); var command = []; command.push('/usr/bin/unzip'); command.push('-o'); // Overwrite any existing applet. command.push('"' + EscapeDoubleQuotes(zip) + '"'); command.push('-d "' + EscapeDoubleQuotes(instance.path) + '"'); command = command.join(' '); Node.child.exec(command, { encoding: 'utf-8' }, end); } ); } ); } function MacCommand(instance, end) { var path = Node.path.join( instance.path, 'Contents', 'MacOS', 'sudo-prompt-command' ); var script = []; // Preserve current working directory: // We do this for commands that rely on relative paths. // This runs in a subshell and will not change the cwd of sudo-prompt-script. script.push('cd "' + EscapeDoubleQuotes(Node.process.cwd()) + '"'); // Export environment variables: for (var key in instance.options.env) { var value = instance.options.env[key]; script.push('export ' + key + '="' + EscapeDoubleQuotes(value) + '"'); } script.push(instance.command); script = script.join('\n'); Node.fs.writeFile(path, script, 'utf-8', end); } function MacIcon(instance, end) { if (!instance.options.icns) return end(); Node.fs.readFile(instance.options.icns, function(error, buffer) { if (error) return end(error); var icns = Node.path.join( instance.path, 'Contents', 'Resources', 'applet.icns' ); Node.fs.writeFile(icns, buffer, end); } ); } function MacOpen(instance, end) { // We must run the binary directly so that the cwd will apply. var binary = Node.path.join(instance.path, 'Contents', 'MacOS', 'applet'); // We must set the cwd so that the AppleScript can find the shell scripts. var options = { cwd: Node.path.dirname(binary), encoding: 'utf-8' }; // We use the relative path rather than the absolute path. The instance.path // may contain spaces which the cwd can handle, but which exec() cannot. Node.child.exec('./' + Node.path.basename(binary), options, end); } function MacPropertyList(instance, end) { // Value must be in single quotes (not double quotes) according to man entry. // e.g. defaults write com.companyname.appname "Default Color" '(255, 0, 0)' // The defaults command will be changed in an upcoming major release to only // operate on preferences domains. General plist manipulation utilities will // be folded into a different command-line program. var plist = Node.path.join(instance.path, 'Contents', 'Info.plist'); var path = EscapeDoubleQuotes(plist); var key = EscapeDoubleQuotes('CFBundleName'); var value = instance.options.name + ' Password Prompt'; if (/'/.test(value)) { return end(new Error('Value should not contain single quotes.')); } var command = []; command.push('/usr/bin/defaults'); command.push('write'); command.push('"' + path + '"'); command.push('"' + key + '"'); command.push("'" + value + "'"); // We must use single quotes for value. command = command.join(' '); Node.child.exec(command, { encoding: 'utf-8' }, end); } function MacResult(instance, end) { var cwd = Node.path.join(instance.path, 'Contents', 'MacOS'); Node.fs.readFile(Node.path.join(cwd, 'code'), 'utf-8', function(error, code) { if (error) { if (error.code === 'ENOENT') return end(new Error(PERMISSION_DENIED)); end(error); } else { Node.fs.readFile(Node.path.join(cwd, 'stdout'), 'utf-8', function(error, stdout) { if (error) return end(error); Node.fs.readFile(Node.path.join(cwd, 'stderr'), 'utf-8', function(error, stderr) { if (error) return end(error); code = parseInt(code.trim(), 10); // Includes trailing newline. if (code === 0) { end(undefined, stdout, stderr); } else { error = new Error( 'Command failed: ' + instance.command + '\n' + stderr ); error.code = code; end(error, stdout, stderr); } } ); } ); } } ); } function Remove(path, end) { if (typeof path !== 'string' || !path.trim()) { return end(new Error('Argument path not defined.')); } var command = []; if (Node.process.platform === 'win32') { if (/"/.test(path)) { return end(new Error('Argument path cannot contain double-quotes.')); } command.push('rmdir /s /q "' + path + '"'); } else { command.push('/bin/rm'); command.push('-rf'); command.push('"' + EscapeDoubleQuotes(Node.path.normalize(path)) + '"'); } command = command.join(' '); Node.child.exec(command, { encoding: 'utf-8' }, end); } function UUID(instance, end) { Node.crypto.randomBytes(256, function(error, random) { if (error) random = Date.now() + '' + Math.random(); var hash = Node.crypto.createHash('SHA256'); hash.update('sudo-prompt-3'); hash.update(instance.options.name); hash.update(instance.command); hash.update(random); var uuid = hash.digest('hex').slice(-32); if (!uuid || typeof uuid !== 'string' || uuid.length !== 32) { // This is critical to ensure we don't remove the wrong temp directory. return end(new Error('Expected a valid UUID.')); } end(undefined, uuid); } ); } function ValidName(string) { // We use 70 characters as a limit to side-step any issues with Unicode // normalization form causing a 255 character string to exceed the fs limit. if (!/^[a-z0-9 ]+$/i.test(string)) return false; if (string.trim().length === 0) return false; if (string.length > 70) return false; return true; } function Windows(instance, callback) { var temp = Node.os.tmpdir(); if (!temp) return callback(new Error('os.tmpdir() not defined.')); UUID(instance, function(error, uuid) { if (error) return callback(error); instance.uuid = uuid; instance.path = Node.path.join(temp, instance.uuid); if (/"/.test(instance.path)) { // We expect double quotes to be reserved on Windows. // Even so, we test for this and abort if they are present. return callback( new Error('instance.path cannot contain double-quotes.') ); } instance.pathElevate = Node.path.join(instance.path, 'elevate.vbs'); instance.pathExecute = Node.path.join(instance.path, 'execute.bat'); instance.pathCommand = Node.path.join(instance.path, 'command.bat'); instance.pathStdout = Node.path.join(instance.path, 'stdout'); instance.pathStderr = Node.path.join(instance.path, 'stderr'); instance.pathStatus = Node.path.join(instance.path, 'status'); Node.fs.mkdir(instance.path, function(error) { if (error) return callback(error); function end(error, stdout, stderr) { Remove(instance.path, function(errorRemove) { if (error) return callback(error); if (errorRemove) return callback(errorRemove); callback(undefined, stdout, stderr); } ); } WindowsWriteExecuteScript(instance, function(error) { if (error) return end(error); WindowsWriteCommandScript(instance, function(error) { if (error) return end(error); WindowsElevate(instance, function(error, stdout, stderr) { if (error) return end(error, stdout, stderr); WindowsWaitForStatus(instance, function(error) { if (error) return end(error); WindowsResult(instance, end); } ); } ); } ); } ); } ); } ); } function WindowsElevate(instance, end) { // We used to use this for executing elevate.vbs: // var command = 'cscript.exe //NoLogo "' + instance.pathElevate + '"'; var command = []; command.push('powershell.exe'); command.push('Start-Process'); command.push('-FilePath'); // Escape characters for cmd using double quotes: // Escape characters for PowerShell using single quotes: // Escape single quotes for PowerShell using backtick: // See: https://ss64.com/ps/syntax-esc.html command.push('"\'' + instance.pathExecute.replace(/'/g, "`'") + '\'"'); command.push('-WindowStyle hidden'); command.push('-Verb runAs'); command = command.join(' '); var child = Node.child.exec(command, { encoding: 'utf-8' }, function(error, stdout, stderr) { // We used to return PERMISSION_DENIED only for error messages containing // the string 'canceled by the user'. However, Windows internationalizes // error messages (issue 96) so now we must assume all errors here are // permission errors. This seems reasonable, given that we already run the // user's command in a subshell. if (error) return end(new Error(PERMISSION_DENIED), stdout, stderr); end(); } ); child.stdin.end(); // Otherwise PowerShell waits indefinitely on Windows 7. } function WindowsResult(instance, end) { Node.fs.readFile(instance.pathStatus, 'utf-8', function(error, code) { if (error) return end(error); Node.fs.readFile(instance.pathStdout, 'utf-8', function(error, stdout) { if (error) return end(error); Node.fs.readFile(instance.pathStderr, 'utf-8', function(error, stderr) { if (error) return end(error); code = parseInt(code.trim(), 10); if (code === 0) { end(undefined, stdout, stderr); } else { error = new Error( 'Command failed: ' + instance.command + '\r\n' + stderr ); error.code = code; end(error, stdout, stderr); } } ); } ); } ); } function WindowsWaitForStatus(instance, end) { // VBScript cannot wait for the elevated process to finish so we have to poll. // VBScript cannot return error code if user does not grant permission. // PowerShell can be used to elevate and wait on Windows 10. // PowerShell can be used to elevate on Windows 7 but it cannot wait. // powershell.exe Start-Process cmd.exe -Verb runAs -Wait Node.fs.stat(instance.pathStatus, function(error, stats) { if ((error && error.code === 'ENOENT') || stats.size < 2) { // Retry if file does not exist or is not finished writing. // We expect a file size of 2. That should cover at least "0\r". // We use a 1 second timeout to keep a light footprint for long-lived // sudo-prompt processes. setTimeout( function() { // If administrator has no password and user clicks Yes, then // PowerShell returns no error and execute (and command) never runs. // We check that command output has been redirected to stdout file: Node.fs.stat(instance.pathStdout, function(error) { if (error) return end(new Error(PERMISSION_DENIED)); WindowsWaitForStatus(instance, end); } ); }, 1000 ); } else if (error) { end(error); } else { end(); } } ); } function WindowsWriteCommandScript(instance, end) { var cwd = Node.process.cwd(); if (/"/.test(cwd)) { // We expect double quotes to be reserved on Windows. // Even so, we test for this and abort if they are present. return end(new Error('process.cwd() cannot contain double-quotes.')); } var script = []; script.push('@echo off'); // Set code page to UTF-8: script.push('chcp 65001>nul'); // Preserve current working directory: // We pass /d as an option in case the cwd is on another drive (issue 70). script.push('cd /d "' + cwd + '"'); // Export environment variables: for (var key in instance.options.env) { // "The characters <, >, |, &, ^ are special command shell characters, and // they must be preceded by the escape character (^) or enclosed in // quotation marks. If you use quotation marks to enclose a string that // contains one of the special characters, the quotation marks are set as // part of the environment variable value." // In other words, Windows assigns everything that follows the equals sign // to the value of the variable, whereas Unix systems ignore double quotes. var value = instance.options.env[key]; script.push('set ' + key + '=' + value.replace(/([<>\\|&^])/g, '^$1')); } script.push(instance.command); script = script.join('\r\n'); Node.fs.writeFile(instance.pathCommand, script, 'utf-8', end); } function WindowsWriteElevateScript(instance, end) { // We do not use VBScript to elevate since it does not return an error if // the user does not grant permission. This is here for reference. // var script = []; // script.push('Set objShell = CreateObject("Shell.Application")'); // script.push( // 'objShell.ShellExecute "' + instance.pathExecute + '", "", "", "runas", 0' // ); // script = script.join('\r\n'); // Node.fs.writeFile(instance.pathElevate, script, 'utf-8', end); } function WindowsWriteExecuteScript(instance, end) { var script = []; script.push('@echo off'); script.push( 'call "' + instance.pathCommand + '"' + ' > "' + instance.pathStdout + '" 2> "' + instance.pathStderr + '"' ); script.push('(echo %ERRORLEVEL%) > "' + instance.pathStatus + '"'); script = script.join('\r\n'); Node.fs.writeFile(instance.pathExecute, script, 'utf-8', end); } module.exports.exec = Exec; // We used to expect that applet.app would be included with this module. // This could not be copied when sudo-prompt was packaged within an asar file. // We now store applet.app as a zip file in base64 within index.js instead. // To recreate: "zip -r ../applet.zip Contents" (with applet.app as CWD). // The zip file must not include applet.app as the root directory so that we // can extract it directly to the target app directory. // // To update the applet, follow these steps: // * open main.scpt in macOS Script Editor and edit it as needed // * select File | Export... (file format: Application) // * replace the `applet` in `Contents/MacOS` // * `zip -r ../applet.zip Contents` // * base64 encode the zip file // * replace the contents of the `APPLET` variable var APPLET = 'UEsDBAoAAAAAABg+cVMAAAAAAAAAAAAAAAAJABwAQ29udGVudHMvVVQJAAPQpZRh0qWUYXV4CwABBPUBAAAEFAAAAFBLAwQKAAAAAAANPnFTAAAAAAAAAAAAAAAADwAcAENvbnRlbnRzL01hY09TL1VUCQADuaWUYbmllGF1eAsAAQT1AQAABBQAAABQSwMEFAAAAAgABUePSBrsViN9AQAAqgIAACEAHABDb250ZW50cy9NYWNPUy9zdWRvLXByb21wdC1zY3JpcHRVVAkAA4mQEFf+pJRhdXgLAAEE9QEAAAQUAAAAjVI7TxwxEO73VwwcgobFQHnFIYRSpOUUpYy89hxr4ReeMZfLr8941yDSpVrL4+85uzlTk4tq0jQPG9gjA1WbgF1AYh0yHFKRq4nwrWLsU6O9J3AHYD79YmdekQl0QbCO9OTRboeFNbxaV2DMoN51UXZSDa0ufuy/PcMOlMV3Fav3cL+7vBtUpbKgOFUz/xdkA485e9yb4jJfEZyLN5pRxrRcnUPQJ9CeUTKwTZXBu4gjRuviC90IwXfub0igLf36jFM7YSlLyhkl21FLRogpjn+wJCjItUQwySLoaGXQEY31J64gKQ8hy1cMcMNIH2gYRCLXJlZQB1rwRmchxH94g45Vqj71OtuSlgWMuaSQeTQphIa923Xb97vVw/oezZzg4kF6a2xi6ymVVf4YsdDsMqRDT3z9kXfx0sSlEJ41QyUxb3QEix55CRa267aoqYjIMcK6oW6jU3XVR3/UJ/oIdvtJ/GV3YBOSVChQYQMBy19nnfbpZTvgb8dwO/wFUEsDBBQAAAAIAMM9cVNCvifldAkAAHjDAQAVABwAQ29udGVudHMvTWFjT1MvYXBwbGV0VVQJAAMupZRhLqWUYXV4CwABBPUBAAAEFAAAAO3dfWwT5x3A8efsJLglpQax0go6IloqqFAcutDRlxWHxMUMREKSoqjqdtjxBRv8tvMFkgKrWcRW2tJRtZPaSZvQ/tjKxFCF0NZVW3HWbt0mTYVuo+1WVdXEqlRrN1RNHTCF7Hl85/jsOClTX6ZJ34/05LnfPc/9nufufPnvufvtpeeeF0J4NCFmydorRFBW+07JP3PkvkahaOrPC0NqnwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB+7ly++d2mWEJpXbntkuVqWJxuE2C+aiu3XyRKWRde72taF7g11d07NoV3GOCrPa5rK0xvq661xfLDqACeudxVRnIdlDFnlbtX5uu6y8z3uiuvceetE3h3qes4ajOamzXfWyTevKi7xOfkaKvLpcSOZNcwa+c47xze7Ys+M8xtM70qkY3oiPZCpkW/ZGjtflyuuyFdF1424PmBGUkbt8x1y8uVdsXeGfOX72tHW2+ZqCFbd16ra65Tyfc2amW1yXvrOiJmbPt8yVzzTvHQ9ndRzw6loJqlnLXNKvmVOPp8rdudrEJWxrm/LWBVxZb6WqnwtNfK5f4e6nozMNL/VTr5rXbE7n3pZR70r1vX+TCqVSU83vy4nX5PrGHe+6me4/NxvXL9pQ6hjfek3krf7ntLKsXDFWlWuJbJHi9NPXRtfvnxOSlPeHicu66ywf7uq/a28fc227rP3zxbl37jmKqp/xfNdJbivfE/c1ItMmoT9gpPAYM4MJBPRQGw4GXPaFzrzOPPyLxeO3NnS+dAD777ytWN3PHOj3OdXHRquFFrD7OI9eNaZw80zzOPT0nXX5f0/VucdF/Y5Fv9frIjWqSMDPcM5y0gFNiaiZsQcDtyt/lXsypg7coH2jGn0GObORL+Rax4o7Q9sMcxcIpPOBdoqerjGWe0aRxtqrC+OU7rmsthDNq9tltc/EbWPu0nY1/m1vH3/ljux+l0AAAAAAAAAAAAAAAAAAAAAAAAAAID/znYRPvDX8MjZc+GH9/rCBwf9By6O/EIb/Ys3rL0fPnD6b3XhkVFfeOQ2MfiB2hpT6wMPvDSmViP/85B0jzz8pJXMRp63sv25sXVyf3h/wfKFZSe1/m9l4UsvHHK5pzjcu/7wS6FzwqfJ0feeDx/ce25MLZANj7zol90nlm7ShJhY2lX8211cHrnx4PXL5UZbz8RSVR9SayHFO29PTEzEr1dbb6it29TWK3LLXlO5yDlHd63WNKo1l63CLmp9uHC21fraRtljvr3CUgvaTcXx5zs5tPu7hTbk1/yNs3yHZMuNTt7zlyaKbixd2LY5/q972q8qrTP/sOPHnONvmOZ4t+L68aBd9zn1VqeOB2uvJ/U568TnOfWiNZe37hQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEw1d4m4Z22PEPOC6uPX9sfro4l0zDDFZrPlkDBXzw3q7ZFksj2TymbSRtrqSOSyEas/LmRjUDZ2Zo10hzEQGUxak31UW3heUDeGEmpb0XQ9FZc7jP5By9DjRkQNsWCmT9V/JKf2BIufHb9PljtlWRuKFD+Xrr7TfbXmt6ck7O9Sa65XFwSq4pAdT85zQ1WsNrxi8hvkwfqp+0StM5/mmta+mvZ1nHKDzEjMvD0QWHXrytZVrbd8rJcPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPApe/nie5canfXuat36PFny9ULsF03F9utkCQu1hr2rbV3o3lB359Qc2tRdU6g8D2oqT2+or7fG8cGqA5y43inltfSWMWSVu1Xnm7/GznefK654yUCdyLtDvbiiPjdtvuya8nsCSrE7n8/J11iRT48byaxh1sj3oJOvxRXPPL/B9K5EOqYn0gOZGvmedfKFXfFML1VQ9+HJYp6Ott42vb1zU4+dLVh1H6pqr1NUH3/x+G0Z122YNp9PlPN4Xf0bROU81bzGJvO4GvJV88rXnlcpl64nI3puOBXNJPWsZU6bz++K3fOaJSpjXY9FrEj1eZZjf77yPP1V+aqVn6eN6zdtCHWsL93LQtV5FuxqyEmmicrnbImceYvTT43tK5R/o0pTwU61VdZNwr4+qv3Bgv08nZN1XNazZekSlWNoovwOi+m85uSpNkfY46nnITCYMwPJRDSg3lzhtC905vGH+h0//nvv7WeP77njX+OLTm2/xTmueI4Ns4WmSmkODQ95bhaue/a8EMvk+as86vl2U+PGnTGKv4kV0TqVNdAznLOMVGBjImpGzOHA3WYkZezKmDtygfaMafQY5s5Ev5FrHijtD2wxzFwik84F2ip6uMZZ7RpHG2qsL45TOmdZ7CGb1zbL809E7eNucs4jX7Dv23InVvdFud6Jt47K3J/Y21EAAAAAAAAAAAAAAAAAAAAAAAAAAAD+v4zvPnlk3Cseyz96sFs0HzX3zXm0O5I8Zs4X4omgECfqZC1Evnt89+jTBa9+ZmJEnB7frR0ZbxeP+cS+7mXisDnmFUfekjlU3/HdbUdkn8dU38VN3j9m6zx9wrO4uN3lbG+u8/hVfG7dySPF/V5R3N8lxLUXJiYWqHmp7Q/ktlojqtbGLnLm667VklG1JrZV2OUrzvpYta3W0jbKI/3llcSlZfUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOB/6LDz/fijayq/Lw4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD49c28Q3aqeF4wNJ2N6zhqM6tFEOmaYYrMpDomcmBvU2yPJZHsmlc2kjbTVkchlI1Z/XDX6ZGNn1kh3GAORwaQ12Ue2lWi6norrxpDRP2gZetyIqNQLPKXmJ77aUqy3yHKnLGtDkXoV18lytea3U8hyrV1PvqIgUBWH7Hgyr9rwOnlK2yW1ZjTNOdY+uymXyozEzNsDgVW3rmxd1XqL+/pefLOxIGewQJTnOl/uk1PyeIWnTk1OTa9flj6n/SohRrc2eUTj5d3B4OSVbstmk4bVI+clvvyPY7m911xYekXY+5PXP/PO2A5r+P2ehZu/2X5kxdPvfvs3v/7RA0eP92V+9c5Aoe7V06d3eDr76if2nNhz//4//fzh8IEVP/iwdkPPnuk89pTm2/nET5u+uOfE8W984c2H+1fOHX6ma/SBn73a8lHzf+T21v7Nj6e/6zvz533PxT57WD+7eGTDlU993vedt393oeP1a2Kf9Pife2PdqSXff33Lrb//1lNX/NA8/ej3jm4fH33Rv/jfhUc6T770ovgPUEsDBAoAAAAAACA+cVMAAAAAAAAAAAAAAAATABwAQ29udGVudHMvUmVzb3VyY2VzL1VUCQAD3KWUYd+llGF1eAsAAQT1AQAABBQAAABQSwMEFAAAAAgA7VBwR/dYplZAAAAAagEAAB4AHABDb250ZW50cy9SZXNvdXJjZXMvYXBwbGV0LnJzcmNVVAkAA82cSVZTpQ9XdXgLAAEE9QEAAAQUAAAAY2BgZGBgYFQBEiDsxjDygJQDPlkmEIEaRpJAQg8kLAMML8bi5OIqIFuouKA4A0jLMTD8/w+S5AdrB7PlBIAEAFBLAwQKAAAAAADtUHBHAAAAAAAAAAAAAAAAJAAcAENvbnRlbnRzL1Jlc291cmNlcy9kZXNjcmlwdGlvbi5ydGZkL1VUCQADzZxJVi2REFd1eAsAAQT1AQAABBQAAABQSwMEFAAAAAgA7VBwRzPLNU9TAAAAZgAAACsAHABDb250ZW50cy9SZXNvdXJjZXMvZGVzY3JpcHRpb24ucnRmZC9UWFQucnRmVVQJAAPNnElWU6UPV3V4CwABBPUBAAAEFAAAACWJOw6AIBAFe08DCBVX2QbWhZgQ1vCpCHcXtHkzkzegtCDB5Xp/g0+UyihARnb70kL/UbvffYpjQODcmk9zKXListxCoUsZA7EQ5S0+dVq085gvUEsDBAoAAAAAAIeBjkgAAAAAAAAAAAAAAAAbABwAQ29udGVudHMvUmVzb3VyY2VzL1NjcmlwdHMvVVQJAAM9pQ9XLZEQV3V4CwABBPUBAAAEFAAAAFBLAwQUAAAACAAJgI5ICl5liTUBAADMAQAAJAAcAENvbnRlbnRzL1Jlc291cmNlcy9TY3JpcHRzL21haW4uc2NwdFVUCQADcaIPVxyllGF1eAsAAQT1AQAABBQAAAB9UMtOAkEQrNldd9dhH3Dz6NGYiPIJHjTxLCZeF9iDcXEJC0RvfoI/4sEfIvoHPEQEhbIHvOok01U16emu7vOkaF2dXu7XqrUTcyMATkxCwYKthCAUbmciAQ8O11yFcGBfbF/4jR24WmCvWjwUeXqfNutn13XyEeYYHkqKam+kghdJGfUCvwIfB6jiGAX6aCHHETroCrYFe6IKNEXfGOXChc0v7HKpBRzdSFrtELvbumKVC80F/FIjzwe9bj91uZRuXJuwAiLjNi7DlsxPaJSUAMrCFOeac3GfpINennQ6d/0sA4z7JxzKiVCCV+YHAs74LuuIONUi//4RIoC63czrIbYQS3PFicWJcTMTv1JHmocmROLJ45gjzfHvXJqjf7ZZ4RT+61uaBbDipGh2ZanBcjh8/gFQSwMEFAAAAAgAgHFwR3658rH2BgAAH9wAAB4AHABDb250ZW50cy9SZXNvdXJjZXMvYXBwbGV0LmljbnNVVAkAAx/WSVb+pJRhdXgLAAEE9QEAAAQUAAAA7d15PNR5HMfx72+claOWxrFZSm3KUUahZRmRkuSYpEQSHSNDmbbTGZaKomMK1Yw9VKiWlKJE0bmxu9m2VY6kdVWTY6dlxBqPR/vYLfvYf/bR8fB+zeP38OTB42Hmj8/j+/j+8f2y/YK4hDzQZvtNNSdEvmW7y/zZisM1hxNCFB3m2LkRQhHJIy/b/8Ur5NhKQqQV2ba2Lg62tjouIcEr2YErCDFPTHT3Xj3GXdWqkLtKd3w5K3Ba7Ppj1ooTFPcunJaeVxBRXW0axHMwrRrX5C96Vn7wRrm5SeHLdOdZLqHGLWmqpZfyI3X0fle+b5U3Zf/wCVWVOnpWeX9EuzTtzGhNsTBJYRfk1Kx4FtpxWHhk67Pzq4QyTeczF/GSVSl66klDNUY9N253/Of6STFxAjXZdA9XLX3v4/Nops4jNp5ZUmt7eavPrz9X9/JP5NtrjdZZp7389G/HRsTvpp4fdb+1gdrSnaxt3eL5iWh5U74xs3TKlnMP/X65wrUKT2SvbDCovxMv484KiD8wcvf3ZX/YK4iNv7vrI3AKaM1sevzV8rQvqgU5a4W+vXxOyerYDs6VoxUpfKsYoa+XWH/6hMaHrqWOmXv49j3y9Ws4YWfH1N3npSWPspZNelCTeipjlNDOK/u+XGYR/5sTZ3aMDW+MMe0wqDeMrzBrvMkquZeVubfsUMmG0vzpnu3tFtLF2wuWpLZdCxFzWEfaGx+3TE+9tXWzXU/3hc1zRGEh/BlPm0ObOmJ4hnI93x7YFz26NDo+It3eRtRY35vzYO5IKY0AzccOEUZ7vlZaMuWRNyejqcJRQc2sUtuR3tod5Sboszu9MyTy1GLZLNeEROcqw/MtrV2uZeVqofzQWNOsqIgixdPDZPQOTo27ONxpkdQofz2mbC393urj0UqyDNUTqho7fNJXqn3cWGzZ/lleyu2Sosv7eq9f94nuOleeN9k/zmobPVezZ1c2/c6KtqxYLz8V63ADM5r1pxo6H/0aXbGU4SBKXsegxm3eYekk2jsmV8Vf2H1vbuCspZZmd19eSDBxy0ibVT0jr1CwrM9k8jwv1i/ZBkpnv9S9NUks432x56pPjlezgZnr2XqNwwUe5V0+Xa09DJF+T8A3dRENHm35Idc8vy/MnXflSeAi7kZ3TY7sI/rzH1PKtpdpdaxra/BQtg/n3UhpPNXpbbk42EjJPvuATHdA10KN+Yl22Z3RnXF5Bhcnhum9vHrxdtjNsNth5WEl3rRki1uHHxU9NFqrzfW5Kgro0PSs3UrfrJ6/qpm3JnvuWN3A0Z/QQy6bPnT1ZbRPVJD3m+l6L4p3olVM50858rmWkp/2b0fFXkVGC6nt4hxap1Ovu/uC5rX7JmktDHYyL7JRSRhv65+wz3TBi3MeHenj9js/dmOPZFmwVI7nVNoox53O2CDg0MQ9Wj8fD8p1a/nJryaMtvjOZ0GtirdHb3T8ae9yzVOmk3mpLU3xx9S/vD5v12pWXBXH82MZYU3n7s40RqGyyhKj2YfECsVF1m1PxEb1u/IIb0xk1DXdIPWKm3I1MuYdMVW590u0kueEjqirfPFEdKmbsSn8ZWXzg1JudqNh5Bkzi8OXaoXr71ox+7LIqsQISsAPdXdZ1hvcPxiSHOxsFmyinv5gLBkalwW/Oz9dIx/P9C2OpKRkFdSnLgMAAHgreC4lRVkSSrOAyeqfRsRh1ny7kzOXbetf6cwghO7y5kqHRiTPwEqnc1NlN1Y6WOlgpYOVziArnVGiN1Y6HLlgrHQAAAAAAAAAAAAAAAA+aNRpq9OeE0qKlsT7536y8VRCHNvf3E+WJpJnYD85Qks/GvvJ2E/GfjL2kwfZT2aSV/vJUZLRckXQxdJuiHXBdjIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAvHXQ/BuaCZFLkJwF8J78SwAAAAAw5BBVEUXJFROqyL/k29dO/DImRHrbmyd+ER3JM3DiF3fLlk6c+IUTv3DiF078GuTEL6InWeUvGvYfJ35dUFYYqUOo8slnrr02gRj9w+X8IBOIKXkGJlAme10NJhAmECYQJtBgE8jn1ZmDlOLAHTYvnDlKZv/XHTb9g4vJJBTd5mDra4PLBNeMYnBhcGFw4ZpRAAA+cPzrNaPG03DNKFY6WOlgpYNrRgEAAAAAAAAAAAAAAIC/8G/XjAaaMPq/Ne8jf38JyX99z+YO/J1qHxGTVw97veRnUpId6Nd+f2i9ot75f4B3/+7efaA5Zw0h0vIEITRkC/LlrOj/osD2Cw7iDswEasjPhPUDnwNzyH8OCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYTQ+9CfUEsDBBQAAAAIAKBxcEeUdoaooQEAAL4DAAATABwAQ29udGVudHMvSW5mby5wbGlzdFVUCQADXNZJVv6klGF1eAsAAQT1AQAABBQAAAB9k1FvmzAUhZ+XX8F4D06lKaomSpUEIkWinVXIpD1Nrn1LrBrbs00J+/UzSdolZOwRc75zz72+ju/3tQjewFiu5F14E83CACRVjMvqLtyW6+lteJ9M4s/pt1X5A2eBFty6AG+X+WYVhFOEFloLQCgt0wDnm6IMvAdC2WMYhDvn9FeE2raNSK+KqKp7oUXYKA3Gdbk3m3ogYo6FvszR/SKOP2WcumTyKX6FLlmtl41kAhZCqPaB74HlihLBfxPnERujXuS1zjSAhlAKbyCUrkG6J6i8/kNunfEdJ5msfIJdjE7fAz7bA20ceRYwBA/9uTFuQ5Vc8zEq4rQPPoIyH5a/cDBD2A8zsg1TU21UrcdryxeV+gH6bonpvh9HO/SaR7Mx/pHUV7kxsbZVhgX4v6Uxoa+kgrLTVw4LjPMxrNgp405Bi4NiSN+Mxy14JYlrzD9mLa6C5sUDl7xu6qKzDupTzWW3MHTHHdALn9MWHsn97fzn/Mv7v7/BZtH8vAg6X928eIJfDTdgV8Q8n13Cxa7mxXaTCeh3dCh4t4vR4Z0kkz9QSwMECgAAAAAA7VBwR6ogBnsIAAAACAAAABAAHABDb250ZW50cy9Qa2dJbmZvVVQJAAPNnElW/qSUYXV4CwABBPUBAAAEFAAAAEFQUExhcGx0UEsBAh4DCgAAAAAAGD5xUwAAAAAAAAAAAAAAAAkAGAAAAAAAAAAQAO1BAAAAAENvbnRlbnRzL1VUBQAD0KWUYXV4CwABBPUBAAAEFAAAAFBLAQIeAwoAAAAAAA0+cVMAAAAAAAAAAAAAAAAPABgAAAAAAAAAEADtQUMAAABDb250ZW50cy9NYWNPUy9VVAUAA7mllGF1eAsAAQT1AQAABBQAAABQSwECHgMUAAAACAAFR49IGuxWI30BAACqAgAAIQAYAAAAAAABAAAA7YGMAAAAQ29udGVudHMvTWFjT1Mvc3Vkby1wcm9tcHQtc2NyaXB0VVQFAAOJkBBXdXgLAAEE9QEAAAQUAAAAUEsBAh4DFAAAAAgAwz1xU0K+J+V0CQAAeMMBABUAGAAAAAAAAAAAAO2BZAIAAENvbnRlbnRzL01hY09TL2FwcGxldFVUBQADLqWUYXV4CwABBPUBAAAEFAAAAFBLAQIeAwoAAAAAACA+cVMAAAAAAAAAAAAAAAATABgAAAAAAAAAEADtQScMAABDb250ZW50cy9SZXNvdXJjZXMvVVQFAAPcpZRhdXgLAAEE9QEAAAQUAAAAUEsBAh4DFAAAAAgA7VBwR/dYplZAAAAAagEAAB4AGAAAAAAAAAAAAKSBdAwAAENvbnRlbnRzL1Jlc291cmNlcy9hcHBsZXQucnNyY1VUBQADzZxJVnV4CwABBPUBAAAEFAAAAFBLAQIeAwoAAAAAAO1QcEcAAAAAAAAAAAAAAAAkABgAAAAAAAAAEADtQQwNAABDb250ZW50cy9SZXNvdXJjZXMvZGVzY3JpcHRpb24ucnRmZC9VVAUAA82cSVZ1eAsAAQT1AQAABBQAAABQSwECHgMUAAAACADtUHBHM8s1T1MAAABmAAAAKwAYAAAAAAABAAAApIFqDQAAQ29udGVudHMvUmVzb3VyY2VzL2Rlc2NyaXB0aW9uLnJ0ZmQvVFhULnJ0ZlVUBQADzZxJVnV4CwABBPUBAAAEFAAAAFBLAQIeAwoAAAAAAIeBjkgAAAAAAAAAAAAAAAAbABgAAAAAAAAAEADtQSIOAABDb250ZW50cy9SZXNvdXJjZXMvU2NyaXB0cy9VVAUAAz2lD1d1eAsAAQT1AQAABBQAAABQSwECHgMUAAAACAAJgI5ICl5liTUBAADMAQAAJAAYAAAAAAAAAAAApIF3DgAAQ29udGVudHMvUmVzb3VyY2VzL1NjcmlwdHMvbWFpbi5zY3B0VVQFAANxog9XdXgLAAEE9QEAAAQUAAAAUEsBAh4DFAAAAAgAgHFwR3658rH2BgAAH9wAAB4AGAAAAAAAAAAAAKSBChAAAENvbnRlbnRzL1Jlc291cmNlcy9hcHBsZXQuaWNuc1VUBQADH9ZJVnV4CwABBPUBAAAEFAAAAFBLAQIeAxQAAAAIAKBxcEeUdoaooQEAAL4DAAATABgAAAAAAAEAAACkgVgXAABDb250ZW50cy9JbmZvLnBsaXN0VVQFAANc1klWdXgLAAEE9QEAAAQUAAAAUEsBAh4DCgAAAAAA7VBwR6ogBnsIAAAACAAAABAAGAAAAAAAAQAAAKSBRhkAAENvbnRlbnRzL1BrZ0luZm9VVAUAA82cSVZ1eAsAAQT1AQAABBQAAABQSwUGAAAAAA0ADQDcBAAAmBkAAAAA'; var PERMISSION_DENIED = 'User did not grant permission.'; var NO_POLKIT_AGENT = 'No polkit authentication agent found.'; // See issue 66: var MAX_BUFFER = 134217728; The MIT License (MIT) Copyright (c) 2015 Joran Dirk Greef Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "@vscode/sudo-prompt", "version": "9.3.1", "description": "Run a command using sudo, prompting the user with an OS dialog if necessary", "main": "index.js", "types": "index.d.ts", "files": [ "LICENSE", "README.md", "index.d.ts", "index.js", "package.json", "test.js", "test-concurrent.js" ], "repository": { "type": "git", "url": "git+https://github.com/bpasero/sudo-prompt.git" }, "keywords": [ "sudo", "os", "dialog", "prompt", "command", "exec", "user access control", "UAC", "privileges", "administrative", "elevate", "run as administrator" ], "author": "Joran Dirk Greef", "license": "MIT", "bugs": { "url": "https://github.com/bpasero/sudo-prompt/issues" }, "homepage": "https://github.com/bpasero/sudo-prompt#readme", "scripts": {} } var sudo = require('./'); var exec = require('child_process').exec; function kill(end) { if (process.platform === 'win32') return end(); exec('sudo -k', end); } kill( function() { var options = { name: 'Sudo Prompt' }; if (process.platform === 'win32') { var sleep = 'timeout /t 10\r\necho world'; } else { var sleep = 'sleep 10 && echo world'; } sudo.exec(sleep, options, function(error, stdout, stderr) { console.log(error, stdout, stderr); } ); sudo.exec('echo hello', options, function(error, stdout, stderr) { console.log(error, stdout, stderr); } ); } ); var assert = require('assert'); var fs = require('fs'); var sudo = require('./'); var exec = require('child_process').exec; function kill(end) { if (process.platform === 'win32') return end(); exec('sudo -k', end); } function icns() { if (process.platform !== 'darwin') return undefined; var path = '/Applications/Electron.app/Contents/Resources/Electron.icns'; try { fs.statSync(path); return path; } catch (error) {} return undefined; } kill( function() { var options = { env: { 'SUDO_PROMPT_TEST_ENV': 'hello world' }, icns: icns(), name: 'Electron' }; if (process.platform === 'win32') { var command = 'echo %SUDO_PROMPT_TEST_ENV%'; var expected = 'hello world\r\n'; } else { // We use double quotes to tell echo to preserve internal space: var command = 'echo "$SUDO_PROMPT_TEST_ENV"'; var expected = 'hello world\n'; } console.log( 'sudo.exec(' + JSON.stringify(command) + ', ' + JSON.stringify(options) + ')' ); sudo.exec(command, options, function(error, stdout, stderr) { console.log('error:', error); console.log('stdout: ' + JSON.stringify(stdout)); console.log('stderr: ' + JSON.stringify(stderr)); assert(error === undefined || typeof error === 'object'); assert(stdout === undefined || typeof stdout === 'string'); assert(stderr === undefined || typeof stderr === 'string'); kill( function() { if (error) throw error; if (stdout !== expected) { throw new Error('stdout != ' + JSON.stringify(expected)); } if (stderr !== '') { throw new Error('stderr != ""'); } console.log('OK'); } ); } ); } ); MIT License Copyright (c) Microsoft Corporation. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE { "name": "@vscode/vscode-languagedetection", "version": "1.0.21", "description": "An npm package that uses guesslang's ML model to detect source code languages", "main": "dist/lib/index.js", "bin": { "vscode-languagedetection": "cli/index.js" }, "module": "dist/lib/index.js", "types": "dist/lib/index.d.ts", "scripts": { "pretest": "npm run clean && tsc --build ./test", "prepublish": "npm test && npm run build", "prepack": "npm run build", "clean": "rimraf dist", "watch": "npm run clean && webpack --watch", "test": "mocha --recursive dist/test/**/*.test.js", "build": "npm run clean && webpack --mode production" }, "repository": { "type": "git", "url": "git+https://github.com/microsoft/vscode-languagedetection.git" }, "author": "Tyler Leonhardt", "license": "MIT", "bugs": { "url": "https://github.com/microsoft/vscode-languagedetection/issues" }, "homepage": "https://github.com/microsoft/vscode-languagedetection#readme", "devDependencies": { "@tensorflow/tfjs-backend-cpu": "^3.9.0", "@tensorflow/tfjs-converter": "^3.9.0", "@tensorflow/tfjs-core": "^3.9.0", "@types/chai": "^4.2.21", "@types/mocha": "8.2.3", "@types/node": "^16.3.1", "chai": "^4.3.4", "esbuild": "^0.12.15", "mocha": "9.0.2", "node-fetch": "^2.6.1", "npm-run-all": "^4.1.5", "rimraf": "3.0.2", "terser-webpack-plugin": "^5.1.4", "ts-loader": "^9.2.3", "typescript": "^4.3.5", "webpack": "~5.44.0", "webpack-cli": "^4.7.2" } } ## Security Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below. ## Reporting Security Issues **Please do not report security vulnerabilities through public GitHub issues.** Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) * Full paths of source file(s) related to the manifestation of the issue * The location of the affected source code (tag/branch/commit or direct URL) * Any special configuration required to reproduce the issue * Step-by-step instructions to reproduce the issue * Proof-of-concept or exploit code (if possible) * Impact of the issue, including how an attacker might exploit the issue This information will help us triage your report more quickly. If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. ## Preferred Languages We prefer all communications to be in English. ## Policy Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). #!/usr/bin/env node const { ModelOperations } = require('../dist/lib/index'); const os = require('os'); (function (params) { console.warn('Note: this CLI is only for diagnosing the model results in @vscode/vscode-languagedetection. It should not be depended on in any production system.'); const args = process.argv.slice(2); const content = args.join(os.EOL); if (!content) { console.error('No content specified. Please pass in the content as the first argument of invocation.'); return; } if (content.length <= 20) { console.error('Not enough content specified. Please include more content in your invocation.'); return; } const modelOperations = new ModelOperations(); modelOperations.runModel(content).then((result) => console.log(result)); })(); asmbatccscppcljcmakecblcoffeecsscsvdartdm dockerfileexerlf90gogroovyhshtmlinijavajsjsonjlktlispluamakefilemdmatlabmmmlpaspmphpps1prologpyrrbrsscalashsqlswifttextomltsvvbaxmlyamlZuqp7.@L%kYZ{T][ZqtaB,BLnSxvMt1)>lWhbiGlΤS3C.lK1ZbKg^3Wcs 9ěgW%|JPe|dD*EebVWxGQ}:C^}2q=Uzkrbt$q{iqnzıw/nՀŏD)hCb~qjtn^b.e@QKꙑ%C29"͕TwO!jrGpTԐb Z߱j;Q5GoʎOW$%jnJ`v}|sJ`n/OZΖHV/8v] ͣmB-s]?O_pqewUnՓ]2 <~{~PDC=éM?xuFTpAd+hR.o ]zmJzMmQGL_axzSZqoJsPp tokb[_n%RSnwfפ'Iww"کlŤa*|U]qmp&LNVLl׵C.DXMl Ep|p>w:?dI6K{(sqÈomu_1ϲM{sphjyyipii]ojT=e֗!ZtHz*m;otqgd9G&gUbaIPywޥ=5LSBT :MO9OD 'c>f_yzL ēKjgL"\oOfÒFJO5g:ΥHO}Lky6L?Yjq>j_[wS|j8VoZvH|هk&e.b6 Jof~x({!󘎘wCjsSzZGxvH_-BUVm5VţNwv"H׌R[L'ZjPGԘ̟]4*SҜȨ_€$= _U$ȶ+gj@cZhŋIώga֬g֓ȧUr.VDȚƴW37F>0eWYcUan[XÿJr_g`.݋ݜm*Ӯyli8QW}qa@;Oh*>=wpjO1zX*Mǵ{; 9t_g{̥C_XQFj;=V~]L>a[Xr[RZ垭WAo^Zw8cr<>X4on_b`Y]rʦgsS$~=hgmYHpW]D%V!tIlzp{x>pug3hv"\Ŧ[rsqSŮ?!-ݼhV` Bqi{*V!P|aB._KH89,["l#Kw3`8N<]OSI|PWOPvfbv5nc6yHI~ʱ}Btnv:|Zq*}N9fohL`mmU h)flkaL㩺u@_q8eB}hcvCˮ;Xʾ'>|~H`_.= SpV{&b[0PfGh8>zs:mA]qe=\4m7U~*ZZ2|i:Y$ss_"{Ueyݯ⋇ٶriNyDYi̦$"`YsH`U]Մ,M7}xg6oG5|Pd\y@9J}$?=Aw4?a-sHK4d|+{Ӳӻ/ꜯxѲ>shԮ3O$&^]IbG?r~9;ifmqtgqSi*]Tl`\NNʎ+#g͵yoG{w-rl 8?oL^SB/|҂p΋Sh{q]vwqz9Hd1À;+|vuY!VYJN_5(ٔo \o&twĥ_y6bKH6|`>済x~P!n少h-»TyBIoB*vzs=mA~Ws{hTx {</ _TygGTi\mFMY9Rf qr¡\a*}B[wFMIneACeOq(ĥp%FMurO6P5l(\HN~ih !J1~^NQF(;x1bש|$'wm؟Xoklx>ңv\zlcpyw nsGqu2y^&~agmpYqutB57=ȣGYXL|fH\rn.`0`K㔚`vPsmӜ]HOxY5fc>Krs>:=EbK Ғj⵭`c0ncЕ杇щˤ(i"\FRÞxjs\nAb&z7aRgu4.lSn_qa{^i/?= qrlkX]ןgKqpvlBᚓ"glu?5g꺀)tiFGZiIGhTFHTDWof&^& S d]k&p>ZeƩSF>n8j#֠[fvBwes|1C{\MK(ۑ.B ^M\f&!|X`12x3wCju[ROHCO.Ƞ;^gV9uWXCq\`@ț6U9,ZdD}b?Ci*brRMVPC|wy`Fyb%vN➃Ye7 aXKzwOR"Z͐$i:ܙn?zje=Ѷbu|)g[)Bsbl*t\[Xxex=!vqBvQv`LFDMr"@[|5S|yqwuU\E0fen9|sh̽+gh3-~x?!f_8}U?xffmUA"Zbʺ>w ayqړ1L]i~VbhB\Hg̕,ዊ`LrcNgXΌ҉vd=b=Ƶ+TVO}.8XIDh?o{PtvBN …qloQ`df"\{XSwe%_nX'{8tشgf@L_ĥ[ZqՂ]oA&T0VvZZx:Sc\b}$j5>\qsN9HdQ>_=dhV@g>f ȕ!ʱ}٢wy,5k.xSapysycU7crn|9X4`o^FQ̨fSbWtnWSغ,:zׂkN(żkXyee|z>'?Fx[GI/s1|6r5?hեƬxK@ECrZ{U ң{,%Z4xekLqVeV_@໰0Ŧ*‰y/7BuNp/|9r|ZCq{\L}P(t P0vv pW?ixlJaN~T-3ug׿hͤ{⡕~{ڃ\!S^^_rv8k͒Ys+pe_btDe}phz;?Yv=lD>wn݈Wmw%qkͣCh;vĘ-/k"MkjQ8Gڛe[Ӆ:z򼗂RkI_(m؝a^}p*Gf0pń;1mhMiKNqMpj4G8#<9K0],>}4T(2/=}~TWvq,X\\osnfZtʘEz91~ib+-gx\AlKU]y4g;Qc8lDPq^ZU6⁆|#Ռy[DS|]Jf.U&*Werau(lWy{xpVыo괎(`SF C{N)-tYvg|3}3YjGoP nd7ZVft%`f_] {_qp}US}sa erSCXtlx܄GJFӁo&4jwY}ϐhmvqn|BЀJS9v mTD ֹds|VvhCZ"0zBni-kPt"tr׺eo]gM;H=X`r哺=ڑi;S!;ctAK^#HҊ_IqVt}Gc=JGA_~h-w\IpC㟞R*;P?sdOufFy]t̢&#bjxh)p3rd İ6moZ֠\ɶgRoOz]X#[jDD_pVRm&(QbY{} xqT$Ѹ|L`s}3O+zdl_FMk@r6&SuTfF|&Ўy+}Qp\wHNgG;ŲsZ|!RbTfP)]lKtD{m]1c>jz׿;E[D<^:$Ugvx<g̒$Q(9zHb~rڈ+>eqg+p6gPC}g*VTrZ;[U4Lkۚu0_2^SAu2_utx5euMWv>I7pZX1:g`gc_ڤړhF3T@FwveYJV󊢉Bm iʏ̃*tM7Y튃BVAgIR/ePگuǩ{^~MQifiLTo^?uSzѣp:RT%lSXYՂe>#ȉM17Xo_C~$|sRuH)Cg.`fZװkzVChˮ\t$[w.c788rsl"n-LtmH莛Dh'8޹pLÛeww*g9QWǀur&Jv{QЀ&pf{GK:|b4E\k$v8OBp G>bZvy>G]opsj Ţ}|}vh.w/6톴bÜ;BY[TSH^Zs/l7UύK)EUOvaRzuGBXBXewy@wzoS>3d;!:YBf|NX{_ˊL7~`4wR l~YrpAF|NEq^mtP(`/&f (seH4W=FJc^s}@03ǚ[6+ov ߜT_I*_ 6d,5oǚQ/fԪԻELSEu1]g]rs։o_FsaaSY|idN d*ar37w^I.;"boFbFD8U7[)(%Ə|v#(eOm+U];sX|OZudVR1V=QTXely2\9ê:dfmP9|i0NאJ/tOkOHy/[ʄBI>voKD)A 1Gہψ]_+jc{T!r-CDj&KW}IN=lvzrNkd+}夦pV#ґ\;f|kl>tez5/AͿ#Yui2{z[p1>"hsRggAUbiu[7F/r;ԇZHZhDbв`Vu`7f4eLF~|X1FfpSݽkZl\ђbj{A}=XZ~Sg0~\Ug&aBEkQ0πr?qx2oɻ4ZvWʷf?0D{xmmH<эH4SzX^2|bijϙuz̷G1yEڭ%lyqhNҴSam{L8Go\}d~Z=^=GՕJiKf{0Un)S=QDtc̉R*98wE\?K _͋?x؇ĀT[|rmp4ŕR)ycRm}#0}Θzz3^Xb5şrm+klߎ_U@\ųz$a6N#>,F\M>](yw`J(wCo4B|{xIX$oIhh^[?-/[eÍ0kMfAzj淂!Ģwg!yE]`+pRc,?"YIURȳ)䧿sāLi=ou_]i)YV$%dۅEg-LTj$l2BH N4HFPXŗ}f(@W)UO.PVqHUymSHۑUBklB8y,fωp@kV ָCKOgˆ=4}HW\-6?0pcj[vRW^rSSqowMx5׽I<+gly%45~{>MmE0I&WDt_TxYxiX*Ӧ$l~s_Yq\iiyw,lgqBeƴvrtnu0rVЅxt7_~;a[olX[m}^AqV[;:T˵DNB4nURf:q3/jTjs8\\X.PI66uĊ`(4YoDpxxXȀ#,ARb9[1|‰RA~\﯍ 2ldvI b[t3:=ww!Wff{r[餫ev]%bqyp]gMƣı4U{f]VIap7a_x"uZ`Yv}>Ld>"L+|ʹH>[/fSmy_^X|cq~Ҩ[nodX\Sc킱Q'eys▙`2PJZT(?ksGqj8#xQMW@`mRXkqJ{_KsMSkQʾ18(fEU¯*^YfZScџn<\\>Elr{`{{af+T;bs! GMwehuΪAQ3+ĕe6}SYOBq*vFAc]Đvsf}@!1ou3-{Fڝ#bzL2hFkejˍ|_:Z*|ԩWD<2Itqv|sucZٳCu-6YqWGH@ZR)ңj,IZzFdYyyt7xs9j ]bMnoxYmH`H3%GI^V=_ƞϷHoaQzZSi牝`@o_Z42vҞC_RZg鏚߂4-1<v$|@kwyq.Ȓb`1tsNNיX:Mi%]nP64jou0류,Sa<Mp|LIvswn~PpW?PGdU*[pnLjGlvYYu9VMtwkoźDvlSHuk4(Pk[չ3-5ōnETMu1.-H$,\Ks Vsϲվ/tp0aXX}ʼnpwaLb|v^x]^`vTE7eR3lhjvXPJ)K"/9ږeǂ}TYeH qeSQ(Cg@VBsvYntz7DT>ko?ٞfR+<6AdюWFoh2oÚVAYD{ LJwK'^HLaBh5Ӎ~UlZWKhɩ]nmj@ZmR*yѸrdVhC$Śx괷8f@9sZph:݇ͥ[y ѫ`9ixTpfܲlLYƑ)E?\d:hw~~UmpR:n'*Y8}NQCDspMm`_ݓ4Xu7lhhMw}1qfQ>:lHYɐqCkuƳéjs3sg_*:`ũBsϭٜHpLꃭ VLb3lړ\О\w܉Kf9uDyOFѓwi rD[[>,oJIP_>|AH5 }kGdJap|IFNV5^7xXlS0PuorQq^U\HdVJ?JHE0dOUg!IMWd}gvUA]Vf^iz8kF?gslj\/Ew,gzUUcPcN)7K썪JNza\_KEPmq܇wڞ&ryFlmfYjdf%PN^ZvpYc{|t}Q_~XR[mobs{#UԐmsjh^ꅳ^Eh^6lY=W˘WKBRdGk䨲Ӂ;Cz|ΦY騎EW4Fqn>tclYJ}ʓ6D(IjtB`TS_l*6\y:Ynt,F-p3fuCȏqjotpLZ{̤:K(wfeR(oZ}\`vWϧ;QZ0%k۸ÀhHň?c7A[ :hl \x𼊔{[X+:~nG{Dgɔ7-}FY~{ILv,bcZs|C7ɕNM?CmM7n\|>T[g*a>Y`L{;,BKXxirՊzE}7<CW{_^U|tLv, IiǒT)ݏUxJ`.NZ{B?YkR ׾9J~LrMd8D[srg{U7C$]C}/4SD\hȢTM`BȰ|npI_sXTQNȏ\1رiseFLSFA˷:ifltNٮ5 xlN\.WhaZt3{rYc1d5_^#5enj}\!3>^%2ոˈms֖Mn|ًPuH [n) Yzikzz-I5XZ@Z;A#J##s^[}IR:tZw[yźf3tE[viЄXXp(ܖZ|6QLU%tUj)poxht[Wꊅ6lYgah?(iRlMAt4-EGai5^Ɓws^WSURjgGiFJU c2'w`W̊stqcWZ*?q鐣}<*ػeAp 5`pK*lkschI[}ixPB ulktOp~U;@H0ۂVpqE\ˇ$Ԑ$n̢4y)#0m4Y[o4ez7a&tuAh蚹~F<&TVxLvnҰY`WrpIPByzvVPu78u-E3_s5Ȋ:4lᅴMl&oĸ8NꏠHso^iCcT"sQ)k?gA;;JW&8!MȟMnаv7I.zn8b1\1\8،"kL>Re(zv@~LK7E$ߎӘ'/B+i^p!Im\(G KP-hU}vY`aniW܀XoDPRɲZu-8\ZlVA8oҐ Rh‡hp~l=ߑd]^[4`I+@sT}Lg:uij"y^Dm~J,i}ۃG~U:erˇ--Pjt~Aqzsm[YEǾpiȲ+'a&IۂbCDoiJu_,ލt,plovl%S9h}|Z5tǸa;؝^)Vy KYPH61XozpUWZGD|D+_d TiIb`cx;q݆!nQPVUzDm̛([ۤ;|Uw!eQPw$q$}p#kra3LЈ4'NOBYRFnb}ΈRwrDZl6y huǦ2CXtWzcueŰIaXTj[~Ml)}Dp4c@mݔϧ\`30;JxWrQ\?]Vhdqc` YfgN-.QcgF;DwsVx7s)Hz :}&0L_MVFEt8\8]jKvs,RœOOg@ɆhBץM`x)"83Q٧`Hh=]kWX(n|[]j=YTduwCuYB=|@ll&_Θ~Y)ajגj_cwb~:^»I:{1etp\Vk6WP I+Xu`)gOqYTpT7ǔ(%Pj떪Ȕ=6KQ|YHhrcYRతL~rǫD'ñu&WmHմdmgl n\DX|Ig16i`{7ęfPTDJ1iAZ~ԥ9DvEl-HChSWcGu*v4sy5]tuU7lfw%p`wu@{JkAuqcq AO_r84 0@~I{{o37_nLAVG'>w43w=[t&x']_vtap!QIgrPjԉ^phӻ3laOJTqs{O/lwd-7OgcofNğ%aM{N#Hm\\oIօ]Unk}LPLu{Dy~mTW<]nX\ChwZVj`)DT]I☀-SMgxft{9g^~٨'6ỤgƠWRzYkX_{ErL?vDi~8[^qzb7`iv;ڵrZyVv>Ćq>vj \aii[U׵{Th&Qʔ{ݭ_`Ts)mZLѪ;Zwe,Q%F6QSEx2e?bLBL5ΑSGYz;Ga_Hb|a/5HZG-Ko0Hj?@㓂5k]A8ERvzuu4mhcvYv[*h2退GLeb?48UtvT̖igѲgJmnlT:ZRa4@ŖJC3Hq)s\"rlxpdÂ|yt>hQ{MXZvu5KJu}.wf}R% *LwVS+vrYIovwq/0u]~c8d[w'Dyv\7hyf7sZF_j.9azBvZje!pfVBob}s*WI+R?T ˅bMd ڻ pL)Gzna\(uvuKfo^kLznkl4pčsi~7y]=Gu8a@9;s ī[%LDžrtN[LՑ\K7Ns>yn+\R{#qӆk|9vpHE>JR[xqrmh?H XMW"Fr>RG~eX4e$@|3@xD6_@[[qW[,匛БGj_glW{luMđQj}Ok#]lhf5I|xyBh(cfNDiߴ89 ]RCLwZX_fĚTタ=ᕤWbjDvx?j\l~ÖoY@Tm*hYuz7'XzeRZK-#uv_xtePyem8y~ Xњ/; <,j\Lc@f?e )|pSFqИGoX2;iZo˺:tEZ٘~֨g:Y`ܝx~sdw .dm͒sEOF4SդŷVdOXJ8N5۶5 |KqZt5[!=vMjd9ly@3EL9Ė 6xv^݇tf/y'\oQ0nyJjjxⷐ_&60/mLКO~y(n`PzJN}IXu##pyb^[_Й#j!e@cgӀnPFg9Sdž"{--qҖoÔc6q;CCeZ_ ;fZRW_Uu;j@|GFr}NrK}م]U J0`@PZѮ\﷜!pӑ1Nk=|pda@P^L?RrE>v"}[+t]he|kڙteɴ'Cךg]I3ߦ@Y"V(q1Ņވc$-eC}ŧث.|B1L\;DbDӛD]fǹ|d`_<,>]OXcfT1kq0Ym,+ty]tUJ=.p$mly\gyn9>uo(v<χx^c:+GAŽv!BlNaˈPƒI$3N|IhDyn]{-XHvd5FbsB\KžXvr(֊_)~kJԫS^L1BkƼVi=yTpæhmVЫ`=Ym6=[/Pq92fl~kD}'~AԢGRgBnc=%}L>5y.Vc\~f[{diK]^4Q~!n`z[ix^<.\m\21] `)ofoFDIqyPZǢI%RSUpoSym֓J!\g~%QYji4 g` }zrR[=RXӉ\{t'O}`|KX`wo9p8Õ c]bxӐwHht(i~jNzr`l˩kNc?VwН,Cqх*uovҕSaBl}~HN8+;mT=޲'g?6\EtYo5!yqftQNrbyǓ^XNdҳ[daaVpvq4 Z8Ňv~@PXeu-QC)Ca ^LXkn.EJhOnvmOsQ!*>.J@w>z013@H6JllF/+@BVv\UvTXG vw K]x[Y|x)"7^ac{pxseWQl*=Aq^4~7AMsՀUdp#]54lsdz9VV$8TJ5I}Nѽݯ{w^)8׆7u |RC;^sV\oS Y8YXY΢랍DTgTm#!Ih/S`vrp9FXW@2}"PdkwLc_rs0CGGxk)>ۆYnIe{OPgLp5a?}xD~1y玩e[Mp-8SI+`vИ *KCTDU=8œ^!qHh~Ja?eZfgZW__a0 =|Q jkp]C..ycr\oڱ y pHy}u|t*dvJq[-b{֞JK_^P1IhbWcNKA^Aء۶2lcsy/fQA/`Т^@sEJIr'~om@2e;'{ǝı\Ul<{ jGHn[ޅRC󔤛j&M-_Ƕ0|`7K+3p&4gڕl[5o7KϕX>}Br`cGNĞ{~fbF#kWgO]8m,la{3u]C&-z^QT3mzpsXXצt,r1~CwvpMgﶈaրXN:,"ה_Bj.bde6A{*_g1bKĨFPSWz(z{nwUm٦iMH|x}ʺm-~8_g;Ӟ%pSz+I^e{6UViA_mL t L9Y˔\g"grEh[4ct콰mkvqTEiK,P~ipKt_7Sy8xG&[\#T,iqs-Xy]3gwUm+CM^t.Hr%䃀W{HTCFB;6 IvOl[L'|ÙatT\ը0\Mvnog;*Epĕ/y:>8atVYNEE~k#Ub.g}"zv.nzQA4<\tArSfu΋ Hfӌ`Qrr&SRO]~hsnxpb\:HdjYP;ufLV˯I/TrKGgkpMk|}~g-(|9ք 7TPD#lNwpYPʁUktpklC? í~PrFӅncs/Bd~;yBuKO_mzKiw'm.Fv7Xಱ!cW42t^KN͸5q`ShYZeE};d0m]ni.2hxEOCHXKni#LO_쵧pЊ?#]aBzkzWHeoR`O_bYFqffkQHHz-L`u[RLi~g|I{:ļEtGYJN8|CV=yHreDZ~}@\qG\8M՝>CkuD4qzf)D5[2ytu{CvDbhe<(6hmJv"3nu+/\X KCzŃCI8x%ì9Þ1PҘTjY~j`ot_n %wvE|dbnK\~yT3Yww)zC6ΌCSΔjV>Zz.ɣf[o^g}TZnb8,т$x޲Q[Ja̟xeLEQZ|\T,ǹ[څ8h^W3 6IaKNAF%o|CM/3Pb[oU@0٪sso5[8uJuVEoާXw>[nW:\G[YƭV@`mAX@sO2kG`Ԑ#hxDST{¼m~[8M3PQ<7[afhԑ=kPFT$xupxwI^ƨݤhOu{ ^8^6nv?a+"ާ\ DR3뱟pp˼Q|b\zAW@ʓP B@ԋwXֽEBߠZyrGe[gMlRЬqkө@wvcپeε\MSsF3eVS0yhlowdbgoʠV^m誾}U7uIع7dvz5T>wG_@Z6Z!pxn`TE(0Tzф|T8~?G[XtuF;KT4qnGx?wxr_ Rb_S=}L4L9DؖO#~wWy*KzUlc6Ui)bx{2MsᬿG%nz3MnT#a# BTc;jBվͅ@"xC^#Z2ˢ`mJ-W3êbrݰvMmzd,Wav)|AG4o^:rD̚`O\glaEtVÇu]6WlTUu+AYYǨuNŘ=lwYrDjFGd㉡9S`ZT0[6ʡswVwINiv H=]]HsrfkYsI:_/bDbyXsqi͍8o0lfŎdY o`va'NRtb`؂I0?g^kl{'vubfZE}JY6|;FGS[+]il|֋ĥtp~X\]>aogoԘ|#?\i>\zyTS&'PUeuV>+sCl{jݕUp[.-s`mD!֫_Dp0?bzc{dBp\Ci@wk4[X"^_zTfG&%ȅvTF:Q_@U볱9<6_vSoQEbX]VSGy2s%d\pS٣ `s{q{^\.yu̶0Jvn*HrϤl4rjlquG}3K\cڪMg}lh[T!|EVR֋wYV'7ƨActNs'#VuWmNT198ŐFrgGH@~+6gZzΎ3Ibe^X^t`eƐj| pH9xc7hACfG\)KjUwj1V;fndY?Pgd[i+?LU^X 쪂nb;mPu`/~&ey5BvIj|`{oJhJ~afzJPme/gk>cwnn[\4!A|@MDeii%:uѰan fg?vot(IƺEB9_6+d`Tfw9ؐd0MlS]3Um&|ao~8hw^}J1|HS)[/U _=ˁjnc575&jx*_g-h6NPRb*g'~E/{oT7;=e0t#>!7pjpj9u}p)gYQz}K([jj)?W ]+)񏤄ٙ7Z'VULKJPL\ɑsXlsMej&Ky.fřrK^II^v9(LCp-Tw]ڶ^Oe"~ScwY@nFC@GCN\Bׁ9Є'VMKgB)}vk:zfcjza8ONz1CUc>mc6%-1ʊWpN`kh!! ܗuE]\2%j8_brnUvٗze׉ڛtPMɤstg:gu6`]V-̙\_kVh5faz^I`67_َfmmݓ2ONx5{k1?eDyeFɫeۂILow+;%!vex~^e~IFK}.m]0f]z4/e_ÉHDnFmow[ey NJJZK\QӣtP)7\K RS:2qpr~fl##LlMЗAŽr[3-]wnNNip\pTqYS}")u}\c=dC(_z)1ƈ훾G6LSP8Ol3}m4uWfu:d刃0&o87Z\Zy\hh~w81O$4]\f^UK~۝oxTbz=l.8-9o59MNON}؜.n߹Ő1:rsUd4ciBUs~k`|N1Q-gm ps~9s1-4 4}YNG{jrMmK;I9p,OԸcb!9خݶtcfZBHE42[\.;nT%4ƈuBLvZpsW\^z,|td{Ѹwj3ek. ynC4+á}2ȝ Ѣqwiϣp|8D-R9\X´ov8$x3.}ĉ}y4#|@urOpI&|MsyZ DZOLPÙ[3=ZGb'ru|sq-ξaG{yxU!} d6+KҘWQbpf^|< s>v(7uNkyɸ4/+kwI(:]zjR."~Ǩ-?j*_nGt,i^wx/kܟwYVoV%m\_xYrP]j^?~|YUh&Kd:9li}NeoӶe'PxyOUum,ho,iRDžp?SS7v?â虮2WNf?u;Ѫsrz2P)]0aESŅZiA9Zi)r}[>RJȹT}~zoMu|}Sw]~`ef6DFYHd\zpKS5eB[k lԔ,CsLp>&qmAPt֥MGY7deOI&hFtK`W~^ކE/lJZ*_oHf̓z4n_h{zb VV/\mu=zB{-rK>rH//:66'~~Il]JydPւ`6fBcPg\D\ufn߃| a|J8C\kWdz9M|~išgCC$V~j9S vqÚXQֹW/vmrV跻eeGq} ``Mk~]{ۙ|re`vaTqD;dTSeP%֔ דK+sg4ז45QjJ`v*X{E PN2u\kI:lZ~Lq_|̷ySj,zK{wdivDx`ZUش5L*Zd"ąphY+=DSb-lfQ<'reH}*t7}r0odb4wYֲ}||A&aLxR[{Uy&L`JI>ŤJ|gDd(RGvQs;|_RR~A`UtH2qR0,jJGVaGveJ"d.\mn^ WHN~`"q\drkɾKm8EM#\vi|ڥI(K7+\KBm۩*aJ 4cO`YKw$!59LKL-|RyrrZzVsqryn_yM._=`]11SqeZmuV~'رg7Xjhm;] @(ihYreC!ΎGe?Dm~W*._C>d/d 2Lǩ+FԊڕ>vGMc8nng7Ex TN}ԇuk@V:rwpSgIskЊpa sPj^;h~VnK\aSeU=[7Guyi!d{5v},c+=s FϮĦdjbmԉnHtsy"'XIq+k`T{5Zm|P]wSA:{oiZA{m{ggVGUG}kQpmŨJǽO@C洸cg}W\[~y`yjSrq_m.zsq'zfʾ߸\j0WM|pmه`+n^HseCQyj[6VzT0kd`p3_t mm eei4dWZ͊id\4ƨ}%{ HM=eGyW8qdZ]&C5pPDZUGx]o|}uj UrlF0g+J9[dP~Tʎ?oe@:b~D~ 㱦~:VyGKeÀTY̞*ҏV-.Czjfm:ˈ[sk@ƍeCu_93ޱuomX;ҀcJ\6|ZWeɊ`z6T[x^ӿLCàe9h49kH{l̗l`1ml[yk}Ɂ u4QPĻU)i!v)U30yNdu^=8WAv:L=(~=mkp,RWS۱}5/(;[광gIv}bg_Y&boRvZ .|f&ss[-zuԠESoTYMߧifeURؤOTbBBqXAxvSuʍ@]\vw gw{3Mմ.[M\d_%1YČdPnca^±29K._e=|p*I2bLF}CV=mKFwMX>a`HDMbQW5rCvj3c]gs5GwG=ŝfnn`Wvc67pNJ}qjfevqep[d}1cHnc_>XV|gqp\ֻ|gu2ݥ?VghmΓnes0{:VR\@ȢNYYt3>Buh[|RÇy'l7hŖs-W>aɥ@FXgN;l\DRrxbƚ9g9$Jg&Us_8{XlGkn{~Z[{w FLRtkvui:쬘gH__߿U-k~2fhfDx炐v7̈́ &~5>^8_%~F_ͿqnO|ϓv`AgKi~}ңAXz~krAm_g* %$f[qS|hcCxizaaFui_ntN#uok{RdRtXA(C’sa'gfZoa}L!郆kr4eaKܱ&aqJAutgTD覨4/ZyzgT{ eBw\ۙԈDc?9]ǸeMTienzVoP(l~HG'˻Vhh 9aWwP>={qVk]_!ϷcY+m"T:kXwiƠ[( ޚX.ΜuA"wu,́UtT>i3:W@aSz7vP9kQcamTrx^y*;JSRpڸ\RSBzqkp~a}~X{xinq[5iiq?ַx2hu}I/iVh򯥵ny\ cqu-dDuu{L+o$xJ8C/TYˉK3LmZDt۽Y@x;ladIچ {J=POZP=_Z\՛PimAnz2| =kS]"MmoBjN vT[[yIp>zr]i_Jj*Gz^-VOndr"S×2I+^|7v#(bMynrE.\ݳ}[u 4-}+nΑՙUNjJNu96x[6VI7xX^U:64Pz]+wX|> YյOhL;0/5|Кb$Tx[n5C\N%#lKFwp4NiԕX [<}oԳqh|xOۣ\:Nk_ў7niZg}]q}FLLt913Ijuuki:S~k[j^PSqoÇMС.$^y4C PS_B^tpz=RaTMϏ-ەzbvW؈yjfmp].<~8O7S>y嬯wOq|U_MmPe^wOrkWΡf0`g{蓧h#GXKXJeXBx-}֥^[TWh0Mέw`Ǭ.~uafbL}{~rj΋"0MZҨUXDJ~lzn^X}*gjCX?rV\o׈^KseCƠ;el{fAX-[~ؐmeSAi7u**oZi{[:tJʕ{cGw@\} ƆDP0gC~|;ΡXѵ??ˌon^@Hykg)o}t69ΤUSE}2|Af9î0loxucoI*ZcPeŀ\;l҂js˝uCruRH}`C|9haw`1^()k4q=^rZgO}E )ajmW_n6*ms`];8S@e׎r%겕Еwrz5zBmy Ν}'i\@cpM=?" o.yX_aCGbʐ\KlaJxΖM`ME+VTZZ>{Azش#Q-ɮO!m}u'A'mh.\bn8*K&RI4SL{dOa~y_zd?^Z>;BKiiQ_ll9iM]5tAj\~d\3dTU+Û:"QP& sQISI vJ,-q*-(T1fdwanuwaIpgYU2}`8d/z_YB]Z_mxКv;Qx/y`AʄQ&Y8e~(H(=;5>eCrSk99SϠXhytżjq]Sh:̰i{@k R0^OhYDŠ{wRafKb}aB]+ɗ=lLZCPf@UxiVg9kv`?ŭcKkú/lŲ4U$cU1[oc>N I v`}Ui~a'yE@0f?kԺs5L{nxYr~3)@7ά?=|m-ldUxާ0H9cl]\aCuI9xu̞G}o|f1}TTYaKc-zo)1("oto&2qP.m:i(yhG6r8K|kUtjP@O?Xn8}RCXctmrz{db.M; h%Hl.[9ǗS[p5 [}֒mbN`NkWRҼYv2a:yk[ndpxU6/}Ql}p'Lzqg}]|Z=(KInJrwxӐd?CYogN/oT-Q}CRbO\QH7-\IRUͰUgfTQ}:V]>t>;p0O`9TXͥ|>{6h"ϻb9S0l?isMNЕDy;jdM q` a wv6Awr?dzU8y׎A:UA\ʴsLa?WbyzбY~/y3j]Hd3G}ʦ+rw<_yGC^efɗ?'2]V8KUXٝR(oeZ5fՇdrE]@b]]zmu}bf=Lf•BhA|nm'qtēăʩ[HA)Zx#Zy[hѐGM}alҖ+p쒐|k|*A8+Zc@?RjU3N;L:wM)Y2%`ke4uP$yؿRyvm?=AIN,^A_ xUEN]cRU֜T=~٬zd}5ZD}ou Gu[aLjf0{;PWku\VzǰNlwlRj{׳e{/:w2ëqqw90(vbR,P|ɁmGiɾd!GXmrBԻto{ʑp}|jVtJ]Gdj-b׏`aš׵`rVTe}p^OQ0v#h#t!^-oeyw]SVh)9Wxvq>iJ(} G_9 cVCT9zrhn/ eCgס`tbpwThX_S_\Xo0].9QPsR \ Cog˓˞Wov)B2{aehh*,3O] hgJ|xc[7SaQt;q֍tfk;{cpHJ`@wa쬆}J V7Ǔ9][D`ȁQ8kT]Ȧx>W(h}Ζ6hsZ z]N_hIV®N{5L?bƆ(|Ɏw,Uy1K6!yD`egPcxVcD'pSf l@BpC?:SNaKpSJ!AmfxNJj?Tͳ}qm@,yv9mx߮jhtzѴWp-LKtR\c ZMUѥg'iCyBe[]_䔊/~6^鹂bnʐ:Z|]=^hLep{,nMqndsQM[zL<`t{E{Fvn[̑HwS*3>HT8kk]w*y=iaWU"M0j#nuU;e'ȒRάu}dL|o\hsYKN[>k({nm@2\P{wbgyHXSTlzV~dcTn?%͇5| ErwZeU@{Dq)].ڲQt^k!KY'i{OMmwb&RD{NNVhdF zB8I=~pS>Bf"Ýw,oXSL:lW^8|OaJJPrUdeql+Ns/ZqvBt^~yDS9^yXc5T]}Qxh0;C>~m3<ٿlcV/Ѱx_MǤ{Hmvhau8j ϊgK"lD350Hs>A[plnN򂥞f"㢽wB#8gsČ鹾^vv@S)uLV}mn&\}_h0}pZL.B@3Jf)#UdMRZ2,_@Lqd΍+|VY\'ZŠʢ[`lgrHu\U}n4V7Wd;u^M]U@aw_hϨM^~2*sdЙ8N]e[Ai ƚ]8ƹ"'{}qpUm_\e/F/t߯ty'B`{Eq8jga|ie`&Ny˜pPMXIPr{g_~JwԄOюRsWy]xFdjQ_[\Aa*LTRx~Ѡ{svc~R}xGu|@t.VZAeO߈^s2g=ېR8`Kn,b+Uϲ 5_Sv$XU֞#wnFxqysH?8p}H+I|~O@`u;l31n1`%LyVzogRē_dvl(h?i$Zhp\g`cyH[]tz&JL9_{=~9W{`;.{H~<¨Bu+8+&PS@ћ.G++ngECoJvJha z|](eLL\oERlP^BA zH:YS}q2VNQs[A/v+vyY\8qPӊåwr)aZdvnj4HȐbfxJhlW݊q#Jvϙ[h+Hl8{XXlW^qlgKbw7ugbo^9d]w&5zibOm$YYrc_N}qAkoyhcMاwEut8zHfR}$U̮L\u]i#j36mL.əhxT+ziPjLC0B]fGnwgS{QQ^gkV9)J[ KʵV$,)tƌE]Yl_ #cv[cwb~T(ŷ#xZt:N|UpT]j}y{HO+M]X\j?gSRRWUƙm |M_6 VVtCfov̉c ֈ-r[!mCWSx7wUÓ~B U{mC cibhZ}jCbscx,~x;xh==Ndhҙ}tlZop9{F;Oˈ^־nNƓ{{gBUDFDFҼ1^|1kGGx1^H.Ӹdw%stjeîV{AsL`0:@o,{'v[ל?f|wWkgGFHzy˰ހ]_^imuu:k{8$OvBO{ϋOegƀo\YZblsgтqW9 wlf8ǠHJ_bMp^Jpь&ǘDffD}v/Փu\=!p4qGPbi',?hqCiT}rC2VUPmhrn@c{&}QD{NŶʎ%Ek|_C\YVhoېo}iz՚%FihlCrh?YsSzhX~„}-P]P= vлXC`_ =GkłGËbAxGRL&-^==|Ͽ5)%Xqn^f|3]u'BWx^>gđhׂ`)|ioSsl҆mO~>%hZnxvcnY1qpy__D[ci7GdPIeB: 7ʍ9]a~'!++8QdAw?q5]nQB@_mR=_eB1ytіLT{ЅVaE_%#}U|uN~:Vg ïx{R 6bd:*hdTBŀSzі[mEX;.6fwcǵa3d{bg"h`iЌ x{פyr߷j8l|X|]nBeWE^gdH_and#=h5Tj|]i=WeJ،HYƹh-n£MnBK&exmt>KrziZ~pBryv'߄fz.Bo\|vjP~OZ+OoBa^/{'k儖Lt"_3[z469>;vvR[w-NFHDX'Dvv>$_{q$m!YX=nV(Sĭg35!d\vBpʹ(WqJm^S7Ǥכ4}SJJZͭ!˨Mc8vs)Gi3k`GK&iBgvJ< աXy UPð(OX6^;-.Y^ (T_ŒX-R_1Y-8Li{FW\˔nDhvRR6|tk_1S5\wX-ͬYunbf񐼰>Rۓ`smE?+NfhZ]N;z®^KF;OگF,7nPt: Əd ELtwg|nds`+Lʊq_<Ȍ}]ZU~!u^v~̳Xc|n1y5IaSMFKl{7JMnЯs=vB({};ޤ-z|zG:^v[~h.oY_'y0Я:iձ~ӭ秿!֞@pY\6eX˙^dgT0=~ c]wewyRN!ʋXY[2IVqJphґy{zjbO]_={Sҕ}r_{\gxIØd\N} m^u:v=M=Շbx]eյ(y'򽔌X#[Yvd{rpP'eTCrYʜ[[W)}oC~v:a?yZfI):T3IB]WЕvwHZxPHd͊%I}Pr,B'ke:xSyLݟb\k\+O*PwLr5hd.?L!.PlLgTYkiR^|i2~Nt;ci7t(f[ap4g{ŸO}?dk[}m|2^negJr}D_u>^q$nXcrS~jTnOqӭy}04@6w*jί&3+g DWn8fCxH*>8Nz<d{VRLVX{a~pAg@.JxIcm:o*]د,*sl6V} gt޻G햤[Zxzw4~W%&Vi]gZzzֻbmq𔁵hȭV_T6_ZbM<] Bq7q Lwrg@i,S,R3HbT.,]~>red[;^m*FFm> ejjU[M^"weQ"\YE7yxDh^`jʉ\?a%#"uŔf!W_wo`ժѬEz2uN0BSsQjmIsH|<`gj~l(:xwqe]2ۥ )˃|'D~[ lqOq_ڊ2: &{QqҬ\@;[EӫL*Pd (ѭhes-`ITocև6GPQ?Fwc fݟVq*=ŏ5Lv~YırQAUTǺl ?Lqq}nn9YyhʘHxsY[gmjbڜE+zt==YZ6Lt˛v%MB{_r:۵%c̷ߠR~wjK\I$槞aBF.ƀ7iU_d]0Z| ј蒮v9Eb}b%16zU=jʚ!|Q@{huUۡXvwܖe_Ϫn˰{TXSPOu̅1- m?sz]{_;YOpTAZqbjOdxr{ZYVOݩlKmnJVhdge-FkmfʽJ`HI`0sVN<]nU`F?=WOkUwK}3jz/19eKUIP1ug=>3?^MX|ouVV;DDa/ėj4mM['^v?Ykml5Ejƥ[VnCȺsk(vj11@攲yn}}oKI`5rs8^L~PPB^VYSRl3]jRǔvk BvdYqbdFR :yRGT8_y|dp8JGC4V)GBpK9hem~v?z]/1mhy}FkVB1%/S+ZeM(%PV}L}x_pCչkk"hP𛇯}Dyk@A^5\4p0\<\Vwnbk?s/&yA5d~^[fXQOz+u_ׇ|n{3[Qv}|FtoUrW[w`L|U{~Vko>;|RzPSdiêrf Kk^{mjm~E!Sb_ixˋWkr}vek7kbu_rf\g[7Yy-\h1}wCLws`j4H!aylϘe׵k}rv|7hɆMl/TD]%@(]`8y lksd%yg >@R7ye|k AdtnBpxqfzffK`+oɹ~<%!UipԆQ"UݦEpGxыb ǓoAmz_C~]O92ix`xi5yӡ䢅znn)oweMS<&p&:K>=eUxj: udEGWqmFIJHIP[&i#[쐳˓Am%{JlwHW1nkvD6j8s zts;S^aTh@[ZJC1gizoY{y/J]xnڒ=knLREo~Isi[ma|QXv\KUvpbs`k7:}hl=PNo3]>AG9OktiuêGueu3qYtovc|e9Н\20ueynqbH>cD-t~WfT7t3gB15hmhU,\VU~љ]t"B!3Ɩ|f.'z~WQ}YynNԝ:R398fddz|[[T._1zԖZ~(9Z5c"O^XuUxxȝk."9ki+n8V@~S&o@ubѬBa/ЩT\xzzYWcLcL_Tҋ=oG?Tۡn_9FJpVdʎ܆-R΀S_UMd 3z'SgpG2e)Hw6~Gz@\P+eQpwAp3ZLXqi+dE3E7 dllnOD=?tiuZoϏ}qbkoJOwmf\]oRzt~B5-^n+k; X A U\۟1cSf"XpOtC}bgÔ~xZϰ|(d8F'lyu:Nfp MUfhWnږr2`\\lՑ.0tu-)^ lOfs4+}ZKOҪVO]'̈%崌f'yiơ^VKj֒XU7+NS/nSvr^XTVl_w}To*g4\;OfRt/w6xjTI.tHװ_uΡhpG֬QhH+?^wD+~Ldo*4 vťw{nYly$牺}P8HL])etFahjO \iO^+~v$Ϟmi6pK;pE$RO_ cyyZa)5aY˗sdzjoYurMԬ~Q4\]*\PHYKq[M\X]^rvMEY̱ZuBF^Л;0|?-e7?q75Dzyo.@i~2P>k r®\y}6\oPhZGlfoM;þk`PhQz}icd`VHێ_WQt<`a@O(sY.>ӼnSNPbN>w;pcmH~Ei}oc#oG[mә<|M;}lШw I'ʡwέw@]C^&:Rbnp*Tltlɽ^tm@1kpV|j_Ǯy~i`yq^LHanpl,-mfqjY{HnH#f-OdN69\c>Tyiam,,nX59;Eyqm@]d*wXn[~lٳ|Nɝ`DdJItm^.[Z^|PG湘@i?li]`Y(Kt40l|[Sp8dh^x930a^W$?^}cvZ$˻ˁ3fQ$2KI^nbcckttXaNxtLw>slpwnu2@oX^b[m,01pՖ@h|[]FTn^Tuszio_mZy]x]XtDde+Zp)j[Ppf:sŗ"b\>jb9vzZGMyk{ njG52VR!ZƑjLy+Hkfp5Tl`TW~ԅ?(@|vzЀkg}P(C,|pS1eu~hʗaytZRMM A|b=v+/dkWv`wh@>m?=VîqE~o\d;SlQUы~?`tZgJuSjYTx,|r8}ȊmrnהZV0g~Tr5Z0khߧ7^4IjTsCgRu2/dVG<j:kSkvwا_uh>8ǺIg{ݍ^{z"cFiSRAł=\\TXAiˍ#A3xh<Φ]s=3I4]kfI[q@o]Q6X7|Yi{{_~#/yaxwrjg8SF_ter-a|%{PYzs>ν|t8\@1ueϲN609fs6hQNde&8A2N* a/-lssFnnZ'4 mVCssDR,k+clf'Yyƌb[W{9aYU4fru|8|/Gp>dqڈ|Yқ\2J䐦bZ*q=NXqEhPlfgFkβ5Ԑx/,~ZtHcT}%{>Rs3H>9Oجk .Fzy}j=(Ur f?~cj`o_XysPr@OE-i71CA}X7Ik]Umkk]Up\SEddZ\xb_yGn@s^k@l]h&?fnFO3vtPofpYdd@N_$2hzwWd|Nrя^Yy>Ù_CmVFdpjn!7;r}\-O;9mViqW@gd`5wB?~exs+mrR^,jd6n[rS`sOkpTZL.Ö>omz8+ Tt?bE~nwz-'x5y[LȨq qdo ;+k"{JMvWP\eJW-m1>bgo7fC]okBE<1YX[}HglqCOލznqnbo~K4;yd$lo՞0y$rztvQR݉{Qqg?bF۪v`~e;_cAҖ(~KWqj.-+qoch-&oVKѬWۥv r }XR?9>sQtk28~dAҏzΌwnroCIxΐZ5tj 6}|O pIKӈSpd]Đq2uq̆LewUtZg|X %J¨Oު|e\sեE7p(+m8բQXJ׳BLKpOCv7Db=^Bp :ёvX6`aTNhg"TtmgoH6g.A0|U]֊u+-O,vXfoU^W^&(hдxoPxk9T,v)#5&9~Ia3,m;SMpevfKJUvƁ+5dG3fT1v?QPE¼Fu Ac FuH3\LܵT{*9Q˛gm2HjoRTb5ėRywbSpur,da2('l|Cs?QdpH@ml~(K[âGd(|xrO<9:DbjR[nnyd]QʛZYt{mEtQxucH^~V{j"hMwt>\܏WERUP=YVtcn}v|84r*sݶKMc=a.bb/^p{xMv12p p!Iɜ2.&g7v|I3Tkԝk{coIy=|Y?YNN-r-7h_jZƱNT| ~QqP?h~uVo9la~ozMDte`WzdݶZb6{hOt|QC^zXdw ^qԅk?FP7қiǘ'r<&2cStSBwN,W)XǃTSO>K|Ӛžuxq'tg M؅bh@0WEw]ZsNV9Rbcxi k_ɶ+{e-SSl6}^hN،H1wkT(f@cwS=oR|@vާ}xhcq]\jr,:W[JƗmm`Űڊ>OƬ 12[^Rò. hYKcvlSocǞ'hdoNu䋍5ZEs޺܄]^dˈ~dw&dˀGzexPONUf LyEBss0RDmYPj<Q攚 ~2]EoLWcYQ9Td2ynmO\pAv%9G6+hKql_o>P^QoL"FF)_~J5K?l<\c:=HqH[fKDP.䓣}F@n\%Ui9LBe',FZypcJSn>~\T"h}MX0\g@T8[$)iNlϳ.hڀeUAuAw| EN[KfɆ]M!V +Kdgt$Txٻ"vt7yn2Z_i%y}%ő2XeC]*^SepL|w|)ML2qel}"<h1/BެtFU_eY6kAM-l[R!j\vMJ)tbo]M/Yp@Pޚ\ohYr˪ZnKjqCy]ObiYX4f֩'7a7Yz3X]b-G'gWGAvf&9Z˳:d0n[_+wRUFŧzUoԻxMoq kS"ܷ-iDyZ4y/~ƨmbtt]2Nb~&cf]&Ŝzwv2@8ejr~yF5er}4ZZC}eK١AJX -4xxB 8odzO{[4w^טOGUڛ=Y[olaJ{V/zwzo;Go.~^/K)v{eoz|•ÙZ{LmhEڑ^~MV Qkb"}7JJ ¢~ZKoeie@CrEaçF=|o0ңhP[cˀGFGb+}MefJoR]%{]@qGZR9s̍x=hhLKmU }; L'}] 8}knlS#{cB0Euy^U}fmq;OmtJVpF69tohJ\j-uI`}֠ 1d-K~/ȗZȳY·|t[yhF@]i~`K>ӅaUdfeUGzy^HyٕkeHy}n괍p{jk\[wFvNjai@D=[N[Ъo1|Shdul2W mn{Q&CYcjhN1βotǭqbxdgb]CVB|&~PpLFk}Pߥ}UYc Ҟ_eoh+`Jq>8mnanfL`̈́x xAƦ4Bye%yj d7›ih5jx8,VW&tPgt(9BKQnX`\ctYp\%׌ UcV0K]>S7p)W`N^i$%u:j{QelgkS|̂ج1DGZ}Y.T3i=~]Jb)4=,a|oQ;k-QM8C+fڸ_H olÝ)F#̘z3=NL{\}t"b01iGTXҳ䖰ex5Iu^j|Շ|lxd9Guōl1pi0VXň_E](bf|Ά}SxirGnE`)`n,&H_O^mT4;Mfw奈/SlDEƴǤ\htNDĽSZ-VdԸ3ЈiLlV\~Ovܡ,D:8Qa?myَoYuqOJ;$~Z:~ZG4~;rޔ*[2(\a2cpThrUĭb}}q$TN_˂daVs {qKZʀkq9)zmCjfbw=nqL$7{-}_yqdLj* ƁW)'vPd'ۏ\~=4]@^0}jg%nHVYjHse[BgSӕV~Yx\WSvn?H$bg\kY\ĐДjʪ|pC;q||qO9TW3AJw-CQa|1*@|#Te1Y͘xITbjܔrmksJ {zqw?'Ihg!j传e?A3Mo_!Vw{Hk?7y`ހ([gFbͷ,jnq}obL'|UG}u&g+Qv@\0UxtFaPL3\3f=q]tb!x+m\Af%LK?g@Y@ `xo;VT̡ څ/jjp48=mfkpP'_lXAGϣp$F{VXsYm8bkNdfRRbGPFyŗ?Y\{pPLyy19 A@{~R;'<$4u?d`)UT#ڵv0C}}ḆYG@Ws.m˘]i9\t"vQ3y|4]؉р`ҹ$+bW%`{~`MƬO9MRԽnRs"p;$b9Q(FCWUҁ}xT{ՖW7YD\b q.-wv0Fvqi}ÎfODJ^hE4yn_PZKera9 …dy&EG0Rtd(1 F`̞LDk]֣2_\f󍁐[5Yՠhj]gyQgyg{ŎSG&A S{gv2*ĩoXaQgCh0pkjdfji$v?kȺ}lSNK.vlOʽ#yA|DD{TiQ=~!~?tMrs3&O3-opuvV IJex]b Cn2¹Ȟ8P+Ikq~saʩg<|o ̘ĨYsb͡wFȣ.m{cxc(?8:Hh=Qe&O~=JC&rEϫSDy{ի%@,nlfP',g4g_?Bu;XX|jf;Db@d TWKTIB_e|3~+KzҠĸ*z dm{bRkjuM^kGP5%MxZc*͜O1oqqƸXˢ6o]g{adZjGJm~Ҁv1y1`.Jp#RRebv{O+ee{0tacRca;NnGNŖgj8.nS]i"Ouxe*}Z[ռ0~*96DSQT`2} 'pϩr saoCVŸS„rWj57|Y~5Up:]wWFXtOj>srZwbuo)7lQpۛXz.2:WeUr(Ҕ>;u?4iG~pbka64/v%7^Un!~Cpla?˖=u1i|ESf_,Q+ݏl)]=锰󳤴K}JKlaUaT<iQ\{xy>wp}{+s BaF.c9_ęH73͟AmpV z+~XOw𖺤:,vbk/S%cH<B6# V xHAK`PsY ،+,Ig\޾>zj4i?Ζ8FR鑁.v15]f#)LT՘(#r=OFMy{?p+;7R~_G]HxuXxI{[~_ckW4nCW-}6–^BHSHuAvi2Flssz6ۭ3k䒒WsRكx3i_lq ݁Ÿ]@kUXlX$WhAOrCYrY%LmN+N&;jɅVͣ[j,ܬSV[mvh-}2u1B0Щ}`ńO$hCemwBn]:aT]KkqS`@<,eSY1laz]zL8ZM?f pDi`imQefnP>*jxXNBr̈́q{t]U-ӱnTRwr0{JE]YA5=qɁBXrtqio`|I7/:p̪Al֡D׆!tbDtH|[0Oߋ?bIg|߲qϙ1kAS@qR(s^knu2ys^[bvG0 j_ydp`FD#{uϔ/PLQwh.ڤ'GU;JNFo`7O}dV]4ƐV{QԦ;}dG*zd:fLXXW^UͿ@EQ$3X6Yz28C~Ln܍}k-@/egQDoÈ0%/q۠[g6uBUW40m7RLX}F˰W@nm뽯tbe-9lfO`~^oly4|Ŀo}AP=eBci cEgqY3l[@taikt|hnJQa<6QYo2g`܂I\WT ->czoIu|GDm :ǃ9rs%}CyKg}k"~+[ȲK"Ng"rQjY}1%NpxdsJJNReh"Uzu7&O}EhA/EwtNz[Omׯm؅hʯojjwUp_Xlij{_Ul9NcZrU8acIŠB_^H5gWQSb;hmʧ7˃G{uTI jx˘U/` UbT^ўH{ȵ`Kxs/t|Qv[Xh<Á#V]K;wwVbŚLM[-ZWr+Ypkm=ho9Ef`TuQ5q\&_Yusyt쀔}xl~yd_$cVI֝oyy<|TYIkKrjV#rfN\`tSvYm'{Qc\I6D^͇Tr_V(\MzaVlq(worqT@^@r72b{gc*vSjr?`VnrFMw_~iw?B[VxѨṙh+M*N[k^AcCxji祺5Al!jXj3󒭃\.䈀gӘa-Fko7!Y􀌇SoǮ qآ%V,1h&*e^DprSu0y?K¯qWRDePTQlZpgJn?`^g=;ꎌ:ZVL'ld+Rr@r#Zuo"so֓[9_}-Q}5}PN#j6K7arsᎨ2l< <?_ʼk8cBL%{ԏH܌pyVdvQtCc/Wkw7lwmîʘUupՀ{7{q1qawyad-&LHnMwBg,ϻ-PߝdW~zxEAѷ>xj}TjcidKA){zvw^R `oakm]tBcqiЊCx6vznV~~Œ4S?K~$9^]y'jDY kAg}}|Nzp}`o)ߘfb+%|iZ֋cKfŪ~R^2$|mTin/c idI}>ڣ!apsXl.e4>*>'7W3HP鏎BqNl_LPެƃ(W=;JxZ,(Ly^~M| MzT+DW|iDogA>_kzpe8?IorkjiIQ*s;UNÕfz{~ nuUz\.H]y~knXjthzGG*"]^jR{B̋ JF]^6yӺ@HN:ֿ{Nh8_Ⱦ3drD2я.L\oN!5gHV FĄ)IGbY4 WPUgIk[-DZ`L?wEOrJf8R@~Z`h}Xw[kܱwvSz;By)g$dKh}ffcV'T慠 Q[rmVg+bP'5qǑɧoE|݌EC~jz@_:)Vqdџ-ώ{h1sw|6p~H!Z8ցթT*'ƨE~^/pZWQAQz [trMP,]AP6ejl7kxfDry q:'mfsC%djoJmKtv*6PT_6npT\~l3g{xG^ޓ*x1ǹ^g^4l`]nNCuyF1ƥ(}v96GK!_LHEJkbH9ar4[|<{f?z+m3"!zItS3P4Ǒrg]bHޑ)I<^=Eb fyS[j[[?^d `B4qpM݂hf(eFF/w+R`V_cD/OVմj#ݚZ]޹Ea_usS ʏ@6\Zkzk[+USּ nn9nf%A(g^]O4ӊNffEDx3R*,OE|ZZ%`C2oumiKN\,$(i*W!yJ S(Hb~kYNc[td~e1}fRm,[*b̑5pQmJN[ʨ`7} pZeup͈l+ky05wr`j`qv%ND}iqQ򖭢Yiی7*5}BNI~O*?bCvPTok7acKapbZg(l$IMWd`ZO_V}3'szAdAfig_ZTEiU76 ڶ)[w3FL:vJf,myn؎%ٟ4|cTa˷)tMA~v4.;RtAhAjc7Z\WS}QoNunO$gtv *+cuwNWtKnlu{@ ǐp@cµ\]UAVdww`vq i{-Tͅm7ĈJͅTr{gf ]6AxKwB|D`(|z A|uWcv؞КssRǭslc us)E1_k~wxGYskso;~Jwen^ ZywR®eb*`{bɓJeYew߳jSGMVd\jzL&/Uj+*[!]DO4p_Ri>]{5DP[ˠ\Ow/mCH|"$7rĶwSW4NeG_bq{tkT>lvvQt#mwc|FREQ@Z24rǭ|B00A2 ic\N{wt>r˻Fxz{=s~Zn"s_u;rrD0OJ/Rc?#^WxPwOC#u0'qov}l5_47ƾbn>֋11?@L&²찺fWVGfi(~#ܽHi˨D`UN"Vq1C|%AF $Ѩ@OnMrqe/SC3ЫQ}b?wm&SXqПeǯ^pQ: Z& Ic` vv^S}E~m(_f1{]ڽqD}S?^kc6J(ÍjSrXL`r pPefwtfu)8Ĉsa-}xHs9@F4JUiܚP!ryWtߪMQ semA5RRk>jk`MYpi~,q s4d]FN{bw}F&K?cMqctMlb{m{H<;zqg%BohYNhpV^Ghñp/924mfL<$rCYzŸ() |zUau8jh'eVk~~f)*X-UD Sq4mZ\_.^Pոjs#^^GTT2ҍIW4eIxTkJ?Sx'To$Qñ>FL,ЀtZ5ri<4m񢑔TH,v};;~a4z|u iTU|?jx_~\c2SAqbth8FkudkW^S_3dg7SmZ~m#Wlo ο ՛[or)9D\7w(T{FZy/T?uUln]uЇq^ֽbo7JnVx}q*;ę\j\ٲ_Se빍~[dqYpJ;^gN+gZn'j fX#ꒄʤvR}rQgzMp⛤tCsx$Y3cwH}ifOi[NQ~`8GXOZR`׳Zv}ߘ늮|SAF(_8Qcd2aʎ8amJ°lmu06ǔI2cb^6|K;qllas 0c@O)?gA|殒sqhHyvpT1ylhQ*txػJCC?[YKfBreY[T0n Kp=sg9p=i시Kg74oPpJq5yP -.I+ltJzNƫ=#9zxWaaxd[7ׂt"ukNj>9S/Ц]mQgy`{@bOo3QdWK>Ì4+vg$5vEEijRQaߝxo\|B^ar^ot~G|\K4{}rfdi5Jc?]bHJ9:izPjP^a?3`Qs`],`]߷.6S&\EJO)jPDR`gxl擡Fo\ 7ORhex(KLȌz^qx]Zq༕PZ_߇X+SUPS><8|ۏd{2 [qorFp'\{n[e㊚Mj囐Ntwys`_Tl{SđbUtT@ah{=_b%@hYX=z{WbМkx@hoq$sXџ%t~b PyvNh#q;TMyK`|t_K{Ry čit M8q)o(GuEQikt_bW\upFۃbQdB8vp{EPnDb 8d}`M̥Qf̧U}Z^4k#@,Iċkup}\ȩ:!&՜g9Fo)xV%Xb$~C@ۖ{MuU^zneo'FtYơo}ԟ-zݾeʝuK(,Ԙ6[6Qs~f^\`;`lσk]j+.-麎ZQa)fAqFFLys}}WrSXPzwkM\zs>kEfIXli}ho9!Ά_Љ2al^K8't7k3D`P_@j`Ʀ`sa:U;m.Nڱd"Y2# Tyk xЙ+U~~7ϸ~z.vdʃ9%WFšwwDJ{AS[m=чNkGӖjs}dyF@K~M%(~x}po@@ i@~[JOds{NfKA9LgdyGEm/T:#s$e\1.l|˝1qgiZM0.tGy~*ŷCszSJiSoE"ǒl{cK{V&E7Yof̰IJ誹FMqƋ=5W-hxy\iqKW7<NUHfC.ӎZ_k)ʊ,k鯍x`wQWsSQy%>]+!iewΟ1&Iwtf=KIQ/9/Vkm2epG:Y`j+EUk4۔z\nP_ϨEDO|VcHd(dlXudB|Z[vo|^GXk]V7OS0G9O"dbSct{Xl$gfSbNpe|( u+\$)P>*vK<1krlz~OQsiEixYD:S&tuK8u@Er׷̭Mwx/Œ[DVsS ϋu^|x{`f`h˅mzloazڕ5[K߭g7O4vn^|Z4=5+i`hGD2mG`}]BA]gp"wH0NcL:Mu6bf+m tvhUFuKPlih!L{E|Œn&)햼t?)s 9z[V߲cb~҃m'o~ٸa{^RL*k0:0~TsΥR!1x:Oo{ooxjs܃t} pzf_X<Cbv2Gh \*xGHQy-yz7U9E{o6vht\PSsreMC얈sM?6cR=`3NyՖPCܨ;J~~6so8bei,46{7Wd4Dzi> 1H|Ofu_EpVxfITMX3kA+.uUkYat5iUi7AZQfhLԗЉhxWI'$^va񐬄t6Z6nœZivG k?eBk}W5EִOvf>ʪҝ;٭AT:w&:i.i4SRdsud}2Xаsrlvf=yS,sGq] }[7EKIv=mtd>˵]ÇI̍wv&2izb4 ce\?sxu[[}`uL,l,Urigx:l\ht8?Qj軗f&$Eco4!|D-m BXi)i{0r(p@]0Ĉ:gģlQpǿӜquGv{Ï*8 UY$VdBmu}ic׉Sgy&wKzf:PRٟWC).CÉ~;^%{><|]q$yBݕ!;Cux‚[8pZPu>oaWJ߅G/GULYE,l~Z<5M7WictXwp{_}vC_iZscJrGpjYӜZ蔊1+\z$:Pr|^|sf[w!pIuy%;+SD :z܅H@Tpia0(XUjTPXp_҆d:zRU^`@lpe^ܪbxWz, prֶ<ڲ|vv`&Tƚٻ_JX:|Tˎ}\7vQW G;V)x_sMVDž{)iJzUQadn_hUYcVZ_qmfhnⴖ1J-jri~Irlj{aMmOdA[QjۛyKE ,nvqBvIhWB[lNs͇NWVoBQ;oQ}XkΠ~W8W|K;IY;4}gZjD:nT=4?XQjem{k@c9%zCޭSjbK\ntSE_~KAQ1kQQGN7&Ց{pm7/p2lzVlp{n8>yI@\ED|j|tzY;vM䞢|>Vk+sw\B8ƌksI0wzku\\|+q_WT6Q-ݘIi{oBUv6S#l[Cz̡b."fk~/`sOmC{)42us:AXQw4Z}vKc[xCavgˏEF`wzZ/D`sR(P/>۵FcdfB{NN3=aZAMPcz pӗ?Ej[S}3?ZGczD. |.^S{XFoGS5#l E>XPl|_Yݞǥ riT4/Õ>oQbwO|=1 I8aEp?rWIIK@m}7<{pLĵ'vwǧei]5/XH`e[&Ql~萰ۺvb\I+jO2鞰zy(&ȀؠMכXtO%BqhIn3g`iqH%̲~rpҚ0o]hеWc}@eNEwj=ZmC:94{w9 "V[OFgq$]桟2t]yJszȫR`q֙p9r#jÍdʎ^^>iYhTt*4|k>'\h=pU:w1t_^Z~qԸDrvPNfBEWQR].³iqBw`rvvGet݌;+NտaOua /Yӂ{;Zi,~(j_;وh(p~gS!w4k_(~yvѐXrogÁуnj3Zm"{lYlApoIA~ӆfh̃fa~o2pIiMYQ_uAUq[+/[pncM馚]WɄ`:a'Re pwl\:ȢwջY{ː.{_Hl]寎p2JVfK8]ŘٝOWUHe|}dnuBӈb渁 ]Van\>G<ok=+c iE|G׳p.tqś5l]Κp|obu~="BVxcyi{Rt|o;t|]@?UexOTxkָȜd)zL^HC:jEzT f6qPܧQjceN,g|V_BbI֥RwAbDHqjryZBB:*@2`E1ƒN8]CNfHhbnX^cDv݂DJb6 Z}d5aMYYEZ=i?|Xծu`SZˬ2boyIeEz0yOXGtk953+ߚHkw>2oEVBbLzh3ɎTIL}aZxW~koCm[sLAu~r^ʍyMɜ,y77BVǫ4|cKupH'iW+G[ljR1Y,JwkzP?QTKf>ᢊxhyCkа̽B)xaUw|<kH`n;.S{sCtQdSOrԆLh؀a:]7fFAoGXbK^0`"8čUfۭy;:RY\deh?RWRt {j9nqqea__i@baWMcE9)IDxy,AV*]EZoa{ׇQoxdR~ ֏b9 ]+D.P45#o<}uΉs~RY*mGd\4ߏ0hoE0=rlq؎˝*]mǶaf]IaYqf[hz:D(l?t$u}vt&]asSn~~A{!xrZR*#=AAOnnpAjavҘeD{aBLЀt3(a oV6 I>@Rz9kf9BXz~BԾHx]7V&2j\Ψ.#QYQv^K9qG[u٣:/2vcwƠeLqocD^4cxO7|Nh7s y7MY=vVn~ŢupCc]i#FꩀgjT]hw?(EooI`zg{F+3`cW@qdsqm|W/:It@QovzV;wyeu]>MAEtrWY_Z5U`UV͍NAv(Vˉ~!m0~Rst6i7\XIxsˮE|bO밿pjTڞx(`,w'nvgsx^`C( Yriq,Q4u<{jQa^Qj@a=b1xq?16]姒SΟrwc( ǀJKe_sU,}|E2._bnOQRTR/d0Y]sO}$yQGpsϦ!-f,v(fȗ,;-PxAP-V^}^>?jS? li_ITt-E=IZy[Z˨f[?qJ|vqkodjm0qQn{H}b_jU@ Z#cCIw%lZc5j]0G_Y%{ ^Rkݜ^utSyQ׶1H_aP/Ni›3RF"2^5R\|[|tXT˷Qhni6EaM(i0;()$_mYHp֡<=xGF1͗W1UgE.xZ-̪eqIq}RfGhDl?08m]lVE;WWŨRn&Z8R`ØKM<C󯮟ibˡe\<%ȇ-ˤ#R-%?(68G~>MKT[kZw\+v`dgv_Rak* Z~}E򾦨o'ju~E |lUzuVnȰWbͭ?ab|tۓ)UC|5c0};Wnјi@_0HqøPso_gxbCXET%TA`}O0<^bgg~utob YfEoY=Մ^9Ef ^pN-IRM'>\j 8`tOphs}̀# l+=Ivc[9B\04~dZjͨFz\8L']Ke[;apuwLx.1ndy[7]T.pAmsvh t-qMWuizCKTk09@꧉YKYv\ZaneoInźyrLl|'wz$b6*ɸA~4*,@U-b>+>/ߝJ:v6hwm~B4oOi;4ydjmoi`g?[UUK{j%Q~{ۙE#+a@XSc)Xv/Jq噡r8kOkxs(sݱ%P >B篡WoZO9D$B/n:uh<\фmpɜKr3fY{3ӘA`V÷GReEٮ֤\6ψf;`?P]{^Lhs?õAB`y[g't(.5kvLn<^Rd'$㡭d{[B@_t)e\F̒{Jpg[Y-ȱe;>9U~~_/K9qBjp~kאoMčkQ\o8mzM}i{pTmxm3zZe(LLۺ:t.J%=ŵ6X;-wXpaVgn #G;nT%p||ꏔ?w}뉈Yۄ1@o{ٍzjPaOFN|y;s~>aekb:{pפ[Xv]Ŭ)xof;NåZqcJ^N[s~$vnO)M^Ad2WNJ#R{ʭr1g|tIyXbmem!ϛySůwnߣH`k \bhmGLh%RvR)~SL'M>Fp;ǒ9~klfȣذgՙ*jPmg@R%~9WUNrwbBW?u{X+nUIce{ɜoNmSlX4La\Qz*~锏cwKkj`[(5yRM)0vV@ţH rݞˡ>֖Þ|m[e!h5X|aAU@P7gmsks!Tcn:utln{|e|7GqANm18}&1Eki]m>S7 mP=IunǀuƃWtYHTq7mkKUyisx՛ ksqk(j#Wph7fROwZn~I|u1dY{҄^~dTi/~HلQՕ$5{w";G悦䙒VH||q5쌙q`??`}`eC8{ k¤ZPaPr}| U+̤7$Xdrȣ︪OuNP~[_J-ps\siycQ!p(F{ƪ4ۍ߫Z]nOmE]|ܰ/W(}t6AS\-[grODiLtjMH5@q'ԉvL]1 0OESOWEW~tW*Q(`|rlKQjk\?ĪAEzVFuWF5lG~n>:@[tqk^*ikrehaE|"wH3DzjR8Ȣfیn:ش5FOXƲp#yM>wdP8PrnSb! {RΛ>,/hU?Ej|ខt8g5\ahwӋZ3qDWtiGx 9f_mc4aЪF%*?AxJVXœ<ٸOγP!!60VSIKz^rf:t+Ms|[Q0F|f°\֮}>sn3VcQ-.C{LJ1`mxʹ^t}5[_6jgi+kQVI]VeA:~r8M^E^X|0mG]XqE~37Mf]k̲/NASJIu=>+}_qና)k}v|~E A%ٓ pH/^nloK~}kDgvvV4S6 d/y0Y]Mqm6*b_D_1W?r_j8tMtZjVor_q0z( }ehHWRq&cOzdbNXbWlYweijuvTqύ=`u^ٛZQ oT+d}\+ɨgoңCYd^}hÏ`WyÎxel-=:nmH ҜbSS]nXJ 3/[7_F>G5Ur\ϗl-`‹ŏ'r^bc8T|ˁ3@fo9cSrgJ/vHwSǦvMڴk Tw8Hff*X@ŇOoTo^IJTnw]+-,ەbQg?j@UG+2Lŵ!os@eJ-Y^Zrlr6e^EgY5@A!\=xpd*TQՃy[foPyb3Uiߘ9PZKX*;GLy+ODJq;e<8cynwiIpvøMxmVLf{mPTIF-anBjh+uX^IjYRBϵiwǂrܨmwk~ܵjU/wJn֒Pp1 mRGHOxfSV:I_'JkIQ9a:6mψ-wTOwʑPZuF̺'qJI[$FPsCX1IWclL~TʗoemhR35xuE}|e9etōE{[~[OYbS1+׀s8fF3FS\tpPgmnaWSZ89cWwɬzN8zB@,\ߠ^ޅyJqZ+}u鄖ݶY2#Ggl K0쥧SuNNtoshϔqi=Ƣ<zg;¦ns姏4l6څXLh=EiJ[i ƫ*Q(XRlUg n:sRBe\iҍ1xZUT}:/nMaSzV1P_fJn\\d.BvIJV:L$'`cjNTZE^-d>]xN]A48i:FnfpoDgy4Rq2;Cc/DmgB(U\qLuU!U}\riroZRWUMoA.bY{_\n2LzMh\l;`7dk:mwSZ> QPx1hFb~{W›|1p%t=:~f}l^~^}z h6mqNҨ]}fiV`= m~<́ob<^IgJ4{o{>K^oޖtr:bڧi^LrM\hNaYIBQV~cTnAOoPeڵ\U5iҴc[hθKz"_}>YGsboFV@?_VUSqbxDpb6E^AflJnr*s_tYϿ˛bU7&UKH7b^ăV*jPsTt?X`qat7KU|ίdqס˭ita&cQ\gQbPvx8O3UmeX[¢Jr]mX(zkLU$ =Hl_u|,izaE!]nfJuQs;4ʳD#vf+4c0\Pwga8$(Zψ̶a&bV&^]i kNrW;{2Hw ~Wf6kgko4tKzOxjq5MRnhȤze،i^D{]İwfDAg+<}n&+zolmPS`L7XZtPM67$rT\zm^`mʢUUZaNXg΍Sfp^ʀGORWWkve9>겊hVd`w^dydAvdJoPtmkUB=H$ERfHciodbHI%U۷J}pJgž{f 4Q;m%R_ﱓ{,>p0R7f>iIxlvwjd8I5q_,x)M[b;TR+g'0O|b_Q͡6ūTm@}yo٫|}%{I\fnܮrL9u~hɻ>fo@$ỗPv0FI_JÆfTˣqe=tA6yh tj|4_m[?p[(o_4@vlS5t,Z5UX{ƀ箅/qn4ûSA8~MqAGo{]_ǏvcBDBzmy՚66h7lzY_d[[v{We^'=huzLV6nZ]G^nUn{Z|q<{Gg%`U<adq%2L0hniQ)W{5*q{g~W KuFWbVw1Q0lƝ s^{u%[xdoSIfCSn;:X-fy8T~aVA)j9b,χ>j$i_1^Dvazظrft`u8“T4ڲ㫎Ikؚ6FAV3Uf{lXEq|+FwdQGf0kv 7.5yp@cXI_yk]Pk@'âV_ӏ]h񣡐YJeц\bZIvrat1r6n=2}[(Lt OIM:lKQT}d.prRЏZxיAw{_GaD=v7w{9`HgW5}v9P. CaQo}bjz~a_@`y[c'X~`5x(fWde61é=umvo-ۍ1؇@{4hpӁS"Brg/&p%W^x5ݠe_nmYU{eZvpYCt`g48~|{Ss[~[ՇYy8g]5yj`{I+/6ZӔT];jn_KZZ TD}k}#[STv8+U.v&]ؤ쫋1r|vקojdYQ^rƇe6M%f[0u%eFeqm~߶̸wT|`jlZa Fvyryny7AST2yugBň*tv{|)WhP2AʔjCsonT^bPoyaHkWrj5Ksw] bwKu\-F pbGW4ՠ.l@:ͣav^RvUɎʏ9mKګtQG|ݤbB"oRZ2lg |ιt&4| ԋ09@sՑPTRXCA6EpX]᫊_~S^SccUYUN^VՌn_xtTơkSN~ %SkS,Zb{ms=!6b[#x e_quYZ@]YX6k0nƾ\h~U;`˗eFU{c추RnWlqdU^ae{8Pk"XeQe*Yʷpq:rfLKaƑHxe4h %=i_}mK;_f8R|h //oJtًv M-vSF\[ k`WJqdそ@o[PɭUdw;l݀xf|rH܋xi0Z3³Fctp l->Xhl_ _\py@NO4g26z?eWuXo:RjPkY[x@q`G_ehj`Q} l]7MċJWg@`~H+mhS_iKS77D8soll&Qmu|%퐘B]'"uNIhV$9BX bF}c@{T16}cg|jk*PPcm'kd]E]s8س88;p歪ѐ{l}=}}{grJ-$hg6c}ǠaGcI -tL>0~]Sf㞈V{p}BdZ6yxV>~i4*m I5.0QgAhQ6,KFsE3ɠhl9r8O,u#~s}\ɜRo~oNzԑo@7y0셬Yh_+1bi>N֠4N+>yo\pMoZ}yan6LV1QГܻnre.Jb#I՚Kx[Nl}r{D+l*"Ƙ3[XHV,sqA$o[gyגgn~ͨYYS|~ quVk PL[yhmEhmmsbrnɗp-Eo:ڛVqUIΥx%1`Ågז]eaWz&Iuu8Pbs,M8V>@@kJdžeMhF|9`Li'^j͢S^ |..OʝŽXDvqb8wf7W@GvUUN9PFCilqoJ{z_D:\>K?Xȹɧ;nxbe.5urI QcvA~˧v̱X2Viy&t4_aVCLxgKl+|o$&~~F{)ЙBt_WϷVF;im(ɨnF4.{-x&yoQ%Fqpb>;rM@ҍQk&NwQ&zհR|=^Ȃ90GNj\[É{uB2NTmYũŒn1XOh7|geD8UZfcyKiΓ&OPo88'h58l۶ZKd,utYK' @~ӱ;Rg$JMaQHoUdn4~IdE\8Ar˃o*aU`dnFtH_ 4i^ jwsLҎSNUjUsϸsȶ%{[y.^gVеpl{2@t[j#7i:SDUxpB?pz|AA[2|zXpOJ|d|dAeRwrKKn)~\_+NmP.wvqlqlJW6vm_xznp2CjTDfEpk"V1O/yч}a~Nd8M$[nN-ej:㹋T4\mkg6Q_6dKOtuHj|pYlZdx$ZjRyozS L]x.sL- :+=ZA%笰$fj^))Sʿ]MӲ`yˈ&*2xSx΃}V 1kcqw^L~.*0pdT=#wżyvD5u9l`?ܲL>Yo(kqk0H DGc8}\kNl`}ss}mJ޹Jutf9^w`b8EVG0Rs_o^{s؟yfҍ_iXwb0<;U ӌszkCvKCR^qniƐuUT_bȫlIH;bai.wM`vTkB裔Rh\0iX:Őex(cA eqjCdx#2y1e<^z5YÐjhXkªO3RWLyFHтĽԐ wo9nD˳S@;?mu74sh)ij[ijظ1{`olŵbFT7-̤U2(SpXbjzwﱜ]NW͜^BVբPVnL7g3z8a{0xÑvt.\mǀT?ywv#iw$?_!C9v{S7Y#|܉PT:AXv{kנs|e'\A=Bkx>c00y`zvΪE~Nԍ[gm7hst: @s2iȉQK_Y70mIDPVÆ䋭fxgt}L%X2HcduČxxV`Nm~_LDKt`w^vtt.KsװGyaOՀ(dz(?uhbI}Ά1P߭Ow]UC{P^jX¸B~@qke&7^و9Hzk 2C :^^V_9`MXfpbgimmsdNS`NI`Ji,蔁OY)oh{¢b[Lk7aEpZ!6ܜpKPxPplXwYʇ汮Vl~A/䲬:Chm`B|B!HGzFhVWmk2hIO~ک]ܗH9Oxu<破U?e@kud}hћX[|n\rR/ac9oq#~GK-ty}hINpG3sDavF]S)}ΰgbAΜҁb ԩfNCՂ8ԏmRuj\[|K-Qu2tf^8sΪsp\/aw=9|gWN=;T4yƛt|[XN%G|Q{{op0LWY;xӁd(YwȒ&lA̦*d[qePX]Upc?[b0Źdjbnfo炁]\T6yZyc? kG4u;&La)tw{~OB-WlUCW>tXfsf1ew7f?Kt U.p*?e>_|w3F('4yp.PR$L>|tHb{}JMJqbȎyTVqg>QN-Fc€בsQ6XU'w>p[:ҵ꣒Hhʒ=nqAk@~r 9]6bo8MM6vkzaqn ejcY}9*ڳv^`ĤHUxVt1c`S_O&D ?tcv2_.p6NtRT8˺!.D[ՐL&`\(*\\JMB`g~шRLj`xK+t1u[Lka0@~;Q}yPU%IW\}DiFCM4wE*H%Cq]ȋ^)Аz 慻U(dHYy+YIF2&eqEBէ~u~6Hn\{?oby W$8~Igxq](hYApqhoVO[x)WSa}MGm嵰 edU@MV(V]kYFxt-p)>|$ mJdCnQ [Dp>zLeձwA_,2Kڨ?=BK`~ğ[ēDZrY|y 7ricIț|gRgne7hz<]qV´[\f^qfYFrxTlO%GѵDtyDQH2NNA"7|qKį[Ibx3mK|pwDxs?{HJWfqV1wp5m]1_7rn}>xsLPYo~qFIZ bvU`xBYU9<7FN5DWxP0:F6g6v^jh9}gNpjl7n`\NbOkȵlY0V*o%b y_xAeiYjVA㟅WP('r]`s̘upyKW5)©؎aH_]x{^pmm Rs`>1mr,wnZ:V}pJ,FjJa~rR=yʶToXhwemi9f{rHhƑhq{ņ=r}{jIh;L&`2)IڹDfx`։e7a$lQ0p8'CuniFmjёP6fR8QuCQcJh$Ğ%}xq>_ qSJT`rfXX]t{'jpd4Pn۳[:ՎpwTkDm:g[{O{y*XlFtaFZĢEܙ`ޚ][[N`ye3JiPHEjdO7Z;#C$eZEtx^UHX׉^թƙb5 AcYbVe\T^__3O,Qٕiag_3ma@]t@{g@45D>91 *aRq{׼F‡Y HpSig֍FZ>FxR g׋^Қ]^UT|"gb*#-CKquYn`-xid#%OiK͈Hi4vjlH3tN5yn`}󬡂DOUinMD}962BRJp>z-tImjzӏmȎɮZQͬWwWX_*-ŋQb:7s)X=W|jCpRm/k̾tahTg]f@NW\\ƣ #[[Tz5mqmwVW?ȋ^{ |uGƒL@}>`IRaiGk\-)՟vaN1{ǫ\Fq|/ ywauz==\5C:3{0ySOP.3I"wBP_?D‰TAwG-?lE*aTiwlrS)YrǪb6^nli?REȫ7dF^Mˬ¸!`fՒxHav՟ңXMΰ$R_N&;l7|JI{t9;m_wo}LjfUYk\vBsJL@ܟwތonȤGXU>I^J8-^[8ݝo]Lߍ81Di uow[T>gPŽF_əUMp\3K੡Duq@B͊EOZHyNrau ۧt-}: ؗkS_lH~.ps9-"5\Xh}Dyhm~k]g˗`ʩ&]1pJdnUi{}kqbӵ,iܙmlJzκK^qjNWa@M$gca g}CwJmʧP󟍨m)$ u+lLk5oYYQR6iz\̧C%cD؆u]wlicE|sfwZW|?PhFG濲KcLЂgwaI%@nuvd=Him<OGY')ۢp/_dF|A]tZsGZ;ǢmxE֧ķć`qґ<(u!_w܆}}WXjkikuѓnJLd^@c[ewps yHhvrJEUXmZX^myVx͋8YWޤgI[Qzϡ-ew6+NƯ6 PŗcfLU)![O-vYݏr rymiS,Qiˡb]=@ЖRk8bmм^|}ptfkE90Hg)p(<^P;L#lgLLKueyp.(wyvjcq%@D}pqSOѼzmpLԸ!F7Ofq5Μ/50%&HNGUw҆d5Q5v[h|7Dϐ%{Zy0lQ ɍ13gO*^YwE9i1|A`=sCm.SFs=b|iq jr)ab~ AsunIuCb\zEXmRB8_#nNUZm~d=c){ MiTcqVR+~YZ2%K<{5Ԣ9xD0'jɍvWe×q@eqqAɭzuă-ns(S"%z6je9NB=Dښq|C^sB-"!TMըeZbDu5G΍>)g9RqtVU0Oe6z'Fj='m 긬ِfGᐉyz[Wmq~XƦ=YkyC/2tT@jt4k8pGZ/fMh;לx+ZsԖnK~vCSGET#+Sˌ`jzpKNmDFwreڅ];Z]rnrzf] Jp{zJS㪜mzKe/cQ_r؆_moZݥZvurũX7ef*rݬleDSN-a$V{c-nXuOvHL?횈@7aAoKM^jOQlZg@\RwI=Mz$pz¦A)󥶇9A4ygRnYrt]fi {KBwHՌ How^~љh`EréDOz|i6GJ~LT䤤+ei;}&ܡYkNݭyw^ٮw"Rk?teUW4DNlLE'{Jlzij keϐy72`ߘI>d;/jktDQce.fHiEcb4tJf*XyOnP*i`/M]S|^tw__Q-zM?\nE=ajd}cOpӼ.w V|a;SG~4#L2O56rąASmqXW9]ٺ\qwxt5A]#~_gIp*huyt'P87=\[@0ke 3IBGS#e,@ynWE`!.nS#^ͻp{U:FLspS|&[PR7vAW>HVj9oPcJLYZY|dkYcutCŀild[3OnQr:>`V CuW1yӖg CWFu4mC|kcjPYkI:qbj}ՍfNY!Y yMYJat>HxCnstE",f*mv^݋bwD~p}h"Z0I)NS/aldf_ ~kh&,W9#yocӣ{b>cel=qz{\׀dawO2;_QolkWxҡE75dAS#qVXV[Êh|T8vUkDGz;U&gÎ\OCVs>QriXJYEzAqjGe֋rSi,oSĂSŠh%4X7qYgpA؍Xjqxqxb_^YBŌ* | i;,nJ2 TplX}awwgkέ}藨s}juTl_OO56?RtIs{?W[}zn>E]cH7<[_ fx4ͅ\53VjjqE af\RD?t^%e{;e0x_p\v̀YzzwrǰQTDXY@Mew`-yT~gj{"^AfyZ'UzuM$zI4-J_1N)1rTOx@d;^\Evf=c㘈_QF :S\idՔ>u1[ /'kYyBɋ>f#F8И%hMoֽ7;G3pCPq|aSzdp€GxRXѣvNEu9jޠl`Bz\/zrˬ{K9I5=xpSv:ژTӎuFsńxigjzy/E4zpIBskmĜx&ɢgpXyn&VJmMByة-hYy*8c|W]LARlW3hJk:[leeT $qX0{v)rst(PFYgZpm|BH@CF|N[LLP拠ٔl=͂kմ 4d^YTMl;<0061i ;hvυ'y3 E[kx?T@^}`4Ha_ l hx.>H͍.Zb~i&@@tvfYT,Z':X/׮fq~@h^wc!ݷDALZ :^czIy\j4Dg~#P A|x"JeC`8MkB?ko FsݶVIM8Npt[xq{6j>vk_xaB?jjVOOgӨ2~+IP=TX|Ʉ(fx(7]aƂ˜jP0ojRrD8IeqWR|r&n`xRc(H3j ¡yoB{pvnnrFƙUIsaAQ)vmr2nۚ9|S8{2gʵFnlaHq_3 |$PzQrng$t[摆!f7^c4KKqŘC\)SXgybzp`5j.\!uMW0+Y|țƍLk6uIzc@})dK}t̨CPRjlÊtPGkU;IOv+(iWRtTdaQ{AIJpF]q.ȉiO3Z;ȑ]̯c@q_`HIWvBhHMhVܕrRtj,Kt(01UsUfhryB{yob*a~YOrGIRA&v]>$q1cen̵&,95IƚfbћyŦ/W+aȈwMSlklJzx&7rfox@zKUatoOl}uk2x{V܉LJDB鳈h~FPymz#zU6TJU`fuȒ]jE^sNЉZWE=Z8WqZsqx$O8PTM$t97.i*9pK줼zWQut#E39MPrj3()YJoFoډ\{IVOhJlwsxpis~)_GF|xopfLȭ6ΛHM [J8^i{[zWXr5W19aDN^ר?l9wHЙR }UeQzK?nG{ƫ;rW:=Kznf(ͅr8چe\yt]NFx}2G#yGpHu{kYBm[L]rnǹy$dIodLVNyuʾVɞvMHMxcjW@֚wUȏFu4ӣ#9CTyG;x͘Iun[z=s3_0m>H]`WSt[XpW\|GpS{}c'vikc8cggsƦ q@(oJIJLu/ٙaϾNB"mPݚR'vvChbaZ7RSnC9Q٘Fr&QYn}HN_\5ÚHepP;GhơrKg{tH;J?Ff/kHdŇl͓֪B Y^]yoQTy(fq4AwЍ~1^ҍx;G}jmXSZwSD|;r7uUyOi̊+r9AY5ۀYfh?3jvd_e1Nez; /[~GͲ:m'Y?KItƑC͟Ж XXi ~Ks%gyo<}P[ƓR_{_Wٽ+DzQNfe7 r2c[9[`lqYʌԫ3.'Z~q mqCE:1IYsmu:]SFGX{BqQ@\cQ6s[9cyN\BwBkL>.QHDէXNW]:WHB5ʧԁżtr /lJ2{5̍+LxONw~ge@L?h2ҵcdo:,^{TeG[Ju|d`IZMSUoGM'^gcmTXmqpˀb{RO;m*}u_o[hdxaIpOgqbf;+8ڤE=ESdE[aQ~u[IkpxRéjdWhaSϻvx#ĒȉSm޶Rgȍo\dAjSUbE-tVW]MU|uyaɧOKǯp.n/bnÒ̖Nyx]jzʠA?\ozgwTu?h]F}ӳj}y{JEmL9vKǭ؃ l^a]iԍND:r7g} y27dnY]uNr~\SFK?|DSKm?~הV+ϷVAvjL*kwh[;ihtYwko~_wݤ}2hkx^"gqX!GMTKB= JJѵcZ9c,Ş{gd\`p}FzO5ӆI˜Swm_;NtЊ~ss<1kp/O?yvؚ̊RZ#Wfu1 ljAHSv%WnY`}}eYnsijn2?cBߨ\[ RX~McBLǃza-B3T(+|eo:{cq=KX\QSaMYjfskRuؽ](#QzPFMuPoCeׯ%c}ݝgGӋ UGWL8OwLgo'An|izü'haL9aYS`jwGFB҆-U2C͂/S+mDPOr\oA0(+h} gtxo?ʢ>Y6’$]7L2n!SaWb]D.NvK~ou:V?YDX"JiD<}\w>Nlhn)Y=kA;?[}g4BS%=t҅lXp/~m<£C5˛7nA~ӎU&ks{5X>B_KbjV%Շ;`np@pn|Vr8˱;)xcPx`&Fbb@Fl~M@ZVs*8{9хXBED~QQC{U.&< peX+uRhCW3rgkuÏNԥCoS'S~SǃDٞ$WHHF=x^;lPBROF%vgϝp={qXPT/k͍rm7WŴj 38(ۦ|F=?uTЅiQXuv[:6nT&q\,uj>YdVz+Q)r}eqp[JY7s+0aO0q-~#hH7@'32{q˜pд&%AC\f~6i'З@Jo.K5pZmh&l@qStCuGbtT]>(MީŊgR2`[suEA6i~eboP_rs7R~wG tk7wo6fqsZElj=ﲽC`ĠLjD-%T[tr:='UjX=VbR7Jon'(\CҏgRd?J-ŤQ؆aMgq￘}ber+vTAyHE3\e6WKWbNsbL9Nu_ΝKLNz|:pawYmVx;֍tV>&ʯSl5UlZqCot[~8Q_!Go0 77ݼ}5Hx&9~h|G}&a_kJ[ڍsjbZ^ݺcW5ɹЏ{_Gׯ`SN'OVZ]Y2Nsnh{1ےm{Z=%j‹Rcݔj{Uhm=8FKdϮJqkz F>>iGp|6}pP33jy0#^]wZq-gic uۀ|2f9$Js-{HykUN|^kdНƭQ~ʚsExS[wʗ,j"q/ޫ,kp>Ynx@r}vuŎ s8@ݟԩJ5԰NnxI||^ōl=U:RyQ}y9e9X^q¼GEAnMg|W zxuLKvk|=G22 uS96oB|hD/h񧚣xG Y,LX|o7oh]YUZv~LLh/ְjFUDcZlbc(9NRarrA$z`X4lg%[1tu_ۊ+mUlecPb~òGbQYK^EEQaJD:uxEYD²fr\y|cs*QJ@[銊ězc3X՜Z`CHo7xj5Jr]x|Zڦyǂ6|2u}^smt^_wשWyɝhZ^myXV R3̋%&t9]~SdbqИlNKUʂ]Q lN$E ݲNq';3FAlqͶH؇B$b86B}V1vgVSC_%Q=f8Ak>]beiɌ)e}hHִ!?]Ow Ej},hr̐.NuԾe\mtw'{%zMT>MMQFkp\z.hys= ^w]r@{8-ZZc2na6(d3sttgeuq8\[~KVWchW=W<>!$>iP u?R1mB~r׿0YKYE7nmIyJ|*rfziR[zclTyvgpb<Ӊݘr<kZvf=qJCS(|b^ztڥ┓t=Mtr qZxb~A7+EޟNEiڵ`YCjk:Ku|NƷKz`cCZ4[oUo~It+[|BnDMD\&u!®oMiʌ10t9<˨BfLDrm*0,UأoDOhXpVbRASN{udG}D0MYwj]wbhx~F?jDm<|_3AEj2{altD1VO:@rOYeMnowIgOkIYZa,RrXXjQ Q}οhL{nAiP@ie a91iڍ&D\)TʯvN8aVA5OmuمeY`tJTMcIj1T01%bRzTR=Dd"Q6͆;W_C9eLnl6䍎JWwao.!`]jp^PntCva4}m 4urαo#ɺ >:{EہKtWze=ʷ|xqv!K}h8|;QllEriBƤxk^'Dvg!vhazTrli贞7̹fR0u3H@vE/>MS%j|x_2TAk-qJQcJR;QNCNAkX TΨ~fxґ1ZxBX0w7#n"UfM>LNŭ7Em4Su|#ja|rsz3srj[tcQ$Lq7hI1y1y\'Mu_N>\}GMeG_G$ B^iqRt$yN@%6)6`d=_Obs\SUKЄpxDsF}Z[OV[z]Xk'HAVм F:fj"Τguvemry[eXsuNROQ.Zw;L5iXii}ȱ^jJioQy揸5PFÂzSFNZ{T:nuQ}\q]5d{`ZMɯj~`HR7>hΑ ]cѫ =<`F,LrqMWzs~O3G[˿TDKhxM?wUzDNw7f:<];vv^!gvШUVRzF]p/-B"k!{Xu l>;Vm}lCjSurҀbee{~bXsxKEZyo5jgSe_7Ћw"gRZ_SAοwCF`sH,^B~^^vZֽ Y+XJ6^[X6OK[aVW}Dm߹$K}dD6;Y_Xh14]NA>uIhdfg|nz]o|[CgX/;+i)qumLzNPxm]DRaie=/SF_uGQ9xF`mxw~)]OeN##6mP5grx}7fͨtUqmDQZQ*[_^P`b{EGPxzAWw->VS%:Kr`&G";[{ceY_adjCK}oq*~hT{CD5KwΧevl_yF:Z?C{߆&^U8vTqy-?[8\4f3sivLXܩvdKh6#tM[SX;Y\ydj]?ըe+y Yw+Ra~郖B-FЙnS/B4rvρXA3Ś4<6BߏgCL:_ȴHjJJpmu&טgXmxQ@{DH+eiuEg5;fL]y"y}vt>D(zdt~YwiQTRMnZ{jUsSx.FUz#[S|N{asCKg~L]^_a^duk7yg>PSZN}]_`@Vij1Th?rWO8`4,-a+Bw,аisqPwfjqk!I`I^*j$[NaU_Q2zj0l3To]PK{~S޺LGHrHv ;ʓ'MI_Ht}E:)r'YyZSGPAU5X~?qi5Ԫ^btd~`K')Xa;@un(;w ]nr݆ƜBlbɅE@it]Tsg!JmY;Y%kE'7=cVOT17ۚiXtګ2qNkzIbcY_\Ɲށf79IO\5jXhHE` Ìe5PjrihaZȅRXg;zM9N)CJ5*^=YeX>hJs•l]]Vy[sZ+vYY9O=YS}+m"OCyU3t(u&6SkQ;,L nXQӯY0С`o|UxZI;bcSSH[P?ǯ7b;qu=]*~?8CouGžMR3gj6a2={TesM<"C(M}S^ȳ#i|tNZƳ_̇MzhO/QDr\YM M7l}fpP\-WjtUf4xLppI08#ERm\Guh(vVoKyOWY90oonDPQ"}ae[nߞx H>n}?p+r{| l.}V:gygI6"`O,f5⎝E>n.U6QjpVNۃu<PӉvjcUmX̜MEnSB}kp[$ Jr2֍GQ؍OiѯIspzJnmi wh(hd*n$Xh2m;j3hvY@ohr|Mded/-zQ_F2sZ\o4\yfexnjItɛiy-rFU8Thd"Z'_:xga)!w5yuR_Pm.tļ`rlZqюs*L3=4{Ύ|g>m^1GX5t_vRwert!J"PK7mQ@G]Wau`(a< vRq@>}kɱseftxlrxWII?WrjԚEj эM1עֆ^iINnҲk6{ncy5*jpЁ`>؉Cybvnx[zmX~uZRL/GlTczU7]jzNE6wxNig5'zbmz(@BV#wUiuׁiu1{Aq|5ch]<O=%Ogn^"?_L6nV|PdxUq/gȘhWZm]r-ȰcO^A\>Bf|Ӎ|ǵ c&5CpqoǭBDLtmSǕ̂bn螠MLJ}{ۓ@Id9 2ҵd gc=mՅU^HhkmE!:/>Cn?vJsMYnFzN?DKqo6^2V3k@<7W`RLEo+g+g΃ߐ`yeay=4yVp1@NkQ_gc3eN~if|5ߙM1HLr-ZCZW`puŎ7b?Hg1q͙z[Ra`rgl6Rw]hgV|w =[~P}pK.sBWRxrQmK|>YTTX&{9gg=ywx\wz(qX8piV?p|{:YޛBvljkUr2j~SoRv*CΪVsMgUycrmBM|ƭ&u|`h{9s~ĎthyVa<&z%_hwRSdtZ_ƶDv=[)?/my"k1nQh;|I[$MED_X?Wȧk6M-x_d*yjI%6}sbSblS>|^Ӄ &5Hƻw҉VUhH!.~Fh\fuXtvOl+(y:fPﰆa V>]S4za{1j\wCc7miqFo__M`AXو{w`>{kR[6"keFꙶcf|oma'N0Th5[TYdVƨip#[)ӄeXP7]Re6f+>u`"nǟ@|]urL_˺ދ}bL2d!vΛsLrp9UY'GJꑦ8IĚAցCgv/zFg.$@8R5Uм|~f%jhR=rd0$wCLnL˨ZC{o`.]TSt0j}ʕHX>0=JuH/̉.YCgx-]+F1CVooύVj{y2t e^C}j{Xr bO=O,B^VQHS6\>ťj@rs`[|k1I5S~|ѱXm9ch8qxNOhfka㧪"8CbY^Rnyz?g2GT(KoBDMԉo8Hnb{AWޜjTUi `O@w'x8c::QUr޵,]IfIft֯[٧qNO"|7 5劸b97aly8h;>͍Luʆat.:mrx2=٘-Q{H)hi}X }UW5k]PPT,ܠuN|qs>bL {j.y5(Ml8BnOk/oɚ]AY;eijLĝKƮ:ʴ.VJ6]7R,4wxZҺ ~|j3M]7nQŪ9&AuGxAvU\[-T\U~_~p<|bMnE:M{mzbN.sl[I{]v0Nױ!^PB,8όgw M#SfPIxkܤUm5߲CFjkt_|pq-u]_)TDž˞s%?Ga:n5fh/pkDAH|vEqs4Rr~h@=KLX&֌A-GdjG,M1qa1tB}t|(XpެEph%!딐󾅨}pWJm2Az߬U1HYdNNsz66Ƃ7fi׌ W={yX-ŏc'YEcY|Wy|S\ʟ?S^}R+T`Z@$Zk_#ȲFxu5{όegjcB6vnbrB0g&ʻrt(kHnD`_$7Wc\c{uUacb@E7t}#JwgZPPzM_\]8Az&hcaqm+/[dY1hlgVi&Έ0{TH~%\1*0fK~XПZ%.de*bgtfNN)oM^܍Ttdb~Hr^^qDeNF1v K0onV1~ZL@@p]J3>W~[R#abu:Ȣ^sճO~k↼4si$8:|KHo[!Mh_F?Re}ƙ{;qL.zh͹VoN!x`]aũ'vH\yP?/|~_g/\Huz_F1daj1huζTybͧ<ȲaŌi;TRIi$|B^++[$ÑeFɥW0{"'dqj~}EmrU~uq+gVjr2%c[ޤyc}"^V%l{VD>gwTĝЯC|Yc݂x`liBh`DZ}_tE711]//lN8팴~WZ>V~Z}gg}Qr kX`O0w~oKor4\zTP20'<9u| ZAlOcobҭĻg;{ڊg$_[uLNs(9br5I"nfklӗUdrBDH]p_;(Qkˠ+7a}XnZft0cK_YuLv# Q8ϐ{zVb) ^fL\NzNNUNz_Hh`-mh;Htmĕo;{ꐙq+C.-:V:a4i|Enkܠjr$Jc\s2.ZGiQvQD_;hXNmFbWb|RZH`NLyn5^yNK̥.G -g.wvtu[49'jJdD[`neANmؿ@ڂQ3:3eqUx:V}֭<"PDbYEfC]xlQO$KXIȀ'e;Tz\miCs>L-rCsdu5cydt0%|gCXˉTR\yV%:lohޮ)9sP~_BD]#^ B2ݦhu]ӫKxbȯ|qpc>3_QV~)߆Քb1ɱX=|E`y?~`tEzQσ{x sG@G{~ n~ra̅kɳwDDUNoT NUOWLMc#{WO+Żx "V1gyX*PEiYgwWkd|9dj+qSnWo຾a|ꄽTjRYUNm5Ro)j>5|f+n3hSwNenqm:1qu9ɭfS0w^S1oZrs(Po4/(LYwhXmYR(5d5Lz0sˡ\5QQ)L~cpM,2ss#XM8ZЮip_CR^T0iۡݓ@mbtZcBu2;@WHkD~MPŅħbsEfHbM.UɛiA[rr_iOVNfC#4|qgBpgH'[ˣ ?6 [Wi`W]cmgwfi@ZcfZ43%DxiYiz w~2e@}OduSW9Jكݢ7gn_XVa@fˍʚB_BEx0[+e+wnwEck"ٙ6ŦOʦ9sļ(.b6_}.\<ykz`pTLsHzL}r0+Zᖅւ/@v?jDqUP^W\NW^Y?Cf`iom+^}=wt Ǡ QD0ċ4X`I{s<,fkm-dK֣>xH?qBJڜNyyvkgmLwdOs=\[+h*zgc~=_鱌=VupA']45r]fy$}^;bqa+:Ov򄐕`FoN;u%:_`[6NC\8ĕ2mhL1gyBq{mjh̩mh~#aGoYgӪO)\Zv68uݾOm{[1 .q8t|J1ޫUL0~cPdƊ&kCUu tjzFQ%npZ8a]q 9\PxB{7nX9FnZ5~JƗv{ep1LGtXjKʪiItp'~WrX-SDԗlRTWSK&AJS6m3`qr9TfP]$OU4^1DXcnB=MfJ'')>k6>]E5XUt]ep)e8cwFʂ83u]В_QD`b{oL}2 7oie~V"t2k`t (׸\lTsZfoО,$hŵ"'Mfa.{JOkddW'e1Gm2Ky\*eG`I>Q6j.JXoW|ОÍ[fvgfxܼk8Jfb|0BJDf?5VBT2rkd!OQCXliz.ԶYny |`--Aw W||x}xwɂ@&Ջ6uROauF=ݩO!~'>x|UKc~j_wk?LNmyxˤkѮ-pKG,/oץkiܜ%pn:}i# R\VBk %/3]K1Ktdayُ9nF-5!8:IQy[=›`Prj0ǝ|?MGYeIt*RrpPdWaV^EL-ghDz@K(则w«?P1AJ7w$SϏch=M]x"9uPOPx|nEꅾ,A`zaLw-jug]tv53+bQAX/.JωiƅOwb=n~8Ϥ^N)&_mrʥtXoK7g$!ءtuaJoUJcgA39cuEt,yf3ZriъH^if<԰xlNfs-,Lz5D.WC E ASXz[Po@D熽I[i8aYVtD$IIj8`7\u@]Xچ}?PmWW2*X`YZpr9hx^[In73{W%/O*V'k@Dht}.VmKu0eWKBa'Q`mSfӤNNj|j`[zgco}H\ʪmʡ|2rNhl0ݰ `hv[CY0EPfh}:ni4DY6߫)^xvl_djw@/Z=X~,sso}f;rl nzq8ٛM;""L?{諎ؓm]׮$oq묇J~ẞEX5,}qҀW%bc<ﻈD{NG# Y?b aӞnl1tn9lqiܭ[}loSHjbί<|nZ,c}Ta]}Mf{reE u3a@y:$v_PnsK/;㕅|TLˀ\qtŪn +賂PB8#xbĝ+}q(OXAɏ 2Ij?I8Q^dx@쫃*phuEvs)$CmNlZ}:ńCWMhW|@dsD|OY<ϟXo; LR_dRksk)_AILLsuIkjN,iXcR[Z}#ׅ[Xcqobmdd2$vim\YZl:JYOpu_BnZ*Eƀә|(+ùdrnTmF! ]M[8zV~Ɔ#yU_UΙlf݇ju{'R~Hjdtub{/a̪I V63evוp"y_i`&3U xr^k->rJf,te\~~abkGmxDQg&jmłj+E}sSÅڝu?u[k~7(d\aUb/oJEDFHOxDg81U/Va[a~Rt)%e.wǖXY]R2aAKBZl7k{F%I~IlUpJ]H4}wwng'μ;0 {aZe;}O B:AFPC/iцkAqnu;@T̠|k}0'N<{fDA1bZtual}H͊n=d`gU6وDMG\b%ĬLCwv9iSɌk7QI?VtoR@}OrUod*9Ygo\/[F^$pkg>i2Rzl0(Fk&+srfitXڵUuRthQYFˋ YL@IXt4qWė~5qmXQuWv=YGY5 X,&2bXlÙ,ahb^GcpN*hbgK8yqG5Spht¹n@Gˬ<*\3#ifYz-*ߥ6Vb>5W=BlєrP>qTQt]En[H|<^ʟq OZcCdߐ(vp6op^s`PDeq 83dTsq]00QC>7`z:n:45L-T[~_6Eo+JamWeoa}E, ;*qn;yr}]cE$2pvunIoͣ\Fʮ8R?`C2KfA@Fp@ĒGd?ݚH}]dy~rjȥwweAL|d8tbQJd#yPPL{nTyVz_ޅHAulۄh5u[Oم{sg+dprkj%[igEcaDhӟTx\*?g˯L@fc=^"nnbUiXSͭ,Х)ǣp@dHf~.TwUos#? Kn.)ui¢nMe`rFWȡ/˿RE%ejFVFuV5h "]|_C\Y"#sCi|znqm`oȼ6kuJ?Yחoһf/BVxloq8\^l@oe/zmun\Tq8HF^.[l]mZ+\BX|sq>dRźyUWTHP/hmMY>~]ocƐu`HdIun-&5pn%oҕ8ibLtٱ"QPRѱ2v9h'6KIр*K;hBv|IXdZML͔g^ϝ)bH `̣bItA»M{ư"sex@lrdٌIfiLd?wWp,+4nkG3_mkƓ6gqq[L v|]B:_|k1ލrb}`OGèrd|+N.CXdtڝt>ZGomσQR_$dydFP[Au2eNd:gչMMmoJo8qhsvtg٨뀌!(kAJ]uO/ ^uMJDձl:DV7臈K]QOS^QꆰjRVC 1ct8ť@Ϭ?ndh `睞mi.ڡ.ړw7v\PHrm9ekM`6NP%RU5[UCۈܚۖQM~:mm3ҎPtc#r̄TbPL"}QƎ[$nNJ&AژORƋm[NJaworzkxt}Zpi^^@7O<}D|3Y4T.[Ρiy]GLc=]>!HodNnHUX|S㒇AOV\QjUJ[I\pvwHV&/:T8Kؘg'5lڬc01rTf1qmb[`ཛྷUjtS"tV47Q`{-"BRbW\?sVf%c`^YiKʊ#NxWkdcHbZ4_n)H2^VꞖVV#Z{eʔ^c!Yq``Lykz=;qanc^ָ,6nrX|pBm]u?cȇ[y}Ŭͼ?sD d,P<>`~Rjef]fe@AGXaLs0FOnTUt,e}}wbaw4Xa3z8#D=ehqYJ¥0dǢ+g3/aZyCVTC]?fr+F̌aGk~m}e/VlPYM3.q8f2,5ٗ6S:Wg"4?mDWuzsoT UPޗT?E&9Iĥ^Țrω$nI*uaNӚMqhAw|M `{)OZNvESLsd*lp,ȥqŚ2e4syw>PEsG9S.U]At_7'6P'ӽ6wH3{E>¿a{Lw3H忿&yˉIʣj}ͭQ+3Bʬ]^f*ڠ*ՒNSrxihZԂjG-ivP4nGGA{GJP'k OYF^P4LfgdL-U,CPS;ujWBA^äl?Zy/~vWPW \yQTl}rszT3-n%~!)DrnavqetIR,:>a{%nEPa:H[phQma:oe%ɵ}ÌMtRۆvbw`GVwĕWO`_?HL^xlPԊ~ `~Eo_)\vl͗\T_׋.ڨ[Y)ugwP,捔nHŒͅMJc18ne̖5mxz l\0L%4x]{Joe~$螙_VMhL T%Gq?_T\ayW?O.`Duz4CpcY.If7JF7'ť{EOR_ke,[r2XWPW_i/q9sĠޠ:/T?9? tjI.oLĀ(+e[ovyORKz;V4,Pvӕcw{[rG{FVD|B|LnnbҁQПdSD?cTz?I~;X*Ԍ/luiy_XRtsaipM~ `\peU£w=Xҹ[9}vRBmVe,hgLWb `H:S+В&na^xȅeBw(uJz~ncA'sGGVMlzR!x5oڥV'OT~\ir&bxPXufai@j#ϫajJbU1GftY$^:pPasKo4m>IDoA8*q,m\h˲^O`kGI3vs~æ7d^ѵAc iӞtwgՈ`xhLw|}X^hM@xa]M=[j;Ҳ}`U<.N"tE!m3p# sd[OL{iRlPMfЩY9/24MV:10(纸v胊8d8!M'+AVǸ"qt|nC7cX֨[*BgFZdٛMіowf]sVzwdUS[lMZCqk}rvLGvFRYcr\|G6ژKo`;:gC[qeFJL1lKawn,mTͶe@d8`CbEЊPo»r`Yl="pnGxYZ7|kV"{E[>Qb_ӧn_Rwlz^Eak`Myqg(OH~k=]p\yGz>ummrG%wQE6I}w1kB-|q(p<_vM^^p9׼osۍfdǥZ*\mO4HjZj4sA^?NTSS灭8WD+:qi `yj_nYkȈ}WɎVKoȐ&DoelTU{k/mqBDqbDfnlcq8ظS&|4U/jw?bSnL|fz=GoCKkH\0gDˁEHzMlU HcȊDw!HEyYo%oϑBxC\t1il}nn6]&@{Qc.âGQ<̺[5vm_"cdlYB÷zU}MwjO FqMy5p[¨qkdhxѧq Jo*UQ$t]N_h[r_dJK❴Akze\k\jhs…4ײַR;or+›c\oLqtADhp](UQJaZ ܨ~p=Gɫm%y9&i-ȍ1`]pT_%8e`퍸#E}$'z+VxlKEV͇dh QU(F'"gOj[wODb0UpgŌug\fhFqLR¥to"|}DOErtpixkМ.=*}~pPuPiicӠqpoOT7B8f+o|fZ};_4z^( ؇%µ^a;zmoLs+W_-aAJ[BFR6ќVZ؅BLqk*Q J}&~0rD/|0@u.g_;U+sowl{bs14USĊ[pnXfװS_ МZHs\Y}L}ۈJvi}=^yI8qb`\=/C;g io -)e@oH*ur...XOT(+h'P4w%(R-@V7v>0qbJj3y䈟js$z~"WN:bfjsw>sK>kzF;\q`>2_{Y@\TvȎ?Uc&k8TM9Z\6SY:lrkՋ}}͆"Mİi'NUIǏ,MJC٦{THaĝ]jLoffsقHUKuMr7Ƌ,j1s/$nTY5lk/]NԓG1SlgVGm:;f攽oU<0Tt뤆9N98&W7e9w{Ȁ4g{ۤ=KlW]4ZFu`m*zgyvvmn>Ĥ3*JoI?2l^uBZ^w1\fG5u5Q0GYe7hzI]ġr;oO}CǭwWswq͙ԹH<ˤ)mCSĂozs9Zh|]KYηuScuGrm[)jwOӡbD߀`FsEB[^UG[[Mj7rQb*ٛ:f|[hyU>xܠe'Cݓ~F{xX|ðȺb8iV{oaS[XpE@Pz;LiēUvL)jԉHMr#c\C/ϑjo2jLL`,HLyP@ ^`Eu^zثz@m4aht9num)aAhst]NA@dJZt֢4z9rU|0(|xx΋t2F~M LCY=jnpy'0Bw_q2g0yZe[yo.3|g3I]U2uGGR`~S=bPKO{yT]CE_hit׌_n (;N9}nnsND`]2H{tj{0nñgppnumu1Ds[oi+APo>d9tow|fWkTCz}ޅ7x59kx09ZcvT[`^yUptĒf᱃?([JQU_w_k'w8I;a)u-}Y䴋N ˦e˝U,GrBMyΜ>F煰lZUlz[ eމ>ݫRPf~S;_`ZVvUzK΋Ut”Powbk_\79{fjoBCYvo =c㎝kEt1lpXp`c|I /\^gb4TQvexxy#Y&1IMmD3?7Vۮu^ ?גZC/-~I+RJ:_LjdiRxۄPE;o኉G«[l-L0(K}l'sz͉)|KTn6 *c[ҠrЮxlq41|=Tt}ǧYGm!̍X*ge|qzNRyZWFNA`ŏDExg`!nGtH&pyD9Uܵ>%Ӌ$IoX]eK)_K~݋jDh XHAt2FyWwzSyMN`O+eo`;8&5kY6lXHZ|a}5 bfKVaEǚsԼmbzKu*{\B,U^oV˦XTYsvRpgNc׋{˨n`m{stA5\C*ކt9=_ebv)\pfb3#=;sG.΄=q]huY%aSJt)pPI1JhocAc@g N͖'R{CnX'|lG>XuU]1{^Qbvs,'ԕ4n"|}L~ewwNcRgJBƏՁ|eDdpdkv̫Uv͠&*RQ`𐇘yRrP`w*vtd|jIOk\rkT3X>GmPgw(g8:ւQq/ep:UƘ^|P2e~W>bldG*lZXi~=rWee+j 'm'W>\wf$ވ+a<{b%)XO#msS[Sl4͎_A]*JLN)`t&C܃VABԂzOfwTWekzo%@6WWƋ RaUk@i=3fNʛE0yecqӈ|IރJ/zPzjeLUwgPӵv<_pQQcp'Sܮta 8el^1~{r8b1>w,mwOۺU*^& ^rzV0hjeIHOtӵ[{(qmn[SKj;] ;Yw)΁NB`\roig,}hduTĆ9ar/mM51_ܔՐ3S/{xea擬THv<~Mh+ܶS9NmPMqlHgJSnfXf> IknԪØv\IfsblACɢ}jkpnoel6ďlx5(iMkU)yCaYpv@b`!^*D$;`@ˋhV΅l1W{Ghly~Nn?o{m_{VeW!d\c;YRd&ZX >!ˑxDq .l{CMw&hsb&sYu0xcmG9R'⑲&UFyLISY;n(Ǔ$N'g=P \lVQrt}"waax0YlR–؂'ZaъFfOafy.S;Zcv^qhmR/}ed~D]spc,M^RAk-HR3vqWz@G_w#gJ; wmIMTFexiyry ϟLIybT~<ȓ7?=FD@"jwGDY8VLkT}'MG2ƟndyOwsr74v%-7ܭMzG]WZj}u~o<̥Ii|Oo{W'mf7h|c ~[B1a]Ir҈tbY≃DpUBӴP~r,Q⃎hzxy/ {?/>z)wJ}McXdj2T.xLcX=갦7"ȶ|LK58?1d&ʖTav!1Xt}TyR#EXxJ3ŨZ>,I\Ba i`6MnaGulAwr!F|KmosŨIɘszbq|=b|sm@~`j·/ul֩]3@`NZLJE_lD*89{qēSެy<~CFu]I BiHB{H)Bm.KmHOۯh Vڅul내bEn|ZQpxhXKLwiY[ҧӯ}Ian\XTwظͤ rNOv}DCj ߬}8]qo8Jd;oXz'|yf€S88˷\V5"樀^OרEy7ɳV:~򞥽P[hPT.vq is@xz%|=|] 7XFbyLr@6 ?颽g`lbרknNzMlSm٘r4}xT-w=ߪjZBզePvS󖊖ˢbwe5{uQG[-z"NLaBo |`tYrQ*Iov렦R_7/Qjǝj0ZqT֖mzpo_[k^+a^wr3NFXw e(+{zu0IIڳ^Nf'ZH¿ZOmdNǺ˥'cxT29y%Iu{Zu=g@^ZsdBumcؓgu>OKȌ]Xfc_d:Nc"YIAbܭJT>I]IJdm~yKmD{ogaڋkxPY|zZ:{|xpwUW54sOw̥@~ʪPo,]U[^~*w~_y[s?L3=UE|^1MNdHMTnz>dx8x*XhD:'Aň@1>A/Y7ano͑xRkc姒 vQ#ّI݀k[UE$Y(dT2'WdvIV/^ \RǠmiLsv\jSWeZ}l!U∬:s[kBrBXŽ6?X]r6_cg/ca(=2xB_[nhyyZ(5{glsx̯jrHSnmigŤl LUo},n\[f 9 Ph@ZxދR݅ipP315/~]4UiUxF/:zwjmt{R|̏V}l5͈~UۡWt:lؑ}~x,sr76Ngk`Sf3;~3{KϡX>MXxKDPxOO[KidA7}5$AzHTV6^/NgZpM~ULEHwܘd-,)UEO2{7"W`Et2ϊo2߈Aa?hAkԥF9m9Bw[h`翑ELTrՔ>NP:ĕ|՘Q]w{؎OgȅfFͨJ VmYV:af[w5sElUhAu,mKPhV]aaɇ-dYhsq-µ>[|ƾPi8SIʦGtmňM6Sar@9Pibu3~3׀+gtzm[6wZgzF&ԺgdPybtul/Wh|^~UsvСRFT[a'Z7zvώgs0=Gy_S#ȑYt^&ցAQD.nw9/gZh<=iZSW&Nm@1~ ^DSMVsH\olnߛB[={~~^3%WFQAZ,cR{\r|g$Jzhx5t~n;sݞrR~-xMHqޚ1PaD|:pAZwZ#gV!i3OImYMreLkqq4mTRuh|}b{B}KsjySpZRnl9[q\.vMÀ5GJʖxnn[$kKxm~cXJءi)IO^~jؒcuj C&%}ek2u8XAcIFyPhUUzpt]ݒZ0z/z>OsSiPy7hZYuhczhE\S 'tb4S]hjY^zJŚa„քedQêN^~(:ZGʢo~bt|"~L5sTg\k[tiwLdZFpYqAJWMDJ39mQ/@m+}d1Pm{9BuUNVz]iэO_-Ŭ‘N`Cc-ClؐIWSnюeA|o_xsLׂDnE&:u2_lkOWwބΈ?&E$ J9^S$@Ba+^fulkzSM~d6q4ɅN!5eFUGd&.mRvyjP$c7vdvk|UngM}L92]ngyn`^$dlllMb[pz3\er6Cs,NgjUYgaj`Oؓm5E8o~;~BzoxVig{pRJ0K-G#u v<1Ev!}څc|`A@&DݛuUoYѫJcR&Euuo>xld@atH>(7?b|RYkm =.CiE^4~J"&̎}-dCw~F3|WHtZt*}urC;Wʪ3kHQeQ]V/=j9/KVaγsn03\Z;~C\{W;;ФJZ6{avN/Gs18s8|θk`dq+_zYA}S UoȒFxS`8Pgԑ}jPhj]DT\qcR:!s:>pASLgZx-Rkeʅ9d݁WYR΂9@m]K3zP[VH-2GU;S`R7ep9KAL`si)PNubDe!pREmwϫTbIsu\}Nphьզ'q{ŅMaHKq`mr_HvoBFco/5q=~'nvk7cg݋sY&.3Ksmu߀0lTy=3;qa.i0Z+Æѱjn*|{G?2[Ub?q@êU]0捎t4 {7 SIngA,`9y^bNsѦ2JҘnfJvۘYtP?H]ooweŖ^n9Mx{RCOeg5>p]VqΌ YtvLf?f.E{8Oz1|apSDL;Y< bcij%ᩭfw+Q~Y4n |D9v'+u}ESz}1W~@kl@iE(EWUB#OjF>usbM{ <Xʿf҃okV{d|r\NK'I WK$3l@do˨cS\ \]SfK:v5CIמ"c2c~f^45aWq}ڡ`k^Cwg]ik|aGs$\hVz{_Z؀u@ZWcC`4L\BC_p`<;ΜUխcVCcThvMjNMWʼM7~}|atxpIv\oT\y]B¥lKƵf7d=p0\aK`j,-[`E6ozea^UNd\KJ]-7vRBiE-rPPx[i6dYB_ԕҊhy%Яt0.s@Ȅ"6Ysсi,NJy&HkH'}=5qȨ/Vv<`?CѺ_޹ihFL9!uj0>wOT{NQɏoujXZOԶQxS1OKݼp#@P6FG|hcB>c@I[!WTᛞl 0HgGr*j7|z^a WmA8gYVƖsRŨHz1ay0[DFywQHh1h~ıeWɳB`~]A+CtS[L(hvfzVɈ3(BhKOf:r7~D"hxgZ8b%9izv9rlk{W|Lû;TDRq9xiF7㞽 p)ℋz+hgǺ8Pu5pWb`0I{B %%[LW,sCÊmqQjcڛ9A?/q0y•ڰjb_Rq;dnjcv;"rzcj_eGdquN_sX|gxm6eJ dqV[VsCZg-1(ȇ.ݚ 3aI&>v;nּ{]cQ еi]ynn]eqzw~Q@*9WSuӣgK4Kub\Ux7rzÕA!<ƒZAEYKQS3c^݃b}nuxY[ .ڇAI.=n:hssNަjhȜۜids%FM$TڧbxFYI nق'ne?dN͡>* #SZpyOˏ:bj\kkh*oanSPvSg7~vMUxiɛuKZwqjy uWweܔ4k\TlGvIYn[p̣E+pm} 7qml5cb?d"tsuF'.>+@ji>/jXJy˕`UO7ygpzOhAzig\(Rw^g4} n-bUߛNuYd)W+~QmRwfkrZ3=g0/ƙM_DCKUuN_bYp{Zb~oznOJ`s-weiQHMOc}_x[HaZxuܷqðQ_]mdЎTMOfgtX\#jKz)Qm˞Ё+msRux9Jgm±g qi@/4T3ԬevM-حh>}IAaLgٸCfD-ˋ\+K{u eo7S ->SXtPr2^Do.좂ْrQc.h•{ZfKꙕ÷ee_k?ºrtjl=E(EjYi[yuUs[u8@Rl,8ƕU>vfwYs.o9x^@먲uԑ@`ks?w8LiJ)&*V?muG|LI+7yBtvIDdwxVl@O})/,u`lTMĦcc֎Yhҽu`prrD)u`?اic*Ջu\gkmm!޽>rGds>Y|z:lUN?ͬ޼Iovm!Rb^͖uΞ%kVo`ieqk:{$]_~|:"š\+X,jN>3HRpbfNZblccԹ|}roShCLy{I|dvp*dKLHIHڭ[NpD @H`hLfui6o7p\{]@6Y|bS_]8UqXQ5W}uVcZ2C`fˌnRUKūajԿ`c즎ak|fu>2e`ZVuD uxZofBܓhqyt{oZ6rF]\}6`vfsRp RdA2$|aVڵќItLRe^S@Y7@f_`֊^xRɶjSu#n_v$-JmF.~^C~v;V7NX3>Ox_=Fs\|}Gi)tYQ5Zsdq?||PhX騊YZ7y\@Q{tlY>t> 2cL9LIlm cFe]DplQ|1# U**N*DWS[r_vtT[[Ue8j`q:k{듾\Eh$`\S$,ģ8Y(3eU|-h9nZ/I/V:qf͛J@]'l{ksWazbLRB:b;u޿ d=*H_.R]ٞ4avmnb^Lhh[Q[+sb4ׁQBxUO#O:;l4[mNl`۫mIEqbRf~q_laUS:Xʀ-<\BptX9|=F/\W~qhNCсGJ\"c4%#pQ̄`U_E; F@&(i-m3Q_WXkFEdLg |lO\t~>U/VJjhx|P6Z.Z.f{A\AuƷmbs~\hK`.YdMV}TMbJ~_`Y:F"G*sD|rxJ-mc`{f}gOÑVdJc>{%2J7ƌQd)aFJ,N,HC5X2t6N p慫A9EooSgPWg¦r?}'^[DFųczxIB }f篡 !s-e~YS1:{lPm|0^Ud,6nC4Xzq_^qqtRqahHBRG kΖUH$*eAfRR-C6e>,)͝aȖmMLo|>3Z_ɁY,X|3x}I[nhQsL\4nY ~yv6ңx?]ʂq">brO5EZnEiznCnZvVwt^nR~`r1@L-ڛbd4DJ0a?os px۳c%@Vcb5x|\ESַ[gsf<͋vM;ukoYF{Z,P/"Z{0aP'țBuKdʺjs=6RRh!ɌF$men|if1%|5ή|^lOB"-(iS7ЕiWDfiyQG%;/B0Wͣ}b|@nX>ݎ6fU06|DZ;;%GCn$YismLKS2fq ebIOP:λZe9PąZO=n!1{b2މVf[S-GbF~3NUɑ$2z:{o͔k/st~#J^|oeۍ\X7#|ƠU=hUrhOŴYvpV䰑褂ùlIrI3%v"{bkw};+VpcDg;sM &ûqV}n,^xՑcmsj~i]pqԭgHДփFÌ'aXzaD̢YuRn>nw}zD69d6o5rYR^kp8L}yS]șpk^;>VeIqG0z=ƥn܂S(mYƩ'DI1FMSMHʀRX}j| `p@ek*r-̙|RegzG]dvuL= u áZnZelmj1\X(Z?-L@ pRoEiՠQ CMyP*4v@aFR$';yb`jhžplcl\=pD|i|wm\wc)򷞣u<ԃY䧇n7c{6I?M۸hႅkAdb>=v}h{_z8Wt̴n[*`t76XlOlEuI[gzoXd?}(2EM~ʹpf&[+_;bi;k'bő@BPT'PHiGXNqh)\]ZBj\hW4wrWuu8!f:H,p{Gwy *6)P{$XWS |[.kcϝfNWxV2O>npj7Rq؅wf3?z!yzk)V|xGzaZ`iH.lHWQWͳ"DoPס4_׭e_1U%I`Х|ZaKnBx}FM/g8A_Uөd3bhhPdLytCp=*>dʻ)e9@bWx}^X|i}Ro)r~U҅Γtd뤥e2=%Is t.KZ䭑Ua(Go}j^7o`2OEgb[qf d}zhP]yDqO7&[\D`U^V rT[Ar{/ Z{xojp!z* ؅d:}*.!g4afj$?6^hwjsظ/LՈ[^H p ^_$ Jd"D JPΗ7ġWG~qLJOYUC x"J@t[^Ala`$FPzvMqKu{l|zFHtw_|an1a{TJl1SiVקF-j6/-d<66Vv/IgS%D&vMjLC|BĒylYlr\[B,__,H ʹ}y9b3~kJ,3ʤX1rIgOQ>QHĸ{2s]#;XBsGKrg9U_rVkY~peQZh(ί=k6#~aE^>:zu2xE*uX?oz_znkъvGk\{kfYF|d(Og=sm>҈ysEH0qFrwgFMQ2YxKm{{P}½1uҐw)hv6PqJVz\hSӓ҂ͱb"tu#caQ}l\ktX9CСj|WNct۞\n)M؝zIB?R)Nvqik3kmnP*rCyww2lËUf<ˤ?g ALxڇhzh8yUb#{YVRiKK}Qp]{^lDIѣI^euǧt֔fVRk|JhW ݃boT2}ЅY(PvD^gI-01q?Xң/TiedT13;dtV-?UZ+?n^Է|6BFuA%ܕ)n,<5n"[;J)[gKwIwbsj_䟛= XnyD*dt.ȯ;5}Ӓz_>Cu/k+=%jwAݎVic!iozD%fwkn>raҷ/lk1oB^c#wݩZQSwFr0P^Uȵ?I9UAɛ&M8gIw1Vg7}vxmt>򷃡_BȎeāYda‹pM8u~pq{Yc{bMǓ܇xY&%gIvӏ⵸N>cƸϕ/gW&SLo=L6_piQL``,{Yb}lnl=S@su(`D6mMHrZoZsJcu+yb85Po{Pkx푄bp1ySsrņ}>Idss}Mm|E/rRCOTݒCbիq&EbL0@{}O2dJoi&0H+<9*TClzax9}IV^{%Ofom(ȗh~lCe9b1[tLM~d-Tƣd}?lxl1sUrXbkk>es_jRtіd|]ZˡE,txmY+3&zx:q: Li2F(xS=7VqJ}ftlr.qSjYjcAO\`.qĒ12bet}kUuIlO|mg@WζiT@|5LlSbzxA0riogJug細wz%;óOMRa~]|@O}r Q`_42[,|jV}`vQf[ ~_t*SvkD[Yt<[:ets)tQS~QwĄ&"i&Q} HZt?JW4lZQVxJ_Wb#3e4{Ag]~$D':Ɖ}-GRP@U{xʖbዢđ3=6|Lkq8`ynjEi)][mD5vmgR0sa9,dRʩWwoh}{nOЍꙮSo5O|%cv͝_iOۛ|: g8j52@̌d&בAhTO|SQo`}%[()"_hP`HOgjRYS:f0c{lA<`@nc\}9Z)x.+Nnu=0Sy ؜㵟!ܥxJ*Way4o_nfrh_Kts=mjfB msjOa`:^o0M#dTnE!qRydk{6ڽ̵J"bxZvI*\U}cEXdJR}nzjm~jk.~v3`t)3S[ϸ?+" iFj0Оyy,T7ZRFĔN畠;׎2igR$dgeEhAa$\gx=x}>aMgHl3STI?צ|c ^>jZ>ARCrG^[tO_VT@I[IoSc=vhg6ev"v 'X1'rtv`s]rZuာG6eWl(pUW[t:g@f_iQɎYǠf9C'@ÃZE</9z^r[vCUyu{ϽvretÂfulDf?d׮}m9.nRfdw-R##T`)ʡk uWm$pP&Hk";PxSpCBŌb^xvg6ZtTJB'OxItL\O`NJ}}OΨs/(圚zƎLm`Pwze'VԷ:QD}_6jv~sɦfojVzw[i8b|g]d\Zgh*|_@ ?Gn05Y7dIckMvL2 I~okYx&oo0tr.oЃ1w+ŢmkH֐Tt=i~lb~bOmu5_0I:}8EI{k&v(ƁYrYB'9DkTI^/Na\lkxZ{gf$=pJHg%DqyQa9s'RFsrNh]緹OrRGrZZe,GdzdX|ֲ?Vxn*0!b8E8gJfsbrIa?fwNhLQ>0a[yL`oC7`ql_SOݍ~R<׳+H\JXS`OaтTqKSfNoQhKdk3$Pm`Pld_kYGZ(vjzgp~jMt_Yh\RdxVaZN:O}^+p*ڠnDwɄZͩar?Jg`;OVTsFPué}7BIE^@wOnCeDT}C dݒ7]xeDŽMU֦kJiFy{k;xٻ2?Yo}[o|$a xaNl/xoY?KYƁ.rٹQwTꗽt6{_x>=FXib6wuC2fm\e Urclzj’VtEc~@t~n]TaµW[yT|'ElFTm4ZhN;AZj`]Dᑯ8jy9m[|Fmf],pEF 4ڙFQ^&^x߻J[]ʨUNSK=xICtmpi{CcuDYyڌXkW[;hfPejfbFu﹕ 2>BfO s>~o_i{^_klrXPutWK+ZN_dqjisQ]YnԹ7vBhUg•~[5PS2I6aY_!fkj4$du~Mum,LiM0G֖VQ?,bќ}~i/xYuW.cX x82se+^Qh±xmD|eD[˛sex8'8|Ku?IUf"{ѯ^Tt0+7~[Q,4ZCB.0=q0!fg8U2m-Z>ͫ˯fʻЬ=v!k6}Tim찝ZvTTfyQdJ΃DX™ҫv@'<;ڮ>wS>#_to[fUi&e2KBqpnWaUiݧXw6^Ǣ.![.dC?`y/)tV8JI0 \W{v3=1OrqzMd"P{TbKZys,J擫{ Vt^i&ڼ{uWIe(@]ZVyc/S\<^@WsNCjz\hf0zltI`s$?-Un׌px&thGVm0Y{sfϼMj46riYg}h-|:jw_Q+Pg_g۾xl}lZh@)w?7V]Ƞ򻗑pͨmEïκmwc]Dg=st˒Hn,NwEoNw:3l/jNҿr@IvD4,O*iO6e˷KUv5Ns6r䀄ajv/“=Zen憛w>Mp;cᣉ4XJ14yGȵSU9ʢ{eoO-KH%#\!}h9O1NsgUrY[AA~78ڏ*UrܗT|M5@muiXIi;TwЋF>ymb$\Hɧ|YZ6>\e\_znTt}]qneT⁷f׭;-06蘚p vj5)Þ4ߘP-lSe5(D-҃-F{f"xӺZB(Ec)6xYpQgri~0=W[z%[J^f*,xxyΒEÿcz"|E0{йRcc)Gps-YٴJW ebfkey5ssPּg~DbTyVoWlj:$=qixfMoh[5_qGHOS A ?b4exs1rWbQ3pNmJV-Q-D^7L]hb.nzȃྼLөtk˗y~ȟrrwʑX}zD7UeAdmn`{ʘyzυXQ>FZch|-wlu.{hʶq|HX_NJ*6qc EjvG,\._ibRw#e$}|x*OaYzZ)8gKthfyWόƜrVs7GJ6sz2\wb[U9Dѡ~&-q5JIhJtFLCQOn>gpacbȔX\m4d ebX=gxji̟윳F"5{bpNH@qh09|1e2LE؎2O]^K+WƏÓ<zWL দe`,C<|+r0>lk1c 9bQet2QA9RTWHGϬE\`;vN~J3otfqpl%n~7u}Ryzdi>\grvgjyLS`M3i>a8ltNŢLUe(b.fd`+^vȑzO|T݇רqA6ECjoϤWKPuvyuE^Ԉ@F0`o@ldb0섡q{ ^rÞU=X!xC\'A)FxUxa~q mg"3873c(wp]>9;3~ͪ5 lzz>UMà~U~нVBe~\`%6r@b7bAldˑmәLygR剔UT!jQTùߎ .ʘ_dل\#r\o]~=NdąPLVSzZ~ Zѳ{jmĄ܍[CRN$*ƥT#0ІHsυhj8EcI{LA^\FW-˞RTdoӘ`g L^'B"YDw]>:~xmeް`!"䖣OO`x<\Op"+.kttDcXa}*xK.GxGeV {(Ui>iWĩ{4*~.R/eRpvFhiFfF8TwG|΁cfX__,o i3uJhCmZA}kadn:7׏ycjĹY^]7ʉpl~m6M_{}:7igBTE vFi>k(;%1wF`w7^$2q_$xza}NN:j6XXssd ^h+az(R(qTNZzo\{@;Ie~_͘L2~NMFeʗfk9!D|rHoarվA#QUtr-Իqj i0sOVג|G@X\rb}<1r 5ZE` ^{xd-gѮeYMaqdlK~sIҿ\fW>ᦖzq.Yo4/!]̓ }^@z}kF6[ _iacᓞziϾYn-bTyo_ yB6Q;`=MӮ&cff})xdG3C@k8PEyTtosv/daOTVPGۃrR?^szLG=Ks-•w %D,k|r)t>GYQ{M=Xvvi9rhx*``GOPFxA9woZl/`8p€izܐoمy#VW[j_O+~Xw(j:;`gNkP{)efýQoJTLgΜKRPpLXmwilsWExEXLN{jfev=c}Ho8m_tkC 4F^pharE_6sA|VTb*-c0`]'\et_tz6~xp2zc6[ l`es&dZ` |[ꞟyYgzzohE[WH>[ʣrԳ4B4iqP@on9 XgznX ᨳlT^\u$Nͨx`;oz㙖ۇFL]du%͘6&)ܧflRbEμUY`5I6vJq}}V|LYwy/\&(jo7TS͊Rno`P?r94壬;ZΡ+=v@ʴuj|G=Β]os+yC;cH5y]iI[YvwbGϢUaOGmKjʀs4GTu{/pziW}q;]Jw&_wX|d\H@H2\'iDXFoodž]ooGgVo`vܙCpώ;_kxvf5>Ơ̈́_#&%=h8`!Eb>NogMqA[-9J/}}zPy1e2w:ݟ|QŹK`qg@AMbm'ZφA+ίߗK\xyzXy&wΞxU?8v_+% N}3` vEgPS"uB(qʵR~EUNjUvcDݖvr@}tܤ]i"l!WQ9jG${vO/TW@ׂmF2xWZVQR~-uoؒG1bfk`_e4]}SInvTe=}VS|ms5)ePDj_zq'L=~\ H/rM{w_Z VJFK}2ts9"-"(sAIRL\ϔ9S}mqsrcf&N;rVsc^uȐ1Iv./5ukZyrA]FiF)A^C@r~O5$_`m|SњL;[n|bwi\Dzxg~~w2^ eSWNRtLSXl_v^\v~cEX}X0m*( 85 e\1ވX6ysؚ0k@mBdʋf]o]&4YJ!OcIS_|-ilEƻ[qaͨXW8yMUTF:+&갼YHzd>#"xx$cfzn6cYUbWaL`-NK{O~,9!yj8lY_o:o͘DeJ7Ba}eڇqDP\HE[ !{LԴjwV RCiGz>rA]Sjq0xy_oXX}d\ 3Ig@Qs.]e [\Ítò-zRo`Tn\,^Jtߒ͍aJf'_a >UZHYerV"%Gzݿ`u7@xqay;Z{8a#xp+u0vgy]8eVE3]OG{uX`Tba蕂lG]gdWW_~'pMzΪ{M?EnlHƵct~m1ƨLt3JeJdW_y|rLՂ~BZ4Yi6U*+D."C{yjYxUYEp嚍hYD_[snnfĥ>]:RvG}KzToWhS fTXʰp]xfXIp,jn2zCy*}!Znח*zytbayڶQi!&=澌Z{uf"d1 [MvdsǢXG{v4[ZZjN)QkZZ{񇓏0oL꾆\hyf|s\Kogugo6U ' v'yɁ%_Yqŋ|5l'h?Whkss4 S8@r,h]UYόqġb=vR0qrm8ZUBU7w}h̥uy̭WxbSLt_`u2ص1y\_,۳KoŎS\Yws{|bzҁȺ-Mr55T*bϤƈ=aXۣ,TOf`P5Ntw|ӈ
W ]]hw#y^qrkCx3mLq]g\A5'a;C4Y-ڵ7$lfN8N)gGLYREKaꅪiL q{L;PHj2OP^RvNVV('mK𣈬6LuɠEl"mtWpotmIbt*ΟH%?# vuG~=]pӊ^f/ւvq[I).Gr~Ǯn8atUWXQČ]%bRqgmǭ x+h]5llIiZ>eYknG9CeSuIiUWp".V]˕`]ZWm.cKE}Smh*ro8q$Beqy y~p,va/<êeIJZFkX>xLWؔd\?ъzٵDzF`e#y4s_wliYzgL?6pe6&iIop5Z.clӷz=CW>EWƅ^fYUFqFtrLqQSyiUy]S_dr^NBw MvCVYspG者dVU]dUYJsj}]{R}j-)qP>!We"1.Fҁ৒ftox=LZcPP.4P=)[wplp_fȴLteQە LiI~?sؚҮh3fnidffaOqHrnWko(*ICt _taΈH9 Ux880Zʱy2c񉜲WxgV]u˃GE֕$!S/g.}c^K?aM WRV.s B.xKgݨSu{xAڅpj|]`d:~evc>[rlS/Jr|{]A,dy\ԥ_nxiLih\GpfbrOS/n]zgmw\q:dsu(rLMsfT)z=bZ kJj%3$=Kgm_qv?r[_8o=P,xD4YPaC5Ma|Sƿbxh?L]mo}Gҏx亂iV6INsnWZY Ѧ&um{b]ys9Mô\/ƏtٚxmKgj6{lB:5bt*e^}NS.wlOIzhfH4KƣJw88HH4sPU<ѓ_ ɚjXbT!hQ[AՌS \!ޒ _&kͳK*]nٮZTl26һBVjvfkA~A|^ƹC"^]v>zTgш4vdO!gH{bwyT5f)l} .sMf\Gu3\)[MR[L%paN:lBzo{kS9d9z`xS]u&m̫\Qc< '?hvm9/Op}:}Vƞ/42axI[",e[t{}_vL{|yG#EuAq `¨d'ZՑTIMhdm;n ȲHsøKrWcl,)v:_AZO2fYQ44b;~n]m3.i.VU9!C1h{ځRoh`N4ۇ{+>~O|rۭ\)(~ehgX;s{_~h7dU(Q2qRsdlx;dqU*Oc5Ss(FTXʣYgrQ*fqUǠb8qǙ\Z_nQ\*i>ZXmGCCdus.s=#~ܦIwybI[`X>4kWW` E^[ v&[_Jlppwɛ:~aG /uwESFgAG8#.}]{Z\u6xw?3ŞWm<F\‹:=.ꗤK[Xl`sыn\ͬe҂{W[fzrr&-;md_vѤ՛N1dkow|p\wgI>1gI!xN؊~Al|@-Щv6mݷ;RӢ o|n_6_v#iCym 5)q`)<72[}EsvzJELV-nv8uk e rƶ\/$yb~Gcee eepysHSvl٢2YIoWw[`dPJ|`qy q,(A4|6XP̸-r`fM JDOHNmbSڨǶ}z |t{Ufڻw]jhD]󷯠F.OPNBnqTRnӗӗ%F5;Kcʇ+[xq^9TOgwgm~}j5.O>k/xlhVMPVdbV.kakWq֜}ҩEJkg_lZU44ni} iwFbXzS3Z}f" kl|RT/C1Reltrq->]>R@GwI]7[dpZBOsl`*0eOPl^wQM[7CuBdg_.4{{}g]g[ƛ:DčvlNtmgIV\T$Ro?!VϏ5Ǹ1dlzhgEs$o#]hW`0du^UIp˻qMI.kB_CJDZ-Kt_~uA PTEkha G"Uy@yi;hQes_:@Sz\榞(+n`fwDzkmڰlv]*Xga5DW4}nO)Rw9 ]j{H{84ki Qu>3ޚSE}Zœǟ ir[_E`GcanV!KdhmXjspKod/yJL)w3!>΂̖El)kHj\{,`tܭSy5QeG{Nu$pvunݍkϊmrcacliɠtY#ӁQƜd11{3OOxyYΥB_A,{ZG^yԏ5sIGQY[TDC}RN[DC{K,bU̸4m‡ΎY[Bo%s[n8ֻ6q^w]g,XF_[iuF)fSdr qDO}8ᶲExz/_Os yfhLEu~[zbn`GgɻYK }fKŒؑnUlp]z>?ypX5aJ7uJ.)I2fdhMmETfCdJp<޵TT|pN&ɏmuR͂a5*dJ~\IaHAKRX\vJ".W3pNZ^SBblPDTJuo^}UwieHp~!vr5E3lKyXwTnf1f?dqu{I4jdXO,>e]_rZv{=OmE.O1W[Fܶ_^QH~tJuc&|OP#1R@lkpQc>{a"7!Sa.⟜WͯQ=<6pJ;.ު%㧠"Hu~.YZwOpðiriOhCs2PXFTN6Lez]eAuyH_IF뽧<&c \X*`zLfCN.;e1o=OCȬ'kqpT6I*YN)__h،'p|z)o^/ Xn/zJ3EzņzLrik¨ʎhK@wyNINQLANympfĘƗU¯t@xM/bgޕ~ULK, {q3W`,;ZbBrɖqUYgÃ[ R;p]AJAAtXzɥEralv-reMLlry6WBx읗]j@ї<"U:@sueҀyxVj^E{km+swL*q2H/[Ys,a6|F>tLLa*;TxK~]ŋ|":ag0d*`-sr%&D~-O`owtU(`|ŨtCnsi.UdJݘ"pqv^nB_hue)ńk6˜"i:q&IQEUvϹJJ]8hE?FB2]$ߋ168Vmqxh|hQn3tqxcw[ 9MthOnI@j]_mveLTN!tZҜ9foDsTQlr\.hjo</gd_xx`kkxZoo^y4~q] filNl.NL\)zMj`jApyr`/f`b45Ji~}kQ>w[{@_FKOv㸟ԊmRiFǴsPN>]vcjzWm>ia{yYh]ʆDk!dopR?0,'V_M.V/b"X RfB`(E}wURt!~{`v"DKRnixONx)9tD[d(3JGQf@1)S=eQyYfON_+ҚEBsZ\tUW}CS$tvBv]^g~}G0#Wք;`_rlVEAXٺ-=Ij%bnh5hwTGÄX~92Gj6De_XdGQň{Q#VlaӎLOf\\SJE:]Fr2_C}|thLk͛S]Nb:ƬCJĨwg^VFS=A{SCTywaCe(UێAr]FU{ˑvoQgR|VNxö𐌎bvpXC)d˩ye$W_QGoWvz)p܇q٣LjiϟuHZ{\̂џ^gs)MaE2]I4:_,o?}^ɨF{k/wю>}gtn`Bt)dϮ|[y,aP}ͮu7gӃMoNMENt>Hȃ-Sxȷl_^rЧkbVR,PϳDzb;|T|ǜs@*S2UJPt&bdm[1-zk\d|H[՘`zsk6{j~biA-[UTTdfG]6ATvl"$ϑ2Wd0cuaf4io}lP@@ًmrL~sq|muxuo8w]E_<m`]jto]WpG*Ȏ]p}DN튓C12+@JϥShM?2__Bg…{bԞrqص^\Քr{ׄX<1`ksay9a t(VZkD}ե[c{zJ~PW9&M~@ZLh`lXEP.jA}]˝w ~U~Uqǟ{Z]6=pZURL0wl{e$fckDkțp|DgHjC?c-?KtsPX*_FzG*7uω"- wz5wɄl$gW_bfv>njZxmC08mR׾L Tj8&ϥ~!{DPqHWPsAgWBHmů)dRώe()?ajҝlhuO1SӧSicĆN_kX,ڷufa8eap-EVUX@\Ȅzv),y)0Wc}]iwnLO9lL݅f5`n َ0>.uwWp^НqUmbXwR@FRizbєt{'t{eWcAl0Yw=veĞsEלƒxU8d"6=}ڠDZ/q=diBmXxDxDݾb<TFGTqR!ף0>ښ)НBX@aSxƊcZDof~1.Pd}"|aP{Ԇ^^ZL3>vhϋ*Ø\*UR'OiASOvaÆhԇa_p԰sywP2jB]?zxC@ljѧk!rO&o~[yh.znb55lb,ˏ3cBRu\idpTJuhYS~d{tz4v68Ohd,cs*6Wmyq5~ltYNQYNp uDzɵ$kpNc5h@;K}vaUoUюCi^}HeijQ]E҈!g`jZ@P8H]xsYD%pF_qpd 8.\cGSU{<.r;^e$A}X/zԙE~UuhobŞNǵHx.>NvOnxiu|lǍLI_RpÌŦGVP}sħiLx4Ȟ3MW|[jfG^V6E4'9(YwP1Y6xr];wvS?uawy[xgcNT0Hº2^W2~hSy}eۋrxy~2H9`F!%i3QJ_LJ6p5ȆDB[^yy߻̓oKj kCntqBamxn7@5ȏUDAvB.ݳWBv{@-ª\zDCYg*Y&V^S`8iQ?7ݚ[J[Ҹ͓XXTfYWԂګRg3D:{U][`r"bl t{zi^4g $jd+L람m^Slvcu=1rgΘG~ Ae}ӥ[w]qW@2x2Guj{(L||e\a) M+YvzV|G_<%~jUhtkDq-[Ry~Br5]MOvX*cxؔXNڙyKfĉoT'MPz_=-bɗT#@5veɜ@N`1zOmo`m:s@Q/gw0@UO9B*H ⯑yiD\*xVk~)fOP~ϭjDtqiQ 7*\Z}^|_PMS/ kL *$;m1_kB;(7vUX!`R{ro?D]d!nEj8c=Nd?ւl94t?/r"‘YX6q%z2kq2rqxQq}3CVo=g}[8kiRSYU@/z{(qy&Ve%͓nbjۚĤT5>Sx{|)uwH^wH !L7}tt}돦b&K[6[ЃPwdc\B:Obpka(l!s N_^XV5-'Q@o\oǁg ȕjzG \2_̼iY @$^EİvɄb?((RߓuwȭXL2f_1{bVX[,bj:mV@ sxA윇r0xt4ӃQiH6oyi6>f-:hS:t@-5 ?k?xAfAnjQVұ[5R^\ hSnwihl~갉5HnuWePatր2lQRNw8Caڢ*(>#PDhP.Z/ȠzIuφ݈L>hHaf[}IѪTaTFVXzO_/zUmhϷ~(`N{0ėz1HgXz]1]9]2TVWBa?Uc]־slw+bw;JX_4PawtcgX$@FVI]N=nKZDfXTvAvV?.yre^_n!aDkksW}~yWƃ`v37.F-O<4O{MSw.zImsx8BGjuX#~$O}Xrhasp_wvQEkSmwCN8u!'Qsv٥77x/gV=UllLߛv͹d0T7sYh陸q}!I5RҹEixW̘M.`nؒi<ހO2eyـK!}uIDIVjHh9d< llOZazm7~}uAE} БfǜWWJfYإknjbkNLC`.OWY.31׬WB:}i_D|Tz]VCzrqzk!nOJY(\ȆZ8۴uR8bxf7zn4~p|ԞxleZLJ*Kb]jU3ukEz[uVʟ2acH?΀t];tR=TfސNxKa` AZamE@tzɭ;_E!yXRqoIƶ6bxT9"qYS옓YAw"]fz'Ǵiߎ_kX$ac;A}ÅX >,MP^gaNEqO|o=klP"tfPz|{2=_҈vJsr^}>b|a[wa:/NjkZHJJ;5huq|CsOnN,IꎈW\H랔zp~ӜnZQ?l^HY Zt< onq(SαŤyHr 4cފtCRդ)o7{dw8sm*/3QWpDSqqkcq!neE^*HN[Ӊ;j~|:NRQXӋWxM^L|v`h{-ss*94/(b'L^`xj@(7rTT7wmA8y~gnriaPscLk-tH;qHj->Ŕ|@fٰ"~ga{?_a;YȀÊs3(ɵ=oC'OGD}lŃK2=U5M㎐kOVpgqa]FoSND)[,`g^wf}plpǜ2{/dSwFLp@Dn薢fV]en`'p_g]B}M9`LxX^4h&WyBp;+ItHP3Vsc\dKJhל͕r`;wqpmrPUhTPQl`DyjP,tAZ$;) \X;CW?Tjg[LD!=l ^să d(2)[؎\p';3!lhqSIYr~RR^4qԵ_ДYnSU[yfJXxLsQE`xS3bqslkNwysQRQi1OO^<>;hd^ʬ<:rCl8F#\Atvfuiwq4esNHv/nu[S3[aˉeI5`xیPUP-TQzeQ. orO`_k>x([dj 3g!>dUp!Yk\iT8V\;A\jm.W?BIʦɨaLǾ;WNRl @\Ty}hu{Sx[WNhc}h^Hih{6ԛs4dR]ay蕊SyKf3q~d~]Atelo^v{͹3&vȤAe~oIy܌&0j1ZZGBVюmuf/p_rدAYpߗ>MrbĤt]Q.>tlРt~Lg/Υ)7x}}͜WuB(FLRʡ }`MK2 u3]YXRIapp wYާaHeRm|)7pL?kQ GWoˮ1M\G/GW{©rAJZr*\J_zYZWQFOoޱUjrܿ5yWPPtmh澌RT?ClLt_1&ssYgʩlY½seP`Fx7lbo$=bryq~W}͚zj+!Cpo7r^BK6GdVu?,FH~CXjRPtX*GVyzZj2A(M}e'fcfdOW~KsYx[vk>aNSWuk^dR `A' Ods³5AZ3^ȥ9-G4yr!cc?۠EL^3$=`YnpMjޢ(MŒx'6o0O͒|g2\߰Hii2d10ЋubYm*DmlCh]TI7aƻeǁui.y3@4~Q_abiǥa] E4r?KGOuHNi2YYX\u{/jNrxҚ68d~`ٱLZ| K7xoު`Sݙ`Y>ϗ}MYKՏ?AbfujHiWiWEP+\M|-kW_[xY/;".ZUˊBmYHR>LxCʆ3Dbjd8UWOǟ1=Z]zUoxBHzδxXVm<@8-g?F]IG^"bp`eE?s{KGDDHhlN\bpbZ+f$u,nk>gnaW RIjܷ2|Qv/[<ZI=*˼](S;s]1bhŎvhoaVasj8ƂXZ;Z>HtWTUȶd4kg[Np߈:DxRm/j,O0U_au]m}a3pmu~r<Ƙ͌ƍNE)Pnmq^x^+H:Y{.Ne^"e7gkbSj3SmXΞVuҢ8V'󙒇9ndKp)%izqJ1)pjq+zoO&rmWZ}o!5Yg]˅yʞZ%giT|"Y$^hn34jЁ={_7MU;qu.(ueJL쨤`IV==D67]iv@X,u0KA>i$R$mV]ξRl䆛[noRssfPjdo[0ʅי[jstbXZZjk\Mk)s^ŞEUtlVkJQyI;ċLM@nGO~c+"~ikNH٤Htc逮Ń'|r/lQV>^ը3QHqA#"/hw%w?+AjF_ @YD!p:ʺr^Cc$PGwDLfnh|JlGaUh"<3v|CBaDh=OdpzUgF"zAYtloXMSjop'}R5B&u>0jNFXD#a`Rcs$MdR `xSżV?isslg[ JyB;Y]h=!@2[bCe{o}C#AMr6<FjyH,܂A}|Gq[;XEL~Q:ZhaN>Q/iOmPQiZ`$Rr,v-PpZyjŚ| L)uKqVΐcU#trOwRjF{e+cаռYpA}f~8mQCNˁnEζhH˫UKNN傏`y.Vr^:ii)GƂ|JFF\2꥽}=@s{d~v`{Mɘb 3P*Gn$VR_vGVEp&1mo} v&햪TLi>t>Ӱӈ[x9zTСvbMGDTqt"pƜ;PbxI'W>n8|BXg7ZKHHQ]0J؃GCryq-'<]jiߥ#5u)W$ }힠DqS뀳x;QXy&5M !_cQ23LgqT0pWcOM(gqYM4}|N@ҡ;2BPl^N&;}[Ă~Lks7ybP f#y2f^chPF?Yp]7Z G\˯iL4N惼ƊJhUMWAqbmK?oE50n?6g[X$e6h&vaycU{6YJi sXm6:$]fIȎ|ICtuNzQS[@4+&TjWtc<2y ddz0NO@σcc8ߕ9cM_`KS2In!;r>iCT͔h]6C|^BISt: %Pn t`-mwsk >M?hK/-}4p醥ZgVױ5A]KSoQ}W2ʅf;[P<Y:9oNU Θ~kkU~)6U<4ݹ?WinL2nQ~uhԑ[&.kYPv2nhWgeFF'FeM`?zG_ ^uˇ֠gpUXS<53PlPΗܕf>Fn]^6G%=MYwK>E %k>}h82qDqR:[HJ4:nTfړ{-ŌH≖xygi@]ABuX,xKO6o~lV_:I*Mc5ыطkIis44\z^HjjuOgYb``y/J||jocŚAimQnyF=S"dh:#{T:}[тDɚlSbJLFFB+dzo'/BZ^4QxĢ,FAnW]}wo[ZJŋSK>yV\ZVQ}||n2YU~sg˻8kIR䕁6@vHSo#J9xb~B {|sOtvZyVɨ'Sa{+u68–'JiTWcO]KpbgRؠ;- vLjx5lqedP]Ts-aea U"dRr%wzTNso^Zʩ?RdP)lT~9g:⡑őeln'b=䮖sX;t~¬HݔSCW;ze_zoߪq~nUNm!OURsX|n̨ovp{g҂PVy)@outA8tpzp䶲7t/0KuRğ^ZqiZJ?ϪVXw]PugojbqMjo2MhU'RK&~ vkr/Bpn-`)d&P /lr?<&Ee]gM(hy(Iмtw+QI[x1[]DZ>959Dj^ݤE;jj|2aaTz4,:iZZqhblzVvcs8y/WFRw<;Qv`2ﱮ☟ȗ\ZPaSiWQL:d?iy`pjk1fy@'z>T;ǿE7hSքr쓓J|q@|LYKC~^K:31Jpfg*w{G|i눒FCc34wZsRK o*m*|ip_rD\^S}Ǔ_ؖ24Ud6Hϲ=qt9eEbiRϐe햧i{u;fsQTGE*g=/hksWZ6;oADv^Lkjm_YABvtl߅E#9mf;ip@Ey-?]jd=GEF?L:Km.#QIuwJwbзdyScQ^v5?{toW4#9K5'GȊښd]Gy{ov04pͬp>>aPRZRaQzYqOIڛ:bNkij}KjoQ`s7N}jj>_uo*r~TE#ҧnpvvRTZD!;yTOHcvnflk~&WtWӛx/:I]"]BʛT~4z7*7Hm B1t%EA\f~v3mO`;_d薖{}A:YzweP0;p}yv+RIE@䕛e#ӼLsw"erufFD_Z@ḍX=2ԀՋFY󜨎&ye`FSw6KQb.k|[cl`YS4dkaʉikpůbڱ=lwOJuv6@ sjj]?oEpd1 oWS[}RZ\9r,XIs1c֜8>UGKOgqxpLg rqF';ØnOz z8Pt5gWaG^Zn\W*UԫB@RȻsoDyhvB(qTbјERBN6KѡN6CQ^bX<ل*COƗ:wa\mdȁUWvROХe1ș!X4bf\ʎ T^y"Y<Ĥ_%ΰ\$Fx|a[Tֱpla@]IU6>oef@w9%|q-w9|@M&3=P':K>za/4qQb{ VUeG!YOE>stkv]Rts+iX$!8\Yl|gvF_tɂc{oV8[tUI|%mZVdUwA$f=ydpKv_skwo4*q}>FY-{PNk~FS~k_}}pnz+$Qc0pi{kVPA!Go2^:н?¥qZFjXʪxF7E,d^^sSxo`9S5f'hqh‹@<݅opΈ^A<•(S_ lq`/(YI^[37Kݵvڧ>wk[cy}Ze7SwMnu{BZdVͧG9ZcF{CXo"!u@戎+?a;w1q P7)9_QQ>k|a^SpiRR"d|cM1'3gsmuv}\a(Wz:gRpn hk+Q|lKZ|Mxr6c`ff]3=mq+TD+We~w8mr>K8~ck([~0S;ܟ|sڢsg-G{l2#m|d25 z>McqvH׵u~u=uy{oO^wuhV$FsS_hS Ouxd6~=Ѵ Cl5r?j;a9_X+%'.BsIx軐 r~8&;˯QjrG-d2oqcNa_=?OAQ1ܩxCĽmv,c3D{b]Vd_ ς=qlҒNe6Tt/ќޮk\[rRx}@Edd망yAsH+廈a*Ub؈ZC{^qTbnR[n[Y`Z\`TjKkx:Rvlrs|pkzoMɌ|q̔10G ||=h?3*WpgOT`wȧjysAfITUidm} ^e~h3JҲKDZxwn3uϼ£vdj{n4QZ|kxbj(] Uِh\Zego9|XbDH_z[ƐHcNYL.wmPNjPǏ9k>L:n$Udo\puzoQJvjYHEavVSsDŽ!r4`jܲ;c?tX*X:xFWWvdkuW~>ixI)Qn]r]ŗ2X؀{w0uM|+7i"PUVfҥ`uP6_vziggR\^ӔAcY:UCc7QUt֤6I%eSd\ WB+޲>Zc<:MӫaPܽN5[mLtrlL VTf Ԣ=ȍ;nG7m80Qaߕia p} X+[+ݕuʐR]m|8nfl}KfhQWME\p2DY\m^Kkϣ.H>S>`KEz*.{5:rHl&ﳤQ~4}YyCC֣è0 Ai'~^6Ԗ|_/qLF:`zWוO)ɞ ؘ遤pM\fZWD)UlCx–npz&?L]lp5)_s ApgDʦ\om\_$<`p8=*O˸leaIYF.UpX3hK<`7U4iq菳>a{Xq`l➞7nj/ݦe|uѕgjP_}q=SVf0oL?#ҲaUwM2ǻ{`wY-}O[Qr6_0JށzG+]mx3ťnsc)*Uδdd2]'Uӑ"EjTih[ƋE>\zިO,|ƶ|PӑyaTwuMWgf\%Z XyDKL~5ji^6$@CEAhart˗u:im-VouأB\'mzGvzrV_&p̸q2ܖsh]]G.`Zo폛jeۥח)n[ĔS]BJ$I?zѠ,x7jgJzΩہVnt:]hקhW=_HgLM`הԁ1(1jO:zBɌoe{+i~ʓߞ{;dnlW;Nǃo<֟Glb^ !5g_NH{~kā{ jm QHwtO nƉC]2*MF+aZT?YYI;.z*;epMhlrQKE90_spgd~`kuZ&^|zz8?QՅ{PPˋP`zs`piRxN޸7Zhr}r!ZH@thnlFۙ:"$p0ϒ3{#OLYMmzj|eQBpDCwxt6g}2M—;i\cݐBsoetVt~bO~gIBa=הJ\ǐ`OsђoA p}&Fz^Qp}~2VW|#Zl{|SMTˈwзUAZJ2o҈yZxKb jݜltǣgr{tSDȀuFa̟`jDٱXXfY:קguF'7rkx1ꟄTwk}F_oMj@_[|>AA^@5Nf{SGu)p6i!dpՅ,Z_(tòdjR3ybSUuJaTiͶWRyKBbl xDOqNIP9ofZJB'սuf(\LJ{GUCѺZ؏bajp9%-_gbl3A2S]@e,a=vxa0`uiW+KrRᡁҼfZpam+sTaȒE[S6x_\Sᘻ_ z_{qwp9oP]{e[aHUQϞgΓF񈎅_o._w俨qx~5iCVBs냱6ٻssp2_xh_y쐒5g|ir{׮?"S4kt\oMJֳ~Ta_1zᜲ_yb[Fg{{L&4Web'}h*bmD^nwpFnezcSY퍫uZ đ)6lߛ~v/ZYEqv^+2ycΡ֥O7E;snuz CPuu~l"ׅ7yj^vvHWPrCZnvU"wgJRTWvWs|mH_O`;jui$ƙ^:oIhiAUcdnmPss|w(/Ċ\zXGSO8FVr`Ǚ6wGcuZ,n>ǀV VfKXwx`ш{yc+NA?eYקԖB ?ظdtLigљgɥa܀zUBLdKOʡmqsЧ?+hpNc䧷V/d\w=p'rxGr(VWdil%=|[M9|>GZMS0ׅQƽ`ZN@~9؉gR?cT;%@(Ve3 stg %jp@kqqYh\}uDTWxy=AC,>Eze*`,_cVjj~l!nT}hԸrVѮBsˏzra6m0@[AY(2?`/jxHwxb*yRTeyhy`5\S)N]vHlk?/HWJjg v2u9hIf&= 89NknM z~KSk<\HNx"DoEvՂXs:Ï|W~u2A13it6\:f}Oec[͗shd.,h@ryN79T~fF/S4wUto48~4ó(}ѪtҬ{^v4^悼 mBrWXD? VI(u,<@gӡ9`V%^gLiw No]~~l_\LS-V=jӊ}қXznD_p\5z= _mhƽܽtyKeitt>u[:Q ~5CjBtخUircXǨwlOrj9r/qy>}VnnmOOxWM\x~~skA{+|ࠜeĭUX8):vlnO"NrQ?IBgSBG[ҿ3;6Tõ&EuVEjQ1Dޙxs]V'vWVUJo)%Ot\یTą^9?Bz~cḆ1qW|jV$MSkxzc^% Ɯ@Grk vIf}x.^V ^^G =_ͣ#pJ8Q,WF$ZNHteńEgJ˨2m!JY=SqՒ p[LJ$7s)ަpwqPe-5.o`QM9]WfofYo;4踱7fpF񈣸}57`÷ɈšNXCn~J@;YM-zڧcWQ@(y҅d$绢<{JurTufTbXU-jb b@^jJ;mQjٳt8~1`˰KWv/OwmT\:]Md\pМxpd"_r> ͋8_``&nXD^6_kNc7u}]aǗYA=(cʘnAkoFk&rQRt9TcSXЏy`iDw`(*qgcُ<ɪm֋<]ڵ^v?P&СkLX樟p8t@ooۅV{"ƪyHK3iLYIGku NJ~=q3N mHYԢf5GGX>ZniBcC’xxic rD?a/dt~z߰e&{FiQ/pǡA/uzM_itnDv`)~M*Uؚxc0mxnHy[lCXRVA5)t{fhXuHwxԊ I}1!y4Mqf mi(R}ax!1{EomkYՀJ=9j@T~Hb(PoR壃P~Vd52tvkΘHzr3sZ+jGowCͨw&pek5@|b+vL|{8C3w_~LTSȸwp9{qu%kqsty*;ޗGyu,xw&(Ʋ:cA7};|Hte{lGVzL,0]Bfj>۝#ez+J2>҃-{OuxzeUYjQ~E5z{;'hW-M~s tǪ;Mvz~sŰgqIW~`]wdIEqn`og}5W.C]H2t%MJwKcӂ*3[ӿU@\^D\Yl=ukh.omRyem(<~d]P|{N5s0pTJH{O9ݼa<B6vv)-ZQpm@mAS_AXeӒ_n=A >aȘdacFEia4W⣆:&|U{R[M]PM%zox!ei<(6ےNiEzņa@l!{tKb.[q79Rte~ZbRĊ|b^Tզȅ'/.LCjWP;z\tTaaUSS[e,uf\sjLBpy#׉ߕȣKJ}5Ze`p]߯\o~Gs)zd~]ZCpmu]kVe3w|GxƔCxVAA~8eы1Ri.tftUekWP4$T=6z$Ss~x[|f?rQw+{S;TieZ:hPjvlwEr6r/+6Pv@;OTsⓌ>׿62`ᒒFjqa=|-6xMSHA$ݤWgw:-Th"B~fpkL@NtezdmGa;n*{o-I9YLVSYifp;0 uO^pONqz{$USنe=+6[̑~QM]^Fny+WT?MKtPIs'Q1.{zPjQB}u;~~VSIAkFoh~/-L`b}ˋjyd[_MhLj.ehyk:N0SKwaZ1+wMsRpWmg!r-՛d.R^hYt{T=ŋk4j)FiD-0DN^{bz[WApot' et^ul(INxt.__Ig3xoZ|zl0=$˸iBeJwzxAEiQKF0[p2SJveqwXU8[iz2q銄Nay˵̑X{1`MȴO֌})n}Jf0@yz*`{a^MpIf}&p~@Nje5RAN,Htrtm~[BIkq^__xAvsY%D u>c @7_XokqPSE)l`ẀɡiM<4XmFgſAFJH>ZLzĶv4iYqf l^i^K$ %\pa<}(QwGn OkzVsɍLdBZ0a"-j[xTd{zMGv9੧5Zƀ0.Dd܃ӖT8Fɧ4k=iOubo\7S{f}Ech+6iѰ/gupƟjF`XjtrOf](1KΉds#j>LWSM'0v}]DapB[tL;\ڬWDpTjgfcOwy"_`o!6MjYюhtñ2UeVuLYM]nWuF[&#)`P8i,qDWIPptx܆R0`sda繚dVn16k=3V#}dw߿GkWհ]SЗ%"U13䇨4]Pqɚ]\<:_e<@YEQNuz,Kc^u3Kt/spNQG0v}wĉˁZugQa&Jh{JTZoyfWoZygwjuRAQ[|kE:6O6z_wSVn<^c\85rؓɧiEhlXؗFRڽ2R9˙|g:U\PI4tjJyTG*MA+S[qfw)XHPb{\ lѱ$6Q0yCJN:q|1mt6]7"(LecSJB^PO7~cw~4|1P̓)'JHOVt޼{_SzYH GyrAdʍ|[سbfT$WqCqmBƼ'[n^vi0nq|}hBF;{=oZʸ*b2Cd!l]g'b{5y Ɇ*0[Hk:/NJusljѴ_gg)JPxS~4U6e/YӰ>I-7!XVfeo/`xry`BaL[~Y)֕pgDzRȱ*f{jzMHht_8>@ N^]ΡK]w:+Ks$G`)IJhL0TrgX"1WqPkWPkqwi7sap|RƟo|oc|ul;lp4-Rvc[c"H_kx"kxoUPvmCQ@zhzŌpce$um8|Gk7%|W&o͊ԴBk\'5]P0jfPtt:`5lY] K0Psys6vjf%`Sqo-o>dtJ]N=5.Hea<:P[zcqCLuY4[vN6)e?@,xiEۡ{.eacʚv|5eCZ^T3n?Sa,M:)EL#r"B&?y[f<^}Qx嵏ܦ#fh@&ckxȀ]OP\(CF)N_''ku3ܰ_WLCzuѓ~) İM{[%+q:~sS{WZv}u}C-wjTmWVSםCM aZXUOx5T@IS=4MkaX1gVwӰEA\`?b4Q)k1gUSg VdhuH)4ĤQg`X]Y躥[7vfI*7Icx}h| σrU}slДKQߗV\9lFfd$o\RHkO|3Ӛrpϴ>ؽsS%hW^xG䧝kRFHbgyyKchl&ioTۭH>zzitg)Rug{{d\eo7e"`dCcŬJOzNt};G؛n\xKxsbShRmʬ:W]]pGdԫ6H*[|]1p_AcM#K"col^aw^jNXCǰS(/L%Ok m]ShVjo vsUW8cr5bOs~y_}6a8%7h?>yaAza#^-AJ?No[p}BLU\tI @ 9ɨtVfǕGLPt.* =Rzy*׽rTrJ;˝Lyå5a;,d(rojQ[YxC'!\ۆśCX!w2p2Hޒru.UXJi򊁇b;^ld^Ua^bREK9JSgu\X,^G[jhfyRjԝW,F Iya2tGh7wG_Q4L'M!bs[wqeL&ukI4lb&~e~hX{c8CyW8sE gngh}roLulqqPgGIUC+nAŰPnbo9V{xWNΕQC=ndWvF7e`WrjD&Flw5hJp)`j13hps2P!nˍ&C*H͈-]|גbOHVkQe`-}p|’Niϐ1(cT{P7jX0UL$hD(%ωs*Z'xqTbz9vg.9=KƲmqz^eYcuaךeo7NWc&~,2W4;ar9ӠcN-`%,5j;qukk#9G>UVML}h{[ /``Ѹ,eIxnRߒv!d7}覎j#ױyVnmqsiE~;nPQe(t+?t"on}Ęk)Zh^q/gtOY~rP7|= fMTof?Jn_YrNW~^[6Tt~WJ{ZId_L|T~Ƒxec2p!5W^O8Q]qDҩ};J 1R `HN IMloP9RZgԀ&iT bSlܛ}e5MDogǃp?lσl~hM@^8iARn4Mq[ ͳVӞ}h?eZe}bPj ?%*$|xă˖XCYq11]~|]wgKxP6!O(C\pb‘i̅Ɓ_at@4 \ʃ^U}@#Cnd*FIKgreeFswҮi'DCGUHq0r{V6N6t p]db"oDZ5$gAUׁ&rr/?=Y})ZV}IõVfZ=v9=kTM3Md"nNDG2&^bqcrDyv@Qlm4ֱ['`wPjrhcXN#efՂvۇ';A/5F?plko[15:ȹz0_@v@yPc@cDxbZϕ)TĠqw̍1ZvÙ%*sV * rOPmC}79eHkU\6Q쒣kNQQ g<ÇjtM[|O~E2\{u<&SpuNSs9o4n<]-TZNe`lj/yff yCEN9lDPNJqkԶ.}y{{qEcc6pAi{,ʫJr!mڏilm40.kTtirKB`1ޙIWȱee`Kp&cwqF{ɢT*\'!Ƕu{vvXGh\TƬTRٖ@N05I"E\M|.31WY6\Zd`?1SUQ\-(![SzvvP\S|kAiq2ZcKt/Uur}W~u9{Ds0X[=~9u;_)xtx\KÑ%[۔4 b'}7VӚfQ> |HǔFzYOqy#nb^UqG_^>qPf:ʂԬks(ȸ!uXq" U,;5Z̓:I8a>StgMԻ!T28H|+`fyQ8l۰Aĉq躾a_8hpIxRNHzς{hmEőjbJn}yWwhg}>RvX%:į:-Bƕ?~߆}hn|oB.yxsJ#{dSԝȾ^V\þr$yقuV&E cEt-MHDC$z^Kh߂[6nrGtYbY:/xOT`jccewO^diZ}ʋ}xq"H'XlwVB=zm5ktGd4(-f_Pb6)6saZ\AOr6IS7m{tpro$[O:@_ƍep;;{3de,|%hGJT:([<T耽G)%oxwG“8nyvbXr?5m`/9h9PUKWmS$ƥ3>yI u+.dwC8DhN=M`~r&5S -HcXGk\7T1/ޅ];i2xUAt?Q@a䒆̀!BRyo5}ZQ~ϳ@3{i%ZAMtLcPur`~ayp8̡԰f`ke*hj<|Ӂ*8蝀?4Ŗd}7:K&\\pKxRl//sDcx:tDe!1RnmK sMr}l][Hp\/fYuvظ2a$s԰g.X@CH;so^c@^uz^[O\Z0㖕l[QÂJP0ɠՂdi\;ly:S6XsXGp;+3lfnIP߽5ns^8ȭUfxoQmFQyMS Z|Rw*pZX~)A[KE-!tZR g 64Putpimt+fVOC]gg_/4]ixɼD^gAT\`k{G0pq(z0@Jvɦf[>lաJۦY7ֽwܤ+^gdP*Wx`CDBMoōNQHaoT*fT1}ꝓPpprqjzrMS1V&tqܪ =weqͪw{R̒.Õu^oٲlXA%Ϧ!]bY[U' beL+8\jRa6up^JE|IC\OVeey |0ilYb-p,}8dMino?~HUDt2b$H%e=d/\a3Cm/`+|FA]{l7*D2vzfe XYeQgb9*)̠lH|@hjњCc{dAOi^Yo'³,4m~+cdN"`K}q`QEOOYd=skm$3t_rkpq+x\QJ(hyi@!uAv$^Jsh$s JRhF3jC~lUdrI(,vYJ`ex=gSqNW:uuIaEˇBy?rv\QR8ogagQAP+ֲPkZR6xncpmsY2;9~t_D]HMJFDAhP~BctQ *1'dqnY`zRzYzTQkf\?uksД̰y-F}jm(4uQhfGFSCbACE8pϳ}sv(6~l`\ym ^G*>qZ]&kn}/Q(L/7cgԇٟy;qFdx`ΤQg[szr̍rv6; {+m[p\<^h-~l{Pzʾ^rMMۃɮ2nkf>f7LRd2#M]zεVϗn`mwHJ`d׬E-FtceRbtlFYfs?s%^zsoUVeh$I]@~ uryY}R\{EF]\#aVtm~FHTdNԜJS_eAdcbY/wDY)sI]2KygVISjRk_O< 3kK^oFN%Y<>=fGAnjcQ $(o`TJbgh:ekU9q4R҄}7jP]l\rĆ_KZ`Ca0`&Ho`_xɪf?vnȬ;d>Ce@Us(=z8>=KTӇ~r6=|zTàw)Uqc,"bl-a)E;oTiSl֨m;ceqVN]k--c`@emjOIfŁ&[n+ttw\F[Yjd:>b\zxo9WM<#LUh]]%_{'qTNl7q_`|o,j+hOoݘg0]q9ΚؤkjR38,hk{Y&x}Lq;du_-5qŘBgrʤ}u\dp]7g~\e4Э`jbho4Oy_vD׵h(cߨcg#YYnkWԉFS#)t_~8|-_U]lzHyf;Vx_)}TXQMHXlNIzܬl6l8z̤,rVbh/:afKy;K[?6]kBrih-WBhP"j1acyTފxlb.4~½;cvEo|őDε2S|X&OXt_}S;TnxO8KIJ|YCK^\C0ym=5mP'A>CeAK=aW=_2PGt^f=Tcegk~jrNK o&Qp|jOV8g[xq_̓[%ّUK؋Nsw:dfkq[pyR^~Wc>QWhlcpOil32R\Py}9\Bo-m*b^s x]%!]]AgUx͢_I!kbh} ZhT|dJYi3\۷ޜQn`,[stwRt~fZ^T=K[OsWSǥ5ty-07g8WG^7eYe%fgcO1,5~|tv#x$X`kѠ#GJM2qCsF x6oWnyU1$_.!KnqwnƧ4E 8!9#fe{uJn;Z'_zzxEx"A`rw |}]ZЏD?yPugfEbz+ؗKRzswE=b#SvӶ4'Nh6oe-lHXbsܯtOk{t[YB&*x)ݒáĵ؏)1uQc- T˧qu hR%b_~{XqbnE{waSɑa)fQ`%+ĘsRX=xz|wwC9ASkMmY6*j~ۋW`rі[zAPc[.h0'Pʠn_{4kT붓=[QB=>tHZ~u }8pO^jsn|f8YWleͺwE Ro&df3^_5Epg֞atӡ6CbQW }[;חzc3s݁wPpGlD\"tPHԪUY=LB֕uOis%?֨VNac3r7O~z9`mt&ҊNe"joOf~nQpB&__pI_s>G{~[n~~Umj(\}P`.}zu(`næ2ܝ-cL֪kd(@tL>ixNt2\LxOŶa~祥{kiMlQIj[hˍ_B8Bh@-չsjkv|{Fl9b|x~aj2^g{5jd~2~s\L0;sF}RWK,jz1M!ЫjSWfsp݃g®KD}@ˆYs^:H[FYɟ!1~$K ?_rrq{JMk>R+Mi9DƋ^zr mi]蝖VM1!xJftYN;i}c pP+c r8s~Q]X_f+()P]P#)at=v89R{B[8PuJyqmfu+VcҜON8EPr>:EpXu:fX0j]NTmn~.TOV^ZnJsiqYŏ0_#IGbEkyE^zRx:ǤJI[fgtwNg~MMɫknmzLDGn`_`gG^KeghN~1գu#;MUna\h468H14?vAE;ڹR2geO6P~lRINZDZզM]-3:C}~fWꏀzxdw9H4xc͇Yj!eU^?soN4`tZX%ZS2rtC~;Ab=&pyhDeg⍒kwsUQoιxhz~XӑX7Y8-[tmfRiIXɡj8}[qg7՟d7su3'*s:jaO@,d/bzxD aodv2 so7}oWH5\T'WKÙtNo)m Y>v`'P]ΣuvU?9i#>;B}1X%ejpTy27XPhaEnGTVܑ,ck=y2lqmeT,^s+񅕁QPϣO\_CKnnbuPd]@srnFïcWx?$&XW$eԏuGLBP|vAxWM(l\@)hǼ:)V LeYBl|jZg~qcYTaqb r(RybuOMQdCg7L|P}_rkAa;]c_}C دCo3#^YQr=`[^\QF|trPWEi;ْYg}ٌ_Wb*sa.iT]^Ϊ1CbuR< WAlm90qDb8X"wez{mQrszrÁ٤ÏJe!}u&|b^vU/Ut]TϟP@>x^J`zZ{bG?`nۆ?vX<5PVmynjҖ۸Sd+#bkli^kLaJIEyؕRu^1Մw^dZF6c1%ajxSqk}hm}mxHzh,y!yqjl{_pvsK8bēGE,~>Ėl=ȱrGYaAvPuBQG0cox0S?k^r>}E4x̕Ëcj@FEHr2TR<:*j _s^ǭ5ʱ&dJDleƒ E#و7Fݣ+jCpkF`oɢp<=g\#1,DɄw8yFT7ץWu&SYs﬿C|2E9}G]n^ۂ?[H1l]'h^sp4wi"wm$qYOc`kp2\KsSv˪Eܪ:#vͭyx6xHbzFWW2X!~\b@A\ad\yPu;nhQu{Lh5ibZjZ@e{jhqag+H@`WT tFXKC+ZlyX WlmƩ?tǿl9nknRӘu]rk=JBl:pAv_lNLVSlv-7A},-t;;Xq@`ysG`Y.q36G]G9@"JjNOp;Khurn(jCKczWVWk)4xٟ+3wq_KgPޏPUlMeb bt7cgb5hϕBn4bHqFd|qv_}Q_p=J,xF5qY_wVF5]gwP.m_,o=[䇜h=ihFb~Ą(9|}KU]Yst#5:{Pow}c+Jct)hSOθ{XV6Lx$6;1<`LV[=nplAxX_wO,^^hٲ2C،r}V=)nuc:BjfF}pS=-?h\{AqpH$k'dz8{N_Qc}PhOXc/V/Le4wIoy7b_fu??3\S.g8qsL`@zd ku+ Ÿ!hHʙ~oyta@!Gxej~Tp`~kQv4vo:ot+tUbƥ?M\ϕ>pkGZBGf;ja}qabD8HT'T{{rQtWnMgnx_g`Fg+Pqkvːyy@4ʆ8_<]p}#Ơ-+dzs-iy˷mdp6lM:`hbkoئH\ImE;E=11NH %cqSN 7$1']Q*~Z |uE]ubuhΌՈYElexH6opF;8doFeRife8]N4lgs l\DuPC Px5'aSulP kRG@(A/{_#Wwh>Tt~~\qL//iNXN}wdzP9f{&nZòBp#"^Wh? CftVʠT$R0m5wv`;OPuumySUt|5vWAW[RriIY{V~6"硅J$N7U?xpZYYG3|r:z8na~\c}o>?oi.dʞ37o'jtCkE#!\_Dq0=a5Yd cg"b}GqoS{Vgҳ|T,~u|QlG'MeTwfS~zP<4XG'[4@0acn}EaIZ/TrA:z[HEwI5fɈQ}0u`Y[twms`qWow\N]~Ϛ;ʡ@RPj?D["raq`ԯtƼcS;bh`nE ۮPlrp\.P~`*SG,jty{fjon_W8Dꮦs:Duq#vr%8G_^2wc0JVDYV ]yĨr\Љl\S:4gbqkX=&Zi|`L<'li3UqrUw\z#aJPk1yjv9IMO:G rLQKkS.Q0 G^Lݍjt?cowndJD}<|֋]қcjRfkz4}ۢD5'5H`:d&SucBd?z2ms|xmu^FQDSsokLTMuL6uFĸ|T>dmƣye V¡x?@\m:ljus,R} Vdh@_bx͏utzcw8Zi*XfAYjX~bw&0cnv_=C|_~ڗTFf;ԤJ/jA%GSj&j~KJcDwpVW|?&}MYuS]oiG%XאZ>codۧ4q4jfݿe5õHeoڄd@ k.i] 8o5@l\q}KjZ^&P%El~uY;ڜg™q`^ji}dFgx,6h~uZY&kvhhQ8K.{{R_*Vu>IcNߗpTdUߍGb_AԸ]9g11$51}Ӏ|M> HۃHF[I<]sO menG8`n3GF,2*˨oůlg$bDrmkTL5ECqN}ݐ[cZB$RoN7c:S[1 J#샰5Axyvx(ZTAۍ&݄S_d5Kvw4fS?bW;kGRNJ+\tlDwM=>u AX'jNXg(etguK\Ó8gwt(d7|6ˬ_ktE{VyG.tyc1mrXǾjhroZ&em]orfpz; om\mGD(kq9nQcG;Aj}.eme)a.tTvlv L7X!mjg@il<tc;mqˍ_`KeHXDwd@Aśi#QySo8eh((ۜ*2)g:}R̊K L͵dhLXٖr+v!Z}afmNAkFJ@~lIuga)yaPpy[n&57CǣLP]xMbٯwp;ǀByCV\j~^ 5TSvi8ДiL JW7Ӫ|:ND;gz2PTJӽIy\)CTz2C1@UjtRDވgRQZacHJ7{7̊f`J˥_%.YNI?@g hـ g:[Fpֺc#alC]cZi4\o)[ZuL?{]3`iN+Zvbwa(ʉplmotkB}t`w*-CxeOyVY|[7EEWmEqeqb܊"M_}N/zs+%oC |TZgy=wBdJyON;EţUW2jTSZpaaZslr/LPO~dWBT.paۤ^gA]sH^u X|y\f|t<94Z=kHy[Zih2}n^?JV.@:S)v\J3Fu"Bz\}ihK.sl]yNgfG=AXs֭e 1\ˮ:2ysqrR̋h\TZ?,:l=VtÑAgz'WMFRR1y0@YgVtKTG>Hw"Hr]^ǯmRIM,Tq.QNm}@jqGZOsWtO=d_P r]h(!7W0{G(B߶\`ZFaZR83yʄ%Fgu2y_1z-z"6ky2bWPe6AiT鋊yV KlQt 员ZoBAï'[ :nDM’f[TdvRôtzI6uł[PY?`W\*,~F Y@eT}tiQID^ikkG1GB&Fo~~ǥv_~;zoAYǶ=w2>Dϙğϣ7ĚJBxA<O,"z?^?tfOɵFuCfW{H*lpQ/C@28\p KSȡly97lj΀MUN]ÝaDL0AMR](nIAawRaij\l{@ɂyHo*l|6nگkt0:y 74]NCJ/qFZR\pyӭ f(s熱d7ЃPiulm3fntAԧLv a")wO멚m>d_M)YwXqvR;&oqc]wqz|,MArS{Xv*oA4\kD^AGts‡OX>r>0Xb0Ua4b7DkNazkHv\TDFP`am^SNÓud<}Rx稱Y<5߆gx4`_wkL9XY,aGI;AxȍKlԂ}הchCpe7>9Rvyնzg6\%^X_wpp{rUk`~Q04(BgĞq83Dkn_~~jE5gF$Sro^Lf}Ed4~WáPN37Kr`D|@XXtdyijiPOQó0?cp{,BW[tut_unLYآYCq/DɊ\p̐[aewvD&lőtTU8HocЙk aGxYɄ?>{]Zmz4^`du@|{ݟiVW Mao,c)uN|96ԞWf"QwJw㉫œ1_Ue_>1%{EL gyu3&Zě;%wcEiq{^!ԁhDbvvYT#iaXmsD)f[wel+J_0^[6:]9^MYFy) f>Gy`\>АAig~,IxqotoOэwwSi~nnv:xhn<(]$xDv\VAb4xG.xkJDZI&OUiݭJ!=v20>W>VׯTJz~gN|CɧSuAHM:r(QinZqo?ާx4RLp_"5Ϻzf4̍?еrm>zT_W"6iVq'aZ/D_vDZ|=r;A2OXYS@NxlzrI/Pkdf1ܦI˃x 7sV" ulX<Ptyi0d(lM[Z1dc+Pn7Ll[b8zmR{Ȋ^I֧{UD;/P׹B%˜;*kU׊|zCС4TMh^o~N-=/.>BFًsuro[zԿg5.Wv|TxcM +:nEhi6X6EO{99M_nf]ǘUMr&-vMXc}edmցqۍtm%WF'髹'QjQj'c)ψrbk͏kvuC{XRYg=6\gI#(^ZR\I)IWA?kmל8jYvgm)1fdVobC6g08,ATնo{uѤKy5qqI:,>̆}7pk$iH*>Ftpi5cfoI]!%<Džce77r{Cd>NlAiH{wP̑燚{N_e75,ͬhFcf@kF`E‘'xؠu\rw}߫<^q%lmmo#g_8z-[jz^rމOz؛[ZVnqԔ7UkXT(p"ש -Wy&s~vqiXx7 d:p$Zp@q1 -NxuHI\Q9ëqunKj4zgEt[QrԆ3Z6~ěV?%j mtf1W.qtJzjl|yω^dNj4gQOg죢,@>>q~iQajF*z{[k-n`:=uG:h78\v8ĨydshI[v1ЍLa!c6u@lA`a0dƆZZ1=h2?=6)3lj;Ic fG@ܿo2gi~Bt[5h(dJrd-F\ktWr^}Kdd]HQ wpy<0җ|bitmGYfr6%icACOsЦWitkT&P=nSyþjiS?|XFmzx=XG Jw:o^b /NJye4n5sZUn_v)NǬ'(T((ňсʭGdmO}+"^ otOi+}vU Sʂ@r& jh>E-µzR4h|9QpwTrntzq]{a `R}8u/tP}񕬪=%G8*5a)XלD.dpoJF|!DH2}|EhGIgw.rirIWFx3SWD~+͑h;̄mo^su5t`4tq>Iz^E7A(m+waMqt0poyZr|h>c/ARRg;ãXQb?Rn*`Y=!zkLbZxR$6Z^hZ[`5pbZo Ònݯājp~Rlޏne7,`{S@C2Lň;osbo9Qf:ȫ *Tqx76{h->dHSpq9czg#:q]*\Z[kN;UƵ`H}I+ss4=mc=ojl]JglNuW)eGAD kv_[cjNQ&KoeM^C~tKah\@Z0xRz{@t+ɚ3[X;#T^|5N[񫎉:l >W, Y~(39vs{dWWl?gM޸]{a/Eg5){hXVғGbqW]DsYpa@5'pjD#f^{sjVz8z7ʥ 1i0Q`Hmp6hcN}ԄYSEVe]ҙNay7v6x[ʊe8撬˜w-{m$sErj?=bpu͡goHmQs/䧯ʧ_`s|Əe7c2HYI*y]`~[vFzk; }?X&yx*MAkhsyO3Uȱi1LFnq#;76pH88ICy=kvw<`W65 88shl~b0X=qYƐ4{ok TdCHQq@l}iMnL#FlHճcȘNXns%C-k#}ţŘjaC؅hŵFs?A,}Hpqq^cT̺frT{2No~jfz ij^^`GSmtuNO|kzbeD}f%̍A1cNcpgk4^}5e9)R#^sḌ~xb\g#<@qKsb~b6jRzƁ[8VYl)ILJ9wh)ÊTي:T=PdNh`z-Ru<$d#/;*ϲ] u]k'q6O-uqPK.K ^IY7dskVWkO(g8.{VHrP恊Pr7-`V#AZsM`yr^N0.rf ^t9҅q1Xsil p|V`|grJm˰^~@{BYɘ^CutFems;`R~O 3fogy[I_5_U1\8ŷ,.$Č\tu텸*bRoy}ןT[ qY*zvivo{`ZC|W?\@Nԋ.MAzN0=H{ICdFv~-}jv[м2ΛH`0OLI}_\2EQrwmcͱGG4֢x4zbY2| \Y vfuTx5vtrOK&+QrQTSKBU=?,p T\kcefbaCz^یDT>~ XaJ7l}RtP^O-0 }zqk85N.{뚘goUN+jI?zSfcraE3|6?bpjG* Qk8FlddtrΉmIurXlHtd9϶&P=&9SQEWoL±;_WXa/Fk7aR?Ö=?3Kd[LEj/x/KUb1v|g5?@y?bpvDGQoG%BdqEeSIgQ4cCc4#o S3cWQㄠ uQxQx OolQk jr`6|.~g]k`a{ёhpݦObQVk̡JӮYFD6{쉃 C-.C&d֨a ۆ{je`Us~5ljnw0zyLUtl7J2)/lEp9S@oWx' z`aۂ?n2E儀{F8yGniᄻct?m*DƟlqΆE|EfaN;K%Ev1%F>2فWYySoȓ EioˍgO\iN5bшN89?jq0exˀ#rpzZ_F??bn:B6ǝsYeuæunIR2؆U˥DJ(y„~fsMlx*nW QqzjBl<{;P;QS՟o/1P_lbX܏RMȇ6L<\xjzIa&urYΛҨ`ZTgrLgנ9c Hu_ͧK&*kmlD`/|TѲJD>~`i措:Ug{?Uyk{nuo⚯k*~AMsk-)dukI؟_Q<2|YY/lWupUAlw~anqطyCc\=|Y5b]Q"3x\zI<^|8яI8bVC،HQqr;ҒTTf%B1_o?OT=O+wjdnl>tem}T7bTxLQI}f¤{zgFirx>ȋ|GPʿp\phKipck4||`6C=qRc]_ ÁYA֨BO*/ǫB}Ded{ `Po~H2[LͪoSxjuA pag9f=qeHRLyrpao@Ev2+5R?_I|o*ۛOO{V^joB:AzT9@H[bNBue/RAzOaT!=]7B͞&tKEW_5{h&ʍDXZIw_eU1sJ:hfR| aGaeJ%蛹zM!zkxXEWChǮ/{ZLg~HQʏk18)*8Ixڪcdhj{Ģ+X!+zkUܧm͵i4F VᄂiMs~=Sat%@حb([˪ZdpY>|&mycTn$;1llkHr~ KK Xdl){3V[1}=FT)QGeKRhYr$_L'HNbt% ǢSxʟ^)u7vZmzLcAiuae׸SXMvo|98g])°Zmbi\%Nt}sۚzbWwnHx`~|qzije}]ktMaX'OQB̔&/I\a%{PQKp TmtXwzzdKM\z!AG:wK)\-j9M%`Vu7\XgIQGP?isi/qvl6?q|4݀j)Q;xbE۵I>]4RƦC,;v7QwHU{0kp6MC~^zi3PiFGzqSuKHg.7 Sn@ȉ?:ڍvy|ΜtwFjpOzsv7nakuA3~ܴ]O7K|H78rSp-9H|[Ĵyr ߆fHF|b"ţE`<̡QrɛtN0MUlW0U,RPolxxp?[V t@9ɴ8.J~ToYs|#Cc:n2ZUPPq{`a8fN_dzyd]nm}clnfVlms4cTn^؇ҍ)d~+XCdOaqGmflx\_lAPh_PkHv|`kpҁ{`ršndnjB3Kt5O|yƨY~Tg˲Qs/?QdEءw`D\so˥+Oh'P`F8~%b7}b[wߔF3xZGFhN6J{7>?6ىEqKy|Yר$fR@gk~ nD^Lv忧WꠃZ#D]G3nu}SIE)O^ZiOڿ}inLL^kmy>މbyzK;Q![pRcёSYhjYi({['ɜsFt^o8rO}Id-RW_ПF`{Tc{6pO oЊQ:0\Z@^Wvm0&&ohLtn\oNf6Ardp+d}JHz&o\ϒjhKA:x管rrN0eyͤfi^SbPS]΀ox?{,^t0o__rWVuP{$ޒx0]psJMM6zmi64SˆTǠgLMgQfuדl1{ -0 hXV Po?qMwgPfx0tPI|{9uiSBSd1j`xQQB\cE_iUCVHIڞXadJtxVnlWV`KHfQcZv>ŀ:{}9wKuG;{{cOKH^_ay}<[A=o?-IL6Җ>hpUn\BܸShqg‘(Yp{rTmrpǘ$pen>>\iBzG(ND^IP" j_U#zMI=H4oQ RpZ͙bp{MJZM|7uC_U Ey֝|n{+mz1|\ cI^3Dٝ/WOSkB)r)Sx{2CP:ΦO]p``g\Mg:ny]TTIkU}R-tn_;GwWuHXqQNKasuvzTZǸTԅ.}ɯAXUr܄dIBRĥ>pupw9ڢs7ɇ"LPhebi(=?aXg3,P:\OzWRfY)b.: O9ckVB2neR8 E5خ]aNeb_H~y-PLxZwN2T?EPۥַ9cYb$.f2fc*L9i}usnu:7qxp\oPtc".IGM˗54=Eׅ$[m{2?< k6F\6WWlV>uÛeu=VF~EMFZgAbfsRGppCx{sr 5qh9~xxs˥JtIͰopyw.FW|0dǚPXo]ȝc#$ .aoAʲfaK\ia6W~ooV._oQ:ni`LnF{@~Jâ܊ snN <]WND`oeB8Vjmt&5Q@DvfぎpQfQs`'ۆCqFFݭ-$F7ZgK#YĠgm_leXr6Z{JLhʼ3{tm]?HH`jo|ǗQyn2q(or'jv֡=z1]ï,LثgX|fJƆtJ//.W\h&|MA!nJXj|="]EbӥjiT’SSoktTi&&Ts`Iu\#ccG@[pfT'N7|!fܲ[x}sLrb;V0^m45oV|J+qώN?m(onknCqU""TF|V~-vnY:~GcCExyAFvPgn:;{f\uв4t|x:tזL`s~ldys^ikTaR8]nlt}\Jd?ӁFVtJ}dcWgL/&a&5IyRxWig;b?J2b4WbrU`˜v?RgEoܒBGFrhU-,CAYpzW?7RőB^FFgwuءa9}jPPbo$WgVאu&jΓ6Gu6m8Evk;X>8,T,tsaLqY͓̜3@}e?ИZ\pz]O\O}UuyBj^AGaHջ;(/Hņ_}}Kf\"%РX|niLYT.X_#n)kO'RAS\#~:Y# YcpuֹD#!ï6i<׮ ao{S̋{ Nt3\5L`5GXQNeop7)KSU6ZCBrkS2TdZLb~فz˷hic5eA]P~DkTOJW>>?xXSعIUgmGf8fed<poKܑ}ZŹPnc^ b6|(}vZXJ'C?s?:^ۚ0P{$-Ԭm.PT}|^RKf+xs!GVJ(x=~Ll{Ji4u)5(mI|PܘlS4LWՉe:ť_^DkY{:o5&2WJaW#p\>2X6BގHʐb]`#tS~LφΈ0LQiu~ykOƆ/mjLywE0Q ǕE>ZY( _=Iq6ZSffʐHzTrMqhmiN'OVǚpcOcPZ3"~u4dNstOdؖLH}Ue|~5ɂn]psZlEQmj|/B6GBWsO゜קXIjVMtP?>^AXnG[s%CEO)ʡ oY`,d`\F4[McN^nʞhiǭdယVmjp{;RiC0A_T;r }kEP͟w Taze[Wŕûh{FݤyTUOq[]kL/'[zlTeIXZ<֍÷Yr\:wlΩJ@zBJ(n bjdnfjE\>E{IeEAzzWzw?rSHzSvwy#_Mh2>R/@sgYl?jIw%`Doh鵥ΡXtkp\}6rY4fyWFWHRW~d˂Tsu[ESwU2ojy+fucm͖_cCL@d}Lpbso8BrS B̟1G.Urzq7^w%Lu8g`N [qN\q>iKm&hi/BMmsy7u{Dq2QK_KPhi@U0YYt6fK\4CDlS1Mۉq䅹eЙkz͆KXQE9O.V__j/5szrɿtKˬi-JUsҧeQv:;bHN_AxŇ$Th0}ܵu"N%!b2|q)Ȃ|oTo<{Dj1jme~b;c^F3eqGJw+oYoͯZt55; l*fFj|#lxnѐ|T~|eqŭSTwa"b~kglk0ISDv0DQc}/bz{mkJUXqNjXOAzZ\ncsb͎wM5æ5]|,*hP[zKvFDևJ=QP2-auZ{vEjZЂ~ci:Ofo4`JbFmF݌ZH3Åt=Qd'm@Pu&iAo{cV>OD$t_{l'dċ`%<)5`VrYx4rtT'oN!^KmN3k7.GK:nD*Nhs{my;b% m[tHASrkk~4{9&dʁLQCdbkAm2Q<6Pav=\ieepYѮelĘmeYbBIpWRIRawk5p @_KtϙFʝcsDKD?TXq{_929P$M%z[kj{ىcua)m1k2"Uk䄃*3Xk$ùv~[.̀7Q?leqjWՀQYJcx;.Z|L!dHwm\q(G!su^`:D2z<{;r3By?$hK*Ftsb@+BAWt!RtoH}Tz_}I_UCׁQ#kHxOoNŕj6IO^D6K6";ro]Ydw@X3Y{ikXnaa;_r)WF{Y{f?Ö#f'ò5NIva4ϩTuR_똘C{7HUW;h<2YpU%Ҕg|ܧ <~~;L%|9xJأ|tfXLOvHTm?XGKYX. }We͌o:†Qpqds(9E!,OLUlt`eDrÓj2gKܟ-^P/cpTxlZ?w3`pYфW;{S:GKelg&rGZ%Kk}]!LtYynLՎm{zˁ>༦2Stgn[W=&cXY#ImH]̥HKtox0tusMvicbxS\OxthBRCM+ybp"n,YUfP$NeLZpG#orp8xQbk.QGF.r'+hj^dqYMbp_DeuwL|Ptb~v%tѧ}YG>,}lfZȃ1)*$LjCfDÆP>H@~NQ?qDWRccD 󔀆K5*HX+uf|gB?lKVIpEhп4UlHX^AllkːɔACiGy㖝̲`8K^.}m{LmC2y?tWZViP_ymwW,P_(5kDrYfdtüFjlULlPd@dxbyVg0>b3smTA^lGAk1F;@ّS!8A`D#wVU_@0AVvpKU0=;LA?8Eb~WbGt m+_rVlJ~icEy1CR0"b>]y s^clću`P#JࣂxM2+OQAdïi,?|nxP}=oxdOq!d"EeV`g["Qk{RQov~͟fZgҰm|5dLQYvlC]ux\cNJج+Y\82+De$ðJcثs |A]nuMsx {,%kewO1OvM~rR~ Roi(/>nt.Tt&~GVkdf,c\Љs]`nP5n{g zy{H9YWK1|EwӪQ};k{h{Ural,UZʼnOOnr1哇=vѢ:exnCnv{ah|q;xODyW`z}cfwdc@\ԙc l,e>Mmem04#/h Pve_llmDnb)yhы^%v}z_} {.= _իh qďt#Dqn/wpjOKZ^oSR cV'/bwKhgBJiczVeihcJwn痙s1X[a݂gmyMcb"x'[Ƌevunlv7Yɨ_FPp@ƻ>n9ZO@Zi|fv9<nsE/=gudr^mAc+eR;sE6}zaKkqk?5iW<Ғc{bwS|Ǘ8,FLqsYǖyǁjN–n8n>7Vt|q~=qeb璹$p+z^W9ltġ&fT\+77u,zGD&e`,>uW9u\ɥuь)l3MJfoYqg'EĻm~捛_tf?t_|Z昏[3#CWq3X/oGseHfxij>N8!ۦ.>}eͽ}S|~ܸ$pߏ\cn{߭F8Lx^]pwVfj͙pPzE[]8XFNv^ޑݞOk5EmVNYys]X[~yՏlf ;Ĕ=ԼF~VEשgu~U`/~}u@eHeAU ͞ҷGLs/Pj6\{TI9vEb}% |2LИc%aI =f`EȭnK5nw x}ş(БvPfu{?exx1XG$%`c'kZrZ`ٵe5smeA)isvYsZGbxZ]aiJ>,r)UJԸgdCiy3`qORGRX]kň]IBBLpXt0rd}Z&<.vSG>WrSdc`LyjMicP]5kpoHrvXqI,(ZUvXt>dDzwqd͂BDl4K³ye5-v78(fo@wlt[rG[JIW69QwP[:B騙'jh&TknK-[sZ{LhZi䀦tdXAӗ8|}qIXyvݛ8*eCl bwQ`|Μ0B!25U6Vctj<gcla|ai_TUneum\?8vn_8Q`Zu~>jNvTeJuw{5woWU7w]Xi'G+ꮙoeu9imvqf,DO>wJrarvHWwp=תاp~kWCYI@p.i)AwwyHT4O~w9ˁbe:xKojcoK<[gG1*10U}Sw8̑nzVWbFhD:_HRw}@wQը̮td)˂BUL|{\5WGJgACf_9dfH7Ȫzg`lvҏe$+_5yMlzQT.l9yAT9Z!\ǂڏH]ҦiRCgG_z7-oIoaqi{@`6fV"?-AIȂlF^_?VSs&U4ML]cZz|uzh {t#88ccsbtvV̀^VWhcRiM;qneA'CaShHL2`]q~;mEAR_5eaB>MdE̩YQ|||֫KbMqOYFz=.RlZEq"$ 6bna?e>D:trWt;zL6Zb{]Fn ͮ][ i O}^wTctzDe_uǠ8PmTGamo/ci3l~-zvihey*~cKC d_ݸ|5z06`%HS.u^~;z\xjEMhi5u%ULDEeRFWKk z#ТxSHu|t;Xqi>?Ghא 984B}eaGnqZW}NwAe1Mn\tH3LHs?^{~TGg!o:24uz7|6_VM|ű3PmcG_g(usWUc ,eJXfK4LrpxgM=vYBC]v_W4Fŗn0  GtEmQ|TiuO~_E$xdzX}+YPPς&!l-W2EPjq<ʷvWG(6?߁ޥXXcnD\ȰY:ezTXZe1`J+;rjJ൨` 蒔݄SLk`lRJckn&OO$l( djSD=qDpv򬊠ƏcT"6gnhAl`2Ncg|DwCĥgNR1{M-viCJVC D{i9-):]dW}h*C>p|sxW#D|&AcfCfKE[ʬdar[3}Fw 2~2\kSXWХ/ik@@rwJOqG*W^,eG7p,slNZRtZvVnSuz|_tinoCĆˍ^GQjF.hRkq^sVhsGhEZֽ4n?,q&&yts7FU|K{Ŀ>O(e]wMTYiBfP̞ƉXdS],%H48Mpw1!F8E¨1:KwOts-f|xxė}`Y1cx<wڶgVꝹCrl:qV-qJEh$p^YTN( 9j{Zj_Yl<ͬI۷~E@xbPQIL@ҏ=z¼0y J-&\W,5ŸqvKZ5t|v\qMW{:@=Mjtaj?viBoDmxM+K]ZIPэOj!vIvrsS]5tBO̚|Y@7Ǘ@q!VBhwbƘ{o|a[pӏmHPkuFEEO}c|eiJɳ|?^*Qٶp1a޺v Pp5}{`ERT͟H`HLͦc:1F2w=/Vu/Lt0Is|kLǎaEVS5@YohbAqS Ot Tx{hox_wϷu,ucYX-A|?mfwXF\'#N@ L_Ԫ ({ms8jC65,gtbTҩOҹK>wJ gdgT7c:'i.PwgB~t~t"݊0\J4&QZ)c\d\fgzx0_tm+[MGtt8:0#'%̊/~ObhѬbU>zڏwhEI_ڙ^=bkw;A|VINcxTۛ+RтNMz_`O^(+P/ՄD#cFvπoH^bW#ҖGˉ}1+omk8>^mE+Vuv(Ud|ygCUefL3Zdcksa2tqbTemx@]|LIXUWyퟐxa;ȱ}FOK~s'm7XVPL)g8/PTăG\T-@}AKeGSLNld:}-+|-fKĠġ݁0X܆)w.81[WBliXض ^pvXsvvzW_0(, ´q.)I ̵lO?)N}3JL|{xz?k˰cY?)>]h+B6~UsӜǀpUaتuQQ{yNFwv}m`i[Ն,yl5S?j4H.-~TÊHHiR{vXrWv|/rcxBY:L`z_)לe7uQB_Wzx7.x ʼn I)P{y9fCddvR]@5=9@up'~=#`]ʺf_13vp7C<8BO{%ɗڝ9~de_uD{šSlN\}eRO-=o}nX~ilvʏ tC{WN ;*|epg}ckSMLՊc;\aqkѢrW5L0 ϾhKj=ø[[W_M٤8w{qW 5;[ S}vp;j16vi$?PT}:`I}b9Ev‹E쥺Za`yUXiomEe{s(K㱳=҉!|(cTk'y^|)5ڱ[Va͛peO;k_cuFn-tAl6;|6YU1ǰ.mXب[r^SZ\<|T}AwPj'}ok Jĉcgᗪ-Y4W] :pj8|L{ehUf[<7Kvs2 tL\euFYe`g`.tBoqcծ\TAxzNTsUzʢMݐ.ZfXYW@Dߙa@E^P݇2ZwPyp}t5 udmo]Ht0^JYBxwswva-^`bXUr Kn>Bur .M!6Y|6N%ts0G~sc~QV_)mgJk>MitsƖJEMo 9VZ=QY#d^'/| ~RG;X77VR%sw঒vpSo|g-#[<=L<獂O4.+S;]<JHk)Txdl|QRjTm@>I.qhqǚٷQhhE]Ox\eԣ=NNmC;7i3]l`Wq"sKK/neaNy֣P-]Un>n<`IaUg-CIU 6YgRrXNLW)m3j_ZahʼnGo;U{kjU|]q}"9 w\ȁ7w6b.y{*OEPUyzOyZ-0AX؞~m._6lxZI"KЉtcP7!jmˊxAk:od}Q?;Ǭ[VsAd]e~m|KVr PYoZmiħ@-i^g-1iPq jUXE<^dXDDXrSN;FAiQu{Ug<8*OQBX'jk|Νͩv]sK^ RG\7qhq6qvL:teF{z섥wM'It$ocg^wfMs\Dc˽{]aVb1-usgjx`aeddLq!qry`dzנ?Ҭ5QPlla:I:Sd5|wdc7q\ l=zm5ߝ8`[8pUl_qdzmN$Pu5"eda`dɽSyY09cGGm]BRƹT&[2o{罶=uxf5A)OݡxJ3SYloyTN3b;@gm\턕=Ty-XL'~QdU'oW;uރuEg4BH~lfocO9Cʉg90!bcDYmtoڗ?ulc+Iu]jgD|@^md/%EgZ.wRkAC^/|WxR;H/jn`(ttWN/kJbt>ʱ5miWqU\HH5հD&gDJomqɃ? VmJ׹΄Uff]i[OGnKv{0Õ@#G`vKuޘm`wJ6Z\ZYC-vgL7jIu`D{4C7@Mff+f舶sqbVyfco)S8`kEԙ߬qfyәA=DqZfRe8X!0nB*z{-vkDLdV!ur6aeȅLaBjÐXfQsVFņ`l|Z@o4Eynev}arܬ_O^t0sxlb2uA:|{eIp;zq"duFp膌v8\sZ'03lq, LJ9mfP3:n${Hg!ĒuM<ͱ2bzƐiv1Ac|xwڢ*nq^aAn\-w5&hOGQsVlvmuvlFu=Q1{Fd@N~|^lTI{8] rC![xƀq}ς7eTsl-:@MַPDc<}snrΊ@`'rϳ,I)i{~,# PuvKOF{\*c[ԀO]LHvY|O_v!q01sdNz5OS$pרK˃}Up^ҊV/}_VML|Ɣ#!`;pP]6 {HGUI5!*VM{NdPWd+ԒG+/-Jê%M}SmdrYV8`FπB_cl𝎛ewcީ̤bujH36:g9ȋ(p~ŔAx3/Q`~2%PfOa p,`R=\c~{Nnp|}Ʌwt{bRj#yw|]wkфToU~?9ءм܀;Dd]MК\ifAq.¨ܰmU<[r4_$r'TP$cKdaˍVZV\_PkWvmY0(oSklYB_|0uD`*B{gk񙱟nL|@`L9tDQqɆ\-9<]smՅ{_+ubn0|l5T]wġdXlxCdPF)+p;o`ԃV~JXUqʵhƂ6PYu}dÎNk?cȝbaAmej,?>çSkspH{2?[mn\V> A6inkpϗ D)Mܬ_sJto5MLwSPFhIPy;Me&\5w] {4srJ!Qe$+n!FxG^N/h}y3kdbFep2WIE9o3}2\oqB'W\]#0w,=}v͸tu;Lnj˔4XLe0bRV0Ur3SnXԔUyyuFctg~Wgd+R[ v~=M<[.u0bZ?0cԘMQpݳU .x5& VNxnuĘX?> LOÏ.֢{k\opq0j6gPG="IO˩ߛFmfgg]eDYU*y<0N6OoSyg>6ifm2rdH o}{oBeYzYAw7Thg\9[[EfhEd./"{wy`nG*>'ɮ\ńL-UYHPNi6}h׉0y٩+rtIz$jvl:qq?LkV֤I`HTgtGSthhCcہ•]HmƜI(ۻU/wZ4\k]r0vm g?QWBi̙VaUF 6G1nzhotmaj&{eAURJmErarwXbS*fseZ:Q_x+F\) ShvuTl9}m6,J{sVlMbmpqO^ƇzB̆xF1q{fT-UBvqT hUהGw~`K|b-MJ|"{Up΅7@>K[VD-Q񀪨qp5WiwQ1Q[סtew=pOmMaS㯍bԨLuh1qsv/PN~Yg@ͽz(fTZ\e~T>tuSz{A}}Ck!˰<=JaÎyv\3XK]<'imD¯uW@xl(rteꛋ^g/dUT^pgprw~4tj՞;COv4iK(yh\VSs{\MLwȢq'gPyZo_.HЇi^8QB8dFpj`LseFBuw"KHUuʌRQQ]n|Yzx8nr\UoJ~AEyhrL}otzY f'~F'NI4{āxЋLǁS Ju2>ԻEZͪƻykqPJRdNi&jg9YKu':s@w}Cao+>QAkuF{gopkny~`_`akZ.N |F&疷6ra c:* nUjw^(էviGpB(k\y[p[Uc9}j45ggcHݩPVE/{h}XHzChFџ`T5BVo4[gTP2i/FaG͑J{Mlܐһxn_tu_dn I!~Ro9@ƨ%ʁt$Gro[ywh\}aNg~-`xZjbn~[zPF6E/g]?@g`tSA)5qF"rm0ef:YhҳP=k|L3s*ɽ߃L_6ho4eZEN@]J͈ldIRheUwVvn|υN}8T B`A^s67b y]Љ-+YnuzWz9zp hPSg'D\^Z(Qnyh075dO^W“9AݽG:a^a5M{y0t/A=y:UbbhjAca/f}J[9T1N1ZHsۮ _j~akXt.=DxÊRM`?u!TsjܰkLy:Oћ J)/nJ*GdچO-BAky1ScjY n;_kQiBY]oS[~~GQ1hRQ3?iHt{̤feȂ@\Zb_`Hϳ`9˚/vɱubYL\b9yP2}fR>LNJ~Ucx)o-}hpT{BqS)AZL62kaxougSXj[+?jGoO 2o{]b?|rS˭L|C.khOOE_q'?V{|WVf=t&Nq.cTTy>r0ϜFG7xč|gȫk̳|.$:#ZG5a݂p7b\f%̆n {h>$~kWMU w{X0;~Sc`e'yQRR | 1wlw^ْ!VvjֲOѼvUyj~X{UxVΤbyj߮XnfiHDi¡%xl&amf`щ|d^O|cJhd aKˣW~R2|(Xƞ=799ghN[k _ϯkN}Ԅ#F_{˱:z'IMÙ"yR(| j8gʉIc$^ЎUWPr7s;C2jsqѲm5;@+OaxgqWaE[sM#_ڴ9`q3`q_s\rY#d5x=jSUwʆoeTZ^z݃a6gC˲-6kPwWԳʦ'bVK_rەx܆ynlv ?jCATF]ԾdaeE@ VQI|iXsd5PDR}Vj,x6Zy89xQP]KԟCӛ]$V'ҜG#PyWMkhAbpc^fHCf^.Ld箻=qIQDzYEk G|Ov p{\wWPw~~b~ʱs&|Ga.qZGXYBsǮwQoC/kmQ֌b¿t)xX]nuPTc6\wzoX_Vkvn埤!݁w3M%qbXyUq#']c?rXM_xGgsX~x}ff]]7ywvqخh6:Z[P Ϥy6aQCXy\eUR.x~ HijNdG[1^4IQݐTPew Z`UK߿~ɢߵ%@PrwhNoe_aw}Nw_cq=d1yvIH}tmXsux\-@~W:syl2+.3\ipn3Rf߄yrtǙܠ]~ZVE=OėW28{=m$\wTBE~rKy^:{ng'iap`v#W"\gz\/`S%Wc˃vLfR*COpj `{ɏ#}tS< c4|UD=vdkuf\?~tGq&2.}0ԣk]j%vt;jGJB|cYklyzJk,_SW.HI(VZ88v $jP2R/`Bԧ>Ba+ՇhIg}T@t>kb;W/6ULL&˷}yKght61Y"}+-^C[xoV?`'v+NKk&i㧟ͺ]VJL!%YZvU4 inަ-U(cu_ӉMe}P2rmt y}wħ%fRaNpaA>PTȦcr5ZK;hVYsVq5y;vm=z3U/Hm_XyenmUkea]AbHwѕ{8!qD"Qg:8_"tjs)swzEC[|l[΃W{r|i{uFY=fry'xD;.g܃p|?`JNssdUNT]l[O8dty:xig8/:BqNBbwD?,P܀ rXrc}<{=!>sFFj{l1īr: Xvlc̲3Ucx+JubD +Qo2Q>p2hLuhtbOܼ.=ydԫnLp!XJ})*W0oFJdX/g4Zxobn^t8[=n jNxp ωogHa@Lq| 3XK!v;/>>omcUI=t>q~+:xPf*E;mP,|{~jXnćktWgOK3P՝<)_29¡Νaw;Mj3'xSs\by8pēX܅DT*өnK/n]KkUD/k!P;ME8?_x6Mf[{ƹxk$pPNNJ,?kr.%%SeG{~ahw}bCД_șiK}i~h{>eBuʫB|zpid8.u6]YzyadkZH{@v=KCUřlwmTRK~*,bˍ}VcdKbqMYX^{W|n~~ŬPcE-@ߙUj@n'f@wFt,ń4kzlNc̳>=Mrz8D_wrt\zJ>PbrjB>o;jq]H<%be+vd{WT\e}NLst[Fοpٚ5U?rXV7Zj+@y:caifj`It{,_RB$9Ǫu-l\oiеRF+^` إ,8PXOy]BZ~l>soq_8rY i~WfziܐVi;fr'QhAG5ztqk X lii}LKמTof''xNmhvy5p?f9^sCp<,@[G_}Ģ?KfiFZ'yiLMTNyl`Mvj]mfrvRbVWΏruGvw?j8CB2nZJ~y_\cDcz]woK3K;U]uR`}{?x?em5vllv\bxWooVyG\_6c֦}7KUAgNW1l7xXw{NGgҝRaB/cf[]-ilMyCmWfGramȅb`XNon!NgA8}Plpq]O`_>m\QBT8Bd~t,3wpWwcMSk!҄[ZV_[4=nޟpmGkDk>HIh75πV^z|~Kjy}zTewbxZWwZgj`x7Qv`Ieփi3'ng[sɥs}\Mͮ{Ml[D.g?,@{7^+uqπ͍vwnWL!Vr1Ɣ{@fAjΌs|Uzޖ)vqZ1LYjeޣGM?]r]WnjAŶe]up&rjx~sdO63.X")kgvLI;]vcbˠ}C,If[TbyXD ùmn)]$\6p-1bi獃ﴛ{_`_eBtfYJx`^Lxtt~i2Vo\y\8DXr{Tye쁶LoDRK4ӌtse`Vo5_?AYƎ}YO QƄl}1ԧsr2UT-RyVv^|{`pć}Q'1 +jJ,u_p[o67g߆VuDbsR{v^ 2S~?À9hgYfv7|^̩(o1i|RVjp@^R\J[~"7cg+VYpkLo=kZ֨nvp:3MM}µf\WuƔyy.qˇerUBi=s- meQbo_mQ h| ZՇw^0kw"kTgR0-F{;bkU%5}lx9[o6Ő{n-Άlah9q\7mA\puMz{YC,L`3ZqamgcAҟgCPg>^v[Zhm)WOX˼t ABuT4T;36\W>e5]_@Fbxf$>k0FLzM9@cSeiÒ=kəqwPQK9H@nf$,w\ΰ1GlW=PšF[S~THMv~Cq˿Q$=cn}BՕkEE,@Q$_eYEqfv~KTXCL݋2GUWny2mnncvr,i}=s (by{h=ϥz~>xa)vW>bzMso?N^W\mX\_&J:YJlKXVO-4ZruDOpÙ~d)Ma?\%e5w')BL]ZbyuxX@S˝>,fK+_p˚pTxO@G߮c]Nv*cb0DIskl^b[nt6<{%Lnk%tUaz6휊=RCiGGUo(7u}iчgޣnb?ԯYwI4 \@ݞXmpč¡X)&?NPO}HKmy{"jEŒ7JQ3xoVpr8{k}{aǘ~jkf-rn!:~hmW7!61tjZsդi3^app1;)9yt;0pŎ\X/kGysIx;^sHHNnhuň+Xˡ]z_@E-]jSYXT~æSbm>Xh⣀chxbEt\ˇgɛ&rVQ7>\1eMX8tvO} Wt`E_k3̍Rt;VV&.\wCKR G}XINc/ktRdSęrWOa-˃xjѾ }TPQXY~\l=VAIBIQ]PX8qc[{L_BФِWe_EwZ~h>_hryѺwg ;:FQcTxDѓ4JFoЭ675=pZZ>&kZe-nLKEcƋjPYsXVREMlX]]=deXueOr96m`^l/fpMSGR<`[IсsheJR|Qp`O6f7pHU1J{(GCbZ]˒Xs;I(eF^ߓMOfUҤ{ї|vV_FrAx.ldgYdj`.Tb}5R'h52xvQF4*:,.DO6@.f^h;ň%76= ojj5do-mC:0[RDGDȇꈬpUfTG[:FEE';yJp>-yUk!/c2S˕c↝\Lm+bhzbp&lЃ+E;Sp rQ1I[5sR`&YvλuԻv,yVֻrlNէ/CRzj4[~)ӕ[JJl$u_CvLt7WcY5yfq4[H(f'tCerÐΎt$QNLNI*vI|oY֒8|rJ tApSveM,7*R}Y,$sS= hzAO[;{Vt^rERqʃ\3xRwP|\c%Zs$+O|t\: @PsMT)ȶ':uR6~єoD@1ep!oa:Q~ǖ/ZD!Eb_Ӝww,>evaFf\`mAW_\3{ՂoτX;Jwݜ]6``t_tqMskhiSS2|_e-T[JjS&F8Z\r}ejAJۅ]_y_ℸj)ZHI8k>}P8tfb\b|6 \EG'>ӪWsyn|qZc^MqQCV?*mnc?HuL䒱#Ƈ$}dHxИRMBxx`݂iEb~k6'c(j{xF1|L3QEg_4XcO/ŽCv2th~erlad$yƊMx$u9nSԂrfrfD]tSe89BJ|ߞ:+5_uKsPz߶Ie.a>^ϙ%eUٱ\G^@uaƌ xiXL$7sJ*]}+]Y[6c|SNy~%aԢfE;lTJX8ytmyEHOďOffc;YzArr.׳r~_oyeBW)_)ڸ̇a2DŽB|Eok|MJͫgz}iÈhnM2khJVvo~:SV0c`5ehFipR?n9xrrKʊIvj#뻓O«K^cyok`h z1@j]{䄈a.|f/^MhS]Ea}*vUд0Lv1p3\4^;[~ѫtOw}qÛav5ίlwpi{L`\qrƄVJkgq@c^snigb"sJv]x1mE4T/@)/DYdSERtBsj;Gk||C 8jGB_Bܑ`g'rG oSE~uSyhlqk*0hbґiMac~UD^egyi=zCEYǯeo|-$2q֫n|s?c$Pl_W_̊cmh_[1`Sumi gp[Ge VodkW՘ZK-}Uhqe6K||z[vyqUaJr|TsFbÂHco (7Rds7t݂@dЌQ zqc[MCznz3Ӭx!vrJΥ hKh:eNªzăgTpH=qk䒗B1rar]G2Il CoQ) pmCs;mBMN3ipT,ӿ~YVX0|V[\@YeU;\BtlW!U4ۦgBY@]+S+WeBQN!}Zet }ǡwoWՂouqx2Lpw9t߿ފ.Q^y ОpBq(lEZ7snCJ=Q>Ђe9{NWiybqfx>F+\N~`z8Sۡlǿ9RoG*QCeeeKO!}CXS#?cwq1;7yoOARSat8k}ijF{Q\PaNmG$WYI8NJ?{EFHjLx{ZgU,W,Mbneu-hd^J/2YriwFXgS=}aTOo>t:oxE/٬1*UI[Ly.U ə8>PUbel\SyϿZ&뱴eK~,hAŧ[T]w| /s{1cSqW%VL';dLbqg;oq^y[h@dd`\v_ڸSnY/HLsk 9w|܃/KaUgΜO§ 6YdvÃ*$AB+\]Uu:c|%/?VOgǒS0z=p_}_}5V>QfBlYȯF\DaOQuydgllIET6PlI}TpwsN:^dh]4d$gW[]guӔ5Wv٪{9QUjˇ^xwm1+G59ad0b}[n8r>Kt\XmA.U[zoWIjo`-***[տJYETu=ۗwgOd?zYgG={5gwIHkC|s9ble]L.`zLYxr(q-;"eldDjNר`TlQi([Sdьy\rp)`qDԸ1Ѩ{dYel]eޭIk8a@āp:NS[Nφ]OMZ2|:bVx=e|\x>+Yu/RhP|||{Ln2OâosZ;a_Sh.B4>ƕMc1S[MgVvHRl{ޯr>wx~v}wrd:oj^t>R_M#+ވE@=eǔ]mw:5](=f;N}UMX P*L[tueVaѪÑvcnh1wzpHG6I{Z#NilqLahV,>x*׏o%Z7Q-/'lBK4Ǜt M*pTJOwŀRpPQ;~Vqy?J?Y* |Z~~Luf7mBᶂzXsG LUO=B~LObOnDdrWi!B)qo[^۷%b^NaZdyiRrvhrB[cUdD]Z\w΃ÒKVt`{|[gŝ(뷱\l+KgX_1emumT`n~SFzyvv-REE@5LX{dӇOU b=rwXy"|4LN xyNVZWG]g_|=RKUtuOe[TtZKSV=7Fqì8mJs|Up16̶n0]LELt'=pslkY@pgBD!j]}Bp_ro"sUsƬT󬹪9Wq^brCre{nlIxSTm3_]_eD;.q qjcaդO}TnDRa{f^:Lblwԩu\pxu5\ D_Ȏ"61J\fRեJVPV|b|H%+_*s=b]>^R+w;~ i]^|1̇E+J,ghԕ=|J~imEpžO PK7xGs-fx~tmnJm꦳ gTꣵOfXDځ=*fusP&p%S. Yxav_}Upيovmkh[=#W̛CȖXYS&(^x5SVt9S z[JZL@w\ƺrƊTlfS˅q (due;qYcerk>ouWW b0\#?⋶fk 'Ut_ƅsv96Xx[X>`n:nTXbTռ_݉dtfJKf|p4z *$TwGW@pVuqrE^d{NvO.=_ٽe[jd[f~k@_P#o-mu;OwK;fGb\0NӅ~qu,Lj_Jr_e[x2ޘoxHrVۅ%m_Lvu>̱퍡!@ZG`t<6&[AVrnOZHsuEN\Tʹ~c>舼`^vi4|xrZ*}IQgg눀V@ρXDnh~i|h}Šh@1TgZerdԈlbk}AMlX>SB5KNY43:ceƴzr^eoр{.mvY7~qmaBO:iw+Gs7">ZHwߠ_~NtVJuKgM?Na/=+d92Zһy]ϑj^rkkvba|fOk^Gmn!yBxD_|͘J'>iEؗvԕQƖnoSI(y)`{>]tߐ6d5sة?VO~AB%[&mU^d"dV=Gb_l_ĻxŽAGc4.AWsA0K{ԛu6=.~e-VYLs9k4,i;XG+x1[m|iM%G酀PcK*?Yzm [bAbvn{m)cr3۞Z`0gֿ[BZN֋hpxj{SExm0T}-½jדp+wHCâHuVA&_a59TΛ[Ze!yyHӢ 5Zvz3nze4YCS>{.Ϫn\yzӑ {j^ˈzfPPqQi2|Kؿ]n Qv"=y#sv`ZZPDmVPlpkvfX9i6uXifuG[|"2#(;w aeNnSZVhN=OykQZDvG569eIV>w[FɁbhȡwPr̈}AjytKyE~/ǺfIttJM0J,a@~ruscM&QYzbvgg8h3hGX-RdZ=zCW!z*`IWCcpW_OneabnJ|pvIE:SIj)HnE5ނqAvm@`sݿDFXzjSUohciuA}XXh8yXxUgSp\ZDRqu0}yK~n3aJzAAШUzk !Ji-kvNVtg؜pQ[Cn>ΦeOƒdg_{]eSb)ɼWMvjÐH\GZ_bwneUZr`M&>18\ZT Mc^b\v_90Vxգd"~?R3ԞșaXKO,}zY}U/fOܕajd=F2RK;g_j{|0&h閚W2siq잲q]iOgo:aI~lPi9Whq nnU yM'VErbK!dcNGWuyQDF׺fӣFtmV椨߬tgKtth=Idz)pdfn709@u'>n[vLPj}ֺ]]E :6V_8Ѫ0cgmc_qԍvl3L}gdm|G}ܖBizw8DAH"l1tr|vQgnjW~^Ddkh^`Tj:@gfBB@ixItxXBoj4qlnfxqx]a>|[IQV.mmkU|Xg~1?k PxC^pdS/Ej%*2bI`~"V=o.:ۚtb؝km1Q͎]-{dfanTԾ&|cR廢aj^(-NY:WOAuW\g`lJ>ŋT˳?wcoe57UH~"[[zcgʈARVmJ)٬>WHb?Őa@=_Mo.`mw]L"!WL/@([]X\_`p]mq[M2myDNs~JԙL6dj:+_4,^pnqi[~jakx3c=D&T%3HqQf&ix~ڀCH\UPm=8:ªUQQhRnbmVF:1YBMLVIgbXuҚhc.cjQsvtϑɟc~ėWhl3ˆ}]h]dXBf)R~cCĔpCjoʥi|ZEh}`Q} nN6t{> mKvrױZûmr>'6πuFO߶`]irrtѧMBFiqxFy$TaP\-+5D?r+&\?LVuǏuc]wdtRqz[a5lLaVgk&-&Gs;w/_^xhuNq55_sg5\:jd'8*i}a0c@mZS򃱛A `Èˠ3u|ǐm[z2EsVG*r~]킸L>L~#Itx>[A)|Lk}]dvXADqjp/pK<>͏L>umq,p؀;?OYI4Stĺ6l~GmiPIvRs~&hsz{ *yg AssX;?8@JwKvYnYz;(n cOb{desYWDlBHJxz)ԏtp*ljn]ϻE{,薑s-n78jQOk3Ij j`uZb}utb@+:}=ϖ_o`{mc؁oT+j#:&UvR )wsnTjSBmba7ifjDomk`l}Vi&fnm=^=g5a ԹTgwkzmW/BCWY_-Rs{`k1}a8FbxsHP @ zk4{]t;zdHsI4k1.TPZ~\}hgedbusnlVmqBJ@}`ЇǢAu9OǬnRlMsVC)p%\n`du\G8 D~,W^aTx`ǀ.CAtpɖ7f>VIixm^aNҶOXB3grd1dynL5gyMQYp&ъ|v~+5{bScr84$xu;@ro/`CAuzHޑhGq30*QX(Eli8X.(7Bg`k{e萂[Ɍp*WHyGЧ9f=k3XgⲽpN$\L`ZIhHGoxfu}cz}-g?-q;hJęzM` z>g@AJyq|ud_X`oSI&Pyk c߉Yz)9,p{.nCf9j_khbun0)h3mf^Y{ 4?H~~nW{TfC Jk Hӄr`>M{v}[^]=;0oLH"hQ.a?zk[Ո+ywVtA!º-+ 񄆐_DE|VFHJjX_DdGfKs]*Ook@84T;SeT qYTT`)IRYw-f; GXqcZgllN0AlujfHsJuB>SJRpsRcfۧhh*5{6uo{;J8"iSX+tӱ$ƽ^s#ºpU*{n1E\jTT.[Ovvr/ڡ6EvI6h~^}E4C1{.̠|`P{%pcZ\O*?@#}hI[J:?Lw_Zb 2EiM_HR a㠁qQg$[[y<tyd=-2JxyGfkgHsMC7iQ:@[Vs&aCjdnPNuzȅ8U%-(iifYެhV[͗=9B“\bX` wqM`mcPӨ+ZgĔ>Y)ݭW.lJCwgk_UUOy[S3T7tL-i]I߇/fl[o o9L;Ʉe |vk#}k9lc[VZwM$r,6gdz?G#3qÜ`90[, 3×{iɠ4fjsF7T+kxlMj7{q,vYPn{P>DUXewt]x+JʔmLhEkݳ8\gJs7u{qGǢ43AcMncK~+m]Z9Ij8d`hZkřUsoj~]`UOmNMvzxK|cS@D{oM"dp#o>xу@IGS6mqu%kv~k׋ؤ*ޘXzaVJnTms>kڅYl^hYuҨxu)$lhG5=Ri_[vhzH:_r݂cu6z 1ZzkK},̿rS\~En__rWL>JBdnjg?uhbӧG?W0JQq&qΧPinhtfvW=<69X~w^tS;qV,PxUSMr>,1vdAgr4)WvǀVUo]j6~S;ЂY=aw 3thxh7tƦH8 j"Ro" kƘ vP43E>hxP4UcҰDIHV:>IyzCO/XqaC*kwr {LO&YuvzG;\yqyulr*|S>/^=O^Ö&4Crvܢ̑M8ᚩkR gKH`$[giڳuiq(ʹ7%C>YyUdōd96{fq[f?LfbVWM|rB2pdj``律X_VYLwxQ38K=mNJoRi‘J\|fpk 3NJbTd@gyfI@WKxqXwg;Ќ\tZ#c\nRo<}D-AĊ*7kmnЗ][f~]Gj+WZukkځtuk1~p5HkT5p[mm`}nQr?e`;Nljrgbs,d^buO\wk3CaR^M1~]qtqfG`rZPw+7]3:kKoPeM0SSlRs^dƷ|g&S*7qY\wETx9mϔ2`ٙ5qVf$T.qädKbʕ4 r}]pt}P}#aYY)|xK`muTg|CBueK9Bkwi|`]_gZoac`NLk_ƈ,Cz~n($S}{9AkDt.})YJY9o]h]\tROPysRM_Bs9ƎX*P][RG[K`]89k}xыa-=lH e }HS@T8gmA p}Nb妤T`HUhd8XIdS[g |>fh&4V]foS^볢';o)ElZndQWO%D_u+Bp95EoXz1|ǹprE[--RZ"'|`A{?NgCJ]̋AO=jv\0![!YzmxTX\VZ|;ω>k;PchuRyOzragRkUgqzqvQlYVpi9^WhюÉ⫯XWwY]Š*ؤ/pcĚJ`qn._0fU-U?qa/Qfŗ w9gk{]qF3jS!ψDuPIy9SNSR{'^_$hwk2hn֎hlN?ffcYغ?Own*R}yO5 !q{lsYJ=6uxbqWWjí,r`JjTIg=«`e&#ipr[vS)XwajjjixgEvgmqf6g;uCW&NFW>+iFju)@1,4[M`ʷ{8xCBphoaOZhLmB|_L`cGqL+]@"UhxZnr;CZZx^s:æ-Lfp4뉅\lBbnWm }}Kb/ִjSP\FhwZb3߷*wp#a{s{4]qdkcq#pvq됑6aV?ӓЯMĆIjYP}gRp;6MmԖQru2ktsWw&NǓN;i^G<5$I˘<&oQt$8a,.L R2ЪaP}@xDZ^+TXd9]ny_ٸnsHwD80ϸ&wHtic9Yo ɥϣ1Y\4(t[jv\eqK@h6mjSҬx\V^Wo`kq`EuDh[~>]Om1RR`]-n_W+bu|dzҊ[p:|֘8G36XF7tcsv*'2@>ۖrR=}j"ɇ_rQX]w!Ze_uV%JXp9vkU>q%KйS6gnCpXv1﯌p(2`Pۆt#r;39Xt6hXaUښQ}jFplܑDOuYGf|CV_,NϩJ4$-˙Hd)vCzG"G|z*=yj˕LY\_ǶXwCpʐ$ߔŽeAPfQ IVa[`T}`K:nQLܸ rLULϛg3CAa:cx]h`gaeAuIY/tWu|cqVuCx%qq `4@KnۢؒX f+"ʋy'v<:r_y@5m&',x!I(I~3oMpNXb@Ѓ]N]|^gTA}ꗯ\v֞vvh@@ʍlflgriW?5@8l4{e3QyL]Vz<9L^>aJRiѭ2rfX$gHZ0X֍~]Y@E]̛vV.%DoDz)*2nSzɪ:OYjjlTUSz%OCͣeށ8RlZaOe\ζAxw@~v{r=n|[w*rk݄~ÄwvyuWX/CC\Hh>(Uì%nhG):TiqYȬlhŷ[9{rqN[}/?lb%r`˂?hc4-_$2CGK{qLW`k퉞ng^"RV}c琐Jй"t=IU[K6dj$bLo\Ì1 uTV\;\$L|,/T==\8zSr@WCc2ө|,hvw$Eg鷘On8AxSzhEr׋wbq~Y>zGC O=vJ/amظgsmmT0b~#8Voލ[Hi'jB͇u#e hhc`kO>cq7Mx^P_@qL9plYyLj=~d/r9oM_Q[sL7jS%wǤB#9?{T{;ʴHygAnĤ_-t2Azbmے8g[Sˣ—EnLPS5UvEq:j$[( Pᗖ3lħ>zeNaSWr=|)~,UUwj\w!`qixWa6WB/g(IcPyףWmxQ{r#OZl֋ahKsxTa0~e#M:V-errelUZ/NSm+w NGMÑ4hwf(y#-2KN;erLTrzw~7.)Z`Jgae(yEbJ͙~aThpu:ɽm)h̖b>HS͇hdl<8i0"wrCrdR@BX2y^tgnjIg M| BC^b=lD81L9Hq"}%Xv 󤕈xOҊdvjpiKWn}oCNLzy3zEY,W~[NiR5BnBTihTQ2O>"H&ha#OαB1;ߠJz0fY4]dVS1BZ+_Ԑ YCK{tYveKjx4^Lp!g+ŒVҨ܀Pƒo~zyBubt%yzc:mL$e\%X7d:Sw_bwTgw/HOcvO?xszTő;׽k4Vl2>S+Kfmh@eE!x!vE;WZ{z^X1xCr]HB}iTh^m,#uHN_tmqu~gNkw\iag`;$m76^fhf/<}:Y +cZHC9ՀXeuhhiOggrujyjqGU…qtq ː>Xdfqe߇ť~B{}~eH;UV>nQcvzRʈ}Mk醐c:[d37SlAu;RbvBƿYvͨHgN(I|`I??=|ʞ\Pr֑6hQn%m6m3Xb9-cg~ e!AJn2bJ[lr@D!Ǧ;iy YaXtVvnUkEq@%:gh>ANdJ&7CJ$Hė1@VY,iMX^e(?x֣3iGDmDhֿȽGor-6:r.Hx5gji{D>Jk>4Vņ[{r<ˏatݲbַ{"IYB|KcAEEH_}l&AZn[4&[yJ(SNFuؔ՝RPsU;eLTYntRhUp^}ތ'u$|_&r|+XzC`y}n]8z}s/fJ;\Siz_XI쓆s$`+xk)M.ZW_ȿrAiuץF/~^+Bb߿jBKRU.o`mBklX2SߢBTp7:2{\o]kѢQ')˩DyT<є'TʖXHّ&rJ]A0?`OCPJtcOSG6}sJWŞqŪu~Uܬ"cC>wMԴf|N0,87kМBPN~y2-BQơyJeTPrp4dթ76c)WaO8nsTiV{un|թ܇j%ImzdrJ_\VԍZ)(=u/ha$bCUko8H|-GSdV58׍p0$FwʧnÇ:{Ҿb`zqFBE|v9eFr<1@.g^xbD^~_h{V\N$a߁v_j}PLZOdҌdK!6]LRi3pBzcH2-؁R_20OQNknSmӦoۊNn9B>pe{Gq ZvyMYaY`EyUEVk=dNϼiEh6p휍>c%.wJŽglrkzCV}fyJ?Wn`CNynKxFyAՐ1c"^48J+tnLY"',`0||mYFoO–,#v>o{PDh4ԊO>m6toXd"Xs{ס=w`i^NrS9_>0SQرU=Z+xlLu:>A:K;`ovyqFN2QEhQa[r- R&\qT8jo>yX]kS1yJoDj[bw|+{fhcӴM>rIg] B#{e}^OdZBii\Zc%8Fy傦GH>o+ fm.{Y71_@@)~ܲϗ:?j6苔#~kĒt.x:劓Dc7xw}`Q{~Uz=r(8k[P?b^E8WT#kuoP=_2y< $BOMs3S2x0s(Q󭗖xXVA75$I?u؝AOhnBOgjS!ҹUsyŸ$9h9XtIwʑgae!v`?ht{p[W [Zl=pgˌDbXu=jwhea BXyc^/km'=r(a)G{iLҔWİdes`vTCo_|L|t;ޜZ[Z]å=s`Ro<}vRP;x*NMT@{emoŜ/RtZfVgzaFﳺorrlp:M[aǙ{tì~xR[o:1tVwBS*>YMt>Xg~XYw0nǑ\_~GûoیKE(_ws@8m)^CFjlZYpP]XiKÏZdzɘAO˝35/_~l ~tp~s@qd]a,j :|P{}w D`PG̶5C9a ^+YP KT"O\fMxX&lnue6fsu{6&Qiai]~_$$ʻXvUR%Y=lÖQӜ@V"Z\r8j*vٻGaJB{Qt~]Db\_YtmkFKqE|hȊ]uii][-:p6[෨GNMSd:IGqsr,CՒfl7xc`i sd] ;ժp}i^1zP0xIs18̕A\'bxW)5f`O\XPkH |/qtgW~a[pfraBtYt!}M>{4EC;Mw rɡlߔky9}gnjPmXdZJaS}LxCHRxO{rŪ8ui!攕-PfJQs{RmsVMfH낕UHvJ`vIFCo~ZON=ByܒoN&s-#]@_}m}J7VƍĞ?xn@lzh>W0MT[`ofɥE^<>q2N:@rŋH:W&3.bsZ`VOPf*F4ut[X;CQ{r,?Ў$ ˫9:)h0-Reqb|M?d;v}eaohw7"KmwI Fe+Sq3m5Q"`yU`d=j@UWCC5^\s+UHJKio^LT\TxaXq;MUzy[wthl}\BO3}X&$uH-$gtx3c'ucJaJxh_WzJQ2N2cխԢbk_3~n[qNRt"YMyVMvGNԂ mB9sϤIzxk#otyDnUY?QPr+fuZZZ;cCȳ\_\Mx[aMWTའor| 7{شMhԶe/R1-M]~|Ȃsڶu[]b?=wra<@To;Gc)HyOүX63vpyw!;CjOơj3@8$$p%s[^h*xS2HqtPJ=}(;Tsg^ b DVOv!kytf7non `rszS~?)XkcegF/q{7fRi'x S5x7Sr6b|1IFFwvEcZwÑMV* 4tEd\T[b8jmHl{blrYP^v+oMmOqq9wK&abmT߻bnte#W(H#f@jTOpv,sTp-wO!k[?;q Ta_Hcߖ!Cm{Kžfskp'KYhҥQv(a@\8tvqzN+z#X4t0SOobغFa㶌a~yKg^F%_5u],jwJrxZӂ_;ye59^:Q`|@~㞵^` miaMc~z>|H.DbOҤ" h)'|tb q7r7jI琳lYyMHaW`cƨZubvK[΁ĆCLx[\c@baԮҌR+xԖl3E{?I9ˬ|[z\+y`c{)v;=djt=lath2qPn7s:|vԕYGh@ȀEYeᾓeq9C0z5NOs\VQ[P6SrMp^ `rƪ/AePҘRmbgQy[ZհcP/{Vm]Myd. iI}m cie>gk `ę"C.6}b1צ~fw˞4"L8SZrvf0/Ik~AdWqx(cq{r~0pMk:zWqucbB^\lRaq_rMsd }/ ^sXOX)ndtk^7W]fjЕiǹ6itʏ4'C=X AhvBeoN]&Ub;av=_Q݅, \ }'uxrA(~^FT/a/eI]/?.v<+J u@70k)ZT*osxrmn9?Ny{-^rmf\B>[sz]a_c_Tv ?E|NLdsΡ}ϋ o?=A1If#.dn|oF$bQϊfHr*ݚ "W !Zꍽ^Cov4||btnpNCڙ~#`=`Dz튿A]XflqeaSkѠ_[N =z yi0>>QXupYyzUc|Yl՚Z:Ơ.)w^F;t^'\ᴐ nC@ơA`gBAnqF#9Yn+[?2H~مvz-a+}xb߆2AmwF"[w={AZWt]07ڋîBGlI/`czX;?vOrw3kka[cȾmFQFyǝXYke(Pq&}y?Ia>C@X XlDن`lMpSi^XCEXDmtcBdVUQe~`_޶Xt}EwOjt_qL(Je*ƢE˹wYEpJ\H_EhUjެt0spˆH3VtHPIu;3JeVo<>4{;ߨlP9yP {hCKq$*XƙkEjs9il/bXtxTOTqYx*V"Bbą{jx{Egk'̣0?{s}McXX\cCknyD ULēzhjA$Q2h(U{{*ugmVQw%+Y-=pc|ޤ:Ji{3Ģ^γRbyw?kur`[ X`#]w}zUG0ew[QyfMe~bFӹHϳ?E~Ѳ2L/xu)ekGL(i-I6y%~w_ɥfTcB}t#_iYM/>a=N6Z_{[aO`~áǞx Ys=kbV{lїҵ|{9DɑKgڛVgZ=d9109J^VX"=+ho'Zd`7wȜ6iez(hA~)Ȕocyqw[uM\S"``iuBU2V:3]Wf[_xcncU1IG{LZp܋oGBZarYfbٜ8oY;P?Koɇ WeNfrZ[]m~_D`e5UTCdX2 ajqtgedeu|0~XH[8v69u5mxbQz}T˱ħ̦ApKSS.tv^hFGHSeObn#z~X9ryF|XlQ~u5Q.&Uxnz¨X^rFEFn$͐Wcn\J%~RRx;v+R?w6+JpXڔe\0Kmܵ'ˇtJJ;ƈBA@ZaY_Uq6|K׌DhB*_ԴZlIReOFc?$ipGXEv: pAzRFr ^Laؓ*1,s6yW&ʄ}*4r[>̙b͊T](Nb$:݉Jzr3ݐ{z]8g=mY]U๢q*CjmQnOx7J݀CnmSW:Ex}u`B`,\VoȥUX{ 2Lm_N2|Wɚ7(Ծ $ݖ*Ŕ >0xir0MmVr3VKc^xLd5]QzTSyey7lcԪT@vmyDtxF6]~L~@oMCg `^cH|?m_Qu#k߁nrzesѡM";WC}!zWn[$/fя'HəĞ.iۂ$Y6:F9s)bڽ8(Ȝ&[#wa[A0ipr=l}STU[C7\.N4H{cW8~@}X_NHTy{2b4Wyec^2e!vJd^^\Dir`ud%ǩG\8|pJT 4vMPxߐ߹ք7K(PK=ҷkA7{kBI?w~֔ekYy'Dv)+;߼IoԜ*k˻;l\2dX~zǖmC3~JjFKƇ8SSN̎tM7a!t(Cf(lÆj[zV=J&k?-6ypaup騌g=kTz[\n PP+4ƍ[GA'i3x双"3}[rKYmw\[I,xE"PWRUHu2MM0/VJltX>q+ŀgstbNRgBGkz1Hpflyldw)3b{VnpDeH-jfPXe0Z;1uKMiMyOXTO~+a:Nz0C'h=Oquϣ -ϰ̀渓G4-uhXPrhTHƅR͍|C3\m9X.!b_hEjtyYp(tD2c+yb`8Hz}x͛DgUEMߧYJXY]>zMbesyHcW^0ތXpsPw}x5Z{ g|iy`HI}qRkIA_:obFQRhŒv)Ęy`l/+PRX\uc-57͝7eu{ZY's[WƀnL:<3L.'vyxt7jcCW,iy~XS䕘[9Y'nיw{pvNG^iJ`O~BX2{gJ~sZ&0|g?dH]6HCRmT^}LXTPoi=m/لĦkO4][Ȯ9Vﮜ;+p{Cp:JKKDH[mNMN{S!rR"˜CMm'`eH6T裧]N@ 0\]sЃ-h>?r}6hmc;{ղDTdS,kzg|^DiJv;M k{Kw\-_zMҝqTFm=jTavW-|ZzRwT+or jmIn}.U+>E\mbVp$]̧Fe/6XRrQVe[(E/wˊJ'朁ukĻ.nBJZzTh=-r8.E7DDL>VO&˖Tq|M1kuV2|[|Ϧonԍdۜ:iTlbē9xw%{k5=;9~P(xN`WDyxw7GҮe}xˠon/ُJyZۈ{xO oP)w)hUG?tӋp\E]f->?YjcQiz=HvOuP>'B}biGli-uR8CkG#C<ݘhdRzچaxS'锐^jAޖ{z7'TJ;'Ua+YA,o{i`ňk?<hXogRSWwwfIpy!,aEh{@Ktk.S/].hjhJJoXaޯoĐBم QecwszĪjWyMraMm^.s_ļm_?FdC>]N)ڜLzHaۛλG6߅aJot{}sUfH`QF04Vs^pzk`j]ё P_sMlJ+U2(]w(y⚻c`JdAϊ"R@QD{kKbd |Pޏ׻]!4V]JTI?p_U?z@ۑQz-_THcrܒl<ƒuQE*_JK1`?:e?~p~rg|Yg2fg9qoj$*Ќ nF?OU:W96CmHli`etֆsbli3Chk^_|L |4Tl~y)DHܸfjz`aKaU[Rؚ>gaHM~X9{Ǘ x?㶦,*QodZuxt-exsy:ZT@bNL-Ûbly1|ŝ1}rFIkEƴ(m~a~L!2l;xLJuxr7Z{'`l~#6Ȏ:zzxlnvd4fïcyͶQ Ϲu|)}_AuYq@_aGÖ{@DN¨J3>kzG>dQj6;}]ӓ \'`STeRt2'ːp}!2u7fj>ܲ9pCCR[ܩ@\qc|E2dcNkF'w_YqcynsktgҨTz{Ƃr*$^ٳ} qV;tg?eHW=j5a4IK?sb!k`jW] ZWV PGju.iDžxJpdsKL,ovlsv6dEn;}oR3f^IJY83tms[}Iq)oG=|NW90|8.yEZCr7!g>4AJ[z\~NVJA.J)Yq1{t8`kH;3<{J؄kv^mrz{bݤ™`NWq6qu<|]^qqQQ+4gEHM+gXFO=2yah}Np;ٗK~r7IÁ[=)l}FygobP}]ۙ_PֳA]0aiAN>'z`wR~NPAunnJj9y"{)DF1`fi˶?_A||y_2kkr'mx?oCm_bDhX%gJABd^Dwvd.ps:}=\kjh_V)uQg`TQv9ڍ3r@:vXqpۼS_}8KKCud|ckUneGU_jjd7dхlrcY]b ǎvrEhA'{{gFPnH-Fl*_]Uxڦڭ1QͣkLT}f߆œYbUءLzwgiqZ4u˔wQO2fxghV~z!-[>O܌|rhpgJ_`Nw7yiU~JYe9bC_0bčR m+aF\kMaijpZ,nwQoqIXdAs.hh:kC0UX8K@lohD(dAuqRnL%Grin1Uqxb~;|3[7U|[\u?iaoy5hn{^~{zkZw"%9ZOAs}ٕG40>ύC2iRtbJPi|j_@؛uO|M|k{VrZ0ZvoaՅOa`wאǨ˾cɦBʖy {mqtSxR%̗@k`UџRtgMIm"[U_*ٕos:Wdc0[¦o>në[\ Atn fE~wUtPWnec]©h;\hY:en㉯8qp%G]Q ܗ[h{81Tgr7Hkc̆75jxBML^Ik}Nm/,xZdB$2(S$;\’}H:X6 {}o_I*eTuۿSb1tS]RvhȆ9deSB[nboYJ$\ 0e7Z]-֖H\b2MqyDPǩLu@>=$d'`}]5x^LN[Hy]PwI_%Ϟ1~ЦSossa?-x^||oHYb,/B`qbki\X5ݴGhxoY{{ W_b"Y̸AqhV=e)zVDxSz?›X0*4asEw1m[ia!y^sR Na&Ϧ[p2S`(>hrEi_XM=D U/pdysPDqI\g[ʅSvpedɷW'5mTKg9E"G6s~˃O *VoO~aC==_p;%PnTZTUv˔\>mm8nb\8NƑ^OQ`k&Qh\DlYaiC;cpRD.n[$uRi0C^CJ֦CbcԂvhPUآ%R>d<=:^+ǝ~lwP`Xrh7Y(Zz/cKœ%(nt{aIet]sZ1\bm`Xq:XVDW yֱ(Diy8;kw@GjVGwͼat^~dqvREUzϚjԟuEm^IauL[&b@L;}du|1YRJǓ&Ft덦ÛﴌZLLp;Owms4Xlmo¤Y_a{q'mxRxZU_)#|Qw{zhnqs<ա٤Ef`tgE^T'cvVM[ j]=Ytm1>wmO;'8_BNWpX\VWbð{rV/]_O㠦_}xCyȔbe|kV[n|nogo!|ld=e6[yCALыiAr r][_eo"@,^cHV̌bEG`䬓1w}bϲc=uQi,f}zKwS~_5ݹR}@ Xcx3^Ư+LWi]:CI˥fR}cVQ']cwm+\4X`/nelJXeDq.O}L}.XX.WzܟZbmEN{D8h\zI]v)ʞ[`}A `l˦4|JS6$W~kA [t?aa͙9jtaţ@J0c8|K$"÷ZqraN92 t\Y<^ƕEF}3ƨ3 BBYZAͫVagR]N.^gPnƄ6P}Aqu_YU|Ioz>}}GCI4@8̕nP0ӂE'bmyЄ#ї^u_tspm3#y0>QèџܹdPDȉOmCjm_NV`+npK3qlw~ei2K)*ggB`]%m|{Eޕ`LXxӡZt>}uHD%F['\hIvgDP(o[ij7GNN~QmvYiFV-lCU(U\_z_T-.|&JkP{mEPFK{zv#ִ.|y>IVw5=k#\J-R\Kj2KGErs]Iľd2cCOho6_KYWl=oz^v*jh{g8`rPAjUt{`bW:mxڹvYg8nNfQZ~<&i2:IhEsf'dC qMfb4O#Fq]ޯr㻠vNM-|GpOTtpi`i>.64P/|ɮfPhcR}UTcpГh8<\NG?toői\(VChO{fB9$t=|vz$^@}`2k C1oesXnjw1WiI?Az;W'\N~E6v=Xqˮx[Z~]#T'-:d*ZvZz.L_#xpE5Rǻ=x_Ub_KiK/myv6WaOfw|;7V3IUdɰ|q4/e#.yr!.nQ8t4O_KVe¥#Zؕ}hnն}Ol>P._<[W4\qy}wmw)n =FwnzoH΍_d$gp^xqtom&=3v-fH2<5XjtwwuaߔhYrp!!hd=w@Q=?r.C!S~͔XE-~1(+cgRb{h8쏑B{gǜ|y]YR=rXMUY?)J0Ƭvf4YzRƗ`Z޲vjU`w%rzȐngW p5lx,?ZrІÖ܃C,Aghb)[ TMh4~t ʗGYJ7ֆPwkґP晷pS3E}.b*gX2I F9Hnq6i~gv7oThQfGzҳN4W~gj>G:FI6)F`zpٶyuuÊW}0ƃr=4TKueݍ5QmB|Bfiie_@瀌$Jl&vrZ?`--xLUNlk蠨ў@?S_#mn~pcl].{hgO5tTFEtfmzf4cn-oͧ#&t{`[QWQьzlD71$HMYlvR,y0qll^~GP\q۩V`)n'_\ 6ބxmʭ oA>j 㮊T}niWxq>p_D7˗YmHGvY[HƘ [Tŗ(fa)$Lv嗵*SCkxf'sφ`әhٕvhhWs2XXryoh1 qi8ta{eCwt=mHYhEUGqh ^jʙ?ubCWK:4=5d){@lp\qhow]VӔ:m]{Z-6eU6\`{^zosscyecxZR5zD6#Ӵ~6N,+fYy?gu ?q;k|ZنOx-f"hn^oELú>Uޙ%xcW^{}_NMӚjJu6s,|ٰ`ZzC3lË![Xt8`+Wi#3q>]LijهTqp_tleFFx,h8oI\yNRhv0hy>[SjXd=W0XGƙDb/ mzylw]>JBvIzOYf[f)E[-TV[7eqʎs|tBv(}M՗DOj`xfSw]T~wRj5eCS{>Ts |eG(FMI!\GLvvvwxmpa\FffB,6Y`Yzex* \}zpMYH2(Yv{Kie}\f~yϏV\smGAn6SWmdZtP]U"՜}xP9Hl^{lwG]bhq`.7Um2pnlSK%b4eP$ 3fWrZX|j6&@i~|jeofe G|esH'jsU vLF*KX=5a?gi9^gK]uaot7z}VpE:V~`#BpfYpۗ\3~NTid\Ǧ:{u_wSSݽȕӧzwǽ4d<1ble>NflyԱUlVUU|bnBb{V)э )gdLˎkcC[Wj(kNu%s;kwp%B˭Ft2NKK/gR j#h_mYMi[BmTH*`cryE~hlfϧm^dزtґשu9})`k+A'~}q𑜵iݦ[n|NjkX[X|6h@dVRpY6#+VmD'65c@_JJYJ.zsyǫoJV̋s/E_q{GzKLTnV`p3S`tz\oYqV]c=eT"AVyh'bv΀9ϻpNV'ګ_gw,3=/|x2e]GلS;&hҖ9yq˂V`ڱHs? _L}j#wʟϧIW=^\Ȉ\XYUEK1pXCrh8hjn^Ym[uOӠwsh{2i[p}\ÕGTt9R}t^\7w !mcw>M1P|Z&l*mf8PαG:P6Ԉ9Prgc3G Ȝehy*HermW0fpxbN6S>2AN}4Jk~j8q?|tk4XvӻPAxbvgKXfkh;Yl"jI92ݷxm"svW `^jJ3k<8KU?JYl6zUgzWK ruXt`ojN9̽_~'^[]8{R{ףWk;Oqs-%|(~ϕlŏ4F!aCv~(clN/G}\KۦLtwt~yk,Hp>kP1R|NO3xj[/0̧O\o0ЊD{j18\ ãQXfjYeog|I_fLx84}d}rkOpxgcqom[L;I]EfÑVG9_av`ѯmuPxis7o%ধ,SʞԉJ؝r\IP(KPGNNggn}QwkKLxZUx:QvZ]Oj`>J{v<{TܒfK[Av*vh^CvI9OM %\a/9Xᬛ>:!5`v0w*PpPƃzqn(0c_;%reWpWZlMn%VKDK*E5m`9|`pF:J|=PIue7sLdxPS`Hf:t6vPudzuCFzPKX9a=}lWBנU"stUwktRi[~9_eSF]iJb{?'ؙ:Pm;qr냇ѧA2@]\|ƶkNwoS`ffWZy`[AǸ{mͧ]y[Yf@пAqdS9yUA37bs`y\0"x}WxG \=`9h<HB}|(b XF4$|̩e%lcc;^"&ŊEBnic]TgEWT^egQax8eN=I[_LQ_ck;tXZN₱h}udw8dYC[Xɚi\̀Zkq=M̲f9dsʐ#Gpx?'PZ|[i^W "y.n\omkKt4 ƘgFX;Ewm~pZ7_"b}}<@QyzOX6g?}ã\_h1fW)]novE ;rq!!zr^lgQegvQ~OmaH A焔͂ףdb`eESth#e{vB7l7hKeBTա4,z=H(]NbiZ.bALbq&+l_GaVvwSCnV_tZ?}M$ncW1φyٲXPq1tb}a2VScl3]3{/\Q`uy9֨UAk 9QK6VPr6k_q=[{+[c;7s}eTun|#SEկgZ[1K4ծI,rh~JreRtDs;;NƅRlv(tv6Y6E!m{-x\cz\Ї`;zQ%||z`LZRKđ|vJ4 r>jWdG7RfCm\cqj;EN?:XAqiʓn0oNX]֥p/^m)-fvZF`SEeg1ME^zj>vPckQCyh?rt[NW=<೼bl;U^Xz`쑖lSCD-5|ĉ~sv@&jzu\`#PN[RJyQ1ImC`SH%ywi*~kU,]1ur8`*ü}Êq]בW##R][woFsCC˔r99GkRTSNvbqVvիh؀ChSԑ{ƽ5,NhpK^s:Iaafkxqy4fG\sweJluY.?R~[imŜ뱜bohZ m1N62g!_`NkӦgj̗t|tBhGDpgu{s1[r:]Pscf(WPCْ zF!ٛ+zKxJR|hr<"w&CO$Sj5JFjyj~J\Fg\g@D?.fFbwAweLo׷ͼhL}"k|Gg"^qX6&TD>T(/ ]&JxRqXvoRgHj| C>qQsQsX|[hZm~1(ŀ4aqt/jS-M(HJ5ic[' q1˼“ks7F=wkRA`OHn9pQCD1G66kwjp,Jf*܁#@ǷD}rb7WzJϢ^˚Q(np_Mwp7f0i1NV};֖+J]j#lSUĄ18zHb~}ra5S_i/9HOj!UaFRBXu)6hIQj]Q0/{*8.7XD#lq4 G^GPDuV>zH%5W5DEͥ~ʠiB]$o|hyaʏ7p%KZ~;+fC`\ʪmm}CX_@ZdʂvQq%N+A+&\iXB\P! yMO^(ڐ3n^|}6~hh2hR~uxLp0u͑SŠyeZX[/o@mxxҒp͝kFM,?1o*[]+&_bnaljjmoM6_`V`]KlSgsM~H9ʹg#m _ǔQOc`S%n Ps8.W}M m0N:RoV#gstDdžK^egqWb8Hj}S+z]_x&}k#>h?Yf,bCYJP>I|~otWhSnYJxϒ`BYr}sfr†lRsojI\+Bqy@H.\;zRP}z_6uq|hzERfQqA*qH!KhnybehKY/ ÅYd*QzwNqcTz5ZESaA@Atv}0zWXp#ݣGE@OK'3\d]$r\hPc~ox_pP)4{Ŧ#]^-\tc\RؘES㻬KbX˱m)ytk V?\nMVbVVGZZ-|_ѤL<aZx|=OKZV~d3)bhsR{R8c6|jqsK;._ܟM{[لhۉed;rNU3.ط|r}"t1j<=D[~JUrI6wjR~t`3]w0Ҙݰ a$wJD}̭ Th~}ylZey}{G薰UKP70>FS7Y%ҳzK_a}p^rH?xs xP_Zzcrh F=eݐXFەF[UϩvB&zxl2ujv9`HcoQh՞N-Wki#~GsMP^dQhܲwRTWjRmdIN'͓EDEdWµj=Iwik5@iϋ䍁mN/VOdFȐf)fՂΦod-”݋/р=`tFPs/-;fL[SP<|Y9zx$FzمVן+_U_QW5ijhN^VUl{hqi\|qA=ѵTs(I=;Y$)ڑ7yOx{y?CE}PΏՅ7 OƐI[ju'iU]!5hd|RQoJ1h|CxiKK4qƙ֫{LL]tjHfWrC_K0O$C:fbh@U*SFMff.7wsuf?CI@3K]UMV[c3!V}7ijXjuPozA~w}qQ헕~_ScgAط]/._b U e)lGıx-^@c<3ģwdUj%ebɄXd˒UmTʅP>6d.s(nct+3G`kr2nR*(VPYΔq4[_7:ɬVi{Ac9 ccI)`U_NwJkL@reP h,P;%Vz8`sbl;836JhWmfƭMN \`ʩFFЁlK~lZ6apvvha\tLjbqƒ_ӌnԊLȩ?ssm`ITewGᦞhRho}i1eߊc}LDm1r;ZPHhW]bF}h&t"!PDvls|^=&MOJN6ejtrV=XRw/*lYfr棊{CfRp[=|{n(wIFvC`nPivEV@P5Y$imo4qrث{wbhj|xuJZB!J}filTIQha.lw~evsFiA5mP˞x9rںvksUjĐgHh~ʏ w< ^ku!6{@UnMbetOTΠȭ:#h:X5εgwc:k*(Ѱ yeIC^;q4*a-u;kĒuMi1`ІK3}WY±erN-vtGTBfnY(r}U|3V};r{vO{gV]ļzʙTh;'ky_H"K@*BrfPX~BMw&]BKUSq\!xYoeo4pVn\X3>gs˗`3>X]vV\\>+{3~Adm~^||Ab~ـIa@nBwXcAǀ'*qKbpSעMtTIeeGj_̚[Raj|W҉ 4F9rr9PcyGlEPA8nM{_fmwX~g3{H.]Emb-XpG{z}b~W5!)&=EFUΑiN^;Fg Jy3@F}YCr@K\xC'v}EDrꌊsؗiIya5-uB}?e&%rq`0L$`J718o?ğ2>_kw?BhObȷ{]S2Lt~G+uJ|TLroT4 WX}lڒ>LK@tDk}&aNAUrU# b:ieLd:GwW^&aF{r^yTnlYO 8k4ƽcLyY(S9~r lcks-0xokJe%-.ˊBd( tpcvamlV|x01m{F[4mdR.@eJIT\K"wF͞ }Ml-zv]ZbzƆW_1RVs-B~Irȏ/vozt*~~_q\N^>cX_,&`:&AqnsbN-?qM}eYE sk~)n>9UeObc7yjVuf滔\u,u8ow_eUwJw[O;\+s-8oEeewmMӧs-qw0c#n|xaẌ́t࠘c{(QfRPmt-q̂QvZV$F@M0,sk{֚띞,{>ktqtⲙ݊o)zd[ mێvY9~?@޺LM@|gY>@Ǩn-KN}]|LᆱG]cm A~7`w`e r7 g6%n+=>}Ey*_vR4]|n4T[FR%}j_ OqJ~c,U,hÁdRZC8voVDkpz]$e7)SLrԚ]\,͈E 0jډUd_jX}Q,Qv7 I;cnK X[4Sp`..LPm_e4llTˆjK?NYCnt6sJaIw%k|"r>Rh_u/Pz.(q%yuvѻZ+:dF~te6\b{ei\SًXU޸YʳqyuwW*e]oҝ X`>rb Op_ࡓ__qTNXϪ/EG cv0SFUHC{YdƆhi;5l`ѣs}X"nxy^}am~I{8;PbdPm$_`e([cyxkWr\m`oRIN=H?@3Kb| RAP1RxOK0jAٯ$uRTQF0or=aoln|Cyɻy@exe`j!Ypm1mNs{Gb؎;]vgCGtc]{*kqB!8qhf~?k1Mno.atKtt8V8>ҙ,BktK$7m]O͌^*Bpoq\spQkG̾^GqLPqwC|Zwk\=ؖ)Gz.›NZjP5LB.W u.Y4%0>f#X~8>k}CcJ9~fnA;"mH>tRldrFQ&dsEWJWQIwmK~\\_98`DG"TWUxrkYw[J|y`jRGdhTkhGE|xҌX'\"xhcxA_\cakR(}^}0M"pzRYa]G{b{dqZoHVa쯍we0QfjBqӑ螽dpilXgȳG@ScyaR7Jјdθf>Whqy2jAUra|`YcFEG`VU|YJ;̯]Jqq\y{5pe+Uw爞B6H+0gF[\.꫍5-lsk$$50UЦBXnxJͽpp<4c4X2k4O>wbiKrT}ʯQmRdҕQcM`b7]1Pt5xo)sancg8s;¤[Zby|m䀘N,+T_zQVՀYHv}~|9AfЀXS|smUlNѓRO6LsliKknL_f:^X}TfnL*WwghH&bԖ#RRPa\ݡܚKX̴[1K%~ wssp4|Jm1vVCe3qYǹz6!B_r (zf McFl"HЙ]|dz݆-ރev?1.KDmTsh:nFfć{rbe_UsGZ!YQO2b@KBsf|ZtROS[p9^I{˫CS|v@\ŌB,ZGR1rQƑ^-,?Pa}VYnռ7e(n{qċi2@wUsg-rlG.voH]8:Jd{9t5BtDjb.ma+S`TFBHGov__WO| k#%'`IN}>V+q`yz6i~p_3Gdι[0su(]T'YS|H=O>kghITDḤ|`"\}3VH]fwՇDeW5Sx[{NXʳ2PP%sk_Z{kN(}?}l]^̬ZV,FK{tk/[ڿϠMt?cacGvH܋E `kUgt%}D[aP:\gƀlUYV&E\ & J©#z%r,}O-!Ip>ޟ_2jX[b|Q~ّ|wԨ$O:5JptʀyoWzRTjނ[ܶzMe{j9fwIc)'5Ѷ_ov(uoxc͌ff~ 񎸋.Fo^B_n@4b;f S@`*`AV=nOPdFf4@&ջ)eboYo%[TTCfSf9bZK/Ɨ،Yp;nORX\x%c@YRwu{|#i;B^>0{RCdkB%кLޡI=Sh4?yUˀNDHvlUr,qWzȋW1d!N9" \$@Wg>3U}(scO[{3gwrMrg?A:n"UggՃg֍kpDevzܛmt[Lte-e Aڻrxݹ~V/z?F5@_'RbCh|4e{pȝ4nbý"ૅmJ3Eӕr4h;jI%fd*m\he̍xYl0FnnE5tCvFtV7uysL4cv՗TmzEIy閵Jxh\!gQQP(VUnnmlGQGEg =ȘSBV b+rHLPщb`zvhԡnuKR-_3YGWe_E}9KO's:vyIp`ZYڂvojYZlQR}:YiK?7~Z@@̃P;}a]ɫUDLWzkj{WDY_T^b bM\-wZ\3TPGF/Ŝ1[W6|bPPۊf>?LS@QcfpJKDRq(YhmnpJf꩙xvGs4:Ġ*ツ3t{b0n̻B}C޹'hpXQDhӀOWEq{nUsG~I{r}aJpͭte׾-G̉c=N]ֿVq dlQv}I'DtX^gyꁬFu4qSwpz7ͥyA`\s70os=(or[DkulQnᐛrϟbƳ`82Yj!yqG2i(䩫و18:Xsª挘x|CKIgsA?}uY0ܨSrPQr}爐/wR-rtvd[xtY~;2_KrCEpf_߾LXPIb\ny`9K]cs'T}'}?@_^׍%m?s}0bsuA_XPcARn^C^32Vώʲt<ʜd㿔kcWwBFxZ}:kl{g=ȜCiP$LP?YKml\R `.v{lGf[ʟu;Sqb\%w7%W`ۣCyhm3H/MzWɕ`!ObYh m|wGZ7l`Y5)QOVUP ^N>ˌ͖WжOjl4KAΗY+u|_9 rZ7cb"~)dKʍ}aKl㍓pp }HLl:"3%?+kMKɀPPVvYy#/`~udsk=ɖnQZfcTɹjM˳vlzVt|QZyY\`LgjF_$Q Si=FXbJ1i8s~K_`QAyV Lpnj\bƇ?񥓏+*A#:'\7jg}=9hFw^Ԁaf{2;,$h@JK 0_s\/B8mNSe07~F@yHǥZ2szw6umVZ@}SP•V0}\)tJ; 믷5nBueb)X>~\5Ec.|q>+yt5W}Y{VYnXrhQAdb.r{RopDNq;riet V{ɧIݼ>oY.nFɎ#и1olg~fugW{zB9ǠMj!rv2HI}䥾PI}3nn҉Z.B{q)SzU:[%^J%ׂ}:X~Pa4Euo`kh\<:g~l/JFM3 ]>ɖ w{C7{KZ_rσaUqDxETgf"z*| ll wGu`Gjuk/h› Q}ϯ|omQ"emX6ʍ8wft_6{Pa-[y[$=AThRW;rїYy_|#gr/qo|rvx~Dv_ ĩM(ro_|XtkwvNKs30ԵO2jlO[/ jߩ~؃-}'vxջ3[(or,Kez:8UoغuQV'`̇x{P'igMVY~[ 9NʋPL4?X]'vvKiR\XrL{zi}K=y8Eއ]dՑD}ښ]V7RWM@T'RZ+R`ʘjoZp pi[E0vlWA_μ۪䪐yg7t:^<56j?0Gbv"Xcoy1MljfَO^tS6+e`Orp.b\,o-Svқ_]3C^eY\qRNBn&hE{(j2׼ZQ1L{I\ͼ^mpi(V4ru|wq4`mI_MfQj͟BJcS?HFk\rCez (vaE|cwprl)X^yPG=sMXnzt[|Uqv]ЖuRKjҭQ[|M7TPd^%?a[f[xowUcKѭf7zwȊәp,z~oMoeG}]4oa7m7ˠJ~%hlfdQzE2Mjx*4'upxpDG^TB_?~6x jOơv^*nOz&z*<{U}Qaq9ez\@kz(U&F?jh"S'9G{5{O[n[6)|Mmskgbx=[c`Dm}iGK=LSi7f Pf^ }~XsbH#lZYAaǚk]ZE9E;!Ƕpg^F~vYeoKsed WĄDx"LRSqӖR#cՔw!IhlBcgoz0CTjzp>!oAjH]/:I|jP5:b0\VHDrPK:ЩPKuD`ƚ4<|<vba5Ѭ]~h×[q%rVkHhGbWz~ZV\S`yLaKBospVB`Hbtidn[oUjyNT>AKu]>Q|}`뜎)rՌeJ[Ņ:Kv)Q앿4d鮉^hjw,e*zxE#T@xcރ2zyAAhȑU[BqdOrh$n,Cq=${D'a=Ń*ly.sDpleo:`HoRsp#Y}'Hfw9X'6Ppd 6:e~Ta0r{Zk\rNWLMVYZ+xrOAϑٌQEÌg^}\iOmx룗iu2b]-A'6yVtƍL0xkǚuqZz~\՚rPIczVle͓HP\$]8n{a(ˍ2#vV۔QVJa+xؤ5dڶr2S|~DtUˊC-;uZڪ4ki}AWCPV[N7th}zmؒęat2^L&o) ΐ#Y{qCra7jI?e:ޕuyES.XBqE0\r^\_֤ɌRֈNm΋i3?ͦ~nA˅C4ouNNIm{֔[Ϲp$Tqi7H"_zueQ<frQY&])q wSvĭrEpcHxkbǺzL}ze~IQek&œ9P(~]BPWe4+Bݐm$i:bnWV8MoUT:^|q!ܡbficy!I+WfE-embJgWV[pX-ul|@+Ta}_}2(Q5fvwjOk^Mpl|[\(poQed1_ Bh|r{ח]8jҡaWq^#gudxqdazlߞȅtpȔ9p;hVx%#Aƌh gYDRif}p6 kyU-_ZEfӦSX)u/Kqc5PKP5tѐ?`r @tz_l4}|sAxYm3cMuX9u~\~%@?HO0ڋ[kcORUz(6n]q?QQsNg[^_:oJ 4f0r3tBG~mLXݙ|GDH)qq|^rbgjHRjSr}`RzCV~{?yPt7ugqaTǜGwsM.EϘ xluqsUśSh;_PvDi{wXm_{,'ltϟiRڄ.Bt"o}^bStu4jlTsfuzQk@!{kI@en=wi\diRIMɭOQ$Zvmw TʳpkcI:Y(,(;JyfM7(R>rl[]AXtͱ⬞;|{Cam _\bNMnouvlHb1eeknNBX?}R7k{KHkTvwgKnl*zy?hl+CV]x}qto\>IqMpr|tt/_^2bHwDX9f\`lTQoo_s,\EզO g Ao:Hn[Qw m)jZC?iYʻM4Lĭm@F߭\]a,dx}i⓰{bin8nB\]KzzrieA|ܳ}I"ovB3jynJOXa.pskmq{חoCہ&7:_Nmd$~}uGyvj&9YP:T9!qe_lv@v5R=`#T[@HD9\ViڀKiVV_H)iKͮF^]HܔF;[ӎM^Oy/OvFf{ x\g^6$rA'YtEVDnx\p*di{7rAѥR|^?gQoqpoW^wͼ ȗl!T/cޅ I  OnvTJxlEkщ {6|lb``sKXʴJ_~y>MmSzQCas[ؘtȱ7vq::sENUɛx.|?tf9hFʣ#$OcՑqKib]Vm^5VR1*{ `Et2VW#L"ɉi`Ctv^1k%҆arrÈw*t04e~v:G`eorf^uOTPaaI8d$kFh`=rkXεu0Kz?V8}g_u6LOP;BKVS+ydlZXsz6/Qr3_t@eHb`_L&z>8IɼiMрВrnVKi;wgwB]7 zY;WĭdɘsPivO"*9LZmD)~13 H%:Ӧ{`aqD0|UXwt[ˡdɆ+d< #q=Ҁd>sn>dXɣ٣`MS\|PZew_sw~x3b1Ź1W.Sna^yTnNyg-^]hyk^d>sχR50ʟYe~mYGΠ}wT\Mʠ5Sx˕wQxKj[s/vbV cJǮ?Zy]ulxGR,9qFZMv"\~J:dsT_TYec[,ueclm^FhvXH7+^=Fso`A$ vTݮ2?b9b|~pM^PX㉢[U#"aQyi^̛$MTKUl_8RSt4GcDZouJ]IA-zޡcHW kq=2{CSexkSIQ(|@wr|]EL95mpcu2h=x9Ⰲk|?C1f{K5%Rkp9_s`r0ua8OGYaybS|ZE|YţT1X!en*P"mS:aC_zG\]ݒ^Caw`L%ᕗatNSo(>WnQzc+z&=i{ԁQ|dYėImPꚽ~I3Ă6|_kr(^+dkQ^?vMmXaгf<4~wtDSiKa8[enM[uET^Mp&n_TM3#ZΝhΈ]$ Ǫ~9LnҊϹik妳<>Sei[@jk}7m'/b-G_in;PGuQJ]-P^)18Nk\0`{ݒ~Nrm>c4IQcf(&W,Jtjrabo'(f|R]΋h|zBs8m*+OF7-v2-%ՏZOtyni2RTZҀ۬:W`M,\`ogHdO:pb\jsVn@`eˆ..KWZ1FQ>|9"fX?VF3gf4JkAч]}dO~ͅOʗ#=ijMq+ѠtH5#O$ub̙}MbvfmLC=?VKyZxlWSVq> ]Ol_} /La\[%b€QK`m loDouI;(A /p@0hsז*Tvt9}svN}"H9!>+U%b[kvQ-`lkQGbxVc6UUֆ hv=~}zxUj/!\wnumݲ6dNJd?ezIE$fȜ¥VXX`_(VFx#`~[;J6'X]e1doVNoXf*`ja8ktEDnnSe[ LM۶zq[G{MOӓCWvژd q@Yhsq^˕.H9ZQkmɸ/[x[P{ŷu)ߐg xVs_]" ѫL|Mf\QUj8mpiQ~XOwybI,OnPFe)ݒʳak@W csP$wh)zy-,M}H>DЍ\Lѫ|<^~êNc|Hyb0A, "L_TD_.~i;kxrQ_Sog. Hjg@^E-[}֊\|hCiAaqpPٓNrcmSLjGdsVXr]O^?\5fd6\[c}PHhDa֭]?`v[¸_IDi}|rruSRvTQߊߏ)mzZTPK0~;x!Î\*M1opEI]HhU}IJIfTXŕS0փax`m7g~m}};^eUUlN?B E?]Q_Lux@!`Oo4Jr²\BTkP.5Jݢ!V2@R!#tN%ep`.rtƺz`34=/ǷԻgU/A{@ᔰmS3Fؓ=dqy-VU^;nWoyˡFF;\@eLyK ^ěbl~Jt tد}yYrFB~wpr2j]cˉgXu>0f[dQYxF<2gMNCQ_Qk0fلҍ^k\͗PhJg0t9Vr9ifH7b:h].@>u#ēE효danp{YG*dЭCvvNrݐ x/xҴo[=Geᑻ82aw<.b9gt2wrkr-HmpbC?;zFyKuJWoHƃњfqxGZ^I8k^`A@Iygvin@-.M-V~PW]lpgCX`ZcV`gm~y|zY4EhZq7ĉsqd}fRjyg:~p Hf^yytstФO$AIQvMu[B?ce

:;$R``hDL^wQp}EpT BJXxg^xf~UB.fb,Ru6 ޔ#ebr7r{̍Ң7[d4Ѧk>RnLCJ7{*b~owUFB{A5]jT+9m@wP[nUC1StjoF2s VpUfY[~cupau[vJv]dZme'^L[<}*煲ᘩ(\g [V~dtمa]B2jvz˔2YotgY}HU|kS.epfZs/AGXiockxM_t]|oNZRKKayB_evZh~9hMXqD[WVbrgZuRGS|rD²]yfSL *{PNmviN{ +A_X U>=j)p|10gK7~?\[0Xg Ù;HlSvY}w/.ˢnhhkNOW_3OeGOaemsqca죑^ςM *ER|TojΙSnUíOws&G85]Y݄WE7yŭ-5Z4ql Ճi/zZ_2GStuozsDLn7}muΈrgz}nN'svM+茾$~ԕ|vlPLe1Xk鴆F Y0 ;W4ITcBuy/L&y\Zn3EYSʍL*ʪRqnlt=1fa^&JW֋- U]gEP{;357&ѻ܀cҞ9+~?LJukcY}<"a:HG|[iD[pEFu(qijT`c+j/{+}}Nhv]ReFcB[HlϵqhXIŸsJ Y7,c[ZF0pCmK&b`м6c~b$}i~+Li)X-3[aԌIqkIZb>7`%OJz/$c=ҩOb^^7X4?cdCpZZg*C]C(o 6-V"bo$eAob< 9E6_.3\XQοb]j,#|Ha+@BiZ't#3aw 6"cvI͒PBY X|u߃tsd"5JjwS& Neعh>gc-AefmJgFv9F~1:YULy_oTY;?>AO}*o>[ЯJ<+NEkhVPzjYPkS飡nQtm ͎mID0;u_]XȚ3䑸`?dp·4ҽ}X,2 W\#bВ[+MZd8.c!Q $Hfz6P\{XY;@'^, CKHSxca\UFr1&q#妕pM"rfZ۳㓚<^)`NTνV/dcT(ϽeB!h|,ʿ麟1?n~9N"( 98:6}Ҁ ?^Tk$  w'1ov\Xt|74 ,c³Xi)Oe-Qu]E\Y*龼x}w>J4,zMtc1KeGiUrb-cٓ'Q&/N&k(Ѕ8EWABڄ?\,}!A)O~Zぺ=UQ" K³+q8=hD5(^*8ЕȒ⍅vϝlҜǼgO8Uٞڻ$+VAW0} gw>d\aAXL)v$£Ԉ fE[A^B @bM7QȀ҇ ~{yhD8ٵ71BchMՕuF z EDnFPt>P."_RoiG7?0EЌFŚ?&S2j =Ox+yL([&S˩Bt*,0xǸqT4q3VqT(79QڦkȩAckċwa M[Y6KQ4R˅CVi"dqMX=v«pEebIyFO ):?sUM EAUe5`}0$4.cKR&]Aؙc=ߙ6O2V) kݞ[" H1{v*OhRLVf^ p:Vc0<0`r-EHogU_,:O_弌쮞*@f'Yg9Fi'G6u=peKc5r_̻?b ue`d2Y/҈yE U7f;hWRˍ:Y]+kbX+]>=p-GOl &"OBTmKi=}cY.)mN61!ڀa@\83AVSxNLȐ_Ńj:(XB]l@€YH7;]+R6"^.k!aeN\px)N?/b1ms~ <]Ű:5"w0}p**ވFɺ@_A߽ <=w؊K@s\o S&$_/Yz e W1oq,HVٰE|Ҙ<vm_a~yrǁqfO-m# uze6 ߥ/eXjVӋGh~,5"6=$8rL݂$?VIwIwN؆v| q-48leE%t> :zuЌYѩG#K3QԮ0xese0*}Ѝ, bpq=ܭ:LK)wГ*lua6jnGLH:91/aT9"ώK#I d2< J 4wUrl:e1}OQ:O7QY@S^:Hc`H ߕsT1!6!)(/oF@" B@c+J2lb] ]kK畈yps{y:`sRbaB$ C%)_{_G !b@J>?%T]r # ܋?\*Tb_AZکt%xVuQ_P; k lH=0UZ]~X T"_z"cDwcXJNd5A( ʹ #.*jWv%S4H7=KcǏP$˳rx\hA0::bJ-/D|Y:xVH'c)do9y+Y]f[4BR{=RC4vpJa\wdWabԧ2!<OeSܲtIHy\0EC~a;kx~U}4v8جZE>] ?T+fRQ|35@5, YVRg368ja9S|Yl&Ce5 .ȅBj?!^F,4pt;uk6w V> @ (ՃOx.4׽RH6^&#k3N6HhaTjOQJcQ -%9BeC HWaCrf6iC hdIOK8O%`,ydǻ͛*X 3F <^?,hizѤ͸:$d4=m7 1ۊ|I9M%XƉO,|I;VmHZzٵ/I'=C44! W650>kL#(NxD[v-D]1=.RXtUw{ۦGawtVqIY۹%a> M* kvp[;c%/%DI7" -iBKA5(1jK^E i E"X %]&TTG L[TĖ4nbutMHMrDב>J:B4"`bHα$V_.)fE"zI$o]/$8i 5Vc@6UFVz(&ݧi9X;$JS]apuox]9 TЧ<&}i!+ĺD!<%{;tu:4xKI1 e(<]ћ}4~^ 13I#=+5r- 3Idπs7=# F9hG*&ai\_j7ER5`A`zp0@g@ E?wQ&oxqPe:34}U_ (4 v}~WVSZL#!ɽ;v.*6uMmlҾqZehSC=X Lf9mG䘂>\=HWq9cMp0ڣ~y #@UD:Pdt_.y0ـGbc4o d -7錵PKIB+7Kw\OJCHd[A|6'9&~ieŦ`҅s ûkuENƤ2 |q'!M$5zX`#FoB%]~( W\Jv{CBAtf-(! e G07&(.WkOm5檇BV-R1W? NrU/gsMT`>bQ@25hǁ [jm:[zХG0/=d6e=Ĵ!;|u%%Z^O -DsIrQQg,[b(4YJC"'1Ko^(j P]c3)Ɓ!I:LMW@lmhdߍy, "F܊i 6MbD(ܵݥ]ǰni/5۪oό'wX!i~fWxMΉM J8[ԇ^h\s+rX(h`z$mOKruu0] ~A^L*,&;uD  ;#q #2)]#0 ܏ͻߋ/q"1ƽm.4'bdu+6tEB/RR6g5qwѬqzeYMq<90 -2RbSՔkx,GGdr!UTAl7 ȝ؁L hW(=بYAZy}S%\sq)ENVZ9b하p0=' lt4vWjTZYS`q[;+bYE?H UJ7}9Aޖ *C9^UIwuD0mC!vg? Y<4AYמ+iR\}"5@yw a<:tɒS:Y+vעAKcڬf:b,0KCvsm5fmXko1sFތB{!ce5eU*:0<8B<1 USW}Tf{^nD/+G@n5+.r4lA~Elsa ySPWw탪DLRGK3,!E կ]7\+L0j;i^z%@ws6X]wՋF[dN*[6ç65ZMH6#Mn rz꽣UnhEOŞ2Q%O/w_T/MA7"vꖆR͙ԯ{1W+X< tRdvfߐd~l9Czkl_"us chD XJ~w0s^?UE]7 ϑټ 4T$ vjj9]gAOya|^nyn' Af^ŭ1P `~FYņ93VMLi20 ͭ"t*/L p]ՠE-KΏ|eS;E⨍YduJRN S,0,il>fjO6%ЎQЛi4[3ƕR{9-7`6u -"u{2**,~CI>|F4 ZLUj6Tcs9F0elo+Ɍ0G'b>-y_J|1n/P?*Z ItXb+rywg[-%`upt?tG&'X4 #S b dG0O=R9ɒh#.I\VYl {i~5xݦ6뽶EI]52+*Ey/S7V)7fؑ!F/;`fW%-iG#1SRc9\Ω6!O4{F3qD oqF`M_gpP̗5;ɸ o ꈷ<1(5=uh5dfF+KD&ae0ǣz^eCz=e`*Gt,65 ֲC7cv$R$kmߑb8yWb.:@wlw C4,I=ݜZ x7{#5bZ3 'a˵ 0p Uy&FiQ|'9ƖZ3dϬفzdYQ͚-IhDOz*w \&ǧG]1/fn+DբIM'I~$ekk(0!%1!,lS8Ewr1r{V ,ghb^! e#{fILΎ"D/eda(V4{$;E圱=YXŜ{g,ՈѶs^?/Hb]^ ep._&̥{K|f93n RލWR:oPhٰ=e!͐qIf*7-oѽ(iwU,uLf4rG݉w)q rQC@ޒ5S{h@]l3eܰc0Mp Ը 咙Gp:RΪOyp!u/xkw:o%q{~SJ /[TC69IKfz .K{34QV-Ngˈkya@[q-DנNd'679Ywc]R-+h葻qd)`}{8)~x֣J!}~J]OjV(%a5j4E#vu6(W*aV%VŅ~NXy>aCb KdT)_oQ]l dTB\ͺͩ* v8 G5y_s"s|K,Pn$vָwE9(w~EqdΠZ߱8Tg@ 'EzCD` kgo{lCz1BҶ1lz>(y2w3jh-Yլ1Cu\Vx>qf NMs%F+R/oSW?[dD&Z`+&e GCl@l7*s\ $8QdeUN$OWzLGsĤK Ihu : ³IK0rx-x]l9J})M{R)biOy!Vq7.I2 ǁ63\"Y,Mi$άTZv]uZʇ[,J {i(TP3IcŧXc߮=+֫[Fa ZZ^m9]:Ɔ-En5Oa.BR+Eɢ${uG؂A3; [ pn|Mi&oZDG;ʼn*p eIqxC^Rz7FqHq=Ќ|:ÉUh4D>?X_=@r .εIՖ,5ri>D KfvC9- ?UCkOo:&WL|09A߱6 k?w&7>&ϣ?ovIdL=V~z<῝#:,M,g`E*n 1*o&!nǾ.  4#n #DFk[PsK@@-4ӱpܭՋ&bXǢJ0~'xMV4Qd2mWXWH3aF\uCV L¬7SlQԤ؂†br/>(~t:+31x+-x|6փ o%CMw'{g h(6`KύgN޳{wC}u0*ggAN{ﭴ1 C"#7AӷUqQR0bIU6b1P[7μ̛5E?wnVPTFr\&$ Mk~i\e/ F_DfFgvI9ވE(/2>-a˹ۣXMUPxzqJ;62Z dOzdzz8P+^_Oܤ$\:v1 4xhfU`$ ; $M"*=aۀ<'lQ~EVd/qmщڡ};q /((7*ә2;X0 9M;R/%*OlF8;qK|fd@?/+vB;CnSkP{=FƨqZ2)MuSٺfUs!Ce`/Z%7 .D@[/ZcAҾ}l՘'m%(5 -%^!i4|;{ݮgv!wwnK,d\ e1DHwrF'(5-׀Ƒ74Gx2%t@F a*^̚vSEp5/`gM"4H=~.q}ڹ*gXL𜂗W & aOYUfsI5.hLl*CmϻZOƍ%.JT*.vBmNulyzM^m-NJ|jMDŽ7j\䔇lx[2W`G!;^e$Dו8>GGq:DE@fJEL 29}n7LF?a!ګ@^W·ug+u4  2HC?ū(!Նcַ5; )T 3*>2Tݵ_t26j@du/Sy 4  *]bR%/uߙt϶Jss6lk_,j4x)ԥԗHF>{_<<6TeFCWSfB j쉱m?Pd B7\G$hrZfyc FwBN=|4pQ&\8 ps[#yN`[I;/@6YCJ+@_H?]?}&:OC qM58}* |02OG}8mWsԚٴf7<<7uJe󚺢-PsoYjĪ5l~q+MNlju~74) @h,UJ]T&ЃQLVW "+r^|/5+KEB&_ڡgSo2f2k,<@:ҊO6_ r P>Ki$UQ2\=ϩvJp(.[`MtgqCF܌ /E Aq뇓 9A+ԩ֦,{_}ƀZ(D T!?vfJ@ꦰJ2 6ڝZWfr_XߚgeߐҦし#fmAjw"GY༤;LG Rn-[n! `$9z:(E$%d⢎TTq}hu**/sbdyN~8-Ɉ17\.8=Ezf;cF>,*kL( ?cC2k2.UF$MvpI:]P<,",5{XJ=SKY]my6dC~9(5$I4y {G7/7UћB&>ޯran56;c~NcOk >l;BΡkRc?!V/r9ɋk:j,SDžQ 7D,RW >$"Rq״o |Е<ж %3 bրZ;X&mW;Zo&.D/@ KL]÷&+Ae>Kҭ 2#sDˏuL#bKƒE[(|-U:^SЌ凎 Gw+=/Qj|VF3(5@htliio1O덹1}Q(I\oKrDZ>(3?7BPPg{ 6 3@W@E@xs7⸂ Z!EZPڥ߭m~6P\2δ8$q!.=0FJ[㚽= 9Odz.?Dhg v4ׯbasA߳)Ys6a9횸fsF:9@8&jD?$a3pߏIxQ/{'`F*axX$ }i~P;(@ JYM_;%.󻜪;hf{?,15m˷᠛m7؋sSYlX3gu- ڵ|DcǮ'hۼȴ8">I8Cn-=1H. U}ү[ ?>Xy?Wy!jpEp.rycH 4C@ZteA%EfҋHq)m̌;wJsWR`*bҽ,& *5RY}\0մ`pL4Dj'2i:}¹.ef7YU~tOkbzA8=~ZOOK$rc:azjŷi܈(]Ye 326)X,1wa Ԧǵ @6;JE %hlR\Ge:3 BB9*]*=c6Oƙcq(#@ :q^>J^&}1AXW9\-q1&rF}FkP4K qUug(+rZ@-O15AdXT> ⓽uT*]0Yă?ЇI[*q^͔lNOZ)B;RSSC,aG7VTA,DRFz^H*u;B9sQO eޡkj':|7YBt} B%b!&j</@&K Na"Lu_}Isc] ɚwM1sAQRޔ=@ 7TŐwW7:AVIls"BTֿ;-NAvY$|=>ua^#xEedCu}3 $U3ǯ~n+h1V#x-$]>V0Ű'K Tl;6bڙRp(|d8-|fRC;'Sǹ;y~:~YV*qHE'4jpK Ab2*tͰTmR-At|B%A'(@ eeE爤H! X/ 77FD Y|f1߅РTݕo/1T?t$xfS`>@ + D,y H0R#%b7I.>MQUW = 1"QǛUDjK)"B9^$US,?]5BJ,Գڧnw]9 ӟ@@:33oj÷C /GWP:<[, ݤ}}^m)/'z+YǓmn +AZ_7e_c$I4r1 NGY7#^P=q҈ԊdA*crT9ì]0tJH9WYUoА.>fV4Y$:d*4Xd܉',MOjpEώW]Rz.2xccI 0dp .fQyJ3ȗ%pO9`J 'b%=jkzi>υʽ( \( X(gݒ-y!TXGX,&;PԂnӚ{|Bġ9[!p""""H8`TiU+†dOs(L֧rJ B T繂O%/&($pIyr>m_Ǧ013L[%D5GIIA&\lR-3=7it:Q 8т^7_p>f!>&~:#3>lX(?nt Yr`$ E-P/o0OM>\c2q6ulnkhs00~RZI}@-_v 5q5 A*u=`ʝLr@U5_"wAHԎI<5CyPN7I=CfST[ûCht!1R3V"qFl%/wՇC6>Y E~!Ljj47b{)+vۍ()~=hvt?Q[3BV{B,UM+x -GrvΟpZp% *e t65pw 6'ҮXۥcщ~Ũ ~"#F-oz/oTR1cnbcF#(Md}3aѩ #W;f짆5>e+i 0L1ʳHOT6B|O$,JZS1A&?wy^_2+*N^.PkTK v" F5YE`aB:ҳPVDJUu[ܩh\csaG~64إ1M|= D &[6Uou~.S1 ͠6ƪei&;ݾ[ٚ|Oe$Ġ&Zmzѳ-+BM;0هCD>V΍%oڭDy')F<s`l3@{WW³:;c0[`H^u|7O_[ҭ{sa%d }i43? @{{ ^-f JZ p(^}jݱnbOB,`^e9S~ Nnh-WS:[=һM=0m̙%p; Rv*H׍a+>-ǸgtK S> Yx˓a V{zApk=+4uiDI.f%?y=e[Nk.QTF &fO|.P12+YV܍_De MqôˢfdDu~6OG7栺+=LߧVPT}:}pie:k*Yh<.Cj^xOhA&^a4SOJ?j >HaA"_:1U=Z,\6a)4)ȺAy0 @CA=q ȼo&cHӊGss_h6^^ IVWa6DKmͣ,H˶J-QFw26GxeF?Y6/Q`pL./Hbw2h/t?n½Y{=/PF:K`\ǩI!F;y,E<)ByB.,$\\sbsG14WrnS](Zd޲2uyk̙E siǫ^8ǗP cFA 5F74a$w.Oak8 ,~z 癌13Զ]#I՝Y) s0ɦ7ZhF1 Si]d>_~-1bCM`3\7]D*.>:O Q֭t %\Wi$< vE2,;! VobOV3ˏEr#.M_n* W"a'{-%\); 췸I&iyb'sP&&v\UOߦԠ}^*:K31 :lϝA!\Jԛ2WAMj6?°ł;>t=%рrt6 K@HN%8F; Aat>f8wՕKOO^g$*PCxڿ[¸Xsխ3e 'p F pYWy  ry"<.6@#A&_^ Ιk2  Qvh|'¶Β^ Q:( "{I k"v͔jZīH`hkeWVYnGTRTĩtD.c`59ȩQN@4% oWb~mFpQZF]O^xԥ&oB͋zR xDƴZh.k(r>]mM3uaq9QAP-D43wj8 440L8ק'1# ,Ѳf7#у[f -E(m}ԜYΈ=/*zIX6so⭧ 3[[;Za]!b>f'. W3sFQ1MZ4 UIgəZݝE>tlEGXߩi't5KaT`8^oYÁI Uc#kwtӤ9I?\Ub緙D1ucT_%Ka'8 a"3!cfMig%1Uȍ@D(A}rvyTur0KψK2.hώ * ?e~A0W{&'?fS3R~X{#,L$`''2z>IQp=.P5.Ety7c" łp$ee,>QQ+(Tt N#.(5qOȑb2S8|A%$ a9GCPms:)k*L)~ځef =n8ʞ 1;WiGul{JT _pZ v^^WD{*41V,v4fY;1JF]??9]N6Fˆm}oQw.[tVޘ0 yo#15QޣNj27@)2 ՟;g;VHhyk[xL|bLia#N2v`ڟU(^7U3ґdl ! k,SǶ1P}jp`#Gen{NZ))w|zflE"ϪՍ"=RJ ZYm΢_7drhֲ̕;Ԧ[{MT[f*5ԮYĕ6Ɲ F>M뼻4*boZBt3YZA[ce/sM ꭕ}1N+˚Wr:(#hF|;=f㑑 'ӆz}_Q?M| +WL.B2`ڛ?ok]Z0ى|͚5pG*IPUEmM0:4}+爡>`nݷ:5ǙqrR:)${IlM#^96d<&QFT &x-ÔdV ҩlV-<.l'؏ό#%OCm}ůuhrҶ2HD/oGZBhKۯW=#RtX/&|6Iچ{Q3guVo;_ #AE0yuILf"fW_Rȵ3rI[iFz9 H90*ȳ׍b;"="#۽AC=_-|n<[<{&~HZ,L4+Yv´]f5^\ߐ |=T\>4`HU;İx:äٸI Pe+æ';=j˩\2NjV6cڠ]K\^VpV4hưU _|csJ7/1{C]sRcߪ$'2N:VWN!yCmV/tfs[0*rAjUw?|Vb]m+BXdEwءމ  #)g`5DD(]aǗVNf?g㤺[~}sWHSmr{s!O|Kt…1~ΩtPf& [YR"FPT.ɛO2eIrlHu@VOK+MK|GTI 0}v?^dST3Uyg҉IBu;ag&*ZYMRٞ,ABA>"4]| "k魗0f@sos}v\)|T!|UPDZUxe}ր?ivôpsY^cH+'fg5L(AzvOYЈ6gJbTo)woB!bEBR {9("( vʰEy&'$w`&o|JAJSA[fs޿O1<>&/%+q,9KLh(eԘQ/$y(orUт5u"AnmI=V8*Z2Ƀ j>z2]C+ևd | N:Uq}B1# W҇p|mJ].; Yx[{A` 2 /'|蛦"O5$v샯3WԊ['bx9 8C'$J 5o v"Tz qt \u"̟n-6[?+oWl6SF9$Z7DcX~i[)`Rm<{︧yg%18K $9O㛽)lBe@Pp`ArL?d̙5K 7eɈ!6V{HdnL⨃K4 CwGjX1`WRM:S6&_Y~C2*&p2+%}S#1R[G-%+TI6 gL?I}i<V8:VB>zikDC6!}} .n? M[deR}\ g:SCp nx;6:,bɬ r.ajZYLy,V++û;D+[t=odk[Cyz! 1Ķf8ƦF'ZѷP295YV;Z}B\Ѯ9DdK_VJ;զWHq~`R>Uߚ#|~C7S틲`ڮ'E{:3NXߠ`sƐ)1HaT4ItNjd VUq"I jBp0,k\Y7Rm=Fbߵ2yyVA兪6!:CS|GM3 DڶQ8{yJV ,/Y.ggJ"^KtlO5-hMGr؛š_t1ukⰆJ5,[& aD{PE0ޚjf2)7)IҢ08ie/WJWmS!ΎQjY/W', ɱ&(hcp~Jt^aoLWlUсG@c1#‰Is\&v.;2}>6O>A :GFRG"B%FRNzvaEW&V6{5 A86C(r4a$Y"-|!Rxm6ֆ򻻙!~d\.(,lʷI"\ntVѭz1彫y%zpg\1/lh Ӈ(2߾1tN~H~7y ћJ.l.OBcWe?~-Dnל7G@_?0ѵ;;b̍ ld,kVij+OĮ: хgoc._,Pq#-/6Z3pX ɆV$My y@{p BĦ4a颼thF-u:<(|!Ӽ{He)J@<7,gA`1#0C fR_G'(@\4v:.~xt'0_d\3 nB|":1 .1kgӌg5"iuMAaS!(`@7{=CYV&qpYYP<$1KI k'`5"hK-.]42j ځǕUI '6Lcd~kAq6-}:5ks\DRM1}P 3OE3ty4 uc8x>JbqPFtf 5PD0U*J];\) jRFy&ǟe׭N{(~t#KJ;RkPn9Il5|tS|aܽb< )DΕ~Q!YHtN31Et/;pVR %^د{տv㏏3P fwˆOG앖*˂h}8>`ȥd-eŏe4DjyӐ|H_uGu0†# jBKHK/fInímYb1H9 ,_1tQ {ݣZxx!@ܙI}`R{>cp@ԟpPiJkkFO~ oN >`j!k=)Af,M8ria,X ע8DL )XշP3f0L,v}K83eAjR6c8ԖI ,x:[d;kچ XI*3/S=jU:] &/|>YU!>|y<n|-ā'XY淬rIhӊF9 @6Ƙi>EiU|w>Kp*JPUtwN?J[FZA=q]jOjƴ$Kzv%)eZ c-nȹ 6=GiIeǔ]HLc$G5ȅ:hGYսGn)̰t2< HxUp\{@L79zq^ 駒*~  0 p; 1p*khD(GYlQw@;yiR*vD 8$W+1]SQL[!R06(!Gŋ_U #WwoǹJ7DoItͺMےn;eTe=^;/1EW_?fDŽ_F'VnWJ/(rJsAl kXJ>#lP$ ys`u PuTCZ IK|l>YJ֍w#0rENtyzL&x,Î.tD+5٧xJ%WGLi<Ѝlz" (! ƾ!zzN~y :yԛc&C>pm3ivzm:3MJ)GZ8CR6bmR/#ZxŀN_tՇ6y'|lv'ns*^s9>BFqLڬ^ɘ: ;VvFɬ/{G%x:qTE|h> ?h JCRW~)tu}g ؘK7ac +yA LiF?^X 5b܃HpRf>@qGbX%OJ-OC8ݡm]g  %-A286!xh֐OrGZ53n7%'gd?=912m={@Ahv0*TS[syXub9ª~@id0'j<Ã7=;[MfE c`;LF$ !D쩼$&,cMmX‹Ĥ>\Md4d<[(qGC72i_[ ٚhˆ>G }0 3/xھ; m~| _=%ިsr+OMqq"H|0!r坜 7=̽BZ Ejn])K'µQn'i$GJIk{%}{x6BسW-Hz+ITP-(dK_7xԶrucuiUĠ#vd1f)5ΰ*߸lܿm{!e[l; yR=±M&I2wu _1ԺU{Q,) ěie[GG޴k$M+Q&襭ޮnudZfwSn'9We.=#.cwxQp,kx'$uK#*R@LĚ}h!kT0sl 2qp.GmW὿ M 7Eia2ǚc8q&b9PbIPggx"6*ðlAP "'wFb]^4-Cdnq"W>Ty!U`6vx X1 \K*b9\a*~B.gH 07Dp2:Wٓmc]O!73G KlAdCډPQ@lhy+#M\*u[:?ؗf  HH7 ءs^pNUdhKf7K߂wN 4`;Xֽ&3;iFko1å` @ӈbqs2nh0&-N@Oc댅8ԧaf힀xNrh N/Q_sBќǸ԰*RT7؅W¼}gWvCV'ZN+5,!؉@f{ E twXncAqqyNzաK޴DdJaT%U,B9ko-˴0$h9@.UGoWNb7? p&8#kJGoϊ Q4YYUɰd ۾`kmPy.ݳ$D+UMKc7e6}x0\e mZ[HũB]d1dgU0#n8lDİg+žvzsL6ħH^°qfvsO'%CD|8+Xe )C LܺBr Z C1)l<}{ ȇQWdVDꨏ\Ik>qbiV(7КpT*Ҁ~ "RV \H/]l\/Yt9aXb/?g#3P4!|ZX8i4"Ip9H(ډ%آJ5gJzA8ו}oj>`!ʁnvɿ s[V8QH.[m>[$ͧd}yf+7[ҦWrrK3ޏi*֞H(@)P*"5\ Əo)rկ/Ĉ wϠl9~#BS$~w22jdv lA }yǎF'HbT &XRf8*Wb8_{ A*g2BȚ%b$džIʦu* Z'If=QM$"pqr^ӽh[Umk4la&0@+K H1N& d#ټ$rPn?w]*m)Qm~ 1K\qbKTL؇=yXbxOWlkGc|p/⛏ SVOųH(q<a賆;>UԹ^c{N"Ը8-"d3ٔT$&>Bx{1T57 [G䷪+gӊ< &MvQuL:[ :鋯x? ?<9o39ed>[-Apgy$ޣ K:_p;GZufd]Z;y rߝj%wBAm>~j9?K!ad1Da:w;X`:2٤LhbDxcbw`y7_?obJJ߱ǟp "/$wnY8O#-AYѲ92D^_=ͭӔ\%!3Lەڔp%^%7\ﴻm˭ s'Cxȓ#A R)Su3τdGI:}qÊ:+g9*i,|VY@CC?Ź85rI,m-$pLD'Z/T*Q5n-a9CDX6rx**ɉ7 QZ,"L74\EgOdw(,?qqDx1p=6ŏUn!H΁EYW5h܄h_괰joW3""0jW%FF^1<$4K"$+ߥkv[3jf63~ahq?CK斛t3lcҐL2 `6G#SVK# 2+Wp?u]#d򌚊LQ.ײ?d`\sZ"ޗ)~"5YBR)ܝ2 6#{e}m[x՗י3Ĩf>kCo'S~@8u0 s{${ԛOUBpf@\Mn>㰒HYx "5"=+ 't _Y'}q>O }SAO /՟=F3sS7ImݢY=.gB3 56~ϩ.$j@@ {d,̙FTìޤ(X@wh#M'V:A'ъgW\k.FTN\i8SoM~:'ىSL,N 8P{ϑ_nwIgɌ= Otשx[L@NV*s5Ku֖a!e0;i"ׯPW$1[V$Q~q5·3[Vt`0(! DCd ~41qB[mH\?^X} vd4.Kw {S=Үtsᗏ~p-PoحyjF>HxNg4ެ,k 'ՃZW߳FmR:9 pM5(^bY1qs¤ea ߥ.@jSa-WdD-$]SE_7 a0=z2b}#"8;]Z]C8F|ËR@`羹lW ;,_[_VxQ%b@&A9P$ڷ}-DFMm%&hlcyt~~yb8(7ڗ%fa!18;i^#wZ)z7yJ/`oꓺu5K3L,3 4+S鈌gԮ aAs1^6W<]X۳1_$f Gy`Xgc U\$f8Z\5m$Fr=JpR/&ΑՒOļ^YD*[wEňbc>9L *#^z{VcQHẃ Vx&PՎDlM;Xckd[S;:@e]~dT= *C{}5BQy3:[5uS_3XQqψ>PB`R[=9^B[l;Cnsl=r<3^"K,^G0CiK-Y Og`w:$yT({S4CL\@TeG}{P?8Wl˃,5j0OׅIok:rJRAk>696y%gwNWV:uA<`\,u"r+?[fuwG)Lj;)::#HӞ5Pg/p/5JyN$.S猇M|T?9W/aw1F)`6#*]Ƃ^R@3]h5mw`}\L^s#}dC;o:_`]D+~IIˠyg|(zJlf $ x3x;{jcQVБCD ZvvCn()ʥ/zë_=EZSטRؾ3IHgzwʌ- 6*X^B>PIcݘ]lKaFel!Wj =uJn)늷\/~bևbM9ܹo[JW i)QER[&ЖKD0Ϗ!tLUϖi9Zq懽owc{<+YR UuYaNĒ@B~SXA*.^ ^?60cyv82:g`$u#"F?G^eH"ʡOB# ⺴îm&GL&5M8vo꿓jwq2`**jddKHuLTL)[ЅVd=.u`^lN@қs*Eug=$7ʮ &D. ;ƭyaH"d's`K[gJo+c|׻Q d^ L#NBUZeM6~L.֯[yMcAweI{b-AkceM hҶcI+~{{RRtcKz ~VN:~(9?Ykm ͆=.+@%83mtB~\ 5$^B6iYvX=^ThDMLjG kRy _z0Kyrhgy& rɽb'OnNS=}&NCXfG3zR0Lg[ H`0sTTq:Z)wl{+BE]D zzmi"Dתu.0* ť2SpD[ R䉴#>2ẏ-t߽OL4.B:9I3DړB1iODb6kuVHc?tGצ ,QlD P%R.|-1i O1S/ne:>UOKG"tv|7خ΋IYQw.˿1\? f5Ω{4s{۰uwdSkcQՆ:#HH>BIF"&i]jXⅴ~Җ0c0Vuw71_J{4k IO(j|qUKp"{V7jĘG?=6\j^] PKb}xp0Xλn1+‰)У<=c)U;LY&k+՝aXBu'y|b;آ $ѣ8^քqOwPmH͕f#ũ 6!yVhnBМous/:AP,I!bpdxyEޑ%>&*@%V}a#]O7 Vd'-Yro :hm,¾6e B=),Y+(vgp%NTS܎)oNp뫋7CPZ~ElvFDi!.{p`G>7%h~N"?@S[)zbEh|%!'sJCI|Dj4z 9L+.MNjYi̾P..¹c](k,2Gt篆c带Q|U@Su =.N/ipu4HE귗&^;[&T0~OE$yY~\T׊'lY=㶍V ɕ 1; p 'p'~M14q*ozvY), (06LO6T%a`L ^"\Y1ۙGHg^%r"f=%,!.'Rw_.4΍H3TLM2SBr6Hcŀ—Pt=8dg(}>Ɂ: sT6=qfpDʰ+qSo"3-*8l'ki*yqUu azri:Pzv?wɏBlE6 ٱN1{vE5`< ~.aĂg+ururoM4 hV!+ǐSiZǑL# b3HEouԍ^UVAYH8#l"z)ĸʎiz5)qi>a m:Oxb#D!޽ɇЁu! ~춙LVt{ۓX; 襜GT뛇:~HpV\K-U*x̔qYC*v^=wlz5DteeTJ%l b|CEsYoA $FR }LkxVoB.9Z;:`d_նRj miҪ_v>]w6NpUT5'FcÃ58T,I@bz"roס$'|ō}f2Pn;ERڊF=8@6ofq_ h^W*W)R<\j*˟4{ 9Ow1L!V:v#Łx8&?TE'X^!~+ǁ쓴o<9S)Z[)5*vaz2Py_]{+( X=K?|p,cEl{7<}9Йb\ !-Y-h@끎B1h(o܁iƜٱ΂S tt{;~Q%%;;3 =A:&<F6MW/D Nh%g/@DAS{t2[%ҙBer)=fcAqk -M,_r8mjIbA:K7znI27-8d):6{Hz]4Iè3N=r2||}‰`(Ă qsp3Su|E`o 23:[ʦV9aiKfW"lT.{g6D2pn!aaq4b́nB$5]~m㥡<~ɮ$ V =Ew2̊TKs̓1l_-!9IxqY-T8+|I-T*{FVԋjJӢ5 P=.gR%S{bβyޚCq9n )8+_.sL*5(F(#X1[H(={.-H 2uqeJ8hu ?_ux` m>ʧKe =0ϣs l1ԭzs Hz '\E$^IݍUOh6#}HT4Uq OhCz w ^Ko h;dvsC\C n$1,BPP xu:|6#'$?*N{եrLs_$w̖mQ7~ִQE"JFo<6hJkJz+ϼӡJ?T{]T!+Z-pݫ Y$/DT.~l~uZj)OR_\@cQɫz&0La^iYf9=6Iaɫ y,w%l$nfaE;Dde6UXO.83^z2um48k)-=r#oybКH06_⼸i goNJ141Wo1A%^0ZYFB=goj(Y37Mks Q?}VZ(ͨhn˜edX㝝 fI2DC_WjQ}{_);hlZ&!q序^sƈSru* Zrk5"`ƾ׃uԦN؇1=ꔩP4.S|KG@cX_ځC>:R0}_ kݵUѴ q0}+tA:fO~`'y~]f{Oj!sve3%w2Xi٩jz's*n!/v.0\ބP?E?w[aׅB>krcS,|A=<^xfˀAy|I͚=$Vh7H49 #tB;jDv#}X-^tϰ}?L2o#fBL/EL-Nu", '>%ȺڵQZȳCMSPG{/s wUvDn+`-Ihؗ~R%3NbvRaj1 syW.BHE$#;ht4NSф֪Nht\TqȒHぅWHji5b؈sbEʱ3`|y׈*2{۽ l/ak8!^7[)8n"8Xᢰe::Aщ"=sG!~*%YAcڇ'tm'Iak4;JVFZ[jD3#31\EݞSq;TqӐvΤP3;Vh>O^Dmu3܌᧘|mb3"suֹ[0.caLVc1,՝TllCO)ܜUg9s`h)Vb6+*0I:f4#M 43Z3}juBmEh@@OQqd}c$#(q3:xƵQ>G n9"feد)FyueJ?sp@GA)`#`w2H@̐>au%wR 0sy I߈s4r<+pd0s 7ߓG7N^.h6w?kt_X[-ؚU(0hy<#N]k5ȺLY ,8u4?lcs|& RX O[r%/a췷l[E^`3If #q(F%Mʪ$LSiSr=`7G9k*t%6ϖͿ{xO>V45ǯ  c7w \\ r+#QHp& tU3| N:p,zeSn_/2?Y;6D | L9Tpa]"n@ RZlW_3ퟓ'2JGGuiu4a6L߽ŝT7%mS{١RKP1 EGՔF**no;/P yTS%ࣲxP9 ඁLzB;W-5ҿE2;w}oFUcԲϴyi{ )P?*a%rUrvcE1ͥ,syJ(PrAK:RMv-pw=/+EX4E`;aQ#_1>3 jGa##y%,үZ*DL`tTzW:{3ouhHƴ4,J'FOQJ KDF5߲2&wຨAĎh|y'bݥϡ]d}9Q]`4Gze<*X} fb:ͩ>iKB q4^&=ÂhGWdlZAJ`#c m-?qEӝKK K,̒?B}nఈT~oj4Y{f@xU1nb"U>Pb96Ej|q~}枌$JE}ˉ$܎pRHt t5̙gF-ҢO6ć>EZqeGCS/V5_!By}$0d<6wҐCZpAF/a1(ƥ7=x沱yQʴ!XTaM;"]ERNRmvc#Mz?ݧ̞|0\ڛI3#lv&7;**~LuKeP2 Da{nG;f\V ~rEMmjٸ?ДXzS">\+z)b:-O}|ix3 :Y&!WXZBh}$񥝜¾ݰju:};&m LٻK)RV׮yz]qfߤ' }w>Dnx.!3^ ĿL`Di`\4D6d~;2;t +t(>Fu"q`Q=OQƍì*HIKU;(r )XDPs\p 3ZpB˅M] m<(t^c-jcۯΰucXΣ@og>)u؆A1׮/IC*8Ttk2 NN)"꥘ o|4"zEGѣɬ)u7@({.+`y(H WPMՔqpc"1ȩ03=3 ,0=mu*Qndt Dfw_=whxizFNFyyCB"%wgj-S4 G!m2p C%͞_`{sSlwSc)XRzދ4Iڍ`L v7ٞٻ+ݡ2BGAW,RJz8-OpOֺ{з9$5|cmƎ1KRMȯ!:B`?9,{+O7=.oݺ5qٗl-lMC]m!mÒԻHOFN?":Km-#c'hsT#56!{dfQȕQOivv1.%|!(egt=ڑ]~q |=ˡG?ۀkLN7 ޢI@Hַ4K3;HY}^ll&. 9^:LumW lM@[bOK_/#H y2}DQzi6|fyjO{FJ)񗀋|J۷Nd%LiIX5+~&)͠AVLs㐳.Ug'R-N`Ygo;5GEe9=u/=ϝsJtdS`Όtc 9 ɲ.M$_C18\qKD.GvVU9Zx$l> K 4A'xw3T.J?pllw~ Ev._1́Uz(L=fWI^ǁt*n%^ ]húpӻw<ֱx} |X/1Z/gue7jq_s|M+ѩϱE1Iėhd"R(bWv( snwRDS$\IKȽC y.v sM(^>_sdDN ׭$> ]&7;a"[i2z˞ ;,3Kw b"d{ze$U+M9XT` p  LZH3]qmTzYDm&9 J؟SS(0+AD_ʔ@x4{'@rDXf d"h$!}"@W1)P#W~*5EωjIjUl(f  iqC5APN&+@-c4w\z3_B m A! Jc&o17͈3v!ָzO~ƶg`u`sJR8̥3J 7pu9{s>4J8=G>%0l{yn5fWo=gj + 5dWKҼc=Vt~퐔20 kw^ڜtk~c^7xiHsfoMyf3I5⦐W觕>tdC+qFi 4=<r~i_+Fa`r^}%>gytZӴk'ECh9GTE^Ba,:`RI v% jwOFRSeYc—v&3`ś,c '5_ѕQۮ HK*hUsR>bgcw8J} Ֆ(I,f3K(kb^Bxߌd.rfHz4lH0o\>]1'#zgJ,3=T~VY#D -tO- bI0|m|pW]l0I \+D5! #'Rg9MYkbQ{˓h AF^^r-Ѣ1F7LnG) [VguCPe:UxnhkM##T/X= pP.( &LS^֠ZUֳ˯ݷ^7Bf"ax'p'i4C9:;woxjEDN5S(ج[RxU/T$C&@~uq#QQ_?d(CNhT$b x! q>-{zaϼg&<S9&I޴x=>C$֕b7DeYԻa ,2oOQ:.zìzq-3Vϵح-&qgB8RS0v"NϖGP~Ji9H %N.wCoЊk+u״uUU[mFV$ Ks:3D!67cpuDU/-N>7P-%Ϗqa?jݛ7"@o(k1Pv3{sj&kGQ_؝34ꩢm6JCjdD̨h縆mj]˷/;Grg ZA=amC6R)ڰjϛH k,#uًTɹ\^%}en w-Ny{4`yl`UA!c&ԑ.%Jېe >=jlq+)29D;傟 j@'֒rbcά.~tǰM ݮ<@kD" wr@KpMaRnU S`;Rب6stM_ qxnKg#`Ve ޹BP0ʉ"g_K3vg4@Gns)A| Y/ݣκbz{o<=jh'&0Sڸ#&yOuQ=> ;QֹHG/p;=se}!t^SCfA_!c/ryo*鞥PEC SzdaEf_pXh.b'*@9մXYR%O/O.%LfL^MX' WP3i;f!~kW4S!uMؼtCyiѰ3 s۲UKPFҬ ҖNy|"BRא(SˁݑpcA,ѧCjL*C:o^LҰHC6=.GT,kzíRG,5jb]>9Yj`n\kPlZiށ.Ieғ`d>󛎖 RF`LtTmS.@+$*gm;Gnc]|İ^̽< q ZW `qEVȁұ7 >u!}@FJ>%di_9Z\*Qu )M14Ew $Сf>2>kj!<@Aij "/Ə1RlQ?zעlcsz4d;d` )G>piW'Ccct&RWZSA%Y"g/ ]~ AG dzX%r>em !<̗RQYP1 R,!KcJ%5%7IOb̀ §% <#mjL9:\c:mޜ #*e6ja֙#u)6{M7>[S>a֍Tb?(6~.;/2bjV3!{EFOjBj0+#s?,~TP,WAbI?E)~ vH57pbe#)f0N+rhnzikB3| ON]r}/& a$M[m8]MLd6A9йʩzd>ȂՕZ=Gy[SLh,C#VSRx\=T#M?HJigꏞ76kPjХmsf4-[xϟ}9U`@\S:h vOd%|u8RwlgFș.-)qkznce߇Joy$h,䋨;?x? rJ"Hz칩e!,EN5CAXĎ.BNeǂ;;)@;HEғ ?MЂw^xqp[ޞ ,)uA3gb6Hr\\e]4lXflЦ؃2F-ivDmEHM{YnA\p_#t#|ԱO v78ۺ5Lo;JUJSKׇ<-rZ_x/QgWJ:]P {o6aT~πk R1-i!)z9T~.驉OG~mna6846"$%Dwޏ%}5쭝LCtz9M I  4Qy[xq&B تnA}8?AHXQtxX~ܲ ):vLo1ivNW=x!nOkr1~,"AôRhzp@]c)Ʈ27 )9$5WOQ|REEFVgI5YToX|RAa)N%?݄9vOʞ&C!d2tY#G>"R~_@PWz#U%Omʶ3EA~bߍ@C( ) q6B]ݠ}'x p6riF,Nԣ Q1)נPb HMV\hScT=ccccccccccccccccccccccccccccccccccccccccccccccccccccdccccdcccccccccccccccccbcccccddcccccbdccbcccccbccbccccbhYafX^o]]^`ma^\dcace^]K\]h^cabWgWd]Uad^\][cac__`hug_an]`cbf`k^h^Xe_`]ah`WmYaandf^Vc`ei_Xem^ZnceekcgXl^a^befagdebrcNek[Tal_Vm[cTkf_agQeamaZjhaXkeZ^mf]][gtUgldVYhqfY`_fbdccdd_ffbbgcedebcbbb`bbdaca`_cabbcb`hibbcbbcdd`e`ce]efcbedace`aadcb`^ea_^`d_db^`gfbegdb]feaa`bniaeba`efaccbccccccccccccccccdcbcccdcccccdcccccccccccccdcdccccccaecba`acacaabacccebe`gegeabfab^cccbidc`fcdcce`bfbcfcc`uh]da_b^^b_kgebea]bh`na^jeeZbkhc]^febkZfX`bjeg[`jd[^rkcbabcbccdcaddbfbcbccdcdccfdcccbcddbbdcadcacafeecccbcbbcbabddcccdaaccfecdaba_cgbbccacbbcbb`baaeeadcbdbbdgfcckb_gbccccfdbhgbcecbhaf^cda^iccb[^fcbadbccdebb`cbbcbgbdbfcgc^oao]`\]Z~hmda_ha[bd\jf^aZ^dh^_^^`abj_d^bcnj\b`fb]^agbfZabhgcZra]\`\YgZ^f^_``b\`d_]h\mheZa_i]`bf_Zaab`ea_fWdc]bh_bp]_c\e_d_]`b[sb^Yc]gbcj[\b\^]ickba_b`ccWbnc_cccccccccccccccccccccccccccccccccccccccccccccccccccccccebdccccbccccdcbccccccbdbcccccccccdabcdcccccccccccccdca`chcaacabecabadadmcgd^^`efcbaadk`fa__eccb`_`bgfcdeb^h_b^decbbd`abbbdchbcci_cag`cdahaaeabdbd^bqbba_^bbcddefhcccccccccccccccccccccccccccccccccccccdccccccccccccccccccccccccccccccccccdcdcbdcccccccccccccccccccbcdcccccdccccccccccdccdccccccecccbbcdccbcccccccbccccccbcccccccccc[fYabcV]]mcY__hbiY`gcW^bggd^]bjg^c`gZYh`kgsbb]dbuag_hdiecbefbb^bd`ccca`hg`b_`debabaabfdbicfcod`hcdbebfb_`cbbX]kcfha`_^bf`^bh[h]\a_fVfgaYg^\a_ecbd^dZ]ba\ii^X\ed\Zefi_ckccccccbccbccbccc^b`ecbcbcccacccccccdcccccccbcccccg`d_maedacdbb_`ba`e_`ec]hdZg`bfdbead[_g`efbaYjYea\jb_cah]eiaac`cba`cef`ed_e_aoecf`acdb`adcb[bc_cbb__cac\_vgbl[iafhZ^^]e_fpZb^\_]f`ccce]bYdca`adgad]Zv`maab^`^cecaj^Vjhg[^c\[dT_eoe_ca\[rV[fYZ^g_vV\[gabk[c`jcaVdcV[`ll_]ccccccccccccccccccccccccccccccbcccccccccccccccccccccccbaec`cccbcbbbccccbb`cbedgbbcfc`ccedbbd_fcbbecccmcbcccc_`ceacgged[g`b`b``ed`dcb`b`ahadgcbicf^abd]db`ej`cdd`b^hcib__ceWTqZaX^\aiamR`]]^fXeKml`c_h][ho^b[`Xn_e[Vna]aa`j^baebbmecbg`d`gac`eheda_db```igcda^e_`gba_c]`dea_`bcn_bdcca`fa_c_hcdc\]^]ccc^\ablfkf]aedec`_cb}aaa`bdgbb`[qh^bc]afec`_ac`_ca^eZk`gfgg]`b^eddUbi_aad]^b^edcy`ecf`]^d_hddbcbcbcgdae^bda`ncefagbeflbgcecd[`fdaafdabbdc\]_]ca_yfaie_heX_aWbjffgk`d^[gd_bd`ddijggedo`l_babsabub\dbaa`_cm`g`_\`]ayfbbdZ_b_^kb]Z`ffa^Z_gc_[\[]c[baU\^c_bbge`cccbc^hbcdccbac_`g\bbidceebbccadcbgadb^cbcbcebdidbaacccceaaecbcbcbbcbe`cbbfbcbcccbccfbdaidcccbcccicccdc\`d`aa^a^a^}^_rd]Yh\kUeU^\qjW^]ak[daX_fcdapRU_g_bp[bn``ba`]a`bi_aca`igbaa]fgchbq]ha``a^j_c]gc_e`bg``^laib`c^``c_dd]_eX]aY\cYWgbfcY_bdp_bjWi^`ge_c_acqhcRfa]ea[lXcWYihbeeh_^jc`ee\cek\f\\ge_ce`he_\gYci^bdffW]^f^l`coc^afcbieilb[a\ddh]mi[bj[bcbed`ao`egbb]cbe^dgbd\paifgoe`ecdf^`febcccff_`b^^eccZv`ec`bda_bde\`dbZ_gba_g_bfabcv`_\lcabbadccac`_ccdacdfcabef`cacdb_ccccgcccccfcebccadgececb^gb]caaef]dcdccbcm_daef^bdc`b_b`bjbdcdcbcbdddeaecgbbfcm_[c]qgdahbbcU__`ic\`fca_dgeffeddgjXY_b[hc[mW][\f]`cpbd`b`bbcafcebccgc`mdf`deeadcdccbhd`acbb_fcb`aedbe_ddabvfY:V_`aeeYf]\]\_\e_\f^`hXcbaU^_X_vlr|pW`Z`ZW\[cfVhZ_bb]_`\aabb`a`aa`^n]_g`bb\aYabbX]b_^_db}_^Zaa`^`_aa__[baa`cbbcbff_ccccacecbcacfdcdebcfbadccdbcacdccbbdbdccddcLk`HaiYbfkaQeoSZ[[Y^kVCfi^^p\Ym^^LZdb_]X\ZZ^TU[g\Mbe[_bjaZdbbbeibcbbbbccdbapaaaabbabba`facab`debbafedcce`cacccccccccccccccccccccccccccccccccccccccccccccccccccccchTfgZX[\U_l\jP[\UZVRWjXZYYZcb[b_STQXVxSef]YUdZ]_Wd[WR`eZ`bdcc\ck]^b]ak^^Z_c`^_s^`e_]goYakaicd`fg^yc_fc__\Z_ccccccccbccccccccccccbccecccecbcbcfccccccccccbcbcccccbacgb]bbcdcbccbcdbdcbdbbdcbccbb`cbbb`ccebfqecaccdcccbbdc^ic\h[_bdhhnbac^]b`ejkcech`nc]a]d_\i_c_deb\c^bcb_gabclVXSIdWdUOl[\Y[Wi`MWdsURYK,W~``eb_cSLh`hcLW^[teaQ^^aec`cbbcccdfbdccdbcccbc`cdbcccecdbbcbbebbccbccdcc`ceebcd`Qa__SabXV][e@Sf[\[UaZ]`_bY_eKF\[Xnu`VXq^fy`aYYVZ\^U\becedd\fgcedhZa_ababecccebe_d`edccdedgdceaddbedg`e`adgb]Rwb_XcdgZR^a[smYmX`fcacfWi]hamfgUKdYacJVcp\LXaa]ma_]\]^]]\a[^[`^_^b]]]\d_[_g``Zj]\c]_]cg`bf^^\_h__]^\aY`^b^h_Zbc]]cgj]hfjcjk^ZfacW`hZcUanqb`b^f^XgdgccZ^iebacdbc_d^ej^ige_^_d`cgkcibbf\c`h^ifUdXk_i__a]el]hbcbae\e^abjfhfb^fYacd[ceif_ckc]ad`efi`agea_febhaheebUeddea[`dlajYc`igadhbf]d``ff\al_cbceiu`d]\[XTbcpZ]_Z_Wgo]_cgg`YScbdcacccccdccccccccccbccdcccdccccccccccccccdccccccccccccccccccccccccccccccbccccccdccccccccccccccccccccccccccffd]fe_af^agYzfe]fd_d_^cb_ed_^c\Xb\bg`__bl]ggfc^g`gc^lal`m^`[\`ih^fX_`cd`fdpboch_ba_dZeg^\a]^fZaqg_f`^ce_aalb`fee`eb\cdac`adbfde`b`a`b`^d`^_`bece]fd_eg`caac_`[cb_eW]Q[aR^l[iokfTg[Xf[fUTfV^\jf`[g__a_iZdjans]ejXh_hZY\Vdabcbcbbfcfcccbddadcf`bjbbccdcfcbcbed_cccaccbbcbcbcdab^^jc_da`g^hdd]bfb^cc^```gdbha_`d^gebccbgchca^efeb`\hbe`_g``bbbabggcbbaec`bbda`cead\bbieeea``_gcbbbbababa_be`ajf`[f\`[acjb[\[bb]ibWgbccgai_`hecffXs_[dg][`f_c_]eaaZciccbbccdc`ccdcccccccbccbcccccbccccaccecccccaccccccccgbaabbdbbifefbaebbfhacdb``adabbabbdbc_gfbccb`ffacbigc``cbeaabbc`cbeebb_cbbbdiachacbbhabfc`^cbbcc_ee`daecalacejcdbe_[kab_cc_cdb`hicgb[\beogfkj_^c[Yb`l]`t`_d_aa`ia_cZVdp_ZZ^NjddT[]U[U?Zh`m`\YKcdU`YbjsuadbUT`fVPmWZ\\kbhXb`cba^ad`kiYbf`b`bi_f`]q^]_jYfee]b]av]_b`^_``b`^bna_`_ccccccccbccccccdcccccccccdccdccccccccccccccccccccccccc^d^acbcca^idcbdecbg`gecceiaabb_b]abbc^`_i`c`cbubbeccah\]a`bbd_^bge\bded^jje^``bgi]Z^]dddfoVl\YeVghei^eda_gcwbdcc`bbc`b`cccbdfcccbgfcdbebdbcedbccdbfadabeabccc_aadcfa_ahdbcccc`badda`afcbfccdabdc`g]`gbbabccbgcaabbccdcgfccccccccccccccccccccceccccccccccccccccccccccccccccccbcbc_dabcced\h_ccccbebcbghb_ba`decbbf_cb_cgbcebbbbcafakbceabdcccbccbcccccbccdacbdcdddcbceceadebccccdbbccccbccc\Y[_Wh`_m|`tc_]c^bc[u]R^\a]a``jdbb_cgXm]hg[]^`lce\f^X[e\`g`__fcZedfV^cm[i[^iec`[ggh]RYceidkkdbUcX`dq[cWd\i^[`dbeadab^agcac`aae`cegecgdg_``_`bedbd`af_abb]f_]ab`__dd`d`fjnZ\jhQjfL_c\p^bptZidug`]Uoh`T\WgdebamkbdY^k[P^n\cdbcdccddcbccccccccccbdbcfcccccbccdbccdbcccccccaccbcdcW^^T[ccSf^g\vZVlBQ}IoAVoPeIanU=O\_WRXfGJ_pcf[P\^vX`ZZ\e_\X_\X\sk]pZ]bdqjd[`Yadq\Y^X`Yf_\``dl[d\aadaab`ccdcebbcbbbbfd]cbaccfcdfba`bafgcacbeh`dh_decd_gbabedbbcoedbbcabcbad`dm_dafcbadaabceebdacbbb`addcddaa^`cafad`bedcacbbbcb`ded^bebccced`_cdaebbddde`cccdbfbcdcb\jbe][`_^]ieke_WbXilXWfgi^cg\d^\hhc`^_^gd__[dVYge\dacb`bcfcfccbdad^ebabbddbbbd`heccd^bgcdcdcfcdc__dcd_afdccp_hegelc^]i^]ZVck\ba]X^_XdRg[Xkedide`acacWXUdfj[]R_]lUkda[b_bRX`g\[capeV[_Xk[cpkZadfqb_]S^_rcdeb]^gS\al`_^acnUee_`nai`efaQ`Yi_baff^l]p\bkVbwb`dgfh]`lebfRh_iVedf]a`bdcdcacadl`eoccgbcbdab`^bcccbabfba[c`dabbbcYbaccabc`^fZUqm^bgi[b^`^d_bY]lhdf`\bW^^`i^_]^cifdY]eYck]_dgbca`ceafab`bdcaggbbb^bga]afbcce`d_fd__e``c^c`_af_eefe``ffecbgejcecdcdbcccacfabbcbaaacc`bac_bb_`bccbbbcchbbcbhbccfabcfbbcbbecccccbcef`bgecbcbbcdb_bbeaaaffcb`cecccfcbdbfeh]lamb`\^`b]cbe]ng^bbcccfWeVbec^eadd`bcg__Uf[e_a^^_]]_bdcdbc`bYeajbbcd`dacbcieifca\``gc`eabe_aae`f`bbaafbd^dfcd_dbbdjaa__`kd]]\edej[]`^[h^bdchea_hba^ec`_^cbmb^\nachapKRMbd\ZsOTX`]EWlaTVjBvMmcedohaibcWcXOA`hJ`RNg[fWWfa[cacbacbeebcacbdbcaacbceb`_b]kad`fb`bbbeebcfcc`^ace_caba^bbdg`h`__c_^]dibeZ`^_^d_]`d^hd`w_ffb`c^_cbc_Yb]ccccccccccccccccccccdcccccccccccccccdccccccccccccdccachg_`cbbcec`ee`dbbedcd[aeead`fa`_eab`efbacbchbfe`cdbdd`bccdacbccbefbbb`b`fcccdbcaebdbcbbbd_abdebbdk_dddbacbdbccccccccccccccccccccccccccccccccccccccccccccccccccccccdbbcb`ccdc`edcccdbcdbcc_cbcfbbcbbbcddebbdcbcbcccddddfdU\c[`Zi]V[cad\ng[oO_[^XXea\ZosPeUZ^~T\b`g|wcZabdcXjhbVcdd`fcac]aaafb`bgd``bgbbbc`d`dac_gadec^b`gdfcfadbcjcbg^b_cfhccabfbbbbabccd__adbkcfbaba`bahie_aaeagabecccbbcabfec`cccbde`bccccddcaibdccdcdbfcdcdbabcacbcebbcbcacbcbfc_cah_ache`eead^af^^fdc_fdabe^`a[bjaeac`bcb_fc`aaeef`bbbcc_ccgc`dccbbccdabfbabaceecdbcbcdecccbbcbbbcccccbdhi\f\c\Wdblk_d[pnff[[`]Vf^kf[b[\f^\^^`tk^e_diYm[fMbfd^\cccccccccccccccccccccdcdccccecbcbcccccccccccccccccccccccccccbcccccccccfcccccccccacccccccccccccccccceccccccccda^e`i^`_ebbnaZX_dfabjceb^`^l`^f`ig]d`cb__\fcjfcccbja]l[cd^e`bc_jg`a`_\bah[a]`gsbc\^dnj[^X^^`VnWada[aeb`\^_b_`_ciagcfdcdacbdbc_cccg^c_hddajafbbbbb`aacbecbabccfc^gd`dca``d`d]_`^[]cbfhY_mad_c^g]Zmh^`[lnh_bUbibbb\afc`ilbdbfdcbccecbcfcdbdja^bbccafcbeabac__haadbbbb_lceebea`d]_h^ag`bcbc^c`oieed_edaad\c``ba`a[b^bifd^a`d_eaeaedoc_o:WQpWN_tmWVjh[hU`eIhVLaG[[Xgd{W\Obej]\_ZftWeQpcUc`Jddzcd^_bccdgi``a_i```^a`ac`a`fh\`gj`a`cece___[\`^c`e`^`ccccccccccccbcdcccccccccccccccbccccccccccccccccdcdccccd`bdgfR\faafZ``b\`[cb]l_ah_d]\]^TYXcjglclkciak_]UgqhjYcbcgccccdcbccccbccccc`cecebcbb_bccccdcabcccchfcacccdbacbbcbcccccclccccccbccdcbcccceccccccbdcbcbbdccbbccbcbbccfb`bbebacbacbebbd`bcb`bfffddo`_fd`cbac^_fbeead_bafcdb^]kedtaa`h^dab_]i_e\Yh_]`r]dY^fke`Yk^^i_bdchg`ab`]\d`ccaacdccceefbccdccbdcccc`dcccbcccacabbbcbcbeccccbceecccfc`a^Y]`da^jh^\]d[ickZce`daf]b_nbekigabbc`]bYu\aageb[UehXaa`cbdfecnbe_]b`d[ac]g_fac[fagecZfaeibc``f\c`ribdaiaafdfdbcbb^_cbb`acccdfgeeaeb_agcbddddbebcabbbdceccbd`^adacfdcbcddccccccccccdccddccbcbcbbcebcdbccccbbcbcbfccc_W`jfiZ^fecfb_fa]eeeaZc`hbZiebdicpf[ebgiji`ecNhi^nb_bib]_bffbfb_`dgbgdcagcb`dgccgacbbbacbacc`bdecdbce_dfdeg_e\g_gfo\YUk\aPa]ec_biYd^^e_u]e\[kdj^QXgXr\[_]bdjSVo_dc_`]ab_[ddXe`bZ^cZ`cdd`gda`cb`UeYfe`ccbbT_^a`a_bd]e[edb\Yh`dZkkj\ha]`bd`Vfe^X_caZZcke_hbf`akdce[bXd]o^f^ceXRb]`_gTcfZPKbbfHgUNfacm_gk^^_^daf^a^bficb^[_hiS`]]SaUZnYYZeY]j`]`bb\W[]`bb^TVj_[bSdkheeb\cb^d^iZ]ZfcYr`U^a\]a[fad]][cad`e^_eih^c]^de_f`[h]s`hedcba`cfZgbb[`n`^ddfgbcccccccbc`bccccddccbdccfbcdcc`cicccbcbccbcccdcbbccafcbYa`kfcb^rd`d]da_b_calaaacf^`d]d_b_e`_di^ai`i`agbhc[deccccccccccbccccccccccdcccccccccccccccccccccccccccccccc_`bfc_kdfk_a_aedadakf\ei[`\b^_Z^aeccd[h^Z_gcdgcrfd``_eba`bjhbacccbdfbdefbc`cb]`afcfd_``d`agdbcgd`gdbgacegc[djhh[d`ed[b_]b]d`d]n\Zam\`eif\[bced``_iebrbdXbeacb_ccfm^g\`pcgb`e[bg`bec`a``nfadc``^fkaahadca`ejba^j]c`c]a_eab`bZ`dbaddh^c_d_cd`_\m\e_^_fg^p^gal`k^_^ic\befd\fddhbYba^bhbbcbbdbbbabccdadececabdcabhc]`dabcba`c`efbcbbhbec_cbbe`ac_c`f_bbbad_hc_feoch_dbZffaj`aaackbeabadbdcb_db`]fdf^Zebil^[`\^deV^aggaf`dhbfdadedccaagd_^_ihec`Zbfaa_aXd]g`kMYdf]inTnh\n`W``^^S\h`eZ^]`cde]bbc^^^`gP[ZjjVbbed_abcdd_dgbdccdcbeccb`ccehbdc_baccabdcccdabcgcdgabeb^b^`bkbdk_dhZege^]Yjj[cihVfecekcc[iifbe`eaag^`cccg^fpLe\cc]^]f^ScdtZ^\ad``a]i_VZkad]Wd]ZTWi~\xXXdU]baa[YacdNiZev]V\e_ZiPvg^]r`ea\baWNoajY_hVge]c^iXmVrT\Qa]bka^k`cgaflac]gcb`^V[r\edcnl^fhhcgeec[hjh`Xifccchfgehb\\ciZcbcccdcccccdccbccccccbbcgc`eccecccccccbbdbcccbcdccgcdbbdbebcccfe]abccccacccfb`acfcgc_bbbdcdcaafdcdcaebcfdb`db`dbfcbchd_`bcdccadbc`caccccccdca`dbcecccdccbdcbdfecfbebccccccbcccbcccccccbbcdccccccbccciccccccbcccccccccccctb`hhhic__ceg^ciefi`i_WanfZimdeeZg]ja_ZdhYeahUY`b[l[c_aceb`ccnce^ebbeccdccabcbcabcac_cbbbcaeddcebcacdbededdcb`bbcgccdcdacccbcbbb^acaecbdecbcbbbebbgdcabdibd`ccccedWJSUXZg`mLST_v[PZFXJcX_OkhSUYXVU[PXdNQNUkVz[aO]dQWMZe\eieTU\cYaea\^d_j[W_f`[_fd]\Yc^jfhe`_^abugj]ip]Oijs[`e\bjac`h^]fag\Xcci_gXl`^d^cdb[aedebdbdg^d[]daeYlf`ije[fjedd_jbbcdolfbje`_ahd_fccdgedcdeddgeghbf_^a`eidZcbcj\]`b_bafXigfcbhfde_fhfhbdabccdlebcx`dddd^bekdcfkd`hceha`_Wbh`efdddchbf`cahbZaddbc\`fdebdcadh_fca^fhbif_beabh_c`bfcccbabedccbddcfaeabcbbdcbbccddaaebcceecdb`adcgcbfacbccccccccbcdccccccccccdccccbcccccccdccccccccccccccccc\r^\Scl]mU]_Xbj[ZasZcriedbaajiVYXfbiXdUgUU__]g]^_jfeydmb\d`aeabddcaabebe``b^a`a]aa`e`cf^eaad`bakaeghbbcbfffbc^dd`dbceffccddbbcc`facfbbbb`bab_kcbc_adeacebabeccf`^ba\edd_ac`cbdbcbcakbebbbdcgb`^ga`dca_dbfjgaachbcacbcbbd`cia`cccbcbaecbcccc`idcacccccb[cblb`bfbcbcdccdc_ccbdcceg_iO^hcail^]RUc`\Wa^vY^`TT[dcieW_Zddgfs{`PPUTXgeYe\dfi]ebW[^b[fdada`^d]_]ea^Wa^s|`bf`e^aj_bdpfbab]^o_b]]b`Udaf\`jZa`fm[`ee\_hb^^b_`b_\bWYa]fYdg]`cWbj^gacXa_[]dfdcccccccccccccccccccccdcdccccccbccccccccccdcccccccccccb`Yd]_he`YWc`hduffgWY`cagfbewk]d_ggjg^[i`ak[[]aiab]lXg`cbcb[bbcecgbadcbbbbbc`bdbbcddag`bb_cea_habb^heg`dgb_daccccccccccccdccccccccccccccccccccccccccccccccccccccccco_e^\[]aebal]_[am\`dg]dedd[bb_eb[d]f\oh_hX[^dc`faal`_Zai^dab^acam_j`aec_bdbeaj\Z`d``_g^__aedg_^[a_gYb\beb^ea``ebdbccfddfccfbcbdcd_cadafeabba`bbcbaccddccd`bacfgcgcccccccccccccccccccccccccccccdccccccccdccccccccccccccccgfh_idab_bc]cbb_`b]b`fZ[cgacc`cbaa_fx[dai_^dfZaaca_bchbgacdbbcbbadbccbccccb`ce`fcdabc`bfedbc`bcbbcbfcfccccfbcccccccccccccccccccccdcdccccccccccccccccccccbcccccccccg_[meZf\ig^^dYekhiibi_gjkdjgfe`cfl\cd[`_Y]og]^gfdbgR`ecccakaac`e__dbacbceba]c_j_abfcabbgae``addfaba`bdegaih`b^cd`chcabhhbdebbb`d`dcbec`dfdbbcccebbb^bgab^ee`ehbdbhXi_bfWW_a_k\d[YV][Zb^R^X\g[[]S{bV_^[Pi]a_X[WU]U_\^Z`Sof`ah[beW]o\^a\]_]aYa^`ZiY`e`Xhad[Zc]r`^__^blY]bb^_[`cccccbccedcacfcccbdccdccccbbdccdccac`bcagcbccbcebccbccc``fdjPV[cdV7SaV^V[hdTIg]Ta[fQ[Qmauj^id[_~_OVec`fjTVUy[j]ca`^t`bgcoUccm[flp[md`chY_gf_````gbZacqjc[Z]^gkg`Xcxr]b\fW^]?iKW~PSmbev[gMM0irkSl]J\a`ZdP`ccLWlebNCTkhps`[Zi]ebi`X^]^a__WZcYT^d[a`Z_jd[bgfksie_V]^a\Sbb]\dfg^bccccccccccccccccccccgcecccccc`ccccacccccccccccdcccccc```bcdbbbdabbabbc^aai[febebab_b^f`_a^aacbcaa^ddb_ead`Xf`]a`bYhrg\c```Vbb^ie`e`gT\c]ek\f_gjbf`f^csV]\k`vg]j^kdehacda[gagh`_dba]`j`]bcccifdjc^d_djaifb\`mcdfk`f_jiccbbbdbc_bddbbbbbadcbcdfecbccbcbcbcccddbcbcbbbcdaebebggffka\bfaaaff]\bWc`bgid]gf]d[i]i\Y`c]\dhg]^ebdaa_dhfebOLWXZNNV}_\tPgjbK[pAka>mHOfo]Jg?bZbkVJQXIbn^RIqM`kOZXre]a^jXmf_h`g^j[cff`bhgWheaiZUgYaXfe\cgcgcgSj\ZfcWXdhd`a[bdbc`bd_fbabcaabbc`cad]bb_yfogb__e``db_b`jjc`bbl```dhaafg]`a^eU_`cebb_eaibjeYZZ^_nc`Xc`_h\d[e^Zijgijd^f^b``i]dadb]m_Yh^hi[Yfb^dmZbYZbo__b[`fig]e]dcY_cc\f][d^Ya^^f`ab`a`fd`__dfe]e_f`aadfgYad_d_`\bca`gcbcf[gahcfl^`ifUekeebk\U\h]X_^^a[Xebccad^`\\k^aZaaUb[`c^y]psbWaacpgb``efcccedahdccblcbbccd]dcbdcc`a``aafc]fecba`bccdifcbbbaaacbebcebfbbecbbhmc]f`caabccbbab`_bacaeecf`cdbdgfadeccbbccccccdcccccccdbcdbccbcccceccccdccdccccdcbcccdcccc_UanZg\lgcd_^fladdbed[_ZZ`g[m^ia^g_hhbbggdaccd]k`b`hc]meia`baddpcebbcbcb`a^aa`b_ec_a_g[d_bcb`afaa^`ca^cadaddodVIYgcR^k`riPS\OXHdohZhZzWeeR_L`Tj]bNcbnalX`beYZ_Q_UaX^^bc`dh_ddabjaabcie[aifnbb]bc^g_dct^`f]`\fcfkbc\c`^^^adecf_ce`bce[dfa^ebcccbe`adcdgccfchcgdbcc`frfdceaaa`ab]f_abbcfbcfbddbb`ceadibabab^`Tlag]efcebbbh]bcbdaca_`_aacdcccdf_fcadccfce_bceabc`fe`ccdbccdca_hcdbddbceecbfcccccccccbbcccccccfdcccccccccccdccbcccccccbcccccccccccZU[UUSW\O]`F[XAIOK[UqZJ\=V^]aIGZnWcXNGUYXNS\TdXUa\jYbFvNWPJe]UfgNHdJbccccccccccbbccccdccccjccc`dcccccacdceccbbccccbfbcccccbd^bdidfaabihejlfe]S_cca^dscgZchae``cacdWkdhZ]acaactbj^b_ae`b_afbghbmec_`abdafeabhb``bgabe`ee^bahae^gb`cbfjdabcacbabddcbbecagdedgcebeddbdcb`bdbbacba`baccccbccabbcbccccccccccccccccccccceccccccccccccccccccccccccccccccccb^ggg\a]d^ecb\a`fa`i^k]`dec\bfed\c__d__`]b__k`^f`]i_ac\iZ]_][c\l_`^bfa^ndZcc\__p]a__]mie][d\n]_UgZ]Ya`^`]\]bcbg_cbcgd`fcbdbbbabb_cdg`bbbb^hbcdaeccbb`cdebdgccgd_bekdUb[]Zh[_fXve`a^d^\dea\\a[fdjaaebjfigaaZhcpZ[hf\h]aebbdddecc_adfcccbdabba_dccbcjcfib^cbi`abbbjbba_eaddbccbhdfcea_bdd``babcica__`deaca^Z^fa`Zdchko_dZ]aba][`eh_hgc^ebfeccdcadddfdebdbdhccc`gb`b`abdcadeb_dgbc^cc`cccfdaccccccccecdcdcccccccbccbccccdccccccccccccccbcccccccccbccccccccccccccccccccccccccccdcccccddccccccdccccbccccbcccccccccccdccccccccccbcccccccccccccccccccccccccccccccc\dd`gcbbk``eaecafcabj`a^``aefbbd^`b`a^khafb`j^f`bbabg_eU]f^e^c]bdi`gdjShcc^idfai\aX`fVf]ab]hibShddggg`blX`fecbbcccccfcbddcccccbfbfbcdbdcd`fb`deacabbccccc`cdbcccb_e_he_acb`ed]^_da\^ababbfbbaa^eagc]ocfaaabda^ec_`ckgdgbecccccccbccbdcccbccccddcccccccdcccdccccccccccccccbcddcccccccccccdcccccccccbccdccccccbbcccccccbdccccddeccccdaccbccccccccdccdbcdccbbdfbbbcdcacbcc`dcccbdcbbdcbcddecdccccccccccccccccccccccccccccccccccccccccccccccccccccccT`aa_hqceWceehcchiavhd_fc`ecfil`Zedfd\efcZ\^cXbpd\]YXecadcbcbcce_eccdccbcabbd`dbbbfbhbdccbdacccccccccbcffccdced`c]Xih`fd^_^ed_j_kg``^jfae^bd`Ycef\cf_^bb`b[ccgb`be]pc\]aYaY[pf`\Z^`[VgWecd]g[afX`ab\Yb]nk__VYi]^aZ]_\Wo_am^d_bacb]aebbbbbav_aca\af^da`da_`fdndkae`a^b]aece^accVkcba]\af^c^fabjWbcXeag\faU^dim\[^gY\f\^`xahdk]`ae[od^baec_cbccd\bcceebbcbcicbdgbccc^bcbcbbcegcecdbbcbdeceadh`^\W\^`bbkf`b`c[Y\Zb^`[_fd^\_m^`hajfqj`^ZjYj_\_aU\b_ihdgffKR]ddW]gQci\iY\]OfjLittq8I4N^R^_\\fpesmIPdSN`ns^Hccccbcccccccccccccccccccdbccccdccbccccdccccccdccccdccc[j_a`mbbY^haX]fYXVgnflu`c`eZ`gg_Xke^U]`]eXRsiVWbob`iccdcccccccccaccccccccccbcddcccccecccccdccccbcccccbccbcddl^]a_dbbfaUbh`c_a\cgih_er^d_^Zg`dnaa_\f[[ae`agk_ed`^b`a`f[`a`fgaffapebW]e`_`liaeeceb`]]Wgf_f_hcrf`fka__Vh_hscc_zWYT_\ccX][yc^c}YW]U_|l_fZehThiSPiRi]BQR[_LZdb\on]^Tb[gOR_T[]kfUahc^aefZk\`gdXXhjdcfccc\mefTh]bic_Y[o^ZSha`ad`baa_dbhece`b`b]_aa_c`agjb_ih]ba]]cd``Xdacdce^adcccbccccbccccccccdcccccceccccccbdcccccccccccccdcccccccbbadeb`bkcYeedffaddcf_dccbdc^_ej`did`[`ecfbbf`bfegfe_c\ffccd_XgkbZZ`f_XcWcdfdcdiekcik[khY^n\gdbdY[h^i]d_[aX^ccccccccbcccdccdccdccccadcccccccbcccdbcdbccbccddceccccec^jdbbbdc_]mi]hYbc^bbaafe[]gb]`c`c^^heeolg``igcfg_bZeccbccccccccccccccccccdccccccccccdcccccccccccccccccccccbb`cfbbcee`ddcbedccccece_ccfaabbcbbcddbdcfcccbcdddcdbc\ngcbaec\`bce`de^dc`cf^dee]eeeh_dd`fe`ad_d_fbgb]c]bfbdka`b```cgc^cebdfbddbce`h`cbcddacecccdcabadch^debbecbadccccccccccccccccccccccccccccccccccccccccccccccccccccccc^cbda]^d_ge`^b`b[dd`aa\gg_]badb]fa_``gdadacU`f]ecZ`f\babbcbccbcdcdcbcccbcccbefebeec_bcbbbebbaaabbbbcbcc`bdd`ccdeabd_abccbdcafcebcea`add_agbacfdcccbddbfcadddgddg``a`cca`a`cfe__gaa^\\_jaecddkl^b^df^a_f`abd_e\ef]mkf[_feb^dbdqf\mgX``a_hdheR_`]^`m_dgkWVk^a_Y\_cX_dedXh`\wocef^d]fcWb^_d`e\abcfbkg`ac_cabdccabffddaeibcff^aac[cgdh^Qb`Xce`cjsf\]h\\M]b][gNhacdq_hd_h`]fk_\X]gXU]\Ydkfa^fibbbbacccccfbccccddcbc`cddadcbbfcebcc_bbcbdceacbdccebdb^h`ag^ddhe^fecah`afih]edc^]a`babfefc`dc_^bca[fc_`[`eegjRs_?UhX_TjUTVO]W\Y_VJDjOOTVW[iSthhi]^]VIYVQWBaHph^u\bZd_kf^`\^aZYgaac]f]Zd\^]`eZ\gY`bZ\t^]\_UcZ_]m\yb`bgfZ^\f`rgdc_\`[ZkdcfZcfb[\a_iggacgho^`_^Zcbiaej`bZ`}Ydc[XfXX]es[aXj`Ym^_p\mZbqkab[W]OZ[chn\X[Xb]\]gXXlPfh[iZei`fb`_JQZ^XcYcsRRab_^fpahbifo_de_]bg_\SdW[hT^\`XY]XgbRaci`cdahcac]cabcdedbcbcccc_ac_`bbbdd`ea`dhccidjcbcdcbddeblc\eacaccdbcbcdcaj[fc]cgbcacda`dccac`^jbbcaecdcccfdc^bcdabccdc^ccccbebfbb_f`cccbkbbcbcadedebbcce_cefdedccd\Tb]`XhdjW]et^^abbbMiUf]^diq`[^c`Tcdgaqjbae_^[ff_f[f]Ob`^bfa`cbaaabccbddcac_aentabagaebbbf`ccbabdc^eakded`dc`bccbccccg\bc_cdcbbcbcgdbcec`d`cbccbfcaaciccecdccbeddbcbbcgccceebaccdbcbccdbccbdccbc`cacbceccecccccccbcddccecddX[_g`\_a]]\bd^f`bcdcagfbcdng`f`a^]a^_bbccaflfb_]\ceXEb`j0dSU^Vv^M]jcu]?hPigRlx]h<]`cSqd\DkxyYyxSE\WI_Le\N`_d\dd[ugfdaf\nfNbebha[faXoj_iea_he`egfefe[]\Wk]`hg]bnbcccdcccccecccccccccccccccccbccccccccddccbccccccccccccbacccccd`bbbccbbcaddcdb^bcdccbecbecccbedbfccabcbblbbcfc`baaabc`difabdcbdacblcafadcdbe`cbaaeccc`]cdbbbhecfab[ccccccccccccccccccccccccccccccccccccccccccccccccccccccedcfccbaeebfdccbdbbcdcbdcbdcbcbcbbbbbfgaaccbbaccddgbccZg\Yadlegek]ad[^Xn]^\fnghgb^^_dccec]`jaoaY^^Ug__b_dk`ib_\j^e^ec]ce^`]_cac`g[be\ba^^^^egbcgidg``k`_rd`c`b]_`aadecb\`fnf^`a`hjbhga^^bblbgcda`cfbaabaa\aceecdd_cbeb`__^abbdbccedcd\haf_`adbbbadbce\ye`bde_egcfkca_gb`^g`bda\Y\jo_ac^ehei`_c\`]\_l`gcccchWj`\_bced^_`V`[V_\iad`si\gi\ccc[b^aZaaa[a`e_l_~bX]de`c_b_j]\`macc[i^^f[[\_]m_[Zcdaafabbl][e\^^WRac[ebhfe\ji`W]`adlg]acgQngYl^ca_fc\fdbYwtp^[a^e[_p][ca]YmdQJ^a[_^RQYYfYWc[aY[hVRV^ZubaXKibcbcbcdcccdcabbcccccbccdbebbbccchcbcbcdbbbacccbbedcccdcgccccccccccbccccccccccccdccccccdccccdcccccccccbcccccfcc\`hZnged\ZdTo[epwbg`[e\kZd[cQba[cW\h\Wh]cgO^lUla`W`_X^\Vebf_\be\dkg]mea^Xgedfed]bd\bn_b^[bh\ad_Zmoe[_^`h_dXhddc_f`aXbed_egW_]_qf[l_a]^`jc[]dgicbcc^g]hZc``a^i_ien_^[dhbcbgjpi_^ak^`f]^__c^ihcebd[jddaddnd_[\b^^f_abeZg^ccbcccdccddccbccccccbacccdbcdccecbef`afbbcfdcbcebcbaccad\[huaab\]c^caa]a`jdqaf]`cgac`Xbaacac]^dr]i^^eacai``[eo\\b]a^a^`kYaaaa^]W`\Za]``bb\bcdkY_]c\^f]]U^]^a^_bfrbbdbgccc`cccecdbbdccibafbedcgc^b\ddcbbabcfcbbbcbcbcbd`cd]fd`r_^Xg\]_e^Y`l_aag`db_aeWe^cies_ekbcc_eTjgfb_^]]`c`ccafab_cXabldbcfgff^a[cdca_a]cdhechc`_dbafm`cafecbiiZbb]cZos`aZg\jbd\gaabdh__e[e]n[adeahi\^]gZ\]h[_^]cd]_bac`cegabbgdmabddadega^^^`cc^dabfce]deabbf_a`deiigec`cg[daabaYbdcdch[dadebccd^bbchdfbfbc^dddjghcbfab`hdacbg`fbdjeebadccadacaf^c``acebd[hbfidbaad_a_a^ebed_cdfddc_cjd^^`^]cbi_c]^`keljf\c_b]^^f_djbajabYfd^`\a^W^^r`b__gX\ebebbpdbbia`_g_`ef_bmbbhl`a`igieafccdfbldcecdieh`bajlfav]e[fahkkV][XhcW\aekmc\]^Xb~XeWhQ\_]hk[``[_d``_\gXb]mZabbhXbfbZe_bd^ab_id^bbeag_e_\__ebahaa]tYhcdehaaclc^_Xk__gacbf\Xa]^V[g_ahZ_fc_db_d^gd^Xn_daWgf^dn`aggfc\oiucbcdccccgcdcdccccccdcbcdceccbbacccdcccccbbccbccccccccc[YbcfbhcZj^Vid_ha]_WYYgbdfa]\ur`ebacbf\b[l]ga^d`Ub_m^icedd_abj^cad[ef^c^h[\`aZcigbdcck`]`_edZae``jaebdb_fedccbccbccacdddcccccbcbbddddbcdcdcdcbcacbecbcccecddcccdcabehab[ffcedd``_af[cdcccdgdbccda]fddcccdeec^ic`d`d_ace_fk``g`bfacb```d_k_c`ca]ebd`f_d\^_dhfd_^lfbea_dab`nd]jcn]bh`bfa`hgaa^c`ccaafbebabcg_kd`ec`g_caeZb`_dccbgbacWYpYV^Um^[ZgEREN^RGvpa7QSiFahsahgpi[`cm]yaQsiOIf]QPYYpjR_a]ogazZbfaZUe_a]a^]cja_]ff`dZS^Smde]cildrZ`^]RgpXX`bbbbaaddfbedea`]ddadfgbdabfede^cbecbb_dc`b`e\f]f]eb_cgdga]dfhcb^_c`Yeba`bae_jia]_cg`We`\f`g`cXe\^g]k_f`f_\fghabcibacabcddbbbcbabbcccb`dcd`cbcdccebe`lbcbdca`bebdcdeob]ddfg[aeb`Wbd`fefbbeb\cv_`ba_aebd^cd]c`iafjVf^^h^k[^aaaceacccdbhdZgc_[`^ggfdfabae`m]bbe^_^^ailjchabcebbh`ae_kacak^`_VdaU]X]Z]bYXcc\b\iYZf^l_]be^Qb\Y]^]cf]]\g_cb`\aZXcYccac^][b]cccccY[\]bca_c^cca_c`cccc[c`cc]cbWccj]`Y\gQ]XqbR_Z^X]gWhdb\eWa^aha_b\agbdogpXg^XpWZc_`fcT`e{fP_c_`e]bPc`]Zfa_Zbe\]\eTeieaabgdacYf^]XYfUam__[f`_cbbcdcccbcbbdcccccbccdccbcecdcdcbccaccccccdbccddcccccc]Vf*ho\YrH{9oSlJaplgZ^DSj`Zma?]'m`DHGkCjZo:Tm;bLOVlbhbd^_gbce\fccdb^bd`ehecgae_fbfcbbhae``cabcnb]fcbab_ed[`bbfa_caa`bihebe`beb^bYaidbeaabhdca^cabhabhfg`cbddce`baeaaabcadjcdchcfgcbcbc]bdcacc`cbbbceccceccdcccbcccbbcbbafceae_daadf`]^eih_^bgccfe`aahdZ_^bac`ced^ceo\bg]cdf`cm\h^\eYabb_j`c`f\`f]bh_\^gk\eck_cg`a`g]^be_hpfade_d^]b`]jbgcY`eedkackbbd]bgdaai\c[dMk_k]d_h^jfafbf^cb_g`ZgcYc_Tcib\b^f^_ku`a^]]\Yl\djbU`^`ebZef]fk`\^[gjH^ed`cca^`abec`[`d\dddeee]_bcb`dddbdcb[_ddccddcbcdbdddaac_deda\bdbghbadcdc`abddcdf^b`_`\_ec^`dfbbabcffkcg_afdd^cec^de`\hc_ecc`a_ggbgbbacgada_ac`ea`eb_db_bc[ebdbbdfbbb``ebbbcae`b`ceddgbccdbbdbdfc_`_dcdbnbdcbdebba]cbcaafbdfed`daVb^[]Qa[[nWdZ`UYSaWX_ZZ\`b^_cfad\Vp`SQZ]bWVhYVd_Ldh_Q``ba^d`g`bdbkbb`fbhf^d__c__`ga\k\b`e`icqcf`c`]caccacac^^d^c^Yef^fdgoX_ecX[i`_bdbh\^^be`Zabbacdd`_^]e_bcf]cfblXf_`]Xbehm`]t[YYm_Y^d]Z[]Vdrps\XWZ`\a\bda\]mZ\g\`od]Rciaa``bcad^eaea`bmp^a]\ge|_c`f[V`bddb`dn[\a[fadf`ccbabcccccccccccccccccccccdcdccccccccccccccccccccbcccccccccdhb\cf_bf_adabgb_f]_c`b^ed`da_ea\^de^^cc`]fc]habca\eddcc_^s]`bcb\a\b`__`hcfc[_c\c`wab`g^`\]`tc^c_]^`^ad_^b]_a[ecdjccdf^eccfdbccbdacbdaebcbdbajaacebbchcd]bcaccce`bbbgcb`bce_acdbcdeaaam\biccbcbebb`bedaadfcbbcibbdcbec`gbdcbacbccbgebcccbccb_eebdbecdagcbfbdbedbbacacdc`cccd`_]^`ec`ababh]cc_ac`]c^`bfe_`adfbcc`lhgcedcgb_ceb`cc`id``Ydbcg]fbj[^dUehm^_\a]_def]hn^d`aX`h`c`ec_d[cfe^anThl_akZbba]ag^c_c`ge_a]dibeacaabi_h_\^`idfcdjh^a\[`bc^o]h^_^db_]aeb_hbib^ea]^`e_Yba_ho^]n[a__e[_b][^_Zbaf`abb`_h]_h^ax_brdlVmdc[f`]XUbfZV][byg_a\TX_gbilh]gfji`U\jXb]cccccccccccccccccccccccdccccdcbccccccdccccccbccccccccc\YeeZ_kbcj]`daj___]c[bhjkee_cc^g^ecc\_djXjbeZaldia_cVdYb]h_`[b_d`decoccUa_f]f_c[cacbd`he`g_g`bdlQcg_cb]fdfb`fbgab_fh]bUd^bidggkc^_fgclc\`egi\^`ebada_iaabfbbko^dddc_fdci`Y``rca_f]afjo_fXb`VbWpXVlb_ggbe]_]aV]^Zf`[_udd]j_Obel\`_aYii_sfc`Ya^]bc]dd_c_h_g`Xa]gd]oZ[heqh]f^Z^if]Z_Y]eaif^t_^cm`]Y^gc[k_dYdgdm]^Zbc`[d]_c[a_V[~`ab^^]^]fccgWbacbff`ebede]`kgf`[^a]__dch]kb_gaeof_ecghfeefX`a`aa`abcr`f]ab_`aaej_`babab_ha_dja`lgadj]h`cbhbcc`_]`bd]osUZaffgISdHqY\Lqk[@RUiCcb]ZVfVdzkZUbRQS[_U`eKPGSbXj_e[iXa_`_b^`ha_ZV\j]`\nb\dZRhabfudedcZstV[be`_^Yd`a\fY^Z`[aa]be]`Z]V[_a[_[XbZ\Zb]dg^ccedge[h{Zbi_[^`_cpa_aak_e^b_\`gb]^oUZg\]llf^h]fQofS^h`gicfTbcQU\R`ba_q]uYj__edeb_eecga]h^eec_e^daZac`cgff`dd^`cagcecdcdacge\cfaVchgg_cebf\bg^da[]hheXedje]]``_bcm`agbe`dU^ifbacdc`kaiacbcedcccbabbcbbbdbcadbea`dbdbfcacabeab`bbbbaceccbccdjccccccccccccccccccccbdcccccccccccccccccccccccccccccccc^fhcdcbc]ac_baadgcb[abcccefaaah``b_cd`b`eg_ajdccd_h^efefadcd^d`^becWc^bbc`bcgdeaeecada`bcbc`ddb`d`gfc`bdcedcacecdcccbcbadcbcdcabbgccdbdce`bbebi_bbdcbbdfbdcccabb`bcd_cd`acbdffbccccfccbdbecacc^cdbccc`cababdfb``cbcdccid_ZZbYavc`cc``b]dcb_`^abaci``_v_an`sca``a`abc]bafcacbea]`ebcb_bgcd\abafacd_bijo`^da``cmYfacdaabgegbeeeb`b^bg^c`_chc`ccd[ccbabdcfdj_beafcb`\bgcba`dddbbad`medcbebcf_ccccccccccccccccccccccccccccccccccccccccccccccccccccccbcddcbccbcccdcbdcecdadcccbbddccccgbccdcbcadbabbecc`bcafQ`U[v\```Zb_\i^ZSaYcf]eaW\SMXhafaa\_oZ[bcTc`\e``[\Ydl\a`cbc]bgbabcbdd`dhljb^adan]cbheaaddde_cbg`_`abb`_abcccccccccccccccccccccccccccccccccccccccccccccccccccccc]Uchdk6F\uVj\0[kXksXnWprd=s:j:gCbVWb[iSLXZvjXWoX[rVWXL`ajacc`cdb^bbkccbfd`ctgafcbdb_bb]g`aadacfe`a]debdbb`bbccccccccccccccccccccccccccccdcccccccccccccccccccccccccVffS`dV\gdh[^ehe\lf^^lddje^^jldaVe__`_b`WokcgX`cz^Zbdka_^fbdbabe_`e_bdab`e`eeegbece\dddafffacdaicbcadbb`cdfccb_b[bbcje^`ac`bch`ffbie`Z_a]b_abdbccgaiZialg`afc^cihcbbcbgbacbcalbcdcccabeb]\bcec]b`a^a_ebefddda]`cvbchbedbbjbdd^abef[fcaaal`Xf]sbc``\deiUoZb^k`agfe^b`bda`h]jeadadebea_g_eddfa`^hnf]]da`db_`acea\a`ad_mf`ab\^``ab_hceciJ`V`lZ^]abYRYdm_hNapZadjoY^caf]cdSVhWa_a\]^YcVigRjW^vbce]hcZ`_ab`c^_ec_Y`bfa`ded`ff_fYadcegddg`adcebed\iidfccdfebccda`cbbdbek]a`_dafdacbaob^bdfbdfeca``_`babeeabb`aeb_bdc^dcc`deccgad``cicefeh]c`eca_eb_^dbb^_dhbb`deZqcfaieaabb_\hUa`g_no_eaof]S]aiT_dgZMbg]g[bZbgVWehXfRV`cc`cfchVZc[de\[Zcbbb^a\edefcWabc_^eba^_eccccb^cfdcegbd\abmc^cbc`fcfabfg_dcc`]`bgabcbjaeab_``dbfad_cccdacdbbacbe]d_cbbfbfdcdae^gh`_gdfecdafbccbdfdc`cecbbbaecacebb`ajaeaabfcebiccbcccbcbcdaecbbbca`dbbcbc_bbcabb_accbabbecbbddbbcchb_dccdcccccbacdccddecbcbcbfbbbccdccbecbcbdccccbccccbccccdccccceccdececbccbcbccccbdccbcccccbcfcbccccb`aeebdcfc``ccnbcbb_abb`caechbbadc_cbhcebgb`acbbdgebac`hcecd^bhbdgb_hfb`fef^bgabecf]fdbd^aebdceb`dbadc_g``d`h\cib]id`idddsh\e]]a_`Wjdae\eh]gadkac`Y[cdk]_daek^Xoabdclb_cccfcadccccbbccfabcbcdcbcbf`bbbcbcccdccbbdccedbbdXi_Rdnq\`gc^qgfl^s`QX`c]ibLhccnXWS_dWSa_[aVYl`gef`[YXf_kaX_eX_dcme]iia^}^]]V[^_b]_^rYeeROj[edoTgj]dcXae`Xe\tccccccccccdccccccccccdcccccccabdcb_ccbccccccecccccdccie\_ebc\g]cfXjln[eebadjc`bf`e`[_jX\ifb`chei^UZbRa^bnci_Zq`Ze_Z^VU]TZYbf[cZc]hVebd[`eYUZb``aukge[U[eWgb__`V]cad]^`]`aa`ag`ca^_`_]fb_b`]daZ`VX]Xd`\]\^\]]^[^_a`]]``^bja^fdcecc]cd``cgffeeeaa_d`eb`b_adh`c_fc`fhcabfdfcbh_eaZehcccdecdcdcbccbecccgaaadccicgabbbbgdaacgfbc^cbccbb_cccc^]a^c[de__``dfb^dgefceeg`f`bde_c`ee^g^_\d_a`abgde`jgbdZ_b^fdfd[`]`b\e`]a`acebhnagddb_gbd_e_a`^bj]b`cfcY_ece`]]cc`^a`_`b``_def__]dbcdheaa^aa]ace__e[]`cb``bdgf^`b`cWf^odfjZ^dtnafglbeYcZhU[ZJafPh_Wg_jaZbtVb\]_haebKaWl`oh]qd^ia~m\`Rb^^iicj]pJdlZZbi_XVaP\beUpeam\Xc^^`kccccccccccdcccccccccccccccccccbcccccccccccccccccccccccbd^eeacc`dacbbcfbcdbbeamfcccbabb^a__fbhdccc`ccfdc\bcakccccccccccccccccccccccccccccdcccccccccccccccccccccccccbbcfccccdcaccccbccbccececccccb]acccbeb`ccccbkdddcbccb`a]bcbcacacbbbbcbdcbbcccceaceetdbbbddabbfdacbcbcebbcd`c_f\i]ea[_^feeheb_[f^hm^ag\Wfkhi[^X]fboca`^[XfhYgb``eel^oeaf[^cbVkkihg_ZbXiac\bZ^XYd]vbp_a_^hh\`dhfXgdbe`[[\je``_f_aa`lf]_b_ac^_`cj\bc_d`b^c_]fb[_a^b`_^kha_aFc`e\ccccccccccccccccccccccccccccccccccdccccccccccccccccccc__`bazbb_becbb`a``]dbab`aa``^aa_`]bab`f_`_bch_aaba_`a_ccfc`ccccccecccccccc\dbbcebcdcfcbcc`gcdccecccccbccccfb_`_`ebjb`b]ba_ccj__c`a]adgigiba^gejdge_h_bf]__fbb^]e[_X\ckdZ^]bT`ZY_^^[_]`HbnXadbdfbSlU`aYN[cZYmZ_R_\]Yg_Sj^ba]ald_hbana^bea`_]kaa`dac^]f^]vh[_djg`e^_ab_bbcbefd\aYZmf`gSamY^iK\c]`\ae\[_Z`ZXWZ`Wfx[c``[o_`[\Y_[heb\ceeadbbcbbaeebbecfcccc`feedcdbfbbd`bcdcdddcbb_bccbbcbb`\hgfSaYe]b``ejjcdW\]`ca_`[NcelaegXgic]fdmccgeT`fZmaa_^hcceeabbd\]abW_edei^cbj]gacc`kd\_cecdab`m`e^ei`l`adcfb]le``_``eg\_acbbfcaelebf\]d`^a`bieed_ccfebdbc^ba`cd^Yajb_jhga]]a`_Zc`gd\a_[`]c__b_ig`]idWXehgced^defaebicbc[chWh`ar`\g]]ZldbgcZew[_^a[ad]d`c`fbc`Ybb`cShWad]a^ld_\_g`\^iblXicbig^_`hbZ_d\a]bfa\iabgb]dX[bdf[dhTbc^Z]jn`dc`dccbcbc^ccbccdbaccqbcdaccc_`dddbdgbd`cbcba`babbencccb_be`\dn`cc`b`gdcfacdfcdbjcdafbgdba`^_``\gh_`cceabc`^cccccccccccbbcaccecccdcdcccgcc^cc`ccccccccdcccegccccbcbacbhacc`egchcdbcccbc_bbccdcdagdbcceacbcbbbafacccbbccb_hbdp[bah__m]g\_^_jea[```YeabWf]\hUg`h^eg`asa`a^]c^__pjJbdccNW^koed[gigc__hP[llfSSfgibcX]a]hje_dgeZrZfUc_X]]hjZ`^agbdbj_ba_bb`hb`glje__dab`ed`ai__d``^`^[d`dbgefdb]\[_[^^bZj__^`f^_l]dfYb\]y_`X_^`b`]][bjX\_]^\]^`]`^`^lag`fMlQ]Zdaj[ccd[]b\Z`an`KWbi`ccha`b^d`^emMhiQfjZk_eice\cicbcbb`ccbcccdbceacdbdccccccbccc`addcccbbbbccbcbbkdcccdcccfccaccccbccaccccc^cedcgdcbeebf``ebdcbccccabdccbeiecb_e`df`_afccdeg_^geecg_`acbceb_`c_a^\hhqb`acgc]d`ccgcebccee^dcccc`bdcbbccdfdc`cbdacbcdaccbbcbbcdddeecccb[\W]}S^rpnQd^[^ZNkYhg]dTrSe_Z^RiHVVTXrZcqu\b`_XfaVd^Xcec\a_`Xedhf``bjbm^b`a^e^ea_``bigb^\ladcj_]f]nhag^ebcccccccccdccbbccccccdcccjcccdcccccccccdbccccccbcccacccbj`aibgkbfchdfYdbkcd_gffadfcecfbad^kccffdc_gedfehabcidiaaebebbcfe`ccccdbcecdbbbbbfccafbfba`cbbbdecccdcccddbbeR\dacXjckcfgfaZ\b^fccmjiabiagafibV`eiVdfge[s^faa\j]g]hcdcecd\cac]d\^ed_fZaa`deaage_iYhbccbaadggdafehd_echd___b]bccbcdeafcbdcbccad`cbgbbb`decabfbebaedjbc`ddcdfg`afcccccbccdcdccccccccccccbceccdcccccccbcbccccccccccccbccXb^_^]aZjn[`gZ_jcaUcchXjiZf_khfhc]`]^me^kudWb_ggv[^^_e_b__`b`bba]caaaeaa^c_\[cddfadb}`^a\bga`ac_chdk`acZca`bccccbccbchdebceccccbdcebacbaaaccdcdccbbbbcccbcbcdcccccaddgcadaccab```cdbfa_]c`jna]_fbaccfb\_c^``dnWicdfc^gecfZbfbbcgc_kcbbbe_befcccbabdhbdeccc_fc`deebb`cbbcccbbcagdbeccceccccccccbbccadaecbcccdcccdbbcbcbbcececbccccdbaeace`_dhe_dcccdddcab`beb_befd_dbcbbedcccfcddbdcafccadlbfa]aabfdedb`cc_ceh\fb_`f`kh`[edd_affcbc[dhcbccbd__d^`Oc`bj]hZbadSqib\Yr_Xmj^gToY]`ncZWgXbrbn^a`^UdY]YcfVjbbcdcbbcbaa`dbbdbdacbgcecbhbdbiddbc_ababbbbdcdecccccdcbd`c`ebc_bidccdbcbdaaadfd_eb`adcccgd`deabac``fccbfddaaaXfaefciabbea`hdi_ngmeicegelcbd_k_cce_hd^Rbe]Y`^bcd^Zda`^cV_dakbYa]]nj[cl[`d]gdfWekZaaWeea^XbZa_cl`h[y`kd`iab`achcdcbcbbccbccbbbcbbhbcccdfccbceeafbbbabbfbcec_bccebgbccbcccdaaccbccddbbcbcbbfedbbbbccebcfccbcabccdcccdcca[hejle]X^[Whv]aacNc]_Zc`lewaldog]_a[_fpkSZfhahcU[`bV]cbcccccccccccccccccccdccccccaccccdcccccdcbccdcccccccccbacdcbcchc]cccbccbccdfbbcccacb_cddbaecacbfcbabcebecche^mab__`c_f]_ge`^gb^c`qd_cc^abkbob\cabb\ejgg``^_gb\[cafcceb`cccbccccdcccdcccbcbhbcddcccadc`bcedccccccbcdbdccbdceea]^_feffc^cb\becbcc]`bb`dioeebged^g]a[`c_ba\cgd^e\b^gkfdehhdaf`jacmdh`gXgi_`p`]ieke_f``^b_gaglefeb[gac]gbbbecbccecacdccccbacdcdccbacdcbccbbbddabebb`bbkcbbcbgdccccccccccccccccccccccccccccccccccccccccccccccccccccccacccccccccccccccccccccdccccfccbccbceccdcbcccbbcccccccbeacbc`ab`cabcbbcgn`aa`babfag_blaebdbb_d`cvbaabcacaa`bd^`haa_bca_acbbbda_c_fuacf`bce`dbc_c_b_lbmdbdaabb_bhbdbaeeefgbdjadd_]Ycfgnq`efb^af[ebbjf^_]h[db\aTfeda`[aW]`dbjj`Qhf`YbdcdbZhfb^_bb[W\c]^gd^fsccad_bbnga_ha^kce[_^abfed_abc`bdebc`aaba]cccedjadbagac_e`fbeb_`babaacdf_bbcc`dc`dcchf_dcdcecdcda_debcccdccbccdadbdcceccbccccdee_d^[\ai_xceaced^_da^\ccdg\h[a^_|^cm_g]abcebb[``]c[`aa_k]cccccccccccbdccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccbcccccccccccdccccccdcbcddccccccaaabdacdaccbabc`hbbabag`cacb_bebhbabcbfb`ebbb`cdcaacjcqd_Wg[r_mcUZYcpadighgdY\fdjhmiUiZ]Vee[kds]_ndhWchceRbVccccccccccccccccccccccccccccccccccccccccccccccccccccccch]c`d`bfbamaa^bbas_`^aZfm`a`V_dk^coYnk\g^c^^ab^ac`fc_ak[eebcc`be`fdfacaajbdb`dacb`bZgc^^]facbbfa`eebdcdq`bl\_\dc^bWffcdd^bkXbg_bgececldjdmdpidZaZUjd^dheOicbgcYbdlc\a^`bbZ`di_b]dcbee`ic\^gf^kajdjhfaace\ZXccbcb^d`i[agacfe_]ha\`^bhalgfaY`o[aVae^bWfte\^dimce_\YhioW_if^gb^cn]]q[[X`eaiW^[icfmZpWbfbdfabgY_c]n]`bh^_[__X]dmd^l`jcSccecabbdgc^ecbcbbcbbb_c_dcddaccbhbcbddcccchcccbcddebfc^g`_cxnVtib^cb\VDnm\ea_x_Tg`qnh^]]Sibb]ZUu[]\[ZWg``[chccccccccdcccccccccccccccccccccbcbcccbcgcccccccccccccdbcddcccccccbccccccccccccccddcccccbccbcccccccccccccbcccccacacjabZ`fb_bfd]gciY`[c__sab\h^\^cf_a[bcYm_bdfahh_a^ibdccfcbcbddccbdbbcdc`bbccaccd_acdccbdaafdbcbdcecccdedaabeddbccbbfdcbbdgb`caa`bcb^ccbfg`cdbd_bacfcpa`cacaeccca`dcdbbb[bcfcef^^][XdWYdjpja\\j`]Zd]_`^n^ggkceidfnia]`a`gge`a`_^gcd]^bce^]bjd^dbc`h^d]]`_bf\[a]gf]cU_gbbi`fc`dc\eg]^e]\a[^]pQab^ea[c]]egPVf]]_YkZYecLm`Ne^\a\d^ii_b\_gdabbd`fdtcbdc]fbd]\_^bdc`Zfbbabme`bbdbuhee_cabaaad\^bZf^a`eebbdbdggifc`d`deb_ia]hdZ_dd^kcfd__cYbiaf]`c`b^abdbbcdfdfcbcaceeae\cacaacd```dbbddad`jfcc_dbkdefaaecccccfcccccdccccccccbdcccccccccccccccccbdacccccccdccdc\]ia_]abgabcc\b_bhbgg^Xfdkdd][c^ffcf]dbddeec__al_jb_efefald`^iW^df^d\b`d\adfci`_VbW[cf_XffYdbbdfmmXqab\`kdebb`gdfbbcbb_ededaib_eeh^dbfcc``bcfacaecg`_abbeccbcbdcbfbbccdcccdc]ceccfacccdbcib`ccgbccaacabdccagbcccebccbcdb__bgdbfcj`djaehfbcagcg__]fdcc]e^fb`^bdb^abgdcdj_adbg]e]^f]^aabcc\R``\`caU\Ta_uX[[axdp`[_Z[YkblT``h^i_kb\f^[`cdbccdccdcbfbccacbebbb`efa^c`bacbccbdbb`cbccbdbdcbmcbbY_ePgbqp]adf]^]ab\_ea[b]ajd`or\_`dn`a]ba^a^bcd`kaea^kdd\^cldfcacaccbgdbbdb`gbe_ge`cf`d_baceba`ggda^adhcddac`b^deca`bbdbfaacahehca[d]e_fdieabk`ee_a^iiaec_`fecedccabi^e`_fge_acf^]aefZaaagbbaidbeadceggd\dbhdcc^eac]``_dft`Z`_PYdvai\XU^NVk[\eicd]rYcdV^bZRf]YZX_aacb[a_ae[ma]cbcdccccacbaccccccbccbccdedcdcbbccacccbeebdccdcccbcdbdadcacdcd^cc`braegbd___]]lfed[c^gb`ecb]b`ed]]gbdhb_ldidcbcbcccccccccccccdccdccccccccccccccccedccccccccbccccccVdV[]fb_kh_jneVfk`Sc]aXlb_\`b^pdTdkpd_ZeUgSZaY]_aZe[eha_a`leY`cfbZbd_dec_`rd`bdbbad_l`]_ag_hhdedacZkddbbaademi[X\nTkcr`bVX\hc^YYqWVfb\ZmbjdT[XWn]VU\][W[oxajh[bg_]S``[b`]_dbhcY\b]]bhad]`gfefap[j[ea]eY````ccgffc_cd[a`ad[[cc__c^e`b``_ak^`^]{bkb_^`jabb\_c\e[a]iZ`d_a^```bddn_zdcf_`cgb`aabbbd_`_edabbZa`a_ejf_`_]ddaae_ba\eeb_sdc\?mPPK^TXljfYOhSK^GiUhn{wjqYIbfPPMNR`\T_@]RefXSSVZLIjPbmcgcdaa`c[a_`fdcf[`dbcecaalbe]gdec_`dcfcdaac^ef`ah`e_afehfWj]XhddeW]iheUaX\[\^\Wcjcgfahidik`k_caXdhV`^_ilfaf[edcaa`abjbc`ehnc_b__kg`edeg[ifZd_d_a``c^e\f^fcn_cd_`^ad`e_`addebe`_ffb`b`^cb_d`cd^_cecd_da`baf`bhbbcadbdbdYt\RSTt\KV^dRh\RNa{SX=M\wcfZ^\cZQUcoPwfP]XZ[gOYd[WRioceccc_cccbdfeabdbcbc`ccbbacac_^ccccadccfccccccdcbecceb\acgf_]afkd`cX^ca^b[ga^b]fa`hemwZ`a]dfjca`XWcc_^cjga_Vl`Zeadcfm`Y[`_[ccdfgjdc`fkc]`ifgldc^e\Wab`a]Wbha_od_`Ycdbececcebaddcccccbdbccbdcccbcbcccbbecdbdccbcccbddccdbh][`_s_bmcfjh`_]^^VbfxXcccY]`\cob_c\\fdb^c]l_hr`cf_[e^NcJUNWPRL`dK_RMx_VBPjRUDX=L[TBZ{wL=`EYsYZTN|DEQlFV8[^PJb[Ne]VZUgdFd\UUpYHQnPLHXEK^bVSWvm]VaO]_dS`c_Lb^QvZ[Ve\cs^^^bZc_g_ag\fdmb]h]Zcd^kb[`ab`jd\ef^jab_u`d_cchfbibdaj`\Q]h][_`^^jbjhehSgfUag[^~`^]`f\Wbeijl_jX\beIeXf\_f^fcbcccbbdcbdcccd`cbgceccccdccc`dcdbbccccccaccccccbccXwMO[^JfUTTMQSRk_FO]MQKWW>cR`HPQUQY]VUYTLgOdOMt]Tk[tW]aYZ_iX]bb\^Z`ZYg\dXa`VXnZ]U]]_XdYlkea`\WL_Zx[^ddd^ccccccccccccccccccccccccccccccccccccccccccccccccccccccf\a\k`_aifl^\d_a_f[c_hafa_Qb\[bfdehid^]ib]dm]]\`e_ffg\cdbddcccccbccccccccccccdccccccccccccccccccccccccccccccccccccccccccccccccccccccccccdccccccdccbccccccccccccccccpbcbbccbcacbbgccdcb``cccdbc_bcgfbbcaaf_d^baafbbbbbadb`nid^bba_hfbcnbdfbafd`a\a^c____\]`c``h_g`\acu`b_aee^s^dhdgajfaihYg^xTgj^e_kZd`[f\l_[df[W\`hmnn^gdgVo`eR_^_bZc`eadfY\jbg`d`\if^afc\m`dc]]\kfecWdfghf[ce_g_d]j]WYcZhbddeccccbcccccccccbccbbfcecdecbcccbcdcbcacccbccccbccdc^`dbdfc`ccfdcZddbcdb_hecebi[ebed^cc`iaaafg_dfd`a]a_bbaVZb`WaT`nWghaYbbam^ehZSkf_\jcWi]Vg_iibccfebh[^a]gXre_VZmagcc_WbcdddO[a_mfd`iiddfqmf]``[diebcacia[ni][emah`ccdZacebfcceafbbdafcdda`ce_aced`eccb^cd\dbcfcd^`c`bcbw`d`R^^[Whb_v\ZW][leh\]dfb`erY_elZ]YgU]o`bencaSjfdfder\`Zccccbcccccccccccccccccccccccccccccccdccccbcdccccccccccj^]_bb[a`_l^b]cbf[[]cepadb_\hZdcdY\g^]b_Ydd}feaW_dcaYannbcage\ca`bajqdfdf`ci`d]_bfc`dae``ke`gg`dkgdljjbcd`edZc^hcSfe_Fc[XQoW[\eqU[oTXgch`KTPf__ffgZ]TfO]]OoRaUe\Y^dja`g^^cabe`^\b_b\cY_^ZbYd^c_`b_\drY]`\Xa`iqge^cf\]cbbccbcccccbbccccadcdbccdcebcfcacdcbcdcbceccabcdcccfadbcc`cbccccccbcccccc_cbcecccbcccbdgcbcccccafccccgacecccg^`cdbb_bbhbia`dcadbg\gadchb_^g_b`idgcdafadbe`]dccebec`bbfae_acbf_ecbbjdbedgcibec`b^cde\a_e`_`db\efdbgcc``hjfV^fagaddihgcc`X^ed^jgbfed_bdddYcaa`c`a_a`^a`_eac_fd]bk_^`i`abcegbfa``fbh[_`gYi^_sa]c`bc^rca`^`b]baf\n^c`bcad`g]q_m`dOabW`sUc^ed_`f\e_a[ecccdgYiegr]ec[\pciW^bcfcanb`dcedeccfciabfabcb`c^b_d_acea_g\gaedabedd`_b`fhcddddaWW`c^c]bf^e\`_b\^^cY`d`XZbeaa]jca_^la^\alhb]\aZi_Zgcd\d[c`\gae\e_^ea_f_`bacqahg^cdd_\`agjeba`^ddhclgacbaea`^cbcccccccbdcecccccccbbbbddecbc`cccecfccbfcc`cdcbcdccbbcccccccccccfbccccccccccbcbccccdccccdbcccdccccccccccccckicace_aafi`fbgfe`_ab`b_dehjcddaejjd^ehbdddkgheegbfb_clc`f\]d`kd^_cd_b][VV^[Ya]ia_aYYX^ZYd`di`eaa]Z[]c{^jb\Zcbdd_bccdcdecccdccacacnaabccbc_bgcbe`cbcdbcababfbcccdbgd]t_bcgNXh[YgWTafW^dgiZ`eWfbah`Z^fa^jmheZ]^ihUggXgngf`X_b]b_cbe\cbebbbeb_\]g^a`cef\Za^amffii^dfaamibicbdaapcdccccccccfccccccccacdcccccccbcccecbcccbccdccccccbccccbccccdccacdccccbceccbdcbdecfbcccbbcbbcccceebcccccbccccccccccccccccccccccccccacccccccccccdccccccccccecccccccceaibhb^nedb^_bebidXffdpXdck_b]fg_ec_bb`c^d_d``h`bgba`b\bb^fj]elXeedz]^^\UakYe`r_|aVZ]b_d^]iYbaa\cigb^b`oh_\cQk^\``t]ZX_`rjZYSmgjYYYcSYdf`]f`UbbuXddUcTca_Uc_`XT\abb_bcbbcecaeccdcccibbededacbbbacfbeacbbcbbbkccccbcdcbbd_`ea\`\_`__\__]`\^^g`db__\^Vd`_Y^W_[ac]Z_^[Y___hcec[cedccdbdcc_d`cceabbdecfddbecbd_b_ccdgbaccgc_ebdbccccbccccbdcccachbcccccfcccbcc`ccccbbccc^bbaddcbdccccbcbccakcba_kcccfcfbcccdcbaedacpbdcccb``^b_aceadbcbbgbddcZdbdceq^aabk^a]aY]^`edfd`dfY]b`ccc`md[bcgdl`h[cabbg[_^cfciacbdbbbcccccddcccccbcbbcdccecccdeccebbccbcbcdcccdcbccccj_^`^l^``d`i`qb`hlj_bbdc`bb\`badch`\^^\g^YaWb\\``]c``_W^^Vb_b[`^_aca^d_`]^go^bZ`a`Yhe\ai[kmbcb`ah]`eb_b__chf_^bcachfrbbdfc_el^_Zacb`ha`dca]cj]ab_`cc`a]bbcbccfd]gTf]diX`aWoT^cb_af`^\q]U_^TYX\`bgY`hc[bXaj\]Z]Ub\\Vdgaccccbccccaccccccccedcccccccccccccccceecccccccccbcccccce]_`h_`d`d]]a``\`cmj]becbp``f]bee`_iZdcgcgegce`a`Wa^ajgo_baa`bgdf`bb`abeifa`diacfbd_]`_faf`acb_l`dcceacdbddZ^fe^bW^]`igcd\^[fe`cd_cf[hZ_dgbg^^gbmai^k_g]\^]ggZd[gbbebcccccccbcccccccdbfdccccccccbcccccbdbcccccabbgcbbcccafg[gLWZ]dcjYecjZ_aee[U`_ZWee]]`l]j[Mdb`nf\ghTQcWfU_bihigg\^a[^g]^d]bc`\f[n`agh]_]`efb`da\cbfc]a[bYae_ckjjcd`ed_becgbagcccccdbb`bdccbdcebeccce`dbbbd_cfcdccdcdce`^`cagcebdaee_gc^jcja]sZ`^cc`^`f\^`\a``]`_a_^e`ceddohdicbccccccbcccccccccccccceccccccccccccccccccccccccccccccb`fcgcbcacacccccobbccfbbceccc]abe`b^ccebefab``edccb`cccbfad\bcidbec`e`c`ibbagdcad`b`dbdabbegf`bccdacdb^i`a`cdcbbcafbbbc`ad`_hc]fYne`heccd_`aabada`cd_`cd]edbcddacgd]bbabhceb^bbbuebcnac_]cdbgebf_bfcbadba`cbdc]cd^caabeaje_bhabbbbdb`cbbeh_bf_dabbbb^bac__ebcc_dcdcbh`b`ba`aaaccccccccccccccccccccccccccccccccccccccccccccccccccccccTdaRR]b__^[U]\\ZZ^]]OTY[]WZ\R[WX\]f^dkZbdWXc\k_XVY`^`aa[b_\aec]`\Ze^Zg``ec]fe\ba_VRg`i_osjr`baY^rUcXa_^bYdccdbecccbccacccdcbbcbbcacbccccacccgbccfbccdbbbbbccccccabcgac]ikd``^cgodbeggXgb`caaaUi`d_bbVcfhgjed\]_dXf[jeX\ccf^bY_[`a_YoxV`[Uhp^ck[Z`hrmWfnga^hb]_XqQcVWf_j_ecdb^pfggabba_V_a``ig]_^bU]df_fb_drd`\^YcYaif``d]`dc^[kaaewWcabbcdcababbbbbadi_cdcedc_bbf`bbQdaedcdbabgbmdbfdZfaZl_h\^af`gX_]_cfmWa`s[\`^We]YekgaZXWt_`b`_p_pfa]ib^_ibtca[`cba`cc`jgca_^_\`^Zbd`a\]f`jbfdp|iYbY`____ea\e`b_egdddacafd]geccdacgca`efbcdcc`\ae_`cea`cc_abieddcbdc_cre`bf_`c[aei]`ddedW]e^b^b^adhcv\]Z`b]gi`fb_a`]di__^_ceccccccccccfccccbccccccbcbdcccceccbcccceccbcccccccbcccb`bbaecbccafebbccadb`^ac`c_ccgehbbbacbc_cbbdegafaceecldZgec^bgc`ed^ai[_ebce`h^ef]W]kYbj^`_b_lgfjS^cefk`_fbc[oef^d]^`bfaadb``bdbabcd\c_cb__bdfbfcdaacca^_\a^gbbbhecbacfbcccbffaeccbcccbcfceccbccbadbdbcccaacbacadc_ccdiabcaabfcbcaebfccddcdccfabbaccc`cbcacdacedbcccdaabdeecbbd`ocah\`ccbbedagbacahbkbgbZgb\^acaaeg`bah]cd__bb^]cb`adccacgcbbedacccdebdhca`aeec`dacbcbcbbfabcbcdacdebceeaab]pZrU[YaZgFPZV[dWFlSn'TQeOW`eLqhCYYPb]lYUCXOM[F`_Y}`decadcccb^ecandddc`cab`adfbdcadfba_`eeb_gcc]be`dffbcbfn^bea`bcbZ\ebb\ib_dls`f]e``\kal``aagcf_c[a^ma`eb]_cVe_acc_cbfdf`haaegbccc]oc\c]d_fa]eeaa_cfc`ebdak_b`ddhd`hgf_eeecbea^kZeZf\\rdbif\bikW`]WkbgpbacXmadZdd[Yqlacbgkccbcicdcbbbccbcccccccbcccdcdcebcccdbbdecabccaccdcbcgccba^abbbcddbebcaccdeachdbcbeebbcchcbfdcdcbdbbb`bdcdccbb]c``f]ecbefeabja_c_c][_babbif_b_ee`^db^]eddc`_hjohgaehccdcbcccccdbcccccagcbccbccccdcccbcbccccccccccccbddcdccb]abjgfb_g[feabcdd`a``btdeab_aed^`c_bhe_bac`l`c`aZebcacdccbccfeccfccccccdcd`camdcbac`cbcc`cccdbdcbcccbdadbbc}jfcfb`b_bbdafbfb^bc[`n]g``a^`g^__c`b_^\_igaWfb^cc``cdccccbcccbcbccccbcbccabcccccdicjbccccbccccbcccecaccccccYb`d_N:TlM;^i=Vfckgn`p\f4lfMo~ZnbchSWgZmj]bjR^j[z_chcEebcfabacgcacdadeabaagac_f`bafcbbdbbfdkaabdb`cddccdhgac[lc\aaeacfaf`__d\c_gd^\cd_d\ddamd[r]afaYecd`fee\ch_jf\aYfXeXufV^`wdVZ]T_Ydbcf`diaXYk^c__egUk\[Z]ga\j`_VWe[icRRR7wMv6C#F{q0^00Q;l2PGvQCsLPDUmTkesqx<nGBFw:VZ^_UhQbR7blbdife_`dmh^ndPf[oiijiZ`iYaSiUbkfVgSbX[^^nJ[Y[Nkf_\Aan`dcb]bgjdaiq]_db_d`d`e]aekh\gnf[dbc]emaak__nhgWd`c^iccccccccccccccccccccccccccccccccccccccccccccccccccccccg`dadfbcacabeddebdc`a_`_debb_`ef^daaeabdaha`eebacecfbbj`b`ababgdbdgbabb_`ac]b`cadbf`dcbabmda_baadbd_cbchf`_cifU_]Yb`edYWn_me_ede`Wjg^^o`e[b]\dbcb[cVba`V`_Xoaaa_f[ccccccccccaccccccccccaccccccbcbcbccccbcccccccccbccccbji`acbbcc`bcbbibcbacbcecbf`bcdaxbafb[cbfagcbbbdb_dcbbb`ba_bdcdcdcadcbgedegc`acbaecabc`cdbbebc^bcccccacgcfebgc\n[ab^]`Sjc]R]{X]dZfqafd_\l\~_b\U_cdhXb_XU^p]Vfd]WYV`a]^a\ddWid_bXzjdbhb^\fca_ae[f]`ggfahac`d\R\]e{_Zdl]Y^\sYeZ``lb`cdY]ZZ^h_`^gadcdan_`\ag___`TeW`a}_YUVY]_Upffbbacbcccccc`cdcbccccddbdcdcdgacbckccbdcccc`cccccdcdccab]bfeeb^c_dhb`abbbdbbg_dbfdacab_bige[`egf_fdb_ef_bcb`dbcbcbcccccccccccccccccecccccdccccccccbcccccccccccccccccd`had\affe_icbm]fbZi\^be\af`jbdidbi`d[]d`laa[`jb\j_ZceU^USN[~Zb\ZpQlUX^_|V[cCg^XfeShbSZ[aXWbbKYUQdm\NJ^jRSkicecccbccgcddebcccdbccbeccbdccaacdcccccbccccdcccbcbccd^cdccccccccdbccccccbdcbccccccccdcccccbccbcccdcfcbcccccca`dcadccededcbdcbdbdbdcdcadbbabbccbadbebgdeca^cbcgdc`ebcccdccccccccccdcccccccccecccccccccccccdcccbccccccccccbddaec`ccc^dcccccdcbfec`bcdc_ccbdeaccchbddccdbcccefcbdcccccccbccdcccbcccccbeccceccccbccccccccbccccccdfcdccdbVe]ac_Xb[def[auTW_bg]bigaVhXSLe[`_hjlj^b\XThcccZY]uh[ccccccbcccccfebccccccbccabccbcabcccccdcceccccccdccdcccbcccccccccccccccccccccccccccccccccccccccccccccccccccccccdbbccbcdbbbbabcceaagfchbcccccYcbbcacecbddbbedcccfcbebVmX_[YbY]^SVb_^X_h\Xb]b^ZZ[hU]acebK`P`b\pVhW\]]aSg\d]cbbdccccccabccbccdbcabdeccfdbcdcbccdbccbbccdbcebcdbcebf_bba`bed^acbbafcdech_hdbebbged_]bdebcbacccffgadbbad`bcaacebccbcbcbcccccdccfeebcdcec_bcccaeabbccddbcbgbccddapbd`ccdZlaf`jgZ`Wc`^eg\dt`YcbdgfeXaadd_``i[sgi`dTg]eiab]fcYbbccbabbbbcba`cajcc_g`beb``ca`_q`f^f`aff_dgdlbacc_e`d^aab`da\ababaa\chj]^bbabaa_a```]ea`b^a_aacfa^`cckbgadcc\be\dga_f_bca_debgbc_c`^hgdchcbbebddbeW`hf\fb`ceeZaW`d\_jd[hd^og\_jeid`hgd]jf]oifii_\cYgbcegcTggb]b^`m]]bfXcebmhYif^aaZkidbXWecd\gn`m\Z_Z`abZf_fd^f_g^be\ccV`a\`bcajg_YbeeWn_dcbjdf`cTmbaf_ei[fdkcifWhaikRk[cdZ]]`e^a_cehbdacffbc_b`cafgbd`a`c`bXb^f]`bdbaceda_afdcima`g_fkebt_d\]_bUY\ZabV^eod`W|_oaeSRaXVTZZohMUvdkR]f\wa^Waka[b^fd`dh]ae\bdi\b]fcbbe_\^i_efb`c]j_Yca^fna^h_]faccZ_ds]g]c\pf\[U\\oa\TbShZ`Yn^haYYgRbX`]eXYU`T[jgcck\fbafb`bbcbf`cccccdbccb`cdc_gebccdbhcbabcbadb_abdgcegcbb_\hd\``cffiegbacgcacc_d`bdce_d]dZeffdaa^`lcagbcbfiedbadabcbb`cheaeb^feaelacd`bcfcfb`fbcddddba_bedg`aed`ebeccc_dcaccceddeccdcaecbbecjccccdcacbcebbcccgdccbadbc]dbbba_a]ce^`cdjea_`gg_gaicfca`i_f_`a]a[b]df`d[xXeZdcbbfbf[[\_ma]Zbj_e[aad_eabceW_aY^f^`dqg\]c[Yacijch_Y]_fD^`^bbebbccccccbcccccccccbecccbcgcccccc`caecccccccbccccccccgWgmd^[eVV`eb[abfeYl[ef]fhZZaaV[\guggabebThh\gda]bhnbh``bc__ccib^ecbfbcb\geddjc^jcc_ca^eahaaad`jd`^eb_cbedbbcddcadccbb`daaebacabcccbbcdccbbcbccdcccdcecddccbccccdchbi^ffobga\ddb_cedc^bcg^cdcbf__i]b]b`cb_`b_aa_beccafbb`de`ba[cbfjehabcvb``f]d]a_bdba]bgn_c`abcdb^a\`aic`eaffcY`]ea`bbcgbcaqcb_ffij]]ccgb^]_dbaofbb`d^a`c]ki_cod^^bZeg`^]`icf_]_`ah^e`^dkcdd_``ah^jgdce_a`fdpbbf_aeba_bdgecf_d`cdbccheb_abgd_e`bddhaeca`ccd`hdabbedd_aabbacba]haa^`bjccgecdgs`ah_m]adgd^^hbe\\d`f^[cY_c\g`d[l`d_behm[bdbebbccacaddccccdecbecfcbdcdcdcebcb`cbbcbcdccdbccbddca]d`fd\^`bheh_`eid`Zekf^ddc_d^adc^bcb\n]kV]f]X`i`]g^]_kbe`_hbg`a_``bbbbbl`e__ae`ic]`b^jeajda`ccccdeacdbbcagabbfc`dccbc_cdbgg_cdaecdacbdcdd_dabcabccbbddeabebcdebcbYcdigc\cd[llgc`dWch``ikbc_^`cX^ei^`hc]eecb_ckgfbuciYfhjfkdfTbPXqY_^c[cF^g\belfoLsSW^\Oe0VZjXlT]][jgo^aMe`We[dggqcZ`bceeKb^\^db]]VZw\W\OWbg[ZYXcem_lt^i]caZ\Zcc]eYWj`e^bbabedhc^^cha`ma^c_dcfahefbf_ad^dcbcgcb`_ebac`]eaeccbccaccbcddccccccecccbbbccebccbbc^dbbbcdccccccececccj`bbbfccbgdabjcfebddda_eabccdbabb_ac_ecccbcbcbabbcdecfdcccccccccccccccccccccccccccccccccccccccccccccccccdcccc`an]ib[^cL[`XZngZlCagUafdbRZncmcfb_lY\^^]bZX^]RdYZY`eYccccccccccccccccccccccccccccccccccccccccccccccccccccccbabc_cbcgececcdbcbbhaecd]cbadba_eebc`_bdbccdcbaedfed^eb_`f`babhfdiebbecfh`bebfdfea_a_cbfac^dbbgcdd`b`acaabhdeldiecec`f_adcbd^]X`_Yskb_b`[_hda^_]c^lafa_d]jdebcdc_fcdfb_dbcdbebcdddcbbbfaaa_iabbb`cdcbbcbcbdccmccbgcee^`dab]ccaabacc`bcbeccfcbacdcggbabdhbbccabaas__bbdabcfcbbge[c_bafd]ggc^ag_jg`mc^adca]b`^mce`e]^bY]acheebc]c_bfhc`n^dYoabcbbb`bde`b]aaZadfa^\n^h`r`dadc_^jg`\]^vdbhedZ__bfi^c`cd\b_bc_ebad`occ_caddabfccbqbb`bagcbac`acbiccd_abdc`cabfa^chdcccbfdc`gbmcbcaaaecbcbhcbebcabec`cbadcbb\b`ee_efbfbd`_c__bZa_^ce_d`efcchgmde__iebf_`b`b_cdfbegab^ab_\ba`dcc^e]hai_W_`ca]V]cerj^f_fb\dek]^v`dgabc]_]eclea^ccfci_abac`ehbb^[edbca\bb\bfccdcaeiecechdac`c`dccdfcba\cdafcacae_baac_gdifd_c`fbc_eg^a`cgabacicabbeafhbbo`d`ectc_^oce`efaba\\db_^a\_e`b_e\]bkdcdb^adbed`Ze_bcccccccccccccccccccccccccccccccccccccccccccccccccccccco]TS[cPXinbeZZZ_TcTlkiZQjXdgQaW`PWSVNcbmlf`ihY^dZXkqccccbbccichcecccbbccdebedbbbdccabcceada``dcbbceaccccc_bhabfaccibccbbbcbdbd`fddcbcccbccacbdedcbbbbcabcabbefc\p]`\cZ_`dbe]X]db[]_Tcg_abg[_YU[dc_kd[f_^dgba|fee`fc^aXcbd`ccbbccbcbbaccbccbacccaccbaabbccncbbbcaccf`cccdbacbY[`bd\b`gd^^ga`gi\bZc]_c]\]`m`ag^\Zc^\iakmfckgeid`jg`\f`bd`bacgfabcec`cb``eachbbbebb_bbedc`_gb`ccdddbpcbdb`c^]YZXd_b^ZaVacd^_`_[a`Y_\YebdYg]Z\cl[okfg_dJc]W_a^^gbg}cbabYoR`bUbZV^d_T\ahYaf_`\`qi[fcj`lfgWapXUy`]df^Wia[]`g`edbcdbceecbbah]abc\^beaejb`bjgc`_bacfca`d``gc`_cdbci^Zfddaadalf`aca^fX_g]mfacbcb\`_j^`\hce^_c_cVfX\hja_cd^ececbabfnfecdcdcdc`]bb`ccc`i\d`c`ebcaca^cdb\d`chd`cdp`if\d_cccc^ftha_bZ^b_eechSfq]\eaai`im`eh_c_beb`jcagaa_i_cc`dc`Y^YcoScb`akdl\^d[h`clnaddgPg]dcejbc[q^[ad_]qZuvad_dcZb]bljYXf`ZiZZf]]d]]\dgV]kYbUb^kd_cj[]hZab^cabcrgd_fZ_k[Uda]UaaeV`__Sdai_c\U]hcYd[S[cm_ktohj[\a_jefchbfb]faafjogkf\`bkci_eh_bd_``b``fg^^bcbaageZmeflbffka]ff^]WaaUakUjn_S``barb`\jbc_Pbj_fkZX_ubdbfYbX`Yc]eU[`ecccccccccccccccccccccccccccccccccccccccccccccccccccccbbebbacbcce`dbhacbcbca^cbf`bd_aeafcbbbbaxb_ccbhcbbceabbbfaddccchbdaccbbbdbbbacebbeccbdcccdfecdccacdbbdbcbbdc^ccccccccccdcccccccccccccccccccccccccccccccccccccccccbcagcedcabdbd`bba_bbhcdcdae`^dedbdfdd_dgaedcgadfacbd``bag_g_fLmW]`jaaYibeWZ^__ZX`dW]hdcfjhk\\NidaceVhlT_[Ufccdaa]c^ebcbdf_cbacab`if\afeacbgbibkhaacaa`ahbddbbadibdcdosc`c^inY\a[fLZ\`^a]`c]aa\]bZbk\cbd[lhOai`W_ZrS^[WXYo]cbbcccccccedccccccccccchcbcb`bddccdcbcccbbccbccdcccddbaae^edajdffdafcgbchagcdcdd\babZ_d_hdfdd]ffdcbd\ddbT]bbd\f`haV\Sahj`ZX`fef]kh][`jLT[]bejcc__cc__d]`dbUbXTkZeZccccccccccccccccccccccccccccccccccccccccccccccccccccccd`bcbbbcfebicbdccdcbb^d^aacdbbacccbde``gbce`bcbbcfefed_]daf_^bfd]ie_dd`a_c^bece_beg\bj]]^bh`_pakcebaccbbd_adheldaWga\gng]eSmZcWbdcicYdiZmj^aj\lXebf[dZ`T[\\_ZYchegjKrP]U]^_[iWSVSWeeO\KH[aaNS?LqWaFPUUZV_K[\lU7hZPIe]Rcccccccccccbdccccccccccccbccccdccccccccccccdcccccccccc^b_]g_ab^ee`b``d^b[d`xZ^gZ]bd_g_h_d^akaach`vbjafb_f__boz`Q:VNWV|g[\ZCRY:sPJ`b3_jPPV[PDWg\ej_B^G5`\6fUpLD]R`_bhecfach\chefbbbcbeebjcbbaabcd]a`fa`a`jad^_bdacbddbejmbbacccbcbcccccbcbbh[cbcbcbdcbbcbcdbcbcdccbabccccbb`d^e\^aadbfgb[da^`m^da`jaidW\`ael``beg^]gaYf]]Yb^caca`bccccccccccccccccccccccccccccccccccccccccbccccccceccccccdhcbccccccacdccccccibbcccbccbccccecbccbccdccafcbccccaccXMaOjLYZOfWZT[SW[JdVcTYbdQjMPfLTgLNMLUBQIMUjPQZTPGNPLch_g]`_`bcd^g`bg^^_^\eehdccbda_dh_ed`baebdd^^ae__aai]dccad`accbbefdccccbabadbe_bgddcbcdcbfacbcbccfcc`eecccbade_eadecebeddc`cdcdedddbdbaccdccdfdddc_ebbcbcabcbeadebnch`^^T^`ch_\\\f\Yai_dcVjV]cYXkhif_^Ta_me^YXVYgZRa`_kel`bc^_t]cdd`b[cl]T`_jc]ae``\d`bf^dT`i^_l\V[ed__U]cfg^Paccd^d_[cpdb\ZcXQZ_XX_bbicc`b[ablge^fei_bde^ZaOZ^ZcU]cccccccccccccccccccccccccccccccccccccccccccccccccccccci`bbeg^i``mbasa]ncdaccbaddgcimif`iccaecdgdendi_bd`gaaeXne[b`jabrgd`^b[`bVea]\bh[`Z\bdcgfdhba^[`rcYf[ea\fd]`c]dbabacicgbc_baaabdcibig`bcdbfbadbdb`gda_ca_aaccbbb`aYlZXZg`b^pc[VjCobe_]dfWbdWThUhfcy^f_^c^]Ya`Ssjobg_fZ_dcddcdeccbbcdccccbccbbdcccaecccbcacbddcb`cbccbcedcdcbccib^]h`]d`acbdccaffddc^bees]bgjgdf[a`a\``a`abd_ddce^[inb]dfbcckc^b]a_^dmd_\emi]^b_a^Ygb`g_jcYc_eif]ei]h``]hdbbc\bacbad\dbdadaab]cce]cb_cccecabccadeddbc`_aeed^d^dec`Xj`c\_`eXdcg^`^ale\_XZbjYIcg\XlU[`]_bc\b[Ua^\`YeV\_\d\ffe`dbcg__ee_`_qfecf_Ze`_cbfadbcc^bacbbggab^`ad_feeebcccccccccccccccccccccccccccccccccccccccccccccccccccccccccbccccccccbccccccccccccccccccccecccccccccccccbcccccc]be`[dXabi^]Ybb\ihkjb^Zhe\mhd^gaakd]SYi`a_aifY\b`a_ekcaehcfdbc_cddibfgcdbca^]dbbcc`i\dabbaaaccbdbbecfacce`cebbbcebccacfbdbbabebdcbbbccbdhbecbbaacgabb`cbabcacdabebim[^d_mbVim[VSdMZdbXce\f`]Pnhnd``FUbYa^j\hbGiqPoc`\bVXaibci`_bcebdeihhdg`bc_i\efgdeb\a`akd]aeb_ca`\d`fa_bb^ebebbcb`clcgcacadcaddd_bkbabdecgbbca_g^eccbdbaacbcbac_acbbccacdd`^bdcieb`kgh_cde]]bfdabgbaabbabaaah_agacadfebjecqgdcb\\_Zfbd`\cbb^kgdahl`[\bYjcb_dd\b`aacbca_cb`_]`pj_cge_aX^abi`_fbebYsS_bbZa_`b\`\_a]le`e^dj^h_`_af^_`Zckeg___laVhf`Z\bde_e`ad_dbkddche\gebhbb^W`__bd[`da]h{beo_cbasdagbaf[`g`aehda^cd_ejlX]ebdamm`eaeb`cg^`eccfe`ga`fbbcbccaadbdaaca]a`_bgbaccgebbba`edb`}b]cbhdbcc]bcadccbcbcccccddcccccccccbbcdbdcccccfcfccccdcbcbcccbcccccccbccccbbccecccbcccccbdcbcbcccccccccbdcccdccccdcccccccc^\[_dd_eZj`bciZa[bi^f]Z]Ya_aXV[X\d`vY]\de^[a_]`]`_[geXfZN^^^gR[`f[chZVZc[P[fo_ch\nfcf_\b`Z_^pb]Z]i\[ad^Zoc_f^Of_m\baf_d[]``eh`_a^^_cgbaf^^`e]`aii`esc`_a`f_]cccec`cccecdcccccbecbddcddcccbcfcccccdc_bbbbbbbcccdccdcbddee`^e\ahebmaea`gfd[c_aeebaaffa`ja`]c_ea`edjc^bfabefisXs]T|\hcZS``U`KKAPiaE^^[MbRcc]S\emvwmNI[dWkU]c[RbL]i[X[k^_YXua`jdVtfTdoab^l`]^[^[\e`d[afkh__ZwfjRYddPb]j^_bddfbedafdada^jgdbf`ec`cabbfb]bfgffae]ga`ffg_cbdafedg\gbecbdccbcdddccccbccbccccccddcbcacbcbcbbcbcbbccccbccef``bbc`bcgbefbabbaac^adcc`gdebah_bbab^f`ab`ac^fdmcbacccccccccccccccccccccccccccccccccccccccccccccccccccccccccd[X\scc`Y_]oYeddiYlgbsoajW__\X\bi_gaegeY`rFa`Ydf\^ba_[ie\]hac`le[[k`U\`[e]hjfjgigc\k_c_ZeYda_\cbdd[\cd[ZbbemjcXaXbcPe`VZWgZ[`b[t\uY`Y\e^nr\_bsbWt_a[narmS\`crehpVahccobbcccbccccccccccbcccbcdbbbbcfbeab_bbcbcccc_ccccccag_cebacejacbcdicb`_ebfd`fa`bc_f`adgdddfb`dba_abcga_h`Yy[dcgmcV`dYQjHW_kbjic_f^q]\kWehgm\\cUjdpXtfS\^\XUdaXccccccccccbccccccccccbccccccdcccccfccccccccccccccccbbb`_dcd_n_f]^k_iee`ega^_`bcc`_dfd^aafdfcbae`_^]v^acbg]agcccccccccccccccccccccccccccccccccccccccccccccccccccccca^cajgab`d_jn_[_e_`dkWb`deXfahjd[_^e^_gcr`ef\Y``ZbpgbVdbic`cbcaacbd_cbdbbbdgbgdcbbdccaaabaccabac`h_^bebdic`fpbff`c`cab]e[agc`ea_g[_aa^`ce^`fd`]_[]^_cfiaeef_bef^[f]]a_af`hbhfbcf\b]bdcbi]_b_cbe`baY^\edbd`ed^gd]dcacfbdaa^eb^cbcdccehb`abb_`d_d_eaddbd^b_}`aacbdbfccababcddabeok\ibZfcccc_\wa_aaXdZ\Zcd_`_aa\ZbfXffa^[\a\aflZe\_icd[cbcbccccccccfc^ccbc`cfcfbcccbcccccccccccdcccccccccccecZW^j`^_adkc[_md_\qMq_b^YdbfX\c^_Wkpe]jYfarVa_lXZdZenlda_`cedcc`b\d`bgdbcmdabc_eccadbcbddhabea_cece`debddddbdacfa^cbcbcagbd`aiefb`^`dcba_ih``cbe`eabdcbg`dab`ci_baacccdcbccdcccccccccccbcccccccccdcccccccccccccccccdccccc`[ff`ebe_de`bdadajec`cg^eceba`hg`fb]dceb`cgddfadckca^bbffceVh\`Rd]g\^dm[V]_`bh_eSYegYWdc`akWgf`aejefX_[ceeqfZfYajddb|dhiba`[^cQ`h^cchbrdohbgi]d]^i^XaZ[ZUad\bo^decccbccccccc^bccccccbbcbccacadccccbcccbcgccccbccjhccbccf_RaV\^N_z`VpRXUz\`XeReYwmdKnQ\\eZcY_O^YMnb[IxTY_Pc]dWaffe`bbcbecfccccdbbbbba_cbccbcdcibcbccbbcbbfcaedcecbbbbg^bgdbcbcagcbb_bdaafab`_bccbb\c`bbtcbcpcebbbcbbcabb\cb`e\fe_cccgde```abbdcUc\afdb^bebaabfa]gelai`bc`gbc`^c`caacbacccbmaecadbcb`bddabgbacbcbdbbbc`bac_ccbcbjceeid_hdb`gacbbe^dbb`ebdccb_dcccaedcbbacabdbfcbcc`ahecdbdfh`bc`ddcfbc_c`ebbbcabcdd`bc`dccddbbfcadedfccc^`dfdXdaded^hafgcefb`af]]^a`cdgcded_cf_dldca_d_ciede\acgegb_bf`i^f]`q_haf[bfTac__kRy_VGPbpYW_ab\dbpWYk]fnR_gV\W__U`wqXcccccccccccccccdccccccccccccdc`ccccccccccbcccccfccccdcccccccccccccccccccccccccccccccccccccccccccccccccccccccak\_i_g]ge_anpp_e^^a_agbecf]fe`kVgef^]_bb]do_g[\hda`cl^j]b\e_bcm^eTjR{cXY\[\fbejj^kjS`Z[e[jXe]V[epZ^df`WVbkdabcccbeaccchbcccafbcfcfbdca`bacabbabddbcaedbacbc`befa_fbff^bb]delc`ckbdd\cc^^b^eed`dgdc`e_ac_ib_geaccabhbbbccccccccccccccccccccccccccccccdcccccccccccccccccccccccgd]b]Z]\oca`e[uli`dob^ddhffnebcaap^`ac`f_ftZh`^dZcr\b]^ac]ckc`fhbWX[dak^]]c^ea^jQ^d`fc_^s^dlmc\bo`hT\`ljmYjQ]ebaieghmkg_aYgaccb^bj_geYfigcXijedYal]a]_eaa\`]b`jjVjccccccccccccccccccccccccccccccccccccccccccccccdcccccccakdadacaebbdccdc\c`_a`ddeaa_^bh`^jjabeafacbie`cdda`baaSc[cWbZbW^fiSch`Z]caqn_g[VTa[oQZ[x\aecfd]`_^q\TgY]Q`mqOvf@_KFTYLfx4?_Rw_f`Uihp@ldRVl__;H]fw_gp`gSlu\]ZZFU[Xcccccccccccbccccccccccbccceccccdcccdcdcbcccccccccccccccbbib_eiafhbkc_dbac`bdd^cb`cbcdefaiabbec]hdc\]jec^lhe^dcccccccccccccccccccccccccccccccccccccccccccccccccccccc`]ccf`cckg]^deid`gee^`_`g`jd_b]hkx\^a\\bhbcc^ce]dee]enccccccccccccdcccccbccccccccdccceccbccccccccccccdccccccbkb\f\\b_gba`^`jl`Zia]dca\gY]]f^ggo\bb`_^^adp]`d`s_Zeag\grb]]na_`Z_he_oYfjjacbgdY[`ajd]id`fd`hicj`afgfZkij]fMWSXVA9kuXRXUFGm\]BdE_d]>aSHWmSUEMjXdS5nghXAZWJf^aTL^a_cg^eddg]e_`adfaWg]^fceb`eg^bafbip\kgbb\m\]^dhbsca_]cbcccdccicdcccbcccdadcacdcbeeccc`gc_bfccc`ccacccbcccbcccccbbccbcdcccccccccbcccccccdccccccceccccccccbcdcbcccdcbccbccc`ecdccaccacbchcdcbcbacbcbbbadccdcccfcddbccccf`c]dggecaaf_eg\c__gfdbafedcagbea^gii`ccdg`bdabc\c^ccaffdcfaacccecfbbccbccacbdgdcbcc`accebdbdbccbccccccdcedcbbkZa_egab]fZia\bape^b]\bc^ibce_cca]_i_```idf]ii^ha`]gZa^X[g[]p^\_euXUeaXa]eiiefddcTldddlb]d]ce^fZdke_p\bd_]_ac`cbadbcafbecbdcd`cccddbcbbcec`cacaadfjddccdabcbcfch_co^`]Zhaagaca`aa_^`bdk_ace`dbfZb`cjg]f\e_fkb^n_cdgabbd^abd[fXrr\a^_[cbf_a_]]_g_c\ca`ck\W\[`^_f]Vre^fea_Z\\Yccb`ba`^a_bi_l__]e]`dfi`lYh^c]_cXaa\iecl^_eb`bZ``a`]\h_cagjebbcdcgccbeddccbb`baaecaf_f`cbacba`ba`cb^eb`b`bhc_`bba[daba`bcjcchc[_b^`ccc^de`cfbbgci_bocagaf^df\be_bd_]cacicebog`]cgg_ik\ba`fcbcd\aeggi_^cgcc`c`bj[edb`\_d^cdea_ck\Zc[a_dudhX]]YeiZdk`_gfclU`\\[amac_mxYcuW\ibWfhtcm][[pb[sf^]siTjkh`\^\XjeiW[sa_YVLX^f_Vo_bmfe_\`deZPlfbpg``c__^b]caTicba`nab`[ZkYekffcaYiYh_hchc]ldQe`Zsclbbcbbcc`ccbchehcbccdabcbdb`cceccaccbbeacbacbccccddcfdccdZlaaiajeacadd\^_c]`fi^gZbh^ceaZk_ffh__fcafggfk`]_hk`Wc]^ad_bbb|\d_ddeYaeWaj^`kgaZg]\^_adgb`g_dek`hghcYagcc_^adccdabbfabagcgrabadc`a`]`ha\cbb`_abf_}`___bbbihabacf^ccccccccccccccccccccccccchccccccccca_cccccccccccccccccccbcddccbcedcdcdcccccbccbcccdcdcbddbccccbbccccccccccbcfbebbdbcabdfcbda_ae_dbcl``dc^ca_abicdbab`gedhb`bdd`adce^bec_cjdbb_\ubc]ecbfggcgde^fXcmdbccfi`cfeci^ehhnfefheacabgcccccabcbcbbe`c`abbcdbcfbbedbbdbbdddacecbcccbccdjabbcdfccebbcccccbcccaebcaadcdcdcacbbcbbcdac`bcecccdaegcadcbbbccdbccbfbcdddcbdbcbedab`ddbbbcbcdcccbbecdcfgcceccccccccccccccccccccccccccccccccccdcccccccccccccccccccbe\dd]bbcbdhcbadcbh`bbega_efdbddcdbaba^cbcad_ddfcebcbee_]Z[_^b`b[b_q``^b]]rRZbb_a_ZZY_e^rklue`hZ_[X_]]h]]_crafdbgbccaaf_cchcceccga_ddbbdacebh``_cddabcecbeccc^bc[hbc_ddcgad^c`eaabb``cdd^bcadccccacfdbcddgccb``cedXb_edddcaagdbdd_]]sba]b_gn^]bf`[Z^`_YabYd^llbefdakgbaagcgk\g`ej^c^RelVa]dX`o\\e^`[djlY`]^ZefYeijlbkkbkZPbd[_Yh[Z`[bdda`cbccgeedbcbcccdacce`_ccbbbbbb``dabdccce`daccceaecch`dee_aje`gc^dgbcbec_acbccehecmfg_b`acdddc`_ed``ebc_bdgU\_b^a`ba_aa]Zdh\fZXch_^Jh_d^T`b]ag_\`hbXZ\\^[^\hideed_cccedgegccccecd``ccefbeeba`_ccaacaabcbaabcgcdebbcabcbcccdbcbccccbccbdbedccbcgccbccc`caeccccccdccbcbccccbedbbbccebbadcbcbebfbbcccabecdbcgbbbcbcac`ccbbdecbcbdeR_`ab_ZmgogUfwf]\]ence\feei_d^^_abcetX]`\]bjbhkWghodf\clYMPj`i\maaai[ZYo\Wh\Q`ja\jgoj]_TZ`cj_\_]Wbo]EcgeaX`ddU]\\Y^[fbY_[VESY\WWX[\^^\b[IQRYTXVZVZ\VXYKX\R^XXeUTckdP^lX_fub^gcgs_W_]gi]^c`bkXnjQPTku^Z[h^g[[bYbd^d_Xp\c`_hf`cb^_oddag`b`]_e]\_e`jc]`\ayf^W[]q_b_aZ]\V^cae^[fo`fggm^`[d]\_a]aibsefZabc_eacYYp\n[^_ZadkiXdgc]f]b[b`Wd_ba`d`bafbf`aca`c`^dyi``ba`ce^b`b``bdbbfcbcg`abofcch`cbbcbbccbcedecbdcdbbaccdcecdecaabbeaebbab`bbbebccc`bcbbafcc`dd_cabdcde__^e_]hciah_a^hdde_aac^eadbde_gbcibedg``_a_bbcb`a``bbbbbbcab`bcebbegabd^acda`dbb``bfacbabe_^b[w\_^b^]\cbi\_h^\`Xb^_h^c`n`Zdm\o[r^f_aeaW`h]f_cYXak__h^l`cd_cb`cccabdu_^_edfbjan`ebX`a^ab^geg`Udbiec]d`cdb]_baacbbbbcabbabba_gibaabdbcbbdadfdcbsai_eadbahbdadcfccccccccccdcccccccccccccccccccbcccccccccccccccccccccccadcpa;MTXmceASVXfRk[lH`oqCjRhIhLdTeeckaWdkbfU^l]dlHOUfcbcccdccfbcdcbbbcccbdbcddedcccecbbbcbbdbcccceccbcedcbbcccaccccbcdcccaccccccccfccccccccccbedcccccccccccccccdab\^[jZXbfi_Ecoga\\c^oa[\]ff[n^`Za\rv^X^f]dcj]`jeaf]\_vcccccccccccccccccbacccbccdbcccbccccccccccccoccbcccccccUlg[ae`]VRho]b`Soa\afdg`cgjYdb__ea_cega^`]n\^_^g_hZ`e]caace`bchgcfcbdecdbb`bdabadecb_bjbbbcabbcdcd`ccdeebcd_^_Zbeaib`babbkcbofedhjdab^bbi_caiabc`b_bb`b`[_egadbahcdfb`kbbb`d_cha`b[abcc]c_agba`hcigdad``cahdc^b_dibbfcba\fgagmd^keg]d^e\^``Ucgggcc`cfg`ikg^`_Zc^a^]h[^geYfd^i[jg`dj__b`_dj_cX^gdc`be_dXahdg^yb`b_fb_fah[`\^Y`]bihd`ccccccccccccccccccccccccccccccccccccccccccccccccccccccc]h^gdc_dca[[e_mkacZq^]e]`kY_bccg]bda^_^_c`g]dbcca_azfa^`md[eccdcbebbedc_]_c`f`cacb`dbgcjfbdadaegfl_`bcdaedaai`dach]dabe_c`a`a\^^_r_Y_c_\id]de_bea`_\a`d^_g_aajb__Zfafdd`fo_\afaXlblmiaa`cdadS`ddffagdfabffeciaafee_hdldcb`cbbcccdecfbccccdbce`dgbacdhc`cacdadccfbbcc`ccacccccc^Va\e]fb`bgkg]beXpjZadec^^opc_cgb_aabaabfd\ka_ieffX^dobhc]a`rcb\fj__c]bfV]k_fqo^ieabddfbkc`bdZ]]^]_]bibffcd]f]eUiho``efeZk[b`^ioa]eZ`gcg]j`dXh_oaZdXb\hcW_[l\`^`aibcccccccccccccdbdcccdcccccccccccccccbcdcccdccccdcbdcdcccccccccccccccccccccccccccccccccccccccccccccccccccccccciZcd`cb_cib_^adccXeXfbp_df`aabig`aea```goc__b`n_Vbfja]k_]^a]dhf\o`da_aYnccbccsbf_^^Ude]l[bnaZ\ZWp]_Yaai`le``^ia^bgbc_dbbdedegcfhYceeebajce]bbabge`ahddabbb`gce_]eRPZW`sZ[[`degqfjo^d_aWaeWaOqdkhcPW[ee``wVscP|^X`__X[bea[dabc_cbbaadbcbbcebfhcbcibcah`abddadb``e`feabbedcebbai_c\dccaadp^a_ZZiaab[Wdk]c_cf_^jXae^b_c]fTclfe]i`\i_i]ccccccccdccccbcccdccdfbdcacbdcbccccbdccccccccccdcccccbcbccc`ccccabbccccbbc`acbaad\bcVcccczc`abcccccccYcac^adbdccbbccddcgdccdcdcccecea`cc`cacbcbceacbbaccbcebcdeedefb[efh__]`ffb`cacdbaf^^ie_c`]ddba^b`a]ggoijch`dcc_cceaaaddaacceeaieaccbcad`bagcbcbhabdcdbbdbceabdcaccabfddacccccccccbccccccccccdcccdceccdccbccccbcbcccdccccccbcccd]eaq[eb`cefifbfxb\j]h]Xil[]\j]gaS\ZZh[gc`__\_qbj^^]a]^mjY[PNQaX^Tbb`R_Yb]M\Wc`gQ]lfbUXK`gf_`me]aTbeHnXddZiR_gd`]`S`\bSaa]__d_b]eza]_d][]Ze[]c\^ba`bT`^qmbbb_a_dja^ebca_ficecbbac`cc]b]bea\fdf`ba]g_eg`_eaebcfcaabajbbacccccccccccccccccccccdcdcccccccdccacccccccccbccccccccdkcRfhX`Rn\d]`geW]XXY^ZbWWac\WYZWa[]][Ze]V`k\[[U^]ZZ]aad`dbccfgabccbcfb`m`defabb^a`bdbb`abdabcadicabdcebfc\_b`Y``bjl_V_o`b`]kabfjtc]R_[b^]Uadhm`hd\h\Vftdfbg]\\_[T`[Xb[_ecbbZ]a^\eh`d[`hbd\\[\^ZXc_c___bebpi]^hie[Y\kccacecccbccbcccccbicccecdcccdcecbcccbccccccbcdcccaccccbccccdccacedcbccbcebaddacaccdce`ccecfbabcbc`bbdecccbf`]afb_gbbf`afacieZg^Zg[kegaccablcbZd\jXdca\dcdibaafha_efihcb\[a]ac`^\mbeX]]djeQe^a^gacibki^c\a_cjd\g]]]`^daemaabcfeccdfceeccccccbdac`dbdc`cce_gdbdcedcabcbbbcccdcadcccccdbcbbcccccccccccecdccccdcacccccccccdcccbbddcbcccc``ecacccecdgccddcadfd_d_c`dc`cbfbbacedceccacdbcbdffcbecae^iYcafefe[`igg[`eZc`Y__`\`hafgga\bbi_baddgeYchaldbfdp[TSah[Zab~ygW[h^_WZ_Cgc[S`foebb\_k^[^TXZ`\q_Wdaj\agcaj[efdgcadb`cbb_babad]bhefdebbebbc```bbjeabaacdb_ebbfdbjdccbbcbbgc`bbaacccibbbbacc^cbabccaacpbbabb`bbbcbbdbcfdccdccccccccccccbccfccccccccc`cccccccccccbccccccccbdce\^bgaab^bjbcd_a````aha{[`ad^jbbc`][fbbgbaeccbb`bee_flcccccccccccbcccccccccccbccccccceccccccccccccccccccccccd^iaaegda_gbbdeda`mdafka_cbaa]e_`a_fea_abgha_becde`eeeadbfd]bbadiecaabac^a`cfgg`gfdadc`bcdd`bcaabf`cbec_bbabadcb``aqcbhbebbbgba``hdoafab^ab^fcaecaf`cbaaa_b_bdaab_swnc]ac`bbc_d^gbmXk^gYXb]e`_\cegQYd^gb\bc`cZbc^eaY[]`[bdccbcdcdeeeccdbccdbd`caccccecbcbccbadbbbcccbccccedc_c_ibaababa_g^dcabcaa]eggpc^d``_^ah`_]`]ef_eedahd]`\dffhe_ahc^a`lnfjdVjcc_g`]dof_Yl]bYcdb]__jd`i_vajZab^Nghh^]`id`bb_cadeeabcbaggddbc]b`cegb`dbe^fg[dabfabe`cdcbd__oc_[apfecabc_ga`dc`d__fc`bbccekch`^bbbcifbhbaW_daccgcbbqYgjfSYVaf<[m[Xg^shZ_Pf^b[O]fvXX``b`ede\X`\U[_^`d^fedCiaa\dp^Xifec^jOa`^cdbc`_ah`r][ecdZfc]aedhOccgacdf`d\ega`acagbcdd`abd_fabbdaacdj`abdbd`debdfce`arcaebbfbcbba^cdgc_bbcbgaddccccdfcb_c^cbdeacbcafbccddddbbcbbdbceeccccbacadfbd`ebbccdca_cfcacd`bdcccb`ecdceddbdb_dcfc]e`cce^f`_le_a_d\aa]_d_dahgb`[\abdb\lb^_^V_eb^bZ`cccia`f``abigchb`acfc]ca`cgebbb_Yd^ch``\YjZm]h_b]hj_]ccYilgjgb_\`gafcfacc`aaddcbbbcbbbabbbabdhcdcbbcfebabecccaccacaabdeccccccccccccccccccccccccccccccccccccccccccccccccccccccccbccccc`cgbccccccbccbdecdccdcdbccce_cbbcbdccbcccbcccecbdccc[bafffc_`bdagg]abdbeded`ga`dbgbcadd_de^dgekebca``cXbmceb`cicdbbdmchbcce^eebbaaeaa^cbdc`ddfbaa_ccccf_bc``h]`eXbjd^dk\lh]g_edfakkiedidjl^d_[_^[fadb\]_dde_]b]acccccccccccccccccccccccccccccccccccdccbcccccccccccccccia^_d`jdcbe\cacqh`fadW_caf`dgcil\`dda`ae`^`_ai`eg`dgeecaaabcbabcfbacc`ca`dc`bbca`g^a^aaca^afnabacbcgcbbccgdcbfccccccccaccccccccbc`ccccccccfccccabccdcacccccaccccecbeg^cbccbcaabb`g`ep]ab^egg_b^cb`ha`e`l]df^daf_fcbf`bc`cecccccccbecccccfdcbacccbccaacbbbbcbbcdccbccdbcbcbbcecbei`cecg^``dab]bbahfjchabbjahbecac]^agia`a_gdf``caea\blM`bf^^bghd\fcejbgh`_ggh[bY]h_``b]e`_^dcX^^Ycb_j]k]ec\ZPMVQbU_b\Tdf^hffk_dROga`K[U[fczgUe^uxeI[XEcd_cZcRTi[`_^dceac^dad^aeakaf_hfchbbf`k^e^ga_oc]`e_jfcf\ckca\k\`iqbk_nbY]S^RXh_a[ekWioZ`[Wbb]]d_[a]kahff_Z]fk{W[d^Vdgb_gcca^gcceci]^Z]\i_ca\`fi]_ce]hgjZk\fb^ZbY\d\fgaecdm]d_iSRcsnXO_eajn^ohaTb^a[ebYShkbafl[kf[Zj[Z^RZ]Y]dbWT_fkh[ghe[f^cfj[fa^aZaWvciaaeatd`hiifYZgZY_bgafW\X[fb_eb``m_acbam_ZfgZ]\hhd`Z^eYXk^rp[``bgch_r_`_gd`^afcak]ebebYccccccccccccccccccccccccccccccccccccccccccccccccccccccoba]bc^da]dcdd_ac]Zag_cg^aY_mW`_g\e]l\eg`b^acNggafn_]fca_jbdpeYnce[i[b_bj]_fd\mgeShcdZebifn]\]_UehZbe`bfifZccbdccbcecckbccccccbbc`cfcbbcacbcbbcbccccbbccbaddcccdcdaYaY^z9VSDY``Ma`c[JdNU`[Ti]pY^heefc\_]e_h\hi\`[\M\bZ\dtgecf`f`b`c\]l^cbfaa`j]cbbaea_\c^\^\`b`ZZZa`Wk^]b_[be_ehcdbdfbeac__ab\jd[_Xj`d`h^__b`]_Xbidcg_c\dmebg`d_cliecdabebbcfbabbccdcbdcc`bddccccddbac`fddbacccbdecdcfbdfcb`afdabc`bcfcddbacbc`^becf`cbbgegc`ebdedccbdadgccaecdbkJdedX^lb^f]eY\b`b`YfcafYjZbMhdhfaYXZ__afbYOlW]]^]`]XccbcbbcccbdccccccccbcdcedbdcccccecbcaebbdbcccbcdcbcbecZ[_bfdedghceefZ\c`cbhf^fdea^fgXaf_^ed`cab\eefb_g^hXZbgbbdf`bcccbcabcbbccqbbdcaccccbbdcebbabbdbdbcdbebecbccba``fdkaaclg^^cbafad`ba]c_aebd\`d^b]g_c^clgaadddc_chiaai^eg_bZlV^afYd_aifdYZ\\`g^`RVfh]^gfdddSlbbgkLgg]`^Zjcdccigb[cccba^e`dkcbeb^dicah_gdbZfgd^ba\gfabjd_\bfd_fhcg]]_bdbdZbegfdc_ea_ddfc]cc]ebdZeaddecbid^`_fdhe^hbeebdc`cdcccbccdcdccccbccc`ccccdcccccccc`cabccccccgcdccccccccccccccccccccdccccccccccccccccccbcccccccccccccccecccccclbf^fLnZX\^[canc`[J]^fZdZ]MW`cbg^o``fNmaqioTeeTd\XncfecccdcccccccbcccdccccdcccccdcdcccccccbccdccccccbcccccccW]Va]|nQ_`bfS\`[\S{]Zlf]`Rogd`faUc_b`[Rcag[]\g[^Tdc^l]ec`ZcjnXZYfejwUTicTkbh]\enadeb^RbZg\ae^UZYV_fYeaekW[gjf_]affcb`b[__ad__fa`fj_ebZ}`hc`cdc`c_ag^ald]fa`ha`ea_btbiTl`jZXPb\^NZbmmdifbWifqP`hebt[bcWgh_XmZYYhYnbfbjcj[bcccccccbbdbbcbcccb``fcae]dckbmcffcb``af[bebebcgbdfd]`l\aj`bc_c^_bc``g`^`c_`_cZaa__atfgh_c_bew``_[_a^b`[a`_idkgddccc_^]ecca``be]eeipeca]daaa_[da`b^`d\_c`daahdadf_cbfbafcce_e`ddc`aggb^b_e]`bbcaaed^ee^abjbgeadeebfdaedrncf``a[Zo``agaNfd>e`Ta]\\Kdhm`j`^Oade[aZHk`kWk`U\geRiXM`TNYY`afch`]XT`Tm_dUTcYWOZiWYc_RgKnTciWmeOuOWbceYXfgaedhd_`ceacbfbabacc^_fecc^f`e`da_`echfb`a_`fbabdgc`efaRBhcdVKTPd`l]PimVaSehJfiii`QjO[QaSchcXlhl]nbZl\c]ehQ]Gacfbbccc]fbdbkc`dkaf`c`ddaccaa_cbcbh_cacbccb_ccic_`bmb_T[U[cY_\k_dZ^`]^c_W^`_d_b\db\_dbUZ`V]hT`Y_`\\^x^^]^gakgb`aebb_jlbhlfj``ejhffabedeh`egf[^d`eeaia`adcaeTbb`febWYb^bac[PWgYzddj\_bYcYffjdhlT_WRde^eUZcSk]H]bn_l[`cel][eacaZc_n]bbicfifhZ^a\effb\bXfaa\c`enhceYj`ShfcjeSebel^a^d_gl__`b\bai`be_fa\a`^cgga`[]_eaf`_Ya`_bm[hZ`_^Xa`lf\_\_b[^[^a_^bb`\`_d^hbbbc_bc_]e_`{b\^a^`[b^_`^_fehcahcad_eeagde_acdemecdZbcachf_gbc_ed`ajhmcda\Yabdgccfcqp[V\cU_`MkQg^[UihY\]t\ITdUK`F^WbO_lUpYa\cUWtcW_WH\mkmVbdX^h^blhg`^dYZ_e]adibfh]bqZc]\V^Sdin\W][YYf]Rh_b_\Zdaba`deichfbjcacdace_dd`gba`acac_ccgbcd_aaa`da]d^bf_adbcRdeo[_gZaibft\Wap^\g]a[]Z]c`ei_Tdagfwae]e_^Yw_j`]akdWcbbdcdccbcbdccccbbacceebcbcgccbccfeacdbbdbfcddcccdbc_a`a`b`adb^bb_bgcg`c^^aW`[bx_c_eZ```ds``g`^^cgefayeme`a`bcad`ddadcjZ_`_aa`cdkd^_\bb^d`dfian^acfleaae\_maao`b]`Z]bjd^ckTXhRnpa[krZ_cZt[`^ddmZexbschUY^_baEfVOaZ|dg`^ceab``adbdkcabdd`da^hgdeeacbkbbbafccbbb[``bae_becgcb\]_aaabobcaa`fcec`a`]ebad]`bc_fdecgbafdc``dYbd`labccaccjS_Zj^WWd]^\SaS{\X]z\k^d[^]Xer[b`f\wPnfb`IN\^n]^\Z^ggWe\jXgeica_aid`fbdb^fldd`gecd]b_b^a]ceadcbg`b`dc`babbb`cdccaccccdadcacbcdcccbefb`bcebacdcbbgdcdcdcbdcddc`dcbd_dah`]a[\l[aa\^g]\jf[\]da`h^T[\\g_k[m[`aV\`P\`d_^^ba\feW\g_L`d^eV\X^Yj^^`_W_fZb\[cwbobcYc\VaigbZ^d`^^bXU]h[cbccgcccbbbbcccccccbbbcdcccccchccbbbcccdcccccccccbccbdcfedacccccccccbccccccccbccccccccecccccccccccccccccccdcZV][eSa\VQZ_f[QWZ__ihZaRL[hxrNW]\_duZojY[QXmZd[Qdl^maffe_acc_cdfcccaccbabdbabbfdfcebdaeahcacbabeb`cccbbdbbbhe_ab`che_^bbc`abbja`ec`^fei`b_dha[_dcglcc]bZgekdbbf`bZbebm`bfe^dmaaf``fed]b]b^dZab_bbbb`_``lb`c_^ecnp_gbg^cp^\`a]ae_djac``bc[eci]ai_`b_]_e]^^fbcfg_dc`\eb\_``__[acYa``b\eefcZiZY`dWbbfidb_nfddcZdc\_d\fd[fejmfhac`X__e\[hdbgdcchcbc\fchaeca^dcbecdf_eedeacdb`cegacbce`bf`befV\TocZ^jXcfb[]W_hYY\_`][_]v[jVodhcsf`v\d^b]YU\a^`V\vb|bcccabfceiag`bac_ackm[ge\bee^`i___^a``od\Zal^eh^adcg`bebb]ef^e\^`][\\_m^a_`gbWZh]cW[bsdfYje^iab`gl`c[jZSahejZZa^e[Zc]yc_f]bbifZd]`]WcaTbgZVaaca_gcYfbfU`Zida^R^blVaaaagcbhdccab_ce`ecbbefabddcca`abcc`da`didbdhdgccdbddf_ccc`ccccccbccccicbcccccccccbccciccccccccccdcccccdccbcbcl`^`cdac_ja_^baajdc_bqc`labbhic^dZgfa_h]\jd_a^e[ccc]_a\decbfba_dbagecgce`[f_bdadbfia`_b_d`kle_agccdiccfchaiZ]fdc]bh`ca_c\b`cfe\egnd`id`gX^e][_dh^c^ib]kmgZ_fb`c_TbNgYXqboZlbW`d_Udr``^W[g[di[^^\Wagdh^eXdqz_dYcUn`Ykaof_o^ic^bihc`am_`dg_a``\c_bhdbhY`\aoWi^pg`lliZ_a\aa]_]bbbdcfccccccbbccbcecbcfbcbcccbbfcfbcdeceebbcccdb^cbbbbb\]b_``dbq`fa`ibasjh^ae_abg`egg`cae_`_e`_a[_d_[^bbdt\a_gbcbfhbccebeccccfebcba``cbddabcdbbcaaccdbdbbbbcbcdbddcm\a`Z`dc^abcbbeg_e^^c]f`c_bda]amffd`dai`]]a]dd`gbb^``dc_aij^[a[c`]^]_ed`cf`hddbd`cbiefh``\`jhb^cc[dX`e`ecdeod`dgej_baedc_`fg\img`]_bebd^]hb\]\c__a^cnecc``idcha_`bh^edbgLX\Ydf[Z^gcdbbb]deceYW`bb`dbbda]gfcg^`_ac_``bcdV^f`_d[\a\eafd_a`chcZ]nbdag_`cga_a[_eflge_]a_kZ`cfkgZ`ccnelcef`a`acdaccae\cbadccedhcdd_adacce\cbcc[[bbdef`edbb^b]aj_`adbg[gmfb^ZZgd]dhbehfcedgbheYe[^`jhjb]`fbZ^^e]mbdwbYYb\]fM\XkSXR]g^[zZbaRVTbbfbY`ZpnYahsKbdhbUimT^gekgZ`f\eY^]WaX^]p^`ca`YTVa[iY_htihdki`e_fb_ncd]mW\ah]Tl\iiiWh`^b_]VgfdcX[]_dcc\Vi^c\lTdebh]ika[bg\_]gOf`d_aZdah`eccg_ea`fbecie`e]if^c_^`ck_\c`kcdddd_g_]aba`edff`]eecdbc_gd^acaccbc`fbfdcgebhabhaabb_`]acbedtecdccd^d_eecace_degbbb\bafadc_cbcbgcfcaab`gddbc_dcecdabedabccffb_fcbbfc_Xecabeccadbkcbbff~dade`faabda^\bcdadeb_eec`^bed^dfdbcbcdaeccicabbaabdb`cbbbqdacb_bbcbeb`b`abbdb`edabVed[eea^^^``yd`_`q]f|k^d]`]hX^[f^_^`aY]]b`lb[`c`]``jk`dhbadbccc]aa`fcdck_eacc`fcb^jedceacacbfdfb`_ddccdaccalYcZceec_[hXg\|ab\]nc`_ihdi_f`i`_aZ\coaY]ZWZmaY^_Z]^gbbgcecbcbcfccccccccbdbcfbbcdbmaacc`bccfbbbccZccdccccabw`Nl`VRdb_eR[bWQ[m\US_gS]QjV\\HwoKItLgY+S^`gU^]bctoZcccccccccccbcccccdcccccccccdccbcccccfcdccccccccccccccccccccccccccccccccccccdcccccccccccccccccccccccccccccccccbcccbccabcbbcbcacbbcacgcacdbcfcbcbcibbcdadbbecdccbccca`bcadcbdedccdbbdcbbaddccacddbcccbabheacbcccfacdccgbddcccdccccccccccccccccccccccccdcccccccccccbcdcbdccccbcccbccccdcbccebccccccccafccdccddcbcccbcdcbcbcccabbccccbddigib\bcclb]_ar_cababbdbfce`fg`bcgbef`acbbZadibcabbaac[dcccccccccccccccccccccccccccccccccccccccccccccccccccccbbabbecdeebbbcbcb`akcacgcapbab`abfbdbddcc`ccacbbccdad^ccbg]dcbcb_bbbccedhaaedga_\dad`bm_efae^dcgc`abbcc_cegbc_cbcbacgb_dbdccdbbdkjcbcacdad[ceba_ceidiacb`bddcdbcabb_cb[d_cdcgecbdbbecbanbacbbaaaa`fb``baacbfcfdaccdffbbdZUdh`gdmK_Zkff`jh_F_iad^saJgfbc]fmifg`nedN\f`Vbib[bTdfak\\ca^f_\[ed^bcaac`d`cb^`ad_bb__`afca`_`db]_`a`abeiccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccaccccccdccccccbcccccdcdccccccccccccccccccccccccccccccccccbcbccccccccccccdccccgcccccccccccc`cccddcccccdccccbcccccbddccbccfacfdcgabccacacabcadcbccbcccdcgc`ccdcd_bbgbtdehdgdc\agbhcdfedac`_ceXaa_^cf]ccb`d`c`\d_g^^`egfebeZjdi\f[dYreoaaUe[acer\]p[bsk]jbb`]X[{ZaQbdl^^rndcaZ`bnbbbdfbadcdbdeabac__bpeceUa`_`maca`cdabf`_dbbn`afaadac`ccebccccadcceaccbbccabcbckcoabeacbdbbbbbccbcbebcceabddcdccccadegaad`bbbfbfc`cd_gaadcc\ecaeddcd_ebdeccdgbad^bbccacfjdccbccabab`\bfbccbb_bebd`lddabbdcbfgcfdbbeXrf^d^a]e~j\e]Y^`fUc[U]`Xj^efe`ZcmcbbXcqTedgjGj[___Ukccccccccccccccccccccccccccccccccccccccccccccccccccccdccbceabfcdcacdcccddbdfbc`chbce]cd_cdedh]caecbcdeacdbbd^l[\n`\\lsgZdW_]_]`eaafgod\d^aZhdk]eTi]g\gVY`Xfi[jbZm[c`Ybafbccfachbdg``c`_Ydabhc_cc_y`_aa^dccbcgc`aaec`dkb_ee\dbd_]_hld[^\\ehfV]]`cb^fbcb\fifcreZe[fj_^^dZZk[\`c^bYach_bmc`[\d\mfZdbebgjh`dgahc_bk`S^YWiracaYmdbggaf`cafi[agb`ecc\egacX[_n^xa]f\]_[blZh\fh]d^ffac\jhb`i_Z]Uja]`j_[`ea]bbaiiingadobc][d`d`dcdlhii\fdnbacdc\mOf\aeif^of_]a]`afdmc`bX\]_bjghch_`l^fe`pja[fkmicfi\[[ae``[bbcXaR[`S_YKao]blYXJUcQmV]@Xg\X)xfIXjW`lfhidgZl`Oei=NViRf^dcb`bee]c[gcffaff^ecb_c_embaaih_ba^eaf^jejbda_ebbbeba`^hkPMl[Yc>]hPd]UgmH+mb]QYbk^NJiNDbjXmf^aO_loIaTC^P`Q[ZT\__a`\]abbkXa^`Vk_\d_Xlm\`b[g^ffc^babbgao\_[gd^fada`^[cdb`ccccccdaccdccccdc`cfcgdcbcccecdbcbcddbcccbc`cbacfc]fbbec`^gYedaiagccdgccfcde`fb^^egc]a`adde```kedbif^cdgo`hegXfppacf`afdghfdeWbi\g[Ybdd`eg`\^^cie]]\kbl^^cd_elihZaeb`b]`eb`j_^_a_da`_[am_fca_h^`b]_h\\c\f\[`_t``dcbhkaaedb^^bdhfe\hdeacd_fe\ccadc`ce`jd^_cacd_`cYZdd`bf`a\akb_\h\bdcbcga^efc[]abmbi]cb^`fe[`^m`^^haclccgalegb^dan`Yc_\{daf_[`_g_]`]da]`e_X]dbee]`b]a\^aVqd^Z_\^n`h_fe^gdfc`e_bcag\dcbbc`[d^chcddbabc]el\bichecab[arc`ic]^_jbe_b_\bac`gdahb_`bcbifack`fbdhdea^b`badefa`bd`bbbdbbb^ecccccccccccacccccccccccecccccccccccccccccccccccccccccce_^]mU]`diaZ`h\bRhh[ieUc___ccff[db^^debY]okkh_oab]__hpccccccccccccccccccccccccccccccccccccccccccccdccccccccc__bceabcacbiadccb_h`ccbaf`edjbecded_came`aac^e`chbeabbbdZb_ebcbcbacchcagf`ahfhc^bd^cbemgadbc^bd]`bcbbadcmbebef[dj[`aZdeXgcaceb_ah[e^deeg]cdjZajfjkd_^degl__`a^^a_gecc__\`bddfe`kaefcg]g`cbc]^de]cfbfda`[deanba`eceajbf`eccccccccccdccccccccceccccccccc`ccccccccccccccccdccccccb`ageccc`df\cbdbcfab[jdddaecccbc]baadgdbcddeacbcci_bdjX}bgb\^Vgbcb[_UbZf\Y[jlnaXefkeg[bb_jgddf`Y^Tgid]b]bhohcbbcbccbbdaccbacddbbifah`bbfb`cecdaabbbbabab`accdbfedcacccdccbebecccccbccdaccbdbecdbcbcbccdhcccccccc^cddbcdd]fa]bbddf^cdbedbceaeafb_adcaabe`dcdai`bdcacbdbcdeffdca^hh`[bfabj\aa_`mcj_d]b^ggar^a\a]`eig`c_f]c_ab``dgc``b`cccbcbcbcegbbbcbb`aabdcf_gafbcbcebbbbafedceceededdac^Z^ebbg^`gbcgbgg`ab^_f]cfabmb_eebgbb`agefdgga`dgdlgeda_cccccccccccccccccccccccccfccdccbcccccccccccccccccccbcb[bbSabf`Ucfcan]bgcebae[bdfe`ae_fad[dWY\`d`hih\edl``aehhdii_ad``ahe`eec`\^d^]g`ecb]`aa]_eg`aZaged^g_c[_bb\`b`YeZ_cefkaecc]`dfae`a\c[edbfebfYelei\_fee_e^akb`^^gSbeaZd\`r^ad^elf\\[c^\qaj_gf]j[`[eff^`^[fj[eg`w^qejcZ`\^[cbecdccccbbcdccdccdccdbdccccdccccccbfccbcccccbcccccccc_`be^qcb`egecac`__abb_g\b]^^abf_db^]dbubb^_tg^`cb_ibbafca^h]\aclYZdceibf]^_bgcjid`ecX`bcq`daY_chhca[]d_caf^famgi``]baa`b_e_bcmU^_\d__fa`e`^c]bf[[e__V]aPeac`g^b^YYgrd`\Xabdej\`[jR^h^hYgi[Sa[T^YQ`ZQgeddM}WR[U[_j`pUZaYbcacabcccg_abaaccfbabhcebbecbbebgb`ffdacbacc`bdcceecbee_eedbccdh]bbbd_dhaadeefbjbcf]_ceacgd_`dedca`ebZc`dcabj\c_j`^bZ\j`b`]`b[]_^]Z[_`^aaa]dcdgZ]_[bS`aVh`d_`bda]cebbb`ccb`e`gbccca``_hcabab`aa^`_acaf^a`aa_b_c]_bacd^`mWda]]`gadZ_Zbd^\o`O\dk[WYzh]TXao`ekbee[bt^f`kq]ebbn]]lna__\dgfaiqbXeZ`Zg_adj_e^na`_`b^aZ``h`ghVfcfpacgnUb\een^^gc`ajecbg\\bf_Td{[c][hYc[bdbWcXaeci_dmsZagjgcla_b`Yaacic^ce`geehg`^Ogffea`_hfhf\ajbh`\haUfbqia]\ebWXgiYio^edc_bd`c`fbdaZgf_ia`b^]`^le`ajm_ca_d^i`eddb_d^c_edhcd]boka^b]`hWf`_j\lbdb]ff_V`_Ox`]iQ`^h`^\_`bbYUgd^j^a\\dbcbdccbbgebbcccebcccbbccecdbbeaecbbcdebdbbbdacbccbcbdgs_SXmOd_^YVaVOYWV]hZ`N[ad[fZ]Z]YbV{\XdcefUk^M\`TbyRYcebccbacbbeecbdbcdc^caaeieccbbbcdcc_adahcccbhacacb`cfb]lbd_gbbfdcd`^fiaeba^bla_^f_gl^ee`]T^f`^`_bh_hl_a]eab_bccccccccccbcccccccccdcccccdcccccccccccccccccccccccccccacdcgdbb]eddge]c^ce`bcbebh`g[cegd^_ige^f_ca[ab`^dgchfbeaeh_bcabcdcbbbbcdbaccecbdcbbdccfgbabbcbabbadfdcdbcdfeadcfebefbdecbbbbbbbb^dfabdcbd_cadcaecbfabca`aacehdbeea_hcffbbcaeac[e`c`dacdebb`b`adad]eb^bbdcdabaafbc]gcdfeYgRdjXZ^WTS]ZddTZjTViggS[dZjYaR_\U_cTY`QQ\dgZ_iOfji[f_^ab^a\c]b]q]X`^{_\]e`\TeYk`bb]V^agiZYZs\]jaT\_gbeabbfcbc`b^]cccbjacgcaddfdcb_bdefccacbebhebaaacbbabbcecccbccccdccccccccdccccccccccccbccccceccccccccbccccccdbkeggebbcaddfcbbdaac_ecbbe_de]al`bbf_cbbbbbbd`bbbg_`b_^facdabbcad^edcfcgccfcdaaf`ceabbbcd_gdcdccbaccbdbccda_gek^be`c_ad`cacdbeabbaodabde`g`bhbbbbef`cc_`f_deac`g`fdfiegb\RuZTYagYVifnbhm_X`UmTi\sdd_Yka]fje]_cb_Rtd^`ieeZcccccccccccccccccccccccccccccccccccccccccccccccccccccc`^cjfccgabdc`bccebc_b]c`bhhcabadfbpacaigdaac_ahab\b_d_cbcccbcccccccccecccccdcccccdcdchccccbc`ddcccbccbccccbcbcccfcccccbbccbcccccgbceccdd`cccbbcfbbdcccccbccccccccclbbcacgc`ccbcbacbcebc`caegdccf]cfccbb`cbc_cdb_bhcd`c`^^cdkd]`b]fd`bg^_`i_ddlgaagb[fgac_g^ea`]hcYa]fdaje]_gbsb`cd`ccdabfbbb`fhbdaagdiadfbda`gqfec^e\b`^]``ibacc^abb]bd^e^aaacehaab_ecc[j[b_cbejd`ZfjfagZgiedd_cbfd`gda`Xfcccccccccccccccccccccccccccccccccccccccccccccccccccccca`\a^bbdab`aab_`ab`_c_a~a_bYb`efa_b`a_^`]`_dbg_cWaaem`\idccv`X]aff__mabdj_^`Yce\ia{ch_e{bV\l\`\e\Q[\`_N`\g]bn[d_bdb\e`c`^ce_b_g\bg_i]c^\cbc_Ydne]e^[yabZ``bb_^dXccbcecccccccccccdcccc`cbccccccbccccbcfaccccccccfcccccccaacbaccbe`fcccbbcd_abdebacbbchbacfcdbgacbddbdebcdccbe[Zj`XVYmXd_e^ZOsc\UW``ad[T`ca]Ss_WZdS^es\\Q^bd]\]_d_cacbbcccfbeccccacacacbc`ccccbcbc`ceccccdcfcccbbbcefaccgfc_gd`cbfdcgaaeaba_bbf`dcdb`]__]cdk_`ah^ja^ca_cbc[c`bfIZ@SJahW\e=TQ]`cwWlXBzXl|IZ~Xge^}jOVxHSF\P{_X^nV\___i_cbXaZgbZbm\aofiahmb_h_\Y[^_gcffbee``c`bf`b`aacaagccndce`ebaeeaabheeaie`bceeaaja`faac_^dca^]afbTfhbbcdecbqeda\dcbddd`bgbfccfaafbac`be^``o_ebba``c``bi`d`bcd^bdc`\]_`cec_de`^dbe]d_l`[]caebbe\]eebbff`fcZfboX_bcdgb]`XcdhceccbbfYaeabaaa[db^dbwb[de]__`ccad`h`fd`o`aekc_fdbcdY`bgb\`__fY_t`]cf^[bsbcic``c\]acgeee__j[bcbhf[c_^eg`\k_d`cpZY`j__g_ddcda]gg^b^g_gmYhg^_]cdef_e^dbie`hgd`c\ecdbccccccbbdccedclbb]db_dabcccccbcdbhb_babfcb_cbdcgbba]ff^a[ebha^^cdb]`db]d`^aqe\be`ZbdfcfZk^a\oca`becbdbfhge`]bbdgcccced_dca_g`faaae_b`kbcaea^ge`ea_mb_`ee`bd`da^b^Yp[c]fb_kbcnmb^bdegcdbfce_cZc[_]ebge^hcgb\^if^_\\bgbbhja\a]blge_`dbfabfbd\`h`cadfcaa``gaa]a_ecf`fccba_ab]a_`eacdbccccecccccci`idda`abcbcaf`c`fcabaccdbadcbchgad`dcbd`ead`feb\^_ae`_cWeedcdaZ`Wb`beXdcbce]d_cbcddaabb]ebZcgcg^bb]cfa]_`de`ecbeebb\]cZaacedbb^bdddd`defccfeah^__a_`fbd_cahfb^dadgbfk`_ceaa`b_jaaecbbafc^v`beabdc^badkda]d`^\beh`a^a`_d`ffWfed``^k^ZfUgbecd`\YUa]ba]__deb`f]he_a]bbfci__a^a``ae_^a[]]^r`Sde\_ha[dfaahc_acdcgZbckd^bbcgi^flbicZ[ibdjjeiikcchie[cae[ebca_lc`ch_aebikcaeba^a`ddeaaeh_e^ai_j`hZ]b`i^f]]t_c_efc__be][a^XfibdbrbeaSfd]a`]cd[c^ikleca\Xea`ffa\`rnhbhehabladc_fVk_dmhaa^ffgagcb_^cddh`fbbab`ggcbdbd`bb`_gbhfbfbcbdadach]ccddhaba_mc^dfecgb\bYlbehba`c^`bef^d`^tgc_ca`hZdfbZg^^a]bh]c^gc`j`^acb`cc^aad`j]fcZbg``faga\e__md_`_bb]aa`a_fc]ba_hacb\daad`bh_ciX_abeW`d\id\ebYd^k_c^igffcd\d\ifb`md[]_f_X`bbYd`^_gV[sacfg_hb]eVggbjdfhfdhYhWk```ed\\]hbaXaYabcfcccecdcacdccbcccbdbcecbccbcadacccccbdccbcbecacdcccbWYjagi\fXWcWg_m`addad_adccOdhephsb^[]]jgbhZX_h[cciYYc\tgQh_a`_f^\d\dmeZf`f]`]cgdfb^dh]gdbZfiZ]e^aibnl\`fg_igbcb`bdccbccbfc\cbaca_dchclcddadcbdahbbaaalbcacbdcebbbcb__caadbfdbdcaccabccbkefidhb_ccdbbcecc_`a`dbfba`abf^gcacc[^c^]sdjaZV]]d]xbaZ^e^aPdfT^iaaefg_gi_YYZhbUZaa`[_Ycccccccccccccccccccccccccccdccccccccccccccccccccccccccae]W_caSj_j]_uZae`bd^_[c_fdadlhcbabfbcdYbj[i]ab^`]]_iRfYRc`cOhqi`P_dTB:fT`gjcPbOcjcQYcjodojmfcX[i^]VJfWZ\cXUW`\Y]`j_`W\`haV[LUZWYibRiReQT`ZWcW^oWS`X]azlVciZ^\^cg^ghbZ``fca]_a`^_e\dib^a]b^kYj_b\a[ebnacd_cicdgbcbb`occccccbcdgdbccccccccbdccafccccbbaccbccdecbccccccccccbbekXUjde^Z_hZgyYd^dbbabVlp^Y\Ze_^b]^eZjaa`bidnZ]ab_[Zcbc[c`ec_h^hdf\zW`hdg`_`hjba]a]c_l_]\hf[dfakaf`_`adef_i[bdbcdeccfbbcbc`ccb`acab`cagcpcbc`bbfbbbedacac_kdbdcbcbb]bbd_b`^hje^cfddbZcYbgehb]`gbacm]b\kh`bcdb_f^dcc`agacbdecacccgabgcbcccdccdaceaccbgbccbccafbddcacc`bcdc_dcaafyc_\a_bbb[_eeacab_`cmb^aecab_Ye_b`dlda_bb``^]`_aaaabbcccfdbccabacbccf`dccaebddcccdbdda`aaecbbbgbdabeccccadablg`edY_WX_n[YfUXf[rYWfhag`fg`aTguaa`ibk\[klnaq]bspbcYcgbZaaa`eafek`bbikkiifZ]^amdaiVpcsX_W]Yddl]`kjU`\Xfe]_jZbeUo\^fc\d[`e[beaj`e]cnYhh`WYafs_bf[da`dmgkoh]^ca`da_d^]^aabdX[Vaa__`_J\S]\m[_\`^ai_^_Z[^m`aca_Yan]^bb_axbdccccccccccccccdcccccccdbccccdcbccdbccccbccccccccccccaeeebbccbcbbgccfgcbcedbdebc`fb`cb_ddcb`bcfdccacacacdbccbcbccccbcbcbccccccdcddbccbbfccccdbccccccbcbcccbdcccbbc\a]_c]feeefg_ed\fdfbaghbgadeamdfSeabblZbZcfa_hdf]bZbe`^ngffSaedc^d]adXh^Wlgah_V[Yhao\Xfbidg_[[hcbZi_`qdbad_bbcddabcf`_dbbcdcdcebaccdcdcefaaaee_dc]dbdccdcbdbhdbec_b`bbanbkcdik_fkcb_aaZblYa`be`a`a_ea^bc`boajb]`kbfda^]nWbUeYXX[ecjZSU^jkk|Z]neaetfWdielXg\Z_`wUV\qaZna^fc_jWcbbcbccddccchccbdac`c`cdcbccgcdcccbdccgccccb`cccccbcba`e_\g^UYgSg^`^ae`_a\_W_\kcgah[jkv`t`ecUiecR`bboTfV^hdbd`_c`_afehbdccdeadcaebdbeddfaacaecaddeagbaba`ecbccedfakhV_YM{Q_]iaTQOabVmlhg?YHTXOfsqa]eX]ZkhccVT[i`Gjj_gP^`fgdcf_^f^Z^g\qg]Z`]Z___b[bi]isbXsd^^jf``bhf`lf^g`Z]bXcddhb]cacefdecebbbaa_deacbbbcdfab`^b]fcodbjbc_ag`ce`ba`debgd]_gXWb`[Wh_nX]t_[b^_Yq\_\diXdd[gfb]Sedp[gceXigteigb_\_^Ya]c`^pji_Z`[fj^cUqhhgc\[a`n__bgd^`de\a`gac^]amZcccccccccccccccccccccccdccccccccccidbcccccccbbcdcbccbcccdbbcccccebcccccccccccccbcbeccccccccccceccccccdccdcccaddde`m[_^\`bZR[hcacZfa\di\XgcZ^b[jci\bd[zc_a^_i]Yeofaa]dZga^VW_fjbVk}g^ZVWe^XbaZNZcpdgl^h`]hh_kfWbbn_^Shefa`lh^k^_`\bYZ^\[]iYUVf\Z\]e\e_YUZ`X[YWeiXcVe^Y[\|^^[_aZccccccccccccccccccccccccccccccccccccccccccccccccccccccc[fcfaVaaflcf_cbi`\aflbb`oX^[`ag^a\i`^iXbf`c_`\g\`_\]h`~a^ba_b^b^^bhaaa`]ad^^]m^_a`aY_^ab][a`b^af`b`^b_a`dchehb`dcbcbd`cced`bfdgfb_fcba^a^dac`h`ddef^c`decc`gg`ecb^aacYbec]ld\wUYX^X^^e[[`ZW^^cqc`Semcb^eag]\`mXdYUhdk]__f`^c_abic_]^ddaaca]\`e_e`cd^aha\dlkcedfgY]aj`afZ_ifaccddbbccbdcdbddccddcacdedaecbcebcdcbdfcacaccccccccbcbaccccccccccccccccccccccccccccdcccccccccccccccccccccccccegcbcccchcfcdcbaacbfcbb^cbbde_ebaaeeababacbgcadcc`ea`^RmYjNt]ZTEaen\d][Z2ZF[K_[g#YJ\k>[[fmo=hIVlen\XF\KplQU]cbccccccccbbdccbccaccddadccddcddcccdccccccccccccccccccb^_`^a`bX_]Q`au__l\_de`tbte`\^aa^b]^m`b\b^^fZcg]drgc^c_[gbqa`b[a_hbaa_^^_^eahIce{b\`daje`\]`Z]l[aH[\ihae\bs_iodZ`aebang^ZZaZT}Zb_dYacie``a[eXZZlfi\[ha_bUZW\bc[dTdae`fe_adh_he``c_e`^`d^ei`[fe[mZ`__]eeech`\_c]c]a`d`aeeba_bbd`d_bb_ebe`fbd`d^a_adb`bf```aa_ecefaifjafaibadhabcbdcacccdfadccccdcdcfccdccccbcbcccaccc`dcccebccccdecabcccccccccccbdcccccccccccccccccccccccbccccccccdcccccccccZabgabcgeb`cdbcba`ahfbbba^bgegc`aadc`\cacblibddceccbdd^``]`^dcb`e`c]c\_c`id_bd``_]``iealkdif`h^^_fl_^ad_^habbibabccbcfcdba_bbd`bbacc`ccaacecdd`b`lajbbjcfcccbaccdcccccccccccccccccccccccccccdcccccccccccccccccccccccccc^a^`_ba`PZc`b``ez^^`kb^b`[d`c_ba_i]`okicWgagc]`\dZ]\fed^eaab^cbajfbc`bfflabdf\gjcc_`f[ba\dcdb\c_d`b^bkbel``_cbdde]cccddaccccbacbddbaffcccdeccacacbcdcdccebcecbddcccccbbbccccbbdccccccccbcbccccbccddecbdccccccdcbcbccccachaaQZaeacfdQyj^e_hcZ\`Xc`[W`eaa``cUZgaff__kbjYWg[gh\^l_i]`haaac`aebbgbfahca^faabfe_dbdb`bbeaa`adc`iecdcfge`cbbcdd_bcfhebcacad_b_fdcdd^f^cbece^c`_ecb]cbg]ffdbgbaadjld[b]_a]_wadi_ae`h\ebb_^]^icq\bYhbfdbecb]`Y__\_X^bZbhbecbcccccchccbccdccefabcceccdc__gecbabdc`accbbcdccbccccbcdbcccecbcccbccdbcc_cbccccbc`bbcleaacbcbcccbccccccbgccccccccdccbbccecccccecccfccacbcccccccccdbccccccccccccccbcdcccccaccccccccccbcbccccccgcccdbecdccccccccccccd`d`ed]^eccabgijccbdb_ica[gb]fd^__bmb_ceaecggaeabbbda`^bbcti`]bcbgce`^`dabk^ceabeb]a`e]bh^^aabdhkg]]_]`_ebeia\a\gbZ^bTXabha`b_R]\^`cj]acbf`beYYjYdifnd\cjaairgh\eacbcjlTb]pYgYUb^XYeiRRnicd_bhXUbobZRah]VQ]a\k`RyaaX\hbVWkcedgfh^ddabbfdl[djijfcff_aifgacb`hgifbfchd`\ckbdi]\hdea\a[^s`cbb`ef]cY[i`ghl^qc^cj`eZ`bUj\d`ek\_d[glghedOc[^^nmgm_]c`bmk`icck]^nS`mcf]ai`jb]\c[ebig\d^e`\aacZ_[^acclhc`dc[f]t`dbbbhfcaZc`cd_cYabx]f^grhdebY_b^dqX]`__]cbj^liaced^dc]Paz^dcaae_`bcfba]noj^b\_\gbbY_eVafp[mYcX^afcccccccccccccccccccccccccccdccccccccccccccccccccccccccy]gbf[fdjeN`gck__`efUbbha`bcceZ_iX_gl^fbb_Yd]gca`a]c\accccccccccbfcbcdcccccccacgcc`cacccccccccccccccddccccccfaecg[c`ZYfc_\^eg]]e_^\bbbd[icche_gcZi_dfT`gbc_c^Zfem_b_k`d^abX_i]_aaahcgeeY^ac`kgb\fb]^]O^abad`^^aa`b`^`Wacccccbccccbcbbaccecccccccccdecccccccdccdccccccccccccbccccccccccccccccccccccdcccccccccccccccccccccccccccccccci`c_de^icmcdgpwcfefkeaceh^c^aYfcd`dbi`gae]g`ch`f^kejjdcccdccccbccccccccccccdcdcccccccccccbcccdcccccccccccccdikZb^fodflfcccKZuheU^`Vdf]^ehgbbZ\fhc]fafba]i]W`c^Yecdhaaah`cahdc]`b`ah```abc^Xde___jg^`_]ba\fbc``aabccheded`i\aeebbb_bafda`dbacijca`b_bbc_^d_^ca^ccha_dlebeba^d_b\Y\je`\bc`g`\a\c`\e`ka^ea\X[`\Xg\\diajciac`]XfXe\etZes\_badcbb_geY`bdbbad]tcweiaca^`_d^g\^``d]j]bddhabb`gdci_d]l^db`\jabbcY`ae_\bd\abc[Zcb_mcbdhddffxc^[kc[[]]``l]cadeccdaecbb`_cg^bggjajde]abaanib`a^`cb^i_`ag`dbcaefgac\ee`^ad`_^[YXcapcdkbda[ccXd_Zj[g_rbddZ`b^aZ]i`tbXtnh\cibbab_bcci`ebcdbbbb`cedd_abab`ccbb_bbbaaacbc`aac`bcfd^^b`hg_bee_Z^i^bn\k`cgyOegu[e_`Wh[[X^caUjbaBj_gpbYac_pr^iZd[^}kaa^v^e_gwab[]f_Y]Wd\_N`L][\Xd_j^dZb__Sadaa`[ig]h`lfc^`_^bbjg`Zhf_bmejlgdajgd^e_]`accj][ajcadrZ]acja``dgdibkiee_Xi`dfXe_abe^hdYkVYfa`acaeeh^ddie]`cgebZ^^^bj_]e^a`g^f]^`acbe[h`]giZY^eahcY]a_ed``a`acn\`d`ai`b\bcebf`cbeegcbcbbc_hbbbd_gbfdecad^dbdddddcabcbabbbfed_bmhd]edmdcciXdWW\[gb^jjiae`fjbdYa[Wa`hehajh\a]a[fN_`ke]ccccccccccccfccccccccacccccccccccccccccccccccccdccccccb_eb_baz`dkaaaed]abdd\bgcah]^c\d_cgda]fg^ca_g^d^aadef^cccccccccceccccccccccbebccccdcbcccccbcccdccccccdcccccc]ecdl\a`^_jbe_aef\_aee`]bd^Ubll[^h_a_f^[fWcb`_a^`cj_`c`cabda`bada`_accaf`ce`cecdhd^[`e^dc_^b_`bfdffha^c^bba]cccccccccccccccccccccccccccccccccccccccccccccccccccccc`c`^_gx[gfbc_kh_Oa`i_cYicg\f_tbf`f`eeqca_g`bhb]dgd\[^s^kRi\hjV[cihtjeZo`_[d\Tbg_Qn`bZa\Pl^dcf[^ZSYzWQ]ce_fe]ccccccccbcddbccccccecccdbcccdcacccdcadcccbcccccfcccccb`fYbgh^cf`[gc`ba_d_f[cf`^gcd^c`bmd]dgcf`j`f[a^ead^]f{dbadcaccccdddcccbcbdcc`cbbecedbbebbbbbdbcc_cbbhdedecbcc]l^][c_`]aZaa^b\c`]aQYb[]\`_]^][m]aa]Wcb\]jaVjbc^]aadWma]hc[beb_gcahbicked^\eag_fggfjc\_db_h``aqh_`gbbbgbahcccccccccceccccccccccbcdccccfbccccccccccccdcbccccccccbdcbebcbckbdagbchcdcff]d_acbicbcebaacaeabc`ecbecbcccd\fg\`defYc^`dffh`^ag__ai\`c`]bc`ccjabedbgbbfa_k`ia\bgeda^`f^]`^ah]jP[b\faUjPR[vZrn_gd^P]]\[mo[j`ggVd[bVXcV^ap\maahhba\b^_c\]ba_a_`_bbbh[^ch[gd`adeZ\gWacdf]ebVf`hqofeaebichZe[]chcj_e_f]Yjbf``ceda]ai^`e[Zb_c[Ucbbdcdf\hccccbcccaccgdccdcbcbddc^acccfcddecccabbdcbbccdcacfccccXe^Wa_qnjYhZaUZ_`c^fqd\aaf\earmhoicad[Zdg\_\fUhl_d[_gvcchcbcccbceecccccccccccb`cecccdbdccccdcbabccbdcbcadcbcbaccbecchhfcbcbbacbcbcccb_dcdcdc`cbdecdfcaceacedcdfbaac\]acj[cgj``][^e^``ek_[[^]`a[padh`glmbaa]dq]am\Zh[^f^_]fafa`hc^banr^]fa\`hb`^hb`\f_fee_gcaa`\\hhecdef\ecgbe^biedf_fa_mi_cabga`dd]gabadabq^e`cd_fcee`dWcb]bb`acbdddccbccbccacccccdccccccccacccccccccebeeccccbcdbccccacccf`eb^bdd]ea`dc?b[bbVbdccdacV`deadbbab^_``bc_FbGYcXdWba^pk\cdcga`\`ga_eec`cbbe_afecbea]dbbb^hi`d_fbffcdbi^^^alccccccccccccccccccccccccccccccccccccccccccccccccccccccdbccceccdcbccccccddcbbacbcccccaccdccdcccccccbdcbcdccecccccccccccccdccccccdccccccccccbccccccccccccccccccccccccbbfa^ccabhhbccbbb`abiaeabeebbdcbad``baddabgbebeccccccivgU[aQ`=rUccWPagLvOZUooQTYJXZ[ie[L|L[^MVnla[_^Oq^TSVedifabh`^d_kh_cicY`jbec^fdgbZc]bbh`lZ[i`efs_Rcab`__^bc_^^djcrbbbcddacdfa_a``ifdc`ejdnb^`^_`ce\d\baYbcbdhha``[WX^d^]sacO^bsebXyMhiubd`i\cfXg^]@gWYUdZ\ZwlYOa`gRUcZccdfdccccbbcdcccccabbddbcbcbcccgccbbbccbccccbccdcbbdcdNneSeVc`]ejf\WY][gSW`aZ`VJ]g^Vekjmld\_VYXxM[jQT]k]TcYcccccccccccccccccccccccccccccccccccccccccccccccccdccccccbcbcccbccdcdcdccbhcbcccbccccbcebddcca`ccccccceccccccc`bdbbbcfefedbdacbbb_fcgmbab`bdbabbbbbbac_bbbdaccecebccdcccccccccbdccccccbcbccccccdcdccbccccbccdcdcdcbcccccc_\edZ]\bVb]iambbc`v_aa]h_c_fifY`[fbWxfh]^`]`z`^aa[`aagaed^cdbdfagib_efkdjad^a`cjcd^c^bicdghif_cbcWeZfX`[c`ebcccdcccccccccccccccccbccccccccccccccdccccccccccdcdcccch`ccccacfccdcccbccbbbccacccccdcccccbccccbccc_eccccccdc\[ee_cZ`eccac^_`dcacb_eeafcbadeda^f_ecbcecaecfbbbcbbeebcbcebcce`_cdcbcccccfbcfcbccaccccddfbbeccdccbdcccbccccPSULWbbIWe_Oobfdcbccccccccccccccccbcccccccccccccbcccccccccccbcccccccsc]faaaZ`Y_f`]diZgd`\cdeacgcf`khbe^__bc[dc]e^c__c^__]z\_i_]_[e]Ybc`]aa[\^`[X_b\`X]bc]aabraa_b\caZge[`la`^ccbddcccccbcccdccccccccdcgcdcccccbddcc`bcccdcgc_ccdccc`c^_pc`b]e`aa``^d_[jbb^abi`e`_[`lkabcjag`gebY_b\a``adcMd[_heb[ZnnzkiW`^VXjfz]\[@Y_o`cq`ojhcc`Vf`PhcDL\Y]Z`Ya_f`edbb`aa]cbaqde``ab^bbf`bad`gc^`_]a\cbafog_a`b^`aieaecabccfcccbcccbfccbhacccccebccbfcdbbbdcbcobbcc_cbcdZbhqgeaZ]_U_ebs^^lhgZdh]]c\]iZ[bb``]ed]^]`YX]fb{eb`Za_cXhjZ`eb^a^addaeca`cacdfaeb`cac`b_b`^o\^pbf{`dY_i_bb`c[fb`ahe_`afe`kbbdc_b`febd`efdcfdbdh_`bbc_a``ce_cb^bgfegeadcbdcccadbcccccddccdecbgbcccdgcbcdcbcdcbcccaccccbcbcb`i^]gcea`Y]Zh]`ce_Z`gi^adb\]fq\n`cl^\gi^kd`ajg_cd^h]c]cccccccccccccccccccccccccccccccccccccccccccccccccccccc^^ba^addfbhdabf``__e_biccgeaadf^ci_facd`dbe\_efebfdhah]daah_lc]ah]ak`^`_[`h]bjhtceU][aZ]c]Z^\yb]^[c]`kb`_`k^hjgh^]_aaahc_aw\]aZdd`aaaT``gbe\bTbcaccZ]QccQe^`kc]]`daccccccccccccccccccfacccccbccacfgbcccacccbcbfccccccbcebf`fNkX^_cdde[feeR^^ba^hgSMfieadnfdfZcdhcicajXV`_jih_UW^d_TZ]hS^i`XceX_mbjPddZXV\PS[PbU_L\WfsO@WTR^XX`]]\Z_Z]n]`a\`agjX^l^Zfe^ddrdaiYYZ^^dfe^`dea^`dca_`iabaaa`cd`_ab]g]bfeaf`cfedaaaabi\``h]f]]gnieecc_`dfad]hccdfa`had_ia]adcfeahcbfaeedkh^ebb_eb`acg^`_abeicbaaebdcbcdea]dbf``cbccbe`edc^ddecacfchccceabdbcbbebcbbcccbdedbbcecccd^bY`f]Sgbfd[jhiVkhbVscbiX]Y^akRkbk\UtX[T^R]e]labk[[`mb[`cbelcbbccagd``c`cfZdeefea`aqaceb`_dc_eebab`ecldab`e]]df\eaah__ce]edd_gdecbfcdddd`ccdgged_d`cgaiYeecec_cbcdj`\]Xd_dehXf^\eekRgfa^gadsbiedqdlhbecc_jU`Zjao]Ve_eaccccccccccccccccccccccccccccdccccccccccccccccccccccccccaN`e[yWa^b_daZe]XVOnhg[_aYZ`]\lgkVfaYmk^]_s~ZanfSaZa\b^^Xj\b^h]\_cVY^aheceha`^mYiTaaaZcXdiafaOcpVdfV[f]aUgYKTV\cf\bZecb]gSS[NuYYYbfooU]UuZ_QT\mTZg_`sh]nkLidOd`dccccccccccccccccccccccccccccccccccccccccccccccccccccccccfc_cccdcbbbcdcfccfbbbdccbdacdbcbcdbbbdgecccccbcbbbdc[e`cad[`p^ab^e]]a\[gb_`lg`e\d^Zcei^eahhbad`ccdckbd^acpmaf`^bcbeefdccddbddc`gfaeede]ba`_d\acc``bbcbbcdecbdaedhhh]gph`_Qae]af\caudgZY_b_Hbag^kgid^W]cr]v\roSVde]ae_]cXfifSRTeSgabjdc^agb]WfhcbdIhXVTa`RdbY^fiahbY]hTbh_dN]cm`dabQceie^^c[c`[\bh^Vfd`^fceacag^eblheee]Vpd_gab[gTedccaY^UaZaZb^ca`e`cb`|aZ_c`^\n_ck^`e[ad[hW_ao]`cbg``asa]^afcab^bgcdaabca]_ahidc`dbaah_bdbgbcabh_cdb_fmdbcbddcfdccccccbfbcccbcbccbacabecfcc`cbcbcgbcccbcccbbcceccbcg^g`fd`aacodaadbcdbae]i`e\dd`cd]ie_a^a``i`dabbabcdbgbfcdc_adRcfjdde__dceegbcece`^ab^`dbdecececagbfdd\_a_efd`Wm^d`bj\\i`b\cef_hpb^kg^k]_nepdic^`hcel`blYam_^fk_\^ed]gcdhddfegWdc_mghcg`coacebffbdiffa_]cd`ffcaaY_ebb]aa^^fg`dc[e`Tdeg^i_cebcgdjf_kbZa_`de_\n`c[baj]rd^Zfdgeibeecccccccccccccccccccccccccccccccccccccccccccccccccccccccbdcbcccbccdccdcccccbbcbdccccccccccecebccbcccccccdccceccccccccccdcccccccccccccccccccccecccccccccccccccccccbcac]\c^abdaabaa`abbc_redgcabgeaZbedb^bp`cb`ba^`a`add`fb`ic^dbdddbdcbcccbcba]cebadbjfbbc`cfbbacbcdagbeccbfcbcbdbcecccbcccccccccccccccecccccbcaccdbccccccbbcddcccccccbegdh[^Vdi\o]^ahZSVfgeZYga_eeXXaa`acjf]hj^\g_dt]\dmkehZeflX`d^Zdjj^da``igpg_Zhg\^d_]eYZZfmb`]a\h[]_j`ad]aYmcfdXbacb_f`caaa_fca_Yg\nfgedeabj__cebc`ca^hUc]tfbj_]kfdcccbcccbccccccccccccbcdccccbcdcccccbcccccdecccccccccc_ahabbbccfddccfcadke`a[^bj]efb__fa`cia]abh`a_cbcbbfaay\Y`jeIgbbddlhWaljg`Ffed`UheYgDem\O`Zl]lxa[d`URe[UZZk[\cccccccccccccccccbcccbccdcccecccccccccccccccccccccccccabhc]ebcdebbfccdcbbcadcfcbcabb_ddbdbfhbecfba`dd`cedbb`ac]cf_bbdc^ha`abaa_ba`c`ghb_aj`a^cba^b``_fhdeg_bb`d`b]^`hhccbabXfbembefcb``dgc[cejcegebce`bZeccbeacdcd]defe_f]Z`d^c]dc[^iZXg^c^UZ]^a}e_dYbdXae[PUUuyZ^bV]a\``jabbccbaaebcbbb`dfcbebbdbccaccedbbccbadbcbbaddmacbcebfcc`ea^^g_edcchaadcab\c`dbe`bdde`edhbebeda`d^`a`akachb`f`ccccccccccfcbccddcccgcc_gcbcbc`cbcecbc`ccbcccdceccccb_cZoc]dbbcabbb`e_d^`aeZ``ai_c\`\d_fahdkddbfag_jdnbfbb`ccdc_cccdbcacgc[ccac`cichdcccbcccccafcecccccccccccccceccccccccccccccccccccccccccccccccccccccccccccccccccccccc[e]dp_yRhb`aSdY`Mbkacadi]eja\`dTn^fcb^_i`k^gfXg_Qj_bhdagbaccccccbiccbbcfbbddceccccbcZcccbfabfbcbbcabbacaccbdacd]gXj]Xha_kX^fh\Sc]a_h_fXTfgdagbic]\gg^geN]eX[_Tdba^c`^_n`abaabd`a_]ia`a_]g\chabY_fkb`dac`ffc`_`g\__a_[]gaz[[^`aab^b\a`e`aaaa]c^`ceadc`Yc`g_ji_jb_ec`awdc_a\^aebchca]_a`dgbbeccec`a^a]dcdcec\d`_ahhfdg`bh\cb[e__ceh^ch^VaY]saabafe_^nf[_l_^Yc\ebbw^Z_Y]aU`^__`Zb\j]d]j``_]iaeXbkgabjb[baaaad_da`^bjbge`hg_aX_dabc\chb_bd`ebclb`a`_\^a]__bXefca`lefha`eY`^^n_]^_Zg^^`d_ci[iZf`]^bab``_[e]`gcdbbia_bcabbcahbc^ecdc_cj_^[a_cdb_aekabcbccb_a^gq^bdbcccccaccddccbccdcbccbecdcccgcccccbcbbcccccccccbccadkwfa_`cbZc[^aa`_db^_`_al`\acae`lca_cadghdhfaegbbcadcdfcccccccccccccccccccccccccccccccccccccccccccccdcccccccc_ap_[^`c`bba`b`e_`ab`b^_ibeev^fb^b_caabbbfi`accebkaee^aadgbi]b[behja^g`y\add^\af`g[_vd`^`e`_^kb`ea^Z_esea_dY^[dckeZ\\aice]]jg^h\ah^Z^fh_`]Xh^b]c^fh^c[^c\[^db]g^[b`ffdcSkbi^_h]ZZa]f]^b`^`YceebYd[^[o_dctbVhi\Xhb^Zbf`ffaldZdbgk_jefckagmefcj^__^]Z`qbb^c`abgce[]k\ulake^^b```^qg]h`eY^^Zc]_cZe_Yb_tkW^jaXge[iegfb_fX^e^``\ZW[^`acZlcccccccccccccccccccccccccccccccccccccccccccccccccccccc_`ldchV`f^hbe]babmi[g][dXk`[]dbdde][b`a\[ck\c]mdiljc_bccccccccccccccccccccccccccccccccccccccccccccccccccccccddcd]ced`_fccaadabeaafgcegc`aiacbdefbgcfbbbaab_c^d`fafb`ccdccceccecccccbcbeacdbcccgcbcbcbbcedcbdcdbccbcecb`d]has]bdaad_Ufb`ac\W_iew[f`R`m_gbm\cd]c^b^aanYkca`_cZeh[cedbdcdbfedd\gdfagd_`d\accdg]fb_dcac_afeaceaeedbdfedcbbdcbcecde_adbcdcfedbd`acbecf]gbacefecccdbcbcabcbcdb`dhadeddbbdebbbea`bc`d_cbea`dbageebqcccfd`a_ed_gccbdabe`\]^_fcjc_bbabca`b\_fX^]^_`dj]gYk]bbbahhhc]`_g^_be^bcecdb`eXi[cZdahbW__ed_^fgbebdZedja[cffc_Wb]ac^_`^j`gik`pa\cbce`bf[btc_hac^[dac[acbfcd`fehbacadeeae```chaa_^bdea`cb_bcccf`fcccfedebd]bfaaddbcabdbcecccfaecebdcdccecbb}hVSKk]]_l]UTZLU\[TfWYd`gUyXkX^a_Mg\dL_XUO]iSPjfcV_[X_cedce[ahddbe_ed`eced`bba_ba_bk_ebcf_edc`e]ab_fagebedah`d`c`ce^efbje__^aeicdicbf`cbag]eedcdbX_eac_j]e]j`b___cccbdbecdcbcacbcccbdeaagccecc_bbeddcb_cccfdccacdccdcdbegfa`daeaecfcadaddoaf_\\dbca`bbf]ed_cdf^g`a`c`ddbae_e\\]ab_``b^afn^cda`cb[[f]__a```fbb_\h]ecch`fhbtfb`d\_`ajaab`dbabgcaibbgbbchdhf_dfadcabedb``addaaadaacbc`c`ha`b_[^`_adb`a_`be_hbf^^_]`gb\b\k`^``yg_`___dbgb`_lba`bccdi`gccchkf^gbba`fceacl]a`bfae`fb`\`^`]d]e_aZckaedeidmbcpbaagab]a^obbgo`fW_g_b[a]a`iaish`[cZ^ek]b_bb\a]b]``b^fcb`_algm]g]_[dhfce_cddge`\lmbXa\caa]^```ae_b``i]`_ih[mgiahohf^]iW`^]\rbbo_eQU[Wb\]ch`W]WbYW_``hUYef]d[]at_f`\^^Y\Zbq_`Z[_^ci^`\gR_gb]Y^`Zeo_[hbjfhk[hd`gc\dab[hZhcbdbkbccdbe`ccccbbbbacaccdcdabfd_cdadcc`fecccbdbccbcccaabbcbbbccffebcccdcaddcccacccbabbebdddadbcccbbcbbddadfecb`dabcbbcabbbbeaj`bhaagdde``e`acn^`^^]m`dd`b`_c``ha]c_heekcc]gaW]j]^[_Xdb[lZe_Y`hiefa[me`j[][cZfYa}egW``juXj^]\_Y^aefccg^cWhdaib[cec_j^dfZ[Ybbcdaa_\^ah_a`fcVZa]b\ddbcccacYccbbbccdcbrcccbcciapbbcbcb[acbccc_bccccbb``bcfd_\ccfceicccabdd^b`gj``bhcc``afb`ccb_bd_e`c_behecbdcmfaa\^f\bfec]_^\f`_f^d\]ba^i^ecedhafe`Zag^`dg`i[_^`_\h]k```_bedcb`bdd_`bedicfa``d`_[b`aa___dbbhcabfbbdeb`^cgccbcdacbeaabdac_cfa_cghdcca`abb`cceeafbacda`c`beiebhacccccccccccccccccccccccccccccccccccccccccccccccccccccca\^ca`bbaa\cba^nc`be]fdmZ\`f_h^aj^_md`hjaf^]]]fbbmce_lc|gaaa_bdddcga]acbcb]dedbdcd]`ej`_dhbaack^_ababbc_aa^dg^dTa`^`XeWjZ__^d^kUZdWY]Y^^a]dWWcioqtpVk^YYg[\]dY_[gabb_chcccbeddecccbdbadeadbebccc`adbbaebcaebcdccbacddbade[bacdjlaedg`\ighgfbiaakdghbbedm]gach^d]k\m`][cfikcaccc`cbaabccdcbdebccebcececedcefabcaeadbaab`afb`bacc`dcdcf_effif`b_Zcbd_icdhjfafeb\]_Ub`^\abb__d\`URd`cXhb^W]gadfnaYaacdc]_dbbbaegc`hcaicfghafadbac`]b]babfdcadcc`f`g`ebk^abb_`icba``aa``[cieo^f`b`fcccbed`^bdaai_bbfcbahcdccccccccccccccccccccccccccccccccccccccccccccccccccccccadcaddbccc`dbbdlcedgd_^eg]ec`b`bca_baa_hdcifcfebabfaaeY^_nh^]aZ_bbchd\^Z^i]^`qY`[ibed^g_dbcge^y\[T_^^d]Vcke`ffgcb]]]Z`cea[hf]Z_hd`_ghe[c`jcckcbfl^`h^a`d`_gadbe]ahbg_]accbddggbabYbZxd`b[gdb_e[]hZaZd^cd^\`d[`qa^baeaZfcbccccccbecdbcdecceceadccbebbcccbcbaacbccccdacbecfebbcd\`gf_\afch^af]dZgS`c[ikgee\fYg\_[ceZsagY`__Xka_e^_^_icdcccbccbcdcccccccccbcccccccdcccdcccccccccccccccdcccccbbd`ccccccddcccdccccdccccbccdcdccccccacccgcccbcccccccde`gagfT^c^aba\XjRfdSd`bd`ieagYkZ`dgdd^afjhcT`aagZ^`Zc^bii`_caacdfbe`g_bb`bbdhb`bc`]bjba``a`dceg`accf`ebdfabe]gace`_f_eg`_`bap_lag\abg]`pf`_b`_cjd^[ai^a`f^`_b`]aa]bebbbd_bdh`fcbedcbhcc[cbadbb```c_`bbdaaebebbcdeddeiccgjlXu_`]__bmZ^uVUYua]XXVfZcYfcjaZ_aTheeY]]eYVf\]bgldoUicbbdea`becaebcbbcdbaeccab_dc`f`aya`b^bcbbb`c`aedcdeb^cdZapb_aefcddc`d`be_ch_b`bj_d`b`_``cdgYeh_bbd]i`fcejcfjY]]eX][`ab^W\^bfaeb`d[XeedYfbbWbR`c[c^iS_]d__kX]]`eYVO@VKNbeU\]ab]ngTJrIg]_Qienjf[Ul@WiI[ggWb]Tpg[ul\hjq[R`_icddfeb\chgblddhcda_ab]c]kcme`_c^b`iaec`d__]`dcd_fa``e`cf`aabef[f`ahdgb`a`\jeb^rbcb`d\ab`a`]fodb`_e`aief\^bggccbbacbfil`af^gbebf[^b_a]a[f_`d``^^g`eb\`aodeeb`f```becccdccaccbfccbccibbdbcccebbcacccbe`cbccbc`becccdcdcc_gb^_c\eld]bhc^ed]edZd\ieg`cbacdcn\eedae_bjg\`f^ak]h`\dcUrc`_ee^cY`ax^d}\vYUX[ea`_h[^eYkbVVrVacKYbYY[ccecrgYdc\be\`bfebegc]aac]`_gfacbcce_abfcfafiafdkbf^ed`adb_fge`cceebc``bgbbbccej_fe^ab`dacbeefcdbdbf_bcf`cefdc_daacYf\cdb]bWaicgb__^_U\fi`g_`e[cYb`ncchmb`Ybf]NS\k_e[heY`ffdnfgaba``b]_Yd`^_f[Y\aa_e_`eb\`l_]faldl^``blb_in_]Z_adedcagce[X_adeZck_cd__s_j`e]lgea``eaZ]`d`\Xg_fehadffacaabcbcbf`ebbdcdceaggdabf`gla_bcb`aba`ijcg`eb`_bbd_a^ccc_cbccccbcgc[ccbc^cichccccacebdbaedceccccccbcbccccffb`adadacbb`fcccegcccaha`e]bd`k`bcbaee`caccbbbgcacccbbbcibebcbcabcfcbbabccfehbag_abcbbebbbcecaadbaba`bbbcbbbb\Z]jfb]``icje[]_[T[agmkkhfm_eYb]]]gmc_ebZU]gY]kaW\T`dg`cccccccccccccccccb`cddbcbcdccfcccccedbcfcfccdcfbccdcb`W_]bcca_]_Wd]f^_fZY^Uao`pdb]a_`[b`^aY^rdZdeytg[fcZae]f\fhdajh^agdc\b[m\ibccgbbkf`badocbbag`ddkhmfed`ek`mabb`f]bedacfc_cccbcaacda`a^g_bbcbab_bbaba`da^ycdbaacbcccbac_da`^fklf``b`gc^fi`qahca`ac_aa]c_^e[eel^dd^```cbbd`fbbccccccbccccbcccccbcacccccecabcaccabgdcecccgccdcccccc`a`fa`gecbcdfcbbbabccud_bdbb_\dcrb_`aaabea`bacadc`ea`bcpd_aflaiachd`]c`dcaab^cdh]f_Ujhbc_f`jmldfeb\Xbd_c\addkgp^g@h`EoJdgu@\kc[Hcbkl[IZMM`WQrBYUhYiOZQ[~gbRM`bcaNcccdbcccacbbccbccccccacecfccecbbcc^bcbbccceccdcbcbccejcccccccccccccccbcccccbbccccdbcbgccebbcdccccccbccccccbdcf`Yf`abaeYi\]Xbge\cchcdfaY]dj\hh]d_\bgal^hjhbhaa_^\`Yjddc`cccccbbccccbcbccdccccdceccbbcccbcbbccccbbcdcdcbcbccccccccccccccccccccccccccccccccccccccccccccccccccccccfZjeYb[`_dd]YaaqgadWZdmdTfd^^_g^_g`b^hga`cZ`legi`ZaY_Rab]bbebc`ccabc_abbbb\bboccbcac_cawfamcbcbebbhbcacZacbb\[i]ef[cddbd_g`dcaleWch]mYjZbi^ggXe_^bdffiZ`_]j`af]fq^cccccccccccccccccccccccdccccccccccccccdcccccccccccccccc`acdcbcbcbccbbacbbcb`bdceecadfbcaceaacbchebgjcdbadbb`]hgdhdlolhbde_eb`Z_\fjaehg`fdgkcdcdbcca`bf`dbgcgoe^b_cbeadaeebfad`cbcbdbcadd`ddbe`cZecbeecbcbdbddaacce`ebdcbeg^\dd\_cj_g`_fa^cdedgdgejhZZb`]dgdbb^[efW`cfc`gYbb]``ca_cgcccccccccccccbcc`ccbcfcbcebcccgccccaccbccccccccdd_hcba`bd`_ac_`___f]\gij^c[a`c`]pddhfa`babb]cnicfdagecb\clcc]abcdecd`aaci^`bb^aeehd`^jaf`beb`adcabf`bccd`baafbdccccccccbbfccccccccbcececebcbccbcbbcccccccbccccbccccblehc`ndacfgaZac^cgeb\_ggg^meY[dac]afbbea_`adea`aa\be`c^_a\_abdafddaadbd]`^hfecc]de`^`ck`ec_`a_\`f^g^abe^`cbidcch]^a^^laa\`bbc^acb`Z_ap^gcicVchc\ba`a[c_e`ac^_leg`b`fVbca]V]gaY]i\]aa_c`o]^lzZ_mgh`Yaga_f`gkgdeerWf\e]hrh`ebbgbaj\`f`^_Zedcf^d^bXioajoYbjag\Z_`cbh_W_m^bk]c`i`To^adcYUUc]bfaa``Tbd[`_cd[ikxdefm_fZ`baYihVlgfa[eT\heeaX\\_b_\`a^`af`b_Y]`\e`__`e]`]]c_\daub`eZ__g`gb^_`]`]^]hlm_d]b^_`cod__{_^]``\fa_cXfb^]eiZ^ce``Z]eb^c`hdc[b[agdcbcgd_abbccbccbcbcbabiaghfbbcbbehccb_ccabc_cdhcbabfcbccccccacbcbccccebccfbccdbcfdccbaaccbcbccdccaccccdcbh^^jcbcafcbdagg]fba_c\`cgda`i\b_fm`ccadgdbaZ_badck`c^a`Zck_be]l_agebh`a_ce_d_cibcbabaage`eb_\_dbff`akbmbbfeeYffff\iaggfdeY`kfkhi^kahahaeZcZdefeghhg__`g_icg``\iaeXdgb`d_``jjfbbdO`emj_^kfaej[deq^QghY_[`_`^akdd[Ykd\de\O^dSW_y]ubY_[]\\POUa^Kr`ZMWT\HaTVYUUWfMUTU`oWO[`boZecfd`bbcbaccdcbcbbacaccbdadbdaeccaafba_ebabgabdgcdbcd`cbdcccccccccccccccccccccccdcccdcccccbccccccccecdcccccccdcbcbccddddbccccdcb_dcbcbddacbbccbcbdcccecbdcbcddebbccccccccccccbcccccccccecccccccccccccccccccccccccccccccc`aeheaZta[_]fleh_g_akhjid`gd`g^\ee`k^c^Z[[\gf]dc^_c]k|dbacdcecccbfccacccbccfdeaeec`fcecccc`cbdcbcc`ccdcacbccdccdaccccccbdccdccccccccbcdcdcbadccdcbcbcccccdddcccdbccgcccbht\^f^hfmic\^\_`_YfcWxaca`i^\dchh^\iq`h]]b]XbgWjbadabgacbeddbbabadfle^`_chf`cb`cbcbbcegbbcbad`acccee_eccbccbccdcdcccccccccccdcccccccbdcbccbccccccecccdccccca\Z_p\bNcg\`\aSaalZj[WbcebgfhYhbZdf]ai^bnZ^aXe_``Zrnf\babcccccedbaccfdcaecceccccecccbbacdbcbcccccbbccbceecccccbcccccccfcbcbcdccbcdccccdccb`cgd`bbdbbcccccicacbccccclR[`pha\n\U]b]\hX_}[WZ``TS`h_n\g[X`][ibn`aXp[oibdob[cm_cc`bbbda_dbcecacbcbdc^macbdcfcbcb`fa^edhbebbbacdcbbdUn`][b\e`]dc^oU\h[Tdc``me^Sf]o`bX_agdd_sdl^`igYbiwfpb`acacda`]dad_d_^ldn]Z___baq]ciqYxc^g_\[\rVba`a]^h`a`Xc_jabb`bkcb_bacacbbgadh_ckdcb_cafbbbbaeibabaceaae]b`bca_q`ccacbcbbbcbcccbbcccdcbc`cccabcbfbbcbbcbbccbbcbccbbbcbubccabcccgcbadabbcbaacacacdcadbceececdccbbcaababdbbcdc^gifbab\`b^bbe^fcfcagggacgbecTb__i^ja_ebc`dcdg`a_abe]bbbchcccbcbadccccbbabbccebdcebcccbbcbecdcccccdccccccacccccc^bc\eZc`cUVd^c^bcb_`baaab`cbcdacacbf]cbce`aVbdc`[dc^fhbgckf`cbb]il`bbdbc^`]cbcic`d`ece_^b`ebe`_ccc`gg]ecbea`cccbcgcebbcdababbaccecdbcfeid`bccebebdcebcbcbbcac_jaa_agceb`a`^badfbeecdhbefdeda`ceb\h_i\bebdbbdfa_ecdacccccccccccccccccccccccccccccccccccccccccccccccccccccceYdl[becaacj_`Wdagkgca]bb]c`dcmfadbgadaceZ`]]cd_c_ahr^cbbcdcccbcccccccccbcceedccdcccdccccccccbbccccccccccccc`]g`\c`bcgbhbgbbc~a`_ka`dbgc`fhd_``_ka_^_ab_jebabae`b`fgb]i]aecige_jY`iad]\_`bi^abXac`[[bhcaf^f^`fjhaafb[a^hcbcbaeibdcbeddcac`edce_bdeacedcaagdacdbefcccbecdbccbbd``de`c`cdefcdbdab_cdcfk]bc]b`e_ehafecaecbceac`k_cbaabecdacacccbcccccbccdccccddcdec`cgcaccdbbbcccccccdccbcccgdadcabbcbcbbbbbbbbcedddecacaabcabbc`bbcababdbzbccbbebbV]hahWo^b\laX^Rj_ein_ccYhieYc[hjeTi^ZgYY^Dohada\KgfdgjbadaZa`e_d`ca_cc_db`ee`cdca_c]a`c^cede_db[`bcde_ec`ac^hba`h\V\gagviq[_hcd^dda_e]c`\rl^dedlZb]e^c\a`Y]h`]ed\bcccbccccbacbccbcdcjfabbbbcbaacd_fgaeac^bbdcaeccccdbcic^ibbfiaba`ccab`a`aZcfec\ad}h^afe`i_Tafa^baq^^]adba_ba]b_cbf`acZ`icaagdecdcd_g\b`c`bb^f`bia]aaic\dg`eafafo^ejkRZ^\Yo_ZhQ_Y[]~]dhacY^i^Ke]Z]_ld]b[]YiRarX^eWacX^g[_^c[cffchSYbO^aP\fadb_^\ecQqqqiEjP^WX^dagbp]plXTkK>_\j^U`^ab``ac[b__db`db_pcaofZc`cb_^^a^abbc`_]``b`_madcdcafdbee`bfhba_\cbdgdbaiga_c[]bhbgcey`^cbdW\_dda]c_cdchach_ccbccbccbcahdccccc_`_cb_ccscbdbccdbcacddbaf^eccdcccccdcbbbcbccbcdeecbdcdbbbdcebecdfcabcbcaebbabababdabcd`bbcd]b[bbj_W`]`V_bfc^mc[kidWR[ci^\aa_Z]ajbidfb\`qbaZ]ae|\hmhbebYaae]c^]bbf^b]`bgfdab_kq_a\fgfa^\fdY^[_aahda_c\]`c``bcacdcieadacgceibcb_`dbaa``fca`afb_`afbbq]bgb`i]cabacb_`cb`bbab\bb`a^m^bga`ceacWf^hbabba`b`dc`abcaagabdfkcgac]_ceddbUqj\hlbb[fihe_eeenbahc\bd[f_gfduGkhbZb__bZceadqacbca`abbc\_^deaaabbe`a_^abhaeaacbcb`]gjndcchj__^Zbk]a\caec`c]`g_\^]aieg]a[^d\f]aaaagfcY`T`eY^a[b\ch[dcgh`ccdecb_cccdccd```eghbacgbdeaa`ccacbacb`becdcbbcbdc[^bbb_b\b^`ahgbcc^__dal\g\dae^aaabh_^ga`dfigd`bgecadbbchbdccfc`cdccdccbceadbdbcccbaccdbcebacdbdc_ebbcedbbcc_e]f^Xa^]d^_a_]`dk[Y^_bdqf_\\Y^^[]\^_]^[_hm^^\`\b_sna`hVcUUZXX]]cy_[[Y`fYoTgZXY^crfRdl[RTG[eUZdUgP_faYbS[T__`ae`ccadea`bgec^`da_e`caa`abacab`a^e`dabfcccb`bft`da_be_eea^f_a]a`ccd^`cbVb\jf_`bbg_\^gcd`be`fbe_bi^fa^de`i`[bc\aaU^W]`ra_[bfi^b\]r\gb]^s]_^b[Zl_Y`We\na[aabg\[s^[d[ecdccfeecbdf_aedf^efbfdef`abcbcdbfbeaeec_ad^d`gbaj[fWbZffWY_gdvsMgd]p]cit_dVhe`gegaYfhf[da_]Pcef]d\f`]bjdbaXb^ma]idbbZifc`f[af^dcdZkci`h`[eeiicafgfl`aZaa`gcg_gcchadad_f`b\d^fbbiebb`e]ko_h^_ebbb`a_f`edb_dec^a[c]cideccccccbebcccdccccceeb`cbaedcccc_c`bbbgaaccadddcgcccaMYa``fjdhagah[v_^fca_n]ca^i[_bfcecdeg`eg`]ha^gmfrc\`ak[^PXad_eY`mW]`G^\]^X\g\U]v^_V\R_f_V[_gY\i][Vc____Zj[cdbXa^e_b_^[ecb_d`b\Yd`ZadNcdcdc`Y`cbdccd`[_cd^_dWa`Xde\eVck^amebl__ZnbddjTaZ|][e_[bbda`_b^_bgbXb\`hah}an_bakr`^j\gffjY\^Zbi[eaZ``\h]`gcciaghgb_naSecb]ev\df_aebYXaTbef`qQ\^^bedbeYdeU`cdhalb[h[]Ybfgeg_Yd_t`adY`d_`bebaca^fbeaa`hdeca`ccfhabegbhcc_`ahb\hd_bbaca`accf`_cddbhfficdafpPbkfebleecg^heca]he\ngedkefg^e_dacfj\dd`ag\`\gacccccccccccccccdccccbcccccccccccccccbddcccccccccccccccffddiazdca``\Zgef`c_bgc`f`^]bgecdbcd^c_ae__`ha`ecf`bc`[V`^ddZa[ca_bhicab\_bhe^a```\_`Udhlch`amb]^oj^cd\j__faaaiabcccdgffabdcdcb_edgabba]``bbdceeb_baabbaab`bbcbfbk]cdg`]a^bf]\ababe]]^td_bgZf`]juaaf`dfb_bX`^g`ajb[d^eZ\XLWoYa`g\XXlec_dVf\Y]X\[`lXS[`[aZZYa[cmqV^XdY^T`\bY`d_bXadcbbcbac`hc_l\bd``h_dbicbacbd]felcb`c_cbb]cc`bbdbgcbcbbcefbeccddcaeccaccacdcccccbebdb^cccccdbcbcceccbbaZejb`kfka^a_^fdacche]ec\a_\c_[dj\gbad`Yev`cagg`ei^`bhmcU_LLX^xQi_JG?Z_>GNo:Mi(=jVi;8o>3uFdf{Fp9A`j/tWQN_ea_`c]ece`baXedcck_bbbdbc^bd`hc[edbetacadge]geaaje^d]cpd`d]bWc]g\dqgiW]jn_[g_bW`c_k`_^^Wlad`\f_e^e_d^^cZa_cbflf^]anddbkkYkncaaebcd_cYdegeccc`ff`eccefbh^[djhaea\hh^\]_\af^da_\c_b]Y^cZe[V\fdVZe[Ydfh\fg\bX]aiZeadl[[gbbccccccccceccccadcbabc`ccccccbccccccccbecccbcdccccmfcbdbcddbc`f`eccgfcfcfc_d``ab`ebkb_cbdacaeabchcccddeda`ac__h`gdd_gche_c`ac^`c]gdejecbcfdhgbgcgebcbca]e`cbgfa]fKZPOG^^ParV\gNi)NnXFV]RVcUpaWUKYYOZSlUVDPIQ[[y]_W]dV\^acc`h[a_b\gbga^`gid_jf^lfX\`ag]bcV_]gdeb[d]ec`\`hYnia`eTdbubcd__f^fZ`njfhg\kYdX[]o_`ec`ed[pZZ[hcW^]babcYka]eb_m]Zb`^^x__ai`cVfj_]X]h`iaaZVe]Xl\~_Q`dxZXhaYaghi^gffiacahdam_a^fcdZgd^c]`id_dc_gg_f`[]^^he\^Y_jZbdecd_ipi^bba`a]aa_[a_ahUa\gT`fe[`abb^cea`[q`gbbr`ic`c`_^hbdgifeeaeiafcfge`jjd`_ieffh]_bcfecdfaghdead\mbfd`ddecibc`___`h_baddeagbdbah`b]`ia`ffb]e\ebid^ec`jac_ga_gchaf_fnbe__fdbhgaccaf`_cj_d\_^cY`c`cbb__jc`b`b`u`[_aeddwca]jcccccccccccccccccccccccccdcccccccccdcccccccccccbcccccc_bbfbdic_i^e]d^ajgdacoa_e^p^]aahh]_[bo``j^c`_fiadca_\d{QidncZVRQZbYdd^Pb]hb[_gYYKXUR`Z`^aeaZYW}qfje^Ocvh^efQ\[cfW^`aY]c\q]b`]d\eVg[f``daa`igbefdcelaVc`jU^___\_\Odabaalgc[ba`agkcccnaadi_d\c^j]ga`g]gfdbbrigWV]f]g]cabkdccccccccccccccccccccccdbccccccccccccccccccccccccccccc_aah[c`dbb_j_bdff]gadf^hZ_bci`fe\f\_bdfgY_[]^aaea^b_eccccccccccccccccccccccccccccccccccccccccccccccccccccccb``b^dbbdb^dbccdaaccdbd_iagbccbcjcccebfceeccdccabhebdcZ^jbffc[g\dPb[edt_a`WhXXaZeZcfY[`^e^kbSdobUdZn[[]lVdacccbcbcccfcdebcbcccccbbccccccdcccccccccbbbcdcddccdccccbbcbbbbbcabbTbbccblXb\`amccbb_aebaeaagbaaafd`f\aadsbbabSZbZdce^Rab\j^eW_fh_hVlfdfWe^fa`_Yhd`_eZ_kV\f`_eU_Yma_remceT`ebgbj`^^Z[Z^e`cerbYnd[g[aXjbbij^`h\ZXj\iagcijbccccccccccdccccccccccccccccccccccccccccccccccccccccdcccbdcbcccdcfdbccefccacaccccbcbcfcacfbbbbcccccbccccacdcd_[]aeX]`Ydfeh_f`yb]fa_aJc_T]l\jRf^Xjcao_[`caX\d_QdUb]]eedb`bc`jc^ebaadfd`a[`]cbgdibbceic_gedceeca`_ca`cdbaczae`j`[c\bae_^]g`^gggf`e]\_b^tY]Xbd_`d`]^baa\b^gb_b_e_ad`cgccccbdbcbcecc\aa]h^ccicabba`iagbcdcdde`acbbdgcbdfZmYZSd`a`Z[X]__^^[VdRS[Uq`]cT[ZXX\alrYZSQ[lW]d_SZ[aeROele]^hWYd_[]Tabhdghff^`[WnZZlff]h[aigfbcdkX^jaaeemjZqeaXa[f`]hbXieZjba_dg`bbd^[ceac_bm]cb\dbh^yZgctcZekfb^lca_fbcb`dcadbbaadec`cbeb^bcebc``c`adi`idgacbYfec`cafdccccccccccccccccccccccccccccccccccccccccccccccccccccccraabbc^c^cd_a^eaed]_dqx^]]f_gzecdc]_fb_d[[fZ_\beb^pd^`ccccccccccccccccccccccccbccecccccccbcccccccdcccccbccdcm_feb`^b[mpb^a^[`gb]^lc_cg\`]`jfdb`\]cg[__d__\Zeadbcel`c_ba`beebffcc_gae`bb``ha`deabbab`a`c_`\ajcfbb`ccabceggdcac^g\i_bY\Vc_j^Ybbc^fcd^ihmbdWko\fccc_[faegYa_``]]h__fcgZ\]b_afeY`sd`UZbad`_[XVYck`dnafkYk`bkc[oiW]_]hgd]V[hghXk_Zkik_`Z`VP_SkYt[`YTW^eXm\krfd\aRbUeUZsQ]^ijU^\cccccccccccccccacccccccdccccccbbcccebcccccccccccccccecgbccccccbcacbcceccddcccbcbccbcccccdedcbcccccccabcccccdccccccccccccccccccccccccccccccccccccccccccccccccccccccbbjbaabcadbdbbgcbcdfcce]eaebcba^b`fr`aaeb_adccddcecbab`Zdbcb[]e\df^Xc`d^^d__ee_e`\c_cbd``]aadj`b`bYde`caYafRhCbS`YJUUdaU\9t`bSQwZYYb\]O]yVgXX_ce\[xWtTGTEW[S^p]Y}_aacc`agcadfb^b_hbacccf]Z_bmb_\bre_henbbeeadeZcbbcdnh^^[b]k^_b``cbkagcaa__fijea^d^e_Zl]^cVei\Xeb]^_b`e`db^c{j[e^Z_]a_gdcb^\ab^^`jbhs^hmae^ce_ae`amefa\abegaeafc]Xf[rc`ffdiUU`_eedajaZfgQb[ccckbc]QhgZ`gge][b\kjbT_Z`cji`bdb^_f`cceb^dca`cdchV`aWg_jjc`^^g_cbaaedfeg]cdfea`d_ef_cf`Xgategf`]]^YY[afo]j^`ajd\^^Xde]\e^Zg[ZhghlXS`]h_WaaYfb^a`[`g]_d`fddm]ab^b\aajbY__`[W`e]bef[ji\ddabcfabffecd]aa`bfeedb_d_ce`decfc`dcda^`]dfacaaa]_a_^bd_gbe`d[\^d]\jrbfgbTXu^QWdb]jZZkidZfYhlXhUZikce_fVZVcXOfbdP^]e^_`ckeh`dace\`]]d_\_fhkhgcc_daYf^f[aedc`abmbgccb]efd`ccbcccbccddbdccdcccdceccdcbccccbcbcbdcccdcdccbcccceebbcebcbcbcccbccccccccccbdccccccdcdbccbcbdcccccccdcdccdcccd_eh]`bcdbfhfc_aa`]]c`dccfbbhbic_e_cb``^c\a^\`idbggefb_]c`^cjfka_gb_b_`b_ac[oW`_`^k_[\kbb\b]f^u_dcakk\clbcnhbd\d`bpka```a`gc`aaea]ceb_ac`bic``bbdhgd_ebfksbbadb``ff[_]cy`bkfffaa`e]`gep`^cgfbV_adl^\^b_ebbgdlYeachc^f^b[_jb__w[ddeb_a`hfbgdadce`[_fdh\jadT`ikcZeYdaki^g]]jYhdg_Zdeffhdnc`b__Uf_gmchhcbb_b\c`ckbYZcgc^^mS^a[me^ba_`bb]eUg_h`dcggbZe``addhdfcebafakh_^ea^_ac`a[dc`d`da_c\cag~mg]e__`cf^Wji^bf[khX]_eVh^bfhZedbchdab\da`[a^a\cY_^lg[ji\neX_]dbgc\Zfd_V_nha_`_e^jf\_e^ae[b\keb_Uce^fc_bc`_bj]pddbaeffikf`idXiia][bYf^d`cbbi`]dcg`Zc\\ebh`jbg`]^dcd_edcccfdcdccccdcdcd`ccba`c`cccecabd`debbegbccdccdddc_^^fac`bgbagaacgbd`bc\fge^_c^cbehb``d`a_bsbdebeac`kdb^eoabdebb`am]aaacaghad_n`edj_``[a_`g_`a`baffc]c_`b^babcccbbccccdcddccccccccccccbcccccccdccccccccccccccccccdcccccccccccceccccccccccbcccccccccccccccccccbcccccdccbccc[Vd]^gy`gXT`bX[^e]kg`I]ZhZvc^Xfa^a[`Q_]k\_`^TdX^[d[Zd]_k[e_q_hY^i]djbpd]f``[cdfdk]]^nbceiU^gmm_aee`^`Zb^^ZWbaacbfbcccdcdccbccdbebbbcbb`_a`cagaccb_bicbgcebgccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccdccccdbccccccccccdccccdcbag`\abjhbacbbdbabgddiaacaac]a_elb^bbgda`dbada_cdbcbbalea[`]dbjaZbbc_a_bifh``ia^^dbZ]b]`^dp^_cafald`^fa`c_va]^Y^Za`bfib]]abaab\^i]Zc[``__Z_i]^eaidaad_e_eebbabbzfcea`a_^^dm_b_cecXsc^\bbadac_bXnwii_cedghdaVU\gjY\_hdcdec^fddf_bjf\h_c`a_c_f``cb`dibchm]c`fc`_ed\fdhacf_b_^`gae`adbbbced^ecceeecebd]daeaccdbbbcca_bcdcbhcdcbdecgfbbccdacabccgdcceccccdacbefbgcccdcc`ecccdcbadcbbcccecbccc`bbbeecccacfbccccbcceckdddhca]cc`cba`bdb^baecncccccb`ccZ^][X\[aZm]]b]\c]wZW]^V\^|WcZb[dabYr^_`fwM[XZ]\w]_^[`cb`fj`bcceabbcf_ae`cde`]^aicbdbiaffbc`_chacbkbd`abid_adcbbc^cccec_gcceccddcbbcfcdccccabbcacdccdcdcecddcdbdebac`h_eYiPY\bSd`gqkaT[[a_[\dAXcnbe]n[cd[`lhihaqjN`_^iakeb^ggeabcgdcaacbbaeeidc\beajefa_e\aada\defca[ddebcbcfgb_aadcbbbbgdcf`ib`e[jfka]aeZ`a`\he_d\bb`cbg`ted`^aggc\c^`bdjfecabadbbfabcagabbfe^e_ea^ffhccfef`cf_a^cgfbcadaabaccbdccmc`cbccbcbcacbbccbcccceccacdecbccbccabccbbdcdcch_daYhha[dflTZljg\afdlZh\sx_iW`cena\eSblNZWgiiZ`gfcjZb_ifabcbda]baa`a_a]caWdfg^e`de^a^e]`dcb_abeecgdbceadbcbebbcbcegefdccccbeccdc`cdbc`bcb^cbadbbdeebcaccecffbbdeocVh^Zc__e[bc`^a]ck`fb]jb`e_]`id_ffb[\`edbaaa`d_Ybfeibcbdc`ccbcfcbccdcfbcdcd__beeecbcebccdcaccbcbbcddcfcbddacc^`blebcdbaeb_k`eabcb^bcfadcd_ba`cdXd_gadckdcga`Xddd_`]]j__afbbe`al_caXXjbl^acab[_[kjec_acfbcq\g`fl]bfc^ghe{e^RU\^e[eTdQW_iSUyYh\^V\YQ__UnUISWYf_YmsSQqkZccajZ\hdd_b`de_dddd\lZfabacfcbdca^d_kb]b`]aegh[]\cfhepf_c]aa^h^Zbbbaeicicebbdb_dcc]bgc^ccfbhbbbedc]i`c`b```acccaeb_ccbcbcccbdfdbccbbccacccdd^dddbdcfcabbceccacccbccccabcb]jf_b]n_\gedfadjebbWbhj]]]aiV_^c\iZdZ`_]i_`[d]bb]^jVaa`ecbccdgdYgc_dcbacceacfgacbcebcaba`bcbcahcddcebcfecbdjbe`bceaebacacgeeeb_`bfidab`_afc``cccb`aaaea`ec`b_g^asdZeadcaXbb_ff[fh[eb_ckgbbjf`edc`e`c^h\_`c`n__\\d`ffebh`S][^aVYnkbn_drkUjhsX\gvbgnc`TdWj_YZ[WTpb\Oo\RqX\}h`aac`ah_acdbb[n`^_`gfhcd_Xwndd\c\dfe]fmU`]cbYW^W\jcabZmd[^[`a_b]b_b^_aa`[`aaaa\aa__ba_af`aa`h__i`c^`^i^`uab`aa]f^d^_ccdcccblafebbfec_cbbeeadbb`eecgcbfgdbbb[ehee]gbacacaa_cacde`fcbdddbbbbbdbnc_bgg^cgbbcdabgaabb_cbddbhdbb`dec`^^cah]dabcdafdfa^aaj]bg_`_ccas`hbfec`caddaadcbfdgf]g]fcaajm[^f_ZdZ^UYdYdYk[VhW\[_fg]adiaecdYifg[i`iZ^b]^Ygaefe]```c`eZc^biab]d``f``bb]Ya_jbbcgh^fbanr_\^^dfflcafd`eacdaccb[cdb`ddcd_bcbdccdef_cabci]beccfcgbe_bbdcgdci\dbjac]agb^__ck`gbkbccdh`fYfada[bdde^__^]c[ac_adbefibcccccbccddabcccdcccecbcccccccccccccccccccccc`cccccbcS]hfaeR^`Xodo]klc\bWba[daaf^g]W_eb_aX\hemclY`bdi]_WriRSR_vdZF;YpKkb@RKUt{amEp\rZfKg.M5^CqehmZ7d[yybPx[c:LCQd_bb^ai_h`dfeacaa_e^cefcggbac`de`bdbac^_be^]`edafkeadZc`YZYRYF]\ZaiNZkdU^YX_ObRSeU[\_bSj^_[mg\bNhQS^Qa[[UdNb_e`_j_^e]`J`bdX\dkf\^aabf[h`abf^eobaeci]^Vnq[Yca_rdcdddcbcccccbcccccdaccbcadcccdcdcdccdbcbcccdccccbcdccccbdbcc`bc^dafdbcbcdbbc`ab`bbedc`dfbgcaefdcccfabhicccd`db\cka_cfngd]b\_cbah[bbe_^[habb^fdZdjg`Zhlcfaa^ac^Zj`[\~\bdf_cbebiZ`ah]fcXccb\d_fZa_]lg^be`\[bjd_`d]_`e^c^_gau`c^]\Zc]`dWX\[Xae]Wk\a`a]`fkXZyijfakZ]oc`\af[^buZfWeedafcegddffcp]kab]akac_d_eaf`[bfda`ae`jeffc]Zjidbh^adWg^bag_ab_i^cb`bmaj_ccbban`a_`d^`c_ckcg^b`jbj]`_`bie`c_r\ce`hZbaccjfibc\aZbcZffa]d]nTbdYnZd_\^bgeok^^bU_edYb^dgaVan^Zrdcd_]c]_YmQgd`a[Rq_dY]admf^YYUsgqml`\fi^hdYZfc\Z_i`h_]_Z_]a__hp]`h^a[ax`a`aY`edeg\^`cSRZTaXbefVc]aabdcabbcjbddbbbbabedd`fdfacc`aeadhafdcecbccb``ccbecbb[`]fceccae``cabfcaedd[_bbbaeb`cjcda`beddaccbcbfccddhdheb_]b\cccdgbdcbeccbbaddgdgcbb`eec^f`bcbadccbg`bbodeh`ccbbchcacccc_cbcacccbeaaccedbcccbcbebbabfbbacc_eehcebcbi_bcfc`acei^j\`^_bcca^nbbaf}_fc\e^d^`_]cadfdce^c`^b_fe_ccdcccccdccedccccccbbacbdcceccbcbcccbfbccccccdccccccaccccccccccccccccccccccdccccccccccccccccccccccccccccccbccdcccccccbcddccdcbbcbcccbddccccceccccccccccdccccccccbck_aaeahb[d`a`a_c`]b[ck\id^fc``aaa_`^d`a_`e[_^^`e__dg__dfad_bcag`eabcac`agdedcbdbebaae_`gbadi`dabgdfdda`bbab_b`Wcf^caap]_a[ZeYebd][fbS[^l^ba\d`k_n`nfa]\c`^gaefj[_bfadcbbcgddgdbeccbbabddcdacbbaeegba_bbb`bbbfbdccdecbdcV^`]ef^cn_tac`bg_ga`hl[hdcsnfY`\ge[_dd^[[g`]S_`aab_^\acadbbdbcdbdhccbdcfbdbbaebc]eaciccbbacb`bbbcbbdbdcc_baab]dfbVk[Ydebebdba]_`ffae\ge[ed`g`ihegdjkdihe`h_dl]ebfhbdcdccbdfbb_bccbbbaccicccfbb_bdidcfgff^`d__bbbbbcdb_faRc``^dnSaedfegfcfii`__jd`chhafg^a^eec`cdkj]gdebdme\hbpcfbbbcccgcaecbcccfacdi_gbbcdgbaacbbdbccabbcb_dbc``bcZccccccccccccccccccccccccccccccccccccccccccccccccccccccccbdcdbcc_bcccccdceaccdcgcacbbbdcbbcbdcbdcbcbcacdddbdccccccccccccccccccccccccccccccccccccccccccdccccccccccccccccccccccccccccccccccccccccecccccacccccccccccccbccccccxb\b^ia`qGaHhj[RflmidhEWTdobYah]\hhed`Webp`m_iWgKPTvYjfc_dfdbbb_ai_nd_fd`cgvcd]aa`^`d_aed`bc_acbcb`bbcehacefbcbh_bbc^d`ebcacbbbbcfbahbdc_`^Vrbcb`babdacfddecbgebhe][gbc_^baXPcer`b[cWfjXgbn^U`b[l_Zfa`c__dendg`ccchk`caebeedcdabfd^bccecdcadcfaeccdcda`bacgbdd^dbdb_fecedagdbflY[Y\]XfdahX[[WZce\VYcTc[zXdCX`~q^kb]]ZgvMWaq_U`fXuf`]nmc[`\`^_g_aY_^^geU[YepbaheaaedcOfg^Y]fZ[bj^eS^kdOnZgmacdbabcccfeaebbbacbffabcaebacbg_`bbdeg`afca``dd`c_cbbe`bccecccab_daccbbbbcdac`acbcbb^cbcabbdccbbaccfcbcbdcc~Zc^[d_abZa[dav``jYaa^gg`oufd`ca[bhdg]Z]_]Z[_`^a]Zae`b__bcbbac`cfacbbcccaeeceb`bcibbccb`accbab`dfadbccbbbccYbdiah\bi]gbge``_kjef]`_\^ha^_a`bcdif[\fdhiiie_bcf_adc]ncbg\^a]d[c_[[_Z\\]x[bf^e^]o_\yX\a_aX[b^Z^^bV]ZZkf]M_c`ccbbbcga_cccbcccbcaabbcaccgcbcdcdbcbcdcdcdabghbddcdde_hoe`\f]eaad`mfd^\g[Uc[ac]bkjXb]i`Zd_vg\_ae\_dtec_^\]d]g]ZZ\d_efbegd`]aa\_``_fc`na]e`_`jdbnb\`e`aba_eb__d[fg_gcb`bbcdfdbdbeabaaafdbfcecaccfcceafbaba^abfddachbadabcabbcccbcgffbcdccccaecdb`cbaaacbebbccacaaccabcbbdcbe_[gZ^m``cXakZ`b[__^`^`h_[am_`c^W[bc_u`a^]^kj_baba`\`_ob[afaebgccgceag`ad^ba^cgcfcbcedfae`dcb^bac`becdb_bcgcbigdXb_a[`ad`Pk\]hjYh\`^[]]g^\eboe^eeoW\clfTZaik\Zcaa\h[ZN\V]XSa_X\aW[TU_NKS^LR\jjV_bTYYXWRXSRRQNfPmR`U\ZWha`fa_ccccf`eecchcedbjbadf]bcaa^ccdbbcbbccdchbccdcdeabcccccabccd`gcabaccccbabcgfccdecccbeca_cbdabcbabcbbecdkecbghjdbbWg^^bdbb^eVg]af_khg_ee`c^_b____`bXjljaaacd^^bncbbbbabchddidccccbbcabcg_bacgbdabcbg_bacbcbdcbbddcebdbce`\^_`bb]_X_aaeaf^a]c]da^^ac`ad^f]\acdcc][\_z^dkaaeacg\ajb`cje`bbbabbc^_Y^aia`db__b```bemoi]ec_ccaa\d\aacbb_fcbcccbdagbbeeaeaabbedbccda]`beaba_eggebcecedidbfebbdfddYacbbfaabadc_`c__cgfbjdac`ke_h`bd`bj`bcg`ccdbdcbedcdcdccccccaccccccaccddcbccceccccccccccbecccbccddccccdchfZefaicfabdfcg_[`ig]ieeaea`c`b_cdebc``^faaabbefead_`icccccccccccccccccccccccccccccccccccbceccccccbccccccccc`dbcfa_dbdZf_aac]_`cc|cao`dacc^cfbbc`^`e]_b`^``ca`db`daa`_`abcmacacbeg`coaabqcg]UbfbYdcab`bbeaaig[``g^chbbbaeVgggmb`jdfg[_^eTdkUjeb_bkfW``kH[Rjb_bWilceJi`diZea[bccccccccccccbdcaccccecccbccccccccccccdccccccccccccccchacbgb^bbcaceccccbcbcbgacibccbccdcccacfabgdcccbecbdddb`ciee^fa`f]dh``blablb]`ab]g``am[^f]bg\hgi`\_c_^f`ccbebf`ad\c_cadf`cecab`ad_`cdaj`b_hcbfcd[cdbcgddhcejacbc`acabbjefhe\bg^`\``^]_bc[b]cghieej\h[_Y`d`]bbe^c\mc^ca`j[da_jcbd_bc`ee_bcbbacaacbg`cabkbbfcdhdeafebc`baacbbb`ccfacbccccccdd`bccdccbdcfacacccdbcbcbcbbcccccdccccdccdfddcad^cd`bcaebecicccdaacceciagbca_gfbbbebabb`cbbbcaibddacbacdbcccbbhccbcbcbc_ejchbecdccZbcbc`ceabccccdbc`bcbcbb`\Ye_dfcc_`gi\_g\b_qe_g__ci`UZgg`hzdccba__fdasXZ^ca_gaat`^e[NkUU]X[yIO_WNa]Kc_ZPRUVGW\PhccYbiVe_][Hp\[PUZje:_hgfgb_`jfebT]fb`hgniXch^ai`_R_gfZa]bZcac^]jc^abcg[`fkot``efa__gaWlbSc]o]h[cc[Zhc\h_dq`XecctdcZTZO[g\_VaZgZbZodacaab^d_am_begabas_dahdcbd``faa^]i`icfb^dcbb`cbc`adbbbdhbbcccdddc`cc`baedcbdabccadcbbgaeabfc_adb_fdccebae__dadbcebeddcp`cbabX`^Wjf`f`b\ldUd_dddg^\ex`\gbbmb`n\hbbbegbchegfg`aa_Zfbkab`fd]Zd\a`ch_Zeb^bagbrd]gncd[`n[c^^hcadca_hc`bbdace]`dcd[ddc`bb`cbabfebi_d}ha]`bfdhcca`cfcab``cfe^bcaaaadbfga_cedaca]_ccdfbbmffadab\da[abbbdawgcc_abb`ee_``ab^]a``_dcf`da__bb`bf_beb^adcb_dc_b`c_cfhheafbbcehe^ca`bbfbaaec__]cbb`bf^a__a_ac^abbddc`cce`edccgabbccdffgcccccccbaaabeccdecda]cbeacdbbccbbebacbbabebf__ha]]WW^[V]\REgOT_Y\[Vc]^g^gbiW[[P`Y2_U_N[YcUWU^Ttk[Vg[f`Qdc^]fa`feacqbZWc`ahc]Z`hha`^\gd[]keh`agjl]e[``cggb^c[``]chYghj`ZbZ]a^df__jkc[gdgje[ZfbVbX`gah^aim[[`_ad`c_bb_bfe]dcdaeddcebacaff_deebacbbbbff_e_dgdhbfdcfccccdbcccccdcccccccccaccbcceccccccccaccccccdcdcdccccccf]ha^f^egh`j`_T]c_\cd^ihgb`nc_Zad_egd`^_eea\aahYiebgfeje^ccb`__bh`ba]bj__s`db_bdekdaj`igaaa_a]``ba`_`deadb^ec_cg^accfdc_gccc`e`ffge]fbi_``gcaaec^e_db]af]db`bcbfe`Z[ipZa[aP[cX^\a`_hU^r]Q^^_eYaYcci`p\^ckcYXu`an]f\iZiha_aadecbcha_^cafcfddch^bacebbia__fb`akdccfeaa_bcgcecccbcbcbcbccdcdcccbccccccbccdbccdcdbcccdcdaccbcbcccdcccccdcbccdeccecabcccccccccbccccc`ccbccccfccbbccccbcdccceccbgg^jVab`mNkHe\MUwl\rWrL\>pn_WgzgWbg\[ebzhjbcfhYdTC\qPi`[co^cdd^cc_ede`wa]`ei[bfdacm]^_bab^f`aa`bd^d_ebi`dfZeddad_`bd`a]f`a``acijbcdcdcka]^]oe_hd\[^_fdaxcb``_d`afea_ke\dmcZ`\_\cbb\dgedc\Ubhaacg_f`brd`deeed]djfi[g_cc[_a^dY_\oaX\[[a`XokTWg]g`U_hYdWf]ef_eb^{dec]]W_ZfbYXa`cie]^b]_fg_ifd`ai^]i^ad`c]f__]^bc_^_\\\cbicdbiZ_db``eiab`cbcdcbbceadbbccccccfcbfccdbbccbccbdcab`cccabbccccaedccccccccdccccccccccccccbbccccccdfcdccccccccc`cbccccccfeY]W[U]Yca`eg\cbPRccgfRiidCYVUc`]fcl`Yle[hecW`dfVd^VeXbba`aabbja`aca^_ba\``cbdbc`dfaadp_daebjhadb`efcb`\c_db`[cbe`hncbge\o`bffe\bVce_dibcd[]`]b[f_dg`b[bdi`]```faap\cdc`[`ee]ic`_`hf^g_bbdbc`hb_`YSg\d^cU^^ficbgbcff_hh\ccbbcdccbccacccebbcaedc_eebcbcaccbdfad_cccj`dccccibbbc]gg_hd^`kZhcg__Yfc`lg_\c`e]i]b^jmbgha\f_^b]c`hWf\]cZ`Z_DWVWbbVfHYTISK;UZKNdUfQD_YN]g`icZaqUaYV[_U_qW`Hca_d\edcc`h_a`b`f`d^[]ic]fa`_Zcehenlahh`hbfc^aqf_cd_`Wb]b^_aac`hciab``cbe_be^fh^aafdie^ce_d`g`e]abh__bac`bejedd\dg]_eeaiiZ_bbfeaf^e`^fddamYi[abeb[d`Ycqbc^dfak`[d\f`kb]`dab_^cbbfdbe_bg]a``^eb]b]gfeg`^]Yfgdo_^ribbf`dm^gacccccccbcaacccccccbccbccccecacccccccdcccccccccc_cccb_b_^_`[cgdcg`b_fac_fab^mbedac`dTbdb[c^gabah_ba`adbag_^dabd_cfb``ccbegb`b`e`ab`jeada`g`bcc`bedfdfcbacdddcdddeabab[c_b_fjabbbg`cbeb]ddfcdbadcalcf^bafdefccc_bddcgahb`dcg_b_cfecfaac`caabc\egbdbda`\cf__bhhfbceaak_b_cdc_bh[ZXbb`bdk\bvcd_]f[f`cmc_g\l]Q\bc`j\bd\R_S[^Qh^Y^y``c^abafbb]c`dgea_hfb`ccbVddafc_d]^ca`bzeecbbYfcc[accba]f`leaYae[agToZlfbX_dh]^t[_Xg`\[aZ]gXfg\WcZ^g\YZ_^c\VZiebg]d]cbad_hbgfbedVcccajbb]`ecd_edcbhb`\^]ndd_eZh_begejddcdbacccebbcccccccccbbcbcbecccdccccbfcbcdacbbcdfcdccdecbcd]cbccbcbabbcbdbaeedeeaadbfacfacecb_cb`biaebdbcbcbai\c`f__blhgfc[W`^][^eQ^`_d[kj\Zagbfni`bedl`_`ga_a_[]aie^\mc_`ced`e`ab`YZkXc`i_aiXda_hRcS^ea_Wkcqa|`cW_Rck\a\`i^fhfbae^^af```hdZba\fg`_lbe]biae\ddfab^b^`]id`a[b`ietZ`ea]ab_kg[de^b_``_habe\R[]vXaVaqe[UWed]ZoVgbjaah^b]aigbadabdcdgafbcef``_gcddg`cd`c^a_bda^]dg^a`gf^dbbhg_bfcmi`e_cbhnaY\ad`_c\a\kdg\d\^]ach[abdhf^aeiabcc^abbba`^`Zacb_bbd`cj^bcfYY]W]b[ccbdiciiab^_qbaadfb[gcna`lc]d_ma_W`w[_chio_d_[TOvZifehnYa]h^S]]_X\\d_iYcksX^ZZZen[k^cdecaccccc`cfcbfaccccecgebccbbccdac`ccccbfccbcccccccbcba`dgdccdc_dcbecfcdbbabadacccbbcdbadfcaecccabbebddacefhagbfhla_\edfldaoge`]e_bega`eih`gh^c`ifbe_h^h`_bah`ahi`\i`bddcecch^ald\ejd][ck`^`^b]geaaadc[ebjfhfa`p]b\aeg^afbcccbb^c_bcbbcab_cecdcbdda``^aba`_je^^badebobccab_ifad_ccbd_a`jab_Z`hffaafddegea_b]`ed^bb]afg^\aZd[c__a^jbec`]ie_acae_`a[bl`^]a^ca_cd^]`ghefc^_]]bfai^^aaaa]^`d`ZfhTdGKciJVVWQf^eY]H`W_`_m_`ffdjR[\\iZTkSgZXdXbT[Njbaf`da__]adkm[^`b`k`^dbadh`b`dlbXdg_`cd`c^fcd]\dcjbhf`Z[re]^e_Ybb_cT`dXXkeXrV_SUUeW^ZbjbXlaXXfZ_cl^^s][tXNZjYgc\caccbbcgddccdbbcccecbecbccc^ciccbc_ecccccibbbccccccU_mmmga__[gl\gbX]\p\a`pWZeq\g[[ggU`WM^a`\\[MYeZc`\ZYs[aa^dfbcc`cghcbadbebc_hcfdbcaeb`bbibca`aadcbbcfbecbib^cbccbbdbdabbcbbdbb`ecbcbggacbaaeccddcddeacbcaabbdaeaebdh_``bcaa`a_dfba]aaafahchbdbb^cd\d\]`ca}`gdaa___cb`mbb`f_aV`cnd`]`\_tYbbe[aZ`ib^dbiaf\da`cd_f^bdabedsgc^cbhib^i]uX]Z`fff\a^aVratUX^X`^e\dYha[pi]Xe\s[?Uh_`TWa__pmX`c`eebicdcacbbcc]dcdaccfbfcfeg`aacacfedbbbbbabbadbeabcccccccccccdccccccccccccbccccdccccccccccccccccccccccccccMc`dht_ZYcYg[d`l^[f\Waa\ghySf_gbdYXRWqiqSXggb_[\bbbdfbcebbbcbbad^ebfad`e_cg_ccjbbbaea]dbabgjbcccfcbb`bckac`deg\edbc`[a\gabca`ba]dchbd`^`gcfgbf_a`ma`a`cZc]dca`fbbiYhSjeYLj]B`gn[eblooWP_NlibfpoeiejndcioacXmhL_c^]fi^GOL`e[pd^g]i_mWQZ]Zb^YcgjdjUqgdRU\`T_hee_g`e]imZT\`_m^tcccccccccccccccccccccccccccccccccccccccccccccccccccccclffdfa\hjcebZW_[kuRbb``eadhhYYXhabedjeb]`gek`Xkd\g_hg]cabadbccadeccgcacbdaceacgbjbcbaabbbaddfdccdbbaadccfaced`fa[d]bga^ge`d^c`h`ach_[icedcg^ccbbd`lfhic\^ae[bhpi`fSXgZbT~b\a\vbhTaa`g\[h[gjcacZk`aeUhk`_h_hxc]gX]`\Tc_Ypccccccccccccccccccbccccbcccfdcaccccdfcbccccdcbcccccccd__fb``bdhfacccedddada`fad_hcfagbgdcbbbcbbfbecbf_cbdf^`kl^[\`aZY_ceZanXbjRYlgeWlgZgah_cgdcgYbikW^h^h^_egYkXgma`ebibab`fajdbbecedb`_bbccccbcbXk`b_g`baaaef`_badaheaccccccccccccccccccccccccccccccccccccccccccccccccccccccccaccacbehcccdccaccbce^cfccccbcbcacdccbdccbcccaceccdfdbkc`_`faagef`baaacdfg_`ebhfe``kciibi`ddefa_aa`Yabagee^b`^cb`aabhaf`dbbgsb`abeae`ccc\ad_``_dba_cf]gbe`dfceb^cgccccccccacbbcccccccbbdcbceccdccbcfcf_ccccceccddccbccce`\]e\\dbgd``h_j]V_]]]_^b[^a[iMedZ\gcf\idp_]ac_[a`ccamU_ZhaQnan]ggV]Qe]Vii`e^gdW`Sdz]lldgjpibe_^U^a[aa^lZc__cbccccccccbdcccccccccccccccccccccccccccdccccccceccccccbcbacbcccdbcbccccccdbdcbcbcgccdccc`bbfdbbccbcbbbccccdecccdbbcccccbccccccbcdbdcecccbcdccccccdbccccccccccdcdcchnf[falba`hdccfakf]jg^e^fcb_]\b]]f`[Wadeb`cZ]`dbead_a^ccbcccccdbdcdccdccbccddebbecdbcccccbacbbbccdbdcdcacdccdVc^WZ\_e\\bm_bW_\ee_eccg`]_`cgddfhg`biaT\Y\]ha^^UY`i^eXb^b`zW`efd`WofbX[WXdba\aVyaebaafab`_cg\pkKhhSaeUbZhZdcaeeaccdbcabcccbccccab`cbcbcacbkcfdbcbcbcbcecbbccifcbod_bdg_c`dacbcbbccd^laa_jlb`aa`_bacdah_g`h`aaacbcb``ac^f_caeacd\aab]ececcd^bdddahc`g`b]`bfaiciaacfedbe_bcfef`d[abcl`fcddafcfbc]dbdcgdbabcddcdaecacc^^c_c]ecdddagcf``a`bbccacaccbbebdahhee_abcbgceacceedbkcbabdeacabacbb`gcbfgd_b`c`^b`b^eWZ\`_c_d]b`^iYb]_Zp_akgedf[]Ybuagd]]__kbda`\cm^^b`b^b_elb`a_kefbfb`]`i^fcfi_bdc`\Zd^gbh__`^bbbgcccceeedccccbccccdeaebacdcgcbcbacaabdbbb`cebcdcbb_[_fgh`fcaXjdddi^ej_ja^jae[dbcbke_`^dcejf[e_jc]ackk][a^Y{_PTj]@U7c=I_Lk?XTPikiI\acZCVxVXVbY@SC|JMX^{y`^Ycdccccccbccccccccccccccccccccceccccccccccbccccccccccccffd`fe_kefcc`pWfgnc_f_e_]ce^cj\hde_g`Sgfi_{k_Ydhe_aeckYQnjl:BI-rOyM;6g<9BDn>xkZPZWyoqwwmRb.HCn0Zu7]sqLR5a^gccb`bef_eba`bbdbbc__fbddbbbgaab`a^_b`ddebahfadZdbcuhljdiScPQ}Z`\T\VZ_fRtMketUwaAV?^f,RNiCmX]I[jZp\\SehWXQdcccccccccccccccccccecccccccccacccccdcccdcccccccccccbccibc`cbcdbhdbccgcadbdec^edbbcbabcacd_aebdacbebbdceaacb`VdbecYm][m]lYadb]gX`b][gQ_f`^_Y^abcc^dasc[fct`aab]\cdab`bdc`cbd^cfdedcbbbbddbdaccbbbbhbdea`bfcdcfdcddcfdd`accccccccccccdccccccccccbccccccbdccecccbcccccccdcccccbcdlb_badke`dffb_cibf[dlbahbcbgndbb\a^ajbbdbeedbbhyae^nj`aaifk`cl``]_c_eiZma`eahbj]ib[^cldYdc`bbhiaYgYd]W``ghdccccccccccbcdccccccccbcdcbccdccccccccccccccccccbcccccc`d_i_acccg_wkbefba_h\cd_ahZbba`^j`_^\aijib^^adc]bddaadbdecccccdcjccccbadb^cbadddbccebb_cbababbbcbccaeedbchcba`\hdeacdb_bbdbdcffd`dcbcbbcebbcabd`ecabbccdejeacldca^Xkj`_[aedfaa^e]b^`cbdri_a[e`bZcd^c`Zgo`WdbYj]lf\ag`aficccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccdcccccccccccccccccccccckg]_de_c]ebc`caag]m[_ecu]]d`\`aceb`iaf_fYe`f\iecabad\eab]bjdcc`cc`bcffbbaacdbbc`ccadfccnb`aajbe_bbabbbdbgbbbb]`]^k_a_`ddc`bf^`W\cbe__^]]]\ddd]hf]`\dZfx^_id`_]]`ccccccccbcccabcccccedccceccccccccccbcccccccbccccbcccccccbceccccfcadcccccccccdddcccccb`cccccec`cccccgedccccdb_a```bccbaccadcbchdabddf`eadcabfbbfacdeee_aabb`cbcajbddWTZqT\Tfn_^McZ}[MoUn]g]gcV^ZhPjaChn_^lVb_3OR^kKYZVaniYl`f`c_fbaai``adblb]^b]cdbbdf^`b^keeb^fec[ed_]_bcdbf`_dcbbbccccccbcccfcccdcbccdbccccdcbcccccdccbfcdccccbccccdb`dgcccbcbbcccccbbccddecbgccccdabccbcbccccacccfcbdccbZmmdba`aaf`fbccb^cccecdceeaeed_c^h`ab`_af\abh```acbdaaj\aabbaddbl^baadsccbcZ^h_e_akl`cd]]cbbiec`_^abedbaf]bgfeeabfd`^[ebhiggSh_mja`dcbcf]j_abZacb\odgYcclf_f_fg`_`\ga_]``dbf_]dbacbb^ch_ldg[agedcbe[fc`_cag\fja_dac_flfdbcebd`cccfebcc^bbfccd_`\c^bf`bdbgacebb`aasdbbccdcbeccd\nZ_b`^dd|lZh\db]b[acbZ[V\[ai\Za_`[Phg^_cbUb_h[ie]b`h\bb_bcbbcebc`ccd_babb]ce\eabccbjbbcb_gccabeqa`bbdbmccc`di```]ba\bXYc\UcieU_cZe[fY]kacjaWVcegfheVa]h^Zi`Ugbbb_e_chffde^^^cW`fecjb^\addbaabfegicegbccechdfaffcbad^f\cccccccccccccccccccccccccccccccccccccccccccccccccccccc]_gc_f`a_^ebe_^bbaf^_Xi[aeha`___a\al\`e\_nh[vdggbfed_^^]^jZfacee_d`ba]j`b\dc_he^]b__gcegh^ea_ebadejZakagbdh_ad^f_dYeidf_oVdZeZdbddceh_gdhfe`j`eghdbhb]^q]adl^\\fdcbgb]ccccc^ddbddecddbgcecbaabadcabcfdbacccdabcdedbddbc_la`eb|]b]_dfw\_gn^`f^`c`ad\\i]_^`_`d`d`\^ifiRe_a`X]h`cdccccccbccccceccbcccbccccccccbcccecccdccdcaccddccccbc`bfa`da_gde_l\V^hee^fcif`ecg_f^`da\`d`d`fba^la]eeackfXcca__bit_]a_gO^_qf`_ifj_ha]^di\^k]e^gcX[\\Xb_^]ibfdq`a`an`hb`a]dcecb`^ahhhahb_caebbceab`]lg_ed`c]^afbbbca``dbbbbb^ccadbdbcabcdeadcajbbcdfcbccdcfcc_dbbbdacbcaaacdg`^bb`dbccb`_cbhdcdkcd``g_abbaaf`ebcafbb`cdbb`cfaawebcaaabdbbbc`dibacbbcaaa`Xci\`bcvbcbbcbjd`_befbe`gebc_gcc_]bhXXpa`Lg`\\^ssi^c\_gV]aUX]h[\fos_V^[hNfIWdgW^^kYg[_tceec`cccacgccccdceccbbcdbcdcbccbdeca_cccbdbbbdcbcebcac`^ibZdacfh_bebccab`c^cenbbbe`d_b_cadbc_`ajkcdebccbdc^^dy^[XhZr`tZaUnXfb`a\mRk_c[ebe^bdRZi^cR^eY^XcU^`cgO^Wbch`ad`[bebcfcm`dbae_acac`dfe`f^b_bcehc^cfea`ldceh`agahikic_e]`a`]Zcg`_ada\`k_bbcc`giZecc^ba`e\gbb`b_abb]b_c_dfcddpbb`_[^b`ji`]^ge]d_f^c_dcb\i_`ebi\`[h_W^dckdb_^_bdcdccccccecccdcc_hbcbccbcccccdccccbbbbccbccbecccbccbccccdcbccbcddccccccfccccabcccccdccccccccccccdcccdcccccbcccccccccccccccccccccccccccccccccccccccccccccccccccccc_afb`abcideebceccaccdadidfd`bbbabaabe`dcb_aaddcacddabfa`ab^dbbdcgeeaadcbbb`fbed`ce`aaccdceccbb`ace`ccabbcbe]yb<[`[SHj8TkURnXMWCj6PG\ReP]aLUeW[UXgWlFWgOTjSHRjLlZdca\f]bikbjl^e_accdajae[da_bgeef`efbba^^cb`f_ecdeZbbe`c`d[`Tbkfd^``Ye[ab_ccdhexb_fc`^gbba]]aiUkbaa^^[cge`i[__```gccfddcic^dcbb_dgdee`gebb`[mfbbe`hdbgda\fd`beebaec``cdcbced_eccecbcccbbcdbbbbdbbcdbeccabebdcbecdbcedebd]]ZPYYaZYYNUa[_XsvMQNqYe}{[Vc\S[Wxd]gg[Xh~d[W[YPXdg^iVb^]b`dgbecnZkbi^ha]f`_edjngf_`of`Zcb^^fkgX_m^cea\WV^X^^h_eOhcffg]YikYgg_bqgcmbXbfVa[j`d^ed`iadf[_cgfmdZcadbhg^f`V`Q^P[`ZPX|WVXxrbbZf__WgcVRU^wTa\SZ{e\VZd^\a_\`_u`k[b_dXUdYYg]]Zf_\^nhYZ`d\d_`Z^Z^ekea`\fbcXxccRh_omSW^TUN^]O_bhSQaUg;WKT\k`\idfj`mmhShhbfmchabgg_ai[Ycgk]p\dec_bbcfccbddaabcebcbbcbc`cbcbe`bbaebbddc]`dgdchh`ebZc`bb_]e^f^b_ba]^]bbfd[_e`^ceib[d`bd]ca[fba_efde_ede[^a`fd_hcm\ab`_]^_]mc]```e\dg`acdaefhecd`ebcbhbb]efdjh_cbbcbccccddcdccbcdcab]`abbedhbecb`ebbdaccfbgeeafccccb_bcccbcccbcdccccbbccacbccdhbcccg^c`bbccaa`abccbccccbacdcpVSWhb`eh^UMk[OSQaXcZNge`c~\seT`QQb^pZVgVhVoSNfZcMU_ibgbcdcccdc_bbbdbcac_c`b`dfccfbbb^hecb`bdcccdfccbceedfd_jbc_eaaeddfadkc\f`a]bdge]ce`_^fab`g^_b`dlaaZ_eedecc_idb^dcdcbeaebcbeec`gbecacd`bdbec``ccccccbbda`baec]daddeV^[^fb_b`haameb`dj_]b_gd_g]b_icaod_dcllknc__c_d_j^fb`c]bcd]aUdfafghh^ca\`ddeg^eddi\XYmdad_af`_dd_]jbfi`kbe]]b_gjcbccbaaaccekddfb`bc`a_bbdc`cd`debb`cafcccdcccbebdbeKe^j\`djleSbb\hejdXj`YbWXU[Zxd`fjgg[Uca\\\T\^f_ah_gXVc`ccbcbcbcfcccccbcccebccccdcdbkbbcccc`abcbcbccbbcdccdcw]gdZf`b_a_cdbage^c]c^g^b]fg]_bl^c_Z]_g^qb_hZ`bbb]jebdbbc`ccccbcddgc\ccac_chcgccccccccccaegccccccccbcccccbebeodbebfsafgbf`]`\iefd^`]bcefb_ahj`dn_ejb`kd_aeccg^c`i_[]eq`a_aa]dheaYc_cidfikgaebiga\gd^ddhiWcg`aj]b_`af^]Qih^^cehac^ereca`be`]^dj^fb_b`^a^bddbda]ec[`cicr^cf^eabca`cccbccdbacdcdbbbdbadbdcbdebcjcbbcdeecaaccacbb]beecbd`Yb__efange]acaa_aiadjZjZkkbac`a^Vl`\af^ge]X\_ercnjbdiaef^\_qbhbdc^ce`md^d`i_`ee_dbfb_g^^feebXbf^dfcbabfbbdjdbdcbccdbcfacccbaccbcbcbbbccdcbcbcceccddbbccabdkcccccbhlbd__\igwa]e_iea^_jaeWca`fd]ldcfbe]ggUg]dcda`aVfah_hhcc`bedccddecccdccecjabeccbcdbcbccbbccbbbccccbbbcccdacd\\eabcz\jS[eKZWbdT]acFWb\c[hm\Wl_[akjeh`m]`^`aUc`dalY[b_cbb`bcbfchccbcbdbd`fdecdeeebabbbbb`bbbebbbbabccgcafad^fcadbcdcaccchdhbc^c`cbdaec_dbbdfbccbbbdfccaccacedbcfbdYfabf`]ae``aia_defge``hcf]b]`bdbcahdebacbcbdckbab`dbfcdb`bccccfbdbccbbcdddebddecdbcace]dda`ccbdb`cccbccdbim]^jf[``^ee]^\_ebY\^gh[^c`aab[Wa]iche]__k]]b^c^ab^lmd^f[bd_ejbd`kYpbf_qbdeYb^[^b\m^^abbe^niqcai^cRjZb]c`ZdbZ[ec]]^laja]`c^im^\beba]g\`[g^df_b[__d]h[`c]`ed[`feehYbbbbaaccdb`abaeieab_f`aadbae_^ba_edeaf_bagcbdaawfcgacaYkigcc`_]ZfIfxhZj^iZcclg`fhgc^j`^nV]X_kbc]Yfc`XhbjY[d]]bd`gafebaecba`dh^cege]]ZcaYdi``ce`^bba`jeTlk^a^_d\c`b`cdacaceaceccefdccdhcdbdbccbbabbcbbdcbcbcddbdebcecc_e\aq^`ea_]bfZbaca`_`jjic[diZ`]]WcZbeuaf__hweh^]f`bae`[aklb_cscaabf``_e_\]cZ^beba]ccZf`\c_dg^]j\YaZa[^`[c_ce]]`\cx[`ab`ghaha`cbaa`gd\^haac_^e^_h\edrabba`ccaa`c^]afcbqbcgdbcedaccccbdcdccccdd`bbcbbecdc`bdebbdcc`bc_dacbcbivdh``p[a`Xgc]_e[k\akj[\afW`ccbdf]g\_p[`Z]kc^`f_Sba\e\Xibgcdh\sfedg`achde\kZh^faUafdcWgc^cje`agidU_vY`edYcZcobZOXeUUob`e_`T^T\qI^cthdS|R]`jeZn`\TXVtZjin]jhVVg[_oZ]]eST^i^^\Z^^WGOZTX^nWbPeh`W]NoVSQUQUJPjJKfQGR[m`K^V[`c_adiabcgeacfdcbaicb`^_[e_cb_`abid_iebeadbbbbgdgeeaabg]^]dZb`b`b_dac_]~_bd_`^a`M`bZ_h~[]^aa[__]`d][dacb^_i_ccccacccgbmedcbcbebdcdb`aebcbb`ecdb`ddeacbbbbaba`cebd^Xg^\[qg_[Oi]Y_k^Sh|Z\qy_ebe[qbZW]l]ZPcd_XkYuZdS[`NY[l]ab\_]cbk`^Yaadd`]Z_^\\|apZc^^^^[`cd[]cX_Zc__^_z`d`a_[ga][R7SZY_Qg`kUFQfRQldWcUaLXf]eSdTdfgfcae^bXe`Va[h`dnLeT^b\j`adcei]bc_d_]`kbag`bj^`UskW`^i_ie]a^f]cmdica^lZ[Ua^]b_\gf`dyWW_bT^qwWio__awN\V`_hYgVTc_URT_sXbm\T\XaY`g][`i]c_bcqldabhaab[`]bgdg^_a`[]_kg\hc[a]ccae`\da[b`lctgdb^cdc`y`^gb`de\\bh^^b_na`^`b_^h_`f^^[cb_]b^^]b`aaa[k`^eff`baebc`af]`c^ba``b`r```cf`i`jbebbe`^cac_ggb\fd^gdUgmib]eZfbmfYZ]]sd_e`gg__b\\b^Xk^fbb[Z`[aqbd`k\]jn_V[tUaagsc`Zb\jb_uuW[\_`ZY\`^BX]b`PjfX]]_jdTldteaj^bX[a[ddbdbccccbdcccbbccbcbefcdbcccc`bbbdbdbbccbceabcdcecceba`aacbabgd]dccffbbecc`cjcbdcdb`bacbecbbcddcf_afacbec`eccdcbcccccccccccccccdcccccceccccccbbecdcccccccccccccccmkd[_g`k^Q_Wb\hgvd]gg]deY[UVWjf[^daeX\k_`[\ZY_Za]cZdd_cgjiZ^`dda_`faZjb`_`be`maadfcbab_bfgan^]c]``]\acdhdgegbabbfbcccde_dccca`|aaec_a^bbbbdd_k```bd`d_e`ccbbceac`bfcbbdbbcacbc`ccccccbcgaabagcaaeajbcdcfabe_cdbdbccccdbaccccccccccccccccccccccccccccccccccccccccccccccccccccccf^Cg?/Mr+STU{hASI_s@/ZjkRBQ.SBDb]J?gCjQ_TId\_UAIXaccccccccdcccdcccccccdccccdcebcaccccbcccccccccccccccccc^k_^hieaYgc_bbjddg]d[\hbe\n\g\f\^h]db[Zfblj__Ydcn]gefWf^h`^bacfcdfbbdbbbbf``fddacebbdb`c`cga`faed`_bbbdffcdgqa_^ba_cb]madeb]aecda\ak^d`di`^b]fd``a_]g\cd^ibdfccc_ai^dafi]aY`cZa]ca_ama_hnYYeqbafZrag`e\_^Yj^\]he[j`eebeYma`b`_b_dad_abcce`ba_fbcbee`b^fga`ddbccad_`e^eddbbgfeeb\fcfbb`ajiVaa^VnXdbeY\knc[YfdhhS`e`b`_bcV[chh]e`]c[gZifccdb{dcbfcaabe`abbb`dabbea\`cl_ac`a``d_]^acjabbea`bab`hdZfdcdXafabbejacbm`dbf_ba^a__pacdcf_c`bbce^cffdibhb`^^\c_dh_g\bdkaf^^Y\femem[Zbc\mZ\aZfl\b^a^Zc\_ddT`]beeadafg[dVX]^ZW`_clV^dh[ib[_dbjgXc`dj_bhfd\XXcs\kfhf^Y^]a^dbcccbb_bb`gcadc_hlb`kcgaf]ebf^aaeea`bhcd_`cebdab]`iffcgUbd^]]a_RV__cZgeb`fee_de_dfbjg``af_oagVa_[h`drabbcbccbcccdccbccccccbccdlbbcbcbcaccdceccbcdccbbbcdcccccbac_ag`gcdcgcccddbbib]b][ebbcbabcbcr_^`dabbc`cbcdckbaecaebb]`aceqgdddee`dab^`fgbbdh`_f_c_^^bedbagcg]_bccbec^gcbccbcccgcddccccccdb`ac_ccccbcbcbcbbgbcdddccccccchdbadaehcadbacfd`dcagbc_cbcgjeb_c_d`acbe^d]^e`abh]cfac_d`ed`bbe`g`fd[cfaYfbe^fb^i]edeabcb_e`a]`edbfeecclgfca`adbe]\`fd_b^d_jZgic_a\jf]t`ibcXp[fc[cbZ`e]f_ak^Z^dbTX`a`^c`_da`id`ddag]_[g\_eeiecbcegdod_]`c`bfZb]^_^_ZiYad_qoiedfbdb]ceeeedbcbk`fe_]``fa_`fd[h^^cej[fbe`_\c`cbbbcgj`Zl^bO]eb\b[]_lee`azc^ffcbf_ecWe`yb]bi`_^`_bTg`mi`]`dclead]dddccab]cc`begdbeeddck`acbdd^badaicgc_hcbcacbbccchccccccccccccccccccccccdcccdccccccccccccccccccccccccccc[[\fbd`bid`habb`bccacia__hecaah_^e`dfdfddiafXjfcdeba_h]cic^`ac`h]a`aecafac`]cjd_i`bngg_c`_afcccifg`acbd_dafcccccccccccccccccbccccdcdccccccccccbbcccccbcccccccccbacbabbgcbccedcccdcccdbdbdbcbecccbcbcbccbbadddbcacbccfbbgcccccccccccccccccbcccccdbbcdccbccccdccdccccccccbcdcbcccecff`gb`baheZet`gZe__ce\e^ecedcbe``fchddeibdd\a\g\_e\d_ccidbg`bjfadcaafhe_g_ac_de`cffi_ch[\faba`Ycce^bcc`e^d]cc_abcbabbfefa`^gnac_`bfabbae`\l^]l`a`f\`a`bc`ba_adgbcbbccccccccccccccbccdcccbcfcccdccacbddcccccccccccccccb`aqcdbbcbbdbce`edba]ccabfdcbd`ccecdXcgbbabbd_cccbdh\f_ccWeZYqnai^c\ce\ZY\emqa]eW]_c\``dkj`]cY_ki[[cc[^li[hXccccccccccbcccccccccdccdccdcccaccccccccceccccccccdcccbc[h`cdbccfaecbcadedad^a_bdbbcb\d^f`adaabda`ccdadac^bdcabbbbccedddccbccbbccfcd`bccbbecdcbh_ccccccdbbdbddccdcVeehm_dbaW_rgabk_jf[YcabYW]gbbhgg]^aab]]kV`]_fYj\Y][d][_e_fso]UcjYlg^iYmjYnb[]\bbbbdfddjabd]^W__badakae___^kc^`aefadgbgd`bbadcaehbdd``bdcg_biba^hbbabcaebdbcaffaibddeg^abg^h]_af\ahb^\fe`h_^a_l`^c`egdkbaj^jc`l\fl`a_fb_cccbcccccccccccccccccccccccccccccccccccccccccccccccccc^b`\VQLbgZcZUa\_jWiY^i_\ejOr]]r^Y`^\fwadY]b_ewZbV][VYccccccccccccccccccbcbbdccbccdccccdccbcccccccdccdeccccdvk[ZS[Vap[YYY_WWY]ZUScUh{Za]LT_XO_cnjmuPf[WT^NT_a`gX\k`n]k\^aaa_cbdk_``c\]hba_g__ebgcd]a_Yuk^`^]^^X^_c^\_fdac_cccccccbecdccccccccecbccccccdc`ccccccccdccbcccccccccccceccccdccccccccccbccddcecccccccccccdbccbccbdcccccccbcbddcbbceec`ccecaabcbcebebcd`cbaccbcbdcddbcfcedecdceadaebbdcccccecbccccbebadcccbdcccdccbcbfcc_ebcfbbddcccbcbe_E^OP]]1BbLMHMd_@M`OC:BESof@WR^UZEHBEIAy]?dC>GUIa_dWgf\Zabh[]be\`mb`^\{Ze`t^_]afec^abi][`cVb[n]]d^^^bddccacdcccb`ccccbccebegbbccdcbccbdcecdbdcdcbbcdceacbdcecccebd^dgc`bc_a[`aced_fa`ecada`gbje`adZdbee\a^ekba]e]ebhccdccccccccacccccccccbcccccdcccccccccccccccccbccccbcbd^f^bYq\_\_klrYqdTTZpa^YjgbncjdacWbpacdn]aZYaZ_ee\b]Yccbadgcccdefbjccccbcb`ccadcbcdc_fccbbaccbddbcbccccdcc`dbcabbcbeffbdcbdaddadaacadcba_c^dbcebbbcbcbccbcbncgegadhjc`hb_q]a`hgaOhcgc]eb]dbeX`e`\ja\[ffaa`fhvfW^hh\ddbYZ\bagbgbd_i^\faabababhmageZ^adc_`cgib_efie\bd`kbccbfeadWRhadladZ]a_b^fj[aYhgVgg[iZj]]Tqce[XgLf[m_dq^Vo`[_r[cRcac^e_a^bWgfa_Vhbd[eadbaecg_d[gdjeebimYb]cdZ[ebiab`gb`dg_cfbaef^bec\dfeacac]cb`ccbb[ge]fecededafdcecccaba_fd\iald^\bi`d^ig^]aadbead^bcb`]ea`eabfkha[dge]cdabbdgbaahgeh[\[h]ke\d^f_i^\\cfd\Zqjdc]]k_fX]d_ZXjV[ddh^f__c^`]kd_d`aW`j\iUaqW_Uaddng`c`ZPoaafbcd^gfvad`kdTjf`dhdj`YUeReUbqaZdbW]_Ugk`cZZicUg`oew`Ybmb`YdDYofsc`em[ZeUokX^[cebijfcc`bd`bcbbbggba`e_bbedbabdcbedaaabcfe\eae^cebba`Rd[kYWOcfVbkc^cdZaidgid[bcb_^^dfdYfgbgbkXaTi\ehgpX[qdffbhbacaedebbb`bcgbfabid`f`daf`cccbcbi`ebaccci]cdc`e`\df^fb`dbcagfccb_eabca_cdbddcabbfi^aciib\boca^heacba_cbcfibbdebckcaaccbbcifdgd`_bc`cccbdaafd`^b`cebcabbbae^b`e_efaeh^cbdadcbbdaabf_^^ecaa`c_af_b_fa^hfed`afbf_bedea``babcb`b^i^ba`bcabhcb[b\b`kca_ec```ebab^e_a^bcmbfbbacccceccccdccccccbddccedcccccccccbccdd`cdccccccbcdcbbccbedgddcfhZciahZdfe_ee`_X[faX`bhadhgcea`ebeeeb_b]^`_\_feccccccccccccccccccccccccccccccccccccccccccccccccccccccacb_cbbd`a]fcb_be`d`dbggabed`cfbaabfbbaibadeegcedceccgfccccccbcbcccccdccecbbccccccccccccbccccdcbbccccdccccbccbdfbcbcfdb`cbddcfcgdaeeaabcdbaebbaa_dbccccgdcabcee`dad`eb_bacfedbbccdbbbc``bcbbbeaa_bbbm`e`ccfbbeaedacefa`hckSale`cal`baafdea^dbefdbYg`^cecacf_a^]b^dbeaab`ciydfcehcccccdcabblccccc``bcccccbaacbacbcccicbbbacbfbdcccc`a^bcfbf`ce]ecf^e`be^cdegfcbbegc^ibg_b_[bfd`_dZe`c\fdebcbn_dca]`gb^`Z`efXclbghac_ebc_Xa[\bed^b`dhcm[Zaf\gab_ggccbc`dccb`bccccccccc`bceecddbcgcaccd^ccbcdccbbccccccjc_\bbecVht^cccV_l_ie[fk_\ad\TfYhed_ai\fbbgZif]bcZYd`ih]dg`bbd_bee^ccbcdhafa[ed_`ageah^bdabgbc]d`b`d^gdbfflcfcbchb[eccaacdcbacmaabc_acbfdcbbdbdbc`dcbcccbcbjdccec`hbeW_]bb[\`f^]\i`bhccbLafYbb]f_gjgZh`Zjn`n[p^[sbgX^ba\b`ubede^a]`Ve`eb``e_ffdeffaf^]Yaa_ed^b`ff^abb_c`a`a_ad^bbcabbbnbcccebcbbecdcdbdcadcea_cbdbd`gccbacbbebcccbbeabacb`cdcbcbbfcaacaabgfa_ccbcbccbedcffcddbabkdbcbbcgc`bt]`a`a^chbbb`b_a_`]_b]a``W_c]bf^afaf^]dZq_e^ha_cc__gd\]^V[VJoUBYn^ABA\B2wdg`iUxhNMTq[Zr__fe[F/~bL]hET[_L^nb]b_bb`c`_ceeaid`mfce`[`g__dfidfl\`sb_bee`\bdXe_]d`_cfcgeX^em]doa]bY^ne_ebf^iUgWZbojcWdU`eagjfd_bfZVZfVc^VgaSgXj^jmd^j_bgVPegVbp_pejeZdhjd[b]QVbIp`lUggTT_Yk]eficcccccccccdccccccccccccccccccccccccccccccccccccccccccc\^b`_`can^h``akbf^pZd`Xi^fRgT][b\fefV^fZdbbc\`_gjicbccbfd__cchcdb`cccdc`c^gbddcbcebcchcb_ce`bbaccbcbaccchfcb]cbcfe`Vac`\^`a`ce^aUWM\]c\b]W^a]jc\[mZZ]pb[__i_[`iw`f[bcg_efYejbga\e_\_bagaaea[dgggfff_fcdf]_eceedh_h`df][ccc`ccccbcecgc\ccbc_cichdbccccbcccccccdccccccccccccbebcjec_``ccdffba^ibd]b`]__a^bcfcabedab]a_chg`]havfcf`cg`]_ccbg]gg\d]`_\ae[ig]e`awde_p[ce`cb^g]bac_ifkdadf^cb``f`\cdbacc```acbbadaahlmb`adeaj_eb`ac`d`[a^bad^acfei`cmccbcccccccccccccccccdccccccccccccccccccccccccccccbcccc^\]]`fW`mWd_g^Pa\^mgpZZfYX\^beUgiTcgedgp^r`ZfcVafh[]`ZYf_b_dhYief`cO_`c]caggcee[Wgdd]dWe`h]jgc`g`aeZ^d]dhgZQ~:YURZNMT?eSNNhV%eO^E^KFOIS\QFGK@SJKcY2=lT5cV.3c][`baacccfddbbcbcbccbcabccbbb`bcccccbc`fcbcbccbbcbcbcceb^]eb_e`cad^f`agaacee^^ag_ejae[gb_a`cbab`bee^tiged_ebc`cccbccccccbbdccccccccccccccccccccecccccccccccdcbccccbcYa_c_a]bbdfffc^bbb__ee^fbcbbf_[gbZage]cbh\ecaa]j`g^`diadgbdgac`abcbbfaccdc^cabdccabc]b^bcgYddb`b_cegcfc`acqaab`hh]^eyZaeZRe^`]Za_Z_hadoYgegdjZ_e[k`b]aUiSmgeViWm]Vh`dbefbb]`db_cac`cdbZ_acbbjagcmj`bgc^c\cgfbdhab^cibdbr^chc^ebbacaccafbdcccjaee_`g^iehbcbcbd`aabedbbdgbdfada]ccbccccccccccccccccccccdccccccdccccdbcbccccccdcdcbcccccbccccccbccddcccccccbaccbccccccccccceccccccccccccccbdea\bjbbbchfdbbbbcbbaab`bbd`bb^a_cbea`a{`aafab_abdbabab_a\^bcabcagc_abjcc`}e^achdh]agcdahdc_c]d\agbWgeabcafibYcb_bbcgcabcgbcbccb_bbbi`fb|ebbacabbcbbbabacZcc`bc_cbbb\_labf`ccc_babde``cbcadbebc_dc`f\h^gfa_eabba^_dgcejaiag_cdbbcbecmbacbabbaaeacdebfda_db\be^de`cdddbb`cebcccaddva^dWm_^]cZ\c_niXfY]fd[]h\ebg]Z^\be[ia_e`iUwgXbY^cT[lgicn\b]i[eea]eudZd`ec\f\`cd_]a`abceadgbk_mbhhfb[a[agaaa[_abpZ_pgn_ec`]Y]WaXodbe`nobW^j_i`cbbge^UkeZk`eljX_`g`h^cfbac`d_bbbabdd^ccabcebbdcb`a`bdabeacaabb^dcacaba_`\dafe_egc]eae_^_bc]gddcbg^fchdaheddaa[caj^ae`f]a^`dbac[la`ebe^Ybf_Z^^jca`dac_Z_ceZagec_^_sY]gekTe]h`bjXb`b[naddcndccfdbbcbedafdc_`biccdc__bb^baabcfacccbcd`bdeebae]eifdfbcfcadba`dada^a]efacedgac`agadeb^ccfb^faaaa_gbd`gfQcdabV^`WclQahf_YedVgck^[cbkaadkaWs`^^O]VbWS^a]Vfdkacfa`bcc_cdbeeebdecca_dcg_ccbc^ccb`bdf`aiccacabfcebfbhabbatbbcbde^cbbbddaa`cd`c`cfea_dZbadfb]aoacdc`aacceabfe^cblacb`ec`bcbbbaabca`bcfbe_bc`bbaabhdfedabcabcqaabj_`i^bhabcee_bcebbdebb`add`bbbaebcfcbcae`dafccdacbcddbbf\WV[O[R_x\_^\MbVH^_dZ5pXY=QeH^e`WakdcgjVoEKfeE\a]YLVYgjcbbabb`bcdabbcadbgeccbb`caba`edadXcc`ccacbcadacadbebccakga`cdaiic_^__n`_b^_d`fe^fYba[_fggcbd^[d][c`c``cda`]gYdj^bcdacoc`abeg`caldb`fgdd_aj^]v_^gcc[Z\ja`^e__\b]a`dcbcabcccc_ag`cbebd_daaa_d^`_b`idb`b`^_^a^]h`ceef`cacdcccccccccccccccccccccccccccccccccbcccccdcccccccccccckc]_bbe]`^ba_]]YbdcaRaw_b`bXX_b_ebabYi_nZc_L\_fbcc\h\a]dc_d`dbej[aababa^b`afa]e_aba_cfbbc]ab_c`cpfcdag`ai^b`ebebbbb`h`bbgcbafac\f\d_jaifhadbabeb`aaeba\ccbeacdh^bd`fdaccccbbacccbc^aaafccjebfbc_cag^jadddcace\cpb``bbbcccb`]^dd]cdc_adca\^cZclc^edeehfae[gVdf`c_aa`abbZ]`hZWRg_\_\o^o[cfR`i[l]U\fYd\_a{c_e`h[`Yd_]{fnQT_``j_dQ\dVcc\gacccccccacc[ccbcnccbcccccci_bfba_c^ccccdccccccccebbdeachbbbdedee[`bb``afcfdcccbba`eb`edcbc_dbbbbcdcadadbSa`cidP[ee]chmga_d]^defeea^g^Yf\e_f_Yb]aca]^`b`idgfgeecb_ccacc_bbdbcdccdcb^cfdbhdcecgacacaeb_dd`bdbacccadcic^^[aeXZ_m^aaZf^^de_YW[giX[]dXXh_befghibXaVX_ecY`caX]fiba_aah]jkgaejbcW]jdec]faj_cd_ne`a_d^fiicaa]Wd_hgb\a]cda`bfdccebbecbcabcbfb_cgc`cbdccd_ccb`cbcdfbdgbbbcecbccXXE_pUPvd^Z\o]ZYQnQaioiWWsQXZdWR_DPSRMo\tVzhgxaOlfUbfXEgba{R`Lad_bU]^aR`XiYWi`QXTQnas\W[\\oZ\]c_Yjdn\^ZWQcbbcdcccbaadccddcbdccccfcbecccccbcbcdccdcdcdccbbccdcacecbaa__cZ_e_dabejaa]aadcdYecd_do^b\gb`i_oZea]ca_aTqedcc_bck`}^jdabe^dd^]bebce`_aZcdahec^bU`]ca_a^fZ]degccl`f`]bbaaaccb^ebgbbb|aba[a_`a^aaa`bababddaab`a]kabbbadbf}fecbb[YmkPah\echjjbadei`^fX[djegcakad[dVat_jfn`dValcjd^a\`de\bfcabdYkfddcdarc^abf__ckk_Vacg]ibdiab``fc^bdh^cg^_bgabca^ei\`gajd^dXgu]d__cgYbkeb`cab\Yic`fbidbc_aba`f`feddbcacffbccabf`ebld`cbca`cd`gadada```ddccebccae_hacccccdcccceeccbccccccbbedcbcccgcccccbccbccccbbcdccbccbU\gfaeu`fefcc[a\[a^bV[bcXhe]jacdZ^^^ggaf`[bbm`b^^aZib^WcZ^`dbbY]jXe^\`o\l`ca\]`dech\Z[ajcs[lc[]ka_bjbk\[^eaqccccc^ccfcbcbcbcccdbcbc_fbdfdccccddbccaccccccccfbdcccecccccccccbccccccccccbcccccccccccccccbcccccccccccccccgcccbcccccccbcccccccccdbcbccccccbcccccbdcccccccccdcdcddd`mcg^n^a]`habi_e^^edic^a]_^Zca`jma]al^bea]u[]badle^_fcddf`adbcc]ddcccccdbdfeccgccbcf`daeeabfcbddbbbcbdc`fcf^cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccdcbcccccbdcccccccbcccccdcccccccceccccdcbae_Zcccacbhgb\ecbd_egbfdbdcbcbbbcccfbdebccbbacccccbfj\ba`bj^Te]bgetm_[eqiceik^ek]e__WcebXZW_h`bhmfYem^daachi_`Xfa[b\gc\`cachZ``[bbZ``_cjae___Zkhsl]q_]aoW__`^^``jea`_ea^jdc^_b`aah`_c`ia[^ap_hiab_\\chd^c^jff`fai`b^if`bfe^eXj\`^i^^c_[adb[fg`bZdpe[Zbu_bbf\_[^^`[hV[eb]\\bf_bnfSQ`cX`iq}S^^dmY[ZlciUQSMZgT^Zd]idZZZZfgkVacJhe`gdX_T`bfab]ah[`d`dbh^cba_ddcYa^``fr_^c`[oddg_a]bgdbaaaacc\eafa_`a\jcf\iaagmf`i`^cb\_lYWgab``gf^`_h`mQe]\]bZdf^b_\dedbcdeh^bbffbglehcdbnabceacd^`e`e_b^aba`eeebc`d__bwhbg_]Y`R`fVbb]T`^_ZhRYWoV\Ub\sqbl_Yjd\]YVt_iMdTV[jU}n[gd`dbbagdd_cga\baa_cb_cd`bg`f]_`e_gcbagaddccecf``befbcbdbaccdcgcccccccbbbacbbccdccbceccdbfbccccdcccbddccbbabeccd\cfaadabcetffcgbba_cdb]babebabhcadbga`]bdccefc_eccccccccccdccccccccdcccccccccccccccccccccccccccccccccce`_aa_ccbcdbbbcbecac[bdgcbcdbbfccccbabddbbbddgcdccbefc]U]`b]VmUU]_SNXih`TfPUb\nfuYYnfeTZdII_[pS\X]Y_YTh[VWQfddfdefcaeecabea_ddaafc`^edebaeebabcedac]^faadfdb`cbh_cjk`b__cck\eddabba_nd\d]``_ggoa\cbah\`a_dca^^dbcefccdbdjcg`g_cic__^af``add[ad`cdabh^k`b^j\a^]ba`csaZddbhcbad^gf^ddfdie`cd\eccbcb`ffeccfed^ff^`f`edgfcaab\_eccecdad]\hddaab_vedajgn_gl`beii]dgcdb]``g]]c`cblaf[ced\b^_c_[Y{\_``\`^]]^`d^]caX]dcah]Z]j^dS\a^ih[i^[ga[]Wb]Wed\`l]baadcbcccciaeccdbbbd`ffbdacddbebebcabcacccbeaddbcgbb``c^`ccdgcdYhfccdbae`dm`cfaeaae_cabd`dce`_ehec``eccbac]a]chggZYgeWcgw`kc_eaddXbcdd]dgZcYj\\dgc`pah`YceegefSac_]X\abdid[\cbceZuZhiiYfbZch`ZaTaiha_^fda_gdkji`gcf_g\cbea\`^fbaWaema^dfcdaxreddc_agfZ_a`ifgd]d_Z[p]]dX_hde\\Xea^c^ejdXjbaQJcbmeghaefe_^ZcYocb[giatY^\SXd^][_Sf^mkccbbccdccddbdgbbccdbbdfc_cabcac_cccdeacbbchibbceccbcc_cagdbabbcdbcbbcca_cbaeccddlbdaah^a``cabdaZ_aababcbcb`cd`h^`c`a`jabdgcZdbahkafoddc^de\\dde\`ac`fhc``Ybcfdce^f^ccccccccccdcccccccccccccccccdccccccdcccccccccccccccccceaccbccc`ccbcccbccdcacbcdcdcdcdccbcccbecdccbbbcbccccffdcbcdefcafgcbdf`daaa^^d_eaa`badaaacdaf^cdgde\`ffiaccehkXc_c^U^_^aac\VhnoYU_gdVahYZYVic_hbacWh[R]^a\Xaco`b^fcccccccbdcdcbccccccccdcbccccccccccccccccccccccbcccccccVV_ecatcgo]Q_YT``p9_\_^\]ez~eVqg[]h`ZYeae_iY_k]Zx_hc^jk`^c^__iX_]atUe[lcaa^ViaiX\a]`fi\]gimag]keUag_^`b_Yagccbfdh^`yniW^Z^i\edYde^lYeS\Wmghc^hg_Wde`Z]Ykgc`reaga`]hoZ[dacfbbb_`eefaobf^bbcadade^eY_ecf_b]_b^ahb_b_`c^c``ebdc\cgfhcbhe_^a\dc_ceic``[ddcffc^ahac`ecad`ddkccbffZcfhcd\eb]gd`aj]]d]j_\fmX]c\gmkdUb]bakd`aeXkVbic`a]\c\ccbcdcccbccccccccccceccfcbccccbcbcccdccccccccdcccaccdcUbeieOShUKfd\Xpc^jbiZbfb^^l\dKgagYd^^he]_mji^gb]V`hjdi_c]b_dc_YalfccV\aY\`kgececTYZf[^Yabikjha_^X]eTcV`ZkSdicbccccccccbddccccecccbccecccbccccccbcccccccccccccccccccbcbb`jcdbgcccdcbadddadcfbccbbacbcbadccccbccbbccccebcdg`_c`cbdcdhcbabca`c]d]cade`b_c]ajd`]`]dddcgdacnadeifcgc_dc`ccccd`ecbcccdgbd^b_jbccdccgacbbbcbccdcdadbbdiecadfoV\TCD\UTi/I9ANSN|kpN]\WUIQKT__NWhRYkFY\OIb[U`aMeliROV[]eT`kP\\PeP\R]hd^`Hb\WQe\bmdZ`cb`dcd]j^baa\_ddZ_n]eg]d`eYldeaeaadb_]rhbclcf`Yk\]XVhm`dT``[Y_mwVTeT`MXWe[pYdbncgZcY[[_|gMaRRc`iWWeOeb]cabcccf^fccebdbecc_a^dcdcbbcd`cjbd`cecdccbbdccehcadra``e``eab_aaa`a_`_`_za_ac_aY_Xb`a`ae__iq^a^_^``b_fa`gcbddccccde^dcccdcddcddcafbccbcacbcbbcdcdbdcbbbdcceecceac_facUacb^da^eabh`fbijdcgk_d\\aghh_de_bbZgbg^daccbZjeccccccccccccccccccccccccccccccccccccccccccccccccccccccN`Y]\{X\j`]\VKxmpb[uZYXhkifsSb_VZmc`\emaVzXd][VaVfu\\Ybb_h`_`bdd`ec``dgcfahb`fcgcqd`_c^``fgca\bccceccbc`ge_bccccbccccccccccccbdcccccccccdcdcccccccccccccccccccccccYU`ebik]ibefXcZTPTuUbsfeaTvhhVjVdVeXZl^d^fYpcbf_VeVdj_^c\ffb`ed]dbc_a_`ba^b^bjdbebb_dd``eb`afc\]fcbcfdc`aefg_g]`]ZWdaqbWhUgd_fRcfb]`V[[cj]d\\`V]jm`__gLaXh]a_^\`kRddddbbccccdcdcaccdcde`bccbcdececaceadcccc`ccc`cdcdccdc]eddd``]g`ged[eccbgaedcgdgeZ`_hjhbaccebagiidffg`dfccib]Y_^ah^cher`[dgba\d]cb^dhYc_c^g`[dZjdVccadit_`bca[g\d^ccchcbccccccccccccccbcccccceccccccbadcccccccbccbccccbda]Yp~fg``d\_\hyf^\fY]_b]iabbVk\]]`ZeXZ\`_]a^qb`\c_ubZgccbcccccccbdcccdcdbccececddcecbeccbccbccbbccadbccdccadSbkdf\`acdf``_\g__WZoSdd]^ZYeadb`a[^cchkbi`[cd]h`[k[\eccccccccccccdccccccccccccccccccccccccgcccccccccccccccciha_Xbge_Qmal_dkn^[XVeec^a]ee[jhoS]^X]bkNYOZ]`fY_dibVca_chdacgf`cdcjbcb``eYe]efgbcdacab`agb``cccebgaccgbadgcccccccccccdcccccccccbccccbddcecccdcbccccccccccdccccccb]gag_bcdj`hbaZbkdbg`^c[a^lblcemfe_Za\kdea]^f_fda_]b\`_mdcabbc^c[^bbabbhcdb`bqa_bdfcabgbddd``idcaa]ebgaaeabbe\dbgcadfehah]bdcYeca_bcfbgec[`daffhfaeecc`^acgc`f^ccfb_cccdacXadkcbacccb_ebeed\bba^gedc\eacd_fbaddadbWbb`]g_dhebcbdccfcaecjb`_b`d[b`c`ad_cddgidcdebabfa^c]bi`^g`dbcbbbccfcbcce`bccbc\^cdbbcebbedfcbbbfdhbbcclbcgccccabcccccbcccccfdbccccccbccacccbcbccccccdcceccccccccbcccebaOhd][QfPneecZZ]ve][gd_krdPfaJuS^a^^hMdeZa^kR`p^^PhU_EgU_njZg\RlbfeWUchd`[chi\hccegeeiebbmhc`gZ[pVUQhfna`gab^cjb`amg_bbebbbadba`hha`bcag__iac`cgb`gc`^bbj^adbacecdqd^hdd_aaqcfdf`abZbdVc^bkbhcc_]ZWckae\j]a_e^Zmoj`]a^e_Xe[ecbdc\c`ceb][^Z^_blabaggb]``\^b_ekkl`i^dbahecafqdcca]ele_a]`dhnd\``\VYbabycbW\_accegfitfcbaYbqIUgPdVTa`cbb_gaafbcbja`bdcdbcad^cegddc`dc_cabhcdaa_dcacdabbccdbgcV[g`ek`a[febje[l_]^]g_[^^qiao`]ddcmfk[_[pTZ]igdfbdXc`hfch^de`bT^e^ba^\f^dnbj_gch^]_c^b]`[uabdfeZe]cc`i__edkda\h_`a^l^`\cbv^_f[e]ce]hgciebe^eZ]eagca^bhcajfcgb^bjc]fbccccccbcgdccbccccccab_kgbcecdfaccccccb`abbbcbccbbccbc]hc_aee^_f`eZ^dagg^o__ibeXng_`]ehgc^e_`Y^`p_jcgcc_bfba__bgce]he`fg][eb`Uiedcfehbe]\]bepf^`\ea^Xb[[\daai]]dc]agd^dbbcd_a`adbbcdcbddmabccg_bbcc_`jbebbfcbgccdcdfd^bhd[]_gl^egdan`hpdraZUl[ioe`ja`bTXYiXX\a`\[Xcc[`^h\[c[hf_`_eacfacaebbe`ec_`b_fbdedcdeefgcdebafcaebckaa_cb]bcdccdbacce`bgbcccccbdb`ceacbdbdcgbdce`ebcbcbdcbdbcecbcbcSgapck_i_m_f]\ql_d_d_]fX\^[\a]ce`b{ed`n`em`bWWbe_ib`Wcbbccccccdf`dcccdcbcccad`dcccdcccbccadbcbcecccddccfdcadebai[abfgcebba]c[`ledoi`agb^\g]^j_f^\__acdblc`dacekbebabaeeaccbccccaccccccjbcfccccdc^bddcccbccdecdaecbcccccc^bgceaacdac_bc`bac[bch_ddbacgb_aa`^c`_bmi_aidacgbhecbi_ggc`cccee_fbbc_bbccf`c`aabb_b^jcfbcacb]g`bcabe]bedc`iobm^n_jfdbcd^Z^ec`sdZc]_ZiaYnh`fbd`caa__fa_``icfY`^]ba_W\e_oYf~]]X[_xjX^W]\QdY^JZ[O_ha[W]]XTdEW}\XG]]\`\\]Wecccccccccccccccdccccccccccccccccccccdccccccccbccccccccbaaciabcdbbbbcbbbdbflcbfbdbcec\bacabhccaacbegacbbacc\cWHj\ikURGbHQZ]UJfpRIg?L]kRGMYG]uGnlSa>IUec[WjdL5dYdJbcbidbcccccacccccccccdcfcicecbabccd^`gaacadc_cccccccbcbqck`YdXgde\c^]]faf\W_`^n_[jeif]fbe_bgl_d^c\c`Zga[chcfZlWZ_ifaXme]Sm[X]eh[iaYe[bVcWq_[cRWdUv_`X]W[_[cceceZc_w_b[_Yajf_Vdee_fdWeb\^`e[`^`efm\Znhmn]^Yb]da^d`\_Zf`cccccccccccdcccccccccdcccdccbcccccccbcccccccccccccccbcafZQ\n`XY^`Zdb`^ddv\tre`]pTY\eh]YZhe]__[dpk]\ak^acWg`fidc_cdbcgfdbedb_cc`bcdacccccaba`baba`eeh`bg^dcccgbdcb]gaX]YY^bc`cf_h_\u>eb^Uch]Wb\adZk^_cdtffiaW`aq`_]fVb_b^l^acedabe`cbgbbcadhaeacccbecbc_cbahacceabcc_cebj`a]acccbccccccdbccaccdcbcbcbcchccceccdcbc`ccccccc^cicffccbcac]]d^ahabef```b_bbc\_^_hbad\Ydck`madga`abdaeiacgabfed`eb`ecciddgbbkbabcbcbcabaa`ad]`tb`af`c`fdce`^e`dbga`d`[b]_]hpf]c^`_Y:^`ecdj_\^Zcdbl]S^j`e]fe]eV[bZ^k]c\_\gm\k`Yf_a_`j`d`^``^`^a\a\`fe^chcbe`cd]_ea]af`afbeaca_^_`ceaaeaccc]gaadbaaecbcacc`ebfcfe_bebd`cbdeca_fecdhcbcaabddaccbe`bacb`bbceeedbcf_eecceafac`ddbb`cbd^bdd\`bbcfcbcccccccccccccccccccccfbbcccccccccccccdccccccccccccdcbcabccbcgaeeccecbccb_ac`cbebdbdbcebcbabbbcccabcfcfebf__`bdocblafm`befb`dgbb]ba_dcgbccc^abdaaacdababab_cbabe_\p^i\h^^Sa[aibm_][`^eX_`aeYaacc__]_\e``VQ\ZeZ`\^__af^cccccccccccccccccccccccccccccccccccccccccccccccccccccctfW[LwU\KVMTZT[XP\NVTwP\YaV{RAkZYOPTOGLGVT\TQRVTPVTYMKcccccccccccccccccccccccccccccccccccccccccccccccccccccccbbbccccccdbccccbcbbbbdccdcbccbadebbbcaccbccbccccbqcfcbf_^ca_ca`_`bcacbbad^`]^ehbe`e`b`cbdeadbba]bg_ccaaceibbabhdhbbhadfc`bbabfbgbcdef``]a`eaaacddcdbah^`bebdbbcfdicbcbbc`gbbbb_bdecbahab`eb_fbdaabai_a_bamc`dhbcbcbcbcjdgc]a]b]_d`^[iacce]ad`a^hZa``ijbac\`ggea]cfhjbf\a^^bkf_`bdcbbbc`hcbcdcccbclcacbddbbabdcbabcbbdccccbccdddfbdbhba^bbcbc`ebcecbbeej_cdicfhcbbgdg`af]cbd`bb`decd_c``b``_h`cgifeaebg[^idjajfclebed``ihd\ga`d]lb\db]hdicmd^kc_ndd\a^a[ff``ab]hcXbabbf___bb^ncaaebgi_e```Z__dgb`beddaefedkeaac[g]djc_eeca\fi_c]_aYiaaf^ffdgf__^f^cab`Y`]_adYbdeh[_mXe\\[_X_]M^ceZgWgc[_]Xe^`ZWa\bbdr`^g\co]_bdtgde__fabacXa```cci``c_`]adaahce`hb_`efa`dbyeZbefc^`eaf^hZ__e^a\f_[]c\c_\UYfca`\]Z_Q^[V`]`\f\da_K`UhZaZ^\^fbo`]^bZ`_]gb__WShZU]d[djaa`\b[^j`_`g]Wb`j_WbbW[b`XY][abdbbccccccbdbcccccbcddcbbccdccbccccebccbcccfcccccdccdc`e__ibgbgifa\f[\bbcZb[Xda`Va]`b`_dafejicga_jlb`aidZ^_gcic`deyZ]YcadZ_dZU]ddca^akX^`sdf`cV`]WeZhVwtcjd`bYj\cbl_f[a[m_Wfcmbd^`XrT_XeUd_aZcg_aeng_Y^dWeae^Vohl]_ScXkdcgegdhc`Zch`lj^c\gWZ_dW[bacck\jcd]c`atgam^cnc\_e_`WegfgceYi_[bbfaY^cf\`b]`[S]_c]_cXZ_Za]gpjik[_^^aY\baQZ_`ja__edfbcb]ccd^cec`gcbccceecdd_cdbddcefgfbcdaafceaceccc`l`\`eXaieede]af\aafbpbifgcd^daacffgeaadcVfacXa``a_bhbcddccacccccdcbcccdcccccacccdcccccccccccdcccccccccccccc[__haabedW``Y__[ae[V\za{egehe]a\gm[_eZbd`\c\\jbMad`^leacZNeaS^fPWpUiOGNTcRQT\K[cfl\]PYpVTK[`cXGe\P_NVqZOdc[]ldacc`afccaadcd_`bbchcicaa`a_ds_d`ecee`ae`a_c\bfae_b`cacnbje`ca``a`aq_YYjReff`^adaY`da]_]Z_^dTmg\fah]k^`^abb[ccfc^_ab_iab`]]cfaf[b_`\b`a^eh^dgaia][e``c]abcYbo^_ba_^bb^dc^VZb^b^b_v`dfiZgrV\haa[\\bem^g\cdVdO]^]Y__f`dd[Sa]PigcV_`bae`hhfb`\cdgTacf]ig`j]Z^`ZeQdggWccp`^\l`_hvjba]b^]ac``[cYXjhb^`dibi`]`Wc`djbi^a\apbW`bbeSkcbaZaidgg]afga`\bcga^caekf]b]afca`[]abdee\_cdgmddWbbadba`biccccbbdccedccdccacacdccbcbbaabbfbcbcccccecedegbceY`tf]e_c\`ei]d^fc\cZdaadlb]a_b]eae^cg_ccbbd``ib]_i_`ghccdbcccccadccccccfbefccdbbccbcacaccbdbbbccccc`cccbccecmj]j`Xdh`U^^\c_b`c`e\bg_`_`_aMYlaVcbec]aeRdUi]cSe\bk`fde_h_cV`bia`bkf]bd^`c[`gZ]^^ca^hjkZ_he^y__X\`c`T_g_af_bedabX__cZZZ[`hafae\]ddaOZjcbh\`bkcbfdcf\^]cec`ebjg^[X_S]UV`jbgh\hUY]Nh_`eIphSEIg^ak]ahco]kqidYZ`f[]XnP\bIhff`__ac^fbabb_`hdfa`]b^a_`j\`agcbap`dfb`c`abececdbdh__a^cbZ_^ja`bbaW\kMfm_roehuZ_h_fend[ZdZ^W\f_f__id]`[Xd`baabecbedbcdbcecddbfaaeccaccbccd`bbbbcccdeceafcbcddbadccccccccccccccccccccccccccccccccccccccccccccccccccccccb`U]qnhh]`ff^Y]XbhTZ]ae_X[_`bgee\efeehVh\]eob__gb^`akcdcccccccccddccccccccebdcdccbcbcccccccdcccccccccccccbcig_k^_iacfc^i`ghfbc`eamcefcj`cg[[gjdififhd`de`dcde_gd[Y[^aj[]fp^lb^]^^abk]d[bi_^Xnb^`k`_^_fZgcjk^_\d`fbiZ\_\lfcagdccbYpffae^ccdh`dbXr]^hYk`cckbfZb^]_jcd]ff[c^befiah_feiab^cd`ddcbabdffj`db`badg_bbc\c`_`_bbcaamedcfdgaecccccccccccccccccccccccccccccccccccccccccccccccbccccccxabbababadb_aaba]daeh`cgbra`a`g]edadgbcXceabc_a```_`dd_\fh^bdcbf^kcbdcgg[dd]aeddkcddaegeadb`cebea`cfhc`ce[aecb`aecccedadccbdbcdcabdedfbeeb\cbbcdbcdcdccbbbcacfdaafYigad]b`]bkUZga^gh`^erhZi\ecY_`c]eehd__Z\bd^\`_aedegibaadbbcccdcebcccdacbccfebcbdcfcccbccfbcbcecccbccccccabbbaad`bbcdd`decdcbccbdcbbcieccb`cdcafdcaabcccbbcadcdffc^^\ZcqaZlcdceYcVJ]nGa_olb[}ShshoklR[_[`_`^Sme`\Z\fdP`ibfccbf__]iddhXd_`bb]eee`bd]aeddibafedc`ace\dgi_e_beh^eZZh]^`]dgb`_a^c`]ad\fb^Y]]fdc`ae_f_oa^\_hde^[]`fc`]`b`rbZbdaacaeacabbdhbbca`bac^bccbbac`d`ddc^dbceebccddabcbXT]^\d]be_g`a_b]X_gZ_b]`\bf_d^kee_^fb]Y`ljc^r^[i`]ccd]nbVbY`]c^j[d^^dccbikcbe_^d]e__bdtg_]fcbcid_ha_addac_`tcced`bbcebbfccebcdccdacbaccdcccdbcbbccdecbcbccccddcbeb`y^ceb_aZc_]d````b[`ga^[a[^^``cc\``Zzgae__d^V^_``^bdj`daabhdacbcacbcababb`f`idc_bd`dcab`be`bf`lbbbbdadccaje`]qea`a``gbaca]]a_arbfhdgbau_ha`haZdggc__fZb`e`daj`_cob]\h_`d`ck^d^_a]^^_cg`Y[_al[_[ddb{m\o\Ya^dZ_[_[YbbZc_c_badchbeedbfgbb`ecabfi_ecaddea`a`dbaj`bbbb]b`ea`^d````]fa^igbbcfbadccbbccbbaab_ccecb`baacbcbagbdfc`hb`kcfbbcfhcbb`a_cicddba`fbaeeacana^abhaaa``bcc[``bae`gaagcbbcc_bYghbdbQ`iheiW]]]WcgZ^fXZdabj=Xicfa`dbfffcdh`i\cWbjXa`dd`c`dbaaam`bbbbabbabeahd^egba`babb_abcbd`caa`ebbdbbd`_hY]leed[_eZ`cZcl^\[\^\[`y``]`\]cWa{\a_[^mfa``da^\^[[b]ihdhe]nmdch_ladcfh]fhZZhg`dg_``da__^ebclbddfdgbbYf^Tccccccccccccccccccccccccccccccccccccccccccccccccccccccafc]cZaYWa`Zca]m\P]iaaaakcnZhedh\`X\bbmga`pfV\XcXWg]cccccccccccccdc`ccbcacgcdccccccccdcccccecccccccccccccccaqad`ccb_caabaaadcbbeabbecabbaacaadaeg`abdfa]cb_b`bbec]b`gbfda^abcfl^_^e]dp^^adg]\di[_i^cja_fgg]^]ypcd_Y_Z_apje\emb``_\aZ`vec`\kf[db`]^occlpaacS_aX^aV[`ai_m^\f`f^j_b`]cbbgbceeabbb`agb[_ka^gfbdg`i__caa`cdebg_hk``db^gcqc`_dcb_abbafa`fb]e`^dagadaa]`geb]_jecja_a]ib^`hb`ie__gdgfcgk_b^caa_hg`de`cW\efd[aYaan^a`a\bic`_a_nchdb_nYa\aeaV^k`_hbg`bkX_\cd`a^_]eZ[d^gdf^ged`ibail`p`W]hq`f^d^[de^ge_b[a_a_aae]]c]cfe\\xbd_XZcb[|[cem[bfZY\^``]c^hZ^acahbdccahZaccafi`bf`_cc]`bcbf`gdaf^__adeaob_cccadebbgbbcc`bccgaaabbbcbababedcbcbgaddbbcdebabcbbgbacdcbcfce[ZaqcbhhaecaimWee`m]ecschc^`cbd]b\dddfccf_`_\hf_Zdblcia_fb_i`_bm`VVc^Wg[eY}iT`ecWhVchWZXUmckbYeXeS`\Ta_qb\PYfe`_mocbYlaW`Xff]`]Za[\RccecfVaW]^]qp[^Wla`q^[lWaje]Xccbcdccccbccccccccccbcc`dcccccdcccbcfcccccccccccdcccccbk````__eegggacbh`je^kbZgfdbeY_`Xa`eb[]g__abcbc\bge_^ahZe_e`_ag^bc]^iccjff]`chbdeXg`dlekdbha^caifj_diglice`\bdcbc`cb`d_bb`bdc^b_cccdYc]abaddd`dbccbddda^cdab_bccccc``b^dadid^bh`daii_ch[aa_`dba`Ybad]_eiajcfbcbea[b_ba`hccccbdccgeddbcccccc^bcd\ggccfceccfc_edcaabeeabbc``cfcddSseSa]bbbcbcdcbaceabbaacfacab\babbcaaa`a]bcddfbaa`bg^ge\ebZg`bf\ad^^d\l_a`d_a^`f`lXbjX\bbid]h__^if_iaZeXZwjZ\fiaaa\aaacfae`eacbah_eb_`i\Y`d__k`ccc`gbj`c`cd`^_af^fdbc_bdec[bbbbfgcccabbfcddchcdb`adbe^`[`gcdeddjdabdea]cajfcd^eb^_d`\^acch^``d^iichh]bbeceaY[d]\m_ae`bakebe_abdc^^c_bgbabecceaeccigcecdgd`\e_fdabc`cd`bc`dabfbdaebcbbabddcfgdhabffgdcb`bc]_blcac^gcf^dacb_hd`beacacfe_bacbccccccde^dcccbcbdcc`dfdfccfcacbcaadbcccdccbccbccecec`[cc`bgbnccacacdc_amebec\\f`abcem\_gZ_^acabd`ic`afagebfg_`e^W]emf`c_b]fc_fa^gc`ca_aabdacc]h^kgcX^b_j\a[[i\_cfb_aca^`cdhe_b`gbebf``h`ae`cbsaggbe]`b_b``e`c`a___cadac`[afceeaekb_\`c^d_h_\aced`_]nce\jd^df_ggb_`n`f_b^cfh]afc_T_`bch^c`b_sd`mdfi`j\\^aa`ccqb^b\_e^`fb^Y^\p`aa``bcfacdbbcgb`dccccadedcbbce`dcdibbbcbaecbc``ccfccdcbccbcabif]_cbiddabbc`bbbhj]_`badchac^d`faaecieedc]`fcbbcdgZf`a_beacggf_cbb__gda`d`bbd`b\`__jbeha_f_id``gd`ZcddcdaVeRZd[ca^YYU[bduaV]Wl{fel^`c]khbXbd_`_dXWtbmYm`ZQSTfikSfiqiT_VWXWYhKYV__HG>ZRLR_dWLQYc=Q^[fgcaiaebed^^_aaj^e_]`cj_h^a`g`eh[_d`b^]cdb`adjb[bcaajfcccccccccccccccccccccecccccccfbcbcc`ccdbccccccdbcccccbccbcdcccccccccbcccccccccdcccbdbcccbdcccbccccccebccdccccccccccccccccccccccccgcccccccc`ccccaccccccccccccccccccccb_`c[a\hkd]`ZXicZ[[_aj\]c\e^chrd`^`YcYna`_`d^e__`_fV]]Q_[e`^KR_`]Yh_[WW]qXbQa]d][ZW]_[[`jkkbXha_SZ`VaX_]aNe_YeeX__dc[ffQacccUcaVceaN[_cM`UvpZbYbd]Z_^dbXf^ftVbhXiaVb`ccabbdgac`ccabdaabbadc`fb]eabacaaadaedhccc`__cbVnZaddZgY^][^a`^g]c^[oa^]`]]bi\]n^Z_i\c`egfhugbgc]cc\b`b_bgecc^cb_bcpabcdabbabcbaafcaadhbbaaegb_debabbdgdceaccccccccccccccccccccdccccccdccdccccbccccccccbccccccccbh`abfcccfc_accccd``cchdfdccfdaebabcacbcccbcedcbacabcbcbcfcbcccbccccccccccmaccbcgdcbc`cbacbbcbbbacebccaccccdcnk]XW^\a]ZX\^e]]Y]b\V[XXb`aaObg]^bofovt`\ZX_l[\j_Ws\^^afaba`bcaac_gcbheaabg_ebaadag`\b`a^neacf`cpb`abcbbec\dcafgge`d\^fibbdalwaWi`e]cmb_K_iS[XM]ZZZn[g^fgcag`jtYalbecgccbcacababbebiccbbb_gbfb_bfbbbacfabac`aabbic`gcbdhZ`cc[kfqcm^^[g_Yb``]`cWk^ecmgqb^l[LghiVfV[XY``Z]kg[Z[a]\`bfeaaa`cad]dac`bdcbechddcfcic__caddeecfcedbdcaebcdad`Qcudab[dh_bcfd`cgfdgdbkgf`babd]h`ba`^adbbd^Yeddffbb^akbcbdbchc_bcbbdbac_bacdd`bb`bdbcmbdeadabbc``bccbebbg]jVlb_]K]hb[\jXUqUbgVe]^\df^\UXVWMP\ah[rXn_~TVfdU`W\\\]e]_]bacjd_[adnca`c`^eldda\aqa[c]afd~ai_]``hci_cb\__bi`i^f`dYkbee]c`^]bbddbca__`cfb`dggjdica`]]d\\daihbac^c^hecTe_[b}bY\\Wl[iY_`]dZW_mei\\VejZoqV`jT^oeY[su`e]eb`_cbbccccceddecceccbdbcaddbccbbcbbbcbccccbcdcccccccdebbecfbcbccc`ccbacbbcebdgcbdeabcddabebdcabdccebccdcdcbbcfa`egdbcbbedfe`b`^adbfb__^g``ca]hgba`fbcoi_dgdeaaebbb`_d_chbbcccccccdccccdcdabaccdccccdc`dde_dcdbcccccceccbcdccbcfacccbbddcccbcdbcbbcbbbbcdbhccdeafbbbccbcabdcccdebbYiKaqf^f`ac]bcd]ak^gb\cdbaebc_abhf_aa`iamad`c_hae`dach_gbffabbdb`kab__bc_eda[dbe`befeeca_gec^jjacjad`b^_aidfZ]gab\aaadY]af``X_\cbdhaYebYeWc`c[c`^`Wj]]aekp_ig^b^kcfdcbcccccbdeccccbbcdcccbcddccbcccccbbdcccbdcccecacccckkc`cdcckM]_aojf_db^fca`f_^_ebcfbgc`cefb_d_aga^oa^`mbiecbcfcbcfdaicbcdedccd`c_cacbbagcbb__d``bcccd``fbdddcefcbdcbcccdccfcccccbbcadcccbccccbccccbccbccccccdcccccgdbhb^`l_o_bhd\]Ydf^abcgfhbdb_f_nj_gdf_Y`bc`Stgh`bfX]\[f[bc`^b_]ee]ecc`dc^aeb^cidcYf`bZh]_aaeaed_e`bb`_^`ahaja_f]h_ic`Y\h_b`\^XZYUd]jc^_fa`joa[bY^_^b]\^kf]gb__^^f\i]Mj_WcSbao]doo_`vUVZh`cWo}cQTiSghialakf\b_XT[aZn_n[NgmV_e`ffajc_^ca`dc^fc]i_\abbgebfcaab`a_efbb`_cdbbghjedgcakoadceg`fc`fij^fjdh`^fdeg`^\[sh`jV_eio]^_mlafbeba_^b\o`cabhaaccbcb`ecclfa^dadba^cbaa`ca\bbedach`b_`cccddkacfaefcabccabbebcadbbejdac]brbobbbabcc`cb`d`cbebbc`ebbbbddcbcdcccccccccccccccbccddcccdcccccccdccccccccdccccccbc^bmZ_`ebc``ahbca`a^`jZ^^ejbfZdVhi`d]Zbg_cifcfjcbbha`mfceacccbbacafbcad^`db_eebfdb`aaeccdiebcddcfdc`ed`cbcbfcbefddd[jfabaf\db[`[_adce[d^dcf`be^ccdbgafhab_bbc\gcaa_k[[affeck_hV`_fpe\Wadjbal]^\]ctabc`ac^S\ab[a`b]Z__]clWb^dc_eacbd]ddbceddbccgcedecbabbdmbba`fdbaabc`dddddcbbbccccccccccbccccccccdcccccgccccbccbcccccccccccccbccccdcbhc``eaYeYhad_\fY^aapa_eahf\bfh`fcg^if^a^cbed_`[`b`cedclccbbccbcbcecccbccacbcdfaccccbcbccbbbcccbccbccdccccccpbca`baaac[beaabc_bbb_cbbdcb_aac^bcpb`bba`bbg^bdcedabcccccccccccccccccccccccccccccccdcccccccccdccccccccccccc\Xg`if\cdQmla^hciXqc[mfbcRcba^f}s]ZsP\gWY^Z_[]b]P[WVUeagd]gbceda_ddibbcag``fdhaccdh^b^b_aa_e``dedcdcfchbab`iaY^U\eanUfEaV|TazQxRdNWNmcb_i~]UTZhZbf_YLipahfSeXrTk`aabc`bbkfacbbababca`bm_b_jdg`hccaad^abeadbf`cdcbaacag_]^ffeecee`ccbgecadad_ahaggbbddbgdbcab_acfbbceb_cbccbaSc`Wet[_`XdMp^_c_mcrTZ\YeWFcY[bY^f]\bd]}UJfgST^\Uoh\_ci[bmcbdae`dbaa`gac`^aha`dcba`eedcceiah_dbbea_dbcc_dg`rebYggZdfacbd[YhY\i^gZWl]o_hg[\eje`efb\afc`^m[dVYi\jee\[[U`RUYs\eOFljl?[\Q^UNn_`daZ^tQXJaf``PS`]meBXsUdtQbf]``dj`abeagecc`^k`]`dbc_bicbccfdc^d_\b`]ia_aeechbd[a^hdibgceccc^cdccccbcbcfdbbaadc`cdbcccaabbacbgcacddcccbcbid\\bq\`[ibphe`__ZSneqV[ag[Z`[ejc_\b[nd]`ebu\kddnU^[e_`d^zcdXiW[iX\\_R`]TpcZh`\a_cYSrW^km\_lVY`OK`_WZbTY]qjU^^`aef\j[e__d[`VgcYnfZac`c_d`hlgdh]^cc`ece\]gZXeaVjkg_cccccccccccccccccccccccccccccccccccccccccccccccccccccc_j__kbab\_]Zi^^aizX`dd]Wa`dd]ni`fb`_[[s]jfelX_dcagc^[^b`eb`ccgbf`fbcdccccbdbcgcbabccebbciabccdbccdbbccd`ebaa^bha`^ae]ca\c\acdbS`[cX`gbXdf^_gi_a^ac[\bf]\c[edZo_eae_fc\cdddd`cbbcf`eceaabeaaeddb`bc`dacdaecgeadbeacddcfdhYd_a_mcebXd\\c_icjbabc`ck`__^hf`bada_hach]ejdb[caaj_d\jbece_ijfcfi^hcbea\g^``a^c\gaX_bda^cbaegehe[ia]\c^d]]adaelchcef]hcbccfcd_fe^dbcea^e_ac_gadaa_ddcgacccccab`cccadecccccccccccccccccccccccccdcccccccccccccbcccccccccl`fad`abbo^abb]__`[[^b]c`ccblXZ[^]bX`fa[Y_^i``wbef]^a`cbac_ec`babfcd`akf]cgi`c_mc^e_dc_bf_ggagl`Y^gcaf]a`c``_`^dcbb^icbeb`fah_eZV`ibc^af^`dcbceb\bg]ck\jbaa`cd`Xmcfghbdb`ppcb_`fcdkbdZdhfb_\bXd\_`XbeUkZbdUYarXaZZ[[edkdZao```baba_^db`ca`fZb^bbbcd]Za]b`mgfj^d]adjbbabba`^c[]Yhg[c^`^akhbhe^f_hh]Wo[c\cgd[\S`ddffajWXffZaaYc_a]nXS`gdeadghaj\`_\]fgokcceebW\_d][kh\]ae^`e\iSi[dm\Q``df`]_bh`[Toecf__Wbg_dg_agc]c]a_c[h`g[dljh`ce[_agpZdbZf_e^`c_l`hdb_gchacc[a`becibacd\abdaeabi`]iscff[`c_`d`\g^caadbcdccccc^cbccebcdcddceccbcdbdcced`cdccdgbdcccacdcbbbccccccccccccdccccccccccccdccdcbcccccdcbcccccecccccccdb_hiZiaaa[]cYd\[]fc_\ja_ceddhj^cgfV\^__bfcdYgl`[caYdbheQg_bZ`^^YZhggkdZmj\Ua`b]hio`ifiaSXnic`c_`nddh_ZaikWY`gc]c_c\_af_e_pYQbT\^VkX_dbb]eet_rn^lfXm`f``WnQahYTbaq^\`cedebbcbcbccacabcbaacccbbcdbkabbccdcacbbdbcjcbdccbcbb_gh`Kabae^cgejc^`jaccc[Z_`]_bcelfim_a_`^be^_n[abfd[`_ccccccccccccccccccccccccccccccccccccccccccccccccccccccc`_bakhe`_f\YaaZfei^c_Te]ade^d\dq^efd\\bljf_efadd`h`f^_dbccccccccccdccccccccccccbccccdccdccccccccccccbcccccccbdd`\_]ba]l`\a_a`\_^ec^ba]`cre__edbPl[^^k`fi\v^`\h\_fcccccccbccdccccccdccceccccccccccdcccbcbcccdcbebcccccccW`\df]][t\^]Ub`Y\IS\dhhd[t^gX]ewaie[_^a^aX\eXpYXa\d_Wa^abebbc`egffadeca_d`\cdcbeb]cbacbd`eeadabccfkbcceiacgWOSb^E\NOnMRLRPmZ7P\q(MRC\NXcJMMiNuXSHGE`VWmFPHRYdcdcbedbd`caccdccbbeccbccceddbdb`ddccdbfcdcaacccbbbced{c`i\fbm_l_tb]U^QfdPdfWfk[mde__Y_^f^\de]g\Xn]_faaZh[^k]`ik[gfc^ccn__be`dcbdc_]ah_^am^_a`abafbb`bcjccc`b^ec_f^_io_bbc_cdjbb`bbd^dekiXcdZbaacggab_]^aai`ae``j_drca]cccccccccccccccccccccccccccccccccccccccccccccccccccccccdeccccccdc]ccbddcbcacdccbccddccbbd`^c`dfcbeebafbcdccbchea`d]\_[[hbdZ_b_`ega`j_`dhZhcad]dgfa\`cf[cgkcZa__dYc_a`ahc^bcea_cdccxbbddb\cda_deebcdcdcaebZ`c^ab^cbhcddchdddccecccdcfbccccfdcccacbccccccccbccdccccccecccccccc`bb}hKXZe]]OU^[K]VfQ`FlQSZFX=[YMdIWZ]ZUUL?Ne_iVH[Z]O\P[Qb]^_e``bfffaa^hccak_cec]^[Zab_cb`_ei]cccZ_^agh^^[d_[indb_bibcccchdcbecd_daab`adcccecdcabacbabcecccaacbcdfb_ecccccccccccccccccccccccccccdcccccbccccccccccccccccccccccdcabccbccdcccbcbgccdcccdccbcccccfbdccccccbcbcbcccccdbdaaeccccb`ddceaccfcabccbbccbbhbcdbeedcbcbccccbfbeae`^cfcccd_chcfcbbcfbcgbcbajc`bcgbaca^b`d`bae]cccabdccgacba`ccbabcfcblfcaabcbcfdcddcbeebdcaa`gdceb_`bbababbd`badaacbbabbcafeecbccdcdcfabeabdbabccdbcecbdaaccebbdbdcadd\^d[`dW`bdg^\ccmhcMh_`]g_g|Vbhdg[WdV\XeZ^[nw_cd__z^b`^bdccecccdcdddcbcccccfaccccbccbccecbeaccdbbcccccbccbc`ccd_``]de]`X]```gd[Pic_]saZg[_`db^ciZ_i\`chIUVcebko]Va_[__ebaagd_^_c]b^_]`Q^fdjf_``q`^^]`d[_acgff_mg\d]]`bhd`iff^e^_mh^]cZdccYfdccWbe]ahtahhbYXg_cg\hd`[Yica]d]\Yacdcg_fb]fdbao`_ag_daf`jgacbaf^c\`acb`b_`_f_d_`if^^e\dccccccccccdcdcccccccccccccccdcdcccccccbcccccccccccccdbfdbebQq]X[hc\SldXaYj[l\`f[[`bR[`ffmfab`oaQ_h]h]}[[dh\vhdbab[bc^cdfacbaebadc_kcchbg_``iadd^cckcff^`bbadcebdaabbccbbbccbccdcbdbfbdbebddfcdeb_bbbb`cbb_b_bbbcabcdbbbcabdeda``abgddgdedicjejeehbe_bgiceaeddfcaacedafddje^cjjd]dcabfd^_ecbfh_e`_b`adfhecee_gaccaa`e`cdac_bdf``bedahfbccccccccccbccccccdaccccccfccccc`cccccccbcccccccccccc^u_a`abbeb^`ga`ai`h__\c\g_cbaaja\^bb`d^e_[gb]a_ubbaaad`fbceg]cffjefN`hc_e\cl]eecbdcYccebcgfhgbfff_bjakodeabjcccccccccccccccccccccdcccccccccccccccccccccccccccccccccbec_cbcgh_edcc`dc`ca`c]cebeeafegcdagf`bicbcabhac_dafbacc\cd]^_]f`mgf`_\^bzbbgY_caddV_\eeea\jbnbacnlXZeaT_S^cccccccccccccccccccccccccccccccccccccccccccccccccccccc^^hddftc[bdadbbb`djcbhZda`cbd_db]`dg`cccfead`]cjb\bbcacb`d`eccabccbbacbcbccdcjdceccbbcebc_eccbaccb`ebecaechebcccccccccccccccdcccccccccccccccccccccccccccccccccccccbaadd]echbdgbbcbbff^e`ea^bif`bcaadacccb_bdcc_dbbcjecaehe_bbcgcacbdcbcgcd`acadebbcbccabcckbeb`baac`abbfcbdbbdcccccbccdcccdccbccccbdcbcccdccaccccebceccccccccccccccdc`dbacbcddacbcbdcebbgdecdadc`cacecbdbccccccbbaccdcebed[`f_a^cnY\c`_[bc^gfe^ff[iifV]^eciag`[hbddYa\ebj[ceUmgZ_`a`gb]bbahi`_a]aca^d_`_eddbdccb]e`cca^af``a__dcbdcb_c`l`_e`aagdfd`eccbgbaebee^aebbca`e_ae]cbe_faaea_cbecgd``bbdfcbeelibcfcabbcdfca_`b_ad^e_eaec_becfcdd_accfbc\i_e\lkSb`[be_`]Xr\ncbhXb]jcYhXObamina`Z\UWdxSa[_^^aW_hbrckfUm]ZMia_UE^Ra]fagd^re\Wneg]h\gbUgY[`Xj\afjd__tdbRadabg_cc`cdbfccbbdcfbbca_kdcccebffaa`ccababbbbdccdaeb`hcbe[j]bibi`f`_bdZdY]gVfc_r]Zc[_[h[fc\cW]f]X\[l`cq^]_ccdccccccccccccccccccccccccccdccccccccccccccccccbcccccc_Sdd`^u`sace]acr_bTgg\ZjaefoZvsgb\`aVUdbd][b^cca`geWYbcf`feabcdcdcbbbcbbjbabdbdfeecaac`adedbbba_b`beccdeb`ccccccccccbccfgc[ccac_cfchcdccbccccc`gbcccccccbccbccccfcaa`k_dbbjbdecbceacfaaa^gbaccbbcdebda`daecdbccaegcecfdacbcb`cccbeadacccbeefdbbbnbbcccc`dcbagbbccccbbcdbcbcc`cmYZadMTigSS`dN_CgRbjwxhRm^a^RO\DKHbBeZhWk_D^VM_eLjQeddedeeedcecceddeeedddddcdeedeeeddeedeededddedddcdeeddg`d`ababgdhd^bdhb^^dbpaead`e`eaggah`c_^]dadc_aa`c[l]]gbbbbfcbcbccdbccdacabba`dafcclcbcbfbcaacbabccabf_cabedbdedhadZ`og_]Wbei\dT`s^djcdY`^bj^fbbbi\idYnf[Vd`_bY^Yb[cgeb`cccee\ecccaabccb_dcbbdcbhccbcbddabc_bccbbdbcefdbchy_a^^k_e^_b_]^_p_Za\jfa`bebZX\b`qj^\]]\co\[\[a__adgXbacbd`bcadjdbbgaab`]fid`d_gaabjahba`i]ddgacba`acc`ced_dibgcdbqe\i_g]`bja`_g\hX]ekh_m^hdhb_[ff^lb^aZ__ZZib\`hb`echwbXgfbfbkc`amcc\^[kffb^chiad[gZbgeb`_e_ce`_Wig_flmXc`afigcZ_f`abY_ccbjeab]ge`_TY^Xcdem\aYe`e`e^^b`Z]ja\`edbad`^fg`^mb`ah`gfgq_acc_dZadcfhbf^da^`da`d_ebfca`]w_aud`_b`d]]\_cl_`dbesb\_dc`Y]e_]fZbb`abddb]_\a^b`gb]uccccdbccccbfccbcccbaccbaccccbccccdcdeffbcbbccccdccccbccbccccccacjcecccccccbbccdcccccdbcccc`ccccccbcbccccccbdfdhhihbha[b\hakbekfkbch]b_gibde`djakei`[bgfhgfccfcgceWcccccaccfbeaccacccccbfbbacccdcbcbcccdcbcdcccccdececceb__hdk`bede_]f\^c_^_abld^`^bddnchlag`c]^a]n][bUrgec`h\ca]ege`M\X[R\dx`Xd^bfcb`\ci[d_q`Ve]YcbD^ek[c`g\_ibRgZZWccccddccdcccccccccccbccbcbcbbbccccceccccccccccccccccccbedc_accdbagbbcbcda`d`dfcadeccgbcac`accdbfcg_ebdcbdbcdd^echeacabaabcabgdaccsbbc`bbe`bfbb`dda`abbabgab^bcebabhcbb\a]bcaagc`b`__^\f^\dmkg`bdpckid^d]]ec`cf`ie_bjc^`kccccccccccccccccccccccccccccccccccccccccccccccccccccccb]abfefb`cbgcaf``cbb`^dceeba`_c__cbadea`dgcebbchshcbeejbc]^\fba`jY]\\d`j\ffa\d``Y__\bbb[`cbbi^mfc]`fkkcfj_ea`d`bjbecac_`bddcbc_bfag_dbbbbkac\gbc]bgab_md`dbceabb`cb`bccbccdd^ebcdccecccbcccbcddbbcbcbaceccccccfcfdcedcec`Zc_^aWba[Vhjcgb\eedWW^_fcXcZYjZlckleccefhkic[b^fafe^ZUWcZR^YaQ\[O`bs[bX^Z[cW\dV]J`TPXXXSXYVIMcVYWX\aSY]]V\f\__Y_`^W_b[Z]bYTegUVgZcX^a[YXZUdYYi_YcX[ZWb\}\^d`^_]e_geWqf[^am]m^Vbab[\ta][`^`ccW]^Sclj_b\`s\Yj[dWU_b{_dfceabaUc]ce`_]^b]_\b`cc`cfaiceadbdXd^cdcc]beg_^b_`ceebfaZbic`cfckca]_gj_dc_[a`]kia_daa`_dbdedccdbjc^cbfcbbjebcde`aaeb^_eeb`ca`ab]ehcc]f_d^fdfbcf__`c`_ch`ededa`cedbbabaabcbbcdbaabccfb[ebhbccdegacaaaje^debfb`ddblcaec_ddddakb`caca`babagcbcbvcgb`bb`d_bZf```beca`acffccbbga``dZcfccgfcebhe[dcbdacb_`fdd_jcab`kbeagbg^cbbah``eca`f`\ccccbcccccccccccccdcdcccccccccccecccadbcccccccccccccebaacbbdbcgb``cbecbcdcj`ed_bddcbbbcabfbccaeacdabdbcbbd_dbf`becbdcc^dcccdbcfccdeecbdcebebbdcfddbbbeccaccbbdbc_bgndXb]db^ad]Xl^`]jcXbe_g`[_gYh\d\c]]dfJ^icfdbsa_^[dbhfcccccccccccccccccccccccccccccccccccdcccccccccccbcccccc_[Ygm`bc`e]hca`bfhf^gebeacfafb[]Z[a_f`bdej`dd_ef^bia`cWiXc_f_Sg]aeZqnTbeqTcgfgh\k`fracbic_Tc[^fkPdd_NaVeb_ega_``X\\aa`mad\b`X_[Vb_b__g\bidvmo`_gbfYgni`Zh[`gaVivhXcb`dfaccbchbbcccbdbcbcceccbckcbcbccb^bcbcbceacbdcbccebbv`b_b`b_aabheaababgfaa_fdadh]_a`ed_`hbd``aa\dadaabbcg_adld^bbfYcd`^\bi`]_c`dbec]ejfbbbdhgdaabf[_cbicddbhe`ebee]e[^`nggY\_^\]WfbZb^c_9fhj``Rffe__[aicaaaVYbceb[ccccdccccbccccccccccccdcdcccccccccccccccccdcccccccccccccbcba^ccecdgacbccbbdccc]cbcaacfccbcecebd_`daacbbecdcggabbcfedccbdebcbbbfcb`db^bcbcdchbbcacd`a`eabbaieccdcadcSVKXNZa`hVYXbZAT[_XZU`ZPXf^\bZYXdP]aHOTQOZ]H[YlcP]]HdeWc[bkb\dd]f_c`ad`_bbccdceccdVeqcfbdhhoccf`ebf`bgf_deif`ab``gabdcada]ac`cfah^cbbkba^`bb`dddbe_abcbd`abdj_gbbccccbccccecdcdccdcccccbccccccccccccdcbccccccccdccccbc\Xc[dw^[W_iW_Uiae\Uac^XZdiSq^\fgi__hhdl`_q`_kfh_MXam`Zeg_cfjecdhffZaggidcZhX\]`c\[aZfkfZd`_kecb__^\\]c`a]_`be\`a^`_b`aecdg_diahd`e_bfZaga_`_^hc^chjafccXb]akfgc_ago[adaYW`b_mU\\RZSXQBWbS]PaV^fsmcWX``\`gfba^OilWqlZon_gccbcadccbcdcbcbccccccccgeccccbbcbccbdcccbcccaccccdccici\ab`dnx`U^]]`kbi\^~\e_d^_dffa[_i_bj^bEbZh^fc[`Y\ecVcjb_a`_bbbfbfgbabcbb`ah\d^dafb`b^cbbbadlbbc`f_odcaejda_b_\]_haubaich`^aeacdbdfi_bd`_gk]bef^^bcgb^ceiccb_bbhbcaeoV`af^badb`e_^di_^c_fam_g`aafZfef_`^h\jhd_baf^`aagmedeechbcac`cedbdcbbfahaab[c`dfcebibe^ecgab`faaceabb^ahf`[a`a^`\e^ghbac`dc\b_`a][ga\^bZnhb]babrdghdd^rbcab\`aigaf^eeegcebbaecabcdecce`bbcdbc^gcbcddcdbdbdaadbbaccbc`e_doigd_`cei_gadd[_c_Z]]_ca\a_\ea^hbhbeYd`_`dehccb^ggaaabfgabbcedaebbbb__dd`eeacdadffababfdeb`eh_ad`dbabhebdccceccbcceccbdccccccccdcbbccccbbdcccccceeccccccccbccccbXV_]kh\bgcbk`]egWZeb^UWZ\ase]g[af]U`^cZd|n_XdUY`Wd\a`cccecccccccccccccccbbcccccccdcdccccbacccccccbcccccccfcfcfb^bjccbeaacbcca_hcacfccb]cihfeccaccccb`ci`\bbbddaa`afgaddbcbafbcb^cc^bc\bb^bfbd^a_ceac_babcebd^aabebbaedna]g_bbcbdbef`b^_bb\`g^d`tb[bb\g]^ge^becfebebZ_^bd^ccba[a`bh_bfedc``fa_b_dkffa`^c][^fgehcc[dbgcd]]]`fkalb]`^b`_cd^^c_afc`__cga\^`dad``^a^c_`_aab\Za``a^k_fbbdfbYcccccdccccdcccccccccccccccbccdcccccccccccbccccfcccccccie`cbcccccfabccccccccbcgcacbgbccebcaccc`caccaccbcdccccg`^fh^ckdceg`eXgcefh\TjaYfd\XWm`b_]eefdga`dbZrcW\`_a``cccccbccdebfdccdcbccfacjbbbcccZccbbocbaaccdcbcd`cabcbccccccbccccbccccccccccbcceccdcccccccdcccccccccccccccccdha\cncbccccbacbbba`acbcac_bd_caa`ede`bd^nabdcb`dcebddacad_b`[\dbec`aS_bd]cY_^d`\e`aR]^f^eedc`bbb_Rb_`_]adee[c`ic_dccfccabcdbcbccfcb]bcdabcdbhcbdecbgbbccbccccbbbcbbbeadpdaVb[beahc_bV`efahigf``Z\cfdc]aabc``i\Vi_Zk`c_ca[dgcfb`a_b`dab[a_baYeZ_bbac__]a]_eba]``_^i]ea_faX`augcdacgbbcbfaeccccfbcbb`bba`dbbhcebabbddceabcabbcedffcdcZm]bjecc`fgecaea`da_abfca_``_]eka``_cbaefgdabdd^ccfb]adbcbc`ccfccccc^ccecbcbcebccdccccccdbcccbcccbcdccacccchcccdccccccccccccccccddcccccedccccccbcccccccccbcbccccccag^da^`cjb_bccgfa`hfedb`d``_]adgb`cZdZhcd^^]ca^_cj^\eak[h`Z^feZ]__``dagc[^f~Z`d]c{b_W`decX_]]U`^]__eb]q^\blapaiWZgcKegdX[f[nbeaZdlbka^mU\_fVTofbWigY[Q_]e\\eScf]cbcccccccbccbccccdbcddcfbccefcacbcccdbbcccccbdcacbccba^dbhccbb_bf`dcbebcb`cgacdmccdcfbdbcg`bbjb_ada[aab`eabcb_bc`_ab``b_`]ijb`Uab_\ogaecjhe^mg\ebcbZfg``df_dbWbfdwd\ecbbbced_ccefdccbdbccbcagabbccgccccccccebd]deacddddbpYlmp3XG:hYpoD:JXwa9FPknE.fB68A=u9e>p9V6I8v^[WuL?eq/E@bcbce`bcabfdcbbabbbdcddebaddeaecacch^bbcdcbfaacfcbddbbdgdcb`bcebegcdcaadabh`d`dhdeab_fa`ec``e^cdgbc`bbcd^bbee[aebbc`aa`_Zde]ec^ecacfTe]e`edkZ]K]c_i\]\\RaaZ`]b^_^bcbdccccdcbbccccco`bbbcdcfbdaccdccdbbdccbdcbbcbbcbdbc`a_a`]ebcccedeaadccbcafccc`cceaac`efagbbc`ccd_cbbbfebfbccbg`^\bdfta[eq]_YhaRV^]]Scd]ea``ce__edgd_]`oVg`_aUg\_ah^ed]mica_c__`acdbb^eea_fcb_debebf`]dba\c_`fedchdebecc]abfab^abcbb`_m_^d_dcead`dh`efa`ei\d_^xa^e^hdda]f`b`ikfbgPn[[jde_Zfhh[YZ\[T\faSUaelmacafhYaf\ejTecSc[Zi^cs`bdgbb`\ihhcobY]c]_beefe_k^eb^ieeceffdfaih_bd`bf\aYdfcea_ea`fceaaeacbddg`d\bfeahdceeegfabbcabab`gc`addfbdcda~GlbBSv]^Za`fXV[NWFP]?a\[eOSOsXYVhX[Zj^T[Vd`XJYmX`n^^RbZd``c``fbf^]b_bY`b_`dh^c]aij{bZi\[adWciasbgah`c`g_\`effgia``_^ge]bd`be`d``lgbafe`bbchaea`ahd`dfbgbdacbdc^dbTW[a^htnfihab]`Y`ccdnf`u[bffapUdb]]af\_heb\Z^aqYg`\^fZafgZ[eadb]daab_`be[egagsffja^afcecd`bcaa_fdhf_c_d[cage_aV^^^`afgYX[^pmd^_Uc]ZkbpPaU``^YfdhVSjZebhb`ZW`h`^\_a_bdf`bgae^f`ac_nac``Zebcgc_^`ed^``]a`ice```cbcdcbb]bkkR\aZ_Yb^c\halfe^a]_d~eYYd_``gZ_cdcb`\a_`be`_ai`\^^ahbcca_cbcdfbfcccbcbdcbadcecdcbcdcdcdcddcccdcedebbbcdaad\9]\]WPcXYcbZ^^UbT]kRXYWU[VZKVTiRX_\^R\Xe`_R~^VSRcZfEana__d\bUh^VetT^W\WZl[`chU[c_Ra`]Zhcd`_uS\XfVWg`Rb^ea\`[eibcbcc`cdbc`eca^`lbdcedcfbbbeacbdahaeaebb`fbcdebfcccccccccccccccccccccccccccccccccccccccccccccccccccccccSe\c]bb^nhRkb_hZ^eXWUY`Z`XY_m^g[kfc\QqdYZ\YRcYek_Yf\YaXa[b_a`g^_\l[`d__Z_mabfca]bhd\kbcddebg``_]csd]Yd]c\gpcccbccecccccccdccccafecdcdeccc^ccccbccbcccecdbcccbbccc\q]ka`ZbecaV_]mc_i^~cYe__ck`d\fa_hf\][]^aQ\ifbX]aecidicccccacccc^cdcbccdc_`bc_eecddciacbcbccedcccccccdccdcffcebfb`cccdaeacbdbc`abddbbaccd`bdhbcbdbbec_ecbcdccdbccghj]`hfbf\dbZ`__c^_\_hh^Zeoaae`a[a`_sYjh]_fnc]\abad]]_^^`fd^bbdcd[hdeddccdd_^ajbaccedceccbafeadfeg^fbebcbdbbeceecdbbc`cbdcbbdddcbbgeecbcb_e^`efbcac^gdddciacbcabcce^dgb^bbege_eadg^bb_gW[bddig``^_fd]feXdbgZalibec[emb[f_g_abdbdc``fddgd^_bab_db`hddab^a`fd]g`mbdaac_caichgebca_Xfcf`]ab^_beap`b\jZ_Z_]\c^^l[a]ch_^\Ye^ta[]eo]aa`l^ihhddZUVcc[kO[RPXW\NK\nVZVcU\gqy]fRp`WY[bgcXNfZQkdOu{VJYSbw^p^_bied]\X_[[aff]_Z^dZXasdiZ`]\bjZb_o`\e]gc_\V_YWoYb^fX]eWjfb_^]]ae{g\``daYkbWh\[g_V]eTc__gbec[YceTghkbf\elcbcdbegbb`cb`_daaadd]gbqbbecb]caabgdcbbacbbcbe`adeccfacqa^a[gbedacbdb^dn``ddd]ecbbaide^ad\hb]a[fZd_cfd`ocXlcb\clWde`babZbhce\jgb^cdc^`^jhd^bbebdgf_d\h]fg_pc^bg`aaacccceedbbdedbfgccadfbdeb_]aacachd_d^babcb`ca`cbcaaa^aa`baa_bbb`baa``bf`aaaabbaaabaabdcaaa`aaa``abaa`ard\Zka`ab[X\bbd^`_`acd`dbfdbqcca`aii`m`[X`a]WZ`^eXbe[j^xf\_adge^]a`jbcbe`behfcaab_]\bm_`[^``c^a\cc^dd`cZedefcacacaccccgcccbbbbbbb_c^dccecba`aeaf``bchgcabd`ccdbafbplgeacaagfe[_cca^[``W^`[kgi`d^hae^b^``eYedchaimcbc^cd``c_hccbbdd[_aa^af`ah_[aidbcbcabee`c^bg`_e]_ee\a`bjdeaa[\ecjb`ac`dadb]]m_^\^a`^a^]h[]_sra_aV\b_ji[k`[_c`]]m^\ccccccccccccccccccccc_bbcbcddcccdccdcccccccccfcbccccccccccccccccacccccccccbecdccccbcbccccddcbccccccccdcccccccdcccccccccccccccccccccccccccccccccbcccccccccdcccccccce{`_a]^difcad__``e`fdQfjaach^]lb\[\_cXbde_aaUd_^cd`uZ`acjbbbccfccceccdbcba`bbbc`bddcecdbbgcc^bhbbdacbccdbcb__`c_ac`fd_b`gbZq`]f[`jabhg_^aaeb^_`fcbgea_dae`k\cg`efem``c]edh`bdc`adcj_adfdcda`i_bda_b^bafbbe]fhd__^kb_bd^ckbg[a`]d\b^i[W\bZeb[XY_daamafVmjbc\`[cgfXmYeh]_adckZc`iec`ab`cfcc^b`cj`f[c]g_ebbab^dcabbdcbe`^bbbaecdbde]^`acb`cghga^`gb_f_ye_ad_cX]`]eaaki_dYd_kbZdjadf\Ydbhahdogck_^dv``]]ee[^^W]]`\m__\[_d`u_d\]]`\Y[]][`_kfYc`i]`l]ca`bedacbcgdbabbbbbjdaaadabccb`acdbbecdcb`bcb`cbcdba`afob]edaad^i]h`baclU_jXaW\scf^XZii\bfZY^cf[ebgbmabecgccfjb]`fa[]aetfV\bexWk^h\`aZRaba`iecZl`][g[^_a~[VW_ObbjYbbec`eccfbheccad`b_dfecZbcccdd_hbadlbb]da`efadbabcb^dccccccccccccbcccccccccdccccccccccccccccccccccccccccccccbbi`c_b_`deaacbbd`dagge`ceca`akh`a`e^daae^acehc`cfcabcacie`d_cbj^`fbb_da_dc\_facca_^\gfdfcea`dcaabdfcfc`jhbaf`ccecbc`b`c_c^aabhdi_hba\`bfcb`acbbcb^`yeaa``baccba_fW]ZbaR^hfV[YP]X]ijVaaWofWRYJ[YXVbWSfZV[Ua^]dbd[NeO^_eea`dedbcbbdeccdcabacb^d_hcdcedbc`cdcgbdhbaccbbbdcdcdded`dcacceee_ecccdececdbeababccceebcfaadbccdacbdcbccdc`dnie`bchcX^`]r\Z_ZVe^`VlX_Qeb[kYZ^Z]e^g\h\cX_`g``_`d_jJfbbd_`]]hbc_[`[jS[o`[]jd\ba^\[elW_kXS`a_e\VhUUjUc_\bcfddbgccadbbcecaceafbfadceaa```gcad_d_cch`baahcgcbbbeccaaadbcce^cecfcccdc`_dea`cbhcc^fdaacdgcddcebcdacfdba`bccccbccccedccbcccccafcfaaccccabccccdccbcbcbbceccccbe`c_h]jPt\Y[`ajX]`mX[]_mV_kaSb`heddj\^`Xmda`eXkiQ[eYd^^cacaebbbcae^febdbeccbc`adbdccbecbgfb`fbdk_bbcedcbcbdcabid]_ja`bagbbbeabcr]`fcc\a\ba[]_bZ_cfcfa^`dc_\b_bc\ghabd^ceb`da`\```_]ad[]^b^e^_eba\bdjdif_g^egachdbfclcefeih\ic`fa\c_]eZ]X_dfa\__\k`Xi]`bt[fab^fh_e^h_embfX^]bddkgcaccbcccccaecccccecccbccecccbccccccbdcccccccccccccccbcabccaeccabb`nacib_`bZba^eefc`bhbagb`_bcecfbcacbab_bc`cccccccccccccccccccccccccccccccccccccccccccccccccccccccapb[ea^b^ac_gf\^g\^^ha^bba]`\`bfa[ba~cm^k`_e]^_iabc`d`_b[cbbbfhjd\g_`d^ca`f`\[]h__b]c\Wb]fgga_daYbd]^^bgc_UdhZe`ah\``fgga[ebbddeh`_ddbbc^`_dgi]d_hbedaj`[`dep]dccd_acb`cdbahg``b_^ahbbe_b`ebgeae\be`bafe^]dfbebgbedecded^iaibTgoZN\\[JQfaRRXl^e]LY]XVQW\YaYZ]]XgZIa^wM[[V\ph]caacdbcccccbcccccccbbccccbcgbcfcdcbbabbccccececaccccddVwciaZXb``Y\Z[[mTbV[^WX[]PfeI`Wrn^W]^Zd`jk\SfW\k^]hrd^ceccccccccccccccccccccccccccdccccccccccccccccccccccccccbdbcbccbcdddccccebdccccbccccdacccbb`ccbccccccbccccdgcbgac`bbcbjdbbbcdbecbc`babgbcba^dbedma`ibr^bbaeb[cbbaa`icZbdbaeadfbbcdo`c^c_hhgkdbl_befb_^bh\f_f\af]a`cc__ca``Xba\o_an^a^_aef^\Zf`][[`\]_ab^__^^aa\[v_N^dmdcx`bai``agb\Wal_[q\brZ\VW[a^cgq\`d|Q\fn_eX`W\q_][Sc^bg[^mYjgQYIQ=Q;8^8bO?cRLK=Q;F%4TZRd`YFN218G>Xf3R@ElUAV`aabacbcee_cbbebbddf`ac_cddejab``b`chbeacbccebc`cecbafbbbcccbccbbcccccbcafcabcbbgbccacc`bbfbcbbccbcmebbccbbaaa^bdgacbbcsbadfbbv`]m[kd`_bb_abab^_acc`adi]^cbbc\dadfdbbcdccccdaeaccccbbccacgcfdcgccbbbabddcbcdecacebceacabfujegaiip`i`lYWhgaXedh`cZWa]e_^dh[^]X`jc^bWYffv`b`jgd]cebcb_cf``j`_db^^_c^_gefd_fai`gca_b^d^ee_i_Yco_an]df]f_bid`bbbcigkcbac]b`caoc^gbcd^eabbbcbaagaf_be`da`bcdababebcbdbceddbccbdbeabbccbdbgbcbabdedh^bcbbcbdadaadfbcbacccccccccccccccccccccdccccccccccccdcccccccccccccccccccbcacebccbcbdbcbcccbccdgccccbecdcbbdbbcbbcbbdcccccdccecfd`\a_cccbebbccaabcb`obcbabg_b[gebb`bcdab_baecbkcbabkcde^cgcd_\`_ha^`crVgncci_]lUm\abg`ffi]_ld]`^d[\`a`Sd]\b``bce_ce\XkmdZYeaaiZ`fe_bcogb`Um`aa]cf\dbga[dsaY]_abfdpf\cg`b`eeigcadd`cb_hag`ecbc_c`c_^fcba`a_]caah__acf_ca_bhctdQ^aY^YeW7bc`u[eXlEkgjvji%vH:Dr)OPU_cbcccccccbeeccdcccdbdadadbccccccbcbbdccccdccccccddebbcfX___csfY[_Ychn`a]V\[U`Z`c^f[fe_b[e^chandYZUeee[dZhgVccccbccccccccccccceccccdccccccbccccdcccccccdccccccccccb_gddcdcfe`\bccbabddgdbha`fdbbaeaaac`c`eabbhaeaccdgecbcdebaccdcebca`cba_`cdchbbebaebad`c]echcencbcaed_bfe`cca_]af]k`bd_gbvhegfbc_bada_iagkb_fdwYc_aXdZ]e\`bgfb`^bjvcPhXc_frXlkgbXenm\z]dNiDheZ`g\g`bcg]R\a`c^x^ebhVT]_^_eiXO]lfZ`^i_zgbmfyLWZ\Waem\cRfm^bVRfZgbZX`]Y`_i\dX^]gcbcec`cbcdd^ddcccdcccdgclehccae]c^cf`bad`bbbcaadbcdebbe]hd_^_bbclUgZaeogemjn]afibdbe^ggf]fc[_[\cZ\l]d^^a^bdl]aceb`cccccfccccccccbdccbchccbccbecbcccc`cccccccacccccca`akV_f`gbfdce\eecmab`e`^i_h\cknf]]_saddYZ^cf[Z`_Y__dcdbkVig_d[d`Yf``k_Zba_[h`[_X\m[^kf_e\]a]`_[fkh]k_]X]eqj`^ddbbedecdbafe^`ihbb_abbbbacc[cfoebbbeeaaaic`dbbd`_accccccccccccccccccccccccccccccccccccccccccccccccccccccbocbaa`b^aXbckldeababacga_id]\`_kaadba`dbecc`ee_cccadcQWQhY]Y\LRXSWXX\Y^VZ=PRHYTQYUVKSYRHDHPUSLXSNJYY\RVbWbdbccccc^ccaccccccafcgcbc_hcec_bfdcea_bbhbcebbcbccdcbcn`c__f^`aWd`fYacdab`a`ae`eaad[gacj_cb^ddbdcbcfcd`e`cedcfXcaab`albibj[]a_`ZcqjX`eY^jbYahZZh``Yjd[_[eead]c\feacke_bacabddcbdaa`bcj`a_ebbbagdeah`cb^agbgabadbbcbc_dbh[]dgcd`_cfWY]]cadd^eidd\hmY_h`^c^cc]be_lcaap`ma^Yb]e\ccccccccccbcccccccccc`ccccccbcccccbccbcccccccbcbccccbkec`]jbbcdd]ead```a`^aebh[abafdabaabk]^ica[bbdfacdcg`nhk[g_ahfbabg`g]c`a]eaaeVghgeb\aieeag`bak]gc\`\[da_`hfg]ccdbbcccdebecccbcecccdccbcccdcddbcbcb`bcccccccbbccdcbcadaci`bb`bad`bZblb^ba`eqVja[dgj[i`d\`ibf`Vb^ebabh]bcdhjgjea``bmda]\Yebiabc[]a`eced^i^^e][fWibc`bacii`fa`bf`_eYXehc_bebfne_^_]]i]dgb\f\b^e_jm[`Zcamlp]_]_b[de\bgh[^`cb[[YYdtVfe]\ZZZV[[jt^c_]TXgZZ^e_ehl`qjebUXafWc^hcX`Udgdbbdccdaebfbdabdaceea_agd[_bc`c`cede`caabcc_bddbbgcgbbcgdc`cace`dbdbcddfcdddcgca^bccce`bcdaedcddj^bcbfbbcchZ^dbd_Vcgcii\_b^Zaaihcm`ddbgefgb_bhibdega__\]Xicm_`^_Ujgc^a\ijecgh__fd``f^\a]jbjbhbaabcg\bcdca__Z_he]d\efkaabbbfdcbcecdcbc^cabbccddccdbbe`c`baaadieddbccabccbib`cjoaa_ded^a]c]`cifaVigcfa`cdbf`ige^X]`jg`bT_]eZ^fadfc^bbede_cccdcaedccbadcbcb`cb`dgbcfbbbabbebcceccbacccbdabdcccccccccccccccccccccccdccccccccccccccccccccccccccbccco_^mg`^bab]``bl``qcZXb__hb`g^Xdeas`\Y_bbV[gY_]_aV^egfc]fgb`iW``bacZRidg`][a^c`gh[el]g^c_a`bYdd_d\ja^gZcfbe^cccccccccccccccccccccccccccccccbccbccccccccccccdcccccdededabccccccccbcdbcccdccbbccacbdcccbbcbbdcccedcdcccbcccdgae^ab_cggca^_`s_\`i\^eddbe_YZ^b`b^_]ab]kt``d\`Yd^ddccbc`bccgddcbbaccdcbcbblcccddcccdecacccbaccbacbcaabccb`a]Yad\]Zcd\_nfm^bmcbnje^YvXgnbWe]ge_fidXcku`S\dae_adfcccccccccccccccccccccdcccccccccccccccccccccccccccccccccdcbbbcc`iddecccccccdacbbdcdbcddbcbcfccbcbcccbcaccccbccdbcdcccbcacdccccccececcccddccdbcbccdcbcccccbdcbccccbcdb`dccaeebbebabdadba`~ceb_abb``babb`e`aac`bbaaaabdeedaXa]icbgbbmhbmb``[d`dcdic^`a_hb_gb_eag^ag_g``bc^ha`cc`td\_]bb\agiblfccbee^bs\n\]`c]fXbdmk\ef^[a_f_]YckdhdZYjgd```bbX`b`_adb_ajae`bb`a`b_dccebfcf`a]gbbbdfkibfcbfakd[^hyg`cnVjc\c]Z_eac`]ja]jua`d^bjfab]^gfcjbcccd`epZl`mfhdcfgj`ag^a^c_\e[bdZb_eccheac^d\degfaaccbbcXi\`d_ab]c[Sbab]iaYdgdag[r`QYcSmbba\hfbhcjSd`cagf`lavg]RbiX`[Z_dq__adccfclgaebbhbbdbeb^fee[aad`^_t_fd_fefge^d`j_abZ`_gTbbbcecccdbdbbcbccbbbebc^lbbcfcbecbcccccbcbcbdcbcebbbcc]b[deb`cbdfaecbcfcbfacgbafadbdb`dcudb^agfabacXdac`fdie`aebbbeb`c`aaaafdj_aahbdg`cfc`jahdbacabfahcc_^bccacbfeh_^db`bb_d`iabaaau]ibcdbc_aa`aZa``[e`[b^bgbj[`b`ckgcccab`ccbbclccbcbbecdafbccbcbdgbbfccbb``b`bcddcdbbcdbbbcb^`c[fdabfa_^c`ddaYec\acfiebfh`[baa]_biffbbg_`[j[^bmsjdbc`cfcbcccaccccbebccbbccfdaccbbcabccbfccbbbccedccccbacdahaigVc]Xk`]iaaYf\e[aa_jehkj^RhbgJlZPf]bi\b_j_h[XVQ[cr`]^\e`ba[`ia__a__jbaa\`c]U`eYc`]]dgnqb\dbb]fY[ca]jag_cccccccccccccccccccccccccccccccccccccccccccccccccccccchSZ]m\Zb`a]da_gif\]VdPeg[h^^c\^keZYa`[{^kbZd`^_aacdj`\_gd|[YXc]\dZfhkdc`Y`i`cV\fZUsnac^fk[heebQi_Qc]QVgemdcWe_dbl_^h\b]_^`d^gcbb[e^bg``bdfe`c`}]`jf`e^]]h[fa__ehgii]_`]b`bkbWch_d\hda[h[caaVdde[ffhcl__bfd_cg`_]`wf``_a`f_dcddbb_[da]_bdddg`c_ho[nZbjgihdbf`__Z^eWd\iX`k_]a_eagaYbgegbc]g`kabcbd\gp^_fjl^b]c^o]dad`fe[e[`iifcdb^cc[Y_`^^`dZb_Wabh_[^Y[Z]lZ[YZbflh[eceWdgr_ioapwceaWchadgX`dgfZfVtaZ^\XVc^[Qk_`e^P\ah\[^QsgxgbahYn`o]\rj^h`R[ajb\fZ\\gcbli`\ibZ]na[_gm\k_V\i]ak]_[]f[Xf[Y|^d`d__`gb_^`ckda^dab]dbfaafbabbgnjedd__e_ag^lda_abaadbbc`dccghdb^\cccccccbdcdbccbccbbcddc_abccccbccdcdcccdbccicbaccbceecQl]naYT`uN[kPYr^W]XcYgmbeJgMQKc\v^xbjjBlYwZ\mcf]Zfafecacdc]cccecaebfcbdbcbeccebbccdagbeadbcbaeb`ccdaeecehc_cZ^cbdbd]ddbgejea`fg[fehcifhedeg[_gb_cgfgeg][j_\c^e[fa`cdcdcbccccdcdcccccdccbccccccdcaccccbccccccccbccccccccdc^b]d^]ggb]dda_h^`ba_jffca^_d^aeda`odgfbafcae`d_dcf\iceiibe__bebibaa^_i`bhfd_afh_e`dbgabhYecda`_d]f]baagbZk_^dgea^ab\_ifa`cceebbh_affcdagjcf_dgb`b\g^^cgh`gbcbbbe^Yaac^d_cbc``]`_a\m`]\f_hdhc_db___aj_ef`gl^_ke]a]_bx^bafefhh]^bdd[fbeee]dbbffdefklhcfba^bbba`b_]cgkYdhgU`ef```]^b`abch`[bbhg_b`aec`d`_edca`__lceg`bja_lg`c`gibjcbbgh~k`ZaY`sYcTb^T_\XRVX^htih`Y`g\Rkac\u[dcjjXiV_Y^``P_d_[gbfgVm_^k`_]^kfh`_U_]X[deZZf^mleigc`_do`bi\c][ax]cfbt^a_HnabclbbXbbbccf\]h_ap``^d__f`gd~b]_a\b_ae_e`jba`aajf_``fhYdafczkkc[_aga]h]ejbna]^_iaWV_dc_`r`RbgjgbXeccafdb_cedccbccbbcccccbccbbbbcccccdcgced_bbccccecccbcbcchccccccccccccccccccccccccccccccccccccccccccccccccdccdccc^^eaae]be``bb]eefbagi_edfdedbacd`ccbfceecccl]^fcbc__deXlabc`w_bafjgbg^_ffc]`[mcii\]acbcb`_ccg]d]f`sf_fV^]dbicbbcbdccabcccbcbccadjbcbcecbccbbccacbccccbdcddcccbhb^ce]cgb`_e_debaa`d^cdfd]^hfbaab_aeeb_`[b]`_kkefgd`eeblbaVYbecccbia_le|h`blrjf^e`^h\YYebd_baXZbabjfg[gf]e]b\j^ueedcaccccbbcdcdcccccdbccccccbcebcc^cddccccbbbbdccacccicael_bac^f``abb`bm]lbec_nghc_aZdc_^f`_bgeb`bah]acleef_cbacaccdbcebacccccdd\abbdcccdbecbeb`hcebc`bcfccccaccjdccccccccecdccccccccccdccdcccbcbccccccccccccccccdccbcbcahdbcei^`[ekVT_bagkh_he_]ahaeadacnegchdfa^`e`gmc[fakecaabagcbcbf^bcbigcecdf_eacdbceb^ebc``ad^cbbbhaaadbfcbdaa_ib_dfcaddjadeed`cb__e`b```fccb`bdbhdchagcg_`bcdfebged]__d^^ba`p\_j^]e~\^c_bk_`[cd_^_`gdn[fh\aYc\hW^kcaeccZUbbU\]iaYObH]a[_^^IWW^jP]cK\ThaW_mvhWXlX[_`Ub[XsafYZS{Y`VYffa[_^[^_^]]]ed`^vVd]]fbnY^inc`^\afccabaZ[faVih]^abbcdcccbcbccc_bbcbcbabdbgbcdchcbcccbccbcbeeeidbcddcbcZcdcfnhjgOWdi_g_`deiWRf_hdbjbLf;^jTabd^dbeafh]bQr^YjU[cbccccccbcacdcbccccceacdccccececcdcbcccbcbccdbccceccdbecd`aedb`eccihc^a`_hbel`eadcf_aagec^^iebd]acd^e\baeff`VbZibMZj\S_dZiU^Xnegkfkg^[bRcnqXe_jacjh\aW`fX^kh[chk^`cadbbcbbcddhcccccdabcadcc`dddcbbacfbcbcabadbbcdbdfebdccccccccccccccccccccccccccccccc`cccccccfcccccccccccccccahccc\^eeab`ccYfa`baacch_bbe_baabd``b`_adcfdaaec__cg^fcl]^ac]^_ea_[a`[^aa]i^c_dZe`p^[^abedp[Yaf\d][c[`Yc_`accccccccececcccccccccacdcccdccccccccbccccccccccccccccbmcb`Yebjaaaedaab_`]ab`a_cd_bb^hckfa`bga`e_apakbfbe`^dac_f^fbba`feiea`jah^da]a`aa`bcua]a_digfba`^aa]caebh^g`ahhdeffgasbd_b^ccabcbg^bfgb[a\`e\e^dcc_caed`jhSe``Z_`_ac\ac_cccbaiaccfccdcegfffhbacad_c_cebiiccafbdaecabdcaecccccccccbcccccccccbdcccbceccdccbcccdacbdccdccdcccdcccc`kdVgcdcce`\cbbbd__jc`]\gk`baaY`bcac`paib_c^bdbed^`i`l_e\_`dX^acjUU^`mc]dVdUidWgq]WYviiY`kVmleh^S\^`jZ\Z^cdX_cedhcbbefgg`bcc_ebea\d^d`cc^bfb`b``ccgc`cgch`c_cdbbcacccccccccccccccccccccccccccccccccccccccccccccccccccccc^_affab_V]ab[Pij\bgbdcjdfbZ^ehe`emh`c`gf[Zegdag]ana`bpbg`bcbab`b_fcbcbaa`bbaa_didbfauaab_`afa_adea\feacj`ef`hchdiac`eheXWb]ba]_mdgR`\adZ_icVebbledc_]c]^fdhaa[``e_cccdccccdbaccccccdccdfcdccccccaccccbdcdccbccbcccccccdc^a_`bdbb`]edd[fcccafeaefbcfcf_iica`fbab`eedf\afafeb`e^anXd]jZ`]eW`c^g_YWe`m[[^aldVZdw^je`]cbcc\`h^gucd`hoZ_Y]ee_]e_beb_]`ahbbaaacXc^b]gd`]Y^ad]`Zqba`YbY^e\d_bad^`aaaaf_c_cdbi```b_^`eid[hcgbhe]dgegccaefhZ`^^]aedggbag__^```_```m]ga^`b_bcbc`ec___^`gg]`bhb`}__]_c^[__a_`^b`d_j]dUhZ[]\c^Wgghk\^`k^]`_`YYgojcib[aecf^dhafmh][[g^jcVkVefa][idemqs`m[c`XfjVndaX`nb`WYTkY[ZcXW]e^eV]bY_`Wbg`efa`b`cgd`acb[bii[bca__`g``ceaob]c]`ccd`b`\baabc^abaccccccccccccbcccccccbecdccccbcddcccabccccecccccdcccccccccccccccccccccccccccccdccccccdccccccccccccccccccccccccabdbbdc`cgecccccdbbbcce`bccbccddcc`acbdcbcfcdcdcdccdbbbbebccbbcacccccccbcbccecdcccbaaccfbebecdcccacbhcbcced_aebg`_ldcdadY_bcc]ddc`ebefbgcdehdfdc_^eg_aaac[d\[eaaifdXbi^\_aengabafbb_Z[Z\[bg_^ib[iagebi_cg^if`[`ar`]b_c[ad_`cc^cge^hbacdca`ae]deb_ababbdnbfbfabgjcde]bcfccbd`ccdfdaacccceddccdccbbccccbbdcbccccbcdacadcbcfbbbcceccbbhc]da`\dhhcfb``cabd_d`acehki]_fefahfe`ah_[gh\_]bgee\clcabddcccfaedccdccccccadbecccbcbbbcbbddceccccbccccddbcdeh`d`accddbedcbdabee[`d^e`debdfccecbbcd]\kdecbfecbddbacee_be^agdl\_]\an`\hf]Zb\\bbcfdeb^l`]adfce]_afcf\`j\c]^]hgl`fbjZ\gdV_hbkShh\bdXeirb`_gcfe\Z^ohk_bkUYfbZVj]\\`gdfhbibcad`fb_e_^ccdh_f`h]\e[iefgcdcbh^fdg^^Z`aa\_^aacccccccccccccccbcccccccgcbcdbcbcccbcdcbcccccccccccccad_Wcm_d[aagje]Zeea`md^chaaXaec_]d^d`fZeX`dhca_r]cad^`e]obX_]e`[of_XfXmdaTJh[]XZcjLq\TTO_YagddbjitdHaV`TuZf`hmcacebdbcgdadccdccdeca`cecbedbcbcbdabcd_bbceabedbcgebcbeigd_bbbbdgcbcbca_gc`kdcbddb_bdcae`cehbe``ccbd_abedacbfgb`aeac_e_hbaffcgb`aeeeea`b_cfe`ec_db]deeaa_ddbgbfbd`bacdacbchc`bdc`cbedcacbdbkbbecfcdfabacfd_abaebc^cc`bf^_f]ddgbabe_acbagdjdgcafdb_ecccdacbddcbccffac`aedcdgc^a_`[XV^U]jaPhRZ_kW^\[jeO`[K^XW]P`T^_YWeHXbg[W]Rdi\bi_lcebfVahW_je_Z_acf\g[d^[aabk[Vbcjkei`_b\^ddf[`r_Y]kna^hkffg`fc^macc]ecmZ_dYkggb`\\debVfXa`^ad^e`^ckc^^_hgaa]\\h`_afbd_`ab`f_dg\chkccekbbg]cegca]f`a^gc_af`cbk^acdhdb^aicbcjdabdgfed`bbb^e_eacaaba_eb_cfcdebccbaabebbebea_fbgb_^feeaebbbfb`f`aabfc_daeaabbad]bcg`bibe_bced`cejbZaSVackUXfWfbX_ga[jZ]a^\ZZeY^f}Ygo`jj^U[fYb`]d_Yee`Yi_Va[c`bad\\_babb\Y`aW_\a`dcc``cp\b\`^_j]_R^``b\d```smndZfoeSYhLe_YZuedgd^RXR\VWMk_fc_hi[\]ZciWbbfZb`Q_aai\cdZeibc_feebbhXkbafca]f^d]Xkf^ibZXb_V_od\`\bbY|Z`}`Xcbdddbbbcjc_dbccfaccbccbhb`ccfcbbbbb`ebebeaccbbcbcbbcbbdXcfddV]d_de`X\ccdc]hcdfh_bWh\e_^fc`__dafdc]e`eg`ddaf]aia]khba[ad[cc\ai^``a`a^bm_bo`Z_^[\t`cg\`ni`]^`cb_a`boddbcg`ac]agb_b^c\bYYh`g[aa^a_a[X^dcgchVdek^~k_\j`ggbc_ccebaaccfc_cdcccccibbcdbcbdcccccccbccccccccabececbcdcco/6&ޱRa41}gFobO =;hjbW]W%Hr/FQ'asmbatccscppcljcmakecblcoffeecsscsvdartdm dockerfileexerlf90gogroovyhshtmlinijavajsjsonjlktlispluamakefilemdmatlabmmmlpaspmphpps1prologpyrrbrsscalashsqlswifttextomltsvvbaxmlyaml6{"format": "graph-model", "generatedBy": "2.5.0", "convertedBy": "TensorFlow.js Converter v3.7.0", "signature": {"inputs": {"inputs": {"name": "Placeholder:0", "dtype": "DT_STRING", "tensorShape": {"dim": [{"size": "-1"}]}}}, "outputs": {"scores": {"name": "head/predictions/probabilities:0", "dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "-1"}, {"size": "54"}]}}, "classes": {"name": "head/Tile:0", "dtype": "DT_STRING", "tensorShape": {"dim": [{"size": "-1"}, {"size": "54"}]}}}}, "modelTopology": {"node": [{"name": "head/ExpandDims/input", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_STRING", "tensorShape": {"dim": [{"size": "54"}]}}}, "dtype": {"type": "DT_STRING"}}}, {"name": "head/ExpandDims/dim", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "head/strided_slice/stack", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "head/strided_slice/stack_1", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "head/strided_slice/stack_2", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "head/Tile/multiples/1", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/Reshape_1/shape", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/stack/0", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/strided_slice/stack", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/strided_slice/stack_1", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/strided_slice/stack_2", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding/embedding_weights", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "5000"}, {"size": "70"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/GatherV2_1/axis", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/GreaterEqual/y", "op": "Const", "attr": {"dtype": {"type": "DT_INT64"}, "value": {"tensor": {"dtype": "DT_INT64", "tensorShape": {}}}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/Reshape/shape", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/GatherV2_2/axis", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/to_sparse_input/ignore_value/x", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_STRING", "tensorShape": {}}}, "dtype": {"type": "DT_STRING"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/Slice/begin", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/Slice/size", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/Const", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/GatherV2/indices", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/GatherV2/axis", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/SparseFillEmptyRows/Const", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT64", "tensorShape": {}}}, "dtype": {"type": "DT_INT64"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/embedding_lookup_sparse/strided_slice/stack", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/embedding_lookup_sparse/strided_slice/stack_1", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}]}}}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/embedding_lookup_sparse/strided_slice/stack_2", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "dnn/hiddenlayer_0/kernel", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "70"}, {"size": "512"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "dnn/hiddenlayer_0/bias", "op": "Const", "attr": {"dtype": {"type": "DT_FLOAT"}, "value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "512"}]}}}}}, {"name": "dnn/hiddenlayer_1/kernel", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "512"}, {"size": "32"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "dnn/hiddenlayer_1/bias", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "32"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "dnn/logits/kernel", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "32"}, {"size": "54"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "dnn/logits/bias", "op": "Const", "attr": {"dtype": {"type": "DT_FLOAT"}, "value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "54"}]}}}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Slice_1/begin", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Slice_1/size", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Reshape_1/shape", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/stack/0", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/strided_slice/stack", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/strided_slice/stack_1", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/strided_slice/stack_2", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "linear/linear_model/content/weights", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "5000"}, {"size": "54"}]}}}, "dtype": {"type": "DT_FLOAT"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/GatherV2_1/axis", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/GreaterEqual/y", "op": "Const", "attr": {"dtype": {"type": "DT_INT64"}, "value": {"tensor": {"dtype": "DT_INT64", "tensorShape": {}}}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Reshape/shape", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/GatherV2_2/axis", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Slice/begin", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Slice/size", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Const", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/to_sparse_input/ignore_value/x", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_STRING", "tensorShape": {}}}, "dtype": {"type": "DT_STRING"}}}, {"name": "map/while/loop_counter", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}}}, {"name": "map/Const", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "map/TensorArrayV2_1/element_shape", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "map/strided_slice/stack", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "map/strided_slice/stack_1", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "map/strided_slice/stack_2", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "Placeholder", "op": "Placeholder", "attr": {"shape": {"shape": {"dim": [{"size": "-1"}]}}, "dtype": {"type": "DT_STRING"}}}, {"name": "map/TensorArrayUnstack/Const", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "map/TensorArrayV2Stack/TensorListStack/element_shape", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/strided_slice/stack", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/strided_slice/stack_1", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/strided_slice/stack_2", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/Cast/x/1", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/GatherV2/indices", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/GatherV2/axis", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/SparseFillEmptyRows/Const", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT64", "tensorShape": {}}}, "dtype": {"type": "DT_INT64"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/embedding_lookup_sparse/strided_slice/stack", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}]}}}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/embedding_lookup_sparse/strided_slice/stack_1", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}]}}}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/embedding_lookup_sparse/strided_slice/stack_2", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Slice_2/begin", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Slice_2/size", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/concat/axis", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}}}, {"name": "linear/linear_model/bias_weights", "op": "Const", "attr": {"dtype": {"type": "DT_FLOAT"}, "value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {"dim": [{"size": "54"}]}}}}}, {"name": "head/ExpandDims", "op": "ExpandDims", "input": ["head/ExpandDims/input", "head/ExpandDims/dim"], "attr": {"T": {"type": "DT_STRING"}, "Tdim": {"type": "DT_INT32"}}}, {"name": "map/Shape", "op": "Shape", "input": ["Placeholder"], "attr": {"out_type": {"type": "DT_INT32"}, "T": {"type": "DT_STRING"}}}, {"name": "map/TensorArrayUnstack/TensorListFromTensor", "op": "TensorListFromTensor", "input": ["Placeholder", "map/TensorArrayUnstack/Const"], "attr": {"shape_type": {"type": "DT_INT32"}, "element_dtype": {"type": "DT_STRING"}}}, {"name": "map/strided_slice", "op": "StridedSlice", "input": ["map/Shape", "map/strided_slice/stack", "map/strided_slice/stack_1", "map/strided_slice/stack_2"], "attr": {"begin_mask": {"i": "0"}, "shrink_axis_mask": {"i": "1"}, "new_axis_mask": {"i": "0"}, "end_mask": {"i": "0"}, "Index": {"type": "DT_INT32"}, "T": {"type": "DT_INT32"}, "ellipsis_mask": {"i": "0"}}}, {"name": "map/TensorArrayV2_1", "op": "TensorListReserve", "input": ["map/TensorArrayV2_1/element_shape", "map/strided_slice"], "attr": {"shape_type": {"type": "DT_INT32"}, "element_dtype": {"type": "DT_STRING"}}}, {"name": "map/while", "op": "StatelessWhile", "input": ["map/while/loop_counter", "map/strided_slice", "map/Const", "map/TensorArrayV2_1", "map/strided_slice", "map/TensorArrayUnstack/TensorListFromTensor"], "attr": {"_read_only_resource_inputs": {"list": {}}, "parallel_iterations": {"i": "10"}, "_lower_using_switch_merge": {"b": true}, "cond": {"func": {"name": "map_while_cond_49114"}}, "output_shapes": {"list": {"shape": [{}, {}, {}, {}, {}, {}]}}, "body": {"func": {"name": "map_while_body_49115"}}, "T": {"list": {"type": ["DT_INT32", "DT_INT32", "DT_INT32", "DT_VARIANT", "DT_INT32", "DT_VARIANT"]}}, "_num_original_outputs": {"i": "6"}}}, {"name": "map/TensorArrayV2Stack/TensorListStack", "op": "TensorListStack", "input": ["map/while:3", "map/TensorArrayV2Stack/TensorListStack/element_shape"], "attr": {"num_elements": {"i": "-1"}, "element_dtype": {"type": "DT_STRING"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/to_sparse_input/NotEqual", "op": "NotEqual", "input": ["map/TensorArrayV2Stack/TensorListStack", "dnn/input_from_feature_columns/input_layer/content_embedding_1/to_sparse_input/ignore_value/x"], "attr": {"incompatible_shape_error": {"b": true}, "T": {"type": "DT_STRING"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/to_sparse_input/dense_shape", "op": "Shape", "input": ["map/TensorArrayV2Stack/TensorListStack"], "attr": {"out_type": {"type": "DT_INT64"}, "T": {"type": "DT_STRING"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/to_sparse_input/NotEqual", "op": "NotEqual", "input": ["map/TensorArrayV2Stack/TensorListStack", "linear/linear_model/linear/linear_model/linear/linear_model/content/to_sparse_input/ignore_value/x"], "attr": {"incompatible_shape_error": {"b": true}, "T": {"type": "DT_STRING"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/to_sparse_input/dense_shape", "op": "Shape", "input": ["map/TensorArrayV2Stack/TensorListStack"], "attr": {"out_type": {"type": "DT_INT64"}, "T": {"type": "DT_STRING"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/to_sparse_input/indices", "op": "Where", "input": ["dnn/input_from_feature_columns/input_layer/content_embedding_1/to_sparse_input/NotEqual"], "attr": {"T": {"type": "DT_BOOL"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/Slice", "op": "Slice", "input": ["dnn/input_from_feature_columns/input_layer/content_embedding_1/to_sparse_input/dense_shape", "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/Slice/begin", "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/Slice/size"], "attr": {"Index": {"type": "DT_INT32"}, "T": {"type": "DT_INT64"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/GatherV2", "op": "GatherV2", "input": ["dnn/input_from_feature_columns/input_layer/content_embedding_1/to_sparse_input/dense_shape", "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/GatherV2/indices", "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/GatherV2/axis"], "attr": {"batch_dims": {"i": "0"}, "Tindices": {"type": "DT_INT32"}, "Taxis": {"type": "DT_INT32"}, "Tparams": {"type": "DT_INT64"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/to_sparse_input/indices", "op": "Where", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/to_sparse_input/NotEqual"], "attr": {"T": {"type": "DT_BOOL"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/Shape/Cast", "op": "Cast", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/to_sparse_input/dense_shape"], "attr": {"Truncate": {"b": false}, "SrcT": {"type": "DT_INT64"}, "DstT": {"type": "DT_INT32"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/to_sparse_input/values", "op": "GatherNd", "input": ["map/TensorArrayV2Stack/TensorListStack", "dnn/input_from_feature_columns/input_layer/content_embedding_1/to_sparse_input/indices"], "attr": {"Tparams": {"type": "DT_STRING"}, "Tindices": {"type": "DT_INT64"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/Prod", "op": "Prod", "input": ["dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/Slice", "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/Const"], "attr": {"T": {"type": "DT_INT64"}, "Tidx": {"type": "DT_INT32"}, "keep_dims": {"b": false}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/to_sparse_input/values", "op": "GatherNd", "input": ["map/TensorArrayV2Stack/TensorListStack", "linear/linear_model/linear/linear_model/linear/linear_model/content/to_sparse_input/indices"], "attr": {"Tparams": {"type": "DT_STRING"}, "Tindices": {"type": "DT_INT64"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/strided_slice", "op": "StridedSlice", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/Shape/Cast", "linear/linear_model/linear/linear_model/linear/linear_model/content/strided_slice/stack", "linear/linear_model/linear/linear_model/linear/linear_model/content/strided_slice/stack_1", "linear/linear_model/linear/linear_model/linear/linear_model/content/strided_slice/stack_2"], "attr": {"Index": {"type": "DT_INT32"}, "ellipsis_mask": {"i": "0"}, "end_mask": {"i": "0"}, "new_axis_mask": {"i": "0"}, "shrink_axis_mask": {"i": "1"}, "begin_mask": {"i": "0"}, "T": {"type": "DT_INT32"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/lookup", "op": "StringToHashBucketFast", "input": ["dnn/input_from_feature_columns/input_layer/content_embedding_1/to_sparse_input/values"], "attr": {"num_buckets": {"i": "5000"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/Cast/x", "op": "Pack", "input": ["dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/Prod", "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/GatherV2"], "attr": {"T": {"type": "DT_INT64"}, "N": {"i": "2"}, "axis": {"i": "0"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/lookup", "op": "StringToHashBucketFast", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/to_sparse_input/values"], "attr": {"num_buckets": {"i": "5000"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/Cast/x", "op": "Pack", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/strided_slice", "linear/linear_model/linear/linear_model/linear/linear_model/content/Cast/x/1"], "attr": {"axis": {"i": "0"}, "N": {"i": "2"}, "T": {"type": "DT_INT32"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/GreaterEqual", "op": "GreaterEqual", "input": ["dnn/input_from_feature_columns/input_layer/content_embedding_1/lookup", "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/GreaterEqual/y"], "attr": {"T": {"type": "DT_INT64"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/SparseReshape", "op": "SparseReshape", "input": ["dnn/input_from_feature_columns/input_layer/content_embedding_1/to_sparse_input/indices", "dnn/input_from_feature_columns/input_layer/content_embedding_1/to_sparse_input/dense_shape", "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/Cast/x"]}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/GreaterEqual", "op": "GreaterEqual", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/lookup", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/GreaterEqual/y"], "attr": {"T": {"type": "DT_INT64"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/Cast", "op": "Cast", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/Cast/x"], "attr": {"SrcT": {"type": "DT_INT32"}, "Truncate": {"b": false}, "DstT": {"type": "DT_INT64"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/Where", "op": "Where", "input": ["dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/GreaterEqual"], "attr": {"T": {"type": "DT_BOOL"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Where", "op": "Where", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/GreaterEqual"], "attr": {"T": {"type": "DT_BOOL"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/SparseReshape", "op": "SparseReshape", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/to_sparse_input/indices", "linear/linear_model/linear/linear_model/linear/linear_model/content/to_sparse_input/dense_shape", "linear/linear_model/linear/linear_model/linear/linear_model/content/Cast"]}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/Reshape", "op": "Reshape", "input": ["dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/Where", "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/Reshape/shape"], "attr": {"Tshape": {"type": "DT_INT32"}, "T": {"type": "DT_INT64"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Reshape", "op": "Reshape", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Where", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Reshape/shape"], "attr": {"T": {"type": "DT_INT64"}, "Tshape": {"type": "DT_INT32"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Cast_1", "op": "Cast", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/SparseReshape:1"], "attr": {"DstT": {"type": "DT_INT32"}, "SrcT": {"type": "DT_INT64"}, "Truncate": {"b": false}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Slice", "op": "Slice", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/SparseReshape:1", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Slice/begin", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Slice/size"], "attr": {"T": {"type": "DT_INT64"}, "Index": {"type": "DT_INT32"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/GatherV2", "op": "GatherV2", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/SparseReshape:1", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/GatherV2/indices", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/GatherV2/axis"], "attr": {"Tparams": {"type": "DT_INT64"}, "Tindices": {"type": "DT_INT32"}, "Taxis": {"type": "DT_INT32"}, "batch_dims": {"i": "0"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/GatherV2_1", "op": "GatherV2", "input": ["dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/SparseReshape", "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/Reshape", "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/GatherV2_1/axis"], "attr": {"Tindices": {"type": "DT_INT64"}, "Taxis": {"type": "DT_INT32"}, "Tparams": {"type": "DT_INT64"}, "batch_dims": {"i": "0"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/GatherV2_2", "op": "GatherV2", "input": ["dnn/input_from_feature_columns/input_layer/content_embedding_1/lookup", "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/Reshape", "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/GatherV2_2/axis"], "attr": {"batch_dims": {"i": "0"}, "Taxis": {"type": "DT_INT32"}, "Tparams": {"type": "DT_INT64"}, "Tindices": {"type": "DT_INT64"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/GatherV2_2", "op": "GatherV2", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/lookup", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Reshape", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/GatherV2_2/axis"], "attr": {"Tindices": {"type": "DT_INT64"}, "batch_dims": {"i": "0"}, "Taxis": {"type": "DT_INT32"}, "Tparams": {"type": "DT_INT64"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Slice_1", "op": "Slice", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Cast_1", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Slice_1/begin", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Slice_1/size"], "attr": {"Index": {"type": "DT_INT32"}, "T": {"type": "DT_INT32"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Prod", "op": "Prod", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Slice", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Const"], "attr": {"T": {"type": "DT_INT64"}, "Tidx": {"type": "DT_INT32"}, "keep_dims": {"b": false}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/SparseFillEmptyRows/SparseFillEmptyRows", "op": "SparseFillEmptyRows", "input": ["dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/GatherV2_1", "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/GatherV2_2", "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/SparseReshape:1", "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/SparseFillEmptyRows/Const"], "attr": {"T": {"type": "DT_INT64"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Cast/x", "op": "Pack", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Prod", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/GatherV2"], "attr": {"T": {"type": "DT_INT64"}, "axis": {"i": "0"}, "N": {"i": "2"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/embedding_lookup_sparse/strided_slice", "op": "StridedSlice", "input": ["dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/SparseFillEmptyRows/SparseFillEmptyRows", "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/embedding_lookup_sparse/strided_slice/stack", "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/embedding_lookup_sparse/strided_slice/stack_1", "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/embedding_lookup_sparse/strided_slice/stack_2"], "attr": {"ellipsis_mask": {"i": "0"}, "Index": {"type": "DT_INT32"}, "begin_mask": {"i": "1"}, "end_mask": {"i": "1"}, "new_axis_mask": {"i": "0"}, "T": {"type": "DT_INT64"}, "shrink_axis_mask": {"i": "2"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/Reshape_1", "op": "Reshape", "input": ["dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/SparseFillEmptyRows/SparseFillEmptyRows:2", "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/Reshape_1/shape"], "attr": {"T": {"type": "DT_BOOL"}, "Tshape": {"type": "DT_INT32"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/SparseReshape", "op": "SparseReshape", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/SparseReshape", "linear/linear_model/linear/linear_model/linear/linear_model/content/SparseReshape:1", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Cast/x"]}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/embedding_lookup_sparse", "op": "SparseSegmentMean", "input": ["dnn/input_from_feature_columns/input_layer/content_embedding/embedding_weights", "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/SparseFillEmptyRows/SparseFillEmptyRows:1", "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/embedding_lookup_sparse/strided_slice"], "attr": {"Tidx": {"type": "DT_INT64"}, "T": {"type": "DT_FLOAT"}, "Tsegmentids": {"type": "DT_INT64"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/GatherV2_1", "op": "GatherV2", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/SparseReshape", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Reshape", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/GatherV2_1/axis"], "attr": {"Tparams": {"type": "DT_INT64"}, "Tindices": {"type": "DT_INT64"}, "batch_dims": {"i": "0"}, "Taxis": {"type": "DT_INT32"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/Shape", "op": "Shape", "input": ["dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/embedding_lookup_sparse"], "attr": {"T": {"type": "DT_FLOAT"}, "out_type": {"type": "DT_INT32"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/zeros_like", "op": "ZerosLike", "input": ["dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/embedding_lookup_sparse"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/SparseFillEmptyRows/SparseFillEmptyRows", "op": "SparseFillEmptyRows", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/GatherV2_1", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/GatherV2_2", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/SparseReshape:1", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/SparseFillEmptyRows/Const"], "attr": {"T": {"type": "DT_INT64"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/strided_slice", "op": "StridedSlice", "input": ["dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/Shape", "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/strided_slice/stack", "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/strided_slice/stack_1", "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/strided_slice/stack_2"], "attr": {"end_mask": {"i": "0"}, "shrink_axis_mask": {"i": "1"}, "ellipsis_mask": {"i": "0"}, "Index": {"type": "DT_INT32"}, "T": {"type": "DT_INT32"}, "new_axis_mask": {"i": "0"}, "begin_mask": {"i": "0"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Reshape_1", "op": "Reshape", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/SparseFillEmptyRows/SparseFillEmptyRows:2", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Reshape_1/shape"], "attr": {"T": {"type": "DT_BOOL"}, "Tshape": {"type": "DT_INT32"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/embedding_lookup_sparse/strided_slice", "op": "StridedSlice", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/SparseFillEmptyRows/SparseFillEmptyRows", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/embedding_lookup_sparse/strided_slice/stack", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/embedding_lookup_sparse/strided_slice/stack_1", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/embedding_lookup_sparse/strided_slice/stack_2"], "attr": {"shrink_axis_mask": {"i": "2"}, "Index": {"type": "DT_INT32"}, "T": {"type": "DT_INT64"}, "end_mask": {"i": "1"}, "ellipsis_mask": {"i": "0"}, "begin_mask": {"i": "1"}, "new_axis_mask": {"i": "0"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/stack", "op": "Pack", "input": ["dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/stack/0", "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/strided_slice"], "attr": {"N": {"i": "2"}, "axis": {"i": "0"}, "T": {"type": "DT_INT32"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/embedding_lookup_sparse", "op": "SparseSegmentSum", "input": ["linear/linear_model/content/weights", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/SparseFillEmptyRows/SparseFillEmptyRows:1", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/embedding_lookup_sparse/strided_slice"], "attr": {"T": {"type": "DT_FLOAT"}, "Tsegmentids": {"type": "DT_INT64"}, "Tidx": {"type": "DT_INT64"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/Tile", "op": "Tile", "input": ["dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/Reshape_1", "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/stack"], "attr": {"T": {"type": "DT_BOOL"}, "Tmultiples": {"type": "DT_INT32"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Shape", "op": "Shape", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/embedding_lookup_sparse"], "attr": {"out_type": {"type": "DT_INT32"}, "T": {"type": "DT_FLOAT"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/zeros_like", "op": "ZerosLike", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/embedding_lookup_sparse"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights", "op": "Select", "input": ["dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/Tile", "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/zeros_like", "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/embedding_lookup_sparse"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/strided_slice", "op": "StridedSlice", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Shape", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/strided_slice/stack", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/strided_slice/stack_1", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/strided_slice/stack_2"], "attr": {"ellipsis_mask": {"i": "0"}, "begin_mask": {"i": "0"}, "new_axis_mask": {"i": "0"}, "end_mask": {"i": "0"}, "shrink_axis_mask": {"i": "1"}, "T": {"type": "DT_INT32"}, "Index": {"type": "DT_INT32"}}}, {"name": "dnn/hiddenlayer_0/Relu", "op": "_FusedMatMul", "input": ["dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights", "dnn/hiddenlayer_0/kernel", "dnn/hiddenlayer_0/bias"], "device": "/device:CPU:0", "attr": {"num_args": {"i": "1"}, "fused_ops": {"list": {"s": ["Qmlhc0FkZA==", "UmVsdQ=="]}}, "T": {"type": "DT_FLOAT"}, "transpose_b": {"b": false}, "transpose_a": {"b": false}, "epsilon": {"f": 0.0}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/stack", "op": "Pack", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/stack/0", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/strided_slice"], "attr": {"axis": {"i": "0"}, "T": {"type": "DT_INT32"}, "N": {"i": "2"}}}, {"name": "dnn/hiddenlayer_1/Relu", "op": "_FusedMatMul", "input": ["dnn/hiddenlayer_0/Relu", "dnn/hiddenlayer_1/kernel", "dnn/hiddenlayer_1/bias"], "device": "/device:CPU:0", "attr": {"fused_ops": {"list": {"s": ["Qmlhc0FkZA==", "UmVsdQ=="]}}, "num_args": {"i": "1"}, "epsilon": {"f": 0.0}, "transpose_a": {"b": false}, "T": {"type": "DT_FLOAT"}, "transpose_b": {"b": false}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Tile", "op": "Tile", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Reshape_1", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/stack"], "attr": {"Tmultiples": {"type": "DT_INT32"}, "T": {"type": "DT_BOOL"}}}, {"name": "dnn/logits/BiasAdd", "op": "_FusedMatMul", "input": ["dnn/hiddenlayer_1/Relu", "dnn/logits/kernel", "dnn/logits/bias"], "device": "/device:CPU:0", "attr": {"num_args": {"i": "1"}, "transpose_b": {"b": false}, "fused_ops": {"list": {"s": ["Qmlhc0FkZA=="]}}, "epsilon": {"f": 0.0}, "transpose_a": {"b": false}, "T": {"type": "DT_FLOAT"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum", "op": "Select", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Tile", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/zeros_like", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/embedding_lookup_sparse"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Shape_1", "op": "Shape", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum"], "attr": {"out_type": {"type": "DT_INT32"}, "T": {"type": "DT_FLOAT"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Slice_2", "op": "Slice", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Shape_1", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Slice_2/begin", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Slice_2/size"], "attr": {"Index": {"type": "DT_INT32"}, "T": {"type": "DT_INT32"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/concat", "op": "ConcatV2", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Slice_1", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Slice_2", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/concat/axis"], "attr": {"N": {"i": "2"}, "T": {"type": "DT_INT32"}, "Tidx": {"type": "DT_INT32"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Reshape_2", "op": "Reshape", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum", "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/concat"], "attr": {"Tshape": {"type": "DT_INT32"}, "T": {"type": "DT_FLOAT"}}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/weighted_sum", "op": "BiasAdd", "input": ["linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Reshape_2", "linear/linear_model/bias_weights"], "attr": {"T": {"type": "DT_FLOAT"}, "data_format": {"s": "TkhXQw=="}}}, {"name": "add", "op": "AddV2", "input": ["dnn/logits/BiasAdd", "linear/linear_model/linear/linear_model/linear/linear_model/weighted_sum"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "head/predictions/probabilities", "op": "Softmax", "input": ["add"], "attr": {"T": {"type": "DT_FLOAT"}}}, {"name": "head/Shape", "op": "Shape", "input": ["head/predictions/probabilities"], "attr": {"T": {"type": "DT_FLOAT"}, "out_type": {"type": "DT_INT32"}}}, {"name": "head/strided_slice", "op": "StridedSlice", "input": ["head/Shape", "head/strided_slice/stack", "head/strided_slice/stack_1", "head/strided_slice/stack_2"], "attr": {"ellipsis_mask": {"i": "0"}, "begin_mask": {"i": "0"}, "end_mask": {"i": "0"}, "T": {"type": "DT_INT32"}, "shrink_axis_mask": {"i": "1"}, "new_axis_mask": {"i": "0"}, "Index": {"type": "DT_INT32"}}}, {"name": "head/Tile/multiples", "op": "Pack", "input": ["head/strided_slice", "head/Tile/multiples/1"], "attr": {"T": {"type": "DT_INT32"}, "N": {"i": "2"}, "axis": {"i": "0"}}}, {"name": "head/Tile", "op": "Tile", "input": ["head/ExpandDims", "head/Tile/multiples"], "attr": {"Tmultiples": {"type": "DT_INT32"}, "T": {"type": "DT_STRING"}}}], "library": {"function": [{"signature": {"name": "map_while_body_49115", "inputArg": [{"name": "map_while_loop_counter", "type": "DT_INT32"}, {"name": "map_strided_slice_0", "type": "DT_INT32"}, {"name": "placeholder", "type": "DT_INT32"}, {"name": "placeholder_1", "type": "DT_VARIANT"}, {"name": "map_strided_slice_1_0", "type": "DT_INT32"}, {"name": "tensorarrayv2read_tensorlistgetitem_map_tensorarrayunstack_tensorlistfromtensor_0", "type": "DT_VARIANT"}], "outputArg": [{"name": "add_1", "type": "DT_INT32"}, {"name": "map_strided_slice", "type": "DT_INT32"}, {"name": "add", "type": "DT_INT32"}, {"name": "tensorarrayv2write_tensorlistsetitem", "type": "DT_VARIANT"}, {"name": "map_strided_slice_1", "type": "DT_INT32"}, {"name": "tensorarrayv2read_tensorlistgetitem_map_tensorarrayunstack_tensorlistfromtensor", "type": "DT_VARIANT"}]}, "nodeDef": [{"name": "map_while_body_49115/add_1/y", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}}}, {"name": "map_while_body_49115/add/y", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}, "_output_shapes": {"list": {"shape": [{}]}}}}, {"name": "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice/stack", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice/stack_1", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice/stack_2", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}}, {"name": "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_2/stack", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "dtype": {"type": "DT_INT32"}}}, {"name": "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_2/stack_1", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "dtype": {"type": "DT_INT32"}}}, {"name": "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_2/stack_2", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}}, {"name": "map_while_body_49115/StringNGrams/RaggedFromRowStarts/RowPartitionFromRowStarts/row_starts", "op": "Const", "attr": {"dtype": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "value": {"tensor": {"dtype": "DT_INT64", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice/stack", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice/stack_1", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}}, {"name": "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice/stack_2", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}}, {"name": "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_2/stack", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "dtype": {"type": "DT_INT32"}}}, {"name": "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_2/stack_1", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_2/stack_2", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}}, {"name": "map_while_body_49115/StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/concat/values_0", "op": "Const", "attr": {"dtype": {"type": "DT_INT64"}, "value": {"tensor": {"dtype": "DT_INT64", "tensorShape": {"dim": [{"size": "1"}]}}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}}, {"name": "map_while_body_49115/StringsByteSplit/StringsByteSplit/strided_slice_1/stack", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "map_while_body_49115/StringsByteSplit/StringsByteSplit/strided_slice_1/stack_1", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}}, {"name": "map_while_body_49115/StringsByteSplit/StringsByteSplit/strided_slice_1/stack_2", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "dtype": {"type": "DT_INT32"}}}, {"name": "map_while_body_49115/StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Const", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "map_while_body_49115/StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Greater/y", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}, "dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{}]}}}}, {"name": "map_while_body_49115/TensorArrayV2Read/Const", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{}]}]}}, "dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{}]}}}}}, {"name": "map_while_body_49115/StringsByteSplit/StringsByteSplit/StringSplit/delimiter", "op": "Const", "attr": {"dtype": {"type": "DT_STRING"}, "value": {"tensor": {"dtype": "DT_STRING", "tensorShape": {}}}, "_output_shapes": {"list": {"shape": [{}]}}}}, {"name": "map_while_body_49115/StringsByteSplit/StringsByteSplit/strided_slice/stack", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}]}}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "2"}]}]}}}}, {"name": "map_while_body_49115/StringsByteSplit/StringsByteSplit/strided_slice/stack_1", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "2"}]}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "map_while_body_49115/StringsByteSplit/StringsByteSplit/strided_slice/stack_2", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "2"}]}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}]}}}}}, {"name": "map_while_body_49115/StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Const_1", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}}, {"name": "map_while_body_49115/StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/add/y", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}, "dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{}]}}}}, {"name": "map_while_body_49115/StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Const_2", "op": "Const", "attr": {"dtype": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{"dim": [{}]}]}}, "value": {"tensor": {"dtype": "DT_INT64", "tensorShape": {"dim": [{}]}}}}}, {"name": "map_while_body_49115/StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/Cumsum/axis", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}, "_output_shapes": {"list": {"shape": [{}]}}}}, {"name": "map_while_body_49115/StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/concat/axis", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}, "dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{}]}}}}, {"name": "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_1/stack", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_1/stack_1", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_1/stack_2", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_3/stack", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}}, {"name": "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_3/stack_1", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_3/stack_2", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_4/Cast", "op": "Const", "attr": {"dtype": {"type": "DT_INT64"}, "value": {"tensor": {"dtype": "DT_INT64", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_5/Const", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{}]}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{}]}}}}}, {"name": "map_while_body_49115/StringNGrams/RaggedFromRowStarts/strided_slice/stack", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}}, {"name": "map_while_body_49115/StringNGrams/RaggedFromRowStarts/strided_slice/stack_1", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "map_while_body_49115/StringNGrams/RaggedFromRowStarts/strided_slice/stack_2", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}}, {"name": "map_while_body_49115/StringNGrams/RaggedFromRowStarts/RowPartitionFromRowStarts/concat/axis", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}, "dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{}]}}}}, {"name": "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_1/stack", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_1/stack_1", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_1/stack_2", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_3/stack", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_3/stack_1", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_3/stack_2", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}}, {"name": "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_4/Cast", "op": "Const", "attr": {"dtype": {"type": "DT_INT64"}, "value": {"tensor": {"dtype": "DT_INT64", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_5/Const", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{}]}]}}, "dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{}]}}}}}, {"name": "map_while_body_49115/Const", "op": "Const", "attr": {"dtype": {"type": "DT_STRING"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "10000"}]}]}}, "value": {"tensor": {"dtype": "DT_STRING", "tensorShape": {"dim": [{"size": "10000"}]}}}}}, {"name": "map_while_body_49115/concat/axis", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}}}, {"name": "map_while_body_49115/strided_slice/stack", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "map_while_body_49115/strided_slice/stack_1", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}, "dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}}, {"name": "map_while_body_49115/strided_slice/stack_2", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}}}}}, {"name": "add_1_0", "op": "AddV2", "input": ["map_while_loop_counter", "map_while_body_49115/add_1/y:output:0"], "attr": {"T": {"type": "DT_INT32"}}}, {"name": "add_0", "op": "AddV2", "input": ["placeholder", "map_while_body_49115/add/y:output:0"], "attr": {"T": {"type": "DT_INT32"}}}, {"name": "TensorArrayV2Read/TensorListGetItem", "op": "TensorListGetItem", "input": ["tensorarrayv2read_tensorlistgetitem_map_tensorarrayunstack_tensorlistfromtensor_0", "placeholder", "map_while_body_49115/TensorArrayV2Read/Const:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "element_dtype": {"type": "DT_STRING"}}}, {"name": "map_while_body_49115/ConstantFolding/StringsByteSplit/stack_const_axis", "op": "Const", "input": ["^TensorArrayV2Read/TensorListGetItem"], "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}}}, {"name": "StringsByteSplit/stack", "op": "ExpandDims", "input": ["TensorArrayV2Read/TensorListGetItem:item:0", "map_while_body_49115/ConstantFolding/StringsByteSplit/stack_const_axis:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "Tdim": {"type": "DT_INT32"}, "T": {"type": "DT_STRING"}}}, {"name": "StringsByteSplit/StringsByteSplit/StringSplit", "op": "StringSplit", "input": ["StringsByteSplit/stack:output:0", "map_while_body_49115/StringsByteSplit/StringsByteSplit/StringSplit/delimiter:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "2"}]}, {"dim": [{"size": "-1"}]}, {"dim": [{"size": "2"}]}]}}, "skip_empty": {"b": false}}}, {"name": "StringsByteSplit/StringsByteSplit/strided_slice_1", "op": "StridedSlice", "input": ["StringsByteSplit/StringsByteSplit/StringSplit:shape:0", "map_while_body_49115/StringsByteSplit/StringsByteSplit/strided_slice_1/stack:output:0", "map_while_body_49115/StringsByteSplit/StringsByteSplit/strided_slice_1/stack_1:output:0", "map_while_body_49115/StringsByteSplit/StringsByteSplit/strided_slice_1/stack_2:output:0"], "attr": {"begin_mask": {"i": "0"}, "end_mask": {"i": "0"}, "Index": {"type": "DT_INT32"}, "new_axis_mask": {"i": "0"}, "ellipsis_mask": {"i": "0"}, "shrink_axis_mask": {"i": "1"}, "T": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{}]}}}}, {"name": "StringsByteSplit/StringsByteSplit/strided_slice", "op": "StridedSlice", "input": ["StringsByteSplit/StringsByteSplit/StringSplit:indices:0", "map_while_body_49115/StringsByteSplit/StringsByteSplit/strided_slice/stack:output:0", "map_while_body_49115/StringsByteSplit/StringsByteSplit/strided_slice/stack_1:output:0", "map_while_body_49115/StringsByteSplit/StringsByteSplit/strided_slice/stack_2:output:0"], "attr": {"begin_mask": {"i": "1"}, "shrink_axis_mask": {"i": "2"}, "Index": {"type": "DT_INT32"}, "T": {"type": "DT_INT64"}, "new_axis_mask": {"i": "0"}, "end_mask": {"i": "1"}, "ellipsis_mask": {"i": "0"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}]}]}}}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/Cast_1", "op": "Cast", "input": ["StringsByteSplit/StringsByteSplit/strided_slice_1:output:0"], "attr": {"Truncate": {"b": false}, "SrcT": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{}]}}, "DstT": {"type": "DT_INT32"}}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/Cast", "op": "Cast", "input": ["StringsByteSplit/StringsByteSplit/strided_slice:output:0"], "attr": {"Truncate": {"b": false}, "DstT": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}]}]}}, "SrcT": {"type": "DT_INT64"}}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Shape", "op": "Shape", "input": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/Cast:y:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "T": {"type": "DT_INT32"}, "out_type": {"type": "DT_INT32"}}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Max", "op": "Max", "input": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/Cast:y:0", "map_while_body_49115/StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Const_1:output:0"], "attr": {"Tidx": {"type": "DT_INT32"}, "keep_dims": {"b": false}, "T": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{}]}}}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Prod", "op": "Prod", "input": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Shape:output:0", "map_while_body_49115/StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Const:output:0"], "attr": {"T": {"type": "DT_INT32"}, "Tidx": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{}]}}, "keep_dims": {"b": false}}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/add", "op": "AddV2", "input": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Max:output:0", "map_while_body_49115/StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/add/y:output:0"], "attr": {"T": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{}]}}}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Greater", "op": "Greater", "input": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Prod:output:0", "map_while_body_49115/StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Greater/y:output:0"], "attr": {"T": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{}]}}}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Cast", "op": "Cast", "input": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Greater:z:0"], "attr": {"SrcT": {"type": "DT_BOOL"}, "DstT": {"type": "DT_INT32"}, "Truncate": {"b": false}, "_output_shapes": {"list": {"shape": [{}]}}}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/mul", "op": "Mul", "input": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Cast:y:0", "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/add:z:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "T": {"type": "DT_INT32"}}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Maximum", "op": "Maximum", "input": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/Cast_1:y:0", "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/mul:z:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "T": {"type": "DT_INT32"}}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Minimum", "op": "Minimum", "input": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/Cast_1:y:0", "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Maximum:z:0"], "attr": {"T": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{}]}}}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Bincount", "op": "Bincount", "input": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/Cast:y:0", "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Minimum:z:0", "map_while_body_49115/StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Const_2:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}]}]}}, "T": {"type": "DT_INT64"}}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/Cumsum", "op": "Cumsum", "input": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Bincount:bins:0", "map_while_body_49115/StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/Cumsum/axis:output:0"], "attr": {"reverse": {"b": false}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}]}]}}, "exclusive": {"b": false}, "Tidx": {"type": "DT_INT32"}, "T": {"type": "DT_INT64"}}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/concat", "op": "ConcatV2", "input": ["map_while_body_49115/StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/concat/values_0:output:0", "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/Cumsum:out:0", "map_while_body_49115/StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/concat/axis:output:0"], "attr": {"N": {"i": "2"}, "Tidx": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}]}]}}, "T": {"type": "DT_INT64"}}}, {"name": "StringsByteSplit/RaggedGetItem/strided_slice", "op": "StridedSlice", "input": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/concat:output:0", "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice/stack:output:0", "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice/stack_1:output:0", "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice/stack_2:output:0"], "attr": {"shrink_axis_mask": {"i": "0"}, "new_axis_mask": {"i": "0"}, "begin_mask": {"i": "1"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}]}]}}, "ellipsis_mask": {"i": "0"}, "end_mask": {"i": "0"}, "Index": {"type": "DT_INT32"}, "T": {"type": "DT_INT64"}}}, {"name": "StringsByteSplit/RaggedGetItem/strided_slice_1", "op": "StridedSlice", "input": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/concat:output:0", "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_1/stack:output:0", "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_1/stack_1:output:0", "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_1/stack_2:output:0"], "attr": {"new_axis_mask": {"i": "0"}, "Index": {"type": "DT_INT32"}, "end_mask": {"i": "1"}, "shrink_axis_mask": {"i": "0"}, "ellipsis_mask": {"i": "0"}, "begin_mask": {"i": "0"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}]}]}}, "T": {"type": "DT_INT64"}}}, {"name": "StringsByteSplit/RaggedGetItem/strided_slice_2", "op": "StridedSlice", "input": ["StringsByteSplit/RaggedGetItem/strided_slice:output:0", "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_2/stack:output:0", "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_2/stack_1:output:0", "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_2/stack_2:output:0"], "attr": {"shrink_axis_mask": {"i": "1"}, "T": {"type": "DT_INT64"}, "new_axis_mask": {"i": "0"}, "begin_mask": {"i": "0"}, "_output_shapes": {"list": {"shape": [{}]}}, "end_mask": {"i": "0"}, "ellipsis_mask": {"i": "0"}, "Index": {"type": "DT_INT32"}}}, {"name": "StringsByteSplit/RaggedGetItem/strided_slice_3", "op": "StridedSlice", "input": ["StringsByteSplit/RaggedGetItem/strided_slice_1:output:0", "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_3/stack:output:0", "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_3/stack_1:output:0", "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_3/stack_2:output:0"], "attr": {"new_axis_mask": {"i": "0"}, "end_mask": {"i": "0"}, "begin_mask": {"i": "0"}, "shrink_axis_mask": {"i": "1"}, "Index": {"type": "DT_INT32"}, "T": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{}]}}, "ellipsis_mask": {"i": "0"}}}, {"name": "map_while_body_49115/ConstantFolding/StringsByteSplit/RaggedGetItem/strided_slice_4/stack_const_axis", "op": "Const", "input": ["^StringsByteSplit/RaggedGetItem/strided_slice_2"], "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "map_while_body_49115/ConstantFolding/StringsByteSplit/RaggedGetItem/strided_slice_4/stack_1_const_axis", "op": "Const", "input": ["^StringsByteSplit/RaggedGetItem/strided_slice_3"], "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "StringsByteSplit/RaggedGetItem/strided_slice_4/stack", "op": "ExpandDims", "input": ["StringsByteSplit/RaggedGetItem/strided_slice_2:output:0", "map_while_body_49115/ConstantFolding/StringsByteSplit/RaggedGetItem/strided_slice_4/stack_const_axis:output:0"], "attr": {"T": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "Tdim": {"type": "DT_INT32"}}}, {"name": "StringsByteSplit/RaggedGetItem/strided_slice_4/stack_1", "op": "ExpandDims", "input": ["StringsByteSplit/RaggedGetItem/strided_slice_3:output:0", "map_while_body_49115/ConstantFolding/StringsByteSplit/RaggedGetItem/strided_slice_4/stack_1_const_axis:output:0"], "attr": {"Tdim": {"type": "DT_INT32"}, "T": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}}, {"name": "StringsByteSplit/RaggedGetItem/strided_slice_4", "op": "StridedSlice", "input": ["StringsByteSplit/StringsByteSplit/StringSplit:values:0", "StringsByteSplit/RaggedGetItem/strided_slice_4/stack:output:0", "StringsByteSplit/RaggedGetItem/strided_slice_4/stack_1:output:0", "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_4/Cast:output:0"], "attr": {"begin_mask": {"i": "0"}, "shrink_axis_mask": {"i": "0"}, "ellipsis_mask": {"i": "0"}, "new_axis_mask": {"i": "0"}, "Index": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}]}]}}, "T": {"type": "DT_STRING"}, "end_mask": {"i": "0"}}}, {"name": "StringsByteSplit/RaggedGetItem/strided_slice_5", "op": "StridedSlice", "input": ["StringsByteSplit/RaggedGetItem/strided_slice_4:output:0", "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_5/Const:output:0", "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_5/Const:output:0", "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_5/Const:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}]}]}}, "end_mask": {"i": "0"}, "T": {"type": "DT_STRING"}, "shrink_axis_mask": {"i": "0"}, "ellipsis_mask": {"i": "0"}, "Index": {"type": "DT_INT32"}, "new_axis_mask": {"i": "0"}, "begin_mask": {"i": "0"}}}, {"name": "StringNGrams/RaggedFromRowStarts/Shape", "op": "Shape", "input": ["StringsByteSplit/RaggedGetItem/strided_slice_5:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "T": {"type": "DT_STRING"}, "out_type": {"type": "DT_INT32"}}}, {"name": "StringNGrams/RaggedFromRowStarts/strided_slice", "op": "StridedSlice", "input": ["StringNGrams/RaggedFromRowStarts/Shape:output:0", "map_while_body_49115/StringNGrams/RaggedFromRowStarts/strided_slice/stack:output:0", "map_while_body_49115/StringNGrams/RaggedFromRowStarts/strided_slice/stack_1:output:0", "map_while_body_49115/StringNGrams/RaggedFromRowStarts/strided_slice/stack_2:output:0"], "attr": {"shrink_axis_mask": {"i": "1"}, "T": {"type": "DT_INT32"}, "end_mask": {"i": "0"}, "_output_shapes": {"list": {"shape": [{}]}}, "begin_mask": {"i": "0"}, "Index": {"type": "DT_INT32"}, "new_axis_mask": {"i": "0"}, "ellipsis_mask": {"i": "0"}}}, {"name": "StringNGrams/RaggedFromRowStarts/RowPartitionFromRowStarts/Cast", "op": "Cast", "input": ["StringNGrams/RaggedFromRowStarts/strided_slice:output:0"], "attr": {"DstT": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{}]}}, "SrcT": {"type": "DT_INT32"}, "Truncate": {"b": false}}}, {"name": "map_while_body_49115/ConstantFolding/StringNGrams/RaggedFromRowStarts/RowPartitionFromRowStarts/concat/values_1_const_axis", "op": "Const", "input": ["^StringNGrams/RaggedFromRowStarts/RowPartitionFromRowStarts/Cast"], "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "StringNGrams/RaggedFromRowStarts/RowPartitionFromRowStarts/concat/values_1", "op": "ExpandDims", "input": ["StringNGrams/RaggedFromRowStarts/RowPartitionFromRowStarts/Cast:y:0", "map_while_body_49115/ConstantFolding/StringNGrams/RaggedFromRowStarts/RowPartitionFromRowStarts/concat/values_1_const_axis:output:0"], "attr": {"T": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "Tdim": {"type": "DT_INT32"}}}, {"name": "StringNGrams/RaggedFromRowStarts/RowPartitionFromRowStarts/concat", "op": "ConcatV2", "input": ["map_while_body_49115/StringNGrams/RaggedFromRowStarts/RowPartitionFromRowStarts/row_starts:output:0", "StringNGrams/RaggedFromRowStarts/RowPartitionFromRowStarts/concat/values_1:output:0", "map_while_body_49115/StringNGrams/RaggedFromRowStarts/RowPartitionFromRowStarts/concat/axis:output:0"], "attr": {"T": {"type": "DT_INT64"}, "N": {"i": "2"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "2"}]}]}}, "Tidx": {"type": "DT_INT32"}}}, {"name": "StringNGrams/StringNGrams/StringNGrams", "op": "StringNGrams", "input": ["StringsByteSplit/RaggedGetItem/strided_slice_5:output:0", "StringNGrams/RaggedFromRowStarts/RowPartitionFromRowStarts/concat:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}]}, {"dim": [{"size": "2"}]}]}}, "right_pad": {"s": ""}, "ngram_widths": {"list": {"i": ["2"]}}, "left_pad": {"s": ""}, "separator": {"s": "IA=="}, "preserve_short_sequences": {"b": false}, "Tsplits": {"type": "DT_INT64"}, "pad_width": {"i": "0"}}}, {"name": "StringNGrams/RaggedGetItem/strided_slice", "op": "StridedSlice", "input": ["StringNGrams/StringNGrams/StringNGrams:ngrams_splits:0", "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice/stack:output:0", "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice/stack_1:output:0", "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice/stack_2:output:0"], "attr": {"begin_mask": {"i": "1"}, "ellipsis_mask": {"i": "0"}, "end_mask": {"i": "0"}, "shrink_axis_mask": {"i": "0"}, "Index": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "new_axis_mask": {"i": "0"}, "T": {"type": "DT_INT64"}}}, {"name": "StringNGrams/RaggedGetItem/strided_slice_1", "op": "StridedSlice", "input": ["StringNGrams/StringNGrams/StringNGrams:ngrams_splits:0", "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_1/stack:output:0", "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_1/stack_1:output:0", "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_1/stack_2:output:0"], "attr": {"ellipsis_mask": {"i": "0"}, "end_mask": {"i": "1"}, "begin_mask": {"i": "0"}, "shrink_axis_mask": {"i": "0"}, "new_axis_mask": {"i": "0"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "T": {"type": "DT_INT64"}, "Index": {"type": "DT_INT32"}}}, {"name": "StringNGrams/RaggedGetItem/strided_slice_2", "op": "StridedSlice", "input": ["StringNGrams/RaggedGetItem/strided_slice:output:0", "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_2/stack:output:0", "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_2/stack_1:output:0", "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_2/stack_2:output:0"], "attr": {"T": {"type": "DT_INT64"}, "end_mask": {"i": "0"}, "begin_mask": {"i": "0"}, "Index": {"type": "DT_INT32"}, "new_axis_mask": {"i": "0"}, "_output_shapes": {"list": {"shape": [{}]}}, "shrink_axis_mask": {"i": "1"}, "ellipsis_mask": {"i": "0"}}}, {"name": "StringNGrams/RaggedGetItem/strided_slice_3", "op": "StridedSlice", "input": ["StringNGrams/RaggedGetItem/strided_slice_1:output:0", "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_3/stack:output:0", "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_3/stack_1:output:0", "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_3/stack_2:output:0"], "attr": {"end_mask": {"i": "0"}, "shrink_axis_mask": {"i": "1"}, "begin_mask": {"i": "0"}, "new_axis_mask": {"i": "0"}, "T": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{}]}}, "ellipsis_mask": {"i": "0"}, "Index": {"type": "DT_INT32"}}}, {"name": "map_while_body_49115/ConstantFolding/StringNGrams/RaggedGetItem/strided_slice_4/stack_const_axis", "op": "Const", "input": ["^StringNGrams/RaggedGetItem/strided_slice_2"], "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "map_while_body_49115/ConstantFolding/StringNGrams/RaggedGetItem/strided_slice_4/stack_1_const_axis", "op": "Const", "input": ["^StringNGrams/RaggedGetItem/strided_slice_3"], "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}}}, {"name": "StringNGrams/RaggedGetItem/strided_slice_4/stack", "op": "ExpandDims", "input": ["StringNGrams/RaggedGetItem/strided_slice_2:output:0", "map_while_body_49115/ConstantFolding/StringNGrams/RaggedGetItem/strided_slice_4/stack_const_axis:output:0"], "attr": {"Tdim": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "T": {"type": "DT_INT64"}}}, {"name": "StringNGrams/RaggedGetItem/strided_slice_4/stack_1", "op": "ExpandDims", "input": ["StringNGrams/RaggedGetItem/strided_slice_3:output:0", "map_while_body_49115/ConstantFolding/StringNGrams/RaggedGetItem/strided_slice_4/stack_1_const_axis:output:0"], "attr": {"Tdim": {"type": "DT_INT32"}, "T": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}}, {"name": "StringNGrams/RaggedGetItem/strided_slice_4", "op": "StridedSlice", "input": ["StringNGrams/StringNGrams/StringNGrams:ngrams:0", "StringNGrams/RaggedGetItem/strided_slice_4/stack:output:0", "StringNGrams/RaggedGetItem/strided_slice_4/stack_1:output:0", "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_4/Cast:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}]}]}}, "Index": {"type": "DT_INT64"}, "begin_mask": {"i": "0"}, "T": {"type": "DT_STRING"}, "shrink_axis_mask": {"i": "0"}, "end_mask": {"i": "0"}, "ellipsis_mask": {"i": "0"}, "new_axis_mask": {"i": "0"}}}, {"name": "StringNGrams/RaggedGetItem/strided_slice_5", "op": "StridedSlice", "input": ["StringNGrams/RaggedGetItem/strided_slice_4:output:0", "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_5/Const:output:0", "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_5/Const:output:0", "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_5/Const:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}]}]}}, "Index": {"type": "DT_INT32"}, "shrink_axis_mask": {"i": "0"}, "end_mask": {"i": "0"}, "new_axis_mask": {"i": "0"}, "begin_mask": {"i": "0"}, "T": {"type": "DT_STRING"}, "ellipsis_mask": {"i": "0"}}}, {"name": "concat", "op": "ConcatV2", "input": ["StringNGrams/RaggedGetItem/strided_slice_5:output:0", "map_while_body_49115/Const:output:0", "map_while_body_49115/concat/axis:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}]}]}}, "N": {"i": "2"}, "T": {"type": "DT_STRING"}, "Tidx": {"type": "DT_INT32"}}}, {"name": "strided_slice", "op": "StridedSlice", "input": ["concat:output:0", "map_while_body_49115/strided_slice/stack:output:0", "map_while_body_49115/strided_slice/stack_1:output:0", "map_while_body_49115/strided_slice/stack_2:output:0"], "attr": {"Index": {"type": "DT_INT32"}, "shrink_axis_mask": {"i": "0"}, "begin_mask": {"i": "1"}, "end_mask": {"i": "0"}, "T": {"type": "DT_STRING"}, "new_axis_mask": {"i": "0"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}]}]}}, "ellipsis_mask": {"i": "0"}}}, {"name": "TensorArrayV2Write/TensorListSetItem", "op": "TensorListSetItem", "input": ["placeholder_1", "placeholder", "strided_slice:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "element_dtype": {"type": "DT_STRING"}}}], "ret": {"add": "add_0:z:0", "tensorarrayv2read_tensorlistgetitem_map_tensorarrayunstack_tensorlistfromtensor": "tensorarrayv2read_tensorlistgetitem_map_tensorarrayunstack_tensorlistfromtensor_0", "map_strided_slice": "map_strided_slice_0", "map_strided_slice_1": "map_strided_slice_1_0", "tensorarrayv2write_tensorlistsetitem": "TensorArrayV2Write/TensorListSetItem:output_handle:0", "add_1": "add_1_0:z:0"}, "attr": {"_input_shapes": {"list": {"shape": [{}, {}, {}, {}, {}, {}]}}}, "argAttr": {"0": {"attr": {"_output_shapes": {"list": {"shape": [{}]}}}}, "5": {"attr": {"_output_shapes": {"list": {"shape": [{}]}}}}, "3": {"attr": {"_output_shapes": {"list": {"shape": [{}]}}}}, "1": {"attr": {"_output_shapes": {"list": {"shape": [{}]}}}}, "4": {"attr": {"_output_shapes": {"list": {"shape": [{}]}}}}, "2": {"attr": {"_output_shapes": {"list": {"shape": [{}]}}}}}}, {"signature": {"name": "map_while_cond_49114", "inputArg": [{"name": "map_while_loop_counter", "type": "DT_INT32"}, {"name": "map_strided_slice", "type": "DT_INT32"}, {"name": "placeholder", "type": "DT_INT32"}, {"name": "placeholder_1", "type": "DT_VARIANT"}, {"name": "less_map_strided_slice", "type": "DT_INT32"}, {"name": "map_while_cond_49114___redundant_placeholder0", "type": "DT_VARIANT"}], "outputArg": [{"name": "logicaland", "type": "DT_BOOL"}]}, "nodeDef": [{"name": "Less_1", "op": "Less", "input": ["map_while_loop_counter", "map_strided_slice"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "T": {"type": "DT_INT32"}}}, {"name": "Less", "op": "Less", "input": ["placeholder", "less_map_strided_slice"], "attr": {"T": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{}]}}}}, {"name": "LogicalAnd", "op": "LogicalAnd", "input": ["Less_1:z:0", "Less:z:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}}}], "ret": {"logicaland": "LogicalAnd:z:0"}, "attr": {"_input_shapes": {"list": {"shape": [{}, {}, {}, {}, {}, {"unknownRank": true}]}}}, "argAttr": {"4": {"attr": {"_output_shapes": {"list": {"shape": [{}]}}}}, "2": {"attr": {"_output_shapes": {"list": {"shape": [{}]}}}}, "5": {"attr": {"_output_shapes": {"list": {"shape": [{"unknownRank": true}]}}}}, "0": {"attr": {"_output_shapes": {"list": {"shape": [{}]}}}}, "3": {"attr": {"_output_shapes": {"list": {"shape": [{}]}}}}, "1": {"attr": {"_output_shapes": {"list": {"shape": [{}]}}}}}}]}, "versions": {"minConsumer": 12}}, "modelInitializer": {"node": [{"name": "head/predictions/class_string_lookup/Const", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_STRING", "tensorShape": {"dim": [{"size": "54"}]}}}, "dtype": {"type": "DT_STRING"}}}, {"name": "head/predictions/class_string_lookup/Size", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "head/predictions/class_string_lookup/range/start", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}, "dtype": {"type": "DT_INT32"}}}, {"name": "head/predictions/class_string_lookup/range/delta", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}}}}}, {"name": "head/predictions/class_string_lookup/range", "op": "Range", "input": ["head/predictions/class_string_lookup/range/start", "head/predictions/class_string_lookup/Size", "head/predictions/class_string_lookup/range/delta"], "attr": {"Tidx": {"type": "DT_INT32"}}}, {"name": "head/predictions/class_string_lookup/Cast", "op": "Cast", "input": ["head/predictions/class_string_lookup/range"], "attr": {"Truncate": {"b": false}, "SrcT": {"type": "DT_INT32"}, "DstT": {"type": "DT_INT64"}}}, {"name": "head/predictions/class_string_lookup/hash_table", "op": "HashTableV2", "attr": {"value_dtype": {"type": "DT_STRING"}, "container": {"s": ""}, "shared_name": {"s": "aGFzaF90YWJsZV80MTQ1NGNlMC0xMmMwLTRiMmEtOTI0My1hZjUxZjE4YWJmOTQ="}, "key_dtype": {"type": "DT_INT64"}, "use_node_name_sharing": {"b": false}}}, {"name": "head/predictions/class_string_lookup/table_init/LookupTableImportV2", "op": "LookupTableImportV2", "input": ["head/predictions/class_string_lookup/hash_table", "head/predictions/class_string_lookup/Cast", "head/predictions/class_string_lookup/Const"], "attr": {"Tout": {"type": "DT_STRING"}, "Tin": {"type": "DT_INT64"}}}], "library": {"function": [{"signature": {"name": "dnn_zero_fraction_1_cond_false_49441", "inputArg": [{"name": "count_nonzero_notequal_dnn_hiddenlayer_1_relu", "type": "DT_FLOAT"}], "outputArg": [{"name": "count_nonzero_nonzero_count", "type": "DT_INT64"}, {"name": "optionalfromvalue", "type": "DT_VARIANT"}, {"name": "optionalfromvalue_1", "type": "DT_VARIANT"}, {"name": "optionalfromvalue_2", "type": "DT_VARIANT"}, {"name": "optionalfromvalue_3", "type": "DT_VARIANT"}, {"name": "optionalnone", "type": "DT_VARIANT"}]}, "nodeDef": [{"name": "count_nonzero/zeros", "op": "Const", "attr": {"dtype": {"type": "DT_FLOAT"}, "_output_shapes": {"list": {"shape": [{}]}}, "value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {}, "floatVal": [0.0]}}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/zeros"]}}, {"name": "count_nonzero/NotEqual", "op": "NotEqual", "input": ["count_nonzero_notequal_dnn_hiddenlayer_1_relu", "count_nonzero/zeros:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "32"}]}]}}, "T": {"type": "DT_FLOAT"}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/NotEqual"]}}, {"name": "count_nonzero/Cast", "op": "Cast", "input": ["count_nonzero/NotEqual:z:0"], "attr": {"SrcT": {"type": "DT_BOOL"}, "DstT": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "32"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/Cast"]}}, {"name": "count_nonzero/Const", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}]}, "tensorContent": "AAAAAAEAAAA="}}, "dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "2"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/Const"]}}, {"name": "count_nonzero/nonzero_count", "op": "Sum", "input": ["count_nonzero/Cast:y:0", "count_nonzero/Const:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "T": {"type": "DT_INT64"}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/nonzero_count"]}}, {"name": "OptionalFromValue", "op": "OptionalFromValue", "input": ["count_nonzero/zeros:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "Toutput_types": {"list": {"type": ["DT_FLOAT"]}}}, "experimentalDebugInfo": {"originalNodeNames": ["OptionalFromValue"]}}, {"name": "OptionalFromValue_1", "op": "OptionalFromValue", "input": ["count_nonzero/NotEqual:z:0"], "attr": {"Toutput_types": {"list": {"type": ["DT_BOOL"]}}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["OptionalFromValue_1"]}}, {"name": "OptionalFromValue_2", "op": "OptionalFromValue", "input": ["count_nonzero/Cast:y:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "Toutput_types": {"list": {"type": ["DT_INT64"]}}}, "experimentalDebugInfo": {"originalNodeNames": ["OptionalFromValue_2"]}}, {"name": "OptionalFromValue_3", "op": "OptionalFromValue", "input": ["count_nonzero/Const:output:0"], "attr": {"Toutput_types": {"list": {"type": ["DT_INT32"]}}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["OptionalFromValue_3"]}}, {"name": "OptionalNone", "op": "OptionalNone", "attr": {"_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["OptionalNone"]}}], "ret": {"count_nonzero_nonzero_count": "count_nonzero/nonzero_count:output:0", "optionalfromvalue": "OptionalFromValue:optional:0", "optionalfromvalue_3": "OptionalFromValue_3:optional:0", "optionalfromvalue_2": "OptionalFromValue_2:optional:0", "optionalfromvalue_1": "OptionalFromValue_1:optional:0", "optionalnone": "OptionalNone:optional:0"}, "attr": {"_input_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "32"}]}]}}}, "argAttr": {"0": {"attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "32"}]}]}}}}}}, {"signature": {"name": "map_while_cond_49114", "inputArg": [{"name": "map_while_loop_counter", "type": "DT_INT32"}, {"name": "map_strided_slice", "type": "DT_INT32"}, {"name": "placeholder", "type": "DT_INT32"}, {"name": "placeholder_1", "type": "DT_VARIANT"}, {"name": "less_map_strided_slice", "type": "DT_INT32"}, {"name": "map_while_cond_49114___redundant_placeholder0", "type": "DT_VARIANT"}], "outputArg": [{"name": "logicaland", "type": "DT_BOOL"}]}, "nodeDef": [{"name": "Less", "op": "Less", "input": ["placeholder", "less_map_strided_slice"], "attr": {"T": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["Less"]}}, {"name": "Less_1", "op": "Less", "input": ["map_while_loop_counter", "map_strided_slice"], "attr": {"T": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["Less_1"]}}, {"name": "LogicalAnd", "op": "LogicalAnd", "input": ["Less_1:z:0", "Less:z:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["LogicalAnd"]}}], "ret": {"logicaland": "LogicalAnd:z:0"}, "attr": {"_input_shapes": {"list": {"shape": [{}, {}, {}, {}, {}, {"unknownRank": true}]}}}, "argAttr": {"1": {"attr": {"_output_shapes": {"list": {"shape": [{}]}}}}, "3": {"attr": {"_output_shapes": {"list": {"shape": [{}]}}}}, "0": {"attr": {"_output_shapes": {"list": {"shape": [{}]}}}}, "5": {"attr": {"_output_shapes": {"list": {"shape": [{"unknownRank": true}]}}}}, "2": {"attr": {"_output_shapes": {"list": {"shape": [{}]}}}}, "4": {"attr": {"_output_shapes": {"list": {"shape": [{}]}}}}}}, {"signature": {"name": "zero_fraction_total_zero_zero_count_false_49655", "inputArg": [{"name": "zero_fraction_readvariableop_linear_linear_model_content_weights", "type": "DT_RESOURCE", "handleData": [{"dtype": "DT_FLOAT", "shape": {"dim": [{"size": "5000"}, {"size": "54"}]}}]}, {"name": "cast_zero_fraction_total_size_size", "type": "DT_INT64"}], "outputArg": [{"name": "mul", "type": "DT_FLOAT"}], "isStateful": true}, "nodeDef": [{"name": "zero_fraction/ReadVariableOp", "op": "ReadVariableOp", "input": ["zero_fraction_readvariableop_linear_linear_model_content_weights"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "5000"}, {"size": "54"}]}]}}, "dtype": {"type": "DT_FLOAT"}}, "experimentalDebugInfo": {"originalNodeNames": ["zero_fraction/ReadVariableOp"]}}, {"name": "zero_fraction/Size", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "value": {"tensor": {"dtype": "DT_INT64", "tensorShape": {}, "int64Val": ["270000"]}}, "dtype": {"type": "DT_INT64"}}, "experimentalDebugInfo": {"originalNodeNames": ["zero_fraction/Size"]}}, {"name": "zero_fraction/LessEqual/y", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT64", "tensorShape": {}, "int64Val": ["2147483647"]}}, "_output_shapes": {"list": {"shape": [{}]}}, "dtype": {"type": "DT_INT64"}}, "experimentalDebugInfo": {"originalNodeNames": ["zero_fraction/LessEqual/y"]}}, {"name": "zero_fraction/LessEqual", "op": "LessEqual", "input": ["zero_fraction/Size:output:0", "zero_fraction/LessEqual/y:output:0"], "attr": {"T": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["zero_fraction/LessEqual"]}}, {"name": "zero_fraction/cond", "op": "StatelessIf", "input": ["zero_fraction/LessEqual:z:0", "zero_fraction/ReadVariableOp:value:0"], "attr": {"else_branch": {"func": {"name": "zero_fraction_cond_false_49665"}}, "then_branch": {"func": {"name": "zero_fraction_cond_true_49664"}}, "Tin": {"list": {"type": ["DT_FLOAT"]}}, "_read_only_resource_inputs": {"list": {}}, "Tcond": {"type": "DT_BOOL"}, "_lower_using_switch_merge": {"b": true}, "output_shapes": {"list": {"shape": [{}]}}, "Tout": {"list": {"type": ["DT_INT64"]}}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["zero_fraction/cond"]}}, {"name": "zero_fraction/cond/Identity", "op": "Identity", "input": ["zero_fraction/cond:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "T": {"type": "DT_INT64"}}, "experimentalDebugInfo": {"originalNodeNames": ["zero_fraction/cond/Identity"]}}, {"name": "zero_fraction/counts_to_fraction/sub", "op": "Sub", "input": ["zero_fraction/Size:output:0", "zero_fraction/cond/Identity:output:0"], "attr": {"T": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["zero_fraction/counts_to_fraction/sub"]}}, {"name": "zero_fraction/counts_to_fraction/Cast", "op": "Cast", "input": ["zero_fraction/counts_to_fraction/sub:z:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "DstT": {"type": "DT_FLOAT"}, "SrcT": {"type": "DT_INT64"}}, "experimentalDebugInfo": {"originalNodeNames": ["zero_fraction/counts_to_fraction/Cast"]}}, {"name": "zero_fraction/counts_to_fraction/Cast_1", "op": "Cast", "input": ["zero_fraction/Size:output:0"], "attr": {"DstT": {"type": "DT_FLOAT"}, "_output_shapes": {"list": {"shape": [{}]}}, "SrcT": {"type": "DT_INT64"}}, "experimentalDebugInfo": {"originalNodeNames": ["zero_fraction/counts_to_fraction/Cast_1"]}}, {"name": "zero_fraction/counts_to_fraction/truediv", "op": "RealDiv", "input": ["zero_fraction/counts_to_fraction/Cast:y:0", "zero_fraction/counts_to_fraction/Cast_1:y:0"], "attr": {"T": {"type": "DT_FLOAT"}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["zero_fraction/counts_to_fraction/truediv"]}}, {"name": "zero_fraction/fraction", "op": "Identity", "input": ["zero_fraction/counts_to_fraction/truediv:z:0"], "attr": {"T": {"type": "DT_FLOAT"}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["zero_fraction/fraction"]}}, {"name": "Cast", "op": "Cast", "input": ["cast_zero_fraction_total_size_size"], "attr": {"DstT": {"type": "DT_FLOAT"}, "SrcT": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["Cast"]}}, {"name": "mul_0", "op": "Mul", "input": ["zero_fraction/fraction:output:0", "Cast:y:0"], "attr": {"T": {"type": "DT_FLOAT"}}, "experimentalDebugInfo": {"originalNodeNames": ["mul"]}}], "ret": {"mul": "mul_0:z:0"}, "attr": {"_input_shapes": {"list": {"shape": [{"unknownRank": true}, {}]}}}, "argAttr": {"1": {"attr": {"_output_shapes": {"list": {"shape": [{}]}}}}}}, {"signature": {"name": "dnn_zero_fraction_2_cond_false_49510", "inputArg": [{"name": "count_nonzero_notequal_dnn_logits_biasadd", "type": "DT_FLOAT"}], "outputArg": [{"name": "count_nonzero_nonzero_count", "type": "DT_INT64"}, {"name": "optionalfromvalue", "type": "DT_VARIANT"}, {"name": "optionalfromvalue_1", "type": "DT_VARIANT"}, {"name": "optionalfromvalue_2", "type": "DT_VARIANT"}, {"name": "optionalfromvalue_3", "type": "DT_VARIANT"}, {"name": "optionalnone", "type": "DT_VARIANT"}]}, "nodeDef": [{"name": "count_nonzero/zeros", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {}, "floatVal": [0.0]}}, "dtype": {"type": "DT_FLOAT"}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/zeros"]}}, {"name": "count_nonzero/NotEqual", "op": "NotEqual", "input": ["count_nonzero_notequal_dnn_logits_biasadd", "count_nonzero/zeros:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "54"}]}]}}, "T": {"type": "DT_FLOAT"}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/NotEqual"]}}, {"name": "count_nonzero/Cast", "op": "Cast", "input": ["count_nonzero/NotEqual:z:0"], "attr": {"SrcT": {"type": "DT_BOOL"}, "DstT": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "54"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/Cast"]}}, {"name": "count_nonzero/Const", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}]}, "tensorContent": "AAAAAAEAAAA="}}, "dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "2"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/Const"]}}, {"name": "count_nonzero/nonzero_count", "op": "Sum", "input": ["count_nonzero/Cast:y:0", "count_nonzero/Const:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "T": {"type": "DT_INT64"}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/nonzero_count"]}}, {"name": "OptionalFromValue", "op": "OptionalFromValue", "input": ["count_nonzero/zeros:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "Toutput_types": {"list": {"type": ["DT_FLOAT"]}}}, "experimentalDebugInfo": {"originalNodeNames": ["OptionalFromValue"]}}, {"name": "OptionalFromValue_1", "op": "OptionalFromValue", "input": ["count_nonzero/NotEqual:z:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "Toutput_types": {"list": {"type": ["DT_BOOL"]}}}, "experimentalDebugInfo": {"originalNodeNames": ["OptionalFromValue_1"]}}, {"name": "OptionalFromValue_2", "op": "OptionalFromValue", "input": ["count_nonzero/Cast:y:0"], "attr": {"Toutput_types": {"list": {"type": ["DT_INT64"]}}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["OptionalFromValue_2"]}}, {"name": "OptionalFromValue_3", "op": "OptionalFromValue", "input": ["count_nonzero/Const:output:0"], "attr": {"Toutput_types": {"list": {"type": ["DT_INT32"]}}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["OptionalFromValue_3"]}}, {"name": "OptionalNone", "op": "OptionalNone", "attr": {"_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["OptionalNone"]}}], "ret": {"optionalfromvalue_1": "OptionalFromValue_1:optional:0", "optionalfromvalue_3": "OptionalFromValue_3:optional:0", "count_nonzero_nonzero_count": "count_nonzero/nonzero_count:output:0", "optionalfromvalue_2": "OptionalFromValue_2:optional:0", "optionalnone": "OptionalNone:optional:0", "optionalfromvalue": "OptionalFromValue:optional:0"}, "attr": {"_input_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "54"}]}]}}}, "argAttr": {"0": {"attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "54"}]}]}}}}}}, {"signature": {"name": "dnn_zero_fraction_2_cond_true_49509", "inputArg": [{"name": "count_nonzero_notequal_dnn_logits_biasadd", "type": "DT_FLOAT"}], "outputArg": [{"name": "cast", "type": "DT_INT64"}, {"name": "optionalfromvalue", "type": "DT_VARIANT"}, {"name": "optionalfromvalue_1", "type": "DT_VARIANT"}, {"name": "optionalfromvalue_2", "type": "DT_VARIANT"}, {"name": "optionalfromvalue_3", "type": "DT_VARIANT"}, {"name": "optionalfromvalue_4", "type": "DT_VARIANT"}]}, "nodeDef": [{"name": "count_nonzero/zeros", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {}, "floatVal": [0.0]}}, "dtype": {"type": "DT_FLOAT"}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/zeros"]}}, {"name": "count_nonzero/NotEqual", "op": "NotEqual", "input": ["count_nonzero_notequal_dnn_logits_biasadd", "count_nonzero/zeros:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "54"}]}]}}, "T": {"type": "DT_FLOAT"}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/NotEqual"]}}, {"name": "count_nonzero/Cast", "op": "Cast", "input": ["count_nonzero/NotEqual:z:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "54"}]}]}}, "SrcT": {"type": "DT_BOOL"}, "DstT": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/Cast"]}}, {"name": "count_nonzero/Const", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}]}, "tensorContent": "AAAAAAEAAAA="}}, "dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "2"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/Const"]}}, {"name": "count_nonzero/nonzero_count", "op": "Sum", "input": ["count_nonzero/Cast:y:0", "count_nonzero/Const:output:0"], "attr": {"T": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/nonzero_count"]}}, {"name": "Cast", "op": "Cast", "input": ["count_nonzero/nonzero_count:output:0"], "attr": {"DstT": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{}]}}, "SrcT": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["Cast"]}}, {"name": "OptionalFromValue", "op": "OptionalFromValue", "input": ["count_nonzero/zeros:output:0"], "attr": {"Toutput_types": {"list": {"type": ["DT_FLOAT"]}}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["OptionalFromValue"]}}, {"name": "OptionalFromValue_1", "op": "OptionalFromValue", "input": ["count_nonzero/NotEqual:z:0"], "attr": {"Toutput_types": {"list": {"type": ["DT_BOOL"]}}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["OptionalFromValue_1"]}}, {"name": "OptionalFromValue_2", "op": "OptionalFromValue", "input": ["count_nonzero/Cast:y:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "Toutput_types": {"list": {"type": ["DT_INT32"]}}}, "experimentalDebugInfo": {"originalNodeNames": ["OptionalFromValue_2"]}}, {"name": "OptionalFromValue_3", "op": "OptionalFromValue", "input": ["count_nonzero/Const:output:0"], "attr": {"Toutput_types": {"list": {"type": ["DT_INT32"]}}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["OptionalFromValue_3"]}}, {"name": "OptionalFromValue_4", "op": "OptionalFromValue", "input": ["count_nonzero/nonzero_count:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "Toutput_types": {"list": {"type": ["DT_INT32"]}}}, "experimentalDebugInfo": {"originalNodeNames": ["OptionalFromValue_4"]}}], "ret": {"cast": "Cast:y:0", "optionalfromvalue_2": "OptionalFromValue_2:optional:0", "optionalfromvalue": "OptionalFromValue:optional:0", "optionalfromvalue_3": "OptionalFromValue_3:optional:0", "optionalfromvalue_4": "OptionalFromValue_4:optional:0", "optionalfromvalue_1": "OptionalFromValue_1:optional:0"}, "attr": {"_input_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "54"}]}]}}}, "argAttr": {"0": {"attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "54"}]}]}}}}}}, {"signature": {"name": "dnn_zero_fraction_cond_false_49371", "inputArg": [{"name": "count_nonzero_notequal_dnn_hiddenlayer_0_relu", "type": "DT_FLOAT"}], "outputArg": [{"name": "count_nonzero_nonzero_count", "type": "DT_INT64"}, {"name": "optionalfromvalue", "type": "DT_VARIANT"}, {"name": "optionalfromvalue_1", "type": "DT_VARIANT"}, {"name": "optionalfromvalue_2", "type": "DT_VARIANT"}, {"name": "optionalfromvalue_3", "type": "DT_VARIANT"}, {"name": "optionalnone", "type": "DT_VARIANT"}]}, "nodeDef": [{"name": "count_nonzero/zeros", "op": "Const", "attr": {"dtype": {"type": "DT_FLOAT"}, "value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {}, "floatVal": [0.0]}}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/zeros"]}}, {"name": "count_nonzero/NotEqual", "op": "NotEqual", "input": ["count_nonzero_notequal_dnn_hiddenlayer_0_relu", "count_nonzero/zeros:output:0"], "attr": {"T": {"type": "DT_FLOAT"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "512"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/NotEqual"]}}, {"name": "count_nonzero/Cast", "op": "Cast", "input": ["count_nonzero/NotEqual:z:0"], "attr": {"SrcT": {"type": "DT_BOOL"}, "DstT": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "512"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/Cast"]}}, {"name": "count_nonzero/Const", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "2"}]}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}]}, "tensorContent": "AAAAAAEAAAA="}}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/Const"]}}, {"name": "count_nonzero/nonzero_count", "op": "Sum", "input": ["count_nonzero/Cast:y:0", "count_nonzero/Const:output:0"], "attr": {"T": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/nonzero_count"]}}, {"name": "OptionalFromValue", "op": "OptionalFromValue", "input": ["count_nonzero/zeros:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "Toutput_types": {"list": {"type": ["DT_FLOAT"]}}}, "experimentalDebugInfo": {"originalNodeNames": ["OptionalFromValue"]}}, {"name": "OptionalFromValue_1", "op": "OptionalFromValue", "input": ["count_nonzero/NotEqual:z:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "Toutput_types": {"list": {"type": ["DT_BOOL"]}}}, "experimentalDebugInfo": {"originalNodeNames": ["OptionalFromValue_1"]}}, {"name": "OptionalFromValue_2", "op": "OptionalFromValue", "input": ["count_nonzero/Cast:y:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "Toutput_types": {"list": {"type": ["DT_INT64"]}}}, "experimentalDebugInfo": {"originalNodeNames": ["OptionalFromValue_2"]}}, {"name": "OptionalFromValue_3", "op": "OptionalFromValue", "input": ["count_nonzero/Const:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "Toutput_types": {"list": {"type": ["DT_INT32"]}}}, "experimentalDebugInfo": {"originalNodeNames": ["OptionalFromValue_3"]}}, {"name": "OptionalNone", "op": "OptionalNone", "attr": {"_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["OptionalNone"]}}], "ret": {"optionalfromvalue_2": "OptionalFromValue_2:optional:0", "count_nonzero_nonzero_count": "count_nonzero/nonzero_count:output:0", "optionalfromvalue_1": "OptionalFromValue_1:optional:0", "optionalnone": "OptionalNone:optional:0", "optionalfromvalue": "OptionalFromValue:optional:0", "optionalfromvalue_3": "OptionalFromValue_3:optional:0"}, "attr": {"_input_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "512"}]}]}}}, "argAttr": {"0": {"attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "512"}]}]}}}}}}, {"signature": {"name": "map_while_body_49115", "inputArg": [{"name": "map_while_loop_counter", "type": "DT_INT32"}, {"name": "map_strided_slice_0", "type": "DT_INT32"}, {"name": "placeholder", "type": "DT_INT32"}, {"name": "placeholder_1", "type": "DT_VARIANT"}, {"name": "map_strided_slice_1_0", "type": "DT_INT32"}, {"name": "tensorarrayv2read_tensorlistgetitem_map_tensorarrayunstack_tensorlistfromtensor_0", "type": "DT_VARIANT"}], "outputArg": [{"name": "add_1", "type": "DT_INT32"}, {"name": "map_strided_slice", "type": "DT_INT32"}, {"name": "add", "type": "DT_INT32"}, {"name": "tensorarrayv2write_tensorlistsetitem", "type": "DT_VARIANT"}, {"name": "map_strided_slice_1", "type": "DT_INT32"}, {"name": "tensorarrayv2read_tensorlistgetitem_map_tensorarrayunstack_tensorlistfromtensor", "type": "DT_VARIANT"}]}, "nodeDef": [{"name": "TensorArrayV2Read/Const", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{}]}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{}]}}}, "dtype": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["TensorArrayV2Read/Const"]}}, {"name": "TensorArrayV2Read/TensorListGetItem", "op": "TensorListGetItem", "input": ["tensorarrayv2read_tensorlistgetitem_map_tensorarrayunstack_tensorlistfromtensor_0", "placeholder", "TensorArrayV2Read/Const:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "element_dtype": {"type": "DT_STRING"}}, "experimentalDebugInfo": {"originalNodeNames": ["TensorArrayV2Read/TensorListGetItem"]}}, {"name": "Const", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_STRING", "tensorShape": {"dim": [{"size": "10000"}]}, "stringVal": ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""]}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "10000"}]}]}}, "dtype": {"type": "DT_STRING"}}, "experimentalDebugInfo": {"originalNodeNames": ["Const"]}}, {"name": "StringsByteSplit/stack", "op": "Pack", "input": ["TensorArrayV2Read/TensorListGetItem:item:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "N": {"i": "1"}, "T": {"type": "DT_STRING"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/stack"]}}, {"name": "StringsByteSplit/StringsByteSplit/StringSplit/delimiter", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_STRING", "tensorShape": {}, "stringVal": [""]}}, "dtype": {"type": "DT_STRING"}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/StringsByteSplit/StringSplit/delimiter"]}}, {"name": "StringsByteSplit/StringsByteSplit/StringSplit", "op": "StringSplit", "input": ["StringsByteSplit/stack:output:0", "StringsByteSplit/StringsByteSplit/StringSplit/delimiter:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "2"}]}, {"dim": [{"size": "-1"}]}, {"dim": [{"size": "2"}]}]}}, "skip_empty": {"b": false}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/StringsByteSplit/StringSplit"]}}, {"name": "StringsByteSplit/StringsByteSplit/strided_slice/stack", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}]}, "tensorContent": "AAAAAAAAAAA="}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "2"}]}]}}, "dtype": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/StringsByteSplit/strided_slice/stack"]}}, {"name": "StringsByteSplit/StringsByteSplit/strided_slice/stack_1", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}]}, "tensorContent": "AAAAAAEAAAA="}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "2"}]}]}}, "dtype": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/StringsByteSplit/strided_slice/stack_1"]}}, {"name": "StringsByteSplit/StringsByteSplit/strided_slice/stack_2", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}]}, "tensorContent": "AQAAAAEAAAA="}}, "dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "2"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/StringsByteSplit/strided_slice/stack_2"]}}, {"name": "StringsByteSplit/StringsByteSplit/strided_slice", "op": "StridedSlice", "input": ["StringsByteSplit/StringsByteSplit/StringSplit:indices:0", "StringsByteSplit/StringsByteSplit/strided_slice/stack:output:0", "StringsByteSplit/StringsByteSplit/strided_slice/stack_1:output:0", "StringsByteSplit/StringsByteSplit/strided_slice/stack_2:output:0"], "attr": {"Index": {"type": "DT_INT32"}, "shrink_axis_mask": {"i": "2"}, "begin_mask": {"i": "1"}, "T": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}]}]}}, "end_mask": {"i": "1"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/StringsByteSplit/strided_slice"]}}, {"name": "StringsByteSplit/StringsByteSplit/strided_slice_1/stack", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [0]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/StringsByteSplit/strided_slice_1/stack"]}}, {"name": "StringsByteSplit/StringsByteSplit/strided_slice_1/stack_1", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [1]}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/StringsByteSplit/strided_slice_1/stack_1"]}}, {"name": "StringsByteSplit/StringsByteSplit/strided_slice_1/stack_2", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [1]}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "dtype": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/StringsByteSplit/strided_slice_1/stack_2"]}}, {"name": "StringsByteSplit/StringsByteSplit/strided_slice_1", "op": "StridedSlice", "input": ["StringsByteSplit/StringsByteSplit/StringSplit:shape:0", "StringsByteSplit/StringsByteSplit/strided_slice_1/stack:output:0", "StringsByteSplit/StringsByteSplit/strided_slice_1/stack_1:output:0", "StringsByteSplit/StringsByteSplit/strided_slice_1/stack_2:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "T": {"type": "DT_INT64"}, "shrink_axis_mask": {"i": "1"}, "Index": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/StringsByteSplit/strided_slice_1"]}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/Cast", "op": "Cast", "input": ["StringsByteSplit/StringsByteSplit/strided_slice:output:0"], "attr": {"SrcT": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}]}]}}, "DstT": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/Cast"]}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/Cast_1", "op": "Cast", "input": ["StringsByteSplit/StringsByteSplit/strided_slice_1:output:0"], "attr": {"DstT": {"type": "DT_INT32"}, "SrcT": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/Cast_1"]}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Shape", "op": "Shape", "input": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/Cast:y:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "T": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Shape"]}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Const", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [0]}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "dtype": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Const"]}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Prod", "op": "Prod", "input": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Shape:output:0", "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Const:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "T": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Prod"]}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Greater/y", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}, "intVal": [0]}}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Greater/y"]}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Greater", "op": "Greater", "input": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Prod:output:0", "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Greater/y:output:0"], "attr": {"T": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Greater"]}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Cast", "op": "Cast", "input": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Greater:z:0"], "attr": {"SrcT": {"type": "DT_BOOL"}, "DstT": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Cast"]}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Const_1", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [0]}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Const_1"]}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Max", "op": "Max", "input": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/Cast:y:0", "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Const_1:output:0"], "attr": {"T": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Max"]}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/add/y", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}, "intVal": [1]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/add/y"]}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/add", "op": "AddV2", "input": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Max:output:0", "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/add/y:output:0"], "attr": {"T": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/add"]}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/mul", "op": "Mul", "input": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Cast:y:0", "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/add:z:0"], "attr": {"T": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/mul"]}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Maximum", "op": "Maximum", "input": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/Cast_1:y:0", "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/mul:z:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "T": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Maximum"]}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Minimum", "op": "Minimum", "input": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/Cast_1:y:0", "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Maximum:z:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "T": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Minimum"]}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Const_2", "op": "Const", "attr": {"dtype": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{"dim": [{}]}]}}, "value": {"tensor": {"dtype": "DT_INT64", "tensorShape": {"dim": [{}]}}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Const_2"]}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Bincount", "op": "Bincount", "input": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/Cast:y:0", "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Minimum:z:0", "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Const_2:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}]}]}}, "T": {"type": "DT_INT64"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Bincount"]}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/Cumsum/axis", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}, "intVal": [0]}}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/Cumsum/axis"]}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/Cumsum", "op": "Cumsum", "input": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Bincount:bins:0", "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/Cumsum/axis:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}]}]}}, "T": {"type": "DT_INT64"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/Cumsum"]}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/concat/values_0", "op": "Const", "attr": {"dtype": {"type": "DT_INT64"}, "value": {"tensor": {"dtype": "DT_INT64", "tensorShape": {"dim": [{"size": "1"}]}, "int64Val": ["0"]}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/concat/values_0"]}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/concat/axis", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}, "intVal": [0]}}, "dtype": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/concat/axis"]}}, {"name": "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/concat", "op": "ConcatV2", "input": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/concat/values_0:output:0", "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/Cumsum:out:0", "StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/concat/axis:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}]}]}}, "N": {"i": "2"}, "T": {"type": "DT_INT64"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/concat"]}}, {"name": "StringsByteSplit/RaggedGetItem/strided_slice/stack", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [0]}}, "dtype": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/RaggedGetItem/strided_slice/stack"]}}, {"name": "StringsByteSplit/RaggedGetItem/strided_slice/stack_1", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [-1]}}, "dtype": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/RaggedGetItem/strided_slice/stack_1"]}}, {"name": "StringsByteSplit/RaggedGetItem/strided_slice/stack_2", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [1]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/RaggedGetItem/strided_slice/stack_2"]}}, {"name": "StringsByteSplit/RaggedGetItem/strided_slice", "op": "StridedSlice", "input": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/concat:output:0", "StringsByteSplit/RaggedGetItem/strided_slice/stack:output:0", "StringsByteSplit/RaggedGetItem/strided_slice/stack_1:output:0", "StringsByteSplit/RaggedGetItem/strided_slice/stack_2:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}]}]}}, "begin_mask": {"i": "1"}, "Index": {"type": "DT_INT32"}, "T": {"type": "DT_INT64"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/RaggedGetItem/strided_slice"]}}, {"name": "StringsByteSplit/RaggedGetItem/strided_slice_1/stack", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [1]}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "dtype": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/RaggedGetItem/strided_slice_1/stack"]}}, {"name": "StringsByteSplit/RaggedGetItem/strided_slice_1/stack_1", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [0]}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/RaggedGetItem/strided_slice_1/stack_1"]}}, {"name": "StringsByteSplit/RaggedGetItem/strided_slice_1/stack_2", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [1]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/RaggedGetItem/strided_slice_1/stack_2"]}}, {"name": "StringsByteSplit/RaggedGetItem/strided_slice_1", "op": "StridedSlice", "input": ["StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/concat:output:0", "StringsByteSplit/RaggedGetItem/strided_slice_1/stack:output:0", "StringsByteSplit/RaggedGetItem/strided_slice_1/stack_1:output:0", "StringsByteSplit/RaggedGetItem/strided_slice_1/stack_2:output:0"], "attr": {"end_mask": {"i": "1"}, "T": {"type": "DT_INT64"}, "Index": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/RaggedGetItem/strided_slice_1"]}}, {"name": "StringsByteSplit/RaggedGetItem/strided_slice_2/stack", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [0]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/RaggedGetItem/strided_slice_2/stack"]}}, {"name": "StringsByteSplit/RaggedGetItem/strided_slice_2/stack_1", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [1]}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/RaggedGetItem/strided_slice_2/stack_1"]}}, {"name": "StringsByteSplit/RaggedGetItem/strided_slice_2/stack_2", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [1]}}, "dtype": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/RaggedGetItem/strided_slice_2/stack_2"]}}, {"name": "StringsByteSplit/RaggedGetItem/strided_slice_2", "op": "StridedSlice", "input": ["StringsByteSplit/RaggedGetItem/strided_slice:output:0", "StringsByteSplit/RaggedGetItem/strided_slice_2/stack:output:0", "StringsByteSplit/RaggedGetItem/strided_slice_2/stack_1:output:0", "StringsByteSplit/RaggedGetItem/strided_slice_2/stack_2:output:0"], "attr": {"Index": {"type": "DT_INT32"}, "T": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{}]}}, "shrink_axis_mask": {"i": "1"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/RaggedGetItem/strided_slice_2"]}}, {"name": "StringsByteSplit/RaggedGetItem/strided_slice_3/stack", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [0]}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "dtype": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/RaggedGetItem/strided_slice_3/stack"]}}, {"name": "StringsByteSplit/RaggedGetItem/strided_slice_3/stack_1", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [1]}}, "dtype": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/RaggedGetItem/strided_slice_3/stack_1"]}}, {"name": "StringsByteSplit/RaggedGetItem/strided_slice_3/stack_2", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [1]}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/RaggedGetItem/strided_slice_3/stack_2"]}}, {"name": "StringsByteSplit/RaggedGetItem/strided_slice_3", "op": "StridedSlice", "input": ["StringsByteSplit/RaggedGetItem/strided_slice_1:output:0", "StringsByteSplit/RaggedGetItem/strided_slice_3/stack:output:0", "StringsByteSplit/RaggedGetItem/strided_slice_3/stack_1:output:0", "StringsByteSplit/RaggedGetItem/strided_slice_3/stack_2:output:0"], "attr": {"Index": {"type": "DT_INT32"}, "shrink_axis_mask": {"i": "1"}, "_output_shapes": {"list": {"shape": [{}]}}, "T": {"type": "DT_INT64"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/RaggedGetItem/strided_slice_3"]}}, {"name": "StringsByteSplit/RaggedGetItem/strided_slice_4/stack", "op": "Pack", "input": ["StringsByteSplit/RaggedGetItem/strided_slice_2:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "T": {"type": "DT_INT64"}, "N": {"i": "1"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/RaggedGetItem/strided_slice_4/stack"]}}, {"name": "StringsByteSplit/RaggedGetItem/strided_slice_4/stack_1", "op": "Pack", "input": ["StringsByteSplit/RaggedGetItem/strided_slice_3:output:0"], "attr": {"T": {"type": "DT_INT64"}, "N": {"i": "1"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/RaggedGetItem/strided_slice_4/stack_1"]}}, {"name": "StringsByteSplit/RaggedGetItem/strided_slice_4/stack_2", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [1]}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/RaggedGetItem/strided_slice_4/stack_2"]}}, {"name": "StringsByteSplit/RaggedGetItem/strided_slice_4/Cast", "op": "Cast", "input": ["StringsByteSplit/RaggedGetItem/strided_slice_4/stack_2:output:0"], "attr": {"DstT": {"type": "DT_INT64"}, "SrcT": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/RaggedGetItem/strided_slice_4/Cast"]}}, {"name": "StringsByteSplit/RaggedGetItem/strided_slice_4", "op": "StridedSlice", "input": ["StringsByteSplit/StringsByteSplit/StringSplit:values:0", "StringsByteSplit/RaggedGetItem/strided_slice_4/stack:output:0", "StringsByteSplit/RaggedGetItem/strided_slice_4/stack_1:output:0", "StringsByteSplit/RaggedGetItem/strided_slice_4/Cast:y:0"], "attr": {"T": {"type": "DT_STRING"}, "Index": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/RaggedGetItem/strided_slice_4"]}}, {"name": "StringsByteSplit/RaggedGetItem/strided_slice_5/Const", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{}]}}}, "_output_shapes": {"list": {"shape": [{"dim": [{}]}]}}, "dtype": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/RaggedGetItem/strided_slice_5/Const"]}}, {"name": "StringsByteSplit/RaggedGetItem/strided_slice_5", "op": "StridedSlice", "input": ["StringsByteSplit/RaggedGetItem/strided_slice_4:output:0", "StringsByteSplit/RaggedGetItem/strided_slice_5/Const:output:0", "StringsByteSplit/RaggedGetItem/strided_slice_5/Const:output:0", "StringsByteSplit/RaggedGetItem/strided_slice_5/Const:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}]}]}}, "T": {"type": "DT_STRING"}, "Index": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringsByteSplit/RaggedGetItem/strided_slice_5"]}}, {"name": "StringNGrams/Shape", "op": "Shape", "input": ["StringsByteSplit/RaggedGetItem/strided_slice_5:output:0"], "attr": {"T": {"type": "DT_STRING"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/Shape"]}}, {"name": "StringNGrams/strided_slice/stack", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [0]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/strided_slice/stack"]}}, {"name": "StringNGrams/strided_slice/stack_1", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [-1]}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/strided_slice/stack_1"]}}, {"name": "StringNGrams/strided_slice/stack_2", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [1]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/strided_slice/stack_2"]}}, {"name": "StringNGrams/strided_slice", "op": "StridedSlice", "input": ["StringNGrams/Shape:output:0", "StringNGrams/strided_slice/stack:output:0", "StringNGrams/strided_slice/stack_1:output:0", "StringNGrams/strided_slice/stack_2:output:0"], "attr": {"Index": {"type": "DT_INT32"}, "begin_mask": {"i": "1"}, "_output_shapes": {"list": {"shape": [{"dim": [{}]}]}}, "T": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/strided_slice"]}}, {"name": "StringNGrams/concat/values_1", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [-1]}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/concat/values_1"]}}, {"name": "StringNGrams/concat/axis", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}, "intVal": [0]}}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/concat/axis"]}}, {"name": "StringNGrams/concat", "op": "ConcatV2", "input": ["StringNGrams/strided_slice:output:0", "StringNGrams/concat/values_1:output:0", "StringNGrams/concat/axis:output:0"], "attr": {"T": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "N": {"i": "2"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/concat"]}}, {"name": "StringNGrams/RaggedFromRowStarts/Shape", "op": "Shape", "input": ["StringsByteSplit/RaggedGetItem/strided_slice_5:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "T": {"type": "DT_STRING"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedFromRowStarts/Shape"]}}, {"name": "StringNGrams/RaggedFromRowStarts/strided_slice/stack", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [0]}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "dtype": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedFromRowStarts/strided_slice/stack"]}}, {"name": "StringNGrams/RaggedFromRowStarts/strided_slice/stack_1", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [1]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedFromRowStarts/strided_slice/stack_1"]}}, {"name": "StringNGrams/RaggedFromRowStarts/strided_slice/stack_2", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [1]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedFromRowStarts/strided_slice/stack_2"]}}, {"name": "StringNGrams/RaggedFromRowStarts/strided_slice", "op": "StridedSlice", "input": ["StringNGrams/RaggedFromRowStarts/Shape:output:0", "StringNGrams/RaggedFromRowStarts/strided_slice/stack:output:0", "StringNGrams/RaggedFromRowStarts/strided_slice/stack_1:output:0", "StringNGrams/RaggedFromRowStarts/strided_slice/stack_2:output:0"], "attr": {"shrink_axis_mask": {"i": "1"}, "T": {"type": "DT_INT32"}, "Index": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedFromRowStarts/strided_slice"]}}, {"name": "StringNGrams/RaggedFromRowStarts/RowPartitionFromRowStarts/row_starts", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "value": {"tensor": {"dtype": "DT_INT64", "tensorShape": {"dim": [{"size": "1"}]}, "int64Val": ["0"]}}, "dtype": {"type": "DT_INT64"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedFromRowStarts/RowPartitionFromRowStarts/row_starts"]}}, {"name": "StringNGrams/RaggedFromRowStarts/RowPartitionFromRowStarts/Cast", "op": "Cast", "input": ["StringNGrams/RaggedFromRowStarts/strided_slice:output:0"], "attr": {"SrcT": {"type": "DT_INT32"}, "DstT": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedFromRowStarts/RowPartitionFromRowStarts/Cast"]}}, {"name": "StringNGrams/RaggedFromRowStarts/RowPartitionFromRowStarts/concat/values_1", "op": "Pack", "input": ["StringNGrams/RaggedFromRowStarts/RowPartitionFromRowStarts/Cast:y:0"], "attr": {"N": {"i": "1"}, "T": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedFromRowStarts/RowPartitionFromRowStarts/concat/values_1"]}}, {"name": "StringNGrams/RaggedFromRowStarts/RowPartitionFromRowStarts/concat/axis", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}, "intVal": [0]}}, "dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedFromRowStarts/RowPartitionFromRowStarts/concat/axis"]}}, {"name": "StringNGrams/RaggedFromRowStarts/RowPartitionFromRowStarts/concat", "op": "ConcatV2", "input": ["StringNGrams/RaggedFromRowStarts/RowPartitionFromRowStarts/row_starts:output:0", "StringNGrams/RaggedFromRowStarts/RowPartitionFromRowStarts/concat/values_1:output:0", "StringNGrams/RaggedFromRowStarts/RowPartitionFromRowStarts/concat/axis:output:0"], "attr": {"T": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "2"}]}]}}, "N": {"i": "2"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedFromRowStarts/RowPartitionFromRowStarts/concat"]}}, {"name": "StringNGrams/StringNGrams/StringNGrams", "op": "StringNGrams", "input": ["StringsByteSplit/RaggedGetItem/strided_slice_5:output:0", "StringNGrams/RaggedFromRowStarts/RowPartitionFromRowStarts/concat:output:0"], "attr": {"preserve_short_sequences": {"b": false}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}]}, {"dim": [{"size": "2"}]}]}}, "left_pad": {"s": ""}, "right_pad": {"s": ""}, "separator": {"s": "IA=="}, "pad_width": {"i": "0"}, "ngram_widths": {"list": {"i": ["2"]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/StringNGrams/StringNGrams"]}}, {"name": "StringNGrams/RaggedGetItem/strided_slice/stack", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [0]}}, "dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedGetItem/strided_slice/stack"]}}, {"name": "StringNGrams/RaggedGetItem/strided_slice/stack_1", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [-1]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedGetItem/strided_slice/stack_1"]}}, {"name": "StringNGrams/RaggedGetItem/strided_slice/stack_2", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [1]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedGetItem/strided_slice/stack_2"]}}, {"name": "StringNGrams/RaggedGetItem/strided_slice", "op": "StridedSlice", "input": ["StringNGrams/StringNGrams/StringNGrams:ngrams_splits:0", "StringNGrams/RaggedGetItem/strided_slice/stack:output:0", "StringNGrams/RaggedGetItem/strided_slice/stack_1:output:0", "StringNGrams/RaggedGetItem/strided_slice/stack_2:output:0"], "attr": {"Index": {"type": "DT_INT32"}, "T": {"type": "DT_INT64"}, "begin_mask": {"i": "1"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedGetItem/strided_slice"]}}, {"name": "StringNGrams/RaggedGetItem/strided_slice_1/stack", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [1]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedGetItem/strided_slice_1/stack"]}}, {"name": "StringNGrams/RaggedGetItem/strided_slice_1/stack_1", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [0]}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedGetItem/strided_slice_1/stack_1"]}}, {"name": "StringNGrams/RaggedGetItem/strided_slice_1/stack_2", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [1]}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedGetItem/strided_slice_1/stack_2"]}}, {"name": "StringNGrams/RaggedGetItem/strided_slice_1", "op": "StridedSlice", "input": ["StringNGrams/StringNGrams/StringNGrams:ngrams_splits:0", "StringNGrams/RaggedGetItem/strided_slice_1/stack:output:0", "StringNGrams/RaggedGetItem/strided_slice_1/stack_1:output:0", "StringNGrams/RaggedGetItem/strided_slice_1/stack_2:output:0"], "attr": {"Index": {"type": "DT_INT32"}, "T": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "end_mask": {"i": "1"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedGetItem/strided_slice_1"]}}, {"name": "StringNGrams/RaggedGetItem/strided_slice_2/stack", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [0]}}, "dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedGetItem/strided_slice_2/stack"]}}, {"name": "StringNGrams/RaggedGetItem/strided_slice_2/stack_1", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [1]}}, "dtype": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedGetItem/strided_slice_2/stack_1"]}}, {"name": "StringNGrams/RaggedGetItem/strided_slice_2/stack_2", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [1]}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedGetItem/strided_slice_2/stack_2"]}}, {"name": "StringNGrams/RaggedGetItem/strided_slice_2", "op": "StridedSlice", "input": ["StringNGrams/RaggedGetItem/strided_slice:output:0", "StringNGrams/RaggedGetItem/strided_slice_2/stack:output:0", "StringNGrams/RaggedGetItem/strided_slice_2/stack_1:output:0", "StringNGrams/RaggedGetItem/strided_slice_2/stack_2:output:0"], "attr": {"Index": {"type": "DT_INT32"}, "T": {"type": "DT_INT64"}, "shrink_axis_mask": {"i": "1"}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedGetItem/strided_slice_2"]}}, {"name": "StringNGrams/RaggedGetItem/strided_slice_3/stack", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [0]}}, "dtype": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedGetItem/strided_slice_3/stack"]}}, {"name": "StringNGrams/RaggedGetItem/strided_slice_3/stack_1", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [1]}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "dtype": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedGetItem/strided_slice_3/stack_1"]}}, {"name": "StringNGrams/RaggedGetItem/strided_slice_3/stack_2", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [1]}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedGetItem/strided_slice_3/stack_2"]}}, {"name": "StringNGrams/RaggedGetItem/strided_slice_3", "op": "StridedSlice", "input": ["StringNGrams/RaggedGetItem/strided_slice_1:output:0", "StringNGrams/RaggedGetItem/strided_slice_3/stack:output:0", "StringNGrams/RaggedGetItem/strided_slice_3/stack_1:output:0", "StringNGrams/RaggedGetItem/strided_slice_3/stack_2:output:0"], "attr": {"T": {"type": "DT_INT64"}, "shrink_axis_mask": {"i": "1"}, "Index": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedGetItem/strided_slice_3"]}}, {"name": "StringNGrams/RaggedGetItem/strided_slice_4/stack", "op": "Pack", "input": ["StringNGrams/RaggedGetItem/strided_slice_2:output:0"], "attr": {"T": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "N": {"i": "1"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedGetItem/strided_slice_4/stack"]}}, {"name": "StringNGrams/RaggedGetItem/strided_slice_4/stack_1", "op": "Pack", "input": ["StringNGrams/RaggedGetItem/strided_slice_3:output:0"], "attr": {"T": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "N": {"i": "1"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedGetItem/strided_slice_4/stack_1"]}}, {"name": "StringNGrams/RaggedGetItem/strided_slice_4/stack_2", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [1]}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedGetItem/strided_slice_4/stack_2"]}}, {"name": "StringNGrams/RaggedGetItem/strided_slice_4/Cast", "op": "Cast", "input": ["StringNGrams/RaggedGetItem/strided_slice_4/stack_2:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "DstT": {"type": "DT_INT64"}, "SrcT": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedGetItem/strided_slice_4/Cast"]}}, {"name": "StringNGrams/RaggedGetItem/strided_slice_4", "op": "StridedSlice", "input": ["StringNGrams/StringNGrams/StringNGrams:ngrams:0", "StringNGrams/RaggedGetItem/strided_slice_4/stack:output:0", "StringNGrams/RaggedGetItem/strided_slice_4/stack_1:output:0", "StringNGrams/RaggedGetItem/strided_slice_4/Cast:y:0"], "attr": {"T": {"type": "DT_STRING"}, "Index": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedGetItem/strided_slice_4"]}}, {"name": "StringNGrams/RaggedGetItem/strided_slice_5/Const", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{}]}}}, "_output_shapes": {"list": {"shape": [{"dim": [{}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedGetItem/strided_slice_5/Const"]}}, {"name": "StringNGrams/RaggedGetItem/strided_slice_5", "op": "StridedSlice", "input": ["StringNGrams/RaggedGetItem/strided_slice_4:output:0", "StringNGrams/RaggedGetItem/strided_slice_5/Const:output:0", "StringNGrams/RaggedGetItem/strided_slice_5/Const:output:0", "StringNGrams/RaggedGetItem/strided_slice_5/Const:output:0"], "attr": {"T": {"type": "DT_STRING"}, "Index": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["StringNGrams/RaggedGetItem/strided_slice_5"]}}, {"name": "concat/axis", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}, "intVal": [0]}}}, "experimentalDebugInfo": {"originalNodeNames": ["concat/axis"]}}, {"name": "concat", "op": "ConcatV2", "input": ["StringNGrams/RaggedGetItem/strided_slice_5:output:0", "Const:output:0", "concat/axis:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}]}]}}, "T": {"type": "DT_STRING"}, "N": {"i": "2"}}, "experimentalDebugInfo": {"originalNodeNames": ["concat"]}}, {"name": "strided_slice/stack", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [0]}}}, "experimentalDebugInfo": {"originalNodeNames": ["strided_slice/stack"]}}, {"name": "strided_slice/stack_1", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [10000]}}}, "experimentalDebugInfo": {"originalNodeNames": ["strided_slice/stack_1"]}}, {"name": "strided_slice/stack_2", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "1"}]}]}}, "dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "1"}]}, "intVal": [1]}}}, "experimentalDebugInfo": {"originalNodeNames": ["strided_slice/stack_2"]}}, {"name": "strided_slice", "op": "StridedSlice", "input": ["concat:output:0", "strided_slice/stack:output:0", "strided_slice/stack_1:output:0", "strided_slice/stack_2:output:0"], "attr": {"Index": {"type": "DT_INT32"}, "begin_mask": {"i": "1"}, "T": {"type": "DT_STRING"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["strided_slice"]}}, {"name": "TensorArrayV2Write/TensorListSetItem", "op": "TensorListSetItem", "input": ["placeholder_1", "placeholder", "strided_slice:output:0"], "attr": {"element_dtype": {"type": "DT_STRING"}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["TensorArrayV2Write/TensorListSetItem"]}}, {"name": "add/y", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}, "intVal": [1]}}}, "experimentalDebugInfo": {"originalNodeNames": ["add/y"]}}, {"name": "add_0", "op": "AddV2", "input": ["placeholder", "add/y:output:0"], "attr": {"T": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["add"]}}, {"name": "add_1/y", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {}, "intVal": [1]}}}, "experimentalDebugInfo": {"originalNodeNames": ["add_1/y"]}}, {"name": "add_1_0", "op": "AddV2", "input": ["map_while_loop_counter", "add_1/y:output:0"], "attr": {"T": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["add_1"]}}], "ret": {"tensorarrayv2read_tensorlistgetitem_map_tensorarrayunstack_tensorlistfromtensor": "tensorarrayv2read_tensorlistgetitem_map_tensorarrayunstack_tensorlistfromtensor_0", "tensorarrayv2write_tensorlistsetitem": "TensorArrayV2Write/TensorListSetItem:output_handle:0", "map_strided_slice": "map_strided_slice_0", "add_1": "add_1_0:z:0", "add": "add_0:z:0", "map_strided_slice_1": "map_strided_slice_1_0"}, "attr": {"_input_shapes": {"list": {"shape": [{}, {}, {}, {}, {}, {}]}}}, "argAttr": {"1": {"attr": {"_output_shapes": {"list": {"shape": [{}]}}}}, "3": {"attr": {"_output_shapes": {"list": {"shape": [{}]}}}}, "0": {"attr": {"_output_shapes": {"list": {"shape": [{}]}}}}, "5": {"attr": {"_output_shapes": {"list": {"shape": [{}]}}}}, "2": {"attr": {"_output_shapes": {"list": {"shape": [{}]}}}}, "4": {"attr": {"_output_shapes": {"list": {"shape": [{}]}}}}}}, {"signature": {"name": "zero_fraction_1_cond_false_49704", "inputArg": [{"name": "count_nonzero_notequal_linear_linear_model_linear_linear_model_linear_linear_model_weighted_sum", "type": "DT_FLOAT"}], "outputArg": [{"name": "count_nonzero_nonzero_count", "type": "DT_INT64"}]}, "nodeDef": [{"name": "count_nonzero/zeros", "op": "Const", "attr": {"dtype": {"type": "DT_FLOAT"}, "_output_shapes": {"list": {"shape": [{}]}}, "value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {}, "floatVal": [0.0]}}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/zeros"]}}, {"name": "count_nonzero/NotEqual", "op": "NotEqual", "input": ["count_nonzero_notequal_linear_linear_model_linear_linear_model_linear_linear_model_weighted_sum", "count_nonzero/zeros:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "54"}]}]}}, "T": {"type": "DT_FLOAT"}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/NotEqual"]}}, {"name": "count_nonzero/Cast", "op": "Cast", "input": ["count_nonzero/NotEqual:z:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "54"}]}]}}, "SrcT": {"type": "DT_BOOL"}, "DstT": {"type": "DT_INT64"}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/Cast"]}}, {"name": "count_nonzero/Const", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "2"}]}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}]}, "tensorContent": "AAAAAAEAAAA="}}, "dtype": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/Const"]}}, {"name": "count_nonzero/nonzero_count", "op": "Sum", "input": ["count_nonzero/Cast:y:0", "count_nonzero/Const:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "T": {"type": "DT_INT64"}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/nonzero_count"]}}], "ret": {"count_nonzero_nonzero_count": "count_nonzero/nonzero_count:output:0"}, "attr": {"_input_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "54"}]}]}}}, "argAttr": {"0": {"attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "54"}]}]}}}}}}, {"signature": {"name": "dnn_zero_fraction_cond_true_49370", "inputArg": [{"name": "count_nonzero_notequal_dnn_hiddenlayer_0_relu", "type": "DT_FLOAT"}], "outputArg": [{"name": "cast", "type": "DT_INT64"}, {"name": "optionalfromvalue", "type": "DT_VARIANT"}, {"name": "optionalfromvalue_1", "type": "DT_VARIANT"}, {"name": "optionalfromvalue_2", "type": "DT_VARIANT"}, {"name": "optionalfromvalue_3", "type": "DT_VARIANT"}, {"name": "optionalfromvalue_4", "type": "DT_VARIANT"}]}, "nodeDef": [{"name": "count_nonzero/zeros", "op": "Const", "attr": {"dtype": {"type": "DT_FLOAT"}, "_output_shapes": {"list": {"shape": [{}]}}, "value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {}, "floatVal": [0.0]}}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/zeros"]}}, {"name": "count_nonzero/NotEqual", "op": "NotEqual", "input": ["count_nonzero_notequal_dnn_hiddenlayer_0_relu", "count_nonzero/zeros:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "512"}]}]}}, "T": {"type": "DT_FLOAT"}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/NotEqual"]}}, {"name": "count_nonzero/Cast", "op": "Cast", "input": ["count_nonzero/NotEqual:z:0"], "attr": {"DstT": {"type": "DT_INT32"}, "SrcT": {"type": "DT_BOOL"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "512"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/Cast"]}}, {"name": "count_nonzero/Const", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}]}, "tensorContent": "AAAAAAEAAAA="}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "2"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/Const"]}}, {"name": "count_nonzero/nonzero_count", "op": "Sum", "input": ["count_nonzero/Cast:y:0", "count_nonzero/Const:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "T": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/nonzero_count"]}}, {"name": "Cast", "op": "Cast", "input": ["count_nonzero/nonzero_count:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "DstT": {"type": "DT_INT64"}, "SrcT": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["Cast"]}}, {"name": "OptionalFromValue", "op": "OptionalFromValue", "input": ["count_nonzero/zeros:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "Toutput_types": {"list": {"type": ["DT_FLOAT"]}}}, "experimentalDebugInfo": {"originalNodeNames": ["OptionalFromValue"]}}, {"name": "OptionalFromValue_1", "op": "OptionalFromValue", "input": ["count_nonzero/NotEqual:z:0"], "attr": {"Toutput_types": {"list": {"type": ["DT_BOOL"]}}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["OptionalFromValue_1"]}}, {"name": "OptionalFromValue_2", "op": "OptionalFromValue", "input": ["count_nonzero/Cast:y:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "Toutput_types": {"list": {"type": ["DT_INT32"]}}}, "experimentalDebugInfo": {"originalNodeNames": ["OptionalFromValue_2"]}}, {"name": "OptionalFromValue_3", "op": "OptionalFromValue", "input": ["count_nonzero/Const:output:0"], "attr": {"Toutput_types": {"list": {"type": ["DT_INT32"]}}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["OptionalFromValue_3"]}}, {"name": "OptionalFromValue_4", "op": "OptionalFromValue", "input": ["count_nonzero/nonzero_count:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "Toutput_types": {"list": {"type": ["DT_INT32"]}}}, "experimentalDebugInfo": {"originalNodeNames": ["OptionalFromValue_4"]}}], "ret": {"optionalfromvalue_3": "OptionalFromValue_3:optional:0", "optionalfromvalue_1": "OptionalFromValue_1:optional:0", "cast": "Cast:y:0", "optionalfromvalue_4": "OptionalFromValue_4:optional:0", "optionalfromvalue": "OptionalFromValue:optional:0", "optionalfromvalue_2": "OptionalFromValue_2:optional:0"}, "attr": {"_input_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "512"}]}]}}}, "argAttr": {"0": {"attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "512"}]}]}}}}}}, {"signature": {"name": "dnn_zero_fraction_1_cond_true_49440", "inputArg": [{"name": "count_nonzero_notequal_dnn_hiddenlayer_1_relu", "type": "DT_FLOAT"}], "outputArg": [{"name": "cast", "type": "DT_INT64"}, {"name": "optionalfromvalue", "type": "DT_VARIANT"}, {"name": "optionalfromvalue_1", "type": "DT_VARIANT"}, {"name": "optionalfromvalue_2", "type": "DT_VARIANT"}, {"name": "optionalfromvalue_3", "type": "DT_VARIANT"}, {"name": "optionalfromvalue_4", "type": "DT_VARIANT"}]}, "nodeDef": [{"name": "count_nonzero/zeros", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {}, "floatVal": [0.0]}}, "_output_shapes": {"list": {"shape": [{}]}}, "dtype": {"type": "DT_FLOAT"}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/zeros"]}}, {"name": "count_nonzero/NotEqual", "op": "NotEqual", "input": ["count_nonzero_notequal_dnn_hiddenlayer_1_relu", "count_nonzero/zeros:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "32"}]}]}}, "T": {"type": "DT_FLOAT"}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/NotEqual"]}}, {"name": "count_nonzero/Cast", "op": "Cast", "input": ["count_nonzero/NotEqual:z:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "32"}]}]}}, "SrcT": {"type": "DT_BOOL"}, "DstT": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/Cast"]}}, {"name": "count_nonzero/Const", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "2"}]}]}}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}]}, "tensorContent": "AAAAAAEAAAA="}}, "dtype": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/Const"]}}, {"name": "count_nonzero/nonzero_count", "op": "Sum", "input": ["count_nonzero/Cast:y:0", "count_nonzero/Const:output:0"], "attr": {"T": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/nonzero_count"]}}, {"name": "Cast", "op": "Cast", "input": ["count_nonzero/nonzero_count:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "SrcT": {"type": "DT_INT32"}, "DstT": {"type": "DT_INT64"}}, "experimentalDebugInfo": {"originalNodeNames": ["Cast"]}}, {"name": "OptionalFromValue", "op": "OptionalFromValue", "input": ["count_nonzero/zeros:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "Toutput_types": {"list": {"type": ["DT_FLOAT"]}}}, "experimentalDebugInfo": {"originalNodeNames": ["OptionalFromValue"]}}, {"name": "OptionalFromValue_1", "op": "OptionalFromValue", "input": ["count_nonzero/NotEqual:z:0"], "attr": {"Toutput_types": {"list": {"type": ["DT_BOOL"]}}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["OptionalFromValue_1"]}}, {"name": "OptionalFromValue_2", "op": "OptionalFromValue", "input": ["count_nonzero/Cast:y:0"], "attr": {"Toutput_types": {"list": {"type": ["DT_INT32"]}}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["OptionalFromValue_2"]}}, {"name": "OptionalFromValue_3", "op": "OptionalFromValue", "input": ["count_nonzero/Const:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "Toutput_types": {"list": {"type": ["DT_INT32"]}}}, "experimentalDebugInfo": {"originalNodeNames": ["OptionalFromValue_3"]}}, {"name": "OptionalFromValue_4", "op": "OptionalFromValue", "input": ["count_nonzero/nonzero_count:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "Toutput_types": {"list": {"type": ["DT_INT32"]}}}, "experimentalDebugInfo": {"originalNodeNames": ["OptionalFromValue_4"]}}], "ret": {"optionalfromvalue_3": "OptionalFromValue_3:optional:0", "optionalfromvalue_2": "OptionalFromValue_2:optional:0", "optionalfromvalue": "OptionalFromValue:optional:0", "optionalfromvalue_1": "OptionalFromValue_1:optional:0", "cast": "Cast:y:0", "optionalfromvalue_4": "OptionalFromValue_4:optional:0"}, "attr": {"_input_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "32"}]}]}}}, "argAttr": {"0": {"attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "32"}]}]}}}}}}, {"signature": {"name": "zero_fraction_cond_false_49665", "inputArg": [{"name": "count_nonzero_notequal_zero_fraction_readvariableop", "type": "DT_FLOAT"}], "outputArg": [{"name": "count_nonzero_nonzero_count", "type": "DT_INT64"}]}, "nodeDef": [{"name": "count_nonzero/zeros", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "dtype": {"type": "DT_FLOAT"}, "value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {}, "floatVal": [0.0]}}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/zeros"]}}, {"name": "count_nonzero/NotEqual", "op": "NotEqual", "input": ["count_nonzero_notequal_zero_fraction_readvariableop", "count_nonzero/zeros:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "5000"}, {"size": "54"}]}]}}, "T": {"type": "DT_FLOAT"}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/NotEqual"]}}, {"name": "count_nonzero/Cast", "op": "Cast", "input": ["count_nonzero/NotEqual:z:0"], "attr": {"SrcT": {"type": "DT_BOOL"}, "DstT": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "5000"}, {"size": "54"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/Cast"]}}, {"name": "count_nonzero/Const", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}]}, "tensorContent": "AAAAAAEAAAA="}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "2"}]}]}}, "dtype": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/Const"]}}, {"name": "count_nonzero/nonzero_count", "op": "Sum", "input": ["count_nonzero/Cast:y:0", "count_nonzero/Const:output:0"], "attr": {"T": {"type": "DT_INT64"}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/nonzero_count"]}}], "ret": {"count_nonzero_nonzero_count": "count_nonzero/nonzero_count:output:0"}, "attr": {"_input_shapes": {"list": {"shape": [{"dim": [{"size": "5000"}, {"size": "54"}]}]}}}, "argAttr": {"0": {"attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "5000"}, {"size": "54"}]}]}}}}}}, {"signature": {"name": "zero_fraction_1_cond_true_49703", "inputArg": [{"name": "count_nonzero_notequal_linear_linear_model_linear_linear_model_linear_linear_model_weighted_sum", "type": "DT_FLOAT"}], "outputArg": [{"name": "cast", "type": "DT_INT64"}]}, "nodeDef": [{"name": "count_nonzero/zeros", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {}, "floatVal": [0.0]}}, "dtype": {"type": "DT_FLOAT"}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/zeros"]}}, {"name": "count_nonzero/NotEqual", "op": "NotEqual", "input": ["count_nonzero_notequal_linear_linear_model_linear_linear_model_linear_linear_model_weighted_sum", "count_nonzero/zeros:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "54"}]}]}}, "T": {"type": "DT_FLOAT"}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/NotEqual"]}}, {"name": "count_nonzero/Cast", "op": "Cast", "input": ["count_nonzero/NotEqual:z:0"], "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "54"}]}]}}, "DstT": {"type": "DT_INT32"}, "SrcT": {"type": "DT_BOOL"}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/Cast"]}}, {"name": "count_nonzero/Const", "op": "Const", "attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "2"}]}]}}, "dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}]}, "tensorContent": "AAAAAAEAAAA="}}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/Const"]}}, {"name": "count_nonzero/nonzero_count", "op": "Sum", "input": ["count_nonzero/Cast:y:0", "count_nonzero/Const:output:0"], "attr": {"T": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/nonzero_count"]}}, {"name": "Cast", "op": "Cast", "input": ["count_nonzero/nonzero_count:output:0"], "attr": {"DstT": {"type": "DT_INT64"}, "SrcT": {"type": "DT_INT32"}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["Cast"]}}], "ret": {"cast": "Cast:y:0"}, "attr": {"_input_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "54"}]}]}}}, "argAttr": {"0": {"attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "-1"}, {"size": "54"}]}]}}}}}}, {"signature": {"name": "zero_fraction_cond_true_49664", "inputArg": [{"name": "count_nonzero_notequal_zero_fraction_readvariableop", "type": "DT_FLOAT"}], "outputArg": [{"name": "cast", "type": "DT_INT64"}]}, "nodeDef": [{"name": "count_nonzero/zeros", "op": "Const", "attr": {"value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {}, "floatVal": [0.0]}}, "dtype": {"type": "DT_FLOAT"}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/zeros"]}}, {"name": "count_nonzero/NotEqual", "op": "NotEqual", "input": ["count_nonzero_notequal_zero_fraction_readvariableop", "count_nonzero/zeros:output:0"], "attr": {"T": {"type": "DT_FLOAT"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "5000"}, {"size": "54"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/NotEqual"]}}, {"name": "count_nonzero/Cast", "op": "Cast", "input": ["count_nonzero/NotEqual:z:0"], "attr": {"SrcT": {"type": "DT_BOOL"}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "5000"}, {"size": "54"}]}]}}, "DstT": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/Cast"]}}, {"name": "count_nonzero/Const", "op": "Const", "attr": {"dtype": {"type": "DT_INT32"}, "value": {"tensor": {"dtype": "DT_INT32", "tensorShape": {"dim": [{"size": "2"}]}, "tensorContent": "AAAAAAEAAAA="}}, "_output_shapes": {"list": {"shape": [{"dim": [{"size": "2"}]}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/Const"]}}, {"name": "count_nonzero/nonzero_count", "op": "Sum", "input": ["count_nonzero/Cast:y:0", "count_nonzero/Const:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "T": {"type": "DT_INT32"}}, "experimentalDebugInfo": {"originalNodeNames": ["count_nonzero/nonzero_count"]}}, {"name": "Cast", "op": "Cast", "input": ["count_nonzero/nonzero_count:output:0"], "attr": {"_output_shapes": {"list": {"shape": [{}]}}, "SrcT": {"type": "DT_INT32"}, "DstT": {"type": "DT_INT64"}}, "experimentalDebugInfo": {"originalNodeNames": ["Cast"]}}], "ret": {"cast": "Cast:y:0"}, "attr": {"_input_shapes": {"list": {"shape": [{"dim": [{"size": "5000"}, {"size": "54"}]}]}}}, "argAttr": {"0": {"attr": {"_output_shapes": {"list": {"shape": [{"dim": [{"size": "5000"}, {"size": "54"}]}]}}}}}}, {"signature": {"name": "zero_fraction_total_zero_zero_count_true_49654", "inputArg": [{"name": "placeholder", "type": "DT_RESOURCE"}, {"name": "placeholder_1", "type": "DT_INT64"}], "outputArg": [{"name": "const", "type": "DT_FLOAT"}]}, "nodeDef": [{"name": "Const", "op": "Const", "attr": {"dtype": {"type": "DT_FLOAT"}, "value": {"tensor": {"dtype": "DT_FLOAT", "tensorShape": {}, "floatVal": [0.0]}}, "_output_shapes": {"list": {"shape": [{}]}}}, "experimentalDebugInfo": {"originalNodeNames": ["Const"]}}], "ret": {"const": "Const:output:0"}, "attr": {"_input_shapes": {"list": {"shape": [{"unknownRank": true}, {}]}}}, "argAttr": {"1": {"attr": {"_output_shapes": {"list": {"shape": [{}]}}}}}}]}, "versions": {"minConsumer": 12}}, "weightsManifest": [{"paths": ["group1-shard1of1.bin"], "weights": [{"name": "head/ExpandDims/input", "shape": [54], "dtype": "string"}, {"name": "head/ExpandDims/dim", "shape": [], "dtype": "int32"}, {"name": "head/strided_slice/stack", "shape": [1], "dtype": "int32"}, {"name": "head/strided_slice/stack_1", "shape": [1], "dtype": "int32"}, {"name": "head/strided_slice/stack_2", "shape": [1], "dtype": "int32"}, {"name": "head/Tile/multiples/1", "shape": [], "dtype": "int32"}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/Reshape_1/shape", "shape": [2], "dtype": "int32"}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/stack/0", "shape": [], "dtype": "int32"}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/strided_slice/stack", "shape": [1], "dtype": "int32"}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/strided_slice/stack_1", "shape": [1], "dtype": "int32"}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/strided_slice/stack_2", "shape": [1], "dtype": "int32"}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding/embedding_weights", "shape": [5000, 70], "dtype": "float32", "quantization": {"dtype": "uint8", "min": -0.23829841794920903, "scale": 0.0018763654956630632, "original_dtype": "float32"}}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/GatherV2_1/axis", "shape": [], "dtype": "int32"}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/GreaterEqual/y", "shape": [], "dtype": "int32"}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/Reshape/shape", "shape": [1], "dtype": "int32"}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/GatherV2_2/axis", "shape": [], "dtype": "int32"}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/to_sparse_input/ignore_value/x", "shape": [], "dtype": "string"}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/Slice/begin", "shape": [1], "dtype": "int32"}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/Slice/size", "shape": [1], "dtype": "int32"}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/Const", "shape": [1], "dtype": "int32"}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/GatherV2/indices", "shape": [], "dtype": "int32"}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/GatherV2/axis", "shape": [], "dtype": "int32"}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/SparseFillEmptyRows/Const", "shape": [], "dtype": "int32"}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/embedding_lookup_sparse/strided_slice/stack", "shape": [2], "dtype": "int32"}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/embedding_lookup_sparse/strided_slice/stack_1", "shape": [2], "dtype": "int32"}, {"name": "dnn/input_from_feature_columns/input_layer/content_embedding_1/content_embedding_weights/embedding_lookup_sparse/strided_slice/stack_2", "shape": [2], "dtype": "int32"}, {"name": "dnn/hiddenlayer_0/kernel", "shape": [70, 512], "dtype": "float32", "quantization": {"dtype": "uint8", "min": -0.10249130375245037, "scale": 0.0008070181397830738, "original_dtype": "float32"}}, {"name": "dnn/hiddenlayer_0/bias", "shape": [512], "dtype": "float32", "quantization": {"dtype": "uint8", "min": -0.021031223785351303, "scale": 0.00020029736938429813, "original_dtype": "float32"}}, {"name": "dnn/hiddenlayer_1/kernel", "shape": [512, 32], "dtype": "float32", "quantization": {"dtype": "uint8", "min": -0.10604567843324998, "scale": 0.000841632368517857, "original_dtype": "float32"}}, {"name": "dnn/hiddenlayer_1/bias", "shape": [32], "dtype": "float32", "quantization": {"dtype": "uint8", "min": -0.022284538547197977, "scale": 0.00032771380216467614, "original_dtype": "float32"}}, {"name": "dnn/logits/kernel", "shape": [32, 54], "dtype": "float32", "quantization": {"dtype": "uint8", "min": -0.27378906011581416, "scale": 0.002172929048538208, "original_dtype": "float32"}}, {"name": "dnn/logits/bias", "shape": [54], "dtype": "float32", "quantization": {"dtype": "uint8", "min": -0.11504998528489879, "scale": 0.0009508263246685851, "original_dtype": "float32"}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Slice_1/begin", "shape": [1], "dtype": "int32"}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Slice_1/size", "shape": [1], "dtype": "int32"}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Reshape_1/shape", "shape": [2], "dtype": "int32"}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/stack/0", "shape": [], "dtype": "int32"}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/strided_slice/stack", "shape": [1], "dtype": "int32"}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/strided_slice/stack_1", "shape": [1], "dtype": "int32"}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/strided_slice/stack_2", "shape": [1], "dtype": "int32"}, {"name": "linear/linear_model/content/weights", "shape": [5000, 54], "dtype": "float32", "quantization": {"dtype": "uint8", "min": -0.3894611456814934, "scale": 0.003933950966479732, "original_dtype": "float32"}}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/GatherV2_1/axis", "shape": [], "dtype": "int32"}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/GreaterEqual/y", "shape": [], "dtype": "int32"}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Reshape/shape", "shape": [1], "dtype": "int32"}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/GatherV2_2/axis", "shape": [], "dtype": "int32"}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Slice/begin", "shape": [1], "dtype": "int32"}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Slice/size", "shape": [1], "dtype": "int32"}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Const", "shape": [1], "dtype": "int32"}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/to_sparse_input/ignore_value/x", "shape": [], "dtype": "string"}, {"name": "map/while/loop_counter", "shape": [], "dtype": "int32"}, {"name": "map/Const", "shape": [], "dtype": "int32"}, {"name": "map/TensorArrayV2_1/element_shape", "shape": [], "dtype": "int32"}, {"name": "map/strided_slice/stack", "shape": [1], "dtype": "int32"}, {"name": "map/strided_slice/stack_1", "shape": [1], "dtype": "int32"}, {"name": "map/strided_slice/stack_2", "shape": [1], "dtype": "int32"}, {"name": "map/TensorArrayUnstack/Const", "shape": [0], "dtype": "int32"}, {"name": "map/TensorArrayV2Stack/TensorListStack/element_shape", "shape": [1], "dtype": "int32"}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/strided_slice/stack", "shape": [1], "dtype": "int32"}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/strided_slice/stack_1", "shape": [1], "dtype": "int32"}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/strided_slice/stack_2", "shape": [1], "dtype": "int32"}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/Cast/x/1", "shape": [], "dtype": "int32"}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/GatherV2/indices", "shape": [], "dtype": "int32"}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/GatherV2/axis", "shape": [], "dtype": "int32"}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/SparseFillEmptyRows/Const", "shape": [], "dtype": "int32"}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/embedding_lookup_sparse/strided_slice/stack", "shape": [2], "dtype": "int32"}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/embedding_lookup_sparse/strided_slice/stack_1", "shape": [2], "dtype": "int32"}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/embedding_lookup_sparse/strided_slice/stack_2", "shape": [2], "dtype": "int32"}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Slice_2/begin", "shape": [1], "dtype": "int32"}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/Slice_2/size", "shape": [1], "dtype": "int32"}, {"name": "linear/linear_model/linear/linear_model/linear/linear_model/content/weighted_sum/concat/axis", "shape": [], "dtype": "int32"}, {"name": "linear/linear_model/bias_weights", "shape": [54], "dtype": "float32", "quantization": {"dtype": "uint8", "min": -0.5752425799182816, "scale": 0.004754070908415551, "original_dtype": "float32"}}, {"name": "map_while_body_49115/add_1/y", "shape": [], "dtype": "int32"}, {"name": "map_while_body_49115/add/y", "shape": [], "dtype": "int32"}, {"name": "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice/stack", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice/stack_1", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice/stack_2", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_2/stack", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_2/stack_1", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_2/stack_2", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringNGrams/RaggedFromRowStarts/RowPartitionFromRowStarts/row_starts", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice/stack", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice/stack_1", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice/stack_2", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_2/stack", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_2/stack_1", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_2/stack_2", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/concat/values_0", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringsByteSplit/StringsByteSplit/strided_slice_1/stack", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringsByteSplit/StringsByteSplit/strided_slice_1/stack_1", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringsByteSplit/StringsByteSplit/strided_slice_1/stack_2", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Const", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Greater/y", "shape": [], "dtype": "int32"}, {"name": "map_while_body_49115/TensorArrayV2Read/Const", "shape": [0], "dtype": "int32"}, {"name": "map_while_body_49115/StringsByteSplit/StringsByteSplit/StringSplit/delimiter", "shape": [], "dtype": "string"}, {"name": "map_while_body_49115/StringsByteSplit/StringsByteSplit/strided_slice/stack", "shape": [2], "dtype": "int32"}, {"name": "map_while_body_49115/StringsByteSplit/StringsByteSplit/strided_slice/stack_1", "shape": [2], "dtype": "int32"}, {"name": "map_while_body_49115/StringsByteSplit/StringsByteSplit/strided_slice/stack_2", "shape": [2], "dtype": "int32"}, {"name": "map_while_body_49115/StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Const_1", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/add/y", "shape": [], "dtype": "int32"}, {"name": "map_while_body_49115/StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/bincount/Const_2", "shape": [0], "dtype": "int32"}, {"name": "map_while_body_49115/StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/Cumsum/axis", "shape": [], "dtype": "int32"}, {"name": "map_while_body_49115/StringsByteSplit/StringsByteSplit/RaggedFromValueRowIds/RowPartitionFromValueRowIds/concat/axis", "shape": [], "dtype": "int32"}, {"name": "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_1/stack", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_1/stack_1", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_1/stack_2", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_3/stack", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_3/stack_1", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_3/stack_2", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_4/Cast", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringsByteSplit/RaggedGetItem/strided_slice_5/Const", "shape": [0], "dtype": "int32"}, {"name": "map_while_body_49115/StringNGrams/RaggedFromRowStarts/strided_slice/stack", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringNGrams/RaggedFromRowStarts/strided_slice/stack_1", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringNGrams/RaggedFromRowStarts/strided_slice/stack_2", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringNGrams/RaggedFromRowStarts/RowPartitionFromRowStarts/concat/axis", "shape": [], "dtype": "int32"}, {"name": "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_1/stack", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_1/stack_1", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_1/stack_2", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_3/stack", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_3/stack_1", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_3/stack_2", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_4/Cast", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/StringNGrams/RaggedGetItem/strided_slice_5/Const", "shape": [0], "dtype": "int32"}, {"name": "map_while_body_49115/Const", "shape": [10000], "dtype": "string"}, {"name": "map_while_body_49115/concat/axis", "shape": [], "dtype": "int32"}, {"name": "map_while_body_49115/strided_slice/stack", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/strided_slice/stack_1", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/strided_slice/stack_2", "shape": [1], "dtype": "int32"}, {"name": "map_while_body_49115/ConstantFolding/StringsByteSplit/stack_const_axis", "shape": [], "dtype": "int32"}, {"name": "map_while_body_49115/ConstantFolding/StringsByteSplit/RaggedGetItem/strided_slice_4/stack_const_axis", "shape": [], "dtype": "int32"}, {"name": "map_while_body_49115/ConstantFolding/StringsByteSplit/RaggedGetItem/strided_slice_4/stack_1_const_axis", "shape": [], "dtype": "int32"}, {"name": "map_while_body_49115/ConstantFolding/StringNGrams/RaggedFromRowStarts/RowPartitionFromRowStarts/concat/values_1_const_axis", "shape": [], "dtype": "int32"}, {"name": "map_while_body_49115/ConstantFolding/StringNGrams/RaggedGetItem/strided_slice_4/stack_const_axis", "shape": [], "dtype": "int32"}, {"name": "map_while_body_49115/ConstantFolding/StringNGrams/RaggedGetItem/strided_slice_4/stack_1_const_axis", "shape": [], "dtype": "int32"}, {"name": "head/predictions/class_string_lookup/Const", "shape": [54], "dtype": "string"}, {"name": "head/predictions/class_string_lookup/Size", "shape": [], "dtype": "int32"}, {"name": "head/predictions/class_string_lookup/range/start", "shape": [], "dtype": "int32"}, {"name": "head/predictions/class_string_lookup/range/delta", "shape": [], "dtype": "int32"}]}]}/*! For license information please see index.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["vscode-languagedetection"]=t():e["vscode-languagedetection"]=t()}(this,(function(){return(()=>{var e={5528:(e,t,n)=>{"use strict";n.r(t),n.d(t,{MathBackendCPU:()=>i,shared:()=>r,version_cpu:()=>dt});var r={};n.r(r),n.d(r,{addImpl:()=>x,bincountImpl:()=>T,bincountReduceImpl:()=>_,ceilImpl:()=>$,concatImpl:()=>O,equalImpl:()=>B,expImpl:()=>R,expm1Impl:()=>L,floorImpl:()=>q,gatherNdImpl:()=>j,gatherV2Impl:()=>K,greaterEqualImpl:()=>Q,greaterImpl:()=>X,lessEqualImpl:()=>ae,lessImpl:()=>te,linSpaceImpl:()=>ie,logImpl:()=>ue,maxImpl:()=>pe,maximumImpl:()=>de,minimumImpl:()=>fe,multiplyImpl:()=>be,negImpl:()=>xe,notEqualImpl:()=>Se,prodImpl:()=>Me,rangeImpl:()=>De,rsqrtImpl:()=>Fe,sigmoidImpl:()=>Ce,simpleAbsImpl:()=>u,sliceImpl:()=>ze,sparseFillEmptyRowsImpl:()=>We,sparseReshapeImpl:()=>He,sparseSegmentReductionImpl:()=>qe,sqrtImpl:()=>Ge,squaredDifferenceImpl:()=>Ke,stridedSliceImpl:()=>Je,stringNGramsImpl:()=>Ye,stringSplitImpl:()=>tt,stringToHashBucketFastImpl:()=>nt,subImpl:()=>rt,tileImpl:()=>it,topKImpl:()=>ct,transposeImpl:()=>_e,uniqueImpl:()=>pt});var a=n(5363);function s(e,t){Array.isArray(e)||(e=[e]),e.forEach((e=>{null!=e&&a.util.assert("complex64"!==e.dtype,(()=>`${t} does not support complex64 tensors in the CPU backend.`))}))}const o=a.kernel_impls.whereImpl;class i extends a.KernelBackend{constructor(){super(),this.blockSize=48,this.firstUse=!0,this.data=new a.DataStorage(this,(0,a.engine)())}nextDataId(){return i.nextDataId++}write(e,t,n){this.firstUse&&(this.firstUse=!1,(0,a.env)().get("IS_NODE")&&a.backend_util.warn("\n============================\nHi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, which binds to TensorFlow C++, by running npm i @tensorflow/tfjs-node, or npm i @tensorflow/tfjs-node-gpu if you have CUDA. Then call require('@tensorflow/tfjs-node'); (-gpu suffix for CUDA) at the start of your program. Visit https://github.com/tensorflow/tfjs-node for more details.\n============================"));const r={id:this.nextDataId()};return this.data.set(r,{values:e,dtype:n,refCount:1}),r}makeTensorInfo(e,t,n){let r;if("string"===t&&null!=n&&n.length>0&&a.util.isString(n[0])){const s=n.map((e=>a.util.encodeString(e)));r=this.write(s,e,t)}else r=this.write(n,e,t);return{dataId:r,shape:e,dtype:t}}refCount(e){if(this.data.has(e)){return this.data.get(e).refCount}return 0}incRef(e){this.data.get(e).refCount++}decRef(e){if(this.data.has(e)){this.data.get(e).refCount--}}move(e,t,n,r,a){this.data.set(e,{values:t,dtype:r,refCount:a})}numDataIds(){return this.data.numDataIds()}async read(e){return this.readSync(e)}readSync(e){const{dtype:t,complexTensorInfos:n}=this.data.get(e);if("complex64"===t){const e=this.readSync(n.real.dataId),t=this.readSync(n.imag.dataId);return a.backend_util.mergeRealAndImagArrays(e,t)}return this.data.get(e).values}bufferSync(e){const t=this.readSync(e.dataId);let n=t;if("string"===e.dtype)try{n=t.map((e=>a.util.decodeString(e)))}catch(e){throw new Error("Failed to decode encoded string bytes into utf-8")}return(0,a.buffer)(e.shape,e.dtype,n)}makeOutput(e,t,n){const r=this.write(e,t,n);return(0,a.engine)().makeTensorFromDataId(r,t,n,this)}disposeData(e,t=!1){if(this.data.has(e)){if(this.data.get(e).refCount--,!t&&this.data.get(e).refCount>0)return!1;const{complexTensorInfos:n}=this.data.get(e);null!=n&&(this.disposeData(n.real.dataId,!0),this.disposeData(n.imag.dataId,!0)),this.data.delete(e)}return!0}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}async time(e){const t=a.util.now();e();return{kernelMs:a.util.now()-t}}memory(){return{unreliable:!0,reasons:["The reported memory is an upper bound. Due to automatic garbage collection, the true allocated memory may be less."]}}where(e){s([e],"where");const t=this.readSync(e.dataId);return o(e.shape,t)}dispose(){}floatPrecision(){return 32}epsilon(){return super.epsilon()}}function u(e){const t=new Float32Array(e.length);for(let n=0;n{const{x:t}=e.inputs,n=e.backend;s(t,"abs");let r=new Float32Array(a.util.sizeFromShape(t.shape));return r=u(n.data.get(t.dataId).values),n.makeOutput(r,t.shape,"float32")}};function c(e){return(t,n,r,s,o)=>{const i=a.backend_util.assertAndGetBroadcastShape(t,n),u=i.length,l=a.util.computeStrides(i),c=a.util.sizeFromShape(i),p=a.util.getTypedArrayFromDType(o,c),d=t.length,h=n.length,m=a.util.computeStrides(t),f=a.util.computeStrides(n),g=a.backend_util.getBroadcastDims(t,i),y=a.backend_util.getBroadcastDims(n,i);if(g.length+y.length===0)for(let t=0;to[e]=0));const i=a.util.locToIndex(o,d,m),c=n.slice(-h);y.forEach((e=>c[e]=0));const b=a.util.locToIndex(c,h,f);p[t]=e(r[i],s[b])}return[p,i]}}function p(e){const{inputs:t,backend:n}=e,{real:r,imag:a}=t,s=n.data.get(r.dataId).values,o=n.data.get(a.dataId).values,i=n.makeTensorInfo(r.shape,"complex64");return n.data.get(i.dataId).complexTensorInfos={real:n.makeTensorInfo(r.shape,"float32",s),imag:n.makeTensorInfo(a.shape,"float32",o)},i}const d={kernelName:a.Complex,backendName:"cpu",kernelFunc:p};function h(e,t,n="float32"){if("complex64"===n){return p({inputs:{real:h(e,t,"float32"),imag:h(e,t,"float32")},backend:e})}const r=a.util.makeZerosTypedArray(a.util.sizeFromShape(t),n);return e.makeTensorInfo(t,n,r)}function m(e){const{inputs:t,backend:n}=e,{x:r}=t;return n.incRef(r.dataId),{dataId:r.dataId,shape:r.shape,dtype:r.dtype}}const f={kernelName:a.Identity,backendName:"cpu",kernelFunc:m};function g(e){const{inputs:t,backend:n}=e,{input:r}=t,a=n.data.get(r.dataId).complexTensorInfos.real,s=n.data.get(a.dataId).values;return n.makeTensorInfo(a.shape,a.dtype,s)}const y={kernelName:a.Real,backendName:"cpu",kernelFunc:g};function b(e){const{inputs:t,backend:n,attrs:r}=e,{x:s}=t,{dtype:o}=r;if("complex64"===o){if("complex64"===s.dtype)return m({inputs:{x:s},backend:n});const e=h(n,s.shape,s.dtype),t=b({inputs:{x:s},backend:n,attrs:{dtype:"float32"}}),r=p({inputs:{real:t,imag:e},backend:n});return n.disposeIntermediateTensorInfo(e),n.disposeIntermediateTensorInfo(t),r}if("complex64"===s.dtype){const e=g({inputs:{input:s},backend:n}),t=b({inputs:{x:e},backend:n,attrs:{dtype:o}});return n.disposeIntermediateTensorInfo(e),t}if(!a.util.hasEncodingLoss(s.dtype,o)){const e=m({inputs:{x:s},backend:n});return{dataId:e.dataId,shape:e.shape,dtype:o}}if("int32"===o){const e=n.data.get(s.dataId).values,t=Int32Array.from(e);return n.makeTensorInfo(s.shape,"int32",t)}if("bool"===o){const e=n.data.get(s.dataId).values,t=a.util.toTypedArray([0],s.dtype),[r,o]=c(((e,t)=>e!==t?1:0))(s.shape,[],e,t,"bool");return n.makeTensorInfo(o,"bool",r)}throw new Error(`Error in Cast: failed to cast ${s.dtype} to ${o}`)}const k={kernelName:a.Cast,backendName:"cpu",kernelFunc:b};function w(e,t,n,r){return null==n?({inputs:n,backend:o})=>{const{a:i,b:u}=n,l=o;s([i,u],e);const c=l.data.get(i.dataId).values,p=l.data.get(u.dataId).values,d="string"===i.dtype?a.backend_util.fromUint8ToStringArray(c):c,h="string"===i.dtype?a.backend_util.fromUint8ToStringArray(p):p,m=r||i.dtype,[f,g]=t(i.shape,u.shape,d,h,m);return l.makeTensorInfo(g,m,f)}:({inputs:e,backend:a})=>{const{a:s,b:o}=e,i=a;if("complex64"===s.dtype||"complex64"===o.dtype){const e=b({inputs:{x:s},backend:i,attrs:{dtype:"complex64"}}),t=i.data.get(e.dataId),r=t.complexTensorInfos.real,a=t.complexTensorInfos.imag,u=i.data.get(r.dataId).values,l=i.data.get(a.dataId).values,c=b({inputs:{x:o},backend:i,attrs:{dtype:"complex64"}}),d=i.data.get(c.dataId),h=d.complexTensorInfos.real,m=d.complexTensorInfos.imag,f=i.data.get(h.dataId).values,g=i.data.get(m.dataId).values,[y,k,w]=n(s.shape,o.shape,u,l,f,g),v=i.makeTensorInfo(w,"float32",y),x=i.makeTensorInfo(w,"float32",k),N=p({inputs:{real:v,imag:x},backend:i});return i.disposeIntermediateTensorInfo(e),i.disposeIntermediateTensorInfo(c),i.disposeIntermediateTensorInfo(v),i.disposeIntermediateTensorInfo(x),N}{const e=i.data.get(s.dataId).values,n=i.data.get(o.dataId).values,a=r||s.dtype,[u,l]=t(s.shape,o.shape,e,n,a);return i.makeTensorInfo(l,a,u)}}}function v(e){return(t,n,r,s,o,i)=>{const u=a.backend_util.assertAndGetBroadcastShape(t,n),l=a.util.sizeFromShape(u),c=u.length,p=a.util.computeStrides(u),d=a.util.getTypedArrayFromDType("float32",l),h=a.util.getTypedArrayFromDType("float32",l),m=a.backend_util.getBroadcastDims(t,u),f=a.backend_util.getBroadcastDims(n,u),g=a.backend_util.mergeRealAndImagArrays(r,s),y=a.backend_util.mergeRealAndImagArrays(o,i),b=t.length,k=a.util.computeStrides(t),w=n.length,v=a.util.computeStrides(n);if(m.length+f.length===0)for(let t=0;tr[e]=0));const s=a.util.locToIndex(r,b,k),o=n.slice(-w);f.forEach((e=>o[e]=0));const i=a.util.locToIndex(o,w,v),u=e(g[2*s],g[2*s+1],y[2*i],y[2*i+1]);d[t]=u.real,h[t]=u.imag}return[d,h,u]}}const x=c(((e,t)=>e+t)),N=v(((e,t,n,r)=>({real:e+n,imag:t+r}))),S=w(a.Add,x,N),I={kernelName:a.Add,backendName:"cpu",kernelFunc:S};function T(e,t,n,r,s){const o=a.util.sizeFromShape(r),i=a.util.makeZerosTypedArray(s,n);for(let n=0;n=s||(i[r]+=o>0?t[n]:1)}return i}function _(e,t,n,r=!1){const s=e.shape[0],o=e.shape[1],i=(0,a.buffer)([s,n],t.dtype);for(let a=0;a=n||(r?i.set(1,a,o):t.size>0?i.set(i.get(a,o)+t.get(a,s),a,o):i.set(i.get(a,o)+1,a,o))}return i}function E(e){return(t,n,r)=>{const s=a.util.getTypedArrayFromDType(n,t.length);for(let n=0;n{const{x:u}=r;if(s(u,e),"string"===u.dtype||"string"===n)throw new Error("unaryKernelFunc does not support string input/output");const l=i,c=l.data.get(u.dataId).values,p=a.util.sizeFromShape(u.shape),d=n||u.dtype,h=a.util.getArrayFromDType(d,p);for(let e=0;e{const{x:i}=r;if(s(i,e),"string"===i.dtype||"string"===n)throw new Error("unaryKernelFunc does not support string input/output");const u=o,l=u.data.get(i.dataId).values,c=n||i.dtype,p=t(l,c,a);return u.makeTensorInfo(i.shape,c,p)}}const $=E((e=>Math.ceil(e))),D=M(a.Ceil,$),F={kernelName:a.Ceil,backendName:"cpu",kernelFunc:D};function O(e,t,n,r){const s=a.util.getArrayFromDType(n,a.util.sizeFromShape(t));if(r&&"string"!==n){let t=0;e.forEach((e=>{const n=a.util.sizeFromShape(e.shape);s.set(e.vals,t),t+=n}))}else{let r=0;e.forEach((e=>{const o="string"===n?a.backend_util.fromUint8ToStringArray(e.vals):e.vals;let i=0;for(let n=0;ne===t?1:0)),C=w(a.Equal,B,null,"bool"),V={kernelName:a.Equal,backendName:"cpu",kernelFunc:C},R=E((e=>Math.exp(e))),z=M(a.Exp,R),P={kernelName:a.Exp,backendName:"cpu",kernelFunc:z},L=E((e=>Math.expm1(e))),W=M(a.Expm1,L),H={kernelName:a.Expm1,backendName:"cpu",kernelFunc:W},q=E((e=>Math.floor(e))),G=M(a.Floor,q),U={kernelName:a.Floor,backendName:"cpu",kernelFunc:G};function j(e,t,n,r,s,o,i,u,l){const c=(0,a.buffer)([r,o],n);for(let n=0;n=l/o)throw new Error(`Invalid indices: ${r} does not index into ${u}`);for(let e=0;ee>t?1:0)),Z=w(a.Greater,X,null,"bool"),J={kernelName:a.Greater,backendName:"cpu",kernelFunc:Z},Q=c(((e,t)=>e>=t?1:0)),Y=w(a.GreaterEqual,Q,null,"bool"),ee={kernelName:a.GreaterEqual,backendName:"cpu",kernelFunc:Y},te=c(((e,t)=>ee<=t?1:0)),se=w(a.LessEqual,ae,null,"bool"),oe={kernelName:a.LessEqual,backendName:"cpu",kernelFunc:se};function ie(e,t,n){const r=(t-e)/(n-1),s=a.util.makeZerosTypedArray(n,"float32");s[0]=e;for(let e=1;eMath.log(e))),le=M(a.Log,ue),ce={kernelName:a.Log,backendName:"cpu",kernelFunc:le};function pe(e,t,n,r){const s=a.util.getTypedArrayFromDType(r,a.util.sizeFromShape(n));for(let n=0;na)&&(a=t)}s[n]=a}return s}const de=c(((e,t)=>Math.max(e,t))),he=w(a.Maximum,de),me={kernelName:a.Maximum,backendName:"cpu",kernelFunc:he},fe=c(((e,t)=>Math.min(e,t))),ge=w(a.Minimum,fe),ye={kernelName:a.Minimum,backendName:"cpu",kernelFunc:ge},be=c(((e,t)=>e*t)),ke=v(((e,t,n,r)=>({real:e*n-t*r,imag:e*r+t*n}))),we=w(a.Multiply,be,ke),ve={kernelName:a.Multiply,backendName:"cpu",kernelFunc:we};function xe(e,t,n){const r=a.util.createScalarValue(-1,n);return be([],t,r,e,n)}const Ne={kernelName:a.Neg,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:r}=t;s(r,"neg");const a=n.data.get(r.dataId).values,[o,i]=xe(a,r.shape,r.dtype);return n.makeTensorInfo(i,r.dtype,o)}},Se=c(((e,t)=>e!==t?1:0)),Ie=w(a.NotEqual,Se,null,"bool"),Te={kernelName:a.NotEqual,backendName:"cpu",kernelFunc:Ie};function _e(e,t,n,r,s){const o=t.length,i=a.util.sizeFromShape(t),u=a.util.computeStrides(t),l=a.util.computeStrides(s),c=a.util.getTypedArrayFromDType(n,a.util.sizeFromShape(s));for(let t=0;tn.disposeIntermediateTensorInfo(e))),n.makeTensorInfo(k,b,g)}};function De(e,t,n,r){if(e===t||e1)return a.util.makeZerosTypedArray(0,r);const s=Math.abs(Math.ceil((t-e)/n)),o=a.util.makeZerosTypedArray(s,r);t1/Math.sqrt(e))),Oe=M(a.Rsqrt,Fe),Be={kernelName:a.Rsqrt,backendName:"cpu",kernelFunc:Oe},Ce=E((e=>1/(1+Math.exp(-e)))),Ve=A(a.Sigmoid,(e=>1/(1+Math.exp(-e)))),Re={kernelName:a.Sigmoid,backendName:"cpu",kernelFunc:Ve};function ze(e,t,n,r,s){const o=a.slice_util.isSliceContinous(r,t,n),i=a.util.sizeFromShape(n),u=a.util.computeStrides(r);if(o){const n=a.slice_util.computeFlatOffset(t,u);return"string"===s?e.slice(n,n+i):e.subarray(n,n+i)}const l="string"===s?a.backend_util.fromUint8ToStringArray(e):e,c=(0,a.buffer)(r,s,l),p=(0,a.buffer)(n,s);for(let e=0;ee+t[n]));p.set(c.get(...r),...n)}return"string"===s?a.backend_util.fromStringArrayToUint8(p.values):p.values}function Pe(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{begin:i,size:u}=r;s(o,"slice");const[l,c]=a.slice_util.parseSliceParams(o,i,u);a.slice_util.assertParamsValid(o,l,c);const p=ze(n.data.get(o.dataId).values,l,c,o.shape,o.dtype);return n.makeTensorInfo(c,o.dtype,p)}const Le={kernelName:a.Slice,backendName:"cpu",kernelFunc:Pe};function We(e,t,n,r,s,o,i){const u=t[0],l=o[0],c=new Array(l),p=new Array(u),d=t[1];if(0===l){if(0!==u)throw new Error(`Received SparseTensor with denseShape[0] = 0 but\n indices.shape[0] = ${u}`);return[a.util.getArrayFromDType(n,0),[0,d],a.util.getArrayFromDType(s,0),c,p]}let h=!0,m=0;const f=new Array(l).fill(0);for(let t=0;t=l)throw new Error(`indices(${t}, 0) is invalid: ${n} >= ${l}`);++f[n],h=h&&n>=m,m=n}let g=!0;for(let e=0;e0&&(f[e]+=f[e-1])}if(g&&h){const t=e,n=r;for(let e=0;e0){m[h-1]=1;for(let e=h-2;e>=0;--e)m[e]=m[e+1]*r[e+1]}const f=[];if(u>0){f[u-1]=1;for(let e=u-2;e>=0;--e)f[e]=f[e+1]*l[e+1]}const g=a.util.getArrayFromDType(n,i*u);for(let t=0;t0?s[u-1]+1:0;if(p<0)throw new Error("segment ids must be >= 0");const d=t.slice();d[0]=p;const h=d.reduce(((e,t)=>e*t),1),m=a.util.getArrayFromDType(n,h);if(0===u)return p>0&&m.fill(i),[m,d];if(p<=0)throw new Error("segment ids must be >= 0");let f=0,g=1,y=0,b=s[f];for(;;){let t=0;if(g=t)throw new Error("segment ids are not increasing")}if(b<0||b>=p)throw new Error(`Segment id ${b} out of range [0, ${p}), possibly because segmentIds input is not sorted.`);b>y&&m.fill(i,y*c,b*c);for(let t=f;t=l[0])throw new Error(`Bad: indices[${t}] == ${r[t]} out of range [0, ${l[0]})`);for(let t=0;tu)break}return yMath.sqrt(e))),Ue=A(a.Sqrt,(e=>Math.sqrt(e))),je={kernelName:a.Sqrt,backendName:"cpu",kernelFunc:Ue},Ke=c(((e,t)=>{const n=e-t;return n*n})),Xe=w(a.SquaredDifference,Ke),Ze={kernelName:a.SquaredDifference,backendName:"cpu",kernelFunc:Xe};function Je(e,t,n,r){const s=(0,a.buffer)(e,t.dtype);for(let e=0;e0?0:o-i);let d=0;d+=u*this.leftPad.length;for(let t=0;te.forEach((e=>h[m++]=e));for(let e=0;e0){f(e[p+c-1]);for(let e=0;e0){let e=t[0];if(0!==e)throw new Error(`First split value must be 0, got ${e}`);for(let a=1;a=e;if(r=r&&t[a]<=n,!r)throw new Error(`Invalid split value ${t[a]}, must be in [${e}, ${n}]`);e=t[a]}if(e!==n)throw new Error(`Last split value must be data size. Expected ${n}, got ${e}`)}const s=r-1,o=a.util.getArrayFromDType("int32",r);if(0===n||0===r){const e=new Array(n);for(let e=0;e<=s;++e)o[e]=0;return[e,o]}o[0]=0;for(let e=1;e<=s;++e){const n=t[e]-t[e-1];let r=0;this.nGramWidths.forEach((e=>{r+=this.getNumNGrams(n,e)})),this.preserveShort&&n>0&&0===r&&(r=1),o[e]=o[e-1]+r}const i=new Array(o[s]);for(let n=0;n{const o=t[n+1]-t[n],u=this.getNumNGrams(o,s);this.createNGrams(e,r,i,a,u,s),a+=u})),this.preserveShort&&a===o[n]){const s=t[n+1]-t[n];if(0===s)continue;const o=s+2*this.padWidth,u=1;this.createNGrams(e,r,i,a,u,o)}}return[i,o]}}function Ye(e,t,n,r,a,s,o,i){return new Qe(n,r,a,s,o,i).compute(e,t)}function et(e,t,n,r){if(!e.length)return;if(0===t.length){for(let t=0;te-t)),at=v(((e,t,n,r)=>({real:e-n,imag:t-r}))),st=w(a.Sub,rt,at),ot={kernelName:a.Sub,backendName:"cpu",kernelFunc:st};function it(e,t){const n=new Array(e.rank);for(let r=0;r{const n=t.value-e.value;return 0===n?e.index-t.index:n};function lt(e,t,n=0,r=e.length-1){for(;r>n;){if(r-n>600){const a=r-n+1,s=t-n+1,o=Math.log(a),i=.5*Math.exp(2*o/3),u=.5*Math.sqrt(o*i*(a-i)/a)*Math.sign(s-a/2);lt(e,t,Math.max(n,Math.floor(t-s*i/a+u)),Math.min(r,Math.floor(t+(a-s)*i/a+u)))}const s=e[t];let o=n,i=r;for(a.util.swap(e,n,t),ut(e[r],s)>0&&a.util.swap(e,n,r);o0;)i-=1}0===ut(e[n],s)?a.util.swap(e,n,i):(i+=1,a.util.swap(e,i,r)),i<=t&&(n=i+1),t<=i&&(r=i-1)}}function ct(e,t,n,r,s){const o=t[t.length-1],[i,u]=[e.length/o,o],l=a.util.getTypedArrayFromDType(n,i*r),c=a.util.getTypedArrayFromDType("int32",i*r);for(let t=0;to[t]={value:e,index:t})),r{for(let n=0;nnew i),1);const ht=A(a.Elu,(e=>e>=0?e:Math.exp(e)-1)),mt={kernelName:a.Elu,backendName:"cpu",kernelFunc:ht};function ft(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{alpha:i}=r;s([o],"leakyRelu");const u=a.util.sizeFromShape(o.shape),l=n.data.get(o.dataId).values,c=a.util.getTypedArrayFromDType("float32",u);for(let e=0;ee<0?t*e:e));function bt(e){const{inputs:t,backend:n}=e,{x:r,alpha:a}=t;s([r,a],"prelu");const o=n.data.get(r.dataId).values,i=n.data.get(a.dataId).values,[u,l]=yt(r.shape,a.shape,o,i,r.dtype);return n.makeTensorInfo(l,r.dtype,u)}const kt={kernelName:a.Prelu,backendName:"cpu",kernelFunc:bt},wt=A(a.Relu,(e=>Math.max(0,e))),vt={kernelName:a.Relu,backendName:"cpu",kernelFunc:wt},xt=A(a.Relu6,(e=>Math.min(Math.max(0,e),6))),Nt={kernelName:a.Relu6,backendName:"cpu",kernelFunc:xt};function St(e,t,n,r,a){if("linear"===n)return m({inputs:{x:t},backend:e});if("relu"===n)return wt({inputs:{x:t},backend:e});if("elu"===n)return ht({inputs:{x:t},backend:e});if("relu6"===n)return xt({inputs:{x:t},backend:e});if("prelu"===n)return bt({inputs:{x:t,alpha:r},backend:e});if("leakyrelu"===n)return ft({inputs:{x:t},backend:e,attrs:{alpha:a}});if("sigmoid"===n)return Ve({inputs:{x:t},backend:e});throw new Error(`Activation ${n} has not been implemented for the CPU backend.`)}function It(e){const{inputs:t,backend:n,attrs:r}=e,{x:s}=t,{shape:o}=r,i=a.util.sizeFromShape(s.shape),u=a.util.inferFromImplicitShape(o,i),l=a.util.sizeFromShape(u);a.util.assert(i===l,(()=>`The new shape (${u}) has ${l} elements and the old shape (${s.shape}) has ${i} elements. The new shape and old shape must have the same number of elements.`)),n.incRef(s.dataId);const c=n.data.get(s.dataId);if(null!=c.complexTensorInfos){const e=c.complexTensorInfos.real,t=c.complexTensorInfos.imag;e.shape=u,t.shape=u}return{dataId:s.dataId,shape:u,dtype:s.dtype}}const Tt={kernelName:a.Reshape,backendName:"cpu",kernelFunc:It};function _t(e){const{inputs:t,backend:n,attrs:r}=e,{a:o,b:i}=t,{transposeA:u,transposeB:l}=r;s([o,i],"matMul");const c=o.shape.length,p=i.shape.length,d=u?o.shape[c-2]:o.shape[c-1],h=l?i.shape[p-1]:i.shape[p-2],m=u?o.shape[c-1]:o.shape[c-2],f=l?i.shape[p-2]:i.shape[p-1],g=o.shape.slice(0,-2),y=i.shape.slice(0,-2),b=a.util.sizeFromShape(g),k=a.util.sizeFromShape(y),w=b===k||1===b||1===k;a.util.assert(c>=2&&p>=2&&w,(()=>`Error in matMul: the input batch dimensions must either be the same or at least one input batch dimension must be 1. Got input batch dimensions of (${g}) and (${y}).`));const v=(b>k?o.shape.slice(0,-2):i.shape.slice(0,-2)).concat([m,f]);a.util.assert(d===h,(()=>`Error in matMul: inner shapes (${d}) and (${h}) of Tensors with shapes ${o.shape} and ${i.shape} and transposeA=${u} and transposeB=${l} must match.`));const x=l?[k,f,h]:[k,h,f],N=It({inputs:{x:o},backend:n,attrs:{shape:u?[b,d,m]:[b,m,d]}}),S=It({inputs:{x:i},backend:n,attrs:{shape:x}}),I=u?N.shape[1]:N.shape[2],T=u?N.shape[2]:N.shape[1],_=l?S.shape[1]:S.shape[2],E=Math.max(b,k),A=n.data.get(N.dataId).values,M=n.data.get(S.dataId).values,$=a.util.computeStrides(N.shape),D=a.util.computeStrides(S.shape),[F,O,B]=u?[$[0],1,$[1]]:[$[0],$[1],1],[C,V,R]=l?[1,D[1],D[0]]:[D[1],1,D[0]],z=T*_,P=(0,a.buffer)([E,T,_],N.dtype),L=P.values,W=n.blockSize;for(let e=0;eMath.acos(e))),$t={kernelName:a.Acos,backendName:"cpu",kernelFunc:Mt},Dt=A(a.Acosh,(e=>Math.acosh(e))),Ft={kernelName:a.Acosh,backendName:"cpu",kernelFunc:Dt};const Ot={kernelName:a.AddN,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,r=t;s(t,"addN");const o=r.map((e=>n.data.get(e.dataId).values)),i=(0,a.buffer)(r[0].shape,r[0].dtype),u=i.values;for(let e=0;en&&(n=a,r=e)}f[e]=r}return p.forEach((e=>n.disposeIntermediateTensorInfo(e))),n.makeTensorInfo(d,"int32",f)}};const Rt={kernelName:a.ArgMin,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{axis:i}=r;s(o,"argMin");let u=a.util.parseAxisParam(i,o.shape);const l=a.backend_util.getAxesPermutation(u,o.shape.length);let c=o;const p=[];null!=l&&(c=Ee({inputs:{x:o},backend:n,attrs:{perm:l}}),p.push(c),u=a.backend_util.getInnerMostAxes(u.length,c.shape.length)),u=[u[0]],a.backend_util.assertAxesAreInnerMostDims("argMin",u,c.shape.length);const[d,h]=a.backend_util.computeOutAndReduceShapes(c.shape,u),m=a.util.sizeFromShape(d),f=a.util.makeZerosTypedArray(m,"int32"),g=a.util.sizeFromShape(h),y=n.data.get(c.dataId).values;for(let e=0;en.disposeIntermediateTensorInfo(e))),n.makeTensorInfo(d,"int32",f)}},zt=A(a.Asin,(e=>Math.asin(e))),Pt={kernelName:a.Asin,backendName:"cpu",kernelFunc:zt},Lt=A(a.Asinh,(e=>Math.asinh(e))),Wt={kernelName:a.Asinh,backendName:"cpu",kernelFunc:Lt},Ht=A(a.Atan,(e=>Math.atan(e))),qt={kernelName:a.Atan,backendName:"cpu",kernelFunc:Ht},Gt=c(((e,t)=>Math.atan2(e,t))),Ut=w(a.Atan2,Gt),jt={kernelName:a.Atan2,backendName:"cpu",kernelFunc:Ut},Kt=A(a.Atanh,(e=>Math.atanh(e))),Xt={kernelName:a.Atanh,backendName:"cpu",kernelFunc:Kt};function Zt(e,t,n,r,s,o){const i=s.strideHeight,u=s.strideWidth,l=s.dilationHeight,c=s.dilationWidth,p=s.effectiveFilterHeight,d=s.effectiveFilterWidth,h=s.padInfo.top,m=s.padInfo.left,f="max"===o?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,g=(0,a.buffer)(s.outShape,n),y=g.values,b=s.outShape[1]*s.outShape[2]*s.outShape[3],k=s.outShape[2]*s.outShape[3],w=s.outShape[3];for(let t=0;tg?g=a:"avg"===o&&(b+=a,k++)}if(isNaN(g))break}y[N+n*w+t]="avg"===o?b/k:g}}}return g}function Jt(e,t,n,r,s=!1,o=!1){const i=(0,a.buffer)(r.outShape,"int32"),u=r.strideHeight,l=r.strideWidth,c=r.dilationHeight,p=r.dilationWidth,d=r.effectiveFilterHeight,h=r.effectiveFilterWidth,m=r.padInfo.top,f=r.padInfo.left,g=(0,a.buffer)(t,n,e);for(let e=0;ew&&(w=l,v=s?o?((e*r.inHeight+n)*r.inWidth+a)*r.inChannels+t:(n*r.inWidth+a)*r.inChannels+t:i*h+u)}}i.set(v,e,n,u,t)}}return i}function Qt(e,t,n,r,s,o){const i=s.strideDepth,u=s.strideHeight,l=s.strideWidth,c=s.dilationDepth,p=s.dilationHeight,d=s.dilationWidth,h=s.effectiveFilterDepth,m=s.effectiveFilterHeight,f=s.effectiveFilterWidth,g=s.padInfo.front,y=s.padInfo.top,b=s.padInfo.left,k="max"===o?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,w=(0,a.buffer)(s.outShape,n),v=w.values,x=s.outShape[1]*s.outShape[2]*s.outShape[3]*s.outShape[4],N=s.outShape[2]*s.outShape[3]*s.outShape[4],S=s.outShape[3]*s.outShape[4],I=s.outShape[4];for(let t=0;tx?x=s:"avg"===o&&(N+=s,S++),isNaN(x))break}if(isNaN(x))break}if(isNaN(x))break}v[y+t]="avg"===o?N/S:x}}}}return w}const Yt={kernelName:a.AvgPool,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t;s(o,"avgPool");const{filterSize:i,strides:u,pad:l,dimRoundingMode:c}=r;a.util.assert(a.backend_util.eitherStridesOrDilationsAreOne(u,1),(()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${u} and dilations '1'`));const p=a.backend_util.computePool2DInfo(o.shape,i,u,1,l,c);let d;if(1===p.filterWidth&&1===p.filterHeight&&a.util.arraysEqual(p.inShape,p.outShape))d=m({inputs:{x:o},backend:n});else{const e=n.data.get(o.dataId).values,t=a.util.computeStrides(o.shape),r=Zt(e,o.shape,o.dtype,t,p,"avg");d=n.makeTensorInfo(p.outShape,o.dtype,r.values)}return d}};const en={kernelName:a.AvgPool3D,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{filterSize:i,strides:u,pad:l,dimRoundingMode:c,dataFormat:p}=r;s(o,"avgPool3d");const d=a.backend_util.computePool3DInfo(o.shape,i,u,1,l,c,p),h=Qt(n.data.get(o.dataId).values,o.shape,o.dtype,a.util.computeStrides(o.shape),d,"avg");return n.makeTensorInfo(h.shape,"float32",h.values)}};const tn={kernelName:a.AvgPool3DGrad,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{dy:o,input:i}=t,{filterSize:u,strides:l,pad:c,dimRoundingMode:p}=r;s([o,i],"avgPool3DGrad");const d=a.backend_util.computePool3DInfo(i.shape,u,l,1,c,p),h=d.strideDepth,m=d.strideHeight,f=d.strideWidth,g=d.filterDepth,y=d.filterHeight,b=d.filterWidth,k=d.dilationDepth,w=d.dilationHeight,v=d.dilationWidth,x=d.effectiveFilterDepth,N=d.effectiveFilterHeight,S=d.effectiveFilterWidth,I=x-1-d.padInfo.front,T=S-1-d.padInfo.left,_=N-1-d.padInfo.top,E=(0,a.buffer)(i.shape,"float32"),A=1/(g*y*b),M=n.bufferSync(o);for(let e=0;e=d.outDepth||Math.floor(r)!==r))for(let n=0;n=d.outHeight||Math.floor(a)!==a))for(let n=0;n=d.outWidth||Math.floor(s)!==s)continue;u+=M.get(e,r,a,s,t)}}}E.set(u*A,e,n,r,a,t)}return n.makeTensorInfo(E.shape,E.dtype,E.values)}};const nn={kernelName:a.AvgPoolGrad,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{dy:o,input:i}=t,u=i;s([o,i],"avgPoolGrad");const{filterSize:l,strides:c,pad:p}=r,d=a.backend_util.computePool2DInfo(u.shape,l,c,1,p),h=d.strideHeight,m=d.strideWidth,f=d.filterHeight,g=d.filterWidth,y=d.dilationHeight,b=d.dilationWidth,k=d.effectiveFilterHeight,w=d.effectiveFilterWidth,v=w-1-d.padInfo.left,x=k-1-d.padInfo.top,N=(0,a.buffer)(u.shape,"float32"),S=1/(f*g),I=n.data.get(o.dataId).values,T=(0,a.buffer)(o.shape,"float32",I);for(let e=0;e=d.outHeight||Math.floor(r)!==r))for(let n=0;n=d.outWidth||Math.floor(a)!==a)continue;o+=T.get(e,r,a,t)}}N.set(o*S,e,n,r,t)}return n.makeTensorInfo(N.shape,N.dtype,N.values)}};const rn={kernelName:a.FusedBatchNorm,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o,scale:i,offset:u,mean:l,variance:c}=t;a.util.assert(l.shape.length===c.shape.length,(()=>"Batch normalization gradient requires mean and variance to have equal ranks.")),a.util.assert(null==u||l.shape.length===u.shape.length,(()=>"Batch normalization gradient requires mean and offset to have equal ranks.")),a.util.assert(null==i||l.shape.length===i.shape.length,(()=>"Batch normalization gradient requires mean and scale to have equal ranks.")),s([o,l,c,i,u],"batchNorm");let{varianceEpsilon:p}=r;null==p&&(p=.001);const d=n.data.get(o.dataId).values,h=n.data.get(l.dataId).values,m=n.data.get(c.dataId).values,f=i?n.data.get(i.dataId).values:new Float32Array([1]),g=u?n.data.get(u.dataId).values:new Float32Array([0]),y=new Float32Array(d.length),b=g.length,k=f.length,w=m.length,v=h.length;let x=0,N=0,S=0,I=0;for(let e=0;e=b&&(x=0),N>=v&&(N=0),S>=k&&(S=0),I>=w&&(I=0);return n.makeTensorInfo(o.shape,o.dtype,y)}};const an={kernelName:a.BatchToSpaceND,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{blockShape:i,crops:u}=r;s([o],"batchToSpaceND");const l=i.reduce(((e,t)=>e*t)),c=a.backend_util.getReshaped(o.shape,i,l),p=a.backend_util.getPermuted(c.length,i.length),d=a.backend_util.getReshapedPermuted(o.shape,i,l),h=a.backend_util.getSliceBeginCoords(u,i.length),m=a.backend_util.getSliceSize(d,u,i.length),f=It({inputs:{x:o},backend:n,attrs:{shape:c}}),g=Ee({inputs:{x:f},backend:n,attrs:{perm:p}}),y=It({inputs:{x:g},backend:n,attrs:{shape:d}}),b=Pe({inputs:{x:y},backend:n,attrs:{begin:h,size:m}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(g),n.disposeIntermediateTensorInfo(y),b}};const sn={kernelName:a.Bincount,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:a,weights:s}=t,{size:o}=r,i=T(n.data.get(a.dataId).values,n.data.get(s.dataId).values,s.dtype,s.shape,o);return n.makeTensorInfo([o],s.dtype,i)}};const on={kernelName:a.BroadcastArgs,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{s0:r,s1:s}=t,o=n.data.get(r.dataId).values,i=n.data.get(s.dataId).values,u=a.backend_util.assertAndGetBroadcastShape(Array.from(o),Array.from(i));return n.makeTensorInfo([u.length],"int32",Int32Array.from(u))}},un=A(a.ClipByValue,((e,t)=>{const n=t;return e>n.clipValueMax?n.clipValueMax:e{const{x:t}=e.inputs,n=e.backend,r=new Float32Array(a.util.sizeFromShape(t.shape)),s=n.data.get(t.dataId),o=s.complexTensorInfos.real,i=s.complexTensorInfos.imag,u=n.data.get(o.dataId).values,l=n.data.get(i.dataId).values;for(let e=0;ee.shape)),o);if(0===a.util.sizeFromShape(i))return n.makeTensorInfo(i,t[0].dtype,[]);const u=t.filter((e=>a.util.sizeFromShape(e.shape)>0));if(1===u.length)return m({inputs:{x:u[0]},backend:n});const l=u.map((e=>e.shape));if(a.backend_util.assertParamsConsistent(l,o),"complex64"===u[0].dtype){const e=u.map((e=>g({inputs:{input:e},backend:n}))),t=u.map((e=>pn({inputs:{input:e},backend:n}))),r=hn({inputs:e,backend:n,attrs:{axis:o}}),a=hn({inputs:t,backend:n,attrs:{axis:o}}),s=p({inputs:{real:r,imag:a},backend:n});return e.forEach((e=>n.disposeIntermediateTensorInfo(e))),t.forEach((e=>n.disposeIntermediateTensorInfo(e))),n.disposeIntermediateTensorInfo(r),n.disposeIntermediateTensorInfo(a),s}const c=u.map((e=>{const t=a.util.sizeFromShape(e.shape.slice(o));return It({inputs:{x:e},backend:n,attrs:{shape:[-1,t]}})})),d=c.map((e=>({vals:n.data.get(e.dataId).values,shape:e.shape})));i=a.backend_util.computeOutShape(c.map((e=>e.shape)),1);const h=1===c[0].shape[0],f=O(d,i,t[0].dtype,h),y=a.backend_util.computeOutShape(u.map((e=>e.shape)),o),b=n.makeTensorInfo(y,t[0].dtype,f);return c.forEach((e=>n.disposeIntermediateTensorInfo(e))),b}const mn={kernelName:a.Concat,backendName:"cpu",kernelFunc:hn};function fn(e){const{inputs:t,backend:n,attrs:r}=e,{x:o,filter:i}=t,{strides:u,pad:l,dataFormat:c,dilations:p,dimRoundingMode:d}=r;s([o,i],"conv2d");const h=a.backend_util.convertConv2DDataFormat(c),m=a.backend_util.computeConv2DInfo(o.shape,i.shape,u,p,l,d,!1,h),f=m.filterHeight,g=m.filterWidth,y=m.dilationHeight,b=m.dilationWidth,k=m.padInfo.left,w=m.padInfo.top,v="channelsLast"===m.dataFormat,x=new a.TensorBuffer(m.outShape,o.dtype),N=a.util.computeStrides(o.shape),S=a.util.computeStrides(i.shape),I=N[0],T=v?N[1]:N[2],_=v?N[2]:1,E=v?1:N[1],A=x.strides[0],M=v?x.strides[1]:x.strides[2],$=v?x.strides[2]:1,D=v?1:x.strides[1],F=n.data.get(o.dataId).values,O=n.data.get(i.dataId).values,B=x.values;for(let e=0;e=m.inHeight)continue;const s=e*S[0],o=t+n*T;for(let e=0;e=m.inWidth)continue;const a=o+r*_;let i=s+e*S[1];for(let e=0;e=p.inDepth)continue;const s=e*_[0],o=t+n*T[1];for(let e=0;e=p.inHeight)continue;const a=s+e*_[1],i=o+r*T[2];for(let e=0;e=p.inWidth)continue;const s=a+e*_[2],o=i+t*p.inChannels;let u=s;for(let e=0;eMath.cos(e))),Nn={kernelName:a.Cos,backendName:"cpu",kernelFunc:xn},Sn=A(a.Cosh,(e=>Math.cosh(e))),In={kernelName:a.Cosh,backendName:"cpu",kernelFunc:Sn};const Tn={kernelName:a.CropAndResize,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{image:s,boxes:o,boxInd:i}=t,{cropSize:u,method:l,extrapolationValue:c}=r,[p,d,h,m]=s.shape,f=o.shape[0],[g,y]=u,b=(0,a.buffer)([f,g,y,m],"float32"),k=n.data.get(o.dataId).values,w=n.data.get(i.dataId).values,v=n.data.get(s.dataId).values,x=a.util.computeStrides(s.shape),N=a.util.computeStrides(b.shape);for(let e=0;e=p)continue;const i=g>1?(a-n)*(d-1)/(g-1):0,u=y>1?(s-r)*(h-1)/(y-1):0;for(let t=0;t1?n*(d-1)+t*i:.5*(n+a)*(d-1);if(p<0||p>d-1)for(let n=0;n1?r*(h-1)+l*u:.5*(r+s)*(h-1);if(p<0||p>h-1){for(let n=0;n1?r*(h-1)+n*u:.5*(r+s)*(h-1);if(a<0||a>h-1){for(let r=0;re+g-t-1:(e,t)=>e+t;for(let e=0;e`Only NHWC dataFormat supported on CPU for depthToSpace. Got ${i}`)),a.util.assert(o>1,(()=>`blockSize should be > 1 for depthToSpace, but was: ${o}`));const u=s.shape[0],l=s.shape[1],c=s.shape[2],p=s.shape[3],d=l*o,h=c*o,m=p/(o*o),f=n.data.get(s.dataId).values,g=new Float32Array(u*d*h*m);let y=0;for(let e=0;e`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${u} and dilations '${m}'`));const f=a.backend_util.computeConv2DInfo(o.shape,i.shape,u,m,l,p,!0),{filterHeight:g,filterWidth:y,dilationHeight:b,dilationWidth:k,padInfo:w}=f,v=w.left,x=w.top,N=f.outChannels/f.inChannels,S=new a.TensorBuffer(f.outShape,o.dtype),I=n.data.get(o.dataId).values,T=n.data.get(i.dataId).values,_=S.values;for(let e=0;e=f.inHeight)continue;const s=e*h[0],o=t+n*d[1];for(let e=0;e=f.inWidth)continue;const a=s+e*h[1],i=o+r*f.inChannels;let u=t,l=a;for(let e=0;e{const{x:r,filter:s}=e,{strides:o,pad:i,dilations:u}=n,l=t,c=l.data.get(r.dataId).values,p=r.shape.length,d=l.data.get(s.dataId).values,h=s.shape.length,{batchSize:m,inHeight:f,inWidth:g,inChannels:y,outHeight:b,outWidth:k,padInfo:w,strideHeight:v,strideWidth:x,filterHeight:N,filterWidth:S,dilationHeight:I,dilationWidth:T,outShape:_}=a.backend_util.computeDilation2DInfo(r.shape,s.shape,o,i,"NHWC",u),E=a.util.sizeFromShape(_),A=_.length,M=a.util.getArrayFromDType(r.dtype,E);for(let e=0;e=0&&o=0&&ml&&(l=g)}}}M[a.util.locToIndex([e,t,o,u],A,a.util.computeStrides(_))]=l}}}return{dataId:l.write(a.util.toTypedArray(M,r.dtype),_,r.dtype),shape:_,dtype:r.dtype}}},Cn={kernelName:a.Dilation2DBackpropFilter,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:r,filter:s,dy:o}=e,{strides:i,pad:u,dilations:l}=n,c=t,p=a.util.toNestedArray(r.shape,c.data.get(r.dataId).values),d=a.util.toNestedArray(s.shape,c.data.get(s.dataId).values),{batchSize:h,inHeight:m,inWidth:f,inChannels:g,outHeight:y,outWidth:b,padInfo:k,strideHeight:w,strideWidth:v,filterHeight:x,filterWidth:N,dilationHeight:S,dilationWidth:I,outShape:T}=a.backend_util.computeDilation2DInfo(r.shape,s.shape,i,u,"NHWC",l);a.util.assert(o.rank===T.length,(()=>`Error in ${a.Dilation2DBackpropFilter}, dy must have the same rank as output ${T.length}, but got ${o.rank}`));const _=a.util.toNestedArray(T,c.data.get(o.dataId).values),E=a.util.makeZerosNestedTypedArray(s.shape,s.dtype);for(let e=0;e=0&&r=0&&lo&&(o=a,i=t,u=n)}}}E[i][u][s]+=_[e][t][r][s]}}}return{dataId:c.write(a.util.toTypedArray(E,r.dtype),s.shape,s.dtype),shape:s.shape,dtype:s.dtype}}},Vn={kernelName:a.Dilation2DBackpropInput,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:r,filter:s,dy:o}=e,{strides:i,pad:u,dilations:l}=n,c=t,p=a.util.toNestedArray(r.shape,c.data.get(r.dataId).values),d=a.util.toNestedArray(s.shape,c.data.get(s.dataId).values),{batchSize:h,inHeight:m,inWidth:f,inChannels:g,outHeight:y,outWidth:b,padInfo:k,strideHeight:w,strideWidth:v,filterHeight:x,filterWidth:N,dilationHeight:S,dilationWidth:I,outShape:T}=a.backend_util.computeDilation2DInfo(r.shape,s.shape,i,u,"NHWC",l);a.util.assert(o.rank===T.length,(()=>`Error in ${a.Dilation2DBackpropInput}, dy must have the same rank as output ${T.length}, but got ${o.rank}`));const _=a.util.toNestedArray(T,c.data.get(o.dataId).values),E=a.util.makeZerosNestedTypedArray(r.shape,r.dtype);for(let e=0;e=0&&r=0&&lo&&(o=a,i=r,u=l)}}}E[e][i][u][s]+=_[e][t][r][s]}}}return{dataId:c.write(a.util.toTypedArray(E,r.dtype),r.shape,r.dtype),shape:r.shape,dtype:r.dtype}}};function Rn(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{axis:i,keepDims:u}=r;let l;s(o,"sum"),l="bool"===o.dtype?b({inputs:{x:o},backend:n,attrs:{dtype:"int32"}}):m({inputs:{x:o},backend:n});const c=l.shape.length,p=a.util.parseAxisParam(i,l.shape),d=a.backend_util.getAxesPermutation(p,c);let f=p,g=l;null!=d&&(g=Ee({inputs:{x:l},backend:n,attrs:{perm:d}}),f=a.backend_util.getInnerMostAxes(f.length,c)),a.backend_util.assertAxesAreInnerMostDims("sum",f,g.shape.length);const[y,k]=a.backend_util.computeOutAndReduceShapes(g.shape,f);let w=h(n,y,a.backend_util.upcastType(g.dtype,"int32"));const v=a.util.sizeFromShape(k),x=n.data.get(w.dataId).values,N=n.data.get(g.dataId).values;for(let e=0;e=0&&(h=Rn({inputs:{x:h},backend:n,attrs:{axis:c[e]-(i.length-m),keepDims:!1}}),f.push(h)),m--)}for(const e of f)e!==h&&n.disposeIntermediateTensorInfo(e);return h}};const Ln={kernelName:a.EluGrad,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{dy:r,y:o}=t;s([r,o],"eluGrad");const i=new Float32Array(a.util.sizeFromShape(o.shape)),u=n.data.get(o.dataId).values,l=n.data.get(r.dataId).values;for(let e=0;e=1?l[e]:l[e]*(t+1)}return n.makeTensorInfo(o.shape,"float32",i)}},Wn=a.backend_util.ERF_P,Hn=a.backend_util.ERF_A1,qn=a.backend_util.ERF_A2,Gn=a.backend_util.ERF_A3,Un=a.backend_util.ERF_A4,jn=a.backend_util.ERF_A5,Kn=A(a.Erf,(e=>{const t=Math.sign(e),n=Math.abs(e),r=1/(1+Wn*n);return t*(1-((((jn*r+Un)*r+Gn)*r+qn)*r+Hn)*r*Math.exp(-n*n))})),Xn={kernelName:a.Erf,backendName:"cpu",kernelFunc:Kn};function Zn(e){const{inputs:t,backend:n,attrs:r}=e,{input:s}=t,{dim:o}=r,i=s.shape.length,u=s.shape.slice();let l=o;return o<0&&(a.util.assert(-(i+1)<=o,(()=>`Axis must be in the interval [${-(i+1)}, ${i}]`)),l=i+o+1),u.splice(l,0,1),It({inputs:{x:s},backend:n,attrs:{shape:u}})}const Jn={kernelName:a.ExpandDims,backendName:"cpu",kernelFunc:Zn},Qn=c(((e,t)=>e/t)),Yn=w(a.RealDiv,Qn),er={kernelName:a.RealDiv,backendName:"cpu",kernelFunc:Yn};function tr(e,t,n){const r=e.shape,s=r[0],o=r[1],i=n.data.get(e.dataId),u=i.complexTensorInfos.real,l=i.complexTensorInfos.imag,c=[s,o],d=a.util.sizeFromShape(c),h=a.util.getTypedArrayFromDType("float32",d),m=a.util.getTypedArrayFromDType("float32",d);for(let e=0;e{const{image:r}=e,s=n,o=a.util.getTypedArrayFromDType(r.dtype,a.util.sizeFromShape(r.shape)),[i,u,l,c]=r.shape,p=s.data.get(r.dataId).values;for(let e=0;e=0&&sMath.floor(e/t))),lr=w(a.FloorDiv,ur,null,"int32"),cr={kernelName:a.FloorDiv,backendName:"cpu",kernelFunc:lr};const pr={kernelName:a.FusedConv2D,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:a,filter:s,bias:o,preluActivationWeights:i}=t,{strides:u,pad:l,dataFormat:c,dilations:p,dimRoundingMode:d,activation:h,leakyreluAlpha:m}=r;let f=fn({inputs:{x:a,filter:s},backend:n,attrs:{strides:u,pad:l,dataFormat:c,dilations:p,dimRoundingMode:d}});if(o){const e=f;f=S({inputs:{a:f,b:o},backend:n}),n.disposeIntermediateTensorInfo(e)}if(h){const e=f;f=St(n,f,h,i,m),n.disposeIntermediateTensorInfo(e)}return f}};const dr={kernelName:a.FusedDepthwiseConv2D,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:a,filter:s,bias:o,preluActivationWeights:i}=t,{strides:u,pad:l,dataFormat:c,dilations:p,dimRoundingMode:d,activation:h,leakyreluAlpha:m}=r;let f=Mn({inputs:{x:a,filter:s},backend:n,attrs:{strides:u,pad:l,dataFormat:c,dilations:p,dimRoundingMode:d}});if(o){const e=f;f=S({inputs:{a:f,b:o},backend:n}),n.disposeIntermediateTensorInfo(e)}if(h){const e=f;f=St(n,f,h,i,m),n.disposeIntermediateTensorInfo(e)}return f}};const hr={kernelName:a.GatherNd,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{params:r,indices:s}=t,o=a.util.sizeFromShape(r.shape),i=s.shape,u=i[i.length-1],[l,c,p,d]=a.backend_util.prepareAndValidate(r,s);if(0===c)return n.makeTensorInfo(l,r.dtype,[]);const h=j(n.data.get(s.dataId).values,n.bufferSync(r),r.dtype,c,u,p,d,r.shape,o);return n.makeTensorInfo(l,r.dtype,h.values)}};const mr={kernelName:a.GatherV2,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o,indices:i}=t,{axis:u,batchDims:l}=r;s([o,i],"gatherV2");let c=l;null==l&&(c=0);const p=a.util.sizeFromShape(i.shape),d=a.util.parseAxisParam(u,o.shape)[0],h=a.backend_util.segment_util.collectGatherOpShapeInfo(o,i,d,c),m=It({inputs:{x:o},backend:n,attrs:{shape:[h.batchSize,h.outerSize,h.dimSize,h.sliceSize]}}),f=It({inputs:{x:i},backend:n,attrs:{shape:[h.batchSize,p/h.batchSize]}}),g=[h.batchSize,h.outerSize,p/h.batchSize,h.sliceSize],y=n.bufferSync(f),b=K(n.bufferSync(m),y,g);return n.disposeIntermediateTensorInfo(m),n.disposeIntermediateTensorInfo(f),n.makeTensorInfo(h.outputShape,b.dtype,b.values)}};const fr={kernelName:a.IFFT,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{input:r}=t,s=a.util.sizeFromShape(r.shape),o=r.shape[r.shape.length-1],i=It({inputs:{x:r},backend:n,attrs:{shape:[s/o,o]}}),u=tr(i,!0,n),l=It({inputs:{x:u},backend:n,attrs:{shape:r.shape}});return n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(u),l}},gr=A(a.IsFinite,(e=>Number.isFinite(e)?1:0),"bool"),yr={kernelName:a.IsFinite,backendName:"cpu",kernelFunc:gr},br=A(a.IsInf,(e=>Math.abs(e)===1/0?1:0),"bool"),kr={kernelName:a.IsInf,backendName:"cpu",kernelFunc:br},wr=A(a.IsNan,(e=>Number.isNaN(e)?1:0),"bool"),vr={kernelName:a.IsNan,backendName:"cpu",kernelFunc:wr};const xr={kernelName:a.LinSpace,backendName:"cpu",kernelFunc:function(e){const{backend:t,attrs:n}=e,{start:r,stop:a,num:s}=n,o=ie(r,a,s);return t.makeTensorInfo([o.length],"float32",o)}},Nr=A(a.Log1p,(e=>Math.log1p(e))),Sr={kernelName:a.Log1p,backendName:"cpu",kernelFunc:Nr},Ir=c(((e,t)=>e&&t)),Tr=w(a.LogicalAnd,Ir,null,"bool"),_r={kernelName:a.LogicalAnd,backendName:"cpu",kernelFunc:Tr},Er=A(a.LogicalNot,(e=>e?0:1),"bool"),Ar={kernelName:a.LogicalNot,backendName:"cpu",kernelFunc:Er},Mr=c(((e,t)=>e||t)),$r=w(a.LogicalOr,Mr,null,"bool"),Dr={kernelName:a.LogicalOr,backendName:"cpu",kernelFunc:$r};const Fr={kernelName:a.LRN,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{depthRadius:i,bias:u,alpha:l,beta:c}=r;s(o,"LRN");const p=o.shape[3],d=p-1,h=n.data.get(o.dataId).values,m=a.util.sizeFromShape(o.shape),f=new Float32Array(m);function g(e){const t=e%p;let n=e-t+Math.max(0,t-i);const r=e-t+Math.min(t+i,d);let a=0;for(;n<=r;n++){const e=h[n];a+=e*e}return a}for(let e=0;e`Error in maxPool: Either strides or dilations must be 1. Got strides ${u} and dilations '1'`));const p=a.backend_util.computePool2DInfo(o.shape,i,u,1,l,c);let d;if(1===p.filterWidth&&1===p.filterHeight&&a.util.arraysEqual(p.inShape,p.outShape))d=m({inputs:{x:o},backend:n});else{const e=n.data.get(o.dataId).values,t=a.util.computeStrides(o.shape),r=Zt(e,o.shape,o.dtype,t,p,"max");d=n.makeTensorInfo(p.outShape,o.dtype,r.values)}return d}};const Rr={kernelName:a.MaxPool3D,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{filterSize:i,strides:u,pad:l,dimRoundingMode:c,dataFormat:p}=r;s(o,"maxPool3d");const d=a.backend_util.computePool3DInfo(o.shape,i,u,1,l,c,p),h=Qt(n.data.get(o.dataId).values,o.shape,o.dtype,a.util.computeStrides(o.shape),d,"max");return n.makeTensorInfo(h.shape,"float32",h.values)}};const zr={kernelName:a.MaxPool3DGrad,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{dy:o,input:i}=t,{filterSize:u,strides:l,pad:c,dimRoundingMode:p}=r;s([o,i],"maxPool3DGrad");const d=a.backend_util.computePool3DInfo(i.shape,u,l,1,c,p),h=function(e,t){const n=(0,a.buffer)(t.outShape,"int32"),r=t.strideDepth,s=t.strideHeight,o=t.strideWidth,i=t.dilationDepth,u=t.dilationHeight,l=t.dilationWidth,c=t.effectiveFilterDepth,p=t.effectiveFilterHeight,d=t.effectiveFilterWidth,h=t.padInfo.front,m=t.padInfo.top,f=t.padInfo.left;for(let a=0;a=S&&(S=u,I=n*p*d+s*p+i)}}}n.set(I,a,y,r,s,g)}}}return n}(n.bufferSync(i),d),m=d.strideDepth,f=d.strideHeight,g=d.strideWidth,y=d.dilationDepth,b=d.dilationHeight,k=d.dilationWidth,w=d.effectiveFilterDepth,v=d.effectiveFilterHeight,x=d.effectiveFilterWidth,N=w-1-d.padInfo.front,S=x-1-d.padInfo.left,I=v-1-d.padInfo.top,T=(0,a.buffer)(i.shape,"float32"),_=n.bufferSync(o);for(let e=0;e=d.outDepth||Math.floor(r)!==r))for(let a=0;a=d.outHeight||Math.floor(s)!==s))for(let o=0;o=d.outWidth||Math.floor(l)!==l)continue;const c=w*v*x-1-h.get(e,r,s,l,t)===n*v*x+a*x+o?1:0;if(0===c)continue;u+=_.get(e,r,s,l,t)*c}}}T.set(u,e,n,r,a,t)}return n.makeTensorInfo(T.shape,T.dtype,T.values)}};const Pr={kernelName:a.MaxPoolGrad,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{dy:o,input:i,output:u}=t,l=i;s([i,u],"maxPoolGrad");const{filterSize:c,strides:p,pad:d,dimRoundingMode:h}=r,m=a.backend_util.computePool2DInfo(l.shape,c,p,1,d,h),f=n.data.get(l.dataId).values,g=(0,a.buffer)(m.outShape,l.dtype,Jt(f,l.shape,l.dtype,m).values),y=m.strideHeight,b=m.strideWidth,k=m.dilationHeight,w=m.dilationWidth,v=m.effectiveFilterHeight,x=m.effectiveFilterWidth,N=x-1-m.padInfo.left,S=v-1-m.padInfo.top,I=(0,a.buffer)(l.shape,"float32"),T=n.data.get(o.dataId).values,_=(0,a.buffer)(o.shape,"float32",T);for(let e=0;e=m.outHeight||Math.floor(r)!==r))for(let a=0;a=m.outWidth||Math.floor(i)!==i)continue;const u=v*x-1-g.get(e,r,i,t)===n*x+a?1:0;if(0===u)continue;o+=_.get(e,r,i,t)*u}}I.set(o,e,n,r,t)}return n.makeTensorInfo(I.shape,I.dtype,I.values)}};const Lr={kernelName:a.MaxPoolWithArgmax,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{x:r}=e,{filterSize:o,strides:i,pad:u,includeBatchInIndex:l}=t,c=n;s(r,"MaxPoolWithArgmax");const p=c.data.get(r.dataId).values,d=a.backend_util.computePool2DInfo(r.shape,o,i,[1,1],u),[h,m]=function(e,t,n,r,s){const o=Zt(e,0,n,a.util.computeStrides(t),s,"max"),i=Jt(e,t,n,s,!0,r);return[o.values,i.values]}(p,r.shape,r.dtype,l,d),f=c.write(h,d.outShape,r.dtype),g=c.write(m,d.outShape,r.dtype);return[{dataId:f,shape:d.outShape,dtype:r.dtype},{dataId:g,shape:d.outShape,dtype:"int32"}]}};const Wr={kernelName:a.Mean,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:s}=t,{axis:o,keepDims:i}=r,u=a.util.parseAxisParam(o,s.shape),l=a.backend_util.computeOutAndReduceShapes(s.shape,u)[1],c=a.util.sizeFromShape(l),p=[],d=n.makeTensorInfo([],"float32",new Float32Array([c]));p.push(d);const h=b({inputs:{x:s},backend:n,attrs:{dtype:"float32"}});p.push(h);const m=Yn({inputs:{a:h,b:d},backend:n});p.push(m);const f=Rn({inputs:{x:m},backend:n,attrs:{axis:o,keepDims:i}});return p.forEach((e=>n.disposeIntermediateTensorInfo(e))),f}};const Hr={kernelName:a.Min,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{axis:i,keepDims:u}=r;s(o,"min");const l=a.util.parseAxisParam(i,o.shape);let c=l;const p=a.backend_util.getAxesPermutation(c,o.shape.length);let d=o;null!=p&&(d=Ee({inputs:{x:o},backend:n,attrs:{perm:p}}),c=a.backend_util.getInnerMostAxes(c.length,o.shape.length)),a.backend_util.assertAxesAreInnerMostDims("min",c,d.shape.length);const[h,m]=a.backend_util.computeOutAndReduceShapes(d.shape,c),f=a.util.sizeFromShape(m),g=a.util.makeZerosTypedArray(a.util.sizeFromShape(h),d.dtype),y=n.data.get(d.dataId).values;for(let e=0;ee[0]+o.shape[t]+e[1])),c=i.map((e=>e[0])),p=i.map(((e,t)=>e[0]+o.shape[t])),d="reflect"===u?0:1,h=n.data.get(o.dataId).values,m=o.shape.length,f=a.util.computeStrides(o.shape),g=a.util.sizeFromShape(l),y=l.length,b=a.util.computeStrides(l),k=a.util.getTypedArrayFromDType(o.dtype,g);for(let e=0;e=p[e]&&(t[e]=2*(p[e]-1)-t[e]+d);t=t.map(((e,t)=>e-c[t]));const n=a.util.locToIndex(t,m,f);k[e]=h[n]}return{dataId:n.write(k,l,o.dtype),shape:l,dtype:o.dtype}}},Gr=c(((e,t)=>{const n=e%t;return e<0&&t<0||e>=0&&t>=0?n:(n+t)%t})),Ur=w(a.Mod,Gr),jr={kernelName:a.Mod,backendName:"cpu",kernelFunc:Ur};var Kr=n(6377);function Xr(e){const{inputs:t,backend:n,attrs:r}=e,{logits:s}=t,{dim:o}=r,i=s.shape.length;let u=o;if(-1===u&&(u=i-1),u!==i-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${i} and dim was ${u}`);const l=a.util.parseAxisParam([u],s.shape),c=Br({inputs:{x:s},backend:n,attrs:{reductionIndices:l,keepDims:!1}}),p=a.backend_util.expandShapeToKeepDim(c.shape,l),d=It({inputs:{x:c},backend:n,attrs:{shape:p}}),h=st({inputs:{a:s,b:d},backend:n}),m=z({inputs:{x:h},backend:n}),f=Rn({inputs:{x:m},backend:n,attrs:{axis:l,keepDims:!1}}),g=It({inputs:{x:f},backend:n,attrs:{shape:p}}),y=Yn({inputs:{a:m,b:g},backend:n});return n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(m),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(g),y}const Zr={kernelName:a.Softmax,backendName:"cpu",kernelFunc:Xr};const Jr={kernelName:a.Multinomial,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{logits:o}=t,{numSamples:i,seed:u,normalized:l}=r;s(o,"multinomial");const c=l?o:Xr({inputs:{logits:o},backend:n,attrs:{dim:-1}}),p=c.shape[0],d=c.shape[1],h=n.data.get(c.dataId).values,m=[p,i],f=a.util.makeZerosTypedArray(a.util.sizeFromShape(m),"int32");for(let e=0;e=0&&d[e]{a.util.assertShapesMatch(o,e.shape,"All tensors passed to stack must have matching shapes"),a.util.assert(i===e.dtype,(()=>"All tensors passed to stack must have matching dtypes"))}));const u=[],l=hn({inputs:t.map((e=>{const t=Zn({inputs:{input:e},backend:n,attrs:{dim:s}});return u.push(t),t})),backend:n,attrs:{axis:s}});return u.forEach((e=>n.disposeIntermediateTensorInfo(e))),l}const la={kernelName:a.Pack,backendName:"cpu",kernelFunc:ua};const ca={kernelName:a.PadV2,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{paddings:i,constantValue:u}=r;s(o,"pad");const l=i.map(((e,t)=>e[0]+o.shape[t]+e[1])),c=i.map((e=>e[0])),p=n.data.get(o.dataId).values,d=a.util.sizeFromShape(o.shape),h=o.shape.length,m=a.util.computeStrides(o.shape),f=a.util.sizeFromShape(l),g=l.length,y=a.util.computeStrides(l),b=a.util.getTypedArrayFromDType(o.dtype,f);0!==u&&b.fill(u);for(let e=0;ee+c[t]));b[a.util.locToIndex(t,g,y)]=p[e]}return{dataId:n.write(b,l,o.dtype),shape:l,dtype:o.dtype}}},pa=c(((e,t)=>Math.pow(e,t))),da=w(a.Pow,pa),ha={kernelName:a.Pow,backendName:"cpu",kernelFunc:da};const ma={kernelName:a.Range,backendName:"cpu",kernelFunc:function(e){const{backend:t,attrs:n}=e,{start:r,stop:a,dtype:s,step:o}=n,i=De(r,a,o,s);return t.makeTensorInfo([i.length],s,i)}},fa=A(a.Reciprocal,(e=>1/e)),ga={kernelName:a.Reciprocal,backendName:"cpu",kernelFunc:fa};const ya={kernelName:a.ResizeBilinear,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{images:o}=t,{alignCorners:i,halfPixelCenters:u,size:l}=r;s(o,"resizeBilinear");const c=a.util.computeStrides(o.shape),[p,d]=l,[h,m,f,g]=o.shape,y=n.data.get(o.dataId).values,b=new Float32Array(a.util.sizeFromShape([h,p,d,g])),k=[i&&p>1?m-1:m,i&&d>1?f-1:f],w=[i&&p>1?p-1:p,i&&d>1?d-1:d];let v=0;const x=k[0]/w[0],N=k[1]/w[1];for(let e=0;e1?p-1:p,u&&f>1?d-1:d],b=[u&&m>1?m-1:m,u&&f>1?f-1:f],k=y[0]/b[0],w=y[1]/b[1],v=n.data.get(i.dataId).values;let x=0;for(let e=0;e1?m-1:m,i&&d>1?f-1:f],w=[i&&p>1?p-1:p,i&&d>1?d-1:d],v=k[0]/w[0],x=k[1]/w[1];let N=0;for(let e=0;e1?d-1:d,u&&g>1?h-1:h],w=[u&&f>1?f-1:f,u&&g>1?g-1:g],v=k[0]/w[0],x=k[1]/w[1],N=1/v,S=1/x,I=2*Math.ceil(N)+2,T=2*Math.ceil(S)+2;for(let e=0;e=f)continue;const p=t+l*c[1],m=l*v;if(e===Math.min(d-1,u?Math.round(m):Math.floor(m)))for(let e=0;e=g)continue;const a=p+t*c[2],s=t*x;r===Math.min(h-1,u?Math.round(s):Math.floor(s))&&(o+=b[a+n])}}y[s+n]=o}}}}return n.makeTensorInfo(o.shape,o.dtype,y)}};const va={kernelName:a.Reverse,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{dims:i}=r;s(o,"reverse");const u=o.shape.length,l=a.util.parseAxisParam(i,o.shape);if(0===u)return m({inputs:{x:o},backend:n});const c=new a.TensorBuffer(o.shape,o.dtype),p=n.bufferSync(o);for(let e=0;en[e]=o.shape[e]-1-n[e])),c.set(p.get(...n),...t)}return n.makeTensorInfo(c.shape,c.dtype,c.values)}},xa={kernelName:a.RotateWithOffset,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{image:r}=e,{radians:s,fillValue:o,center:i}=t,u=n,l=a.util.getTypedArrayFromDType(r.dtype,a.util.sizeFromShape(r.shape)),[c,p,d,h]=r.shape,[m,f]=a.backend_util.getImageCenter(i,p,d),g=Math.sin(s),y=Math.cos(s),b=u.data.get(r.dataId).values;for(let e=0;e=0&&w=0&&v{const t=Math.floor(e);return e-t<.5?Math.floor(e):e-t>.5?Math.ceil(e):t%2==0?t:t+1})),Sa={kernelName:a.Round,backendName:"cpu",kernelFunc:Na};function Ia(e,t,n,r,s,o,i,u,l,c){const p=[r/s,s],d=e.values,h=t.values;if(0===r)return(0,a.buffer)(n,t.dtype);const m=(0,a.buffer)(p,t.dtype);m.values.fill(l);for(let e=0;e=r/s)throw new Error(`Invalid indices: ${a} does not index into ${n}`);for(let n=0;n1||1===o.shape.length?1:a.util.sizeFromShape(o.shape.slice(1));for(let e=0;ee>=0?Aa*e:Ea*(Math.exp(e)-1))),$a={kernelName:a.Selu,backendName:"cpu",kernelFunc:Ma},Da=A(a.Sign,(e=>e<0?-1:e>0?1:0)),Fa={kernelName:a.Sign,backendName:"cpu",kernelFunc:Da},Oa=A(a.Sin,(e=>Math.sin(e))),Ba={kernelName:a.Sin,backendName:"cpu",kernelFunc:Oa},Ca=A(a.Sinh,(e=>Math.sinh(e))),Va={kernelName:a.Sinh,backendName:"cpu",kernelFunc:Ca},Ra=Math.log(1.1920928955078125e-7)+2,za=A(a.Softplus,(e=>{const t=e>-Ra,n=eNumber(e))))),n.makeTensorInfo([f.length],r.dtype,new Int32Array(f))]}};const Ha={kernelName:a.SparseReshape,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{inputIndices:r,inputShape:a,newShape:s}=t;if(2!==r.shape.length)throw new Error(`Input indices should be a matrix but received shape\n ${r.shape}`);if(1!==a.shape.length)throw new Error(`Input shape should be a vector but received shape\n ${a.shape}`);if(1!==s.shape.length)throw new Error(`Target shape should be a vector but received shape ${s.shape}`);const o=Array.from(n.data.get(a.dataId).values),i=n.data.get(r.dataId).values,u=Array.from(n.data.get(s.dataId).values),[l,c,p]=He(i,r.shape,r.dtype,o,u);return[n.makeTensorInfo(c,r.dtype,l),n.makeTensorInfo([p.length],s.dtype,new Int32Array(p))]}};const qa={kernelName:a.SparseSegmentMean,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{data:r,indices:a,segmentIds:s}=t;if(r.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==a.shape.length)throw new Error(`Indices should be a vector but received shape\n ${a.shape}`);if(1!==s.shape.length)throw new Error(`Segment ids should be a vector but received shape\n ${s.shape}`);const o=n.data.get(r.dataId).values,i=n.data.get(a.dataId).values,u=n.data.get(s.dataId).values,[l,c]=qe(o,r.shape,r.dtype,i,u,!0);return n.makeTensorInfo(c,r.dtype,l)}};const Ga={kernelName:a.SparseSegmentSum,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{data:r,indices:a,segmentIds:s}=t;if(r.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==a.shape.length)throw new Error(`Indices should be a vector but received shape\n ${a.shape}`);if(1!==s.shape.length)throw new Error(`Segment ids should be a vector but received shape\n ${s.shape}`);const o=n.data.get(r.dataId).values,i=n.data.get(a.dataId).values,u=n.data.get(s.dataId).values,[l,c]=qe(o,r.shape,r.dtype,i,u);return n.makeTensorInfo(c,r.dtype,l)}};const Ua={kernelName:a.SparseToDense,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{sparseIndices:s,sparseValues:o,defaultValue:i}=t,{outputShape:u}=r,{sliceRank:l,numUpdates:c,sliceSize:p,strides:d,outputSize:h}=a.backend_util.calculateShapes(o,s,u),m=Ia(n.bufferSync(s),n.bufferSync(o),u,h,p,c,l,d,n.data.get(i.dataId).values[0],!1);return n.makeTensorInfo(u,m.dtype,m.values)}};const ja={kernelName:a.SplitV,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:s}=t,{numOrSizeSplits:o,axis:i}=r,u=a.util.parseAxisParam(i,s.shape)[0],l=a.backend_util.prepareSplitSize(s,o,u),c=new Array(s.shape.length).fill(0),p=s.shape.slice();return l.map((e=>{const t=[...p];t[u]=e;const r=Pe({inputs:{x:s},backend:n,attrs:{begin:c,size:t}});return c[u]+=e,r}))}},Ka={kernelName:a.Square,backendName:"cpu",kernelFunc:({inputs:e,backend:t})=>{const{x:n}=e,r=t;s(n,"square");const a=r.data.get(n.dataId).values,o=new Float32Array(a.length);for(let e=0;e{const n=t;return isNaN(e)?NaN:e>0?1:n.alpha})),Za={kernelName:a.Step,backendName:"cpu",kernelFunc:Xa};const Ja={kernelName:a.StridedSlice,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:o}=t,{begin:i,end:u,strides:l,beginMask:c,endMask:p,ellipsisMask:d,newAxisMask:h,shrinkAxisMask:m}=r;s(o,"stridedSlice");const{nonStrided:f,$begin:g,$strides:y,size:b,newShape:k,outShape:w}=a.slice_util.sliceInfo(o.shape,i,u,l,c,p,d,h,m),v=It({inputs:{x:o},backend:n,attrs:{shape:k}});let x;if(f){const e=Pe({inputs:{x:v},backend:n,attrs:{begin:g,size:b}});x=It({inputs:{x:e},backend:n,attrs:{shape:w}}),n.disposeIntermediateTensorInfo(e)}else if(w.some((e=>0===e)))x=n.makeTensorInfo(w,o.dtype,[]);else{const e=Je(w,n.bufferSync(v),y,g);x=n.makeTensorInfo(e.shape,e.dtype,e.values)}const N=It({inputs:{x},backend:n,attrs:{shape:w}});return n.disposeIntermediateTensorInfo(v),n.disposeIntermediateTensorInfo(x),N}};const Qa={kernelName:a.StringNGrams,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{separator:a,nGramWidths:s,leftPad:o,rightPad:i,padWidth:u,preserveShortSequences:l}=r,{data:c,dataSplits:p}=t,d=n.data.get(c.dataId).values,h=n.data.get(p.dataId).values,[m,f]=Ye(d,h,a,s,o,i,u,l);return[n.makeTensorInfo([m.length],"string",m),n.makeTensorInfo(p.shape,"int32",f)]}};const Ya={kernelName:a.StringSplit,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{skipEmpty:a}=r,{input:s,delimiter:o}=t;if("string"!==s.dtype)throw new Error("Input must be of datatype string");if(1!==s.shape.length)throw new Error(`Input must be a vector, got shape: ${s.shape}`);if(0!==o.shape.length)throw new Error(`Delimiter must be a scalar, got shape: ${o.shape}`);const i=n.data.get(s.dataId).values,u=n.data.get(o.dataId).values[0],[l,c,p]=tt(i,u,a),d=c.length;return[n.makeTensorInfo([d,2],"int32",l),n.makeTensorInfo([d],"string",c),n.makeTensorInfo([2],"int32",new Int32Array(p))]}};const es={kernelName:a.StringToHashBucketFast,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{numBuckets:a}=r,{input:s}=t;if("string"!==s.dtype)throw new Error("Input must be of datatype string");if(a<=0)throw new Error("Number of buckets must be at least 1");const o=nt(n.data.get(s.dataId).values,a);return n.makeTensorInfo(s.shape,"int32",o)}},ts=A(a.Tan,(e=>Math.tan(e))),ns={kernelName:a.Tan,backendName:"cpu",kernelFunc:ts},rs=A(a.Tanh,(e=>Math.tanh(e))),as={kernelName:a.Tanh,backendName:"cpu",kernelFunc:rs};const ss={kernelName:a.Tile,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{reps:o}=r;s(a,"tile");const i=it(n.bufferSync(a),o);return n.makeTensorInfo(i.shape,i.dtype,i.values)}};const os={kernelName:a.TopK,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{x:a}=t,{k:o,sorted:i}=r;s(a,"topk");const u=n.data.get(a.dataId).values,[l,c]=ct(u,a.shape,a.dtype,o,i);return[n.makeTensorInfo(l.shape,l.dtype,l.values),n.makeTensorInfo(c.shape,c.dtype,c.values)]}};const is={kernelName:a.Transform,backendName:"cpu",kernelFunc:function(e){const{inputs:t,attrs:n,backend:r}=e,{image:s,transforms:o}=t,{interpolation:i,fillMode:u,fillValue:l,outputShape:c}=n,[p,d,h,m]=s.shape,[f,g]=null!=c?c:[d,h],y=[p,f,g,m],b=a.util.computeStrides(s.shape),k=b[0],w=b[1],v=b[2],x=a.util.getTypedArrayFromDType(s.dtype,a.util.sizeFromShape(y));x.fill(l);const N=r.data.get(s.dataId).values,S=r.data.get(o.dataId).values;for(let e=0;et-1)if(t<=1)n=0;else{const e=2*t;n-=e*Math.trunc(n/e),n>=t&&(n=e-n-1)}return a.util.clamp(0,n,t-1)}(e,t);case"wrap":return function(e,t){let n=e;if(n<0)if(t<=1)n=0;else{const e=t-1;n+=t*(Math.trunc(-n/e)+1)}else if(n>t-1)if(t<=1)n=0;else{const e=t-1;n-=t*Math.trunc(n/e)}return a.util.clamp(0,n,t-1)}(e,t);case"nearest":return function(e,t){return a.util.clamp(0,e,t-1)}(e,t);case"constant":default:return function(e,t){return e}(e)}}function ls(e,t,n,r,a,s,o,i,u,l,c){return 0<=i&&in.disposeIntermediateTensorInfo(e))),h}},fs=[At,l,$t,Ft,I,Ot,Bt,Ct,Vt,Rt,Pt,Wt,qt,jt,Xt,Yt,en,tn,nn,Et,rn,an,sn,on,k,F,ln,d,cn,mn,yn,bn,gn,wn,vn,kn,Nn,In,Tn,_n,En,An,$n,Dn,Fn,On,Bn,Vn,Cn,er,Pn,mt,Ln,V,Xn,P,Jn,H,ar,or,ir,U,cr,pr,dr,hr,mr,J,ee,f,fr,dn,yr,kr,vr,gt,re,oe,xr,ce,Sr,_r,Ar,Dr,Fr,Or,me,Vr,Rr,zr,Pr,Lr,Cr,Wr,Hr,ye,qr,jr,Jr,ve,Ne,Yr,ta,ra,Te,aa,ia,la,ca,ha,kt,$e,ma,y,ga,vt,Nt,Tt,ya,ba,ka,wa,va,xa,Sa,Be,Ta,_a,$a,Re,Fa,Ba,Va,Le,Zr,Pa,La,Wa,Ha,qa,Ga,Ua,ja,je,Ka,Ze,Za,Ja,Qa,Ya,es,ot,zn,ns,as,ss,os,Ae,is,ds,hs,ms,oa];for(const e of fs)(0,a.registerKernel)(e)},4933:(e,t,n)=>{"use strict";n.r(t),n.d(t,{GraphModel:()=>gr,deregisterOp:()=>E,loadGraphModel:()=>yr,registerOp:()=>T,version_converter:()=>br});var r={};n.r(r),n.d(r,{json:()=>C});var a={};n.r(a),n.d(a,{json:()=>V});var s={};n.r(s),n.d(s,{json:()=>R});var o={};n.r(o),n.d(o,{json:()=>z});var i={};n.r(i),n.d(i,{json:()=>P});var u={};n.r(u),n.d(u,{json:()=>L});var l={};n.r(l),n.d(l,{json:()=>W});var c={};n.r(c),n.d(c,{json:()=>H});var p={};n.r(p),n.d(p,{json:()=>q});var d={};n.r(d),n.d(d,{json:()=>G});var h={};n.r(h),n.d(h,{json:()=>U});var m={};n.r(m),n.d(m,{json:()=>j});var f={};n.r(f),n.d(f,{json:()=>K});var g={};n.r(g),n.d(g,{json:()=>X});var y={};n.r(y),n.d(y,{json:()=>Z});var b={};n.r(b),n.d(b,{json:()=>J});var k={};n.r(k),n.d(k,{json:()=>Q});var w={};n.r(w),n.d(w,{json:()=>Y});var v={};n.r(v),n.d(v,{json:()=>ee});var x,N,S=n(5363);!function(e){e[e.DT_INVALID=0]="DT_INVALID",e[e.DT_FLOAT=1]="DT_FLOAT",e[e.DT_DOUBLE=2]="DT_DOUBLE",e[e.DT_INT32=3]="DT_INT32",e[e.DT_UINT8=4]="DT_UINT8",e[e.DT_INT16=5]="DT_INT16",e[e.DT_INT8=6]="DT_INT8",e[e.DT_STRING=7]="DT_STRING",e[e.DT_COMPLEX64=8]="DT_COMPLEX64",e[e.DT_INT64=9]="DT_INT64",e[e.DT_BOOL=10]="DT_BOOL",e[e.DT_QINT8=11]="DT_QINT8",e[e.DT_QUINT8=12]="DT_QUINT8",e[e.DT_QINT32=13]="DT_QINT32",e[e.DT_BFLOAT16=14]="DT_BFLOAT16",e[e.DT_FLOAT_REF=101]="DT_FLOAT_REF",e[e.DT_DOUBLE_REF=102]="DT_DOUBLE_REF",e[e.DT_INT32_REF=103]="DT_INT32_REF",e[e.DT_UINT8_REF=104]="DT_UINT8_REF",e[e.DT_INT16_REF=105]="DT_INT16_REF",e[e.DT_INT8_REF=106]="DT_INT8_REF",e[e.DT_STRING_REF=107]="DT_STRING_REF",e[e.DT_COMPLEX64_REF=108]="DT_COMPLEX64_REF",e[e.DT_INT64_REF=109]="DT_INT64_REF",e[e.DT_BOOL_REF=110]="DT_BOOL_REF",e[e.DT_QINT8_REF=111]="DT_QINT8_REF",e[e.DT_QUINT8_REF=112]="DT_QUINT8_REF",e[e.DT_QINT32_REF=113]="DT_QINT32_REF",e[e.DT_BFLOAT16_REF=114]="DT_BFLOAT16_REF"}(x||(x={})),function(e){let t;!function(e){e[e.LEGACY=0]="LEGACY",e[e.V1=1]="V1",e[e.V2=2]="V2"}(t=e.CheckpointFormatVersion||(e.CheckpointFormatVersion={}))}(N||(N={}));const I={};function T(e,t){const n={tfOpName:e,category:"custom",inputs:[],attrs:[],customExecutor:t};I[e]=n}function _(e){return I[e]}function E(e){delete I[e]}function A(e,t,n,r,a){const s=t.inputParams[e];if(s&&void 0!==s.inputIndexStart){const e=s.inputIndexStart,o=0===s.inputIndexEnd?void 0:void 0===s.inputIndexEnd?e+1:s.inputIndexEnd;if("tensor"===s.type)return M(t.inputNames[s.inputIndexStart],n,r,a);if("tensors"===s.type){return t.inputNames.slice(e,o).map((e=>M(e,n,r,a)))}const i=M(t.inputNames.slice(e)[0],n,r,a),u=i.dataSync();return"number"===s.type?u[0]:S.util.toNestedArray(i.shape,u)}const o=t.attrParams[e];return o&&o.value}function M(e,t,n,r){const[a,s]=F(e);if(null!=r){const e=r.getHashTableHandleByName(a);if(null!=e)return e}const o=n.currentContextIds.find((e=>!!t[D(a,e)]));return void 0!==o?t[D(a,o)][s]:void 0}function $(e,t){const[n,r,a]=F(e);return[D(n,t&&t.currentContextId),r,a]}function D(e,t){return t?`${e}-${t}`:e}function F(e){const t=e.split(":");if(1===t.length)return[e,0,void 0];const n=t[0],r=3===t.length?t[1]:void 0;return[n,Number(t[t.length-1]),r]}function O(e,t,n){let r=A("pad",e,t,n);if("explicit"===r){r=A("explicitPaddings",e,t,n);const a=[[0,0],[0,0],[0,0],[0,0]];for(let e=0;e<4;e++)a[e][0]=r[2*e],a[e][1]=r[2*e+1];return a}return r}function B(e){return e.kept?e:(0,S.clone)(e)}const C=[{tfOpName:"Add",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddV2",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddN",category:"arithmetic",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"BiasAdd",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"Sub",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"RealDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Div",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"DivNoNan",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mul",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Maximum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Minimum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Pow",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SquaredDifference",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorMod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],V=[{tfOpName:"Abs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan2",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Ceil",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ClipByValue",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"clipValueMin",type:"number"},{start:2,name:"clipValueMax",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Complex",category:"basic_math",inputs:[{start:0,name:"real",type:"tensor"},{start:1,name:"imag",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ComplexAbs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Elu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Exp",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Floor",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Imag",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Neg",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Real",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Prelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"alpha",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu6",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Selu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sigmoid",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Rsqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Square",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sign",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Round",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Expm1",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log1p",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Reciprocal",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Softplus",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Erf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Prod",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axes",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LeakyRelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"alpha",name:"alpha",type:"number",defaultValue:.2},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsNan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],R=[{tfOpName:"EmptyTensorList",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"maxNumElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"LoopCond",category:"control",inputs:[{start:0,name:"pred",type:"tensor"}]},{tfOpName:"Switch",category:"control",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"pred",type:"tensor"}]},{tfOpName:"Merge",category:"control",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"Enter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"frame_name",name:"frameName",type:"string"},{tfName:"is_constant",name:"isConstant",type:"bool"}]},{tfOpName:"Exit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NextIteration",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayV3",category:"control",inputs:[{start:0,name:"size",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"dynamic_size",name:"dynamicSize",type:"bool"},{tfName:"clear_after_read",name:"clearAfterRead",type:"bool"},{tfName:"identical_element_shapes",name:"identicalElementShapes",type:"bool"},{tfName:"tensor_array_name",name:"name",type:"string"}]},{tfOpName:"TensorArrayWriteV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayReadV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayGatherV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"}]},{tfOpName:"TensorArrayScatterV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArrayConcatV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape_except0",name:"elementShapeExcept0",type:"shape",notSupported:!0}]},{tfOpName:"TensorArraySplitV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"tensor",type:"tensor"},{start:2,name:"lengths",type:"number[]"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArraySizeV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"},{start:1,name:"flowIn",type:"number"}]},{tfOpName:"TensorArrayCloseV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"}]},{tfOpName:"StatelessIf",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"If",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"StatelessWhile",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"While",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"TensorListScatter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListScatterV2",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"},{start:3,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGather",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListSetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListReserve",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListFromTensor",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListStack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"},{tfName:"num_elements",name:"numElements",type:"dtype"}]},{tfOpName:"TensorListSplit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"},{start:2,name:"lengths",type:"number[]"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListConcat",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}],attrs:[{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPopBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPushBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]}],z=[{tfOpName:"AvgPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[],notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPoolWithArgmax",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"include_batch_in_index",name:"includeBatchInIndex",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AvgPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Conv1D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"stride",name:"stride",type:"number"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NWC"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"dilation",name:"dilation",type:"number",defaultValue:1}]},{tfOpName:"Conv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"useCudnnOnGpu",name:"useCudnnOnGpu",type:"bool"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"_FusedConv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"use_cudnn_on_gpu",name:"useCudnnOnGpu",type:"bool",defaultValue:!0},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number"}]},{tfOpName:"Conv2DBackpropInput",category:"convolution",inputs:[{start:2,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:0,name:"outputShape",type:"number[]"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]",notSupported:!0}]},{tfOpName:"DepthwiseConv2d",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"DepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"FusedDepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]}]},{tfOpName:"Conv3D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"Dilation2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"rates",name:"dilations",type:"number[]"},{tfName:"padding",name:"pad",type:"string"}]}],P=[{tfOpName:"Fill",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"},{start:1,name:"value",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"LinSpace",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"num",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"OneHot",category:"creation",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"depth",type:"number"},{start:2,name:"onValue",type:"number",defaultValue:1},{start:3,name:"offValue",type:"number",defaultValue:0}],attrs:[{tfName:"axis",name:"axis",type:"number",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Ones",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"OnesLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"RandomUniform",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number",defaultValue:0},{tfName:"maxval",name:"maxval",type:"number",defaultValue:1},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"Range",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"step",type:"number",defaultValue:0}],attrs:[{tfName:"Tidx",name:"dtype",type:"dtype"}]},{tfOpName:"TruncatedNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"means",name:"mean",type:"number",defaultValue:0},{tfName:"stddev",name:"stdDev",type:"number",defaultValue:1},{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"Zeros",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"ZerosLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"Multinomial",category:"creation",inputs:[{start:0,name:"logits",type:"tensor"},{start:1,name:"numSamples",type:"number"}],attrs:[{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number"},{tfName:"T",name:"dtype",type:"dtype"},{tfName:"output_dtype",name:"output_dtype",type:"dtype"}]}],L=[{tfOpName:"NonMaxSuppressionV2",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV3",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV4",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"T_threshold",name:"threshold",type:"dtype",notSupported:!0},{tfName:"pad_to_max_output_size",name:"padToMaxOutputSize",type:"bool"}]},{tfOpName:"NonMaxSuppressionV5",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"},{start:5,name:"softNmsSigma",type:"number"}]},{tfOpName:"Where",category:"dynamic",inputs:[{start:0,name:"condition",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ListDiff",category:"dynamic",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],W=[{tfOpName:"TopKV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"k",type:"number"}],attrs:[{tfName:"sorted",name:"sorted",type:"bool"}]},{tfOpName:"Unique",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"UniqueV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]}],H=[{tfOpName:"PlaceholderWithDefault",category:"graph",inputs:[{start:0,name:"default",type:"tensor"}],attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Placeholder",category:"graph",attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Const",category:"graph"},{tfOpName:"Identity",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IdentityN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Snapshot",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Rank",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Size",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Shape",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"ShapeN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Print",category:"graph",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"data",type:"tensors"}],attrs:[{tfName:"message",name:"message",type:"string"},{tfName:"first_n",name:"firstN",type:"number",notSupported:!0},{tfName:"summarize",name:"summarize",type:"number",defaultValue:3}]},{tfOpName:"NoOp",category:"graph",inputs:[]},{tfOpName:"StopGradient",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"FakeQuantWithMinMaxVars",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"min",name:"min",type:"number"},{tfName:"max",name:"max",type:"number"}]}],q=[{tfOpName:"HashTable",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"HashTableV2",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"LookupTableImport",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableImportV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFind",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFindV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableSize",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]},{tfOpName:"LookupTableSizeV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]}],G=[{tfOpName:"ResizeBilinear",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ResizeNearestNeighbor",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"half_pixel_centers",name:"halfPixelCenters",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"CropAndResize",category:"image",inputs:[{start:0,name:"image",type:"tensor"},{start:1,name:"boxes",type:"tensor"},{start:2,name:"boxInd",type:"tensor"},{start:3,name:"cropSize",type:"number[]"}],attrs:[{tfName:"method",name:"method",type:"string"},{tfName:"extrapolation_value",name:"extrapolationValue",type:"number"}]}],U=[{tfOpName:"Equal",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NotEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Greater",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"GreaterEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Less",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LessEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalAnd",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalNot",category:"logical",inputs:[{start:0,name:"a",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalOr",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Select",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SelectV2",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],j=[{tfOpName:"_FusedMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMulV2",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Transpose",category:"matrices",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"perm",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Einsum",category:"matrices",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"equation",name:"equation",type:"string"},{tfName:"N",name:"n",type:"number",defaultValue:2},{tfName:"T",name:"dtype",type:"dtype"}]}],K=[{tfOpName:"FusedBatchNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV2",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV3",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"LRN",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"depth_radius",name:"radius",type:"number",defaultValue:5},{tfName:"bias",name:"bias",type:"number",defaultValue:1},{tfName:"alpha",name:"alpha",type:"number",defaultValue:1},{tfName:"beta",name:"beta",type:"number",defaultValue:.5}]},{tfOpName:"Softmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"LogSoftmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"SparseToDense",category:"normalization",inputs:[{start:0,name:"sparseIndices",type:"tensor"},{start:1,name:"outputShape",type:"number[]"},{start:2,name:"sparseValues",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",defaultValue:!0,notSupported:!0}]}],X=[{tfOpName:"Bincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}]},{tfOpName:"DenseBincount",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"size",type:"number"},{start:2,name:"weights",type:"tensor"}],attrs:[{tfName:"binary_output",name:"binaryOutput",type:"bool"}]},{tfOpName:"Max",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Mean",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Min",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Sum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"All",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Any",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"ArgMax",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"ArgMin",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"Prod",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Cumsum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}],attrs:[{tfName:"exclusive",name:"exclusive",type:"bool"},{tfName:"reverse",name:"reverse",type:"bool"}]}],Z=[{tfOpName:"ConcatV2",category:"slice_join",inputs:[{start:0,end:-1,name:"tensors",type:"tensors"},{start:-1,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"Concat",category:"slice_join",inputs:[{start:1,end:0,name:"tensors",type:"tensors"},{start:0,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"GatherV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"axis",type:"number",defaultValue:0}],attrs:[{tfName:"batch_dims",name:"batchDims",type:"number",defaultValue:0}]},{tfOpName:"Gather",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",notSupported:!0}]},{tfOpName:"Reverse",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"dims",type:"bool[]"}]},{tfOpName:"ReverseV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}]},{tfOpName:"Slice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"size",type:"number[]"}]},{tfOpName:"StridedSlice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"end",type:"number[]"},{start:3,name:"strides",type:"number[]"}],attrs:[{tfName:"begin_mask",name:"beginMask",type:"number",defaultValue:0},{tfName:"end_mask",name:"endMask",type:"number",defaultValue:0},{tfName:"new_axis_mask",name:"newAxisMask",type:"number",defaultValue:0},{tfName:"ellipsis_mask",name:"ellipsisMask",type:"number",defaultValue:0},{tfName:"shrink_axis_mask",name:"shrinkAxisMask",type:"number",defaultValue:0}]},{tfOpName:"Pack",category:"slice_join",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0}]},{tfOpName:"Unpack",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0},{tfName:"num",name:"num",type:"number",defaultValue:0,notSupported:!0}]},{tfOpName:"Tile",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"reps",type:"number[]"}]},{tfOpName:"Split",category:"slice_join",inputs:[{start:0,name:"axis",type:"number",defaultValue:0},{start:1,name:"x",type:"tensor"}],attrs:[{tfName:"num_split",name:"numOrSizeSplits",type:"number",defaultValue:1}]},{tfOpName:"SplitV",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"numOrSizeSplits",type:"number[]"},{start:2,name:"axis",type:"number",defaultValue:0}]},{tfOpName:"ScatterNd",category:"slice_join",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"shape",type:"number[]"}]},{tfOpName:"GatherNd",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}]},{tfOpName:"SparseToDense",category:"slice_join",inputs:[{start:0,name:"sparseIndices",type:"tensor"},{start:1,name:"outputShape",type:"number[]"},{start:2,name:"sparseValues",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",defaultValue:!1,notSupported:!0}]}],J=[{tfOpName:"SparseFillEmptyRows",category:"sparse",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"denseShape",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}]},{tfOpName:"SparseReshape",category:"sparse",inputs:[{start:0,name:"inputIndices",type:"tensor"},{start:1,name:"inputShape",type:"tensor"},{start:2,name:"newShape",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SparseSegmentMean",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]},{tfOpName:"SparseSegmentSum",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]}],Q=[{tfOpName:"FFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"RFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]},{tfOpName:"IRFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]}],Y=[{tfOpName:"StringNGrams",category:"string",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"dataSplits",type:"tensor"}],attrs:[{tfName:"separator",name:"separator",type:"string"},{tfName:"ngram_widths",name:"nGramWidths",type:"number[]"},{tfName:"left_pad",name:"leftPad",type:"string"},{tfName:"right_pad",name:"rightPad",type:"string"},{tfName:"pad_width",name:"padWidth",type:"number"},{tfName:"preserve_short_sequences",name:"preserveShortSequences",type:"bool"}],outputs:["ngrams","ngrams_splits"]},{tfOpName:"StringSplit",category:"string",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"delimiter",type:"tensor"}],attrs:[{tfName:"skip_empty",name:"skipEmpty",type:"bool"}],outputs:["indices","values","shape"]},{tfOpName:"StringToHashBucketFast",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"num_buckets",name:"numBuckets",type:"number"}]}],ee=[{tfOpName:"Cast",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"SrcT",name:"sdtype",type:"dtype",notSupported:!0},{tfName:"DstT",name:"dtype",type:"dtype"}]},{tfOpName:"ExpandDims",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"MirrorPad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"mode",name:"mode",type:"string"}]},{tfOpName:"Pad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"constant_value",name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"PadV2",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"},{start:2,name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"Reshape",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}]},{tfOpName:"Squeeze",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"axis",tfDeprecatedName:"squeeze_dims",name:"axis",type:"number[]"}]},{tfOpName:"SpaceToBatchND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"paddings",type:"number[]"}]},{tfOpName:"BatchToSpaceND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"crops",type:"number[]"}]},{tfOpName:"DepthToSpace",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"block_size",name:"blockSize",type:"number"},{tfName:"data_format",name:"dataFormat",type:"string"}]},{tfOpName:"BroadcastTo",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}],attrs:[]},{tfOpName:"BroadcastArgs",category:"transformation",inputs:[{start:0,name:"s0",type:"tensor"},{start:1,name:"s1",type:"tensor"}],attrs:[]}];class te{static get Instance(){return this._instance||(this._instance=new this)}constructor(){const e=[].concat(...[r,a,s,o,i,u,l,c,p,d,h,m,f,g,y,b,k,w,v].map((e=>e.json)));this.opMappers=e.reduce(((e,t)=>(e[t.tfOpName]=t,e)),{})}transformGraph(e,t={}){const n=e.node,r=[],a=[],s=[],o=n.reduce(((e,t)=>(e[t.name]=this.mapNode(t),t.op.startsWith("Placeholder")?r.push(e[t.name]):"Const"===t.op?a.push(e[t.name]):null!=t.input&&0!==t.input.length||s.push(e[t.name]),e)),{});let i=[];const u=[];let l={},c={};null!=t&&(l=this.mapSignatureEntries(t.inputs),c=this.mapSignatureEntries(t.outputs));const p=Object.keys(o);p.forEach((e=>{const t=o[e];t.inputNames.forEach(((e,n)=>{const[r,,a]=$(e),s=o[r];if(null!=s.outputs){const e=s.outputs.indexOf(a);if(-1!==e){const a=`${r}:${e}`;t.inputNames[n]=a}}t.inputs.push(s),s.children.push(t)}))})),0===Object.keys(c).length?p.forEach((e=>{const t=o[e];0===t.children.length&&u.push(t)})):Object.keys(c).forEach((e=>{const[t]=$(e),n=o[t];null!=n&&(n.signatureKey=c[e],u.push(n))})),Object.keys(l).length>0?Object.keys(l).forEach((e=>{const[t]=$(e),n=o[t];n&&(n.signatureKey=l[e],i.push(n))})):i=r;let d={};null!=e.library&&null!=e.library.function&&(d=e.library.function.reduce(((e,t)=>(e[t.signature.name]=this.mapFunction(t),e)),{}));const h={nodes:o,inputs:i,outputs:u,weights:a,placeholders:r,signature:t,functions:d};return s.length>0&&(h.initNodes=s),h}mapSignatureEntries(e){return Object.keys(e||{}).reduce(((t,n)=>(t[e[n].name]=n,t)),{})}mapNode(e){const t=_(e.op)||this.opMappers[e.op]||{};null==e.attr&&(e.attr={});const n={name:e.name,op:e.op,category:t.category,inputNames:(e.input||[]).map((e=>e.startsWith("^")?e.substr(1):e)),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:e.attr,outputs:t.outputs};return null!=t.inputs&&(n.inputParams=t.inputs.reduce(((e,t)=>(e[t.name]={type:t.type,inputIndexStart:t.start,inputIndexEnd:t.end},e)),{})),null!=t.attrs&&(n.attrParams=t.attrs.reduce(((t,n)=>{const r=n.type;let a;switch(n.type){case"string":a=re(e.attr,n.tfName,n.defaultValue),void 0===a&&n.tfDeprecatedName&&(a=re(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"string[]":a=he(e.attr,n.tfName,n.defaultValue),void 0===a&&n.tfDeprecatedName&&(a=he(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number":a=se(e.attr,n.tfName,n.defaultValue||0),void 0===a&&n.tfDeprecatedName&&(a=se(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number[]":a=de(e.attr,n.tfName,n.defaultValue),void 0===a&&n.tfDeprecatedName&&(a=de(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool":a=ae(e.attr,n.tfName,n.defaultValue),void 0===a&&n.tfDeprecatedName&&(a=ae(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool[]":a=fe(e.attr,n.tfName,n.defaultValue),void 0===a&&n.tfDeprecatedName&&(a=fe(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape":a=pe(e.attr,n.tfName,n.defaultValue),void 0===a&&n.tfDeprecatedName&&(a=pe(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape[]":a=me(e.attr,n.tfName,n.defaultValue),void 0===a&&n.tfDeprecatedName&&(a=me(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype":a=ue(e.attr,n.tfName,n.defaultValue),void 0===a&&n.tfDeprecatedName&&(a=ue(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype[]":a=le(e.attr,n.tfName,n.defaultValue),void 0===a&&n.tfDeprecatedName&&(a=le(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"func":a=ie(e.attr,n.tfName,n.defaultValue),void 0===a&&n.tfDeprecatedName&&(a=ie(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"tensor":case"tensors":break;default:throw new Error(`Unsupported param type: ${n.type} for op: ${e.op}`)}return t[n.name]={value:a,type:r},t}),{})),n}mapFunction(e){const t=e.nodeDef,n=[];let r={};null!=t&&(r=t.reduce(((e,t)=>(e[t.name]=this.mapNode(t),"Const"===t.op&&n.push(e[t.name]),e)),{}));const a=[],s=[];e.signature.inputArg.forEach((e=>{const[t]=$(e.name),n={name:t,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:oe(e.type),type:"dtype"}},children:[]};n.signatureKey=e.name,a.push(n),r[t]=n}));Object.keys(r).forEach((e=>{const t=r[e];t.inputNames.forEach(((e,n)=>{const[a,,s]=$(e),o=r[a];if(null!=o.outputs){const e=o.outputs.indexOf(s);if(-1!==e){const r=`${a}:${e}`;t.inputNames[n]=r}}t.inputs.push(o),o.children.push(t)}))}));const o=e.ret;e.signature.outputArg.forEach((e=>{const[t,n]=$(o[e.name]),a=r[t];null!=a&&(a.defaultOutput=n,s.push(a))}));const i=this.mapArgsToSignature(e);return{nodes:r,inputs:a,outputs:s,weights:n,placeholders:[],signature:i}}mapArgsToSignature(e){return{methodName:e.signature.name,inputs:e.signature.inputArg.reduce(((e,t)=>(e[t.name]=this.mapArgToTensorInfo(t),e)),{}),outputs:e.signature.outputArg.reduce(((t,n)=>(t[n.name]=this.mapArgToTensorInfo(n,e.ret),t)),{})}}mapArgToTensorInfo(e,t){let n=e.name;return null!=t&&(n=t[n]),{name:n,dtype:e.type}}}function ne(e,t){const n=Array.isArray(e)?String.fromCharCode.apply(null,e):function(e){const t=(0,S.env)().global;if(void 0!==t.atob)return t.atob(e);if("undefined"!=typeof Buffer)return new Buffer(e,"base64").toString();throw new Error("Unable to decode base64 in this environment. Missing built-in atob() or Buffer()")}(e);return t?n:n.toLowerCase()}function re(e,t,n,r=!1){const a=e[t];return null!=a?ne(a.s,r):n}function ae(e,t,n){const r=e[t];return r?r.b:n}function se(e,t,n){const r=e[t]||{},a=null!=r.i?r.i:null!=r.f?r.f:n;return"number"==typeof a?a:parseInt(a,10)}function oe(e){switch("string"==typeof e&&(e=x[e]),e){case x.DT_FLOAT:return"float32";case x.DT_INT32:case x.DT_INT64:case x.DT_INT8:case x.DT_UINT8:return"int32";case x.DT_BOOL:return"bool";case x.DT_DOUBLE:return"float32";case x.DT_STRING:return"string";default:return null}}function ie(e,t,n){const r=e[t];return r&&r.func?r.func.name:n}function ue(e,t,n){const r=e[t];return r&&r.type?oe(r.type):n}function le(e,t,n){const r=e[t];return r&&r.list&&r.list.type?r.list.type.map((e=>oe(e))):n}function ce(e){if(!e.unknownRank)return null!=e.dim?e.dim.map((e=>"number"==typeof e.size?e.size:parseInt(e.size,10))):[]}function pe(e,t,n){const r=e[t];return r&&r.shape?ce(r.shape):n}function de(e,t,n){const r=e[t];return r?((r.list.f&&r.list.f.length?r.list.f:r.list.i)||[]).map((e=>"number"==typeof e?e:parseInt(e,10))):n}function he(e,t,n,r=!1){const a=e[t];return a&&a.list&&a.list.s?a.list.s.map((e=>ne(e,r))):n}function me(e,t,n){const r=e[t];return r&&r.list&&r.list.shape?r.list.shape.map((e=>ce(e))):n}function fe(e,t,n){const r=e[t];return r&&r.list&&r.list.b?r.list.b:n}class ge{constructor(e,t,n){this.node=e,this.tensorMap=t,this.context=n,this.inputs=[],this.attrs={},this.inputs=e.inputNames.map((e=>this.getInput(e))),null!=e.rawAttrs&&(this.attrs=Object.keys(e.rawAttrs).reduce(((e,t)=>(e[t]=this.getAttr(t),e)),{}))}getInput(e){return M(e,this.tensorMap,this.context)}getAttr(e,t){const n=this.node.rawAttrs[e];if(null!=n.tensor)return M(e,this.tensorMap,this.context);if(null!=n.i||null!=n.f)return se(this.node.rawAttrs,e,t);if(null!=n.s)return re(this.node.rawAttrs,e,t);if(null!=n.b)return ae(this.node.rawAttrs,e,t);if(null!=n.shape)return pe(this.node.rawAttrs,e,t);if(null!=n.type)return ue(this.node.rawAttrs,e,t);if(null!=n.list){if(null!=n.list.i||null!=n.list.f)return de(this.node.rawAttrs,e,t);if(null!=n.list.s)return he(this.node.rawAttrs,e,t);if(null!=n.list.shape)return me(this.node.rawAttrs,e,t);if(null!=n.list.b)return fe(this.node.rawAttrs,e,t);if(null!=n.list.type)return le(this.node.rawAttrs,e,t)}return t}}var ye=n(6407),be=n(3135),ke=n(5228),we=n(4841),ve=n(1274),xe=n(9322),Ne=n(9165),Se=n(827),Ie=n(4513),Te=n(632),_e=n(3453),Ee=n(5265);var Ae=n(6235),Me=n(7839),$e=n(1470),De=n(2421),Fe=n(1891),Oe=n(7037),Be=n(9812),Ce=n(369),Ve=n(6825),Re=n(1661),ze=n(173),Pe=n(2699),Le=n(3233),We=n(4650),He=n(4842),qe=n(3426),Ge=n(6943),Ue=n(2597),je=n(7474),Ke=n(4386),Xe=n(7370),Ze=n(9036),Je=n(766),Qe=n(7409),Ye=n(7809),et=n(5503),tt=n(625),nt=n(9331),rt=n(4434),at=n(3254),st=n(3694),ot=n(3261),it=n(248),ut=n(1869),lt=n(1173),ct=n(2279),pt=n(3582),dt=n(2634),ht=n(9451),mt=n(9133),ft=n(8151),gt=n(6230);function yt(e,t,n=""){if("number"!=typeof e&&"number"!=typeof t){S.util.assert(e.length===t.length,(()=>n+` Shapes ${e} and ${t} must match`));for(let r=0;rn+` Shapes ${e} and ${t} must match`))}}}function bt(e){return"number"!=typeof e&&!e.some((e=>e<0))}function kt(e,t,n){let r=wt(e,n);const a=!bt(r);if(a&&0===t.length)throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${r}`);if(a&&t.forEach((e=>{r=wt(e.shape,r)})),!bt(r))throw new Error(`Non-fully-defined elementShape: ${r}`);return r}function wt(e,t){if("number"==typeof e)return t;if("number"==typeof t)return e;if(e.length!==t.length)throw new Error(`Incompatible ranks during merge: ${e} vs. ${t}`);const n=[];for(let r=0;r=0&&s>=0&&a!==s)throw new Error(`Incompatible shape during merge: ${e} vs. ${t}`);n[r]=a>=0?a:s}return n}class vt{constructor(e,t,n,r,a,s,o){this.name=e,this.dtype=t,this.maxSize=n,this.elementShape=r,this.identicalElementShapes=a,this.dynamicSize=s,this.clearAfterRead=o,this.tensors=[],this.closed_=!1,this.idTensor=(0,S.scalar)(0),(0,S.keep)(this.idTensor)}get id(){return this.idTensor.id}get closed(){return this.closed_}clearAndClose(e){this.tensors.forEach((t=>{null!=e&&e.has(t.tensor.id)||t.tensor.dispose()})),this.tensors=[],this.closed_=!0,this.idTensor.dispose()}size(){return this.tensors.length}read(e){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||e>=this.size())throw new Error(`Tried to read from index ${e}, but array size is: ${this.size()}`);const t=this.tensors[e];if(t.cleared)throw new Error(`TensorArray ${this.name}: Could not read index ${e} twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).`);return this.clearAfterRead&&(t.cleared=!0),t.read=!0,t.tensor}readMany(e){return e.map((e=>this.read(e)))}write(e,t){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||!this.dynamicSize&&e>=this.maxSize)throw new Error(`Tried to write to index ${e}, but array is not resizeable and size is: ${this.maxSize}`);const n=this.tensors[e]||{};if(t.dtype!==this.dtype)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e},\n because the value dtype is ${t.dtype}, but TensorArray dtype is ${this.dtype}.`);if(0!==this.size()||null!=this.elementShape&&0!==this.elementShape.length||(this.elementShape=t.shape),yt(this.elementShape,t.shape,`TensorArray ${this.name}: Could not write to TensorArray index ${e}.`),n.read)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been read.`);if(n.written)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been written.`);n.tensor=t,(0,S.keep)(t),n.written=!0,this.tensors[e]=n}writeMany(e,t){if(e.length!==t.length)throw new Error(`TensorArray ${this.name}: could not write multiple tensors,because the index size: ${e.length} is not the same as tensors size: ${t.length}.`);e.forEach(((e,n)=>this.write(e,t[n])))}gather(e,t){if(t&&t!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but gather requested dtype ${t}`);if(e)e=e.slice(0,this.size());else{e=[];for(let t=0;t=this.maxSize)throw new Error(`Max index must be < array size (${n} vs. ${this.maxSize})`);this.writeMany(e,(0,S.unstack)(t,0))}split(e,t){if(t.dtype!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${t.dtype}`);let n=0;const r=e.map((e=>(n+=e,n)));if(n!==t.shape[0])throw new Error(`Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ${n}, and tensor's shape is: ${t.shape}`);if(!this.dynamicSize&&e.length!==this.maxSize)throw new Error(`TensorArray's size is not equal to the size of lengths (${this.maxSize} vs. ${e.length}), and the TensorArray is not marked as dynamically resizeable`);const a=0===n?0:t.size/n,s=[];(0,S.tidy)((()=>{t=(0,S.reshape)(t,[1,n,a]);for(let n=0;n{if(n!==e.dtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${e.dtype}`);yt(t,e.shape,"TensorList shape mismatch: "),(0,S.keep)(e)})),this.idTensor=(0,S.scalar)(0),this.maxNumElements=r,(0,S.keep)(this.idTensor)}get id(){return this.idTensor.id}copy(){return new xt([...this.tensors],this.elementShape,this.elementDtype)}clearAndClose(e){this.tensors.forEach((t=>{null!=e&&e.has(t.id)||t.dispose()})),this.tensors.length=0,this.idTensor.dispose()}size(){return this.tensors.length}stack(e,t,n=-1){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(-1!==n&&this.tensors.length!==n)throw new Error(`Operation expected a list with ${n} elements but got a list with ${this.tensors.length} elements.`);yt(e,this.elementShape,"TensorList shape mismatch: ");const r=kt(this.elementShape,this.tensors,e);return(0,S.tidy)((()=>{const e=this.tensors.map((e=>(0,S.reshape)(e,r)));return(0,S.stack)(e,0)}))}popBack(e,t){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(0===this.size())throw new Error("Trying to pop from an empty list.");const n=kt(this.elementShape,this.tensors,e),r=this.tensors.pop();return yt(r.shape,e,"TensorList shape mismatch: "),(0,S.reshape)(r,n)}pushBack(e){if(e.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${this.elementDtype}`);if(yt(e.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");(0,S.keep)(e),this.tensors.push(e)}resize(e){if(e<0)throw new Error(`TensorListResize expects size to be non-negative. Got: ${e}`);if(-1!==this.maxNumElements&&e>this.maxNumElements)throw new Error(`TensorListResize input size ${e} is greater maxNumElement ${this.maxNumElements}.`);this.tensors.length=e}getItem(e,t,n){if(n!==this.elementDtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${this.elementDtype}`);if(e<0||e>this.tensors.length)throw new Error(`Trying to access element ${e} in a list with ${this.tensors.length} elements.`);if(null==this.tensors[e])throw new Error(`element at index ${e} is null.`);yt(this.tensors[e].shape,t,"TensorList shape mismatch: ");const r=kt(this.elementShape,this.tensors,t);return(0,S.reshape)(this.tensors[e],r)}setItem(e,t){if(t.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t.dtype}, but list elements ${this.elementDtype}`);if(e<0||-1!==this.maxNumElements&&e>=this.maxNumElements)throw new Error(`Trying to set element ${e} in a list with max ${this.maxNumElements} elements.`);yt(this.elementShape,t.shape,"TensorList shape mismatch: "),(0,S.keep)(t),this.tensors[e]=t}gather(e,t,n){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);yt(this.elementShape,n,"TensorList shape mismatch: "),e=e.slice(0,this.size());const r=kt(this.elementShape,this.tensors,n);return 0===e.length?(0,S.tensor)([],[0].concat(r)):(0,S.tidy)((()=>{const t=e.map((e=>(0,S.reshape)(this.tensors[e],r)));return(0,S.stack)(t,0)}))}concat(e,t){if(e&&e!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${e}`);yt(this.elementShape,t,"TensorList shape mismatch: ");const n=kt(this.elementShape,this.tensors,t);return 0===this.size()?(0,S.tensor)([],[0].concat(n)):(0,S.tidy)((()=>{const e=this.tensors.map((e=>(0,S.reshape)(e,n)));return(0,S.concat)(e,0)}))}}const Nt=async(e,t,n)=>{switch(e.op){case"If":case"StatelessIf":{const r=A("thenBranch",e,t,n),a=A("elseBranch",e,t,n),s=A("cond",e,t,n),o=A("args",e,t,n);return(await s.data())[0]?n.functionMap[r].executeFunctionAsync(o,n.tensorArrayMap,n.tensorListMap):n.functionMap[a].executeFunctionAsync(o,n.tensorArrayMap,n.tensorListMap)}case"While":case"StatelessWhile":{const r=A("body",e,t,n),a=A("cond",e,t,n),s=A("args",e,t,n),o=await n.functionMap[a].executeFunctionAsync(s,n.tensorArrayMap,n.tensorListMap),i=s.map((e=>e.id));let u=await o[0].data();o.forEach((e=>{e.kept||-1!==i.indexOf(e.id)||e.dispose()}));let l=s;for(;u[0];){const e=l;l=await n.functionMap[r].executeFunctionAsync(l,n.tensorArrayMap,n.tensorListMap);const t=l.map((e=>e.id));e.forEach((e=>{e.kept||-1!==i.indexOf(e.id)||-1!==t.indexOf(e.id)||e.dispose()}));const s=await n.functionMap[a].executeFunctionAsync(l,n.tensorArrayMap,n.tensorListMap);u=await s[0].data(),s.forEach((e=>{e.kept||-1!==i.indexOf(e.id)||-1!==t.indexOf(e.id)||e.dispose()}))}return l}case"LoopCond":return[B(A("pred",e,t,n))];case"Switch":{const r=A("pred",e,t,n);let a=A("data",e,t,n);return a.kept||(a=B(a)),(await r.data())[0]?[void 0,a]:[a,void 0]}case"Merge":{const r=e.inputNames.find((e=>void 0!==M(e,t,n)));if(r){return[B(M(r,t,n))]}return}case"Enter":{const r=A("frameName",e,t,n),a=A("tensor",e,t,n);return n.enterFrame(r),[B(a)]}case"Exit":{const r=A("tensor",e,t,n);return n.exitFrame(),[B(r)]}case"NextIteration":{const r=A("tensor",e,t,n);return n.nextIteration(),[B(r)]}case"TensorArrayV3":{const r=A("size",e,t,n),a=A("dtype",e,t,n),s=A("elementShape",e,t,n),o=A("dynamicSize",e,t,n),i=A("clearAfterRead",e,t,n),u=A("identicalElementShapes",e,t,n),l=A("name",e,t,n),c=new vt(l,a,r,s,u,o,i);return n.addTensorArray(c),[c.idTensor,(0,S.scalar)(1)]}case"TensorArrayWriteV3":{const r=A("tensorArrayId",e,t,n),a=A("index",e,t,n),s=A("tensor",e,t,n),o=n.getTensorArray(r.id);return o.write(a,s),[o.idTensor]}case"TensorArrayReadV3":{const r=A("tensorArrayId",e,t,n),a=A("index",e,t,n);return[n.getTensorArray(r.id).read(a)]}case"TensorArrayGatherV3":{const r=A("tensorArrayId",e,t,n),a=A("indices",e,t,n),s=A("dtype",e,t,n);return[n.getTensorArray(r.id).gather(a,s)]}case"TensorArrayScatterV3":{const r=A("tensorArrayId",e,t,n),a=A("indices",e,t,n),s=A("tensor",e,t,n),o=n.getTensorArray(r.id);return o.scatter(a,s),[o.idTensor]}case"TensorArrayConcatV3":{const r=A("tensorArrayId",e,t,n),a=n.getTensorArray(r.id),s=A("dtype",e,t,n);return[a.concat(s)]}case"TensorArraySplitV3":{const r=A("tensorArrayId",e,t,n),a=A("tensor",e,t,n),s=A("lengths",e,t,n),o=n.getTensorArray(r.id);return o.split(s,a),[o.idTensor]}case"TensorArraySizeV3":{const r=A("tensorArrayId",e,t,n),a=n.getTensorArray(r.id);return[(0,S.scalar)(a.size(),"int32")]}case"TensorArrayCloseV3":{const r=A("tensorArrayId",e,t,n),a=n.getTensorArray(r.id);return a.clearAndClose(),[a.idTensor]}case"TensorListSetItem":{const r=A("tensorListId",e,t,n),a=A("index",e,t,n),s=A("tensor",e,t,n),o=n.getTensorList(r.id);return o.setItem(a,s),[o.idTensor]}case"TensorListGetItem":{const r=A("tensorListId",e,t,n),a=A("index",e,t,n),s=A("elementShape",e,t,n),o=A("elementDType",e,t,n);return[n.getTensorList(r.id).getItem(a,s,o)]}case"TensorListScatterV2":case"TensorListScatter":{const r=A("indices",e,t,n),a=function(e,t,n,r){if(t.length!==e.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${t.length} vs. ${e.shape[0]}`);const a=Math.max(...t);if(null!=r&&-1!==r&&a>=r)throw new Error(`Max index must be < array size (${a} vs. ${r})`);const s=new xt([],n,e.dtype,r),o=(0,S.unstack)(e,0);return t.forEach(((e,t)=>{s.setItem(e,o[t])})),s}(A("tensor",e,t,n),r,A("elementShape",e,t,n),A("numElements",e,t,n));return n.addTensorList(a),[a.idTensor]}case"TensorListReserve":case"EmptyTensorList":{const r=A("elementShape",e,t,n),a=A("elementDType",e,t,n);let s;s="TensorListReserve"===e.op?"numElements":"maxNumElements";const o=function(e,t,n){return new xt([],e,t,n)}(r,a,A(s,e,t,n));return n.addTensorList(o),[o.idTensor]}case"TensorListGather":{const r=A("tensorListId",e,t,n),a=A("indices",e,t,n),s=A("elementShape",e,t,n),o=A("elementDType",e,t,n);return[n.getTensorList(r.id).gather(a,o,s)]}case"TensorListStack":{const r=A("tensorListId",e,t,n),a=A("elementShape",e,t,n),s=A("elementDType",e,t,n),o=A("numElements",e,t,n);return[n.getTensorList(r.id).stack(a,s,o)]}case"TensorListFromTensor":{const r=function(e,t,n){const r=e.dtype;if(e.shape.length<1)throw new Error(`Tensor must be at least a vector, but saw shape: ${e.shape}`);if(e.dtype!==n)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${n}`);yt(e.shape.slice(1),t,"TensorList shape mismatch: ");const a=(0,S.unstack)(e);return new xt(a,t,r)}(A("tensor",e,t,n),A("elementShape",e,t,n),A("elementDType",e,t,n));return n.addTensorList(r),[r.idTensor]}case"TensorListConcat":{const r=A("tensorListId",e,t,n),a=n.getTensorList(r.id),s=A("dtype",e,t,n),o=A("elementShape",e,t,n);return[a.concat(s,o)]}case"TensorListPushBack":{const r=A("tensorListId",e,t,n),a=A("tensor",e,t,n),s=n.getTensorList(r.id);return s.pushBack(a),[s.idTensor]}case"TensorListPopBack":{const r=A("tensorListId",e,t,n),a=A("elementShape",e,t,n),s=A("elementDType",e,t,n);return[n.getTensorList(r.id).popBack(a,s)]}case"TensorListSplit":{const r=A("tensor",e,t,n),a=A("elementShape",e,t,n),s=function(e,t,n){let r=0;const a=t.map((e=>(r+=e,r)));if(r!==e.shape[0])throw new Error(`Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ${r}, and tensor's shape is: ${e.shape}`);const s=wt(e.shape.slice(1),n),o=0===r?0:e.size/r,i=(0,S.tidy)((()=>{const n=[];e=(0,S.reshape)(e,[1,r,o]);for(let r=0;re.dispose())),this.tensorMap.clear(),this.handle.dispose()}size(){return this.tensorMap.size}tensorSize(){return nn.i(this.size(),"int32")}async import(e,t){this.checkKeyAndValueTensor(e,t);const n=await e.data();return this.tensorMap.forEach((e=>e.dispose())),this.tensorMap.clear(),(0,S.tidy)((()=>{const e=(0,S.unstack)(t),r=n.length,a=e.length;S.util.assert(r===a,(()=>`The number of elements doesn't match, keys has ${r} elements, the values has ${a} elements.`));for(let t=0;t{const e=[];for(let r=0;r{switch(e.category){case"arithmetic":return S.tidy((()=>((e,t,n)=>{switch(e.op){case"BiasAdd":case"AddV2":case"Add":return[ye.I(A("a",e,t,n),A("b",e,t,n))];case"AddN":return[be.Q(A("tensors",e,t,n))];case"FloorMod":case"Mod":return[ke.w(A("a",e,t,n),A("b",e,t,n))];case"Mul":return[we.d(A("a",e,t,n),A("b",e,t,n))];case"RealDiv":case"Div":return[ve.h(A("a",e,t,n),A("b",e,t,n))];case"DivNoNan":return[xe.N(A("a",e,t,n),A("b",e,t,n))];case"FloorDiv":return[Ne.q(A("a",e,t,n),A("b",e,t,n))];case"Sub":return[Se.l(A("a",e,t,n),A("b",e,t,n))];case"Minimum":return[Ie.L(A("a",e,t,n),A("b",e,t,n))];case"Maximum":return[Te.g(A("a",e,t,n),A("b",e,t,n))];case"Pow":return[_e.s(A("a",e,t,n),A("b",e,t,n))];case"SquaredDifference":return[Ee.$(A("a",e,t,n),A("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"basic_math":return S.tidy((()=>((e,t,n)=>{switch(e.op){case"Abs":case"ComplexAbs":return[Ae.W(A("x",e,t,n))];case"Acos":return[Me.K(A("x",e,t,n))];case"Acosh":return[$e._(A("x",e,t,n))];case"Asin":return[De.Z(A("x",e,t,n))];case"Asinh":return[Fe.V(A("x",e,t,n))];case"Atan":return[Oe.z(A("x",e,t,n))];case"Atan2":return[Be.f(A("x",e,t,n),A("y",e,t,n))];case"Atanh":return[Ce.C(A("x",e,t,n))];case"Ceil":return[Ve.m(A("x",e,t,n))];case"Complex":return[Re.P(A("real",e,t,n),A("imag",e,t,n))];case"Cos":return[ze.m(A("x",e,t,n))];case"Cosh":return[Pe.f(A("x",e,t,n))];case"Elu":return[Le.p(A("x",e,t,n))];case"Erf":return[We.q(A("x",e,t,n))];case"Exp":return[He.Q(A("x",e,t,n))];case"Expm1":return[qe.t(A("x",e,t,n))];case"Floor":return[Ge.G(A("x",e,t,n))];case"Log":return[Ue.c(A("x",e,t,n))];case"Log1p":return[je.K(A("x",e,t,n))];case"Imag":return[Ke.a(A("x",e,t,n))];case"Neg":return[Xe.W(A("x",e,t,n))];case"Reciprocal":return[Ze.M(A("x",e,t,n))];case"Real":return[Je.k(A("x",e,t,n))];case"Relu":return[Qe.U(A("x",e,t,n))];case"Round":return[Ye.N(A("x",e,t,n))];case"Selu":return[et.U(A("x",e,t,n))];case"Sigmoid":return[tt.X(A("x",e,t,n))];case"Sin":return[nt.O(A("x",e,t,n))];case"Sign":return[rt.X(A("x",e,t,n))];case"Sinh":return[at.R(A("x",e,t,n))];case"Softplus":return[st.W(A("x",e,t,n))];case"Sqrt":return[ot._(A("x",e,t,n))];case"Square":return[it.h(A("x",e,t,n))];case"Tanh":return[ut.A(A("x",e,t,n))];case"Tan":return[lt.O(A("x",e,t,n))];case"ClipByValue":return[ct.i(A("x",e,t,n),A("clipValueMin",e,t,n),A("clipValueMax",e,t,n))];case"Relu6":return[pt.b(A("x",e,t,n))];case"Rsqrt":return[dt.b(M(e.inputNames[0],t,n))];case"Prod":return[ht.W(A("x",e,t,n),A("axes",e,t,n))];case"LeakyRelu":return[mt.h(A("x",e,t,n),A("alpha",e,t,n))];case"Prelu":return[ft.A(A("x",e,t,n),A("alpha",e,t,n))];case"IsNan":return[gt.i(M(e.inputNames[0],t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"control":return Nt(e,t,n);case"convolution":return S.tidy((()=>((e,t,n)=>{switch(e.op){case"Conv1D":{const r=A("stride",e,t,n),a=A("pad",e,t,n),s=A("dataFormat",e,t,n).toUpperCase(),o=A("dilation",e,t,n);return[St.P(A("x",e,t,n),A("filter",e,t,n),r,a,s,o)]}case"Conv2D":{const r=A("strides",e,t,n),a=O(e,t,n),s=A("dataFormat",e,t,n).toUpperCase(),o=A("dilations",e,t,n);return[It.T(A("x",e,t,n),A("filter",e,t,n),[r[1],r[2]],a,s,[o[1],o[2]])]}case"_FusedConv2D":{const{stride:r,pad:a,dataFormat:s,dilations:o,biasArg:i,preluArg:u,activationFunc:l,leakyreluAlpha:c}=Ct(e,t,n);return[Tt.conv2d({x:A("x",e,t,n),filter:A("filter",e,t,n),strides:[r[1],r[2]],pad:a,dataFormat:s,dilations:[o[1],o[2]],bias:i,activation:l,preluActivationWeights:u,leakyreluAlpha:c})]}case"FusedDepthwiseConv2dNative":{const{stride:r,pad:a,dataFormat:s,dilations:o,biasArg:i,preluArg:u,activationFunc:l,leakyreluAlpha:c}=Ct(e,t,n);return[Tt.depthwiseConv2d({x:A("x",e,t,n),filter:A("filter",e,t,n),strides:[r[1],r[2]],pad:a,dataFormat:s,dilations:[o[1],o[2]],bias:i,activation:l,preluActivationWeights:u,leakyreluAlpha:c})]}case"Conv2DBackpropInput":case"Conv2dTranspose":{const r=A("outputShape",e,t,n),a=A("strides",e,t,n),s=O(e,t,n);return[_t.b(A("x",e,t,n),A("filter",e,t,n),r,[a[1],a[2]],s)]}case"DepthwiseConv2dNative":case"DepthwiseConv2d":{const r=A("strides",e,t,n),a=O(e,t,n),s=A("dilations",e,t,n),o=A("dataFormat",e,t,n).toUpperCase();return[Et.B(A("input",e,t,n),A("filter",e,t,n),[r[1],r[2]],a,o,[s[1],s[2]])]}case"Conv3D":{const r=A("strides",e,t,n),a=A("pad",e,t,n),s=A("dataFormat",e,t,n).toUpperCase(),o=A("dilations",e,t,n);return[At.p(A("x",e,t,n),A("filter",e,t,n),[r[1],r[2],r[3]],a,s,[o[1],o[2],o[3]])]}case"AvgPool":{const r=A("strides",e,t,n),a=A("pad",e,t,n),s=A("kernelSize",e,t,n);return[Mt.w(A("x",e,t,n),[s[1],s[2]],[r[1],r[2]],a)]}case"MaxPool":{const r=A("strides",e,t,n),a=A("pad",e,t,n),s=A("kernelSize",e,t,n);return[$t._(A("x",e,t,n),[s[1],s[2]],[r[1],r[2]],a)]}case"MaxPoolWithArgmax":{const r=A("strides",e,t,n),a=A("pad",e,t,n),s=A("kernelSize",e,t,n),o=A("includeBatchInIndex",e,t,n),{result:i,indexes:u}=Dt.I(A("x",e,t,n),[s[1],s[2]],[r[1],r[2]],a,o);return[i,u]}case"AvgPool3D":{const r=A("strides",e,t,n),a=A("pad",e,t,n),s=A("kernelSize",e,t,n);return[Ft.u(A("x",e,t,n),[s[1],s[2],s[3]],[r[1],r[2],r[3]],a)]}case"MaxPool3D":{const r=A("strides",e,t,n),a=A("pad",e,t,n),s=A("kernelSize",e,t,n);return[Ot.Y(A("x",e,t,n),[s[1],s[2],s[3]],[r[1],r[2],r[3]],a)]}case"Dilation2D":{const r=A("strides",e,t,n),a=A("pad",e,t,n),s=A("dilations",e,t,n),o=r[1],i=r[2],u=s[1],l=s[2];return[Bt.W(A("x",e,t,n),A("filter",e,t,n),[o,i],a,[u,l],"NHWC")]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"creation":return S.tidy((()=>((e,t,n)=>{switch(e.op){case"Fill":{const r=A("shape",e,t,n),a=A("dtype",e,t,n),s=A("value",e,t,n);return[Vt.h(r,s,a)]}case"LinSpace":{const r=A("start",e,t,n),a=A("stop",e,t,n),s=A("num",e,t,n);return[Rt.S(r,a,s)]}case"Multinomial":{const r=A("logits",e,t,n),a=A("numSamples",e,t,n),s=A("seed",e,t,n);return[zt.S(r,a,s)]}case"OneHot":{const r=A("indices",e,t,n),a=A("depth",e,t,n),s=A("onValue",e,t,n),o=A("offValue",e,t,n);return[Pt.l(r,a,s,o)]}case"Ones":return[Lt.i(A("shape",e,t,n),A("dtype",e,t,n))];case"OnesLike":return[Wt.J(A("x",e,t,n))];case"RandomUniform":return[Ht.L(A("shape",e,t,n),A("minval",e,t,n),A("maxval",e,t,n),A("dtype",e,t,n))];case"Range":{const r=A("start",e,t,n),a=A("stop",e,t,n),s=A("step",e,t,n);return[qt.w(r,a,s,A("dtype",e,t,n))]}case"TruncatedNormal":{const r=A("shape",e,t,n),a=A("mean",e,t,n),s=A("stdDev",e,t,n),o=A("seed",e,t,n);return[Gt.X(r,a,s,A("dtype",e,t,n),o)]}case"Zeros":return[Ut.l(A("shape",e,t,n),A("dtype",e,t,n))];case"ZerosLike":return[jt.P(A("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"dynamic":return(async(e,t,n)=>{switch(e.op){case"NonMaxSuppressionV5":{const{boxes:r,scores:a,maxOutputSize:s,iouThreshold:o,scoreThreshold:i,softNmsSigma:u}=Qt(e,t,n),l=await Kt.BHj.nonMaxSuppressionWithScoreAsync(r,a,s,o,i,u);return[l.selectedIndices,l.selectedScores]}case"NonMaxSuppressionV4":{const{boxes:r,scores:a,maxOutputSize:s,iouThreshold:o,scoreThreshold:i}=Qt(e,t,n),u=A("padToMaxOutputSize",e,t,n),l=await Kt.BHj.nonMaxSuppressionPaddedAsync(r,a,s,o,i,u);return[l.selectedIndices,l.validOutputs]}case"NonMaxSuppressionV3":case"NonMaxSuppressionV2":{const{boxes:r,scores:a,maxOutputSize:s,iouThreshold:o,scoreThreshold:i}=Qt(e,t,n);return[await Kt.BHj.nonMaxSuppressionAsync(r,a,s,o,i)]}case"Where":{const r=Xt.p(A("condition",e,t,n),"bool"),a=[await Zt.i(r)];return r.dispose(),a}case"ListDiff":return Jt.O(A("x",e,t,n),A("y",e,t,n));default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n);case"evaluation":return S.tidy((()=>((e,t,n)=>{switch(e.op){case"TopKV2":{const r=A("x",e,t,n),a=A("k",e,t,n),s=A("sorted",e,t,n),o=Yt.h(r,a,s);return[o.values,o.indices]}case"Unique":{const r=A("x",e,t,n),a=en.T(r);return[a.values,a.indices]}case"UniqueV2":{const r=A("x",e,t,n),a=A("axis",e,t,n),s=en.T(r,a);return[s.values,s.indices]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"image":return S.tidy((()=>((e,t,n)=>{switch(e.op){case"ResizeBilinear":{const r=A("images",e,t,n),a=A("size",e,t,n),s=A("alignCorners",e,t,n),o=A("halfPixelCenters",e,t,n);return[Kt.BHj.resizeBilinear(r,[a[0],a[1]],s,o)]}case"ResizeNearestNeighbor":{const r=A("images",e,t,n),a=A("size",e,t,n),s=A("alignCorners",e,t,n),o=A("halfPixelCenters",e,t,n);return[Kt.BHj.resizeNearestNeighbor(r,[a[0],a[1]],s,o)]}case"CropAndResize":{const r=A("image",e,t,n),a=A("boxes",e,t,n),s=A("boxInd",e,t,n),o=A("cropSize",e,t,n),i=A("method",e,t,n),u=A("extrapolationValue",e,t,n);return[Kt.BHj.cropAndResize(r,a,s,o,i,u)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"graph":return S.tidy((()=>((e,t,n)=>{switch(e.op){case"Const":return t[e.name];case"PlaceholderWithDefault":const r=A("default",e,t,n);return[M(e.name,t,n)||r];case"Placeholder":return[M(e.name,t,n)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":return[B(A("x",e,t,n))];case"IdentityN":return A("x",e,t,n).map((e=>B(e)));case"Snapshot":return[B(A("x",e,t,n))];case"Shape":return[tn.R(A("x",e,t,n).shape,"int32")];case"ShapeN":return A("x",e,t,n).map((e=>tn.R(e.shape)));case"Size":return[nn.i(A("x",e,t,n).size,"int32")];case"Rank":return[nn.i(A("x",e,t,n).rank,"int32")];case"NoOp":return[nn.i(1)];case"Print":const a=A("x",e,t,n),s=A("data",e,t,n),o=A("message",e,t,n),i=A("summarize",e,t,n);console.warn("The graph has a tf.print() operation,usually used for debugging, which slows down performance."),console.log(o);for(let e=0;e((e,t,n)=>{switch(e.op){case"Equal":return[an.D(A("a",e,t,n),A("b",e,t,n))];case"NotEqual":return[sn.Q(A("a",e,t,n),A("b",e,t,n))];case"Greater":return[on.p(A("a",e,t,n),A("b",e,t,n))];case"GreaterEqual":return[un.b(A("a",e,t,n),A("b",e,t,n))];case"Less":return[ln.d(A("a",e,t,n),A("b",e,t,n))];case"LessEqual":return[cn.z(A("a",e,t,n),A("b",e,t,n))];case"LogicalAnd":return[pn.H(A("a",e,t,n),A("b",e,t,n))];case"LogicalNot":return[dn.h(A("a",e,t,n))];case"LogicalOr":return[hn.K(A("a",e,t,n),A("b",e,t,n))];case"Select":case"SelectV2":return[mn.a(A("condition",e,t,n),A("a",e,t,n),A("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"matrices":return S.tidy((()=>((e,t,n)=>{switch(e.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[fn.O(A("a",e,t,n),A("b",e,t,n),A("transposeA",e,t,n),A("transposeB",e,t,n))];case"Einsum":return[gn.W(A("equation",e,t,n),...A("tensors",e,t,n))];case"Transpose":return[yn.p(A("x",e,t,n),A("perm",e,t,n))];case"_FusedMatMul":const[r,a]=A("fusedOps",e,t,n),s="biasadd"===r,o="prelu"===a,i=A("numArgs",e,t,n),u=A("leakyreluAlpha",e,t,n);if(s){if(o&&2!==i)throw new Error("Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!o&&1!==i)throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias.")}const[l,c]=A("args",e,t,n);return[Tt.matMul({a:A("a",e,t,n),b:A("b",e,t,n),transposeA:A("transposeA",e,t,n),transposeB:A("transposeB",e,t,n),bias:l,activation:a,preluActivationWeights:c,leakyreluAlpha:u})];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"normalization":return S.tidy((()=>((e,t,n)=>{switch(e.op){case"FusedBatchNorm":case"FusedBatchNormV2":case"FusedBatchNormV3":return[bn.t(A("x",e,t,n),A("mean",e,t,n),A("variance",e,t,n),A("offset",e,t,n),A("scale",e,t,n),A("epsilon",e,t,n))];case"LRN":return[kn.G(A("x",e,t,n),A("radius",e,t,n),A("bias",e,t,n),A("alpha",e,t,n),A("beta",e,t,n))];case"Softmax":return[wn.X(A("x",e,t,n))];case"LogSoftmax":return[vn.C(A("x",e,t,n))];case"SparseToDense":return[xn.e(A("sparseIndices",e,t,n),A("outputShape",e,t,n),A("sparseValues",e,t,n),A("defaultValue",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"reduction":return S.tidy((()=>((e,t,n)=>{switch(e.op){case"Max":{const r=A("axis",e,t,n),a=A("keepDims",e,t,n);return[Nn.F(A("x",e,t,n),r,a)]}case"Mean":{const r=A("axis",e,t,n),a=A("keepDims",e,t,n);return[Sn.J(A("x",e,t,n),r,a)]}case"Min":{const r=A("axis",e,t,n),a=A("keepDims",e,t,n);return[In.V(A("x",e,t,n),r,a)]}case"Sum":{const r=A("axis",e,t,n),a=A("keepDims",e,t,n);return[Tn.S(A("x",e,t,n),r,a)]}case"All":{const r=A("axis",e,t,n),a=A("keepDims",e,t,n);return[_n.$(A("x",e,t,n),r,a)]}case"Any":{const r=A("axis",e,t,n),a=A("keepDims",e,t,n);return[En.Y(A("x",e,t,n),r,a)]}case"ArgMax":{const r=A("axis",e,t,n);return[An.N(A("x",e,t,n),r)]}case"ArgMin":{const r=A("axis",e,t,n);return[Mn.v(A("x",e,t,n),r)]}case"Prod":{const r=A("axis",e,t,n),a=A("keepDims",e,t,n);return[ht.W(A("x",e,t,n),r,a)]}case"Cumsum":{const r=A("axis",e,t,n),a=A("exclusive",e,t,n),s=A("reverse",e,t,n);return[$n.z(A("x",e,t,n),r,a,s)]}case"Bincount":const r=A("x",e,t,n),a=A("weights",e,t,n),s=A("size",e,t,n);return[Dn.y(r,a,s)];case"DenseBincount":{const r=A("x",e,t,n),a=A("weights",e,t,n),s=A("size",e,t,n),o=A("binaryOutput",e,t,n);return[Fn.p(r,a,s,o)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"slice_join":return S.tidy((()=>((e,t,n)=>{switch(e.op){case"ConcatV2":case"Concat":{const r=A("n",e,t,n),a=A("axis",e,t,n);let s=A("tensors",e,t,n);return s=s.slice(0,r),[On.z(s,a)]}case"Gather":{const r=A("x",e,t,n),a=A("indices",e,t,n);return[Bn.I(r,Xt.p(a,"int32"),0)]}case"GatherV2":{const r=A("axis",e,t,n),a=A("batchDims",e,t,n),s=A("x",e,t,n),o=A("indices",e,t,n);return[Bn.I(s,Xt.p(o,"int32"),r,a)]}case"Reverse":{const r=A("dims",e,t,n),a=[];for(let e=0;e{const r=A("axis",e,t,n),a=A("tensors",e,t,n),s=a[0].shape,o=zn.L(a[0]).shape,i=a.map((e=>{const t=S.util.arraysEqual(e.shape,s);if(!t&&!S.util.arraysEqual(zn.L(e).shape,o))throw new Error("the input tensors shape does not match");return t?e:Pn.X(e,s)}));return[Ln.k(i,r)]}));case"Unpack":{const r=A("axis",e,t,n),a=A("tensor",e,t,n);return Wn.H(a,r)}case"Tile":{const r=A("reps",e,t,n);return[Hn.G(A("x",e,t,n),r)]}case"Split":case"SplitV":{const r=A("axis",e,t,n),a=A("numOrSizeSplits",e,t,n),s=A("x",e,t,n);return qn.V(s,a,r)}case"ScatterNd":{const r=A("indices",e,t,n),a=A("values",e,t,n),s=A("shape",e,t,n);return[Gn.s(r,a,s)]}case"GatherNd":{const r=A("x",e,t,n),a=A("indices",e,t,n);return[Un.d(r,a)]}case"SparseToDense":{const r=A("sparseIndices",e,t,n),a=A("outputShape",e,t,n),s=A("sparseValues",e,t,n),o=A("defaultValue",e,t,n);return[xn.e(r,s,a,s.dtype===o.dtype?o:Xt.p(o,s.dtype))]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"sparse":return S.tidy((()=>((e,t,n)=>{switch(e.op){case"SparseFillEmptyRows":{const{outputIndices:r,outputValues:a,emptyRowIndicator:s,reverseIndexMap:o}=Kt.rVs.sparseFillEmptyRows(A("indices",e,t,n),A("values",e,t,n),A("denseShape",e,t,n),A("defaultValue",e,t,n));return[r,a,s,o]}case"SparseReshape":{const{outputIndices:r,outputShape:a}=Kt.rVs.sparseReshape(A("inputIndices",e,t,n),A("inputShape",e,t,n),A("newShape",e,t,n));return[r,a]}case"SparseSegmentMean":return[Kt.rVs.sparseSegmentMean(A("data",e,t,n),A("indices",e,t,n),A("segmentIds",e,t,n))];case"SparseSegmentSum":return[Kt.rVs.sparseSegmentSum(A("data",e,t,n),A("indices",e,t,n),A("segmentIds",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"spectral":return S.tidy((()=>((e,t,n)=>{switch(e.op){case"FFT":return[jn.k(A("x",e,t,n))];case"IFFT":return[Kn.S(A("x",e,t,n))];case"RFFT":return[Xn.Q(A("x",e,t,n))];case"IRFFT":return[Zn.w(A("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"string":return S.tidy((()=>((e,t,n)=>{switch(e.op){case"StringNGrams":{const{nGrams:r,nGramsSplits:a}=Kt.Z_8.stringNGrams(A("data",e,t,n),A("dataSplits",e,t,n),A("separator",e,t,n),A("nGramWidths",e,t,n),A("leftPad",e,t,n),A("rightPad",e,t,n),A("padWidth",e,t,n),A("preserveShortSequences",e,t,n));return[r,a]}case"StringSplit":{const{indices:r,values:a,shape:s}=Kt.Z_8.stringSplit(A("input",e,t,n),A("delimiter",e,t,n),A("skipEmpty",e,t,n));return[r,a,s]}case"StringToHashBucketFast":return[Kt.Z_8.stringToHashBucketFast(A("input",e,t,n),A("numBuckets",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"transformation":return S.tidy((()=>((e,t,n)=>{switch(e.op){case"Cast":return[Xt.p(A("x",e,t,n),A("dtype",e,t,n))];case"ExpandDims":{const r=A("axis",e,t,n);return[Jn.d(A("x",e,t,n),r)]}case"Squeeze":{const r=A("axis",e,t,n);return[zn.L(A("x",e,t,n),r)]}case"Reshape":return[Pn.X(A("x",e,t,n),A("shape",e,t,n))];case"MirrorPad":return[Qn.V(A("x",e,t,n),A("padding",e,t,n),A("mode",e,t,n))];case"PadV2":case"Pad":return[Yn.v(A("x",e,t,n),A("padding",e,t,n),A("constantValue",e,t,n))];case"SpaceToBatchND":{const r=A("blockShape",e,t,n),a=A("paddings",e,t,n);return[er.f(A("x",e,t,n),r,a)]}case"BatchToSpaceND":{const r=A("blockShape",e,t,n),a=A("crops",e,t,n);return[tr.E(A("x",e,t,n),r,a)]}case"DepthToSpace":{const r=A("blockSize",e,t,n),a=A("dataFormat",e,t,n).toUpperCase();return[nr.n(A("x",e,t,n),r,a)]}case"BroadcastTo":return[rr.U(A("x",e,t,n),A("shape",e,t,n))];case"BroadcastArgs":return[ar.X(A("s0",e,t,n),A("s1",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n)));case"hash_table":return(async(e,t,n,r)=>{switch(e.op){case"HashTable":case"HashTableV2":{const a=A("keyDType",e,t,n),s=A("valueDType",e,t,n),o=new rn(a,s);return r.addHashTable(e.name,o),[o.handle]}case"LookupTableImport":case"LookupTableImportV2":{const a=A("tableHandle",e,t,n,r),s=A("keys",e,t,n),o=A("values",e,t,n),i=r.getHashTableById(a.id);return[await i.import(s,o)]}case"LookupTableFind":case"LookupTableFindV2":{const a=A("tableHandle",e,t,n,r),s=A("keys",e,t,n),o=A("defaultValue",e,t,n),i=r.getHashTableById(a.id);return[await i.find(s,o)]}case"LookupTableSize":case"LookupTableSizeV2":{const a=A("tableHandle",e,t,n,r);return[r.getHashTableById(a.id).tensorSize()]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n,r);case"custom":const a=_(e.op);if(a&&a.customExecutor)return a.customExecutor(new ge(e,t,n));throw TypeError(`Custom op ${e.op} is not registered.`);default:throw TypeError(`Unknown op '${e.op}'. File an issue at https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()`)}})(e,t,n);return S.util.isPromise(a)?a.then((e=>[].concat(e))):[].concat(a)}class or{constructor(e={},t={},n={},r={}){this.weightMap=e,this.tensorArrayMap=t,this.tensorListMap=n,this.functionMap=r,this.rootContext={id:0,frameName:"",iterationId:0},this.contexts=[this.rootContext],this.lastId=0,this.generateCurrentContextIds()}newFrame(e,t){return{id:e,frameName:t,iterationId:0}}set currentContext(e){this.contexts!==e&&(this.contexts=e,this.generateCurrentContextIds())}get currentContext(){return this.contexts}get currentContextId(){return this._currentContextIds[0]}get currentContextIds(){return this._currentContextIds}generateCurrentContextIds(){const e=[];for(let t=0;t0===e.id&&0===e.iterationId?"":`${e.frameName}-${e.iterationId}`)).join("/"):""}enterFrame(e){this.contexts&&(this.lastId++,this.contexts=this.contexts.slice(),this.contexts.push(this.newFrame(this.lastId,e)),this._currentContextIds.unshift(this.contextIdforContexts(this.contexts)))}exitFrame(){if(!(this.contexts&&this.contexts.length>1))throw new Error("Cannot exit frame, the context is empty");this.contexts=this.contexts.slice(),this.contexts.splice(-1),this.currentContextIds.shift()}nextIteration(){if(!(this.contexts&&this.contexts.length>0))throw new Error("Cannot increase frame iteration, the context is empty");{this.contexts=this.contexts.slice(),this.lastId++;const e=Object.assign({},this.contexts[this.contexts.length-1]);e.iterationId+=1,e.id=this.lastId,this.contexts.splice(-1,1,e),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))}}getWeight(e){return this.weightMap[e]}addTensorArray(e){this.tensorArrayMap[e.id]=e}getTensorArray(e){return this.tensorArrayMap[e]}addTensorList(e){this.tensorListMap[e.id]=e}getTensorList(e){return this.tensorListMap[e]}dispose(e){for(const t in this.tensorArrayMap)this.tensorArrayMap[t].clearAndClose(e);for(const t in this.tensorListMap)this.tensorListMap[t].clearAndClose(e)}}function ir(e,t,n,r){const a=new Set,s=[];let o=null,i=null;const u=new Set,l=Object.keys(e).map((e=>F(e)[0]));let c=[];null!=r&&(c=r.map((e=>F(e.name)[0])));const p=[...t];for(;p.length>0;){const e=p.pop();(pr(e)||dr(e)||hr(e))&&null==o&&(o=e,i=o.children.map((e=>e.name)).filter((e=>a.has(e)))),a.add(e.name),null==n[e.name]&&(-1===l.indexOf(e.name)&&-1===c.indexOf(e.name)&&(0!==e.inputs.length?e.inputs.forEach((e=>{u.has(e.name)||(u.add(e.name),p.push(e))})):s.push(e.name)))}return{inputs:e,outputs:t,usedNodes:a,missingInputs:s,dynamicNode:o,syncInputs:i}}const ur=["Switch","Merge","Enter","Exit","NextIteration","StatelessIf","StatelessWhile","if","While"],lr=["NonMaxSuppressionV2","NonMaxSuppressionV3","NonMaxSuppressionV5","Where"],cr=["HashTable","HashTableV2","LookupTableImport","LookupTableImportV2","LookupTableFind","LookupTableFindV2","LookupTableSize","LookupTableSizeV2"];function pr(e){return ur.indexOf(e.op)>=0}function dr(e){return lr.indexOf(e.op)>=0}function hr(e){return cr.indexOf(e.op)>=0}class mr{constructor(e,t){this.graph=e,this.parent=t,this.compiledMap=new Map,this._weightMap={},this.SEPERATOR=",",this._functions={},this._functionExecutorMap={},this._outputs=e.outputs,this._inputs=e.inputs,this._initNodes=e.initNodes,this._signature=e.signature,this._functions=e.functions,null!=e.functions&&Object.keys(e.functions).forEach((t=>{this._functionExecutorMap[t]=new mr(e.functions[t],this)}))}get weightIds(){return this.parent?this.parent.weightIds:this._weightIds}get functionExecutorMap(){return this.parent?this.parent.functionExecutorMap:this._functionExecutorMap}get weightMap(){return this.parent?this.parent.weightMap:this._weightMap}set weightMap(e){const t=Object.keys(e).map((t=>e[t].map((e=>e.id))));this._weightIds=[].concat(...t),this._weightMap=e}set resourceManager(e){this._resourceManager=e}get inputs(){return this._inputs.map((e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0})))}get outputs(){return this._outputs.map((e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0})))}get inputNodes(){return this._inputs.map((e=>e.signatureKey||e.name))}get outputNodes(){return this._outputs.map((e=>{const t=e.signatureKey||e.name;return e.defaultOutput?`${t}:${e.defaultOutput}`:t}))}get functions(){return Object.keys(this._functions).reduce(((e,t)=>(e[t]=this._functions[t].signature,e)),{})}getCompilationKey(e,t){const n=e.map((e=>e.name)).sort(),r=t.map((e=>e.name)).sort();return n.join(this.SEPERATOR)+"--"+r.join(this.SEPERATOR)}compile(e,t){const n=ir(e,t,this.weightMap,this._initNodes),{missingInputs:r,dynamicNode:a,syncInputs:s}=n;if(null!=a)throw new Error(`This execution contains the node '${a.name}', which has the dynamic op '${a.op}'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs [${s}]`);if(r.length>0){const n=t.map((e=>e.name)),a=Object.keys(e);throw new Error(`Cannot compute the outputs [${n}] from the provided inputs [${a}]. Missing the following inputs: [${r}]`)}return function(e,t,n){const{usedNodes:r,inputs:a}=n,s=[],o=Object.keys(a).map((e=>F(e)[0])).map((t=>e.nodes[t])),i=e.initNodes;o.forEach((e=>{r.has(e.name)&&s.push(e)})),e.weights.forEach((e=>{r.has(e.name)&&s.push(e)})),null!=i&&i.forEach((e=>{r.has(e.name)&&s.push(e)}));const u=new Set,l=[];for(;s.length>0;){const e=s.pop();u.add(e.name),t[e.name]||l.push(e),e.children.forEach((e=>{!u.has(e.name)&&r.has(e.name)&&e.inputs.every((e=>u.has(e.name)))&&s.push(e)}))}return l}(this.graph,this.weightMap,n)}execute(e,t){e=this.mapInputs(e);const n=Object.keys(e).sort();this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t);const r=n.map((e=>this.graph.nodes[F(e)[0]])),a=t.map((e=>F(e)[0]));let s=a.map((e=>this.graph.nodes[e]));0===s.length&&(s=this._outputs);const o=this.getCompilationKey(r,s);let i=this.compiledMap.get(o);null==i&&(i=this.compile(e,s),this.compiledMap.set(o,i));const u={},l={};return(0,S.tidy)((()=>{const n=new or(this.weightMap,u,l,this.functionExecutorMap),r=Object.assign({},this.weightMap);Object.keys(e).forEach((t=>{const[n,a]=F(t),s=[];s[a]=e[t],r[n]=s}));const s=this.getFrozenTensorIds(r),o={};for(let e=0;eM(e,r,n)))}))}getFrozenTensorIds(e){const t=[].concat.apply([],Object.keys(e).map((t=>e[t])).map((e=>e.map((e=>e.id)))));return new Set(t)}checkTensorForDisposal(e,t,n,r,a,s,o){"control"!==t.category&&-1===s.indexOf(e)&&(n[e].forEach((e=>{null!=e&&(o[e.id]=(o[e.id]||0)+t.children.length)})),t.inputs.forEach((e=>{if("control"!==e.category){const t=function(e,t,n){return t[D(e,n.currentContextId)]}(e.name,n,r);null!=t&&t.forEach((e=>{if(e&&!e.kept&&!a.has(e.id)){const t=o[e.id];1===t?(e.dispose(),delete o[e.id]):null!=t&&o[e.id]--}}))}})))}async executeAsync(e,t){return this._executeAsync(e,t)}async _executeAsync(e,t,n=!1,r={},a={}){n||(e=this.mapInputs(e),this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t));const s=new or(this.weightMap,r,a,this.functionExecutorMap),o=await this.executeWithControlFlow(e,s,t,n),i=t.map((e=>M(e,o,s))),u=i.map((e=>e.id)),l=Object.keys(e).map((t=>e[t].id)),c=new Set([...u,...l,...this.weightIds]);return Object.keys(o).forEach((e=>{o[e].forEach((e=>{!e||e.kept||e.isDisposed||c.has(e.id)||e.dispose()}))})),null==this.parent&&s.dispose(c),i}async executeFunctionAsync(e,t,n){const r=e.reduce(((e,t,n)=>(e[this.inputs[n].name]=t,e)),{});return this._executeAsync(r,this.outputNodes,!0,t,n)}async executeWithControlFlow(e,t,n,r){const a=Object.keys(e),s=a.map((e=>this.graph.nodes[F(e)[0]])),o=n.map((e=>F(e)[0]));let i=o.map((e=>this.graph.nodes[e]));0===i.length&&(i=this._outputs);const{usedNodes:u,missingInputs:l,dynamicNode:c,syncInputs:p}=ir(e,i,this.weightMap,this._initNodes),d=[...s,...this.graph.weights,...this._initNodes||[]].map((e=>({node:e,contexts:t.currentContext}))),h=Object.assign({},this.weightMap);Object.keys(e).forEach((t=>{const[n,r]=F(t),a=[];a[r]=e[t],h[n]=a}));const m={},f=this.getFrozenTensorIds(h),g={};for(;d.length>0;){const e=this.processStack(s,d,t,h,g,f,o,m,u);await Promise.all(e)}null!=c||r||console.warn("This model execution did not contain any nodes with control flow or dynamic output shapes. You can use model.execute() instead.");const y=i.filter((e=>!pr(e)&&!M(e.name,h,t))).map((e=>e.name));if(y.length>0){let e="";throw null!=c&&(e=`Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${p}]`),new Error(`Cannot compute the outputs [${y}] from the provided inputs [${a}]. Consider providing the following inputs: [${l}]. ${e}`)}return h}processStack(e,t,n,r,a,s,o,i,u){const l=[];for(;t.length>0;){const e=t.pop();n.currentContext=e.contexts;let c="";if("Enter"===e.node.op&&A("isConstant",e.node,r,n)&&([c]=$(e.node.name,n)),null==r[e.node.name]){const p=sr(e.node,r,n,this._resourceManager);c||([c]=$(e.node.name,n));const d=n.currentContext;S.util.isPromise(p)?l.push(p.then((l=>(r[c]=l,n.currentContext=d,this.checkTensorForDisposal(c,e.node,r,n,s,o,i),this.processChildNodes(e.node,t,n,r,a,u),l)))):(r[c]=p,this.checkTensorForDisposal(c,e.node,r,n,s,o,i),this.processChildNodes(e.node,t,n,r,a,u))}else this.processChildNodes(e.node,t,n,r,a,u)}return l}processChildNodes(e,t,n,r,a,s){e.children.forEach((e=>{const[o]=$(e.name,n);!a[o]&&s.has(e.name)&&("Merge"===e.op?e.inputNames.some((e=>!!M(e,r,n)))&&(a[o]=!0,t.push({contexts:n.currentContext,node:e})):e.inputNames.every((e=>!!M(e,r,n)))&&(a[o]=!0,t.push({contexts:n.currentContext,node:e})))}))}dispose(){Object.keys(this.weightMap).forEach((e=>this.weightMap[e].forEach((e=>e.dispose()))))}checkInputShapeAndType(e){Object.keys(e).forEach((t=>{const n=e[t],[r]=F(t),a=this.graph.nodes[r];if(a.attrParams.shape&&a.attrParams.shape.value){const e=a.attrParams.shape.value,t=e.length===n.shape.length&&n.shape.every(((t,n)=>-1===e[n]||e[n]===t));S.util.assert(t,(()=>`The shape of dict['${a.name}'] provided in model.execute(dict) must be [${e}], but was [${n.shape}]`))}a.attrParams.dtype&&a.attrParams.dtype.value&&S.util.assert(n.dtype===a.attrParams.dtype.value,(()=>`The dtype of dict['${a.name}'] provided in model.execute(dict) must be ${a.attrParams.dtype.value}, but was ${n.dtype}`))}))}mapInputs(e){const t={};for(const n in e)if(null!=this._signature&&null!=this._signature.inputs&&null!=this._signature.inputs[n]){t[this._signature.inputs[n].name]=e[n]}else t[n]=e[n];return t}checkInputs(e){const t=Object.keys(e).filter((e=>{const[t]=F(e);return null==this.graph.nodes[t]}));if(t.length>0)throw new Error(`The dict provided in model.execute(dict) has keys: [${t}] that are not part of graph`)}mapOutputs(e){return e.map((e=>{if(null!=this._signature&&null!=this._signature.outputs&&null!=this._signature.outputs[e]){return this._signature.outputs[e].name}return e}),{})}checkOutputs(e){e.forEach((e=>{const[t]=F(e);if(!this.graph.nodes[t])throw new Error(`The output '${e}' is not found in the graph`)}))}}class fr{constructor(e={},t={}){this.hashTableNameToHandle=e,this.hashTableMap=t}addHashTable(e,t){this.hashTableNameToHandle[e]=t.handle,this.hashTableMap[t.id]=t}getHashTableHandleByName(e){return this.hashTableNameToHandle[e]}getHashTableById(e){return this.hashTableMap[e]}dispose(){for(const e in this.hashTableMap)this.hashTableMap[e].clearAndClose(),delete this.hashTableMap[e];for(const e in this.hashTableNameToHandle)this.hashTableNameToHandle[e].dispose(),delete this.hashTableNameToHandle[e]}}class gr{constructor(e,t={}){this.modelUrl=e,this.loadOptions=t,this.version="n/a",null==t&&(this.loadOptions={}),this.resourceManager=new fr}get modelVersion(){return this.version}get inputNodes(){return this.executor.inputNodes}get outputNodes(){return this.executor.outputNodes}get inputs(){return this.executor.inputs}get outputs(){return this.executor.outputs}get weights(){return this.executor.weightMap}get metadata(){return this.artifacts.userDefinedMetadata}get modelSignature(){return this.signature}findIOHandler(){const e=this.modelUrl;if(null!=e.load)this.handler=e;else if(null!=this.loadOptions.requestInit)this.handler=S.io.browserHTTPRequest(e,this.loadOptions);else{const t=S.io.getLoadHandlers(e,this.loadOptions);if(0===t.length)t.push(S.io.browserHTTPRequest(e,this.loadOptions));else if(t.length>1)throw new Error(`Found more than one (${t.length}) load handlers for URL '${[e]}'`);this.handler=t[0]}}async load(){if(this.findIOHandler(),null==this.handler.load)throw new Error("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");const e=await this.handler.load();return this.loadSync(e)}loadSync(e){this.artifacts=e;const t=this.artifacts.modelTopology;let n;n=null!=this.artifacts.userDefinedMetadata&&null!=this.artifacts.userDefinedMetadata.signature?this.artifacts.userDefinedMetadata.signature:this.artifacts.signature,this.signature=n,this.version=`${t.versions.producer}.${t.versions.minConsumer}`;const r=S.io.decodeWeights(this.artifacts.weightData,this.artifacts.weightSpecs);if(this.executor=new mr(te.Instance.transformGraph(t,this.signature)),this.executor.weightMap=this.convertTensorMapToTensorsMap(r),this.executor.resourceManager=this.resourceManager,null!=e.modelInitializer&&null!=e.modelInitializer.node){const t=te.Instance.transformGraph(e.modelInitializer);this.initializer=new mr(t),this.initializer.weightMap=this.executor.weightMap,this.initializer.resourceManager=this.resourceManager,this.initializer.executeAsync({},[])}return!0}async save(e,t){if("string"==typeof e){const t=S.io.getSaveHandlers(e);if(0===t.length)throw new Error(`Cannot find any save handlers for URL '${e}'`);if(t.length>1)throw new Error(`Found more than one (${t.length}) save handlers for URL '${e}'`);e=t[0]}if(null==e.save)throw new Error("GraphModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");return e.save(this.artifacts)}predict(e,t){return this.execute(e,this.outputNodes)}normalizeInputs(e){if(!(e instanceof S.Tensor||Array.isArray(e)))return e;if((e=Array.isArray(e)?e:[e]).length!==this.inputNodes.length)throw new Error(`Input tensor count mismatch,the graph model has ${this.inputNodes.length} placeholders, while there are ${e.length} input tensors.`);return this.inputNodes.reduce(((t,n,r)=>(t[n]=e[r],t)),{})}normalizeOutputs(e){return e=e||this.outputNodes,Array.isArray(e)?e:[e]}execute(e,t){e=this.normalizeInputs(e),t=this.normalizeOutputs(t);const n=this.executor.execute(e,t);return n.length>1?n:n[0]}async executeAsync(e,t){e=this.normalizeInputs(e),t=this.normalizeOutputs(t);const n=await this.executor.executeAsync(e,t);return n.length>1?n:n[0]}convertTensorMapToTensorsMap(e){return Object.keys(e).reduce(((t,n)=>(t[n]=[e[n]],t)),{})}dispose(){this.executor.dispose(),this.initializer&&this.initializer.dispose(),this.resourceManager.dispose()}}async function yr(e,t={}){if(null==e)throw new Error("modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model");null==t&&(t={}),t.fromTFHub&&null==e.load&&(e.endsWith("/")||(e+="/"),e=`${e}model.json?tfjs-format=file`);const n=new gr(e,t);return await n.load(),n}const br="3.9.0"},8713:(e,t,n)=>{"use strict";n.d(t,{JL:()=>r,Zu:()=>a});class r{constructor(e,t){this.backend=e,this.dataMover=t,this.data=new WeakMap,this.dataIdsCount=0}get(e){return this.data.has(e)||this.dataMover.moveData(this.backend,e),this.data.get(e)}set(e,t){this.dataIdsCount++,this.data.set(e,t)}has(e){return this.data.has(e)}delete(e){return this.dataIdsCount--,this.data.delete(e)}numDataIds(){return this.dataIdsCount}}class a{refCount(e){return s("refCount")}incRef(e){return s("incRef")}timerAvailable(){return!0}time(e){return s("time")}read(e){return s("read")}readSync(e){return s("readSync")}numDataIds(){return s("numDataIds")}disposeData(e,t){return s("disposeData")}write(e,t,n){return s("write")}move(e,t,n,r,a){return s("move")}memory(){return s("memory")}floatPrecision(){return s("floatPrecision")}epsilon(){return 32===this.floatPrecision()?1e-7:1e-4}dispose(){return s("dispose")}}function s(e){throw new Error(`'${e}' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen`)}},3337:(e,t,n)=>{"use strict";function r(e,t,n){const r=function(e,t,n){return function(e,t,n){let r=0,a=e.length,s=0,o=!1;for(;r>>1);const i=n(t,e[s]);i>0?r=s+1:(a=s,o=!i)}return o?r:-r-1}(e,t,n||a)}(e,t,n),s=r<0?-(r+1):r;e.splice(s,0,t)}function a(e,t){return e>t?1:es&&h.push({score:t[e],boxIndex:e,suppressBeginIndex:0});h.sort(p);const m=o>0?-.5/o:0,f=[],g=[];for(;f.length0;){const t=h.pop(),{score:n,boxIndex:o,suppressBeginIndex:i}=t;if(n=i;--n){const r=l(e,o,f[n]);if(r>=a){u=!0;break}if(t.score=t.score*c(a,m,r),t.score<=s)break}t.suppressBeginIndex=f.length,u||(t.score===n?(f.push(o),g.push(t.score)):t.score>s&&r(h,t,p))}const y=f.length,b=n-y;u&&b>0&&(f.push(...new Array(b).fill(0)),g.push(...new Array(b).fill(0)));const k={selectedIndices:f};return i&&(k.selectedScores=g),d&&(k.validOutputs=y),k}function l(e,t,n){const r=e.subarray(4*t,4*t+4),a=e.subarray(4*n,4*n+4),s=Math.min(r[0],r[2]),o=Math.min(r[1],r[3]),i=Math.max(r[0],r[2]),u=Math.max(r[1],r[3]),l=Math.min(a[0],a[2]),c=Math.min(a[1],a[3]),p=Math.max(a[0],a[2]),d=Math.max(a[1],a[3]),h=(i-s)*(u-o),m=(p-l)*(d-c);if(h<=0||m<=0)return 0;const f=Math.max(s,l),g=Math.max(o,c),y=Math.min(i,p),b=Math.min(u,d),k=Math.max(y-f,0)*Math.max(b-g,0);return k/(h+m-k)}function c(e,t,n){const r=Math.exp(t*n*n);return n<=e?r:0}function p(e,t){return e.score-t.score||e.score===t.score&&t.boxIndex-e.boxIndex}n.d(t,{GP:()=>s,qP:()=>o,pA:()=>i})},8333:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(2657);function a(e,t){const n=[];for(let e=0;e{"use strict";n.d(t,{BV:()=>w,wv:()=>k});var r=n(8713),a=n(2885),s=n(5938),o=n(9121),i=n(6151),u=n(9122),l=n(569);class c{constructor(e,t){this.backendTimer=e,this.logger=t,null==t&&(this.logger=new d)}profileKernel(e,t,n){let r;const s=()=>{r=n()};let o;const i=u.now();if(this.backendTimer.timerAvailable())o=this.backendTimer.time(s);else{s();for(const e of r)e.dataSync();o=Promise.resolve({kernelMs:u.now()-i})}if((0,a.OB)().getBool("CHECK_COMPUTATION_FOR_ERRORS"))for(let t=0;t{p(t,n.dtype,e)}))}return{kernelName:e,outputs:r,inputs:t,timeMs:o.then((e=>e.kernelMs)),extraInfo:o.then((e=>null!=e.getExtraProfileInfo?e.getExtraProfileInfo():""))}}logKernelProfile(e){const{kernelName:t,outputs:n,timeMs:r,inputs:a,extraInfo:s}=e;n.forEach((e=>{Promise.all([e.data(),r,s]).then((n=>{this.logger.logKernelProfile(t,e,n[0],n[1],a,n[2])}))}))}}function p(e,t,n){if("float32"!==t)return!1;for(let t=0;t0?r:""} `}}console.log(`%c${i}\t%c${o}\t%c${u}D ${p}\t%c${c}\t%c${d}\t%c${s}`,"font-weight:bold","color:red","color:blue","color: orange","color: green","color: steelblue")}}var h=n(4077),m=n(747),f=n(4706);function g(e){return null!=e.kernelName}class y{constructor(){this.registeredVariables={},this.nextTapeNodeId=0,this.numBytes=0,this.numTensors=0,this.numStringTensors=0,this.numDataBuffers=0,this.gradientDepth=0,this.kernelDepth=0,this.scopeStack=[],this.numDataMovesStack=[],this.nextScopeId=0,this.tensorInfo=new WeakMap,this.profiling=!1,this.activeProfile={newBytes:0,newTensors:0,peakBytes:0,kernels:[],result:null,get kernelNames(){return Array.from(new Set(this.kernels.map((e=>e.name))))}}}dispose(){for(const e in this.registeredVariables)this.registeredVariables[e].dispose()}}class b{constructor(e){this.ENV=e,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new y}async ready(){if(null!=this.pendingBackendInit)return this.pendingBackendInit.then((()=>{}));if(null!=this.backendInstance)return;const e=this.getSortedBackends();for(let t=0;t{null!=e.setupFunc&&e.setupFunc(this.backendInstance)}))}disposeRegisteredKernels(e){(0,i.tr)(e).forEach((t=>{null!=t.disposeFunc&&t.disposeFunc(this.registry[e])}))}initializeBackend(e){const t=this.registryFactory[e];if(null==t)throw new Error(`Cannot initialize backend ${e}, no registration found.`);try{const n=t.factory();if(!n||n instanceof r.Zu||"function"!=typeof n.then)return this.registry[e]=n,{success:!0,asyncInit:!1};{const t=++this.pendingBackendInitId,r=n.then((n=>!(t(tthis.registryFactory[t].priority-this.registryFactory[e].priority))}initializeBackendsAndReturnBest(){const e=this.getSortedBackends();for(let t=0;tthis.startScope(r)),(()=>this.endScope(n)),(()=>(n=t(),n instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),n)))}scopedRun(e,t,n){e();try{const e=n();return t(),e}catch(e){throw t(),e}}nextTensorId(){return b.nextTensorId++}nextVariableId(){return b.nextVariableId++}clone(e){const t=w.runKernel(o.iJ,{x:e}),n={x:e};return this.addTapeNode(this.state.activeScope.name,n,[t],(e=>({x:()=>{const t={x:e},n={dtype:"float32"};return w.runKernel(o.RF,t,n)}})),[],{}),t}runKernel(e,t,n){null==this.backendName&&this.backend;if(!(null!=(0,i.pI)(e,this.backendName)))throw new Error(`Kernel '${e}' not registered for backend '${this.backendName}'`);return this.runKernelFunc({kernelName:e,inputs:t,attrs:n})}shouldCheckForMemLeaks(){return this.ENV.getBool("IS_TEST")}checkKernelForMemLeak(e,t,n){const r=this.backend.numDataIds();let a=0;n.forEach((e=>{a+="complex64"===e.dtype?3:1}));const s=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],o=r-t-a-s;if(o>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${o} data ids) after running '${e}'`)}runKernelFunc(e){let t,n=[];const r=this.isTapeOn(),a=this.state.numBytes,s=this.state.numTensors;let o,u;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0),null==this.backendName&&this.backend;const c=g(e)?e.kernelName:null!=this.state.activeScope?this.state.activeScope.name:"";if(g(e)){const{kernelName:t,inputs:a,attrs:s}=e;null==this.backendName&&this.backend;const c=(0,i.pI)(t,this.backendName);l.hu(null!=c,(()=>`Cannot find registered kernel '${t}' for backend '${this.backendName}'`)),o=()=>{const e=this.backend.numDataIds();u=c.kernelFunc({inputs:a,attrs:s,backend:this.backend});const o=Array.isArray(u)?u:[u];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(t,e,o);const i=o.map((e=>{if(null!=e.rank)return e;const{dataId:t,shape:n,dtype:r}=e;return this.makeTensorFromDataId(t,n,r)}));if(r){const e=this.getTensorsForGradient(t,a,i);n=this.saveTensorsForBackwardMode(e)}return i}}else{const{forwardFunc:t}=e,a=e=>{r&&(n=e.map((e=>this.keep(this.clone(e)))))};o=()=>{const e=this.backend.numDataIds();u=this.tidy((()=>t(this.backend,a)));const n=Array.isArray(u)?u:[u];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(c,e,n),n}}const{inputs:p,attrs:d}=e,h=g(e)?null:e.backwardsFunc;let m;return this.scopedRun((()=>this.state.kernelDepth++),(()=>this.state.kernelDepth--),(()=>{this.ENV.getBool("DEBUG")||this.state.profiling?(m=this.profiler.profileKernel(c,p,(()=>o())),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(m),t=m.outputs):t=o()})),r&&this.addTapeNode(c,p,t,h,n,d),this.state.profiling&&this.state.activeProfile.kernels.push({name:c,bytesAdded:this.state.numBytes-a,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-s,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(p).map((e=>null!=p[e]?p[e].shape:null)),outputShapes:t.map((e=>e.shape)),kernelTimeMs:m.timeMs,extraInfo:m.extraInfo}),Array.isArray(u)?t:t[0]}saveTensorsForBackwardMode(e){return e.map((e=>this.keep(this.clone(e))))}getTensorsForGradient(e,t,n){const r=(0,i.uk)(e);if(null!=r){const e=r.inputsToSave||[],a=r.outputsToSave||[];let s;r.saveAllInputs?(l.hu(Array.isArray(t),(()=>"saveAllInputs is true, expected inputs to be an array.")),s=Object.keys(t).map((e=>t[e]))):s=e.map((e=>t[e]));const o=n.filter(((e,t)=>a[t]));return s.concat(o)}return[]}makeTensor(e,t,n,r){if(null==e)throw new Error("Values passed to engine.makeTensor() are null");n=n||"float32",r=r||this.backend;let a=e;"string"===n&&l.HD(e[0])&&(a=e.map((e=>u.encodeString(e))));const s=r.write(a,t,n),o=new h.es(t,n,s,this.nextTensorId());if(this.trackTensor(o,r),"string"===n){const e=this.state.tensorInfo.get(s),t=(0,l.Ub)(a);this.state.numBytes+=t-e.bytes,e.bytes=t}return o}makeTensorFromDataId(e,t,n,r){n=n||"float32";const a=new h.es(t,n,e,this.nextTensorId());return this.trackTensor(a,r),a}makeVariable(e,t=!0,n,r){n=n||this.nextVariableId().toString(),null!=r&&r!==e.dtype&&(e=e.cast(r));const a=new h._w(e,t,n,this.nextTensorId());if(null!=this.state.registeredVariables[a.name])throw new Error(`Variable with name ${a.name} was already registered`);return this.state.registeredVariables[a.name]=a,this.incRef(a,this.backend),a}trackTensor(e,t){this.state.numTensors++,"string"===e.dtype&&this.state.numStringTensors++;let n=0;"complex64"!==e.dtype&&"string"!==e.dtype&&(n=e.size*l.bT(e.dtype)),this.state.numBytes+=n,this.state.tensorInfo.has(e.dataId)||(this.state.numDataBuffers++,this.state.tensorInfo.set(e.dataId,{backend:t||this.backend,dtype:e.dtype,shape:e.shape,bytes:n})),e instanceof h._w||this.track(e)}incRef(e,t){this.trackTensor(e,t),this.backend.incRef(e.dataId)}removeDataId(e,t){this.state.tensorInfo.has(e)&&this.state.tensorInfo.get(e).backend===t&&(this.state.tensorInfo.delete(e),this.state.numDataBuffers--)}disposeTensor(e){if(!this.state.tensorInfo.has(e.dataId))return;const t=this.state.tensorInfo.get(e.dataId);if(this.state.numTensors--,"string"===e.dtype&&(this.state.numStringTensors--,this.state.numBytes-=t.bytes),"complex64"!==e.dtype&&"string"!==e.dtype){const t=e.size*l.bT(e.dtype);this.state.numBytes-=t}t.backend.disposeData(e.dataId)&&this.removeDataId(e.dataId,t.backend)}disposeVariables(){for(const e in this.state.registeredVariables){const t=this.state.registeredVariables[e];this.disposeVariable(t)}}disposeVariable(e){this.disposeTensor(e),null!=this.state.registeredVariables[e.name]&&delete this.state.registeredVariables[e.name]}memory(){const e=this.backend.memory();return e.numTensors=this.state.numTensors,e.numDataBuffers=this.state.numDataBuffers,e.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(e.unreliable=!0,null==e.reasons&&(e.reasons=[]),e.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),e}async profile(e){this.state.profiling=!0;const t=this.state.numBytes,n=this.state.numTensors;this.state.activeProfile.kernels=[],this.state.activeProfile.result=await e(),this.state.profiling=!1,this.state.activeProfile.peakBytes=Math.max(...this.state.activeProfile.kernels.map((e=>e.totalBytesSnapshot))),this.state.activeProfile.newBytes=this.state.numBytes-t,this.state.activeProfile.newTensors=this.state.numTensors-n;for(const e of this.state.activeProfile.kernels)e.kernelTimeMs=await e.kernelTimeMs,e.extraInfo=await e.extraInfo;return this.state.activeProfile}isTapeOn(){return this.state.gradientDepth>0&&0===this.state.kernelDepth}addTapeNode(e,t,n,r,a,s){const o={id:this.state.nextTapeNodeId++,kernelName:e,inputs:t,outputs:n,saved:a},u=(0,i.uk)(e);null!=u&&(r=u.gradFunc),null!=r&&(o.gradient=e=>(e=e.map(((e,t)=>{if(null==e){const e=n[t],r=l.wT(e.size,e.dtype);return this.makeTensor(r,e.shape,e.dtype)}return e})),r(e.length>1?e:e[0],a,s))),this.state.activeTape.push(o)}keep(e){return e.kept=!0,e}startTape(){0===this.state.gradientDepth&&(this.state.activeTape=[]),this.state.gradientDepth++}endTape(){this.state.gradientDepth--}startScope(e){const t={track:[],name:"unnamed scope",id:this.state.nextScopeId++};e&&(t.name=e),this.state.scopeStack.push(t),this.state.activeScope=t}endScope(e){const t=(0,m.getTensorsInContainer)(e),n=new Set(t.map((e=>e.id)));for(let e=0;e{e.kept||e.scopeId!==r.id||this.track(e)}))}gradients(e,t,n,r=!1){if(l.hu(t.length>0,(()=>"gradients() received an empty list of xs.")),null!=n&&"float32"!==n.dtype)throw new Error(`dy must have 'float32' dtype, but has '${n.dtype}'`);const a=this.scopedRun((()=>this.startTape()),(()=>this.endTape()),(()=>this.tidy("forward",e)));l.hu(a instanceof h.es,(()=>"The result y returned by f() must be a tensor."));const s=function(e,t,n){const r={},a={};for(let e=0;er[e.id]=!0)),i=!0,a[s.id]=!0;break}if(i)break}}const s={};s[n.id]=!0;const o={};for(let t=e.length-1;t>=0;t--){const n=e[t],r=n.inputs;for(let e=0;e0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");return this.tidy("backward",(()=>{const e={};e[a.id]=null==n?function(e){const t=(0,l.p8)((0,l.NA)(e),"float32");return w.makeTensor(t,e,"float32")}(a.shape):n,function(e,t,n,r){for(let a=t.length-1;a>=0;a--){const s=t[a],o=[];if(s.outputs.forEach((t=>{const n=e[t.id];null!=n?o.push(n):o.push(null)})),null==s.gradient)throw new Error(`Cannot compute gradient: gradient function not found for ${s.kernelName}.`);const i=s.gradient(o);for(const t in s.inputs){if(!(t in i))throw new Error(`Cannot backprop through input ${t}. Available gradients found: ${Object.keys(i)}.`);const a=n((()=>i[t]()));if("float32"!==a.dtype)throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input ${t} must have 'float32' dtype, but has '${a.dtype}'`);const o=s.inputs[t];if(!l.cO(a.shape,o.shape))throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input '${t}' has shape '${a.shape}', which does not match the shape of the input '${o.shape}'`);if(null==e[o.id])e[o.id]=a;else{const t=e[o.id];e[o.id]=r(t,a),t.dispose()}}}}(e,s,(e=>this.tidy(e)),v);const r=t.map((t=>e[t.id]));return 0===this.state.gradientDepth&&(this.state.activeTape.forEach((e=>{for(const t of e.saved)t.dispose()})),this.state.activeTape=null),{value:a,grads:r}}))}customGrad(e){return l.hu(l.mf(e),(()=>"The f passed in customGrad(f) must be a function.")),(...t)=>{let n;l.hu(t.every((e=>e instanceof h.es)),(()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors"));const r={};t.forEach(((e,t)=>{r[t]=e}));return this.runKernelFunc({forwardFunc:(r,a)=>(n=e(...t,a),l.hu(n.value instanceof h.es,(()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor")),l.hu(l.mf(n.gradFunc),(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function.")),n.value),backwardsFunc:(e,r)=>{const a=n.gradFunc(e,r),s=Array.isArray(a)?a:[a];l.hu(s.length===t.length,(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns the same number of tensors as inputs passed to f(...).")),l.hu(s.every((e=>e instanceof h.es)),(()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors."));const o={};return s.forEach(((e,t)=>{o[t]=()=>e})),o},inputs:r})}}readSync(e){return this.state.tensorInfo.get(e).backend.readSync(e)}read(e){return this.state.tensorInfo.get(e).backend.read(e)}async time(e){const t=(0,u.now)(),n=await this.backend.time(e);return n.wallMs=(0,u.now)()-t,n}track(e){return null!=this.state.activeScope&&(e.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(e)),e}get registeredVariables(){return this.state.registeredVariables}reset(){this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new y;for(const e in this.registry)this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}}function k(){const e=(0,s.D)();if(null==e._tfengine){const t=new a.qA(e);e._tfengine=new b(t)}return(0,a.iG)(e._tfengine.ENV),(0,h.Vi)((()=>e._tfengine)),e._tfengine}b.nextTensorId=0,b.nextVariableId=0;const w=k();function v(e,t){const n={a:e,b:t};return w.runKernel(o.mm,n)}},2885:(e,t,n)=>{"use strict";n.d(t,{qA:()=>o,OB:()=>u,Vi:()=>l,iG:()=>c});var r=n(569),a=n(4706);const s="tfjsflags";class o{constructor(e){this.global=e,this.flags={},this.flagRegistry={},this.urlFlags={},this.getQueryParams=i,this.populateURLFlags()}setPlatform(e,t){null!=this.platform&&a.Z(`Platform ${this.platformName} has already been set. Overwriting the platform with ${t}.`),this.platformName=e,this.platform=t}registerFlag(e,t,n){if(this.flagRegistry[e]={evaluationFn:t,setHook:n},null!=this.urlFlags[e]){const t=this.urlFlags[e];a.Z(`Setting feature override from URL ${e}: ${t}.`),this.set(e,t)}}async getAsync(e){return e in this.flags||(this.flags[e]=await this.evaluateFlag(e)),this.flags[e]}get(e){if(e in this.flags)return this.flags[e];const t=this.evaluateFlag(e);if((0,r.tI)(t))throw new Error(`Flag ${e} cannot be synchronously evaluated. Please use getAsync() instead.`);return this.flags[e]=t,this.flags[e]}getNumber(e){return this.get(e)}getBool(e){return this.get(e)}getFlags(){return this.flags}get features(){return this.flags}set(e,t){if(null==this.flagRegistry[e])throw new Error(`Cannot set flag ${e} as it has not been registered.`);this.flags[e]=t,null!=this.flagRegistry[e].setHook&&this.flagRegistry[e].setHook(t)}evaluateFlag(e){if(null==this.flagRegistry[e])throw new Error(`Cannot evaluate flag '${e}': no evaluation function found.`);return this.flagRegistry[e].evaluationFn()}setFlags(e){this.flags=Object.assign({},e)}reset(){this.flags={},this.urlFlags={},this.populateURLFlags()}populateURLFlags(){if(void 0===this.global||void 0===this.global.location||void 0===this.global.location.search)return;const e=this.getQueryParams(this.global.location.search);if(s in e){e.tfjsflags.split(",").forEach((e=>{const[t,n]=e.split(":");this.urlFlags[t]=function(e,t){if("true"===(t=t.toLowerCase())||"false"===t)return"true"===t;if(""+ +t===t)return+t;throw new Error(`Could not parse value flag value ${t} for flag ${e}.`)}(t,n)}))}}}function i(e){const t={};return e.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,((e,...n)=>(function(e,t,n){e[decodeURIComponent(t)]=decodeURIComponent(n||"")}(t,n[0],n[1]),n.join("=")))),t}function u(){return l}let l=null;function c(e){l=e}},5938:(e,t,n)=>{"use strict";let r;function a(){if(null==r){let e;if("undefined"!=typeof window)e=window;else if("undefined"!=typeof global)e=global;else if("undefined"!=typeof process)e=process;else{if("undefined"==typeof self)throw new Error("Could not find a global object");e=self}r=e}return r}function s(e,t){const n=function(){const e=a();return null==e._tfGlobals&&(e._tfGlobals=new Map),e._tfGlobals}();if(n.has(e))return n.get(e);{const r=t();return n.set(e,r),n.get(e)}}n.d(t,{D:()=>a,R:()=>s})},4368:(e,t,n)=>{"use strict";n.d(t,{G4:()=>i,R:()=>u,cF:()=>l,MX:()=>c,N8:()=>p,SR:()=>d,sq:()=>h,N5:()=>m,lu:()=>f,B9:()=>g,Cn:()=>y,XV:()=>b,CQ:()=>k,Cd:()=>w,N_:()=>v,cj:()=>x,x3:()=>N,ze:()=>S,jq:()=>I,y3:()=>T,VY:()=>_});var r=n(7097),a=n(2885),s=n(4077),o=n(747);function i(){(0,a.OB)().set("PROD",!0)}function u(){(0,a.OB)().set("DEBUG",!0)}function l(){(0,a.OB)().set("DEPRECATION_WARNINGS_ENABLED",!1),console.warn("TensorFlow.js deprecation warnings have been disabled.")}function c(e){(0,a.OB)().getBool("DEPRECATION_WARNINGS_ENABLED")&&console.warn(e+" You can disable deprecation warnings with tf.disableDeprecationWarnings().")}function p(){r.BV.disposeVariables()}function d(){return r.BV}function h(){return r.BV.memory()}function m(e){return r.BV.profile(e)}function f(e,t){return r.BV.tidy(e,t)}function g(e){(0,o.getTensorsInContainer)(e).forEach((e=>e.dispose()))}function y(e){return r.BV.keep(e)}function b(e){return r.BV.time(e)}function k(e){return r.BV.setBackend(e)}function w(){return r.BV.ready()}function v(){return r.BV.backendName}function x(e){r.BV.removeBackend(e)}function N(e){return r.BV.findBackend(e)}function S(e){return r.BV.findBackendFactory(e)}function I(e,t,n=1){return r.BV.registerBackend(e,t,n)}function T(){return r.BV.backend}function _(e,t){(0,a.OB)().setPlatform(e,t)}(0,s.FZ)(c)},633:(e,t,n)=>{"use strict";n.d(t,{cb:()=>d,pn:()=>p,h7:()=>l,fN:()=>c,UQ:()=>i,ti:()=>u});var r=n(7097),a=n(4077),s=n(3740),o=n(569);function i(e){return o.hu(o.mf(e),(()=>"The f passed in grad(f) must be a function")),(t,n)=>{const a=(0,s._1)(t,"x","tf.grad","string_or_numeric"),i=null!=n?(0,s._1)(n,"dy","tf.grad"):null;return r.BV.tidy((()=>{const{value:t,grads:n}=r.BV.gradients((()=>e(a)),[a],i);return null!=i&&o.k5(t.shape,i.shape,"The shape of dy passed in grad(f)(x, dy) must match the shape returned by f(x)"),h(n),n[0]}))}}function u(e){return o.hu(o.mf(e),(()=>"The f passed in grads(f) must be a function")),(t,n)=>{o.hu(Array.isArray(t),(()=>"The args passed in grads(f)(args) must be an array of `Tensor`s or `TensorLike`s"));const a=(0,s.sI)(t,"args","tf.grads","string_or_numeric"),i=null!=n?(0,s._1)(n,"dy","tf.grads"):null;return r.BV.tidy((()=>{const{value:t,grads:n}=r.BV.gradients((()=>e(...a)),a,i);return null!=i&&o.k5(t.shape,i.shape,"The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),h(n),n}))}}function l(e){return o.hu(o.mf(e),(()=>"The f passed in valueAndGrad(f) must be a function")),(t,n)=>{o.hu(t instanceof a.es,(()=>"The x passed in valueAndGrad(f)(x) must be a tensor")),o.hu(null==n||n instanceof a.es,(()=>"The dy passed in valueAndGrad(f)(x, dy) must be a tensor"));const{grads:s,value:i}=r.BV.gradients((()=>e(t)),[t],n);return h(s),{grad:s[0],value:i}}}function c(e){return o.hu(o.mf(e),(()=>"The f passed in valueAndGrads(f) must be a function")),(t,n)=>{o.hu(Array.isArray(t)&&t.every((e=>e instanceof a.es)),(()=>"The args passed in valueAndGrads(f)(args) must be array of tensors")),o.hu(null==n||n instanceof a.es,(()=>"The dy passed in valueAndGrads(f)(args, dy) must be a tensor"));const s=r.BV.gradients((()=>e(...t)),t,n);return null!=n&&o.k5(s.value.shape,n.shape,"The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),h(s.grads),s}}function p(e,t){o.hu(o.mf(e),(()=>"The f passed in variableGrads(f) must be a function")),o.hu(null==t||Array.isArray(t)&&t.every((e=>e instanceof a._w)),(()=>"The varList passed in variableGrads(f, varList) must be an array of variables"));const n=null!=t;if(!n){t=[];for(const e in r.BV.registeredVariables)t.push(r.BV.registeredVariables[e])}const s=n?t.filter((e=>!e.trainable)):null,i=t.length;t=t.filter((e=>e.trainable)),o.hu(t.length>0,(()=>`variableGrads() expects at least one of the input variables to be trainable, but none of the ${i} variables is trainable.`));const{value:u,grads:l}=r.BV.gradients(e,t,null,!0);o.hu(l.some((e=>null!=e)),(()=>"Cannot find a connection between any variable and the result of the loss function y=f(x). Please make sure the operations that use variables are inside the function f passed to minimize().")),o.hu(0===u.rank,(()=>`The f passed in variableGrads(f) must return a scalar, but it returned a rank-${u.rank} tensor`));const c={};return t.forEach(((e,t)=>{null!=l[t]&&(c[e.name]=l[t])})),null!=s&&s.forEach((e=>c[e.name]=null)),{value:u,grads:c}}function d(e){return r.BV.customGrad(e)}function h(e){if(e.filter((e=>null==e)).length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that\n the f you passed encloses all operations that lead from x to y.")}},5363:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Abs:()=>je.SY,Acos:()=>je.VG,Acosh:()=>je.Sp,AdadeltaOptimizer:()=>jt,AdagradOptimizer:()=>Xt,AdamOptimizer:()=>Qt,AdamaxOptimizer:()=>tn,Add:()=>je.mm,AddN:()=>je.Xz,All:()=>je.oT,Any:()=>je.IK,ArgMax:()=>je.sJ,ArgMin:()=>je.aJ,Asin:()=>je.M2,Asinh:()=>je.qw,Atan:()=>je.jM,Atan2:()=>je.QC,Atanh:()=>je.Oy,AvgPool:()=>je.Jh,AvgPool3D:()=>je._k,AvgPool3DGrad:()=>je.IM,AvgPoolGrad:()=>je.RO,BatchMatMul:()=>je.XL,BatchToSpaceND:()=>je.zw,Bincount:()=>je.zv,BroadcastArgs:()=>je.eE,BroadcastTo:()=>je.Ly,Cast:()=>je.RF,Ceil:()=>je.gJ,ClipByValue:()=>je.xn,Complex:()=>je.Zz,ComplexAbs:()=>je.yj,Concat:()=>je.Eh,Conv2D:()=>je.mh,Conv2DBackpropFilter:()=>je.wU,Conv2DBackpropInput:()=>je.wm,Conv3D:()=>je.x1,Conv3DBackpropFilterV2:()=>je.o2,Conv3DBackpropInputV2:()=>je.ik,Cos:()=>je.mc,Cosh:()=>je.TR,CropAndResize:()=>je.Vc,Cumsum:()=>je.iH,DataStorage:()=>or.JL,DenseBincount:()=>je.QR,DepthToSpace:()=>je.T0,DepthwiseConv2dNative:()=>je.ci,DepthwiseConv2dNativeBackpropFilter:()=>je.sL,DepthwiseConv2dNativeBackpropInput:()=>je.y7,Diag:()=>je.$w,Dilation2D:()=>je.p4,Dilation2DBackpropFilter:()=>je.Vn,Dilation2DBackpropInput:()=>je.ek,ENV:()=>y.Vi,Einsum:()=>je.$g,Elu:()=>je.SX,EluGrad:()=>je.HE,Environment:()=>y.qA,Equal:()=>je.hd,Erf:()=>je.Om,Exp:()=>je.NE,ExpandDims:()=>je.YF,Expm1:()=>je.Y0,FFT:()=>je.vw,Fill:()=>je.de,FlipLeftRight:()=>je.Uy,Floor:()=>je.OR,FloorDiv:()=>je.je,FromPixels:()=>je.eB,FusedBatchNorm:()=>je.sH,FusedConv2D:()=>je._V,FusedDepthwiseConv2D:()=>je.lu,GatherNd:()=>je.q1,GatherV2:()=>je.qi,Greater:()=>je.iZ,GreaterEqual:()=>je.Ac,IFFT:()=>je.Qg,Identity:()=>je.iJ,Imag:()=>je.J_,IsFinite:()=>je.av,IsInf:()=>je.iW,IsNan:()=>je.r7,KernelBackend:()=>or.Zu,LRN:()=>je.eZ,LRNGrad:()=>je.Hh,LeakyRelu:()=>je.J$,Less:()=>je.vt,LessEqual:()=>je.CA,LinSpace:()=>je.e7,Log:()=>je.Zb,Log1p:()=>je.kU,LogSoftmax:()=>je.qC,LogicalAnd:()=>je.PY,LogicalNot:()=>je.Vf,LogicalOr:()=>je.MZ,Max:()=>je.Yo,MaxPool:()=>je.mT,MaxPool3D:()=>je.OA,MaxPool3DGrad:()=>je.OU,MaxPoolGrad:()=>je.OV,MaxPoolWithArgmax:()=>je.vF,Maximum:()=>je.BM,Mean:()=>je.q2,Min:()=>je.c1,Minimum:()=>je.q8,MirrorPad:()=>je.jQ,Mod:()=>je.Vb,MomentumOptimizer:()=>rn,Multinomial:()=>je.NZ,Multiply:()=>je.wY,Neg:()=>je.ku,NonMaxSuppressionV3:()=>je.uv,NonMaxSuppressionV4:()=>je.cy,NonMaxSuppressionV5:()=>je.W0,NotEqual:()=>je.yQ,OP_SCOPE_SUFFIX:()=>on.zvA,OneHot:()=>je.we,OnesLike:()=>je.qW,Optimizer:()=>Ut,Pack:()=>je.Qi,PadV2:()=>je.ly,Pool:()=>je.Kg,Pow:()=>je.pe,Prelu:()=>je.o0,Prod:()=>je.Dl,RMSPropOptimizer:()=>an,Range:()=>je.e6,Rank:()=>sn.yw,Real:()=>je.xJ,RealDiv:()=>je.oH,Reciprocal:()=>je.$H,Reduction:()=>un.I,Relu:()=>je.qk,Relu6:()=>je.Sb,Reshape:()=>je.HZ,ResizeBilinear:()=>je._Y,ResizeBilinearGrad:()=>je.zb,ResizeNearestNeighbor:()=>je.dp,ResizeNearestNeighborGrad:()=>je.Hm,Reverse:()=>je.mK,RotateWithOffset:()=>je.b9,Round:()=>je.e0,Rsqrt:()=>je.bV,SGDOptimizer:()=>nn,ScatterNd:()=>je.xQ,Select:()=>je.Ph,Selu:()=>je.oF,Sigmoid:()=>je.a5,Sign:()=>je.i5,Sin:()=>je.RQ,Sinh:()=>je.w3,Slice:()=>je.p2,Softmax:()=>je.Gc,Softplus:()=>je.MR,SpaceToBatchND:()=>je.TQ,SparseFillEmptyRows:()=>je.O3,SparseReshape:()=>je.nh,SparseSegmentMean:()=>je.YW,SparseSegmentSum:()=>je.Zj,SparseToDense:()=>je.D2,SplitV:()=>je.L8,Sqrt:()=>je.FK,Square:()=>je.bK,SquaredDifference:()=>je._t,Step:()=>je.h8,StridedSlice:()=>je.m2,StringNGrams:()=>je._J,StringSplit:()=>je.s1,StringToHashBucketFast:()=>je.Xk,Sub:()=>je.Tr,Sum:()=>je.GB,Tan:()=>je.sE,Tanh:()=>je.MI,Tensor:()=>xe.es,TensorBuffer:()=>xe.YD,Tile:()=>je.n9,TopK:()=>je.cW,Transform:()=>je.wx,Transpose:()=>je.G3,Unique:()=>je.kp,Unpack:()=>je.To,UnsortedSegmentSum:()=>je.Qv,Variable:()=>xe._w,ZerosLike:()=>je.Ru,_FusedMatMul:()=>je.us,abs:()=>on.WnP,acos:()=>on.Khb,acosh:()=>on.__u,add:()=>on.IHx,addN:()=>on.QBD,all:()=>on.$6P,any:()=>on.YjB,argMax:()=>on.NqF,argMin:()=>on.vHJ,asin:()=>on.ZRM,asinh:()=>on.VfV,atan:()=>on.z4N,atan2:()=>on.fvJ,atanh:()=>on.C80,avgPool:()=>on.wS1,avgPool3d:()=>on.uR5,backend:()=>Vt.y3,backend_util:()=>d,basicLSTMCell:()=>on.zEQ,batchNorm:()=>on.tgs,batchNorm2d:()=>on.Dxk,batchNorm3d:()=>on.JY5,batchNorm4d:()=>on.p3b,batchToSpaceND:()=>on.E4h,bincount:()=>on.yE8,booleanMaskAsync:()=>on.anm,broadcastArgs:()=>on.XsQ,broadcastTo:()=>on.UFq,browser:()=>o,buffer:()=>on.f3b,cast:()=>on.pju,ceil:()=>on.mDi,clipByValue:()=>on.iUl,clone:()=>on.d9v,complex:()=>on.PYB,concat:()=>on.zoF,concat1d:()=>on.gME,concat2d:()=>on.Izb,concat3d:()=>on.MNy,concat4d:()=>on.ZaL,conv1d:()=>on.PAt,conv2d:()=>on.Tek,conv2dTranspose:()=>on.bc,conv3d:()=>on.pdZ,conv3dTranspose:()=>on.$QV,copyRegisteredKernels:()=>Ke.T3,cos:()=>on.mCk,cosh:()=>on.f9Y,cosineWindow:()=>on.mew,cumsum:()=>on.zbp,customGrad:()=>qt.cb,denseBincount:()=>on.ppE,deprecationWarn:()=>Vt.MX,depthToSpace:()=>on.nTT,depthwiseConv2d:()=>on.B10,device_util:()=>r,diag:()=>on.Ka3,dilation2d:()=>on.WmZ,disableDeprecationWarnings:()=>Vt.cF,dispose:()=>Vt.B9,disposeVariables:()=>Vt.N8,div:()=>on.hiC,divNoNan:()=>on.NTj,dot:()=>on.AKD,dropout:()=>on.rvX,einsum:()=>on.WYO,elu:()=>on.pyx,enableDebugMode:()=>Vt.R,enableProdMode:()=>Vt.G4,enclosingPowerOfTwo:()=>on.GRh,engine:()=>Vt.SR,env:()=>y.OB,equal:()=>on.DgJ,erf:()=>on.qNN,exp:()=>on.Qqt,expandDims:()=>on.dt4,expm1:()=>on.t$B,eye:()=>on.iyy,fft:()=>on.kp_,fill:()=>on.hlL,findBackend:()=>Vt.x3,findBackendFactory:()=>Vt.ze,floor:()=>on.GWj,floorDiv:()=>on.qPi,fused:()=>on.imm,gather:()=>on.Iqj,gatherND:()=>on.dbB,gather_util:()=>i,getBackend:()=>Vt.N_,getGradient:()=>Ke.uk,getKernel:()=>Ke.pI,getKernelsForBackend:()=>Ke.tr,grad:()=>qt.UQ,grads:()=>qt.ti,greater:()=>on.pjt,greaterEqual:()=>on.brS,ifft:()=>on.Sxn,imag:()=>on.asL,image:()=>on.BHj,inTopKAsync:()=>on.V3u,io:()=>a,irfft:()=>on.wx0,isFinite:()=>on.xVT,isInf:()=>on.UWc,isNaN:()=>on.i2d,keep:()=>Vt.Cn,kernel_impls:()=>h,leakyRelu:()=>on.hi7,less:()=>on.d9m,lessEqual:()=>on.zN1,linalg:()=>on.$r2,linspace:()=>on.SX3,localResponseNormalization:()=>on.G9k,log:()=>on.cM7,log1p:()=>on.Krr,logSigmoid:()=>on.e_t,logSoftmax:()=>on.CmS,logSumExp:()=>on.l_t,logicalAnd:()=>on.HvI,logicalNot:()=>on.hJK,logicalOr:()=>on.K5V,logicalXor:()=>on.egP,losses:()=>on.MB5,matMul:()=>on.OI3,math:()=>s,max:()=>on.Fp7,maxPool:()=>on._sB,maxPool3d:()=>on.YQQ,maxPoolWithArgmax:()=>on.Ip$,maximum:()=>on.gWQ,mean:()=>on.J69,memory:()=>Vt.sq,meshgrid:()=>on.ry_,min:()=>on.VV$,minimum:()=>on.LTh,mirrorPad:()=>on.VdP,mod:()=>on.wQq,moments:()=>on.Gi7,movingAverage:()=>on.p_,mul:()=>on.dC7,multiRNNCell:()=>on.rq4,multinomial:()=>on.SJ_,neg:()=>on.W76,nextFrame:()=>dn,norm:()=>on.KOy,notEqual:()=>on.Quu,oneHot:()=>on.lfX,ones:()=>on.iUs,onesLike:()=>on.JpU,op:()=>on.op,outerProduct:()=>on.N2O,pad:()=>on.vku,pad1d:()=>on.pNR,pad2d:()=>on.koy,pad3d:()=>on.t1L,pad4d:()=>on.lGY,pool:()=>on.d_R,pow:()=>on.sQ3,prelu:()=>on.AL3,print:()=>on.S0v,prod:()=>on.WVs,profile:()=>Vt.N5,rand:()=>on.TN_,randomGamma:()=>on.wzB,randomNormal:()=>on.nGf,randomUniform:()=>on.LGj,range:()=>on.w6H,ready:()=>Vt.Cd,real:()=>on.kwC,reciprocal:()=>on.M25,registerBackend:()=>Vt.jq,registerGradient:()=>Ke.Li,registerKernel:()=>Ke.wC,relu:()=>on.UYe,relu6:()=>on.btT,removeBackend:()=>Vt.cj,reshape:()=>on.XLQ,reverse:()=>on.GYS,reverse1d:()=>on.SDf,reverse2d:()=>on.diP,reverse3d:()=>on.sx7,reverse4d:()=>on.mG2,rfft:()=>on.QEs,round:()=>on.NMM,rsqrt:()=>on.bp0,scalar:()=>on.iD$,scatterND:()=>on.snQ,scatter_util:()=>rt,selu:()=>on.U8D,separableConv2d:()=>on.U_I,serialization:()=>l,setBackend:()=>Vt.CQ,setPlatform:()=>Vt.VY,setdiff1dAsync:()=>on.ODp,sigmoid:()=>on.XD2,sign:()=>on.Xxe,signal:()=>on.tdS,sin:()=>on.O$l,sinh:()=>on.R_K,slice:()=>on.tPi,slice1d:()=>on.jZU,slice2d:()=>on.SmN,slice3d:()=>on.CnO,slice4d:()=>on.p0P,slice_util:()=>u,softmax:()=>on.XAC,softplus:()=>on.Wvh,spaceToBatchND:()=>on.fBT,sparse:()=>on.rVs,sparseToDense:()=>on.ers,spectral:()=>on.uN7,split:()=>on.Vl2,sqrt:()=>on._b3,square:()=>on.h62,squaredDifference:()=>on.$i,squeeze:()=>on.L9e,stack:()=>on.knu,step:()=>on.Nbs,stridedSlice:()=>on.NXj,string:()=>on.Z_8,sub:()=>on.luU,sum:()=>on.Smz,sumOutType:()=>sn.z4,tan:()=>on.ORZ,tanh:()=>on.AEp,tensor:()=>on.XeE,tensor1d:()=>on.RRF,tensor2d:()=>on.odF,tensor3d:()=>on.wOQ,tensor4d:()=>on.yXz,tensor5d:()=>on.Bfx,tensor6d:()=>on.xZs,tensor_util:()=>Nt,test_util:()=>c,tidy:()=>Vt.lu,tile:()=>on.Gg6,time:()=>Vt.XV,topk:()=>on.hg7,train:()=>cn,transpose:()=>on.p4s,truncatedNormal:()=>on.Xu6,unique:()=>on.Two,unregisterGradient:()=>Ke.bt,unregisterKernel:()=>Ke.nE,unsortedSegmentSum:()=>on.pUJ,unstack:()=>on.HHK,upcastType:()=>sn.x8,util:()=>St,valueAndGrad:()=>qt.h7,valueAndGrads:()=>qt.fN,variable:()=>on.VD$,variableGrads:()=>qt.pn,version_core:()=>Ct,where:()=>on.arb,whereAsync:()=>on.itS,zeros:()=>on.lls,zerosLike:()=>on.P84});var r={};n.r(r),n.d(r,{isBrowser:()=>g,isMobile:()=>f});var a={};n.r(a),n.d(a,{browserFiles:()=>_e,browserHTTPRequest:()=>Ce,concatenateArrayBuffers:()=>E,copyModel:()=>de,decodeWeights:()=>S,encodeWeights:()=>N,fromMemory:()=>ze,getLoadHandlers:()=>R,getModelArtifactsForJSON:()=>$,getModelArtifactsInfoForJSON:()=>D,getSaveHandlers:()=>V,http:()=>Be,isHTTPScheme:()=>Fe,listModels:()=>ce,loadWeights:()=>Me,moveModel:()=>he,registerLoadRouter:()=>C,registerSaveRouter:()=>B,removeModel:()=>pe,weightsLoaderFactory:()=>$e,withSaveHandler:()=>Pe});var s={};n.r(s),n.d(s,{confusionMatrix:()=>Ue});var o={};n.r(o),n.d(o,{fromPixels:()=>tt,fromPixelsAsync:()=>Ye,toPixels:()=>et});var i={};n.r(i),n.d(i,{prepareAndValidate:()=>nt});var u={};n.r(u),n.d(u,{assertParamsValid:()=>at,computeFlatOffset:()=>yt,computeOutShape:()=>ot,getNormalizedAxes:()=>ct,isSliceContinous:()=>gt,maskToAxes:()=>st,parseSliceParams:()=>bt,sliceInfo:()=>kt,startForAxis:()=>mt,startIndicesWithElidedDims:()=>pt,stopForAxis:()=>ft,stopIndicesWithElidedDims:()=>dt,stridesForAxis:()=>ht,stridesWithElidedDims:()=>it});var l={};n.r(l),n.d(l,{Serializable:()=>wt,SerializationMap:()=>vt,registerClass:()=>xt});var c={};n.r(c),n.d(c,{TEST_EPSILON_FLOAT16:()=>It,encodeStrings:()=>Bt,expectArrayBuffersEqual:()=>Ot,expectArraysClose:()=>Tt,expectArraysEqual:()=>Mt,expectNumbersClose:()=>$t,expectPromiseToFail:()=>At,expectValuesInRange:()=>Ft,testEpsilon:()=>_t});var p={};n.r(p),n.d(p,{collectGatherOpShapeInfo:()=>tr,computeOutShape:()=>er,segOpComputeOptimalWindowSize:()=>Yn});var d={};n.r(d),n.d(d,{ERF_A1:()=>Mn,ERF_A2:()=>$n,ERF_A3:()=>Dn,ERF_A4:()=>Fn,ERF_A5:()=>On,ERF_P:()=>An,PARALLELIZE_THRESHOLD:()=>kn,SELU_SCALE:()=>En,SELU_SCALEALPHA:()=>_n,applyActivation:()=>bn.QH,assertAndGetBroadcastShape:()=>mn.$N,assertAxesAreInnerMostDims:()=>hn.lB,assertParamsConsistent:()=>fn,assignToTypedArray:()=>Ln,axesAreInnerMostDims:()=>hn.YB,calculateShapes:()=>rt.calculateShapes,checkEinsumDimSizes:()=>Kn,combineLocations:()=>hn.Vh,complexWithEvenIndex:()=>Rn,complexWithOddIndex:()=>zn,computeConv2DInfo:()=>yn.Ix,computeConv3DInfo:()=>yn.jw,computeDefaultPad:()=>yn.aO,computeDilation2DInfo:()=>yn.Rf,computeOptimalWindowSize:()=>wn,computeOutAndReduceShapes:()=>hn.kz,computeOutShape:()=>gn,computePool2DInfo:()=>yn.Xw,computePool3DInfo:()=>yn.pl,convertConv2DDataFormat:()=>yn.sl,decodeEinsumEquation:()=>Un,eitherStridesOrDilationsAreOne:()=>yn.jT,expandShapeToKeepDim:()=>hn.rv,exponent:()=>Hn,exponents:()=>Wn,fromStringArrayToUint8:()=>rr,fromUint8ToStringArray:()=>nr,getAxesPermutation:()=>hn.Q3,getBroadcastDims:()=>mn.XF,getComplexWithIndex:()=>Pn,getEinsumComputePath:()=>Xn,getEinsumPermutation:()=>jn,getFusedBiasGradient:()=>bn.pf,getFusedDyActivation:()=>bn.Fr,getImageCenter:()=>vn,getInnerMostAxes:()=>hn.sY,getPermuted:()=>Nn,getReductionAxes:()=>mn.RR,getReshaped:()=>xn,getReshapedPermuted:()=>Sn,getSliceBeginCoords:()=>In,getSliceSize:()=>Tn,getUndoAxesPermutation:()=>hn.LJ,isIdentityPermutation:()=>Zn,log:()=>Bn.c,mergeRealAndImagArrays:()=>Cn,prepareAndValidate:()=>nt,prepareSplitSize:()=>Qn,segment_util:()=>p,shouldFuse:()=>bn.uy,slice_util:()=>u,splitRealAndImagArrays:()=>Vn,tupleValuesAreOne:()=>yn.I0,upcastType:()=>sn.x8,validateInput:()=>rt.validateInput,validateUpdateShape:()=>rt.validateUpdateShape,warn:()=>Bn.Z});var h={};n.r(h),n.d(h,{nonMaxSuppressionV3Impl:()=>ar.GP,nonMaxSuppressionV4Impl:()=>ar.qP,nonMaxSuppressionV5Impl:()=>ar.pA,whereImpl:()=>sr.Z});var m=n(7097);function f(e){if(e||"undefined"!=typeof navigator&&null!=navigator){if(e||(e=navigator),"ReactNative"===e.product)return!0;const t=e.userAgent||e.vendor||("undefined"!=typeof window?window.opera:"");if(!t){const t=e;return t.userAgentData&&t.userAgentData.mobile}return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}return!1}function g(){return"undefined"!=typeof window&&null!=window.document||"undefined"!=typeof WorkerGlobalScope}var y=n(2885);const b=(0,y.OB)();b.registerFlag("DEBUG",(()=>!1),(e=>{e&&console.warn("Debugging mode is ON. The output of every math call will be downloaded to CPU and checked for NaNs. This significantly impacts performance.")})),b.registerFlag("IS_BROWSER",(()=>g())),b.registerFlag("IS_NODE",(()=>"undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.node)),b.registerFlag("IS_CHROME",(()=>"undefined"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor))),b.registerFlag("PROD",(()=>!1)),b.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",(()=>b.getBool("DEBUG"))),b.registerFlag("DEPRECATION_WARNINGS_ENABLED",(()=>!0)),b.registerFlag("IS_TEST",(()=>!1)),b.registerFlag("CHECK_COMPUTATION_FOR_ERRORS",(()=>!0)),b.registerFlag("WRAP_TO_IMAGEBITMAP",(()=>!1));var k=n(1661),w=n(701),v=n(569);const x={float32:4,float16:2,int32:4,uint16:2,uint8:1,bool:1,complex64:8};async function N(e,t){const n=[],r=[],a=Array.isArray(e)?e.map((e=>e.name)):Object.keys(e);for(let s=0;s{const t=await i.bytes(),n=t.reduce(((e,t)=>e+t.length),0)+4*t.length,r=new Uint8Array(n);let a=0;for(let e=0;e{if(t+=e.byteLength,n.push(e.byteLength===e.buffer.byteLength?e:new e.constructor(e)),!(e instanceof Float32Array||e instanceof Int32Array||e instanceof Uint8Array))throw new Error(`Unsupported TypedArray subtype: ${e.constructor.name}`)}));const r=new Uint8Array(t);let a=0;return n.forEach((e=>{r.set(new Uint8Array(e.buffer),a),a+=e.byteLength})),r.buffer}const T="undefined"!=typeof Buffer&&("undefined"==typeof Blob||"undefined"==typeof atob||"undefined"==typeof btoa);function _(e){return T?Buffer.byteLength(e):new Blob([e]).size}function E(e){if(1===e.length)return e[0];let t=0;e.forEach((e=>{t+=e.byteLength}));const n=new Uint8Array(t);let r=0;return e.forEach((e=>{n.set(new Uint8Array(e),r),r+=e.byteLength})),n.buffer}function A(e){for(e=e.trim();e.endsWith("/");)e=e.slice(0,e.length-1);const t=e.split("/");return t[t.length-1]}function M(e,t){const n={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,weightsManifest:t};return null!=e.signature&&(n.signature=e.signature),null!=e.userDefinedMetadata&&(n.userDefinedMetadata=e.userDefinedMetadata),null!=e.modelInitializer&&(n.modelInitializer=e.modelInitializer),null!=e.trainingConfig&&(n.trainingConfig=e.trainingConfig),n}async function $(e,t){const n={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy};if(null!=e.trainingConfig&&(n.trainingConfig=e.trainingConfig),null!=e.weightsManifest){const[r,a]=await t(e.weightsManifest);n.weightSpecs=r,n.weightData=a}return null!=e.signature&&(n.signature=e.signature),null!=e.userDefinedMetadata&&(n.userDefinedMetadata=e.userDefinedMetadata),null!=e.modelInitializer&&(n.modelInitializer=e.modelInitializer),n}function D(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("Expected JSON model topology, received ArrayBuffer.");return{dateSaved:new Date,modelTopologyType:"JSON",modelTopologyBytes:null==e.modelTopology?0:_(JSON.stringify(e.modelTopology)),weightSpecsBytes:null==e.weightSpecs?0:_(JSON.stringify(e.weightSpecs)),weightDataBytes:null==e.weightData?0:e.weightData.byteLength}}function F(){const e=function(){const e=e=>{let t=e<<13,n=0;for(;0==(8388608&t);)n-=8388608,t<<=1;return t&=-8388609,n+=947912704,t|n},t=new Uint32Array(2048);t[0]=0;for(let n=1;n<1024;n++)t[n]=e(n);for(let e=1024;e<2048;e++)t[e]=939524096+(e-1024<<13);return t}(),t=function(){const e=new Uint32Array(64);e[0]=0,e[31]=1199570944,e[32]=2147483648,e[63]=3347054592;for(let t=1;t<31;t++)e[t]=t<<23;for(let t=33;t<63;t++)e[t]=2147483648+(t-32<<23);return e}(),n=function(){const e=new Uint32Array(64);for(let t=0;t<64;t++)e[t]=1024;return e[0]=e[32]=0,e}();return r=>{const a=new ArrayBuffer(4*r.length),s=new Uint32Array(a);for(let a=0;a>10]+(1023&o)]+t[o>>10];s[a]=i}return new Float32Array(a)}}class O{constructor(){this.saveRouters=[],this.loadRouters=[]}static getInstance(){return null==O.instance&&(O.instance=new O),O.instance}static registerSaveRouter(e){O.getInstance().saveRouters.push(e)}static registerLoadRouter(e){O.getInstance().loadRouters.push(e)}static getSaveHandlers(e){return O.getHandlers(e,"save")}static getLoadHandlers(e,t){return O.getHandlers(e,"load",t)}static getHandlers(e,t,n){const r=[];return("load"===t?O.getInstance().loadRouters:O.getInstance().saveRouters).forEach((t=>{const a=t(e,n);null!==a&&r.push(a)})),r}}const B=e=>O.registerSaveRouter(e),C=e=>O.registerLoadRouter(e),V=e=>O.getSaveHandlers(e),R=(e,t)=>O.getLoadHandlers(e,t),z="tensorflowjs",P="models_store",L="model_info_store";function W(){if(!(0,y.OB)().getBool("IS_BROWSER"))throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");const e="undefined"==typeof window?self:window,t=e.indexedDB||e.mozIndexedDB||e.webkitIndexedDB||e.msIndexedDB||e.shimIndexedDB;if(null==t)throw new Error("The current browser does not appear to support IndexedDB.");return t}function H(e){const t=e.result;t.createObjectStore(P,{keyPath:"modelPath"}),t.createObjectStore(L,{keyPath:"modelPath"})}class q{constructor(e){if(this.indexedDB=W(),null==e||!e)throw new Error("For IndexedDB, modelPath must not be null, undefined or empty.");this.modelPath=e}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");return this.databaseAction(this.modelPath,e)}async load(){return this.databaseAction(this.modelPath)}databaseAction(e,t){return new Promise(((e,n)=>{const r=this.indexedDB.open(z,1);r.onupgradeneeded=()=>H(r),r.onsuccess=()=>{const a=r.result;if(null==t){const t=a.transaction(P,"readonly"),r=t.objectStore(P).get(this.modelPath);r.onsuccess=()=>{if(null==r.result)return a.close(),n(new Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`));e(r.result.modelArtifacts)},r.onerror=e=>(a.close(),n(r.error)),t.oncomplete=()=>a.close()}else{const r=D(t),s=a.transaction(L,"readwrite");let o=s.objectStore(L);const i=o.put({modelPath:this.modelPath,modelArtifactsInfo:r});let u;i.onsuccess=()=>{u=a.transaction(P,"readwrite");const i=u.objectStore(P).put({modelPath:this.modelPath,modelArtifacts:t,modelArtifactsInfo:r});i.onsuccess=()=>e({modelArtifactsInfo:r}),i.onerror=e=>{o=s.objectStore(L);const t=o.delete(this.modelPath);t.onsuccess=()=>(a.close(),n(i.error)),t.onerror=e=>(a.close(),n(i.error))}},i.onerror=e=>(a.close(),n(i.error)),s.oncomplete=()=>{null==u?a.close():u.oncomplete=()=>a.close()}}},r.onerror=e=>n(r.error)}))}}q.URL_SCHEME="indexeddb://";const G=e=>{return(0,y.OB)().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(q.URL_SCHEME)?(t=e.slice(q.URL_SCHEME.length),new q(t)):null;var t};O.registerSaveRouter(G),O.registerLoadRouter(G);class U{constructor(){this.indexedDB=W()}async listModels(){return new Promise(((e,t)=>{const n=this.indexedDB.open(z,1);n.onupgradeneeded=()=>H(n),n.onsuccess=()=>{const r=n.result,a=r.transaction(L,"readonly"),s=a.objectStore(L).getAll();s.onsuccess=()=>{const t={};for(const e of s.result)t[e.modelPath]=e.modelArtifactsInfo;e(t)},s.onerror=e=>(r.close(),t(s.error)),a.oncomplete=()=>r.close()},n.onerror=e=>t(n.error)}))}async removeModel(e){var t;return e=(t=e).startsWith(q.URL_SCHEME)?t.slice(q.URL_SCHEME.length):t,new Promise(((t,n)=>{const r=this.indexedDB.open(z,1);r.onupgradeneeded=()=>H(r),r.onsuccess=()=>{const a=r.result,s=a.transaction(L,"readwrite"),o=s.objectStore(L),i=o.get(e);let u;i.onsuccess=()=>{if(null==i.result)return a.close(),n(new Error(`Cannot find model with path '${e}' in IndexedDB.`));{const r=o.delete(e),s=()=>{u=a.transaction(P,"readwrite");const r=u.objectStore(P).delete(e);r.onsuccess=()=>t(i.result.modelArtifactsInfo),r.onerror=e=>n(i.error)};r.onsuccess=s,r.onerror=e=>(s(),a.close(),n(i.error))}},i.onerror=e=>(a.close(),n(i.error)),s.oncomplete=()=>{null==u?a.close():u.oncomplete=()=>a.close()}},r.onerror=e=>n(r.error)}))}}const j="/",K="tensorflowjs_models",X="info",Z="model_topology",J="weight_specs",Q="weight_data",Y="model_metadata";function ee(e){return{info:[K,e,X].join(j),topology:[K,e,Z].join(j),weightSpecs:[K,e,J].join(j),weightData:[K,e,Q].join(j),modelMetadata:[K,e,Y].join(j)}}function te(e){for(const t of Object.values(e))window.localStorage.removeItem(t)}function ne(e){const t=e.split(j);if(t.length<3)throw new Error(`Invalid key format: ${e}`);return t.slice(1,t.length-1).join(j)}class re{constructor(e){if(!(0,y.OB)().getBool("IS_BROWSER")||"undefined"==typeof window||void 0===window.localStorage)throw new Error("The current environment does not support local storage.");if(this.LS=window.localStorage,null==e||!e)throw new Error("For local storage, modelPath must not be null, undefined or empty.");this.modelPath=e,this.keys=ee(this.modelPath)}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");{const t=JSON.stringify(e.modelTopology),n=JSON.stringify(e.weightSpecs),r=D(e);try{this.LS.setItem(this.keys.info,JSON.stringify(r)),this.LS.setItem(this.keys.topology,t),this.LS.setItem(this.keys.weightSpecs,n),this.LS.setItem(this.keys.weightData,function(e){if(T)return Buffer.from(e).toString("base64");const t=new Uint8Array(e);let n="";for(let e=0,r=t.length;e{return(0,y.OB)().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(re.URL_SCHEME)?(t=e.slice(re.URL_SCHEME.length),new re(t)):null;var t};O.registerSaveRouter(ae),O.registerLoadRouter(ae);class se{constructor(){(0,v.hu)((0,y.OB)().getBool("IS_BROWSER"),(()=>"Current environment is not a web browser")),(0,v.hu)("undefined"==typeof window||void 0!==window.localStorage,(()=>"Current browser does not appear to support localStorage")),this.LS=window.localStorage}async listModels(){const e={},t=K+j,n=j+X;for(let r=0;r"scheme must not be undefined or null.")),e.endsWith(oe)&&(e=e.slice(0,e.indexOf(oe))),(0,v.hu)(e.length>0,(()=>"scheme must not be an empty string."));const n=ie.getInstance();(0,v.hu)(null==n.managers[e],(()=>`A model store manager is already registered for scheme '${e}'.`)),n.managers[e]=t}static getManager(e){const t=this.getInstance().managers[e];if(null==t)throw new Error(`Cannot find model manager for scheme '${e}'`);return t}static getSchemes(){return Object.keys(this.getInstance().managers)}}function ue(e){if(-1===e.indexOf(oe))throw new Error(`The url string provided does not contain a scheme. Supported schemes are: ${ie.getSchemes().join(",")}`);return{scheme:e.split(oe)[0],path:e.split(oe)[1]}}async function le(e,t,n=!1){(0,v.hu)(e!==t,(()=>`Old path and new path are the same: '${e}'`));const r=O.getLoadHandlers(e);(0,v.hu)(r.length>0,(()=>`Copying failed because no load handler is found for source URL ${e}.`)),(0,v.hu)(r.length<2,(()=>`Copying failed because more than one (${r.length}) load handlers for source URL ${e}.`));const a=r[0],s=O.getSaveHandlers(t);(0,v.hu)(s.length>0,(()=>`Copying failed because no save handler is found for destination URL ${t}.`)),(0,v.hu)(s.length<2,(()=>`Copying failed because more than one (${r.length}) save handlers for destination URL ${t}.`));const o=s[0],i=ue(e).scheme,u=ue(e).path,l=i===ue(e).scheme,c=await a.load();n&&l&&await ie.getManager(i).removeModel(u);const p=await o.save(c);return n&&!l&&await ie.getManager(i).removeModel(u),p.modelArtifactsInfo}async function ce(){const e=ie.getSchemes(),t={};for(const n of e){const e=await ie.getManager(n).listModels();for(const r in e){t[n+oe+r]=e[r]}}return t}async function pe(e){const t=ue(e);return ie.getManager(t.scheme).removeModel(t.path)}async function de(e,t){return le(e,t,!1)}async function he(e,t){return le(e,t,!0)}class me{fetch(e,t){return fetch(e,t)}now(){return performance.now()}encode(e,t){if("utf-8"!==t&&"utf8"!==t)throw new Error(`Browser's encoder only supports utf-8, but got ${t}`);return null==this.textEncoder&&(this.textEncoder=new TextEncoder),this.textEncoder.encode(e)}decode(e,t){return new TextDecoder(t).decode(e)}}if((0,y.OB)().get("IS_BROWSER")){(0,y.OB)().setPlatform("browser",new me);try{ie.registerManager(re.URL_SCHEME,new se)}catch(e){}try{ie.registerManager(q.URL_SCHEME,new U)}catch(e){}}const fe=()=>n(7854);let ge;class ye{constructor(){this.util=n(1669),this.textEncoder=new this.util.TextEncoder}fetch(e,t){return null!=(0,y.OB)().global.fetch?(0,y.OB)().global.fetch(e,t):(null==ge&&(ge=fe()),ge(e,t))}now(){const e=process.hrtime();return 1e3*e[0]+e[1]/1e6}encode(e,t){if("utf-8"!==t&&"utf8"!==t)throw new Error(`Node built-in encoder only supports utf-8, but got ${t}`);return this.textEncoder.encode(e)}decode(e,t){return 0===e.length?"":new this.util.TextDecoder(t).decode(e)}}(0,y.OB)().get("IS_NODE")&&(0,y.OB)().setPlatform("node",new ye);var be=n(2657),ke=n(2271),we=n(8723),ve=n(9798),xe=n(4077);(0,m.wv)();const Ne={buffer:be.f,cast:ke.p,clone:we.d,print:ve.S};(0,xe.Vp)(Ne);function Se(e){return new Promise((e=>setTimeout(e))).then(e)}class Ie{constructor(e){if(!(0,y.OB)().getBool("IS_BROWSER"))throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");e.startsWith(Ie.URL_SCHEME)&&(e=e.slice(Ie.URL_SCHEME.length)),null!=e&&0!==e.length||(e="model"),this.modelJsonFileName=e+".json",this.weightDataFileName=e+".weights.bin"}async save(e){if("undefined"==typeof document)throw new Error("Browser downloads are not supported in this environment since `document` is not present");const t=window.URL.createObjectURL(new Blob([e.weightData],{type:"application/octet-stream"}));if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserDownloads.save() does not support saving model topology in binary formats yet.");{const n=M(e,[{paths:["./"+this.weightDataFileName],weights:e.weightSpecs}]),r=window.URL.createObjectURL(new Blob([JSON.stringify(n)],{type:"application/json"})),a=null==this.modelJsonAnchor?document.createElement("a"):this.modelJsonAnchor;if(a.download=this.modelJsonFileName,a.href=r,await Se((()=>a.dispatchEvent(new MouseEvent("click")))),null!=e.weightData){const e=null==this.weightDataAnchor?document.createElement("a"):this.weightDataAnchor;e.download=this.weightDataFileName,e.href=t,await Se((()=>e.dispatchEvent(new MouseEvent("click"))))}return{modelArtifactsInfo:D(e)}}}}Ie.URL_SCHEME="downloads://";class Te{constructor(e){if(null==e||e.length<1)throw new Error(`When calling browserFiles, at least 1 file is required, but received ${e}`);this.jsonFile=e[0],this.weightsFiles=e.slice(1)}async load(){return new Promise(((e,t)=>{const n=new FileReader;n.onload=n=>{const r=JSON.parse(n.target.result),a=r.modelTopology;if(null==a)return void t(new Error(`modelTopology field is missing from file ${this.jsonFile.name}`));if(null==r.weightsManifest)return void t(new Error(`weightManifest field is missing from file ${this.jsonFile.name}`));if(0===this.weightsFiles.length)return void e({modelTopology:a});const s=$(r,(e=>this.loadWeights(e)));e(s)},n.onerror=e=>t(`Failed to read model topology and weights manifest JSON from file '${this.jsonFile.name}'. BrowserFiles supports loading Keras-style tf.Model artifacts only.`),n.readAsText(this.jsonFile)}))}loadWeights(e){const t=[],n=[];for(const r of e)t.push(...r.weights),n.push(...r.paths);const r=this.checkManifestAndWeightFiles(e),a=n.map((e=>this.loadWeightsFile(e,r[e])));return Promise.all(a).then((e=>[t,E(e)]))}loadWeightsFile(e,t){return new Promise(((n,r)=>{const a=new FileReader;a.onload=e=>{const t=e.target.result;n(t)},a.onerror=t=>r(`Failed to weights data from file of path '${e}'.`),a.readAsArrayBuffer(t)}))}checkManifestAndWeightFiles(e){const t=[],n=this.weightsFiles.map((e=>A(e.name))),r={};for(const a of e)a.paths.forEach((e=>{const a=A(e);if(-1!==t.indexOf(a))throw new Error(`Duplicate file basename found in weights manifest: '${a}'`);if(t.push(a),-1===n.indexOf(a))throw new Error(`Weight file with basename '${a}' is not provided.`);r[e]=this.weightsFiles[n.indexOf(a)]}));if(t.length!==this.weightsFiles.length)throw new Error(`Mismatch in the number of files in weights manifest (${t.length}) and the number of weight files provided (${this.weightsFiles.length}).`);return r}}function _e(e){return new Te(e)}function Ee(e,t,n,r){!function(e){(0,v.hu)(null!=e&&Array.isArray(e)&&e.length>0,(()=>"promises must be a none empty array"))}(e),function(e,t){(0,v.hu)(e>=0&&e<=1,(()=>`Progress fraction must be in range [0, 1], but got startFraction ${e}`)),(0,v.hu)(t>=0&&t<=1,(()=>`Progress fraction must be in range [0, 1], but got endFraction ${t}`)),(0,v.hu)(t>=e,(()=>`startFraction must be no more than endFraction, but got startFraction ${e} and endFraction ${t}`))}(n=null==n?0:n,r=null==r?1:r);let a=0;return Promise.all(e.map((s=>(s.then((s=>{const o=n+ ++a/e.length*(r-n);return t(o),s})),s))))}async function Ae(e,t){null==t&&(t={});const n=null==t.fetchFunc?(0,y.OB)().platform.fetch:t.fetchFunc,r=e.map((e=>n(e,t.requestInit,{isBinary:!0}))),a=(null==t.onProgress?await Promise.all(r):await Ee(r,t.onProgress,0,.5)).map((e=>e.arrayBuffer()));return null==t.onProgress?await Promise.all(a):await Ee(a,t.onProgress,.5,1)}async function Me(e,t="",n,r){return $e((e=>Ae(e,{requestInit:r})))(e,t,n)}function $e(e){return async(t,n="",r)=>{const a=t.map((()=>!1)),s={},o=null!=r?r.map((()=>!1)):[],i=[];if(t.forEach(((e,t)=>{let n=0;e.weights.forEach((e=>{const u="quantization"in e?e.quantization.dtype:e.dtype,l=x[u]*v.NA(e.shape),c=()=>{a[t]=!0,null==s[t]&&(s[t]=[]),s[t].push({manifestEntry:e,groupOffset:n,sizeBytes:l})};null!=r?r.forEach(((t,n)=>{t===e.name&&(c(),o[n]=!0)})):c(),i.push(e.name),n+=l}))})),!o.every((e=>e))){const e=r.filter(((e,t)=>!o[t]));throw new Error(`Could not find weights in manifest with names: ${e.join(", ")}. \nManifest JSON has weights with names: ${i.join(", ")}.`)}const u=a.reduce(((e,t,n)=>(t&&e.push(n),e)),[]),l=[];u.forEach((e=>{t[e].paths.forEach((e=>{const t=n+(n.endsWith("/")?"":"/")+e;l.push(t)}))}));const c=await e(l),p={};let d=0;return u.forEach((e=>{const n=t[e].paths.length;let r=0;for(let e=0;e{const t=S(a.slice(e.groupOffset,e.groupOffset+e.sizeBytes),[e.manifestEntry]);for(const e in t)p[e]=t[e]})),d+=n})),p}}O.registerSaveRouter((e=>(0,y.OB)().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(Ie.URL_SCHEME)?function(e="model"){return new Ie(e)}(e.slice(Ie.URL_SCHEME.length)):null));class De{constructor(e,t){if(this.DEFAULT_METHOD="POST",null==t&&(t={}),this.weightPathPrefix=t.weightPathPrefix,this.onProgress=t.onProgress,this.weightUrlConverter=t.weightUrlConverter,null!=t.fetchFunc?((0,v.hu)("function"==typeof t.fetchFunc,(()=>"Must pass a function that matches the signature of `fetch` (see https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)")),this.fetch=t.fetchFunc):this.fetch=(0,y.OB)().platform.fetch,(0,v.hu)(null!=e&&e.length>0,(()=>"URL path for http must not be null, undefined or empty.")),Array.isArray(e)&&(0,v.hu)(2===e.length,(()=>`URL paths for http must have a length of 2, (actual length is ${e.length}).`)),this.path=e,null!=t.requestInit&&null!=t.requestInit.body)throw new Error("requestInit is expected to have no pre-existing body, but has one.");this.requestInit=t.requestInit||{}}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserHTTPRequest.save() does not support saving model topology in binary formats yet.");const t=Object.assign({method:this.DEFAULT_METHOD},this.requestInit);t.body=new FormData;const n=M(e,[{paths:["./model.weights.bin"],weights:e.weightSpecs}]);t.body.append("model.json",new Blob([JSON.stringify(n)],{type:"application/json"}),"model.json"),null!=e.weightData&&t.body.append("model.weights.bin",new Blob([e.weightData],{type:"application/octet-stream"}),"model.weights.bin");const r=await this.fetch(this.path,t);if(r.ok)return{modelArtifactsInfo:D(e),responses:[r]};throw new Error(`BrowserHTTPRequest.save() failed due to HTTP response status ${r.status}.`)}async load(){const e=await this.fetch(this.path,this.requestInit);if(!e.ok)throw new Error(`Request to ${this.path} failed with status code ${e.status}. Please verify this URL points to the model JSON of the model to load.`);let t;try{t=await e.json()}catch(e){let t=`Failed to parse model JSON of response from ${this.path}.`;throw this.path.endsWith(".pb")?t+=" Your path contains a .pb file extension. Support for .pb models have been removed in TensorFlow.js 1.0 in favor of .json models. You can re-convert your Python TensorFlow model using the TensorFlow.js 1.0 conversion scripts or you can convert your.pb models with the 'pb2json'NPM script in the tensorflow/tfjs-converter repository.":t+=" Please make sure the server is serving valid JSON for this request.",new Error(t)}const n=t.modelTopology,r=t.weightsManifest;if(null==n&&null==r)throw new Error(`The JSON from HTTP path ${this.path} contains neither model topology or manifest for weights.`);return $(t,(e=>this.loadWeights(e)))}async loadWeights(e){const t=Array.isArray(this.path)?this.path[1]:this.path,[n,r]=function(e){const t=e.lastIndexOf("/"),n=e.lastIndexOf("?"),r=e.substring(0,t),a=n>t?e.substring(n):"";return[r+"/",a]}(t),a=this.weightPathPrefix||n,s=[];for(const t of e)s.push(...t.weights);const o=[],i=[];for(const t of e)for(const e of t.paths)null!=this.weightUrlConverter?i.push(this.weightUrlConverter(e)):o.push(a+e+r);this.weightUrlConverter&&o.push(...await Promise.all(i));return[s,E(await Ae(o,{requestInit:this.requestInit,fetchFunc:this.fetch,onProgress:this.onProgress}))]}}function Fe(e){return null!=e.match(De.URL_SCHEME_REGEX)}De.URL_SCHEME_REGEX=/^https?:\/\//;const Oe=(e,t)=>{if("undefined"==typeof fetch&&(null==t||null==t.fetchFunc))return null;{let n=!0;if(n=Array.isArray(e)?e.every((e=>Fe(e))):Fe(e),n)return Be(e,t)}return null};function Be(e,t){return new De(e,t)}function Ce(e,t){return Be(e,t)}O.registerSaveRouter(Oe),O.registerLoadRouter(Oe);class Ve{constructor(e){this.modelArtifacts=e}async load(){return this.modelArtifacts}}class Re{constructor(e){this.saveHandler=e}async save(e){return this.saveHandler(e)}}function ze(e,t,n,r){if(1===arguments.length){return null!=e.modelTopology||null!=e.weightSpecs?new Ve(e):(console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new Ve({modelTopology:e}))}return console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new Ve({modelTopology:e,weightSpecs:t,weightData:n,trainingConfig:r})}function Pe(e){return new Re(e)}var Le=n(3740),We=n(8687),He=n(6708),qe=n(2668),Ge=n(9065);const Ue=(0,qe.op)({confusionMatrix_:function(e,t,n){const r=(0,Le._1)(e,"labels","confusionMatrix"),a=(0,Le._1)(t,"predictions","confusionMatrix");v.hu(null==n||n>0&&Number.isInteger(n),(()=>`If provided, numClasses must be a positive integer, but got ${n}`)),v.hu(1===r.rank,(()=>`Expected the rank of labels to be 1, but got ${r.rank}`)),v.hu(1===a.rank,(()=>`Expected the rank of predictions to be 1, but got ${a.rank}`)),v.hu(r.shape[0]===a.shape[0],(()=>`Mismatch in the number of examples: ${r.shape[0]} vs. ${a.shape[0]}. Labels and predictions should have the same number of elements.`)),v.hu(n>0&&Number.isInteger(n),(()=>`numClasses is required to be a positive integer, but got ${n}`));const s=(0,He.l)((0,ke.p)(r,"int32"),n),o=(0,He.l)((0,ke.p)(a,"int32"),n),i=(0,Ge.p)(s),u=(0,We.O)(i,o);return(0,ke.p)(u,"int32")}});var je=n(9121),Ke=n(6151),Xe=n(9906);let Ze;function Je(e,t=3){if(t>4)throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");if(null==e)throw new Error("pixels passed to tf.browser.fromPixels() can not be null");let n=!1,r=!1,a=!1,s=!1,o=!1,i=!1;if(e.data instanceof Uint8Array)n=!0;else if("undefined"!=typeof ImageData&&e instanceof ImageData)r=!0;else if("undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement)a=!0;else if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement)s=!0;else if(null!=e.getContext)o=!0;else{if(!("undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap))throw new Error(`pixels passed to tf.browser.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData in browser, or OffscreenCanvas, ImageData in webworker or {data: Uint32Array, width: number, height: number}, but was ${e.constructor.name}`);i=!0}if(a){const t=2;if(a&&e.readyState element.")}if(null!=(0,Ke.pI)(je.eB,m.BV.backendName)){const n={pixels:e},r={numChannels:t};return m.BV.runKernel(je.eB,n,r)}const[u,l]=a?[e.videoWidth,e.videoHeight]:[e.width,e.height];let c,p;if(o?c=e.getContext("2d").getImageData(0,0,u,l).data:r||n?c=e.data:(s||a||i)&&(null==Ze&&(Ze=document.createElement("canvas").getContext("2d")),Ze.canvas.width=u,Ze.canvas.height=l,Ze.drawImage(e,0,0,u,l),c=Ze.getImageData(0,0,u,l).data),4===t)p=new Int32Array(c);else{const e=u*l;p=new Int32Array(e*t);for(let n=0;n4||2===s)throw new Error(`toPixels only supports depth of size 1, 3 or 4 but got ${s}`);if("float32"!==n.dtype&&"int32"!==n.dtype)throw new Error(`Unsupported type for toPixels: ${n.dtype}. Please use float32 or int32 tensors.`);const o=await n.data(),i="float32"===n.dtype?255:1,u=new Uint8ClampedArray(a*r*4);for(let e=0;e1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${a}.`)}else if("int32"===n.dtype&&(a<0||a>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${a}.`);1===s?(t[0]=a*i,t[1]=a*i,t[2]=a*i):t[r]=a*i}const r=4*e;u[r+0]=Math.round(t[0]),u[r+1]=Math.round(t[1]),u[r+2]=Math.round(t[2]),u[r+3]=Math.round(t[3])}if(null!=t){t.width=a,t.height=r;const e=t.getContext("2d"),n=new ImageData(u,a,r);e.putImageData(n,0,0)}return n!==e&&n.dispose(),u}const tt=(0,qe.op)({fromPixels_:Je});function nt(e,t){const n=e.shape.length,r=t.shape.length;if(n<1)throw new Error(`tf.gatherND() expects the input to be rank 1 or higher, but the rank was ${n}.`);if(r<1)throw new Error(`tf.gatherND() expects the indices to be rank 1 or higher, but the rank was ${r}.`);if("int32"!==t.dtype)throw new Error(`tf.gatherND() expects the indices to be int32 type, but the dtype was ${t.dtype}.`);if(t.shape[r-1]>n)throw new Error(`index innermost dimension length must be <= tensor rank; saw: ${t.shape[r-1]} vs. ${n}`);if(0===(0,v.NA)(e.shape))throw new Error(`Requested more than 0 entries, but input is empty. Input shape: ${e.shape}.`);const a=t.shape,s=a[a.length-1];let o=1;for(let e=0;ee/l)),1].slice(0,s);return[u,o,l,c]}var rt=n(3028);function at(e,t,n){const r=e.shape.length;v.hu(r===t.length,(()=>`Error in slice${r}D: Length of begin ${t} must match the rank of the array (${r}).`)),v.hu(r===n.length,(()=>`Error in slice${r}D: Length of size ${n} must match the rank of the array (${r}).`));for(let a=0;a`Error in slice${r}D: begin[${a}] + size[${a}] (${t[a]+n[a]}) would overflow input.shape[${a}] (${e.shape[a]})`))}function st(e){const t=[];let n=0;for(;e>0;)1&e&&t.push(n),e/=2,n++;return t}function ot(e,t,n){const r=[];for(let a=0;a0){const u=t[0],l=n+1;c=pt(o,u,l,r,e),p=dt(i,u,l,a,e),d=it(s,u,l,e)}else for(let t=0;t-1)s[a]=0;else{const o=ut(t,n,a);let i=r[o];e&1<-1)s[a]=Number.MAX_SAFE_INTEGER;else{const o=ut(t,n,a);let i=r[o];e&1<0?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER);const u=r[a];return o<0&&(o+=u),o=v.uZ(0,o,u-1),o}function ft(e,t,n,r,a,s){let o=t[a];const i=n[a]||1;(e&1<0?Number.MAX_SAFE_INTEGER:Number.MIN_SAFE_INTEGER);const u=r[a];return o<0&&(o+=u),o=i>0?v.uZ(0,o,u):v.uZ(-1,o,u-1),o}function gt(e,t,n){let r=n.length;for(let e=0;e1){r=e;break}for(let a=r+1;a0||n[a]!==e[a])return!1;return!0}function yt(e,t){let n=e.length>0?e[e.length-1]:1;for(let r=0;r{v.hu(-1!==e,(()=>"slice() does not support negative begin indexing."))})),s=null==n?new Array(a).fill(-1):"number"==typeof n?[n,...new Array(a-1).fill(-1)]:n.lengtht>=0?t:(v.hu(-1===t,(()=>`Negative size values should be exactly -1 but got ${t} for the slice() size at index ${n}.`)),e.shape[n]-r[n]))),[r,s]}function kt(e,t,n,r,a,s,o,i,u){let l=t.slice(),c=n.slice(),p=r;null==r&&(p=new Array(l.length));const d=st(o);if(d.length>1)throw new Error("Multiple ellipses in slice is not allowed.");if(0!==o&&0!==i)throw new Error("Using both ellipsisMask and newAxisMask is not yet supported.");if(0!==o&&0!==u)throw new Error("Using both ellipsisMask and shrinkAxisMask is not yet supported.");const h=e.length-l.length,m=st(i),f=e.slice();m.forEach((e=>{l[e]=0,c[e]=1,f.splice(e,0,1)}));const{begin:g,end:y,strides:b}=ct(f,d,h,l,c,p,a,s,o);l=g,c=y,p=b;const k=st(u);k.forEach((e=>{c[e]=l[e]+1,p[e]=1}));const w=ot(l,c,p),v=w.filter(((e,t)=>-1===k.indexOf(t)));return{nonStrided:p.every((e=>1===e)),$begin:l,$end:c,$strides:p,size:w,newShape:f,outShape:v}}class wt{getClassName(){return this.constructor.className}static fromConfig(e,t){return new e(t)}}class vt{constructor(){this.classNameMap={}}static getMap(){return null==vt.instance&&(vt.instance=new vt),vt.instance}static register(e){vt.getMap().classNameMap[e.className]=[e,e.fromConfig]}}function xt(e){(0,v.hu)(null!=e.className,(()=>"Class being registered does not have the static className property defined.")),(0,v.hu)("string"==typeof e.className,(()=>"className is required to be a string, but got type "+typeof e.className)),(0,v.hu)(e.className.length>0,(()=>"Class being registered has an empty-string as its className, which is disallowed.")),vt.register(e)}var Nt=n(747),St=n(9122);const It=.1;function Tt(e,t,n){return null==n&&(n=_t()),Et(e,t,((e,t)=>Dt(e,t,n)))}function _t(){return 32===m.BV.backend.floatPrecision()?.001:It}function Et(e,t,n){let r=!0;if(((0,v.fU)(e)||(0,v.fU)(t))&&(r=!1),(0,v.fU)(e)&&(0,v.fU)(t)&&(r=!0),r){const n=e.constructor.name,r=t.constructor.name;if(n!==r)throw new Error(`Arrays are of different type. Actual: ${n}. Expected: ${r}`)}if(Array.isArray(e)&&Array.isArray(t)){const n=(0,Le.C)(e),r=(0,Le.C)(t);if(!(0,v.cO)(n,r))throw new Error(`Arrays have different shapes. Actual: [${n}]. Expected: [${r}]`)}const a=(0,v.fU)(e)?e:(0,v.xH)(e),s=(0,v.fU)(t)?t:(0,v.xH)(t);if(a.length!==s.length)throw new Error(`Arrays have different lengths actual: ${a.length} vs expected: ${s.length}.\nActual: ${a}.\nExpected: ${s}.`);for(let e=0;et.fail()),(()=>t()))}function Mt(e,t){const n="string"==typeof t||"number"==typeof t||"boolean"==typeof t?[t]:t;return(0,v.HD)(e)||(0,v.HD)(e[0])||(0,v.HD)(t)||(0,v.HD)(t[0])?Et(e,n,((e,t)=>e==t)):Et(e,t,((e,t)=>Dt(e,t,0)))}function $t(e,t,n){if(null==n&&(n=_t()),!Dt(e,t,n))throw new Error(`Numbers differ: actual === ${e}, expected === ${t}`)}function Dt(e,t,n){return!isFinite(e)&&!isFinite(t)||!(isNaN(e)||isNaN(t)||Math.abs(e-t)>n)}function Ft(e,t,n){for(let r=0;rn)throw new Error(`Value out of range:${e[r]} low: ${t}, high: ${n}`)}function Ot(e,t){expect(new Float32Array(e)).toEqual(new Float32Array(t))}function Bt(e){for(let t=0;t({name:e.name,tensor:a[e.name]})));this.applyGradients(e)}else this.applyGradients(a);return(0,Vt.B9)(a),t?r:(r.dispose(),null)}get iterations(){return null==this.iterations_&&(this.iterations_=0),this.iterations_}incrementIterations(){this.iterations_=this.iterations+1}computeGradients(e,t){return(0,qt.pn)(e,t)}dispose(){null!=this.iterations_&&(0,Vt.B9)(this.iterations_)}async saveIterations(){return null==this.iterations_&&(this.iterations_=0),{name:"iter",tensor:(0,Gt.i)(this.iterations_,"int32")}}async getWeights(){throw new Error("getWeights() is not implemented for this optimizer yet.")}async setWeights(e){throw new Error(`setWeights() is not implemented for this optimizer class ${this.getClassName()}`)}async extractIterations(e){return this.iterations_=(await e[0].tensor.data())[0],e.slice(1)}}Object.defineProperty(Ut,Symbol.hasInstance,{value:e=>null!=e.minimize&&null!=e.computeGradients&&null!=e.applyGradients});class jt extends Ut{constructor(e,t,n=null){super(),this.learningRate=e,this.rho=t,this.epsilon=n,this.accumulatedGrads=[],this.accumulatedUpdates=[],null==n&&(this.epsilon=m.BV.backend.epsilon())}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const r=m.BV.registeredVariables[t];null==this.accumulatedGrads[n]&&(this.accumulatedGrads[n]={originalName:`${t}/accum_grad`,variable:(0,Vt.lu)((()=>(0,Ht.P)(r).variable(false)))}),null==this.accumulatedUpdates[n]&&(this.accumulatedUpdates[n]={originalName:`${t}/accum_var`,variable:(0,Vt.lu)((()=>(0,Ht.P)(r).variable(false)))});const a=Array.isArray(e)?e[n].tensor:e[t];if(null==a)return;const s=this.accumulatedGrads[n].variable,o=this.accumulatedUpdates[n].variable;(0,Vt.lu)((()=>{const e=(0,Rt.I)((0,Pt.d)(s,this.rho),(0,Pt.d)((0,Wt.h)(a),1-this.rho)),t=(0,Pt.d)((0,zt.h)((0,Lt._)((0,Rt.I)(o,this.epsilon)),(0,Lt._)((0,Rt.I)(s,this.epsilon))),a),n=(0,Rt.I)((0,Pt.d)(o,this.rho),(0,Pt.d)((0,Wt.h)(t),1-this.rho));s.assign(e),o.assign(n);const i=(0,Rt.I)((0,Pt.d)(t,-this.learningRate),r);r.assign(i)}))})),this.incrementIterations()}dispose(){null!=this.accumulatedUpdates&&((0,Vt.B9)(this.accumulatedGrads.map((e=>e.variable))),(0,Vt.B9)(this.accumulatedUpdates.map((e=>e.variable))))}async getWeights(){const e=[...this.accumulatedGrads,...this.accumulatedUpdates];return[await this.saveIterations()].concat(e.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){const t=(e=await this.extractIterations(e)).length/2;this.accumulatedGrads=e.slice(0,t).map((e=>({originalName:e.name,variable:e.tensor.variable(false)}))),this.accumulatedUpdates=e.slice(t,2*t).map((e=>({originalName:e.name,variable:e.tensor.variable(false)})))}getConfig(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.rho,t.epsilon)}}jt.className="Adadelta",xt(jt);var Kt=n(4006);class Xt extends Ut{constructor(e,t=.1){super(),this.learningRate=e,this.initialAccumulatorValue=t,this.accumulatedGrads=[]}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const r=m.BV.registeredVariables[t];if(null==this.accumulatedGrads[n]){const e=!1;this.accumulatedGrads[n]={originalName:`${t}/accumulator`,variable:(0,Vt.lu)((()=>(0,Kt.h)(r.shape,this.initialAccumulatorValue).variable(e)))}}const a=Array.isArray(e)?e[n].tensor:e[t];if(null==a)return;const s=this.accumulatedGrads[n].variable;(0,Vt.lu)((()=>{const e=(0,Rt.I)(s,(0,Wt.h)(a));s.assign(e);const t=(0,Rt.I)((0,Pt.d)((0,zt.h)(a,(0,Lt._)((0,Rt.I)(e,m.BV.backend.epsilon()))),-this.learningRate),r);r.assign(t)}))})),this.incrementIterations()}dispose(){null!=this.accumulatedGrads&&(0,Vt.B9)(this.accumulatedGrads.map((e=>e.variable)))}async getWeights(){return[await this.saveIterations()].concat(this.accumulatedGrads.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){e=await this.extractIterations(e);this.accumulatedGrads=e.map((e=>({originalName:e.name,variable:e.tensor.variable(false)})))}getConfig(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}}static fromConfig(e,t){return new e(t.learningRate,t.initialAccumulatorValue)}}Xt.className="Adagrad",xt(Xt);var Zt=n(3453),Jt=n(827);class Qt extends Ut{constructor(e,t,n,r=null){super(),this.learningRate=e,this.beta1=t,this.beta2=n,this.epsilon=r,this.accumulatedFirstMoment=[],this.accumulatedSecondMoment=[],(0,Vt.lu)((()=>{this.accBeta1=(0,Gt.i)(t).variable(),this.accBeta2=(0,Gt.i)(n).variable()})),null==r&&(this.epsilon=m.BV.backend.epsilon())}applyGradients(e){const t=Array.isArray(e)?e.map((e=>e.name)):Object.keys(e);(0,Vt.lu)((()=>{const n=(0,Jt.l)(1,this.accBeta1),r=(0,Jt.l)(1,this.accBeta2);t.forEach(((t,a)=>{const s=m.BV.registeredVariables[t];null==this.accumulatedFirstMoment[a]&&(this.accumulatedFirstMoment[a]={originalName:`${t}/m`,variable:(0,Vt.lu)((()=>(0,Ht.P)(s).variable(false)))}),null==this.accumulatedSecondMoment[a]&&(this.accumulatedSecondMoment[a]={originalName:`${t}/v`,variable:(0,Vt.lu)((()=>(0,Ht.P)(s).variable(false)))});const o=Array.isArray(e)?e[a].tensor:e[t];if(null==o)return;const i=this.accumulatedFirstMoment[a].variable,u=this.accumulatedSecondMoment[a].variable,l=(0,Rt.I)((0,Pt.d)(i,this.beta1),(0,Pt.d)(o,1-this.beta1)),c=(0,Rt.I)((0,Pt.d)(u,this.beta2),(0,Pt.d)((0,Wt.h)(o),1-this.beta2)),p=(0,zt.h)(l,n),d=(0,zt.h)(c,r);i.assign(l),u.assign(c);const h=(0,Rt.I)((0,Pt.d)((0,zt.h)(p,(0,Rt.I)((0,Lt._)(d),this.epsilon)),-this.learningRate),s);s.assign(h)})),this.accBeta1.assign((0,Pt.d)(this.accBeta1,this.beta1)),this.accBeta2.assign((0,Pt.d)(this.accBeta2,this.beta2))})),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.accBeta2.dispose(),null!=this.accumulatedFirstMoment&&(0,Vt.B9)(this.accumulatedFirstMoment.map((e=>e.variable))),null!=this.accumulatedSecondMoment&&(0,Vt.B9)(this.accumulatedSecondMoment.map((e=>e.variable)))}async getWeights(){const e=[...this.accumulatedFirstMoment,...this.accumulatedSecondMoment];return[await this.saveIterations()].concat(e.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){e=await this.extractIterations(e),(0,Vt.lu)((()=>{this.accBeta1.assign((0,Zt.s)(this.beta1,this.iterations_+1)),this.accBeta2.assign((0,Zt.s)(this.beta2,this.iterations_+1))}));const t=e.length/2;this.accumulatedFirstMoment=e.slice(0,t).map((e=>({originalName:e.name,variable:e.tensor.variable(false)}))),this.accumulatedSecondMoment=e.slice(t,2*t).map((e=>({originalName:e.name,variable:e.tensor.variable(false)})))}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon)}}Qt.className="Adam",xt(Qt);var Yt=n(6235),en=n(632);class tn extends Ut{constructor(e,t,n,r=null,a=0){super(),this.learningRate=e,this.beta1=t,this.beta2=n,this.epsilon=r,this.decay=a,this.accumulatedFirstMoment=[],this.accumulatedWeightedInfNorm=[],(0,Vt.lu)((()=>{this.iteration=(0,Gt.i)(0).variable(),this.accBeta1=(0,Gt.i)(t).variable()})),null==r&&(this.epsilon=m.BV.backend.epsilon())}applyGradients(e){const t=Array.isArray(e)?e.map((e=>e.name)):Object.keys(e);(0,Vt.lu)((()=>{const n=(0,Jt.l)(1,this.accBeta1),r=(0,zt.h)(-this.learningRate,(0,Rt.I)((0,Pt.d)(this.iteration,this.decay),1));t.forEach(((t,a)=>{const s=m.BV.registeredVariables[t];null==this.accumulatedFirstMoment[a]&&(this.accumulatedFirstMoment[a]={originalName:`${t}/m`,variable:(0,Ht.P)(s).variable(false)}),null==this.accumulatedWeightedInfNorm[a]&&(this.accumulatedWeightedInfNorm[a]={originalName:`${t}/v`,variable:(0,Ht.P)(s).variable(false)});const o=Array.isArray(e)?e[a].tensor:e[t];if(null==o)return;const i=this.accumulatedFirstMoment[a].variable,u=this.accumulatedWeightedInfNorm[a].variable,l=(0,Rt.I)((0,Pt.d)(i,this.beta1),(0,Pt.d)(o,1-this.beta1)),c=(0,Pt.d)(u,this.beta2),p=(0,Yt.W)(o),d=(0,en.g)(c,p);i.assign(l),u.assign(d);const h=(0,Rt.I)((0,Pt.d)((0,zt.h)(r,n),(0,zt.h)(l,(0,Rt.I)(d,this.epsilon))),s);s.assign(h)})),this.iteration.assign((0,Rt.I)(this.iteration,1)),this.accBeta1.assign((0,Pt.d)(this.accBeta1,this.beta1))})),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.iteration.dispose(),null!=this.accumulatedFirstMoment&&(0,Vt.B9)(this.accumulatedFirstMoment.map((e=>e.variable))),null!=this.accumulatedWeightedInfNorm&&(0,Vt.B9)(this.accumulatedWeightedInfNorm.map((e=>e.variable)))}async getWeights(){throw new Error("getWeights() is not implemented for Adamax yet.")}async setWeights(e){throw new Error("setWeights() is not implemented for Adamax yet.")}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon,decay:this.decay}}static fromConfig(e,t){return new e(t.learningRate,t.beta1,t.beta2,t.epsilon,t.decay)}}tn.className="Adamax",xt(tn);class nn extends Ut{constructor(e){super(),this.learningRate=e,this.setLearningRate(e)}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const r=Array.isArray(e)?e[n].tensor:e[t];if(null==r)return;const a=m.BV.registeredVariables[t];(0,Vt.lu)((()=>{const e=(0,Rt.I)((0,Pt.d)(this.c,r),a);a.assign(e)}))})),this.incrementIterations()}setLearningRate(e){this.learningRate=e,null!=this.c&&this.c.dispose(),this.c=(0,Vt.Cn)((0,Gt.i)(-e))}dispose(){this.c.dispose()}async getWeights(){return[await this.saveIterations()]}async setWeights(e){if(0!==(e=await this.extractIterations(e)).length)throw new Error("SGD optimizer does not have settable weights.")}getConfig(){return{learningRate:this.learningRate}}static fromConfig(e,t){return new e(t.learningRate)}}nn.className="SGD",xt(nn);class rn extends nn{constructor(e,t,n=!1){super(e),this.learningRate=e,this.momentum=t,this.useNesterov=n,this.accumulations=[],this.m=(0,Gt.i)(this.momentum)}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const r=m.BV.registeredVariables[t];if(null==this.accumulations[n]){const e=!1;this.accumulations[n]={originalName:`${t}/momentum`,variable:(0,Vt.lu)((()=>(0,Ht.P)(r).variable(e)))}}const a=this.accumulations[n].variable,s=Array.isArray(e)?e[n].tensor:e[t];null!=s&&(0,Vt.lu)((()=>{let e;const t=(0,Rt.I)((0,Pt.d)(this.m,a),s);e=this.useNesterov?(0,Rt.I)((0,Pt.d)(this.c,(0,Rt.I)(s,(0,Pt.d)(t,this.m))),r):(0,Rt.I)((0,Pt.d)(this.c,t),r),a.assign(t),r.assign(e)}))})),this.incrementIterations()}dispose(){this.m.dispose(),null!=this.accumulations&&(0,Vt.B9)(this.accumulations.map((e=>e.variable)))}setMomentum(e){this.momentum=e}async getWeights(){return[await this.saveIterations()].concat(this.accumulations.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){e=await this.extractIterations(e);this.accumulations=e.map((e=>({originalName:e.name,variable:e.tensor.variable(false)})))}getConfig(){return{learningRate:this.learningRate,momentum:this.momentum,useNesterov:this.useNesterov}}static fromConfig(e,t){return new e(t.learningRate,t.momentum,t.useNesterov)}}rn.className="Momentum",xt(rn);class an extends Ut{constructor(e,t=.9,n=0,r=null,a=!1){if(super(),this.learningRate=e,this.decay=t,this.momentum=n,this.epsilon=r,this.accumulatedMeanSquares=[],this.accumulatedMoments=[],this.accumulatedMeanGrads=[],this.centered=a,null==r&&(this.epsilon=m.BV.backend.epsilon()),null==e)throw new Error("learningRate for RMSPropOptimizer must be defined.")}applyGradients(e){(Array.isArray(e)?e.map((e=>e.name)):Object.keys(e)).forEach(((t,n)=>{const r=m.BV.registeredVariables[t],a=!1;null==this.accumulatedMeanSquares[n]&&(this.accumulatedMeanSquares[n]={originalName:`${t}/rms`,variable:(0,Vt.lu)((()=>(0,Ht.P)(r).variable(a)))}),null==this.accumulatedMoments[n]&&(this.accumulatedMoments[n]={originalName:`${t}/momentum`,variable:(0,Vt.lu)((()=>(0,Ht.P)(r).variable(a)))}),null==this.accumulatedMeanGrads[n]&&this.centered&&(this.accumulatedMeanGrads[n]={originalName:`${t}/mg`,variable:(0,Vt.lu)((()=>(0,Ht.P)(r).variable(a)))});const s=Array.isArray(e)?e[n].tensor:e[t];if(null==s)return;const o=this.accumulatedMeanSquares[n].variable,i=this.accumulatedMoments[n].variable;(0,Vt.lu)((()=>{const e=(0,Rt.I)((0,Pt.d)(o,this.decay),(0,Pt.d)((0,Wt.h)(s),1-this.decay));if(this.centered){const t=this.accumulatedMeanGrads[n].variable,a=(0,Rt.I)((0,Pt.d)(t,this.decay),(0,Pt.d)(s,1-this.decay)),u=(0,zt.h)((0,Pt.d)(s,this.learningRate),(0,Lt._)((0,Jt.l)(e,(0,Rt.I)((0,Wt.h)(a),this.epsilon)))),l=(0,Rt.I)((0,Pt.d)(i,this.momentum),u);o.assign(e),t.assign(a),i.assign(l);const c=(0,Jt.l)(r,l);r.assign(c)}else{const e=(0,Rt.I)((0,Pt.d)(o,this.decay),(0,Pt.d)((0,Wt.h)(s),1-this.decay)),t=(0,Rt.I)((0,Pt.d)(i,this.momentum),(0,zt.h)((0,Pt.d)(s,this.learningRate),(0,Lt._)((0,Rt.I)(e,this.epsilon))));o.assign(e),i.assign(t);const n=(0,Jt.l)(r,t);r.assign(n)}}))})),this.incrementIterations()}dispose(){null!=this.accumulatedMeanSquares&&(0,Vt.B9)(this.accumulatedMeanSquares.map((e=>e.variable))),null!=this.accumulatedMeanGrads&&this.centered&&(0,Vt.B9)(this.accumulatedMeanGrads.map((e=>e.variable))),null!=this.accumulatedMoments&&(0,Vt.B9)(this.accumulatedMoments.map((e=>e.variable)))}async getWeights(){const e=[...this.accumulatedMeanSquares,...this.accumulatedMoments];return this.centered&&e.push(...this.accumulatedMeanGrads),[await this.saveIterations()].concat(e.map((e=>({name:e.originalName,tensor:e.variable}))))}async setWeights(e){e=await this.extractIterations(e);const t=this.centered?e.length/3:e.length/2,n=!1;this.accumulatedMeanSquares=e.slice(0,t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)}))),this.accumulatedMoments=e.slice(t,2*t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)}))),this.centered&&(this.accumulatedMeanGrads=e.slice(2*t,3*t).map((e=>({originalName:e.name,variable:e.tensor.variable(n)}))))}getConfig(){return{learningRate:this.learningRate,decay:this.decay,momentum:this.momentum,epsilon:this.epsilon,centered:this.centered}}static fromConfig(e,t){return new e(t.learningRate,t.decay,t.momentum,t.epsilon,t.centered)}}an.className="RMSProp",xt(an);var sn=n(1221),on=n(4885),un=n(9876);class ln{static sgd(e){return new nn(e)}static momentum(e,t,n=!1){return new rn(e,t,n)}static rmsprop(e,t=.9,n=0,r=null,a=!1){return new an(e,t,n,r,a)}static adam(e=.001,t=.9,n=.999,r=null){return new Qt(e,t,n,r)}static adadelta(e=.001,t=.95,n=null){return new jt(e,t,n)}static adamax(e=.002,t=.9,n=.999,r=null,a=0){return new tn(e,t,n,r,a)}static adagrad(e,t=.1){return new Xt(e,t)}}const cn={sgd:ln.sgd,momentum:ln.momentum,adadelta:ln.adadelta,adagrad:ln.adagrad,rmsprop:ln.rmsprop,adamax:ln.adamax,adam:ln.adam},pn="undefined"!=typeof requestAnimationFrame?requestAnimationFrame:"undefined"!=typeof setImmediate?setImmediate:e=>e();function dn(){return new Promise((e=>pn((()=>e()))))}var hn=n(3591),mn=n(2200);function fn(e,t){const n=e[0].length;e.forEach(((e,t)=>{v.hu(e.length===n,(()=>`Error in concat${n}D: rank of tensors[${t}] must be the same as the rank of the rest (${n})`))})),v.hu(t>=0&&t`Error in concat${n}D: axis must be between 0 and ${n-1}.`));const r=e[0];e.forEach(((e,a)=>{for(let s=0;s`Error in concat${n}D: Shape of tensors[${a}] (${e}) does not match the shape of the rest (${r}) along the non-concatenated axis ${a}.`))}))}function gn(e,t){const n=e[0].slice();for(let r=1;r=2*t+1||r%2==1?a.push(r):n.push(r);r.push(...n),r.push(0),r.push(...a)}return r}function Sn(e,t,n,r=!0){const a=[];r?a.push(e[0]/n):a.push(e[0]*n);for(let n=1;n/g;function Un(e,t){const n=((e=e.replace(/\s/g,"")).length-e.replace(Gn,"").length)/qn.length;if(n<1)throw new Error("Equations without an arrow are not supported.");if(n>1)throw new Error('Equation must contain exactly one arrow ("->").');const[r,a]=e.split(qn);(0,v.hu)(-1===r.indexOf("..."),(()=>'The ellipsis notation ("...") is not supported yet.'));const s=r.split(","),o=s.length;if(t!==o)throw new Error(`Expected ${o} input tensors, received ${t}`);if(o>2)throw new Error("Support for more than 2 input tensors is not implemented yet.");const i=[];for(let e=0;e-1!==e.indexOf(t))))throw new Error(`Output subscripts contain the label ${t} not present in the input subscripts.`);-1===i.indexOf(t)&&i.push(t)}for(let e=0;e-1!==e)),{permutationIndices:n,expandDims:r}}function Kn(e,t,n){const r=new Array(e);for(let e=0;e`Expected dimension ${r[t[e][n]]} at axis ${n} of input shaped ${JSON.stringify(a)}, but got dimension ${a[n]}`))}}function Xn(e,t){const n=e,r=[];let a=0;0===e.length&&n.push(-1),a=e.length+1;for(let e=0;ee===t))}function Jn(e,t){const n=[];for(let r=0;r"Number of splits must evenly divide the axis.")),r=new Array(t).fill(e.shape[n]/t);else{const a=t.reduce(((e,t)=>(-1===t&&(e+=1),e)),0);(0,v.hu)(a<=1,(()=>"There should be only one negative value in split array."));const s=t.indexOf(-1);if(-1!==s){const r=t.reduce(((e,t)=>t>0?e+t:e));t[s]=e.shape[n]-r}(0,v.hu)(e.shape[n]===t.reduce(((e,t)=>e+t)),(()=>"The sum of sizes must match the size of the axis dimension.")),r=t}return r}function Yn(e,t){let n,r=!1;for(e<=kn?(n=e,r=!0):n=(0,v.jP)(e,Math.floor(Math.sqrt(e)));!r;)n>t||n===e?r=!0:n=(0,v.jP)(e,n+1);return n}function er(e,t,n){const r=[],a=e.length;for(let s=0;sa))throw new Error(`Expect batchDims in the range of [-${a}, ${a}], but got ${r}`);if(r<0&&(r+=a),r>s)throw new Error(`batchDims (${r}) must be less than rank(x) (\n ${s}).`);if(n(0,St.decodeString)(e)))}catch(e){throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${e}`)}}function rr(e){return e.map((e=>(0,St.encodeString)(e)))}var ar=n(3337),sr=n(8333),or=n(8713)},9121:(e,t,n)=>{"use strict";n.d(t,{SY:()=>r,VG:()=>a,Sp:()=>s,mm:()=>o,Xz:()=>i,oT:()=>u,IK:()=>l,sJ:()=>c,aJ:()=>p,M2:()=>d,qw:()=>h,jM:()=>m,Oy:()=>f,QC:()=>g,Jh:()=>y,RO:()=>b,_k:()=>k,IM:()=>w,XL:()=>v,zw:()=>x,zv:()=>N,Ly:()=>S,eE:()=>I,RF:()=>T,gJ:()=>_,xn:()=>E,Zz:()=>A,yj:()=>M,Eh:()=>$,mh:()=>D,wU:()=>F,wm:()=>O,x1:()=>B,o2:()=>C,ik:()=>V,mc:()=>R,TR:()=>z,iH:()=>P,Vc:()=>L,QR:()=>W,T0:()=>H,ci:()=>q,sL:()=>G,y7:()=>U,$w:()=>j,p4:()=>K,ek:()=>X,Vn:()=>Z,oH:()=>J,$g:()=>Q,SX:()=>Y,HE:()=>ee,Om:()=>te,hd:()=>ne,NE:()=>re,YF:()=>ae,Y0:()=>se,vw:()=>oe,de:()=>ie,Uy:()=>ue,OR:()=>le,je:()=>ce,sH:()=>pe,qi:()=>de,q1:()=>he,iZ:()=>me,Ac:()=>fe,iJ:()=>ge,Qg:()=>ye,J_:()=>be,av:()=>ke,iW:()=>we,r7:()=>ve,J$:()=>xe,vt:()=>Ne,CA:()=>Se,e7:()=>Ie,Zb:()=>Te,kU:()=>_e,PY:()=>Ee,Vf:()=>Ae,MZ:()=>Me,qC:()=>$e,eZ:()=>De,Hh:()=>Fe,Yo:()=>Oe,BM:()=>Be,mT:()=>Ce,OV:()=>Ve,OA:()=>Re,OU:()=>ze,vF:()=>Pe,q2:()=>Le,c1:()=>We,q8:()=>He,jQ:()=>qe,Vb:()=>Ge,NZ:()=>Ue,wY:()=>je,ku:()=>Ke,yQ:()=>Xe,uv:()=>Ze,cy:()=>Je,W0:()=>Qe,qW:()=>Ye,we:()=>et,Qi:()=>tt,ly:()=>nt,Kg:()=>rt,pe:()=>at,o0:()=>st,Dl:()=>ot,e6:()=>it,xJ:()=>ut,$H:()=>lt,qk:()=>ct,HZ:()=>pt,dp:()=>dt,Hm:()=>ht,_Y:()=>mt,zb:()=>ft,Sb:()=>gt,mK:()=>yt,e0:()=>bt,bV:()=>kt,xQ:()=>wt,Ph:()=>vt,oF:()=>xt,p2:()=>Nt,RQ:()=>St,w3:()=>It,i5:()=>Tt,a5:()=>_t,MR:()=>Et,FK:()=>At,GB:()=>Mt,TQ:()=>$t,L8:()=>Dt,Gc:()=>Ft,O3:()=>Ot,nh:()=>Bt,YW:()=>Ct,Zj:()=>Vt,D2:()=>Rt,_t:()=>zt,bK:()=>Pt,m2:()=>Lt,_J:()=>Wt,s1:()=>Ht,Xk:()=>qt,Tr:()=>Gt,sE:()=>Ut,MI:()=>jt,n9:()=>Kt,cW:()=>Xt,wx:()=>Zt,G3:()=>Jt,kp:()=>Qt,To:()=>Yt,Qv:()=>en,Ru:()=>tn,h8:()=>nn,eB:()=>rn,b9:()=>an,us:()=>sn,_V:()=>on,lu:()=>un});const r="Abs",a="Acos",s="Acosh",o="Add",i="AddN",u="All",l="Any",c="ArgMax",p="ArgMin",d="Asin",h="Asinh",m="Atan",f="Atanh",g="Atan2",y="AvgPool",b="AvgPoolGrad",k="AvgPool3D",w="AvgPool3DGrad",v="BatchMatMul",x="BatchToSpaceND",N="Bincount",S="BroadcastTo",I="BroadcastArgs",T="Cast",_="Ceil",E="ClipByValue",A="Complex",M="ComplexAbs",$="Concat",D="Conv2D",F="Conv2DBackpropFilter",O="Conv2DBackpropInput",B="Conv3D",C="Conv3DBackpropFilterV2",V="Conv3DBackpropInputV2",R="Cos",z="Cosh",P="Cumsum",L="CropAndResize",W="DenseBincount",H="DepthToSpace",q="DepthwiseConv2dNative",G="DepthwiseConv2dNativeBackpropFilter",U="DepthwiseConv2dNativeBackpropInput",j="Diag",K="Dilation2D",X="Dilation2DBackpropInput",Z="Dilation2DBackpropFilter",J="RealDiv",Q="Einsum",Y="Elu",ee="EluGrad",te="Erf",ne="Equal",re="Exp",ae="ExpandDims",se="Expm1",oe="FFT",ie="Fill",ue="FlipLeftRight",le="Floor",ce="FloorDiv",pe="FusedBatchNorm",de="GatherV2",he="GatherNd",me="Greater",fe="GreaterEqual",ge="Identity",ye="IFFT",be="Imag",ke="IsFinite",we="IsInf",ve="IsNan",xe="LeakyRelu",Ne="Less",Se="LessEqual",Ie="LinSpace",Te="Log",_e="Log1p",Ee="LogicalAnd",Ae="LogicalNot",Me="LogicalOr",$e="LogSoftmax",De="LRN",Fe="LRNGrad",Oe="Max",Be="Maximum",Ce="MaxPool",Ve="MaxPoolGrad",Re="MaxPool3D",ze="MaxPool3DGrad",Pe="MaxPoolWithArgmax",Le="Mean",We="Min",He="Minimum",qe="MirrorPad",Ge="Mod",Ue="Multinomial",je="Multiply",Ke="Neg",Xe="NotEqual",Ze="NonMaxSuppressionV3",Je="NonMaxSuppressionV4",Qe="NonMaxSuppressionV5",Ye="OnesLike",et="OneHot",tt="Pack",nt="PadV2",rt="Pool",at="Pow",st="Prelu",ot="Prod",it="Range",ut="Real",lt="Reciprocal",ct="Relu",pt="Reshape",dt="ResizeNearestNeighbor",ht="ResizeNearestNeighborGrad",mt="ResizeBilinear",ft="ResizeBilinearGrad",gt="Relu6",yt="Reverse",bt="Round",kt="Rsqrt",wt="ScatterNd",vt="Select",xt="Selu",Nt="Slice",St="Sin",It="Sinh",Tt="Sign",_t="Sigmoid",Et="Softplus",At="Sqrt",Mt="Sum",$t="SpaceToBatchND",Dt="SplitV",Ft="Softmax",Ot="SparseFillEmptyRows",Bt="SparseReshape",Ct="SparseSegmentMean",Vt="SparseSegmentSum",Rt="SparseToDense",zt="SquaredDifference",Pt="Square",Lt="StridedSlice",Wt="StringNGrams",Ht="StringSplit",qt="StringToHashBucketFast",Gt="Sub",Ut="Tan",jt="Tanh",Kt="Tile",Xt="TopK",Zt="Transform",Jt="Transpose",Qt="Unique",Yt="Unpack",en="UnsortedSegmentSum",tn="ZerosLike",nn="Step",rn="FromPixels",an="RotateWithOffset",sn="_FusedMatMul",on="FusedConv2D",un="FusedDepthwiseConv2D"},6151:(e,t,n)=>{"use strict";n.d(t,{pI:()=>u,uk:()=>l,tr:()=>c,wC:()=>p,Li:()=>d,nE:()=>h,bt:()=>m,T3:()=>f});var r=n(2885),a=n(5938),s=n(4706);const o=(0,a.R)("kernelRegistry",(()=>new Map)),i=(0,a.R)("gradRegistry",(()=>new Map));function u(e,t){const n=g(e,t);return o.get(n)}function l(e){return i.get(e)}function c(e){const t=o.entries(),n=[];for(;;){const{done:r,value:a}=t.next();if(r)break;const[s,o]=a,[i]=s.split("_");i===e&&n.push(o)}return n}function p(e){const{kernelName:t,backendName:n}=e,r=g(t,n);o.has(r)&&s.Z(`The kernel '${t}' for backend '${n}' is already registered`),o.set(r,e)}function d(e){const{kernelName:t}=e;i.has(t)&&(0,r.OB)().getBool("DEBUG")&&s.Z(`Overriding the gradient for '${t}'`),i.set(t,e)}function h(e,t){const n=g(e,t);if(!o.has(n))throw new Error(`The kernel '${e}' for backend '${t}' is not registered`);o.delete(n)}function m(e){if(!i.has(e))throw new Error(`The gradient '${e}' for backend is not registered`);i.delete(e)}function f(e,t){c(e).forEach((e=>{p(Object.assign({},e,{backendName:t}))}))}function g(e,t){return`${t}_${e}`}},4706:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a,c:()=>s});var r=n(2885);function a(...e){(0,r.OB)().getBool("IS_TEST")||(0,r.OB)().getBool("PROD")||console.warn(...e)}function s(...e){(0,r.OB)().getBool("IS_TEST")||(0,r.OB)().getBool("PROD")||console.log(...e)}},6235:(e,t,n)=>{"use strict";n.d(t,{W:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({abs_:function(e){const t=(0,s._1)(e,"x","abs");if("complex64"===t.dtype){const e={x:t};return r.BV.runKernel(a.yj,e)}{const e={x:t};return r.BV.runKernel(a.SY,e)}}})},7839:(e,t,n)=>{"use strict";n.d(t,{K:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({acos_:function(e){const t={x:(0,s._1)(e,"x","acos")};return r.BV.runKernel(a.VG,t)}})},1470:(e,t,n)=>{"use strict";n.d(t,{_:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({acosh_:function(e){const t={x:(0,s._1)(e,"x","acosh")};return r.BV.runKernel(a.Sp,t)}})},6407:(e,t,n)=>{"use strict";n.d(t,{I:()=>i});var r=n(7097),a=n(9121),s=n(747),o=n(3740);const i=(0,n(2668).op)({add_:function(e,t){let n=(0,o._1)(e,"a","add"),i=(0,o._1)(t,"b","add");[n,i]=(0,s.makeTypesMatch)(n,i);const u={a:n,b:i};return r.BV.runKernel(a.mm,u)}})},3135:(e,t,n)=>{"use strict";n.d(t,{Q:()=>i});var r=n(7097),a=n(9121),s=n(3740),o=n(569);const i=(0,n(2668).op)({addN_:function(e){o.hu(Array.isArray(e),(()=>"The argument passed to tf.addN() must be a list of tensors")),o.hu(e.length>=1,(()=>`Must pass at least one tensor to tf.addN(), but got ${e.length}`));const t=e.map(((e,t)=>(0,s._1)(e,`tensors${t}`,"addN"))),n=t[0];t.forEach((e=>{if(e.dtype!==n.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")})),t.forEach((e=>{if(!o.cO(e.shape,n.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")}));const i=t;return r.BV.runKernel(a.Xz,i)}})},781:(e,t,n)=>{"use strict";n.d(t,{$:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({all_:function(e,t=null,n=!1){const o={x:(0,s._1)(e,"x","all","bool")},i={axis:t,keepDims:n};return r.BV.runKernel(a.oT,o,i)}})},2998:(e,t,n)=>{"use strict";n.d(t,{Y:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({any_:function(e,t=null,n=!1){const o={x:(0,s._1)(e,"x","any","bool")},i={axis:t,keepDims:n};return r.BV.runKernel(a.IK,o,i)}})},47:(e,t,n)=>{"use strict";n.d(t,{N:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({argMax_:function(e,t=0){const n={x:(0,s._1)(e,"x","argMax")},o={axis:t};return r.BV.runKernel(a.sJ,n,o)}})},7394:(e,t,n)=>{"use strict";n.d(t,{v:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({argMin_:function(e,t=0){const n={x:(0,s._1)(e,"x","argMin")},o={axis:t};return r.BV.runKernel(a.aJ,n,o)}})},2421:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({asin_:function(e){const t={x:(0,s._1)(e,"x","asin")};return r.BV.runKernel(a.M2,t)}})},1891:(e,t,n)=>{"use strict";n.d(t,{V:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({asinh_:function(e){const t={x:(0,s._1)(e,"x","asinh")};return r.BV.runKernel(a.qw,t)}})},7037:(e,t,n)=>{"use strict";n.d(t,{z:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({atan_:function(e){const t={x:(0,s._1)(e,"x","atan")};return r.BV.runKernel(a.jM,t)}})},9812:(e,t,n)=>{"use strict";n.d(t,{f:()=>i});var r=n(7097),a=n(9121),s=n(747),o=n(3740);const i=(0,n(2668).op)({atan2_:function(e,t){let n=(0,o._1)(e,"a","atan2"),i=(0,o._1)(t,"b","atan2");[n,i]=(0,s.makeTypesMatch)(n,i);const u={a:n,b:i};return r.BV.runKernel(a.QC,u)}})},369:(e,t,n)=>{"use strict";n.d(t,{C:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({atanh_:function(e){const t={x:(0,s._1)(e,"x","atanh")};return r.BV.runKernel(a.Oy,t)}})},5176:(e,t,n)=>{"use strict";n.d(t,{w:()=>p});var r=n(7097),a=n(9121),s=n(3740),o=n(569),i=n(2271),u=n(2582),l=n(2668),c=n(4968);const p=(0,l.op)({avgPool_:function(e,t,n,l,p){const d=(0,s._1)(e,"x","avgPool","float32");o.hu(u.jT(n,1),(()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`));let h=d,m=!1;3===d.rank&&(m=!0,h=(0,c.X)(d,[1,d.shape[0],d.shape[1],d.shape[2]])),o.hu(4===h.rank,(()=>`Error in avgPool: x must be rank 4 but got rank ${h.rank}.`)),null!=p&&o.hu(o.GN(l),(()=>`Error in avgPool: pad must be an integer when using, dimRoundingMode ${p} but got pad ${l}.`));const f={x:h},g={filterSize:t,strides:n,pad:l,dimRoundingMode:p};let y=r.BV.runKernel(a.Jh,f,g);return y=(0,i.p)(y,d.dtype),m?(0,c.X)(y,[y.shape[1],y.shape[2],y.shape[3]]):y}})},1749:(e,t,n)=>{"use strict";n.d(t,{u:()=>c});var r=n(7097),a=n(9121),s=n(3740),o=n(569),i=n(2271),u=n(2668),l=n(4968);const c=(0,u.op)({avgPool3d_:function(e,t,n,u,c,p="NDHWC"){const d=(0,s._1)(e,"x","avgPool3d","float32");let h=d,m=!1;4===d.rank&&(m=!0,h=(0,l.X)(d,[1,d.shape[0],d.shape[1],d.shape[2],d.shape[3]])),o.hu(5===h.rank,(()=>`Error in avgPool3d: x must be rank 5 but got rank ${h.rank}.`)),o.hu("NDHWC"===p,(()=>`Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${p}`)),null!=c&&o.hu(o.GN(u),(()=>`Error in avgPool3d: pad must be an integer when using, dimRoundingMode ${c} but got pad ${u}.`));const f={x:h},g={filterSize:t,strides:n,pad:u,dimRoundingMode:c,dataFormat:p};let y=r.BV.runKernel(a._k,f,g);return y=(0,i.p)(y,h.dtype),m?(0,l.X)(y,[y.shape[1],y.shape[2],y.shape[3],y.shape[4]]):y}})},3591:(e,t,n)=>{"use strict";n.d(t,{YB:()=>a,Vh:()=>s,kz:()=>o,rv:()=>i,lB:()=>u,Q3:()=>l,LJ:()=>c,sY:()=>p});var r=n(569);function a(e,t){for(let n=0;ne[t]))]}function i(e,t){return s(e,t.map((e=>1)),t)}function u(e,t,n){r.hu(a(t,n),(()=>`${e} supports only inner-most axes for now. Got axes ${t} and rank-${n} input.`))}function l(e,t){if(a(e,t))return null;const n=[];for(let r=0;rn.push(e))),n}function c(e){return e.map(((e,t)=>[t,e])).sort(((e,t)=>e[1]-t[1])).map((e=>e[0]))}function p(e,t){const n=[];for(let r=t-e;r{"use strict";n.d(t,{E:()=>i});var r=n(7097),a=n(9121),s=n(3740),o=n(569);const i=(0,n(2668).op)({batchToSpaceND_:function(e,t,n){const i=(0,s._1)(e,"x","batchToSpaceND"),u=t.reduce(((e,t)=>e*t));o.hu(i.rank>=1+t.length,(()=>`input rank is ${i.rank} but should be > than blockShape.length ${t.length}`)),o.hu(n.length===t.length,(()=>`crops.length is ${n.length} but should be equal to blockShape.length ${t.length}`)),o.hu(i.shape[0]%u==0,(()=>`input tensor batch is ${i.shape[0]} but is not divisible by the product of the elements of blockShape ${t.join(" * ")} === ${u}`));const l={x:i},c={blockShape:t,crops:n};return r.BV.runKernel(a.zw,l,c)}})},7505:(e,t,n)=>{"use strict";n.d(t,{t:()=>u});var r=n(7097),a=n(9121),s=n(3740),o=n(569),i=n(4968);const u=(0,n(2668).op)({batchNorm_:function(e,t,n,u,l,c){null==c&&(c=.001);const p=(0,s._1)(e,"x","batchNorm"),d=(0,s._1)(t,"mean","batchNorm"),h=(0,s._1)(n,"variance","batchNorm");let m,f;null!=l&&(m=(0,s._1)(l,"scale","batchNorm")),null!=u&&(f=(0,s._1)(u,"offset","batchNorm")),o.hu(d.rank===h.rank,(()=>"Batch normalization gradient requires mean and variance to have equal ranks.")),o.hu(null==f||d.rank===f.rank,(()=>"Batch normalization gradient requires mean and offset to have equal ranks.")),o.hu(null==m||d.rank===m.rank,(()=>"Batch normalization gradient requires mean and scale to have equal ranks."));const g={x:function(e){let t;return t=0===e.rank||1===e.rank?(0,i.X)(e,[1,1,1,e.size]):2===e.rank?(0,i.X)(e,[1,1,e.shape[0],e.shape[1]]):3===e.rank?(0,i.X)(e,[1,e.shape[0],e.shape[1],e.shape[2]]):e,t}(p),scale:m,offset:f,mean:d,variance:h},y={varianceEpsilon:c},b=r.BV.runKernel(a.sH,g,y);return(0,i.X)(b,p.shape)}})},3865:(e,t,n)=>{"use strict";n.d(t,{y:()=>i});var r=n(7097),a=n(9121),s=n(3740),o=n(569);const i=(0,n(2668).op)({bincount_:function(e,t,n){const i=(0,s._1)(e,"x","bincount"),u=(0,s._1)(t,"weights","bincount");o.hu("int32"===i.dtype,(()=>`Error in bincount: input dtype must be int32, but got ${i.dtype}`)),o.hu(n>=0,(()=>`size must be non-negative, but got ${n}.`)),o.hu(u.size===i.size||0===u.size,(()=>`Error in bincount: weights must have the same size as input or0-length, but got input shape: ${i.shape}, weights shape: ${u.shape}.`));const l={x:i,weights:u},c={size:n};return r.BV.runKernel(a.zv,l,c)}})},8194:(e,t,n)=>{"use strict";n.d(t,{X:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({broadcastArgs_:function(e,t){const n=(0,s._1)(e,"s0","broadcastArgs","int32"),o=(0,s._1)(t,"s1","broadcastArgs","int32");if(1!==n.rank)throw new Error(`broadcastArgs(): first input must be a vector (rank=1). Has rank ${n.rank}`);if(1!==o.rank)throw new Error(`broadcastArgs(): second input must be a vector (rank=1). Has rank ${o.rank}`);const i={s0:n,s1:o};return r.BV.runKernel(a.eE,i)}})},8247:(e,t,n)=>{"use strict";n.d(t,{U:()=>l});var r=n(7097),a=n(9121),s=n(3740),o=n(8723),i=n(2668),u=n(4968);const l=(0,i.op)({broadcastTo_:function(e,t){let n=(0,s._1)(e,"broadcastTo","x");const i=n.shape;if(t.some((e=>!(e>0)||e%1!=0)))throw new Error(`broadcastTo(): Invalid broadcast shape [${t}].`);if(t.lengthn.rank){const e=n.shape.slice();for(;e.length=0;e--)if(l[e]===t[e])c[e]=1;else if(1!==n.shape[e])throw new Error(`broadcastTo(): [${i}] cannot be broadcast to [${t}].`);if(0===c.map(((e,t)=>e>1?t:-1)).filter((e=>e>=0)).length)return(0,o.d)(n);const p={x:n},d={reps:c};return r.BV.runKernel(a.n9,p,d)}})},2200:(e,t,n)=>{"use strict";function r(e,t){const n=e.length,r=[];for(let a=0;a1&&1===o&&r.unshift(s)}return r}function a(e,t){const n=[];for(let r=0;r1)&&n.unshift(s)}return n}function s(e,t){const n=[],r=Math.max(e.length,t.length);for(let a=0;ar,RR:()=>a,$N:()=>s})},2657:(e,t,n)=>{"use strict";n.d(t,{f:()=>s});var r=n(4077),a=n(569);function s(e,t="float32",n){return t=t||"float32",a.Mu(e),new r.YD(e,t,n)}},2271:(e,t,n)=>{"use strict";n.d(t,{p:()=>i});var r=n(7097),a=n(9121),s=n(3740),o=n(569);const i=(0,n(2668).op)({cast_:function(e,t){const n=(0,s._1)(e,"x","cast");if(!o.LP(t))throw new Error(`Failed to cast to unknown dtype ${t}`);if("string"===t&&"string"!==n.dtype||"string"!==t&&"string"===n.dtype)throw new Error("Only strings can be casted to strings");const i={x:n},u={dtype:t};return r.BV.runKernel(a.RF,i,u)}})},6825:(e,t,n)=>{"use strict";n.d(t,{m:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({ceil_:function(e){const t={x:(0,s._1)(e,"x","ceil")};return r.BV.runKernel(a.gJ,t)}})},2279:(e,t,n)=>{"use strict";n.d(t,{i:()=>i});var r=n(7097),a=n(9121),s=n(3740),o=n(569);const i=(0,n(2668).op)({clipByValue_:function(e,t,n){const i=(0,s._1)(e,"x","clipByValue");o.hu(t<=n,(()=>`Error in clip: min (${t}) must be less than or equal to max (${n}).`));const u={x:i},l={clipValueMin:t,clipValueMax:n};return r.BV.runKernel(a.xn,u,l)}})},8723:(e,t,n)=>{"use strict";n.d(t,{d:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({clone_:function(e){const t={x:(0,s._1)(e,"x","clone","string_or_numeric")};return r.BV.runKernel(a.iJ,t)}})},1661:(e,t,n)=>{"use strict";n.d(t,{P:()=>i});var r=n(7097),a=n(9121),s=n(3740),o=n(569);const i=(0,n(2668).op)({complex_:function(e,t){const n=(0,s._1)(e,"real","complex"),i=(0,s._1)(t,"imag","complex");o.k5(n.shape,i.shape,`real and imag shapes, ${n.shape} and ${i.shape}, must match in call to tf.complex().`);const u={real:n,imag:i};return r.BV.runKernel(a.Zz,u)}})},6884:(e,t,n)=>{"use strict";n.d(t,{z:()=>u});var r=n(7097),a=n(9121),s=n(3740),o=n(569),i=n(8723);const u=(0,n(2668).op)({concat_:function(e,t=0){(0,o.hu)(e.length>=1,(()=>"Pass at least one tensor to concat"));const n=(0,s.sI)(e,"tensors","concat","string_or_numeric");if("complex64"===n[0].dtype&&n.forEach((e=>{if("complex64"!==e.dtype)throw new Error(`Cannot concatenate complex64 tensors with a tensor\n with dtype ${e.dtype}. `)})),1===n.length)return(0,i.d)(n[0]);const u=n,l={axis:t};return r.BV.runKernel(a.Eh,u,l)}})},1355:(e,t,n)=>{"use strict";n.d(t,{P:()=>l});var r=n(3740),a=n(569),s=n(4794),o=n(2582),i=n(2668),u=n(4968);const l=(0,i.op)({conv1d_:function(e,t,n,i,l="NWC",c=1,p){const d=(0,r._1)(e,"x","conv1d"),h=(0,r._1)(t,"filter","conv1d");let m=d,f=!1;2===d.rank&&(f=!0,m=(0,u.X)(d,[1,d.shape[0],d.shape[1]])),a.hu(3===m.rank,(()=>`Error in conv1d: input must be rank 3, but got rank ${m.rank}.`)),a.hu(3===h.rank,(()=>`Error in conv1d: filter must be rank 3, but got rank ${h.rank}.`)),null!=p&&a.hu(a.GN(i),(()=>`Error in conv1d: pad must be an integer when using, dimRoundingMode ${p} but got pad ${i}.`)),a.hu(m.shape[2]===h.shape[1],(()=>`Error in conv1d: depth of input (${m.shape[2]}) must match input depth for filter ${h.shape[1]}.`)),a.hu(o.jT(n,c),(()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${n} and dilation '${c}'`)),a.hu("NWC"===l,(()=>`Error in conv1d: got dataFormat of ${l} but only NWC is currently supported.`));const g=(0,u.X)(h,[1,h.shape[0],h.shape[1],h.shape[2]]),y=(0,u.X)(m,[m.shape[0],1,m.shape[1],m.shape[2]]),b=[1,n],k=[1,c],w=(0,s.T)(y,g,b,i,"NHWC",k,p);return f?(0,u.X)(w,[w.shape[2],w.shape[3]]):(0,u.X)(w,[w.shape[0],w.shape[2],w.shape[3]])}})},4794:(e,t,n)=>{"use strict";n.d(t,{T:()=>c});var r=n(7097),a=n(9121),s=n(3740),o=n(569),i=n(2582),u=n(2668),l=n(4968);const c=(0,u.op)({conv2d_:function(e,t,n,u,c="NHWC",p=[1,1],d){const h=(0,s._1)(e,"x","conv2d"),m=(0,s._1)(t,"filter","conv2d");let f=h,g=!1;3===h.rank&&(g=!0,f=(0,l.X)(h,[1,h.shape[0],h.shape[1],h.shape[2]])),o.hu(4===f.rank,(()=>`Error in conv2d: input must be rank 4, but got rank ${f.rank}.`)),o.hu(4===m.rank,(()=>`Error in conv2d: filter must be rank 4, but got rank ${m.rank}.`)),null!=d&&o.hu(o.GN(u),(()=>`Error in conv2d: pad must be an integer when using, dimRoundingMode ${d} but got pad ${u}.`));const y="NHWC"===c?f.shape[3]:f.shape[1];o.hu(y===m.shape[2],(()=>`Error in conv2d: depth of input (${y}) must match input depth for filter ${m.shape[2]}.`)),o.hu(i.jT(n,p),(()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${p}'`));const b={x:f,filter:m},k={strides:n,pad:u,dataFormat:c,dilations:p,dimRoundingMode:d},w=r.BV.runKernel(a.mh,b,k);return g?(0,l.X)(w,[w.shape[1],w.shape[2],w.shape[3]]):w}})},9832:(e,t,n)=>{"use strict";n.d(t,{_:()=>u});var r=n(7097),a=n(9121),s=n(569),o=n(2668),i=n(4968);const u=(0,o.op)({conv2DBackpropInput_:function(e,t,n,o,u,l="NHWC",c){s.hu(e.length===t.rank,(()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`));let p=e,d=t,h=!1;3===t.rank&&(h=!0,d=(0,i.X)(t,[1,t.shape[0],t.shape[1],t.shape[2]]),p=[1,e[0],e[1],e[2]]),s.hu(4===p.length,(()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${p.length}.`)),s.hu(4===d.rank,(()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${d.rank}`)),s.hu(4===n.rank,(()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${n.rank}`));const m="NHWC"===l?p[3]:p[1],f="NHWC"===l?d.shape[3]:d.shape[1];s.hu(m===n.shape[2],(()=>`Error in conv2dDerInput: depth of input (${m}) must match input depth for filter ${n.shape[2]}.`)),s.hu(f===n.shape[3],(()=>`Error in conv2dDerInput: depth of output (${f}) must match output depth for filter ${n.shape[3]}.`)),null!=c&&s.hu(s.GN(u),(()=>`Error in conv2dDerInput: pad must be an integer when using, dimRoundingMode ${c} but got pad ${u}.`));const g={dy:d,filter:n},y={strides:o,pad:u,dataFormat:l,dimRoundingMode:c,inputShape:p},b=r.BV.runKernel(a.wm,g,y);return h?(0,i.X)(b,[b.shape[1],b.shape[2],b.shape[3]]):b}})},1405:(e,t,n)=>{"use strict";n.d(t,{b:()=>s});var r=n(3740),a=n(9832);const s=(0,n(2668).op)({conv2dTranspose_:function(e,t,n,s,o,i){const u=(0,r._1)(e,"x","conv2dTranspose"),l=(0,r._1)(t,"filter","conv2dTranspose");return(0,a._)(n,u,l,s,o,"NHWC",i)}})},473:(e,t,n)=>{"use strict";n.d(t,{p:()=>c});var r=n(7097),a=n(9121),s=n(3740),o=n(569),i=n(2582),u=n(2668),l=n(4968);const c=(0,u.op)({conv3d_:function(e,t,n,u,c="NDHWC",p=[1,1,1]){const d=(0,s._1)(e,"x","conv3d"),h=(0,s._1)(t,"filter","conv3d");let m=d,f=!1;4===d.rank&&(f=!0,m=(0,l.X)(d,[1,d.shape[0],d.shape[1],d.shape[2],d.shape[3]])),o.hu(5===m.rank,(()=>`Error in conv3d: input must be rank 5, but got rank ${m.rank}.`)),o.hu(5===h.rank,(()=>`Error in conv3d: filter must be rank 5, but got rank ${h.rank}.`)),o.hu(m.shape[4]===h.shape[3],(()=>`Error in conv3d: depth of input (${m.shape[4]}) must match input depth for filter ${h.shape[3]}.`)),o.hu((0,i.jT)(n,p),(()=>`Error in conv3D: Either strides or dilations must be 1. Got strides ${n} and dilations '${p}'`)),o.hu("NDHWC"===c,(()=>`Error in conv3d: got dataFormat of ${c} but only NDHWC is currently supported.`));const g={x:m,filter:h},y={strides:n,pad:u,dataFormat:c,dilations:p},b=r.BV.runKernel(a.x1,g,y);return f?(0,l.X)(b,[b.shape[1],b.shape[2],b.shape[3],b.shape[4]]):b}})},2582:(e,t,n)=>{"use strict";function r(e,t,n,r,a="NHWC",s){return o(e,[...t,e[3]],n,s,r,null,null,f(a))}function a(e,t,n,r,a,s,i="channelsLast"){const[u,c]=l(t);let p;if("channelsLast"===i)p=[u,c,e[3],e[3]];else{if("channelsFirst"!==i)throw new Error(`Unknown dataFormat ${i}`);p=[u,c,e[1],e[1]]}return o(e,p,n,r,a,s,!1,i)}function s(e,t,n,r,a,s,o="NDHWC"){const[u,l,p]=c(t);let d,h;if("NDHWC"===o)h="channelsLast",d=[u,l,p,e[4],e[4]];else{if("NCDHW"!==o)throw new Error(`Unknown dataFormat ${o}`);h="channelsFirst",d=[u,l,p,e[1],e[1]]}return i(e,d,n,r,a,!1,h,s)}function o(e,t,n,r,a,s,o=!1,i="channelsLast"){let[c,h,m,f]=[-1,-1,-1,-1];if("channelsLast"===i)[c,h,m,f]=e;else{if("channelsFirst"!==i)throw new Error(`Unknown dataFormat ${i}`);[c,f,h,m]=e}const[g,y,,b]=t,[k,w]=l(n),[v,x]=l(r),N=p(g,v),S=p(y,x),{padInfo:I,outHeight:T,outWidth:_}=function(e,t,n,r,a,s,o,i,l){let c,p,h;if("number"==typeof e){c={top:e,bottom:e,left:e,right:e,type:0===e?"VALID":"NUMBER"};const a=function(e,t,n,r,a){null==r&&(r=u(e,t,n));const s=e[0],o=e[1],i=d((s-t+2*r)/n+1,a),l=d((o-t+2*r)/n+1,a);return[i,l]}([t,n],s,r,e,i);p=a[0],h=a[1]}else if("same"===e){p=Math.ceil(t/r),h=Math.ceil(n/a);const e=Math.max(0,(p-1)*r+s-t),i=Math.max(0,(h-1)*a+o-n),u=Math.floor(e/2),l=e-u,d=Math.floor(i/2);c={top:u,bottom:l,left:d,right:i-d,type:"SAME"}}else if("valid"===e)c={top:0,bottom:0,left:0,right:0,type:"VALID"},p=Math.ceil((t-s+1)/r),h=Math.ceil((n-o+1)/a);else{if("object"!=typeof e)throw Error(`Unknown padding parameter: ${e}`);{const u="channelsLast"===l?e[1][0]:e[2][0],m="channelsLast"===l?e[1][1]:e[2][1],f="channelsLast"===l?e[2][0]:e[3][0],g="channelsLast"===l?e[2][1]:e[3][1];c={top:u,bottom:m,left:f,right:g,type:0===u&&0===m&&0===f&&0===g?"VALID":"EXPLICIT"},p=d((t-s+u+m)/r+1,i),h=d((n-o+f+g)/a+1,i)}}return{padInfo:c,outHeight:p,outWidth:h}}(a,h,m,k,w,N,S,s,i),E=o?b*f:b;let A;return"channelsFirst"===i?A=[c,E,T,_]:"channelsLast"===i&&(A=[c,T,_,E]),{batchSize:c,dataFormat:i,inHeight:h,inWidth:m,inChannels:f,outHeight:T,outWidth:_,outChannels:E,padInfo:I,strideHeight:k,strideWidth:w,filterHeight:g,filterWidth:y,effectiveFilterHeight:N,effectiveFilterWidth:S,dilationHeight:v,dilationWidth:x,inShape:e,outShape:A,filterShape:t}}function i(e,t,n,r,a,s=!1,o="channelsLast",i){let[l,h,m,f,g]=[-1,-1,-1,-1,-1];if("channelsLast"===o)[l,h,m,f,g]=e;else{if("channelsFirst"!==o)throw new Error(`Unknown dataFormat ${o}`);[l,g,h,m,f]=e}const[y,b,k,,w]=t,[v,x,N]=c(n),[S,I,T]=c(r),_=p(y,S),E=p(b,I),A=p(k,T),{padInfo:M,outDepth:$,outHeight:D,outWidth:F}=function(e,t,n,r,a,s,o,i,l,c,p){let h,m,f,g;if("number"==typeof e){h={top:e,bottom:e,left:e,right:e,front:e,back:e,type:0===e?"VALID":"NUMBER"};const s=function(e,t,n,r,a,s){null==a&&(a=u(e,t,r));const o=e[0],i=e[1],l=e[2],c=d((o-t+2*a)/r+1,s),p=d((i-t+2*a)/r+1,s),h=d((l-t+2*a)/r+1,s);return[c,p,h,n]}([t,n,r,1],i,1,a,e,p);m=s[0],f=s[1],g=s[2]}else if("same"===e){m=Math.ceil(t/a),f=Math.ceil(n/s),g=Math.ceil(r/o);const e=(m-1)*a+i-t,u=(f-1)*s+l-n,p=(g-1)*o+c-r,d=Math.floor(e/2),y=e-d,b=Math.floor(u/2),k=u-b,w=Math.floor(p/2);h={top:b,bottom:k,left:w,right:p-w,front:d,back:y,type:"SAME"}}else{if("valid"!==e)throw Error(`Unknown padding parameter: ${e}`);h={top:0,bottom:0,left:0,right:0,front:0,back:0,type:"VALID"},m=Math.ceil((t-i+1)/a),f=Math.ceil((n-l+1)/s),g=Math.ceil((r-c+1)/o)}return{padInfo:h,outDepth:m,outHeight:f,outWidth:g}}(a,h,m,f,v,x,N,_,E,A,i),O=s?w*g:w;let B;return"channelsFirst"===o?B=[l,O,$,D,F]:"channelsLast"===o&&(B=[l,$,D,F,O]),{batchSize:l,dataFormat:o,inDepth:h,inHeight:m,inWidth:f,inChannels:g,outDepth:$,outHeight:D,outWidth:F,outChannels:O,padInfo:M,strideDepth:v,strideHeight:x,strideWidth:N,filterDepth:y,filterHeight:b,filterWidth:k,effectiveFilterDepth:_,effectiveFilterHeight:E,effectiveFilterWidth:A,dilationDepth:S,dilationHeight:I,dilationWidth:T,inShape:e,outShape:B,filterShape:t}}function u(e,t,n,r=1){const a=p(t,r);return Math.floor((e[0]*(n-1)-n+a)/2)}function l(e){return"number"==typeof e?[e,e,e]:2===e.length?[e[0],e[1],1]:e}function c(e){return"number"==typeof e?[e,e,e]:e}function p(e,t){return t<=1?e:e+(e-1)*(t-1)}function d(e,t){if(!t)return Math.trunc(e);switch(t){case"round":return Math.round(e);case"ceil":return Math.ceil(e);case"floor":return Math.floor(e);default:throw new Error(`Unknown roundingMode ${t}`)}}function h(e){const[t,n,r]=l(e);return 1===t&&1===n&&1===r}function m(e,t){return h(e)||h(t)}function f(e){if("NHWC"===e)return"channelsLast";if("NCHW"===e)return"channelsFirst";throw new Error(`Unknown dataFormat ${e}`)}n.d(t,{Rf:()=>r,Xw:()=>a,pl:()=>s,Ix:()=>o,jw:()=>i,aO:()=>u,I0:()=>h,jT:()=>m,sl:()=>f})},173:(e,t,n)=>{"use strict";n.d(t,{m:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({cos_:function(e){const t={x:(0,s._1)(e,"x","cos")};return r.BV.runKernel(a.mc,t)}})},2699:(e,t,n)=>{"use strict";n.d(t,{f:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({cosh_:function(e){const t={x:(0,s._1)(e,"x","cosh")};return r.BV.runKernel(a.TR,t)}})},7405:(e,t,n)=>{"use strict";n.d(t,{z:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({cumsum_:function(e,t=0,n=!1,o=!1){const i={x:(0,s._1)(e,"x","cumsum")},u={axis:t,exclusive:n,reverse:o};return r.BV.runKernel(a.iH,i,u)}})},5746:(e,t,n)=>{"use strict";n.d(t,{p:()=>i});var r=n(7097),a=n(9121),s=n(3740),o=n(569);const i=(0,n(2668).op)({denseBincount_:function(e,t,n,i=!1){const u=(0,s._1)(e,"x","denseBincount"),l=(0,s._1)(t,"weights","denseBincount");o.hu("int32"===u.dtype,(()=>`Error in denseBincount: input dtype must be int32, but got ${u.dtype}`)),o.hu(u.rank<=2,(()=>`Error in denseBincount: input must be at most rank 2, but got rank ${u.rank}.`)),o.hu(n>=0,(()=>`size must be non-negative, but got ${n}.`)),o.hu(l.size===u.size||0===l.size,(()=>`Error in denseBincount: weights must have the same shape as x or 0-length, but got x shape: ${u.shape}, weights shape: ${l.shape}.`));const c={x:u,weights:l},p={size:n,binaryOutput:i};return r.BV.runKernel(a.QR,c,p)}})},9112:(e,t,n)=>{"use strict";n.d(t,{n:()=>i});var r=n(7097),a=n(9121),s=n(3740),o=n(569);const i=(0,n(2668).op)({depthToSpace_:function(e,t,n="NHWC"){const i=(0,s._1)(e,"x","depthToSpace"),u="NHWC"===n?i.shape[1]:i.shape[2],l="NHWC"===n?i.shape[2]:i.shape[3],c="NHWC"===n?i.shape[3]:i.shape[1];o.hu(u*t>=0,(()=>`Negative dimension size caused by overflow when multiplying\n ${u} and ${t} for depthToSpace with input shape\n ${i.shape}`)),o.hu(l*t>=0,(()=>`Negative dimension size caused by overflow when multiplying\n ${l} and ${t} for depthToSpace with input shape\n ${i.shape}`)),o.hu(c%(t*t)==0,(()=>`Dimension size must be evenly divisible by ${t*t} but is ${c} for depthToSpace with input shape ${i.shape}`));const p={x:i},d={blockSize:t,dataFormat:n};return r.BV.runKernel(a.T0,p,d)}})},4718:(e,t,n)=>{"use strict";n.d(t,{B:()=>l});var r=n(7097),a=n(9121),s=n(3740),o=n(569),i=n(2668),u=n(4968);const l=(0,i.op)({depthwiseConv2d_:function(e,t,n,i,l="NHWC",c=[1,1],p){const d=(0,s._1)(e,"x","depthwiseConv2d"),h=(0,s._1)(t,"filter","depthwiseConv2d");let m=d,f=!1;3===d.rank&&(f=!0,m=(0,u.X)(d,[1,d.shape[0],d.shape[1],d.shape[2]])),o.hu(4===m.rank,(()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${m.rank}.`)),o.hu(4===h.rank,(()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${h.rank}.`)),o.hu(m.shape[3]===h.shape[2],(()=>`Error in depthwiseConv2d: number of input channels (${m.shape[3]}) must match the inChannels dimension in filter ${h.shape[2]}.`)),null!=p&&o.hu(o.GN(i),(()=>`Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode ${p} but got pad ${i}.`));const g={x:m,filter:h},y={strides:n,pad:i,dataFormat:l,dilations:c,dimRoundingMode:p},b=r.BV.runKernel(a.ci,g,y);return f?(0,u.X)(b,[b.shape[1],b.shape[2],b.shape[3]]):b}})},557:(e,t,n)=>{"use strict";n.d(t,{W:()=>l});var r=n(7097),a=n(9121),s=n(3740),o=n(569),i=n(2668),u=n(4968);const l=(0,i.op)({dilation2d_:function(e,t,n,i,l=[1,1],c="NHWC"){const p=(0,s._1)(e,"x","dilation2d"),d=(0,s._1)(t,"filter","dilation2d");o.hu(3===p.rank||4===p.rank,(()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${p.rank}.`)),o.hu(3===d.rank,(()=>`Error in dilation2d: filter must be rank 3, but got rank ${d.rank}.`)),o.hu("NHWC"===c,(()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${c}`));let h=p,m=!1;3===p.rank&&(h=(0,u.X)(p,[1,p.shape[0],p.shape[1],p.shape[2]]),m=!0);const f={x:h,filter:d},g={strides:n,pad:i,dilations:l},y=r.BV.runKernel(a.p4,f,g);return m?(0,u.X)(y,[y.shape[1],y.shape[2],y.shape[3]]):y}})},1274:(e,t,n)=>{"use strict";n.d(t,{h:()=>u});var r=n(7097),a=n(9121),s=n(747),o=n(3740),i=n(9165);const u=(0,n(2668).op)({div_:function(e,t){let n=(0,o._1)(e,"a","div"),u=(0,o._1)(t,"b","div");if([n,u]=(0,s.makeTypesMatch)(n,u),"int32"===n.dtype&&"int32"===u.dtype)return(0,i.q)(n,u);const l={a:n,b:u};return r.BV.runKernel(a.oH,l,{})}})},9322:(e,t,n)=>{"use strict";n.d(t,{N:()=>c});var r=n(747),a=n(3740),s=n(1274),o=n(6477),i=n(2668),u=n(5912),l=n(6577);const c=(0,i.op)({divNoNan_:function(e,t){let n=(0,a._1)(e,"a","div"),i=(0,a._1)(t,"b","div");[n,i]=(0,r.makeTypesMatch)(n,i);const c=(0,s.h)(n,i),p=(0,l.P)(c),d=(0,o.D)(i,p);return(0,u.a)(d,p,c)}})},4653:(e,t,n)=>{"use strict";n.d(t,{W:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({einsum_:function(e,...t){const n=t.map(((e,t)=>(0,s._1)(e,`tensors${t}`,"einsum"))),o={equation:e};return r.BV.runKernel(a.$g,n,o)}})},3233:(e,t,n)=>{"use strict";n.d(t,{p:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({elu_:function(e){const t={x:(0,s._1)(e,"x","elu")};return r.BV.runKernel(a.SX,t)}})},6477:(e,t,n)=>{"use strict";n.d(t,{D:()=>u});var r=n(7097),a=n(9121),s=n(747),o=n(3740),i=n(2200);const u=(0,n(2668).op)({equal_:function(e,t){let n=(0,o._1)(e,"a","equal","string_or_numeric"),u=(0,o._1)(t,"b","equal","string_or_numeric");[n,u]=(0,s.makeTypesMatch)(n,u),(0,i.$N)(n.shape,u.shape);const l={a:n,b:u};return r.BV.runKernel(a.hd,l)}})},4650:(e,t,n)=>{"use strict";n.d(t,{q:()=>u});var r=n(7097),a=n(9121),s=n(3740),o=n(569),i=n(2271);const u=(0,n(2668).op)({erf_:function(e){let t=(0,s._1)(e,"x","erf");o.hu("int32"===t.dtype||"float32"===t.dtype,(()=>"Input dtype must be `int32` or `float32`.")),"int32"===t.dtype&&(t=(0,i.p)(t,"float32"));const n={x:t};return r.BV.runKernel(a.Om,n)}})},4842:(e,t,n)=>{"use strict";n.d(t,{Q:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({exp_:function(e){const t={x:(0,s._1)(e,"x","exp")};return r.BV.runKernel(a.NE,t)}})},1300:(e,t,n)=>{"use strict";n.d(t,{d:()=>i});var r=n(7097),a=n(9121),s=n(3740),o=n(569);const i=(0,n(2668).op)({expandDims_:function(e,t=0){const n=(0,s._1)(e,"x","expandDims","string_or_numeric");o.hu(t<=n.rank,(()=>"Axis must be <= rank of the tensor"));const i={input:n},u={dim:t};return r.BV.runKernel(a.YF,i,u)}})},3426:(e,t,n)=>{"use strict";n.d(t,{t:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({expm1_:function(e){const t={x:(0,s._1)(e,"x","expm1")};return r.BV.runKernel(a.Y0,t)}})},4006:(e,t,n)=>{"use strict";n.d(t,{h:()=>s});var r=n(7097),a=n(9121);function s(e,t,n){const s={shape:e,value:t,dtype:n};return r.BV.runKernel(a.de,{},s)}},6943:(e,t,n)=>{"use strict";n.d(t,{G:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({floor_:function(e){const t={x:(0,s._1)(e,"x","floor")};return r.BV.runKernel(a.OR,t)}})},9165:(e,t,n)=>{"use strict";n.d(t,{q:()=>i});var r=n(7097),a=n(9121),s=n(747),o=n(3740);const i=(0,n(2668).op)({floorDiv_:function(e,t){let n=(0,o._1)(e,"a","floorDiv"),i=(0,o._1)(t,"b","floorDiv");[n,i]=(0,s.makeTypesMatch)(n,i);const u={a:n,b:i};return r.BV.runKernel(a.je,u)}})},2277:(e,t,n)=>{"use strict";n.r(t),n.d(t,{conv2d:()=>b,depthwiseConv2d:()=>x,matMul:()=>S});var r=n(7097),a=n(633),s=n(9121),o=n(747),i=n(3740),u=n(569),l=n(6407),c=n(2200),p=n(4794),d=n(2668),h=n(4968);const m=(0,d.op)({conv2DBackpropFilter_:function(e,t,n,a,o,i="NHWC",l){let c=e;3===e.rank&&(c=(0,h.X)(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let p=t;3===p.rank&&(p=(0,h.X)(t,[1,t.shape[0],t.shape[1],t.shape[2]])),u.hu(4===c.rank,(()=>`Error in conv2dDerFilter: input must be rank 4, but got shape ${c.shape}.`)),u.hu(4===p.rank,(()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${p.shape}.`)),u.hu(4===n.length,(()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${n}.`));const d="NHWC"===i?c.shape[3]:c.shape[1],m="NHWC"===i?p.shape[3]:p.shape[1];u.hu(d===n[2],(()=>`Error in conv2dDerFilter: depth of input ${d}) must match input depth in filter (${n[2]}.`)),u.hu(m===n[3],(()=>`Error in conv2dDerFilter: depth of dy (${m}) must match output depth for filter (${n[3]}).`)),null!=l&&u.hu(u.GN(o),(()=>`Error in conv2dDerFilter: pad must be an integer when using, dimRoundingMode ${l} but got pad ${o}.`));const f={x:c,dy:p},g={strides:a,pad:o,dataFormat:i,dimRoundingMode:l,filterShape:n};return r.BV.runKernel(s.wU,f,g)}});var f=n(9832),g=n(2582),y=n(9323);const b=(0,d.op)({fusedConv2d_:function({x:e,filter:t,strides:n,pad:d,dataFormat:b="NHWC",dilations:k=[1,1],dimRoundingMode:w,bias:v,activation:x="linear",preluActivationWeights:N,leakyreluAlpha:S}){if(x=x||"linear",!1===(0,y.uy)(r.BV.state.gradientDepth,x)){let r=(0,p.T)(e,t,n,d,b,k,w);return null!=v&&(r=(0,l.I)(r,v)),(0,y.QH)(r,x,N,S)}const I=(0,i._1)(e,"x","conv2d"),T=(0,i._1)(t,"filter","conv2d");let _=I,E=!1;3===I.rank&&(E=!0,_=(0,h.X)(I,[1,I.shape[0],I.shape[1],I.shape[2]])),u.hu(4===_.rank,(()=>`Error in fused conv2d: input must be rank 4, but got rank ${_.rank}.`)),u.hu(4===T.rank,(()=>`Error in fused conv2d: filter must be rank 4, but got rank ${T.rank}.`)),null!=w&&u.hu(u.GN(d),(()=>`Error in fused conv2d: pad must be an integer when using, dimRoundingMode ${w} but got pad ${d}.`)),u.hu(_.shape[3]===T.shape[2],(()=>`Error in conv2d: depth of input (${_.shape[3]}) must match input depth for filter ${T.shape[2]}.`)),u.hu(g.jT(n,k),(()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${k}'`)),u.hu("NHWC"===b,(()=>`Error in conv2d: got dataFormat of ${b} but only NHWC is currently supported.`));const A=g.Ix(_.shape,T.shape,n,k,d,w);let M,$;null!=v&&(M=(0,i._1)(v,"bias","fused conv2d"),[M]=(0,o.makeTypesMatch)(M,I),c.$N(A.outShape,M.shape)),null!=N&&($=(0,i._1)(N,"prelu weights","fused conv2d"));const D=(e,t)=>{const[r,a,s,o]=t,i=(0,y.Fr)(e,s,x);u.hu(g.I0(k),(()=>`Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${k}'`));const l=[(0,f._)(a.shape,i,r,n,d),m(a,i,r.shape,n,d)];if(null!=o){const e=(0,y.pf)(o,i);l.push(e)}return l},F={x:_,filter:T,bias:M,preluActivationWeights:$},O={strides:n,pad:d,dataFormat:b,dilations:k,dimRoundingMode:w,activation:x,leakyreluAlpha:S};if(null==v){return(0,a.cb)(((e,t,n)=>{let a=r.BV.runKernel(s._V,F,O);return n([t,e,a]),E&&(a=(0,h.X)(a,[a.shape[1],a.shape[2],a.shape[3]])),{value:a,gradFunc:D}}))(_,T)}return(0,a.cb)(((e,t,n,a)=>{let o=r.BV.runKernel(s._V,F,O);return a([t,e,o,n]),E&&(o=(0,h.X)(o,[o.shape[1],o.shape[2],o.shape[3]])),{value:o,gradFunc:D}}))(_,T,M)}});var k=n(4718);const w=(0,d.op)({depthwiseConv2dNativeBackpropFilter_:function(e,t,n,a,o,i=[1,1],u){let l=e;3===e.rank&&(l=(0,h.X)(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let c=t;3===c.rank&&(c=(0,h.X)(t,[1,t.shape[0],t.shape[1],t.shape[2]]));const p={x:l,dy:c},d={strides:a,pad:o,dimRoundingMode:u,dilations:i,filterShape:n};return r.BV.runKernel(s.sL,p,d)}});const v=(0,d.op)({depthwiseConv2dNativeBackpropInput_:function(e,t,n,a,o,i=[1,1],u){let l=t,c=!1;3===t.rank&&(c=!0,l=(0,h.X)(t,[1,t.shape[0],t.shape[1],t.shape[2]]));const p={dy:l,filter:n},d={strides:a,pad:o,dimRoundingMode:u,dilations:i,inputShape:e},m=r.BV.runKernel(s.y7,p,d);return c?(0,h.X)(m,[m.shape[1],m.shape[2],m.shape[3]]):m}});const x=(0,d.op)({fusedDepthwiseConv2d_:function({x:e,filter:t,strides:n,pad:p,dataFormat:d="NHWC",dilations:m=[1,1],dimRoundingMode:f,bias:b,activation:x="linear",preluActivationWeights:N,leakyreluAlpha:S}){if(!1===(0,y.uy)(r.BV.state.gradientDepth,x)){let r=(0,k.B)(e,t,n,p,d,m,f);return null!=b&&(r=(0,l.I)(r,b)),(0,y.QH)(r,x,N,S)}const I=(0,i._1)(e,"x","depthwiseConv2d"),T=(0,i._1)(t,"filter","depthwiseConv2d");let _=I,E=!1;3===I.rank&&(E=!0,_=(0,h.X)(I,[1,I.shape[0],I.shape[1],I.shape[2]])),u.hu(4===_.rank,(()=>`Error in fused depthwiseConv2d: input must be rank 4, but got rank ${_.rank}.`)),u.hu(4===T.rank,(()=>`Error in fused depthwiseConv2d: filter must be rank 4, but got rank ${T.rank}.`)),u.hu(_.shape[3]===T.shape[2],(()=>`Error in fused depthwiseConv2d: number of input channels (${_.shape[3]}) must match the inChannels dimension in filter ${T.shape[2]}.`)),null==m&&(m=[1,1]),u.hu(g.jT(n,m),(()=>`Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${n} and dilations '${m}'`)),null!=f&&u.hu(u.GN(p),(()=>`Error in fused depthwiseConv2d: pad must be an integer when using dimRoundingMode ${f} but got pad ${p}.`));const A=g.Ix(_.shape,T.shape,n,m,p,f,!0);let M,$;null!=b&&(M=(0,i._1)(b,"bias","fused conv2d"),[M]=(0,o.makeTypesMatch)(M,I),c.$N(A.outShape,M.shape)),null!=N&&($=(0,i._1)(N,"prelu weights","fused depthwiseConv2d"));const D=(e,t)=>{u.hu(g.I0(m),(()=>`Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${m}'`));const[r,a,s,o]=t,i=(0,y.Fr)(e,s,x),l=v(a.shape,i,r,n,p,m,f),c=w(a,i,r.shape,n,p,m,f);if(null!=o){return[l,c,(0,y.pf)(M,i)]}return[l,c]},F={x:_,filter:T,bias:M,preluActivationWeights:$},O={strides:n,pad:p,dataFormat:d,dilations:m,dimRoundingMode:f,activation:x,leakyreluAlpha:S};if(null==b){return(0,a.cb)(((e,t,n)=>{let a=r.BV.runKernel(s.lu,F,O);return n([t,e,a]),E&&(a=(0,h.X)(a,[a.shape[1],a.shape[2],a.shape[3]])),{value:a,gradFunc:D}}))(_,T)}return(0,a.cb)(((e,t,n,a)=>{let o=r.BV.runKernel(s.lu,F,O);return a([t,e,o,n]),E&&(o=(0,h.X)(o,[o.shape[1],o.shape[2],o.shape[3]])),{value:o,gradFunc:D}}))(_,T,M)}});var N=n(8687);const S=(0,d.op)({fusedMatMul_:function({a:e,b:t,transposeA:n=!1,transposeB:p=!1,bias:d,activation:m="linear",preluActivationWeights:f,leakyreluAlpha:g}){if(!1===(0,y.uy)(r.BV.state.gradientDepth,m)){let r=(0,N.O)(e,t,n,p);return null!=d&&(r=(0,l.I)(r,d)),(0,y.QH)(r,m,f,g)}let b=(0,i._1)(e,"a","fused matMul"),k=(0,i._1)(t,"b","fused matMul");[b,k]=(0,o.makeTypesMatch)(b,k);const w=n?b.shape[b.rank-2]:b.shape[b.rank-1],v=p?k.shape[k.rank-1]:k.shape[k.rank-2],x=n?b.shape[b.rank-1]:b.shape[b.rank-2],S=p?k.shape[k.rank-2]:k.shape[k.rank-1],I=b.shape.slice(0,-2),T=k.shape.slice(0,-2),_=u.NA(I),E=u.NA(T);u.hu(b.rank>=2&&k.rank>=2&&b.rank===k.rank,(()=>`Error in fused matMul: inputs must have the same rank of at least 2, got ranks ${b.rank} and ${k.rank}.`)),u.hu(u.cO(I,T),(()=>`Error in fused matMul: outer dimensions (${I}) and (${T}) of Tensors with shapes ${b.shape} and ${k.shape} must match.`)),u.hu(w===v,(()=>`Error in fused matMul: inner shapes (${w}) and (${v}) of Tensors with shapes ${b.shape} and ${k.shape} and transposeA=${n} and transposeB=${p} must match.`));const A=b.shape.slice(0,-2).concat([x,S]),M=n?(0,h.X)(b,[_,w,x]):(0,h.X)(b,[_,x,w]),$=p?(0,h.X)(k,[E,S,v]):(0,h.X)(k,[E,v,S]);let D,F;null!=d&&(D=(0,i._1)(d,"bias","fused matMul"),[D]=(0,o.makeTypesMatch)(D,b),c.$N(A,D.shape)),null!=f&&(F=(0,i._1)(f,"prelu weights","fused matMul"));const O=(e,t)=>{const[r,a,s,o]=t,i=(0,y.Fr)((0,h.X)(e,s.shape),s,m);let u,l;if(n||p?!n&&p?(u=(0,N.O)(i,a,!1,!1),l=(0,N.O)(i,r,!0,!1)):n&&!p?(u=(0,N.O)(a,i,!1,!0),l=(0,N.O)(r,i,!1,!1)):(u=(0,N.O)(a,i,!0,!0),l=(0,N.O)(i,r,!0,!0)):(u=(0,N.O)(i,a,!1,!0),l=(0,N.O)(r,i,!0,!1)),null!=d){return[u,l,(0,y.pf)(o,i)]}return[u,l]},B={a:M,b:$,bias:D,preluActivationWeights:F},C={transposeA:n,transposeB:p,activation:m,leakyreluAlpha:g};if(null==d){return(0,a.cb)(((e,t,n)=>{const a=r.BV.runKernel(s.us,B,C);return n([e,t,a]),{value:(0,h.X)(a,A),gradFunc:O}}))(M,$)}return(0,a.cb)(((e,t,n,a)=>{const o=r.BV.runKernel(s.us,B,C);return a([e,t,o,n]),{value:(0,h.X)(o,A),gradFunc:O}}))(M,$,D)}})},9323:(e,t,n)=>{"use strict";n.d(t,{Fr:()=>m,pf:()=>f,QH:()=>g,uy:()=>y});var r=n(2200),a=n(3233),s=n(9133),o=n(4841),i=n(8151),u=n(7409),l=n(3582),c=n(4968),p=n(625),d=n(1901),h=n(5475);function m(e,t,n){if(null==n||"linear"===n)return e;if("relu"===n)return(0,o.d)(e,(0,d.N)(t));throw new Error(`Cannot compute gradient for fused activation ${n}.`)}function f(e,t){let n=t;const a=r.RR(e.shape,t.shape);return a.length>0&&(n=(0,h.S)(n,a)),(0,c.X)(n,e.shape)}function g(e,t,n,r){if("linear"===t)return e;if("relu"===t)return(0,u.U)(e);if("elu"===t)return(0,a.p)(e);if("relu6"===t)return(0,l.b)(e);if("prelu"===t)return(0,i.A)(e,n);if("leakyrelu"===t)return(0,s.h)(e,r);if("sigmoid"===t)return(0,p.X)(e);throw new Error(`Unknown fused activation ${t}.`)}const y=(e,t)=>!(e>0)||"linear"===t},4926:(e,t,n)=>{"use strict";n.d(t,{I:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({gather_:function(e,t,n=0,o=0){const i={x:(0,s._1)(e,"x","gather"),indices:(0,s._1)(t,"indices","gather","int32")},u={axis:n,batchDims:o};return r.BV.runKernel(a.qi,i,u)}})},7494:(e,t,n)=>{"use strict";n.d(t,{d:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({gatherND_:function(e,t){const n=(0,s._1)(t,"indices","gatherND","int32"),o={params:(0,s._1)(e,"x","gatherND","string_or_numeric"),indices:n};return r.BV.runKernel(a.q1,o)}})},636:(e,t,n)=>{"use strict";n.d(t,{p:()=>u});var r=n(7097),a=n(9121),s=n(747),o=n(3740),i=n(2200);const u=(0,n(2668).op)({greater_:function(e,t){let n=(0,o._1)(e,"a","greater","string_or_numeric"),u=(0,o._1)(t,"b","greater","string_or_numeric");[n,u]=(0,s.makeTypesMatch)(n,u),(0,i.$N)(n.shape,u.shape);const l={a:n,b:u};return r.BV.runKernel(a.iZ,l)}})},7630:(e,t,n)=>{"use strict";n.d(t,{b:()=>u});var r=n(7097),a=n(9121),s=n(747),o=n(3740),i=n(2200);const u=(0,n(2668).op)({greaterEqual_:function(e,t){let n=(0,o._1)(e,"a","greaterEqual","string_or_numeric"),u=(0,o._1)(t,"b","greaterEqual","string_or_numeric");[n,u]=(0,s.makeTypesMatch)(n,u),(0,i.$N)(n.shape,u.shape);const l={a:n,b:u};return r.BV.runKernel(a.Ac,l)}})},4386:(e,t,n)=>{"use strict";n.d(t,{a:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({imag_:function(e){const t={input:(0,s._1)(e,"input","imag")};return r.BV.runKernel(a.J_,t)}})},6230:(e,t,n)=>{"use strict";n.d(t,{i:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({isNaN_:function(e){const t={x:(0,s._1)(e,"x","isNaN")};return r.BV.runKernel(a.r7,t)}})},9133:(e,t,n)=>{"use strict";n.d(t,{h:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({leakyRelu_:function(e,t=.2){const n={x:(0,s._1)(e,"x","leakyRelu")},o={alpha:t};return r.BV.runKernel(a.J$,n,o)}})},6573:(e,t,n)=>{"use strict";n.d(t,{d:()=>u});var r=n(7097),a=n(9121),s=n(747),o=n(3740),i=n(2200);const u=(0,n(2668).op)({less_:function(e,t){let n=(0,o._1)(e,"a","less","string_or_numeric"),u=(0,o._1)(t,"b","less","string_or_numeric");[n,u]=(0,s.makeTypesMatch)(n,u),(0,i.$N)(n.shape,u.shape);const l={a:n,b:u};return r.BV.runKernel(a.vt,l)}})},624:(e,t,n)=>{"use strict";n.d(t,{z:()=>u});var r=n(7097),a=n(9121),s=n(747),o=n(3740),i=n(2200);const u=(0,n(2668).op)({lessEqual_:function(e,t){let n=(0,o._1)(e,"a","lessEqual","string_or_numeric"),u=(0,o._1)(t,"b","lessEqual","string_or_numeric");[n,u]=(0,s.makeTypesMatch)(n,u),(0,i.$N)(n.shape,u.shape);const l={a:n,b:u};return r.BV.runKernel(a.CA,l)}})},4135:(e,t,n)=>{"use strict";n.d(t,{S:()=>s});var r=n(7097),a=n(9121);function s(e,t,n){if(n<=0)throw new Error("The number of values should be positive.");const s={start:e,stop:t,num:n};return r.BV.runKernel(a.e7,{},s)}},9648:(e,t,n)=>{"use strict";n.d(t,{G:()=>l});var r=n(7097),a=n(9121),s=n(3740),o=n(569),i=n(2668),u=n(4968);const l=(0,i.op)({localResponseNormalization_:function(e,t=5,n=1,i=1,l=.5){const c=(0,s._1)(e,"x","localResponseNormalization");o.hu(4===c.rank||3===c.rank,(()=>`Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank ${c.rank}.`)),o.hu(o.GN(t),(()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${t}.`));let p=c,d=!1;3===c.rank&&(d=!0,p=(0,u.X)(c,[1,c.shape[0],c.shape[1],c.shape[2]]));const h={x:p},m={depthRadius:t,bias:n,alpha:i,beta:l},f=r.BV.runKernel(a.eZ,h,m);return d?(0,u.X)(f,[f.shape[1],f.shape[2],f.shape[3]]):f}})},2597:(e,t,n)=>{"use strict";n.d(t,{c:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({log_:function(e){const t={x:(0,s._1)(e,"x","log")};return r.BV.runKernel(a.Zb,t)}})},7474:(e,t,n)=>{"use strict";n.d(t,{K:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({log1p_:function(e){const t={x:(0,s._1)(e,"x","log1p")};return r.BV.runKernel(a.kU,t)}})},1510:(e,t,n)=>{"use strict";n.d(t,{C:()=>h});var r=n(633),a=n(3740),s=n(2271),o=n(4842),i=n(2597),u=n(3307),l=n(4841),c=n(2668),p=n(827),d=n(5475);const h=(0,c.op)({logSoftmax_:function(e,t=-1){const n=(0,a._1)(e,"logits","logSoftmax");if(-1===t&&(t=n.rank-1),t!==n.rank-1)throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and axis was ${t}`);return(0,r.cb)(((e,n)=>{const r=(0,u.F)(e,t,!0),a=(0,p.l)(e,r),c=(0,p.l)((0,s.p)(a,"float32"),(0,i.c)((0,d.S)((0,o.Q)(a),t,!0)));n([c]);return{value:c,gradFunc:(e,n)=>{const[r]=n,a=(0,o.Q)(r);return(0,p.l)(e,(0,l.d)((0,d.S)(e,t,!0),a))}}}))(n)}})},2856:(e,t,n)=>{"use strict";n.d(t,{H:()=>i});var r=n(7097),a=n(9121),s=n(3740),o=n(2200);const i=(0,n(2668).op)({logicalAnd_:function(e,t){const n=(0,s._1)(e,"a","logicalAnd","bool"),i=(0,s._1)(t,"b","logicalAnd","bool");(0,o.$N)(n.shape,i.shape);const u={a:n,b:i};return r.BV.runKernel(a.PY,u)}})},8651:(e,t,n)=>{"use strict";n.d(t,{h:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({logicalNot_:function(e){const t={x:(0,s._1)(e,"x","logicalNot","bool")};return r.BV.runKernel(a.Vf,t)}})},5750:(e,t,n)=>{"use strict";n.d(t,{K:()=>i});var r=n(7097),a=n(9121),s=n(3740),o=n(2200);const i=(0,n(2668).op)({logicalOr_:function(e,t){const n=(0,s._1)(e,"a","logicalOr","bool"),i=(0,s._1)(t,"b","logicalOr","bool");(0,o.$N)(n.shape,i.shape);const u={a:n,b:i};return r.BV.runKernel(a.MZ,u)}})},9876:(e,t,n)=>{"use strict";var r;n.d(t,{I:()=>r}),function(e){e[e.NONE=0]="NONE",e[e.MEAN=1]="MEAN",e[e.SUM=2]="SUM",e[e.SUM_BY_NONZERO_WEIGHTS=3]="SUM_BY_NONZERO_WEIGHTS"}(r||(r={}))},8687:(e,t,n)=>{"use strict";n.d(t,{O:()=>i});var r=n(7097),a=n(9121),s=n(747),o=n(3740);const i=(0,n(2668).op)({matMul_:function(e,t,n=!1,i=!1){let u=(0,o._1)(e,"a","matMul"),l=(0,o._1)(t,"b","matMul");[u,l]=(0,s.makeTypesMatch)(u,l);const c={a:u,b:l},p={transposeA:n,transposeB:i};return r.BV.runKernel(a.XL,c,p)}})},3307:(e,t,n)=>{"use strict";n.d(t,{F:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({max_:function(e,t=null,n=!1){const o={x:(0,s._1)(e,"x","max")},i={reductionIndices:t,keepDims:n};return r.BV.runKernel(a.Yo,o,i)}})},1174:(e,t,n)=>{"use strict";n.d(t,{_:()=>c});var r=n(7097),a=n(9121),s=n(3740),o=n(569),i=n(2582),u=n(2668),l=n(4968);const c=(0,u.op)({maxPool_:function(e,t,n,u,c){const p=(0,s._1)(e,"x","maxPool");let d=p,h=!1;3===p.rank&&(h=!0,d=(0,l.X)(p,[1,p.shape[0],p.shape[1],p.shape[2]])),o.hu(4===d.rank,(()=>`Error in maxPool: input must be rank 4 but got rank ${d.rank}.`)),o.hu(i.jT(n,1),(()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`)),null!=c&&o.hu(o.GN(u),(()=>`Error in maxPool: pad must be an integer when using, dimRoundingMode ${c} but got pad ${u}.`));const m={x:d},f={filterSize:t,strides:n,pad:u,dimRoundingMode:c},g=r.BV.runKernel(a.mT,m,f);return h?(0,l.X)(g,[g.shape[1],g.shape[2],g.shape[3]]):g}})},5020:(e,t,n)=>{"use strict";n.d(t,{Y:()=>l});var r=n(7097),a=n(9121),s=n(3740),o=n(569),i=n(2668),u=n(4968);const l=(0,i.op)({maxPool3d_:function(e,t=[1,1,1],n,i,l,c="NDHWC"){const p=(0,s._1)(e,"x","maxPool3d");let d=p,h=!1;4===p.rank&&(h=!0,d=(0,u.X)(p,[1,p.shape[0],p.shape[1],p.shape[2],p.shape[3]])),o.hu(5===d.rank,(()=>`Error in maxPool3d: x must be rank 5 but got rank ${d.rank}.`)),o.hu("NDHWC"===c,(()=>`Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${c}`)),null!=l&&o.hu(o.GN(i),(()=>`Error in maxPool3d: pad must be an integer when using, dimRoundingMode ${l} but got pad ${i}.`));const m={x:d},f={filterSize:t,strides:n,pad:i,dimRoundingMode:l,dataFormat:c},g=r.BV.runKernel(a.OA,m,f);return h?(0,u.X)(g,[g.shape[1],g.shape[2],g.shape[3],g.shape[4]]):g}})},6877:(e,t,n)=>{"use strict";n.d(t,{I:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({maxPoolWithArgmax_:function(e,t,n,o,i=!1){const u={x:(0,s._1)(e,"x","maxPoolWithArgmax")},l={filterSize:t,strides:n,pad:o,includeBatchInIndex:i},c=r.BV.runKernel(a.vF,u,l);return{result:c[0],indexes:c[1]}}})},632:(e,t,n)=>{"use strict";n.d(t,{g:()=>l});var r=n(7097),a=n(9121),s=n(747),o=n(3740),i=n(2200),u=n(2271);const l=(0,n(2668).op)({maximum_:function(e,t){let n=(0,o._1)(e,"a","maximum"),l=(0,o._1)(t,"b","maximum");[n,l]=(0,s.makeTypesMatch)(n,l),"bool"===n.dtype&&(n=(0,u.p)(n,"int32"),l=(0,u.p)(l,"int32")),(0,i.$N)(n.shape,l.shape);const c={a:n,b:l};return r.BV.runKernel(a.BM,c)}})},5130:(e,t,n)=>{"use strict";n.d(t,{J:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({mean_:function(e,t=null,n=!1){const o={x:(0,s._1)(e,"x","mean")},i={axis:t,keepDims:n};return r.BV.runKernel(a.q2,o,i)}})},5735:(e,t,n)=>{"use strict";n.d(t,{V:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({min_:function(e,t=null,n=!1){const o={x:(0,s._1)(e,"x","min")},i={axis:t,keepDims:n};return r.BV.runKernel(a.c1,o,i)}})},4513:(e,t,n)=>{"use strict";n.d(t,{L:()=>l});var r=n(7097),a=n(9121),s=n(747),o=n(3740),i=n(2200),u=n(2271);const l=(0,n(2668).op)({minimum_:function(e,t){let n=(0,o._1)(e,"a","minimum"),l=(0,o._1)(t,"b","minimum");[n,l]=(0,s.makeTypesMatch)(n,l),"bool"===n.dtype&&(n=(0,u.p)(n,"int32"),l=(0,u.p)(l,"int32")),(0,i.$N)(n.shape,l.shape);const c={a:n,b:l};return r.BV.runKernel(a.q8,c)}})},1483:(e,t,n)=>{"use strict";n.d(t,{V:()=>i});var r=n(7097),a=n(9121),s=n(3740),o=n(569);const i=(0,n(2668).op)({mirrorPad_:function(e,t,n){o.hu("reflect"===n||"symmetric"===n,(()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${n}.`));const i=(0,s._1)(e,"x","mirrorPad");if(0===i.rank)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");o.hu(t.length===i.rank,(()=>`Padding doesn't match input. Must be ${i.rank}. Got ${t.length}.`));const u="reflect"===n?1:0;for(let e=0;e"Invalid number of paddings. Must be length of 2 each.")),o.hu(t[e][0]>=0&&t[e][0]<=i.shape[e]-u&&t[e][1]>=0&&t[e][1]<=i.shape[e]-u,(()=>`Padding in dimension ${e} cannot be greater than or equal to ${i.shape[e]-u} or less than 0 for input of shape ${i.shape}`));const l={paddings:t,mode:n},c={x:i};return r.BV.runKernel(a.jQ,c,l)}})},5228:(e,t,n)=>{"use strict";n.d(t,{w:()=>i});var r=n(7097),a=n(9121),s=n(747),o=n(3740);const i=(0,n(2668).op)({mod_:function(e,t){let n=(0,o._1)(e,"a","mod"),i=(0,o._1)(t,"b","mod");[n,i]=(0,s.makeTypesMatch)(n,i);const u={a:n,b:i};return r.BV.runKernel(a.Vb,u)}})},4841:(e,t,n)=>{"use strict";n.d(t,{d:()=>i});var r=n(7097),a=n(9121),s=n(747),o=n(3740);const i=(0,n(2668).op)({mul_:function(e,t){let n=(0,o._1)(e,"a","mul"),i=(0,o._1)(t,"b","mul");[n,i]=(0,s.makeTypesMatch)(n,i);const u={a:n,b:i};return r.BV.runKernel(a.wY,u)}})},686:(e,t,n)=>{"use strict";n.d(t,{S:()=>u});var r=n(7097),a=n(9121),s=n(3740),o=n(2668),i=n(4968);const u=(0,o.op)({multinomial_:function(e,t,n,o=!1){const u=(0,s._1)(e,"logits","multinomial"),l=u.size,c=u.rank;if(l<2)throw new Error(`Error in multinomial: you need at least 2 outcomes, but got ${l}.`);if(c>2)throw new Error(`Rank of probabilities must be 1 or 2, but is ${c}`);n=n||Math.random();const p={logits:1===c?(0,i.X)(u,[1,-1]):u},d={numSamples:t,seed:n,normalized:o},h=r.BV.runKernel(a.NZ,p,d);return 1===c?(0,i.X)(h,[h.size]):h}})},7370:(e,t,n)=>{"use strict";n.d(t,{W:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({neg_:function(e){const t={x:(0,s._1)(e,"x","neg")};return r.BV.runKernel(a.ku,t)}})},6500:(e,t,n)=>{"use strict";n.d(t,{Q:()=>u});var r=n(7097),a=n(9121),s=n(747),o=n(3740),i=n(2200);const u=(0,n(2668).op)({notEqual_:function(e,t){let n=(0,o._1)(e,"a","notEqual","string_or_numeric"),u=(0,o._1)(t,"b","notEqual","string_or_numeric");[n,u]=(0,s.makeTypesMatch)(n,u),(0,i.$N)(n.shape,u.shape);const l={a:n,b:u};return r.BV.runKernel(a.yQ,l)}})},6708:(e,t,n)=>{"use strict";n.d(t,{l:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({oneHot_:function(e,t,n=1,o=0){if(t<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${t}`);const i={indices:(0,s._1)(e,"indices","oneHot","int32")},u={depth:t,onValue:n,offValue:o};return r.BV.runKernel(a.we,i,u)}})},4917:(e,t,n)=>{"use strict";n.d(t,{i:()=>i});var r=n(7097),a=n(569),s=n(1661),o=n(9640);function i(e,t="float32"){if("complex64"===t){const t=i(e,"float32"),n=(0,o.l)(e,"float32");return(0,s.P)(t,n)}const n=(0,a.p8)((0,a.NA)(e),t);return r.BV.makeTensor(n,e,t)}},7846:(e,t,n)=>{"use strict";n.d(t,{J:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({onesLike_:function(e){const t={x:(0,s._1)(e,"x","onesLike")};return r.BV.runKernel(a.qW,t)}})},2668:(e,t,n)=>{"use strict";n.d(t,{z:()=>s,op:()=>o});var r=n(7097),a=n(569);const s="__op";function o(e){const t=Object.keys(e);if(1!==t.length)throw new Error(`Please provide an object with a single key (operation name) mapping to a function. Got an object with ${t.length} keys.`);let n=t[0];const o=e[n];n.endsWith("_")&&(n=n.substring(0,n.length-1)),n+=s;const i=(...e)=>{r.BV.startScope(n);try{const t=o(...e);return(0,a.tI)(t)&&console.error("Cannot return a Promise inside of tidy."),r.BV.endScope(t),t}catch(e){throw r.BV.endScope(null),e}};return Object.defineProperty(i,"name",{value:n,configurable:!0}),i}},4885:(e,t,n)=>{"use strict";n.d(t,{zvA:()=>N.z,WnP:()=>r.W,Khb:()=>a.K,__u:()=>s._,IHx:()=>o.I,QBD:()=>i.Q,$6P:()=>u.$,YjB:()=>l.Y,NqF:()=>c.N,vHJ:()=>p.v,ZRM:()=>d.Z,VfV:()=>h.V,z4N:()=>m.z,fvJ:()=>f.f,C80:()=>g.C,wS1:()=>y.w,uR5:()=>b.u,zEQ:()=>_,tgs:()=>A.t,Dxk:()=>$,JY5:()=>D,p3b:()=>F,E4h:()=>E.E,yE8:()=>O.y,anm:()=>Rn,XsQ:()=>B.X,UFq:()=>C.U,f3b:()=>V.f,pju:()=>R.p,mDi:()=>z.m,iUl:()=>P.i,d9v:()=>L.d,PYB:()=>W.P,zoF:()=>w.z,gME:()=>H,Izb:()=>q,MNy:()=>G,ZaL:()=>U,PAt:()=>j.P,Tek:()=>K.T,bc:()=>X.b,pdZ:()=>Z.p,$QV:()=>te,mCk:()=>ne.m,f9Y:()=>re.f,mew:()=>Xn,zbp:()=>ae.z,ppE:()=>se.p,nTT:()=>oe.n,B10:()=>ie.B,Ka3:()=>ue,WmZ:()=>le.W,hiC:()=>ce.h,NTj:()=>pe.N,AKD:()=>de,rvX:()=>jn,WYO:()=>he.W,pyx:()=>me.p,GRh:()=>Kn,DgJ:()=>fe.D,qNN:()=>ge.q,Qqt:()=>ye.Q,dt4:()=>be.d,t$B:()=>ke.t,iyy:()=>ve,kp_:()=>un.k,hlL:()=>xe.h,GWj:()=>Ne.G,qPi:()=>Se.q,imm:()=>Jn,Iqj:()=>Ie.I,dbB:()=>Un.d,pjt:()=>Te.p,brS:()=>_e.b,Sxn:()=>ln.S,asL:()=>Ee.a,BHj:()=>Wr,V3u:()=>Zn,wx0:()=>cn.w,xVT:()=>Ae,UWc:()=>Me,i2d:()=>$e.i,hi7:()=>De.h,d9m:()=>Fe.d,zN1:()=>Oe.z,$r2:()=>Hr,SX3:()=>Be.S,G9k:()=>Ce.G,cM7:()=>Ve.c,Krr:()=>Re.K,e_t:()=>We,CmS:()=>He.C,l_t:()=>Ke,HvI:()=>Xe.H,hJK:()=>Ze.h,K5V:()=>Je.K,egP:()=>Ye,MB5:()=>qr,OI3:()=>v.O,Fp7:()=>Ge.F,_sB:()=>et._,YQQ:()=>tt.Y,Ip$:()=>nt.I,gWQ:()=>rt.g,J69:()=>at.J,ry_:()=>it,VV$:()=>ut.V,LTh:()=>lt.L,VdP:()=>ct.V,wQq:()=>pt.w,Gi7:()=>ht,p_:()=>Hn,dC7:()=>x.d,rq4:()=>mt,SJ_:()=>ft.S,W76:()=>Pe.W,KOy:()=>Ln,Quu:()=>gt.Q,lfX:()=>yt.l,iUs:()=>st.i,JpU:()=>bt.J,op:()=>N.op,N2O:()=>kt,vku:()=>wt.v,pNR:()=>vt,koy:()=>xt,t1L:()=>Nt,lGY:()=>St,d_R:()=>_t,sQ3:()=>Et.s,AL3:()=>At.A,S0v:()=>Mt.S,WVs:()=>$t.W,TN_:()=>Dt,wzB:()=>Ot,nGf:()=>Bt,LGj:()=>Ct.L,w6H:()=>Vt.w,kwC:()=>Rt.k,M25:()=>zt.M,UYe:()=>Pt.U,btT:()=>Lt.b,XLQ:()=>Y.X,GYS:()=>Wt.G,SDf:()=>Ht,diP:()=>qt,sx7:()=>Gt,mG2:()=>Ut,QEs:()=>pn.Q,NMM:()=>jt.N,bp0:()=>Kt.b,iD$:()=>Xt.i,snQ:()=>qn.s,U8D:()=>Zt.U,U_I:()=>Jt,ODp:()=>Qt.O,XD2:()=>S.X,Xxe:()=>Yt.X,tdS:()=>Lr,O$l:()=>en.O,R_K:()=>tn.R,tPi:()=>I.t,jZU:()=>nn,SmN:()=>rn,CnO:()=>an,p0P:()=>sn,XAC:()=>on.X,Wvh:()=>Le.W,fBT:()=>Tt.f,rVs:()=>Gr,ers:()=>Gn.e,uN7:()=>Pr,Vl2:()=>dn.V,_b3:()=>hn._,h62:()=>dt.h,$i:()=>mn.$,L9e:()=>fn.L,knu:()=>gn.k,Nbs:()=>yn.N,NXj:()=>bn.N,Z_8:()=>Ur,luU:()=>Ue.l,Smz:()=>je.S,ORZ:()=>kn.O,AEp:()=>T.A,XeE:()=>wn.X,RRF:()=>vn.R,odF:()=>Nn,wOQ:()=>Sn.w,yXz:()=>In,Bfx:()=>Tn,xZs:()=>_n,Gg6:()=>we.G,hg7:()=>En.h,p4s:()=>zn.p,Xu6:()=>An.X,Two:()=>Mn.T,pUJ:()=>$n,HHK:()=>Dn.H,VD$:()=>Fn,arb:()=>On.a,itS:()=>Bn.i,lls:()=>Cn.l,P84:()=>Vn.P});var r=n(6235),a=n(7839),s=n(1470),o=n(6407),i=n(3135),u=n(781),l=n(2998),c=n(47),p=n(7394),d=n(2421),h=n(1891),m=n(7037),f=n(9812),g=n(369),y=n(5176),b=n(1749),k=n(3740),w=n(6884),v=n(8687),x=n(4841),N=n(2668),S=n(625),I=n(2676),T=n(1869);const _=(0,N.op)({basicLSTMCell_:function(e,t,n,r,a,s){const i=(0,k._1)(e,"forgetBias","basicLSTMCell"),u=(0,k._1)(t,"lstmKernel","basicLSTMCell"),l=(0,k._1)(n,"lstmBias","basicLSTMCell"),c=(0,k._1)(r,"data","basicLSTMCell"),p=(0,k._1)(a,"c","basicLSTMCell"),d=(0,k._1)(s,"h","basicLSTMCell"),h=(0,w.z)([c,d],1),m=(0,v.O)(h,u),f=(0,o.I)(m,l),g=f.shape[0],y=f.shape[1]/4,b=[g,y],N=(0,I.t)(f,[0,0],b),_=(0,I.t)(f,[0,y],b),E=(0,I.t)(f,[0,2*y],b),A=(0,I.t)(f,[0,3*y],b),M=(0,o.I)((0,x.d)((0,S.X)(N),(0,T.A)(_)),(0,x.d)(p,(0,S.X)((0,o.I)(i,E))));return[M,(0,x.d)((0,T.A)(M),(0,S.X)(A))]}});var E=n(8441),A=n(7505),M=n(569);const $=(0,N.op)({batchNorm2d_:function(e,t,n,r,a,s){const o=(0,k._1)(e,"x","batchNorm"),i=(0,k._1)(t,"mean","batchNorm"),u=(0,k._1)(n,"variance","batchNorm");let l,c;return null!=a&&(l=(0,k._1)(a,"scale","batchNorm")),null!=r&&(c=(0,k._1)(r,"offset","batchNorm")),M.hu(2===o.rank,(()=>`Error in batchNorm2D: x must be rank 2 but got rank ${o.rank}.`)),M.hu(2===i.rank||1===i.rank,(()=>`Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank ${i.rank}.`)),M.hu(2===u.rank||1===u.rank,(()=>`Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank ${u.rank}.`)),null!=l&&M.hu(2===l.rank||1===l.rank,(()=>`Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${l.rank}.`)),null!=c&&M.hu(2===c.rank||1===c.rank,(()=>`Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${c.rank}.`)),(0,A.t)(o,i,u,c,l,s)}});const D=(0,N.op)({batchNorm3d_:function(e,t,n,r,a,s){const o=(0,k._1)(e,"x","batchNorm"),i=(0,k._1)(t,"mean","batchNorm"),u=(0,k._1)(n,"variance","batchNorm");let l,c;return null!=a&&(l=(0,k._1)(a,"scale","batchNorm")),null!=r&&(c=(0,k._1)(r,"offset","batchNorm")),M.hu(3===o.rank,(()=>`Error in batchNorm3D: x must be rank 3 but got rank ${o.rank}.`)),M.hu(3===i.rank||1===i.rank,(()=>`Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank ${i.rank}.`)),M.hu(3===u.rank||1===u.rank,(()=>`Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank ${u.rank}.`)),null!=l&&M.hu(3===l.rank||1===l.rank,(()=>`Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${l.rank}.`)),null!=c&&M.hu(3===c.rank||1===c.rank,(()=>`Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${c.rank}.`)),(0,A.t)(o,i,u,c,l,s)}});const F=(0,N.op)({batchNorm4d_:function(e,t,n,r,a,s){const o=(0,k._1)(e,"x","batchNorm"),i=(0,k._1)(t,"mean","batchNorm"),u=(0,k._1)(n,"variance","batchNorm");let l,c;return null!=a&&(l=(0,k._1)(a,"scale","batchNorm")),null!=r&&(c=(0,k._1)(r,"offset","batchNorm")),M.hu(4===o.rank,(()=>`Error in batchNorm4D: x must be rank 4 but got rank ${o.rank}.`)),M.hu(4===i.rank||1===i.rank,(()=>`Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank ${i.rank}.`)),M.hu(4===u.rank||1===u.rank,(()=>`Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank ${u.rank}.`)),null!=l&&M.hu(4===l.rank||1===l.rank,(()=>`Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${l.rank}.`)),null!=c&&M.hu(4===c.rank||1===c.rank,(()=>`Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${c.rank}.`)),(0,A.t)(o,i,u,c,l,s)}});var O=n(3865),B=n(8194),C=n(8247),V=n(2657),R=n(2271),z=n(6825),P=n(2279),L=n(8723),W=n(1661);const H=(0,N.op)({concat1d_:function(e){return(0,w.z)(e,0)}});const q=(0,N.op)({concat2d_:function(e,t){return(0,w.z)(e,t)}});const G=(0,N.op)({concat3d_:function(e,t){return(0,w.z)(e,t)}});const U=(0,N.op)({concat4d_:function(e,t){return(0,w.z)(e,t)}});var j=n(1355),K=n(4794),X=n(1405),Z=n(473),J=n(7097),Q=n(9121),Y=n(4968);const ee=(0,N.op)({conv3DBackpropInput_:function(e,t,n,r,a){M.hu(e.length===t.rank,(()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`));let s=e,o=t,i=!1;4===t.rank&&(i=!0,o=(0,Y.X)(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]]),s=[1,e[0],e[1],e[2],e[3]]);const u=s[4],l=o.shape[4];M.hu(5===s.length,(()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${s.length}.`)),M.hu(5===o.rank,(()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${o.rank}`)),M.hu(5===n.rank,(()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${n.rank}`)),M.hu(u===n.shape[3],(()=>`Error in conv3dDerInput: depth of input (${u}) must match input depth for filter ${n.shape[3]}.`)),M.hu(l===n.shape[4],(()=>`Error in conv3dDerInput: depth of output (${l}) must match output depth for filter ${n.shape[4]}.`));const c={dy:o,filter:n},p={pad:a,strides:r,inputShape:s},d=J.BV.runKernel(Q.ik,c,p);return i?(0,Y.X)(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}});const te=(0,N.op)({conv3dTranspose_:function(e,t,n,r,a){const s=(0,k._1)(e,"x","conv3dTranspose"),o=(0,k._1)(t,"filter","conv3dTranspose");return ee(n,s,o,r,a)}});var ne=n(173),re=n(2699),ae=n(7405),se=n(5746),oe=n(9112),ie=n(4718);const ue=(0,N.op)({diag_:function(e){const t={x:(0,k._1)(e,"x","diag")};return J.BV.runKernel(Q.$w,t)}});var le=n(557),ce=n(1274),pe=n(9322);const de=(0,N.op)({dot_:function(e,t){const n=(0,k._1)(e,"t1","dot"),r=(0,k._1)(t,"t2","dot");M.hu(!(1!==n.rank&&2!==n.rank||1!==r.rank&&2!==r.rank),(()=>`Error in dot: inputs must all be rank 1 or 2, but got ranks ${n.rank} and ${r.rank}.`));const a=1===n.rank?n.size:n.shape[1],s=1===r.rank?r.size:r.shape[0];if(M.hu(a===s,(()=>`Error in dot: inner dimensions of inputs must match, but got ${a} and ${s}.`)),1===n.rank&&1===r.rank){const e=(0,Y.X)(n,[1,-1]),t=(0,Y.X)(r,[-1,1]),a=(0,v.O)(e,t);return(0,Y.X)(a,[])}if(1===n.rank&&2===r.rank){const e=(0,Y.X)(n,[1,-1]),t=(0,Y.X)(r,[r.shape[0],r.shape[1]]),a=(0,v.O)(e,t);return(0,Y.X)(a,[a.size])}if(2===n.rank&&1===r.rank){const e=(0,Y.X)(r,[-1,1]),t=(0,v.O)(n,e);return(0,Y.X)(t,[t.size])}{const e=(0,Y.X)(r,[r.shape[0],r.shape[1]]);return(0,v.O)(n,e)}}});var he=n(4653),me=n(3233),fe=n(6477),ge=n(4650),ye=n(4842),be=n(1300),ke=n(3426),we=n(7501);const ve=(0,N.op)({eye_:function(e,t,n,r="float32"){null==t&&(t=e);const a=(0,V.f)([e,t],r),s=e<=t?e:t;for(let e=0;e({value:(0,Pe.W)((0,Le.W)((0,Pe.W)(e))),gradFunc:t=>(0,x.d)(t,(0,S.X)((0,Pe.W)(e)))})))(t)}});var He=n(1510),qe=n(3591),Ge=n(3307),Ue=n(827),je=n(5475);const Ke=(0,N.op)({logSumExp_:function(e,t=null,n=!1){const r=(0,k._1)(e,"x","logSumExp"),a=(0,M.EC)(t,r.shape),s=(0,Ge.F)(r,a,!0),i=(0,Ue.l)(r,s),u=(0,ye.Q)(i),l=(0,je.S)(u,a),c=(0,Ve.c)(l),p=(0,o.I)((0,Y.X)(s,c.shape),c);if(n){const e=(0,qe.rv)(p.shape,a);return(0,Y.X)(p,e)}return p}});var Xe=n(2856),Ze=n(8651),Je=n(5750),Qe=n(2200);const Ye=(0,N.op)({logicalXor_:function(e,t){const n=(0,k._1)(e,"a","logicalXor","bool"),r=(0,k._1)(t,"b","logicalXor","bool");return(0,Qe.$N)(n.shape,r.shape),(0,Xe.H)((0,Je.K)(e,t),(0,Ze.h)((0,Xe.H)(e,t)))}});var et=n(1174),tt=n(5020),nt=n(6877),rt=n(632),at=n(5130),st=n(4917),ot=n(4077);function it(e,t,{indexing:n="xy"}={}){if("xy"!==n&&"ij"!==n)throw new TypeError(`${n} is not a valid third argument to meshgrid`);if(void 0===e)return[];let r=(0,k._1)(e,"x","meshgrid",e instanceof ot.es?e.dtype:"float32");if(void 0===t)return[r];let a=(0,k._1)(t,"y","meshgrid",t instanceof ot.es?t.dtype:"float32");const s=(0,M.NA)(r.shape),o=(0,M.NA)(a.shape);return"xy"===n?(r=(0,Y.X)(r,[1,-1]),a=(0,Y.X)(a,[-1,1]),[(0,v.O)((0,st.i)([o,1],r.dtype),r),(0,v.O)(a,(0,st.i)([1,s],a.dtype))]):(r=(0,Y.X)(r,[-1,1]),a=(0,Y.X)(a,[1,-1]),[(0,v.O)(r,(0,st.i)([1,o],r.dtype)),(0,v.O)((0,st.i)([s,1],a.dtype),a)])}var ut=n(5735),lt=n(4513),ct=n(1483),pt=n(5228),dt=n(248);const ht=(0,N.op)({moments_:function(e,t=null,n=!1){e=(0,k._1)(e,"x","moments");const r=(0,M.EC)(t,e.shape),a=(0,at.J)(e,r,n);let s=a.shape;n||(s=(0,qe.rv)(a.shape,r));const o=(0,dt.h)((0,Ue.l)((0,R.p)(e,"float32"),(0,Y.X)(a,s)));return{mean:a,variance:(0,at.J)(o,r,n)}}});const mt=(0,N.op)({multiRNNCell_:function(e,t,n,r){const a=(0,k._1)(t,"data","multiRNNCell"),s=(0,k.sI)(n,"c","multiRNNCell"),o=(0,k.sI)(r,"h","multiRNNCell");let i=a;const u=[];for(let t=0;t`Error in outerProduct: inputs must be rank 1, but got ranks ${n.rank} and ${r.rank}.`));const a=(0,Y.X)(n,[-1,1]),s=(0,Y.X)(r,[1,-1]);return(0,v.O)(a,s)}});var wt=n(9682);const vt=(0,N.op)({pad1d_:function(e,t,n=0){return(0,M.hu)(2===t.length,(()=>"Invalid number of paddings. Must be length of 2.")),(0,wt.v)(e,[t],n)}});const xt=(0,N.op)({pad2d_:function(e,t,n=0){return(0,M.hu)(2===t.length&&2===t[0].length&&2===t[1].length,(()=>"Invalid number of paddings. Must be length of 2 each.")),(0,wt.v)(e,t,n)}});const Nt=(0,N.op)({pad3d_:function(e,t,n=0){return(0,M.hu)(3===t.length&&2===t[0].length&&2===t[1].length&&2===t[2].length,(()=>"Invalid number of paddings. Must be length of 2 each.")),(0,wt.v)(e,t,n)}});const St=(0,N.op)({pad4d_:function(e,t,n=0){return(0,M.hu)(4===t.length&&2===t[0].length&&2===t[1].length&&2===t[2].length&&2===t[3].length,(()=>"Invalid number of paddings. Must be length of 2 each.")),(0,wt.v)(e,t,n)}});var It=n(2582),Tt=n(7918);const _t=(0,N.op)({pool_:function(e,t,n,r,a,s){null==a&&(a=[1,1]),null==s&&(s=1),0===r&&(r="valid");const o=(0,k._1)(e,"x","maxPool");let i=o,u=!1;3===o.rank&&(u=!0,i=(0,Y.X)(o,[1,o.shape[0],o.shape[1],o.shape[2]])),M.hu(It.jT(s,a),(()=>`Error in pool: Either strides or dilations must be 1. Got strides ${s} and dilations '${a}'`));const l=It.Xw(i.shape,t,s,a,r),c=[l.dilationHeight,l.dilationWidth];let p;p="same"===r?function(e,t){const n=e.map(((e,n)=>e+(e-1)*(t[n]-1))).map((e=>e-1)),r=n.map((e=>Math.floor(e/2))),a=n.map(((e,t)=>e-r[t]));return n.map(((e,t)=>[r[t],a[t]]))}([l.filterHeight,l.filterWidth],c):[[0,0],[0,0]];const d=1===c[0]&&1===c[1],[h,m]=function(e,t,n){const r=n.map((e=>e[0])),a=n.map((e=>e[1])),s=e.concat(r,a),o=t.map(((e,t)=>(e-s[t]%e)%e)),i=a.map(((e,t)=>e+o[t])),u=t.map(((e,t)=>[r[t],i[t]])),l=t.map(((e,t)=>[0,o[t]]));return[u,l]}([l.inHeight,l.inWidth],c,p),f=d?r:"valid",g=d?i:(0,Tt.f)(i,c,h),b=("avg"===n?()=>(0,y.w)(g,t,s,f):()=>(0,et._)(g,t,s,f))(),w=d?b:(0,E.E)(b,c,m);return u?(0,Y.X)(w,[w.shape[1],w.shape[2],w.shape[3]]):w}});var Et=n(3453),At=n(8151),Mt=n(9798),$t=n(9451);const Dt=(0,N.op)({rand_:function(e,t,n){const r=(0,M.NA)(e);let a=null;if(null==n||"float32"===n)a=new Float32Array(r);else if("int32"===n)a=new Int32Array(r);else{if("bool"!==n)throw new Error(`Unknown data type ${n}`);a=new Uint8Array(r)}for(let e=0;e`Error in reverse1D: x must be rank 1 but got rank ${t.rank}.`)),(0,Wt.G)(t,0)}});const qt=(0,N.op)({reverse2d_:function(e,t){const n=(0,k._1)(e,"x","reverse");return M.hu(2===n.rank,(()=>`Error in reverse2D: x must be rank 2 but got rank ${n.rank}.`)),(0,Wt.G)(n,t)}});const Gt=(0,N.op)({reverse3d_:function(e,t){const n=(0,k._1)(e,"x","reverse");return M.hu(3===n.rank,(()=>`Error in reverse3D: x must be rank 3 but got rank ${n.rank}.`)),(0,Wt.G)(n,t)}});const Ut=(0,N.op)({reverse4d_:function(e,t){const n=(0,k._1)(e,"x","reverse");return M.hu(4===n.rank,(()=>`Error in reverse4D: x must be rank 4 but got rank ${n.rank}.`)),(0,Wt.G)(n,t)}});var jt=n(7809),Kt=n(2634),Xt=n(9494),Zt=n(5503);const Jt=(0,N.op)({separableConv2d_:function(e,t,n,r,a,s=[1,1],o="NHWC"){const i=(0,k._1)(e,"x","separableConv2d"),u=(0,k._1)(t,"depthwiseFilter","separableConv2d"),l=(0,k._1)(n,"pointwiseFilter","separableConv2d");let c=i,p=!1;if(3===i.rank&&(p=!0,c=(0,Y.X)(i,[1,i.shape[0],i.shape[1],i.shape[2]])),"NCHW"===o)throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");M.hu(4===c.rank,(()=>`Error in separableConv2d: input must be rank 4, but got rank ${c.rank}.`)),M.hu(4===u.rank,(()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${u.rank}.`)),M.hu(4===l.rank,(()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${u.rank}.`)),M.hu(1===l.shape[0],(()=>`Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${l.shape[0]}.`)),M.hu(1===l.shape[1],(()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${l.shape[1]}.`));const d=u.shape[2],h=u.shape[3];M.hu(l.shape[2]===d*h,(()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${d*h}, but got ${l.shape[2]}.`));const m=(0,ie.B)(c,u,r,a,o,s),f=(0,K.T)(m,l,1,"valid",o);return p?(0,Y.X)(f,[f.shape[1],f.shape[2],f.shape[3]]):f}});var Qt=n(6567),Yt=n(4434),en=n(9331),tn=n(3254);const nn=(0,N.op)({slice1d_:function(e,t,n){const r=(0,k._1)(e,"x","slice1d");return M.hu(1===r.rank,(()=>`slice1d expects a rank-1 tensor, but got a rank-${r.rank} tensor`)),(0,I.t)(r,[t],[n])}});const rn=(0,N.op)({slice2d_:function(e,t,n){const r=(0,k._1)(e,"x","slice2d");return M.hu(2===r.rank,(()=>`slice2d expects a rank-2 tensor, but got a rank-${r.rank} tensor`)),(0,I.t)(r,t,n)}});const an=(0,N.op)({slice3d_:function(e,t,n){const r=(0,k._1)(e,"x","slice3d");return M.hu(3===r.rank,(()=>`slice3d expects a rank-3 tensor, but got a rank-${r.rank} tensor`)),(0,I.t)(r,t,n)}});const sn=(0,N.op)({slice4d_:function(e,t,n){const r=(0,k._1)(e,"x","slice4d");return M.hu(4===r.rank,(()=>`slice4d expects a rank-4 tensor, but got a rank-${r.rank} tensor`)),(0,I.t)(r,t,n)}});var on=n(682),un=n(7020),ln=n(8447),cn=n(4415),pn=n(3710),dn=n(8644),hn=n(3261),mn=n(5265),fn=n(9590),gn=n(2991),yn=n(1901),bn=n(5158),kn=n(1173),wn=n(701),vn=n(6092),xn=n(7852);function Nn(e,t,n){if((0,M.Cq)(e),null!=t&&2!==t.length)throw new Error("tensor2d() requires shape to have two numbers");const r=(0,k.C)(e,n);if(2!==r.length&&1!==r.length)throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");if(1===r.length&&null==t)throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return(0,xn.H)(e,t,r,n)}var Sn=n(9906);function In(e,t,n){if((0,M.Cq)(e),null!=t&&4!==t.length)throw new Error("tensor4d() requires shape to have four numbers");const r=(0,k.C)(e,n);if(4!==r.length&&1!==r.length)throw new Error("tensor4d() requires values to be number[][][][] or flat/TypedArray");if(1===r.length&&null==t)throw new Error("tensor4d() requires shape to be provided when `values` are a flat array");return(0,xn.H)(e,t,r,n)}function Tn(e,t,n){if((0,M.Cq)(e),null!=t&&5!==t.length)throw new Error("tensor5d() requires shape to have five numbers");const r=(0,k.C)(e,n);if(5!==r.length&&1!==r.length)throw new Error("tensor5d() requires values to be number[][][][][] or flat/TypedArray");if(1===r.length&&null==t)throw new Error("tensor5d() requires shape to be provided when `values` are a flat array");return(0,xn.H)(e,t,r,n)}function _n(e,t,n){if((0,M.Cq)(e),null!=t&&6!==t.length)throw new Error("tensor6d() requires shape to have six numbers");const r=(0,k.C)(e,n);if(6!==r.length&&1!==r.length)throw new Error("tensor6d() requires values to be number[][][][][][] or flat/TypedArray");if(1===r.length&&null==t)throw new Error("tensor6d() requires shape to be provided when `values` are a flat array");return t=t||r,(0,xn.H)(e,t,r,n)}var En=n(3243),An=n(3596),Mn=n(9608);const $n=(0,N.op)({unsortedSegmentSum_:function(e,t,n){const r=(0,k._1)(e,"x","unsortedSegmentSum"),a=(0,k._1)(t,"segmentIds","unsortedSegmentSum","int32");(0,M.hu)((0,M.GN)(n),(()=>"numSegments must be of dtype int"));const s={x:r,segmentIds:a},o={numSegments:n};return J.BV.runKernel(Q.Qv,s,o)}});var Dn=n(4136);function Fn(e,t=!0,n,r){return J.BV.makeVariable(e,t,n,r)}var On=n(5912),Bn=n(6380),Cn=n(9640),Vn=n(6577);const Rn=async function(e,t,n){const r=(0,k._1)(e,"tensor","boolMask"),a=(0,k._1)(t,"mask","boolMask","bool"),s=null==n?0:n,o=a.rank,i=r.shape;M.hu(o>0,(()=>"mask cannot be scalar")),M.k5(i.slice(s,s+o),a.shape,"mask's shape must match the first K dimensions of tensor's shape,");let u=1;for(let e=s;e"Shape mismatch in v and x"));const l=(0,Xt.i)(1),c=(0,Ue.l)(l,u);let p=(0,x.d)((0,Ue.l)(i,s),c);if(a){M.hu(null!=r,(()=>"When using zeroDebias: true, step is required."));const e=(0,k._1)(r,"step","movingAverage");p=(0,ce.h)(p,(0,Ue.l)(l,(0,Et.s)(u,e)))}return(0,o.I)(s,p)}});var qn=n(3100),Gn=n(9758),Un=n(7494);const jn=(0,N.op)({dropout_:function(e,t,n,r){const a=(0,k._1)(e,"x","dropout");if(M.hu("float32"===a.dtype,(()=>`x has to be a floating point tensor since it's going to be scaled, but got a ${a.dtype} tensor instead.`)),M.hu(t>=0&&t<1,(()=>`rate must be a float in the range [0, 1), but got ${t}.`)),0===t)return e instanceof ot.es?a.clone():a;const s=function(e,t){if(null==t)return e.shape.slice();if(M.cO(e.shape,t))return t;if(e.shape.length===t.length){const n=[];for(let r=0;r1,(()=>`inTopK() expects the predictions to be of rank 2 or higher, but got ${r.rank}`)),(0,M.hu)(r.rank-1===a.rank,(()=>`predictions rank should be 1 larger than targets rank, but got predictions rank ${r.rank} and targets rank ${a.rank}`)),(0,M.k5)(r.shape.slice(0,r.shape.length-1),a.shape,"predictions's shape should be align with the targets' shape, except the last dimension.");const s=r.shape[r.shape.length-1];(0,M.hu)(n>0&&n<=s,(()=>`'k' passed to inTopK() must be > 0 && <= the predictions last dimension (${s}), but got ${n}`));const o=await r.data(),i=await a.data(),[u,l]=[o.length/s,s],c=(0,M.WP)("bool",u);for(let e=0;et.value-e.value)),c[e]=0;for(let t=0;t`Error in cropAndResize: image must be rank 4,but got rank ${o.rank}.`)),M.hu(2===i.rank&&4===i.shape[1],(()=>`Error in cropAndResize: boxes must be have size [${l},4] but had shape ${i.shape}.`)),M.hu(1===u.rank&&u.shape[0]===l,(()=>`Error in cropAndResize: boxInd must be have size [${l}] but had shape ${i.shape}.`)),M.hu(2===r.length,(()=>`Error in cropAndResize: cropSize must be of length 2, but got length ${r.length}.`)),M.hu(r[0]>=1&&r[1]>=1,(()=>`cropSize must be atleast [1,1], but was ${r}`)),M.hu("bilinear"===a||"nearest"===a,(()=>`method must be bilinear or nearest, but was ${a}`));const c={image:o,boxes:i,boxInd:u},p={method:a,extrapolationValue:s,cropSize:r};return J.BV.runKernel(Q.Vc,c,p)}});const rr=(0,N.op)({flipLeftRight_:function(e){const t=(0,k._1)(e,"image","flipLeftRight","float32");M.hu(4===t.rank,(()=>`Error in flipLeftRight: image must be rank 4,but got rank ${t.rank}.`));const n={image:t};return J.BV.runKernel(Q.Uy,n,{})}});const ar=(0,N.op)({grayscaleToRGB_:function(e){const t=(0,k._1)(e,"image","grayscaleToRGB"),n=t.rank-1,r=t.shape[n];M.hu(t.rank>=2,(()=>`Error in grayscaleToRGB: images must be at least rank 2, but got rank ${t.rank}.`)),M.hu(1===r,(()=>`Error in grayscaleToRGB: last dimension of a grayscale image should be size 1, but got size ${r}.`));const a=new Array(t.rank);return a.fill(1,0,n),a[n]=3,(0,we.G)(t,a)}});const sr=(0,N.op)({rotateWithOffset_:function(e,t,n=0,r=.5){const a=(0,k._1)(e,"image","rotateWithOffset","float32");M.hu(4===a.rank,(()=>`Error in rotateWithOffset: image must be rank 4,but got rank ${a.rank}.`));const s={image:a},o={radians:t,fillValue:n,center:r};return J.BV.runKernel(Q.b9,s,o)}});function or(e,t,n,r,a,s){null==r&&(r=.5),null==a&&(a=Number.NEGATIVE_INFINITY),null==s&&(s=0);const o=e.shape[0];return n=Math.min(n,o),M.hu(0<=r&&r<=1,(()=>`iouThreshold must be in [0, 1], but was '${r}'`)),M.hu(2===e.rank,(()=>`boxes must be a 2D tensor, but was of rank '${e.rank}'`)),M.hu(4===e.shape[1],(()=>`boxes must have 4 columns, but 2nd dimension was ${e.shape[1]}`)),M.hu(1===t.rank,(()=>"scores must be a 1D tensor")),M.hu(t.shape[0]===o,(()=>`scores has incompatible shape with boxes. Expected ${o}, but was ${t.shape[0]}`)),M.hu(0<=s&&s<=1,(()=>`softNmsSigma must be in [0, 1], but was '${s}'`)),{maxOutputSize:n,iouThreshold:r,scoreThreshold:a,softNmsSigma:s}}const ir=(0,N.op)({nonMaxSuppression_:function(e,t,n,r=.5,a=Number.NEGATIVE_INFINITY){const s=(0,k._1)(e,"boxes","nonMaxSuppression"),o=(0,k._1)(t,"scores","nonMaxSuppression"),i=or(s,o,n,r,a),u={maxOutputSize:n=i.maxOutputSize,iouThreshold:r=i.iouThreshold,scoreThreshold:a=i.scoreThreshold};return J.BV.runKernel(Q.uv,{boxes:s,scores:o},u)}});var ur=n(3337);const lr=async function(e,t,n,r=.5,a=Number.NEGATIVE_INFINITY){const s=(0,k._1)(e,"boxes","nonMaxSuppressionAsync"),o=(0,k._1)(t,"scores","nonMaxSuppressionAsync"),i=or(s,o,n,r,a);n=i.maxOutputSize,r=i.iouThreshold,a=i.scoreThreshold;const u=await Promise.all([s.data(),o.data()]),l=u[0],c=u[1],{selectedIndices:p}=(0,ur.GP)(l,c,n,r,a);return s!==e&&s.dispose(),o!==t&&o.dispose(),(0,vn.R)(p,"int32")};const cr=(0,N.op)({nonMaxSuppressionWithScore_:function(e,t,n,r=.5,a=Number.NEGATIVE_INFINITY,s=0){const o=(0,k._1)(e,"boxes","nonMaxSuppression"),i=(0,k._1)(t,"scores","nonMaxSuppression"),u=or(o,i,n,r,a,s),l={boxes:o,scores:i},c={maxOutputSize:n=u.maxOutputSize,iouThreshold:r=u.iouThreshold,scoreThreshold:a=u.scoreThreshold,softNmsSigma:s=u.softNmsSigma},p=J.BV.runKernel(Q.W0,l,c);return{selectedIndices:p[0],selectedScores:p[1]}}});const pr=async function(e,t,n,r=.5,a=Number.NEGATIVE_INFINITY,s=0){const o=(0,k._1)(e,"boxes","nonMaxSuppressionAsync"),i=(0,k._1)(t,"scores","nonMaxSuppressionAsync"),u=or(o,i,n,r,a,s);n=u.maxOutputSize,r=u.iouThreshold,a=u.scoreThreshold,s=u.softNmsSigma;const l=await Promise.all([o.data(),i.data()]),c=l[0],p=l[1],{selectedIndices:d,selectedScores:h}=(0,ur.pA)(c,p,n,r,a,s);return o!==e&&o.dispose(),i!==t&&i.dispose(),{selectedIndices:(0,vn.R)(d,"int32"),selectedScores:(0,vn.R)(h)}};const dr=(0,N.op)({nonMaxSuppressionPadded_:function(e,t,n,r=.5,a=Number.NEGATIVE_INFINITY,s=!1){const o=(0,k._1)(e,"boxes","nonMaxSuppression"),i=(0,k._1)(t,"scores","nonMaxSuppression"),u=or(o,i,n,r,a,null),l={boxes:o,scores:i},c={maxOutputSize:u.maxOutputSize,iouThreshold:u.iouThreshold,scoreThreshold:u.scoreThreshold,padToMaxOutputSize:s},p=J.BV.runKernel(Q.cy,l,c);return{selectedIndices:p[0],validOutputs:p[1]}}});const hr=async function(e,t,n,r=.5,a=Number.NEGATIVE_INFINITY,s=!1){const o=(0,k._1)(e,"boxes","nonMaxSuppressionAsync"),i=(0,k._1)(t,"scores","nonMaxSuppressionAsync"),u=or(o,i,n,r,a,null),l=u.maxOutputSize,c=u.iouThreshold,p=u.scoreThreshold,[d,h]=await Promise.all([o.data(),i.data()]),{selectedIndices:m,validOutputs:f}=(0,ur.qP)(d,h,l,c,p,s);return o!==e&&o.dispose(),i!==t&&i.dispose(),{selectedIndices:(0,vn.R)(m,"int32"),validOutputs:(0,Xt.i)(f,"int32")}};const mr=(0,N.op)({resizeBilinear_:function(e,t,n=!1,r=!1){const a=(0,k._1)(e,"images","resizeBilinear");M.hu(3===a.rank||4===a.rank,(()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${a.rank}.`)),M.hu(2===t.length,(()=>`Error in resizeBilinear: new shape must 2D, but got shape ${t}.`)),M.hu(!1===r||!1===n,(()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false."));let s=a,o=!1;3===a.rank&&(o=!0,s=(0,Y.X)(a,[1,a.shape[0],a.shape[1],a.shape[2]]));const[]=t,i={images:s},u={alignCorners:n,halfPixelCenters:r,size:t},l=J.BV.runKernel(Q._Y,i,u);return o?(0,Y.X)(l,[l.shape[1],l.shape[2],l.shape[3]]):l}});const fr=(0,N.op)({resizeNearestNeighbor_:function(e,t,n=!1,r=!1){const a=(0,k._1)(e,"images","resizeNearestNeighbor");M.hu(3===a.rank||4===a.rank,(()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${a.rank}.`)),M.hu(2===t.length,(()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${t}.`)),M.hu("float32"===a.dtype||"int32"===a.dtype,(()=>"`images` must have `int32` or `float32` as dtype")),M.hu(!1===r||!1===n,(()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false."));let s=a,o=!1;3===a.rank&&(o=!0,s=(0,Y.X)(a,[1,a.shape[0],a.shape[1],a.shape[2]]));const[]=t,i={images:s},u={alignCorners:n,halfPixelCenters:r,size:t},l=J.BV.runKernel(Q.dp,i,u);return o?(0,Y.X)(l,[l.shape[1],l.shape[2],l.shape[3]]):l}});const gr=(0,N.op)({threshold_:function(e,t="binary",n=!1,r=.5){const a=(0,k._1)(e,"image","threshold"),s=a.shape[0]*a.shape[1];let i,u,l,c,p=(0,x.d)((0,vn.R)([r]),255);if(M.hu(3===a.rank,(()=>`Error in threshold: image must be rank 3,but got rank ${a.rank}.`)),M.hu(3===a.shape[2]||1===a.shape[2],(()=>`Error in threshold: image color channel must be equal to 3 or 1but got ${a.shape[2]}.`)),M.hu("int32"===a.dtype||"float32"===a.dtype,(()=>`Error in dtype: image dtype must be int32 or float32,but got dtype ${a.dtype}.`)),M.hu("otsu"===t||"binary"===t,(()=>`Method must be binary or otsu, but was ${t}`)),3===a.shape[2]){[i,u,l]=(0,dn.V)(a,[1,1,1],-1);const e=(0,x.d)(i,.2989),t=(0,x.d)(u,.587),n=(0,x.d)(l,.114);c=(0,o.I)((0,o.I)(e,t),n)}else c=e;if("otsu"===t){p=function(e,t){let n,r,a,s,i,u,l=(0,vn.R)([-1]),c=(0,vn.R)([0]),p=(0,vn.R)([0]);for(let d=0;d`Error in transform: image must be rank 4,but got rank ${o.rank}.`)),M.hu(2===i.rank&&(i.shape[0]===o.shape[0]||1===i.shape[0])&&8===i.shape[1],(()=>"Error in transform: Input transform should be batch x 8 or 1 x 8")),M.hu(null==s||2===s.length,(()=>`Error in transform: outputShape must be [height, width] or null, but got ${s}.`));const u={image:o,transforms:i},l={interpolation:n,fillMode:r,fillValue:a,outputShape:s};return J.BV.runKernel(Q.wx,u,l)}});const br=(0,N.op)({bandPart_:function(e,t,n){(0,M.hu)(t%1==0,(()=>`bandPart(): numLower must be an integer, got ${t}.`)),(0,M.hu)(n%1==0,(()=>`bandPart(): numUpper must be an integer, got ${n}.`));const r=(0,k._1)(e,"a","bandPart");(0,M.hu)(r.rank>=2,(()=>`bandPart(): Rank must be at least 2, got ${r.rank}.`));const a=r.shape,[s,o]=r.shape.slice(-2);if(!(t<=s))throw new Error(`bandPart(): numLower (${t}) must not be greater than the number of rows (${s}).`);if(!(n<=o))throw new Error(`bandPart(): numUpper (${n}) must not be greater than the number of columns (${o}).`);t<0&&(t=s),n<0&&(n=o);const i=(0,Y.X)((0,Vt.w)(0,s,1,"int32"),[-1,1]),u=(0,Vt.w)(0,o,1,"int32"),l=(0,Ue.l)(i,u),c=(0,Xe.H)((0,Oe.z)(l,(0,Xt.i)(+t,"int32")),(0,_e.b)(l,(0,Xt.i)(-n,"int32"))),p=(0,Cn.l)([s,o],r.dtype);return(0,Y.X)((0,gn.k)((0,Dn.H)((0,Y.X)(r,[-1,s,o])).map((e=>(0,On.a)(c,e,p)))),a)}});const kr=(0,N.op)({gramSchmidt_:function(e){let t;if(Array.isArray(e)){t=!1,(0,M.hu)(null!=e&&e.length>0,(()=>"Gram-Schmidt process: input must not be null, undefined, or empty"));const n=e[0].shape[0];for(let t=1;t`Gram-Schmidt: Non-unique lengths found in the input vectors: (${e[t].shape[0]} vs. ${n})`))}else t=!0,e=(0,dn.V)(e,e.shape[0],0).map((e=>(0,fn.L)(e,[0])));(0,M.hu)(e.length<=e[0].shape[0],(()=>`Gram-Schmidt: Number of vectors (${e.length}) exceeds number of dimensions (${e[0].shape[0]}).`));const n=[],r=e;for(let t=0;t{let e=r[t];if(t>0)for(let r=0;r{(0,M.hu)(2===e.shape.length,(()=>`qr2d() requires a 2D Tensor, but got a ${e.shape.length}D Tensor.`));const n=e.shape[0],r=e.shape[1];let a=ve(n),s=(0,L.d)(e);const o=Nn([[1]],[1,1]);let i=(0,L.d)(o);const u=n>=r?r:n;for(let e=0;e{const t=(0,I.t)(s,[e,e],[n-e,1]),u=Ln(t),l=(0,I.t)(s,[e,e],[1,1]),c=(0,On.a)((0,Te.p)(l,0),Nn([[-1]]),Nn([[1]])),p=(0,Ue.l)(l,(0,x.d)(c,u)),d=(0,ce.h)(t,p);i=1===d.shape[0]?(0,L.d)(o):(0,w.z)([o,(0,I.t)(d,[1,0],[d.shape[0]-1,d.shape[1]])],0);const h=(0,Pe.W)((0,ce.h)((0,v.O)(c,p),u)),m=(0,I.t)(s,[e,0],[n-e,r]),f=(0,x.d)(h,i),g=(0,zn.p)(i);if(0===e)s=(0,Ue.l)(m,(0,v.O)(f,(0,v.O)(g,m)));else{const t=(0,Ue.l)(m,(0,v.O)(f,(0,v.O)(g,m)));s=(0,w.z)([(0,I.t)(s,[0,0],[e,r]),t],0)}const y=(0,zn.p)(f),b=(0,I.t)(a,[0,e],[n,a.shape[1]-e]);if(0===e)a=(0,Ue.l)(b,(0,v.O)((0,v.O)(b,i),y));else{const t=(0,Ue.l)(b,(0,v.O)((0,v.O)(b,i),y));a=(0,w.z)([(0,I.t)(a,[0,0],[n,e]),t],1)}return[i,s,a]})),(0,wr.B9)([t,u,l])}return!t&&n>r&&(a=(0,I.t)(a,[0,0],[n,r]),s=(0,I.t)(s,[0,0],[r,r])),[a,s]}))}const xr=(0,N.op)({qr_:function(e,t=!1){if((0,M.hu)(e.rank>=2,(()=>`qr() requires input tensor to have a rank >= 2, but got rank ${e.rank}`)),2===e.rank)return vr(e,t);{const n=e.shape.slice(0,e.shape.length-2).reduce(((e,t)=>e*t)),r=(0,Dn.H)((0,Y.X)(e,[n,e.shape[e.shape.length-2],e.shape[e.shape.length-1]]),0),a=[],s=[];r.forEach((e=>{const[n,r]=vr(e,t);a.push(n),s.push(r)}));return[(0,Y.X)((0,gn.k)(a,0),e.shape),(0,Y.X)((0,gn.k)(s,0),e.shape)]}}});var Nr=n(9876);const Sr=(0,N.op)({computeWeightedLoss_:function(e,t,n=Nr.I.SUM_BY_NONZERO_WEIGHTS){const r=(0,k._1)(e,"losses","computeWeightedLoss");let a=null;null!=t&&(a=(0,k._1)(t,"weights","computeWeightedLoss"));const s=null==a?r:(0,x.d)(r,a);if(n===Nr.I.NONE)return s;if(n===Nr.I.SUM)return(0,je.S)(s);if(n===Nr.I.MEAN){if(null==a)return(0,at.J)(s);{const e=r.size/a.size,t=(0,ce.h)((0,je.S)(s),(0,je.S)(a));return e>1?(0,ce.h)(t,(0,Xt.i)(e)):t}}if(n===Nr.I.SUM_BY_NONZERO_WEIGHTS){if(null==a)return(0,ce.h)((0,je.S)(s),(0,Xt.i)(r.size));{const e=(0,x.d)(a,(0,st.i)(r.shape)),t=(0,R.p)((0,je.S)((0,gt.Q)(e,(0,Xt.i)(0))),"float32");return(0,ce.h)((0,je.S)(s),t)}}throw Error(`Unknown reduction: ${n}`)}});const Ir=(0,N.op)({absoluteDifference_:function(e,t,n,a=Nr.I.SUM_BY_NONZERO_WEIGHTS){const s=(0,k._1)(e,"labels","absoluteDifference"),o=(0,k._1)(t,"predictions","absoluteDifference");let i=null;null!=n&&(i=(0,k._1)(n,"weights","absoluteDifference")),(0,M.k5)(s.shape,o.shape,"Error in absoluteDifference: ");const u=(0,r.W)((0,Ue.l)(s,o));return Sr(u,i,a)}});const Tr=(0,N.op)({cosineDistance_:function(e,t,n,r,a=Nr.I.SUM_BY_NONZERO_WEIGHTS){const s=(0,k._1)(e,"labels","cosineDistance"),o=(0,k._1)(t,"predictions","cosineDistance");let i=null;null!=r&&(i=(0,k._1)(r,"weights","cosineDistance")),(0,M.k5)(s.shape,o.shape,"Error in cosineDistance: ");const u=(0,Xt.i)(1),l=(0,Ue.l)(u,(0,je.S)((0,x.d)(s,o),n,!0));return Sr(l,i,a)}});const _r=(0,N.op)({hingeLoss_:function(e,t,n,r=Nr.I.SUM_BY_NONZERO_WEIGHTS){let a=(0,k._1)(e,"labels","hingeLoss");const s=(0,k._1)(t,"predictions","hingeLoss");let o=null;null!=n&&(o=(0,k._1)(n,"weights","hingeLoss")),(0,M.k5)(a.shape,s.shape,"Error in hingeLoss: ");const i=(0,Xt.i)(1);a=(0,Ue.l)((0,x.d)((0,Xt.i)(2),a),i);const u=(0,Pt.U)((0,Ue.l)(i,(0,x.d)(a,s)));return Sr(u,o,r)}});const Er=(0,N.op)({huberLoss_:function(e,t,n,a=1,s=Nr.I.SUM_BY_NONZERO_WEIGHTS){const i=(0,k._1)(e,"labels","huberLoss"),u=(0,k._1)(t,"predictions","huberLoss");let l=null;null!=n&&(l=(0,k._1)(n,"weights","huberLoss")),(0,M.k5)(i.shape,u.shape,"Error in huberLoss: ");const c=(0,Xt.i)(a),p=(0,r.W)((0,Ue.l)(u,i)),d=(0,lt.L)(p,c),h=(0,Ue.l)(p,d),m=(0,o.I)((0,x.d)((0,Xt.i)(.5),(0,dt.h)(d)),(0,x.d)(c,h));return Sr(m,l,s)}});const Ar=(0,N.op)({logLoss_:function(e,t,n,r=1e-7,a=Nr.I.SUM_BY_NONZERO_WEIGHTS){const s=(0,k._1)(e,"labels","logLoss"),i=(0,k._1)(t,"predictions","logLoss");let u=null;null!=n&&(u=(0,k._1)(n,"weights","logLoss")),(0,M.k5)(s.shape,i.shape,"Error in logLoss: ");const l=(0,Xt.i)(1),c=(0,Xt.i)(r),p=(0,Pe.W)((0,x.d)(s,(0,Ve.c)((0,o.I)(i,c)))),d=(0,x.d)((0,Ue.l)(l,s),(0,Ve.c)((0,o.I)((0,Ue.l)(l,i),c))),h=(0,Ue.l)(p,d);return Sr(h,u,a)}});const Mr=(0,N.op)({meanSquaredError_:function(e,t,n,r=Nr.I.SUM_BY_NONZERO_WEIGHTS){const a=(0,k._1)(e,"labels","meanSquaredError"),s=(0,k._1)(t,"predictions","meanSquaredError");let o=null;null!=n&&(o=(0,k._1)(n,"weights","meanSquaredError")),(0,M.k5)(a.shape,s.shape,"Error in meanSquaredError: ");const i=(0,mn.$)(a,s);return Sr(i,o,r)}});const $r=(0,N.op)({sigmoidCrossEntropy_:function(e,t,n,a=0,s=Nr.I.SUM_BY_NONZERO_WEIGHTS){let i=(0,k._1)(e,"multiClassLabels","sigmoidCrossEntropy");const u=(0,k._1)(t,"logits","sigmoidCrossEntropy");let l=null;if(null!=n&&(l=(0,k._1)(n,"weights","sigmoidCrossEntropy")),(0,M.k5)(i.shape,u.shape,"Error in sigmoidCrossEntropy: "),a>0){const e=(0,Xt.i)(a),t=(0,Xt.i)(1),n=(0,Xt.i)(.5);i=(0,o.I)((0,x.d)(i,(0,Ue.l)(t,e)),(0,x.d)(n,e))}const c=function(e,t){const n=(0,k._1)(e,"labels","sigmoidCrossEntropyWithLogits"),a=(0,k._1)(t,"logits","sigmoidCrossEntropyWithLogits");(0,M.k5)(n.shape,a.shape,"Error in sigmoidCrossEntropyWithLogits: ");const s=(0,Pt.U)(a),i=(0,x.d)(a,n),u=(0,Re.K)((0,ye.Q)((0,Pe.W)((0,r.W)(a))));return(0,o.I)((0,Ue.l)(s,i),u)}(i,u);return Sr(c,l,s)}});const Dr=(0,N.op)({softmaxCrossEntropy_:function(e,t,n,r=0,a=Nr.I.SUM_BY_NONZERO_WEIGHTS){let s=(0,k._1)(e,"onehotLabels","softmaxCrossEntropy");const i=(0,k._1)(t,"logits","softmaxCrossEntropy");let u=null;if(null!=n&&(u=(0,k._1)(n,"weights","softmaxCrossEntropy")),(0,M.k5)(s.shape,i.shape,"Error in softmaxCrossEntropy: "),r>0){const e=(0,Xt.i)(r),t=(0,Xt.i)(1),n=(0,Xt.i)(s.shape[1]);s=(0,o.I)((0,x.d)(s,(0,Ue.l)(t,e)),(0,ce.h)(e,n))}const l=function(e,t,n=-1){if(-1===n&&(n=t.rank-1),n!==t.rank-1)throw Error(`Softmax cross entropy along a non-last dimension is not yet supported. Labels / logits was rank ${t.rank} and dim was ${n}`);return(0,ze.cb)(((e,t,r)=>{const a=Ke(t,[n],!0),s=(0,Ue.l)((0,R.p)(t,"float32"),a);r([e,s]);const o=(0,Pe.W)((0,x.d)(s,e));return{value:(0,je.S)(o,[n]),gradFunc:(e,t)=>{const[r,a]=t,s=(0,qe.rv)(e.shape,[n]);return[(0,x.d)((0,Y.X)(e,s),(0,Ue.l)((0,R.p)(r,"float32"),(0,ye.Q)(a))),(0,x.d)((0,Y.X)(e,s),(0,Ue.l)((0,ye.Q)(a),(0,R.p)(r,"float32")))]}}}))(e,t)}(s,i);return Sr(l,u,a)}});const Fr=(0,N.op)({sparseFillEmptyRows_:function(e,t,n,r){const a=(0,k._1)(e,"indices","sparseFillEmptyRows"),s=(0,k._1)(t,"values","sparseFillEmptyRows"),o=(0,k._1)(n,"denseShape","sparseFillEmptyRows"),i=(0,k._1)(r,"defaultValue","sparseFillEmptyRows",s.dtype);if(2!==a.rank)throw new Error(`Indices should be Tensor2D but received shape\n ${a.shape}`);if(1!==s.rank)throw new Error(`Values should be Tensor1D but received shape ${s.shape}`);if(1!==o.rank)throw new Error(`Dense shape should be Tensor1D but received shape ${o.shape}`);if(0!==i.rank)throw new Error(`Default value should be a scalar but received shape ${i.shape}`);const u={indices:a,values:s,denseShape:o,defaultValue:i},l=J.BV.runKernel(Q.O3,u);return{outputIndices:l[0],outputValues:l[1],emptyRowIndicator:l[2],reverseIndexMap:l[3]}}});const Or=(0,N.op)({sparseReshape_:function(e,t,n){const r=(0,k._1)(e,"inputIndices","sparseReshape"),a=(0,k._1)(t,"inputShape","sparseReshape"),s=(0,k._1)(n,"newShape","sparseReshape");if(2!==r.rank)throw new Error(`Input indices should be Tensor2D but received shape\n ${r.shape}`);if(1!==a.rank)throw new Error(`Input shape should be Tensor1D but received shape ${a.shape}`);if(1!==s.rank)throw new Error(`New shape should be Tensor1D but received shape ${s.shape}`);const o={inputIndices:r,inputShape:a,newShape:s},i=J.BV.runKernel(Q.nh,o);return{outputIndices:i[0],outputShape:i[1]}}});const Br=(0,N.op)({sparseSegmentMean_:function(e,t,n){const r=(0,k._1)(e,"data","sparseSegmentMean"),a=(0,k._1)(t,"indices","sparseSegmentMean"),s=(0,k._1)(n,"segmentIds","sparseSegmentMean");if(r.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==a.rank)throw new Error(`Indices should be Tensor1D but received shape\n ${a.shape}`);if(1!==s.rank)throw new Error(`Segment ids should be Tensor1D but received shape\n ${s.shape}`);const o={data:r,indices:a,segmentIds:s};return J.BV.runKernel(Q.YW,o)}});const Cr=(0,N.op)({sparseSegmentSum_:function(e,t,n){const r=(0,k._1)(e,"data","sparseSegmentSum"),a=(0,k._1)(t,"indices","sparseSegmentSum"),s=(0,k._1)(n,"segmentIds","sparseSegmentSum");if(r.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(1!==a.rank)throw new Error(`Indices should be Tensor1D but received shape\n ${a.shape}`);if(1!==s.rank)throw new Error(`Segment ids should be Tensor1D but received shape\n ${s.shape}`);const o={data:r,indices:a,segmentIds:s};return J.BV.runKernel(Q.Zj,o)}});const Vr=(0,N.op)({stringNGrams_:function(e,t,n,r,a,s,o,i){const u=(0,k._1)(e,"data","stringNGrams","string");if("string"!==u.dtype)throw new Error("Data must be of datatype string");if(1!==u.shape.length)throw new Error(`Data must be a vector, saw: ${u.shape}`);const l=(0,k._1)(t,"dataSplits","stringNGrams");if("int32"!==l.dtype)throw new Error("Data splits must be of datatype int32");const c={separator:n,nGramWidths:r,leftPad:a,rightPad:s,padWidth:o,preserveShortSequences:i},p={data:u,dataSplits:l},d=J.BV.runKernel(Q._J,p,c);return{nGrams:d[0],nGramsSplits:d[1]}}});const Rr=(0,N.op)({stringSplit_:function(e,t,n=!0){const r=(0,k._1)(e,"input","stringSplit","string"),a=(0,k._1)(t,"delimiter","stringSplit","string");if(1!==r.rank)throw new Error(`Input should be Tensor1D but received shape ${r.shape}`);if(0!==a.rank)throw new Error(`Delimiter should be a scalar but received shape ${a.shape}`);const s={skipEmpty:n},o={input:r,delimiter:a},i=J.BV.runKernel(Q.s1,o,s);return{indices:i[0],values:i[1],shape:i[2]}}});const zr=(0,N.op)({stringToHashBucketFast_:function(e,t){const n=(0,k._1)(e,"input","stringToHashBucketFast","string"),r={numBuckets:t};if(t<=0)throw new Error("Number of buckets must be at least 1");const a={input:n};return J.BV.runKernel(Q.Xk,a,r)}}),Pr={fft:un.k,ifft:ln.S,rfft:pn.Q,irfft:cn.w},Lr={hammingWindow:Qn,hannWindow:Yn,frame:er,stft:tr},Wr={flipLeftRight:rr,grayscaleToRGB:ar,resizeNearestNeighbor:fr,resizeBilinear:mr,rotateWithOffset:sr,cropAndResize:nr,nonMaxSuppression:ir,nonMaxSuppressionAsync:lr,nonMaxSuppressionWithScore:cr,nonMaxSuppressionWithScoreAsync:pr,nonMaxSuppressionPadded:dr,nonMaxSuppressionPaddedAsync:hr,threshold:gr,transform:yr},Hr={bandPart:br,gramSchmidt:kr,qr:xr},qr={absoluteDifference:Ir,computeWeightedLoss:Sr,cosineDistance:Tr,hingeLoss:_r,huberLoss:Er,logLoss:Ar,meanSquaredError:Mr,sigmoidCrossEntropy:$r,softmaxCrossEntropy:Dr},Gr={sparseFillEmptyRows:Fr,sparseReshape:Or,sparseSegmentMean:Br,sparseSegmentSum:Cr},Ur={stringNGrams:Vr,stringSplit:Rr,stringToHashBucketFast:zr}},9682:(e,t,n)=>{"use strict";n.d(t,{v:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({pad_:function(e,t,n=0){const o=(0,s._1)(e,"x","pad");if(0===o.rank)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");const i={paddings:t,constantValue:n},u={x:o};return r.BV.runKernel(a.ly,u,i)}})},3453:(e,t,n)=>{"use strict";n.d(t,{s:()=>i});var r=n(7097),a=n(9121),s=n(747),o=n(3740);const i=(0,n(2668).op)({pow_:function(e,t){let n=(0,o._1)(e,"base","pow"),i=(0,o._1)(t,"exp","pow");[n,i]=(0,s.makeTypesMatch)(n,i);const u={a:n,b:i};return r.BV.runKernel(a.pe,u)}})},8151:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({prelu_:function(e,t){const n={x:(0,s._1)(e,"x","prelu"),alpha:(0,s._1)(t,"alpha","prelu")};return r.BV.runKernel(a.o0,n)}})},9798:(e,t,n)=>{"use strict";function r(e,t=!1){console.log(e.toString(t))}n.d(t,{S:()=>r})},9451:(e,t,n)=>{"use strict";n.d(t,{W:()=>i});var r=n(7097),a=n(9121),s=n(3740),o=n(2271);const i=(0,n(2668).op)({prod_:function(e,t=null,n=!1){let i=(0,s._1)(e,"x","prod");"bool"===i.dtype&&(i=(0,o.p)(i,"int32"));const u={x:i},l={axis:t,keepDims:n};return r.BV.runKernel(a.Dl,u,l)}})},6845:(e,t,n)=>{"use strict";n.d(t,{Yi:()=>a,T9:()=>s,wv:()=>o});var r=n(6377);class a{constructor(e,t,n,a,s){this.mean=e,this.stdDev=t,this.dtype=n,this.nextVal=NaN,this.truncated=a,this.truncated&&(this.upper=this.mean+2*this.stdDev,this.lower=this.mean-2*this.stdDev);const o=s||Math.random();this.random=r.alea(o.toString())}nextValue(){if(!isNaN(this.nextVal)){const e=this.nextVal;return this.nextVal=NaN,e}let e,t,n=!1;for(;!n;){let r,a,s;do{r=2*this.random()-1,a=2*this.random()-1,s=r*r+a*a}while(s>=1||0===s);const o=Math.sqrt(-2*Math.log(s)/s);e=this.mean+this.stdDev*r*o,t=this.mean+this.stdDev*a*o,this.truncated&&!this.isValidTruncated(e)||(n=!0)}return this.truncated&&!this.isValidTruncated(t)||(this.nextVal=this.convertValue(t)),this.convertValue(e)}convertValue(e){return null==this.dtype||"float32"===this.dtype?e:Math.round(e)}isValidTruncated(e){return e<=this.upper&&e>=this.lower}}class s{constructor(e,t,n,s){this.alpha=e,this.beta=1/t,this.dtype=n;const o=s||Math.random();this.randu=r.alea(o.toString()),this.randn=new a(0,1,n,!1,this.randu()),this.d=e<1?e+2/3:e-1/3,this.c=1/Math.sqrt(9*this.d)}nextValue(){let e,t,n,r,a,s;for(;;){do{r=this.randn.nextValue(),s=1+this.c*r}while(s<=0);if(s*=s*s,e=r*r,t=1-.331*e*e,n=.5*e+this.d*(1-s+Math.log(s)),a=this.randu(),anull==this.dtype||"float32"===this.dtype,this.min=e,this.range=t-e,this.dtype=n,null==a&&(a=Math.random()),"number"==typeof a&&(a=a.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error(`The difference between ${e} - ${t} <= 1 and dtype is not float`);this.random=r.alea(a)}convertValue(e){return this.canReturnFloat()?e:Math.round(e)}nextValue(){return this.convertValue(this.min+this.range*this.random())}}},5002:(e,t,n)=>{"use strict";n.d(t,{L:()=>o});var r=n(2657),a=n(2668),s=n(6845);const o=(0,a.op)({randomUniform_:function(e,t=0,n=1,a="float32",o){const i=(0,r.f)(e,a),u=new s.wv(t,n,null,o);for(let e=0;e{"use strict";n.d(t,{w:()=>s});var r=n(7097),a=n(9121);function s(e,t,n=1,s="float32"){if(0===n)throw new Error("Cannot have a step of zero");const o={start:e,stop:t,step:n,dtype:s};return r.BV.runKernel(a.e6,{},o)}},766:(e,t,n)=>{"use strict";n.d(t,{k:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({real_:function(e){const t={input:(0,s._1)(e,"input","real")};return r.BV.runKernel(a.xJ,t)}})},9036:(e,t,n)=>{"use strict";n.d(t,{M:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({reciprocal_:function(e){const t={x:(0,s._1)(e,"x","reciprocal")};return r.BV.runKernel(a.$H,t)}})},7409:(e,t,n)=>{"use strict";n.d(t,{U:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({relu_:function(e){const t={x:(0,s._1)(e,"x","relu")};return r.BV.runKernel(a.qk,t)}})},3582:(e,t,n)=>{"use strict";n.d(t,{b:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({relu6_:function(e){const t={x:(0,s._1)(e,"x","relu6")};return r.BV.runKernel(a.Sb,t)}})},4968:(e,t,n)=>{"use strict";n.d(t,{X:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({reshape_:function(e,t){const n={x:(0,s._1)(e,"x","reshape","string_or_numeric")},o={shape:t};return r.BV.runKernel(a.HZ,n,o)}})},7486:(e,t,n)=>{"use strict";n.d(t,{G:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({reverse_:function(e,t){const n={x:(0,s._1)(e,"x","reverse")},o={dims:t};return r.BV.runKernel(a.mK,n,o)}})},7809:(e,t,n)=>{"use strict";n.d(t,{N:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({round_:function(e){const t={x:(0,s._1)(e,"x","round")};return r.BV.runKernel(a.e0,t)}})},2634:(e,t,n)=>{"use strict";n.d(t,{b:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({rsqrt_:function(e){const t={x:(0,s._1)(e,"x","rsqrt")};return r.BV.runKernel(a.bV,t)}})},9494:(e,t,n)=>{"use strict";n.d(t,{i:()=>s});var r=n(569),a=n(7852);function s(e,t){if(((0,r.fU)(e)&&"string"!==t||Array.isArray(e))&&"complex64"!==t)throw new Error("Error creating a new Scalar: value must be a primitive (number|boolean|string)");if("string"===t&&(0,r.fU)(e)&&!(e instanceof Uint8Array))throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`.");return(0,a.H)(e,[],[],t)}},3100:(e,t,n)=>{"use strict";n.d(t,{s:()=>u});var r=n(7097),a=n(9121),s=n(3740),o=n(2668),i=n(3028);const u=(0,o.op)({scatterND_:function(e,t,n){const o=(0,s._1)(e,"indices","scatterND","int32"),u=(0,s._1)(t,"updates","scatterND");i.validateInput(u,o,n);const l={indices:o,updates:u},c={shape:n};return r.BV.runKernel(a.xQ,l,c)}})},3028:(e,t,n)=>{"use strict";n.r(t),n.d(t,{validateUpdateShape:()=>a,validateInput:()=>s,calculateShapes:()=>o});var r=n(569);function a(e,t,n){const r=t.rank>1?t.shape[t.rank-1]:1,a=t.rank>1?t.rank-1:1,s=`Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: ${n.shape}, indices.shape: ${t.shape}, shape: ${e}, sliceDim: ${r}, and batchDim: ${a}.`;if(n.rank1?t.shape[a-1]:1,o=n.length;let i=1;for(let e=s;e{"use strict";n.d(t,{U:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({selu_:function(e){const t={x:(0,s._1)(e,"x","selu")};return r.BV.runKernel(a.oF,t)}})},6567:(e,t,n)=>{"use strict";n.d(t,{O:()=>o});var r=n(4077),a=n(3740),s=n(569);const o=async function(e,t){const n=(0,a._1)(e,"x","setdiff1d"),o=(0,a._1)(t,"y","setdiff1d");s.hu(n.dtype===o.dtype,(()=>`x and y should have the same dtype, but got x (${n.dtype}) and y (${o.dtype}).`)),s.hu(1===n.rank,(()=>`x should be 1D tensor, but got x (${n.shape}).`)),s.hu(1===o.rank,(()=>`y should be 1D tensor, but got y (${o.shape}).`));const i=await n.data(),u=await o.data(),l=new Set(u);let c=0;for(let e=0;e{"use strict";n.d(t,{X:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({sigmoid_:function(e){const t={x:(0,s._1)(e,"x","sigmoid")};return r.BV.runKernel(a.a5,t)}})},4434:(e,t,n)=>{"use strict";n.d(t,{X:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({sign_:function(e){const t={x:(0,s._1)(e,"x","sign")};return r.BV.runKernel(a.i5,t)}})},9331:(e,t,n)=>{"use strict";n.d(t,{O:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({sin_:function(e){const t={x:(0,s._1)(e,"x","sin")};return r.BV.runKernel(a.RQ,t)}})},3254:(e,t,n)=>{"use strict";n.d(t,{R:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({sinh_:function(e){const t={x:(0,s._1)(e,"x","sinh")};return r.BV.runKernel(a.w3,t)}})},2676:(e,t,n)=>{"use strict";n.d(t,{t:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({slice_:function(e,t,n){const o=(0,s._1)(e,"x","slice","string_or_numeric");if(0===o.rank)throw new Error("Slicing scalar is not possible");const i={x:o},u={begin:t,size:n};return r.BV.runKernel(a.p2,i,u)}})},682:(e,t,n)=>{"use strict";n.d(t,{X:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({softmax_:function(e,t=-1){const n=(0,s._1)(e,"logits","softmax","float32");if(-1===t&&(t=n.rank-1),t!==n.rank-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and dim was ${t}`);const o={logits:n},i={dim:t};return r.BV.runKernel(a.Gc,o,i)}})},3694:(e,t,n)=>{"use strict";n.d(t,{W:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({softplus_:function(e){const t={x:(0,s._1)(e,"x","softplus")};return r.BV.runKernel(a.MR,t)}})},7918:(e,t,n)=>{"use strict";n.d(t,{f:()=>i});var r=n(7097),a=n(9121),s=n(3740),o=n(569);const i=(0,n(2668).op)({spaceToBatchND_:function(e,t,n){const i=(0,s._1)(e,"x","spaceToBatchND");o.hu(i.rank>=1+t.length,(()=>`input rank ${i.rank} should be > than [blockShape] ${t.length}`)),o.hu(n.length===t.length,(()=>`paddings.shape[0] ${n.length} must be equal to [blockShape] ${t.length}`)),o.hu(i.shape.reduce(((e,r,a)=>a>0&&a<=t.length?e&&(r+n[a-1][0]+n[a-1][1])%t[a-1]==0:e),!0),(()=>`input spatial dimensions ${i.shape.slice(1)} with paddings ${n.toString()} must be divisible by blockShapes ${t.toString()}`));const u={x:i},l={blockShape:t,paddings:n};return r.BV.runKernel(a.TQ,u,l)}})},9758:(e,t,n)=>{"use strict";n.d(t,{e:()=>o});var r=n(7097),a=n(9121);var s=n(3740);const o=(0,n(2668).op)({sparseToDense_:function(e,t,n,o=0){const i=(0,s._1)(e,"sparseIndices","sparseToDense","int32"),u=(0,s._1)(t,"sparseValues","sparseToDense"),l=(0,s._1)(o,"defaultValue","sparseToDense",u.dtype);!function(e,t,n,r){if("int32"!==e.dtype)throw new Error(`tf.sparseToDense() expects the indices to be int32 type, but the dtype was ${e.dtype}.`);if(e.rank>2)throw new Error(`sparseIndices should be a scalar, vector, or matrix, but got shape ${e.shape}.`);const a=e.rank>0?e.shape[0]:1,s=e.rank>1?e.shape[1]:1;if(n.length!==s)throw new Error(`outputShape has incorrect number of elements:, ${n.length}, should be: ${s}.`);const o=t.size;if(0!==t.rank&&(1!==t.rank||o!==a))throw new Error(`sparseValues has incorrect shape ${t.shape}, should be [] or [${a}]`);if(t.dtype!==r.dtype)throw new Error("sparseValues.dtype must match defaultValues.dtype")}(i,u,n,l);const c={sparseIndices:i,sparseValues:u,defaultValue:l},p={outputShape:n};return r.BV.runKernel(a.D2,c,p)}})},7020:(e,t,n)=>{"use strict";n.d(t,{k:()=>o});var r=n(7097),a=n(9121),s=n(569);const o=(0,n(2668).op)({fft_:function(e){(0,s.hu)("complex64"===e.dtype,(()=>`The dtype for tf.spectral.fft() must be complex64 but got ${e.dtype}.`));const t={input:e};return r.BV.runKernel(a.vw,t)}})},8447:(e,t,n)=>{"use strict";n.d(t,{S:()=>o});var r=n(7097),a=n(9121),s=n(569);const o=(0,n(2668).op)({ifft_:function(e){(0,s.hu)("complex64"===e.dtype,(()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${e.dtype}.`));const t={input:e};return r.BV.runKernel(a.Qg,t)}})},4415:(e,t,n)=>{"use strict";n.d(t,{w:()=>m});var r=n(1661),a=n(6884),s=n(4386),o=n(4841),i=n(2668),u=n(766),l=n(4968),c=n(7486),p=n(9494),d=n(2676),h=n(8447);const m=(0,i.op)({irfft_:function(e){const t=e.shape[e.shape.length-1],n=e.size/t;let i;if(t<=2){const r=(0,l.X)(e,[n,t]);i=(0,h.S)(r)}else{const m=[n,2*(t-1)],f=(0,l.X)((0,u.k)(e),[n,t]),g=(0,l.X)((0,s.a)(e),[n,t]),y=(0,c.G)((0,d.t)(f,[0,1],[n,t-2]),1),b=(0,o.d)((0,c.G)((0,d.t)(g,[0,1],[n,t-2]),1),(0,p.i)(-1)),k=(0,a.z)([f,y],1),w=(0,a.z)([g,b],1),v=(0,l.X)((0,r.P)(k,w),[m[0],m[1]]);i=(0,h.S)(v)}if(i=(0,u.k)(i),3===e.rank&&0!==e.shape[0]){const t=i,n=e.shape[0];i=(0,l.X)(i,[n,i.shape[0]/n,i.shape[1]]),t.dispose()}return i}})},3710:(e,t,n)=>{"use strict";n.d(t,{Q:()=>f});var r=n(569),a=n(1661),s=n(6884),o=n(4386),i=n(2668),u=n(766),l=n(4968),c=n(2676),p=n(8644),d=n(9640),h=n(6577),m=n(7020);const f=(0,i.op)({rfft_:function(e,t){(0,r.hu)("float32"===e.dtype,(()=>`The dtype for rfft() must be real value but got ${e.dtype}`));let n=e.shape[e.shape.length-1];const i=e.size/n;let f;if(null!=t&&t0)),a=e.shape.map((e=>e));a[e.shape.length-1]=t,f=(0,c.t)(e,r,a),n=t}else if(null!=t&&t>n){const r=e.shape.map((e=>e));r[e.shape.length-1]=t-n,f=(0,s.z)([e,(0,d.l)(r)],e.shape.length-1),n=t}else f=e;const g=(0,h.P)(f),y=(0,l.X)((0,a.P)(f,g),[i,n]),b=(0,m.k)(y),k=Math.floor(n/2)+1,w=(0,u.k)(b),v=(0,o.a)(b),x=(0,p.V)(w,[k,n-k],w.shape.length-1),N=(0,p.V)(v,[k,n-k],v.shape.length-1),S=f.shape.slice();return S[f.shape.length-1]=k,(0,l.X)((0,a.P)(x[0],N[0]),S)}})},8644:(e,t,n)=>{"use strict";n.d(t,{V:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({split_:function(e,t,n=0){const o={x:(0,s._1)(e,"x","split")},i={numOrSizeSplits:t,axis:n};return r.BV.runKernel(a.L8,o,i)}})},3261:(e,t,n)=>{"use strict";n.d(t,{_:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({sqrt_:function(e){const t={x:(0,s._1)(e,"x","sqrt")};return r.BV.runKernel(a.FK,t)}})},248:(e,t,n)=>{"use strict";n.d(t,{h:()=>s});var r=n(7097),a=n(3740);const s=(0,n(2668).op)({square_:function(e){const t=(0,a._1)(e,"x","square");return r.BV.runKernel("Square",{x:t},{})}})},5265:(e,t,n)=>{"use strict";n.d(t,{$:()=>u});var r=n(7097),a=n(9121),s=n(747),o=n(3740),i=n(2200);const u=(0,n(2668).op)({squaredDifference_:function(e,t){let n=(0,o._1)(e,"a","squaredDifference"),u=(0,o._1)(t,"b","squaredDifference");[n,u]=(0,s.makeTypesMatch)(n,u),(0,i.$N)(n.shape,u.shape);const l={a:n,b:u};return r.BV.runKernel(a._t,l,{})}})},9590:(e,t,n)=>{"use strict";n.d(t,{L:()=>i});var r=n(3740),a=n(569),s=n(2668),o=n(4968);const i=(0,s.op)({squeeze_:function(e,t){const n=(0,r._1)(e,"x","squeeze");return(0,o.X)(n,(0,a.bp)(n.shape,t).newShape)}})},2991:(e,t,n)=>{"use strict";n.d(t,{k:()=>i});var r=n(7097),a=n(9121),s=n(3740),o=n(569);const i=(0,n(2668).op)({stack_:function(e,t=0){const n=(0,s.sI)(e,"tensors","stack","string_or_numeric");o.hu(n.length>=1,(()=>"Pass at least one tensor to tf.stack")),n.length>0&&o.hu(t<=n[0].rank,(()=>"Axis must be <= rank of the tensor"));const i=n,u={axis:t};return r.BV.runKernel(a.Qi,i,u)}})},1901:(e,t,n)=>{"use strict";n.d(t,{N:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({step_:function(e,t=0){const n={x:(0,s._1)(e,"x","step")},o={alpha:t};return r.BV.runKernel(a.h8,n,o)}})},5158:(e,t,n)=>{"use strict";n.d(t,{N:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({stridedSlice_:function(e,t,n,o,i=0,u=0,l=0,c=0,p=0){const d={x:(0,s._1)(e,"x","stridedSlice","string_or_numeric")},h={begin:t,end:n,strides:o,beginMask:i,endMask:u,ellipsisMask:l,newAxisMask:c,shrinkAxisMask:p};return r.BV.runKernel(a.m2,d,h)}})},827:(e,t,n)=>{"use strict";n.d(t,{l:()=>i});var r=n(7097),a=n(9121),s=n(747),o=n(3740);const i=(0,n(2668).op)({sub_:function(e,t){let n=(0,o._1)(e,"a","sub"),i=(0,o._1)(t,"b","sub");[n,i]=(0,s.makeTypesMatch)(n,i);const u={a:n,b:i};return r.BV.runKernel(a.Tr,u)}})},5475:(e,t,n)=>{"use strict";n.d(t,{S:()=>i});var r=n(7097),a=n(9121),s=n(3740),o=n(2271);const i=(0,n(2668).op)({sum_:function(e,t=null,n=!1){let i=(0,s._1)(e,"x","sum");"bool"===i.dtype&&(i=(0,o.p)(i,"int32"));const u={x:i},l={axis:t,keepDims:n};return r.BV.runKernel(a.GB,u,l)}})},1173:(e,t,n)=>{"use strict";n.d(t,{O:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({tan_:function(e){const t={x:(0,s._1)(e,"x","tan")};return r.BV.runKernel(a.sE,t)}})},1869:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({tanh_:function(e){const t={x:(0,s._1)(e,"x","tanh")};return r.BV.runKernel(a.MI,t)}})},701:(e,t,n)=>{"use strict";n.d(t,{X:()=>s});var r=n(3740),a=n(7852);function s(e,t,n){const s=(0,r.C)(e,n);return(0,a.H)(e,t,s,n)}},6092:(e,t,n)=>{"use strict";n.d(t,{R:()=>o});var r=n(3740),a=n(569),s=n(7852);function o(e,t){(0,a.Cq)(e);const n=(0,r.C)(e,t);if(1!==n.length)throw new Error("tensor1d() requires values to be a flat/TypedArray");return(0,s.H)(e,null,n,t)}},9906:(e,t,n)=>{"use strict";n.d(t,{w:()=>o});var r=n(3740),a=n(569),s=n(7852);function o(e,t,n){if((0,a.Cq)(e),null!=t&&3!==t.length)throw new Error("tensor3d() requires shape to have three numbers");const o=(0,r.C)(e,n);if(3!==o.length&&1!==o.length)throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray");if(1===o.length&&null==t)throw new Error("tensor3d() requires shape to be provided when `values` are a flat array");return(0,s.H)(e,t,o,n)}},7852:(e,t,n)=>{"use strict";n.d(t,{H:()=>o});var r=n(7097),a=n(569),s=n(9122);function o(e,t,n,o){if(null==o&&(o=(0,a.D2)(e)),"complex64"===o)throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(!(0,a.fU)(e)&&!Array.isArray(e)&&"number"!=typeof e&&"boolean"!=typeof e&&"string"!=typeof e)throw new Error("values passed to tensor(values) must be a number/boolean/string or an array of numbers/booleans/strings, or a TypedArray");if(null!=t){(0,a.Mu)(t);const e=(0,a.NA)(t),r=(0,a.NA)(n);(0,a.hu)(e===r,(()=>`Based on the provided shape, [${t}], the tensor should have ${e} values but has ${r}`));for(let e=0;e`Error creating a new Tensor. Inferred shape (${n}) does not match the provided shape (${t}). `))}}return(0,a.fU)(e)||Array.isArray(e)||(e=[e]),t=t||n,e="string"!==o?(0,s.toTypedArray)(e,o):(0,a.xH)(e,[],!0),r.BV.makeTensor(e,t,o)}},7501:(e,t,n)=>{"use strict";n.d(t,{G:()=>i});var r=n(7097),a=n(9121),s=n(3740),o=n(569);const i=(0,n(2668).op)({tile_:function(e,t){const n=(0,s._1)(e,"x","tile","string_or_numeric");o.hu(n.rank===t.length,(()=>`Error in transpose: rank of input ${n.rank} must match length of reps ${t}.`));const i={x:n},u={reps:t};return r.BV.runKernel(a.n9,i,u)}})},3243:(e,t,n)=>{"use strict";n.d(t,{h:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({topk_:function(e,t=1,n=!0){const o=(0,s._1)(e,"x","topk");if(0===o.rank)throw new Error("topk() expects the input to be of rank 1 or higher");const i=o.shape[o.shape.length-1];if(t<0)throw new Error(`'k' passed to topk() must be >= 0 but got ${t}`);if(t>i)throw new Error(`'k' passed to topk() must be <= the last dimension (${i}) but got ${t}`);const u={x:o},l={k:t,sorted:n},[c,p]=r.BV.runKernel(a.cW,u,l);return{values:c,indices:p}}})},9065:(e,t,n)=>{"use strict";n.d(t,{p:()=>i});var r=n(7097),a=n(9121),s=n(3740),o=n(569);const i=(0,n(2668).op)({transpose_:function(e,t){const n=(0,s._1)(e,"x","transpose");if(null==t&&(t=n.shape.map(((e,t)=>t)).reverse()),o.hu(n.rank===t.length,(()=>`Error in transpose: rank of input ${n.rank} must match length of perm ${t}.`)),t.forEach((e=>{o.hu(e>=0&&e"All entries in 'perm' must be between 0 and "+(n.rank-1)+` but got ${t}`))})),n.rank<=1)return n.clone();const i={x:n},u={perm:t};return r.BV.runKernel(a.G3,i,u)}})},3596:(e,t,n)=>{"use strict";n.d(t,{X:()=>o});var r=n(2657),a=n(2668),s=n(6845);const o=(0,a.op)({truncatedNormal_:function(e,t=0,n=1,a,o){if(null!=a&&"bool"===a)throw new Error("Unsupported data type $ { dtype }");const i=new s.Yi(t,n,a,!0,o),u=(0,r.f)(e,a);for(let e=0;e{"use strict";n.d(t,{T:()=>i});var r=n(7097),a=n(9121),s=n(3740),o=n(569);const i=(0,n(2668).op)({unique_:function(e,t=0){const n=(0,s._1)(e,"x","unique","string_or_numeric");(0,o.hu)(n.rank>0,(()=>"The input tensor must be at least 1D"));const i={x:n},u={axis:t},[l,c]=r.BV.runKernel(a.kp,i,u);return{values:l,indices:c}}})},4136:(e,t,n)=>{"use strict";n.d(t,{H:()=>i});var r=n(7097),a=n(9121),s=n(3740),o=n(569);const i=(0,n(2668).op)({unstack_:function(e,t=0){const n=(0,s._1)(e,"x","unstack","string_or_numeric");o.hu(t>=-n.shape.length&&t`Axis = ${t} is not in [-${n.shape.length}, ${n.shape.length})`));const i={value:n},u={axis:t};return r.BV.runKernel(a.To,i,u)}})},5912:(e,t,n)=>{"use strict";n.d(t,{a:()=>u});var r=n(7097),a=n(9121),s=n(3740),o=n(8247),i=n(2200);const u=(0,n(2668).op)({where_:function(e,t,n){const u=(0,s._1)(t,"a","where"),l=(0,s._1)(n,"b","where"),c=(0,s._1)(e,"condition","where","bool"),p=(0,i.$N)((0,i.$N)(c.shape,u.shape),l.shape),d={condition:(0,o.U)(c,p),t:(0,o.U)(u,p),e:(0,o.U)(l,p)};return r.BV.runKernel(a.Ph,d)}})},6380:(e,t,n)=>{"use strict";n.d(t,{i:()=>s});var r=n(8333),a=n(3740);const s=async function(e){const t=(0,a._1)(e,"condition","whereAsync","bool"),n=await t.data(),s=(0,r.Z)(t.shape,n);return e!==t&&t.dispose(),s}},9640:(e,t,n)=>{"use strict";n.d(t,{l:()=>o});var r=n(7097),a=n(569),s=n(1661);function o(e,t="float32"){if("complex64"===t){const t=o(e,"float32"),n=o(e,"float32");return(0,s.P)(t,n)}const n=(0,a.wT)((0,a.NA)(e),t);return r.BV.makeTensor(n,e,t)}},6577:(e,t,n)=>{"use strict";n.d(t,{P:()=>o});var r=n(7097),a=n(9121),s=n(3740);const o=(0,n(2668).op)({zerosLike_:function(e){const t={x:(0,s._1)(e,"x","zerosLike")};return r.BV.runKernel(a.Ru,t)}})},4077:(e,t,n)=>{"use strict";n.d(t,{es:()=>b,YD:()=>p,_w:()=>k,FZ:()=>y,Vp:()=>g,Vi:()=>f});var r=n(5938),a=n(569);function s(e,t,n,r){const s=(0,a.e3)(t),i=function(e,t,n,r){const s=(0,a.NA)(t),i=r[r.length-1],u=new Array(i).fill(0),c=t.length,p="complex64"===n?l(e):e;if(c>1)for(let e=0;e" "+e)).join("\n")),d.join("\n")}function o(e,t,n){let r;return r=Array.isArray(e)?`${parseFloat(e[0].toFixed(7))} + ${parseFloat(e[1].toFixed(7))}j`:(0,a.HD)(e)?`'${e}'`:"bool"===n?i(e):parseFloat(e.toFixed(7)).toString(),(0,a.oj)(r,t)}function i(e){return 0===e?"false":"true"}function u(e,t,n,r,a,s=!0){const c="complex64"===n?2:1,p=t[0],d=t.length;if(0===d){if("complex64"===n){return[o(l(e)[0],0,n)]}return"bool"===n?[i(e[0])]:[e[0].toString()]}if(1===d){if(p>20){const t=3*c;let r=Array.from(e.slice(0,t)),s=Array.from(e.slice((p-3)*c,p*c));return"complex64"===n&&(r=l(r),s=l(s)),["["+r.map(((e,t)=>o(e,a[t],n))).join(", ")+", ..., "+s.map(((e,t)=>o(e,a[p-3+t],n))).join(", ")+"]"]}return["["+("complex64"===n?l(e):Array.from(e)).map(((e,t)=>o(e,a[t],n))).join(", ")+"]"]}const h=t.slice(1),m=r.slice(1),f=r[0]*c,g=[];if(p>20){for(let t=0;t<3;t++){const r=t*f,s=r+f;g.push(...u(e.slice(r,s),h,n,m,a,!1))}g.push("...");for(let t=p-3;t`Length of values '${e}' does not match the size inferred by the shape '${this.size}'.`))}if("complex64"===t)throw new Error("complex64 dtype TensorBuffers are not supported. Please create a TensorBuffer for the real and imaginary parts separately and call tf.complex(real, imag).");this.values=n||a.rQ(t,this.size),this.strides=(0,a.e3)(e)}set(e,...t){0===t.length&&(t=[0]),a.hu(t.length===this.rank,(()=>`The number of provided coordinates (${t.length}) must match the rank (${this.rank})`));const n=this.locToIndex(t);this.values[n]=e}get(...e){0===e.length&&(e=[0]);let t=0;for(const n of e){if(n<0||n>=this.shape[t]){const t=`Requested out of range element at ${e}. Buffer shape=${this.shape}`;throw new Error(t)}t++}let n=e[e.length-1];for(let t=0;tc.decodeString(e)))}catch(e){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}}return e}dataSync(){this.throwIfDisposed();const e=d().readSync(this.dataId);if("string"===this.dtype)try{return e.map((e=>c.decodeString(e)))}catch(e){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}return e}async bytes(){this.throwIfDisposed();const e=await d().read(this.dataId);return"string"===this.dtype?e:new Uint8Array(e.buffer)}dispose(){this.isDisposed||(d().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(e=!1){return h.print(this,e)}clone(){return this.throwIfDisposed(),h.clone(this)}toString(e=!1){return s(this.dataSync(),this.shape,this.dtype,e)}cast(e){return this.throwIfDisposed(),h.cast(this,e)}variable(e=!0,t,n){return this.throwIfDisposed(),d().makeVariable(this,e,t,n)}}Object.defineProperty(b,Symbol.hasInstance,{value:e=>!!e&&null!=e.data&&null!=e.dataSync&&null!=e.throwIfDisposed}),(0,r.R)("Tensor",(()=>b));class k extends b{constructor(e,t,n,r){super(e.shape,e.dtype,e.dataId,r),this.trainable=t,this.name=n}assign(e){if(e.dtype!==this.dtype)throw new Error(`dtype of the new value (${e.dtype}) and previous value (${this.dtype}) must match`);if(!a.cO(e.shape,this.shape))throw new Error(`shape of the new value (${e.shape}) and previous value (${this.shape}) must match`);d().disposeTensor(this),this.dataId=e.dataId,d().incRef(this,null)}dispose(){d().disposeVariable(this),this.isDisposedInternal=!0}}Object.defineProperty(k,Symbol.hasInstance,{value:e=>e instanceof b&&null!=e.assign&&e.assign instanceof Function})},747:(e,t,n)=>{"use strict";n.r(t),n.d(t,{makeTypesMatch:()=>o,assertTypesMatch:()=>i,isTensorInList:()=>u,getTensorsInContainer:()=>l});var r=n(4077),a=n(1221),s=n(569);function o(e,t){if(e.dtype===t.dtype)return[e,t];const n=(0,a.x8)(e.dtype,t.dtype);return[e.cast(n),t.cast(n)]}function i(e,t){(0,s.hu)(e.dtype===t.dtype,(()=>`The dtypes of the first(${e.dtype}) and second(${t.dtype}) input must match`))}function u(e,t){return t.some((t=>t.id===e.id))}function l(e){const t=[];return c(e,t,new Set),t}function c(e,t,n){if(null==e)return;if(e instanceof r.es)return void t.push(e);if(a=e,!Array.isArray(a)&&"object"!=typeof a)return;var a;const s=e;for(const e in s){const r=s[e];n.has(r)||(n.add(r),c(r,t,n))}}},3740:(e,t,n)=>{"use strict";n.d(t,{C:()=>u,_1:()=>p,sI:()=>d});var r=n(7097),a=n(2885),s=n(4077),o=n(569),i=n(9122);function u(e,t){let n=e;if((0,o.fU)(e))return"string"===t?[]:[e.length];if(!Array.isArray(e))return[];const r=[];for(;Array.isArray(n)||(0,o.fU)(n)&&"string"!==t;)r.push(n.length),n=n[0];return Array.isArray(e)&&(0,a.OB)().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&l(e,r,[]),r}function l(e,t,n){if(n=n||[],!Array.isArray(e)&&!(0,o.fU)(e))return void(0,o.hu)(0===t.length,(()=>`Element arr[${n.join("][")}] is a primitive, but should be an array/TypedArray of ${t[0]} elements`));(0,o.hu)(t.length>0,(()=>`Element arr[${n.join("][")}] should be a primitive, but is an array of ${e.length} elements`)),(0,o.hu)(e.length===t[0],(()=>`Element arr[${n.join("][")}] should have ${t[0]} elements, but has ${e.length} elements`));const r=t.slice(1);for(let t=0;t=0&&(l=a),c(a,l,t,n),null==e||!(0,o.fU)(e)&&!Array.isArray(e)&&"number"!=typeof e&&"boolean"!=typeof e&&"string"!=typeof e){const r=null==e?"null":e.constructor.name;throw new Error(`Argument '${t}' passed to '${n}' must be a Tensor or TensorLike, but got '${r}'`)}const p=u(e,l);(0,o.fU)(e)||Array.isArray(e)||(e=[e]);const d="string"!==l?(0,i.toTypedArray)(e,l):(0,o.xH)(e,[],!0);return r.BV.makeTensor(d,p,l)}function d(e,t,n,r="numeric"){if(!Array.isArray(e))throw new Error(`Argument ${t} passed to ${n} must be a \`Tensor[]\` or \`TensorLike[]\``);return e.map(((e,a)=>p(e,`${t}[${a}]`,n,r)))}},1221:(e,t,n)=>{"use strict";var r,a,s,o,i;n.d(t,{yw:()=>r,x8:()=>l,z4:()=>c}),function(e){e.R0="R0",e.R1="R1",e.R2="R2",e.R3="R3",e.R4="R4",e.R5="R5",e.R6="R6"}(r||(r={})),function(e){e.float32="float32",e.int32="int32",e.bool="int32",e.complex64="complex64"}(a||(a={})),function(e){e.float32="float32",e.int32="int32",e.bool="bool",e.complex64="complex64"}(s||(s={})),function(e){e.float32="float32",e.int32="float32",e.bool="float32",e.complex64="complex64"}(o||(o={})),function(e){e.float32="complex64",e.int32="complex64",e.bool="complex64",e.complex64="complex64"}(i||(i={}));const u={float32:o,int32:a,bool:s,complex64:i};function l(e,t){if("string"===e||"string"===t){if("string"===e&&"string"===t)return"string";throw new Error(`Can not upcast ${e} with ${t}`)}return u[e][t]}function c(e){return l(e,"int32")}},9122:(e,t,n)=>{"use strict";n.r(t),n.d(t,{arraysEqual:()=>a.cO,assert:()=>a.hu,assertNonNegativeIntegerDimensions:()=>a.Mu,assertNonNull:()=>a.Cq,assertShapesMatch:()=>a.k5,bytesFromStringArray:()=>a.Ub,bytesPerElement:()=>a.bT,checkConversionForErrors:()=>a.D5,clamp:()=>a.uZ,computeStrides:()=>a.e3,createScalarValue:()=>k,createShuffledIndices:()=>a.U$,decodeString:()=>S,distSquared:()=>a.E7,encodeString:()=>N,fetch:()=>x,fingerPrint64:()=>b,flatten:()=>a.xH,getArrayFromDType:()=>a.rQ,getTypedArrayFromDType:()=>a.WP,hasEncodingLoss:()=>a.QB,hexToLong:()=>i,indexToLoc:()=>a.NE,inferDtype:()=>a.D2,inferFromImplicitShape:()=>a.JZ,isBoolean:()=>a.jn,isFunction:()=>a.mf,isInt:()=>a.GN,isNumber:()=>a.hj,isPromise:()=>a.tI,isScalarShape:()=>a.N9,isString:()=>a.HD,isTypedArray:()=>a.fU,isValidDtype:()=>a.LP,locToIndex:()=>a.qy,makeOnesTypedArray:()=>a.p8,makeZerosNestedTypedArray:()=>a.l6,makeZerosTypedArray:()=>a.wT,nearestDivisor:()=>a.jP,nearestLargerEven:()=>a.nY,now:()=>v,parseAxisParam:()=>a.EC,randUniform:()=>a.bj,repeatedTry:()=>a.WD,rightPad:()=>a.oj,shuffle:()=>a.TV,shuffleCombo:()=>a.d7,sizeFromShape:()=>a.NA,sizeToSquarishShape:()=>a.YP,squeezeShape:()=>a.bp,sum:()=>a.Sm,swap:()=>a.LF,tanh:()=>a.AE,toNestedArray:()=>a.GX,toTypedArray:()=>w});var r=n(2885),a=n(569),s=n(3720);const o=n.n(s)()||s;function i(e){return o.fromString(e,!0,16)}const u=i("c3a5c85c97cb3127"),l=i("b492b66fbe98f273"),c=i("9ae16a3b2f90404f");function p(e){return e.xor(e.shru(47))}function d(e,t,n){const r=e.slice(t,t+n);return o.fromBytes(Array.from(r),!0,!0)}function h(e,t){return d(e,t,8)}function m(e,t){return d(e,t,4)}function f(e,t){return 0===t?e:e.shru(t).or(e.shl(64-t))}function g(e,t,n=i("9ddfea08eb382d69")){let r=e.xor(t).mul(n);r=r.xor(r.shru(47));let a=t.xor(r).mul(n);return a=a.xor(a.shru(47)),a=a.mul(n),a}function y(e,t,n,r){return function(e,t,n,r,a,s){a=a.add(e),s=f(s.add(a).add(r),21);const o=a;return a=(a=a.add(t)).add(n),s=s.add(f(a,44)),[a.add(r),s.add(o)]}(h(e,t),h(e,t+8),h(e,t+16),h(e,t+24),n,r)}function b(e,t=e.length){const n=o.fromNumber(81,!0);if(t<=32)return t<=16?function(e,t=e.length){if(t>=8){const n=c.add(2*t),r=h(e,0).add(c),a=h(e,t-8);return g(f(a,37).mul(n).add(r),f(r,25).add(a).mul(n),n)}if(t>=4){const n=c.add(2*t);return g(m(e,0).shl(3).add(t),m(e,t-4),n)}if(t>0){const n=e[0]+(e[t>>1]<<8),r=t+(e[t-1]<<2);return p(c.mul(n).xor(u.mul(r))).mul(c)}return c}(e,t):function(e,t=e.length){const n=c.add(2*t),r=h(e,0).mul(l),a=h(e,8),s=h(e,t-8).mul(n),o=h(e,t-16).mul(c);return g(f(r.add(a),43).add(f(s,30)).add(o),r.add(f(a.add(c),18)).add(s),n)}(e,t);if(t<=64)return function(e,t=e.length){const n=c.add(2*t),r=h(e,0).mul(c),a=h(e,8),s=h(e,t-8).mul(n),o=h(e,t-16).mul(c),i=f(r.add(a),43).add(f(s,30)).add(o),u=g(i,r.add(f(a.add(c),18)).add(s),n),l=h(e,16).mul(n),p=h(e,24),d=i.add(h(e,t-32)).mul(n),m=u.add(h(e,t-24)).mul(n);return g(f(l.add(p),43).add(f(d,30)).add(m),l.add(f(p.add(r),18)).add(d),n)}(e,t);let r=n,a=n.mul(l).add(113),s=p(a.mul(c).add(113)).mul(c),i=[o.UZERO,o.UZERO],d=[o.UZERO,o.UZERO];r=r.mul(c).add(h(e,0));let b=0;const k=64*(t-1>>6),w=k+(t-1&63)-63;do{r=f(r.add(a).add(i[0]).add(h(e,b+8)),37).mul(l),a=f(a.add(i[1]).add(h(e,b+48)),42).mul(l),r=r.xor(d[1]),a=a.add(i[0]).add(h(e,b+40)),s=f(s.add(d[0]),33).mul(l),i=y(e,b,i[1].mul(l),r.add(d[0])),d=y(e,b+32,s.add(d[1]),a.add(h(e,b+16))),[s,r]=[r,s],b+=64}while(b!==k);const v=l.add(s.and(255).shl(1));return b=w,d[0]=d[0].add(t-1&63),i[0]=i[0].add(d[0]),d[0]=d[0].add(i[0]),r=f(r.add(a).add(i[0]).add(h(e,b+8)),37).mul(v),a=f(a.add(i[1]).add(h(e,b+48)),42).mul(v),r=r.xor(d[1].mul(9)),a=a.add(i[0].mul(9).add(h(e,b+40))),s=f(s.add(d[0]),33).mul(v),i=y(e,b,i[1].mul(v),r.add(d[0])),d=y(e,b+32,s.add(d[1]),a.add(h(e,b+16))),[s,r]=[r,s],g(g(i[0],d[0],v).add(p(a).mul(u)).add(s),g(i[1],d[1],v).add(r),v)}function k(e,t){return"string"===t?N(e):w([e],t)}function w(e,t){if("string"===t)throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(e)&&(e=a.xH(e)),(0,r.OB)().getBool("DEBUG")&&a.D5(e,t),function(e,t){return e instanceof Float32Array&&"float32"===t||e instanceof Int32Array&&"int32"===t||e instanceof Uint8Array&&"bool"===t}(e,t))return e;if(null==t||"float32"===t||"complex64"===t)return new Float32Array(e);if("int32"===t)return new Int32Array(e);if("bool"===t){const t=new Uint8Array(e.length);for(let n=0;n{"use strict";function r(e){let t=e.length,n=0;for(;t>0;)n=Math.random()*t|0,t--,i(e,t,n)}function a(e,t){if(e.length!==t.length)throw new Error(`Array sizes must match to be shuffled together First array length was ${e.length}Second array length was ${t.length}`);let n=e.length,r=0;for(;n>0;)r=Math.random()*n|0,n--,i(e,n,r),i(t,n,r)}function s(e,t,n){return Math.max(e,Math.min(t,n))}function o(e){return e%2==0?e:e+1}function i(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function u(e){let t=0;for(let n=0;nn+` Shapes ${e} and ${t} must match`))}function h(e){p(null!=e,(()=>"The input to the tensor constructor must be a non-null value."))}function m(e,t=[],n=!1){if(null==t&&(t=[]),Array.isArray(e)||D(e)&&!n)for(let r=0;r0),n){return new Promise(((r,a)=>{let s=0;const o=()=>{if(e())return void r();s++;const i=t(s);null!=n&&s>=n?a():setTimeout(o,i)};o()}))}function S(e,t){let n=1,r=-1;for(let t=0;t=0)n*=e[t];else if(-1===e[t]){if(-1!==r)throw Error(`Shapes can only have 1 implicit size. Found -1 at dim ${r} and dim ${t}`);r=t}else if(e[t]<0)throw Error(`Shapes can not be < 0. Found ${e[t]} at dim ${t}`);if(-1===r){if(t>0&&t!==n)throw Error(`Size(${t}) must match the product of shape ${e}`);return e}if(0===n)throw Error(`Cannot infer the missing size in [${e}] when there are 0 elements`);if(t%n!=0)throw Error(`The implicit shape can't be a fractional number. Got ${t} / ${n}`);const a=e.slice();return a[r]=t/n,a}function I(e,t){const n=t.length;return p((e=null==e?t.map(((e,t)=>t)):[].concat(e)).every((e=>e>=-n&&e`All values in axis param must be in range [-${n}, ${n}) but got axis ${e}`)),p(e.every((e=>b(e))),(()=>`All values in axis param must be integers but got axis ${e}`)),e.map((e=>e<0?n+e:e))}function T(e,t){const n=[],r=[],a=null!=t&&Array.isArray(t)&&0===t.length,s=null==t||a?null:I(t,e).sort();let o=0;for(let t=0;tt)&&1===e[t]&&(n.push(e[t]),r.push(t)),s[o]<=t&&o++}1!==e[t]&&(n.push(e[t]),r.push(t))}return{newShape:n,keptDims:r}}function _(e,t){let n=null;if(null==e||"float32"===e)n=new Float32Array(t);else if("int32"===e)n=new Int32Array(t);else{if("bool"!==e)throw new Error(`Unknown data type ${e}`);n=new Uint8Array(t)}return n}function E(e,t){let n=null;if(null==e||"float32"===e)n=new Float32Array(t);else if("int32"===e)n=new Int32Array(t);else if("bool"===e)n=new Uint8Array(t);else{if("string"!==e)throw new Error(`Unknown data type ${e}`);n=new Array(t)}return n}function A(e,t){for(let n=0;nt+=e.length)),t}function B(e){return"string"==typeof e||e instanceof String}function C(e){return"boolean"==typeof e}function V(e){return"number"==typeof e}function R(e){return Array.isArray(e)?R(e[0]):e instanceof Float32Array?"float32":e instanceof Int32Array||e instanceof Uint8Array?"int32":V(e)?"float32":B(e)?"string":C(e)?"bool":"float32"}function z(e){return!!(e&&e.constructor&&e.call&&e.apply)}function P(e,t){for(let n=t;n=0;--r)n[r]=n[r+1]*e[r+1];return n}function W(e,t,n,r=!1){const a=new Array;if(1===t.length){const s=t[0]*(r?2:1);for(let t=0;te*t))*(r?2:1);for(let t=0;te*t))*(n?2:1);if(0===r)return[];if(r!==t.length)throw new Error(`[${e}] does not match the input size ${t.length}${n?" for a complex tensor":""}.`);return W(0,e,t,n)}function q(e,t){const n=G(e,t);for(let e=0;ee*t),1);if(null==t||"float32"===t)return H(e,new Float32Array(n));if("int32"===t)return H(e,new Int32Array(n));if("bool"===t)return H(e,new Uint8Array(n));throw new Error(`Unknown data type ${t}`)}function j(e){e.forEach((t=>{p(Number.isInteger(t)&&t>=0,(()=>`Tensor must have a shape comprised of positive integers but got shape [${e}].`))}))}function K(e,t,n){if(0===t)return 0;if(1===t)return e[0];let r=e[e.length-1];for(let t=0;tr,d7:()=>a,uZ:()=>s,nY:()=>o,LF:()=>i,Sm:()=>u,bj:()=>l,E7:()=>c,hu:()=>p,k5:()=>d,Cq:()=>h,xH:()=>m,NA:()=>f,N9:()=>g,cO:()=>y,GN:()=>b,AE:()=>k,YP:()=>w,U$:()=>v,oj:()=>x,WD:()=>N,JZ:()=>S,EC:()=>I,bp:()=>T,WP:()=>_,rQ:()=>E,D5:()=>A,LP:()=>M,QB:()=>$,fU:()=>D,bT:()=>F,Ub:()=>O,HD:()=>B,jn:()=>C,hj:()=>V,D2:()=>R,mf:()=>z,jP:()=>P,e3:()=>L,GX:()=>H,p8:()=>q,wT:()=>G,l6:()=>U,Mu:()=>j,qy:()=>K,NE:()=>X,tI:()=>Z})},3720:e=>{e.exports=n;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function n(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function r(e){return!0===(e&&e.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=r;var a={},s={};function o(e,t){var n,r,o;return t?(o=0<=(e>>>=0)&&e<256)&&(r=s[e])?r:(n=u(e,(0|e)<0?-1:0,!0),o&&(s[e]=n),n):(o=-128<=(e|=0)&&e<128)&&(r=a[e])?r:(n=u(e,e<0?-1:0,!1),o&&(a[e]=n),n)}function i(e,t){if(isNaN(e))return t?y:g;if(t){if(e<0)return y;if(e>=h)return x}else{if(e<=-m)return N;if(e+1>=m)return v}return e<0?i(-e,t).neg():u(e%d|0,e/d|0,t)}function u(e,t,r){return new n(e,t,r)}n.fromInt=o,n.fromNumber=i,n.fromBits=u;var l=Math.pow;function c(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return g;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||360)throw Error("interior hyphen");if(0===r)return c(e.substring(1),t,n).neg();for(var a=i(l(n,8)),s=g,o=0;o>>0:this.low},S.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},S.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((s=u).isZero())return c+o;for(;c.length<6;)c="0"+c;o=""+c+o}},S.getHighBits=function(){return this.high},S.getHighBitsUnsigned=function(){return this.high>>>0},S.getLowBits=function(){return this.low},S.getLowBitsUnsigned=function(){return this.low>>>0},S.getNumBitsAbs=function(){if(this.isNegative())return this.eq(N)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},S.isOdd=function(){return 1==(1&this.low)},S.isEven=function(){return 0==(1&this.low)},S.equals=function(e){return r(e)||(e=p(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},S.eq=S.equals,S.notEquals=function(e){return!this.eq(e)},S.neq=S.notEquals,S.ne=S.notEquals,S.lessThan=function(e){return this.comp(e)<0},S.lt=S.lessThan,S.lessThanOrEqual=function(e){return this.comp(e)<=0},S.lte=S.lessThanOrEqual,S.le=S.lessThanOrEqual,S.greaterThan=function(e){return this.comp(e)>0},S.gt=S.greaterThan,S.greaterThanOrEqual=function(e){return this.comp(e)>=0},S.gte=S.greaterThanOrEqual,S.ge=S.greaterThanOrEqual,S.compare=function(e){if(r(e)||(e=p(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},S.comp=S.compare,S.negate=function(){return!this.unsigned&&this.eq(N)?N:this.not().add(b)},S.neg=S.negate,S.add=function(e){r(e)||(e=p(e));var t=this.high>>>16,n=65535&this.high,a=this.low>>>16,s=65535&this.low,o=e.high>>>16,i=65535&e.high,l=e.low>>>16,c=0,d=0,h=0,m=0;return h+=(m+=s+(65535&e.low))>>>16,d+=(h+=a+l)>>>16,c+=(d+=n+i)>>>16,c+=t+o,u((h&=65535)<<16|(m&=65535),(c&=65535)<<16|(d&=65535),this.unsigned)},S.subtract=function(e){return r(e)||(e=p(e)),this.add(e.neg())},S.sub=S.subtract,S.multiply=function(e){if(this.isZero())return g;if(r(e)||(e=p(e)),t)return u(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return g;if(this.eq(N))return e.isOdd()?N:g;if(e.eq(N))return this.isOdd()?N:g;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(f)&&e.lt(f))return i(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,a=65535&this.high,s=this.low>>>16,o=65535&this.low,l=e.high>>>16,c=65535&e.high,d=e.low>>>16,h=65535&e.low,m=0,y=0,b=0,k=0;return b+=(k+=o*h)>>>16,y+=(b+=s*h)>>>16,b&=65535,y+=(b+=o*d)>>>16,m+=(y+=a*h)>>>16,y&=65535,m+=(y+=s*d)>>>16,y&=65535,m+=(y+=o*c)>>>16,m+=n*h+a*d+s*c+o*l,u((b&=65535)<<16|(k&=65535),(m&=65535)<<16|(y&=65535),this.unsigned)},S.mul=S.multiply,S.divide=function(e){if(r(e)||(e=p(e)),e.isZero())throw Error("division by zero");var n,a,s;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?u((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?y:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return y;if(e.gt(this.shru(1)))return k;s=y}else{if(this.eq(N))return e.eq(b)||e.eq(w)?N:e.eq(N)?b:(n=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?b:w:(a=this.sub(e.mul(n)),s=n.add(a.div(e)));if(e.eq(N))return this.unsigned?y:g;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();s=g}for(a=this;a.gte(e);){n=Math.max(1,Math.floor(a.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(n)/Math.LN2),c=o<=48?1:l(2,o-48),d=i(n),h=d.mul(e);h.isNegative()||h.gt(a);)h=(d=i(n-=c,this.unsigned)).mul(e);d.isZero()&&(d=b),s=s.add(d),a=a.sub(h)}return s},S.div=S.divide,S.modulo=function(e){return r(e)||(e=p(e)),t?u((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},S.mod=S.modulo,S.rem=S.modulo,S.not=function(){return u(~this.low,~this.high,this.unsigned)},S.and=function(e){return r(e)||(e=p(e)),u(this.low&e.low,this.high&e.high,this.unsigned)},S.or=function(e){return r(e)||(e=p(e)),u(this.low|e.low,this.high|e.high,this.unsigned)},S.xor=function(e){return r(e)||(e=p(e)),u(this.low^e.low,this.high^e.high,this.unsigned)},S.shiftLeft=function(e){return r(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?u(this.low<>>32-e,this.unsigned):u(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):u(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},S.shr=S.shiftRight,S.shiftRightUnsigned=function(e){if(r(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?u(this.low>>>e|t<<32-e,t>>>e,this.unsigned):u(32===e?t:t>>>e-32,0,this.unsigned)},S.shru=S.shiftRightUnsigned,S.shr_u=S.shiftRightUnsigned,S.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},S.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},S.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},S.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},S.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},n.fromBytes=function(e,t,r){return r?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},7854:(e,t,n)=>{"use strict";n.r(t),n.d(t,{FetchError:()=>d,Headers:()=>A,Request:()=>H,Response:()=>V,default:()=>K});const r=require("stream"),a=require("http"),s=require("url"),o=require("https"),i=require("zlib"),u=r.Readable,l=Symbol("buffer"),c=Symbol("type");class p{constructor(){this[c]="";const e=arguments[0],t=arguments[1],n=[];let r=0;if(e){const t=e,a=Number(t.length);for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:{},a=n.size;let s=void 0===a?0:a;var o=n.timeout;let i=void 0===o?0:o;null==e?e=null:b(e)?e=Buffer.from(e.toString()):k(e)||Buffer.isBuffer(e)||("[object ArrayBuffer]"===Object.prototype.toString.call(e)?e=Buffer.from(e):ArrayBuffer.isView(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof r||(e=Buffer.from(String(e)))),this[m]={body:e,disturbed:!1,error:null},this.size=s,this.timeout=i,e instanceof r&&e.on("error",(function(e){const n="AbortError"===e.name?e:new d(`Invalid response body while trying to fetch ${t.url}: ${e.message}`,"system",e);t[m].error=n}))}function y(){var e=this;if(this[m].disturbed)return g.Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[m].disturbed=!0,this[m].error)return g.Promise.reject(this[m].error);let t=this.body;if(null===t)return g.Promise.resolve(Buffer.alloc(0));if(k(t)&&(t=t.stream()),Buffer.isBuffer(t))return g.Promise.resolve(t);if(!(t instanceof r))return g.Promise.resolve(Buffer.alloc(0));let n=[],a=0,s=!1;return new g.Promise((function(r,o){let i;e.timeout&&(i=setTimeout((function(){s=!0,o(new d(`Response timeout while trying to fetch ${e.url} (over ${e.timeout}ms)`,"body-timeout"))}),e.timeout)),t.on("error",(function(t){"AbortError"===t.name?(s=!0,o(t)):o(new d(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t))})),t.on("data",(function(t){if(!s&&null!==t){if(e.size&&a+t.length>e.size)return s=!0,void o(new d(`content size at ${e.url} over limit: ${e.size}`,"max-size"));a+=t.length,n.push(t)}})),t.on("end",(function(){if(!s){clearTimeout(i);try{r(Buffer.concat(n,a))}catch(t){o(new d(`Could not create Buffer from response body for ${e.url}: ${t.message}`,"system",t))}}}))}))}function b(e){return"object"==typeof e&&"function"==typeof e.append&&"function"==typeof e.delete&&"function"==typeof e.get&&"function"==typeof e.getAll&&"function"==typeof e.has&&"function"==typeof e.set&&("URLSearchParams"===e.constructor.name||"[object URLSearchParams]"===Object.prototype.toString.call(e)||"function"==typeof e.sort)}function k(e){return"object"==typeof e&&"function"==typeof e.arrayBuffer&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.constructor&&"string"==typeof e.constructor.name&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}function w(e){let t,n,a=e.body;if(e.bodyUsed)throw new Error("cannot clone body after it is used");return a instanceof r&&"function"!=typeof a.getBoundary&&(t=new f,n=new f,a.pipe(t),a.pipe(n),e[m].body=t,a=n),a}function v(e){return null===e?null:"string"==typeof e?"text/plain;charset=UTF-8":b(e)?"application/x-www-form-urlencoded;charset=UTF-8":k(e)?e.type||null:Buffer.isBuffer(e)||"[object ArrayBuffer]"===Object.prototype.toString.call(e)||ArrayBuffer.isView(e)?null:"function"==typeof e.getBoundary?`multipart/form-data;boundary=${e.getBoundary()}`:e instanceof r?null:"text/plain;charset=UTF-8"}function x(e){const t=e.body;return null===t?0:k(t)?t.size:Buffer.isBuffer(t)?t.length:t&&"function"==typeof t.getLengthSync&&(t._lengthRetrievers&&0==t._lengthRetrievers.length||t.hasKnownLength&&t.hasKnownLength())?t.getLengthSync():null}g.prototype={get body(){return this[m].body},get bodyUsed(){return this[m].disturbed},arrayBuffer(){return y.call(this).then((function(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}))},blob(){let e=this.headers&&this.headers.get("content-type")||"";return y.call(this).then((function(t){return Object.assign(new p([],{type:e.toLowerCase()}),{[l]:t})}))},json(){var e=this;return y.call(this).then((function(t){try{return JSON.parse(t.toString())}catch(t){return g.Promise.reject(new d(`invalid json response body at ${e.url} reason: ${t.message}`,"invalid-json"))}}))},text(){return y.call(this).then((function(e){return e.toString()}))},buffer(){return y.call(this)},textConverted(){var e=this;return y.call(this).then((function(t){return function(e,t){if("function"!=typeof h)throw new Error("The package `encoding` must be installed to use the textConverted() function");const n=t.get("content-type");let r,a,s="utf-8";n&&(r=/charset=([^;]*)/i.exec(n));a=e.slice(0,1024).toString(),!r&&a&&(r=/0&&void 0!==arguments[0]?arguments[0]:void 0;if(this[E]=Object.create(null),e instanceof A){const t=e.raw(),n=Object.keys(t);for(const e of n)for(const n of t[e])this.append(e,n)}else if(null==e);else{if("object"!=typeof e)throw new TypeError("Provided initializer must be an object");{const t=e[Symbol.iterator];if(null!=t){if("function"!=typeof t)throw new TypeError("Header pairs must be iterable");const n=[];for(const t of e){if("object"!=typeof t||"function"!=typeof t[Symbol.iterator])throw new TypeError("Each header pair must be iterable");n.push(Array.from(t))}for(const e of n){if(2!==e.length)throw new TypeError("Each header pair must be a name/value tuple");this.append(e[0],e[1])}}else for(const t of Object.keys(e)){const n=e[t];this.append(t,n)}}}}get(e){I(e=`${e}`);const t=_(this[E],e);return void 0===t?null:this[E][t].join(", ")}forEach(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=M(this),r=0;for(;r1&&void 0!==arguments[1]?arguments[1]:"key+value";const n=Object.keys(e[E]).sort();return n.map("key"===t?function(e){return e.toLowerCase()}:"value"===t?function(t){return e[E][t].join(", ")}:function(t){return[t.toLowerCase(),e[E][t].join(", ")]})}A.prototype.entries=A.prototype[Symbol.iterator],Object.defineProperty(A.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(A.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});const $=Symbol("internal");function D(e,t){const n=Object.create(F);return n[$]={target:e,kind:t,index:0},n}const F=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==F)throw new TypeError("Value of `this` is not a HeadersIterator");var e=this[$];const t=e.target,n=e.kind,r=e.index,a=M(t,n);return r>=a.length?{value:void 0,done:!0}:(this[$].index=r+1,{value:a[r],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));function O(e){const t=Object.assign({__proto__:null},e[E]),n=_(e[E],"Host");return void 0!==n&&(t[n]=t[n][0]),t}Object.defineProperty(F,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});const B=Symbol("Response internals"),C=a.STATUS_CODES;class V{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};g.call(this,e,t);const n=t.status||200,r=new A(t.headers);if(null!=e&&!r.has("Content-Type")){const t=v(e);t&&r.append("Content-Type",t)}this[B]={url:t.url,status:n,statusText:t.statusText||C[n],headers:r,counter:t.counter}}get url(){return this[B].url||""}get status(){return this[B].status}get ok(){return this[B].status>=200&&this[B].status<300}get redirected(){return this[B].counter>0}get statusText(){return this[B].statusText}get headers(){return this[B].headers}clone(){return new V(w(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}g.mixIn(V.prototype),Object.defineProperties(V.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),Object.defineProperty(V.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});const R=Symbol("Request internals"),z=s.parse,P=s.format,L="destroy"in r.Readable.prototype;function W(e){return"object"==typeof e&&"object"==typeof e[R]}class H{constructor(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};W(e)?t=z(e.url):(t=e&&e.href?z(e.href):z(`${e}`),e={});let r=n.method||e.method||"GET";if(r=r.toUpperCase(),(null!=n.body||W(e)&&null!==e.body)&&("GET"===r||"HEAD"===r))throw new TypeError("Request with GET/HEAD method cannot have body");let a=null!=n.body?n.body:W(e)&&null!==e.body?w(e):null;g.call(this,a,{timeout:n.timeout||e.timeout||0,size:n.size||e.size||0});const s=new A(n.headers||e.headers||{});if(null!=a&&!s.has("Content-Type")){const e=v(a);e&&s.append("Content-Type",e)}let o=W(e)?e.signal:null;if("signal"in n&&(o=n.signal),null!=o&&!function(e){const t=e&&"object"==typeof e&&Object.getPrototypeOf(e);return!(!t||"AbortSignal"!==t.constructor.name)}(o))throw new TypeError("Expected signal to be an instanceof AbortSignal");this[R]={method:r,redirect:n.redirect||e.redirect||"follow",headers:s,parsedURL:t,signal:o},this.follow=void 0!==n.follow?n.follow:void 0!==e.follow?e.follow:20,this.compress=void 0!==n.compress?n.compress:void 0===e.compress||e.compress,this.counter=n.counter||e.counter||0,this.agent=n.agent||e.agent}get method(){return this[R].method}get url(){return P(this[R].parsedURL)}get headers(){return this[R].headers}get redirect(){return this[R].redirect}get signal(){return this[R].signal}clone(){return new H(this)}}function q(e){Error.call(this,e),this.type="aborted",this.message=e,Error.captureStackTrace(this,this.constructor)}g.mixIn(H.prototype),Object.defineProperty(H.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(H.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),q.prototype=Object.create(Error.prototype),q.prototype.constructor=q,q.prototype.name="AbortError";const G=r.PassThrough,U=s.resolve;function j(e,t){if(!j.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return g.Promise=j.Promise,new j.Promise((function(n,s){const u=new H(e,t),l=function(e){const t=e[R].parsedURL,n=new A(e[R].headers);if(n.has("Accept")||n.set("Accept","*/*"),!t.protocol||!t.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(t.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(e.signal&&e.body instanceof r.Readable&&!L)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let a=null;if(null==e.body&&/^(POST|PUT)$/i.test(e.method)&&(a="0"),null!=e.body){const t=x(e);"number"==typeof t&&(a=String(t))}a&&n.set("Content-Length",a),n.has("User-Agent")||n.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),e.compress&&!n.has("Accept-Encoding")&&n.set("Accept-Encoding","gzip,deflate");let s=e.agent;return"function"==typeof s&&(s=s(t)),n.has("Connection")||s||n.set("Connection","close"),Object.assign({},t,{method:e.method,headers:O(n),agent:s})}(u),c=("https:"===l.protocol?o:a).request,p=u.signal;let h=null;const m=function(){let e=new q("The user aborted a request.");s(e),u.body&&u.body instanceof r.Readable&&u.body.destroy(e),h&&h.body&&h.body.emit("error",e)};if(p&&p.aborted)return void m();const f=function(){m(),b()},g=c(l);let y;function b(){g.abort(),p&&p.removeEventListener("abort",f),clearTimeout(y)}p&&p.addEventListener("abort",f),u.timeout&&g.once("socket",(function(e){y=setTimeout((function(){s(new d(`network timeout at: ${u.url}`,"request-timeout")),b()}),u.timeout)})),g.on("error",(function(e){s(new d(`request to ${u.url} failed, reason: ${e.message}`,"system",e)),b()})),g.on("response",(function(e){clearTimeout(y);const t=function(e){const t=new A;for(const n of Object.keys(e))if(!N.test(n))if(Array.isArray(e[n]))for(const r of e[n])S.test(r)||(void 0===t[E][n]?t[E][n]=[r]:t[E][n].push(r));else S.test(e[n])||(t[E][n]=[e[n]]);return t}(e.headers);if(j.isRedirect(e.statusCode)){const r=t.get("Location"),a=null===r?null:U(u.url,r);switch(u.redirect){case"error":return s(new d(`uri requested responds with a redirect, redirect mode is set to error: ${u.url}`,"no-redirect")),void b();case"manual":if(null!==a)try{t.set("Location",a)}catch(e){s(e)}break;case"follow":if(null===a)break;if(u.counter>=u.follow)return s(new d(`maximum redirect reached at: ${u.url}`,"max-redirect")),void b();const r={headers:new A(u.headers),follow:u.follow,counter:u.counter+1,agent:u.agent,compress:u.compress,method:u.method,body:u.body,signal:u.signal,timeout:u.timeout,size:u.size};return 303!==e.statusCode&&u.body&&null===x(u)?(s(new d("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void b()):(303!==e.statusCode&&(301!==e.statusCode&&302!==e.statusCode||"POST"!==u.method)||(r.method="GET",r.body=void 0,r.headers.delete("content-length")),n(j(new H(a,r))),void b())}}e.once("end",(function(){p&&p.removeEventListener("abort",f)}));let r=e.pipe(new G);const a={url:u.url,status:e.statusCode,statusText:e.statusMessage,headers:t,size:u.size,timeout:u.timeout,counter:u.counter},o=t.get("Content-Encoding");if(!u.compress||"HEAD"===u.method||null===o||204===e.statusCode||304===e.statusCode)return h=new V(r,a),void n(h);const l={flush:i.Z_SYNC_FLUSH,finishFlush:i.Z_SYNC_FLUSH};if("gzip"==o||"x-gzip"==o)return r=r.pipe(i.createGunzip(l)),h=new V(r,a),void n(h);if("deflate"!=o&&"x-deflate"!=o){if("br"==o&&"function"==typeof i.createBrotliDecompress)return r=r.pipe(i.createBrotliDecompress()),h=new V(r,a),void n(h);h=new V(r,a),n(h)}else{e.pipe(new G).once("data",(function(e){r=8==(15&e[0])?r.pipe(i.createInflate()):r.pipe(i.createInflateRaw()),h=new V(r,a),n(h)}))}})),function(e,t){const n=t.body;null===n?e.end():k(n)?n.stream().pipe(e):Buffer.isBuffer(n)?(e.write(n),e.end()):n.pipe(e)}(g,u)}))}j.isRedirect=function(e){return 301===e||302===e||303===e||307===e||308===e},j.Promise=global.Promise;const K=j},6377:(e,t,n)=>{var r=n(4832),a=n(8652),s=n(801),o=n(2030),i=n(3618),u=n(9049),l=n(1971);l.alea=r,l.xor128=a,l.xorwow=s,l.xorshift7=o,l.xor4096=i,l.tychei=u,e.exports=l},4832:function(e,t,n){var r;!function(e,a,s){function o(e){var t,n=this,r=(t=4022871197,function(e){e=e.toString();for(var n=0;n>>0,t=(r*=t)>>>0,t+=4294967296*(r-=t)}return 2.3283064365386963e-10*(t>>>0)});n.next=function(){var e=2091639*n.s0+2.3283064365386963e-10*n.c;return n.s0=n.s1,n.s1=n.s2,n.s2=e-(n.c=0|e)},n.c=1,n.s0=r(" "),n.s1=r(" "),n.s2=r(" "),n.s0-=r(e),n.s0<0&&(n.s0+=1),n.s1-=r(e),n.s1<0&&(n.s1+=1),n.s2-=r(e),n.s2<0&&(n.s2+=1),r=null}function i(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function u(e,t){var n=new o(e),r=t&&t.state,a=n.next;return a.int32=function(){return 4294967296*n.next()|0},a.double=function(){return a()+11102230246251565e-32*(2097152*a()|0)},a.quick=a,r&&("object"==typeof r&&i(r,n),a.state=function(){return i(n,{})}),a}a&&a.exports?a.exports=u:n.amdD&&n.amdO?void 0===(r=function(){return u}.call(t,n,t,a))||(a.exports=r):this.alea=u}(0,e=n.nmd(e),n.amdD)},9049:function(e,t,n){var r;!function(e,a,s){function o(e){var t=this,n="";t.next=function(){var e=t.b,n=t.c,r=t.d,a=t.a;return e=e<<25^e>>>7^n,n=n-r|0,r=r<<24^r>>>8^a,a=a-e|0,t.b=e=e<<20^e>>>12^n,t.c=n=n-r|0,t.d=r<<16^n>>>16^a,t.a=a-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):n+=e;for(var r=0;r>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,r&&("object"==typeof r&&i(r,n),a.state=function(){return i(n,{})}),a}a&&a.exports?a.exports=u:n.amdD&&n.amdO?void 0===(r=function(){return u}.call(t,n,t,a))||(a.exports=r):this.tychei=u}(0,e=n.nmd(e),n.amdD)},8652:function(e,t,n){var r;!function(e,a,s){function o(e){var t=this,n="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:n+=e;for(var r=0;r>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,r&&("object"==typeof r&&i(r,n),a.state=function(){return i(n,{})}),a}a&&a.exports?a.exports=u:n.amdD&&n.amdO?void 0===(r=function(){return u}.call(t,n,t,a))||(a.exports=r):this.xor128=u}(0,e=n.nmd(e),n.amdD)},3618:function(e,t,n){var r;!function(e,a,s){function o(e){var t=this;t.next=function(){var e,n,r=t.w,a=t.X,s=t.i;return t.w=r=r+1640531527|0,n=a[s+34&127],e=a[s=s+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=a[s]=n^e,t.i=s,n+(r^r>>>16)|0},function(e,t){var n,r,a,s,o,i=[],u=128;for(t===(0|t)?(r=t,t=null):(t+="\0",r=0,u=Math.max(u,t.length)),a=0,s=-32;s>>15,r^=r<<4,r^=r>>>13,s>=0&&(o=o+1640531527|0,a=0==(n=i[127&s]^=r+o)?a+1:0);for(a>=128&&(i[127&(t&&t.length||0)]=-1),a=127,s=512;s>0;--s)r=i[a+34&127],n=i[a=a+1&127],r^=r<<13,n^=n<<17,r^=r>>>15,n^=n>>>12,i[a]=r^n;e.w=o,e.X=i,e.i=a}(t,e)}function i(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function u(e,t){null==e&&(e=+new Date);var n=new o(e),r=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,r&&(r.X&&i(r,n),a.state=function(){return i(n,{})}),a}a&&a.exports?a.exports=u:n.amdD&&n.amdO?void 0===(r=function(){return u}.call(t,n,t,a))||(a.exports=r):this.xor4096=u}(0,e=n.nmd(e),n.amdD)},2030:function(e,t,n){var r;!function(e,a,s){function o(e){var t=this;t.next=function(){var e,n,r=t.x,a=t.i;return e=r[a],n=(e^=e>>>7)^e<<24,n^=(e=r[a+1&7])^e>>>10,n^=(e=r[a+3&7])^e>>>3,n^=(e=r[a+4&7])^e<<7,e=r[a+7&7],n^=(e^=e<<13)^e<<9,r[a]=n,t.i=a+1&7,n},function(e,t){var n,r=[];if(t===(0|t))r[0]=t;else for(t=""+t,n=0;n0;--n)e.next()}(t,e)}function i(e,t){return t.x=e.x.slice(),t.i=e.i,t}function u(e,t){null==e&&(e=+new Date);var n=new o(e),r=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,r&&(r.x&&i(r,n),a.state=function(){return i(n,{})}),a}a&&a.exports?a.exports=u:n.amdD&&n.amdO?void 0===(r=function(){return u}.call(t,n,t,a))||(a.exports=r):this.xorshift7=u}(0,e=n.nmd(e),n.amdD)},801:function(e,t,n){var r;!function(e,a,s){function o(e){var t=this,n="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:n+=e;for(var r=0;r>>4),t.next()}function i(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function u(e,t){var n=new o(e),r=t&&t.state,a=function(){return(n.next()>>>0)/4294967296};return a.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},a.int32=n.next,a.quick=a,r&&("object"==typeof r&&i(r,n),a.state=function(){return i(n,{})}),a}a&&a.exports?a.exports=u:n.amdD&&n.amdO?void 0===(r=function(){return u}.call(t,n,t,a))||(a.exports=r):this.xorwow=u}(0,e=n.nmd(e),n.amdD)},1971:(e,t,n)=>{var r;!function(a,s){var o,i=this,u=256,l=s.pow(u,6),c=s.pow(2,52),p=2*c,d=255;function h(e,t,n){var r=[],d=y(g((t=1==t?{entropy:!0}:t||{}).entropy?[e,b(a)]:null==e?function(){try{var e;return o&&(e=o.randomBytes)?e=e(u):(e=new Uint8Array(u),(i.crypto||i.msCrypto).getRandomValues(e)),b(e)}catch(e){var t=i.navigator,n=t&&t.plugins;return[+new Date,i,n,i.screen,b(a)]}}():e,3),r),h=new m(r),k=function(){for(var e=h.g(6),t=l,n=0;e=p;)e/=2,t/=2,n>>>=1;return(e+n)/t};return k.int32=function(){return 0|h.g(4)},k.quick=function(){return h.g(4)/4294967296},k.double=k,y(b(h.S),a),(t.pass||n||function(e,t,n,r){return r&&(r.S&&f(r,h),e.state=function(){return f(h,{})}),n?(s.random=e,t):e})(k,d,"global"in t?t.global:this==s,t.state)}function m(e){var t,n=e.length,r=this,a=0,s=r.i=r.j=0,o=r.S=[];for(n||(e=[n++]);a0&&a[a.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]=this._maxContentSize&&(e=e.substring(0,this._maxContentSize)),this._normalizeNewline&&(e=e.replace(/\r\n/g,"\n")),[4,this._model.executeAsync(u.tensor([e]))];case 2:for(t=i.sent(),n=Array.isArray(t)?t[0]:t,r=Array.isArray(t)?t[1]:t,a=n.dataSync(),s=r.dataSync(),o=[],c=0;ca[l]&&(l=c);return[2,o.sort((function(e,t){return t.confidence-e.confidence}))]}}))}))},e.prototype.dispose=function(){var e;null===(e=this._model)||void 0===e||e.dispose()},e.DEFAULT_MAX_CONTENT_SIZE=1e5,e.DEFAULT_MIN_CONTENT_SIZE=20,e.NODE_MODEL_JSON_FUNC=function(){return o(void 0,void 0,void 0,(function(){var e,t;return i(this,(function(r){switch(r.label){case 0:return[4,Promise.resolve().then((function(){return s(n(5747))}))];case 1:return e=r.sent(),[4,Promise.resolve().then((function(){return s(n(5622))}))];case 2:return t=r.sent(),[2,new Promise((function(n,r){e.readFile(t.join(__dirname,"..","..","model","model.json"),(function(e,t){e?r(e):n(JSON.parse(t.toString()))}))}))]}}))}))},e.NODE_WEIGHTS_FUNC=function(){return o(void 0,void 0,void 0,(function(){var e,t;return i(this,(function(r){switch(r.label){case 0:return[4,Promise.resolve().then((function(){return s(n(5747))}))];case 1:return e=r.sent(),[4,Promise.resolve().then((function(){return s(n(5622))}))];case 2:return t=r.sent(),[2,new Promise((function(n,r){e.readFile(t.join(__dirname,"..","..","model","group1-shard1of1.bin"),(function(e,t){e?r(e):n(t.buffer)}))}))]}}))}))},e}();t.ModelOperations=p},6417:e=>{"use strict";e.exports=require("crypto")},5747:e=>{"use strict";e.exports=require("fs")},5622:e=>{"use strict";e.exports=require("path")},1669:e=>{"use strict";e.exports=require("util")}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var s=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(s.exports,s,s.exports,n),s.loaded=!0,s.exports}return n.amdD=function(){throw new Error("define cannot be used indirect")},n.amdO={},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n(6086)})()}));//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@vscode/vscode-languagedetection/dist/lib/index.js.map/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */ /** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */ /** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */ /** * @license * Copyright 2020 Google Inc. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */ /** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */ /** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */ /** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */ /** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */ /** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */ /** @license See the LICENSE file. */ 'use strict' module.exports = clone var getPrototypeOf = Object.getPrototypeOf || function (obj) { return obj.__proto__ } function clone (obj) { if (obj === null || typeof obj !== 'object') return obj if (obj instanceof Object) var copy = { __proto__: getPrototypeOf(obj) } else var copy = Object.create(null) Object.getOwnPropertyNames(obj).forEach(function (key) { Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) }) return copy } var fs = require('fs') var polyfills = require('./polyfills.js') var legacy = require('./legacy-streams.js') var clone = require('./clone.js') var util = require('util') /* istanbul ignore next - node 0.x polyfill */ var gracefulQueue var previousSymbol /* istanbul ignore else - node 0.x polyfill */ if (typeof Symbol === 'function' && typeof Symbol.for === 'function') { gracefulQueue = Symbol.for('graceful-fs.queue') // This is used in testing by future versions previousSymbol = Symbol.for('graceful-fs.previous') } else { gracefulQueue = '___graceful-fs.queue' previousSymbol = '___graceful-fs.previous' } function noop () {} function publishQueue(context, queue) { Object.defineProperty(context, gracefulQueue, { get: function() { return queue } }) } var debug = noop if (util.debuglog) debug = util.debuglog('gfs4') else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) debug = function() { var m = util.format.apply(util, arguments) m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') console.error(m) } // Once time initialization if (!fs[gracefulQueue]) { // This queue can be shared by multiple loaded instances var queue = global[gracefulQueue] || [] publishQueue(fs, queue) // Patch fs.close/closeSync to shared queue version, because we need // to retry() whenever a close happens *anywhere* in the program. // This is essential when multiple graceful-fs instances are // in play at the same time. fs.close = (function (fs$close) { function close (fd, cb) { return fs$close.call(fs, fd, function (err) { // This function uses the graceful-fs shared queue if (!err) { resetQueue() } if (typeof cb === 'function') cb.apply(this, arguments) }) } Object.defineProperty(close, previousSymbol, { value: fs$close }) return close })(fs.close) fs.closeSync = (function (fs$closeSync) { function closeSync (fd) { // This function uses the graceful-fs shared queue fs$closeSync.apply(fs, arguments) resetQueue() } Object.defineProperty(closeSync, previousSymbol, { value: fs$closeSync }) return closeSync })(fs.closeSync) if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { process.on('exit', function() { debug(fs[gracefulQueue]) require('assert').equal(fs[gracefulQueue].length, 0) }) } } if (!global[gracefulQueue]) { publishQueue(global, fs[gracefulQueue]); } module.exports = patch(clone(fs)) if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) { module.exports = patch(fs) fs.__patched = true; } function patch (fs) { // Everything that references the open() function needs to be in here polyfills(fs) fs.gracefulify = patch fs.createReadStream = createReadStream fs.createWriteStream = createWriteStream var fs$readFile = fs.readFile fs.readFile = readFile function readFile (path, options, cb) { if (typeof options === 'function') cb = options, options = null return go$readFile(path, options, cb) function go$readFile (path, options, cb, startTime) { return fs$readFile(path, options, function (err) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()]) else { if (typeof cb === 'function') cb.apply(this, arguments) } }) } } var fs$writeFile = fs.writeFile fs.writeFile = writeFile function writeFile (path, data, options, cb) { if (typeof options === 'function') cb = options, options = null return go$writeFile(path, data, options, cb) function go$writeFile (path, data, options, cb, startTime) { return fs$writeFile(path, data, options, function (err) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) else { if (typeof cb === 'function') cb.apply(this, arguments) } }) } } var fs$appendFile = fs.appendFile if (fs$appendFile) fs.appendFile = appendFile function appendFile (path, data, options, cb) { if (typeof options === 'function') cb = options, options = null return go$appendFile(path, data, options, cb) function go$appendFile (path, data, options, cb, startTime) { return fs$appendFile(path, data, options, function (err) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) else { if (typeof cb === 'function') cb.apply(this, arguments) } }) } } var fs$copyFile = fs.copyFile if (fs$copyFile) fs.copyFile = copyFile function copyFile (src, dest, flags, cb) { if (typeof flags === 'function') { cb = flags flags = 0 } return go$copyFile(src, dest, flags, cb) function go$copyFile (src, dest, flags, cb, startTime) { return fs$copyFile(src, dest, flags, function (err) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()]) else { if (typeof cb === 'function') cb.apply(this, arguments) } }) } } var fs$readdir = fs.readdir fs.readdir = readdir function readdir (path, options, cb) { if (typeof options === 'function') cb = options, options = null return go$readdir(path, options, cb) function go$readdir (path, options, cb, startTime) { return fs$readdir(path, options, function (err, files) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$readdir, [path, options, cb], err, startTime || Date.now(), Date.now()]) else { if (files && files.sort) files.sort() if (typeof cb === 'function') cb.call(this, err, files) } }) } } if (process.version.substr(0, 4) === 'v0.8') { var legStreams = legacy(fs) ReadStream = legStreams.ReadStream WriteStream = legStreams.WriteStream } var fs$ReadStream = fs.ReadStream if (fs$ReadStream) { ReadStream.prototype = Object.create(fs$ReadStream.prototype) ReadStream.prototype.open = ReadStream$open } var fs$WriteStream = fs.WriteStream if (fs$WriteStream) { WriteStream.prototype = Object.create(fs$WriteStream.prototype) WriteStream.prototype.open = WriteStream$open } Object.defineProperty(fs, 'ReadStream', { get: function () { return ReadStream }, set: function (val) { ReadStream = val }, enumerable: true, configurable: true }) Object.defineProperty(fs, 'WriteStream', { get: function () { return WriteStream }, set: function (val) { WriteStream = val }, enumerable: true, configurable: true }) // legacy names var FileReadStream = ReadStream Object.defineProperty(fs, 'FileReadStream', { get: function () { return FileReadStream }, set: function (val) { FileReadStream = val }, enumerable: true, configurable: true }) var FileWriteStream = WriteStream Object.defineProperty(fs, 'FileWriteStream', { get: function () { return FileWriteStream }, set: function (val) { FileWriteStream = val }, enumerable: true, configurable: true }) function ReadStream (path, options) { if (this instanceof ReadStream) return fs$ReadStream.apply(this, arguments), this else return ReadStream.apply(Object.create(ReadStream.prototype), arguments) } function ReadStream$open () { var that = this open(that.path, that.flags, that.mode, function (err, fd) { if (err) { if (that.autoClose) that.destroy() that.emit('error', err) } else { that.fd = fd that.emit('open', fd) that.read() } }) } function WriteStream (path, options) { if (this instanceof WriteStream) return fs$WriteStream.apply(this, arguments), this else return WriteStream.apply(Object.create(WriteStream.prototype), arguments) } function WriteStream$open () { var that = this open(that.path, that.flags, that.mode, function (err, fd) { if (err) { that.destroy() that.emit('error', err) } else { that.fd = fd that.emit('open', fd) } }) } function createReadStream (path, options) { return new fs.ReadStream(path, options) } function createWriteStream (path, options) { return new fs.WriteStream(path, options) } var fs$open = fs.open fs.open = open function open (path, flags, mode, cb) { if (typeof mode === 'function') cb = mode, mode = null return go$open(path, flags, mode, cb) function go$open (path, flags, mode, cb, startTime) { return fs$open(path, flags, mode, function (err, fd) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()]) else { if (typeof cb === 'function') cb.apply(this, arguments) } }) } } return fs } function enqueue (elem) { debug('ENQUEUE', elem[0].name, elem[1]) fs[gracefulQueue].push(elem) retry() } // keep track of the timeout between retry() calls var retryTimer // reset the startTime and lastTime to now // this resets the start of the 60 second overall timeout as well as the // delay between attempts so that we'll retry these jobs sooner function resetQueue () { var now = Date.now() for (var i = 0; i < fs[gracefulQueue].length; ++i) { // entries that are only a length of 2 are from an older version, don't // bother modifying those since they'll be retried anyway. if (fs[gracefulQueue][i].length > 2) { fs[gracefulQueue][i][3] = now // startTime fs[gracefulQueue][i][4] = now // lastTime } } // call retry to make sure we're actively processing the queue retry() } function retry () { // clear the timer and remove it to help prevent unintended concurrency clearTimeout(retryTimer) retryTimer = undefined if (fs[gracefulQueue].length === 0) return var elem = fs[gracefulQueue].shift() var fn = elem[0] var args = elem[1] // these items may be unset if they were added by an older graceful-fs var err = elem[2] var startTime = elem[3] var lastTime = elem[4] // if we don't have a startTime we have no way of knowing if we've waited // long enough, so go ahead and retry this item now if (startTime === undefined) { debug('RETRY', fn.name, args) fn.apply(null, args) } else if (Date.now() - startTime >= 60000) { // it's been more than 60 seconds total, bail now debug('TIMEOUT', fn.name, args) var cb = args.pop() if (typeof cb === 'function') cb.call(null, err) } else { // the amount of time between the last attempt and right now var sinceAttempt = Date.now() - lastTime // the amount of time between when we first tried, and when we last tried // rounded up to at least 1 var sinceStart = Math.max(lastTime - startTime, 1) // backoff. wait longer than the total time we've been retrying, but only // up to a maximum of 100ms var desiredDelay = Math.min(sinceStart * 1.2, 100) // it's been long enough since the last retry, do it again if (sinceAttempt >= desiredDelay) { debug('RETRY', fn.name, args) fn.apply(null, args.concat([startTime])) } else { // if we can't do this job yet, push it to the end of the queue // and let the next iteration check again fs[gracefulQueue].push(elem) } } // schedule our next run if one isn't already scheduled if (retryTimer === undefined) { retryTimer = setTimeout(retry, 0) } } var Stream = require('stream').Stream module.exports = legacy function legacy (fs) { return { ReadStream: ReadStream, WriteStream: WriteStream } function ReadStream (path, options) { if (!(this instanceof ReadStream)) return new ReadStream(path, options); Stream.call(this); var self = this; this.path = path; this.fd = null; this.readable = true; this.paused = false; this.flags = 'r'; this.mode = 438; /*=0666*/ this.bufferSize = 64 * 1024; options = options || {}; // Mixin options into this var keys = Object.keys(options); for (var index = 0, length = keys.length; index < length; index++) { var key = keys[index]; this[key] = options[key]; } if (this.encoding) this.setEncoding(this.encoding); if (this.start !== undefined) { if ('number' !== typeof this.start) { throw TypeError('start must be a Number'); } if (this.end === undefined) { this.end = Infinity; } else if ('number' !== typeof this.end) { throw TypeError('end must be a Number'); } if (this.start > this.end) { throw new Error('start must be <= end'); } this.pos = this.start; } if (this.fd !== null) { process.nextTick(function() { self._read(); }); return; } fs.open(this.path, this.flags, this.mode, function (err, fd) { if (err) { self.emit('error', err); self.readable = false; return; } self.fd = fd; self.emit('open', fd); self._read(); }) } function WriteStream (path, options) { if (!(this instanceof WriteStream)) return new WriteStream(path, options); Stream.call(this); this.path = path; this.fd = null; this.writable = true; this.flags = 'w'; this.encoding = 'binary'; this.mode = 438; /*=0666*/ this.bytesWritten = 0; options = options || {}; // Mixin options into this var keys = Object.keys(options); for (var index = 0, length = keys.length; index < length; index++) { var key = keys[index]; this[key] = options[key]; } if (this.start !== undefined) { if ('number' !== typeof this.start) { throw TypeError('start must be a Number'); } if (this.start < 0) { throw new Error('start must be >= zero'); } this.pos = this.start; } this.busy = false; this._queue = []; if (this.fd === null) { this._open = fs.open; this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); this.flush(); } } } The ISC License Copyright (c) Isaac Z. Schlueter, Ben Noordhuis, and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "graceful-fs", "description": "A drop-in replacement for fs, making various improvements.", "version": "4.2.8", "repository": { "type": "git", "url": "https://github.com/isaacs/node-graceful-fs" }, "main": "graceful-fs.js", "directories": { "test": "test" }, "scripts": { "preversion": "npm test", "postversion": "npm publish", "postpublish": "git push origin --follow-tags", "test": "nyc --silent node test.js | tap -c -", "posttest": "nyc report" }, "keywords": [ "fs", "module", "reading", "retry", "retries", "queue", "error", "errors", "handling", "EMFILE", "EAGAIN", "EINVAL", "EPERM", "EACCESS" ], "license": "ISC", "devDependencies": { "import-fresh": "^2.0.0", "mkdirp": "^0.5.0", "rimraf": "^2.2.8", "tap": "^12.7.0" }, "files": [ "fs.js", "graceful-fs.js", "legacy-streams.js", "polyfills.js", "clone.js" ] } var constants = require('constants') var origCwd = process.cwd var cwd = null var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform process.cwd = function() { if (!cwd) cwd = origCwd.call(process) return cwd } try { process.cwd() } catch (er) {} // This check is needed until node.js 12 is required if (typeof process.chdir === 'function') { var chdir = process.chdir process.chdir = function (d) { cwd = null chdir.call(process, d) } if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir) } module.exports = patch function patch (fs) { // (re-)implement some things that are known busted or missing. // lchmod, broken prior to 0.6.2 // back-port the fix here. if (constants.hasOwnProperty('O_SYMLINK') && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { patchLchmod(fs) } // lutimes implementation, or no-op if (!fs.lutimes) { patchLutimes(fs) } // https://github.com/isaacs/node-graceful-fs/issues/4 // Chown should not fail on einval or eperm if non-root. // It should not fail on enosys ever, as this just indicates // that a fs doesn't support the intended operation. fs.chown = chownFix(fs.chown) fs.fchown = chownFix(fs.fchown) fs.lchown = chownFix(fs.lchown) fs.chmod = chmodFix(fs.chmod) fs.fchmod = chmodFix(fs.fchmod) fs.lchmod = chmodFix(fs.lchmod) fs.chownSync = chownFixSync(fs.chownSync) fs.fchownSync = chownFixSync(fs.fchownSync) fs.lchownSync = chownFixSync(fs.lchownSync) fs.chmodSync = chmodFixSync(fs.chmodSync) fs.fchmodSync = chmodFixSync(fs.fchmodSync) fs.lchmodSync = chmodFixSync(fs.lchmodSync) fs.stat = statFix(fs.stat) fs.fstat = statFix(fs.fstat) fs.lstat = statFix(fs.lstat) fs.statSync = statFixSync(fs.statSync) fs.fstatSync = statFixSync(fs.fstatSync) fs.lstatSync = statFixSync(fs.lstatSync) // if lchmod/lchown do not exist, then make them no-ops if (!fs.lchmod) { fs.lchmod = function (path, mode, cb) { if (cb) process.nextTick(cb) } fs.lchmodSync = function () {} } if (!fs.lchown) { fs.lchown = function (path, uid, gid, cb) { if (cb) process.nextTick(cb) } fs.lchownSync = function () {} } // on Windows, A/V software can lock the directory, causing this // to fail with an EACCES or EPERM if the directory contains newly // created files. Try again on failure, for up to 60 seconds. // Set the timeout this long because some Windows Anti-Virus, such as Parity // bit9, may lock files for up to a minute, causing npm package install // failures. Also, take care to yield the scheduler. Windows scheduling gives // CPU to a busy looping process, which can cause the program causing the lock // contention to be starved of CPU by node, so the contention doesn't resolve. if (platform === "win32") { fs.rename = (function (fs$rename) { return function (from, to, cb) { var start = Date.now() var backoff = 0; fs$rename(from, to, function CB (er) { if (er && (er.code === "EACCES" || er.code === "EPERM") && Date.now() - start < 60000) { setTimeout(function() { fs.stat(to, function (stater, st) { if (stater && stater.code === "ENOENT") fs$rename(from, to, CB); else cb(er) }) }, backoff) if (backoff < 100) backoff += 10; return; } if (cb) cb(er) }) }})(fs.rename) } // if read() returns EAGAIN, then just try it again. fs.read = (function (fs$read) { function read (fd, buffer, offset, length, position, callback_) { var callback if (callback_ && typeof callback_ === 'function') { var eagCounter = 0 callback = function (er, _, __) { if (er && er.code === 'EAGAIN' && eagCounter < 10) { eagCounter ++ return fs$read.call(fs, fd, buffer, offset, length, position, callback) } callback_.apply(this, arguments) } } return fs$read.call(fs, fd, buffer, offset, length, position, callback) } // This ensures `util.promisify` works as it does for native `fs.read`. if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read) return read })(fs.read) fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) { var eagCounter = 0 while (true) { try { return fs$readSync.call(fs, fd, buffer, offset, length, position) } catch (er) { if (er.code === 'EAGAIN' && eagCounter < 10) { eagCounter ++ continue } throw er } } }})(fs.readSync) function patchLchmod (fs) { fs.lchmod = function (path, mode, callback) { fs.open( path , constants.O_WRONLY | constants.O_SYMLINK , mode , function (err, fd) { if (err) { if (callback) callback(err) return } // prefer to return the chmod error, if one occurs, // but still try to close, and report closing errors if they occur. fs.fchmod(fd, mode, function (err) { fs.close(fd, function(err2) { if (callback) callback(err || err2) }) }) }) } fs.lchmodSync = function (path, mode) { var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) // prefer to return the chmod error, if one occurs, // but still try to close, and report closing errors if they occur. var threw = true var ret try { ret = fs.fchmodSync(fd, mode) threw = false } finally { if (threw) { try { fs.closeSync(fd) } catch (er) {} } else { fs.closeSync(fd) } } return ret } } function patchLutimes (fs) { if (constants.hasOwnProperty("O_SYMLINK")) { fs.lutimes = function (path, at, mt, cb) { fs.open(path, constants.O_SYMLINK, function (er, fd) { if (er) { if (cb) cb(er) return } fs.futimes(fd, at, mt, function (er) { fs.close(fd, function (er2) { if (cb) cb(er || er2) }) }) }) } fs.lutimesSync = function (path, at, mt) { var fd = fs.openSync(path, constants.O_SYMLINK) var ret var threw = true try { ret = fs.futimesSync(fd, at, mt) threw = false } finally { if (threw) { try { fs.closeSync(fd) } catch (er) {} } else { fs.closeSync(fd) } } return ret } } else { fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } fs.lutimesSync = function () {} } } function chmodFix (orig) { if (!orig) return orig return function (target, mode, cb) { return orig.call(fs, target, mode, function (er) { if (chownErOk(er)) er = null if (cb) cb.apply(this, arguments) }) } } function chmodFixSync (orig) { if (!orig) return orig return function (target, mode) { try { return orig.call(fs, target, mode) } catch (er) { if (!chownErOk(er)) throw er } } } function chownFix (orig) { if (!orig) return orig return function (target, uid, gid, cb) { return orig.call(fs, target, uid, gid, function (er) { if (chownErOk(er)) er = null if (cb) cb.apply(this, arguments) }) } } function chownFixSync (orig) { if (!orig) return orig return function (target, uid, gid) { try { return orig.call(fs, target, uid, gid) } catch (er) { if (!chownErOk(er)) throw er } } } function statFix (orig) { if (!orig) return orig // Older versions of Node erroneously returned signed integers for // uid + gid. return function (target, options, cb) { if (typeof options === 'function') { cb = options options = null } function callback (er, stats) { if (stats) { if (stats.uid < 0) stats.uid += 0x100000000 if (stats.gid < 0) stats.gid += 0x100000000 } if (cb) cb.apply(this, arguments) } return options ? orig.call(fs, target, options, callback) : orig.call(fs, target, callback) } } function statFixSync (orig) { if (!orig) return orig // Older versions of Node erroneously returned signed integers for // uid + gid. return function (target, options) { var stats = options ? orig.call(fs, target, options) : orig.call(fs, target) if (stats.uid < 0) stats.uid += 0x100000000 if (stats.gid < 0) stats.gid += 0x100000000 return stats; } } // ENOSYS means that the fs doesn't support the op. Just ignore // that, because it doesn't matter. // // if there's no getuid, or if getuid() is something other // than 0, and the error is EINVAL or EPERM, then just ignore // it. // // This specific case is a silent failure in cp, install, tar, // and most other unix tools that manage permissions. // // When running as root, or if other types of errors are // encountered, then it's strict. function chownErOk (er) { if (!er) return true if (er.code === "ENOSYS") return true var nonroot = !process.getuid || process.getuid() !== 0 if (nonroot) { if (er.code === "EINVAL" || er.code === "EPERM") return true } return false } } /** * Module dependencies. */ var net = require('net'); var tls = require('tls'); var url = require('url'); var Agent = require('agent-base'); var inherits = require('util').inherits; var debug = require('debug')('http-proxy-agent'); /** * Module exports. */ module.exports = HttpProxyAgent; /** * The `HttpProxyAgent` implements an HTTP Agent subclass that connects to the * specified "HTTP proxy server" in order to proxy HTTP requests. * * @api public */ function HttpProxyAgent (opts) { if (!(this instanceof HttpProxyAgent)) return new HttpProxyAgent(opts); if ('string' == typeof opts) opts = url.parse(opts); if (!opts) throw new Error('an HTTP(S) proxy server `host` and `port` must be specified!'); debug('creating new HttpProxyAgent instance: %o', opts); Agent.call(this, opts); var proxy = Object.assign({}, opts); // if `true`, then connect to the proxy server over TLS. defaults to `false`. this.secureProxy = proxy.protocol ? /^https:?$/i.test(proxy.protocol) : false; // prefer `hostname` over `host`, and set the `port` if needed proxy.host = proxy.hostname || proxy.host; proxy.port = +proxy.port || (this.secureProxy ? 443 : 80); if (proxy.host && proxy.path) { // if both a `host` and `path` are specified then it's most likely the // result of a `url.parse()` call... we need to remove the `path` portion so // that `net.connect()` doesn't attempt to open that as a unix socket file. delete proxy.path; delete proxy.pathname; } this.proxy = proxy; } inherits(HttpProxyAgent, Agent); /** * Called when the node-core HTTP client library is creating a new HTTP request. * * @api public */ HttpProxyAgent.prototype.callback = function connect (req, opts, fn) { var proxy = this.proxy; // change the `http.ClientRequest` instance's "path" field // to the absolute path of the URL that will be requested var parsed = url.parse(req.path); if (null == parsed.protocol) parsed.protocol = 'http:'; if (null == parsed.hostname) parsed.hostname = opts.hostname || opts.host; if (null == parsed.port) parsed.port = opts.port; if (parsed.port == 80) { // if port is 80, then we can remove the port so that the // ":80" portion is not on the produced URL delete parsed.port; } var absolute = url.format(parsed); req.path = absolute; // inject the `Proxy-Authorization` header if necessary if (proxy.auth) { req.setHeader( 'Proxy-Authorization', 'Basic ' + Buffer.from(proxy.auth).toString('base64') ); } // create a socket connection to the proxy server var socket; if (this.secureProxy) { socket = tls.connect(proxy); } else { socket = net.connect(proxy); } // at this point, the http ClientRequest's internal `_header` field might have // already been set. If this is the case then we'll need to re-generate the // string since we just changed the `req.path` if (req._header) { debug('regenerating stored HTTP header string for request'); req._header = null; req._implicitHeader(); if (req.output && req.output.length > 0) { debug('patching connection write() output buffer with updated header'); // the _header has already been queued to be written to the socket var first = req.output[0]; var endOfHeaders = first.indexOf('\r\n\r\n') + 4; req.output[0] = req._header + first.substring(endOfHeaders); debug('output buffer: %o', req.output); } } fn(null, socket); }; { "name": "http-proxy-agent", "version": "2.1.0", "description": "An HTTP(s) proxy `http.Agent` implementation for HTTP", "main": "./index.js", "scripts": { "test": "mocha --reporter spec" }, "repository": { "type": "git", "url": "git://github.com/TooTallNate/node-http-proxy-agent.git" }, "keywords": [ "http", "proxy", "endpoint", "agent" ], "author": "Nathan Rajlich (http://n8.io/)", "license": "MIT", "bugs": { "url": "https://github.com/TooTallNate/node-http-proxy-agent/issues" }, "dependencies": { "agent-base": "4", "debug": "3.1.0" }, "devDependencies": { "mocha": "3", "proxy": "~0.2.3" }, "engines": { "node": ">= 4.5.0" } } 'use strict'; require('./patch-core'); const inherits = require('util').inherits; const promisify = require('es6-promisify'); const EventEmitter = require('events').EventEmitter; module.exports = Agent; function isAgent(v) { return v && typeof v.addRequest === 'function'; } /** * Base `http.Agent` implementation. * No pooling/keep-alive is implemented by default. * * @param {Function} callback * @api public */ function Agent(callback, _opts) { if (!(this instanceof Agent)) { return new Agent(callback, _opts); } EventEmitter.call(this); // The callback gets promisified if it has 3 parameters // (i.e. it has a callback function) lazily this._promisifiedCallback = false; let opts = _opts; if ('function' === typeof callback) { this.callback = callback; } else if (callback) { opts = callback; } // timeout for the socket to be returned from the callback this.timeout = (opts && opts.timeout) || null; this.options = opts; } inherits(Agent, EventEmitter); /** * Override this function in your subclass! */ Agent.prototype.callback = function callback(req, opts) { throw new Error( '"agent-base" has no default implementation, you must subclass and override `callback()`' ); }; /** * Called by node-core's "_http_client.js" module when creating * a new HTTP request with this Agent instance. * * @api public */ Agent.prototype.addRequest = function addRequest(req, _opts) { const ownOpts = Object.assign({}, _opts); // Set default `host` for HTTP to localhost if (null == ownOpts.host) { ownOpts.host = 'localhost'; } // Set default `port` for HTTP if none was explicitly specified if (null == ownOpts.port) { ownOpts.port = ownOpts.secureEndpoint ? 443 : 80; } const opts = Object.assign({}, this.options, ownOpts); if (opts.host && opts.path) { // If both a `host` and `path` are specified then it's most likely the // result of a `url.parse()` call... we need to remove the `path` portion so // that `net.connect()` doesn't attempt to open that as a unix socket file. delete opts.path; } delete opts.agent; delete opts.hostname; delete opts._defaultAgent; delete opts.defaultPort; delete opts.createConnection; // Hint to use "Connection: close" // XXX: non-documented `http` module API :( req._last = true; req.shouldKeepAlive = false; // Create the `stream.Duplex` instance let timeout; let timedOut = false; const timeoutMs = this.timeout; function onerror(err) { if (req._hadError) return; req.emit('error', err); // For Safety. Some additional errors might fire later on // and we need to make sure we don't double-fire the error event. req._hadError = true; } function ontimeout() { timeout = null; timedOut = true; const err = new Error( 'A "socket" was not created for HTTP request before ' + timeoutMs + 'ms' ); err.code = 'ETIMEOUT'; onerror(err); } function callbackError(err) { if (timedOut) return; if (timeout != null) { clearTimeout(timeout); timeout = null; } onerror(err); } function onsocket(socket) { if (timedOut) return; if (timeout != null) { clearTimeout(timeout); timeout = null; } if (isAgent(socket)) { // `socket` is actually an http.Agent instance, so relinquish // responsibility for this `req` to the Agent from here on socket.addRequest(req, opts); } else if (socket) { req.onSocket(socket); } else { const err = new Error( `no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\`` ); onerror(err); } } if (!this._promisifiedCallback && this.callback.length >= 3) { // Legacy callback function - convert to a Promise this.callback = promisify(this.callback, this); this._promisifiedCallback = true; } if (timeoutMs > 0) { timeout = setTimeout(ontimeout, timeoutMs); } try { Promise.resolve(this.callback(req, opts)).then(onsocket, callbackError); } catch (err) { Promise.reject(err).catch(callbackError); } }; { "name": "agent-base", "version": "4.2.0", "description": "Turn a function into an `http.Agent` instance", "main": "./index.js", "scripts": { "test": "mocha --reporter spec" }, "repository": { "type": "git", "url": "git://github.com/TooTallNate/node-agent-base.git" }, "keywords": [ "http", "agent", "base", "barebones", "https" ], "author": "Nathan Rajlich (http://n8.io/)", "license": "MIT", "bugs": { "url": "https://github.com/TooTallNate/node-agent-base/issues" }, "devDependencies": { "mocha": "^3.4.2", "ws": "^3.0.0" }, "dependencies": { "es6-promisify": "^5.0.0" }, "engines": { "node": ">= 4.0.0" } } 'use strict'; const url = require('url'); const https = require('https'); /** * This currently needs to be applied to all Node.js versions * in order to determine if the `req` is an HTTP or HTTPS request. * * There is currently no PR attempting to move this property upstream. */ https.request = (function(request) { return function(_options, cb) { let options; if (typeof _options === 'string') { options = url.parse(_options); } else { options = Object.assign({}, _options); } if (null == options.port) { options.port = 443; } options.secureEndpoint = true; return request.call(https, options, cb); }; })(https.request); /** * This is needed for Node.js >= 9.0.0 to make sure `https.get()` uses the * patched `https.request()`. * * Ref: https://github.com/nodejs/node/commit/5118f31 */ https.get = function(options, cb) { const req = https.request(options, cb); req.end(); return req; }; // Karma configuration // Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC) module.exports = function(config) { config.set({ // base path that will be used to resolve all patterns (eg. files, exclude) basePath: '', // frameworks to use // available frameworks: https://npmjs.org/browse/keyword/karma-adapter frameworks: ['mocha', 'chai', 'sinon'], // list of files / patterns to load in the browser files: [ 'dist/debug.js', 'test/*spec.js' ], // list of files to exclude exclude: [ 'src/node.js' ], // preprocess matching files before serving them to the browser // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor preprocessors: { }, // test results reporter to use // possible values: 'dots', 'progress' // available reporters: https://npmjs.org/browse/keyword/karma-reporter reporters: ['progress'], // web server port port: 9876, // enable / disable colors in the output (reporters and logs) colors: true, // level of logging // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG logLevel: config.LOG_INFO, // enable / disable watching file and executing tests whenever any file changes autoWatch: true, // start these browsers // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher browsers: ['PhantomJS'], // Continuous Integration mode // if true, Karma captures browsers, runs the tests and exits singleRun: false, // Concurrency level // how many browser should be started simultaneous concurrency: Infinity }) } (The MIT License) Copyright (c) 2014 TJ Holowaychuk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # get Makefile directory name: http://stackoverflow.com/a/5982798/376773 THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) # BIN directory BIN := $(THIS_DIR)/node_modules/.bin # Path PATH := node_modules/.bin:$(PATH) SHELL := /bin/bash # applications NODE ?= $(shell which node) YARN ?= $(shell which yarn) PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm)) BROWSERIFY ?= $(NODE) $(BIN)/browserify install: node_modules browser: dist/debug.js node_modules: package.json @NODE_ENV= $(PKG) install @touch node_modules dist/debug.js: src/*.js node_modules @mkdir -p dist @$(BROWSERIFY) \ --standalone debug \ . > dist/debug.js lint: @eslint *.js src/*.js test-node: @istanbul cover node_modules/mocha/bin/_mocha -- test/**.js @cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js test-browser: @$(MAKE) browser @karma start --single-run test-all: @concurrently \ "make test-node" \ "make test-browser" test: @if [ "x$(BROWSER)" = "x" ]; then \ $(MAKE) test-node; \ else \ $(MAKE) test-browser; \ fi clean: rimraf dist coverage .PHONY: browser install clean lint test test-all test-node test-browser module.exports = require('./src/node'); { "name": "debug", "version": "3.1.0", "repository": { "type": "git", "url": "git://github.com/visionmedia/debug.git" }, "description": "small debugging utility", "keywords": [ "debug", "log", "debugger" ], "author": "TJ Holowaychuk ", "contributors": [ "Nathan Rajlich (http://n8.io)", "Andrew Rhyne " ], "license": "MIT", "dependencies": { "ms": "2.0.0" }, "devDependencies": { "browserify": "14.4.0", "chai": "^3.5.0", "concurrently": "^3.1.0", "coveralls": "^2.11.15", "eslint": "^3.12.1", "istanbul": "^0.4.5", "karma": "^1.3.0", "karma-chai": "^0.1.0", "karma-mocha": "^1.3.0", "karma-phantomjs-launcher": "^1.0.2", "karma-sinon": "^1.0.5", "mocha": "^3.2.0", "mocha-lcov-reporter": "^1.2.0", "rimraf": "^2.5.4", "sinon": "^1.17.6", "sinon-chai": "^2.8.0" }, "main": "./src/index.js", "browser": "./src/browser.js" } /** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; var y = d * 365.25; /** * Parse or format the given `val`. * * Options: * * - `long` verbose formatting [false] * * @param {String|Number} val * @param {Object} [options] * @throws {Error} throw an error if val is not a non-empty string or a number * @return {String|Number} * @api public */ module.exports = function(val, options) { options = options || {}; var type = typeof val; if (type === 'string' && val.length > 0) { return parse(val); } else if (type === 'number' && isNaN(val) === false) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error( 'val is not a non-empty string or a valid number. val=' + JSON.stringify(val) ); }; /** * Parse the given `str` and return milliseconds. * * @param {String} str * @return {Number} * @api private */ function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec( str ); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'yrs': case 'yr': case 'y': return n * y; case 'days': case 'day': case 'd': return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': return n * m; case 'seconds': case 'second': case 'secs': case 'sec': case 's': return n * s; case 'milliseconds': case 'millisecond': case 'msecs': case 'msec': case 'ms': return n; default: return undefined; } } /** * Short format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtShort(ms) { if (ms >= d) { return Math.round(ms / d) + 'd'; } if (ms >= h) { return Math.round(ms / h) + 'h'; } if (ms >= m) { return Math.round(ms / m) + 'm'; } if (ms >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtLong(ms) { return plural(ms, d, 'day') || plural(ms, h, 'hour') || plural(ms, m, 'minute') || plural(ms, s, 'second') || ms + ' ms'; } /** * Pluralization helper. */ function plural(ms, n, name) { if (ms < n) { return; } if (ms < n * 1.5) { return Math.floor(ms / n) + ' ' + name; } return Math.ceil(ms / n) + ' ' + name + 's'; } The MIT License (MIT) Copyright (c) 2016 Zeit, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "ms", "version": "2.0.0", "description": "Tiny milisecond conversion utility", "repository": "zeit/ms", "main": "./index", "files": [ "index.js" ], "scripts": { "precommit": "lint-staged", "lint": "eslint lib/* bin/*", "test": "mocha tests.js" }, "eslintConfig": { "extends": "eslint:recommended", "env": { "node": true, "es6": true } }, "lint-staged": { "*.js": [ "npm run lint", "prettier --single-quote --write", "git add" ] }, "license": "MIT", "devDependencies": { "eslint": "3.19.0", "expect.js": "0.3.1", "husky": "0.13.3", "lint-staged": "3.4.1", "mocha": "3.4.1" } } /** * This is the web browser implementation of `debug()`. * * Expose `debug()` as the module. */ exports = module.exports = require('./debug'); exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = 'undefined' != typeof chrome && 'undefined' != typeof chrome.storage ? chrome.storage.local : localstorage(); /** * Colors. */ exports.colors = [ '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33' ]; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') { return true; } // Internet Explorer and Edge do not support colors. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } // is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || // is firebug? http://stackoverflow.com/a/398120/376773 (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || // is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || // double check webkit in userAgent just in case we are in a worker (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); } /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ exports.formatters.j = function(v) { try { return JSON.stringify(v); } catch (err) { return '[UnexpectedJSONParseError]: ' + err.message; } }; /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { var useColors = this.useColors; args[0] = (useColors ? '%c' : '') + this.namespace + (useColors ? ' %c' : ' ') + args[0] + (useColors ? '%c ' : ' ') + '+' + exports.humanize(this.diff); if (!useColors) return; var c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit') // the final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into var index = 0; var lastC = 0; args[0].replace(/%[a-zA-Z%]/g, function(match) { if ('%%' === match) return; index++; if ('%c' === match) { // we only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.log()` when available. * No-op when `console.log` is not a "function". * * @api public */ function log() { // this hackery is required for IE8/9, where // the `console.log` function doesn't have 'apply' return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (null == namespaces) { exports.storage.removeItem('debug'); } else { exports.storage.debug = namespaces; } } catch(e) {} } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { var r; try { r = exports.storage.debug; } catch(e) {} // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Enable namespaces listed in `localStorage.debug` initially. */ exports.enable(load()); /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { return window.localStorage; } catch (e) {} } /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. * * Expose `debug()` as the module. */ exports = module.exports = createDebug.debug = createDebug['default'] = createDebug; exports.coerce = coerce; exports.disable = disable; exports.enable = enable; exports.enabled = enabled; exports.humanize = require('ms'); /** * Active `debug` instances. */ exports.instances = []; /** * The currently active debug mode names, and names to skip. */ exports.names = []; exports.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ exports.formatters = {}; /** * Select a color. * @param {String} namespace * @return {Number} * @api private */ function selectColor(namespace) { var hash = 0, i; for (i in namespace) { hash = ((hash << 5) - hash) + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return exports.colors[Math.abs(hash) % exports.colors.length]; } /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { var prevTime; function debug() { // disabled? if (!debug.enabled) return; var self = debug; // set `diff` timestamp var curr = +new Date(); var ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; // turn the `arguments` into a proper Array var args = new Array(arguments.length); for (var i = 0; i < args.length; i++) { args[i] = arguments[i]; } args[0] = exports.coerce(args[0]); if ('string' !== typeof args[0]) { // anything else let's inspect with %O args.unshift('%O'); } // apply any `formatters` transformations var index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) { // if we encounter an escaped % then don't increase the array index if (match === '%%') return match; index++; var formatter = exports.formatters[format]; if ('function' === typeof formatter) { var val = args[index]; match = formatter.call(self, val); // now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // apply env-specific formatting (colors, etc.) exports.formatArgs.call(self, args); var logFn = debug.log || exports.log || console.log.bind(console); logFn.apply(self, args); } debug.namespace = namespace; debug.enabled = exports.enabled(namespace); debug.useColors = exports.useColors(); debug.color = selectColor(namespace); debug.destroy = destroy; // env-specific initialization logic for debug instances if ('function' === typeof exports.init) { exports.init(debug); } exports.instances.push(debug); return debug; } function destroy () { var index = exports.instances.indexOf(this); if (index !== -1) { exports.instances.splice(index, 1); return true; } else { return false; } } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { exports.save(namespaces); exports.names = []; exports.skips = []; var i; var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); var len = split.length; for (i = 0; i < len; i++) { if (!split[i]) continue; // ignore empty strings namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else { exports.names.push(new RegExp('^' + namespaces + '$')); } } for (i = 0; i < exports.instances.length; i++) { var instance = exports.instances[i]; instance.enabled = exports.enabled(instance.namespace); } } /** * Disable debug output. * * @api public */ function disable() { exports.enable(''); } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { if (name[name.length - 1] === '*') { return true; } var i, len; for (i = 0, len = exports.skips.length; i < len; i++) { if (exports.skips[i].test(name)) { return false; } } for (i = 0, len = exports.names.length; i < len; i++) { if (exports.names[i].test(name)) { return true; } } return false; } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) return val.stack || val.message; return val; } /** * Detect Electron renderer process, which is node, but we should * treat as a browser. */ if (typeof process === 'undefined' || process.type === 'renderer') { module.exports = require('./browser.js'); } else { module.exports = require('./node.js'); } /** * Module dependencies. */ var tty = require('tty'); var util = require('util'); /** * This is the Node.js implementation of `debug()`. * * Expose `debug()` as the module. */ exports = module.exports = require('./debug'); exports.init = init; exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; /** * Colors. */ exports.colors = [ 6, 2, 3, 4, 5, 1 ]; try { var supportsColor = require('supports-color'); if (supportsColor && supportsColor.level >= 2) { exports.colors = [ 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221 ]; } } catch (err) { // swallow - we only care if `supports-color` is available; it doesn't have to be. } /** * Build up the default `inspectOpts` object from the environment variables. * * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js */ exports.inspectOpts = Object.keys(process.env).filter(function (key) { return /^debug_/i.test(key); }).reduce(function (obj, key) { // camel-case var prop = key .substring(6) .toLowerCase() .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() }); // coerce string value into JS value var val = process.env[key]; if (/^(yes|on|true|enabled)$/i.test(val)) val = true; else if (/^(no|off|false|disabled)$/i.test(val)) val = false; else if (val === 'null') val = null; else val = Number(val); obj[prop] = val; return obj; }, {}); /** * Is stdout a TTY? Colored output is enabled when `true`. */ function useColors() { return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd); } /** * Map %o to `util.inspect()`, all on a single line. */ exports.formatters.o = function(v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts) .split('\n').map(function(str) { return str.trim() }).join(' '); }; /** * Map %o to `util.inspect()`, allowing multiple lines if needed. */ exports.formatters.O = function(v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts); }; /** * Adds ANSI color escape codes if enabled. * * @api public */ function formatArgs(args) { var name = this.namespace; var useColors = this.useColors; if (useColors) { var c = this.color; var colorCode = '\u001b[3' + (c < 8 ? c : '8;5;' + c); var prefix = ' ' + colorCode + ';1m' + name + ' ' + '\u001b[0m'; args[0] = prefix + args[0].split('\n').join('\n' + prefix); args.push(colorCode + 'm+' + exports.humanize(this.diff) + '\u001b[0m'); } else { args[0] = getDate() + name + ' ' + args[0]; } } function getDate() { if (exports.inspectOpts.hideDate) { return ''; } else { return new Date().toISOString() + ' '; } } /** * Invokes `util.format()` with the specified arguments and writes to stderr. */ function log() { return process.stderr.write(util.format.apply(util, arguments) + '\n'); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { if (null == namespaces) { // If you set a process.env field to null or undefined, it gets cast to the // string 'null' or 'undefined'. Just delete instead. delete process.env.DEBUG; } else { process.env.DEBUG = namespaces; } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { return process.env.DEBUG; } /** * Init logic for `debug` instances. * * Create a new `inspectOpts` object in case `useColors` is set * differently for a particular `debug` instance. */ function init (debug) { debug.inspectOpts = {}; var keys = Object.keys(exports.inspectOpts); for (var i = 0; i < keys.length; i++) { debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; } } /** * Enable namespaces listed in `process.env.DEBUG` initially. */ exports.enable(load()); /** * Module dependencies. */ var net = require('net'); var tls = require('tls'); var url = require('url'); var assert = require('assert'); var Agent = require('agent-base'); var inherits = require('util').inherits; var debug = require('debug')('https-proxy-agent'); /** * Module exports. */ module.exports = HttpsProxyAgent; /** * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to the * specified "HTTP(s) proxy server" in order to proxy HTTPS requests. * * @api public */ function HttpsProxyAgent(opts) { if (!(this instanceof HttpsProxyAgent)) return new HttpsProxyAgent(opts); if ('string' == typeof opts) opts = url.parse(opts); if (!opts) throw new Error( 'an HTTP(S) proxy server `host` and `port` must be specified!' ); debug('creating new HttpsProxyAgent instance: %o', opts); Agent.call(this, opts); var proxy = Object.assign({}, opts); // if `true`, then connect to the proxy server over TLS. defaults to `false`. this.secureProxy = proxy.protocol ? /^https:?$/i.test(proxy.protocol) : false; // prefer `hostname` over `host`, and set the `port` if needed proxy.host = proxy.hostname || proxy.host; proxy.port = +proxy.port || (this.secureProxy ? 443 : 80); // ALPN is supported by Node.js >= v5. // attempt to negotiate http/1.1 for proxy servers that support http/2 if (this.secureProxy && !('ALPNProtocols' in proxy)) { proxy.ALPNProtocols = ['http 1.1']; } if (proxy.host && proxy.path) { // if both a `host` and `path` are specified then it's most likely the // result of a `url.parse()` call... we need to remove the `path` portion so // that `net.connect()` doesn't attempt to open that as a unix socket file. delete proxy.path; delete proxy.pathname; } this.proxy = proxy; this.defaultPort = 443; } inherits(HttpsProxyAgent, Agent); /** * Called when the node-core HTTP client library is creating a new HTTP request. * * @api public */ HttpsProxyAgent.prototype.callback = function connect(req, opts, fn) { var proxy = this.proxy; // create a socket connection to the proxy server var socket; if (this.secureProxy) { socket = tls.connect(proxy); } else { socket = net.connect(proxy); } // we need to buffer any HTTP traffic that happens with the proxy before we get // the CONNECT response, so that if the response is anything other than an "200" // response code, then we can re-play the "data" events on the socket once the // HTTP parser is hooked up... var buffers = []; var buffersLength = 0; function read() { var b = socket.read(); if (b) ondata(b); else socket.once('readable', read); } function cleanup() { socket.removeListener('end', onend); socket.removeListener('error', onerror); socket.removeListener('close', onclose); socket.removeListener('readable', read); } function onclose(err) { debug('onclose had error %o', err); } function onend() { debug('onend'); } function onerror(err) { cleanup(); fn(err); } function ondata(b) { buffers.push(b); buffersLength += b.length; var buffered = Buffer.concat(buffers, buffersLength); var str = buffered.toString('ascii'); if (!~str.indexOf('\r\n\r\n')) { // keep buffering debug('have not received end of HTTP headers yet...'); read(); return; } var firstLine = str.substring(0, str.indexOf('\r\n')); var statusCode = +firstLine.split(' ')[1]; debug('got proxy server response: %o', firstLine); if (200 == statusCode) { // 200 Connected status code! var sock = socket; // nullify the buffered data since we won't be needing it buffers = buffered = null; if (opts.secureEndpoint) { // since the proxy is connecting to an SSL server, we have // to upgrade this socket connection to an SSL connection debug( 'upgrading proxy-connected socket to TLS connection: %o', opts.host ); opts.socket = socket; opts.servername = opts.servername || opts.host; opts.host = null; opts.hostname = null; opts.port = null; sock = tls.connect(opts); } cleanup(); req.once('socket', resume); fn(null, sock); } else { // some other status code that's not 200... need to re-play the HTTP header // "data" events onto the socket once the HTTP machinery is attached so // that the node core `http` can parse and handle the error status code cleanup(); // the original socket is closed, and a new closed socket is // returned instead, so that the proxy doesn't get the HTTP request // written to it (which may contain `Authorization` headers or other // sensitive data). // // See: https://hackerone.com/reports/541502 socket.destroy(); socket = new net.Socket(); socket.readable = true; // save a reference to the concat'd Buffer for the `onsocket` callback buffers = buffered; // need to wait for the "socket" event to re-play the "data" events req.once('socket', onsocket); fn(null, socket); } } function onsocket(socket) { debug('replaying proxy buffer for failed request'); assert(socket.listenerCount('data') > 0); // replay the "buffers" Buffer onto the `socket`, since at this point // the HTTP module machinery has been hooked up for the user socket.push(buffers); // nullify the cached Buffer instance buffers = null; } socket.on('error', onerror); socket.on('close', onclose); socket.on('end', onend); read(); var hostname = opts.host + ':' + opts.port; var msg = 'CONNECT ' + hostname + ' HTTP/1.1\r\n'; var headers = Object.assign({}, proxy.headers); if (proxy.auth) { headers['Proxy-Authorization'] = 'Basic ' + Buffer.from(proxy.auth).toString('base64'); } // the Host header should only include the port // number when it is a non-standard port var host = opts.host; if (!isDefaultPort(opts.port, opts.secureEndpoint)) { host += ':' + opts.port; } headers['Host'] = host; headers['Connection'] = 'close'; Object.keys(headers).forEach(function(name) { msg += name + ': ' + headers[name] + '\r\n'; }); socket.write(msg + '\r\n'); }; /** * Resumes a socket. * * @param {(net.Socket|tls.Socket)} socket The socket to resume * @api public */ function resume(socket) { socket.resume(); } function isDefaultPort(port, secure) { return Boolean((!secure && port === 80) || (secure && port === 443)); } { "name": "https-proxy-agent", "version": "2.2.4", "description": "An HTTP(s) proxy `http.Agent` implementation for HTTPS", "main": "./index.js", "types": "./index.d.ts", "scripts": { "test": "mocha --reporter spec" }, "repository": { "type": "git", "url": "git://github.com/TooTallNate/node-https-proxy-agent.git" }, "keywords": [ "https", "proxy", "endpoint", "agent" ], "author": "Nathan Rajlich (http://n8.io/)", "license": "MIT", "bugs": { "url": "https://github.com/TooTallNate/node-https-proxy-agent/issues" }, "dependencies": { "agent-base": "^4.3.0", "debug": "^3.1.0" }, "devDependencies": { "mocha": "^6.2.0", "proxy": "1" }, "engines": { "node": ">= 4.5.0" } } (The MIT License) Copyright (c) 2014 TJ Holowaychuk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. module.exports = require('./src/node'); { "name": "debug", "version": "3.2.6", "repository": { "type": "git", "url": "git://github.com/visionmedia/debug.git" }, "description": "small debugging utility", "keywords": [ "debug", "log", "debugger" ], "files": [ "src", "node.js", "dist/debug.js", "LICENSE", "README.md" ], "author": "TJ Holowaychuk ", "contributors": [ "Nathan Rajlich (http://n8.io)", "Andrew Rhyne " ], "license": "MIT", "dependencies": { "ms": "^2.1.1" }, "devDependencies": { "@babel/cli": "^7.0.0", "@babel/core": "^7.0.0", "@babel/preset-env": "^7.0.0", "browserify": "14.4.0", "chai": "^3.5.0", "concurrently": "^3.1.0", "coveralls": "^3.0.2", "istanbul": "^0.4.5", "karma": "^3.0.0", "karma-chai": "^0.1.0", "karma-mocha": "^1.3.0", "karma-phantomjs-launcher": "^1.0.2", "mocha": "^5.2.0", "mocha-lcov-reporter": "^1.2.0", "rimraf": "^2.5.4", "xo": "^0.23.0" }, "main": "./src/index.js", "browser": "./src/browser.js", "unpkg": "./dist/debug.js" } 'use strict'; require('./patch-core'); const inherits = require('util').inherits; const promisify = require('es6-promisify'); const EventEmitter = require('events').EventEmitter; module.exports = Agent; function isAgent(v) { return v && typeof v.addRequest === 'function'; } /** * Base `http.Agent` implementation. * No pooling/keep-alive is implemented by default. * * @param {Function} callback * @api public */ function Agent(callback, _opts) { if (!(this instanceof Agent)) { return new Agent(callback, _opts); } EventEmitter.call(this); // The callback gets promisified if it has 3 parameters // (i.e. it has a callback function) lazily this._promisifiedCallback = false; let opts = _opts; if ('function' === typeof callback) { this.callback = callback; } else if (callback) { opts = callback; } // timeout for the socket to be returned from the callback this.timeout = (opts && opts.timeout) || null; this.options = opts; } inherits(Agent, EventEmitter); /** * Override this function in your subclass! */ Agent.prototype.callback = function callback(req, opts) { throw new Error( '"agent-base" has no default implementation, you must subclass and override `callback()`' ); }; /** * Called by node-core's "_http_client.js" module when creating * a new HTTP request with this Agent instance. * * @api public */ Agent.prototype.addRequest = function addRequest(req, _opts) { const ownOpts = Object.assign({}, _opts); // Set default `host` for HTTP to localhost if (null == ownOpts.host) { ownOpts.host = 'localhost'; } // Set default `port` for HTTP if none was explicitly specified if (null == ownOpts.port) { ownOpts.port = ownOpts.secureEndpoint ? 443 : 80; } const opts = Object.assign({}, this.options, ownOpts); if (opts.host && opts.path) { // If both a `host` and `path` are specified then it's most likely the // result of a `url.parse()` call... we need to remove the `path` portion so // that `net.connect()` doesn't attempt to open that as a unix socket file. delete opts.path; } delete opts.agent; delete opts.hostname; delete opts._defaultAgent; delete opts.defaultPort; delete opts.createConnection; // Hint to use "Connection: close" // XXX: non-documented `http` module API :( req._last = true; req.shouldKeepAlive = false; // Create the `stream.Duplex` instance let timeout; let timedOut = false; const timeoutMs = this.timeout; const freeSocket = this.freeSocket; function onerror(err) { if (req._hadError) return; req.emit('error', err); // For Safety. Some additional errors might fire later on // and we need to make sure we don't double-fire the error event. req._hadError = true; } function ontimeout() { timeout = null; timedOut = true; const err = new Error( 'A "socket" was not created for HTTP request before ' + timeoutMs + 'ms' ); err.code = 'ETIMEOUT'; onerror(err); } function callbackError(err) { if (timedOut) return; if (timeout != null) { clearTimeout(timeout); timeout = null; } onerror(err); } function onsocket(socket) { if (timedOut) return; if (timeout != null) { clearTimeout(timeout); timeout = null; } if (isAgent(socket)) { // `socket` is actually an http.Agent instance, so relinquish // responsibility for this `req` to the Agent from here on socket.addRequest(req, opts); } else if (socket) { function onfree() { freeSocket(socket, opts); } socket.on('free', onfree); req.onSocket(socket); } else { const err = new Error( 'no Duplex stream was returned to agent-base for `' + req.method + ' ' + req.path + '`' ); onerror(err); } } if (!this._promisifiedCallback && this.callback.length >= 3) { // Legacy callback function - convert to a Promise this.callback = promisify(this.callback, this); this._promisifiedCallback = true; } if (timeoutMs > 0) { timeout = setTimeout(ontimeout, timeoutMs); } try { Promise.resolve(this.callback(req, opts)).then(onsocket, callbackError); } catch (err) { Promise.reject(err).catch(callbackError); } }; Agent.prototype.freeSocket = function freeSocket(socket, opts) { // TODO reuse sockets socket.destroy(); }; { "name": "agent-base", "version": "4.3.0", "description": "Turn a function into an `http.Agent` instance", "main": "./index.js", "scripts": { "test": "mocha --reporter spec" }, "repository": { "type": "git", "url": "git://github.com/TooTallNate/node-agent-base.git" }, "keywords": [ "http", "agent", "base", "barebones", "https" ], "author": "Nathan Rajlich (http://n8.io/)", "license": "MIT", "bugs": { "url": "https://github.com/TooTallNate/node-agent-base/issues" }, "devDependencies": { "@types/es6-promisify": "^5.0.0", "@types/node": "^10.5.3", "mocha": "^3.4.2", "ws": "^3.0.0" }, "dependencies": { "es6-promisify": "^5.0.0" }, "engines": { "node": ">= 4.0.0" } } 'use strict'; const url = require('url'); const https = require('https'); /** * This currently needs to be applied to all Node.js versions * in order to determine if the `req` is an HTTP or HTTPS request. * * There is currently no PR attempting to move this property upstream. */ const patchMarker = "__agent_base_https_request_patched__"; if (!https.request[patchMarker]) { https.request = (function(request) { return function(_options, cb) { let options; if (typeof _options === 'string') { options = url.parse(_options); } else { options = Object.assign({}, _options); } if (null == options.port) { options.port = 443; } options.secureEndpoint = true; return request.call(https, options, cb); }; })(https.request); https.request[patchMarker] = true; } /** * This is needed for Node.js >= 9.0.0 to make sure `https.get()` uses the * patched `https.request()`. * * Ref: https://github.com/nodejs/node/commit/5118f31 */ https.get = function (_url, _options, cb) { let options; if (typeof _url === 'string' && _options && typeof _options !== 'function') { options = Object.assign({}, url.parse(_url), _options); } else if (!_options && !cb) { options = _url; } else if (!cb) { options = _url; cb = _options; } const req = https.request(options, cb); req.end(); return req; }; "use strict"; function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } (function (f) { if ((typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined") { module.exports = f(); } else if (typeof define === "function" && define.amd) { define([], f); } else { var g; if (typeof window !== "undefined") { g = window; } else if (typeof global !== "undefined") { g = global; } else if (typeof self !== "undefined") { g = self; } else { g = this; } g.debug = f(); } })(function () { var define, module, exports; return function () { function r(e, n, t) { function o(i, f) { if (!n[i]) { if (!e[i]) { var c = "function" == typeof require && require; if (!f && c) return c(i, !0); if (u) return u(i, !0); var a = new Error("Cannot find module '" + i + "'"); throw a.code = "MODULE_NOT_FOUND", a; } var p = n[i] = { exports: {} }; e[i][0].call(p.exports, function (r) { var n = e[i][1][r]; return o(n || r); }, p, p.exports, r, e, n, t); } return n[i].exports; } for (var u = "function" == typeof require && require, i = 0; i < t.length; i++) { o(t[i]); } return o; } return r; }()({ 1: [function (require, module, exports) { /** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; var w = d * 7; var y = d * 365.25; /** * Parse or format the given `val`. * * Options: * * - `long` verbose formatting [false] * * @param {String|Number} val * @param {Object} [options] * @throws {Error} throw an error if val is not a non-empty string or a number * @return {String|Number} * @api public */ module.exports = function (val, options) { options = options || {}; var type = _typeof(val); if (type === 'string' && val.length > 0) { return parse(val); } else if (type === 'number' && isNaN(val) === false) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val)); }; /** * Parse the given `str` and return milliseconds. * * @param {String} str * @return {Number} * @api private */ function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'yrs': case 'yr': case 'y': return n * y; case 'weeks': case 'week': case 'w': return n * w; case 'days': case 'day': case 'd': return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': return n * m; case 'seconds': case 'second': case 'secs': case 'sec': case 's': return n * s; case 'milliseconds': case 'millisecond': case 'msecs': case 'msec': case 'ms': return n; default: return undefined; } } /** * Short format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtShort(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return Math.round(ms / d) + 'd'; } if (msAbs >= h) { return Math.round(ms / h) + 'h'; } if (msAbs >= m) { return Math.round(ms / m) + 'm'; } if (msAbs >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtLong(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return plural(ms, msAbs, d, 'day'); } if (msAbs >= h) { return plural(ms, msAbs, h, 'hour'); } if (msAbs >= m) { return plural(ms, msAbs, m, 'minute'); } if (msAbs >= s) { return plural(ms, msAbs, s, 'second'); } return ms + ' ms'; } /** * Pluralization helper. */ function plural(ms, msAbs, n, name) { var isPlural = msAbs >= n * 1.5; return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); } }, {}], 2: [function (require, module, exports) { // shim for using process in browser var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it // don't break things. But we need to wrap it in a try catch in case it is // wrapped in strict mode code which doesn't define any globals. It's inside a // function because try/catches deoptimize in certain engines. var cachedSetTimeout; var cachedClearTimeout; function defaultSetTimout() { throw new Error('setTimeout has not been defined'); } function defaultClearTimeout() { throw new Error('clearTimeout has not been defined'); } (function () { try { if (typeof setTimeout === 'function') { cachedSetTimeout = setTimeout; } else { cachedSetTimeout = defaultSetTimout; } } catch (e) { cachedSetTimeout = defaultSetTimout; } try { if (typeof clearTimeout === 'function') { cachedClearTimeout = clearTimeout; } else { cachedClearTimeout = defaultClearTimeout; } } catch (e) { cachedClearTimeout = defaultClearTimeout; } })(); function runTimeout(fun) { if (cachedSetTimeout === setTimeout) { //normal enviroments in sane situations return setTimeout(fun, 0); } // if setTimeout wasn't available but was latter defined if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout; return setTimeout(fun, 0); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedSetTimeout(fun, 0); } catch (e) { try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedSetTimeout.call(null, fun, 0); } catch (e) { // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { //normal enviroments in sane situations return clearTimeout(marker); } // if clearTimeout wasn't available but was latter defined if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout; return clearTimeout(marker); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedClearTimeout(marker); } catch (e) { try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedClearTimeout.call(null, marker); } catch (e) { // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. // Some versions of I.E. have different rules for clearTimeout vs setTimeout return cachedClearTimeout.call(this, marker); } } } var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; while (len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; runClearTimeout(timeout); } process.nextTick = function (fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { runTimeout(drainQueue); } }; // v8 likes predictible objects function Item(fun, array) { this.fun = fun; this.array = array; } Item.prototype.run = function () { this.fun.apply(null, this.array); }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues process.versions = {}; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.prependListener = noop; process.prependOnceListener = noop; process.listeners = function (name) { return []; }; process.binding = function (name) { throw new Error('process.binding is not supported'); }; process.cwd = function () { return '/'; }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; process.umask = function () { return 0; }; }, {}], 3: [function (require, module, exports) { /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. */ function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = require('ms'); Object.keys(env).forEach(function (key) { createDebug[key] = env[key]; }); /** * Active `debug` instances. */ createDebug.instances = []; /** * The currently active debug mode names, and names to skip. */ createDebug.names = []; createDebug.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ createDebug.formatters = {}; /** * Selects a color for a debug namespace * @param {String} namespace The namespace string for the for the debug instance to be colored * @return {Number|String} An ANSI color code for the given namespace * @api private */ function selectColor(namespace) { var hash = 0; for (var i = 0; i < namespace.length; i++) { hash = (hash << 5) - hash + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { var prevTime; function debug() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } // Disabled? if (!debug.enabled) { return; } var self = debug; // Set `diff` timestamp var curr = Number(new Date()); var ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== 'string') { // Anything else let's inspect with %O args.unshift('%O'); } // Apply any `formatters` transformations var index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) { // If we encounter an escaped % then don't increase the array index if (match === '%%') { return match; } index++; var formatter = createDebug.formatters[format]; if (typeof formatter === 'function') { var val = args[index]; match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // Apply env-specific formatting (colors, etc.) createDebug.formatArgs.call(self, args); var logFn = self.log || createDebug.log; logFn.apply(self, args); } debug.namespace = namespace; debug.enabled = createDebug.enabled(namespace); debug.useColors = createDebug.useColors(); debug.color = selectColor(namespace); debug.destroy = destroy; debug.extend = extend; // Debug.formatArgs = formatArgs; // debug.rawLog = rawLog; // env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } createDebug.instances.push(debug); return debug; } function destroy() { var index = createDebug.instances.indexOf(this); if (index !== -1) { createDebug.instances.splice(index, 1); return true; } return false; } function extend(namespace, delimiter) { return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { createDebug.save(namespaces); createDebug.names = []; createDebug.skips = []; var i; var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); var len = split.length; for (i = 0; i < len; i++) { if (!split[i]) { // ignore empty strings continue; } namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else { createDebug.names.push(new RegExp('^' + namespaces + '$')); } } for (i = 0; i < createDebug.instances.length; i++) { var instance = createDebug.instances[i]; instance.enabled = createDebug.enabled(instance.namespace); } } /** * Disable debug output. * * @api public */ function disable() { createDebug.enable(''); } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { if (name[name.length - 1] === '*') { return true; } var i; var len; for (i = 0, len = createDebug.skips.length; i < len; i++) { if (createDebug.skips[i].test(name)) { return false; } } for (i = 0, len = createDebug.names.length; i < len; i++) { if (createDebug.names[i].test(name)) { return true; } } return false; } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } createDebug.enable(createDebug.load()); return createDebug; } module.exports = setup; }, { "ms": 1 }], 4: [function (require, module, exports) { (function (process) { /* eslint-env browser */ /** * This is the web browser implementation of `debug()`. */ exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); /** * Colors. */ exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33']; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ // eslint-disable-next-line complexity function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { return true; } // Internet Explorer and Edge do not support colors. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); } /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); if (!this.useColors) { return; } var c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into var index = 0; var lastC = 0; args[0].replace(/%[a-zA-Z%]/g, function (match) { if (match === '%%') { return; } index++; if (match === '%c') { // We only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.log()` when available. * No-op when `console.log` is not a "function". * * @api public */ function log() { var _console; // This hackery is required for IE8/9, where // the `console.log` function doesn't have 'apply' return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (namespaces) { exports.storage.setItem('debug', namespaces); } else { exports.storage.removeItem('debug'); } } catch (error) {// Swallow // XXX (@Qix-) should we be logging these? } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { var r; try { r = exports.storage.getItem('debug'); } catch (error) {} // Swallow // XXX (@Qix-) should we be logging these? // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context // The Browser also has localStorage in the global context. return localStorage; } catch (error) {// Swallow // XXX (@Qix-) should we be logging these? } } module.exports = require('./common')(exports); var formatters = module.exports.formatters; /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ formatters.j = function (v) { try { return JSON.stringify(v); } catch (error) { return '[UnexpectedJSONParseError]: ' + error.message; } }; }).call(this, require('_process')); }, { "./common": 3, "_process": 2 }] }, {}, [4])(4); }); "use strict"; function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } /* eslint-env browser */ /** * This is the web browser implementation of `debug()`. */ exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); /** * Colors. */ exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33']; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ // eslint-disable-next-line complexity function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { return true; } // Internet Explorer and Edge do not support colors. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); } /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); if (!this.useColors) { return; } var c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into var index = 0; var lastC = 0; args[0].replace(/%[a-zA-Z%]/g, function (match) { if (match === '%%') { return; } index++; if (match === '%c') { // We only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.log()` when available. * No-op when `console.log` is not a "function". * * @api public */ function log() { var _console; // This hackery is required for IE8/9, where // the `console.log` function doesn't have 'apply' return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (namespaces) { exports.storage.setItem('debug', namespaces); } else { exports.storage.removeItem('debug'); } } catch (error) {// Swallow // XXX (@Qix-) should we be logging these? } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { var r; try { r = exports.storage.getItem('debug'); } catch (error) {} // Swallow // XXX (@Qix-) should we be logging these? // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context // The Browser also has localStorage in the global context. return localStorage; } catch (error) {// Swallow // XXX (@Qix-) should we be logging these? } } module.exports = require('./common')(exports); var formatters = module.exports.formatters; /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ formatters.j = function (v) { try { return JSON.stringify(v); } catch (error) { return '[UnexpectedJSONParseError]: ' + error.message; } }; "use strict"; /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. */ function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = require('ms'); Object.keys(env).forEach(function (key) { createDebug[key] = env[key]; }); /** * Active `debug` instances. */ createDebug.instances = []; /** * The currently active debug mode names, and names to skip. */ createDebug.names = []; createDebug.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ createDebug.formatters = {}; /** * Selects a color for a debug namespace * @param {String} namespace The namespace string for the for the debug instance to be colored * @return {Number|String} An ANSI color code for the given namespace * @api private */ function selectColor(namespace) { var hash = 0; for (var i = 0; i < namespace.length; i++) { hash = (hash << 5) - hash + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { var prevTime; function debug() { // Disabled? if (!debug.enabled) { return; } for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } var self = debug; // Set `diff` timestamp var curr = Number(new Date()); var ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== 'string') { // Anything else let's inspect with %O args.unshift('%O'); } // Apply any `formatters` transformations var index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) { // If we encounter an escaped % then don't increase the array index if (match === '%%') { return match; } index++; var formatter = createDebug.formatters[format]; if (typeof formatter === 'function') { var val = args[index]; match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // Apply env-specific formatting (colors, etc.) createDebug.formatArgs.call(self, args); var logFn = self.log || createDebug.log; logFn.apply(self, args); } debug.namespace = namespace; debug.enabled = createDebug.enabled(namespace); debug.useColors = createDebug.useColors(); debug.color = selectColor(namespace); debug.destroy = destroy; debug.extend = extend; // Debug.formatArgs = formatArgs; // debug.rawLog = rawLog; // env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } createDebug.instances.push(debug); return debug; } function destroy() { var index = createDebug.instances.indexOf(this); if (index !== -1) { createDebug.instances.splice(index, 1); return true; } return false; } function extend(namespace, delimiter) { return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { createDebug.save(namespaces); createDebug.names = []; createDebug.skips = []; var i; var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); var len = split.length; for (i = 0; i < len; i++) { if (!split[i]) { // ignore empty strings continue; } namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else { createDebug.names.push(new RegExp('^' + namespaces + '$')); } } for (i = 0; i < createDebug.instances.length; i++) { var instance = createDebug.instances[i]; instance.enabled = createDebug.enabled(instance.namespace); } } /** * Disable debug output. * * @api public */ function disable() { createDebug.enable(''); } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { if (name[name.length - 1] === '*') { return true; } var i; var len; for (i = 0, len = createDebug.skips.length; i < len; i++) { if (createDebug.skips[i].test(name)) { return false; } } for (i = 0, len = createDebug.names.length; i < len; i++) { if (createDebug.names[i].test(name)) { return true; } } return false; } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } createDebug.enable(createDebug.load()); return createDebug; } module.exports = setup; "use strict"; /** * Detect Electron renderer / nwjs process, which is node, but we should * treat as a browser. */ if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { module.exports = require('./browser.js'); } else { module.exports = require('./node.js'); } "use strict"; /** * Module dependencies. */ var tty = require('tty'); var util = require('util'); /** * This is the Node.js implementation of `debug()`. */ exports.init = init; exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; /** * Colors. */ exports.colors = [6, 2, 3, 4, 5, 1]; try { // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) // eslint-disable-next-line import/no-extraneous-dependencies var supportsColor = require('supports-color'); if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { exports.colors = [20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221]; } } catch (error) {} // Swallow - we only care if `supports-color` is available; it doesn't have to be. /** * Build up the default `inspectOpts` object from the environment variables. * * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js */ exports.inspectOpts = Object.keys(process.env).filter(function (key) { return /^debug_/i.test(key); }).reduce(function (obj, key) { // Camel-case var prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, function (_, k) { return k.toUpperCase(); }); // Coerce string value into JS value var val = process.env[key]; if (/^(yes|on|true|enabled)$/i.test(val)) { val = true; } else if (/^(no|off|false|disabled)$/i.test(val)) { val = false; } else if (val === 'null') { val = null; } else { val = Number(val); } obj[prop] = val; return obj; }, {}); /** * Is stdout a TTY? Colored output is enabled when `true`. */ function useColors() { return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd); } /** * Adds ANSI color escape codes if enabled. * * @api public */ function formatArgs(args) { var name = this.namespace, useColors = this.useColors; if (useColors) { var c = this.color; var colorCode = "\x1B[3" + (c < 8 ? c : '8;5;' + c); var prefix = " ".concat(colorCode, ";1m").concat(name, " \x1B[0m"); args[0] = prefix + args[0].split('\n').join('\n' + prefix); args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + "\x1B[0m"); } else { args[0] = getDate() + name + ' ' + args[0]; } } function getDate() { if (exports.inspectOpts.hideDate) { return ''; } return new Date().toISOString() + ' '; } /** * Invokes `util.format()` with the specified arguments and writes to stderr. */ function log() { return process.stderr.write(util.format.apply(util, arguments) + '\n'); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { if (namespaces) { process.env.DEBUG = namespaces; } else { // If you set a process.env field to null or undefined, it gets cast to the // string 'null' or 'undefined'. Just delete instead. delete process.env.DEBUG; } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { return process.env.DEBUG; } /** * Init logic for `debug` instances. * * Create a new `inspectOpts` object in case `useColors` is set * differently for a particular `debug` instance. */ function init(debug) { debug.inspectOpts = {}; var keys = Object.keys(exports.inspectOpts); for (var i = 0; i < keys.length; i++) { debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; } } module.exports = require('./common')(exports); var formatters = module.exports.formatters; /** * Map %o to `util.inspect()`, all on a single line. */ formatters.o = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts).replace(/\s*\n\s*/g, ' '); }; /** * Map %O to `util.inspect()`, allowing multiple lines if needed. */ formatters.O = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts); }; António Afonso - author Markus Ast - transformed into an npm package, multiple bug fixes Leon - multiple bug fixes Jérôme Desboeufs - transformed into proper modules for composability GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. (This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.) Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. {description} Copyright (C) {year} {fullname} This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. {signature of Ty Coon}, 1 April 1990 Ty Coon, President of Vice That's all there is to it! { "name": "jschardet", "version": "3.0.0", "description": "Character encoding auto-detection in JavaScript (port of python's chardet)", "author": "António Afonso", "license": "LGPL-2.1+", "keywords": [ "encoding", "charset" ], "repository": { "type": "git", "url": "https://github.com/aadsm/jschardet.git" }, "types": "index.d.ts", "directories": { "lib": "./lib", "test": "./test" }, "dependencies": {}, "devDependencies": { "browserify": "~12.0.1", "google-closure-compiler": "20151015.0.0" }, "scripts": { "dist-dev": "mkdir -p dist && browserify index.js -s jschardet --detect-globals false -o dist/jschardet.js", "dist": "npm run dist-dev && java -jar node_modules/google-closure-compiler/compiler.jar --warning_level QUIET --compilation_level SIMPLE_OPTIMIZATIONS --js dist/jschardet.js > dist/jschardet.min.js" }, "engines": { "node": ">=0.1.90" } } (function(a){"object"===typeof exports&&"undefined"!==typeof module?module.exports=a():"function"===typeof define&&define.amd?define([],a):("undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:this).jschardet=a()})(function(){return function(){function a(d,b,c){function f(e,k){if(!b[e]){if(!d[e]){var h="function"==typeof require&&require;if(!k&&h)return h(e,!0);if(g)return g(e,!0);h=Error("Cannot find module '"+e+"'");throw h.code="MODULE_NOT_FOUND", h;}h=b[e]={exports:{}};d[e][0].call(h.exports,function(a){return f(d[e][1][a]||a)},h,h.exports,a,d,b,c)}return b[e].exports}for(var g="function"==typeof require&&require,e=0;ethis._mCharToFreqOrder[e]&&this._mFreqChars++)};this.getConfidence=function(){if(0>=this._mTotalChars||3>=this._mFreqChars)return.01;if(this._mTotalChars!=this._mFreqChars){var a=this._mFreqChars/((this._mTotalChars-this._mFreqChars)*this._mTypicalDistributionRatio);if(.99>a)return a}return.99};this.gotEnoughData=function(){return 1024< this._mTotalChars};this.getOrder=function(a){return-1};this._mTypicalDistributionRatio=this._mTableSize=this._mCharToFreqOrder=null;this.reset()}function f(){c.apply(this);this.getOrder=function(a){return 196<=a.charCodeAt(0)?94*(a.charCodeAt(0)-196)+a.charCodeAt(1)-161:-1};this._mCharToFreqOrder=n.EUCTWCharToFreqOrder;this._mTableSize=n.EUCTW_TABLE_SIZE;this._mTypicalDistributionRatio=n.EUCTW_TYPICAL_DISTRIBUTION_RATIO}function g(){c.apply(this);this.getOrder=function(a){return 176<=a.charCodeAt(0)? 94*(a.charCodeAt(0)-176)+a.charCodeAt(1)-161:-1};this._mCharToFreqOrder=p.EUCKRCharToFreqOrder;this._mTableSize=p.EUCKR_TABLE_SIZE;this._mTypicalDistributionRatio=p.EUCKR_TYPICAL_DISTRIBUTION_RATIO}function e(){c.apply(this);this.getOrder=function(a){return 176<=a.charCodeAt(0)&&161<=a.charCodeAt(1)?94*(a.charCodeAt(0)-176)+a.charCodeAt(1)-161:-1};this._mCharToFreqOrder=q.GB2312CharToFreqOrder;this._mTableSize=q.GB2312_TABLE_SIZE;this._mTypicalDistributionRatio=q.GB2312_TYPICAL_DISTRIBUTION_RATIO} function m(){c.apply(this);this.getOrder=function(a){return 164<=a.charCodeAt(0)?161<=a.charCodeAt(1)?157*(a.charCodeAt(0)-164)+a.charCodeAt(1)-161+63:157*(a.charCodeAt(0)-164)+a.charCodeAt(1)-64:-1};this._mCharToFreqOrder=r.Big5CharToFreqOrder;this._mTableSize=r.BIG5_TABLE_SIZE;this._mTypicalDistributionRatio=r.BIG5_TYPICAL_DISTRIBUTION_RATIO}function k(){c.apply(this);this.getOrder=function(a){if(129<=a.charCodeAt(0)&&159>=a.charCodeAt(0))var b=188*(a.charCodeAt(0)-129);else if(224<=a.charCodeAt(0)&& 239>=a.charCodeAt(0))b=188*(a.charCodeAt(0)-224+31);else return-1;b+=a.charCodeAt(1)-64;if(64>a.charCodeAt(1)||127===a.charCodeAt(1)||252=this._mActiveNum)){this._mState=f.notMe;break}}return this.getState()};this.getConfidence=function(){var a=this.getState();if(a==f.foundIt)return.99;if(a==f.notMe)return.01;a=0;this._mBestGuessProber=null;for(var b=0,h;h=this._mProbers[b];b++)if(h)if(h.active){var l=h.getConfidence();e.log(h.getCharsetName()+" confidence = "+l+"\n");a"==h?e=!1:"<"==h&&(e=!0);var l=/[a-zA-Z]/.test(h);/^[\x00-\x7F]*$/.test(h)&&!l&&(k>c&&!e&&(b=b+a.substring(c,k)+" "),c=k+1)}e||(b+=a.substring(c));return b}}},{"./constants":8}],7:[function(a,d,b){var c=a("./constants");d.exports= function(a){this.reset=function(){this._mCurrentState=c.start};this.nextState=function(a){a=this._mModel.classTable[a.charCodeAt(0)];this._mCurrentState==c.start&&(this._mCurrentBytePos=0,this._mCurrentCharLen=this._mModel.charLenTable[a]);this._mCurrentState=this._mModel.stateTable[this._mCurrentState*this._mModel.classFactor+a];this._mCurrentBytePos++;return this._mCurrentState};this.getCurrentCharLen=function(){return this._mCurrentCharLen};this.getCodingStateMachine=function(){return this._mModel.name}; this._mModel=a;this._mCurrentCharLen=this._mCurrentBytePos=0;this.reset()}},{"./constants":8}],8:[function(a,d,b){d.exports={detecting:0,foundIt:1,notMe:2,start:0,error:1,itsMe:2,SHORTCUT_THRESHOLD:.95}},{}],9:[function(a,d,b){function c(){f.apply(this);var a=this;this.reset=function(){c.prototype.reset.apply(this);for(var b=0,e;e=this._mCodingSM[b];b++)e&&(e.active=!0,e.reset());this._mActiveSM=a._mCodingSM.length;this._mDetectedCharset=null};this.getCharsetName=function(){return this._mDetectedCharset}; this.getConfidence=function(){return this._mDetectedCharset?.99:0};this.feed=function(a){for(var b=0,e;b=this._mActiveSM)return this._mState=m.notMe,this.getState()}else if(d==m.itsMe)return this._mState=m.foundIt,this._mDetectedCharset=k.getCodingStateMachine(),this.getState()}}return this.getState()};a._mCodingSM=[new g(e.HZSMModel),new g(e.ISO2022CNSMModel), new g(e.ISO2022JPSMModel),new g(e.ISO2022KRSMModel)];a.reset()}var f=a("./charsetprober"),g=a("./codingstatemachine"),e=a("./escsm"),m=a("./constants");c.prototype=new f;d.exports=c},{"./charsetprober":6,"./codingstatemachine":7,"./constants":8,"./escsm":10}],10:[function(a,d,b){a=a("./constants");b.HZSMModel={classTable:[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,5,2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],classFactor:6,stateTable:[a.start,a.error,3,a.start,a.start,a.start,a.error,a.error,a.error,a.error,a.error,a.error,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.error, a.error,a.start,a.start,4,a.error,5,a.error,6,a.error,5,5,4,a.error,4,a.error,4,4,4,a.error,4,a.error,4,a.itsMe,a.start,a.start,a.start,a.start,a.start,a.start],charLenTable:[0,0,0,0,0,0],name:"HZ-GB-2312"};b.ISO2022CNSMModel={classTable:[2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2],classFactor:9,stateTable:[a.start,3,a.error,a.start,a.start,a.start,a.start,a.start,a.start,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.error,a.error, a.error,4,a.error,a.error,a.error,a.error,a.itsMe,a.error,a.error,a.error,a.error,5,6,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.itsMe,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.itsMe,a.error,a.start],charLenTable:[0,0,0,0,0,0,0,0,0],name:"ISO-2022-CN"};b.ISO2022JPSMModel={classTable:[2,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,7,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,4,0,8,0,0,0,0,9,5,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2],classFactor:10,stateTable:[a.start,3,a.error,a.start,a.start,a.start,a.start,a.start,a.start,a.start,a.error,a.error,a.error,a.error,a.error,a.error, a.error,a.error,a.error,a.error,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.error,a.error,a.error,5,a.error,a.error,a.error,4,a.error,a.error,a.error,a.error,a.error,6,a.itsMe,a.error,a.itsMe,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.itsMe,a.itsMe,a.error,a.error,a.error,a.itsMe,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.itsMe,a.error,a.start,a.start],charLenTable:[0,0,0,0,0,0,0,0,0,0],name:"ISO-2022-JP"};b.ISO2022KRSMModel= {classTable:[2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,3,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2],classFactor:6,stateTable:[a.start,3,a.error,a.start,a.start,a.start,a.error,a.error,a.error,a.error,a.error,a.error,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.error,a.error,a.error,4,a.error,a.error,a.error,a.error,a.error,a.error,5,a.error,a.error,a.error,a.error,a.error,a.error,a.itsMe,a.start,a.start,a.start,a.start],charLenTable:[0,0,0,0,0,0],name:"ISO-2022-KR"}},{"./constants":8}],11:[function(a,d,b){function c(){g.apply(this);this.reset=function(){c.prototype.reset.apply(this); this._mContextAnalyzer.reset()};this.getCharsetName=function(){return"EUC-JP"};this.feed=function(a){for(var b=a.length,e=0;eh.SHORTCUT_THRESHOLD&&(this._mState=h.foundIt);return this.getState()};this.getConfidence=function(){var a=this._mContextAnalyzer.getConfidence(),b=this._mDistributionAnalyzer.getConfidence();return Math.max(a,b)};this._mCodingSM=new f(k);this._mDistributionAnalyzer=new e;this._mContextAnalyzer= new m;this.reset()}var f=a("./codingstatemachine"),g=a("./mbcharsetprober"),e=a("./chardistribution").EUCJPDistributionAnalysis,m=a("./jpcntx").EUCJPContextAnalysis,k=a("./mbcssm/eucjp"),h=a("./constants"),l=a("./logger");c.prototype=new g;d.exports=c},{"./chardistribution":4,"./codingstatemachine":7,"./constants":8,"./jpcntx":21,"./logger":29,"./mbcharsetprober":30,"./mbcssm/eucjp":33}],12:[function(a,d,b){b.EUCKR_TYPICAL_DISTRIBUTION_RATIO=6;b.EUCKR_TABLE_SIZE=2352;b.EUCKRCharToFreqOrder=[13,130, 120,1396,481,1719,1720,328,609,212,1721,707,400,299,1722,87,1397,1723,104,536,1117,1203,1724,1267,685,1268,508,1725,1726,1727,1728,1398,1399,1729,1730,1731,141,621,326,1057,368,1732,267,488,20,1733,1269,1734,945,1400,1735,47,904,1270,1736,1737,773,248,1738,409,313,786,429,1739,116,987,813,1401,683,75,1204,145,1740,1741,1742,1743,16,847,667,622,708,1744,1745,1746,966,787,304,129,1747,60,820,123,676,1748,1749,1750,1751,617,1752,626,1753,1754,1755,1756,653,1757,1758,1759,1760,1761,1762,856,344,1763, 1764,1765,1766,89,401,418,806,905,848,1767,1768,1769,946,1205,709,1770,1118,1771,241,1772,1773,1774,1271,1775,569,1776,999,1777,1778,1779,1780,337,751,1058,28,628,254,1781,177,906,270,349,891,1079,1782,19,1783,379,1784,315,1785,629,754,1402,559,1786,636,203,1206,1787,710,567,1788,935,814,1789,1790,1207,766,528,1791,1792,1208,1793,1794,1795,1796,1797,1403,1798,1799,533,1059,1404,1405,1156,1406,936,884,1080,1800,351,1801,1802,1803,1804,1805,801,1806,1807,1808,1119,1809,1157,714,474,1407,1810,298,899, 885,1811,1120,802,1158,1812,892,1813,1814,1408,659,1815,1816,1121,1817,1818,1819,1820,1821,1822,319,1823,594,545,1824,815,937,1209,1825,1826,573,1409,1022,1827,1210,1828,1829,1830,1831,1832,1833,556,722,807,1122,1060,1834,697,1835,900,557,715,1836,1410,540,1411,752,1159,294,597,1211,976,803,770,1412,1837,1838,39,794,1413,358,1839,371,925,1840,453,661,788,531,723,544,1023,1081,869,91,1841,392,430,790,602,1414,677,1082,457,1415,1416,1842,1843,475,327,1024,1417,795,121,1844,733,403,1418,1845,1846,1847, 300,119,711,1212,627,1848,1272,207,1849,1850,796,1213,382,1851,519,1852,1083,893,1853,1854,1855,367,809,487,671,1856,663,1857,1858,956,471,306,857,1859,1860,1160,1084,1861,1862,1863,1864,1865,1061,1866,1867,1868,1869,1870,1871,282,96,574,1872,502,1085,1873,1214,1874,907,1875,1876,827,977,1419,1420,1421,268,1877,1422,1878,1879,1880,308,1881,2,537,1882,1883,1215,1884,1885,127,791,1886,1273,1423,1887,34,336,404,643,1888,571,654,894,840,1889,0,886,1274,122,575,260,908,938,1890,1275,410,316,1891,1892, 100,1893,1894,1123,48,1161,1124,1025,1895,633,901,1276,1896,1897,115,816,1898,317,1899,694,1900,909,734,1424,572,866,1425,691,85,524,1010,543,394,841,1901,1902,1903,1026,1904,1905,1906,1907,1908,1909,30,451,651,988,310,1910,1911,1426,810,1216,93,1912,1913,1277,1217,1914,858,759,45,58,181,610,269,1915,1916,131,1062,551,443,1E3,821,1427,957,895,1086,1917,1918,375,1919,359,1920,687,1921,822,1922,293,1923,1924,40,662,118,692,29,939,887,640,482,174,1925,69,1162,728,1428,910,1926,1278,1218,1279,386,870, 217,854,1163,823,1927,1928,1929,1930,834,1931,78,1932,859,1933,1063,1934,1935,1936,1937,438,1164,208,595,1938,1939,1940,1941,1219,1125,1942,280,888,1429,1430,1220,1431,1943,1944,1945,1946,1947,1280,150,510,1432,1948,1949,1950,1951,1952,1953,1954,1011,1087,1955,1433,1043,1956,881,1957,614,958,1064,1065,1221,1958,638,1001,860,967,896,1434,989,492,553,1281,1165,1959,1282,1002,1283,1222,1960,1961,1962,1963,36,383,228,753,247,454,1964,876,678,1965,1966,1284,126,464,490,835,136,672,529,940,1088,1435,473, 1967,1968,467,50,390,227,587,279,378,598,792,968,240,151,160,849,882,1126,1285,639,1044,133,140,288,360,811,563,1027,561,142,523,1969,1970,1971,7,103,296,439,407,506,634,990,1972,1973,1974,1975,645,1976,1977,1978,1979,1980,1981,236,1982,1436,1983,1984,1089,192,828,618,518,1166,333,1127,1985,818,1223,1986,1987,1988,1989,1990,1991,1992,1993,342,1128,1286,746,842,1994,1995,560,223,1287,98,8,189,650,978,1288,1996,1437,1997,17,345,250,423,277,234,512,226,97,289,42,167,1998,201,1999,2E3,843,836,824,532, 338,783,1090,182,576,436,1438,1439,527,500,2001,947,889,2002,2003,2004,2005,262,600,314,447,2006,547,2007,693,738,1129,2008,71,1440,745,619,688,2009,829,2010,2011,147,2012,33,948,2013,2014,74,224,2015,61,191,918,399,637,2016,1028,1130,257,902,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,837,2027,2028,2029,2030,179,874,591,52,724,246,2031,2032,2033,2034,1167,969,2035,1289,630,605,911,1091,1168,2036,2037,2038,1441,912,2039,623,2040,2041,253,1169,1290,2042,1442,146,620,611,577,433,2043,1224,719, 1170,959,440,437,534,84,388,480,1131,159,220,198,679,2044,1012,819,1066,1443,113,1225,194,318,1003,1029,2045,2046,2047,2048,1067,2049,2050,2051,2052,2053,59,913,112,2054,632,2055,455,144,739,1291,2056,273,681,499,2057,448,2058,2059,760,2060,2061,970,384,169,245,1132,2062,2063,414,1444,2064,2065,41,235,2066,157,252,877,568,919,789,580,2067,725,2068,2069,1292,2070,2071,1445,2072,1446,2073,2074,55,588,66,1447,271,1092,2075,1226,2076,960,1013,372,2077,2078,2079,2080,2081,1293,2082,2083,2084,2085,850, 2086,2087,2088,2089,2090,186,2091,1068,180,2092,2093,2094,109,1227,522,606,2095,867,1448,1093,991,1171,926,353,1133,2096,581,2097,2098,2099,1294,1449,1450,2100,596,1172,1014,1228,2101,1451,1295,1173,1229,2102,2103,1296,1134,1452,949,1135,2104,2105,1094,1453,1454,1455,2106,1095,2107,2108,2109,2110,2111,2112,2113,2114,2115,2116,2117,804,2118,2119,1230,1231,805,1456,405,1136,2120,2121,2122,2123,2124,720,701,1297,992,1457,927,1004,2125,2126,2127,2128,2129,2130,22,417,2131,303,2132,385,2133,971,520,513, 2134,1174,73,1096,231,274,962,1458,673,2135,1459,2136,152,1137,2137,2138,2139,2140,1005,1138,1460,1139,2141,2142,2143,2144,11,374,844,2145,154,1232,46,1461,2146,838,830,721,1233,106,2147,90,428,462,578,566,1175,352,2148,2149,538,1234,124,1298,2150,1462,761,565,2151,686,2152,649,2153,72,173,2154,460,415,2155,1463,2156,1235,305,2157,2158,2159,2160,2161,2162,579,2163,2164,2165,2166,2167,747,2168,2169,2170,2171,1464,669,2172,2173,2174,2175,2176,1465,2177,23,530,285,2178,335,729,2179,397,2180,2181,2182, 1030,2183,2184,698,2185,2186,325,2187,2188,369,2189,799,1097,1015,348,2190,1069,680,2191,851,1466,2192,2193,10,2194,613,424,2195,979,108,449,589,27,172,81,1031,80,774,281,350,1032,525,301,582,1176,2196,674,1045,2197,2198,1467,730,762,2199,2200,2201,2202,1468,2203,993,2204,2205,266,1070,963,1140,2206,2207,2208,664,1098,972,2209,2210,2211,1177,1469,1470,871,2212,2213,2214,2215,2216,1471,2217,2218,2219,2220,2221,2222,2223,2224,2225,2226,2227,1472,1236,2228,2229,2230,2231,2232,2233,2234,2235,1299,2236, 2237,200,2238,477,373,2239,2240,731,825,777,2241,2242,2243,521,486,548,2244,2245,2246,1473,1300,53,549,137,875,76,158,2247,1301,1474,469,396,1016,278,712,2248,321,442,503,767,744,941,1237,1178,1475,2249,82,178,1141,1179,973,2250,1302,2251,297,2252,2253,570,2254,2255,2256,18,450,206,2257,290,292,1142,2258,511,162,99,346,164,735,2259,1476,1477,4,554,343,798,1099,2260,1100,2261,43,171,1303,139,215,2262,2263,717,775,2264,1033,322,216,2265,831,2266,149,2267,1304,2268,2269,702,1238,135,845,347,309,2270, 484,2271,878,655,238,1006,1478,2272,67,2273,295,2274,2275,461,2276,478,942,412,2277,1034,2278,2279,2280,265,2281,541,2282,2283,2284,2285,2286,70,852,1071,2287,2288,2289,2290,21,56,509,117,432,2291,2292,331,980,552,1101,148,284,105,393,1180,1239,755,2293,187,2294,1046,1479,2295,340,2296,63,1047,230,2297,2298,1305,763,1306,101,800,808,494,2299,2300,2301,903,2302,37,1072,14,5,2303,79,675,2304,312,2305,2306,2307,2308,2309,1480,6,1307,2310,2311,2312,1,470,35,24,229,2313,695,210,86,778,15,784,592,779,32, 77,855,964,2314,259,2315,501,380,2316,2317,83,981,153,689,1308,1481,1482,1483,2318,2319,716,1484,2320,2321,2322,2323,2324,2325,1485,2326,2327,128,57,68,261,1048,211,170,1240,31,2328,51,435,742,2329,2330,2331,635,2332,264,456,2333,2334,2335,425,2336,1486,143,507,263,943,2337,363,920,1487,256,1488,1102,243,601,1489,2338,2339,2340,2341,2342,2343,2344,861,2345,2346,2347,2348,2349,2350,395,2351,1490,1491,62,535,166,225,2352,2353,668,419,1241,138,604,928,2354,1181,2355,1492,1493,2356,2357,2358,1143,2359, 696,2360,387,307,1309,682,476,2361,2362,332,12,222,156,2363,232,2364,641,276,656,517,1494,1495,1035,416,736,1496,2365,1017,586,2366,2367,2368,1497,2369,242,2370,2371,2372,1498,2373,965,713,2374,2375,2376,2377,740,982,1499,944,1500,1007,2378,2379,1310,1501,2380,2381,2382,785,329,2383,2384,1502,2385,2386,2387,932,2388,1503,2389,2390,2391,2392,1242,2393,2394,2395,2396,2397,994,950,2398,2399,2400,2401,1504,1311,2402,2403,2404,2405,1049,749,2406,2407,853,718,1144,1312,2408,1182,1505,2409,2410,255,516, 479,564,550,214,1506,1507,1313,413,239,444,339,1145,1036,1508,1509,1314,1037,1510,1315,2411,1511,2412,2413,2414,176,703,497,624,593,921,302,2415,341,165,1103,1512,2416,1513,2417,2418,2419,376,2420,700,2421,2422,2423,258,768,1316,2424,1183,2425,995,608,2426,2427,2428,2429,221,2430,2431,2432,2433,2434,2435,2436,2437,195,323,726,188,897,983,1317,377,644,1050,879,2438,452,2439,2440,2441,2442,2443,2444,914,2445,2446,2447,2448,915,489,2449,1514,1184,2450,2451,515,64,427,495,2452,583,2453,483,485,1038,562, 213,1515,748,666,2454,2455,2456,2457,334,2458,780,996,1008,705,1243,2459,2460,2461,2462,2463,114,2464,493,1146,366,163,1516,961,1104,2465,291,2466,1318,1105,2467,1517,365,2468,355,951,1244,2469,1319,2470,631,2471,2472,218,1320,364,320,756,1518,1519,1321,1520,1322,2473,2474,2475,2476,997,2477,2478,2479,2480,665,1185,2481,916,1521,2482,2483,2484,584,684,2485,2486,797,2487,1051,1186,2488,2489,2490,1522,2491,2492,370,2493,1039,1187,65,2494,434,205,463,1188,2495,125,812,391,402,826,699,286,398,155,781, 771,585,2496,590,505,1073,2497,599,244,219,917,1018,952,646,1523,2498,1323,2499,2500,49,984,354,741,2501,625,2502,1324,2503,1019,190,357,757,491,95,782,868,2504,2505,2506,2507,2508,2509,134,1524,1074,422,1525,898,2510,161,2511,2512,2513,2514,769,2515,1526,2516,2517,411,1325,2518,472,1527,2519,2520,2521,2522,2523,2524,985,2525,2526,2527,2528,2529,2530,764,2531,1245,2532,2533,25,204,311,2534,496,2535,1052,2536,2537,2538,2539,2540,2541,2542,199,704,504,468,758,657,1528,196,44,839,1246,272,750,2543,765, 862,2544,2545,1326,2546,132,615,933,2547,732,2548,2549,2550,1189,1529,2551,283,1247,1053,607,929,2552,2553,2554,930,183,872,616,1040,1147,2555,1148,1020,441,249,1075,2556,2557,2558,466,743,2559,2560,2561,92,514,426,420,526,2562,2563,2564,2565,2566,2567,2568,185,2569,2570,2571,2572,776,1530,658,2573,362,2574,361,922,1076,793,2575,2576,2577,2578,2579,2580,1531,251,2581,2582,2583,2584,1532,54,612,237,1327,2585,2586,275,408,647,111,2587,1533,1106,465,3,458,9,38,2588,107,110,890,209,26,737,498,2589,1534, 2590,431,202,88,1535,356,287,1107,660,1149,2591,381,1536,986,1150,445,1248,1151,974,2592,2593,846,2594,446,953,184,1249,1250,727,2595,923,193,883,2596,2597,2598,102,324,539,817,2599,421,1041,2600,832,2601,94,175,197,406,2602,459,2603,2604,2605,2606,2607,330,555,2608,2609,2610,706,1108,389,2611,2612,2613,2614,233,2615,833,558,931,954,1251,2616,2617,1537,546,2618,2619,1009,2620,2621,2622,1538,690,1328,2623,955,2624,1539,2625,2626,772,2627,2628,2629,2630,2631,924,648,863,603,2632,2633,934,1540,864,865, 2634,642,1042,670,1190,2635,2636,2637,2638,168,2639,652,873,542,1054,1541,2640,2641,2642,2643,2644,2645,2646,2647,2648,2649,2650,2651,2652,2653,2654,2655,2656,2657,2658,2659,2660,2661,2662,2663,2664,2665,2666,2667,2668,2669,2670,2671,2672,2673,2674,2675,2676,2677,2678,2679,2680,2681,2682,2683,2684,2685,2686,2687,2688,2689,2690,2691,2692,2693,2694,2695,2696,2697,2698,2699,1542,880,2700,2701,2702,2703,2704,2705,2706,2707,2708,2709,2710,2711,2712,2713,2714,2715,2716,2717,2718,2719,2720,2721,2722,2723, 2724,2725,1543,2726,2727,2728,2729,2730,2731,2732,1544,2733,2734,2735,2736,2737,2738,2739,2740,2741,2742,2743,2744,2745,2746,2747,2748,2749,2750,2751,2752,2753,2754,1545,2755,2756,2757,2758,2759,2760,2761,2762,2763,2764,2765,2766,1546,2767,1547,2768,2769,2770,2771,2772,2773,2774,2775,2776,2777,2778,2779,2780,2781,2782,2783,2784,2785,2786,1548,2787,2788,2789,1109,2790,2791,2792,2793,2794,2795,2796,2797,2798,2799,2800,2801,2802,2803,2804,2805,2806,2807,2808,2809,2810,2811,2812,1329,2813,2814,2815,2816, 2817,2818,2819,2820,2821,2822,2823,2824,2825,2826,2827,2828,2829,2830,2831,2832,2833,2834,2835,2836,2837,2838,2839,2840,2841,2842,2843,2844,2845,2846,2847,2848,2849,2850,2851,2852,2853,2854,2855,2856,1549,2857,2858,2859,2860,1550,2861,2862,1551,2863,2864,2865,2866,2867,2868,2869,2870,2871,2872,2873,2874,1110,1330,2875,2876,2877,2878,2879,2880,2881,2882,2883,2884,2885,2886,2887,2888,2889,2890,2891,2892,2893,2894,2895,2896,2897,2898,2899,2900,2901,2902,2903,2904,2905,2906,2907,2908,2909,2910,2911,2912, 2913,2914,2915,2916,2917,2918,2919,2920,2921,2922,2923,2924,2925,2926,2927,2928,2929,2930,1331,2931,2932,2933,2934,2935,2936,2937,2938,2939,2940,2941,2942,2943,1552,2944,2945,2946,2947,2948,2949,2950,2951,2952,2953,2954,2955,2956,2957,2958,2959,2960,2961,2962,2963,2964,1252,2965,2966,2967,2968,2969,2970,2971,2972,2973,2974,2975,2976,2977,2978,2979,2980,2981,2982,2983,2984,2985,2986,2987,2988,2989,2990,2991,2992,2993,2994,2995,2996,2997,2998,2999,3E3,3001,3002,3003,3004,3005,3006,3007,3008,3009,3010, 3011,3012,1553,3013,3014,3015,3016,3017,1554,3018,1332,3019,3020,3021,3022,3023,3024,3025,3026,3027,3028,3029,3030,3031,3032,3033,3034,3035,3036,3037,3038,3039,3040,3041,3042,3043,3044,3045,3046,3047,3048,3049,3050,1555,3051,3052,3053,1556,1557,3054,3055,3056,3057,3058,3059,3060,3061,3062,3063,3064,3065,3066,3067,1558,3068,3069,3070,3071,3072,3073,3074,3075,3076,1559,3077,3078,3079,3080,3081,3082,3083,1253,3084,3085,3086,3087,3088,3089,3090,3091,3092,3093,3094,3095,3096,3097,3098,3099,3100,3101,3102, 3103,3104,3105,3106,3107,3108,1152,3109,3110,3111,3112,3113,1560,3114,3115,3116,3117,1111,3118,3119,3120,3121,3122,3123,3124,3125,3126,3127,3128,3129,3130,3131,3132,3133,3134,3135,3136,3137,3138,3139,3140,3141,3142,3143,3144,3145,3146,3147,3148,3149,3150,3151,3152,3153,3154,3155,3156,3157,3158,3159,3160,3161,3162,3163,3164,3165,3166,3167,3168,3169,3170,3171,3172,3173,3174,3175,3176,1333,3177,3178,3179,3180,3181,3182,3183,3184,3185,3186,3187,3188,3189,1561,3190,3191,1334,3192,3193,3194,3195,3196,3197, 3198,3199,3200,3201,3202,3203,3204,3205,3206,3207,3208,3209,3210,3211,3212,3213,3214,3215,3216,3217,3218,3219,3220,3221,3222,3223,3224,3225,3226,3227,3228,3229,3230,3231,3232,3233,3234,1562,3235,3236,3237,3238,3239,3240,3241,3242,3243,3244,3245,3246,3247,3248,3249,3250,3251,3252,3253,3254,3255,3256,3257,3258,3259,3260,3261,3262,3263,3264,3265,3266,3267,3268,3269,3270,3271,3272,3273,3274,3275,3276,3277,1563,3278,3279,3280,3281,3282,3283,3284,3285,3286,3287,3288,3289,3290,3291,3292,3293,3294,3295,3296, 3297,3298,3299,3300,3301,3302,3303,3304,3305,3306,3307,3308,3309,3310,3311,3312,3313,3314,3315,3316,3317,3318,3319,3320,3321,3322,3323,3324,3325,3326,3327,3328,3329,3330,3331,3332,3333,3334,3335,3336,3337,3338,3339,3340,3341,3342,3343,3344,3345,3346,3347,3348,3349,3350,3351,3352,3353,3354,3355,3356,3357,3358,3359,3360,3361,3362,3363,3364,1335,3365,3366,3367,3368,3369,3370,3371,3372,3373,3374,3375,3376,3377,3378,3379,3380,3381,3382,3383,3384,3385,3386,3387,1336,3388,3389,3390,3391,3392,3393,3394,3395, 3396,3397,3398,3399,3400,3401,3402,3403,3404,3405,3406,3407,3408,3409,3410,3411,3412,3413,3414,1337,3415,3416,3417,3418,3419,1338,3420,3421,3422,1564,1565,3423,3424,3425,3426,3427,3428,3429,3430,3431,1254,3432,3433,3434,1339,3435,3436,3437,3438,3439,1566,3440,3441,3442,3443,3444,3445,3446,3447,3448,3449,3450,3451,3452,3453,3454,1255,3455,3456,3457,3458,3459,1567,1191,3460,1568,1569,3461,3462,3463,1570,3464,3465,3466,3467,3468,1571,3469,3470,3471,3472,3473,1572,3474,3475,3476,3477,3478,3479,3480,3481, 3482,3483,3484,3485,3486,1340,3487,3488,3489,3490,3491,3492,1021,3493,3494,3495,3496,3497,3498,1573,3499,1341,3500,3501,3502,3503,3504,3505,3506,3507,3508,3509,3510,3511,1342,3512,3513,3514,3515,3516,1574,1343,3517,3518,3519,1575,3520,1576,3521,3522,3523,3524,3525,3526,3527,3528,3529,3530,3531,3532,3533,3534,3535,3536,3537,3538,3539,3540,3541,3542,3543,3544,3545,3546,3547,3548,3549,3550,3551,3552,3553,3554,3555,3556,3557,3558,3559,3560,3561,3562,3563,3564,3565,3566,3567,3568,3569,3570,3571,3572,3573, 3574,3575,3576,3577,3578,3579,3580,1577,3581,3582,1578,3583,3584,3585,3586,3587,3588,3589,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,3602,3603,3604,1579,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,1580,3630,3631,1581,3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,3643,3644,3645,3646,3647,3648,3649,3650,3651,3652,3653,3654,3655,3656,1582,3657,3658,3659,3660,3661,3662,3663,3664,3665,3666,3667,3668, 3669,3670,3671,3672,3673,3674,3675,3676,3677,3678,3679,3680,3681,3682,3683,3684,3685,3686,3687,3688,3689,3690,3691,3692,3693,3694,3695,3696,3697,3698,3699,3700,1192,3701,3702,3703,3704,1256,3705,3706,3707,3708,1583,1257,3709,3710,3711,3712,3713,3714,3715,3716,1584,3717,3718,3719,3720,3721,3722,3723,3724,3725,3726,3727,3728,3729,3730,3731,3732,3733,3734,3735,3736,3737,3738,3739,3740,3741,3742,3743,3744,3745,1344,3746,3747,3748,3749,3750,3751,3752,3753,3754,3755,3756,1585,3757,3758,3759,3760,3761,3762, 3763,3764,3765,3766,1586,3767,3768,3769,3770,3771,3772,3773,3774,3775,3776,3777,3778,1345,3779,3780,3781,3782,3783,3784,3785,3786,3787,3788,3789,3790,3791,3792,3793,3794,3795,1346,1587,3796,3797,1588,3798,3799,3800,3801,3802,3803,3804,3805,3806,1347,3807,3808,3809,3810,3811,1589,3812,3813,3814,3815,3816,3817,3818,3819,3820,3821,1590,3822,3823,1591,1348,3824,3825,3826,3827,3828,3829,3830,1592,3831,3832,1593,3833,3834,3835,3836,3837,3838,3839,3840,3841,3842,3843,3844,1349,3845,3846,3847,3848,3849,3850, 3851,3852,3853,3854,3855,3856,3857,3858,1594,3859,3860,3861,3862,3863,3864,3865,3866,3867,3868,3869,1595,3870,3871,3872,3873,1596,3874,3875,3876,3877,3878,3879,3880,3881,3882,3883,3884,3885,3886,1597,3887,3888,3889,3890,3891,3892,3893,3894,3895,1598,3896,3897,3898,1599,1600,3899,1350,3900,1351,3901,3902,1352,3903,3904,3905,3906,3907,3908,3909,3910,3911,3912,3913,3914,3915,3916,3917,3918,3919,3920,3921,3922,3923,3924,1258,3925,3926,3927,3928,3929,3930,3931,1193,3932,1601,3933,3934,3935,3936,3937,3938, 3939,3940,3941,3942,3943,1602,3944,3945,3946,3947,3948,1603,3949,3950,3951,3952,3953,3954,3955,3956,3957,3958,3959,3960,3961,3962,3963,3964,3965,1604,3966,3967,3968,3969,3970,3971,3972,3973,3974,3975,3976,3977,1353,3978,3979,3980,3981,3982,3983,3984,3985,3986,3987,3988,3989,3990,3991,1354,3992,3993,3994,3995,3996,3997,3998,3999,4E3,4001,4002,4003,4004,4005,4006,4007,4008,4009,4010,4011,4012,4013,4014,4015,4016,4017,4018,4019,4020,4021,4022,4023,1355,4024,4025,4026,4027,4028,4029,4030,4031,4032,4033, 4034,4035,4036,4037,4038,4039,4040,1605,4041,4042,4043,4044,4045,4046,4047,4048,4049,4050,4051,4052,4053,4054,4055,4056,4057,4058,4059,4060,1606,4061,4062,4063,4064,1607,4065,4066,4067,4068,4069,4070,4071,4072,4073,4074,4075,4076,1194,4077,4078,1608,4079,4080,4081,4082,4083,4084,4085,4086,4087,1609,4088,4089,4090,4091,4092,4093,4094,4095,4096,4097,4098,4099,4100,4101,4102,4103,4104,4105,4106,4107,4108,1259,4109,4110,4111,4112,4113,4114,4115,4116,4117,4118,4119,4120,4121,4122,4123,4124,1195,4125,4126, 4127,1610,4128,4129,4130,4131,4132,4133,4134,4135,4136,4137,1356,4138,4139,4140,4141,4142,4143,4144,1611,4145,4146,4147,4148,4149,4150,4151,4152,4153,4154,4155,4156,4157,4158,4159,4160,4161,4162,4163,4164,4165,4166,4167,4168,4169,4170,4171,4172,4173,4174,4175,4176,4177,4178,4179,4180,4181,4182,4183,4184,4185,4186,4187,4188,4189,4190,4191,4192,4193,4194,4195,4196,4197,4198,4199,4200,4201,4202,4203,4204,4205,4206,4207,4208,4209,4210,4211,4212,4213,4214,4215,4216,4217,4218,4219,1612,4220,4221,4222,4223, 4224,4225,4226,4227,1357,4228,1613,4229,4230,4231,4232,4233,4234,4235,4236,4237,4238,4239,4240,4241,4242,4243,1614,4244,4245,4246,4247,4248,4249,4250,4251,4252,4253,4254,4255,4256,4257,4258,4259,4260,4261,4262,4263,4264,4265,4266,4267,4268,4269,4270,1196,1358,4271,4272,4273,4274,4275,4276,4277,4278,4279,4280,4281,4282,4283,4284,4285,4286,4287,1615,4288,4289,4290,4291,4292,4293,4294,4295,4296,4297,4298,4299,4300,4301,4302,4303,4304,4305,4306,4307,4308,4309,4310,4311,4312,4313,4314,4315,4316,4317,4318, 4319,4320,4321,4322,4323,4324,4325,4326,4327,4328,4329,4330,4331,4332,4333,4334,1616,4335,4336,4337,4338,4339,4340,4341,4342,4343,4344,4345,4346,4347,4348,4349,4350,4351,4352,4353,4354,4355,4356,4357,4358,4359,4360,1617,4361,4362,4363,4364,4365,1618,4366,4367,4368,4369,4370,4371,4372,4373,4374,4375,4376,4377,4378,4379,4380,4381,4382,4383,4384,4385,4386,4387,4388,4389,4390,4391,4392,4393,4394,4395,4396,4397,4398,4399,4400,4401,4402,4403,4404,4405,4406,4407,4408,4409,4410,4411,4412,4413,4414,4415,4416, 1619,4417,4418,4419,4420,4421,4422,4423,4424,4425,1112,4426,4427,4428,4429,4430,1620,4431,4432,4433,4434,4435,4436,4437,4438,4439,4440,4441,4442,1260,1261,4443,4444,4445,4446,4447,4448,4449,4450,4451,4452,4453,4454,4455,1359,4456,4457,4458,4459,4460,4461,4462,4463,4464,4465,1621,4466,4467,4468,4469,4470,4471,4472,4473,4474,4475,4476,4477,4478,4479,4480,4481,4482,4483,4484,4485,4486,4487,4488,4489,1055,4490,4491,4492,4493,4494,4495,4496,4497,4498,4499,4500,4501,4502,4503,4504,4505,4506,4507,4508,4509, 4510,4511,4512,4513,4514,4515,4516,4517,4518,1622,4519,4520,4521,1623,4522,4523,4524,4525,4526,4527,4528,4529,4530,4531,4532,4533,4534,4535,1360,4536,4537,4538,4539,4540,4541,4542,4543,975,4544,4545,4546,4547,4548,4549,4550,4551,4552,4553,4554,4555,4556,4557,4558,4559,4560,4561,4562,4563,4564,4565,4566,4567,4568,4569,4570,4571,1624,4572,4573,4574,4575,4576,1625,4577,4578,4579,4580,4581,4582,4583,4584,1626,4585,4586,4587,4588,4589,4590,4591,4592,4593,4594,4595,1627,4596,4597,4598,4599,4600,4601,4602, 4603,4604,4605,4606,4607,4608,4609,4610,4611,4612,4613,4614,4615,1628,4616,4617,4618,4619,4620,4621,4622,4623,4624,4625,4626,4627,4628,4629,4630,4631,4632,4633,4634,4635,4636,4637,4638,4639,4640,4641,4642,4643,4644,4645,4646,4647,4648,4649,1361,4650,4651,4652,4653,4654,4655,4656,4657,4658,4659,4660,4661,1362,4662,4663,4664,4665,4666,4667,4668,4669,4670,4671,4672,4673,4674,4675,4676,4677,4678,4679,4680,4681,4682,1629,4683,4684,4685,4686,4687,1630,4688,4689,4690,4691,1153,4692,4693,4694,1113,4695,4696, 4697,4698,4699,4700,4701,4702,4703,4704,4705,4706,4707,4708,4709,4710,4711,1197,4712,4713,4714,4715,4716,4717,4718,4719,4720,4721,4722,4723,4724,4725,4726,4727,4728,4729,4730,4731,4732,4733,4734,4735,1631,4736,1632,4737,4738,4739,4740,4741,4742,4743,4744,1633,4745,4746,4747,4748,4749,1262,4750,4751,4752,4753,4754,1363,4755,4756,4757,4758,4759,4760,4761,4762,4763,4764,4765,4766,4767,4768,1634,4769,4770,4771,4772,4773,4774,4775,4776,4777,4778,1635,4779,4780,4781,4782,4783,4784,4785,4786,4787,4788,4789, 1636,4790,4791,4792,4793,4794,4795,4796,4797,4798,4799,4800,4801,4802,4803,4804,4805,4806,1637,4807,4808,4809,1638,4810,4811,4812,4813,4814,4815,4816,4817,4818,1639,4819,4820,4821,4822,4823,4824,4825,4826,4827,4828,4829,4830,4831,4832,4833,1077,4834,4835,4836,4837,4838,4839,4840,4841,4842,4843,4844,4845,4846,4847,4848,4849,4850,4851,4852,4853,4854,4855,4856,4857,4858,4859,4860,4861,4862,4863,4864,4865,4866,4867,4868,4869,4870,4871,4872,4873,4874,4875,4876,4877,4878,4879,4880,4881,4882,4883,1640,4884, 4885,1641,4886,4887,4888,4889,4890,4891,4892,4893,4894,4895,4896,4897,4898,4899,4900,4901,4902,4903,4904,4905,4906,4907,4908,4909,4910,4911,1642,4912,4913,4914,1364,4915,4916,4917,4918,4919,4920,4921,4922,4923,4924,4925,4926,4927,4928,4929,4930,4931,1643,4932,4933,4934,4935,4936,4937,4938,4939,4940,4941,4942,4943,4944,4945,4946,4947,4948,4949,4950,4951,4952,4953,4954,4955,4956,4957,4958,4959,4960,4961,4962,4963,4964,4965,4966,4967,4968,4969,4970,4971,4972,4973,4974,4975,4976,4977,4978,4979,4980,1644, 4981,4982,4983,4984,1645,4985,4986,1646,4987,4988,4989,4990,4991,4992,4993,4994,4995,4996,4997,4998,4999,5E3,5001,5002,5003,5004,5005,1647,5006,1648,5007,5008,5009,5010,5011,5012,1078,5013,5014,5015,5016,5017,5018,5019,5020,5021,5022,5023,5024,5025,5026,5027,5028,1365,5029,5030,5031,5032,5033,5034,5035,5036,5037,5038,5039,1649,5040,5041,5042,5043,5044,5045,1366,5046,5047,5048,5049,5050,5051,5052,5053,5054,5055,1650,5056,5057,5058,5059,5060,5061,5062,5063,5064,5065,5066,5067,5068,5069,5070,5071,5072, 5073,5074,5075,5076,5077,1651,5078,5079,5080,5081,5082,5083,5084,5085,5086,5087,5088,5089,5090,5091,5092,5093,5094,5095,5096,5097,5098,5099,5100,5101,5102,5103,5104,5105,5106,5107,5108,5109,5110,1652,5111,5112,5113,5114,5115,5116,5117,5118,1367,5119,5120,5121,5122,5123,5124,5125,5126,5127,5128,5129,1653,5130,5131,5132,5133,5134,5135,5136,5137,5138,5139,5140,5141,5142,5143,5144,5145,5146,5147,5148,5149,1368,5150,1654,5151,1369,5152,5153,5154,5155,5156,5157,5158,5159,5160,5161,5162,5163,5164,5165,5166, 5167,5168,5169,5170,5171,5172,5173,5174,5175,5176,5177,5178,1370,5179,5180,5181,5182,5183,5184,5185,5186,5187,5188,5189,5190,5191,5192,5193,5194,5195,5196,5197,5198,1655,5199,5200,5201,5202,1656,5203,5204,5205,5206,1371,5207,1372,5208,5209,5210,5211,1373,5212,5213,1374,5214,5215,5216,5217,5218,5219,5220,5221,5222,5223,5224,5225,5226,5227,5228,5229,5230,5231,5232,5233,5234,5235,5236,5237,5238,5239,5240,5241,5242,5243,5244,5245,5246,5247,1657,5248,5249,5250,5251,1658,1263,5252,5253,5254,5255,5256,1375, 5257,5258,5259,5260,5261,5262,5263,5264,5265,5266,5267,5268,5269,5270,5271,5272,5273,5274,5275,5276,5277,5278,5279,5280,5281,5282,5283,1659,5284,5285,5286,5287,5288,5289,5290,5291,5292,5293,5294,5295,5296,5297,5298,5299,5300,1660,5301,5302,5303,5304,5305,5306,5307,5308,5309,5310,5311,5312,5313,5314,5315,5316,5317,5318,5319,5320,5321,1376,5322,5323,5324,5325,5326,5327,5328,5329,5330,5331,5332,5333,1198,5334,5335,5336,5337,5338,5339,5340,5341,5342,5343,1661,5344,5345,5346,5347,5348,5349,5350,5351,5352, 5353,5354,5355,5356,5357,5358,5359,5360,5361,5362,5363,5364,5365,5366,5367,5368,5369,5370,5371,5372,5373,5374,5375,5376,5377,5378,5379,5380,5381,5382,5383,5384,5385,5386,5387,5388,5389,5390,5391,5392,5393,5394,5395,5396,5397,5398,1264,5399,5400,5401,5402,5403,5404,5405,5406,5407,5408,5409,5410,5411,5412,1662,5413,5414,5415,5416,1663,5417,5418,5419,5420,5421,5422,5423,5424,5425,5426,5427,5428,5429,5430,5431,5432,5433,5434,5435,5436,5437,5438,1664,5439,5440,5441,5442,5443,5444,5445,5446,5447,5448,5449, 5450,5451,5452,5453,5454,5455,5456,5457,5458,5459,5460,5461,5462,5463,5464,5465,5466,5467,5468,5469,5470,5471,5472,5473,5474,5475,5476,5477,5478,1154,5479,5480,5481,5482,5483,5484,5485,1665,5486,5487,5488,5489,5490,5491,5492,5493,5494,5495,5496,5497,5498,5499,5500,5501,5502,5503,5504,5505,5506,5507,5508,5509,5510,5511,5512,5513,5514,5515,5516,5517,5518,5519,5520,5521,5522,5523,5524,5525,5526,5527,5528,5529,5530,5531,5532,5533,5534,5535,5536,5537,5538,5539,5540,5541,5542,5543,5544,5545,5546,5547,5548, 1377,5549,5550,5551,5552,5553,5554,5555,5556,5557,5558,5559,5560,5561,5562,5563,5564,5565,5566,5567,5568,5569,5570,1114,5571,5572,5573,5574,5575,5576,5577,5578,5579,5580,5581,5582,5583,5584,5585,5586,5587,5588,5589,5590,5591,5592,1378,5593,5594,5595,5596,5597,5598,5599,5600,5601,5602,5603,5604,5605,5606,5607,5608,5609,5610,5611,5612,5613,5614,1379,5615,5616,5617,5618,5619,5620,5621,5622,5623,5624,5625,5626,5627,5628,5629,5630,5631,5632,5633,5634,1380,5635,5636,5637,5638,5639,5640,5641,5642,5643,5644, 5645,5646,5647,5648,5649,1381,1056,5650,5651,5652,5653,5654,5655,5656,5657,5658,5659,5660,1666,5661,5662,5663,5664,5665,5666,5667,5668,1667,5669,1668,5670,5671,5672,5673,5674,5675,5676,5677,5678,1155,5679,5680,5681,5682,5683,5684,5685,5686,5687,5688,5689,5690,5691,5692,5693,5694,5695,5696,5697,5698,1669,5699,5700,5701,5702,5703,5704,5705,1670,5706,5707,5708,5709,5710,1671,5711,5712,5713,5714,1382,5715,5716,5717,5718,5719,5720,5721,5722,5723,5724,5725,1672,5726,5727,1673,1674,5728,5729,5730,5731,5732, 5733,5734,5735,5736,1675,5737,5738,5739,5740,5741,5742,5743,5744,1676,5745,5746,5747,5748,5749,5750,5751,1383,5752,5753,5754,5755,5756,5757,5758,5759,5760,5761,5762,5763,5764,5765,5766,5767,5768,1677,5769,5770,5771,5772,5773,1678,5774,5775,5776,998,5777,5778,5779,5780,5781,5782,5783,5784,5785,1384,5786,5787,5788,5789,5790,5791,5792,5793,5794,5795,5796,5797,5798,5799,5800,1679,5801,5802,5803,1115,1116,5804,5805,5806,5807,5808,5809,5810,5811,5812,5813,5814,5815,5816,5817,5818,5819,5820,5821,5822,5823, 5824,5825,5826,5827,5828,5829,5830,5831,5832,5833,5834,5835,5836,5837,5838,5839,5840,5841,5842,5843,5844,5845,5846,5847,5848,5849,5850,5851,5852,5853,5854,5855,1680,5856,5857,5858,5859,5860,5861,5862,5863,5864,1681,5865,5866,5867,1682,5868,5869,5870,5871,5872,5873,5874,5875,5876,5877,5878,5879,1683,5880,1684,5881,5882,5883,5884,1685,5885,5886,5887,5888,5889,5890,5891,5892,5893,5894,5895,5896,5897,5898,5899,5900,5901,5902,5903,5904,5905,5906,5907,1686,5908,5909,5910,5911,5912,5913,5914,5915,5916,5917, 5918,5919,5920,5921,5922,5923,5924,5925,5926,5927,5928,5929,5930,5931,5932,5933,5934,5935,1687,5936,5937,5938,5939,5940,5941,5942,5943,5944,5945,5946,5947,5948,5949,5950,5951,5952,1688,1689,5953,1199,5954,5955,5956,5957,5958,5959,5960,5961,1690,5962,5963,5964,5965,5966,5967,5968,5969,5970,5971,5972,5973,5974,5975,5976,5977,5978,5979,5980,5981,1385,5982,1386,5983,5984,5985,5986,5987,5988,5989,5990,5991,5992,5993,5994,5995,5996,5997,5998,5999,6E3,6001,6002,6003,6004,6005,6006,6007,6008,6009,6010,6011, 6012,6013,6014,6015,6016,6017,6018,6019,6020,6021,6022,6023,6024,6025,6026,6027,1265,6028,6029,1691,6030,6031,6032,6033,6034,6035,6036,6037,6038,6039,6040,6041,6042,6043,6044,6045,6046,6047,6048,6049,6050,6051,6052,6053,6054,6055,6056,6057,6058,6059,6060,6061,6062,6063,6064,6065,6066,6067,6068,6069,6070,6071,6072,6073,6074,6075,6076,6077,6078,6079,6080,6081,6082,6083,6084,1692,6085,6086,6087,6088,6089,6090,6091,6092,6093,6094,6095,6096,6097,6098,6099,6100,6101,6102,6103,6104,6105,6106,6107,6108,6109, 6110,6111,6112,6113,6114,6115,6116,6117,6118,6119,6120,6121,6122,6123,6124,6125,6126,6127,6128,6129,6130,6131,1693,6132,6133,6134,6135,6136,1694,6137,6138,6139,6140,6141,1695,6142,6143,6144,6145,6146,6147,6148,6149,6150,6151,6152,6153,6154,6155,6156,6157,6158,6159,6160,6161,6162,6163,6164,6165,6166,6167,6168,6169,6170,6171,6172,6173,6174,6175,6176,6177,6178,6179,6180,6181,6182,6183,6184,6185,1696,6186,6187,6188,6189,6190,6191,6192,6193,6194,6195,6196,6197,6198,6199,6200,6201,6202,6203,6204,6205,6206, 6207,6208,6209,6210,6211,6212,6213,6214,6215,6216,6217,6218,6219,1697,6220,6221,6222,6223,6224,6225,6226,6227,6228,6229,6230,6231,6232,6233,6234,6235,6236,6237,6238,6239,6240,6241,6242,6243,6244,6245,6246,6247,6248,6249,6250,6251,6252,6253,1698,6254,6255,6256,6257,6258,6259,6260,6261,6262,6263,1200,6264,6265,6266,6267,6268,6269,6270,6271,6272,6273,6274,6275,6276,6277,6278,6279,6280,6281,6282,6283,6284,6285,6286,6287,6288,6289,6290,6291,6292,6293,6294,6295,6296,6297,6298,6299,6300,6301,6302,1699,6303, 6304,1700,6305,6306,6307,6308,6309,6310,6311,6312,6313,6314,6315,6316,6317,6318,6319,6320,6321,6322,6323,6324,6325,6326,6327,6328,6329,6330,6331,6332,6333,6334,6335,6336,6337,6338,6339,1701,6340,6341,6342,6343,6344,1387,6345,6346,6347,6348,6349,6350,6351,6352,6353,6354,6355,6356,6357,6358,6359,6360,6361,6362,6363,6364,6365,6366,6367,6368,6369,6370,6371,6372,6373,6374,6375,6376,6377,6378,6379,6380,6381,6382,6383,6384,6385,6386,6387,6388,6389,6390,6391,6392,6393,6394,6395,6396,6397,6398,6399,6400,6401, 6402,6403,6404,6405,6406,6407,6408,6409,6410,6411,6412,6413,1702,6414,6415,6416,6417,6418,6419,6420,6421,6422,1703,6423,6424,6425,6426,6427,6428,6429,6430,6431,6432,6433,6434,6435,6436,6437,6438,1704,6439,6440,6441,6442,6443,6444,6445,6446,6447,6448,6449,6450,6451,6452,6453,6454,6455,6456,6457,6458,6459,6460,6461,6462,6463,6464,6465,6466,6467,6468,6469,6470,6471,6472,6473,6474,6475,6476,6477,6478,6479,6480,6481,6482,6483,6484,6485,6486,6487,6488,6489,6490,6491,6492,6493,6494,6495,6496,6497,6498,6499, 6500,6501,6502,6503,1266,6504,6505,6506,6507,6508,6509,6510,6511,6512,6513,6514,6515,6516,6517,6518,6519,6520,6521,6522,6523,6524,6525,6526,6527,6528,6529,6530,6531,6532,6533,6534,6535,6536,6537,6538,6539,6540,6541,6542,6543,6544,6545,6546,6547,6548,6549,6550,6551,1705,1706,6552,6553,6554,6555,6556,6557,6558,6559,6560,6561,6562,6563,6564,6565,6566,6567,6568,6569,6570,6571,6572,6573,6574,6575,6576,6577,6578,6579,6580,6581,6582,6583,6584,6585,6586,6587,6588,6589,6590,6591,6592,6593,6594,6595,6596,6597, 6598,6599,6600,6601,6602,6603,6604,6605,6606,6607,6608,6609,6610,6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621,6622,6623,6624,6625,6626,6627,6628,6629,6630,6631,6632,6633,6634,6635,6636,6637,1388,6638,6639,6640,6641,6642,6643,6644,1707,6645,6646,6647,6648,6649,6650,6651,6652,6653,6654,6655,6656,6657,6658,6659,6660,6661,6662,6663,1708,6664,6665,6666,6667,6668,6669,6670,6671,6672,6673,6674,1201,6675,6676,6677,6678,6679,6680,6681,6682,6683,6684,6685,6686,6687,6688,6689,6690,6691,6692,6693,6694, 6695,6696,6697,6698,6699,6700,6701,6702,6703,6704,6705,6706,6707,6708,6709,6710,6711,6712,6713,6714,6715,6716,6717,6718,6719,6720,6721,6722,6723,6724,6725,1389,6726,6727,6728,6729,6730,6731,6732,6733,6734,6735,6736,1390,1709,6737,6738,6739,6740,6741,6742,1710,6743,6744,6745,6746,1391,6747,6748,6749,6750,6751,6752,6753,6754,6755,6756,6757,1392,6758,6759,6760,6761,6762,6763,6764,6765,6766,6767,6768,6769,6770,6771,6772,6773,6774,6775,6776,6777,6778,6779,6780,1202,6781,6782,6783,6784,6785,6786,6787,6788, 6789,6790,6791,6792,6793,6794,6795,6796,6797,6798,6799,6800,6801,6802,6803,6804,6805,6806,6807,6808,6809,1711,6810,6811,6812,6813,6814,6815,6816,6817,6818,6819,6820,6821,6822,6823,6824,6825,6826,6827,6828,6829,6830,6831,6832,6833,6834,6835,6836,1393,6837,6838,6839,6840,6841,6842,6843,6844,6845,6846,6847,6848,6849,6850,6851,6852,6853,6854,6855,6856,6857,6858,6859,6860,6861,6862,6863,6864,6865,6866,6867,6868,6869,6870,6871,6872,6873,6874,6875,6876,6877,6878,6879,6880,6881,6882,6883,6884,6885,6886,6887, 6888,6889,6890,6891,6892,6893,6894,6895,6896,6897,6898,6899,6900,6901,6902,1712,6903,6904,6905,6906,6907,6908,6909,6910,1713,6911,6912,6913,6914,6915,6916,6917,6918,6919,6920,6921,6922,6923,6924,6925,6926,6927,6928,6929,6930,6931,6932,6933,6934,6935,6936,6937,6938,6939,6940,6941,6942,6943,6944,6945,6946,6947,6948,6949,6950,6951,6952,6953,6954,6955,6956,6957,6958,6959,6960,6961,6962,6963,6964,6965,6966,6967,6968,6969,6970,6971,6972,6973,6974,1714,6975,6976,6977,6978,6979,6980,6981,6982,6983,6984,6985, 6986,6987,6988,1394,6989,6990,6991,6992,6993,6994,6995,6996,6997,6998,6999,7E3,1715,7001,7002,7003,7004,7005,7006,7007,7008,7009,7010,7011,7012,7013,7014,7015,7016,7017,7018,7019,7020,7021,7022,7023,7024,7025,7026,7027,7028,1716,7029,7030,7031,7032,7033,7034,7035,7036,7037,7038,7039,7040,7041,7042,7043,7044,7045,7046,7047,7048,7049,7050,7051,7052,7053,7054,7055,7056,7057,7058,7059,7060,7061,7062,7063,7064,7065,7066,7067,7068,7069,7070,7071,7072,7073,7074,7075,7076,7077,7078,7079,7080,7081,7082,7083, 7084,7085,7086,7087,7088,7089,7090,7091,7092,7093,7094,7095,7096,7097,7098,7099,7100,7101,7102,7103,7104,7105,7106,7107,7108,7109,7110,7111,7112,7113,7114,7115,7116,7117,7118,7119,7120,7121,7122,7123,7124,7125,7126,7127,7128,7129,7130,7131,7132,7133,7134,7135,7136,7137,7138,7139,7140,7141,7142,7143,7144,7145,7146,7147,7148,7149,7150,7151,7152,7153,7154,7155,7156,7157,7158,7159,7160,7161,7162,7163,7164,7165,7166,7167,7168,7169,7170,7171,7172,7173,7174,7175,7176,7177,7178,7179,7180,7181,7182,7183,7184, 7185,7186,7187,7188,7189,7190,7191,7192,7193,7194,7195,7196,7197,7198,7199,7200,7201,7202,7203,7204,7205,7206,7207,1395,7208,7209,7210,7211,7212,7213,1717,7214,7215,7216,7217,7218,7219,7220,7221,7222,7223,7224,7225,7226,7227,7228,7229,7230,7231,7232,7233,7234,7235,7236,7237,7238,7239,7240,7241,7242,7243,7244,7245,7246,7247,7248,7249,7250,7251,7252,7253,7254,7255,7256,7257,7258,7259,7260,7261,7262,7263,7264,7265,7266,7267,7268,7269,7270,7271,7272,7273,7274,7275,7276,7277,7278,7279,7280,7281,7282,7283, 7284,7285,7286,7287,7288,7289,7290,7291,7292,7293,7294,7295,7296,7297,7298,7299,7300,7301,7302,7303,7304,7305,7306,7307,7308,7309,7310,7311,7312,7313,1718,7314,7315,7316,7317,7318,7319,7320,7321,7322,7323,7324,7325,7326,7327,7328,7329,7330,7331,7332,7333,7334,7335,7336,7337,7338,7339,7340,7341,7342,7343,7344,7345,7346,7347,7348,7349,7350,7351,7352,7353,7354,7355,7356,7357,7358,7359,7360,7361,7362,7363,7364,7365,7366,7367,7368,7369,7370,7371,7372,7373,7374,7375,7376,7377,7378,7379,7380,7381,7382,7383, 7384,7385,7386,7387,7388,7389,7390,7391,7392,7393,7394,7395,7396,7397,7398,7399,7400,7401,7402,7403,7404,7405,7406,7407,7408,7409,7410,7411,7412,7413,7414,7415,7416,7417,7418,7419,7420,7421,7422,7423,7424,7425,7426,7427,7428,7429,7430,7431,7432,7433,7434,7435,7436,7437,7438,7439,7440,7441,7442,7443,7444,7445,7446,7447,7448,7449,7450,7451,7452,7453,7454,7455,7456,7457,7458,7459,7460,7461,7462,7463,7464,7465,7466,7467,7468,7469,7470,7471,7472,7473,7474,7475,7476,7477,7478,7479,7480,7481,7482,7483,7484, 7485,7486,7487,7488,7489,7490,7491,7492,7493,7494,7495,7496,7497,7498,7499,7500,7501,7502,7503,7504,7505,7506,7507,7508,7509,7510,7511,7512,7513,7514,7515,7516,7517,7518,7519,7520,7521,7522,7523,7524,7525,7526,7527,7528,7529,7530,7531,7532,7533,7534,7535,7536,7537,7538,7539,7540,7541,7542,7543,7544,7545,7546,7547,7548,7549,7550,7551,7552,7553,7554,7555,7556,7557,7558,7559,7560,7561,7562,7563,7564,7565,7566,7567,7568,7569,7570,7571,7572,7573,7574,7575,7576,7577,7578,7579,7580,7581,7582,7583,7584,7585, 7586,7587,7588,7589,7590,7591,7592,7593,7594,7595,7596,7597,7598,7599,7600,7601,7602,7603,7604,7605,7606,7607,7608,7609,7610,7611,7612,7613,7614,7615,7616,7617,7618,7619,7620,7621,7622,7623,7624,7625,7626,7627,7628,7629,7630,7631,7632,7633,7634,7635,7636,7637,7638,7639,7640,7641,7642,7643,7644,7645,7646,7647,7648,7649,7650,7651,7652,7653,7654,7655,7656,7657,7658,7659,7660,7661,7662,7663,7664,7665,7666,7667,7668,7669,7670,7671,7672,7673,7674,7675,7676,7677,7678,7679,7680,7681,7682,7683,7684,7685,7686, 7687,7688,7689,7690,7691,7692,7693,7694,7695,7696,7697,7698,7699,7700,7701,7702,7703,7704,7705,7706,7707,7708,7709,7710,7711,7712,7713,7714,7715,7716,7717,7718,7719,7720,7721,7722,7723,7724,7725,7726,7727,7728,7729,7730,7731,7732,7733,7734,7735,7736,7737,7738,7739,7740,7741,7742,7743,7744,7745,7746,7747,7748,7749,7750,7751,7752,7753,7754,7755,7756,7757,7758,7759,7760,7761,7762,7763,7764,7765,7766,7767,7768,7769,7770,7771,7772,7773,7774,7775,7776,7777,7778,7779,7780,7781,7782,7783,7784,7785,7786,7787, 7788,7789,7790,7791,7792,7793,7794,7795,7796,7797,7798,7799,7800,7801,7802,7803,7804,7805,7806,7807,7808,7809,7810,7811,7812,7813,7814,7815,7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,7832,7833,7834,7835,7836,7837,7838,7839,7840,7841,7842,7843,7844,7845,7846,7847,7848,7849,7850,7851,7852,7853,7854,7855,7856,7857,7858,7859,7860,7861,7862,7863,7864,7865,7866,7867,7868,7869,7870,7871,7872,7873,7874,7875,7876,7877,7878,7879,7880,7881,7882,7883,7884,7885,7886,7887,7888, 7889,7890,7891,7892,7893,7894,7895,7896,7897,7898,7899,7900,7901,7902,7903,7904,7905,7906,7907,7908,7909,7910,7911,7912,7913,7914,7915,7916,7917,7918,7919,7920,7921,7922,7923,7924,7925,7926,7927,7928,7929,7930,7931,7932,7933,7934,7935,7936,7937,7938,7939,7940,7941,7942,7943,7944,7945,7946,7947,7948,7949,7950,7951,7952,7953,7954,7955,7956,7957,7958,7959,7960,7961,7962,7963,7964,7965,7966,7967,7968,7969,7970,7971,7972,7973,7974,7975,7976,7977,7978,7979,7980,7981,7982,7983,7984,7985,7986,7987,7988,7989, 7990,7991,7992,7993,7994,7995,7996,7997,7998,7999,8E3,8001,8002,8003,8004,8005,8006,8007,8008,8009,8010,8011,8012,8013,8014,8015,8016,8017,8018,8019,8020,8021,8022,8023,8024,8025,8026,8027,8028,8029,8030,8031,8032,8033,8034,8035,8036,8037,8038,8039,8040,8041,8042,8043,8044,8045,8046,8047,8048,8049,8050,8051,8052,8053,8054,8055,8056,8057,8058,8059,8060,8061,8062,8063,8064,8065,8066,8067,8068,8069,8070,8071,8072,8073,8074,8075,8076,8077,8078,8079,8080,8081,8082,8083,8084,8085,8086,8087,8088,8089,8090, 8091,8092,8093,8094,8095,8096,8097,8098,8099,8100,8101,8102,8103,8104,8105,8106,8107,8108,8109,8110,8111,8112,8113,8114,8115,8116,8117,8118,8119,8120,8121,8122,8123,8124,8125,8126,8127,8128,8129,8130,8131,8132,8133,8134,8135,8136,8137,8138,8139,8140,8141,8142,8143,8144,8145,8146,8147,8148,8149,8150,8151,8152,8153,8154,8155,8156,8157,8158,8159,8160,8161,8162,8163,8164,8165,8166,8167,8168,8169,8170,8171,8172,8173,8174,8175,8176,8177,8178,8179,8180,8181,8182,8183,8184,8185,8186,8187,8188,8189,8190,8191, 8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8208,8209,8210,8211,8212,8213,8214,8215,8216,8217,8218,8219,8220,8221,8222,8223,8224,8225,8226,8227,8228,8229,8230,8231,8232,8233,8234,8235,8236,8237,8238,8239,8240,8241,8242,8243,8244,8245,8246,8247,8248,8249,8250,8251,8252,8253,8254,8255,8256,8257,8258,8259,8260,8261,8262,8263,8264,8265,8266,8267,8268,8269,8270,8271,8272,8273,8274,8275,8276,8277,8278,8279,8280,8281,8282,8283,8284,8285,8286,8287,8288,8289,8290,8291,8292, 8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,8304,8305,8306,8307,8308,8309,8310,8311,8312,8313,8314,8315,8316,8317,8318,8319,8320,8321,8322,8323,8324,8325,8326,8327,8328,8329,8330,8331,8332,8333,8334,8335,8336,8337,8338,8339,8340,8341,8342,8343,8344,8345,8346,8347,8348,8349,8350,8351,8352,8353,8354,8355,8356,8357,8358,8359,8360,8361,8362,8363,8364,8365,8366,8367,8368,8369,8370,8371,8372,8373,8374,8375,8376,8377,8378,8379,8380,8381,8382,8383,8384,8385,8386,8387,8388,8389,8390,8391,8392,8393, 8394,8395,8396,8397,8398,8399,8400,8401,8402,8403,8404,8405,8406,8407,8408,8409,8410,8411,8412,8413,8414,8415,8416,8417,8418,8419,8420,8421,8422,8423,8424,8425,8426,8427,8428,8429,8430,8431,8432,8433,8434,8435,8436,8437,8438,8439,8440,8441,8442,8443,8444,8445,8446,8447,8448,8449,8450,8451,8452,8453,8454,8455,8456,8457,8458,8459,8460,8461,8462,8463,8464,8465,8466,8467,8468,8469,8470,8471,8472,8473,8474,8475,8476,8477,8478,8479,8480,8481,8482,8483,8484,8485,8486,8487,8488,8489,8490,8491,8492,8493,8494, 8495,8496,8497,8498,8499,8500,8501,8502,8503,8504,8505,8506,8507,8508,8509,8510,8511,8512,8513,8514,8515,8516,8517,8518,8519,8520,8521,8522,8523,8524,8525,8526,8527,8528,8529,8530,8531,8532,8533,8534,8535,8536,8537,8538,8539,8540,8541,8542,8543,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,8554,8555,8556,8557,8558,8559,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,8570,8571,8572,8573,8574,8575,8576,8577,8578,8579,8580,8581,8582,8583,8584,8585,8586,8587,8588,8589,8590,8591,8592,8593,8594,8595, 8596,8597,8598,8599,8600,8601,8602,8603,8604,8605,8606,8607,8608,8609,8610,8611,8612,8613,8614,8615,8616,8617,8618,8619,8620,8621,8622,8623,8624,8625,8626,8627,8628,8629,8630,8631,8632,8633,8634,8635,8636,8637,8638,8639,8640,8641,8642,8643,8644,8645,8646,8647,8648,8649,8650,8651,8652,8653,8654,8655,8656,8657,8658,8659,8660,8661,8662,8663,8664,8665,8666,8667,8668,8669,8670,8671,8672,8673,8674,8675,8676,8677,8678,8679,8680,8681,8682,8683,8684,8685,8686,8687,8688,8689,8690,8691,8692,8693,8694,8695,8696, 8697,8698,8699,8700,8701,8702,8703,8704,8705,8706,8707,8708,8709,8710,8711,8712,8713,8714,8715,8716,8717,8718,8719,8720,8721,8722,8723,8724,8725,8726,8727,8728,8729,8730,8731,8732,8733,8734,8735,8736,8737,8738,8739,8740,8741]},{}],13:[function(a,d,b){function c(){g.apply(this);this.getCharsetName=function(){return"EUC-KR"};this._mCodingSM=new f(m);this._mDistributionAnalyzer=new e;this.reset()}var f=a("./codingstatemachine"),g=a("./mbcharsetprober"),e=a("./chardistribution").EUCKRDistributionAnalysis, m=a("./mbcssm/euckr");c.prototype=new g;d.exports=c},{"./chardistribution":4,"./codingstatemachine":7,"./mbcharsetprober":30,"./mbcssm/euckr":34}],14:[function(a,d,b){b.EUCTW_TYPICAL_DISTRIBUTION_RATIO=.75;b.EUCTW_TABLE_SIZE=8102;b.EUCTWCharToFreqOrder=[1,1800,1506,255,1431,198,9,82,6,7310,177,202,3615,1256,2808,110,3735,33,3241,261,76,44,2113,16,2931,2184,1176,659,3868,26,3404,2643,1198,3869,3313,4060,410,2211,302,590,361,1963,8,204,58,4296,7311,1931,63,7312,7313,317,1614,75,222,159,4061,2412,1480, 7314,3500,3068,224,2809,3616,3,10,3870,1471,29,2774,1135,2852,1939,873,130,3242,1123,312,7315,4297,2051,507,252,682,7316,142,1914,124,206,2932,34,3501,3173,64,604,7317,2494,1976,1977,155,1990,645,641,1606,7318,3405,337,72,406,7319,80,630,238,3174,1509,263,939,1092,2644,756,1440,1094,3406,449,69,2969,591,179,2095,471,115,2034,1843,60,50,2970,134,806,1868,734,2035,3407,180,995,1607,156,537,2893,688,7320,319,1305,779,2144,514,2374,298,4298,359,2495,90,2707,1338,663,11,906,1099,2545,20,2436,182,532,1716, 7321,732,1376,4062,1311,1420,3175,25,2312,1056,113,399,382,1949,242,3408,2467,529,3243,475,1447,3617,7322,117,21,656,810,1297,2295,2329,3502,7323,126,4063,706,456,150,613,4299,71,1118,2036,4064,145,3069,85,835,486,2114,1246,1426,428,727,1285,1015,800,106,623,303,1281,7324,2127,2354,347,3736,221,3503,3110,7325,1955,1153,4065,83,296,1199,3070,192,624,93,7326,822,1897,2810,3111,795,2064,991,1554,1542,1592,27,43,2853,859,139,1456,860,4300,437,712,3871,164,2392,3112,695,211,3017,2096,195,3872,1608,3504, 3505,3618,3873,234,811,2971,2097,3874,2229,1441,3506,1615,2375,668,2076,1638,305,228,1664,4301,467,415,7327,262,2098,1593,239,108,300,200,1033,512,1247,2077,7328,7329,2173,3176,3619,2673,593,845,1062,3244,88,1723,2037,3875,1950,212,266,152,149,468,1898,4066,4302,77,187,7330,3018,37,5,2972,7331,3876,7332,7333,39,2517,4303,2894,3177,2078,55,148,74,4304,545,483,1474,1029,1665,217,1869,1531,3113,1104,2645,4067,24,172,3507,900,3877,3508,3509,4305,32,1408,2811,1312,329,487,2355,2247,2708,784,2674,4,3019, 3314,1427,1788,188,109,499,7334,3620,1717,1789,888,1217,3020,4306,7335,3510,7336,3315,1520,3621,3878,196,1034,775,7337,7338,929,1815,249,439,38,7339,1063,7340,794,3879,1435,2296,46,178,3245,2065,7341,2376,7342,214,1709,4307,804,35,707,324,3622,1601,2546,140,459,4068,7343,7344,1365,839,272,978,2257,2572,3409,2128,1363,3623,1423,697,100,3071,48,70,1231,495,3114,2193,7345,1294,7346,2079,462,586,1042,3246,853,256,988,185,2377,3410,1698,434,1084,7347,3411,314,2615,2775,4308,2330,2331,569,2280,637,1816, 2518,757,1162,1878,1616,3412,287,1577,2115,768,4309,1671,2854,3511,2519,1321,3737,909,2413,7348,4069,933,3738,7349,2052,2356,1222,4310,765,2414,1322,786,4311,7350,1919,1462,1677,2895,1699,7351,4312,1424,2437,3115,3624,2590,3316,1774,1940,3413,3880,4070,309,1369,1130,2812,364,2230,1653,1299,3881,3512,3882,3883,2646,525,1085,3021,902,2E3,1475,964,4313,421,1844,1415,1057,2281,940,1364,3116,376,4314,4315,1381,7,2520,983,2378,336,1710,2675,1845,321,3414,559,1131,3022,2742,1808,1132,1313,265,1481,1857, 7352,352,1203,2813,3247,167,1089,420,2814,776,792,1724,3513,4071,2438,3248,7353,4072,7354,446,229,333,2743,901,3739,1200,1557,4316,2647,1920,395,2744,2676,3740,4073,1835,125,916,3178,2616,4317,7355,7356,3741,7357,7358,7359,4318,3117,3625,1133,2547,1757,3415,1510,2313,1409,3514,7360,2145,438,2591,2896,2379,3317,1068,958,3023,461,311,2855,2677,4074,1915,3179,4075,1978,383,750,2745,2617,4076,274,539,385,1278,1442,7361,1154,1964,384,561,210,98,1295,2548,3515,7362,1711,2415,1482,3416,3884,2897,1257,129, 7363,3742,642,523,2776,2777,2648,7364,141,2231,1333,68,176,441,876,907,4077,603,2592,710,171,3417,404,549,18,3118,2393,1410,3626,1666,7365,3516,4319,2898,4320,7366,2973,368,7367,146,366,99,871,3627,1543,748,807,1586,1185,22,2258,379,3743,3180,7368,3181,505,1941,2618,1991,1382,2314,7369,380,2357,218,702,1817,1248,3418,3024,3517,3318,3249,7370,2974,3628,930,3250,3744,7371,59,7372,585,601,4078,497,3419,1112,1314,4321,1801,7373,1223,1472,2174,7374,749,1836,690,1899,3745,1772,3885,1476,429,1043,1790,2232, 2116,917,4079,447,1086,1629,7375,556,7376,7377,2020,1654,844,1090,105,550,966,1758,2815,1008,1782,686,1095,7378,2282,793,1602,7379,3518,2593,4322,4080,2933,2297,4323,3746,980,2496,544,353,527,4324,908,2678,2899,7380,381,2619,1942,1348,7381,1341,1252,560,3072,7382,3420,2856,7383,2053,973,886,2080,143,4325,7384,7385,157,3886,496,4081,57,840,540,2038,4326,4327,3421,2117,1445,970,2259,1748,1965,2081,4082,3119,1234,1775,3251,2816,3629,773,1206,2129,1066,2039,1326,3887,1738,1725,4083,279,3120,51,1544,2594, 423,1578,2130,2066,173,4328,1879,7386,7387,1583,264,610,3630,4329,2439,280,154,7388,7389,7390,1739,338,1282,3073,693,2857,1411,1074,3747,2440,7391,4330,7392,7393,1240,952,2394,7394,2900,1538,2679,685,1483,4084,2468,1436,953,4085,2054,4331,671,2395,79,4086,2441,3252,608,567,2680,3422,4087,4088,1691,393,1261,1791,2396,7395,4332,7396,7397,7398,7399,1383,1672,3748,3182,1464,522,1119,661,1150,216,675,4333,3888,1432,3519,609,4334,2681,2397,7400,7401,7402,4089,3025,0,7403,2469,315,231,2442,301,3319,4335, 2380,7404,233,4090,3631,1818,4336,4337,7405,96,1776,1315,2082,7406,257,7407,1809,3632,2709,1139,1819,4091,2021,1124,2163,2778,1777,2649,7408,3074,363,1655,3183,7409,2975,7410,7411,7412,3889,1567,3890,718,103,3184,849,1443,341,3320,2934,1484,7413,1712,127,67,339,4092,2398,679,1412,821,7414,7415,834,738,351,2976,2146,846,235,1497,1880,418,1992,3749,2710,186,1100,2147,2746,3520,1545,1355,2935,2858,1377,583,3891,4093,2573,2977,7416,1298,3633,1078,2549,3634,2358,78,3750,3751,267,1289,2099,2001,1594,4094, 348,369,1274,2194,2175,1837,4338,1820,2817,3635,2747,2283,2002,4339,2936,2748,144,3321,882,4340,3892,2749,3423,4341,2901,7417,4095,1726,320,7418,3893,3026,788,2978,7419,2818,1773,1327,2859,3894,2819,7420,1306,4342,2003,1700,3752,3521,2359,2650,787,2022,506,824,3636,534,323,4343,1044,3322,2023,1900,946,3424,7421,1778,1500,1678,7422,1881,4344,165,243,4345,3637,2521,123,683,4096,764,4346,36,3895,1792,589,2902,816,626,1667,3027,2233,1639,1555,1622,3753,3896,7423,3897,2860,1370,1228,1932,891,2083,2903, 304,4097,7424,292,2979,2711,3522,691,2100,4098,1115,4347,118,662,7425,611,1156,854,2381,1316,2861,2,386,515,2904,7426,7427,3253,868,2234,1486,855,2651,785,2212,3028,7428,1040,3185,3523,7429,3121,448,7430,1525,7431,2164,4348,7432,3754,7433,4099,2820,3524,3122,503,818,3898,3123,1568,814,676,1444,306,1749,7434,3755,1416,1030,197,1428,805,2821,1501,4349,7435,7436,7437,1993,7438,4350,7439,7440,2195,13,2779,3638,2980,3124,1229,1916,7441,3756,2131,7442,4100,4351,2399,3525,7443,2213,1511,1727,1120,7444,7445, 646,3757,2443,307,7446,7447,1595,3186,7448,7449,7450,3639,1113,1356,3899,1465,2522,2523,7451,519,7452,128,2132,92,2284,1979,7453,3900,1512,342,3125,2196,7454,2780,2214,1980,3323,7455,290,1656,1317,789,827,2360,7456,3758,4352,562,581,3901,7457,401,4353,2248,94,4354,1399,2781,7458,1463,2024,4355,3187,1943,7459,828,1105,4101,1262,1394,7460,4102,605,4356,7461,1783,2862,7462,2822,819,2101,578,2197,2937,7463,1502,436,3254,4103,3255,2823,3902,2905,3425,3426,7464,2712,2315,7465,7466,2332,2067,23,4357,193, 826,3759,2102,699,1630,4104,3075,390,1793,1064,3526,7467,1579,3076,3077,1400,7468,4105,1838,1640,2863,7469,4358,4359,137,4106,598,3078,1966,780,104,974,2938,7470,278,899,253,402,572,504,493,1339,7471,3903,1275,4360,2574,2550,7472,3640,3029,3079,2249,565,1334,2713,863,41,7473,7474,4361,7475,1657,2333,19,463,2750,4107,606,7476,2981,3256,1087,2084,1323,2652,2982,7477,1631,1623,1750,4108,2682,7478,2864,791,2714,2653,2334,232,2416,7479,2983,1498,7480,2654,2620,755,1366,3641,3257,3126,2025,1609,119,1917, 3427,862,1026,4109,7481,3904,3760,4362,3905,4363,2260,1951,2470,7482,1125,817,4110,4111,3906,1513,1766,2040,1487,4112,3030,3258,2824,3761,3127,7483,7484,1507,7485,2683,733,40,1632,1106,2865,345,4113,841,2524,230,4364,2984,1846,3259,3428,7486,1263,986,3429,7487,735,879,254,1137,857,622,1300,1180,1388,1562,3907,3908,2939,967,2751,2655,1349,592,2133,1692,3324,2985,1994,4114,1679,3909,1901,2185,7488,739,3642,2715,1296,1290,7489,4115,2198,2199,1921,1563,2595,2551,1870,2752,2986,7490,435,7491,343,1108, 596,17,1751,4365,2235,3430,3643,7492,4366,294,3527,2940,1693,477,979,281,2041,3528,643,2042,3644,2621,2782,2261,1031,2335,2134,2298,3529,4367,367,1249,2552,7493,3530,7494,4368,1283,3325,2004,240,1762,3326,4369,4370,836,1069,3128,474,7495,2148,2525,268,3531,7496,3188,1521,1284,7497,1658,1546,4116,7498,3532,3533,7499,4117,3327,2684,1685,4118,961,1673,2622,190,2005,2200,3762,4371,4372,7500,570,2497,3645,1490,7501,4373,2623,3260,1956,4374,584,1514,396,1045,1944,7502,4375,1967,2444,7503,7504,4376,3910, 619,7505,3129,3261,215,2006,2783,2553,3189,4377,3190,4378,763,4119,3763,4379,7506,7507,1957,1767,2941,3328,3646,1174,452,1477,4380,3329,3130,7508,2825,1253,2382,2186,1091,2285,4120,492,7509,638,1169,1824,2135,1752,3911,648,926,1021,1324,4381,520,4382,997,847,1007,892,4383,3764,2262,1871,3647,7510,2400,1784,4384,1952,2942,3080,3191,1728,4121,2043,3648,4385,2007,1701,3131,1551,30,2263,4122,7511,2026,4386,3534,7512,501,7513,4123,594,3431,2165,1821,3535,3432,3536,3192,829,2826,4124,7514,1680,3132,1225, 4125,7515,3262,4387,4126,3133,2336,7516,4388,4127,7517,3912,3913,7518,1847,2383,2596,3330,7519,4389,374,3914,652,4128,4129,375,1140,798,7520,7521,7522,2361,4390,2264,546,1659,138,3031,2445,4391,7523,2250,612,1848,910,796,3765,1740,1371,825,3766,3767,7524,2906,2554,7525,692,444,3032,2624,801,4392,4130,7526,1491,244,1053,3033,4131,4132,340,7527,3915,1041,2987,293,1168,87,1357,7528,1539,959,7529,2236,721,694,4133,3768,219,1478,644,1417,3331,2656,1413,1401,1335,1389,3916,7530,7531,2988,2362,3134,1825, 730,1515,184,2827,66,4393,7532,1660,2943,246,3332,378,1457,226,3433,975,3917,2944,1264,3537,674,696,7533,163,7534,1141,2417,2166,713,3538,3333,4394,3918,7535,7536,1186,15,7537,1079,1070,7538,1522,3193,3539,276,1050,2716,758,1126,653,2945,3263,7539,2337,889,3540,3919,3081,2989,903,1250,4395,3920,3434,3541,1342,1681,1718,766,3264,286,89,2946,3649,7540,1713,7541,2597,3334,2990,7542,2947,2215,3194,2866,7543,4396,2498,2526,181,387,1075,3921,731,2187,3335,7544,3265,310,313,3435,2299,770,4134,54,3034,189, 4397,3082,3769,3922,7545,1230,1617,1849,355,3542,4135,4398,3336,111,4136,3650,1350,3135,3436,3035,4137,2149,3266,3543,7546,2784,3923,3924,2991,722,2008,7547,1071,247,1207,2338,2471,1378,4399,2009,864,1437,1214,4400,373,3770,1142,2216,667,4401,442,2753,2555,3771,3925,1968,4138,3267,1839,837,170,1107,934,1336,1882,7548,7549,2118,4139,2828,743,1569,7550,4402,4140,582,2384,1418,3437,7551,1802,7552,357,1395,1729,3651,3268,2418,1564,2237,7553,3083,3772,1633,4403,1114,2085,4141,1532,7554,482,2446,4404,7555, 7556,1492,833,1466,7557,2717,3544,1641,2829,7558,1526,1272,3652,4142,1686,1794,416,2556,1902,1953,1803,7559,3773,2785,3774,1159,2316,7560,2867,4405,1610,1584,3036,2419,2754,443,3269,1163,3136,7561,7562,3926,7563,4143,2499,3037,4406,3927,3137,2103,1647,3545,2010,1872,4144,7564,4145,431,3438,7565,250,97,81,4146,7566,1648,1850,1558,160,848,7567,866,740,1694,7568,2201,2830,3195,4147,4407,3653,1687,950,2472,426,469,3196,3654,3655,3928,7569,7570,1188,424,1995,861,3546,4148,3775,2202,2685,168,1235,3547, 4149,7571,2086,1674,4408,3337,3270,220,2557,1009,7572,3776,670,2992,332,1208,717,7573,7574,3548,2447,3929,3338,7575,513,7576,1209,2868,3339,3138,4409,1080,7577,7578,7579,7580,2527,3656,3549,815,1587,3930,3931,7581,3550,3439,3777,1254,4410,1328,3038,1390,3932,1741,3933,3778,3934,7582,236,3779,2448,3271,7583,7584,3657,3780,1273,3781,4411,7585,308,7586,4412,245,4413,1851,2473,1307,2575,430,715,2136,2449,7587,270,199,2869,3935,7588,3551,2718,1753,761,1754,725,1661,1840,4414,3440,3658,7589,7590,587,14, 3272,227,2598,326,480,2265,943,2755,3552,291,650,1883,7591,1702,1226,102,1547,62,3441,904,4415,3442,1164,4150,7592,7593,1224,1548,2756,391,498,1493,7594,1386,1419,7595,2055,1177,4416,813,880,1081,2363,566,1145,4417,2286,1001,1035,2558,2599,2238,394,1286,7596,7597,2068,7598,86,1494,1730,3936,491,1588,745,897,2948,843,3340,3937,2757,2870,3273,1768,998,2217,2069,397,1826,1195,1969,3659,2993,3341,284,7599,3782,2500,2137,2119,1903,7600,3938,2150,3939,4151,1036,3443,1904,114,2559,4152,209,1527,7601,7602, 2949,2831,2625,2385,2719,3139,812,2560,7603,3274,7604,1559,737,1884,3660,1210,885,28,2686,3553,3783,7605,4153,1004,1779,4418,7606,346,1981,2218,2687,4419,3784,1742,797,1642,3940,1933,1072,1384,2151,896,3941,3275,3661,3197,2871,3554,7607,2561,1958,4420,2450,1785,7608,7609,7610,3942,4154,1005,1308,3662,4155,2720,4421,4422,1528,2600,161,1178,4156,1982,987,4423,1101,4157,631,3943,1157,3198,2420,1343,1241,1016,2239,2562,372,877,2339,2501,1160,555,1934,911,3944,7611,466,1170,169,1051,2907,2688,3663,2474, 2994,1182,2011,2563,1251,2626,7612,992,2340,3444,1540,2721,1201,2070,2401,1996,2475,7613,4424,528,1922,2188,1503,1873,1570,2364,3342,3276,7614,557,1073,7615,1827,3445,2087,2266,3140,3039,3084,767,3085,2786,4425,1006,4158,4426,2341,1267,2176,3664,3199,778,3945,3200,2722,1597,2657,7616,4427,7617,3446,7618,7619,7620,3277,2689,1433,3278,131,95,1504,3946,723,4159,3141,1841,3555,2758,2189,3947,2027,2104,3665,7621,2995,3948,1218,7622,3343,3201,3949,4160,2576,248,1634,3785,912,7623,2832,3666,3040,3786,654, 53,7624,2996,7625,1688,4428,777,3447,1032,3950,1425,7626,191,820,2120,2833,971,4429,931,3202,135,664,783,3787,1997,772,2908,1935,3951,3788,4430,2909,3203,282,2723,640,1372,3448,1127,922,325,3344,7627,7628,711,2044,7629,7630,3952,2219,2787,1936,3953,3345,2220,2251,3789,2300,7631,4431,3790,1258,3279,3954,3204,2138,2950,3955,3956,7632,2221,258,3205,4432,101,1227,7633,3280,1755,7634,1391,3281,7635,2910,2056,893,7636,7637,7638,1402,4161,2342,7639,7640,3206,3556,7641,7642,878,1325,1780,2788,4433,259,1385, 2577,744,1183,2267,4434,7643,3957,2502,7644,684,1024,4162,7645,472,3557,3449,1165,3282,3958,3959,322,2152,881,455,1695,1152,1340,660,554,2153,4435,1058,4436,4163,830,1065,3346,3960,4437,1923,7646,1703,1918,7647,932,2268,122,7648,4438,947,677,7649,3791,2627,297,1905,1924,2269,4439,2317,3283,7650,7651,4164,7652,4165,84,4166,112,989,7653,547,1059,3961,701,3558,1019,7654,4167,7655,3450,942,639,457,2301,2451,993,2951,407,851,494,4440,3347,927,7656,1237,7657,2421,3348,573,4168,680,921,2911,1279,1874,285, 790,1448,1983,719,2167,7658,7659,4441,3962,3963,1649,7660,1541,563,7661,1077,7662,3349,3041,3451,511,2997,3964,3965,3667,3966,1268,2564,3350,3207,4442,4443,7663,535,1048,1276,1189,2912,2028,3142,1438,1373,2834,2952,1134,2012,7664,4169,1238,2578,3086,1259,7665,700,7666,2953,3143,3668,4170,7667,4171,1146,1875,1906,4444,2601,3967,781,2422,132,1589,203,147,273,2789,2402,898,1786,2154,3968,3969,7668,3792,2790,7669,7670,4445,4446,7671,3208,7672,1635,3793,965,7673,1804,2690,1516,3559,1121,1082,1329,3284, 3970,1449,3794,65,1128,2835,2913,2759,1590,3795,7674,7675,12,2658,45,976,2579,3144,4447,517,2528,1013,1037,3209,7676,3796,2836,7677,3797,7678,3452,7679,2602,614,1998,2318,3798,3087,2724,2628,7680,2580,4172,599,1269,7681,1810,3669,7682,2691,3088,759,1060,489,1805,3351,3285,1358,7683,7684,2386,1387,1215,2629,2252,490,7685,7686,4173,1759,2387,2343,7687,4448,3799,1907,3971,2630,1806,3210,4449,3453,3286,2760,2344,874,7688,7689,3454,3670,1858,91,2914,3671,3042,3800,4450,7690,3145,3972,2659,7691,3455,1202, 1403,3801,2954,2529,1517,2503,4451,3456,2504,7692,4452,7693,2692,1885,1495,1731,3973,2365,4453,7694,2029,7695,7696,3974,2693,1216,237,2581,4174,2319,3975,3802,4454,4455,2694,3560,3457,445,4456,7697,7698,7699,7700,2761,61,3976,3672,1822,3977,7701,687,2045,935,925,405,2660,703,1096,1859,2725,4457,3978,1876,1367,2695,3352,918,2105,1781,2476,334,3287,1611,1093,4458,564,3146,3458,3673,3353,945,2631,2057,4459,7702,1925,872,4175,7703,3459,2696,3089,349,4176,3674,3979,4460,3803,4177,3675,2155,3980,4461,4462, 4178,4463,2403,2046,782,3981,400,251,4179,1624,7704,7705,277,3676,299,1265,476,1191,3804,2121,4180,4181,1109,205,7706,2582,1E3,2156,3561,1860,7707,7708,7709,4464,7710,4465,2565,107,2477,2157,3982,3460,3147,7711,1533,541,1301,158,753,4182,2872,3562,7712,1696,370,1088,4183,4466,3563,579,327,440,162,2240,269,1937,1374,3461,968,3043,56,1396,3090,2106,3288,3354,7713,1926,2158,4467,2998,7714,3564,7715,7716,3677,4468,2478,7717,2791,7718,1650,4469,7719,2603,7720,7721,3983,2661,3355,1149,3356,3984,3805,3985, 7722,1076,49,7723,951,3211,3289,3290,450,2837,920,7724,1811,2792,2366,4184,1908,1138,2367,3806,3462,7725,3212,4470,1909,1147,1518,2423,4471,3807,7726,4472,2388,2604,260,1795,3213,7727,7728,3808,3291,708,7729,3565,1704,7730,3566,1351,1618,3357,2999,1886,944,4185,3358,4186,3044,3359,4187,7731,3678,422,413,1714,3292,500,2058,2345,4188,2479,7732,1344,1910,954,7733,1668,7734,7735,3986,2404,4189,3567,3809,4190,7736,2302,1318,2505,3091,133,3092,2873,4473,629,31,2838,2697,3810,4474,850,949,4475,3987,2955, 1732,2088,4191,1496,1852,7737,3988,620,3214,981,1242,3679,3360,1619,3680,1643,3293,2139,2452,1970,1719,3463,2168,7738,3215,7739,7740,3361,1828,7741,1277,4476,1565,2047,7742,1636,3568,3093,7743,869,2839,655,3811,3812,3094,3989,3E3,3813,1310,3569,4477,7744,7745,7746,1733,558,4478,3681,335,1549,3045,1756,4192,3682,1945,3464,1829,1291,1192,470,2726,2107,2793,913,1054,3990,7747,1027,7748,3046,3991,4479,982,2662,3362,3148,3465,3216,3217,1946,2794,7749,571,4480,7750,1830,7751,3570,2583,1523,2424,7752,2089, 984,4481,3683,1959,7753,3684,852,923,2795,3466,3685,969,1519,999,2048,2320,1705,7754,3095,615,1662,151,597,3992,2405,2321,1049,275,4482,3686,4193,568,3687,3571,2480,4194,3688,7755,2425,2270,409,3218,7756,1566,2874,3467,1002,769,2840,194,2090,3149,3689,2222,3294,4195,628,1505,7757,7758,1763,2177,3001,3993,521,1161,2584,1787,2203,2406,4483,3994,1625,4196,4197,412,42,3096,464,7759,2632,4484,3363,1760,1571,2875,3468,2530,1219,2204,3814,2633,2140,2368,4485,4486,3295,1651,3364,3572,7760,7761,3573,2481, 3469,7762,3690,7763,7764,2271,2091,460,7765,4487,7766,3002,962,588,3574,289,3219,2634,1116,52,7767,3047,1796,7768,7769,7770,1467,7771,1598,1143,3691,4198,1984,1734,1067,4488,1280,3365,465,4489,1572,510,7772,1927,2241,1812,1644,3575,7773,4490,3692,7774,7775,2663,1573,1534,7776,7777,4199,536,1807,1761,3470,3815,3150,2635,7778,7779,7780,4491,3471,2915,1911,2796,7781,3296,1122,377,3220,7782,360,7783,7784,4200,1529,551,7785,2059,3693,1769,2426,7786,2916,4201,3297,3097,2322,2108,2030,4492,1404,136,1468, 1479,672,1171,3221,2303,271,3151,7787,2762,7788,2049,678,2727,865,1947,4493,7789,2013,3995,2956,7790,2728,2223,1397,3048,3694,4494,4495,1735,2917,3366,3576,7791,3816,509,2841,2453,2876,3817,7792,7793,3152,3153,4496,4202,2531,4497,2304,1166,1010,552,681,1887,7794,7795,2957,2958,3996,1287,1596,1861,3154,358,453,736,175,478,1117,905,1167,1097,7796,1853,1530,7797,1706,7798,2178,3472,2287,3695,3473,3577,4203,2092,4204,7799,3367,1193,2482,4205,1458,2190,2205,1862,1888,1421,3298,2918,3049,2179,3474,595, 2122,7800,3997,7801,7802,4206,1707,2636,223,3696,1359,751,3098,183,3475,7803,2797,3003,419,2369,633,704,3818,2389,241,7804,7805,7806,838,3004,3697,2272,2763,2454,3819,1938,2050,3998,1309,3099,2242,1181,7807,1136,2206,3820,2370,1446,4207,2305,4498,7808,7809,4208,1055,2605,484,3698,7810,3999,625,4209,2273,3368,1499,4210,4E3,7811,4001,4211,3222,2274,2275,3476,7812,7813,2764,808,2606,3699,3369,4002,4212,3100,2532,526,3370,3821,4213,955,7814,1620,4214,2637,2427,7815,1429,3700,1669,1831,994,928,7816,3578, 1260,7817,7818,7819,1948,2288,741,2919,1626,4215,2729,2455,867,1184,362,3371,1392,7820,7821,4003,4216,1770,1736,3223,2920,4499,4500,1928,2698,1459,1158,7822,3050,3372,2877,1292,1929,2506,2842,3701,1985,1187,2071,2014,2607,4217,7823,2566,2507,2169,3702,2483,3299,7824,3703,4501,7825,7826,666,1003,3005,1022,3579,4218,7827,4502,1813,2253,574,3822,1603,295,1535,705,3823,4219,283,858,417,7828,7829,3224,4503,4504,3051,1220,1889,1046,2276,2456,4004,1393,1599,689,2567,388,4220,7830,2484,802,7831,2798,3824, 2060,1405,2254,7832,4505,3825,2109,1052,1345,3225,1585,7833,809,7834,7835,7836,575,2730,3477,956,1552,1469,1144,2323,7837,2324,1560,2457,3580,3226,4005,616,2207,3155,2180,2289,7838,1832,7839,3478,4506,7840,1319,3704,3705,1211,3581,1023,3227,1293,2799,7841,7842,7843,3826,607,2306,3827,762,2878,1439,4221,1360,7844,1485,3052,7845,4507,1038,4222,1450,2061,2638,4223,1379,4508,2585,7846,7847,4224,1352,1414,2325,2921,1172,7848,7849,3828,3829,7850,1797,1451,7851,7852,7853,7854,2922,4006,4007,2485,2346,411, 4008,4009,3582,3300,3101,4509,1561,2664,1452,4010,1375,7855,7856,47,2959,316,7857,1406,1591,2923,3156,7858,1025,2141,3102,3157,354,2731,884,2224,4225,2407,508,3706,726,3583,996,2428,3584,729,7859,392,2191,1453,4011,4510,3707,7860,7861,2458,3585,2608,1675,2800,919,2347,2960,2348,1270,4511,4012,73,7862,7863,647,7864,3228,2843,2255,1550,1346,3006,7865,1332,883,3479,7866,7867,7868,7869,3301,2765,7870,1212,831,1347,4226,4512,2326,3830,1863,3053,720,3831,4513,4514,3832,7871,4227,7872,7873,4515,7874,7875, 1798,4516,3708,2609,4517,3586,1645,2371,7876,7877,2924,669,2208,2665,2429,7878,2879,7879,7880,1028,3229,7881,4228,2408,7882,2256,1353,7883,7884,4518,3158,518,7885,4013,7886,4229,1960,7887,2142,4230,7888,7889,3007,2349,2350,3833,516,1833,1454,4014,2699,4231,4519,2225,2610,1971,1129,3587,7890,2766,7891,2961,1422,577,1470,3008,1524,3373,7892,7893,432,4232,3054,3480,7894,2586,1455,2508,2226,1972,1175,7895,1020,2732,4015,3481,4520,7896,2733,7897,1743,1361,3055,3482,2639,4016,4233,4521,2290,895,924,4234, 2170,331,2243,3056,166,1627,3057,1098,7898,1232,2880,2227,3374,4522,657,403,1196,2372,542,3709,3375,1600,4235,3483,7899,4523,2767,3230,576,530,1362,7900,4524,2533,2666,3710,4017,7901,842,3834,7902,2801,2031,1014,4018,213,2700,3376,665,621,4236,7903,3711,2925,2430,7904,2431,3302,3588,3377,7905,4237,2534,4238,4525,3589,1682,4239,3484,1380,7906,724,2277,600,1670,7907,1337,1233,4526,3103,2244,7908,1621,4527,7909,651,4240,7910,1612,4241,2611,7911,2844,7912,2734,2307,3058,7913,716,2459,3059,174,1255,2701, 4019,3590,548,1320,1398,728,4020,1574,7914,1890,1197,3060,4021,7915,3061,3062,3712,3591,3713,747,7916,635,4242,4528,7917,7918,7919,4243,7920,7921,4529,7922,3378,4530,2432,451,7923,3714,2535,2072,4244,2735,4245,4022,7924,1764,4531,7925,4246,350,7926,2278,2390,2486,7927,4247,4023,2245,1434,4024,488,4532,458,4248,4025,3715,771,1330,2391,3835,2568,3159,2159,2409,1553,2667,3160,4249,7928,2487,2881,2612,1720,2702,4250,3379,4533,7929,2536,4251,7930,3231,4252,2768,7931,2015,2736,7932,1155,1017,3716,3836, 7933,3303,2308,201,1864,4253,1430,7934,4026,7935,7936,7937,7938,7939,4254,1604,7940,414,1865,371,2587,4534,4535,3485,2016,3104,4536,1708,960,4255,887,389,2171,1536,1663,1721,7941,2228,4027,2351,2926,1580,7942,7943,7944,1744,7945,2537,4537,4538,7946,4539,7947,2073,7948,7949,3592,3380,2882,4256,7950,4257,2640,3381,2802,673,2703,2460,709,3486,4028,3593,4258,7951,1148,502,634,7952,7953,1204,4540,3594,1575,4541,2613,3717,7954,3718,3105,948,3232,121,1745,3837,1110,7955,4259,3063,2509,3009,4029,3719,1151, 1771,3838,1488,4030,1986,7956,2433,3487,7957,7958,2093,7959,4260,3839,1213,1407,2803,531,2737,2538,3233,1011,1537,7960,2769,4261,3106,1061,7961,3720,3721,1866,2883,7962,2017,120,4262,4263,2062,3595,3234,2309,3840,2668,3382,1954,4542,7963,7964,3488,1047,2704,1266,7965,1368,4543,2845,649,3383,3841,2539,2738,1102,2846,2669,7966,7967,1999,7968,1111,3596,2962,7969,2488,3842,3597,2804,1854,3384,3722,7970,7971,3385,2410,2884,3304,3235,3598,7972,2569,7973,3599,2805,4031,1460,856,7974,3600,7975,2885,2963, 7976,2886,3843,7977,4264,632,2510,875,3844,1697,3845,2291,7978,7979,4544,3010,1239,580,4545,4265,7980,914,936,2074,1190,4032,1039,2123,7981,7982,7983,3386,1473,7984,1354,4266,3846,7985,2172,3064,4033,915,3305,4267,4268,3306,1605,1834,7986,2739,398,3601,4269,3847,4034,328,1912,2847,4035,3848,1331,4270,3011,937,4271,7987,3602,4036,4037,3387,2160,4546,3388,524,742,538,3065,1012,7988,7989,3849,2461,7990,658,1103,225,3850,7991,7992,4547,7993,4548,7994,3236,1243,7995,4038,963,2246,4549,7996,2705,3603,3161, 7997,7998,2588,2327,7999,4550,8E3,8001,8002,3489,3307,957,3389,2540,2032,1930,2927,2462,870,2018,3604,1746,2770,2771,2434,2463,8003,3851,8004,3723,3107,3724,3490,3390,3725,8005,1179,3066,8006,3162,2373,4272,3726,2541,3163,3108,2740,4039,8007,3391,1556,2542,2292,977,2887,2033,4040,1205,3392,8008,1765,3393,3164,2124,1271,1689,714,4551,3491,8009,2328,3852,533,4273,3605,2181,617,8010,2464,3308,3492,2310,8011,8012,3165,8013,8014,3853,1987,618,427,2641,3493,3394,8015,8016,1244,1690,8017,2806,4274,4552, 8018,3494,8019,8020,2279,1576,473,3606,4275,3395,972,8021,3607,8022,3067,8023,8024,4553,4554,8025,3727,4041,4042,8026,153,4555,356,8027,1891,2888,4276,2143,408,803,2352,8028,3854,8029,4277,1646,2570,2511,4556,4557,3855,8030,3856,4278,8031,2411,3396,752,8032,8033,1961,2964,8034,746,3012,2465,8035,4279,3728,698,4558,1892,4280,3608,2543,4559,3609,3857,8036,3166,3397,8037,1823,1302,4043,2706,3858,1973,4281,8038,4282,3167,823,1303,1288,1236,2848,3495,4044,3398,774,3859,8039,1581,4560,1304,2849,3860,4561, 8040,2435,2161,1083,3237,4283,4045,4284,344,1173,288,2311,454,1683,8041,8042,1461,4562,4046,2589,8043,8044,4563,985,894,8045,3399,3168,8046,1913,2928,3729,1988,8047,2110,1974,8048,4047,8049,2571,1194,425,8050,4564,3169,1245,3730,4285,8051,8052,2850,8053,636,4565,1855,3861,760,1799,8054,4286,2209,1508,4566,4048,1893,1684,2293,8055,8056,8057,4287,4288,2210,479,8058,8059,832,8060,4049,2489,8061,2965,2490,3731,990,3109,627,1814,2642,4289,1582,4290,2125,2111,3496,4567,8062,799,4291,3170,8063,4568,2112, 1737,3013,1018,543,754,4292,3309,1676,4569,4570,4050,8064,1489,8065,3497,8066,2614,2889,4051,8067,8068,2966,8069,8070,8071,8072,3171,4571,4572,2182,1722,8073,3238,3239,1842,3610,1715,481,365,1975,1856,8074,8075,1962,2491,4573,8076,2126,3611,3240,433,1894,2063,2075,8077,602,2741,8078,8079,8080,8081,8082,3014,1628,3400,8083,3172,4574,4052,2890,4575,2512,8084,2544,2772,8085,8086,8087,3310,4576,2891,8088,4577,8089,2851,4578,4579,1221,2967,4053,2513,8090,8091,8092,1867,1989,8093,8094,8095,1895,8096,8097, 4580,1896,4054,318,8098,2094,4055,4293,8099,8100,485,8101,938,3862,553,2670,116,8102,3863,3612,8103,3498,2671,2773,3401,3311,2807,8104,3613,2929,4056,1747,2930,2968,8105,8106,207,8107,8108,2672,4581,2514,8109,3015,890,3614,3864,8110,1877,3732,3402,8111,2183,2353,3403,1652,8112,8113,8114,941,2294,208,3499,4057,2019,330,4294,3865,2892,2492,3733,4295,8115,8116,8117,8118,2515,1613,4582,8119,3312,3866,2516,8120,4058,8121,1637,4059,2466,4583,3867,8122,2493,3016,3734,8123,8124,2192,8125,8126,2162,8127,8128, 8129,8130,8131,8132,8133,8134,8135,8136,8137,8138,8139,8140,8141,8142,8143,8144,8145,8146,8147,8148,8149,8150,8151,8152,8153,8154,8155,8156,8157,8158,8159,8160,8161,8162,8163,8164,8165,8166,8167,8168,8169,8170,8171,8172,8173,8174,8175,8176,8177,8178,8179,8180,8181,8182,8183,8184,8185,8186,8187,8188,8189,8190,8191,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8208,8209,8210,8211,8212,8213,8214,8215,8216,8217,8218,8219,8220,8221,8222,8223,8224,8225,8226,8227,8228,8229, 8230,8231,8232,8233,8234,8235,8236,8237,8238,8239,8240,8241,8242,8243,8244,8245,8246,8247,8248,8249,8250,8251,8252,8253,8254,8255,8256,8257,8258,8259,8260,8261,8262,8263,8264,8265,8266,8267,8268,8269,8270,8271,8272,8273,8274,8275,8276,8277,8278,8279,8280,8281,8282,8283,8284,8285,8286,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,8304,8305,8306,8307,8308,8309,8310,8311,8312,8313,8314,8315,8316,8317,8318,8319,8320,8321,8322,8323,8324,8325,8326,8327,8328,8329,8330, 8331,8332,8333,8334,8335,8336,8337,8338,8339,8340,8341,8342,8343,8344,8345,8346,8347,8348,8349,8350,8351,8352,8353,8354,8355,8356,8357,8358,8359,8360,8361,8362,8363,8364,8365,8366,8367,8368,8369,8370,8371,8372,8373,8374,8375,8376,8377,8378,8379,8380,8381,8382,8383,8384,8385,8386,8387,8388,8389,8390,8391,8392,8393,8394,8395,8396,8397,8398,8399,8400,8401,8402,8403,8404,8405,8406,8407,8408,8409,8410,8411,8412,8413,8414,8415,8416,8417,8418,8419,8420,8421,8422,8423,8424,8425,8426,8427,8428,8429,8430,8431, 8432,8433,8434,8435,8436,8437,8438,8439,8440,8441,8442,8443,8444,8445,8446,8447,8448,8449,8450,8451,8452,8453,8454,8455,8456,8457,8458,8459,8460,8461,8462,8463,8464,8465,8466,8467,8468,8469,8470,8471,8472,8473,8474,8475,8476,8477,8478,8479,8480,8481,8482,8483,8484,8485,8486,8487,8488,8489,8490,8491,8492,8493,8494,8495,8496,8497,8498,8499,8500,8501,8502,8503,8504,8505,8506,8507,8508,8509,8510,8511,8512,8513,8514,8515,8516,8517,8518,8519,8520,8521,8522,8523,8524,8525,8526,8527,8528,8529,8530,8531,8532, 8533,8534,8535,8536,8537,8538,8539,8540,8541,8542,8543,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,8554,8555,8556,8557,8558,8559,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,8570,8571,8572,8573,8574,8575,8576,8577,8578,8579,8580,8581,8582,8583,8584,8585,8586,8587,8588,8589,8590,8591,8592,8593,8594,8595,8596,8597,8598,8599,8600,8601,8602,8603,8604,8605,8606,8607,8608,8609,8610,8611,8612,8613,8614,8615,8616,8617,8618,8619,8620,8621,8622,8623,8624,8625,8626,8627,8628,8629,8630,8631,8632,8633, 8634,8635,8636,8637,8638,8639,8640,8641,8642,8643,8644,8645,8646,8647,8648,8649,8650,8651,8652,8653,8654,8655,8656,8657,8658,8659,8660,8661,8662,8663,8664,8665,8666,8667,8668,8669,8670,8671,8672,8673,8674,8675,8676,8677,8678,8679,8680,8681,8682,8683,8684,8685,8686,8687,8688,8689,8690,8691,8692,8693,8694,8695,8696,8697,8698,8699,8700,8701,8702,8703,8704,8705,8706,8707,8708,8709,8710,8711,8712,8713,8714,8715,8716,8717,8718,8719,8720,8721,8722,8723,8724,8725,8726,8727,8728,8729,8730,8731,8732,8733,8734, 8735,8736,8737,8738,8739,8740,8741]},{}],15:[function(a,d,b){function c(){g.apply(this);this.getCharsetName=function(){return"EUC-TW"};this._mCodingSM=new f(m);this._mDistributionAnalyzer=new e;this.reset()}var f=a("./codingstatemachine"),g=a("./mbcharsetprober"),e=a("./chardistribution").EUCTWDistributionAnalysis,m=a("./mbcssm/euctw");c.prototype=new g;d.exports=c},{"./chardistribution":4,"./codingstatemachine":7,"./mbcharsetprober":30,"./mbcssm/euctw":35}],16:[function(a,d,b){b.GB2312_TYPICAL_DISTRIBUTION_RATIO= .9;b.GB2312_TABLE_SIZE=3760;b.GB2312CharToFreqOrder=[1671,749,1443,2364,3924,3807,2330,3921,1704,3463,2691,1511,1515,572,3191,2205,2361,224,2558,479,1711,963,3162,440,4060,1905,2966,2947,3580,2647,3961,3842,2204,869,4207,970,2678,5626,2944,2956,1479,4048,514,3595,588,1346,2820,3409,249,4088,1746,1873,2047,1774,581,1813,358,1174,3590,1014,1561,4844,2245,670,1636,3112,889,1286,953,556,2327,3060,1290,3141,613,185,3477,1367,850,3820,1715,2428,2642,2303,2732,3041,2562,2648,3566,3946,1349,388,3098,2091, 1360,3585,152,1687,1539,738,1559,59,1232,2925,2267,1388,1249,1741,1679,2960,151,1566,1125,1352,4271,924,4296,385,3166,4459,310,1245,2850,70,3285,2729,3534,3575,2398,3298,3466,1960,2265,217,3647,864,1909,2084,4401,2773,1010,3269,5152,853,3051,3121,1244,4251,1895,364,1499,1540,2313,1180,3655,2268,562,715,2417,3061,544,336,3768,2380,1752,4075,950,280,2425,4382,183,2759,3272,333,4297,2155,1688,2356,1444,1039,4540,736,1177,3349,2443,2368,2144,2225,565,196,1482,3406,927,1335,4147,692,878,1311,1653,3911, 3622,1378,4200,1840,2969,3149,2126,1816,2534,1546,2393,2760,737,2494,13,447,245,2747,38,2765,2129,2589,1079,606,360,471,3755,2890,404,848,699,1785,1236,370,2221,1023,3746,2074,2026,2023,2388,1581,2119,812,1141,3091,2536,1519,804,2053,406,1596,1090,784,548,4414,1806,2264,2936,1100,343,4114,5096,622,3358,743,3668,1510,1626,5020,3567,2513,3195,4115,5627,2489,2991,24,2065,2697,1087,2719,48,1634,315,68,985,2052,198,2239,1347,1107,1439,597,2366,2172,871,3307,919,2487,2790,1867,236,2570,1413,3794,906,3365, 3381,1701,1982,1818,1524,2924,1205,616,2586,2072,2004,575,253,3099,32,1365,1182,197,1714,2454,1201,554,3388,3224,2748,756,2587,250,2567,1507,1517,3529,1922,2761,2337,3416,1961,1677,2452,2238,3153,615,911,1506,1474,2495,1265,1906,2749,3756,3280,2161,898,2714,1759,3450,2243,2444,563,26,3286,2266,3769,3344,2707,3677,611,1402,531,1028,2871,4548,1375,261,2948,835,1190,4134,353,840,2684,1900,3082,1435,2109,1207,1674,329,1872,2781,4055,2686,2104,608,3318,2423,2957,2768,1108,3739,3512,3271,3985,2203,1771, 3520,1418,2054,1681,1153,225,1627,2929,162,2050,2511,3687,1954,124,1859,2431,1684,3032,2894,585,4805,3969,2869,2704,2088,2032,2095,3656,2635,4362,2209,256,518,2042,2105,3777,3657,643,2298,1148,1779,190,989,3544,414,11,2135,2063,2979,1471,403,3678,126,770,1563,671,2499,3216,2877,600,1179,307,2805,4937,1268,1297,2694,252,4032,1448,1494,1331,1394,127,2256,222,1647,1035,1481,3056,1915,1048,873,3651,210,33,1608,2516,200,1520,415,102,0,3389,1287,817,91,3299,2940,836,1814,549,2197,1396,1669,2987,3582,2297, 2848,4528,1070,687,20,1819,121,1552,1364,1461,1968,2617,3540,2824,2083,177,948,4938,2291,110,4549,2066,648,3359,1755,2110,2114,4642,4845,1693,3937,3308,1257,1869,2123,208,1804,3159,2992,2531,2549,3361,2418,1350,2347,2800,2568,1291,2036,2680,72,842,1990,212,1233,1154,1586,75,2027,3410,4900,1823,1337,2710,2676,728,2810,1522,3026,4995,157,755,1050,4022,710,785,1936,2194,2085,1406,2777,2400,150,1250,4049,1206,807,1910,534,529,3309,1721,1660,274,39,2827,661,2670,1578,925,3248,3815,1094,4278,4901,4252, 41,1150,3747,2572,2227,4501,3658,4902,3813,3357,3617,2884,2258,887,538,4187,3199,1294,2439,3042,2329,2343,2497,1255,107,543,1527,521,3478,3568,194,5062,15,961,3870,1241,1192,2664,66,5215,3260,2111,1295,1127,2152,3805,4135,901,1164,1976,398,1278,530,1460,748,904,1054,1966,1426,53,2909,509,523,2279,1534,536,1019,239,1685,460,2353,673,1065,2401,3600,4298,2272,1272,2363,284,1753,3679,4064,1695,81,815,2677,2757,2731,1386,859,500,4221,2190,2566,757,1006,2519,2068,1166,1455,337,2654,3203,1863,1682,1914, 3025,1252,1409,1366,847,714,2834,2038,3209,964,2970,1901,885,2553,1078,1756,3049,301,1572,3326,688,2130,1996,2429,1805,1648,2930,3421,2750,3652,3088,262,1158,1254,389,1641,1812,526,1719,923,2073,1073,1902,468,489,4625,1140,857,2375,3070,3319,2863,380,116,1328,2693,1161,2244,273,1212,1884,2769,3011,1775,1142,461,3066,1200,2147,2212,790,702,2695,4222,1601,1058,434,2338,5153,3640,67,2360,4099,2502,618,3472,1329,416,1132,830,2782,1807,2653,3211,3510,1662,192,2124,296,3979,1739,1611,3684,23,118,324,446, 1239,1225,293,2520,3814,3795,2535,3116,17,1074,467,2692,2201,387,2922,45,1326,3055,1645,3659,2817,958,243,1903,2320,1339,2825,1784,3289,356,576,865,2315,2381,3377,3916,1088,3122,1713,1655,935,628,4689,1034,1327,441,800,720,894,1979,2183,1528,5289,2702,1071,4046,3572,2399,1571,3281,79,761,1103,327,134,758,1899,1371,1615,879,442,215,2605,2579,173,2048,2485,1057,2975,3317,1097,2253,3801,4263,1403,1650,2946,814,4968,3487,1548,2644,1567,1285,2,295,2636,97,946,3576,832,141,4257,3273,760,3821,3521,3156, 2607,949,1024,1733,1516,1803,1920,2125,2283,2665,3180,1501,2064,3560,2171,1592,803,3518,1416,732,3897,4258,1363,1362,2458,119,1427,602,1525,2608,1605,1639,3175,694,3064,10,465,76,2E3,4846,4208,444,3781,1619,3353,2206,1273,3796,740,2483,320,1723,2377,3660,2619,1359,1137,1762,1724,2345,2842,1850,1862,912,821,1866,612,2625,1735,2573,3369,1093,844,89,937,930,1424,3564,2413,2972,1004,3046,3019,2011,711,3171,1452,4178,428,801,1943,432,445,2811,206,4136,1472,730,349,73,397,2802,2547,998,1637,1167,789,396, 3217,154,1218,716,1120,1780,2819,4826,1931,3334,3762,2139,1215,2627,552,3664,3628,3232,1405,2383,3111,1356,2652,3577,3320,3101,1703,640,1045,1370,1246,4996,371,1575,2436,1621,2210,984,4033,1734,2638,16,4529,663,2755,3255,1451,3917,2257,1253,1955,2234,1263,2951,214,1229,617,485,359,1831,1969,473,2310,750,2058,165,80,2864,2419,361,4344,2416,2479,1134,796,3726,1266,2943,860,2715,938,390,2734,1313,1384,248,202,877,1064,2854,522,3907,279,1602,297,2357,395,3740,137,2075,944,4089,2584,1267,3802,62,1533, 2285,178,176,780,2440,201,3707,590,478,1560,4354,2117,1075,30,74,4643,4004,1635,1441,2745,776,2596,238,1077,1692,1912,2844,605,499,1742,3947,241,3053,980,1749,936,2640,4511,2582,515,1543,2162,5322,2892,2993,890,2148,1924,665,1827,3581,1032,968,3163,339,1044,1896,270,583,1791,1720,4367,1194,3488,3669,43,2523,1657,163,2167,290,1209,1622,3378,550,634,2508,2510,695,2634,2384,2512,1476,1414,220,1469,2341,2138,2852,3183,2900,4939,2865,3502,1211,3680,854,3227,1299,2976,3172,186,2998,1459,443,1067,3251,1495, 321,1932,3054,909,753,1410,1828,436,2441,1119,1587,3164,2186,1258,227,231,1425,1890,3200,3942,247,959,725,5254,2741,577,2158,2079,929,120,174,838,2813,591,1115,417,2024,40,3240,1536,1037,291,4151,2354,632,1298,2406,2500,3535,1825,1846,3451,205,1171,345,4238,18,1163,811,685,2208,1217,425,1312,1508,1175,4308,2552,1033,587,1381,3059,2984,3482,340,1316,4023,3972,792,3176,519,777,4690,918,933,4130,2981,3741,90,3360,2911,2200,5184,4550,609,3079,2030,272,3379,2736,363,3881,1130,1447,286,779,357,1169,3350, 3137,1630,1220,2687,2391,747,1277,3688,2618,2682,2601,1156,3196,5290,4034,3102,1689,3596,3128,874,219,2783,798,508,1843,2461,269,1658,1776,1392,1913,2983,3287,2866,2159,2372,829,4076,46,4253,2873,1889,1894,915,1834,1631,2181,2318,298,664,2818,3555,2735,954,3228,3117,527,3511,2173,681,2712,3033,2247,2346,3467,1652,155,2164,3382,113,1994,450,899,494,994,1237,2958,1875,2336,1926,3727,545,1577,1550,633,3473,204,1305,3072,2410,1956,2471,707,2134,841,2195,2196,2663,3843,1026,4940,990,3252,4997,368,1092, 437,3212,3258,1933,1829,675,2977,2893,412,943,3723,4644,3294,3283,2230,2373,5154,2389,2241,2661,2323,1404,2524,593,787,677,3008,1275,2059,438,2709,2609,2240,2269,2246,1446,36,1568,1373,3892,1574,2301,1456,3962,693,2276,5216,2035,1143,2720,1919,1797,1811,2763,4137,2597,1830,1699,1488,1198,2090,424,1694,312,3634,3390,4179,3335,2252,1214,561,1059,3243,2295,2561,975,5155,2321,2751,3772,472,1537,3282,3398,1047,2077,2348,2878,1323,3340,3076,690,2906,51,369,170,3541,1060,2187,2688,3670,2541,1083,1683,928, 3918,459,109,4427,599,3744,4286,143,2101,2730,2490,82,1588,3036,2121,281,1860,477,4035,1238,2812,3020,2716,3312,1530,2188,2055,1317,843,636,1808,1173,3495,649,181,1002,147,3641,1159,2414,3750,2289,2795,813,3123,2610,1136,4368,5,3391,4541,2174,420,429,1728,754,1228,2115,2219,347,2223,2733,735,1518,3003,2355,3134,1764,3948,3329,1888,2424,1001,1234,1972,3321,3363,1672,1021,1450,1584,226,765,655,2526,3404,3244,2302,3665,731,594,2184,319,1576,621,658,2656,4299,2099,3864,1279,2071,2598,2739,795,3086,3699, 3908,1707,2352,2402,1382,3136,2475,1465,4847,3496,3865,1085,3004,2591,1084,213,2287,1963,3565,2250,822,793,4574,3187,1772,1789,3050,595,1484,1959,2770,1080,2650,456,422,2996,940,3322,4328,4345,3092,2742,965,2784,739,4124,952,1358,2498,2949,2565,332,2698,2378,660,2260,2473,4194,3856,2919,535,1260,2651,1208,1428,1300,1949,1303,2942,433,2455,2450,1251,1946,614,1269,641,1306,1810,2737,3078,2912,564,2365,1419,1415,1497,4460,2367,2185,1379,3005,1307,3218,2175,1897,3063,682,1157,4040,4005,1712,1160,1941, 1399,394,402,2952,1573,1151,2986,2404,862,299,2033,1489,3006,346,171,2886,3401,1726,2932,168,2533,47,2507,1030,3735,1145,3370,1395,1318,1579,3609,4560,2857,4116,1457,2529,1965,504,1036,2690,2988,2405,745,5871,849,2397,2056,3081,863,2359,3857,2096,99,1397,1769,2300,4428,1643,3455,1978,1757,3718,1440,35,4879,3742,1296,4228,2280,160,5063,1599,2013,166,520,3479,1646,3345,3012,490,1937,1545,1264,2182,2505,1096,1188,1369,1436,2421,1667,2792,2460,1270,2122,727,3167,2143,806,1706,1012,1800,3037,960,2218, 1882,805,139,2456,1139,1521,851,1052,3093,3089,342,2039,744,5097,1468,1502,1585,2087,223,939,326,2140,2577,892,2481,1623,4077,982,3708,135,2131,87,2503,3114,2326,1106,876,1616,547,2997,2831,2093,3441,4530,4314,9,3256,4229,4148,659,1462,1986,1710,2046,2913,2231,4090,4880,5255,3392,3274,1368,3689,4645,1477,705,3384,3635,1068,1529,2941,1458,3782,1509,100,1656,2548,718,2339,408,1590,2780,3548,1838,4117,3719,1345,3530,717,3442,2778,3220,2898,1892,4590,3614,3371,2043,1998,1224,3483,891,635,584,2559,3355, 733,1766,1729,1172,3789,1891,2307,781,2982,2271,1957,1580,5773,2633,2005,4195,3097,1535,3213,1189,1934,5693,3262,586,3118,1324,1598,517,1564,2217,1868,1893,4445,3728,2703,3139,1526,1787,1992,3882,2875,1549,1199,1056,2224,1904,2711,5098,4287,338,1993,3129,3489,2689,1809,2815,1997,957,1855,3898,2550,3275,3057,1105,1319,627,1505,1911,1883,3526,698,3629,3456,1833,1431,746,77,1261,2017,2296,1977,1885,125,1334,1600,525,1798,1109,2222,1470,1945,559,2236,1186,3443,2476,1929,1411,2411,3135,1777,3372,2621, 1841,1613,3229,668,1430,1839,2643,2916,195,1989,2671,2358,1387,629,3205,2293,5256,4439,123,1310,888,1879,4300,3021,3605,1003,1162,3192,2910,2010,140,2395,2859,55,1082,2012,2901,662,419,2081,1438,680,2774,4654,3912,1620,1731,1625,5035,4065,2328,512,1344,802,5443,2163,2311,2537,524,3399,98,1155,2103,1918,2606,3925,2816,1393,2465,1504,3773,2177,3963,1478,4346,180,1113,4655,3461,2028,1698,833,2696,1235,1322,1594,4408,3623,3013,3225,2040,3022,541,2881,607,3632,2029,1665,1219,639,1385,1686,1099,2803,3231, 1938,3188,2858,427,676,2772,1168,2025,454,3253,2486,3556,230,1950,580,791,1991,1280,1086,1974,2034,630,257,3338,2788,4903,1017,86,4790,966,2789,1995,1696,1131,259,3095,4188,1308,179,1463,5257,289,4107,1248,42,3413,1725,2288,896,1947,774,4474,4254,604,3430,4264,392,2514,2588,452,237,1408,3018,988,4531,1970,3034,3310,540,2370,1562,1288,2990,502,4765,1147,4,1853,2708,207,294,2814,4078,2902,2509,684,34,3105,3532,2551,644,709,2801,2344,573,1727,3573,3557,2021,1081,3100,4315,2100,3681,199,2263,1837,2385, 146,3484,1195,2776,3949,997,1939,3973,1008,1091,1202,1962,1847,1149,4209,5444,1076,493,117,5400,2521,972,1490,2934,1796,4542,2374,1512,2933,2657,413,2888,1135,2762,2314,2156,1355,2369,766,2007,2527,2170,3124,2491,2593,2632,4757,2437,234,3125,3591,1898,1750,1376,1942,3468,3138,570,2127,2145,3276,4131,962,132,1445,4196,19,941,3624,3480,3366,1973,1374,4461,3431,2629,283,2415,2275,808,2887,3620,2112,2563,1353,3610,955,1089,3103,1053,96,88,4097,823,3808,1583,399,292,4091,3313,421,1128,642,4006,903,2539, 1877,2082,596,29,4066,1790,722,2157,130,995,1569,769,1485,464,513,2213,288,1923,1101,2453,4316,133,486,2445,50,625,487,2207,57,423,481,2962,159,3729,1558,491,303,482,501,240,2837,112,3648,2392,1783,362,8,3433,3422,610,2793,3277,1390,1284,1654,21,3823,734,367,623,193,287,374,1009,1483,816,476,313,2255,2340,1262,2150,2899,1146,2581,782,2116,1659,2018,1880,255,3586,3314,1110,2867,2137,2564,986,2767,5185,2006,650,158,926,762,881,3157,2717,2362,3587,306,3690,3245,1542,3077,2427,1691,2478,2118,2985,3490, 2438,539,2305,983,129,1754,355,4201,2386,827,2923,104,1773,2838,2771,411,2905,3919,376,767,122,1114,828,2422,1817,3506,266,3460,1007,1609,4998,945,2612,4429,2274,726,1247,1964,2914,2199,2070,4002,4108,657,3323,1422,579,455,2764,4737,1222,2895,1670,824,1223,1487,2525,558,861,3080,598,2659,2515,1967,752,2583,2376,2214,4180,977,704,2464,4999,2622,4109,1210,2961,819,1541,142,2284,44,418,457,1126,3730,4347,4626,1644,1876,3671,1864,302,1063,5694,624,723,1984,3745,1314,1676,2488,1610,1449,3558,3569,2166, 2098,409,1011,2325,3704,2306,818,1732,1383,1824,1844,3757,999,2705,3497,1216,1423,2683,2426,2954,2501,2726,2229,1475,2554,5064,1971,1794,1666,2014,1343,783,724,191,2434,1354,2220,5065,1763,2752,2472,4152,131,175,2885,3434,92,1466,4920,2616,3871,3872,3866,128,1551,1632,669,1854,3682,4691,4125,1230,188,2973,3290,1302,1213,560,3266,917,763,3909,3249,1760,868,1958,764,1782,2097,145,2277,3774,4462,64,1491,3062,971,2132,3606,2442,221,1226,1617,218,323,1185,3207,3147,571,619,1473,1005,1744,2281,449,1887, 2396,3685,275,375,3816,1743,3844,3731,845,1983,2350,4210,1377,773,967,3499,3052,3743,2725,4007,1697,1022,3943,1464,3264,2855,2722,1952,1029,2839,2467,84,4383,2215,820,1391,2015,2448,3672,377,1948,2168,797,2545,3536,2578,2645,94,2874,1678,405,1259,3071,771,546,1315,470,1243,3083,895,2468,981,969,2037,846,4181,653,1276,2928,14,2594,557,3007,2474,156,902,1338,1740,2574,537,2518,973,2282,2216,2433,1928,138,2903,1293,2631,1612,646,3457,839,2935,111,496,2191,2847,589,3186,149,3994,2060,4031,2641,4067,3145, 1870,37,3597,2136,1025,2051,3009,3383,3549,1121,1016,3261,1301,251,2446,2599,2153,872,3246,637,334,3705,831,884,921,3065,3140,4092,2198,1944,246,2964,108,2045,1152,1921,2308,1031,203,3173,4170,1907,3890,810,1401,2003,1690,506,647,1242,2828,1761,1649,3208,2249,1589,3709,2931,5156,1708,498,666,2613,834,3817,1231,184,2851,1124,883,3197,2261,3710,1765,1553,2658,1178,2639,2351,93,1193,942,2538,2141,4402,235,1821,870,1591,2192,1709,1871,3341,1618,4126,2595,2334,603,651,69,701,268,2662,3411,2555,1380,1606, 503,448,254,2371,2646,574,1187,2309,1770,322,2235,1292,1801,305,566,1133,229,2067,2057,706,167,483,2002,2672,3295,1820,3561,3067,316,378,2746,3452,1112,136,1981,507,1651,2917,1117,285,4591,182,2580,3522,1304,335,3303,1835,2504,1795,1792,2248,674,1018,2106,2449,1857,2292,2845,976,3047,1781,2600,2727,1389,1281,52,3152,153,265,3950,672,3485,3951,4463,430,1183,365,278,2169,27,1407,1336,2304,209,1340,1730,2202,1852,2403,2883,979,1737,1062,631,2829,2542,3876,2592,825,2086,2226,3048,3625,352,1417,3724,542, 991,431,1351,3938,1861,2294,826,1361,2927,3142,3503,1738,463,2462,2723,582,1916,1595,2808,400,3845,3891,2868,3621,2254,58,2492,1123,910,2160,2614,1372,1603,1196,1072,3385,1700,3267,1980,696,480,2430,920,799,1570,2920,1951,2041,4047,2540,1321,4223,2469,3562,2228,1271,2602,401,2833,3351,2575,5157,907,2312,1256,410,263,3507,1582,996,678,1849,2316,1480,908,3545,2237,703,2322,667,1826,2849,1531,2604,2999,2407,3146,2151,2630,1786,3711,469,3542,497,3899,2409,858,837,4446,3393,1274,786,620,1845,2001,3311, 484,308,3367,1204,1815,3691,2332,1532,2557,1842,2020,2724,1927,2333,4440,567,22,1673,2728,4475,1987,1858,1144,1597,101,1832,3601,12,974,3783,4391,951,1412,1,3720,453,4608,4041,528,1041,1027,3230,2628,1129,875,1051,3291,1203,2262,1069,2860,2799,2149,2615,3278,144,1758,3040,31,475,1680,366,2685,3184,311,1642,4008,2466,5036,1593,1493,2809,216,1420,1668,233,304,2128,3284,232,1429,1768,1040,2008,3407,2740,2967,2543,242,2133,778,1565,2022,2620,505,2189,2756,1098,2273,372,1614,708,553,2846,2094,2278,169, 3626,2835,4161,228,2674,3165,809,1454,1309,466,1705,1095,900,3423,880,2667,3751,5258,2317,3109,2571,4317,2766,1503,1342,866,4447,1118,63,2076,314,1881,1348,1061,172,978,3515,1747,532,511,3970,6,601,905,2699,3300,1751,276,1467,3725,2668,65,4239,2544,2779,2556,1604,578,2451,1802,992,2331,2624,1320,3446,713,1513,1013,103,2786,2447,1661,886,1702,916,654,3574,2031,1556,751,2178,2821,2179,1498,1538,2176,271,914,2251,2080,1325,638,1953,2937,3877,2432,2754,95,3265,1716,260,1227,4083,775,106,1357,3254,426, 1607,555,2480,772,1985,244,2546,474,495,1046,2611,1851,2061,71,2089,1675,2590,742,3758,2843,3222,1433,267,2180,2576,2826,2233,2092,3913,2435,956,1745,3075,856,2113,1116,451,3,1988,2896,1398,993,2463,1878,2049,1341,2718,2721,2870,2108,712,2904,4363,2753,2324,277,2872,2349,2649,384,987,435,691,3E3,922,164,3939,652,1500,1184,4153,2482,3373,2165,4848,2335,3775,3508,3154,2806,2830,1554,2102,1664,2530,1434,2408,893,1547,2623,3447,2832,2242,2532,3169,2856,3223,2078,49,3770,3469,462,318,656,2259,3250,3069, 679,1629,2758,344,1138,1104,3120,1836,1283,3115,2154,1437,4448,934,759,1999,794,2862,1038,533,2560,1722,2342,855,2626,1197,1663,4476,3127,85,4240,2528,25,1111,1181,3673,407,3470,4561,2679,2713,768,1925,2841,3986,1544,1165,932,373,1240,2146,1930,2673,721,4766,354,4333,391,2963,187,61,3364,1442,1102,330,1940,1767,341,3809,4118,393,2496,2062,2211,105,331,300,439,913,1332,626,379,3304,1557,328,689,3952,309,1555,931,317,2517,3027,325,569,686,2107,3084,60,1042,1333,2794,264,3177,4014,1628,258,3712,7,4464, 1176,1043,1778,683,114,1975,78,1492,383,1886,510,386,645,5291,2891,2069,3305,4138,3867,2939,2603,2493,1935,1066,1848,3588,1015,1282,1289,4609,697,1453,3044,2666,3611,1856,2412,54,719,1330,568,3778,2459,1748,788,492,551,1191,1E3,488,3394,3763,282,1799,348,2016,1523,3155,2390,1049,382,2019,1788,1170,729,2968,3523,897,3926,2785,2938,3292,350,2319,3238,1718,1717,2655,3453,3143,4465,161,2889,2980,2009,1421,56,1908,1640,2387,2232,1917,1874,2477,4921,148,83,3438,592,4245,2882,1822,1055,741,115,1496,1624, 381,1638,4592,1020,516,3214,458,947,4575,1432,211,1514,2926,1865,2142,189,852,1221,1400,1486,882,2299,4036,351,28,1122,700,6479,6480,6481,6482,6483,5508,6484,3900,3414,3974,4441,4024,3537,4037,5628,5099,3633,6485,3148,6486,3636,5509,3257,5510,5973,5445,5872,4941,4403,3174,4627,5873,6276,2286,4230,5446,5874,5122,6102,6103,4162,5447,5123,5323,4849,6277,3980,3851,5066,4246,5774,5067,6278,3001,2807,5695,3346,5775,5974,5158,5448,6487,5975,5976,5776,3598,6279,5696,4806,4211,4154,6280,6488,6489,6490,6281, 4212,5037,3374,4171,6491,4562,4807,4722,4827,5977,6104,4532,4079,5159,5324,5160,4404,3858,5359,5875,3975,4288,4610,3486,4512,5325,3893,5360,6282,6283,5560,2522,4231,5978,5186,5449,2569,3878,6284,5401,3578,4415,6285,4656,5124,5979,2506,4247,4449,3219,3417,4334,4969,4329,6492,4576,4828,4172,4416,4829,5402,6286,3927,3852,5361,4369,4830,4477,4867,5876,4173,6493,6105,4657,6287,6106,5877,5450,6494,4155,4868,5451,3700,5629,4384,6288,6289,5878,3189,4881,6107,6290,6495,4513,6496,4692,4515,4723,5100,3356,6497, 6291,3810,4080,5561,3570,4430,5980,6498,4355,5697,6499,4724,6108,6109,3764,4050,5038,5879,4093,3226,6292,5068,5217,4693,3342,5630,3504,4831,4377,4466,4309,5698,4431,5777,6293,5778,4272,3706,6110,5326,3752,4676,5327,4273,5403,4767,5631,6500,5699,5880,3475,5039,6294,5562,5125,4348,4301,4482,4068,5126,4593,5700,3380,3462,5981,5563,3824,5404,4970,5511,3825,4738,6295,6501,5452,4516,6111,5881,5564,6502,6296,5982,6503,4213,4163,3454,6504,6112,4009,4450,6113,4658,6297,6114,3035,6505,6115,3995,4904,4739,4563, 4942,4110,5040,3661,3928,5362,3674,6506,5292,3612,4791,5565,4149,5983,5328,5259,5021,4725,4577,4564,4517,4364,6298,5405,4578,5260,4594,4156,4157,5453,3592,3491,6507,5127,5512,4709,4922,5984,5701,4726,4289,6508,4015,6116,5128,4628,3424,4241,5779,6299,4905,6509,6510,5454,5702,5780,6300,4365,4923,3971,6511,5161,3270,3158,5985,4100,867,5129,5703,6117,5363,3695,3301,5513,4467,6118,6512,5455,4232,4242,4629,6513,3959,4478,6514,5514,5329,5986,4850,5162,5566,3846,4694,6119,5456,4869,5781,3779,6301,5704,5987, 5515,4710,6302,5882,6120,4392,5364,5705,6515,6121,6516,6517,3736,5988,5457,5989,4695,2457,5883,4551,5782,6303,6304,6305,5130,4971,6122,5163,6123,4870,3263,5365,3150,4871,6518,6306,5783,5069,5706,3513,3498,4409,5330,5632,5366,5458,5459,3991,5990,4502,3324,5991,5784,3696,4518,5633,4119,6519,4630,5634,4417,5707,4832,5992,3418,6124,5993,5567,4768,5218,6520,4595,3458,5367,6125,5635,6126,4202,6521,4740,4924,6307,3981,4069,4385,6308,3883,2675,4051,3834,4302,4483,5568,5994,4972,4101,5368,6309,5164,5884,3922, 6127,6522,6523,5261,5460,5187,4164,5219,3538,5516,4111,3524,5995,6310,6311,5369,3181,3386,2484,5188,3464,5569,3627,5708,6524,5406,5165,4677,4492,6312,4872,4851,5885,4468,5996,6313,5709,5710,6128,2470,5886,6314,5293,4882,5785,3325,5461,5101,6129,5711,5786,6525,4906,6526,6527,4418,5887,5712,4808,2907,3701,5713,5888,6528,3765,5636,5331,6529,6530,3593,5889,3637,4943,3692,5714,5787,4925,6315,6130,5462,4405,6131,6132,6316,5262,6531,6532,5715,3859,5716,5070,4696,5102,3929,5788,3987,4792,5997,6533,6534,3920, 4809,5E3,5998,6535,2974,5370,6317,5189,5263,5717,3826,6536,3953,5001,4883,3190,5463,5890,4973,5999,4741,6133,6134,3607,5570,6E3,4711,3362,3630,4552,5041,6318,6001,2950,2953,5637,4646,5371,4944,6002,2044,4120,3429,6319,6537,5103,4833,6538,6539,4884,4647,3884,6003,6004,4758,3835,5220,5789,4565,5407,6540,6135,5294,4697,4852,6320,6321,3206,4907,6541,6322,4945,6542,6136,6543,6323,6005,4631,3519,6544,5891,6545,5464,3784,5221,6546,5571,4659,6547,6324,6137,5190,6548,3853,6549,4016,4834,3954,6138,5332,3827, 4017,3210,3546,4469,5408,5718,3505,4648,5790,5131,5638,5791,5465,4727,4318,6325,6326,5792,4553,4010,4698,3439,4974,3638,4335,3085,6006,5104,5042,5166,5892,5572,6327,4356,4519,5222,5573,5333,5793,5043,6550,5639,5071,4503,6328,6139,6551,6140,3914,3901,5372,6007,5640,4728,4793,3976,3836,4885,6552,4127,6553,4451,4102,5002,6554,3686,5105,6555,5191,5072,5295,4611,5794,5296,6556,5893,5264,5894,4975,5466,5265,4699,4976,4370,4056,3492,5044,4886,6557,5795,4432,4769,4357,5467,3940,4660,4290,6141,4484,4770,4661, 3992,6329,4025,4662,5022,4632,4835,4070,5297,4663,4596,5574,5132,5409,5895,6142,4504,5192,4664,5796,5896,3885,5575,5797,5023,4810,5798,3732,5223,4712,5298,4084,5334,5468,6143,4052,4053,4336,4977,4794,6558,5335,4908,5576,5224,4233,5024,4128,5469,5225,4873,6008,5045,4729,4742,4633,3675,4597,6559,5897,5133,5577,5003,5641,5719,6330,6560,3017,2382,3854,4406,4811,6331,4393,3964,4946,6561,2420,3722,6562,4926,4378,3247,1736,4442,6332,5134,6333,5226,3996,2918,5470,4319,4003,4598,4743,4744,4485,3785,3902,5167, 5004,5373,4394,5898,6144,4874,1793,3997,6334,4085,4214,5106,5642,4909,5799,6009,4419,4189,3330,5899,4165,4420,5299,5720,5227,3347,6145,4081,6335,2876,3930,6146,3293,3786,3910,3998,5900,5300,5578,2840,6563,5901,5579,6147,3531,5374,6564,6565,5580,4759,5375,6566,6148,3559,5643,6336,6010,5517,6337,6338,5721,5902,3873,6011,6339,6567,5518,3868,3649,5722,6568,4771,4947,6569,6149,4812,6570,2853,5471,6340,6341,5644,4795,6342,6012,5723,6343,5724,6013,4349,6344,3160,6150,5193,4599,4514,4493,5168,4320,6345,4927, 3666,4745,5169,5903,5005,4928,6346,5725,6014,4730,4203,5046,4948,3395,5170,6015,4150,6016,5726,5519,6347,5047,3550,6151,6348,4197,4310,5904,6571,5581,2965,6152,4978,3960,4291,5135,6572,5301,5727,4129,4026,5905,4853,5728,5472,6153,6349,4533,2700,4505,5336,4678,3583,5073,2994,4486,3043,4554,5520,6350,6017,5800,4487,6351,3931,4103,5376,6352,4011,4321,4311,4190,5136,6018,3988,3233,4350,5906,5645,4198,6573,5107,3432,4191,3435,5582,6574,4139,5410,6353,5411,3944,5583,5074,3198,6575,6354,4358,6576,5302,4600, 5584,5194,5412,6577,6578,5585,5413,5303,4248,5414,3879,4433,6579,4479,5025,4854,5415,6355,4760,4772,3683,2978,4700,3797,4452,3965,3932,3721,4910,5801,6580,5195,3551,5907,3221,3471,3029,6019,3999,5908,5909,5266,5267,3444,3023,3828,3170,4796,5646,4979,4259,6356,5647,5337,3694,6357,5648,5338,4520,4322,5802,3031,3759,4071,6020,5586,4836,4386,5048,6581,3571,4679,4174,4949,6154,4813,3787,3402,3822,3958,3215,3552,5268,4387,3933,4950,4359,6021,5910,5075,3579,6358,4234,4566,5521,6359,3613,5049,6022,5911,3375, 3702,3178,4911,5339,4521,6582,6583,4395,3087,3811,5377,6023,6360,6155,4027,5171,5649,4421,4249,2804,6584,2270,6585,4E3,4235,3045,6156,5137,5729,4140,4312,3886,6361,4330,6157,4215,6158,3500,3676,4929,4331,3713,4930,5912,4265,3776,3368,5587,4470,4855,3038,4980,3631,6159,6160,4132,4680,6161,6362,3923,4379,5588,4255,6586,4121,6587,6363,4649,6364,3288,4773,4774,6162,6024,6365,3543,6588,4274,3107,3737,5050,5803,4797,4522,5589,5051,5730,3714,4887,5378,4001,4523,6163,5026,5522,4701,4175,2791,3760,6589,5473, 4224,4133,3847,4814,4815,4775,3259,5416,6590,2738,6164,6025,5304,3733,5076,5650,4816,5590,6591,6165,6592,3934,5269,6593,3396,5340,6594,5804,3445,3602,4042,4488,5731,5732,3525,5591,4601,5196,6166,6026,5172,3642,4612,3202,4506,4798,6366,3818,5108,4303,5138,5139,4776,3332,4304,2915,3415,4434,5077,5109,4856,2879,5305,4817,6595,5913,3104,3144,3903,4634,5341,3133,5110,5651,5805,6167,4057,5592,2945,4371,5593,6596,3474,4182,6367,6597,6168,4507,4279,6598,2822,6599,4777,4713,5594,3829,6169,3887,5417,6170,3653, 5474,6368,4216,2971,5228,3790,4579,6369,5733,6600,6601,4951,4746,4555,6602,5418,5475,6027,3400,4665,5806,6171,4799,6028,5052,6172,3343,4800,4747,5006,6370,4556,4217,5476,4396,5229,5379,5477,3839,5914,5652,5807,4714,3068,4635,5808,6173,5342,4192,5078,5419,5523,5734,6174,4557,6175,4602,6371,6176,6603,5809,6372,5735,4260,3869,5111,5230,6029,5112,6177,3126,4681,5524,5915,2706,3563,4748,3130,6178,4018,5525,6604,6605,5478,4012,4837,6606,4534,4193,5810,4857,3615,5479,6030,4082,3697,3539,4086,5270,3662,4508, 4931,5916,4912,5811,5027,3888,6607,4397,3527,3302,3798,2775,2921,2637,3966,4122,4388,4028,4054,1633,4858,5079,3024,5007,3982,3412,5736,6608,3426,3236,5595,3030,6179,3427,3336,3279,3110,6373,3874,3039,5080,5917,5140,4489,3119,6374,5812,3405,4494,6031,4666,4141,6180,4166,6032,5813,4981,6609,5081,4422,4982,4112,3915,5653,3296,3983,6375,4266,4410,5654,6610,6181,3436,5082,6611,5380,6033,3819,5596,4535,5231,5306,5113,6612,4952,5918,4275,3113,6613,6376,6182,6183,5814,3073,4731,4838,5008,3831,6614,4888,3090, 3848,4280,5526,5232,3014,5655,5009,5737,5420,5527,6615,5815,5343,5173,5381,4818,6616,3151,4953,6617,5738,2796,3204,4360,2989,4281,5739,5174,5421,5197,3132,5141,3849,5142,5528,5083,3799,3904,4839,5480,2880,4495,3448,6377,6184,5271,5919,3771,3193,6034,6035,5920,5010,6036,5597,6037,6378,6038,3106,5422,6618,5423,5424,4142,6619,4889,5084,4890,4313,5740,6620,3437,5175,5307,5816,4199,5198,5529,5817,5199,5656,4913,5028,5344,3850,6185,2955,5272,5011,5818,4567,4580,5029,5921,3616,5233,6621,6622,6186,4176,6039, 6379,6380,3352,5200,5273,2908,5598,5234,3837,5308,6623,6624,5819,4496,4323,5309,5201,6625,6626,4983,3194,3838,4167,5530,5922,5274,6381,6382,3860,3861,5599,3333,4292,4509,6383,3553,5481,5820,5531,4778,6187,3955,3956,4324,4389,4218,3945,4325,3397,2681,5923,4779,5085,4019,5482,4891,5382,5383,6040,4682,3425,5275,4094,6627,5310,3015,5483,5657,4398,5924,3168,4819,6628,5925,6629,5532,4932,4613,6041,6630,4636,6384,4780,4204,5658,4423,5821,3989,4683,5822,6385,4954,6631,5345,6188,5425,5012,5384,3894,6386,4490, 4104,6632,5741,5053,6633,5823,5926,5659,5660,5927,6634,5235,5742,5824,4840,4933,4820,6387,4859,5928,4955,6388,4143,3584,5825,5346,5013,6635,5661,6389,5014,5484,5743,4337,5176,5662,6390,2836,6391,3268,6392,6636,6042,5236,6637,4158,6638,5744,5663,4471,5347,3663,4123,5143,4293,3895,6639,6640,5311,5929,5826,3800,6189,6393,6190,5664,5348,3554,3594,4749,4603,6641,5385,4801,6043,5827,4183,6642,5312,5426,4761,6394,5665,6191,4715,2669,6643,6644,5533,3185,5427,5086,5930,5931,5386,6192,6044,6645,4781,4013,5745, 4282,4435,5534,4390,4267,6045,5746,4984,6046,2743,6193,3501,4087,5485,5932,5428,4184,4095,5747,4061,5054,3058,3862,5933,5600,6646,5144,3618,6395,3131,5055,5313,6396,4650,4956,3855,6194,3896,5202,4985,4029,4225,6195,6647,5828,5486,5829,3589,3002,6648,6397,4782,5276,6649,6196,6650,4105,3803,4043,5237,5830,6398,4096,3643,6399,3528,6651,4453,3315,4637,6652,3984,6197,5535,3182,3339,6653,3096,2660,6400,6654,3449,5934,4250,4236,6047,6401,5831,6655,5487,3753,4062,5832,6198,6199,6656,3766,6657,3403,4667,6048, 6658,4338,2897,5833,3880,2797,3780,4326,6659,5748,5015,6660,5387,4351,5601,4411,6661,3654,4424,5935,4339,4072,5277,4568,5536,6402,6662,5238,6663,5349,5203,6200,5204,6201,5145,4536,5016,5056,4762,5834,4399,4957,6202,6403,5666,5749,6664,4340,6665,5936,5177,5667,6666,6667,3459,4668,6404,6668,6669,4543,6203,6670,4276,6405,4480,5537,6671,4614,5205,5668,6672,3348,2193,4763,6406,6204,5937,5602,4177,5669,3419,6673,4020,6205,4443,4569,5388,3715,3639,6407,6049,4058,6206,6674,5938,4544,6050,4185,4294,4841,4651, 4615,5488,6207,6408,6051,5178,3241,3509,5835,6208,4958,5836,4341,5489,5278,6209,2823,5538,5350,5206,5429,6675,4638,4875,4073,3516,4684,4914,4860,5939,5603,5389,6052,5057,3237,5490,3791,6676,6409,6677,4821,4915,4106,5351,5058,4243,5539,4244,5604,4842,4916,5239,3028,3716,5837,5114,5605,5390,5940,5430,6210,4332,6678,5540,4732,3667,3840,6053,4305,3408,5670,5541,6410,2744,5240,5750,6679,3234,5606,6680,5607,5671,3608,4283,4159,4400,5352,4783,6681,6411,6682,4491,4802,6211,6412,5941,6413,6414,5542,5751,6683, 4669,3734,5942,6684,6415,5943,5059,3328,4670,4144,4268,6685,6686,6687,6688,4372,3603,6689,5944,5491,4373,3440,6416,5543,4784,4822,5608,3792,4616,5838,5672,3514,5391,6417,4892,6690,4639,6691,6054,5673,5839,6055,6692,6056,5392,6212,4038,5544,5674,4497,6057,6693,5840,4284,5675,4021,4545,5609,6418,4454,6419,6213,4113,4472,5314,3738,5087,5279,4074,5610,4959,4063,3179,4750,6058,6420,6214,3476,4498,4716,5431,4960,4685,6215,5241,6694,6421,6216,6695,5841,5945,6422,3748,5946,5179,3905,5752,5545,5947,4374,6217, 4455,6423,4412,6218,4803,5353,6696,3832,5280,6219,4327,4702,6220,6221,6059,4652,5432,6424,3749,4751,6425,5753,4986,5393,4917,5948,5030,5754,4861,4733,6426,4703,6697,6222,4671,5949,4546,4961,5180,6223,5031,3316,5281,6698,4862,4295,4934,5207,3644,6427,5842,5950,6428,6429,4570,5843,5282,6430,6224,5088,3239,6060,6699,5844,5755,6061,6431,2701,5546,6432,5115,5676,4039,3993,3327,4752,4425,5315,6433,3941,6434,5677,4617,4604,3074,4581,6225,5433,6435,6226,6062,4823,5756,5116,6227,3717,5678,4717,5845,6436,5679, 5846,6063,5847,6064,3977,3354,6437,3863,5117,6228,5547,5394,4499,4524,6229,4605,6230,4306,4500,6700,5951,6065,3693,5952,5089,4366,4918,6701,6231,5548,6232,6702,6438,4704,5434,6703,6704,5953,4168,6705,5680,3420,6706,5242,4407,6066,3812,5757,5090,5954,4672,4525,3481,5681,4618,5395,5354,5316,5955,6439,4962,6707,4526,6440,3465,4673,6067,6441,5682,6708,5435,5492,5758,5683,4619,4571,4674,4804,4893,4686,5493,4753,6233,6068,4269,6442,6234,5032,4705,5146,5243,5208,5848,6235,6443,4963,5033,4640,4226,6236,5849, 3387,6444,6445,4436,4437,5850,4843,5494,4785,4894,6709,4361,6710,5091,5956,3331,6237,4987,5549,6069,6711,4342,3517,4473,5317,6070,6712,6071,4706,6446,5017,5355,6713,6714,4988,5436,6447,4734,5759,6715,4735,4547,4456,4754,6448,5851,6449,6450,3547,5852,5318,6451,6452,5092,4205,6716,6238,4620,4219,5611,6239,6072,4481,5760,5957,5958,4059,6240,6453,4227,4537,6241,5761,4030,4186,5244,5209,3761,4457,4876,3337,5495,5181,6242,5959,5319,5612,5684,5853,3493,5854,6073,4169,5613,5147,4895,6074,5210,6717,5182,6718, 3830,6243,2798,3841,6075,6244,5855,5614,3604,4606,5496,5685,5118,5356,6719,6454,5960,5357,5961,6720,4145,3935,4621,5119,5962,4261,6721,6455,4786,5963,4375,4582,6245,6246,6247,6076,5437,4877,5856,3376,4380,6248,4160,6722,5148,6456,5211,6457,6723,4718,6458,6724,6249,5358,4044,3297,6459,6250,5857,5615,5497,5245,6460,5498,6725,6251,6252,5550,3793,5499,2959,5396,6461,6462,4572,5093,5500,5964,3806,4146,6463,4426,5762,5858,6077,6253,4755,3967,4220,5965,6254,4989,5501,6464,4352,6726,6078,4764,2290,5246,3906, 5438,5283,3767,4964,2861,5763,5094,6255,6256,4622,5616,5859,5860,4707,6727,4285,4708,4824,5617,6257,5551,4787,5212,4965,4935,4687,6465,6728,6466,5686,6079,3494,4413,2995,5247,5966,5618,6729,5967,5764,5765,5687,5502,6730,6731,6080,5397,6467,4990,6258,6732,4538,5060,5619,6733,4719,5688,5439,5018,5149,5284,5503,6734,6081,4607,6259,5120,3645,5861,4583,6260,4584,4675,5620,4098,5440,6261,4863,2379,3306,4585,5552,5689,4586,5285,6735,4864,6736,5286,6082,6737,4623,3010,4788,4381,4558,5621,4587,4896,3698,3161, 5248,4353,4045,6262,3754,5183,4588,6738,6263,6739,6740,5622,3936,6741,6468,6742,6264,5095,6469,4991,5968,6743,4992,6744,6083,4897,6745,4256,5766,4307,3108,3968,4444,5287,3889,4343,6084,4510,6085,4559,6086,4898,5969,6746,5623,5061,4919,5249,5250,5504,5441,6265,5320,4878,3242,5862,5251,3428,6087,6747,4237,5624,5442,6266,5553,4539,6748,2585,3533,5398,4262,6088,5150,4736,4438,6089,6267,5505,4966,6749,6268,6750,6269,5288,5554,3650,6090,6091,4624,6092,5690,6751,5863,4270,5691,4277,5555,5864,6752,5692,4720, 4865,6470,5151,4688,4825,6753,3094,6754,6471,3235,4653,6755,5213,5399,6756,3201,4589,5865,4967,6472,5866,6473,5019,3016,6757,5321,4756,3957,4573,6093,4993,5767,4721,6474,6758,5625,6759,4458,6475,6270,6760,5556,4994,5214,5252,6271,3875,5768,6094,5034,5506,4376,5769,6761,2120,6476,5253,5770,6762,5771,5970,3990,5971,5557,5558,5772,6477,6095,2787,4641,5972,5121,6096,6097,6272,6763,3703,5867,5507,6273,4206,6274,4789,6098,6764,3619,3646,3833,3804,2394,3788,4936,3978,4866,4899,6099,6100,5559,6478,6765,3599, 5868,6101,5869,5870,6275,6766,4527,6767]},{}],17:[function(a,d,b){function c(){f.apply(this);this.getCharsetName=function(){return"GB2312"};this._mCodingSM=new g(e);this._mDistributionAnalyzer=new m;this.reset()}var f=a("./mbcharsetprober"),g=a("./codingstatemachine"),e=a("./mbcssm/gb2312"),m=a("./chardistribution").GB2312DistributionAnalysis;c.prototype=new f;d.exports=c},{"./chardistribution":4,"./codingstatemachine":7,"./mbcharsetprober":30,"./mbcssm/gb2312":36}],18:[function(a,d,b){function c(){f.apply(this); this.reset=function(){this._mFinalCharVisualScore=this._mFinalCharLogicalScore=0;this._mBeforePrev=this._mPrev=" "};this.setModelProbers=function(a,b){this._mLogicalProber=a;this._mVisualProber=b};this.isFinal=function(a){return-1!=["\u00ea","\u00ed","\u00ef","\u00f3","\u00f5"].indexOf(a)};this.isNonFinal=function(a){return-1!=["\u00eb","\u00ee","\u00f0","\u00f4"].indexOf(a)};this.feed=function(a){if(this.getState()==g.notMe)return g.notMe;a=this.filterHighBitOnly(a);for(var b=0,c;b=a)return"ISO-8859-8";var b=this._mLogicalProber.getConfidence()- this._mVisualProber.getConfidence();return.01b||0>a?"ISO-8859-8":"windows-1255"};this.getState=function(){return this._mLogicalProber.getState()==g.notMe&&this._mVisualProber.getState()==g.notMe?g.notMe:g.detecting};this._mVisualProber=this._mLogicalProber=null;this.reset()}var f=a("./charsetprober"),g=a("./constants");Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){var c=this.length>>>0,h=Number(b)||0,h=0>h?Math.ceil(h):Math.floor(h);for(0>h&&(h+=c);ha;this._mRelSample[a++]=0);this._mNeedToSkipCharNum=0;this._mLastCharOrder=-1;this._mDone=!1};this.feed=function(a,c){if(!this._mDone)for(var d=this._mNeedToSkipCharNum;dc)this._mNeedToSkipCharNum=d-c,this._mLastCharOrder=-1;else{if(-1!=l&&-1!=this._mLastCharOrder){this._mTotalRel+= 1;if(1E3=a.charCodeAt(0)||224<=a.charCodeAt(0)&&252>=a.charCodeAt(0)? 2:1;return 1=a.charCodeAt(0)?[a.charCodeAt(1)-159,b]:[-1,b]}}function g(){this.getOrder=function(a){if(!a)return[-1,1];var b=142<=a.charCodeAt(0)||161<=a.charCodeAt(0)&&254>=a.charCodeAt(0)?2:143==a.charCodeAt(0)?3:1;return 1=a.charCodeAt(1)?[a.charCodeAt(1)-161,b]:[-1,b]}}b.jp2CharContext=[[0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1],[2,4,0,4,0,3,0,4,0,3,4,4,4,2,4,3,3,4,3,2,3,3,4,2,3,3,3,2,4,1,4,3,3,1,5,4,3,4,3,4,3,5,3,0,3,5,4,2,0,3,1,0,3,3,0,3,3,0,1,1,0,4,3,0,3,3,0,4,0,2,0,3,5,5,5,5,4,0,4,1,0,3,4],[0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2],[0,4,0,5,0,5,0,4,0,4,5,4,4,3,5,3,5,1,5,3,4,3,4,4,3,4,3,3,4,3,5,4,4,3,5,5,3,5,5,5,3,5,5,3, 4,5,5,3,1,3,2,0,3,4,0,4,2,0,4,2,1,5,3,2,3,5,0,4,0,2,0,5,4,4,5,4,5,0,4,0,0,4,4],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,3,0,4,0,3,0,3,0,4,5,4,3,3,3,3,4,3,5,4,4,3,5,4,4,3,4,3,4,4,4,4,5,3,4,4,3,4,5,5,4,5,5,1,4,5,4,3,0,3,3,1,3,3,0,4,4,0,3,3,1,5,3,3,3,5,0,4,0,3,0,4,4,3,4,3,3,0,4,1,1,3,4],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,4,0,3,0,3,0,4,0,3,4,4,3,2,2,1,2,1,3,1,3,3,3,3,3,4,3,1,3,3,5,3,3,0,4,3,0,5,4,3,3,5,4,4,3,4,4,5,0,1,2,0,1,2,0,2,2,0,1,0,0,5,2,2,1,4,0,3,0,1,0,4,4,3,5,4,3,0,2,1,0,4,3],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,3,0,5,0,4,0,2,1,4,4,2,4,1,4,2,4,2,4,3,3,3,4,3,3,3,3,1,4,2,3,3,3,1,4,4,1,1,1,4,3,3, 2,0,2,4,3,2,0,3,3,0,3,1,1,0,0,0,3,3,0,4,2,2,3,4,0,4,0,3,0,4,4,5,3,4,4,0,3,0,0,1,4],[1,4,0,4,0,4,0,4,0,3,5,4,4,3,4,3,5,4,3,3,4,3,5,4,4,4,4,3,4,2,4,3,3,1,5,4,3,2,4,5,4,5,5,4,4,5,4,4,0,3,2,2,3,3,0,4,3,1,3,2,1,4,3,3,4,5,0,3,0,2,0,4,5,5,4,5,4,0,4,0,0,5,4],[0,5,0,5,0,4,0,3,0,4,4,3,4,3,3,3,4,0,4,4,4,3,4,3,4,3,3,1,4,2,4,3,4,0,5,4,1,4,5,4,4,5,3,2,4,3,4,3,2,4,1,3,3,3,2,3,2,0,4,3,3,4,3,3,3,4,0,4,0,3,0,4,5,4,4,4,3,0,4,1,0,1,3],[0,3,1,4,0,3,0,2,0,3,4,4,3,1,4,2,3,3,4,3,4,3,4,3,4,4,3,2,3,1,5,4,4,1,4,4,3,5,4,4,3, 5,5,4,3,4,4,3,1,2,3,1,2,2,0,3,2,0,3,1,0,5,3,3,3,4,3,3,3,3,4,4,4,4,5,4,2,0,3,3,2,4,3],[0,2,0,3,0,1,0,1,0,0,3,2,0,0,2,0,1,0,2,1,3,3,3,1,2,3,1,0,1,0,4,2,1,1,3,3,0,4,3,3,1,4,3,3,0,3,3,2,0,0,0,0,1,0,0,2,0,0,0,0,0,4,1,0,2,3,2,2,2,1,3,3,3,4,4,3,2,0,3,1,0,3,3],[0,4,0,4,0,3,0,3,0,4,4,4,3,3,3,3,3,3,4,3,4,2,4,3,4,3,3,2,4,3,4,5,4,1,4,5,3,5,4,5,3,5,4,0,3,5,5,3,1,3,3,2,2,3,0,3,4,1,3,3,2,4,3,3,3,4,0,4,0,3,0,4,5,4,4,5,3,0,4,1,0,3,4],[0,2,0,3,0,3,0,0,0,2,2,2,1,0,1,0,0,0,3,0,3,0,3,0,1,3,1,0,3,1,3,3,3,1,3,3,3,0,1,3, 1,3,4,0,0,3,1,1,0,3,2,0,0,0,0,1,3,0,1,0,0,3,3,2,0,3,0,0,0,0,0,3,4,3,4,3,3,0,3,0,0,2,3],[2,3,0,3,0,2,0,1,0,3,3,4,3,1,3,1,1,1,3,1,4,3,4,3,3,3,0,0,3,1,5,4,3,1,4,3,2,5,5,4,4,4,4,3,3,4,4,4,0,2,1,1,3,2,0,1,2,0,0,1,0,4,1,3,3,3,0,3,0,1,0,4,4,4,5,5,3,0,2,0,0,4,4],[0,2,0,1,0,3,1,3,0,2,3,3,3,0,3,1,0,0,3,0,3,2,3,1,3,2,1,1,0,0,4,2,1,0,2,3,1,4,3,2,0,4,4,3,1,3,1,3,0,1,0,0,1,0,0,0,1,0,0,0,0,4,1,1,1,2,0,3,0,0,0,3,4,2,4,3,2,0,1,0,0,3,3],[0,1,0,4,0,5,0,4,0,2,4,4,2,3,3,2,3,3,5,3,3,3,4,3,4,2,3,0,4,3,3,3,4,1,4,3,2,1,5, 5,3,4,5,1,3,5,4,2,0,3,3,0,1,3,0,4,2,0,1,3,1,4,3,3,3,3,0,3,0,1,0,3,4,4,4,5,5,0,3,0,1,4,5],[0,2,0,3,0,3,0,0,0,2,3,1,3,0,4,0,1,1,3,0,3,4,3,2,3,1,0,3,3,2,3,1,3,0,2,3,0,2,1,4,1,2,2,0,0,3,3,0,0,2,0,0,0,1,0,0,0,0,2,2,0,3,2,1,3,3,0,2,0,2,0,0,3,3,1,2,4,0,3,0,2,2,3],[2,4,0,5,0,4,0,4,0,2,4,4,4,3,4,3,3,3,1,2,4,3,4,3,4,4,5,0,3,3,3,3,2,0,4,3,1,4,3,4,1,4,4,3,3,4,4,3,1,2,3,0,4,2,0,4,1,0,3,3,0,4,3,3,3,4,0,4,0,2,0,3,5,3,4,5,2,0,3,0,0,4,5],[0,3,0,4,0,1,0,1,0,1,3,2,2,1,3,0,3,0,2,0,2,0,3,0,2,0,0,0,1,0,1,1,0,0,3,1,0,0, 0,4,0,3,1,0,2,1,3,0,0,0,0,0,0,3,0,0,0,0,0,0,0,4,2,2,3,1,0,3,0,0,0,1,4,4,4,3,0,0,4,0,0,1,4],[1,4,1,5,0,3,0,3,0,4,5,4,4,3,5,3,3,4,4,3,4,1,3,3,3,3,2,1,4,1,5,4,3,1,4,4,3,5,4,4,3,5,4,3,3,4,4,4,0,3,3,1,2,3,0,3,1,0,3,3,0,5,4,4,4,4,4,4,3,3,5,4,4,3,3,5,4,0,3,2,0,4,4],[0,2,0,3,0,1,0,0,0,1,3,3,3,2,4,1,3,0,3,1,3,0,2,2,1,1,0,0,2,0,4,3,1,0,4,3,0,4,4,4,1,4,3,1,1,3,3,1,0,2,0,0,1,3,0,0,0,0,2,0,0,4,3,2,4,3,5,4,3,3,3,4,3,3,4,3,3,0,2,1,0,3,3],[0,2,0,4,0,3,0,2,0,2,5,5,3,4,4,4,4,1,4,3,3,0,4,3,4,3,1,3,3,2,4,3,0,3,4,3,0, 3,4,4,2,4,4,0,4,5,3,3,2,2,1,1,1,2,0,1,5,0,3,3,2,4,3,3,3,4,0,3,0,2,0,4,4,3,5,5,0,0,3,0,2,3,3],[0,3,0,4,0,3,0,1,0,3,4,3,3,1,3,3,3,0,3,1,3,0,4,3,3,1,1,0,3,0,3,3,0,0,4,4,0,1,5,4,3,3,5,0,3,3,4,3,0,2,0,1,1,1,0,1,3,0,1,2,1,3,3,2,3,3,0,3,0,1,0,1,3,3,4,4,1,0,1,2,2,1,3],[0,1,0,4,0,4,0,3,0,1,3,3,3,2,3,1,1,0,3,0,3,3,4,3,2,4,2,0,1,0,4,3,2,0,4,3,0,5,3,3,2,4,4,4,3,3,3,4,0,1,3,0,0,1,0,0,1,0,0,0,0,4,2,3,3,3,0,3,0,0,0,4,4,4,5,3,2,0,3,3,0,3,5],[0,2,0,3,0,0,0,3,0,1,3,0,2,0,0,0,1,0,3,1,1,3,3,0,0,3,0,0,3,0,2,3,1,0,3,1, 0,3,3,2,0,4,2,2,0,2,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,1,2,0,1,0,1,0,0,0,1,3,1,2,0,0,0,1,0,0,1,4],[0,3,0,3,0,5,0,1,0,2,4,3,1,3,3,2,1,1,5,2,1,0,5,1,2,0,0,0,3,3,2,2,3,2,4,3,0,0,3,3,1,3,3,0,2,5,3,4,0,3,3,0,1,2,0,2,2,0,3,2,0,2,2,3,3,3,0,2,0,1,0,3,4,4,2,5,4,0,3,0,0,3,5],[0,3,0,3,0,3,0,1,0,3,3,3,3,0,3,0,2,0,2,1,1,0,2,0,1,0,0,0,2,1,0,0,1,0,3,2,0,0,3,3,1,2,3,1,0,3,3,0,0,1,0,0,0,0,0,2,0,0,0,0,0,2,3,1,2,3,0,3,0,1,0,3,2,1,0,4,3,0,1,1,0,3,3],[0,4,0,5,0,3,0,3,0,4,5,5,4,3,5,3,4,3,5,3,3,2,5,3,4,4,4,3,4,3,4,5,5,3,4, 4,3,4,4,5,4,4,4,3,4,5,5,4,2,3,4,2,3,4,0,3,3,1,4,3,2,4,3,3,5,5,0,3,0,3,0,5,5,5,5,4,4,0,4,0,1,4,4],[0,4,0,4,0,3,0,3,0,3,5,4,4,2,3,2,5,1,3,2,5,1,4,2,3,2,3,3,4,3,3,3,3,2,5,4,1,3,3,5,3,4,4,0,4,4,3,1,1,3,1,0,2,3,0,2,3,0,3,0,0,4,3,1,3,4,0,3,0,2,0,4,4,4,3,4,5,0,4,0,0,3,4],[0,3,0,3,0,3,1,2,0,3,4,4,3,3,3,0,2,2,4,3,3,1,3,3,3,1,1,0,3,1,4,3,2,3,4,4,2,4,4,4,3,4,4,3,2,4,4,3,1,3,3,1,3,3,0,4,1,0,2,2,1,4,3,2,3,3,5,4,3,3,5,4,4,3,3,0,4,0,3,2,2,4,4],[0,2,0,1,0,0,0,0,0,1,2,1,3,0,0,0,0,0,2,0,1,2,1,0,0,1,0,0,0,0,3,0,0,1, 0,1,1,3,1,0,0,0,1,1,0,1,1,0,0,0,0,0,2,0,0,0,0,0,0,0,0,1,1,2,2,0,3,4,0,0,0,1,1,0,0,1,0,0,0,0,0,1,1],[0,1,0,0,0,1,0,0,0,0,4,0,4,1,4,0,3,0,4,0,3,0,4,0,3,0,3,0,4,1,5,1,4,0,0,3,0,5,0,5,2,0,1,0,0,0,2,1,4,0,1,3,0,0,3,0,0,3,1,1,4,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0],[1,4,0,5,0,3,0,2,0,3,5,4,4,3,4,3,5,3,4,3,3,0,4,3,3,3,3,3,3,2,4,4,3,1,3,4,4,5,4,4,3,4,4,1,3,5,4,3,3,3,1,2,2,3,3,1,3,1,3,3,3,5,3,3,4,5,0,3,0,3,0,3,4,3,4,4,3,0,3,0,2,4,3],[0,1,0,4,0,0,0,0,0,1,4,0,4,1,4,2,4,0,3,0,1,0,1,0,0,0,0,0,2,0,3,1,1, 1,0,3,0,0,0,1,2,1,0,0,1,1,1,1,0,1,0,0,0,1,0,0,3,0,0,0,0,3,2,0,2,2,0,1,0,0,0,2,3,2,3,3,0,0,0,0,2,1,0],[0,5,1,5,0,3,0,3,0,5,4,4,5,1,5,3,3,0,4,3,4,3,5,3,4,3,3,2,4,3,4,3,3,0,3,3,1,4,4,3,4,4,4,3,4,5,5,3,2,3,1,1,3,3,1,3,1,1,3,3,2,4,5,3,3,5,0,4,0,3,0,4,4,3,5,3,3,0,3,4,0,4,3],[0,5,0,5,0,3,0,2,0,4,4,3,5,2,4,3,3,3,4,4,4,3,5,3,5,3,3,1,4,0,4,3,3,0,3,3,0,4,4,4,4,5,4,3,3,5,5,3,2,3,1,2,3,2,0,1,0,0,3,2,2,4,4,3,1,5,0,4,0,3,0,4,3,1,3,2,1,0,3,3,0,3,3],[0,4,0,5,0,5,0,4,0,4,5,5,5,3,4,3,3,2,5,4,4,3,5,3,5,3,4,0,4,3,4,4, 3,2,4,4,3,4,5,4,4,5,5,0,3,5,5,4,1,3,3,2,3,3,1,3,1,0,4,3,1,4,4,3,4,5,0,4,0,2,0,4,3,4,4,3,3,0,4,0,0,5,5],[0,4,0,4,0,5,0,1,1,3,3,4,4,3,4,1,3,0,5,1,3,0,3,1,3,1,1,0,3,0,3,3,4,0,4,3,0,4,4,4,3,4,4,0,3,5,4,1,0,3,0,0,2,3,0,3,1,0,3,1,0,3,2,1,3,5,0,3,0,1,0,3,2,3,3,4,4,0,2,2,0,4,4],[2,4,0,5,0,4,0,3,0,4,5,5,4,3,5,3,5,3,5,3,5,2,5,3,4,3,3,4,3,4,5,3,2,1,5,4,3,2,3,4,5,3,4,1,2,5,4,3,0,3,3,0,3,2,0,2,3,0,4,1,0,3,4,3,3,5,0,3,0,1,0,4,5,5,5,4,3,0,4,2,0,3,5],[0,5,0,4,0,4,0,2,0,5,4,3,4,3,4,3,3,3,4,3,4,2,5,3,5,3,4,1,4,3,4, 4,4,0,3,5,0,4,4,4,4,5,3,1,3,4,5,3,3,3,3,3,3,3,0,2,2,0,3,3,2,4,3,3,3,5,3,4,1,3,3,5,3,2,0,0,0,0,4,3,1,3,3],[0,1,0,3,0,3,0,1,0,1,3,3,3,2,3,3,3,0,3,0,0,0,3,1,3,0,0,0,2,2,2,3,0,0,3,2,0,1,2,4,1,3,3,0,0,3,3,3,0,1,0,0,2,1,0,0,3,0,3,1,0,3,0,0,1,3,0,2,0,1,0,3,3,1,3,3,0,0,1,1,0,3,3],[0,2,0,3,0,2,1,4,0,2,2,3,1,1,3,1,1,0,2,0,3,1,2,3,1,3,0,0,1,0,4,3,2,3,3,3,1,4,2,3,3,3,3,1,0,3,1,4,0,1,1,0,1,2,0,1,1,0,1,1,0,3,1,3,2,2,0,1,0,0,0,2,3,3,3,1,0,0,0,0,0,2,3],[0,5,0,4,0,5,0,2,0,4,5,5,3,3,4,3,3,1,5,4,4,2,4,4,4,3,4,2,4,3, 5,5,4,3,3,4,3,3,5,5,4,5,5,1,3,4,5,3,1,4,3,1,3,3,0,3,3,1,4,3,1,4,5,3,3,5,0,4,0,3,0,5,3,3,1,4,3,0,4,0,1,5,3],[0,5,0,5,0,4,0,2,0,4,4,3,4,3,3,3,3,3,5,4,4,4,4,4,4,5,3,3,5,2,4,4,4,3,4,4,3,3,4,4,5,5,3,3,4,3,4,3,3,4,3,3,3,3,1,2,2,1,4,3,3,5,4,4,3,4,0,4,0,3,0,4,4,4,4,4,1,0,4,2,0,2,4],[0,4,0,4,0,3,0,1,0,3,5,2,3,0,3,0,2,1,4,2,3,3,4,1,4,3,3,2,4,1,3,3,3,0,3,3,0,0,3,3,3,5,3,3,3,3,3,2,0,2,0,0,2,0,0,2,0,0,1,0,0,3,1,2,2,3,0,3,0,2,0,4,4,3,3,4,1,0,3,0,0,2,4],[0,0,0,4,0,0,0,0,0,0,1,0,1,0,2,0,0,0,0,0,1,0,2,0,1,0,0,0,0, 0,3,1,3,0,3,2,0,0,0,1,0,3,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,4,0,2,0,0,0,0,0,0,2],[0,2,1,3,0,2,0,2,0,3,3,3,3,1,3,1,3,3,3,3,3,3,4,2,2,1,2,1,4,0,4,3,1,3,3,3,2,4,3,5,4,3,3,3,3,3,3,3,0,1,3,0,2,0,0,1,0,0,1,0,0,4,2,0,2,3,0,3,3,0,3,3,4,2,3,1,4,0,1,2,0,2,3],[0,3,0,3,0,1,0,3,0,2,3,3,3,0,3,1,2,0,3,3,2,3,3,2,3,2,3,1,3,0,4,3,2,0,3,3,1,4,3,3,2,3,4,3,1,3,3,1,1,0,1,1,0,1,0,1,0,1,0,0,0,4,1,1,0,3,0,3,1,0,2,3,3,3,3,3,1,0,0,2,0,3,3],[0,0,0,0,0,0,0,0,0,0,3,0,2,0,3,0,0,0,0,0,0,0,3,0,0,0,0,0, 0,0,3,0,3,0,3,1,0,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,2,0,2,3,0,0,0,0,0,0,0,0,3],[0,2,0,3,1,3,0,3,0,2,3,3,3,1,3,1,3,1,3,1,3,3,3,1,3,0,2,3,1,1,4,3,3,2,3,3,1,2,2,4,1,3,3,0,1,4,2,3,0,1,3,0,3,0,0,1,3,0,2,0,0,3,3,2,1,3,0,3,0,2,0,3,4,4,4,3,1,0,3,0,0,3,3],[0,2,0,1,0,2,0,0,0,1,3,2,2,1,3,0,1,1,3,0,3,2,3,1,2,0,2,0,1,1,3,3,3,0,3,3,1,1,2,3,2,3,3,1,2,3,2,0,0,1,0,0,0,0,0,0,3,0,1,0,0,2,1,2,1,3,0,3,0,0,0,3,4,4,4,3,2,0,2,0,0,2,4],[0,0,0,1,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,1,1,0,0, 0,0,0,0,0,0,0,2,2,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,3,1,0,0,0,0,0,0,0,3],[0,3,0,3,0,2,0,3,0,3,3,3,2,3,2,2,2,0,3,1,3,3,3,2,3,3,0,0,3,0,3,2,2,0,2,3,1,4,3,4,3,3,2,3,1,5,4,4,0,3,1,2,1,3,0,3,1,1,2,0,2,3,1,3,1,3,0,3,0,1,0,3,3,4,4,2,1,0,2,1,0,2,4],[0,1,0,3,0,1,0,2,0,1,4,2,5,1,4,0,2,0,2,1,3,1,4,0,2,1,0,0,2,1,4,1,1,0,3,3,0,5,1,3,2,3,3,1,0,3,2,3,0,1,0,0,0,0,0,0,1,0,0,0,0,4,0,1,0,3,0,2,0,1,0,3,3,3,4,3,3,0,0,0,0,2,3],[0,0,0,1,0,0,0,0,0,0,2,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 0,0,0,0,3,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,0,0,1,0,0,0,0,0,3],[0,1,0,3,0,4,0,3,0,2,4,3,1,0,3,2,2,1,3,1,2,2,3,1,1,1,2,1,3,0,1,2,0,1,3,2,1,3,0,5,5,1,0,0,1,3,2,1,0,3,0,0,1,0,0,0,0,0,3,4,0,1,1,1,3,2,0,2,0,1,0,2,3,3,1,2,3,0,1,0,1,0,4],[0,0,0,1,0,3,0,3,0,2,2,1,0,0,4,0,3,0,3,1,3,0,3,0,3,0,1,0,3,0,3,1,3,0,3,3,0,0,1,2,1,1,1,0,1,2,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,2,2,1,2,0,0,2,0,0,0,0,2,3,3,3,3,0,0,0,0,1,4],[0,0,0,3,0,3,0,0,0,0,3,1,1,0,3,0,1,0,2,0,1,0,0,0,0, 0,0,0,1,0,3,0,2,0,2,3,0,0,2,2,3,1,2,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,2,0,0,0,0,2,3],[2,4,0,5,0,5,0,4,0,3,4,3,3,3,4,3,3,3,4,3,4,4,5,4,5,5,5,2,3,0,5,5,4,1,5,4,3,1,5,4,3,4,4,3,3,4,3,3,0,3,2,0,2,3,0,3,0,0,3,3,0,5,3,2,3,3,0,3,0,3,0,3,4,5,4,5,3,0,4,3,0,3,4],[0,3,0,3,0,3,0,3,0,3,3,4,3,2,3,2,3,0,4,3,3,3,3,3,3,3,3,0,3,2,4,3,3,1,3,4,3,4,4,4,3,4,4,3,2,4,4,1,0,2,0,0,1,1,0,2,0,0,3,1,0,5,3,2,1,3,0,3,0,1,2,4,3,2,4,3,3,0,3,2,0,4,4],[0,3,0,3,0,1,0,0,0,1,4,3,3,2,3,1,3,1,4,2,3,2,4,2, 3,4,3,0,2,2,3,3,3,0,3,3,3,0,3,4,1,3,3,0,3,4,3,3,0,1,1,0,1,0,0,0,4,0,3,0,0,3,1,2,1,3,0,4,0,1,0,4,3,3,4,3,3,0,2,0,0,3,3],[0,3,0,4,0,1,0,3,0,3,4,3,3,0,3,3,3,1,3,1,3,3,4,3,3,3,0,0,3,1,5,3,3,1,3,3,2,5,4,3,3,4,5,3,2,5,3,4,0,1,0,0,0,0,0,2,0,0,1,1,0,4,2,2,1,3,0,3,0,2,0,4,4,3,5,3,2,0,1,1,0,3,4],[0,5,0,4,0,5,0,2,0,4,4,3,3,2,3,3,3,1,4,3,4,1,5,3,4,3,4,0,4,2,4,3,4,1,5,4,0,4,4,4,4,5,4,1,3,5,4,2,1,4,1,1,3,2,0,3,1,0,3,2,1,4,3,3,3,4,0,4,0,3,0,4,4,4,3,3,3,0,4,2,0,3,4],[1,4,0,4,0,3,0,1,0,3,3,3,1,1,3,3,2,2,3,3,1,0,3, 2,2,1,2,0,3,1,2,1,2,0,3,2,0,2,2,3,3,4,3,0,3,3,1,2,0,1,1,3,1,2,0,0,3,0,1,1,0,3,2,2,3,3,0,3,0,0,0,2,3,3,4,3,3,0,1,0,0,1,4],[0,4,0,4,0,4,0,0,0,3,4,4,3,1,4,2,3,2,3,3,3,1,4,3,4,0,3,0,4,2,3,3,2,2,5,4,2,1,3,4,3,4,3,1,3,3,4,2,0,2,1,0,3,3,0,0,2,0,3,1,0,4,4,3,4,3,0,4,0,1,0,2,4,4,4,4,4,0,3,2,0,3,3],[0,0,0,1,0,4,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,3,2,0,0,1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,2],[0,2,0,3,0,4,0,4,0,1,3,3,3,0,4,0,2,1,2,1,1,1, 2,0,3,1,1,0,1,0,3,1,0,0,3,3,2,0,1,1,0,0,0,0,0,1,0,2,0,2,2,0,3,1,0,0,1,0,1,1,0,1,2,0,3,0,0,0,0,1,0,0,3,3,4,3,1,0,1,0,3,0,2],[0,0,0,3,0,5,0,0,0,0,1,0,2,0,3,1,0,1,3,0,0,0,2,0,0,0,1,0,0,0,1,1,0,0,4,0,0,0,2,3,0,1,4,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,1,0,0,0,0,0,0,0,2,0,0,3,0,0,0,0,0,3],[0,2,0,5,0,5,0,1,0,2,4,3,3,2,5,1,3,2,3,3,3,0,4,1,2,0,3,0,4,0,2,2,1,1,5,3,0,0,1,4,2,3,2,0,3,3,3,2,0,2,4,1,1,2,0,1,1,0,3,1,0,1,3,1,2,3,0,2,0,0,0,1,3,5,4,4,4,0,3,0,0,1,3],[0,4,0,5,0,4,0,4,0,4,5,4,3,3,4,3,3,3,4,3,4, 4,5,3,4,5,4,2,4,2,3,4,3,1,4,4,1,3,5,4,4,5,5,4,4,5,5,5,2,3,3,1,4,3,1,3,3,0,3,3,1,4,3,4,4,4,0,3,0,4,0,3,3,4,4,5,0,0,4,3,0,4,5],[0,4,0,4,0,3,0,3,0,3,4,4,4,3,3,2,4,3,4,3,4,3,5,3,4,3,2,1,4,2,4,4,3,1,3,4,2,4,5,5,3,4,5,4,1,5,4,3,0,3,2,2,3,2,1,3,1,0,3,3,3,5,3,3,3,5,4,4,2,3,3,4,3,3,3,2,1,0,3,2,1,4,3],[0,4,0,5,0,4,0,3,0,3,5,5,3,2,4,3,4,0,5,4,4,1,4,4,4,3,3,3,4,3,5,5,2,3,3,4,1,2,5,5,3,5,5,2,3,5,5,4,0,3,2,0,3,3,1,1,5,1,4,1,0,4,3,2,3,5,0,4,0,3,0,5,4,3,4,3,0,0,4,1,0,4,4],[1,3,0,4,0,2,0,2,0,2,5,5,3,3,3,3,3,0,4,2, 3,4,4,4,3,4,0,0,3,4,5,4,3,3,3,3,2,5,5,4,5,5,5,4,3,5,5,5,1,3,1,0,1,0,0,3,2,0,4,2,0,5,2,3,2,4,1,3,0,3,0,4,5,4,5,4,3,0,4,2,0,5,4],[0,3,0,4,0,5,0,3,0,3,4,4,3,2,3,2,3,3,3,3,3,2,4,3,3,2,2,0,3,3,3,3,3,1,3,3,3,0,4,4,3,4,4,1,1,4,4,2,0,3,1,0,1,1,0,4,1,0,2,3,1,3,3,1,3,4,0,3,0,1,0,3,1,3,0,0,1,0,2,0,0,4,4],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,3,0,3,0,2,0,3,0,1,5,4,3,3,3,1,4,2,1, 2,3,4,4,2,4,4,5,0,3,1,4,3,4,0,4,3,3,3,2,3,2,5,3,4,3,2,2,3,0,0,3,0,2,1,0,1,2,0,0,0,0,2,1,1,3,1,0,2,0,4,0,3,4,4,4,5,2,0,2,0,0,1,3],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,0,0,1,1,0,0,0,4,2,1,1,0,1,0,3,2,0,0,3,1,1,1,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,1,0,0,0,2,0,0,0,1,4,0,4,2,1,0,0,0,0,0,1],[0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,1,0,1,0,0,0,0,3,1,0,0,0,2,0,2,1,0,0,1,2,1,0,1,1,0,0,3,0,0,0,0,0,0,0,0,0,0,0,1,3,1,0,0,0,0,0,1,0,0,2,1,0,0,0,0,0,0,0,0,2],[0,4,0,4,0,4,0,3,0,4,4,3,4,2,4,3,2,0, 4,4,4,3,5,3,5,3,3,2,4,2,4,3,4,3,1,4,0,2,3,4,4,4,3,3,3,4,4,4,3,4,1,3,4,3,2,1,2,1,3,3,3,4,4,3,3,5,0,4,0,3,0,4,3,3,3,2,1,0,3,0,0,3,3],[0,4,0,3,0,3,0,3,0,3,5,5,3,3,3,3,4,3,4,3,3,3,4,4,4,3,3,3,3,4,3,5,3,3,1,3,2,4,5,5,5,5,4,3,4,5,5,3,2,2,3,3,3,3,2,3,3,1,2,3,2,4,3,3,3,4,0,4,0,2,0,4,3,2,2,1,2,0,3,0,0,4,1]];f.prototype=new c;b.SJISContextAnalysis=f;g.prototype=new c;b.EUCJPContextAnalysis=g},{}],22:[function(a,d,b){b.Latin5_BulgarianCharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,77,90,99,100,72,109,107,101,79,185,81,102,76,94,82,110,186,108,91,74,119,84,96,111,187,115,253,253,253,253,253,253,65,69,70,66,63,68,112,103,92,194,104,95,86,87,71,116,195,85,93,97,113,196,197,198,199,200,253,253,253,253,253,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212, 213,214,215,216,217,218,219,220,221,222,223,224,225,81,226,227,228,229,230,105,231,232,233,234,235,236,45,237,238,31,32,35,43,37,44,55,47,40,59,33,46,38,36,41,30,39,28,34,51,48,49,53,50,54,57,61,239,67,240,60,56,1,18,9,20,11,3,23,15,2,26,12,10,14,6,4,13,7,8,5,19,29,25,22,21,27,24,17,75,52,241,42,16,62,242,243,244,58,245,98,246,247,248,249,250,251,91,252,253];b.win1251BulgarianCharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,77,90,99,100,72,109,107,101,79,185,81,102,76,94,82,110,186,108,91,74,119,84,96,111,187,115,253,253,253,253,253,253,65,69,70,66,63,68,112,103,92,194,104,95,86,87,71,116,195,85,93,97,113,196,197,198,199,200,253,253,253,253,253,206,207,208,209,210,211,212,213,120,214,215,216,217,218,219,220,221,78,64,83,121,98,117,105,222,223,224,225,226,227,228,229, 88,230,231,232,233,122,89,106,234,235,236,237,238,45,239,240,73,80,118,114,241,242,243,244,245,62,58,246,247,248,249,250,31,32,35,43,37,44,55,47,40,59,33,46,38,36,41,30,39,28,34,51,48,49,53,50,54,57,61,251,67,252,60,56,1,18,9,20,11,3,23,15,2,26,12,10,14,6,4,13,7,8,5,19,29,25,22,21,27,24,17,75,52,253,42,16];b.BulgarianLangModel=[0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,3,2,2,3,2,2,1,2,2,3,1,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,3,3, 3,3,3,3,3,3,0,3,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,2,3,3,3,3,3,3,3,3,0,3,1,0,0,1,0,0,0,0,0,0,0,0,1,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,1,3,2,3,3,3,3,3,3,3,3,0,3,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,2,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,1,3,2,3,3,3,3,3,3,3,3,0,3,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3,2,3,2,2,1,3, 3,3,3,2,2,2,1,1,2,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,3,3,2,3,2,2,3,3,1,1,2,3,3,2,3,3,3,3,2,1,2,0,2,0,3,0,0,0,0,0,0,0,0,0,1,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,3,3,1,3,3,3,3,3,2,3,2,3,3,3,3,3,2,3,3,1,3,0,3,0,2,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,3,3,3,1,3,3,2,3,3,3,1,3,3,2,3,2,2,2,0,0,2,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,3,3,3,3,0,3,3, 3,2,2,3,3,3,1,2,2,3,2,1,1,2,0,2,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,0,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,3,3,2,3,3,1,2,3,2,2,2,3,3,3,3,3,2,2,3,1,2,0,2,1,2,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,1,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,1,3,3,3,3,3,2,3,3,3,2,3,3,2,3,2,2,2,3,1,2,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,3,3,3,3,3,3,1,1,1,2,2,1,3,1,3,2,2,3,0,0,1,0,1,0,1,0,0,0,0,0,1,0,0,0,0,1,0,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,2,2, 3,2,2,3,1,2,1,1,1,2,3,1,3,1,2,2,0,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,1,3,2,2,3,3,1,2,3,1,1,3,3,3,3,1,2,2,1,1,1,0,2,0,2,0,1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,2,2,3,3,3,2,2,1,1,2,0,2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,3,0,1,2,1,3,3,2,3,3,3,3,3,2,3,2,1,0,3,1,2,1,2,1,2,3,2,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1, 1,2,3,3,3,3,3,3,3,3,3,3,3,3,0,0,3,1,3,3,2,3,3,2,2,2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,3,3,3,0,3,3,3,3,3,2,1,1,2,1,3,3,0,3,1,1,1,1,3,2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,3,3,2,2,2,3,3,3,3,3,3,3,3,3,3,3,1,1,3,1,3,3,2,3,2,2,2,3,0,2,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,2,3,3,2,2,3,2,1,1,1,1,1,3,1,3,1,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0, 0,0,0,3,3,3,3,3,2,3,2,0,3,2,0,3,0,2,0,0,2,1,3,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,2,1,1,1,1,2,1,1,2,1,1,1,2,2,1,2,1,1,1,0,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,2,1,3,1,1,2,1,3,2,1,1,0,1,2,3,2,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,3,3,3,2,2,1,0,1,0,0,1,0,0,0,2,1,0,3,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,1,3,3,3,2,3,2,3,3,1,3,2,1,1,1,2,1,1,2,1,3,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,1,2,2,3,3,2,3,2,2,2,3,1,2,2,1,1,2,1,1,2,2,0,1,1,0,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,2,1,3,1,0,2,2,1,3,2,1,0,0,2,0,2,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,3,3,3,3,3,3,1,2,0,2,3,1,2,3,2,0,1,3,1,2,1,1,1,0,0,1,0,0,2,2,2,3,2,2,2,2,1,2,1,1,2,2,1,1,2,0,1,1,1,0,0, 1,1,0,0,1,1,0,0,0,1,1,0,1,3,3,3,3,3,2,1,2,2,1,2,0,2,0,1,0,1,2,1,2,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1,3,3,2,3,3,1,1,3,1,0,3,2,1,0,0,0,1,2,0,2,0,1,0,0,0,1,0,1,2,1,2,2,1,1,1,1,1,1,1,2,2,2,1,1,1,1,1,1,1,0,1,2,1,1,1,0,0,0,0,0,1,1,0,0,3,1,0,1,0,2,3,2,2,2,3,2,2,2,2,2,1,0,2,1,2,1,1,1,0,1,2,1,2,2,2,1,1,1,2,2,2,2,1,2,1,1,0,1,2,1,2,2,2,1,1,1,0,1,1,1,1,2,0,1,0,0,0,0,2,3,2,3,3,0,0,2,1,0,2,1,0,0,0,0,2,3,0,2,0,0,0,0,0,1,0,0,2,0,1,2,2,1,2,1,2,2,1,1,1,2,1,1,1,0, 1,2,2,1,1,1,1,1,0,1,1,1,0,0,1,2,0,0,3,3,2,2,3,0,2,3,1,1,2,0,0,0,1,0,0,2,0,2,0,0,0,1,0,1,0,1,2,0,2,2,1,1,1,1,2,1,0,1,2,2,2,1,1,1,1,1,1,1,0,1,1,1,0,0,0,0,0,0,1,1,0,0,2,3,2,3,3,0,0,3,0,1,1,0,1,0,0,0,2,2,1,2,0,0,0,0,0,0,0,0,2,0,1,2,2,2,1,1,1,1,1,2,2,2,1,0,2,0,1,0,1,0,0,1,0,1,0,0,1,0,0,0,0,1,0,0,3,3,3,3,2,2,2,2,2,0,2,1,1,1,1,2,1,2,1,1,0,2,0,1,0,1,0,0,2,0,1,2,1,1,1,1,1,1,1,2,2,1,1,0,2,0,1,0,2,0,0,1,1,1,0,0,2,0,0,0,1,1,0,0,2,3,3,3,3,1,0,0,0,0,0,0,0,0,0,0,2,0,0,1,1,0,0,0,0,0,0,1,2,0,1,2,2,2,2,1,1,2,1,1,2, 2,2,1,2,0,1,1,1,1,1,1,0,1,1,1,1,0,0,1,1,1,0,0,2,3,3,3,3,0,2,2,0,2,1,0,0,0,1,1,1,2,0,2,0,0,0,3,0,0,0,0,2,0,2,2,1,1,1,2,1,2,1,1,2,2,2,1,2,0,1,1,1,0,1,1,1,1,0,2,1,0,0,0,1,1,0,0,2,3,3,3,3,0,2,1,0,0,2,0,0,0,0,0,1,2,0,2,0,0,0,0,0,0,0,0,2,0,1,2,1,1,1,2,1,1,1,1,2,2,2,0,1,0,1,1,1,0,0,1,1,1,0,0,1,0,0,0,0,1,0,0,3,3,2,2,3,0,1,0,1,0,0,0,0,0,0,0,1,1,0,3,0,0,0,0,0,0,0,0,1,0,2,2,1,1,1,1,1,2,1,1,2,2,1,2,2,1,0,1,1,1,1,1,0,1,0,0,1,0,0,0,1,1,0,0,3,1,0,1,0,2,2,2,2,3,2,1,1,1,2,3,0,0,1,0,2,1,1,0,1,1,1,1,2,1,1,1,1,2,2,1, 2,1,2,2,1,1,0,1,2,1,2,2,1,1,1,0,0,1,1,1,2,1,0,1,0,0,0,0,2,1,0,1,0,3,1,2,2,2,2,1,2,2,1,1,1,0,2,1,2,2,1,1,2,1,1,0,2,1,1,1,1,2,2,2,2,2,2,2,1,2,0,1,1,0,2,1,1,1,1,1,0,0,1,1,1,1,0,1,0,0,0,0,2,1,1,1,1,2,2,2,2,1,2,2,2,1,2,2,1,1,2,1,2,3,2,2,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,3,2,0,1,2,0,1,2,1,1,0,1,0,1,2,1,2,0,0,0,1,1,0,0,0,1,0,0,2,1,1,0,0,1,1,0,1,1,1,1,0,2,0,1,1,1,0,0,1,1,0,0,0,0,1,0,0,0,1,0,0,2,0,0,0,0,1,2,2,2,2,2,2,2,1,2,1,1,1,1,1,1,1,0,1,1,1,1,1,2,1,1, 1,1,2,2,2,2,1,1,2,1,2,1,1,1,0,2,1,2,1,1,1,0,2,1,1,1,1,0,1,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,0,1,0,1,1,1,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,3,2,0,0,0,0,1,0,0,0,0,0,0,1,1,0,2,0,0,0,0,0,0,0,0,1,0,1,2,1,1,1,1,1,1,0,0,2,2,2,2,2,0,1,1,0,1,1,1,1,1,0,0,1,0,0,0,1,1,0,1,2,3,1,2,1,0,1,1,0,2,2,2,0,0,1,0,0,1,1,1,1,0,0,0,0,0,0,0,1,0,1,2,1,1,1,1,2,1,1,1,1,1,1,1,1,0,1,1,0,1,0,1,0,1,0,0,1,0,0,0,0,1,0,0,2,2,2,2,2,0,0,2,0,0,2,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0, 0,0,2,0,2,2,1,1,1,1,1,0,0,1,2,1,1,0,1,0,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2,0,0,2,0,1,1,0,0,0,1,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,0,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,2,2,3,2,0,0,1,0,0,1,0,0,0,0,0,0,1,0,2,0,0,0,1,0,0,0,0,0,0,0,2,1,1,0,0,1,0,0,0,1,1,0,0,1,0,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,2,1,2,2,2,1,2,1,2,2,1,1,2,1,1,1,0,1,1,1,1,2,0,1,0,1,1,1,1,0,1,1,1,1,2,1,1,1,1,1,1,0,0,1,2,1,1,1,1,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,1,0,0,1,3,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0, 0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,1,0,0,1,0,2,0,0,0,0,0,1,1,1,0,1,0,0,0,0,0,0,0,0,2,0,0,1,0,2,0,1,0,0,1,1,2,0,1,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2,0,1,1,0,2,1,0,1,1,1,0,0,1,0,2,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,0,0,0,1,1,0,0,1,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,0,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,1,0,0,1,1,1,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,2,0,1,0,0,1,2,1,1,1,1,1,1,2,2,1, 0,0,1,0,1,0,0,0,0,1,1,1,1,0,0,0,1,1,2,1,1,1,1,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,1,2,1,0,0,1,0,0,0,0,0,0,0,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,0,1,1,1,0,0,1,0,0,1,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,0,1,1,1,1,1,1, 1,1,1,1,1,0,0,1,0,2,0,0,2,0,1,0,0,1,0,0,1,1,1,0,0,1,1,0,1,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,1,1,1,1,1,2,0,0,0,0,0,0,2,1,0,1,1,0,0,1,1,1,0,1,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,1,0,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1];b.Latin5BulgarianModel= {charToOrderMap:b.Latin5_BulgarianCharToOrderMap,precedenceMatrix:b.BulgarianLangModel,mTypicalPositiveRatio:.969392,keepEnglishLetter:!1,charsetName:"ISO-8859-5"};b.Win1251BulgarianModel={charToOrderMap:b.win1251BulgarianCharToOrderMap,precedenceMatrix:b.BulgarianLangModel,mTypicalPositiveRatio:.969392,keepEnglishLetter:!1,charsetName:"windows-1251"}},{}],23:[function(a,d,b){b.KOI8R_CharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,142,143,144,145,146,147,148,149,150,151,152,74,153,75,154,155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253,253,71,172,66,173,65,174,76,175,64,176,177,77,72,178,69,67,179,78,73,180,181,79,182,183,184,185,253,253,253,253,253,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216, 217,218,219,220,221,222,223,224,225,68,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,27,3,21,28,13,2,39,19,26,4,23,11,8,12,5,1,15,16,9,7,6,14,24,10,17,18,20,25,30,29,22,54,59,37,44,58,41,48,53,46,55,42,60,36,49,38,31,34,35,43,45,32,40,52,56,33,61,62,51,57,47,63,50,70];b.win1251_CharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253, 253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,142,143,144,145,146,147,148,149,150,151,152,74,153,75,154,155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253,253,71,172,66,173,65,174,76,175,64,176,177,77,72,178,69,67,179,78,73,180,181,79,182,183,184,185,253,253,253,253,253,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226, 227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,68,247,248,249,250,251,252,253,37,44,33,46,41,48,56,51,42,60,36,49,38,31,34,35,45,32,40,52,53,55,58,50,57,63,70,62,61,47,59,43,3,21,10,19,13,2,24,20,4,23,11,8,12,5,1,15,9,7,6,14,39,26,28,22,25,29,54,18,17,30,27,16];b.latin5_CharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253, 253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,142,143,144,145,146,147,148,149,150,151,152,74,153,75,154,155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253,253,71,172,66,173,65,174,76,175,64,176,177,77,72,178,69,67,179,78,73,180,181,79,182,183,184,185,253,253,253,253,253,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237, 238,37,44,33,46,41,48,56,51,42,60,36,49,38,31,34,35,45,32,40,52,53,55,58,50,57,63,70,62,61,47,59,43,3,21,10,19,13,2,24,20,4,23,11,8,12,5,1,15,9,7,6,14,39,26,28,22,25,29,54,18,17,30,27,16,239,68,240,241,242,243,244,245,246,247,248,249,250,251,252,255];b.macCyrillic_CharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252, 252,252,252,253,253,253,253,253,253,253,142,143,144,145,146,147,148,149,150,151,152,74,153,75,154,155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253,253,71,172,66,173,65,174,76,175,64,176,177,77,72,178,69,67,179,78,73,180,181,79,182,183,184,185,253,253,253,253,253,37,44,33,46,41,48,56,51,42,60,36,49,38,31,34,35,45,32,40,52,53,55,58,50,57,63,70,62,61,47,59,43,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222, 223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,68,16,3,21,10,19,13,2,24,20,4,23,11,8,12,5,1,15,9,7,6,14,39,26,28,22,25,29,54,18,17,30,27,255];b.IBM855_CharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,142, 143,144,145,146,147,148,149,150,151,152,74,153,75,154,155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253,253,71,172,66,173,65,174,76,175,64,176,177,77,72,178,69,67,179,78,73,180,181,79,182,183,184,185,253,253,253,253,253,191,192,193,194,68,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,27,59,54,70,3,37,21,44,28,58,13,41,2,48,39,53,19,46,218,219,220,221,222,223,224,26,55,4,42,225,226,227,228,23,60,229,230,231,232,233,234,235,11,36,236,237,238, 239,240,241,242,243,8,49,12,38,5,31,1,34,15,244,245,246,247,35,16,248,43,9,45,7,32,6,40,14,52,24,56,10,33,17,61,249,250,18,62,20,51,25,57,30,47,29,63,22,50,251,252,255];b.IBM866_CharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,142,143,144,145,146,147,148,149,150,151,152,74, 153,75,154,155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253,253,71,172,66,173,65,174,76,175,64,176,177,77,72,178,69,67,179,78,73,180,181,79,182,183,184,185,253,253,253,253,253,37,44,33,46,41,48,56,51,42,60,36,49,38,31,34,35,45,32,40,52,53,55,58,50,57,63,70,62,61,47,59,43,3,21,10,19,13,2,24,20,4,23,11,8,12,5,1,15,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233, 234,235,236,237,238,9,7,6,14,39,26,28,22,25,29,54,18,17,30,27,16,239,68,240,241,242,243,244,245,246,247,248,249,250,251,252,255];b.RussianLangModel=[0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,1,3,3,3,3,1,3,3,3,2,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,2,2,2,2,2,0,0,2,3,3,3,2,3,3,3,3,3,3,3,3,3,3,2,3,3,0,0,3,3,3,3,3,3,3,3,3,2,3,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,2,2,3,3,3,3,3,3,3,3,3,2,3,3,0,0,3,3,3,3,3,3,3,3,2,3,3,1,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,2,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,0,0,3,3,3,3,3,3,3,3,3,3,3,2,1,0,0,0,0,0,0,0,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,0,0,3,3,3,3,3,3,3,3,3,3,3,2,1,0,0,0,0,0,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,2,2,2,3,1,3,3,1,3,3,3,3,2,2,3,0,2,2,2,3,3,2,1,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,2,3,3,3,3,3,2,2,3,2,3,3,3,2,1,2,2,0,1,2,2,2,2,2,2,0,0,0,0,0,0,0,0,2,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,3,0,2,2,3,3,2,1,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,1,0,0,2,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,2,3,3,1,2,3,2,2,3,2,3,3,3,3,2,2,3,0,3,2,2,3,1,1,1,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,2,2,3,3,3,3,3,2,3,3,3,3,2,2,2,0,3,3,3,2,2,2,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,2,3,2,3,3,3,3,3,3,2,3,2,2,0,1,3,2,1,2,2,1,0,0,0,0,0,0,0, 0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3,2,1,1,3,0,1,1,1,1,2,1,1,0,2,2,2,1,2,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,2,3,3,2,2,2,2,1,3,2,3,2,3,2,1,2,2,0,1,1,2,1,2,1,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3,3,2,2,3,2,3,3,3,2,2,2,2,0,2,2,2,2,3,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,3,2,3,2,2,3,3,3,3,3,3,3,3,3,1,3,2,0,0,3,3,3,3,2,3,3,3,3,2,3,2,0,0, 0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,3,3,3,3,2,2,3,3,0,2,1,0,3,2,3,2,3,0,0,1,2,0,0,1,0,1,2,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,3,0,2,3,3,3,3,2,3,3,3,3,1,2,2,0,0,2,3,2,2,2,3,2,3,2,2,3,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,2,3,0,2,3,2,3,0,1,2,3,3,2,0,2,3,0,0,2,3,2,2,0,1,3,1,3,2,2,1,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,3,0,2,3,3,3,3,3,3,3,3,2,1,3,2,0,0,2,2,3,3,3,2,3,3,0, 2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,2,2,3,3,2,2,2,3,3,0,0,1,1,1,1,1,2,0,0,1,1,1,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,2,2,3,3,3,3,3,3,3,0,3,2,3,3,2,3,2,0,2,1,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,2,3,3,3,2,2,2,2,3,1,3,2,3,1,1,2,1,0,2,2,2,2,1,3,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,2,3,3,3,3,3,1,2,2,1,3,1,0,3,0,0,3,0,0,0,1,1, 0,1,2,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,2,2,1,1,3,3,3,2,2,1,2,2,3,1,1,2,0,0,2,2,1,3,0,0,2,1,1,2,1,1,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,2,3,3,3,3,1,2,2,2,1,2,1,3,3,1,1,2,1,2,1,2,2,0,2,0,0,1,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,3,3,3,3,2,1,3,2,2,3,2,0,3,2,0,3,0,1,0,1,1,0,0,1,1,1,1,0,1,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,2,3,3,3,2,2,2,3,3,1,2,1,2,1,0,1, 0,1,1,0,1,0,0,2,1,1,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,3,1,1,2,1,2,3,3,2,2,1,2,2,3,0,2,1,0,0,2,2,3,2,1,2,2,2,2,2,3,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,1,1,0,1,1,2,2,1,1,3,0,0,1,3,1,1,1,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,3,3,3,2,0,0,0,2,1,0,1,0,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,1,0,0,2,3,2,2,2,1,2,2, 2,1,2,1,0,0,1,1,1,0,2,0,1,1,1,0,0,1,1,1,0,0,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,2,3,3,3,3,0,0,0,0,1,0,0,0,0,3,0,1,2,1,0,0,0,0,0,0,0,1,1,0,0,1,1,1,0,1,0,1,2,0,0,1,1,2,1,0,1,1,1,1,0,1,1,1,1,0,1,0,0,1,0,0,1,1,0,2,2,3,2,2,2,3,1,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,0,1,0,1,1,1,0,2,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,0,1,0,1,1,0,1,1,1,0,1,1,0,3,3,3,2,2,2,2,3,2,2,1,1,2,2,2,2,1,1,3,1,2,1,2,0,0,1,1,0,1,0,2,1,1,1,1,1,1,2,1,0,1,1,1,1,0,1,0,0,1,1,0,0,1,0,1,0,0,1,0,0,0,1,1,0,2,0,0,1,0,3,2,2, 2,2,1,2,1,2,1,2,0,0,0,2,1,2,2,1,1,2,2,0,1,1,0,2,1,1,1,1,1,0,1,1,1,2,1,1,1,2,1,0,1,2,1,1,1,1,0,1,1,1,0,0,1,0,0,1,1,3,2,2,2,1,1,1,2,3,0,0,0,0,2,0,2,2,1,0,0,0,0,0,0,1,0,0,0,0,1,1,1,0,1,1,0,1,0,1,1,0,1,1,0,2,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,1,1,0,2,3,2,3,2,1,2,2,2,2,1,0,0,0,2,0,0,1,1,0,0,0,0,0,0,0,1,1,0,0,2,1,1,1,2,1,0,2,0,0,1,0,1,0,0,1,0,0,1,1,0,1,1,0,0,0,0,0,1,0,0,0,0,0,3,0,0,1,0,2,2,2,3,2,2,2,2,2,2,2,0,0,0,2,1,2,1,1,1,2,2,0,0,0,1,2,1,1,1,1,1,0,1,2,1,1,1,1,1,1,1,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0,0,1,2,3,2, 3,3,2,0,1,1,1,0,0,1,0,2,0,1,1,3,1,0,0,0,0,0,0,0,1,0,0,2,1,1,1,1,1,1,1,1,0,1,0,1,1,1,1,0,1,1,1,0,0,1,1,0,1,0,0,0,0,0,0,1,0,2,3,3,3,3,1,2,2,2,2,0,1,1,0,2,1,1,1,2,1,0,1,1,0,0,1,0,1,0,0,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,3,3,2,0,0,1,1,2,2,1,0,0,2,0,1,1,3,0,0,1,0,0,0,0,0,1,0,1,2,1,1,1,2,0,1,1,1,0,1,0,1,1,0,1,0,1,1,1,1,0,1,0,0,0,0,0,0,1,0,1,1,0,1,3,2,3,2,1,0,0,2,2,2,0,1,0,2,0,1,1,1,0,1,0,0,0,3,0,1,1,0,0,2,1,1,1,1,0,1,1,0,0,0,0,1,1,0,1,0,0,2,1,1,0,1,0,0,0,1,0,1,0,0,1, 1,0,3,1,2,1,1,2,2,2,2,2,2,1,2,2,1,1,0,0,0,2,2,2,0,0,0,1,2,1,0,1,0,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,2,1,1,1,0,1,0,1,1,0,1,1,1,0,0,1,3,0,0,0,0,2,0,1,1,1,1,1,1,1,0,1,0,0,0,1,1,1,0,1,0,1,1,0,0,1,0,1,1,1,0,0,1,0,0,0,1,0,1,1,0,0,1,0,1,0,1,0,0,0,0,1,0,0,0,1,0,0,0,1,1,3,3,2,2,0,0,0,2,2,0,0,0,1,2,0,1,1,2,0,0,0,0,0,0,0,0,1,0,0,2,1,0,1,1,0,0,1,1,0,0,0,1,1,0,1,1,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,1,0,2,3,2,3,2,0,0,0,0,1,1,0,0,0,2,0,2,0,2,0,0,0,0,0,1,0,0,1,0,0,1,1,1,1,2,0,1,2,1,0,1,1,2,1,1,1,1,1,2,1,1,0,1,0,0,1,1, 1,1,1,0,1,1,0,1,3,2,2,2,1,0,0,2,2,1,0,1,2,2,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,1,1,0,0,1,1,0,1,1,0,0,1,1,0,1,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,2,3,1,2,2,2,2,2,2,1,1,0,0,0,1,0,1,0,2,1,1,1,0,0,0,0,1,1,1,0,1,1,0,1,1,1,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,2,0,0,1,0,3,2,1,2,1,2,2,0,1,0,0,0,2,1,0,0,2,1,1,1,1,0,2,0,2,2,1,1,1,1,1,1,1,1,1,1,1,1,2,1,0,1,1,1,1,0,0,0,1,1,1,1,0,1,0,0,1,1,2,2,2,2,1,0,0,1,0,0,0,0,0,2,0,1,1,1,1,0,0,0,0,1,0,1,2,0,0,2,0,1,0,1,1,1,2,1,0,1,0,1,1,0,0,1,0,1,1,1,0, 1,0,0,0,1,0,0,1,0,1,1,0,2,1,2,2,2,0,3,0,1,1,0,0,0,0,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1,1,0,0,1,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,1,2,2,3,2,2,0,0,1,1,2,0,1,2,1,0,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,1,1,0,0,1,0,0,0,0,0,0,0,0,1,1,0,2,2,1,1,2,1,2,2,2,2,2,1,2,2,0,1,0,0,0,1,2,2,2,1,2,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,0,1,1,1,0,0,0,0,1,1,1,0,1,1,0,0,1,1,2,2,2,2,0,1,0,2,2,0,0,0,0,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,1,0,0,1,0,0,0,0,1,0,1,1,0, 0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2,0,0,0,2,2,2,0,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,1,1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2,0,0,0,0,1,0,0,1,1,2,0,0,0,0,1,0,1,0,0,1,0,0,2,0,0,0,1,0,0,1,0,0,1,0,0,0,1,1,0,0,0,0,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,1,1,2,0,2,1,1,1,1,0,2,2,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,1,0,0,1,0,1,1,0,0,0,0, 1,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,2,1,2,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,1,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,2,0,1,2,1,0,1,1,1,0,1,0,0,0,1,0,1,0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,1,1,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,1, 0,1,0,0,1,1,1,1,0,0,0,1,0,0,0,0,1,0,0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1,0,1,0,1,0,0,0,0,1,1,0,1,1,0,0,0,0,0,1,0,1,1,0,1,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0];b.Koi8rModel={charToOrderMap:b.KOI8R_CharToOrderMap,precedenceMatrix:b.RussianLangModel,mTypicalPositiveRatio:.976601,keepEnglishLetter:!1,charsetName:"KOI8-R"};b.Win1251CyrillicModel={charToOrderMap:b.win1251_CharToOrderMap, precedenceMatrix:b.RussianLangModel,mTypicalPositiveRatio:.976601,keepEnglishLetter:!1,charsetName:"windows-1251"};b.Latin5CyrillicModel={charToOrderMap:b.latin5_CharToOrderMap,precedenceMatrix:b.RussianLangModel,mTypicalPositiveRatio:.976601,keepEnglishLetter:!1,charsetName:"ISO-8859-5"};b.MacCyrillicModel={charToOrderMap:b.macCyrillic_CharToOrderMap,precedenceMatrix:b.RussianLangModel,mTypicalPositiveRatio:.976601,keepEnglishLetter:!1,charsetName:"x-mac-cyrillic"};b.Ibm866Model={charToOrderMap:b.IBM866_CharToOrderMap, precedenceMatrix:b.RussianLangModel,mTypicalPositiveRatio:.976601,keepEnglishLetter:!1,charsetName:"IBM866"};b.Ibm855Model={charToOrderMap:b.IBM855_CharToOrderMap,precedenceMatrix:b.RussianLangModel,mTypicalPositiveRatio:.976601,keepEnglishLetter:!1,charsetName:"IBM855"}},{}],24:[function(a,d,b){b.Latin7_CharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253, 253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,82,100,104,94,98,101,116,102,111,187,117,92,88,113,85,79,118,105,83,67,114,119,95,99,109,188,253,253,253,253,253,253,72,70,80,81,60,96,93,89,68,120,97,77,86,69,55,78,115,65,66,58,76,106,103,87,107,112,253,253,253,253,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,233,90,253,253,253,253,253,253,253,253,253,253,74,253,253,253,253,253, 253,247,248,61,36,46,71,73,253,54,253,108,123,110,31,51,43,41,34,91,40,52,47,44,53,38,49,59,39,35,48,250,37,33,45,56,50,84,57,120,121,17,18,22,15,124,1,29,20,21,3,32,13,25,5,11,16,10,6,30,4,9,8,14,7,2,12,28,23,42,24,64,75,19,26,27,253];b.win1253_CharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253, 253,253,253,253,253,82,100,104,94,98,101,116,102,111,187,117,92,88,113,85,79,118,105,83,67,114,119,95,99,109,188,253,253,253,253,253,253,72,70,80,81,60,96,93,89,68,120,97,77,86,69,55,78,115,65,66,58,76,106,103,87,107,112,253,253,253,253,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,233,61,253,253,253,253,253,253,253,253,253,253,74,253,253,253,253,253,253,247,253,253,36,46,71,73,253,54,253,108,123,110,31,51,43, 41,34,91,40,52,47,44,53,38,49,59,39,35,48,250,37,33,45,56,50,84,57,120,121,17,18,22,15,124,1,29,20,21,3,32,13,25,5,11,16,10,6,30,4,9,8,14,7,2,12,28,23,42,24,64,75,19,26,27,253];b.GreekLangModel=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,2,2,3,3,3,3,3,3,3,3,1,3,3,3,0,2,2,3,3,0,3,0,3,2,0,3,3,3,0,3,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,0,3,3,0,3,2,3,3,0,3,2,3,3,3,0,0,3,0,3, 0,3,3,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,3,2,2,3,3,3,3,3,3,3,3,0,3,3,3,3,0,2,3,3,0,3,3,3,3,2,3,3,3,0,2,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,0,2,1,3,3,3,3,2,3,3,2,3,3,2,0,0,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,0,3,3,3,3,3,3,0,3,3,0,3,3,3,3,3,3,3,3,3,3,0,3,2,3,3,0,2,0,1,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,3,3,3,3,3,2,3,0,0,0,0,3,3,0,3,1,3,3,3, 0,3,3,0,3,3,3,3,0,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,0,3,0,3,3,3,3,3,0,3,2,2,2,3,0,2,3,3,3,3,3,2,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,2,2,2,3,3,3,3,0,3,1,3,3,3,3,2,3,3,3,3,3,3,3,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,2,0,3,0,0,0,3,3,2,3,3,3,3,3,0,0,3,2,3,0,2,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,3,3,3,3,0,0,3,3,0,2,3,0, 3,0,3,3,3,0,0,3,0,3,0,2,2,3,3,0,0,0,0,1,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,2,0,3,2,3,3,3,3,0,3,3,3,3,3,0,3,3,2,3,2,3,3,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,2,3,2,3,3,3,3,3,3,0,2,3,2,3,2,2,2,3,2,3,3,2,3,0,2,2,2,3,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,3,3,3,2,3,3,0,0,3,0,3,0,0,0,3,2,0,3,0,3,0,0,2,0,2,0,0,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,0,3,3,3,3,3,3,0,3,3,0,3,0,0,0,3,3,0,3,3,3,0,0,1,2,3,0,3,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,2,0,0,3,2,2,3,3,0,3,3,3,3,3,2,1,3,0,3,2,3,3,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,0,2,3,3,3,3,3,3,0,0,3,0,3,0,0,0,3,3,0,3,2,3,0,0,3,3,3,0,3,0,0,0,2,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3, 0,3,3,3,3,3,3,0,0,3,0,3,0,0,0,3,2,0,3,2,3,0,0,3,2,3,0,2,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,2,2,3,3,3,3,3,3,0,2,3,0,3,0,0,0,3,3,0,3,0,2,0,0,2,3,1,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,3,3,3,3,0,3,0,3,3,2,3,0,3,3,3,3,3,3,0,3,3,3,0,2,3,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,3,3,3,0,0,3,0,0,0,3,3,0,3,0,2,3,3,0,0,3,0,3,0,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,3,0,0,0,3,3,3,3,3,3,0,0,3,0,2,0,0,0,3,3,0,3,0,3,0,0,2,0,2,0,0,0,0,0,1,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,0,3,0,2,0,3,2,0,3,2,3,2,3,0,0,3,2,3,2,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,2,3,3,3,3,3,0,0,0,3,0,2,1,0,0,3,2,2,2,0,3,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,3,3,3,2,0,3,0,3,0,3,3,0,2,1,2,3,3,0,0,3,0,3,0,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,2,3,3,3,0,3,3,3,3,3,3,0,2,3,0,3,0,0,0,2,1,0,2,2,3,0,0,2,2,2,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,2,3,3,3,2,3,0,0,1,3,0,2,0,0,0,0,3,0,1,0,2,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,1,0,3,0,0,0,3,2,0,3,2,3,3,3,0,0,3,0,3,2,2,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,3,3,3,0,0,3,0,0,0,0,2,0,2,3,3,2,2,2,2,3,0,2,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,2,0,0,0,0,0,0,2,3,0,2,0,2,3,2,0,0,3,0,3,0,3,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,2,3,3,2,2,3,0,2,0,3,0,0,0,2,0,0,0,0,1,2,0,2,0,2,0,0,2,0,2,0,2,2,0,0,1,0,2,2,2,0,2,2,2,0,2,2,2,0,0,2,0,0,1,0,0,0,0,0,2,0,3,3,2,0,0,0,0,0,0,1,3,0,2,0,2,2,2,0,0,2,0,3,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,2,3,2,0,2,2,0,2,0,2,2,0,2,0,2,2,2,0,0,0,0,0,0,2,3,0,0,0,2,0,1,2,0,0,0,0,2,2,0,0,0,2,1,0,2,2, 0,0,0,0,0,0,1,0,2,0,0,0,0,0,0,0,0,2,1,0,2,3,2,2,3,2,3,2,0,0,3,3,3,0,0,3,2,0,0,0,1,1,0,2,0,2,2,0,2,0,2,0,2,2,0,0,2,0,2,2,2,0,2,2,2,2,0,0,2,0,0,0,2,0,1,0,0,0,0,0,3,0,3,3,2,2,0,3,0,0,0,2,2,0,2,2,2,1,2,0,0,1,2,2,0,0,3,0,0,0,2,0,1,2,0,0,0,1,2,0,0,0,0,0,0,0,2,2,0,1,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,3,2,2,0,0,0,2,0,2,3,3,0,2,0,0,0,0,0,0,2,2,2,0,2,2,0,2,0,2,0,2,2,0,0,2,2,2,2,1,0,0, 2,2,0,2,0,0,2,0,0,0,0,0,0,2,0,0,0,0,0,0,0,2,0,3,2,3,0,0,0,3,0,0,2,2,0,2,0,2,2,2,0,0,2,0,0,0,0,0,0,0,0,2,0,0,2,2,0,0,2,2,2,0,0,0,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,3,2,0,2,2,2,2,2,0,0,0,2,0,0,0,0,2,0,1,0,0,2,0,1,0,0,0,0,2,2,2,0,2,2,0,1,2,0,2,2,2,0,2,2,2,2,1,2,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,2,0,2,2,0,0,0,0,1,2,1,0,0,2,2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,2,3,0,0,2,0,0,0,2,2,0,2,0,0,0,1,0,0,2,0,2,0,2,2,0,0,0,0,0,0,2,0,0,0,0, 2,2,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,2,2,3,2,2,0,0,0,0,0,0,1,3,0,2,0,2,2,0,0,0,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,3,2,0,2,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,2,0,0,0,0,1,1,0,0,2,1,2,0,2,2,0,1,0,0,1,0,0,0,2,0,0,0,0,0,0,0,3,0,2,2,2,0,0,2,0,0,0,2,0,0,0,2,3,0,2,0,0,0,0,0,0,2,2,0,0,0,2,0,1,2,0,0,0,1,2,2,1,0,0,0,2,0,0,2,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2, 1,2,0,2,2,0,2,0,0,2,0,0,0,0,1,2,1,0,2,1,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,3,1,2,2,0,2,0,0,0,0,2,0,0,0,2,0,0,3,0,0,0,0,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,0,2,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,0,0,0,0,0,0,2,0,2,2,0,0,2,2,2,2,2,0,1,2,0,0,0,2,2,0,1,0,2,0,0,2,2,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,0,0,2,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,2,0,1,2,0,0,0,0,2,2,1,0,1,0,1,0,2,2,2,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,2,0,1,2,0,0,0,0,0,0,0,0,0,0,2,0,0,2,2,0,0,0,0,1,0,0,0,0, 0,0,2,0,2,2,0,0,0,0,2,2,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,2,0,0,0,0,2,2,2,2,0,0,0,3,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,2,0,0,0,0,0,0,1,0,0,2,0,0,0,0,1,2,0,0,0,0,0,0,2,2,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,2,0,2,2,2,0,0,2,0,0,0,0,0,0,0,2,2,2,0,0,0,2,0,0,0,0,0,0,0,0,2,0,0,1,0,0,0,0,2,1,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,3,0,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,0,2,0,0,2,0,0,0,0,2,2,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,2,1,0,0,0,0,0,0,2,0,0,2,0,2,2,2,0,0,0,0, 0,0,2,0,0,0,0,2,0,0,2,0,0,2,0,2,2,0,0,0,0,2,0,2,0,0,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,3,0,0,0,2,2,0,2,2,0,0,0,0,0,2,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,2,0,0,0,0,0,0,2,2,2,2,2,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,2,1,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,2,0,0,0,0, 0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,0,0,2,0,0,0,0,0,1,0,0,0,0,2,2,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,2,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,2,1,0,0,0,0, 0,0,2,0,0,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];b.Latin7GreekModel={charToOrderMap:b.Latin7_CharToOrderMap,precedenceMatrix:b.GreekLangModel,mTypicalPositiveRatio:.982851,keepEnglishLetter:!1, charsetName:"ISO-8859-7"};b.Win1253GreekModel={charToOrderMap:b.win1253_CharToOrderMap,precedenceMatrix:b.GreekLangModel,mTypicalPositiveRatio:.982851,keepEnglishLetter:!1,charsetName:"windows-1253"}},{}],25:[function(a,d,b){b.win1255_CharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253, 253,253,69,91,79,80,92,89,97,90,68,111,112,82,73,95,85,78,121,86,71,67,102,107,84,114,103,115,253,253,253,253,253,253,50,74,60,61,42,76,70,64,53,105,93,56,65,54,49,66,110,51,43,44,63,81,77,98,75,108,253,253,253,253,253,124,202,203,204,205,40,58,206,207,208,209,210,211,212,213,214,215,83,52,47,46,72,32,94,216,113,217,109,218,219,220,221,34,116,222,118,100,223,224,117,119,104,125,225,226,87,99,227,106,122,123,228,55,229,230,101,231,232,120,233,48,39,57,234,30,59,41,88,33,37,36,31,29,35,235,62,28,236, 126,237,238,38,45,239,240,241,242,243,127,244,245,246,247,248,249,250,9,8,20,16,3,2,24,14,22,1,25,15,4,11,6,23,12,19,13,26,18,27,21,17,7,10,5,251,252,128,96,253];b.HebrewLangModel=[0,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,2,3,2,1,2,0,1,0,0,3,0,3,1,0,0,1,3,2,0,1,1,2,0,2,2,2,1,1,1,1,2,1,1,1,2,0,0,2,2,0,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,1,2,1,2,1,2,0,0,2,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2, 1,2,1,3,1,1,0,0,2,0,0,0,1,0,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,0,1,2,2,1,3,1,2,1,1,2,2,0,0,2,2,0,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,0,1,0,1,1,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,2,2,2,2,3,2,1,2,1,2,2,2,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,2,3,2,2,3,2,2,2,1,2,2,2,2,1,2,1,1,2,2,0,1,2,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,0, 2,2,2,2,2,0,2,0,2,2,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,0,2,2,2,0,2,1,2,2,2,0,0,2,1,0,0,0,0,1,0,1,0,0,0,0,0,0,2,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,2,1,2,3,2,2,2,1,2,1,2,2,2,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,0,3,3,3,3,3,3,3,3,3,2,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,1,0,2,0,2,0,2,1,2,2,2,0,0,1,2,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,0,2,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,2, 3,2,2,3,2,1,2,1,1,1,0,1,1,1,1,1,3,0,1,0,0,0,0,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,1,1,0,0,1,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,0,2,0,1,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,2,3,3,3,2,1,2,3,3,2,3,3,3,3,2,3,2,1,2,0,2,1,2,0,2,0,2,2,2,0,0,1,2,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,3,3,3,3,3,3,3,3,3,2,3,3,3,1,2,2,3, 3,2,3,2,3,2,2,3,1,2,2,0,2,2,2,0,2,1,2,2,2,0,0,1,2,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,2,3,3,2,2,2,3,3,3,3,1,3,2,2,2,0,2,0,1,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,3,3,3,2,3,2,2,2,1,2,2,0,2,2,2,2,0,2,0,2,2,2,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,1,3,2,3,3,2,3,3,2,2,1,2,2,2,2,2,2,0,2,1,2,1,2,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,1,0,3,3,3,3,3,3,2,3,2,3,3,2, 3,3,3,3,2,3,2,3,3,3,3,3,2,2,2,2,2,2,2,1,0,2,0,1,2,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,2,1,2,3,3,3,3,3,3,3,2,3,2,3,2,1,2,3,0,2,1,2,2,0,2,1,1,2,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,2,0,3,3,3,3,3,3,3,3,3,2,3,3,3,3,2,1,3,1,2,2,2,1,2,3,3,1,2,1,2,2,2,2,0,1,1,1,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,2,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,0,2,3,3,3,1,3,3,3,1,2,2,2,2,1,1,2,2,2,2,2,2,0,2,0,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,3,3,3,3,3,3,2, 3,3,3,2,2,3,3,3,2,1,2,3,2,3,2,2,2,2,1,2,1,1,1,2,2,0,2,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,2,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,2,3,3,2,3,1,2,2,2,2,3,2,3,1,1,2,2,1,2,2,1,1,0,2,2,2,2,0,1,0,1,2,2,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,3,0,0,1,1,0,1,0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0, 1,0,1,0,1,1,0,1,1,0,0,0,1,1,0,1,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,3,2,2,1,2,2,2,2,2,2,2,1,2,2,1,2,2,1,1,1,1,1,1,1,1,2,1,1,0,3,3,3,0,3,0,2,2,2,2,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,2,2,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,2,1,2,2,2,1,1,1,2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,0,2,2,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,1,0,2,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,3,1,1,2,2,2,2,2,1,2,2,2,1,1,2,2,2,2,2,2,2,1,2,2,1,0,1,1,1,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,3,2,1,1,1,1,2,1,1,2,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,1,0,0,1,1,0,0,0,0,0,0,1,0,0,2,1,1,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,1,2,1,2,1,1,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,1,2,2,2,2,2,2,2,2,2,2,1,2,1,2,1,1,2,1,1,1,2,1,2,1,2,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,2,2,2,1,2,2,2,2,2,2,2,2,1,2,1,1,1,1,1,1,2,1,2,1,1,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,2,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,0,2,0,1,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,3,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,1,1,1,1,1,1,0,1,1,0,1,0,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,1,1,1,0,1,0,0,0,1,1,0,1,1,0,0,0,0,0,1,1,0,0,0,1,1,1,2,1,2,2,2,0,2,0,2,0,1,1,2,1,1,1,1,2,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,1,2,2,0,1,0,0,1,1,2,2,1,2,0,2,0,0,0,1,2,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,1,2,0,2,0,0,1,1,1,1,1,1,0,1,0,0,0,1,0,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,2,1,1,0,1,0,0,1,1,1,2,2,0,0,1,0,0,0,1,0,0,1,1,1,2,1,0,1,1,1,0,1,0,1,1,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,2,2,1,0,2,0,1,2,1,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,0,0,1,0,1,1,1,1,0,0,0,0,0,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,2,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,1,1,1,0,1,1,0,1,0,0,0,1,1,0,1,2,0,1,0,1,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,1,0,1,1,1,0,1,0,0,1,1,2,1,1,2,0,1,0,0,0,1,1,0,1,1,0,0,1,0,0,1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,2,0,1,0,0,0,0,2,1,1,2,0,2,0,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,1,1,0,1,0,0,2,2,1,2,1,1,0,1,0,0,0,1,1,0,1,2,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,0,0,0,0,0,1,1,0,1,0,0,1,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,1,2,2,0,0,0,0,2,1,1,1,0,2,1,1,0,0,0,2,1,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,2,0,1,0,0,1,1,0,2,1,1,0,1,0,0,0,1,1,0,1,2,2,1,1,1,0,1,1,0,1,1,0,1,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,1,1,0,1,0,0,1,1,0,1,2,1,0,2,0,0,0,1,1,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,1,0,0,2,0,2,1,1,0,1,0,1,0,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,2,0,1,0,0,1,1,1,0,1,0,0,1,0,0,0,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,1,1,0,0,1,0,0,2,1,1,1,1,1,0,1,0,0,0,0,1,0,1,0,1,1,1,2,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,1,0,0,0,0,0,1,1,1,1,1,0,1,0,0,0,1,1,0,0];b.Win1255HebrewModel={charToOrderMap:b.win1255_CharToOrderMap,precedenceMatrix:b.HebrewLangModel,mTypicalPositiveRatio:.984004,keepEnglishLetter:!1,charsetName:"windows-1255"}}, {}],26:[function(a,d,b){b.Latin2_HungarianCharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,28,40,54,45,32,50,49,38,39,53,36,41,34,35,47,46,71,43,33,37,57,48,64,68,55,52,253,253,253,253,253,253,2,18,26,17,1,27,12,20,9,22,7,6,13,4,8,23,67,10,5,3,21,19,65,62,16,11,253,253,253, 253,253,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,75,198,199,200,201,202,203,204,205,79,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,51,81,222,78,223,224,225,226,44,227,228,229,61,230,231,232,233,234,58,235,66,59,236,237,238,60,69,63,239,240,241,82,14,74,242,70,80,243,72,244,15,83,77,84,30,76,85,245,246,247,25,73,42,24,248,249,250,31,56,29,251,252,253];b.win1250HungarianCharToOrderMap= [255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,28,40,54,45,32,50,49,38,39,53,36,41,34,35,47,46,72,43,33,37,57,48,64,68,55,52,253,253,253,253,253,253,2,18,26,17,1,27,12,20,9,22,7,6,13,4,8,23,67,10,5,3,21,19,65,62,16,11,253,253,253,253,253,161,162,163,164,165,166,167,168,169,170,171,172,173, 174,175,176,177,178,179,180,78,181,69,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,76,198,199,200,201,202,203,204,205,81,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,51,83,222,80,223,224,225,226,44,227,228,229,61,230,231,232,233,234,58,235,66,59,236,237,238,60,70,63,239,240,241,84,14,75,242,71,82,243,73,244,15,85,79,86,30,77,87,245,246,247,25,74,42,24,248,249,250,31,56,29,251,252,253];b.HungarianLangModel=[0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,3,3,3,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,2,2,3,3,1,1,2,2,2,2,2,1,2,3,2,2,3,3,3,3,3,2,3,3,3,3,3,3,1,2,3,3,3,3,2,3,3,1,1,3,3,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,3,2,1,3,3,3,3,3,2,3,3,3,3,3,1,1,2,3,3,3,3,3,3,3,1,1,3,2,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,1,1,2,3,3,3,1,3,3,3,3,3,1,3,3,2,2,0,3,2,3,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,3,3,3,3,3,2,3,3,3,2,3,3,2,3,3,3,3,3,2,3,3, 2,2,3,2,3,2,0,3,2,2,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,3,3,3,3,3,3,2,3,3,3,3,3,2,3,3,3,1,2,3,2,2,3,1,2,3,3,2,2,0,3,3,3,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,2,2,3,3,3,3,3,3,2,3,3,3,3,2,3,3,3,3,0,2,3,2,0,0,0,1,1,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,3,1,1,1,3,3,2,1,3,2,2,3,2,1,3,2,2,1,0,3,3,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,2,2,3,3,3,3,3,1,2,3,3,3,3,1,2,1, 3,3,3,3,2,2,3,1,1,3,2,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,2,2,3,3,3,3,3,2,1,3,3,3,3,3,2,2,1,3,3,3,0,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,2,3,3,2,3,3,3,2,0,3,2,3,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,1,0,3,3,3,3,3,3,2,3,3,3,2,3,2,3,3,3,1,3,2,2,2,3,1,1,3,3,1,1,0,3,3,2,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,3,3,3,3,3,3,2,3,3,3,2, 3,2,3,3,3,2,3,3,3,3,3,1,2,3,2,2,0,2,2,2,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,3,3,2,2,2,3,1,3,3,2,2,1,3,3,3,1,1,3,1,2,3,2,3,2,2,2,1,0,2,2,2,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,1,1,3,3,3,3,3,1,2,3,3,3,3,1,2,1,3,3,3,2,2,3,2,1,0,3,2,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,1,3,3,3,3,3,1,2,3,3,3,3,1,1,0,3,3,3,3,0,2,3,0,0,2,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,2, 2,3,3,2,2,2,2,3,3,0,1,2,3,2,3,2,2,3,2,1,2,0,2,2,2,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,3,3,3,3,3,1,2,3,3,3,2,1,2,3,3,2,2,2,3,2,3,3,1,3,3,1,1,0,2,3,2,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,3,3,1,2,2,2,2,3,3,3,1,1,1,3,3,1,1,3,1,1,3,2,1,2,3,1,1,0,2,2,2,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,3,3,2,1,2,1,1,3,3,1,1,1,1,3,3,1,1,2,2,1,2,1,1,2,2,1,1,0,2,2,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,3, 3,1,1,2,1,1,3,3,1,0,1,1,3,3,2,0,1,1,2,3,1,0,2,2,1,0,0,1,3,2,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,2,1,3,3,3,3,3,1,2,3,2,3,3,2,1,1,3,2,3,2,1,2,2,0,1,2,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,3,3,3,3,2,2,2,2,3,1,2,2,1,1,3,3,0,3,2,1,2,3,2,1,3,3,1,1,0,2,1,3,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,3,3,3,2,2,2,3,2,3,3,3,2,1,1,3,3,1,1,1,2,2,3,2,3,2,2,2,1,0,2,2,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0, 0,0,0,1,0,0,3,3,3,3,3,0,0,3,3,2,3,0,0,0,2,3,3,1,0,1,2,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,2,3,3,3,3,3,1,2,3,3,2,2,1,1,0,3,3,2,2,1,2,2,1,0,2,2,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,2,2,1,3,1,2,3,3,2,2,1,1,2,2,1,1,1,1,3,2,1,1,1,1,2,1,0,1,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,3,3,1,1,1,1,1,3,3,3,0,1,1,3,3,1,1,1,1,1,2,2,0,3,1,1,2,0,2,1,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,0,0,0,0,0,0,0,3,1,0,1,2,1,2,2,0,1,2,3,1,2,0,0,0,2,1,1,1,1,1,2,0,0,1,1,0,0,0,0,1,2,1,2,2,2,1,2,1,2,0,2,0,2,2,1,1,2,1,1,2,1,1,1,0,1,0,0,0,1,1,0,1,1,1,2,3,2,3,3,0,1,2,2,3,1,0,1,0,2,1,2,2,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,3,3,2,2,1,0,0,3,2,3,2,0,0,0,1,1,3,0,0,1,1,0,0,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,1,2,2,3,3,1,0,1,3,2,3,1,1,1,0,1,1,1,1,1,3,1,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,1,1,2,2,2,1,0,1,2,3,3,2,0,0,0,2,1,1,1,2,1,1,1,0,1,1,1,0,0,0,1,2,2,2,2,2,1,1,1,2,0,2,1,1,1,1,1,2,1,1,1,1,1,1,0,1,1,1,0,0,1,1,3,2,2,1,0,0,1,1,2,2,0,3,0,1,2,1,1,0,0,1,1,1,0,1,1,1,1,0,2,1,1,1,2,2,1,1,1,2,1,2,1,1,1,1,1,1,1,2,1,1,1,2,3,1,1,1,1,1,1,1,1,1,0,1,2,3,3,0,1,0,0,0,3,3,1,0,0,1,2,2,1,0,0,0,0,2,0,0,1,1,1,0,2,1,1,1,2,1,1,1,1,1,1,2,1,1,0,1,1,0,1,1,1,0,1,2,1,1,0,1,1,1,1,1,1,1,0,1,2,3,3,0,1,0,0,0,2,2,0,0,0,0,1,2,2,0,0,0,0,1,0,0,1,1,0,0,2,0,1,0,2,1,1,1,1,2,1,1,1,1,1,1,1,2, 1,1,1,1,1,1,1,1,1,2,0,1,1,1,1,1,0,1,3,2,2,0,1,0,1,0,2,3,2,0,0,1,2,2,1,0,0,1,1,1,0,0,2,1,0,1,2,2,1,1,2,1,1,1,1,1,1,2,1,1,1,1,1,1,0,2,1,0,1,1,0,1,1,1,0,1,1,2,1,1,0,1,2,2,2,0,0,1,0,0,2,2,1,1,0,0,2,1,1,0,0,0,1,2,0,0,2,1,0,0,2,1,1,1,2,1,1,1,1,2,1,2,1,1,1,2,2,1,1,2,1,1,1,2,1,1,1,1,1,1,1,1,1,1,0,1,1,2,3,0,0,0,1,0,3,2,1,0,0,1,2,1,1,0,0,0,0,2,1,0,1,1,0,0,2,1,2,1,1,1,0,0,0,1,0,1,1,1,1,1,2,0,0,1,0,0,0,2,0,0,1,1,1,1,1,1,1,1,0,1,3,0,0,2,1,2,2,1,0,0,2,1,2,2,0,0,0,2,1,1,1,0,1,1,0,0,1,1,2,0,0,0,1,2,1,2,2,1,1,2,1, 2,0,1,1,1,1,1,1,1,1,1,2,1,1,0,0,1,1,1,1,0,0,1,1,3,2,0,0,0,1,0,2,2,2,0,0,0,2,2,1,0,0,0,0,3,1,1,1,1,0,0,2,1,1,1,2,1,0,1,1,1,0,1,1,1,1,1,1,1,0,2,1,0,0,1,0,1,1,0,1,1,1,1,1,1,0,1,2,3,2,0,0,0,1,0,2,2,0,0,0,0,2,1,1,0,0,0,0,2,1,0,1,1,0,0,2,1,1,0,2,1,1,1,1,2,1,2,1,2,0,1,1,1,0,2,1,1,1,2,1,1,1,1,0,1,1,1,1,1,0,1,3,1,1,2,2,2,3,2,1,1,2,2,1,1,0,1,0,2,2,1,1,1,1,1,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,0,0,0,0,0,2,2,0,0,0,0,2,2,1,0,0,0,1,1,0,0,1,2,0,0,2,1,1,1,2,2,1,1, 1,2,1,2,1,1,0,1,1,1,1,2,1,1,1,2,1,1,1,1,0,1,2,1,1,1,0,1,1,0,0,1,2,3,2,1,0,0,2,0,1,1,0,0,0,1,1,1,1,0,1,1,0,0,1,0,0,0,0,0,1,2,1,2,1,2,1,1,1,2,0,2,1,1,1,0,1,2,0,0,1,1,1,0,0,0,0,0,0,0,0,0,2,3,2,0,0,0,0,0,1,1,2,1,0,0,1,1,1,0,0,0,0,2,0,0,1,1,0,0,2,1,1,1,2,1,1,1,1,1,1,2,1,0,1,1,1,1,0,2,1,1,1,1,1,1,0,1,0,1,1,1,1,1,0,1,1,2,2,0,1,1,1,0,2,2,2,0,0,0,3,2,1,0,0,0,1,1,0,0,1,1,0,1,1,1,0,0,1,1,0,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,0,0,1,1,1,0,1,0,1,2,1,0,2,1,1,2,2,1,1,2,1,1,1,0,0,0,1,1,0,1,1,1,1,0,0,1,1,1,0,0, 0,1,2,2,2,2,2,1,1,1,2,0,2,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,0,0,1,0,1,2,3,0,0,0,1,0,2,2,0,0,0,0,2,2,0,0,0,0,0,1,0,0,1,0,0,0,2,0,1,0,2,1,1,1,1,1,0,2,0,0,0,1,2,1,1,1,1,0,1,2,0,1,0,1,0,1,1,1,0,1,0,1,2,2,2,0,0,0,1,0,2,1,2,0,0,0,1,1,2,0,0,0,0,1,0,0,1,1,0,0,2,1,0,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,0,1,1,1,1,1,0,1,1,2,2,0,0,0,1,0,2,2,2,0,0,0,1,1,0,0,0,0,0,1,1,0,2,0,0,1,1,1,0,1,1,0,1,1,1,1,1,1,0,1,1,1,1,0,0,1,0,0,1,1,0,1,0,1,1,1,1,1,0,0,0,1,1,0,0,1,0,1,2,1,0,0,1,1,1,2,0,0,0,1,1,0,1,0,1,1,0,0, 1,0,0,0,0,0,0,2,1,2,1,1,1,1,1,2,0,2,0,1,1,0,1,2,1,0,1,1,1,0,0,0,0,0,0,1,0,0,2,1,1,0,1,2,0,0,1,1,1,0,0,0,1,1,0,0,0,0,0,1,0,0,1,0,0,0,2,1,0,1,2,2,1,1,1,1,1,2,1,1,0,1,1,1,1,2,1,1,1,2,1,1,0,1,0,1,1,1,1,1,0,1,1,2,2,0,0,0,0,0,1,1,0,0,0,0,2,1,0,0,0,0,0,2,0,0,2,2,0,0,2,0,0,1,2,1,1,1,1,1,1,1,0,1,1,0,1,1,0,1,0,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,2,0,0,3,1,0,2,1,1,1,0,0,1,1,1,0,0,0,1,1,0,0,0,1,0,0,1,0,1,0,1,2,1,0,1,1,1,2,1,1,0,1,1,1,1,1,0,0,0,1,1,1,1,1,0,1,0,0,0,1,0,0,2,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,1,0, 0,0,1,0,0,0,0,2,0,0,0,2,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,2,1,1,0,0,1,1,1,1,1,0,1,2,1,1,1,2,1,1,1,0,1,1,2,1,0,0,0,0,1,1,1,1,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,1,0,0,1,1,2,1,0,0,0,1,1,0,0,0,1,1,0,0,1,0,1,0,0,0,1,2,1,1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,0,1,1,1,0,0,0,0,0,0,1,0,0,2,0,0,0,1,1,1,1,0,0,1,1,0,0,0,0,0,1,1,1,2,0,0,1,0,0,1,0,1,0,0,0,0,1,1,1,1,1,1,1,1,2,0,1,1,1,1,0,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,1,1,1,1,1,0,0,2,1,0,1,0,0, 0,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,1,1,1,1,0,1,1,0,1,0,1,1,0,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,1,1,1,0,0,0,0,1,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,1,1,0,1,0,1,0,0,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,0,0,1,1,0,1,0,1,1,0,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0,2,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,0,0,1,0,1,0,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,1,1,0,0,0,1, 1,1,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,1,1,0,1,0,1,0,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0];b.Latin2HungarianModel={charToOrderMap:b.Latin2_HungarianCharToOrderMap,precedenceMatrix:b.HungarianLangModel,mTypicalPositiveRatio:.947368,keepEnglishLetter:!0,charsetName:"ISO-8859-2"};b.Win1250HungarianModel={charToOrderMap:b.win1250HungarianCharToOrderMap,precedenceMatrix:b.HungarianLangModel,mTypicalPositiveRatio:.947368,keepEnglishLetter:!0,charsetName:"windows-1250"}},{}],27:[function(a, d,b){b.TIS620CharToOrderMap=[255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253,253,182,106,107,100,183,184,185,101,94,186,187,108,109,110,111,188,189,190,89,95,112,113,191,192,193,194,253,253,253,253,253,253,64,72,73,114,74,115,116,102,81,201,117,90,103,78,82,96,202,91,79,84,104,105,97,98,92,203, 253,253,253,253,253,209,210,211,212,213,88,214,215,216,217,218,219,220,118,221,222,223,224,99,85,83,225,226,227,228,229,230,231,232,233,234,235,236,5,30,237,24,238,75,8,26,52,34,51,119,47,58,57,49,53,55,43,20,19,44,14,48,3,17,25,39,62,31,54,45,9,16,2,61,15,239,12,42,46,18,21,76,4,66,63,22,10,1,36,23,13,40,27,32,35,86,240,241,242,243,244,11,28,41,29,33,245,50,37,6,7,67,77,38,93,246,247,68,56,59,65,69,60,70,80,71,87,248,249,250,251,252,253];b.ThaiLangModel=[0,1,3,3,3,3,0,0,3,3,0,3,3,0,3,3,3,3,3,3,3, 3,0,0,3,3,3,0,3,3,3,3,0,3,3,0,0,0,1,3,0,3,3,2,3,3,0,1,2,3,3,3,3,0,2,0,2,0,0,3,2,1,2,2,3,0,3,3,2,3,0,0,3,3,0,3,3,0,3,3,3,3,3,3,3,3,3,0,3,2,3,0,2,2,2,3,0,2,3,0,0,0,0,1,0,1,2,3,1,1,3,2,2,0,1,1,0,0,1,0,0,0,0,0,0,0,1,1,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,3,3,2,3,2,3,3,2,2,2,3,1,2,3,0,3,3,2,2,1,2,3,3,1,2,0,1,3,0,1,0,0,1,0,0,0,0,0,0,0,1,1,3,3,2,2,3,3,3,3,1,2,3,3,3,3,3,2,2,2,2,3,3,2,2,3,3,2,2,3,2,3,2,2,3,3,1,2,3,1,2,2,3,3,1,0,2,1,0,0,3,1,2,1,0,0,1,0,0,0,0,0,0,1,0,1,3,3,3,3,3,3,2,2,3,3,3,3,2,3,2,2, 3,3,2,2,3,2,2,2,2,1,1,3,1,2,1,1,3,2,1,0,2,1,0,1,0,1,1,0,1,1,0,0,1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,3,3,3,2,3,2,3,3,2,2,3,2,3,3,2,3,1,1,2,3,2,2,2,3,2,2,2,2,2,1,2,1,2,2,1,1,3,3,2,1,0,1,2,2,0,1,3,0,0,0,1,1,0,0,0,0,0,2,3,0,0,2,1,1,3,3,2,3,3,2,0,0,3,3,0,3,3,0,2,2,3,1,2,2,1,1,1,0,2,2,2,0,2,2,1,1,0,2,1,0,2,0,0,2,0,1,0,0,1,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,0,3,3,2,3,3,2,0,0,3,3,0,2,3,0,2,1,2,2,2,2,1,2,0,0,2,2,2,0,2,2,1,1,0,2,1,0,2,0,0,2,0,1,1,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,3,3,2,3,2,3,2,0,2,2,1, 3,2,1,3,2,1,2,3,2,2,3,0,2,3,2,2,1,2,2,2,2,1,2,2,0,0,0,0,2,0,1,2,0,1,1,1,0,1,0,3,1,1,0,0,0,0,0,0,0,0,0,1,0,3,3,2,3,3,2,3,2,2,2,3,2,2,3,2,2,1,2,3,2,2,3,1,3,2,2,2,3,2,2,2,3,3,2,1,3,0,1,1,1,0,2,1,1,1,1,1,0,1,0,1,1,0,0,0,0,0,0,0,0,0,2,0,0,1,0,0,3,0,3,3,3,3,3,0,0,3,0,2,2,3,3,3,3,3,0,0,0,1,1,3,0,0,0,0,2,0,0,1,0,0,0,0,0,0,0,2,3,0,0,0,3,0,2,0,0,0,0,0,3,0,0,0,0,0,0,0,0,2,0,3,3,3,3,0,0,2,3,0,0,3,0,3,3,2,3,3,3,3,3,0,0,3,3,3,0,0,0,3,3,0,0,3,0,0,0,0,2,0,0,2,1,1,3,0,0,1,0,0,2,3,0,1,0,0,0,0,0,0,0,1,0,3,3,3,3,2,3, 3,3,3,3,3,3,1,2,1,3,3,2,2,1,2,2,2,3,1,1,2,0,2,1,2,1,2,2,1,0,0,0,1,1,0,1,0,1,1,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,3,0,2,1,2,3,3,3,0,2,0,2,2,0,2,1,3,2,2,1,2,1,0,0,2,2,1,0,2,1,2,2,0,1,1,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,2,1,3,3,1,1,3,0,2,3,1,1,3,2,1,1,2,0,2,2,3,2,1,1,1,1,1,2,3,0,0,1,3,1,2,1,2,0,3,0,0,0,1,0,3,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,3,3,1,1,3,2,3,3,3,1,3,2,1,3,2,1,3,2,2,2,2,1,3,3,1,2,1,3,1,2,3,0,2,1,1,3,2,2,2,1,2,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3, 3,2,3,2,3,3,2,3,2,3,2,3,3,2,1,0,3,2,2,2,1,2,2,2,1,2,2,1,2,1,1,2,2,2,3,0,1,3,1,1,1,1,0,1,1,0,2,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,2,3,2,2,1,1,3,2,3,2,3,2,0,3,2,2,1,2,0,2,2,2,1,2,2,2,2,1,3,2,1,2,2,1,0,2,0,1,0,0,1,1,0,0,0,0,0,1,1,0,1,0,0,0,0,0,0,0,0,1,3,3,3,3,3,2,3,1,2,3,3,2,2,3,0,1,1,2,0,3,3,2,2,3,0,1,1,3,0,0,0,0,3,1,0,3,3,0,2,0,2,1,0,0,3,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,2,3,2,3,3,0,1,3,1,1,2,1,2,1,1,3,1,1,0,2,3,1,1,1,1,1,1,1,1,3,1,1,2,2,2,2,1,1,1,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,1,3,2,2,1,1,2,1,3,3,2,3,2,2,3,2,2,3,1,2,2,1,2,0,3,2,1,2,2,2,2,2,1,3,2,1,2,2,2,1,1,1,1,0,0,1,1,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,3,1,3,3,0,2,1,0,3,2,0,0,3,1,0,1,1,0,1,0,0,0,0,0,1,1,0,0,1,0,3,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,2,2,2,3,0,0,1,3,0,3,2,0,3,2,2,3,3,3,3,3,1,0,2,2,2,0,2,2,1,2,0,2,3,0,0,0,0,1,0,1,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,0,2,3,1,3,3,2,3,3,0,3,3,0,3,2,2,3,2,3,3,3,0,0,2,2,3,0,1,1,1,3,0,0,3,0,0,0,2,2,0,1,3,0,1,2,2,2,3,0,0,0,0,0,1, 0,0,0,0,0,0,0,0,1,3,2,3,3,2,0,3,3,2,2,3,1,3,2,1,3,2,0,1,2,2,0,2,3,2,1,0,3,0,0,0,0,3,0,0,2,3,1,3,0,0,3,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,3,2,2,2,1,2,0,1,3,1,1,3,1,3,0,0,2,1,1,1,1,2,1,1,1,0,2,1,0,1,1,2,0,0,0,3,1,1,0,0,0,0,1,0,1,0,0,1,0,1,0,0,0,0,0,3,1,0,0,0,1,0,3,3,3,3,2,2,2,2,2,1,3,1,1,1,2,0,1,1,2,1,2,1,3,2,0,0,3,1,1,1,1,1,3,1,0,2,3,0,0,0,3,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,0,3,3,0,2,0,0,0,0,0,0,0,3,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,1,3,0,0,1,2,0,0,2,0,3,3,2,3,3,3,2,3,0,0,2,2,2,0,0,0,2,2,0,0,1,0,0,0,0,3,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,3,0,2,0,0,0,0,0,0,0,0,0,0,1,2,3,1,3,3,0,0,1,0,3,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,1,2,3,1,2,3,1,0,3,0,2,2,1,0,2,1,1,2,0,1,0,0,1,1,1,1,0,1,0,0,1,0,0,0,0,1,1,0,3,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,2,1,0,1,1,1,3,1,2,2,2,2,2,2,1,1,1,1,0,3,1,0,1,3,1,1,1,1,1,1,0,2,0,1,3,1,1,0,0,1,0, 0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,2,0,1,3,0,2,2,1,3,3,2,3,3,0,1,1,0,2,2,1,2,1,3,3,1,0,0,3,2,0,0,0,0,2,1,0,1,0,0,0,0,1,2,0,1,1,3,1,1,2,2,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,3,0,0,1,0,0,0,3,0,0,3,0,3,1,0,1,1,1,3,2,0,0,0,3,0,0,0,0,2,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,2,0,0,0,0,0,0,0,0,0,3,3,1,3,2,1,3,3,1,2,2,0,1,2,1,0,1,2,0,0,0,0,0,3,0,0,0,3,0,0,0,0,3,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,1,2,0,3,3,3,2,2,0,1,1,0,1,3,0,0,0,2,2,0,0,0,0,3,1,0,1,0,0,0,0,0,0,0,0,0,0,0, 0,1,0,1,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,2,3,1,2,0,0,2,1,0,3,1,0,1,2,0,1,1,1,1,3,0,0,3,1,1,0,2,2,1,1,0,2,0,0,0,0,0,1,0,1,0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,3,1,2,0,0,2,2,0,1,2,0,1,0,1,3,1,2,1,0,0,0,2,0,3,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,1,1,2,2,0,0,0,2,0,2,1,0,1,1,0,1,1,1,2,1,0,0,1,1,1,0,2,1,1,1,0,1,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,1,0,0,0,2,0,1,3,1,1,1,1,0,0,0,0,3,2,0,1,0,0,0,1,2,0,0,0,1,0,0,0,0,0,0,0, 3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,3,2,2,0,0,0,1,0,0,0,0,2,3,2,1,2,2,3,0,0,0,2,3,1,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,1,0,1,0,0,0,0,0,0,0,0,0,3,3,2,2,0,1,0,0,0,0,2,0,2,0,1,0,0,0,1,1,0,0,0,2,1,0,1,0,1,1,0,0,0,1,0,2,0,0,1,0,3,0,1,0,0,0,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,1,0,0,1,0,0,0,0,0,1,1,2,0,0,0,0,1,0,0,1,3,1,0,0,0,0,1,1, 0,0,0,1,0,0,0,0,3,0,0,0,0,0,0,3,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,3,3,1,1,1,1,2,3,0,0,2,1,1,1,1,1,0,2,1,1,0,0,0,2,1,0,1,2,1,1,0,1,2,1,0,3,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,1,0,0,0,0,0,0,0,3,0,0,0,3,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,0,0,0,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,2,0,0,0,0,0,0,1,2,1,0,1,1,0,2,0,0,1,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,1,3,0,1,0,0,0,2,0,0,0,0,0,0,0,1,2,0,0,0,0,0,3,3,0,0,1,1,2,0,0,1,2,1,0,1,1,1,0,1,1,0,0,2,1,1,0, 1,0,0,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,1,0,0,0,0,1,0,0,0,0,3,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,2,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,0,0,1,1,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,2,0,1,2,0,0,1,1,0,2,0,1,0,0,1,0, 0,0,0,1,0,0,0,2,0,0,0,0,1,0,0,1,0,1,1,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,0,1,1,0,2,1,3,0,0,0,0,1,1,0,0,0,0,0,0,0,3,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,1,0,1,0,0,2,0,0,2,0,0,1,1,2,0,0,1,1,0,0,0,1,0,0,0,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,1,0,0,3,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,1,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,2,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,3,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,2,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,2,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];b.TIS620ThaiModel={charToOrderMap:b.TIS620CharToOrderMap,precedenceMatrix:b.ThaiLangModel,mTypicalPositiveRatio:.926386,keepEnglishLetter:!1,charsetName:"TIS-620"}},{}],28:[function(a,d,b){function c(){f.apply(this);this.reset=function(){this._mLastCharClass=1;this._mFreqCounter=[];for(var a=0;4>a;this._mFreqCounter[a++]=0);c.prototype.reset.apply(this)};this.getCharsetName=function(){return"windows-1252"}; this.feed=function(a){a=this.filterWithEnglishLetters(a);for(var b=0;bb||(a=this._mFreqCounter[3]/b-20*this._mFreqCounter[1]/b);0>a&&(a=0);return.95*a};this.reset()}var f= a("./charsetprober"),g=a("./constants"),e=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,1,1,1,1,1,0,1,7,1,1,1,1,1,1,5,1,5,0,5,0,0,1,1,1,1,1,1,1,1,1,7,1,7,0,7,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,4,4,4,4,4,5,5,4,4,4,4,4,4,4,4,5,5,4,4,4,4,4,1,4,4,4,4,4,5,5,5,6,6,6,6,6, 6,7,7,6,6,6,6,6,6,6,6,7,7,6,6,6,6,6,1,6,6,6,6,6,7,7,7],m=[0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,3,0,3,3,3,3,3,3,3,0,3,3,3,1,1,3,3,0,3,3,3,1,2,1,2,0,3,3,3,3,3,3,3,0,3,1,3,1,1,1,3,0,3,1,3,1,1,3,3];c.prototype=new f;d.exports=c},{"./charsetprober":6,"./constants":8}],29:[function(a,d,b){b.log=function(){};b.setLogger=function(a){b.enabled=!0;b.log=a}},{}],30:[function(a,d,b){function c(){f.apply(this);this.reset=function(){c.prototype.reset.apply(this);this._mCodingSM&&this._mCodingSM.reset();this._mDistributionAnalyzer&& this._mDistributionAnalyzer.reset();this._mLastChar="\x00\x00"};this.getCharsetName=function(){};this.feed=function(a){for(var b=a.length,c=0;cg.SHORTCUT_THRESHOLD&&(this._mState=g.foundIt);return this.getState()};this.getConfidence=function(){return this._mDistributionAnalyzer.getConfidence()}}var f=a("./charsetprober"),g=a("./constants"),e=a("./logger");c.prototype=new f;d.exports=c},{"./charsetprober":6,"./constants":8,"./logger":29}],31:[function(a,d,b){function c(){f.apply(this);this._mProbers=[new e, new m,new k,new h,new l,new g,new n];this.reset()}var f=a("./charsetgroupprober"),g=a("./big5prober"),e=a("./utf8prober"),m=a("./sjisprober"),k=a("./eucjpprober"),h=a("./gb2312prober"),l=a("./euckrprober"),n=a("./euctwprober");c.prototype=new f;d.exports=c},{"./big5prober":3,"./charsetgroupprober":5,"./eucjpprober":11,"./euckrprober":13,"./euctwprober":15,"./gb2312prober":17,"./sjisprober":41,"./utf8prober":43}],32:[function(a,d,b){a=a("../constants");d.exports={classTable:[1,1,1,1,1,1,1,1,1,1,1, 1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0],classFactor:5, stateTable:[a.error,a.start,a.start,3,a.error,a.error,a.error,a.error,a.error,a.error,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.error,a.error,a.start,a.start,a.start,a.start,a.start,a.start,a.start],charLenTable:[0,1,1,2,0],name:"Big5"}},{"../constants":8}],33:[function(a,d,b){a=a("../constants");d.exports={classTable:[4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,4,4,4,4,4,4,4,4,4,4,4,5,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,1,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5],classFactor:6,stateTable:[3,4,3,5,a.start,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.start,a.error,a.start, a.error,a.error,a.error,a.error,a.error,a.start,a.error,a.error,a.error,3,a.error,3,a.error,a.error,a.error,a.start,a.start,a.start,a.start],charLenTable:[2,2,2,3,1,0],name:"EUC-JP"}},{"../constants":8}],34:[function(a,d,b){a=a("../constants");d.exports={classTable:[1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0],classFactor:4,stateTable:[a.error,a.start,3,a.error,a.error,a.error,a.error,a.error,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.error,a.error,a.start,a.start],charLenTable:[0,1,2,0],name:"EUC-KR"}},{"../constants":8}],35:[function(a, d,b){a=a("../constants");d.exports={classTable:[2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,4,4,4,4,4,4,5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0],classFactor:7,stateTable:[a.error,a.error,a.start,3,3,3,4,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.error,a.start,a.error,a.start,a.start,a.start,a.error,a.error,a.error,a.error,a.error,5,a.error,a.error,a.error,a.start,a.error,a.start,a.start,a.start,a.error,a.start,a.start,a.start,a.start,a.start,a.start],charLenTable:[0,0,1,2,2,2,3],name:"x-euc-tw"}},{"../constants":8}], 36:[function(a,d,b){a=a("../constants");d.exports={classTable:[1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,3,3,3,3,3,3,3,3,3,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,4,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,0],classFactor:7,stateTable:[a.error,a.start,a.start,a.start,a.start,a.start,3,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.error,a.error,a.start,4,a.error,a.start,a.start,a.error,a.error,a.error,a.error,a.error,a.error,5,a.error,a.error,a.error,a.itsMe,a.error,a.error,a.error,a.start,a.start,a.start,a.start,a.start,a.start],charLenTable:[0,1,1,1,1,1,2],name:"GB2312"}}, {"../constants":8}],37:[function(a,d,b){a=a("../constants");d.exports={classTable:[1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,0,0,0],classFactor:6,stateTable:[a.error,a.start,a.start,3,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.error,a.error,a.start,a.start,a.start,a.start],charLenTable:[0,1,1,2,0,0],name:"Shift_JIS"}},{"../constants":8}],38:[function(a,d,b){a=a("../constants");d.exports={classTable:[1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,0,0,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,8,8,8,8,8,8,8,8,8,8,8,8,9,8,8,10,11,11,11,11,11,11,11,12,13,13,13,14,15,0,0],classFactor:16,stateTable:[a.error,a.start, a.error,a.error,a.error,a.error,12,10,9,11,8,7,6,5,4,3,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.itsMe,a.error,a.error,5,5,5,5,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,5,5,5,a.error,a.error,a.error,a.error,a.error,a.error,a.error, a.error,a.error,a.error,a.error,a.error,7,7,7,7,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,7,7,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,9,9,9,9,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,9,9,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,12,12,12,12,a.error,a.error, a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,12,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,12,12,12,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.start,a.start,a.start,a.start,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error,a.error],charLenTable:[0,1,0,0,0,0,2,3,3,3,4,4,5,5,6,6],name:"UTF-8"}},{"../constants":8}], 39:[function(a,d,b){function c(a,b,d){f.apply(this);var l=this;this.reset=function(){c.prototype.reset.apply(this);this._mLastOrder=255;this._mSeqCounters=[];for(var a=0;4>a;this._mSeqCounters[a++]=0);this._mFreqChar=this._mTotalChar=this._mTotalSeqs=0};this.getCharsetName=function(){return this._mNameProber?this._mNameProber.getCharsetName():this._mModel.charsetName};this.feed=function(a){this._mModel.keepEnglishLetter||(a=this.filterWithoutEnglishLetters(a));var b=a.length;if(!b)return this.getState(); for(var c=0,d;cd&&this._mTotalChar++,64>d&&(this._mFreqChar++,64>this._mLastOrder&&(this._mTotalSeqs++,this._mReversed?this._mSeqCounters[this._mModel.precedenceMatrix[64*d+this._mLastOrder]]++:this._mSeqCounters[this._mModel.precedenceMatrix[64*this._mLastOrder+d]]++)),this._mLastOrder=d;this.getState()==g.detecting&&1024a&&(e.log(this._mModel.charsetName+" confidence = "+a+", below negative shortcut threshhold 0.05\n"),this._mState=g.notMe));return this.getState()};this.getConfidence=function(){var a=.01;0h.SHORTCUT_THRESHOLD&&(this._mState=h.foundIt);return this.getState()}; this.getConfidence=function(){var a=this._mContextAnalyzer.getConfidence(),b=this._mDistributionAnalyzer.getConfidence();return Math.max(a,b)};this._mCodingSM=new f(e);this._mDistributionAnalyzer=new m;this._mContextAnalyzer=new k;this.reset()}var f=a("./codingstatemachine"),g=a("./mbcharsetprober"),e=a("./mbcssm/sjis"),m=a("./chardistribution").SJISDistributionAnalysis,k=a("./jpcntx").SJISContextAnalysis,h=a("./constants"),l=a("./logger");c.prototype=new g;d.exports=c},{"./chardistribution":4,"./codingstatemachine":7, "./constants":8,"./jpcntx":21,"./logger":29,"./mbcharsetprober":30,"./mbcssm/sjis":37}],42:[function(a,d,b){var c=a("./constants"),f=a("./mbcsgroupprober"),g=a("./sbcsgroupprober"),e=a("./latin1prober"),m=a("./escprober"),k=a("./logger");d.exports=function(a){a||(a={});a.minimumThreshold||(a.minimumThreshold=.2);this.reset=function(){this.result={encoding:null,confidence:0};this.results=[];this.done=!1;this._mStart=!0;this._mGotData=!1;this._mInputState=0;this._mBOM=this._mLastChar="";this._mEscCharsetProber&& this._mEscCharsetProber.reset();for(var a=0,b;b=this._mCharsetProbers[a];a++)b.reset()};this.feed=function(a){if(!this.done&&a.length)if(this._mGotData||(this._mBOM+=a,"\u00ef\u00bb\u00bf"==this._mBOM.slice(0,3)?this.result={encoding:"UTF-8",confidence:1}:"\u00ff\u00fe\x00\x00"==this._mBOM.slice(0,4)?this.result={encoding:"UTF-32LE",confidence:1}:"\x00\x00\u00fe\u00ff"==this._mBOM.slice(0,4)?this.result={encoding:"UTF-32BE",confidence:1}:"\u00fe\u00ff\x00\x00"==this._mBOM.slice(0,4)?this.result={encoding:"X-ISO-10646-UCS-4-3412", confidence:1}:"\x00\x00\u00ff\u00fe"==this._mBOM.slice(0,4)?this.result={encoding:"X-ISO-10646-UCS-4-2143",confidence:1}:"\u00ff\u00fe"==this._mBOM.slice(0,2)?this.result={encoding:"UTF-16LE",confidence:1}:"\u00fe\u00ff"==this._mBOM.slice(0,2)&&(this.result={encoding:"UTF-16BE",confidence:1}),0=a.minimumThreshold))return this.result=b}if(k.enabled)for(k.log("no probers hit minimum threshhold\n"),b=0;c=this._mCharsetProbers[b];b++)c&&k.log(c.getCharsetName()+" confidence = "+c.getConfidence()+"\n")}};this._highBitDetector=/[\x80-\xFF]/; this._escDetector=/(\x1B|~\{)/;this._mEscCharsetProber=null;this._mCharsetProbers=[];this.reset()}},{"./constants":8,"./escprober":9,"./latin1prober":28,"./logger":29,"./mbcsgroupprober":31,"./sbcsgroupprober":40}],43:[function(a,d,b){function c(){g.apply(this);this.reset=function(){c.prototype.reset.apply(this);this._mCodingSM.reset();this._mBasicAsciiLen=this._mFullLen=this._mMBCharLen=this._mNumOfMBChar=0};this.getCharsetName=function(){return"UTF-8"};this.feed=function(a){this._mFullLen+=a.length; for(var b=0,c;bc.charCodeAt(0)&&this._mBasicAsciiLen++)}this.getState()==e.detecting&&this.getConfidence()>e.SHORTCUT_THRESHOLD&&(this._mState=e.foundIt);return this.getState()};this.getConfidence=function(){var a=.99, b=0,c=this._mFullLen-this._mBasicAsciiLen;0this._mNumOfMBChar&&.6>=b?(a*=Math.pow(.5,this._mNumOfMBChar),1-a):a};this._mCodingSM=new f(m);this.reset()}var f=a("./codingstatemachine"),g=a("./charsetprober"),e=a("./constants"),m=a("./mbcssm/utf8");c.prototype=new g;d.exports=c},{"./charsetprober":6,"./codingstatemachine":7,"./constants":8,"./mbcssm/utf8":38}]},{},[1])(1)}); Copyright (c) 2013 GitHub Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "main": "./lib/keytar.js", "typings": "keytar.d.ts", "name": "keytar", "description": "Bindings to native Mac/Linux/Windows password APIs", "version": "7.9.0", "license": "MIT", "repository": { "type": "git", "url": "https://github.com/atom/node-keytar.git" }, "bugs": { "url": "https://github.com/atom/node-keytar/issues" }, "homepage": "http://atom.github.io/node-keytar", "keywords": [ "keychain", "password", "passwords", "credential", "credentials", "vault", "credential vault" ], "files": [ "lib", "src", "binding.gyp", "keytar.d.ts" ], "types": "./keytar.d.ts", "scripts": { "install": "prebuild-install || npm run build", "build": "node-gyp rebuild", "lint": "npm run cpplint", "cpplint": "node-cpplint --filters legal-copyright,build-include,build-namespaces src/*.cc", "test": "npm run lint && npm rebuild && mocha --require babel-core/register spec/", "prebuild-napi-x64": "prebuild -t 3 -r napi -a x64 --strip", "prebuild-napi-ia32": "prebuild -t 3 -r napi -a ia32 --strip", "prebuild-napi-arm64": "prebuild -t 3 -r napi -a arm64 --strip", "prebuild-napi-armv7l": "prebuild -t 3 -r napi -a armv7l --strip", "upload": "node ./script/upload.js" }, "devDependencies": { "babel-core": "^6.26.3", "babel-plugin-transform-async-to-generator": "^6.24.1", "chai": "^4.2.0", "mocha": "^9.2.0", "node-cpplint": "~0.4.0", "node-gyp": "^8.4.1", "prebuild": "^11.0.2" }, "dependencies": { "node-addon-api": "^4.3.0", "prebuild-install": "^7.0.1" }, "binary": { "napi_versions": [ 3 ] }, "config": { "runtime": "napi", "target": 3 } } var keytar = require('../build/Release/keytar.node') function checkRequired(val, name) { if (!val || val.length <= 0) { throw new Error(name + ' is required.'); } } module.exports = { getPassword: function (service, account) { checkRequired(service, 'Service') checkRequired(account, 'Account') return keytar.getPassword(service, account) }, setPassword: function (service, account, password) { checkRequired(service, 'Service') checkRequired(account, 'Account') checkRequired(password, 'Password') return keytar.setPassword(service, account, password) }, deletePassword: function (service, account) { checkRequired(service, 'Service') checkRequired(account, 'Account') return keytar.deletePassword(service, account) }, findPassword: function (service) { checkRequired(service, 'Service') return keytar.findPassword(service) }, findCredentials: function (service) { checkRequired(service, 'Service') return keytar.findCredentials(service) } } module.exports = function (args, opts) { if (!opts) opts = {}; var flags = { bools : {}, strings : {}, unknownFn: null }; if (typeof opts['unknown'] === 'function') { flags.unknownFn = opts['unknown']; } if (typeof opts['boolean'] === 'boolean' && opts['boolean']) { flags.allBools = true; } else { [].concat(opts['boolean']).filter(Boolean).forEach(function (key) { flags.bools[key] = true; }); } var aliases = {}; Object.keys(opts.alias || {}).forEach(function (key) { aliases[key] = [].concat(opts.alias[key]); aliases[key].forEach(function (x) { aliases[x] = [key].concat(aliases[key].filter(function (y) { return x !== y; })); }); }); [].concat(opts.string).filter(Boolean).forEach(function (key) { flags.strings[key] = true; if (aliases[key]) { flags.strings[aliases[key]] = true; } }); var defaults = opts['default'] || {}; var argv = { _ : [] }; Object.keys(flags.bools).forEach(function (key) { setArg(key, defaults[key] === undefined ? false : defaults[key]); }); var notFlags = []; if (args.indexOf('--') !== -1) { notFlags = args.slice(args.indexOf('--')+1); args = args.slice(0, args.indexOf('--')); } function argDefined(key, arg) { return (flags.allBools && /^--[^=]+$/.test(arg)) || flags.strings[key] || flags.bools[key] || aliases[key]; } function setArg (key, val, arg) { if (arg && flags.unknownFn && !argDefined(key, arg)) { if (flags.unknownFn(arg) === false) return; } var value = !flags.strings[key] && isNumber(val) ? Number(val) : val ; setKey(argv, key.split('.'), value); (aliases[key] || []).forEach(function (x) { setKey(argv, x.split('.'), value); }); } function setKey (obj, keys, value) { var o = obj; for (var i = 0; i < keys.length-1; i++) { var key = keys[i]; if (isConstructorOrProto(o, key)) return; if (o[key] === undefined) o[key] = {}; if (o[key] === Object.prototype || o[key] === Number.prototype || o[key] === String.prototype) o[key] = {}; if (o[key] === Array.prototype) o[key] = []; o = o[key]; } var key = keys[keys.length - 1]; if (isConstructorOrProto(o, key)) return; if (o === Object.prototype || o === Number.prototype || o === String.prototype) o = {}; if (o === Array.prototype) o = []; if (o[key] === undefined || flags.bools[key] || typeof o[key] === 'boolean') { o[key] = value; } else if (Array.isArray(o[key])) { o[key].push(value); } else { o[key] = [ o[key], value ]; } } function aliasIsBoolean(key) { return aliases[key].some(function (x) { return flags.bools[x]; }); } for (var i = 0; i < args.length; i++) { var arg = args[i]; if (/^--.+=/.test(arg)) { // Using [\s\S] instead of . because js doesn't support the // 'dotall' regex modifier. See: // http://stackoverflow.com/a/1068308/13216 var m = arg.match(/^--([^=]+)=([\s\S]*)$/); var key = m[1]; var value = m[2]; if (flags.bools[key]) { value = value !== 'false'; } setArg(key, value, arg); } else if (/^--no-.+/.test(arg)) { var key = arg.match(/^--no-(.+)/)[1]; setArg(key, false, arg); } else if (/^--.+/.test(arg)) { var key = arg.match(/^--(.+)/)[1]; var next = args[i + 1]; if (next !== undefined && !/^-/.test(next) && !flags.bools[key] && !flags.allBools && (aliases[key] ? !aliasIsBoolean(key) : true)) { setArg(key, next, arg); i++; } else if (/^(true|false)$/.test(next)) { setArg(key, next === 'true', arg); i++; } else { setArg(key, flags.strings[key] ? '' : true, arg); } } else if (/^-[^-]+/.test(arg)) { var letters = arg.slice(1,-1).split(''); var broken = false; for (var j = 0; j < letters.length; j++) { var next = arg.slice(j+2); if (next === '-') { setArg(letters[j], next, arg) continue; } if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) { setArg(letters[j], next.split('=')[1], arg); broken = true; break; } if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { setArg(letters[j], next, arg); broken = true; break; } if (letters[j+1] && letters[j+1].match(/\W/)) { setArg(letters[j], arg.slice(j+2), arg); broken = true; break; } else { setArg(letters[j], flags.strings[letters[j]] ? '' : true, arg); } } var key = arg.slice(-1)[0]; if (!broken && key !== '-') { if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1]) && !flags.bools[key] && (aliases[key] ? !aliasIsBoolean(key) : true)) { setArg(key, args[i+1], arg); i++; } else if (args[i+1] && /^(true|false)$/.test(args[i+1])) { setArg(key, args[i+1] === 'true', arg); i++; } else { setArg(key, flags.strings[key] ? '' : true, arg); } } } else { if (!flags.unknownFn || flags.unknownFn(arg) !== false) { argv._.push( flags.strings['_'] || !isNumber(arg) ? arg : Number(arg) ); } if (opts.stopEarly) { argv._.push.apply(argv._, args.slice(i + 1)); break; } } } Object.keys(defaults).forEach(function (key) { if (!hasKey(argv, key.split('.'))) { setKey(argv, key.split('.'), defaults[key]); (aliases[key] || []).forEach(function (x) { setKey(argv, x.split('.'), defaults[key]); }); } }); if (opts['--']) { argv['--'] = new Array(); notFlags.forEach(function(key) { argv['--'].push(key); }); } else { notFlags.forEach(function(key) { argv._.push(key); }); } return argv; }; function hasKey (obj, keys) { var o = obj; keys.slice(0,-1).forEach(function (key) { o = (o[key] || {}); }); var key = keys[keys.length - 1]; return key in o; } function isNumber (x) { if (typeof x === 'number') return true; if (/^0x[0-9a-f]+$/i.test(x)) return true; return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); } function isConstructorOrProto (obj, key) { return key === 'constructor' && typeof obj[key] === 'function' || key === '__proto__'; } This software is released under the MIT license: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "minimist", "version": "1.2.6", "description": "parse argument options", "main": "index.js", "devDependencies": { "covert": "^1.0.0", "tap": "~0.4.0", "tape": "^3.5.0" }, "scripts": { "test": "tap test/*.js", "coverage": "covert test/*.js" }, "testling": { "files": "test/*.js", "browsers": [ "ie/6..latest", "ff/5", "firefox/latest", "chrome/10", "chrome/latest", "safari/5.1", "safari/latest", "opera/12" ] }, "repository": { "type": "git", "url": "git://github.com/substack/minimist.git" }, "homepage": "https://github.com/substack/minimist", "keywords": [ "argv", "getopt", "parser", "optimist" ], "author": { "name": "James Halliday", "email": "mail@substack.net", "url": "http://substack.net" }, "license": "MIT" } 'use strict'; let lib = null; let tried = false; let returned = false; let retValue = false; module.exports = function isElevated () { if (returned) { return retValue; } if (!tried) { // Prevent multiple failed require attempts tried = true; try { lib = require('./build/Release/iselevated'); } catch (err) { console.error(err); } } if (!lib) { return false; } try { // Cache the result for subsequent calls returned = true; retValue = lib.isElevated(); } catch (err) { console.error(err); } return retValue; }; MIT License Copyright (c) 2016 Eugene Cheung Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "native-is-elevated", "version": "0.4.3", "description": "Native module for checking if the process is being run with elevated privileges", "main": "index.js", "types": "index.d.ts", "engine": { "node": ">=10.0.0" }, "scripts": { "configure": "node-gyp configure", "build": "node-gyp build", "test": "ava" }, "repository": { "type": "git", "url": "git+https://github.com/arkon/native-is-elevated.git" }, "author": "Eugene Cheung", "license": "MIT", "bugs": { "url": "https://github.com/arkon/native-is-elevated/issues" }, "homepage": "https://github.com/arkon/native-is-elevated#readme", "devDependencies": { "ava": "^3.13.0" } } const test = require('ava').serial; const isElevated = require('..'); // Note that 1 of the 2 tests will fail depending on if you're running // it normally, or with root/admin rights test('normal', t => { t.false(isElevated()); }); test('elevated', t => { t.true(isElevated()); }); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ function NativeBinding() { this._tried = false; this._keymapping = null; } NativeBinding.prototype._init = function() { if (this._tried) { return; } this._tried = true; this._keymapping = require('./build/Release/keymapping'); }; NativeBinding.prototype.getKeyMap = function() { try { this._init(); return this._keymapping.getKeyMap(); } catch(err) { console.error(err); return []; } }; NativeBinding.prototype.getCurrentKeyboardLayout = function() { try { this._init(); return this._keymapping.getCurrentKeyboardLayout(); } catch(err) { console.error(err); return null; } }; NativeBinding.prototype.onDidChangeKeyboardLayout = function(callback) { try { this._init(); this._keymapping.onDidChangeKeyboardLayout(callback); } catch(err) { console.error(err); } } NativeBinding.prototype.isISOKeyboard = function(callback) { try { this._init(); return this._keymapping.isISOKeyboard(); } catch(err) { return false; } } var binding = new NativeBinding(); exports.getCurrentKeyboardLayout = function() { return binding.getCurrentKeyboardLayout(); }; exports.getKeyMap = function() { return binding.getKeyMap(); }; exports.onDidChangeKeyboardLayout = function(callback) { return binding.onDidChangeKeyboardLayout(callback); }; exports.isISOKeyboard = function(callback) { return binding.isISOKeyboard(callback); }; Copyright (c) Microsoft Corporation All rights reserved. MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.{ "name": "native-keymap", "version": "3.3.0", "description": "Get OS key mapping", "main": "index.js", "typings": "index.d.ts", "scripts": { "test": "node test/test.js" }, "repository": { "type": "git", "url": "git+https://github.com/Microsoft/node-native-keymap.git" }, "author": "Microsoft Corporation", "license": "MIT", "bugs": { "url": "https://github.com/Microsoft/node-native-keymap/issues" }, "homepage": "https://github.com/Microsoft/node-native-keymap#readme" } ## Security Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below. ## Reporting Security Issues **Please do not report security vulnerabilities through public GitHub issues.** Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) * Full paths of source file(s) related to the manifestation of the issue * The location of the affected source code (tag/branch/commit or direct URL) * Any special configuration required to reproduce the issue * Step-by-step instructions to reproduce the issue * Proof-of-concept or exploit code (if possible) * Impact of the issue, including how an attacker might exploit the issue This information will help us triage your report more quickly. If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. ## Preferred Languages We prefer all communications to be in English. ## Policy Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). THIRD-PARTY SOFTWARE NOTICES AND INFORMATION Do Not Translate or Localize This project incorporates material from the project(s) listed below (collectively, “Third Party Code”). Microsoft is not the original author of the Third Party Code. The original copyright notice and license under which Microsoft received such Third Party Code are set out below. This Third Party Code is licensed to you under their original license terms set forth below. Microsoft reserves all other rights not expressly granted, whether by implication, estoppel or otherwise. The following files/folders contain third party software: ========================================================================================================= deps/chromium/** --------------------------------------------------------------------------------------------------------- // Copyright 2015 The Chromium Authors. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ========================================================================================================= /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------*/ var watchdog = require('./build/Release/watchdog'); var hasStarted = false; exports.start = function(pid) { if (typeof pid !== 'number' || Math.round(pid) !== pid) { throw new Error(`Expected integer pid!`); } if (hasStarted) { throw new Error(`Can only monitor a single process!`); } hasStarted = true; watchdog.start(pid); } exports.exit = function(code) { watchdog.exit(code || 0); } MIT License Copyright (c) Microsoft Corporation. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE { "name": "native-watchdog", "version": "1.4.0", "description": "A native module that kills the current process if the event loop is unresponsive", "main": "index.js", "typings": "index.d.ts", "scripts": { "test": "node test/test.js" }, "repository": { "type": "git", "url": "git+https://github.com/Microsoft/node-native-watchdog.git" }, "author": "Microsoft Corporation", "license": "MIT", "bugs": { "url": "https://github.com/Microsoft/node-native-watchdog/issues" }, "homepage": "https://github.com/Microsoft/node-native-watchdog#readme" } ## Security Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below. ## Reporting Security Issues **Please do not report security vulnerabilities through public GitHub issues.** Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) * Full paths of source file(s) related to the manifestation of the issue * The location of the affected source code (tag/branch/commit or direct URL) * Any special configuration required to reproduce the issue * Step-by-step instructions to reproduce the issue * Proof-of-concept or exploit code (if possible) * Impact of the issue, including how an attacker might exploit the issue This information will help us triage your report more quickly. If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. ## Preferred Languages We prefer all communications to be in English. ## Policy Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). Copyright (c) 2012-2015, Christopher Jeffrey (https://github.com/chjj/) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. The MIT License (MIT) Copyright (c) 2016, Daniel Imms (http://www.growingwiththeweb.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. MIT License Copyright (c) 2018 - present Microsoft Corporation All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "node-pty", "description": "Fork pseudoterminals in Node.JS", "author": { "name": "Microsoft Corporation" }, "version": "0.11.0-beta11", "license": "MIT", "main": "./lib/index.js", "types": "./typings/node-pty.d.ts", "repository": { "type": "git", "url": "git://github.com/microsoft/node-pty.git" }, "files": [ "binding.gyp", "lib/", "scripts/", "src/", "deps/", "typings/" ], "homepage": "https://github.com/microsoft/node-pty", "bugs": { "url": "https://github.com/microsoft/node-pty/issues" }, "keywords": [ "pty", "tty", "terminal", "pseudoterminal", "forkpty", "openpty" ], "scripts": { "build": "tsc -b ./src/tsconfig.json", "watch": "tsc -b -w ./src/tsconfig.json", "lint": "eslint -c .eslintrc.js --ext .ts src/", "install": "node scripts/install.js", "postinstall": "node scripts/post-install.js", "test": "cross-env NODE_ENV=test mocha -R spec --exit lib/*.test.js", "posttest": "npm run lint", "prepare": "npm run build", "prepublishOnly": "npm run build" }, "dependencies": { "nan": "^2.14.0" }, "devDependencies": { "@types/mocha": "^7.0.2", "@types/node": "12", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "cross-env": "^5.1.4", "eslint": "^6.8.0", "mocha": "^7.1.1", "ps-list": "^6.0.0", "typescript": "^3.8.3" } }"use strict"; /** * Copyright (c) 2019, Microsoft Corporation (MIT License). * * This module fetches the console process list for a particular PID. It must be * called from a different process (child_process.fork) as there can only be a * single console attached to a process. */ var getConsoleProcessList; try { getConsoleProcessList = require('../build/Release/conpty_console_list.node').getConsoleProcessList; } catch (err) { getConsoleProcessList = require('../build/Debug/conpty_console_list.node').getConsoleProcessList; } var shellPid = parseInt(process.argv[2], 10); var consoleProcessList = getConsoleProcessList(shellPid); process.send({ consoleProcessList: consoleProcessList }); process.exit(0);//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/node-pty/lib/conpty_console_list_agent.js.map"use strict"; /** * Copyright (c) 2019, Microsoft Corporation (MIT License). */ Object.defineProperty(exports, "__esModule", { value: true }); exports.EventEmitter2 = void 0; var EventEmitter2 = /** @class */ (function () { function EventEmitter2() { this._listeners = []; } Object.defineProperty(EventEmitter2.prototype, "event", { get: function () { var _this = this; if (!this._event) { this._event = function (listener) { _this._listeners.push(listener); var disposable = { dispose: function () { for (var i = 0; i < _this._listeners.length; i++) { if (_this._listeners[i] === listener) { _this._listeners.splice(i, 1); return; } } } }; return disposable; }; } return this._event; }, enumerable: false, configurable: true }); EventEmitter2.prototype.fire = function (data) { var queue = []; for (var i = 0; i < this._listeners.length; i++) { queue.push(this._listeners[i]); } for (var i = 0; i < queue.length; i++) { queue[i].call(undefined, data); } }; return EventEmitter2; }()); exports.EventEmitter2 = EventEmitter2;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/node-pty/lib/eventEmitter2.js.map"use strict"; /** * Copyright (c) 2012-2015, Christopher Jeffrey, Peter Sunde (MIT License) * Copyright (c) 2016, Daniel Imms (MIT License). * Copyright (c) 2018, Microsoft Corporation (MIT License). */ Object.defineProperty(exports, "__esModule", { value: true }); exports.native = exports.open = exports.createTerminal = exports.fork = exports.spawn = void 0; var terminalCtor; if (process.platform === 'win32') { terminalCtor = require('./windowsTerminal').WindowsTerminal; } else { terminalCtor = require('./unixTerminal').UnixTerminal; } /** * Forks a process as a pseudoterminal. * @param file The file to launch. * @param args The file's arguments as argv (string[]) or in a pre-escaped * CommandLine format (string). Note that the CommandLine option is only * available on Windows and is expected to be escaped properly. * @param options The options of the terminal. * @throws When the file passed to spawn with does not exists. * @see CommandLineToArgvW https://msdn.microsoft.com/en-us/library/windows/desktop/bb776391(v=vs.85).aspx * @see Parsing C++ Comamnd-Line Arguments https://msdn.microsoft.com/en-us/library/17w5ykft.aspx * @see GetCommandLine https://msdn.microsoft.com/en-us/library/windows/desktop/ms683156.aspx */ function spawn(file, args, opt) { return new terminalCtor(file, args, opt); } exports.spawn = spawn; /** @deprecated */ function fork(file, args, opt) { return new terminalCtor(file, args, opt); } exports.fork = fork; /** @deprecated */ function createTerminal(file, args, opt) { return new terminalCtor(file, args, opt); } exports.createTerminal = createTerminal; function open(options) { return terminalCtor.open(options); } exports.open = open; /** * Expose the native API when not Windows, note that this is not public API and * could be removed at any time. */ exports.native = (process.platform !== 'win32' ? require('../build/Release/pty.node') : null);//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/node-pty/lib/index.js.map"use strict"; /** * Copyright (c) 2016, Daniel Imms (MIT License). * Copyright (c) 2018, Microsoft Corporation (MIT License). */ Object.defineProperty(exports, "__esModule", { value: true });//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/node-pty/lib/interfaces.js.map"use strict"; /** * Copyright (c) 2012-2015, Christopher Jeffrey (MIT License) * Copyright (c) 2016, Daniel Imms (MIT License). * Copyright (c) 2018, Microsoft Corporation (MIT License). */ Object.defineProperty(exports, "__esModule", { value: true }); exports.Terminal = exports.DEFAULT_ROWS = exports.DEFAULT_COLS = void 0; var events_1 = require("events"); var eventEmitter2_1 = require("./eventEmitter2"); exports.DEFAULT_COLS = 80; exports.DEFAULT_ROWS = 24; /** * Default messages to indicate PAUSE/RESUME for automatic flow control. * To avoid conflicts with rebound XON/XOFF control codes (such as on-my-zsh), * the sequences can be customized in `IPtyForkOptions`. */ var FLOW_CONTROL_PAUSE = '\x13'; // defaults to XOFF var FLOW_CONTROL_RESUME = '\x11'; // defaults to XON var Terminal = /** @class */ (function () { function Terminal(opt) { this._onData = new eventEmitter2_1.EventEmitter2(); this._onExit = new eventEmitter2_1.EventEmitter2(); // for 'close' this._internalee = new events_1.EventEmitter(); if (!opt) { return; } // Do basic type checks here in case node-pty is being used within JavaScript. If the wrong // types go through to the C++ side it can lead to hard to diagnose exceptions. this._checkType('name', opt.name ? opt.name : undefined, 'string'); this._checkType('cols', opt.cols ? opt.cols : undefined, 'number'); this._checkType('rows', opt.rows ? opt.rows : undefined, 'number'); this._checkType('cwd', opt.cwd ? opt.cwd : undefined, 'string'); this._checkType('env', opt.env ? opt.env : undefined, 'object'); this._checkType('uid', opt.uid ? opt.uid : undefined, 'number'); this._checkType('gid', opt.gid ? opt.gid : undefined, 'number'); this._checkType('encoding', opt.encoding ? opt.encoding : undefined, 'string'); // setup flow control handling this.handleFlowControl = !!(opt.handleFlowControl); this._flowControlPause = opt.flowControlPause || FLOW_CONTROL_PAUSE; this._flowControlResume = opt.flowControlResume || FLOW_CONTROL_RESUME; } Object.defineProperty(Terminal.prototype, "onData", { get: function () { return this._onData.event; }, enumerable: false, configurable: true }); Object.defineProperty(Terminal.prototype, "onExit", { get: function () { return this._onExit.event; }, enumerable: false, configurable: true }); Object.defineProperty(Terminal.prototype, "pid", { get: function () { return this._pid; }, enumerable: false, configurable: true }); Object.defineProperty(Terminal.prototype, "cols", { get: function () { return this._cols; }, enumerable: false, configurable: true }); Object.defineProperty(Terminal.prototype, "rows", { get: function () { return this._rows; }, enumerable: false, configurable: true }); Terminal.prototype.write = function (data) { if (this.handleFlowControl) { // PAUSE/RESUME messages are not forwarded to the pty if (data === this._flowControlPause) { this.pause(); return; } if (data === this._flowControlResume) { this.resume(); return; } } // everything else goes to the real pty this._write(data); }; Terminal.prototype._forwardEvents = function () { var _this = this; this.on('data', function (e) { return _this._onData.fire(e); }); this.on('exit', function (exitCode, signal) { return _this._onExit.fire({ exitCode: exitCode, signal: signal }); }); }; Terminal.prototype._checkType = function (name, value, type, allowArray) { if (allowArray === void 0) { allowArray = false; } if (value === undefined) { return; } if (allowArray) { if (Array.isArray(value)) { value.forEach(function (v, i) { if (typeof v !== type) { throw new Error(name + "[" + i + "] must be a " + type + " (not a " + typeof v[i] + ")"); } }); return; } } if (typeof value !== type) { throw new Error(name + " must be a " + type + " (not a " + typeof value + ")"); } }; /** See net.Socket.end */ Terminal.prototype.end = function (data) { this._socket.end(data); }; /** See stream.Readable.pipe */ Terminal.prototype.pipe = function (dest, options) { return this._socket.pipe(dest, options); }; /** See net.Socket.pause */ Terminal.prototype.pause = function () { return this._socket.pause(); }; /** See net.Socket.resume */ Terminal.prototype.resume = function () { return this._socket.resume(); }; /** See net.Socket.setEncoding */ Terminal.prototype.setEncoding = function (encoding) { if (this._socket._decoder) { delete this._socket._decoder; } if (encoding) { this._socket.setEncoding(encoding); } }; Terminal.prototype.addListener = function (eventName, listener) { this.on(eventName, listener); }; Terminal.prototype.on = function (eventName, listener) { if (eventName === 'close') { this._internalee.on('close', listener); return; } this._socket.on(eventName, listener); }; Terminal.prototype.emit = function (eventName) { var args = []; for (var _i = 1; _i < arguments.length; _i++) { args[_i - 1] = arguments[_i]; } if (eventName === 'close') { return this._internalee.emit.apply(this._internalee, arguments); } return this._socket.emit.apply(this._socket, arguments); }; Terminal.prototype.listeners = function (eventName) { return this._socket.listeners(eventName); }; Terminal.prototype.removeListener = function (eventName, listener) { this._socket.removeListener(eventName, listener); }; Terminal.prototype.removeAllListeners = function (eventName) { this._socket.removeAllListeners(eventName); }; Terminal.prototype.once = function (eventName, listener) { this._socket.once(eventName, listener); }; Terminal.prototype._close = function () { this._socket.readable = false; this.write = function () { }; this.end = function () { }; this._writable = false; this._readable = false; }; Terminal.prototype._parseEnv = function (env) { var keys = Object.keys(env || {}); var pairs = []; for (var i = 0; i < keys.length; i++) { if (keys[i] === undefined) { continue; } pairs.push(keys[i] + '=' + env[keys[i]]); } return pairs; }; return Terminal; }()); exports.Terminal = Terminal;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/node-pty/lib/terminal.js.map"use strict"; /** * Copyright (c) 2017, Daniel Imms (MIT License). * Copyright (c) 2018, Microsoft Corporation (MIT License). */ Object.defineProperty(exports, "__esModule", { value: true });//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/node-pty/lib/types.js.map"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.UnixTerminal = void 0; /** * Copyright (c) 2012-2015, Christopher Jeffrey (MIT License) * Copyright (c) 2016, Daniel Imms (MIT License). * Copyright (c) 2018, Microsoft Corporation (MIT License). */ var net = require("net"); var terminal_1 = require("./terminal"); var utils_1 = require("./utils"); var pty; try { pty = require('../build/Release/pty.node'); } catch (outerError) { try { pty = require('../build/Debug/pty.node'); } catch (innerError) { console.error('innerError', innerError); // Re-throw the exception from the Release require if the Debug require fails as well throw outerError; } } var DEFAULT_FILE = 'sh'; var DEFAULT_NAME = 'xterm'; var DESTROY_SOCKET_TIMEOUT_MS = 200; var UnixTerminal = /** @class */ (function (_super) { __extends(UnixTerminal, _super); function UnixTerminal(file, args, opt) { var _this = _super.call(this, opt) || this; if (typeof args === 'string') { throw new Error('args as a string is not supported on unix.'); } // Initialize arguments args = args || []; file = file || DEFAULT_FILE; opt = opt || {}; opt.env = opt.env || process.env; _this._cols = opt.cols || terminal_1.DEFAULT_COLS; _this._rows = opt.rows || terminal_1.DEFAULT_ROWS; var uid = opt.uid || -1; var gid = opt.gid || -1; var env = utils_1.assign({}, opt.env); if (opt.env === process.env) { _this._sanitizeEnv(env); } var cwd = opt.cwd || process.cwd(); env.PWD = cwd; var name = opt.name || env.TERM || DEFAULT_NAME; env.TERM = name; var parsedEnv = _this._parseEnv(env); var encoding = (opt.encoding === undefined ? 'utf8' : opt.encoding); var onexit = function (code, signal) { // XXX Sometimes a data event is emitted after exit. Wait til socket is // destroyed. if (!_this._emittedClose) { if (_this._boundClose) { return; } _this._boundClose = true; // From macOS High Sierra 10.13.2 sometimes the socket never gets // closed. A timeout is applied here to avoid the terminal never being // destroyed when this occurs. var timeout_1 = setTimeout(function () { timeout_1 = null; // Destroying the socket now will cause the close event to fire _this._socket.destroy(); }, DESTROY_SOCKET_TIMEOUT_MS); _this.once('close', function () { if (timeout_1 !== null) { clearTimeout(timeout_1); } _this.emit('exit', code, signal); }); return; } _this.emit('exit', code, signal); }; // fork var term = pty.fork(file, args, parsedEnv, cwd, _this._cols, _this._rows, uid, gid, (encoding === 'utf8'), onexit); _this._socket = new PipeSocket(term.fd); if (encoding !== null) { _this._socket.setEncoding(encoding); } // setup _this._socket.on('error', function (err) { // NOTE: fs.ReadStream gets EAGAIN twice at first: if (err.code) { if (~err.code.indexOf('EAGAIN')) { return; } } // close _this._close(); // EIO on exit from fs.ReadStream: if (!_this._emittedClose) { _this._emittedClose = true; _this.emit('close'); } // EIO, happens when someone closes our child process: the only process in // the terminal. // node < 0.6.14: errno 5 // node >= 0.6.14: read EIO if (err.code) { if (~err.code.indexOf('errno 5') || ~err.code.indexOf('EIO')) { return; } } // throw anything else if (_this.listeners('error').length < 2) { throw err; } }); _this._pid = term.pid; _this._fd = term.fd; _this._pty = term.pty; _this._file = file; _this._name = name; _this._readable = true; _this._writable = true; _this._socket.on('close', function () { if (_this._emittedClose) { return; } _this._emittedClose = true; _this._close(); _this.emit('close'); }); _this._forwardEvents(); return _this; } Object.defineProperty(UnixTerminal.prototype, "master", { get: function () { return this._master; }, enumerable: false, configurable: true }); Object.defineProperty(UnixTerminal.prototype, "slave", { get: function () { return this._slave; }, enumerable: false, configurable: true }); UnixTerminal.prototype._write = function (data) { this._socket.write(data); }; /** * openpty */ UnixTerminal.open = function (opt) { var self = Object.create(UnixTerminal.prototype); opt = opt || {}; if (arguments.length > 1) { opt = { cols: arguments[1], rows: arguments[2] }; } var cols = opt.cols || terminal_1.DEFAULT_COLS; var rows = opt.rows || terminal_1.DEFAULT_ROWS; var encoding = (opt.encoding === undefined ? 'utf8' : opt.encoding); // open var term = pty.open(cols, rows); self._master = new PipeSocket(term.master); if (encoding !== null) { self._master.setEncoding(encoding); } self._master.resume(); self._slave = new PipeSocket(term.slave); if (encoding !== null) { self._slave.setEncoding(encoding); } self._slave.resume(); self._socket = self._master; self._pid = null; self._fd = term.master; self._pty = term.pty; self._file = process.argv[0] || 'node'; self._name = process.env.TERM || ''; self._readable = true; self._writable = true; self._socket.on('error', function (err) { self._close(); if (self.listeners('error').length < 2) { throw err; } }); self._socket.on('close', function () { self._close(); }); return self; }; UnixTerminal.prototype.destroy = function () { var _this = this; this._close(); // Need to close the read stream so node stops reading a dead file // descriptor. Then we can safely SIGHUP the shell. this._socket.once('close', function () { _this.kill('SIGHUP'); }); this._socket.destroy(); }; UnixTerminal.prototype.kill = function (signal) { try { process.kill(this.pid, signal || 'SIGHUP'); } catch (e) { /* swallow */ } }; Object.defineProperty(UnixTerminal.prototype, "process", { /** * Gets the name of the process. */ get: function () { return pty.process(this._fd, this._pty) || this._file; }, enumerable: false, configurable: true }); /** * TTY */ UnixTerminal.prototype.resize = function (cols, rows) { if (cols <= 0 || rows <= 0 || isNaN(cols) || isNaN(rows) || cols === Infinity || rows === Infinity) { throw new Error('resizing must be done using positive cols and rows'); } pty.resize(this._fd, cols, rows); this._cols = cols; this._rows = rows; }; UnixTerminal.prototype._sanitizeEnv = function (env) { // Make sure we didn't start our server from inside tmux. delete env['TMUX']; delete env['TMUX_PANE']; // Make sure we didn't start our server from inside screen. // http://web.mit.edu/gnu/doc/html/screen_20.html delete env['STY']; delete env['WINDOW']; // Delete some variables that might confuse our terminal. delete env['WINDOWID']; delete env['TERMCAP']; delete env['COLUMNS']; delete env['LINES']; }; return UnixTerminal; }(terminal_1.Terminal)); exports.UnixTerminal = UnixTerminal; /** * Wraps net.Socket to force the handle type "PIPE" by temporarily overwriting * tty_wrap.guessHandleType. * See: https://github.com/chjj/pty.js/issues/103 */ var PipeSocket = /** @class */ (function (_super) { __extends(PipeSocket, _super); function PipeSocket(fd) { var _this = this; var pipeWrap = process.binding('pipe_wrap'); // tslint:disable-line // @types/node has fd as string? https://github.com/DefinitelyTyped/DefinitelyTyped/pull/18275 var handle = new pipeWrap.Pipe(pipeWrap.constants.SOCKET); handle.open(fd); _this = _super.call(this, { handle: handle }) || this; return _this; } return PipeSocket; }(net.Socket));//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/node-pty/lib/unixTerminal.js.map"use strict"; /** * Copyright (c) 2017, Daniel Imms (MIT License). * Copyright (c) 2018, Microsoft Corporation (MIT License). */ Object.defineProperty(exports, "__esModule", { value: true }); exports.assign = void 0; function assign(target) { var sources = []; for (var _i = 1; _i < arguments.length; _i++) { sources[_i - 1] = arguments[_i]; } sources.forEach(function (source) { return Object.keys(source).forEach(function (key) { return target[key] = source[key]; }); }); return target; } exports.assign = assign;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/node-pty/lib/utils.js.map"use strict"; /** * Copyright (c) 2020, Microsoft Corporation (MIT License). */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __generator = (this && this.__generator) || function (thisArg, body) { var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); while (_) try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0: case 1: t = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t[2]) _.ops.pop(); _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } }; Object.defineProperty(exports, "__esModule", { value: true }); exports.ConoutConnection = void 0; var worker_threads_1 = require("worker_threads"); var conout_1 = require("./shared/conout"); var path_1 = require("path"); var eventEmitter2_1 = require("./eventEmitter2"); /** * The amount of time to wait for additional data after the conpty shell process has exited before * shutting down the worker and sockets. The timer will be reset if a new data event comes in after * the timer has started. */ var FLUSH_DATA_INTERVAL = 1000; /** * Connects to and manages the lifecycle of the conout socket. This socket must be drained on * another thread in order to avoid deadlocks where Conpty waits for the out socket to drain * when `ClosePseudoConsole` is called. This happens when data is being written to the terminal when * the pty is closed. * * See also: * - https://github.com/microsoft/node-pty/issues/375 * - https://github.com/microsoft/vscode/issues/76548 * - https://github.com/microsoft/terminal/issues/1810 * - https://docs.microsoft.com/en-us/windows/console/closepseudoconsole */ var ConoutConnection = /** @class */ (function () { function ConoutConnection(_conoutPipeName) { var _this = this; this._conoutPipeName = _conoutPipeName; this._isDisposed = false; this._onReady = new eventEmitter2_1.EventEmitter2(); var workerData = { conoutPipeName: _conoutPipeName }; var scriptPath = __dirname.replace('node_modules.asar', 'node_modules.asar.unpacked'); this._worker = new worker_threads_1.Worker(path_1.join(scriptPath, 'worker/conoutSocketWorker.js'), { workerData: workerData }); this._worker.on('message', function (message) { switch (message) { case 1 /* READY */: _this._onReady.fire(); return; default: console.warn('Unexpected ConoutWorkerMessage', message); } }); } Object.defineProperty(ConoutConnection.prototype, "onReady", { get: function () { return this._onReady.event; }, enumerable: false, configurable: true }); ConoutConnection.prototype.dispose = function () { if (this._isDisposed) { return; } this._isDisposed = true; // Drain all data from the socket before closing this._drainDataAndClose(); }; ConoutConnection.prototype.connectSocket = function (socket) { socket.connect(conout_1.getWorkerPipeName(this._conoutPipeName)); }; ConoutConnection.prototype._drainDataAndClose = function () { var _this = this; if (this._drainTimeout) { clearTimeout(this._drainTimeout); } this._drainTimeout = setTimeout(function () { return _this._destroySocket(); }, FLUSH_DATA_INTERVAL); }; ConoutConnection.prototype._destroySocket = function () { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { switch (_a.label) { case 0: return [4 /*yield*/, this._worker.terminate()]; case 1: _a.sent(); return [2 /*return*/]; } }); }); }; return ConoutConnection; }()); exports.ConoutConnection = ConoutConnection;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/node-pty/lib/windowsConoutConnection.js.map"use strict"; /** * Copyright (c) 2012-2015, Christopher Jeffrey, Peter Sunde (MIT License) * Copyright (c) 2016, Daniel Imms (MIT License). * Copyright (c) 2018, Microsoft Corporation (MIT License). */ Object.defineProperty(exports, "__esModule", { value: true }); exports.argsToCommandLine = exports.WindowsPtyAgent = void 0; var fs = require("fs"); var os = require("os"); var path = require("path"); var net_1 = require("net"); var child_process_1 = require("child_process"); var windowsConoutConnection_1 = require("./windowsConoutConnection"); var conptyNative; var winptyNative; /** * The amount of time to wait for additional data after the conpty shell process has exited before * shutting down the socket. The timer will be reset if a new data event comes in after the timer * has started. */ var FLUSH_DATA_INTERVAL = 1000; /** * This agent sits between the WindowsTerminal class and provides a common interface for both conpty * and winpty. */ var WindowsPtyAgent = /** @class */ (function () { function WindowsPtyAgent(file, args, env, cwd, cols, rows, debug, _useConpty, conptyInheritCursor) { var _this = this; if (conptyInheritCursor === void 0) { conptyInheritCursor = false; } this._useConpty = _useConpty; if (this._useConpty === undefined || this._useConpty === true) { this._useConpty = this._getWindowsBuildNumber() >= 18309; } if (this._useConpty) { if (!conptyNative) { try { conptyNative = require('../build/Release/conpty.node'); } catch (outerError) { try { conptyNative = require('../build/Debug/conpty.node'); } catch (innerError) { console.error('innerError', innerError); // Re-throw the exception from the Release require if the Debug require fails as well throw outerError; } } } } else { if (!winptyNative) { try { winptyNative = require('../build/Release/pty.node'); } catch (outerError) { try { winptyNative = require('../build/Debug/pty.node'); } catch (innerError) { console.error('innerError', innerError); // Re-throw the exception from the Release require if the Debug require fails as well throw outerError; } } } } this._ptyNative = this._useConpty ? conptyNative : winptyNative; // Sanitize input variable. cwd = path.resolve(cwd); // Compose command line var commandLine = argsToCommandLine(file, args); // Open pty session. var term; if (this._useConpty) { term = this._ptyNative.startProcess(file, cols, rows, debug, this._generatePipeName(), conptyInheritCursor); } else { term = this._ptyNative.startProcess(file, commandLine, env, cwd, cols, rows, debug); this._pid = term.pid; this._innerPid = term.innerPid; this._innerPidHandle = term.innerPidHandle; } // Not available on windows. this._fd = term.fd; // Generated incremental number that has no real purpose besides using it // as a terminal id. this._pty = term.pty; // Create terminal pipe IPC channel and forward to a local unix socket. this._outSocket = new net_1.Socket(); this._outSocket.setEncoding('utf8'); // The conout socket must be ready out on another thread to avoid deadlocks this._conoutSocketWorker = new windowsConoutConnection_1.ConoutConnection(term.conout); this._conoutSocketWorker.onReady(function () { _this._conoutSocketWorker.connectSocket(_this._outSocket); }); this._outSocket.on('connect', function () { _this._outSocket.emit('ready_datapipe'); }); var inSocketFD = fs.openSync(term.conin, 'w'); this._inSocket = new net_1.Socket({ fd: inSocketFD, readable: false, writable: true }); this._inSocket.setEncoding('utf8'); if (this._useConpty) { var connect = this._ptyNative.connect(this._pty, commandLine, cwd, env, function (c) { return _this._$onProcessExit(c); }); this._innerPid = connect.pid; } } Object.defineProperty(WindowsPtyAgent.prototype, "inSocket", { get: function () { return this._inSocket; }, enumerable: false, configurable: true }); Object.defineProperty(WindowsPtyAgent.prototype, "outSocket", { get: function () { return this._outSocket; }, enumerable: false, configurable: true }); Object.defineProperty(WindowsPtyAgent.prototype, "fd", { get: function () { return this._fd; }, enumerable: false, configurable: true }); Object.defineProperty(WindowsPtyAgent.prototype, "innerPid", { get: function () { return this._innerPid; }, enumerable: false, configurable: true }); Object.defineProperty(WindowsPtyAgent.prototype, "pty", { get: function () { return this._pty; }, enumerable: false, configurable: true }); WindowsPtyAgent.prototype.resize = function (cols, rows) { if (this._useConpty) { if (this._exitCode !== undefined) { throw new Error('Cannot resize a pty that has already exited'); } this._ptyNative.resize(this._pty, cols, rows); return; } this._ptyNative.resize(this._pid, cols, rows); }; WindowsPtyAgent.prototype.kill = function () { var _this = this; this._inSocket.readable = false; this._outSocket.readable = false; // Tell the agent to kill the pty, this releases handles to the process if (this._useConpty) { this._getConsoleProcessList().then(function (consoleProcessList) { consoleProcessList.forEach(function (pid) { try { process.kill(pid); } catch (e) { // Ignore if process cannot be found (kill ESRCH error) } }); _this._ptyNative.kill(_this._pty); }); } else { this._ptyNative.kill(this._pid, this._innerPidHandle); // Since pty.kill closes the handle it will kill most processes by itself // and process IDs can be reused as soon as all handles to them are // dropped, we want to immediately kill the entire console process list. // If we do not force kill all processes here, node servers in particular // seem to become detached and remain running (see // Microsoft/vscode#26807). var processList = this._ptyNative.getProcessList(this._pid); processList.forEach(function (pid) { try { process.kill(pid); } catch (e) { // Ignore if process cannot be found (kill ESRCH error) } }); } this._conoutSocketWorker.dispose(); }; WindowsPtyAgent.prototype._getConsoleProcessList = function () { var _this = this; return new Promise(function (resolve) { var agent = child_process_1.fork(path.join(__dirname, 'conpty_console_list_agent'), [_this._innerPid.toString()]); agent.on('message', function (message) { clearTimeout(timeout); resolve(message.consoleProcessList); }); var timeout = setTimeout(function () { // Something went wrong, just send back the shell PID agent.kill(); resolve([_this._innerPid]); }, 5000); }); }; Object.defineProperty(WindowsPtyAgent.prototype, "exitCode", { get: function () { if (this._useConpty) { return this._exitCode; } return this._ptyNative.getExitCode(this._innerPidHandle); }, enumerable: false, configurable: true }); WindowsPtyAgent.prototype._getWindowsBuildNumber = function () { var osVersion = (/(\d+)\.(\d+)\.(\d+)/g).exec(os.release()); var buildNumber = 0; if (osVersion && osVersion.length === 4) { buildNumber = parseInt(osVersion[3]); } return buildNumber; }; WindowsPtyAgent.prototype._generatePipeName = function () { return "conpty-" + Math.random() * 10000000; }; /** * Triggered from the native side when a contpy process exits. */ WindowsPtyAgent.prototype._$onProcessExit = function (exitCode) { var _this = this; this._exitCode = exitCode; this._flushDataAndCleanUp(); this._outSocket.on('data', function () { return _this._flushDataAndCleanUp(); }); }; WindowsPtyAgent.prototype._flushDataAndCleanUp = function () { var _this = this; if (this._closeTimeout) { clearTimeout(this._closeTimeout); } this._closeTimeout = setTimeout(function () { return _this._cleanUpProcess(); }, FLUSH_DATA_INTERVAL); }; WindowsPtyAgent.prototype._cleanUpProcess = function () { this._inSocket.readable = false; this._outSocket.readable = false; this._outSocket.destroy(); }; return WindowsPtyAgent; }()); exports.WindowsPtyAgent = WindowsPtyAgent; // Convert argc/argv into a Win32 command-line following the escaping convention // documented on MSDN (e.g. see CommandLineToArgvW documentation). Copied from // winpty project. function argsToCommandLine(file, args) { if (isCommandLine(args)) { if (args.length === 0) { return file; } return argsToCommandLine(file, []) + " " + args; } var argv = [file]; Array.prototype.push.apply(argv, args); var result = ''; for (var argIndex = 0; argIndex < argv.length; argIndex++) { if (argIndex > 0) { result += ' '; } var arg = argv[argIndex]; // if it is empty or it contains whitespace and is not already quoted var hasLopsidedEnclosingQuote = xOr((arg[0] !== '"'), (arg[arg.length - 1] !== '"')); var hasNoEnclosingQuotes = ((arg[0] !== '"') && (arg[arg.length - 1] !== '"')); var quote = arg === '' || (arg.indexOf(' ') !== -1 || arg.indexOf('\t') !== -1) && ((arg.length > 1) && (hasLopsidedEnclosingQuote || hasNoEnclosingQuotes)); if (quote) { result += '\"'; } var bsCount = 0; for (var i = 0; i < arg.length; i++) { var p = arg[i]; if (p === '\\') { bsCount++; } else if (p === '"') { result += repeatText('\\', bsCount * 2 + 1); result += '"'; bsCount = 0; } else { result += repeatText('\\', bsCount); bsCount = 0; result += p; } } if (quote) { result += repeatText('\\', bsCount * 2); result += '\"'; } else { result += repeatText('\\', bsCount); } } return result; } exports.argsToCommandLine = argsToCommandLine; function isCommandLine(args) { return typeof args === 'string'; } function repeatText(text, count) { var result = ''; for (var i = 0; i < count; i++) { result += text; } return result; } function xOr(arg1, arg2) { return ((arg1 && !arg2) || (!arg1 && arg2)); }//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/node-pty/lib/windowsPtyAgent.js.map"use strict"; /** * Copyright (c) 2012-2015, Christopher Jeffrey, Peter Sunde (MIT License) * Copyright (c) 2016, Daniel Imms (MIT License). * Copyright (c) 2018, Microsoft Corporation (MIT License). */ var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.WindowsTerminal = void 0; var terminal_1 = require("./terminal"); var windowsPtyAgent_1 = require("./windowsPtyAgent"); var utils_1 = require("./utils"); var DEFAULT_FILE = 'cmd.exe'; var DEFAULT_NAME = 'Windows Shell'; var WindowsTerminal = /** @class */ (function (_super) { __extends(WindowsTerminal, _super); function WindowsTerminal(file, args, opt) { var _this = _super.call(this, opt) || this; _this._checkType('args', args, 'string', true); // Initialize arguments args = args || []; file = file || DEFAULT_FILE; opt = opt || {}; opt.env = opt.env || process.env; if (opt.encoding) { console.warn('Setting encoding on Windows is not supported'); } var env = utils_1.assign({}, opt.env); _this._cols = opt.cols || terminal_1.DEFAULT_COLS; _this._rows = opt.rows || terminal_1.DEFAULT_ROWS; var cwd = opt.cwd || process.cwd(); var name = opt.name || env.TERM || DEFAULT_NAME; var parsedEnv = _this._parseEnv(env); // If the terminal is ready _this._isReady = false; // Functions that need to run after `ready` event is emitted. _this._deferreds = []; // Create new termal. _this._agent = new windowsPtyAgent_1.WindowsPtyAgent(file, args, parsedEnv, cwd, _this._cols, _this._rows, false, opt.useConpty, opt.conptyInheritCursor); _this._socket = _this._agent.outSocket; // Not available until `ready` event emitted. _this._pid = _this._agent.innerPid; _this._fd = _this._agent.fd; _this._pty = _this._agent.pty; // The forked windows terminal is not available until `ready` event is // emitted. _this._socket.on('ready_datapipe', function () { // These events needs to be forwarded. ['connect', 'data', 'end', 'timeout', 'drain'].forEach(function (event) { _this._socket.on(event, function () { // Wait until the first data event is fired then we can run deferreds. if (!_this._isReady && event === 'data') { // Terminal is now ready and we can avoid having to defer method // calls. _this._isReady = true; // Execute all deferred methods _this._deferreds.forEach(function (fn) { // NB! In order to ensure that `this` has all its references // updated any variable that need to be available in `this` before // the deferred is run has to be declared above this forEach // statement. fn.run(); }); // Reset _this._deferreds = []; } }); }); // Shutdown if `error` event is emitted. _this._socket.on('error', function (err) { // Close terminal session. _this._close(); // EIO, happens when someone closes our child process: the only process // in the terminal. // node < 0.6.14: errno 5 // node >= 0.6.14: read EIO if (err.code) { if (~err.code.indexOf('errno 5') || ~err.code.indexOf('EIO')) return; } // Throw anything else. if (_this.listeners('error').length < 2) { throw err; } }); // Cleanup after the socket is closed. _this._socket.on('close', function () { _this.emit('exit', _this._agent.exitCode); _this._close(); }); }); _this._file = file; _this._name = name; _this._readable = true; _this._writable = true; _this._forwardEvents(); return _this; } WindowsTerminal.prototype._write = function (data) { this._defer(this._doWrite, data); }; WindowsTerminal.prototype._doWrite = function (data) { this._agent.inSocket.write(data); }; /** * openpty */ WindowsTerminal.open = function (options) { throw new Error('open() not supported on windows, use Fork() instead.'); }; /** * TTY */ WindowsTerminal.prototype.resize = function (cols, rows) { var _this = this; if (cols <= 0 || rows <= 0 || isNaN(cols) || isNaN(rows) || cols === Infinity || rows === Infinity) { throw new Error('resizing must be done using positive cols and rows'); } this._defer(function () { _this._agent.resize(cols, rows); _this._cols = cols; _this._rows = rows; }); }; WindowsTerminal.prototype.destroy = function () { var _this = this; this._defer(function () { _this.kill(); }); }; WindowsTerminal.prototype.kill = function (signal) { var _this = this; this._defer(function () { if (signal) { throw new Error('Signals not supported on windows.'); } _this._close(); _this._agent.kill(); }); }; WindowsTerminal.prototype._defer = function (deferredFn, arg) { var _this = this; // If the terminal is ready, execute. if (this._isReady) { deferredFn.call(this, arg); return; } // Queue until terminal is ready. this._deferreds.push({ run: function () { return deferredFn.call(_this, arg); } }); }; Object.defineProperty(WindowsTerminal.prototype, "process", { get: function () { return this._name; }, enumerable: false, configurable: true }); Object.defineProperty(WindowsTerminal.prototype, "master", { get: function () { throw new Error('master is not supported on Windows'); }, enumerable: false, configurable: true }); Object.defineProperty(WindowsTerminal.prototype, "slave", { get: function () { throw new Error('slave is not supported on Windows'); }, enumerable: false, configurable: true }); return WindowsTerminal; }(terminal_1.Terminal)); exports.WindowsTerminal = WindowsTerminal;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/node-pty/lib/windowsTerminal.js.map{ "name": "node-vsce-sign", "description": "Visual Studio Code extension package signing and verification module", "version": "0.0.1", "author": { "name": "Microsoft" }, "license": "SEE LICENSE IN LICENSE.txt", "devDependencies": { "mocha": "^10.0.0" }, "homepage": "https://github.com/Microsoft/node-vscode-sign", "main": "src/main.js", "scripts": { "postinstall": "node ./src/postinstall.js", "test": "mocha ./src/test/*.test.js --timeout 5s --fail-zero --exit" } } /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * See LICENSE.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // @ts-check 'use strict'; const childProcess = require('child_process'); const Path = require('path'); const util = require('util'); const execFile = util.promisify(childProcess.execFile); const command = process.platform === 'win32' ? 'vsce-sign.exe' : 'vsce-sign'; const vsceSignFilePath = Path.join(__dirname, '../bin', command); // Must stay in sync with Microsoft.VisualStudio.Extensions.Signing.ReturnCode (src\Core\ReturnCode.cs). const ReturnCode = {}; // This comment and its corresponding end tag are for a test. /* MEMBERS START */ ReturnCode[ReturnCode["None"] = 0] = "None"; // For internal use. Used for initialization. ReturnCode[ReturnCode["RequiredArgumentMissing"] = 1] = "RequiredArgumentMissing"; // A required argument is missing. ReturnCode[ReturnCode["InvalidArgument"] = 2] = "InvalidArgument"; // An argument is invalid. ReturnCode[ReturnCode["PackageIsUnreadable"] = 3] = "PackageIsUnreadable"; // The extension package is unreadable. ReturnCode[ReturnCode["UnhandledException"] = 4] = "UnhandledException"; // An unhandled exception occurred. ReturnCode[ReturnCode["SignatureManifestIsMissing"] = 5] = "SignatureManifestIsMissing"; // The extension is missing a signature manifest file (.signature.manifest). ReturnCode[ReturnCode["SignatureManifestIsUnreadable"] = 6] = "SignatureManifestIsUnreadable"; // The signature manifest is unreadable. ReturnCode[ReturnCode["SignatureIsMissing"] = 7] = "SignatureIsMissing"; // The extension is missing a signature file (.signature.p7s). ReturnCode[ReturnCode["SignatureIsUnreadable"] = 8] = "SignatureIsUnreadable"; // The signature is unreadable. ReturnCode[ReturnCode["CertificateIsUnreadable"] = 9] = "CertificateIsUnreadable"; // The certificate is unreadable. ReturnCode[ReturnCode["SignatureArchiveIsUnreadable"] = 10] = "SignatureArchiveIsUnreadable"; // The signature archive is unreadable. ReturnCode[ReturnCode["FileAlreadyExists"] = 11] = "FileAlreadyExists"; // The output file already exists. // Space reserved for additional CLI-specific return codes. ReturnCode[ReturnCode["Success"] = 100] = "Success"; // The operation succeeded. ReturnCode[ReturnCode["PackageIntegrityCheckFailed"] = 101] = "PackageIntegrityCheckFailed"; // The package integrity check failed. ReturnCode[ReturnCode["SignatureIsInvalid"] = 102] = "SignatureIsInvalid"; // The extension has an invalid signature file (.signature.p7s). ReturnCode[ReturnCode["SignatureManifestIsInvalid"] = 103] = "SignatureManifestIsInvalid"; // The extension has an invalid signature manifest file (.signature.manifest). ReturnCode[ReturnCode["SignatureIntegrityCheckFailed"] = 104] = "SignatureIntegrityCheckFailed"; // The extension's signature integrity check failed. Extension integrity is suspect. ReturnCode[ReturnCode["EntryIsMissing"] = 105] = "EntryIsMissing"; // An entry referenced in the signature manifest was not found in the extension. ReturnCode[ReturnCode["EntryIsTampered"] = 106] = "EntryIsTampered"; // The integrity check for an entry referenced in the signature manifest failed. ReturnCode[ReturnCode["Untrusted"] = 107] = "Untrusted"; // An X.509 certificate in the extension signature is untrusted. ReturnCode[ReturnCode["CertificateRevoked"] = 108] = "CertificateRevoked"; // An X.509 certificate in the extension signature has been revoked. ReturnCode[ReturnCode["SignatureIsNotValid"] = 109] = "SignatureIsNotValid"; // The extension signature is invalid. ReturnCode[ReturnCode["UnknownError"] = 110] = "UnknownError"; // An unknown error occurred. class ExtensionSignatureVerificationError extends Error { constructor(code) { super(); this.code = code; } } /** * @param {string} vsixFilePath * @param {string} signatureArchiveFilePath * @returns {Promise} */ async function verify(vsixFilePath, signatureArchiveFilePath) { const args = ['verify', '--package', vsixFilePath, '--signaturearchive', signatureArchiveFilePath]; let errorCode; try { await execFile(vsceSignFilePath, args); } catch (e) { // vsce-sign never returns 0, and execFile(...) returns an error for any non-zero exit code. const code = e.code; // vsce-sign returns exit codes (numbers), whereas execFile(...), in the absence of an exit code, returns an error code (string) (e.g.: ENOENT). if (typeof code === 'number') { if (code === ReturnCode.Success) { return true; } errorCode = ReturnCode[code]; } else if (typeof code === 'string') { errorCode = code; } } if (errorCode === undefined) { errorCode = ReturnCode[ReturnCode.UnknownError]; } throw new ExtensionSignatureVerificationError(errorCode); } module.exports = { verify, ReturnCode, ExtensionSignatureVerificationError }; const path = require('path'); const mkdirp = require('mkdirp'); const spdlog = require('bindings')('spdlog'); exports.version = spdlog.version; exports.setLevel = spdlog.setLevel; exports.setFlushOn = spdlog.setFlushOn; exports.Logger = spdlog.Logger; function createRotatingLogger(name, filepath, maxFileSize, maxFiles) { return createLogger('rotating', name, filepath, maxFileSize, maxFiles); } function createAsyncRotatingLogger(name, filepath, maxFileSize, maxFiles) { return createLogger('rotating_async', name, filepath, maxFileSize, maxFiles); } function createLogger(loggerType, name, filepath, maxFileSize, maxFiles) { return new Promise((c, e) => { const dirname = path.dirname(filepath); mkdirp(dirname, err => { if (err) { e(err); } else { c(new spdlog.Logger(loggerType, name, filepath, maxFileSize, maxFiles)); } }); }); } exports.createRotatingLogger = createRotatingLogger; exports.createAsyncRotatingLogger = createAsyncRotatingLogger; MIT License Copyright (c) Microsoft Corporation. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE { "name": "spdlog", "version": "0.13.6", "description": "Node bindings for spdlog", "main": "index.js", "types": "index.d.ts", "scripts": { "dev": "cp -R ~/.node-gyp/$(node -p 'process.versions.node')/include/node deps/node", "test": "mocha" }, "repository": { "type": "git", "url": "git+https://github.com/Microsoft/node-spdlog.git" }, "keywords": [ "node", "spdlog", "logging", "logger", "log", "fast", "performance" ], "author": "Microsoft", "license": "MIT", "bugs": { "url": "https://github.com/Microsoft/node-spdlog/issues" }, "homepage": "https://github.com/Microsoft/node-spdlog#readme", "dependencies": { "bindings": "^1.5.0", "mkdirp": "^0.5.5", "nan": "^2.14.0" }, "devDependencies": { "@types/mocha": "^2.2.44", "@types/node": "^8.0.53", "mocha": "^6.2.3" } } var path = require('path'); var fs = require('fs'); var _0777 = parseInt('0777', 8); module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; function mkdirP (p, opts, f, made) { if (typeof opts === 'function') { f = opts; opts = {}; } else if (!opts || typeof opts !== 'object') { opts = { mode: opts }; } var mode = opts.mode; var xfs = opts.fs || fs; if (mode === undefined) { mode = _0777 } if (!made) made = null; var cb = f || function () {}; p = path.resolve(p); xfs.mkdir(p, mode, function (er) { if (!er) { made = made || p; return cb(null, made); } switch (er.code) { case 'ENOENT': if (path.dirname(p) === p) return cb(er); mkdirP(path.dirname(p), opts, function (er, made) { if (er) cb(er, made); else mkdirP(p, opts, cb, made); }); break; // In the case of any other error, just see if there's a dir // there already. If so, then hooray! If not, then something // is borked. default: xfs.stat(p, function (er2, stat) { // if the stat fails, then that's super weird. // let the original error be the failure reason. if (er2 || !stat.isDirectory()) cb(er, made) else cb(null, made); }); break; } }); } mkdirP.sync = function sync (p, opts, made) { if (!opts || typeof opts !== 'object') { opts = { mode: opts }; } var mode = opts.mode; var xfs = opts.fs || fs; if (mode === undefined) { mode = _0777 } if (!made) made = null; p = path.resolve(p); try { xfs.mkdirSync(p, mode); made = made || p; } catch (err0) { switch (err0.code) { case 'ENOENT' : made = sync(path.dirname(p), opts, made); sync(p, opts, made); break; // In the case of any other error, just see if there's a dir // there already. If so, then hooray! If not, then something // is borked. default: var stat; try { stat = xfs.statSync(p); } catch (err1) { throw err0; } if (!stat.isDirectory()) throw err0; break; } } return made; }; Copyright 2010 James Halliday (mail@substack.net) This project is free software released under the MIT/X11 license: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "mkdirp", "description": "Recursively mkdir, like `mkdir -p`", "version": "0.5.5", "publishConfig": { "tag": "legacy" }, "author": "James Halliday (http://substack.net)", "main": "index.js", "keywords": [ "mkdir", "directory" ], "repository": { "type": "git", "url": "https://github.com/substack/node-mkdirp.git" }, "scripts": { "test": "tap test/*.js" }, "dependencies": { "minimist": "^1.2.5" }, "devDependencies": { "mock-fs": "^3.7.0", "tap": "^5.4.2" }, "bin": "bin/cmd.js", "license": "MIT", "files": [ "bin", "index.js" ] } #!/usr/bin/env node var mkdirp = require('../'); var minimist = require('minimist'); var fs = require('fs'); var argv = minimist(process.argv.slice(2), { alias: { m: 'mode', h: 'help' }, string: [ 'mode' ] }); if (argv.help) { fs.createReadStream(__dirname + '/usage.txt').pipe(process.stdout); return; } var paths = argv._.slice(); var mode = argv.mode ? parseInt(argv.mode, 8) : undefined; (function next () { if (paths.length === 0) return; var p = paths.shift(); if (mode === undefined) mkdirp(p, cb) else mkdirp(p, mode, cb) function cb (err) { if (err) { console.error(err.message); process.exit(1); } else next(); } })(); usage: mkdirp [DIR1,DIR2..] {OPTIONS} Create each supplied directory including any necessary parent directories that don't yet exist. If the directory already exists, do nothing. OPTIONS are: -m, --mode If a directory needs to be created, set the mode as an octal permission string. MIT License Copyright (c) Microsoft Corporation. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE { "name": "tas-client-umd", "version": "0.1.6", "description": "TAS-Client as UMD module", "main": "lib/tas-client-umd.js", "typings": "tas-client-umd.d.ts", "scripts": { "build": "webpack", "prepublish": "webpack" }, "keywords": [ "tas-client", "umd" ], "author": "Microsoft", "license": "MIT", "devDependencies": { "tas-client": "0.1.26", "webpack": "^4.16.5", "webpack-cli": "^3.1.0" } } !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}("undefined"!=typeof self?self:this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,r),s.l=!0,s.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)r.d(n,s,function(t){return e[t]}.bind(null,s));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=11)}([function(e,t,r){"use strict";var n=r(3),s=Object.prototype.toString;function i(e){return"[object Array]"===s.call(e)}function o(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==s.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===s.call(e)}function f(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var r=0,n=e.length;r=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){c.headers[e]=n.merge(o)})),e.exports=c}).call(this,r(23))},function(e,t,r){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,e.exports=n},function(e,t,r){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n0&&this.PostEventToTelemetry(t);let n=r.data,s=n.Configs,i=[];for(let e of s)if(e.Parameters)for(let t of Object.keys(e.Parameters)){const r=t+(e.Parameters[t]?"":"cf");i.includes(r)||i.push(r)}return{features:i,assignmentContext:n.AssignmentContext,configs:s}}}t.TasApiFeatureProvider=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(15);class s extends n.BaseFeatureProvider{constructor(e,t){super(e),this.telemetry=e,this.filterProviders=t,this.cachedTelemetryEvents=[]}getFilters(){let e=new Map;for(let t of this.filterProviders){let r=t.getFilters();for(let t of r.keys()){let n=r.get(t);e.set(t,n)}}return e}PostEventToTelemetry(e){if(this.cachedTelemetryEvents.includes(e))return;const t=JSON.stringify(e);this.telemetry.postEvent("report-headers",new Map([["ABExp.headers",t]])),this.cachedTelemetryEvents.push(e)}}t.FilteredFeatureProvider=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.BaseFeatureProvider=class{constructor(e){this.telemetry=e,this.isFetching=!1}async getFeatures(){if(this.isFetching&&this.fetchPromise)return this.fetchPromise;this.fetchPromise=this.fetch();let e=await this.fetchPromise;return this.isFetching=!1,this.fetchPromise=void 0,e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(17);t.AxiosHttpClient=class{constructor(e){this.endpoint=e}get(e){return n.default.get(this.endpoint,Object.assign(Object.assign({},e),{proxy:!1}))}}},function(e,t,r){e.exports=r(18)},function(e,t,r){"use strict";var n=r(0),s=r(3),i=r(19),o=r(9);var a=function e(t){var r=new i(t),a=s(i.prototype.request,r);return n.extend(a,i.prototype,r),n.extend(a,r),a.create=function(r){return e(o(t,r))},a}(r(1));a.Axios=i,a.Cancel=r(2),a.CancelToken=r(33),a.isCancel=r(8),a.VERSION=r(10).version,a.all=function(e){return Promise.all(e)},a.spread=r(34),a.isAxiosError=r(35),e.exports=a,e.exports.default=a},function(e,t,r){"use strict";var n=r(0),s=r(4),i=r(20),o=r(21),a=r(9),u=r(32),c=u.validators;function f(e){this.defaults=e,this.interceptors={request:new i,response:new i}}f.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&u.assertOptions(t,{silentJSONParsing:c.transitional(c.boolean),forcedJSONParsing:c.transitional(c.boolean),clarifyTimeoutError:c.transitional(c.boolean)},!1);var r=[],n=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(n=n&&t.synchronous,r.unshift(t.fulfilled,t.rejected))}));var s,i=[];if(this.interceptors.response.forEach((function(e){i.push(e.fulfilled,e.rejected)})),!n){var f=[o,void 0];for(Array.prototype.unshift.apply(f,r),f=f.concat(i),s=Promise.resolve(e);f.length;)s=s.then(f.shift(),f.shift());return s}for(var l=e;r.length;){var h=r.shift(),d=r.shift();try{l=h(l)}catch(e){d(e);break}}try{s=o(l)}catch(e){return Promise.reject(e)}for(;i.length;)s=s.then(i.shift(),i.shift());return s},f.prototype.getUri=function(e){return e=a(this.defaults,e),s(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){f.prototype[e]=function(t,r){return this.request(a(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){f.prototype[e]=function(t,r,n){return this.request(a(n||{},{method:e,url:t,data:r}))}})),e.exports=f},function(e,t,r){"use strict";var n=r(0);function s(){this.handlers=[]}s.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},s.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},s.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=s},function(e,t,r){"use strict";var n=r(0),s=r(22),i=r(8),o=r(1),a=r(2);function u(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new a("canceled")}e.exports=function(e){return u(e),e.headers=e.headers||{},e.data=s.call(e,e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||o.adapter)(e).then((function(t){return u(e),t.data=s.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(u(e),t&&t.response&&(t.response.data=s.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,r){"use strict";var n=r(0),s=r(1);e.exports=function(e,t,r){var i=this||s;return n.forEach(r,(function(r){e=r.call(i,e,t)})),e}},function(e,t){var r,n,s=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var u,c=[],f=!1,l=-1;function h(){f&&u&&(f=!1,u.length?c=u.concat(c):l=-1,c.length&&d())}function d(){if(!f){var e=a(h);f=!0;for(var t=c.length;t;){for(u=c,c=[];++l1)for(var r=1;r=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([r]):o[t]?o[t]+", "+r:r}})),o):o}},function(e,t,r){"use strict";var n=r(0);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function s(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=s(window.location.href),function(t){var r=n.isString(t)?s(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},function(e,t,r){"use strict";var n=r(10).version,s={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){s[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var i={};s.transitional=function(e,t,r){function s(e,t){return"[Axios v"+n+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,o){if(!1===e)throw new Error(s(n," has been removed"+(t?" in "+t:"")));return t&&!i[n]&&(i[n]=!0,console.warn(s(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,o)}},e.exports={assertOptions:function(e,t,r){if("object"!=typeof e)throw new TypeError("options must be an object");for(var n=Object.keys(e),s=n.length;s-- >0;){var i=n[s],o=t[i];if(o){var a=e[i],u=void 0===a||o(a,i,e);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:s}},function(e,t,r){"use strict";var n=r(2);function s(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;this.promise.then((function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t0&&(this.pollingService=new s.PollingService(r),this.pollingService.OnPollTick(async()=>{await super.getFeaturesAsync()}))}init(){this.pollingService?this.pollingService.StartPolling(!0):super.getFeaturesAsync()}async getFeaturesAsync(e=!1){if(this.pollingService){this.pollingService.StopPolling();let t=await super.getFeaturesAsync(e);return this.pollingService.StartPolling(),t}return await super.getFeaturesAsync(e)}}t.ExperimentationServiceAutoPolling=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(38);t.ExperimentationServiceBase=class{constructor(e,t,r,s,i,o){this.telemetry=e,this.featuresTelemetryPropertyName=t,this.assignmentContextTelemetryPropertyName=r,this.telemetryEventName=s,this.storageKey=i,this.storage=o,this.featuresConsumed=!1,this.cachedTelemetryEvents=[],this._features={features:[],assignmentContext:"",configs:[]},this.storageKey||(this.storageKey="ABExp.Features"),this.storage||(o=new n.MemoryKeyValueStorage),this.loadCachePromise=this.loadCachedFeatureData(),this.initializePromise=this.loadCachePromise,this.initialFetch=new Promise((e,t)=>{this.resolveInitialFetchPromise=e})}get features(){return this._features}set features(e){this._features=e,this.telemetry&&(this.telemetry.setSharedProperty(this.featuresTelemetryPropertyName,this.features.features.join(";")),this.telemetry.setSharedProperty(this.assignmentContextTelemetryPropertyName,this.features.assignmentContext))}async getFeaturesAsync(e=!1){if(null!=this.fetchPromise){try{await this.fetchPromise}catch(e){}return this.features}if(!this.featureProviders||0===this.featureProviders.length)return Promise.resolve({features:[],assignmentContext:"",configs:[]});this.fetchPromise=Promise.all(this.featureProviders.map(async e=>await e.getFeatures()));try{const t=await this.fetchPromise;this.updateFeatures(t,e)}catch(e){}return this.fetchPromise=void 0,this.resolveInitialFetchPromise&&(this.resolveInitialFetchPromise(),this.resolveInitialFetchPromise=void 0),this.features}updateFeatures(e,t=!1){let r={features:[],assignmentContext:"",configs:[]};for(let t of e){for(let e of t.features)r.features.includes(e)||r.features.push(e);for(let e of t.configs){const t=r.configs.find(t=>t.Id===e.Id);t?t.Parameters=Object.assign(Object.assign({},t.Parameters),e.Parameters):r.configs.push(e)}r.assignmentContext+=t.assignmentContext}!t&&this.featuresConsumed||(this.features=r),this.storage&&this.storage.setValue(this.storageKey,r)}async loadCachedFeatureData(){let e;this.storage&&(e=await this.storage.getValue(this.storageKey),void 0!==e&&void 0===e.configs&&(e.configs=[])),0===this.features.features.length&&(this.features=e||{features:[],assignmentContext:"",configs:[]})}isFlightEnabled(e){return this.featuresConsumed=!0,this.PostEventToTelemetry(e),this.features.features.includes(e)}async isCachedFlightEnabled(e){return await this.loadCachePromise,this.featuresConsumed=!0,this.PostEventToTelemetry(e),this.features.features.includes(e)}async isFlightEnabledAsync(e){const t=await this.getFeaturesAsync(!0);return this.featuresConsumed=!0,this.PostEventToTelemetry(e),t.features.includes(e)}getTreatmentVariable(e,t){var r;this.featuresConsumed=!0,this.PostEventToTelemetry(`${e}.${t}`);return null===(r=this.features.configs.find(t=>t.Id===e))||void 0===r?void 0:r.Parameters[t]}async getTreatmentVariableAsync(e,t,r){if(r){const r=this.featuresConsumed,n=this.getTreatmentVariable(e,t);if(void 0!==n)return n;this.featuresConsumed=r}return await this.getFeaturesAsync(!0),this.getTreatmentVariable(e,t)}PostEventToTelemetry(e){this.cachedTelemetryEvents.includes(e)||(this.telemetry.postEvent(this.telemetryEventName,new Map([["ABExp.queriedFeature",e]])),this.cachedTelemetryEvents.push(e))}invokeInit(){this.init()}addFeatureProvider(...e){if(null!=e&&null!=this.featureProviders)for(let t of e)this.featureProviders.push(t)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.MemoryKeyValueStorage=class{constructor(){this.storage=new Map}async getValue(e,t){return this.storage.has(e)?await Promise.resolve(this.storage.get(e)):await Promise.resolve(t||void 0)}setValue(e,t){this.storage.set(e,t)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PollingService=class{constructor(e){this.fetchInterval=e}StopPolling(){clearInterval(this.intervalHandle),this.intervalHandle=void 0}OnPollTick(e){this.onTick=e}StartPolling(e=!1){this.intervalHandle&&this.StopPolling(),null!=this.onTick&&(e&&this.onTick().then(()=>{}).catch(()=>{}),this.intervalHandle=setInterval(async()=>{await this.onTick()},this.fetchInterval),this.intervalHandle.unref&&this.intervalHandle.unref())}}}])}));//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/tas-client-umd/lib/tas-client-umd.js.map/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ //@ts-check const cdp = require('chrome-remote-interface'); async function wait(n) { return new Promise(resolve => setTimeout(resolve, n)); } async function connectWithRetry(port, tries = 10, retryWait = 50, errors = [], target) { if (typeof target === 'undefined') { target = function (targets) { const target = targets.find(target => { if (target.webSocketDebuggerUrl) { if (target.type === 'page') { return target.url.indexOf('bootstrap/index.html') > 0 } else { return true; } } }); if (!target) { throw new class extends Error { constructor() { super('no target'); this.code = 'ECONNREFUSED'; } }; } return target; }; } try { return await cdp({ port, target, local: true, }); } catch (e) { errors.push(e); if (tries <= 1) { throw new class extends Error { constructor() { super('failed to connect'); this.errors = errors; } } } await wait(retryWait); return connectWithRetry(port, tries - 1, retryWait, errors, target); } } async function startProfiling(options) { const client = await connectWithRetry(options.port, options.tries, options.retryWait, [], options.target); const { Runtime, Profiler } = client; if (options.checkForPaused) { // ensure the runtime isn't being debugged let { Debugger } = client; let isPaused = false; client.on('event', message => { if (message.method === 'Debugger.paused') { isPaused = true; } }) await Debugger.enable(); if (isPaused) { // client.close(); // ⬆︎ this leaks the connection but there is an issue in // chrome that it will resume the runtime whenever a client // disconnects. Because things are relatively short-lived // we trade the leakage for being able to debug return Promise.reject('runtime is paused'); } } else { // resume form inspect-brk await Runtime.runIfWaitingForDebugger(); } // now start profiling await Profiler.enable(); await Profiler.setSamplingInterval({ interval: 100 }); await Profiler.start(); return { stop: async function (n = 0) { if (n > 0) { await wait(n); } const data = await Profiler.stop(); await client.close(); return data; } } } module.exports = { startProfiling } MIT License Copyright (c) 2015 - present Microsoft Corporation All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "v8-inspect-profiler", "version": "0.1.0", "description": "v8 profiling via the chrome dev-tools protocol", "main": "index.js", "types": "index.d.ts", "author": "jrieken", "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/jrieken/v8-inspect-profiler.git" }, "dependencies": { "chrome-remote-interface": "0.28.2" } } VS Code Oniguruma Bindings MIT License Copyright (c) Microsoft Corporation. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. THIRD-PARTY SOFTWARE NOTICES AND INFORMATION Do Not Translate or Localize This project incorporates material from the project(s) listed below (collectively, “Third Party Code”). Microsoft is not the original author of the Third Party Code. The original copyright notice and license under which Microsoft received such Third Party Code are set out below. This Third Party Code is licensed to you under their original license terms set forth below. Microsoft reserves all other rights not expressly granted, whether by implication, estoppel or otherwise. The following files/folders contain third party software: ========================================================================================================= deps/oniguruma/ --- oniguruma version 6.9.5_rev1 https://github.com/kkos/oniguruma/tree/v6.9.5_rev1 --------------------------------------------------------------------------------------------------------- Oniguruma LICENSE ----------------- Copyright (c) 2002-2020 K.Kosako All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. { "name": "vscode-oniguruma", "version": "1.6.1", "description": "VSCode oniguruma bindings", "author": { "name": "Microsoft Corporation" }, "main": "release/main.js", "typings": "main.d.ts", "repository": { "type": "git", "url": "https://github.com/microsoft/vscode-oniguruma" }, "license": "MIT", "bugs": { "url": "https://github.com/microsoft/vscode-oniguruma/issues" }, "scripts": { "test": "tape -r ./out/test/index.test.js", "build-onig": "cd deps/oniguruma && autoreconf -vfi && emconfigure ./configure && make clean && emmake make", "build-wasm": "./scripts/build.sh", "build-tsc": "tsc -p tsconfig.json", "watch-tsc": "tsc -w -p tsconfig.json", "package": "webpack && node ./scripts/cp ./out/onig.wasm ./release/onig.wasm", "prepublishOnly": "npm run package" }, "devDependencies": { "@types/node": "^14.14.33", "@types/tape": "^4.13.0", "tape": "^5.2.2", "typescript": "^4.2.3", "webpack": "^5.38.1", "webpack-cli": "^4.7.2" } } !function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.onig=n():t.onig=n()}(this,(function(){return t={770:function(t,n,e){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0}),n.setDefaultDebugCall=n.createOnigScanner=n.createOnigString=n.loadWASM=n.OnigScanner=n.OnigString=void 0;const i=r(e(418));let o=null,a=!1;class f{constructor(t){const n=t.length,e=f._utf8ByteLength(t),r=e!==n,i=r?new Uint32Array(n+1):null;r&&(i[n]=e);const o=r?new Uint32Array(e+1):null;r&&(o[e]=n);const a=new Uint8Array(e);let s=0;for(let e=0;e=55296&&f<=56319&&e+1=56320&&n<=57343&&(u=65536+(f-55296<<10)|n-56320,c=!0)}r&&(i[e]=s,c&&(i[e+1]=s),u<=127?o[s+0]=e:u<=2047?(o[s+0]=e,o[s+1]=e):u<=65535?(o[s+0]=e,o[s+1]=e,o[s+2]=e):(o[s+0]=e,o[s+1]=e,o[s+2]=e,o[s+3]=e)),u<=127?a[s++]=u:u<=2047?(a[s++]=192|(1984&u)>>>6,a[s++]=128|(63&u)>>>0):u<=65535?(a[s++]=224|(61440&u)>>>12,a[s++]=128|(4032&u)>>>6,a[s++]=128|(63&u)>>>0):(a[s++]=240|(1835008&u)>>>18,a[s++]=128|(258048&u)>>>12,a[s++]=128|(4032&u)>>>6,a[s++]=128|(63&u)>>>0),c&&e++}this.utf16Length=n,this.utf8Length=e,this.utf16Value=t,this.utf8Value=a,this.utf16OffsetToUtf8=i,this.utf8OffsetToUtf16=o}static _utf8ByteLength(t){let n=0;for(let e=0,r=t.length;e=55296&&i<=56319&&e+1=56320&&n<=57343&&(o=65536+(i-55296<<10)|n-56320,a=!0)}n+=o<=127?1:o<=2047?2:o<=65535?3:4,a&&e++}return n}createString(t){const n=t._omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}class s{constructor(t){if(this.id=++s.LAST_ID,!o)throw new Error("Must invoke loadWASM first.");this._onigBinding=o,this.content=t;const n=new f(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!s._sharedPtrInUse?(s._sharedPtr||(s._sharedPtr=o._omalloc(1e4)),s._sharedPtrInUse=!0,o.HEAPU8.set(n.utf8Value,s._sharedPtr),this.ptr=s._sharedPtr):this.ptr=n.createString(o)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===s._sharedPtr?s._sharedPtrInUse=!1:this._onigBinding._ofree(this.ptr)}}n.OnigString=s,s.LAST_ID=0,s._sharedPtr=0,s._sharedPtrInUse=!1;class u{constructor(t){if(!o)throw new Error("Must invoke loadWASM first.");const n=[],e=[];for(let r=0,i=t.length;rWebAssembly.instantiate(t,n)}(r):r instanceof Response&&"function"==typeof WebAssembly.instantiateStreaming?function(t){return n=>WebAssembly.instantiateStreaming(t,n)}(r):function(t){return async n=>{const e=await t.arrayBuffer();return WebAssembly.instantiate(e,n)}}(r)}return l=new Promise(((t,n)=>{r=t,a=n})),function(t,n,e,r){i.default({print:n,instantiateWasm:(n,e)=>{if("undefined"==typeof performance){const t=()=>Date.now();n.env.emscripten_get_now=t,n.wasi_snapshot_preview1.emscripten_get_now=t}return t(n).then((t=>e(t.instance)),r),{}}}).then((t=>{o=t,e()}))}(n,e,r,a),l},n.createOnigString=function(t){return new s(t)},n.createOnigScanner=function(t){return new u(t)},n.setDefaultDebugCall=function(t){a=t}},418:t=>{var n=("undefined"!=typeof document&&document.currentScript&&document.currentScript.src,function(t){var n,e,r=void 0!==(t=t||{})?t:{};r.ready=new Promise((function(t,r){n=t,e=r}));var i,o={};for(i in r)r.hasOwnProperty(i)&&(o[i]=r[i]);var a,f=[],s=!1,u=!1,c=!0,l="";function p(t){return r.locateFile?r.locateFile(t,l):l+t}c&&(a=function(t){var n;return"function"==typeof readbuffer?new Uint8Array(readbuffer(t)):(v("object"==typeof(n=read(t,"binary"))),n)},"undefined"!=typeof scriptArgs?f=scriptArgs:void 0!==arguments&&(f=arguments),"undefined"!=typeof onig_print&&("undefined"==typeof console&&(console={}),console.log=onig_print,console.warn=console.error="undefined"!=typeof printErr?printErr:onig_print));var h=r.print||console.log.bind(console),g=r.printErr||console.warn.bind(console);for(i in o)o.hasOwnProperty(i)&&(r[i]=o[i]);o=null,r.arguments&&(f=r.arguments),r.thisProgram&&r.thisProgram,r.quit&&r.quit;var d,_,m=function(t){};r.wasmBinary&&(d=r.wasmBinary),r.noExitRuntime,"object"!=typeof WebAssembly&&z("no native wasm support detected");var y=!1;function v(t,n){t||z("Assertion failed: "+n)}var w,S,A,b="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function O(t,n,e){for(var r=n+e,i=n;t[i]&&!(i>=r);)++i;if(i-n>16&&t.subarray&&b)return b.decode(t.subarray(n,i));for(var o="";n>10,56320|1023&u)}}else o+=String.fromCharCode((31&a)<<6|f)}else o+=String.fromCharCode(a)}return o}function U(t,n){return t?O(S,t,n):""}function x(t,n){return t%n>0&&(t+=n-t%n),t}function P(t){w=t,r.HEAP8=new Int8Array(t),r.HEAP16=new Int16Array(t),r.HEAP32=A=new Int32Array(t),r.HEAPU8=S=new Uint8Array(t),r.HEAPU16=new Uint16Array(t),r.HEAPU32=new Uint32Array(t),r.HEAPF32=new Float32Array(t),r.HEAPF64=new Float64Array(t)}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le"),r.INITIAL_MEMORY;var T,R=[],E=[],M=[],L=[];function I(){if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)N(r.preRun.shift());$(R)}function D(){$(E)}function W(){$(M)}function C(){if(r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)B(r.postRun.shift());$(L)}function N(t){R.unshift(t)}function B(t){L.unshift(t)}E.push({func:function(){ut()}});var k=0,H=null,j=null;function F(t){k++,r.monitorRunDependencies&&r.monitorRunDependencies(k)}function V(t){if(k--,r.monitorRunDependencies&&r.monitorRunDependencies(k),0==k&&(null!==H&&(clearInterval(H),H=null),j)){var n=j;j=null,n()}}function z(t){r.onAbort&&r.onAbort(t),g(t+=""),y=!0,t="abort("+t+"). Build with -s ASSERTIONS=1 for more info.";var n=new WebAssembly.RuntimeError(t);throw e(n),n}function q(t,n){return String.prototype.startsWith?t.startsWith(n):0===t.indexOf(n)}r.preloadedImages={},r.preloadedAudios={};var Y="data:application/octet-stream;base64,";function G(t){return q(t,Y)}var J,K="onig.wasm";function Q(t){try{if(t==K&&d)return new Uint8Array(d);if(a)return a(t);throw"both async and sync fetching of the wasm failed"}catch(t){z(t)}}function X(){return d||!s&&!u||"function"!=typeof fetch?Promise.resolve().then((function(){return Q(K)})):fetch(K,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+K+"'";return t.arrayBuffer()})).catch((function(){return Q(K)}))}function Z(){var t={env:st,wasi_snapshot_preview1:st};function n(t,n){var e=t.exports;r.asm=e,P((_=r.asm.memory).buffer),T=r.asm.__indirect_function_table,V()}function i(t){n(t.instance)}function o(n){return X().then((function(n){return WebAssembly.instantiate(n,t)})).then(n,(function(t){g("failed to asynchronously prepare wasm: "+t),z(t)}))}if(F(),r.instantiateWasm)try{return r.instantiateWasm(t,n)}catch(t){return g("Module.instantiateWasm callback failed with error: "+t),!1}return(d||"function"!=typeof WebAssembly.instantiateStreaming||G(K)||"function"!=typeof fetch?o(i):fetch(K,{credentials:"same-origin"}).then((function(n){return WebAssembly.instantiateStreaming(n,t).then(i,(function(t){return g("wasm streaming compile failed: "+t),g("falling back to ArrayBuffer instantiation"),o(i)}))}))).catch(e),{}}function $(t){for(;t.length>0;){var n=t.shift();if("function"!=typeof n){var e=n.func;"number"==typeof e?void 0===n.arg?T.get(e)():T.get(e)(n.arg):e(void 0===n.arg?null:n.arg)}else n(r)}}function tt(t,n,e){S.copyWithin(t,n,n+e)}function nt(){return S.length}function et(t){try{return _.grow(t-w.byteLength+65535>>>16),P(_.buffer),1}catch(t){}}function rt(t){var n=nt(),e=2147483648;if(t>e)return!1;for(var r=1;r<=4;r*=2){var i=n*(1+.2/r);if(i=Math.min(i,t+100663296),et(Math.min(e,x(Math.max(t,i),65536))))return!0}return!1}G(K)||(K=p(K)),J="undefined"!=typeof dateNow?dateNow:function(){return performance.now()};var it={mappings:{},buffers:[null,[],[]],printChar:function(t,n){var e=it.buffers[t];0===n||10===n?((1===t?h:g)(O(e,0)),e.length=0):e.push(n)},varargs:void 0,get:function(){return it.varargs+=4,A[it.varargs-4>>2]},getStr:function(t){return U(t)},get64:function(t,n){return t}};function ot(t,n,e,r){for(var i=0,o=0;o>2],f=A[n+(8*o+4)>>2],s=0;s>2]=i,0}function at(t){m(0|t)}var ft,st={emscripten_get_now:J,emscripten_memcpy_big:tt,emscripten_resize_heap:rt,fd_write:ot,setTempRet0:at},ut=(Z(),r.___wasm_call_ctors=function(){return(ut=r.___wasm_call_ctors=r.asm.__wasm_call_ctors).apply(null,arguments)});function ct(t){function e(){ft||(ft=!0,r.calledRun=!0,y||(D(),W(),n(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),C()))}t=t||f,k>0||(I(),k>0||(r.setStatus?(r.setStatus("Running..."),setTimeout((function(){setTimeout((function(){r.setStatus("")}),1),e()}),1)):e()))}if(r.___errno_location=function(){return(r.___errno_location=r.asm.__errno_location).apply(null,arguments)},r._omalloc=function(){return(r._omalloc=r.asm.omalloc).apply(null,arguments)},r._ofree=function(){return(r._ofree=r.asm.ofree).apply(null,arguments)},r._getLastOnigError=function(){return(r._getLastOnigError=r.asm.getLastOnigError).apply(null,arguments)},r._createOnigScanner=function(){return(r._createOnigScanner=r.asm.createOnigScanner).apply(null,arguments)},r._freeOnigScanner=function(){return(r._freeOnigScanner=r.asm.freeOnigScanner).apply(null,arguments)},r._findNextOnigScannerMatch=function(){return(r._findNextOnigScannerMatch=r.asm.findNextOnigScannerMatch).apply(null,arguments)},r._findNextOnigScannerMatchDbg=function(){return(r._findNextOnigScannerMatchDbg=r.asm.findNextOnigScannerMatchDbg).apply(null,arguments)},r.stackSave=function(){return(r.stackSave=r.asm.stackSave).apply(null,arguments)},r.stackRestore=function(){return(r.stackRestore=r.asm.stackRestore).apply(null,arguments)},r.stackAlloc=function(){return(r.stackAlloc=r.asm.stackAlloc).apply(null,arguments)},r.dynCall_jiji=function(){return(r.dynCall_jiji=r.asm.dynCall_jiji).apply(null,arguments)},r.UTF8ToString=U,j=function t(){ft||ct(),ft||(j=t)},r.run=ct,r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return ct(),t.ready});t.exports=n}},n={},function e(r){var i=n[r];if(void 0!==i)return i.exports;var o=n[r]={exports:{}};return t[r].call(o.exports,o,o.exports,e),o.exports}(770);var t,n}));/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ exports.createWatcher = require('bindings')('vscode-policy-watcher'); if (require.main === module) { exports.createWatcher( 'CodeOSS', { UpdateMode: { type: 'string' }, SCMInputFontSize: { type: 'number' }, }, msg => console.log(msg) ); } MIT License Copyright (c) Microsoft Corporation. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE { "name": "vscode-policy-watcher", "version": "1.1.1", "description": "", "main": "index.js", "scripts": { "build": "node-gyp build", "rebuild": "node-gyp rebuild", "prepare": "husky install" }, "repository": { "type": "git", "url": "git+https://github.com/microsoft/vscode-policy-watcher.git" }, "author": "João Moreno", "license": "MIT", "types": "index.d.ts", "dependencies": { "bindings": "^1.5.0", "node-addon-api": "*" }, "devDependencies": { "@commitlint/cli": "^17.0.0", "@commitlint/config-conventional": "^17.0.0", "husky": "^8.0.1", "node-gyp": "^9.0.0", "semantic-release": "^19.0.2" }, "release": { "branches": [ "main" ] }, "commitlint": { "extends": [ "@commitlint/config-conventional" ] } } MIT License Copyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net> Copyright (c) 2015 Félicien François <felicien@tweakstyle.com> Copyright (c) Microsoft Corporation. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "vscode-proxy-agent", "version": "0.12.0", "description": "NodeJS http(s) agent implementation for VS Code", "main": "out/index.js", "types": "out/index.d.ts", "repository": { "type": "git", "url": "git://github.com/Microsoft/vscode-proxy-agent.git" }, "keywords": [ "proxy", "agent", "http", "https", "socks", "request", "access" ], "authors": [ "Nathan Rajlich (http://n8.io/)", "Félicien François ", "Microsoft Corporation" ], "license": "MIT", "bugs": { "url": "https://github.com/Microsoft/vscode-proxy-agent/issues" }, "homepage": "https://github.com/Microsoft/vscode-proxy-agent", "dependencies": { "@tootallnate/once": "^1.1.2", "agent-base": "^6.0.2", "debug": "^4.3.1", "http-proxy-agent": "^4.0.1", "https-proxy-agent": "^5.0.0", "socks-proxy-agent": "^5.0.0" }, "optionalDependencies": { "vscode-windows-ca-certs": "^0.3.0" }, "devDependencies": { "@types/debug": "^4.1.5", "@types/node": "^12.18.3", "typescript": "^4.2.2" }, "scripts": { "compile": "tsc -p ./", "watch": "tsc -watch -p ./" } } "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; const http_1 = __importDefault(require("http")); const https_1 = __importDefault(require("https")); const once_1 = __importDefault(require("@tootallnate/once")); const debug_1 = __importDefault(require("debug")); const url_1 = require("url"); const http_proxy_agent_1 = require("http-proxy-agent"); const https_proxy_agent_1 = require("https-proxy-agent"); const socks_proxy_agent_1 = require("socks-proxy-agent"); const agent_base_1 = require("agent-base"); const debug = debug_1.default('pac-proxy-agent'); /** * The `PacProxyAgent` class. * * A few different "protocol" modes are supported (supported protocols are * backed by the `get-uri` module): * * - "pac+data", "data" - refers to an embedded "data:" URI * - "pac+file", "file" - refers to a local file * - "pac+ftp", "ftp" - refers to a file located on an FTP server * - "pac+http", "http" - refers to an HTTP endpoint * - "pac+https", "https" - refers to an HTTPS endpoint * * @api public */ class _PacProxyAgent extends agent_base_1.Agent { constructor(resolver, opts = {}) { super(opts); debug('Creating PacProxyAgent with options %o', opts); this.resolver = resolver; this.opts = Object.assign({}, opts); this.cache = undefined; } /** * Called when the node-core HTTP client library is creating a new HTTP request. * * @api protected */ callback(req, opts) { return __awaiter(this, void 0, void 0, function* () { const { secureEndpoint } = opts; // Calculate the `url` parameter const defaultPort = secureEndpoint ? 443 : 80; let path = req.path; let search = null; const firstQuestion = path.indexOf('?'); if (firstQuestion !== -1) { search = path.substring(firstQuestion); path = path.substring(0, firstQuestion); } const urlOpts = Object.assign(Object.assign({}, opts), { protocol: secureEndpoint ? 'https:' : 'http:', pathname: path, search, // need to use `hostname` instead of `host` otherwise `port` is ignored hostname: opts.host, host: null, href: null, // set `port` to null when it is the protocol default port (80 / 443) port: defaultPort === opts.port ? null : opts.port }); const url = url_1.format(urlOpts); debug('url: %o', url); let result = yield this.resolver(req, opts, url); // Default to "DIRECT" if a falsey value was returned (or nothing) if (!result) { result = 'DIRECT'; } const proxies = String(result) .trim() .split(/\s*;\s*/g) .filter(Boolean); if (this.opts.fallbackToDirect && !proxies.includes('DIRECT')) { proxies.push('DIRECT'); } for (const proxy of proxies) { let agent = null; let socket = null; const [type, target] = proxy.split(/\s+/); debug('Attempting to use proxy: %o', proxy); if (type === 'DIRECT') { // Needed for SNI. const originalAgent = this.opts.originalAgent; const defaultAgent = secureEndpoint ? https_1.default.globalAgent : http_1.default.globalAgent; agent = originalAgent === false ? new defaultAgent.constructor() : (originalAgent || defaultAgent); } else if (type === 'SOCKS' || type === 'SOCKS5') { // Use a SOCKSv5h proxy agent = new socks_proxy_agent_1.SocksProxyAgent(`socks://${target}`); } else if (type === 'SOCKS4') { // Use a SOCKSv4a proxy agent = new socks_proxy_agent_1.SocksProxyAgent(`socks4a://${target}`); } else if (type === 'PROXY' || type === 'HTTP' || type === 'HTTPS') { // Use an HTTP or HTTPS proxy // http://dev.chromium.org/developers/design-documents/secure-web-proxy const proxyURL = `${type === 'HTTPS' ? 'https' : 'http'}://${target}`; const proxyOpts = Object.assign(Object.assign({}, this.opts), url_1.parse(proxyURL)); if (secureEndpoint) { agent = new https_proxy_agent_1.HttpsProxyAgent(proxyOpts); } else { agent = new http_proxy_agent_1.HttpProxyAgent(proxyOpts); } } try { if (socket) { // "DIRECT" connection, wait for connection confirmation yield once_1.default(socket, 'connect'); req.emit('proxy', { proxy, socket }); return socket; } if (agent) { let s; if (agent instanceof agent_base_1.Agent) { s = yield agent.callback(req, opts); } else { s = agent; } req.emit('proxy', { proxy, socket: s }); return s; } throw new Error(`Could not determine proxy type for: ${proxy}`); } catch (err) { debug('Got error for proxy %o: %o', proxy, err); req.emit('proxy', { proxy, error: err }); } } throw new Error(`Failed to establish a socket connection to proxies: ${JSON.stringify(proxies)}`); }); } } function createPacProxyAgent(resolver, opts) { if (!opts) { opts = {}; } if (typeof resolver !== 'function') { throw new TypeError('a resolve function must be specified!'); } return new _PacProxyAgent(resolver, opts); } (function (createPacProxyAgent) { createPacProxyAgent.PacProxyAgent = _PacProxyAgent; createPacProxyAgent.prototype = _PacProxyAgent.prototype; })(createPacProxyAgent || (createPacProxyAgent = {})); module.exports = createPacProxyAgent;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/vscode-proxy-agent/out/agent.js.map"use strict"; /*--------------------------------------------------------------------------------------------- * Copyright (c) Nathan Rajlich, Félicien François, Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.createTlsPatch = exports.createHttpPatch = exports.createProxyResolver = exports.LogLevel = void 0; const nodeurl = __importStar(require("url")); const os = __importStar(require("os")); const fs = __importStar(require("fs")); const cp = __importStar(require("child_process")); const agent_1 = __importStar(require("./agent")); const SocksProxyAgent = require('socks-proxy-agent'); var LogLevel; (function (LogLevel) { LogLevel[LogLevel["Trace"] = 0] = "Trace"; LogLevel[LogLevel["Debug"] = 1] = "Debug"; LogLevel[LogLevel["Info"] = 2] = "Info"; LogLevel[LogLevel["Warning"] = 3] = "Warning"; LogLevel[LogLevel["Error"] = 4] = "Error"; LogLevel[LogLevel["Critical"] = 5] = "Critical"; LogLevel[LogLevel["Off"] = 6] = "Off"; })(LogLevel = exports.LogLevel || (exports.LogLevel = {})); const maxCacheEntries = 5000; // Cache can grow twice that much due to 'oldCache'. function createProxyResolver(params) { const { getHttpProxySetting, log, getLogLevel, proxyResolveTelemetry: proxyResolverTelemetry, useHostProxy, env } = params; let envProxy = proxyFromConfigURL(env.https_proxy || env.HTTPS_PROXY || env.http_proxy || env.HTTP_PROXY); // Not standardized. let envNoProxy = noProxyFromEnv(env.no_proxy || env.NO_PROXY); // Not standardized. let cacheRolls = 0; let oldCache = new Map(); let cache = new Map(); function getCacheKey(url) { // Expecting proxies to usually be the same per scheme://host:port. Assuming that for performance. return nodeurl.format(Object.assign(Object.assign({}, url), { pathname: undefined, search: undefined, hash: undefined })); } function getCachedProxy(key) { let proxy = cache.get(key); if (proxy) { return proxy; } proxy = oldCache.get(key); if (proxy) { oldCache.delete(key); cacheProxy(key, proxy); } return proxy; } function cacheProxy(key, proxy) { cache.set(key, proxy); if (cache.size >= maxCacheEntries) { oldCache = cache; cache = new Map(); cacheRolls++; log(LogLevel.Debug, 'ProxyResolver#cacheProxy cacheRolls', cacheRolls); } } let timeout; let count = 0; let duration = 0; let errorCount = 0; let cacheCount = 0; let envCount = 0; let settingsCount = 0; let localhostCount = 0; let envNoProxyCount = 0; let results = []; function logEvent() { timeout = undefined; proxyResolverTelemetry({ count, duration, errorCount, cacheCount, cacheSize: cache.size, cacheRolls, envCount, settingsCount, localhostCount, envNoProxyCount, results }); count = duration = errorCount = cacheCount = envCount = settingsCount = localhostCount = envNoProxyCount = 0; results = []; } function resolveProxy(flags, req, opts, url, callback) { if (!timeout) { timeout = setTimeout(logEvent, 10 * 60 * 1000); } const stackText = getLogLevel() === LogLevel.Trace ? '\n' + new Error('Error for stack trace').stack : ''; useSystemCertificates(params, flags.useSystemCertificates, opts, () => { useProxySettings(useHostProxy, flags.useProxySettings, req, opts, url, stackText, callback); }); } function useProxySettings(useHostProxy, useProxySettings, req, opts, url, stackText, callback) { if (!useProxySettings) { callback('DIRECT'); return; } const parsedUrl = nodeurl.parse(url); // Coming from Node's URL, sticking with that. const hostname = parsedUrl.hostname; if (hostname === 'localhost' || hostname === '127.0.0.1' || hostname === '::1' || hostname === '::ffff:127.0.0.1') { localhostCount++; callback('DIRECT'); log(LogLevel.Debug, 'ProxyResolver#resolveProxy localhost', url, 'DIRECT', stackText); return; } const { secureEndpoint } = opts; const defaultPort = secureEndpoint ? 443 : 80; if (typeof hostname === 'string' && envNoProxy(hostname, String(parsedUrl.port || defaultPort))) { envNoProxyCount++; callback('DIRECT'); log(LogLevel.Debug, 'ProxyResolver#resolveProxy envNoProxy', url, 'DIRECT', stackText); return; } let settingsProxy = proxyFromConfigURL(getHttpProxySetting()); if (settingsProxy) { settingsCount++; callback(settingsProxy); log(LogLevel.Debug, 'ProxyResolver#resolveProxy settings', url, settingsProxy, stackText); return; } if (envProxy) { envCount++; callback(envProxy); log(LogLevel.Debug, 'ProxyResolver#resolveProxy env', url, envProxy, stackText); return; } const key = getCacheKey(parsedUrl); const proxy = getCachedProxy(key); if (proxy) { cacheCount++; collectResult(results, proxy, parsedUrl.protocol === 'https:' ? 'HTTPS' : 'HTTP', req); callback(proxy); log(LogLevel.Debug, 'ProxyResolver#resolveProxy cached', url, proxy, stackText); return; } if (!useHostProxy) { callback('DIRECT'); log(LogLevel.Debug, 'ProxyResolver#resolveProxy unconfigured', url, 'DIRECT', stackText); return; } const start = Date.now(); params.resolveProxy(url) // Use full URL to ensure it is an actually used one. .then(proxy => { if (proxy) { cacheProxy(key, proxy); collectResult(results, proxy, parsedUrl.protocol === 'https:' ? 'HTTPS' : 'HTTP', req); } callback(proxy); log(LogLevel.Debug, 'ProxyResolver#resolveProxy', url, proxy, stackText); }).then(() => { count++; duration = Date.now() - start + duration; }, err => { errorCount++; const fallback = cache.values().next().value; // fall back to any proxy (https://github.com/microsoft/vscode/issues/122825) callback(fallback); log(LogLevel.Error, 'ProxyResolver#resolveProxy', fallback, toErrorMessage(err), stackText); }); } return resolveProxy; } exports.createProxyResolver = createProxyResolver; function collectResult(results, resolveProxy, connection, req) { const proxy = resolveProxy ? String(resolveProxy).trim().split(/\s+/, 1)[0] : 'EMPTY'; req.on('response', res => { const code = `HTTP_${res.statusCode}`; const result = findOrCreateResult(results, proxy, connection, code); result.count++; }); req.on('error', err => { const code = err && typeof err.code === 'string' && err.code || 'UNKNOWN_ERROR'; const result = findOrCreateResult(results, proxy, connection, code); result.count++; }); } function findOrCreateResult(results, proxy, connection, code) { for (const result of results) { if (result.proxy === proxy && result.connection === connection && result.code === code) { return result; } } const result = { proxy, connection, code, count: 0 }; results.push(result); return result; } function proxyFromConfigURL(configURL) { if (!configURL) { return undefined; } const url = (configURL || '').trim(); const i = url.indexOf('://'); if (i === -1) { return undefined; } const scheme = url.substr(0, i).toLowerCase(); const proxy = url.substr(i + 3); if (scheme === 'http') { return 'PROXY ' + proxy; } else if (scheme === 'https') { return 'HTTPS ' + proxy; } else if (scheme === 'socks') { return 'SOCKS ' + proxy; } return undefined; } function noProxyFromEnv(envValue) { const value = (envValue || '') .trim() .toLowerCase(); if (value === '*') { return () => true; } const filters = value .split(',') .map(s => s.trim().split(':', 2)) .map(([name, port]) => ({ name, port })) .filter(filter => !!filter.name) .map(({ name, port }) => { const domain = name[0] === '.' ? name : `.${name}`; return { domain, port }; }); if (!filters.length) { return () => false; } return (hostname, port) => filters.some(({ domain, port: filterPort }) => { return `.${hostname.toLowerCase()}`.endsWith(domain) && (!filterPort || port === filterPort); }); } function createHttpPatch(originals, resolveProxy, proxySetting, certSetting, onRequest) { return { get: patch(originals.get), request: patch(originals.request) }; function patch(original) { function patched(url, options, callback) { if (typeof url !== 'string' && !(url && url.searchParams)) { callback = options; options = url; url = null; } if (typeof options === 'function') { callback = options; options = null; } options = options || {}; if (options.socketPath) { return original.apply(null, arguments); } const originalAgent = options.agent; if (originalAgent === true) { throw new Error('Unexpected agent option: true'); } const isHttps = originals.globalAgent.protocol === 'https:'; const optionsPatched = originalAgent instanceof agent_1.PacProxyAgent; const config = onRequest && (options._vscodeProxySupport || /* LS */ options._vscodeSystemProxy) || proxySetting.config; const useProxySettings = !optionsPatched && (config === 'override' || config === 'fallback' || (config === 'on' && originalAgent === undefined)); const useSystemCertificates = !optionsPatched && certSetting.config && isHttps && !options.ca; if (useProxySettings || useSystemCertificates) { if (url) { const parsed = typeof url === 'string' ? new nodeurl.URL(url) : url; const urlOptions = { protocol: parsed.protocol, hostname: parsed.hostname.lastIndexOf('[', 0) === 0 ? parsed.hostname.slice(1, -1) : parsed.hostname, port: parsed.port, path: `${parsed.pathname}${parsed.search}` }; if (parsed.username || parsed.password) { options.auth = `${parsed.username}:${parsed.password}`; } options = Object.assign(Object.assign({}, urlOptions), options); } else { options = Object.assign({}, options); } const resolveP = (req, opts, url) => new Promise(resolve => resolveProxy({ useProxySettings, useSystemCertificates }, req, opts, url, resolve)); const host = options.hostname || options.host; const isLocalhost = !host || host === 'localhost' || host === '127.0.0.1'; // Avoiding https://github.com/microsoft/vscode/issues/120354 options.agent = agent_1.default(resolveP, { originalAgent: (!useProxySettings || isLocalhost || config === 'fallback') ? originalAgent : undefined }); return original(options, callback); } return original.apply(null, arguments); } return patched; } } exports.createHttpPatch = createHttpPatch; function createTlsPatch(originals) { return { createSecureContext: patchCreateSecureContext(originals.createSecureContext), }; } exports.createTlsPatch = createTlsPatch; function patchCreateSecureContext(original) { return function (details) { const context = original.apply(null, arguments); const certs = details._vscodeAdditionalCaCerts; if (certs) { for (const cert of certs) { context.context.addCACert(cert); } } return context; }; } function useSystemCertificates(params, useSystemCertificates, opts, callback) { if (useSystemCertificates) { getCaCertificates(params) .then(caCertificates => { if (caCertificates) { if (caCertificates.append) { opts._vscodeAdditionalCaCerts = caCertificates.certs; } else { opts.ca = caCertificates.certs; } } callback(); }) .catch(err => { params.log(LogLevel.Error, 'ProxyResolver#useSystemCertificates', toErrorMessage(err)); }); } else { callback(); } } let _caCertificates; function getCaCertificates({ log }) { return __awaiter(this, void 0, void 0, function* () { if (!_caCertificates) { _caCertificates = readCaCertificates() .then(res => { log(LogLevel.Debug, 'ProxyResolver#getCaCertificates count', res && res.certs.length); return res && res.certs.length ? res : undefined; }) .catch(err => { log(LogLevel.Error, 'ProxyResolver#getCaCertificates error', toErrorMessage(err)); return undefined; }); } return _caCertificates; }); } function readCaCertificates() { return __awaiter(this, void 0, void 0, function* () { if (process.platform === 'win32') { return readWindowsCaCertificates(); } if (process.platform === 'darwin') { return readMacCaCertificates(); } if (process.platform === 'linux') { return readLinuxCaCertificates(); } return undefined; }); } function readWindowsCaCertificates() { return __awaiter(this, void 0, void 0, function* () { // @ts-ignore Windows only const winCA = yield Promise.resolve().then(() => __importStar(require('vscode-windows-ca-certs'))); let ders = []; const store = new winCA.Crypt32(); try { let der; while (der = store.next()) { ders.push(der); } } finally { store.done(); } const certs = new Set(ders.map(derToPem)); return { certs: Array.from(certs), append: true }; }); } function readMacCaCertificates() { return __awaiter(this, void 0, void 0, function* () { const stdout = yield new Promise((resolve, reject) => { const child = cp.spawn('/usr/bin/security', ['find-certificate', '-a', '-p']); const stdout = []; child.stdout.setEncoding('utf8'); child.stdout.on('data', str => stdout.push(str)); child.on('error', reject); child.on('exit', code => code ? reject(code) : resolve(stdout.join(''))); }); const certs = new Set(stdout.split(/(?=-----BEGIN CERTIFICATE-----)/g) .filter(pem => !!pem.length)); return { certs: Array.from(certs), append: true }; }); } const linuxCaCertificatePaths = [ '/etc/ssl/certs/ca-certificates.crt', '/etc/ssl/certs/ca-bundle.crt', ]; function readLinuxCaCertificates() { return __awaiter(this, void 0, void 0, function* () { for (const certPath of linuxCaCertificatePaths) { try { const content = yield fs.promises.readFile(certPath, { encoding: 'utf8' }); const certs = new Set(content.split(/(?=-----BEGIN CERTIFICATE-----)/g) .filter(pem => !!pem.length)); return { certs: Array.from(certs), append: false }; } catch (err) { if (err.code !== 'ENOENT') { throw err; } } } return undefined; }); } function derToPem(blob) { const lines = ['-----BEGIN CERTIFICATE-----']; const der = blob.toString('base64'); for (let i = 0; i < der.length; i += 64) { lines.push(der.substr(i, 64)); } lines.push('-----END CERTIFICATE-----', ''); return lines.join(os.EOL); } function toErrorMessage(err) { return err && (err.stack || err.message) || String(err); }//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/vscode-proxy-agent/out/index.js.map{ "name": "agent-base", "version": "6.0.2", "description": "Turn a function into an `http.Agent` instance", "main": "dist/src/index", "typings": "dist/src/index", "files": [ "dist/src", "src" ], "scripts": { "prebuild": "rimraf dist", "build": "tsc", "postbuild": "cpy --parents src test '!**/*.ts' dist", "test": "mocha --reporter spec dist/test/*.js", "test-lint": "eslint src --ext .js,.ts", "prepublishOnly": "npm run build" }, "repository": { "type": "git", "url": "git://github.com/TooTallNate/node-agent-base.git" }, "keywords": [ "http", "agent", "base", "barebones", "https" ], "author": "Nathan Rajlich (http://n8.io/)", "license": "MIT", "bugs": { "url": "https://github.com/TooTallNate/node-agent-base/issues" }, "dependencies": { "debug": "4" }, "devDependencies": { "@types/debug": "4", "@types/mocha": "^5.2.7", "@types/node": "^14.0.20", "@types/semver": "^7.1.0", "@types/ws": "^6.0.3", "@typescript-eslint/eslint-plugin": "1.6.0", "@typescript-eslint/parser": "1.1.0", "async-listen": "^1.2.0", "cpy-cli": "^2.0.0", "eslint": "5.16.0", "eslint-config-airbnb": "17.1.0", "eslint-config-prettier": "4.1.0", "eslint-import-resolver-typescript": "1.1.1", "eslint-plugin-import": "2.16.0", "eslint-plugin-jsx-a11y": "6.2.1", "eslint-plugin-react": "7.12.4", "mocha": "^6.2.0", "rimraf": "^3.0.0", "semver": "^7.1.2", "typescript": "^3.5.3", "ws": "^3.0.0" }, "engines": { "node": ">= 6.0.0" } } { "name": "https-proxy-agent", "version": "5.0.0", "description": "An HTTP(s) proxy `http.Agent` implementation for HTTPS", "main": "dist/index", "types": "dist/index", "files": [ "dist" ], "scripts": { "prebuild": "rimraf dist", "build": "tsc", "test": "mocha --reporter spec", "test-lint": "eslint src --ext .js,.ts", "prepublishOnly": "npm run build" }, "repository": { "type": "git", "url": "git://github.com/TooTallNate/node-https-proxy-agent.git" }, "keywords": [ "https", "proxy", "endpoint", "agent" ], "author": "Nathan Rajlich (http://n8.io/)", "license": "MIT", "bugs": { "url": "https://github.com/TooTallNate/node-https-proxy-agent/issues" }, "dependencies": { "agent-base": "6", "debug": "4" }, "devDependencies": { "@types/debug": "4", "@types/node": "^12.12.11", "@typescript-eslint/eslint-plugin": "1.6.0", "@typescript-eslint/parser": "1.1.0", "eslint": "5.16.0", "eslint-config-airbnb": "17.1.0", "eslint-config-prettier": "4.1.0", "eslint-import-resolver-typescript": "1.1.1", "eslint-plugin-import": "2.16.0", "eslint-plugin-jsx-a11y": "6.2.1", "eslint-plugin-react": "7.12.4", "mocha": "^6.2.2", "proxy": "1", "rimraf": "^3.0.0", "typescript": "^3.5.3" }, "engines": { "node": ">= 6" } } { "name": "http-proxy-agent", "version": "4.0.1", "description": "An HTTP(s) proxy `http.Agent` implementation for HTTP", "main": "./dist/index.js", "types": "./dist/index.d.ts", "files": [ "dist" ], "scripts": { "prebuild": "rimraf dist", "build": "tsc", "test": "mocha", "test-lint": "eslint src --ext .js,.ts", "prepublishOnly": "npm run build" }, "repository": { "type": "git", "url": "git://github.com/TooTallNate/node-http-proxy-agent.git" }, "keywords": [ "http", "proxy", "endpoint", "agent" ], "author": "Nathan Rajlich (http://n8.io/)", "license": "MIT", "bugs": { "url": "https://github.com/TooTallNate/node-http-proxy-agent/issues" }, "dependencies": { "@tootallnate/once": "1", "agent-base": "6", "debug": "4" }, "devDependencies": { "@types/debug": "4", "@types/node": "^12.12.11", "@typescript-eslint/eslint-plugin": "1.6.0", "@typescript-eslint/parser": "1.1.0", "eslint": "5.16.0", "eslint-config-airbnb": "17.1.0", "eslint-config-prettier": "4.1.0", "eslint-import-resolver-typescript": "1.1.1", "eslint-plugin-import": "2.16.0", "eslint-plugin-jsx-a11y": "6.2.1", "eslint-plugin-react": "7.12.4", "mocha": "^6.2.2", "proxy": "1", "rimraf": "^3.0.0", "typescript": "^3.5.3" }, "engines": { "node": ">= 6" } } "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const net_1 = __importDefault(require("net")); const tls_1 = __importDefault(require("tls")); const url_1 = __importDefault(require("url")); const assert_1 = __importDefault(require("assert")); const debug_1 = __importDefault(require("debug")); const agent_base_1 = require("agent-base"); const parse_proxy_response_1 = __importDefault(require("./parse-proxy-response")); const debug = debug_1.default('https-proxy-agent:agent'); /** * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to * the specified "HTTP(s) proxy server" in order to proxy HTTPS requests. * * Outgoing HTTP requests are first tunneled through the proxy server using the * `CONNECT` HTTP request method to establish a connection to the proxy server, * and then the proxy server connects to the destination target and issues the * HTTP request from the proxy server. * * `https:` requests have their socket connection upgraded to TLS once * the connection to the proxy server has been established. * * @api public */ class HttpsProxyAgent extends agent_base_1.Agent { constructor(_opts) { let opts; if (typeof _opts === 'string') { opts = url_1.default.parse(_opts); } else { opts = _opts; } if (!opts) { throw new Error('an HTTP(S) proxy server `host` and `port` must be specified!'); } debug('creating new HttpsProxyAgent instance: %o', opts); super(opts); const proxy = Object.assign({}, opts); // If `true`, then connect to the proxy server over TLS. // Defaults to `false`. this.secureProxy = opts.secureProxy || isHTTPS(proxy.protocol); // Prefer `hostname` over `host`, and set the `port` if needed. proxy.host = proxy.hostname || proxy.host; if (typeof proxy.port === 'string') { proxy.port = parseInt(proxy.port, 10); } if (!proxy.port && proxy.host) { proxy.port = this.secureProxy ? 443 : 80; } // ALPN is supported by Node.js >= v5. // attempt to negotiate http/1.1 for proxy servers that support http/2 if (this.secureProxy && !('ALPNProtocols' in proxy)) { proxy.ALPNProtocols = ['http 1.1']; } if (proxy.host && proxy.path) { // If both a `host` and `path` are specified then it's most likely // the result of a `url.parse()` call... we need to remove the // `path` portion so that `net.connect()` doesn't attempt to open // that as a Unix socket file. delete proxy.path; delete proxy.pathname; } this.proxy = proxy; } /** * Called when the node-core HTTP client library is creating a * new HTTP request. * * @api protected */ callback(req, opts) { return __awaiter(this, void 0, void 0, function* () { const { proxy, secureProxy } = this; // Create a socket connection to the proxy server. let socket; if (secureProxy) { debug('Creating `tls.Socket`: %o', proxy); socket = tls_1.default.connect(proxy); } else { debug('Creating `net.Socket`: %o', proxy); socket = net_1.default.connect(proxy); } const headers = Object.assign({}, proxy.headers); const hostname = `${opts.host}:${opts.port}`; let payload = `CONNECT ${hostname} HTTP/1.1\r\n`; // Inject the `Proxy-Authorization` header if necessary. if (proxy.auth) { headers['Proxy-Authorization'] = `Basic ${Buffer.from(proxy.auth).toString('base64')}`; } // The `Host` header should only include the port // number when it is not the default port. let { host, port, secureEndpoint } = opts; if (!isDefaultPort(port, secureEndpoint)) { host += `:${port}`; } headers.Host = host; headers.Connection = 'close'; for (const name of Object.keys(headers)) { payload += `${name}: ${headers[name]}\r\n`; } const proxyResponsePromise = parse_proxy_response_1.default(socket); socket.write(`${payload}\r\n`); const { statusCode, buffered } = yield proxyResponsePromise; if (statusCode === 200) { req.once('socket', resume); if (opts.secureEndpoint) { const servername = opts.servername || opts.host; if (!servername) { throw new Error('Could not determine "servername"'); } // The proxy is connecting to a TLS server, so upgrade // this socket connection to a TLS connection. debug('Upgrading socket connection to TLS'); return tls_1.default.connect(Object.assign(Object.assign({}, omit(opts, 'host', 'hostname', 'path', 'port')), { socket, servername })); } return socket; } // Some other status code that's not 200... need to re-play the HTTP // header "data" events onto the socket once the HTTP machinery is // attached so that the node core `http` can parse and handle the // error status code. // Close the original socket, and a new "fake" socket is returned // instead, so that the proxy doesn't get the HTTP request // written to it (which may contain `Authorization` headers or other // sensitive data). // // See: https://hackerone.com/reports/541502 socket.destroy(); const fakeSocket = new net_1.default.Socket(); fakeSocket.readable = true; // Need to wait for the "socket" event to re-play the "data" events. req.once('socket', (s) => { debug('replaying proxy buffer for failed request'); assert_1.default(s.listenerCount('data') > 0); // Replay the "buffered" Buffer onto the fake `socket`, since at // this point the HTTP module machinery has been hooked up for // the user. s.push(buffered); s.push(null); }); return fakeSocket; }); } } exports.default = HttpsProxyAgent; function resume(socket) { socket.resume(); } function isDefaultPort(port, secure) { return Boolean((!secure && port === 80) || (secure && port === 443)); } function isHTTPS(protocol) { return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false; } function omit(obj, ...keys) { const ret = {}; let key; for (key in obj) { if (!keys.includes(key)) { ret[key] = obj[key]; } } return ret; }//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/vscode-proxy-agent/node_modules/https-proxy-agent/dist/agent.js.map"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; const agent_1 = __importDefault(require("./agent")); function createHttpsProxyAgent(opts) { return new agent_1.default(opts); } (function (createHttpsProxyAgent) { createHttpsProxyAgent.HttpsProxyAgent = agent_1.default; createHttpsProxyAgent.prototype = agent_1.default.prototype; })(createHttpsProxyAgent || (createHttpsProxyAgent = {})); module.exports = createHttpsProxyAgent;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/vscode-proxy-agent/node_modules/https-proxy-agent/dist/index.js.map"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const debug_1 = __importDefault(require("debug")); const debug = debug_1.default('https-proxy-agent:parse-proxy-response'); function parseProxyResponse(socket) { return new Promise((resolve, reject) => { // we need to buffer any HTTP traffic that happens with the proxy before we get // the CONNECT response, so that if the response is anything other than an "200" // response code, then we can re-play the "data" events on the socket once the // HTTP parser is hooked up... let buffersLength = 0; const buffers = []; function read() { const b = socket.read(); if (b) ondata(b); else socket.once('readable', read); } function cleanup() { socket.removeListener('end', onend); socket.removeListener('error', onerror); socket.removeListener('close', onclose); socket.removeListener('readable', read); } function onclose(err) { debug('onclose had error %o', err); } function onend() { debug('onend'); } function onerror(err) { cleanup(); debug('onerror %o', err); reject(err); } function ondata(b) { buffers.push(b); buffersLength += b.length; const buffered = Buffer.concat(buffers, buffersLength); const endOfHeaders = buffered.indexOf('\r\n\r\n'); if (endOfHeaders === -1) { // keep buffering debug('have not received end of HTTP headers yet...'); read(); return; } const firstLine = buffered.toString('ascii', 0, buffered.indexOf('\r\n')); const statusCode = +firstLine.split(' ')[1]; debug('got proxy server response: %o', firstLine); resolve({ statusCode, buffered }); } socket.on('error', onerror); socket.on('close', onclose); socket.on('end', onend); read(); }); } exports.default = parseProxyResponse;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/vscode-proxy-agent/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const net_1 = __importDefault(require("net")); const tls_1 = __importDefault(require("tls")); const url_1 = __importDefault(require("url")); const debug_1 = __importDefault(require("debug")); const once_1 = __importDefault(require("@tootallnate/once")); const agent_base_1 = require("agent-base"); const debug = debug_1.default('http-proxy-agent'); function isHTTPS(protocol) { return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false; } /** * The `HttpProxyAgent` implements an HTTP Agent subclass that connects * to the specified "HTTP proxy server" in order to proxy HTTP requests. * * @api public */ class HttpProxyAgent extends agent_base_1.Agent { constructor(_opts) { let opts; if (typeof _opts === 'string') { opts = url_1.default.parse(_opts); } else { opts = _opts; } if (!opts) { throw new Error('an HTTP(S) proxy server `host` and `port` must be specified!'); } debug('Creating new HttpProxyAgent instance: %o', opts); super(opts); const proxy = Object.assign({}, opts); // If `true`, then connect to the proxy server over TLS. // Defaults to `false`. this.secureProxy = opts.secureProxy || isHTTPS(proxy.protocol); // Prefer `hostname` over `host`, and set the `port` if needed. proxy.host = proxy.hostname || proxy.host; if (typeof proxy.port === 'string') { proxy.port = parseInt(proxy.port, 10); } if (!proxy.port && proxy.host) { proxy.port = this.secureProxy ? 443 : 80; } if (proxy.host && proxy.path) { // If both a `host` and `path` are specified then it's most likely // the result of a `url.parse()` call... we need to remove the // `path` portion so that `net.connect()` doesn't attempt to open // that as a Unix socket file. delete proxy.path; delete proxy.pathname; } this.proxy = proxy; } /** * Called when the node-core HTTP client library is creating a * new HTTP request. * * @api protected */ callback(req, opts) { return __awaiter(this, void 0, void 0, function* () { const { proxy, secureProxy } = this; const parsed = url_1.default.parse(req.path); if (!parsed.protocol) { parsed.protocol = 'http:'; } if (!parsed.hostname) { parsed.hostname = opts.hostname || opts.host || null; } if (parsed.port == null && typeof opts.port) { parsed.port = String(opts.port); } if (parsed.port === '80') { // if port is 80, then we can remove the port so that the // ":80" portion is not on the produced URL delete parsed.port; } // Change the `http.ClientRequest` instance's "path" field // to the absolute path of the URL that will be requested. req.path = url_1.default.format(parsed); // Inject the `Proxy-Authorization` header if necessary. if (proxy.auth) { req.setHeader('Proxy-Authorization', `Basic ${Buffer.from(proxy.auth).toString('base64')}`); } // Create a socket connection to the proxy server. let socket; if (secureProxy) { debug('Creating `tls.Socket`: %o', proxy); socket = tls_1.default.connect(proxy); } else { debug('Creating `net.Socket`: %o', proxy); socket = net_1.default.connect(proxy); } // At this point, the http ClientRequest's internal `_header` field // might have already been set. If this is the case then we'll need // to re-generate the string since we just changed the `req.path`. if (req._header) { let first; let endOfHeaders; debug('Regenerating stored HTTP header string for request'); req._header = null; req._implicitHeader(); if (req.output && req.output.length > 0) { // Node < 12 debug('Patching connection write() output buffer with updated header'); first = req.output[0]; endOfHeaders = first.indexOf('\r\n\r\n') + 4; req.output[0] = req._header + first.substring(endOfHeaders); debug('Output buffer: %o', req.output); } else if (req.outputData && req.outputData.length > 0) { // Node >= 12 debug('Patching connection write() output buffer with updated header'); first = req.outputData[0].data; endOfHeaders = first.indexOf('\r\n\r\n') + 4; req.outputData[0].data = req._header + first.substring(endOfHeaders); debug('Output buffer: %o', req.outputData[0].data); } } // Wait for the socket's `connect` event, so that this `callback()` // function throws instead of the `http` request machinery. This is // important for i.e. `PacProxyAgent` which determines a failed proxy // connection via the `callback()` function throwing. yield once_1.default(socket, 'connect'); return socket; }); } } exports.default = HttpProxyAgent;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/vscode-proxy-agent/node_modules/http-proxy-agent/dist/agent.js.map"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; const agent_1 = __importDefault(require("./agent")); function createHttpProxyAgent(opts) { return new agent_1.default(opts); } (function (createHttpProxyAgent) { createHttpProxyAgent.HttpProxyAgent = agent_1.default; createHttpProxyAgent.prototype = agent_1.default.prototype; })(createHttpProxyAgent || (createHttpProxyAgent = {})); module.exports = createHttpProxyAgent;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/vscode-proxy-agent/node_modules/http-proxy-agent/dist/index.js.map(The MIT License) Copyright (c) 2014 TJ Holowaychuk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "debug", "version": "4.1.1", "repository": { "type": "git", "url": "git://github.com/visionmedia/debug.git" }, "description": "small debugging utility", "keywords": [ "debug", "log", "debugger" ], "files": [ "src", "dist/debug.js", "LICENSE", "README.md" ], "author": "TJ Holowaychuk ", "contributors": [ "Nathan Rajlich (http://n8.io)", "Andrew Rhyne " ], "license": "MIT", "scripts": { "lint": "xo", "test": "npm run test:node && npm run test:browser", "test:node": "istanbul cover _mocha -- test.js", "pretest:browser": "npm run build", "test:browser": "karma start --single-run", "prebuild:debug": "mkdir -p dist && browserify --standalone debug -o dist/debug.es6.js .", "build:debug": "babel -o dist/debug.js dist/debug.es6.js > dist/debug.js", "build:test": "babel -d dist test.js", "build": "npm run build:debug && npm run build:test", "clean": "rimraf dist coverage", "test:coverage": "cat ./coverage/lcov.info | coveralls" }, "dependencies": { "ms": "^2.1.1" }, "devDependencies": { "@babel/cli": "^7.0.0", "@babel/core": "^7.0.0", "@babel/preset-env": "^7.0.0", "browserify": "14.4.0", "chai": "^3.5.0", "concurrently": "^3.1.0", "coveralls": "^3.0.2", "istanbul": "^0.4.5", "karma": "^3.0.0", "karma-chai": "^0.1.0", "karma-mocha": "^1.3.0", "karma-phantomjs-launcher": "^1.0.2", "mocha": "^5.2.0", "mocha-lcov-reporter": "^1.2.0", "rimraf": "^2.5.4", "xo": "^0.23.0" }, "main": "./src/index.js", "browser": "./src/browser.js", "unpkg": "./dist/debug.js" } "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; const events_1 = require("events"); const debug_1 = __importDefault(require("debug")); const promisify_1 = __importDefault(require("./promisify")); const debug = debug_1.default('agent-base'); function isAgent(v) { return Boolean(v) && typeof v.addRequest === 'function'; } function isSecureEndpoint() { const { stack } = new Error(); if (typeof stack !== 'string') return false; return stack.split('\n').some(l => l.indexOf('(https.js:') !== -1 || l.indexOf('node:https:') !== -1); } function createAgent(callback, opts) { return new createAgent.Agent(callback, opts); } (function (createAgent) { /** * Base `http.Agent` implementation. * No pooling/keep-alive is implemented by default. * * @param {Function} callback * @api public */ class Agent extends events_1.EventEmitter { constructor(callback, _opts) { super(); let opts = _opts; if (typeof callback === 'function') { this.callback = callback; } else if (callback) { opts = callback; } // Timeout for the socket to be returned from the callback this.timeout = null; if (opts && typeof opts.timeout === 'number') { this.timeout = opts.timeout; } // These aren't actually used by `agent-base`, but are required // for the TypeScript definition files in `@types/node` :/ this.maxFreeSockets = 1; this.maxSockets = 1; this.maxTotalSockets = Infinity; this.sockets = {}; this.freeSockets = {}; this.requests = {}; this.options = {}; } get defaultPort() { if (typeof this.explicitDefaultPort === 'number') { return this.explicitDefaultPort; } return isSecureEndpoint() ? 443 : 80; } set defaultPort(v) { this.explicitDefaultPort = v; } get protocol() { if (typeof this.explicitProtocol === 'string') { return this.explicitProtocol; } return isSecureEndpoint() ? 'https:' : 'http:'; } set protocol(v) { this.explicitProtocol = v; } callback(req, opts, fn) { throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`'); } /** * Called by node-core's "_http_client.js" module when creating * a new HTTP request with this Agent instance. * * @api public */ addRequest(req, _opts) { const opts = Object.assign({}, _opts); if (typeof opts.secureEndpoint !== 'boolean') { opts.secureEndpoint = isSecureEndpoint(); } if (opts.host == null) { opts.host = 'localhost'; } if (opts.port == null) { opts.port = opts.secureEndpoint ? 443 : 80; } if (opts.protocol == null) { opts.protocol = opts.secureEndpoint ? 'https:' : 'http:'; } if (opts.host && opts.path) { // If both a `host` and `path` are specified then it's most // likely the result of a `url.parse()` call... we need to // remove the `path` portion so that `net.connect()` doesn't // attempt to open that as a unix socket file. delete opts.path; } delete opts.agent; delete opts.hostname; delete opts._defaultAgent; delete opts.defaultPort; delete opts.createConnection; // Hint to use "Connection: close" // XXX: non-documented `http` module API :( req._last = true; req.shouldKeepAlive = false; let timedOut = false; let timeoutId = null; const timeoutMs = opts.timeout || this.timeout; const onerror = (err) => { if (req._hadError) return; req.emit('error', err); // For Safety. Some additional errors might fire later on // and we need to make sure we don't double-fire the error event. req._hadError = true; }; const ontimeout = () => { timeoutId = null; timedOut = true; const err = new Error(`A "socket" was not created for HTTP request before ${timeoutMs}ms`); err.code = 'ETIMEOUT'; onerror(err); }; const callbackError = (err) => { if (timedOut) return; if (timeoutId !== null) { clearTimeout(timeoutId); timeoutId = null; } onerror(err); }; const onsocket = (socket) => { if (timedOut) return; if (timeoutId != null) { clearTimeout(timeoutId); timeoutId = null; } if (isAgent(socket)) { // `socket` is actually an `http.Agent` instance, so // relinquish responsibility for this `req` to the Agent // from here on debug('Callback returned another Agent instance %o', socket.constructor.name); socket.addRequest(req, opts); return; } if (socket) { socket.once('free', () => { this.freeSocket(socket, opts); }); req.onSocket(socket); return; } const err = new Error(`no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\``); onerror(err); }; if (typeof this.callback !== 'function') { onerror(new Error('`callback` is not defined')); return; } if (!this.promisifiedCallback) { if (this.callback.length >= 3) { debug('Converting legacy callback function to promise'); this.promisifiedCallback = promisify_1.default(this.callback); } else { this.promisifiedCallback = this.callback; } } if (typeof timeoutMs === 'number' && timeoutMs > 0) { timeoutId = setTimeout(ontimeout, timeoutMs); } if ('port' in opts && typeof opts.port !== 'number') { opts.port = Number(opts.port); } try { debug('Resolving socket for %o request: %o', opts.protocol, `${req.method} ${req.path}`); Promise.resolve(this.promisifiedCallback(req, opts)).then(onsocket, callbackError); } catch (err) { Promise.reject(err).catch(callbackError); } } freeSocket(socket, opts) { debug('Freeing socket %o %o', socket.constructor.name, opts); socket.destroy(); } destroy() { debug('Destroying agent %o', this.constructor.name); } } createAgent.Agent = Agent; // So that `instanceof` works correctly createAgent.prototype = createAgent.Agent.prototype; })(createAgent || (createAgent = {})); module.exports = createAgent;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/vscode-proxy-agent/node_modules/agent-base/dist/src/index.js.map"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function promisify(fn) { return function (req, opts) { return new Promise((resolve, reject) => { fn.call(this, req, opts, (err, rtn) => { if (err) { reject(err); } else { resolve(rtn); } }); }); }; } exports.default = promisify;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/vscode-proxy-agent/node_modules/agent-base/dist/src/promisify.js.map{ "name": "agent-base", "version": "6.0.1", "description": "Turn a function into an `http.Agent` instance", "main": "dist/src/index", "typings": "dist/src/index", "files": [ "dist/src", "src" ], "scripts": { "prebuild": "rimraf dist", "build": "tsc", "postbuild": "cpy --parents src test '!**/*.ts' dist", "test": "mocha --reporter spec dist/test/*.js", "test-lint": "eslint src --ext .js,.ts", "prepublishOnly": "npm run build" }, "repository": { "type": "git", "url": "git://github.com/TooTallNate/node-agent-base.git" }, "keywords": [ "http", "agent", "base", "barebones", "https" ], "author": "Nathan Rajlich (http://n8.io/)", "license": "MIT", "bugs": { "url": "https://github.com/TooTallNate/node-agent-base/issues" }, "dependencies": { "debug": "4" }, "devDependencies": { "@types/debug": "4", "@types/mocha": "^5.2.7", "@types/node": "^12.12.17", "@types/semver": "^7.1.0", "@types/ws": "^6.0.3", "@typescript-eslint/eslint-plugin": "1.6.0", "@typescript-eslint/parser": "1.1.0", "async-listen": "^1.2.0", "cpy-cli": "^2.0.0", "eslint": "5.16.0", "eslint-config-airbnb": "17.1.0", "eslint-config-prettier": "4.1.0", "eslint-import-resolver-typescript": "1.1.1", "eslint-plugin-import": "2.16.0", "eslint-plugin-jsx-a11y": "6.2.1", "eslint-plugin-react": "7.12.4", "mocha": "^6.2.0", "rimraf": "^3.0.0", "semver": "^7.1.2", "typescript": "^3.5.3", "ws": "^3.0.0" }, "engines": { "node": ">= 6.0.0" } } (The MIT License) Copyright (c) 2014 TJ Holowaychuk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "debug", "version": "4.1.1", "repository": { "type": "git", "url": "git://github.com/visionmedia/debug.git" }, "description": "small debugging utility", "keywords": [ "debug", "log", "debugger" ], "files": [ "src", "dist/debug.js", "LICENSE", "README.md" ], "author": "TJ Holowaychuk ", "contributors": [ "Nathan Rajlich (http://n8.io)", "Andrew Rhyne " ], "license": "MIT", "scripts": { "lint": "xo", "test": "npm run test:node && npm run test:browser", "test:node": "istanbul cover _mocha -- test.js", "pretest:browser": "npm run build", "test:browser": "karma start --single-run", "prebuild:debug": "mkdir -p dist && browserify --standalone debug -o dist/debug.es6.js .", "build:debug": "babel -o dist/debug.js dist/debug.es6.js > dist/debug.js", "build:test": "babel -d dist test.js", "build": "npm run build:debug && npm run build:test", "clean": "rimraf dist coverage", "test:coverage": "cat ./coverage/lcov.info | coveralls" }, "dependencies": { "ms": "^2.1.1" }, "devDependencies": { "@babel/cli": "^7.0.0", "@babel/core": "^7.0.0", "@babel/preset-env": "^7.0.0", "browserify": "14.4.0", "chai": "^3.5.0", "concurrently": "^3.1.0", "coveralls": "^3.0.2", "istanbul": "^0.4.5", "karma": "^3.0.0", "karma-chai": "^0.1.0", "karma-mocha": "^1.3.0", "karma-phantomjs-launcher": "^1.0.2", "mocha": "^5.2.0", "mocha-lcov-reporter": "^1.2.0", "rimraf": "^2.5.4", "xo": "^0.23.0" }, "main": "./src/index.js", "browser": "./src/browser.js", "unpkg": "./dist/debug.js" } { "name": "agent-base", "version": "6.0.1", "description": "Turn a function into an `http.Agent` instance", "main": "dist/src/index", "typings": "dist/src/index", "files": [ "dist/src", "src" ], "scripts": { "prebuild": "rimraf dist", "build": "tsc", "postbuild": "cpy --parents src test '!**/*.ts' dist", "test": "mocha --reporter spec dist/test/*.js", "test-lint": "eslint src --ext .js,.ts", "prepublishOnly": "npm run build" }, "repository": { "type": "git", "url": "git://github.com/TooTallNate/node-agent-base.git" }, "keywords": [ "http", "agent", "base", "barebones", "https" ], "author": "Nathan Rajlich (http://n8.io/)", "license": "MIT", "bugs": { "url": "https://github.com/TooTallNate/node-agent-base/issues" }, "dependencies": { "debug": "4" }, "devDependencies": { "@types/debug": "4", "@types/mocha": "^5.2.7", "@types/node": "^12.12.17", "@types/semver": "^7.1.0", "@types/ws": "^6.0.3", "@typescript-eslint/eslint-plugin": "1.6.0", "@typescript-eslint/parser": "1.1.0", "async-listen": "^1.2.0", "cpy-cli": "^2.0.0", "eslint": "5.16.0", "eslint-config-airbnb": "17.1.0", "eslint-config-prettier": "4.1.0", "eslint-import-resolver-typescript": "1.1.1", "eslint-plugin-import": "2.16.0", "eslint-plugin-jsx-a11y": "6.2.1", "eslint-plugin-react": "7.12.4", "mocha": "^6.2.0", "rimraf": "^3.0.0", "semver": "^7.1.2", "typescript": "^3.5.3", "ws": "^3.0.0" }, "engines": { "node": ">= 6.0.0" } } (The MIT License) Copyright (c) 2014 TJ Holowaychuk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "debug", "version": "4.1.1", "repository": { "type": "git", "url": "git://github.com/visionmedia/debug.git" }, "description": "small debugging utility", "keywords": [ "debug", "log", "debugger" ], "files": [ "src", "dist/debug.js", "LICENSE", "README.md" ], "author": "TJ Holowaychuk ", "contributors": [ "Nathan Rajlich (http://n8.io)", "Andrew Rhyne " ], "license": "MIT", "scripts": { "lint": "xo", "test": "npm run test:node && npm run test:browser", "test:node": "istanbul cover _mocha -- test.js", "pretest:browser": "npm run build", "test:browser": "karma start --single-run", "prebuild:debug": "mkdir -p dist && browserify --standalone debug -o dist/debug.es6.js .", "build:debug": "babel -o dist/debug.js dist/debug.es6.js > dist/debug.js", "build:test": "babel -d dist test.js", "build": "npm run build:debug && npm run build:test", "clean": "rimraf dist coverage", "test:coverage": "cat ./coverage/lcov.info | coveralls" }, "dependencies": { "ms": "^2.1.1" }, "devDependencies": { "@babel/cli": "^7.0.0", "@babel/core": "^7.0.0", "@babel/preset-env": "^7.0.0", "browserify": "14.4.0", "chai": "^3.5.0", "concurrently": "^3.1.0", "coveralls": "^3.0.2", "istanbul": "^0.4.5", "karma": "^3.0.0", "karma-chai": "^0.1.0", "karma-mocha": "^1.3.0", "karma-phantomjs-launcher": "^1.0.2", "mocha": "^5.2.0", "mocha-lcov-reporter": "^1.2.0", "rimraf": "^2.5.4", "xo": "^0.23.0" }, "main": "./src/index.js", "browser": "./src/browser.js", "unpkg": "./dist/debug.js" } "use strict"; function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } (function (f) { if ((typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined") { module.exports = f(); } else if (typeof define === "function" && define.amd) { define([], f); } else { var g; if (typeof window !== "undefined") { g = window; } else if (typeof global !== "undefined") { g = global; } else if (typeof self !== "undefined") { g = self; } else { g = this; } g.debug = f(); } })(function () { var define, module, exports; return function () { function r(e, n, t) { function o(i, f) { if (!n[i]) { if (!e[i]) { var c = "function" == typeof require && require; if (!f && c) return c(i, !0); if (u) return u(i, !0); var a = new Error("Cannot find module '" + i + "'"); throw a.code = "MODULE_NOT_FOUND", a; } var p = n[i] = { exports: {} }; e[i][0].call(p.exports, function (r) { var n = e[i][1][r]; return o(n || r); }, p, p.exports, r, e, n, t); } return n[i].exports; } for (var u = "function" == typeof require && require, i = 0; i < t.length; i++) { o(t[i]); } return o; } return r; }()({ 1: [function (require, module, exports) { /** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; var w = d * 7; var y = d * 365.25; /** * Parse or format the given `val`. * * Options: * * - `long` verbose formatting [false] * * @param {String|Number} val * @param {Object} [options] * @throws {Error} throw an error if val is not a non-empty string or a number * @return {String|Number} * @api public */ module.exports = function (val, options) { options = options || {}; var type = _typeof(val); if (type === 'string' && val.length > 0) { return parse(val); } else if (type === 'number' && isNaN(val) === false) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val)); }; /** * Parse the given `str` and return milliseconds. * * @param {String} str * @return {Number} * @api private */ function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'yrs': case 'yr': case 'y': return n * y; case 'weeks': case 'week': case 'w': return n * w; case 'days': case 'day': case 'd': return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': return n * m; case 'seconds': case 'second': case 'secs': case 'sec': case 's': return n * s; case 'milliseconds': case 'millisecond': case 'msecs': case 'msec': case 'ms': return n; default: return undefined; } } /** * Short format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtShort(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return Math.round(ms / d) + 'd'; } if (msAbs >= h) { return Math.round(ms / h) + 'h'; } if (msAbs >= m) { return Math.round(ms / m) + 'm'; } if (msAbs >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtLong(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return plural(ms, msAbs, d, 'day'); } if (msAbs >= h) { return plural(ms, msAbs, h, 'hour'); } if (msAbs >= m) { return plural(ms, msAbs, m, 'minute'); } if (msAbs >= s) { return plural(ms, msAbs, s, 'second'); } return ms + ' ms'; } /** * Pluralization helper. */ function plural(ms, msAbs, n, name) { var isPlural = msAbs >= n * 1.5; return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); } }, {}], 2: [function (require, module, exports) { // shim for using process in browser var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it // don't break things. But we need to wrap it in a try catch in case it is // wrapped in strict mode code which doesn't define any globals. It's inside a // function because try/catches deoptimize in certain engines. var cachedSetTimeout; var cachedClearTimeout; function defaultSetTimout() { throw new Error('setTimeout has not been defined'); } function defaultClearTimeout() { throw new Error('clearTimeout has not been defined'); } (function () { try { if (typeof setTimeout === 'function') { cachedSetTimeout = setTimeout; } else { cachedSetTimeout = defaultSetTimout; } } catch (e) { cachedSetTimeout = defaultSetTimout; } try { if (typeof clearTimeout === 'function') { cachedClearTimeout = clearTimeout; } else { cachedClearTimeout = defaultClearTimeout; } } catch (e) { cachedClearTimeout = defaultClearTimeout; } })(); function runTimeout(fun) { if (cachedSetTimeout === setTimeout) { //normal enviroments in sane situations return setTimeout(fun, 0); } // if setTimeout wasn't available but was latter defined if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout; return setTimeout(fun, 0); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedSetTimeout(fun, 0); } catch (e) { try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedSetTimeout.call(null, fun, 0); } catch (e) { // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { //normal enviroments in sane situations return clearTimeout(marker); } // if clearTimeout wasn't available but was latter defined if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout; return clearTimeout(marker); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedClearTimeout(marker); } catch (e) { try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedClearTimeout.call(null, marker); } catch (e) { // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. // Some versions of I.E. have different rules for clearTimeout vs setTimeout return cachedClearTimeout.call(this, marker); } } } var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; while (len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; runClearTimeout(timeout); } process.nextTick = function (fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { runTimeout(drainQueue); } }; // v8 likes predictible objects function Item(fun, array) { this.fun = fun; this.array = array; } Item.prototype.run = function () { this.fun.apply(null, this.array); }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues process.versions = {}; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.prependListener = noop; process.prependOnceListener = noop; process.listeners = function (name) { return []; }; process.binding = function (name) { throw new Error('process.binding is not supported'); }; process.cwd = function () { return '/'; }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; process.umask = function () { return 0; }; }, {}], 3: [function (require, module, exports) { /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. */ function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = require('ms'); Object.keys(env).forEach(function (key) { createDebug[key] = env[key]; }); /** * Active `debug` instances. */ createDebug.instances = []; /** * The currently active debug mode names, and names to skip. */ createDebug.names = []; createDebug.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ createDebug.formatters = {}; /** * Selects a color for a debug namespace * @param {String} namespace The namespace string for the for the debug instance to be colored * @return {Number|String} An ANSI color code for the given namespace * @api private */ function selectColor(namespace) { var hash = 0; for (var i = 0; i < namespace.length; i++) { hash = (hash << 5) - hash + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { var prevTime; function debug() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } // Disabled? if (!debug.enabled) { return; } var self = debug; // Set `diff` timestamp var curr = Number(new Date()); var ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== 'string') { // Anything else let's inspect with %O args.unshift('%O'); } // Apply any `formatters` transformations var index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) { // If we encounter an escaped % then don't increase the array index if (match === '%%') { return match; } index++; var formatter = createDebug.formatters[format]; if (typeof formatter === 'function') { var val = args[index]; match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // Apply env-specific formatting (colors, etc.) createDebug.formatArgs.call(self, args); var logFn = self.log || createDebug.log; logFn.apply(self, args); } debug.namespace = namespace; debug.enabled = createDebug.enabled(namespace); debug.useColors = createDebug.useColors(); debug.color = selectColor(namespace); debug.destroy = destroy; debug.extend = extend; // Debug.formatArgs = formatArgs; // debug.rawLog = rawLog; // env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } createDebug.instances.push(debug); return debug; } function destroy() { var index = createDebug.instances.indexOf(this); if (index !== -1) { createDebug.instances.splice(index, 1); return true; } return false; } function extend(namespace, delimiter) { var newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); newDebug.log = this.log; return newDebug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { createDebug.save(namespaces); createDebug.names = []; createDebug.skips = []; var i; var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); var len = split.length; for (i = 0; i < len; i++) { if (!split[i]) { // ignore empty strings continue; } namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else { createDebug.names.push(new RegExp('^' + namespaces + '$')); } } for (i = 0; i < createDebug.instances.length; i++) { var instance = createDebug.instances[i]; instance.enabled = createDebug.enabled(instance.namespace); } } /** * Disable debug output. * * @return {String} namespaces * @api public */ function disable() { var namespaces = [].concat(_toConsumableArray(createDebug.names.map(toNamespace)), _toConsumableArray(createDebug.skips.map(toNamespace).map(function (namespace) { return '-' + namespace; }))).join(','); createDebug.enable(''); return namespaces; } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { if (name[name.length - 1] === '*') { return true; } var i; var len; for (i = 0, len = createDebug.skips.length; i < len; i++) { if (createDebug.skips[i].test(name)) { return false; } } for (i = 0, len = createDebug.names.length; i < len; i++) { if (createDebug.names[i].test(name)) { return true; } } return false; } /** * Convert regexp to namespace * * @param {RegExp} regxep * @return {String} namespace * @api private */ function toNamespace(regexp) { return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, '*'); } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } createDebug.enable(createDebug.load()); return createDebug; } module.exports = setup; }, { "ms": 1 }], 4: [function (require, module, exports) { (function (process) { /* eslint-env browser */ /** * This is the web browser implementation of `debug()`. */ exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); /** * Colors. */ exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33']; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ // eslint-disable-next-line complexity function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { return true; } // Internet Explorer and Edge do not support colors. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); } /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); if (!this.useColors) { return; } var c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into var index = 0; var lastC = 0; args[0].replace(/%[a-zA-Z%]/g, function (match) { if (match === '%%') { return; } index++; if (match === '%c') { // We only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.log()` when available. * No-op when `console.log` is not a "function". * * @api public */ function log() { var _console; // This hackery is required for IE8/9, where // the `console.log` function doesn't have 'apply' return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (namespaces) { exports.storage.setItem('debug', namespaces); } else { exports.storage.removeItem('debug'); } } catch (error) {// Swallow // XXX (@Qix-) should we be logging these? } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { var r; try { r = exports.storage.getItem('debug'); } catch (error) {} // Swallow // XXX (@Qix-) should we be logging these? // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context // The Browser also has localStorage in the global context. return localStorage; } catch (error) {// Swallow // XXX (@Qix-) should we be logging these? } } module.exports = require('./common')(exports); var formatters = module.exports.formatters; /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ formatters.j = function (v) { try { return JSON.stringify(v); } catch (error) { return '[UnexpectedJSONParseError]: ' + error.message; } }; }).call(this, require('_process')); }, { "./common": 3, "_process": 2 }] }, {}, [4])(4); }); /* eslint-env browser */ /** * This is the web browser implementation of `debug()`. */ exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); /** * Colors. */ exports.colors = [ '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33' ]; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ // eslint-disable-next-line complexity function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { return true; } // Internet Explorer and Edge do not support colors. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || // Is firebug? http://stackoverflow.com/a/398120/376773 (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || // Double check webkit in userAgent just in case we are in a worker (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); } /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); if (!this.useColors) { return; } const c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into let index = 0; let lastC = 0; args[0].replace(/%[a-zA-Z%]/g, match => { if (match === '%%') { return; } index++; if (match === '%c') { // We only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.log()` when available. * No-op when `console.log` is not a "function". * * @api public */ function log(...args) { // This hackery is required for IE8/9, where // the `console.log` function doesn't have 'apply' return typeof console === 'object' && console.log && console.log(...args); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (namespaces) { exports.storage.setItem('debug', namespaces); } else { exports.storage.removeItem('debug'); } } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { let r; try { r = exports.storage.getItem('debug'); } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context // The Browser also has localStorage in the global context. return localStorage; } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } module.exports = require('./common')(exports); const {formatters} = module.exports; /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ formatters.j = function (v) { try { return JSON.stringify(v); } catch (error) { return '[UnexpectedJSONParseError]: ' + error.message; } }; /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. */ function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = require('ms'); Object.keys(env).forEach(key => { createDebug[key] = env[key]; }); /** * Active `debug` instances. */ createDebug.instances = []; /** * The currently active debug mode names, and names to skip. */ createDebug.names = []; createDebug.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ createDebug.formatters = {}; /** * Selects a color for a debug namespace * @param {String} namespace The namespace string for the for the debug instance to be colored * @return {Number|String} An ANSI color code for the given namespace * @api private */ function selectColor(namespace) { let hash = 0; for (let i = 0; i < namespace.length; i++) { hash = ((hash << 5) - hash) + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { let prevTime; function debug(...args) { // Disabled? if (!debug.enabled) { return; } const self = debug; // Set `diff` timestamp const curr = Number(new Date()); const ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== 'string') { // Anything else let's inspect with %O args.unshift('%O'); } // Apply any `formatters` transformations let index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { // If we encounter an escaped % then don't increase the array index if (match === '%%') { return match; } index++; const formatter = createDebug.formatters[format]; if (typeof formatter === 'function') { const val = args[index]; match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // Apply env-specific formatting (colors, etc.) createDebug.formatArgs.call(self, args); const logFn = self.log || createDebug.log; logFn.apply(self, args); } debug.namespace = namespace; debug.enabled = createDebug.enabled(namespace); debug.useColors = createDebug.useColors(); debug.color = selectColor(namespace); debug.destroy = destroy; debug.extend = extend; // Debug.formatArgs = formatArgs; // debug.rawLog = rawLog; // env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } createDebug.instances.push(debug); return debug; } function destroy() { const index = createDebug.instances.indexOf(this); if (index !== -1) { createDebug.instances.splice(index, 1); return true; } return false; } function extend(namespace, delimiter) { const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); newDebug.log = this.log; return newDebug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { createDebug.save(namespaces); createDebug.names = []; createDebug.skips = []; let i; const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); const len = split.length; for (i = 0; i < len; i++) { if (!split[i]) { // ignore empty strings continue; } namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else { createDebug.names.push(new RegExp('^' + namespaces + '$')); } } for (i = 0; i < createDebug.instances.length; i++) { const instance = createDebug.instances[i]; instance.enabled = createDebug.enabled(instance.namespace); } } /** * Disable debug output. * * @return {String} namespaces * @api public */ function disable() { const namespaces = [ ...createDebug.names.map(toNamespace), ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) ].join(','); createDebug.enable(''); return namespaces; } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { if (name[name.length - 1] === '*') { return true; } let i; let len; for (i = 0, len = createDebug.skips.length; i < len; i++) { if (createDebug.skips[i].test(name)) { return false; } } for (i = 0, len = createDebug.names.length; i < len; i++) { if (createDebug.names[i].test(name)) { return true; } } return false; } /** * Convert regexp to namespace * * @param {RegExp} regxep * @return {String} namespace * @api private */ function toNamespace(regexp) { return regexp.toString() .substring(2, regexp.toString().length - 2) .replace(/\.\*\?$/, '*'); } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } createDebug.enable(createDebug.load()); return createDebug; } module.exports = setup; /** * Detect Electron renderer / nwjs process, which is node, but we should * treat as a browser. */ if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { module.exports = require('./browser.js'); } else { module.exports = require('./node.js'); } /** * Module dependencies. */ const tty = require('tty'); const util = require('util'); /** * This is the Node.js implementation of `debug()`. */ exports.init = init; exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; /** * Colors. */ exports.colors = [6, 2, 3, 4, 5, 1]; try { // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) // eslint-disable-next-line import/no-extraneous-dependencies const supportsColor = require('supports-color'); if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { exports.colors = [ 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221 ]; } } catch (error) { // Swallow - we only care if `supports-color` is available; it doesn't have to be. } /** * Build up the default `inspectOpts` object from the environment variables. * * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js */ exports.inspectOpts = Object.keys(process.env).filter(key => { return /^debug_/i.test(key); }).reduce((obj, key) => { // Camel-case const prop = key .substring(6) .toLowerCase() .replace(/_([a-z])/g, (_, k) => { return k.toUpperCase(); }); // Coerce string value into JS value let val = process.env[key]; if (/^(yes|on|true|enabled)$/i.test(val)) { val = true; } else if (/^(no|off|false|disabled)$/i.test(val)) { val = false; } else if (val === 'null') { val = null; } else { val = Number(val); } obj[prop] = val; return obj; }, {}); /** * Is stdout a TTY? Colored output is enabled when `true`. */ function useColors() { return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd); } /** * Adds ANSI color escape codes if enabled. * * @api public */ function formatArgs(args) { const {namespace: name, useColors} = this; if (useColors) { const c = this.color; const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); const prefix = ` ${colorCode};1m${name} \u001B[0m`; args[0] = prefix + args[0].split('\n').join('\n' + prefix); args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); } else { args[0] = getDate() + name + ' ' + args[0]; } } function getDate() { if (exports.inspectOpts.hideDate) { return ''; } return new Date().toISOString() + ' '; } /** * Invokes `util.format()` with the specified arguments and writes to stderr. */ function log(...args) { return process.stderr.write(util.format(...args) + '\n'); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { if (namespaces) { process.env.DEBUG = namespaces; } else { // If you set a process.env field to null or undefined, it gets cast to the // string 'null' or 'undefined'. Just delete instead. delete process.env.DEBUG; } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { return process.env.DEBUG; } /** * Init logic for `debug` instances. * * Create a new `inspectOpts` object in case `useColors` is set * differently for a particular `debug` instance. */ function init(debug) { debug.inspectOpts = {}; const keys = Object.keys(exports.inspectOpts); for (let i = 0; i < keys.length; i++) { debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; } } module.exports = require('./common')(exports); const {formatters} = module.exports; /** * Map %o to `util.inspect()`, all on a single line. */ formatters.o = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts) .replace(/\s*\n\s*/g, ' '); }; /** * Map %O to `util.inspect()`, allowing multiple lines if needed. */ formatters.O = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts); }; "use strict"; function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } (function (f) { if ((typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined") { module.exports = f(); } else if (typeof define === "function" && define.amd) { define([], f); } else { var g; if (typeof window !== "undefined") { g = window; } else if (typeof global !== "undefined") { g = global; } else if (typeof self !== "undefined") { g = self; } else { g = this; } g.debug = f(); } })(function () { var define, module, exports; return function () { function r(e, n, t) { function o(i, f) { if (!n[i]) { if (!e[i]) { var c = "function" == typeof require && require; if (!f && c) return c(i, !0); if (u) return u(i, !0); var a = new Error("Cannot find module '" + i + "'"); throw a.code = "MODULE_NOT_FOUND", a; } var p = n[i] = { exports: {} }; e[i][0].call(p.exports, function (r) { var n = e[i][1][r]; return o(n || r); }, p, p.exports, r, e, n, t); } return n[i].exports; } for (var u = "function" == typeof require && require, i = 0; i < t.length; i++) { o(t[i]); } return o; } return r; }()({ 1: [function (require, module, exports) { /** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; var w = d * 7; var y = d * 365.25; /** * Parse or format the given `val`. * * Options: * * - `long` verbose formatting [false] * * @param {String|Number} val * @param {Object} [options] * @throws {Error} throw an error if val is not a non-empty string or a number * @return {String|Number} * @api public */ module.exports = function (val, options) { options = options || {}; var type = _typeof(val); if (type === 'string' && val.length > 0) { return parse(val); } else if (type === 'number' && isNaN(val) === false) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val)); }; /** * Parse the given `str` and return milliseconds. * * @param {String} str * @return {Number} * @api private */ function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'yrs': case 'yr': case 'y': return n * y; case 'weeks': case 'week': case 'w': return n * w; case 'days': case 'day': case 'd': return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': return n * m; case 'seconds': case 'second': case 'secs': case 'sec': case 's': return n * s; case 'milliseconds': case 'millisecond': case 'msecs': case 'msec': case 'ms': return n; default: return undefined; } } /** * Short format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtShort(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return Math.round(ms / d) + 'd'; } if (msAbs >= h) { return Math.round(ms / h) + 'h'; } if (msAbs >= m) { return Math.round(ms / m) + 'm'; } if (msAbs >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtLong(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return plural(ms, msAbs, d, 'day'); } if (msAbs >= h) { return plural(ms, msAbs, h, 'hour'); } if (msAbs >= m) { return plural(ms, msAbs, m, 'minute'); } if (msAbs >= s) { return plural(ms, msAbs, s, 'second'); } return ms + ' ms'; } /** * Pluralization helper. */ function plural(ms, msAbs, n, name) { var isPlural = msAbs >= n * 1.5; return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); } }, {}], 2: [function (require, module, exports) { // shim for using process in browser var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it // don't break things. But we need to wrap it in a try catch in case it is // wrapped in strict mode code which doesn't define any globals. It's inside a // function because try/catches deoptimize in certain engines. var cachedSetTimeout; var cachedClearTimeout; function defaultSetTimout() { throw new Error('setTimeout has not been defined'); } function defaultClearTimeout() { throw new Error('clearTimeout has not been defined'); } (function () { try { if (typeof setTimeout === 'function') { cachedSetTimeout = setTimeout; } else { cachedSetTimeout = defaultSetTimout; } } catch (e) { cachedSetTimeout = defaultSetTimout; } try { if (typeof clearTimeout === 'function') { cachedClearTimeout = clearTimeout; } else { cachedClearTimeout = defaultClearTimeout; } } catch (e) { cachedClearTimeout = defaultClearTimeout; } })(); function runTimeout(fun) { if (cachedSetTimeout === setTimeout) { //normal enviroments in sane situations return setTimeout(fun, 0); } // if setTimeout wasn't available but was latter defined if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout; return setTimeout(fun, 0); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedSetTimeout(fun, 0); } catch (e) { try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedSetTimeout.call(null, fun, 0); } catch (e) { // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { //normal enviroments in sane situations return clearTimeout(marker); } // if clearTimeout wasn't available but was latter defined if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout; return clearTimeout(marker); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedClearTimeout(marker); } catch (e) { try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedClearTimeout.call(null, marker); } catch (e) { // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. // Some versions of I.E. have different rules for clearTimeout vs setTimeout return cachedClearTimeout.call(this, marker); } } } var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; while (len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; runClearTimeout(timeout); } process.nextTick = function (fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { runTimeout(drainQueue); } }; // v8 likes predictible objects function Item(fun, array) { this.fun = fun; this.array = array; } Item.prototype.run = function () { this.fun.apply(null, this.array); }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues process.versions = {}; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.prependListener = noop; process.prependOnceListener = noop; process.listeners = function (name) { return []; }; process.binding = function (name) { throw new Error('process.binding is not supported'); }; process.cwd = function () { return '/'; }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; process.umask = function () { return 0; }; }, {}], 3: [function (require, module, exports) { /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. */ function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = require('ms'); Object.keys(env).forEach(function (key) { createDebug[key] = env[key]; }); /** * Active `debug` instances. */ createDebug.instances = []; /** * The currently active debug mode names, and names to skip. */ createDebug.names = []; createDebug.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ createDebug.formatters = {}; /** * Selects a color for a debug namespace * @param {String} namespace The namespace string for the for the debug instance to be colored * @return {Number|String} An ANSI color code for the given namespace * @api private */ function selectColor(namespace) { var hash = 0; for (var i = 0; i < namespace.length; i++) { hash = (hash << 5) - hash + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { var prevTime; function debug() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } // Disabled? if (!debug.enabled) { return; } var self = debug; // Set `diff` timestamp var curr = Number(new Date()); var ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== 'string') { // Anything else let's inspect with %O args.unshift('%O'); } // Apply any `formatters` transformations var index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) { // If we encounter an escaped % then don't increase the array index if (match === '%%') { return match; } index++; var formatter = createDebug.formatters[format]; if (typeof formatter === 'function') { var val = args[index]; match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // Apply env-specific formatting (colors, etc.) createDebug.formatArgs.call(self, args); var logFn = self.log || createDebug.log; logFn.apply(self, args); } debug.namespace = namespace; debug.enabled = createDebug.enabled(namespace); debug.useColors = createDebug.useColors(); debug.color = selectColor(namespace); debug.destroy = destroy; debug.extend = extend; // Debug.formatArgs = formatArgs; // debug.rawLog = rawLog; // env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } createDebug.instances.push(debug); return debug; } function destroy() { var index = createDebug.instances.indexOf(this); if (index !== -1) { createDebug.instances.splice(index, 1); return true; } return false; } function extend(namespace, delimiter) { var newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); newDebug.log = this.log; return newDebug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { createDebug.save(namespaces); createDebug.names = []; createDebug.skips = []; var i; var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); var len = split.length; for (i = 0; i < len; i++) { if (!split[i]) { // ignore empty strings continue; } namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else { createDebug.names.push(new RegExp('^' + namespaces + '$')); } } for (i = 0; i < createDebug.instances.length; i++) { var instance = createDebug.instances[i]; instance.enabled = createDebug.enabled(instance.namespace); } } /** * Disable debug output. * * @return {String} namespaces * @api public */ function disable() { var namespaces = [].concat(_toConsumableArray(createDebug.names.map(toNamespace)), _toConsumableArray(createDebug.skips.map(toNamespace).map(function (namespace) { return '-' + namespace; }))).join(','); createDebug.enable(''); return namespaces; } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { if (name[name.length - 1] === '*') { return true; } var i; var len; for (i = 0, len = createDebug.skips.length; i < len; i++) { if (createDebug.skips[i].test(name)) { return false; } } for (i = 0, len = createDebug.names.length; i < len; i++) { if (createDebug.names[i].test(name)) { return true; } } return false; } /** * Convert regexp to namespace * * @param {RegExp} regxep * @return {String} namespace * @api private */ function toNamespace(regexp) { return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, '*'); } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } createDebug.enable(createDebug.load()); return createDebug; } module.exports = setup; }, { "ms": 1 }], 4: [function (require, module, exports) { (function (process) { /* eslint-env browser */ /** * This is the web browser implementation of `debug()`. */ exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); /** * Colors. */ exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33']; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ // eslint-disable-next-line complexity function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { return true; } // Internet Explorer and Edge do not support colors. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); } /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); if (!this.useColors) { return; } var c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into var index = 0; var lastC = 0; args[0].replace(/%[a-zA-Z%]/g, function (match) { if (match === '%%') { return; } index++; if (match === '%c') { // We only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.log()` when available. * No-op when `console.log` is not a "function". * * @api public */ function log() { var _console; // This hackery is required for IE8/9, where // the `console.log` function doesn't have 'apply' return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (namespaces) { exports.storage.setItem('debug', namespaces); } else { exports.storage.removeItem('debug'); } } catch (error) {// Swallow // XXX (@Qix-) should we be logging these? } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { var r; try { r = exports.storage.getItem('debug'); } catch (error) {} // Swallow // XXX (@Qix-) should we be logging these? // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context // The Browser also has localStorage in the global context. return localStorage; } catch (error) {// Swallow // XXX (@Qix-) should we be logging these? } } module.exports = require('./common')(exports); var formatters = module.exports.formatters; /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ formatters.j = function (v) { try { return JSON.stringify(v); } catch (error) { return '[UnexpectedJSONParseError]: ' + error.message; } }; }).call(this, require('_process')); }, { "./common": 3, "_process": 2 }] }, {}, [4])(4); }); /* eslint-env browser */ /** * This is the web browser implementation of `debug()`. */ exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); /** * Colors. */ exports.colors = [ '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33' ]; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ // eslint-disable-next-line complexity function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { return true; } // Internet Explorer and Edge do not support colors. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || // Is firebug? http://stackoverflow.com/a/398120/376773 (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || // Double check webkit in userAgent just in case we are in a worker (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); } /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); if (!this.useColors) { return; } const c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into let index = 0; let lastC = 0; args[0].replace(/%[a-zA-Z%]/g, match => { if (match === '%%') { return; } index++; if (match === '%c') { // We only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.log()` when available. * No-op when `console.log` is not a "function". * * @api public */ function log(...args) { // This hackery is required for IE8/9, where // the `console.log` function doesn't have 'apply' return typeof console === 'object' && console.log && console.log(...args); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (namespaces) { exports.storage.setItem('debug', namespaces); } else { exports.storage.removeItem('debug'); } } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { let r; try { r = exports.storage.getItem('debug'); } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context // The Browser also has localStorage in the global context. return localStorage; } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } module.exports = require('./common')(exports); const {formatters} = module.exports; /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ formatters.j = function (v) { try { return JSON.stringify(v); } catch (error) { return '[UnexpectedJSONParseError]: ' + error.message; } }; /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. */ function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = require('ms'); Object.keys(env).forEach(key => { createDebug[key] = env[key]; }); /** * Active `debug` instances. */ createDebug.instances = []; /** * The currently active debug mode names, and names to skip. */ createDebug.names = []; createDebug.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ createDebug.formatters = {}; /** * Selects a color for a debug namespace * @param {String} namespace The namespace string for the for the debug instance to be colored * @return {Number|String} An ANSI color code for the given namespace * @api private */ function selectColor(namespace) { let hash = 0; for (let i = 0; i < namespace.length; i++) { hash = ((hash << 5) - hash) + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { let prevTime; function debug(...args) { // Disabled? if (!debug.enabled) { return; } const self = debug; // Set `diff` timestamp const curr = Number(new Date()); const ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== 'string') { // Anything else let's inspect with %O args.unshift('%O'); } // Apply any `formatters` transformations let index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { // If we encounter an escaped % then don't increase the array index if (match === '%%') { return match; } index++; const formatter = createDebug.formatters[format]; if (typeof formatter === 'function') { const val = args[index]; match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // Apply env-specific formatting (colors, etc.) createDebug.formatArgs.call(self, args); const logFn = self.log || createDebug.log; logFn.apply(self, args); } debug.namespace = namespace; debug.enabled = createDebug.enabled(namespace); debug.useColors = createDebug.useColors(); debug.color = selectColor(namespace); debug.destroy = destroy; debug.extend = extend; // Debug.formatArgs = formatArgs; // debug.rawLog = rawLog; // env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } createDebug.instances.push(debug); return debug; } function destroy() { const index = createDebug.instances.indexOf(this); if (index !== -1) { createDebug.instances.splice(index, 1); return true; } return false; } function extend(namespace, delimiter) { const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); newDebug.log = this.log; return newDebug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { createDebug.save(namespaces); createDebug.names = []; createDebug.skips = []; let i; const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); const len = split.length; for (i = 0; i < len; i++) { if (!split[i]) { // ignore empty strings continue; } namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else { createDebug.names.push(new RegExp('^' + namespaces + '$')); } } for (i = 0; i < createDebug.instances.length; i++) { const instance = createDebug.instances[i]; instance.enabled = createDebug.enabled(instance.namespace); } } /** * Disable debug output. * * @return {String} namespaces * @api public */ function disable() { const namespaces = [ ...createDebug.names.map(toNamespace), ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) ].join(','); createDebug.enable(''); return namespaces; } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { if (name[name.length - 1] === '*') { return true; } let i; let len; for (i = 0, len = createDebug.skips.length; i < len; i++) { if (createDebug.skips[i].test(name)) { return false; } } for (i = 0, len = createDebug.names.length; i < len; i++) { if (createDebug.names[i].test(name)) { return true; } } return false; } /** * Convert regexp to namespace * * @param {RegExp} regxep * @return {String} namespace * @api private */ function toNamespace(regexp) { return regexp.toString() .substring(2, regexp.toString().length - 2) .replace(/\.\*\?$/, '*'); } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } createDebug.enable(createDebug.load()); return createDebug; } module.exports = setup; /** * Detect Electron renderer / nwjs process, which is node, but we should * treat as a browser. */ if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { module.exports = require('./browser.js'); } else { module.exports = require('./node.js'); } /** * Module dependencies. */ const tty = require('tty'); const util = require('util'); /** * This is the Node.js implementation of `debug()`. */ exports.init = init; exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; /** * Colors. */ exports.colors = [6, 2, 3, 4, 5, 1]; try { // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) // eslint-disable-next-line import/no-extraneous-dependencies const supportsColor = require('supports-color'); if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { exports.colors = [ 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221 ]; } } catch (error) { // Swallow - we only care if `supports-color` is available; it doesn't have to be. } /** * Build up the default `inspectOpts` object from the environment variables. * * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js */ exports.inspectOpts = Object.keys(process.env).filter(key => { return /^debug_/i.test(key); }).reduce((obj, key) => { // Camel-case const prop = key .substring(6) .toLowerCase() .replace(/_([a-z])/g, (_, k) => { return k.toUpperCase(); }); // Coerce string value into JS value let val = process.env[key]; if (/^(yes|on|true|enabled)$/i.test(val)) { val = true; } else if (/^(no|off|false|disabled)$/i.test(val)) { val = false; } else if (val === 'null') { val = null; } else { val = Number(val); } obj[prop] = val; return obj; }, {}); /** * Is stdout a TTY? Colored output is enabled when `true`. */ function useColors() { return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd); } /** * Adds ANSI color escape codes if enabled. * * @api public */ function formatArgs(args) { const {namespace: name, useColors} = this; if (useColors) { const c = this.color; const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); const prefix = ` ${colorCode};1m${name} \u001B[0m`; args[0] = prefix + args[0].split('\n').join('\n' + prefix); args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); } else { args[0] = getDate() + name + ' ' + args[0]; } } function getDate() { if (exports.inspectOpts.hideDate) { return ''; } return new Date().toISOString() + ' '; } /** * Invokes `util.format()` with the specified arguments and writes to stderr. */ function log(...args) { return process.stderr.write(util.format(...args) + '\n'); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { if (namespaces) { process.env.DEBUG = namespaces; } else { // If you set a process.env field to null or undefined, it gets cast to the // string 'null' or 'undefined'. Just delete instead. delete process.env.DEBUG; } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { return process.env.DEBUG; } /** * Init logic for `debug` instances. * * Create a new `inspectOpts` object in case `useColors` is set * differently for a particular `debug` instance. */ function init(debug) { debug.inspectOpts = {}; const keys = Object.keys(exports.inspectOpts); for (let i = 0; i < keys.length; i++) { debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; } } module.exports = require('./common')(exports); const {formatters} = module.exports; /** * Map %o to `util.inspect()`, all on a single line. */ formatters.o = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts) .replace(/\s*\n\s*/g, ' '); }; /** * Map %O to `util.inspect()`, allowing multiple lines if needed. */ formatters.O = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts); }; "use strict"; function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } (function (f) { if ((typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined") { module.exports = f(); } else if (typeof define === "function" && define.amd) { define([], f); } else { var g; if (typeof window !== "undefined") { g = window; } else if (typeof global !== "undefined") { g = global; } else if (typeof self !== "undefined") { g = self; } else { g = this; } g.debug = f(); } })(function () { var define, module, exports; return function () { function r(e, n, t) { function o(i, f) { if (!n[i]) { if (!e[i]) { var c = "function" == typeof require && require; if (!f && c) return c(i, !0); if (u) return u(i, !0); var a = new Error("Cannot find module '" + i + "'"); throw a.code = "MODULE_NOT_FOUND", a; } var p = n[i] = { exports: {} }; e[i][0].call(p.exports, function (r) { var n = e[i][1][r]; return o(n || r); }, p, p.exports, r, e, n, t); } return n[i].exports; } for (var u = "function" == typeof require && require, i = 0; i < t.length; i++) { o(t[i]); } return o; } return r; }()({ 1: [function (require, module, exports) { /** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; var w = d * 7; var y = d * 365.25; /** * Parse or format the given `val`. * * Options: * * - `long` verbose formatting [false] * * @param {String|Number} val * @param {Object} [options] * @throws {Error} throw an error if val is not a non-empty string or a number * @return {String|Number} * @api public */ module.exports = function (val, options) { options = options || {}; var type = _typeof(val); if (type === 'string' && val.length > 0) { return parse(val); } else if (type === 'number' && isNaN(val) === false) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val)); }; /** * Parse the given `str` and return milliseconds. * * @param {String} str * @return {Number} * @api private */ function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'yrs': case 'yr': case 'y': return n * y; case 'weeks': case 'week': case 'w': return n * w; case 'days': case 'day': case 'd': return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': return n * m; case 'seconds': case 'second': case 'secs': case 'sec': case 's': return n * s; case 'milliseconds': case 'millisecond': case 'msecs': case 'msec': case 'ms': return n; default: return undefined; } } /** * Short format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtShort(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return Math.round(ms / d) + 'd'; } if (msAbs >= h) { return Math.round(ms / h) + 'h'; } if (msAbs >= m) { return Math.round(ms / m) + 'm'; } if (msAbs >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtLong(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return plural(ms, msAbs, d, 'day'); } if (msAbs >= h) { return plural(ms, msAbs, h, 'hour'); } if (msAbs >= m) { return plural(ms, msAbs, m, 'minute'); } if (msAbs >= s) { return plural(ms, msAbs, s, 'second'); } return ms + ' ms'; } /** * Pluralization helper. */ function plural(ms, msAbs, n, name) { var isPlural = msAbs >= n * 1.5; return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); } }, {}], 2: [function (require, module, exports) { // shim for using process in browser var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it // don't break things. But we need to wrap it in a try catch in case it is // wrapped in strict mode code which doesn't define any globals. It's inside a // function because try/catches deoptimize in certain engines. var cachedSetTimeout; var cachedClearTimeout; function defaultSetTimout() { throw new Error('setTimeout has not been defined'); } function defaultClearTimeout() { throw new Error('clearTimeout has not been defined'); } (function () { try { if (typeof setTimeout === 'function') { cachedSetTimeout = setTimeout; } else { cachedSetTimeout = defaultSetTimout; } } catch (e) { cachedSetTimeout = defaultSetTimout; } try { if (typeof clearTimeout === 'function') { cachedClearTimeout = clearTimeout; } else { cachedClearTimeout = defaultClearTimeout; } } catch (e) { cachedClearTimeout = defaultClearTimeout; } })(); function runTimeout(fun) { if (cachedSetTimeout === setTimeout) { //normal enviroments in sane situations return setTimeout(fun, 0); } // if setTimeout wasn't available but was latter defined if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout; return setTimeout(fun, 0); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedSetTimeout(fun, 0); } catch (e) { try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedSetTimeout.call(null, fun, 0); } catch (e) { // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { //normal enviroments in sane situations return clearTimeout(marker); } // if clearTimeout wasn't available but was latter defined if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout; return clearTimeout(marker); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedClearTimeout(marker); } catch (e) { try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedClearTimeout.call(null, marker); } catch (e) { // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. // Some versions of I.E. have different rules for clearTimeout vs setTimeout return cachedClearTimeout.call(this, marker); } } } var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; while (len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; runClearTimeout(timeout); } process.nextTick = function (fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { runTimeout(drainQueue); } }; // v8 likes predictible objects function Item(fun, array) { this.fun = fun; this.array = array; } Item.prototype.run = function () { this.fun.apply(null, this.array); }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues process.versions = {}; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.prependListener = noop; process.prependOnceListener = noop; process.listeners = function (name) { return []; }; process.binding = function (name) { throw new Error('process.binding is not supported'); }; process.cwd = function () { return '/'; }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; process.umask = function () { return 0; }; }, {}], 3: [function (require, module, exports) { /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. */ function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = require('ms'); Object.keys(env).forEach(function (key) { createDebug[key] = env[key]; }); /** * Active `debug` instances. */ createDebug.instances = []; /** * The currently active debug mode names, and names to skip. */ createDebug.names = []; createDebug.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ createDebug.formatters = {}; /** * Selects a color for a debug namespace * @param {String} namespace The namespace string for the for the debug instance to be colored * @return {Number|String} An ANSI color code for the given namespace * @api private */ function selectColor(namespace) { var hash = 0; for (var i = 0; i < namespace.length; i++) { hash = (hash << 5) - hash + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { var prevTime; function debug() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } // Disabled? if (!debug.enabled) { return; } var self = debug; // Set `diff` timestamp var curr = Number(new Date()); var ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== 'string') { // Anything else let's inspect with %O args.unshift('%O'); } // Apply any `formatters` transformations var index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) { // If we encounter an escaped % then don't increase the array index if (match === '%%') { return match; } index++; var formatter = createDebug.formatters[format]; if (typeof formatter === 'function') { var val = args[index]; match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // Apply env-specific formatting (colors, etc.) createDebug.formatArgs.call(self, args); var logFn = self.log || createDebug.log; logFn.apply(self, args); } debug.namespace = namespace; debug.enabled = createDebug.enabled(namespace); debug.useColors = createDebug.useColors(); debug.color = selectColor(namespace); debug.destroy = destroy; debug.extend = extend; // Debug.formatArgs = formatArgs; // debug.rawLog = rawLog; // env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } createDebug.instances.push(debug); return debug; } function destroy() { var index = createDebug.instances.indexOf(this); if (index !== -1) { createDebug.instances.splice(index, 1); return true; } return false; } function extend(namespace, delimiter) { var newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); newDebug.log = this.log; return newDebug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { createDebug.save(namespaces); createDebug.names = []; createDebug.skips = []; var i; var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); var len = split.length; for (i = 0; i < len; i++) { if (!split[i]) { // ignore empty strings continue; } namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else { createDebug.names.push(new RegExp('^' + namespaces + '$')); } } for (i = 0; i < createDebug.instances.length; i++) { var instance = createDebug.instances[i]; instance.enabled = createDebug.enabled(instance.namespace); } } /** * Disable debug output. * * @return {String} namespaces * @api public */ function disable() { var namespaces = [].concat(_toConsumableArray(createDebug.names.map(toNamespace)), _toConsumableArray(createDebug.skips.map(toNamespace).map(function (namespace) { return '-' + namespace; }))).join(','); createDebug.enable(''); return namespaces; } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { if (name[name.length - 1] === '*') { return true; } var i; var len; for (i = 0, len = createDebug.skips.length; i < len; i++) { if (createDebug.skips[i].test(name)) { return false; } } for (i = 0, len = createDebug.names.length; i < len; i++) { if (createDebug.names[i].test(name)) { return true; } } return false; } /** * Convert regexp to namespace * * @param {RegExp} regxep * @return {String} namespace * @api private */ function toNamespace(regexp) { return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, '*'); } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } createDebug.enable(createDebug.load()); return createDebug; } module.exports = setup; }, { "ms": 1 }], 4: [function (require, module, exports) { (function (process) { /* eslint-env browser */ /** * This is the web browser implementation of `debug()`. */ exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); /** * Colors. */ exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33']; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ // eslint-disable-next-line complexity function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { return true; } // Internet Explorer and Edge do not support colors. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); } /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); if (!this.useColors) { return; } var c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into var index = 0; var lastC = 0; args[0].replace(/%[a-zA-Z%]/g, function (match) { if (match === '%%') { return; } index++; if (match === '%c') { // We only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.log()` when available. * No-op when `console.log` is not a "function". * * @api public */ function log() { var _console; // This hackery is required for IE8/9, where // the `console.log` function doesn't have 'apply' return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (namespaces) { exports.storage.setItem('debug', namespaces); } else { exports.storage.removeItem('debug'); } } catch (error) {// Swallow // XXX (@Qix-) should we be logging these? } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { var r; try { r = exports.storage.getItem('debug'); } catch (error) {} // Swallow // XXX (@Qix-) should we be logging these? // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context // The Browser also has localStorage in the global context. return localStorage; } catch (error) {// Swallow // XXX (@Qix-) should we be logging these? } } module.exports = require('./common')(exports); var formatters = module.exports.formatters; /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ formatters.j = function (v) { try { return JSON.stringify(v); } catch (error) { return '[UnexpectedJSONParseError]: ' + error.message; } }; }).call(this, require('_process')); }, { "./common": 3, "_process": 2 }] }, {}, [4])(4); }); /* eslint-env browser */ /** * This is the web browser implementation of `debug()`. */ exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); /** * Colors. */ exports.colors = [ '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33' ]; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ // eslint-disable-next-line complexity function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { return true; } // Internet Explorer and Edge do not support colors. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || // Is firebug? http://stackoverflow.com/a/398120/376773 (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || // Double check webkit in userAgent just in case we are in a worker (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); } /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); if (!this.useColors) { return; } const c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into let index = 0; let lastC = 0; args[0].replace(/%[a-zA-Z%]/g, match => { if (match === '%%') { return; } index++; if (match === '%c') { // We only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.log()` when available. * No-op when `console.log` is not a "function". * * @api public */ function log(...args) { // This hackery is required for IE8/9, where // the `console.log` function doesn't have 'apply' return typeof console === 'object' && console.log && console.log(...args); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (namespaces) { exports.storage.setItem('debug', namespaces); } else { exports.storage.removeItem('debug'); } } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { let r; try { r = exports.storage.getItem('debug'); } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context // The Browser also has localStorage in the global context. return localStorage; } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } module.exports = require('./common')(exports); const {formatters} = module.exports; /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ formatters.j = function (v) { try { return JSON.stringify(v); } catch (error) { return '[UnexpectedJSONParseError]: ' + error.message; } }; /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. */ function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = require('ms'); Object.keys(env).forEach(key => { createDebug[key] = env[key]; }); /** * Active `debug` instances. */ createDebug.instances = []; /** * The currently active debug mode names, and names to skip. */ createDebug.names = []; createDebug.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ createDebug.formatters = {}; /** * Selects a color for a debug namespace * @param {String} namespace The namespace string for the for the debug instance to be colored * @return {Number|String} An ANSI color code for the given namespace * @api private */ function selectColor(namespace) { let hash = 0; for (let i = 0; i < namespace.length; i++) { hash = ((hash << 5) - hash) + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { let prevTime; function debug(...args) { // Disabled? if (!debug.enabled) { return; } const self = debug; // Set `diff` timestamp const curr = Number(new Date()); const ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== 'string') { // Anything else let's inspect with %O args.unshift('%O'); } // Apply any `formatters` transformations let index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { // If we encounter an escaped % then don't increase the array index if (match === '%%') { return match; } index++; const formatter = createDebug.formatters[format]; if (typeof formatter === 'function') { const val = args[index]; match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // Apply env-specific formatting (colors, etc.) createDebug.formatArgs.call(self, args); const logFn = self.log || createDebug.log; logFn.apply(self, args); } debug.namespace = namespace; debug.enabled = createDebug.enabled(namespace); debug.useColors = createDebug.useColors(); debug.color = selectColor(namespace); debug.destroy = destroy; debug.extend = extend; // Debug.formatArgs = formatArgs; // debug.rawLog = rawLog; // env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } createDebug.instances.push(debug); return debug; } function destroy() { const index = createDebug.instances.indexOf(this); if (index !== -1) { createDebug.instances.splice(index, 1); return true; } return false; } function extend(namespace, delimiter) { const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); newDebug.log = this.log; return newDebug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { createDebug.save(namespaces); createDebug.names = []; createDebug.skips = []; let i; const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); const len = split.length; for (i = 0; i < len; i++) { if (!split[i]) { // ignore empty strings continue; } namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else { createDebug.names.push(new RegExp('^' + namespaces + '$')); } } for (i = 0; i < createDebug.instances.length; i++) { const instance = createDebug.instances[i]; instance.enabled = createDebug.enabled(instance.namespace); } } /** * Disable debug output. * * @return {String} namespaces * @api public */ function disable() { const namespaces = [ ...createDebug.names.map(toNamespace), ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) ].join(','); createDebug.enable(''); return namespaces; } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { if (name[name.length - 1] === '*') { return true; } let i; let len; for (i = 0, len = createDebug.skips.length; i < len; i++) { if (createDebug.skips[i].test(name)) { return false; } } for (i = 0, len = createDebug.names.length; i < len; i++) { if (createDebug.names[i].test(name)) { return true; } } return false; } /** * Convert regexp to namespace * * @param {RegExp} regxep * @return {String} namespace * @api private */ function toNamespace(regexp) { return regexp.toString() .substring(2, regexp.toString().length - 2) .replace(/\.\*\?$/, '*'); } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } createDebug.enable(createDebug.load()); return createDebug; } module.exports = setup; /** * Detect Electron renderer / nwjs process, which is node, but we should * treat as a browser. */ if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { module.exports = require('./browser.js'); } else { module.exports = require('./node.js'); } /** * Module dependencies. */ const tty = require('tty'); const util = require('util'); /** * This is the Node.js implementation of `debug()`. */ exports.init = init; exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; /** * Colors. */ exports.colors = [6, 2, 3, 4, 5, 1]; try { // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) // eslint-disable-next-line import/no-extraneous-dependencies const supportsColor = require('supports-color'); if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { exports.colors = [ 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221 ]; } } catch (error) { // Swallow - we only care if `supports-color` is available; it doesn't have to be. } /** * Build up the default `inspectOpts` object from the environment variables. * * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js */ exports.inspectOpts = Object.keys(process.env).filter(key => { return /^debug_/i.test(key); }).reduce((obj, key) => { // Camel-case const prop = key .substring(6) .toLowerCase() .replace(/_([a-z])/g, (_, k) => { return k.toUpperCase(); }); // Coerce string value into JS value let val = process.env[key]; if (/^(yes|on|true|enabled)$/i.test(val)) { val = true; } else if (/^(no|off|false|disabled)$/i.test(val)) { val = false; } else if (val === 'null') { val = null; } else { val = Number(val); } obj[prop] = val; return obj; }, {}); /** * Is stdout a TTY? Colored output is enabled when `true`. */ function useColors() { return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd); } /** * Adds ANSI color escape codes if enabled. * * @api public */ function formatArgs(args) { const {namespace: name, useColors} = this; if (useColors) { const c = this.color; const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); const prefix = ` ${colorCode};1m${name} \u001B[0m`; args[0] = prefix + args[0].split('\n').join('\n' + prefix); args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); } else { args[0] = getDate() + name + ' ' + args[0]; } } function getDate() { if (exports.inspectOpts.hideDate) { return ''; } return new Date().toISOString() + ' '; } /** * Invokes `util.format()` with the specified arguments and writes to stderr. */ function log(...args) { return process.stderr.write(util.format(...args) + '\n'); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { if (namespaces) { process.env.DEBUG = namespaces; } else { // If you set a process.env field to null or undefined, it gets cast to the // string 'null' or 'undefined'. Just delete instead. delete process.env.DEBUG; } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { return process.env.DEBUG; } /** * Init logic for `debug` instances. * * Create a new `inspectOpts` object in case `useColors` is set * differently for a particular `debug` instance. */ function init(debug) { debug.inspectOpts = {}; const keys = Object.keys(exports.inspectOpts); for (let i = 0; i < keys.length; i++) { debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; } } module.exports = require('./common')(exports); const {formatters} = module.exports; /** * Map %o to `util.inspect()`, all on a single line. */ formatters.o = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts) .replace(/\s*\n\s*/g, ' '); }; /** * Map %O to `util.inspect()`, allowing multiple lines if needed. */ formatters.O = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts); }; "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; const events_1 = require("events"); const debug_1 = __importDefault(require("debug")); const promisify_1 = __importDefault(require("./promisify")); const debug = debug_1.default('agent-base'); function isAgent(v) { return Boolean(v) && typeof v.addRequest === 'function'; } function isSecureEndpoint() { const { stack } = new Error(); if (typeof stack !== 'string') return false; return stack.split('\n').some(l => l.indexOf('(https.js:') !== -1); } function createAgent(callback, opts) { return new createAgent.Agent(callback, opts); } (function (createAgent) { /** * Base `http.Agent` implementation. * No pooling/keep-alive is implemented by default. * * @param {Function} callback * @api public */ class Agent extends events_1.EventEmitter { constructor(callback, _opts) { super(); let opts = _opts; if (typeof callback === 'function') { this.callback = callback; } else if (callback) { opts = callback; } // Timeout for the socket to be returned from the callback this.timeout = null; if (opts && typeof opts.timeout === 'number') { this.timeout = opts.timeout; } // These aren't actually used by `agent-base`, but are required // for the TypeScript definition files in `@types/node` :/ this.maxFreeSockets = 1; this.maxSockets = 1; this.sockets = {}; this.requests = {}; this.options = {}; } get defaultPort() { if (typeof this.explicitDefaultPort === 'number') { return this.explicitDefaultPort; } return isSecureEndpoint() ? 443 : 80; } set defaultPort(v) { this.explicitDefaultPort = v; } get protocol() { if (typeof this.explicitProtocol === 'string') { return this.explicitProtocol; } return isSecureEndpoint() ? 'https:' : 'http:'; } set protocol(v) { this.explicitProtocol = v; } callback(req, opts, fn) { throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`'); } /** * Called by node-core's "_http_client.js" module when creating * a new HTTP request with this Agent instance. * * @api public */ addRequest(req, _opts) { const opts = Object.assign({}, _opts); if (typeof opts.secureEndpoint !== 'boolean') { opts.secureEndpoint = isSecureEndpoint(); } if (opts.host == null) { opts.host = 'localhost'; } if (opts.port == null) { opts.port = opts.secureEndpoint ? 443 : 80; } if (opts.protocol == null) { opts.protocol = opts.secureEndpoint ? 'https:' : 'http:'; } if (opts.host && opts.path) { // If both a `host` and `path` are specified then it's most // likely the result of a `url.parse()` call... we need to // remove the `path` portion so that `net.connect()` doesn't // attempt to open that as a unix socket file. delete opts.path; } delete opts.agent; delete opts.hostname; delete opts._defaultAgent; delete opts.defaultPort; delete opts.createConnection; // Hint to use "Connection: close" // XXX: non-documented `http` module API :( req._last = true; req.shouldKeepAlive = false; let timedOut = false; let timeoutId = null; const timeoutMs = opts.timeout || this.timeout; const onerror = (err) => { if (req._hadError) return; req.emit('error', err); // For Safety. Some additional errors might fire later on // and we need to make sure we don't double-fire the error event. req._hadError = true; }; const ontimeout = () => { timeoutId = null; timedOut = true; const err = new Error(`A "socket" was not created for HTTP request before ${timeoutMs}ms`); err.code = 'ETIMEOUT'; onerror(err); }; const callbackError = (err) => { if (timedOut) return; if (timeoutId !== null) { clearTimeout(timeoutId); timeoutId = null; } onerror(err); }; const onsocket = (socket) => { if (timedOut) return; if (timeoutId != null) { clearTimeout(timeoutId); timeoutId = null; } if (isAgent(socket)) { // `socket` is actually an `http.Agent` instance, so // relinquish responsibility for this `req` to the Agent // from here on debug('Callback returned another Agent instance %o', socket.constructor.name); socket.addRequest(req, opts); return; } if (socket) { socket.once('free', () => { this.freeSocket(socket, opts); }); req.onSocket(socket); return; } const err = new Error(`no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\``); onerror(err); }; if (typeof this.callback !== 'function') { onerror(new Error('`callback` is not defined')); return; } if (!this.promisifiedCallback) { if (this.callback.length >= 3) { debug('Converting legacy callback function to promise'); this.promisifiedCallback = promisify_1.default(this.callback); } else { this.promisifiedCallback = this.callback; } } if (typeof timeoutMs === 'number' && timeoutMs > 0) { timeoutId = setTimeout(ontimeout, timeoutMs); } if ('port' in opts && typeof opts.port !== 'number') { opts.port = Number(opts.port); } try { debug('Resolving socket for %o request: %o', opts.protocol, `${req.method} ${req.path}`); Promise.resolve(this.promisifiedCallback(req, opts)).then(onsocket, callbackError); } catch (err) { Promise.reject(err).catch(callbackError); } } freeSocket(socket, opts) { debug('Freeing socket %o %o', socket.constructor.name, opts); socket.destroy(); } destroy() { debug('Destroying agent %o', this.constructor.name); } } createAgent.Agent = Agent; // So that `instanceof` works correctly createAgent.prototype = createAgent.Agent.prototype; })(createAgent || (createAgent = {})); module.exports = createAgent;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/vscode-proxy-agent/node_modules/https-proxy-agent/node_modules/agent-base/dist/src/index.js.map"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function promisify(fn) { return function (req, opts) { return new Promise((resolve, reject) => { fn.call(this, req, opts, (err, rtn) => { if (err) { reject(err); } else { resolve(rtn); } }); }); }; } exports.default = promisify;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/vscode-proxy-agent/node_modules/https-proxy-agent/node_modules/agent-base/dist/src/promisify.js.map"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; const events_1 = require("events"); const debug_1 = __importDefault(require("debug")); const promisify_1 = __importDefault(require("./promisify")); const debug = debug_1.default('agent-base'); function isAgent(v) { return Boolean(v) && typeof v.addRequest === 'function'; } function isSecureEndpoint() { const { stack } = new Error(); if (typeof stack !== 'string') return false; return stack.split('\n').some(l => l.indexOf('(https.js:') !== -1); } function createAgent(callback, opts) { return new createAgent.Agent(callback, opts); } (function (createAgent) { /** * Base `http.Agent` implementation. * No pooling/keep-alive is implemented by default. * * @param {Function} callback * @api public */ class Agent extends events_1.EventEmitter { constructor(callback, _opts) { super(); let opts = _opts; if (typeof callback === 'function') { this.callback = callback; } else if (callback) { opts = callback; } // Timeout for the socket to be returned from the callback this.timeout = null; if (opts && typeof opts.timeout === 'number') { this.timeout = opts.timeout; } // These aren't actually used by `agent-base`, but are required // for the TypeScript definition files in `@types/node` :/ this.maxFreeSockets = 1; this.maxSockets = 1; this.sockets = {}; this.requests = {}; this.options = {}; } get defaultPort() { if (typeof this.explicitDefaultPort === 'number') { return this.explicitDefaultPort; } return isSecureEndpoint() ? 443 : 80; } set defaultPort(v) { this.explicitDefaultPort = v; } get protocol() { if (typeof this.explicitProtocol === 'string') { return this.explicitProtocol; } return isSecureEndpoint() ? 'https:' : 'http:'; } set protocol(v) { this.explicitProtocol = v; } callback(req, opts, fn) { throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`'); } /** * Called by node-core's "_http_client.js" module when creating * a new HTTP request with this Agent instance. * * @api public */ addRequest(req, _opts) { const opts = Object.assign({}, _opts); if (typeof opts.secureEndpoint !== 'boolean') { opts.secureEndpoint = isSecureEndpoint(); } if (opts.host == null) { opts.host = 'localhost'; } if (opts.port == null) { opts.port = opts.secureEndpoint ? 443 : 80; } if (opts.protocol == null) { opts.protocol = opts.secureEndpoint ? 'https:' : 'http:'; } if (opts.host && opts.path) { // If both a `host` and `path` are specified then it's most // likely the result of a `url.parse()` call... we need to // remove the `path` portion so that `net.connect()` doesn't // attempt to open that as a unix socket file. delete opts.path; } delete opts.agent; delete opts.hostname; delete opts._defaultAgent; delete opts.defaultPort; delete opts.createConnection; // Hint to use "Connection: close" // XXX: non-documented `http` module API :( req._last = true; req.shouldKeepAlive = false; let timedOut = false; let timeoutId = null; const timeoutMs = opts.timeout || this.timeout; const onerror = (err) => { if (req._hadError) return; req.emit('error', err); // For Safety. Some additional errors might fire later on // and we need to make sure we don't double-fire the error event. req._hadError = true; }; const ontimeout = () => { timeoutId = null; timedOut = true; const err = new Error(`A "socket" was not created for HTTP request before ${timeoutMs}ms`); err.code = 'ETIMEOUT'; onerror(err); }; const callbackError = (err) => { if (timedOut) return; if (timeoutId !== null) { clearTimeout(timeoutId); timeoutId = null; } onerror(err); }; const onsocket = (socket) => { if (timedOut) return; if (timeoutId != null) { clearTimeout(timeoutId); timeoutId = null; } if (isAgent(socket)) { // `socket` is actually an `http.Agent` instance, so // relinquish responsibility for this `req` to the Agent // from here on debug('Callback returned another Agent instance %o', socket.constructor.name); socket.addRequest(req, opts); return; } if (socket) { socket.once('free', () => { this.freeSocket(socket, opts); }); req.onSocket(socket); return; } const err = new Error(`no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\``); onerror(err); }; if (typeof this.callback !== 'function') { onerror(new Error('`callback` is not defined')); return; } if (!this.promisifiedCallback) { if (this.callback.length >= 3) { debug('Converting legacy callback function to promise'); this.promisifiedCallback = promisify_1.default(this.callback); } else { this.promisifiedCallback = this.callback; } } if (typeof timeoutMs === 'number' && timeoutMs > 0) { timeoutId = setTimeout(ontimeout, timeoutMs); } if ('port' in opts && typeof opts.port !== 'number') { opts.port = Number(opts.port); } try { debug('Resolving socket for %o request: %o', opts.protocol, `${req.method} ${req.path}`); Promise.resolve(this.promisifiedCallback(req, opts)).then(onsocket, callbackError); } catch (err) { Promise.reject(err).catch(callbackError); } } freeSocket(socket, opts) { debug('Freeing socket %o %o', socket.constructor.name, opts); socket.destroy(); } destroy() { debug('Destroying agent %o', this.constructor.name); } } createAgent.Agent = Agent; // So that `instanceof` works correctly createAgent.prototype = createAgent.Agent.prototype; })(createAgent || (createAgent = {})); module.exports = createAgent;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/vscode-proxy-agent/node_modules/http-proxy-agent/node_modules/agent-base/dist/src/index.js.map"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function promisify(fn) { return function (req, opts) { return new Promise((resolve, reject) => { fn.call(this, req, opts, (err, rtn) => { if (err) { reject(err); } else { resolve(rtn); } }); }); }; } exports.default = promisify;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/vscode-proxy-agent/node_modules/http-proxy-agent/node_modules/agent-base/dist/src/promisify.js.map/*! @author Toru Nagashima */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var ast = /*#__PURE__*/Object.freeze({ __proto__: null }); let largeIdStartRanges = undefined; let largeIdContinueRanges = undefined; function isIdStart(cp) { if (cp < 0x41) return false; if (cp < 0x5b) return true; if (cp < 0x61) return false; if (cp < 0x7b) return true; return isLargeIdStart(cp); } function isIdContinue(cp) { if (cp < 0x30) return false; if (cp < 0x3a) return true; if (cp < 0x41) return false; if (cp < 0x5b) return true; if (cp === 0x5f) return true; if (cp < 0x61) return false; if (cp < 0x7b) return true; return isLargeIdStart(cp) || isLargeIdContinue(cp); } function isLargeIdStart(cp) { return isInRange(cp, largeIdStartRanges || (largeIdStartRanges = initLargeIdStartRanges())); } function isLargeIdContinue(cp) { return isInRange(cp, largeIdContinueRanges || (largeIdContinueRanges = initLargeIdContinueRanges())); } function initLargeIdStartRanges() { return restoreRanges("4q 0 b 0 5 0 6 m 2 u 2 cp 5 b f 4 8 0 2 0 3m 4 2 1 3 3 2 0 7 0 2 2 2 0 2 j 2 2a 2 3u 9 4l 2 11 3 0 7 14 20 q 5 3 1a 16 10 1 2 2q 2 0 g 1 8 1 b 2 3 0 h 0 2 t u 2g c 0 p w a 1 5 0 6 l 5 0 a 0 4 0 o o 8 a 1i k 2 h 1p 1h 4 0 j 0 8 9 g f 5 7 3 1 3 l 2 6 2 0 4 3 4 0 h 0 e 1 2 2 f 1 b 0 9 5 5 1 3 l 2 6 2 1 2 1 2 1 w 3 2 0 k 2 h 8 2 2 2 l 2 6 2 1 2 4 4 0 j 0 g 1 o 0 c 7 3 1 3 l 2 6 2 1 2 4 4 0 v 1 2 2 g 0 i 0 2 5 4 2 2 3 4 1 2 0 2 1 4 1 4 2 4 b n 0 1h 7 2 2 2 m 2 f 4 0 r 2 6 1 v 0 5 7 2 2 2 m 2 9 2 4 4 0 x 0 2 1 g 1 i 8 2 2 2 14 3 0 h 0 6 2 9 2 p 5 6 h 4 n 2 8 2 0 3 6 1n 1b 2 1 d 6 1n 1 2 0 2 4 2 n 2 0 2 9 2 1 a 0 3 4 2 0 m 3 x 0 1s 7 2 z s 4 38 16 l 0 h 5 5 3 4 0 4 1 8 2 5 c d 0 i 11 2 0 6 0 3 16 2 98 2 3 3 6 2 0 2 3 3 14 2 3 3 w 2 3 3 6 2 0 2 3 3 e 2 1k 2 3 3 1u 12 f h 2d 3 5 4 h7 3 g 2 p 6 22 4 a 8 c 2 3 f h f h f c 2 2 g 1f 10 0 5 0 1w 2g 8 14 2 0 6 1x b u 1e t 3 4 c 17 5 p 1j m a 1g 2b 0 2m 1a i 6 1k t e 1 b 17 r z 16 2 b z 3 8 8 16 3 2 16 3 2 5 2 1 4 0 6 5b 1t 7p 3 5 3 11 3 5 3 7 2 0 2 0 2 0 2 u 3 1g 2 6 2 0 4 2 2 6 4 3 3 5 5 c 6 2 2 6 39 0 e 0 h c 2u 0 5 0 3 9 2 0 3 5 7 0 2 0 2 0 2 f 3 3 6 4 5 0 i 14 22g 1a 2 1a 2 3o 7 3 4 1 d 11 2 0 6 0 3 1j 8 0 h m a 6 2 6 2 6 2 6 2 6 2 6 2 6 2 6 fb 2 q 8 8 4 3 4 5 2d 5 4 2 2h 2 3 6 16 2 2l i v 1d f e9 533 1t g70 4 wc 1w 19 3 7g 4 f b 1 l 1a h u 3 27 14 8 3 2u 3 1g 3 8 17 c 2 2 2 3 2 m u 1f f 1d 1r 5 4 0 2 1 c r b m q s 8 1a t 0 h 4 2 9 b 4 2 14 o 2 2 7 l m 4 0 4 1d 2 0 4 1 3 4 3 0 2 0 p 2 3 a 8 2 d 5 3 5 3 5 a 6 2 6 2 16 2 d 7 36 u 8mb d m 5 1c 6it a5 3 2x 13 6 d 4 6 0 2 9 2 c 2 4 2 0 2 1 2 1 2 2z y a2 j 1r 3 1h 15 b 39 4 2 3q 11 p 7 p c 2g 4 5 3 5 3 5 3 2 10 b 2 p 2 i 2 1 2 e 3 d z 3e 1y 1g 7g s 4 1c 1c v e t 6 11 b t 3 z 5 7 2 4 17 4d j z 5 z 5 13 9 1f 4d 8m a l b 7 49 5 3 0 2 17 2 1 4 0 3 m b m a u 1u i 2 1 b l b p 1z 1j 7 1 1t 0 g 3 2 2 2 s 17 s 4 s 10 7 2 r s 1h b l b i e h 33 20 1k 1e e 1e e z 9p 15 7 1 27 s b 0 9 l 2z k s m d 1g 24 18 x o r z u 0 3 0 9 y 4 0 d 1b f 3 m 0 2 0 10 h 2 o 2d 6 2 0 2 3 2 e 2 9 8 1a 13 7 3 1 3 l 2 6 2 1 2 4 4 0 j 0 d 4 4f 1g j 3 l 2 v 1b l 1 2 0 55 1a 16 3 11 1b l 0 1o 16 e 0 20 q 6e 17 39 1r w 7 3 0 3 7 2 1 2 n g 0 2 0 2n 7 3 12 h 0 2 0 t 0 b 13 8 0 m 0 c 19 k 0 z 1k 7c 8 2 10 i 0 1e t 35 6 2 1 2 11 m 0 q 5 2 1 2 v f 0 94 i 5a 0 28 pl 2v 32 i 5f 24d tq 34i g6 6nu fs 8 u 36 t j 1b h 3 w k 6 i j5 1r 3l 22 6 0 1v c 1t 1 2 0 t 4qf 9 yd 17 8 6wo 7y 1e 2 i 3 9 az 1s5 2y 6 c 4 8 8 9 4mf 2c 2 1y 2 1 3 0 3 1 3 3 2 b 2 0 2 6 2 1s 2 3 3 7 2 6 2 r 2 3 2 4 2 0 4 6 2 9f 3 o 2 o 2 u 2 o 2 u 2 o 2 u 2 o 2 u 2 o 2 7 1th 18 b 6 h 0 aa 17 105 5g 1o 1v 8 0 xh 3 2 q 2 1 2 0 3 0 2 9 2 3 2 0 2 0 7 0 5 0 2 0 2 0 2 2 2 1 2 0 3 0 2 0 2 0 2 0 2 0 2 1 2 0 3 3 2 6 2 3 2 3 2 0 2 9 2 g 6 2 2 4 2 g 3et wyl z 378 c 65 3 4g1 f 5rk 2e8 f1 15v 3t6"); } function initLargeIdContinueRanges() { return restoreRanges("53 0 g9 33 o 0 70 4 7e 18 2 0 2 1 2 1 2 0 21 a 1d u 7 0 2u 6 3 5 3 1 2 3 3 9 o 0 v q 2k a g 9 y 8 a 0 p 3 2 8 2 2 2 4 18 2 3c e 2 w 1j 2 2 h 2 6 b 1 3 9 i 2 1l 0 2 6 3 1 3 2 a 0 b 1 3 9 f 0 3 2 1l 0 2 4 5 1 3 2 4 0 l b 4 0 c 2 1l 0 2 7 2 2 2 2 l 1 3 9 b 5 2 2 1l 0 2 6 3 1 3 2 8 2 b 1 3 9 j 0 1o 4 4 2 2 3 a 0 f 9 h 4 1m 6 2 2 2 3 8 1 c 1 3 9 i 2 1l 0 2 6 2 2 2 3 8 1 c 1 3 9 h 3 1k 1 2 6 2 2 2 3 a 0 b 1 3 9 i 2 1z 0 5 5 2 0 2 7 7 9 3 1 1q 0 3 6 d 7 2 9 2g 0 3 8 c 5 3 9 1r 1 7 9 c 0 2 0 2 0 5 1 1e j 2 1 6 a 2 z a 0 2t j 2 9 d 3 5 2 2 2 3 6 4 3 e b 2 e jk 2 a 8 pt 2 u 2 u 1 v 1 1t v a 0 3 9 y 2 3 9 40 0 3b b 5 b b 9 3l a 1p 4 1m 9 2 s 3 a 7 9 n d 2 1 1s 4 1c g c 9 i 8 d 2 v c 3 9 19 d 1d j 9 9 7 9 3b 2 2 k 5 0 7 0 3 2 5j 1l 2 4 g0 1 k 0 3g c 5 0 4 b 2db 2 3y 0 2p v ff 5 2y 1 n7q 9 1y 0 5 9 x 1 29 1 7l 0 4 0 5 0 o 4 5 0 2c 1 1f h b 9 7 h e a t 7 q c 19 3 1c d g 9 c 0 b 9 1c d d 0 9 1 3 9 y 2 1f 0 2 2 3 1 6 1 2 0 16 4 6 1 6l 7 2 1 3 9 fmt 0 ki f h f 4 1 p 2 5d 9 12 0 ji 0 6b 0 46 4 86 9 120 2 2 1 6 3 15 2 5 0 4m 1 fy 3 9 9 aa 1 4a a 4w 2 1i e w 9 g 3 1a a 1i 9 7 2 11 d 2 9 6 1 19 0 d 2 1d d 9 3 2 b 2b b 7 0 4h b 6 9 7 3 1k 1 2 6 3 1 3 2 a 0 b 1 3 6 4 4 5d h a 9 5 0 2a j d 9 5y 6 3 8 s 1 2b g g 9 2a c 9 9 2c e 5 9 6r e 4m 9 1z 5 2 1 3 3 2 0 2 1 d 9 3c 6 3 6 4 0 t 9 15 6 2 3 9 0 a a 1b f ba 7 2 7 h 9 1l l 2 d 3f 5 4 0 2 1 2 6 2 0 9 9 1d 4 2 1 2 4 9 9 96 3 ewa 9 3r 4 1o 6 q 9 s6 0 2 1i 8 3 2a 0 c 1 f58 1 43r 4 4 5 9 7 3 6 v 3 45 2 13e 1d e9 1i 5 1d 9 0 f 0 n 4 2 e 11t 6 2 g 3 6 2 1 2 4 7a 6 a 9 bn d 15j 6 32 6 6 9 3o7 9 gvt3 6n"); } function isInRange(cp, ranges) { let l = 0, r = (ranges.length / 2) | 0, i = 0, min = 0, max = 0; while (l < r) { i = ((l + r) / 2) | 0; min = ranges[2 * i]; max = ranges[2 * i + 1]; if (cp < min) { r = i; } else if (cp > max) { l = i + 1; } else { return true; } } return false; } function restoreRanges(data) { let last = 0; return data.split(" ").map(s => (last += parseInt(s, 36) | 0)); } class DataSet { constructor(raw2018, raw2019, raw2020, raw2021) { this._raw2018 = raw2018; this._raw2019 = raw2019; this._raw2020 = raw2020; this._raw2021 = raw2021; } get es2018() { return (this._set2018 || (this._set2018 = new Set(this._raw2018.split(" ")))); } get es2019() { return (this._set2019 || (this._set2019 = new Set(this._raw2019.split(" ")))); } get es2020() { return (this._set2020 || (this._set2020 = new Set(this._raw2020.split(" ")))); } get es2021() { return (this._set2021 || (this._set2021 = new Set(this._raw2021.split(" ")))); } } const gcNameSet = new Set(["General_Category", "gc"]); const scNameSet = new Set(["Script", "Script_Extensions", "sc", "scx"]); const gcValueSets = new DataSet("C Cased_Letter Cc Cf Close_Punctuation Cn Co Combining_Mark Connector_Punctuation Control Cs Currency_Symbol Dash_Punctuation Decimal_Number Enclosing_Mark Final_Punctuation Format Initial_Punctuation L LC Letter Letter_Number Line_Separator Ll Lm Lo Lowercase_Letter Lt Lu M Mark Math_Symbol Mc Me Mn Modifier_Letter Modifier_Symbol N Nd Nl No Nonspacing_Mark Number Open_Punctuation Other Other_Letter Other_Number Other_Punctuation Other_Symbol P Paragraph_Separator Pc Pd Pe Pf Pi Po Private_Use Ps Punctuation S Sc Separator Sk Sm So Space_Separator Spacing_Mark Surrogate Symbol Titlecase_Letter Unassigned Uppercase_Letter Z Zl Zp Zs cntrl digit punct", "", "", ""); const scValueSets = new DataSet("Adlam Adlm Aghb Ahom Anatolian_Hieroglyphs Arab Arabic Armenian Armi Armn Avestan Avst Bali Balinese Bamu Bamum Bass Bassa_Vah Batak Batk Beng Bengali Bhaiksuki Bhks Bopo Bopomofo Brah Brahmi Brai Braille Bugi Buginese Buhd Buhid Cakm Canadian_Aboriginal Cans Cari Carian Caucasian_Albanian Chakma Cham Cher Cherokee Common Copt Coptic Cprt Cuneiform Cypriot Cyrillic Cyrl Deseret Deva Devanagari Dsrt Dupl Duployan Egyp Egyptian_Hieroglyphs Elba Elbasan Ethi Ethiopic Geor Georgian Glag Glagolitic Gonm Goth Gothic Gran Grantha Greek Grek Gujarati Gujr Gurmukhi Guru Han Hang Hangul Hani Hano Hanunoo Hatr Hatran Hebr Hebrew Hira Hiragana Hluw Hmng Hung Imperial_Aramaic Inherited Inscriptional_Pahlavi Inscriptional_Parthian Ital Java Javanese Kaithi Kali Kana Kannada Katakana Kayah_Li Khar Kharoshthi Khmer Khmr Khoj Khojki Khudawadi Knda Kthi Lana Lao Laoo Latin Latn Lepc Lepcha Limb Limbu Lina Linb Linear_A Linear_B Lisu Lyci Lycian Lydi Lydian Mahajani Mahj Malayalam Mand Mandaic Mani Manichaean Marc Marchen Masaram_Gondi Meetei_Mayek Mend Mende_Kikakui Merc Mero Meroitic_Cursive Meroitic_Hieroglyphs Miao Mlym Modi Mong Mongolian Mro Mroo Mtei Mult Multani Myanmar Mymr Nabataean Narb Nbat New_Tai_Lue Newa Nko Nkoo Nshu Nushu Ogam Ogham Ol_Chiki Olck Old_Hungarian Old_Italic Old_North_Arabian Old_Permic Old_Persian Old_South_Arabian Old_Turkic Oriya Orkh Orya Osage Osge Osma Osmanya Pahawh_Hmong Palm Palmyrene Pau_Cin_Hau Pauc Perm Phag Phags_Pa Phli Phlp Phnx Phoenician Plrd Prti Psalter_Pahlavi Qaac Qaai Rejang Rjng Runic Runr Samaritan Samr Sarb Saur Saurashtra Sgnw Sharada Shavian Shaw Shrd Sidd Siddham SignWriting Sind Sinh Sinhala Sora Sora_Sompeng Soyo Soyombo Sund Sundanese Sylo Syloti_Nagri Syrc Syriac Tagalog Tagb Tagbanwa Tai_Le Tai_Tham Tai_Viet Takr Takri Tale Talu Tamil Taml Tang Tangut Tavt Telu Telugu Tfng Tglg Thaa Thaana Thai Tibetan Tibt Tifinagh Tirh Tirhuta Ugar Ugaritic Vai Vaii Wara Warang_Citi Xpeo Xsux Yi Yiii Zanabazar_Square Zanb Zinh Zyyy", "Dogr Dogra Gong Gunjala_Gondi Hanifi_Rohingya Maka Makasar Medefaidrin Medf Old_Sogdian Rohg Sogd Sogdian Sogo", "Elym Elymaic Hmnp Nand Nandinagari Nyiakeng_Puachue_Hmong Wancho Wcho", "Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi"); const binPropertySets = new DataSet("AHex ASCII ASCII_Hex_Digit Alpha Alphabetic Any Assigned Bidi_C Bidi_Control Bidi_M Bidi_Mirrored CI CWCF CWCM CWKCF CWL CWT CWU Case_Ignorable Cased Changes_When_Casefolded Changes_When_Casemapped Changes_When_Lowercased Changes_When_NFKC_Casefolded Changes_When_Titlecased Changes_When_Uppercased DI Dash Default_Ignorable_Code_Point Dep Deprecated Dia Diacritic Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Ext Extender Gr_Base Gr_Ext Grapheme_Base Grapheme_Extend Hex Hex_Digit IDC IDS IDSB IDST IDS_Binary_Operator IDS_Trinary_Operator ID_Continue ID_Start Ideo Ideographic Join_C Join_Control LOE Logical_Order_Exception Lower Lowercase Math NChar Noncharacter_Code_Point Pat_Syn Pat_WS Pattern_Syntax Pattern_White_Space QMark Quotation_Mark RI Radical Regional_Indicator SD STerm Sentence_Terminal Soft_Dotted Term Terminal_Punctuation UIdeo Unified_Ideograph Upper Uppercase VS Variation_Selector White_Space XIDC XIDS XID_Continue XID_Start space", "Extended_Pictographic", "", "EBase EComp EMod EPres ExtPict"); function isValidUnicodeProperty(version, name, value) { if (gcNameSet.has(name)) { return version >= 2018 && gcValueSets.es2018.has(value); } if (scNameSet.has(name)) { return ((version >= 2018 && scValueSets.es2018.has(value)) || (version >= 2019 && scValueSets.es2019.has(value)) || (version >= 2020 && scValueSets.es2020.has(value)) || (version >= 2021 && scValueSets.es2021.has(value))); } return false; } function isValidLoneUnicodeProperty(version, value) { return ((version >= 2018 && binPropertySets.es2018.has(value)) || (version >= 2019 && binPropertySets.es2019.has(value)) || (version >= 2021 && binPropertySets.es2021.has(value))); } const Backspace = 0x08; const CharacterTabulation = 0x09; const LineFeed = 0x0a; const LineTabulation = 0x0b; const FormFeed = 0x0c; const CarriageReturn = 0x0d; const ExclamationMark = 0x21; const DollarSign = 0x24; const LeftParenthesis = 0x28; const RightParenthesis = 0x29; const Asterisk = 0x2a; const PlusSign = 0x2b; const Comma = 0x2c; const HyphenMinus = 0x2d; const FullStop = 0x2e; const Solidus = 0x2f; const DigitZero = 0x30; const DigitOne = 0x31; const DigitSeven = 0x37; const DigitNine = 0x39; const Colon = 0x3a; const LessThanSign = 0x3c; const EqualsSign = 0x3d; const GreaterThanSign = 0x3e; const QuestionMark = 0x3f; const LatinCapitalLetterA = 0x41; const LatinCapitalLetterB = 0x42; const LatinCapitalLetterD = 0x44; const LatinCapitalLetterF = 0x46; const LatinCapitalLetterP = 0x50; const LatinCapitalLetterS = 0x53; const LatinCapitalLetterW = 0x57; const LatinCapitalLetterZ = 0x5a; const LowLine = 0x5f; const LatinSmallLetterA = 0x61; const LatinSmallLetterB = 0x62; const LatinSmallLetterC = 0x63; const LatinSmallLetterD = 0x64; const LatinSmallLetterF = 0x66; const LatinSmallLetterG = 0x67; const LatinSmallLetterI = 0x69; const LatinSmallLetterK = 0x6b; const LatinSmallLetterM = 0x6d; const LatinSmallLetterN = 0x6e; const LatinSmallLetterP = 0x70; const LatinSmallLetterR = 0x72; const LatinSmallLetterS = 0x73; const LatinSmallLetterT = 0x74; const LatinSmallLetterU = 0x75; const LatinSmallLetterV = 0x76; const LatinSmallLetterW = 0x77; const LatinSmallLetterX = 0x78; const LatinSmallLetterY = 0x79; const LatinSmallLetterZ = 0x7a; const LeftSquareBracket = 0x5b; const ReverseSolidus = 0x5c; const RightSquareBracket = 0x5d; const CircumflexAccent = 0x5e; const LeftCurlyBracket = 0x7b; const VerticalLine = 0x7c; const RightCurlyBracket = 0x7d; const ZeroWidthNonJoiner = 0x200c; const ZeroWidthJoiner = 0x200d; const LineSeparator = 0x2028; const ParagraphSeparator = 0x2029; const MinCodePoint = 0x00; const MaxCodePoint = 0x10ffff; function isLatinLetter(code) { return ((code >= LatinCapitalLetterA && code <= LatinCapitalLetterZ) || (code >= LatinSmallLetterA && code <= LatinSmallLetterZ)); } function isDecimalDigit(code) { return code >= DigitZero && code <= DigitNine; } function isOctalDigit(code) { return code >= DigitZero && code <= DigitSeven; } function isHexDigit(code) { return ((code >= DigitZero && code <= DigitNine) || (code >= LatinCapitalLetterA && code <= LatinCapitalLetterF) || (code >= LatinSmallLetterA && code <= LatinSmallLetterF)); } function isLineTerminator(code) { return (code === LineFeed || code === CarriageReturn || code === LineSeparator || code === ParagraphSeparator); } function isValidUnicode(code) { return code >= MinCodePoint && code <= MaxCodePoint; } function digitToInt(code) { if (code >= LatinSmallLetterA && code <= LatinSmallLetterF) { return code - LatinSmallLetterA + 10; } if (code >= LatinCapitalLetterA && code <= LatinCapitalLetterF) { return code - LatinCapitalLetterA + 10; } return code - DigitZero; } function isLeadSurrogate(code) { return code >= 0xd800 && code <= 0xdbff; } function isTrailSurrogate(code) { return code >= 0xdc00 && code <= 0xdfff; } function combineSurrogatePair(lead, trail) { return (lead - 0xd800) * 0x400 + (trail - 0xdc00) + 0x10000; } const legacyImpl = { at(s, end, i) { return i < end ? s.charCodeAt(i) : -1; }, width(c) { return 1; }, }; const unicodeImpl = { at(s, end, i) { return i < end ? s.codePointAt(i) : -1; }, width(c) { return c > 0xffff ? 2 : 1; }, }; class Reader { constructor() { this._impl = legacyImpl; this._s = ""; this._i = 0; this._end = 0; this._cp1 = -1; this._w1 = 1; this._cp2 = -1; this._w2 = 1; this._cp3 = -1; this._w3 = 1; this._cp4 = -1; } get source() { return this._s; } get index() { return this._i; } get currentCodePoint() { return this._cp1; } get nextCodePoint() { return this._cp2; } get nextCodePoint2() { return this._cp3; } get nextCodePoint3() { return this._cp4; } reset(source, start, end, uFlag) { this._impl = uFlag ? unicodeImpl : legacyImpl; this._s = source; this._end = end; this.rewind(start); } rewind(index) { const impl = this._impl; this._i = index; this._cp1 = impl.at(this._s, this._end, index); this._w1 = impl.width(this._cp1); this._cp2 = impl.at(this._s, this._end, index + this._w1); this._w2 = impl.width(this._cp2); this._cp3 = impl.at(this._s, this._end, index + this._w1 + this._w2); this._w3 = impl.width(this._cp3); this._cp4 = impl.at(this._s, this._end, index + this._w1 + this._w2 + this._w3); } advance() { if (this._cp1 !== -1) { const impl = this._impl; this._i += this._w1; this._cp1 = this._cp2; this._w1 = this._w2; this._cp2 = this._cp3; this._w2 = impl.width(this._cp2); this._cp3 = this._cp4; this._w3 = impl.width(this._cp3); this._cp4 = impl.at(this._s, this._end, this._i + this._w1 + this._w2 + this._w3); } } eat(cp) { if (this._cp1 === cp) { this.advance(); return true; } return false; } eat2(cp1, cp2) { if (this._cp1 === cp1 && this._cp2 === cp2) { this.advance(); this.advance(); return true; } return false; } eat3(cp1, cp2, cp3) { if (this._cp1 === cp1 && this._cp2 === cp2 && this._cp3 === cp3) { this.advance(); this.advance(); this.advance(); return true; } return false; } } class RegExpSyntaxError extends SyntaxError { constructor(source, uFlag, index, message) { if (source) { if (!source.startsWith("/")) { source = `/${source}/${uFlag ? "u" : ""}`; } source = `: ${source}`; } super(`Invalid regular expression${source}: ${message}`); this.index = index; } } function isSyntaxCharacter(cp) { return (cp === CircumflexAccent || cp === DollarSign || cp === ReverseSolidus || cp === FullStop || cp === Asterisk || cp === PlusSign || cp === QuestionMark || cp === LeftParenthesis || cp === RightParenthesis || cp === LeftSquareBracket || cp === RightSquareBracket || cp === LeftCurlyBracket || cp === RightCurlyBracket || cp === VerticalLine); } function isRegExpIdentifierStart(cp) { return isIdStart(cp) || cp === DollarSign || cp === LowLine; } function isRegExpIdentifierPart(cp) { return (isIdContinue(cp) || cp === DollarSign || cp === LowLine || cp === ZeroWidthNonJoiner || cp === ZeroWidthJoiner); } function isUnicodePropertyNameCharacter(cp) { return isLatinLetter(cp) || cp === LowLine; } function isUnicodePropertyValueCharacter(cp) { return isUnicodePropertyNameCharacter(cp) || isDecimalDigit(cp); } class RegExpValidator { constructor(options) { this._reader = new Reader(); this._uFlag = false; this._nFlag = false; this._lastIntValue = 0; this._lastMinValue = 0; this._lastMaxValue = 0; this._lastStrValue = ""; this._lastKeyValue = ""; this._lastValValue = ""; this._lastAssertionIsQuantifiable = false; this._numCapturingParens = 0; this._groupNames = new Set(); this._backreferenceNames = new Set(); this._options = options || {}; } validateLiteral(source, start = 0, end = source.length) { this._uFlag = this._nFlag = false; this.reset(source, start, end); this.onLiteralEnter(start); if (this.eat(Solidus) && this.eatRegExpBody() && this.eat(Solidus)) { const flagStart = this.index; const uFlag = source.includes("u", flagStart); this.validateFlags(source, flagStart, end); this.validatePattern(source, start + 1, flagStart - 1, uFlag); } else if (start >= end) { this.raise("Empty"); } else { const c = String.fromCodePoint(this.currentCodePoint); this.raise(`Unexpected character '${c}'`); } this.onLiteralLeave(start, end); } validateFlags(source, start = 0, end = source.length) { const existingFlags = new Set(); let global = false; let ignoreCase = false; let multiline = false; let sticky = false; let unicode = false; let dotAll = false; for (let i = start; i < end; ++i) { const flag = source.charCodeAt(i); if (existingFlags.has(flag)) { this.raise(`Duplicated flag '${source[i]}'`); } existingFlags.add(flag); if (flag === LatinSmallLetterG) { global = true; } else if (flag === LatinSmallLetterI) { ignoreCase = true; } else if (flag === LatinSmallLetterM) { multiline = true; } else if (flag === LatinSmallLetterU && this.ecmaVersion >= 2015) { unicode = true; } else if (flag === LatinSmallLetterY && this.ecmaVersion >= 2015) { sticky = true; } else if (flag === LatinSmallLetterS && this.ecmaVersion >= 2018) { dotAll = true; } else { this.raise(`Invalid flag '${source[i]}'`); } } this.onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll); } validatePattern(source, start = 0, end = source.length, uFlag = false) { this._uFlag = uFlag && this.ecmaVersion >= 2015; this._nFlag = uFlag && this.ecmaVersion >= 2018; this.reset(source, start, end); this.consumePattern(); if (!this._nFlag && this.ecmaVersion >= 2018 && this._groupNames.size > 0) { this._nFlag = true; this.rewind(start); this.consumePattern(); } } get strict() { return Boolean(this._options.strict || this._uFlag); } get ecmaVersion() { return this._options.ecmaVersion || 2020; } onLiteralEnter(start) { if (this._options.onLiteralEnter) { this._options.onLiteralEnter(start); } } onLiteralLeave(start, end) { if (this._options.onLiteralLeave) { this._options.onLiteralLeave(start, end); } } onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll) { if (this._options.onFlags) { this._options.onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll); } } onPatternEnter(start) { if (this._options.onPatternEnter) { this._options.onPatternEnter(start); } } onPatternLeave(start, end) { if (this._options.onPatternLeave) { this._options.onPatternLeave(start, end); } } onDisjunctionEnter(start) { if (this._options.onDisjunctionEnter) { this._options.onDisjunctionEnter(start); } } onDisjunctionLeave(start, end) { if (this._options.onDisjunctionLeave) { this._options.onDisjunctionLeave(start, end); } } onAlternativeEnter(start, index) { if (this._options.onAlternativeEnter) { this._options.onAlternativeEnter(start, index); } } onAlternativeLeave(start, end, index) { if (this._options.onAlternativeLeave) { this._options.onAlternativeLeave(start, end, index); } } onGroupEnter(start) { if (this._options.onGroupEnter) { this._options.onGroupEnter(start); } } onGroupLeave(start, end) { if (this._options.onGroupLeave) { this._options.onGroupLeave(start, end); } } onCapturingGroupEnter(start, name) { if (this._options.onCapturingGroupEnter) { this._options.onCapturingGroupEnter(start, name); } } onCapturingGroupLeave(start, end, name) { if (this._options.onCapturingGroupLeave) { this._options.onCapturingGroupLeave(start, end, name); } } onQuantifier(start, end, min, max, greedy) { if (this._options.onQuantifier) { this._options.onQuantifier(start, end, min, max, greedy); } } onLookaroundAssertionEnter(start, kind, negate) { if (this._options.onLookaroundAssertionEnter) { this._options.onLookaroundAssertionEnter(start, kind, negate); } } onLookaroundAssertionLeave(start, end, kind, negate) { if (this._options.onLookaroundAssertionLeave) { this._options.onLookaroundAssertionLeave(start, end, kind, negate); } } onEdgeAssertion(start, end, kind) { if (this._options.onEdgeAssertion) { this._options.onEdgeAssertion(start, end, kind); } } onWordBoundaryAssertion(start, end, kind, negate) { if (this._options.onWordBoundaryAssertion) { this._options.onWordBoundaryAssertion(start, end, kind, negate); } } onAnyCharacterSet(start, end, kind) { if (this._options.onAnyCharacterSet) { this._options.onAnyCharacterSet(start, end, kind); } } onEscapeCharacterSet(start, end, kind, negate) { if (this._options.onEscapeCharacterSet) { this._options.onEscapeCharacterSet(start, end, kind, negate); } } onUnicodePropertyCharacterSet(start, end, kind, key, value, negate) { if (this._options.onUnicodePropertyCharacterSet) { this._options.onUnicodePropertyCharacterSet(start, end, kind, key, value, negate); } } onCharacter(start, end, value) { if (this._options.onCharacter) { this._options.onCharacter(start, end, value); } } onBackreference(start, end, ref) { if (this._options.onBackreference) { this._options.onBackreference(start, end, ref); } } onCharacterClassEnter(start, negate) { if (this._options.onCharacterClassEnter) { this._options.onCharacterClassEnter(start, negate); } } onCharacterClassLeave(start, end, negate) { if (this._options.onCharacterClassLeave) { this._options.onCharacterClassLeave(start, end, negate); } } onCharacterClassRange(start, end, min, max) { if (this._options.onCharacterClassRange) { this._options.onCharacterClassRange(start, end, min, max); } } get source() { return this._reader.source; } get index() { return this._reader.index; } get currentCodePoint() { return this._reader.currentCodePoint; } get nextCodePoint() { return this._reader.nextCodePoint; } get nextCodePoint2() { return this._reader.nextCodePoint2; } get nextCodePoint3() { return this._reader.nextCodePoint3; } reset(source, start, end) { this._reader.reset(source, start, end, this._uFlag); } rewind(index) { this._reader.rewind(index); } advance() { this._reader.advance(); } eat(cp) { return this._reader.eat(cp); } eat2(cp1, cp2) { return this._reader.eat2(cp1, cp2); } eat3(cp1, cp2, cp3) { return this._reader.eat3(cp1, cp2, cp3); } raise(message) { throw new RegExpSyntaxError(this.source, this._uFlag, this.index, message); } eatRegExpBody() { const start = this.index; let inClass = false; let escaped = false; for (;;) { const cp = this.currentCodePoint; if (cp === -1 || isLineTerminator(cp)) { const kind = inClass ? "character class" : "regular expression"; this.raise(`Unterminated ${kind}`); } if (escaped) { escaped = false; } else if (cp === ReverseSolidus) { escaped = true; } else if (cp === LeftSquareBracket) { inClass = true; } else if (cp === RightSquareBracket) { inClass = false; } else if ((cp === Solidus && !inClass) || (cp === Asterisk && this.index === start)) { break; } this.advance(); } return this.index !== start; } consumePattern() { const start = this.index; this._numCapturingParens = this.countCapturingParens(); this._groupNames.clear(); this._backreferenceNames.clear(); this.onPatternEnter(start); this.consumeDisjunction(); const cp = this.currentCodePoint; if (this.currentCodePoint !== -1) { if (cp === RightParenthesis) { this.raise("Unmatched ')'"); } if (cp === ReverseSolidus) { this.raise("\\ at end of pattern"); } if (cp === RightSquareBracket || cp === RightCurlyBracket) { this.raise("Lone quantifier brackets"); } const c = String.fromCodePoint(cp); this.raise(`Unexpected character '${c}'`); } for (const name of this._backreferenceNames) { if (!this._groupNames.has(name)) { this.raise("Invalid named capture referenced"); } } this.onPatternLeave(start, this.index); } countCapturingParens() { const start = this.index; let inClass = false; let escaped = false; let count = 0; let cp = 0; while ((cp = this.currentCodePoint) !== -1) { if (escaped) { escaped = false; } else if (cp === ReverseSolidus) { escaped = true; } else if (cp === LeftSquareBracket) { inClass = true; } else if (cp === RightSquareBracket) { inClass = false; } else if (cp === LeftParenthesis && !inClass && (this.nextCodePoint !== QuestionMark || (this.nextCodePoint2 === LessThanSign && this.nextCodePoint3 !== EqualsSign && this.nextCodePoint3 !== ExclamationMark))) { count += 1; } this.advance(); } this.rewind(start); return count; } consumeDisjunction() { const start = this.index; let i = 0; this.onDisjunctionEnter(start); do { this.consumeAlternative(i++); } while (this.eat(VerticalLine)); if (this.consumeQuantifier(true)) { this.raise("Nothing to repeat"); } if (this.eat(LeftCurlyBracket)) { this.raise("Lone quantifier brackets"); } this.onDisjunctionLeave(start, this.index); } consumeAlternative(i) { const start = this.index; this.onAlternativeEnter(start, i); while (this.currentCodePoint !== -1 && this.consumeTerm()) { } this.onAlternativeLeave(start, this.index, i); } consumeTerm() { if (this._uFlag || this.strict) { return (this.consumeAssertion() || (this.consumeAtom() && this.consumeOptionalQuantifier())); } return ((this.consumeAssertion() && (!this._lastAssertionIsQuantifiable || this.consumeOptionalQuantifier())) || (this.consumeExtendedAtom() && this.consumeOptionalQuantifier())); } consumeOptionalQuantifier() { this.consumeQuantifier(); return true; } consumeAssertion() { const start = this.index; this._lastAssertionIsQuantifiable = false; if (this.eat(CircumflexAccent)) { this.onEdgeAssertion(start, this.index, "start"); return true; } if (this.eat(DollarSign)) { this.onEdgeAssertion(start, this.index, "end"); return true; } if (this.eat2(ReverseSolidus, LatinCapitalLetterB)) { this.onWordBoundaryAssertion(start, this.index, "word", true); return true; } if (this.eat2(ReverseSolidus, LatinSmallLetterB)) { this.onWordBoundaryAssertion(start, this.index, "word", false); return true; } if (this.eat2(LeftParenthesis, QuestionMark)) { const lookbehind = this.ecmaVersion >= 2018 && this.eat(LessThanSign); let negate = false; if (this.eat(EqualsSign) || (negate = this.eat(ExclamationMark))) { const kind = lookbehind ? "lookbehind" : "lookahead"; this.onLookaroundAssertionEnter(start, kind, negate); this.consumeDisjunction(); if (!this.eat(RightParenthesis)) { this.raise("Unterminated group"); } this._lastAssertionIsQuantifiable = !lookbehind && !this.strict; this.onLookaroundAssertionLeave(start, this.index, kind, negate); return true; } this.rewind(start); } return false; } consumeQuantifier(noConsume = false) { const start = this.index; let min = 0; let max = 0; let greedy = false; if (this.eat(Asterisk)) { min = 0; max = Number.POSITIVE_INFINITY; } else if (this.eat(PlusSign)) { min = 1; max = Number.POSITIVE_INFINITY; } else if (this.eat(QuestionMark)) { min = 0; max = 1; } else if (this.eatBracedQuantifier(noConsume)) { min = this._lastMinValue; max = this._lastMaxValue; } else { return false; } greedy = !this.eat(QuestionMark); if (!noConsume) { this.onQuantifier(start, this.index, min, max, greedy); } return true; } eatBracedQuantifier(noError) { const start = this.index; if (this.eat(LeftCurlyBracket)) { this._lastMinValue = 0; this._lastMaxValue = Number.POSITIVE_INFINITY; if (this.eatDecimalDigits()) { this._lastMinValue = this._lastMaxValue = this._lastIntValue; if (this.eat(Comma)) { this._lastMaxValue = this.eatDecimalDigits() ? this._lastIntValue : Number.POSITIVE_INFINITY; } if (this.eat(RightCurlyBracket)) { if (!noError && this._lastMaxValue < this._lastMinValue) { this.raise("numbers out of order in {} quantifier"); } return true; } } if (!noError && (this._uFlag || this.strict)) { this.raise("Incomplete quantifier"); } this.rewind(start); } return false; } consumeAtom() { return (this.consumePatternCharacter() || this.consumeDot() || this.consumeReverseSolidusAtomEscape() || this.consumeCharacterClass() || this.consumeUncapturingGroup() || this.consumeCapturingGroup()); } consumeDot() { if (this.eat(FullStop)) { this.onAnyCharacterSet(this.index - 1, this.index, "any"); return true; } return false; } consumeReverseSolidusAtomEscape() { const start = this.index; if (this.eat(ReverseSolidus)) { if (this.consumeAtomEscape()) { return true; } this.rewind(start); } return false; } consumeUncapturingGroup() { const start = this.index; if (this.eat3(LeftParenthesis, QuestionMark, Colon)) { this.onGroupEnter(start); this.consumeDisjunction(); if (!this.eat(RightParenthesis)) { this.raise("Unterminated group"); } this.onGroupLeave(start, this.index); return true; } return false; } consumeCapturingGroup() { const start = this.index; if (this.eat(LeftParenthesis)) { let name = null; if (this.ecmaVersion >= 2018) { if (this.consumeGroupSpecifier()) { name = this._lastStrValue; } } else if (this.currentCodePoint === QuestionMark) { this.raise("Invalid group"); } this.onCapturingGroupEnter(start, name); this.consumeDisjunction(); if (!this.eat(RightParenthesis)) { this.raise("Unterminated group"); } this.onCapturingGroupLeave(start, this.index, name); return true; } return false; } consumeExtendedAtom() { return (this.consumeDot() || this.consumeReverseSolidusAtomEscape() || this.consumeReverseSolidusFollowedByC() || this.consumeCharacterClass() || this.consumeUncapturingGroup() || this.consumeCapturingGroup() || this.consumeInvalidBracedQuantifier() || this.consumeExtendedPatternCharacter()); } consumeReverseSolidusFollowedByC() { const start = this.index; if (this.currentCodePoint === ReverseSolidus && this.nextCodePoint === LatinSmallLetterC) { this._lastIntValue = this.currentCodePoint; this.advance(); this.onCharacter(start, this.index, ReverseSolidus); return true; } return false; } consumeInvalidBracedQuantifier() { if (this.eatBracedQuantifier(true)) { this.raise("Nothing to repeat"); } return false; } consumePatternCharacter() { const start = this.index; const cp = this.currentCodePoint; if (cp !== -1 && !isSyntaxCharacter(cp)) { this.advance(); this.onCharacter(start, this.index, cp); return true; } return false; } consumeExtendedPatternCharacter() { const start = this.index; const cp = this.currentCodePoint; if (cp !== -1 && cp !== CircumflexAccent && cp !== DollarSign && cp !== ReverseSolidus && cp !== FullStop && cp !== Asterisk && cp !== PlusSign && cp !== QuestionMark && cp !== LeftParenthesis && cp !== RightParenthesis && cp !== LeftSquareBracket && cp !== VerticalLine) { this.advance(); this.onCharacter(start, this.index, cp); return true; } return false; } consumeGroupSpecifier() { if (this.eat(QuestionMark)) { if (this.eatGroupName()) { if (!this._groupNames.has(this._lastStrValue)) { this._groupNames.add(this._lastStrValue); return true; } this.raise("Duplicate capture group name"); } this.raise("Invalid group"); } return false; } consumeAtomEscape() { if (this.consumeBackreference() || this.consumeCharacterClassEscape() || this.consumeCharacterEscape() || (this._nFlag && this.consumeKGroupName())) { return true; } if (this.strict || this._uFlag) { this.raise("Invalid escape"); } return false; } consumeBackreference() { const start = this.index; if (this.eatDecimalEscape()) { const n = this._lastIntValue; if (n <= this._numCapturingParens) { this.onBackreference(start - 1, this.index, n); return true; } if (this.strict || this._uFlag) { this.raise("Invalid escape"); } this.rewind(start); } return false; } consumeCharacterClassEscape() { const start = this.index; if (this.eat(LatinSmallLetterD)) { this._lastIntValue = -1; this.onEscapeCharacterSet(start - 1, this.index, "digit", false); return true; } if (this.eat(LatinCapitalLetterD)) { this._lastIntValue = -1; this.onEscapeCharacterSet(start - 1, this.index, "digit", true); return true; } if (this.eat(LatinSmallLetterS)) { this._lastIntValue = -1; this.onEscapeCharacterSet(start - 1, this.index, "space", false); return true; } if (this.eat(LatinCapitalLetterS)) { this._lastIntValue = -1; this.onEscapeCharacterSet(start - 1, this.index, "space", true); return true; } if (this.eat(LatinSmallLetterW)) { this._lastIntValue = -1; this.onEscapeCharacterSet(start - 1, this.index, "word", false); return true; } if (this.eat(LatinCapitalLetterW)) { this._lastIntValue = -1; this.onEscapeCharacterSet(start - 1, this.index, "word", true); return true; } let negate = false; if (this._uFlag && this.ecmaVersion >= 2018 && (this.eat(LatinSmallLetterP) || (negate = this.eat(LatinCapitalLetterP)))) { this._lastIntValue = -1; if (this.eat(LeftCurlyBracket) && this.eatUnicodePropertyValueExpression() && this.eat(RightCurlyBracket)) { this.onUnicodePropertyCharacterSet(start - 1, this.index, "property", this._lastKeyValue, this._lastValValue || null, negate); return true; } this.raise("Invalid property name"); } return false; } consumeCharacterEscape() { const start = this.index; if (this.eatControlEscape() || this.eatCControlLetter() || this.eatZero() || this.eatHexEscapeSequence() || this.eatRegExpUnicodeEscapeSequence() || (!this.strict && !this._uFlag && this.eatLegacyOctalEscapeSequence()) || this.eatIdentityEscape()) { this.onCharacter(start - 1, this.index, this._lastIntValue); return true; } return false; } consumeKGroupName() { const start = this.index; if (this.eat(LatinSmallLetterK)) { if (this.eatGroupName()) { const groupName = this._lastStrValue; this._backreferenceNames.add(groupName); this.onBackreference(start - 1, this.index, groupName); return true; } this.raise("Invalid named reference"); } return false; } consumeCharacterClass() { const start = this.index; if (this.eat(LeftSquareBracket)) { const negate = this.eat(CircumflexAccent); this.onCharacterClassEnter(start, negate); this.consumeClassRanges(); if (!this.eat(RightSquareBracket)) { this.raise("Unterminated character class"); } this.onCharacterClassLeave(start, this.index, negate); return true; } return false; } consumeClassRanges() { const strict = this.strict || this._uFlag; for (;;) { const rangeStart = this.index; if (!this.consumeClassAtom()) { break; } const min = this._lastIntValue; if (!this.eat(HyphenMinus)) { continue; } this.onCharacter(this.index - 1, this.index, HyphenMinus); if (!this.consumeClassAtom()) { break; } const max = this._lastIntValue; if (min === -1 || max === -1) { if (strict) { this.raise("Invalid character class"); } continue; } if (min > max) { this.raise("Range out of order in character class"); } this.onCharacterClassRange(rangeStart, this.index, min, max); } } consumeClassAtom() { const start = this.index; const cp = this.currentCodePoint; if (cp !== -1 && cp !== ReverseSolidus && cp !== RightSquareBracket) { this.advance(); this._lastIntValue = cp; this.onCharacter(start, this.index, this._lastIntValue); return true; } if (this.eat(ReverseSolidus)) { if (this.consumeClassEscape()) { return true; } if (!this.strict && this.currentCodePoint === LatinSmallLetterC) { this._lastIntValue = ReverseSolidus; this.onCharacter(start, this.index, this._lastIntValue); return true; } if (this.strict || this._uFlag) { this.raise("Invalid escape"); } this.rewind(start); } return false; } consumeClassEscape() { const start = this.index; if (this.eat(LatinSmallLetterB)) { this._lastIntValue = Backspace; this.onCharacter(start - 1, this.index, this._lastIntValue); return true; } if (this._uFlag && this.eat(HyphenMinus)) { this._lastIntValue = HyphenMinus; this.onCharacter(start - 1, this.index, this._lastIntValue); return true; } let cp = 0; if (!this.strict && !this._uFlag && this.currentCodePoint === LatinSmallLetterC && (isDecimalDigit((cp = this.nextCodePoint)) || cp === LowLine)) { this.advance(); this.advance(); this._lastIntValue = cp % 0x20; this.onCharacter(start - 1, this.index, this._lastIntValue); return true; } return (this.consumeCharacterClassEscape() || this.consumeCharacterEscape()); } eatGroupName() { if (this.eat(LessThanSign)) { if (this.eatRegExpIdentifierName() && this.eat(GreaterThanSign)) { return true; } this.raise("Invalid capture group name"); } return false; } eatRegExpIdentifierName() { if (this.eatRegExpIdentifierStart()) { this._lastStrValue = String.fromCodePoint(this._lastIntValue); while (this.eatRegExpIdentifierPart()) { this._lastStrValue += String.fromCodePoint(this._lastIntValue); } return true; } return false; } eatRegExpIdentifierStart() { const start = this.index; const forceUFlag = !this._uFlag && this.ecmaVersion >= 2020; let cp = this.currentCodePoint; this.advance(); if (cp === ReverseSolidus && this.eatRegExpUnicodeEscapeSequence(forceUFlag)) { cp = this._lastIntValue; } else if (forceUFlag && isLeadSurrogate(cp) && isTrailSurrogate(this.currentCodePoint)) { cp = combineSurrogatePair(cp, this.currentCodePoint); this.advance(); } if (isRegExpIdentifierStart(cp)) { this._lastIntValue = cp; return true; } if (this.index !== start) { this.rewind(start); } return false; } eatRegExpIdentifierPart() { const start = this.index; const forceUFlag = !this._uFlag && this.ecmaVersion >= 2020; let cp = this.currentCodePoint; this.advance(); if (cp === ReverseSolidus && this.eatRegExpUnicodeEscapeSequence(forceUFlag)) { cp = this._lastIntValue; } else if (forceUFlag && isLeadSurrogate(cp) && isTrailSurrogate(this.currentCodePoint)) { cp = combineSurrogatePair(cp, this.currentCodePoint); this.advance(); } if (isRegExpIdentifierPart(cp)) { this._lastIntValue = cp; return true; } if (this.index !== start) { this.rewind(start); } return false; } eatCControlLetter() { const start = this.index; if (this.eat(LatinSmallLetterC)) { if (this.eatControlLetter()) { return true; } this.rewind(start); } return false; } eatZero() { if (this.currentCodePoint === DigitZero && !isDecimalDigit(this.nextCodePoint)) { this._lastIntValue = 0; this.advance(); return true; } return false; } eatControlEscape() { if (this.eat(LatinSmallLetterF)) { this._lastIntValue = FormFeed; return true; } if (this.eat(LatinSmallLetterN)) { this._lastIntValue = LineFeed; return true; } if (this.eat(LatinSmallLetterR)) { this._lastIntValue = CarriageReturn; return true; } if (this.eat(LatinSmallLetterT)) { this._lastIntValue = CharacterTabulation; return true; } if (this.eat(LatinSmallLetterV)) { this._lastIntValue = LineTabulation; return true; } return false; } eatControlLetter() { const cp = this.currentCodePoint; if (isLatinLetter(cp)) { this.advance(); this._lastIntValue = cp % 0x20; return true; } return false; } eatRegExpUnicodeEscapeSequence(forceUFlag = false) { const start = this.index; const uFlag = forceUFlag || this._uFlag; if (this.eat(LatinSmallLetterU)) { if ((uFlag && this.eatRegExpUnicodeSurrogatePairEscape()) || this.eatFixedHexDigits(4) || (uFlag && this.eatRegExpUnicodeCodePointEscape())) { return true; } if (this.strict || uFlag) { this.raise("Invalid unicode escape"); } this.rewind(start); } return false; } eatRegExpUnicodeSurrogatePairEscape() { const start = this.index; if (this.eatFixedHexDigits(4)) { const lead = this._lastIntValue; if (isLeadSurrogate(lead) && this.eat(ReverseSolidus) && this.eat(LatinSmallLetterU) && this.eatFixedHexDigits(4)) { const trail = this._lastIntValue; if (isTrailSurrogate(trail)) { this._lastIntValue = combineSurrogatePair(lead, trail); return true; } } this.rewind(start); } return false; } eatRegExpUnicodeCodePointEscape() { const start = this.index; if (this.eat(LeftCurlyBracket) && this.eatHexDigits() && this.eat(RightCurlyBracket) && isValidUnicode(this._lastIntValue)) { return true; } this.rewind(start); return false; } eatIdentityEscape() { const cp = this.currentCodePoint; if (this.isValidIdentityEscape(cp)) { this._lastIntValue = cp; this.advance(); return true; } return false; } isValidIdentityEscape(cp) { if (cp === -1) { return false; } if (this._uFlag) { return isSyntaxCharacter(cp) || cp === Solidus; } if (this.strict) { return !isIdContinue(cp); } if (this._nFlag) { return !(cp === LatinSmallLetterC || cp === LatinSmallLetterK); } return cp !== LatinSmallLetterC; } eatDecimalEscape() { this._lastIntValue = 0; let cp = this.currentCodePoint; if (cp >= DigitOne && cp <= DigitNine) { do { this._lastIntValue = 10 * this._lastIntValue + (cp - DigitZero); this.advance(); } while ((cp = this.currentCodePoint) >= DigitZero && cp <= DigitNine); return true; } return false; } eatUnicodePropertyValueExpression() { const start = this.index; if (this.eatUnicodePropertyName() && this.eat(EqualsSign)) { this._lastKeyValue = this._lastStrValue; if (this.eatUnicodePropertyValue()) { this._lastValValue = this._lastStrValue; if (isValidUnicodeProperty(this.ecmaVersion, this._lastKeyValue, this._lastValValue)) { return true; } this.raise("Invalid property name"); } } this.rewind(start); if (this.eatLoneUnicodePropertyNameOrValue()) { const nameOrValue = this._lastStrValue; if (isValidUnicodeProperty(this.ecmaVersion, "General_Category", nameOrValue)) { this._lastKeyValue = "General_Category"; this._lastValValue = nameOrValue; return true; } if (isValidLoneUnicodeProperty(this.ecmaVersion, nameOrValue)) { this._lastKeyValue = nameOrValue; this._lastValValue = ""; return true; } this.raise("Invalid property name"); } return false; } eatUnicodePropertyName() { this._lastStrValue = ""; while (isUnicodePropertyNameCharacter(this.currentCodePoint)) { this._lastStrValue += String.fromCodePoint(this.currentCodePoint); this.advance(); } return this._lastStrValue !== ""; } eatUnicodePropertyValue() { this._lastStrValue = ""; while (isUnicodePropertyValueCharacter(this.currentCodePoint)) { this._lastStrValue += String.fromCodePoint(this.currentCodePoint); this.advance(); } return this._lastStrValue !== ""; } eatLoneUnicodePropertyNameOrValue() { return this.eatUnicodePropertyValue(); } eatHexEscapeSequence() { const start = this.index; if (this.eat(LatinSmallLetterX)) { if (this.eatFixedHexDigits(2)) { return true; } if (this._uFlag || this.strict) { this.raise("Invalid escape"); } this.rewind(start); } return false; } eatDecimalDigits() { const start = this.index; this._lastIntValue = 0; while (isDecimalDigit(this.currentCodePoint)) { this._lastIntValue = 10 * this._lastIntValue + digitToInt(this.currentCodePoint); this.advance(); } return this.index !== start; } eatHexDigits() { const start = this.index; this._lastIntValue = 0; while (isHexDigit(this.currentCodePoint)) { this._lastIntValue = 16 * this._lastIntValue + digitToInt(this.currentCodePoint); this.advance(); } return this.index !== start; } eatLegacyOctalEscapeSequence() { if (this.eatOctalDigit()) { const n1 = this._lastIntValue; if (this.eatOctalDigit()) { const n2 = this._lastIntValue; if (n1 <= 3 && this.eatOctalDigit()) { this._lastIntValue = n1 * 64 + n2 * 8 + this._lastIntValue; } else { this._lastIntValue = n1 * 8 + n2; } } else { this._lastIntValue = n1; } return true; } return false; } eatOctalDigit() { const cp = this.currentCodePoint; if (isOctalDigit(cp)) { this.advance(); this._lastIntValue = cp - DigitZero; return true; } this._lastIntValue = 0; return false; } eatFixedHexDigits(length) { const start = this.index; this._lastIntValue = 0; for (let i = 0; i < length; ++i) { const cp = this.currentCodePoint; if (!isHexDigit(cp)) { this.rewind(start); return false; } this._lastIntValue = 16 * this._lastIntValue + digitToInt(cp); this.advance(); } return true; } } const DummyPattern = {}; const DummyFlags = {}; const DummyCapturingGroup = {}; class RegExpParserState { constructor(options) { this._node = DummyPattern; this._flags = DummyFlags; this._backreferences = []; this._capturingGroups = []; this.source = ""; this.strict = Boolean(options && options.strict); this.ecmaVersion = (options && options.ecmaVersion) || 2020; } get pattern() { if (this._node.type !== "Pattern") { throw new Error("UnknownError"); } return this._node; } get flags() { if (this._flags.type !== "Flags") { throw new Error("UnknownError"); } return this._flags; } onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll) { this._flags = { type: "Flags", parent: null, start, end, raw: this.source.slice(start, end), global, ignoreCase, multiline, unicode, sticky, dotAll, }; } onPatternEnter(start) { this._node = { type: "Pattern", parent: null, start, end: start, raw: "", alternatives: [], }; this._backreferences.length = 0; this._capturingGroups.length = 0; } onPatternLeave(start, end) { this._node.end = end; this._node.raw = this.source.slice(start, end); for (const reference of this._backreferences) { const ref = reference.ref; const group = typeof ref === "number" ? this._capturingGroups[ref - 1] : this._capturingGroups.find(g => g.name === ref); reference.resolved = group; group.references.push(reference); } } onAlternativeEnter(start) { const parent = this._node; if (parent.type !== "Assertion" && parent.type !== "CapturingGroup" && parent.type !== "Group" && parent.type !== "Pattern") { throw new Error("UnknownError"); } this._node = { type: "Alternative", parent, start, end: start, raw: "", elements: [], }; parent.alternatives.push(this._node); } onAlternativeLeave(start, end) { const node = this._node; if (node.type !== "Alternative") { throw new Error("UnknownError"); } node.end = end; node.raw = this.source.slice(start, end); this._node = node.parent; } onGroupEnter(start) { const parent = this._node; if (parent.type !== "Alternative") { throw new Error("UnknownError"); } this._node = { type: "Group", parent, start, end: start, raw: "", alternatives: [], }; parent.elements.push(this._node); } onGroupLeave(start, end) { const node = this._node; if (node.type !== "Group" || node.parent.type !== "Alternative") { throw new Error("UnknownError"); } node.end = end; node.raw = this.source.slice(start, end); this._node = node.parent; } onCapturingGroupEnter(start, name) { const parent = this._node; if (parent.type !== "Alternative") { throw new Error("UnknownError"); } this._node = { type: "CapturingGroup", parent, start, end: start, raw: "", name, alternatives: [], references: [], }; parent.elements.push(this._node); this._capturingGroups.push(this._node); } onCapturingGroupLeave(start, end) { const node = this._node; if (node.type !== "CapturingGroup" || node.parent.type !== "Alternative") { throw new Error("UnknownError"); } node.end = end; node.raw = this.source.slice(start, end); this._node = node.parent; } onQuantifier(start, end, min, max, greedy) { const parent = this._node; if (parent.type !== "Alternative") { throw new Error("UnknownError"); } const element = parent.elements.pop(); if (element == null || element.type === "Quantifier" || (element.type === "Assertion" && element.kind !== "lookahead")) { throw new Error("UnknownError"); } const node = { type: "Quantifier", parent, start: element.start, end, raw: this.source.slice(element.start, end), min, max, greedy, element, }; parent.elements.push(node); element.parent = node; } onLookaroundAssertionEnter(start, kind, negate) { const parent = this._node; if (parent.type !== "Alternative") { throw new Error("UnknownError"); } const node = (this._node = { type: "Assertion", parent, start, end: start, raw: "", kind, negate, alternatives: [], }); parent.elements.push(node); } onLookaroundAssertionLeave(start, end) { const node = this._node; if (node.type !== "Assertion" || node.parent.type !== "Alternative") { throw new Error("UnknownError"); } node.end = end; node.raw = this.source.slice(start, end); this._node = node.parent; } onEdgeAssertion(start, end, kind) { const parent = this._node; if (parent.type !== "Alternative") { throw new Error("UnknownError"); } parent.elements.push({ type: "Assertion", parent, start, end, raw: this.source.slice(start, end), kind, }); } onWordBoundaryAssertion(start, end, kind, negate) { const parent = this._node; if (parent.type !== "Alternative") { throw new Error("UnknownError"); } parent.elements.push({ type: "Assertion", parent, start, end, raw: this.source.slice(start, end), kind, negate, }); } onAnyCharacterSet(start, end, kind) { const parent = this._node; if (parent.type !== "Alternative") { throw new Error("UnknownError"); } parent.elements.push({ type: "CharacterSet", parent, start, end, raw: this.source.slice(start, end), kind, }); } onEscapeCharacterSet(start, end, kind, negate) { const parent = this._node; if (parent.type !== "Alternative" && parent.type !== "CharacterClass") { throw new Error("UnknownError"); } parent.elements.push({ type: "CharacterSet", parent, start, end, raw: this.source.slice(start, end), kind, negate, }); } onUnicodePropertyCharacterSet(start, end, kind, key, value, negate) { const parent = this._node; if (parent.type !== "Alternative" && parent.type !== "CharacterClass") { throw new Error("UnknownError"); } parent.elements.push({ type: "CharacterSet", parent, start, end, raw: this.source.slice(start, end), kind, key, value, negate, }); } onCharacter(start, end, value) { const parent = this._node; if (parent.type !== "Alternative" && parent.type !== "CharacterClass") { throw new Error("UnknownError"); } parent.elements.push({ type: "Character", parent, start, end, raw: this.source.slice(start, end), value, }); } onBackreference(start, end, ref) { const parent = this._node; if (parent.type !== "Alternative") { throw new Error("UnknownError"); } const node = { type: "Backreference", parent, start, end, raw: this.source.slice(start, end), ref, resolved: DummyCapturingGroup, }; parent.elements.push(node); this._backreferences.push(node); } onCharacterClassEnter(start, negate) { const parent = this._node; if (parent.type !== "Alternative") { throw new Error("UnknownError"); } this._node = { type: "CharacterClass", parent, start, end: start, raw: "", negate, elements: [], }; parent.elements.push(this._node); } onCharacterClassLeave(start, end) { const node = this._node; if (node.type !== "CharacterClass" || node.parent.type !== "Alternative") { throw new Error("UnknownError"); } node.end = end; node.raw = this.source.slice(start, end); this._node = node.parent; } onCharacterClassRange(start, end) { const parent = this._node; if (parent.type !== "CharacterClass") { throw new Error("UnknownError"); } const elements = parent.elements; const max = elements.pop(); const hyphen = elements.pop(); const min = elements.pop(); if (!min || !max || !hyphen || min.type !== "Character" || max.type !== "Character" || hyphen.type !== "Character" || hyphen.value !== HyphenMinus) { throw new Error("UnknownError"); } const node = { type: "CharacterClassRange", parent, start, end, raw: this.source.slice(start, end), min, max, }; min.parent = node; max.parent = node; elements.push(node); } } class RegExpParser { constructor(options) { this._state = new RegExpParserState(options); this._validator = new RegExpValidator(this._state); } parseLiteral(source, start = 0, end = source.length) { this._state.source = source; this._validator.validateLiteral(source, start, end); const pattern = this._state.pattern; const flags = this._state.flags; const literal = { type: "RegExpLiteral", parent: null, start, end, raw: source, pattern, flags, }; pattern.parent = literal; flags.parent = literal; return literal; } parseFlags(source, start = 0, end = source.length) { this._state.source = source; this._validator.validateFlags(source, start, end); return this._state.flags; } parsePattern(source, start = 0, end = source.length, uFlag = false) { this._state.source = source; this._validator.validatePattern(source, start, end, uFlag); return this._state.pattern; } } class RegExpVisitor { constructor(handlers) { this._handlers = handlers; } visit(node) { this.visitWithParents(node, []); } visitWithParents(node, parents) { switch (node.type) { case "Alternative": this.visitAlternative(node, parents); break; case "Assertion": this.visitAssertion(node, parents); break; case "Backreference": this.visitBackreference(node, parents); break; case "CapturingGroup": this.visitCapturingGroup(node, parents); break; case "Character": this.visitCharacter(node, parents); break; case "CharacterClass": this.visitCharacterClass(node, parents); break; case "CharacterClassRange": this.visitCharacterClassRange(node, parents); break; case "CharacterSet": this.visitCharacterSet(node, parents); break; case "Flags": this.visitFlags(node, parents); break; case "Group": this.visitGroup(node, parents); break; case "Pattern": this.visitPattern(node, parents); break; case "Quantifier": this.visitQuantifier(node, parents); break; case "RegExpLiteral": this.visitRegExpLiteral(node, parents); break; default: throw new Error(`Unknown type: ${node.type}`); } } visitAlternative(node, parents) { if (this._handlers.onAlternativeEnter) { this._handlers.onAlternativeEnter(node, parents); } parents.push(node); for (const child of node.elements) { this.visitWithParents(child, parents); } parents.pop(); if (this._handlers.onAlternativeLeave) { this._handlers.onAlternativeLeave(node, parents); } } visitAssertion(node, parents) { if (this._handlers.onAssertionEnter) { this._handlers.onAssertionEnter(node, parents); } if (node.kind === "lookahead" || node.kind === "lookbehind") { parents.push(node); for (const child of node.alternatives) { this.visitWithParents(child, parents); } parents.pop(); } if (this._handlers.onAssertionLeave) { this._handlers.onAssertionLeave(node, parents); } } visitBackreference(node, parents) { if (this._handlers.onBackreferenceEnter) { this._handlers.onBackreferenceEnter(node, parents); } if (this._handlers.onBackreferenceLeave) { this._handlers.onBackreferenceLeave(node, parents); } } visitCapturingGroup(node, parents) { if (this._handlers.onCapturingGroupEnter) { this._handlers.onCapturingGroupEnter(node, parents); } parents.push(node); for (const child of node.alternatives) { this.visitWithParents(child, parents); } parents.pop(); if (this._handlers.onCapturingGroupLeave) { this._handlers.onCapturingGroupLeave(node, parents); } } visitCharacter(node, parents) { if (this._handlers.onCharacterEnter) { this._handlers.onCharacterEnter(node, parents); } if (this._handlers.onCharacterLeave) { this._handlers.onCharacterLeave(node, parents); } } visitCharacterClass(node, parents) { if (this._handlers.onCharacterClassEnter) { this._handlers.onCharacterClassEnter(node, parents); } parents.push(node); for (const child of node.elements) { this.visitWithParents(child, parents); } parents.pop(); if (this._handlers.onCharacterClassLeave) { this._handlers.onCharacterClassLeave(node, parents); } } visitCharacterClassRange(node, parents) { if (this._handlers.onCharacterClassRangeEnter) { this._handlers.onCharacterClassRangeEnter(node, parents); } parents.push(node); this.visitCharacter(node.min, parents); this.visitCharacter(node.max, parents); parents.pop(); if (this._handlers.onCharacterClassRangeLeave) { this._handlers.onCharacterClassRangeLeave(node, parents); } } visitCharacterSet(node, parents) { if (this._handlers.onCharacterSetEnter) { this._handlers.onCharacterSetEnter(node, parents); } if (this._handlers.onCharacterSetLeave) { this._handlers.onCharacterSetLeave(node, parents); } } visitFlags(node, parents) { if (this._handlers.onFlagsEnter) { this._handlers.onFlagsEnter(node, parents); } if (this._handlers.onFlagsLeave) { this._handlers.onFlagsLeave(node, parents); } } visitGroup(node, parents) { if (this._handlers.onGroupEnter) { this._handlers.onGroupEnter(node, parents); } parents.push(node); for (const child of node.alternatives) { this.visitWithParents(child, parents); } parents.pop(); if (this._handlers.onGroupLeave) { this._handlers.onGroupLeave(node, parents); } } visitPattern(node, parents) { if (this._handlers.onPatternEnter) { this._handlers.onPatternEnter(node, parents); } parents.push(node); for (const child of node.alternatives) { this.visitWithParents(child, parents); } parents.pop(); if (this._handlers.onPatternLeave) { this._handlers.onPatternLeave(node, parents); } } visitQuantifier(node, parents) { if (this._handlers.onQuantifierEnter) { this._handlers.onQuantifierEnter(node, parents); } parents.push(node); this.visitWithParents(node.element, parents); parents.pop(); if (this._handlers.onQuantifierLeave) { this._handlers.onQuantifierLeave(node, parents); } } visitRegExpLiteral(node, parents) { if (this._handlers.onRegExpLiteralEnter) { this._handlers.onRegExpLiteralEnter(node, parents); } parents.push(node); this.visitWithParents(node.pattern, parents); this.visitWithParents(node.flags, parents); parents.pop(); if (this._handlers.onRegExpLiteralLeave) { this._handlers.onRegExpLiteralLeave(node, parents); } } } function parseRegExpLiteral(source, options) { return new RegExpParser(options).parseLiteral(String(source)); } function validateRegExpLiteral(source, options) { return new RegExpValidator(options).validateLiteral(source); } function visitRegExpAST(node, handlers) { new RegExpVisitor(handlers).visit(node); } exports.AST = ast; exports.RegExpParser = RegExpParser; exports.RegExpValidator = RegExpValidator; exports.RegExpVisitor = RegExpVisitor; exports.parseRegExpLiteral = parseRegExpLiteral; exports.validateRegExpLiteral = validateRegExpLiteral; exports.visitRegExpAST = visitRegExpAST;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/vscode-regexpp/index.js.map /*! @author Toru Nagashima */ var ast = /*#__PURE__*/Object.freeze({ __proto__: null }); let largeIdStartRanges = undefined; let largeIdContinueRanges = undefined; function isIdStart(cp) { if (cp < 0x41) return false; if (cp < 0x5b) return true; if (cp < 0x61) return false; if (cp < 0x7b) return true; return isLargeIdStart(cp); } function isIdContinue(cp) { if (cp < 0x30) return false; if (cp < 0x3a) return true; if (cp < 0x41) return false; if (cp < 0x5b) return true; if (cp === 0x5f) return true; if (cp < 0x61) return false; if (cp < 0x7b) return true; return isLargeIdStart(cp) || isLargeIdContinue(cp); } function isLargeIdStart(cp) { return isInRange(cp, largeIdStartRanges || (largeIdStartRanges = initLargeIdStartRanges())); } function isLargeIdContinue(cp) { return isInRange(cp, largeIdContinueRanges || (largeIdContinueRanges = initLargeIdContinueRanges())); } function initLargeIdStartRanges() { return restoreRanges("4q 0 b 0 5 0 6 m 2 u 2 cp 5 b f 4 8 0 2 0 3m 4 2 1 3 3 2 0 7 0 2 2 2 0 2 j 2 2a 2 3u 9 4l 2 11 3 0 7 14 20 q 5 3 1a 16 10 1 2 2q 2 0 g 1 8 1 b 2 3 0 h 0 2 t u 2g c 0 p w a 1 5 0 6 l 5 0 a 0 4 0 o o 8 a 1i k 2 h 1p 1h 4 0 j 0 8 9 g f 5 7 3 1 3 l 2 6 2 0 4 3 4 0 h 0 e 1 2 2 f 1 b 0 9 5 5 1 3 l 2 6 2 1 2 1 2 1 w 3 2 0 k 2 h 8 2 2 2 l 2 6 2 1 2 4 4 0 j 0 g 1 o 0 c 7 3 1 3 l 2 6 2 1 2 4 4 0 v 1 2 2 g 0 i 0 2 5 4 2 2 3 4 1 2 0 2 1 4 1 4 2 4 b n 0 1h 7 2 2 2 m 2 f 4 0 r 2 6 1 v 0 5 7 2 2 2 m 2 9 2 4 4 0 x 0 2 1 g 1 i 8 2 2 2 14 3 0 h 0 6 2 9 2 p 5 6 h 4 n 2 8 2 0 3 6 1n 1b 2 1 d 6 1n 1 2 0 2 4 2 n 2 0 2 9 2 1 a 0 3 4 2 0 m 3 x 0 1s 7 2 z s 4 38 16 l 0 h 5 5 3 4 0 4 1 8 2 5 c d 0 i 11 2 0 6 0 3 16 2 98 2 3 3 6 2 0 2 3 3 14 2 3 3 w 2 3 3 6 2 0 2 3 3 e 2 1k 2 3 3 1u 12 f h 2d 3 5 4 h7 3 g 2 p 6 22 4 a 8 c 2 3 f h f h f c 2 2 g 1f 10 0 5 0 1w 2g 8 14 2 0 6 1x b u 1e t 3 4 c 17 5 p 1j m a 1g 2b 0 2m 1a i 6 1k t e 1 b 17 r z 16 2 b z 3 8 8 16 3 2 16 3 2 5 2 1 4 0 6 5b 1t 7p 3 5 3 11 3 5 3 7 2 0 2 0 2 0 2 u 3 1g 2 6 2 0 4 2 2 6 4 3 3 5 5 c 6 2 2 6 39 0 e 0 h c 2u 0 5 0 3 9 2 0 3 5 7 0 2 0 2 0 2 f 3 3 6 4 5 0 i 14 22g 1a 2 1a 2 3o 7 3 4 1 d 11 2 0 6 0 3 1j 8 0 h m a 6 2 6 2 6 2 6 2 6 2 6 2 6 2 6 fb 2 q 8 8 4 3 4 5 2d 5 4 2 2h 2 3 6 16 2 2l i v 1d f e9 533 1t g70 4 wc 1w 19 3 7g 4 f b 1 l 1a h u 3 27 14 8 3 2u 3 1g 3 8 17 c 2 2 2 3 2 m u 1f f 1d 1r 5 4 0 2 1 c r b m q s 8 1a t 0 h 4 2 9 b 4 2 14 o 2 2 7 l m 4 0 4 1d 2 0 4 1 3 4 3 0 2 0 p 2 3 a 8 2 d 5 3 5 3 5 a 6 2 6 2 16 2 d 7 36 u 8mb d m 5 1c 6it a5 3 2x 13 6 d 4 6 0 2 9 2 c 2 4 2 0 2 1 2 1 2 2z y a2 j 1r 3 1h 15 b 39 4 2 3q 11 p 7 p c 2g 4 5 3 5 3 5 3 2 10 b 2 p 2 i 2 1 2 e 3 d z 3e 1y 1g 7g s 4 1c 1c v e t 6 11 b t 3 z 5 7 2 4 17 4d j z 5 z 5 13 9 1f 4d 8m a l b 7 49 5 3 0 2 17 2 1 4 0 3 m b m a u 1u i 2 1 b l b p 1z 1j 7 1 1t 0 g 3 2 2 2 s 17 s 4 s 10 7 2 r s 1h b l b i e h 33 20 1k 1e e 1e e z 9p 15 7 1 27 s b 0 9 l 2z k s m d 1g 24 18 x o r z u 0 3 0 9 y 4 0 d 1b f 3 m 0 2 0 10 h 2 o 2d 6 2 0 2 3 2 e 2 9 8 1a 13 7 3 1 3 l 2 6 2 1 2 4 4 0 j 0 d 4 4f 1g j 3 l 2 v 1b l 1 2 0 55 1a 16 3 11 1b l 0 1o 16 e 0 20 q 6e 17 39 1r w 7 3 0 3 7 2 1 2 n g 0 2 0 2n 7 3 12 h 0 2 0 t 0 b 13 8 0 m 0 c 19 k 0 z 1k 7c 8 2 10 i 0 1e t 35 6 2 1 2 11 m 0 q 5 2 1 2 v f 0 94 i 5a 0 28 pl 2v 32 i 5f 24d tq 34i g6 6nu fs 8 u 36 t j 1b h 3 w k 6 i j5 1r 3l 22 6 0 1v c 1t 1 2 0 t 4qf 9 yd 17 8 6wo 7y 1e 2 i 3 9 az 1s5 2y 6 c 4 8 8 9 4mf 2c 2 1y 2 1 3 0 3 1 3 3 2 b 2 0 2 6 2 1s 2 3 3 7 2 6 2 r 2 3 2 4 2 0 4 6 2 9f 3 o 2 o 2 u 2 o 2 u 2 o 2 u 2 o 2 u 2 o 2 7 1th 18 b 6 h 0 aa 17 105 5g 1o 1v 8 0 xh 3 2 q 2 1 2 0 3 0 2 9 2 3 2 0 2 0 7 0 5 0 2 0 2 0 2 2 2 1 2 0 3 0 2 0 2 0 2 0 2 0 2 1 2 0 3 3 2 6 2 3 2 3 2 0 2 9 2 g 6 2 2 4 2 g 3et wyl z 378 c 65 3 4g1 f 5rk 2e8 f1 15v 3t6"); } function initLargeIdContinueRanges() { return restoreRanges("53 0 g9 33 o 0 70 4 7e 18 2 0 2 1 2 1 2 0 21 a 1d u 7 0 2u 6 3 5 3 1 2 3 3 9 o 0 v q 2k a g 9 y 8 a 0 p 3 2 8 2 2 2 4 18 2 3c e 2 w 1j 2 2 h 2 6 b 1 3 9 i 2 1l 0 2 6 3 1 3 2 a 0 b 1 3 9 f 0 3 2 1l 0 2 4 5 1 3 2 4 0 l b 4 0 c 2 1l 0 2 7 2 2 2 2 l 1 3 9 b 5 2 2 1l 0 2 6 3 1 3 2 8 2 b 1 3 9 j 0 1o 4 4 2 2 3 a 0 f 9 h 4 1m 6 2 2 2 3 8 1 c 1 3 9 i 2 1l 0 2 6 2 2 2 3 8 1 c 1 3 9 h 3 1k 1 2 6 2 2 2 3 a 0 b 1 3 9 i 2 1z 0 5 5 2 0 2 7 7 9 3 1 1q 0 3 6 d 7 2 9 2g 0 3 8 c 5 3 9 1r 1 7 9 c 0 2 0 2 0 5 1 1e j 2 1 6 a 2 z a 0 2t j 2 9 d 3 5 2 2 2 3 6 4 3 e b 2 e jk 2 a 8 pt 2 u 2 u 1 v 1 1t v a 0 3 9 y 2 3 9 40 0 3b b 5 b b 9 3l a 1p 4 1m 9 2 s 3 a 7 9 n d 2 1 1s 4 1c g c 9 i 8 d 2 v c 3 9 19 d 1d j 9 9 7 9 3b 2 2 k 5 0 7 0 3 2 5j 1l 2 4 g0 1 k 0 3g c 5 0 4 b 2db 2 3y 0 2p v ff 5 2y 1 n7q 9 1y 0 5 9 x 1 29 1 7l 0 4 0 5 0 o 4 5 0 2c 1 1f h b 9 7 h e a t 7 q c 19 3 1c d g 9 c 0 b 9 1c d d 0 9 1 3 9 y 2 1f 0 2 2 3 1 6 1 2 0 16 4 6 1 6l 7 2 1 3 9 fmt 0 ki f h f 4 1 p 2 5d 9 12 0 ji 0 6b 0 46 4 86 9 120 2 2 1 6 3 15 2 5 0 4m 1 fy 3 9 9 aa 1 4a a 4w 2 1i e w 9 g 3 1a a 1i 9 7 2 11 d 2 9 6 1 19 0 d 2 1d d 9 3 2 b 2b b 7 0 4h b 6 9 7 3 1k 1 2 6 3 1 3 2 a 0 b 1 3 6 4 4 5d h a 9 5 0 2a j d 9 5y 6 3 8 s 1 2b g g 9 2a c 9 9 2c e 5 9 6r e 4m 9 1z 5 2 1 3 3 2 0 2 1 d 9 3c 6 3 6 4 0 t 9 15 6 2 3 9 0 a a 1b f ba 7 2 7 h 9 1l l 2 d 3f 5 4 0 2 1 2 6 2 0 9 9 1d 4 2 1 2 4 9 9 96 3 ewa 9 3r 4 1o 6 q 9 s6 0 2 1i 8 3 2a 0 c 1 f58 1 43r 4 4 5 9 7 3 6 v 3 45 2 13e 1d e9 1i 5 1d 9 0 f 0 n 4 2 e 11t 6 2 g 3 6 2 1 2 4 7a 6 a 9 bn d 15j 6 32 6 6 9 3o7 9 gvt3 6n"); } function isInRange(cp, ranges) { let l = 0, r = (ranges.length / 2) | 0, i = 0, min = 0, max = 0; while (l < r) { i = ((l + r) / 2) | 0; min = ranges[2 * i]; max = ranges[2 * i + 1]; if (cp < min) { r = i; } else if (cp > max) { l = i + 1; } else { return true; } } return false; } function restoreRanges(data) { let last = 0; return data.split(" ").map(s => (last += parseInt(s, 36) | 0)); } class DataSet { constructor(raw2018, raw2019, raw2020, raw2021) { this._raw2018 = raw2018; this._raw2019 = raw2019; this._raw2020 = raw2020; this._raw2021 = raw2021; } get es2018() { return (this._set2018 || (this._set2018 = new Set(this._raw2018.split(" ")))); } get es2019() { return (this._set2019 || (this._set2019 = new Set(this._raw2019.split(" ")))); } get es2020() { return (this._set2020 || (this._set2020 = new Set(this._raw2020.split(" ")))); } get es2021() { return (this._set2021 || (this._set2021 = new Set(this._raw2021.split(" ")))); } } const gcNameSet = new Set(["General_Category", "gc"]); const scNameSet = new Set(["Script", "Script_Extensions", "sc", "scx"]); const gcValueSets = new DataSet("C Cased_Letter Cc Cf Close_Punctuation Cn Co Combining_Mark Connector_Punctuation Control Cs Currency_Symbol Dash_Punctuation Decimal_Number Enclosing_Mark Final_Punctuation Format Initial_Punctuation L LC Letter Letter_Number Line_Separator Ll Lm Lo Lowercase_Letter Lt Lu M Mark Math_Symbol Mc Me Mn Modifier_Letter Modifier_Symbol N Nd Nl No Nonspacing_Mark Number Open_Punctuation Other Other_Letter Other_Number Other_Punctuation Other_Symbol P Paragraph_Separator Pc Pd Pe Pf Pi Po Private_Use Ps Punctuation S Sc Separator Sk Sm So Space_Separator Spacing_Mark Surrogate Symbol Titlecase_Letter Unassigned Uppercase_Letter Z Zl Zp Zs cntrl digit punct", "", "", ""); const scValueSets = new DataSet("Adlam Adlm Aghb Ahom Anatolian_Hieroglyphs Arab Arabic Armenian Armi Armn Avestan Avst Bali Balinese Bamu Bamum Bass Bassa_Vah Batak Batk Beng Bengali Bhaiksuki Bhks Bopo Bopomofo Brah Brahmi Brai Braille Bugi Buginese Buhd Buhid Cakm Canadian_Aboriginal Cans Cari Carian Caucasian_Albanian Chakma Cham Cher Cherokee Common Copt Coptic Cprt Cuneiform Cypriot Cyrillic Cyrl Deseret Deva Devanagari Dsrt Dupl Duployan Egyp Egyptian_Hieroglyphs Elba Elbasan Ethi Ethiopic Geor Georgian Glag Glagolitic Gonm Goth Gothic Gran Grantha Greek Grek Gujarati Gujr Gurmukhi Guru Han Hang Hangul Hani Hano Hanunoo Hatr Hatran Hebr Hebrew Hira Hiragana Hluw Hmng Hung Imperial_Aramaic Inherited Inscriptional_Pahlavi Inscriptional_Parthian Ital Java Javanese Kaithi Kali Kana Kannada Katakana Kayah_Li Khar Kharoshthi Khmer Khmr Khoj Khojki Khudawadi Knda Kthi Lana Lao Laoo Latin Latn Lepc Lepcha Limb Limbu Lina Linb Linear_A Linear_B Lisu Lyci Lycian Lydi Lydian Mahajani Mahj Malayalam Mand Mandaic Mani Manichaean Marc Marchen Masaram_Gondi Meetei_Mayek Mend Mende_Kikakui Merc Mero Meroitic_Cursive Meroitic_Hieroglyphs Miao Mlym Modi Mong Mongolian Mro Mroo Mtei Mult Multani Myanmar Mymr Nabataean Narb Nbat New_Tai_Lue Newa Nko Nkoo Nshu Nushu Ogam Ogham Ol_Chiki Olck Old_Hungarian Old_Italic Old_North_Arabian Old_Permic Old_Persian Old_South_Arabian Old_Turkic Oriya Orkh Orya Osage Osge Osma Osmanya Pahawh_Hmong Palm Palmyrene Pau_Cin_Hau Pauc Perm Phag Phags_Pa Phli Phlp Phnx Phoenician Plrd Prti Psalter_Pahlavi Qaac Qaai Rejang Rjng Runic Runr Samaritan Samr Sarb Saur Saurashtra Sgnw Sharada Shavian Shaw Shrd Sidd Siddham SignWriting Sind Sinh Sinhala Sora Sora_Sompeng Soyo Soyombo Sund Sundanese Sylo Syloti_Nagri Syrc Syriac Tagalog Tagb Tagbanwa Tai_Le Tai_Tham Tai_Viet Takr Takri Tale Talu Tamil Taml Tang Tangut Tavt Telu Telugu Tfng Tglg Thaa Thaana Thai Tibetan Tibt Tifinagh Tirh Tirhuta Ugar Ugaritic Vai Vaii Wara Warang_Citi Xpeo Xsux Yi Yiii Zanabazar_Square Zanb Zinh Zyyy", "Dogr Dogra Gong Gunjala_Gondi Hanifi_Rohingya Maka Makasar Medefaidrin Medf Old_Sogdian Rohg Sogd Sogdian Sogo", "Elym Elymaic Hmnp Nand Nandinagari Nyiakeng_Puachue_Hmong Wancho Wcho", "Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi"); const binPropertySets = new DataSet("AHex ASCII ASCII_Hex_Digit Alpha Alphabetic Any Assigned Bidi_C Bidi_Control Bidi_M Bidi_Mirrored CI CWCF CWCM CWKCF CWL CWT CWU Case_Ignorable Cased Changes_When_Casefolded Changes_When_Casemapped Changes_When_Lowercased Changes_When_NFKC_Casefolded Changes_When_Titlecased Changes_When_Uppercased DI Dash Default_Ignorable_Code_Point Dep Deprecated Dia Diacritic Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Ext Extender Gr_Base Gr_Ext Grapheme_Base Grapheme_Extend Hex Hex_Digit IDC IDS IDSB IDST IDS_Binary_Operator IDS_Trinary_Operator ID_Continue ID_Start Ideo Ideographic Join_C Join_Control LOE Logical_Order_Exception Lower Lowercase Math NChar Noncharacter_Code_Point Pat_Syn Pat_WS Pattern_Syntax Pattern_White_Space QMark Quotation_Mark RI Radical Regional_Indicator SD STerm Sentence_Terminal Soft_Dotted Term Terminal_Punctuation UIdeo Unified_Ideograph Upper Uppercase VS Variation_Selector White_Space XIDC XIDS XID_Continue XID_Start space", "Extended_Pictographic", "", "EBase EComp EMod EPres ExtPict"); function isValidUnicodeProperty(version, name, value) { if (gcNameSet.has(name)) { return version >= 2018 && gcValueSets.es2018.has(value); } if (scNameSet.has(name)) { return ((version >= 2018 && scValueSets.es2018.has(value)) || (version >= 2019 && scValueSets.es2019.has(value)) || (version >= 2020 && scValueSets.es2020.has(value)) || (version >= 2021 && scValueSets.es2021.has(value))); } return false; } function isValidLoneUnicodeProperty(version, value) { return ((version >= 2018 && binPropertySets.es2018.has(value)) || (version >= 2019 && binPropertySets.es2019.has(value)) || (version >= 2021 && binPropertySets.es2021.has(value))); } const Backspace = 0x08; const CharacterTabulation = 0x09; const LineFeed = 0x0a; const LineTabulation = 0x0b; const FormFeed = 0x0c; const CarriageReturn = 0x0d; const ExclamationMark = 0x21; const DollarSign = 0x24; const LeftParenthesis = 0x28; const RightParenthesis = 0x29; const Asterisk = 0x2a; const PlusSign = 0x2b; const Comma = 0x2c; const HyphenMinus = 0x2d; const FullStop = 0x2e; const Solidus = 0x2f; const DigitZero = 0x30; const DigitOne = 0x31; const DigitSeven = 0x37; const DigitNine = 0x39; const Colon = 0x3a; const LessThanSign = 0x3c; const EqualsSign = 0x3d; const GreaterThanSign = 0x3e; const QuestionMark = 0x3f; const LatinCapitalLetterA = 0x41; const LatinCapitalLetterB = 0x42; const LatinCapitalLetterD = 0x44; const LatinCapitalLetterF = 0x46; const LatinCapitalLetterP = 0x50; const LatinCapitalLetterS = 0x53; const LatinCapitalLetterW = 0x57; const LatinCapitalLetterZ = 0x5a; const LowLine = 0x5f; const LatinSmallLetterA = 0x61; const LatinSmallLetterB = 0x62; const LatinSmallLetterC = 0x63; const LatinSmallLetterD = 0x64; const LatinSmallLetterF = 0x66; const LatinSmallLetterG = 0x67; const LatinSmallLetterI = 0x69; const LatinSmallLetterK = 0x6b; const LatinSmallLetterM = 0x6d; const LatinSmallLetterN = 0x6e; const LatinSmallLetterP = 0x70; const LatinSmallLetterR = 0x72; const LatinSmallLetterS = 0x73; const LatinSmallLetterT = 0x74; const LatinSmallLetterU = 0x75; const LatinSmallLetterV = 0x76; const LatinSmallLetterW = 0x77; const LatinSmallLetterX = 0x78; const LatinSmallLetterY = 0x79; const LatinSmallLetterZ = 0x7a; const LeftSquareBracket = 0x5b; const ReverseSolidus = 0x5c; const RightSquareBracket = 0x5d; const CircumflexAccent = 0x5e; const LeftCurlyBracket = 0x7b; const VerticalLine = 0x7c; const RightCurlyBracket = 0x7d; const ZeroWidthNonJoiner = 0x200c; const ZeroWidthJoiner = 0x200d; const LineSeparator = 0x2028; const ParagraphSeparator = 0x2029; const MinCodePoint = 0x00; const MaxCodePoint = 0x10ffff; function isLatinLetter(code) { return ((code >= LatinCapitalLetterA && code <= LatinCapitalLetterZ) || (code >= LatinSmallLetterA && code <= LatinSmallLetterZ)); } function isDecimalDigit(code) { return code >= DigitZero && code <= DigitNine; } function isOctalDigit(code) { return code >= DigitZero && code <= DigitSeven; } function isHexDigit(code) { return ((code >= DigitZero && code <= DigitNine) || (code >= LatinCapitalLetterA && code <= LatinCapitalLetterF) || (code >= LatinSmallLetterA && code <= LatinSmallLetterF)); } function isLineTerminator(code) { return (code === LineFeed || code === CarriageReturn || code === LineSeparator || code === ParagraphSeparator); } function isValidUnicode(code) { return code >= MinCodePoint && code <= MaxCodePoint; } function digitToInt(code) { if (code >= LatinSmallLetterA && code <= LatinSmallLetterF) { return code - LatinSmallLetterA + 10; } if (code >= LatinCapitalLetterA && code <= LatinCapitalLetterF) { return code - LatinCapitalLetterA + 10; } return code - DigitZero; } function isLeadSurrogate(code) { return code >= 0xd800 && code <= 0xdbff; } function isTrailSurrogate(code) { return code >= 0xdc00 && code <= 0xdfff; } function combineSurrogatePair(lead, trail) { return (lead - 0xd800) * 0x400 + (trail - 0xdc00) + 0x10000; } const legacyImpl = { at(s, end, i) { return i < end ? s.charCodeAt(i) : -1; }, width(c) { return 1; }, }; const unicodeImpl = { at(s, end, i) { return i < end ? s.codePointAt(i) : -1; }, width(c) { return c > 0xffff ? 2 : 1; }, }; class Reader { constructor() { this._impl = legacyImpl; this._s = ""; this._i = 0; this._end = 0; this._cp1 = -1; this._w1 = 1; this._cp2 = -1; this._w2 = 1; this._cp3 = -1; this._w3 = 1; this._cp4 = -1; } get source() { return this._s; } get index() { return this._i; } get currentCodePoint() { return this._cp1; } get nextCodePoint() { return this._cp2; } get nextCodePoint2() { return this._cp3; } get nextCodePoint3() { return this._cp4; } reset(source, start, end, uFlag) { this._impl = uFlag ? unicodeImpl : legacyImpl; this._s = source; this._end = end; this.rewind(start); } rewind(index) { const impl = this._impl; this._i = index; this._cp1 = impl.at(this._s, this._end, index); this._w1 = impl.width(this._cp1); this._cp2 = impl.at(this._s, this._end, index + this._w1); this._w2 = impl.width(this._cp2); this._cp3 = impl.at(this._s, this._end, index + this._w1 + this._w2); this._w3 = impl.width(this._cp3); this._cp4 = impl.at(this._s, this._end, index + this._w1 + this._w2 + this._w3); } advance() { if (this._cp1 !== -1) { const impl = this._impl; this._i += this._w1; this._cp1 = this._cp2; this._w1 = this._w2; this._cp2 = this._cp3; this._w2 = impl.width(this._cp2); this._cp3 = this._cp4; this._w3 = impl.width(this._cp3); this._cp4 = impl.at(this._s, this._end, this._i + this._w1 + this._w2 + this._w3); } } eat(cp) { if (this._cp1 === cp) { this.advance(); return true; } return false; } eat2(cp1, cp2) { if (this._cp1 === cp1 && this._cp2 === cp2) { this.advance(); this.advance(); return true; } return false; } eat3(cp1, cp2, cp3) { if (this._cp1 === cp1 && this._cp2 === cp2 && this._cp3 === cp3) { this.advance(); this.advance(); this.advance(); return true; } return false; } } class RegExpSyntaxError extends SyntaxError { constructor(source, uFlag, index, message) { if (source) { if (!source.startsWith("/")) { source = `/${source}/${uFlag ? "u" : ""}`; } source = `: ${source}`; } super(`Invalid regular expression${source}: ${message}`); this.index = index; } } function isSyntaxCharacter(cp) { return (cp === CircumflexAccent || cp === DollarSign || cp === ReverseSolidus || cp === FullStop || cp === Asterisk || cp === PlusSign || cp === QuestionMark || cp === LeftParenthesis || cp === RightParenthesis || cp === LeftSquareBracket || cp === RightSquareBracket || cp === LeftCurlyBracket || cp === RightCurlyBracket || cp === VerticalLine); } function isRegExpIdentifierStart(cp) { return isIdStart(cp) || cp === DollarSign || cp === LowLine; } function isRegExpIdentifierPart(cp) { return (isIdContinue(cp) || cp === DollarSign || cp === LowLine || cp === ZeroWidthNonJoiner || cp === ZeroWidthJoiner); } function isUnicodePropertyNameCharacter(cp) { return isLatinLetter(cp) || cp === LowLine; } function isUnicodePropertyValueCharacter(cp) { return isUnicodePropertyNameCharacter(cp) || isDecimalDigit(cp); } class RegExpValidator { constructor(options) { this._reader = new Reader(); this._uFlag = false; this._nFlag = false; this._lastIntValue = 0; this._lastMinValue = 0; this._lastMaxValue = 0; this._lastStrValue = ""; this._lastKeyValue = ""; this._lastValValue = ""; this._lastAssertionIsQuantifiable = false; this._numCapturingParens = 0; this._groupNames = new Set(); this._backreferenceNames = new Set(); this._options = options || {}; } validateLiteral(source, start = 0, end = source.length) { this._uFlag = this._nFlag = false; this.reset(source, start, end); this.onLiteralEnter(start); if (this.eat(Solidus) && this.eatRegExpBody() && this.eat(Solidus)) { const flagStart = this.index; const uFlag = source.includes("u", flagStart); this.validateFlags(source, flagStart, end); this.validatePattern(source, start + 1, flagStart - 1, uFlag); } else if (start >= end) { this.raise("Empty"); } else { const c = String.fromCodePoint(this.currentCodePoint); this.raise(`Unexpected character '${c}'`); } this.onLiteralLeave(start, end); } validateFlags(source, start = 0, end = source.length) { const existingFlags = new Set(); let global = false; let ignoreCase = false; let multiline = false; let sticky = false; let unicode = false; let dotAll = false; for (let i = start; i < end; ++i) { const flag = source.charCodeAt(i); if (existingFlags.has(flag)) { this.raise(`Duplicated flag '${source[i]}'`); } existingFlags.add(flag); if (flag === LatinSmallLetterG) { global = true; } else if (flag === LatinSmallLetterI) { ignoreCase = true; } else if (flag === LatinSmallLetterM) { multiline = true; } else if (flag === LatinSmallLetterU && this.ecmaVersion >= 2015) { unicode = true; } else if (flag === LatinSmallLetterY && this.ecmaVersion >= 2015) { sticky = true; } else if (flag === LatinSmallLetterS && this.ecmaVersion >= 2018) { dotAll = true; } else { this.raise(`Invalid flag '${source[i]}'`); } } this.onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll); } validatePattern(source, start = 0, end = source.length, uFlag = false) { this._uFlag = uFlag && this.ecmaVersion >= 2015; this._nFlag = uFlag && this.ecmaVersion >= 2018; this.reset(source, start, end); this.consumePattern(); if (!this._nFlag && this.ecmaVersion >= 2018 && this._groupNames.size > 0) { this._nFlag = true; this.rewind(start); this.consumePattern(); } } get strict() { return Boolean(this._options.strict || this._uFlag); } get ecmaVersion() { return this._options.ecmaVersion || 2020; } onLiteralEnter(start) { if (this._options.onLiteralEnter) { this._options.onLiteralEnter(start); } } onLiteralLeave(start, end) { if (this._options.onLiteralLeave) { this._options.onLiteralLeave(start, end); } } onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll) { if (this._options.onFlags) { this._options.onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll); } } onPatternEnter(start) { if (this._options.onPatternEnter) { this._options.onPatternEnter(start); } } onPatternLeave(start, end) { if (this._options.onPatternLeave) { this._options.onPatternLeave(start, end); } } onDisjunctionEnter(start) { if (this._options.onDisjunctionEnter) { this._options.onDisjunctionEnter(start); } } onDisjunctionLeave(start, end) { if (this._options.onDisjunctionLeave) { this._options.onDisjunctionLeave(start, end); } } onAlternativeEnter(start, index) { if (this._options.onAlternativeEnter) { this._options.onAlternativeEnter(start, index); } } onAlternativeLeave(start, end, index) { if (this._options.onAlternativeLeave) { this._options.onAlternativeLeave(start, end, index); } } onGroupEnter(start) { if (this._options.onGroupEnter) { this._options.onGroupEnter(start); } } onGroupLeave(start, end) { if (this._options.onGroupLeave) { this._options.onGroupLeave(start, end); } } onCapturingGroupEnter(start, name) { if (this._options.onCapturingGroupEnter) { this._options.onCapturingGroupEnter(start, name); } } onCapturingGroupLeave(start, end, name) { if (this._options.onCapturingGroupLeave) { this._options.onCapturingGroupLeave(start, end, name); } } onQuantifier(start, end, min, max, greedy) { if (this._options.onQuantifier) { this._options.onQuantifier(start, end, min, max, greedy); } } onLookaroundAssertionEnter(start, kind, negate) { if (this._options.onLookaroundAssertionEnter) { this._options.onLookaroundAssertionEnter(start, kind, negate); } } onLookaroundAssertionLeave(start, end, kind, negate) { if (this._options.onLookaroundAssertionLeave) { this._options.onLookaroundAssertionLeave(start, end, kind, negate); } } onEdgeAssertion(start, end, kind) { if (this._options.onEdgeAssertion) { this._options.onEdgeAssertion(start, end, kind); } } onWordBoundaryAssertion(start, end, kind, negate) { if (this._options.onWordBoundaryAssertion) { this._options.onWordBoundaryAssertion(start, end, kind, negate); } } onAnyCharacterSet(start, end, kind) { if (this._options.onAnyCharacterSet) { this._options.onAnyCharacterSet(start, end, kind); } } onEscapeCharacterSet(start, end, kind, negate) { if (this._options.onEscapeCharacterSet) { this._options.onEscapeCharacterSet(start, end, kind, negate); } } onUnicodePropertyCharacterSet(start, end, kind, key, value, negate) { if (this._options.onUnicodePropertyCharacterSet) { this._options.onUnicodePropertyCharacterSet(start, end, kind, key, value, negate); } } onCharacter(start, end, value) { if (this._options.onCharacter) { this._options.onCharacter(start, end, value); } } onBackreference(start, end, ref) { if (this._options.onBackreference) { this._options.onBackreference(start, end, ref); } } onCharacterClassEnter(start, negate) { if (this._options.onCharacterClassEnter) { this._options.onCharacterClassEnter(start, negate); } } onCharacterClassLeave(start, end, negate) { if (this._options.onCharacterClassLeave) { this._options.onCharacterClassLeave(start, end, negate); } } onCharacterClassRange(start, end, min, max) { if (this._options.onCharacterClassRange) { this._options.onCharacterClassRange(start, end, min, max); } } get source() { return this._reader.source; } get index() { return this._reader.index; } get currentCodePoint() { return this._reader.currentCodePoint; } get nextCodePoint() { return this._reader.nextCodePoint; } get nextCodePoint2() { return this._reader.nextCodePoint2; } get nextCodePoint3() { return this._reader.nextCodePoint3; } reset(source, start, end) { this._reader.reset(source, start, end, this._uFlag); } rewind(index) { this._reader.rewind(index); } advance() { this._reader.advance(); } eat(cp) { return this._reader.eat(cp); } eat2(cp1, cp2) { return this._reader.eat2(cp1, cp2); } eat3(cp1, cp2, cp3) { return this._reader.eat3(cp1, cp2, cp3); } raise(message) { throw new RegExpSyntaxError(this.source, this._uFlag, this.index, message); } eatRegExpBody() { const start = this.index; let inClass = false; let escaped = false; for (;;) { const cp = this.currentCodePoint; if (cp === -1 || isLineTerminator(cp)) { const kind = inClass ? "character class" : "regular expression"; this.raise(`Unterminated ${kind}`); } if (escaped) { escaped = false; } else if (cp === ReverseSolidus) { escaped = true; } else if (cp === LeftSquareBracket) { inClass = true; } else if (cp === RightSquareBracket) { inClass = false; } else if ((cp === Solidus && !inClass) || (cp === Asterisk && this.index === start)) { break; } this.advance(); } return this.index !== start; } consumePattern() { const start = this.index; this._numCapturingParens = this.countCapturingParens(); this._groupNames.clear(); this._backreferenceNames.clear(); this.onPatternEnter(start); this.consumeDisjunction(); const cp = this.currentCodePoint; if (this.currentCodePoint !== -1) { if (cp === RightParenthesis) { this.raise("Unmatched ')'"); } if (cp === ReverseSolidus) { this.raise("\\ at end of pattern"); } if (cp === RightSquareBracket || cp === RightCurlyBracket) { this.raise("Lone quantifier brackets"); } const c = String.fromCodePoint(cp); this.raise(`Unexpected character '${c}'`); } for (const name of this._backreferenceNames) { if (!this._groupNames.has(name)) { this.raise("Invalid named capture referenced"); } } this.onPatternLeave(start, this.index); } countCapturingParens() { const start = this.index; let inClass = false; let escaped = false; let count = 0; let cp = 0; while ((cp = this.currentCodePoint) !== -1) { if (escaped) { escaped = false; } else if (cp === ReverseSolidus) { escaped = true; } else if (cp === LeftSquareBracket) { inClass = true; } else if (cp === RightSquareBracket) { inClass = false; } else if (cp === LeftParenthesis && !inClass && (this.nextCodePoint !== QuestionMark || (this.nextCodePoint2 === LessThanSign && this.nextCodePoint3 !== EqualsSign && this.nextCodePoint3 !== ExclamationMark))) { count += 1; } this.advance(); } this.rewind(start); return count; } consumeDisjunction() { const start = this.index; let i = 0; this.onDisjunctionEnter(start); do { this.consumeAlternative(i++); } while (this.eat(VerticalLine)); if (this.consumeQuantifier(true)) { this.raise("Nothing to repeat"); } if (this.eat(LeftCurlyBracket)) { this.raise("Lone quantifier brackets"); } this.onDisjunctionLeave(start, this.index); } consumeAlternative(i) { const start = this.index; this.onAlternativeEnter(start, i); while (this.currentCodePoint !== -1 && this.consumeTerm()) { } this.onAlternativeLeave(start, this.index, i); } consumeTerm() { if (this._uFlag || this.strict) { return (this.consumeAssertion() || (this.consumeAtom() && this.consumeOptionalQuantifier())); } return ((this.consumeAssertion() && (!this._lastAssertionIsQuantifiable || this.consumeOptionalQuantifier())) || (this.consumeExtendedAtom() && this.consumeOptionalQuantifier())); } consumeOptionalQuantifier() { this.consumeQuantifier(); return true; } consumeAssertion() { const start = this.index; this._lastAssertionIsQuantifiable = false; if (this.eat(CircumflexAccent)) { this.onEdgeAssertion(start, this.index, "start"); return true; } if (this.eat(DollarSign)) { this.onEdgeAssertion(start, this.index, "end"); return true; } if (this.eat2(ReverseSolidus, LatinCapitalLetterB)) { this.onWordBoundaryAssertion(start, this.index, "word", true); return true; } if (this.eat2(ReverseSolidus, LatinSmallLetterB)) { this.onWordBoundaryAssertion(start, this.index, "word", false); return true; } if (this.eat2(LeftParenthesis, QuestionMark)) { const lookbehind = this.ecmaVersion >= 2018 && this.eat(LessThanSign); let negate = false; if (this.eat(EqualsSign) || (negate = this.eat(ExclamationMark))) { const kind = lookbehind ? "lookbehind" : "lookahead"; this.onLookaroundAssertionEnter(start, kind, negate); this.consumeDisjunction(); if (!this.eat(RightParenthesis)) { this.raise("Unterminated group"); } this._lastAssertionIsQuantifiable = !lookbehind && !this.strict; this.onLookaroundAssertionLeave(start, this.index, kind, negate); return true; } this.rewind(start); } return false; } consumeQuantifier(noConsume = false) { const start = this.index; let min = 0; let max = 0; let greedy = false; if (this.eat(Asterisk)) { min = 0; max = Number.POSITIVE_INFINITY; } else if (this.eat(PlusSign)) { min = 1; max = Number.POSITIVE_INFINITY; } else if (this.eat(QuestionMark)) { min = 0; max = 1; } else if (this.eatBracedQuantifier(noConsume)) { min = this._lastMinValue; max = this._lastMaxValue; } else { return false; } greedy = !this.eat(QuestionMark); if (!noConsume) { this.onQuantifier(start, this.index, min, max, greedy); } return true; } eatBracedQuantifier(noError) { const start = this.index; if (this.eat(LeftCurlyBracket)) { this._lastMinValue = 0; this._lastMaxValue = Number.POSITIVE_INFINITY; if (this.eatDecimalDigits()) { this._lastMinValue = this._lastMaxValue = this._lastIntValue; if (this.eat(Comma)) { this._lastMaxValue = this.eatDecimalDigits() ? this._lastIntValue : Number.POSITIVE_INFINITY; } if (this.eat(RightCurlyBracket)) { if (!noError && this._lastMaxValue < this._lastMinValue) { this.raise("numbers out of order in {} quantifier"); } return true; } } if (!noError && (this._uFlag || this.strict)) { this.raise("Incomplete quantifier"); } this.rewind(start); } return false; } consumeAtom() { return (this.consumePatternCharacter() || this.consumeDot() || this.consumeReverseSolidusAtomEscape() || this.consumeCharacterClass() || this.consumeUncapturingGroup() || this.consumeCapturingGroup()); } consumeDot() { if (this.eat(FullStop)) { this.onAnyCharacterSet(this.index - 1, this.index, "any"); return true; } return false; } consumeReverseSolidusAtomEscape() { const start = this.index; if (this.eat(ReverseSolidus)) { if (this.consumeAtomEscape()) { return true; } this.rewind(start); } return false; } consumeUncapturingGroup() { const start = this.index; if (this.eat3(LeftParenthesis, QuestionMark, Colon)) { this.onGroupEnter(start); this.consumeDisjunction(); if (!this.eat(RightParenthesis)) { this.raise("Unterminated group"); } this.onGroupLeave(start, this.index); return true; } return false; } consumeCapturingGroup() { const start = this.index; if (this.eat(LeftParenthesis)) { let name = null; if (this.ecmaVersion >= 2018) { if (this.consumeGroupSpecifier()) { name = this._lastStrValue; } } else if (this.currentCodePoint === QuestionMark) { this.raise("Invalid group"); } this.onCapturingGroupEnter(start, name); this.consumeDisjunction(); if (!this.eat(RightParenthesis)) { this.raise("Unterminated group"); } this.onCapturingGroupLeave(start, this.index, name); return true; } return false; } consumeExtendedAtom() { return (this.consumeDot() || this.consumeReverseSolidusAtomEscape() || this.consumeReverseSolidusFollowedByC() || this.consumeCharacterClass() || this.consumeUncapturingGroup() || this.consumeCapturingGroup() || this.consumeInvalidBracedQuantifier() || this.consumeExtendedPatternCharacter()); } consumeReverseSolidusFollowedByC() { const start = this.index; if (this.currentCodePoint === ReverseSolidus && this.nextCodePoint === LatinSmallLetterC) { this._lastIntValue = this.currentCodePoint; this.advance(); this.onCharacter(start, this.index, ReverseSolidus); return true; } return false; } consumeInvalidBracedQuantifier() { if (this.eatBracedQuantifier(true)) { this.raise("Nothing to repeat"); } return false; } consumePatternCharacter() { const start = this.index; const cp = this.currentCodePoint; if (cp !== -1 && !isSyntaxCharacter(cp)) { this.advance(); this.onCharacter(start, this.index, cp); return true; } return false; } consumeExtendedPatternCharacter() { const start = this.index; const cp = this.currentCodePoint; if (cp !== -1 && cp !== CircumflexAccent && cp !== DollarSign && cp !== ReverseSolidus && cp !== FullStop && cp !== Asterisk && cp !== PlusSign && cp !== QuestionMark && cp !== LeftParenthesis && cp !== RightParenthesis && cp !== LeftSquareBracket && cp !== VerticalLine) { this.advance(); this.onCharacter(start, this.index, cp); return true; } return false; } consumeGroupSpecifier() { if (this.eat(QuestionMark)) { if (this.eatGroupName()) { if (!this._groupNames.has(this._lastStrValue)) { this._groupNames.add(this._lastStrValue); return true; } this.raise("Duplicate capture group name"); } this.raise("Invalid group"); } return false; } consumeAtomEscape() { if (this.consumeBackreference() || this.consumeCharacterClassEscape() || this.consumeCharacterEscape() || (this._nFlag && this.consumeKGroupName())) { return true; } if (this.strict || this._uFlag) { this.raise("Invalid escape"); } return false; } consumeBackreference() { const start = this.index; if (this.eatDecimalEscape()) { const n = this._lastIntValue; if (n <= this._numCapturingParens) { this.onBackreference(start - 1, this.index, n); return true; } if (this.strict || this._uFlag) { this.raise("Invalid escape"); } this.rewind(start); } return false; } consumeCharacterClassEscape() { const start = this.index; if (this.eat(LatinSmallLetterD)) { this._lastIntValue = -1; this.onEscapeCharacterSet(start - 1, this.index, "digit", false); return true; } if (this.eat(LatinCapitalLetterD)) { this._lastIntValue = -1; this.onEscapeCharacterSet(start - 1, this.index, "digit", true); return true; } if (this.eat(LatinSmallLetterS)) { this._lastIntValue = -1; this.onEscapeCharacterSet(start - 1, this.index, "space", false); return true; } if (this.eat(LatinCapitalLetterS)) { this._lastIntValue = -1; this.onEscapeCharacterSet(start - 1, this.index, "space", true); return true; } if (this.eat(LatinSmallLetterW)) { this._lastIntValue = -1; this.onEscapeCharacterSet(start - 1, this.index, "word", false); return true; } if (this.eat(LatinCapitalLetterW)) { this._lastIntValue = -1; this.onEscapeCharacterSet(start - 1, this.index, "word", true); return true; } let negate = false; if (this._uFlag && this.ecmaVersion >= 2018 && (this.eat(LatinSmallLetterP) || (negate = this.eat(LatinCapitalLetterP)))) { this._lastIntValue = -1; if (this.eat(LeftCurlyBracket) && this.eatUnicodePropertyValueExpression() && this.eat(RightCurlyBracket)) { this.onUnicodePropertyCharacterSet(start - 1, this.index, "property", this._lastKeyValue, this._lastValValue || null, negate); return true; } this.raise("Invalid property name"); } return false; } consumeCharacterEscape() { const start = this.index; if (this.eatControlEscape() || this.eatCControlLetter() || this.eatZero() || this.eatHexEscapeSequence() || this.eatRegExpUnicodeEscapeSequence() || (!this.strict && !this._uFlag && this.eatLegacyOctalEscapeSequence()) || this.eatIdentityEscape()) { this.onCharacter(start - 1, this.index, this._lastIntValue); return true; } return false; } consumeKGroupName() { const start = this.index; if (this.eat(LatinSmallLetterK)) { if (this.eatGroupName()) { const groupName = this._lastStrValue; this._backreferenceNames.add(groupName); this.onBackreference(start - 1, this.index, groupName); return true; } this.raise("Invalid named reference"); } return false; } consumeCharacterClass() { const start = this.index; if (this.eat(LeftSquareBracket)) { const negate = this.eat(CircumflexAccent); this.onCharacterClassEnter(start, negate); this.consumeClassRanges(); if (!this.eat(RightSquareBracket)) { this.raise("Unterminated character class"); } this.onCharacterClassLeave(start, this.index, negate); return true; } return false; } consumeClassRanges() { const strict = this.strict || this._uFlag; for (;;) { const rangeStart = this.index; if (!this.consumeClassAtom()) { break; } const min = this._lastIntValue; if (!this.eat(HyphenMinus)) { continue; } this.onCharacter(this.index - 1, this.index, HyphenMinus); if (!this.consumeClassAtom()) { break; } const max = this._lastIntValue; if (min === -1 || max === -1) { if (strict) { this.raise("Invalid character class"); } continue; } if (min > max) { this.raise("Range out of order in character class"); } this.onCharacterClassRange(rangeStart, this.index, min, max); } } consumeClassAtom() { const start = this.index; const cp = this.currentCodePoint; if (cp !== -1 && cp !== ReverseSolidus && cp !== RightSquareBracket) { this.advance(); this._lastIntValue = cp; this.onCharacter(start, this.index, this._lastIntValue); return true; } if (this.eat(ReverseSolidus)) { if (this.consumeClassEscape()) { return true; } if (!this.strict && this.currentCodePoint === LatinSmallLetterC) { this._lastIntValue = ReverseSolidus; this.onCharacter(start, this.index, this._lastIntValue); return true; } if (this.strict || this._uFlag) { this.raise("Invalid escape"); } this.rewind(start); } return false; } consumeClassEscape() { const start = this.index; if (this.eat(LatinSmallLetterB)) { this._lastIntValue = Backspace; this.onCharacter(start - 1, this.index, this._lastIntValue); return true; } if (this._uFlag && this.eat(HyphenMinus)) { this._lastIntValue = HyphenMinus; this.onCharacter(start - 1, this.index, this._lastIntValue); return true; } let cp = 0; if (!this.strict && !this._uFlag && this.currentCodePoint === LatinSmallLetterC && (isDecimalDigit((cp = this.nextCodePoint)) || cp === LowLine)) { this.advance(); this.advance(); this._lastIntValue = cp % 0x20; this.onCharacter(start - 1, this.index, this._lastIntValue); return true; } return (this.consumeCharacterClassEscape() || this.consumeCharacterEscape()); } eatGroupName() { if (this.eat(LessThanSign)) { if (this.eatRegExpIdentifierName() && this.eat(GreaterThanSign)) { return true; } this.raise("Invalid capture group name"); } return false; } eatRegExpIdentifierName() { if (this.eatRegExpIdentifierStart()) { this._lastStrValue = String.fromCodePoint(this._lastIntValue); while (this.eatRegExpIdentifierPart()) { this._lastStrValue += String.fromCodePoint(this._lastIntValue); } return true; } return false; } eatRegExpIdentifierStart() { const start = this.index; const forceUFlag = !this._uFlag && this.ecmaVersion >= 2020; let cp = this.currentCodePoint; this.advance(); if (cp === ReverseSolidus && this.eatRegExpUnicodeEscapeSequence(forceUFlag)) { cp = this._lastIntValue; } else if (forceUFlag && isLeadSurrogate(cp) && isTrailSurrogate(this.currentCodePoint)) { cp = combineSurrogatePair(cp, this.currentCodePoint); this.advance(); } if (isRegExpIdentifierStart(cp)) { this._lastIntValue = cp; return true; } if (this.index !== start) { this.rewind(start); } return false; } eatRegExpIdentifierPart() { const start = this.index; const forceUFlag = !this._uFlag && this.ecmaVersion >= 2020; let cp = this.currentCodePoint; this.advance(); if (cp === ReverseSolidus && this.eatRegExpUnicodeEscapeSequence(forceUFlag)) { cp = this._lastIntValue; } else if (forceUFlag && isLeadSurrogate(cp) && isTrailSurrogate(this.currentCodePoint)) { cp = combineSurrogatePair(cp, this.currentCodePoint); this.advance(); } if (isRegExpIdentifierPart(cp)) { this._lastIntValue = cp; return true; } if (this.index !== start) { this.rewind(start); } return false; } eatCControlLetter() { const start = this.index; if (this.eat(LatinSmallLetterC)) { if (this.eatControlLetter()) { return true; } this.rewind(start); } return false; } eatZero() { if (this.currentCodePoint === DigitZero && !isDecimalDigit(this.nextCodePoint)) { this._lastIntValue = 0; this.advance(); return true; } return false; } eatControlEscape() { if (this.eat(LatinSmallLetterF)) { this._lastIntValue = FormFeed; return true; } if (this.eat(LatinSmallLetterN)) { this._lastIntValue = LineFeed; return true; } if (this.eat(LatinSmallLetterR)) { this._lastIntValue = CarriageReturn; return true; } if (this.eat(LatinSmallLetterT)) { this._lastIntValue = CharacterTabulation; return true; } if (this.eat(LatinSmallLetterV)) { this._lastIntValue = LineTabulation; return true; } return false; } eatControlLetter() { const cp = this.currentCodePoint; if (isLatinLetter(cp)) { this.advance(); this._lastIntValue = cp % 0x20; return true; } return false; } eatRegExpUnicodeEscapeSequence(forceUFlag = false) { const start = this.index; const uFlag = forceUFlag || this._uFlag; if (this.eat(LatinSmallLetterU)) { if ((uFlag && this.eatRegExpUnicodeSurrogatePairEscape()) || this.eatFixedHexDigits(4) || (uFlag && this.eatRegExpUnicodeCodePointEscape())) { return true; } if (this.strict || uFlag) { this.raise("Invalid unicode escape"); } this.rewind(start); } return false; } eatRegExpUnicodeSurrogatePairEscape() { const start = this.index; if (this.eatFixedHexDigits(4)) { const lead = this._lastIntValue; if (isLeadSurrogate(lead) && this.eat(ReverseSolidus) && this.eat(LatinSmallLetterU) && this.eatFixedHexDigits(4)) { const trail = this._lastIntValue; if (isTrailSurrogate(trail)) { this._lastIntValue = combineSurrogatePair(lead, trail); return true; } } this.rewind(start); } return false; } eatRegExpUnicodeCodePointEscape() { const start = this.index; if (this.eat(LeftCurlyBracket) && this.eatHexDigits() && this.eat(RightCurlyBracket) && isValidUnicode(this._lastIntValue)) { return true; } this.rewind(start); return false; } eatIdentityEscape() { const cp = this.currentCodePoint; if (this.isValidIdentityEscape(cp)) { this._lastIntValue = cp; this.advance(); return true; } return false; } isValidIdentityEscape(cp) { if (cp === -1) { return false; } if (this._uFlag) { return isSyntaxCharacter(cp) || cp === Solidus; } if (this.strict) { return !isIdContinue(cp); } if (this._nFlag) { return !(cp === LatinSmallLetterC || cp === LatinSmallLetterK); } return cp !== LatinSmallLetterC; } eatDecimalEscape() { this._lastIntValue = 0; let cp = this.currentCodePoint; if (cp >= DigitOne && cp <= DigitNine) { do { this._lastIntValue = 10 * this._lastIntValue + (cp - DigitZero); this.advance(); } while ((cp = this.currentCodePoint) >= DigitZero && cp <= DigitNine); return true; } return false; } eatUnicodePropertyValueExpression() { const start = this.index; if (this.eatUnicodePropertyName() && this.eat(EqualsSign)) { this._lastKeyValue = this._lastStrValue; if (this.eatUnicodePropertyValue()) { this._lastValValue = this._lastStrValue; if (isValidUnicodeProperty(this.ecmaVersion, this._lastKeyValue, this._lastValValue)) { return true; } this.raise("Invalid property name"); } } this.rewind(start); if (this.eatLoneUnicodePropertyNameOrValue()) { const nameOrValue = this._lastStrValue; if (isValidUnicodeProperty(this.ecmaVersion, "General_Category", nameOrValue)) { this._lastKeyValue = "General_Category"; this._lastValValue = nameOrValue; return true; } if (isValidLoneUnicodeProperty(this.ecmaVersion, nameOrValue)) { this._lastKeyValue = nameOrValue; this._lastValValue = ""; return true; } this.raise("Invalid property name"); } return false; } eatUnicodePropertyName() { this._lastStrValue = ""; while (isUnicodePropertyNameCharacter(this.currentCodePoint)) { this._lastStrValue += String.fromCodePoint(this.currentCodePoint); this.advance(); } return this._lastStrValue !== ""; } eatUnicodePropertyValue() { this._lastStrValue = ""; while (isUnicodePropertyValueCharacter(this.currentCodePoint)) { this._lastStrValue += String.fromCodePoint(this.currentCodePoint); this.advance(); } return this._lastStrValue !== ""; } eatLoneUnicodePropertyNameOrValue() { return this.eatUnicodePropertyValue(); } eatHexEscapeSequence() { const start = this.index; if (this.eat(LatinSmallLetterX)) { if (this.eatFixedHexDigits(2)) { return true; } if (this._uFlag || this.strict) { this.raise("Invalid escape"); } this.rewind(start); } return false; } eatDecimalDigits() { const start = this.index; this._lastIntValue = 0; while (isDecimalDigit(this.currentCodePoint)) { this._lastIntValue = 10 * this._lastIntValue + digitToInt(this.currentCodePoint); this.advance(); } return this.index !== start; } eatHexDigits() { const start = this.index; this._lastIntValue = 0; while (isHexDigit(this.currentCodePoint)) { this._lastIntValue = 16 * this._lastIntValue + digitToInt(this.currentCodePoint); this.advance(); } return this.index !== start; } eatLegacyOctalEscapeSequence() { if (this.eatOctalDigit()) { const n1 = this._lastIntValue; if (this.eatOctalDigit()) { const n2 = this._lastIntValue; if (n1 <= 3 && this.eatOctalDigit()) { this._lastIntValue = n1 * 64 + n2 * 8 + this._lastIntValue; } else { this._lastIntValue = n1 * 8 + n2; } } else { this._lastIntValue = n1; } return true; } return false; } eatOctalDigit() { const cp = this.currentCodePoint; if (isOctalDigit(cp)) { this.advance(); this._lastIntValue = cp - DigitZero; return true; } this._lastIntValue = 0; return false; } eatFixedHexDigits(length) { const start = this.index; this._lastIntValue = 0; for (let i = 0; i < length; ++i) { const cp = this.currentCodePoint; if (!isHexDigit(cp)) { this.rewind(start); return false; } this._lastIntValue = 16 * this._lastIntValue + digitToInt(cp); this.advance(); } return true; } } const DummyPattern = {}; const DummyFlags = {}; const DummyCapturingGroup = {}; class RegExpParserState { constructor(options) { this._node = DummyPattern; this._flags = DummyFlags; this._backreferences = []; this._capturingGroups = []; this.source = ""; this.strict = Boolean(options && options.strict); this.ecmaVersion = (options && options.ecmaVersion) || 2020; } get pattern() { if (this._node.type !== "Pattern") { throw new Error("UnknownError"); } return this._node; } get flags() { if (this._flags.type !== "Flags") { throw new Error("UnknownError"); } return this._flags; } onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll) { this._flags = { type: "Flags", parent: null, start, end, raw: this.source.slice(start, end), global, ignoreCase, multiline, unicode, sticky, dotAll, }; } onPatternEnter(start) { this._node = { type: "Pattern", parent: null, start, end: start, raw: "", alternatives: [], }; this._backreferences.length = 0; this._capturingGroups.length = 0; } onPatternLeave(start, end) { this._node.end = end; this._node.raw = this.source.slice(start, end); for (const reference of this._backreferences) { const ref = reference.ref; const group = typeof ref === "number" ? this._capturingGroups[ref - 1] : this._capturingGroups.find(g => g.name === ref); reference.resolved = group; group.references.push(reference); } } onAlternativeEnter(start) { const parent = this._node; if (parent.type !== "Assertion" && parent.type !== "CapturingGroup" && parent.type !== "Group" && parent.type !== "Pattern") { throw new Error("UnknownError"); } this._node = { type: "Alternative", parent, start, end: start, raw: "", elements: [], }; parent.alternatives.push(this._node); } onAlternativeLeave(start, end) { const node = this._node; if (node.type !== "Alternative") { throw new Error("UnknownError"); } node.end = end; node.raw = this.source.slice(start, end); this._node = node.parent; } onGroupEnter(start) { const parent = this._node; if (parent.type !== "Alternative") { throw new Error("UnknownError"); } this._node = { type: "Group", parent, start, end: start, raw: "", alternatives: [], }; parent.elements.push(this._node); } onGroupLeave(start, end) { const node = this._node; if (node.type !== "Group" || node.parent.type !== "Alternative") { throw new Error("UnknownError"); } node.end = end; node.raw = this.source.slice(start, end); this._node = node.parent; } onCapturingGroupEnter(start, name) { const parent = this._node; if (parent.type !== "Alternative") { throw new Error("UnknownError"); } this._node = { type: "CapturingGroup", parent, start, end: start, raw: "", name, alternatives: [], references: [], }; parent.elements.push(this._node); this._capturingGroups.push(this._node); } onCapturingGroupLeave(start, end) { const node = this._node; if (node.type !== "CapturingGroup" || node.parent.type !== "Alternative") { throw new Error("UnknownError"); } node.end = end; node.raw = this.source.slice(start, end); this._node = node.parent; } onQuantifier(start, end, min, max, greedy) { const parent = this._node; if (parent.type !== "Alternative") { throw new Error("UnknownError"); } const element = parent.elements.pop(); if (element == null || element.type === "Quantifier" || (element.type === "Assertion" && element.kind !== "lookahead")) { throw new Error("UnknownError"); } const node = { type: "Quantifier", parent, start: element.start, end, raw: this.source.slice(element.start, end), min, max, greedy, element, }; parent.elements.push(node); element.parent = node; } onLookaroundAssertionEnter(start, kind, negate) { const parent = this._node; if (parent.type !== "Alternative") { throw new Error("UnknownError"); } const node = (this._node = { type: "Assertion", parent, start, end: start, raw: "", kind, negate, alternatives: [], }); parent.elements.push(node); } onLookaroundAssertionLeave(start, end) { const node = this._node; if (node.type !== "Assertion" || node.parent.type !== "Alternative") { throw new Error("UnknownError"); } node.end = end; node.raw = this.source.slice(start, end); this._node = node.parent; } onEdgeAssertion(start, end, kind) { const parent = this._node; if (parent.type !== "Alternative") { throw new Error("UnknownError"); } parent.elements.push({ type: "Assertion", parent, start, end, raw: this.source.slice(start, end), kind, }); } onWordBoundaryAssertion(start, end, kind, negate) { const parent = this._node; if (parent.type !== "Alternative") { throw new Error("UnknownError"); } parent.elements.push({ type: "Assertion", parent, start, end, raw: this.source.slice(start, end), kind, negate, }); } onAnyCharacterSet(start, end, kind) { const parent = this._node; if (parent.type !== "Alternative") { throw new Error("UnknownError"); } parent.elements.push({ type: "CharacterSet", parent, start, end, raw: this.source.slice(start, end), kind, }); } onEscapeCharacterSet(start, end, kind, negate) { const parent = this._node; if (parent.type !== "Alternative" && parent.type !== "CharacterClass") { throw new Error("UnknownError"); } parent.elements.push({ type: "CharacterSet", parent, start, end, raw: this.source.slice(start, end), kind, negate, }); } onUnicodePropertyCharacterSet(start, end, kind, key, value, negate) { const parent = this._node; if (parent.type !== "Alternative" && parent.type !== "CharacterClass") { throw new Error("UnknownError"); } parent.elements.push({ type: "CharacterSet", parent, start, end, raw: this.source.slice(start, end), kind, key, value, negate, }); } onCharacter(start, end, value) { const parent = this._node; if (parent.type !== "Alternative" && parent.type !== "CharacterClass") { throw new Error("UnknownError"); } parent.elements.push({ type: "Character", parent, start, end, raw: this.source.slice(start, end), value, }); } onBackreference(start, end, ref) { const parent = this._node; if (parent.type !== "Alternative") { throw new Error("UnknownError"); } const node = { type: "Backreference", parent, start, end, raw: this.source.slice(start, end), ref, resolved: DummyCapturingGroup, }; parent.elements.push(node); this._backreferences.push(node); } onCharacterClassEnter(start, negate) { const parent = this._node; if (parent.type !== "Alternative") { throw new Error("UnknownError"); } this._node = { type: "CharacterClass", parent, start, end: start, raw: "", negate, elements: [], }; parent.elements.push(this._node); } onCharacterClassLeave(start, end) { const node = this._node; if (node.type !== "CharacterClass" || node.parent.type !== "Alternative") { throw new Error("UnknownError"); } node.end = end; node.raw = this.source.slice(start, end); this._node = node.parent; } onCharacterClassRange(start, end) { const parent = this._node; if (parent.type !== "CharacterClass") { throw new Error("UnknownError"); } const elements = parent.elements; const max = elements.pop(); const hyphen = elements.pop(); const min = elements.pop(); if (!min || !max || !hyphen || min.type !== "Character" || max.type !== "Character" || hyphen.type !== "Character" || hyphen.value !== HyphenMinus) { throw new Error("UnknownError"); } const node = { type: "CharacterClassRange", parent, start, end, raw: this.source.slice(start, end), min, max, }; min.parent = node; max.parent = node; elements.push(node); } } class RegExpParser { constructor(options) { this._state = new RegExpParserState(options); this._validator = new RegExpValidator(this._state); } parseLiteral(source, start = 0, end = source.length) { this._state.source = source; this._validator.validateLiteral(source, start, end); const pattern = this._state.pattern; const flags = this._state.flags; const literal = { type: "RegExpLiteral", parent: null, start, end, raw: source, pattern, flags, }; pattern.parent = literal; flags.parent = literal; return literal; } parseFlags(source, start = 0, end = source.length) { this._state.source = source; this._validator.validateFlags(source, start, end); return this._state.flags; } parsePattern(source, start = 0, end = source.length, uFlag = false) { this._state.source = source; this._validator.validatePattern(source, start, end, uFlag); return this._state.pattern; } } class RegExpVisitor { constructor(handlers) { this._handlers = handlers; } visit(node) { this.visitWithParents(node, []); } visitWithParents(node, parents) { switch (node.type) { case "Alternative": this.visitAlternative(node, parents); break; case "Assertion": this.visitAssertion(node, parents); break; case "Backreference": this.visitBackreference(node, parents); break; case "CapturingGroup": this.visitCapturingGroup(node, parents); break; case "Character": this.visitCharacter(node, parents); break; case "CharacterClass": this.visitCharacterClass(node, parents); break; case "CharacterClassRange": this.visitCharacterClassRange(node, parents); break; case "CharacterSet": this.visitCharacterSet(node, parents); break; case "Flags": this.visitFlags(node, parents); break; case "Group": this.visitGroup(node, parents); break; case "Pattern": this.visitPattern(node, parents); break; case "Quantifier": this.visitQuantifier(node, parents); break; case "RegExpLiteral": this.visitRegExpLiteral(node, parents); break; default: throw new Error(`Unknown type: ${node.type}`); } } visitAlternative(node, parents) { if (this._handlers.onAlternativeEnter) { this._handlers.onAlternativeEnter(node, parents); } parents.push(node); for (const child of node.elements) { this.visitWithParents(child, parents); } parents.pop(); if (this._handlers.onAlternativeLeave) { this._handlers.onAlternativeLeave(node, parents); } } visitAssertion(node, parents) { if (this._handlers.onAssertionEnter) { this._handlers.onAssertionEnter(node, parents); } if (node.kind === "lookahead" || node.kind === "lookbehind") { parents.push(node); for (const child of node.alternatives) { this.visitWithParents(child, parents); } parents.pop(); } if (this._handlers.onAssertionLeave) { this._handlers.onAssertionLeave(node, parents); } } visitBackreference(node, parents) { if (this._handlers.onBackreferenceEnter) { this._handlers.onBackreferenceEnter(node, parents); } if (this._handlers.onBackreferenceLeave) { this._handlers.onBackreferenceLeave(node, parents); } } visitCapturingGroup(node, parents) { if (this._handlers.onCapturingGroupEnter) { this._handlers.onCapturingGroupEnter(node, parents); } parents.push(node); for (const child of node.alternatives) { this.visitWithParents(child, parents); } parents.pop(); if (this._handlers.onCapturingGroupLeave) { this._handlers.onCapturingGroupLeave(node, parents); } } visitCharacter(node, parents) { if (this._handlers.onCharacterEnter) { this._handlers.onCharacterEnter(node, parents); } if (this._handlers.onCharacterLeave) { this._handlers.onCharacterLeave(node, parents); } } visitCharacterClass(node, parents) { if (this._handlers.onCharacterClassEnter) { this._handlers.onCharacterClassEnter(node, parents); } parents.push(node); for (const child of node.elements) { this.visitWithParents(child, parents); } parents.pop(); if (this._handlers.onCharacterClassLeave) { this._handlers.onCharacterClassLeave(node, parents); } } visitCharacterClassRange(node, parents) { if (this._handlers.onCharacterClassRangeEnter) { this._handlers.onCharacterClassRangeEnter(node, parents); } parents.push(node); this.visitCharacter(node.min, parents); this.visitCharacter(node.max, parents); parents.pop(); if (this._handlers.onCharacterClassRangeLeave) { this._handlers.onCharacterClassRangeLeave(node, parents); } } visitCharacterSet(node, parents) { if (this._handlers.onCharacterSetEnter) { this._handlers.onCharacterSetEnter(node, parents); } if (this._handlers.onCharacterSetLeave) { this._handlers.onCharacterSetLeave(node, parents); } } visitFlags(node, parents) { if (this._handlers.onFlagsEnter) { this._handlers.onFlagsEnter(node, parents); } if (this._handlers.onFlagsLeave) { this._handlers.onFlagsLeave(node, parents); } } visitGroup(node, parents) { if (this._handlers.onGroupEnter) { this._handlers.onGroupEnter(node, parents); } parents.push(node); for (const child of node.alternatives) { this.visitWithParents(child, parents); } parents.pop(); if (this._handlers.onGroupLeave) { this._handlers.onGroupLeave(node, parents); } } visitPattern(node, parents) { if (this._handlers.onPatternEnter) { this._handlers.onPatternEnter(node, parents); } parents.push(node); for (const child of node.alternatives) { this.visitWithParents(child, parents); } parents.pop(); if (this._handlers.onPatternLeave) { this._handlers.onPatternLeave(node, parents); } } visitQuantifier(node, parents) { if (this._handlers.onQuantifierEnter) { this._handlers.onQuantifierEnter(node, parents); } parents.push(node); this.visitWithParents(node.element, parents); parents.pop(); if (this._handlers.onQuantifierLeave) { this._handlers.onQuantifierLeave(node, parents); } } visitRegExpLiteral(node, parents) { if (this._handlers.onRegExpLiteralEnter) { this._handlers.onRegExpLiteralEnter(node, parents); } parents.push(node); this.visitWithParents(node.pattern, parents); this.visitWithParents(node.flags, parents); parents.pop(); if (this._handlers.onRegExpLiteralLeave) { this._handlers.onRegExpLiteralLeave(node, parents); } } } function parseRegExpLiteral(source, options) { return new RegExpParser(options).parseLiteral(String(source)); } function validateRegExpLiteral(source, options) { return new RegExpValidator(options).validateLiteral(source); } function visitRegExpAST(node, handlers) { new RegExpVisitor(handlers).visit(node); } export { ast as AST, RegExpParser, RegExpValidator, RegExpVisitor, parseRegExpLiteral, validateRegExpLiteral, visitRegExpAST }; //# sourceMappingURL=index.mjs.map {"version":3,"file":"index.mjs.map","sources":[".temp/unicode/src/unicode/ids.ts",".temp/unicode/src/unicode/properties.ts",".temp/unicode/src/unicode/index.ts",".temp/src/reader.ts",".temp/src/regexp-syntax-error.ts",".temp/src/validator.ts",".temp/src/parser.ts",".temp/src/visitor.ts",".temp/src/index.ts"],"sourcesContent":[{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\Connor\\Documents\\Github\\vscode-regexpp\\.temp\\unicode\\src\\unicode\\ids.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\Connor\\Documents\\Github\\vscode-regexpp\\.temp\\unicode\\src\\unicode\\properties.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\Connor\\Documents\\Github\\vscode-regexpp\\.temp\\unicode\\src\\unicode\\index.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\Connor\\Documents\\Github\\vscode-regexpp\\.temp\\src\\reader.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\Connor\\Documents\\Github\\vscode-regexpp\\.temp\\src\\regexp-syntax-error.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\Connor\\Documents\\Github\\vscode-regexpp\\.temp\\src\\validator.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\Connor\\Documents\\Github\\vscode-regexpp\\.temp\\src\\parser.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\Connor\\Documents\\Github\\vscode-regexpp\\.temp\\src\\visitor.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\Connor\\Documents\\Github\\vscode-regexpp\\.temp\\src\\index.ts"}],"names":[],"mappings":";;;;;;;AAIA,IAAI,kBAAkB,GAAyB,SAAS,CAAA;AACxD,IAAI,qBAAqB,GAAyB,SAAS,CAAA;AAE3D,SAAgB,SAAS,CAAC,EAAU;IAChC,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,IAAI,CAAA;IAC1B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,IAAI,CAAA;IAC1B,OAAO,cAAc,CAAC,EAAE,CAAC,CAAA;AAC7B,CAAC;AAED,SAAgB,YAAY,CAAC,EAAU;IACnC,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,IAAI,CAAA;IAC1B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,IAAI,CAAA;IAC1B,IAAI,EAAE,KAAK,IAAI;QAAE,OAAO,IAAI,CAAA;IAC5B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,IAAI,CAAA;IAC1B,OAAO,cAAc,CAAC,EAAE,CAAC,IAAI,iBAAiB,CAAC,EAAE,CAAC,CAAA;AACtD,CAAC;AAED,SAAS,cAAc,CAAC,EAAU;IAC9B,OAAO,SAAS,CACZ,EAAE,EACF,kBAAkB,KAAK,kBAAkB,GAAG,sBAAsB,EAAE,CAAC,CACxE,CAAA;AACL,CAAC;AAED,SAAS,iBAAiB,CAAC,EAAU;IACjC,OAAO,SAAS,CACZ,EAAE,EACF,qBAAqB;SAChB,qBAAqB,GAAG,yBAAyB,EAAE,CAAC,CAC5D,CAAA;AACL,CAAC;AAED,SAAS,sBAAsB;IAC3B,OAAO,aAAa,CAChB,4qFAA4qF,CAC/qF,CAAA;AACL,CAAC;AAED,SAAS,yBAAyB;IAC9B,OAAO,aAAa,CAChB,0gDAA0gD,CAC7gD,CAAA;AACL,CAAC;AAED,SAAS,SAAS,CAAC,EAAU,EAAE,MAAgB;IAC3C,IAAI,CAAC,GAAG,CAAC,EACL,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,EAC3B,CAAC,GAAG,CAAC,EACL,GAAG,GAAG,CAAC,EACP,GAAG,GAAG,CAAC,CAAA;IACX,OAAO,CAAC,GAAG,CAAC,EAAE;QACV,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACrB,GAAG,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;QACnB,GAAG,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;QACvB,IAAI,EAAE,GAAG,GAAG,EAAE;YACV,CAAC,GAAG,CAAC,CAAA;SACR;aAAM,IAAI,EAAE,GAAG,GAAG,EAAE;YACjB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;SACZ;aAAM;YACH,OAAO,IAAI,CAAA;SACd;KACJ;IACD,OAAO,KAAK,CAAA;AAChB,CAAC;AAED,SAAS,aAAa,CAAC,IAAY;IAC/B,IAAI,IAAI,GAAG,CAAC,CAAA;IACZ,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,IAAI,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;AAClE,CAAC;;AC3ED,MAAM,OAAO;IAST,YACI,OAAe,EACf,OAAe,EACf,OAAe,EACf,OAAe;QAEf,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;QACvB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;QACvB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;QACvB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;KAC1B;IACD,IAAW,MAAM;QACb,QACI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EACvE;KACJ;IACD,IAAW,MAAM;QACb,QACI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EACvE;KACJ;IACD,IAAW,MAAM;QACb,QACI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EACvE;KACJ;IACD,IAAW,MAAM;QACb,QACI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EACvE;KACJ;CACJ;AAED,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC,CAAA;AACrD,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,mBAAmB,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAA;AACvE,MAAM,WAAW,GAAG,IAAI,OAAO,CAC3B,opBAAopB,EACppB,EAAE,EACF,EAAE,EACF,EAAE,CACL,CAAA;AACD,MAAM,WAAW,GAAG,IAAI,OAAO,CAC3B,48DAA48D,EAC58D,gHAAgH,EAChH,uEAAuE,EACvE,uEAAuE,CAC1E,CAAA;AACD,MAAM,eAAe,GAAG,IAAI,OAAO,CAC/B,69BAA69B,EAC79B,uBAAuB,EACvB,EAAE,EACF,gCAAgC,CACnC,CAAA;AAED,SAAgB,sBAAsB,CAClC,OAAe,EACf,IAAY,EACZ,KAAa;IAEb,IAAI,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;QACrB,OAAO,OAAO,IAAI,IAAI,IAAI,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;KAC1D;IACD,IAAI,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;QACrB,QACI,CAAC,OAAO,IAAI,IAAI,IAAI,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC;aAChD,OAAO,IAAI,IAAI,IAAI,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;aACjD,OAAO,IAAI,IAAI,IAAI,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;aACjD,OAAO,IAAI,IAAI,IAAI,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EACrD;KACJ;IACD,OAAO,KAAK,CAAA;AAChB,CAAC;AAED,SAAgB,0BAA0B,CACtC,OAAe,EACf,KAAa;IAEb,QACI,CAAC,OAAO,IAAI,IAAI,IAAI,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC;SACpD,OAAO,IAAI,IAAI,IAAI,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;SACrD,OAAO,IAAI,IAAI,IAAI,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EACzD;AACL,CAAC;;ACtFM,MAAM,SAAS,GAAG,IAAI,CAAA;AAC7B,AAAO,MAAM,mBAAmB,GAAG,IAAI,CAAA;AACvC,AAAO,MAAM,QAAQ,GAAG,IAAI,CAAA;AAC5B,AAAO,MAAM,cAAc,GAAG,IAAI,CAAA;AAClC,AAAO,MAAM,QAAQ,GAAG,IAAI,CAAA;AAC5B,AAAO,MAAM,cAAc,GAAG,IAAI,CAAA;AAClC,AAAO,MAAM,eAAe,GAAG,IAAI,CAAA;AACnC,AAAO,MAAM,UAAU,GAAG,IAAI,CAAA;AAC9B,AAAO,MAAM,eAAe,GAAG,IAAI,CAAA;AACnC,AAAO,MAAM,gBAAgB,GAAG,IAAI,CAAA;AACpC,AAAO,MAAM,QAAQ,GAAG,IAAI,CAAA;AAC5B,AAAO,MAAM,QAAQ,GAAG,IAAI,CAAA;AAC5B,AAAO,MAAM,KAAK,GAAG,IAAI,CAAA;AACzB,AAAO,MAAM,WAAW,GAAG,IAAI,CAAA;AAC/B,AAAO,MAAM,QAAQ,GAAG,IAAI,CAAA;AAC5B,AAAO,MAAM,OAAO,GAAG,IAAI,CAAA;AAC3B,AAAO,MAAM,SAAS,GAAG,IAAI,CAAA;AAC7B,AAAO,MAAM,QAAQ,GAAG,IAAI,CAAA;AAC5B,AAAO,MAAM,UAAU,GAAG,IAAI,CAAA;AAC9B,AAAO,MAAM,SAAS,GAAG,IAAI,CAAA;AAC7B,AAAO,MAAM,KAAK,GAAG,IAAI,CAAA;AACzB,AAAO,MAAM,YAAY,GAAG,IAAI,CAAA;AAChC,AAAO,MAAM,UAAU,GAAG,IAAI,CAAA;AAC9B,AAAO,MAAM,eAAe,GAAG,IAAI,CAAA;AACnC,AAAO,MAAM,YAAY,GAAG,IAAI,CAAA;AAChC,AAAO,MAAM,mBAAmB,GAAG,IAAI,CAAA;AACvC,AAAO,MAAM,mBAAmB,GAAG,IAAI,CAAA;AACvC,AAAO,MAAM,mBAAmB,GAAG,IAAI,CAAA;AACvC,AAAO,MAAM,mBAAmB,GAAG,IAAI,CAAA;AACvC,AAAO,MAAM,mBAAmB,GAAG,IAAI,CAAA;AACvC,AAAO,MAAM,mBAAmB,GAAG,IAAI,CAAA;AACvC,AAAO,MAAM,mBAAmB,GAAG,IAAI,CAAA;AACvC,AAAO,MAAM,mBAAmB,GAAG,IAAI,CAAA;AACvC,AAAO,MAAM,OAAO,GAAG,IAAI,CAAA;AAC3B,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,cAAc,GAAG,IAAI,CAAA;AAClC,AAAO,MAAM,kBAAkB,GAAG,IAAI,CAAA;AACtC,AAAO,MAAM,gBAAgB,GAAG,IAAI,CAAA;AACpC,AAAO,MAAM,gBAAgB,GAAG,IAAI,CAAA;AACpC,AAAO,MAAM,YAAY,GAAG,IAAI,CAAA;AAChC,AAAO,MAAM,iBAAiB,GAAG,IAAI,CAAA;AACrC,AAAO,MAAM,kBAAkB,GAAG,MAAM,CAAA;AACxC,AAAO,MAAM,eAAe,GAAG,MAAM,CAAA;AACrC,AAAO,MAAM,aAAa,GAAG,MAAM,CAAA;AACnC,AAAO,MAAM,kBAAkB,GAAG,MAAM,CAAA;AAExC,AAAO,MAAM,YAAY,GAAG,IAAI,CAAA;AAChC,AAAO,MAAM,YAAY,GAAG,QAAQ,CAAA;AAEpC,SAAgB,aAAa,CAAC,IAAY;IACtC,QACI,CAAC,IAAI,IAAI,mBAAmB,IAAI,IAAI,IAAI,mBAAmB;SAC1D,IAAI,IAAI,iBAAiB,IAAI,IAAI,IAAI,iBAAiB,CAAC,EAC3D;AACL,CAAC;AAED,SAAgB,cAAc,CAAC,IAAY;IACvC,OAAO,IAAI,IAAI,SAAS,IAAI,IAAI,IAAI,SAAS,CAAA;AACjD,CAAC;AAED,SAAgB,YAAY,CAAC,IAAY;IACrC,OAAO,IAAI,IAAI,SAAS,IAAI,IAAI,IAAI,UAAU,CAAA;AAClD,CAAC;AAED,SAAgB,UAAU,CAAC,IAAY;IACnC,QACI,CAAC,IAAI,IAAI,SAAS,IAAI,IAAI,IAAI,SAAS;SACtC,IAAI,IAAI,mBAAmB,IAAI,IAAI,IAAI,mBAAmB,CAAC;SAC3D,IAAI,IAAI,iBAAiB,IAAI,IAAI,IAAI,iBAAiB,CAAC,EAC3D;AACL,CAAC;AAED,SAAgB,gBAAgB,CAAC,IAAY;IACzC,QACI,IAAI,KAAK,QAAQ;QACjB,IAAI,KAAK,cAAc;QACvB,IAAI,KAAK,aAAa;QACtB,IAAI,KAAK,kBAAkB,EAC9B;AACL,CAAC;AAED,SAAgB,cAAc,CAAC,IAAY;IACvC,OAAO,IAAI,IAAI,YAAY,IAAI,IAAI,IAAI,YAAY,CAAA;AACvD,CAAC;AAED,SAAgB,UAAU,CAAC,IAAY;IACnC,IAAI,IAAI,IAAI,iBAAiB,IAAI,IAAI,IAAI,iBAAiB,EAAE;QACxD,OAAO,IAAI,GAAG,iBAAiB,GAAG,EAAE,CAAA;KACvC;IACD,IAAI,IAAI,IAAI,mBAAmB,IAAI,IAAI,IAAI,mBAAmB,EAAE;QAC5D,OAAO,IAAI,GAAG,mBAAmB,GAAG,EAAE,CAAA;KACzC;IACD,OAAO,IAAI,GAAG,SAAS,CAAA;AAC3B,CAAC;AAED,SAAgB,eAAe,CAAC,IAAY;IACxC,OAAO,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,CAAA;AAC3C,CAAC;AAED,SAAgB,gBAAgB,CAAC,IAAY;IACzC,OAAO,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,CAAA;AAC3C,CAAC;AAED,SAAgB,oBAAoB,CAAC,IAAY,EAAE,KAAa;IAC5D,OAAO,CAAC,IAAI,GAAG,MAAM,IAAI,KAAK,IAAI,KAAK,GAAG,MAAM,CAAC,GAAG,OAAO,CAAA;AAC/D,CAAC;;ACpID,MAAM,UAAU,GAAG;IACf,EAAE,CAAC,CAAS,EAAE,GAAW,EAAE,CAAS;QAChC,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;KACxC;IACD,KAAK,CAAC,CAAS;QACX,OAAO,CAAC,CAAA;KACX;CACJ,CAAA;AACD,MAAM,WAAW,GAAG;IAChB,EAAE,CAAC,CAAS,EAAE,GAAW,EAAE,CAAS;QAChC,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,CAAE,GAAG,CAAC,CAAC,CAAA;KAC1C;IACD,KAAK,CAAC,CAAS;QACX,OAAO,CAAC,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,CAAA;KAC5B;CACJ,CAAA;AAED,MAAa,MAAM;IAAnB;QACY,UAAK,GAAG,UAAU,CAAA;QAClB,OAAE,GAAG,EAAE,CAAA;QACP,OAAE,GAAG,CAAC,CAAA;QACN,SAAI,GAAG,CAAC,CAAA;QACR,SAAI,GAAW,CAAC,CAAC,CAAA;QACjB,QAAG,GAAG,CAAC,CAAA;QACP,SAAI,GAAW,CAAC,CAAC,CAAA;QACjB,QAAG,GAAG,CAAC,CAAA;QACP,SAAI,GAAW,CAAC,CAAC,CAAA;QACjB,QAAG,GAAG,CAAC,CAAA;QACP,SAAI,GAAW,CAAC,CAAC,CAAA;KAkG5B;IAhGG,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,EAAE,CAAA;KACjB;IAED,IAAW,KAAK;QACZ,OAAO,IAAI,CAAC,EAAE,CAAA;KACjB;IAED,IAAW,gBAAgB;QACvB,OAAO,IAAI,CAAC,IAAI,CAAA;KACnB;IAED,IAAW,aAAa;QACpB,OAAO,IAAI,CAAC,IAAI,CAAA;KACnB;IAED,IAAW,cAAc;QACrB,OAAO,IAAI,CAAC,IAAI,CAAA;KACnB;IAED,IAAW,cAAc;QACrB,OAAO,IAAI,CAAC,IAAI,CAAA;KACnB;IAEM,KAAK,CACR,MAAc,EACd,KAAa,EACb,GAAW,EACX,KAAc;QAEd,IAAI,CAAC,KAAK,GAAG,KAAK,GAAG,WAAW,GAAG,UAAU,CAAA;QAC7C,IAAI,CAAC,EAAE,GAAG,MAAM,CAAA;QAChB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAA;QACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;KACrB;IAEM,MAAM,CAAC,KAAa;QACvB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAA;QACvB,IAAI,CAAC,EAAE,GAAG,KAAK,CAAA;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QAC9C,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAChC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAA;QACzD,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAChC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAA;QACpE,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAChC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,CACf,IAAI,CAAC,EAAE,EACP,IAAI,CAAC,IAAI,EACT,KAAK,GAAG,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CACzC,CAAA;KACJ;IAEM,OAAO;QACV,IAAI,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,EAAE;YAClB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAA;YACvB,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,GAAG,CAAA;YACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA;YACrB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAA;YACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA;YACrB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAChC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA;YACrB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAChC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,CACf,IAAI,CAAC,EAAE,EACP,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAC3C,CAAA;SACJ;KACJ;IAEM,GAAG,CAAC,EAAU;QACjB,IAAI,IAAI,CAAC,IAAI,KAAK,EAAE,EAAE;YAClB,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAEM,IAAI,CAAC,GAAW,EAAE,GAAW;QAChC,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,EAAE;YACxC,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAEM,IAAI,CAAC,GAAW,EAAE,GAAW,EAAE,GAAW;QAC7C,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,EAAE;YAC7D,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;CACJ;;MC9HY,iBAAkB,SAAQ,WAAW;IAE9C,YACI,MAAc,EACd,KAAc,EACd,KAAa,EACb,OAAe;QAGf,IAAI,MAAM,EAAE;YACR,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;gBACzB,MAAM,GAAG,IAAI,MAAM,IAAI,KAAK,GAAG,GAAG,GAAG,EAAE,EAAE,CAAA;aAC5C;YACD,MAAM,GAAG,KAAK,MAAM,EAAE,CAAA;SACzB;QAGD,KAAK,CAAC,6BAA6B,MAAM,KAAK,OAAO,EAAE,CAAC,CAAA;QACxD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;KACrB;CACJ;;ACyDD,SAAS,iBAAiB,CAAC,EAAU;IACjC,QACI,EAAE,KAAK,gBAAgB;QACvB,EAAE,KAAK,UAAU;QACjB,EAAE,KAAK,cAAc;QACrB,EAAE,KAAK,QAAQ;QACf,EAAE,KAAK,QAAQ;QACf,EAAE,KAAK,QAAQ;QACf,EAAE,KAAK,YAAY;QACnB,EAAE,KAAK,eAAe;QACtB,EAAE,KAAK,gBAAgB;QACvB,EAAE,KAAK,iBAAiB;QACxB,EAAE,KAAK,kBAAkB;QACzB,EAAE,KAAK,gBAAgB;QACvB,EAAE,KAAK,iBAAiB;QACxB,EAAE,KAAK,YAAY,EACtB;AACL,CAAC;AAED,SAAS,uBAAuB,CAAC,EAAU;IACvC,OAAO,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,UAAU,IAAI,EAAE,KAAK,OAAO,CAAA;AAC/D,CAAC;AAED,SAAS,sBAAsB,CAAC,EAAU;IACtC,QACI,YAAY,CAAC,EAAE,CAAC;QAChB,EAAE,KAAK,UAAU;QACjB,EAAE,KAAK,OAAO;QACd,EAAE,KAAK,kBAAkB;QACzB,EAAE,KAAK,eAAe,EACzB;AACL,CAAC;AAED,SAAS,8BAA8B,CAAC,EAAU;IAC9C,OAAO,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,OAAO,CAAA;AAC9C,CAAC;AAED,SAAS,+BAA+B,CAAC,EAAU;IAC/C,OAAO,8BAA8B,CAAC,EAAE,CAAC,IAAI,cAAc,CAAC,EAAE,CAAC,CAAA;AACnE,CAAC;AAmSD,MAAa,eAAe;IAoBxB,YAAmB,OAAiC;QAlBnC,YAAO,GAAG,IAAI,MAAM,EAAE,CAAA;QAC/B,WAAM,GAAG,KAAK,CAAA;QACd,WAAM,GAAG,KAAK,CAAA;QACd,kBAAa,GAAG,CAAC,CAAA;QACjB,kBAAa,GAAG,CAAC,CAAA;QACjB,kBAAa,GAAG,CAAC,CAAA;QACjB,kBAAa,GAAG,EAAE,CAAA;QAClB,kBAAa,GAAG,EAAE,CAAA;QAClB,kBAAa,GAAG,EAAE,CAAA;QAClB,iCAA4B,GAAG,KAAK,CAAA;QACpC,wBAAmB,GAAG,CAAC,CAAA;QACvB,gBAAW,GAAG,IAAI,GAAG,EAAU,CAAA;QAC/B,wBAAmB,GAAG,IAAI,GAAG,EAAU,CAAA;QAO3C,IAAI,CAAC,QAAQ,GAAG,OAAO,IAAI,EAAE,CAAA;KAChC;IAQM,eAAe,CAClB,MAAc,EACd,KAAK,GAAG,CAAC,EACT,MAAc,MAAM,CAAC,MAAM;QAE3B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;QACjC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAA;QAE9B,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;QAC1B,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,aAAa,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;YAChE,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAA;YAC5B,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;YAC7C,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,CAAC,CAAA;YAC1C,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,GAAG,CAAC,EAAE,SAAS,GAAG,CAAC,EAAE,KAAK,CAAC,CAAA;SAChE;aAAM,IAAI,KAAK,IAAI,GAAG,EAAE;YACrB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;SACtB;aAAM;YACH,MAAM,CAAC,GAAG,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;YACrD,IAAI,CAAC,KAAK,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAA;SAC5C;QACD,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;KAClC;IAQM,aAAa,CAChB,MAAc,EACd,KAAK,GAAG,CAAC,EACT,MAAc,MAAM,CAAC,MAAM;QAE3B,MAAM,aAAa,GAAG,IAAI,GAAG,EAAU,CAAA;QACvC,IAAI,MAAM,GAAG,KAAK,CAAA;QAClB,IAAI,UAAU,GAAG,KAAK,CAAA;QACtB,IAAI,SAAS,GAAG,KAAK,CAAA;QACrB,IAAI,MAAM,GAAG,KAAK,CAAA;QAClB,IAAI,OAAO,GAAG,KAAK,CAAA;QACnB,IAAI,MAAM,GAAG,KAAK,CAAA;QAClB,KAAK,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,GAAG,EAAE,EAAE,CAAC,EAAE;YAC9B,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;YAEjC,IAAI,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;gBACzB,IAAI,CAAC,KAAK,CAAC,oBAAoB,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;aAC/C;YACD,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;YAEvB,IAAI,IAAI,KAAK,iBAAiB,EAAE;gBAC5B,MAAM,GAAG,IAAI,CAAA;aAChB;iBAAM,IAAI,IAAI,KAAK,iBAAiB,EAAE;gBACnC,UAAU,GAAG,IAAI,CAAA;aACpB;iBAAM,IAAI,IAAI,KAAK,iBAAiB,EAAE;gBACnC,SAAS,GAAG,IAAI,CAAA;aACnB;iBAAM,IAAI,IAAI,KAAK,iBAAiB,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,EAAE;gBAC/D,OAAO,GAAG,IAAI,CAAA;aACjB;iBAAM,IAAI,IAAI,KAAK,iBAAiB,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,EAAE;gBAC/D,MAAM,GAAG,IAAI,CAAA;aAChB;iBAAM,IAAI,IAAI,KAAK,iBAAiB,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,EAAE;gBAC/D,MAAM,GAAG,IAAI,CAAA;aAChB;iBAAM;gBACH,IAAI,CAAC,KAAK,CAAC,iBAAiB,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;aAC5C;SACJ;QACD,IAAI,CAAC,OAAO,CACR,KAAK,EACL,GAAG,EACH,MAAM,EACN,UAAU,EACV,SAAS,EACT,OAAO,EACP,MAAM,EACN,MAAM,CACT,CAAA;KACJ;IASM,eAAe,CAClB,MAAc,EACd,KAAK,GAAG,CAAC,EACT,MAAc,MAAM,CAAC,MAAM,EAC3B,KAAK,GAAG,KAAK;QAEb,IAAI,CAAC,MAAM,GAAG,KAAK,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAA;QAC/C,IAAI,CAAC,MAAM,GAAG,KAAK,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAA;QAC/C,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAA;QAC9B,IAAI,CAAC,cAAc,EAAE,CAAA;QAErB,IACI,CAAC,IAAI,CAAC,MAAM;YACZ,IAAI,CAAC,WAAW,IAAI,IAAI;YACxB,IAAI,CAAC,WAAW,CAAC,IAAI,GAAG,CAAC,EAC3B;YACE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAA;YAClB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;YAClB,IAAI,CAAC,cAAc,EAAE,CAAA;SACxB;KACJ;IAID,IAAY,MAAM;QACd,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,CAAA;KACtD;IAED,IAAY,WAAW;QACnB,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,IAAI,IAAI,CAAA;KAC3C;IAEO,cAAc,CAAC,KAAa;QAChC,IAAI,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE;YAC9B,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;SACtC;KACJ;IAEO,cAAc,CAAC,KAAa,EAAE,GAAW;QAC7C,IAAI,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE;YAC9B,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;SAC3C;KACJ;IAEO,OAAO,CACX,KAAa,EACb,GAAW,EACX,MAAe,EACf,UAAmB,EACnB,SAAkB,EAClB,OAAgB,EAChB,MAAe,EACf,MAAe;QAEf,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE;YACvB,IAAI,CAAC,QAAQ,CAAC,OAAO,CACjB,KAAK,EACL,GAAG,EACH,MAAM,EACN,UAAU,EACV,SAAS,EACT,OAAO,EACP,MAAM,EACN,MAAM,CACT,CAAA;SACJ;KACJ;IAEO,cAAc,CAAC,KAAa;QAChC,IAAI,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE;YAC9B,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;SACtC;KACJ;IAEO,cAAc,CAAC,KAAa,EAAE,GAAW;QAC7C,IAAI,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE;YAC9B,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;SAC3C;KACJ;IAEO,kBAAkB,CAAC,KAAa;QACpC,IAAI,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE;YAClC,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAA;SAC1C;KACJ;IAEO,kBAAkB,CAAC,KAAa,EAAE,GAAW;QACjD,IAAI,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE;YAClC,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;SAC/C;KACJ;IAEO,kBAAkB,CAAC,KAAa,EAAE,KAAa;QACnD,IAAI,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE;YAClC,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;SACjD;KACJ;IAEO,kBAAkB,CACtB,KAAa,EACb,GAAW,EACX,KAAa;QAEb,IAAI,IAAI,CAAC,QAAQ,CAAC,kBAAkB,EAAE;YAClC,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA;SACtD;KACJ;IAEO,YAAY,CAAC,KAAa;QAC9B,IAAI,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE;YAC5B,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;SACpC;KACJ;IAEO,YAAY,CAAC,KAAa,EAAE,GAAW;QAC3C,IAAI,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE;YAC5B,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;SACzC;KACJ;IAEO,qBAAqB,CAAC,KAAa,EAAE,IAAmB;QAC5D,IAAI,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE;YACrC,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;SACnD;KACJ;IAEO,qBAAqB,CACzB,KAAa,EACb,GAAW,EACX,IAAmB;QAEnB,IAAI,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE;YACrC,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;SACxD;KACJ;IAEO,YAAY,CAChB,KAAa,EACb,GAAW,EACX,GAAW,EACX,GAAW,EACX,MAAe;QAEf,IAAI,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE;YAC5B,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAA;SAC3D;KACJ;IAEO,0BAA0B,CAC9B,KAAa,EACb,IAAgC,EAChC,MAAe;QAEf,IAAI,IAAI,CAAC,QAAQ,CAAC,0BAA0B,EAAE;YAC1C,IAAI,CAAC,QAAQ,CAAC,0BAA0B,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;SAChE;KACJ;IAEO,0BAA0B,CAC9B,KAAa,EACb,GAAW,EACX,IAAgC,EAChC,MAAe;QAEf,IAAI,IAAI,CAAC,QAAQ,CAAC,0BAA0B,EAAE;YAC1C,IAAI,CAAC,QAAQ,CAAC,0BAA0B,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;SACrE;KACJ;IAEO,eAAe,CACnB,KAAa,EACb,GAAW,EACX,IAAqB;QAErB,IAAI,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE;YAC/B,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;SAClD;KACJ;IAEO,uBAAuB,CAC3B,KAAa,EACb,GAAW,EACX,IAAY,EACZ,MAAe;QAEf,IAAI,IAAI,CAAC,QAAQ,CAAC,uBAAuB,EAAE;YACvC,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;SAClE;KACJ;IAEO,iBAAiB,CAAC,KAAa,EAAE,GAAW,EAAE,IAAW;QAC7D,IAAI,IAAI,CAAC,QAAQ,CAAC,iBAAiB,EAAE;YACjC,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;SACpD;KACJ;IAEO,oBAAoB,CACxB,KAAa,EACb,GAAW,EACX,IAAgC,EAChC,MAAe;QAEf,IAAI,IAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE;YACpC,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;SAC/D;KACJ;IAEO,6BAA6B,CACjC,KAAa,EACb,GAAW,EACX,IAAgB,EAChB,GAAW,EACX,KAAoB,EACpB,MAAe;QAEf,IAAI,IAAI,CAAC,QAAQ,CAAC,6BAA6B,EAAE;YAC7C,IAAI,CAAC,QAAQ,CAAC,6BAA6B,CACvC,KAAK,EACL,GAAG,EACH,IAAI,EACJ,GAAG,EACH,KAAK,EACL,MAAM,CACT,CAAA;SACJ;KACJ;IAEO,WAAW,CAAC,KAAa,EAAE,GAAW,EAAE,KAAa;QACzD,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE;YAC3B,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA;SAC/C;KACJ;IAEO,eAAe,CACnB,KAAa,EACb,GAAW,EACX,GAAoB;QAEpB,IAAI,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE;YAC/B,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;SACjD;KACJ;IAEO,qBAAqB,CAAC,KAAa,EAAE,MAAe;QACxD,IAAI,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE;YACrC,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;SACrD;KACJ;IAEO,qBAAqB,CACzB,KAAa,EACb,GAAW,EACX,MAAe;QAEf,IAAI,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE;YACrC,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,CAAA;SAC1D;KACJ;IAEO,qBAAqB,CACzB,KAAa,EACb,GAAW,EACX,GAAW,EACX,GAAW;QAEX,IAAI,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE;YACrC,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;SAC5D;KACJ;IAMD,IAAY,MAAM;QACd,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAA;KAC7B;IAED,IAAY,KAAK;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAA;KAC5B;IAED,IAAY,gBAAgB;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAA;KACvC;IAED,IAAY,aAAa;QACrB,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,CAAA;KACpC;IAED,IAAY,cAAc;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,CAAA;KACrC;IAED,IAAY,cAAc;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,CAAA;KACrC;IAEO,KAAK,CAAC,MAAc,EAAE,KAAa,EAAE,GAAW;QACpD,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;KACtD;IAEO,MAAM,CAAC,KAAa;QACxB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;KAC7B;IAEO,OAAO;QACX,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAA;KACzB;IAEO,GAAG,CAAC,EAAU;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;KAC9B;IAEO,IAAI,CAAC,GAAW,EAAE,GAAW;QACjC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;KACrC;IAEO,IAAI,CAAC,GAAW,EAAE,GAAW,EAAE,GAAW;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;KAC1C;IAIO,KAAK,CAAC,OAAe;QACzB,MAAM,IAAI,iBAAiB,CACvB,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,KAAK,EACV,OAAO,CACV,CAAA;KACJ;IAGO,aAAa;QACjB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,OAAO,GAAG,KAAK,CAAA;QACnB,IAAI,OAAO,GAAG,KAAK,CAAA;QAEnB,SAAS;YACL,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;YAChC,IAAI,EAAE,KAAK,CAAC,CAAC,IAAI,gBAAgB,CAAC,EAAE,CAAC,EAAE;gBACnC,MAAM,IAAI,GAAG,OAAO,GAAG,iBAAiB,GAAG,oBAAoB,CAAA;gBAC/D,IAAI,CAAC,KAAK,CAAC,gBAAgB,IAAI,EAAE,CAAC,CAAA;aACrC;YACD,IAAI,OAAO,EAAE;gBACT,OAAO,GAAG,KAAK,CAAA;aAClB;iBAAM,IAAI,EAAE,KAAK,cAAc,EAAE;gBAC9B,OAAO,GAAG,IAAI,CAAA;aACjB;iBAAM,IAAI,EAAE,KAAK,iBAAiB,EAAE;gBACjC,OAAO,GAAG,IAAI,CAAA;aACjB;iBAAM,IAAI,EAAE,KAAK,kBAAkB,EAAE;gBAClC,OAAO,GAAG,KAAK,CAAA;aAClB;iBAAM,IACH,CAAC,EAAE,KAAK,OAAO,IAAI,CAAC,OAAO;iBAC1B,EAAE,KAAK,QAAQ,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,EAC3C;gBACE,MAAK;aACR;YACD,IAAI,CAAC,OAAO,EAAE,CAAA;SACjB;QAED,OAAO,IAAI,CAAC,KAAK,KAAK,KAAK,CAAA;KAC9B;IASO,cAAc;QAClB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,oBAAoB,EAAE,CAAA;QACtD,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAA;QACxB,IAAI,CAAC,mBAAmB,CAAC,KAAK,EAAE,CAAA;QAEhC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;QAC1B,IAAI,CAAC,kBAAkB,EAAE,CAAA;QAEzB,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAChC,IAAI,IAAI,CAAC,gBAAgB,KAAK,CAAC,CAAC,EAAE;YAC9B,IAAI,EAAE,KAAK,gBAAgB,EAAE;gBACzB,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAA;aAC9B;YACD,IAAI,EAAE,KAAK,cAAc,EAAE;gBACvB,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAA;aACrC;YACD,IAAI,EAAE,KAAK,kBAAkB,IAAI,EAAE,KAAK,iBAAiB,EAAE;gBACvD,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAA;aACzC;YACD,MAAM,CAAC,GAAG,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,CAAA;YAClC,IAAI,CAAC,KAAK,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAA;SAC5C;QACD,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,mBAAmB,EAAE;YACzC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;gBAC7B,IAAI,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAA;aACjD;SACJ;QACD,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;KACzC;IAMO,oBAAoB;QACxB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,OAAO,GAAG,KAAK,CAAA;QACnB,IAAI,OAAO,GAAG,KAAK,CAAA;QACnB,IAAI,KAAK,GAAG,CAAC,CAAA;QACb,IAAI,EAAE,GAAG,CAAC,CAAA;QAEV,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC,gBAAgB,MAAM,CAAC,CAAC,EAAE;YACxC,IAAI,OAAO,EAAE;gBACT,OAAO,GAAG,KAAK,CAAA;aAClB;iBAAM,IAAI,EAAE,KAAK,cAAc,EAAE;gBAC9B,OAAO,GAAG,IAAI,CAAA;aACjB;iBAAM,IAAI,EAAE,KAAK,iBAAiB,EAAE;gBACjC,OAAO,GAAG,IAAI,CAAA;aACjB;iBAAM,IAAI,EAAE,KAAK,kBAAkB,EAAE;gBAClC,OAAO,GAAG,KAAK,CAAA;aAClB;iBAAM,IACH,EAAE,KAAK,eAAe;gBACtB,CAAC,OAAO;iBACP,IAAI,CAAC,aAAa,KAAK,YAAY;qBAC/B,IAAI,CAAC,cAAc,KAAK,YAAY;wBACjC,IAAI,CAAC,cAAc,KAAK,UAAU;wBAClC,IAAI,CAAC,cAAc,KAAK,eAAe,CAAC,CAAC,EACnD;gBACE,KAAK,IAAI,CAAC,CAAA;aACb;YACD,IAAI,CAAC,OAAO,EAAE,CAAA;SACjB;QAED,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QAClB,OAAO,KAAK,CAAA;KACf;IAUO,kBAAkB;QACtB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,CAAC,GAAG,CAAC,CAAA;QAET,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAA;QAC9B,GAAG;YACC,IAAI,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAA;SAC/B,QAAQ,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,EAAC;QAEhC,IAAI,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE;YAC9B,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAA;SAClC;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE;YAC5B,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAA;SACzC;QACD,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;KAC7C;IAUO,kBAAkB,CAAC,CAAS;QAChC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QAExB,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;QACjC,OAAO,IAAI,CAAC,gBAAgB,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE;SAE1D;QACD,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;KAChD;IAmBO,WAAW;QACf,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE;YAC5B,QACI,IAAI,CAAC,gBAAgB,EAAE;iBACtB,IAAI,CAAC,WAAW,EAAE,IAAI,IAAI,CAAC,yBAAyB,EAAE,CAAC,EAC3D;SACJ;QACD,QACI,CAAC,IAAI,CAAC,gBAAgB,EAAE;aACnB,CAAC,IAAI,CAAC,4BAA4B;gBAC/B,IAAI,CAAC,yBAAyB,EAAE,CAAC;aACxC,IAAI,CAAC,mBAAmB,EAAE,IAAI,IAAI,CAAC,yBAAyB,EAAE,CAAC,EACnE;KACJ;IACO,yBAAyB;QAC7B,IAAI,CAAC,iBAAiB,EAAE,CAAA;QACxB,OAAO,IAAI,CAAA;KACd;IAyBO,gBAAgB;QACpB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,CAAC,4BAA4B,GAAG,KAAK,CAAA;QAGzC,IAAI,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE;YAC5B,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;YAChD,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;YACtB,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;YAC9C,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,mBAAmB,CAAC,EAAE;YAChD,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;YAC7D,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,iBAAiB,CAAC,EAAE;YAC9C,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;YAC9D,OAAO,IAAI,CAAA;SACd;QAGD,IAAI,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,EAAE;YAC1C,MAAM,UAAU,GACZ,IAAI,CAAC,WAAW,IAAI,IAAI,IAAI,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;YACtD,IAAI,MAAM,GAAG,KAAK,CAAA;YAClB,IAAI,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,EAAE;gBAC9D,MAAM,IAAI,GAAG,UAAU,GAAG,YAAY,GAAG,WAAW,CAAA;gBACpD,IAAI,CAAC,0BAA0B,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;gBACpD,IAAI,CAAC,kBAAkB,EAAE,CAAA;gBACzB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE;oBAC7B,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAA;iBACnC;gBACD,IAAI,CAAC,4BAA4B,GAAG,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,MAAM,CAAA;gBAC/D,IAAI,CAAC,0BAA0B,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;gBAChE,OAAO,IAAI,CAAA;aACd;YACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QAED,OAAO,KAAK,CAAA;KACf;IAmBO,iBAAiB,CAAC,SAAS,GAAG,KAAK;QACvC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,GAAG,GAAG,CAAC,CAAA;QACX,IAAI,GAAG,GAAG,CAAC,CAAA;QACX,IAAI,MAAM,GAAG,KAAK,CAAA;QAGlB,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;YACpB,GAAG,GAAG,CAAC,CAAA;YACP,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAA;SACjC;aAAM,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;YAC3B,GAAG,GAAG,CAAC,CAAA;YACP,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAA;SACjC;aAAM,IAAI,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;YAC/B,GAAG,GAAG,CAAC,CAAA;YACP,GAAG,GAAG,CAAC,CAAA;SACV;aAAM,IAAI,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,EAAE;YAC5C,GAAG,GAAG,IAAI,CAAC,aAAa,CAAA;YACxB,GAAG,GAAG,IAAI,CAAC,aAAa,CAAA;SAC3B;aAAM;YACH,OAAO,KAAK,CAAA;SACf;QAGD,MAAM,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;QAEhC,IAAI,CAAC,SAAS,EAAE;YACZ,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAA;SACzD;QACD,OAAO,IAAI,CAAA;KACd;IAaO,mBAAmB,CAAC,OAAgB;QACxC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE;YAC5B,IAAI,CAAC,aAAa,GAAG,CAAC,CAAA;YACtB,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,iBAAiB,CAAA;YAC7C,IAAI,IAAI,CAAC,gBAAgB,EAAE,EAAE;gBACzB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAA;gBAC5D,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;oBACjB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,gBAAgB,EAAE;0BACtC,IAAI,CAAC,aAAa;0BAClB,MAAM,CAAC,iBAAiB,CAAA;iBACjC;gBACD,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;oBAC7B,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,EAAE;wBACrD,IAAI,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAA;qBACtD;oBACD,OAAO,IAAI,CAAA;iBACd;aACJ;YACD,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,EAAE;gBAC1C,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAA;aACtC;YACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QACD,OAAO,KAAK,CAAA;KACf;IAeO,WAAW;QACf,QACI,IAAI,CAAC,uBAAuB,EAAE;YAC9B,IAAI,CAAC,UAAU,EAAE;YACjB,IAAI,CAAC,+BAA+B,EAAE;YACtC,IAAI,CAAC,qBAAqB,EAAE;YAC5B,IAAI,CAAC,uBAAuB,EAAE;YAC9B,IAAI,CAAC,qBAAqB,EAAE,EAC/B;KACJ;IASO,UAAU;QACd,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;YACpB,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;YACzD,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IASO,+BAA+B;QACnC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE;YAC1B,IAAI,IAAI,CAAC,iBAAiB,EAAE,EAAE;gBAC1B,OAAO,IAAI,CAAA;aACd;YACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QACD,OAAO,KAAK,CAAA;KACf;IASO,uBAAuB;QAC3B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,YAAY,EAAE,KAAK,CAAC,EAAE;YACjD,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;YACxB,IAAI,CAAC,kBAAkB,EAAE,CAAA;YACzB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE;gBAC7B,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAA;aACnC;YACD,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;YACpC,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IASO,qBAAqB;QACzB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE;YAC3B,IAAI,IAAI,GAAkB,IAAI,CAAA;YAC9B,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,EAAE;gBAC1B,IAAI,IAAI,CAAC,qBAAqB,EAAE,EAAE;oBAC9B,IAAI,GAAG,IAAI,CAAC,aAAa,CAAA;iBAC5B;aACJ;iBAAM,IAAI,IAAI,CAAC,gBAAgB,KAAK,YAAY,EAAE;gBAC/C,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAA;aAC9B;YAED,IAAI,CAAC,qBAAqB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;YACvC,IAAI,CAAC,kBAAkB,EAAE,CAAA;YACzB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE;gBAC7B,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAA;aACnC;YACD,IAAI,CAAC,qBAAqB,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;YAEnD,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAkBO,mBAAmB;QACvB,QACI,IAAI,CAAC,UAAU,EAAE;YACjB,IAAI,CAAC,+BAA+B,EAAE;YACtC,IAAI,CAAC,gCAAgC,EAAE;YACvC,IAAI,CAAC,qBAAqB,EAAE;YAC5B,IAAI,CAAC,uBAAuB,EAAE;YAC9B,IAAI,CAAC,qBAAqB,EAAE;YAC5B,IAAI,CAAC,8BAA8B,EAAE;YACrC,IAAI,CAAC,+BAA+B,EAAE,EACzC;KACJ;IASO,gCAAgC;QACpC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IACI,IAAI,CAAC,gBAAgB,KAAK,cAAc;YACxC,IAAI,CAAC,aAAa,KAAK,iBAAiB,EAC1C;YACE,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,gBAAgB,CAAA;YAC1C,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,cAAc,CAAC,CAAA;YACnD,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAaO,8BAA8B;QAClC,IAAI,IAAI,CAAC,mBAAmB,CAAgB,IAAI,CAAC,EAAE;YAC/C,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAA;SAClC;QACD,OAAO,KAAK,CAAA;KACf;IAWO,uBAAuB;QAC3B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAChC,IAAI,EAAE,KAAK,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC,EAAE;YACrC,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;YACvC,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAWO,+BAA+B;QACnC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAChC,IACI,EAAE,KAAK,CAAC,CAAC;YACT,EAAE,KAAK,gBAAgB;YACvB,EAAE,KAAK,UAAU;YACjB,EAAE,KAAK,cAAc;YACrB,EAAE,KAAK,QAAQ;YACf,EAAE,KAAK,QAAQ;YACf,EAAE,KAAK,QAAQ;YACf,EAAE,KAAK,YAAY;YACnB,EAAE,KAAK,eAAe;YACtB,EAAE,KAAK,gBAAgB;YACvB,EAAE,KAAK,iBAAiB;YACxB,EAAE,KAAK,YAAY,EACrB;YACE,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;YACvC,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAYO,qBAAqB;QACzB,IAAI,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;YACxB,IAAI,IAAI,CAAC,YAAY,EAAE,EAAE;gBACrB,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE;oBAC3C,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;oBACxC,OAAO,IAAI,CAAA;iBACd;gBACD,IAAI,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAA;aAC7C;YACD,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAA;SAC9B;QACD,OAAO,KAAK,CAAA;KACf;IAiBO,iBAAiB;QACrB,IACI,IAAI,CAAC,oBAAoB,EAAE;YAC3B,IAAI,CAAC,2BAA2B,EAAE;YAClC,IAAI,CAAC,sBAAsB,EAAE;aAC5B,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC,EAC3C;YACE,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE;YAC5B,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAA;SAC/B;QACD,OAAO,KAAK,CAAA;KACf;IAWO,oBAAoB;QACxB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,IAAI,CAAC,gBAAgB,EAAE,EAAE;YACzB,MAAM,CAAC,GAAG,IAAI,CAAC,aAAa,CAAA;YAC5B,IAAI,CAAC,IAAI,IAAI,CAAC,mBAAmB,EAAE;gBAC/B,IAAI,CAAC,eAAe,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;gBAC9C,OAAO,IAAI,CAAA;aACd;YACD,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE;gBAC5B,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAA;aAC/B;YACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QACD,OAAO,KAAK,CAAA;KACf;IAoBO,2BAA2B;QAC/B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QAExB,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAA;YACvB,IAAI,CAAC,oBAAoB,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,CAAA;YAChE,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE;YAC/B,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAA;YACvB,IAAI,CAAC,oBAAoB,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,CAAA;YAC/D,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAA;YACvB,IAAI,CAAC,oBAAoB,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,CAAA;YAChE,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE;YAC/B,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAA;YACvB,IAAI,CAAC,oBAAoB,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,CAAA;YAC/D,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAA;YACvB,IAAI,CAAC,oBAAoB,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;YAC/D,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE;YAC/B,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAA;YACvB,IAAI,CAAC,oBAAoB,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;YAC9D,OAAO,IAAI,CAAA;SACd;QAED,IAAI,MAAM,GAAG,KAAK,CAAA;QAClB,IACI,IAAI,CAAC,MAAM;YACX,IAAI,CAAC,WAAW,IAAI,IAAI;aACvB,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC;iBACvB,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAC/C;YACE,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAA;YACvB,IACI,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC;gBAC1B,IAAI,CAAC,iCAAiC,EAAE;gBACxC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAC7B;gBACE,IAAI,CAAC,6BAA6B,CAC9B,KAAK,GAAG,CAAC,EACT,IAAI,CAAC,KAAK,EACV,UAAU,EACV,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,aAAa,IAAI,IAAI,EAC1B,MAAM,CACT,CAAA;gBACD,OAAO,IAAI,CAAA;aACd;YACD,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAA;SACtC;QAED,OAAO,KAAK,CAAA;KACf;IAiBO,sBAAsB;QAC1B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IACI,IAAI,CAAC,gBAAgB,EAAE;YACvB,IAAI,CAAC,iBAAiB,EAAE;YACxB,IAAI,CAAC,OAAO,EAAE;YACd,IAAI,CAAC,oBAAoB,EAAE;YAC3B,IAAI,CAAC,8BAA8B,EAAE;aACpC,CAAC,IAAI,CAAC,MAAM;gBACT,CAAC,IAAI,CAAC,MAAM;gBACZ,IAAI,CAAC,4BAA4B,EAAE,CAAC;YACxC,IAAI,CAAC,iBAAiB,EAAE,EAC1B;YACE,IAAI,CAAC,WAAW,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,CAAA;YAC3D,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IASO,iBAAiB;QACrB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,IAAI,CAAC,YAAY,EAAE,EAAE;gBACrB,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,CAAA;gBACpC,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;gBACvC,IAAI,CAAC,eAAe,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;gBACtD,OAAO,IAAI,CAAA;aACd;YACD,IAAI,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAA;SACxC;QACD,OAAO,KAAK,CAAA;KACf;IAYO,qBAAqB;QACzB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAA;YACzC,IAAI,CAAC,qBAAqB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;YACzC,IAAI,CAAC,kBAAkB,EAAE,CAAA;YACzB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC,EAAE;gBAC/B,IAAI,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAA;aAC7C;YACD,IAAI,CAAC,qBAAqB,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;YACrD,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAkBO,kBAAkB;QACtB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAA;QACzC,SAAS;YAEL,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAA;YAC7B,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE;gBAC1B,MAAK;aACR;YACD,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAA;YAG9B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE;gBACxB,SAAQ;aACX;YACD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC,CAAA;YAGzD,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE;gBAC1B,MAAK;aACR;YACD,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAA;YAG9B,IAAI,GAAG,KAAK,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,EAAE;gBAC1B,IAAI,MAAM,EAAE;oBACR,IAAI,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAA;iBACxC;gBACD,SAAQ;aACX;YACD,IAAI,GAAG,GAAG,GAAG,EAAE;gBACX,IAAI,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAA;aACtD;YAED,IAAI,CAAC,qBAAqB,CAAC,UAAU,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;SAC/D;KACJ;IAiBO,gBAAgB;QACpB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAEhC,IAAI,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,cAAc,IAAI,EAAE,KAAK,kBAAkB,EAAE;YACjE,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,aAAa,GAAG,EAAE,CAAA;YACvB,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,CAAA;YACvD,OAAO,IAAI,CAAA;SACd;QAED,IAAI,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE;YAC1B,IAAI,IAAI,CAAC,kBAAkB,EAAE,EAAE;gBAC3B,OAAO,IAAI,CAAA;aACd;YACD,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,gBAAgB,KAAK,iBAAiB,EAAE;gBAC7D,IAAI,CAAC,aAAa,GAAG,cAAc,CAAA;gBACnC,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,CAAA;gBACvD,OAAO,IAAI,CAAA;aACd;YACD,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE;gBAC5B,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAA;aAC/B;YACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QAED,OAAO,KAAK,CAAA;KACf;IAmBO,kBAAkB;QACtB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QAGxB,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,CAAC,aAAa,GAAG,SAAS,CAAA;YAC9B,IAAI,CAAC,WAAW,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,CAAA;YAC3D,OAAO,IAAI,CAAA;SACd;QAGD,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE;YACtC,IAAI,CAAC,aAAa,GAAG,WAAW,CAAA;YAChC,IAAI,CAAC,WAAW,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,CAAA;YAC3D,OAAO,IAAI,CAAA;SACd;QAGD,IAAI,EAAE,GAAG,CAAC,CAAA;QACV,IACI,CAAC,IAAI,CAAC,MAAM;YACZ,CAAC,IAAI,CAAC,MAAM;YACZ,IAAI,CAAC,gBAAgB,KAAK,iBAAiB;aAC1C,cAAc,EAAE,EAAE,GAAG,IAAI,CAAC,aAAa,EAAE,IAAI,EAAE,KAAK,OAAO,CAAC,EAC/D;YACE,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,aAAa,GAAG,EAAE,GAAG,IAAI,CAAA;YAC9B,IAAI,CAAC,WAAW,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,CAAA;YAC3D,OAAO,IAAI,CAAA;SACd;QAED,QACI,IAAI,CAAC,2BAA2B,EAAE,IAAI,IAAI,CAAC,sBAAsB,EAAE,EACtE;KACJ;IAWO,YAAY;QAChB,IAAI,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;YACxB,IAAI,IAAI,CAAC,uBAAuB,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE;gBAC7D,OAAO,IAAI,CAAA;aACd;YACD,IAAI,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAA;SAC3C;QACD,OAAO,KAAK,CAAA;KACf;IAaO,uBAAuB;QAC3B,IAAI,IAAI,CAAC,wBAAwB,EAAE,EAAE;YACjC,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;YAC7D,OAAO,IAAI,CAAC,uBAAuB,EAAE,EAAE;gBACnC,IAAI,CAAC,aAAa,IAAI,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;aACjE;YACD,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAgBO,wBAAwB;QAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,MAAM,UAAU,GAAG,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAA;QAC3D,IAAI,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAC9B,IAAI,CAAC,OAAO,EAAE,CAAA;QAEd,IACI,EAAE,KAAK,cAAc;YACrB,IAAI,CAAC,8BAA8B,CAAC,UAAU,CAAC,EACjD;YACE,EAAE,GAAG,IAAI,CAAC,aAAa,CAAA;SAC1B;aAAM,IACH,UAAU;YACV,eAAe,CAAC,EAAE,CAAC;YACnB,gBAAgB,CAAC,IAAI,CAAC,gBAAgB,CAAC,EACzC;YACE,EAAE,GAAG,oBAAoB,CAAC,EAAE,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAA;YACpD,IAAI,CAAC,OAAO,EAAE,CAAA;SACjB;QAED,IAAI,uBAAuB,CAAC,EAAE,CAAC,EAAE;YAC7B,IAAI,CAAC,aAAa,GAAG,EAAE,CAAA;YACvB,OAAO,IAAI,CAAA;SACd;QAED,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,EAAE;YACtB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QACD,OAAO,KAAK,CAAA;KACf;IAkBO,uBAAuB;QAC3B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,MAAM,UAAU,GAAG,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAA;QAC3D,IAAI,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAC9B,IAAI,CAAC,OAAO,EAAE,CAAA;QAEd,IACI,EAAE,KAAK,cAAc;YACrB,IAAI,CAAC,8BAA8B,CAAC,UAAU,CAAC,EACjD;YACE,EAAE,GAAG,IAAI,CAAC,aAAa,CAAA;SAC1B;aAAM,IACH,UAAU;YACV,eAAe,CAAC,EAAE,CAAC;YACnB,gBAAgB,CAAC,IAAI,CAAC,gBAAgB,CAAC,EACzC;YACE,EAAE,GAAG,oBAAoB,CAAC,EAAE,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAA;YACpD,IAAI,CAAC,OAAO,EAAE,CAAA;SACjB;QAED,IAAI,sBAAsB,CAAC,EAAE,CAAC,EAAE;YAC5B,IAAI,CAAC,aAAa,GAAG,EAAE,CAAA;YACvB,OAAO,IAAI,CAAA;SACd;QAED,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,EAAE;YACtB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QACD,OAAO,KAAK,CAAA;KACf;IAUO,iBAAiB;QACrB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,IAAI,CAAC,gBAAgB,EAAE,EAAE;gBACzB,OAAO,IAAI,CAAA;aACd;YACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QACD,OAAO,KAAK,CAAA;KACf;IAUO,OAAO;QACX,IACI,IAAI,CAAC,gBAAgB,KAAK,SAAS;YACnC,CAAC,cAAc,CAAC,IAAI,CAAC,aAAa,CAAC,EACrC;YACE,IAAI,CAAC,aAAa,GAAG,CAAC,CAAA;YACtB,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAYO,gBAAgB;QACpB,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAA;YAC7B,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAA;YAC7B,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,CAAC,aAAa,GAAG,cAAc,CAAA;YACnC,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,CAAC,aAAa,GAAG,mBAAmB,CAAA;YACxC,OAAO,IAAI,CAAA;SACd;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,CAAC,aAAa,GAAG,cAAc,CAAA;YACnC,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAaO,gBAAgB;QACpB,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAChC,IAAI,aAAa,CAAC,EAAE,CAAC,EAAE;YACnB,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,aAAa,GAAG,EAAE,GAAG,IAAI,CAAA;YAC9B,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAiBO,8BAA8B,CAAC,UAAU,GAAG,KAAK;QACrD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,MAAM,KAAK,GAAG,UAAU,IAAI,IAAI,CAAC,MAAM,CAAA;QAEvC,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IACI,CAAC,KAAK,IAAI,IAAI,CAAC,mCAAmC,EAAE;gBACpD,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC;iBACxB,KAAK,IAAI,IAAI,CAAC,+BAA+B,EAAE,CAAC,EACnD;gBACE,OAAO,IAAI,CAAA;aACd;YACD,IAAI,IAAI,CAAC,MAAM,IAAI,KAAK,EAAE;gBACtB,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAA;aACvC;YACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QAED,OAAO,KAAK,CAAA;KACf;IAUO,mCAAmC;QACvC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QAExB,IAAI,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE;YAC3B,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAA;YAC/B,IACI,eAAe,CAAC,IAAI,CAAC;gBACrB,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC;gBACxB,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC;gBAC3B,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAC3B;gBACE,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,CAAA;gBAChC,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;oBACzB,IAAI,CAAC,aAAa,GAAG,oBAAoB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;oBACtD,OAAO,IAAI,CAAA;iBACd;aACJ;YAED,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QAED,OAAO,KAAK,CAAA;KACf;IAUO,+BAA+B;QACnC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QAExB,IACI,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC;YAC1B,IAAI,CAAC,YAAY,EAAE;YACnB,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC;YAC3B,cAAc,CAAC,IAAI,CAAC,aAAa,CAAC,EACpC;YACE,OAAO,IAAI,CAAA;SACd;QAED,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QAClB,OAAO,KAAK,CAAA;KACf;IAkBO,iBAAiB;QACrB,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAChC,IAAI,IAAI,CAAC,qBAAqB,CAAC,EAAE,CAAC,EAAE;YAChC,IAAI,CAAC,aAAa,GAAG,EAAE,CAAA;YACvB,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IACO,qBAAqB,CAAC,EAAU;QACpC,IAAI,EAAE,KAAK,CAAC,CAAC,EAAE;YACX,OAAO,KAAK,CAAA;SACf;QACD,IAAI,IAAI,CAAC,MAAM,EAAE;YACb,OAAO,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,OAAO,CAAA;SACjD;QACD,IAAI,IAAI,CAAC,MAAM,EAAE;YACb,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC,CAAA;SAC3B;QACD,IAAI,IAAI,CAAC,MAAM,EAAE;YACb,OAAO,EAAE,EAAE,KAAK,iBAAiB,IAAI,EAAE,KAAK,iBAAiB,CAAC,CAAA;SACjE;QACD,OAAO,EAAE,KAAK,iBAAiB,CAAA;KAClC;IAYO,gBAAgB;QACpB,IAAI,CAAC,aAAa,GAAG,CAAC,CAAA;QACtB,IAAI,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAC9B,IAAI,EAAE,IAAI,QAAQ,IAAI,EAAE,IAAI,SAAS,EAAE;YACnC,GAAG;gBACC,IAAI,CAAC,aAAa,GAAG,EAAE,GAAG,IAAI,CAAC,aAAa,IAAI,EAAE,GAAG,SAAS,CAAC,CAAA;gBAC/D,IAAI,CAAC,OAAO,EAAE,CAAA;aACjB,QACG,CAAC,EAAE,GAAG,IAAI,CAAC,gBAAgB,KAAK,SAAS;gBACzC,EAAE,IAAI,SAAS,EAClB;YACD,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAcO,iCAAiC;QACrC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QAGxB,IAAI,IAAI,CAAC,sBAAsB,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;YACvD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAA;YACvC,IAAI,IAAI,CAAC,uBAAuB,EAAE,EAAE;gBAChC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAA;gBACvC,IACI,sBAAsB,CAClB,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,aAAa,CACrB,EACH;oBACE,OAAO,IAAI,CAAA;iBACd;gBACD,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAA;aACtC;SACJ;QACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QAGlB,IAAI,IAAI,CAAC,iCAAiC,EAAE,EAAE;YAC1C,MAAM,WAAW,GAAG,IAAI,CAAC,aAAa,CAAA;YACtC,IACI,sBAAsB,CAClB,IAAI,CAAC,WAAW,EAChB,kBAAkB,EAClB,WAAW,CACd,EACH;gBACE,IAAI,CAAC,aAAa,GAAG,kBAAkB,CAAA;gBACvC,IAAI,CAAC,aAAa,GAAG,WAAW,CAAA;gBAChC,OAAO,IAAI,CAAA;aACd;YACD,IAAI,0BAA0B,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE;gBAC3D,IAAI,CAAC,aAAa,GAAG,WAAW,CAAA;gBAChC,IAAI,CAAC,aAAa,GAAG,EAAE,CAAA;gBACvB,OAAO,IAAI,CAAA;aACd;YACD,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAA;SACtC;QACD,OAAO,KAAK,CAAA;KACf;IAYO,sBAAsB;QAC1B,IAAI,CAAC,aAAa,GAAG,EAAE,CAAA;QACvB,OAAO,8BAA8B,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE;YAC1D,IAAI,CAAC,aAAa,IAAI,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;YACjE,IAAI,CAAC,OAAO,EAAE,CAAA;SACjB;QACD,OAAO,IAAI,CAAC,aAAa,KAAK,EAAE,CAAA;KACnC;IAYO,uBAAuB;QAC3B,IAAI,CAAC,aAAa,GAAG,EAAE,CAAA;QACvB,OAAO,+BAA+B,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE;YAC3D,IAAI,CAAC,aAAa,IAAI,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;YACjE,IAAI,CAAC,OAAO,EAAE,CAAA;SACjB;QACD,OAAO,IAAI,CAAC,aAAa,KAAK,EAAE,CAAA;KACnC;IAYO,iCAAiC;QACrC,OAAO,IAAI,CAAC,uBAAuB,EAAE,CAAA;KACxC;IAaO,oBAAoB;QACxB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;YAC7B,IAAI,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE;gBAC3B,OAAO,IAAI,CAAA;aACd;YACD,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE;gBAC5B,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAA;aAC/B;YACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;SACrB;QACD,OAAO,KAAK,CAAA;KACf;IAcO,gBAAgB;QACpB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QAExB,IAAI,CAAC,aAAa,GAAG,CAAC,CAAA;QACtB,OAAO,cAAc,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE;YAC1C,IAAI,CAAC,aAAa;gBACd,EAAE,GAAG,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;YAC/D,IAAI,CAAC,OAAO,EAAE,CAAA;SACjB;QAED,OAAO,IAAI,CAAC,KAAK,KAAK,KAAK,CAAA;KAC9B;IAcO,YAAY;QAChB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,CAAC,aAAa,GAAG,CAAC,CAAA;QACtB,OAAO,UAAU,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE;YACtC,IAAI,CAAC,aAAa;gBACd,EAAE,GAAG,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;YAC/D,IAAI,CAAC,OAAO,EAAE,CAAA;SACjB;QACD,OAAO,IAAI,CAAC,KAAK,KAAK,KAAK,CAAA;KAC9B;IAoBO,4BAA4B;QAChC,IAAI,IAAI,CAAC,aAAa,EAAE,EAAE;YACtB,MAAM,EAAE,GAAG,IAAI,CAAC,aAAa,CAAA;YAC7B,IAAI,IAAI,CAAC,aAAa,EAAE,EAAE;gBACtB,MAAM,EAAE,GAAG,IAAI,CAAC,aAAa,CAAA;gBAC7B,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,aAAa,EAAE,EAAE;oBACjC,IAAI,CAAC,aAAa,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,aAAa,CAAA;iBAC7D;qBAAM;oBACH,IAAI,CAAC,aAAa,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,CAAA;iBACnC;aACJ;iBAAM;gBACH,IAAI,CAAC,aAAa,GAAG,EAAE,CAAA;aAC1B;YACD,OAAO,IAAI,CAAA;SACd;QACD,OAAO,KAAK,CAAA;KACf;IAWO,aAAa;QACjB,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;QAChC,IAAI,YAAY,CAAC,EAAE,CAAC,EAAE;YAClB,IAAI,CAAC,OAAO,EAAE,CAAA;YACd,IAAI,CAAC,aAAa,GAAG,EAAE,GAAG,SAAS,CAAA;YACnC,OAAO,IAAI,CAAA;SACd;QACD,IAAI,CAAC,aAAa,GAAG,CAAC,CAAA;QACtB,OAAO,KAAK,CAAA;KACf;IAYO,iBAAiB,CAAC,MAAc;QACpC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACxB,IAAI,CAAC,aAAa,GAAG,CAAC,CAAA;QACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,EAAE,CAAC,EAAE;YAC7B,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAA;YAChC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE;gBACjB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;gBAClB,OAAO,KAAK,CAAA;aACf;YACD,IAAI,CAAC,aAAa,GAAG,EAAE,GAAG,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,EAAE,CAAC,CAAA;YAC7D,IAAI,CAAC,OAAO,EAAE,CAAA;SACjB;QACD,OAAO,IAAI,CAAA;KACd;CACJ;;ACv4ED,MAAM,YAAY,GAAY,EAAS,CAAA;AACvC,MAAM,UAAU,GAAU,EAAS,CAAA;AACnC,MAAM,mBAAmB,GAAmB,EAAS,CAAA;AAErD,MAAM,iBAAiB;IAUnB,YAAmB,OAA8B;QAPzC,UAAK,GAAmB,YAAY,CAAA;QACpC,WAAM,GAAU,UAAU,CAAA;QAC1B,oBAAe,GAAoB,EAAE,CAAA;QACrC,qBAAgB,GAAqB,EAAE,CAAA;QAExC,WAAM,GAAG,EAAE,CAAA;QAGd,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,CAAA;QAChD,IAAI,CAAC,WAAW,GAAG,CAAC,OAAO,IAAI,OAAO,CAAC,WAAW,KAAK,IAAI,CAAA;KAC9D;IAED,IAAW,OAAO;QACd,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QACD,OAAO,IAAI,CAAC,KAAK,CAAA;KACpB;IAED,IAAW,KAAK;QACZ,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,OAAO,EAAE;YAC9B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QACD,OAAO,IAAI,CAAC,MAAM,CAAA;KACrB;IAEM,OAAO,CACV,KAAa,EACb,GAAW,EACX,MAAe,EACf,UAAmB,EACnB,SAAkB,EAClB,OAAgB,EAChB,MAAe,EACf,MAAe;QAEf,IAAI,CAAC,MAAM,GAAG;YACV,IAAI,EAAE,OAAO;YACb,MAAM,EAAE,IAAI;YACZ,KAAK;YACL,GAAG;YACH,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;YAClC,MAAM;YACN,UAAU;YACV,SAAS;YACT,OAAO;YACP,MAAM;YACN,MAAM;SACT,CAAA;KACJ;IAEM,cAAc,CAAC,KAAa;QAC/B,IAAI,CAAC,KAAK,GAAG;YACT,IAAI,EAAE,SAAS;YACf,MAAM,EAAE,IAAI;YACZ,KAAK;YACL,GAAG,EAAE,KAAK;YACV,GAAG,EAAE,EAAE;YACP,YAAY,EAAE,EAAE;SACnB,CAAA;QACD,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAA;QAC/B,IAAI,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,CAAA;KACnC;IAEM,cAAc,CAAC,KAAa,EAAE,GAAW;QAC5C,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,CAAA;QACpB,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;QAE9C,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,eAAe,EAAE;YAC1C,MAAM,GAAG,GAAG,SAAS,CAAC,GAAG,CAAA;YACzB,MAAM,KAAK,GACP,OAAO,GAAG,KAAK,QAAQ;kBACjB,IAAI,CAAC,gBAAgB,CAAC,GAAG,GAAG,CAAC,CAAC;kBAC9B,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,GAAG,CAAE,CAAA;YAC1D,SAAS,CAAC,QAAQ,GAAG,KAAK,CAAA;YAC1B,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;SACnC;KACJ;IAEM,kBAAkB,CAAC,KAAa;QACnC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IACI,MAAM,CAAC,IAAI,KAAK,WAAW;YAC3B,MAAM,CAAC,IAAI,KAAK,gBAAgB;YAChC,MAAM,CAAC,IAAI,KAAK,OAAO;YACvB,MAAM,CAAC,IAAI,KAAK,SAAS,EAC3B;YACE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,IAAI,CAAC,KAAK,GAAG;YACT,IAAI,EAAE,aAAa;YACnB,MAAM;YACN,KAAK;YACL,GAAG,EAAE,KAAK;YACV,GAAG,EAAE,EAAE;YACP,QAAQ,EAAE,EAAE;SACf,CAAA;QACD,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;KACvC;IAEM,kBAAkB,CAAC,KAAa,EAAE,GAAW;QAChD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAA;QACvB,IAAI,IAAI,CAAC,IAAI,KAAK,aAAa,EAAE;YAC7B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;QACxC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAA;KAC3B;IAEM,YAAY,CAAC,KAAa;QAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,IAAI,CAAC,KAAK,GAAG;YACT,IAAI,EAAE,OAAO;YACb,MAAM;YACN,KAAK;YACL,GAAG,EAAE,KAAK;YACV,GAAG,EAAE,EAAE;YACP,YAAY,EAAE,EAAE;SACnB,CAAA;QACD,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;KACnC;IAEM,YAAY,CAAC,KAAa,EAAE,GAAW;QAC1C,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAA;QACvB,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YAC7D,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;QACxC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAA;KAC3B;IAEM,qBAAqB,CAAC,KAAa,EAAE,IAAmB;QAC3D,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,IAAI,CAAC,KAAK,GAAG;YACT,IAAI,EAAE,gBAAgB;YACtB,MAAM;YACN,KAAK;YACL,GAAG,EAAE,KAAK;YACV,GAAG,EAAE,EAAE;YACP,IAAI;YACJ,YAAY,EAAE,EAAE;YAChB,UAAU,EAAE,EAAE;SACjB,CAAA;QACD,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAChC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;KACzC;IAEM,qBAAqB,CAAC,KAAa,EAAE,GAAW;QACnD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAA;QACvB,IACI,IAAI,CAAC,IAAI,KAAK,gBAAgB;YAC9B,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,aAAa,EACpC;YACE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;QACxC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAA;KAC3B;IAEM,YAAY,CACf,KAAa,EACb,GAAW,EACX,GAAW,EACX,GAAW,EACX,MAAe;QAEf,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAGD,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAA;QACrC,IACI,OAAO,IAAI,IAAI;YACf,OAAO,CAAC,IAAI,KAAK,YAAY;aAC5B,OAAO,CAAC,IAAI,KAAK,WAAW,IAAI,OAAO,CAAC,IAAI,KAAK,WAAW,CAAC,EAChE;YACE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,MAAM,IAAI,GAAe;YACrB,IAAI,EAAE,YAAY;YAClB,MAAM;YACN,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,GAAG;YACH,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;YAC1C,GAAG;YACH,GAAG;YACH,MAAM;YACN,OAAO;SACV,CAAA;QACD,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC1B,OAAO,CAAC,MAAM,GAAG,IAAI,CAAA;KACxB;IAEM,0BAA0B,CAC7B,KAAa,EACb,IAAgC,EAChC,MAAe;QAEf,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,MAAM,IAAI,IAAyB,IAAI,CAAC,KAAK,GAAG;YAC5C,IAAI,EAAE,WAAW;YACjB,MAAM;YACN,KAAK;YACL,GAAG,EAAE,KAAK;YACV,GAAG,EAAE,EAAE;YACP,IAAI;YACJ,MAAM;YACN,YAAY,EAAE,EAAE;SACnB,CAAC,CAAA;QACF,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;KAC7B;IAEM,0BAA0B,CAAC,KAAa,EAAE,GAAW;QACxD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAA;QACvB,IAAI,IAAI,CAAC,IAAI,KAAK,WAAW,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YACjE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;QACxC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAA;KAC3B;IAEM,eAAe,CAClB,KAAa,EACb,GAAW,EACX,IAAqB;QAErB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;YACjB,IAAI,EAAE,WAAW;YACjB,MAAM;YACN,KAAK;YACL,GAAG;YACH,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;YAClC,IAAI;SACP,CAAC,CAAA;KACL;IAEM,uBAAuB,CAC1B,KAAa,EACb,GAAW,EACX,IAAY,EACZ,MAAe;QAEf,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;YACjB,IAAI,EAAE,WAAW;YACjB,MAAM;YACN,KAAK;YACL,GAAG;YACH,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;YAClC,IAAI;YACJ,MAAM;SACT,CAAC,CAAA;KACL;IAEM,iBAAiB,CAAC,KAAa,EAAE,GAAW,EAAE,IAAW;QAC5D,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;YACjB,IAAI,EAAE,cAAc;YACpB,MAAM;YACN,KAAK;YACL,GAAG;YACH,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;YAClC,IAAI;SACP,CAAC,CAAA;KACL;IAEM,oBAAoB,CACvB,KAAa,EACb,GAAW,EACX,IAAgC,EAChC,MAAe;QAEf,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,IAAI,MAAM,CAAC,IAAI,KAAK,gBAAgB,EAAE;YACnE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAEC,MAAM,CAAC,QAAoC,CAAC,IAAI,CAAC;YAC/C,IAAI,EAAE,cAAc;YACpB,MAAM;YACN,KAAK;YACL,GAAG;YACH,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;YAClC,IAAI;YACJ,MAAM;SACT,CAAC,CAAA;KACL;IAEM,6BAA6B,CAChC,KAAa,EACb,GAAW,EACX,IAAgB,EAChB,GAAW,EACX,KAAoB,EACpB,MAAe;QAEf,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,IAAI,MAAM,CAAC,IAAI,KAAK,gBAAgB,EAAE;YACnE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAEC,MAAM,CAAC,QAAoC,CAAC,IAAI,CAAC;YAC/C,IAAI,EAAE,cAAc;YACpB,MAAM;YACN,KAAK;YACL,GAAG;YACH,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;YAClC,IAAI;YACJ,GAAG;YACH,KAAK;YACL,MAAM;SACT,CAAC,CAAA;KACL;IAEM,WAAW,CAAC,KAAa,EAAE,GAAW,EAAE,KAAa;QACxD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,IAAI,MAAM,CAAC,IAAI,KAAK,gBAAgB,EAAE;YACnE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAEC,MAAM,CAAC,QAAoC,CAAC,IAAI,CAAC;YAC/C,IAAI,EAAE,WAAW;YACjB,MAAM;YACN,KAAK;YACL,GAAG;YACH,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;YAClC,KAAK;SACR,CAAC,CAAA;KACL;IAEM,eAAe,CAClB,KAAa,EACb,GAAW,EACX,GAAoB;QAEpB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,MAAM,IAAI,GAAkB;YACxB,IAAI,EAAE,eAAe;YACrB,MAAM;YACN,KAAK;YACL,GAAG;YACH,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;YAClC,GAAG;YACH,QAAQ,EAAE,mBAAmB;SAChC,CAAA;QACD,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC1B,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;KAClC;IAEM,qBAAqB,CAAC,KAAa,EAAE,MAAe;QACvD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,IAAI,CAAC,KAAK,GAAG;YACT,IAAI,EAAE,gBAAgB;YACtB,MAAM;YACN,KAAK;YACL,GAAG,EAAE,KAAK;YACV,GAAG,EAAE,EAAE;YACP,MAAM;YACN,QAAQ,EAAE,EAAE;SACf,CAAA;QACD,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;KACnC;IAEM,qBAAqB,CAAC,KAAa,EAAE,GAAW;QACnD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAA;QACvB,IACI,IAAI,CAAC,IAAI,KAAK,gBAAgB;YAC9B,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,aAAa,EACpC;YACE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;QACxC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAA;KAC3B;IAEM,qBAAqB,CAAC,KAAa,EAAE,GAAW;QACnD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAA;QACzB,IAAI,MAAM,CAAC,IAAI,KAAK,gBAAgB,EAAE;YAClC,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAGD,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAA;QAChC,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAA;QAC1B,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAA;QAC7B,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAA;QAC1B,IACI,CAAC,GAAG;YACJ,CAAC,GAAG;YACJ,CAAC,MAAM;YACP,GAAG,CAAC,IAAI,KAAK,WAAW;YACxB,GAAG,CAAC,IAAI,KAAK,WAAW;YACxB,MAAM,CAAC,IAAI,KAAK,WAAW;YAC3B,MAAM,CAAC,KAAK,KAAK,WAAW,EAC9B;YACE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAClC;QAED,MAAM,IAAI,GAAwB;YAC9B,IAAI,EAAE,qBAAqB;YAC3B,MAAM;YACN,KAAK;YACL,GAAG;YACH,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;YAClC,GAAG;YACH,GAAG;SACN,CAAA;QACD,GAAG,CAAC,MAAM,GAAG,IAAI,CAAA;QACjB,GAAG,CAAC,MAAM,GAAG,IAAI,CAAA;QACjB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;KACtB;CACJ;AAuBD,MAAa,YAAY;IAQrB,YAAmB,OAA8B;QAC7C,IAAI,CAAC,MAAM,GAAG,IAAI,iBAAiB,CAAC,OAAO,CAAC,CAAA;QAC5C,IAAI,CAAC,UAAU,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;KACrD;IASM,YAAY,CACf,MAAc,EACd,KAAK,GAAG,CAAC,EACT,MAAc,MAAM,CAAC,MAAM;QAE3B,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,CAAA;QAC3B,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAA;QACnD,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAA;QACnC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAA;QAC/B,MAAM,OAAO,GAAkB;YAC3B,IAAI,EAAE,eAAe;YACrB,MAAM,EAAE,IAAI;YACZ,KAAK;YACL,GAAG;YACH,GAAG,EAAE,MAAM;YACX,OAAO;YACP,KAAK;SACR,CAAA;QACD,OAAO,CAAC,MAAM,GAAG,OAAO,CAAA;QACxB,KAAK,CAAC,MAAM,GAAG,OAAO,CAAA;QACtB,OAAO,OAAO,CAAA;KACjB;IASM,UAAU,CACb,MAAc,EACd,KAAK,GAAG,CAAC,EACT,MAAc,MAAM,CAAC,MAAM;QAE3B,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,CAAA;QAC3B,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAA;QACjD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAA;KAC3B;IAUM,YAAY,CACf,MAAc,EACd,KAAK,GAAG,CAAC,EACT,MAAc,MAAM,CAAC,MAAM,EAC3B,KAAK,GAAG,KAAK;QAEb,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,CAAA;QAC3B,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA;QAC1D,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAA;KAC7B;CACJ;;MC5jBY,aAAa;IAOtB,YAAmB,QAAgC;QAC/C,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAA;KAC5B;IAMM,KAAK,CAAC,IAAU;QACnB,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;KAClC;IAEO,gBAAgB,CAAC,IAAU,EAAE,OAAe;QAChD,QAAQ,IAAI,CAAC,IAAI;YACb,KAAK,aAAa;gBACd,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;gBACpC,MAAK;YACT,KAAK,WAAW;gBACZ,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;gBAClC,MAAK;YACT,KAAK,eAAe;gBAChB,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;gBACtC,MAAK;YACT,KAAK,gBAAgB;gBACjB,IAAI,CAAC,mBAAmB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;gBACvC,MAAK;YACT,KAAK,WAAW;gBACZ,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;gBAClC,MAAK;YACT,KAAK,gBAAgB;gBACjB,IAAI,CAAC,mBAAmB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;gBACvC,MAAK;YACT,KAAK,qBAAqB;gBACtB,IAAI,CAAC,wBAAwB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;gBAC5C,MAAK;YACT,KAAK,cAAc;gBACf,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;gBACrC,MAAK;YACT,KAAK,OAAO;gBACR,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;gBAC9B,MAAK;YACT,KAAK,OAAO;gBACR,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;gBAC9B,MAAK;YACT,KAAK,SAAS;gBACV,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;gBAChC,MAAK;YACT,KAAK,YAAY;gBACb,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;gBACnC,MAAK;YACT,KAAK,eAAe;gBAChB,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;gBACtC,MAAK;YACT;gBACI,MAAM,IAAI,KAAK,CAAC,iBAAkB,IAAY,CAAC,IAAI,EAAE,CAAC,CAAA;SAC7D;KACJ;IAEO,gBAAgB,CAAC,IAAiB,EAAE,OAAe;QACvD,IAAI,IAAI,CAAC,SAAS,CAAC,kBAAkB,EAAE;YACnC,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;SACnD;QACD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAClB,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE;YAC/B,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;SACxC;QACD,OAAO,CAAC,GAAG,EAAE,CAAA;QACb,IAAI,IAAI,CAAC,SAAS,CAAC,kBAAkB,EAAE;YACnC,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;SACnD;KACJ;IACO,cAAc,CAAC,IAAe,EAAE,OAAe;QACnD,IAAI,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE;YACjC,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;SACjD;QACD,IAAI,IAAI,CAAC,IAAI,KAAK,WAAW,IAAI,IAAI,CAAC,IAAI,KAAK,YAAY,EAAE;YACzD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAClB,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,YAAY,EAAE;gBACnC,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;aACxC;YACD,OAAO,CAAC,GAAG,EAAE,CAAA;SAChB;QACD,IAAI,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE;YACjC,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;SACjD;KACJ;IACO,kBAAkB,CAAC,IAAmB,EAAE,OAAe;QAC3D,IAAI,IAAI,CAAC,SAAS,CAAC,oBAAoB,EAAE;YACrC,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;SACrD;QACD,IAAI,IAAI,CAAC,SAAS,CAAC,oBAAoB,EAAE;YACrC,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;SACrD;KACJ;IACO,mBAAmB,CAAC,IAAoB,EAAE,OAAe;QAC7D,IAAI,IAAI,CAAC,SAAS,CAAC,qBAAqB,EAAE;YACtC,IAAI,CAAC,SAAS,CAAC,qBAAqB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;SACtD;QACD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAClB,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,YAAY,EAAE;YACnC,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;SACxC;QACD,OAAO,CAAC,GAAG,EAAE,CAAA;QACb,IAAI,IAAI,CAAC,SAAS,CAAC,qBAAqB,EAAE;YACtC,IAAI,CAAC,SAAS,CAAC,qBAAqB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;SACtD;KACJ;IACO,cAAc,CAAC,IAAe,EAAE,OAAe;QACnD,IAAI,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE;YACjC,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;SACjD;QACD,IAAI,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE;YACjC,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;SACjD;KACJ;IACO,mBAAmB,CAAC,IAAoB,EAAE,OAAe;QAC7D,IAAI,IAAI,CAAC,SAAS,CAAC,qBAAqB,EAAE;YACtC,IAAI,CAAC,SAAS,CAAC,qBAAqB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;SACtD;QACD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAClB,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE;YAC/B,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;SACxC;QACD,OAAO,CAAC,GAAG,EAAE,CAAA;QACb,IAAI,IAAI,CAAC,SAAS,CAAC,qBAAqB,EAAE;YACtC,IAAI,CAAC,SAAS,CAAC,qBAAqB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;SACtD;KACJ;IACO,wBAAwB,CAC5B,IAAyB,EACzB,OAAe;QAEf,IAAI,IAAI,CAAC,SAAS,CAAC,0BAA0B,EAAE;YAC3C,IAAI,CAAC,SAAS,CAAC,0BAA0B,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;SAC3D;QACD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAClB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;QACtC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;QACtC,OAAO,CAAC,GAAG,EAAE,CAAA;QACb,IAAI,IAAI,CAAC,SAAS,CAAC,0BAA0B,EAAE;YAC3C,IAAI,CAAC,SAAS,CAAC,0BAA0B,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;SAC3D;KACJ;IACO,iBAAiB,CAAC,IAAkB,EAAE,OAAe;QACzD,IAAI,IAAI,CAAC,SAAS,CAAC,mBAAmB,EAAE;YACpC,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;SACpD;QACD,IAAI,IAAI,CAAC,SAAS,CAAC,mBAAmB,EAAE;YACpC,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;SACpD;KACJ;IACO,UAAU,CAAC,IAAW,EAAE,OAAe;QAC3C,IAAI,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE;YAC7B,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;SAC7C;QACD,IAAI,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE;YAC7B,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;SAC7C;KACJ;IACO,UAAU,CAAC,IAAW,EAAE,OAAe;QAC3C,IAAI,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE;YAC7B,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;SAC7C;QACD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAClB,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,YAAY,EAAE;YACnC,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;SACxC;QACD,OAAO,CAAC,GAAG,EAAE,CAAA;QACb,IAAI,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE;YAC7B,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;SAC7C;KACJ;IACO,YAAY,CAAC,IAAa,EAAE,OAAe;QAC/C,IAAI,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE;YAC/B,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;SAC/C;QACD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAClB,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,YAAY,EAAE;YACnC,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;SACxC;QACD,OAAO,CAAC,GAAG,EAAE,CAAA;QACb,IAAI,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE;YAC/B,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;SAC/C;KACJ;IACO,eAAe,CAAC,IAAgB,EAAE,OAAe;QACrD,IAAI,IAAI,CAAC,SAAS,CAAC,iBAAiB,EAAE;YAClC,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;SAClD;QACD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAClB,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QAC5C,OAAO,CAAC,GAAG,EAAE,CAAA;QACb,IAAI,IAAI,CAAC,SAAS,CAAC,iBAAiB,EAAE;YAClC,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;SAClD;KACJ;IACO,kBAAkB,CAAC,IAAmB,EAAE,OAAe;QAC3D,IAAI,IAAI,CAAC,SAAS,CAAC,oBAAoB,EAAE;YACrC,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;SACrD;QACD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAClB,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QAC5C,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;QAC1C,OAAO,CAAC,GAAG,EAAE,CAAA;QACb,IAAI,IAAI,CAAC,SAAS,CAAC,oBAAoB,EAAE;YACrC,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;SACrD;KACJ;CACJ;;SC9Ne,kBAAkB,CAC9B,MAAuB,EACvB,OAA8B;IAE9B,OAAO,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAA;AACjE,CAAC;AAOD,SAAgB,qBAAqB,CACjC,MAAc,EACd,OAAiC;IAEjC,OAAO,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC,CAAA;AAC/D,CAAC;AAED,SAAgB,cAAc,CAC1B,IAAc,EACd,QAAgC;IAEhC,IAAI,aAAa,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;AAC3C,CAAC;;;;"}MIT License Copyright (c) 2018 Toru Nagashima Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "vscode-regexpp", "version": "3.1.0", "description": "Regular expression parser for ECMAScript.", "engines": { "node": ">=8" }, "main": "index", "files": [ "index.*" ], "dependencies": {}, "devDependencies": { "@mysticatea/eslint-plugin": "^11.0.0", "@types/eslint": "^4.16.2", "@types/jsdom": "^12.2.4", "@types/mocha": "^5.2.2", "@types/node": "^12.6.8", "codecov": "^3.5.0", "dts-bundle": "^0.7.3", "eslint": "^6.1.0", "jsdom": "^15.1.1", "mocha": "^6.2.0", "npm-run-all": "^4.1.5", "nyc": "^14.1.1", "rimraf": "^2.6.2", "rollup": "^1.17.0", "rollup-plugin-node-resolve": "^5.2.0", "rollup-plugin-sourcemaps": "^0.4.2", "ts-node": "^8.3.0", "typescript": "^3.5.3" }, "scripts": { "prebuild": "npm run -s clean", "prepack": "run-s clean build", "build": "run-s build:*", "build:tsc": "tsc --module es2015", "build:rollup": "rollup -c", "build:dts": "dts-bundle --name vscode-regexpp --main .temp/index.d.ts --out ../index.d.ts", "clean": "rimraf .temp index.*", "codecov": "nyc report -r lcovonly && codecov -t ${CODECOV_TOKEN} --disable=gcov", "lint": "eslint scripts src test --ext .ts", "pretest": "run-s build lint", "test": "nyc _mocha \"test/*.ts\" --reporter dot --timeout 10000", "update:test": "ts-node scripts/update-fixtures.ts", "update:unicode": "run-s update:unicode:*", "update:unicode:ids": "ts-node scripts/update-unicode-ids.ts", "update:unicode:props": "ts-node scripts/update-unicode-properties.ts", "preversion": "npm test", "version": "npm run -s build", "postversion": "git push && git push --tags", "prewatch": "npm run -s clean", "watch": "_mocha \"test/*.ts\" --require ts-node/register --reporter dot --timeout 10000 --watch-extensions ts --watch --growl" }, "repository": { "type": "git", "url": "git+https://github.com/mysticatea/regexpp.git" }, "keywords": [ "regexp", "regular", "expression", "parser", "validator", "ast", "abstract", "syntax", "tree", "ecmascript", "es2015", "es2016", "es2017", "es2018", "es2019", "es2020", "annexB" ], "author": "Toru Nagashima (https://github.com/mysticatea)", "license": "MIT", "bugs": { "url": "https://github.com/mysticatea/regexpp/issues" }, "homepage": "https://github.com/mysticatea/regexpp#readme", "funding": "https://github.com/sponsors/mysticatea" } The MIT License (MIT) Copyright (c) Microsoft Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "vscode-textmate", "version": "7.0.1", "description": "VSCode TextMate grammar helpers", "author": { "name": "Microsoft Corporation" }, "main": "./release/main.js", "typings": "./release/main.d.ts", "repository": { "type": "git", "url": "https://github.com/microsoft/vscode-textmate" }, "license": "MIT", "bugs": { "url": "https://github.com/microsoft/vscode-textmate/issues" }, "scripts": { "watch": "tsc --watch", "compile": "tsc", "test": "mocha --ui=tdd ./out/tests/all.test.js", "benchmark": "node benchmark/benchmark.js", "inspect": "node out/tests/inspect.js", "tmconvert": "node scripts/tmconvert.js", "version": "npm run compile && npm run test && node scripts/release.js", "postversion": "git push && git push --tags", "prepublishOnly": "tsc && webpack --progress && node scripts/release.js" }, "devDependencies": { "@types/node": "^16.6.1", "@types/mocha": "^9.1.0", "mocha": "^9.2.2", "typescript": "^4.3.5", "vscode-oniguruma": "^1.5.1", "webpack": "^5.50.0", "webpack-cli": "^4.8.0" } } ## Security Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below. ## Reporting Security Issues **Please do not report security vulnerabilities through public GitHub issues.** Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) * Full paths of source file(s) related to the manifestation of the issue * The location of the affected source code (tag/branch/commit or direct URL) * Any special configuration required to reproduce the issue * Step-by-step instructions to reproduce the issue * Proof-of-concept or exploit code (if possible) * Impact of the issue, including how an attacker might exploit the issue This information will help us triage your report more quickly. If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. ## Preferred Languages We prefer all communications to be in English. ## Policy Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.vscodetextmate=t():e.vscodetextmate=t()}(this,(function(){return(()=>{"use strict";var e={350:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UseOnigurumaFindOptions=t.DebugFlags=void 0,t.DebugFlags={InDebugMode:"undefined"!=typeof process&&!!process.env.VSCODE_TEXTMATE_DEBUG},t.UseOnigurumaFindOptions=!1},527:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BalancedBracketSelectors=t.LocalStackElement=t.StackElement=t.ScopeListElement=t.StackElementMetadata=t.Grammar=t.ScopeMetadata=t.ScopeDependencyProcessor=t.ScopeDependencyCollector=t.PartialScopeDependency=t.FullScopeDependency=t.createGrammar=void 0;var r=n(878),o=n(792),i=n(736),s=n(350),a="undefined"==typeof performance?function(){return Date.now()}:function(){return performance.now()};t.createGrammar=function(e,t,n,r,o,i,s,a){return new C(e,t,n,r,o,i,s,a)};var c=function(e){this.scopeName=e};t.FullScopeDependency=c;var u=function(){function e(e,t){this.scopeName=e,this.include=t}return e.prototype.toKey=function(){return"".concat(this.scopeName,"#").concat(this.include)},e}();t.PartialScopeDependency=u;var l=function(){function e(){this.full=[],this.partial=[],this.visitedRule=new Set,this._seenFull=new Set,this._seenPartial=new Set}return e.prototype.add=function(e){e instanceof c?this._seenFull.has(e.scopeName)||(this._seenFull.add(e.scopeName),this.full.push(e)):this._seenPartial.has(e.toKey())||(this._seenPartial.add(e.toKey()),this.partial.push(e))},e}();function h(e,t,n,o,i){for(var s=0,a=o;s=0){var _=d.substring(0,m),y=d.substring(m+1);_===t.scopeName?f(e,t,t,y,p):_===n.scopeName?f(e,t,n,y,p):e.add(new u(_,d.substring(m+1)))}else e.add(new c(d))}}}}t.ScopeDependencyCollector=l;var p=function(){function e(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests=new Set,this.seenPartialScopeRequests=new Set,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new c(this.initialScopeName)]}return e.prototype.processQueue=function(){var e=this.Q;this.Q=[];for(var t=new l,n=0,r=e;n"))}function f(e,t,n,r,o){void 0===o&&(o=n.repository),o&&o[r]&&h(e,t,n,[o[r]],o)}function g(e,t,n){if(n.patterns&&Array.isArray(n.patterns)&&h(e,t,n,n.patterns,n.repository),n.injections){var r=[];for(var o in n.injections)r.push(n.injections[o]);h(e,t,n,r,n.repository)}}function m(e,t){if(!e)return!1;if(e===t)return!0;var n=t.length;return e.length>n&&e.substr(0,n)===t&&"."===e[n]}function _(e,t){if(t.length>")}var u=Object.keys(this._embeddedLanguages).map((function(t){return e._escapeRegExpCharacters(t)}));0===u.length?this._embeddedLanguagesRegex=null:(u.sort(),u.reverse(),this._embeddedLanguagesRegex=new RegExp("^((".concat(u.join(")|("),"))($|\\.)"),""))}return e.prototype.onDidChangeTheme=function(){this._cache=new Map,this._defaultMetaData=new v("",this._initialLanguage,8,[this._themeProvider.getDefaults()])},e.prototype.getDefaultMetadata=function(){return this._defaultMetaData},e._escapeRegExpCharacters=function(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")},e.prototype.getMetadataForScope=function(t){if(null===t)return e._NULL_SCOPE_METADATA;var n=this._cache.get(t);return n||(n=this._doGetMetadataForScope(t),this._cache.set(t,n),n)},e.prototype._doGetMetadataForScope=function(e){var t=this._scopeToLanguage(e),n=this._toStandardTokenType(e),r=this._themeProvider.themeMatch(e);return new v(e,t,n,r)},e.prototype._scopeToLanguage=function(e){if(!e)return 0;if(!this._embeddedLanguagesRegex)return 0;var t=e.match(this._embeddedLanguagesRegex);return t&&(this._embeddedLanguages[t[1]]||0)||0},e.prototype._toStandardTokenType=function(t){var n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")},e._NULL_SCOPE_METADATA=new v("",0,0,null),e.STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/,e}(),C=function(){function e(e,t,n,r,o,s,a,c){if(this.balancedBracketSelectors=s,this._scopeName=e,this._scopeMetadataProvider=new b(n,a,r),this._onigLib=c,this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=a,this._grammar=k(t,null),this._injections=null,this._tokenTypeMatchers=[],o)for(var u=0,l=Object.keys(o);u0)){console.log("Grammar ".concat(this._scopeName," contains the following injections:"));for(var e=0,t=this._injections;el)break;for(;u.length>0&&u[u.length-1].endPos<=d.start;)o.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?o.produceFromScopes(u[u.length-1].scopes,d.start):o.produce(r,d.start),p.retokenizeCapturedWithRuleId){var f=p.getName(a,s),g=r.contentNameScopesList.push(e,f),m=p.getContentName(a,s),_=g.push(e,m),y=r.push(p.retokenizeCapturedWithRuleId,d.start,-1,!1,null,g,_),v=e.createOnigString(a.substring(0,d.end));T(e,v,n&&0===d.start,d.start,y,o,!1,0),S(v)}else{var b=p.getName(a,s);if(null!==b){var C=(u.length>0?u[u.length-1].scopes:r.contentNameScopesList).push(e,b);u.push(new N(C,d.end))}}}}}for(;u.length>0;)o.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}}function w(e){for(var t=[],n=0,r=e.rules.length;nr&&(r=m.captureIndices[0].end,n=!1))}return{stack:i,linePos:r,anchorPosition:c,isFirstLine:n}}(e,t,n,r,i,c);i=f.stack,r=f.linePos,n=f.isFirstLine,d=f.anchorPosition}for(var g=Date.now();!p;){if(0!==l&&Date.now()-g>l)return new x(i,!0);m()}return new x(i,!1);function m(){s.DebugFlags.InDebugMode&&(console.log(""),console.log("@@scanNext ".concat(r,": |").concat(t.content.substr(r).replace(/\n$/,"\\n"),"|")));var u=function(e,t,n,r,o,i){var c=function(e,t,n,r,o,i){var c=o.getRule(e),u=A(c,e,o.endRule,n,r===i),l=u.ruleScanner,h=u.findOptions,p=0;s.DebugFlags.InDebugMode&&(p=a());var d=l.scanner.findNextMatchSync(t,r,h);if(s.DebugFlags.InDebugMode){var f=a()-p;f>5&&console.warn("Rule ".concat(c.debugName," (").concat(c.id,") matching took ").concat(f," against '").concat(t,"'")),console.log(" scanning for (linePos: ".concat(r,", anchorPosition: ").concat(i,")")),console.log(w(l)),d&&console.log("matched rule id: ".concat(l.rules[d.index]," from ").concat(d.captureIndices[0].start," to ").concat(d.captureIndices[0].end))}return d?{captureIndices:d.captureIndices,matchedRuleId:l.rules[d.index]}:null}(e,t,n,r,o,i),u=e.getInjections();if(0===u.length)return c;var l=function(e,t,n,r,o,i,a){for(var c,u=Number.MAX_VALUE,l=null,h=0,p=i.contentNameScopesList.generateScopes(),d=0,f=e.length;d=u)&&(u=b,l=v.captureIndices,c=_.rules[v.index],h=g.priority,u===o))break}}}return l?{priorityMatch:-1===h,captureIndices:l,matchedRuleId:c}:null}(u,e,t,n,r,o,i);if(!l)return c;if(!c)return l;var h=c.captureIndices[0].start,p=l.captureIndices[0].start;return p0)&&l[0].end>r;if(-1===f){var m=i.getRule(e);s.DebugFlags.InDebugMode&&console.log(" popping "+m.debugName+" - "+m.debugEndRegExp),c.produce(i,l[0].start),i=i.setContentNameScopesList(i.nameScopesList),R(e,t,n,i,c,m.endCaptures,l),c.produce(i,l[0].end);var _=i;if(i=i.pop(),d=_.getAnchorPos(),!g&&_.getEnterPos()===r)return s.DebugFlags.InDebugMode&&console.error("[1] - Grammar is in an endless loop - Grammar pushed & popped a rule without advancing"),i=_,c.produce(i,h),void(p=!0)}else{var y=e.getRule(f);c.produce(i,l[0].start);var v=i,b=y.getName(t.content,l),C=i.contentNameScopesList.push(e,b);if(i=i.push(f,r,d,l[0].end===h,null,C,C),y instanceof o.BeginEndRule){var S=y;s.DebugFlags.InDebugMode&&console.log(" pushing "+S.debugName+" - "+S.debugBeginRegExp),R(e,t,n,i,c,S.beginCaptures,l),c.produce(i,l[0].end),d=l[0].end;var k=S.getContentName(t.content,l),P=C.push(e,k);if(i=i.setContentNameScopesList(P),S.endHasBackReferences&&(i=i.setEndRule(S.getEndWithResolvedBackReferences(t.content,l))),!g&&v.hasSameRuleAs(i))return s.DebugFlags.InDebugMode&&console.error("[2] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),i=i.pop(),c.produce(i,h),void(p=!0)}else if(y instanceof o.BeginWhileRule){if(S=y,s.DebugFlags.InDebugMode&&console.log(" pushing "+S.debugName),R(e,t,n,i,c,S.beginCaptures,l),c.produce(i,l[0].end),d=l[0].end,k=S.getContentName(t.content,l),P=C.push(e,k),i=i.setContentNameScopesList(P),S.whileHasBackReferences&&(i=i.setEndRule(S.getWhileWithResolvedBackReferences(t.content,l))),!g&&v.hasSameRuleAs(i))return s.DebugFlags.InDebugMode&&console.error("[3] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),i=i.pop(),c.produce(i,h),void(p=!0)}else{var I=y;if(s.DebugFlags.InDebugMode&&console.log(" matched "+I.debugName+" - "+I.debugMatchRegExp),R(e,t,n,i,c,I.captures,l),c.produce(i,l[0].end),i=i.pop(),!g)return s.DebugFlags.InDebugMode&&console.error("[4] - Grammar is in an endless loop - Grammar is not advancing, nor is it pushing/popping"),i=i.safePop(),c.produce(i,h),void(p=!0)}}l[0].end>r&&(r=l[0].end,n=!1)}}var G=function(){function e(){}return e.toBinaryStr=function(e){for(var t=e.toString(2);t.length<32;)t="0"+t;return t},e.printMetadata=function(t){var n=e.getLanguageId(t),r=e.getTokenType(t),o=e.getFontStyle(t),i=e.getForeground(t),s=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:o,foreground:i,background:s})},e.getLanguageId=function(e){return(255&e)>>>0},e.getTokenType=function(e){return(768&e)>>>8},e.containsBalancedBrackets=function(e){return 0!=(1024&e)},e.getFontStyle=function(e){return(30720&e)>>>11},e.getForeground=function(e){return(16744448&e)>>>15},e.getBackground=function(e){return(4278190080&e)>>>24},e.set=function(t,n,r,o,i,s,a){var c=e.getLanguageId(t),u=e.getTokenType(t),l=e.containsBalancedBrackets(t)?1:0,h=e.getFontStyle(t),p=e.getForeground(t),d=e.getBackground(t);return 0!==n&&(c=n),8!==r&&(u=r),null!==o&&(l=o?1:0),-1!==i&&(h=i),0!==s&&(p=s),0!==a&&(d=a),(c<<0|u<<8|l<<10|h<<11|p<<15|d<<24)>>>0},e}();t.StackElementMetadata=G;var M=function(){function e(e,t,n){this.parent=e,this.scope=t,this.metadata=n}return e._equals=function(e,t){for(;;){if(e===t)return!0;if(!e&&!t)return!0;if(!e||!t)return!1;if(e.scope!==t.scope||e.metadata!==t.metadata)return!1;e=e.parent,t=t.parent}},e.prototype.equals=function(t){return e._equals(this,t)},e._matchesScope=function(e,t,n){return t===e||e.substring(0,n.length)===n},e._matches=function(e,t){if(null===t)return!0;for(var n=t.length,r=0,o=t[r],i=o+".";e;){if(this._matchesScope(e.scope,o,i)){if(++r===n)return!0;i=(o=t[r])+"."}e=e.parent}return!1},e.mergeMetadata=function(e,t,n){if(null===n)return e;var r=-1,o=0,i=0;if(null!==n.themeData)for(var s=0,a=n.themeData.length;s=0?e._push(this,t,n.split(/ /g)):e._push(this,t,[n])},e._generateScopes=function(e){for(var t=[],n=0;e;)t[n++]=e.scope,e=e.parent;return t.reverse(),t},e.prototype.generateScopes=function(){return e._generateScopes(this)},e}();t.ScopeListElement=M;var E=function(){function e(e,t,n,r,o,i,s,a){this._stackElementBrand=void 0,this.parent=e,this.depth=this.parent?this.parent.depth+1:1,this.ruleId=t,this._enterPos=n,this._anchorPos=r,this.beginRuleCapturedEOL=o,this.endRule=i,this.nameScopesList=s,this.contentNameScopesList=a}return e._structuralEquals=function(e,t){for(;;){if(e===t)return!0;if(!e&&!t)return!0;if(!e||!t)return!1;if(e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}},e._equals=function(e,t){return e===t||!!this._structuralEquals(e,t)&&e.contentNameScopesList.equals(t.contentNameScopesList)},e.prototype.clone=function(){return this},e.prototype.equals=function(t){return null!==t&&e._equals(this,t)},e._reset=function(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent},e.prototype.reset=function(){e._reset(this)},e.prototype.pop=function(){return this.parent},e.prototype.safePop=function(){return this.parent?this.parent:this},e.prototype.push=function(t,n,r,o,i,s,a){return new e(this,t,n,r,o,i,s,a)},e.prototype.getEnterPos=function(){return this._enterPos},e.prototype.getAnchorPos=function(){return this._anchorPos},e.prototype.getRule=function(e){return e.getRule(this.ruleId)},e.prototype._writeString=function(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]="(".concat(this.ruleId,", TODO-").concat(this.nameScopesList,", TODO-").concat(this.contentNameScopesList,")"),t},e.prototype.toString=function(){var e=[];return this._writeString(e,0),"["+e.join(",")+"]"},e.prototype.setContentNameScopesList=function(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)},e.prototype.setEndRule=function(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)},e.prototype.hasSameRuleAs=function(e){for(var t=this;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1},e.NULL=new e(null,0,0,0,!1,null,null,null),e}();t.StackElement=E;var N=function(e,t){this.scopes=e,this.endPos=t};t.LocalStackElement=N;var L=function(){function e(e,t){var n=this;this.allowAny=!1,this.balancedBracketScopes=e.flatMap((function(e){return"*"===e?(n.allowAny=!0,[]):(0,i.createMatchers)(e,_).map((function(e){return e.matcher}))})),this.unbalancedBracketScopes=t.flatMap((function(e){return(0,i.createMatchers)(e,_).map((function(e){return e.matcher}))}))}return Object.defineProperty(e.prototype,"matchesAlways",{get:function(){return this.allowAny&&0===this.unbalancedBracketScopes.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"matchesNever",{get:function(){return 0===this.balancedBracketScopes.length&&!this.allowAny},enumerable:!1,configurable:!0}),e.prototype.match=function(e){for(var t=0,n=this.unbalancedBracketScopes;t=t)){if(this._emitBinaryTokens){var r=e.metadata,o=!1;if((null===(n=this.balancedBracketSelectors)||void 0===n?void 0:n.matchesAlways)&&(o=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){for(var i=e.generateScopes(),a=0,c=this._tokenTypeOverrides;a0&&this._binaryTokens[this._binaryTokens.length-1]===r)return void(this._lastTokenEndIndex=t);if(s.DebugFlags.InDebugMode){var l=e.generateScopes();console.log(" token: |"+this._lineText.substring(this._lastTokenEndIndex,t).replace(/\n$/,"\\n")+"|");for(var h=0;h0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),0===this._tokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens},e.prototype.getBinaryResult=function(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),0===this._binaryTokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);for(var n=new Uint32Array(this._binaryTokens.length),r=0,o=this._binaryTokens.length;r{Object.defineProperty(t,"__esModule",{value:!0}),t.parseRawGrammar=void 0;var r=n(69),o=n(350),i=n(974);t.parseRawGrammar=function(e,t){return void 0===t&&(t=null),null!==t&&/\.json$/.test(t)?(n=e,s=t,o.DebugFlags.InDebugMode?(0,i.parse)(n,s,!0):JSON.parse(n)):function(e,t){return o.DebugFlags.InDebugMode?r.parseWithLocation(e,t,"$vscodeTextmateLocation"):r.parse(e)}(e,t);var n,s}},974:(e,t)=>{function n(e,t){throw new Error("Near offset "+e.pos+": "+t+" ~~~"+e.source.substr(e.pos,50)+"~~~")}Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0,t.parse=function(e,t,s){var a=new r(e),c=new o,u=0,l=null,h=[],p=[];function d(){h.push(u),p.push(l)}function f(){u=h.pop(),l=p.pop()}function g(e){n(a,e)}for(;i(a,c);){if(0===u){if(null!==l&&g("too many constructs in root"),3===c.type){l={},s&&(l.$vscodeTextmateLocation=c.toLocation(t)),d(),u=1;continue}if(2===c.type){l=[],d(),u=4;continue}g("unexpected token in root")}if(2===u){if(5===c.type){f();continue}if(7===c.type){u=3;continue}g("expected , or }")}if(1===u||3===u){if(1===u&&5===c.type){f();continue}if(1===c.type){var m=c.value;if(i(a,c)&&6===c.type||g("expected colon"),i(a,c)||g("expected value"),u=2,1===c.type){l[m]=c.value;continue}if(8===c.type){l[m]=null;continue}if(9===c.type){l[m]=!0;continue}if(10===c.type){l[m]=!1;continue}if(11===c.type){l[m]=parseFloat(c.value);continue}if(2===c.type){var _=[];l[m]=_,d(),u=4,l=_;continue}if(3===c.type){var y={};s&&(y.$vscodeTextmateLocation=c.toLocation(t)),l[m]=y,d(),u=1,l=y;continue}}g("unexpected token in dict")}if(5===u){if(4===c.type){f();continue}if(7===c.type){u=6;continue}g("expected , or ]")}if(4===u||6===u){if(4===u&&4===c.type){f();continue}if(u=5,1===c.type){l.push(c.value);continue}if(8===c.type){l.push(null);continue}if(9===c.type){l.push(!0);continue}if(10===c.type){l.push(!1);continue}if(11===c.type){l.push(parseFloat(c.value));continue}if(2===c.type){_=[],l.push(_),d(),u=4,l=_;continue}if(3===c.type){y={},s&&(y.$vscodeTextmateLocation=c.toLocation(t)),l.push(y),d(),u=1,l=y;continue}g("unexpected token in array")}g("unknown state")}return 0!==p.length&&g("unclosed constructs"),l};var r=function(e){this.source=e,this.pos=0,this.len=e.length,this.line=1,this.char=0},o=function(){function e(){this.value=null,this.type=0,this.offset=-1,this.len=-1,this.line=-1,this.char=-1}return e.prototype.toLocation=function(e){return{filename:e,line:this.line,char:this.char}},e}();function i(e,t){t.value=null,t.type=0,t.offset=-1,t.len=-1,t.line=-1,t.char=-1;for(var r,o=e.source,i=e.pos,s=e.len,a=e.line,c=e.char;;){if(i>=s)return!1;if(32!==(r=o.charCodeAt(i))&&9!==r&&13!==r){if(10!==r)break;i++,a++,c=0}else i++,c++}if(t.offset=i,t.line=a,t.char=c,34===r){for(t.type=1,i++,c++;;){if(i>=s)return!1;if(r=o.charCodeAt(i),i++,c++,92!==r){if(34===r)break}else i++,c++}t.value=o.substring(t.offset+1,i-1).replace(/\\u([0-9A-Fa-f]{4})/g,(function(e,t){return String.fromCodePoint(parseInt(t,16))})).replace(/\\(.)/g,(function(t,r){switch(r){case'"':return'"';case"\\":return"\\";case"/":return"/";case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";default:n(e,"invalid escape sequence")}throw new Error("unreachable")}))}else if(91===r)t.type=2,i++,c++;else if(123===r)t.type=3,i++,c++;else if(93===r)t.type=4,i++,c++;else if(125===r)t.type=5,i++,c++;else if(58===r)t.type=6,i++,c++;else if(44===r)t.type=7,i++,c++;else if(110===r){if(t.type=8,i++,c++,117!==(r=o.charCodeAt(i)))return!1;if(i++,c++,108!==(r=o.charCodeAt(i)))return!1;if(i++,c++,108!==(r=o.charCodeAt(i)))return!1;i++,c++}else if(116===r){if(t.type=9,i++,c++,114!==(r=o.charCodeAt(i)))return!1;if(i++,c++,117!==(r=o.charCodeAt(i)))return!1;if(i++,c++,101!==(r=o.charCodeAt(i)))return!1;i++,c++}else if(102===r){if(t.type=10,i++,c++,97!==(r=o.charCodeAt(i)))return!1;if(i++,c++,108!==(r=o.charCodeAt(i)))return!1;if(i++,c++,115!==(r=o.charCodeAt(i)))return!1;if(i++,c++,101!==(r=o.charCodeAt(i)))return!1;i++,c++}else for(t.type=11;;){if(i>=s)return!1;if(!(46===(r=o.charCodeAt(i))||r>=48&&r<=57||101===r||69===r||45===r||43===r))break;i++,c++}return t.len=i-t.offset,null===t.value&&(t.value=o.substr(t.offset,t.len)),e.pos=i,e.line=a,e.char=c,!0}},787:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)},i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0?[4,Promise.all(i.Q.map((function(e){return a._loadSingleGrammar(e.scopeName)})))]:[3,3];case 2:return s.sent(),i.processQueue(),[3,1];case 3:return[2,this._grammarForScopeName(e,t,n,r,o)]}}))}))},e.prototype.addGrammar=function(e,t,n,r){return void 0===t&&(t=[]),void 0===n&&(n=0),void 0===r&&(r=null),i(this,void 0,void 0,(function(){return s(this,(function(o){switch(o.label){case 0:return this._syncRegistry.addGrammar(e,t),[4,this._grammarForScopeName(e.scopeName,n,r)];case 1:return[2,o.sent()]}}))}))},e.prototype._grammarForScopeName=function(e,t,n,r,o){return void 0===t&&(t=0),void 0===n&&(n=null),void 0===r&&(r=null),void 0===o&&(o=null),this._syncRegistry.grammarForScopeName(e,t,n,r,o)},e}();t.Registry=h,t.INITIAL=l.StackElement.NULL,t.parseRawGrammar=c.parseRawGrammar},736:(e,t)=>{function n(e){return!!e&&!!e.match(/[\w\.:]+/)}Object.defineProperty(t,"__esModule",{value:!0}),t.createMatchers=void 0,t.createMatchers=function(e,t){for(var r,o,i,s=[],a=(i=(o=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g).exec(r=e),{next:function(){if(!i)return null;var e=i[0];return i=o.exec(r),e}}),c=a.next();null!==c;){var u=0;if(2===c.length&&":"===c.charAt(1)){switch(c.charAt(0)){case"R":u=1;break;case"L":u=-1;break;default:console.log("Unknown priority ".concat(c," in scope selector"))}c=a.next()}var l=p();if(s.push({matcher:l,priority:u}),","!==c)break;c=a.next()}return s;function h(){if("-"===c){c=a.next();var e=h();return function(t){return!!e&&!e(t)}}if("("===c){c=a.next();var r=function(){for(var e=[],t=p();t&&(e.push(t),"|"===c||","===c);){do{c=a.next()}while("|"===c||","===c);t=p()}return function(t){return e.some((function(e){return e(t)}))}}();return")"===c&&(c=a.next()),r}if(n(c)){var o=[];do{o.push(c),c=a.next()}while(n(c));return function(e){return t(o,e)}}return null}function p(){for(var e=[],t=h();t;)e.push(t),t=h();return function(t){return e.every((function(e){return e(t)}))}}}},69:(e,t)=>{function n(e,t,n){var r=e.length,o=0,i=1,s=0;function a(t){if(null===n)o+=t;else for(;t>0;)10===e.charCodeAt(o)?(o++,i++,s=0):(o++,s++),t--}function c(e){null===n?o=e:a(e-o)}function u(){for(;o0&&65279===e.charCodeAt(0)&&(o=1);var d=0,f=null,g=[],m=[],_=null;function y(e,t){g.push(d),m.push(f),d=e,f=t}function v(){if(0===g.length)return b("illegal state stack");d=g.pop(),f=m.pop()}function b(t){throw new Error("Near offset "+o+": "+t+" ~~~"+e.substr(o,50)+"~~~")}var C,S,k,R,w,P=function(){if(null===_)return b("missing ");var e={};null!==n&&(e[n]={filename:t,line:i,char:s}),f[_]=e,_=null,y(1,e)},A=function(){if(null===_)return b("missing ");var e=[];f[_]=e,_=null,y(2,e)};function I(){if(1!==d)return b("unexpected ");v()}function x(){return 1===d||2!==d?b("unexpected "):void v()}function T(e){if(1===d){if(null===_)return b("missing ");f[_]=e,_=null}else 2===d?f.push(e):f=e}function G(e){if(isNaN(e))return b("cannot parse float");if(1===d){if(null===_)return b("missing ");f[_]=e,_=null}else 2===d?f.push(e):f=e}function M(e){if(isNaN(e))return b("cannot parse integer");if(1===d){if(null===_)return b("missing ");f[_]=e,_=null}else 2===d?f.push(e):f=e}function E(e){if(1===d){if(null===_)return b("missing ");f[_]=e,_=null}else 2===d?f.push(e):f=e}function N(e){if(1===d){if(null===_)return b("missing ");f[_]=e,_=null}else 2===d?f.push(e):f=e}function L(e){if(1===d){if(null===_)return b("missing ");f[_]=e,_=null}else 2===d?f.push(e):f=e}function O(e){if(e.isClosed)return"";var t=p(""),t.replace(/&#([0-9]+);/g,(function(e,t){return String.fromCodePoint(parseInt(t,10))})).replace(/&#x([0-9a-f]+);/g,(function(e,t){return String.fromCodePoint(parseInt(t,16))})).replace(/&|<|>|"|'/g,(function(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case""":return'"';case"'":return"'"}return e}))}for(;o=r));){var D=e.charCodeAt(o);if(a(1),60!==D)return b("expected <");if(o>=r)return b("unexpected end of input");var F=e.charCodeAt(o);if(63!==F)if(33!==F){if(47===F){if(a(1),u(),l("plist")){h(">");continue}if(l("dict")){h(">"),I();continue}if(l("array")){h(">"),x();continue}return b("unexpected closed tag")}var j=(S=void 0,k=void 0,k=!1,47===(S=p(">")).charCodeAt(S.length-1)&&(k=!0,S=S.substring(0,S.length-1)),{name:S.trim(),isClosed:k});switch(j.name){case"dict":1===d?P():2===d?(w=void 0,w={},null!==n&&(w[n]={filename:t,line:i,char:s}),f.push(w),y(1,w)):(f={},null!==n&&(f[n]={filename:t,line:i,char:s}),y(1,f)),j.isClosed&&I();continue;case"array":1===d?A():2===d?(R=void 0,R=[],f.push(R),y(2,R)):y(2,f=[]),j.isClosed&&x();continue;case"key":C=O(j),1!==d?b("unexpected "):null!==_?b("too many "):_=C;continue;case"string":T(O(j));continue;case"real":G(parseFloat(O(j)));continue;case"integer":M(parseInt(O(j),10));continue;case"date":E(new Date(O(j)));continue;case"data":N(O(j));continue;case"true":O(j),L(!0);continue;case"false":O(j),L(!1);continue}if(!/^plist/.test(j.name))return b("unexpected opened tag "+j.name)}else{if(a(1),l("--")){h("--\x3e");continue}h(">")}else a(1),h("?>")}return f}Object.defineProperty(t,"__esModule",{value:!0}),t.parse=t.parseWithLocation=void 0,t.parseWithLocation=function(e,t,r){return n(e,t,r)},t.parse=function(e){return n(e,null,null)}},652:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]i&&(i=c);for(var a=0;a<=i;a++)o[a]=null;for(var s in t)if("$vscodeTextmateLocation"!==s){var c=parseInt(s,10),u=0;t[s].patterns&&(u=e.getCompiledRuleId(t[s],n,r)),o[c]=e.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,u)}}return o},e._compilePatterns=function(t,n,r){var o=[];if(t)for(var i=0,s=t.length;i=0?(l=a.include.substring(0,p),h=a.include.substring(p+1)):l=a.include;var d=n.getExternalGrammar(l,r);if(d)if(h){var _=d.repository[h];_&&(c=e.getCompiledRuleId(_,n,d.repository))}else c=e.getCompiledRuleId(d.repository.$self,n,d.repository)}else c=e.getCompiledRuleId(a,n,r);if(-1!==c){var y=n.getRule(c),v=!1;if((y instanceof f||y instanceof g||y instanceof m)&&y.hasMissingPatterns&&0===y.patterns.length&&(v=!0),v)continue;o.push(c)}}return{patterns:o,hasMissingPatterns:(t?t.length:0)!==o.length}},e}();t.RuleFactory=_},583:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ThemeTrieElement=t.ThemeTrieElementRule=t.strArrCmp=t.strcmp=t.Theme=t.ColorMap=t.parseTheme=t.ParsedThemeRule=void 0;var n=function(e,t,n,r,o,i){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=o,this.background=i};function r(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function o(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];for(var t=e.settings,o=[],i=0,s=0,a=t.length;s1&&(_=g.slice(0,g.length-1)).reverse(),o[i++]=new n(m,_,s,l,d,f)}}}return o}function i(e,t){e.sort((function(e,t){var n=c(e.scope,t.scope);return 0!==n||0!==(n=u(e.parentScopes,t.parentScopes))?n:e.index-t.index}));for(var n=0,r="#000000",o="#ffffff";e.length>=1&&""===e[0].scope;){var i=e.shift();-1!==i.fontStyle&&(n=i.fontStyle),null!==i.foreground&&(r=i.foreground),null!==i.background&&(o=i.background)}for(var p=new s(t),d=new l(0,null,n,p.getId(r),p.getId(o)),f=new h(new l(0,null,-1,0,0),[]),g=0,m=e.length;gt?1:0}function u(e,t){if(null===e&&null===t)return 0;if(!e)return-1;if(!t)return 1;var n=e.length,r=t.length;if(n===r){for(var o=0;oe?console.log("how did this happen?"):this.scopeDepth=e,-1!==t&&(this.fontStyle=t),0!==n&&(this.foreground=n),0!==r&&(this.background=r)},e}();t.ThemeTrieElementRule=l;var h=function(){function e(e,t,n){void 0===t&&(t=[]),void 0===n&&(n={}),this._mainRule=e,this._rulesWithParentScopes=t,this._children=n}return e._sortBySpecificity=function(e){return 1===e.length||e.sort(this._cmpBySpecificity),e},e._cmpBySpecificity=function(e,t){if(e.scopeDepth===t.scopeDepth){var n=e.parentScopes,r=t.parentScopes,o=null===n?0:n.length,i=null===r?0:r.length;if(o===i)for(var s=0;s{Object.defineProperty(t,"__esModule",{value:!0})},878:(e,t)=>{function n(e){return Array.isArray(e)?function(e){for(var t=[],r=0,o=e.length;r{"use strict";var e={4567:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AccessibilityManager=void 0;const s=i(9042),r=i(6114),n=i(9924),o=i(3656),a=i(844),h=i(5596),c=i(9631);class l extends a.Disposable{constructor(e,t){super(),this._terminal=e,this._renderService=t,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityTreeRoot=document.createElement("div"),this._accessibilityTreeRoot.classList.add("xterm-accessibility"),this._accessibilityTreeRoot.tabIndex=0,this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let e=0;ethis._handleBoundaryFocus(e,0),this._bottomBoundaryFocusListener=e=>this._handleBoundaryFocus(e,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityTreeRoot.appendChild(this._rowContainer),this._renderRowsDebouncer=new n.TimeBasedDebouncer(this._renderRows.bind(this)),this._refreshRows(),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityTreeRoot.appendChild(this._liveRegion),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityTreeRoot),this.register(this._renderRowsDebouncer),this.register(this._terminal.onResize((e=>this._handleResize(e.rows)))),this.register(this._terminal.onRender((e=>this._refreshRows(e.start,e.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((e=>this._handleChar(e)))),this.register(this._terminal.onLineFeed((()=>this._handleChar("\n")))),this.register(this._terminal.onA11yTab((e=>this._handleTab(e)))),this.register(this._terminal.onKey((e=>this._handleKey(e.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this._screenDprMonitor=new h.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener((()=>this._refreshRowsDimensions())),this.register((0,o.addDisposableDomListener)(window,"resize",(()=>this._refreshRowsDimensions()))),this.register((0,a.toDisposable)((()=>{(0,c.removeElementFromParent)(this._accessibilityTreeRoot),this._rowElements.length=0})))}_handleBoundaryFocus(e,t){const i=e.target,s=this._rowElements[0===t?1:this._rowElements.length-2];if(i.getAttribute("aria-posinset")===(0===t?"1":`${this._terminal.buffer.lines.length}`))return;if(e.relatedTarget!==s)return;let r,n;if(0===t?(r=i,n=this._rowElements.pop(),this._rowContainer.removeChild(n)):(r=this._rowElements.shift(),n=i,this._rowContainer.removeChild(r)),r.removeEventListener("focus",this._topBoundaryFocusListener),n.removeEventListener("focus",this._bottomBoundaryFocusListener),0===t){const e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement("afterbegin",e)}else{const e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(0===t?-1:1),this._rowElements[0===t?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;ee;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const e=document.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_handleTab(e){for(let t=0;t0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,"\n"===e&&(this._liveRegionLineCount++,21===this._liveRegionLineCount&&(this._liveRegion.textContent+=s.tooMuchOutput)),r.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout((()=>{this._accessibilityTreeRoot.appendChild(this._liveRegion)}),0))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,r.isMac&&(0,c.removeElementFromParent)(this._liveRegion)}_handleKey(e){this._clearLiveRegion(),this._charsToConsume.push(e)}_refreshRows(e,t){this._renderRowsDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){const i=this._terminal.buffer,s=i.lines.length.toString();for(let r=e;r<=t;r++){const e=i.translateBufferLineToString(i.ydisp+r,!0),t=(i.ydisp+r+1).toString(),n=this._rowElements[r];n&&(0===e.length?n.innerText=" ":n.textContent=e,n.setAttribute("aria-posinset",t),n.setAttribute("aria-setsize",s))}this._announceCharacters()}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e{function i(e){return e.replace(/\r?\n/g,"\r")}function s(e,t){return t?"[200~"+e+"[201~":e}function r(e,t,r){e=s(e=i(e),r.decPrivateModes.bracketedPasteMode),r.triggerDataEvent(e,!0),t.value=""}function n(e,t,i){const s=i.getBoundingClientRect(),r=e.clientX-s.left-10,n=e.clientY-s.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${r}px`,t.style.top=`${n}px`,t.style.zIndex="1000",t.focus()}Object.defineProperty(t,"__esModule",{value:!0}),t.rightClickHandler=t.moveTextAreaUnderMouseCursor=t.paste=t.handlePasteEvent=t.copyHandler=t.bracketTextForPaste=t.prepareTextForTerminal=void 0,t.prepareTextForTerminal=i,t.bracketTextForPaste=s,t.copyHandler=function(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()},t.handlePasteEvent=function(e,t,i){e.stopPropagation(),e.clipboardData&&r(e.clipboardData.getData("text/plain"),t,i)},t.paste=r,t.moveTextAreaUnderMouseCursor=n,t.rightClickHandler=function(e,t,i,s,r){n(e,t,i),r&&s.rightClickSelect(e),t.value=s.selectionText,t.select()}},7239:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContrastCache=void 0;const s=i(1505);t.ColorContrastCache=class{constructor(){this._color=new s.TwoKeyMap,this._css=new s.TwoKeyMap}setCss(e,t,i){this._css.set(e,t,i)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,i){this._color.set(e,t,i)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}}},9631:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.removeElementFromParent=void 0,t.removeElementFromParent=function(...e){var t;for(const i of e)null===(t=null==i?void 0:i.parentElement)||void 0===t||t.removeChild(i)}},3656:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addDisposableDomListener=void 0,t.addDisposableDomListener=function(e,t,i,s){e.addEventListener(t,i,s);let r=!1;return{dispose:()=>{r||(r=!0,e.removeEventListener(t,i,s))}}}},6465:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Linkifier2=void 0;const n=i(2585),o=i(8460),a=i(844),h=i(3656);let c=class extends a.Disposable{constructor(e){super(),this._bufferService=e,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._activeLine=-1,this._onShowLinkUnderline=this.register(new o.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new o.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,a.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,a.toDisposable)((()=>{this._lastMouseEvent=void 0})))}get currentLink(){return this._currentLink}registerLinkProvider(e){return this._linkProviders.push(e),{dispose:()=>{const t=this._linkProviders.indexOf(e);-1!==t&&this._linkProviders.splice(t,1)}}}attachToDom(e,t,i){this._element=e,this._mouseService=t,this._renderService=i,this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(e){if(this._lastMouseEvent=e,!this._element||!this._mouseService)return;const t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;const i=e.composedPath();for(let e=0;e{null==e||e.forEach((e=>{e.link.dispose&&e.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=e.y);let r=!1;for(const[i,n]of this._linkProviders.entries())t?(null===(s=this._activeProviderReplies)||void 0===s?void 0:s.get(i))&&(r=this._checkLinkProviderResult(i,e,r)):n.provideLinks(e.y,(t=>{var s,n;if(this._isMouseOut)return;const o=null==t?void 0:t.map((e=>({link:e})));null===(s=this._activeProviderReplies)||void 0===s||s.set(i,o),r=this._checkLinkProviderResult(i,e,r),(null===(n=this._activeProviderReplies)||void 0===n?void 0:n.size)===this._linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)}))}_removeIntersectingLinks(e,t){const i=new Set;for(let s=0;se?this._bufferService.cols:s.link.range.end.x;for(let e=n;e<=o;e++){if(i.has(e)){r.splice(t--,1);break}i.add(e)}}}}_checkLinkProviderResult(e,t,i){var s;if(!this._activeProviderReplies)return i;const r=this._activeProviderReplies.get(e);let n=!1;for(let t=0;tthis._linkAtPosition(e.link,t)));e&&(i=!0,this._handleNewLink(e))}if(this._activeProviderReplies.size===this._linkProviders.length&&!i)for(let e=0;ethis._linkAtPosition(e.link,t)));if(r){i=!0,this._handleNewLink(r);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._element||!this._mouseService||!this._currentLink)return;const t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){this._element&&this._currentLink&&this._lastMouseEvent&&(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,a.disposeArray)(this._linkCacheDisposables))}_handleNewLink(e){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:void 0===e.link.decorations||e.link.decorations.underline,pointerCursor:void 0===e.link.decorations||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var e,t;return null===(t=null===(e=this._currentLink)||void 0===e?void 0:e.state)||void 0===t?void 0:t.decorations.pointerCursor},set:e=>{var t,i;(null===(t=this._currentLink)||void 0===t?void 0:t.state)&&this._currentLink.state.decorations.pointerCursor!==e&&(this._currentLink.state.decorations.pointerCursor=e,this._currentLink.state.isHovered&&(null===(i=this._element)||void 0===i||i.classList.toggle("xterm-cursor-pointer",e)))}},underline:{get:()=>{var e,t;return null===(t=null===(e=this._currentLink)||void 0===e?void 0:e.state)||void 0===t?void 0:t.decorations.underline},set:t=>{var i,s,r;(null===(i=this._currentLink)||void 0===i?void 0:i.state)&&(null===(r=null===(s=this._currentLink)||void 0===s?void 0:s.state)||void 0===r?void 0:r.decorations.underline)!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,t))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((e=>{const t=0===e.start?0:e.start+1+this._bufferService.buffer.ydisp;this._clearCurrentLink(t,e.end+1+this._bufferService.buffer.ydisp)}))))}_linkHover(e,t,i){var s;(null===(s=this._currentLink)||void 0===s?void 0:s.state)&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(i,t.text)}_fireUnderlineEvent(e,t){const i=e.range,s=this._bufferService.buffer.ydisp,r=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-s-1,i.end.x,i.end.y-s-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(r)}_linkLeave(e,t,i){var s;(null===(s=this._currentLink)||void 0===s?void 0:s.state)&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(i,t.text)}_linkAtPosition(e,t){const i=e.range.start.y===e.range.end.y,s=e.range.start.yt.y;return(i&&e.range.start.x<=t.x&&e.range.end.x>=t.x||s&&e.range.end.x>=t.x||r&&e.range.start.x<=t.x||s&&r)&&e.range.start.y<=t.y&&e.range.end.y>=t.y}_positionFromMouseEvent(e,t,i){const s=i.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(s)return{x:s[0],y:s[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,i,s,r){return{x1:e,y1:t,x2:i,y2:s,cols:this._bufferService.cols,fg:r}}};c=s([r(0,n.IBufferService)],c),t.Linkifier2=c},9042:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tooMuchOutput=t.promptLabel=void 0,t.promptLabel="Terminal input",t.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkProvider=void 0;const n=i(511),o=i(2585);let a=class{constructor(e,t,i){this._bufferService=e,this._optionsService=t,this._oscLinkService=i}provideLinks(e,t){var i;const s=this._bufferService.buffer.lines.get(e-1);if(!s)return void t(void 0);const r=[],o=this._optionsService.rawOptions.linkHandler,a=new n.CellData,c=s.getTrimmedLength();let l=-1,d=-1,_=!1;for(let t=0;to?o.activate(e,t,i):h(0,t),hover:(e,t)=>{var s;return null===(s=null==o?void 0:o.hover)||void 0===s?void 0:s.call(o,e,t,i)},leave:(e,t)=>{var s;return null===(s=null==o?void 0:o.leave)||void 0===s?void 0:s.call(o,e,t,i)}})}_=!1,a.hasExtendedAttrs()&&a.extended.urlId?(d=t,l=a.extended.urlId):(d=-1,l=-1)}}t(r)}};function h(e,t){if(confirm(`Do you want to navigate to ${t}?`)){const e=window.open();if(e){try{e.opener=null}catch(e){}e.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}a=s([r(0,o.IBufferService),r(1,o.IOptionsService),r(2,o.IOscLinkService)],a),t.OscLinkProvider=a},6193:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RenderDebouncer=void 0,t.RenderDebouncer=class{constructor(e,t){this._parentWindow=e,this._renderCallback=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(e,t,i){this._rowCount=i,e=void 0!==e?e:0,t=void 0!==t?t:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,e):e,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,t):t,this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,void 0===this._rowStart||void 0===this._rowEnd||void 0===this._rowCount)return void this._runRefreshCallbacks();const e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}}},5596:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ScreenDprMonitor=void 0;const s=i(844);class r extends s.Disposable{constructor(e){super(),this._parentWindow=e,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,s.toDisposable)((()=>{this.clearListener()})))}setListener(e){this._listener&&this.clearListener(),this._listener=e,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var e;this._outerListener&&(null===(e=this._resolutionMediaMatchList)||void 0===e||e.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}t.ScreenDprMonitor=r},3236:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Terminal=void 0;const s=i(2950),r=i(1680),n=i(3614),o=i(2584),a=i(5435),h=i(9312),c=i(6114),l=i(3656),d=i(9042),_=i(4567),u=i(1296),f=i(7399),v=i(8460),g=i(8437),p=i(3230),S=i(4725),m=i(428),C=i(8934),b=i(6465),y=i(5114),w=i(8969),E=i(8055),L=i(4269),k=i(5941),R=i(3107),D=i(5744),A=i(9074),x=i(2585),B=i(3730),T=i(844),M=i(6731),O="undefined"!=typeof window?window.document:null;class I extends w.CoreTerminal{constructor(e={}){super(e),this.browser=c,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._onCursorMove=this.register(new v.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new v.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new v.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new v.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new v.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new v.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new v.EventEmitter),this._onBlur=this.register(new v.EventEmitter),this._onA11yCharEmitter=this.register(new v.EventEmitter),this._onA11yTabEmitter=this.register(new v.EventEmitter),this._onWillOpen=this.register(new v.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(b.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(B.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(A.DecorationService),this._instantiationService.setService(x.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((e,t)=>this.refresh(e,t)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((e=>this._reportWindowsOptions(e)))),this.register(this._inputHandler.onColor((e=>this._handleColorEvent(e)))),this.register((0,v.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,v.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,v.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,v.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((e=>this._afterResize(e.cols,e.rows)))),this.register((0,T.toDisposable)((()=>{var e,t;this._customKeyEventHandler=void 0,null===(t=null===(e=this.element)||void 0===e?void 0:e.parentNode)||void 0===t||t.removeChild(this.element)})))}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(const t of e){let e,i="";switch(t.index){case 256:e="foreground",i="10";break;case 257:e="background",i="11";break;case 258:e="cursor",i="12";break;default:e="ansi",i="4;"+t.index}switch(t.type){case 0:const s=E.color.toColorRGB("ansi"===e?this._themeService.colors.ansi[t.index]:this._themeService.colors[e]);this.coreService.triggerDataEvent(`${o.C0.ESC}]${i};${(0,k.toRgbString)(s)}${o.C1_ESCAPED.ST}`);break;case 1:if("ansi"===e)this._themeService.modifyColors((e=>e.ansi[t.index]=E.rgba.toColor(...t.color)));else{const i=e;this._themeService.modifyColors((e=>e[i]=E.rgba.toColor(...t.color)))}break;case 2:this._themeService.restoreColor(t.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){var t;e?!this._accessibilityManager&&this._renderService&&(this._accessibilityManager=new _.AccessibilityManager(this,this._renderService)):(null===(t=this._accessibilityManager)||void 0===t||t.dispose(),this._accessibilityManager=void 0)}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(o.C0.ESC+"[I"),this.updateCursorStyle(e),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var e;return null===(e=this.textarea)||void 0===e?void 0:e.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(o.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;const i=Math.min(this.buffer.x,this.cols-1),s=this._renderService.dimensions.css.cell.height,r=t.getWidth(i),n=this._renderService.dimensions.css.cell.width*r,o=this.buffer.y*this._renderService.dimensions.css.cell.height,a=i*this._renderService.dimensions.css.cell.width;this.textarea.style.left=a+"px",this.textarea.style.top=o+"px",this.textarea.style.width=n+"px",this.textarea.style.height=s+"px",this.textarea.style.lineHeight=s+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,l.addDisposableDomListener)(this.element,"copy",(e=>{this.hasSelection()&&(0,n.copyHandler)(e,this._selectionService)})));const e=e=>(0,n.handlePasteEvent)(e,this.textarea,this.coreService);this.register((0,l.addDisposableDomListener)(this.textarea,"paste",e)),this.register((0,l.addDisposableDomListener)(this.element,"paste",e)),c.isFirefox?this.register((0,l.addDisposableDomListener)(this.element,"mousedown",(e=>{2===e.button&&(0,n.rightClickHandler)(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,l.addDisposableDomListener)(this.element,"contextmenu",(e=>{(0,n.rightClickHandler)(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),c.isLinux&&this.register((0,l.addDisposableDomListener)(this.element,"auxclick",(e=>{1===e.button&&(0,n.moveTextAreaUnderMouseCursor)(e,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,l.addDisposableDomListener)(this.textarea,"keyup",(e=>this._keyUp(e)),!0)),this.register((0,l.addDisposableDomListener)(this.textarea,"keydown",(e=>this._keyDown(e)),!0)),this.register((0,l.addDisposableDomListener)(this.textarea,"keypress",(e=>this._keyPress(e)),!0)),this.register((0,l.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,l.addDisposableDomListener)(this.textarea,"compositionupdate",(e=>this._compositionHelper.compositionupdate(e)))),this.register((0,l.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,l.addDisposableDomListener)(this.textarea,"input",(e=>this._inputEvent(e)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(e){var t;if(!e)throw new Error("Terminal requires a parent element.");e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=e.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),this.element.setAttribute("tabindex","0"),e.appendChild(this.element);const i=O.createDocumentFragment();this._viewportElement=O.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),i.appendChild(this._viewportElement),this._viewportScrollArea=O.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=O.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=O.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),i.appendChild(this.screenElement),this.textarea=O.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",d.promptLabel),this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this.register((0,l.addDisposableDomListener)(this.textarea,"focus",(e=>this._handleTextAreaFocus(e)))),this.register((0,l.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._coreBrowserService=this._instantiationService.createInstance(y.CoreBrowserService,this.textarea,null!==(t=this._document.defaultView)&&void 0!==t?t:window),this._instantiationService.setService(S.ICoreBrowserService,this._coreBrowserService),this._charSizeService=this._instantiationService.createInstance(m.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(S.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(M.ThemeService),this._instantiationService.setService(S.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(L.CharacterJoinerService),this._instantiationService.setService(S.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(p.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(S.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((e=>this._onRender.fire(e)))),this.onResize((e=>this._renderService.resize(e.cols,e.rows))),this._compositionView=O.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(s.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(i);try{this._onWillOpen.fire(this.element)}catch(e){}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(C.MouseService),this._instantiationService.setService(S.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(r.Viewport,(e=>this.scrollLines(e,!0,1)),this._viewportElement,this._viewportScrollArea),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(h.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(S.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((e=>this.scrollLines(e.amount,e.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((e=>this._renderService.handleSelectionChanged(e.start,e.end,e.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((e=>{this.textarea.value=e,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((e=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,l.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(R.BufferDecorationRenderer,this.screenElement)),this.register((0,l.addDisposableDomListener)(this.element,"mousedown",(e=>this._selectionService.handleMouseDown(e)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new _.AccessibilityManager(this,this._renderService)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(e=>this._handleScreenReaderModeOptionChange(e)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(D.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(e=>{!this._overviewRulerRenderer&&e&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(D.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(u.DomRenderer,this.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){const e=this,t=this.element;function i(t){const i=e._mouseService.getMouseReportCoords(t,e.screenElement);if(!i)return!1;let s,r;switch(t.overrideType||t.type){case"mousemove":r=32,void 0===t.buttons?(s=3,void 0!==t.button&&(s=t.button<3?t.button:3)):s=1&t.buttons?0:4&t.buttons?1:2&t.buttons?2:3;break;case"mouseup":r=0,s=t.button<3?t.button:3;break;case"mousedown":r=1,s=t.button<3?t.button:3;break;case"wheel":if(0===e.viewport.getLinesScrolled(t))return!1;r=t.deltaY<0?0:1,s=4;break;default:return!1}return!(void 0===r||void 0===s||s>4)&&e.coreMouseService.triggerMouseEvent({col:i.col,row:i.row,x:i.x,y:i.y,button:s,action:r,ctrl:t.ctrlKey,alt:t.altKey,shift:t.shiftKey})}const s={mouseup:null,wheel:null,mousedrag:null,mousemove:null},r={mouseup:e=>(i(e),e.buttons||(this._document.removeEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.removeEventListener("mousemove",s.mousedrag)),this.cancel(e)),wheel:e=>(i(e),this.cancel(e,!0)),mousedrag:e=>{e.buttons&&i(e)},mousemove:e=>{e.buttons||i(e)}};this.register(this.coreMouseService.onProtocolChange((e=>{e?("debug"===this.optionsService.rawOptions.logLevel&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(e)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&e?s.mousemove||(t.addEventListener("mousemove",r.mousemove),s.mousemove=r.mousemove):(t.removeEventListener("mousemove",s.mousemove),s.mousemove=null),16&e?s.wheel||(t.addEventListener("wheel",r.wheel,{passive:!1}),s.wheel=r.wheel):(t.removeEventListener("wheel",s.wheel),s.wheel=null),2&e?s.mouseup||(s.mouseup=r.mouseup):(this._document.removeEventListener("mouseup",s.mouseup),s.mouseup=null),4&e?s.mousedrag||(s.mousedrag=r.mousedrag):(this._document.removeEventListener("mousemove",s.mousedrag),s.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,l.addDisposableDomListener)(t,"mousedown",(e=>{if(e.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(e))return i(e),s.mouseup&&this._document.addEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.addEventListener("mousemove",s.mousedrag),this.cancel(e)}))),this.register((0,l.addDisposableDomListener)(t,"wheel",(e=>{if(!s.wheel){if(!this.buffer.hasScrollback){const t=this.viewport.getLinesScrolled(e);if(0===t)return;const i=o.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(e.deltaY<0?"A":"B");let s="";for(let e=0;e{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(e),this.cancel(e)}),{passive:!0})),this.register((0,l.addDisposableDomListener)(t,"touchmove",(e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(e)?void 0:this.cancel(e)}),{passive:!1}))}refresh(e,t){var i;null===(i=this._renderService)||void 0===i||i.refreshRows(e,t)}updateCursorStyle(e){var t;(null===(t=this._selectionService)||void 0===t?void 0:t.shouldColumnSelect(e))?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t,i=0){super.scrollLines(e,t,i),this.refresh(0,this.rows-1)}paste(e){(0,n.paste)(e,this.textarea,this.coreService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}registerLinkProvider(e){return this.linkifier2.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}addMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(e,t,i){this._selectionService.setSelection(e,t,i)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var e;null===(e=this._selectionService)||void 0===e||e.clearSelection()}selectAll(){var e;null===(e=this._selectionService)||void 0===e||e.selectAll()}selectLines(e,t){var i;null===(i=this._selectionService)||void 0===i||i.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;const t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.buffer.ybase!==this.buffer.ydisp&&this._bufferService.scrollToBottom(),!1;t||"Dead"!==e.key&&"AltGraph"!==e.key||(this._unprocessedDeadKey=!0);const i=(0,f.evaluateKeyboardEvent)(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),3===i.type||2===i.type){const t=this.rows-1;return this.scrollLines(2===i.type?-t:t),this.cancel(e,!0)}return 1===i.type&&this.selectAll(),!!this._isThirdLevelShift(this.browser,e)||(i.cancel&&this.cancel(e,!0),!i.key||!!(e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&1===e.key.length&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(i.key!==o.C0.ETX&&i.key!==o.C0.CR||(this.textarea.value=""),this._onKey.fire({key:i.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i.key,!0),this.optionsService.rawOptions.screenReaderMode?void(this._keyDownHandled=!0):this.cancel(e,!0))))}_isThirdLevelShift(e,t){const i=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return"keypress"===t.type?i:i&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e)||(function(e){return 16===e.keyCode||17===e.keyCode||18===e.keyCode}(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled)return!1;if(this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(null===e.which||void 0===e.which)t=e.keyCode;else{if(0===e.which||0===e.charCode)return!1;t=e.which}return!(!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)||(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(e){if(e.data&&"insertText"===e.inputType&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){e!==this.cols||t!==this.rows?super.resize(e,t):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(e,t){var i,s;null===(i=this._charSizeService)||void 0===i||i.measure(),null===(s=this.viewport)||void 0===s||s.syncScrollArea(!0)}clear(){if(0!==this.buffer.ybase||0!==this.buffer.y){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e{Object.defineProperty(t,"__esModule",{value:!0}),t.TimeBasedDebouncer=void 0,t.TimeBasedDebouncer=class{constructor(e,t=1e3){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,i){this._rowCount=i,e=void 0!==e?e:0,t=void 0!==t?t:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,e):e,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,t):t;const s=Date.now();if(s-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=s,this._innerRefresh();else if(!this._additionalRefreshRequested){const e=s-this._lastRefreshMs,t=this._debounceThresholdMS-e;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),t)}}_innerRefresh(){if(void 0===this._rowStart||void 0===this._rowEnd||void 0===this._rowCount)return;const e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}}},1680:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Viewport=void 0;const n=i(844),o=i(3656),a=i(4725),h=i(2585);let c=class extends n.Disposable{constructor(e,t,i,s,r,n,a,h,c){super(),this._scrollLines=e,this._viewportElement=t,this._scrollArea=i,this._bufferService=s,this._optionsService=r,this._charSizeService=n,this._renderService=a,this._coreBrowserService=h,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,o.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((e=>this._activeBuffer=e.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((e=>this._renderDimensions=e))),this._handleThemeChange(c.colors),this.register(c.onChangeColors((e=>this._handleThemeChange(e)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()),0)}_handleThemeChange(e){this._viewportElement.style.backgroundColor=e.background.css}_refresh(e){if(e)return this._innerRefresh(),void(null!==this._refreshAnimationFrame&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));null===this._refreshAnimationFrame&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderService.dimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.css.canvas.height);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const e=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==e&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=e),this._refreshAnimationFrame=null}syncScrollArea(e=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(e);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(e)}_handleScroll(e){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._scrollLines(0);const t=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._scrollLines(t)}_smoothScroll(){if(this._isDisposed||-1===this._smoothScrollState.origin||-1===this._smoothScrollState.target)return;const e=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(e*(this._smoothScrollState.target-this._smoothScrollState.origin)),e<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(e,t){const i=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(t<0&&0!==this._viewportElement.scrollTop||t>0&&i0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._bufferService.rows),t}_applyScrollModifier(e,t){const i=this._optionsService.rawOptions.fastScrollModifier;return"alt"===i&&t.altKey||"ctrl"===i&&t.ctrlKey||"shift"===i&&t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(e){this._lastTouchY=e.touches[0].pageY}handleTouchMove(e){const t=this._lastTouchY-e.touches[0].pageY;return this._lastTouchY=e.touches[0].pageY,0!==t&&(this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))}};c=s([r(3,h.IBufferService),r(4,h.IOptionsService),r(5,a.ICharSizeService),r(6,a.IRenderService),r(7,a.ICoreBrowserService),r(8,a.IThemeService)],c),t.Viewport=c},3107:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferDecorationRenderer=void 0;const n=i(3656),o=i(4725),a=i(844),h=i(2585);let c=class extends a.Disposable{constructor(e,t,i,s){super(),this._screenElement=e,this._bufferService=t,this._decorationService=i,this._renderService=s,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register((0,n.addDisposableDomListener)(window,"resize",(()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((e=>this._removeDecoration(e)))),this.register((0,a.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){void 0===this._animationFrame&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var t;const i=document.createElement("div");i.classList.add("xterm-decoration"),i.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=(e.options.height||1)*this._renderService.dimensions.css.cell.height+"px",i.style.top=(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const s=null!==(t=e.options.x)&&void 0!==t?t:0;return s&&s>this._bufferService.cols&&(i.style.display="none"),this._refreshXPosition(e,i),i}_refreshStyle(e){const t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let i=this._decorationElements.get(e);i||(i=this._createElement(e),e.element=i,this._decorationElements.set(e,i),this._container.appendChild(i)),i.style.top=t*this._renderService.dimensions.css.cell.height+"px",i.style.display=this._altBufferIsActive?"none":"block",e.onRenderEmitter.fire(i)}}_refreshXPosition(e,t=e.element){var i;if(!t)return;const s=null!==(i=e.options.x)&&void 0!==i?i:0;"right"===(e.options.anchor||"left")?t.style.right=s?s*this._renderService.dimensions.css.cell.width+"px":"":t.style.left=s?s*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(e){var t;null===(t=this._decorationElements.get(e))||void 0===t||t.remove(),this._decorationElements.delete(e),e.dispose()}};c=s([r(1,h.IBufferService),r(2,h.IDecorationService),r(3,o.IRenderService)],c),t.BufferDecorationRenderer=c},5871:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorZoneStore=void 0,t.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(const t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position))return void this._addLineToZone(t,e.marker.line)}if(this._zonePoolIndex=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,i){return t>=e.startBufferLine-this._linePadding[i||"full"]&&t<=e.endBufferLine+this._linePadding[i||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}}},5744:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OverviewRulerRenderer=void 0;const n=i(5871),o=i(3656),a=i(4725),h=i(844),c=i(2585),l={full:0,left:0,center:0,right:0},d={full:0,left:0,center:0,right:0},_={full:0,left:0,center:0,right:0};let u=class extends h.Disposable{constructor(e,t,i,s,r,o,a){var c;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=i,this._decorationService=s,this._renderService=r,this._optionsService=o,this._coreBrowseService=a,this._colorZoneStore=new n.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),null===(c=this._viewportElement.parentElement)||void 0===c||c.insertBefore(this._canvas,this._viewportElement);const l=this._canvas.getContext("2d");if(!l)throw new Error("Ctx cannot be null");this._ctx=l,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,h.toDisposable)((()=>{var e;null===(e=this._canvas)||void 0===e||e.remove()})))}get _width(){return this._optionsService.options.overviewRulerWidth||0}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register((0,o.addDisposableDomListener)(this._coreBrowseService.window,"resize",(()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const e=Math.floor(this._canvas.width/3),t=Math.ceil(this._canvas.width/3);d.full=this._canvas.width,d.left=e,d.center=t,d.right=e,this._refreshDrawHeightConstants(),_.full=0,_.left=0,_.center=d.left,_.right=d.left+d.center}_refreshDrawHeightConstants(){l.full=Math.round(2*this._coreBrowseService.dpr);const e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowseService.dpr);l.left=t,l.center=t,l.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowseService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const e of this._decorationService.decorations)this._colorZoneStore.addDecoration(e);this._ctx.lineWidth=1;const e=this._colorZoneStore.zones;for(const t of e)"full"!==t.position&&this._renderColorZone(t);for(const t of e)"full"===t.position&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(_[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-l[e.position||"full"]/2),d[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+l[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,void 0===this._animationFrame&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};u=s([r(2,c.IBufferService),r(3,c.IDecorationService),r(4,a.IRenderService),r(5,c.IOptionsService),r(6,a.ICoreBrowserService)],u),t.OverviewRulerRenderer=u},2950:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CompositionHelper=void 0;const n=i(4725),o=i(2585),a=i(2584);let h=class{constructor(e,t,i,s,r,n){this._textarea=e,this._compositionView=t,this._bufferService=i,this._optionsService=s,this._coreService=r,this._renderService=n,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(229===e.keyCode)return!1;if(16===e.keyCode||17===e.keyCode||18===e.keyCode)return!1;this._finalizeComposition(!1)}return 229!==e.keyCode||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){const e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let t;this._isSendingComposition=!1,e.start+=this._dataAlreadySent.length,t=this._isComposing?this._textarea.value.substring(e.start,e.end):this._textarea.value.substring(e.start),t.length>0&&this._coreService.triggerDataEvent(t,!0)}}),0)}else{this._isSendingComposition=!1;const e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){const e=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const t=this._textarea.value,i=t.replace(e,"");this._dataAlreadySent=i,t.length>e.length?this._coreService.triggerDataEvent(i,!0):t.lengththis.updateCompositionElements(!0)),0)}}};h=s([r(2,o.IBufferService),r(3,o.IOptionsService),r(4,o.ICoreService),r(5,n.IRenderService)],h),t.CompositionHelper=h},9806:(e,t)=>{function i(e,t,i){const s=i.getBoundingClientRect(),r=e.getComputedStyle(i),n=parseInt(r.getPropertyValue("padding-left")),o=parseInt(r.getPropertyValue("padding-top"));return[t.clientX-s.left-n,t.clientY-s.top-o]}Object.defineProperty(t,"__esModule",{value:!0}),t.getCoords=t.getCoordsRelativeToElement=void 0,t.getCoordsRelativeToElement=i,t.getCoords=function(e,t,s,r,n,o,a,h,c){if(!o)return;const l=i(e,t,s);return l?(l[0]=Math.ceil((l[0]+(c?a/2:0))/a),l[1]=Math.ceil(l[1]/h),l[0]=Math.min(Math.max(l[0],1),r+(c?1:0)),l[1]=Math.min(Math.max(l[1],1),n),l):void 0}},9504:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.moveToCellSequence=void 0;const s=i(2584);function r(e,t,i,s){const r=e-n(e,i),a=t-n(t,i),l=Math.abs(r-a)-function(e,t,i){let s=0;const r=e-n(e,i),a=t-n(t,i);for(let n=0;n=0&&et?"A":"B"}function a(e,t,i,s,r,n){let o=e,a=t,h="";for(;o!==i||a!==s;)o+=r?1:-1,r&&o>n.cols-1?(h+=n.buffer.translateBufferLineToString(a,!1,e,o),o=0,e=0,a++):!r&&o<0&&(h+=n.buffer.translateBufferLineToString(a,!1,0,e+1),o=n.cols-1,e=o,a--);return h+n.buffer.translateBufferLineToString(a,!1,e,o)}function h(e,t){const i=t?"O":"[";return s.C0.ESC+i+e}function c(e,t){e=Math.floor(e);let i="";for(let s=0;s0?s-n(s,o):t;const _=s,u=function(e,t,i,s,o,a){let h;return h=r(i,s,o,a).length>0?s-n(s,o):t,e=i&&he?"D":"C",c(Math.abs(o-e),h(d,s));d=l>t?"D":"C";const _=Math.abs(l-t);return c(function(e,t){return t.cols-e}(l>t?e:o,i)+(_-1)*i.cols+1+((l>t?o:e)-1),h(d,s))}},1296:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRenderer=void 0;const n=i(9631),o=i(3787),a=i(2223),h=i(6171),c=i(4725),l=i(8055),d=i(8460),_=i(844),u=i(2585),f="xterm-dom-renderer-owner-",v="xterm-focus";let g=1,p=class extends _.Disposable{constructor(e,t,i,s,r,a,c,l,u,v){super(),this._element=e,this._screenElement=t,this._viewportElement=i,this._linkifier2=s,this._charSizeService=a,this._optionsService=c,this._bufferService=l,this._coreBrowserService=u,this._terminalClass=g++,this._rowElements=[],this.onRequestRedraw=this.register(new d.EventEmitter).event,this._rowContainer=document.createElement("div"),this._rowContainer.classList.add("xterm-rows"),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=document.createElement("div"),this._selectionContainer.classList.add("xterm-selection"),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,h.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(v.onChangeColors((e=>this._injectCss(e)))),this._injectCss(v.colors),this._rowFactory=r.createInstance(o.DomRendererRowFactory,document),this._element.classList.add(f+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((e=>this._handleLinkHover(e)))),this.register(this._linkifier2.onHideLinkUnderline((e=>this._handleLinkLeave(e)))),this.register((0,_.toDisposable)((()=>{this._element.classList.remove(f+this._terminalClass),(0,n.removeElementFromParent)(this._rowContainer,this._selectionContainer,this._themeStyleElement,this._dimensionsStyleElement)})))}_updateDimensions(){const e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const e of this._rowElements)e.style.width=`${this.dimensions.css.canvas.width}px`,e.style.height=`${this.dimensions.css.cell.height}px`,e.style.lineHeight=`${this.dimensions.css.cell.height}px`,e.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const t=`${this._terminalSelector} .xterm-rows span { display: inline-block; height: 100%; vertical-align: top; width: ${this.dimensions.css.cell.width}px}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .xterm-rows { color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px;}`;t+=`${this._terminalSelector} span:not(.${o.BOLD_CLASS}) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.${o.BOLD_CLASS} { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.${o.ITALIC_CLASS} { font-style: italic;}`,t+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { box-shadow: none; }}",t+="@keyframes blink_block_"+this._terminalClass+" { 0% {"+` background-color: ${e.cursor.css};`+` color: ${e.cursorAccent.css}; } 50% {`+` background-color: ${e.cursorAccent.css};`+` color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .xterm-rows:not(.xterm-focus) .${o.CURSOR_CLASS}.${o.CURSOR_STYLE_BLOCK_CLASS} { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .xterm-rows.xterm-focus .${o.CURSOR_CLASS}.${o.CURSOR_BLINK_CLASS}:not(.${o.CURSOR_STYLE_BLOCK_CLASS}) { animation: blink_box_shadow_`+this._terminalClass+" 1s step-end infinite;}"+`${this._terminalSelector} .xterm-rows.xterm-focus .${o.CURSOR_CLASS}.${o.CURSOR_BLINK_CLASS}.${o.CURSOR_STYLE_BLOCK_CLASS} { animation: blink_block_`+this._terminalClass+" 1s step-end infinite;}"+`${this._terminalSelector} .xterm-rows.xterm-focus .${o.CURSOR_CLASS}.${o.CURSOR_STYLE_BLOCK_CLASS} {`+` background-color: ${e.cursor.css};`+` color: ${e.cursorAccent.css};}`+`${this._terminalSelector} .xterm-rows .${o.CURSOR_CLASS}.${o.CURSOR_STYLE_BAR_CLASS} {`+` box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}`+`${this._terminalSelector} .xterm-rows .${o.CURSOR_CLASS}.${o.CURSOR_STYLE_UNDERLINE_CLASS} {`+` box-shadow: 0 -1px 0 ${e.cursor.css} inset;}`,t+=`${this._terminalSelector} .xterm-selection { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .xterm-selection div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .xterm-selection div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(const[i,s]of e.ansi.entries())t+=`${this._terminalSelector} .xterm-fg-${i} { color: ${s.css}; }${this._terminalSelector} .xterm-bg-${i} { background-color: ${s.css}; }`;t+=`${this._terminalSelector} .xterm-fg-${a.INVERTED_DEFAULT_COLOR} { color: ${l.color.opaque(e.background).css}; }${this._terminalSelector} .xterm-bg-${a.INVERTED_DEFAULT_COLOR} { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}handleDevicePixelRatioChange(){this._updateDimensions()}_refreshRowElements(e,t){for(let e=this._rowElements.length;e<=t;e++){const e=document.createElement("div");this._rowContainer.appendChild(e),this._rowElements.push(e)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions()}handleBlur(){this._rowContainer.classList.remove(v)}handleFocus(){this._rowContainer.classList.add(v)}handleSelectionChanged(e,t,i){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(this._rowFactory.handleSelectionChanged(e,t,i),this.renderRows(0,this._bufferService.rows-1),!e||!t)return;const s=e[1]-this._bufferService.buffer.ydisp,r=t[1]-this._bufferService.buffer.ydisp,n=Math.max(s,0),o=Math.min(r,this._bufferService.rows-1);if(n>=this._bufferService.rows||o<0)return;const a=document.createDocumentFragment();if(i){const i=e[0]>t[0];a.appendChild(this._createSelectionElement(n,i?t[0]:e[0],i?e[0]:t[0],o-n+1))}else{const i=s===n?e[0]:0,h=n===r?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(n,i,h));const c=o-n-1;if(a.appendChild(this._createSelectionElement(n+1,0,this._bufferService.cols,c)),n!==o){const e=r===o?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(o,0,e))}}this._selectionContainer.appendChild(a)}_createSelectionElement(e,t,i,s=1){const r=document.createElement("div");return r.style.height=s*this.dimensions.css.cell.height+"px",r.style.top=e*this.dimensions.css.cell.height+"px",r.style.left=t*this.dimensions.css.cell.width+"px",r.style.width=this.dimensions.css.cell.width*(i-t)+"px",r}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions()}clear(){for(const e of this._rowElements)e.replaceChildren()}renderRows(e,t){const i=this._bufferService.buffer.ybase+this._bufferService.buffer.y,s=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),r=this._optionsService.rawOptions.cursorBlink;for(let n=e;n<=t;n++){const e=this._rowElements[n],t=n+this._bufferService.buffer.ydisp,o=this._bufferService.buffer.lines.get(t),a=this._optionsService.rawOptions.cursorStyle;e.replaceChildren(this._rowFactory.createRow(o,t,t===i,a,s,r,this.dimensions.css.cell.width,this._bufferService.cols))}}get _terminalSelector(){return`.${f}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,i,s,r,n){for(;e!==t||i!==s;){const t=this._rowElements[i];if(!t)return;const s=t.children[e];s&&(s.style.textDecoration=n?"underline":"none"),++e>=r&&(e=0,i++)}}};p=s([r(4,u.IInstantiationService),r(5,c.ICharSizeService),r(6,u.IOptionsService),r(7,u.IBufferService),r(8,c.ICoreBrowserService),r(9,c.IThemeService)],p),t.DomRenderer=p},3787:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRendererRowFactory=t.CURSOR_STYLE_UNDERLINE_CLASS=t.CURSOR_STYLE_BAR_CLASS=t.CURSOR_STYLE_BLOCK_CLASS=t.CURSOR_BLINK_CLASS=t.CURSOR_CLASS=t.STRIKETHROUGH_CLASS=t.UNDERLINE_CLASS=t.ITALIC_CLASS=t.DIM_CLASS=t.BOLD_CLASS=void 0;const n=i(2223),o=i(643),a=i(511),h=i(2585),c=i(8055),l=i(4725),d=i(4269),_=i(6171),u=i(3734);t.BOLD_CLASS="xterm-bold",t.DIM_CLASS="xterm-dim",t.ITALIC_CLASS="xterm-italic",t.UNDERLINE_CLASS="xterm-underline",t.STRIKETHROUGH_CLASS="xterm-strikethrough",t.CURSOR_CLASS="xterm-cursor",t.CURSOR_BLINK_CLASS="xterm-cursor-blink",t.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",t.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",t.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";let f=class{constructor(e,t,i,s,r,n,o){this._document=e,this._characterJoinerService=t,this._optionsService=i,this._coreBrowserService=s,this._coreService=r,this._decorationService=n,this._themeService=o,this._workCell=new a.CellData,this._columnSelectMode=!1}handleSelectionChanged(e,t,i){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=i}createRow(e,i,s,r,a,h,l,_){const f=this._document.createDocumentFragment(),g=this._characterJoinerService.getJoinedCharacters(i);let p=0;for(let t=Math.min(e.length,_)-1;t>=0;t--)if(e.loadCell(t,this._workCell).getCode()!==o.NULL_CELL_CODE||s&&t===a){p=t+1;break}const S=this._themeService.colors;for(let _=0;_0&&_===g[0][0]){m=!0;const t=g.shift();b=new d.JoinedCellData(this._workCell,e.translateToString(!0,t[0],t[1]),t[1]-t[0]),C=t[1]-1,p=b.getWidth()}const y=this._document.createElement("span");if(p>1&&(y.style.width=l*p+"px"),m&&(y.style.display="inline",a>=_&&a<=C&&(a=_)),!this._coreService.isCursorHidden&&s&&_===a)switch(y.classList.add(t.CURSOR_CLASS),h&&y.classList.add(t.CURSOR_BLINK_CLASS),r){case"bar":y.classList.add(t.CURSOR_STYLE_BAR_CLASS);break;case"underline":y.classList.add(t.CURSOR_STYLE_UNDERLINE_CLASS);break;default:y.classList.add(t.CURSOR_STYLE_BLOCK_CLASS)}if(b.isBold()&&y.classList.add(t.BOLD_CLASS),b.isItalic()&&y.classList.add(t.ITALIC_CLASS),b.isDim()&&y.classList.add(t.DIM_CLASS),b.isInvisible()?y.textContent=o.WHITESPACE_CELL_CHAR:y.textContent=b.getChars()||o.WHITESPACE_CELL_CHAR,b.isUnderline()&&(y.classList.add(`${t.UNDERLINE_CLASS}-${b.extended.underlineStyle}`)," "===y.textContent&&(y.textContent=" "),!b.isUnderlineColorDefault()))if(b.isUnderlineColorRGB())y.style.textDecorationColor=`rgb(${u.AttributeData.toColorRGB(b.getUnderlineColor()).join(",")})`;else{let e=b.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&b.isBold()&&e<8&&(e+=8),y.style.textDecorationColor=S.ansi[e].css}b.isStrikethrough()&&y.classList.add(t.STRIKETHROUGH_CLASS);let w=b.getFgColor(),E=b.getFgColorMode(),L=b.getBgColor(),k=b.getBgColorMode();const R=!!b.isInverse();if(R){const e=w;w=L,L=e;const t=E;E=k,k=t}let D,A,x=!1;this._decorationService.forEachDecorationAtCell(_,i,void 0,(e=>{"top"!==e.options.layer&&x||(e.backgroundColorRGB&&(k=50331648,L=e.backgroundColorRGB.rgba>>8&16777215,D=e.backgroundColorRGB),e.foregroundColorRGB&&(E=50331648,w=e.foregroundColorRGB.rgba>>8&16777215,A=e.foregroundColorRGB),x="top"===e.options.layer)}));const B=this._isCellInSelection(_,i);let T;switch(x||S.selectionForeground&&B&&(E=50331648,w=S.selectionForeground.rgba>>8&16777215,A=S.selectionForeground),B&&(D=this._coreBrowserService.isFocused?S.selectionBackgroundOpaque:S.selectionInactiveBackgroundOpaque,x=!0),x&&y.classList.add("xterm-decoration-top"),k){case 16777216:case 33554432:T=S.ansi[L],y.classList.add(`xterm-bg-${L}`);break;case 50331648:T=c.rgba.toColor(L>>16,L>>8&255,255&L),this._addStyle(y,`background-color:#${v((L>>>0).toString(16),"0",6)}`);break;default:R?(T=S.foreground,y.classList.add(`xterm-bg-${n.INVERTED_DEFAULT_COLOR}`)):T=S.background}switch(D||b.isDim()&&(D=c.color.multiplyOpacity(T,.5)),E){case 16777216:case 33554432:b.isBold()&&w<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(w+=8),this._applyMinimumContrast(y,T,S.ansi[w],b,D,void 0)||y.classList.add(`xterm-fg-${w}`);break;case 50331648:const e=c.rgba.toColor(w>>16&255,w>>8&255,255&w);this._applyMinimumContrast(y,T,e,b,D,A)||this._addStyle(y,`color:#${v(w.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(y,T,S.foreground,b,D,void 0)||R&&y.classList.add(`xterm-fg-${n.INVERTED_DEFAULT_COLOR}`)}f.appendChild(y),_=C}return f}_applyMinimumContrast(e,t,i,s,r,n){if(1===this._optionsService.rawOptions.minimumContrastRatio||(0,_.excludeFromContrastRatioDemands)(s.getCode()))return!1;let o;return r||n||(o=this._themeService.colors.contrastCache.getColor(t.rgba,i.rgba)),void 0===o&&(o=c.color.ensureContrastRatio(r||t,n||i,this._optionsService.rawOptions.minimumContrastRatio),this._themeService.colors.contrastCache.setColor((r||t).rgba,(n||i).rgba,null!=o?o:null)),!!o&&(this._addStyle(e,`color:${o.css}`),!0)}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){const i=this._selectionStart,s=this._selectionEnd;return!(!i||!s)&&(this._columnSelectMode?i[0]<=s[0]?e>=i[0]&&t>=i[1]&&e=i[1]&&e>=s[0]&&t<=s[1]:t>i[1]&&t=i[0]&&e=i[0])}};function v(e,t,i){for(;e.length{Object.defineProperty(t,"__esModule",{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;const s=i(6114);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=s.isFirefox||s.isLegacyEdge?"bottom":"ideographic"},6171:(e,t)=>{function i(e){return 57508<=e&&e<=57558}Object.defineProperty(t,"__esModule",{value:!0}),t.createRenderDimensions=t.excludeFromContrastRatioDemands=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(e){if(!e)throw new Error("value must not be falsy");return e},t.isPowerlineGlyph=i,t.isRestrictedPowerlineGlyph=function(e){return 57520<=e&&e<=57527},t.excludeFromContrastRatioDemands=function(e){return i(e)||function(e){return 9472<=e&&e<=9631}(e)},t.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}}},456:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionModel=void 0,t.SelectionModel=class{constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const e=this.selectionStart,t=this.selectionEnd;return!(!e||!t)&&(e[1]>t[1]||e[1]===t[1]&&e[0]>t[0])}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharSizeService=void 0;const n=i(2585),o=i(8460),a=i(844);let h=class extends a.Disposable{constructor(e,t,i){super(),this._optionsService=i,this.width=0,this.height=0,this._onCharSizeChange=this.register(new o.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new c(e,t,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}get hasValidSize(){return this.width>0&&this.height>0}measure(){const e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};h=s([r(2,n.IOptionsService)],h),t.CharSizeService=h;class c{constructor(e,t,i){this._document=e,this._parentElement=t,this._optionsService=i,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W",this._measureElement.setAttribute("aria-hidden","true"),this._parentElement.appendChild(this._measureElement)}measure(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;const e=this._measureElement.getBoundingClientRect();return 0!==e.width&&0!==e.height&&(this._result.width=e.width,this._result.height=Math.ceil(e.height)),this._result}}},4269:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharacterJoinerService=t.JoinedCellData=void 0;const n=i(3734),o=i(643),a=i(511),h=i(2585);class c extends n.AttributeData{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.JoinedCellData=c;let l=class e{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new a.CellData}register(e){const t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t1){const e=this._getJoinedRanges(s,a,n,t,r);for(let t=0;t1){const e=this._getJoinedRanges(s,a,n,t,r);for(let t=0;t{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreBrowserService=void 0,t.CoreBrowserService=class{constructor(e,t){this._textarea=e,this.window=t}get dpr(){return this.window.devicePixelRatio}get isFocused(){return(this._textarea.getRootNode?this._textarea.getRootNode():this._textarea.ownerDocument).activeElement===this._textarea&&this._textarea.ownerDocument.hasFocus()}}},8934:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MouseService=void 0;const n=i(4725),o=i(9806);let a=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,i,s,r){return(0,o.getCoords)(window,e,t,i,s,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,r)}getMouseReportCoords(e,t){const i=(0,o.getCoordsRelativeToElement)(window,e,t);if(!(!this._charSizeService.hasValidSize||i[0]<0||i[1]<0||i[0]>=this._renderService.dimensions.css.canvas.width||i[1]>=this._renderService.dimensions.css.canvas.height))return{col:Math.floor(i[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(i[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(i[0]),y:Math.floor(i[1])}}};a=s([r(0,n.IRenderService),r(1,n.ICharSizeService)],a),t.MouseService=a},3230:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.RenderService=void 0;const n=i(6193),o=i(8460),a=i(844),h=i(5596),c=i(3656),l=i(2585),d=i(4725),_=i(7226);let u=class extends a.Disposable{constructor(e,t,i,s,r,a,l,d){if(super(),this._rowCount=e,this._charSizeService=s,this._pausedResizeTask=new _.DebouncedIdleTask,this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new o.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new o.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new o.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new o.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this.register({dispose:()=>{var e;return null===(e=this._renderer)||void 0===e?void 0:e.dispose()}}),this._renderDebouncer=new n.RenderDebouncer(l.window,((e,t)=>this._renderRows(e,t))),this.register(this._renderDebouncer),this._screenDprMonitor=new h.ScreenDprMonitor(l.window),this._screenDprMonitor.setListener((()=>this.handleDevicePixelRatioChange())),this.register(this._screenDprMonitor),this.register(a.onResize((()=>this._fullRefresh()))),this.register(a.buffers.onBufferActivate((()=>{var e;return null===(e=this._renderer)||void 0===e?void 0:e.clear()}))),this.register(i.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(r.onDecorationRegistered((()=>this._fullRefresh()))),this.register(r.onDecorationRemoved((()=>this._fullRefresh()))),this.register(i.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],(()=>{this.clear(),this.handleResize(a.cols,a.rows),this._fullRefresh()}))),this.register(i.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(a.buffer.y,a.buffer.y,!0)))),this.register((0,c.addDisposableDomListener)(l.window,"resize",(()=>this.handleDevicePixelRatioChange()))),this.register(d.onChangeColors((()=>this._fullRefresh()))),"IntersectionObserver"in l.window){const e=new l.window.IntersectionObserver((e=>this._handleIntersectionChange(e[e.length-1])),{threshold:0});e.observe(t),this.register({dispose:()=>e.disconnect()})}}get dimensions(){return this._renderer.dimensions}_handleIntersectionChange(e){this._isPaused=void 0===e.isIntersecting?0===e.intersectionRatio:!e.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,i=!1){this._isPaused?this._needsFullRefresh=!0:(i||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount))}_renderRows(e,t){this._renderer&&(this._renderer.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0)}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer&&(this._renderer.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions))}hasRenderer(){return!!this._renderer}setRenderer(e){var t;null===(t=this._renderer)||void 0===t||t.dispose(),this._renderer=e,this._renderer.onRequestRedraw((e=>this.refreshRows(e.start,e.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,t;this._renderer&&(null===(t=(e=this._renderer).clearTextureAtlas)||void 0===t||t.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer&&(this._renderer.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.handleResize(e,t))):this._renderer.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){var e;null===(e=this._renderer)||void 0===e||e.handleCharSizeChanged()}handleBlur(){var e;null===(e=this._renderer)||void 0===e||e.handleBlur()}handleFocus(){var e;null===(e=this._renderer)||void 0===e||e.handleFocus()}handleSelectionChanged(e,t,i){var s;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=i,null===(s=this._renderer)||void 0===s||s.handleSelectionChanged(e,t,i)}handleCursorMove(){var e;null===(e=this._renderer)||void 0===e||e.handleCursorMove()}clear(){var e;null===(e=this._renderer)||void 0===e||e.clear()}};u=s([r(2,l.IOptionsService),r(3,d.ICharSizeService),r(4,l.IDecorationService),r(5,l.IBufferService),r(6,d.ICoreBrowserService),r(7,d.IThemeService)],u),t.RenderService=u},9312:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionService=void 0;const n=i(6114),o=i(456),a=i(511),h=i(8460),c=i(4725),l=i(2585),d=i(9806),_=i(9504),u=i(844),f=i(4841),v=String.fromCharCode(160),g=new RegExp(v,"g");let p=class extends u.Disposable{constructor(e,t,i,s,r,n,c,l,d){super(),this._element=e,this._screenElement=t,this._linkifier=i,this._bufferService=s,this._coreService=r,this._mouseService=n,this._optionsService=c,this._renderService=l,this._coreBrowserService=d,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new a.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new h.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new h.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new h.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new h.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=e=>this._handleMouseMove(e),this._mouseUpListener=e=>this._handleMouseUp(e),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((e=>this._handleTrim(e))),this.register(this._bufferService.buffers.onBufferActivate((e=>this._handleBufferActivate(e)))),this.enable(),this._model=new o.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,u.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!(!e||!t||e[0]===t[0]&&e[1]===t[1])}get selectionText(){const e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";const i=this._bufferService.buffer,s=[];if(3===this._activeSelectionMode){if(e[0]===t[0])return"";const r=e[0]e.replace(g," "))).join(n.isWindows?"\r\n":"\n")}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),n.isLinux&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:3===this._activeSelectionMode})}_isClickInSelection(e){const t=this._getMouseBufferCoords(e),i=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!!(i&&s&&t)&&this._areCoordsInSelection(t,i,s)}isCellInSelection(e,t){const i=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!(!i||!s)&&this._areCoordsInSelection([e,t],i,s)}_areCoordsInSelection(e,t,i){return e[1]>t[1]&&e[1]=t[0]&&e[0]=t[0]}_selectWordAtCursor(e,t){var i,s;const r=null===(s=null===(i=this._linkifier.currentLink)||void 0===i?void 0:i.link)||void 0===s?void 0:s.range;if(r)return this._model.selectionStart=[r.start.x-1,r.start.y-1],this._model.selectionStartLength=(0,f.getRangeLength)(r,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const n=this._getMouseBufferCoords(e);return!!n&&(this._selectWordAt(n,t),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){const t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,e,this._screenElement)[1];const i=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=i?0:(t>i&&(t-=i),t=Math.min(Math.max(t,-50),50),t/=50,t/Math.abs(t)+Math.round(14*t))}shouldForceSelection(e){return n.isMac?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,(2!==e.button||!this.hasSelection)&&0===e.button){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):1===e.detail?this._handleSingleClick(e):2===e.detail?this._handleDoubleClick(e):3===e.detail&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&0===t.hasWidth(this._model.selectionStart[0])&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){const t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(n.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;const t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd)return void this.refresh(!0);2===this._activeSelectionMode?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const i=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){const t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<500&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const t=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(t&&void 0!==t[0]&&void 0!==t[1]){const e=(0,_.moveToCellSequence)(t[0]-1,t[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(e,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,i=!(!e||!t||e[0]===t[0]&&e[1]===t[1]);i?e&&t&&(this._oldSelectionStart&&this._oldSelectionEnd&&e[0]===this._oldSelectionStart[0]&&e[1]===this._oldSelectionStart[1]&&t[0]===this._oldSelectionEnd[0]&&t[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(e,t,i)):this._oldHasSelection&&this._fireOnSelectionChange(e,t,i)}_fireOnSelectionChange(e,t,i){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=i,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim((e=>this._handleTrim(e)))}_convertViewportColToCharacterIndex(e,t){let i=t;for(let s=0;t>=s;s++){const r=e.loadCell(s,this._workCell).getChars().length;0===this._workCell.getWidth()?i--:r>1&&t!==s&&(i+=r-1)}return i}setSelection(e,t,i){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=i,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,i=!0,s=!0){if(e[0]>=this._bufferService.cols)return;const r=this._bufferService.buffer,n=r.lines.get(e[1]);if(!n)return;const o=r.translateBufferLineToString(e[1],!1);let a=this._convertViewportColToCharacterIndex(n,e[0]),h=a;const c=e[0]-a;let l=0,d=0,_=0,u=0;if(" "===o.charAt(a)){for(;a>0&&" "===o.charAt(a-1);)a--;for(;h1&&(u+=s-1,h+=s-1);t>0&&a>0&&!this._isCharWordSeparator(n.loadCell(t-1,this._workCell));){n.loadCell(t-1,this._workCell);const e=this._workCell.getChars().length;0===this._workCell.getWidth()?(l++,t--):e>1&&(_+=e-1,a-=e-1),a--,t--}for(;i1&&(u+=e-1,h+=e-1),h++,i++}}h++;let f=a+c-l+_,v=Math.min(this._bufferService.cols,h-a+l+d-_-u);if(t||""!==o.slice(a,h).trim()){if(i&&0===f&&32!==n.getCodePoint(0)){const t=r.lines.get(e[1]-1);if(t&&n.isWrapped&&32!==t.getCodePoint(this._bufferService.cols-1)){const t=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(t){const e=this._bufferService.cols-t.start;f-=e,v+=e}}}if(s&&f+v===this._bufferService.cols&&32!==n.getCodePoint(this._bufferService.cols-1)){const t=r.lines.get(e[1]+1);if((null==t?void 0:t.isWrapped)&&32!==t.getCodePoint(0)){const t=this._getWordAt([0,e[1]+1],!1,!1,!0);t&&(v+=t.length)}}return{start:f,length:v}}}_selectWordAt(e,t){const i=this._getWordAt(e,t);if(i){for(;i.start<0;)i.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[i.start,e[1]],this._model.selectionStartLength=i.length}}_selectToWordAt(e){const t=this._getWordAt(e,!0);if(t){let i=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,i--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,i++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,i]}}_isCharWordSeparator(e){return 0!==e.getWidth()&&this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){const t=this._bufferService.buffer.getWrappedRangeForLine(e),i={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,f.getRangeLength)(i,this._bufferService.cols)}};p=s([r(3,l.IBufferService),r(4,l.ICoreService),r(5,c.IMouseService),r(6,l.IOptionsService),r(7,c.IRenderService),r(8,c.ICoreBrowserService)],p),t.SelectionService=p},4725:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IThemeService=t.ICharacterJoinerService=t.ISelectionService=t.IRenderService=t.IMouseService=t.ICoreBrowserService=t.ICharSizeService=void 0;const s=i(8343);t.ICharSizeService=(0,s.createDecorator)("CharSizeService"),t.ICoreBrowserService=(0,s.createDecorator)("CoreBrowserService"),t.IMouseService=(0,s.createDecorator)("MouseService"),t.IRenderService=(0,s.createDecorator)("RenderService"),t.ISelectionService=(0,s.createDecorator)("SelectionService"),t.ICharacterJoinerService=(0,s.createDecorator)("CharacterJoinerService"),t.IThemeService=(0,s.createDecorator)("ThemeService")},6731:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ThemeService=t.DEFAULT_ANSI_COLORS=void 0;const n=i(7239),o=i(8055),a=i(8460),h=i(844),c=i(2585),l=o.css.toColor("#ffffff"),d=o.css.toColor("#000000"),_=o.css.toColor("#ffffff"),u=o.css.toColor("#000000"),f={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};t.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const e=[o.css.toColor("#2e3436"),o.css.toColor("#cc0000"),o.css.toColor("#4e9a06"),o.css.toColor("#c4a000"),o.css.toColor("#3465a4"),o.css.toColor("#75507b"),o.css.toColor("#06989a"),o.css.toColor("#d3d7cf"),o.css.toColor("#555753"),o.css.toColor("#ef2929"),o.css.toColor("#8ae234"),o.css.toColor("#fce94f"),o.css.toColor("#729fcf"),o.css.toColor("#ad7fa8"),o.css.toColor("#34e2e2"),o.css.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let i=0;i<216;i++){const s=t[i/36%6|0],r=t[i/6%6|0],n=t[i%6];e.push({css:o.channels.toCss(s,r,n),rgba:o.channels.toRgba(s,r,n)})}for(let t=0;t<24;t++){const i=8+10*t;e.push({css:o.channels.toCss(i,i,i),rgba:o.channels.toRgba(i,i,i)})}return e})());let v=class extends h.Disposable{constructor(e){super(),this._optionsService=e,this._onChangeColors=this.register(new a.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._contrastCache=new n.ColorContrastCache,this._colors={foreground:l,background:d,cursor:_,cursorAccent:u,selectionForeground:void 0,selectionBackgroundTransparent:f,selectionBackgroundOpaque:o.color.blend(d,f),selectionInactiveBackgroundTransparent:f,selectionInactiveBackgroundOpaque:o.color.blend(d,f),ansi:t.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}get colors(){return this._colors}_setTheme(e={}){const i=this._colors;if(i.foreground=g(e.foreground,l),i.background=g(e.background,d),i.cursor=g(e.cursor,_),i.cursorAccent=g(e.cursorAccent,u),i.selectionBackgroundTransparent=g(e.selectionBackground,f),i.selectionBackgroundOpaque=o.color.blend(i.background,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundTransparent=g(e.selectionInactiveBackground,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundOpaque=o.color.blend(i.background,i.selectionInactiveBackgroundTransparent),i.selectionForeground=e.selectionForeground?g(e.selectionForeground,o.NULL_COLOR):void 0,i.selectionForeground===o.NULL_COLOR&&(i.selectionForeground=void 0),o.color.isOpaque(i.selectionBackgroundTransparent)){const e=.3;i.selectionBackgroundTransparent=o.color.opacity(i.selectionBackgroundTransparent,e)}if(o.color.isOpaque(i.selectionInactiveBackgroundTransparent)){const e=.3;i.selectionInactiveBackgroundTransparent=o.color.opacity(i.selectionInactiveBackgroundTransparent,e)}if(i.ansi=t.DEFAULT_ANSI_COLORS.slice(),i.ansi[0]=g(e.black,t.DEFAULT_ANSI_COLORS[0]),i.ansi[1]=g(e.red,t.DEFAULT_ANSI_COLORS[1]),i.ansi[2]=g(e.green,t.DEFAULT_ANSI_COLORS[2]),i.ansi[3]=g(e.yellow,t.DEFAULT_ANSI_COLORS[3]),i.ansi[4]=g(e.blue,t.DEFAULT_ANSI_COLORS[4]),i.ansi[5]=g(e.magenta,t.DEFAULT_ANSI_COLORS[5]),i.ansi[6]=g(e.cyan,t.DEFAULT_ANSI_COLORS[6]),i.ansi[7]=g(e.white,t.DEFAULT_ANSI_COLORS[7]),i.ansi[8]=g(e.brightBlack,t.DEFAULT_ANSI_COLORS[8]),i.ansi[9]=g(e.brightRed,t.DEFAULT_ANSI_COLORS[9]),i.ansi[10]=g(e.brightGreen,t.DEFAULT_ANSI_COLORS[10]),i.ansi[11]=g(e.brightYellow,t.DEFAULT_ANSI_COLORS[11]),i.ansi[12]=g(e.brightBlue,t.DEFAULT_ANSI_COLORS[12]),i.ansi[13]=g(e.brightMagenta,t.DEFAULT_ANSI_COLORS[13]),i.ansi[14]=g(e.brightCyan,t.DEFAULT_ANSI_COLORS[14]),i.ansi[15]=g(e.brightWhite,t.DEFAULT_ANSI_COLORS[15]),e.extendedAnsi){const s=Math.min(i.ansi.length-16,e.extendedAnsi.length);for(let r=0;r{Object.defineProperty(t,"__esModule",{value:!0}),t.CircularList=void 0;const s=i(8460),r=i(844);class n extends r.Disposable{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this.register(new s.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new s.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new s.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;const t=new Array(e);for(let i=0;ithis._length)for(let t=this._length;t=e;t--)this._array[this._getCyclicIndex(t+i.length)]=this._array[this._getCyclicIndex(t)];for(let t=0;tthis._maxLength){const e=this._length+i.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=i.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(i>0){for(let s=t-1;s>=0;s--)this.set(e+s+i,this.get(e+s));const s=e+t+i-this._length;if(s>0)for(this._length+=s;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let s=0;s{Object.defineProperty(t,"__esModule",{value:!0}),t.clone=void 0,t.clone=function e(t,i=5){if("object"!=typeof t)return t;const s=Array.isArray(t)?[]:{};for(const r in t)s[r]=i<=1?t[r]:t[r]&&e(t[r],i-1);return s}},8055:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=t.NULL_COLOR=void 0;const s=i(6114);let r=0,n=0,o=0,a=0;var h,c,l;function d(e){const t=e.toString(16);return t.length<2?"0"+t:t}function _(e,t){return e>>0}}(h=t.channels||(t.channels={})),function(e){function t(e,t){return a=Math.round(255*t),[r,n,o]=l.toChannels(e.rgba),{css:h.toCss(r,n,o,a),rgba:h.toRgba(r,n,o,a)}}e.blend=function(e,t){if(a=(255&t.rgba)/255,1===a)return{css:t.css,rgba:t.rgba};const i=t.rgba>>24&255,s=t.rgba>>16&255,c=t.rgba>>8&255,l=e.rgba>>24&255,d=e.rgba>>16&255,_=e.rgba>>8&255;return r=l+Math.round((i-l)*a),n=d+Math.round((s-d)*a),o=_+Math.round((c-_)*a),{css:h.toCss(r,n,o),rgba:h.toRgba(r,n,o)}},e.isOpaque=function(e){return 255==(255&e.rgba)},e.ensureContrastRatio=function(e,t,i){const s=l.ensureContrastRatio(e.rgba,t.rgba,i);if(s)return l.toColor(s>>24&255,s>>16&255,s>>8&255)},e.opaque=function(e){const t=(255|e.rgba)>>>0;return[r,n,o]=l.toChannels(t),{css:h.toCss(r,n,o),rgba:t}},e.opacity=t,e.multiplyOpacity=function(e,i){return a=255&e.rgba,t(e,a*i/255)},e.toColorRGB=function(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}}(t.color||(t.color={})),function(e){let t,i;if(!s.isNode){const e=document.createElement("canvas");e.width=1,e.height=1;const s=e.getContext("2d",{willReadFrequently:!0});s&&(t=s,t.globalCompositeOperation="copy",i=t.createLinearGradient(0,0,1,1))}e.toColor=function(e){if(e.match(/#[\da-f]{3,8}/i))switch(e.length){case 4:return r=parseInt(e.slice(1,2).repeat(2),16),n=parseInt(e.slice(2,3).repeat(2),16),o=parseInt(e.slice(3,4).repeat(2),16),l.toColor(r,n,o);case 5:return r=parseInt(e.slice(1,2).repeat(2),16),n=parseInt(e.slice(2,3).repeat(2),16),o=parseInt(e.slice(3,4).repeat(2),16),a=parseInt(e.slice(4,5).repeat(2),16),l.toColor(r,n,o,a);case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}const s=e.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(s)return r=parseInt(s[1]),n=parseInt(s[2]),o=parseInt(s[3]),a=Math.round(255*(void 0===s[5]?1:parseFloat(s[5]))),l.toColor(r,n,o,a);if(!t||!i)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=i,t.fillStyle=e,"string"!=typeof t.fillStyle)throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[r,n,o,a]=t.getImageData(0,0,1,1).data,255!==a)throw new Error("css.toColor: Unsupported css format");return{rgba:h.toRgba(r,n,o,a),css:e}}}(t.css||(t.css={})),function(e){function t(e,t,i){const s=e/255,r=t/255,n=i/255;return.2126*(s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))}e.relativeLuminance=function(e){return t(e>>16&255,e>>8&255,255&e)},e.relativeLuminance2=t}(c=t.rgb||(t.rgb={})),function(e){function t(e,t,i){const s=e>>24&255,r=e>>16&255,n=e>>8&255;let o=t>>24&255,a=t>>16&255,h=t>>8&255,l=_(c.relativeLuminance2(o,a,h),c.relativeLuminance2(s,r,n));for(;l0||a>0||h>0);)o-=Math.max(0,Math.ceil(.1*o)),a-=Math.max(0,Math.ceil(.1*a)),h-=Math.max(0,Math.ceil(.1*h)),l=_(c.relativeLuminance2(o,a,h),c.relativeLuminance2(s,r,n));return(o<<24|a<<16|h<<8|255)>>>0}function i(e,t,i){const s=e>>24&255,r=e>>16&255,n=e>>8&255;let o=t>>24&255,a=t>>16&255,h=t>>8&255,l=_(c.relativeLuminance2(o,a,h),c.relativeLuminance2(s,r,n));for(;l>>0}e.ensureContrastRatio=function(e,s,r){const n=c.relativeLuminance(e>>8),o=c.relativeLuminance(s>>8);if(_(n,o)>8));if(a_(n,c.relativeLuminance(t>>8))?o:t}return o}const a=i(e,s,r),h=_(n,c.relativeLuminance(a>>8));if(h_(n,c.relativeLuminance(i>>8))?a:i}return a}},e.reduceLuminance=t,e.increaseLuminance=i,e.toChannels=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},e.toColor=function(e,t,i,s){return{css:h.toCss(e,t,i,s),rgba:h.toRgba(e,t,i,s)}}}(l=t.rgba||(t.rgba={})),t.toPaddedHex=d,t.contrastRatio=_},8969:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreTerminal=void 0;const s=i(844),r=i(2585),n=i(4348),o=i(7866),a=i(744),h=i(7302),c=i(6975),l=i(8460),d=i(1753),_=i(1480),u=i(7994),f=i(9282),v=i(5435),g=i(5981),p=i(2660);let S=!1;class m extends s.Disposable{constructor(e){super(),this._onBinary=this.register(new l.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new l.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new l.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new l.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new l.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new l.EventEmitter),this._instantiationService=new n.InstantiationService,this.optionsService=this.register(new h.OptionsService(e)),this._instantiationService.setService(r.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(a.BufferService)),this._instantiationService.setService(r.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(o.LogService)),this._instantiationService.setService(r.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(c.CoreService,(()=>this.scrollToBottom()))),this._instantiationService.setService(r.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(d.CoreMouseService)),this._instantiationService.setService(r.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(_.UnicodeService)),this._instantiationService.setService(r.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(u.CharsetService),this._instantiationService.setService(r.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(p.OscLinkService),this._instantiationService.setService(r.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new v.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,l.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,l.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,l.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,l.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onSpecificOptionChange("windowsMode",(e=>this._handleWindowsModeOptionChange(e)))),this.register(this._bufferService.onScroll((e=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((e=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new g.WriteBuffer(((e,t)=>this._inputHandler.parse(e,t)))),this.register((0,l.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed)),this.register((0,s.toDisposable)((()=>{var e;null===(e=this._windowsMode)||void 0===e||e.dispose(),this._windowsMode=void 0})))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new l.EventEmitter),this._onScroll.event((e=>{var t;null===(t=this._onScrollApi)||void 0===t||t.fire(e.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(const t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=r.LogLevelEnum.WARN&&!S&&(this._logService.warn("writeSync is unreliable and will be removed soon."),S=!0),this._writeBuffer.writeSync(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,a.MINIMUM_COLS),t=Math.max(t,a.MINIMUM_ROWS),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t,i){this._bufferService.scrollLines(e,t,i)}scrollPages(e){this._bufferService.scrollPages(e)}scrollToTop(){this._bufferService.scrollToTop()}scrollToBottom(){this._bufferService.scrollToBottom()}scrollToLine(e){this._bufferService.scrollToLine(e)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this.optionsService.rawOptions.windowsMode&&this._enableWindowsMode()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsModeOptionChange(e){var t;e?this._enableWindowsMode():(null===(t=this._windowsMode)||void 0===t||t.dispose(),this._windowsMode=void 0)}_enableWindowsMode(){if(!this._windowsMode){const e=[];e.push(this.onLineFeed(f.updateWindowsModeWrappedState.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},(()=>((0,f.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsMode={dispose:()=>{for(const t of e)t.dispose()}}}}}t.CoreTerminal=m},8460:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=e=>(this._listeners.push(e),{dispose:()=>{if(!this._disposed)for(let t=0;tt.fire(e)))}},5435:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InputHandler=t.WindowsOptionsReportType=void 0;const n=i(2584),o=i(7116),a=i(2015),h=i(844),c=i(482),l=i(8437),d=i(8460),_=i(643),u=i(511),f=i(3734),v=i(2585),g=i(6242),p=i(6351),S=i(5941),m={"(":0,")":1,"*":2,"+":3,"-":1,".":2},C=131072;function b(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var y;!function(e){e[e.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",e[e.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"}(y=t.WindowsOptionsReportType||(t.WindowsOptionsReportType={}));let w=0;class E extends h.Disposable{constructor(e,t,i,s,r,h,_,f,v=new a.EscapeSequenceParser){super(),this._bufferService=e,this._charsetService=t,this._coreService=i,this._logService=s,this._optionsService=r,this._oscLinkService=h,this._coreMouseService=_,this._unicodeService=f,this._parser=v,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new c.StringToUtf32,this._utf8Decoder=new c.Utf8ToUtf32,this._workCell=new u.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=l.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=l.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new d.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new d.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new d.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new d.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new d.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new d.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new d.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new d.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new d.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new d.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new d.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new d.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new L(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((e=>this._activeBuffer=e.activeBuffer))),this._parser.setCsiHandlerFallback(((e,t)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(e),params:t.toArray()})})),this._parser.setEscHandlerFallback((e=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(e)})})),this._parser.setExecuteHandlerFallback((e=>{this._logService.debug("Unknown EXECUTE code: ",{code:e})})),this._parser.setOscHandlerFallback(((e,t,i)=>{this._logService.debug("Unknown OSC code: ",{identifier:e,action:t,data:i})})),this._parser.setDcsHandlerFallback(((e,t,i)=>{"HOOK"===t&&(i=i.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(e),action:t,payload:i})})),this._parser.setPrintHandler(((e,t,i)=>this.print(e,t,i))),this._parser.registerCsiHandler({final:"@"},(e=>this.insertChars(e))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(e=>this.scrollLeft(e))),this._parser.registerCsiHandler({final:"A"},(e=>this.cursorUp(e))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(e=>this.scrollRight(e))),this._parser.registerCsiHandler({final:"B"},(e=>this.cursorDown(e))),this._parser.registerCsiHandler({final:"C"},(e=>this.cursorForward(e))),this._parser.registerCsiHandler({final:"D"},(e=>this.cursorBackward(e))),this._parser.registerCsiHandler({final:"E"},(e=>this.cursorNextLine(e))),this._parser.registerCsiHandler({final:"F"},(e=>this.cursorPrecedingLine(e))),this._parser.registerCsiHandler({final:"G"},(e=>this.cursorCharAbsolute(e))),this._parser.registerCsiHandler({final:"H"},(e=>this.cursorPosition(e))),this._parser.registerCsiHandler({final:"I"},(e=>this.cursorForwardTab(e))),this._parser.registerCsiHandler({final:"J"},(e=>this.eraseInDisplay(e,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(e=>this.eraseInDisplay(e,!0))),this._parser.registerCsiHandler({final:"K"},(e=>this.eraseInLine(e,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(e=>this.eraseInLine(e,!0))),this._parser.registerCsiHandler({final:"L"},(e=>this.insertLines(e))),this._parser.registerCsiHandler({final:"M"},(e=>this.deleteLines(e))),this._parser.registerCsiHandler({final:"P"},(e=>this.deleteChars(e))),this._parser.registerCsiHandler({final:"S"},(e=>this.scrollUp(e))),this._parser.registerCsiHandler({final:"T"},(e=>this.scrollDown(e))),this._parser.registerCsiHandler({final:"X"},(e=>this.eraseChars(e))),this._parser.registerCsiHandler({final:"Z"},(e=>this.cursorBackwardTab(e))),this._parser.registerCsiHandler({final:"`"},(e=>this.charPosAbsolute(e))),this._parser.registerCsiHandler({final:"a"},(e=>this.hPositionRelative(e))),this._parser.registerCsiHandler({final:"b"},(e=>this.repeatPrecedingCharacter(e))),this._parser.registerCsiHandler({final:"c"},(e=>this.sendDeviceAttributesPrimary(e))),this._parser.registerCsiHandler({prefix:">",final:"c"},(e=>this.sendDeviceAttributesSecondary(e))),this._parser.registerCsiHandler({final:"d"},(e=>this.linePosAbsolute(e))),this._parser.registerCsiHandler({final:"e"},(e=>this.vPositionRelative(e))),this._parser.registerCsiHandler({final:"f"},(e=>this.hVPosition(e))),this._parser.registerCsiHandler({final:"g"},(e=>this.tabClear(e))),this._parser.registerCsiHandler({final:"h"},(e=>this.setMode(e))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(e=>this.setModePrivate(e))),this._parser.registerCsiHandler({final:"l"},(e=>this.resetMode(e))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(e=>this.resetModePrivate(e))),this._parser.registerCsiHandler({final:"m"},(e=>this.charAttributes(e))),this._parser.registerCsiHandler({final:"n"},(e=>this.deviceStatus(e))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(e=>this.deviceStatusPrivate(e))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(e=>this.softReset(e))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(e=>this.setCursorStyle(e))),this._parser.registerCsiHandler({final:"r"},(e=>this.setScrollRegion(e))),this._parser.registerCsiHandler({final:"s"},(e=>this.saveCursor(e))),this._parser.registerCsiHandler({final:"t"},(e=>this.windowOptions(e))),this._parser.registerCsiHandler({final:"u"},(e=>this.restoreCursor(e))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(e=>this.insertColumns(e))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(e=>this.deleteColumns(e))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(e=>this.selectProtected(e))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(e=>this.requestMode(e,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(e=>this.requestMode(e,!1))),this._parser.setExecuteHandler(n.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(n.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(n.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(n.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(n.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(n.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(n.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(n.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(n.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(n.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(n.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(n.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new g.OscHandler((e=>(this.setTitle(e),this.setIconName(e),!0)))),this._parser.registerOscHandler(1,new g.OscHandler((e=>this.setIconName(e)))),this._parser.registerOscHandler(2,new g.OscHandler((e=>this.setTitle(e)))),this._parser.registerOscHandler(4,new g.OscHandler((e=>this.setOrReportIndexedColor(e)))),this._parser.registerOscHandler(8,new g.OscHandler((e=>this.setHyperlink(e)))),this._parser.registerOscHandler(10,new g.OscHandler((e=>this.setOrReportFgColor(e)))),this._parser.registerOscHandler(11,new g.OscHandler((e=>this.setOrReportBgColor(e)))),this._parser.registerOscHandler(12,new g.OscHandler((e=>this.setOrReportCursorColor(e)))),this._parser.registerOscHandler(104,new g.OscHandler((e=>this.restoreIndexedColor(e)))),this._parser.registerOscHandler(110,new g.OscHandler((e=>this.restoreFgColor(e)))),this._parser.registerOscHandler(111,new g.OscHandler((e=>this.restoreBgColor(e)))),this._parser.registerOscHandler(112,new g.OscHandler((e=>this.restoreCursorColor(e)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const e in o.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:e},(()=>this.selectCharset("("+e))),this._parser.registerEscHandler({intermediates:")",final:e},(()=>this.selectCharset(")"+e))),this._parser.registerEscHandler({intermediates:"*",final:e},(()=>this.selectCharset("*"+e))),this._parser.registerEscHandler({intermediates:"+",final:e},(()=>this.selectCharset("+"+e))),this._parser.registerEscHandler({intermediates:"-",final:e},(()=>this.selectCharset("-"+e))),this._parser.registerEscHandler({intermediates:".",final:e},(()=>this.selectCharset("."+e))),this._parser.registerEscHandler({intermediates:"/",final:e},(()=>this.selectCharset("/"+e)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((e=>(this._logService.error("Parsing error: ",e),e))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new p.DcsHandler(((e,t)=>this.requestStatusString(e,t))))}getAttrData(){return this._curAttrData}_preserveStack(e,t,i,s){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=i,this._parseStack.position=s}_logSlowResolvingAsync(e){this._logService.logLevel<=v.LogLevelEnum.WARN&&Promise.race([e,new Promise(((e,t)=>setTimeout((()=>t("#SLOW_TIMEOUT")),5e3)))]).catch((e=>{if("#SLOW_TIMEOUT"!==e)throw e;console.warn("async parser handler taking longer than 5000 ms")}))}parse(e,t){let i,s=this._activeBuffer.x,r=this._activeBuffer.y,n=0;const o=this._parseStack.paused;if(o){if(i=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(i),i;s=this._parseStack.cursorStartX,r=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>C&&(n=this._parseStack.position+C)}if(this._logService.logLevel<=v.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+("string"==typeof e?` "${e}"`:` "${Array.prototype.map.call(e,(e=>String.fromCharCode(e))).join("")}"`),"string"==typeof e?e.split("").map((e=>e.charCodeAt(0))):e),this._parseBuffer.lengthC)for(let t=n;t0&&2===u.getWidth(this._activeBuffer.x-1)&&u.setCellFromCodePoint(this._activeBuffer.x-1,0,1,d.fg,d.bg,d.extended);for(let f=t;f=a)if(h){for(;this._activeBuffer.x=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),u=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=a-1,2===r)continue;if(l&&(u.insertCells(this._activeBuffer.x,r,this._activeBuffer.getNullCell(d),d),2===u.getWidth(a-1)&&u.setCellFromCodePoint(a-1,_.NULL_CELL_CODE,_.NULL_CELL_WIDTH,d.fg,d.bg,d.extended)),u.setCellFromCodePoint(this._activeBuffer.x++,s,r,d.fg,d.bg,d.extended),r>0)for(;--r;)u.setCellFromCodePoint(this._activeBuffer.x++,0,0,d.fg,d.bg,d.extended)}else u.getWidth(this._activeBuffer.x-1)?u.addCodepointToCell(this._activeBuffer.x-1,s):u.addCodepointToCell(this._activeBuffer.x-2,s)}i-t>0&&(u.loadCell(this._activeBuffer.x-1,this._workCell),2===this._workCell.getWidth()||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x0&&0===u.getWidth(this._activeBuffer.x)&&!u.hasContent(this._activeBuffer.x)&&u.setCellFromCodePoint(this._activeBuffer.x,0,1,d.fg,d.bg,d.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return"t"!==e.final||e.prefix||e.intermediates?this._parser.registerCsiHandler(e,t):this._parser.registerCsiHandler(e,(e=>!b(e.params[0],this._optionsService.rawOptions.windowOptions)||t(e)))}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new p.DcsHandler(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new g.OscHandler(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var e;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(0===this._activeBuffer.x&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&(null===(e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))||void 0===e?void 0:e.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){const t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){const t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){const t=e.params[0];return 0===t?delete this._activeBuffer.tabs[this._activeBuffer.x]:3===t&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){const t=e.params[0];return 1===t&&(this._curAttrData.bg|=536870912),2!==t&&0!==t||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,i,s=!1,r=!1){const n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.replaceCells(t,i,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),r),s&&(n.isWrapped=!1)}_resetBufferLine(e,t=!1){const i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),i.isWrapped=!1}eraseInDisplay(e,t=!1){let i;switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i++,this._activeBuffer.x,this._bufferService.cols,0===this._activeBuffer.x,t);i=this._bufferService.cols&&(this._activeBuffer.lines.get(i+1).isWrapped=!1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0);break;case 2:for(i=this._bufferService.rows,this._dirtyRowTracker.markDirty(i-1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0);break;case 3:const e=this._activeBuffer.lines.length-this._bufferService.rows;e>0&&(this._activeBuffer.lines.trimStart(e),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-e,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-e,0),this._onScroll.fire(0))}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,0===this._activeBuffer.x,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(n.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(n.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(n.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(n.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(n.C0.ESC+"[>83;40003;0c")),!0}_is(e){return 0===(this._optionsService.rawOptions.termName+"").indexOf(e)}setMode(e){for(let t=0;te?1:2,u=e.params[0];return f=u,v=t?2===u?3:4===u?_(o.modes.insertMode):12===u?4:20===u?_(d.convertEol):0:1===u?_(i.applicationCursorKeys):3===u?d.windowOptions.setWinLines?80===h?2:132===h?1:0:0:6===u?_(i.origin):7===u?_(i.wraparound):8===u?3:9===u?_("X10"===s):12===u?_(d.cursorBlink):25===u?_(!o.isCursorHidden):45===u?_(i.reverseWraparound):66===u?_(i.applicationKeypad):1e3===u?_("VT200"===s):1002===u?_("DRAG"===s):1003===u?_("ANY"===s):1004===u?_(i.sendFocus):1005===u?4:1006===u?_("SGR"===r):1015===u?4:1016===u?_("SGR_PIXELS"===r):1048===u?1:47===u||1047===u||1049===u?_(c===l):2004===u?_(i.bracketedPasteMode):0,o.triggerDataEvent(`${n.C0.ESC}[${t?"":"?"}${f};${v}$y`),!0;var f,v}_updateAttrColor(e,t,i,s,r){return 2===t?(e|=50331648,e&=-16777216,e|=f.AttributeData.fromColorRGB([i,s,r])):5===t&&(e&=-50331904,e|=33554432|255&i),e}_extractColor(e,t,i){const s=[0,0,-1,0,0,0];let r=0,n=0;do{if(s[n+r]=e.params[t+n],e.hasSubParams(t+n)){const i=e.getSubParams(t+n);let o=0;do{5===s[1]&&(r=1),s[n+o+1+r]=i[o]}while(++o=2||2===s[1]&&n+r>=5)break;s[1]&&(r=1)}while(++n+t5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,0===e&&(t.fg&=-268435457),t.updateExtended()}charAttributes(e){if(1===e.length&&0===e.params[0])return this._curAttrData.fg=l.DEFAULT_ATTR_DATA.fg,this._curAttrData.bg=l.DEFAULT_ATTR_DATA.bg,!0;const t=e.length;let i;const s=this._curAttrData;for(let r=0;r=30&&i<=37?(s.fg&=-50331904,s.fg|=16777216|i-30):i>=40&&i<=47?(s.bg&=-50331904,s.bg|=16777216|i-40):i>=90&&i<=97?(s.fg&=-50331904,s.fg|=16777224|i-90):i>=100&&i<=107?(s.bg&=-50331904,s.bg|=16777224|i-100):0===i?(s.fg=l.DEFAULT_ATTR_DATA.fg,s.bg=l.DEFAULT_ATTR_DATA.bg):1===i?s.fg|=134217728:3===i?s.bg|=67108864:4===i?(s.fg|=268435456,this._processUnderline(e.hasSubParams(r)?e.getSubParams(r)[0]:1,s)):5===i?s.fg|=536870912:7===i?s.fg|=67108864:8===i?s.fg|=1073741824:9===i?s.fg|=2147483648:2===i?s.bg|=134217728:21===i?this._processUnderline(2,s):22===i?(s.fg&=-134217729,s.bg&=-134217729):23===i?s.bg&=-67108865:24===i?(s.fg&=-268435457,this._processUnderline(0,s)):25===i?s.fg&=-536870913:27===i?s.fg&=-67108865:28===i?s.fg&=-1073741825:29===i?s.fg&=2147483647:39===i?(s.fg&=-67108864,s.fg|=16777215&l.DEFAULT_ATTR_DATA.fg):49===i?(s.bg&=-67108864,s.bg|=16777215&l.DEFAULT_ATTR_DATA.bg):38===i||48===i||58===i?r+=this._extractColor(e,r,s):59===i?(s.extended=s.extended.clone(),s.extended.underlineColor=-1,s.updateExtended()):100===i?(s.fg&=-67108864,s.fg|=16777215&l.DEFAULT_ATTR_DATA.fg,s.bg&=-67108864,s.bg|=16777215&l.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",i);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${n.C0.ESC}[0n`);break;case 6:const e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[${e};${t}R`)}return!0}deviceStatusPrivate(e){if(6===e.params[0]){const e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[?${e};${t}R`)}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=l.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){const t=e.params[0]||1;switch(t){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const i=t%2==1;return this._optionsService.options.cursorBlink=i,!0}setScrollRegion(e){const t=e.params[0]||1;let i;return(e.length<2||(i=e.params[1])>this._bufferService.rows||0===i)&&(i=this._bufferService.rows),i>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=i-1,this._setCursor(0,0)),!0}windowOptions(e){if(!b(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;const t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:2!==t&&this._onRequestWindowsOptionsReport.fire(y.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(y.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${n.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:0!==t&&2!==t||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),0!==t&&1!==t||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:0!==t&&2!==t||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),0!==t&&1!==t||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){const t=[],i=e.split(";");for(;i.length>1;){const e=i.shift(),s=i.shift();if(/^\d+$/.exec(e)){const i=parseInt(e);if(0<=i&&i<256)if("?"===s)t.push({type:0,index:i});else{const e=(0,S.parseColor)(s);e&&t.push({type:1,index:i,color:e})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){const t=e.split(";");return!(t.length<2)&&(t[1]?this._createHyperlink(t[0],t[1]):!t[0]&&this._finishHyperlink())}_createHyperlink(e,t){void 0!==this._currentLinkId&&this._finishHyperlink();const i=e.split(":");let s;const r=i.findIndex((e=>e.startsWith("id=")));return-1!==r&&(s=i[r].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._currentLinkId=this._oscLinkService.registerLink({id:s,uri:t}),this._curAttrData.extended.urlId=this._currentLinkId,this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),this._currentLinkId=void 0,!0}_setOrReportSpecialColor(e,t){const i=e.split(";");for(let e=0;e=this._specialColors.length);++e,++t)if("?"===i[e])this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{const s=(0,S.parseColor)(i[e]);s&&this._onColor.fire([{type:1,index:this._specialColors[t],color:s}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;const t=[],i=e.split(";");for(let e=0;e=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=l.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=l.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){const e=new u.CellData;e.content=1<<22|"E".charCodeAt(0),e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t(this._coreService.triggerDataEvent(`${n.C0.ESC}${e}${n.C0.ESC}\\`),!0))('"q'===e?`P1$r${this._curAttrData.isProtected()?1:0}"q`:'"p'===e?'P1$r61;1"p':"r"===e?`P1$r${i.scrollTop+1};${i.scrollBottom+1}r`:"m"===e?"P1$r0m":" q"===e?`P1$r${{block:2,underline:4,bar:6}[s.cursorStyle]-(s.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}}t.InputHandler=E;let L=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){ethis.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(w=e,e=t,t=w),ethis.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};L=s([r(0,v.IBufferService)],L)},844:(e,t)=>{function i(e){for(const t of e)t.dispose();e.length=0}Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const e of this._disposables)e.dispose();this._disposables.length=0}register(e){return this._disposables.push(e),e}unregister(e){const t=this._disposables.indexOf(e);-1!==t&&this._disposables.splice(t,1)}},t.toDisposable=function(e){return{dispose:e}},t.disposeArray=i,t.getDisposeArrayDisposable=function(e){return{dispose:()=>i(e)}}},1505:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class i{constructor(){this._data={}}set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}}t.TwoKeyMap=i,t.FourKeyMap=class{constructor(){this._data=new i}set(e,t,s,r,n){this._data.get(e,t)||this._data.set(e,t,new i),this._data.get(e,t).set(s,r,n)}get(e,t,i,s){var r;return null===(r=this._data.get(e,t))||void 0===r?void 0:r.get(i,s)}clear(){this._data.clear()}}},6114:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.isSafari=t.isLegacyEdge=t.isFirefox=t.isNode=void 0,t.isNode="undefined"==typeof navigator;const i=t.isNode?"node":navigator.userAgent,s=t.isNode?"node":navigator.platform;t.isFirefox=i.includes("Firefox"),t.isLegacyEdge=i.includes("Edge"),t.isSafari=/^((?!chrome|android).)*safari/i.test(i),t.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(s),t.isIpad="iPad"===s,t.isIphone="iPhone"===s,t.isWindows=["Windows","Win16","Win32","WinCE"].includes(s),t.isLinux=s.indexOf("Linux")>=0},6106:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SortedList=void 0;let i=0;t.SortedList=class{constructor(e){this._getKey=e,this._array=[]}clear(){this._array.length=0}insert(e){0!==this._array.length?(i=this._search(this._getKey(e),0,this._array.length-1),this._array.splice(i,0,e)):this._array.push(e)}delete(e){if(0===this._array.length)return!1;const t=this._getKey(e);if(void 0===t)return!1;if(i=this._search(t,0,this._array.length-1),-1===i)return!1;if(this._getKey(this._array[i])!==t)return!1;do{if(this._array[i]===e)return this._array.splice(i,1),!0}while(++i=this._array.length)&&this._getKey(this._array[i])===e))do{yield this._array[i]}while(++i=this._array.length)&&this._getKey(this._array[i])===e))do{t(this._array[i])}while(++ie)return this._search(e,t,s-1);if(r0&&this._getKey(this._array[s-1])===e;)s--;return s}}},7226:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DebouncedIdleTask=t.IdleTaskQueue=t.PriorityTaskQueue=void 0;const s=i(6114);class r{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._ie.timeRemaining())return void this._start();this.clear()}}class n extends r{_requestCallback(e){return setTimeout((()=>e(this._createDeadline(16))))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){const t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}}t.PriorityTaskQueue=n,t.IdleTaskQueue=!s.isNode&&"requestIdleCallback"in window?class extends r{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}}:n,t.DebouncedIdleTask=class{constructor(){this._queue=new t.IdleTaskQueue}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}}},8273:(e,t)=>{function i(e,t,i=0,s=e.length){if(i>=e.length)return e;i=(e.length+i)%e.length,s=s>=e.length?e.length:(e.length+s)%e.length;for(let r=i;r{Object.defineProperty(t,"__esModule",{value:!0}),t.updateWindowsModeWrappedState=void 0;const s=i(643);t.updateWindowsModeWrappedState=function(e){const t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1),i=null==t?void 0:t.get(e.cols-1),r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);r&&i&&(r.isWrapped=i[s.CHAR_DATA_CODE_INDEX]!==s.NULL_CELL_CODE&&i[s.CHAR_DATA_CODE_INDEX]!==s.WHITESPACE_CELL_CODE)}},3734:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class i{constructor(){this.fg=0,this.bg=0,this.extended=new s}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){const e=new i;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underlineStyle?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return 50331648==(50331648&this.fg)}isBgRGB(){return 50331648==(50331648&this.bg)}isFgPalette(){return 16777216==(50331648&this.fg)||33554432==(50331648&this.fg)}isBgPalette(){return 16777216==(50331648&this.bg)||33554432==(50331648&this.bg)}isFgDefault(){return 0==(50331648&this.fg)}isBgDefault(){return 0==(50331648&this.bg)}isAttributeDefault(){return 0===this.fg&&0===this.bg}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?50331648==(50331648&this.extended.underlineColor):this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?16777216==(50331648&this.extended.underlineColor)||33554432==(50331648&this.extended.underlineColor):this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?0==(50331648&this.extended.underlineColor):this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}t.AttributeData=i;class s{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(e){this._ext&=-67108864,this._ext|=67108863&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}clone(){return new s(this._ext,this._urlId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId}}t.ExtendedAttrs=s},9092:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferStringIterator=t.Buffer=t.MAX_BUFFER_SIZE=void 0;const s=i(6349),r=i(8437),n=i(511),o=i(643),a=i(4634),h=i(4863),c=i(7116),l=i(3734);t.MAX_BUFFER_SIZE=4294967295,t.Buffer=class{constructor(e,t,i){this._hasScrollback=e,this._optionsService=t,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=r.DEFAULT_ATTR_DATA.clone(),this.savedCharset=c.DEFAULT_CHARSET,this.markers=[],this._nullCell=n.CellData.fromCharData([0,o.NULL_CELL_CHAR,o.NULL_CELL_WIDTH,o.NULL_CELL_CODE]),this._whitespaceCell=n.CellData.fromCharData([0,o.WHITESPACE_CELL_CHAR,o.WHITESPACE_CELL_WIDTH,o.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new s.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new l.ExtendedAttrs),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new l.ExtendedAttrs),this._whitespaceCell}getBlankLine(e,t){return new r.BufferLine(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const e=this.ybase+this.y-this.ydisp;return e>=0&&et.MAX_BUFFER_SIZE?t.MAX_BUFFER_SIZE:i}fillViewportRows(e){if(0===this.lines.length){void 0===e&&(e=r.DEFAULT_ATTR_DATA);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new s.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){const i=this.getNullCell(r.DEFAULT_ATTR_DATA),s=this._getCorrectBufferLength(t);if(s>this.lines.maxLength&&(this.lines.maxLength=s),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+n+1?(this.ybase--,n++,this.ydisp>0&&this.ydisp--):this.lines.push(new r.BufferLine(e,i)));else for(let e=this._rows;e>t;e--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(s0&&(this.lines.trimStart(e),this.ybase=Math.max(this.ybase-e,0),this.ydisp=Math.max(this.ydisp-e,0),this.savedY=Math.max(this.savedY-e,0)),this.lines.maxLength=s}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),n&&(this.y+=n),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let t=0;tthis._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){const i=(0,a.reflowLargerGetLinesToRemove)(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(r.DEFAULT_ATTR_DATA));if(i.length>0){const s=(0,a.reflowLargerCreateNewLayout)(this.lines,i);(0,a.reflowLargerApplyNewLayout)(this.lines,s.layout),this._reflowLargerAdjustViewport(e,t,s.countRemoved)}}_reflowLargerAdjustViewport(e,t,i){const s=this.getNullCell(r.DEFAULT_ATTR_DATA);let n=i;for(;n-- >0;)0===this.ybase?(this.y>0&&this.y--,this.lines.length=0;o--){let h=this.lines.get(o);if(!h||!h.isWrapped&&h.getTrimmedLength()<=e)continue;const c=[h];for(;h.isWrapped&&o>0;)h=this.lines.get(--o),c.unshift(h);const l=this.ybase+this.y;if(l>=o&&l0&&(s.push({start:o+c.length+n,newLines:v}),n+=v.length),c.push(...v);let g=_.length-1,p=_[g];0===p&&(g--,p=_[g]);let S=c.length-u-1,m=d;for(;S>=0;){const e=Math.min(m,p);if(void 0===c[g])break;if(c[g].copyCellsFrom(c[S],m-e,p-e,e,!0),p-=e,0===p&&(g--,p=_[g]),m-=e,0===m){S--;const e=Math.max(S,0);m=(0,a.getWrappedLineTrimmedLength)(c,e,this._cols)}}for(let t=0;t0;)0===this.ybase?this.y0){const e=[],t=[];for(let e=0;e=0;c--)if(a&&a.start>r+h){for(let e=a.newLines.length-1;e>=0;e--)this.lines.set(c--,a.newLines[e]);c++,e.push({index:r+1,amount:a.newLines.length}),h+=a.newLines.length,a=s[++o]}else this.lines.set(c,t[r--]);let c=0;for(let t=e.length-1;t>=0;t--)e[t].index+=c,this.lines.onInsertEmitter.fire(e[t]),c+=e[t].amount;const l=Math.max(0,i+n-this.lines.maxLength);l>0&&this.lines.onTrimEmitter.fire(l)}}stringIndexToBufferIndex(e,t,i=!1){for(;t;){const s=this.lines.get(e);if(!s)return[-1,-1];const r=i?s.getTrimmedLength():s.length;for(let i=0;i0&&this.lines.get(t).isWrapped;)t--;for(;i+10;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(null==e&&(e=this.x);!this.tabs[++e]&&e=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t{t.line-=e,t.line<0&&t.dispose()}))),t.register(this.lines.onInsert((e=>{t.line>=e.index&&(t.line+=e.amount)}))),t.register(this.lines.onDelete((e=>{t.line>=e.index&&t.linee.index&&(t.line-=e.amount)}))),t.register(t.onDispose((()=>this._removeMarker(t)))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}iterator(e,t,i,s,r){return new d(this,e,t,i,s,r)}};class d{constructor(e,t,i=0,s=e.lines.length,r=0,n=0){this._buffer=e,this._trimRight=t,this._startIndex=i,this._endIndex=s,this._startOverscan=r,this._endOverscan=n,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}hasNext(){return this._currentthis._endIndex+this._endOverscan&&(e.last=this._endIndex+this._endOverscan),e.first=Math.max(e.first,0),e.last=Math.min(e.last,this._buffer.lines.length);let t="";for(let i=e.first;i<=e.last;++i)t+=this._buffer.translateBufferLineToString(i,this._trimRight);return this._current=e.last+1,{range:e,content:t}}}t.BufferStringIterator=d},8437:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLine=t.DEFAULT_ATTR_DATA=void 0;const s=i(482),r=i(643),n=i(511),o=i(3734);t.DEFAULT_ATTR_DATA=Object.freeze(new o.AttributeData);let a=0;class h{constructor(e,t,i=!1){this.isWrapped=i,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);const s=t||n.CellData.fromCharData([0,r.NULL_CELL_CHAR,r.NULL_CELL_WIDTH,r.NULL_CELL_CODE]);for(let t=0;t>22,2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):i]}set(e,t){this._data[3*e+1]=t[r.CHAR_DATA_ATTR_INDEX],t[r.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e]=t[1],this._data[3*e+0]=2097152|e|t[r.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=t[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|t[r.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(e){return this._data[3*e+0]>>22}hasWidth(e){return 12582912&this._data[3*e+0]}getFg(e){return this._data[3*e+1]}getBg(e){return this._data[3*e+2]}hasContent(e){return 4194303&this._data[3*e+0]}getCodePoint(e){const t=this._data[3*e+0];return 2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&t}isCombined(e){return 2097152&this._data[3*e+0]}getString(e){const t=this._data[3*e+0];return 2097152&t?this._combined[e]:2097151&t?(0,s.stringFromCodePoint)(2097151&t):""}isProtected(e){return 536870912&this._data[3*e+2]}loadCell(e,t){return a=3*e,t.content=this._data[a+0],t.fg=this._data[a+1],t.bg=this._data[a+2],2097152&t.content&&(t.combinedData=this._combined[e]),268435456&t.bg&&(t.extended=this._extendedAttrs[e]),t}setCell(e,t){2097152&t.content&&(this._combined[e]=t.combinedData),268435456&t.bg&&(this._extendedAttrs[e]=t.extended),this._data[3*e+0]=t.content,this._data[3*e+1]=t.fg,this._data[3*e+2]=t.bg}setCellFromCodePoint(e,t,i,s,r,n){268435456&r&&(this._extendedAttrs[e]=n),this._data[3*e+0]=t|i<<22,this._data[3*e+1]=s,this._data[3*e+2]=r}addCodepointToCell(e,t){let i=this._data[3*e+0];2097152&i?this._combined[e]+=(0,s.stringFromCodePoint)(t):(2097151&i?(this._combined[e]=(0,s.stringFromCodePoint)(2097151&i)+(0,s.stringFromCodePoint)(t),i&=-2097152,i|=2097152):i=t|1<<22,this._data[3*e+0]=i)}insertCells(e,t,i,s){if((e%=this.length)&&2===this.getWidth(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null==s?void 0:s.fg)||0,(null==s?void 0:s.bg)||0,(null==s?void 0:s.extended)||new o.ExtendedAttrs),t=0;--i)this.setCell(e+t+i,this.loadCell(e+i,s));for(let s=0;sthis.length){const i=new Uint32Array(3*e);this.length&&(3*e=e&&delete this._combined[s]}}else this._data=new Uint32Array(0),this._combined={};this.length=e}}fill(e,t=!1){if(t)for(let t=0;t=0;--e)if(4194303&this._data[3*e+0])return e+(this._data[3*e+0]>>22);return 0}copyCellsFrom(e,t,i,s,r){const n=e._data;if(r)for(let r=s-1;r>=0;r--){for(let e=0;e<3;e++)this._data[3*(i+r)+e]=n[3*(t+r)+e];268435456&n[3*(t+r)+2]&&(this._extendedAttrs[i+r]=e._extendedAttrs[t+r])}else for(let r=0;r=t&&(this._combined[r-t+i]=e._combined[r])}}translateToString(e=!1,t=0,i=this.length){e&&(i=Math.min(i,this.getTrimmedLength()));let n="";for(;t>22||1}return n}}t.BufferLine=h},4841:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRangeLength=void 0,t.getRangeLength=function(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}},4634:(e,t)=>{function i(e,t,i){if(t===e.length-1)return e[t].getTrimmedLength();const s=!e[t].hasContent(i-1)&&1===e[t].getWidth(i-1),r=2===e[t+1].getWidth(0);return s&&r?i-1:i}Object.defineProperty(t,"__esModule",{value:!0}),t.getWrappedLineTrimmedLength=t.reflowSmallerGetNewLineLengths=t.reflowLargerApplyNewLayout=t.reflowLargerCreateNewLayout=t.reflowLargerGetLinesToRemove=void 0,t.reflowLargerGetLinesToRemove=function(e,t,s,r,n){const o=[];for(let a=0;a=a&&r0&&(e>d||0===l[e].getTrimmedLength());e--)v++;v>0&&(o.push(a+l.length-v),o.push(v)),a+=l.length-1}return o},t.reflowLargerCreateNewLayout=function(e,t){const i=[];let s=0,r=t[s],n=0;for(let o=0;oi(e,r,t))).reduce(((e,t)=>e+t));let o=0,a=0,h=0;for(;hc&&(o-=c,a++);const l=2===e[a].getWidth(o-1);l&&o--;const d=l?s-1:s;r.push(d),h+=d}return r},t.getWrappedLineTrimmedLength=i},5295:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferSet=void 0;const s=i(9092),r=i(8460),n=i(844);class o extends n.Disposable{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this.register(new r.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new s.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new s.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}}t.BufferSet=o},511:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;const s=i(482),r=i(643),n=i(3734);class o extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(e){const t=new o;return t.setFromCharData(e),t}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,s.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[r.CHAR_DATA_ATTR_INDEX],this.bg=0;let t=!1;if(e[r.CHAR_DATA_CHAR_INDEX].length>2)t=!0;else if(2===e[r.CHAR_DATA_CHAR_INDEX].length){const i=e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=i&&i<=56319){const s=e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=s&&s<=57343?this.content=1024*(i-55296)+s-56320+65536|e[r.CHAR_DATA_WIDTH_INDEX]<<22:t=!0}else t=!0}else this.content=e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e[r.CHAR_DATA_WIDTH_INDEX]<<22;t&&(this.combinedData=e[r.CHAR_DATA_CHAR_INDEX],this.content=2097152|e[r.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=o},643:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=256,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},4863:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Marker=void 0;const s=i(8460),r=i(844);class n{constructor(e){this.line=e,this.isDisposed=!1,this._disposables=[],this._id=n._nextId++,this._onDispose=this.register(new s.EventEmitter),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,r.disposeArray)(this._disposables),this._disposables.length=0)}register(e){return this._disposables.push(e),e}}t.Marker=n,n._nextId=1},7116:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CHARSET=t.CHARSETS=void 0,t.CHARSETS={},t.DEFAULT_CHARSET=t.CHARSETS.B,t.CHARSETS[0]={"`":"◆",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:"≥","{":"π","|":"≠","}":"£","~":"·"},t.CHARSETS.A={"#":"£"},t.CHARSETS.B=void 0,t.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},t.CHARSETS.C=t.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},t.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},t.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},t.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},t.CHARSETS.E=t.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},t.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},t.CHARSETS.H=t.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(e,t)=>{var i,s;Object.defineProperty(t,"__esModule",{value:!0}),t.C1_ESCAPED=t.C1=t.C0=void 0,function(e){e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="",e.BS="\b",e.HT="\t",e.LF="\n",e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""}(i=t.C0||(t.C0={})),(s=t.C1||(t.C1={})).PAD="€",s.HOP="",s.BPH="‚",s.NBH="ƒ",s.IND="„",s.NEL="…",s.SSA="†",s.ESA="‡",s.HTS="ˆ",s.HTJ="‰",s.VTS="Š",s.PLD="‹",s.PLU="Œ",s.RI="",s.SS2="Ž",s.SS3="",s.DCS="",s.PU1="‘",s.PU2="’",s.STS="“",s.CCH="”",s.MW="•",s.SPA="–",s.EPA="—",s.SOS="˜",s.SGCI="™",s.SCI="š",s.CSI="›",s.ST="œ",s.OSC="",s.PM="ž",s.APC="Ÿ",(t.C1_ESCAPED||(t.C1_ESCAPED={})).ST=`${i.ESC}\\`},7399:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateKeyboardEvent=void 0;const s=i(2584),r={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};t.evaluateKeyboardEvent=function(e,t,i,n){const o={type:0,cancel:!1,key:void 0},a=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:"UIKeyInputUpArrow"===e.key?o.key=t?s.C0.ESC+"OA":s.C0.ESC+"[A":"UIKeyInputLeftArrow"===e.key?o.key=t?s.C0.ESC+"OD":s.C0.ESC+"[D":"UIKeyInputRightArrow"===e.key?o.key=t?s.C0.ESC+"OC":s.C0.ESC+"[C":"UIKeyInputDownArrow"===e.key&&(o.key=t?s.C0.ESC+"OB":s.C0.ESC+"[B");break;case 8:if(e.altKey){o.key=s.C0.ESC+s.C0.DEL;break}o.key=s.C0.DEL;break;case 9:if(e.shiftKey){o.key=s.C0.ESC+"[Z";break}o.key=s.C0.HT,o.cancel=!0;break;case 13:o.key=e.altKey?s.C0.ESC+s.C0.CR:s.C0.CR,o.cancel=!0;break;case 27:o.key=s.C0.ESC,e.altKey&&(o.key=s.C0.ESC+s.C0.ESC),o.cancel=!0;break;case 37:if(e.metaKey)break;a?(o.key=s.C0.ESC+"[1;"+(a+1)+"D",o.key===s.C0.ESC+"[1;3D"&&(o.key=s.C0.ESC+(i?"b":"[1;5D"))):o.key=t?s.C0.ESC+"OD":s.C0.ESC+"[D";break;case 39:if(e.metaKey)break;a?(o.key=s.C0.ESC+"[1;"+(a+1)+"C",o.key===s.C0.ESC+"[1;3C"&&(o.key=s.C0.ESC+(i?"f":"[1;5C"))):o.key=t?s.C0.ESC+"OC":s.C0.ESC+"[C";break;case 38:if(e.metaKey)break;a?(o.key=s.C0.ESC+"[1;"+(a+1)+"A",i||o.key!==s.C0.ESC+"[1;3A"||(o.key=s.C0.ESC+"[1;5A")):o.key=t?s.C0.ESC+"OA":s.C0.ESC+"[A";break;case 40:if(e.metaKey)break;a?(o.key=s.C0.ESC+"[1;"+(a+1)+"B",i||o.key!==s.C0.ESC+"[1;3B"||(o.key=s.C0.ESC+"[1;5B")):o.key=t?s.C0.ESC+"OB":s.C0.ESC+"[B";break;case 45:e.shiftKey||e.ctrlKey||(o.key=s.C0.ESC+"[2~");break;case 46:o.key=a?s.C0.ESC+"[3;"+(a+1)+"~":s.C0.ESC+"[3~";break;case 36:o.key=a?s.C0.ESC+"[1;"+(a+1)+"H":t?s.C0.ESC+"OH":s.C0.ESC+"[H";break;case 35:o.key=a?s.C0.ESC+"[1;"+(a+1)+"F":t?s.C0.ESC+"OF":s.C0.ESC+"[F";break;case 33:e.shiftKey?o.type=2:e.ctrlKey?o.key=s.C0.ESC+"[5;"+(a+1)+"~":o.key=s.C0.ESC+"[5~";break;case 34:e.shiftKey?o.type=3:e.ctrlKey?o.key=s.C0.ESC+"[6;"+(a+1)+"~":o.key=s.C0.ESC+"[6~";break;case 112:o.key=a?s.C0.ESC+"[1;"+(a+1)+"P":s.C0.ESC+"OP";break;case 113:o.key=a?s.C0.ESC+"[1;"+(a+1)+"Q":s.C0.ESC+"OQ";break;case 114:o.key=a?s.C0.ESC+"[1;"+(a+1)+"R":s.C0.ESC+"OR";break;case 115:o.key=a?s.C0.ESC+"[1;"+(a+1)+"S":s.C0.ESC+"OS";break;case 116:o.key=a?s.C0.ESC+"[15;"+(a+1)+"~":s.C0.ESC+"[15~";break;case 117:o.key=a?s.C0.ESC+"[17;"+(a+1)+"~":s.C0.ESC+"[17~";break;case 118:o.key=a?s.C0.ESC+"[18;"+(a+1)+"~":s.C0.ESC+"[18~";break;case 119:o.key=a?s.C0.ESC+"[19;"+(a+1)+"~":s.C0.ESC+"[19~";break;case 120:o.key=a?s.C0.ESC+"[20;"+(a+1)+"~":s.C0.ESC+"[20~";break;case 121:o.key=a?s.C0.ESC+"[21;"+(a+1)+"~":s.C0.ESC+"[21~";break;case 122:o.key=a?s.C0.ESC+"[23;"+(a+1)+"~":s.C0.ESC+"[23~";break;case 123:o.key=a?s.C0.ESC+"[24;"+(a+1)+"~":s.C0.ESC+"[24~";break;default:if(!e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)if(i&&!n||!e.altKey||e.metaKey)!i||e.altKey||e.ctrlKey||e.shiftKey||!e.metaKey?e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&1===e.key.length?o.key=e.key:e.key&&e.ctrlKey&&("_"===e.key&&(o.key=s.C0.US),"@"===e.key&&(o.key=s.C0.NUL)):65===e.keyCode&&(o.type=1);else{const t=r[e.keyCode],i=null==t?void 0:t[e.shiftKey?1:0];if(i)o.key=s.C0.ESC+i;else if(e.keyCode>=65&&e.keyCode<=90){const t=e.ctrlKey?e.keyCode-64:e.keyCode+32;let i=String.fromCharCode(t);e.shiftKey&&(i=i.toUpperCase()),o.key=s.C0.ESC+i}else if("Dead"===e.key&&e.code.startsWith("Key")){let t=e.code.slice(3,4);e.shiftKey||(t=t.toLowerCase()),o.key=s.C0.ESC+t,o.cancel=!0}}else e.keyCode>=65&&e.keyCode<=90?o.key=String.fromCharCode(e.keyCode-64):32===e.keyCode?o.key=s.C0.NUL:e.keyCode>=51&&e.keyCode<=55?o.key=String.fromCharCode(e.keyCode-51+27):56===e.keyCode?o.key=s.C0.DEL:219===e.keyCode?o.key=s.C0.ESC:220===e.keyCode?o.key=s.C0.FS:221===e.keyCode&&(o.key=s.C0.GS)}return o}},482:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)},t.utf32ToString=function(e,t=0,i=e.length){let s="";for(let r=t;r65535?(t-=65536,s+=String.fromCharCode(55296+(t>>10))+String.fromCharCode(t%1024+56320)):s+=String.fromCharCode(t)}return s},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){const i=e.length;if(!i)return 0;let s=0,r=0;if(this._interim){const i=e.charCodeAt(r++);56320<=i&&i<=57343?t[s++]=1024*(this._interim-55296)+i-56320+65536:(t[s++]=this._interim,t[s++]=i),this._interim=0}for(let n=r;n=i)return this._interim=r,s;const o=e.charCodeAt(n);56320<=o&&o<=57343?t[s++]=1024*(r-55296)+o-56320+65536:(t[s++]=r,t[s++]=o)}else 65279!==r&&(t[s++]=r)}return s}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){const i=e.length;if(!i)return 0;let s,r,n,o,a=0,h=0,c=0;if(this.interim[0]){let s=!1,r=this.interim[0];r&=192==(224&r)?31:224==(240&r)?15:7;let n,o=0;for(;(n=63&this.interim[++o])&&o<4;)r<<=6,r|=n;const h=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,l=h-o;for(;c=i)return 0;if(n=e[c++],128!=(192&n)){c--,s=!0;break}this.interim[o++]=n,r<<=6,r|=63&n}s||(2===h?r<128?c--:t[a++]=r:3===h?r<2048||r>=55296&&r<=57343||65279===r||(t[a++]=r):r<65536||r>1114111||(t[a++]=r)),this.interim.fill(0)}const l=i-4;let d=c;for(;d=i)return this.interim[0]=s,a;if(r=e[d++],128!=(192&r)){d--;continue}if(h=(31&s)<<6|63&r,h<128){d--;continue}t[a++]=h}else if(224==(240&s)){if(d>=i)return this.interim[0]=s,a;if(r=e[d++],128!=(192&r)){d--;continue}if(d>=i)return this.interim[0]=s,this.interim[1]=r,a;if(n=e[d++],128!=(192&n)){d--;continue}if(h=(15&s)<<12|(63&r)<<6|63&n,h<2048||h>=55296&&h<=57343||65279===h)continue;t[a++]=h}else if(240==(248&s)){if(d>=i)return this.interim[0]=s,a;if(r=e[d++],128!=(192&r)){d--;continue}if(d>=i)return this.interim[0]=s,this.interim[1]=r,a;if(n=e[d++],128!=(192&n)){d--;continue}if(d>=i)return this.interim[0]=s,this.interim[1]=r,this.interim[2]=n,a;if(o=e[d++],128!=(192&o)){d--;continue}if(h=(7&s)<<18|(63&r)<<12|(63&n)<<6|63&o,h<65536||h>1114111)continue;t[a++]=h}}return a}}},225:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeV6=void 0;const s=i(8273),r=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],n=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let o;t.UnicodeV6=class{constructor(){if(this.version="6",!o){o=new Uint8Array(65536),(0,s.fill)(o,1),o[0]=0,(0,s.fill)(o,0,1,32),(0,s.fill)(o,0,127,160),(0,s.fill)(o,2,4352,4448),o[9001]=2,o[9002]=2,(0,s.fill)(o,2,11904,42192),o[12351]=1,(0,s.fill)(o,2,44032,55204),(0,s.fill)(o,2,63744,64256),(0,s.fill)(o,2,65040,65050),(0,s.fill)(o,2,65072,65136),(0,s.fill)(o,2,65280,65377),(0,s.fill)(o,2,65504,65511);for(let e=0;et[r][1])return!1;for(;r>=s;)if(i=s+r>>1,e>t[i][1])s=i+1;else{if(!(e=131072&&e<=196605||e>=196608&&e<=262141?2:1}}},5981:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WriteBuffer=void 0;const s=i(8460),r=i(844);class n extends r.Disposable{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new s.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(void 0!==t&&this._syncCalls>t)return void(this._syncCalls=0);if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let i;for(this._isSyncWriting=!0;i=this._writeBuffer.shift();){this._action(i);const e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){const i=e||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const e=this._writeBuffer[this._bufferOffset],s=this._action(e,t);if(s){const e=e=>Date.now()-i>=12?setTimeout((()=>this._innerWrite(0,e))):this._innerWrite(i,e);return void s.catch((e=>(queueMicrotask((()=>{throw e})),Promise.resolve(!1)))).then(e)}const r=this._callbacks[this._bufferOffset];if(r&&r(),this._bufferOffset++,this._pendingData-=e.length,Date.now()-i>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}t.WriteBuffer=n},5941:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.toRgbString=t.parseColor=void 0;const i=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,s=/^[\da-f]+$/;function r(e,t){const i=e.toString(16),s=i.length<2?"0"+i:i;switch(t){case 4:return i[0];case 8:return s;case 12:return(s+s).slice(0,3);default:return s+s}}t.parseColor=function(e){if(!e)return;let t=e.toLowerCase();if(0===t.indexOf("rgb:")){t=t.slice(4);const e=i.exec(t);if(e){const t=e[1]?15:e[4]?255:e[7]?4095:65535;return[Math.round(parseInt(e[1]||e[4]||e[7]||e[10],16)/t*255),Math.round(parseInt(e[2]||e[5]||e[8]||e[11],16)/t*255),Math.round(parseInt(e[3]||e[6]||e[9]||e[12],16)/t*255)]}}else if(0===t.indexOf("#")&&(t=t.slice(1),s.exec(t)&&[3,6,9,12].includes(t.length))){const e=t.length/3,i=[0,0,0];for(let s=0;s<3;++s){const r=parseInt(t.slice(e*s,e*s+e),16);i[s]=1===e?r<<4:2===e?r:3===e?r>>4:r>>8}return i}},t.toRgbString=function(e,t=16){const[i,s,n]=e;return`rgb:${r(i,t)}/${r(s,t)}/${r(n,t)}`}},5770:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PAYLOAD_LIMIT=void 0,t.PAYLOAD_LIMIT=1e7},6351:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DcsHandler=t.DcsParser=void 0;const s=i(482),r=i(8742),n=i(5770),o=[];t.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=o,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=o}registerHandler(e,t){void 0===this._handlers[e]&&(this._handlers[e]=[]);const i=this._handlers[e];return i.push(t),{dispose:()=>{const e=i.indexOf(t);-1!==e&&i.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=o,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||o,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(t);else this._handlerFb(this._ident,"HOOK",t)}put(e,t,i){if(this._active.length)for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,i);else this._handlerFb(this._ident,"PUT",(0,s.utf32ToString)(e,t,i))}unhook(e,t=!0){if(this._active.length){let i=!1,s=this._active.length-1,r=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=t,r=this._stack.fallThrough,this._stack.paused=!1),!r&&!1===i){for(;s>=0&&(i=this._active[s].unhook(e),!0!==i);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].unhook(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}else this._handlerFb(this._ident,"UNHOOK",e);this._active=o,this._ident=0}};const a=new r.Params;a.addParam(0),t.DcsHandler=class{constructor(e){this._handler=e,this._data="",this._params=a,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():a,this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=(0,s.utf32ToString)(e,t,i),this._data.length>n.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then((e=>(this._params=a,this._data="",this._hitLimit=!1,e)));return this._params=a,this._data="",this._hitLimit=!1,t}}},2015:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EscapeSequenceParser=t.VT500_TRANSITION_TABLE=t.TransitionTable=void 0;const s=i(844),r=i(8273),n=i(8742),o=i(6242),a=i(6351);class h{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){(0,r.fill)(this.table,e<<4|t)}add(e,t,i,s){this.table[t<<8|e]=i<<4|s}addMany(e,t,i,s){for(let r=0;rt)),i=(e,i)=>t.slice(e,i),s=i(32,127),r=i(0,24);r.push(25),r.push.apply(r,i(28,32));const n=i(0,14);let o;for(o in e.setDefault(1,0),e.addMany(s,0,2,0),n)e.addMany([24,26,153,154],o,3,0),e.addMany(i(128,144),o,3,0),e.addMany(i(144,152),o,3,0),e.add(156,o,0,0),e.add(27,o,11,1),e.add(157,o,4,8),e.addMany([152,158,159],o,0,7),e.add(155,o,11,3),e.add(144,o,11,9);return e.addMany(r,0,3,0),e.addMany(r,1,3,1),e.add(127,1,0,1),e.addMany(r,8,0,8),e.addMany(r,3,3,3),e.add(127,3,0,3),e.addMany(r,4,3,4),e.add(127,4,0,4),e.addMany(r,6,3,6),e.addMany(r,5,3,5),e.add(127,5,0,5),e.addMany(r,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(s,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(i(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(s,7,0,7),e.addMany(r,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(i(64,127),3,7,0),e.addMany(i(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(i(48,60),4,8,4),e.addMany(i(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(i(32,64),6,0,6),e.add(127,6,0,6),e.addMany(i(64,127),6,0,0),e.addMany(i(32,48),3,9,5),e.addMany(i(32,48),5,9,5),e.addMany(i(48,64),5,0,6),e.addMany(i(64,127),5,7,0),e.addMany(i(32,48),4,9,5),e.addMany(i(32,48),1,9,2),e.addMany(i(32,48),2,9,2),e.addMany(i(48,127),2,10,0),e.addMany(i(48,80),1,10,0),e.addMany(i(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(i(96,127),1,10,0),e.add(80,1,11,9),e.addMany(r,9,0,9),e.add(127,9,0,9),e.addMany(i(28,32),9,0,9),e.addMany(i(32,48),9,9,12),e.addMany(i(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(r,11,0,11),e.addMany(i(32,128),11,0,11),e.addMany(i(28,32),11,0,11),e.addMany(r,10,0,10),e.add(127,10,0,10),e.addMany(i(28,32),10,0,10),e.addMany(i(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(i(32,48),10,9,12),e.addMany(r,12,0,12),e.add(127,12,0,12),e.addMany(i(28,32),12,0,12),e.addMany(i(32,48),12,9,12),e.addMany(i(48,64),12,0,11),e.addMany(i(64,127),12,12,13),e.addMany(i(64,127),10,12,13),e.addMany(i(64,127),9,12,13),e.addMany(r,13,13,13),e.addMany(s,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(c,0,2,0),e.add(c,8,5,8),e.add(c,6,0,6),e.add(c,11,0,11),e.add(c,13,13,13),e}();class l extends s.Disposable{constructor(e=t.VT500_TRANSITION_TABLE){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new n.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(e,t,i)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,t)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,s.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new o.OscParser),this._dcsParser=this.register(new a.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(e,t=[64,126]){let i=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(i=e.prefix.charCodeAt(0),i&&60>i||i>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let t=0;ts||s>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");i<<=8,i|=s}}if(1!==e.final.length)throw new Error("final must be a single byte");const s=e.final.charCodeAt(0);if(t[0]>s||s>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return i<<=8,i|=s,i}identToString(e){const t=[];for(;e;)t.push(String.fromCharCode(255&e)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){const i=this._identifier(e,[48,126]);void 0===this._escHandlers[i]&&(this._escHandlers[i]=[]);const s=this._escHandlers[i];return s.push(t),{dispose:()=>{const e=s.indexOf(t);-1!==e&&s.splice(e,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){const i=this._identifier(e);void 0===this._csiHandlers[i]&&(this._csiHandlers[i]=[]);const s=this._csiHandlers[i];return s.push(t),{dispose:()=>{const e=s.indexOf(t);-1!==e&&s.splice(e,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,0!==this._parseStack.state&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,i,s,r){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=i,this._parseStack.transition=s,this._parseStack.chunkPos=r}parse(e,t,i){let s,r=0,n=0,o=0;if(this._parseStack.state)if(2===this._parseStack.state)this._parseStack.state=0,o=this._parseStack.chunkPos+1;else{if(void 0===i||1===this._parseStack.state)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const t=this._parseStack.handlers;let n=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(!1===i&&n>-1)for(;n>=0&&(s=t[n](this._params),!0!==s);n--)if(s instanceof Promise)return this._parseStack.handlerPos=n,s;this._parseStack.handlers=[];break;case 4:if(!1===i&&n>-1)for(;n>=0&&(s=t[n](),!0!==s);n--)if(s instanceof Promise)return this._parseStack.handlerPos=n,s;this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],s=this._dcsParser.unhook(24!==r&&26!==r,i),s)return s;27===r&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(r=e[this._parseStack.chunkPos],s=this._oscParser.end(24!==r&&26!==r,i),s)return s;27===r&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,o=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let i=o;i>4){case 2:for(let s=i+1;;++s){if(s>=t||(r=e[s])<32||r>126&&r=t||(r=e[s])<32||r>126&&r=t||(r=e[s])<32||r>126&&r=t||(r=e[s])<32||r>126&&r=0&&(s=o[a](this._params),!0!==s);a--)if(s instanceof Promise)return this._preserveStack(3,o,a,n,i),s;a<0&&this._csiHandlerFb(this._collect<<8|r,this._params),this.precedingCodepoint=0;break;case 8:do{switch(r){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(r-48)}}while(++i47&&r<60);i--;break;case 9:this._collect<<=8,this._collect|=r;break;case 10:const h=this._escHandlers[this._collect<<8|r];let l=h?h.length-1:-1;for(;l>=0&&(s=h[l](),!0!==s);l--)if(s instanceof Promise)return this._preserveStack(4,h,l,n,i),s;l<0&&this._escHandlerFb(this._collect<<8|r),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|r,this._params);break;case 13:for(let s=i+1;;++s)if(s>=t||24===(r=e[s])||26===r||27===r||r>127&&r=t||(r=e[s])<32||r>127&&r{Object.defineProperty(t,"__esModule",{value:!0}),t.OscHandler=t.OscParser=void 0;const s=i(5770),r=i(482),n=[];t.OscParser=class{constructor(){this._state=0,this._active=n,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){void 0===this._handlers[e]&&(this._handlers[e]=[]);const i=this._handlers[e];return i.push(t),{dispose:()=>{const e=i.indexOf(t);-1!==e&&i.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=n}reset(){if(2===this._state)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=n,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||n,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].start();else this._handlerFb(this._id,"START")}_put(e,t,i){if(this._active.length)for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,i);else this._handlerFb(this._id,"PUT",(0,r.utf32ToString)(e,t,i))}start(){this.reset(),this._state=1}put(e,t,i){if(3!==this._state){if(1===this._state)for(;t0&&this._put(e,t,i)}}end(e,t=!0){if(0!==this._state){if(3!==this._state)if(1===this._state&&this._start(),this._active.length){let i=!1,s=this._active.length-1,r=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=t,r=this._stack.fallThrough,this._stack.paused=!1),!r&&!1===i){for(;s>=0&&(i=this._active[s].end(e),!0!==i);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].end(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}else this._handlerFb(this._id,"END",e);this._active=n,this._id=-1,this._state=0}}},t.OscHandler=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=(0,r.utf32ToString)(e,t,i),this._data.length>s.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then((e=>(this._data="",this._hitLimit=!1,e)));return this._data="",this._hitLimit=!1,t}}},8742:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Params=void 0;const i=2147483647;class s{constructor(e=32,t=32){if(this.maxLength=e,this.maxSubParamsLength=t,t>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(t),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(e){const t=new s;if(!e.length)return t;for(let i=Array.isArray(e[0])?1:0;i>8,s=255&this._subParamsIdx[t];s-i>0&&e.push(Array.prototype.slice.call(this._subParams,i,s))}return e}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>i?i:e}}addSubParam(e){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=e>i?i:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return(255&this._subParamsIdx[e])-(this._subParamsIdx[e]>>8)>0}getSubParams(e){const t=this._subParamsIdx[e]>>8,i=255&this._subParamsIdx[e];return i-t>0?this._subParams.subarray(t,i):null}getSubParamsAll(){const e={};for(let t=0;t>8,s=255&this._subParamsIdx[t];s-i>0&&(e[t]=this._subParams.slice(i,s))}return e}addDigit(e){let t;if(this._rejectDigits||!(t=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const s=this._digitIsSub?this._subParams:this.params,r=s[t-1];s[t-1]=~r?Math.min(10*r+e,i):e}}t.Params=s},5741:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AddonManager=void 0,t.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){const i={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(i),t.dispose=()=>this._wrappedAddonDispose(i),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let i=0;i{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferApiView=void 0;const s=i(3785),r=i(511);t.BufferApiView=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){const t=this._buffer.lines.get(e);if(t)return new s.BufferLineApiView(t)}getNullCell(){return new r.CellData}}},3785:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLineApiView=void 0;const s=i(511);t.BufferLineApiView=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new s.CellData)}translateToString(e,t,i){return this._line.translateToString(e,t,i)}}},8285:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferNamespaceApi=void 0;const s=i(8771),r=i(8460);t.BufferNamespaceApi=class{constructor(e){this._core=e,this._onBufferChange=new r.EventEmitter,this.onBufferChange=this._onBufferChange.event,this._normal=new s.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new s.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}},7975:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ParserApi=void 0,t.ParserApi=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,(e=>t(e.toArray())))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,((e,i)=>t(e,i.toArray())))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}}},7090:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeApi=void 0,t.UnicodeApi=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}}},744:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferService=t.MINIMUM_ROWS=t.MINIMUM_COLS=void 0;const n=i(2585),o=i(5295),a=i(8460),h=i(844);t.MINIMUM_COLS=2,t.MINIMUM_ROWS=1;let c=class extends h.Disposable{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this.register(new a.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new a.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,t.MINIMUM_COLS),this.rows=Math.max(e.rawOptions.rows||0,t.MINIMUM_ROWS),this.buffers=this.register(new o.BufferSet(e,this))}get buffer(){return this.buffers.active}resize(e,t){this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){const i=this.buffer;let s;s=this._cachedBlankLine,s&&s.length===this.cols&&s.getFg(0)===e.fg&&s.getBg(0)===e.bg||(s=i.getBlankLine(e,t),this._cachedBlankLine=s),s.isWrapped=t;const r=i.ybase+i.scrollTop,n=i.ybase+i.scrollBottom;if(0===i.scrollTop){const e=i.lines.isFull;n===i.lines.length-1?e?i.lines.recycle().copyFrom(s):i.lines.push(s.clone()):i.lines.splice(n+1,0,s.clone()),e?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{const e=n-r+1;i.lines.shiftElements(r+1,e-1,-1),i.lines.set(n,s.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(e,t,i){const s=this.buffer;if(e<0){if(0===s.ydisp)return;this.isUserScrolling=!0}else e+s.ydisp>=s.ybase&&(this.isUserScrolling=!1);const r=s.ydisp;s.ydisp=Math.max(Math.min(s.ydisp+e,s.ybase),0),r!==s.ydisp&&(t||this._onScroll.fire(s.ydisp))}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this.buffer.ydisp)}scrollToBottom(){this.scrollLines(this.buffer.ybase-this.buffer.ydisp)}scrollToLine(e){const t=e-this.buffer.ydisp;0!==t&&this.scrollLines(t)}};c=s([r(0,n.IOptionsService)],c),t.BufferService=c},7994:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CharsetService=void 0,t.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}}},1753:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreMouseService=void 0;const n=i(2585),o=i(8460),a=i(844),h={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>4!==e.button&&1===e.action&&(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>32!==e.action},DRAG:{events:23,restrict:e=>32!==e.action||3!==e.button},ANY:{events:31,restrict:e=>!0}};function c(e,t){let i=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return 4===e.button?(i|=64,i|=e.action):(i|=3&e.button,4&e.button&&(i|=64),8&e.button&&(i|=128),32===e.action?i|=32:0!==e.action||t||(i|=3)),i}const l=String.fromCharCode,d={DEFAULT:e=>{const t=[c(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`${l(t[0])}${l(t[1])}${l(t[2])}`},SGR:e=>{const t=0===e.action&&4!==e.button?"m":"M";return`[<${c(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{const t=0===e.action&&4!==e.button?"m":"M";return`[<${c(e,!0)};${e.x};${e.y}${t}`}};let _=class extends a.Disposable{constructor(e,t){super(),this._bufferService=e,this._coreService=t,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new o.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const e of Object.keys(h))this.addProtocol(e,h[e]);for(const e of Object.keys(d))this.addEncoding(e,d[e]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return 0!==this._protocols[this._activeProtocol].events}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows)return!1;if(4===e.button&&32===e.action)return!1;if(3===e.button&&32!==e.action)return!1;if(4!==e.button&&(2===e.action||3===e.action))return!1;if(e.col++,e.row++,32===e.action&&this._lastEvent&&this._equalEvents(this._lastEvent,e,"SGR_PIXELS"===this._activeEncoding))return!1;if(!this._protocols[this._activeProtocol].restrict(e))return!1;const t=this._encodings[this._activeEncoding](e);return t&&("DEFAULT"===this._activeEncoding?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(1&e),up:!!(2&e),drag:!!(4&e),move:!!(8&e),wheel:!!(16&e)}}_equalEvents(e,t,i){if(i){if(e.x!==t.x)return!1;if(e.y!==t.y)return!1}else{if(e.col!==t.col)return!1;if(e.row!==t.row)return!1}return e.button===t.button&&e.action===t.action&&e.ctrl===t.ctrl&&e.alt===t.alt&&e.shift===t.shift}};_=s([r(0,n.IBufferService),r(1,n.ICoreService)],_),t.CoreMouseService=_},6975:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreService=void 0;const n=i(2585),o=i(8460),a=i(1439),h=i(844),c=Object.freeze({insertMode:!1}),l=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let d=class extends h.Disposable{constructor(e,t,i,s){super(),this._bufferService=t,this._logService=i,this._optionsService=s,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new o.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new o.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new o.EventEmitter),this.onBinary=this._onBinary.event,this._scrollToBottom=e,this.register({dispose:()=>this._scrollToBottom=void 0}),this.modes=(0,a.clone)(c),this.decPrivateModes=(0,a.clone)(l)}reset(){this.modes=(0,a.clone)(c),this.decPrivateModes=(0,a.clone)(l)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;const i=this._bufferService.buffer;i.ybase!==i.ydisp&&this._scrollToBottom(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`,(()=>e.split("").map((e=>e.charCodeAt(0))))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`,(()=>e.split("").map((e=>e.charCodeAt(0))))),this._onBinary.fire(e))}};d=s([r(1,n.IBufferService),r(2,n.ILogService),r(3,n.IOptionsService)],d),t.CoreService=d},9074:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DecorationService=void 0;const s=i(8055),r=i(8460),n=i(844),o=i(6106);let a=0,h=0;class c extends n.Disposable{constructor(){super(),this._decorations=new o.SortedList((e=>null==e?void 0:e.marker.line)),this._onDecorationRegistered=this.register(new r.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new r.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,n.toDisposable)((()=>{for(const e of this._decorations.values())this._onDecorationRemoved.fire(e);this.reset()})))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;const t=new l(e);if(t){const e=t.marker.onDispose((()=>t.dispose()));t.onDispose((()=>{t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),e.dispose())})),this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(const e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,i){var s,r,n;let o=0,a=0;for(const h of this._decorations.getKeyIterator(t))o=null!==(s=h.options.x)&&void 0!==s?s:0,a=o+(null!==(r=h.options.width)&&void 0!==r?r:1),e>=o&&e{var r,n,o;a=null!==(r=t.options.x)&&void 0!==r?r:0,h=a+(null!==(n=t.options.width)&&void 0!==n?n:1),e>=a&&e{Object.defineProperty(t,"__esModule",{value:!0}),t.InstantiationService=t.ServiceCollection=void 0;const s=i(2585),r=i(8343);class n{constructor(...e){this._entries=new Map;for(const[t,i]of e)this.set(t,i)}set(e,t){const i=this._entries.get(e);return this._entries.set(e,t),i}forEach(e){for(const[t,i]of this._entries.entries())e(t,i)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}}t.ServiceCollection=n,t.InstantiationService=class{constructor(){this._services=new n,this._services.set(s.IInstantiationService,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){const i=(0,r.getServiceDependencies)(e).sort(((e,t)=>e.index-t.index)),s=[];for(const t of i){const i=this._services.get(t.id);if(!i)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${t.id}.`);s.push(i)}const n=i.length>0?i[0].index:t.length;if(t.length!==n)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${n+1} conflicts with ${t.length} static arguments`);return new e(...[...t,...s])}}},7866:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.LogService=void 0;const n=i(844),o=i(2585),a={debug:o.LogLevelEnum.DEBUG,info:o.LogLevelEnum.INFO,warn:o.LogLevelEnum.WARN,error:o.LogLevelEnum.ERROR,off:o.LogLevelEnum.OFF};let h=class extends n.Disposable{constructor(e){super(),this._optionsService=e,this.logLevel=o.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel())))}_updateLogLevel(){this.logLevel=a[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t{Object.defineProperty(t,"__esModule",{value:!0}),t.OptionsService=t.DEFAULT_OPTIONS=void 0;const s=i(8460),r=i(6114),n=i(844);t.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",scrollback:1e3,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:r.isMac,windowOptions:{},windowsMode:!1,wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const o=["normal","bold","100","200","300","400","500","600","700","800","900"];class a extends n.Disposable{constructor(e){super(),this._onOptionChange=this.register(new s.EventEmitter),this.onOptionChange=this._onOptionChange.event;const i=Object.assign({},t.DEFAULT_OPTIONS);for(const t in e)if(t in i)try{const s=e[t];i[t]=this._sanitizeAndValidateOption(t,s)}catch(e){console.error(e)}this.rawOptions=i,this.options=Object.assign({},i),this._setupOptions()}onSpecificOptionChange(e,t){return this.onOptionChange((i=>{i===e&&t(this.rawOptions[e])}))}onMultipleOptionChange(e,t){return this.onOptionChange((i=>{-1!==e.indexOf(i)&&t()}))}_setupOptions(){const e=e=>{if(!(e in t.DEFAULT_OPTIONS))throw new Error(`No option with key "${e}"`);return this.rawOptions[e]},i=(e,i)=>{if(!(e in t.DEFAULT_OPTIONS))throw new Error(`No option with key "${e}"`);i=this._sanitizeAndValidateOption(e,i),this.rawOptions[e]!==i&&(this.rawOptions[e]=i,this._onOptionChange.fire(e))};for(const t in this.rawOptions){const s={get:e.bind(this,t),set:i.bind(this,t)};Object.defineProperty(this.options,t,s)}}_sanitizeAndValidateOption(e,i){switch(e){case"cursorStyle":if(i||(i=t.DEFAULT_OPTIONS[e]),!function(e){return"block"===e||"underline"===e||"bar"===e}(i))throw new Error(`"${i}" is not a valid value for ${e}`);break;case"wordSeparator":i||(i=t.DEFAULT_OPTIONS[e]);break;case"fontWeight":case"fontWeightBold":if("number"==typeof i&&1<=i&&i<=1e3)break;i=o.includes(i)?i:t.DEFAULT_OPTIONS[e];break;case"cursorWidth":i=Math.floor(i);case"lineHeight":case"tabStopWidth":if(i<1)throw new Error(`${e} cannot be less than 1, value: ${i}`);break;case"minimumContrastRatio":i=Math.max(1,Math.min(21,Math.round(10*i)/10));break;case"scrollback":if((i=Math.min(i,4294967295))<0)throw new Error(`${e} cannot be less than 0, value: ${i}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(i<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${i}`);case"rows":case"cols":if(!i&&0!==i)throw new Error(`${e} must be numeric, value: ${i}`)}return i}}t.OptionsService=a},2660:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkService=void 0;const n=i(2585);let o=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){const t=this._bufferService.buffer;if(void 0===e.id){const i=t.addMarker(t.ybase+t.y),s={data:e,id:this._nextId++,lines:[i]};return i.onDispose((()=>this._removeMarkerFromLink(s,i))),this._dataByLinkId.set(s.id,s),s.id}const i=e,s=this._getEntryIdKey(i),r=this._entriesWithId.get(s);if(r)return this.addLineToLink(r.id,t.ybase+t.y),r.id;const n=t.addMarker(t.ybase+t.y),o={id:this._nextId++,key:this._getEntryIdKey(i),data:i,lines:[n]};return n.onDispose((()=>this._removeMarkerFromLink(o,n))),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,t){const i=this._dataByLinkId.get(e);if(i&&i.lines.every((e=>e.line!==t))){const e=this._bufferService.buffer.addMarker(t);i.lines.push(e),e.onDispose((()=>this._removeMarkerFromLink(i,e)))}}getLinkData(e){var t;return null===(t=this._dataByLinkId.get(e))||void 0===t?void 0:t.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){const i=e.lines.indexOf(t);-1!==i&&(e.lines.splice(i,1),0===e.lines.length&&(void 0!==e.data.id&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};o=s([r(0,n.IBufferService)],o),t.OscLinkService=o},8343:(e,t)=>{function i(e,t,i){t.di$target===t?t.di$dependencies.push({id:e,index:i}):(t.di$dependencies=[{id:e,index:i}],t.di$target=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0,t.serviceRegistry=new Map,t.getServiceDependencies=function(e){return e.di$dependencies||[]},t.createDecorator=function(e){if(t.serviceRegistry.has(e))return t.serviceRegistry.get(e);const s=function(e,t,r){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");i(s,e,r)};return s.toString=()=>e,t.serviceRegistry.set(e,s),s}},2585:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;const s=i(8343);var r;t.IBufferService=(0,s.createDecorator)("BufferService"),t.ICoreMouseService=(0,s.createDecorator)("CoreMouseService"),t.ICoreService=(0,s.createDecorator)("CoreService"),t.ICharsetService=(0,s.createDecorator)("CharsetService"),t.IInstantiationService=(0,s.createDecorator)("InstantiationService"),(r=t.LogLevelEnum||(t.LogLevelEnum={}))[r.DEBUG=0]="DEBUG",r[r.INFO=1]="INFO",r[r.WARN=2]="WARN",r[r.ERROR=3]="ERROR",r[r.OFF=4]="OFF",t.ILogService=(0,s.createDecorator)("LogService"),t.IOptionsService=(0,s.createDecorator)("OptionsService"),t.IOscLinkService=(0,s.createDecorator)("OscLinkService"),t.IUnicodeService=(0,s.createDecorator)("UnicodeService"),t.IDecorationService=(0,s.createDecorator)("DecorationService")},1480:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeService=void 0;const s=i(8460),r=i(225);t.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new s.EventEmitter,this.onChange=this._onChange.event;const e=new r.UnicodeV6;this.register(e),this._active=e.version,this._activeProvider=e}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw new Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(e){let t=0;const i=e.length;for(let s=0;s=i)return t+this.wcwidth(r);const n=e.charCodeAt(s);56320<=n&&n<=57343?r=1024*(r-55296)+n-56320+65536:t+=this.wcwidth(n)}t+=this.wcwidth(r)}return t}}}},t={};function i(s){var r=t[s];if(void 0!==r)return r.exports;var n=t[s]={exports:{}};return e[s].call(n.exports,n,n.exports,i),n.exports}var s={};return(()=>{var e=s;Object.defineProperty(e,"__esModule",{value:!0}),e.Terminal=void 0;const t=i(3236),r=i(9042),n=i(7975),o=i(7090),a=i(5741),h=i(8285),c=["cols","rows"];e.Terminal=class{constructor(e){this._core=new t.Terminal(e),this._addonManager=new a.AddonManager,this._publicOptions=Object.assign({},this._core.options);const i=e=>this._core.options[e],s=(e,t)=>{this._checkReadonlyOptions(e),this._core.options[e]=t};for(const e in this._core.options){const t={get:i.bind(this,e),set:s.bind(this,e)};Object.defineProperty(this._publicOptions,e,t)}}_checkReadonlyOptions(e){if(c.includes(e))throw new Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new n.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new o.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=new h.BufferNamespaceApi(this._core)),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const e=this._core.coreService.decPrivateModes;let t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any"}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(const t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.addMarker(e)}registerDecoration(e){var t,i,s;return this._checkProposedApi(),this._verifyPositiveIntegers(null!==(t=e.x)&&void 0!==t?t:0,null!==(i=e.width)&&void 0!==i?i:0,null!==(s=e.height)&&void 0!==s?s:0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,i){this._verifyIntegers(e,t,i),this._core.select(e,t,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){this._addonManager.dispose(),this._core.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write("\r\n",t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){return this._addonManager.loadAddon(this,e)}static get strings(){return r}_verifyIntegers(...e){for(const t of e)if(t===1/0||isNaN(t)||t%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(const t of e)if(t&&(t===1/0||isNaN(t)||t%1!=0||t<0))throw new Error("This API only accepts positive integers")}}})(),s})()}));//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/xterm/lib/xterm.js.mapCopyright (c) 2017, The xterm.js authors (https://github.com/xtermjs/xterm.js) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "xterm-addon-canvas", "version": "0.3.0-beta.23", "author": { "name": "The xterm.js authors", "url": "https://xtermjs.org/" }, "main": "lib/xterm-addon-canvas.js", "types": "typings/xterm-addon-canvas.d.ts", "repository": "https://github.com/xtermjs/xterm.js", "license": "MIT", "keywords": [ "terminal", "canvas", "xterm", "xterm.js" ], "scripts": { "build": "../../node_modules/.bin/tsc -p .", "prepackage": "npm run build", "package": "../../node_modules/.bin/webpack", "prepublishOnly": "npm run package" }, "peerDependencies": { "xterm": "^5.0.0" } }!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.CanvasAddon=t():e.CanvasAddon=t()}(self,(function(){return(()=>{"use strict";var e={903:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseRenderLayer=void 0;const s=i(503),r=i(627),o=i(237),n=i(860),h=i(374),a=i(296),c=i(855),l=i(274),d=i(859),_=i(399);class u extends d.Disposable{constructor(e,t,i,r,o,n,h,c,_,u){super(),this._terminal=e,this._container=t,this._alpha=o,this._themeService=n,this._bufferService=h,this._optionsService=c,this._decorationService=_,this._coreBrowserService=u,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._selectionModel=(0,a.createSelectionRenderModel)(),this._cellColorResolver=new l.CellColorResolver(this._terminal,this._selectionModel,this._decorationService,this._coreBrowserService,this._themeService),this._canvas=document.createElement("canvas"),this._canvas.classList.add(`xterm-${i}-layer`),this._canvas.style.zIndex=r.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._refreshCharAtlas(this._themeService.colors),this.register(this._themeService.onChangeColors((e=>{this._refreshCharAtlas(e),this.reset()}))),this.register((0,d.toDisposable)((()=>{var e;(0,s.removeElementFromParent)(this._canvas),null===(e=this._charAtlas)||void 0===e||e.dispose()})))}get canvas(){return this._canvas}get cacheCanvas(){var e;return null===(e=this._charAtlas)||void 0===e?void 0:e.cacheCanvas}_initCanvas(){this._ctx=(0,h.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(){}handleFocus(){}handleCursorMove(){}handleGridChanged(e,t){}handleSelectionChanged(e,t,i=!1){this._selectionModel.update(this._terminal,e,t,i)}_setTransparency(e){if(e===this._alpha)return;const t=this._canvas;this._alpha=e,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,t),this._refreshCharAtlas(this._themeService.colors),this.handleGridChanged(0,this._bufferService.rows-1)}_refreshCharAtlas(e){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,r.acquireTextureAtlas)(this._terminal,e,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp(),this._bitmapGenerator=new f(this._charAtlas.cacheCanvas))}resize(e){this._deviceCellWidth=e.device.cell.width,this._deviceCellHeight=e.device.cell.height,this._deviceCharWidth=e.device.char.width,this._deviceCharHeight=e.device.char.height,this._deviceCharLeft=e.device.char.left,this._deviceCharTop=e.device.char.top,this._canvas.width=e.device.canvas.width,this._canvas.height=e.device.canvas.height,this._canvas.style.width=`${e.css.canvas.width}px`,this._canvas.style.height=`${e.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(this._themeService.colors)}clearTextureAtlas(){var e;null===(e=this._charAtlas)||void 0===e||e.clearTexture()}_fillCells(e,t,i,s){this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight)}_fillMiddleLineAtCells(e,t,i=1){const s=Math.ceil(.5*this._deviceCellHeight);this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight-s-this._coreBrowserService.dpr,i*this._deviceCellWidth,this._coreBrowserService.dpr)}_fillBottomLineAtCells(e,t,i=1,s=0){this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight+s-this._coreBrowserService.dpr-1,i*this._deviceCellWidth,this._coreBrowserService.dpr)}_curlyUnderlineAtCell(e,t,i=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const s=this._coreBrowserService.dpr;this._ctx.lineWidth=s;for(let r=0;r1?this._charAtlas.getRasterizedGlyphCombinedChar(o,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext):this._charAtlas.getRasterizedGlyph(e.getCode()||c.WHITESPACE_CELL_CODE,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext),this._ctx.save(),this._clipRow(i),this._charAtlas.hasCanvasChanged&&(null===(s=this._bitmapGenerator)||void 0===s||s.refresh(),this._charAtlas.hasCanvasChanged=!1),this._ctx.drawImage((null===(r=this._bitmapGenerator)||void 0===r?void 0:r.bitmap)||this._charAtlas.cacheCanvas,n.texturePosition.x,n.texturePosition.y,n.size.x,n.size.y,t*this._deviceCellWidth-n.offset.x,i*this._deviceCellHeight-n.offset.y,n.size.x,n.size.y),this._ctx.restore()}_clipRow(e){this._ctx.beginPath(),this._ctx.rect(0,e*this._deviceCellHeight,this._bufferService.cols*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,t){return`${t?"italic":""} ${e?this._optionsService.rawOptions.fontWeightBold:this._optionsService.rawOptions.fontWeight} ${this._optionsService.rawOptions.fontSize*this._coreBrowserService.dpr}px ${this._optionsService.rawOptions.fontFamily}`}}t.BaseRenderLayer=u;class f{constructor(e){this._canvas=e,this._state=0,this._commitTimeout=void 0,this._bitmap=void 0}get bitmap(){return this._bitmap}refresh(){this._bitmap=void 0,_.isSafari||(void 0===this._commitTimeout&&(this._commitTimeout=window.setTimeout((()=>this._generate()),100)),1===this._state&&(this._state=2))}_generate(){0===this._state&&(this._bitmap=void 0,this._state=1,window.createImageBitmap(this._canvas).then((e=>{2===this._state?this.refresh():this._bitmap=e,this._state=0})),this._commitTimeout&&(this._commitTimeout=void 0))}}},949:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CanvasRenderer=void 0;const s=i(627),r=i(56),o=i(374),n=i(345),h=i(859),a=i(873),c=i(43),l=i(630),d=i(744);class _ extends h.Disposable{constructor(e,t,i,_,u,f,g,v,C,p,m){super(),this._terminal=e,this._screenElement=t,this._bufferService=_,this._charSizeService=u,this._optionsService=f,this._coreBrowserService=C,this._themeService=m,this._onRequestRedraw=this.register(new n.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onChangeTextureAtlas=this.register(new n.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event;const w=this._optionsService.rawOptions.allowTransparency;this._renderLayers=[new d.TextRenderLayer(this._terminal,this._screenElement,0,w,this._bufferService,this._optionsService,g,p,this._coreBrowserService,m),new l.SelectionRenderLayer(this._terminal,this._screenElement,1,this._bufferService,this._coreBrowserService,p,this._optionsService,m),new c.LinkRenderLayer(this._terminal,this._screenElement,2,i,this._bufferService,this._optionsService,p,this._coreBrowserService,m),new a.CursorRenderLayer(this._terminal,this._screenElement,3,this._onRequestRedraw,this._bufferService,this._optionsService,v,this._coreBrowserService,p,m)],this.dimensions=(0,o.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this.register((0,r.observeDevicePixelDimensions)(this._renderLayers[0].canvas,this._coreBrowserService.window,((e,t)=>this._setCanvasDevicePixelDimensions(e,t)))),this.register((0,h.toDisposable)((()=>{for(const e of this._renderLayers)e.dispose();(0,s.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){return this._renderLayers[0].cacheCanvas}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._bufferService.cols,this._bufferService.rows))}handleResize(e,t){this._updateDimensions();for(const e of this._renderLayers)e.resize(this.dimensions);this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}handleCharSizeChanged(){this.handleResize(this._bufferService.cols,this._bufferService.rows)}handleBlur(){this._runOperation((e=>e.handleBlur()))}handleFocus(){this._runOperation((e=>e.handleFocus()))}handleSelectionChanged(e,t,i=!1){this._runOperation((s=>s.handleSelectionChanged(e,t,i))),this._themeService.colors.selectionForeground&&this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}handleCursorMove(){this._runOperation((e=>e.handleCursorMove()))}clear(){this._runOperation((e=>e.reset()))}_runOperation(e){for(const t of this._renderLayers)e(t)}renderRows(e,t){for(const i of this._renderLayers)i.handleGridChanged(e,t)}clearTextureAtlas(){for(const e of this._renderLayers)e.clearTextureAtlas()}_updateDimensions(){if(!this._charSizeService.hasValidSize)return;const e=this._coreBrowserService.dpr;this.dimensions.device.char.width=Math.floor(this._charSizeService.width*e),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=1===this._optionsService.rawOptions.lineHeight?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._bufferService.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._bufferService.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows,this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols}_setCanvasDevicePixelDimensions(e,t){this.dimensions.device.canvas.height=t,this.dimensions.device.canvas.width=e;for(const e of this._renderLayers)e.resize(this.dimensions);this._requestRedrawViewport()}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}}t.CanvasRenderer=_},873:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CursorRenderLayer=void 0;const s=i(903),r=i(782),o=i(859);class n extends s.BaseRenderLayer{constructor(e,t,i,s,n,h,a,c,l,d){super(e,t,"cursor",i,!0,d,n,h,l,c),this._onRequestRedraw=s,this._coreService=a,this._cell=new r.CellData,this._state={x:0,y:0,isFocused:!1,style:"",width:0},this._cursorRenderers={bar:this._renderBarCursor.bind(this),block:this._renderBlockCursor.bind(this),underline:this._renderUnderlineCursor.bind(this)},this.register(h.onOptionChange((()=>this._handleOptionsChanged()))),this.register((0,o.toDisposable)((()=>{var e;null===(e=this._cursorBlinkStateManager)||void 0===e||e.dispose(),this._cursorBlinkStateManager=void 0})))}resize(e){super.resize(e),this._state={x:0,y:0,isFocused:!1,style:"",width:0}}reset(){var e;this._clearCursor(),null===(e=this._cursorBlinkStateManager)||void 0===e||e.restartBlinkAnimation(),this._handleOptionsChanged()}handleBlur(){var e;null===(e=this._cursorBlinkStateManager)||void 0===e||e.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleFocus(){var e;null===(e=this._cursorBlinkStateManager)||void 0===e||e.resume(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}_handleOptionsChanged(){var e;this._optionsService.rawOptions.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new h(this._coreBrowserService.isFocused,(()=>{this._render(!0)}),this._coreBrowserService)):(null===(e=this._cursorBlinkStateManager)||void 0===e||e.dispose(),this._cursorBlinkStateManager=void 0),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleCursorMove(){var e;null===(e=this._cursorBlinkStateManager)||void 0===e||e.restartBlinkAnimation()}handleGridChanged(e,t){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(!1):this._cursorBlinkStateManager.restartBlinkAnimation()}_render(e){if(!this._coreService.isCursorInitialized||this._coreService.isCursorHidden)return void this._clearCursor();const t=this._bufferService.buffer.ybase+this._bufferService.buffer.y,i=t-this._bufferService.buffer.ydisp;if(i<0||i>=this._bufferService.rows)return void this._clearCursor();const s=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(t).loadCell(s,this._cell),void 0!==this._cell.content){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css;const e=this._optionsService.rawOptions.cursorStyle;return e&&"block"!==e?this._cursorRenderers[e](s,i,this._cell):this._renderBlurCursor(s,i,this._cell),this._ctx.restore(),this._state.x=s,this._state.y=i,this._state.isFocused=!1,this._state.style=e,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===s&&this._state.y===i&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.rawOptions.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.rawOptions.cursorStyle||"block"](s,i,this._cell),this._ctx.restore(),this._state.x=s,this._state.y=i,this._state.isFocused=!1,this._state.style=this._optionsService.rawOptions.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}_clearCursor(){this._state&&(this._coreBrowserService.dpr<1?this._clearAll():this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})}_renderBarCursor(e,t,i){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillLeftLineAtCell(e,t,this._optionsService.rawOptions.cursorWidth),this._ctx.restore()}_renderBlockCursor(e,t,i){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillCells(e,t,i.getWidth(),1),this._ctx.fillStyle=this._themeService.colors.cursorAccent.css,this._fillCharTrueColor(i,e,t),this._ctx.restore()}_renderUnderlineCursor(e,t,i){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillBottomLineAtCells(e,t),this._ctx.restore()}_renderBlurCursor(e,t,i){this._ctx.save(),this._ctx.strokeStyle=this._themeService.colors.cursor.css,this._strokeRectAtCell(e,t,i.getWidth(),1),this._ctx.restore()}}t.CursorRenderLayer=n;class h{constructor(e,t,i){this._renderCallback=t,this._coreBrowserService=i,this.isCursorVisible=!0,e&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))))}_restartInterval(e=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const e=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,e>0)return void this._restartInterval(e)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const e=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(e)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),e)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},574:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GridCache=void 0,t.GridCache=class{constructor(){this.cache=[]}resize(e,t){for(let i=0;i{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkRenderLayer=void 0;const s=i(903),r=i(237),o=i(197);class n extends s.BaseRenderLayer{constructor(e,t,i,s,r,o,n,h,a){super(e,t,"link",i,!0,a,r,o,n,h),this.register(s.onShowLinkUnderline((e=>this._handleShowLinkUnderline(e)))),this.register(s.onHideLinkUnderline((e=>this._handleHideLinkUnderline(e))))}resize(e){super.resize(e),this._state=void 0}reset(){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){if(e.fg===r.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:e.fg&&(0,o.is256Color)(e.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let t=e.y1+1;t{Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionRenderLayer=void 0;const s=i(903);class r extends s.BaseRenderLayer{constructor(e,t,i,s,r,o,n,h){super(e,t,"selection",i,!0,h,s,n,o,r),this._clearState()}_clearState(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}}resize(e){super.resize(e),this._selectionModel.selectionStart&&this._selectionModel.selectionEnd&&this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}reset(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())}handleBlur(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleFocus(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleSelectionChanged(e,t,i){super.handleSelectionChanged(e,t,i),this._redrawSelection(e,t,i)}_redrawSelection(e,t,i){if(!this._didStateChange(e,t,i,this._bufferService.buffer.ydisp))return;if(this._clearAll(),!e||!t)return void this._clearState();const s=e[1]-this._bufferService.buffer.ydisp,r=t[1]-this._bufferService.buffer.ydisp,o=Math.max(s,0),n=Math.min(r,this._bufferService.rows-1);if(o>=this._bufferService.rows||n<0)this._state.ydisp=this._bufferService.buffer.ydisp;else{if(this._ctx.fillStyle=(this._coreBrowserService.isFocused?this._themeService.colors.selectionBackgroundTransparent:this._themeService.colors.selectionInactiveBackgroundTransparent).css,i){const i=e[0],s=t[0]-i,r=n-o+1;this._fillCells(i,o,s,r)}else{const i=s===o?e[0]:0,h=o===r?t[0]:this._bufferService.cols;this._fillCells(i,o,h-i,1);const a=Math.max(n-o-1,0);if(this._fillCells(0,o+1,this._bufferService.cols,a),o!==n){const e=r===n?t[0]:this._bufferService.cols;this._fillCells(0,n,e,1)}}this._state.start=[e[0],e[1]],this._state.end=[t[0],t[1]],this._state.columnSelectMode=i,this._state.ydisp=this._bufferService.buffer.ydisp}}_didStateChange(e,t,i,s){return!this._areCoordinatesEqual(e,this._state.start)||!this._areCoordinatesEqual(t,this._state.end)||i!==this._state.columnSelectMode||s!==this._state.ydisp}_areCoordinatesEqual(e,t){return!(!e||!t)&&e[0]===t[0]&&e[1]===t[1]}}t.SelectionRenderLayer=r},744:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextRenderLayer=void 0;const s=i(574),r=i(903),o=i(147),n=i(855),h=i(782),a=i(577),c=i(160);class l extends r.BaseRenderLayer{constructor(e,t,i,r,o,n,a,c,l,d){super(e,t,"text",i,r,d,o,n,c,l),this._characterJoinerService=a,this._characterWidth=0,this._characterFont="",this._characterOverlapCache={},this._workCell=new h.CellData,this._state=new s.GridCache,this.register(n.onSpecificOptionChange("allowTransparency",(e=>this._setTransparency(e))))}resize(e){super.resize(e);const t=this._getFont(!1,!1);this._characterWidth===e.device.char.width&&this._characterFont===t||(this._characterWidth=e.device.char.width,this._characterFont=t,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)}reset(){this._state.clear(),this._clearAll()}_forEachCell(e,t,i){for(let s=e;s<=t;s++){const e=s+this._bufferService.buffer.ydisp,t=this._bufferService.buffer.lines.get(e),r=this._characterJoinerService.getJoinedCharacters(e);for(let e=0;e0&&e===r[0][0]){h=!0;const e=r.shift();o=new a.JoinedCellData(this._workCell,t.translateToString(!0,e[0],e[1]),e[1]-e[0]),c=e[1]-1}!h&&this._isOverlapping(o)&&c{let l=null;e.isInverse()?l=e.isFgDefault()?this._themeService.colors.foreground.css:e.isFgRGB()?`rgb(${o.AttributeData.toColorRGB(e.getFgColor()).join(",")})`:this._themeService.colors.ansi[e.getFgColor()].css:e.isBgRGB()?l=`rgb(${o.AttributeData.toColorRGB(e.getBgColor()).join(",")})`:e.isBgPalette()&&(l=this._themeService.colors.ansi[e.getBgColor()].css),l&&e.isDim()&&(l=c.color.multiplyOpacity(c.css.toColor(l),.5).css);let d=!1;this._decorationService.forEachDecorationAtCell(t,this._bufferService.buffer.ydisp+a,void 0,(e=>{"top"!==e.options.layer&&d||(e.backgroundColorRGB&&(l=e.backgroundColorRGB.css),d="top"===e.options.layer)})),null===h&&(r=t,n=a),a!==n?(i.fillStyle=h||"",this._fillCells(r,n,s-r,1),r=t,n=a):h!==l&&(i.fillStyle=h||"",this._fillCells(r,n,t-r,1),r=t,n=a),h=l})),null!==h&&(i.fillStyle=h,this._fillCells(r,n,s-r,1)),i.restore()}_drawForeground(e,t){this._forEachCell(e,t,((e,t,i)=>this._drawChars(e,t,i)))}handleGridChanged(e,t){0!==this._state.cache.length&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,e,this._bufferService.cols,t-e+1),this._drawBackground(e,t),this._drawForeground(e,t))}_isOverlapping(e){if(1!==e.getWidth())return!1;if(e.getCode()<256)return!1;const t=e.getChars();if(this._characterOverlapCache.hasOwnProperty(t))return this._characterOverlapCache[t];this._ctx.save(),this._ctx.font=this._characterFont;const i=Math.floor(this._ctx.measureText(t).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[t]=i,i}}t.TextRenderLayer=l},503:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.removeElementFromParent=void 0,t.removeElementFromParent=function(...e){var t;for(const i of e)null===(t=null==i?void 0:i.parentElement)||void 0===t||t.removeChild(i)}},274:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellColorResolver=void 0;let i,s=0,r=0,o=!1,n=!1,h=!1;t.CellColorResolver=class{constructor(e,t,i,s,r){this._terminal=e,this._selectionRenderModel=t,this._decorationService=i,this._coreBrowserService=s,this._themeService=r,this.result={fg:0,bg:0,ext:0}}resolve(e,t,a){this.result.bg=e.bg,this.result.fg=e.fg,this.result.ext=268435456&e.bg?e.extended.ext:0,r=0,s=0,n=!1,o=!1,h=!1,i=this._themeService.colors,this._decorationService.forEachDecorationAtCell(t,a,"bottom",(e=>{e.backgroundColorRGB&&(r=e.backgroundColorRGB.rgba>>8&16777215,n=!0),e.foregroundColorRGB&&(s=e.foregroundColorRGB.rgba>>8&16777215,o=!0)})),h=this._selectionRenderModel.isCellSelected(this._terminal,t,a),h&&(r=(this._coreBrowserService.isFocused?i.selectionBackgroundOpaque:i.selectionInactiveBackgroundOpaque).rgba>>8&16777215,n=!0,i.selectionForeground&&(s=i.selectionForeground.rgba>>8&16777215,o=!0)),this._decorationService.forEachDecorationAtCell(t,a,"top",(e=>{e.backgroundColorRGB&&(r=e.backgroundColorRGB.rgba>>8&16777215,n=!0),e.foregroundColorRGB&&(s=e.foregroundColorRGB.rgba>>8&16777215,o=!0)})),n&&(r=h?-16777216&e.bg&-134217729|r|50331648:-16777216&e.bg|r|50331648),o&&(s=-16777216&e.fg&-67108865|s|50331648),67108864&this.result.fg&&(n&&!o&&(s=0==(50331648&this.result.bg)?-134217728&this.result.fg|16777215&i.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,o=!0),!n&&o&&(r=0==(50331648&this.result.fg)?-67108864&this.result.bg|16777215&i.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,n=!0)),i=void 0,this.result.bg=n?r:this.result.bg,this.result.fg=o?s:this.result.fg}}},627:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.removeTerminalFromCache=t.acquireTextureAtlas=void 0;const s=i(509),r=i(197),o=[];t.acquireTextureAtlas=function(e,t,i,n,h,a,c){const l=(0,r.generateConfig)(i,n,h,a,e,t,c);for(let t=0;t=0){if((0,r.configEquals)(i.config,l))return i.atlas;1===i.ownedBy.length?(i.atlas.dispose(),o.splice(t,1)):i.ownedBy.splice(s,1);break}}for(let t=0;t{Object.defineProperty(t,"__esModule",{value:!0}),t.is256Color=t.configEquals=t.generateConfig=void 0;const s=i(160);t.generateConfig=function(e,t,i,r,o,n,h){const a={foreground:n.foreground,background:n.background,cursor:s.NULL_COLOR,cursorAccent:s.NULL_COLOR,selectionForeground:s.NULL_COLOR,selectionBackgroundTransparent:s.NULL_COLOR,selectionBackgroundOpaque:s.NULL_COLOR,selectionInactiveBackgroundTransparent:s.NULL_COLOR,selectionInactiveBackgroundOpaque:s.NULL_COLOR,ansi:n.ansi.slice(),contrastCache:n.contrastCache};return{customGlyphs:o.options.customGlyphs,devicePixelRatio:h,letterSpacing:o.options.letterSpacing,lineHeight:o.options.lineHeight,deviceCellWidth:e,deviceCellHeight:t,deviceCharWidth:i,deviceCharHeight:r,fontFamily:o.options.fontFamily,fontSize:o.options.fontSize,fontWeight:o.options.fontWeight,fontWeightBold:o.options.fontWeightBold,allowTransparency:o.options.allowTransparency,drawBoldTextInBrightColors:o.options.drawBoldTextInBrightColors,minimumContrastRatio:o.options.minimumContrastRatio,colors:a}},t.configEquals=function(e,t){for(let i=0;i{Object.defineProperty(t,"__esModule",{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;const s=i(399);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=s.isFirefox||s.isLegacyEdge?"bottom":"ideographic"},860:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tryDrawCustomChar=t.powerlineDefinitions=t.boxDrawingDefinitions=t.blockElementDefinitions=void 0;const s=i(374);t.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const r={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};t.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"║":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╒":{1:(e,t)=>`M.5,1 L.5,${.5-t} L1,${.5-t} M.5,${.5+t} L1,${.5+t}`},"╓":{1:(e,t)=>`M${.5-e},1 L${.5-e},.5 L1,.5 M${.5+e},.5 L${.5+e},1`},"╔":{1:(e,t)=>`M1,${.5-t} L${.5-e},${.5-t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1`},"╕":{1:(e,t)=>`M0,${.5-t} L.5,${.5-t} L.5,1 M0,${.5+t} L.5,${.5+t}`},"╖":{1:(e,t)=>`M${.5+e},1 L${.5+e},.5 L0,.5 M${.5-e},.5 L${.5-e},1`},"╗":{1:(e,t)=>`M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M0,${.5-t} L${.5+e},${.5-t} L${.5+e},1`},"╘":{1:(e,t)=>`M.5,0 L.5,${.5+t} L1,${.5+t} M.5,${.5-t} L1,${.5-t}`},"╙":{1:(e,t)=>`M1,.5 L${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╚":{1:(e,t)=>`M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0 M1,${.5+t} L${.5-e},${.5+t} L${.5-e},0`},"╛":{1:(e,t)=>`M0,${.5+t} L.5,${.5+t} L.5,0 M0,${.5-t} L.5,${.5-t}`},"╜":{1:(e,t)=>`M0,.5 L${.5+e},.5 L${.5+e},0 M${.5-e},.5 L${.5-e},0`},"╝":{1:(e,t)=>`M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M0,${.5+t} L${.5+e},${.5+t} L${.5+e},0`},"╞":{1:(e,t)=>`M.5,0 L.5,1 M.5,${.5-t} L1,${.5-t} M.5,${.5+t} L1,${.5+t}`},"╟":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1 M${.5+e},.5 L1,.5`},"╠":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╡":{1:(e,t)=>`M.5,0 L.5,1 M0,${.5-t} L.5,${.5-t} M0,${.5+t} L.5,${.5+t}`},"╢":{1:(e,t)=>`M0,.5 L${.5-e},.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╣":{1:(e,t)=>`M${.5+e},0 L${.5+e},1 M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0`},"╤":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t} M.5,${.5+t} L.5,1`},"╥":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},1 M${.5+e},.5 L${.5+e},1`},"╦":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1`},"╧":{1:(e,t)=>`M.5,0 L.5,${.5-t} M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"╨":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╩":{1:(e,t)=>`M0,${.5+t} L1,${.5+t} M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╪":{1:(e,t)=>`M.5,0 L.5,1 M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"╫":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╬":{1:(e,t)=>`M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1 M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(e,t)=>`M.5,1 L.5,${.5+t/.15*.5} C.5,${.5+t/.15*.5},.5,.5,1,.5`},"╮":{1:(e,t)=>`M.5,1 L.5,${.5+t/.15*.5} C.5,${.5+t/.15*.5},.5,.5,0,.5`},"╯":{1:(e,t)=>`M.5,0 L.5,${.5-t/.15*.5} C.5,${.5-t/.15*.5},.5,.5,0,.5`},"╰":{1:(e,t)=>`M.5,0 L.5,${.5-t/.15*.5} C.5,${.5-t/.15*.5},.5,.5,1,.5`}},t.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:1,leftPadding:1}},t.tryDrawCustomChar=function(e,i,n,c,l,d,_,u){const f=t.blockElementDefinitions[i];if(f)return function(e,t,i,s,r,o){for(let n=0;n7&&parseInt(c.slice(7,9),16)||1;else{if(!c.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${c}" when drawing pattern glyph`);[d,_,u,f]=c.substring(5,c.length-1).split(",").map((e=>parseFloat(e)))}for(let e=0;ee.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]),L:(e,t)=>e.lineTo(t[0],t[1]),M:(e,t)=>e.moveTo(t[0],t[1])};function a(e,t,i,s,r,o,h,a=0,c=0){const l=e.map((e=>parseFloat(e)||parseInt(e)));if(l.length<2)throw new Error("Too few arguments for instruction");for(let e=0;e{Object.defineProperty(t,"__esModule",{value:!0}),t.observeDevicePixelDimensions=void 0;const s=i(859);t.observeDevicePixelDimensions=function(e,t,i){let r=new t.ResizeObserver((t=>{const s=t.find((t=>t.target===e));if(!s)return;if(!("devicePixelContentBoxSize"in s))return null==r||r.disconnect(),void(r=void 0);const o=s.devicePixelContentBoxSize[0].inlineSize,n=s.devicePixelContentBoxSize[0].blockSize;o>0&&n>0&&i(o,n)}));try{r.observe(e,{box:["device-pixel-content-box"]})}catch(e){r.disconnect(),r=void 0}return(0,s.toDisposable)((()=>null==r?void 0:r.disconnect()))}},374:(e,t)=>{function i(e){return 57508<=e&&e<=57558}Object.defineProperty(t,"__esModule",{value:!0}),t.createRenderDimensions=t.excludeFromContrastRatioDemands=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(e){if(!e)throw new Error("value must not be falsy");return e},t.isPowerlineGlyph=i,t.isRestrictedPowerlineGlyph=function(e){return 57520<=e&&e<=57527},t.excludeFromContrastRatioDemands=function(e){return i(e)||function(e){return 9472<=e&&e<=9631}(e)},t.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}}},296:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createSelectionRenderModel=void 0;class i{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,i,s=!1){if(this.selectionStart=t,this.selectionEnd=i,!t||!i||t[0]===i[0]&&t[1]===i[1])return void this.clear();const r=t[1]-e.buffer.active.viewportY,o=i[1]-e.buffer.active.viewportY,n=Math.max(r,0),h=Math.min(o,e.rows-1);n>=e.rows||h<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=s,this.viewportStartRow=r,this.viewportEndRow=o,this.viewportCappedStartRow=n,this.viewportCappedEndRow=h,this.startCol=t[0],this.endCol=i[0])}isCellSelected(e,t,i){return!!this.hasSelection&&(i-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&i>=this.viewportCappedStartRow&&t=this.viewportCappedStartRow&&t>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i=this.startCol&&t=this.startCol)}}t.createSelectionRenderModel=function(){return new i}},509:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextureAtlas=void 0;const s=i(237),r=i(855),o=i(147),n=i(160),h=i(860),a=i(374),c=i(485),l=i(385),d=1024,_=1024,u=Math.floor(819.2),f={offset:{x:0,y:0},texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let g;function v(e,t,i,s){const r=t.rgba>>>24,o=t.rgba>>>16&255,n=t.rgba>>>8&255,h=i.rgba>>>24,a=i.rgba>>>16&255,c=i.rgba>>>8&255,l=Math.floor((Math.abs(r-h)+Math.abs(o-a)+Math.abs(n-c))/12);let d=!0;for(let t=0;t{if(!this._cacheMap.get(t,r.DEFAULT_COLOR,r.DEFAULT_COLOR,r.DEFAULT_EXT)){const e=this._drawToCache(t,r.DEFAULT_COLOR,r.DEFAULT_COLOR,r.DEFAULT_EXT);this._cacheMap.set(t,r.DEFAULT_COLOR,r.DEFAULT_COLOR,r.DEFAULT_EXT,e)}}))}beginFrame(){return this._currentRow.y>u&&(this.clearTexture(),this.warmUp(),!0)}clearTexture(){0===this._currentRow.x&&0===this._currentRow.y||(this._cacheCtx.clearRect(0,0,d,_),this._cacheMap.clear(),this._cacheMapCombined.clear(),this._currentRow.x=0,this._currentRow.y=0,this._currentRow.height=0,this._fixedRows.length=0,this._didWarmUp=!1,this.hasCanvasChanged=!0)}getRasterizedGlyphCombinedChar(e,t,i,s){return this._getFromCacheMap(this._cacheMapCombined,e,t,i,s)}getRasterizedGlyph(e,t,i,s){return this._getFromCacheMap(this._cacheMap,e,t,i,s)}_getFromCacheMap(e,t,i,s,r){return g=e.get(t,i,s,r),g||(g=this._drawToCache(t,i,s,r),e.set(t,i,s,r,g)),g}_getColorFromAnsiIndex(e){if(e>=this._config.colors.ansi.length)throw new Error("No color found for idx "+e);return this._config.colors.ansi[e]}_getBackgroundColor(e,t,i,r){if(this._config.allowTransparency)return n.NULL_COLOR;let h;switch(e){case 16777216:case 33554432:h=this._getColorFromAnsiIndex(t);break;case 50331648:const e=o.AttributeData.toColorRGB(t);h=n.rgba.toColor(e[0],e[1],e[2]);break;default:h=i?this._config.colors.foreground:this._config.colors.background}return r&&(h=n.color.blend(this._config.colors.background,n.color.multiplyOpacity(h,s.DIM_OPACITY))),h}_getForegroundColor(e,t,i,r,h,a,c,l,d,_){const u=this._getMinimumContrastColor(e,t,i,r,h,a,!1,d,_);if(u)return u;let f;switch(h){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&d&&a<8&&(a+=8),f=this._getColorFromAnsiIndex(a);break;case 50331648:const e=o.AttributeData.toColorRGB(a);f=n.rgba.toColor(e[0],e[1],e[2]);break;default:f=c?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(f=n.color.opaque(f)),l&&(f=n.color.multiplyOpacity(f,s.DIM_OPACITY)),f}_resolveBackgroundRgba(e,t,i){switch(e){case 16777216:case 33554432:return this._getColorFromAnsiIndex(t).rgba;case 50331648:return t<<8;default:return i?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(e,t,i,s){switch(e){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&s&&t<8&&(t+=8),this._getColorFromAnsiIndex(t).rgba;case 50331648:return t<<8;default:return i?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(e,t,i,s,r,o,h,a,c){if(1===this._config.minimumContrastRatio||c)return;const l=this._config.colors.contrastCache.getColor(e,s);if(void 0!==l)return l||void 0;const d=this._resolveBackgroundRgba(t,i,h),_=this._resolveForegroundRgba(r,o,h,a),u=n.rgba.ensureContrastRatio(d,_,this._config.minimumContrastRatio);if(!u)return void this._config.colors.contrastCache.setColor(e,s,null);const f=n.rgba.toColor(u>>24&255,u>>16&255,u>>8&255);return this._config.colors.contrastCache.setColor(e,s,f),f}_drawToCache(e,t,i,r){const n="number"==typeof e?String.fromCharCode(e):e;this.hasCanvasChanged=!0;const c=this._config.deviceCellWidth*Math.max(n.length,2)+4;this._tmpCanvas.width=12&&!this._config.allowTransparency&&" "!==n){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const t=this._tmpCtx.measureText(n);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in t&&t.actualBoundingBoxDescent>0){this._tmpCtx.save();const t=new Path2D;t.rect(i,s-Math.ceil(e/2),this._config.deviceCellWidth,h-s+Math.ceil(e/2)),this._tmpCtx.clip(t),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=S.css,this._tmpCtx.strokeText(n,k,k+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if($||this._tmpCtx.fillText(n,k,k+this._config.deviceCharHeight),"_"===n&&!this._config.allowTransparency){let e=v(this._tmpCtx.getImageData(k,k,this._config.deviceCellWidth,this._config.deviceCellHeight),S,T,E);if(e)for(let t=1;t<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=S.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(n,k,k+this._config.deviceCharHeight-t),e=v(this._tmpCtx.getImageData(k,k,this._config.deviceCellWidth,this._config.deviceCellHeight),S,T,E),e);t++);}if(w){const e=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),t=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=e,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(k,k+Math.floor(this._config.deviceCharHeight/2)-t),this._tmpCtx.lineTo(k+this._config.deviceCharWidth*B,k+Math.floor(this._config.deviceCharHeight/2)-t),this._tmpCtx.stroke()}this._tmpCtx.restore();const I=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let O;if(O=this._config.allowTransparency?function(e){for(let t=0;t0)return!1;return!0}(I):v(I,S,T,E),O)return f;const F=this._findGlyphBoundingBox(I,this._workBoundingBox,c,D,$,k);let P;for(;;){P=this._currentRow;for(const e of this._fixedRows)(P===this._currentRow||e.height2*F.size.y&&(this._currentRow.height>0&&this._fixedRows.push(this._currentRow),P={x:0,y:this._currentRow.y+this._currentRow.height,height:F.size.y},this._fixedRows.push(P),this._currentRow={x:0,y:P.y+P.height,height:0}),P.x+F.size.x<=d)break;P===this._currentRow?(P.x=0,P.y+=P.height,P.height=0):this._fixedRows.splice(this._fixedRows.indexOf(P),1)}return F.texturePosition.x=P.x,F.texturePosition.y=P.y,F.texturePositionClipSpace.x=P.x/d,F.texturePositionClipSpace.y=P.y/_,P.height=Math.max(P.height,F.size.y),P.x+=F.size.x,this._cacheCtx.putImageData(I,F.texturePosition.x-this._workBoundingBox.left,F.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,F.size.x,F.size.y),F}_findGlyphBoundingBox(e,t,i,s,r,o){t.top=0;const n=s?this._config.deviceCellHeight:this._tmpCanvas.height,h=s?this._config.deviceCellWidth:i;let a=!1;for(let i=0;i=0;i--){for(let s=0;s=0;i--){for(let s=0;s=0;h--)(r=e[h])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharacterJoinerService=t.JoinedCellData=void 0;const o=i(147),n=i(855),h=i(782),a=i(97);class c extends o.AttributeData{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.JoinedCellData=c;let l=class e{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new h.CellData}register(e){const t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t1){const e=this._getJoinedRanges(s,h,o,t,r);for(let t=0;t1){const e=this._getJoinedRanges(s,h,o,t,r);for(let t=0;t{Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=t.NULL_COLOR=void 0;const s=i(399);let r=0,o=0,n=0,h=0;var a,c,l;function d(e){const t=e.toString(16);return t.length<2?"0"+t:t}function _(e,t){return e>>0}}(a=t.channels||(t.channels={})),function(e){function t(e,t){return h=Math.round(255*t),[r,o,n]=l.toChannels(e.rgba),{css:a.toCss(r,o,n,h),rgba:a.toRgba(r,o,n,h)}}e.blend=function(e,t){if(h=(255&t.rgba)/255,1===h)return{css:t.css,rgba:t.rgba};const i=t.rgba>>24&255,s=t.rgba>>16&255,c=t.rgba>>8&255,l=e.rgba>>24&255,d=e.rgba>>16&255,_=e.rgba>>8&255;return r=l+Math.round((i-l)*h),o=d+Math.round((s-d)*h),n=_+Math.round((c-_)*h),{css:a.toCss(r,o,n),rgba:a.toRgba(r,o,n)}},e.isOpaque=function(e){return 255==(255&e.rgba)},e.ensureContrastRatio=function(e,t,i){const s=l.ensureContrastRatio(e.rgba,t.rgba,i);if(s)return l.toColor(s>>24&255,s>>16&255,s>>8&255)},e.opaque=function(e){const t=(255|e.rgba)>>>0;return[r,o,n]=l.toChannels(t),{css:a.toCss(r,o,n),rgba:t}},e.opacity=t,e.multiplyOpacity=function(e,i){return h=255&e.rgba,t(e,h*i/255)},e.toColorRGB=function(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}}(t.color||(t.color={})),function(e){let t,i;if(!s.isNode){const e=document.createElement("canvas");e.width=1,e.height=1;const s=e.getContext("2d",{willReadFrequently:!0});s&&(t=s,t.globalCompositeOperation="copy",i=t.createLinearGradient(0,0,1,1))}e.toColor=function(e){if(e.match(/#[\da-f]{3,8}/i))switch(e.length){case 4:return r=parseInt(e.slice(1,2).repeat(2),16),o=parseInt(e.slice(2,3).repeat(2),16),n=parseInt(e.slice(3,4).repeat(2),16),l.toColor(r,o,n);case 5:return r=parseInt(e.slice(1,2).repeat(2),16),o=parseInt(e.slice(2,3).repeat(2),16),n=parseInt(e.slice(3,4).repeat(2),16),h=parseInt(e.slice(4,5).repeat(2),16),l.toColor(r,o,n,h);case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}const s=e.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(s)return r=parseInt(s[1]),o=parseInt(s[2]),n=parseInt(s[3]),h=Math.round(255*(void 0===s[5]?1:parseFloat(s[5]))),l.toColor(r,o,n,h);if(!t||!i)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=i,t.fillStyle=e,"string"!=typeof t.fillStyle)throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[r,o,n,h]=t.getImageData(0,0,1,1).data,255!==h)throw new Error("css.toColor: Unsupported css format");return{rgba:a.toRgba(r,o,n,h),css:e}}}(t.css||(t.css={})),function(e){function t(e,t,i){const s=e/255,r=t/255,o=i/255;return.2126*(s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))+.0722*(o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4))}e.relativeLuminance=function(e){return t(e>>16&255,e>>8&255,255&e)},e.relativeLuminance2=t}(c=t.rgb||(t.rgb={})),function(e){function t(e,t,i){const s=e>>24&255,r=e>>16&255,o=e>>8&255;let n=t>>24&255,h=t>>16&255,a=t>>8&255,l=_(c.relativeLuminance2(n,h,a),c.relativeLuminance2(s,r,o));for(;l0||h>0||a>0);)n-=Math.max(0,Math.ceil(.1*n)),h-=Math.max(0,Math.ceil(.1*h)),a-=Math.max(0,Math.ceil(.1*a)),l=_(c.relativeLuminance2(n,h,a),c.relativeLuminance2(s,r,o));return(n<<24|h<<16|a<<8|255)>>>0}function i(e,t,i){const s=e>>24&255,r=e>>16&255,o=e>>8&255;let n=t>>24&255,h=t>>16&255,a=t>>8&255,l=_(c.relativeLuminance2(n,h,a),c.relativeLuminance2(s,r,o));for(;l>>0}e.ensureContrastRatio=function(e,s,r){const o=c.relativeLuminance(e>>8),n=c.relativeLuminance(s>>8);if(_(o,n)>8));if(h_(o,c.relativeLuminance(t>>8))?n:t}return n}const h=i(e,s,r),a=_(o,c.relativeLuminance(h>>8));if(a_(o,c.relativeLuminance(i>>8))?h:i}return h}},e.reduceLuminance=t,e.increaseLuminance=i,e.toChannels=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},e.toColor=function(e,t,i,s){return{css:a.toCss(e,t,i,s),rgba:a.toRgba(e,t,i,s)}}}(l=t.rgba||(t.rgba={})),t.toPaddedHex=d,t.contrastRatio=_},345:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=e=>(this._listeners.push(e),{dispose:()=>{if(!this._disposed)for(let t=0;tt.fire(e)))}},859:(e,t)=>{function i(e){for(const t of e)t.dispose();e.length=0}Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const e of this._disposables)e.dispose();this._disposables.length=0}register(e){return this._disposables.push(e),e}unregister(e){const t=this._disposables.indexOf(e);-1!==t&&this._disposables.splice(t,1)}},t.toDisposable=function(e){return{dispose:e}},t.disposeArray=i,t.getDisposeArrayDisposable=function(e){return{dispose:()=>i(e)}}},485:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class i{constructor(){this._data={}}set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}}t.TwoKeyMap=i,t.FourKeyMap=class{constructor(){this._data=new i}set(e,t,s,r,o){this._data.get(e,t)||this._data.set(e,t,new i),this._data.get(e,t).set(s,r,o)}get(e,t,i,s){var r;return null===(r=this._data.get(e,t))||void 0===r?void 0:r.get(i,s)}clear(){this._data.clear()}}},399:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.isSafari=t.isLegacyEdge=t.isFirefox=t.isNode=void 0,t.isNode="undefined"==typeof navigator;const i=t.isNode?"node":navigator.userAgent,s=t.isNode?"node":navigator.platform;t.isFirefox=i.includes("Firefox"),t.isLegacyEdge=i.includes("Edge"),t.isSafari=/^((?!chrome|android).)*safari/i.test(i),t.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(s),t.isIpad="iPad"===s,t.isIphone="iPhone"===s,t.isWindows=["Windows","Win16","Win32","WinCE"].includes(s),t.isLinux=s.indexOf("Linux")>=0},385:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DebouncedIdleTask=t.IdleTaskQueue=t.PriorityTaskQueue=void 0;const s=i(399);class r{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._ie.timeRemaining())return void this._start();this.clear()}}class o extends r{_requestCallback(e){return setTimeout((()=>e(this._createDeadline(16))))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){const t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}}t.PriorityTaskQueue=o,t.IdleTaskQueue=!s.isNode&&"requestIdleCallback"in window?class extends r{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}}:o,t.DebouncedIdleTask=class{constructor(){this._queue=new t.IdleTaskQueue}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}}},147:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class i{constructor(){this.fg=0,this.bg=0,this.extended=new s}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){const e=new i;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underlineStyle?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return 50331648==(50331648&this.fg)}isBgRGB(){return 50331648==(50331648&this.bg)}isFgPalette(){return 16777216==(50331648&this.fg)||33554432==(50331648&this.fg)}isBgPalette(){return 16777216==(50331648&this.bg)||33554432==(50331648&this.bg)}isFgDefault(){return 0==(50331648&this.fg)}isBgDefault(){return 0==(50331648&this.bg)}isAttributeDefault(){return 0===this.fg&&0===this.bg}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?50331648==(50331648&this.extended.underlineColor):this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?16777216==(50331648&this.extended.underlineColor)||33554432==(50331648&this.extended.underlineColor):this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?0==(50331648&this.extended.underlineColor):this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}t.AttributeData=i;class s{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(e){this._ext&=-67108864,this._ext|=67108863&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}clone(){return new s(this._ext,this._urlId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId}}t.ExtendedAttrs=s},782:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;const s=i(133),r=i(855),o=i(147);class n extends o.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new o.ExtendedAttrs,this.combinedData=""}static fromCharData(e){const t=new n;return t.setFromCharData(e),t}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,s.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[r.CHAR_DATA_ATTR_INDEX],this.bg=0;let t=!1;if(e[r.CHAR_DATA_CHAR_INDEX].length>2)t=!0;else if(2===e[r.CHAR_DATA_CHAR_INDEX].length){const i=e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=i&&i<=56319){const s=e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=s&&s<=57343?this.content=1024*(i-55296)+s-56320+65536|e[r.CHAR_DATA_WIDTH_INDEX]<<22:t=!0}else t=!0}else this.content=e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e[r.CHAR_DATA_WIDTH_INDEX]<<22;t&&(this.combinedData=e[r.CHAR_DATA_CHAR_INDEX],this.content=2097152|e[r.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=n},855:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=256,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},133:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)},t.utf32ToString=function(e,t=0,i=e.length){let s="";for(let r=t;r65535?(t-=65536,s+=String.fromCharCode(55296+(t>>10))+String.fromCharCode(t%1024+56320)):s+=String.fromCharCode(t)}return s},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){const i=e.length;if(!i)return 0;let s=0,r=0;if(this._interim){const i=e.charCodeAt(r++);56320<=i&&i<=57343?t[s++]=1024*(this._interim-55296)+i-56320+65536:(t[s++]=this._interim,t[s++]=i),this._interim=0}for(let o=r;o=i)return this._interim=r,s;const n=e.charCodeAt(o);56320<=n&&n<=57343?t[s++]=1024*(r-55296)+n-56320+65536:(t[s++]=r,t[s++]=n)}else 65279!==r&&(t[s++]=r)}return s}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){const i=e.length;if(!i)return 0;let s,r,o,n,h=0,a=0,c=0;if(this.interim[0]){let s=!1,r=this.interim[0];r&=192==(224&r)?31:224==(240&r)?15:7;let o,n=0;for(;(o=63&this.interim[++n])&&n<4;)r<<=6,r|=o;const a=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,l=a-n;for(;c=i)return 0;if(o=e[c++],128!=(192&o)){c--,s=!0;break}this.interim[n++]=o,r<<=6,r|=63&o}s||(2===a?r<128?c--:t[h++]=r:3===a?r<2048||r>=55296&&r<=57343||65279===r||(t[h++]=r):r<65536||r>1114111||(t[h++]=r)),this.interim.fill(0)}const l=i-4;let d=c;for(;d=i)return this.interim[0]=s,h;if(r=e[d++],128!=(192&r)){d--;continue}if(a=(31&s)<<6|63&r,a<128){d--;continue}t[h++]=a}else if(224==(240&s)){if(d>=i)return this.interim[0]=s,h;if(r=e[d++],128!=(192&r)){d--;continue}if(d>=i)return this.interim[0]=s,this.interim[1]=r,h;if(o=e[d++],128!=(192&o)){d--;continue}if(a=(15&s)<<12|(63&r)<<6|63&o,a<2048||a>=55296&&a<=57343||65279===a)continue;t[h++]=a}else if(240==(248&s)){if(d>=i)return this.interim[0]=s,h;if(r=e[d++],128!=(192&r)){d--;continue}if(d>=i)return this.interim[0]=s,this.interim[1]=r,h;if(o=e[d++],128!=(192&o)){d--;continue}if(d>=i)return this.interim[0]=s,this.interim[1]=r,this.interim[2]=o,h;if(n=e[d++],128!=(192&n)){d--;continue}if(a=(7&s)<<18|(63&r)<<12|(63&o)<<6|63&n,a<65536||a>1114111)continue;t[h++]=a}}return h}}},726:(e,t)=>{function i(e,t,i){t.di$target===t?t.di$dependencies.push({id:e,index:i}):(t.di$dependencies=[{id:e,index:i}],t.di$target=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0,t.serviceRegistry=new Map,t.getServiceDependencies=function(e){return e.di$dependencies||[]},t.createDecorator=function(e){if(t.serviceRegistry.has(e))return t.serviceRegistry.get(e);const s=function(e,t,r){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");i(s,e,r)};return s.toString=()=>e,t.serviceRegistry.set(e,s),s}},97:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;const s=i(726);var r;t.IBufferService=(0,s.createDecorator)("BufferService"),t.ICoreMouseService=(0,s.createDecorator)("CoreMouseService"),t.ICoreService=(0,s.createDecorator)("CoreService"),t.ICharsetService=(0,s.createDecorator)("CharsetService"),t.IInstantiationService=(0,s.createDecorator)("InstantiationService"),(r=t.LogLevelEnum||(t.LogLevelEnum={}))[r.DEBUG=0]="DEBUG",r[r.INFO=1]="INFO",r[r.WARN=2]="WARN",r[r.ERROR=3]="ERROR",r[r.OFF=4]="OFF",t.ILogService=(0,s.createDecorator)("LogService"),t.IOptionsService=(0,s.createDecorator)("OptionsService"),t.IOscLinkService=(0,s.createDecorator)("OscLinkService"),t.IUnicodeService=(0,s.createDecorator)("UnicodeService"),t.IDecorationService=(0,s.createDecorator)("DecorationService")}},t={};function i(s){var r=t[s];if(void 0!==r)return r.exports;var o=t[s]={exports:{}};return e[s].call(o.exports,o,o.exports,i),o.exports}var s={};return(()=>{var e=s;Object.defineProperty(e,"__esModule",{value:!0}),e.CanvasAddon=void 0;const t=i(949),r=i(345),o=i(859);class n extends o.Disposable{constructor(){super(...arguments),this._onChangeTextureAtlas=this.register(new r.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event}get textureAtlas(){var e;return null===(e=this._renderer)||void 0===e?void 0:e.textureAtlas}activate(e){const i=e._core;if(!e.element)return void this.register(i.onWillOpen((()=>this.activate(e))));this._terminal=e;const s=i.coreService,n=i.optionsService,h=i.screenElement,a=i.linkifier2,c=i,l=c._bufferService,d=c._renderService,_=c._characterJoinerService,u=c._charSizeService,f=c._coreBrowserService,g=c._decorationService,v=c._themeService;this._renderer=new t.CanvasRenderer(e,h,a,l,u,n,_,s,f,g,v),this.register((0,r.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),d.setRenderer(this._renderer),d.handleResize(l.cols,l.rows),this.register((0,o.toDisposable)((()=>{var t;d.setRenderer(this._terminal._core._createRenderer()),d.handleResize(e.cols,e.rows),null===(t=this._renderer)||void 0===t||t.dispose(),this._renderer=void 0})))}}e.CanvasAddon=n})(),s})()}));//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/xterm-addon-canvas/lib/xterm-addon-canvas.js.mapCopyright (c) 2017, The xterm.js authors (https://github.com/xtermjs/xterm.js) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "xterm-addon-search", "version": "0.11.0-beta.7", "author": { "name": "The xterm.js authors", "url": "https://xtermjs.org/" }, "main": "lib/xterm-addon-search.js", "types": "typings/xterm-addon-search.d.ts", "repository": "https://github.com/xtermjs/xterm.js", "license": "MIT", "keywords": [ "terminal", "xterm", "xterm.js" ], "scripts": { "build": "../../node_modules/.bin/tsc -p .", "prepackage": "npm run build", "package": "../../node_modules/.bin/webpack", "prepublishOnly": "npm run package" }, "peerDependencies": { "xterm": "^5.0.0" } }!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SearchAddon=t():e.SearchAddon=t()}(self,(function(){return(()=>{"use strict";var e={345:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=e=>(this._listeners.push(e),{dispose:()=>{if(!this._disposed)for(let t=0;tt.fire(e)))}},859:(e,t)=>{function s(e){for(const t of e)t.dispose();e.length=0}Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1,this.dispose=()=>{this._isDisposed=!0;for(const e of this._disposables)e.dispose();this._disposables.length=0}}register(e){return this._disposables.push(e),e}unregister(e){const t=this._disposables.indexOf(e);-1!==t&&this._disposables.splice(t,1)}},t.toDisposable=function(e){return{dispose:e}},t.disposeArray=s,t.getDisposeArrayDisposable=function(e){return{dispose:()=>s(e)}}}},t={};function s(i){var r=t[i];if(void 0!==r)return r.exports;var n=t[i]={exports:{}};return e[i](n,n.exports,s),n.exports}var i={};return(()=>{var e=i;Object.defineProperty(e,"__esModule",{value:!0}),e.SearchAddon=void 0;const t=s(345),r=s(859),n=" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?";class o extends r.Disposable{constructor(){super(...arguments),this._linesCacheTimeoutId=0,this._onDidChangeResults=this.register(new t.EventEmitter),this.onDidChangeResults=this._onDidChangeResults.event}activate(e){this._terminal=e,this._onDataDisposable=this.register(this._terminal.onWriteParsed((()=>this._updateMatches()))),this._onResizeDisposable=this.register(this._terminal.onResize((()=>this._updateMatches()))),this.register((0,r.toDisposable)((()=>{var e,t;this.clearDecorations(),null===(e=this._onDataDisposable)||void 0===e||e.dispose(),null===(t=this._onResizeDisposable)||void 0===t||t.dispose()})))}_updateMatches(){var e;this._highlightTimeout&&window.clearTimeout(this._highlightTimeout),this._cachedSearchTerm&&(null===(e=this._lastSearchOptions)||void 0===e?void 0:e.decorations)&&(this._highlightTimeout=setTimeout((()=>{var e,t;this.findPrevious(this._cachedSearchTerm,Object.assign(Object.assign({},this._lastSearchOptions),{incremental:!0,noScroll:!0})),this._resultIndex=this._searchResults?this._searchResults.size-1:-1,this._onDidChangeResults.fire({resultIndex:this._resultIndex,resultCount:null!==(t=null===(e=this._searchResults)||void 0===e?void 0:e.size)&&void 0!==t?t:-1})}),200))}clearDecorations(e){var t,s,i,r;null===(t=this._selectedDecoration)||void 0===t||t.dispose(),null===(s=this._searchResults)||void 0===s||s.clear(),null===(i=this._resultDecorations)||void 0===i||i.forEach((e=>{for(const t of e)t.dispose()})),null===(r=this._resultDecorations)||void 0===r||r.clear(),this._searchResults=void 0,this._resultDecorations=void 0,e||(this._cachedSearchTerm=void 0)}clearActiveDecoration(){var e;null===(e=this._selectedDecoration)||void 0===e||e.dispose(),this._selectedDecoration=void 0}findNext(e,t){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");return this._lastSearchOptions=t,(null==t?void 0:t.decorations)&&(void 0===this._resultIndex&&void 0!==this._cachedSearchTerm&&e===this._cachedSearchTerm||this._highlightAllMatches(e,t)),this._fireResults(e,this._findNextAndSelect(e,t),t)}_highlightAllMatches(e,t){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!e||0===e.length)return void this.clearDecorations();t=t||{},this.clearDecorations(!0),this._searchResults=new Map,this._resultDecorations=new Map;const s=this._resultDecorations;let i=this._find(e,0,0,t);for(;i&&!this._searchResults.get(`${i.row}-${i.col}`);)if(this._searchResults.set(`${i.row}-${i.col}`,i),i=this._find(e,i.col+i.term.length>=this._terminal.cols?i.row+1:i.row,i.col+i.term.length>=this._terminal.cols?0:i.col+1,t),this._searchResults.size>1e3)return this.clearDecorations(),void(this._resultIndex=void 0);this._searchResults.forEach((e=>{const i=this._createResultDecoration(e,t.decorations);if(i){const e=s.get(i.marker.line)||[];e.push(i),s.set(i.marker.line,e)}}))}_find(e,t,s,i){var r;if(!this._terminal||!e||0===e.length)return null===(r=this._terminal)||void 0===r||r.clearSelection(),void this.clearDecorations();if(s>this._terminal.cols)throw new Error(`Invalid col: ${s} to search in terminal of ${this._terminal.cols} cols`);let n;this._initLinesCache();const o={startRow:t,startCol:s};if(n=this._findInLine(e,o,i),!n)for(let s=t+1;s=this._searchResults.size&&(this._resultIndex=0))),this._selectResult(l,null==t?void 0:t.decorations,null==t?void 0:t.noScroll)}findPrevious(e,t){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");return this._lastSearchOptions=t,(null==t?void 0:t.decorations)&&(void 0===this._resultIndex&&void 0!==this._cachedSearchTerm&&e===this._cachedSearchTerm||this._highlightAllMatches(e,t)),this._fireResults(e,this._findPreviousAndSelect(e,t),t)}_fireResults(e,t,s){var i;return(null==s?void 0:s.decorations)&&(void 0!==this._resultIndex&&void 0!==(null===(i=this._searchResults)||void 0===i?void 0:i.size)?this._onDidChangeResults.fire({resultIndex:this._resultIndex,resultCount:this._searchResults.size}):this._onDidChangeResults.fire(void 0)),this._cachedSearchTerm=e,t}_findPreviousAndSelect(e,t){var s;if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");let i;if(!this._terminal||!e||0===e.length)return i=void 0,null===(s=this._terminal)||void 0===s||s.clearSelection(),this.clearDecorations(),this._resultIndex=-1,!1;this._cachedSearchTerm!==e&&(this._resultIndex=void 0,this._terminal.clearSelection());let r=this._terminal.buffer.active.baseY+this._terminal.rows,n=this._terminal.cols;const o=!0,l=!!t&&t.incremental;let h;this._terminal.hasSelection()&&(h=this._terminal.getSelectionPosition(),r=h.start.y,n=h.start.x),this._initLinesCache();const a={startRow:r,startCol:n};if(l?(i=this._findInLine(e,a,t,!1),i&&i.row===r&&i.col===n||(h&&(a.startRow=h.end.y,a.startCol=h.end.x),i=this._findInLine(e,a,t,!0))):i=this._findInLine(e,a,t,o),!i){a.startCol=Math.max(a.startCol,this._terminal.cols);for(let s=r-1;s>=0&&(a.startRow=s,i=this._findInLine(e,a,t,o),!i);s--);}if(!i&&r!==this._terminal.buffer.active.baseY+this._terminal.rows)for(let s=this._terminal.buffer.active.baseY+this._terminal.rows;s>=r&&(a.startRow=s,i=this._findInLine(e,a,t,o),!i);s--);return this._searchResults&&(0===this._searchResults.size?this._resultIndex=-1:void 0===this._resultIndex||this._resultIndex<0?this._resultIndex=this._searchResults.size-1:(this._resultIndex--,-1===this._resultIndex&&(this._resultIndex=this._searchResults.size-1))),!(i||!h)||this._selectResult(i,null==t?void 0:t.decorations,null==t?void 0:t.noScroll)}_initLinesCache(){const e=this._terminal;this._linesCache||(this._linesCache=new Array(e.buffer.active.length),this._cursorMoveListener=e.onCursorMove((()=>this._destroyLinesCache())),this._resizeListener=e.onResize((()=>this._destroyLinesCache()))),window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=window.setTimeout((()=>this._destroyLinesCache()),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._cursorMoveListener&&(this._cursorMoveListener.dispose(),this._cursorMoveListener=void 0),this._resizeListener&&(this._resizeListener.dispose(),this._resizeListener=void 0),this._linesCacheTimeoutId&&(window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=0)}_isWholeWord(e,t,s){return(0===e||n.includes(t[e-1]))&&(e+s.length===t.length||n.includes(t[e+s.length]))}_findInLine(e,t,s={},i=!1){var r;const n=this._terminal,o=t.startRow,l=t.startCol,h=n.buffer.active.getLine(o);if(null==h?void 0:h.isWrapped)return i?void(t.startCol+=n.cols):(t.startRow--,t.startCol+=n.cols,this._findInLine(e,t,s));let a=null===(r=this._linesCache)||void 0===r?void 0:r[o];a||(a=this._translateBufferLineToStringWithWrap(o,!0),this._linesCache&&(this._linesCache[o]=a));const[c,d]=a,u=this._bufferColsToStringOffset(o,l),_=s.caseSensitive?e:e.toLowerCase(),f=s.caseSensitive?c:c.toLowerCase();let v=-1;if(s.regex){const t=RegExp(_,"g");let s;if(i)for(;s=t.exec(f.slice(0,u));)v=t.lastIndex-s[0].length,e=s[0],t.lastIndex-=e.length-1;else s=t.exec(f.slice(u)),s&&s[0].length>0&&(v=u+(t.lastIndex-s[0].length),e=s[0])}else i?u-_.length>=0&&(v=f.lastIndexOf(_,u-_.length)):v=f.indexOf(_,u);if(v>=0){if(s.wholeWord&&!this._isWholeWord(v,f,e))return;let t=0;for(;t=d[t+1];)t++;let i=t;for(;i=d[i+1];)i++;const r=v-d[t],l=v+e.length-d[i],h=this._stringLengthToBufferSize(o+t,r);return{term:e,col:h,row:o+t,size:this._stringLengthToBufferSize(o+i,l)-h+n.cols*(i-t)}}}_stringLengthToBufferSize(e,t){const s=this._terminal.buffer.active.getLine(e);if(!s)return 0;for(let e=0;e1&&(t-=r.length-1);const n=s.getCell(e+1);n&&0===n.getWidth()&&t++}return t}_bufferColsToStringOffset(e,t){const s=this._terminal;let i=e,r=0,n=s.buffer.active.getLine(i);for(;t>0&&n;){for(let e=0;ethis._applyStyles(e,t.activeMatchBorder,!0))),null===(r=this._selectedDecoration)||void 0===r||r.onDispose((()=>s.dispose())))}if(!s&&(e.row>=n.buffer.active.viewportY+n.rows||e.rowthis._applyStyles(e,t.matchBorder,!1))),null==n||n.onDispose((()=>r.dispose())),n}}e.SearchAddon=o})(),i})()}));//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/xterm-addon-search/lib/xterm-addon-search.js.map{ "name": "xterm-addon-serialize", "version": "0.9.0-beta.3", "author": { "name": "The xterm.js authors", "url": "https://xtermjs.org/" }, "main": "lib/xterm-addon-serialize.js", "types": "typings/xterm-addon-serialize.d.ts", "repository": "https://github.com/xtermjs/xterm.js", "license": "MIT", "keywords": [ "terminal", "xterm", "xterm.js" ], "scripts": { "build": "../../node_modules/.bin/tsc -p .", "prepackage": "npm run build", "package": "../../node_modules/.bin/webpack", "prepublishOnly": "npm run package", "benchmark": "NODE_PATH=../../out:./out:./out-benchmark/ ../../node_modules/.bin/xterm-benchmark -r 5 -c benchmark/benchmark.json", "benchmark-baseline": "NODE_PATH=../../out:./out:./out-benchmark/ ../../node_modules/.bin/xterm-benchmark -r 5 -c benchmark/benchmark.json --baseline out-benchmark/benchmark/*benchmark.js", "benchmark-eval": "NODE_PATH=../../out:./out:./out-benchmark/ ../../node_modules/.bin/xterm-benchmark -r 5 -c benchmark/benchmark.json --eval out-benchmark/benchmark/*benchmark.js" }, "peerDependencies": { "xterm": "^5.0.0" } }!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.SerializeAddon=e():t.SerializeAddon=e()}(this,(function(){return(()=>{"use strict";var t={};return(()=>{var e=t;function s(t,e,s){return Math.max(e,Math.min(t,s))}Object.defineProperty(e,"__esModule",{value:!0}),e.HTMLSerializeHandler=e.SerializeAddon=void 0;class i{constructor(t){this._buffer=t}serialize(t){const e=this._buffer.getNullCell(),s=this._buffer.getNullCell();let i=e;const r=t.start.x,l=t.end.x,o=t.start.y,n=t.end.y;this._beforeSerialize(l-r,r,l);for(let h=r;h<=l;h++){const r=this._buffer.getLine(h);if(r){const l=h!==t.start.x?0:o,u=h!==t.end.x?r.length:n;for(let t=l;t0&&!l(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`[${this._nullCellCount}X`);let i="";if(!e){t-this._firstRow>=this._terminal.rows&&(null===(s=this._buffer.getLine(this._cursorStyleRow))||void 0===s||s.getCell(this._cursorStyleCol,this._backgroundCell));const e=this._buffer.getLine(t),r=this._buffer.getLine(t+1);if(r.isWrapped){i="";const s=e.getCell(e.length-1,this._thisRowLastChar),o=e.getCell(e.length-2,this._thisRowLastSecondChar),n=r.getCell(0,this._nextRowFirstChar),h=n.getWidth()>1;let u=!1;(n.getChars()&&h?this._nullCellCount<=1:this._nullCellCount<=0)&&((s.getChars()||0===s.getWidth())&&l(s,n)&&(u=!0),h&&(o.getChars()||0===o.getWidth())&&l(s,n)&&l(o,n)&&(u=!0)),u||(i="-".repeat(this._nullCellCount+1),i+="",this._nullCellCount>0&&(i+="",i+=`[${e.length-this._nullCellCount}C`,i+=`[${this._nullCellCount}X`,i+=`[${e.length-this._nullCellCount}D`,i+=""),this._lastContentCursorRow=t+1,this._lastContentCursorCol=0,this._lastCursorRow=t+1,this._lastCursorCol=0)}else i="\r\n",this._lastCursorRow=t+1,this._lastCursorCol=0}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=i,this._currentRow="",this._nullCellCount=0}_diffStyle(t,e){const s=[],i=!r(t,e),n=!l(t,e),h=!o(t,e);if(i||n||h)if(t.isAttributeDefault())e.isAttributeDefault()||s.push(0);else{if(i){const e=t.getFgColor();t.isFgRGB()?s.push(38,2,e>>>16&255,e>>>8&255,255&e):t.isFgPalette()?e>=16?s.push(38,5,e):s.push(8&e?90+(7&e):30+(7&e)):s.push(39)}if(n){const e=t.getBgColor();t.isBgRGB()?s.push(48,2,e>>>16&255,e>>>8&255,255&e):t.isBgPalette()?e>=16?s.push(48,5,e):s.push(8&e?100+(7&e):40+(7&e)):s.push(49)}h&&(t.isInverse()!==e.isInverse()&&s.push(t.isInverse()?7:27),t.isBold()!==e.isBold()&&s.push(t.isBold()?1:22),t.isUnderline()!==e.isUnderline()&&s.push(t.isUnderline()?4:24),t.isBlink()!==e.isBlink()&&s.push(t.isBlink()?5:25),t.isInvisible()!==e.isInvisible()&&s.push(t.isInvisible()?8:28),t.isItalic()!==e.isItalic()&&s.push(t.isItalic()?3:23),t.isDim()!==e.isDim()&&s.push(t.isDim()?2:22),t.isStrikethrough()!==e.isStrikethrough()&&s.push(t.isStrikethrough()?9:29))}return s}_nextCell(t,e,s,i){if(0===t.getWidth())return;const r=""===t.getChars(),o=this._diffStyle(t,this._cursorStyle);if(r?!l(this._cursorStyle,t):o.length>0){this._nullCellCount>0&&(l(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`[${this._nullCellCount}X`),this._currentRow+=`[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=s,this._lastContentCursorCol=this._lastCursorCol=i,this._currentRow+=`[${o.join(";")}m`;const t=this._buffer.getLine(s);void 0!==t&&(t.getCell(i,this._cursorStyle),this._cursorStyleRow=s,this._cursorStyleCol=i)}r?this._nullCellCount+=t.getWidth():(this._nullCellCount>0&&(l(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`[${this._nullCellCount}X`),this._currentRow+=`[${this._nullCellCount}C`,this._nullCellCount=0),this._currentRow+=t.getChars(),this._lastContentCursorRow=this._lastCursorRow=s,this._lastContentCursorCol=this._lastCursorCol=i+t.getWidth())}_serializeString(){let t=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(t=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let e="";for(let s=0;s0?e+=`[${r}B`:r<0&&(e+=`[${-r}A`),(t=>{t>0?e+=`[${t}C`:t<0&&(e+=`[${-t}D`)})(i-this._lastCursorCol));const l=this._terminal._core._inputHandler._curAttrData,o=this._diffStyle(l,this._cursorStyle);return o.length>0&&(e+=`[${o.join(";")}m`),e}}e.SerializeAddon=class{constructor(){}activate(t){this._terminal=t}_serializeBuffer(t,e,i){const r=e.length,l=new n(e,t),o=void 0===i?r:s(i+t.rows,0,r);return l.serialize({start:{x:r-o,y:0},end:{x:r-1,y:t.cols}})}_serializeBufferAsHTML(t,e){var i,r;const l=t.buffer.active,o=new h(l,t,e);if(null===(i=e.onlySelection)||void 0===i||!i){const i=l.length,r=e.scrollback,n=void 0===r?i:s(r+t.rows,0,i);return o.serialize({start:{x:i-n,y:0},end:{x:i-1,y:t.cols}})}const n=null===(r=this._terminal)||void 0===r?void 0:r.getSelectionPosition();return void 0!==n?o.serialize({start:{x:n.start.y,y:n.start.x},end:{x:n.end.y,y:n.end.x}}):""}_serializeModes(t){let e="";const s=t.modes;if(s.applicationCursorKeysMode&&(e+="[?1h"),s.applicationKeypadMode&&(e+="[?66h"),s.bracketedPasteMode&&(e+="[?2004h"),s.insertMode&&(e+=""),s.originMode&&(e+="[?6h"),s.reverseWraparoundMode&&(e+="[?45h"),s.sendFocusMode&&(e+="[?1004h"),!1===s.wraparoundMode&&(e+="[?7l"),"none"!==s.mouseTrackingMode)switch(s.mouseTrackingMode){case"x10":e+="[?9h";break;case"vt200":e+="[?1000h";break;case"drag":e+="[?1002h";break;case"any":e+="[?1003h"}return e}serialize(t){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");let e=this._serializeBuffer(this._terminal,this._terminal.buffer.normal,null==t?void 0:t.scrollback);return(null==t?void 0:t.excludeAltBuffer)||"alternate"!==this._terminal.buffer.active.type||(e+=`[?1049h${this._serializeBuffer(this._terminal,this._terminal.buffer.alternate,void 0)}`),(null==t?void 0:t.excludeModes)||(e+=this._serializeModes(this._terminal)),e}serializeAsHTML(t){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");return this._serializeBufferAsHTML(this._terminal,t||{})}dispose(){}};class h extends i{constructor(t,e,s){super(t),this._terminal=e,this._options=s,this._currentRow="",this._htmlContent="",this._colors=e._core._themeService.colors}_padStart(t,e,s){return e>>=0,s=null!=s?s:" ",t.length>e?t:((e-=t.length)>s.length&&(s+=s.repeat(e/s.length)),s.slice(0,e)+t)}_beforeSerialize(t,e,s){var i,r,l,o,n;this._htmlContent+="\x3c!--StartFragment--\x3e

";let h="#000000",u="#ffffff";null!==(i=this._options.includeGlobalBackground)&&void 0!==i&&i&&(h=null!==(l=null===(r=this._terminal.options.theme)||void 0===r?void 0:r.foreground)&&void 0!==l?l:"#ffffff",u=null!==(n=null===(o=this._terminal.options.theme)||void 0===o?void 0:o.background)&&void 0!==n?n:"#000000");const a=[];a.push("color: "+h+";"),a.push("background-color: "+u+";"),a.push("font-family: "+this._terminal.options.fontFamily+";"),a.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="
"}_afterSerialize(){this._htmlContent+="
",this._htmlContent+="
\x3c!--EndFragment--\x3e"}_rowEnd(t,e){this._htmlContent+="
"+this._currentRow+"
",this._currentRow=""}_getHexColor(t,e){const s=e?t.getFgColor():t.getBgColor();return(e?t.isFgRGB():t.isBgRGB())?[s>>16&255,s>>8&255,255&s].map((t=>this._padStart(t.toString(16),2,"0"))).join(""):(e?t.isFgPalette():t.isBgPalette())?this._colors.ansi[s].css:void 0}_diffStyle(t,e){const s=[],i=!r(t,e),n=!l(t,e),h=!o(t,e);if(i||n||h){const e=this._getHexColor(t,!0);e&&s.push("color: "+e+";");const i=this._getHexColor(t,!1);return i&&s.push("background-color: "+i+";"),t.isInverse()&&s.push("color: #000000; background-color: #BFBFBF;"),t.isBold()&&s.push("font-weight: bold;"),t.isUnderline()&&s.push("text-decoration: underline;"),t.isBlink()&&s.push("text-decoration: blink;"),t.isInvisible()&&s.push("visibility: hidden;"),t.isItalic()&&s.push("font-style: italic;"),t.isDim()&&s.push("opacity: 0.5;"),t.isStrikethrough()&&s.push("text-decoration: line-through;"),s}}_nextCell(t,e,s,i){if(0===t.getWidth())return;const r=""===t.getChars(),l=this._diffStyle(t,e);l&&(this._currentRow+=0===l.length?"":""),this._currentRow+=r?" ":t.getChars()}_serializeString(){return this._htmlContent}}e.HTMLSerializeHandler=h})(),t})()}));//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/xterm-addon-serialize/lib/xterm-addon-serialize.js.mapCopyright (c) 2019, The xterm.js authors (https://github.com/xtermjs/xterm.js) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "xterm-addon-unicode11", "version": "0.5.0-beta.1", "author": { "name": "The xterm.js authors", "url": "https://xtermjs.org/" }, "main": "lib/xterm-addon-unicode11.js", "types": "typings/xterm-addon-unicode11.d.ts", "repository": "https://github.com/xtermjs/xterm.js", "license": "MIT", "keywords": [ "terminal", "xterm", "xterm.js" ], "scripts": { "build": "../../node_modules/.bin/tsc -p .", "prepackage": "npm run build", "package": "../../node_modules/.bin/webpack", "prepublishOnly": "npm run package" }, "peerDependencies": { "xterm": "^5.0.0" } }!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Unicode11Addon=t():e.Unicode11Addon=t()}(this,(function(){return(()=>{"use strict";var e={433:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeV11=void 0;const o=n(455),r=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],l=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],i=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],c=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let f;function d(e,t){let n,o=0,r=t.length-1;if(et[r][1])return!1;for(;r>=o;)if(n=o+r>>1,e>t[n][1])o=n+1;else{if(!(e{function n(e,t,n=0,o=e.length){if(n>=e.length)return e;n=(e.length+n)%e.length,o=o>=e.length?e.length:(e.length+o)%e.length;for(let r=n;r{var e=o;Object.defineProperty(e,"__esModule",{value:!0}),e.Unicode11Addon=void 0;const t=n(433);e.Unicode11Addon=class{activate(e){e.unicode.register(new t.UnicodeV11)}dispose(){}}})(),o})()}));//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/xterm-addon-unicode11/lib/xterm-addon-unicode11.js.mapCopyright (c) 2018, The xterm.js authors (https://github.com/xtermjs/xterm.js) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "xterm-addon-webgl", "version": "0.14.0-beta.32", "author": { "name": "The xterm.js authors", "url": "https://xtermjs.org/" }, "main": "lib/xterm-addon-webgl.js", "types": "typings/xterm-addon-webgl.d.ts", "repository": "https://github.com/xtermjs/xterm.js", "license": "MIT", "keywords": [ "terminal", "webgl", "xterm", "xterm.js" ], "scripts": { "build": "../../node_modules/.bin/tsc -p .", "prepackage": "npm run build", "package": "../../node_modules/.bin/webpack", "prepublishOnly": "npm run package" }, "peerDependencies": { "xterm": "^5.0.0" } }!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.WebglAddon=t():e.WebglAddon=t()}(self,(function(){return(()=>{"use strict";var e={965:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GlyphRenderer=void 0;const s=i(381),r=i(455),o=i(855),n=i(859),a=i(374),h=10,l=h*Float32Array.BYTES_PER_ELEMENT;let c,d=0,_=0,u=0;class g extends n.Disposable{constructor(e,t,i){super(),this._terminal=e,this._gl=t,this._dimensions=i,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const r=this._gl;this._program=(0,a.throwIfFalsy)((0,s.createProgram)(r,"#version 300 es\nlayout (location = 0) in vec2 a_unitquad;\nlayout (location = 1) in vec2 a_cellpos;\nlayout (location = 2) in vec2 a_offset;\nlayout (location = 3) in vec2 a_size;\nlayout (location = 4) in vec2 a_texcoord;\nlayout (location = 5) in vec2 a_texsize;\n\nuniform mat4 u_projection;\nuniform vec2 u_resolution;\n\nout vec2 v_texcoord;\n\nvoid main() {\n vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);\n gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);\n v_texcoord = a_texcoord + a_unitquad * a_texsize;\n}","#version 300 es\nprecision lowp float;\n\nin vec2 v_texcoord;\n\nuniform sampler2D u_texture;\n\nout vec4 outColor;\n\nvoid main() {\n outColor = texture(u_texture, v_texcoord);\n}")),this.register((0,n.toDisposable)((()=>r.deleteProgram(this._program)))),this._projectionLocation=(0,a.throwIfFalsy)(r.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,a.throwIfFalsy)(r.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,a.throwIfFalsy)(r.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=r.createVertexArray(),r.bindVertexArray(this._vertexArrayObject);const o=new Float32Array([0,0,1,0,0,1,1,1]),h=r.createBuffer();this.register((0,n.toDisposable)((()=>r.deleteBuffer(h)))),r.bindBuffer(r.ARRAY_BUFFER,h),r.bufferData(r.ARRAY_BUFFER,o,r.STATIC_DRAW),r.enableVertexAttribArray(0),r.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const c=new Uint8Array([0,1,2,3]),d=r.createBuffer();this.register((0,n.toDisposable)((()=>r.deleteBuffer(d)))),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,d),r.bufferData(r.ELEMENT_ARRAY_BUFFER,c,r.STATIC_DRAW),this._attributesBuffer=(0,a.throwIfFalsy)(r.createBuffer()),this.register((0,n.toDisposable)((()=>r.deleteBuffer(this._attributesBuffer)))),r.bindBuffer(r.ARRAY_BUFFER,this._attributesBuffer),r.enableVertexAttribArray(2),r.vertexAttribPointer(2,2,r.FLOAT,!1,l,0),r.vertexAttribDivisor(2,1),r.enableVertexAttribArray(3),r.vertexAttribPointer(3,2,r.FLOAT,!1,l,2*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(3,1),r.enableVertexAttribArray(4),r.vertexAttribPointer(4,2,r.FLOAT,!1,l,4*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(4,1),r.enableVertexAttribArray(5),r.vertexAttribPointer(5,2,r.FLOAT,!1,l,6*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(5,1),r.enableVertexAttribArray(1),r.vertexAttribPointer(1,2,r.FLOAT,!1,l,8*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(1,1),this._atlasTexture=(0,a.throwIfFalsy)(r.createTexture()),this.register((0,n.toDisposable)((()=>r.deleteTexture(this._atlasTexture)))),r.bindTexture(r.TEXTURE_2D,this._atlasTexture),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,new Uint8Array([0,0,255,255])),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.enable(r.BLEND),r.blendFunc(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(e,t,i,s,r,o,n,a){this._updateCell(this._vertices.attributes,e,t,i,s,r,o,n,a)}_updateCell(e,t,i,s,n,a,l,g,f){d=(i*this._terminal.cols+t)*h,s!==o.NULL_CELL_CODE&&void 0!==s?this._atlas&&(c=g&&g.length>1?this._atlas.getRasterizedGlyphCombinedChar(g,n,a,l):this._atlas.getRasterizedGlyph(s,n,a,l),_=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),n!==f&&c.offset.x>_?(u=c.offset.x-_,e[d]=-(c.offset.x-u)+this._dimensions.device.char.left,e[d+1]=-c.offset.y+this._dimensions.device.char.top,e[d+2]=(c.size.x-u)/this._dimensions.device.canvas.width,e[d+3]=c.size.y/this._dimensions.device.canvas.height,e[d+4]=c.texturePositionClipSpace.x+u/this._atlas.cacheCanvas.width,e[d+5]=c.texturePositionClipSpace.y,e[d+6]=c.sizeClipSpace.x-u/this._atlas.cacheCanvas.width,e[d+7]=c.sizeClipSpace.y):(e[d]=-c.offset.x+this._dimensions.device.char.left,e[d+1]=-c.offset.y+this._dimensions.device.char.top,e[d+2]=c.size.x/this._dimensions.device.canvas.width,e[d+3]=c.size.y/this._dimensions.device.canvas.height,e[d+4]=c.texturePositionClipSpace.x,e[d+5]=c.texturePositionClipSpace.y,e[d+6]=c.sizeClipSpace.x,e[d+7]=c.sizeClipSpace.y)):(0,r.fill)(e,0,d,d+h-1-2)}clear(){const e=this._terminal,t=e.cols*e.rows*h;this._vertices.count!==t?this._vertices.attributes=new Float32Array(t):this._vertices.attributes.fill(0);for(let e=0;e{Object.defineProperty(t,"__esModule",{value:!0}),t.RectangleRenderer=void 0;const s=i(381),r=i(310),o=i(859),n=i(237),a=i(374),h=8*Float32Array.BYTES_PER_ELEMENT;let l=0,c=!1,d=0,_=0,u=0,g=0,f=0,v=0;class C extends o.Disposable{constructor(e,t,i,r){super(),this._terminal=e,this._gl=t,this._dimensions=i,this._themeService=r,this._vertices={count:0,attributes:new Float32Array(160)};const n=this._gl;this._program=(0,a.throwIfFalsy)((0,s.createProgram)(n,"#version 300 es\nlayout (location = 0) in vec2 a_position;\nlayout (location = 1) in vec2 a_size;\nlayout (location = 2) in vec4 a_color;\nlayout (location = 3) in vec2 a_unitquad;\n\nuniform mat4 u_projection;\n\nout vec4 v_color;\n\nvoid main() {\n vec2 zeroToOne = a_position + (a_unitquad * a_size);\n gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);\n v_color = a_color;\n}","#version 300 es\nprecision lowp float;\n\nin vec4 v_color;\n\nout vec4 outColor;\n\nvoid main() {\n outColor = v_color;\n}")),this.register((0,o.toDisposable)((()=>n.deleteProgram(this._program)))),this._projectionLocation=(0,a.throwIfFalsy)(n.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=n.createVertexArray(),n.bindVertexArray(this._vertexArrayObject);const l=new Float32Array([0,0,1,0,0,1,1,1]),c=n.createBuffer();this.register((0,o.toDisposable)((()=>n.deleteBuffer(c)))),n.bindBuffer(n.ARRAY_BUFFER,c),n.bufferData(n.ARRAY_BUFFER,l,n.STATIC_DRAW),n.enableVertexAttribArray(3),n.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const d=new Uint8Array([0,1,2,3]),_=n.createBuffer();this.register((0,o.toDisposable)((()=>n.deleteBuffer(_)))),n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,_),n.bufferData(n.ELEMENT_ARRAY_BUFFER,d,n.STATIC_DRAW),this._attributesBuffer=(0,a.throwIfFalsy)(n.createBuffer()),this.register((0,o.toDisposable)((()=>n.deleteBuffer(this._attributesBuffer)))),n.bindBuffer(n.ARRAY_BUFFER,this._attributesBuffer),n.enableVertexAttribArray(0),n.vertexAttribPointer(0,2,n.FLOAT,!1,h,0),n.vertexAttribDivisor(0,1),n.enableVertexAttribArray(1),n.vertexAttribPointer(1,2,n.FLOAT,!1,h,2*Float32Array.BYTES_PER_ELEMENT),n.vertexAttribDivisor(1,1),n.enableVertexAttribArray(2),n.vertexAttribPointer(2,4,n.FLOAT,!1,h,4*Float32Array.BYTES_PER_ELEMENT),n.vertexAttribDivisor(2,1),this._updateCachedColors(r.colors),this.register(this._themeService.onChangeColors((e=>{this._updateCachedColors(e),this._updateViewportRectangle()})))}render(){const e=this._gl;e.useProgram(this._program),e.bindVertexArray(this._vertexArrayObject),e.uniformMatrix4fv(this._projectionLocation,!1,s.PROJECTION_MATRIX),e.bindBuffer(e.ARRAY_BUFFER,this._attributesBuffer),e.bufferData(e.ARRAY_BUFFER,this._vertices.attributes,e.DYNAMIC_DRAW),e.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,e.UNSIGNED_BYTE,0,this._vertices.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(e){const t=this._terminal,i=this._vertices;let s,o,n,a,h,l,c,d,_,u,g,f=1;for(s=0;s>24&255)/255,g=(l>>16&255)/255,f=(l>>8&255)/255,v=!c&&134217728&r?n.DIM_OPACITY:1,this._addRectangle(e.attributes,t,d,_,(a-o)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,u,g,f,v)}_addRectangle(e,t,i,s,r,o,n,a,h,l){e[t]=i/this._dimensions.device.canvas.width,e[t+1]=s/this._dimensions.device.canvas.height,e[t+2]=r/this._dimensions.device.canvas.width,e[t+3]=o/this._dimensions.device.canvas.height,e[t+4]=n,e[t+5]=a,e[t+6]=h,e[t+7]=l}_addRectangleFloat(e,t,i,s,r,o,n){e[t]=i/this._dimensions.device.canvas.width,e[t+1]=s/this._dimensions.device.canvas.height,e[t+2]=r/this._dimensions.device.canvas.width,e[t+3]=o/this._dimensions.device.canvas.height,e[t+4]=n[0],e[t+5]=n[1],e[t+6]=n[2],e[t+7]=n[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(255&e.rgba)/255])}}t.RectangleRenderer=C},310:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RenderModel=t.COMBINED_CHAR_BIT_MASK=t.RENDER_MODEL_EXT_OFFSET=t.RENDER_MODEL_FG_OFFSET=t.RENDER_MODEL_BG_OFFSET=t.RENDER_MODEL_INDICIES_PER_CELL=void 0;const s=i(455),r=i(296);t.RENDER_MODEL_INDICIES_PER_CELL=4,t.RENDER_MODEL_BG_OFFSET=1,t.RENDER_MODEL_FG_OFFSET=2,t.RENDER_MODEL_EXT_OFFSET=3,t.COMBINED_CHAR_BIT_MASK=2147483648,t.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,r.createSelectionRenderModel)()}resize(e,i){const s=e*i*t.RENDER_MODEL_INDICIES_PER_CELL;s!==this.cells.length&&(this.cells=new Uint32Array(s),this.lineLengths=new Uint32Array(i))}clear(){(0,s.fill)(this.cells,0,0),(0,s.fill)(this.lineLengths,0,0)}}},666:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.JoinedCellData=t.WebglRenderer=void 0;const s=i(820),r=i(274),o=i(627),n=i(56),a=i(374),h=i(147),l=i(782),c=i(855),d=i(345),_=i(859),u=i(965),g=i(742),f=i(461),v=i(733),C=i(310);class m extends _.Disposable{constructor(e,t,i,h,c,u,g,m,p){super(),this._terminal=e,this._characterJoinerService=t,this._charSizeService=i,this._coreBrowserService=h,this._decorationService=u,this._themeService=m,this._model=new C.RenderModel,this._workCell=new l.CellData,this._onChangeTextureAtlas=this.register(new d.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onRequestRedraw=this.register(new d.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new d.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors((()=>this._handleColorChange()))),this._cellColorResolver=new r.CellColorResolver(this._terminal,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new v.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier2,this._coreBrowserService,this._themeService),new f.CursorRenderLayer(e,this._core.screenElement,3,this._onRequestRedraw,this._coreBrowserService,c,this._themeService,g)],this.dimensions=(0,a.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this.register(g.onOptionChange((()=>this._handleOptionsChanged()))),this._canvas=document.createElement("canvas");const L={antialias:!1,depth:!1,preserveDrawingBuffer:p};if(this._gl=this._canvas.getContext("webgl2",L),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,s.addDisposableDomListener)(this._canvas,"webglcontextlost",(e=>{console.log("webglcontextlost event received"),e.preventDefault(),this._contextRestorationTimeout=setTimeout((()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(e)}),3e3)}))),this.register((0,s.addDisposableDomListener)(this._canvas,"webglcontextrestored",(e=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,o.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()}))),this.register((0,n.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,((e,t)=>this._setCanvasDevicePixelDimensions(e,t)))),this._core.screenElement.appendChild(this._canvas),this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,_.toDisposable)((()=>{var e;for(const e of this._renderLayers)e.dispose();null===(e=this._canvas.parentElement)||void 0===e||e.removeChild(this._canvas),(0,o.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){var e;return null===(e=this._charAtlas)||void 0===e?void 0:e.cacheCanvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,t){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const e of this._renderLayers)e.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.setDimensions(this.dimensions),this._rectangleRenderer.handleResize(),this._glyphRenderer.setDimensions(this.dimensions),this._glyphRenderer.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(const e of this._renderLayers)e.handleBlur(this._terminal);this._requestRedrawViewport()}handleFocus(){for(const e of this._renderLayers)e.handleFocus(this._terminal);this._requestRedrawViewport()}handleSelectionChanged(e,t,i){for(const s of this._renderLayers)s.handleSelectionChanged(this._terminal,e,t,i);this._model.selection.update(this._terminal,e,t,i),this._requestRedrawViewport()}handleCursorMove(){for(const e of this._renderLayers)e.handleCursorMove(this._terminal)}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas()}_initializeWebGLState(){var e,t;null===(e=this._rectangleRenderer)||void 0===e||e.dispose(),null===(t=this._glyphRenderer)||void 0===t||t.dispose(),this._rectangleRenderer=this.register(new g.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService)),this._glyphRenderer=this.register(new u.GlyphRenderer(this._terminal,this._gl,this.dimensions)),this.handleCharSizeChanged()}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const e=(0,o.acquireTextureAtlas)(this._terminal,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==e&&this._onChangeTextureAtlas.fire(e.cacheCanvas),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.clear()}clearTextureAtlas(){var e;null===(e=this._charAtlas)||void 0===e||e.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(const e of this._renderLayers)e.reset(this._terminal)}registerCharacterJoiner(e){return-1}deregisterCharacterJoiner(e){return!1}renderRows(e,t){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const i of this._renderLayers)i.handleGridChanged(this._terminal,e,t);this._glyphRenderer.beginFrame()&&(this._clearModel(!0),this._model.selection.clear()),this._updateModel(e,t),this._rectangleRenderer.render(),this._glyphRenderer.render(this._model)}_updateModel(e,t){const i=this._core;let s,r,o,n,a,h,l,d,_,u,g,f,v,m=this._workCell;for(r=e;r<=t;r++)for(o=r+i.buffer.ydisp,n=i.buffer.lines.get(o),this._model.lineLengths[r]=0,a=this._characterJoinerService.getJoinedCharacters(o),f=0;f0&&f===a[0][0]&&(h=!0,d=a.shift(),m=new p(m,n.translateToString(!0,d[0],d[1]),d[1]-d[0]),l=d[1]-1),_=m.getChars(),u=m.getCode(),g=(r*i.cols+f)*C.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(m,f,o),u!==c.NULL_CELL_CODE&&(this._model.lineLengths[r]=f+1),(this._model.cells[g]!==u||this._model.cells[g+C.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[g+C.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[g+C.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(_.length>1&&(u|=C.COMBINED_CHAR_BIT_MASK),this._model.cells[g]=u,this._model.cells[g+C.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[g+C.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[g+C.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,this._glyphRenderer.updateCell(f,r,u,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,_,s),h))for(m=this._workCell,f++;f{Object.defineProperty(t,"__esModule",{value:!0}),t.expandFloat32Array=t.createShader=t.createProgram=t.PROJECTION_MATRIX=void 0;const s=i(374);function r(e,t,i){const r=(0,s.throwIfFalsy)(e.createShader(t));if(e.shaderSource(r,i),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS))return r;console.error(e.getShaderInfoLog(r)),e.deleteShader(r)}t.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),t.createProgram=function(e,t,i){const o=(0,s.throwIfFalsy)(e.createProgram());if(e.attachShader(o,(0,s.throwIfFalsy)(r(e,e.VERTEX_SHADER,t))),e.attachShader(o,(0,s.throwIfFalsy)(r(e,e.FRAGMENT_SHADER,i))),e.linkProgram(o),e.getProgramParameter(o,e.LINK_STATUS))return o;console.error(e.getProgramInfoLog(o)),e.deleteProgram(o)},t.createShader=r,t.expandFloat32Array=function(e,t){const i=Math.min(2*e.length,t),s=new Float32Array(i);for(let t=0;t{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseRenderLayer=void 0;const s=i(627),r=i(237),o=i(374),n=i(859);class a extends n.Disposable{constructor(e,t,i,s,r,o,a){super(),this._container=t,this._alpha=r,this._coreBrowserService=o,this._themeService=a,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add(`xterm-${i}-layer`),this._canvas.style.zIndex=s.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors((t=>{this._refreshCharAtlas(e,t),this.reset(e)}))),this.register((0,n.toDisposable)((()=>{var e;this._canvas.remove(),null===(e=this._charAtlas)||void 0===e||e.dispose()})))}_initCanvas(){this._ctx=(0,o.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,t,i){}handleSelectionChanged(e,t,i,s=!1){}_setTransparency(e,t){if(t===this._alpha)return;const i=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,i),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,t){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,s.acquireTextureAtlas)(e,t,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(e,t){this._deviceCellWidth=t.device.cell.width,this._deviceCellHeight=t.device.cell.height,this._deviceCharWidth=t.device.char.width,this._deviceCharHeight=t.device.char.height,this._deviceCharLeft=t.device.char.left,this._deviceCharTop=t.device.char.top,this._canvas.width=t.device.canvas.width,this._canvas.height=t.device.canvas.height,this._canvas.style.width=`${t.css.canvas.width}px`,this._canvas.style.height=`${t.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillCells(e,t,i,s){this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight)}_fillBottomLineAtCells(e,t,i=1){this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,i*this._deviceCellWidth,this._coreBrowserService.dpr)}_fillLeftLineAtCell(e,t,i){this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,this._coreBrowserService.dpr*i,this._deviceCellHeight)}_strokeRectAtCell(e,t,i,s){this._ctx.lineWidth=this._coreBrowserService.dpr,this._ctx.strokeRect(e*this._deviceCellWidth+this._coreBrowserService.dpr/2,t*this._deviceCellHeight+this._coreBrowserService.dpr/2,i*this._deviceCellWidth-this._coreBrowserService.dpr,s*this._deviceCellHeight-this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(e,t,i,s){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight))}_fillCharTrueColor(e,t,i,s){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=r.TEXT_BASELINE,this._clipCell(i,s,t.getWidth()),this._ctx.fillText(t.getChars(),i*this._deviceCellWidth+this._deviceCharLeft,s*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,t,i){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,t,i){return`${i?"italic":""} ${t?e.options.fontWeightBold:e.options.fontWeight} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}}t.BaseRenderLayer=a},461:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CursorRenderLayer=void 0;const s=i(592),r=i(782),o=i(859);class n extends s.BaseRenderLayer{constructor(e,t,i,s,n,a,h,l){super(e,t,"cursor",i,!0,n,h),this._onRequestRefreshRowsEvent=s,this._coreService=a,this._cell=new r.CellData,this._state={x:0,y:0,isFocused:!1,style:"",width:0},this._cursorRenderers={bar:this._renderBarCursor.bind(this),block:this._renderBlockCursor.bind(this),underline:this._renderUnderlineCursor.bind(this)},this._handleOptionsChanged(e),this.register(l.onOptionChange((()=>this._handleOptionsChanged(e)))),this.register((0,o.toDisposable)((()=>{var e;null===(e=this._cursorBlinkStateManager)||void 0===e||e.dispose(),this._cursorBlinkStateManager=void 0})))}resize(e,t){super.resize(e,t),this._state={x:0,y:0,isFocused:!1,style:"",width:0}}reset(e){var t;this._clearCursor(),null===(t=this._cursorBlinkStateManager)||void 0===t||t.restartBlinkAnimation(e),this._handleOptionsChanged(e)}handleBlur(e){var t;null===(t=this._cursorBlinkStateManager)||void 0===t||t.pause(),this._onRequestRefreshRowsEvent.fire({start:e.buffer.active.cursorY,end:e.buffer.active.cursorY})}handleFocus(e){var t;null===(t=this._cursorBlinkStateManager)||void 0===t||t.resume(e),this._onRequestRefreshRowsEvent.fire({start:e.buffer.active.cursorY,end:e.buffer.active.cursorY})}_handleOptionsChanged(e){var t;e.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new a((()=>{this._render(e,!0)}),this._coreBrowserService)):(null===(t=this._cursorBlinkStateManager)||void 0===t||t.dispose(),this._cursorBlinkStateManager=void 0),this._onRequestRefreshRowsEvent.fire({start:e.buffer.active.cursorY,end:e.buffer.active.cursorY})}handleCursorMove(e){var t;null===(t=this._cursorBlinkStateManager)||void 0===t||t.restartBlinkAnimation(e)}handleGridChanged(e,t,i){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(e,!1):this._cursorBlinkStateManager.restartBlinkAnimation(e)}_render(e,t){if(!this._coreService.isCursorInitialized||this._coreService.isCursorHidden)return void this._clearCursor();const i=e.buffer.active.baseY+e.buffer.active.cursorY,s=i-e.buffer.active.viewportY,r=Math.min(e.buffer.active.cursorX,e.cols-1);if(s<0||s>=e.rows)this._clearCursor();else if(e._core.buffer.lines.get(i).loadCell(r,this._cell),void 0!==this._cell.content){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css;const t=e.options.cursorStyle;return t&&"block"!==t?this._cursorRenderers[t](e,r,s,this._cell):this._renderBlurCursor(e,r,s,this._cell),this._ctx.restore(),this._state.x=r,this._state.y=s,this._state.isFocused=!1,this._state.style=t,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===r&&this._state.y===s&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===e.options.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[e.options.cursorStyle||"block"](e,r,s,this._cell),this._ctx.restore(),this._state.x=r,this._state.y=s,this._state.isFocused=!1,this._state.style=e.options.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}_clearCursor(){this._state&&(this._coreBrowserService.dpr<1?this._clearAll():this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})}_renderBarCursor(e,t,i,s){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillLeftLineAtCell(t,i,e.options.cursorWidth),this._ctx.restore()}_renderBlockCursor(e,t,i,s){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillCells(t,i,s.getWidth(),1),this._ctx.fillStyle=this._themeService.colors.cursorAccent.css,this._fillCharTrueColor(e,s,t,i),this._ctx.restore()}_renderUnderlineCursor(e,t,i,s){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillBottomLineAtCells(t,i),this._ctx.restore()}_renderBlurCursor(e,t,i,s){this._ctx.save(),this._ctx.strokeStyle=this._themeService.colors.cursor.css,this._strokeRectAtCell(t,i,s.getWidth(),1),this._ctx.restore()}}t.CursorRenderLayer=n;class a{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(e){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))))}_restartInterval(e=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const e=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,e>0)return void this._restartInterval(e)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const e=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(e)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),e)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(e){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation(e)}}},733:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkRenderLayer=void 0;const s=i(197),r=i(237),o=i(592);class n extends o.BaseRenderLayer{constructor(e,t,i,s,r,o){super(i,e,"link",t,!0,r,o),this.register(s.onShowLinkUnderline((e=>this._handleShowLinkUnderline(e)))),this.register(s.onHideLinkUnderline((e=>this._handleHideLinkUnderline(e))))}resize(e,t){super.resize(e,t),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){if(e.fg===r.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:void 0!==e.fg&&(0,s.is256Color)(e.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let t=e.y1+1;t{Object.defineProperty(t,"__esModule",{value:!0}),t.addDisposableDomListener=void 0,t.addDisposableDomListener=function(e,t,i,s){e.addEventListener(t,i,s);let r=!1;return{dispose:()=>{r||(r=!0,e.removeEventListener(t,i,s))}}}},274:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellColorResolver=void 0;let i,s=0,r=0,o=!1,n=!1,a=!1;t.CellColorResolver=class{constructor(e,t,i,s,r){this._terminal=e,this._selectionRenderModel=t,this._decorationService=i,this._coreBrowserService=s,this._themeService=r,this.result={fg:0,bg:0,ext:0}}resolve(e,t,h){this.result.bg=e.bg,this.result.fg=e.fg,this.result.ext=268435456&e.bg?e.extended.ext:0,r=0,s=0,n=!1,o=!1,a=!1,i=this._themeService.colors,this._decorationService.forEachDecorationAtCell(t,h,"bottom",(e=>{e.backgroundColorRGB&&(r=e.backgroundColorRGB.rgba>>8&16777215,n=!0),e.foregroundColorRGB&&(s=e.foregroundColorRGB.rgba>>8&16777215,o=!0)})),a=this._selectionRenderModel.isCellSelected(this._terminal,t,h),a&&(r=(this._coreBrowserService.isFocused?i.selectionBackgroundOpaque:i.selectionInactiveBackgroundOpaque).rgba>>8&16777215,n=!0,i.selectionForeground&&(s=i.selectionForeground.rgba>>8&16777215,o=!0)),this._decorationService.forEachDecorationAtCell(t,h,"top",(e=>{e.backgroundColorRGB&&(r=e.backgroundColorRGB.rgba>>8&16777215,n=!0),e.foregroundColorRGB&&(s=e.foregroundColorRGB.rgba>>8&16777215,o=!0)})),n&&(r=a?-16777216&e.bg&-134217729|r|50331648:-16777216&e.bg|r|50331648),o&&(s=-16777216&e.fg&-67108865|s|50331648),67108864&this.result.fg&&(n&&!o&&(s=0==(50331648&this.result.bg)?-134217728&this.result.fg|16777215&i.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,o=!0),!n&&o&&(r=0==(50331648&this.result.fg)?-67108864&this.result.bg|16777215&i.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,n=!0)),i=void 0,this.result.bg=n?r:this.result.bg,this.result.fg=o?s:this.result.fg}}},627:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.removeTerminalFromCache=t.acquireTextureAtlas=void 0;const s=i(509),r=i(197),o=[];t.acquireTextureAtlas=function(e,t,i,n,a,h,l){const c=(0,r.generateConfig)(i,n,a,h,e,t,l);for(let t=0;t=0){if((0,r.configEquals)(i.config,c))return i.atlas;1===i.ownedBy.length?(i.atlas.dispose(),o.splice(t,1)):i.ownedBy.splice(s,1);break}}for(let t=0;t{Object.defineProperty(t,"__esModule",{value:!0}),t.is256Color=t.configEquals=t.generateConfig=void 0;const s=i(160);t.generateConfig=function(e,t,i,r,o,n,a){const h={foreground:n.foreground,background:n.background,cursor:s.NULL_COLOR,cursorAccent:s.NULL_COLOR,selectionForeground:s.NULL_COLOR,selectionBackgroundTransparent:s.NULL_COLOR,selectionBackgroundOpaque:s.NULL_COLOR,selectionInactiveBackgroundTransparent:s.NULL_COLOR,selectionInactiveBackgroundOpaque:s.NULL_COLOR,ansi:n.ansi.slice(),contrastCache:n.contrastCache};return{customGlyphs:o.options.customGlyphs,devicePixelRatio:a,letterSpacing:o.options.letterSpacing,lineHeight:o.options.lineHeight,deviceCellWidth:e,deviceCellHeight:t,deviceCharWidth:i,deviceCharHeight:r,fontFamily:o.options.fontFamily,fontSize:o.options.fontSize,fontWeight:o.options.fontWeight,fontWeightBold:o.options.fontWeightBold,allowTransparency:o.options.allowTransparency,drawBoldTextInBrightColors:o.options.drawBoldTextInBrightColors,minimumContrastRatio:o.options.minimumContrastRatio,colors:h}},t.configEquals=function(e,t){for(let i=0;i{Object.defineProperty(t,"__esModule",{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;const s=i(399);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=s.isFirefox||s.isLegacyEdge?"bottom":"ideographic"},860:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tryDrawCustomChar=t.powerlineDefinitions=t.boxDrawingDefinitions=t.blockElementDefinitions=void 0;const s=i(374);t.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const r={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};t.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"║":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╒":{1:(e,t)=>`M.5,1 L.5,${.5-t} L1,${.5-t} M.5,${.5+t} L1,${.5+t}`},"╓":{1:(e,t)=>`M${.5-e},1 L${.5-e},.5 L1,.5 M${.5+e},.5 L${.5+e},1`},"╔":{1:(e,t)=>`M1,${.5-t} L${.5-e},${.5-t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1`},"╕":{1:(e,t)=>`M0,${.5-t} L.5,${.5-t} L.5,1 M0,${.5+t} L.5,${.5+t}`},"╖":{1:(e,t)=>`M${.5+e},1 L${.5+e},.5 L0,.5 M${.5-e},.5 L${.5-e},1`},"╗":{1:(e,t)=>`M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M0,${.5-t} L${.5+e},${.5-t} L${.5+e},1`},"╘":{1:(e,t)=>`M.5,0 L.5,${.5+t} L1,${.5+t} M.5,${.5-t} L1,${.5-t}`},"╙":{1:(e,t)=>`M1,.5 L${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╚":{1:(e,t)=>`M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0 M1,${.5+t} L${.5-e},${.5+t} L${.5-e},0`},"╛":{1:(e,t)=>`M0,${.5+t} L.5,${.5+t} L.5,0 M0,${.5-t} L.5,${.5-t}`},"╜":{1:(e,t)=>`M0,.5 L${.5+e},.5 L${.5+e},0 M${.5-e},.5 L${.5-e},0`},"╝":{1:(e,t)=>`M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M0,${.5+t} L${.5+e},${.5+t} L${.5+e},0`},"╞":{1:(e,t)=>`M.5,0 L.5,1 M.5,${.5-t} L1,${.5-t} M.5,${.5+t} L1,${.5+t}`},"╟":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1 M${.5+e},.5 L1,.5`},"╠":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╡":{1:(e,t)=>`M.5,0 L.5,1 M0,${.5-t} L.5,${.5-t} M0,${.5+t} L.5,${.5+t}`},"╢":{1:(e,t)=>`M0,.5 L${.5-e},.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╣":{1:(e,t)=>`M${.5+e},0 L${.5+e},1 M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0`},"╤":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t} M.5,${.5+t} L.5,1`},"╥":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},1 M${.5+e},.5 L${.5+e},1`},"╦":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1`},"╧":{1:(e,t)=>`M.5,0 L.5,${.5-t} M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"╨":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╩":{1:(e,t)=>`M0,${.5+t} L1,${.5+t} M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╪":{1:(e,t)=>`M.5,0 L.5,1 M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"╫":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╬":{1:(e,t)=>`M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1 M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(e,t)=>`M.5,1 L.5,${.5+t/.15*.5} C.5,${.5+t/.15*.5},.5,.5,1,.5`},"╮":{1:(e,t)=>`M.5,1 L.5,${.5+t/.15*.5} C.5,${.5+t/.15*.5},.5,.5,0,.5`},"╯":{1:(e,t)=>`M.5,0 L.5,${.5-t/.15*.5} C.5,${.5-t/.15*.5},.5,.5,0,.5`},"╰":{1:(e,t)=>`M.5,0 L.5,${.5-t/.15*.5} C.5,${.5-t/.15*.5},.5,.5,1,.5`}},t.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:1,leftPadding:1}},t.tryDrawCustomChar=function(e,i,n,l,c,d,_,u){const g=t.blockElementDefinitions[i];if(g)return function(e,t,i,s,r,o){for(let n=0;n7&&parseInt(l.slice(7,9),16)||1;else{if(!l.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${l}" when drawing pattern glyph`);[d,_,u,g]=l.substring(5,l.length-1).split(",").map((e=>parseFloat(e)))}for(let e=0;ee.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]),L:(e,t)=>e.lineTo(t[0],t[1]),M:(e,t)=>e.moveTo(t[0],t[1])};function h(e,t,i,s,r,o,a,h=0,l=0){const c=e.map((e=>parseFloat(e)||parseInt(e)));if(c.length<2)throw new Error("Too few arguments for instruction");for(let e=0;e{Object.defineProperty(t,"__esModule",{value:!0}),t.observeDevicePixelDimensions=void 0;const s=i(859);t.observeDevicePixelDimensions=function(e,t,i){let r=new t.ResizeObserver((t=>{const s=t.find((t=>t.target===e));if(!s)return;if(!("devicePixelContentBoxSize"in s))return null==r||r.disconnect(),void(r=void 0);const o=s.devicePixelContentBoxSize[0].inlineSize,n=s.devicePixelContentBoxSize[0].blockSize;o>0&&n>0&&i(o,n)}));try{r.observe(e,{box:["device-pixel-content-box"]})}catch(e){r.disconnect(),r=void 0}return(0,s.toDisposable)((()=>null==r?void 0:r.disconnect()))}},374:(e,t)=>{function i(e){return 57508<=e&&e<=57558}Object.defineProperty(t,"__esModule",{value:!0}),t.createRenderDimensions=t.excludeFromContrastRatioDemands=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(e){if(!e)throw new Error("value must not be falsy");return e},t.isPowerlineGlyph=i,t.isRestrictedPowerlineGlyph=function(e){return 57520<=e&&e<=57527},t.excludeFromContrastRatioDemands=function(e){return i(e)||function(e){return 9472<=e&&e<=9631}(e)},t.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}}},296:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createSelectionRenderModel=void 0;class i{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,i,s=!1){if(this.selectionStart=t,this.selectionEnd=i,!t||!i||t[0]===i[0]&&t[1]===i[1])return void this.clear();const r=t[1]-e.buffer.active.viewportY,o=i[1]-e.buffer.active.viewportY,n=Math.max(r,0),a=Math.min(o,e.rows-1);n>=e.rows||a<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=s,this.viewportStartRow=r,this.viewportEndRow=o,this.viewportCappedStartRow=n,this.viewportCappedEndRow=a,this.startCol=t[0],this.endCol=i[0])}isCellSelected(e,t,i){return!!this.hasSelection&&(i-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&i>=this.viewportCappedStartRow&&t=this.viewportCappedStartRow&&t>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i=this.startCol&&t=this.startCol)}}t.createSelectionRenderModel=function(){return new i}},509:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextureAtlas=void 0;const s=i(237),r=i(855),o=i(147),n=i(160),a=i(860),h=i(374),l=i(485),c=i(385),d=1024,_=1024,u=Math.floor(819.2),g={offset:{x:0,y:0},texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let f;function v(e,t,i,s){const r=t.rgba>>>24,o=t.rgba>>>16&255,n=t.rgba>>>8&255,a=i.rgba>>>24,h=i.rgba>>>16&255,l=i.rgba>>>8&255,c=Math.floor((Math.abs(r-a)+Math.abs(o-h)+Math.abs(n-l))/12);let d=!0;for(let t=0;t{if(!this._cacheMap.get(t,r.DEFAULT_COLOR,r.DEFAULT_COLOR,r.DEFAULT_EXT)){const e=this._drawToCache(t,r.DEFAULT_COLOR,r.DEFAULT_COLOR,r.DEFAULT_EXT);this._cacheMap.set(t,r.DEFAULT_COLOR,r.DEFAULT_COLOR,r.DEFAULT_EXT,e)}}))}beginFrame(){return this._currentRow.y>u&&(this.clearTexture(),this.warmUp(),!0)}clearTexture(){0===this._currentRow.x&&0===this._currentRow.y||(this._cacheCtx.clearRect(0,0,d,_),this._cacheMap.clear(),this._cacheMapCombined.clear(),this._currentRow.x=0,this._currentRow.y=0,this._currentRow.height=0,this._fixedRows.length=0,this._didWarmUp=!1,this.hasCanvasChanged=!0)}getRasterizedGlyphCombinedChar(e,t,i,s){return this._getFromCacheMap(this._cacheMapCombined,e,t,i,s)}getRasterizedGlyph(e,t,i,s){return this._getFromCacheMap(this._cacheMap,e,t,i,s)}_getFromCacheMap(e,t,i,s,r){return f=e.get(t,i,s,r),f||(f=this._drawToCache(t,i,s,r),e.set(t,i,s,r,f)),f}_getColorFromAnsiIndex(e){if(e>=this._config.colors.ansi.length)throw new Error("No color found for idx "+e);return this._config.colors.ansi[e]}_getBackgroundColor(e,t,i,r){if(this._config.allowTransparency)return n.NULL_COLOR;let a;switch(e){case 16777216:case 33554432:a=this._getColorFromAnsiIndex(t);break;case 50331648:const e=o.AttributeData.toColorRGB(t);a=n.rgba.toColor(e[0],e[1],e[2]);break;default:a=i?this._config.colors.foreground:this._config.colors.background}return r&&(a=n.color.blend(this._config.colors.background,n.color.multiplyOpacity(a,s.DIM_OPACITY))),a}_getForegroundColor(e,t,i,r,a,h,l,c,d,_){const u=this._getMinimumContrastColor(e,t,i,r,a,h,!1,d,_);if(u)return u;let g;switch(a){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&d&&h<8&&(h+=8),g=this._getColorFromAnsiIndex(h);break;case 50331648:const e=o.AttributeData.toColorRGB(h);g=n.rgba.toColor(e[0],e[1],e[2]);break;default:g=l?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(g=n.color.opaque(g)),c&&(g=n.color.multiplyOpacity(g,s.DIM_OPACITY)),g}_resolveBackgroundRgba(e,t,i){switch(e){case 16777216:case 33554432:return this._getColorFromAnsiIndex(t).rgba;case 50331648:return t<<8;default:return i?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(e,t,i,s){switch(e){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&s&&t<8&&(t+=8),this._getColorFromAnsiIndex(t).rgba;case 50331648:return t<<8;default:return i?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(e,t,i,s,r,o,a,h,l){if(1===this._config.minimumContrastRatio||l)return;const c=this._config.colors.contrastCache.getColor(e,s);if(void 0!==c)return c||void 0;const d=this._resolveBackgroundRgba(t,i,a),_=this._resolveForegroundRgba(r,o,a,h),u=n.rgba.ensureContrastRatio(d,_,this._config.minimumContrastRatio);if(!u)return void this._config.colors.contrastCache.setColor(e,s,null);const g=n.rgba.toColor(u>>24&255,u>>16&255,u>>8&255);return this._config.colors.contrastCache.setColor(e,s,g),g}_drawToCache(e,t,i,r){const n="number"==typeof e?String.fromCharCode(e):e;this.hasCanvasChanged=!0;const l=this._config.deviceCellWidth*Math.max(n.length,2)+4;this._tmpCanvas.width=12&&!this._config.allowTransparency&&" "!==n){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const t=this._tmpCtx.measureText(n);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in t&&t.actualBoundingBoxDescent>0){this._tmpCtx.save();const t=new Path2D;t.rect(i,s-Math.ceil(e/2),this._config.deviceCellWidth,a-s+Math.ceil(e/2)),this._tmpCtx.clip(t),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=R.css,this._tmpCtx.strokeText(n,T,T+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(B||this._tmpCtx.fillText(n,T,T+this._config.deviceCharHeight),"_"===n&&!this._config.allowTransparency){let e=v(this._tmpCtx.getImageData(T,T,this._config.deviceCellWidth,this._config.deviceCellHeight),R,D,I);if(e)for(let t=1;t<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=R.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(n,T,T+this._config.deviceCharHeight-t),e=v(this._tmpCtx.getImageData(T,T,this._config.deviceCellWidth,this._config.deviceCellHeight),R,D,I),e);t++);}if(L){const e=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),t=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=e,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(T,T+Math.floor(this._config.deviceCharHeight/2)-t),this._tmpCtx.lineTo(T+this._config.deviceCharWidth*F,T+Math.floor(this._config.deviceCharHeight/2)-t),this._tmpCtx.stroke()}this._tmpCtx.restore();const $=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let k;if(k=this._config.allowTransparency?function(e){for(let t=0;t0)return!1;return!0}($):v($,R,D,I),k)return g;const O=this._findGlyphBoundingBox($,this._workBoundingBox,l,S,B,T);let P;for(;;){P=this._currentRow;for(const e of this._fixedRows)(P===this._currentRow||e.height2*O.size.y&&(this._currentRow.height>0&&this._fixedRows.push(this._currentRow),P={x:0,y:this._currentRow.y+this._currentRow.height,height:O.size.y},this._fixedRows.push(P),this._currentRow={x:0,y:P.y+P.height,height:0}),P.x+O.size.x<=d)break;P===this._currentRow?(P.x=0,P.y+=P.height,P.height=0):this._fixedRows.splice(this._fixedRows.indexOf(P),1)}return O.texturePosition.x=P.x,O.texturePosition.y=P.y,O.texturePositionClipSpace.x=P.x/d,O.texturePositionClipSpace.y=P.y/_,P.height=Math.max(P.height,O.size.y),P.x+=O.size.x,this._cacheCtx.putImageData($,O.texturePosition.x-this._workBoundingBox.left,O.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,O.size.x,O.size.y),O}_findGlyphBoundingBox(e,t,i,s,r,o){t.top=0;const n=s?this._config.deviceCellHeight:this._tmpCanvas.height,a=s?this._config.deviceCellWidth:i;let h=!1;for(let i=0;i=0;i--){for(let s=0;s=0;i--){for(let s=0;s{Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=t.NULL_COLOR=void 0;const s=i(399);let r=0,o=0,n=0,a=0;var h,l,c;function d(e){const t=e.toString(16);return t.length<2?"0"+t:t}function _(e,t){return e>>0}}(h=t.channels||(t.channels={})),function(e){function t(e,t){return a=Math.round(255*t),[r,o,n]=c.toChannels(e.rgba),{css:h.toCss(r,o,n,a),rgba:h.toRgba(r,o,n,a)}}e.blend=function(e,t){if(a=(255&t.rgba)/255,1===a)return{css:t.css,rgba:t.rgba};const i=t.rgba>>24&255,s=t.rgba>>16&255,l=t.rgba>>8&255,c=e.rgba>>24&255,d=e.rgba>>16&255,_=e.rgba>>8&255;return r=c+Math.round((i-c)*a),o=d+Math.round((s-d)*a),n=_+Math.round((l-_)*a),{css:h.toCss(r,o,n),rgba:h.toRgba(r,o,n)}},e.isOpaque=function(e){return 255==(255&e.rgba)},e.ensureContrastRatio=function(e,t,i){const s=c.ensureContrastRatio(e.rgba,t.rgba,i);if(s)return c.toColor(s>>24&255,s>>16&255,s>>8&255)},e.opaque=function(e){const t=(255|e.rgba)>>>0;return[r,o,n]=c.toChannels(t),{css:h.toCss(r,o,n),rgba:t}},e.opacity=t,e.multiplyOpacity=function(e,i){return a=255&e.rgba,t(e,a*i/255)},e.toColorRGB=function(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}}(t.color||(t.color={})),function(e){let t,i;if(!s.isNode){const e=document.createElement("canvas");e.width=1,e.height=1;const s=e.getContext("2d",{willReadFrequently:!0});s&&(t=s,t.globalCompositeOperation="copy",i=t.createLinearGradient(0,0,1,1))}e.toColor=function(e){if(e.match(/#[\da-f]{3,8}/i))switch(e.length){case 4:return r=parseInt(e.slice(1,2).repeat(2),16),o=parseInt(e.slice(2,3).repeat(2),16),n=parseInt(e.slice(3,4).repeat(2),16),c.toColor(r,o,n);case 5:return r=parseInt(e.slice(1,2).repeat(2),16),o=parseInt(e.slice(2,3).repeat(2),16),n=parseInt(e.slice(3,4).repeat(2),16),a=parseInt(e.slice(4,5).repeat(2),16),c.toColor(r,o,n,a);case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}const s=e.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(s)return r=parseInt(s[1]),o=parseInt(s[2]),n=parseInt(s[3]),a=Math.round(255*(void 0===s[5]?1:parseFloat(s[5]))),c.toColor(r,o,n,a);if(!t||!i)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=i,t.fillStyle=e,"string"!=typeof t.fillStyle)throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[r,o,n,a]=t.getImageData(0,0,1,1).data,255!==a)throw new Error("css.toColor: Unsupported css format");return{rgba:h.toRgba(r,o,n,a),css:e}}}(t.css||(t.css={})),function(e){function t(e,t,i){const s=e/255,r=t/255,o=i/255;return.2126*(s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))+.0722*(o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4))}e.relativeLuminance=function(e){return t(e>>16&255,e>>8&255,255&e)},e.relativeLuminance2=t}(l=t.rgb||(t.rgb={})),function(e){function t(e,t,i){const s=e>>24&255,r=e>>16&255,o=e>>8&255;let n=t>>24&255,a=t>>16&255,h=t>>8&255,c=_(l.relativeLuminance2(n,a,h),l.relativeLuminance2(s,r,o));for(;c0||a>0||h>0);)n-=Math.max(0,Math.ceil(.1*n)),a-=Math.max(0,Math.ceil(.1*a)),h-=Math.max(0,Math.ceil(.1*h)),c=_(l.relativeLuminance2(n,a,h),l.relativeLuminance2(s,r,o));return(n<<24|a<<16|h<<8|255)>>>0}function i(e,t,i){const s=e>>24&255,r=e>>16&255,o=e>>8&255;let n=t>>24&255,a=t>>16&255,h=t>>8&255,c=_(l.relativeLuminance2(n,a,h),l.relativeLuminance2(s,r,o));for(;c>>0}e.ensureContrastRatio=function(e,s,r){const o=l.relativeLuminance(e>>8),n=l.relativeLuminance(s>>8);if(_(o,n)>8));if(a_(o,l.relativeLuminance(t>>8))?n:t}return n}const a=i(e,s,r),h=_(o,l.relativeLuminance(a>>8));if(h_(o,l.relativeLuminance(i>>8))?a:i}return a}},e.reduceLuminance=t,e.increaseLuminance=i,e.toChannels=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},e.toColor=function(e,t,i,s){return{css:h.toCss(e,t,i,s),rgba:h.toRgba(e,t,i,s)}}}(c=t.rgba||(t.rgba={})),t.toPaddedHex=d,t.contrastRatio=_},345:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=e=>(this._listeners.push(e),{dispose:()=>{if(!this._disposed)for(let t=0;tt.fire(e)))}},859:(e,t)=>{function i(e){for(const t of e)t.dispose();e.length=0}Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const e of this._disposables)e.dispose();this._disposables.length=0}register(e){return this._disposables.push(e),e}unregister(e){const t=this._disposables.indexOf(e);-1!==t&&this._disposables.splice(t,1)}},t.toDisposable=function(e){return{dispose:e}},t.disposeArray=i,t.getDisposeArrayDisposable=function(e){return{dispose:()=>i(e)}}},485:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class i{constructor(){this._data={}}set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}}t.TwoKeyMap=i,t.FourKeyMap=class{constructor(){this._data=new i}set(e,t,s,r,o){this._data.get(e,t)||this._data.set(e,t,new i),this._data.get(e,t).set(s,r,o)}get(e,t,i,s){var r;return null===(r=this._data.get(e,t))||void 0===r?void 0:r.get(i,s)}clear(){this._data.clear()}}},399:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.isSafari=t.isLegacyEdge=t.isFirefox=t.isNode=void 0,t.isNode="undefined"==typeof navigator;const i=t.isNode?"node":navigator.userAgent,s=t.isNode?"node":navigator.platform;t.isFirefox=i.includes("Firefox"),t.isLegacyEdge=i.includes("Edge"),t.isSafari=/^((?!chrome|android).)*safari/i.test(i),t.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(s),t.isIpad="iPad"===s,t.isIphone="iPhone"===s,t.isWindows=["Windows","Win16","Win32","WinCE"].includes(s),t.isLinux=s.indexOf("Linux")>=0},385:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DebouncedIdleTask=t.IdleTaskQueue=t.PriorityTaskQueue=void 0;const s=i(399);class r{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._ie.timeRemaining())return void this._start();this.clear()}}class o extends r{_requestCallback(e){return setTimeout((()=>e(this._createDeadline(16))))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){const t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}}t.PriorityTaskQueue=o,t.IdleTaskQueue=!s.isNode&&"requestIdleCallback"in window?class extends r{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}}:o,t.DebouncedIdleTask=class{constructor(){this._queue=new t.IdleTaskQueue}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}}},455:(e,t)=>{function i(e,t,i=0,s=e.length){if(i>=e.length)return e;i=(e.length+i)%e.length,s=s>=e.length?e.length:(e.length+s)%e.length;for(let r=i;r{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class i{constructor(){this.fg=0,this.bg=0,this.extended=new s}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){const e=new i;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underlineStyle?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return 50331648==(50331648&this.fg)}isBgRGB(){return 50331648==(50331648&this.bg)}isFgPalette(){return 16777216==(50331648&this.fg)||33554432==(50331648&this.fg)}isBgPalette(){return 16777216==(50331648&this.bg)||33554432==(50331648&this.bg)}isFgDefault(){return 0==(50331648&this.fg)}isBgDefault(){return 0==(50331648&this.bg)}isAttributeDefault(){return 0===this.fg&&0===this.bg}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?50331648==(50331648&this.extended.underlineColor):this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?16777216==(50331648&this.extended.underlineColor)||33554432==(50331648&this.extended.underlineColor):this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?0==(50331648&this.extended.underlineColor):this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}t.AttributeData=i;class s{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(e){this._ext&=-67108864,this._ext|=67108863&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}clone(){return new s(this._ext,this._urlId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId}}t.ExtendedAttrs=s},782:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;const s=i(133),r=i(855),o=i(147);class n extends o.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new o.ExtendedAttrs,this.combinedData=""}static fromCharData(e){const t=new n;return t.setFromCharData(e),t}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,s.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[r.CHAR_DATA_ATTR_INDEX],this.bg=0;let t=!1;if(e[r.CHAR_DATA_CHAR_INDEX].length>2)t=!0;else if(2===e[r.CHAR_DATA_CHAR_INDEX].length){const i=e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=i&&i<=56319){const s=e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=s&&s<=57343?this.content=1024*(i-55296)+s-56320+65536|e[r.CHAR_DATA_WIDTH_INDEX]<<22:t=!0}else t=!0}else this.content=e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e[r.CHAR_DATA_WIDTH_INDEX]<<22;t&&(this.combinedData=e[r.CHAR_DATA_CHAR_INDEX],this.content=2097152|e[r.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=n},855:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=256,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},133:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)},t.utf32ToString=function(e,t=0,i=e.length){let s="";for(let r=t;r65535?(t-=65536,s+=String.fromCharCode(55296+(t>>10))+String.fromCharCode(t%1024+56320)):s+=String.fromCharCode(t)}return s},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){const i=e.length;if(!i)return 0;let s=0,r=0;if(this._interim){const i=e.charCodeAt(r++);56320<=i&&i<=57343?t[s++]=1024*(this._interim-55296)+i-56320+65536:(t[s++]=this._interim,t[s++]=i),this._interim=0}for(let o=r;o=i)return this._interim=r,s;const n=e.charCodeAt(o);56320<=n&&n<=57343?t[s++]=1024*(r-55296)+n-56320+65536:(t[s++]=r,t[s++]=n)}else 65279!==r&&(t[s++]=r)}return s}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){const i=e.length;if(!i)return 0;let s,r,o,n,a=0,h=0,l=0;if(this.interim[0]){let s=!1,r=this.interim[0];r&=192==(224&r)?31:224==(240&r)?15:7;let o,n=0;for(;(o=63&this.interim[++n])&&n<4;)r<<=6,r|=o;const h=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,c=h-n;for(;l=i)return 0;if(o=e[l++],128!=(192&o)){l--,s=!0;break}this.interim[n++]=o,r<<=6,r|=63&o}s||(2===h?r<128?l--:t[a++]=r:3===h?r<2048||r>=55296&&r<=57343||65279===r||(t[a++]=r):r<65536||r>1114111||(t[a++]=r)),this.interim.fill(0)}const c=i-4;let d=l;for(;d=i)return this.interim[0]=s,a;if(r=e[d++],128!=(192&r)){d--;continue}if(h=(31&s)<<6|63&r,h<128){d--;continue}t[a++]=h}else if(224==(240&s)){if(d>=i)return this.interim[0]=s,a;if(r=e[d++],128!=(192&r)){d--;continue}if(d>=i)return this.interim[0]=s,this.interim[1]=r,a;if(o=e[d++],128!=(192&o)){d--;continue}if(h=(15&s)<<12|(63&r)<<6|63&o,h<2048||h>=55296&&h<=57343||65279===h)continue;t[a++]=h}else if(240==(248&s)){if(d>=i)return this.interim[0]=s,a;if(r=e[d++],128!=(192&r)){d--;continue}if(d>=i)return this.interim[0]=s,this.interim[1]=r,a;if(o=e[d++],128!=(192&o)){d--;continue}if(d>=i)return this.interim[0]=s,this.interim[1]=r,this.interim[2]=o,a;if(n=e[d++],128!=(192&n)){d--;continue}if(h=(7&s)<<18|(63&r)<<12|(63&o)<<6|63&n,h<65536||h>1114111)continue;t[a++]=h}}return a}}}},t={};function i(s){var r=t[s];if(void 0!==r)return r.exports;var o=t[s]={exports:{}};return e[s](o,o.exports,i),o.exports}var s={};return(()=>{var e=s;Object.defineProperty(e,"__esModule",{value:!0}),e.WebglAddon=void 0;const t=i(345),r=i(859),o=i(399),n=i(666);class a extends r.Disposable{constructor(e){super(),this._preserveDrawingBuffer=e,this._onChangeTextureAtlas=this.register(new t.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onContextLoss=this.register(new t.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(e){if(o.isSafari)throw new Error("Webgl is not currently supported on Safari");const i=e._core;if(!e.element)return void this.register(i.onWillOpen((()=>this.activate(e))));this._terminal=e;const s=i.coreService,a=i.optionsService,h=i,l=h._renderService,c=h._characterJoinerService,d=h._charSizeService,_=h._coreBrowserService,u=h._decorationService,g=h._themeService;this._renderer=this.register(new n.WebglRenderer(e,c,d,_,s,u,a,g,this._preserveDrawingBuffer)),this.register((0,t.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,t.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),l.setRenderer(this._renderer),this.register((0,r.toDisposable)((()=>{const t=this._terminal._core._renderService;t.setRenderer(this._terminal._core._createRenderer()),t.handleResize(e.cols,e.rows)})))}get textureAtlas(){var e;return null===(e=this._renderer)||void 0===e?void 0:e.textureAtlas}clearTextureAtlas(){var e;null===(e=this._renderer)||void 0===e||e.clearTextureAtlas()}}e.WebglAddon=a})(),s})()}));//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/xterm-addon-webgl/lib/xterm-addon-webgl.js.map{ "name": "xterm-headless", "description": "A headless terminal component that runs in Node.js", "version": "5.1.0-beta.49", "main": "lib-headless/xterm-headless.js", "types": "typings/xterm-headless.d.ts", "repository": "https://github.com/xtermjs/xterm.js", "license": "MIT", "keywords": [ "cli", "command-line", "console", "pty", "shell", "ssh", "styles", "terminal-emulator", "terminal", "tty", "vt100", "webgl", "xterm" ] }(()=>{"use strict";var e={349:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CircularList=void 0;const s=i(460),r=i(844);class n extends r.Disposable{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this.register(new s.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new s.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new s.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;const t=new Array(e);for(let i=0;ithis._length)for(let t=this._length;t=e;t--)this._array[this._getCyclicIndex(t+i.length)]=this._array[this._getCyclicIndex(t)];for(let t=0;tthis._maxLength){const e=this._length+i.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=i.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(i>0){for(let s=t-1;s>=0;s--)this.set(e+s+i,this.get(e+s));const s=e+t+i-this._length;if(s>0)for(this._length+=s;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let s=0;s{Object.defineProperty(t,"__esModule",{value:!0}),t.clone=void 0,t.clone=function e(t,i=5){if("object"!=typeof t)return t;const s=Array.isArray(t)?[]:{};for(const r in t)s[r]=i<=1?t[r]:t[r]&&e(t[r],i-1);return s}},969:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreTerminal=void 0;const s=i(844),r=i(585),n=i(348),a=i(866),o=i(744),h=i(302),c=i(83),l=i(460),_=i(753),d=i(480),f=i(994),u=i(282),g=i(435),p=i(981),v=i(660);let b=!1;class S extends s.Disposable{constructor(e){super(),this._onBinary=this.register(new l.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new l.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new l.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new l.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new l.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new l.EventEmitter),this._instantiationService=new n.InstantiationService,this.optionsService=this.register(new h.OptionsService(e)),this._instantiationService.setService(r.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(o.BufferService)),this._instantiationService.setService(r.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(a.LogService)),this._instantiationService.setService(r.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(c.CoreService,(()=>this.scrollToBottom()))),this._instantiationService.setService(r.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(_.CoreMouseService)),this._instantiationService.setService(r.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(d.UnicodeService)),this._instantiationService.setService(r.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(f.CharsetService),this._instantiationService.setService(r.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(v.OscLinkService),this._instantiationService.setService(r.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new g.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,l.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,l.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,l.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,l.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onSpecificOptionChange("windowsMode",(e=>this._handleWindowsModeOptionChange(e)))),this.register(this._bufferService.onScroll((e=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((e=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new p.WriteBuffer(((e,t)=>this._inputHandler.parse(e,t)))),this.register((0,l.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed)),this.register((0,s.toDisposable)((()=>{var e;null===(e=this._windowsMode)||void 0===e||e.dispose(),this._windowsMode=void 0})))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new l.EventEmitter),this._onScroll.event((e=>{var t;null===(t=this._onScrollApi)||void 0===t||t.fire(e.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(const t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=r.LogLevelEnum.WARN&&!b&&(this._logService.warn("writeSync is unreliable and will be removed soon."),b=!0),this._writeBuffer.writeSync(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,o.MINIMUM_COLS),t=Math.max(t,o.MINIMUM_ROWS),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t,i){this._bufferService.scrollLines(e,t,i)}scrollPages(e){this._bufferService.scrollPages(e)}scrollToTop(){this._bufferService.scrollToTop()}scrollToBottom(){this._bufferService.scrollToBottom()}scrollToLine(e){this._bufferService.scrollToLine(e)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this.optionsService.rawOptions.windowsMode&&this._enableWindowsMode()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsModeOptionChange(e){var t;e?this._enableWindowsMode():(null===(t=this._windowsMode)||void 0===t||t.dispose(),this._windowsMode=void 0)}_enableWindowsMode(){if(!this._windowsMode){const e=[];e.push(this.onLineFeed(u.updateWindowsModeWrappedState.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},(()=>((0,u.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsMode={dispose:()=>{for(const t of e)t.dispose()}}}}}t.CoreTerminal=S},460:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=e=>{this._listeners.push(e);const t={dispose:()=>{if(!this._disposed)for(let t=0;tt.fire(e)))}},435:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InputHandler=t.WindowsOptionsReportType=void 0;const n=i(584),a=i(116),o=i(15),h=i(844),c=i(482),l=i(437),_=i(460),d=i(643),f=i(511),u=i(734),g=i(585),p=i(242),v=i(351),b=i(941),S={"(":0,")":1,"*":2,"+":3,"-":1,".":2},C=131072;function m(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var y;!function(e){e[e.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",e[e.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"}(y=t.WindowsOptionsReportType||(t.WindowsOptionsReportType={}));let w=0;class A extends h.Disposable{constructor(e,t,i,s,r,h,d,u,g=new o.EscapeSequenceParser){super(),this._bufferService=e,this._charsetService=t,this._coreService=i,this._logService=s,this._optionsService=r,this._oscLinkService=h,this._coreMouseService=d,this._unicodeService=u,this._parser=g,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new c.StringToUtf32,this._utf8Decoder=new c.Utf8ToUtf32,this._workCell=new f.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=l.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=l.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new _.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new _.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new _.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new _.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new _.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new _.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new _.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new _.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new _.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new _.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new _.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new _.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new _.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new B(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((e=>this._activeBuffer=e.activeBuffer))),this._parser.setCsiHandlerFallback(((e,t)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(e),params:t.toArray()})})),this._parser.setEscHandlerFallback((e=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(e)})})),this._parser.setExecuteHandlerFallback((e=>{this._logService.debug("Unknown EXECUTE code: ",{code:e})})),this._parser.setOscHandlerFallback(((e,t,i)=>{this._logService.debug("Unknown OSC code: ",{identifier:e,action:t,data:i})})),this._parser.setDcsHandlerFallback(((e,t,i)=>{"HOOK"===t&&(i=i.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(e),action:t,payload:i})})),this._parser.setPrintHandler(((e,t,i)=>this.print(e,t,i))),this._parser.registerCsiHandler({final:"@"},(e=>this.insertChars(e))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(e=>this.scrollLeft(e))),this._parser.registerCsiHandler({final:"A"},(e=>this.cursorUp(e))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(e=>this.scrollRight(e))),this._parser.registerCsiHandler({final:"B"},(e=>this.cursorDown(e))),this._parser.registerCsiHandler({final:"C"},(e=>this.cursorForward(e))),this._parser.registerCsiHandler({final:"D"},(e=>this.cursorBackward(e))),this._parser.registerCsiHandler({final:"E"},(e=>this.cursorNextLine(e))),this._parser.registerCsiHandler({final:"F"},(e=>this.cursorPrecedingLine(e))),this._parser.registerCsiHandler({final:"G"},(e=>this.cursorCharAbsolute(e))),this._parser.registerCsiHandler({final:"H"},(e=>this.cursorPosition(e))),this._parser.registerCsiHandler({final:"I"},(e=>this.cursorForwardTab(e))),this._parser.registerCsiHandler({final:"J"},(e=>this.eraseInDisplay(e,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(e=>this.eraseInDisplay(e,!0))),this._parser.registerCsiHandler({final:"K"},(e=>this.eraseInLine(e,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(e=>this.eraseInLine(e,!0))),this._parser.registerCsiHandler({final:"L"},(e=>this.insertLines(e))),this._parser.registerCsiHandler({final:"M"},(e=>this.deleteLines(e))),this._parser.registerCsiHandler({final:"P"},(e=>this.deleteChars(e))),this._parser.registerCsiHandler({final:"S"},(e=>this.scrollUp(e))),this._parser.registerCsiHandler({final:"T"},(e=>this.scrollDown(e))),this._parser.registerCsiHandler({final:"X"},(e=>this.eraseChars(e))),this._parser.registerCsiHandler({final:"Z"},(e=>this.cursorBackwardTab(e))),this._parser.registerCsiHandler({final:"`"},(e=>this.charPosAbsolute(e))),this._parser.registerCsiHandler({final:"a"},(e=>this.hPositionRelative(e))),this._parser.registerCsiHandler({final:"b"},(e=>this.repeatPrecedingCharacter(e))),this._parser.registerCsiHandler({final:"c"},(e=>this.sendDeviceAttributesPrimary(e))),this._parser.registerCsiHandler({prefix:">",final:"c"},(e=>this.sendDeviceAttributesSecondary(e))),this._parser.registerCsiHandler({final:"d"},(e=>this.linePosAbsolute(e))),this._parser.registerCsiHandler({final:"e"},(e=>this.vPositionRelative(e))),this._parser.registerCsiHandler({final:"f"},(e=>this.hVPosition(e))),this._parser.registerCsiHandler({final:"g"},(e=>this.tabClear(e))),this._parser.registerCsiHandler({final:"h"},(e=>this.setMode(e))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(e=>this.setModePrivate(e))),this._parser.registerCsiHandler({final:"l"},(e=>this.resetMode(e))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(e=>this.resetModePrivate(e))),this._parser.registerCsiHandler({final:"m"},(e=>this.charAttributes(e))),this._parser.registerCsiHandler({final:"n"},(e=>this.deviceStatus(e))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(e=>this.deviceStatusPrivate(e))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(e=>this.softReset(e))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(e=>this.setCursorStyle(e))),this._parser.registerCsiHandler({final:"r"},(e=>this.setScrollRegion(e))),this._parser.registerCsiHandler({final:"s"},(e=>this.saveCursor(e))),this._parser.registerCsiHandler({final:"t"},(e=>this.windowOptions(e))),this._parser.registerCsiHandler({final:"u"},(e=>this.restoreCursor(e))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(e=>this.insertColumns(e))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(e=>this.deleteColumns(e))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(e=>this.selectProtected(e))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(e=>this.requestMode(e,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(e=>this.requestMode(e,!1))),this._parser.setExecuteHandler(n.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(n.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(n.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(n.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(n.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(n.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(n.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(n.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(n.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(n.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(n.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(n.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new p.OscHandler((e=>(this.setTitle(e),this.setIconName(e),!0)))),this._parser.registerOscHandler(1,new p.OscHandler((e=>this.setIconName(e)))),this._parser.registerOscHandler(2,new p.OscHandler((e=>this.setTitle(e)))),this._parser.registerOscHandler(4,new p.OscHandler((e=>this.setOrReportIndexedColor(e)))),this._parser.registerOscHandler(8,new p.OscHandler((e=>this.setHyperlink(e)))),this._parser.registerOscHandler(10,new p.OscHandler((e=>this.setOrReportFgColor(e)))),this._parser.registerOscHandler(11,new p.OscHandler((e=>this.setOrReportBgColor(e)))),this._parser.registerOscHandler(12,new p.OscHandler((e=>this.setOrReportCursorColor(e)))),this._parser.registerOscHandler(104,new p.OscHandler((e=>this.restoreIndexedColor(e)))),this._parser.registerOscHandler(110,new p.OscHandler((e=>this.restoreFgColor(e)))),this._parser.registerOscHandler(111,new p.OscHandler((e=>this.restoreBgColor(e)))),this._parser.registerOscHandler(112,new p.OscHandler((e=>this.restoreCursorColor(e)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const e in a.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:e},(()=>this.selectCharset("("+e))),this._parser.registerEscHandler({intermediates:")",final:e},(()=>this.selectCharset(")"+e))),this._parser.registerEscHandler({intermediates:"*",final:e},(()=>this.selectCharset("*"+e))),this._parser.registerEscHandler({intermediates:"+",final:e},(()=>this.selectCharset("+"+e))),this._parser.registerEscHandler({intermediates:"-",final:e},(()=>this.selectCharset("-"+e))),this._parser.registerEscHandler({intermediates:".",final:e},(()=>this.selectCharset("."+e))),this._parser.registerEscHandler({intermediates:"/",final:e},(()=>this.selectCharset("/"+e)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((e=>(this._logService.error("Parsing error: ",e),e))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new v.DcsHandler(((e,t)=>this.requestStatusString(e,t))))}getAttrData(){return this._curAttrData}_preserveStack(e,t,i,s){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=i,this._parseStack.position=s}_logSlowResolvingAsync(e){this._logService.logLevel<=g.LogLevelEnum.WARN&&Promise.race([e,new Promise(((e,t)=>setTimeout((()=>t("#SLOW_TIMEOUT")),5e3)))]).catch((e=>{if("#SLOW_TIMEOUT"!==e)throw e;console.warn("async parser handler taking longer than 5000 ms")}))}parse(e,t){let i,s=this._activeBuffer.x,r=this._activeBuffer.y,n=0;const a=this._parseStack.paused;if(a){if(i=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(i),i;s=this._parseStack.cursorStartX,r=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>C&&(n=this._parseStack.position+C)}if(this._logService.logLevel<=g.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+("string"==typeof e?` "${e}"`:` "${Array.prototype.map.call(e,(e=>String.fromCharCode(e))).join("")}"`),"string"==typeof e?e.split("").map((e=>e.charCodeAt(0))):e),this._parseBuffer.lengthC)for(let t=n;t0&&2===f.getWidth(this._activeBuffer.x-1)&&f.setCellFromCodePoint(this._activeBuffer.x-1,0,1,_.fg,_.bg,_.extended);for(let u=t;u=o)if(h){for(;this._activeBuffer.x=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),f=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=o-1,2===r)continue;if(l&&(f.insertCells(this._activeBuffer.x,r,this._activeBuffer.getNullCell(_),_),2===f.getWidth(o-1)&&f.setCellFromCodePoint(o-1,d.NULL_CELL_CODE,d.NULL_CELL_WIDTH,_.fg,_.bg,_.extended)),f.setCellFromCodePoint(this._activeBuffer.x++,s,r,_.fg,_.bg,_.extended),r>0)for(;--r;)f.setCellFromCodePoint(this._activeBuffer.x++,0,0,_.fg,_.bg,_.extended)}else f.getWidth(this._activeBuffer.x-1)?f.addCodepointToCell(this._activeBuffer.x-1,s):f.addCodepointToCell(this._activeBuffer.x-2,s)}i-t>0&&(f.loadCell(this._activeBuffer.x-1,this._workCell),2===this._workCell.getWidth()||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x0&&0===f.getWidth(this._activeBuffer.x)&&!f.hasContent(this._activeBuffer.x)&&f.setCellFromCodePoint(this._activeBuffer.x,0,1,_.fg,_.bg,_.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return"t"!==e.final||e.prefix||e.intermediates?this._parser.registerCsiHandler(e,t):this._parser.registerCsiHandler(e,(e=>!m(e.params[0],this._optionsService.rawOptions.windowOptions)||t(e)))}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new v.DcsHandler(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new p.OscHandler(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var e;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(0===this._activeBuffer.x&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&(null===(e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))||void 0===e?void 0:e.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){const t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){const t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){const t=e.params[0];return 0===t?delete this._activeBuffer.tabs[this._activeBuffer.x]:3===t&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){const t=e.params[0];return 1===t&&(this._curAttrData.bg|=536870912),2!==t&&0!==t||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,i,s=!1,r=!1){const n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.replaceCells(t,i,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),r),s&&(n.isWrapped=!1)}_resetBufferLine(e,t=!1){const i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),i.isWrapped=!1}eraseInDisplay(e,t=!1){let i;switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i++,this._activeBuffer.x,this._bufferService.cols,0===this._activeBuffer.x,t);i=this._bufferService.cols&&(this._activeBuffer.lines.get(i+1).isWrapped=!1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0);break;case 2:for(i=this._bufferService.rows,this._dirtyRowTracker.markDirty(i-1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0);break;case 3:const e=this._activeBuffer.lines.length-this._bufferService.rows;e>0&&(this._activeBuffer.lines.trimStart(e),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-e,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-e,0),this._onScroll.fire(0))}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,0===this._activeBuffer.x,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(n.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(n.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(n.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(n.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(n.C0.ESC+"[>83;40003;0c")),!0}_is(e){return 0===(this._optionsService.rawOptions.termName+"").indexOf(e)}setMode(e){for(let t=0;te?1:2,f=e.params[0];return u=f,g=t?2===f?3:4===f?d(a.modes.insertMode):12===f?4:20===f?d(_.convertEol):0:1===f?d(i.applicationCursorKeys):3===f?_.windowOptions.setWinLines?80===h?2:132===h?1:0:0:6===f?d(i.origin):7===f?d(i.wraparound):8===f?3:9===f?d("X10"===s):12===f?d(_.cursorBlink):25===f?d(!a.isCursorHidden):45===f?d(i.reverseWraparound):66===f?d(i.applicationKeypad):1e3===f?d("VT200"===s):1002===f?d("DRAG"===s):1003===f?d("ANY"===s):1004===f?d(i.sendFocus):1005===f?4:1006===f?d("SGR"===r):1015===f?4:1016===f?d("SGR_PIXELS"===r):1048===f?1:47===f||1047===f||1049===f?d(c===l):2004===f?d(i.bracketedPasteMode):0,a.triggerDataEvent(`${n.C0.ESC}[${t?"":"?"}${u};${g}$y`),!0;var u,g}_updateAttrColor(e,t,i,s,r){return 2===t?(e|=50331648,e&=-16777216,e|=u.AttributeData.fromColorRGB([i,s,r])):5===t&&(e&=-50331904,e|=33554432|255&i),e}_extractColor(e,t,i){const s=[0,0,-1,0,0,0];let r=0,n=0;do{if(s[n+r]=e.params[t+n],e.hasSubParams(t+n)){const i=e.getSubParams(t+n);let a=0;do{5===s[1]&&(r=1),s[n+a+1+r]=i[a]}while(++a=2||2===s[1]&&n+r>=5)break;s[1]&&(r=1)}while(++n+t5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,0===e&&(t.fg&=-268435457),t.updateExtended()}charAttributes(e){if(1===e.length&&0===e.params[0])return this._curAttrData.fg=l.DEFAULT_ATTR_DATA.fg,this._curAttrData.bg=l.DEFAULT_ATTR_DATA.bg,!0;const t=e.length;let i;const s=this._curAttrData;for(let r=0;r=30&&i<=37?(s.fg&=-50331904,s.fg|=16777216|i-30):i>=40&&i<=47?(s.bg&=-50331904,s.bg|=16777216|i-40):i>=90&&i<=97?(s.fg&=-50331904,s.fg|=16777224|i-90):i>=100&&i<=107?(s.bg&=-50331904,s.bg|=16777224|i-100):0===i?(s.fg=l.DEFAULT_ATTR_DATA.fg,s.bg=l.DEFAULT_ATTR_DATA.bg):1===i?s.fg|=134217728:3===i?s.bg|=67108864:4===i?(s.fg|=268435456,this._processUnderline(e.hasSubParams(r)?e.getSubParams(r)[0]:1,s)):5===i?s.fg|=536870912:7===i?s.fg|=67108864:8===i?s.fg|=1073741824:9===i?s.fg|=2147483648:2===i?s.bg|=134217728:21===i?this._processUnderline(2,s):22===i?(s.fg&=-134217729,s.bg&=-134217729):23===i?s.bg&=-67108865:24===i?(s.fg&=-268435457,this._processUnderline(0,s)):25===i?s.fg&=-536870913:27===i?s.fg&=-67108865:28===i?s.fg&=-1073741825:29===i?s.fg&=2147483647:39===i?(s.fg&=-67108864,s.fg|=16777215&l.DEFAULT_ATTR_DATA.fg):49===i?(s.bg&=-67108864,s.bg|=16777215&l.DEFAULT_ATTR_DATA.bg):38===i||48===i||58===i?r+=this._extractColor(e,r,s):59===i?(s.extended=s.extended.clone(),s.extended.underlineColor=-1,s.updateExtended()):100===i?(s.fg&=-67108864,s.fg|=16777215&l.DEFAULT_ATTR_DATA.fg,s.bg&=-67108864,s.bg|=16777215&l.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",i);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${n.C0.ESC}[0n`);break;case 6:const e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[${e};${t}R`)}return!0}deviceStatusPrivate(e){if(6===e.params[0]){const e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[?${e};${t}R`)}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=l.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){const t=e.params[0]||1;switch(t){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const i=t%2==1;return this._optionsService.options.cursorBlink=i,!0}setScrollRegion(e){const t=e.params[0]||1;let i;return(e.length<2||(i=e.params[1])>this._bufferService.rows||0===i)&&(i=this._bufferService.rows),i>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=i-1,this._setCursor(0,0)),!0}windowOptions(e){if(!m(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;const t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:2!==t&&this._onRequestWindowsOptionsReport.fire(y.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(y.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${n.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:0!==t&&2!==t||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),0!==t&&1!==t||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:0!==t&&2!==t||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),0!==t&&1!==t||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){const t=[],i=e.split(";");for(;i.length>1;){const e=i.shift(),s=i.shift();if(/^\d+$/.exec(e)){const i=parseInt(e);if(0<=i&&i<256)if("?"===s)t.push({type:0,index:i});else{const e=(0,b.parseColor)(s);e&&t.push({type:1,index:i,color:e})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){const t=e.split(";");return!(t.length<2)&&(t[1]?this._createHyperlink(t[0],t[1]):!t[0]&&this._finishHyperlink())}_createHyperlink(e,t){void 0!==this._currentLinkId&&this._finishHyperlink();const i=e.split(":");let s;const r=i.findIndex((e=>e.startsWith("id=")));return-1!==r&&(s=i[r].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._currentLinkId=this._oscLinkService.registerLink({id:s,uri:t}),this._curAttrData.extended.urlId=this._currentLinkId,this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),this._currentLinkId=void 0,!0}_setOrReportSpecialColor(e,t){const i=e.split(";");for(let e=0;e=this._specialColors.length);++e,++t)if("?"===i[e])this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{const s=(0,b.parseColor)(i[e]);s&&this._onColor.fire([{type:1,index:this._specialColors[t],color:s}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;const t=[],i=e.split(";");for(let e=0;e=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=l.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=l.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){const e=new f.CellData;e.content=1<<22|"E".charCodeAt(0),e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t(this._coreService.triggerDataEvent(`${n.C0.ESC}${e}${n.C0.ESC}\\`),!0))('"q'===e?`P1$r${this._curAttrData.isProtected()?1:0}"q`:'"p'===e?'P1$r61;1"p':"r"===e?`P1$r${i.scrollTop+1};${i.scrollBottom+1}r`:"m"===e?"P1$r0m":" q"===e?`P1$r${{block:2,underline:4,bar:6}[s.cursorStyle]-(s.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}}t.InputHandler=A;let B=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){ethis.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(w=e,e=t,t=w),ethis.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};B=s([r(0,g.IBufferService)],B)},844:(e,t)=>{function i(e){for(const t of e)t.dispose();e.length=0}Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const e of this._disposables)e.dispose();this._disposables.length=0}register(e){return this._disposables.push(e),e}unregister(e){const t=this._disposables.indexOf(e);-1!==t&&this._disposables.splice(t,1)}},t.toDisposable=function(e){return{dispose:e}},t.disposeArray=i,t.getDisposeArrayDisposable=function(e){return{dispose:()=>i(e)}}},114:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.isSafari=t.isLegacyEdge=t.isFirefox=t.isNode=void 0,t.isNode="undefined"==typeof navigator;const i=t.isNode?"node":navigator.userAgent,s=t.isNode?"node":navigator.platform;t.isFirefox=i.includes("Firefox"),t.isLegacyEdge=i.includes("Edge"),t.isSafari=/^((?!chrome|android).)*safari/i.test(i),t.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(s),t.isIpad="iPad"===s,t.isIphone="iPhone"===s,t.isWindows=["Windows","Win16","Win32","WinCE"].includes(s),t.isLinux=s.indexOf("Linux")>=0},273:(e,t)=>{function i(e,t,i=0,s=e.length){if(i>=e.length)return e;i=(e.length+i)%e.length,s=s>=e.length?e.length:(e.length+s)%e.length;for(let r=i;r{Object.defineProperty(t,"__esModule",{value:!0}),t.updateWindowsModeWrappedState=void 0;const s=i(643);t.updateWindowsModeWrappedState=function(e){const t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1),i=null==t?void 0:t.get(e.cols-1),r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);r&&i&&(r.isWrapped=i[s.CHAR_DATA_CODE_INDEX]!==s.NULL_CELL_CODE&&i[s.CHAR_DATA_CODE_INDEX]!==s.WHITESPACE_CELL_CODE)}},734:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class i{constructor(){this.fg=0,this.bg=0,this.extended=new s}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){const e=new i;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underlineStyle?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return 50331648==(50331648&this.fg)}isBgRGB(){return 50331648==(50331648&this.bg)}isFgPalette(){return 16777216==(50331648&this.fg)||33554432==(50331648&this.fg)}isBgPalette(){return 16777216==(50331648&this.bg)||33554432==(50331648&this.bg)}isFgDefault(){return 0==(50331648&this.fg)}isBgDefault(){return 0==(50331648&this.bg)}isAttributeDefault(){return 0===this.fg&&0===this.bg}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?50331648==(50331648&this.extended.underlineColor):this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?16777216==(50331648&this.extended.underlineColor)||33554432==(50331648&this.extended.underlineColor):this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?0==(50331648&this.extended.underlineColor):this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}t.AttributeData=i;class s{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(e){this._ext&=-67108864,this._ext|=67108863&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}clone(){return new s(this._ext,this._urlId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId}}t.ExtendedAttrs=s},92:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferStringIterator=t.Buffer=t.MAX_BUFFER_SIZE=void 0;const s=i(349),r=i(437),n=i(511),a=i(643),o=i(634),h=i(863),c=i(116),l=i(734);t.MAX_BUFFER_SIZE=4294967295,t.Buffer=class{constructor(e,t,i){this._hasScrollback=e,this._optionsService=t,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=r.DEFAULT_ATTR_DATA.clone(),this.savedCharset=c.DEFAULT_CHARSET,this.markers=[],this._nullCell=n.CellData.fromCharData([0,a.NULL_CELL_CHAR,a.NULL_CELL_WIDTH,a.NULL_CELL_CODE]),this._whitespaceCell=n.CellData.fromCharData([0,a.WHITESPACE_CELL_CHAR,a.WHITESPACE_CELL_WIDTH,a.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new s.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new l.ExtendedAttrs),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new l.ExtendedAttrs),this._whitespaceCell}getBlankLine(e,t){return new r.BufferLine(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const e=this.ybase+this.y-this.ydisp;return e>=0&&et.MAX_BUFFER_SIZE?t.MAX_BUFFER_SIZE:i}fillViewportRows(e){if(0===this.lines.length){void 0===e&&(e=r.DEFAULT_ATTR_DATA);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new s.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){const i=this.getNullCell(r.DEFAULT_ATTR_DATA),s=this._getCorrectBufferLength(t);if(s>this.lines.maxLength&&(this.lines.maxLength=s),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+n+1?(this.ybase--,n++,this.ydisp>0&&this.ydisp--):this.lines.push(new r.BufferLine(e,i)));else for(let e=this._rows;e>t;e--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(s0&&(this.lines.trimStart(e),this.ybase=Math.max(this.ybase-e,0),this.ydisp=Math.max(this.ydisp-e,0),this.savedY=Math.max(this.savedY-e,0)),this.lines.maxLength=s}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),n&&(this.y+=n),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let t=0;tthis._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){const i=(0,o.reflowLargerGetLinesToRemove)(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(r.DEFAULT_ATTR_DATA));if(i.length>0){const s=(0,o.reflowLargerCreateNewLayout)(this.lines,i);(0,o.reflowLargerApplyNewLayout)(this.lines,s.layout),this._reflowLargerAdjustViewport(e,t,s.countRemoved)}}_reflowLargerAdjustViewport(e,t,i){const s=this.getNullCell(r.DEFAULT_ATTR_DATA);let n=i;for(;n-- >0;)0===this.ybase?(this.y>0&&this.y--,this.lines.length=0;a--){let h=this.lines.get(a);if(!h||!h.isWrapped&&h.getTrimmedLength()<=e)continue;const c=[h];for(;h.isWrapped&&a>0;)h=this.lines.get(--a),c.unshift(h);const l=this.ybase+this.y;if(l>=a&&l0&&(s.push({start:a+c.length+n,newLines:g}),n+=g.length),c.push(...g);let p=d.length-1,v=d[p];0===v&&(p--,v=d[p]);let b=c.length-f-1,S=_;for(;b>=0;){const e=Math.min(S,v);if(void 0===c[p])break;if(c[p].copyCellsFrom(c[b],S-e,v-e,e,!0),v-=e,0===v&&(p--,v=d[p]),S-=e,0===S){b--;const e=Math.max(b,0);S=(0,o.getWrappedLineTrimmedLength)(c,e,this._cols)}}for(let t=0;t0;)0===this.ybase?this.y0){const e=[],t=[];for(let e=0;e=0;c--)if(o&&o.start>r+h){for(let e=o.newLines.length-1;e>=0;e--)this.lines.set(c--,o.newLines[e]);c++,e.push({index:r+1,amount:o.newLines.length}),h+=o.newLines.length,o=s[++a]}else this.lines.set(c,t[r--]);let c=0;for(let t=e.length-1;t>=0;t--)e[t].index+=c,this.lines.onInsertEmitter.fire(e[t]),c+=e[t].amount;const l=Math.max(0,i+n-this.lines.maxLength);l>0&&this.lines.onTrimEmitter.fire(l)}}stringIndexToBufferIndex(e,t,i=!1){for(;t;){const s=this.lines.get(e);if(!s)return[-1,-1];const r=i?s.getTrimmedLength():s.length;for(let i=0;i0&&this.lines.get(t).isWrapped;)t--;for(;i+10;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(null==e&&(e=this.x);!this.tabs[++e]&&e=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t{t.line-=e,t.line<0&&t.dispose()}))),t.register(this.lines.onInsert((e=>{t.line>=e.index&&(t.line+=e.amount)}))),t.register(this.lines.onDelete((e=>{t.line>=e.index&&t.linee.index&&(t.line-=e.amount)}))),t.register(t.onDispose((()=>this._removeMarker(t)))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}iterator(e,t,i,s,r){return new _(this,e,t,i,s,r)}};class _{constructor(e,t,i=0,s=e.lines.length,r=0,n=0){this._buffer=e,this._trimRight=t,this._startIndex=i,this._endIndex=s,this._startOverscan=r,this._endOverscan=n,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}hasNext(){return this._currentthis._endIndex+this._endOverscan&&(e.last=this._endIndex+this._endOverscan),e.first=Math.max(e.first,0),e.last=Math.min(e.last,this._buffer.lines.length);let t="";for(let i=e.first;i<=e.last;++i)t+=this._buffer.translateBufferLineToString(i,this._trimRight);return this._current=e.last+1,{range:e,content:t}}}t.BufferStringIterator=_},437:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLine=t.DEFAULT_ATTR_DATA=void 0;const s=i(482),r=i(643),n=i(511),a=i(734);t.DEFAULT_ATTR_DATA=Object.freeze(new a.AttributeData);let o=0;class h{constructor(e,t,i=!1){this.isWrapped=i,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);const s=t||n.CellData.fromCharData([0,r.NULL_CELL_CHAR,r.NULL_CELL_WIDTH,r.NULL_CELL_CODE]);for(let t=0;t>22,2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):i]}set(e,t){this._data[3*e+1]=t[r.CHAR_DATA_ATTR_INDEX],t[r.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e]=t[1],this._data[3*e+0]=2097152|e|t[r.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=t[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|t[r.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(e){return this._data[3*e+0]>>22}hasWidth(e){return 12582912&this._data[3*e+0]}getFg(e){return this._data[3*e+1]}getBg(e){return this._data[3*e+2]}hasContent(e){return 4194303&this._data[3*e+0]}getCodePoint(e){const t=this._data[3*e+0];return 2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&t}isCombined(e){return 2097152&this._data[3*e+0]}getString(e){const t=this._data[3*e+0];return 2097152&t?this._combined[e]:2097151&t?(0,s.stringFromCodePoint)(2097151&t):""}isProtected(e){return 536870912&this._data[3*e+2]}loadCell(e,t){return o=3*e,t.content=this._data[o+0],t.fg=this._data[o+1],t.bg=this._data[o+2],2097152&t.content&&(t.combinedData=this._combined[e]),268435456&t.bg&&(t.extended=this._extendedAttrs[e]),t}setCell(e,t){2097152&t.content&&(this._combined[e]=t.combinedData),268435456&t.bg&&(this._extendedAttrs[e]=t.extended),this._data[3*e+0]=t.content,this._data[3*e+1]=t.fg,this._data[3*e+2]=t.bg}setCellFromCodePoint(e,t,i,s,r,n){268435456&r&&(this._extendedAttrs[e]=n),this._data[3*e+0]=t|i<<22,this._data[3*e+1]=s,this._data[3*e+2]=r}addCodepointToCell(e,t){let i=this._data[3*e+0];2097152&i?this._combined[e]+=(0,s.stringFromCodePoint)(t):(2097151&i?(this._combined[e]=(0,s.stringFromCodePoint)(2097151&i)+(0,s.stringFromCodePoint)(t),i&=-2097152,i|=2097152):i=t|1<<22,this._data[3*e+0]=i)}insertCells(e,t,i,s){if((e%=this.length)&&2===this.getWidth(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null==s?void 0:s.fg)||0,(null==s?void 0:s.bg)||0,(null==s?void 0:s.extended)||new a.ExtendedAttrs),t=0;--i)this.setCell(e+t+i,this.loadCell(e+i,s));for(let s=0;sthis.length){const i=new Uint32Array(3*e);this.length&&(3*e=e&&delete this._combined[s]}}else this._data=new Uint32Array(0),this._combined={};this.length=e}}fill(e,t=!1){if(t)for(let t=0;t=0;--e)if(4194303&this._data[3*e+0])return e+(this._data[3*e+0]>>22);return 0}copyCellsFrom(e,t,i,s,r){const n=e._data;if(r)for(let r=s-1;r>=0;r--){for(let e=0;e<3;e++)this._data[3*(i+r)+e]=n[3*(t+r)+e];268435456&n[3*(t+r)+2]&&(this._extendedAttrs[i+r]=e._extendedAttrs[t+r])}else for(let r=0;r=t&&(this._combined[r-t+i]=e._combined[r])}}translateToString(e=!1,t=0,i=this.length){e&&(i=Math.min(i,this.getTrimmedLength()));let n="";for(;t>22||1}return n}}t.BufferLine=h},634:(e,t)=>{function i(e,t,i){if(t===e.length-1)return e[t].getTrimmedLength();const s=!e[t].hasContent(i-1)&&1===e[t].getWidth(i-1),r=2===e[t+1].getWidth(0);return s&&r?i-1:i}Object.defineProperty(t,"__esModule",{value:!0}),t.getWrappedLineTrimmedLength=t.reflowSmallerGetNewLineLengths=t.reflowLargerApplyNewLayout=t.reflowLargerCreateNewLayout=t.reflowLargerGetLinesToRemove=void 0,t.reflowLargerGetLinesToRemove=function(e,t,s,r,n){const a=[];for(let o=0;o=o&&r0&&(e>_||0===l[e].getTrimmedLength());e--)g++;g>0&&(a.push(o+l.length-g),a.push(g)),o+=l.length-1}return a},t.reflowLargerCreateNewLayout=function(e,t){const i=[];let s=0,r=t[s],n=0;for(let a=0;ai(e,r,t))).reduce(((e,t)=>e+t));let a=0,o=0,h=0;for(;hc&&(a-=c,o++);const l=2===e[o].getWidth(a-1);l&&a--;const _=l?s-1:s;r.push(_),h+=_}return r},t.getWrappedLineTrimmedLength=i},295:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferSet=void 0;const s=i(92),r=i(460),n=i(844);class a extends n.Disposable{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this.register(new r.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new s.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new s.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}}t.BufferSet=a},511:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;const s=i(482),r=i(643),n=i(734);class a extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(e){const t=new a;return t.setFromCharData(e),t}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,s.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[r.CHAR_DATA_ATTR_INDEX],this.bg=0;let t=!1;if(e[r.CHAR_DATA_CHAR_INDEX].length>2)t=!0;else if(2===e[r.CHAR_DATA_CHAR_INDEX].length){const i=e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=i&&i<=56319){const s=e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=s&&s<=57343?this.content=1024*(i-55296)+s-56320+65536|e[r.CHAR_DATA_WIDTH_INDEX]<<22:t=!0}else t=!0}else this.content=e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e[r.CHAR_DATA_WIDTH_INDEX]<<22;t&&(this.combinedData=e[r.CHAR_DATA_CHAR_INDEX],this.content=2097152|e[r.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=a},643:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=256,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},863:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Marker=void 0;const s=i(460),r=i(844);class n{constructor(e){this.line=e,this.isDisposed=!1,this._disposables=[],this._id=n._nextId++,this._onDispose=this.register(new s.EventEmitter),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,r.disposeArray)(this._disposables),this._disposables.length=0)}register(e){return this._disposables.push(e),e}}t.Marker=n,n._nextId=1},116:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CHARSET=t.CHARSETS=void 0,t.CHARSETS={},t.DEFAULT_CHARSET=t.CHARSETS.B,t.CHARSETS[0]={"`":"◆",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:"≥","{":"π","|":"≠","}":"£","~":"·"},t.CHARSETS.A={"#":"£"},t.CHARSETS.B=void 0,t.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},t.CHARSETS.C=t.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},t.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},t.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},t.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},t.CHARSETS.E=t.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},t.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},t.CHARSETS.H=t.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},584:(e,t)=>{var i,s;Object.defineProperty(t,"__esModule",{value:!0}),t.C1_ESCAPED=t.C1=t.C0=void 0,function(e){e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="",e.BS="\b",e.HT="\t",e.LF="\n",e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""}(i=t.C0||(t.C0={})),(s=t.C1||(t.C1={})).PAD="€",s.HOP="",s.BPH="‚",s.NBH="ƒ",s.IND="„",s.NEL="…",s.SSA="†",s.ESA="‡",s.HTS="ˆ",s.HTJ="‰",s.VTS="Š",s.PLD="‹",s.PLU="Œ",s.RI="",s.SS2="Ž",s.SS3="",s.DCS="",s.PU1="‘",s.PU2="’",s.STS="“",s.CCH="”",s.MW="•",s.SPA="–",s.EPA="—",s.SOS="˜",s.SGCI="™",s.SCI="š",s.CSI="›",s.ST="œ",s.OSC="",s.PM="ž",s.APC="Ÿ",(t.C1_ESCAPED||(t.C1_ESCAPED={})).ST=`${i.ESC}\\`},482:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)},t.utf32ToString=function(e,t=0,i=e.length){let s="";for(let r=t;r65535?(t-=65536,s+=String.fromCharCode(55296+(t>>10))+String.fromCharCode(t%1024+56320)):s+=String.fromCharCode(t)}return s},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){const i=e.length;if(!i)return 0;let s=0,r=0;if(this._interim){const i=e.charCodeAt(r++);56320<=i&&i<=57343?t[s++]=1024*(this._interim-55296)+i-56320+65536:(t[s++]=this._interim,t[s++]=i),this._interim=0}for(let n=r;n=i)return this._interim=r,s;const a=e.charCodeAt(n);56320<=a&&a<=57343?t[s++]=1024*(r-55296)+a-56320+65536:(t[s++]=r,t[s++]=a)}else 65279!==r&&(t[s++]=r)}return s}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){const i=e.length;if(!i)return 0;let s,r,n,a,o=0,h=0,c=0;if(this.interim[0]){let s=!1,r=this.interim[0];r&=192==(224&r)?31:224==(240&r)?15:7;let n,a=0;for(;(n=63&this.interim[++a])&&a<4;)r<<=6,r|=n;const h=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,l=h-a;for(;c=i)return 0;if(n=e[c++],128!=(192&n)){c--,s=!0;break}this.interim[a++]=n,r<<=6,r|=63&n}s||(2===h?r<128?c--:t[o++]=r:3===h?r<2048||r>=55296&&r<=57343||65279===r||(t[o++]=r):r<65536||r>1114111||(t[o++]=r)),this.interim.fill(0)}const l=i-4;let _=c;for(;_=i)return this.interim[0]=s,o;if(r=e[_++],128!=(192&r)){_--;continue}if(h=(31&s)<<6|63&r,h<128){_--;continue}t[o++]=h}else if(224==(240&s)){if(_>=i)return this.interim[0]=s,o;if(r=e[_++],128!=(192&r)){_--;continue}if(_>=i)return this.interim[0]=s,this.interim[1]=r,o;if(n=e[_++],128!=(192&n)){_--;continue}if(h=(15&s)<<12|(63&r)<<6|63&n,h<2048||h>=55296&&h<=57343||65279===h)continue;t[o++]=h}else if(240==(248&s)){if(_>=i)return this.interim[0]=s,o;if(r=e[_++],128!=(192&r)){_--;continue}if(_>=i)return this.interim[0]=s,this.interim[1]=r,o;if(n=e[_++],128!=(192&n)){_--;continue}if(_>=i)return this.interim[0]=s,this.interim[1]=r,this.interim[2]=n,o;if(a=e[_++],128!=(192&a)){_--;continue}if(h=(7&s)<<18|(63&r)<<12|(63&n)<<6|63&a,h<65536||h>1114111)continue;t[o++]=h}}return o}}},225:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeV6=void 0;const s=i(273),r=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],n=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let a;t.UnicodeV6=class{constructor(){if(this.version="6",!a){a=new Uint8Array(65536),(0,s.fill)(a,1),a[0]=0,(0,s.fill)(a,0,1,32),(0,s.fill)(a,0,127,160),(0,s.fill)(a,2,4352,4448),a[9001]=2,a[9002]=2,(0,s.fill)(a,2,11904,42192),a[12351]=1,(0,s.fill)(a,2,44032,55204),(0,s.fill)(a,2,63744,64256),(0,s.fill)(a,2,65040,65050),(0,s.fill)(a,2,65072,65136),(0,s.fill)(a,2,65280,65377),(0,s.fill)(a,2,65504,65511);for(let e=0;et[r][1])return!1;for(;r>=s;)if(i=s+r>>1,e>t[i][1])s=i+1;else{if(!(e=131072&&e<=196605||e>=196608&&e<=262141?2:1}}},981:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WriteBuffer=void 0;const s=i(460),r=i(844);class n extends r.Disposable{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new s.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(void 0!==t&&this._syncCalls>t)return void(this._syncCalls=0);if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let i;for(this._isSyncWriting=!0;i=this._writeBuffer.shift();){this._action(i);const e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){const i=e||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const e=this._writeBuffer[this._bufferOffset],s=this._action(e,t);if(s){const e=e=>Date.now()-i>=12?setTimeout((()=>this._innerWrite(0,e))):this._innerWrite(i,e);return void s.catch((e=>(queueMicrotask((()=>{throw e})),Promise.resolve(!1)))).then(e)}const r=this._callbacks[this._bufferOffset];if(r&&r(),this._bufferOffset++,this._pendingData-=e.length,Date.now()-i>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}t.WriteBuffer=n},941:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.toRgbString=t.parseColor=void 0;const i=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,s=/^[\da-f]+$/;function r(e,t){const i=e.toString(16),s=i.length<2?"0"+i:i;switch(t){case 4:return i[0];case 8:return s;case 12:return(s+s).slice(0,3);default:return s+s}}t.parseColor=function(e){if(!e)return;let t=e.toLowerCase();if(0===t.indexOf("rgb:")){t=t.slice(4);const e=i.exec(t);if(e){const t=e[1]?15:e[4]?255:e[7]?4095:65535;return[Math.round(parseInt(e[1]||e[4]||e[7]||e[10],16)/t*255),Math.round(parseInt(e[2]||e[5]||e[8]||e[11],16)/t*255),Math.round(parseInt(e[3]||e[6]||e[9]||e[12],16)/t*255)]}}else if(0===t.indexOf("#")&&(t=t.slice(1),s.exec(t)&&[3,6,9,12].includes(t.length))){const e=t.length/3,i=[0,0,0];for(let s=0;s<3;++s){const r=parseInt(t.slice(e*s,e*s+e),16);i[s]=1===e?r<<4:2===e?r:3===e?r>>4:r>>8}return i}},t.toRgbString=function(e,t=16){const[i,s,n]=e;return`rgb:${r(i,t)}/${r(s,t)}/${r(n,t)}`}},770:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PAYLOAD_LIMIT=void 0,t.PAYLOAD_LIMIT=1e7},351:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DcsHandler=t.DcsParser=void 0;const s=i(482),r=i(742),n=i(770),a=[];t.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=a,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=a}registerHandler(e,t){void 0===this._handlers[e]&&(this._handlers[e]=[]);const i=this._handlers[e];return i.push(t),{dispose:()=>{const e=i.indexOf(t);-1!==e&&i.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=a,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||a,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(t);else this._handlerFb(this._ident,"HOOK",t)}put(e,t,i){if(this._active.length)for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,i);else this._handlerFb(this._ident,"PUT",(0,s.utf32ToString)(e,t,i))}unhook(e,t=!0){if(this._active.length){let i=!1,s=this._active.length-1,r=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=t,r=this._stack.fallThrough,this._stack.paused=!1),!r&&!1===i){for(;s>=0&&(i=this._active[s].unhook(e),!0!==i);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].unhook(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}else this._handlerFb(this._ident,"UNHOOK",e);this._active=a,this._ident=0}};const o=new r.Params;o.addParam(0),t.DcsHandler=class{constructor(e){this._handler=e,this._data="",this._params=o,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():o,this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=(0,s.utf32ToString)(e,t,i),this._data.length>n.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then((e=>(this._params=o,this._data="",this._hitLimit=!1,e)));return this._params=o,this._data="",this._hitLimit=!1,t}}},15:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EscapeSequenceParser=t.VT500_TRANSITION_TABLE=t.TransitionTable=void 0;const s=i(844),r=i(273),n=i(742),a=i(242),o=i(351);class h{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){(0,r.fill)(this.table,e<<4|t)}add(e,t,i,s){this.table[t<<8|e]=i<<4|s}addMany(e,t,i,s){for(let r=0;rt)),i=(e,i)=>t.slice(e,i),s=i(32,127),r=i(0,24);r.push(25),r.push.apply(r,i(28,32));const n=i(0,14);let a;for(a in e.setDefault(1,0),e.addMany(s,0,2,0),n)e.addMany([24,26,153,154],a,3,0),e.addMany(i(128,144),a,3,0),e.addMany(i(144,152),a,3,0),e.add(156,a,0,0),e.add(27,a,11,1),e.add(157,a,4,8),e.addMany([152,158,159],a,0,7),e.add(155,a,11,3),e.add(144,a,11,9);return e.addMany(r,0,3,0),e.addMany(r,1,3,1),e.add(127,1,0,1),e.addMany(r,8,0,8),e.addMany(r,3,3,3),e.add(127,3,0,3),e.addMany(r,4,3,4),e.add(127,4,0,4),e.addMany(r,6,3,6),e.addMany(r,5,3,5),e.add(127,5,0,5),e.addMany(r,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(s,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(i(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(s,7,0,7),e.addMany(r,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(i(64,127),3,7,0),e.addMany(i(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(i(48,60),4,8,4),e.addMany(i(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(i(32,64),6,0,6),e.add(127,6,0,6),e.addMany(i(64,127),6,0,0),e.addMany(i(32,48),3,9,5),e.addMany(i(32,48),5,9,5),e.addMany(i(48,64),5,0,6),e.addMany(i(64,127),5,7,0),e.addMany(i(32,48),4,9,5),e.addMany(i(32,48),1,9,2),e.addMany(i(32,48),2,9,2),e.addMany(i(48,127),2,10,0),e.addMany(i(48,80),1,10,0),e.addMany(i(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(i(96,127),1,10,0),e.add(80,1,11,9),e.addMany(r,9,0,9),e.add(127,9,0,9),e.addMany(i(28,32),9,0,9),e.addMany(i(32,48),9,9,12),e.addMany(i(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(r,11,0,11),e.addMany(i(32,128),11,0,11),e.addMany(i(28,32),11,0,11),e.addMany(r,10,0,10),e.add(127,10,0,10),e.addMany(i(28,32),10,0,10),e.addMany(i(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(i(32,48),10,9,12),e.addMany(r,12,0,12),e.add(127,12,0,12),e.addMany(i(28,32),12,0,12),e.addMany(i(32,48),12,9,12),e.addMany(i(48,64),12,0,11),e.addMany(i(64,127),12,12,13),e.addMany(i(64,127),10,12,13),e.addMany(i(64,127),9,12,13),e.addMany(r,13,13,13),e.addMany(s,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(c,0,2,0),e.add(c,8,5,8),e.add(c,6,0,6),e.add(c,11,0,11),e.add(c,13,13,13),e}();class l extends s.Disposable{constructor(e=t.VT500_TRANSITION_TABLE){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new n.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(e,t,i)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,t)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,s.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new a.OscParser),this._dcsParser=this.register(new o.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(e,t=[64,126]){let i=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(i=e.prefix.charCodeAt(0),i&&60>i||i>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let t=0;ts||s>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");i<<=8,i|=s}}if(1!==e.final.length)throw new Error("final must be a single byte");const s=e.final.charCodeAt(0);if(t[0]>s||s>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return i<<=8,i|=s,i}identToString(e){const t=[];for(;e;)t.push(String.fromCharCode(255&e)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){const i=this._identifier(e,[48,126]);void 0===this._escHandlers[i]&&(this._escHandlers[i]=[]);const s=this._escHandlers[i];return s.push(t),{dispose:()=>{const e=s.indexOf(t);-1!==e&&s.splice(e,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){const i=this._identifier(e);void 0===this._csiHandlers[i]&&(this._csiHandlers[i]=[]);const s=this._csiHandlers[i];return s.push(t),{dispose:()=>{const e=s.indexOf(t);-1!==e&&s.splice(e,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,0!==this._parseStack.state&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,i,s,r){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=i,this._parseStack.transition=s,this._parseStack.chunkPos=r}parse(e,t,i){let s,r=0,n=0,a=0;if(this._parseStack.state)if(2===this._parseStack.state)this._parseStack.state=0,a=this._parseStack.chunkPos+1;else{if(void 0===i||1===this._parseStack.state)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const t=this._parseStack.handlers;let n=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(!1===i&&n>-1)for(;n>=0&&(s=t[n](this._params),!0!==s);n--)if(s instanceof Promise)return this._parseStack.handlerPos=n,s;this._parseStack.handlers=[];break;case 4:if(!1===i&&n>-1)for(;n>=0&&(s=t[n](),!0!==s);n--)if(s instanceof Promise)return this._parseStack.handlerPos=n,s;this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],s=this._dcsParser.unhook(24!==r&&26!==r,i),s)return s;27===r&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(r=e[this._parseStack.chunkPos],s=this._oscParser.end(24!==r&&26!==r,i),s)return s;27===r&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,a=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let i=a;i>4){case 2:for(let s=i+1;;++s){if(s>=t||(r=e[s])<32||r>126&&r=t||(r=e[s])<32||r>126&&r=t||(r=e[s])<32||r>126&&r=t||(r=e[s])<32||r>126&&r=0&&(s=a[o](this._params),!0!==s);o--)if(s instanceof Promise)return this._preserveStack(3,a,o,n,i),s;o<0&&this._csiHandlerFb(this._collect<<8|r,this._params),this.precedingCodepoint=0;break;case 8:do{switch(r){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(r-48)}}while(++i47&&r<60);i--;break;case 9:this._collect<<=8,this._collect|=r;break;case 10:const h=this._escHandlers[this._collect<<8|r];let l=h?h.length-1:-1;for(;l>=0&&(s=h[l](),!0!==s);l--)if(s instanceof Promise)return this._preserveStack(4,h,l,n,i),s;l<0&&this._escHandlerFb(this._collect<<8|r),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|r,this._params);break;case 13:for(let s=i+1;;++s)if(s>=t||24===(r=e[s])||26===r||27===r||r>127&&r=t||(r=e[s])<32||r>127&&r{Object.defineProperty(t,"__esModule",{value:!0}),t.OscHandler=t.OscParser=void 0;const s=i(770),r=i(482),n=[];t.OscParser=class{constructor(){this._state=0,this._active=n,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){void 0===this._handlers[e]&&(this._handlers[e]=[]);const i=this._handlers[e];return i.push(t),{dispose:()=>{const e=i.indexOf(t);-1!==e&&i.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=n}reset(){if(2===this._state)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=n,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||n,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].start();else this._handlerFb(this._id,"START")}_put(e,t,i){if(this._active.length)for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,i);else this._handlerFb(this._id,"PUT",(0,r.utf32ToString)(e,t,i))}start(){this.reset(),this._state=1}put(e,t,i){if(3!==this._state){if(1===this._state)for(;t0&&this._put(e,t,i)}}end(e,t=!0){if(0!==this._state){if(3!==this._state)if(1===this._state&&this._start(),this._active.length){let i=!1,s=this._active.length-1,r=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=t,r=this._stack.fallThrough,this._stack.paused=!1),!r&&!1===i){for(;s>=0&&(i=this._active[s].end(e),!0!==i);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].end(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}else this._handlerFb(this._id,"END",e);this._active=n,this._id=-1,this._state=0}}},t.OscHandler=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=(0,r.utf32ToString)(e,t,i),this._data.length>s.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then((e=>(this._data="",this._hitLimit=!1,e)));return this._data="",this._hitLimit=!1,t}}},742:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Params=void 0;const i=2147483647;class s{constructor(e=32,t=32){if(this.maxLength=e,this.maxSubParamsLength=t,t>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(t),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(e){const t=new s;if(!e.length)return t;for(let i=Array.isArray(e[0])?1:0;i>8,s=255&this._subParamsIdx[t];s-i>0&&e.push(Array.prototype.slice.call(this._subParams,i,s))}return e}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>i?i:e}}addSubParam(e){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=e>i?i:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return(255&this._subParamsIdx[e])-(this._subParamsIdx[e]>>8)>0}getSubParams(e){const t=this._subParamsIdx[e]>>8,i=255&this._subParamsIdx[e];return i-t>0?this._subParams.subarray(t,i):null}getSubParamsAll(){const e={};for(let t=0;t>8,s=255&this._subParamsIdx[t];s-i>0&&(e[t]=this._subParams.slice(i,s))}return e}addDigit(e){let t;if(this._rejectDigits||!(t=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const s=this._digitIsSub?this._subParams:this.params,r=s[t-1];s[t-1]=~r?Math.min(10*r+e,i):e}}t.Params=s},741:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AddonManager=void 0,t.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){const i={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(i),t.dispose=()=>this._wrappedAddonDispose(i),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let i=0;i{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferApiView=void 0;const s=i(785),r=i(511);t.BufferApiView=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){const t=this._buffer.lines.get(e);if(t)return new s.BufferLineApiView(t)}getNullCell(){return new r.CellData}}},785:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLineApiView=void 0;const s=i(511);t.BufferLineApiView=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new s.CellData)}translateToString(e,t,i){return this._line.translateToString(e,t,i)}}},285:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferNamespaceApi=void 0;const s=i(771),r=i(460);t.BufferNamespaceApi=class{constructor(e){this._core=e,this._onBufferChange=new r.EventEmitter,this.onBufferChange=this._onBufferChange.event,this._normal=new s.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new s.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}},975:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ParserApi=void 0,t.ParserApi=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,(e=>t(e.toArray())))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,((e,i)=>t(e,i.toArray())))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}}},90:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeApi=void 0,t.UnicodeApi=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}}},744:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferService=t.MINIMUM_ROWS=t.MINIMUM_COLS=void 0;const n=i(585),a=i(295),o=i(460),h=i(844);t.MINIMUM_COLS=2,t.MINIMUM_ROWS=1;let c=class extends h.Disposable{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this.register(new o.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new o.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,t.MINIMUM_COLS),this.rows=Math.max(e.rawOptions.rows||0,t.MINIMUM_ROWS),this.buffers=this.register(new a.BufferSet(e,this))}get buffer(){return this.buffers.active}resize(e,t){this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){const i=this.buffer;let s;s=this._cachedBlankLine,s&&s.length===this.cols&&s.getFg(0)===e.fg&&s.getBg(0)===e.bg||(s=i.getBlankLine(e,t),this._cachedBlankLine=s),s.isWrapped=t;const r=i.ybase+i.scrollTop,n=i.ybase+i.scrollBottom;if(0===i.scrollTop){const e=i.lines.isFull;n===i.lines.length-1?e?i.lines.recycle().copyFrom(s):i.lines.push(s.clone()):i.lines.splice(n+1,0,s.clone()),e?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{const e=n-r+1;i.lines.shiftElements(r+1,e-1,-1),i.lines.set(n,s.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(e,t,i){const s=this.buffer;if(e<0){if(0===s.ydisp)return;this.isUserScrolling=!0}else e+s.ydisp>=s.ybase&&(this.isUserScrolling=!1);const r=s.ydisp;s.ydisp=Math.max(Math.min(s.ydisp+e,s.ybase),0),r!==s.ydisp&&(t||this._onScroll.fire(s.ydisp))}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this.buffer.ydisp)}scrollToBottom(){this.scrollLines(this.buffer.ybase-this.buffer.ydisp)}scrollToLine(e){const t=e-this.buffer.ydisp;0!==t&&this.scrollLines(t)}};c=s([r(0,n.IOptionsService)],c),t.BufferService=c},994:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CharsetService=void 0,t.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}}},753:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreMouseService=void 0;const n=i(585),a=i(460),o=i(844),h={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>4!==e.button&&1===e.action&&(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>32!==e.action},DRAG:{events:23,restrict:e=>32!==e.action||3!==e.button},ANY:{events:31,restrict:e=>!0}};function c(e,t){let i=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return 4===e.button?(i|=64,i|=e.action):(i|=3&e.button,4&e.button&&(i|=64),8&e.button&&(i|=128),32===e.action?i|=32:0!==e.action||t||(i|=3)),i}const l=String.fromCharCode,_={DEFAULT:e=>{const t=[c(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`${l(t[0])}${l(t[1])}${l(t[2])}`},SGR:e=>{const t=0===e.action&&4!==e.button?"m":"M";return`[<${c(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{const t=0===e.action&&4!==e.button?"m":"M";return`[<${c(e,!0)};${e.x};${e.y}${t}`}};let d=class extends o.Disposable{constructor(e,t){super(),this._bufferService=e,this._coreService=t,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new a.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const e of Object.keys(h))this.addProtocol(e,h[e]);for(const e of Object.keys(_))this.addEncoding(e,_[e]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return 0!==this._protocols[this._activeProtocol].events}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows)return!1;if(4===e.button&&32===e.action)return!1;if(3===e.button&&32!==e.action)return!1;if(4!==e.button&&(2===e.action||3===e.action))return!1;if(e.col++,e.row++,32===e.action&&this._lastEvent&&this._equalEvents(this._lastEvent,e,"SGR_PIXELS"===this._activeEncoding))return!1;if(!this._protocols[this._activeProtocol].restrict(e))return!1;const t=this._encodings[this._activeEncoding](e);return t&&("DEFAULT"===this._activeEncoding?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(1&e),up:!!(2&e),drag:!!(4&e),move:!!(8&e),wheel:!!(16&e)}}_equalEvents(e,t,i){if(i){if(e.x!==t.x)return!1;if(e.y!==t.y)return!1}else{if(e.col!==t.col)return!1;if(e.row!==t.row)return!1}return e.button===t.button&&e.action===t.action&&e.ctrl===t.ctrl&&e.alt===t.alt&&e.shift===t.shift}};d=s([r(0,n.IBufferService),r(1,n.ICoreService)],d),t.CoreMouseService=d},83:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreService=void 0;const n=i(585),a=i(460),o=i(439),h=i(844),c=Object.freeze({insertMode:!1}),l=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let _=class extends h.Disposable{constructor(e,t,i,s){super(),this._bufferService=t,this._logService=i,this._optionsService=s,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new a.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new a.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new a.EventEmitter),this.onBinary=this._onBinary.event,this._scrollToBottom=e,this.register({dispose:()=>this._scrollToBottom=void 0}),this.modes=(0,o.clone)(c),this.decPrivateModes=(0,o.clone)(l)}reset(){this.modes=(0,o.clone)(c),this.decPrivateModes=(0,o.clone)(l)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;const i=this._bufferService.buffer;i.ybase!==i.ydisp&&this._scrollToBottom(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`,(()=>e.split("").map((e=>e.charCodeAt(0))))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`,(()=>e.split("").map((e=>e.charCodeAt(0))))),this._onBinary.fire(e))}};_=s([r(1,n.IBufferService),r(2,n.ILogService),r(3,n.IOptionsService)],_),t.CoreService=_},348:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InstantiationService=t.ServiceCollection=void 0;const s=i(585),r=i(343);class n{constructor(...e){this._entries=new Map;for(const[t,i]of e)this.set(t,i)}set(e,t){const i=this._entries.get(e);return this._entries.set(e,t),i}forEach(e){for(const[t,i]of this._entries.entries())e(t,i)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}}t.ServiceCollection=n,t.InstantiationService=class{constructor(){this._services=new n,this._services.set(s.IInstantiationService,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){const i=(0,r.getServiceDependencies)(e).sort(((e,t)=>e.index-t.index)),s=[];for(const t of i){const i=this._services.get(t.id);if(!i)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${t.id}.`);s.push(i)}const n=i.length>0?i[0].index:t.length;if(t.length!==n)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${n+1} conflicts with ${t.length} static arguments`);return new e(...[...t,...s])}}},866:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.LogService=void 0;const n=i(844),a=i(585),o={debug:a.LogLevelEnum.DEBUG,info:a.LogLevelEnum.INFO,warn:a.LogLevelEnum.WARN,error:a.LogLevelEnum.ERROR,off:a.LogLevelEnum.OFF};let h=class extends n.Disposable{constructor(e){super(),this._optionsService=e,this.logLevel=a.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel())))}_updateLogLevel(){this.logLevel=o[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t{Object.defineProperty(t,"__esModule",{value:!0}),t.OptionsService=t.DEFAULT_OPTIONS=void 0;const s=i(460),r=i(114),n=i(844);t.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",scrollback:1e3,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:r.isMac,windowOptions:{},windowsMode:!1,wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const a=["normal","bold","100","200","300","400","500","600","700","800","900"];class o extends n.Disposable{constructor(e){super(),this._onOptionChange=this.register(new s.EventEmitter),this.onOptionChange=this._onOptionChange.event;const i=Object.assign({},t.DEFAULT_OPTIONS);for(const t in e)if(t in i)try{const s=e[t];i[t]=this._sanitizeAndValidateOption(t,s)}catch(e){console.error(e)}this.rawOptions=i,this.options=Object.assign({},i),this._setupOptions()}onSpecificOptionChange(e,t){return this.onOptionChange((i=>{i===e&&t(this.rawOptions[e])}))}onMultipleOptionChange(e,t){return this.onOptionChange((i=>{-1!==e.indexOf(i)&&t()}))}_setupOptions(){const e=e=>{if(!(e in t.DEFAULT_OPTIONS))throw new Error(`No option with key "${e}"`);return this.rawOptions[e]},i=(e,i)=>{if(!(e in t.DEFAULT_OPTIONS))throw new Error(`No option with key "${e}"`);i=this._sanitizeAndValidateOption(e,i),this.rawOptions[e]!==i&&(this.rawOptions[e]=i,this._onOptionChange.fire(e))};for(const t in this.rawOptions){const s={get:e.bind(this,t),set:i.bind(this,t)};Object.defineProperty(this.options,t,s)}}_sanitizeAndValidateOption(e,i){switch(e){case"cursorStyle":if(i||(i=t.DEFAULT_OPTIONS[e]),!function(e){return"block"===e||"underline"===e||"bar"===e}(i))throw new Error(`"${i}" is not a valid value for ${e}`);break;case"wordSeparator":i||(i=t.DEFAULT_OPTIONS[e]);break;case"fontWeight":case"fontWeightBold":if("number"==typeof i&&1<=i&&i<=1e3)break;i=a.includes(i)?i:t.DEFAULT_OPTIONS[e];break;case"cursorWidth":i=Math.floor(i);case"lineHeight":case"tabStopWidth":if(i<1)throw new Error(`${e} cannot be less than 1, value: ${i}`);break;case"minimumContrastRatio":i=Math.max(1,Math.min(21,Math.round(10*i)/10));break;case"scrollback":if((i=Math.min(i,4294967295))<0)throw new Error(`${e} cannot be less than 0, value: ${i}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(i<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${i}`);case"rows":case"cols":if(!i&&0!==i)throw new Error(`${e} must be numeric, value: ${i}`)}return i}}t.OptionsService=o},660:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkService=void 0;const n=i(585);let a=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){const t=this._bufferService.buffer;if(void 0===e.id){const i=t.addMarker(t.ybase+t.y),s={data:e,id:this._nextId++,lines:[i]};return i.onDispose((()=>this._removeMarkerFromLink(s,i))),this._dataByLinkId.set(s.id,s),s.id}const i=e,s=this._getEntryIdKey(i),r=this._entriesWithId.get(s);if(r)return this.addLineToLink(r.id,t.ybase+t.y),r.id;const n=t.addMarker(t.ybase+t.y),a={id:this._nextId++,key:this._getEntryIdKey(i),data:i,lines:[n]};return n.onDispose((()=>this._removeMarkerFromLink(a,n))),this._entriesWithId.set(a.key,a),this._dataByLinkId.set(a.id,a),a.id}addLineToLink(e,t){const i=this._dataByLinkId.get(e);if(i&&i.lines.every((e=>e.line!==t))){const e=this._bufferService.buffer.addMarker(t);i.lines.push(e),e.onDispose((()=>this._removeMarkerFromLink(i,e)))}}getLinkData(e){var t;return null===(t=this._dataByLinkId.get(e))||void 0===t?void 0:t.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){const i=e.lines.indexOf(t);-1!==i&&(e.lines.splice(i,1),0===e.lines.length&&(void 0!==e.data.id&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};a=s([r(0,n.IBufferService)],a),t.OscLinkService=a},343:(e,t)=>{function i(e,t,i){t.di$target===t?t.di$dependencies.push({id:e,index:i}):(t.di$dependencies=[{id:e,index:i}],t.di$target=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0,t.serviceRegistry=new Map,t.getServiceDependencies=function(e){return e.di$dependencies||[]},t.createDecorator=function(e){if(t.serviceRegistry.has(e))return t.serviceRegistry.get(e);const s=function(e,t,r){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");i(s,e,r)};return s.toString=()=>e,t.serviceRegistry.set(e,s),s}},585:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;const s=i(343);var r;t.IBufferService=(0,s.createDecorator)("BufferService"),t.ICoreMouseService=(0,s.createDecorator)("CoreMouseService"),t.ICoreService=(0,s.createDecorator)("CoreService"),t.ICharsetService=(0,s.createDecorator)("CharsetService"),t.IInstantiationService=(0,s.createDecorator)("InstantiationService"),(r=t.LogLevelEnum||(t.LogLevelEnum={}))[r.DEBUG=0]="DEBUG",r[r.INFO=1]="INFO",r[r.WARN=2]="WARN",r[r.ERROR=3]="ERROR",r[r.OFF=4]="OFF",t.ILogService=(0,s.createDecorator)("LogService"),t.IOptionsService=(0,s.createDecorator)("OptionsService"),t.IOscLinkService=(0,s.createDecorator)("OscLinkService"),t.IUnicodeService=(0,s.createDecorator)("UnicodeService"),t.IDecorationService=(0,s.createDecorator)("DecorationService")},480:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeService=void 0;const s=i(460),r=i(225);t.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new s.EventEmitter,this.onChange=this._onChange.event;const e=new r.UnicodeV6;this.register(e),this._active=e.version,this._activeProvider=e}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw new Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(e){let t=0;const i=e.length;for(let s=0;s=i)return t+this.wcwidth(r);const n=e.charCodeAt(s);56320<=n&&n<=57343?r=1024*(r-55296)+n-56320+65536:t+=this.wcwidth(n)}t+=this.wcwidth(r)}return t}}},781:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Terminal=void 0;const s=i(437),r=i(969),n=i(460);class a extends r.CoreTerminal{constructor(e={}){super(e),this._onBell=this.register(new n.EventEmitter),this.onBell=this._onBell.event,this._onCursorMove=this.register(new n.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onTitleChange=this.register(new n.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onA11yCharEmitter=this.register(new n.EventEmitter),this.onA11yChar=this._onA11yCharEmitter.event,this._onA11yTabEmitter=this.register(new n.EventEmitter),this.onA11yTab=this._onA11yTabEmitter.event,this._setup(),this.register(this._inputHandler.onRequestBell((()=>this.bell()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register((0,n.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,n.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,n.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,n.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter))}get options(){return this.optionsService.options}get buffer(){return this.buffers.active}get markers(){return this.buffer.markers}addMarker(e){if(this.buffer===this.buffers.normal)return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}bell(){this._onBell.fire()}resize(e,t){e===this.cols&&t===this.rows||super.resize(e,t)}clear(){if(0!==this.buffer.ybase||0!==this.buffer.y){this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e{var e=s;Object.defineProperty(e,"__esModule",{value:!0}),e.Terminal=void 0;const t=i(285),r=i(975),n=i(90),a=i(781),o=i(741),h=["cols","rows"];e.Terminal=class{constructor(e){this._core=new a.Terminal(e),this._addonManager=new o.AddonManager,this._publicOptions=Object.assign({},this._core.options);const t=e=>this._core.options[e],i=(e,t)=>{this._checkReadonlyOptions(e),this._core.options[e]=t};for(const e in this._core.options){Object.defineProperty(this._publicOptions,e,{get:()=>this._core.options[e],set:t=>{this._checkReadonlyOptions(e),this._core.options[e]=t}});const s={get:t.bind(this,e),set:i.bind(this,e)};Object.defineProperty(this._publicOptions,e,s)}}_checkReadonlyOptions(e){if(h.includes(e))throw new Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.options.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onLineFeed(){return this._core.onLineFeed}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onTitleChange(){return this._core.onTitleChange}get parser(){return this._checkProposedApi(),this._parser||(this._parser=new r.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new n.UnicodeApi(this._core)}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._checkProposedApi(),this._buffer||(this._buffer=new t.BufferNamespaceApi(this._core)),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const e=this._core.coreService.decPrivateModes;let t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any"}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(const t in e)this._publicOptions[t]=e[t]}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}registerMarker(e=0){return this._checkProposedApi(),this._verifyIntegers(e),this._core.addMarker(e)}addMarker(e){return this.registerMarker(e)}dispose(){this._addonManager.dispose(),this._core.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write("\r\n",t)}reset(){this._core.reset()}loadAddon(e){return this._addonManager.loadAddon(this,e)}_verifyIntegers(...e){for(const t of e)if(t===1/0||isNaN(t)||t%1!=0)throw new Error("This API only accepts integers")}}})();var r=exports;for(var n in s)r[n]=s[n];s.__esModule&&Object.defineProperty(r,"__esModule",{value:!0})})();//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/xterm-headless/lib-headless/xterm-headless.js.mapvar fs = require("fs"); var zlib = require("zlib"); var fd_slicer = require("fd-slicer"); var crc32 = require("buffer-crc32"); var util = require("util"); var EventEmitter = require("events").EventEmitter; var Transform = require("stream").Transform; var PassThrough = require("stream").PassThrough; var Writable = require("stream").Writable; exports.open = open; exports.fromFd = fromFd; exports.fromBuffer = fromBuffer; exports.fromRandomAccessReader = fromRandomAccessReader; exports.dosDateTimeToDate = dosDateTimeToDate; exports.validateFileName = validateFileName; exports.ZipFile = ZipFile; exports.Entry = Entry; exports.RandomAccessReader = RandomAccessReader; function open(path, options, callback) { if (typeof options === "function") { callback = options; options = null; } if (options == null) options = {}; if (options.autoClose == null) options.autoClose = true; if (options.lazyEntries == null) options.lazyEntries = false; if (options.decodeStrings == null) options.decodeStrings = true; if (options.validateEntrySizes == null) options.validateEntrySizes = true; if (options.strictFileNames == null) options.strictFileNames = false; if (callback == null) callback = defaultCallback; fs.open(path, "r", function(err, fd) { if (err) return callback(err); fromFd(fd, options, function(err, zipfile) { if (err) fs.close(fd, defaultCallback); callback(err, zipfile); }); }); } function fromFd(fd, options, callback) { if (typeof options === "function") { callback = options; options = null; } if (options == null) options = {}; if (options.autoClose == null) options.autoClose = false; if (options.lazyEntries == null) options.lazyEntries = false; if (options.decodeStrings == null) options.decodeStrings = true; if (options.validateEntrySizes == null) options.validateEntrySizes = true; if (options.strictFileNames == null) options.strictFileNames = false; if (callback == null) callback = defaultCallback; fs.fstat(fd, function(err, stats) { if (err) return callback(err); var reader = fd_slicer.createFromFd(fd, {autoClose: true}); fromRandomAccessReader(reader, stats.size, options, callback); }); } function fromBuffer(buffer, options, callback) { if (typeof options === "function") { callback = options; options = null; } if (options == null) options = {}; options.autoClose = false; if (options.lazyEntries == null) options.lazyEntries = false; if (options.decodeStrings == null) options.decodeStrings = true; if (options.validateEntrySizes == null) options.validateEntrySizes = true; if (options.strictFileNames == null) options.strictFileNames = false; // limit the max chunk size. see https://github.com/thejoshwolfe/yauzl/issues/87 var reader = fd_slicer.createFromBuffer(buffer, {maxChunkSize: 0x10000}); fromRandomAccessReader(reader, buffer.length, options, callback); } function fromRandomAccessReader(reader, totalSize, options, callback) { if (typeof options === "function") { callback = options; options = null; } if (options == null) options = {}; if (options.autoClose == null) options.autoClose = true; if (options.lazyEntries == null) options.lazyEntries = false; if (options.decodeStrings == null) options.decodeStrings = true; var decodeStrings = !!options.decodeStrings; if (options.validateEntrySizes == null) options.validateEntrySizes = true; if (options.strictFileNames == null) options.strictFileNames = false; if (callback == null) callback = defaultCallback; if (typeof totalSize !== "number") throw new Error("expected totalSize parameter to be a number"); if (totalSize > Number.MAX_SAFE_INTEGER) { throw new Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double."); } // the matching unref() call is in zipfile.close() reader.ref(); // eocdr means End of Central Directory Record. // search backwards for the eocdr signature. // the last field of the eocdr is a variable-length comment. // the comment size is encoded in a 2-byte field in the eocdr, which we can't find without trudging backwards through the comment to find it. // as a consequence of this design decision, it's possible to have ambiguous zip file metadata if a coherent eocdr was in the comment. // we search backwards for a eocdr signature, and hope that whoever made the zip file was smart enough to forbid the eocdr signature in the comment. var eocdrWithoutCommentSize = 22; var maxCommentSize = 0xffff; // 2-byte size var bufferSize = Math.min(eocdrWithoutCommentSize + maxCommentSize, totalSize); var buffer = newBuffer(bufferSize); var bufferReadStart = totalSize - buffer.length; readAndAssertNoEof(reader, buffer, 0, bufferSize, bufferReadStart, function(err) { if (err) return callback(err); for (var i = bufferSize - eocdrWithoutCommentSize; i >= 0; i -= 1) { if (buffer.readUInt32LE(i) !== 0x06054b50) continue; // found eocdr var eocdrBuffer = buffer.slice(i); // 0 - End of central directory signature = 0x06054b50 // 4 - Number of this disk var diskNumber = eocdrBuffer.readUInt16LE(4); if (diskNumber !== 0) { return callback(new Error("multi-disk zip files are not supported: found disk number: " + diskNumber)); } // 6 - Disk where central directory starts // 8 - Number of central directory records on this disk // 10 - Total number of central directory records var entryCount = eocdrBuffer.readUInt16LE(10); // 12 - Size of central directory (bytes) // 16 - Offset of start of central directory, relative to start of archive var centralDirectoryOffset = eocdrBuffer.readUInt32LE(16); // 20 - Comment length var commentLength = eocdrBuffer.readUInt16LE(20); var expectedCommentLength = eocdrBuffer.length - eocdrWithoutCommentSize; if (commentLength !== expectedCommentLength) { return callback(new Error("invalid comment length. expected: " + expectedCommentLength + ". found: " + commentLength)); } // 22 - Comment // the encoding is always cp437. var comment = decodeStrings ? decodeBuffer(eocdrBuffer, 22, eocdrBuffer.length, false) : eocdrBuffer.slice(22); if (!(entryCount === 0xffff || centralDirectoryOffset === 0xffffffff)) { return callback(null, new ZipFile(reader, centralDirectoryOffset, totalSize, entryCount, comment, options.autoClose, options.lazyEntries, decodeStrings, options.validateEntrySizes, options.strictFileNames)); } // ZIP64 format // ZIP64 Zip64 end of central directory locator var zip64EocdlBuffer = newBuffer(20); var zip64EocdlOffset = bufferReadStart + i - zip64EocdlBuffer.length; readAndAssertNoEof(reader, zip64EocdlBuffer, 0, zip64EocdlBuffer.length, zip64EocdlOffset, function(err) { if (err) return callback(err); // 0 - zip64 end of central dir locator signature = 0x07064b50 if (zip64EocdlBuffer.readUInt32LE(0) !== 0x07064b50) { return callback(new Error("invalid zip64 end of central directory locator signature")); } // 4 - number of the disk with the start of the zip64 end of central directory // 8 - relative offset of the zip64 end of central directory record var zip64EocdrOffset = readUInt64LE(zip64EocdlBuffer, 8); // 16 - total number of disks // ZIP64 end of central directory record var zip64EocdrBuffer = newBuffer(56); readAndAssertNoEof(reader, zip64EocdrBuffer, 0, zip64EocdrBuffer.length, zip64EocdrOffset, function(err) { if (err) return callback(err); // 0 - zip64 end of central dir signature 4 bytes (0x06064b50) if (zip64EocdrBuffer.readUInt32LE(0) !== 0x06064b50) { return callback(new Error("invalid zip64 end of central directory record signature")); } // 4 - size of zip64 end of central directory record 8 bytes // 12 - version made by 2 bytes // 14 - version needed to extract 2 bytes // 16 - number of this disk 4 bytes // 20 - number of the disk with the start of the central directory 4 bytes // 24 - total number of entries in the central directory on this disk 8 bytes // 32 - total number of entries in the central directory 8 bytes entryCount = readUInt64LE(zip64EocdrBuffer, 32); // 40 - size of the central directory 8 bytes // 48 - offset of start of central directory with respect to the starting disk number 8 bytes centralDirectoryOffset = readUInt64LE(zip64EocdrBuffer, 48); // 56 - zip64 extensible data sector (variable size) return callback(null, new ZipFile(reader, centralDirectoryOffset, totalSize, entryCount, comment, options.autoClose, options.lazyEntries, decodeStrings, options.validateEntrySizes, options.strictFileNames)); }); }); return; } callback(new Error("end of central directory record signature not found")); }); } util.inherits(ZipFile, EventEmitter); function ZipFile(reader, centralDirectoryOffset, fileSize, entryCount, comment, autoClose, lazyEntries, decodeStrings, validateEntrySizes, strictFileNames) { var self = this; EventEmitter.call(self); self.reader = reader; // forward close events self.reader.on("error", function(err) { // error closing the fd emitError(self, err); }); self.reader.once("close", function() { self.emit("close"); }); self.readEntryCursor = centralDirectoryOffset; self.fileSize = fileSize; self.entryCount = entryCount; self.comment = comment; self.entriesRead = 0; self.autoClose = !!autoClose; self.lazyEntries = !!lazyEntries; self.decodeStrings = !!decodeStrings; self.validateEntrySizes = !!validateEntrySizes; self.strictFileNames = !!strictFileNames; self.isOpen = true; self.emittedError = false; if (!self.lazyEntries) self._readEntry(); } ZipFile.prototype.close = function() { if (!this.isOpen) return; this.isOpen = false; this.reader.unref(); }; function emitErrorAndAutoClose(self, err) { if (self.autoClose) self.close(); emitError(self, err); } function emitError(self, err) { if (self.emittedError) return; self.emittedError = true; self.emit("error", err); } ZipFile.prototype.readEntry = function() { if (!this.lazyEntries) throw new Error("readEntry() called without lazyEntries:true"); this._readEntry(); }; ZipFile.prototype._readEntry = function() { var self = this; if (self.entryCount === self.entriesRead) { // done with metadata setImmediate(function() { if (self.autoClose) self.close(); if (self.emittedError) return; self.emit("end"); }); return; } if (self.emittedError) return; var buffer = newBuffer(46); readAndAssertNoEof(self.reader, buffer, 0, buffer.length, self.readEntryCursor, function(err) { if (err) return emitErrorAndAutoClose(self, err); if (self.emittedError) return; var entry = new Entry(); // 0 - Central directory file header signature var signature = buffer.readUInt32LE(0); if (signature !== 0x02014b50) return emitErrorAndAutoClose(self, new Error("invalid central directory file header signature: 0x" + signature.toString(16))); // 4 - Version made by entry.versionMadeBy = buffer.readUInt16LE(4); // 6 - Version needed to extract (minimum) entry.versionNeededToExtract = buffer.readUInt16LE(6); // 8 - General purpose bit flag entry.generalPurposeBitFlag = buffer.readUInt16LE(8); // 10 - Compression method entry.compressionMethod = buffer.readUInt16LE(10); // 12 - File last modification time entry.lastModFileTime = buffer.readUInt16LE(12); // 14 - File last modification date entry.lastModFileDate = buffer.readUInt16LE(14); // 16 - CRC-32 entry.crc32 = buffer.readUInt32LE(16); // 20 - Compressed size entry.compressedSize = buffer.readUInt32LE(20); // 24 - Uncompressed size entry.uncompressedSize = buffer.readUInt32LE(24); // 28 - File name length (n) entry.fileNameLength = buffer.readUInt16LE(28); // 30 - Extra field length (m) entry.extraFieldLength = buffer.readUInt16LE(30); // 32 - File comment length (k) entry.fileCommentLength = buffer.readUInt16LE(32); // 34 - Disk number where file starts // 36 - Internal file attributes entry.internalFileAttributes = buffer.readUInt16LE(36); // 38 - External file attributes entry.externalFileAttributes = buffer.readUInt32LE(38); // 42 - Relative offset of local file header entry.relativeOffsetOfLocalHeader = buffer.readUInt32LE(42); if (entry.generalPurposeBitFlag & 0x40) return emitErrorAndAutoClose(self, new Error("strong encryption is not supported")); self.readEntryCursor += 46; buffer = newBuffer(entry.fileNameLength + entry.extraFieldLength + entry.fileCommentLength); readAndAssertNoEof(self.reader, buffer, 0, buffer.length, self.readEntryCursor, function(err) { if (err) return emitErrorAndAutoClose(self, err); if (self.emittedError) return; // 46 - File name var isUtf8 = (entry.generalPurposeBitFlag & 0x800) !== 0; entry.fileName = self.decodeStrings ? decodeBuffer(buffer, 0, entry.fileNameLength, isUtf8) : buffer.slice(0, entry.fileNameLength); // 46+n - Extra field var fileCommentStart = entry.fileNameLength + entry.extraFieldLength; var extraFieldBuffer = buffer.slice(entry.fileNameLength, fileCommentStart); entry.extraFields = []; var i = 0; while (i < extraFieldBuffer.length - 3) { var headerId = extraFieldBuffer.readUInt16LE(i + 0); var dataSize = extraFieldBuffer.readUInt16LE(i + 2); var dataStart = i + 4; var dataEnd = dataStart + dataSize; if (dataEnd > extraFieldBuffer.length) return emitErrorAndAutoClose(self, new Error("extra field length exceeds extra field buffer size")); var dataBuffer = newBuffer(dataSize); extraFieldBuffer.copy(dataBuffer, 0, dataStart, dataEnd); entry.extraFields.push({ id: headerId, data: dataBuffer, }); i = dataEnd; } // 46+n+m - File comment entry.fileComment = self.decodeStrings ? decodeBuffer(buffer, fileCommentStart, fileCommentStart + entry.fileCommentLength, isUtf8) : buffer.slice(fileCommentStart, fileCommentStart + entry.fileCommentLength); // compatibility hack for https://github.com/thejoshwolfe/yauzl/issues/47 entry.comment = entry.fileComment; self.readEntryCursor += buffer.length; self.entriesRead += 1; if (entry.uncompressedSize === 0xffffffff || entry.compressedSize === 0xffffffff || entry.relativeOffsetOfLocalHeader === 0xffffffff) { // ZIP64 format // find the Zip64 Extended Information Extra Field var zip64EiefBuffer = null; for (var i = 0; i < entry.extraFields.length; i++) { var extraField = entry.extraFields[i]; if (extraField.id === 0x0001) { zip64EiefBuffer = extraField.data; break; } } if (zip64EiefBuffer == null) { return emitErrorAndAutoClose(self, new Error("expected zip64 extended information extra field")); } var index = 0; // 0 - Original Size 8 bytes if (entry.uncompressedSize === 0xffffffff) { if (index + 8 > zip64EiefBuffer.length) { return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include uncompressed size")); } entry.uncompressedSize = readUInt64LE(zip64EiefBuffer, index); index += 8; } // 8 - Compressed Size 8 bytes if (entry.compressedSize === 0xffffffff) { if (index + 8 > zip64EiefBuffer.length) { return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include compressed size")); } entry.compressedSize = readUInt64LE(zip64EiefBuffer, index); index += 8; } // 16 - Relative Header Offset 8 bytes if (entry.relativeOffsetOfLocalHeader === 0xffffffff) { if (index + 8 > zip64EiefBuffer.length) { return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include relative header offset")); } entry.relativeOffsetOfLocalHeader = readUInt64LE(zip64EiefBuffer, index); index += 8; } // 24 - Disk Start Number 4 bytes } // check for Info-ZIP Unicode Path Extra Field (0x7075) // see https://github.com/thejoshwolfe/yauzl/issues/33 if (self.decodeStrings) { for (var i = 0; i < entry.extraFields.length; i++) { var extraField = entry.extraFields[i]; if (extraField.id === 0x7075) { if (extraField.data.length < 6) { // too short to be meaningful continue; } // Version 1 byte version of this extra field, currently 1 if (extraField.data.readUInt8(0) !== 1) { // > Changes may not be backward compatible so this extra // > field should not be used if the version is not recognized. continue; } // NameCRC32 4 bytes File Name Field CRC32 Checksum var oldNameCrc32 = extraField.data.readUInt32LE(1); if (crc32.unsigned(buffer.slice(0, entry.fileNameLength)) !== oldNameCrc32) { // > If the CRC check fails, this UTF-8 Path Extra Field should be // > ignored and the File Name field in the header should be used instead. continue; } // UnicodeName Variable UTF-8 version of the entry File Name entry.fileName = decodeBuffer(extraField.data, 5, extraField.data.length, true); break; } } } // validate file size if (self.validateEntrySizes && entry.compressionMethod === 0) { var expectedCompressedSize = entry.uncompressedSize; if (entry.isEncrypted()) { // traditional encryption prefixes the file data with a header expectedCompressedSize += 12; } if (entry.compressedSize !== expectedCompressedSize) { var msg = "compressed/uncompressed size mismatch for stored file: " + entry.compressedSize + " != " + entry.uncompressedSize; return emitErrorAndAutoClose(self, new Error(msg)); } } if (self.decodeStrings) { if (!self.strictFileNames) { // allow backslash entry.fileName = entry.fileName.replace(/\\/g, "/"); } var errorMessage = validateFileName(entry.fileName, self.validateFileNameOptions); if (errorMessage != null) return emitErrorAndAutoClose(self, new Error(errorMessage)); } self.emit("entry", entry); if (!self.lazyEntries) self._readEntry(); }); }); }; ZipFile.prototype.openReadStream = function(entry, options, callback) { var self = this; // parameter validation var relativeStart = 0; var relativeEnd = entry.compressedSize; if (callback == null) { callback = options; options = {}; } else { // validate options that the caller has no excuse to get wrong if (options.decrypt != null) { if (!entry.isEncrypted()) { throw new Error("options.decrypt can only be specified for encrypted entries"); } if (options.decrypt !== false) throw new Error("invalid options.decrypt value: " + options.decrypt); if (entry.isCompressed()) { if (options.decompress !== false) throw new Error("entry is encrypted and compressed, and options.decompress !== false"); } } if (options.decompress != null) { if (!entry.isCompressed()) { throw new Error("options.decompress can only be specified for compressed entries"); } if (!(options.decompress === false || options.decompress === true)) { throw new Error("invalid options.decompress value: " + options.decompress); } } if (options.start != null || options.end != null) { if (entry.isCompressed() && options.decompress !== false) { throw new Error("start/end range not allowed for compressed entry without options.decompress === false"); } if (entry.isEncrypted() && options.decrypt !== false) { throw new Error("start/end range not allowed for encrypted entry without options.decrypt === false"); } } if (options.start != null) { relativeStart = options.start; if (relativeStart < 0) throw new Error("options.start < 0"); if (relativeStart > entry.compressedSize) throw new Error("options.start > entry.compressedSize"); } if (options.end != null) { relativeEnd = options.end; if (relativeEnd < 0) throw new Error("options.end < 0"); if (relativeEnd > entry.compressedSize) throw new Error("options.end > entry.compressedSize"); if (relativeEnd < relativeStart) throw new Error("options.end < options.start"); } } // any further errors can either be caused by the zipfile, // or were introduced in a minor version of yauzl, // so should be passed to the client rather than thrown. if (!self.isOpen) return callback(new Error("closed")); if (entry.isEncrypted()) { if (options.decrypt !== false) return callback(new Error("entry is encrypted, and options.decrypt !== false")); } // make sure we don't lose the fd before we open the actual read stream self.reader.ref(); var buffer = newBuffer(30); readAndAssertNoEof(self.reader, buffer, 0, buffer.length, entry.relativeOffsetOfLocalHeader, function(err) { try { if (err) return callback(err); // 0 - Local file header signature = 0x04034b50 var signature = buffer.readUInt32LE(0); if (signature !== 0x04034b50) { return callback(new Error("invalid local file header signature: 0x" + signature.toString(16))); } // all this should be redundant // 4 - Version needed to extract (minimum) // 6 - General purpose bit flag // 8 - Compression method // 10 - File last modification time // 12 - File last modification date // 14 - CRC-32 // 18 - Compressed size // 22 - Uncompressed size // 26 - File name length (n) var fileNameLength = buffer.readUInt16LE(26); // 28 - Extra field length (m) var extraFieldLength = buffer.readUInt16LE(28); // 30 - File name // 30+n - Extra field var localFileHeaderEnd = entry.relativeOffsetOfLocalHeader + buffer.length + fileNameLength + extraFieldLength; var decompress; if (entry.compressionMethod === 0) { // 0 - The file is stored (no compression) decompress = false; } else if (entry.compressionMethod === 8) { // 8 - The file is Deflated decompress = options.decompress != null ? options.decompress : true; } else { return callback(new Error("unsupported compression method: " + entry.compressionMethod)); } var fileDataStart = localFileHeaderEnd; var fileDataEnd = fileDataStart + entry.compressedSize; if (entry.compressedSize !== 0) { // bounds check now, because the read streams will probably not complain loud enough. // since we're dealing with an unsigned offset plus an unsigned size, // we only have 1 thing to check for. if (fileDataEnd > self.fileSize) { return callback(new Error("file data overflows file bounds: " + fileDataStart + " + " + entry.compressedSize + " > " + self.fileSize)); } } var readStream = self.reader.createReadStream({ start: fileDataStart + relativeStart, end: fileDataStart + relativeEnd, }); var endpointStream = readStream; if (decompress) { var destroyed = false; var inflateFilter = zlib.createInflateRaw(); readStream.on("error", function(err) { // setImmediate here because errors can be emitted during the first call to pipe() setImmediate(function() { if (!destroyed) inflateFilter.emit("error", err); }); }); readStream.pipe(inflateFilter); if (self.validateEntrySizes) { endpointStream = new AssertByteCountStream(entry.uncompressedSize); inflateFilter.on("error", function(err) { // forward zlib errors to the client-visible stream setImmediate(function() { if (!destroyed) endpointStream.emit("error", err); }); }); inflateFilter.pipe(endpointStream); } else { // the zlib filter is the client-visible stream endpointStream = inflateFilter; } // this is part of yauzl's API, so implement this function on the client-visible stream endpointStream.destroy = function() { destroyed = true; if (inflateFilter !== endpointStream) inflateFilter.unpipe(endpointStream); readStream.unpipe(inflateFilter); // TODO: the inflateFilter may cause a memory leak. see Issue #27. readStream.destroy(); }; } callback(null, endpointStream); } finally { self.reader.unref(); } }); }; function Entry() { } Entry.prototype.getLastModDate = function() { return dosDateTimeToDate(this.lastModFileDate, this.lastModFileTime); }; Entry.prototype.isEncrypted = function() { return (this.generalPurposeBitFlag & 0x1) !== 0; }; Entry.prototype.isCompressed = function() { return this.compressionMethod === 8; }; function dosDateTimeToDate(date, time) { var day = date & 0x1f; // 1-31 var month = (date >> 5 & 0xf) - 1; // 1-12, 0-11 var year = (date >> 9 & 0x7f) + 1980; // 0-128, 1980-2108 var millisecond = 0; var second = (time & 0x1f) * 2; // 0-29, 0-58 (even numbers) var minute = time >> 5 & 0x3f; // 0-59 var hour = time >> 11 & 0x1f; // 0-23 return new Date(year, month, day, hour, minute, second, millisecond); } function validateFileName(fileName) { if (fileName.indexOf("\\") !== -1) { return "invalid characters in fileName: " + fileName; } if (/^[a-zA-Z]:/.test(fileName) || /^\//.test(fileName)) { return "absolute path: " + fileName; } if (fileName.split("/").indexOf("..") !== -1) { return "invalid relative path: " + fileName; } // all good return null; } function readAndAssertNoEof(reader, buffer, offset, length, position, callback) { if (length === 0) { // fs.read will throw an out-of-bounds error if you try to read 0 bytes from a 0 byte file return setImmediate(function() { callback(null, newBuffer(0)); }); } reader.read(buffer, offset, length, position, function(err, bytesRead) { if (err) return callback(err); if (bytesRead < length) { return callback(new Error("unexpected EOF")); } callback(); }); } util.inherits(AssertByteCountStream, Transform); function AssertByteCountStream(byteCount) { Transform.call(this); this.actualByteCount = 0; this.expectedByteCount = byteCount; } AssertByteCountStream.prototype._transform = function(chunk, encoding, cb) { this.actualByteCount += chunk.length; if (this.actualByteCount > this.expectedByteCount) { var msg = "too many bytes in the stream. expected " + this.expectedByteCount + ". got at least " + this.actualByteCount; return cb(new Error(msg)); } cb(null, chunk); }; AssertByteCountStream.prototype._flush = function(cb) { if (this.actualByteCount < this.expectedByteCount) { var msg = "not enough bytes in the stream. expected " + this.expectedByteCount + ". got only " + this.actualByteCount; return cb(new Error(msg)); } cb(); }; util.inherits(RandomAccessReader, EventEmitter); function RandomAccessReader() { EventEmitter.call(this); this.refCount = 0; } RandomAccessReader.prototype.ref = function() { this.refCount += 1; }; RandomAccessReader.prototype.unref = function() { var self = this; self.refCount -= 1; if (self.refCount > 0) return; if (self.refCount < 0) throw new Error("invalid unref"); self.close(onCloseDone); function onCloseDone(err) { if (err) return self.emit('error', err); self.emit('close'); } }; RandomAccessReader.prototype.createReadStream = function(options) { var start = options.start; var end = options.end; if (start === end) { var emptyStream = new PassThrough(); setImmediate(function() { emptyStream.end(); }); return emptyStream; } var stream = this._readStreamForRange(start, end); var destroyed = false; var refUnrefFilter = new RefUnrefFilter(this); stream.on("error", function(err) { setImmediate(function() { if (!destroyed) refUnrefFilter.emit("error", err); }); }); refUnrefFilter.destroy = function() { stream.unpipe(refUnrefFilter); refUnrefFilter.unref(); stream.destroy(); }; var byteCounter = new AssertByteCountStream(end - start); refUnrefFilter.on("error", function(err) { setImmediate(function() { if (!destroyed) byteCounter.emit("error", err); }); }); byteCounter.destroy = function() { destroyed = true; refUnrefFilter.unpipe(byteCounter); refUnrefFilter.destroy(); }; return stream.pipe(refUnrefFilter).pipe(byteCounter); }; RandomAccessReader.prototype._readStreamForRange = function(start, end) { throw new Error("not implemented"); }; RandomAccessReader.prototype.read = function(buffer, offset, length, position, callback) { var readStream = this.createReadStream({start: position, end: position + length}); var writeStream = new Writable(); var written = 0; writeStream._write = function(chunk, encoding, cb) { chunk.copy(buffer, offset + written, 0, chunk.length); written += chunk.length; cb(); }; writeStream.on("finish", callback); readStream.on("error", function(error) { callback(error); }); readStream.pipe(writeStream); }; RandomAccessReader.prototype.close = function(callback) { setImmediate(callback); }; util.inherits(RefUnrefFilter, PassThrough); function RefUnrefFilter(context) { PassThrough.call(this); this.context = context; this.context.ref(); this.unreffedYet = false; } RefUnrefFilter.prototype._flush = function(cb) { this.unref(); cb(); }; RefUnrefFilter.prototype.unref = function(cb) { if (this.unreffedYet) return; this.unreffedYet = true; this.context.unref(); }; var cp437 = '\u0000☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ '; function decodeBuffer(buffer, start, end, isUtf8) { if (isUtf8) { return buffer.toString("utf8", start, end); } else { var result = ""; for (var i = start; i < end; i++) { result += cp437[buffer[i]]; } return result; } } function readUInt64LE(buffer, offset) { // there is no native function for this, because we can't actually store 64-bit integers precisely. // after 53 bits, JavaScript's Number type (IEEE 754 double) can't store individual integers anymore. // but since 53 bits is a whole lot more than 32 bits, we do our best anyway. var lower32 = buffer.readUInt32LE(offset); var upper32 = buffer.readUInt32LE(offset + 4); // we can't use bitshifting here, because JavaScript bitshifting only works on 32-bit integers. return upper32 * 0x100000000 + lower32; // as long as we're bounds checking the result of this function against the total file size, // we'll catch any overflow errors, because we already made sure the total file size was within reason. } // Node 10 deprecated new Buffer(). var newBuffer; if (typeof Buffer.allocUnsafe === "function") { newBuffer = function(len) { return Buffer.allocUnsafe(len); }; } else { newBuffer = function(len) { return new Buffer(len); }; } function defaultCallback(err) { if (err) throw err; } The MIT License (MIT) Copyright (c) 2014 Josh Wolfe Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "yauzl", "version": "2.10.0", "description": "yet another unzip library for node", "main": "index.js", "scripts": { "test": "node test/test.js", "test-cov": "istanbul cover test/test.js", "test-travis": "istanbul cover --report lcovonly test/test.js" }, "repository": { "type": "git", "url": "https://github.com/thejoshwolfe/yauzl.git" }, "keywords": [ "unzip", "zip", "stream", "archive", "file" ], "author": "Josh Wolfe ", "license": "MIT", "bugs": { "url": "https://github.com/thejoshwolfe/yauzl/issues" }, "homepage": "https://github.com/thejoshwolfe/yauzl", "dependencies": { "fd-slicer": "~1.1.0", "buffer-crc32": "~0.2.3" }, "devDependencies": { "bl": "~1.0.0", "istanbul": "~0.3.4", "pend": "~1.2.0" }, "files": [ "index.js" ] } #!/bin/bash set -e OPENSSL_VERSION="1.1.1n" OPENSSL_DIR="$(pwd)/vendor/openssl" if [ -d $OPENSSL_DIR ] then echo "Skipping, vendor/openssl already exists" exit 0 fi cd vendor # Download from openssl curl -O "https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz" # Unpack tar -xf "openssl-$OPENSSL_VERSION.tar.gz" && mv "openssl-$OPENSSL_VERSION" openssl rm "openssl-$OPENSSL_VERSION.tar.gz" # Build cd openssl TEMP_SYSTEM=$SYSTEM unset SYSTEM if [[ $AS == *"arm-linux-gnueabihf"* ]]; then ./Configure linux-generic32 elif [[ $AS == *"aarch64-linux-gnu"* ]]; then ./Configure linux-aarch64 elif [[ $OSTYPE == "darwin"* ]]; then if [[ $1 == "arm64" ]]; then ./Configure darwin64-arm64-cc else ./config fi else ./config $1 fi make SYSTEM=$TEMP_SYSTEM MIT License Copyright (c) Microsoft Corporation. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE { "name": "vscode-encrypt", "version": "1.0.0", "description": "Encryption for VSCode", "main": "lib/index.js", "typings": "vscode-encrypt.d.ts", "author": "", "scripts": { "test": "mocha test/test.js", "prepublish": "tsc", "watch": "tsc -w", "lint": "tslint lib/*.ts typings/*.ts *.ts" }, "gypfile": true, "dependencies": { "node-addon-api": "^3.0.2", "node-gyp": "^9.0.0" }, "devDependencies": { "@types/mocha": "2.2.48", "@types/node": "^12.11.7", "mocha": "^3.5.3", "tslint": "^6.1.1", "typescript": "^3.8.3" } } ## Security Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below. ## Reporting Security Issues **Please do not report security vulnerabilities through public GitHub issues.** Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) * Full paths of source file(s) related to the manifestation of the issue * The location of the affected source code (tag/branch/commit or direct URL) * Any special configuration required to reproduce the issue * Step-by-step instructions to reproduce the issue * Proof-of-concept or exploit code (if possible) * Impact of the issue, including how an attacker might exploit the issue This information will help us triage your report more quickly. If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. ## Preferred Languages We prefer all communications to be in English. ## Policy Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). { "compilerOptions": { "module": "commonjs", "target": "es6", "sourceMap": true, "noImplicitReturns": true, "noUnusedLocals": true, "noImplicitThis": true, "alwaysStrict": true } } { "rules": { "array-type": [ true, "array" ], "class-name": true, "comment-format": [ true, "check-space" ], "curly": [ true, "ignore-same-line" ], "indent": [ true, "spaces" ], "interface-name": [ true, "always-prefix" ], "interface-over-type-literal": true, "typedef": [ true, "call-signature", "parameter" ], "eofline": true, "no-duplicate-imports": true, "no-eval": true, "no-internal-module": true, "no-trailing-whitespace": true, "one-variable-per-declaration": true, "no-unsafe-finally": true, "no-var-keyword": true, "prefer-const": true, "quotemark": [ true, "single" ], "semicolon": [ true, "always" ], "triple-equals": [ true, "allow-null-check" ], "typedef-whitespace": [ true, { "call-signature": "nospace", "index-signature": "nospace", "parameter": "nospace", "property-declaration": "nospace", "variable-declaration": "nospace" } ], "variable-name": [ true, "ban-keywords", "check-format", "allow-leading-underscore" ], "whitespace": [ true, "check-branch", "check-decl", "check-module", "check-operator", "check-rest-spread", "check-separator", "check-type", "check-type-operator", "check-preblock" ] } }stages: - stage: Windows pool: vmImage: windows-latest jobs: - job: win_x64 variables: VSCODE_ARCH: x64 steps: - template: windows.yml - job: win_ia32 variables: VSCODE_ARCH: ia32 steps: - template: windows.yml - stage: Linux dependsOn: [] pool: vmImage: "Ubuntu-18.04" jobs: - job: linux_x64 variables: VSCODE_ARCH: x64 steps: - template: posix.yml - stage: Mac dependsOn: [] pool: vmImage: macOS-latest jobs: - job: mac_x64 variables: VSCODE_ARCH: x64 steps: - template: posix.yml trigger: branches: include: - mainsteps: - task: NodeTool@0 inputs: versionSpec: "16.x" - script: | set -e npm install -g node-gyp@latest node-gyp --version displayName: Update node-gyp condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'arm64')) - script: | set -e export npm_config_arch="$(VSCODE_ARCH)" yarn displayName: Install Dependencies - script: | set -e yarn prepublish displayName: Build - script: | set -e yarn test displayName: Run Tests condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64')) - script: | set -e curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin" displayName: Install Rust - script: | set -e cargo test --features vendored-openssl displayName: Test Rust Bindings workingDirectory: rs - script: | set -e cargo test displayName: Test Rust Native workingDirectory: rs-pure steps: - task: NodeTool@0 inputs: versionSpec: "16.x" - task: UsePythonVersion@0 inputs: versionSpec: '3.x' addToPath: true - powershell: | $env:npm_config_arch="$(VSCODE_ARCH)" yarn displayName: Install Dependencies - powershell: | yarn prepublish displayName: Build - powershell: | yarn test displayName: Run Tests condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64')) - script: | curl -sSf -o rustup-init.exe https://win.rustup.rs rustup-init.exe -y --profile minimal set PATH=%PATH%;%USERPROFILE%\.cargo\bin echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin" displayName: Install Rust - script: cargo test --features vendored-openssl displayName: Test Rust Bindings workingDirectory: rs - script: cargo test displayName: Test Rust Native workingDirectory: rs-pure "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.decrypt = exports.encrypt = void 0; const addon = require('../build/Release/vscode-encrypt-native'); function encrypt(key, value) { return addon.encrypt(key, value); } exports.encrypt = encrypt; function decrypt(key, value) { return addon.decrypt(key, value); } exports.decrypt = decrypt; function getSignatureSerialNumber() { if (process.platform === 'win32') { return addon.getSignatureSerialNumber(); } else { return Promise.resolve(undefined); } } exports.getSignatureSerialNumber = getSignatureSerialNumber;fn main() { let mut cxx = cxx_build::bridge("src/lib.rs"); let base_dir = std::env::var("CARGO_MANIFEST_DIR").expect("expected manifest dir"); let out_dir = std::env::var("OUT_DIR").expect("expected out dir"); let enc_sources = format!("{}/../src", base_dir); cxx.file(format!("{}/base64.cc", enc_sources)); match std::env::var("CARGO_CFG_TARGET_OS") .expect("expected target os") .as_str() { "linux" => { include_openssl(&mut cxx); cxx.file(format!("{}/encrypt_posix.cc", enc_sources)) .define("OS_LINUX", None); } "macos" => { include_openssl(&mut cxx); cxx.file(format!("{}/encrypt_posix.cc", enc_sources)) .define("OS_MACOS", None); } "windows" => { cxx.flag("/guard:cf"); println!("cargo:rustc-link-lib=shell32"); cxx.file(format!("{}/encrypt_win.cc", enc_sources)); } os => panic!("unsupported target os {}", os), }; cxx.file("src/lib.cc") .include(enc_sources) .include(out_dir) .include(base_dir) .flag_if_supported("-std=c++14") .compile("vscode-encrypt"); } fn include_openssl(cxx: &mut cc::Build) { let openssl_includes = std::env::var("DEP_OPENSSL_INCLUDE").expect("expected openssl includes"); cxx.include(openssl_includes); if std::env::var("DEP_OPENSSL_VENDORED").is_ok() { println!("cargo:rustc-link-lib=static={}", "ssl"); println!("cargo:rustc-link-lib=static={}", "crypto"); } } [package] name = "vscode-encrypt-sys" version = "0.1.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] "cxx" = "1.0" [target."cfg(not(windows))".dependencies] openssl-sys = "0.9" [build-dependencies] cxx-build = "1.0" cc = "1.0" [features] vendored-openssl = ["openssl-sys/vendored"] [package] name = "vscode-encrypt" version = "0.1.0" edition = "2021" [dependencies] "base64" = "0.13" "sha2" = "0.10" "rand" = "0.8" "chacha20poly1305" = "0.10" "lazy_static" = "1" #include "src/lib.h" #include "encrypt.h" #include rust::Vec string_to_vec(std::string str) { rust::Vec vec; vec.reserve(str.length()); for (uint8_t c : str) { vec.push_back(c); } return vec; } rust::String encrypt(rust::Slice key, rust::Slice value) { std::string result; std::string error; bool ok = Encryption::Encrypt(std::string(key.begin(), key.end()), std::string(value.begin(), value.end()), &result, &error); if (!ok) { throw std::logic_error(error); } return rust::String(result); } rust::Vec decrypt(rust::Slice key, rust::Str value) { std::string result; std::string error; bool ok = Encryption::Decrypt(std::string(key.begin(), key.end()), std::string(value), &result, &error); if (!ok) { throw std::logic_error(error); } return string_to_vec(result); } #pragma once #include "encrypt.h" #include "rust/cxx.h" rust::String encrypt(rust::Slice key, rust::Slice value); rust::Vec decrypt(rust::Slice key, rust::Str value); #[cxx::bridge] mod ffi { unsafe extern "C++" { include!("src/lib.h"); fn encrypt(key: &[u8], value: &[u8]) -> Result; fn decrypt(key: &[u8], value: &str) -> Result>; } } pub fn encrypt(key: &[u8], value: &[u8]) -> Result { ffi::encrypt(key, value).map_err(|e| Error(format!("error during encryption: {}", e))) } pub fn decrypt(key: &[u8], value: &str) -> Result, Error> { ffi::decrypt(key, value).map_err(|e| Error(format!("error during decryption: {}", e))) } #[derive(Debug)] pub struct Error(String); impl std::error::Error for Error { fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { None } } impl std::fmt::Display for Error { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.write_str(&self.0) } } #[cfg(test)] mod test { #[test] fn test_round_trips() { let input = &b"hello world!"[..]; let key = &b"salt"[..]; let encrypted = super::encrypt(key, input).expect("expected to encrypt"); assert_ne!(encrypted, String::from_utf8_lossy(input)); let decrypted = super::decrypt(key, &encrypted).expect("expected to decrypt"); assert_eq!(&decrypted, input); } } use chacha20poly1305::{ aead::{Aead, KeyInit}, ChaCha20Poly1305, KeySizeUser, Nonce, }; use lazy_static::lazy_static; use rand::Rng; use sha2::{ digest::{FixedOutputReset, HashMarker}, Digest, Sha256, }; const SALT: [u8; 8] = [0xCF, 0x86, 0x46, 0x55, 0x69, 0x38, 0xC0, 0x71]; const NONCE_SEED_LENGTH: usize = 8; lazy_static! { static ref NONCE_SIZE: usize = Nonce::default().len(); } pub fn encrypt(key: &[u8], value: &[u8]) -> Result { let mut hashed_key = create_key(key)?; let nonce_seed: [u8; NONCE_SEED_LENGTH] = rand::thread_rng().gen::().to_be_bytes(); hashed_key.extend_from_slice(&nonce_seed); let (key, iv) = evp_bytes_to_key::( &SALT[..], &hashed_key, 1, ChaCha20Poly1305::key_size(), *NONCE_SIZE, ); let mut enc = ChaCha20Poly1305::new_from_slice(&key) .expect("expected correct key size") .encrypt(Nonce::from_slice(&iv), value) .expect("expected to encrypt"); enc.extend_from_slice(&nonce_seed); Ok(base64::encode(enc)) } pub fn decrypt(key: &[u8], value: &str) -> Result, Error> { let enc = base64::decode(value).map_err(|_| Error("Invalid base64 data".to_string()))?; if enc.len() < NONCE_SEED_LENGTH { return Err(Error("Value too short".to_string())); } let mut nonce_seed: [u8; NONCE_SEED_LENGTH] = [0; NONCE_SEED_LENGTH]; let nonce_start = enc.len() - NONCE_SEED_LENGTH; nonce_seed.copy_from_slice(&enc[nonce_start..]); let mut hashed_key = create_key(key)?; hashed_key.extend_from_slice(&nonce_seed); let (key, iv) = evp_bytes_to_key::( &SALT[..], &hashed_key, 1, ChaCha20Poly1305::key_size(), *NONCE_SIZE, ); let dec = ChaCha20Poly1305::new_from_slice(&key) .expect("expected correct key size") .decrypt(Nonce::from_slice(&iv), &enc[..nonce_start]) .map_err(|_| Error::generic())?; Ok(dec) } #[cfg(unix)] fn create_key(key: &[u8]) -> Result, Error> { let exe = std::env::current_exe().map_err(|_| Error::generic())?; let exe = exe.to_string_lossy(); let mut exe = exe.as_ref(); // SNAP is set to the directory where the snap is mounted when running in a snap package. This snap path has a version number in it // which can't be used to reliably encrypt/decrypt after a version update. to get around this, we check for the SNAP environment // variable and remove that from the process path. What’s left over is /usr/bin/code (or similar) which is perfect to be used in the encryption. // More info: https://snapcraft.io/docs/environment-variables if cfg!(target_os = "linux") { if let Ok(snap) = std::env::var("SNAP") { if exe.contains(&snap) { exe = &exe[snap.len()..]; } } } let mut hasher = Sha256::new(); hasher.update(key); hasher.update(exe.as_bytes()); Ok(hasher.finalize().to_vec()) } #[cfg(windows)] fn create_key(key: &[u8]) -> Result, Error> { let mut hasher = Sha256::new(); hasher.update(key); hasher.update(b"33000001df6bf02e92a74ab4d00000000001df"); Ok(hasher.finalize().to_vec()) } pub fn evp_bytes_to_key( salt: &[u8], data: &[u8], hashes: usize, key_bytes: usize, iv_bytes: usize, ) -> (Vec, Vec) { let byte_len = key_bytes + iv_bytes; let mut hasher = D::default(); let mut derived_key = Vec::with_capacity(byte_len); let mut block = Vec::new(); while derived_key.len() < byte_len { if !block.is_empty() { hasher.update(&block); } hasher.update(data); hasher.update(salt.as_ref()); block = hasher.finalize_reset().to_vec(); if hashes > 1 { for _ in 0..(hashes - 1) { hasher.update(&block); block = hasher.finalize_reset().to_vec(); } } derived_key.extend_from_slice(&block); } ( derived_key[0..key_bytes].to_vec(), derived_key[key_bytes..byte_len].to_vec(), ) } #[derive(Debug)] pub struct Error(String); impl Error { /// Returns a generic errror -- used in many cases to avoid leaking /// internals about waht is used for state. fn generic() -> Error { Error("Cryptography failed".to_string()) } } impl std::error::Error for Error { fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { None } } impl std::fmt::Display for Error { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.write_str(&self.0) } } #[cfg(test)] mod test { #[test] fn test_round_trips() { let input = &b"hello world!"[..]; let key = &b"salt"[..]; let encrypted = super::encrypt(key, input).expect("expected to encrypt"); assert_ne!(encrypted, String::from_utf8_lossy(input)); let decrypted = super::decrypt(key, &encrypted).expect("expected to decrypt"); assert_eq!(&decrypted, input); } #[test] fn test_does_not_reuse_nonce() { let input = &b"hello world!"[..]; let key = &b"salt"[..]; let encrypted1 = super::encrypt(key, input).expect("expected to encrypt"); let encrypted2 = super::encrypt(key, input).expect("expected to encrypt"); assert_ne!(encrypted1, encrypted2); } #[test] fn test_different_salts_encrypt_different() { let input = &b"hello world!"[..]; let encrypted = super::encrypt(&b"salt"[..], input).expect("expected to encrypt"); assert_ne!(encrypted, String::from_utf8_lossy(input)); super::decrypt(&b"pepper"[..], &encrypted).expect_err("expected *not* to decrypt"); } } { "name": "vscode-regexp-languagedetection", "version": "1.0.0", "description": "Language detection for VSCode powered by regular expressions. Trained on data from GitHub and RosettaCode.", "main": "dist/index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], "author": "Jackson Kearl " } !function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports["vscode-regexp-languagedetection"]=n():e["vscode-regexp-languagedetection"]=n()}(this,(function(){return(()=>{"use strict";var e={217:(e,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.hashString=n.NUM_BUCKETS=void 0,n.NUM_BUCKETS=512;n.hashString=(e,t=n.NUM_BUCKETS)=>{let o=3735928559;if(0===e.length)return o;for(let n=0;n{Object.defineProperty(n,"__esModule",{value:!0}),n.mainTokenizer=n.listAllTokens=n.endOfLineTokenizer=n.beginningOfLineNoWSTokenizer=n.beginningOfLineTokenizer=n.mdTokenizer=n.pyTokenizer=n.cTokenizer=n.LimitedTokenizer=n.IDTokenizer=n.DeDupTokenizer=n.MultiplexTokenizer=n.NGramRangeTokenizer=n.NGramTokenizer=n.ParseletTokenizer=void 0;class t{constructor(e){this.parselets=e;const n=e.map((e=>`(${e.matcher.source})`)).join("|");this.makeMatcher=()=>new RegExp(n,"guim")}*tokenize(e){const n=this.makeMatcher();let t;for(;t=n.exec(e);){const e=t.findIndex(((e,n)=>n&&e))-1,o=t[e+1];if(o){const r=this.parselets[e].makeToken(o,t.groups??{});void 0!==r&&(yield{token:r,startIndex:t.index,endIndex:n.lastIndex})}}}}n.ParseletTokenizer=t;class o{constructor(e,n){this.n=e,this.tokenizer=n}*tokenize(e){const n=[];for(const t of this.tokenizer.tokenize(e))if(n.push(t),n.length===this.n){let e=[n[0]];for(const t of n.slice(1)){const n=[];for(const o of e)for(const e of this.joinMatches(o,t))n.push(e);e=n}for(const n of e)yield n;n.shift()}}joinMatches(e,n){const t=new Set;return t.add(`${e.token.id} ${n.token.id}`.trim()),e.token.gId&&t.add(`${e.token.gId} ${n.token.id}`.trim()),n.token.gId&&t.add(`${e.token.id} ${n.token.gId}`.trim()),[...t.values()].map((t=>({token:{id:t,gId:`${e.token.gId} ${n.token.gId}`.trim()},startIndex:e.startIndex,endIndex:n.endIndex})))}}n.NGramTokenizer=o;class r{constructor(e,n,t){const r=[];for(let s=e;s<=n;s++)r.push(new o(s,t));this.tokenizer=new s(r)}tokenize(e){return this.tokenizer.tokenize(e)}}n.NGramRangeTokenizer=r;class s{constructor(e){this.tokenizers=e}*tokenize(e){const n=[],t=e=>{const t=e.next();if(t.value){const o=n.findIndex((({match:e})=>e.endIndex>t.value.endIndex||e.endIndex===t.value.endIndex&&e.startIndex>t.value.startIndex));-1===o?n.push({match:t.value,source:e}):n.splice(o,0,{match:t.value,source:e})}};let o;for(this.tokenizers.forEach((n=>t(n.tokenize(e))));o=n.shift();)yield o.match,t(o.source)}}n.MultiplexTokenizer=s;class i{constructor(e){this.tokenizer=e}*tokenize(e){const n=new Set;for(const t of this.tokenizer.tokenize(e))n.has(t.token.id)||(n.add(t.token.id),yield t)}}n.DeDupTokenizer=i;n.IDTokenizer=class{constructor(e){this.tokenizer=e}*tokenize(e){for(const n of this.tokenizer.tokenize(e))yield n}};class a{constructor(e,n){this.limit=e,this.tokenizer=n}*tokenize(e){let n=0;for(const t of this.tokenizer.tokenize(e))if(yield t,n++,n>this.limit)break}}n.LimitedTokenizer=a;const c=e=>n=>({gId:e,id:e,trace:n}),l=e=>n=>({gId:"",id:e,trace:n}),d={matcher:/\/\/.*$/,makeToken:l("// comment")},k={matcher:/#.*$/,makeToken:l("# comment")},m={matcher://,makeToken:l("\x3c!-- comment --\x3e")},h={matcher:/\/\*(?:[^*]|\*[^/])*\*\//,makeToken:l("/* comment */")},f={matcher:/'(?:\\'|[^'])*'/,makeToken:c("'str'")},g={matcher:/"(?:\\"|[^"])*"/,makeToken:c('"str"')},u={matcher:/`(?:\\`|[^`])*`/,makeToken:c("`str`")},p={matcher:/'''(?:[^']|'[^']|''[^'])*'''/,makeToken:c("'''str'''")},T={matcher:/"""(?:[^"]|"[^"]|""[^"])*"""/,makeToken:c('"""str"""')},z={matcher:/```(?:[^`]|`[^`]|``[^`])*```/,makeToken:c("```str```")},b={matcher:/\n/,makeToken:c("\\n")},x={matcher:/\d+?\.?|\d+/,makeToken:c("#NUM#")},v={matcher:/[_#$a-zA-Z\xA0-\uFFFF][\-_#$a-zA-Z0-9\xA0-\uFFFF]*/,makeToken:e=>({id:1===e.length?"%ID%":e,gId:"%ID%",trace:e})},I={matcher:/[~!@#\$%\^&\*\(\)\-\+=\{\}\[\]\|\\:;\?\/,.<>]+/,makeToken:e=>({id:e,gId:e,trace:e})};n.cTokenizer=new t([d,h,z,f,g,u,b,v,I,x]),n.pyTokenizer=new t([k,p,T,z,f,g,u,b,v,I,x]);const y={matcher:/$#+.*$/,makeToken:e=>{const n=e.search(/[^#]/);return c("#".repeat(n)+"h"+n)(e)}},w={matcher:/^>.*$/,makeToken:c("> Quote")},j={matcher:/^\s*\d+\. .*$/,makeToken:c("1. li")},$={matcher:/^\s*[\-] .*$/,makeToken:c("- li")},_={matcher:/!\[[^\]]*\]\([^)]+\)/,makeToken:c("![]()")},L={matcher:/\[[^\]]+\]\([^)]+\)/,makeToken:c("[]()")},O={matcher:/\*\*(?:[^*]|\*[^*])+\*\*|__(?:[^_]|_[^_])+__/,makeToken:c("__strong__")},M={matcher:/\*[^*]+\*|_[^_]+_/,makeToken:c("_em_")};n.mdTokenizer=new t([m,u,z,y,w,j,$,_,L,O,M]),n.beginningOfLineTokenizer=new t([{matcher:/^\s*(?[^\s]{1,20})/,makeToken:(e,n)=>({id:`^\\s*${n.bol}.*$`,gId:`^\\s*${n.bol}.*$`})}]),n.beginningOfLineNoWSTokenizer=new t([{matcher:/^(?[^\s]{1,20}$)/,makeToken:(e,n)=>({id:`^${n.bol}.*$`,gId:`^${n.bol}.*$`})}]),n.endOfLineTokenizer=new t([{matcher:/(?[^\s]{1,20}$)/,makeToken:(e,n)=>({id:`^.*${n.eol}$`,gId:`^.*${n.eol}$`})}]);n.listAllTokens=(e,n)=>{const t=[];for(const o of e.tokenize(n))t.push(o);return t},n.mainTokenizer=new a(5e3,new i(new s([new i(new r(1,3,n.pyTokenizer)),new i(new r(1,3,n.cTokenizer)),new i(new r(1,3,n.mdTokenizer)),new i(new r(1,3,n.beginningOfLineTokenizer)),new i(new r(1,3,n.beginningOfLineNoWSTokenizer)),new i(new r(1,3,n.endOfLineTokenizer))])))},898:(e,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.modelLangToVSCodeLang=n.languages=void 0,n.languages=["json","js","html","py","css","md","ts","php","yml","sh","cpp","sql","rs","c","java","cs","go","ps1","bat","rb","lua","mm","swift","pl","tex","scala","r","matlab","ipynb","hs","erl","coffee"],n.modelLangToVSCodeLang={ts:"typescript",rs:"rust",js:"javascript",c:"c",lua:"lua",cpp:"cpp",cs:"csharp",mm:"objective-c",html:"html",sql:"sql",swift:"swift",pl:"perl",md:"markdown",java:"java",ps1:"powershell",php:"php",go:"go",tex:"tex",scala:"scala",py:"python",r:"r",matlab:void 0,css:"css",sh:"shellscript",ipynb:void 0,bat:"bat",hs:"haskell",erl:"erlang",coffee:"coffeescript",rb:"ruby",yml:"yaml",json:"json"}},275:(e,n,t)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ReLangEx=void 0;const o=t(217),r=t(253);n.ReLangEx=(e,n,t,s=[])=>i=>{const a={},c=t?.length?t:r.model.languages;for(const{token:n}of e.tokenize(i)){const e=(0,o.hashString)(n.id,2**32);for(const t of c){const o=r.model.bigModel[t]?.[e];if(o)for(const e of c){if(t===e)continue;const i=r.model.languages.indexOf(e);if(-1===i)console.error("unknown language",e);else{o&1<e<0)).length,r=Object.entries(t).filter((([e,n])=>n<0)).map((([e,n])=>e));d.set(e,r),o<=1&&l.push({languageId:e,confidence:Object.values(t).filter((e=>e>3)).length+(n[e]??0)})}return l.filter((e=>d.get(e.languageId)?.every((e=>d.get(e).length>4)))).filter((e=>e.confidence>=Math.floor(2*c.length/3))).sort(((e,n)=>{const t=n.confidence-e.confidence;if(t)return t;return r.model.languages.indexOf(e.languageId)-r.model.languages.indexOf(n.languageId)}))}},253:(e,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.model=void 0,n.model={languages:["json","js","html","py","css","md","ts","php","yml","sh","cpp","sql","rs","c","java","cs","go","ps1","bat","rb","lua","mm","swift","pl","tex","scala","r","matlab","ipynb","hs","erl","coffee"],bigModel:{bat:{312822:1291849777,731816:-806617089,949766:-268697893,985371:1,1367043:152174601,1380234:1813067266,1515412:-285477141,1580010:-268697601,1612999:-268697601,1702777:-285475329,2397870:-285474869,2431489:1858819786,2620050:-285475093,2678873:-285474817,3346625:1073745920,3425564:257,3702987:-268697601,4168709:16777217,4589376:16777217,5045545:-285477141,5347319:-268697601,5393397:16777233,5545825:-285475349,5778795:-268697601,5989959:-285477141,6335030:1859876554,6563494:139579757,6673297:1321465538,7826548:16777216,7861904:-268699649,8063914:1073872896,8260801:16777233,8610972:-268697601,8802643:-270278657,9287911:-287574326,9400905:1859876554,9458472:-1543766017,9838846:1850963658,10119839:1859876554,11099195:-268697601,11258107:1859876554,12250825:-419709209,12315381:1848831467,12439840:-268705793,12476936:-268697601,12483064:-268697601,12988125:-285475093,12995678:-287574326,13177108:-286523393,13181756:1117271232,13186594:16777233,13600674:65544,13856407:1318811338,13937697:-839123469,13979552:-1543766025,13983794:-285474817,14070850:1746600456,14075092:1850963658,14168919:-806617105,14196082:1829767473,14196422:1859876554,14202478:-285475093,14286053:1,14510814:16777216,14539815:135266305,14670600:157516645,14739629:-268697605,14743871:-268697889,14754881:-268697617,14769321:16910449,15248546:-268697601,15368289:1830008739,15664613:1859875906,15960330:-855900445,16064360:1224738905,16081875:-268697601,16214049:16777233,16637385:1859876554,16858108:-268697601,16967961:-268697601,17011923:-268697601,17309790:1850963658,17709064:-268698497,18007004:-268697601,18012332:-268697889,18396714:1859876554,18470013:1207959617,18719931:-284044161,18745189:-928513247,18978694:16777217,19047391:-268697601,20130929:-285477686,20269483:786134730,20394471:1859876042,20507824:-335806465,20661506:1859876554,22756924:1,22960684:-268697601,23446478:1859809994,23848581:-285474833,24164978:1857219819,24315517:1859876554,24378711:-268699649,25672434:1715725955,26043143:1859876554,26928764:-268697605,27132030:1100178576,27449578:-806617105,27453463:-285474817,27985268:-287574334,27992837:1318811338,28141783:-268697601,28507664:1859876042,29673765:65,29684339:-268697601,29830104:-285475093,31285652:-268697601,31470430:1,31573923:-273422345,31961222:1877702079,32266649:-268697601,32905286:1,33126519:-268697601,33224413:153092881,33857486:801,34439049:-268697601,35056249:-809802761,35301426:-285475093,37000492:-805568513,37164933:-268697601,38474928:1270021139,38483488:1627392305,38567676:-335806473,38623511:-434374968,39014871:-272931849,39016116:1834727211,39114709:-285477182,39297288:1224740917,40123469:1859876554,40231799:-285474833,40433573:1859875914,40911357:1859868362,41316426:1,44412523:1859876554,47044963:-285474837,47475473:1717827264,47621121:704803522,47961588:-285475103,48029920:-268698113,48048888:-285477174,48433605:-285477141,48847127:-287574326,49000832:-268705793,49031126:35140800,49733158:-369560233,49838177:123749393,50276739:1859876554,50373841:-268697601,51090654:-285474833,52143641:-268698497,53097516:1859876554,53520350:-285474833,53542469:1859876554,53799746:135397377,53799883:65,53799917:1073743873,53800088:1,53800225:16777216,53800738:1,53800807:219223553,56920565:16777489,57149397:1859876554,58665194:-285474837,58680669:-268700161,58755476:1127301463,58808043:1859876554,59308438:16777216,59882725:-285474837,59928948:-285477141,59965069:-285474817,60306822:-285477141,60746018:4259840,62969403:1859876554,63072925:1621131361,64612859:1859876554,64915997:37897408,64980417:-285477174,64993001:1859909322,65340417:1859876554,65362088:1627390257,65429313:69394883,65480933:33,66588115:1323005642,67252806:-268698497,67579576:-268697857,68484464:-285475093,68648085:-285475093,68833936:-285474837,69044619:1877702079,69647451:1859876554,70600208:1,72075825:1291583459,72269016:-268697889,73025477:1859876554,73154171:-285475093,73866625:-268697601,74698190:263342173,74713228:131937,76034923:-293904385,76361847:-268697601,77145654:-285477174,77450502:-268697601,78463280:1859909322,78604712:1,80118199:16777232,80326251:1207959616,80481447:1859876554,80643233:-1018555887,80976251:-268697601,81195093:-268697601,81971388:-285477141,83350007:16777233,84229035:-285474817,85390009:1859876554,86765353:-1895727051,87041881:1746600456,87875195:1,88505333:16777216,89133099:-896346605,89723625:-1476657153,89892069:-285475093,92408631:-285477141,93079207:-919591663,93214626:16777216,95176872:-825497653,95892971:1627390225,95930215:-268697601,95942161:-428614145,96275653:16,97587611:134217728,98093322:1859876554,101728843:-268698497,103575952:-285474837,103918418:-285477686,105731401:-268697601,105926782:1859876554,107346001:1859876554,108174248:1859876554,108521277:4719105,111736729:196616,111835489:-285474837,112026056:-822382047,113498111:-268697601,116502717:16777216,120864237:-268697617,121477421:153092369,121497916:-268697601,122541867:-268700161,125299832:1874556351,137154583:-268697601,4164904318:-813962251,4165069259:1318811338,4165916705:-421792054,4166211628:1,4168123178:1610612785,4168986838:-268697601,4172083426:-268699649,4172533521:-268697601,4173123068:1859876554,4176306610:1,4176516221:-285474817,4180330084:65,4180379855:32768,4180599537:-285475093,4180761023:1859811010,4182865303:-268697601,4186210268:-268697601,4187127576:34209809,4188117931:-1560543509,4188488973:16777233,4189561807:1859876554,4190275274:-285477141,4193307531:1,4194109479:1145110528,4195055740:-268697601,4196099075:-805568513,4197256632:-268697601,4197744957:-268697601,4197858541:134217728,4198719337:-285475093,4201496325:-268697601,4201963189:-268697601,4204593533:1188652610,4205064510:150994961,4205214670:67108864,4205812949:1859876554,4206927397:-402915365,4207129132:-268697889,4207222897:1610612736,4209464834:-268697601,4209676079:-268697601,4210032670:-285474817,4210865916:-285474865,4211506632:-268698113,4212396703:786133706,4212563735:142624801,4213282975:-268697601,4213342617:-470024229,4214853554:1,4214864286:-285474837,4215975998:1258291217,4216554910:1,4216963350:-402915329,4217038330:1859908682,4217215205:1859876554,4217878191:1610612737,4219571077:-285475607,4221573861:1859876554,4222219033:-268697601,4222517121:16777216,4223423706:1859875914,4223977137:-285475093,4223982330:-268700417,4224555745:1859876554,4224720375:-268697601,4224971564:-268697601,4225341739:1,4226892860:1859876554,4226895904:-911203055,4228002083:1075839057,4228420979:-287639862,4229309551:1318811338,4229388226:1092616241,4230783720:-285477141,4231322699:-268697601,4232511277:2621633,4233818981:-285474833,4234237457:-268697601,4234451708:1859876554,4234693677:-285474817,4234939762:1826354890,4235185053:1073808384,4235255330:1078002688,4235789928:-278142977,4236169534:-268697601,4236373597:-285475093,4236435271:-402915329,4236647716:-277744385,4236991553:-285474817,4237047891:16777233,4237154728:-293972757,4237163484:1859876554,4237259345:-268697601,4238189464:1859909322,4238749632:65,4238803435:-285474833,4239812740:134217728,4240416035:1,4240641539:-268697601,4240900450:-268697601,4241134349:-268697609,4242127572:-843516491,4242221825:-335806469,4242499004:-268697601,4243394753:16777216,4244359436:-285474841,4244532621:1807888281,4244699913:1725658826,4244744391:-268697601,4245259090:1859876554,4245747620:1073743873,4245981655:-285477141,4246329376:-319031573,4246392993:16777216,4246545602:1677721600,4246548917:1859909322,4246841587:-268697601,4247136962:1859876554,4247534156:1073741825,4247935793:-287574326,4248492287:-285474833,4248586796:16777233,4248964732:16777216,4249034408:-285475121,4249286212:-287574326,4249466447:136384513,4249629024:536870912,4250564677:1859876554,4251090524:17,4251751819:-268697601,4251869679:1859876554,4252214546:-268697601,4252666874:-919591663,4252932672:651917002,4253251048:-285477141,4253595153:-268697601,4253632708:-268697601,4254344881:-268698113,4255183169:1859876546,4255287578:-335806465,4255630569:1859909322,4255864964:538968401,4256074164:-268705793,4256179191:-287574966,4256914394:1850963658,4257047283:-268697601,4257443601:1878786047,4257905647:-285477653,4258363285:-287605333,4258458989:1218603381,4258805674:1859876554,4259101035:1831864693,4260254090:-268700161,4260299422:1612710257,4260317540:1251122195,4261240968:-285474817,4262450066:1744876738,4263818430:1851421898,4263873564:-268700161,4264009037:1878236665,4264113013:1108882624,4264447607:151027729,4264704825:-268697601,4265123108:1877736959,4265278863:16,4266931484:25186321,4266960172:1859876554,4267397454:-823396373,4267669953:-277120599,4267934021:-285474817,4268333969:1859876554,4268546734:1219231715,4268708073:1859876554,4268815557:-268698497,4269990855:-279225943,4270194254:528,4270202593:-319031581,4270252850:-420743445,4271368637:16777232,4271951343:-285477141,4272161551:1859876554,4272303480:-805570625,4272321108:1724118722,4272331384:1859909322,4272366700:-293899029,4273525580:1073741825,4273979358:1,4274034542:-285474817,4274897548:1829767473,4275195569:-402948097,4275248922:1,4275412342:254953613,4276105201:1829844899,4276490261:-419694869,4276619857:1,4276740745:-285475329,4277139549:1289254080,4277165202:-830734869,4277706515:153092401,4278901317:756225537,4278934556:1859876554,4279066958:1621137889,4279286055:1859876554,4280285420:1859876554,4280286820:67108865,4280366344:1143079265,4280501399:-268697601,4280931769:1075318976,4281291204:1831864693,4281822018:1859876554,4282895744:1859876554,4283034741:-270270465,4283043369:1859876554,4283066724:1,4283655578:1859876554,4285108920:17,4285198935:1725658826,4285295832:1109921539,4285298910:-285474837,4286218527:-268697601,4286421575:1848831211,4287711798:-268697857,4288186343:-268697601,4288680152:-285475073,4288831674:1859876554,4288866084:-268697601,4289142010:-287574326,4289375684:1859675776,4289496156:157516645,4290399982:-285477141,4290497805:-268697601,4290555759:-285474837,4291089718:10539185,4291146876:-285475349,4291460836:-285474837,4291759108:-847747695,4292324402:33554432,4292416970:65544,4292479460:17,4292508222:1725658826,4292562621:-268697601,4293230001:1859872458,4293587443:-285475093,4294710404:-268698497,4294834112:1840299511},c:{157878:393233,248610:-384038120,382026:-270574593,685161:-840967681,759123:-270590977,985371:1,1367043:152174601,1550201:1224999217,1691756:-270541825,1697776:16,1726996:-272675841,2042939:-268443649,2065654:16908593,2080024:-303129609,2107041:-306308308,2417197:49,3115252:262145,3150748:-279000093,3247138:-272118793,3327817:-400750280,3425564:257,4168709:16777217,4556320:-268492801,4589376:16777217,5034516:1,5102504:17172853,5358572:-279520385,5393397:16777232,5612728:-270540801,5709159:-270590977,5724962:-270541825,6335403:16777217,6510776:-268444673,6558833:-270590977,6563494:156352877,6915263:16777216,6970374:1,7347374:-2147219456,7403755:17171313,7619767:-268493825,7698583:-812708865,7803658:1093797945,7826548:16777216,7863414:-2124152831,8081866:17039925,8097931:-274736129,8117403:-417375233,8260801:16777233,8279589:-1377854465,8382818:-274785281,8449778:-279110855,8561223:-519828687,8566589:-268443649,8844597:4522241,9193597:-268443649,9266279:-272675841,9676618:1627717941,9906629:-481689299,10062376:-270590977,10476788:-375449031,10980365:-270540801,11031154:-270541825,11095627:-413148289,11170081:-1593048791,11199101:-268443649,11212041:16779776,11259315:16777216,11291143:-447767681,11372726:-1377530891,11667632:-268444673,12081940:1077936157,12293765:-402388992,12336465:-384038343,12739604:-278979779,12851928:-308407508,12901351:-270590977,12912345:-308409576,13186594:16777233,13475198:-352056527,13525563:1099366453,13778088:-270540801,13877616:1763049521,13892934:-280032455,14012459:1091700793,14070850:-384103911,14076152:-273232897,14078273:17039377,14079334:17039377,14080394:-816395305,14111180:16777233,14114361:16777216,14130268:-1609695223,14143027:-845161985,14144087:1226293265,14149389:1839072040,14176994:203167761,14196082:1829767473,14286053:1,14303320:-304218072,14308622:1293551632,14310492:-270541825,14362664:16777217,14737474:17170801,14752678:562041649,14769321:16910449,14801168:16908593,14906312:-268444673,15380823:-306308311,15392555:-1491139799,15590433:1335106359,15758653:261364528,15767205:16777217,15770386:17041920,15786292:-1555169223,15820225:1864370513,15858553:-278930433,15990062:16777232,16064360:16777232,16214049:16777233,16228895:16,16245593:-270541825,16445982:16777232,16622467:-816395305,16652720:-384038343,16805384:-1588786887,16842464:17956913,16990428:16777216,17154160:-384038103,17380744:-279045315,17421368:-1486945511,17819818:-270540801,17931166:50596657,18003220:1090519057,18259490:-275330049,18390982:-271135753,18470013:1224736853,18522374:16777217,18582700:-809608263,18657655:-807412225,18978694:16777217,19072095:-1486946007,19113381:-807658697,19170785:588186137,19177085:1831078773,19628201:1828981109,20275682:16777216,20288139:33554481,20366406:-486276807,20674768:-270541825,20848053:1292108593,20867222:-1419902151,21190249:1107296273,21415702:-302118035,21638658:1157890321,21873846:-1588657911,22053366:16777233,22109374:-270558209,22197101:-270541825,22408304:25427985,22638336:-268444673,22756924:1,22760496:17041920,23321953:17040177,23348265:-270540801,23735270:16779269,23898652:-270590977,24017614:-270803073,24071969:-1524694487,24140057:-384038855,24361697:-270541825,24368893:17041921,24403397:16908545,24571705:-270541825,25070691:-270541825,25156244:-270540801,25192357:-270541825,25302584:-2147219199,25327284:-270590977,25331921:-270590977,26349326:-1344332801,26535154:16908545,26686513:33554448,26747773:-270590977,26771193:-1348924663,26923413:-270672951,27184074:-279110855,27211227:-279045257,27380109:-1894905033,27675230:16777216,27913634:-2130312395,28047376:17039921,28061236:1,28407683:-270541825,28607133:-350287063,29217755:-308671976,29343426:1169097717,29443210:-270541825,30157835:-384038615,30183467:1090912625,30219881:-271590409,30263340:-268443649,30313384:16777217,30878761:-270541825,30985659:-1344282625,30987658:-270722179,31056216:17039617,31128651:1292503056,31197784:-278983923,31470430:1,31932768:-481361091,31934920:-314405931,32071611:1090846773,32627218:17,32905286:16777233,32930725:1,33857486:801,34113768:-849885103,34189313:588186137,34256299:663683897,34402752:16777505,34507879:-1053685443,34520741:17039617,34695718:-283240071,35222524:-274785799,35296213:16777473,35429574:16777217,35990494:-279033319,36017746:-384038343,36544067:-272675841,36558013:-807461961,36925215:-268444673,36974999:-270590979,37408233:-519828687,37563288:-268444673,37788500:-407483393,37945009:17040373,37956245:-1352789697,38098271:-270541889,38483488:1627392305,38762473:1091505013,39131800:1090912625,39461344:138493953,39925877:-272675841,40433881:-1421017075,40816034:-273232897,41316426:1,41378701:-1458697427,42231999:25559824,42837317:-405861571,43116296:-1591999703,43698772:-1073477343,43751142:1091502645,44291106:393265,44391284:-270590977,44528519:-270574593,44651348:16777216,44895276:266279935,45056901:-270541825,45199803:-379778980,45338769:1763049781,45657565:16777232,45739175:-268444673,45791762:-450952391,46698887:1090650481,47478257:-270541825,47842642:16777745,47845727:-1589247175,47853878:264706943,47952646:-278981633,48295924:1,48642373:-270541825,48645720:1694761233,48819987:161874321,48933602:-270918665,49167744:33,49486124:-417459843,49547159:660538161,49634844:-849884457,49972515:1870727861,50167402:-270541825,50262134:16777216,50357567:-283178711,50454534:-480312551,51008750:-984098433,51068792:-383972483,51338192:-480376003,51546791:-807412225,51571667:-270541825,51977790:-268444673,52184498:-447081609,52276737:17040245,53523042:554566169,53799883:65,53799917:1090521089,53800054:16777217,53800088:1,53800157:1,53800225:16777216,53800636:262145,53800670:131073,53800738:1,53800773:184553473,53802825:264192,53802893:264192,54157158:-308411864,54875784:710232131,55663643:-1588657623,56132221:-1486945495,56448401:-815510667,56500929:-384038595,56549721:-811607111,56603892:-383837671,56920565:16777489,57512342:1,57747925:-270541825,57812939:-270541825,58224425:-405861571,58283539:1224999569,58708662:1172249087,58769064:1293552144,58781070:-1605500119,59151406:1,59245118:-271135753,59308438:16777216,59796289:-413203607,60472233:-807941641,60826018:-268492801,61371563:-270541825,61827387:-270590977,62219423:-304213204,62298329:1829767473,62975969:17041685,62976958:-1487994051,63205075:16910449,64418996:1876908597,64505548:-379778691,64790892:17042193,65229307:-270545921,65362088:1627390257,65480933:16777253,65701343:-274855139,66229371:1,66394688:-274768897,66659640:-402388992,67291199:-485555395,67530903:-1344282625,67566044:-270541825,67860197:50594097,68665291:203233489,69094873:-270541825,70518565:-268446849,70600208:17,71973889:16777233,72933692:-402388984,73259294:-278979779,73543138:-268493825,74646425:-278979779,74682573:17039717,74713228:131841,74715446:17039665,74846937:17040245,74925417:-276882627,75193077:-812131399,75303661:264209,75346723:17040177,75372903:-283698375,75443302:-1554052807,75560512:-276947977,75623547:-347141351,76404366:-279110855,76573682:-274986227,77345272:-384562391,77488763:16,78233136:-268444673,78406521:-841016321,78502530:16777345,79612801:-812131399,80157537:-413201603,80188002:-280523971,81035179:-278931073,82601453:-270541825,83208605:16777217,83225979:-1348924927,83350007:16777265,83454719:1627718453,83700702:-304112641,83949074:-448921335,84605179:-270541825,84836293:-1588723159,85797653:16910453,85906489:16777216,86531117:1124075521,86976579:-270590977,87041881:-384103911,87157077:-308407512,87750413:-1559297479,88505333:16777216,88672254:1627717941,88966985:-270590977,89322446:-268444673,90864446:-270574593,90894917:-446703233,91501305:-270595075,91554220:-1344282625,92430870:-271594497,93384267:-268443649,93526516:-306314484,93719713:-274920643,93754018:-270540801,93815735:131329,93839317:1800755447,94479397:17039665,94543295:16777233,94600651:17040177,95135648:-405861571,95230619:-1425142995,95365496:16777217,95547931:-270541825,95892971:1627390225,96275653:48,96357129:273,96844629:1761872453,96850547:1830029621,97191148:17172597,97285047:50593808,97515297:-270541953,97815565:1733233465,98903879:-816395305,99048682:-270540801,99107521:-1558314711,99171232:-270722145,100181512:-270590977,100350182:27656881,101443742:-278983831,101663042:-481359335,101907699:393265,101968e3:-274789571,102533317:-270545921,103362094:17039377,104133712:-1518403063,104265827:-278983923,105170283:151257617,105831187:151257445,106085164:-404861953,106395301:-405861571,107047352:16777217,107287639:134481921,107976297:-303653897,108380558:-1591473663,109130155:-270541825,109131032:-1344404807,109639184:1292503056,110288286:-270541953,111537333:-308409576,113386002:-270541825,115129233:-1486945731,115154384:16779776,116388487:-317977839,116502717:16777216,116637919:-270540929,118060866:16777216,118272910:16777984,119214439:-384038855,120330040:-1345926667,120492938:-272674817,120803712:-268444673,121379081:17170725,122323260:118297393,123639340:1763049777,123803139:710232131,124318065:1627718453,125727594:-384038343,126272535:16777216,126680217:-279113367,127285317:1,127522327:2048,127786507:-268443649,128776313:-985163393,131048041:1340021759,133534634:1090846773,133937728:25427985,134013330:33,134234336:-1486945479,135793726:16777232,4156596313:-270541825,4160612071:-268443649,4161095482:-812708865,4161406380:-306312440,4161428555:-270540801,4162242713:-283240067,4163501532:-270540801,4166211628:1,4169242603:-2130378447,4173396898:-270590977,4175826917:-268443649,4177046655:-1424028883,4177056126:1862533941,4178820659:264193,4178983573:-304213207,4180131296:-308407511,4180330084:16777301,4180897389:-384099815,4182272228:16777489,4182596950:-346092759,4182675519:-270590977,4182789924:-2020140491,4183243148:-385087455,4184396062:-306314452,4184432574:84149041,4184616345:23068673,4184688954:16777233,4184727394:1763049525,4186181662:-379841673,4186572608:1199636935,4188127282:-2012477128,4188504755:-276345867,4188835189:-308671976,4188839918:-1520696519,4188981984:5,4189662286:150995221,4189962687:-275330049,4190165397:-402388992,4190207356:-278983811,4190329355:1234831929,4190874972:1091700793,4190889267:-384038343,4192144082:-270541825,4192447395:16,4193063859:16908657,4193252035:-1487011271,4193628692:-270541825,4193862568:-384038343,4195032936:1168573429,4195310940:756335269,4195363426:-270541825,4196146541:-270541825,4196189860:-268461057,4196252715:-1487994059,4196926091:-1491269191,4197940497:1829767473,4198839886:-270541825,4198863869:-305144833,4199503089:-270541825,4199611560:-401864439,4199688799:184811529,4200259565:20054065,4201403077:1090912529,4201866639:16777216,4202191165:-268444675,4202339965:-807429313,4202823656:-270541825,4203380996:16777781,4203660099:-1377854465,4203921636:-347141351,4204786339:1775305489,4204822749:-270558209,4204886506:-347141351,4205064510:16777232,4205278244:16777217,4206467074:-1487991879,4206613438:-270574593,4207030792:1093797945,4207076625:16777473,4207222897:1627392309,4207931442:-1509684745,4208931908:-413148161,4208984342:-270541825,4209045637:-308540904,4209690425:-274736129,4209741679:-1486945495,4209757953:-271135753,4210917794:554566169,4211144239:-1554054387,4211181144:-337652865,4211546653:-1488060375,4211578475:-302120148,4213107710:-270541825,4213473442:17171201,4213913181:-270541825,4214664318:-335554689,4214765082:-268444673,4214853554:1,4216152919:-304145409,4216577521:50335745,4216832962:1795426865,4216974258:16777525,4217878191:1627392305,4219121950:1208223744,4219470677:-270590977,4220655086:-278984135,4221143231:-270541825,4221273556:-413201611,4221363200:-268444673,4221378653:1799702595,4221581939:-268444673,4221876124:-404876417,4221946187:-385611471,4222174446:150997504,4222517121:16777216,4222596666:-384038631,4223169097:-268443649,4223268450:-308671976,4223371075:151389045,4223586635:-1555100871,4223674691:16777216,4224024829:-375972939,4224227646:-308407511,4224496884:-909307079,4225111972:-816395305,4225341739:1,4226035935:-807429313,4226334149:-1587674311,4226849027:-407483393,4226928135:-807515623,4227117016:1338971129,4227819956:-1519517175,4228002083:1073741905,4229063437:-413203587,4229358650:-270574593,4229448967:16777216,4229481987:-270972263,4229531685:-270590977,4229900359:-270574593,4229913474:1862535541,4230030974:1090650129,4230110934:-407483393,4230210081:-1604451531,4230223119:16777216,4230350305:-921232847,4230395914:151257909,4230406998:-401864695,4230882509:-308407511,4230991595:-1592917975,4231216359:-270540801,4231547605:-446702721,4231784883:1208813592,4232653498:-1056568459,4232689753:16777216,4233125417:16777728,4233128178:-270590977,4233149912:-270590977,4233268708:16777217,4233351257:-379778980,4233449796:-414313623,4233557636:-414250727,4234615610:-270590977,4234655533:-270541825,4235653793:1090912625,4235678858:-270540801,4235890744:-404812803,4236526237:-402388991,4237031727:16777216,4237047891:16777233,4237197538:16777217,4237244340:-1486945735,4237378658:2085,4237630041:1,4237715685:-308671728,4237729630:-279033319,4237969433:-413267139,4238218965:-270722179,4238451604:1,4238749632:65,4238955640:16777216,4238992175:16777232,4239020129:-270541825,4239591837:-283242119,4239729097:-270591107,4240157940:-270574593,4241144047:17039925,4241337537:1837304311,4241554559:-1512107203,4241948009:16778001,4241965153:-404813515,4242159741:-385611512,4242183912:-279045129,4242742979:-308407511,4242942783:-1593573079,4243305358:1082132757,4243347429:49,4243394753:16777216,4243763698:-308671976,4243844844:1091506993,4243872492:621087665,4244042009:-270541825,4244256664:-274785799,4244791220:-318373071,4244967883:-1609629175,4245048405:16910449,4245171891:-2146435055,4245179532:-270541825,4245186501:16777216,4245334242:-414252243,4245367688:-270541825,4245605605:-270541825,4245747620:1090521089,4245762616:-308411640,4245814923:-268443649,4245942014:-268443649,4245961447:1167922167,4246343474:16777761,4246392993:16777216,4246545602:1694499093,4246592382:-383837671,4246730129:-384038855,4246966763:-402388992,4247079356:-1589378755,4247534156:1073741841,4247997963:17039377,4248044685:-402388728,4248586796:16777233,4248810771:-346219651,4248855555:17242937,4248964732:16777216,4249268408:-302120151,4249308382:1837500861,4249629024:553648149,4249635388:17039377,4249645580:-270541825,4249655479:-274851041,4249678100:-270541825,4249754176:-270541825,4249957763:-278983811,4249995489:-270541825,4250066051:16777216,4250101333:-270541825,4250158074:-268444673,4250344993:-383841487,4250391855:-270574657,4250588279:-270541825,4251077575:-270541825,4251532903:1306467327,4251568087:-316929223,4251703040:16777761,4251740147:-274920643,4251938528:1225001761,4252073972:-1486945987,4252396369:-316929767,4252483946:-270541825,4252629812:-851574519,4252692419:-383972551,4252934009:393269,4253116556:-383837671,4253124965:-268444756,4253230062:-270574657,4253685932:-851574519,4253814871:-384038087,4254685287:-273232897,4255864964:81,4255868585:16777217,4255962279:-270541825,4256447450:-1344282625,4256486823:50596656,4256635217:-278979715,4256667911:-1487535823,4256781340:-384038343,4256953055:-1488125159,4257701476:16,4257793391:-270541825,4257835141:-270541825,4258666663:-270541825,4258736157:-401864695,4258939639:1763049845,4259029832:1627722549,4259101035:1831864629,4259361935:-1568734419,4259481041:16910449,4259766952:-270541953,4259950785:151076865,4259978018:17039377,4260299422:1075839057,4260467968:-383841475,4261274653:-270541825,4261839613:1,4262298873:-1593573007,4262439971:16777232,4262482152:-417375233,4263003936:-268444673,4263572970:-1593571031,4263809962:17039409,4264319580:-308411608,4264372118:33,4264565476:-337652865,4265278863:48,4265427674:-1345136417,4265600307:-400815352,4265830826:-384103911,4265984868:-270574593,4266197469:-270541825,4266281335:17040177,4266835595:-270590977,4266868554:-815904231,4267465796:-385611239,4267576791:1838619369,4267692508:-270590977,4267793387:-268495873,4267883468:16777216,4268059602:-277918947,4268214771:-270574593,4268363496:-268444673,4268536409:-269542401,4268783545:-268443649,4268909946:1233256501,4268966679:-1609629439,4269115543:1627717649,4269613155:-404814851,4269742265:-268547559,4269989442:-402388728,4270595276:1090519041,4270690343:1742674815,4270736056:-270574593,4271247449:-346158275,4271368637:16777232,4271569336:1669597493,4271628185:-1555102935,4271750250:1,4271825210:16777233,4271925961:-283240135,4272008383:-1992128379,4272636811:-1604386007,4272901982:-279110855,4273707595:16777329,4273888683:17236913,4273979358:1,4274105001:-302120148,4274408220:-1555103191,4274849080:-270541825,4274897548:1829767473,4274914865:-279049411,4275112174:-921957831,4275168009:1090781489,4275248922:1,4275350614:-308407512,4275441162:-268444673,4275626944:-384099815,4276018921:-270590977,4276178968:16779637,4276377486:16777216,4276619857:1,4276662938:138493953,4276761142:-279110855,4276855808:-270590977,4276939770:-1593573087,4277037515:-384562647,4277065656:-379778691,4277538304:-1520499927,4277683870:-316929767,4277725366:-306314452,4277875829:-314127371,4278293224:16908289,4278608509:277,4278864381:-402388992,4278876418:-407483393,4279000497:-384038855,4279328482:17170741,4279585106:17041921,4279611155:1627717941,4279852657:-405861571,4280247692:-308411608,4280521571:-270644711,4280837617:16777217,4280857749:-270541825,4281021189:16777216,4281291204:1831864629,4281525267:-1480188937,4281785052:262165,4281893918:-270541825,4282134606:-270541825,4282226933:-1605435127,4282228437:-271660035,4282277811:-308411608,4282825832:-347141351,4282947907:-401864439,4283058734:1292503057,4283066724:1,4283079328:-346732089,4283294503:-384562647,4283304906:151259648,4283308288:16908593,4283379522:-312501377,4283539692:-346092775,4283737743:16777216,4283786316:-1055976651,4284065916:-270541825,4284268026:-810103809,4284573587:-1488059587,4284805266:-270541825,4284864940:570755281,4285108920:16,4285135993:-413203911,4285298084:-1486945479,4285378917:16777216,4285476536:16910709,4285547299:151259905,4285669101:159779473,4285767181:155533509,4285899572:-1555169223,4286093114:16,4286257689:-519765703,4286337134:16777232,4286548794:-270611971,4286594717:-272704727,4286631068:-270590977,4286867240:-385086968,4287995034:-1486945475,4288039324:17171217,4288211433:-270590977,4288220412:-414318211,4288390300:16,4288661535:-1480123401,4288785436:1702887925,4289018661:588453897,4289020253:-270541825,4289063934:-335555713,4289304759:1234113073,4289390350:-270558209,4289459772:-268444673,4289474248:-414252239,4289513683:-383972559,4289638665:-270574593,4290156648:-312485505,4290392637:-270540801,4290492511:-270540801,4290640889:-270590977,4290908805:-1356920423,4291282829:-1412561991,4291295362:-304217304,4291323072:-846591243,4291589230:-1486945735,4291938039:-1914758151,4292001953:-1344402563,4292150495:16777473,4292473419:16777489,4292479460:131089,4292502530:-270541825,4292603358:-270540801,4292799155:-302120151,4293170004:-270590977,4293423350:-854081519,4293554978:-519828687,4293581527:-815981767,4293637870:-337835649,4293811672:-270541825,4294173238:-283239619,4294179705:-276947977,4294372446:-275330049,4294392761:-270540929,4294588497:-278983809,4294630601:-270541825,4294844064:-273232897},coffee:{286794:67266242,660733:1860171466,985371:1,1006937:16777857,1102146:33554497,1222350:1859876554,1550201:1207959552,2003081:1078268009,2045464:704725058,3178380:67371009,3270687:4194304,4589376:16777217,5393397:16777233,5550489:169555650,5923409:10760225,6515669:1879048121,6915263:16777216,6970374:1,8081866:17040181,8260801:16777233,8652460:33890304,9318819:10538113,9676618:1627717941,9858649:1082262208,10039008:1275662408,11212041:512,11837851:1092878864,12081940:1078005769,12367541:1753288896,13186594:16777233,13186680:1853883008,13600674:65544,14079334:17039377,14196082:1829767473,14260835:213363701,14275715:1243726017,14286053:1,14769321:16910449,15758653:244587296,15772507:109314561,15977618:23367697,16214049:16777233,16589801:1859876554,16811678:1686110208,17432235:1849783424,18763838:1825781384,19169077:612500488,20288139:33554481,20848053:1275330561,21190249:1107296273,21638658:1090781201,22053366:16777233,22408304:8650769,22756924:1,23321953:262433,24143304:1859860104,24217541:1241736392,24403397:1,25355638:135496384,26686513:33554448,28061236:1,29775042:35668481,30178870:17,31470430:1,31967668:1084670689,32071611:1074069537,32905286:16777233,32930725:1,34315864:1826321538,34521928:1730602231,36906860:1859876554,37130730:1873274323,39297288:1224736821,39461344:134299649,40397027:1316349951,41300032:4194304,42523435:268435447,42848883:1821398210,43372757:1287861888,44291106:131072,44651348:16777216,45212170:1822892713,45492310:1879048121,47196059:268435445,47842642:16777745,48295924:1,49167744:1,50262134:16777216,51290071:249263808,52843528:264219637,53800054:16777217,53800088:1,53800225:16777216,53800670:1,53800738:1,54875784:709183555,55239849:1324808865,55509314:1082262016,56953824:1874851319,56981766:246939552,57512342:1,58164e3:3613312,58621821:23105553,59162956:1107510466,59308438:16777216,60499451:1073743872,61830411:1859876554,62268807:1817392776,62298329:1812990241,62466954:1879048191,65022547:1219886761,65362088:1627390001,65429313:86172151,65480933:33,66229371:1,67023325:134811720,67084953:1879048121,70224333:1879048191,71476435:249280200,72397707:1879048121,73467024:167797888,74610078:604113920,75303661:264209,78502530:16777345,81511892:1314092746,83350007:16777233,85797653:133217,86531117:1073743873,86752183:102035233,86942451:1878458367,87028190:1335744215,87434803:1879048191,87875195:1,88240679:1817392776,88672254:1627717941,93643633:2097204,93815735:1,93839317:1779779655,94543295:1,95892971:1627389969,96275653:16,96348077:4194304,96850547:1830029621,99709525:73437217,100815327:1879048121,103566087:34628096,106742262:1532544,107047352:16777217,107114981:606076929,108130723:1822892713,109349241:1305852601,109569975:1844920249,111736729:202047496,116502717:16777216,123803139:709183555,126123308:268435445,126272535:16777216,133534634:1074069537,133937728:262161,137928656:1879048121,140910398:65536,141931170:1858827912,4166211628:1,4174632973:246889376,4180379855:32801,4184432574:262433,4184688954:1,4188054806:1859876554,4188488973:16777233,4195605543:8389184,4196483509:1811939840,4196728401:1879048191,4197093837:604130304,4197940497:1812990241,4198836623:209716864,4201365441:1082261632,4203380996:17040181,4203811927:1320681121,4203884039:2097152,4205064510:16777233,4205214670:69206033,4205278244:16777217,4205804568:1084392673,4206120927:1786117187,4208194860:1722279399,4208658445:1716744192,4212563735:142624801,4215384633:1098927281,4216554910:25165953,4217878191:1610612736,4221378653:1799702595,4221542050:67306120,4223314660:2192,4223926638:1243989481,4226518324:1862268651,4227228989:8388608,4227340012:1836400569,4228002083:1073741888,4229388226:1073741824,4229448967:16777216,4230030974:1073872896,4230944324:1862270955,4230968503:1845625346,4231011037:268435447,4231657873:264219637,4231737261:52693169,4232689753:16777216,4233013500:64,4233125417:512,4234275328:249263818,4234586987:1872623319,4235719085:1318565504,4237047891:16777233,4237197538:16777217,4237540275:1331821791,4237630041:1,4238451604:1,4239575572:6553601,4241144047:17040181,4241440928:1207959552,4242820562:118812465,4243134914:67240512,4243394753:16777216,4244452210:4194816,4244488387:1320614817,424464e4:1209073664,4244719060:1854145153,4244969643:1859876554,4245048405:131136,4245827040:1073741824,4247001900:4196353,4247534156:1073741841,4247997963:17039377,4248586796:16777233,4248964732:16777216,4251090524:1,4251647817:65536,4251853706:1619199104,4254091340:1879048121,4256020602:1859352266,4257921795:1824732800,4258825262:1879048121,4259101035:1812987904,4259481041:133153,4259950785:155271171,4259983756:1218495137,4261155065:1755506371,4263627361:67174400,4264372118:33,4264447607:16810001,4265278863:16,4266281335:262657,4266384456:109052416,4266931484:8409105,4268497641:1879048125,4268910181:1305852601,4269115543:1627717649,4270595276:1090519041,4270940291:603979784,4271368637:16777232,4271750250:1,4271921185:1264894429,4273246520:6553601,4273482074:1153758336,4273979358:1,4274897548:1829767473,4275168009:1090781201,4275248922:1,4276344616:101869056,4276377486:16777216,4276662938:134299649,4277996249:1845650626,4278057080:1862270959,4278474055:1076110209,4278552289:796306073,4279066958:1619005568,4279854126:1086525481,4280177454:106258560,4280286820:1,4280599523:1218497057,4281076887:17,4281291204:1812987904,4281702983:2049,4282088778:1,4282391640:1844920249,4283066724:1,4283429223:1859876554,4284476566:137858005,4285108920:16,4285190240:1859876554,4285378917:16777216,4285384613:1859876554,4285468426:64,4285476536:131136,4285717623:16529,4285767181:81920,4286109091:1859352266,4286515768:1086649472,4288071379:1858073737,4288814860:264219637,4290148010:1786108999,4290718429:1730347217,4291089718:10522801,4291338243:1879047865,4292416970:65544,4292473419:17040145,4294681065:1078267913,4294724981:1802886231,4294834112:1821385922},cpp:{64183:-268436481,157878:393233,248610:-384038120,448861:-272684101,759123:-270590977,812840:23068689,835870:-268469346,985371:1,1006937:16777857,1288233:-268440577,1367043:150994945,1550201:1224999217,1691756:-270541825,1705302:1303722805,1726996:-272675841,1802472:-915149825,1823782:-268436578,2003081:1095045245,2221918:1870121855,2417197:49,2557968:16910337,3040414:-268440577,3115252:262145,3150748:1331612643,3178380:84148481,3247138:-272118793,3267637:-268436481,3270687:20971537,3327817:-400750312,3382370:-268436481,3425564:257,3546827:-268440577,3716185:1844956159,3843897:-384038359,4168709:16777217,4198915:-268436481,4589376:16777217,5102504:17173365,5209076:-268436481,5365806:-268436481,5393397:16777232,5431464:-268436481,5485813:1764625273,5654855:-268436481,5709038:-268436481,5709159:-270590977,5724962:-270541825,6335403:16777217,6970374:1,7161053:16777217,7182828:-268477441,7320983:-278984391,7347374:-2147219456,7403755:17171313,7486206:-276841601,7698583:-947450889,7826548:16777216,7863414:-411303927,8029590:-304150215,8081866:16777781,8117403:-417375233,8153399:1772890801,8179649:-268436481,8260801:16777233,8279589:-1378903049,8382818:-274785281,8449778:-283305159,8561223:-519828687,8844597:4522241,8938196:1167405829,9030537:1873021489,9197133:-1352726147,9266279:-272675841,9330059:16779280,9377025:-268436481,9614121:-847778953,9640832:-369218887,9676618:1627717941,9853410:-268436481,9931467:-268436481,10062376:-270590977,10463185:-268444673,10520750:-268436481,10577926:-268436481,11031154:-270541825,11170081:-1593048791,11212041:16779776,11259315:16777216,11316437:-268436609,11372204:-268469249,11667632:-268444673,11837851:1092878864,12081940:1078005789,12116028:-268436483,12293765:-402388992,12336465:-384038343,12656219:-268444673,12739604:-278979779,12780717:-268436481,12841246:1124092677,12901351:-270590977,12912345:-308409576,13347435:-402654209,13475198:-352056527,13544157:-276857970,13549889:16777488,13614844:-304149735,13679723:-268436481,13715647:-275362893,13877616:1763049521,13892934:-280032455,14012459:1091700793,14070850:-384103911,14078273:17039377,14079334:17039377,14111180:16777233,14114361:16777216,14130268:-1609695231,14176994:203167833,14196082:1829767473,14286053:1,14308622:1293814288,14362664:16777217,14439558:29362193,14510814:16777216,14670600:1232317285,14736414:757467255,14737474:16908657,14752678:16782129,14769321:16910449,14778899:-817943621,14801168:16908593,14802228:84017205,15273141:-277350145,15291533:1293814064,15392555:555680553,15426780:258023953,15590433:1334057781,15721698:1878513911,15758653:251927344,15786292:-1555693519,15983590:-813700097,16144235:-268440577,16214049:16777233,16228895:16,16652720:-384038343,16805384:-1588786887,16990428:16777216,17154160:-384038359,17380744:-279045315,17421368:-1555103207,17979891:-2122704047,18003220:1090519057,18149742:-511571019,18470013:1224736853,18582700:-268543047,18934377:-411107319,18978694:16777217,19072095:-1486946039,19113381:-1881400521,19152302:-268436481,19170785:-481359303,19628201:1828981109,19647078:-306758881,20054193:203167761,20275682:16777216,20288139:33554449,20366406:-486276807,20674768:-270541825,20676375:-268436481,20712518:-268436481,20786921:-268440577,20848053:1292108593,21190249:1107296273,21599589:-809555013,21638658:1157890321,21674515:16,21873846:-1588657911,21895488:-277013639,22053366:16777233,22109374:-270590977,22197101:-270541825,22408304:25427985,22720608:-268436481,22756924:1,22901811:-269026305,23046442:-848057363,23321953:17039665,23604344:-274785799,23628203:-268436481,23735270:1226967045,23898652:-270590977,24071969:-1591803351,24140057:-384038855,24361697:-270541825,24403397:16908545,25302584:-2147219167,25327284:-270590977,25331921:-270590977,25393856:-276878567,25880767:-268436481,26223475:-268469313,26535154:16908545,26686513:33554448,26747773:-270590977,26771193:-1348924663,26843078:-304149703,26923413:-270673079,27184074:-283305159,27211227:-279045257,27850892:1236613937,27874211:-268436481,28047376:17039921,28061236:1,28607133:-350287351,28660170:-276829185,29074562:-268436481,29206982:-302023937,29217755:-308409832,29358926:-268436481,29443210:-270541825,30157835:-384038615,30178870:17,30219881:-271594505,30313384:16777217,30342432:-268436481,30352604:17117953,30779147:-268436481,31128651:1293813776,31340066:16910709,31341637:-268964865,31470430:1,31473136:-268448769,31533142:-268436481,31890112:1708473215,31932768:-481361091,31934920:-314405931,32071611:1090846773,32627218:17,32905286:16777233,32930725:1,32985208:-268444673,33416331:-1342184457,33522150:-275051751,33841989:-268436481,33857486:801,34189313:-481359303,34256299:596575033,34257650:-1513159879,34387453:-268436485,34402752:16777505,34520741:17039617,34613565:-268436481,34661684:-268436481,34695718:-283240071,34893155:-268436481,35222524:-270591495,35296213:16777473,35866109:-815855239,35944507:-268436481,35990494:-279033319,36260398:-268436481,36544067:-272675841,37093243:-268448769,37408233:-519828687,37788500:-407483393,37800141:-268436481,37945009:17040245,37956245:-276950209,38358498:-268436481,38762473:1091505013,39083667:-268436481,39461344:138493953,39570264:-268469249,40433881:-1352728275,40457347:4194581,40947339:-268436481,41139536:-268440577,41316426:1,41378701:-1458962131,41832643:-270541825,42182686:-268436481,42231999:25559824,42359638:-268436481,42837317:-410055875,43089216:16777216,43116296:-1591999703,43275344:716280795,43329490:-268436481,43698772:-1073477343,43705279:-268440577,43751142:1091502645,43788632:-268436481,44291106:393265,44391284:-270590977,44653584:-308409832,44895276:266279935,45056901:-270541825,45199803:-379778980,45338769:1763049781,46691394:-268440577,46698887:1090650481,47821645:1232579429,47842642:16777745,47845727:-1589247431,47952646:-278981633,48142153:-268440577,48295924:1,48645720:1694761233,48729776:-268436481,48933602:-270918665,49167744:33,49649147:-1513160391,49759509:-276866177,50357567:-283178711,50365023:-268436481,50382978:-278983879,50384898:-268436481,50411121:-276833281,50446410:-272671745,50454534:-480312551,51068792:-383972483,51338192:-518124739,51571667:-270574593,52184498:-446819465,52276737:17040245,52623179:-268436481,52931331:151783985,53029950:690883381,53523042:1661864505,53571494:-350483591,53728605:-2011952847,53799883:65,53799917:1090521089,53800054:16777217,53800088:1,53800157:1,53800225:16777216,53800636:262145,53800670:131073,53800738:1,53800773:184553473,53802825:264192,53802893:264192,53907494:-805348353,54573392:-268436481,54675927:-268469249,54875784:710232131,55068515:-343995623,55663643:-1588657623,55934440:-268436481,56132221:-1486945527,56237822:-268436481,56448401:-805549067,56500929:-384038595,56549721:-270541895,56603892:-383837671,56920565:16777489,56948270:-311956489,57352630:-268444705,57512342:1,57719043:-268436481,57740275:8388752,58224425:-405861571,58283539:150995601,58418777:-1045328987,58769064:1830685200,58781070:-1605631703,59084621:1224739605,59151406:1,59191143:-268436481,59308438:16777216,59321232:-268436481,60717214:16777493,60814559:-268436481,61057744:-268469513,61371563:-271655937,61529457:-268436481,61693638:-277349889,61827387:-270590977,62298329:1829767473,62572429:-1479603415,62976958:-1487994051,63205075:16910449,63914302:-268436481,64418996:1876908597,64505548:-379778691,65229307:-270545921,65362088:1627390257,65382985:-1513223895,65480933:16777253,65567488:-306738185,65701343:-274855139,65732677:-268440577,65961766:-350287043,66106794:1773544437,66229371:1,66394688:-274768897,66508850:-268436481,66659640:-402388992,66825848:-268436481,66890307:-268436481,67256110:-268436481,67291199:-485555395,67472024:-268436481,67566044:-270541825,67860197:50594097,68665291:203364569,68887220:-268436481,69094873:-270574593,70957285:-268436481,71229439:-268436481,71954494:-809555013,72933692:-402388984,73259294:-278979779,73543138:-276882433,73773872:-268477441,74646425:-278979779,74846937:17040181,75193077:-807937095,75303661:264209,75346723:17039665,75443302:-1554052807,75560512:-276947977,75623547:-347141319,76207842:-268436481,76404366:-820176071,76573682:-274986227,76699434:-268436481,77167210:-268436481,77345272:-384562391,78233136:-268444673,78502530:16777345,78690443:-308409576,79183185:-270541825,79430039:1878518783,79612801:-807937095,79810826:-268436481,80343893:-268440577,80367319:-268440577,80448968:1879026687,80688981:-268498119,81184727:-308409576,82532754:-1342702593,82601453:-270541825,82865766:-270021769,83208605:16777217,83225979:-1348924927,83350007:16777233,83454719:1627718453,83460722:-268436481,83700702:-304112673,84711301:2048,84836293:-1588723671,84906973:-268436481,85797653:16910453,86216195:-268436481,86531117:1090521089,86597067:-268436481,86976579:-270590977,87041881:-384103911,87350739:766851893,87718424:-268436481,87750413:-483458503,88461625:-268440577,88505333:16777216,88672254:1627717941,88966985:-270590977,89181997:-920319683,89322446:-268444673,89792497:-268469249,91017925:1832339703,92430870:-271594497,92855035:-268469249,93719713:-274920643,93815735:131329,93826580:-268440577,93839317:1800755447,94117227:-276825089,94543295:16777233,95135648:-405861571,95230619:-1995830491,95365496:16777217,95483501:-268436481,95547931:-270541825,95892971:1627389969,96275653:48,96357129:273,96850547:1830029621,97244165:-384431243,97502059:-268436481,99107521:554565929,99171232:-270722145,99214862:-268436481,100181512:-270590977,100350182:27656753,100411531:690883381,101443742:-278983831,101663042:-514913767,101907699:393265,101968e3:-274789571,102315576:-271644359,102533317:-270545921,102854754:-268444673,103959e3:-268436481,104265827:-278983923,105170283:150995473,106395301:-405861571,106589609:-268436481,107047352:16777217,107287639:134219777,107491427:-469767177,108380558:-1591474175,109419007:-308409832,109551858:-268436481,109639184:1293813776,110513265:-268436481,110532416:-268436481,111537333:-308409576,115731728:1205240669,116388487:-317977839,116502717:16777216,118016833:-268436481,118060866:16777216,118239367:-350287079,118272910:16777984,119214439:-384038855,119399010:268377085,120330040:-1345926155,120803712:-268444673,122323260:118297393,122447725:-268477441,122988336:-268436481,123639340:1763049777,123803139:710232131,124318065:1627718453,125304220:-304149703,126272535:16777216,126680217:-279113431,127522327:2048,131048041:1340021759,131575742:-268436481,133534634:1090846773,133937728:25427985,134013330:33,134234336:592380721,134280695:-268440577,139344342:-268436481,4161095482:-813233161,4162242713:-283240067,4164904318:-814486539,4166211628:1,4168191703:-1921537153,4168282771:-268446723,4171473132:-307352587,4173396898:-270590977,4177046655:-1458961619,4177056126:721683253,4177173536:-268440577,4177306815:-278967491,4177891458:-268436481,4178820659:264193,4180330084:16777301,4180897389:-384099815,4181293825:-268436481,4181474660:-268436481,4182017233:-851498053,4182310634:16777233,4182365502:-268444673,4182596950:-346092759,4182675519:-270590977,4184432574:17039665,4184464044:-268477441,4184688954:16777233,4184727394:1763049525,4186181662:-379841673,4186572608:1166016965,4187846769:-268436481,4188057564:-268436483,4188127282:-2012477160,4188835189:-308409832,4188835463:1837501233,4188839918:-1526463695,4188981984:5,4189371938:-272651273,4189484018:-268436481,4189662286:150995221,4189891943:-268444981,4190165397:-402388992,4190180136:-268489795,4190207356:-278983875,4190329355:1233783353,4190874972:1091700793,4190889267:-384038343,4191197911:-268436481,4191247229:-268452865,4192144082:-270541825,4192447395:16,4192679651:-272680065,4193063859:16908593,4193261121:-268436481,4193808354:-268436483,4193862568:-384038343,4195310940:152338981,4196146541:-270541825,4196252715:-1487994059,4196370657:-1342184585,4196584775:-308409576,4196607921:-268436545,4196856223:-268436481,4196926091:-1559426631,4197858541:150994961,4197940497:1829767473,4198138195:1837501241,4198839886:-270541825,4199503089:-270541825,4199611560:-401864439,4199688799:-1420492503,4199815149:-1921537155,4199907410:-268436481,4200000821:-268436481,4200320218:-268436481,4201252677:-268436481,4201403077:1703280913,4201410290:-268440577,4201632743:-268961025,4201740844:-268440577,4202191165:-268444673,4202339965:-807429315,4203380996:16777781,4203554220:-918746307,4203660099:-1378903073,4203921636:-347141351,4204822749:-270558209,4204886506:-347141319,4205064510:16777232,4205214670:2097169,4205278244:16777217,4205738421:23068689,4205958239:-268485633,4206284503:-276886759,4206428685:-268436481,4206467074:-1487991879,4207030792:1093797945,4207076625:16777473,4207088572:-268440577,4207931442:-1509684747,4208914099:-268436481,4208984342:-270541825,4209045637:-308540904,4209741679:-1554054359,4209772919:-268436481,4209837912:-268436481,4210041344:-268436805,4210496882:796281079,4210736706:690883381,4210917794:1661864505,4211144239:-1587608819,4211343712:1,4211546653:-1521614807,4211997046:-268436481,4212469277:-270590977,4212530734:-304149735,4212669820:-268440577,4213107710:-270541825,4213473442:17171201,4214853554:1,4215281406:-268960769,4215722242:1232579429,4215764479:-268436481,4216554910:16777345,4216832962:1795426833,4217878191:1627392273,4218473927:-268960769,4219118080:-276825089,4219121950:1208223744,4219470677:-270590977,4220962449:-268436481,4221143231:-270541825,4221363200:-268444673,4221378653:1799702595,4221410812:-268436481,4221581939:-268444673,4221776457:-413201859,4221876124:-404876417,4221946187:-384562895,4222517121:16777216,4222596666:-384038119,4223268450:-308409832,4223371075:151389045,4223586635:-1555100871,4224024829:-375972939,4224496884:-909307079,4225025230:-268436481,4225341739:1,4226035935:-807429315,4226334149:-1588723143,4226496393:1879014331,4226928135:-270644711,4227117016:1338971129,4228002083:1073741905,4229448967:16777216,4229481987:-270972199,4229483703:-268436481,4229531685:-270590977,4229913474:1862535541,4230030974:1090650129,4230210081:-1604451531,4230223119:16777216,4230395914:17040181,4230406998:-401864695,4230728073:-268436481,4230991595:-1592917975,4231784883:1208813592,4232653498:-1056568459,4233124446:-278983879,4233125417:16777728,4233128178:-270590977,4233149912:-270590977,4233268708:16777216,4233321999:-1994651268,4233351257:-379778980,4233379676:-268469505,4233449796:-414313631,4233519724:-268436483,4233557636:-414250183,4233576580:-268436481,4234615610:-278979585,4234655533:-271655937,4235653793:1090650481,4236362773:-270595271,4236433551:16908389,4236438842:-268469249,4236526237:-402388991,4237031727:16777216,4237197538:16777217,4237378658:2085,4237630041:1,4237715685:-308409576,4237729630:-279033319,4237947943:-268436481,4238451604:1,4238840645:555745313,4238955640:16777216,4238997890:-268436481,4239410749:-1010881603,4239591837:-283242183,4239704312:-268436481,4239812740:18874369,4240207818:-268448769,4240301951:-268440577,4241144047:16777781,4241186921:-277349889,4241553496:-268436481,4241776489:-268452865,4241948009:16778001,4242159741:-385611512,4242183912:-279045129,4242942783:-1593573079,4243166341:17039361,4243305358:1082132757,4243347429:49,4243394753:16777216,4243763698:-308409832,4243844844:17765169,4243872492:621087665,4244004786:-268436481,4244042009:-270541825,4244256664:-270591495,4244791220:-318373071,4244967883:-1609629175,4245048405:16910449,4245186501:16777216,4245605605:-270541825,4245747620:1661995521,4245882019:-304149703,4245931709:-308856289,4245961447:1167851989,4246343474:16777729,4246392993:16777216,4246545602:1694499093,4246592382:-383841767,4246670531:-283309187,4246730129:-384038855,4246904064:-277013639,4246966763:-402388992,4247079356:-1593573059,4247276852:16777216,4247534156:1073741841,4247661187:-268436481,4247997963:17039377,4248044685:-402388728,4248586796:16777233,4248810771:-346219651,4248958451:-283124737,4248964732:16777216,4249308382:629539217,4249478233:-274805769,4249629024:553648149,4249678100:-270541825,4249754176:-270541825,4249957763:-278983811,4249995489:-270541825,4250234897:1838103067,4250344993:-383841487,4250391855:-270574657,4250564861:-268477441,4250588279:-271655937,4250718575:-268436481,4251182338:-268436481,4251213172:-268436481,4251568087:-316929223,4251703040:16777729,4251740147:-274920643,4251875020:-1479603415,4252483946:-270541825,4252692419:-383972551,4252934009:393269,4253116556:-383837671,4253230062:-270574657,4253569066:-268436481,4253599693:-303101025,4253709912:-268444673,4253814871:-316929223,4254137293:-268436481,4254502955:277,4254887299:-276829185,4255108341:-268436481,4255165615:-268436481,4255423080:-317978307,4255864964:81,4255868585:16777217,4255869397:-272671745,4256374660:-268436481,4256521192:1797392901,4256635217:-278979715,4256667911:50725169,4256883517:-268436485,4256953055:-1488125159,4257389142:-268436483,4257553428:1333397751,4257701476:16,4258736157:-401864695,4258939639:1763049845,4259029832:1627718453,4259361935:-1568734419,4259481041:16910449,4259686157:-268440577,4259950785:151076865,4259978018:17039377,4261181127:690883381,4261274653:-270541825,4261370490:-268436481,4261500156:16,4261839613:1,4261918850:-270726355,4262158846:-268440577,4262482152:-417375233,4262652835:-268436481,4263003936:-268444673,4263268237:-268436481,4263434542:-268440577,4263572970:553912617,4263646058:-1513159879,4263809962:17039409,4264372118:33,4265278863:48,4265600307:-400815352,4265830826:-384103911,4266281335:17039921,4266394919:-268477441,4266846426:1842842613,4266868554:-807515623,4266890851:-268436481,4266968904:-272680097,4267465796:-385611751,4267576791:159514625,4267624613:-268436481,4267625996:-268436481,4267692508:-270590977,4267720310:-268485633,4267822917:-268436481,4268059602:-276837603,4268088727:-270541825,4268363496:-268444673,4268966679:-1609629439,4269056414:16777217,4269115543:1627717649,4269138719:-268436481,4269472438:-268444673,4269742265:-268547559,4269941417:151783985,4269989442:-402388216,4270461468:16777233,4270595276:1090519041,4270940291:603979800,4270972636:268377085,4271125244:-268444673,4271215461:-283374727,4271284074:-268436853,4271368637:16777232,4271569336:1669597493,4271628185:-1555102935,4271750250:1,4271825210:16777233,4271925961:-283240135,4272008383:-1992128379,4272636811:-1604386007,4272901982:-283305159,4273265033:-268436481,4273359986:-268436481,4273707595:16777329,4273888683:17236785,4273979358:1,4274263341:1842842613,4274386098:50463233,4274408220:-1588657623,4274566539:-270595271,4274689949:-268436481,4274700127:1327679573,4274764775:-268436481,4274849080:-270541825,4274897548:1829767473,4275103752:-268436481,4275112174:-921957831,4275149034:-268436481,4275168009:1090781489,4275248922:1,4275626944:-384099815,4276018557:-268469313,4276018921:-270590977,4276377486:16777216,4276619857:1,4276662938:138493953,4276761142:-283305159,4276939770:-1593573087,4277037515:-384562647,4277055145:-276837571,4277065656:-379778691,4277123905:1090521137,4277451583:-268436481,4277538304:-1521548503,4277540109:-268436481,4277683870:-316929767,4277875829:-314127371,4278181247:-384562311,4278370475:-268436481,4278474055:1092887441,4278480520:-268436481,4278684882:1840130997,4278864381:-402388992,4278876418:-407483393,4278904638:-268436578,4278974169:-268440577,4279000497:-384038855,4279001966:-314754243,4279252647:-268440577,4279599928:1197607031,4279825429:-268436481,4279852657:-405861571,4279896961:-268444673,4280286820:67108865,4280521571:-270644711,4280554141:-268436481,4280837617:16777217,4280927245:-268436481,4281079180:218234933,4281525267:-1480188937,4281549159:-270541825,4281785052:262165,4281854549:-268436481,4281893918:-270541825,4282134606:-271655937,4282226933:-1605435127,4282228437:-271660035,4282423678:1694629913,4282682606:-268444673,4282825832:-347141351,4282947907:-400815863,4283058734:1830684689,4283066724:1,4283079328:-346732089,4283153215:1303722805,4283294503:-384562391,4283308288:16908593,4283539692:-379647207,4283591957:-268436481,4283732878:-343995623,4283786316:1091506997,4284021066:-268436481,4284065916:-270541825,4284254318:-268440577,4284372523:-272811137,4284805266:-270541825,4285108920:16,4285135993:-413203911,4285298084:659489593,4285378917:16777216,4285394687:-268440577,4285476536:16910709,4285744026:1764625273,4285767181:155533505,4285899572:-1555169223,4285913524:-270590977,4286093114:16,4286147784:-268436481,4286257689:-519765703,4286548794:-270611971,4286631068:-270590977,4286652130:1879010235,4286813244:18907905,4286867240:-385086968,4287288125:-268436481,4288039324:17171217,4288211433:-270590977,4288220412:-481427075,4288390300:16,4288501214:-268436481,4288661535:-1480254475,4288837231:-308409576,4288970579:-268436481,4289020253:-270541825,4289390350:-270558209,4289459772:-268444673,4289474248:-414248135,4289496156:1232317285,4289513683:-383972559,4290640889:-270590977,4290908805:-1356920423,4291282829:-1412561991,4291938039:-1881203719,4292100442:-268436481,4292440124:-268436481,4292473419:16777489,4292479460:1073872913,4292502530:-270541825,4293170004:-270590977,4293554978:-519828687,4293581527:-820176071,4293637870:-337835649,4293811672:-271655937,4294173238:-283239619,4294179705:-276947977,4294640694:-268436481,4294681065:1095045149,4294760164:-268440577},cs:{157878:393233,248610:-384038088,262868:-268468225,387168:-268468225,448861:-289461333,516857:-268550145,621045:1725440714,641129:780681730,759123:1859850954,812840:1643792985,835870:-268469346,985371:1,1006937:17040001,1256528:-440967255,1367043:135397384,1478300:1859745482,1497776:262688,1550201:1208221985,1705302:1303722805,1726996:1855668938,2003081:1078005832,2134007:-268468225,2176033:1859875530,2222402:1855660682,2417197:49,2925893:-287361334,3115252:262145,3178380:84280193,3270687:1096811033,3327817:-400750276,3425564:257,3683894:1859875530,3843897:1746403848,3952651:1322809034,4168709:16777217,4168785:1828077217,4447109:-824346934,4589376:16777217,4604983:-287368213,4769648:-289439761,4813523:-268468225,4820862:-272688129,4971363:-285442069,4976967:-268468225,5034516:1,5102504:393280,5368558:-285245461,5393397:16777232,5619329:1826322122,5622121:773001736,5709159:-270590977,5758174:-805339137,6335403:134217729,6378251:-285247766,6650192:-272679041,6778870:-294701558,6970374:1,7150824:1847211722,7161053:134217729,7182828:1859867338,7320983:1851457608,7347374:-2147219456,7384216:-268468225,8081866:16777781,8153399:1753752192,8260801:16777233,8290208:-287344950,8449778:1847136776,8561223:-519828687,8677922:-272680065,8698642:1322930880,8741324:-272680097,8844597:-532348663,8935089:1167067664,8938196:1704409861,9030537:1873021489,9111700:1083179648,9121001:-272662531,9148803:1851327050,9266279:1855668938,9341906:512,9363427:-287344950,9472949:1859876490,9640832:-335664455,9676618:1627717941,9678433:-268468225,9711465:-319415519,9746005:-285442069,9906629:-498400983,10052743:-285248789,10062376:-270590977,10205260:-287343445,10232770:1826305738,10237373:1616065032,10329637:-306298951,10756328:-272678913,10852473:1855525578,11170081:-1593573111,11184319:-268468225,11212041:16779776,11235720:-1481751561,11372204:-285248789,11566751:612499464,11632974:1859876424,11639666:-289587349,11762036:-306234561,11837851:1092887057,11857909:-285245717,11932924:1859876554,12081940:1078005768,12100038:-268493825,12248933:-268468225,12293765:-402388992,12435470:1851458120,12739604:-295757015,12767082:-306298951,12901351:-270590977,12912345:-308409576,13009261:-272679041,13211372:8392704,13369966:1859876554,13406882:-268493825,13475198:-402388175,13506975:-400815235,13544157:-276857970,13794160:1784222280,13877616:1763049521,13892934:-280032455,13987016:-268484609,14012459:1074923561,14070850:-400881143,14074032:236020808,14078273:17039409,14079334:17039377,14110120:1083048480,14111180:16777233,14114361:16777216,14116482:16777216,14130268:-1609695223,14196082:1812990257,14286053:1,14308622:1293814288,14362664:1,14439558:12584961,14574412:1859876554,14720758:-285245461,14737474:16908657,14752678:4096,14769321:16910449,14770381:225930257,14778899:-817943621,14783141:1855136258,14785261:1854605e3,14801168:131104,14802228:67239969,14873731:1859876554,15242400:1821910656,15291533:1276772352,15305821:-268468225,15306955:-839041281,15392555:-1491139799,15590433:1335237431,15758653:261495600,15770386:262656,15772507:109052416,15786292:591790129,15965795:-285265941,16032909:1859876554,16214049:16777233,16341045:-285254677,16681709:-270589953,16688791:1858811400,16729561:-268484737,16747571:-285442069,16794482:1821909632,16805384:-1592981223,16841602:-268468289,16842464:1179648,16933621:1717244616,16995267:1083048608,17048354:-310411623,17091632:-306217031,17154160:-384038359,17338062:1859859146,17380744:-295822551,17421368:-1555103207,17482476:-1374805341,17525710:-268615681,17901404:-287501752,17979891:-2122441903,18003220:1090519057,18315335:1826305608,18325236:512,18342395:-268468225,18474388:1859811018,18546905:1859875530,18582700:-826387800,18746801:-268493825,18883109:-285318933,18978694:16777217,19072095:-1486945495,19113381:-807658505,19170785:-346092743,19227798:1188591240,19628201:1275330593,19647078:-306758849,20003152:1828533889,20275682:16777216,20288139:33554449,20366406:-486276807,20805031:1303653009,20848053:1292108337,20922774:-295864758,20988029:1758073408,21040400:-268484609,21190249:1107296273,21229736:-446823527,21599589:-809555013,21606510:-268468225,21611024:1213793288,21638658:1157890321,21777609:1854605e3,21873846:-1588657911,21879763:1847211722,22053366:16777233,22057397:1855677066,22210730:-268468225,22217315:1611870728,22408304:25427985,22539413:1281058440,22594923:1859876554,22756924:1,22761889:1288900744,23220140:-268484609,23321953:262433,23350999:1859876490,23624517:-289461341,24071969:-1491140055,24140057:-384038855,24403397:16777473,25088627:-268493825,25302584:-2147219199,25327284:-270590977,25331921:1859850954,25372165:-285265237,25879497:-285245717,26235825:1855660546,26429254:-285261845,26535154:16908545,26619207:1851458120,26657453:-293655893,26686513:33554448,26771193:613485313,26871437:-285261845,26933589:1859876554,27037198:1291288097,27184074:-300084728,27193984:-272680065,27211227:-279045257,27380109:-299955417,27470823:-276988033,27753442:-268468225,27850892:1303722801,28047376:17039921,28061236:1,28104968:-864063575,28199699:-268484609,28244819:-805470209,28490107:-268468225,28581297:1855660746,28607133:-350287063,29206982:-268469505,29217755:-308409832,29317890:1855682250,30157835:-400818135,30183467:1074135137,30313384:16777217,30335435:1859876554,30352604:1159150337,30652261:-367191171,30867136:1846743560,30964574:1859745482,30987658:-287499415,31002955:1846634056,31128651:1293813776,31128967:-268468225,31154439:-272680065,31197784:1847263752,31238399:1825797768,31456365:1817404552,31470430:1,31544364:-268468225,31613513:-285245457,31633117:16777216,31782483:-306234561,31814205:-446954695,31890112:1878473599,31932768:-498138624,32071611:1074069537,32134102:-289458456,32627218:17,32905286:1,32916832:-285262101,32930725:1,33006848:778600419,33043408:-302022657,33107216:-268468225,33195241:-839041281,33224413:134218240,33254801:-285245441,33522150:-316994799,33857486:801,33953076:-419596661,34033923:-939633673,34189313:-346092743,34256299:579535368,34520741:16777217,34695718:1847201800,34834430:1255945601,35296213:16777473,35473710:1217463816,35498585:-268468225,35866109:-295761543,35990494:1851408904,36544067:1855668938,36800219:-295761543,36887088:1855660680,36953371:16777233,37158689:-268599297,37394054:-1384808577,37408233:-519828687,37762374:-1342406689,37775157:777589320,37788500:1720861386,37953257:-268468225,38483488:536870912,38526599:-285245717,38749292:-268468225,38762473:1074727521,38985701:-306561095,39131800:1074135137,39598218:1324842593,40133677:-285245717,40433881:-1420886003,40457347:71827733,40546344:-285261845,40836830:-289465621,40850046:-864063575,41316426:1,41378701:-1458697427,41391733:1836989241,41436181:-268468225,41530750:16777216,41711838:1619001729,42310592:-268468225,42670652:-329644350,42794649:-302022657,43116296:538444296,43401191:-268533761,43698772:-1073477343,43751142:1074725413,44291106:393265,44391284:-270590977,44651348:16777216,44653584:-308409832,45024648:-285245461,45199803:-379778980,45338769:1746010112,45791762:-467729623,46061912:1679429706,46143395:-840212481,46394932:1,46660736:-285245461,46698887:1073872960,47333160:-268468225,47608887:-287345974,47842642:16777745,47845727:-1589247175,47853878:247929707,47952646:-279047297,47962048:-285245461,48295924:1,48645720:1677983745,48933602:-270656521,49111295:1822032392,49167744:1,49387022:-805470209,49547159:576389632,49824808:-268484609,49938339:-287345974,49972515:-274396491,50114261:1813643264,50216968:-268468225,50262134:16777216,50295528:-285376789,50357567:-350287575,50382978:-295761111,50454534:-531692791,50655120:-354610616,50935680:-2135395383,51068792:-383972483,51089574:-268468225,51103948:-306298887,51930656:536949256,52184498:-446819465,52400953:-268468225,52673366:-319127575,52931331:135004704,53095696:615787425,53523042:-481424583,53581694:-272679041,53800054:16777217,53800088:1,53800157:1,53800636:262145,53800670:1,53800738:1,53800773:184553473,53802825:264192,53802893:264192,53907494:-805348353,54002016:1289434120,54040030:781940424,54502203:-285245461,54702009:-318817751,54785268:-839155713,55037356:240661192,55226049:-306298951,55663643:-1588657623,56132221:-1486945527,56189586:1859850954,56220274:1859801802,56448401:-805549067,56500929:-400816087,56515453:1859876554,56603892:-400616951,56613286:4194304,57373512:-285261845,57512342:1,57729237:-1359118337,57740275:8389264,58224425:1724580360,58283539:151257745,58387028:1822032392,58769064:1830685200,58781070:-1605500631,58823749:-1481751561,59151406:1,59172531:545390656,59257640:-272679041,59308438:16777216,59373516:-362872791,59646924:1837054777,60155988:-290492433,60499451:1100220929,61057744:-268469249,61361823:1167199285,61827387:-270590977,62298329:1812989985,62337741:-268468225,62538601:-268468225,62572429:650838536,62976958:-1504771543,63086559:-268469249,63205075:16910449,64227633:-268484609,64505548:-379778691,64823762:1859876554,65362088:1627390001,65382985:617218056,65480933:33,65701343:-274789537,66229371:1,66283973:1859876554,66485939:-285444373,66659640:-402388992,66819883:-289456181,67291199:1108017672,67345485:1859860170,67451318:-285247766,67860197:33554432,68061633:8651392,68263128:1859876554,68497616:145752064,68708785:-438879477,68718504:-285376789,68762237:1717240328,70039857:1783955497,70184974:1690053537,70290369:1846231688,70417760:-268468225,70629169:-318821911,70730094:1846743112,70976692:1859876554,71954494:-809555013,71973889:16777233,72207017:-268468225,72383790:-268468225,72672805:1859876554,72850110:-426285366,72933692:-402388984,73068351:-289442072,73192774:-295757255,73259294:-295757015,73514451:1859876554,73543138:-268493825,74035910:-268469313,74646425:-295759352,74715446:17039665,74925417:1851462152,75208539:1276318208,75303661:264209,75346723:262433,75372903:1846743560,75443302:-1570830039,75560512:-276947977,75623547:-363918839,75682024:-306298951,76404366:-279110855,76573682:-274789553,77103560:-272679041,77283799:-268484737,77345272:-384562647,77526937:1859876554,78168724:1859876554,78502530:16777345,78660610:-285245463,78820899:-285245461,80688981:-285275351,80799459:-822191135,80966917:-285246293,81288833:1746403848,81639363:-285444373,81840234:1717244616,83208605:1,83225979:612436481,83305372:1819088513,83350007:16777233,83394211:-291700152,83454719:1627718453,83934179:-865926399,83947431:-306298951,84711301:2048,84836293:-1588723671,85038080:-268468225,85797653:16910453,86531117:1090521089,86575334:-268468225,87041881:-400881143,87161375:-300476151,87350739:1840593717,87750413:-345044423,87832e3:1745354760,87937995:-285245717,88672254:1627717941,88879250:1859745482,89181997:1208025096,89228638:-1401585793,89760298:1859876554,89925005:1859860170,90118082:72573960,90899094:1859876554,92855035:-268469249,93020596:-268468225,93253708:-268468225,93719713:-274789377,93815735:131329,94182263:-847811535,94479397:262433,94543295:16777233,94759804:-285262101,95043733:1859876426,95230619:-1425142995,95869005:-270590977,95892971:1627389969,96275653:16,96357129:273,96850547:1812987904,97305627:-268469249,98163723:-268468225,98210206:1308585625,99107521:-1558314711,99171232:-270722113,99194557:1289447048,100181512:-270590977,100350182:10879649,100531632:-318817301,101443742:1851457544,101663042:-531693047,101907699:393265,101968e3:-274789377,102367525:-427883927,102395155:4196352,103113602:1691030144,103277617:-1477033481,103362094:17039377,104027111:4194304,104265827:-295761143,104406128:147265673,104986824:-302027079,106395301:1724580360,106408018:-285245717,107047352:16777217,107287639:134217728,107705134:1823749025,108722144:1784222280,108758134:-289456277,109419007:-308409832,109569975:1825773192,109639184:1293813776,110093314:-302022657,110779342:1859811018,111537333:-308409576,111736729:67829768,112569916:-285245717,112692256:-285263253,113560389:-268468225,114952007:-268468225,115048684:-285245493,115129233:643498504,115937760:-268615681,116388487:-385086703,116502717:16777216,118239367:-346092743,118272910:512,119214439:-384038855,119993022:-272679333,120561078:-272679041,120591997:-285262101,120771173:-272679041,120820893:1826305738,121347939:-268468225,121477421:134217728,122447725:1859867330,122636907:-285264149,123152328:-285393025,123266891:-268615681,123639340:1746272289,123929637:-268599297,124318065:1627718453,125714005:-285392897,126272535:16777216,126680217:744030216,127522327:2048,127602782:-285245461,128189054:-272680097,128268115:643524232,129243858:-285245461,132525163:1859876554,133534634:1074069537,133937728:25427985,134013330:33,134234336:592380721,134400992:1859876554,135090945:1859876554,137087576:643498504,137509416:1859876554,140910398:134283264,143134466:-268469249,4150227703:1851330634,4157713955:-285770005,4159656364:-1939206656,4161864171:-291539254,4162875566:207176320,4163667875:-283178455,4164296730:-287361334,4164465199:-306758785,4167539403:-268468225,4170798431:-427883927,4173351668:1828159459,4173400764:-285264216,4175669853:1859876554,4175776437:-268664833,4177046655:-1424028883,4177060881:134218240,4178770917:-287368469,4178820659:264193,4180750646:-268615681,4180897389:-400877047,4180973619:-272810113,4181663546:-268468225,4182017233:-817943621,4182272228:17039633,4182310634:20972049,4182596950:1784349192,4182862186:1826304520,4183906609:1778384960,4184239925:1717240520,4184369364:1859715722,4184432574:262449,4184688954:16777233,4184727394:1746272289,4186181662:-379841673,4186572608:1140850753,4188127282:-1475606216,4188182179:-268468257,4188478454:-272679041,4188504755:-274248715,4188835189:-308409832,4188839918:609747464,4188981984:5,4190165397:-402388992,4190180136:1859854856,4190247374:-316929255,4190474076:-293657877,4190874972:1074923561,4192212162:-285247766,4192362015:134218240,4192447395:16,4192679651:-272680065,4193063859:131072,4193252035:-1503788503,4193599548:-268468225,4194594014:1859876554,4195814833:-287345942,4196500489:562299313,4196584775:1822032392,4197882259:-268468225,4197940497:1812989985,4198216606:-285248789,4198337378:-268468225,4198361122:1859875530,4198674102:-323076183,4199007401:1846743560,4199611560:1744830472,4199688799:189071369,4199718961:612368896,4200259565:1179648,4200284378:-285264149,4201093440:1073741824,4201403077:1703280913,4202445836:-285245457,4202603902:1851458056,4203366720:-805339137,4203380996:16777781,4203426923:-270590977,4203479410:-285376533,4203554220:1746469384,4203798462:1859859010,4203862903:1859876426,4203921636:-363918839,4204752800:1847228106,4204837474:1859876554,4204886506:-363918839,4204947018:1859850818,4205214670:69214257,4205278244:16777217,4205581530:-268468257,4205738421:1106791001,4205898350:-268468225,4205958239:-268485633,4207629224:1822111434,4207931442:-1509687071,4208018418:216488741,4208817276:-268468225,4208866636:1859876554,4209045637:-308540904,4209313507:-268468225,4209600340:-268484609,4209671825:1859876554,4209693973:643498504,4209741679:-1555103447,4209855087:-268468225,4210011815:1341537271,4210273130:-463601047,4210494078:1219764897,4210809182:-285245441,4210917794:-481424583,4211144239:-1570831607,4211370423:-285442069,4211546653:608829448,4211742415:-268468225,4211916387:1290239781,4212469277:-270590977,4212594582:-268468225,4212619317:-268469249,4213087380:-285262101,4213221217:1859745482,4213481066:1847211722,4213572245:-268468257,4213660921:-268468225,4214853554:257,4215098365:1859875530,4215502519:1342061567,4215872863:-268468225,4216187132:1855677066,4216416056:-268468225,4216554910:25165953,4216684298:786118152,4216817397:1858811400,4216832962:1778649089,4217173991:-268468225,4217456575:-285247766,4217878191:1610612736,4218133757:-293655893,4218498495:1845441305,4218545854:1859860042,4218974934:-268468225,4219121950:1208223744,4219470677:-270590977,4219588322:-285245717,4219973942:-274785281,4219985845:-864588279,4220317186:-268468225,4220634339:615787425,4220655086:1851458056,4220828173:2069,4221444723:1855665866,4221542050:67306120,4221776457:-278984131,4221876124:-404876417,4221946187:1745879040,4222174446:134220288,4222232469:-268468225,4222533644:-285442069,4222596666:-384038631,4222678378:1686831744,4222828593:1851462152,4223268450:-308409832,4223395538:-268468225,4223586635:-1555101415,4223718522:-285401365,4224024829:1754468992,4224487183:20971537,4224496884:-926084567,4225630039:1855600328,4225790028:-268468225,4226116171:-268484609,4226334149:-1588723143,4226626786:-268533761,4226665067:1859876554,4226928135:-836877816,4227340012:1819612840,4227411634:-268468225,4227615382:-1921553391,4228002083:1073741824,4228953479:1150222464,4229137989:-268469313,4229282708:1859876554,4229913474:1275068416,4230030974:1073872896,4230210081:542769664,4230395914:17040181,4230406998:-401864695,4230873256:1859876360,4230991595:-1591869399,4231210466:-805339137,4231311757:1754935944,4231662570:-290829855,4231770040:-268599297,4231784883:-401799144,4232235571:-438879345,4232595781:1183744,4232653498:1090915189,4232689753:16777216,4232815064:-268468225,4233124446:-295761111,4233125417:16777728,4233128178:-270590977,4233268708:16777217,4233321999:-1419965569,4233351257:-379778980,4233379676:-268469249,4233557636:-431027959,4233995370:-268469249,4234285761:1859678922,4234497390:-268599297,4234712141:1859876554,4234774878:-268468225,4235354525:1823749025,4235525251:-268469249,4235579441:1859876554,4235653793:1090650481,4235748067:-268533761,4236307405:-272678913,4236438842:-268469249,4236526237:-402388991,4237197538:16777217,4237244340:-1503722967,4237378658:264229,4237449389:1855141514,4237630041:1,4237702804:8388736,4237715685:-308409576,4237729630:1851408904,4237805167:-272678913,4237816332:-838898023,4238218965:-824370327,4238451604:1,4239379403:-300478391,4239410749:-809555009,4239557793:1859876554,4239591837:-300543959,4240074664:-268468225,4240646340:-333577688,4241144047:17039925,4241401271:-268599297,4241983650:-388033943,4242159741:-384038616,4242183912:-279045129,4242305440:2049,4242347117:1859876554,4242456950:-1363181585,4242532022:1690053537,4242803638:1855665738,4242942783:-1593573087,4243166341:17039489,4243305358:1082130432,4243369201:-805355521,4243394753:16777216,4243763698:-308409832,4243818890:-285263063,4243844844:1091507001,4243973709:1836989241,4244060146:1717240392,4244249815:717898242,4244403916:-268468225,4244600803:1725629e3,4244719060:1853883008,4244791220:-335150560,4244967883:-1609629175,4245048405:16910449,4245171891:-2146435071,4245186501:16777216,4245334242:-429981079,4245931709:-308856289,4246033183:-285265941,4246343474:16777761,4246592382:-400616951,4246670531:-291698071,4246730129:-384038855,4246966763:-402388992,4247035893:-268468225,4247079356:536870920,4247218286:-285310993,4247534156:1073741841,4247600437:612630656,4247997963:17039377,4248044685:-402388728,4248586796:16777233,4248633292:1859876554,4248708405:1859728970,4248810771:-346220163,4248855555:201224,4248964732:16777216,4249308382:629539217,4249602117:-839041281,4249629024:536870913,4249635388:17039377,4249655479:-272688289,4249878445:4194304,4250234897:-272680357,4250241270:134218240,4250344993:-383972559,4250391855:-287352149,4250439574:1250640064,4250564861:1859867338,4250994732:-285264149,4251090524:16777233,4251430580:1308585625,4251564610:-270590977,4251568087:-400815335,4251647817:65536,4251676548:1859679946,4251703040:16777761,4251731339:-824346934,4251740147:-274789441,4251875020:650838536,4252692419:-383972559,4253062825:-268485697,4253116556:-400616951,4253230062:-287352149,4254194792:1823746561,4254794990:-824346934,4255538219:-285246465,4255618641:1820459656,4255645607:777716232,4255857871:-268468225,4256356615:1859876554,4256635217:1851457544,4256667911:575012897,4256961103:-268469313,4257251933:1299672081,4257498070:612368512,4257503935:-268468225,4257553428:1316618467,4257679158:1822818993,4257701476:17,4257719041:1324317929,4257762163:135333384,4258020153:-268468225,4258254222:1320565623,4258373578:-1375895681,4258601041:1859876554,4258736157:-401864695,4258939639:1746010176,4259029832:1627718453,4259112832:-285265238,4259143502:772891720,4259361935:576324104,4259481041:16910449,4259978018:17039409,4260015006:-285245461,4260211349:1859876554,4260213953:1859801794,4260467968:1746600456,4260572186:1859998408,4260679671:16777232,4261134369:-269009025,4261500156:16,4261839613:1,4262272210:-285261845,4262383589:-268469249,4262634516:-805339137,4262966794:-268484609,4263294194:-268468225,4263508267:-293655893,4263572970:553912617,4263584949:1859876554,4263821198:1859846858,4264191623:16777233,4264372118:33,4265278863:16,4265521539:-289459541,4265600307:-400815352,4265830826:-400881143,4265882026:1859876554,4266141576:1619919520,4266183727:-268468225,4266200429:262177,4266278501:-285246481,4266281335:17039921,4266394919:1859867338,4266716077:-285264149,4266868554:-838450680,4266968904:-272680065,4267200434:-319415519,4267465796:1744830984,4267576791:8519680,4267692508:-270590977,4267720310:-268485633,4267987460:-363001475,4268026893:1322809034,4268157273:-268484609,4268544229:-268471297,4268590527:216497697,4268726914:1700215559,4268966679:-1609629439,4269115543:1627717649,4269481311:-287344950,4269941417:135004704,4269989442:-401863896,4270146989:-268468225,4270425210:-276988033,4270468551:1859875530,4270578787:1859801794,4270595276:1090519041,4270940291:603979784,4271013752:-285442065,4271628185:-1588657879,4271750250:1,4271763247:-287365430,4271825210:17039377,4271925961:-283240135,4272223886:1859876554,4272273422:-268468225,4272636811:-1604386007,4272901982:-279110855,4273663403:1859876554,4273707595:97,4273888683:-2130246735,4273965903:-268468225,4273979358:1,4274016136:-268468225,4274054318:1619919392,4274386098:33686016,4274408220:-1588657623,4274479107:1855600328,4274566539:-287372503,4274897548:1812990257,4274923578:-306569815,4274970024:-285376533,4275168009:1090781457,4275248922:1,4275626944:-400877047,4276018557:1859875466,4276593811:-285262133,4276606664:1826304520,4276705348:777614922,4276761142:-300084728,4277037515:-401341912,4277065656:-400750211,4277123905:1073743905,4277448691:1859876554,4277538304:-1520499927,4277676755:4194324,4277683870:-316930023,4277706515:134217728,4277878316:1859876554,4278462461:-306233729,4278474055:1073750656,4278864381:-402388992,4278876418:1720861386,4278972471:-367193528,4279000497:-384038855,4279001966:-331533783,4279309774:-285245441,4279585106:512,4279599928:1180827747,4279852657:1724580360,4280142991:1859876554,4280470749:-440967255,4280521571:1851408904,4281079180:201457697,4281435449:-272680357,4281525267:650252994,4281674186:-320914455,4281785052:262149,4282154528:1859679946,4282226933:-1605435127,4282305529:33571328,4282315070:-268484609,4282391640:1825773192,4282688869:1746408010,4282726687:-306364545,4282825832:-347141351,4282878382:-293655893,4282954362:-268615681,4283058734:1830684689,4283066724:1,4283153215:1303722805,4283205227:-270590977,4283294503:-384562647,4283308288:131072,4283630826:-274789441,4283786316:1074201088,4283897739:-306758849,4283905278:-822127893,4284372523:-268485761,4284434560:-268468225,4284553603:1859876554,4284561078:-403149116,4285135993:-429981143,4285251670:-268550145,4285294334:-268484737,4285298084:642712377,4285378917:16777216,4285437027:-269009347,4285476536:133217,4285547299:16779777,4285646995:1859876426,4285899572:-1571946455,4285997586:1859876554,4286257689:-519765703,4286631068:-278979585,4286778738:1073741824,4286867240:-384038392,4287131213:-308332001,4287366951:-322994199,4287683181:-268468225,4287737058:1717240392,4288080259:-302040129,4288211433:1855656650,4288427336:1826322122,4288431506:-285246741,4288456470:-285245461,4288837231:1822032392,4289018661:705894409,4289125690:23070997,4289273034:1813512712,4289358895:-287503524,4289474248:-431029471,4289513683:-383972559,4290445468:1859679946,4290528386:1611338432,4290640889:-299953429,4290908805:-1911354983,4291282829:-1429339480,4291304513:-268468225,4291589230:643432968,4291611742:-285245461,4291816692:-285245717,4292150476:1851356746,4292211566:1691025416,4292373319:1855660682,4292416970:65544,4292473419:257,4292474613:1859876554,4292479460:1073872913,4292684498:1859876554,4293132813:-285245461,4293554978:-519828687,4293581527:-815981767,4293637870:-337835649,4293732005:-268468225,4293896655:-268615681,4294173238:-300016855,4294179705:-268559361,4294582693:-276988033,4294681065:1078005768},css:{225808:1859876554,658704:-285214997,661739:-285214997,755358:1859876554,846123:144326784,889938:1859876554,967602:-285212957,985371:1,1138034:-429981079,1349958:-285212949,1367043:135397384,1380234:-334383486,1588554:1859876554,1592645:1859876426,1603384:1321862784,1611787:1859876552,1650114:1859876426,1715772:1858827978,1745165:-287312182,1781885:1859875530,1848921:1859876554,1866694:-285213013,1909597:1859876554,1917980:1859876554,2107041:-325185016,2251328:1859876554,2264901:1859876554,2349623:1859876554,2433869:1859876552,2611547:1321947850,2632706:-298379551,2661928:-285214997,3115252:262145,3121097:786134152,3230674:1859876554,3458454:-285212949,3590876:1859876426,3783885:1859876554,3843897:1746403848,3898588:1859876554,4015441:1859876554,4182762:1859876488,4282539:-287312182,4554684:10092544,4589376:1,4754721:-285212693,4836490:1859876554,4881052:1859876554,5017890:1859876554,5032077:1859876554,5034516:1,5279412:-285214997,5488704:1859876554,5521676:1859876490,5621406:-2147483648,5641239:-287312182,5683916:1859876552,5787281:-287312182,5936487:-285212693,5952809:-285214997,5953237:-268435509,5977311:4194816,5983925:1859876554,6335403:134217728,6348786:1859876554,6402709:247608320,6622257:-285212759,6633451:1321947850,6633582:786134152,6694583:1859876554,6735964:1859876554,6856971:-285212693,6862430:1859876554,7036816:1859876554,7161053:134217728,7164133:-285214997,7347374:264192,7401491:1859876426,7419455:1859872458,7470075:1859876554,7496358:-288361848,7654182:1859352264,7710445:-285212693,7722803:1308828226,7863414:1715994624,7902571:1859876554,7991591:1859876554,8332214:1859876554,8622713:-285212949,8663541:-285212957,8844597:4194561,9010681:1859876554,9434418:1859876554,9595781:-287312182,9607176:-285212757,9625840:1826256586,9679155:1859876554,9706083:1859876554,9777982:1859876554,9936706:1859876554,10038937:1859876554,10127682:786134152,10452147:-285212693,10528052:1859909322,10677357:-285212693,10754748:1692090952,10859199:1859876554,10871314:-1944158206,10945861:1859876552,11170081:-1609826007,11212041:512,11309819:-285245749,11349981:1859876554,11383169:1859876554,11534794:-287312182,12131544:-285212949,12158097:-285214997,12255260:1859876554,12293765:-402388992,12365333:-285214997,12533941:192,12651635:-287312182,12723842:1859876554,12851928:-325184984,13063612:-285212693,13491498:-285212693,13510166:1791496832,13964597:1859876552,14002881:-285212693,14130268:-1610350591,14149389:1822294824,14207285:-285212693,14242808:67309704,14303320:-320995288,14570235:1859876554,14827941:1859876554,14890221:1859876488,14964873:1859876554,14971789:1859876554,15108988:1859876554,15218488:-285215093,15228924:-287312182,15368289:1813231395,15380823:-287436216,15430631:1859876554,15633363:-285212693,15651964:1859876554,15731385:1859876554,15769801:-285214997,15874989:1859868296,16094086:1859901128,16095897:1859876554,16126001:1862268491,16127061:1826248394,16128121:1826313930,16129182:1826322122,16130242:1826322122,16131303:1859876554,16312770:1859875528,16411491:1859876554,16416383:1859876554,16456063:-268501045,16473688:144326784,16537661:1859876552,16562241:1826190410,16577087:1682993226,16602571:1859811016,17070686:1859876554,17093068:1859876554,17110151:1859876554,17154160:1746403848,17359923:-287312182,17453664:-285212693,17507131:-2147483648,17567402:781910216,17663227:-287312182,18083394:1859868296,18416775:1859876554,18507472:-285212693,18589607:1859876554,18791261:-285214997,18923385:16384,18934377:1717239816,19241667:1859876554,19397969:-285214997,19946110:-287312182,20061407:1859876554,20688586:-285212757,20973674:-287312182,21609854:1859876554,21754115:1859876554,21873846:-1588657919,22075856:-285212693,22105154:1859876554,22189276:1826322122,22473570:1859909322,22552226:-285212949,22760496:512,23008434:-285212693,23194644:1859876554,23353142:1859876554,23783229:1859876554,23930694:-285212693,24277490:1859876554,24532626:1859876554,24667414:1859909322,24785750:1322988682,24927808:-285215093,25326626:-285212759,25760051:-285214997,25872453:1859872392,25993137:-287312182,25999224:1859909322,26052802:-285213013,26053366:-285212693,26059859:1859876554,26286100:-285212727,26511788:-285212693,26522428:1289355272,26526988:-287312182,26598772:1859876554,26702328:-287312182,26761203:1859876554,27005460:1859876554,27083506:1859876554,27204500:-285212693,27717664:1859876552,27763612:-285212757,27888728:1859876554,28043347:1725658826,28061236:1,28117673:1859850952,28198637:1859876554,28520511:1859876554,28595203:1859875976,28607133:-400621047,28757779:1859876554,29171295:1859876554,29282108:1859876488,29343165:1859876554,29516718:1859876554,29760562:-285212957,29770267:1859876554,30157835:1746403336,30227519:1859876554,30305505:-287312182,30352604:70144,30443924:-287309845,30627584:1859876554,30717844:1855714952,30938819:1855157962,30954701:1859909322,31004151:-285212725,31197784:1851458056,32040808:-2147483648,32298253:1246769792,32305510:-295763384,32397709:1859876554,32671916:1859876554,33025602:1859876554,33065128:-285212949,33089285:1859876552,33117180:1859876554,33148935:1859876554,33450469:1859868296,33579835:-285215095,33676525:1859876554,33678175:1859876554,33857486:801,34010211:1859876554,34145773:1859876554,34256029:1859876554,34802815:1859876554,35074048:1822123648,35082035:-285212693,35206789:1859876552,35274817:1859876554,35296213:1,35473710:-927649879,35646253:1859876554,35725874:-285215029,35879720:1859876554,36459854:1859876554,36540049:-285214997,36602750:1859876552,36702567:1859876554,36883111:1859876554,37739699:1859876554,38582612:1859876554,39016116:738431497,39461344:138493953,39939758:1859876554,40433881:709427208,40442445:-285213013,40651120:1859798666,41127443:1859876552,41300032:4194816,41316426:1,41504176:-285343765,41580531:1859876554,41628754:1859876554,41670014:1859876554,41806740:1859876554,41922545:1859876554,42011504:1859876554,42102445:1859876554,42379394:1859876554,42597889:1859876554,42778636:67110913,42962509:786134152,43116296:-530644439,43431307:1859876554,43584886:-411169941,43651376:1859876554,43698772:-1073477343,43793390:1859876554,43968598:-285214997,43998219:1859876554,44132800:1859868360,44728351:1859876554,44746678:1859876554,45169224:1859876554,45379526:-285212693,45977453:1859876554,45986096:1859876552,46103666:1859909322,46851309:1826230792,46915293:1859909320,47158291:1859876552,47372788:1859876552,47486267:-285212695,47872287:-293666199,48221940:1851478536,48228496:1859876552,48808041:1851487946,48960800:-287312182,49636896:1859876488,49753621:-285212693,50097714:1826322122,50147153:-289941789,50357567:-283178711,50410368:1859909322,50415497:1859876552,50895094:1859876554,51006463:1725658826,51035217:-285214997,51051970:1859876490,51082022:1859876554,51192887:1859876554,51332609:1851487946,51339464:2622017,51358695:1859876554,51582173:1859798730,51606537:-287313206,51885451:-285212693,51943735:1859876554,51956966:-285214997,52076742:-285214997,52138224:1859876554,52147480:1859876554,52333823:-440995861,52379586:1859876554,52660295:1859811018,52776092:1859909322,53609112:1859876554,53800054:1,53800157:1,53800636:262145,53800738:1,53800807:201392129,53802825:264192,53802893:264192,54046262:-285212949,54157158:-325189080,54250696:1121158848,54328456:1859876554,54410007:1859868362,54864530:1222755459,54875784:704659456,55663643:-1609956863,55735625:1859876554,56132221:608895496,56491847:1859876554,56498233:1859909322,56504781:1859876554,56917269:1859876554,57011804:1859850952,57192428:-285214997,57512342:1,57532575:1859876554,57542776:1859876554,57643379:81412096,58031687:1859876554,58060944:1859876554,58158239:1859876554,58316746:1859876554,58475863:1855611594,58675499:1859876554,58781070:-1605631703,58819729:1859876554,58858952:1826230792,59945846:1859876554,60166005:1859876554,61021318:1859876546,61431242:1859876554,61588402:1859876554,61978561:1859876554,62219423:-320990680,62348650:76677120,62956680:1859909258,64497183:1859876554,64706288:1791496832,65002531:-285212693,65239778:1859876554,65241196:1859876554,65419576:1859876554,65480933:33,6556e4:1859876554,65649408:-285214997,66083564:1859876554,66318172:1859909322,66429112:1859909322,66659640:-939259904,66663986:1859876554,66668177:-285214997,66697671:-323492117,66885673:-285212693,67155047:1822058186,67623382:1859876554,68173499:1859876554,68334813:1859876554,68347298:1859876554,68494022:1859876554,68596786:1859876552,68895323:596787201,68954826:-268435477,69308136:-285212693,69795025:1859876554,69870133:1657341440,70002664:-285214997,70180844:1813198538,70223667:1859875464,70456512:1859876554,70506327:1859909322,70625332:-285212949,71003333:-285212725,71382203:1859876554,71504034:786134152,72066939:1859876554,72599563:1859876554,72805873:1859876488,72933692:-402388984,72992796:541196864,73143678:1859876554,73449539:1859876554,73456415:1859876554,74085477:-285212693,74287434:-285212693,74302391:1859909256,74633657:1859876552,75248168:1859876554,75509621:1859876554,75708033:1859876554,75736614:1859876554,76829750:-285212949,77249247:1859876554,77296429:1859876554,77345272:1745879560,77633801:-289406999,77822301:1859876554,79336029:1859876554,80940897:1859876552,81194190:1859876554,81237014:-285212693,81535964:1859876554,81558297:1859876554,82399668:1859876554,82545278:1859876554,82726574:-285214997,83019954:-285212693,83091433:1859876554,83501844:1859876554,83600659:1859876490,83949074:-331481079,84037558:1859909322,84244373:-287312182,84672682:1859876554,84836293:536870912,85003043:1859876554,85024593:1859876554,85240166:1859876554,85360523:1859876554,85629372:-322961527,85660709:-285214997,85743011:1322931840,86446429:47187073,86531117:1073741824,86859708:1859909322,87127885:1222755459,87157077:-325185016,87449563:1859876554,87590141:1859909322,88065368:1859876554,88067318:1859876554,88386947:-285212693,88748993:1859876554,88777162:1859876554,89024051:1859876554,89703037:-285212949,89952478:1859876426,90354190:1859872392,90372402:1859876554,90463922:-285214997,92782961:-285212757,93353161:-285212693,93526516:1822032392,93627543:-285214997,93889927:-285214997,94188065:1859876554,94433418:1859876554,94854129:1859876554,94966802:1859876554,95185144:1073741888,95523143:1859909320,96203934:1859876554,96511299:1322940034,97653703:-285212949,97974200:-285212693,99139928:1859876554,99162783:1859909258,100007018:1859876554,100458690:1285161088,100557535:1859876554,100916549:713163392,101143089:1859876554,101309325:1859867336,101443742:-295761815,101751937:-285212949,101873333:1859876554,101980003:1859876554,102255292:1859876554,104470646:1859876554,104533266:1859876554,104584453:1859876490,104928903:1859876554,105200574:1859876554,105675596:1859909322,106012525:-285212981,106068561:-285214997,106225707:-322965599,106548476:1859876554,106703552:1858818762,106735600:1859876488,106816560:-318894071,106943094:-285213045,107169437:-285214997,107719415:1859876554,108314102:-285212949,108380558:-1608250879,108395049:1318287050,109652918:1859876554,110026367:-285212693,110049765:-285212693,113040607:1859876488,113273445:-2038703357,114287683:1075972353,114526370:1859876554,115154384:512,115944374:1859876554,116016731:-2147483648,116474072:681198720,116482898:-285212693,117051929:-285739349,117126073:75572864,117381675:-285212949,118269939:1859876426,118782632:1859909256,119858516:1073741888,119902707:-285212693,120655566:-285214997,121408071:1859876554,121919589:1859909322,122865439:1859876552,123497368:1859876554,123770271:1859876554,123803139:704659456,124227596:1686819530,125046094:1859909322,125132428:-287312182,126680217:1851588649,126694456:1859876554,127278984:-287312182,127536185:1859876554,127567134:-285212949,128744031:202899584,129846143:-285215029,132547432:-285212693,134945532:-394437397,135241020:1859876552,137562158:-285214997,4154593427:1859876552,4155998035:67273730,4156293890:-2030927133,4161406380:-323053048,4164676231:1859876554,4165161896:1859876554,4165190317:-285278549,4165405966:1851479754,4166495071:64,4166533925:1859876554,4166779749:-291541045,4167518229:1859876554,4169592138:1859876554,4170666734:-285212949,4171953547:1254848192,4172274955:1859876554,4172703289:1859876554,4172859859:1859876554,4173430173:1859876554,4173446746:-287312182,4175095279:-285214997,4175384383:1859876554,4175427535:1859876554,4175598830:1859876554,4175712735:1859876554,4176115140:-352618999,4176306610:1,4176395620:134357512,4176668801:-285212693,4176677383:1850762240,4177456346:1859876554,4177988298:1859876552,4178112524:1859872456,4178269855:-285214997,4178328780:1859876554,4178820659:264193,4178849439:1859876554,4178983573:-325184984,4179091098:1859876552,4179293770:776552456,4179753604:1859876554,4180131296:-325184984,4181170771:1321956554,4182596950:-362870231,4182664253:1851487946,4182894597:1859876488,4183624132:1859876554,4184396062:1822032392,4184570051:1859876554,4184767070:1692026440,4185349832:1859876554,4186080713:1859876554,4186137210:1859876554,4186470689:1822057162,4186615799:1670824960,4187573969:1859876554,4187734005:1859876554,4187847298:1859876554,4188019868:1859876554,4188084382:1859876554,4188188701:1859876554,4188404105:1859876554,4188485385:1859875530,4188948564:1859876490,4189066949:1859876554,4189735065:1859876554,4189891943:-285222197,4189945353:1859876554,4190165397:-939259904,4191245429:1859876554,4191884149:-285213013,4192020882:1859876554,4192138070:1859876554,4192541754:-285212949,4192675768:1859909322,4192788194:1859876554,4192818060:1,4193110812:1859876554,4193134405:1859875530,4193633386:-285212693,4193943193:1859876552,4194815316:1859876552,4195292353:-285212949,4195710173:1859876426,4196643106:1859876488,4196669206:1859876554,4196689940:1859876554,4196812677:-285215029,4196899282:-285212693,4196951930:1859876554,4197051207:1859876554,4198254537:1,4198317961:1859876554,4198500664:-285212949,4198758537:1859876552,4199070846:1859876554,4199611560:-400815863,4199688799:167772168,4199854394:64,4199911468:676946946,4199925343:-285214997,4200308473:1859876554,4200524164:1859876490,4200774008:-285212693,4201324221:1859876554,4203070496:-285212693,4203085893:1859876552,4203459784:1859876554,4203474048:1859876554,4204398575:-285215093,4204808882:-285212693,4204904863:1859876554,4204964772:-285215063,4205278244:1,4205611799:1859876554,4206505319:1859876554,4206767048:1859876554,4207376273:1859876554,4207390370:1859876554,4208551672:1859876554,4208828043:176816128,4208835140:1859876554,4209219768:1859850952,4209348373:1859876554,4209482394:1791496832,4209565069:33555456,4209741679:-1570831575,4210050623:-287312182,4210349745:-285212693,4210928514:1859876554,4211044821:1859876554,4211222855:1859876552,4211578475:-320994808,4211790915:1859850440,4211832794:1859876552,4212270621:1859876554,4212389998:1859876554,4212424339:1859876554,4212473271:-285214997,4212911299:1859876554,4213113774:-285212693,4213253722:1859876554,4213473442:131584,4213499273:1859876554,4213508616:1859876554,4213522469:1859850952,4213882078:-285214997,4214003444:1859876554,4214150739:1859876554,4214251978:-285212949,4214456340:1859876554,4214601290:1859876552,4214853554:1,4214861981:1859876554,4215034385:1,4215107698:785601738,4216047410:-285212949,4216399923:1859876554,4216415436:-285212693,4216554910:1,4216921060:-285802615,4217260500:-285212949,4217590968:1859876554,4217620762:1859876554,4218054328:1859876554,4218247950:1859876554,4218318181:1859876554,4218447027:1859876554,4218492320:1851462344,4218659666:-285212693,4218687143:-285212981,4218756107:1859876552,4219121950:1208223744,4220412764:1859876490,4220572202:-287312182,4220624938:1859876554,4221378653:1782661186,4221674456:1859909322,4222174446:134218240,4222785231:1859876554,4223727956:651387904,4223892637:202899584,4224227646:1822032392,4224562258:709587656,4224910304:1859876424,4225060871:1859876554,4225277708:-826223997,4225341739:1,4225854829:202899584,4226262071:-285212693,4227292772:1859909322,4227472114:1076888192,4227664696:1321957066,4227729270:1859876554,4227761817:1849906818,4228188266:1859352202,4229014153:1859876554,4229023552:1859876554,4229355823:-287313206,4229538515:-285212693,4229595769:1859876554,4229736671:1859876554,4230015103:1859876554,4230073762:1859876552,4230280718:1251458531,4230326530:1822058186,4230406998:-401864695,4230554852:1859876490,4230801815:1859876554,4230862344:1859909322,4230991595:537526280,4231586425:-285212725,4231645451:-285212949,4231649477:1859876554,4231724254:106102784,4232145042:1859909322,4232384487:1822057096,4233013500:64,4233045935:1859867336,4233125417:512,4233268708:1,4233449796:-431090839,4233530330:-289406997,4233735278:1859876554,4233934187:1859876552,4234052056:1859876554,4234420310:1859876554,4234581536:1859876554,4235011537:1859876488,4235289311:51511296,4235300564:1321957066,4235361102:1323000514,4235563543:1859876554,4235924263:-1031909887,4235974511:1859876554,4236324761:1859876552,4236433551:131136,4236526237:-400815863,4236918551:-285214997,4237168193:-285215093,4237216373:-285214997,4237378658:69470241,4237887297:1859909322,4238170496:1859876426,4238261743:1859876552,4238261824:1859876554,4238329731:1859876554,4238451604:1,4238528181:1859876554,4238541868:-285214997,4238586385:-285212693,4238749632:64,4238809747:1855157962,4240080478:-285212949,4240238329:1859876554,4241029206:-285214997,4241416423:1859876554,4241582309:-285212693,4241625423:1822123658,4241903641:1859876554,4242168596:-285212693,4242742979:-325184984,4242748324:1859850952,4242942783:-1610350303,4243001061:1859876554,4243024627:1859868360,4243110049:1859876554,4243162379:1862268555,4244452210:4194816,4244693967:1859876552,4244967883:-1609694719,4244974364:1859876554,4244985991:1859876554,4245192511:-285212693,4245446291:1859876554,4245608820:1859876554,4245689899:1859872392,4245762616:-325188856,4246256114:-285212949,4246432835:1859876554,4246966763:-402388992,4247004382:1859876554,4247478442:1859876554,4247489949:1859876552,4247821588:-285215061,4248044685:1745092616,4248096538:1859872392,4248190994:-285214997,4249031268:-285212693,4249268408:1822032392,4249273619:1859876554,4249294876:1859876554,4249503474:1859876554,4249580418:-285215061,4250226732:1859876554,4250265829:1859876552,4250287840:1859876554,4250786021:1859876554,4250844768:1318287050,4250952558:1318715522,4250965844:100696064,4251130604:1859876554,4251242442:1859876554,4251603592:1859876552,4251733591:-285212693,4251984383:1859876554,4252112068:681198720,4252478848:1859876554,4252609785:1284661888,4252619777:-285212693,4252629812:-855769079,4252747231:1212236992,4252839923:-285214997,4253175005:1859876554,4253392574:1859876554,4253680892:-285214997,4253685932:-868351991,4253923565:781849154,4254047313:-285214997,4254237681:-287312182,4254590538:-293626903,4254813825:1859876554,4255460078:1859876552,4255538548:1859876554,4255575209:1859876552,4255760264:1859335816,4255835651:1826230280,4256081578:-285212949,4256133693:1859850952,4256278803:1859876554,4256423271:1285186696,4256591552:1859909322,4256682705:1859876554,4256743105:2,4257059631:1826313930,4257091962:1859876554,4257184093:1859909322,4257337905:-285214997,4257395857:1859876554,4257521299:1859876554,4257762163:-927649879,4257829483:-287312182,4257950023:-285212949,4258270552:1859876552,4258736157:-400815863,4258789049:786134152,4258798932:1859876554,4258884547:1859876554,4259018130:1859876554,4259063103:1859876554,4259189524:-285214997,4259342647:1859909322,4259355610:1859876552,4259361935:576389640,4259439041:1859876552,4259906025:1859876554,4259950785:138493955,4260097760:1859876554,4260550265:1859876554,4260905934:1288181248,4261140237:-287312182,4261808204:1859876552,4262028328:1859876360,4262175058:1859876554,4262204833:1859876552,4262476899:1859876554,4262496372:1859737290,4262549762:-285212949,4263041060:1859876552,4263115811:1717261514,4263406408:-320866678,4263627916:1859876554,4263738565:-285212949,4264319580:-325188824,4264405546:1859850824,4264673792:-285212693,4264988277:4211200,4265425782:1859876554,4265455172:1859876554,4265600307:1744830472,4266031912:1859908746,4266175055:1859876554,4266629896:1859909322,4266643284:1859876488,4266691779:576,4266777299:1859876554,4266842967:1859876552,4266893942:1859876552,4266999877:1859909322,4267106364:-285212949,4267241165:1859909322,4267285492:1859872392,4267392321:1859876554,4267523556:6292801,4267576791:142737408,4267654051:681198720,4267669953:1312886792,4267727507:-285212791,4267956615:1859876554,4267966496:1859876554,4268128599:1859876554,4268279007:1859876554,4268282035:-285212757,4268409745:1859909322,4268732424:1859876554,4268966679:-1609629439,4269243150:-419430485,4269253170:-285212949,4269305853:1859876488,4269523164:1859876554,4269654106:-285212949,4269989442:-402391032,4269990855:1312886792,4270057748:1859872394,4270226178:1859876554,4270292650:-287312182,4270347648:-2030044245,4270469110:1859876554,4270616298:-285214997,4270771993:-287312182,4270934986:-285212949,4271567891:-285215061,4271628185:-1605435095,4271702756:1859876554,4271944861:1859876554,4272008383:134348800,4272636811:-1604386271,4272657751:1859876554,4272910574:1859876490,4272957369:1859876554,4273002349:1826322122,4273130610:1859876554,4273198056:1727462305,4273547368:1859876554,4273872031:1859909322,4273968818:1859876554,4273979358:1,4274105001:1826226696,4274335447:1074266240,4274386098:-2113797471,4274408220:537526792,4274439219:1851422344,4274621847:1859909322,4274838482:786134152,4274923578:1610747904,4275093902:1859876554,4275122439:-285212949,4275268984:1859876554,4275315172:1859876554,4275328932:1859876552,4275350614:-325185016,4275404011:-293631895,4275412342:135397384,4275495207:1859876554,4275688729:1859876554,4276105201:1813067555,4276109537:-285212693,4276249070:1859876554,4276351450:-285212791,4276430302:1859876488,4276662938:138493953,4277085981:1859876552,4277231834:1859909322,4277309814:1855672968,4277376128:1725658826,4277440519:1859876554,4277468245:1859876554,4277545652:-285212949,4277674711:1859876490,4277725366:1822032392,4278224771:1859876490,4278293224:4325377,4278366244:-939128319,4278508146:1859876552,4278705866:1859876552,4278818596:-2147483648,4278864381:-402388992,4278881089:-285212693,4278901317:738263553,4278972714:71434240,4279028156:1859909322,4279149247:1859876554,4279195162:-285214997,4279430277:1859876554,4279470769:1859876554,4279922205:1859876554,4279934561:131648,4280087939:1859876554,4280247692:-325188824,4280286820:67141633,4280312420:-285214997,4280762237:-285212949,4280772322:1859876554,4281018364:1859876554,4281065032:1859872392,4281091292:-287312182,4281200110:-285804917,4281274065:1859876554,4281275108:1859876554,4281395468:1859876554,4281858631:1859876554,4281882690:-285212949,4281882783:1859876554,4281926429:1859876554,4281953375:1859868362,4282027584:1859876554,4282215897:-285214997,4282226933:-1609629439,4282268956:1859850954,4282277811:-325189080,4282406159:1859876552,4282451992:1859875464,4282649526:1859909322,4282853661:-285212693,4282936969:1859876554,4282947907:-400815831,4282971780:1859909322,4283170048:1859876554,4283294503:1745879560,4283536338:-285214997,4283537294:1859876554,4283559108:1859875530,4283588544:-285214997,4283933323:-285212949,4283986930:1859876554,4284099908:1859876552,4284151294:1859876554,4284157693:1791496832,4284255058:1859859146,4284256767:1859876554,4284269931:1822032392,4284299438:1859876554,4284336204:-285212725,4284368657:134217728,4284568634:-285214997,4284581351:1859876490,4284633314:67309704,4284736901:1859876552,4284805626:-287312182,4285285978:1859876554,4285547299:512,4285574273:1859876552,4285806456:1859876554,4286031128:1859876554,4286204625:1859876554,4286416356:1859876554,4286421112:1859876554,4286431690:1859876552,4286485016:1859909320,4286559175:-287312182,4286594717:1855607304,4286596489:751100928,4286672171:-285212693,4286681213:1859876554,4286833836:1859872394,4286867240:1745355272,4287004274:1859876488,4287755360:-285212981,4287989704:-285212693,4288254119:1859876546,4288267370:-285212949,4288635235:1859876490,4288805270:1859876554,4289075198:-285212693,4289439912:1859876554,4289540753:1859876554,4289584252:786104386,4289755585:-287312182,4289892734:-285212693,4289993842:1859867784,4290028583:1859876554,4290057903:1859876554,4290065600:1859876554,4290262025:-285214997,4290314159:1759187528,4290387496:-287312182,4290459830:1846740608,4290526146:1859876554,4290685393:-287312182,4290698813:-285212949,4290722828:1859876554,4290750506:1859876554,4291082671:1859876552,4291295362:-325189080,4291365858:1859839624,4291609027:-285212949,4291698302:786134152,4291791496:-285212949,4291860755:1859876554,4291983156:5928008,4292290266:1859850954,4292389139:-285212949,4292555908:-285214997,4292730428:1826322122,4292799155:-325189080,4293006087:1859876554,4293072461:-822083957,4293083708:-285212693,4293175028:-285214997,4293272097:1859876554,4293391972:1859876554,4293445793:1859876488,4293451382:202506240,4293533175:-285212949,4293732798:1859876554,4293882049:-285212693,4293922031:1859876554,4294181364:-2137782656,4294336629:1859876554,4294362452:-276853975,4294399172:-285212949,4294443012:1725068936,4294460601:1859876554,4294503871:1859866760,4294720860:1859876554,4294820115:1859876554},erl:{157878:262145,579630:-1536369989,985371:1,1039496:-1342177281,1235783:-1342177281,1591479:-1342177281,2359011:-1342177281,2417197:33,2621164:-1342177281,3083801:-1342177281,3115252:1,3178380:84148481,3405236:804675288,3821546:-1889018459,4071504:-1342177281,4168709:16777217,4392798:-1342177281,4589376:16777217,5299387:-1343752193,5315016:-1342177281,5393397:16777232,5550489:188727287,5900689:-1342177281,5967824:-1342177281,6208107:-1895825429,6338478:800534527,6355028:-1343225857,6444531:-1443909657,6970374:1,7063656:-1342177313,7282005:-1342177281,7403755:17171313,7584843:212100752,7826548:16777216,8035280:-1473385599,8180952:-1342177281,8561817:-2130706411,8652460:33892352,8857281:-1350565889,9458472:-1568931861,10130353:-1895825425,10880685:-1944695291,11212041:16779776,11259315:16777216,11514592:-1342177281,12056913:-1342177281,12163998:-1342177281,12779148:-1342177281,13979552:-1602494493,14079334:17039377,14111180:16777233,14114361:17039872,14116482:19922944,14130268:-1610350591,14132354:118877953,14166288:-1608168831,14176994:203167761,14259741:-2014969873,14260835:213887989,14286053:1,14362664:16777217,14510814:16777216,14720508:-1979777025,14769321:16910385,15290440:158178105,15767205:16777217,15770386:17041920,15772507:126093825,15790465:-1342177356,16049249:-2127167431,16122122:-1590296515,16206931:804708351,16214049:16777233,16223593:-1376866596,16410431:-1544656193,16711168:-1358954769,16789478:-1591474160,16791598:-1397477652,16826304:-1342177281,16842464:17956921,17015259:-1342177281,17073981:-1343225857,17774667:-1375732001,18425880:-1342177281,18522374:16777217,18878605:-1342177281,18978694:16777217,18997761:-1590945607,19910677:797182849,20001750:121958101,20275682:16777216,20288139:33554449,21034987:-1342177281,21053681:-1523582032,21482418:-1342177281,21873846:558694401,22318224:-1342177281,22431760:-1342177281,22565396:801107967,22756924:1,24332682:-1358954517,24368893:17041921,24376341:-2013397009,24403397:16777217,24430667:-1360536093,24664352:-1342177281,25201773:-1342177281,25355638:138387445,26361145:-2088896515,26686513:33554448,27199021:-2124021033,27486989:-2136700284,28047376:17039921,28061236:1,29585458:-1342177281,30178870:17,30637108:-1342177281,30676289:770174908,31056216:17039617,31470430:1,31531618:-1342177313,31795211:-1430360155,32930725:1,33311862:-1376908363,33857486:801,33955704:-1342177635,34150622:-1376800785,34462096:-1358954497,34693866:-1342177281,35296213:16777473,35429574:16777217,36091212:-1342177281,37179500:-1342177281,38368734:53758229,38837183:-1342177281,39395202:-1342177281,39461344:16385,40015495:-1342177281,40162855:-1342177281,40602144:-1342177281,41197613:-1996092863,41233588:-1342177281,41234815:-1360536093,41316426:1,41357994:-1342177281,41816977:-1409351681,41870993:-1397424404,42224950:-1879048201,42231999:25559825,42523435:268435447,43327456:196341749,44322755:-1993397391,44828910:-1342177281,45689766:-1889665067,45980267:-1456074439,46037715:-1342308353,46109197:-1342177281,46329208:-1520153928,47196059:268435445,47842642:16777745,47845727:-1593441775,48295924:1,48457172:665113535,49167744:1,49686222:-1342177281,50101895:-1342177281,50126439:134220085,50768071:-1342177281,51095246:766781493,51275740:-2028081359,51481523:-1879048193,52843528:264219637,53029950:690359093,53481494:-2028638587,53688776:-1993994623,53799883:1,53800054:16777217,53800088:1,53800157:1,53800225:16777216,53800636:1,53800670:1,53800738:1,53802825:2048,53802859:16777217,53802893:2048,54799990:-2053762787,54949318:-1342177281,54969160:-1881673729,55086252:-1342177281,55663643:-1592917503,56108401:-1342177281,56902005:-1342177281,57359792:805306367,57898540:-1342177281,58164e3:20392592,58599982:17039617,58600659:-1393557783,59308438:16777216,59616018:-1442841601,60392736:-2014446089,60425452:131760980,62718271:805306367,63454930:-1342177281,64231435:-1342177281,64790892:17042193,64796897:804192255,64915997:40027601,65218780:805306335,65254328:2099328,65480933:16777253,66229371:1,66467334:-1342177281,67709824:-1358954517,67875894:267910805,68497616:162537472,68665291:203233489,69307371:-1452930455,69687502:-1359085627,69865379:88080384,70448081:-1349645415,71173148:-1343230017,71462452:-1343229953,71476435:268419069,72666936:768,75017580:-1376908363,75168769:-1358954497,75303661:264209,75446971:-2127822079,76484381:-1344307201,76839199:16779280,77482678:-1367474197,78502530:1,79520793:-1342177281,81392283:-1342177281,81869136:-1342185601,82703408:805306367,82952703:-1343488001,83208605:1,83231507:117735125,83441165:-1342177281,83784597:23085072,84836293:-1593442303,85531591:-1342177281,85906489:16777216,86495811:264220663,86752183:118812465,87630804:662699673,87776435:151391744,88505333:16777217,88664841:-1342734337,88798717:-2023883051,88922999:-1879048203,89042818:-1342177281,89076931:-1509949729,90030577:-1342177281,90147867:-1343488001,90238384:-1342177281,91558358:-1342177281,93815735:1,94543295:16777233,94600651:17040177,95031698:-1342177281,95365496:16777217,96348077:88080384,96357129:273,97144777:770174908,98178765:-1342701605,98442869:-1375731713,99289224:-1342177587,100411531:674106145,107047352:16777217,108290868:-1879048195,108356220:662699673,111618356:-1342177281,112381345:-1342308353,112642797:118845061,115129233:-1486945731,116502717:16777216,117126073:-2053017983,117404983:17827841,118234736:-1342177281,118272910:16777984,119021631:-2128215247,120330040:-1396258527,122656166:17825793,126123308:268435445,126272535:16777216,126287894:-2001237035,127522327:2049,127684019:-1880716289,128268115:662666905,128989260:18874625,134013330:545,134773916:665188287,137072213:-1342177281,4152698296:-1917973505,4156293890:-2052944921,4156627339:-1879048193,4161501651:-1343227905,4161655039:-1342177281,4161967245:-1342177281,4164015858:-1342177281,4166211628:1,4167333106:-1342177281,4172114486:-1342177281,4172348243:669981695,4172829098:-1342177281,4175787584:-1979777025,4176395620:136456969,4177241950:-1358959645,4179428767:-1358955009,4179649287:197132279,4182888543:238490400,4184688954:16777233,4184957393:703743192,4186380814:-1342177281,4187028958:564267509,4187585449:-1342177281,4188127282:134481944,4188980561:-1900023839,4188981984:5,4190598260:-1478492465,4192447395:16,4192758943:19270433,4192824689:804745205,4193252035:-1487011271,4196086620:-1409286145,4196477981:-1342177281,4197102603:-1881276449,4197638946:-1342181377,4198509982:-2128346367,4199718961:766783413,4199911468:-1350697269,4200186957:247459829,4200259565:-2127429575,4205019469:-1342177281,4205278244:16777217,4205918392:-1342177281,4205932925:-2130444288,4207276397:-1375731755,4207528378:239071201,4207891207:-2088897539,4208402215:74602721,4209558445:-1904572287,4209855533:-2053762657,4210736706:690359093,4210777704:-1342177281,4211343712:257,4211546653:-1521614807,4213313439:-1608127871,4213473442:17171201,4214853554:1,4214952446:-1342177281,4216554910:16777345,4219060843:-1358954497,4220270100:-1342177281,4220401036:-1346392075,4220720421:17171249,4220969619:-1359085589,4221088822:-1476419617,4221663797:-1342177281,4221919870:-1342177281,4222162943:-2055208803,4222174446:150997504,4223603502:-1342177281,4223708826:-1342177281,4224159826:804191231,4224883325:-1342177281,4226334149:-1588723143,4227798047:152045569,4228137412:-1358954517,4230395914:17040181,4230498503:19137297,4230564248:87297557,4231011037:268435447,4231342407:-1376383147,4231657873:264219637,4232796802:-1342193665,4233125417:16777728,4233268708:16777217,4233321999:-1995699916,4233806248:-1342193697,4235115070:-1342177281,4236255459:108136561,4237195305:-1342177281,4237197538:16777217,4237244340:-1486945735,4237630041:1,4237691900:559948885,4237979990:-1352794123,4240356292:-1490027600,4241235453:-1879048203,4241594381:234864629,4241861293:-1342177281,4241948009:16778001,4242448203:-1342177281,4242820562:118812465,4242942783:17039617,4242971735:-1342177281,4242977690:804777975,4244967883:-1609694719,4245186501:16777216,4245219575:-1342177281,4246343474:16777729,4246392993:16777216,4246606431:-1343303681,4246625768:-1342177281,4247997963:17039377,4248380634:-1342177281,4248586796:16777233,4248964732:16777216,4249186733:805306367,4249224191:805306367,4251703040:16777729,4252560142:-1343225857,4252944348:-1342177281,4254219879:-1342177281,4254584124:-1342177281,4255687282:-1342177281,4255689043:221580949,4255864964:81,4255868585:16777217,4256743105:-1554153781,4257419466:131631636,4258798572:268435455,4259832212:153393585,4259914367:-1342177281,4260119978:-1342177281,4260139295:-2119919771,4260361205:-1342177281,4260679671:87296528,4261181127:674106145,4262457775:-1342701569,4262832356:805304319,4263019050:665262975,4263809962:17039409,4263867048:-1385772119,4263974727:-1342177281,4264372118:33,4264376321:-1342177281,4264500874:-1879081473,4264885373:-1342177281,4265201013:-1342177281,4265365178:-1358954513,4265414537:-1342177281,4266281335:17039921,4266515585:771042301,4266928435:-1358954517,4267502753:-1342177281,4268452079:-1342181377,4268966679:537722881,4269014227:-1342177281,4269593528:-1342177281,4269681327:-1342177281,4270076484:-1355808839,4270940291:603979800,4271319519:-1979777025,4271398445:-1342185473,4271628185:-1592983263,4271750250:1,4272008383:-1996324859,4272665550:-1342177281,4273057437:602403839,4273089074:-2128210955,4273382863:-1393620043,4273460337:213827555,4273979358:1,4274293770:-1342177281,4274312408:-1985052777,4274386098:-2087845215,4274408220:-1592851959,4275018923:-1409554977,4276135286:-1950351363,4276337969:-1342308353,4276464715:-1493172233,4276662938:16385,4276762133:-2053762787,4276938760:-1342177281,4278072607:-1950470219,4279430410:-1342177345,4279585106:17041921,4280177454:106260865,4280286820:67141633,4280551918:-1342177281,4281813854:-1904215061,4281901001:783806453,4282033061:-1342177281,4282226933:983041,4282235639:-1342177281,4283066724:1,4283469693:-1342177281,4283540960:-1342178305,4284225395:-1342177569,4284317440:-1342177281,4284364900:-1889018715,4284476566:146254837,4284644890:118877953,4285300633:-1342177281,4285378917:16777216,4285843325:-1358954497,4286777888:-2128346319,4286813244:18875137,4286817451:63046869,4287075929:-1912605697,4287242949:20054073,4287274493:804257791,4287995034:-1570831575,4288421189:-1350573263,4288471586:118878005,4288584878:-1342177281,4288814860:264219637,4289764471:-1342177281,4289900890:-1926362113,4290338131:-1979777025,4290604977:-1342177281,4291408142:155065317,4291589230:-1487011271,4292473419:17040145,4292830723:-1342177281,4293296753:-1342177281,4293323348:-1342177283,4293444888:-1358954513,4293926586:-1422488609,4293940145:-1342177281,4293975356:-1887436801,4294060323:-1473418367},go:{157878:262161,248610:-384038120,286794:1160179699,312822:1291849777,516857:-805421057,520355:-308409544,662990:19269760,930576:-272699393,985371:1,1006937:16777857,1345121:-1343291393,1367043:152174601,1378817:-268533761,1550201:1224999217,1630004:-272695297,1730314:-385087111,2040508:-1552149641,2080024:-303129609,2417197:49,2472099:-268511361,2572512:-349901416,2628717:-268500993,2933420:-268500993,2969660:698614149,3115252:1,3178380:84279553,3327705:1073741824,3346625:1629493297,3843897:-384038359,3954286:-268500993,4066016:-268503553,4151669:1878982655,4168709:16777217,4185413:1637924277,4347633:-276905985,4589376:16777217,4988584:-268500993,5034516:1,5393397:16777233,5670066:16,5923409:27570353,6152544:-273743937,6335403:150994945,6624593:-268501121,6915263:16777216,6917868:-268500993,6970374:1,6991740:1090781489,7161053:150994945,7275523:60820273,7347374:-2147219456,7403755:17171249,7826548:16777216,7838456:1101398517,8007935:153127121,8224360:-805371905,8260801:16777233,8305673:1101401077,8561817:-2130706411,9030537:1873021489,9161004:-268500993,9537660:1877934013,9858649:1099303925,10099313:-373515331,10148532:-268500993,10329637:-306298951,11107708:-268503041,11170081:-1593573111,11212041:16779776,11259315:16777216,11372726:-1377530891,11566751:621152265,11837851:1092887089,12076871:-268500993,12293765:-402388992,12315381:1865608703,12336465:-384038343,12767082:-306561095,12904120:-268500993,12912345:-308409576,12920194:-268501025,13211372:27529265,13222653:16777216,13264747:-283374823,13447019:-302055425,13475198:-351532231,13633413:-268500993,13686510:-268503041,13764311:-268500993,13877616:1763049521,14012459:1091700793,14044289:-839192641,14079334:17039377,14111180:17039377,14114361:16777216,14115422:594285431,14116482:16777216,14130268:-1610612735,14176994:203167833,14196082:1829767473,14286053:1,14308622:1293814288,14375280:-268500993,14510814:16777216,14591161:-268500993,14673781:-268503041,14701271:-268500993,14737474:16908657,14769321:16910449,14801168:16908593,15159754:16777216,15361811:-268500993,15472811:-274855111,15536456:-272695297,15590433:1335106359,15612165:-308405955,15721538:-269025289,15758653:261364528,15767205:16777217,15770386:17041920,15973062:16777232,15990062:16777232,16214049:16777233,16410431:568740533,16418914:233765623,16445982:16777232,16652720:-384038343,16786296:-2128344687,16789478:-1591474160,16842464:17956913,16968589:27656693,16990428:16777216,17154160:-384038103,17160037:-268500993,17498994:-269549635,17739272:-272695297,18003220:1090519057,18330830:-268500993,18470013:1224736853,18489600:17041764,18576615:-304213129,18919737:16777216,18978694:16777217,18988782:1099303921,19113381:-807658697,20054193:205264985,20275682:16777216,20279616:-1480688641,20288139:33554449,20617239:1878982655,20848053:1292108593,21112955:-268500993,21190249:1107296273,21238109:-268500993,21428485:-272695297,21638658:1157890321,21794083:-268500993,22053366:16777233,22326632:-1448169515,22408304:25427985,22756924:1,22760496:17041920,23321953:84149041,24000086:-268500993,24140057:-375518919,24164978:1873997055,24192657:-268500993,24368893:17041921,24403397:16777217,25170246:153356885,25203451:17172853,25302584:-2147219167,25861352:-268500993,26458261:-382829571,26535154:16908545,26563380:-1556343945,26686513:33554448,26791657:-268500993,26875458:-268500993,27617324:8241,27675230:16777216,27696601:1840683987,27885964:-302055425,28047376:17039921,28061236:1,28334400:-272699393,29002672:1832314871,29078772:-1018806055,29217755:-308409832,29671673:-268500993,29979496:-270607847,30157835:-384038103,30183467:1090912625,30313384:16777216,31056216:17039617,31128651:1293813776,31340066:16910709,31470430:1,31633117:16777216,31707941:-274792449,31724377:-272695297,31934920:-314405931,31986435:-268500993,32185674:-339956803,32289089:-268500993,32304813:-306253924,32627218:17,32905286:16777233,32930725:1,33224413:-1457519855,33857486:801,33943938:-306254865,34357020:-281142919,34402752:16777505,34520741:16777217,34521928:1730602487,34695718:-283240071,34945569:-272699393,34984768:-268533761,35260567:-805371905,35296213:16777473,35429574:16777217,35644127:-268500993,35767771:-1342242825,35819977:-276906017,35990494:-279033319,37130708:-302055425,37788500:-407483393,37893087:-269025537,37945009:17040245,37994613:-268534273,38446883:-276889601,38477246:-268500993,38928210:-407479297,38985701:-306561095,39012185:1292765525,39131800:1090912625,39297288:1224740917,40074882:-1555018995,40289481:-272695297,40417970:16777216,40962509:-272699393,41134322:-268503041,41185797:1671757239,41197339:-268517377,41316426:1,41711838:1635778961,42184802:-268500993,42231999:25559824,42702644:-273743937,43089216:16777216,43488201:-276905985,43591071:-373493761,43603232:-310460417,43698772:-1073477343,44291106:393265,44314709:-268500993,44651348:16777216,44653584:-308409832,44851640:-268509185,45338769:1763049781,45657565:16777232,46061912:-451013761,46196904:-381882947,46384264:-2096100451,46394932:1,46495963:-377091083,46698887:1090650481,46759476:-268503041,46824593:-272695297,47179317:-272695297,47250144:-268500993,47548116:-308483201,47842642:16777745,47845727:-1593441775,48295924:1,48645720:1694761233,48819987:161874321,48933602:-816702473,49167744:33,49733158:-268765833,49880027:-1490679376,50262134:16777216,50322667:-306253924,50592641:-2128328303,50599692:-268501057,50801799:1877933047,50967813:-268500993,51103948:-306298951,51301246:-268500993,51920181:620923928,52184498:-312601737,52276737:17040245,52333823:-442192053,52673366:-268533767,52931331:151783985,53575990:-268501025,53699846:-268500993,53799883:1,53799917:1090521089,53800054:16777217,53800088:1,53800157:1,53800225:16777216,53800636:1,53800670:1,53800738:1,53802825:264192,53802893:264192,54290282:-805371905,54346941:-272695297,54799990:-2053762787,55226049:-306298951,55509314:1099301685,56448401:-805549067,56500929:-384038595,56920565:16777489,57512342:1,57740275:8389264,57886945:-273743873,57956270:-268500993,58283539:151257745,58526883:-919700483,58769064:1830685200,59110676:-268500993,59151406:1,59308438:16777216,59371986:-268501001,60499451:1090521088,60566242:-268500993,60775589:-274793553,62298329:1829767473,62321954:-268500993,62795819:-438039557,62975969:17041685,63118444:-268500993,63205075:16910449,63726515:-268500993,63906122:-1342244865,64033087:151128437,64646060:228854772,64790892:17042193,65254328:2048,65362088:1627390257,65429313:86173175,65480933:16777253,65950221:-274792449,66229371:1,66430165:-268511361,66659640:-402388992,66879321:-272695297,66959218:-272695297,67860197:50594097,68230315:-308409547,70033554:-1474033244,70080540:-268500993,71973889:16777233,72508811:-268500993,72720787:-272695297,72933692:-402388984,73171656:-268511233,73236021:-268500993,74213692:-268500993,74610078:620891152,74616828:-839640109,74682573:17039717,74698190:263325789,74713228:131841,75065238:-268503041,75164362:-440467463,75303661:264209,75346723:84149041,75682024:-306298951,76579359:-912224267,77112939:1308288665,77345272:-384562391,78470342:-268500993,78502530:16777345,78625431:-268503041,78690443:-308409576,80236629:16777216,81126781:-268501257,81184727:-308409576,82424134:1093067767,82595943:222100217,83350007:16777265,83551537:-339939399,83802698:-268500993,83947431:-306298951,84149128:-1879277603,84667952:-273743937,84702523:-268500995,84711301:2048,84826818:-272827459,84836293:-1593573375,84905720:-268509185,85226658:564832597,85797653:16910453,85835074:16777216,86274839:-268500993,86531117:1124075521,87875195:2113553,88400856:-272695297,90332110:-268503041,93079207:-919575279,93609208:-269025289,93643633:20,93815735:131073,93902416:-268503041,94543295:16777233,94825468:-268500993,95365496:16777217,95892971:1627390225,95933554:-838984737,96275653:16,96357129:273,96844629:150997509,96850547:1830029621,97059008:-1608250972,97191148:17172597,98490048:-272826435,98766868:-314700943,100350182:564527793,101399867:-274793553,101869258:-306282503,101907699:393265,102316150:-373493761,102633761:-268517377,105081308:-1503335945,105458216:-272695297,105831187:17039717,106472883:-268500993,106796398:-268500993,106963953:17041764,107047352:16777217,107287639:134481921,107586248:-268501001,107976297:-303653897,108380558:-1591473663,108792076:-268500993,109419007:-308409832,109639184:1293813776,111537333:-308409576,112224242:-268500993,112803698:1227631153,113349708:-270599169,115154384:16779776,115299950:-281214983,116388487:-283374823,116502717:16777216,117501027:-369180801,118060866:16777216,118272910:16777984,119214439:-384038599,119555263:1670126364,120330040:-1345926153,121477421:-1457520367,123639340:1763049777,125727594:-384038343,126272535:16777216,127522327:2048,132238158:-268500993,133937728:25427985,134013330:33,135496536:-268505089,135793726:16777232,136999220:-268500993,141085845:-268500993,4153890411:-268500993,4155359182:16777216,4161885970:-268500993,4162202409:-1995701435,4166211628:1,4166713037:-308376776,4167584877:-269025537,4167589213:50334513,4167595708:-270657099,4168123178:1627390001,4168238156:-272695297,4169439297:-381883975,4169829299:-268500993,4176761240:-268534273,4176821877:-272699905,4177056126:721683253,4177128734:-1419376104,4178820659:264193,4179336520:-268500993,4180330084:16777301,4180379855:32768,4181203553:-272695297,4181822412:-268500994,4182272228:19136785,4182310634:16777233,4182568200:-272695297,4183243148:-384038879,4184432574:84149041,4184688954:16777233,4184727394:1763049525,4185526275:-268500993,4185898014:-1350107137,4186181662:-379841673,4186457246:-314642532,4186470689:-306287633,4186479442:-306544647,4187406641:86437879,4188419887:-272695297,4188488973:16777233,4188835189:-308409832,4188981984:5,4189662286:16777237,4189749133:-268500993,4190165397:-402388992,4190247374:-316929255,4190874972:1091700793,4190889267:-384038343,4190986791:-268509185,4191378673:-846590987,4191523098:-1012596783,4192447395:16,4193063859:16908593,4193862568:-384038343,4194267180:-268500993,4194531788:-268500993,4194783435:-846331236,4195390424:-268500993,4195524322:-268500993,4195605543:27263601,4196584775:-308409576,4196820858:16780049,4197093837:620907536,4197858541:150994961,4197940497:1829767473,4198028626:86437879,4198674102:-306298887,4199611560:-400815863,4199794921:1637924277,4200259565:20054065,4201246879:-272729089,4201403077:1703280913,4201476126:-839194689,4201866639:16777216,4202263466:-314700943,4202738211:-1480688641,4205064510:16777233,4205278244:16777217,4205539918:-838942793,4205932925:-1989935104,4207222897:1627392309,4207931442:-1509684745,4208436036:-268500993,4209045637:-308540904,4209855533:-2053762785,4209948823:1199898516,4210011815:1341537271,4210016057:-268500993,4211059393:-269156353,4211427374:-268500993,4211984648:-272695297,4212563735:159434933,4213288978:-268500993,4213473442:17171201,4213592072:-306253928,4214637105:-307298371,4214853554:1,4215384633:16796849,4215502519:1341537279,4215752913:1705942973,4216163284:-268500993,4216359764:-273743873,4216554910:25165953,4216997402:-268500993,4217353886:-270601217,4218075297:-409068771,4218904977:-268500993,4219121950:1208223744,4219353612:-268500993,4219615482:-1583443081,4219858698:-268500993,4220044044:1336597495,4220828173:2069,4221812203:-268500993,4221946187:-384562887,4222162943:-2055208931,4222174446:150997504,4222517121:16777216,4222596666:-384038087,4222652671:-268500993,4223109845:620940824,4223268450:-308409832,4223314660:16,4223363418:1738283837,4223371075:151388533,4223674691:16777216,4224278404:-268500993,4225783353:-306544647,4226709454:-268500993,4226895904:-911186639,4226928135:-820098535,4227228989:8388608,4227426319:1637931505,4227798709:-268500993,4228002083:1073741905,4228247418:-268500993,4228867652:-268500993,4229295330:1840552659,4229320340:-268500993,4229388226:1090519089,4229448967:16777216,4229854253:-310460417,4230110934:-407483393,4230223119:16777216,4230326530:-306253841,4230365175:16777489,4230395914:17040181,4230406998:-401864695,4230968503:1877376707,4231019123:1878842367,4231232415:-381882951,4231662570:-417199691,4231737261:50595857,4232689753:16777216,4233125417:16777728,4233268708:16777217,4233509800:31475765,4234227921:-268500993,4234321867:-269549635,4234793550:-269549833,4235545135:-268500993,4235653793:1090650481,4236523106:-805404673,4236526237:-400815863,4236683279:-268500993,4237031727:16777216,4237047891:16777233,4237197538:16777217,4237378658:69470501,4237630041:1,4237702804:25165952,4237715685:-308409576,4237729630:-279033319,4238098492:-272695297,4238144722:-373519937,4238146701:-268500993,4238451604:1,4238655761:-270661195,4238840645:555745313,4238955640:16777216,4239490850:-1916878975,4239591837:-283766471,4239812740:153094145,4240049983:-272699393,4240198957:-843137103,4240646340:-316798152,4241057816:-268500993,4241214713:1292781909,4241393874:-268500993,4241445464:-268500993,4241486008:-269553665,4241948009:16778001,4242159741:-385611480,4242228090:255654905,4242331592:-268500993,4242544995:553779733,4242845814:25434677,4242942783:553910561,4242987764:-989331428,4243134914:86379377,4243166341:17039489,4243176625:-268500993,4243265187:161482961,4243305358:1082132757,4243347429:49,4243394753:16777216,4243763698:-308409832,4243924076:-276906273,4243943985:-402388680,4244436542:-272695297,4244652436:-268500993,4244791220:-318373071,4245048405:16910449,4245171891:-2146435055,4245186501:16777216,4245707260:-302055425,4245747620:1090521089,4245802308:17170741,4246144569:-407576777,4246186709:1738283805,4246233806:-268500993,4246343474:150995489,4246392993:16777216,4246545602:1694499125,4246714071:-268500993,4246730129:-375518919,4246767751:16777216,4246966763:-402388992,4247276852:16777216,4247534156:1073741841,4247997963:17039377,4248024956:1101267381,4248044685:-402388728,4248382200:-272830465,4248586796:16777233,4248964732:16777216,4248995886:1201938869,4250015220:1674201589,4250038401:-268500993,4250066051:153356608,4250867957:1342110719,4250932401:1730426293,4251090524:16777233,4251289812:-268500993,4251515894:1227627377,4251568087:-283374791,4251662396:-272699393,4251664313:-843137135,4251703040:150995489,4251938528:1761872673,4251985769:-272695297,4252024424:-268500993,4252174784:-314700943,4252268981:-385087175,4252396369:-316929767,4252666874:-919575247,4252934009:393269,4253311727:1292503381,4253814871:-316929223,4254082390:-268500993,4254970295:16779793,4255182860:-270599169,4255211513:-269553673,4255316442:-269549833,4255423080:-312714947,4255526190:16777232,4255817174:-372372489,4255868585:16777217,4256378521:16777232,4256396899:-268503041,4256486823:50596656,4256512762:-272695297,4256782333:-268500993,4257373395:1099174709,4257701476:17,4258346033:-839115813,4258736157:-400815863,4258764005:-268509185,4258939639:1763049845,4259303510:-270658561,4259373773:-268500993,4259481041:16910449,4259765722:-339940419,4259836781:-268500993,4260213953:-268545033,4260679671:16777232,4260805871:-268500993,4261045469:1193542069,4261155065:1772283859,4261767562:-268533761,4261839613:1,4262022432:-268500993,4262074177:-309404673,4262298873:-1593573007,4262607267:-339935297,4262666509:1877933047,4262867275:-2145384288,4262908779:-1553181833,4262988771:-268500993,4263098146:-268501001,4263572970:553912617,4263809962:17039409,4263888072:-1608250892,4263967693:-268500993,4264372118:33,4264447607:16810001,4264669669:16777489,4264686252:-268500993,4265278863:16,4265600307:-400815352,4265808264:17042197,4266281335:17039921,4266695968:-2130706432,4266868554:-821671399,4266931484:25186449,4267094708:-272695297,4267341037:-272699393,4267465796:-385611239,4267883468:16777216,4268281899:-1376330753,4268459128:-1543628809,4268525143:-1368520193,4268854457:20973589,4268909946:-377353995,4269056414:16777216,4269420199:-269550603,4269675349:-400275032,4269782458:-272695297,4269941417:151783985,4269989442:-401863896,4270169725:10504245,4270464092:801,4270530665:-268500993,4270578787:-268545033,4270595276:1090519041,4270618146:-268500993,4270932410:-268517377,4270940291:603979800,4271069121:1831271609,4271343156:-268500993,4271368637:150994960,4271569336:1669597493,4271636228:-268500993,4271750250:1,4271825210:17039377,4271866446:1236019761,4271925961:-283240135,4272008383:-1992128315,4272452975:-268500993,4272856305:-268500993,4273837503:-268500993,4273979358:1,4274417129:-273358985,4274479073:-306298951,4274600917:-268500993,4274814844:-272695297,4274897548:1829767473,4274923578:-306569815,4274937942:-269553673,4275112174:-921957831,4275168009:1090781489,4275248922:1,4275412342:154273805,4275721917:-279047305,4275970327:-369172481,4275982296:-269550603,4276157626:-839194721,4276377486:16777216,4276418465:-272695297,4276446098:-268500993,4276619857:1,4276631898:-268500993,4276762133:-2053762787,4276939770:-1593573087,4276959084:-306298951,4277064386:-268500993,4277139549:-302449153,4277683870:-316929767,4277706515:153092369,4277744081:-268509185,4277875829:-314127371,4277899820:-339935297,4277996249:1864822775,4278474055:1772366737,4278552289:16941585,4278798324:-805383305,4278864381:-402388992,4279000497:-341964487,4279066958:1637915125,4279189533:-269025281,4279328482:17170741,4279585106:17041921,4279693343:-268503041,4280081132:54578485,4280259755:-270644711,4280286820:1,4280477085:-308409544,4280521571:-279033319,4280612576:553779733,4280837617:16777217,4280852701:10504501,4280936741:-268500993,4281021189:16777216,4281076887:16777233,4281196136:-268500993,4281525267:-1480188937,4281561665:-268500993,4281606763:1293993265,4281646379:18907136,4281702983:16795921,4281785052:262165,4281953124:-344032393,4282228437:-271660033,4282423678:1694498841,4282527847:17172853,4282643679:-268500994,4282947907:-400815831,4283058734:1830684689,4283066724:1,4283294503:-384562391,4283308288:16908593,4283737743:16777216,4283823160:-272695297,4284330711:1329396473,4284409298:-268500993,4284942969:-268500993,4285108920:17,4285205984:-268500993,4285251670:-268550145,4285274978:-306262120,4285378917:16777216,4285468426:16777216,4285476536:16910709,4285547299:17042177,4285669101:159779473,4285695756:-272695297,4285717623:16529,4285814382:1293552469,4285830964:-268500993,4285835948:-268500995,4286093114:16,4286176106:-268500993,4286337134:16777232,4286361629:-268500993,4286379094:-272695297,4286421575:1865608447,4286494909:16777232,4286515072:-268503041,4286548794:-270611457,4286813244:18875137,4286867240:-384038136,4287475292:-268500993,4287844405:-268500993,4288221917:-268500993,4288314195:-308409576,4288455364:-268561409,4288514097:698362561,4288537134:-1343291393,4288837231:-308409576,4289179655:-373526599,4289273034:-316929256,4289712662:-268501057,4289799287:-268500993,4290000030:-276889601,4290105639:-268506113,4290322988:1671752117,4291001068:-373519875,4291089718:10522673,4291152846:-273744897,4291323072:-846591243,4291355449:-268500993,4291759108:-277322351,4291963186:10504213,4292001775:-268500993,4292061586:1832297335,4292378708:-306312335,4292473419:17040145,4292479460:17,4292920498:-268500993,4293188392:-302055425,4293974359:-805371905,4294049490:-1510942217,4294559889:264035773,4294763449:-1448170539,4294816284:-805371905},hs:{312822:1291845649,662990:221677697,985371:1,1006937:16777857,1102146:33556565,1216261:-805306369,1219091:-805306369,1350040:221753333,1550201:1224999217,1629517:-809500683,2182112:-805306379,2346861:-805445901,2353610:1308622837,2417197:49,2611547:-808463377,2798974:268435453,3073857:-805306377,3399341:-805306371,3425564:257,3821546:-1880629785,4168709:16777217,4243213:-805306369,4384533:-805306369,4589376:16777217,4616513:16777525,5393397:16777233,5503523:-805355521,5550489:188727287,5550922:1225130325,5610885:-1980884099,5670066:16,5679785:-805345281,5829596:-805311499,5923409:1101312689,6136691:-805312513,6335403:150994945,6457490:-847520003,6633451:-808463377,6641101:1342177269,6748576:-806357009,6915263:16777216,6970374:1,7068354:-838860811,7088013:1329465717,7094162:-805306369,7298153:-805306401,7347374:2048,7750920:-805306369,7826548:16777216,8081866:17039925,8260801:16777233,8561817:-2130706411,8652460:33892353,9046625:17042197,9318819:27315345,9735632:-805306371,10209185:1332134877,10690576:1328934544,10761806:-1879048193,11212041:16779776,11259315:16777216,11837851:1092878864,11989645:-838860811,12723894:-805306369,13116235:-2041360751,13186594:16777233,13600674:84085145,13924342:-805306625,13970120:-805306379,14012459:1091700793,14078273:17039377,14079334:17039377,14111180:16777233,14114361:16777216,14133415:-830996867,14166322:17042197,14176994:203167833,14242808:-2054450995,14260835:213363701,14275715:1327612117,14286053:1,14460225:1308622837,14510814:16777216,14520305:-838860805,14670600:1232317285,14720508:-1979777025,14769321:16910449,14770381:221604881,15033931:50467601,15079235:-805310475,15170568:-805994507,15306955:-839041313,15590433:1335106359,15608681:-2048416779,15702451:17173493,15756532:184937553,15758653:261364528,15767205:16777217,15770386:17041920,15811210:193228757,15822346:151259253,15900443:221315473,15973062:16777232,15983590:-813700097,16064360:150997009,16123446:1332871103,16214049:16777233,16572466:-805306369,16705534:1237319669,16737381:1304297461,17052116:-872464387,17372727:-806363137,17636544:-805306379,17716855:-805339241,17777397:16810129,18003220:16777232,18359512:-988331145,18419500:-977817611,18978694:16777217,19046880:-1921073291,19113381:-807658697,19227798:-2013495395,19685101:-805306379,20054193:203167825,20275682:16777216,20288139:33554481,20660571:1266970613,21190249:1107296273,21611024:1229520912,21638658:1090781201,22029774:-805306369,22053366:16777232,22113923:-1879048193,22408304:25427985,22756924:1,22759334:-843120651,23086034:1267006709,23811864:-805306379,24217541:1260839389,24403397:16777217,25039661:-809500683,25355638:213893109,25905522:-805306379,25989237:-843075595,26686513:33554448,27637131:-805306379,28047376:17039921,28061236:1,28156063:1090521525,28244819:-805486625,28431074:-805306369,29775042:52445713,30178870:17,30560050:-2022579397,31056216:17039617,31470430:1,31677814:-809538119,31926737:-805607425,32071611:1090846773,32559286:-843120651,32627218:17,32798312:-1879048193,32930725:1,33195241:-839041281,33444354:-805306369,33485672:-818352267,33857486:801,34631006:-2061481327,35903495:-805306369,36092712:1232397457,36175105:-872415235,37103629:-1990047023,37175828:-805306379,37945009:17039733,38427788:-809538115,38544984:-1920996355,38601297:-843120651,38859640:-805355521,39176522:-805306379,39286294:-886008353,39297288:150994997,39412266:-805306379,39461344:16385,39711415:-1891689995,39871665:-973301005,40346254:-809500683,40397027:1333127167,40859954:-805306369,41316426:1,41530750:16777216,41866484:-1887436837,41959020:-877133835,42523435:230146039,42795491:-805306369,42940024:-805306369,43327456:-1950355467,43484549:-809500683,43540191:-805306369,43964594:-805306499,43996579:1342177269,44286641:-809500683,44286813:-809500683,45378551:-805306369,45582514:-805306369,45637566:151388485,46032540:-805607433,46394932:1,46515170:-805306379,46593619:-805306369,46691660:95161985,47196059:264224725,47821645:1232579429,47842642:16777745,48295924:1,48795731:-806879745,49167744:1,49387022:-805486881,50262134:16777216,50508812:-843071563,50551050:1330697427,51346035:263696373,51546169:-809500683,51590733:-1879048203,52343498:-805306369,52481438:-805308417,52843528:264219637,52922926:-906035201,52972933:1298484183,53419340:-805306369,53800054:16777217,53800088:1,53800225:16777216,53800670:1,53800738:1,53801765:6291461,53801833:16779317,53802859:16779265,53802893:2048,54362686:-1879064619,54622196:-847332363,54646632:-805306369,54864530:140624897,55940419:-805306369,55954413:-805306369,56920565:16777489,56981766:263716784,57512342:1,57740275:8388624,58164e3:20392592,58418777:-1045328987,59151406:1,59162956:1260636119,59308438:16777216,59478356:-977817611,60425452:131760980,62354519:-977813515,62386387:-838860801,63058711:-809500683,63205075:16910449,63486092:1328015327,64250955:158909584,64607582:39173521,65254328:2048,65480933:16777253,65688808:-813702147,66229371:1,66728518:-939663373,66897278:-813694977,67018699:-805306379,67955005:-805306369,68460398:-1891577711,68665291:203364561,70141805:-1879048203,70172800:-805306369,70337921:-805306369,70600208:17,70619273:-1954548867,71715122:16,71973889:16777233,73467024:1260776592,74034803:-838860801,74616828:-839115813,74814065:-814235777,75303661:264209,75307157:-1005108361,75794974:-809538119,75874424:-805306379,76293342:-939589641,76984266:1341125887,77001521:-807044609,77432531:1328018807,77495235:-838877193,77683272:16777216,77860285:-1996041251,77906151:159514997,77998429:-808454145,78390683:-805306379,78502530:16777345,79040457:-805306369,79172597:-809538119,79181248:-1053495901,79314245:-838860811,79448493:221769268,80118199:16777232,80981620:131760980,81511892:1333264383,83208605:16777217,83943018:1262922679,84458683:-830472579,85797653:16910453,85835074:16777216,86305278:-1879048203,86373158:-847332363,86752183:118812465,87127885:140624897,87192648:1135215124,87875195:136334481,88505333:16777216,89684706:-843055115,90625292:-941370145,91265804:-805306369,92026643:1262922673,92353490:-805306369,92354827:-939524139,93204947:1211950224,93214626:16777216,93601542:-805306369,93643633:20,93815735:1,94479397:17039665,94543295:16777233,95209774:-830996867,95792279:-805607425,95933554:-838984737,96275653:16,96357129:273,97037385:-1879048193,97118220:207477461,98012884:193326549,100150464:-805312513,100285116:-843055115,100979080:-819404939,103362094:17039377,106465091:-805306369,106742262:18311189,107047352:16777217,110202803:221769713,110973774:-848731179,111736729:230369721,113624955:-939729165,113891461:222269105,115512222:-805306379,115626622:153518453,116502717:16777216,117126073:-2053017983,117404983:17844225,118272910:16777984,120628376:-805306369,120866495:16908289,120985419:-805306369,121465287:-809538119,122278821:-805306369,122656166:16777217,123514446:16777521,124476609:-843055113,125274588:-843091979,125550710:-809566219,125626453:-814235777,126123308:264224757,126272535:16777216,126287894:-1933590539,126594529:-805306379,127411536:-1879048193,133534634:1090846773,133937728:25427985,135001186:-805306897,137500009:-809500683,140910398:134283665,4152020555:-805306369,4155485543:-1883242507,4155987191:16777233,4159656364:-1921052976,4159787817:1270874101,4163805900:1328934544,4164904318:-814486539,4166211628:1,4167506975:1333778655,4168425242:-805306369,4169231319:-805306369,4174632973:263666608,4175431657:-805306369,4175787584:-1979777025,4176306610:1,4176887443:-843120651,4176903623:1262283792,4180379855:32768,4181597292:-1916928011,4182272228:16777489,4182977442:-806364683,4183471620:-838877291,4184688954:16777233,4186746922:-805306379,4188488973:16777233,4188507441:-1879048193,4188980561:-1883246603,4189146339:-1879212649,4189662286:16777237,4190865304:-805306369,4192011667:-813695013,4192447395:16,4192462479:154569108,4193138622:-843186187,4194994308:-1916928011,4195486818:-805306379,4196578481:230141941,4196743059:-805306379,4197051882:-820023911,4197060545:65,4198807616:1258618101,4198957912:-805306369,4200186957:-1883246603,4201093440:1159200788,4201327656:-805306379,4201983957:-809500683,4202339965:-807429313,4202693390:277,4203008004:-805306369,4203380996:17039925,4203811927:1337458609,4205064510:16777233,4205105413:-809500683,4205214670:203431985,4205278244:16777217,4205539918:-843137097,4205804568:1101170165,4209484231:1328934544,4210109905:151259381,4211995930:1237319669,4212301731:255723893,4212563735:159402037,4213002703:-806356993,4213574720:-805306369,4214281187:-805306369,4214682823:1093067253,4214853554:1,4215197273:-805306369,4215212654:-805306369,4215384633:1098927281,4215584513:-847938251,4215722242:1232579429,4216532351:94646161,4217452799:-805306369,4217466333:-805306369,4218352214:-843137135,4218387618:-838860811,4219211329:-805306369,4220311640:1342164959,4221135663:1333788671,4221136126:-805306371,4221533097:-805306369,4221542050:85396409,4222162943:-2055208803,4222654750:-805470825,4223314660:2192,4223387233:222269105,4223604833:-805306369,4223795429:233268661,4223904054:-872415233,4224660046:-805306379,4225341739:1,4226035935:-807429313,4226170060:-805312513,4226265868:-808454145,4226397365:1198938585,4226508172:-838860803,4227228989:8388608,4227615382:-1921553391,4227744497:259370132,4227798047:152045569,4229736141:-805306369,4230030974:1090650129,4230188886:-805306371,4231657873:163556341,4231713560:153381904,4231737261:50595857,4232219146:-805607425,4233125417:16777728,4233268708:16777216,4233712266:-805306379,4234517295:-1954254891,4235496723:-807044609,4235719085:1337442225,4237031727:16777216,4237047891:16777233,4237197538:16777217,4237264852:-813696297,4237630041:1,4237702804:25165952,4238395373:-838860801,4238451604:1,4238484567:-2015321605,4238749632:65,4238784733:-940598563,4239490850:-1916878975,4239583093:-805306369,4239812740:153092097,4240198957:-843137135,4240860043:-1949738075,4241050706:254141407,4241144047:17039925,4241186408:-1988165633,4241594381:234864629,4242068206:1333788671,4242360649:-943718401,4242820562:118812465,4242962262:-906035201,4243134914:86378865,4243262543:-805307395,4243315449:-805306369,4243516495:-814404601,4243583465:-843251723,4243794829:-805306369,4244155948:-805306379,4244488387:1337392049,4245048405:16910449,4245186501:16777216,4245348105:159779829,4245593180:-805308417,4246880792:-2053078819,4247377629:-805306881,4247409480:-805306379,4247534156:1073741841,4247997963:17039377,4248129005:-922353195,4248374383:-2005343216,4248586796:16777233,4248925745:-805306369,4248964732:16777216,4249602117:-839041313,4249635388:17039377,4250066051:150994944,4250295012:1267137781,4250385625:-805306369,4251090524:16777233,4251647817:134283537,4251664313:-843137135,4251753868:-839122955,4251972279:-807633153,4252747231:140625345,4253182605:-809500683,4253338862:-805306369,4253431070:-1879048193,4254296140:1295448540,4254516263:-805306369,4254970295:16779793,4255526190:16777232,4255674917:-1913882667,4255724047:-1988107267,4256178710:-843055107,4256378521:16777232,4257223158:-805306369,4257251933:225799185,4257419466:131631636,4257701476:17,4258254222:1337342839,4258346033:-839115813,4258805576:161967989,4258985792:-805306369,4259155275:1299768464,4259190266:-805316609,4259262842:106655121,4259481041:16910449,4259978018:17039377,4260813285:-843120713,4260839428:-1879048203,4260954329:-805306369,4261839613:1,4262117528:-843055115,4262867275:-2145384288,4263028402:-1993088047,4263809962:17039409,4264353306:-805316609,4264372118:33,4264447607:16810001,4264669669:16777489,4264792156:-805306369,4264960086:-805478443,4265278863:16,4265647928:-805306379,4266281335:17039921,4266312412:-805306369,4266931484:25186449,4266948725:-805306369,4268047615:-805306369,4268132007:1296032912,4269107183:1310682265,4269732530:-805306369,4270464092:801,4270595276:1090519041,4270809803:-805470305,4271319519:-1979777025,4271368637:16777232,4271750250:1,4271825210:17039377,4271921185:191152605,4272008383:-1992128379,4272556791:-805306369,4272672517:-1005108361,4272794185:-920647663,4273034693:-939597889,4273707595:16777329,4273979358:1,4274054826:-813695105,4274057631:-805830721,4274879905:-805312513,4274886360:-805306379,4275168009:17039377,4275248922:1,4275415354:1099170805,4276619857:1,4276662938:16385,4276817250:-809500683,4276967737:-1883246603,4277150403:-805306369,4277230379:-1879048195,4277235591:-805306369,4277995125:-845018635,4278608509:277,4278738734:-809500683,4279843388:-805306369,4280177454:106260865,4280285899:1308622837,4280754027:-805306369,4280837617:16777217,4280906548:-805306401,4282088778:16777233,4282407623:-839122955,4282415783:-830472579,4282491689:-805306401,4282525618:-805310475,4282882433:16777232,4283066724:1,4283076541:16777232,4283445483:-843055115,4283827240:-805314571,4284317191:-1979777025,4284364900:-1880630107,4284367187:-805306369,4284427684:1307080115,4284476566:213887989,4284488494:-805306369,4284633314:-2054450995,4285030563:-838860809,4285108920:17,4285119706:-2122900619,4285273820:-805306369,4285378917:16777216,4285476536:16779573,4285623962:-843071615,4285717623:18577,4285901309:1202323476,4286494909:16777232,4286778738:1335362268,4287928599:-838860811,4288265271:-805306369,4288431019:-1916928011,4288471586:118878005,4288634252:-805306369,4288814860:264219637,4289046369:-872415243,4289496156:1232315237,4290338131:-1979777025,4291820327:6357013,4292255862:-805306369,4292416970:67307929,4292473419:17040145,4292479460:1073872913,4292684956:-1879212641,4292931285:-805306369,4294086996:-805306369,4294529541:-2124021483},html:{570856:1859876552,864246:-285215221,959452:1859876426,1006937:641,1292638:-285212693,1348306:1859876426,1367043:135397384,1403756:1859876554,1603384:-288377207,2195630:-285212919,2497454:-285212677,3109912:-285212949,3115252:1,3178380:67108864,3270687:4194304,3327705:-1073086464,3537415:786134730,4102685:-285212693,4144856:101869056,4168709:16908289,4408586:-285212949,4559038:1859876554,4653303:-268435495,4931231:-285212725,5142676:-268435589,5196787:1854030472,5268161:1859876554,5420415:1859876554,5950482:-268435461,5953237:1859876424,5977311:4194816,5982534:1859876552,6335403:153094145,6617495:-1879048229,6656168:-268435591,7161053:153094145,7347374:264192,7601193:709501448,7803658:1074921480,7863414:642252800,8007935:1207959744,8118418:1724478976,8343810:1859876426,8475852:1859876554,8561223:536871424,8998730:-285215159,9111700:1083179648,9156976:-285212677,9292788:68747776,9449580:-285212725,9625868:4194816,9720567:1859876554,10092522:1179783680,10122749:705303048,10296665:-285213111,10303335:1859876424,10326360:-285212693,10329637:1822045832,10390662:-268435493,10438369:-285212677,10648080:-268435591,11048995:-285212677,11192408:-268435493,11837851:1076101632,11921674:-268468391,12245684:-268435591,12282862:-268435591,12293765:1208223744,12324445:-285212855,12419915:-268435509,12767082:-323340664,13037484:1859876426,13158003:-268435589,13827509:-268435589,14012459:1074921480,14069931:-285213111,14079334:1,14166288:537485952,14286053:1,14308622:1275723776,14319729:1859876552,14324529:-285212919,14707783:-268435461,14722629:-268468391,14800107:1859745352,15057468:-268435463,15228924:1851487946,15254847:-268435591,15327931:-285212693,15365119:1859876554,15426780:258159377,15765074:1791718920,15886958:1255671432,15977618:4194304,15997217:-268435591,16126001:1826321994,16211928:-824781159,16312770:1859875528,16399816:-285215030,16456063:1725067848,16602571:1859811016,16623335:-285212677,16765582:1859876554,16789478:536870912,16805384:537395208,16809557:-1494347062,16875371:536900296,17154160:-400817656,17635686:1859266176,17856106:-285212981,17902675:-268435591,18065573:1859876424,18431025:1859876552,18465321:1859909322,18723393:1859876552,18843065:-1360070966,18934377:1717239816,18978694:16908289,19326669:775946760,19498677:1859745352,19866709:1859876554,19931715:-285212709,20366406:1610612736,20713994:1859876554,20777281:1862268488,20827202:1323005512,20848053:1275068416,21005886:-285212679,21137482:1859876426,21611024:1213793288,21638658:1073741824,21873846:4521985,22493849:37748736,22588531:1753970312,22756924:1,23238444:-285215157,23814645:-285215157,23936458:1859876426,23948370:1859876554,24140057:-400818168,24403397:16908545,24551576:1859875528,24720473:-268435589,24794573:1859876554,25097463:-285212693,25131001:1859876424,25156466:-268435591,25339612:1859875530,26240530:-268435589,26457357:-318767141,26535154:131073,26686513:33554432,26771193:-1348924663,26923413:-291644599,26975240:-268435623,27053672:1859876426,27172393:1859905160,27672088:-268435591,27791569:38273024,27866043:-268435461,27961962:134217728,28710765:742391808,29085431:1859876554,29136365:1859876490,29217755:1822032392,29502710:-285212981,30352604:1074084609,30443924:1720931904,30809278:-268435623,30968600:1859876554,31128651:1275723776,31421214:1859876554,31636883:-285212677,31814205:1677721608,32102171:1853880841,32104404:1859876424,32456993:-285215030,32799730:205520896,33522150:-275051751,33707094:-285212919,33714165:-268435461,35473710:1217463816,35473772:1859909320,35589448:-285212677,36292998:1859745352,36732576:-285212725,37154389:-318783525,37408233:512,38789345:1859876554,38985701:-323349463,39268185:-268435591,39340791:-285212677,39436425:1859876554,39461344:16384,39470785:1859876554,39526178:1859876554,39624555:-285212677,40174901:-285212677,40212365:-285212805,41300032:6291968,41382737:-285215158,41427644:1859859146,41711838:1619001472,41967576:1859876552,42608212:1851479552,43409851:1859876554,43584886:1682571272,43777532:1859909320,44590143:-285212693,44709234:-285212805,44816984:1859909322,45212170:1820533384,45342420:-285212949,45884475:-285212725,46068699:709501448,46136499:-268730791,46915763:-268435493,47896330:-285212679,48566942:-268435623,48684042:-285212949,49950227:-285212727,50219143:1859876554,50357567:-400621559,50367920:-268435461,50592641:16512,50842484:1859876554,50953069:1859876554,51103948:1822045832,51846260:786069194,51941952:-285215158,52023050:-285212679,52333823:1686120010,52636545:1859744776,53008737:1859876554,53157110:-285212855,53684440:-285212693,53800636:1,53800670:131073,53800738:1,53800773:167776256,53800807:65536,53802825:2048,53802893:2048,54086453:-285212693,54218015:-285215157,54864530:138494976,55139601:1792767496,55226049:-323340664,55240760:1744847496,55488786:-285212677,55663643:537526784,55768327:742392832,56171430:1859876426,56374987:1859876552,56869268:-268435589,57211710:1859876554,57601377:-285212727,57740275:8388608,58438802:-285212981,58769064:1276772864,58984970:-268435461,59302528:-285215157,59308438:16777216,59599707:1859876554,59736337:-268435461,59895090:-285212725,60285554:-285212725,61274902:1859745290,61341392:1859876424,61363880:-285212949,61654680:-285212725,61688837:1859876554,62465192:1859876554,62486203:-286262071,62706675:1859876554,63635500:1859876552,63661543:-268435589,63753347:1859876554,64481428:-285212693,64550619:-268435493,65362088:1610612736,65737461:608829960,65755075:1859876554,66151117:-268435589,66659640:1208223744,66783811:1859876554,67355230:1859876554,67678384:1859876554,68143934:-285212677,68316894:1859876554,68318843:-285212965,68663760:1859876426,68669788:1859876554,68708785:-469288189,68895323:1179648,69376224:-285215030,69870133:-268435895,70638258:-285212693,71260995:-268435591,73390281:1859909322,73820424:-268435495,74261602:1753768584,74395840:1859806336,74543852:-285212981,74662966:-268435591,74900706:1077936128,75303661:1,75326674:1859876554,75682024:-457558392,75956234:6291969,75972782:1791575168,76044830:-285212695,76369573:1787519488,76418579:1859876554,76952501:-268435591,77270549:-285215157,77345272:-401341944,77694530:-285212693,79835783:206570496,80473600:-268468391,80563796:-285212693,80938489:1859876424,81163203:-268435461,81184727:1822032392,82368825:-268435461,83225979:-1348924927,83933330:524288,83947431:-457558391,84836293:536870912,84839072:-285212725,85659414:-268697767,87127885:138494976,88009163:-285212981,89408734:-285245621,89692407:-268435463,89800898:-268435589,89978851:1862268649,90392416:1859744834,92825528:1859876554,92865399:1858696200,93081186:-285213479,93214626:1224736769,93815735:131073,94194184:1323005642,94352729:-268435495,95057605:1859876424,95892971:1610612736,96240770:-285212981,98000450:-268435461,99398657:1753768584,99585136:1859876554,99890535:-285212725,100047078:1859876552,100821753:-285212679,101272608:224600833,101420780:-285212677,103096152:-268435461,103852886:-268435589,104133712:609944072,104417685:1209163840,104751993:742916096,107114981:603979776,108110879:1859876554,108130723:1820533384,108380558:536871424,109489362:-285212709,109639184:1275723776,110412696:1724478472,111599975:1322935880,112506047:-285212725,113281966:1859876554,113732009:1724477448,114287683:1073741824,116829525:-285212693,117700099:-285212693,118272910:512,119021631:512,119074720:-285212919,119996327:-268468391,120757820:1859876424,122949314:-319850727,123149899:1862268488,123179454:-285212693,124055869:1859876426,125370949:-268435463,126233715:-285212693,126757457:1859876554,127208675:37748736,127499520:-285212725,139899310:-285212725,140910398:134283264,143060306:-268435623,4154039993:1859876424,4156261017:-285212725,4160738769:704673482,4162130335:1859876424,4165271670:38273024,4165366825:-285215031,4165998083:1859876424,4166211628:1,4167949963:-285245623,4168799213:1859876426,4168889896:-285212981,4169420791:-285212725,4169986432:104923648,4172122687:205520896,4176115140:-268468727,4176395620:-1883242551,4177089152:-285212677,4177109535:1859876426,4177128734:708968968,4179147937:-285212821,4179259837:-285214997,4179293770:-268440055,4179337024:1614815744,4180986857:-285215158,4181144136:1657369608,4183097141:1859876554,4184228478:-824180839,4184616345:6291969,4186615799:9437184,4186839383:1859745480,4187437205:1859876554,4187569342:1859876554,4188084382:1859876554,4188576046:-285212981,4188835189:1822032392,4188943086:1859876554,4190165397:1208223744,4190356160:-268435591,4190667499:1859872392,4190874972:1074921480,4192183086:537001984,4194832184:1859876554,4194852332:4194304,4195461361:1859909322,4195599051:1859745352,4195634610:1862268488,4196355538:-268435591,4196584775:1822032392,4197237673:-285215030,4198506194:1859876554,4198509982:512,4199402926:-385951095,4199465312:1859876488,4199733469:1859876554,4199801480:1859811018,4200143438:1859876552,4202268136:-285212693,4202750533:1859876552,4202912152:-268435589,4203017133:-997324288,4203540619:1859876490,4204190187:-268468391,4205118501:-285212821,4205856844:-268435591,4205931357:1859876552,4206022136:1859876554,4206314370:-285215032,4206962851:-335806975,4207030792:1074921480,4207932643:-268435589,4209045637:1821901320,4209333792:-285212677,4209741679:575340552,4210043661:-285215157,4211240706:1859876554,4211265110:1179849216,4212211136:1255671432,4213029556:1859876426,4213313439:537485952,4213485217:1859876424,4214545508:-285212821,4216213065:1859876554,4216554910:129,4216577521:33558528,4217106677:1859876488,4217114963:1859806336,4217572911:1859876554,4217915182:-268435589,4218201225:-268435591,4218356023:1859876554,4218960679:-268435461,4219121950:134481920,4219259582:-335544471,4219886739:1859876424,4220658152:536900296,4220784606:-285212693,4221034513:-285212805,4222103546:-268435591,4222596666:1746403336,4222946849:-268435589,4223056561:1791575168,4223268450:1822032392,4223403197:-285215157,4223586635:575340552,4223727956:651387904,4224564164:-285221173,4224803114:1859876554,4225442965:-285215030,4225725635:1859876552,4226759379:-285212677,4227514437:-268435461,4227819956:608829960,4229068204:-285215032,4229260105:-285212725,4229348161:1322923720,4229481987:1859209737,4229997384:-268435623,4230115484:-268960439,4230406998:1745094665,4231039458:1859876554,4231724254:106102784,4231948823:1859876554,4232223533:1859876554,4232332235:1859876426,4232482467:-268435589,4234562006:-268435589,4235289311:1048576,4235845419:-318791989,4235909811:1859876554,4236298957:1859876554,4236526237:-402391039,4236881538:-268435461,4237265614:1859876554,4237424339:-268435591,4237702804:8388736,4237715685:1822032384,4238191868:-268435589,4238488535:1859872392,4238665406:-268435607,4238943369:-285215029,4239326079:-268435461,4239575572:4194304,4239975531:1859876554,4240401579:-268435461,4240531463:-285212981,4240537378:1859909320,4240832611:1859876554,4241415209:-268435461,4243137865:-268435623,4243389743:-268435717,4243502074:-268435493,4243763698:1822032392,4243872492:604045952,4243876969:604045952,4244367020:-268451845,4244452210:4194816,4244897848:1859876424,4244967883:537395712,4245195802:-285212693,4246016320:524288,4246019735:-268435591,4246730129:-400818168,4246889783:-285212695,4246966763:1745094656,4246999827:-268435591,4247584993:-285212981,4247887418:1859876424,4247997963:1,4248044685:1744830464,4248301589:1859745482,4248359567:1859876554,4248374383:135283712,4248555413:1859876554,4249534516:1859909194,4250344993:1746469376,4250399171:1859909322,4250727409:-285508535,4250846303:1859876554,4250870901:1859876554,4251204886:-268435589,4251482065:1859876424,4251647817:65536,4251823570:-268435591,4252692419:1612251648,4253274167:-285212805,4253314840:-285212695,4253715881:-285212679,4254270341:1859876554,4255549686:-268435589,4256382614:-285215031,4256610358:1859876554,4256739710:-268435589,4257436369:1859876552,4257762163:135333384,4258588418:-285212981,4258736157:1745354760,4258905998:1859875466,4259515100:-285212677,4260422452:1862268649,4260807570:-318767413,4260870776:1859876424,4260932210:-285212725,4261805401:1782670848,4262055613:1859876554,4262130282:-268435461,4262152628:1859876554,4262213440:1859876554,4262479349:1657368584,4262534916:1859876554,4262858899:-285212725,4262873387:1850299458,4262997559:-285212725,4263056932:1753768584,4263571997:1862268649,4263633477:-268435463,4263843442:1859876424,4263859890:1149392064,4264153416:1859872392,4264694485:-285212693,4264723614:1859876554,4264988277:4210688,4265600307:1744830472,4265854978:248521856,4265985426:1859745352,4267061797:-268435591,4267448715:1855071872,4267455210:-268435589,4267710292:-285215032,4268724311:1859745288,4268780726:1859876426,4268966679:327681,4268996799:-268435461,4269067599:-268435493,4269321162:4264448,4269344979:-285212919,4269546949:-285214997,4269668482:1686857344,4269989442:1744830472,4270192583:-285215158,4271214850:-285212693,4271628185:537460736,4271907950:-285212677,4272028970:-268697767,4272712609:1859876554,4272794185:-906502535,4273246520:4194304,4273542078:1859909194,4273979358:1,4274384055:-268435461,4274408220:537526792,4274439219:1851422344,4274663247:-285212693,4274837746:-268435493,4274923578:-467529687,4275094752:-268435589,4275168009:1073741824,4275200412:1859876554,4275248922:1,4275441890:1859876426,4276200215:-285245479,4276555370:1183999488,4276662938:16384,4277070029:-285215030,4277383507:-285212983,4278366244:1073872896,4278508609:1859876554,4278683310:-285215032,4278712293:1859810954,4278864381:1745094656,4278901317:536936960,4278961016:-268435493,4279000497:-400818168,4279357857:-268435589,4279503633:-285247653,4279719876:-285212679,4279845447:1859876554,4279994581:-268435591,4280286820:67108865,4280511522:1859876554,4280610653:1859876424,4280759557:-268435461,4281091292:1859876554,4281126993:-268567399,4281626644:-285212919,4281656713:-285212711,4281836983:-285215157,4281976468:-1999694063,4282045422:1859909194,4282124211:1859876554,4282205319:1859876424,4282226933:983041,4282825832:575341064,4282927733:-938999807,4283058734:1275723776,4283222745:-285212981,4283294503:1745879560,4283534727:1859876488,4283609528:1859876424,4283767688:-285212853,4284001986:-268435493,4284078817:-268435589,4284578180:1859876426,4284600392:-268435589,4284646867:1859876424,4284847212:-285212679,4285295830:-285212725,4285537396:1859745352,4285666266:708977160,4286596489:750838784,4286604772:-285215096,4286813244:119702305,4286815179:1854030472,4286867240:1745355272,4287691027:-268435461,4287756409:-285212949,4287856543:-285212677,4289023859:-268468391,4289264700:-268468391,4289281312:-268435463,4289428942:1859876554,4289513683:1746469376,4289667993:1859876554,4289897023:-285212725,4289908352:1859876554,4289953842:1791575168,4289969218:1175585408,4290314159:-352321719,4290442663:1862268488,4290965859:1859876554,4290978775:1859876554,4291045376:1859876554,4291609027:1859876554,4291781763:1859876554,4292261869:-268435623,4292314041:1859806336,4292479460:1073872913,4293554978:512,4293863712:-285215160,4294181364:9438720,4294362452:1683685376,4294452889:-285212949,4294632960:-268435591,4294854484:-285212983},java:{157878:262161,248610:-384038088,489334:-272646145,516039:756397713,516857:-268550145,759123:-270590977,985371:1,1006937:17040001,1180217:-1993962635,1380234:-317604089,1550201:1224999217,2330803:-302006273,2417197:49,2557968:16910337,2769201:-268451841,2925893:-268484609,3115252:262145,3178380:84279681,3270687:1096811033,3843897:-384038359,4168709:16777217,4168785:1844854709,4589376:16777217,4604983:-270590977,5034516:1,5102504:17172853,5485813:1764625273,5709159:-270590977,6254307:1840523825,6335403:150994945,6650192:-268484737,7161053:150994945,7347374:-2147219456,7826548:16777216,8029590:-304150215,8081866:16777781,8153399:1772890801,8260801:16777233,8279589:-1377854465,8449778:-283305159,8475142:-268451911,8561223:-519828687,8677922:-272680065,8741324:-272679073,8844597:4194561,8935089:1158678544,8938196:1167538949,9030537:1873021489,9111700:-1047524736,9330059:16779280,9640832:-335664455,9676618:1627717941,9711465:-302564547,9906629:-481623763,9930849:-268451841,10062376:-270590977,10232770:-302039041,10476788:-375449031,10477085:-370758659,10519143:-306200577,10756328:-268484609,10951195:-268484865,11170081:-1593573111,11212041:16779776,11259315:16777216,11279928:-268451841,11291143:-448291969,11639666:-272810113,11762036:-306234561,11837851:1092887057,12100038:-268493825,12293765:-402388992,12336465:-384038343,12739604:-278979779,12901351:-270590977,12912345:-308409576,13009261:-272679041,13406882:-268493825,13475198:-352056527,13506975:-384038019,13877616:1763049521,13892934:-280034503,13913717:-268451841,14012459:1091700793,14070850:-384103911,14078273:17039377,14079334:17039377,14111180:16777233,14114361:16777216,14116482:16777216,14130268:-1609695223,14176994:203167761,14196082:1829767473,14198134:-401339543,14260835:137593685,14286053:1,14308622:1293814288,14362664:16777217,14510814:16777216,14737474:16908657,14769321:16910449,14801168:16908593,15242400:1841049521,15306955:-839041281,15368289:1829975811,15392555:-1491139799,15590433:1335761719,15608681:-2047367177,15646349:-268451841,15758653:261495600,15786292:591790129,15963922:-268456961,15965795:-268488705,16214049:16777233,16223593:-1385780588,16545645:-268484609,16652720:-384038343,16681709:-268484609,16760325:-268451841,16794482:1841048497,16805384:-1593046759,16842464:17956913,17154160:-384038103,17380744:-279045315,17421368:-1555103207,18003220:1090519057,18470013:1224736853,18978694:16777217,19072095:-1486946039,19113381:-807658697,19170785:-480310471,19342354:-268451841,19604796:-268451841,19647078:-306758849,20124563:-268451841,20275682:16777216,20288139:33554449,20366406:-486276807,20805031:1303644817,20848053:1292108593,21190249:1107296273,21229736:-446823655,21611024:1230570520,21638658:1157890321,21873846:-1588657919,22053366:16777233,22756924:1,22863287:-268451841,23220140:-268484609,23321953:17039665,23797836:-1587049547,23898652:-270590977,24071969:-1491140055,24140057:-384038855,24403397:16777473,24796614:-268485825,25088627:-268493825,25302584:-2147219167,25327284:-270590977,25711019:-302006273,25827453:-302006529,26088133:-268451841,26535154:16908545,26686513:33554448,26792050:-272646145,27184074:-283305159,27193984:-272679041,27211227:-279045257,28047376:17039921,28061236:1,28067830:-268451841,28607133:-350287063,28957819:-272680065,29217755:-308409832,29234591:-268451841,30157835:-384038103,30168437:-306200609,30178870:17,30183467:1090912625,30313384:16777217,30352604:1159019265,30987658:-270722179,31128651:1292765200,31154439:-272680065,31645422:-302006564,31782483:-306234561,31814205:-452197607,31932768:-481361091,31934920:-314405995,32071611:1090846773,32627218:17,32905286:16777233,32930725:1,33195241:-839041281,33386314:-403980513,33522150:1695091473,33677709:-906361903,33857486:801,34189313:-346092743,34256299:663683897,34257650:-1513159879,34520741:16777473,34695718:-283240071,34837122:-269762657,35296213:16777473,35821186:-268451841,36017746:-384038343,36953371:16777233,37363504:-1980855403,37408233:-519828687,38158227:-268484609,38195587:-268451841,38762473:1091505013,39131800:1090912625,39199837:-268451841,40433881:-1421017075,40566864:-303846475,41316426:1,41378701:-1458697427,41391733:1769880345,41530750:16777216,41711838:1635778961,41934806:-302006273,41979409:-268451841,42046914:-384038019,42670652:-1384510121,42837317:-405861571,43116296:-1591999703,43698772:-1073477343,43742544:-384038019,43751142:1091502645,44159687:-268451841,44291106:393265,44391284:-270590977,44651348:16777216,44653584:-308409832,44895276:266279423,45060305:-268455937,45286421:-302006273,45338769:1763049781,45394716:-370758659,45463086:-306200577,45637566:151126277,46061912:-451013761,46698887:1090650481,46764238:1303850901,47842642:16777745,47845727:-1589247175,47853878:266279807,47922503:-272679041,47952646:-279047297,48151139:-302077039,48295924:1,48500287:-270590977,48645720:1694761233,48933602:-270918665,49167744:1,49547159:593429297,49649147:-1513160391,50262134:16777216,50357567:-350287575,50382978:-270595271,50454534:-514915559,50494035:-302006273,50508812:-843071563,51338192:-480376003,51763728:-384038083,52184498:-446819465,52931331:151783985,53026405:-302535755,53029950:690359093,53095696:632564657,53518097:-268456965,53523042:-481424583,53581694:-272679041,53799883:65,53800054:16777217,53800088:1,53800157:1,53800225:16777216,53800636:262145,53800670:1,53800738:1,53800773:184553473,53800807:16842753,53802825:264192,53802893:264192,54702009:-302040259,55467871:-268484609,55663643:-1588657623,56132221:-1521548535,56500929:-384038595,57084991:-268451841,57201057:-272646145,57512342:1,57740275:8389264,58224425:-405861571,58283539:150995601,58418777:-1045328987,58563220:-302006273,58607429:-268451841,58769064:1830685200,58781070:-1605631703,59257640:-272679041,59308438:16777216,59646924:1837054745,60494345:-977817633,60499451:1090521088,60717214:16777493,61361823:-841609675,61675924:1845477309,61827387:-270590977,61913891:-268451841,61956035:1845477181,62135193:-268451841,62298329:1829767473,62572429:-1479603415,62976958:-1487994051,63205075:16910449,63358435:-302006273,63540003:-268484865,63989596:-268484609,64319671:-302006273,65362088:1627390257,65382985:-1513223895,65480933:16777253,65701343:-274789537,66229371:1,66391661:-268451841,66445005:-302006273,66636098:-1981379695,66659640:-402388992,66819883:-272678945,67291199:-485555395,68425281:-273203267,68708785:-438879477,70006129:-268582913,70039857:1800732729,70184974:1706830769,71973889:16777233,72104020:-272679105,72933692:-402388984,73192774:-278980039,73259294:-278979779,73543138:-276882433,73687991:-268451841,74568451:-268451841,74631019:-268451841,74646425:-278979779,74715446:17039665,74925417:-276882627,75303661:264209,75346723:17039665,75443302:-1554052807,75560512:-276947977,75928654:-1517417679,76404366:-279110855,76573682:-274789617,77103560:-268484737,77345272:-384562391,77495235:-838877193,78502530:16777345,78525859:-384038083,80152763:-268484609,80455314:-268451841,80688981:-268498119,80860651:-306200577,81002584:-274920551,82391531:-420890993,83208605:16777217,83350007:16777233,83454719:1627718453,83700702:-304112641,83934179:-849149167,84508052:-268451841,84836293:-1588723671,84920813:1845477309,85001795:-302009379,85797653:16910453,86531117:1090521089,87041881:-384103911,87252086:1224737269,87750413:-345044423,87832e3:-384038083,88505333:16777216,88672254:1627717941,93313292:-268484609,93719713:-274920643,93815735:131329,94543295:16777233,95135648:-405861571,95230619:-1425142995,95365496:16777217,95869005:-270590977,95892971:1627389969,96275653:16,96357129:273,96850547:1830029621,99107521:-1558314711,99171232:-270722113,100181512:-270590977,100350182:27656753,100531632:-302040065,101663042:-514913767,101907699:393265,101968e3:-274789571,103184005:-268451841,103264165:-268451841,103362094:17039377,105324903:-302006273,105579676:633158457,106395301:-405861571,106602009:-268451841,107047352:16777217,107287639:134481921,107705134:1840526257,108380558:-1591473663,108758134:-272679041,109349241:1305852601,109419007:-308409832,109569975:1844912057,109639184:1292765200,111537333:-308409576,112379853:-268451841,116388487:-317977839,116502717:16777216,117527585:-268451841,118239367:-346092743,118272910:16777984,119214439:-384038855,119993022:-272679333,120558248:-268451841,120561078:-272679041,120771173:-272679041,120820893:-302039041,122323260:118297393,123407657:-302006273,123639340:1763049777,124318065:1627718453,124596928:-268451841,125304220:-304149703,125727594:-384038343,126038731:-268451841,126272535:16777216,126319720:-268451841,127381297:-302079023,128189054:-272679073,128776313:-985163393,131048041:1340021247,131843035:-268484609,133534634:1090846773,134013330:33,134234336:592380721,4153976270:-274874439,4159656364:-1922429424,4161703711:-384038083,4163667875:-283178455,4164296730:-268484609,4164465199:-306758785,4165613183:-270590977,4166211628:1,4167532733:-268455969,4167674422:-335560705,4169716211:-1375793449,4171275934:-1883295747,4173752924:-306204673,4174658521:-268451841,4177046655:-1424028883,4177313772:-268451841,4178770917:-270590977,4178820659:264193,4180330084:16777301,4180897389:-384099815,4180973619:-272679041,4182310634:20972049,4182596950:-346092759,4183243148:-385087455,4183309167:-973127721,4183471620:-838877291,4184432574:17039665,4184688954:16777233,4184727394:1763049525,4186181662:-379841673,4186572608:1157628229,4188127282:264208,4188478454:-268484737,4188835189:-308409832,4188839918:-1520696519,4189156122:-268484609,4189674674:-268451841,4190165397:-402388992,4190180136:-268489795,4190247374:-316929255,4190329355:1234831929,4190734356:1845477181,4190874972:1091700793,4190889267:-384038343,4191632489:-1881195719,4192266791:-1586000907,4192447395:16,4192679651:-272680065,4193063859:16908593,4193252035:-1487011271,4193862568:-384038343,4193955576:-268451841,4194166664:-303121411,4196500489:562299313,4196584775:-308409576,4197103296:-272679041,4197347572:-302530561,4197940497:1829767473,4198138195:1837501241,4199611560:-401864439,4199688799:184811529,4199718961:631243285,4200259565:20054065,4200490488:1845477181,4201403077:1090912273,4202103065:-268451841,4202603902:-268498115,4203380996:16777781,4203426923:-270590977,4203660099:-1377854465,4205064510:16777232,4205214670:69214225,4205278244:16777217,4206923651:-268484609,4207076625:16777473,4208479055:-302006273,4209045637:-308540904,4209600340:-268484609,4209741679:-1555103447,4210011815:1341537279,4210736706:690359093,4210917794:-481424583,4211144239:-1554054387,4211414184:-268451841,4211546653:-1521614807,4211776926:1844722609,4212469277:-270590977,4214853554:1,4215444798:-268484609,4215502519:1342061567,4216532351:229912497,4216554910:25165953,4217878191:1627392273,4218352214:-843137135,4218498495:1845441305,4219121950:1208223744,4219470677:-270590977,4220062311:264060927,4220240669:-375579777,4220634339:632564657,4221776457:-413201859,4221876124:-404876417,4221946187:-384562895,4222174446:150997504,4222596666:-384038119,4223268450:-308409832,4223586635:-1555101415,4224416405:-268451841,4224487183:20971537,4226116171:-268484609,4226334149:-1588723143,4227117016:1338971129,4227159275:16777232,4227340012:1836400569,4227834144:-268484609,4228002083:1073741905,4228079262:-268713985,4228611516:24641553,4229261986:-268451841,4229448967:16777216,4229531685:-270590977,4230030974:1090650129,4230210081:-1604451531,4230223119:16777216,4230350305:-384361935,4230395914:17040181,4230406998:-401864695,4230729705:526353,4230869189:1843833745,4230991595:-1591869399,4231163100:-268484609,4231784883:135006232,4232235571:-438355057,4232653498:1090915189,4232689753:16777216,4232969672:-268451841,4233124446:-270595271,4233125417:16777728,4233128178:-270590977,4233149912:-270591489,4233268708:16777217,4233296419:-268484609,4234012465:-1346424835,4234321037:-306724865,4234615610:-278979585,4235354525:1840526257,4235568050:-268451841,4235653793:1090650481,4236188220:-268451841,4236307405:-268484609,4236526237:-400815863,4236894401:-268451841,4237031727:16777216,4237140686:-384562327,4237197538:16777217,4237244340:-1486945735,4237378658:1680607533,4237630041:1,4237715685:-308409576,4237805167:-268484609,4238218965:-807593091,4238451604:1,4238499041:-268451841,4239410749:-1010881603,4239429345:-268451841,4239490850:-1918976127,4239591837:-283766471,4240198957:-843137135,4240646340:-316798152,4240932451:-369220655,4240950911:-268451841,4241144047:16777781,4242159741:-384562904,4242183912:-279045129,4242197950:-268451841,4242532022:1706830769,4242803638:-272679041,4242942783:-1593573087,4243166341:17039361,4243305358:1082132757,4243333379:-268451841,4243347429:49,4243369201:-805355521,4243394753:16777216,4243691797:-268451841,4243763698:-308409832,4243818890:-268485831,4243844844:1091506993,4243872492:621087665,4243876969:621087665,4243943985:1208223760,4243973709:1769880345,4244791220:-318373071,4244967883:-1609629175,4245048405:16910449,4245186501:16777216,4245334242:-413203603,4245643742:-302006273,4245931709:-308856289,4246033183:-268488705,4246093431:-268451841,4246178525:84280113,4246343474:16777761,4246346937:-302006305,4246392993:16777216,4246545602:1694499093,4246730129:-384038855,4246966763:-402388992,4246976952:1795496657,4247534156:1073741841,4247997963:17039377,4248044685:-402388728,4248586796:16777233,4248855555:17242937,4248964732:16777216,4249308382:629539217,4249367411:-268451841,4249602117:-839041281,4249635388:17039377,4249655479:-272688289,4250234897:-272680357,4250306369:1845477181,4250344993:-383841487,4251189228:-302006529,4251458294:-268451841,4251568087:-316929223,4251632050:-268451841,4251664313:-843137135,4251674569:-272646145,4251703040:16777761,4251740147:-274920643,4251875020:-1479603415,4252396369:-316929767,4252692419:-383972551,4252934009:393269,4253062825:-268485697,4253814871:-316929223,4254194792:1840523793,4254316096:-268451841,4254502955:277,4254530595:-304268487,4255453868:-1518402755,4255506863:-302006273,4255591989:-384038019,4255705199:18876449,4255868585:16777217,4256667911:591790385,4256781340:-384038343,4256798098:-1879228417,4257701476:16,4258254222:1337342839,4258736157:-401864439,4259029832:1627718453,4259176753:-403980321,4259361935:-1568734419,4259481041:16910449,4259978018:17039377,4260277209:-268451841,4260662044:-268451841,4260679671:16777232,4261078633:-268451841,4261500156:16,4261839613:1,4261918850:-270726355,4262509385:-268451841,4262966794:-268484609,4263317705:-268451841,4263352348:-268451841,4263572970:553912617,4263646058:-1513159879,4263723474:1099379485,4263809962:17039409,4264191623:16777233,4264372118:33,4264967753:-268582913,4265278863:16,4265600307:-400815352,4265830826:-384103911,4266281335:17039889,4266846426:1842842549,4266968904:-272680065,4267200434:-302564547,4267465796:-385611239,4267563970:-302171335,4267614146:-302373935,4267692508:-270590977,4268157273:-268484609,4268536409:-268493825,4268726914:1632058119,4268910181:1305852601,4268966679:-1609629439,4269115543:1627717649,4269845589:-270590977,4269941417:151783985,4269989442:-401863896,4270021864:-306233473,4270162447:1843833745,4270262275:-268451841,4270367783:-268484609,4270595276:1090519041,4270940291:603979800,4271276762:-268451841,4271569336:1669597493,4271628185:-1588657879,4271744980:-268452129,4271750250:1,4271763247:-268488705,4271825210:16777233,4271925961:-283240135,4272008383:-1992128379,4272227658:-268451841,4272486644:633088817,4272636811:-1604386007,4272788255:-302006273,4272901982:-279110855,4272931998:-1517417679,4273707595:16777329,4273772785:-268451841,4273888683:17236913,4273979358:1,4274263341:1842842549,4274398287:-303846475,4274408220:-1588657623,4274566539:-270595271,4274897548:1829767473,4274905306:-268451841,4275112174:-921957831,4275168009:1090781457,4275248922:1,4275626944:-384099815,4275762766:93862681,4276105201:1829844739,4276377486:16777216,4276619857:1,4276761142:-283305159,4276855808:-270590977,4277037515:-384562647,4277538304:-1520499927,4277683870:-316929767,4278218304:-306233537,4278462461:-306233729,4278474055:1772364689,4278525480:-272680065,4278583896:-268451841,4278864381:-402388992,4278901317:553714177,4279000497:-384038855,4279001966:-306234563,4279852657:-405861571,4280536979:-302006273,4280644920:-268451841,4281315349:-302006273,4281435449:-272680357,4281785052:262165,4282226933:-1605435127,4282315070:-268484609,4282391640:1844912057,4282423678:1694629913,4282726687:-306364545,4282767367:-268451841,4282954286:-268498119,4283058734:1829636113,4283066724:1,4283294503:-384562391,4283308288:16908593,4283379522:-314074241,4283518874:-268451841,4283539692:-346092775,4283625932:-302006273,4283630826:-274789571,4283786316:1090978613,4283897739:-306758849,4284476566:137595733,4284864940:570759377,4285135993:-413203911,4285233720:-302006273,4285251670:-268550145,4285298084:659489593,4285378917:16777216,4285437027:-269008899,4285476536:16910709,4285547299:16779777,4285623962:-845168767,4285744026:1764625273,4285899572:-1555169223,4285913524:-270590977,4286093114:16,4286257689:-519765703,4286631068:-278979585,4286651447:-268451841,4286867240:-384038136,4287131213:-308332001,4287840651:-268565647,4288080259:-302040129,4288211433:-820569097,4288390300:16,4288550262:-268451841,4289019388:-268451841,4289060717:-268451841,4289273034:-316929256,4289274231:-268484609,4289304759:1234113073,4289474248:-1487994063,4289513683:-383972559,4290349321:-302006273,4290514690:-1881195719,4290640889:-283173889,4290732932:-268451841,4290849496:-916645063,4290908805:-1894577767,4291118467:-403982433,4291282829:-1412561991,4292001953:-1344402563,4292229618:-268451841,4292479460:1073872913,4293086862:-272679041,4293265198:-302006564,4293425201:-268451841,4293551475:-335560705,4293554978:-519828687,4293581527:-815981767,4294097214:-268484609,4294173238:-283239619,4294179705:-276947977,4294812275:-805486625},js:{157878:262161,662990:221677696,985371:1,1006937:17040001,1180217:-1993962635,1256528:-440967255,1361094:624274993,1367043:152174601,1550201:1224999217,2002608:-308359243,2417197:49,2870299:-268513379,3115252:262145,3270687:20971537,3327817:-939259880,3843897:-384038359,4144856:252898960,4168709:16777217,4589376:16777217,5167944:-273219912,5196787:-274281832,5393397:16777232,5977311:23331616,6335403:150994945,6515669:1843904185,6641101:1342173173,6915263:16777216,6970374:1,6988973:-274851047,7161053:150994945,7210979:-272892359,7347374:264192,7383903:-279503939,7601193:-345068904,7826548:16777216,7863414:-411238391,8081866:16777781,8118418:-403835335,8260801:16777233,8449778:-283305159,8561223:-519828943,8652460:33892352,8844597:257,8935089:1158678544,9030537:1873021489,9111700:-1047524736,9625868:23331360,9640832:1778264761,9676618:1627717941,9906629:-481689299,10092522:1196825361,10122749:-1425140935,10329637:-306298951,10505116:-852026535,10644181:-272662599,11028532:1308585913,11170081:-1593573111,11212041:16779776,11259315:16777216,11837851:1092887057,11839626:-302026855,12133587:564630193,12149189:-302022727,12293765:-402388992,12336465:-384038343,12767082:-306298951,12912345:-308409576,13186680:1873021617,13475198:-385610959,13892934:-313588935,14012459:1091700793,14070850:-384103911,14078273:17039377,14079334:17039377,14111180:16777233,14114361:16777216,14116482:16777216,14130268:-1609695231,14132354:118843905,14166288:-1590859119,14196082:1829767473,14260835:137593685,14286053:1,14308622:1293814544,14362664:16777217,14670600:157516645,14737474:16908593,14752678:16781617,14769321:16910385,14770381:225930257,14861968:-411041991,14871264:1879048125,15200464:1796413449,15291533:1293814064,15373339:-268435523,15392555:555680553,15756532:184937553,15758653:251927344,15765074:-336593095,15767205:16777217,15770386:17041920,15772507:662964865,15786292:-1555169231,15822346:151259253,15977618:23101457,16214049:16777233,16221085:1845440441,16652720:-384038343,16705534:1237315573,16786296:-2128344687,16789478:-1591473648,16805384:-1588786887,16842464:17956913,16990428:16777216,17048354:-310411623,17091632:-306217031,17154160:-384038103,17421368:-1555103207,18003220:1090519057,18522374:16777217,18745189:-1985477839,18763838:1844920249,18934377:-411107319,18978694:16777217,19072095:-1487994871,19170785:-481361351,19305921:1840623281,19326669:-1352398312,19685101:-805310475,19861087:1879044093,19910677:797182849,20003152:1836924817,20043835:267911101,20275682:16777216,20288139:33554449,20366406:-486276807,20475666:-270541927,20771826:1845493689,20805031:1303644817,20848053:1292108593,21078499:-438367307,21190249:1107296273,21229736:-446824167,21611024:1230570520,21638658:1157890321,21873846:558694657,22053366:16777233,22100671:-268435527,22408304:17039377,22588531:-374341991,22756924:1,23206453:568826549,23315809:1308061625,23321953:17039665,23811864:-805318667,23985225:1844969149,24071969:-1591803351,24140057:-384038855,24143304:1879031741,24296961:1879048125,24352755:-301989955,24368893:17041921,24403397:16777217,25039661:-809500683,25302584:-2147219455,25355638:137858005,25869386:-302022727,25989237:-843075595,26535154:16908545,26686513:33554448,27132030:16842768,27172393:1879043993,27184074:-283305159,27210921:1340604349,27675230:16777216,27961962:16777216,28047376:17039921,28061236:1,28607133:-350287351,28679658:-268435523,29172503:1839672249,29217755:-308409832,29775042:52445713,29861208:1879039896,29898825:1845442360,29979496:-268502503,30178870:17,30313384:16777216,31056216:17039617,31128651:1293814032,31633117:16777216,31677814:-809538159,31814205:-452722663,31932768:-481361099,32248983:-268435911,32583659:-268435459,32627218:17,32726328:19235637,32756741:-268435527,32819561:-268435459,32930725:1,33224413:153092881,33857486:801,33907815:-411041991,34189313:-481361351,34256299:596575033,34520741:16777217,34758951:-370147687,35296213:16777473,35473710:1236602377,35990494:-279033319,36017746:-384038343,36469291:-268502115,36728843:17039665,37408233:1627654705,37427771:-336631879,38700005:-276888775,38985701:-306298951,39176522:-805314571,39412266:-805306379,39495047:-283243727,39918967:-1587150023,40011481:-269617383,40346254:-809500683,40433881:-1421017075,41300032:23331329,41316426:1,41378701:-1995833051,41391733:694293273,41530750:16777216,41599942:-278975975,41711838:1635778993,42231999:25559824,42608212:-276865536,43089216:16777216,43116296:-1593048791,43327456:196341749,43372757:1340587957,43484549:-809500683,43529140:1172308881,43698772:1074006305,44291106:393265,44457959:1836445340,44651348:16777216,44653584:-308409832,45212170:1839672249,45492310:1879047865,45602687:1710228145,45637566:151126277,45869802:-1484825799,46068699:-345068904,46515170:-805306379,46871203:-345052520,47038962:1241513973,47821645:157518693,47842642:16777745,47845727:-1589247431,47863670:1879039645,48295924:1,48645720:1694761233,48819987:161874321,49167744:1,49547159:593429297,50262134:16777216,50357567:-383842263,50454534:-514915559,50592641:-2128344687,51010491:-301989955,51103948:-306298887,51609471:1874016905,51944086:-306233415,52246925:1235495601,52340702:-268439619,52369651:1308065725,52843528:163556341,53478390:-284943567,53523042:1628308025,53688776:-1993994623,53799883:1,53800054:16777217,53800088:1,53800157:1,53800225:16777216,53800636:262145,53800670:1,53800738:1,53800773:184553473,53802825:264192,53802893:2048,53803594:1844965053,54070216:-411041991,54157158:-1383464408,54357251:1879047869,54432635:-843071499,55139601:-335544519,55226049:-306298951,55240760:-383497319,55339693:-272785511,55545501:4194304,55663643:-1592851927,55929853:1877999293,56132221:-1521548535,56263910:-268435911,56603892:-383841767,56723662:1879048189,56920565:16777489,57512342:1,57740275:8389264,57877362:-268435527,58164e3:20392592,58283539:151257745,58769064:1830685456,58781070:-1609826015,59308438:16777216,59646924:1836792601,60499451:1100220416,61783120:-340792527,62268807:1836531641,62298329:1829767473,62976958:-1487994051,63040662:1308618741,64250955:158909584,65254328:2048,65362088:1627390001,65439752:-268567239,65480933:16777253,65737461:-411106807,65744298:1304428345,65961766:-346092739,66229371:1,66483357:266860533,66659640:-402388992,66771327:-411041991,67084953:1879047865,67291199:-485555395,67443714:-270644327,67860197:50594097,67875894:258473620,68061633:25430673,68895323:17956865,69199538:1304428473,70141805:268435445,70252126:1840758769,71973889:16777233,72186386:-379230699,72397707:1843904185,72666936:16778e3,72933692:-402388984,73192774:-278980039,73265088:-268435459,74715446:17039665,74900706:1097072657,75208539:-854123759,75303661:264209,75346723:17039665,75372903:-283698375,75446971:-2128346368,75623547:-347141319,75682024:-306298951,75794974:-809538119,75956234:23069185,76369573:-336598223,76404366:-279110855,77345272:-384562391,78502530:16777345,78690443:-308409576,79172597:-809538119,79314245:-838860811,80773891:-2123897295,81002584:-270595175,81184727:-308409576,81314487:-336626887,83208605:16777217,83305372:1835867537,83350007:16777233,83394228:-277976168,83454719:1090847541,83933330:21496081,83947431:-306298951,84711301:2048,84836293:-1593442295,84928972:1304424437,85835074:16777216,85906489:16777216,86305278:-1879048203,86531117:1090521089,86752183:118812465,87041881:-384103911,87161375:-283698919,87588127:1877999549,87750413:-1559297479,87776435:151391744,87832e3:-385086659,88672254:1627717941,88868649:-268435523,92776564:1879048157,92865399:-269615847,93079207:153092369,93095993:-310940007,93815735:131073,94182263:-847811567,94543295:16777233,94887656:1237315573,95211622:-268435459,95230619:-1995830491,95365496:16777217,95892971:1627389969,95995425:1870003889,96275653:16,96357129:273,96850547:1830029621,97560297:266074905,97590796:-268566727,97861822:1879048125,98146e3:1878908573,98210206:1308585625,99107521:554565929,99398657:-375125095,99459113:1843904185,100350182:27656881,100797851:-268435459,100815327:1879047865,101907699:393265,102148947:-872743271,103362094:17039377,104133712:-411106807,104986824:-302027079,106960348:1308065725,107047352:16777217,107114981:622854161,107287639:134219777,107705134:1840526257,108130723:1839672249,108285044:-336592967,108380558:-1591473663,109349241:1305852601,109419007:-308409832,109569975:1844920249,109639184:1293814032,110412696:-403835847,110934450:-268481635,111537333:-308409576,111926437:1845440441,113403025:1840623281,113732009:-403833799,113891461:222277297,115626622:153518453,116388487:-385086703,116502717:16777216,117474847:-413193671,118060866:16777216,118272910:16777984,119021631:-2128346607,119214439:-384038887,121465287:-809538119,121477421:153092369,124318065:1627718453,125727594:-384038343,126272535:16777216,126287894:-2001237035,127522327:2049,131003217:1879048121,133937728:17039377,134013330:33,134234336:-1487994055,137087576:-413193703,137928656:1879015097,138070512:-335544391,140910398:134283537,141931170:1877999293,144938709:-301990343,4153976270:-270549063,4154605267:1303899809,4155485543:-1883242507,4164042543:-1993897099,4166211628:1,4167031781:-268435463,4169986432:124094993,4173400764:-268484679,4174099585:1777335997,4174805620:-843632967,4175721795:-268435527,4176903623:1262283792,4177046655:-1458961619,4177128734:-1419376104,4177306815:-278967491,4177608572:-374341991,4178820659:264193,4179337024:1633722913,4180897389:-384099815,4181144136:-470944743,4182310634:16777233,4183243148:-385087455,4183381635:-1484825799,4184432574:17039665,4184616345:23069185,4184661597:564399672,4184688954:16777233,4186479442:-306544647,4186585667:1207413685,4188127282:264208,4188783759:-273224568,4188835189:-308409832,4188938990:1235486977,4188946798:-303583592,4188980561:-1883246603,4190165397:-402388992,4190690901:-1484783815,4190874972:1091700793,4190889267:-384038343,4192447395:16,4193252035:-1487011271,4193862568:-384038343,4194852332:20971521,4195774297:1845493689,4196500489:562299185,4196584775:-308409576,4196974443:-268435459,4197051882:1327451545,4197363645:-276888807,4197940497:1829767473,4198509982:-2128346624,4198674102:-306298887,4199611560:-401864439,4199688799:184811529,4199864370:121105936,4199984714:1879007161,4200045628:-268547427,4200186957:264237045,4200259565:20054065,4201403077:1090781201,4201866639:16777216,4201983957:-809500683,4202391203:-278564943,4203380996:16777781,4203921636:-347141351,4204786339:701563153,4204886506:-347141319,4204923857:-273224567,4205042422:-470944455,4205214670:69206033,4205278244:16777217,4205823665:-268435459,4205932925:-2130444288,4207030792:1093797945,4207152115:-276888775,4209045637:-308409832,4209567293:1879048121,4209693973:-413193703,4209741679:-1555103479,4210649868:1879048125,4210917794:1628308025,4211546653:-1525940183,4211935423:191220753,4212078819:1877983157,4213313439:-1590826351,4213473442:17171201,4214853554:1,4215384633:16779441,4215722242:158567269,4216532351:94646161,4216554910:16777345,4216577521:184553473,4216832962:1795426833,4217065770:1304407729,4217114963:1862167953,4217276796:-301989959,4218498495:1777013529,4218768764:1840758769,4219121950:1208223744,4219985845:-847810791,4220459620:1705444281,4220543751:-278967495,4220981300:-302026855,4221273556:-413201611,4221438686:-872743271,4221776457:-413201859,4222517121:16777216,4222596666:-384038087,4222598178:1863711537,4223033940:-268547175,4223268450:-308409832,4223314660:16,4223387233:222277297,4223586635:-1555101383,4223674691:16777216,4223727956:670526464,4223795429:233269173,4225630039:-272744455,4226334149:-1588723143,4226525054:-270644711,4226895904:-1994391279,4226928135:-807515623,4227340012:1836400569,4227384810:1832291217,4227615382:-1921553391,4227819956:-411106807,4228002083:1073741905,4228859007:-268547175,4229448967:16777216,4230210081:-1604451531,4230223119:16777216,4230406998:-401864695,4230903567:-843600199,4230991595:-1592917975,4231148360:-336631879,4231724254:125241344,4231737261:50595857,4231784883:135006232,4231987172:-336593991,4232280224:-268435651,4232689753:16777216,4232857987:-282199119,4233125417:16777728,4233268708:16777217,4233557636:-414250727,4234011089:1205900209,4234022415:1840643993,4234251640:1308585753,4234298507:-272892355,4235289311:17825792,4235354525:1840526257,4235653793:1090650481,4236526237:-402388991,4237031727:16777216,4237047891:16777233,4237197538:16777217,4237217432:-1376780359,4237244340:-1486945735,4237630041:1,4237702804:25165952,4237715685:-308409576,4237729630:-279033319,4237816332:-838898023,4238451604:1,4238955640:16777216,4239575572:23330817,4239591837:-283766471,4240253608:-268514403,4240860043:-1949738075,4241144047:16777781,4241948009:16778001,4242820562:118812465,4242843154:61706677,4242942783:553910561,4243166341:17039361,4243347429:49,4243394753:16777216,4243583465:-977469451,4243763698:-308409832,4243872492:621087665,4243876969:621087665,4243943985:1208223760,4243973709:694301465,4244155948:-805306379,4244160493:1845493757,4244452210:23331328,4244719060:1870924417,4244791220:-318373071,4244911578:770109369,4244967883:-1609629175,4245171891:-2146435055,4245186501:16777216,4245422993:91785745,4245990930:-268435527,4246016320:23593217,4246343474:16777729,4246369043:262145,4246392993:16777216,4246587189:-268435527,4246592382:-383841767,4246730129:-384038855,4246966763:-402388992,4247276852:16777216,4247534156:1073741841,4247997963:17039377,4248044685:-402388728,4248176813:121105936,4248374383:137421840,4248586796:16777233,4248903986:-268435911,4248964732:16777216,4249308382:629539217,4249629024:553648149,4249635388:17039377,4250263183:-1484817607,4250344993:-383972559,4250480910:-268435463,4250907585:-278975975,4251090524:16777233,4251314539:-805306379,4251405432:-268537955,4251430580:1308585625,4251568087:-384038119,4251647817:65809,4251703040:16777729,4251753868:-839122955,4251853706:1642583705,4252666874:153092369,4252692419:-383972559,4253116556:-383841767,4253391263:1862671153,4254091340:1879047865,4254194792:1840523281,4254970295:16779793,4255453868:-1518403267,4255527811:-336593095,4255584839:1877999293,4255645607:-278975975,4255705199:18876961,4255830081:-1484979951,4255868585:16777217,4256486823:50596656,4256667911:591790385,4256781340:-384562631,4256953055:-1488125159,4257251933:1299541009,4257701476:16,4257762163:154471945,4257876897:1831144369,4257921795:1877458869,4258736157:-401864695,4259029832:1090847541,4259124977:-440524807,4259481041:16910385,4259978018:17039377,4260022461:-268435523,4260214097:28152245,4260679671:16777232,4261500156:16,4261805401:1801807377,4261839613:1,4261855242:1130750993,4262479349:-470944711,4263056932:-374576231,4263572970:553912617,4263627361:86351889,4263809962:17039409,4264070883:-302027111,4264153416:1879011225,4264372118:33,4264988277:23085312,4265238718:259517969,4265278863:16,4265600307:-400815864,4265830826:-384103911,4266281335:17040177,4266384456:128191025,4266502866:-268435459,4266868554:-815904231,4267883468:16777216,4268059602:-277918947,4268126348:1839073840,4268910181:1305852601,4268966679:-1609629439,4269107183:1310673049,4269115543:1627455505,4269321162:23401009,4269668482:-441454959,4269742265:-268547431,4269989442:-402388728,4270160858:-415781195,4270336927:-268435527,4270464489:-268435911,4270481668:-278959331,4270595276:1090519041,4270940291:603979800,4271149015:1342177169,4271368637:16777232,4271628185:-1592983263,4271750250:1,4271825210:16777233,4271925961:-283240135,4272296808:-302551399,4272339775:1710260913,4272636811:-1604386015,4272901982:-279110855,4273056483:153398289,4273246520:23330817,4273610245:1870924673,4273707595:16777329,4273888683:17236785,4273979358:1,4274081794:1303883425,4274386098:50463233,4274408220:-1588657655,4274479073:-306298951,4274886360:-805306379,4274897548:1829767473,4274923578:-306569815,4275112174:-921957831,4275168009:1090781489,4275248922:1,4275579343:1705444281,4275586405:266860469,4275626944:-384099815,4276222008:1304375185,4276377486:16777216,4276555370:1335291537,4276619857:1,4276761142:-283305159,4276959084:-306298951,4277037515:-384562647,4277149633:16777232,4277194101:-268547559,4277538304:-1521548503,4277683870:-316930023,4277706515:153092369,4278181247:-384562375,4278474055:1092887441,4278552289:17203729,4278716541:-268436483,4278864381:-402388992,4279000497:-384038855,4279585106:17041921,4280247692:-308673752,4280259755:-270644711,4280286820:67108865,4280470749:-440967255,4280521571:-270644711,4280888649:1194830517,4281021189:16777216,4281376512:-336626887,4281785052:262165,4282226933:-1609629439,4282391640:1844920249,4282407623:-839122955,4282570165:1874078641,4282825832:-347141351,4282882433:16777232,4282947907:-401864439,4283058734:1830684945,4283066724:1,4283294503:-384562391,4283737743:16777216,4283786316:17171253,4284476566:137595733,4284644890:118843905,4285108920:16,4285135993:-413203911,4285215542:1340600253,4285298084:659489593,4285378917:16777216,4285546434:-301989955,4285666266:-1419367655,4285717623:16529,4285899572:-1555169223,4286093114:16,4286101056:690335281,4286249774:-403704775,4286257689:-519831271,4286596489:753200161,4286738446:-270587367,4286815179:-1348023655,4286867240:-384038392,4287242949:20054073,4288228929:-268443752,4288314195:-308409576,4288390300:16,4288653214:1237319669,4288814860:264219637,4288837231:-308409576,4288845963:23335425,4289018661:722671625,4289046369:-872415243,4289324182:1237319669,4289432692:-282068047,4289474248:-1487994063,4289496156:157516645,4289513683:-383972559,4289911272:184814385,4291032685:1303731993,4291282829:-1412561991,4291338243:1879006905,4291589230:-1554120135,4291759108:1299735825,4292473419:17040145,4292479460:1073872913,4292627262:1768632201,4292910842:-302022723,4292922513:-268501223,4292944579:17301520,4293554978:1090783793,4293581527:-815981767,4294141657:1304424437,4294158757:-272633923,4294181364:-2137782656,4294362452:-444661759,4294654605:-268435687},json:{542957:176288960,2336795:134218240,2572512:-349376584,3327817:-401799144,3682964:-272638292,4144856:1335357104,5167944:-272630088,5196787:-272699496,6829489:785938114,7347374:-2147219456,7601193:-336597096,7792763:1859876554,10690576:1329065616,11212041:2560,11300657:-268439876,12293765:-402388992,12681055:1859876552,13771932:1859876554,14171440:-268435458,14308622:1275723776,14861165:-289411448,15770386:17041920,16789478:-1557919048,19326669:-277984360,19935173:1859876554,20275682:16777728,21037339:1859876552,21820942:-268435458,26535164:-285212694,27132030:1130640,28332165:1859876554,30844404:-285217112,31128651:1275723776,31876770:67108872,33706056:1859876554,34653090:-285213048,35135232:-285215030,36463366:-285213048,36477952:-289419768,40362431:-268435458,42648294:1859872392,44880209:1874849784,45199803:-379778980,45340617:1859876488,46068699:-336597064,46871203:-268439624,47278749:-268439876,50741471:-268435528,53249037:1859876554,53802825:264192,53802893:264192,54680526:-285212792,55052930:-283239824,55554577:-268570952,57143008:-285212950,58769064:1276772864,59308438:16777216,62968192:-285217144,63397411:-2147352576,63460980:-285741432,63484792:-268435458,64067532:-268435458,64646060:228854644,66544818:786134728,66659640:-402388992,70090636:-1368515960,72666936:512,72933692:-402388984,73467024:1328934032,73981533:-318804344,74610078:604113920,79448493:204992032,82047917:1859876554,83085765:748946056,83394228:-268439656,84056133:-285212950,84930901:-285212694,85906489:16777728,87776435:-1996075520,89926523:-285217112,97072044:-285214998,98273147:1851487880,102955635:-285212694,106970076:-276955240,109639184:1275723776,116200401:784858848,116847518:-285212726,119120660:-268435458,121856814:1851487880,126272535:16777216,130083735:-281077124,130263698:-318935384,130318609:1859876488,138126782:131584,4163805900:1329065616,4165848932:-1994126496,4171330879:-289472800,4177128734:-1352266824,4182885857:-268435458,4184661597:-1381749064,4185346021:-374538754,4187971286:-268435458,4188127282:264208,4188783759:-273219960,4188835189:1822032392,4188946798:-268439912,4190165397:-402388992,4191573348:-285212674,4191675033:-285214998,4195966109:-294652280,4197093837:604130304,4199864370:255323696,4200990157:-293603704,4204045213:1851487880,4206160867:1859876552,4209045637:1821901320,4209484231:1328934544,4213592072:1822058120,4215548954:1859876554,4216499662:1859872392,4219121950:1208223744,4219885098:1859876554,4221072619:4325376,4222174446:134220288,4223268450:1822032392,4223314660:2192,4227881335:1859876360,4231105949:-285212950,4231713560:186936336,4231784883:-401799144,4233125417:16777728,4233351257:-379778980,4233912756:-1350570340,4235370110:-285233496,4235668682:1859909322,4236597784:-268439908,4237369800:1859876488,4238039391:1859876554,4238422144:1859876554,4239084453:704933536,4243763698:1822032392,4243943985:1208221696,4246966763:-402388992,4248044685:-402388728,4248176813:255323664,4248220834:-285219160,4248524950:1321205706,4248976810:571614848,4249284892:-268435458,4250066051:153356644,4255050951:1859876554,4255467138:777512640,4256595037:-285215064,4258575278:-285215096,4258779437:1859876554,4265205639:-288364920,4265443700:1859876488,4265600307:-400815352,4265640239:1859876554,4269989442:-402388216,4270940291:603979784,4271005908:-290062712,4271368637:150994960,4272001452:142631936,4273795241:1859876554,4273836617:1859909322,4274777e3:-272630020,4274920975:-272678918,4275417790:-285212674,4276350067:1859876554,4276778706:1859909322,4276857699:-269739012,4277394625:-268435458,4278864381:-402388992,4281111341:1874329308,4281680242:1859876552,4282095870:1859876554,4283304906:-1996223964,4284475851:-1358954840,4285274978:1822049928,4285467612:-285212690,4286658338:1859876554,4286867240:-385086968,4288228929:-268435560,4291226895:-276824168,4292657607:-285217144,4293451382:1865619972,4293517858:-920384660,4294181364:-1061919104,4294717358:-268435458},lua:{157878:262161,286794:1160179699,908281:-269484033,947079:-404228097,985371:1,1006937:16777857,1017155:16777232,1151296:-270008321,1180217:-1984971787,1550201:1224999217,2003081:1103433853,2003789:153283191,2080024:-303129609,2266907:-806354953,2320729:1877475317,2417197:49,2611547:-808463377,2704905:-949606409,3178380:84148481,3346625:1629493297,3425564:257,4168709:16777217,4589376:16777217,4668229:-269484033,4788968:-1376845833,5023618:-983265935,5210566:-404228097,5299387:-1343752193,5393397:16777233,5651177:1206384639,5923409:27570353,6335403:150994945,6343593:-269484033,6444531:-1443909657,6524020:-277873153,6633451:-808463377,6748576:-806357009,6793332:-404488193,6841194:-404228865,6915263:16777216,6970374:1,6991740:1132728625,7161053:150994945,7169100:-270008321,7347374:264192,7826548:16777216,8007935:1226868945,8118418:-403835079,8159510:-404228865,8260801:16777233,8802643:-270278657,9030537:1873021489,9089368:-269533193,9215806:-1343225857,9330059:16779280,9671199:-404226049,9676618:1627717941,10948045:-404226049,11212041:16779776,11235720:-1549384715,11259315:16777216,11342237:-404226049,11372726:-1377002505,11476166:-269484545,11837851:1092887057,11971664:1103250521,12081940:1078005853,12293765:1208223744,12519846:-269486081,13034566:-269484033,13186594:16777233,13211372:25169969,14079334:17039377,14111180:16777233,14114361:16777216,14179314:-270008833,14242808:-2054450995,14275715:1327613141,14286053:1,14510814:16777216,14737474:16908593,14752678:696261425,14769321:16910449,15697149:-1343225889,15767205:16777217,15770386:17041920,15820225:1797261585,16064360:1224738905,16214049:16777233,16223593:-1385255204,16417854:16777232,16789478:-1591474160,16811678:1822853937,16839351:-940572673,17388498:-1477967873,17915904:-270008321,17994815:-269484033,18003220:1090519057,18470013:1224736853,19055938:1843833653,19169077:631377085,20040902:-269484033,20275682:16777216,20288139:33554449,20848053:1292108593,21190249:1107296273,21249045:-1418723633,21479220:-404226049,21638658:1157890321,22053366:16777233,22234711:-269484041,22408304:25427985,22756924:1,22760496:17041920,23321953:17040177,24217541:1328014813,24368893:17041921,24403397:16777217,24782263:1877475253,25170246:153356885,25302584:-2147219455,25672434:658760979,25827441:1340604415,25856309:-269484033,26300522:1340602367,26535154:16777473,26686513:33554448,27210921:1340604349,27486989:-2145121788,27512485:1709392849,27675230:16777216,27676893:-270008321,27917080:631573425,28047376:17039921,28061236:1,29281770:18874641,31470430:1,31633117:16777216,31976894:-269484545,32071611:1090846773,32098488:-269484545,32261622:-940572673,32627218:17,32726328:19235637,32930725:1,32954544:-403832961,33857486:801,34150622:-1376800785,34521928:1730602487,35077351:803733503,35296213:16777473,35429574:16777217,35867201:-806887425,36909163:-269484033,37130730:127985104,37407195:-269484033,37427771:-341089383,38345011:-303058953,38483488:1627392305,39297288:16777269,39461344:81921,40011481:-269617383,40136936:187093975,40138247:-404226049,40337905:-270010369,40442488:1743254527,40461955:-1343750145,41316426:1,41711838:1635778961,41760587:-270008321,41922547:-269484033,43372757:1340587957,43698772:264192,44291106:393265,44651348:16777216,44800920:-269484033,45112942:-403727137,45637566:153485669,45750758:153317637,46394932:1,46846427:-270008321,47475473:1734604501,47626615:-1477969921,47842642:16777745,48199560:-1376845833,48295924:1,48457172:669513663,48645720:1694761233,48795731:-806879745,49167744:33,49188461:-269484065,49756971:-811095049,49972515:1870990005,50262134:16777216,51339464:19399489,51805480:-273944593,51920181:620923928,52887179:-303058953,53041825:-811095049,53176629:-303104009,53343400:-404228097,53799883:1,53800054:16777217,53800088:1,53800157:1,53800225:16777216,53800670:1,53800738:1,53802825:2048,53802893:2048,54864530:136430593,54939227:-269484033,55739283:-1893225609,56920565:16777489,57512342:1,57740275:8388624,57868231:-270008321,58112343:-806879233,58283539:150995601,58823749:-1549384939,59151406:1,59308438:16777216,60155988:-273715201,60392736:-2056651273,60591697:-269484545,61143210:-406587425,63072925:1637908593,63205075:16910449,63250472:-2126266212,63413339:-404226049,64790892:17042193,65073225:-269484033,65254328:2048,65362088:1627390257,65429313:86173175,65480933:16777253,65523917:-269484033,66229371:1,66483357:266860533,66659640:1208223744,66842558:-303120417,67548242:-403833543,67860197:50594097,71145637:-842198215,71462452:-1377374209,71973889:16777233,72933692:1745094656,73554161:-2029640713,74610078:620891152,75303661:264209,75346723:84149041,75750166:1341128703,76519998:-270010369,77001521:-806913537,77488763:16,77860285:-1987652643,77998429:-808454145,78502530:16777345,79782194:1336401919,80245489:-810551297,80526802:-1996224195,81314487:-336626887,81742814:-269484033,82424134:1093067767,82925504:1810755129,83208605:16777217,83350007:16777233,83933330:602423569,84848611:1331815645,85797653:16910453,86531117:1090521089,87127885:136430593,87875195:2097169,88505333:16777216,88672254:1627717941,89385717:-403832961,89871714:629333021,90625292:-806628129,91210688:133269,93214626:16777216,93643633:20,93815735:1,94543295:16777233,95365496:16777217,95892971:1627390225,96126386:-277873153,96275653:16,96357129:273,96442137:-806879745,96574035:-269484033,96844629:150997509,97059008:-1608250972,97191148:17172597,99851420:1839631152,99878335:-269484545,100350182:27656881,101907699:393265,102395155:20973588,102510877:-806879233,107047352:16777217,107506213:1202637797,107976297:-303129609,110412696:-403835847,110673729:-1418723633,113732009:-403833799,115154384:16779776,115626622:153608565,116502717:16777216,118272910:16777984,121942875:-269484545,126272535:16777216,126735740:-1893432491,126741512:1873213141,127522327:2048,128989260:18874625,131748530:-269484033,133534634:1090846773,133937728:25427985,134013330:33,134773916:-1477969921,135440681:-269484065,4155987191:16777361,4159610728:-953800713,4159906373:27312629,4161501651:-1343227905,4164042543:-1984955403,4166211628:1,4168123178:1627390001,4168415006:-269484033,4175371911:-270008321,4175835111:669251547,4176306610:1,4177056126:1795425077,4180330084:16777301,4180379855:32768,4181144136:-470944487,4181732551:-303058953,4182272228:16777489,4183783437:-269484545,4183840863:1795427141,4184410899:-1343225889,4184432574:84149041,4184688954:16777233,4185671183:-303104001,4185898014:-1350107137,4188488973:16777233,4188504755:-276345867,4188674375:1262520537,4188981984:5,4190165397:1208223744,4190483915:-270008321,4191523098:-1012596773,4193464810:17301520,4195071658:-1418723361,4195436821:-987757755,4196483509:1822722864,4196820858:16780049,4197001847:-269489169,4197060545:65,4197093837:620907536,4197380637:-273731593,4198028626:86437879,4198036118:-269490177,4198792334:-1893225609,4201403077:1090781201,4201463418:-269484033,4202331789:-2128182395,4203063720:-270011137,4204022205:-274224137,4205042422:-470944455,4205064510:16777232,4205214670:69206033,4205278244:16777217,4205932925:-2130444288,4207076625:16777569,4207222897:1627392309,4207931442:-1509684747,4208194860:1739056631,4208309188:-269484545,4208356132:-403701761,4208513288:-403701761,4209819616:-269484545,4211343712:257,4212078819:1877983157,4213268663:-269484545,4213473442:17171201,4214283380:29377561,4214853554:1,4215384633:16796849,4215975998:50331664,4215998958:-920128011,4216316703:-911739403,4216417408:-269484033,4216554910:16777345,4216583951:-269484033,4216832962:721684497,4216974258:16777525,4217878191:1627392273,4219121950:134481920,4219729268:1877475253,4220030681:-269484033,4222174446:150997504,4222301375:-269484033,4222517121:16777216,4223109845:620940824,4223123379:-269484033,4223314660:16,4223674691:16777216,4223795429:233269173,4224496884:-909307079,4225242072:267336369,4226163286:-270008321,4226265868:-808585217,4227426319:1637915121,4227925780:667154431,4228002083:1073741905,4229388226:1092616241,4229448967:16777216,4230395914:17040181,4230968503:1873161731,4231148360:-341089383,4231987172:-336593991,4232689753:16777216,4233125417:16777728,4233268708:16777217,4235496723:-806913537,4237031727:16777216,4237047891:16777233,4237197538:16777217,4237630041:1,4237655872:-1389393227,4237702804:25165824,4238451604:1,4238992175:16777232,4239212204:-404226049,4239293603:254009331,4239812740:153094145,4241046447:-269484033,4242091116:669513727,4242544995:553779733,4242843154:61706677,4243134914:86379377,4243166341:17039361,4243265187:161482833,4243347429:561,4243394753:16777216,4243598405:669515775,4243754346:-403832961,4243872492:621087665,4243876969:621087665,4244111080:-404226049,4244310713:-269484033,4244543580:-344982321,4244791220:-318373071,4245048405:16910449,4245186501:16777216,4245838819:-269484545,4246016320:23593217,4246343474:16777729,4246392993:16777216,4246545602:1694499093,4246555635:-269484033,4246966763:134481920,4247144689:-404228097,4247534156:1073741841,4247938344:-1985037323,4247997963:17039377,4248132513:-303120417,4248168967:-270008387,4248259343:-909307079,4248552375:-269484041,4248586796:16777233,4248964732:16777216,4250439574:1269777655,4251184407:16777233,4251703040:16777729,4251938528:1761872673,4253929921:-270278657,4254524139:1332707327,4255868585:16777217,4255934757:-269484033,4256279959:-277872641,4256525263:-269484545,4256979864:-269486081,4257373395:1099174709,4257490906:-277873441,4257876897:1831144369,4257892851:-404228097,4257921795:1877458869,4258255800:-277873153,4259421280:1341095423,4259481041:16910449,4259832212:153354641,4259940740:96486617,4259950785:151076865,4260214097:61837749,4261839613:1,4262087289:-269484545,4262439971:16777232,4262479349:-470944711,4262570825:-269484033,4262867275:-2145384416,4262927939:1843866613,4263809962:17039409,4263888072:-1608250892,4264372118:33,4264447607:16810001,4264669669:16777489,4265221701:-270010369,4265278863:16,4265653027:-269484033,4266281335:17039921,4266406211:690480501,4266847065:-270008321,4266931484:25186321,4267175e3:1843866613,4268665714:-1389393227,4269115543:1627455505,4269832775:-404226049,4269878799:-269484545,4270464092:801,4270595276:1090519041,4270940291:603979800,4271011946:-374947851,4271124815:-806879745,4271368637:16777232,4271639369:-269484033,4271641836:-270008321,4271750250:1,4271825210:17039377,4272321108:1742995447,4272973513:-273678337,4273057437:-1477969921,4273979358:1,4274386098:50463361,4275168009:1090781457,4275231254:-404230145,4275248922:1,4275586405:266860469,4275894115:-273680385,4276377486:16777216,4276619857:1,4276662938:81921,4277676755:20971540,4277722572:629541169,4277789605:-269484545,4277996249:1864822263,4278509498:-270010881,4278864381:134481920,4279066958:1637915125,4279550782:1797524337,4279585106:17041921,4279854126:1103302781,4280286820:1,4280463538:1877934071,4280612576:553779733,4280636950:-269484545,4280837617:16777217,4281021189:16777216,4281309080:-270010369,4281376512:-336626887,4281525267:-1480188937,4281606763:1293993265,4281702983:16779537,4281711795:16777236,4281785052:262165,4281940521:-277873153,4282088778:1124073617,4282423678:1694629913,4282546931:-273945617,4283066724:1,4283243257:1341095935,4283737743:16777216,4284238507:-403703809,4284389440:-269486081,4284633314:-2054450995,4285108920:17,4285215542:1340604349,4285378917:16777216,4285467834:16777361,4285476536:16910709,4285547299:16779777,4285669101:159779473,4285717623:16529,4286076601:538968881,4286093114:16,4286249774:-403704775,4286813244:18875137,4288448040:-1477967873,4288514097:689971713,4288661535:-1480254475,4289788622:-269484033,4289968648:-403767297,4290718429:1730216145,4290777981:20971605,4291089718:10522801,4291199976:16777232,4291485679:19005941,4291743666:-269484065,4292473419:17040145,4292479460:1073872913,4292497860:-269484033,4292597532:650373083,4292912233:-1488722669,4292944579:17301520,4292977897:-344982017,4294163237:-810551297,4294471447:-303059979,4294681065:1095045213},matlab:{985371:1,2003081:1095045245,2757411:-421535873,2932904:-1476397057,3115252:1,3346625:1092622385,3457522:-1476406273,4554644:-1478100993,4564013:-402653185,4589376:16777217,4782098:-421535873,5393397:16777233,5977311:6554400,7863414:-412352511,8118418:-403835343,8260801:16777233,8561223:264705,9625868:23331360,9671199:-404226049,9676618:1627717941,11170081:-1593573111,11259315:16777216,11778128:16777232,12081940:1078005789,13211372:25169969,13600674:16845081,14111180:16777233,14114361:16777216,14130268:-1609695231,14132354:118843905,14286053:1,14769321:16910385,14802228:84017205,15392555:555680553,15767205:16777217,15786292:587595825,16214049:16777233,17388498:-1477969921,17421368:-1555103207,17598563:-940064769,18359512:-988396681,18934377:-411238391,19072095:625934337,20366406:1661206841,21479220:-404490241,21873846:558825729,22756924:1,23321953:17039665,23609496:1743171575,24071969:554631721,25851398:-402653185,25994857:-402653185,26361145:-2088896515,26686513:33554448,27675230:16777216,28047376:17039921,28061236:1,29175243:-1476657189,30178870:17,31270053:657977301,31470430:1,32071611:1090846773,32627218:17,32930725:1,32973300:-1476395009,33857486:801,34256299:596575033,34520741:16777216,34521928:1663493365,35296213:16777473,37408233:264705,41300032:23331329,41316426:1,44001150:-939639809,46394932:1,47842642:16777745,47845727:-1589247431,48295924:1,48457172:669382591,49167744:1,50262134:16777216,52392938:2544501,53799883:65,53800054:16777217,53800088:1,53800225:16777216,53800636:262145,53800670:1,53800738:1,53802825:2048,53802928:2562643,55038114:-1477504003,55545501:4194304,55663643:-1592851927,56132221:-1521548535,57512342:1,58164e3:20392592,58574460:-402653185,58599982:17039617,58700142:121106389,58781070:-1609826015,59151406:1,61143210:-406587425,64915997:645586387,65362088:1627389969,65429313:86172119,65480933:16777253,66229371:1,66325884:-402653185,67548242:-403833543,71973889:16777233,74900706:1097072657,75303661:264209,75307157:-1072283273,75346723:17039665,75956234:23069185,77563885:-403703809,78787269:-402915329,82424134:1093067767,83350007:16777233,83933330:21496081,84836293:-1593442295,84842442:-939540481,85797653:16910453,86491607:-402653185,86752183:118812465,88672254:1627717941,91211009:593608087,93815735:1,94889315:-427883719,95365496:16777217,95892971:1627389969,95942161:1718732285,96275653:16,96357129:273,97170295:598678259,99107521:554565929,100350182:27656753,104133712:-1518403063,105876254:-1476397057,105940042:-402653187,106454761:-402653185,106742262:18311829,107047352:16777217,110412696:-403835847,116502717:16777216,118272910:16777984,133534634:1090846773,134013330:33,134234336:588186417,134773916:-1477969921,4160954926:2228661,4166211628:1,4175835111:669247451,4176947074:16,4178820659:2048,4181144136:-470944487,4182272228:16777489,4184432574:17039665,4184616345:23069185,4184688954:16777233,4188488973:16777233,4192391397:-1493958665,4193101815:555810293,4193252035:-1487011783,4194852332:20971521,4201863061:-1476395009,4201866639:16777216,4202693390:277,4203380996:16777781,4205042422:-470944455,4205278244:16777217,4207076625:16777473,4207891207:-2088897539,4208222367:-1522178095,4208431123:-1477181441,4211343712:257,4211546653:-1521614807,4213473442:17171201,4214171080:-1476395009,4214853554:1,4217878191:1627392273,4220761693:-402653185,4220883602:-1476657153,4221542050:84347833,4226334149:-1588723143,4227526970:-939524097,4227819956:-1519517175,4227925780:667150335,4228002083:1073741905,4229448967:16777216,4230991595:554303529,4232415481:17039681,4232595781:-2143938475,4232618236:-404810883,4232689753:16777216,4233268708:16777216,4235289311:17825792,4235971550:-1006895617,4237031727:16777216,4237047891:16777233,4237197538:16777217,4237524820:1201843703,4237630041:1,4238451604:1,4238840645:555745313,4241144047:16777781,4242091116:669382655,4242820562:118812465,4242942783:553910561,4243394753:16777216,4243960618:-1000958977,4244111080:-404226049,4244452210:23331328,4244967883:-1609629175,4245048405:133233,4245171891:-2112747503,4246016320:21496065,4246392993:16777216,4247079356:-1589378755,4247144689:-404228097,4247417373:-402915329,4247534156:1073741841,4248586796:16777233,4248590644:-1493958665,4248964732:16777216,4249629024:553648149,4249886442:1206300663,4250675700:-402653185,4251677454:1206300663,4255076359:-1006632961,4255864964:538968145,4256667911:591790385,4257995538:2544629,4258480461:-1476395009,4259481041:16910385,4260299422:1075839057,4262479349:-470945735,4263809962:17039409,4264372118:33,4264988277:23089920,4265278863:16,4265654975:1743175671,4265970921:19139445,4266281335:17171249,4266931484:25186321,4268966679:-1609760511,4269115543:1090584593,4269321162:1097160241,4269832775:-404226049,4269906164:-402915329,4270464092:801,4271628185:-1588788959,4271750250:1,4271825210:16777233,4272636811:-1604386015,4272672517:-1072217737,4273979358:1,4274386098:50463233,4274408220:-1592851959,4275248922:1,4276344616:121040693,4276464715:-1493172233,4277538304:-1521548503,4279599928:1197607031,4279846917:-402655233,4279854126:1103302717,4280875446:-402653185,4282226933:983041,4283066724:1,4284009690:-1037593601,4284238507:-403703809,4284644890:118843905,4285108920:16,4285298084:34537761,4286093114:16,4286224013:-402653187,4286257689:-519831271,4288091236:-402661379,4288448040:669513727,4288845963:23335425,4288881302:-402661379,4288933508:16777232,4289617677:-402661379,4289632544:-402653185,4289968648:-403767299,4291969587:-402653185,4292033483:-2095841263,4292416970:67865,4292473419:17040145,4292479460:17,4292597532:650340315,4293554978:264705,4294681065:1095045149},md:{20273:1117258944,336535:1073742016,394779:1241716290,719030:1859876554,732084:1817313992,812840:4194305,846123:-1342473080,985371:1,1017155:16777233,1470040:-268435489,1697776:16,1903093:1859872456,2557968:131072,2583475:1665140753,2752711:-431956287,2787008:584057472,2831900:-822207350,2893504:-285212961,2895398:1724642826,2997898:1862004427,3025513:-337903974,3040576:543162368,3073539:1721463488,3073726:786068618,3121097:-268468600,3135201:1859909314,3175031:1107427336,3270687:20971537,3332139:-270532897,3405236:15729792,3443372:-285212725,4168709:1,4195075:5242880,4485001:4194304,4524686:1859876554,4554684:-1342473080,4589376:16777217,4597797:16777360,5362535:16777216,5621406:-1955379072,5829259:106954880,5838450:1792767690,6007137:1075841025,6051692:1859876042,6145100:20971520,6157898:1323005642,6173180:-822083960,6335403:134217729,6633582:-268435832,6804818:2048,6821428:4194304,6915263:16777216,6970374:1,7110589:-335675425,7161053:134217729,7244044:1126170641,7272195:-285213047,7645078:639795201,7826548:16777216,8063914:1073872896,8290979:1859289737,8541563:1778385472,8567387:1077936128,8652460:33892352,8935089:1140850688,8984947:-335544609,9241145:1116340232,9242428:16777216,9461560:16777216,9530873:-285215030,9600383:-428222775,9798973:48808641,9956928:1859876554,10127682:-268468600,10287955:1107298305,10296665:-285213175,10539517:1112276992,10570337:1140850688,10607668:5242880,10706848:1859876554,11259315:16777216,11319071:537001984,11422233:672220296,11464945:71434248,11728054:1816806408,11778128:16777232,11921674:1859745352,12003339:23068672,12310707:135349256,12377862:675942464,12436366:639811585,12455233:5242880,12529570:1859876554,12566018:16777233,12571297:16777217,12715142:1828714187,13015312:173146176,13037484:1859876426,13116235:-967086447,13202879:-285212962,13222653:16777217,13430078:1247805440,13710157:-323092790,13913738:-335544617,14069321:-285215096,14116482:16777216,14144087:-916996079,14286053:1,14302260:1316484744,14403547:-285346102,14439558:12584961,14510814:16777216,14722629:1685945417,14825891:16777216,15194957:1126170641,15200464:1779636233,15203441:609355785,15209803:207618561,15264881:1859876554,15396675:1859876554,15426780:136389121,15554814:720512137,15616044:16779280,15639750:1077936256,15645305:-2005901631,15745095:-287312182,15766144:-306316585,15886958:1255671432,15897837:1859876552,15910507:786134730,15967760:16777232,15973062:16777232,15974122:16777232,15981506:-285508472,15990062:16777232,16008148:609749128,16214049:17,16223593:742564480,16227835:1,16228895:16,16236007:-285749565,16259681:1859679368,16339315:-855900983,16417854:16777232,16445982:16777232,16454145:1859876488,16473688:-1342473080,16609994:-892202424,16658841:4194305,16838215:-1435766136,16931122:1821078210,16990428:16777216,17161325:1716519944,17199719:1809648857,17507131:-1955379072,17682827:-335544609,17856106:-285213109,18021931:1682047048,18644434:1107298305,18919737:16777217,18951719:1859876554,19018230:1094715409,19094259:-2095036416,19236821:215027712,19555830:16779280,19752999:-306316578,19821148:1859872394,19931715:1859876426,20215103:-453090688,20223845:1321944778,20496160:12584064,20925068:586156672,21357481:38273024,21516377:1725658826,21755141:-268699941,21903406:1247302272,22493849:1111752705,22538221:1859876554,22756924:1,22791867:21102592,22939241:2097152,23084087:1255737034,23215402:608305152,23594251:1869091347,23735270:131072,23917059:537001984,23948977:-323095862,24066915:1859876552,24097576:612368384,24231511:1859876490,24403397:16777217,24407463:-268435489,24551576:1859858624,24933691:1859876554,25044974:1859875968,25452061:-285212981,25820513:-285212981,25917244:1859876488,26237993:210773128,26267702:1822126794,26457357:1285162624,26522428:1289355272,26612050:1318745736,26771193:76548865,26775336:1157629968,26839434:1111494656,26923413:-1365913079,26926110:-285212981,26956353:20971520,26975240:1826485832,27007400:1140850688,27048697:-2111831935,27063417:-268435489,27132030:65536,27230322:1859909322,27314217:-427899774,27675230:16777216,27768951:1182389961,27791569:1112276993,28061236:1,28710765:-1405091839,29052028:1816667720,29078772:33554440,29336471:1174405145,29437394:-419570621,30058617:1,30356821:1187136066,30501566:1761339079,30502269:128,30559954:542638152,31067651:16777216,31263734:-285215031,31302130:106038920,31470430:1,31645422:1826305736,31750606:-286402981,32040808:-1955379072,32094843:4194304,32102171:1851683336,32279699:-270532897,32693725:1682047048,32799730:205520896,32824470:1725650048,32854950:138543104,32898716:1744961600,32905286:1,32978734:1859744904,33124851:2244608,33285324:-306316585,33522150:1677721600,33707094:786003464,33713611:16384,34066493:181937672,34113768:-816330543,34271025:37748736,34276736:-270795045,34418533:1792677512,34778161:136348161,35370478:-268435489,35429574:1,35461456:1280930826,35837456:4194306,35990494:1851408904,36112850:663552,36340965:1229064209,36374510:5243008,36759585:2097152,36953371:17,37000514:1792112328,37342493:786134664,37472923:16777232,38116715:4194304,38426886:1725579978,38481128:1691377866,38876889:1861213890,38989793:4194305,38994523:-2145386368,39015483:100713089,39436425:1859876554,39461344:138493953,39522651:-268435553,39856941:-285213048,40233269:-2141192191,40417970:16777216,40451766:1859876554,40585302:67108864,40701229:1826313930,41241218:642909832,41530750:16777216,41895062:-335675425,42222725:33554496,42405375:-268435489,42627158:-2113929088,42962509:-268435832,42999651:-285213047,43028265:1283667650,43081229:780826176,43089216:16777216,43287979:-453096832,43680025:-285217126,43695935:16777216,43893832:-269486369,44243837:1256341505,44302665:1726971401,44407813:1859876554,44651348:16777216,44982888:181937664,45479568:1090521105,45657565:16777232,45761781:1859876490,45931099:-285215030,46136499:1859744840,46329064:4194305,46495347:1656898184,46801361:1073742016,46870374:4194304,46887902:1075841025,47097701:608704664,47238035:1859876554,47757025:-857835830,47761934:1859909314,47823238:16777232,47897427:1255695496,47951923:4194320,48279570:1859876488,48566942:1859745352,48604750:1859876554,48693171:1322456200,49448735:1651243145,49634844:1280524994,49648770:1073741888,49676780:20971520,49790204:1826227272,49838177:54542353,50262134:16777216,50338611:-285313333,50605326:-287440949,50697058:4194304,51104816:786134602,52585783:1073741824,53445214:542244928,53668417:1107298305,53799746:134217728,53800054:1,53800157:1,53800225:16777216,53800670:1,53800738:1,53800773:167776257,53800807:65536,54198615:2228224,54231345:-285212981,54233949:1682047048,54349900:-306185513,54871735:-335544609,54875784:709183555,55768327:742392832,56558675:-270532897,56605880:33554496,56613286:4194304,56656505:1859876554,56800294:1725658818,57141973:1725588170,57502225:1321956034,57512342:1,57933767:785535624,58017159:1859876554,58420046:1859876554,58466166:-285212965,58859255:1722540736,59308438:16777216,59386365:207749641,59749433:1862105731,59886983:1859876554,59917803:1859876552,60053439:544243841,60302696:16777216,60499451:1073741824,60717317:1859876554,60762154:1817313992,60823860:138412033,60933531:1859811018,61927365:-269486443,62200716:4194304,62367510:-285475135,62389744:4194305,62486203:-286279359,62521159:1757938816,63014588:1859810888,63397411:-2013134848,63959175:537001984,63996694:-268435745,64250955:140002432,64829329:1859876554,65052525:1322873992,65691389:1275068416,65693567:-285280566,65780554:4194304,65852475:2277376,66449051:16777233,66659640:134217728,66687739:1859876552,66955326:-2111831935,67310368:-285212971,67757866:4718656,67826272:1724642824,68049446:1859876554,68288620:1859909322,68338029:-337903974,69700010:20971520,69865379:4194304,70055622:1859901064,70259840:1792759432,70299910:106987648,70651561:1862264458,70877428:113787584,70950214:1,70990950:-285215029,71201111:-268699941,71504034:-268468600,71715122:16,72043554:1859811016,72379479:537001984,72430547:-268435489,72434480:16777233,72459135:-1435766136,72933692:1744830464,73007188:1726897673,73040529:-520421751,73390281:-285212981,73967585:642843656,74215539:1859876554,74395840:1861936256,74448411:4194304,74540056:1859876488,74962686:1725658248,75494038:1073741840,75591559:1861213890,75607263:-285212982,75662294:1850963658,75972782:1794890890,76418579:1859876554,76523808:1614807683,76839199:2048,77052113:12713992,77396246:7471120,77411922:-285215031,77488763:16,77676429:16,77683272:16777216,78644114:-2111700863,78692726:16777232,78768537:542114816,79462809:-287312182,79835783:206570496,80091963:100663296,80190988:513,80236629:16777217,80504773:541589504,80535367:1778385472,81254789:1859876554,82081154:1257827465,82630808:4620416,83163469:1112559616,83225979:2561,83242825:128,83606419:-822207286,83784597:23089168,83949074:-331480823,85659414:744094209,85687062:1091043345,85835074:16777216,85930025:718960138,86525887:-285215032,86531117:1073741824,86597118:651300872,87016341:16777216,87462784:4194304,87674098:46137344,88009163:1859876552,88196603:151027712,88302986:33554440,88505333:16777217,89133099:1208090626,89171675:1860425352,89296642:650470529,90230635:1790984200,90392416:-285344574,91132414:1090519056,91211009:576828546,91651316:-294132022,91867149:640,92222076:-285215096,92320377:1859876490,92605906:1721463488,93204947:-822088560,93736150:1859859522,93896264:173162560,94090046:1859810440,94519731:1851487818,94792685:-293601590,95003446:12582913,95010139:1791059656,95038021:-285214142,96240770:-285212853,96348077:4194304,96397105:1859811018,97349736:-2113929206,97556957:-453096832,97783800:1112014848,97791433:-1435766648,98017612:1859876488,98178765:-1359511605,98275324:1859876552,98648701:1656897672,98809810:1318076928,100196627:1859876554,100347902:1699222033,100374592:2097153,100792724:1859745482,100902357:48808649,101092681:16777233,101188596:1859876554,101272608:203497473,101351935:1826227272,101877592:16777232,103300504:1859909322,103329644:1854493890,103429268:16777232,103511078:79695872,104027111:54525952,104358229:543162368,104713976:1859876554,106816560:-318897911,107284437:16,107925824:16,108610258:1858294920,108852144:-353372469,109102277:1283667586,109489362:1859876426,111153579:-335675425,111192181:-285212961,112546501:1816663048,112822666:-285475192,113507497:-285215029,114351222:1859876554,114640391:147914752,114879009:2064,114889344:1788556416,116016731:-1955379072,116274766:-285215029,116474072:-268731256,116502717:16777216,116761577:-268435745,116775123:786118280,116802014:-285215096,117180424:705712256,117404983:1048576,117560155:-307365163,118060866:16777216,118272910:512,118495978:1745354760,119858516:1073741888,119996327:1717138504,120737830:1859876554,120866495:131072,123803139:709183555,125163513:786134730,125228892:1648509064,126658329:1859876554,127208675:1111754753,127387043:1859876554,128146334:1115209858,128744031:-1350869880,129618624:4194312,131828334:-306316585,132534121:1682571336,133900956:48808649,135793726:16777232,139135851:173146176,4150370038:1859876554,4154969634:46137472,4155359182:16777217,4155586013:524288,4158814088:1086324864,4162747158:642942985,4163918103:-269486113,4164896305:1859876554,4165271670:1112276993,4166211628:1,4167090198:608700560,4168889896:-285212853,4170301986:1854628552,4171980771:1724530762,4172122687:-1941962751,4172446639:1650029704,4172819105:5243008,4173017197:-268435745,4173445613:-285212981,4173612988:180486152,4173638408:1850996426,4173651060:-285217142,4174316238:16777232,4174544446:1859868362,4176306610:1,4176626371:608704664,4176903623:-872616808,4176947074:16777233,4177663730:705822784,4177992197:37879808,4178810682:-287312248,4179308594:-1435766648,4179891249:1187528712,4181322187:1851487816,4181620737:-1361051957,4181710081:-335544353,4182056109:1288699904,4182310634:16777233,4182500145:543162368,4184767070:1692026440,4184957393:23069840,4186107305:1859867208,4186597310:1858303176,4186634484:-2107636735,4187010063:-2111567743,4187028004:1074266120,4187177271:1859876546,4187946691:1859876554,4188068476:-268435745,4188236226:37749768,4188488973:17,4188674375:37748736,4189543383:-285213048,4190531219:1859876554,4190598260:-1478492465,4190683307:718951944,4191056504:-285215030,4191121514:786134664,4191547070:16777216,4191926291:-285215093,4192043882:1859875976,4192088355:4194368,4192360650:-838867815,4192447395:16,4194034326:1826227272,4194089386:181937664,4194443619:549454336,4194519225:1859909322,4194657503:1859905224,4196102469:4194304,4196128540:-822207286,4196134753:1859876552,4196292160:4194304,4196525687:1859352266,4196671678:147871432,4197285583:1322997450,4197378828:1657500874,4198883114:-285215037,4199402926:1221104136,4199465312:1859909256,4199524366:-285212725,4199911468:-1350697781,4199976303:-268435553,4200187838:1623720064,4200984693:-268435745,4201034297:546833480,4201729111:-1071644544,4201761304:16777232,4201866639:16777217,4202433013:-270532897,4202483822:8,4202957170:1322788040,4203196334:37765128,4204109184:1687163464,4204190187:1717138504,4204801933:1791719114,4205057668:1119896705,4205278244:1,4205559134:1794813569,4205702098:1254776842,4205738421:20971537,4205782762:1817313992,4206030094:1691488840,4206588398:-285387709,4206962851:-529519615,4207264190:79691904,4207952266:-822207286,4208091218:1721460362,4208133651:-268435755,4208384222:16777233,4208408073:1321943754,4208849628:-285212981,4208934187:1724610056,4209045637:1821900800,4209286462:1850950794,4209876398:1086324864,4211253492:-285475191,4211730254:4194304,4211793109:1690304641,4211817073:1321944072,4212119102:1795141313,4212211136:1255671432,4212977875:100663304,4213161475:-285212981,4213380447:4194304,4213443794:50331665,4214228217:1859811018,4214499491:-285215030,4215139545:1859876554,4215263695:1112539136,4215572801:37750928,4215975998:33554432,4216577521:167776257,4216598956:-285214126,4217747354:1794235395,4218153417:1107951616,4218356023:1859876426,4218419059:1859876554,4218529230:1255831176,4218836783:16777232,4218882553:-287312248,4218912306:5243904,4219255092:181937672,4219376193:4194304,4219501421:4194304,4220600338:1107427336,4220600433:-2145386368,4220748403:1287651456,4220830794:1182318722,4221147328:1,4221207706:1,4221234321:64,4221280735:1859876554,4221378653:1800751299,4222133333:1859876554,4222391036:-419899711,4222517121:16777216,4222654750:1280925698,4223056561:1794759810,4223330143:37750928,4223674691:16777216,4223811493:1087373312,4223892637:-1350869880,4224404745:785601160,4224487183:4194321,4224564164:-287321464,4224853345:1725634120,4224859136:1855616584,4225142005:1859876554,4225179872:-287312310,4225222433:-2145255295,4225341739:1,4225486712:1154499778,4225591873:-285868085,4225627709:576,4225667766:1859871872,4225854829:-1350869880,4226347114:1850963658,4226447161:1720410816,4226448140:-287312184,4226637312:1283604610,4226739455:1279410816,4226753732:-285215029,4228169038:1224869917,4228229668:33554440,4228545770:1801260121,4228601112:1826322122,4228910830:1859876424,4229448967:16777216,4229520983:1107298305,4229531490:1859876488,4229610700:1221067904,4229890303:50331665,4229952772:1859876554,4229997384:1826485832,4230004652:1323005642,4230115484:1816223744,4230138901:-268435745,4230223119:16777216,4230444374:-285217143,4230968503:1845625346,4231136452:1190707842,4231425034:-285344054,4231815168:20971520,4232140732:552731136,4232207457:-1361215925,4232517751:1859876552,4232559382:1859876488,4232689753:16777216,4232780306:5243008,4232933186:5242880,4233204734:1859876554,4233950772:-335675425,4234403065:1859876488,4234964634:1221067904,4235322722:-335544617,4235340641:1095238161,4235789696:4194304,4235849436:-306185513,4236304234:-419572542,4236363185:-335544617,4236471987:1809649369,4236594367:106070152,4237031727:16777216,4237297427:1859876552,4237404669:1648377992,4237486350:1246778434,4237668519:249239176,4237702804:8388736,4237722057:33556481,4238053047:-270532897,4238134681:1859810504,4238151719:180355081,4238309218:1809648857,4238451604:1,4238749632:64,4238863293:-805378928,4238943369:-285215158,4238955640:16777216,4238992175:16777232,4239037501:-268435489,4239201177:608700560,4239232421:207102464,4239467340:-268435745,4240238175:1719321730,4240531463:-285212853,4240615939:-805401382,4240631294:16,4240652001:-335544353,4240716793:4194304,4240929561:1073741824,4241013581:16777216,4241200889:-287574392,4241510293:20971520,4241943318:4325376,4241948009:512,4242475945:-285215029,4243394753:16777216,4243781804:542638152,4243797972:-428222775,4243924076:1212823176,4244246697:1077936128,4244426285:-285217126,4244648492:1864896531,4245186501:16777216,4245257550:1859876554,4245665087:549453824,4245795531:786134656,4246025513:-268435489,4246168207:-285212725,4246392993:16777216,4246467517:551026760,4246519213:-318810421,4246767751:16777216,4246966763:134217728,4247071384:1615331328,4247276852:16777216,4247584993:-285212853,4247609438:1801260121,4247637778:546308736,4247871231:1859875978,4248008619:-287312182,4248184968:16777233,4248374383:-931601264,4248638504:1716524224,4248739325:1859876488,4248964732:16777216,4249151571:1859876552,4249530844:1859876552,4249590285:1792112328,4249878445:37748736,4250226364:1792742472,4250505498:1859876554,4250537292:1858827978,4251025449:48808641,4251184407:1,4251258522:603979776,4251664313:1285174912,4252002367:39879360,4252112068:-268731256,4252192554:1682047048,4252365879:1254121480,4252629812:-870449144,4252775484:1716143168,4252953137:1107296257,4253149023:4194304,4253266151:785977986,4253278281:33554440,4253552354:720512137,4253566197:1309671424,4253684142:-1435766648,4253685932:-868351991,4253712043:1859876554,4253930621:1826313930,4255232588:1,4255416801:1321944202,4255526190:16777232,4255835651:-318894071,4255868585:1,4256093272:536870912,4256127780:-285213048,4256371653:-285475639,4256378521:16777232,4256521192:33685504,4256743105:-1554174781,4256836488:-997415231,4257157997:1073742016,4257168990:-286402981,4257669532:1859868362,4257997757:-268435745,4258588418:-285212853,4258634969:1859876488,4258789049:-268435832,4258845731:-285475639,4258897521:-285475135,4258959646:20973585,4259155275:-805444464,4259342984:1828716235,4259591516:-1435766136,4259627148:-805507943,4260247080:134217728,4260317540:1208090626,4260679671:16777232,4260964119:786134152,4261087938:1859876554,4261500156:16,4261574092:131072,4261663070:1094715409,4261683480:-268435745,4261839613:1,4262050638:1275199616,4262054846:-268731693,4262128630:-268435489,4262436161:1859876552,4262439971:16777232,4262873387:-286403501,4262997559:1859876426,4263073162:1859909314,4263285961:-997284159,4263371542:-1361084721,4263411793:537919489,4263485534:-422443456,4263488960:648200192,4263567421:-285475192,4263928607:786167432,4264092664:33554440,4264372450:16777217,4264539153:-285215030,4264924899:1859876490,4265159020:1077936128,4265762626:-285212961,4265854978:1322263681,4266133055:1691944064,4266601187:1251627648,4266606879:684357312,4266613163:1719320706,4266686375:1853355656,4266695968:-2013265920,4266911004:1859875978,4266931484:25186321,4267173332:140137992,4267395703:153092224,4267524061:16777232,4267630008:1862270667,4267654051:-268731256,4267701743:610278528,4267883468:16777216,4267915028:1859875976,4268025636:1792697992,4268132007:-805311344,4268286776:651826312,4268294103:1859872458,4268508072:1726897673,4268850586:-855998773,4268941534:-324076862,4268979370:1859909320,4269056414:16777217,4269337312:1795161803,4269473639:1322940106,4269672526:-268435489,4269692077:64,4269757511:651302472,4270157208:-285213047,4270192583:1859876426,4270450563:16,4270595276:1090519041,4270627489:1859876552,4270809803:1280930826,4270897026:-335544353,4271284074:1859797504,4271826440:16777233,4271858787:-285215096,4272028970:744094209,4272544139:16777216,4272687496:16,4272719121:1179653184,4272837182:720512137,4272861230:1745495168,4273019262:-335544609,4273144546:181621960,4273260429:20971521,4273290306:1817314376,4273375066:4718656,4273565827:1859875976,4273572899:1859806408,4273701260:-285212981,4273979358:1,4274067085:1649112200,4274068223:-285215030,4274103297:1859872394,4274335447:1074266240,4274644639:-318808373,4274738332:1612709953,4274776757:-285212982,4274838482:-268435832,4274910196:1716143168,4275239990:-268435755,4275248922:1,4275350511:16777233,4275375827:4194304,4275439911:20971520,4275505917:1074266120,4275513509:16,4275652839:524288,4275802142:1791719114,4276075751:16777216,4276088200:786118280,4276377486:16777216,4276517544:1792108232,4276549054:1794813571,4276662938:138493953,4277116481:1332220051,4277149633:16777232,4277601599:2097152,4277789751:4194305,4278241153:-287312248,4278293224:131073,4278546889:1792767626,4278700334:4194304,4278818596:-1955379072,4278835560:16777232,4278901317:536936960,4278968889:1859876554,4279264856:1725658248,4279368798:1321878218,4279409822:4194304,4279503109:16777216,4279531187:1656898184,4279948174:1859745474,4280020224:5373952,4280138009:1254121472,4280177454:106260865,4280286820:67108865,4280724950:-268435745,4280828430:-285215096,4281021189:16777216,4281069720:16384,4281076887:1,4281147027:167776257,4282047790:4358145,4282097317:1124597785,4282157953:1821930112,4282305529:167789056,4282329546:1859745482,4282421806:1075841025,4282882433:16777232,4283317917:37750912,4283534727:1859909256,4283737743:16777216,4284188857:1859872458,4284368657:1226965061,4284669900:4194304,4285022881:1860005577,4285100978:548407936,4285108920:17,4285594659:1859876552,4285733420:16777216,4285767181:155533505,4286039028:-335937896,4286208828:1623195777,4286220516:1816810504,4286235636:542114816,4286337134:16777232,4286447887:-268699941,4286494909:16777232,4286503893:48808649,4286685438:1792226890,4286724023:-833104702,4286736148:1859876554,4287170026:138412032,4287340892:1816884232,4287420493:1,4287575265:105927744,4287827044:1859872394,4288126324:1859876554,4288616509:-892202424,4288703866:1861315201,4289005602:16777220,4289018661:705894409,4289023859:1685945417,4289264700:1828550217,4289395009:207749769,4289445312:1255806536,4289469589:1255806536,4289897023:1859876424,4289953842:1794759808,4289981802:1859744904,4290193436:-337903974,4290330488:1725579978,4290468293:1719278208,4290680458:-824306486,4290813345:1,4291199976:16777232,4291272259:1859876552,4291307705:536870913,4291380284:541136066,4291393413:67108864,4291567991:4194304,4291622921:249062600,4291656333:1862268619,4291698302:-268468600,4291751345:1859876554,4292085571:-323490101,4292092935:4194304,4292201796:1856231432,4292261869:1859745352,4292314041:1859806336,4292324402:37748736,4292477880:-337903974,4292479460:1,4292547324:1859876554,4292613421:1859876554,4292763575:1107820544,4292977588:-285212977,4292981910:642941064,4293144463:1859876042,4293188354:-270532897,4293265198:1826305736,4293274059:1859875976,4293329057:4194312,4293350802:788339329,4293423350:-870858751,4293637701:1859876554,4294389493:1859876554,4294470816:1321943746,4294487731:1812467848,4294724981:1802886231,4294894261:-2111700863},mm:{382356:1859876554,516039:1830270609,685161:-840966145,985371:1,1135042:-287312182,1380234:-317603929,1417014:-270532609,1691756:-287319041,1755583:-287310101,1939826:-1920597003,2273236:1875787679,2468342:1276248705,3115252:262145,3150748:-279000085,3247138:-288898333,3257290:1855157962,3257395:1859876554,3327817:-401799144,3705248:-278921299,3843897:1746403848,4435557:1859868362,4589376:16777217,5036854:-270532609,5709159:-270590977,5724962:-270541825,6406758:-287309825,6854470:-270532609,6970374:1,6978370:-287319061,7327504:1859909322,7347374:264192,7746773:1859909322,7826548:16777216,8163575:-287309825,8260801:16777233,8279589:-1395680257,8449778:1847136776,8561223:553912849,8652460:33908737,8760072:-270532609,8844597:4194561,9230723:-287310869,9338597:-270532609,9445427:1855682250,9579763:1859876554,10547933:1851458056,10971323:-287309841,11170081:536870920,11265160:-274726913,11457330:-287309845,11648385:1318811338,12118630:-1428160529,12293765:-402388992,12336465:1746403848,12589599:643498504,12901351:-270590977,12912345:-325186808,13116235:-967053679,13475198:-351532231,13506975:-384038019,13892934:-313588935,14079334:16777233,14103723:1733785567,14130268:-1610350591,14132354:102064641,14143027:-845160961,14237506:-393936157,14286053:1,14308622:1293814288,14510814:16777216,14651512:-1562640401,14676962:-270532609,14705593:1318811336,14769321:133153,15291533:1277034528,15368289:1830008739,15689606:1859876554,15756532:193457361,15770386:262656,15786292:-1487011783,15788246:-270532609,16069180:-270532609,16186629:1276248705,16211928:1330795161,16214049:16777233,16228370:-287375361,16805384:536870920,17154160:-384038359,17421368:-1571880439,18003220:1090519057,18576615:1817842242,18657655:-807411713,19072095:609157120,19114184:1851225803,19552597:1251112642,19628201:1828981045,20001750:100953729,20168433:1322415752,20366406:-486276807,20848053:1292107825,21518204:-270532609,21638658:1157890321,21873846:558694401,21884375:1859909322,22053366:16777233,22408304:262145,22613987:1859876554,22617559:-287312150,22756924:1,23455801:64,23673757:-270532609,24361697:-287319057,24368893:512,24403397:16777217,24649474:-287309825,25192357:1859900106,25302584:-2147219199,25327284:1859785418,25635114:1650131528,26535154:16908545,26771193:798558977,26923413:-274867383,27132030:65536,27184074:1847136776,27185297:1850832458,27211227:-279047305,27515177:1322996360,27682013:1846637056,28302640:1859876554,28607133:-383841783,29217755:-308409832,29458105:-287312149,29648039:-287342901,30219881:-288374045,31128651:1293813776,31934920:-314406251,31982121:-404754945,32279699:-287346997,32331348:-287319061,33946126:-270532609,34446998:-270532609,35239310:1859876554,35260139:-287335893,35417585:-270532609,35701950:-287310101,36558013:-824239197,37174610:-287310101,37408233:264705,38098271:-287319125,39016116:760976907,39461344:134299649,39470955:-287309825,40355082:-270532609,40433881:709427208,41378701:-2012610271,41832643:-287319061,41876621:1859344074,42475294:-824189205,43698772:264225,44391284:-278981633,44617864:-1886916623,44711463:-287309845,45056901:-287319057,45199803:-383973284,45668469:-287312182,46066555:-287319317,46766651:-287309845,47184756:1859876554,47312563:-270532609,47478257:1859867338,47515685:1859876554,47643797:1792741448,47845727:537002496,47952646:-279047297,48169787:-287321398,48642373:-287319057,48928812:-2054814731,49547159:576652065,50357567:-350287575,51275740:102327808,51427820:1859876554,51546791:-807412225,52276737:64,53481494:102064769,53800054:16777217,53800088:1,53800157:1,53800225:16777216,53800636:262145,53800670:1,53800738:1,53800807:219223553,53802825:264192,53802893:2048,54875784:704989249,54969160:-1899630613,55663643:-1593179647,55757779:1859876554,56558675:-270532897,57512342:1,58769064:1830685200,59308438:16777216,59449577:-287309841,60186614:-274726913,61143210:-406587425,61154297:-270532609,61827387:-287368193,62976958:-1486943427,63064099:-287312182,63468860:1859876554,64418996:1860131365,64505548:1746468936,64750519:-270532609,64839715:-824813944,65362088:1627389969,65485546:1859876554,65961766:-278983875,66659640:-939259904,68296785:-287319061,68443836:101843008,68561459:1859876554,68895323:1179649,69094873:-287351829,69624525:-270532609,69774398:1859876554,70180844:-278937617,71198324:1859876554,71598515:-287312150,72176735:1859876554,72933692:-402388984,75171214:1859876042,75303661:262161,76404366:-836955607,76831132:-393932061,77335550:1855682250,77345272:-384562647,77860285:20992,78690443:1822032392,79183185:-287319061,81184727:1822032392,82601453:-287319057,83152355:-270532609,83225979:798034433,83350007:16777233,83700702:-320889889,84836293:-1593442295,84901889:-270532609,85768611:1859909322,85797653:131136,86531117:1073741825,86752183:118812465,87267454:1859876554,87629859:-270532609,87832e3:-384038083,88196603:1774225536,88598996:1859876554,88798717:102592193,90415532:-316686417,92430870:-288374037,92953565:-287312150,93815735:131329,94083059:-270532609,94526752:1859876554,94543295:16777233,95628073:-270532609,95892971:1610612753,96275653:16,96664273:1859876554,98012884:-1954026027,99171232:-270722145,99454230:1284679297,100643283:-270532609,100824280:-270532609,101172759:1859876554,101443742:-278983831,101705514:-287309845,103087494:-287310101,103439056:1859876554,103677157:-1361051665,105170283:150995473,107047352:16777217,107287639:134217728,107627241:1792767690,108524077:-270532609,109130155:-287319057,109639184:1293813776,110732390:-287310101,111537333:-325186808,111551230:1859876554,112452290:-270532609,112642797:102064769,113468022:1859876554,113643319:-287310101,114381970:-287309845,115129233:-1503722967,115221454:-270532609,116388487:-283374823,116502717:16777216,119214439:-400816103,120330040:-1362703899,121351574:-270532609,122233996:1859876554,122294389:-287310101,123803139:704989249,126272535:16777216,126680217:-279117527,131722772:1813194368,133937728:262145,134234336:-1486945479,4161051698:-270565377,4166211628:1,4166779749:1846223050,4167185054:1859876554,4168454109:1858692232,4168654531:1859876554,4173396898:-287368209,4176538143:-287312182,4177046655:-1475739095,4178243293:-287309845,4178373331:-287310101,4178820659:264193,4179499905:-270532609,4180100894:1859876554,4180206038:-270640129,4182789924:-2036917727,4182934705:1859876554,4184688954:16777233,4185898014:-1366884373,4186181662:-379841673,4186572608:1166016965,4187678804:1850963658,4188127282:264208,4188835189:-308409832,4188854089:-270532609,4189214527:-287318033,4189461060:-287312182,4189662286:16777237,4190165397:-939259904,4190207356:-278983811,4190552516:-270532609,4190632445:-270532609,4190889267:1746403848,4191357080:1859876554,4192144082:-287319057,4192447395:16,4193140115:-421534013,4193252035:-1487011271,4195310940:756466605,4196584775:-325189112,4196728482:-413698081,4196820858:1325428691,4198002737:-287309845,4199503089:-287319057,4199611560:-401864439,4199688799:167772168,4199994540:-270532609,4200188245:-270532609,4200615287:-287309825,4201253216:1855682250,4201403077:1090912273,4201463901:1859876554,4202523656:-270540801,4202995245:-291508253,4203660099:-1395680289,4204335959:-287310101,4205278244:16777217,4207415845:-287312182,4208444801:-270532609,4208984342:-287319057,4209045637:-308540904,4209741679:-1554054359,4209809824:-271348769,4211343712:1,4213107710:-287319061,4213487010:1859876554,4213501193:1859876554,4213749971:-270532609,4213797676:1859876554,4215517300:-404750337,4215850719:-270532609,4217366795:-270532609,4218832129:1859876554,4219121950:1208223744,4219541793:-287310103,4220655086:1851458056,4220817710:1859876554,4221143231:-287319057,4221273556:-413201603,4222101405:788983665,4222517121:16777216,4222596666:-400815863,4222598178:1846932128,4223268450:-308409832,4223355019:-825297013,4224557277:-287312182,4224770881:-287319061,4224831433:-270532609,4225719687:-287309845,4226125724:-287310101,4226334149:-1588723143,4226928135:-824292839,4229358650:-287351809,4229361811:1859876554,4229913474:1862535477,4230045016:-270647361,4230395914:512,4230406998:-401864695,4231097739:-274726913,4231784883:135006232,4232207457:786003018,4232535660:1305676767,4232913409:-287312149,4233043392:-270532609,4233125417:16777728,4233321999:-2012477152,4233351257:-385021860,4234615610:1851462346,4234810563:-1361313809,4234816035:1859876554,4235289311:17825792,4236272331:1859876554,4236292708:1859876554,4236526237:-400815863,4236620916:-270532609,4236758668:1859876554,4237197538:16777217,4237244340:-1486945735,4237429729:-287312150,4237715685:-308409576,4238451604:1,4239265541:-287314647,4239927368:-287309841,4241336260:-287309845,4241554559:-438365379,4241589202:-270565377,4241628660:-293149696,4241766079:1859876554,4241862806:1854105154,4241932995:1850832458,4242183912:-279047177,4242450272:-1886916623,4242674856:-270532641,4242820562:118812465,4242942783:-1593573087,4243088622:1859876554,4243394753:16777216,4243443260:-287309845,4243763698:-308409832,4244588788:1650065480,4244967883:-1609694711,4245186501:16777216,4245255580:-270532609,4245349284:1859876554,4245605605:-287319041,4246343474:512,4246392993:16777216,4246966763:-402388992,4247156700:-270532609,4247534156:1073741825,4247997963:16777233,4248044685:1745094920,4248351928:-270532609,4248621666:-291504129,4248810771:1784217672,4248924300:-287314135,4248964732:16777216,4249401454:-270532609,4249613029:-1885863945,4249754176:-287319057,4249957763:-278979713,4249995489:-287319057,4250344993:-383972591,4250991947:1859868362,4251199444:1859876554,4251411755:-287312150,4251568087:-283374791,4251642179:-270532609,4251703040:512,4251885705:1859876554,4252382194:-270532609,4252692419:-383972559,4252952915:-287310101,4253490882:1854105154,4253648276:-287309845,4253814871:1813512712,4254295017:643498504,4255218104:-287312150,4256635217:-278984323,4256667911:575013153,4256743105:-2096878589,4258158978:1859876554,4258448820:-274726913,4258736157:-401864695,4259262842:-2032177679,4259443766:-270532609,4259481041:131072,4260865077:-287309845,4261274653:-287319057,4262074177:-326216983,4262378546:-270565377,4263371542:-1361086774,4263415913:1725654730,4263572970:264481,4263653375:-270532609,4265278863:16,4265600307:-402388728,4266735040:1859876426,4266868554:-833205735,4267323425:-287335893,4267576791:1837238305,4267692508:-287368213,4267964703:-270532609,4268966679:-1609629439,4269228383:1855682250,4269960727:-278921217,4269989442:-402388984,4270181355:-287309841,4270461468:1,4270666295:1855682250,4270690503:1859876554,4271114078:1847293130,4271628185:-1588657879,4271750250:1,4271925961:-300017623,4271970781:-1920562987,4272008383:-1992128379,4272609963:-270532609,4272855629:-270532609,4272901982:1847136776,4273384697:1859876554,4273979358:1,4274408220:-1592851959,4274701287:-270532609,4275112174:1208484360,4275168009:1090781457,4275248922:1,4275721917:1851396674,4275769172:1859876426,4276105201:1829877667,4276532410:-270532609,4276662938:134299649,4276761142:1847136776,4276838423:-287309845,4276887060:1322399434,4277065656:1746468936,4277647998:1859876554,4277683870:-316929767,4277690143:1859876554,4277875829:-314389515,4278229981:1855320736,4278637817:-270532609,4278864381:-402388992,4278901317:756225537,4280177454:106261889,4280694030:-270532609,4280857749:-287319057,4281549159:-287319061,4281702983:1124093201,4281893918:-287319061,4282226933:-1609629439,4282228437:-288437267,4282328348:643498504,4282390899:-287309845,4282947907:1745354760,4283058734:1292765201,4283066724:1,4283294503:-384562679,4283365613:1859876554,4284032105:1855682250,4284065916:-270541825,4284485865:-287335765,4284536757:1859876554,4284644890:102064641,4284805266:-287319041,4285108920:16,4285268418:-270532609,4285298084:-1486945479,4285378917:16777216,4285547299:16779777,4285767181:155533441,4285887947:1859876554,4285899572:-1487009735,4285958053:-270532609,4286064959:1859876554,4286214488:-270532609,4286257689:-536608487,4286490591:1859876554,4286631068:-270590977,4286848481:-287318293,4286867240:-384038392,4287206074:1855682250,4287250786:-270532609,4287267412:1859876554,4287381332:-270532609,4288211433:-270590977,4288220412:-1576271511,4288471586:118878133,4288616409:-287309845,4288785436:1702887893,4288915785:-270532609,4289020253:-287319057,4289513683:-383972591,4290102711:1850947274,4290229240:1817294474,4290383085:1851487946,4290640889:-287368193,4290692722:1859876554,4290908805:-1911354999,4291382723:-287335445,4291589230:-1503788503,4291643468:1855682250,4291749132:-287312182,4292381242:-278921233,4292444693:1854105154,4292479460:17,4292502530:-287319061,4292597532:650339291,4293188354:-270532897,4293554978:17041937,4293570690:1859876554,4293581527:-836955607,4293637870:-354613143,4293752234:1859876554,4294099841:-270532609},php:{312822:1291845649,985371:1,1386918:-268435585,1717757:-268436097,3115252:262145,3270687:20971537,3273933:-276955265,3327817:-401864680,3425564:257,4168709:16777217,4589376:16777217,4692653:-268435585,5102504:17172853,5977311:23331616,6335403:1,7347374:264192,7486206:-276841601,7863414:-411303927,7970576:-2019615883,8260801:16777233,8449778:-283305159,8561223:553912849,8844597:257,9625868:23331360,9676618:1627717941,11170081:-1593573111,11212041:16779776,11237138:-293601429,11332837:-268451969,12293765:-402388992,12687559:-276824193,12912345:-325186792,13475198:-385610959,13614844:-304149735,13892934:-313588935,14019814:-276955777,14025116:-276955777,14035720:-276959873,14074032:-1354930305,14079334:16777233,14111180:16777233,14114361:16777216,14130268:-1609695231,14198134:-401339543,14286053:1,14288697:-1006633089,14308622:1293814288,14737079:-293732481,14737474:16908593,14739595:-268451969,14769321:16910449,14770381:221604881,14834075:-268435585,15392555:555680553,15698209:-1354891905,15786292:587595825,15973062:16777232,16214049:16777233,17154160:-384038359,17421368:-1555103207,17709064:-268698497,18003220:1090519057,18934377:-411107319,18978694:16777217,19072095:625934345,19170785:588186137,19792044:-276955265,20275682:16777216,20366406:-486276807,20848053:1292107825,21190249:1107296273,21279477:-276824193,21638658:1157890065,21873846:-1588657919,22053366:16777233,22320417:-268435585,22756924:1,23321953:262433,24071969:554631721,24403397:16777217,25252768:-276955265,25302584:-2147219455,26535154:16777473,26686513:33554448,26843078:-304149703,27184074:-283305159,27470823:-276988033,27488379:-285212821,28047376:17039921,28061236:1,28103202:-293601409,28607133:-350287351,28797662:-276955265,29217755:-308671976,29466241:-268436097,30313384:16777216,31128651:1292765200,32071611:1090846773,32274201:-276955265,32627218:17,32894979:-285475477,32930725:1,33224413:136315137,33857486:801,34189313:588186137,34520741:16777216,35246289:-268435585,35296213:16777473,37207251:-268566657,37394054:-1401585793,37408233:17041937,38514137:-276955265,38528582:-276955265,40433881:-1419837395,40522695:-276955265,41300032:23331329,41316426:1,41378701:-1995833051,42046914:-384038019,43116296:-1591999703,43698772:1074006049,43742544:-400815235,44291106:393265,45199803:-385021860,45336327:-276955265,47490452:-268435585,48295924:1,49167744:1,50357567:-383842007,50454534:-514915559,50910563:-285212801,51068792:-920843395,52143641:-268698497,53523042:1628307993,53799883:1,53800054:16777217,53800088:1,53800225:16777216,53800636:262145,53800670:1,53800738:1,53800773:184553473,53802825:264192,53802893:2048,55081244:-293732497,55545501:4194304,55663643:-1592851927,56132221:-1610153719,56685069:-293601409,57618946:-281149569,57847533:-268435585,58599982:17039617,58769064:1830685200,58781070:-1605631703,59308438:16777216,65362088:1627389969,65439752:-285344471,65480933:16777253,65737461:-1536294391,66229371:1,66277345:-276824193,66659640:-939259904,67252806:-268698497,68302471:-268435585,72789937:-268435585,72933692:-402388984,75303661:264209,75956234:23069185,76404366:-820176071,77345272:-384562647,80165650:-276955777,83350007:16777233,83933330:21495825,84836293:-1593442295,85797653:16910453,86655031:16777237,87750413:-1559297479,88505333:16777216,88672254:1627717941,89228638:-1401585793,91851302:-268698497,92865399:-269615847,93685014:-268435585,93815735:131073,94889315:-427883735,95365496:1,95892971:1627389969,96275653:16,96357129:273,99107521:554565929,101079861:-268435585,101108450:-276955265,101728843:-268698497,101907699:393265,104133712:-1518403063,107287639:134219777,108739157:-268436097,109639184:1292765200,110412696:-403835847,111537333:-308409576,113732009:-403834823,115181133:-377883561,116388487:-385086703,116502717:16777216,118272910:16777984,119214439:-384038887,121003378:-276955265,121477421:136315137,126272535:16777216,133534634:1090846773,134013330:33,134234336:588186417,4151547166:-276955777,4166211628:1,4166977876:-1350697601,4172316537:-276955265,4172496089:-268435585,4177046655:-1458961619,4178820659:2048,4181144136:-470944743,4181607789:-276959361,4182310634:16777233,4184432574:17039665,4184616345:23069185,4184688954:16777233,4186576341:-276955265,4188127282:264208,4188769571:-268566657,4188835189:-308671976,4190165397:-939259904,4191052762:-276957313,4193252035:-1487011271,4193862568:-400815575,4195042980:-268435585,4195777633:-268435585,4199611560:-402388727,4199688799:-1420492759,4201403077:17039377,4202703618:-268435585,4205042422:-470944455,4205064510:16777233,4205203864:-402653321,4205278244:16777217,4209045637:-308540904,4209677500:-268435585,4209741679:-1555103479,4210917794:1628307993,4211098685:-268435585,4211546653:-1538392023,4212530734:-320926967,4214853554:1,4216150090:-293732497,4216407598:-268435585,4216829310:-2010739849,4217435297:-268435585,4219121950:1208223744,4219165614:-2017518731,4220762676:-268435585,4221548704:-268435585,4222596666:-384038631,4223268450:-308671976,4223423706:-268698497,4224829543:-268566657,4225016884:-268566657,4226334149:-1588723143,4227819956:-1484848631,4230395914:17040181,4230406998:-401864695,4230991595:554303529,4231784883:135006232,4233125417:16777728,4233268708:16777216,4233351257:-385021860,4235653793:1090650481,4235767868:-268435585,4236107369:-297801875,4236526237:-402388991,4237140686:-535557271,4237244340:-1486945735,4237715685:-308671720,4237999393:-268436097,4238451604:1,4239575572:23330817,4242748295:-272634051,4242942783:553910561,4243394753:16777216,4243763698:-308671976,4244050944:-268435585,4244452210:23331328,4244967883:-1609629175,4245048405:16910449,4245186501:16777216,4245882019:-304149703,4246016320:17301505,4246249412:-268435585,4246343474:16777729,4246392993:16777216,4246966763:-402388992,4246989227:-1006897289,4247534156:1073741841,4247997963:16777233,4248044685:-402388728,4248586796:16777233,4248964732:16777216,4249629024:553648149,4250506120:-268435585,4251191129:-276988033,4251443548:-268435585,4251568087:-384038119,4251703040:16777729,4253468733:-268436097,4254537090:-268435585,4255524593:-268435585,4255526190:16777232,4255591989:-384038019,4255830081:-411238127,4256378521:16777232,4256663424:-268436097,4256938009:-277413603,4256953055:-1488125159,4257320171:-268435585,4257701476:16,4258140804:-268698497,4258373578:-1392672897,4258736157:-401864695,4259143502:-1354926209,4259361935:-1568734419,4259481041:16910385,4260633700:-352453335,4261839613:1,4262479349:-470944711,4263572970:553912617,4264988277:23089920,4265278863:16,4265600307:-400815864,4265646776:-276955265,4265825262:-417395911,4266281335:17039921,4268815557:-268698497,4268966679:-1609629439,4269002776:-268435585,4269115543:1090584593,4269248724:-268698529,4269321162:1097160241,4269989442:-402388728,4270425210:-276988033,4270461468:16777233,4270940291:603979800,4271628185:-1592983263,4271750250:1,4271825210:16777233,4271925961:-283240135,4272636811:-1604386015,4272901982:-283305159,4273246520:23330817,4273828954:-276955265,4273979358:1,4274408220:-1588657655,4275112174:-921957831,4275168009:1090781201,4275248922:1,4276619857:1,4276705348:-1367507093,4276761142:-283305159,4277037515:-384562647,4277683870:-316930023,4278576441:-268435585,4278864381:-402388992,4281882489:-276955265,4282226933:537853953,4283058734:1292765201,4283066724:1,4283294503:-384562647,4285108920:16,4285298084:659489593,4285378917:16777216,4285414532:-268435585,4285476536:2337,4285510366:-268435585,4285547299:16779777,4285899572:-1576140767,4286093114:16,4286257689:-519831271,4286494909:16777232,4286867240:-385086968,4287054496:-268435585,4289514558:-281150081,4289790545:-268435585,4291143019:-268435585,4291836172:-268435585,4292473419:16778001,4293554978:17041937,4293581527:-820176071,4294582693:-1401061505,4294710404:-268698497},pl:{117875:-276955777,157878:262161,312822:1291849777,662990:221644928,985371:1,1361094:624274993,1753184:-276824577,1785810:-276824065,1806085:-276828161,2417197:49,3115252:262145,3178380:17039617,3273933:-276955265,3327817:-401864680,3989296:-276824065,4168709:16777217,4441934:-276824065,4589376:16777217,4688097:-276824065,4725653:-278397577,5550922:1225134421,6030390:-281546753,6563494:156352877,6928640:-276824065,7347374:264192,7486206:-276841601,7649472:-276824065,7826548:16777216,7863414:-411238391,8260801:16777233,8561223:553912849,8844597:4456705,9614121:-847778953,9625868:23331360,9676618:1627717941,10512901:-276824065,11147735:-276828195,11170081:-1593573111,11212041:16779776,11263414:-276955777,11422233:762533579,11810011:-2061046785,12293765:-402388992,12310707:223429835,12983372:-1956250571,13475198:-385611471,13862770:-1956512459,14009209:-276955137,14011330:-1350701697,14012391:-276959873,14012459:1091700793,14019814:-276955777,14025116:-276955777,14035720:-276959873,14074032:-1354930305,14079334:16777233,14081879:-277485697,14103723:1733785567,14111180:16777233,14114361:16777216,14130268:-1609695231,14144087:152551441,14196082:1829767473,14201418:-1350963843,14275715:1327612117,14286053:1,14321347:-276824067,14362664:16777217,14670600:157516645,14769321:16910449,14770381:221604881,14838248:-277348865,14838350:-276824065,15097537:-276824065,15368289:1829975811,15420437:-276824065,15698209:-1354891905,15767205:16777217,15770386:17041920,15786292:587595825,16214049:16777233,16361584:-276824321,16417854:16777232,16486849:-276824065,16507576:-281149569,16549219:-1956250571,16717301:-281673857,16789478:-1591474160,16805384:-1593046759,16842464:17956913,16933237:-276824577,17154160:-384038359,17185479:1867904735,17310653:-276824065,17421368:-1555103207,17979891:-2122704047,18003220:16777232,18109147:1868003295,18934377:-411107319,18978694:16777217,19072095:-1486946039,19094259:-2130704384,19114184:1868003295,20275682:16777216,20288139:33554449,20366406:-486276807,20848053:1292107793,21190249:1107296273,21279477:-276824193,21401838:-276832359,21638658:1157890065,21873846:-1588657911,21904323:-276832357,22053366:16777233,22161083:-276955265,22524514:-276824067,22756924:1,23664620:1868003295,24217541:1260905949,24403397:16777217,24649328:-276824065,24867661:-276824705,25302584:-2147219455,26535154:16777473,26686513:33554448,26968966:-276824065,27072662:-276824065,27470823:-1384284289,27675230:16777216,28047376:17039921,28061236:1,28607133:-383841783,28660170:-276829185,28797662:-276959361,29059952:-276824065,30157835:-385087191,30162326:-276824065,30178870:17,30313384:16777216,30483097:-276824193,31128651:1292503056,31259515:-276824065,31470430:1,31932768:-481361091,32715833:-315097089,32905286:16777233,32930725:1,33554493:-276955137,33673819:-276824065,33857486:801,34404475:-1956250315,34520741:16777217,34521928:1663493365,35296213:16777473,35339768:-1956250315,35429574:16777217,35476057:-276824065,36340965:1263142937,36436587:-276828161,36789482:-276824081,37526111:-276824065,37825794:-276824065,37956245:-1352789699,38514137:-277479553,39433808:-276824065,39461344:134299649,39531165:-276824065,40433881:-1419837139,40522695:-276955265,40806928:-276824065,41097372:-276824065,41227310:-276824581,41300032:23331329,41316426:1,41688413:-277483649,42209253:1870100479,42670652:-310767657,43116296:-1591999703,43698772:1074006305,44291106:393265,45330089:-276824065,45637566:153485669,45674539:-1956250571,47821645:157518693,47842642:16777233,47845727:-1593441775,48291640:-277086593,48295924:1,49167744:1,50013568:-1956250315,50126439:2357,50150832:-278399625,50357567:-350287575,51008750:-985147009,51244294:16777232,53203191:-276824065,53665913:-276824065,53728605:-2011952847,53799883:65,53800054:16777217,53800088:1,53800157:1,53800225:16777216,53800636:262145,53800670:1,53800738:1,53800773:184553473,53800807:219219457,53802825:264192,53802893:2048,54492852:-277479553,54875784:704989249,55545501:4194304,55663643:-1592851927,55723448:-276824065,56132221:-1486945527,56181432:-276824065,56330407:-276828161,57434613:-276824067,57618946:-281149569,58781070:-1605631703,59162956:1327753183,59308438:16777216,59373516:-346095299,59443077:-276824065,59832528:-276824065,59915336:1130424128,60556016:-276824065,60905634:-276824065,61053393:-276824065,61395307:-277348993,61984192:-276955265,62262811:-276828161,62590466:-276824065,62825152:-276955777,62976958:-1487994051,63129323:-276824065,63242338:-276824065,63486092:1328015327,63614847:-276824065,65254328:2176,65362088:1627390001,65480933:16777253,66229371:1,66659640:-939259904,67291199:-485555395,67860197:50594097,68193059:691301693,68359925:-276824065,69069928:-1956512459,69665350:-276955265,70333095:-315097089,70437323:-276824065,70917040:1868035967,70975063:-276824065,71715122:16,72683476:-276824705,72736125:-276824065,72933692:-402388984,75303661:262161,75307157:-1005108361,75443302:-1554052807,75956234:23069185,76839199:16779280,77320601:-276824065,77345272:-384562647,77411018:-383455233,77432531:1332213111,78480057:-1585577931,79022088:1828757267,79473485:-1956250571,80118199:16777232,80141645:-276824065,80165650:-276955777,80188002:-280523971,80245607:-276824065,81378509:-276824065,82202311:-311959753,83208605:16777217,83350007:16777233,84711301:264193,84836293:-1593442295,85797653:16910453,85861226:-277086593,88285947:-276824065,88505333:16777216,88672254:1627717941,89062312:-276824065,89228638:-1401585793,90966281:-411044599,91651316:-277352737,92926082:-276824065,93214626:16777216,93815735:131073,94543295:16777233,94940433:-276824065,95500156:-276824065,95892971:1627389969,95942161:1718732285,96275653:16,96357129:273,96850547:1830029621,97059008:-1608250972,97098559:-281018497,97553357:-276824065,98489861:-276824065,99727963:-311053027,100517128:-1956250315,101108450:-276955265,101907699:393265,104133712:-1518403063,104348813:1261955039,105711330:1735882719,106693482:-512881673,107114981:622936089,107287639:134219777,107827924:-276955265,108380558:-1591473663,108574281:-276824065,109639184:1292503056,110107681:-276824065,110338467:-276824065,114784829:1736440927,115626622:153592181,115826374:-277348865,116388487:-385610991,116502717:16777216,118272910:16777984,118722286:-276826179,119214439:-384038887,121477421:153092369,123803139:704989249,124318065:1627718453,126272535:16777216,127522327:2049,128776313:-985228929,131960065:-1956250571,134013330:33,134234336:588186417,4151547166:-276955777,4159656364:-1922429424,4162819364:-276955265,4164904318:-814486539,4166211628:1,4166977876:-1350697601,4167621538:-276828161,4169888135:-276824065,4170933035:-276824065,4172945709:-276824065,4173638408:-277348641,4174741913:17,4175836782:-277092481,4177612479:-276824065,4178820659:264193,4180330084:16777237,4181607789:-276959361,4182310634:16777233,4183342959:595524703,4184432574:17039665,4184616345:23069185,4184688954:16777233,4185753225:1864538489,4186181662:-1056959625,4188127282:264208,4188488973:16777233,4189662286:16777237,4190165397:-939259904,4191052762:-276961921,4191751386:-1350963841,4192271499:-276824065,4192447395:16,4192764386:-276824065,4193862568:-384038343,4194912972:-276824065,4196728482:1733785567,4197363645:-277937383,4197940497:1829767473,4199397727:-276829315,4199611560:-401864439,4199688799:-1420492503,4201935691:-814219777,4202331789:-379060249,4202830069:-1956250315,4203207631:-276824065,4203380996:16777781,4203489517:-276824065,4203884039:18874368,4205051340:-310764065,4205064510:150994961,4205214670:69206033,4205278244:16777217,4205724054:-814227969,4206350172:-1350963841,4206538862:-986756105,4207314383:-277348353,4208938436:-276824065,4209741679:-1555103479,4210092321:-815270537,4211001097:-276824065,4211546653:-1521614807,4211791887:-276824065,4212672565:-276828161,4213302044:-277086465,4214853554:1,4215387386:1870528511,4215722242:158567269,4216829310:-1993962633,4217840918:-276824065,4217878191:1627392273,4218361996:-1956250315,4218542309:1869602041,4219121950:1208223744,4220620601:-814219777,4221378653:1799702595,4221520435:-381769347,4222517121:16777216,4223586635:-1555101415,4223803178:-276824065,4223926638:1260766717,4224206155:-276826113,4224879570:-276824065,4225341739:1,4226334149:-1588723143,4226562433:-276824067,4226819503:-276824065,4227615382:-1921553391,4227819956:-1519517175,4228002083:1073741905,4228169038:1090521117,4229448967:16777216,4230223119:16777216,4230395914:17040181,4230406998:-401864695,4230638407:-276824081,4230856135:-276824065,4231760061:-276824065,4231784883:135006232,4233013500:18874433,4233125417:16777728,4233268708:16777216,4233449796:-414313631,4236096362:-383258755,4236107369:-281024643,4236526237:-400815863,4237031727:16777216,4237197538:16777217,4237378658:69994789,4237547851:-276824065,4237630041:1,4238451604:1,4238731679:-276824065,4239413692:-276828161,4239575572:23330817,4240514944:-276824065,424064e4:-276824065,4241050706:1327883231,4241067620:-276824065,4241126572:-276824065,4241144047:17039925,4241443653:-1350963841,4241611677:-276824065,4241794739:-276824065,4241932995:1867872127,4242159741:-385611512,4242942783:-1593573087,4243394753:16777216,4243840736:-276824099,4243901994:-276824065,4243943985:1208223760,4244057828:-276824065,4244075215:1333261687,4244452210:23331328,424464e4:1225851157,4244967883:-1609629175,4245048405:16910449,4245186501:16777216,4245818029:-1956250315,4246256401:-276824131,4246343474:16777729,4246392993:16777216,4246945781:-276824065,4246966763:-402388992,4247534156:17,4248044685:-402388728,4248964732:16777216,4249392930:-276824065,4249689262:1870133215,4250275450:-276824065,4250344993:-518190319,4251191129:-276988033,4251568087:-384038119,4251703040:16777729,4252009901:-276824065,4252692419:-383972559,4253283937:-276824065,4253969415:-1490109533,4255517503:-276824065,4255864964:81,4255868585:16777217,4256486823:50596656,4256667911:50725169,4256938009:-277411523,4256953055:-1488125159,4257117727:-276824065,4257251933:225799185,4258736157:-401864695,4259029832:1090847541,4259143502:-1354926209,4259293803:-276824065,4259361935:-1568734419,4259481041:16910385,4259950785:155271169,4260299422:1075839057,4261036645:-276824065,4261663070:1128400913,4261839613:1,4262090417:-1956250571,4262137651:-276824065,4262560152:-276828161,4263011545:-276824065,4263027806:-1996441547,4263572970:17041697,4263627361:86351889,4264372118:33,4264988277:23085824,4265278863:16,4265600307:-400815864,4265646776:-276955265,4265970921:19139573,4266281335:17039889,4266406211:690480501,4266423662:-276824065,4266577580:-276824065,4267471162:1090519129,4268966679:-1609629439,4269115543:1627717649,4269142350:-276824065,4269321162:1097142833,4269705293:-276824065,4269960727:-413663233,4269989442:-402388728,4270425210:-276988033,4270436044:-276824097,4270894589:-276824065,4271628185:-1588657879,4271750250:1,4271921185:186941917,4272170301:-276824065,4272636811:-1604386007,4272672517:-1005108361,4273056483:153398289,4273150308:-276824065,4273246520:23330817,4273828954:-276955265,4273979358:1,4274395191:-276824065,4274408220:-1588657655,4274897548:1829767473,4275112174:-921957831,4275168009:1090781201,4275248922:1,4276105201:1829844739,4276377486:16777216,4276619857:1,4276662938:134299649,4277037515:-384562647,4277370852:-276824065,4277683870:-384038887,4277884419:-276824065,4277971839:1870100447,4278152927:-278923265,4278864381:-402388992,4278901317:756225537,4279911456:-276824065,4280014106:-276824065,4280021608:-276826115,4281021189:16777216,4281076887:16777233,4281361843:-276824065,4281702983:16779537,4282226933:-1605435127,4282825832:-481359079,4282882433:16777232,4282947907:-401864439,4283066724:1,4283076541:16777232,4283294503:-384562647,4283737743:16777216,4284318445:-1956250571,4285108920:16,4285193676:-277348993,4285274548:-1350565889,4285298084:659489593,4285333580:-276824065,4285378917:16777216,4285476536:16910709,4285547299:16779777,4285767181:16859137,4285790669:1316216541,4285892430:1735882719,4285899572:-1555169223,4286093114:16,4286218605:-276824065,4286257689:-519765703,4286287848:-276824067,4286813244:18874625,4286867240:-385086968,4287284983:-276824081,4287349322:16777216,4288050560:1870133243,4288557327:1095008273,4289303187:-276824081,4289426892:-276824065,4289474248:-414252239,4289496156:157516645,4289513683:-383972591,4289514558:-281150081,4289614116:-276824065,4290087295:-276824065,4290797519:-276824065,4290939126:-276824065,4291008488:-276824065,4291199976:16777232,4291978429:-276824065,4292473419:17040145,4292479460:131089,4292483032:-276824065,4293002408:-276828161,4293208639:-276824065,4293554978:17041937,4294224461:-276824065,4294421706:-276824065,4294598035:-1956250571,4294724981:1802886231},ps1:{248610:-384038120,276647:-268567041,312822:1291845649,516838:-268566529,886169:1811808245,985371:1,1006937:16777857,1726925:-268566529,2003081:1095045245,2417197:49,2572512:-349901416,3273933:-276955265,3327817:-401799144,4006473:-268566529,451e4:-268567041,4589376:16777217,5393397:16777233,5403692:-268566529,5698773:-268566529,6312397:-268566529,6335403:150994945,6970374:1,7161053:150994945,7347374:264192,7540371:-268566529,7865605:-268566529,8007935:1226868945,8053246:-268566529,8260801:16777233,8652460:33892353,8935089:1158678544,9430691:-268567041,9938931:257260053,10312673:-268566529,11212041:16779776,11259315:16777216,11292521:-335675393,11483874:-268566529,11837851:1092616208,12081940:1078005789,12293765:-402388992,12336465:-384038343,13075512:-268566529,13186594:16777233,13448482:-344122497,13638601:-268566529,13794160:-344122499,14009209:-276955137,14011330:-1350701697,14019814:-276955777,14074032:-1354930305,14079334:16777233,14111180:16777233,14116482:16777216,14132354:118843905,14166322:17042197,14196082:1829767473,14200885:-302154529,14286053:1,14362664:16777217,14737079:-276955265,14742811:-268567425,14842592:-941752321,15306955:-839041313,15698209:-1355416193,15761902:-268566529,15811210:193228757,15900443:221315473,15977618:23101457,16098327:-310514443,16165202:-310518403,16214049:16777233,16324435:-302129665,16372222:-310510081,16417854:16777232,16507576:-281149569,16602131:-268566529,16652720:-384038343,16717301:-281673857,16747571:-268664833,16779376:-1879179265,17154160:-384038391,18003220:16777232,18522374:16777217,20001750:117729813,20275682:16777216,20288139:33554449,20366406:1627652401,20848053:1292107793,21190249:1107296273,21557191:-268567297,21638658:1090781201,21672543:-268566529,22030943:-268566529,22053366:16777232,22408304:17039377,22756924:1,24512531:-268566529,25252768:-276955265,25302584:-2147219199,26686513:33554448,27064869:-268566529,27470823:-310542465,27675230:16777216,27813213:-268567041,28061236:1,28132432:-268566529,28423532:-268566529,28797662:-276959361,29286967:-268567425,30313384:16777216,30652261:-383968387,31002955:-281710723,31342055:-268599297,31470430:1,32071611:1090846773,32274201:-276955265,32627218:17,32930725:1,33006848:795377655,33195241:-839041281,33270951:-268566529,33554493:-276955137,33986435:-268566529,34067038:-268567041,34520741:16777216,34656882:-268566529,34834430:1272722833,37158689:-268599297,37207251:-268566657,38341184:-437495363,38368734:53741845,38525662:-268566529,38528582:-276955265,39297288:150994997,39461344:81921,39640391:-814363169,40522695:-276955265,41316426:1,41399205:-276955649,41530750:16777216,42004276:-268566529,42201756:-268566529,42964742:-268566529,43698772:1074006049,44534847:-268566529,44904381:-268566529,45199803:-383973284,45336327:-276955265,45763665:-268567425,45918314:-268566529,46626476:17039729,47735900:-268566529,48011590:-269095681,48279847:-268566529,48295924:1,49167744:1,50041632:-276955265,50262134:16777216,50354243:-268566529,51068792:-383972483,53481494:-2028639611,53799883:1,53800054:16777217,53800088:1,53800157:1,53800225:16777216,53802825:264192,53802859:16779265,53802893:2048,53805024:690244084,54079853:-268566545,54492852:-277479553,54527712:-268566529,54640718:738065397,54875784:704989249,55354032:-268567041,55554577:-303747400,56792753:-2114172433,56920565:16777489,57076220:-1006764043,57512342:1,57729237:-1497542659,58187988:-268566529,59151406:1,59308438:16777216,60499451:1090521088,62298329:1829767473,62931278:-268566529,64178064:1739700063,64282353:-268566529,64646060:159383892,65254328:2099328,65362088:1627389969,66229371:1,66659640:-939259904,67851858:-268566529,67860197:50594097,68061633:25430161,69037483:-268566529,69145107:-1345519681,70600208:17,71564919:-268566529,71973889:16777233,72695632:-268566529,72933692:-402388984,73971751:1270153205,74162348:-1342619649,74349947:-268566529,74781192:17039697,75204277:19169617,75303661:264209,75547954:-277223947,76404366:-820176071,76460597:-268566529,77345272:-384562647,77509488:-402784769,78431749:-276955649,78502530:16777345,80165650:-276955777,83208605:16777217,83231507:117733909,83350007:16777233,83933330:21495825,84031333:-268567425,84210260:738065397,84711301:2048,85906489:16777216,86728481:-268567041,86752183:118812465,87875195:17,88171633:1,88345942:-268567041,88672254:1090847029,88798717:118844117,89181997:-920319171,89228638:-1401585793,89296642:667250053,91457803:-268566529,92865399:-269615847,93079207:153092369,93558684:-268567041,93643633:20,95892971:1627389969,96275653:16,96850547:1830029621,96903054:-268566529,97064272:-1344509287,97126933:-268566529,101108450:-276955265,104083304:-268599305,105727586:-268566529,107287639:134219777,108380558:-1591473663,108629785:-268566529,108722144:-880993411,108912373:-268566529,109483731:151013457,110412696:-403835847,112642797:118844037,113732009:-403834823,116388487:-385610991,116502717:16777216,117404983:17844225,119214439:-384038887,119555263:1670126364,121003378:-276955265,121477421:153092369,122656166:17825793,123803139:704989249,125727594:-384038343,126272535:16777216,126396690:-268566529,127285317:1,127522327:2048,133534634:1090846773,133937728:17039377,137814640:-805437505,4150227703:-277014145,4151547166:-276955777,4158356767:-268567041,4162819364:-276955265,4166211628:1,4166977876:-1350697601,4167106417:-268567425,4168454109:-271749699,4172316537:-276955265,4173288197:-268566529,4174418603:-268566529,4177043132:224515831,4178625593:-268566529,4178820659:264193,4180379855:32768,4181144136:-470944743,4181607789:-276959361,4183243148:-385087455,4183906609:1795427189,4184661597:564399800,4184688954:16777233,4185346021:-385077764,4186181662:-1051192457,4186576341:-276955265,4188127282:134481944,4188769571:-268566657,4188981984:5,4190165397:-939259904,4190889267:-384038343,4191052762:-276961921,4192447395:16,4192721944:-268566529,4193862568:-384038343,4194369711:-2084700171,4197940497:1829767473,4199611560:-402388727,4199842665:-268566529,4203186847:-268567041,4203380996:16777269,4203554220:-381875395,4203884039:18874368,4205064510:16777233,4205214670:69206033,4205932925:-2130444288,4206679661:-268566529,4207001082:-268566529,4210002332:-268566545,4210194125:-805437441,4211370423:-268664833,4211825585:-268566529,4212563735:159402037,4214853554:1,4215384633:16779441,4215631401:-268566529,4216554910:16777217,4216622380:-268566529,4216974258:16777525,4218062537:-268566529,4219121950:1208223744,4221378653:1799702595,4222600372:-268566529,4222750417:-268632129,4223095586:-268566529,4223314660:16,4223926638:1260766717,4224829543:-268566657,4225016884:-268566657,4225341739:1,4225803489:59046901,4226895904:-1994391279,4227228989:8388608,4227340012:1836392377,4227798047:152045569,4230406998:-401864695,4231232415:-383496815,4231737261:50595857,4231784883:135071768,4232689753:16777216,4233013500:18874433,4233094498:-276955649,4233125417:16777728,4233321999:-1994651268,4233351257:-383973284,4234497390:-268599297,4235228516:-268566529,4236526237:-402388991,4236567016:-268567425,4237031727:16777216,4237047891:16777233,4237630041:1,4237702804:25165824,4238451604:1,4239459263:-268566529,4239616046:-872546313,4239812740:153092097,4241144047:16777269,4242127572:-844569163,4242159741:-385611512,4242820562:118812465,4242942783:17039617,4243181161:-268566529,4243347429:49,4243394753:16777216,4243943985:1208224056,4245379353:-268566529,4246016320:17301505,4246153092:-2123085427,4246343474:16777729,4246541967:-268566529,4246966763:-402388992,4247052704:-268566529,4247534156:1073741841,4247997963:16777233,4248044685:-402388728,4248482612:-268567041,4248586796:16777233,4248964732:16777216,4249074316:1293517301,4249602117:-839041313,4249629024:553648149,4250066051:150994944,4251191129:-1350729857,4251568087:-384038119,4251647817:65809,4251703040:16777729,4252440857:-268566529,4252493870:-268566529,4252666874:153092369,4252767988:-404881409,4255030370:-268566529,4255423080:-317978307,4256083273:-268566529,4257498070:1702887857,4257547619:-268566529,4257701476:16,4258736157:-401864695,4258959646:20973585,4259143502:-1354930305,4259359095:-268567041,4259950785:151076865,4260043002:-268566529,4260633700:-268567171,4260679671:16777232,4261443077:-268566529,4261475754:-268566529,4261839613:1,4262337998:1811808245,4262479349:-470944711,4262867275:-2145367904,4263572970:17041697,4263588350:-268566529,4263627361:86343697,4263900264:-268566529,4264372118:33,4264447607:16810001,4265278863:16,4265600307:-400815352,4265646776:-1350697601,4266197911:-268566529,4266516428:-268566529,4266931484:25186321,4267682058:-1350697067,4267987460:-346224259,4269046557:-268566529,4269115543:16842769,4269169416:-268566529,4269675349:-400275032,4269989442:-402388216,4270352588:-1476526083,4270425210:-276988033,4270464092:801,4270946968:-268566529,4271106252:-268566529,4271368637:150994960,4271744873:-335675905,4271750250:1,4271825210:16777233,4271850765:-268566529,4271900173:-268566529,4271921185:186941917,4272171471:-277053449,4272318696:-268829473,4272901982:-283305159,4273707595:16777329,4273828954:-276959361,4274016182:-268566529,4274199294:16777221,4274897548:1829767473,4275112174:-921957831,4275168009:1090781201,4275248922:1,4276268761:-269090817,4276396103:-268566529,4276619857:1,4276662938:81921,4276714240:-268566529,4277037515:-384562647,4277683870:-384038887,4278181247:-384562311,4278474055:1092887441,4278864381:-402388992,4279056465:1795427189,4280177454:106260865,4280286353:-1956254475,4281340517:-914547843,4281418332:-268566529,4281606763:1226883377,4281611606:-268566529,4281882489:-276955265,4282501227:-268566561,4283009833:-268566529,4283066724:1,4283294503:-384562647,4284644890:118843905,4285108920:16,4285295077:-1455423403,4285323912:-268566529,4285378917:16777216,4285717623:16529,4286093114:16,4286867240:-385086968,4288471586:118878005,4288559875:-268566529,4289035090:-268566529,4289514558:-281150081,4291089718:10522673,4291418836:-268566529,4291759108:1299735825,4292288978:-268566529,4292328426:-268566529,4292473419:16777489,4293581527:-820176071,4293590077:-268566529,4294070911:-268566529,4294681065:1094975517,4294724981:1802886231},py:{107020:-809512969,157878:262161,246744:-268435465,286794:1160179699,312822:1291845649,662990:19269760,764232:-268435465,925973:113,985371:1,1006937:16777857,1017155:16777232,1067212:1803541201,1180217:-1993360395,1361094:624274993,1419889:1870651089,1550201:1224999217,1705302:1295334197,1830720:-268435465,2008635:-268435465,2232869:-268435465,2336795:-1996357116,2338848:-306205737,2417197:49,2593413:-268435465,3088545:-268435465,3178380:84148481,3247138:-272118793,3346625:1092622385,3425564:257,4168709:16777217,4185413:1637920181,4428141:-272695305,4551816:1768409301,4589376:16777217,4616513:16777525,4725653:1869067639,4814534:1197966352,5281261:-268435465,5393397:16777232,5550922:1225130325,5670066:16,5923409:1101312177,5977311:23331616,6134381:-268435465,6335403:150994945,6643126:-302514185,6915263:16777216,6970374:1,6991740:1132728625,7120886:1308568567,7161053:150994945,7228627:1878914295,7275523:60820401,7403755:17171313,7584843:212092432,7639166:1333233239,7826548:16777216,7887943:1744764919,8029537:-268435465,8081866:16777781,8122878:-268435465,8260801:16777233,8392257:-268435531,8652460:33892352,8736377:-369098889,8805494:-268435465,8935089:1158678544,8938196:17117957,9046625:17042197,9318819:27315345,9379238:1870659285,9614121:-848041097,9625868:23331360,9676618:1627717941,9880038:-268435465,10028823:17039665,10044176:1879048183,10092522:-948561135,10269965:-805839881,11212041:16779776,11259315:16777216,11335164:1863195445,11372726:-1377530891,11837851:1092887057,12367541:1772484085,12681756:-273015819,13116235:-2041426799,13186594:16777233,13211372:1101271089,13677742:-268435465,13877616:1763049521,14078273:17039377,14079334:17039377,14103016:-268435465,14110120:1083050805,14111180:17039377,14114361:16777216,14116482:16777216,14129207:-1045967993,14132354:118843905,14144087:1226293265,14166322:17058581,14196082:1829767473,14260835:137593685,14286053:1,14308622:1292503056,14362664:16777217,14510814:16777216,14670600:157516645,14737474:16908593,14752678:16782129,14760864:-471072809,14769321:16910449,14801401:-268435465,15039473:-268435465,15461790:-272629801,15702451:17173493,15707753:52741492,15756532:50719825,15758653:251927344,15767205:17039361,15770386:17041920,15785232:-978388091,15811210:193228757,15822346:17041525,15860822:-268435529,15973062:16777232,15977618:23367697,16159900:56789008,16214049:16777233,16417854:16777232,16705534:1237315573,17498912:1105720823,17931166:50596657,18003220:1090519057,18316332:-268451849,18470013:1090519061,18522374:16777217,18745189:-911736015,18978694:16777217,19225035:-268435465,19620848:27280433,19796569:-805855243,19820304:2097168,20275682:16777216,20288139:33554481,20454430:185336593,20515941:-268435465,20626004:1841299447,20660571:1266970613,20848053:1292108593,21190249:1107296273,21206108:-268435529,21638658:1157890321,22041962:1879048183,22053366:16777233,22229309:19563381,22326632:-1448169515,22408304:25427985,22636853:-805306665,22756924:1,23321953:17039665,23536743:-268435465,24403397:16777217,24430667:-1343758857,25355638:137857877,25672434:658761491,26535154:16777473,26621087:-268470281,26686513:33554448,26722667:-302514185,27037198:1308065589,27543190:-268435977,27595858:-278399183,27675230:16777216,27682013:1863711665,27850892:153434929,27920763:-268435465,27980181:-809500681,28047376:17040177,28061236:1,28383557:-268451849,29044242:19563381,29775042:52445713,29826945:1877607415,30352604:17109761,30892790:-302514185,30992044:-1350127823,31056216:17039617,31128651:1292503056,31344048:-272629769,31470430:1,31633117:16777216,31758498:1777212213,31847275:-268435465,31934920:-851277675,31975357:1299709457,32180407:-805306377,32627218:17,32768866:-2119826443,32905286:16777233,32930725:1,33224413:153092881,33485672:-809893897,33729680:-269876233,33857486:801,34039310:-268435465,34521928:1730602487,34834430:1272722833,34836020:-1543503913,35296213:16777473,36630301:1237024247,36728843:17040177,37130730:1873274323,38099413:1099486613,38368734:53741845,38424413:-272629769,38547371:-2029255723,38641285:-369098825,38972101:1341519029,38973550:1769340279,39060834:-268435465,39461344:138493953,39493204:-277350607,39598218:1341620085,39867454:-268435465,41032632:-268435465,41234815:-1343758857,41300032:23331329,41316426:1,41530750:16777216,41587505:-268435465,41764094:-302514185,42231999:25559824,43231389:-268435977,43274880:-272629897,43327456:196341749,43529140:1172308881,43748930:-1509950473,44209283:1879048183,44291106:393265,44389893:1878523895,44651348:16777216,45244787:-272629769,45602687:1710228145,45637566:153518437,46394932:1,46486441:-268435465,47475473:1734604501,47821645:157518693,47842642:16777745,48140253:-302514185,48295924:1,48645720:1694761233,49167744:33,49182897:-268435465,49379147:-303054987,50150832:1869084023,50226883:-301994121,50262134:16777216,50508812:-843071595,51070143:-873529385,52392938:19330037,52843528:163556341,52931331:151783985,53029950:690359093,53481494:118843909,53490169:-370148425,53799883:65,53800054:16777217,53800088:1,53800157:1,53800225:16777216,53800670:1,53800738:1,53802825:2048,54498157:-1891631115,54692889:-1925283851,54875784:709183555,54998186:-1343291401,55239849:1341586353,55456401:-268435465,55509314:1099301685,55545501:4194304,56470843:-268435465,56903787:-470286345,56920565:16777489,56981766:263716784,57471540:-268451851,57512342:1,57740275:8388624,57834049:-268435465,58254925:-814219275,58283539:150995601,58599982:17039617,58621821:23367697,59151406:1,59308438:16777216,60499451:1090521088,63072925:1629519921,63205075:16910449,63397411:-2013130752,64011134:-268435465,64095494:1633972785,64857497:-268435465,65362088:1627390257,65379941:16777557,65429313:86173175,65480933:16777253,66229371:1,67354700:-268435465,67860197:50594097,69309474:-302514185,69331935:-268435977,69760997:-272629769,70141805:268435445,70600208:17,71715122:16,71973889:16777233,72119272:-268435465,72919966:-979301385,73683283:-269091337,74715446:17039665,74900706:1097105425,75303661:264209,75346723:17039665,75494038:16,75558998:-268435465,75956234:23069185,76520914:-268435465,76899088:-268435465,77432531:1328018807,77488763:16,77517361:1099041141,77676429:16,77683272:16777216,77883220:-805356553,78502530:16777345,79353166:-301989897,80461424:-268436489,80601202:-1891411328,80608140:-268435465,80782835:-268435465,81126781:-268501257,81516205:1879048183,81776252:-268435465,82424134:1093067767,83208605:16777217,83350007:16777265,84385947:224849909,84606021:-302514185,85226658:564300053,85716842:-268439561,85719964:-268435465,85797653:16910453,85835074:16777216,85906489:16777216,86305278:-1879048203,86531117:1090521089,86752183:118812465,87875195:17,88505333:16777217,88672254:1627717941,89086949:1197842613,89309846:-268435465,90174459:-2128150251,90367035:-268435465,91211009:593608087,92472273:-268435465,93079207:153092369,93112206:-302514185,93643633:2097204,93815735:1,93839317:1796556887,94543295:16777233,95365496:16777217,95834277:-268435465,95892971:1627390225,95986005:-1925101536,96275653:16,96357129:273,96850547:1830029621,99101428:-268435465,99421155:-268435465,100297426:-268435465,100350182:564527793,100979080:-806617099,101864195:-911107593,102543843:-302006411,102686354:27525425,103362094:17039377,103956802:-1376849931,105340839:-268451849,107047352:16777217,108196261:-1422917641,109226089:-402653193,109639184:1292503056,110202803:221769713,112642797:118843909,112803698:1227631153,113891461:222269105,115626622:153608565,116502717:16777216,116585895:-404226089,117424178:-303054859,118060866:16777216,118189783:-268435465,118272910:16777984,120330040:-1345926667,121477421:153092369,122587611:1264899063,123514446:16777521,123639340:1763049777,123803139:709183555,124935422:-302514185,126272535:16777216,126287894:-2001237163,126741512:1872950869,130863824:-268435465,133534634:1090846773,133937728:25427985,134013330:33,138126782:-2147352064,4162202409:-2130443451,4164042543:-1984955403,4164518049:-306205737,4166211628:1,4166807589:17170933,4167589213:50334513,4168123178:1627390001,4169986432:124094993,4170545266:-805855243,4171920674:-319291401,4174632973:263666608,4176306610:1,4176972515:-268435465,4179337024:1633722913,4179752099:-268468233,4180330084:16777301,4180379855:32768,4182272228:19136785,4183706793:1164310033,4183840863:1795427141,4184432574:17039665,4184616345:23069185,4184688954:16777233,4184727394:1763049525,4186076373:-805306377,4186181662:-1056959625,4187127576:16,4187406641:86437879,4187447599:1769340279,4187671436:-268435465,4188000349:-268435977,4188488973:16777233,4188980561:-1883246603,4189662286:16777237,4190752854:-268435465,4192362015:151782161,4192447395:16,4194852332:1096810497,4195393079:-1889314176,4196329668:-302514185,4196820858:16779537,4197858541:184549393,4197940497:1829767473,4198028626:86437879,4198509982:-2128346624,4199132962:-268435465,4199158702:-302514185,4199794921:1637924277,4200186957:264236021,4201820221:-807494859,4201866639:16777216,4201870509:16908597,4202693390:277,4203262282:-268501001,4203380996:16777781,4203811927:1337458609,4203821380:-376566795,4204465133:-272629769,4204786339:701563665,4205064510:16777232,4205214670:2097169,4205278244:16777217,4205804568:1101170165,4205932925:-2124152832,4207076625:16777473,4207222897:1627392309,4208018418:233265973,4208194860:1739056631,4209518372:-805568523,4210092321:-815270537,4210736706:690359093,4210967625:-335609865,4211916387:1307017013,4211995930:1237315573,4212561577:-268435465,4213473442:17171201,4214853554:257,4215384633:1090538673,4215722242:158567269,4215998958:1227355509,4216125820:-268439561,4216316703:-911738891,4216554910:16777345,4216832962:1795426321,4217878191:1627392273,4218567876:-1946419275,4218816607:1227261015,4220578030:-268435465,4221072619:-2143158272,4221378653:1799702595,4221721244:-268435721,4222101405:755404049,4222517121:16777216,4222598178:1863711665,4223314660:2192,4223387233:222269105,4224713897:-1891729419,4225341739:1,4225803489:59046901,4226895904:-1994391279,4227041044:124033057,4227277105:-302157833,4227305608:633339829,4227426319:1637915121,4228002083:1073741905,4228068853:-344032265,4228410821:-2013506603,4229281338:-1946419211,4229388226:1090519089,4229448967:16777216,4230030974:1090650129,4230223119:16777216,4230365175:1090519313,4230395914:17040181,4230399884:16777521,4230498503:19137297,4230968503:1873161731,4231086515:1101508661,4231657873:163032053,4231737261:52693137,4232595781:-2147481579,4232689753:16777216,4233125417:16777728,4233268708:16777217,4233704234:-268435465,4233930377:-1045967993,4234011089:1205900209,4234517295:-1954254891,4234793550:-269549833,4235719085:1337442225,4236033259:-276858889,4236269257:1105594999,4237031727:16777216,4237047891:16777233,4237197538:16777217,4237630041:1,4237702804:25165952,4238451604:1,4238517928:-302514185,4238626579:1264899063,4238711830:-268435977,4238840645:555745313,4238992175:16777232,4239490850:-1916878975,4239575572:23330817,4239770746:-268435465,4239812740:153092097,4240198957:-843137135,4240860043:-1949738075,4241144047:16777781,4241948009:16778001,4242820562:118812465,4242845814:25434677,4243017102:-268435465,4243134914:86379377,4243166341:17039361,4243265187:161482833,4243305358:1073744149,4243347429:536871473,4243394753:16777216,4244075215:1333261687,4244452210:23331328,4244488387:1337392049,4244791220:-318373071,4245048405:16910449,4245171891:-2146303983,4245186501:16777216,4245348105:17172853,4245536913:-268435465,4245827040:1092618513,4246014073:-268959753,4246343474:16777729,4246369043:262145,4246392993:16777216,4246457082:-268470281,4246545602:1694499093,4246551333:-274850891,4247169820:-989787145,4247534156:1073741841,4247938344:-1985049611,4247997963:17039377,4248586796:16777233,4248926460:160442487,4248964732:16777216,4249327807:-2126380796,4249629024:553648181,4249635388:17039377,4250066051:150994944,4250161525:-268435465,4250187926:-268474377,4250439574:1269780471,4250758418:-272629769,4251184407:16777233,4251647817:65809,4251664313:-843137135,4251703040:16777729,4251744178:-272629801,4252559570:-268435465,4252666874:153092369,4253391263:1862671153,4254970295:16779793,4255226966:-805830665,4255316442:-269549833,4255326869:1835527381,4255534774:-268435753,4255864964:81,4256029770:1879048183,4256486823:50596656,4257373395:1099174709,4257701476:16,4257789916:-268435465,4257941377:-301989897,4257995538:19330037,4258221508:-268501001,4259101035:1831864629,4259175282:1099301173,4259262842:106655121,4259481041:16910449,4259832212:153354641,4259950785:155271171,4259978018:17039377,4260156117:1130532177,4260277743:-272629769,4260299422:1075839057,4260679671:16777232,4260813285:-843137129,4261839613:1,4261855242:1130750993,4262439971:16777232,4263186018:-272629769,4263627361:86351889,4263809962:17039409,4263817213:16777233,4264372118:33,4264447607:16810001,4264669669:16777489,4264702753:-302514185,4264767167:-268959753,4264988277:23085824,4265278863:16,4265808264:17042197,4266132612:-268435465,4266281335:17040177,4266406211:690481141,4266699207:-268435465,4266931484:25186449,4267883468:16777216,4268088216:27527537,4268590527:233275189,4268909946:-377353995,4269056414:16777217,4269115543:1627717649,4269321162:1097142833,4269941417:151783985,4270160858:-415781195,4270248180:1105594997,4270284924:-268439561,4270310653:-268435465,4270464092:801,4270595276:1090519041,4271011946:-374947979,4271080483:-272987147,4271368637:16777232,4271750250:1,4271825210:17039377,4271866446:1236019761,4272008383:-1996324859,4272135424:-268435465,4272321108:1742995447,4272687496:16,4273056483:153398289,4273246520:23330817,4273482074:1164244401,4273707595:16777329,4273821242:-268435465,4273979358:1,4274386098:50463233,4274601750:-1342178313,4274672828:-1350127823,4274748391:-507511817,4274897548:1829767473,4275168009:1090781489,4275248922:1,4276344616:121040693,4276377486:16777216,4276619857:1,4276662938:138493953,4277706515:153092369,4277875829:-314389579,4277921666:-268435465,4277996249:1864822263,4278474055:1772364689,4278492075:-268435465,4278608509:277,4278750762:1201946103,4278838604:17173301,4279007743:-1543503881,4279066958:1637915125,4279585106:17041921,4279943147:-310378699,4280020138:-370148425,4280081132:1128320437,4280286820:67108865,4280745611:-302514185,4280761018:-276824073,4280888649:1194830517,4281021189:16777216,4281076887:16777233,4281291204:1831864629,4281556665:-268435465,4281606763:1293993265,4281702983:16779537,4281711795:16777236,4281868610:-1414537259,4281921573:-268435465,4281953124:-344032265,4282113001:1768290423,4282305529:184568336,4282882433:16777232,4283058734:1292503057,4283066724:1,4283153215:1295334197,4283737743:16777216,4284364900:-1889018715,4284476566:137595733,4284644890:118843905,4285108920:17,4285186183:52807540,4285378917:16777216,4285468426:16777280,4285476536:16910709,4285623962:-843071615,4285717623:16529,4285767181:16859137,4285985237:86907697,4286076601:538968881,4286093114:16,4286367537:-272633993,4286400857:1101822901,4286406967:-471745065,4286494909:16777232,4286515768:1105523857,4286813244:18875137,4287113433:-306205737,4287446538:-272629769,4287875607:-272695305,4288471586:118878005,4288514097:689963521,4288557327:1095008273,4288814860:264219637,4288845963:23335425,4289104552:-268435465,4289496156:157516645,4290148010:1802886231,4290224017:-268435465,4290718429:1730609361,4290940676:1802894711,4291089718:10522801,4291199976:16777232,4291323072:-846591755,4291644946:-805306729,4291648722:-268959753,4291685525:-268435465,4291759108:1299735825,4292245279:1236909303,4292351070:1735374069,4292473419:17040145,4292549741:1879046135,4292724225:556139445,4292912233:-1488722669,4292988638:-272629769,4293113974:-376566795,4293436013:-268435465,4293437284:-818410761,4294529541:-2124021483,4294724981:1802886231,4294763449:-1448170539,4294834112:1840295415,4294840771:-268435465},r:{157878:262161,985371:1,1180217:-1993962635,2417197:49,2553729:-469762049,3327817:-401864680,3346625:1092622385,3425564:257,4168709:16777217,4589376:16777217,5102504:17172853,5393397:16777232,6128298:-2085221803,6335403:150994945,7161053:150994945,7347374:264192,7826548:16777216,8260801:16777233,8561223:-519828943,8671431:167529426,11212041:16779776,11259315:16777216,11837851:1092878864,12293765:1745094656,12336465:-384038343,13211372:27529265,13979552:-1577320457,14079334:16777233,14111180:17039377,14114361:16777216,14170898:-369098753,14198134:-401339543,14286053:1,14362664:16777217,14421639:-335544321,14510814:16777216,14720508:-1979777025,14737474:16908593,14752678:16781617,14769321:16910449,15756532:50719825,15767205:16777217,15770386:17041920,15822346:151259253,15973062:16777232,16214049:16777233,16904682:-872415521,17154160:-384038359,18522374:16777217,20048649:1267001589,20275682:16777216,20288139:33554449,20454430:151257873,21190249:1107296273,22053366:16777232,22408304:17039377,22756924:1,22760496:17041920,24600658:-369098753,25170246:153356885,25302584:-2147219455,26361145:-2088765443,26686513:33554448,28047376:17040177,28061236:1,29201078:-335816705,30178870:17,31470430:1,32071538:-335544321,32627218:17,32930725:1,33857486:801,35296213:16777473,36203249:-369098753,37408233:1090783793,37427771:-336625735,37720603:-335544321,38973550:1769340407,39461344:134299649,41197613:-1996092863,41316426:1,41771952:1811939327,42231999:25559824,43698772:264224,44835937:-876675593,45199803:-385021860,45637566:151126341,46196904:-381882947,46394932:1,47842642:16777745,48295924:1,49167744:1,50213030:-335817857,50262134:16777216,51068792:-920843395,52392938:19329909,53099750:19267605,53800054:16777217,53800088:1,53800157:1,53800225:16777216,53800670:1,53800738:1,53802825:264192,53802893:2048,54875784:709183555,55568803:-369098753,57512342:1,57740275:8388624,58283539:150995601,58599982:17039681,59151406:1,59308438:16777216,65362088:1627389969,65480933:16777253,65678668:-1045412391,66229371:1,66659640:-939259904,67579901:-1946157057,67860197:50594097,68373587:17039713,71973889:16777233,72639376:-1410334721,72933692:-402388984,74713228:131905,75303661:17,76772829:-335609857,77345272:-384562647,78502530:16777217,83208605:16777217,83350007:16777233,83454719:1090847541,85797653:16910453,85807881:-335816705,86531117:1090521089,88505333:16777216,88672254:1627717941,93643633:20,93815735:1,93839317:1796556887,94543295:16777233,95118066:1809684177,95365496:16777217,95892971:1627389969,96275653:16,96357129:273,100350182:564527793,101209446:-335544321,102686354:27525425,107047352:16777217,107287639:134219777,115154384:16779776,115626622:153518453,116502717:16777216,118272910:16777984,119214439:-384038887,123514446:16777521,123803139:709183555,124318065:1627718453,126272535:16777216,127048258:-1578689551,127522327:2048,133937728:17039377,134013330:33,4159182628:-335544321,4159906373:27312565,4164042543:-1993897099,4166211628:1,4170853641:-335544321,4175787584:-1979777025,4177060881:1267467057,4178820659:2048,4180379855:32768,4182272228:17039633,4184688954:16777233,4186615799:26214400,4186996085:-919958091,4187447599:1769340407,4188127282:264208,4190165397:-939259904,4192362015:1225523985,4192447395:16,4197178991:-1456254187,4198750088:-335544321,4199611560:-402388727,4202693390:277,4204786339:701563665,4205278244:16777217,4206622678:-335544321,4207891207:-2088766467,4213473442:17171201,4214853554:257,4215384633:16779441,4216554910:16777217,4216829310:-1993962699,4218168348:-1577063425,4219078940:-335808513,4219121950:1208223744,4221378653:1799702595,4222174446:150997504,4223314660:16,4230030974:1090650129,4230365175:1090519313,4230395914:17040181,4230399884:16777521,4230406998:1745618953,4231148360:-336625735,4231232415:-382407239,4231784883:135006232,4232595781:-2146297835,4232653498:1090915189,4232689753:16777216,4233125417:16777728,4233268708:16777217,4233351257:-385021860,4235289311:17825792,4235888488:-335807233,4236433551:16908389,4237031727:16777216,4237047891:16777233,4237197538:16777217,4237630041:1,4238451604:1,4238516494:-1045412391,4238840645:555745313,4239812740:153094145,4241186408:-1979711489,4241948009:16778001,4242962262:-906035201,4243166341:17039361,4243265187:161482833,4243347429:536871473,4243394753:16777216,4243943985:1208223760,4245171891:-2146303983,4245186501:16777216,4246016320:23593217,4246343474:16777729,4246392993:16777216,4246616794:-369098753,4246966763:1745094656,4247267300:-1985738187,4247534156:1073741841,4247938344:-1993438219,4247997963:16777233,4248044685:1745094912,4248586796:16777233,4248964732:16777216,4250344993:-383972591,4251090524:16777233,4251703040:16777729,4252692419:-383972559,4253016202:-335544321,4255076359:-1006632961,4255868585:16777217,4257882573:-335544321,4257995538:19321845,4259029832:1090847541,4259175282:1099301813,4259481041:16910449,4259950785:155271169,4264372118:33,4264669669:16777489,4265278863:16,4265600307:-402388728,4266281335:17039889,4266931484:25186321,4269115543:1090584593,4269409288:1774054391,4269989442:-402388728,4270464092:801,4271319519:-1979777025,4271368637:16777232,4271750250:1,4271825210:17039377,4273052363:-1979777025,4273979358:1,4274831223:-335849601,4275168009:17039377,4275248922:1,4276619857:1,4276662938:134299649,4277037515:-384562647,4278838604:17173301,4278864381:1745094656,4283066724:1,4283294503:-384562647,4283709078:-369098753,4283786316:17171253,4284317191:-906035201,4285108920:16,4285119706:-2124014795,4285174642:-469762049,4285378917:16777216,4285476536:16910709,4285547299:16779777,4285930657:-470057729,4286076601:538968881,4286093114:16,4286867240:-385086968,4287925492:1811939327,4288514097:689963521,4289513683:-383972591,4289893547:-872415233,4290338131:-1979777025,4292033483:-2095706095,4292473419:17040145,4293554978:1090783793,4294529541:-2124021483,4294724981:1802886231},rb:{157878:262161,286794:1160179699,312822:1291849777,408721:-270008321,662990:221644928,826897:-268967937,985371:1,1006937:17040001,1410043:-268959745,1550201:1224999217,1705302:1295334197,2003081:1095045245,2045464:1784006867,2417197:49,2557968:16910337,3178380:84148481,3346625:1092622385,3425564:257,4589376:16777217,4725653:1869067639,5393397:16777233,5670066:16,6052139:-268960257,6335403:150994945,6643126:-302514185,6915263:16777216,6970374:1,6991740:1090781489,7161053:150994945,7347374:264192,7826548:16777216,7932746:-268959745,8081866:16777781,8260801:16777233,8652460:33892352,8802643:-270278657,8935089:1167329809,8938196:1167405829,9061482:-1352250433,9264603:-268959745,9671199:-404226049,9676618:1627717941,10948045:-404226049,11139109:-268959745,11212041:16779776,11259315:16777216,11837851:1092878865,12081940:1078005789,13186680:1873021617,14111180:16777233,14114361:16777216,14116482:16777216,14144087:152551441,14196082:1829767473,14200255:690252753,14275715:1260503253,14286053:1,14510814:16777216,14670600:157516133,14736414:755368053,14769321:16910449,14770381:221604881,14810745:-273154113,15273141:1870133503,15368289:1829975811,15721698:1864878327,15758653:251927344,15770386:17041920,15772507:662964737,15822346:151259253,15977618:23367697,16064360:1224738905,16214049:16777233,16417854:16777232,16791598:-1397477652,16810617:-268959745,17302048:-268959745,17388498:-1477969921,17781629:-269090817,18003220:16777232,19910677:797182721,20288139:33554449,20632897:1878523903,20805031:1303644817,20848053:1292107793,20899964:184553621,21190249:1107296273,21479220:-404488193,21638658:1090781201,21674515:16,22053366:16777232,22756924:1,22760496:17041920,23321953:17039665,24217541:1260839389,24403397:16777217,24958251:-268959745,25302584:-2147219455,26237993:-1917834087,26443331:-1352274945,26535154:16777473,26686513:33554448,27132030:16842768,27675230:16777216,27850892:154483505,28061236:1,29775042:52445713,30178870:17,30352604:17117953,31423817:1842610175,31470430:1,31890112:1708604287,31967668:27708149,32071611:1090846773,32627218:17,32905286:16777233,32930725:1,33857486:801,35077351:1877475327,35296213:16777473,36260416:-268967937,37249048:1101398753,38002094:-1342846249,38105777:-273154113,38973550:1769340279,39297288:1224740917,39461344:138493953,39941713:184553621,40138247:-404226049,40484319:766780305,41316426:1,41530750:16777216,41764094:-302514185,44291106:393265,44323530:-268959745,44479472:-277483521,44651348:16777216,45637566:151126277,46935564:-268959745,47304707:-268959745,47361431:-1343782913,47821645:157518181,47842642:16777745,48077147:-268959745,48140253:-302514185,48295924:1,48457172:669513663,48795731:-806896129,49167744:1,50150832:1869084023,50226827:-270008329,51609471:1874016905,52003118:-370671943,53799883:65,53800054:16777217,53800088:1,53800157:1,53800225:16777216,53800670:1,53800738:1,53800773:184553473,53800807:16842753,53802825:2048,53802859:17827841,53802893:2048,54384110:-268959745,54422303:-805962497,54670658:-268959745,54864530:140625025,54875784:709183555,55239849:1337392049,56213086:-268959745,56981766:263716784,57512342:1,57740275:8388624,58112343:-815267841,58154370:-268959745,58164e3:20392592,58621821:23105553,58979504:-273154113,59151406:1,59308438:16777216,60499451:1100220929,61143210:-406587425,63174827:-268959745,63205075:16910449,65254328:2176,65429313:86172119,65480933:16777253,65674431:-268959745,66229371:1,68193059:758476157,68497616:162537472,68712296:-814396257,69673389:-805962529,70029440:-268959745,70974846:-268959745,70984394:-268967937,73747328:-268959745,75303661:264209,75346723:17039665,75790151:-268959745,75956234:23069185,77001521:-817546913,77432531:1328018807,77631495:-268959745,78502530:16777345,81165422:-268960257,82235393:-270008329,83208605:16777217,83350007:16777233,84606021:-302514185,84847465:-814386033,84932717:-1925879947,85797653:16910453,86531117:1090521089,86752183:118812465,87127885:140625025,87875195:17,88505333:16777216,88672254:1627717941,91017925:1829111925,93112206:-302514185,93214626:16777216,93643633:20,93815735:131073,93839317:1796556887,94543295:16777233,96275653:16,96357129:273,96850547:1830029621,97059008:-1608250972,97285047:50593808,99709525:1164021813,101864195:-307110409,101907699:393265,107047352:16777217,112702005:-268959745,115626622:153518453,116502717:16777216,116550726:-268959745,117404983:22038529,122656166:257181697,123803139:709183555,126272535:16777216,127522327:2048,133534634:1090846773,134013330:33,134773916:-1477969921,4154605267:1303899809,4166211628:1,4171920674:-319291401,4173447755:-268959745,4174632973:263666608,4175835111:669251547,4176306610:1,4178820659:2048,4180379855:32768,4182310634:20971537,4184432574:17039665,4184616345:23069185,4184688954:16777233,4185898014:-1350107137,4187447599:1769340279,4188488973:16777233,4188674375:1262520537,4189148759:-302514185,4189662286:16777237,4192971833:-805830657,4193936147:-268959745,4194852332:20971521,4195583329:-268967937,4196244826:1669484319,4196329668:-302514185,4196741091:-268959745,4197060545:65,4197093837:620760080,4198807616:1225043061,4199158702:-302514185,4199718961:631243285,4199730056:1878261695,4200362269:184553621,4200910369:-268959745,4203380996:16777781,4203884039:18874368,4205064510:16777233,4205278244:16777217,4205932925:-2126249984,4207541086:-268959745,4208194860:1739056631,4208553045:-268959745,4210494078:1236544161,4210496882:757465205,4211343712:257,4212563735:25184309,4212750745:1878523903,4214853554:1,4215384633:16796849,4215722242:158566757,4215996927:-268959745,4216554910:16777345,4216577521:184553473,4217213923:1877475327,4219121950:134481920,4220300557:-2122317227,4221378653:1799702595,4222101405:788966673,4222517121:16777216,4222970175:-268959745,4223314660:2192,4223926638:1260766717,4225341739:1,4225486712:1173573334,4227228989:8388608,4227798047:257181697,4227925780:667150335,4228002083:1073741905,4228732092:-268959745,4229388226:16777265,4229448967:16777216,4230494230:-268959745,4231086515:1093115957,4231737261:50595857,4232682471:153381781,4233013500:18874433,4233125417:16777728,4233268708:16777216,4235496723:-817546881,4237031727:16777216,4237047891:16777233,4237197538:16777217,4237630041:1,4238451604:1,4238840645:555745313,4239812740:153092097,4241144047:16777781,4242039400:-1448809483,4242091116:669513727,4242351914:-270008329,4242534984:-268959745,4242820562:118812465,4243134914:86379377,4243166341:17039361,4243265187:161482769,4243347429:49,4243394753:16777216,4243516495:-1888146425,4243598405:669515263,4244111080:-404226049,4244488387:1203174321,4244719060:1870924417,4245048405:16910449,4245186501:16777216,4245194062:-268959745,4246014073:-268959753,4246343474:16777729,4246392993:16777216,4247144689:-404228097,4247534156:1073741841,4248586796:16777233,4248964732:16777216,4249696756:-269091361,4250016695:1877475327,4251090524:16777233,4251647817:65809,4251703040:16777729,4251853706:1776801433,4253149023:20971536,4255864964:81,4255868585:16777217,4256486823:50596656,4257251933:225799185,4259101035:1831864629,4259481041:16910449,4259950785:155271171,4260679671:16777232,4261155065:1772283859,4261839613:1,4262867275:-2145367904,4262875435:-268959745,4263627361:86351889,4263809962:17039409,4263817213:16777233,4263888072:-1608250956,4263978910:-268973153,4264372118:33,4264447607:1224769553,4264596142:-268959745,4265278863:16,4266281335:17039889,4266384456:665062065,4266931484:25186321,4269115543:1090584593,4269832775:-404226049,4270035057:-268959745,4270102084:-268959745,4270324883:-268959845,4270595276:1090519041,4270637551:-269231625,4270804017:-273154113,4270940291:603979800,4271368637:150994960,4271750250:1,4271921185:191152605,4272334730:1676828447,4273057437:-1477970945,4273610245:1870924673,4273876543:-805933657,4273979358:1,4274081794:1303883425,4274897548:1829767473,4275168009:1090781201,4275248922:1,4276105201:1829844739,4276377486:16777216,4276619857:1,4276662938:134299649,4278901317:553714177,4279099012:-1380700434,4279475233:-268959745,4279854126:1103302717,4280745611:-302514185,4280837617:16777217,4281021189:16777216,4281076887:16777233,4281291204:1831864629,4281702983:16779537,4282088778:16777233,4283066724:1,4283153215:1303722805,4283472485:-268959745,4283737743:16777216,4283844015:-277348865,4284669900:20971665,4284689212:-268959745,4285108920:17,4285378917:16777216,4285476536:16910709,4285717623:16529,4285767181:16859137,4285923599:-270008321,4286093114:16,4286515768:1105523857,4287869472:561204929,4287899001:-270008321,4288050560:1869838331,4288448040:-1477967873,4288514097:689963521,4288557327:1095008273,4289018661:722671625,4289148305:-268959745,4289496156:157516133,4289539985:-268959745,4290148010:1802882135,4290229240:1834071823,4290452577:-1352373321,4290718429:1730216017,4291032685:1161125657,4291089718:10522673,4292150495:16777473,4292201796:1873008668,4292473419:17040145,4292597532:650373083,4294681065:1095045149,4294724981:1802886231},rs:{157878:262161,248610:-384038120,286794:1160179699,662990:19269760,930576:-272699393,948963:-268439553,985371:1,1006937:16777857,1367043:152174601,1689565:-268439553,1726996:-272675841,1788012:-268439553,1802472:-915149825,1806085:-276828161,2003715:-268439553,2221918:1870130047,2402597:-274731265,2417197:49,3115252:262145,3178380:84279681,3404404:-268439553,3843897:-384038359,4168709:16777217,4589376:16777217,4726463:-272633923,5253865:-268874092,5393397:16777233,5435373:-268439553,5769360:-268439553,6007425:-268439553,6299446:-268439553,6335403:150994945,6722050:-268439553,6970374:1,7161053:150994945,7347374:-2147219456,7584843:212102800,7587724:1879044091,7614617:-268439553,7826548:16777216,8081866:16777781,8153399:1772890801,8260801:16777233,8844597:257,8935089:1167329809,9046625:17042197,9061482:-1352250433,9266279:-272675841,9292788:-986117583,9417817:-268440585,9614121:-847778953,9640832:-369218887,9676618:1627717941,9805861:1871179121,10209185:1333192669,10516395:-818024513,11170081:-1593573111,11212041:16779776,11259315:16777216,11837851:1092878864,12293765:-402388992,12336465:-384038343,12704277:-844167209,12785006:-268439617,12860845:-268439553,12892590:-1587738183,12912345:-308409576,13382773:-268439553,13700045:1629749781,13715647:-275363021,13855347:-805319681,13877616:1763049521,13909428:-270537057,14012459:1091700793,14076152:-273232897,14078273:17039377,14079334:17039377,14111180:16777233,14114361:16777216,14116482:16777216,14130268:-1609695231,14166322:17042197,14167348:-268439553,14196082:1829767473,14260835:204975093,14286053:1,14308622:1293814288,14362664:16777217,14510814:16777216,14670600:158573413,14737474:16908593,14769321:16910449,14770381:221604881,14778899:-851506245,14779959:-820171873,14783141:-273208425,14802228:84017205,15242400:1841049521,15291533:1293814064,15391339:-1342443617,15392555:555680553,15767205:16777217,15770386:17041920,15772507:126093825,15786292:-1555169231,15811210:193228757,15973062:16777232,15983590:1265888255,16126993:1811869629,16144235:-268440577,16214049:16777233,16223593:-1385780588,16314135:-268980225,16547430:-268440577,16652720:-384038343,16733578:-268439553,16761792:-268439553,16786296:-2128344687,16794482:1841048497,16805384:-1588786887,16881109:-268440577,17021056:1879044095,17154160:-384038359,17183665:-1883246593,17421368:-1555103207,18003220:16777232,18259490:-275330049,18359512:-988396681,18470013:1090519125,18770346:-268439555,18942688:-268439553,18978694:16777217,19072095:-1487994615,19165876:-306188289,19170785:-346092743,19324984:-809504835,19831788:-268439553,20241506:-268439553,20275682:16777216,20288139:33554449,20325429:-268439553,20366406:1661206841,20631679:-268439553,20660571:1266970613,20805031:1303644817,20848053:1292107793,21190249:1107296273,21574087:-268439553,21638658:1090781201,21692831:-272684225,21759184:-268439553,21873846:-1588657919,22053366:16777232,22131167:-274731205,22209558:-272683075,22408304:25427985,22565396:801091575,22609369:-268439553,22756924:1,23321953:17039665,23624517:-1346425929,23735270:1090652165,24012382:-306188289,24071969:-1524694487,24140057:-375518919,24403397:16777473,25067357:-268439553,25302584:-2147219199,26022888:-268439553,26048674:-819992289,26235825:-272684137,26384169:-272633857,26535154:16908545,26535584:-268439553,26686513:33554448,26879997:-809504835,27675230:16777216,28061236:1,28334400:-272699393,28607133:-350287095,28660170:-276829185,28794175:-268439553,29172503:1840737209,29217755:-308409832,29899833:-268439553,29909620:-268439553,30157835:-384038103,30582687:-268439553,30865163:-268439553,31048953:-268439553,31056216:17039617,31128651:1293813776,31197784:-278983923,31232468:-268439553,31456365:1836543389,31470430:1,31677814:-809505351,31932768:-481361099,31934920:-314405931,32627218:17,32905286:16777233,32923148:-283300961,32930725:1,33311862:-1376908363,33350224:-268439553,33522150:-452392175,33619542:-268439553,33857486:801,34189313:-346092743,34520741:16777216,34521928:1730602231,34532994:-844167209,34636345:-1554052163,35296213:16777473,35429574:16777217,35473710:1236610697,35804705:-268439553,35990494:-279033319,36252387:-268439553,36340965:1229064217,36436587:-276828161,36544067:-272675841,36664594:-268439553,36887088:-272684099,36953371:16777233,37130730:1873274323,37744551:-268439553,37788500:-407483393,37859733:-272633923,38002094:666225239,38368734:53741845,38427788:-809538115,38700005:-276888775,39012468:-268439553,39052151:-306188289,39461344:81921,39925877:-272675841,40484319:766780305,40528470:-881530883,40816034:-273232897,40962509:-272699393,41210038:-268439553,41316426:1,41378701:-1458699987,41530750:16777216,41624940:-273224705,42410816:-268439553,42810312:-272633857,42831433:-268439553,43116296:-1591999703,43378864:1876912063,43698772:-1073477343,44291106:393265,44358988:-1916899465,44479472:-277483521,44651348:16777216,44653584:-308409832,45212170:1840737209,45425859:1307790269,45637566:151126277,46691660:27527297,47407632:-268439555,47821645:1232579429,47842642:16777745,47845727:-1593441775,48205855:-268439553,48295924:1,48645720:1694761233,49065034:-269488129,49167744:1,49547159:593429297,49555384:-268439553,49857979:-268481537,50018256:-272708609,50262134:16777216,50357567:-383842263,50382978:-270595271,50454534:-514915559,50592641:-2128328303,51338192:-518124739,51431964:-805310465,51972509:-268439623,52333823:-442192053,52843528:264219637,52846935:-1346375681,52931331:151783985,53029950:690359093,53032973:-268439553,53095696:767306673,53523042:-481424583,53551184:-268439555,53799883:65,53799917:1090521089,53800054:16777217,53800088:1,53800157:1,53800225:16777216,53800636:262145,53800670:1,53800738:1,53802825:264192,53802859:16779265,53802893:264192,54875784:704923649,55240760:-383497319,55663643:-1592851927,55773253:-268439553,56132221:-1486945527,56152758:-268439553,56240982:-268439553,56330407:-276828161,56448401:-805549195,56500929:-384038595,56948270:-277353473,57512342:1,57740275:8388624,58011805:-272633857,58358364:-268439553,58418777:-1045320795,58769064:1830685200,58781070:-1605631703,58856454:-268439553,59308438:16777216,59373516:-346095299,60499451:1100220929,61322438:-268439553,61703980:-268439553,62976958:-1487994051,63205075:16910449,63260528:-268439553,64219355:-268439553,64432263:-268439553,65362088:1627390257,65429313:86173175,65480933:16777253,65678668:-340695589,65732677:-268440577,66229371:1,66275465:-268439553,66428758:-278983811,66659640:-402388992,67478422:-268439553,67873470:-268448769,68497616:162537472,69167387:-876616939,69980078:-268439553,70184974:1841048497,70670605:-269496321,71647532:-809504839,71715122:16,71973889:16777233,72666936:16778e3,72933692:-402388984,73156462:-268498051,74261602:-374576231,75017580:-1376908491,75303661:17,75307157:-1072283273,75339718:1235649333,75443302:-1554052807,75446971:-2128346368,75623547:-347141351,75733723:-268439553,75794974:-809505351,76179788:-268439553,77345272:-384562647,77914661:-272634435,78502530:16777345,79172597:-809505351,80367319:-268440577,80688981:-268498119,81184727:-308409576,82175348:-268439553,82271495:-268439553,83208605:16777217,83350007:16777233,84673683:-805310465,84711301:2048,84836293:-1588723671,85752756:-268439555,85797653:16910453,85906489:16777216,85954336:-268439553,86224237:-268481537,86495811:264220661,86531117:1090521089,86752183:118812465,87750413:-343995591,88501160:805301247,88505333:16777216,88509322:-268439553,88672254:1627717941,88702976:-268439553,89556597:-274731265,90101317:-268980225,91409974:-268439553,91693001:1772785589,93709558:-301993985,93815735:131329,94182263:-847811567,94456133:1874602995,94543295:16777233,95892971:1627390225,96275653:16,96357129:273,96427915:-276303951,96850547:1830029621,97538875:-268439553,97664097:-1375735849,98210206:1308585625,99107521:554565929,99398657:-374576231,99702654:-268440129,101663042:-514913767,101907699:393265,102352093:-268439553,102681881:-268439553,103362094:17039377,104006877:-268439553,104265827:-278983923,105453346:-268455937,107047352:16777217,107054229:-276303887,107114981:622936089,107287639:134481921,108130723:1840737209,108380558:-1591473663,108984080:-268439553,109419007:-308409832,109639184:1293813776,111324276:-268439553,111537333:-308409576,112803698:1227631153,113602207:-268439553,114114451:-268439553,115626622:153518453,115981963:-844272681,116502717:16777216,117126073:-2052886653,117197831:-268439553,117404983:17827841,117955872:-268439553,118060866:16777216,118239367:-350287079,118272910:16777984,119021631:-2128346607,119214439:-384038855,120330040:-1345926155,121444711:-272633921,121465287:-809505351,122656166:152045569,123803139:704923649,125727594:-384038343,126272535:16777216,127285317:1,127522327:2048,127943996:-268439553,131447838:-268439553,132580818:-268439553,133937728:17039377,134013330:33,134234336:-1487994055,135138741:-383955525,135496536:-268505089,137087576:-1486943719,140910398:134283537,4157742210:-268439553,4159300095:-268439553,4163667875:-350287319,4165245010:-268439553,4165848932:151259968,4166452445:-268439553,4167404363:-268439553,4167621538:-276828161,4168191703:-1988646017,4170017355:-301994017,4170373889:-315159683,4173279218:-817893475,4173752924:-306204673,4174741913:529,4174805620:-843632967,4175108791:-268439617,4177046655:-1424096467,4178808173:-268439553,4178820659:264193,4180330084:16777301,4181247069:-301994529,4182017233:-851506245,4182272228:16777489,4182310634:20971537,4183243148:-384038879,4184002101:-268439553,4184432574:17039665,4184438162:-268440577,4184688954:16777233,4184692426:-268439553,4185083659:-268439553,4187406641:86437879,4187678949:-268439553,4188488973:16777233,4188797588:-268439553,4188835189:-308409832,4189524937:-268489731,4189962687:-275330049,4190165397:-402388992,4190180136:-268489795,4190874972:1091700793,4190878474:1836485717,4190889267:-384038343,4191820591:-270536993,4192447395:16,4193774071:-301993985,4193862568:-384038343,4195323566:-268439553,4196430579:-268439553,4196584775:-308409576,4196802860:-268439553,4197051882:-809505383,4197363645:-276888807,4197767534:-304631809,4197777829:1090519349,4197967438:1841048241,4198028626:86437879,4198162884:-268439553,4198509982:-2128346624,4198601387:-268439553,4198724505:-268439553,4199611560:-400815863,4199718961:631243413,4199830341:-402657281,4200880383:-278516076,4200928314:-268439553,4201102201:-268455937,4201403077:1703280913,4201410290:-268448769,4201415965:-268439553,4201658778:-268439553,4201740844:-268440577,4201870509:16908597,4201928225:-268439553,4202603902:-268498115,4203380996:16777781,4203884039:18874368,4203921636:-347141351,4204886506:-347141351,4204991380:-268439553,4205214670:69206033,4205278244:16777217,4205932925:-2130444288,4207152115:-276888775,4207182781:-274731265,4207736822:-268439553,4208194860:1739056631,4209045342:-268439553,4209045637:-308540904,4209693973:-1486943719,4209741679:-1555103479,4210476008:-268439553,4210494078:1236544161,4210736706:690359093,4210917794:-481424583,4211546653:-1525940183,4211801080:-268439553,4211891262:-839930889,4212278236:-268439553,4212672565:-276828161,4212893507:-268440065,4213473442:17171201,4214853554:1,4215722242:1232579429,4216147476:-268439553,4216532351:94646161,4216554910:16777345,4217657347:1841295359,4217878191:1627392273,4218210687:-268440705,4218709157:-272633923,4219121950:1208223744,4219541792:-268439553,4219671621:-268439553,4220040256:-809505351,4220136249:-276828161,4220199395:-268439553,4220401036:-1346392075,4220459620:1705444281,4220634339:767306673,4220720421:17171249,4221273556:-413201611,4221378653:1799702595,4221520435:-381769347,4221776457:-278984131,4221946187:-384562895,4222101405:788983569,4222517121:16777216,4222596666:-384038631,4223268450:-308409832,4223314660:16,4223586635:-1555101383,4223926638:1260766717,4224250398:-1375752193,4225260108:-275551307,4226334149:-1588723143,4226928135:-820098535,4227277105:-302157833,4227615382:-1921553391,4227733521:1879027711,4227798047:152045569,4228002083:1073741905,4228592766:-268439553,4229448967:16777216,4230223119:16777216,4230406998:-401864695,4230600011:-268439553,4230733525:-268439553,4230788478:-268440129,4230903567:-843600199,4230991595:-1592917975,4231104199:-268439553,4231232415:-382407247,4231657873:264219637,4231784883:134481944,4232689753:16777216,4232905474:-268439553,4233013500:18874433,4233124446:-270595271,4233125417:16777728,4233268708:16777217,4233323593:-268439553,4233557636:-414250727,4234517295:-1954254891,4234815580:-269096961,4234992787:-268439553,4235279812:-268439553,4235407109:1878978559,4235924131:-268439553,4236526237:-400815863,4236901207:-820721249,4237031727:16777216,4237197538:16777217,4237378658:69470245,4237630041:1,4237715685:-308409576,4237729630:-279033319,4237816332:-838898023,4238451604:1,4238516494:-877574693,4238668665:-268439553,4238955640:16777216,4239388142:-272634435,4239413692:-276828161,4239685273:-268439557,4239812740:153092097,4241144047:16777781,4241628660:-276370159,4242159741:-385611512,4242532022:1841048497,4242538443:-272634371,4242544995:553648661,4242659618:-268440577,4242820562:118812465,4242942783:553910561,4242987764:-2130182124,4243134914:86379377,4243166341:17039489,4243394753:16777216,4243527713:-284708873,4243763698:-308409832,4243943985:1208223800,4244719060:1870924417,4244967883:-1609629175,4245048405:16910449,4245186501:16777216,4245747620:1661995521,4245826545:-268439553,4245954964:-339746027,4246343474:16777729,4246392993:16777216,4246545602:1694499093,4246730129:-375518919,4246966763:-402388992,4247147909:-268439553,4247287311:-268439553,4247534156:1073741841,4247759553:-274781281,4247997963:17039377,4248044685:-402388728,4248074719:1879027711,4248382200:-272830465,4248533660:161548944,4248583655:-268439553,4248964732:16777216,4249478233:-274805769,4249676980:1879044095,4250066051:150994944,4250344993:-383972591,4250849352:-284184585,4251184407:16777233,4251430580:1308585625,4251493887:-268439553,4251647817:65809,4251703040:16777729,4251783586:-268439553,4252220159:-1344336963,4252261717:-268439553,4252396369:-316929767,4252692419:-383972559,4254280751:-268439553,4254685287:-273232897,4254703887:-271333289,4255001415:-273232897,4255508741:-268439553,4255526190:16777232,4255541320:1879044087,4255645607:-1352725991,4255868585:16777217,4256223810:-268439553,4256267882:-268439553,4256378521:16777232,4256521192:52561925,4256593472:-272633921,4256667911:591790385,4256953055:-1488125159,4257251933:225799185,4257701476:16,4257762163:1228222089,4258248877:-268439553,4258301170:-268439553,4258340120:-268439553,4258609806:-268439553,4258623381:-268440065,4258736157:-400815863,4259101035:1831864629,4259481041:16910449,4259495676:-268439617,4259950785:151076865,4259978018:17039377,4260679671:17826320,4260957442:-268439553,4261155065:1772283859,4261447806:-268439553,4261663070:1094846481,4261839613:1,4262158846:-268440577,4262403829:-268439553,4262560152:-276828161,4262644917:263663613,4263056932:-374576231,4263809962:17039409,4264372118:33,4265160138:-268439553,4265278863:16,4265600307:-400815352,4265956479:-268439617,4266141160:-268439553,4266281335:17039889,4266868554:-821671399,4266909358:-268455937,4266975644:-268439553,4267465796:-385611239,4267630831:-268439553,4267630904:-284693003,4268038188:-268439553,4268549582:-268440577,4268909946:-377356043,4268966679:-1609629439,4269107183:-828379751,4269115543:1090584593,4269122548:-268439553,4269139682:-268439553,4269590596:-268439619,4269851275:-268455937,4269941417:151783985,4269989442:-401863896,4270461468:16777233,4270629596:-268439553,4270940291:603979800,4271628185:-1588657879,4271692608:-268439553,4271750250:1,4271825210:16777233,4271866446:1236019761,4271921185:1333052925,4272008383:-1992128315,4272038365:-268439553,4272117323:-268439553,4272296808:-310940007,4272340215:-268439553,4272437953:-272633921,4272636811:-1604386007,4272672517:-1072217737,4273324896:-268439553,4273351310:-268439553,4273573805:-272633923,4273866906:-268439553,4273869194:-268481537,4273876543:-805933657,4273979358:1,4274081794:1303883425,4274207673:-268439553,4274344863:-268439553,4274408220:-1588657623,4274476068:-1348523105,4274566539:-270595271,4274897548:1829767473,4275112174:-921957831,4275168009:1090781201,4275248922:1,4275579343:1705460665,4276377486:16777216,4276457914:-272633923,4276619857:1,4276627300:-268439553,4276662938:81921,4276826359:-276303951,4277018910:-268439555,4277037515:-384562647,4277538304:-1521548503,4277683870:-384038887,4277875829:-314127371,4278366894:-268439553,4278379467:-346297345,4278474055:1772366737,4278684882:1840130997,4278864381:-402388992,4278876418:-407483393,4278931672:-274781281,4279000497:-341964487,4279185952:-268439553,4279393519:-268439553,4280286820:67108865,4280521571:-279033319,4280586280:-268439553,4280612576:553648661,4280713674:-268439553,4280733902:-268439553,4281076887:16777233,4281079180:218234933,4281291204:1831864629,4281323498:-302602307,4281785052:262165,4281815071:-269496321,4281815395:-268439553,4282053322:-1898352897,4282194391:-806138881,4282226933:-1609629439,4282228437:-271660035,4282305529:184568336,4282825832:-481359079,4282947907:-400815831,4282954286:-268498119,4283058734:1829636113,4283066724:1,4283294503:-384562647,4283304906:151259648,4283539692:-346092775,4284054281:-269037569,4284438337:-301993985,4284476566:146254837,4285298084:659489593,4285378917:16777216,4285476536:16910709,4285547299:151259905,4285717623:16529,4285783697:-268439553,4285899572:-1555169223,4286093114:16,4286257689:-519831271,4286367537:-272633993,4286494909:16777232,4286548794:-270611457,4286613897:-268439553,4286813244:18875137,4286867240:-384038136,4287265060:-268439553,4287273857:-411185281,4287322327:-268439553,4287498313:-268439553,4288388584:-302534657,4288718194:-268439553,4288814860:264219637,4288837231:-308409576,4289179655:-373526599,4289273034:-316929256,4289467603:263663613,4289496156:1232315237,4289513683:-383972591,4290105639:-268506113,4290452577:-1352373321,4290660282:-268439553,4290718429:1730216145,4290753593:-276828161,4291278645:-805310465,4291949655:-268440587,4292150495:16777473,4292296325:1795162485,4292345695:-268439553,4292473419:17040145,4292479460:1073872913,4292718997:-268439553,4292766078:-809504833,4292916893:-272633923,4293002408:-276828161,4293839665:-268439553,4293894914:-268440577,4294158757:-272633923,4294181364:-2135660928,4294372446:-275330049,4294820352:-268439553,4294844064:-273232897},scala:{184925:-301989889,248610:-384038120,662990:221677697,985371:1,1006937:16777857,1312624:-302514185,1705302:1295334197,1771306:-977421315,1835198:-301990165,2417197:49,2557968:16910337,3270687:20971537,3346625:1092622385,3425564:257,3843897:-385086935,3861958:-1916801091,3867993:-301989889,4168709:16777217,4589376:16777217,4616513:16777525,5001813:1090520405,5102504:17172853,5393397:16777232,5923409:27537457,6116330:-301989889,6254307:1840523313,6335403:150994945,6643126:-302514185,6649550:-301989889,6915263:16777216,6970374:1,7161053:150994945,7347374:264192,7403755:17171313,7584843:212102800,7826548:16777216,8081866:16777781,8260801:16777233,8279589:-1378903049,8561223:-1593570767,8561817:-2055208939,8935089:1167329809,8938196:1090859781,9292788:-986116559,9341906:1694768005,9654964:-845981007,9711465:-303690955,10496886:-306310371,10519143:-306200577,11028532:1308585913,11136972:-371848523,11212041:16779776,11259315:16777216,11372726:-1377530891,11762036:-306234593,11832553:-1921553219,11837851:1092887057,12064785:-301989889,12293765:-402388992,12675986:-301989889,12767082:-306561095,12838699:-301989889,12906790:1090651477,12912345:-308409576,13186594:16777233,13211372:25432113,13506975:-384038019,13525563:1233584181,13570971:1227480535,13600674:16845081,13828457:-301989889,13877616:1763049521,14012459:1091700793,14078273:17039377,14079334:16777233,14106108:-306184193,14110120:1083050805,14111180:17039377,14114361:16777216,14116482:16777216,14129207:-1046066427,14196082:1829767473,14286053:1,14308486:-306242691,14308622:1293813776,14510814:16777216,14670600:157516645,14720508:-1979777025,14737474:16908593,14769321:16910449,14770381:225930257,15291533:1293814064,15368289:1829975811,15532294:-301989889,15612165:-308405443,15766144:-307463531,15767205:16777217,15770386:17041920,15840441:-838861889,15867463:-436211713,16214049:16777233,16774741:-301989889,16995267:1099828149,17048354:-310411623,17154160:-384038391,17647841:-306184193,18359512:-988331145,18541424:-301989889,19647078:-306758881,19943170:-301989889,20275682:16777216,20805031:1303653009,21411049:-301989889,22009144:-1916850187,22408304:17039377,22756924:1,22759334:-843120651,23276907:-303040521,23315809:1308061625,23321953:17040177,24368893:17041921,24382333:-301989897,24403397:16777217,24600658:-369164289,25170246:153356885,25302584:-2147219455,25711019:-302006273,25827453:-302006529,26237993:-1917834087,26516310:-302514177,26535154:16777473,27790802:-1916981323,27850892:154483505,27973406:-301989889,27997321:-2132799402,28047376:17039921,28061236:1,29131779:-301989889,29217755:-308671976,29267626:-301990145,30157835:-384038615,30178870:17,30352604:17109761,30892790:-302514185,31056216:17039617,31128651:1292765200,31470430:1,31633117:16777216,31934920:-851277803,32071611:1090846773,32627218:17,32905286:16777233,32930725:1,33285324:-307463531,33791963:-977863171,33857486:801,33985943:-301989889,34520741:16777216,34659611:-301989889,35141694:-301989897,35282886:-843056129,35296213:16777473,35566892:-301989889,37394054:-1384808577,37408233:1627654705,37869523:-1380061185,37898544:-301989905,37989292:1303883705,38099413:1099486613,38601297:-843120651,38705217:-302514465,38985701:-314958535,39052151:-306188289,39376916:-301989889,40484319:691274513,41106357:-301989889,41316426:1,41391733:695350041,41530750:16777216,41764094:-302514185,41934806:-302006273,43698772:-1073477343,44291106:393265,45206751:-301989889,45463086:-306200577,45471463:-301989889,46025857:-301989889,46196904:-381882947,46394932:1,46691660:95161473,46942984:-838860809,47821645:157518693,47842642:16777745,48140253:-302514185,48295924:1,48479186:-301989889,48819987:161874321,49167744:1,49183153:-301989897,50146425:-301989953,50463387:1842626205,50508812:-843071595,50652814:-1591473227,51077729:-301989889,51354741:-301994307,52241789:-301993985,52333823:-442192053,52534379:1292963349,53799883:1,53800054:16777217,53800088:1,53800157:1,53800225:16777216,53800670:1,53800738:1,53800807:16842753,53802825:264192,53802893:2048,54349900:-307463531,54702009:-302040259,54799990:-2053762787,54829198:-301989889,55226049:-306561095,56011784:1093468533,56920565:16777489,57153304:-301989905,57202038:-843133287,57512342:1,57740275:8389264,57958667:614465619,58418777:-1045328987,58563220:-302006273,58599982:17039617,58769064:1293814288,59135505:1843150749,59151406:1,59172531:1635912437,59308438:16777216,59646924:1836792601,60177930:-301989889,60499451:1100220929,61361823:1099958325,61956035:-302006465,62386387:-838860801,63153041:-301989897,63205075:16910449,63358435:-302006273,63812731:-301989889,64675937:-301989889,64790892:17042193,65254328:2048,65362088:1627389969,65480933:16777253,66229371:1,66659640:-402388992,66818793:-301989889,67646220:-306184193,68373587:17039713,68497616:162537472,68604897:1099303765,68708785:17240835,69309474:-302514185,70898868:-301994049,71001857:-301989889,71973889:16777233,72933692:-402388984,73401749:-301989889,73916587:-301989889,74602175:-301989889,74713228:131905,74715446:17039665,74734859:-1916796929,75303661:17,75307157:-1005108361,75346723:17039665,75682024:-440778823,76135781:1231670295,77345272:-384562647,77495235:-838877193,77780163:-306188289,78362805:-301989889,78502530:16777345,80350055:-301989889,80860651:-306200577,83208605:16777217,83350007:16777233,83392381:-301989889,83700702:-305161257,83947431:-440778855,84456709:-1041237113,84711301:2048,85252069:-306184193,85797653:16910453,87832e3:-385086659,87875195:17,88505333:16777216,89228638:-1401585793,89684706:-843055115,90351698:-301989889,93112206:-302514185,93214626:16777216,93643633:20,93815735:1,94182263:-847811535,94479397:17039665,94543295:16777233,95365496:16777217,95370550:-301989889,95408670:-303562753,95892971:1627389969,95898261:-301989889,96275653:16,96357129:273,98210206:1308585625,98766663:-301989889,98766868:-314701007,100285116:-843055115,100350182:564527793,101907699:393265,102686354:27525425,103362094:17039377,104986824:-302027079,107047352:16777217,107287639:134219777,107490435:-301990149,107705134:1840526257,108380558:-1591473663,109349241:1234275001,109639184:1292765200,111537333:-308409576,111736729:220924345,113891461:222277297,115154384:16779776,115608390:-301989889,116502717:16777216,116850827:1303711637,116962064:-301989889,117126073:-2052362365,117241987:-301989889,117560155:-307463467,118272910:16777984,119214439:-384038887,119971771:-301989889,123514446:16777521,126272535:16777216,127522327:2048,131828334:-307463532,133006694:-301993985,133534634:1090846773,133937728:17039377,134013330:33,134944617:1842602967,140910398:134283537,143064342:10485843,4154605267:1303899809,4159656364:-1921380656,4164465199:-306758849,4166211628:1,4166775597:-301989889,4166825437:-301989889,4169242603:-2130443983,4171920674:-319291401,4173752924:-306204673,4175787584:-1979777089,4176306610:1,4178820659:264193,4180379855:32768,4180435314:-306242691,4181597292:-1916928011,4182272228:19136785,4182310634:20971537,4182577529:-301989889,4183602898:-838860865,4183796467:-301989889,4184432574:17040177,4184688954:16777233,4184727394:1763049525,4184832302:-302514185,4188488973:16777233,4188835189:-308671976,4188951732:-301989889,4189652636:-301989889,4190165397:-402388992,4190212714:-1916796929,4190494045:-301989897,4190734356:-302006465,4190874972:1091700793,4192447395:16,4193138622:-843186187,4193219162:-301989913,4193570481:-301989889,4194876555:-303579203,4195133239:1300431345,4196329668:-302514185,4196500489:562299185,4198863869:-305144833,4199158702:-302514185,4199169533:-843186185,4199611560:-402388727,4199718961:631243413,4200067965:-301989889,4200209325:-306188353,4200490488:-302006465,4202263466:-314700943,4203380996:16777781,4203660099:-1378903081,4204462298:-301989889,4205064510:16777233,4205214670:69206033,4205278244:16777217,4205552505:-369098753,4206538862:-985698313,4208479055:-302006273,4209045637:-308540904,4209855533:-1919544865,4210494078:1236544161,4211217279:-301989889,4212284103:-301989889,4212418809:-302022665,4212589253:-301989913,4213473442:17171201,4214853554:257,4215584513:-847938251,4215591081:-301989889,4215722242:158566757,4216532351:94646161,4216554910:16777345,4217065770:1304407729,4217657347:1841295359,4218174052:-301989889,4218352214:-843137135,4218498495:1777013529,4218816607:1093043223,4219121950:1208223744,4219708757:-301989889,4219985845:-838897895,4220599167:1236018453,4221542050:84347833,4222162943:-2055208803,4222174446:150997504,4222334007:-301989889,4222517121:16777216,4222954269:-843120651,4223268450:-308671976,4223387233:222277297,4224760406:-301989889,4225341739:1,4226242056:-301989889,4227228989:8388608,4227615382:-1921553391,4228002083:1073741905,4228667201:151062549,4229448738:-301989889,4230030974:1233256465,4230365175:1090519313,4230395914:17040181,4230399884:16777521,4230406998:-401864695,4230564248:87297557,4231232415:-382407239,4231869261:-309886479,4232653498:1090915189,4233125417:16777728,4233268708:16777216,4233315007:-306244835,4233860489:-1916932107,4233930377:-1046066427,4234251640:1308585881,4234512412:-302006465,4234609966:-301989889,4235354525:1840526257,4235653793:1090650417,4235849436:-307463531,4236433551:16908389,4236526237:-400815863,4236875386:-301989897,4237047891:16777233,4237197538:16777217,4237378658:69994789,4237630041:1,4237702804:1098907777,4237715685:-308409576,4237816332:-838898023,4237920856:-306184257,4238451604:1,4238495921:1840643508,4238517928:-302514185,4238831825:-306184259,4238840645:555745313,4239490850:-1918976383,4239812740:153094145,4240198957:-843137135,4240642339:-301989889,4241144047:17039925,4241948009:16778001,4242159741:-385611512,4242537049:-302514177,4243166341:17039361,4243265187:161482833,4243394753:16777216,4243583465:-843251723,4243763698:-308671976,4243804075:-838860809,4243872492:629476273,4243876969:621087665,4243943985:1208223800,4243973709:694301465,4244430761:-301989889,4245048405:16910449,4245186501:16777216,4245807566:17041781,4245931709:-308856289,4246343474:16777729,4246392993:16777216,4246697075:-369098753,4246880792:-2053078819,4246966763:-402388992,4247027094:-301989889,4247267300:-1985738059,4247534156:1073741841,4247997963:16777233,4248044685:-402388728,4248102842:-301989897,4248533660:161483408,4248586796:16777233,4248964732:16777216,4249635388:17039377,4250306369:-302006467,4250344993:-383972591,4251189228:-302006531,4251430580:1308585625,4251647817:65809,4251664313:-843137135,4251703040:16777729,4251868820:-301989889,4252174784:-314700943,4252692419:-383972559,4254026488:-302006465,4254194792:1840523793,4254815610:-302120961,4255132060:-302022665,4255864964:81,4255868585:16777217,4257251933:1299672081,4257701476:16,4257876897:1839664049,4258373578:-1375895681,4258736157:-401864695,4259481041:16910449,4259780654:-302516225,4259978018:17039377,4260387966:-306188357,4260679671:17826320,4260813285:-843137129,4261839613:1,4262360733:-306184193,4262867275:-2145384288,4262965234:-301989889,4263292311:-301989889,4263528750:-306184193,4263809962:17039409,4264372118:33,4264447607:16810001,4264669669:16777489,4264702753:-302514185,4264716135:-1384120321,4264765838:-301989897,4265278863:16,4265600307:-400815352,4265970921:19138933,4266281335:17039921,4266846426:1842842549,4266931484:25186449,4267490905:-436273161,4267499553:-301989897,4267523556:6291777,4267532573:-301989889,4268252792:-306204739,4268910181:1234275001,4269115543:16777233,4269323577:-301989889,4269675349:-400275160,4269898272:-306184193,4269989442:-402388728,4270011879:-306184193,4270386040:1775635125,4270464092:801,4270595276:1090519041,4270749679:-306188359,4270753383:-301989889,4270940291:603979800,4271283950:-301989889,4271319519:-1979777025,4271368637:16777232,4271750250:1,4271825210:17039377,4272008383:-1996324859,4272103736:-301989889,4272336042:-301989889,4272672517:-1005108361,4272788255:-302006273,4272794185:-920647663,4273459247:-838877185,4273707595:16777329,4273888683:17236785,4273908551:-301989889,4273979358:1,4274054318:1636698933,4274081794:1303883425,4274100069:-310902785,4274263341:1842842549,4274726341:-844922511,4274897548:1829767473,4274923578:-450752215,4275112174:-921957831,4275248922:1,4276105201:1829844739,4276131224:-301989889,4276387583:-301989889,4276619857:1,4276699202:-306184193,4276762133:-2053762787,4277037515:-384562647,4277411332:-844424556,4277875829:-314389707,4277995125:-1918760587,4278222265:-838897731,4278462461:-306233761,4278838604:17173301,4278864381:-402388992,4278901317:553714177,4279585106:17041921,4280536979:-302006529,4280745611:-302514185,4281315349:-302006273,4281792668:1629750213,4282059083:-301989889,4282108709:-301989889,4282877340:-911987723,4283058734:1292503057,4283066724:1,4283153215:1295334197,4283294503:-384562679,4283513524:-454682793,4283625932:-302006273,4283709078:-369164289,4283897739:-306889953,4284059331:-302120961,4285108920:16,4285233720:-302006273,4285378917:16777216,4285476536:16910709,4285623962:-845169023,4285669101:159779473,4285684472:-302022657,4286048999:-2051607073,4286093114:16,4286605853:-301989889,4286867240:-385086968,4287131213:-308332001,4288254023:-306184225,4288291391:-301989889,4288514097:689971713,4289108295:-302022657,4289304759:1234113073,4289496156:157516645,4289513683:-383972591,4289899872:-301989889,4289997474:-843133287,4290338131:-1979777025,4291032685:1303731993,4291089718:10522673,4291301788:-301989897,4292150495:16777473,4292416970:67176729,4292473419:17040145,4292479460:131089,4293554978:1090783793,4293647399:-301989889,4294181364:-2135660928,4294372793:-1041245305,4294720558:-301989889,4294849864:-301989889},sh:{312822:1291849777,747604:-268435969,985371:1,1717757:-268436097,2003081:1095045245,2045464:710264915,2667344:-293601893,3115252:1,4471936:-269026115,4589376:16777217,5361836:-285213441,5393397:16777233,5879220:-268436225,6335403:150994945,6524020:-277873153,6683166:1254484449,6841194:-941099777,7161053:150994945,7347374:264192,7495657:-268435969,7826548:16777216,8007935:1226868945,8159510:-941099777,8260801:16777233,8498334:1342106777,8844597:256,9676618:1627717941,9970246:-293601893,10930867:1265973545,11259315:16777216,11325009:-505341451,11684070:-268435969,12081940:1078005789,12293765:1208223744,12367541:1772484085,12983372:-1889141643,13186594:17,13211372:25169969,13862770:-1889141387,13960430:1866462397,14012459:1091700793,14078273:17039409,14079334:17039377,14111180:16777233,14200885:-302154529,14242808:-2063396724,14286053:1,14742811:-268567425,14747052:-505341451,14769321:16910385,15756532:184937553,15862711:-268698113,15977618:23101457,16064360:1224738833,16098327:-1065562907,16121691:-285213441,16214049:16777233,16534636:-268436257,16549219:-1889141643,16842464:17956913,16990428:16777216,17709064:-268698497,19094259:-2130704384,20048649:1271262453,20366406:1627652401,22053366:16777232,22756924:1,23012503:-268435969,23726422:-285213205,24140057:-384038855,24298312:-268435969,24403397:16777217,25302584:2049,26535154:257,27911196:1877990717,28061236:1,28108050:-268435969,29286967:-293733265,29367984:1806695893,30313384:16777216,31470430:1,32071611:1090846773,32930725:1,34404475:-1889141387,34507122:-268436225,34520741:16777217,34521928:1663485173,34812485:-268698241,35514442:-268435969,36959408:-268436225,37130730:1335944656,39297288:1224740917,39461344:138493953,40433573:-285475729,43491688:-285213205,43698772:264192,44518363:-268435969,44651348:16777216,44873795:-276824577,45763665:-268567425,46657069:-285475345,48029920:-268698113,48795731:-806879745,49048293:-268436225,49167744:1,50262134:16777216,50559622:-285213457,51008750:-985147009,51244294:18874384,52143641:-268698497,52151666:-470886039,53799883:1,53800054:16777217,53800088:1,53800157:1,53800225:16777216,53800636:1,53800670:1,53800738:1,53802825:2048,53802859:16777217,53802893:2048,54864530:140624897,54875784:709183555,56920565:257,57512342:1,58621821:23105553,59308438:16777216,60955335:-301994497,63250472:-2059153252,63960958:-268435969,65254328:2048,65362088:1627390001,66066365:-268436225,66229371:1,66659640:1208223744,67252806:-268698497,67306489:-269484673,68059414:-268436225,69069928:-1889141387,70600208:17,71715122:16,71973889:16777233,72284030:-268435969,72933692:1745094656,73945005:-268436257,75303661:264209,77001521:-807044609,77676429:16,78312349:1272315125,80118199:16777232,81605533:-268435969,82081154:1274604697,83208605:16777217,83350007:16777233,83933330:17301520,84198347:1308034545,84711301:2048,86531117:1090521089,86765353:16810037,86782187:-268435969,87127885:136430593,88171633:1,88345942:-285344273,88672254:1627717941,89544265:-268435969,93214626:16777216,93643633:20,93815735:1,93839317:1796556887,95222149:-268436257,95892971:1627389969,96126386:-277873153,96275653:16,98012884:193326549,99709525:73437237,101728843:-268698497,103362094:17039377,114317490:-268435969,117404983:17827841,122656166:16777217,123803139:709183555,126272535:16777216,127285317:1,127522327:2048,128776313:-985163393,129532936:-269026115,133534634:1090846773,145592745:-270591491,4166211628:1,4167106417:-268567425,4168123178:1627390001,4169242603:-2130378447,4172446639:1669201049,4178820659:2048,4181144136:-491981815,4182272228:257,4185128231:-268436225,4185346021:-385077764,4188488973:16777233,4189025662:770346205,4189662286:16777237,4190165397:1208223744,4190874972:1091700793,4194794625:-268435969,4199611560:-402388727,4199688799:184811529,4200259565:20054065,4202830069:-1889141387,4203063720:-270011137,4203495726:-268435969,4205064510:150994961,4205724054:-814227969,4208194860:1722279399,4208205451:-268436225,4211491541:-268435969,4212563735:159402037,4215233960:-285213201,4218361996:-1889141387,4218617916:-268435969,4219121950:1208223744,4220620601:-830997013,4221378653:1799702595,4222517121:16777216,4223423706:-285475713,4225243245:-268435969,4225341739:1,4227788623:-268436225,4227798047:152045569,4228627829:-268435969,4229178906:-268501761,4229388226:1090519089,4229448967:16777216,4229980297:-268435969,4230365175:1090519313,4230406998:1745094665,4230964408:-268435969,4230991595:554303529,4232630788:-268436225,4232689753:16777216,4233507341:-268435969,4235496723:-807044609,4235860709:-268436225,4236567016:-293733265,4237031727:16777216,4237047891:16777233,4237378658:2085,4237591823:-268435969,4238451604:1,4241943318:21366805,4242215535:-268435969,4242942783:17039617,4243394753:16777216,4243943985:1208223760,4244438047:-268698241,4244543580:1665173645,4244588788:-480376707,4245093028:-268436225,4246016320:17301504,4246392993:16777216,4246730129:-384038855,4246966763:1745094656,4247534156:1073741841,4247821473:-268435969,4247997963:17039377,4248374383:137421840,4248586796:16777233,4248926460:1234184311,4248964732:16777216,4249635388:17039377,4251042551:-276824577,4251090524:16777233,4252755434:-301994497,4253347211:-268698369,4254329888:-268435969,4255559318:-285278993,4255633430:-805307137,4256938009:-814284515,4257490906:1734514909,4257520680:-268698369,4257701476:16,4257834948:-276824577,4258140804:-268698497,4258736157:-401864695,4258798595:-301994497,4258959646:20973585,4259832212:153354641,4259950785:155271171,4259978018:17039409,4261839613:1,4262722506:-268435969,4263027806:-1889141643,4263085184:-268501571,4263572970:553912617,4264447607:1224769553,4264669669:16777489,4264731371:-268435969,4265278863:16,4267471162:16777305,4268815557:-268698497,4269115543:1627717649,4269248724:-268698497,4270055157:-268435969,4270823901:-985146881,4270936094:-268435969,4271368637:150994960,4271500905:-268436225,4271643562:-268435969,4271825210:16777233,4272318696:-269879073,4273979358:1,4275248922:1,4276377486:16777216,4276662938:138493953,4278033018:-268698369,4278343452:228161655,4278864381:1745094656,4279000497:-384038855,4279854126:1103302717,4281940521:-344982017,4282088778:16777361,4282205715:-268436225,4282922633:-285213201,4283066724:1,4283076541:16777232,4285108920:16,4285295077:-381675435,4285378917:16777216,4285767181:16859137,4287310005:1308034545,4287349322:16777216,4288557327:1162117137,4290148010:1802886231,4290307896:-268436225,4290708487:-268435969,4290718429:1730216145,4291089718:10522801,4291552453:-268435969,4292479460:17,4292703405:-268436225,4292979608:-268968449,4294238408:-268435969,4294681065:1095045149,4294710404:-268698499,4294724981:1802886231,4294820758:-285213441},sql:{985371:1,1006937:128,1116438:1859876554,1808171:1859876426,2611547:-808463377,3115252:262145,3168684:1859876554,3425564:1,4576828:-823213373,4589376:16777217,4825036:-285214997,4884076:1859876554,5393397:16777233,5786026:1859876554,6402709:-806979637,6633451:-808463377,6748576:-823134485,6824833:1858761856,7863414:1716256768,8844597:4456705,9061813:1859876554,9625868:4194816,9827011:249255104,10782360:786134600,11170081:536870920,11837851:1075839488,11903134:1859351746,12015904:1860171466,12108448:786134730,12133211:-822085649,12310707:135349385,12354182:-2147483648,13686510:-855706389,14111180:1,14130268:-1610350591,14242808:-2016702259,14286053:1,14362664:1,14673781:-855706397,14737474:131425,14867284:33554496,14870563:1859876554,14894233:-2147483648,14920037:786429448,15161024:1859876554,15169507:1858827970,15174809:1724601992,15360587:1859868298,15900443:204537985,15977618:6324225,16099820:-293603329,16229520:-287312182,16674725:1859876554,16842464:1179689,17185479:1784014539,17421368:-1571880439,18441314:1859876554,18934377:1717239816,19072095:-1487994871,19879978:1859876554,19972560:1859876554,20178193:-285214997,21359587:-285477141,21578679:1859876554,21873846:558694401,22275445:1859876554,22620991:1859876554,22756924:1,23298544:-285214997,24071969:537592328,24940970:-285214997,25519230:-824278367,26252893:1859876554,26621087:-285247773,28047376:262689,28912355:-293603671,28916418:1859876554,29133177:-822085909,29437059:1859876554,29712528:1859876554,29819910:1859876554,30123677:1859876554,30150021:1859876554,30183467:1074135104,30923303:-285214997,31177303:1859876426,31402199:1859876554,31470430:1,31814205:1677721608,32557170:-352323927,32673952:1859876554,32930725:1,33224413:136315649,33857486:512,33950866:-822085909,34571831:-822643233,35160849:1859876554,35296213:16777473,35475280:1859876554,38282698:1859876554,39131800:1074135137,39833930:1859876554,39834264:1107452480,40617520:1859875018,40972241:-287312182,41134322:-855706397,41186962:1078985280,41300032:6291968,41316426:1,41711838:1619001472,43116296:-1608777175,43275344:705757890,43759839:-285214737,45070981:1859876554,45911128:1859876554,46485152:1859876554,46759476:1826256586,47322787:1859876554,47541108:-294128145,47782231:1859876554,47842642:16777745,47845727:-1610219007,48457172:578814088,49167744:1,49988633:64,50889736:1859876554,51339464:2622273,51345958:1859868298,52380203:1859876554,53112232:1859876554,53800054:1,53800088:1,53800636:262145,53800807:65537,54324172:1859876554,55545501:4194304,55663643:-1592851927,56132221:608895496,57946928:1851487880,57987957:1859876554,58621821:4231168,58781070:-1605631703,59024518:1859876554,59304723:1859868298,59328235:1859876554,59373516:1784348680,59550696:-285214997,60823860:146800641,61495289:8929856,61598636:1859876554,62610225:-285214997,62841904:-957586485,64095494:1614836224,65218463:-277351041,69167387:1251698178,70437879:1859876554,71725550:-2147483648,74713228:131584,75065238:1859810506,75307157:131138,75547954:1817797760,75956234:6291969,77305140:1859876554,77860285:447233,77998429:-825231377,81263187:1,83210957:-285214997,83631942:1859876554,84836293:-1593442295,85371434:-285214997,86498701:10657793,88505333:16777217,90085640:-1895827799,90332110:-855706389,90625292:-806628129,90679678:1859745482,93079207:136314881,94543295:1,95803935:1859876554,96348077:4194304,100448043:1859876554,102257049:1851487818,103790634:-285214721,104133712:609944072,105682360:-805406741,106961014:1859876554,107047352:1,109142200:1859876554,110484257:1859876554,111067869:1859876554,112108665:1859876554,114005648:1859876554,116502717:16777216,121477421:136315137,125050571:1851487946,126272535:16777216,126735740:-1910209983,130328627:-1896876309,134013330:33,134247643:1859876554,140364901:1859876554,142362690:1859876554,4156617009:-285214737,4159277386:1754494154,4166211628:1,4172490664:1859876554,4173612988:717357129,4176037183:1859876554,4176306610:1,4179312716:1860171466,4184616345:6291969,4184688954:16777233,4188876606:-285214997,4189951921:249263818,4192447395:16,4192519777:1859876554,4194233513:1073872960,4194852332:4194304,4195253258:1858827978,4195436821:-1003994303,4195521312:1859876554,4195587489:1859909322,4196372388:1858827978,4197060545:64,4197363645:1851458056,4200259565:3276841,4201093440:1140850688,4202894845:-836050205,4203874444:1860171466,4204784352:1858827978,4205278244:1,4206761117:1859876554,4209741679:589832,4211343712:1,4211546653:-1504837591,4211885601:-285477141,4211932263:-2147483648,4212237509:1859876554,4213473442:131584,4214443225:1859876554,4214853554:257,4216554910:1,4217081346:1859876424,4217562407:1859876360,4218130116:-822085909,4219318177:1859876554,4219817078:-285214997,4221352963:1859876554,4222665662:1851487818,4224214524:680616650,4226891274:1859876554,4226895904:134217728,4227819956:608829960,4229141398:1859876554,4229766257:-831601981,4230210081:542769664,4230724015:1859876554,4230991595:537526280,4231408675:-822085941,4232955049:1859876554,4233818699:-285214997,4234360849:-285214997,4235653793:1073873249,4236033259:-293636381,4236101737:-277613217,4236145110:1859876554,4237047891:1,4237197538:1,4237660574:1859876554,4237724396:1859876554,4238151719:180486153,4238223427:1859876554,4238749632:64,4239081782:-822118677,4239575572:4194304,4240143539:-285214997,4242091116:578818754,4242942783:553910561,4243196295:1321957066,4244452210:6554112,4244967883:-1609629175,4245186501:16777216,4246448605:-285214997,4246457082:-822118429,4247079356:541065224,4248029338:1859876554,4248586796:16777233,4248828858:1859876554,4248964732:16777216,4249074316:1276706880,4249076199:-285214997,4249449378:-285214997,4250187926:-823171101,4250685983:1321956552,4251153067:1859876554,4251647817:65537,4252426505:1859876554,4252536354:1083851400,4252666874:136323329,4253541246:1859745482,4253631925:1859876554,4255158771:-822181215,4255308634:1859876554,4256114892:1859876554,4256953055:642318856,4257236084:1859876554,4257260679:1073873536,4257701476:16,4258126402:-293603329,4258649939:1859876554,4258954826:1859876554,4259242565:1859876554,4259361935:576389640,4259790277:1859876554,4260107741:1859876554,4260724339:-285214997,4261839613:1,4262045325:-285214997,4262521208:1859876554,4264066802:-805406737,4264372118:33,4264380355:-293603361,4264633099:1323005642,4265040676:1859876554,4265498955:1859876554,4266697902:-285214997,4268152778:1858753664,4268966679:-1609629439,4269321162:4260352,4269578954:-285214998,4269682412:1859876554,4270202593:1288402562,4270464092:512,4271628185:-1592983263,4271675100:1859876554,4272272623:1859876426,4272444476:1859745482,4272636811:-1604386007,4273025092:1859876554,4273808478:1859876554,4274408220:-1592851959,4275162221:-957848757,4275248922:1,4275480810:1813214920,4276198351:1859876426,4276252598:1859876554,4276374996:1858827978,4276619857:1,4277706515:136315137,4277757482:1859745482,4278067874:-285214997,4278293224:131072,4279087225:1859876554,4281673994:1859876554,4282226933:-1609629439,4283066724:1,4284155661:1859876554,4284171469:1859876554,4284226092:1859876554,4284633314:-2054450995,4284665997:1858827978,4285226078:1859876554,4285378917:16777216,4285444460:-285215029,4285475093:1792767690,4286280498:-285248021,4286515072:1826256586,4286778738:1073741824,4286932483:-285247765,4287242949:3276841,4288794180:1859876554,4288835219:1859876554,4288845963:4461056,4289764804:-823134517,4290347964:1859876554,4291759108:1282958593,4292117046:-285214737,4292473419:1,4292479460:1,4293629514:1859876554,4293929250:1859876554,4294566699:1859876554},swift:{157878:262161,248610:-384038120,286794:1160179699,662990:19269760,692082:-272695297,930576:-272699393,985371:1,1006937:16777857,1180217:-1993360395,1550201:1224999217,1609052:1326706324,1629517:-809500683,1630004:-272695297,1771306:-977421313,2338848:-306205737,2417197:49,2978965:-306299015,3178380:84279553,3682964:1866370692,3843897:-384038359,4144856:252898960,4168709:16777217,4263198:-272633923,4589376:16777217,5393397:16777232,5759016:-273711460,5923409:27537457,6335403:150994945,6970374:1,7161053:150994945,7347374:264192,7382708:-272629761,7492903:-272629761,7584843:212102800,7826548:16777216,7995536:-843169799,8007935:1226868945,8035280:-1456473199,8081866:16777781,8260801:16777233,8561817:-2130706411,8935089:1158678544,9030537:1873021489,9111700:-1047524736,9292788:-986117583,9318819:27315345,9676618:1627717941,10329637:-306298951,10516395:-809504833,10519143:-306204673,11212041:16779776,11837851:1092878864,12127696:-474490183,12293765:-402388992,12336465:-384038343,12704277:-844167209,12767082:-306298951,12912345:-308409576,13186594:16777233,13211372:25169969,13264747:-283374823,13475198:-385610959,13877616:1763049521,13959370:-1355284995,14012459:1091700793,14074032:255157373,14079334:17039377,14106108:-306184193,14111180:16777233,14114361:16777216,14116482:16777216,14166288:-1590859119,14196082:1829767473,14260835:137866229,14275715:1260503253,14286053:1,14290561:-272629761,14308622:1293813776,14510814:16777216,14737474:16908593,14769321:16910449,14778899:-851498053,15612165:-308405955,15767205:16777217,15770386:17041920,16214049:16777233,16652720:-384038343,16786296:-2128344687,17154160:-384038359,17183665:-1883246593,17647841:-306184193,18003220:1090519057,19324984:-809504835,20275682:16777216,20288139:33554449,20848053:1292108593,20908237:-314876481,21190249:1107296273,21428485:-272695297,21599589:-809555013,21638658:1157890321,22053366:16777233,22326632:-1448169515,22408304:25427985,22565396:801091575,22756924:1,22759334:-843120651,23129534:-348657665,23251874:-809538115,23321953:17039665,23633847:-272629761,24140057:-384038855,24368893:17041921,24403397:16777217,25039661:-809500683,25302584:-2147219455,25863018:-809500673,26028857:-273682945,26048674:-819992161,26535154:16908545,26686513:33554448,26705003:-306188289,26879997:-809504835,27132030:16842768,27660182:-1355286531,27980181:-809500937,28047376:17039921,28061236:1,28334400:-272699393,29217755:-308671976,29291735:-274726913,30157835:-384038615,30611288:-272629761,31056216:17039617,31128651:1292765200,31470430:1,31498115:-843169799,31677814:-809505351,32627218:17,32930725:1,33857486:801,33943938:-306254865,34323989:-272629761,34521928:1730602229,34532994:-844167209,35296213:16777473,36544067:-406893569,37130730:1873274321,37202897:-306184257,37788500:-407483393,38411985:-314576897,38427788:-809538115,38601297:-843120651,38985701:-306298951,39052151:1841295359,40289481:-272695297,40788524:-809500673,40962509:-272699393,41316426:1,41530750:16777216,41711838:1635778961,43698772:-1073477343,44651348:16777216,45463086:-306200577,45637566:153485669,47240044:-306298951,47842642:16777745,48295924:1,48491508:-272633921,48645720:1694761233,48819987:161874321,49167744:1,50262134:16777216,50592641:-2128328303,51006984:-306488897,51103948:-306298887,52333823:-442192053,52843528:264219637,53799883:1,53799917:16779265,53800054:16777217,53800088:1,53800157:1,53800225:16777216,53800670:1,53800738:1,53800773:184553473,53802825:264192,53802893:264192,54346941:-272695297,54799990:-2053762787,55226049:-306298951,55240760:-383497319,55852374:-272633923,56500929:-384038595,57344530:-272629761,57512342:1,57587062:-306778625,57740275:8388624,58283539:150995473,58418777:-1045320795,58769064:1293552144,59151406:1,59162956:1260636119,59308438:16777216,60499451:1090521088,60717214:16777493,60787497:-272633921,61801147:-281601027,61873420:-272629761,62298329:1829767473,62543420:-272629761,63205075:16910449,63486092:1328015327,65362088:1627390001,65429313:86172151,65480933:16777253,65678668:-340695589,65744298:1304428345,66229371:1,66253725:-272629761,66659640:-402388992,66879321:-272695297,66959218:-272695297,67646220:-306184193,68895323:554844161,69199538:1304428473,71137415:-272629761,71647532:-809504839,71954494:-809555013,71973889:16777233,72933692:-402388984,73799566:-272629761,75303661:262161,75346723:17039665,75682024:-306298951,75794974:-809505351,76133957:-809500961,77345272:-384562647,77780163:-306188289,78502530:16777345,79172597:-809505351,81793488:1335886229,83350007:16777233,83947431:-306298951,84373268:1236269047,84711301:2048,85226658:564300053,85797653:16910453,86495811:264220661,86531117:1090521089,86752183:118812465,87832e3:-385087171,87875195:17,88505333:16777216,88672254:1627717941,93643633:20,93815735:131073,94133950:-272633857,94543295:16777233,95150528:-272629761,95365496:16777217,95892971:1627389969,96275653:16,96357129:273,96427915:-276385871,96850547:1830029621,103040588:-306233347,107047352:16777217,107287639:134219777,107716402:1337720831,109639184:1292503056,111537333:-308409576,111714555:-1993977859,112514235:-809500673,115626622:153592181,115981963:-844272681,116388487:-317977839,116502717:16777216,117126073:-2052886653,118272910:16777984,119214439:-384038887,119836880:-272629761,121465287:-809505351,123061962:-274726913,123514446:16777521,123639340:1763049777,125550710:-809566219,125727594:-384038343,126272535:16777216,127522327:2048,128446388:-272629761,133937728:17039377,144193683:-809500673,4164042543:-1984955403,4164518049:-306205737,4166211628:1,4166779749:-284218930,4168238156:-272695297,4169553685:-272629761,4173752924:1841278975,4175816040:-272629761,4177331170:-809574409,4178820659:264193,4179745835:-272629761,4180379855:32768,4182017233:-851498053,4182272228:16777489,4183243148:-385087455,4184432574:17039665,4184688954:16777233,4184727394:1763049525,4185898014:-1350107137,4186470689:-306287633,4186615799:26214400,4188419887:-272695297,4188488973:16777233,4188835189:-308671976,4188980561:-1883246603,4189761071:-272629761,4190165397:-402388992,4190247374:-316929255,4190874972:1091700793,4190889267:-384038343,4191363481:-809566209,4192447395:16,4193138622:-843186187,4193862568:-384038343,4193887112:-1985589251,4197051882:-809505383,4197940497:1829767473,4198674102:-306298887,4199611560:-401864439,4200186957:264237045,4201403077:1090781201,4203380996:16777781,4205064510:16777232,4205278244:16777217,4208194860:1739056631,4208902162:-272633921,4209045637:-308540904,4211984648:-272695297,4213313439:-1590826351,4214853554:1,4215384633:16779441,4215542570:-272629825,4216316703:-911739403,4216532351:94646161,4216554910:16777345,4216577521:184553473,4216832962:1795426833,4217878191:1627392273,4218709157:-272633923,4218768764:1840758769,4219121950:1208223744,4220040256:-809505351,4220044044:1336597495,4221520435:-381685891,4222101405:788966673,4222517121:16777216,4222596666:-384038087,4222954269:-843120651,4223224837:-272629761,4223268450:-308671976,4223314660:16,4224826138:-450145873,4225783353:-306544647,4226868875:-309990411,4227384810:1832291217,4228002083:1073741905,4229448967:16777216,4230237470:-272630017,4230326530:-306253841,4230395914:17040181,4230406998:-401864695,4230698770:-273711201,4231232415:-382407239,4231657873:264219637,4231737261:50595857,4232689753:16777216,4233125417:16777728,4233268708:16777216,4233860489:-1916932107,4235289311:17956864,4235653793:1090650481,4236526237:-400815863,4236901207:-819990625,4237047891:16777233,4237197538:16777217,4237378658:69470245,4237630041:1,4237702804:25165952,4237715685:-308671728,4238144722:-373519937,4238451604:1,4238516494:-877574693,4239490850:-1918976383,4239812740:153094145,4241050706:1327883231,4241144047:16777781,4242159741:-385611512,4242538443:-272634371,4242820562:118812465,4243134914:86379377,4243265187:161482833,4243394753:16777216,4243583465:-843251723,4243763698:-308671976,4243792613:-272629761,4243943985:1208224056,4244436542:-272695297,4244791220:-318373071,4245048405:16910449,4245186501:16777216,4246343474:16777729,4246392993:16777216,4246545602:1694499093,4246730129:-384038855,4246966763:-402388992,4247534156:1073741841,4247938344:-1985049611,4247997963:17039377,4248044685:-402388728,4248382200:-272830465,4248586796:16777233,4248964732:16777216,4248976810:590751360,4249629024:553648149,4250439574:1269776629,4251482890:1335919765,4251568087:-316929223,4251639330:-314609985,4251664313:-843137135,4251703040:16777729,4252268981:-385087183,4252396369:-316929767,4252609785:1838313089,4253814871:-316929223,4254502955:277,4255864964:81,4255868585:16777217,4258448820:-274726913,4258736157:-401864695,4258939639:1763049845,4259101035:1831864629,4259143502:-1892326275,4259481041:16910449,4259832212:153354641,4260387966:-306188359,4260679671:16777232,4260896478:-275284065,4261839613:1,4264372118:33,4264447607:16810001,4264669669:16777489,4265278863:16,4265453228:-272629761,4265600307:-400815352,4266246769:-809500961,4266281335:17039921,4266406211:-1457002507,4266931484:25186321,4267465796:-385611751,4269088107:-273160193,4269107183:-828379751,4269115543:1627455505,4269300057:-272629761,4269675349:-400275032,4269989442:-401863928,4270011879:-306184193,4270461468:16777233,4270595276:1090519041,4270749679:-306188359,4270940291:603979800,4271011946:-374358027,4271368637:16777232,4271750250:1,4271825210:16777233,4271970781:-2063169515,4273979358:1,4274081794:1303883425,4274386098:50462721,4274479073:-306282503,4274814844:-273743875,4274897548:1829767473,4274923578:-306569815,4275112174:-921957831,4275168009:1090781457,4275248922:1,4275937836:-272695297,4276175768:-384038136,4276377486:16777216,4276418465:-272695297,4276555370:1335291537,4276619857:1,4276699202:-306184193,4276762133:-2053762787,4276826359:-276385871,4276959084:-306298951,4276967737:-1883246603,4277037515:-384562647,4277683870:-316929767,4278474055:1092887441,4278864381:-402388992,4278876418:-407483393,4279000497:-384038855,4279585106:17041921,4279611155:1627717941,4280309597:-399185476,4280382454:-809500675,4280691767:-809500673,4281291204:1831864629,4281606763:1293993265,4281785052:262165,4282402060:-809500681,4282947907:-400815863,4283058734:1292503057,4283066724:1,4283178859:-272629761,4283294503:-384562647,4283823160:-272695297,4284197340:-310006795,4284476566:146254837,4284806671:-306483201,4285108920:16,4285203847:792720893,4285378917:16777216,4285476536:16910709,4285547299:16779777,4285623962:-845169023,4285695756:-272695297,4285717623:16529,4286093114:16,4286400857:1093434293,4286554985:-272629761,4286778738:1090519060,4286813244:18875137,4286867240:-384038392,4287113433:-306205737,4287597105:1193666527,4288471586:118878005,4288514097:698362561,4288716809:-272629761,4288814860:264219637,4289179655:-373526599,4289304551:-306249735,4290718429:1730216145,4291032685:1161125657,4291089718:10522801,4292061586:1832264055,4292473419:16778001,4292479460:1073872913,4292766078:-809504833,4293451382:1293027328,4294060323:-1456505967,4294158757:-272633923,4294181364:-2135660928,4294763449:-1448170539,4294834112:1840295415},tex:{3163348:1859876554,3410385:1145184960,3416014:-289411093,3891022:1859876554,3899127:1859876554,3930003:-285212693,4533833:1859876554,5361836:1859876042,6461469:1850963658,7315645:1859876554,7347374:264192,8430597:1859876554,8482701:-285212693,8958552:-285212693,9671518:-822083585,9790902:-285212693,11019179:1859876554,11858209:-285212693,12293765:1208223744,12591712:1859876554,13312925:-285212693,13647251:-285212693,14278469:1859876554,14839398:1859876554,16121691:-285215509,16716241:1859876042,16718361:1859876554,16776684:-285212689,16782055:-285212693,16839317:1851422410,16840377:-293603605,16853830:-285212693,16873250:1717072586,17827573:1859876554,18736684:1859876042,21521427:1859876554,22517247:1851487434,23631107:1859876554,23969863:-285212693,24726608:1859876554,26736155:1859876554,27232229:1859876554,27431131:1859876554,28382791:1859876554,28815528:1859876554,29673765:64,30085773:-285212693,30156212:-285212693,30446582:1859876554,31121053:1859876554,34184790:1181818085,36673376:1859876554,36898137:1859876554,37124470:1859876554,39448731:1216487552,39461344:16384,39779857:-285212689,41319079:1859876554,43275344:1794225099,45211459:1859876554,46168406:-285212673,47230171:1859876554,47657290:-285212693,47698784:1859876554,50004176:1859876554,50546568:1859876546,52799431:1859876554,53734112:-965640459,53799883:64,53801765:1148262629,53802825:264192,53802893:2048,55341605:1859876554,56039149:1180415178,56130027:1859876554,57359615:1859876554,60133125:1859876554,61932963:-285212949,62246203:1859876554,63213285:1859876554,63631821:1859876554,64915997:37897408,65254328:2148480,66361414:1859876554,66659640:1208223744,69336245:1859876554,70826585:-293603605,71024169:1859876554,72933692:1745094656,73329662:-285212693,73667772:1859876554,73777841:-822083605,74761289:1859876554,79891301:-285212693,80895600:-285212693,81474977:1859876554,83558080:1859876554,84711301:264193,89663459:1851487946,89834567:1859876554,92054928:-285212673,94114909:1859876554,94762775:-285212693,95214840:-285212693,97059008:536871040,98204092:1859876554,101046420:539290793,103197033:-287312182,103394655:-285212693,105081308:-1503336221,108733556:1859876554,109388622:-285212689,111764843:536870914,113773643:1859876554,127522327:264193,139922161:1859876554,4153394372:-285212693,4156017704:1859876554,4166417725:1859876554,4167349666:616562688,4168560996:1859876554,4171021631:1859876554,4171920674:-319291421,4174973246:1859876042,4178820659:264193,4184118947:-285212693,4184496527:1859876554,4185558741:1859876554,4186302489:1859876554,4189085626:-285212693,4190165397:1208223744,4191291513:1859876554,4192671207:1323005642,4194318495:-287312182,4195389864:1859876554,4196673088:1859876554,4197438262:1859876554,4197645244:1859876554,4200388153:1859876554,4204023055:1859876554,4204472525:-285212693,4205983341:-285212693,4207050486:1859876554,4207450903:1859876554,4207931442:-1505490717,4209490652:-285212693,4210257580:-285212693,4210917183:1859876554,4211343712:257,4211439385:-285212693,4212142053:1854038730,4214237218:1859876554,4215795595:-285212693,4216521003:-285212693,4216943288:-285212693,4217065410:1859876554,4217114963:-285216887,4218655034:1859876554,4219121950:1208223744,4221874091:-285212693,4224562796:-285212693,4225857215:-285212693,4227109774:1859876554,4227927172:1859876554,4233448800:-285212949,4233932511:1859876554,4234299328:1850963658,4237628203:1859876554,4239404441:1759213258,4239514123:1859876554,4242264669:1859876554,4242548920:1859876554,4242818226:-285212693,4243943985:1207959552,4244030503:1859876554,4245444946:1859876554,4247534156:1073741824,4247629937:-285212693,4249103944:1851487946,4249139909:-285212693,4249707193:1859876554,4249721875:1859876554,4250187359:-285212693,4251096602:-285212693,4251172909:-285212693,4251782173:79691776,4254848645:1859876554,4255119235:1859876554,4255864964:64,4256113074:1859876554,4257602690:1859876554,4259465411:-285212693,4259986796:-285212693,4260094314:1859876554,4261773550:1859876554,4261824790:-285212689,4262604673:-822083585,4262867275:-2145063520,4263888072:536871104,4264929059:1322864706,4266884072:1859876554,4267610797:1859876554,4268260689:-285212693,4268416389:-285212689,4268525143:776601802,4269629221:1859876554,4269859388:-285212693,4270894922:-285212725,4272395535:-285212673,4274557298:1791719106,4275248922:1,4275617957:1859876554,4276183890:-285212693,4276662938:16384,4276825844:1859876554,4278527874:-285212693,4278535513:-285212693,4278914373:-285212693,4279382622:1859876554,4279568449:-285212693,4280705677:1859876554,4281914183:1851487946,4282293169:-287312182,4284794244:1859876554,4285071659:1859876554,4286185877:1851487946,4286826687:1859876554,4290245093:1859876554,4290386771:-285214997,4290430020:-285212693,4290834711:-822083585,4291770455:-285212949,4291820327:1181875453,4293274268:1859876546,4294193064:1859876554},ts:{1006937:16777345,2273236:1875787679,3115252:1,3178380:84148481,3270687:20971537,3285886:-268435681,3327705:1073741824,3843897:-384038359,4589376:16777217,4818620:-805306472,5196787:-274281832,5418524:-268435521,5477162:-268484673,5802833:-268436323,6515669:1843904177,7347374:264192,7584843:212092560,7601193:-1423013352,7863414:-412352511,8118418:-403835343,8260801:16777233,8561223:553912849,8844597:256,8938196:1090859781,9111700:-1047524736,9292788:-2059859407,9566780:-268436323,10195174:-1342210401,11112362:-306188655,11259315:16777216,11837851:1092878864,11839626:-302026855,12133587:556241457,12293765:1745094656,12722934:-1342177345,12912345:-308409576,14079334:16777233,14116482:16777216,14128979:1878998975,14129207:-1046082812,14130268:-1610350591,14149389:764281640,14166288:-1590859119,14286053:1,14308622:1293814544,14362664:16777217,14510814:16777216,14770381:221604881,14829833:-270532833,15159754:16777216,15291533:1293814064,15758653:50596656,15786292:50724913,15973062:16777232,15977618:23101457,16214049:16777233,16786296:-2128344815,16789478:-1591474160,16805384:-1592981223,17154160:-384038359,18003220:16777232,18855562:-268435681,18934377:-411107319,19072095:625934345,19170785:588186137,19326669:-1352398312,20275682:16777216,20848053:1292107793,21638658:1090781201,21873846:21299201,22053366:16777233,22077221:-268435559,22133322:-402680897,22364706:-268484673,22588531:-382865775,22756924:1,24140057:-384038855,24403397:16777217,24869516:-268435556,25302584:2049,26535154:16908545,27961962:16777216,28607133:-383907319,29217755:-308409832,29979496:-270599655,30352604:17109761,31076972:-276824167,31128651:1293814032,31677814:-809538151,31814205:-452722663,32248983:-268435911,33224413:153092881,33522150:1694501649,33955704:-1342178148,34189313:588186137,34758951:-382865767,35990494:-279033319,36083362:-268435523,36417520:-268435523,37408233:17041937,37611221:-1342177633,40074882:-481277171,40255970:-270578755,40433881:-1555234803,41300032:23069184,41378701:-2130050779,41530750:16777216,41711838:1635778961,42608212:-310486528,43698772:1074006049,44653584:-308409832,45492310:1879047865,46068699:-1423013352,46384264:-2096100451,47023668:-402680897,47842642:16777233,47845727:-1593441775,50262134:16777216,50357567:-383842263,51084099:-807969859,52287974:1868300191,53523042:554566169,53800054:16777217,53800225:16777216,53800636:262145,53800670:1,53800738:1,53800773:184553473,53800807:16842753,53802825:264192,53802859:16777217,53802893:2048,54157158:-309722584,55240760:-920384615,55663643:-1593179647,57512342:1,57740275:8388624,58418777:-1045328987,58621821:23105553,58769064:1830685200,59308438:16777216,60499451:1090521088,61956035:1845477181,64163402:-805306468,65254328:2099328,66659640:-939259904,67084953:1879047865,68895323:17956865,71647532:-809505351,72397707:1843904177,72933692:-402388984,73358322:-268435527,75303661:17,75623547:-347141351,75794974:-809538119,75956234:23069185,77112939:1174053529,77345272:-384562647,78604712:1,79172597:-809538119,81184727:-308409576,82391531:-420891121,82625783:-268436324,82925504:737013305,83350007:16777233,83933330:21495825,84456709:-1045439740,84711301:264192,84836293:-1593442303,85151612:-268436323,85453899:-268435523,85835074:16777216,85906489:16777216,90966281:-412106487,93815735:131073,96275653:16,98210206:1308585625,99171232:-274916451,99459113:1843904177,99709525:90214453,100815327:1879047865,101046420:539028629,102148947:-872874343,107047352:16777217,107287639:134481921,108380558:-1591473663,109419007:-308409832,109639184:1293814032,110412696:-403835847,111537333:-308409576,113732009:-403834823,116388487:-385610991,116502717:16777216,117126073:-2052886911,117404983:17827841,119214439:-384038887,121465287:-809538119,121477421:153092369,122656166:16777217,125965785:-268435559,126272535:16777216,127522327:2049,137928656:1879015097,4151168666:-268435559,4166211628:1,4174884581:-838930497,4176903623:1262283792,4177128734:-1419376104,4178820659:264193,4180244760:-413185227,4181144136:-470944743,4182310634:16777233,4183471620:-843071595,4183602898:-838860897,4184616345:23069185,4184688954:16777233,4186615799:26214400,4188835189:-308409832,4188981984:5,4190165397:-939259904,4190734356:1845477181,4192447395:16,4193464810:17301520,4194852332:20971521,4196584775:-308409576,4197051882:1327459737,4199611560:-401864439,4199688799:184811529,4200490488:1845477181,4201476126:-839194689,4202663695:-268435779,4203017133:1157892624,4203921636:-347141351,4204886506:-347141351,4205064510:16777232,4205096306:1878998975,4205214670:69206033,4205278244:16777217,4205932925:-2130444288,4209045637:-308409576,4210917794:554566169,4213313439:-1590826351,4216554910:16777345,4218352214:-843137135,4219121950:1208223744,4221438686:-872874343,4222596666:-384038631,4223128719:-268435559,4223268450:-308409832,4223586635:-1555101415,4223727956:670526464,4224019817:138529153,4226525054:-279033319,4226928135:-807515623,4227615382:-1921553391,4227798047:152045569,4230045016:1876836255,4230406998:-401864695,4231724254:125241344,4232689753:16777216,4233268708:16777216,4233930377:-1046066428,4234264718:-1342177345,4235289311:16777216,4236526237:-400816119,4237197538:16777217,4237378658:69470245,4237702804:25165824,4237715685:-308409576,4237722057:33556497,4237729630:-279033319,4237816332:-838898151,4238451604:1,4238464924:-805306435,4239490850:-1918976384,4240198957:-843137135,4240416035:16777233,4242942783:17039617,4242987764:-989331436,4243394753:16777216,4243763698:-308409832,4243872492:621087665,4243876969:621087665,4243943985:1208223760,4244967883:-1609956863,4245762616:-308411640,4246016320:17301505,4246144569:-474689739,4246343474:16777729,4246730129:-384038855,4246966763:-402388992,4247454415:-272629825,4247997963:16777233,4248044685:1745094920,4248374383:137421840,4248964732:16777216,4250306369:1845477181,4251430580:1308585625,4251664313:-843137135,4251703040:16777729,4253214245:-268435681,4254091340:1879047865,4255526190:16777232,4255884718:-404787265,4256378521:16777232,4257701476:16,4257876897:1831144369,4258736157:-401864695,4259495676:-268439617,4261500156:16,4261805401:728065553,4262479349:-470945735,4264070883:-302027111,4264319580:-308411608,4265278863:16,4265600307:-400815864,4265840636:-402684993,4266281335:17039889,4266695968:-1996488704,4266868554:-815904231,4268059602:-277918947,4268966679:-1609760511,4269107183:1310682265,4269596309:-272629825,4269742265:-268547431,4269989442:-402388728,4270464489:-301990343,4270782911:-268435559,4270940291:603979800,4271628185:-1592983263,4272296808:-310940007,4273979358:1,4274408220:-1592917495,4275112174:-921957831,4275168009:1090781201,4275248922:1,4276157626:-839212129,4277683870:-384038887,4278552289:16941585,4278864381:-402388992,4278901317:553714177,4279000497:-384038855,4280247692:-308673752,4280259755:-270644711,4280286820:67108865,4280521571:-270644711,4281055133:-268435559,4282226933:537853953,4282825832:-347141351,4282882433:16777232,4282947907:-401864439,4283058734:1830684689,4283294503:-384562647,4285378917:16777216,4285623962:-845169024,4286257689:-519831279,4286494909:16777232,4286515768:1097110545,4286596489:753200161,4286815179:-1348023655,4286867240:-385086968,4287219214:-268435559,4288390300:16,4288837231:-308409576,4291338243:1778015929,4292479460:17,4292944579:17301520,4293554978:17041937,4294181364:-2137782656,4294362452:-411107319,4294372793:-1045439740},yml:{516039:739620481,651552:1859876554,695415:1859876554,846123:-1359262584,985371:1,1015519:1859872458,1468435:201326720,1469459:1692009098,1609052:1309927040,2045464:709967938,2065246:1859872458,2203797:1859876554,2435530:1859876554,3025513:1792566920,3101642:1859909322,3121097:-268469112,3201421:1858762434,3270687:4194304,3293120:1859876490,3332139:-287310133,3813321:1859876554,4144856:1310191232,4554684:-1359278968,4576301:1858827978,4589376:16777217,4839984:1859876554,5229660:-285212949,5230100:-285212949,5621406:-2111700992,5740315:1859876554,6046128:1859876554,6133090:-285212949,6145100:4194304,6203064:1859876554,6633582:-285248376,6933445:1859876554,7244044:1073741824,7272195:1859876488,7826548:16777216,8063914:1073872896,8143955:-285212949,8294425:1859876554,8515774:1859876554,9111700:1083179648,9953973:1855678088,10009681:1859811018,10127682:-285246328,10287955:33554432,10767856:-285212949,10912019:1859876554,11112362:-306188647,11200716:-285213045,11422233:674317961,12128220:-830612277,12310707:206652553,12517469:-822151485,14195660:1859876554,14242808:-2080173944,14722034:1859876554,15081566:1859876552,15194957:1073741824,15454279:1859876554,15657352:1859876554,15977618:6590481,15981506:1658418304,16214049:1,16259681:1861809288,16473688:-1359262584,16572914:1283597954,16609994:1255281224,16809557:-1494344981,16818299:1859876554,16875371:-1608189240,16930719:1859876554,16990428:16777216,17302812:1859876554,17507131:-2111700992,17809332:1859876554,18156146:1859876554,18644434:33554432,18793362:1859876554,18843065:-1360068885,19094259:-2095052800,19169077:612500616,19450054:1859876480,20114253:1859876554,20530013:1855682184,20574690:1859876554,21755141:1859901130,22791867:4194304,23308641:1859872458,23594251:1073741824,23596078:1859876554,23824944:1859876554,23955969:-285215029,24074235:1859876554,25203137:1859876490,25375069:1859876490,25443328:-285212949,26775336:67108864,26896232:-1440418070,26926110:1859876554,27132030:1133733008,27425621:1859876552,27478574:-285212981,27961962:-1996488703,28061236:1,28218439:1859876554,28256678:-285215029,28302640:1859876554,28545528:1859876554,28588187:1859876554,28710765:-1405091775,28751816:1859876554,28944403:1859876554,29016851:1859876554,29172980:-285212981,29336471:33554432,29483291:1859876554,29648039:-287342901,30067705:1859876554,30276035:1859875978,30506032:1859876554,30812639:1859876554,30881783:1859876546,31134077:-285475605,32040808:-2111700992,32187106:1859876554,32279699:-270532897,32768408:1859876554,32799730:-1906293687,32934710:-285212945,32978734:1859777672,33124851:147456,33262913:1859876554,33356475:1859876488,33631865:-1566117141,34276736:1758996104,35736426:1859876490,36057814:1795161285,36112850:131072,36297880:1187763850,36298408:1859876554,36325397:134217728,36477952:-289419768,36983941:1859876554,38116715:4194304,38278343:-285212949,39461344:134299649,40792981:1859876554,41619957:1859872458,42962509:-285248376,43063240:1859876426,43081229:780826176,43196777:1859876554,43982653:-2075930488,44449395:-285212949,44545176:1859876554,44667710:1859876554,45022112:1859876554,45479568:1073741824,45988141:4194304,46585470:1859876426,47429345:1859876554,48311075:1859876488,48945177:1859876554,50338611:1792689856,51079769:1711280640,51244294:18876432,51920181:612559880,51940345:1254848128,53668417:33554432,53800157:1,53800225:16777216,53800773:167776256,53800807:201392129,53802859:1,54250696:-270532917,54422303:-822747957,54656274:1309148288,54848816:1859872458,54875784:704989249,55727776:-285212945,55768327:-1367849911,56558675:-270532897,58621821:6328321,58872013:1859876554,59341246:1859876554,59714035:1859876554,61449953:-268435745,63250472:-2075930488,63460980:-285737336,64384784:1859876554,64599056:1859876480,65179719:1859876490,65874563:-287574392,66229371:1,66260691:1859876490,66428775:-285215029,67053628:1859876554,68338029:1792566920,68895323:1179649,69128178:1859876490,69428659:1859876490,69513481:1859876554,69673389:-831152949,69700010:4194304,71201111:1859909322,71504034:-1358990200,71705664:1859876554,72016763:1859876554,73398361:-285214997,74174859:-285212949,74211914:-287310133,74244542:243925504,74395840:1859806336,74439841:-285212945,74610078:604417032,75915326:-287312182,77683272:16777217,77698814:-285214997,78502530:128,79179070:-287574392,80042119:1859876554,80556069:1859876032,80775686:1859876554,80965422:-354716672,81090271:1859909322,83208605:1,85687062:1073741824,86154653:1859876554,86362455:-390139191,86416095:1859876552,87390783:1859876554,87535350:1859876554,87678117:1824596104,88111677:-1363413303,89690389:1859876554,89871714:612520968,90089270:-268439911,90588294:1859876554,90625292:1178816712,91128715:1859876554,91363032:-285212981,91493067:1859876554,91633097:1859876554,92459394:1859876554,92667671:-285215029,93204947:1209558144,93484395:1859876554,93839317:1779515458,94003993:-285212945,96439957:1859876490,100347902:1610612736,100674664:1859872458,100782573:1859876554,101199338:1859876554,103989800:-285212949,104751993:742916096,104753207:1727528577,106518078:1859876554,106991869:1859876554,107114981:603979776,109483731:1207978049,109771723:-285212981,109984242:1859876554,110636567:1859876554,111663967:1859876554,113298813:-285212949,116016731:-2111700992,116144070:671088640,116474072:-1359254392,116667726:1859876554,117152780:-285212945,118093329:-352332093,118414711:-352321815,120076131:1859876490,120446665:1859876554,123453002:1859876490,123803139:704989249,124589467:1859876552,124936281:1859876554,125418047:138626048,128335288:786134730,128681330:1859876554,128744031:-1371848576,130629062:-285212949,132778285:1859876554,139227628:-287312182,4152785797:1859876554,4156535015:1859876554,4159844703:1859876554,4160738769:-1440418102,4162798541:1859876546,4164541994:1859876426,4165519148:1859876554,4166211628:1,4172122687:-1941929919,4173250830:1859876554,4174950007:1859876554,4176115140:1212704264,4176903623:1243112448,4177319433:1859876554,4180985134:1792562688,4181620737:786134730,4181650766:-285215029,4184311126:1859876554,4184539808:1859876554,4184858637:1859876554,4186128645:1859876554,4186402023:-287312182,4186615799:9568256,4186814617:1859876554,4187083262:1859876554,4188783759:-289997688,4190598260:-1495271733,4190631962:-285212949,4190730105:-287312182,4190897882:1859876554,4191992986:-1359020309,4192043882:1859875976,4192360650:1289381e3,4192841603:-285213495,4195921281:-285212949,4197093837:606530568,4197287534:1859876554,4197746090:1859876554,4197858541:150994961,4198410825:-285214997,4199801480:-285280533,4199911468:-1350697269,4202433013:-270532897,4204128622:1859872458,4204923857:-289997687,4205902268:1859876554,4206120927:1783723074,4209226814:1859876554,4210516538:1859876554,4210666109:1859876554,4211935423:172049536,4212316633:1859876552,4212605361:-285214997,4213161475:1859876554,4213443794:33554432,4213565455:-285214997,4213804954:1859876554,4215384633:19617,4215703390:1859876488,4216522041:1859876554,4216577521:33558528,4217712835:-285212949,4218349579:1859876554,4218542309:1850430664,4219137631:1859851778,4219376193:4194304,4220658152:-1440417080,4221378653:1782661186,4222094858:-285215029,4222517121:16777216,4223074655:1321957e3,4223109845:604171784,4223727956:654306817,4223892637:-1371848576,4224153640:1859876552,4224487183:4194304,4224859136:1854014024,4224920417:1859876554,4225251772:1859876554,4225277519:1178816648,4225355914:-287312182,4225667766:1859871872,4225854829:-1371848576,4226128031:1859876552,4226266116:-285212949,4226540036:1859876554,4227075147:1859876554,4227228989:8388608,4228169038:8,4228239704:1859876554,4229220152:1859876490,4229520983:1107296256,4229890303:33554432,4229903644:1859876554,4230218458:-287312182,4230480278:-285212949,4231724254:108464641,4231815168:4194304,4232250702:-285212981,4232478601:1859876554,4233300009:1859876554,4234018417:1859876554,4234161621:1859876554,4235289311:1048576,4235340641:1073741824,4236234301:785008136,4236234797:1859876554,4237006633:1859876490,4237047891:1,4237722057:33554432,4238053047:-287310113,4238863293:1276667008,4239376953:1149371520,4239467340:-285212981,4239790558:1859876554,4239871847:1826305672,4240615939:-858389366,4240966680:-290457909,4241307167:1859876554,4243844588:1859875976,4243988970:1859876554,4244648492:1073741824,4245257550:1859876554,4245971935:1859876554,4246392993:16777216,4246796360:-285213013,4247405316:-289411447,4247605848:1859876554,4247846645:1859876554,4247991407:786134730,4248263790:1859876554,4248301589:-285346069,4248374383:137413632,4248729955:1859876554,4249322369:1859876554,4250193802:-287574392,4250226364:1254752328,4250337633:1859876554,4250584180:1859876554,4251090524:1,4251304522:-285213045,4252112068:-1359262584,4252609785:1821535873,4253004723:-285215029,4253086471:-285212949,4254088278:1859876554,4254096593:-285212949,4254252801:1859876554,4255326577:-287312182,4255521880:-285212945,4255847295:-285214997,4256116514:1318717056,4256236131:-285212949,4256743105:-1487044917,4256803032:1859872384,4256905278:1859352266,4258228082:-285212981,4258752505:1859876554,4258789049:-285248376,4258990803:1859876554,4259155275:1209558144,4259482373:1859876554,4259950785:138493953,4260736492:-285213457,4260905934:1288181248,4261087938:1859876554,4261363759:-285212949,4261610089:-285212949,4261839613:1,4262054846:1610678274,4262082263:1859876554,4263305324:1859876554,4263371542:-1344274721,4263457511:1859876490,4264447607:32769,4265420334:1792799746,4265644810:-1360069909,4265762626:-285215029,4265854978:1322263681,4266477610:1222252032,4266601187:1251627648,4266735040:1859876554,4267464299:134217728,4267621468:-285215029,4267654051:-1359262584,4268132007:1276863616,4268432619:1859876554,4269056414:150994945,4269225827:1108501632,4269334636:114324032,4270615136:-285213013,4270668893:1859876554,4270940291:603979784,4271750250:1,4272008383:134348800,4272351945:-285212949,4272883306:1859876554,4272970859:1859872458,4272973891:-285215029,4273620973:1859876554,4273701260:1859876554,4274013197:1859876546,4274279473:-285212949,4274439219:1851422344,4274442298:1859872458,4274838482:-285248376,4275248922:1,4275349682:1859909322,4275439911:4194304,4275769172:-287310113,4276023161:-285212949,4276137043:-285212949,4276178797:1822123648,4276367255:675374152,4276555370:1855450753,4276662938:134299649,4277083550:604176512,4277090258:1859876554,4277116481:1275068418,4277459379:1859876488,4277549311:-285212949,4278017965:1859876554,4278803682:1615986818,4278818596:-2111700992,4278901317:671154689,4279014061:1859876554,4279062517:1859876554,4280286820:67141761,4281111341:1857283200,4281280401:-285215029,4281294756:-287312182,4281745129:1321956554,4281804367:1859876554,4281834622:1859876554,4282097317:524288,4282311319:1859876552,4283587234:777745610,4284077674:1855682184,4284580836:-285213048,4284633314:-2080173944,4285108920:16,4285295077:671088640,4285665537:1859872458,4285702503:-289692032,4285717623:16513,4285767181:81920,4285805171:-306188641,4285988425:1859876554,4286447887:1859901130,4286515768:1086354560,4287307138:1859876554,4287341302:1859876552,4287759040:1859876554,4288508608:1859876554,4288616509:1255281224,4289072445:248664768,4289291891:-285212945,4289445312:1255806536,4289469589:1255806536,4289772185:1859872458,4289981802:1859777672,4290089015:-285212981,4290148010:1783714882,4290193436:1792566920,4290352190:1859876488,4290608470:-287312182,4291650959:1859872458,4291698302:-285246328,4291874698:1859876554,4292477880:1792566920,4292889445:1859876554,4292977588:-287312182,4293188354:-270532897,4293272097:1859876426,4293451382:1276250112,4293515123:1849821889,4293801441:1859876554,4294000437:1859876554,4294153370:-287312182,4294181364:1536,4294724981:1786109015}}}}},n={};function t(o){var r=n[o];if(void 0!==r)return r.exports;var s=n[o]={exports:{}};return e[o](s,s.exports,t),s.exports}var o={};return(()=>{var e=o;Object.defineProperty(e,"__esModule",{value:!0}),e.detect=void 0;const n=t(275),r=t(770),s=t(898),i={};for(const[e,n]of Object.entries(s.modelLangToVSCodeLang))n&&(i[n]=e);e.detect=(e,t,o=[])=>{const a=o.map((e=>i[e])).filter((e=>e)),c={};for(const[e,n]of Object.entries(t??{})){const t=i[e];t&&(c[t]=n)}const l=(0,n.ReLangEx)(r.mainTokenizer,c,a)(e)[0];if(l)return s.modelLangToVSCodeLang[l.languageId]}})(),o})()}));module.exports = require('./build/Release/vsda');{ "name": "vsda", "description": "VS Code debug handshake module", "version": "1.4.1", "author": { "name": "Microsoft" }, "dependencies": {}, "devDependencies": { "mocha": "^6.1.4" }, "homepage": "https://github.com/Microsoft/vscode", "main": "index.js", "types": "index.d.ts", "os": [ "win32", "linux", "darwin" ], "scripts": { "build": "node-gyp build", "configure": "node-gyp configure", "install": "node-gyp rebuild", "test": "mocha test.js" } } 'use strict'; const assert = require('assert'); const vsda = require('./index'); describe('vsda module', () => { it('has signer interface', () => { assert.strictEqual(typeof vsda.signer, 'function'); assert.strictEqual(typeof Object.getOwnPropertyDescriptor( vsda.signer.prototype, 'sign').value, 'function'); }); it('has validator interface', () => { assert.strictEqual(typeof vsda.validator, 'function'); assert.strictEqual(typeof Object.getOwnPropertyDescriptor( vsda.validator.prototype, 'createNewMessage').value, 'function'); assert.strictEqual(typeof Object.getOwnPropertyDescriptor( vsda.validator.prototype, 'validate').value, 'function'); }); it('can sign with a valid string input', () => { const signer = new vsda.signer(); const validator = new vsda.validator(); const message = validator.createNewMessage("test"); const signed_message = signer.sign(message); assert.strictEqual(validator.validate(signed_message), "ok"); }) it('throws for invalid input', () => { const signer = new vsda.signer(); const validator = new vsda.validator(); assert.throws(() => { validator.createNewMessage() }, "/^Error: Wrong number of arguments$/"); assert.throws(() => { validator.createNewMessage(1) }, "/^Error: Wrong type of argment. Expects a string.$/"); assert.throws(() => { validator.validate(1, 2) }, "/^Error: Wrong number of arguments$/"); assert.throws(() => { validator.validate(1) }, "/^Error: Wrong type of argment. Expects a string.$/"); assert.throws(() => { signer.sign("test1", "test2") }, "/^Error: Wrong number of arguments$/"); assert.throws(() => { signer.sign(undefined) }, "/^Error: Wrong type of argment. Expects a string.$/"); }) });var fs = require("fs"); var Transform = require("stream").Transform; var PassThrough = require("stream").PassThrough; var zlib = require("zlib"); var util = require("util"); var EventEmitter = require("events").EventEmitter; var crc32 = require("buffer-crc32"); exports.ZipFile = ZipFile; exports.dateToDosDateTime = dateToDosDateTime; util.inherits(ZipFile, EventEmitter); function ZipFile() { this.outputStream = new PassThrough(); this.entries = []; this.outputStreamCursor = 0; this.ended = false; // .end() sets this this.allDone = false; // set when we've written the last bytes this.forceZip64Eocd = false; // configurable in .end() } ZipFile.prototype.addFile = function(realPath, metadataPath, options) { var self = this; metadataPath = validateMetadataPath(metadataPath, false); if (options == null) options = {}; var entry = new Entry(metadataPath, false, options); self.entries.push(entry); fs.stat(realPath, function(err, stats) { if (err) return self.emit("error", err); if (!stats.isFile()) return self.emit("error", new Error("not a file: " + realPath)); entry.uncompressedSize = stats.size; if (options.mtime == null) entry.setLastModDate(stats.mtime); if (options.mode == null) entry.setFileAttributesMode(stats.mode); entry.setFileDataPumpFunction(function() { var readStream = fs.createReadStream(realPath); entry.state = Entry.FILE_DATA_IN_PROGRESS; readStream.on("error", function(err) { self.emit("error", err); }); pumpFileDataReadStream(self, entry, readStream); }); pumpEntries(self); }); }; ZipFile.prototype.addReadStream = function(readStream, metadataPath, options) { var self = this; metadataPath = validateMetadataPath(metadataPath, false); if (options == null) options = {}; var entry = new Entry(metadataPath, false, options); self.entries.push(entry); entry.setFileDataPumpFunction(function() { entry.state = Entry.FILE_DATA_IN_PROGRESS; pumpFileDataReadStream(self, entry, readStream); }); pumpEntries(self); }; ZipFile.prototype.addBuffer = function(buffer, metadataPath, options) { var self = this; metadataPath = validateMetadataPath(metadataPath, false); if (buffer.length > 0x3fffffff) throw new Error("buffer too large: " + buffer.length + " > " + 0x3fffffff); if (options == null) options = {}; if (options.size != null) throw new Error("options.size not allowed"); var entry = new Entry(metadataPath, false, options); entry.uncompressedSize = buffer.length; entry.crc32 = crc32.unsigned(buffer); entry.crcAndFileSizeKnown = true; self.entries.push(entry); if (!entry.compress) { setCompressedBuffer(buffer); } else { zlib.deflateRaw(buffer, function(err, compressedBuffer) { setCompressedBuffer(compressedBuffer); }); } function setCompressedBuffer(compressedBuffer) { entry.compressedSize = compressedBuffer.length; entry.setFileDataPumpFunction(function() { writeToOutputStream(self, compressedBuffer); writeToOutputStream(self, entry.getDataDescriptor()); entry.state = Entry.FILE_DATA_DONE; // don't call pumpEntries() recursively. // (also, don't call process.nextTick recursively.) setImmediate(function() { pumpEntries(self); }); }); pumpEntries(self); } }; ZipFile.prototype.addEmptyDirectory = function(metadataPath, options) { var self = this; metadataPath = validateMetadataPath(metadataPath, true); if (options == null) options = {}; if (options.size != null) throw new Error("options.size not allowed"); if (options.compress != null) throw new Error("options.compress not allowed"); var entry = new Entry(metadataPath, true, options); self.entries.push(entry); entry.setFileDataPumpFunction(function() { writeToOutputStream(self, entry.getDataDescriptor()); entry.state = Entry.FILE_DATA_DONE; pumpEntries(self); }); pumpEntries(self); }; ZipFile.prototype.end = function(options, finalSizeCallback) { if (typeof options === "function") { finalSizeCallback = options; options = null; } if (options == null) options = {}; if (this.ended) return; this.ended = true; this.finalSizeCallback = finalSizeCallback; this.forceZip64Eocd = !!options.forceZip64Format; pumpEntries(this); }; function writeToOutputStream(self, buffer) { self.outputStream.write(buffer); self.outputStreamCursor += buffer.length; } function pumpFileDataReadStream(self, entry, readStream) { var crc32Watcher = new Crc32Watcher(); var uncompressedSizeCounter = new ByteCounter(); var compressor = entry.compress ? new zlib.DeflateRaw() : new PassThrough(); var compressedSizeCounter = new ByteCounter(); readStream.pipe(crc32Watcher) .pipe(uncompressedSizeCounter) .pipe(compressor) .pipe(compressedSizeCounter) .pipe(self.outputStream, {end: false}); compressedSizeCounter.on("end", function() { entry.crc32 = crc32Watcher.crc32; if (entry.uncompressedSize == null) { entry.uncompressedSize = uncompressedSizeCounter.byteCount; } else { if (entry.uncompressedSize !== uncompressedSizeCounter.byteCount) return self.emit("error", new Error("file data stream has unexpected number of bytes")); } entry.compressedSize = compressedSizeCounter.byteCount; self.outputStreamCursor += entry.compressedSize; writeToOutputStream(self, entry.getDataDescriptor()); entry.state = Entry.FILE_DATA_DONE; pumpEntries(self); }); } function pumpEntries(self) { if (self.allDone) return; // first check if finalSize is finally known if (self.ended && self.finalSizeCallback != null) { var finalSize = calculateFinalSize(self); if (finalSize != null) { // we have an answer self.finalSizeCallback(finalSize); self.finalSizeCallback = null; } } // pump entries var entry = getFirstNotDoneEntry(); function getFirstNotDoneEntry() { for (var i = 0; i < self.entries.length; i++) { var entry = self.entries[i]; if (entry.state < Entry.FILE_DATA_DONE) return entry; } return null; } if (entry != null) { // this entry is not done yet if (entry.state < Entry.READY_TO_PUMP_FILE_DATA) return; // input file not open yet if (entry.state === Entry.FILE_DATA_IN_PROGRESS) return; // we'll get there // start with local file header entry.relativeOffsetOfLocalHeader = self.outputStreamCursor; var localFileHeader = entry.getLocalFileHeader(); writeToOutputStream(self, localFileHeader); entry.doFileDataPump(); } else { // all cought up on writing entries if (self.ended) { // head for the exit self.offsetOfStartOfCentralDirectory = self.outputStreamCursor; self.entries.forEach(function(entry) { var centralDirectoryRecord = entry.getCentralDirectoryRecord(); writeToOutputStream(self, centralDirectoryRecord); }); writeToOutputStream(self, getEndOfCentralDirectoryRecord(self)); self.outputStream.end(); self.allDone = true; } } } function calculateFinalSize(self) { var pretendOutputCursor = 0; var centralDirectorySize = 0; for (var i = 0; i < self.entries.length; i++) { var entry = self.entries[i]; // compression is too hard to predict if (entry.compress) return -1; if (entry.state >= Entry.READY_TO_PUMP_FILE_DATA) { // if addReadStream was called without providing the size, we can't predict the final size if (entry.uncompressedSize == null) return -1; } else { // if we're still waiting for fs.stat, we might learn the size someday if (entry.uncompressedSize == null) return null; } // we know this for sure, and this is important to know if we need ZIP64 format. entry.relativeOffsetOfLocalHeader = pretendOutputCursor; var useZip64Format = entry.useZip64Format(); pretendOutputCursor += LOCAL_FILE_HEADER_FIXED_SIZE + entry.utf8FileName.length; pretendOutputCursor += entry.uncompressedSize; if (!entry.crcAndFileSizeKnown) { // use a data descriptor if (useZip64Format) { pretendOutputCursor += ZIP64_DATA_DESCRIPTOR_SIZE; } else { pretendOutputCursor += DATA_DESCRIPTOR_SIZE; } } centralDirectorySize += CENTRAL_DIRECTORY_RECORD_FIXED_SIZE + entry.utf8FileName.length; if (useZip64Format) { centralDirectorySize += ZIP64_EXTENDED_INFORMATION_EXTRA_FIELD_SIZE; } } var endOfCentralDirectorySize = 0; if (self.forceZip64Eocd || self.entries.length >= 0xffff || centralDirectorySize >= 0xffff || pretendOutputCursor >= 0xffffffff) { // use zip64 end of central directory stuff endOfCentralDirectorySize += ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIZE + ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIZE; } endOfCentralDirectorySize += END_OF_CENTRAL_DIRECTORY_RECORD_SIZE; return pretendOutputCursor + centralDirectorySize + endOfCentralDirectorySize; } var ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIZE = 56; var ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIZE = 20; var END_OF_CENTRAL_DIRECTORY_RECORD_SIZE = 22; function getEndOfCentralDirectoryRecord(self, actuallyJustTellMeHowLongItWouldBe) { var needZip64Format = false; var normalEntriesLength = self.entries.length; if (self.forceZip64Eocd || self.entries.length >= 0xffff) { normalEntriesLength = 0xffff; needZip64Format = true; } var sizeOfCentralDirectory = self.outputStreamCursor - self.offsetOfStartOfCentralDirectory; var normalSizeOfCentralDirectory = sizeOfCentralDirectory; if (self.forceZip64Eocd || sizeOfCentralDirectory >= 0xffffffff) { normalSizeOfCentralDirectory = 0xffffffff; needZip64Format = true; } var normalOffsetOfStartOfCentralDirectory = self.offsetOfStartOfCentralDirectory; if (self.forceZip64Eocd || self.offsetOfStartOfCentralDirectory >= 0xffffffff) { normalOffsetOfStartOfCentralDirectory = 0xffffffff; needZip64Format = true; } if (actuallyJustTellMeHowLongItWouldBe) { if (needZip64Format) { return ( ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIZE + ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIZE + END_OF_CENTRAL_DIRECTORY_RECORD_SIZE ); } else { return END_OF_CENTRAL_DIRECTORY_RECORD_SIZE; } } var eocdrBuffer = new Buffer(END_OF_CENTRAL_DIRECTORY_RECORD_SIZE); // end of central dir signature 4 bytes (0x06054b50) eocdrBuffer.writeUInt32LE(0x06054b50, 0); // number of this disk 2 bytes eocdrBuffer.writeUInt16LE(0, 4); // number of the disk with the start of the central directory 2 bytes eocdrBuffer.writeUInt16LE(0, 6); // total number of entries in the central directory on this disk 2 bytes eocdrBuffer.writeUInt16LE(normalEntriesLength, 8); // total number of entries in the central directory 2 bytes eocdrBuffer.writeUInt16LE(normalEntriesLength, 10); // size of the central directory 4 bytes eocdrBuffer.writeUInt32LE(normalSizeOfCentralDirectory, 12); // offset of start of central directory with respect to the starting disk number 4 bytes eocdrBuffer.writeUInt32LE(normalOffsetOfStartOfCentralDirectory, 16); // .ZIP file comment length 2 bytes eocdrBuffer.writeUInt16LE(0, 20); // .ZIP file comment (variable size) // no comment if (!needZip64Format) return eocdrBuffer; // ZIP64 format // ZIP64 End of Central Directory Record var zip64EocdrBuffer = new Buffer(ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIZE); // zip64 end of central dir signature 4 bytes (0x06064b50) zip64EocdrBuffer.writeUInt32LE(0x06064b50, 0); // size of zip64 end of central directory record 8 bytes writeUInt64LE(zip64EocdrBuffer, ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIZE - 12, 4); // version made by 2 bytes zip64EocdrBuffer.writeUInt16LE(VERSION_MADE_BY, 12); // version needed to extract 2 bytes zip64EocdrBuffer.writeUInt16LE(VERSION_NEEDED_TO_EXTRACT_ZIP64, 14); // number of this disk 4 bytes zip64EocdrBuffer.writeUInt32LE(0, 16); // number of the disk with the start of the central directory 4 bytes zip64EocdrBuffer.writeUInt32LE(0, 20); // total number of entries in the central directory on this disk 8 bytes writeUInt64LE(zip64EocdrBuffer, self.entries.length, 24); // total number of entries in the central directory 8 bytes writeUInt64LE(zip64EocdrBuffer, self.entries.length, 32); // size of the central directory 8 bytes writeUInt64LE(zip64EocdrBuffer, sizeOfCentralDirectory, 40); // offset of start of central directory with respect to the starting disk number 8 bytes writeUInt64LE(zip64EocdrBuffer, self.offsetOfStartOfCentralDirectory, 48); // zip64 extensible data sector (variable size) // nothing in the zip64 extensible data sector // ZIP64 End of Central Directory Locator var zip64EocdlBuffer = new Buffer(ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIZE); // zip64 end of central dir locator signature 4 bytes (0x07064b50) zip64EocdlBuffer.writeUInt32LE(0x07064b50, 0); // number of the disk with the start of the zip64 end of central directory 4 bytes zip64EocdlBuffer.writeUInt32LE(0, 4); // relative offset of the zip64 end of central directory record 8 bytes writeUInt64LE(zip64EocdlBuffer, self.outputStreamCursor, 8); // total number of disks 4 bytes zip64EocdlBuffer.writeUInt32LE(1, 16); return Buffer.concat([ zip64EocdrBuffer, zip64EocdlBuffer, eocdrBuffer, ]); } function validateMetadataPath(metadataPath, isDirectory) { if (metadataPath === "") throw new Error("empty metadataPath"); metadataPath = metadataPath.replace(/\\/g, "/"); if (/^[a-zA-Z]:/.test(metadataPath) || /^\//.test(metadataPath)) throw new Error("absolute path: " + metadataPath); if (metadataPath.split("/").indexOf("..") !== -1) throw new Error("invalid relative path: " + metadataPath); var looksLikeDirectory = /\/$/.test(metadataPath); if (isDirectory) { // append a trailing '/' if necessary. if (!looksLikeDirectory) metadataPath += "/"; } else { if (looksLikeDirectory) throw new Error("file path cannot end with '/': " + metadataPath); } return metadataPath; } var defaultFileMode = parseInt("0100664", 8); var defaultDirectoryMode = parseInt("040775", 8); // this class is not part of the public API function Entry(metadataPath, isDirectory, options) { this.utf8FileName = new Buffer(metadataPath); if (this.utf8FileName.length > 0xffff) throw new Error("utf8 file name too long. " + utf8FileName.length + " > " + 0xffff); this.isDirectory = isDirectory; this.state = Entry.WAITING_FOR_METADATA; this.setLastModDate(options.mtime != null ? options.mtime : new Date()); if (options.mode != null) { this.setFileAttributesMode(options.mode); } else { this.setFileAttributesMode(isDirectory ? defaultDirectoryMode : defaultFileMode); } if (isDirectory) { this.crcAndFileSizeKnown = true; this.crc32 = 0; this.uncompressedSize = 0; this.compressedSize = 0; } else { // unknown so far this.crcAndFileSizeKnown = false; this.crc32 = null; this.uncompressedSize = null; this.compressedSize = null; if (options.size != null) this.uncompressedSize = options.size; } if (isDirectory) { this.compress = false; } else { this.compress = true; // default if (options.compress != null) this.compress = !!options.compress; } this.forceZip64Format = !!options.forceZip64Format; } Entry.WAITING_FOR_METADATA = 0; Entry.READY_TO_PUMP_FILE_DATA = 1; Entry.FILE_DATA_IN_PROGRESS = 2; Entry.FILE_DATA_DONE = 3; Entry.prototype.setLastModDate = function(date) { var dosDateTime = dateToDosDateTime(date); this.lastModFileTime = dosDateTime.time; this.lastModFileDate = dosDateTime.date; }; Entry.prototype.setFileAttributesMode = function(mode) { if ((mode & 0xffff) !== mode) throw new Error("invalid mode. expected: 0 <= " + mode + " <= " + 0xffff); // http://unix.stackexchange.com/questions/14705/the-zip-formats-external-file-attribute/14727#14727 this.externalFileAttributes = (mode << 16) >>> 0; }; // doFileDataPump() should not call pumpEntries() directly. see issue #9. Entry.prototype.setFileDataPumpFunction = function(doFileDataPump) { this.doFileDataPump = doFileDataPump; this.state = Entry.READY_TO_PUMP_FILE_DATA; }; Entry.prototype.useZip64Format = function() { return ( (this.forceZip64Format) || (this.uncompressedSize != null && this.uncompressedSize > 0xfffffffe) || (this.compressedSize != null && this.compressedSize > 0xfffffffe) || (this.relativeOffsetOfLocalHeader != null && this.relativeOffsetOfLocalHeader > 0xfffffffe) ); } var LOCAL_FILE_HEADER_FIXED_SIZE = 30; var VERSION_NEEDED_TO_EXTRACT_UTF8 = 20; var VERSION_NEEDED_TO_EXTRACT_ZIP64 = 45; // 3 = unix. 63 = spec version 6.3 var VERSION_MADE_BY = (3 << 8) | 63; var FILE_NAME_IS_UTF8 = 1 << 11; var UNKNOWN_CRC32_AND_FILE_SIZES = 1 << 3; Entry.prototype.getLocalFileHeader = function() { var crc32 = 0; var compressedSize = 0; var uncompressedSize = 0; if (this.crcAndFileSizeKnown) { crc32 = this.crc32; compressedSize = this.compressedSize; uncompressedSize = this.uncompressedSize; } var fixedSizeStuff = new Buffer(LOCAL_FILE_HEADER_FIXED_SIZE); var generalPurposeBitFlag = FILE_NAME_IS_UTF8; if (!this.crcAndFileSizeKnown) generalPurposeBitFlag |= UNKNOWN_CRC32_AND_FILE_SIZES; // local file header signature 4 bytes (0x04034b50) fixedSizeStuff.writeUInt32LE(0x04034b50, 0); // version needed to extract 2 bytes fixedSizeStuff.writeUInt16LE(VERSION_NEEDED_TO_EXTRACT_UTF8, 4); // general purpose bit flag 2 bytes fixedSizeStuff.writeUInt16LE(generalPurposeBitFlag, 6); // compression method 2 bytes fixedSizeStuff.writeUInt16LE(this.getCompressionMethod(), 8); // last mod file time 2 bytes fixedSizeStuff.writeUInt16LE(this.lastModFileTime, 10); // last mod file date 2 bytes fixedSizeStuff.writeUInt16LE(this.lastModFileDate, 12); // crc-32 4 bytes fixedSizeStuff.writeUInt32LE(crc32, 14); // compressed size 4 bytes fixedSizeStuff.writeUInt32LE(compressedSize, 18); // uncompressed size 4 bytes fixedSizeStuff.writeUInt32LE(uncompressedSize, 22); // file name length 2 bytes fixedSizeStuff.writeUInt16LE(this.utf8FileName.length, 26); // extra field length 2 bytes fixedSizeStuff.writeUInt16LE(0, 28); return Buffer.concat([ fixedSizeStuff, // file name (variable size) this.utf8FileName, // extra field (variable size) // no extra fields ]); }; var DATA_DESCRIPTOR_SIZE = 16; var ZIP64_DATA_DESCRIPTOR_SIZE = 24; Entry.prototype.getDataDescriptor = function() { if (this.crcAndFileSizeKnown) { // the Mac Archive Utility requires this not be present unless we set general purpose bit 3 return new Buffer(0); } if (!this.useZip64Format()) { var buffer = new Buffer(DATA_DESCRIPTOR_SIZE); // optional signature (required according to Archive Utility) buffer.writeUInt32LE(0x08074b50, 0); // crc-32 4 bytes buffer.writeUInt32LE(this.crc32, 4); // compressed size 4 bytes buffer.writeUInt32LE(this.compressedSize, 8); // uncompressed size 4 bytes buffer.writeUInt32LE(this.uncompressedSize, 12); return buffer; } else { // ZIP64 format var buffer = new Buffer(ZIP64_DATA_DESCRIPTOR_SIZE); // optional signature (unknown if anyone cares about this) buffer.writeUInt32LE(0x08074b50, 0); // crc-32 4 bytes buffer.writeUInt32LE(this.crc32, 4); // compressed size 8 bytes writeUInt64LE(buffer, this.compressedSize, 8); // uncompressed size 8 bytes writeUInt64LE(buffer, this.uncompressedSize, 16); return buffer; } }; var CENTRAL_DIRECTORY_RECORD_FIXED_SIZE = 46; var ZIP64_EXTENDED_INFORMATION_EXTRA_FIELD_SIZE = 28; Entry.prototype.getCentralDirectoryRecord = function() { var fixedSizeStuff = new Buffer(CENTRAL_DIRECTORY_RECORD_FIXED_SIZE); var generalPurposeBitFlag = FILE_NAME_IS_UTF8; if (!this.crcAndFileSizeKnown) generalPurposeBitFlag |= UNKNOWN_CRC32_AND_FILE_SIZES; var normalCompressedSize = this.compressedSize; var normalUncompressedSize = this.uncompressedSize; var normalRelativeOffsetOfLocalHeader = this.relativeOffsetOfLocalHeader; var versionNeededToExtract; var zeiefBuffer; if (this.useZip64Format()) { normalCompressedSize = 0xffffffff; normalUncompressedSize = 0xffffffff; normalRelativeOffsetOfLocalHeader = 0xffffffff; versionNeededToExtract = VERSION_NEEDED_TO_EXTRACT_ZIP64; // ZIP64 extended information extra field zeiefBuffer = new Buffer(ZIP64_EXTENDED_INFORMATION_EXTRA_FIELD_SIZE); // 0x0001 2 bytes Tag for this "extra" block type zeiefBuffer.writeUInt16LE(0x0001, 0); // Size 2 bytes Size of this "extra" block zeiefBuffer.writeUInt16LE(ZIP64_EXTENDED_INFORMATION_EXTRA_FIELD_SIZE - 4, 2); // Original Size 8 bytes Original uncompressed file size writeUInt64LE(zeiefBuffer, this.uncompressedSize, 4); // Compressed Size 8 bytes Size of compressed data writeUInt64LE(zeiefBuffer, this.compressedSize, 12); // Relative Header Offset 8 bytes Offset of local header record writeUInt64LE(zeiefBuffer, this.relativeOffsetOfLocalHeader, 20); // Disk Start Number 4 bytes Number of the disk on which this file starts // (omit) } else { versionNeededToExtract = VERSION_NEEDED_TO_EXTRACT_UTF8; zeiefBuffer = new Buffer(0); } // central file header signature 4 bytes (0x02014b50) fixedSizeStuff.writeUInt32LE(0x02014b50, 0); // version made by 2 bytes fixedSizeStuff.writeUInt16LE(VERSION_MADE_BY, 4); // version needed to extract 2 bytes fixedSizeStuff.writeUInt16LE(versionNeededToExtract, 6); // general purpose bit flag 2 bytes fixedSizeStuff.writeUInt16LE(generalPurposeBitFlag, 8); // compression method 2 bytes fixedSizeStuff.writeUInt16LE(this.getCompressionMethod(), 10); // last mod file time 2 bytes fixedSizeStuff.writeUInt16LE(this.lastModFileTime, 12); // last mod file date 2 bytes fixedSizeStuff.writeUInt16LE(this.lastModFileDate, 14); // crc-32 4 bytes fixedSizeStuff.writeUInt32LE(this.crc32, 16); // compressed size 4 bytes fixedSizeStuff.writeUInt32LE(normalCompressedSize, 20); // uncompressed size 4 bytes fixedSizeStuff.writeUInt32LE(normalUncompressedSize, 24); // file name length 2 bytes fixedSizeStuff.writeUInt16LE(this.utf8FileName.length, 28); // extra field length 2 bytes fixedSizeStuff.writeUInt16LE(zeiefBuffer.length, 30); // file comment length 2 bytes fixedSizeStuff.writeUInt16LE(0, 32); // disk number start 2 bytes fixedSizeStuff.writeUInt16LE(0, 34); // internal file attributes 2 bytes fixedSizeStuff.writeUInt16LE(0, 36); // external file attributes 4 bytes fixedSizeStuff.writeUInt32LE(this.externalFileAttributes, 38); // relative offset of local header 4 bytes fixedSizeStuff.writeUInt32LE(normalRelativeOffsetOfLocalHeader, 42); return Buffer.concat([ fixedSizeStuff, // file name (variable size) this.utf8FileName, // extra field (variable size) zeiefBuffer, // file comment (variable size) // empty comment ]); }; Entry.prototype.getCompressionMethod = function() { var NO_COMPRESSION = 0; var DEFLATE_COMPRESSION = 8; return this.compress ? DEFLATE_COMPRESSION : NO_COMPRESSION; }; function dateToDosDateTime(jsDate) { var date = 0; date |= jsDate.getDate() & 0x1f; // 1-31 date |= ((jsDate.getMonth() + 1) & 0xf) << 5; // 0-11, 1-12 date |= ((jsDate.getFullYear() - 1980) & 0x7f) << 9; // 0-128, 1980-2108 var time = 0; time |= Math.floor(jsDate.getSeconds() / 2); // 0-59, 0-29 (lose odd numbers) time |= (jsDate.getMinutes() & 0x3f) << 5; // 0-59 time |= (jsDate.getHours() & 0x1f) << 11; // 0-23 return {date: date, time: time}; } function writeUInt64LE(buffer, n, offset) { // can't use bitshift here, because JavaScript only allows bitshiting on 32-bit integers. var high = Math.floor(n / 0x100000000); var low = n % 0x100000000; buffer.writeUInt32LE(low, offset); buffer.writeUInt32LE(high, offset + 4); } function defaultCallback(err) { if (err) throw err; } util.inherits(ByteCounter, Transform); function ByteCounter(options) { Transform.call(this, options); this.byteCount = 0; } ByteCounter.prototype._transform = function(chunk, encoding, cb) { this.byteCount += chunk.length; cb(null, chunk); }; util.inherits(Crc32Watcher, Transform); function Crc32Watcher(options) { Transform.call(this, options); this.crc32 = 0; } Crc32Watcher.prototype._transform = function(chunk, encoding, cb) { this.crc32 = crc32.unsigned(chunk, this.crc32); cb(null, chunk); }; The MIT License (MIT) Copyright (c) 2014 Josh Wolfe Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "yazl", "version": "2.4.3", "description": "yet another zip library for node", "main": "index.js", "scripts": { "test": "node test/test.js" }, "repository": { "type": "git", "url": "https://github.com/thejoshwolfe/yazl.git" }, "keywords": [ "zip", "stream", "archive", "file" ], "author": "Josh Wolfe ", "license": "MIT", "bugs": { "url": "https://github.com/thejoshwolfe/yazl/issues" }, "homepage": "https://github.com/thejoshwolfe/yazl", "dependencies": { "buffer-crc32": "~0.2.3" }, "devDependencies": { "bl": "~0.9.3", "yauzl": "~2.3.1" }, "files": [ "index.js" ] } Copyright (c) Microsoft Corporation All rights reserved. MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.{ "name": "@vscode/windows-registry", "version": "1.0.6", "description": "A native node module for accessing the windows registry", "os": [ "win32" ], "main": "dist/index.js", "typings": "dist/index.d.ts", "scripts": { "compile": "tsc -p ./", "test": "mocha -r ts-node/register test/**/*.test.ts" }, "repository": { "type": "git", "url": "git+https://github.com/Microsoft/vscode-windows-registry.git" }, "author": "Microsoft Corporation", "license": "MIT", "bugs": { "url": "https://github.com/Microsoft/vscode-windows-registry/issues" }, "homepage": "https://github.com/Microsoft/vscode-windows-registry#readme", "devDependencies": { "@types/mocha": "^9.0.0", "@types/node": "^14", "mocha": "^9.1.3", "ts-node": "^10.4.0", "typescript": "^4.4.4" } } "use strict"; /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ Object.defineProperty(exports, "__esModule", { value: true }); exports.GetStringRegKey = void 0; const windowregistry = process.platform === 'win32' ? require('../build/Release/winregistry.node') : null; function GetStringRegKey(hive, path, name) { if (windowregistry) { return windowregistry.GetStringRegKey(hive, path, name); } console.error('Could not initialize Windows Registry native node module.'); return undefined; } exports.GetStringRegKey = GetStringRegKey; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@vscode/windows-registry/dist/index.js.mapvar foregroundLove = null; var tried = false; exports.allowSetForegroundWindow = function (pid) { if (process.platform !== 'win32') { return false; } if (!tried) { tried = true; try { foregroundLove = require('./build/Release/foreground_love'); } catch (err) { console.error(err); } } if (!foregroundLove) { return false; } var r = false; try { r = foregroundLove.allowSetForegroundWindow(pid); } catch (err) { console.error(err); } return r; }; MIT License Copyright (c) 2016 Tereza Tomcova Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "windows-foreground-love", "version": "0.4.0", "description": "API wrapper for AllowSetForegroundWindow", "main": "index.js", "types": "index.d.ts", "files": [ "src", "binding.gyp", "index.js", "index.d.ts" ], "scripts": { "test": "node test/test.js" }, "repository": { "type": "git", "url": "git+https://github.com/the-ress/node-windows-foreground-love.git" }, "author": "Tereza Tomcova", "license": "MIT", "bugs": { "url": "https://github.com/the-ress/node-windows-foreground-love/issues" }, "homepage": "https://github.com/the-ress/node-windows-foreground-love#readme" } trigger: branches: include: ['*'] tags: include: ['*'] pool: vmImage: vs2017-win2016 steps: - task: NodeTool@0 inputs: versionSpec: '10.x' displayName: 'Install Node.js' - task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@3 displayName: 'Use Yarn 1.x' - task: geeklearningio.gl-vsts-tasks-yarn.yarn-task.Yarn@2 displayName: 'Install dependencies' - task: Npm@1 displayName: 'Publish to NPM' inputs: command: publish verbose: false publishEndpoint: 'NPM joaomoreno.ms' condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))module.exports = require('bindings')('CreateMutex');Copyright (c) Microsoft Corporation All rights reserved. MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "windows-mutex", "version": "0.4.1", "description": "Expose the Windows CreateMutex API to Node.JS", "main": "index.js", "homepage": "https://github.com/Microsoft/node-windows-mutex", "bugs": "https://github.com/Microsoft/node-windows-mutex/issues", "repository": { "type": "git", "url": "https://github.com/Microsoft/node-windows-mutex.git" }, "author": "Microsoft", "license": "MIT", "os": [ "win32" ], "dependencies": { "bindings": "^1.2.1", "nan": "^2.14.0" }, "devDependencies": { "mocha": "^6.1.4" }, "scripts": { "test": "mocha" } } /** * Module dependencies. */ var fs = require('fs') , path = require('path') , join = path.join , dirname = path.dirname , exists = ((fs.accessSync && function (path) { try { fs.accessSync(path); } catch (e) { return false; } return true; }) || fs.existsSync || path.existsSync) , defaults = { arrow: process.env.NODE_BINDINGS_ARROW || ' → ' , compiled: process.env.NODE_BINDINGS_COMPILED_DIR || 'compiled' , platform: process.platform , arch: process.arch , version: process.versions.node , bindings: 'bindings.node' , try: [ // node-gyp's linked version in the "build" dir [ 'module_root', 'build', 'bindings' ] // node-waf and gyp_addon (a.k.a node-gyp) , [ 'module_root', 'build', 'Debug', 'bindings' ] , [ 'module_root', 'build', 'Release', 'bindings' ] // Debug files, for development (legacy behavior, remove for node v0.9) , [ 'module_root', 'out', 'Debug', 'bindings' ] , [ 'module_root', 'Debug', 'bindings' ] // Release files, but manually compiled (legacy behavior, remove for node v0.9) , [ 'module_root', 'out', 'Release', 'bindings' ] , [ 'module_root', 'Release', 'bindings' ] // Legacy from node-waf, node <= 0.4.x , [ 'module_root', 'build', 'default', 'bindings' ] // Production "Release" buildtype binary (meh...) , [ 'module_root', 'compiled', 'version', 'platform', 'arch', 'bindings' ] ] } /** * The main `bindings()` function loads the compiled bindings for a given module. * It uses V8's Error API to determine the parent filename that this function is * being invoked from, which is then used to find the root directory. */ function bindings (opts) { // Argument surgery if (typeof opts == 'string') { opts = { bindings: opts } } else if (!opts) { opts = {} } // maps `defaults` onto `opts` object Object.keys(defaults).map(function(i) { if (!(i in opts)) opts[i] = defaults[i]; }); // Get the module root if (!opts.module_root) { opts.module_root = exports.getRoot(exports.getFileName()) } // Ensure the given bindings name ends with .node if (path.extname(opts.bindings) != '.node') { opts.bindings += '.node' } var tries = [] , i = 0 , l = opts.try.length , n , b , err for (; i (http://tootallnate.net)", "repository": { "type": "git", "url": "git://github.com/TooTallNate/node-bindings.git" }, "main": "./bindings.js", "bugs": { "url": "https://github.com/TooTallNate/node-bindings/issues" }, "homepage": "https://github.com/TooTallNate/node-bindings", "license": "MIT" } MIT License Copyright (c) Microsoft Corporation. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE{ "name": "windows-process-tree", "version": "0.3.4", "description": "Fetch a Windows process tree fast", "main": "lib/index.js", "types": "typings/windows-process-tree.d.ts", "scripts": { "test": "mocha lib/test.js", "prepublish": "tsc", "compile": "tsc", "watch": "tsc -w", "lint": "tslint lib/*.ts typings/*.ts *.ts" }, "author": "Microsoft Corporation", "license": "MIT", "repository": { "type": "git", "url": "git://github.com/Microsoft/vscode-windows-process-tree.git" }, "homepage": "https://github.com/Microsoft/vscode-windows-process-tree", "bugs": { "url": "https://github.com/Microsoft/vscode-windows-process-tree/issues" }, "dependencies": { "nan": "^2.13.2" }, "devDependencies": { "@types/mocha": "^8.0.0", "@types/node": "^14.14.0", "mocha": "^8.3.2", "tslint": "5.9.1", "typescript": "^4.0.0" }, "os": [ "win32" ] } ## Security Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below. ## Reporting Security Issues **Please do not report security vulnerabilities through public GitHub issues.** Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report). If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) * Full paths of source file(s) related to the manifestation of the issue * The location of the affected source code (tag/branch/commit or direct URL) * Any special configuration required to reproduce the issue * Step-by-step instructions to reproduce the issue * Proof-of-concept or exploit code (if possible) * Impact of the issue, including how an attacker might exploit the issue This information will help us triage your report more quickly. If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs. ## Preferred Languages We prefer all communications to be in English. ## Policy Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd). { "compilerOptions": { "module": "commonjs", "target": "es6", "sourceMap": true, "noImplicitReturns": true, "noUnusedLocals": true, "noImplicitThis": true, "alwaysStrict": true, "strictNullChecks": true } } { "rules": { "array-type": [ true, "array" ], "class-name": true, "comment-format": [ true, "check-space" ], "curly": [ true, "ignore-same-line" ], "indent": [ true, "spaces" ], "interface-name": [ true, "always-prefix" ], "interface-over-type-literal": true, "typedef": [ true, "call-signature", "parameter" ], "eofline": true, "no-duplicate-imports": true, "no-eval": true, "no-internal-module": true, "no-trailing-whitespace": true, "one-variable-per-declaration": true, "no-unsafe-finally": true, "no-var-keyword": true, "quotemark": [ true, "single" ], "semicolon": [ true, "always" ], "triple-equals": [ true, "allow-null-check" ], "typedef-whitespace": [ true, { "call-signature": "nospace", "index-signature": "nospace", "parameter": "nospace", "property-declaration": "nospace", "variable-declaration": "nospace" } ], "variable-name": [ true, "ban-keywords", "check-format", "allow-leading-underscore" ], "whitespace": [ true, "check-branch", "check-decl", "check-module", "check-operator", "check-rest-spread", "check-separator", "check-type", "check-type-operator", "check-preblock" ] } }"use strict"; /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ Object.defineProperty(exports, "__esModule", { value: true }); exports.getProcessTree = exports.getProcessCpuUsage = exports.getProcessList = exports.filterProcessList = exports.buildProcessTree = exports.ProcessDataFlag = void 0; const native = require('../build/Release/windows_process_tree.node'); var ProcessDataFlag; (function (ProcessDataFlag) { ProcessDataFlag[ProcessDataFlag["None"] = 0] = "None"; ProcessDataFlag[ProcessDataFlag["Memory"] = 1] = "Memory"; ProcessDataFlag[ProcessDataFlag["CommandLine"] = 2] = "CommandLine"; })(ProcessDataFlag = exports.ProcessDataFlag || (exports.ProcessDataFlag = {})); // requestInProgress is used for any function that uses CreateToolhelp32Snapshot, as multiple calls // to this cannot be done at the same time. let requestInProgress = false; const processListRequestQueue = []; const processTreeRequestQueue = []; const MAX_FILTER_DEPTH = 10; /** * Filters a list of processes to rootPid and its descendents and creates a tree * @param rootPid The process to use as the root * @param processList The list of processes * @param maxDepth The maximum depth to search */ function buildProcessTree(rootPid, processList, maxDepth) { if (!processList) { return undefined; } const rootIndex = processList.findIndex(v => v.pid === rootPid); if (rootIndex === -1) { return undefined; } const rootProcess = processList[rootIndex]; const childIndexes = processList.filter(v => v.ppid === rootPid); const children = []; if (maxDepth !== 0) { for (const c of childIndexes) { const tree = buildProcessTree(c.pid, processList, maxDepth - 1); if (tree) { children.push(tree); } } } return { pid: rootProcess.pid, name: rootProcess.name, memory: rootProcess.memory, commandLine: rootProcess.commandLine, children }; } exports.buildProcessTree = buildProcessTree; /** * Filters processList to contain the process with rootPid and all of its descendants * @param rootPid The root pid * @param processList The list of all processes * @param maxDepth The maximum depth to search */ function filterProcessList(rootPid, processList, maxDepth) { const rootIndex = processList.findIndex(v => v.pid === rootPid); if (rootIndex === -1) { return undefined; } if (maxDepth === -1) { return []; } const rootProcess = processList[rootIndex]; const childIndexes = processList.filter(v => v.ppid === rootPid); const children = []; for (const c of childIndexes) { const list = filterProcessList(c.pid, processList, maxDepth - 1); if (list) { children.push(list); } } return children.reduce((prev, current) => prev.concat(current), [rootProcess]); } exports.filterProcessList = filterProcessList; function getRawProcessList(pid, queue, callback, filter, flags) { queue.push({ callback: callback, rootPid: pid }); // Only make a new request if there is not currently a request in progress. // This prevents too many requests from being made, there is also a crash that // can occur when performing multiple calls to CreateToolhelp32Snapshot at // once. if (!requestInProgress) { requestInProgress = true; native.getProcessList((processList) => { queue.forEach(r => { r.callback(filter(r.rootPid, processList, MAX_FILTER_DEPTH)); }); queue.length = 0; requestInProgress = false; }, flags || 0); } } /** * Returns a list of processes containing the rootPid process and all of its descendants * @param rootPid The pid of the process of interest * @param callback The callback to use with the returned set of processes * @param flags The flags for what process data should be included */ function getProcessList(rootPid, callback, flags) { getRawProcessList(rootPid, processListRequestQueue, callback, filterProcessList, flags); } exports.getProcessList = getProcessList; /** * Returns the list of processes annotated with cpu usage information * @param processList The list of processes * @param callback The callback to use with the returned list of processes */ function getProcessCpuUsage(processList, callback) { native.getProcessCpuUsage(processList, (processListWithCpu) => callback(processListWithCpu)); } exports.getProcessCpuUsage = getProcessCpuUsage; /** * Returns a tree of processes with rootPid as the root * @param rootPid The pid of the process that will be the root of the tree * @param callback The callback to use with the returned list of processes * @param flags Flags indicating what process data should be written on each node */ function getProcessTree(rootPid, callback, flags) { getRawProcessList(rootPid, processTreeRequestQueue, callback, buildProcessTree, flags); } exports.getProcessTree = getProcessTree; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/windows-process-tree/lib/index.js.map MIT License Copyright (c) Microsoft Corporation. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE { "name": "@microsoft/applicationinsights-core-js", "author": "Microsoft Application Insights Team", "version": "2.8.3", "description": "Microsoft Application Insights Core Javascript SDK", "homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme", "keywords": [ "azure", "cloud", "script errors", "microsoft", "application insights", "browser performance monitoring", "web analytics" ], "main": "dist/applicationinsights-core-js.js", "module": "dist-esm/applicationinsights-core-js.js", "types": "types/applicationinsights-core-js.d.ts", "scripts": { "clean": "grunt clean", "build": "npm run build:esm && npm run build:browser && npm run sri && npm run dtsgen", "build:esm": "grunt core", "build:browser": "rollup -c rollup.config.js", "rebuild": "npm run build", "test": "grunt coreunittest", "perftest": "grunt coreperftest", "lint": "tslint -p tsconfig.json", "dtsgen": "api-extractor run --local && node ../../scripts/dtsgen.js \"Microsoft Application Insights Core Javascript SDK\"", "sri": "node ../../tools/subResourceIntegrity/generateIntegrityFile.js" }, "repository": { "type": "git", "url": "https://github.com/microsoft/ApplicationInsights-JS/tree/master/shared/AppInsightsCore" }, "license": "MIT", "sideEffects": false, "devDependencies": { "@microsoft/ai-test-framework": "0.0.1", "@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0", "@microsoft/applicationinsights-rollup-es3": "1.1.3", "@microsoft/api-extractor": "^7.18.1", "grunt": "^1.4.1", "grunt-cli": "^1.4.3", "grunt-contrib-qunit": "^5.0.1", "@nevware21/grunt-ts-plugin": "^0.4.3", "@nevware21/grunt-eslint-ts": "^0.2.2", "globby": "^11.0.0", "magic-string": "^0.25.7", "pako": "^2.0.3", "@rollup/plugin-commonjs": "^18.0.0", "@rollup/plugin-node-resolve": "^11.2.1", "@rollup/plugin-replace": "^2.3.3", "rollup-plugin-cleanup": "^3.2.1", "rollup": "^2.32.0", "typescript": "^4.3.4", "tslib": "^2.0.0", "qunit": "^2.11.2", "sinon": "^7.3.1" }, "peerDependencies": { "tslib": "*" }, "dependencies": { "@microsoft/applicationinsights-shims": "2.0.1", "@microsoft/dynamicproto-js": "^1.1.6" } } { "compilerOptions": { "sourceMap": true, "inlineSources": true, "noImplicitAny": true, "module": "es6", "moduleResolution": "node", "target": "es3", "forceConsistentCasingInFileNames": true, "importHelpers": true, "noEmitHelpers": true, "skipLibCheck": true, "alwaysStrict": true, "skipLibCheck": true, "skipDefaultLibCheck": true, "declaration": true, "declarationDir": "shared/AppInsightsCore/types", "outDir": "./dist-esm", "rootDir": "shared/AppInsightsCore/src", "suppressImplicitAnyIndexErrors": true, "allowSyntheticDefaultImports": true }, "include": [ "./src/applicationinsights-core-js.ts", "./src/JavaScriptSDK/**/*.ts", "./src/JavaScriptSDK.Enums/**/*.ts", "./src/JavaScriptSDK.Interfaces/**/*.ts" ], "exclude": ["node_modules/"] } { "name": "applicationinsights-core-js", "version": "2.8.3", "ext": { "@js": { "file": "applicationinsights-core-js.js", "type": "text/javascript; charset=utf-8", "integrity": "sha256-oefJ5cO7KAtHi+cGmw9tVwCqYeXhiUgaI9zBLOoDOOg= sha384-9B2NJ0FQ9iAcE2NmiIcf7LGxhKKqBjzLzX9Dhwo1KsGnkkyoGI+IHlBb19qs+YaE sha512-7MsdsaUsFOiIQP3wuaBJw7fQrFZGSefcmr8s+RY+I3ODXaSPDC1ANlnKtpaVDdGyyogFCmfR8b4PT12neVowuQ==", "hashes": { "sha256": "oefJ5cO7KAtHi+cGmw9tVwCqYeXhiUgaI9zBLOoDOOg=", "sha384": "9B2NJ0FQ9iAcE2NmiIcf7LGxhKKqBjzLzX9Dhwo1KsGnkkyoGI+IHlBb19qs+YaE", "sha512": "7MsdsaUsFOiIQP3wuaBJw7fQrFZGSefcmr8s+RY+I3ODXaSPDC1ANlnKtpaVDdGyyogFCmfR8b4PT12neVowuQ==" } }, "@min.js": { "file": "applicationinsights-core-js.min.js", "type": "text/javascript; charset=utf-8", "integrity": "sha256-W4nDbsP7NEWmqdMaJeZqWF4zrpPN7PgLfDx4F0JAxuw= sha384-60XmAblHmnyofiaTbBSjQWamsMPtU+qvnuCwdh1xIRX7LJvQU/ftCfjuzd0xm4PE sha512-3RVOR0PvA5gZ64VSA4cJdyBcAkv7vn4+Br1kV6a5EDALmuFoSkRvU6kvpFZGfGsYqxKYSo9QXg+eM3BoJS7fIQ==", "hashes": { "sha256": "W4nDbsP7NEWmqdMaJeZqWF4zrpPN7PgLfDx4F0JAxuw=", "sha384": "60XmAblHmnyofiaTbBSjQWamsMPtU+qvnuCwdh1xIRX7LJvQU/ftCfjuzd0xm4PE", "sha512": "3RVOR0PvA5gZ64VSA4cJdyBcAkv7vn4+Br1kV6a5EDALmuFoSkRvU6kvpFZGfGsYqxKYSo9QXg+eM3BoJS7fIQ==" } } } }/*! * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.Microsoft = global.Microsoft || {}, global.Microsoft.ApplicationInsights = global.Microsoft.ApplicationInsights || {}))); })(this, (function (exports) { 'use strict'; var MinChannelPriorty = 100; var strShimFunction = "function"; var strShimObject = "object"; var strShimUndefined = "undefined"; var strShimPrototype = "prototype"; var strShimHasOwnProperty = "hasOwnProperty"; var ObjClass = Object; var ObjProto = ObjClass[strShimPrototype]; var ObjAssign = ObjClass["assign"]; var ObjCreate = ObjClass["create"]; var ObjDefineProperty = ObjClass["defineProperty"]; var ObjHasOwnProperty = ObjProto[strShimHasOwnProperty]; var _cachedGlobal = null; function getGlobal(useCached) { if (useCached === void 0) { useCached = true; } if (!_cachedGlobal || !useCached) { if (typeof globalThis !== strShimUndefined && globalThis) { _cachedGlobal = globalThis; } if (typeof self !== strShimUndefined && self) { _cachedGlobal = self; } if (typeof window !== strShimUndefined && window) { _cachedGlobal = window; } if (typeof global !== strShimUndefined && global) { _cachedGlobal = global; } } return _cachedGlobal; } function throwTypeError(message) { throw new TypeError(message); } function objCreateFn(obj) { var func = ObjCreate; if (func) { return func(obj); } if (obj == null) { return {}; } var type = typeof obj; if (type !== strShimObject && type !== strShimFunction) { throwTypeError("Object prototype may only be an Object:" + obj); } function tmpFunc() { } tmpFunc[strShimPrototype] = obj; return new tmpFunc(); } (getGlobal() || {})["Symbol"]; (getGlobal() || {})["Reflect"]; var extendStaticsFn = function (d, b) { extendStaticsFn = ObjClass["setPrototypeOf"] || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) { if (b[strShimHasOwnProperty](p)) { d[p] = b[p]; } } }; return extendStaticsFn(d, b); }; function __extendsFn(d, b) { if (typeof b !== strShimFunction && b !== null) { throwTypeError("Class extends value " + String(b) + " is not a constructor or null"); } extendStaticsFn(d, b); function __() { this.constructor = d; } d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new __()); } function __spreadArrayFn(to, from) { for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) { to[j] = from[i]; } return to; } var strEmpty = ""; var strProcessTelemetry = "processTelemetry"; var strPriority = "priority"; var strSetNextPlugin = "setNextPlugin"; var strIsInitialized = "isInitialized"; var strTeardown = "teardown"; var strCore = "core"; var strUpdate = "update"; var strDisabled = "disabled"; var strDoTeardown = "_doTeardown"; var strProcessNext = "processNext"; var strResume = "resume"; var strPause = "pause"; var strNotificationListener = "NotificationListener"; var strAddNotificationListener = "add" + strNotificationListener; var strRemoveNotificationListener = "remove" + strNotificationListener; var strEventsSent = "eventsSent"; var strEventsDiscarded = "eventsDiscarded"; var strEventsSendRequest = "eventsSendRequest"; var strPerfEvent = "perfEvent"; var strToISOString = "toISOString"; var cStrEndsWith = "endsWith"; var cStrStartsWith = "startsWith"; var strIndexOf = "indexOf"; var strMap = "map"; var strReduce = "reduce"; var cStrTrim = "trim"; var strToString = "toString"; var str__Proto$1 = "__proto__"; var strConstructor = "constructor"; var _objDefineProperty$1 = ObjDefineProperty; var _objFreeze = ObjClass.freeze; var _objSeal = ObjClass.seal; var _objKeys = ObjClass.keys; var StringProto = String[strShimPrototype]; var _strTrim = StringProto[cStrTrim]; var _strEndsWith = StringProto[cStrEndsWith]; var _strStartsWith = StringProto[cStrStartsWith]; var DateProto = Date[strShimPrototype]; var _dataToISOString = DateProto[strToISOString]; var _isArray = Array.isArray; var _objToString = ObjProto[strToString]; var _fnToString = ObjHasOwnProperty[strToString]; var _objFunctionString = _fnToString.call(ObjClass); var rCamelCase = /-([a-z])/g; var rNormalizeInvalid = /([^\w\d_$])/g; var rLeadingNumeric = /^(\d+[\w\d_$])/; var _objGetPrototypeOf$1 = Object["getPrototypeOf"]; function _getObjProto$1(target) { if (target) { if (_objGetPrototypeOf$1) { return _objGetPrototypeOf$1(target); } var newProto = target[str__Proto$1] || target[strShimPrototype] || target[strConstructor]; if (newProto) { return newProto; } } return null; } function objToString(obj) { return _objToString.call(obj); } function isTypeof(value, theType) { return typeof value === theType; } function isUndefined(value) { return value === undefined || typeof value === strShimUndefined; } function isNotUndefined(value) { return !isUndefined(value); } function isNullOrUndefined(value) { return (value === null || isUndefined(value)); } function isNotNullOrUndefined(value) { return !isNullOrUndefined(value); } function hasOwnProperty(obj, prop) { return !!(obj && ObjHasOwnProperty.call(obj, prop)); } function isObject(value) { return !!(value && typeof value === strShimObject); } function isFunction(value) { return !!(value && typeof value === strShimFunction); } function normalizeJsName(name) { var value = name; if (value && isString(value)) { value = value.replace(rCamelCase, function (_all, letter) { return letter.toUpperCase(); }); value = value.replace(rNormalizeInvalid, "_"); value = value.replace(rLeadingNumeric, function (_all, match) { return "_" + match; }); } return value; } function objForEachKey(target, callbackfn) { if (target) { for (var prop in target) { if (ObjHasOwnProperty.call(target, prop)) { callbackfn.call(target, prop, target[prop]); } } } } function strEndsWith(value, search) { var result = false; if (value && search && !(result = value === search)) { result = _strEndsWith ? value[cStrEndsWith](search) : _strEndsWithPoly(value, search); } return result; } function _strEndsWithPoly(value, search) { var result = false; var searchLen = search ? search.length : 0; var valLen = value ? value.length : 0; if (searchLen && valLen && valLen >= searchLen && !(result = value === search)) { var pos = valLen - 1; for (var lp = searchLen - 1; lp >= 0; lp--) { if (value[pos] != search[lp]) { return false; } pos--; } result = true; } return result; } function strStartsWith(value, checkValue) { var result = false; if (value && checkValue && !(result = value === checkValue)) { result = _strStartsWith ? value[cStrStartsWith](checkValue) : _strStartsWithPoly(value, checkValue); } return result; } function _strStartsWithPoly(value, checkValue) { var result = false; var chkLen = checkValue ? checkValue.length : 0; if (value && chkLen && value.length >= chkLen && !(result = value === checkValue)) { for (var lp = 0; lp < chkLen; lp++) { if (value[lp] !== checkValue[lp]) { return false; } } result = true; } return result; } function strContains(value, search) { if (value && search) { return value.indexOf(search) !== -1; } return false; } function isDate(obj) { return !!(obj && _objToString.call(obj) === "[object Date]"); } var isArray = _isArray || _isArrayPoly; function _isArrayPoly(obj) { return !!(obj && _objToString.call(obj) === "[object Array]"); } function isError(obj) { return !!(obj && _objToString.call(obj) === "[object Error]"); } function isString(value) { return typeof value === "string"; } function isNumber(value) { return typeof value === "number"; } function isBoolean(value) { return typeof value === "boolean"; } function isSymbol(value) { return typeof value === "symbol"; } function isPlainObject(value) { var result = false; if (value && typeof value === "object") { var proto = _objGetPrototypeOf$1 ? _objGetPrototypeOf$1(value) : _getObjProto$1(value); if (!proto) { result = true; } else { if (proto[strConstructor] && ObjHasOwnProperty.call(proto, strConstructor)) { proto = proto[strConstructor]; } result = typeof proto === strShimFunction && _fnToString.call(proto) === _objFunctionString; } } return result; } function toISOString(date) { if (date) { return _dataToISOString ? date[strToISOString]() : _toISOStringPoly(date); } } function _toISOStringPoly(date) { if (date && date.getUTCFullYear) { var pad = function (num) { var r = String(num); if (r.length === 1) { r = "0" + r; } return r; }; return date.getUTCFullYear() + "-" + pad(date.getUTCMonth() + 1) + "-" + pad(date.getUTCDate()) + "T" + pad(date.getUTCHours()) + ":" + pad(date.getUTCMinutes()) + ":" + pad(date.getUTCSeconds()) + "." + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5) + "Z"; } } function arrForEach(arr, callbackfn, thisArg) { var len = arr.length; try { for (var idx = 0; idx < len; idx++) { if (idx in arr) { if (callbackfn.call(thisArg || arr, arr[idx], idx, arr) === -1) { break; } } } } catch (e) { } } function arrIndexOf(arr, searchElement, fromIndex) { if (arr) { if (arr[strIndexOf]) { return arr[strIndexOf](searchElement, fromIndex); } var len = arr.length; var from = fromIndex || 0; try { for (var lp = Math.max(from >= 0 ? from : len - Math.abs(from), 0); lp < len; lp++) { if (lp in arr && arr[lp] === searchElement) { return lp; } } } catch (e) { } } return -1; } function arrMap(arr, callbackfn, thisArg) { var results; if (arr) { if (arr[strMap]) { return arr[strMap](callbackfn, thisArg); } var len = arr.length; var _this = thisArg || arr; results = new Array(len); try { for (var lp = 0; lp < len; lp++) { if (lp in arr) { results[lp] = callbackfn.call(_this, arr[lp], arr); } } } catch (e) { } } return results; } function arrReduce(arr, callbackfn, initialValue) { var value; if (arr) { if (arr[strReduce]) { return arr[strReduce](callbackfn, initialValue); } var len = arr.length; var lp = 0; if (arguments.length >= 3) { value = arguments[2]; } else { while (lp < len && !(lp in arr)) { lp++; } value = arr[lp++]; } while (lp < len) { if (lp in arr) { value = callbackfn(value, arr[lp], lp, arr); } lp++; } } return value; } function strTrim(str) { if (str) { str = (_strTrim && str[cStrTrim]) ? str[cStrTrim]() : (str.replace ? str.replace(/^\s+|\s+$/g, "") : str); } return str; } var _objKeysHasDontEnumBug = !({ toString: null }).propertyIsEnumerable("toString"); var _objKeysDontEnums = [ "toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor" ]; function objKeys(obj) { var objType = typeof obj; if (objType !== strShimFunction && (objType !== strShimObject || obj === null)) { throwTypeError("objKeys called on non-object"); } if (!_objKeysHasDontEnumBug && _objKeys) { return _objKeys(obj); } var result = []; for (var prop in obj) { if (obj && ObjHasOwnProperty.call(obj, prop)) { result.push(prop); } } if (_objKeysHasDontEnumBug) { var dontEnumsLength = _objKeysDontEnums.length; for (var lp = 0; lp < dontEnumsLength; lp++) { if (obj && ObjHasOwnProperty.call(obj, _objKeysDontEnums[lp])) { result.push(_objKeysDontEnums[lp]); } } } return result; } function objDefineAccessors(target, prop, getProp, setProp) { if (_objDefineProperty$1) { try { var descriptor = { enumerable: true, configurable: true }; if (getProp) { descriptor.get = getProp; } if (setProp) { descriptor.set = setProp; } _objDefineProperty$1(target, prop, descriptor); return true; } catch (e) { } } return false; } function _doNothing(value) { return value; } function deepFreeze(obj) { if (_objFreeze) { objForEachKey(obj, function (name, value) { if (isArray(value) || isObject(value)) { _objFreeze(value); } }); } return objFreeze(obj); } var objFreeze = _objFreeze || _doNothing; var objSeal = _objSeal || _doNothing; function dateNow() { var dt = Date; return dt.now ? dt.now() : new dt().getTime(); } function getExceptionName(object) { if (isError(object)) { return object.name; } return strEmpty; } function setValue(target, field, value, valChk, srcChk) { var theValue = value; if (target) { theValue = target[field]; if (theValue !== value && (!srcChk || srcChk(theValue)) && (!valChk || valChk(value))) { theValue = value; target[field] = theValue; } } return theValue; } function getSetValue(target, field, defValue) { var theValue; if (target) { theValue = target[field]; if (!theValue && isNullOrUndefined(theValue)) { theValue = !isUndefined(defValue) ? defValue : {}; target[field] = theValue; } } else { theValue = !isUndefined(defValue) ? defValue : {}; } return theValue; } function isNotTruthy(value) { return !value; } function isTruthy(value) { return !!value; } function throwError(message) { throw new Error(message); } function _createProxyFunction(source, funcName) { var srcFunc = null; var src = null; if (isFunction(source)) { srcFunc = source; } else { src = source; } return function () { var originalArguments = arguments; if (srcFunc) { src = srcFunc(); } if (src) { return src[funcName].apply(src, originalArguments); } }; } function proxyAssign(target, source, chkSet) { if (target && source && isObject(target) && isObject(source)) { var _loop_1 = function (field) { if (isString(field)) { var value = source[field]; if (isFunction(value)) { if (!chkSet || chkSet(field, true, source, target)) { target[field] = _createProxyFunction(source, field); } } else if (!chkSet || chkSet(field, false, source, target)) { if (hasOwnProperty(target, field)) { delete target[field]; } if (!objDefineAccessors(target, field, function () { return source[field]; }, function (theValue) { source[field] = theValue; })) { target[field] = value; } } } }; for (var field in source) { _loop_1(field); } } return target; } function proxyFunctionAs(target, name, source, theFunc, overwriteTarget) { if (target && name && source) { if (overwriteTarget !== false || isUndefined(target[name])) { target[name] = _createProxyFunction(source, theFunc); } } } function proxyFunctions(target, source, functionsToProxy, overwriteTarget) { if (target && source && isObject(target) && isArray(functionsToProxy)) { arrForEach(functionsToProxy, function (theFuncName) { if (isString(theFuncName)) { proxyFunctionAs(target, theFuncName, source, theFuncName, overwriteTarget); } }); } return target; } function createClassFromInterface(defaults) { return /** @class */ (function () { function class_1() { var _this_1 = this; if (defaults) { objForEachKey(defaults, function (field, value) { _this_1[field] = value; }); } } return class_1; }()); } function optimizeObject(theObject) { if (theObject && ObjAssign) { theObject = ObjClass(ObjAssign({}, theObject)); } return theObject; } function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) { var theArgs = arguments; var extended = theArgs[0] || {}; var argLen = theArgs.length; var deep = false; var idx = 1; if (argLen > 0 && isBoolean(extended)) { deep = extended; extended = theArgs[idx] || {}; idx++; } if (!isObject(extended)) { extended = {}; } for (; idx < argLen; idx++) { var arg = theArgs[idx]; var isArgArray = isArray(arg); var isArgObj = isObject(arg); for (var prop in arg) { var propOk = (isArgArray && (prop in arg)) || (isArgObj && (ObjHasOwnProperty.call(arg, prop))); if (!propOk) { continue; } var newValue = arg[prop]; var isNewArray = void 0; if (deep && newValue && ((isNewArray = isArray(newValue)) || isPlainObject(newValue))) { var clone = extended[prop]; if (isNewArray) { if (!isArray(clone)) { clone = []; } } else if (!isPlainObject(clone)) { clone = {}; } newValue = objExtend(deep, clone, newValue); } if (newValue !== undefined) { extended[prop] = newValue; } } } return extended; } function createEnumStyle(values) { var enumClass = {}; objForEachKey(values, function (field, value) { enumClass[field] = value; enumClass[value] = field; }); return deepFreeze(enumClass); } function createEnumMap(values) { var mapClass = {}; objForEachKey(values, function (field, value) { mapClass[field] = field; mapClass[value] = field; }); return deepFreeze(mapClass); } function createValueMap(values) { var mapClass = {}; objForEachKey(values, function (field, value) { mapClass[field] = value[1]; mapClass[value[0]] = value[1]; }); return deepFreeze(mapClass); } var EventsDiscardedReason = createEnumStyle({ Unknown: 0 , NonRetryableStatus: 1 , InvalidEvent: 2 , SizeLimitExceeded: 3 , KillSwitch: 4 , QueueFull: 5 }); /*! * Microsoft Dynamic Proto Utility, 1.1.6 * Copyright (c) Microsoft and contributors. All rights reserved. */ var Constructor = 'constructor'; var Prototype = 'prototype'; var strFunction = 'function'; var DynInstFuncTable = '_dynInstFuncs'; var DynProxyTag = '_isDynProxy'; var DynClassName = '_dynClass'; var DynClassNamePrefix = '_dynCls$'; var DynInstChkTag = '_dynInstChk'; var DynAllowInstChkTag = DynInstChkTag; var DynProtoDefaultOptions = '_dfOpts'; var UnknownValue = '_unknown_'; var str__Proto = "__proto__"; var DynProtoBaseProto = "_dyn" + str__Proto; var DynProtoCurrent = "_dynInstProto"; var strUseBaseInst = 'useBaseInst'; var strSetInstFuncs = 'setInstFuncs'; var Obj = Object; var _objGetPrototypeOf = Obj["getPrototypeOf"]; var _objGetOwnProps = Obj["getOwnPropertyNames"]; var _dynamicNames = 0; function _hasOwnProperty(obj, prop) { return obj && Obj[Prototype].hasOwnProperty.call(obj, prop); } function _isObjectOrArrayPrototype(target) { return target && (target === Obj[Prototype] || target === Array[Prototype]); } function _isObjectArrayOrFunctionPrototype(target) { return _isObjectOrArrayPrototype(target) || target === Function[Prototype]; } function _getObjProto(target) { var newProto; if (target) { if (_objGetPrototypeOf) { return _objGetPrototypeOf(target); } var curProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null); newProto = target[DynProtoBaseProto] || curProto; if (!_hasOwnProperty(target, DynProtoBaseProto)) { delete target[DynProtoCurrent]; newProto = target[DynProtoBaseProto] = target[DynProtoCurrent] || target[DynProtoBaseProto]; target[DynProtoCurrent] = curProto; } } return newProto; } function _forEachProp(target, func) { var props = []; if (_objGetOwnProps) { props = _objGetOwnProps(target); } else { for (var name_1 in target) { if (typeof name_1 === "string" && _hasOwnProperty(target, name_1)) { props.push(name_1); } } } if (props && props.length > 0) { for (var lp = 0; lp < props.length; lp++) { func(props[lp]); } } } function _isDynamicCandidate(target, funcName, skipOwn) { return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName))); } function _throwTypeError(message) { throw new TypeError("DynamicProto: " + message); } function _getInstanceFuncs(thisTarget) { var instFuncs = {}; _forEachProp(thisTarget, function (name) { if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) { instFuncs[name] = thisTarget[name]; } }); return instFuncs; } function _hasVisited(values, value) { for (var lp = values.length - 1; lp >= 0; lp--) { if (values[lp] === value) { return true; } } return false; } function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) { function _instFuncProxy(target, funcHost, funcName) { var theFunc = funcHost[funcName]; if (theFunc[DynProxyTag] && useBaseInst) { var instFuncTable = target[DynInstFuncTable] || {}; if (instFuncTable[DynAllowInstChkTag] !== false) { theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc; } } return function () { return theFunc.apply(target, arguments); }; } var baseFuncs = {}; _forEachProp(instFuncs, function (name) { baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name); }); var baseProto = _getObjProto(classProto); var visited = []; while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) { _forEachProp(baseProto, function (name) { if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) { baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name); } }); visited.push(baseProto); baseProto = _getObjProto(baseProto); } return baseFuncs; } function _getInstFunc(target, funcName, proto, currentDynProtoProxy) { var instFunc = null; if (target && _hasOwnProperty(proto, DynClassName)) { var instFuncTable = target[DynInstFuncTable] || {}; instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName]; if (!instFunc) { _throwTypeError("Missing [" + funcName + "] " + strFunction); } if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) { var canAddInst = !_hasOwnProperty(target, funcName); var objProto = _getObjProto(target); var visited = []; while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) { var protoFunc = objProto[funcName]; if (protoFunc) { canAddInst = (protoFunc === currentDynProtoProxy); break; } visited.push(objProto); objProto = _getObjProto(objProto); } try { if (canAddInst) { target[funcName] = instFunc; } instFunc[DynInstChkTag] = 1; } catch (e) { instFuncTable[DynAllowInstChkTag] = false; } } } return instFunc; } function _getProtoFunc(funcName, proto, currentDynProtoProxy) { var protoFunc = proto[funcName]; if (protoFunc === currentDynProtoProxy) { protoFunc = _getObjProto(proto)[funcName]; } if (typeof protoFunc !== strFunction) { _throwTypeError("[" + funcName + "] is not a " + strFunction); } return protoFunc; } function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) { function _createDynamicPrototype(proto, funcName) { var dynProtoProxy = function () { var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy); return instFunc.apply(this, arguments); }; dynProtoProxy[DynProxyTag] = 1; return dynProtoProxy; } if (!_isObjectOrArrayPrototype(proto)) { var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {}; var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {}); if (instFuncTable[DynAllowInstChkTag] !== false) { instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc; } _forEachProp(target, function (name) { if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) { instFuncs_1[name] = target[name]; delete target[name]; if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) { proto[name] = _createDynamicPrototype(proto, name); } } }); } } function _checkPrototype(classProto, thisTarget) { if (_objGetPrototypeOf) { var visited = []; var thisProto = _getObjProto(thisTarget); while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) { if (thisProto === classProto) { return true; } visited.push(thisProto); thisProto = _getObjProto(thisProto); } return false; } return true; } function _getObjName(target, unknownValue) { if (_hasOwnProperty(target, Prototype)) { return target.name || unknownValue || UnknownValue; } return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue; } function dynamicProto(theClass, target, delegateFunc, options) { if (!_hasOwnProperty(theClass, Prototype)) { _throwTypeError("theClass is an invalid class definition."); } var classProto = theClass[Prototype]; if (!_checkPrototype(classProto, target)) { _throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]"); } var className = null; if (_hasOwnProperty(classProto, DynClassName)) { className = classProto[DynClassName]; } else { className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _dynamicNames; _dynamicNames++; classProto[DynClassName] = className; } var perfOptions = dynamicProto[DynProtoDefaultOptions]; var useBaseInst = !!perfOptions[strUseBaseInst]; if (useBaseInst && options && options[strUseBaseInst] !== undefined) { useBaseInst = !!options[strUseBaseInst]; } var instFuncs = _getInstanceFuncs(target); var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst); delegateFunc(target, baseFuncs); var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs]; if (setInstanceFunc && options) { setInstanceFunc = !!options[strSetInstFuncs]; } _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false); } var perfDefaults = { setInstFuncs: true, useBaseInst: true }; dynamicProto[DynProtoDefaultOptions] = perfDefaults; var strWindow = "window"; var strDocument = "document"; var strDocumentMode = "documentMode"; var strNavigator = "navigator"; var strHistory = "history"; var strLocation = "location"; var strConsole = "console"; var strPerformance = "performance"; var strJSON = "JSON"; var strCrypto = "crypto"; var strMsCrypto = "msCrypto"; var strReactNative = "ReactNative"; var strMsie = "msie"; var strTrident = "trident/"; var strXMLHttpRequest = "XMLHttpRequest"; var _isTrident = null; var _navUserAgentCheck = null; var _enableMocks = false; var _useXDomainRequest = null; var _beaconsSupported = null; function _hasProperty(theClass, property) { var supported = false; if (theClass) { try { supported = property in theClass; if (!supported) { var proto = theClass[strShimPrototype]; if (proto) { supported = property in proto; } } } catch (e) { } if (!supported) { try { var tmp = new theClass(); supported = !isUndefined(tmp[property]); } catch (e) { } } } return supported; } function setEnableEnvMocks(enabled) { _enableMocks = enabled; } function getGlobalInst(name) { var gbl = getGlobal(); if (gbl && gbl[name]) { return gbl[name]; } if (name === strWindow && hasWindow()) { return window; } return null; } function hasWindow() { return Boolean(typeof window === strShimObject && window); } function getWindow() { if (hasWindow()) { return window; } return getGlobalInst(strWindow); } function hasDocument() { return Boolean(typeof document === strShimObject && document); } function getDocument() { if (hasDocument()) { return document; } return getGlobalInst(strDocument); } function hasNavigator() { return Boolean(typeof navigator === strShimObject && navigator); } function getNavigator() { if (hasNavigator()) { return navigator; } return getGlobalInst(strNavigator); } function hasHistory() { return Boolean(typeof history === strShimObject && history); } function getHistory() { if (hasHistory()) { return history; } return getGlobalInst(strHistory); } function getLocation(checkForMock) { if (checkForMock && _enableMocks) { var mockLocation = getGlobalInst("__mockLocation"); if (mockLocation) { return mockLocation; } } if (typeof location === strShimObject && location) { return location; } return getGlobalInst(strLocation); } function getConsole() { if (typeof console !== strShimUndefined) { return console; } return getGlobalInst(strConsole); } function getPerformance() { return getGlobalInst(strPerformance); } function hasJSON() { return Boolean((typeof JSON === strShimObject && JSON) || getGlobalInst(strJSON) !== null); } function getJSON() { if (hasJSON()) { return JSON || getGlobalInst(strJSON); } return null; } function getCrypto() { return getGlobalInst(strCrypto); } function getMsCrypto() { return getGlobalInst(strMsCrypto); } function isReactNative() { var nav = getNavigator(); if (nav && nav.product) { return nav.product === strReactNative; } return false; } function isIE() { var nav = getNavigator(); if (nav && (nav.userAgent !== _navUserAgentCheck || _isTrident === null)) { _navUserAgentCheck = nav.userAgent; var userAgent = (_navUserAgentCheck || strEmpty).toLowerCase(); _isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident)); } return _isTrident; } function getIEVersion(userAgentStr) { if (userAgentStr === void 0) { userAgentStr = null; } if (!userAgentStr) { var navigator_1 = getNavigator() || {}; userAgentStr = navigator_1 ? (navigator_1.userAgent || strEmpty).toLowerCase() : strEmpty; } var ua = (userAgentStr || strEmpty).toLowerCase(); if (strContains(ua, strMsie)) { var doc = getDocument() || {}; return Math.max(parseInt(ua.split(strMsie)[1]), (doc[strDocumentMode] || 0)); } else if (strContains(ua, strTrident)) { var tridentVer = parseInt(ua.split(strTrident)[1]); if (tridentVer) { return tridentVer + 4; } } return null; } function dumpObj(object) { var objectTypeDump = Object[strShimPrototype].toString.call(object); var propertyValueDump = strEmpty; if (objectTypeDump === "[object Error]") { propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'"; } else if (hasJSON()) { propertyValueDump = getJSON().stringify(object); } return objectTypeDump + propertyValueDump; } function isSafari(userAgentStr) { if (!userAgentStr || !isString(userAgentStr)) { var navigator_2 = getNavigator() || {}; userAgentStr = navigator_2 ? (navigator_2.userAgent || strEmpty).toLowerCase() : strEmpty; } var ua = (userAgentStr || strEmpty).toLowerCase(); return (ua.indexOf("safari") >= 0); } function isBeaconsSupported() { if (_beaconsSupported === null) { _beaconsSupported = hasNavigator() && Boolean(getNavigator().sendBeacon); } return _beaconsSupported; } function isFetchSupported(withKeepAlive) { var isSupported = false; try { isSupported = !!getGlobalInst("fetch"); var request = getGlobalInst("Request"); if (isSupported && withKeepAlive && request) { isSupported = _hasProperty(request, "keepalive"); } } catch (e) { } return isSupported; } function useXDomainRequest() { if (_useXDomainRequest === null) { _useXDomainRequest = (typeof XDomainRequest !== strShimUndefined); if (_useXDomainRequest && isXhrSupported()) { _useXDomainRequest = _useXDomainRequest && !_hasProperty(getGlobalInst(strXMLHttpRequest), "withCredentials"); } } return _useXDomainRequest; } function isXhrSupported() { var isSupported = false; try { var xmlHttpRequest = getGlobalInst(strXMLHttpRequest); isSupported = !!xmlHttpRequest; } catch (e) { } return isSupported; } var listenerFuncs = ["eventsSent", "eventsDiscarded", "eventsSendRequest", "perfEvent"]; var _aiNamespace = null; var _debugListener; function _listenerProxyFunc(name, config) { return function () { var args = arguments; var dbgExt = getDebugExt(config); if (dbgExt) { var listener = dbgExt.listener; if (listener && listener[name]) { listener[name].apply(listener, args); } } }; } function _getExtensionNamespace() { var target = getGlobalInst("Microsoft"); if (target) { _aiNamespace = target["ApplicationInsights"]; } return _aiNamespace; } function getDebugExt(config) { var ns = _aiNamespace; if (!ns && config.disableDbgExt !== true) { ns = _aiNamespace || _getExtensionNamespace(); } return ns ? ns["ChromeDbgExt"] : null; } function getDebugListener(config) { if (!_debugListener) { _debugListener = {}; for (var lp = 0; lp < listenerFuncs.length; lp++) { _debugListener[listenerFuncs[lp]] = _listenerProxyFunc(listenerFuncs[lp], config); } } return _debugListener; } var AiNonUserActionablePrefix = "AI (Internal): "; var AiUserActionablePrefix = "AI: "; var AIInternalMessagePrefix = "AITR_"; var strErrorToConsole = "errorToConsole"; var strWarnToConsole = "warnToConsole"; function _sanitizeDiagnosticText(text) { if (text) { return "\"" + text.replace(/\"/g, strEmpty) + "\""; } return strEmpty; } function _logToConsole(func, message) { var theConsole = getConsole(); if (!!theConsole) { var logFunc = "log"; if (theConsole[func]) { logFunc = func; } if (isFunction(theConsole[logFunc])) { theConsole[logFunc](message); } } } var _InternalLogMessage = /** @class */ (function () { function _InternalLogMessage(msgId, msg, isUserAct, properties) { if (isUserAct === void 0) { isUserAct = false; } var _self = this; _self.messageId = msgId; _self.message = (isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) + msgId; var strProps = strEmpty; if (hasJSON()) { strProps = getJSON().stringify(properties); } var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : strEmpty) + (properties ? " props:" + _sanitizeDiagnosticText(strProps) : strEmpty); _self.message += diagnosticText; } _InternalLogMessage.dataType = "MessageData"; return _InternalLogMessage; }()); function safeGetLogger(core, config) { return (core || {}).logger || new DiagnosticLogger(config); } var DiagnosticLogger = /** @class */ (function () { function DiagnosticLogger(config) { this.identifier = "DiagnosticLogger"; this.queue = []; var _messageCount = 0; var _messageLogged = {}; dynamicProto(DiagnosticLogger, this, function (_self) { if (isNullOrUndefined(config)) { config = {}; } _self.consoleLoggingLevel = function () { return _getConfigValue("loggingLevelConsole", 0); }; _self.telemetryLoggingLevel = function () { return _getConfigValue("loggingLevelTelemetry", 1); }; _self.maxInternalMessageLimit = function () { return _getConfigValue("maxMessageLimit", 25); }; _self.enableDebugExceptions = function () { return _getConfigValue("enableDebugExceptions", false); }; _self.throwInternal = function (severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } var message = new _InternalLogMessage(msgId, msg, isUserAct, properties); if (_self.enableDebugExceptions()) { throw dumpObj(message); } else { var logFunc = severity === 1 ? strErrorToConsole : strWarnToConsole; if (!isUndefined(message.message)) { var logLevel = _self.consoleLoggingLevel(); if (isUserAct) { var messageKey = +message.messageId; if (!_messageLogged[messageKey] && logLevel >= severity) { _self[logFunc](message.message); _messageLogged[messageKey] = true; } } else { if (logLevel >= severity) { _self[logFunc](message.message); } } _self.logInternalMessage(severity, message); } else { _debugExtMsg("throw" + (severity === 1 ? "Critical" : "Warning"), message); } } }; _self.warnToConsole = function (message) { _logToConsole("warn", message); _debugExtMsg("warning", message); }; _self.errorToConsole = function (message) { _logToConsole("error", message); _debugExtMsg("error", message); }; _self.resetInternalMessageCount = function () { _messageCount = 0; _messageLogged = {}; }; _self.logInternalMessage = function (severity, message) { if (_areInternalMessagesThrottled()) { return; } var logMessage = true; var messageKey = AIInternalMessagePrefix + message.messageId; if (_messageLogged[messageKey]) { logMessage = false; } else { _messageLogged[messageKey] = true; } if (logMessage) { if (severity <= _self.telemetryLoggingLevel()) { _self.queue.push(message); _messageCount++; _debugExtMsg((severity === 1 ? "error" : "warn"), message); } if (_messageCount === _self.maxInternalMessageLimit()) { var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app."; var throttleMessage = new _InternalLogMessage(23 , throttleLimitMessage, false); _self.queue.push(throttleMessage); if (severity === 1 ) { _self.errorToConsole(throttleLimitMessage); } else { _self.warnToConsole(throttleLimitMessage); } } } }; function _getConfigValue(name, defValue) { var value = config[name]; if (!isNullOrUndefined(value)) { return value; } return defValue; } function _areInternalMessagesThrottled() { return _messageCount >= _self.maxInternalMessageLimit(); } function _debugExtMsg(name, data) { var dbgExt = getDebugExt(config); if (dbgExt && dbgExt.diagLog) { dbgExt.diagLog(name, data); } } }); } return DiagnosticLogger; }()); function _getLogger(logger) { return (logger || new DiagnosticLogger()); } function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } (logger || new DiagnosticLogger()).throwInternal(severity, msgId, msg, properties, isUserAct); } function _warnToConsole(logger, message) { _getLogger(logger).warnToConsole(message); } function _logInternalMessage(logger, severity, message) { _getLogger(logger).logInternalMessage(severity, message); } var strExecutionContextKey = "ctx"; var _defaultPerfManager = null; var PerfEvent = /** @class */ (function () { function PerfEvent(name, payloadDetails, isAsync) { var _self = this; var accessorDefined = false; _self.start = dateNow(); _self.name = name; _self.isAsync = isAsync; _self.isChildEvt = function () { return false; }; if (isFunction(payloadDetails)) { var theDetails_1; accessorDefined = objDefineAccessors(_self, "payload", function () { if (!theDetails_1 && isFunction(payloadDetails)) { theDetails_1 = payloadDetails(); payloadDetails = null; } return theDetails_1; }); } _self.getCtx = function (key) { if (key) { if (key === PerfEvent.ParentContextKey || key === PerfEvent.ChildrenContextKey) { return _self[key]; } return (_self[strExecutionContextKey] || {})[key]; } return null; }; _self.setCtx = function (key, value) { if (key) { if (key === PerfEvent.ParentContextKey) { if (!_self[key]) { _self.isChildEvt = function () { return true; }; } _self[key] = value; } else if (key === PerfEvent.ChildrenContextKey) { _self[key] = value; } else { var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {}; ctx[key] = value; } } }; _self.complete = function () { var childTime = 0; var childEvts = _self.getCtx(PerfEvent.ChildrenContextKey); if (isArray(childEvts)) { for (var lp = 0; lp < childEvts.length; lp++) { var childEvt = childEvts[lp]; if (childEvt) { childTime += childEvt.time; } } } _self.time = dateNow() - _self.start; _self.exTime = _self.time - childTime; _self.complete = function () { }; if (!accessorDefined && isFunction(payloadDetails)) { _self.payload = payloadDetails(); } }; } PerfEvent.ParentContextKey = "parent"; PerfEvent.ChildrenContextKey = "childEvts"; return PerfEvent; }()); var PerfManager = /** @class */ (function () { function PerfManager(manager) { this.ctx = {}; dynamicProto(PerfManager, this, function (_self) { _self.create = function (src, payloadDetails, isAsync) { return new PerfEvent(src, payloadDetails, isAsync); }; _self.fire = function (perfEvent) { if (perfEvent) { perfEvent.complete(); if (manager && isFunction(manager.perfEvent)) { manager.perfEvent(perfEvent); } } }; _self.setCtx = function (key, value) { if (key) { var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {}; ctx[key] = value; } }; _self.getCtx = function (key) { return (_self[strExecutionContextKey] || {})[key]; }; }); } return PerfManager; }()); var doPerfActiveKey = "CoreUtils.doPerf"; function doPerf(mgrSource, getSource, func, details, isAsync) { if (mgrSource) { var perfMgr = mgrSource; if (isFunction(perfMgr["getPerfMgr"])) { perfMgr = perfMgr["getPerfMgr"](); } if (perfMgr) { var perfEvt = void 0; var currentActive = perfMgr.getCtx(doPerfActiveKey); try { perfEvt = perfMgr.create(getSource(), details, isAsync); if (perfEvt) { if (currentActive && perfEvt.setCtx) { perfEvt.setCtx(PerfEvent.ParentContextKey, currentActive); if (currentActive.getCtx && currentActive.setCtx) { var children = currentActive.getCtx(PerfEvent.ChildrenContextKey); if (!children) { children = []; currentActive.setCtx(PerfEvent.ChildrenContextKey, children); } children.push(perfEvt); } } perfMgr.setCtx(doPerfActiveKey, perfEvt); return func(perfEvt); } } catch (ex) { if (perfEvt && perfEvt.setCtx) { perfEvt.setCtx("exception", ex); } } finally { if (perfEvt) { perfMgr.fire(perfEvt); } perfMgr.setCtx(doPerfActiveKey, currentActive); } } } return func(); } function setGblPerfMgr(perfManager) { _defaultPerfManager = perfManager; } function getGblPerfMgr() { return _defaultPerfManager; } var UInt32Mask = 0x100000000; var MaxUInt32 = 0xffffffff; var _mwcSeeded = false; var _mwcW = 123456789; var _mwcZ = 987654321; function _mwcSeed(seedValue) { if (seedValue < 0) { seedValue >>>= 0; } _mwcW = (123456789 + seedValue) & MaxUInt32; _mwcZ = (987654321 - seedValue) & MaxUInt32; _mwcSeeded = true; } function _autoSeedMwc() { try { var now = dateNow() & 0x7fffffff; _mwcSeed(((Math.random() * UInt32Mask) ^ now) + now); } catch (e) { } } function randomValue(maxValue) { if (maxValue > 0) { return Math.floor((random32() / MaxUInt32) * (maxValue + 1)) >>> 0; } return 0; } function random32(signed) { var value = 0; var c = getCrypto() || getMsCrypto(); if (c && c.getRandomValues) { value = c.getRandomValues(new Uint32Array(1))[0] & MaxUInt32; } if (value === 0 && isIE()) { if (!_mwcSeeded) { _autoSeedMwc(); } value = mwcRandom32() & MaxUInt32; } if (value === 0) { value = Math.floor((UInt32Mask * Math.random()) | 0); } if (!signed) { value >>>= 0; } return value; } function mwcRandomSeed(value) { if (!value) { _autoSeedMwc(); } else { _mwcSeed(value); } } function mwcRandom32(signed) { _mwcZ = (36969 * (_mwcZ & 0xFFFF) + (_mwcZ >> 16)) & MaxUInt32; _mwcW = (18000 * (_mwcW & 0xFFFF) + (_mwcW >> 16)) & MaxUInt32; var value = (((_mwcZ << 16) + (_mwcW & 0xFFFF)) >>> 0) & MaxUInt32 | 0; if (!signed) { value >>>= 0; } return value; } function newId(maxLength) { if (maxLength === void 0) { maxLength = 22; } var base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; var number = random32() >>> 0; var chars = 0; var result = strEmpty; while (result.length < maxLength) { chars++; result += base64chars.charAt(number & 0x3F); number >>>= 6; if (chars === 5) { number = (((random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0; chars = 0; } } return result; } var _objDefineProperty = ObjDefineProperty; var version = "2.8.3"; var instanceName = "." + newId(6); var _dataUid = 0; function _createAccessor(target, prop, value) { if (_objDefineProperty) { try { _objDefineProperty(target, prop, { value: value, enumerable: false, configurable: true }); return true; } catch (e) { } } return false; } function _canAcceptData(target) { return target.nodeType === 1 || target.nodeType === 9 || !(+target.nodeType); } function _getCache(data, target) { var theCache = target[data.id]; if (!theCache) { theCache = {}; try { if (_canAcceptData(target)) { if (!_createAccessor(target, data.id, theCache)) { target[data.id] = theCache; } } } catch (e) { } } return theCache; } function createUniqueNamespace(name, includeVersion) { if (includeVersion === void 0) { includeVersion = false; } return normalizeJsName(name + (_dataUid++) + (includeVersion ? "." + version : "") + instanceName); } function createElmNodeData(name) { var data = { id: createUniqueNamespace("_aiData-" + (name || "") + "." + version), accept: function (target) { return _canAcceptData(target); }, get: function (target, name, defValue, addDefault) { var theCache = target[data.id]; if (!theCache) { if (addDefault) { theCache = _getCache(data, target); theCache[normalizeJsName(name)] = defValue; } return defValue; } return theCache[normalizeJsName(name)]; }, kill: function (target, name) { if (target && target[name]) { try { delete target[name]; } catch (e) { } } } }; return data; } var strDoUnload = "_doUnload"; var pluginStateData = createElmNodeData("plugin"); function _getPluginState(plugin) { return pluginStateData.get(plugin, "state", {}, true); } function initializePlugins(processContext, extensions) { var initPlugins = []; var lastPlugin = null; var proxy = processContext.getNext(); var pluginState; while (proxy) { var thePlugin = proxy.getPlugin(); if (thePlugin) { if (lastPlugin && isFunction(lastPlugin[strSetNextPlugin]) && isFunction(thePlugin[strProcessTelemetry])) { lastPlugin[strSetNextPlugin](thePlugin); } var isInitialized = false; if (isFunction(thePlugin[strIsInitialized])) { isInitialized = thePlugin[strIsInitialized](); } else { pluginState = _getPluginState(thePlugin); isInitialized = pluginState[strIsInitialized]; } if (!isInitialized) { initPlugins.push(thePlugin); } lastPlugin = thePlugin; proxy = proxy.getNext(); } } arrForEach(initPlugins, function (thePlugin) { var core = processContext.core(); thePlugin.initialize(processContext.getCfg(), core, extensions, processContext.getNext()); pluginState = _getPluginState(thePlugin); if (!thePlugin[strCore] && !pluginState[strCore]) { pluginState[strCore] = core; } pluginState[strIsInitialized] = true; delete pluginState[strTeardown]; }); } function sortPlugins(plugins) { return plugins.sort(function (extA, extB) { var result = 0; var bHasProcess = isFunction(extB[strProcessTelemetry]); if (isFunction(extA[strProcessTelemetry])) { result = bHasProcess ? extA[strPriority] - extB[strPriority] : 1; } else if (bHasProcess) { result = -1; } return result; }); } function unloadComponents(components, unloadCtx, unloadState, asyncCallback) { var idx = 0; function _doUnload() { while (idx < components.length) { var component = components[idx++]; if (component) { var func = component[strDoUnload] || component[strDoTeardown]; if (isFunction(func)) { if (func.call(component, unloadCtx, unloadState, _doUnload) === true) { return true; } } } } } return _doUnload(); } var strTelemetryPluginChain = "TelemetryPluginChain"; var strHasRunFlags = "_hasRun"; var strGetTelCtx = "_getTelCtx"; var _chainId = 0; function _getNextProxyStart(proxy, core, startAt) { while (proxy) { if (proxy.getPlugin() === startAt) { return proxy; } proxy = proxy.getNext(); } return createTelemetryProxyChain([startAt], core.config || {}, core); } function _createInternalContext(telemetryChain, config, core, startAt) { var _nextProxy = null; var _onComplete = []; if (startAt !== null) { _nextProxy = startAt ? _getNextProxyStart(telemetryChain, core, startAt) : telemetryChain; } var context = { _next: _moveNext, ctx: { core: function () { return core; }, diagLog: function () { return safeGetLogger(core, config); }, getCfg: function () { return config; }, getExtCfg: _getExtCfg, getConfig: _getConfig, hasNext: function () { return !!_nextProxy; }, getNext: function () { return _nextProxy; }, setNext: function (nextPlugin) { _nextProxy = nextPlugin; }, iterate: _iterateChain, onComplete: _addOnComplete } }; function _addOnComplete(onComplete, that) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } if (onComplete) { _onComplete.push({ func: onComplete, self: !isUndefined(that) ? that : context.ctx, args: args }); } } function _moveNext() { var nextProxy = _nextProxy; _nextProxy = nextProxy ? nextProxy.getNext() : null; if (!nextProxy) { var onComplete = _onComplete; if (onComplete && onComplete.length > 0) { arrForEach(onComplete, function (completeDetails) { try { completeDetails.func.call(completeDetails.self, completeDetails.args); } catch (e) { _throwInternal(core.logger, 2 , 73 , "Unexpected Exception during onComplete - " + dumpObj(e)); } }); _onComplete = []; } } return nextProxy; } function _getExtCfg(identifier, defaultValue, mergeDefault) { if (defaultValue === void 0) { defaultValue = {}; } if (mergeDefault === void 0) { mergeDefault = 0 ; } var theConfig; if (config) { var extConfig = config.extensionConfig; if (extConfig && identifier) { theConfig = extConfig[identifier]; } } if (!theConfig) { theConfig = defaultValue; } else if (isObject(defaultValue)) { if (mergeDefault !== 0 ) { var newConfig_1 = objExtend(true, defaultValue, theConfig); if (config && mergeDefault === 2 ) { objForEachKey(defaultValue, function (field) { if (isNullOrUndefined(newConfig_1[field])) { var cfgValue = config[field]; if (!isNullOrUndefined(cfgValue)) { newConfig_1[field] = cfgValue; } } }); } theConfig = newConfig_1; } } return theConfig; } function _getConfig(identifier, field, defaultValue) { if (defaultValue === void 0) { defaultValue = false; } var theValue; var extConfig = _getExtCfg(identifier, null); if (extConfig && !isNullOrUndefined(extConfig[field])) { theValue = extConfig[field]; } else if (config && !isNullOrUndefined(config[field])) { theValue = config[field]; } return !isNullOrUndefined(theValue) ? theValue : defaultValue; } function _iterateChain(cb) { var nextPlugin; while (!!(nextPlugin = context._next())) { var plugin = nextPlugin.getPlugin(); if (plugin) { cb(plugin); } } } return context; } function createProcessTelemetryContext(telemetryChain, config, core, startAt) { var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(env) { var nextPlugin = internalContext._next(); nextPlugin && nextPlugin.processTelemetry(env, context); return !nextPlugin; } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryContext(plugins || context.getNext(), config, core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } function createProcessTelemetryUnloadContext(telemetryChain, core, startAt) { var config = core.config || {}; var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(unloadState) { var nextPlugin = internalContext._next(); nextPlugin && nextPlugin.unload(context, unloadState); return !nextPlugin; } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryUnloadContext(plugins || context.getNext(), core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } function createProcessTelemetryUpdateContext(telemetryChain, core, startAt) { var config = core.config || {}; var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(updateState) { return context.iterate(function (plugin) { if (isFunction(plugin.update)) { plugin.update(context, updateState); } }); } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryUpdateContext(plugins || context.getNext(), core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } function createTelemetryProxyChain(plugins, config, core, startAt) { var firstProxy = null; var add = startAt ? false : true; if (isArray(plugins) && plugins.length > 0) { var lastProxy_1 = null; arrForEach(plugins, function (thePlugin) { if (!add && startAt === thePlugin) { add = true; } if (add && thePlugin && isFunction(thePlugin.processTelemetry)) { var newProxy = createTelemetryPluginProxy(thePlugin, config, core); if (!firstProxy) { firstProxy = newProxy; } if (lastProxy_1) { lastProxy_1._setNext(newProxy); } lastProxy_1 = newProxy; } }); } if (startAt && !firstProxy) { return createTelemetryProxyChain([startAt], config, core); } return firstProxy; } function createTelemetryPluginProxy(plugin, config, core) { var nextProxy = null; var hasProcessTelemetry = isFunction(plugin.processTelemetry); var hasSetNext = isFunction(plugin.setNextPlugin); var chainId; if (plugin) { chainId = plugin.identifier + "-" + plugin.priority + "-" + _chainId++; } else { chainId = "Unknown-0-" + _chainId++; } var proxyChain = { getPlugin: function () { return plugin; }, getNext: function () { return nextProxy; }, processTelemetry: _processTelemetry, unload: _unloadPlugin, update: _updatePlugin, _id: chainId, _setNext: function (nextPlugin) { nextProxy = nextPlugin; } }; function _getTelCtx() { var itemCtx; if (plugin && isFunction(plugin[strGetTelCtx])) { itemCtx = plugin[strGetTelCtx](); } if (!itemCtx) { itemCtx = createProcessTelemetryContext(proxyChain, config, core); } return itemCtx; } function _processChain(itemCtx, processPluginFn, name, details, isAsync) { var hasRun = false; var identifier = plugin ? plugin.identifier : strTelemetryPluginChain; var hasRunContext = itemCtx[strHasRunFlags]; if (!hasRunContext) { hasRunContext = itemCtx[strHasRunFlags] = {}; } itemCtx.setNext(nextProxy); if (plugin) { doPerf(itemCtx[strCore](), function () { return identifier + ":" + name; }, function () { hasRunContext[chainId] = true; try { var nextId = nextProxy ? nextProxy._id : strEmpty; if (nextId) { hasRunContext[nextId] = false; } hasRun = processPluginFn(itemCtx); } catch (error) { var hasNextRun = nextProxy ? hasRunContext[nextProxy._id] : true; if (hasNextRun) { hasRun = true; } if (!nextProxy || !hasNextRun) { _throwInternal(itemCtx.diagLog(), 1 , 73 , "Plugin [" + identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext)); } } }, details, isAsync); } return hasRun; } function _processTelemetry(env, itemCtx) { itemCtx = itemCtx || _getTelCtx(); function _callProcessTelemetry(itemCtx) { if (!plugin || !hasProcessTelemetry) { return false; } var pluginState = _getPluginState(plugin); if (pluginState.teardown || pluginState[strDisabled]) { return false; } if (hasSetNext) { plugin.setNextPlugin(nextProxy); } plugin.processTelemetry(env, itemCtx); return true; } if (!_processChain(itemCtx, _callProcessTelemetry, "processTelemetry", function () { return ({ item: env }); }, !(env.sync))) { itemCtx.processNext(env); } } function _unloadPlugin(unloadCtx, unloadState) { function _callTeardown() { var hasRun = false; if (plugin) { var pluginState = _getPluginState(plugin); var pluginCore = plugin[strCore] || pluginState.core; if (plugin && (!pluginCore || pluginCore === unloadCtx[strCore]()) && !pluginState[strTeardown]) { pluginState[strCore] = null; pluginState[strTeardown] = true; pluginState[strIsInitialized] = false; if (plugin[strTeardown] && plugin[strTeardown](unloadCtx, unloadState) === true) { hasRun = true; } } } return hasRun; } if (!_processChain(unloadCtx, _callTeardown, "unload", function () { }, unloadState.isAsync)) { unloadCtx.processNext(unloadState); } } function _updatePlugin(updateCtx, updateState) { function _callUpdate() { var hasRun = false; if (plugin) { var pluginState = _getPluginState(plugin); var pluginCore = plugin[strCore] || pluginState.core; if (plugin && (!pluginCore || pluginCore === updateCtx[strCore]()) && !pluginState[strTeardown]) { if (plugin[strUpdate] && plugin[strUpdate](updateCtx, updateState) === true) { hasRun = true; } } } return hasRun; } if (!_processChain(updateCtx, _callUpdate, "update", function () { }, false)) { updateCtx.processNext(updateState); } } return objFreeze(proxyChain); } var ProcessTelemetryContext = /** @class */ (function () { function ProcessTelemetryContext(pluginChain, config, core, startAt) { var _self = this; var context = createProcessTelemetryContext(pluginChain, config, core, startAt); proxyFunctions(_self, context, objKeys(context)); } return ProcessTelemetryContext; }()); var strToGMTString = "toGMTString"; var strToUTCString = "toUTCString"; var strCookie = "cookie"; var strExpires = "expires"; var strEnabled = "enabled"; var strIsCookieUseDisabled = "isCookieUseDisabled"; var strDisableCookiesUsage = "disableCookiesUsage"; var strConfigCookieMgr = "_ckMgr"; var _supportsCookies = null; var _allowUaSameSite = null; var _parsedCookieValue = null; var _doc = getDocument(); var _cookieCache = {}; var _globalCookieConfig = {}; function _gblCookieMgr(config, logger) { var inst = createCookieMgr[strConfigCookieMgr] || _globalCookieConfig[strConfigCookieMgr]; if (!inst) { inst = createCookieMgr[strConfigCookieMgr] = createCookieMgr(config, logger); _globalCookieConfig[strConfigCookieMgr] = inst; } return inst; } function _isMgrEnabled(cookieMgr) { if (cookieMgr) { return cookieMgr.isEnabled(); } return true; } function _createCookieMgrConfig(rootConfig) { var cookieMgrCfg = rootConfig.cookieCfg = rootConfig.cookieCfg || {}; setValue(cookieMgrCfg, "domain", rootConfig.cookieDomain, isNotNullOrUndefined, isNullOrUndefined); setValue(cookieMgrCfg, "path", rootConfig.cookiePath || "/", null, isNullOrUndefined); if (isNullOrUndefined(cookieMgrCfg[strEnabled])) { var cookieEnabled = void 0; if (!isUndefined(rootConfig[strIsCookieUseDisabled])) { cookieEnabled = !rootConfig[strIsCookieUseDisabled]; } if (!isUndefined(rootConfig[strDisableCookiesUsage])) { cookieEnabled = !rootConfig[strDisableCookiesUsage]; } cookieMgrCfg[strEnabled] = cookieEnabled; } return cookieMgrCfg; } function safeGetCookieMgr(core, config) { var cookieMgr; if (core) { cookieMgr = core.getCookieMgr(); } else if (config) { var cookieCfg = config.cookieCfg; if (cookieCfg[strConfigCookieMgr]) { cookieMgr = cookieCfg[strConfigCookieMgr]; } else { cookieMgr = createCookieMgr(config); } } if (!cookieMgr) { cookieMgr = _gblCookieMgr(config, (core || {}).logger); } return cookieMgr; } function createCookieMgr(rootConfig, logger) { var cookieMgrConfig = _createCookieMgrConfig(rootConfig || _globalCookieConfig); var _path = cookieMgrConfig.path || "/"; var _domain = cookieMgrConfig.domain; var _enabled = cookieMgrConfig[strEnabled] !== false; var cookieMgr = { isEnabled: function () { var enabled = _enabled && areCookiesSupported(logger); var gblManager = _globalCookieConfig[strConfigCookieMgr]; if (enabled && gblManager && cookieMgr !== gblManager) { enabled = _isMgrEnabled(gblManager); } return enabled; }, setEnabled: function (value) { _enabled = value !== false; }, set: function (name, value, maxAgeSec, domain, path) { var result = false; if (_isMgrEnabled(cookieMgr)) { var values = {}; var theValue = strTrim(value || strEmpty); var idx = theValue.indexOf(";"); if (idx !== -1) { theValue = strTrim(value.substring(0, idx)); values = _extractParts(value.substring(idx + 1)); } setValue(values, "domain", domain || _domain, isTruthy, isUndefined); if (!isNullOrUndefined(maxAgeSec)) { var _isIE = isIE(); if (isUndefined(values[strExpires])) { var nowMs = dateNow(); var expireMs = nowMs + (maxAgeSec * 1000); if (expireMs > 0) { var expiry = new Date(); expiry.setTime(expireMs); setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || strEmpty, isTruthy); } } if (!_isIE) { setValue(values, "max-age", strEmpty + maxAgeSec, null, isUndefined); } } var location_1 = getLocation(); if (location_1 && location_1.protocol === "https:") { setValue(values, "secure", null, null, isUndefined); if (_allowUaSameSite === null) { _allowUaSameSite = !uaDisallowsSameSiteNone((getNavigator() || {}).userAgent); } if (_allowUaSameSite) { setValue(values, "SameSite", "None", null, isUndefined); } } setValue(values, "path", path || _path, null, isUndefined); var setCookieFn = cookieMgrConfig.setCookie || _setCookieValue; setCookieFn(name, _formatCookieValue(theValue, values)); result = true; } return result; }, get: function (name) { var value = strEmpty; if (_isMgrEnabled(cookieMgr)) { value = (cookieMgrConfig.getCookie || _getCookieValue)(name); } return value; }, del: function (name, path) { var result = false; if (_isMgrEnabled(cookieMgr)) { result = cookieMgr.purge(name, path); } return result; }, purge: function (name, path) { var _a; var result = false; if (areCookiesSupported(logger)) { var values = (_a = {}, _a["path"] = path ? path : "/", _a[strExpires] = "Thu, 01 Jan 1970 00:00:01 GMT", _a); if (!isIE()) { values["max-age"] = "0"; } var delCookie = cookieMgrConfig.delCookie || _setCookieValue; delCookie(name, _formatCookieValue(strEmpty, values)); result = true; } return result; } }; cookieMgr[strConfigCookieMgr] = cookieMgr; return cookieMgr; } function areCookiesSupported(logger) { if (_supportsCookies === null) { _supportsCookies = false; try { var doc = _doc || {}; _supportsCookies = doc[strCookie] !== undefined; } catch (e) { _throwInternal(logger, 2 , 68 , "Cannot access document.cookie - " + getExceptionName(e), { exception: dumpObj(e) }); } } return _supportsCookies; } function _extractParts(theValue) { var values = {}; if (theValue && theValue.length) { var parts = strTrim(theValue).split(";"); arrForEach(parts, function (thePart) { thePart = strTrim(thePart || strEmpty); if (thePart) { var idx = thePart.indexOf("="); if (idx === -1) { values[thePart] = null; } else { values[strTrim(thePart.substring(0, idx))] = strTrim(thePart.substring(idx + 1)); } } }); } return values; } function _formatDate(theDate, func) { if (isFunction(theDate[func])) { return theDate[func](); } return null; } function _formatCookieValue(value, values) { var cookieValue = value || strEmpty; objForEachKey(values, function (name, theValue) { cookieValue += "; " + name + (!isNullOrUndefined(theValue) ? "=" + theValue : strEmpty); }); return cookieValue; } function _getCookieValue(name) { var cookieValue = strEmpty; if (_doc) { var theCookie = _doc[strCookie] || strEmpty; if (_parsedCookieValue !== theCookie) { _cookieCache = _extractParts(theCookie); _parsedCookieValue = theCookie; } cookieValue = strTrim(_cookieCache[name] || strEmpty); } return cookieValue; } function _setCookieValue(name, cookieValue) { if (_doc) { _doc[strCookie] = name + "=" + cookieValue; } } function uaDisallowsSameSiteNone(userAgent) { if (!isString(userAgent)) { return false; } if (strContains(userAgent, "CPU iPhone OS 12") || strContains(userAgent, "iPad; CPU OS 12")) { return true; } if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strContains(userAgent, "Version/") && strContains(userAgent, "Safari")) { return true; } if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strEndsWith(userAgent, "AppleWebKit/605.1.15 (KHTML, like Gecko)")) { return true; } if (strContains(userAgent, "Chrome/5") || strContains(userAgent, "Chrome/6")) { return true; } if (strContains(userAgent, "UnrealEngine") && !strContains(userAgent, "Chrome")) { return true; } if (strContains(userAgent, "UCBrowser/12") || strContains(userAgent, "UCBrowser/11")) { return true; } return false; } var strIKey = "iKey"; var strExtensionConfig = "extensionConfig"; var ChannelControllerPriority = 500; var ChannelValidationMessage = "Channel has invalid priority - "; function _addChannelQueue(channelQueue, queue, config, core) { if (queue && isArray(queue) && queue.length > 0) { queue = queue.sort(function (a, b) { return a.priority - b.priority; }); arrForEach(queue, function (queueItem) { if (queueItem.priority < ChannelControllerPriority) { throwError(ChannelValidationMessage + queueItem.identifier); } }); channelQueue.push({ queue: objFreeze(queue), chain: createTelemetryProxyChain(queue, config, core) }); } } function createChannelControllerPlugin(channelQueue, core) { var _a; function _getTelCtx() { return createProcessTelemetryContext(null, core.config, core, null); } function _processChannelQueue(theChannels, itemCtx, processFn, onComplete) { var waiting = theChannels ? (theChannels.length + 1) : 1; function _runChainOnComplete() { waiting--; if (waiting === 0) { onComplete && onComplete(); onComplete = null; } } if (waiting > 0) { arrForEach(theChannels, function (channels) { if (channels && channels.queue.length > 0) { var channelChain = channels.chain; var chainCtx = itemCtx.createNew(channelChain); chainCtx.onComplete(_runChainOnComplete); processFn(chainCtx); } else { waiting--; } }); } _runChainOnComplete(); } function _doUpdate(updateCtx, updateState) { var theUpdateState = updateState || { reason: 0 }; _processChannelQueue(channelQueue, updateCtx, function (chainCtx) { chainCtx[strProcessNext](theUpdateState); }, function () { updateCtx[strProcessNext](theUpdateState); }); return true; } function _doTeardown(unloadCtx, unloadState) { var theUnloadState = unloadState || { reason: 0 , isAsync: false }; _processChannelQueue(channelQueue, unloadCtx, function (chainCtx) { chainCtx[strProcessNext](theUnloadState); }, function () { unloadCtx[strProcessNext](theUnloadState); isInitialized = false; }); return true; } function _getChannel(pluginIdentifier) { var thePlugin = null; if (channelQueue && channelQueue.length > 0) { arrForEach(channelQueue, function (channels) { if (channels && channels.queue.length > 0) { arrForEach(channels.queue, function (ext) { if (ext.identifier === pluginIdentifier) { thePlugin = ext; return -1; } }); if (thePlugin) { return -1; } } }); } return thePlugin; } var isInitialized = false; var channelController = (_a = { identifier: "ChannelControllerPlugin", priority: ChannelControllerPriority, initialize: function (config, core, extensions, pluginChain) { isInitialized = true; arrForEach(channelQueue, function (channels) { if (channels && channels.queue.length > 0) { initializePlugins(createProcessTelemetryContext(channels.chain, config, core), extensions); } }); }, isInitialized: function () { return isInitialized; }, processTelemetry: function (item, itemCtx) { _processChannelQueue(channelQueue, itemCtx || _getTelCtx(), function (chainCtx) { chainCtx[strProcessNext](item); }, function () { itemCtx[strProcessNext](item); }); }, update: _doUpdate }, _a[strPause] = function () { _processChannelQueue(channelQueue, _getTelCtx(), function (chainCtx) { chainCtx.iterate(function (plugin) { plugin[strPause] && plugin[strPause](); }); }, null); }, _a[strResume] = function () { _processChannelQueue(channelQueue, _getTelCtx(), function (chainCtx) { chainCtx.iterate(function (plugin) { plugin[strResume] && plugin[strResume](); }); }, null); }, _a[strTeardown] = _doTeardown, _a.getChannel = _getChannel, _a.flush = function (isAsync, callBack, sendReason, cbTimeout) { var waiting = 1; var doneIterating = false; var cbTimer = null; cbTimeout = cbTimeout || 5000; function doCallback() { waiting--; if (doneIterating && waiting === 0) { if (cbTimer) { clearTimeout(cbTimer); cbTimer = null; } callBack && callBack(doneIterating); callBack = null; } } _processChannelQueue(channelQueue, _getTelCtx(), function (chainCtx) { chainCtx.iterate(function (plugin) { if (plugin.flush) { waiting++; var handled_1 = false; if (!plugin.flush(isAsync, function () { handled_1 = true; doCallback(); }, sendReason)) { if (!handled_1) { if (isAsync && cbTimer == null) { cbTimer = setTimeout(function () { cbTimer = null; doCallback(); }, cbTimeout); } else { doCallback(); } } } } }); }, function () { doneIterating = true; doCallback(); }); return true; }, _a._setQueue = function (queue) { channelQueue = queue; }, _a); return channelController; } function createChannelQueues(channels, extensions, config, core) { var channelQueue = []; if (channels) { arrForEach(channels, function (queue) { return _addChannelQueue(channelQueue, queue, config, core); }); } if (extensions) { var extensionQueue_1 = []; arrForEach(extensions, function (plugin) { if (plugin.priority > ChannelControllerPriority) { extensionQueue_1.push(plugin); } }); _addChannelQueue(channelQueue, extensionQueue_1, config, core); } return channelQueue; } function createUnloadHandlerContainer() { var handlers = []; function _addHandler(handler) { if (handler) { handlers.push(handler); } } function _runHandlers(unloadCtx, unloadState) { arrForEach(handlers, function (handler) { try { handler(unloadCtx, unloadState); } catch (e) { _throwInternal(unloadCtx.diagLog(), 2 , 73 , "Unexpected error calling unload handler - " + dumpObj(e)); } }); handlers = []; } return { add: _addHandler, run: _runHandlers }; } var strGetPlugin = "getPlugin"; var BaseTelemetryPlugin = /** @class */ (function () { function BaseTelemetryPlugin() { var _self = this; var _isinitialized; var _rootCtx; var _nextPlugin; var _unloadHandlerContainer; var _hooks; _initDefaults(); dynamicProto(BaseTelemetryPlugin, _self, function (_self) { _self.initialize = function (config, core, extensions, pluginChain) { _setDefaults(config, core, pluginChain); _isinitialized = true; }; _self.teardown = function (unloadCtx, unloadState) { var core = _self.core; if (!core || (unloadCtx && core !== unloadCtx.core())) { return; } var result; var unloadDone = false; var theUnloadCtx = unloadCtx || createProcessTelemetryUnloadContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin); var theUnloadState = unloadState || { reason: 0 , isAsync: false }; function _unloadCallback() { if (!unloadDone) { unloadDone = true; _unloadHandlerContainer.run(theUnloadCtx, unloadState); arrForEach(_hooks, function (fn) { fn.rm(); }); _hooks = []; if (result === true) { theUnloadCtx.processNext(theUnloadState); } _initDefaults(); } } if (!_self[strDoTeardown] || _self[strDoTeardown](theUnloadCtx, theUnloadState, _unloadCallback) !== true) { _unloadCallback(); } else { result = true; } return result; }; _self.update = function (updateCtx, updateState) { var core = _self.core; if (!core || (updateCtx && core !== updateCtx.core())) { return; } var result; var updateDone = false; var theUpdateCtx = updateCtx || createProcessTelemetryUpdateContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin); var theUpdateState = updateState || { reason: 0 }; function _updateCallback() { if (!updateDone) { updateDone = true; _setDefaults(theUpdateCtx.getCfg(), theUpdateCtx.core(), theUpdateCtx.getNext()); } } if (!_self._doUpdate || _self._doUpdate(theUpdateCtx, theUpdateState, _updateCallback) !== true) { _updateCallback(); } else { result = true; } return result; }; _self._addHook = function (hooks) { if (hooks) { if (isArray(hooks)) { _hooks = _hooks.concat(hooks); } else { _hooks.push(hooks); } } }; proxyFunctionAs(_self, "_addUnloadCb", function () { return _unloadHandlerContainer; }, "add"); }); _self.diagLog = function (itemCtx) { return _getTelCtx(itemCtx).diagLog(); }; _self[strIsInitialized] = function () { return _isinitialized; }; _self.setInitialized = function (isInitialized) { _isinitialized = isInitialized; }; _self[strSetNextPlugin] = function (next) { _nextPlugin = next; }; _self.processNext = function (env, itemCtx) { if (itemCtx) { itemCtx.processNext(env); } else if (_nextPlugin && isFunction(_nextPlugin.processTelemetry)) { _nextPlugin.processTelemetry(env, null); } }; _self._getTelCtx = _getTelCtx; function _getTelCtx(currentCtx) { if (currentCtx === void 0) { currentCtx = null; } var itemCtx = currentCtx; if (!itemCtx) { var rootCtx = _rootCtx || createProcessTelemetryContext(null, {}, _self.core); if (_nextPlugin && _nextPlugin[strGetPlugin]) { itemCtx = rootCtx.createNew(null, _nextPlugin[strGetPlugin]); } else { itemCtx = rootCtx.createNew(null, _nextPlugin); } } return itemCtx; } function _setDefaults(config, core, pluginChain) { if (config) { setValue(config, strExtensionConfig, [], null, isNullOrUndefined); } if (!pluginChain && core) { pluginChain = core.getProcessTelContext().getNext(); } var nextPlugin = _nextPlugin; if (_nextPlugin && _nextPlugin[strGetPlugin]) { nextPlugin = _nextPlugin[strGetPlugin](); } _self.core = core; _rootCtx = createProcessTelemetryContext(pluginChain, config, core, nextPlugin); } function _initDefaults() { _isinitialized = false; _self.core = null; _rootCtx = null; _nextPlugin = null; _hooks = []; _unloadHandlerContainer = createUnloadHandlerContainer(); } } return BaseTelemetryPlugin; }()); var TelemetryInitializerPlugin = /** @class */ (function (_super) { __extendsFn(TelemetryInitializerPlugin, _super); function TelemetryInitializerPlugin() { var _this = _super.call(this) || this; _this.identifier = "TelemetryInitializerPlugin"; _this.priority = 199; var _id; var _initializers; _initDefaults(); dynamicProto(TelemetryInitializerPlugin, _this, function (_self, _base) { _self.addTelemetryInitializer = function (telemetryInitializer) { var theInitializer = { id: _id++, fn: telemetryInitializer }; _initializers.push(theInitializer); var handler = { remove: function () { arrForEach(_initializers, function (initializer, idx) { if (initializer.id === theInitializer.id) { _initializers.splice(idx, 1); return -1; } }); } }; return handler; }; _self.processTelemetry = function (item, itemCtx) { var doNotSendItem = false; var telemetryInitializersCount = _initializers.length; for (var i = 0; i < telemetryInitializersCount; ++i) { var telemetryInitializer = _initializers[i]; if (telemetryInitializer) { try { if (telemetryInitializer.fn.apply(null, [item]) === false) { doNotSendItem = true; break; } } catch (e) { _throwInternal(itemCtx.diagLog(), 1 , 64 , "One of telemetry initializers failed, telemetry item will not be sent: " + getExceptionName(e), { exception: dumpObj(e) }, true); } } } if (!doNotSendItem) { _self.processNext(item, itemCtx); } }; _self[strDoTeardown] = function () { _initDefaults(); }; }); function _initDefaults() { _id = 0; _initializers = []; } return _this; } return TelemetryInitializerPlugin; }(BaseTelemetryPlugin)); var strValidationError = "Plugins must provide initialize method"; var strNotificationManager = "_notificationManager"; var strSdkUnloadingError = "SDK is still unloading..."; var strSdkNotInitialized = "SDK is not initialized"; var defaultInitConfig = { loggingLevelConsole: 1 }; function _createPerfManager(core, notificationMgr) { return new PerfManager(notificationMgr); } function _validateExtensions(logger, channelPriority, allExtensions) { var coreExtensions = []; var extPriorities = {}; arrForEach(allExtensions, function (ext) { if (isNullOrUndefined(ext) || isNullOrUndefined(ext.initialize)) { throwError(strValidationError); } var extPriority = ext.priority; var identifier = ext.identifier; if (ext && extPriority) { if (!isNullOrUndefined(extPriorities[extPriority])) { _warnToConsole(logger, "Two extensions have same priority #" + extPriority + " - " + extPriorities[extPriority] + ", " + identifier); } else { extPriorities[extPriority] = identifier; } } if (!extPriority || extPriority < channelPriority) { coreExtensions.push(ext); } }); return { all: allExtensions, core: coreExtensions }; } function _isPluginPresent(thePlugin, plugins) { var exists = false; arrForEach(plugins, function (plugin) { if (plugin === thePlugin) { exists = true; return -1; } }); return exists; } function _createDummyNotificationManager() { var _a; return objCreateFn((_a = {}, _a[strAddNotificationListener] = function (listener) { }, _a[strRemoveNotificationListener] = function (listener) { }, _a[strEventsSent] = function (events) { }, _a[strEventsDiscarded] = function (events, reason) { }, _a[strEventsSendRequest] = function (sendReason, isAsync) { }, _a)); } var BaseCore = /** @class */ (function () { function BaseCore() { var _isInitialized; var _eventQueue; var _notificationManager; var _perfManager; var _cfgPerfManager; var _cookieManager; var _pluginChain; var _configExtensions; var _coreExtensions; var _channelControl; var _channelConfig; var _channelQueue; var _isUnloading; var _telemetryInitializerPlugin; var _internalLogsEventName; var _evtNamespace; var _unloadHandlers; var _debugListener; var _internalLogPoller = 0; dynamicProto(BaseCore, this, function (_self) { _initDefaults(); _self.isInitialized = function () { return _isInitialized; }; _self.initialize = function (config, extensions, logger, notificationManager) { if (_isUnloading) { throwError(strSdkUnloadingError); } if (_self.isInitialized()) { throwError("Core should not be initialized more than once"); } if (!config || isNullOrUndefined(config.instrumentationKey)) { throwError("Please provide instrumentation key"); } _notificationManager = notificationManager; _self[strNotificationManager] = notificationManager; _self.config = config || {}; _initDebugListener(config); _initPerfManager(config); config.extensions = isNullOrUndefined(config.extensions) ? [] : config.extensions; _initExtConfig(config); if (logger) { _self.logger = logger; } _configExtensions = []; _configExtensions.push.apply(_configExtensions, __spreadArrayFn(__spreadArrayFn([], extensions, false), config.extensions)); _channelConfig = (config || {}).channels; _initPluginChain(config, null); if (!_channelQueue || _channelQueue.length === 0) { throwError("No channels available"); } _isInitialized = true; _self.releaseQueue(); }; _self.getTransmissionControls = function () { var controls = []; if (_channelQueue) { arrForEach(_channelQueue, function (channels) { controls.push(channels.queue); }); } return objFreeze(controls); }; _self.track = function (telemetryItem) { setValue(telemetryItem, strIKey, _self.config.instrumentationKey, null, isNotTruthy); setValue(telemetryItem, "time", toISOString(new Date()), null, isNotTruthy); setValue(telemetryItem, "ver", "4.0", null, isNullOrUndefined); if (!_isUnloading && _self.isInitialized()) { _createTelCtx().processNext(telemetryItem); } else { _eventQueue.push(telemetryItem); } }; _self.getProcessTelContext = _createTelCtx; _self.getNotifyMgr = function () { if (!_notificationManager) { _notificationManager = _createDummyNotificationManager(); _self[strNotificationManager] = _notificationManager; } return _notificationManager; }; _self[strAddNotificationListener] = function (listener) { if (_notificationManager) { _notificationManager[strAddNotificationListener](listener); } }; _self[strRemoveNotificationListener] = function (listener) { if (_notificationManager) { _notificationManager[strRemoveNotificationListener](listener); } }; _self.getCookieMgr = function () { if (!_cookieManager) { _cookieManager = createCookieMgr(_self.config, _self.logger); } return _cookieManager; }; _self.setCookieMgr = function (cookieMgr) { _cookieManager = cookieMgr; }; _self.getPerfMgr = function () { if (!_perfManager && !_cfgPerfManager) { if (_self.config && _self.config.enablePerfMgr && isFunction(_self.config.createPerfMgr)) { _cfgPerfManager = _self.config.createPerfMgr(_self, _self.getNotifyMgr()); } } return _perfManager || _cfgPerfManager || getGblPerfMgr(); }; _self.setPerfMgr = function (perfMgr) { _perfManager = perfMgr; }; _self.eventCnt = function () { return _eventQueue.length; }; _self.releaseQueue = function () { if (_isInitialized && _eventQueue.length > 0) { var eventQueue = _eventQueue; _eventQueue = []; arrForEach(eventQueue, function (event) { _createTelCtx().processNext(event); }); } }; _self.pollInternalLogs = function (eventName) { _internalLogsEventName = eventName || null; var interval = _self.config.diagnosticLogInterval; if (!interval || !(interval > 0)) { interval = 10000; } if (_internalLogPoller) { clearInterval(_internalLogPoller); } _internalLogPoller = setInterval(function () { _flushInternalLogs(); }, interval); return _internalLogPoller; }; _self.stopPollingInternalLogs = function () { if (_internalLogPoller) { clearInterval(_internalLogPoller); _internalLogPoller = 0; _flushInternalLogs(); } }; proxyFunctions(_self, function () { return _telemetryInitializerPlugin; }, ["addTelemetryInitializer"]); _self.unload = function (isAsync, unloadComplete, cbTimeout) { if (isAsync === void 0) { isAsync = true; } if (!_isInitialized) { throwError(strSdkNotInitialized); } if (_isUnloading) { throwError(strSdkUnloadingError); } var unloadState = { reason: 50 , isAsync: isAsync, flushComplete: false }; var processUnloadCtx = createProcessTelemetryUnloadContext(_getPluginChain(), _self); processUnloadCtx.onComplete(function () { _initDefaults(); unloadComplete && unloadComplete(unloadState); }, _self); function _doUnload(flushComplete) { unloadState.flushComplete = flushComplete; _isUnloading = true; _unloadHandlers.run(processUnloadCtx, unloadState); _self.stopPollingInternalLogs(); processUnloadCtx.processNext(unloadState); } if (!_flushChannels(isAsync, _doUnload, 6 , cbTimeout)) { _doUnload(false); } }; _self.getPlugin = _getPlugin; _self.addPlugin = function (plugin, replaceExisting, isAsync, addCb) { if (!plugin) { addCb && addCb(false); _logOrThrowError(strValidationError); return; } var existingPlugin = _getPlugin(plugin.identifier); if (existingPlugin && !replaceExisting) { addCb && addCb(false); _logOrThrowError("Plugin [" + plugin.identifier + "] is already loaded!"); return; } var updateState = { reason: 16 }; function _addPlugin(removed) { _configExtensions.push(plugin); updateState.added = [plugin]; _initPluginChain(_self.config, updateState); addCb && addCb(true); } if (existingPlugin) { var removedPlugins_1 = [existingPlugin.plugin]; var unloadState = { reason: 2 , isAsync: !!isAsync }; _removePlugins(removedPlugins_1, unloadState, function (removed) { if (!removed) { addCb && addCb(false); } else { updateState.removed = removedPlugins_1; updateState.reason |= 32 ; _addPlugin(); } }); } else { _addPlugin(); } }; _self.evtNamespace = function () { return _evtNamespace; }; _self.flush = _flushChannels; proxyFunctionAs(_self, "addUnloadCb", function () { return _unloadHandlers; }, "add"); function _initDefaults() { _isInitialized = false; _self.config = objExtend(true, {}, defaultInitConfig); _self.logger = new DiagnosticLogger(_self.config); _self._extensions = []; _telemetryInitializerPlugin = new TelemetryInitializerPlugin(); _eventQueue = []; _notificationManager = null; _perfManager = null; _cfgPerfManager = null; _cookieManager = null; _pluginChain = null; _coreExtensions = null; _configExtensions = []; _channelControl = null; _channelConfig = null; _channelQueue = null; _isUnloading = false; _internalLogsEventName = null; _evtNamespace = createUniqueNamespace("AIBaseCore", true); _unloadHandlers = createUnloadHandlerContainer(); } function _createTelCtx() { return createProcessTelemetryContext(_getPluginChain(), _self.config, _self); } function _initPluginChain(config, updateState) { var theExtensions = _validateExtensions(_self.logger, ChannelControllerPriority, _configExtensions); _coreExtensions = theExtensions.core; _pluginChain = null; var allExtensions = theExtensions.all; _channelQueue = objFreeze(createChannelQueues(_channelConfig, allExtensions, config, _self)); if (_channelControl) { var idx = arrIndexOf(allExtensions, _channelControl); if (idx !== -1) { allExtensions.splice(idx, 1); } idx = arrIndexOf(_coreExtensions, _channelControl); if (idx !== -1) { _coreExtensions.splice(idx, 1); } _channelControl._setQueue(_channelQueue); } else { _channelControl = createChannelControllerPlugin(_channelQueue, _self); } allExtensions.push(_channelControl); _coreExtensions.push(_channelControl); _self._extensions = sortPlugins(allExtensions); _channelControl.initialize(config, _self, allExtensions); initializePlugins(_createTelCtx(), allExtensions); _self._extensions = objFreeze(sortPlugins(_coreExtensions || [])).slice(); if (updateState) { _doUpdate(updateState); } } function _getPlugin(pluginIdentifier) { var theExt = null; var thePlugin = null; arrForEach(_self._extensions, function (ext) { if (ext.identifier === pluginIdentifier && ext !== _channelControl && ext !== _telemetryInitializerPlugin) { thePlugin = ext; return -1; } }); if (!thePlugin && _channelControl) { thePlugin = _channelControl.getChannel(pluginIdentifier); } if (thePlugin) { theExt = { plugin: thePlugin, setEnabled: function (enabled) { _getPluginState(thePlugin)[strDisabled] = !enabled; }, isEnabled: function () { var pluginState = _getPluginState(thePlugin); return !pluginState[strTeardown] && !pluginState[strDisabled]; }, remove: function (isAsync, removeCb) { if (isAsync === void 0) { isAsync = true; } var pluginsToRemove = [thePlugin]; var unloadState = { reason: 1 , isAsync: isAsync }; _removePlugins(pluginsToRemove, unloadState, function (removed) { if (removed) { _initPluginChain(_self.config, { reason: 32 , removed: pluginsToRemove }); } removeCb && removeCb(removed); }); } }; } return theExt; } function _getPluginChain() { if (!_pluginChain) { var extensions = (_coreExtensions || []).slice(); if (arrIndexOf(extensions, _telemetryInitializerPlugin) === -1) { extensions.push(_telemetryInitializerPlugin); } _pluginChain = createTelemetryProxyChain(sortPlugins(extensions), _self.config, _self); } return _pluginChain; } function _removePlugins(thePlugins, unloadState, removeComplete) { if (thePlugins && thePlugins.length > 0) { var unloadChain = createTelemetryProxyChain(thePlugins, _self.config, _self); var unloadCtx = createProcessTelemetryUnloadContext(unloadChain, _self); unloadCtx.onComplete(function () { var removed = false; var newConfigExtensions = []; arrForEach(_configExtensions, function (plugin, idx) { if (!_isPluginPresent(plugin, thePlugins)) { newConfigExtensions.push(plugin); } else { removed = true; } }); _configExtensions = newConfigExtensions; var newChannelConfig = []; if (_channelConfig) { arrForEach(_channelConfig, function (queue, idx) { var newQueue = []; arrForEach(queue, function (channel) { if (!_isPluginPresent(channel, thePlugins)) { newQueue.push(channel); } else { removed = true; } }); newChannelConfig.push(newQueue); }); _channelConfig = newChannelConfig; } removeComplete && removeComplete(removed); }); unloadCtx.processNext(unloadState); } else { removeComplete(false); } } function _flushInternalLogs() { var queue = _self.logger ? _self.logger.queue : []; if (queue) { arrForEach(queue, function (logMessage) { var item = { name: _internalLogsEventName ? _internalLogsEventName : "InternalMessageId: " + logMessage.messageId, iKey: _self.config.instrumentationKey, time: toISOString(new Date()), baseType: _InternalLogMessage.dataType, baseData: { message: logMessage.message } }; _self.track(item); }); queue.length = 0; } } function _flushChannels(isAsync, callBack, sendReason, cbTimeout) { if (_channelControl) { return _channelControl.flush(isAsync, callBack, sendReason || 6 , cbTimeout); } callBack && callBack(false); return true; } function _initDebugListener(config) { if (config.disableDbgExt === true && _debugListener) { _notificationManager[strRemoveNotificationListener](_debugListener); _debugListener = null; } if (_notificationManager && !_debugListener && config.disableDbgExt !== true) { _debugListener = getDebugListener(config); _notificationManager[strAddNotificationListener](_debugListener); } } function _initPerfManager(config) { if (!config.enablePerfMgr && _cfgPerfManager) { _cfgPerfManager = null; } if (config.enablePerfMgr) { setValue(_self.config, "createPerfMgr", _createPerfManager); } } function _initExtConfig(config) { var extConfig = getSetValue(config, strExtensionConfig); extConfig.NotificationManager = _notificationManager; } function _doUpdate(updateState) { var updateCtx = createProcessTelemetryUpdateContext(_getPluginChain(), _self); if (!_self._updateHook || _self._updateHook(updateCtx, updateState) !== true) { updateCtx.processNext(updateState); } } function _logOrThrowError(message) { var logger = _self.logger; if (logger) { _throwInternal(logger, 2 , 73 , message); } else { throwError(message); } } }); } return BaseCore; }()); function _runListeners(listeners, name, isAsync, callback) { arrForEach(listeners, function (listener) { if (listener && listener[name]) { if (isAsync) { setTimeout(function () { return callback(listener); }, 0); } else { try { callback(listener); } catch (e) { } } } }); } var NotificationManager = /** @class */ (function () { function NotificationManager(config) { this.listeners = []; var perfEvtsSendAll = !!(config || {}).perfEvtsSendAll; dynamicProto(NotificationManager, this, function (_self) { _self[strAddNotificationListener] = function (listener) { _self.listeners.push(listener); }; _self[strRemoveNotificationListener] = function (listener) { var index = arrIndexOf(_self.listeners, listener); while (index > -1) { _self.listeners.splice(index, 1); index = arrIndexOf(_self.listeners, listener); } }; _self[strEventsSent] = function (events) { _runListeners(_self.listeners, strEventsSent, true, function (listener) { listener[strEventsSent](events); }); }; _self[strEventsDiscarded] = function (events, reason) { _runListeners(_self.listeners, strEventsDiscarded, true, function (listener) { listener[strEventsDiscarded](events, reason); }); }; _self[strEventsSendRequest] = function (sendReason, isAsync) { _runListeners(_self.listeners, strEventsSendRequest, isAsync, function (listener) { listener[strEventsSendRequest](sendReason, isAsync); }); }; _self[strPerfEvent] = function (perfEvent) { if (perfEvent) { if (perfEvtsSendAll || !perfEvent.isChildEvt()) { _runListeners(_self.listeners, strPerfEvent, false, function (listener) { if (perfEvent.isAsync) { setTimeout(function () { return listener[strPerfEvent](perfEvent); }, 0); } else { listener[strPerfEvent](perfEvent); } }); } } }; }); } return NotificationManager; }()); var AppInsightsCore = /** @class */ (function (_super) { __extendsFn(AppInsightsCore, _super); function AppInsightsCore() { var _this = _super.call(this) || this; dynamicProto(AppInsightsCore, _this, function (_self, _base) { _self.initialize = function (config, extensions, logger, notificationManager) { _base.initialize(config, extensions, logger || new DiagnosticLogger(config), notificationManager || new NotificationManager(config)); }; _self.track = function (telemetryItem) { doPerf(_self.getPerfMgr(), function () { return "AppInsightsCore:track"; }, function () { if (telemetryItem === null) { _notifyInvalidEvent(telemetryItem); throwError("Invalid telemetry item"); } _validateTelemetryItem(telemetryItem); _base.track(telemetryItem); }, function () { return ({ item: telemetryItem }); }, !(telemetryItem.sync)); }; function _validateTelemetryItem(telemetryItem) { if (isNullOrUndefined(telemetryItem.name)) { _notifyInvalidEvent(telemetryItem); throwError("telemetry name required"); } } function _notifyInvalidEvent(telemetryItem) { var manager = _self.getNotifyMgr(); if (manager) { manager.eventsDiscarded([telemetryItem], 2 ); } } }); return _this; } return AppInsightsCore; }(BaseCore)); var strOnPrefix = "on"; var strAttachEvent = "attachEvent"; var strAddEventHelper = "addEventListener"; var strDetachEvent = "detachEvent"; var strRemoveEventListener = "removeEventListener"; var strEvents = "events"; var strVisibilityChangeEvt = "visibilitychange"; var strPageHide = "pagehide"; var strPageShow = "pageshow"; var strUnload = "unload"; var strBeforeUnload = "beforeunload"; var strPageHideNamespace = createUniqueNamespace("aiEvtPageHide"); var strPageShowNamespace = createUniqueNamespace("aiEvtPageShow"); var rRemoveEmptyNs = /\.[\.]+/g; var rRemoveTrailingEmptyNs = /[\.]+$/; var _guid = 1; var elmNodeData = createElmNodeData("events"); var eventNamespace = /^([^.]*)(?:\.(.+)|)/; function _normalizeNamespace(name) { if (name && name.replace) { return name.replace(/^\s*\.*|\.*\s*$/g, ""); } return name; } function _getEvtNamespace(eventName, evtNamespace) { if (evtNamespace) { var theNamespace_1 = ""; if (isArray(evtNamespace)) { theNamespace_1 = ""; arrForEach(evtNamespace, function (name) { name = _normalizeNamespace(name); if (name) { if (name[0] !== ".") { name = "." + name; } theNamespace_1 += name; } }); } else { theNamespace_1 = _normalizeNamespace(evtNamespace); } if (theNamespace_1) { if (theNamespace_1[0] !== ".") { theNamespace_1 = "." + theNamespace_1; } eventName = (eventName || "") + theNamespace_1; } } var parsedEvent = (eventNamespace.exec(eventName || "") || []); return { type: parsedEvent[1], ns: ((parsedEvent[2] || "").replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, "").split(".").sort()).join(".") }; } function __getRegisteredEvents(target, eventName, evtNamespace) { var theEvents = []; var eventCache = elmNodeData.get(target, strEvents, {}, false); var evtName = _getEvtNamespace(eventName, evtNamespace); objForEachKey(eventCache, function (evtType, registeredEvents) { arrForEach(registeredEvents, function (value) { if (!evtName.type || evtName.type === value.evtName.type) { if (!evtName.ns || evtName.ns === evtName.ns) { theEvents.push({ name: value.evtName.type + (value.evtName.ns ? "." + value.evtName.ns : ""), handler: value.handler }); } } }); }); return theEvents; } function _getRegisteredEvents(target, evtName, addDefault) { if (addDefault === void 0) { addDefault = true; } var aiEvts = elmNodeData.get(target, strEvents, {}, addDefault); var registeredEvents = aiEvts[evtName]; if (!registeredEvents) { registeredEvents = aiEvts[evtName] = []; } return registeredEvents; } function _doDetach(obj, evtName, handlerRef, useCapture) { if (obj && evtName && evtName.type) { if (obj[strRemoveEventListener]) { obj[strRemoveEventListener](evtName.type, handlerRef, useCapture); } else if (obj[strDetachEvent]) { obj[strDetachEvent](strOnPrefix + evtName.type, handlerRef); } } } function _doAttach(obj, evtName, handlerRef, useCapture) { var result = false; if (obj && evtName && evtName.type && handlerRef) { if (obj[strAddEventHelper]) { obj[strAddEventHelper](evtName.type, handlerRef, useCapture); result = true; } else if (obj[strAttachEvent]) { obj[strAttachEvent](strOnPrefix + evtName.type, handlerRef); result = true; } } return result; } function _doUnregister(target, events, evtName, unRegFn) { var idx = events.length; while (idx--) { var theEvent = events[idx]; if (theEvent) { if (!evtName.ns || evtName.ns === theEvent.evtName.ns) { if (!unRegFn || unRegFn(theEvent)) { _doDetach(target, theEvent.evtName, theEvent.handler, theEvent.capture); events.splice(idx, 1); } } } } } function _unregisterEvents(target, evtName, unRegFn) { if (evtName.type) { _doUnregister(target, _getRegisteredEvents(target, evtName.type), evtName, unRegFn); } else { var eventCache = elmNodeData.get(target, strEvents, {}); objForEachKey(eventCache, function (evtType, events) { _doUnregister(target, events, evtName, unRegFn); }); if (objKeys(eventCache).length === 0) { elmNodeData.kill(target, strEvents); } } } function mergeEvtNamespace(theNamespace, namespaces) { var newNamespaces; if (namespaces) { if (isArray(namespaces)) { newNamespaces = [theNamespace].concat(namespaces); } else { newNamespaces = [theNamespace, namespaces]; } newNamespaces = (_getEvtNamespace("xx", newNamespaces).ns).split("."); } else { newNamespaces = theNamespace; } return newNamespaces; } function eventOn(target, eventName, handlerRef, evtNamespace, useCapture) { if (useCapture === void 0) { useCapture = false; } var result = false; if (target) { try { var evtName = _getEvtNamespace(eventName, evtNamespace); result = _doAttach(target, evtName, handlerRef, useCapture); if (result && elmNodeData.accept(target)) { var registeredEvent = { guid: _guid++, evtName: evtName, handler: handlerRef, capture: useCapture }; _getRegisteredEvents(target, evtName.type).push(registeredEvent); } } catch (e) { } } return result; } function eventOff(target, eventName, handlerRef, evtNamespace, useCapture) { if (useCapture === void 0) { useCapture = false; } if (target) { try { var evtName_1 = _getEvtNamespace(eventName, evtNamespace); var found_1 = false; _unregisterEvents(target, evtName_1, function (regEvent) { if ((evtName_1.ns && !handlerRef) || regEvent.handler === handlerRef) { found_1 = true; return true; } return false; }); if (!found_1) { _doDetach(target, evtName_1, handlerRef, useCapture); } } catch (e) { } } } function attachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) { if (useCapture === void 0) { useCapture = false; } return eventOn(obj, eventNameWithoutOn, handlerRef, null, useCapture); } function detachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) { if (useCapture === void 0) { useCapture = false; } eventOff(obj, eventNameWithoutOn, handlerRef, null, useCapture); } function addEventHandler(eventName, callback, evtNamespace) { var result = false; var w = getWindow(); if (w) { result = eventOn(w, eventName, callback, evtNamespace); result = eventOn(w["body"], eventName, callback, evtNamespace) || result; } var doc = getDocument(); if (doc) { result = eventOn(doc, eventName, callback, evtNamespace) || result; } return result; } function removeEventHandler(eventName, callback, evtNamespace) { var w = getWindow(); if (w) { eventOff(w, eventName, callback, evtNamespace); eventOff(w["body"], eventName, callback, evtNamespace); } var doc = getDocument(); if (doc) { eventOff(doc, eventName, callback, evtNamespace); } } function _addEventListeners(events, listener, excludeEvents, evtNamespace) { var added = false; if (listener && events && events.length > 0) { arrForEach(events, function (name) { if (name) { if (!excludeEvents || arrIndexOf(excludeEvents, name) === -1) { added = addEventHandler(name, listener, evtNamespace) || added; } } }); } return added; } function addEventListeners(events, listener, excludeEvents, evtNamespace) { var added = false; if (listener && events && isArray(events)) { added = _addEventListeners(events, listener, excludeEvents, evtNamespace); if (!added && excludeEvents && excludeEvents.length > 0) { added = _addEventListeners(events, listener, null, evtNamespace); } } return added; } function removeEventListeners(events, listener, evtNamespace) { if (events && isArray(events)) { arrForEach(events, function (name) { if (name) { removeEventHandler(name, listener, evtNamespace); } }); } } function addPageUnloadEventListener(listener, excludeEvents, evtNamespace) { return addEventListeners([strBeforeUnload, strUnload, strPageHide], listener, excludeEvents, evtNamespace); } function removePageUnloadEventListener(listener, evtNamespace) { removeEventListeners([strBeforeUnload, strUnload, strPageHide], listener, evtNamespace); } function addPageHideEventListener(listener, excludeEvents, evtNamespace) { function _handlePageVisibility(evt) { var doc = getDocument(); if (listener && doc && doc.visibilityState === "hidden") { listener(evt); } } var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace); var pageUnloadAdded = _addEventListeners([strPageHide], listener, excludeEvents, newNamespaces); if (!excludeEvents || arrIndexOf(excludeEvents, strVisibilityChangeEvt) === -1) { pageUnloadAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageUnloadAdded; } if (!pageUnloadAdded && excludeEvents) { pageUnloadAdded = addPageHideEventListener(listener, null, evtNamespace); } return pageUnloadAdded; } function removePageHideEventListener(listener, evtNamespace) { var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace); removeEventListeners([strPageHide], listener, newNamespaces); removeEventListeners([strVisibilityChangeEvt], null, newNamespaces); } function addPageShowEventListener(listener, excludeEvents, evtNamespace) { function _handlePageVisibility(evt) { var doc = getDocument(); if (listener && doc && doc.visibilityState === "visible") { listener(evt); } } var newNamespaces = mergeEvtNamespace(strPageShowNamespace, evtNamespace); var pageShowAdded = _addEventListeners([strPageShow], listener, excludeEvents, newNamespaces); pageShowAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageShowAdded; if (!pageShowAdded && excludeEvents) { pageShowAdded = addPageShowEventListener(listener, null, evtNamespace); } return pageShowAdded; } function removePageShowEventListener(listener, evtNamespace) { var newNamespaces = mergeEvtNamespace(strPageShowNamespace, evtNamespace); removeEventListeners([strPageShow], listener, newNamespaces); removeEventListeners([strVisibilityChangeEvt], null, newNamespaces); } var _cookieMgrs = null; var _canUseCookies; var Undefined = strShimUndefined; function newGuid() { function randomHexDigit() { return randomValue(15); } return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(GuidRegex, function (c) { var r = (randomHexDigit() | 0), v = (c === "x" ? r : r & 0x3 | 0x8); return v.toString(16); }); } function perfNow() { var perf = getPerformance(); if (perf && perf.now) { return perf.now(); } return dateNow(); } function generateW3CId() { var hexValues = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]; var oct = strEmpty, tmp; for (var a = 0; a < 4; a++) { tmp = random32(); oct += hexValues[tmp & 0xF] + hexValues[tmp >> 4 & 0xF] + hexValues[tmp >> 8 & 0xF] + hexValues[tmp >> 12 & 0xF] + hexValues[tmp >> 16 & 0xF] + hexValues[tmp >> 20 & 0xF] + hexValues[tmp >> 24 & 0xF] + hexValues[tmp >> 28 & 0xF]; } var clockSequenceHi = hexValues[8 + (random32() & 0x03) | 0]; return oct.substr(0, 8) + oct.substr(9, 4) + "4" + oct.substr(13, 3) + clockSequenceHi + oct.substr(16, 3) + oct.substr(19, 12); } var CoreUtils = { _canUseCookies: undefined, isTypeof: isTypeof, isUndefined: isUndefined, isNullOrUndefined: isNullOrUndefined, hasOwnProperty: hasOwnProperty, isFunction: isFunction, isObject: isObject, isDate: isDate, isArray: isArray, isError: isError, isString: isString, isNumber: isNumber, isBoolean: isBoolean, toISOString: toISOString, arrForEach: arrForEach, arrIndexOf: arrIndexOf, arrMap: arrMap, arrReduce: arrReduce, strTrim: strTrim, objCreate: objCreateFn, objKeys: objKeys, objDefineAccessors: objDefineAccessors, addEventHandler: addEventHandler, dateNow: dateNow, isIE: isIE, disableCookies: disableCookies, newGuid: newGuid, perfNow: perfNow, newId: newId, randomValue: randomValue, random32: random32, mwcRandomSeed: mwcRandomSeed, mwcRandom32: mwcRandom32, generateW3CId: generateW3CId }; var GuidRegex = /[xy]/g; var EventHelper = { Attach: attachEvent, AttachEvent: attachEvent, Detach: detachEvent, DetachEvent: detachEvent }; function _legacyCookieMgr(config, logger) { var cookieMgr = _gblCookieMgr(config, logger); var legacyCanUseCookies = CoreUtils._canUseCookies; if (_cookieMgrs === null) { _cookieMgrs = []; _canUseCookies = legacyCanUseCookies; objDefineAccessors(CoreUtils, "_canUseCookies", function () { return _canUseCookies; }, function (value) { _canUseCookies = value; arrForEach(_cookieMgrs, function (mgr) { mgr.setEnabled(value); }); }); } if (arrIndexOf(_cookieMgrs, cookieMgr) === -1) { _cookieMgrs.push(cookieMgr); } if (isBoolean(legacyCanUseCookies)) { cookieMgr.setEnabled(legacyCanUseCookies); } if (isBoolean(_canUseCookies)) { cookieMgr.setEnabled(_canUseCookies); } return cookieMgr; } function disableCookies() { _legacyCookieMgr().setEnabled(false); } function canUseCookies(logger) { return _legacyCookieMgr(null, logger).isEnabled(); } function getCookie(logger, name) { return _legacyCookieMgr(null, logger).get(name); } function setCookie(logger, name, value, domain) { _legacyCookieMgr(null, logger).set(name, value, null, domain); } function deleteCookie(logger, name) { return _legacyCookieMgr(null, logger).del(name); } var LoggingSeverity = createEnumStyle({ CRITICAL: 1 , WARNING: 2 }); var _InternalMessageId = createEnumStyle({ BrowserDoesNotSupportLocalStorage: 0 , BrowserCannotReadLocalStorage: 1 , BrowserCannotReadSessionStorage: 2 , BrowserCannotWriteLocalStorage: 3 , BrowserCannotWriteSessionStorage: 4 , BrowserFailedRemovalFromLocalStorage: 5 , BrowserFailedRemovalFromSessionStorage: 6 , CannotSendEmptyTelemetry: 7 , ClientPerformanceMathError: 8 , ErrorParsingAISessionCookie: 9 , ErrorPVCalc: 10 , ExceptionWhileLoggingError: 11 , FailedAddingTelemetryToBuffer: 12 , FailedMonitorAjaxAbort: 13 , FailedMonitorAjaxDur: 14 , FailedMonitorAjaxOpen: 15 , FailedMonitorAjaxRSC: 16 , FailedMonitorAjaxSend: 17 , FailedMonitorAjaxGetCorrelationHeader: 18 , FailedToAddHandlerForOnBeforeUnload: 19 , FailedToSendQueuedTelemetry: 20 , FailedToReportDataLoss: 21 , FlushFailed: 22 , MessageLimitPerPVExceeded: 23 , MissingRequiredFieldSpecification: 24 , NavigationTimingNotSupported: 25 , OnError: 26 , SessionRenewalDateIsZero: 27 , SenderNotInitialized: 28 , StartTrackEventFailed: 29 , StopTrackEventFailed: 30 , StartTrackFailed: 31 , StopTrackFailed: 32 , TelemetrySampledAndNotSent: 33 , TrackEventFailed: 34 , TrackExceptionFailed: 35 , TrackMetricFailed: 36 , TrackPVFailed: 37 , TrackPVFailedCalc: 38 , TrackTraceFailed: 39 , TransmissionFailed: 40 , FailedToSetStorageBuffer: 41 , FailedToRestoreStorageBuffer: 42 , InvalidBackendResponse: 43 , FailedToFixDepricatedValues: 44 , InvalidDurationValue: 45 , TelemetryEnvelopeInvalid: 46 , CreateEnvelopeError: 47 , CannotSerializeObject: 48 , CannotSerializeObjectNonSerializable: 49 , CircularReferenceDetected: 50 , ClearAuthContextFailed: 51 , ExceptionTruncated: 52 , IllegalCharsInName: 53 , ItemNotInArray: 54 , MaxAjaxPerPVExceeded: 55 , MessageTruncated: 56 , NameTooLong: 57 , SampleRateOutOfRange: 58 , SetAuthContextFailed: 59 , SetAuthContextFailedAccountName: 60 , StringValueTooLong: 61 , StartCalledMoreThanOnce: 62 , StopCalledWithoutStart: 63 , TelemetryInitializerFailed: 64 , TrackArgumentsNotSpecified: 65 , UrlTooLong: 66 , SessionStorageBufferFull: 67 , CannotAccessCookie: 68 , IdTooLong: 69 , InvalidEvent: 70 , FailedMonitorAjaxSetRequestHeader: 71 , SendBrowserInfoOnUserInit: 72 , PluginException: 73 , NotificationException: 74 , SnippetScriptLoadFailure: 99 , InvalidInstrumentationKey: 100 , CannotParseAiBlobValue: 101 , InvalidContentBlob: 102 , TrackPageActionEventFailed: 103 , FailedAddingCustomDefinedRequestContext: 104 , InMemoryStorageBufferFull: 105 }); var aiInstrumentHooks = "_aiHooks"; var cbNames = [ "req", "rsp", "hkErr", "fnErr" ]; function _arrLoop(arr, fn) { if (arr) { for (var lp = 0; lp < arr.length; lp++) { if (fn(arr[lp], lp)) { break; } } } } function _doCallbacks(hooks, callDetails, cbArgs, hookCtx, type) { if (type >= 0 && type <= 2 ) { _arrLoop(hooks, function (hook, idx) { var cbks = hook.cbks; var cb = cbks[cbNames[type]]; if (cb) { callDetails.ctx = function () { var ctx = hookCtx[idx] = (hookCtx[idx] || {}); return ctx; }; try { cb.apply(callDetails.inst, cbArgs); } catch (err) { var orgEx = callDetails.err; try { var hookErrorCb = cbks[cbNames[2 ]]; if (hookErrorCb) { callDetails.err = err; hookErrorCb.apply(callDetails.inst, cbArgs); } } catch (e) { } finally { callDetails.err = orgEx; } } } }); } } function _createFunctionHook(aiHook) { return function () { var funcThis = this; var orgArgs = arguments; var hooks = aiHook.h; var funcArgs = { name: aiHook.n, inst: funcThis, ctx: null, set: _replaceArg }; var hookCtx = []; var cbArgs = _createArgs([funcArgs], orgArgs); funcArgs.evt = getGlobalInst("event"); function _createArgs(target, theArgs) { _arrLoop(theArgs, function (arg) { target.push(arg); }); return target; } function _replaceArg(idx, value) { orgArgs = _createArgs([], orgArgs); orgArgs[idx] = value; cbArgs = _createArgs([funcArgs], orgArgs); } _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 0 ); var theFunc = aiHook.f; if (theFunc) { try { funcArgs.rslt = theFunc.apply(funcThis, orgArgs); } catch (err) { funcArgs.err = err; _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 3 ); throw err; } } _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 1 ); return funcArgs.rslt; }; } function _getOwner(target, name, checkPrototype) { var owner = null; if (target) { if (hasOwnProperty(target, name)) { owner = target; } else if (checkPrototype) { owner = _getOwner(_getObjProto$1(target), name, false); } } return owner; } function InstrumentProto(target, funcName, callbacks) { if (target) { return InstrumentFunc(target[strShimPrototype], funcName, callbacks, false); } return null; } function InstrumentProtos(target, funcNames, callbacks) { if (target) { return InstrumentFuncs(target[strShimPrototype], funcNames, callbacks, false); } return null; } function _createInstrumentHook(owner, funcName, fn, callbacks) { var aiHook = fn && fn[aiInstrumentHooks]; if (!aiHook) { aiHook = { i: 0, n: funcName, f: fn, h: [] }; var newFunc = _createFunctionHook(aiHook); newFunc[aiInstrumentHooks] = aiHook; owner[funcName] = newFunc; } var theHook = { id: aiHook.i, cbks: callbacks, rm: function () { var id = this.id; _arrLoop(aiHook.h, function (hook, idx) { if (hook.id === id) { aiHook.h.splice(idx, 1); return 1; } }); } }; aiHook.i++; aiHook.h.push(theHook); return theHook; } function InstrumentFunc(target, funcName, callbacks, checkPrototype) { if (checkPrototype === void 0) { checkPrototype = true; } if (target && funcName && callbacks) { var owner = _getOwner(target, funcName, checkPrototype); if (owner) { var fn = owner[funcName]; if (typeof fn === strShimFunction) { return _createInstrumentHook(owner, funcName, fn, callbacks); } } } return null; } function InstrumentFuncs(target, funcNames, callbacks, checkPrototype) { if (checkPrototype === void 0) { checkPrototype = true; } var hooks = null; _arrLoop(funcNames, function (funcName) { var hook = InstrumentFunc(target, funcName, callbacks, checkPrototype); if (hook) { if (!hooks) { hooks = []; } hooks.push(hook); } }); return hooks; } function InstrumentEvent(target, evtName, callbacks, checkPrototype) { if (target && evtName && callbacks) { var owner = _getOwner(target, evtName, checkPrototype) || target; if (owner) { return _createInstrumentHook(owner, evtName, owner[evtName], callbacks); } } return null; } exports.AppInsightsCore = AppInsightsCore; exports.BaseCore = BaseCore; exports.BaseTelemetryPlugin = BaseTelemetryPlugin; exports.CoreUtils = CoreUtils; exports.DiagnosticLogger = DiagnosticLogger; exports.EventHelper = EventHelper; exports.EventsDiscardedReason = EventsDiscardedReason; exports.InstrumentEvent = InstrumentEvent; exports.InstrumentFunc = InstrumentFunc; exports.InstrumentFuncs = InstrumentFuncs; exports.InstrumentProto = InstrumentProto; exports.InstrumentProtos = InstrumentProtos; exports.LoggingSeverity = LoggingSeverity; exports.MinChannelPriorty = MinChannelPriorty; exports.NotificationManager = NotificationManager; exports.PerfEvent = PerfEvent; exports.PerfManager = PerfManager; exports.ProcessTelemetryContext = ProcessTelemetryContext; exports.Undefined = Undefined; exports._InternalLogMessage = _InternalLogMessage; exports._InternalMessageId = _InternalMessageId; exports.__getRegisteredEvents = __getRegisteredEvents; exports._legacyCookieMgr = _legacyCookieMgr; exports._logInternalMessage = _logInternalMessage; exports._throwInternal = _throwInternal; exports._warnToConsole = _warnToConsole; exports.addEventHandler = addEventHandler; exports.addEventListeners = addEventListeners; exports.addPageHideEventListener = addPageHideEventListener; exports.addPageShowEventListener = addPageShowEventListener; exports.addPageUnloadEventListener = addPageUnloadEventListener; exports.areCookiesSupported = areCookiesSupported; exports.arrForEach = arrForEach; exports.arrIndexOf = arrIndexOf; exports.arrMap = arrMap; exports.arrReduce = arrReduce; exports.attachEvent = attachEvent; exports.canUseCookies = canUseCookies; exports.createClassFromInterface = createClassFromInterface; exports.createCookieMgr = createCookieMgr; exports.createEnumMap = createEnumMap; exports.createEnumStyle = createEnumStyle; exports.createProcessTelemetryContext = createProcessTelemetryContext; exports.createUniqueNamespace = createUniqueNamespace; exports.createUnloadHandlerContainer = createUnloadHandlerContainer; exports.createValueMap = createValueMap; exports.dateNow = dateNow; exports.deepFreeze = deepFreeze; exports.deleteCookie = deleteCookie; exports.detachEvent = detachEvent; exports.disableCookies = disableCookies; exports.doPerf = doPerf; exports.dumpObj = dumpObj; exports.eventOff = eventOff; exports.eventOn = eventOn; exports.generateW3CId = generateW3CId; exports.getConsole = getConsole; exports.getCookie = getCookie; exports.getCrypto = getCrypto; exports.getDebugExt = getDebugExt; exports.getDebugListener = getDebugListener; exports.getDocument = getDocument; exports.getExceptionName = getExceptionName; exports.getGblPerfMgr = getGblPerfMgr; exports.getGlobal = getGlobal; exports.getGlobalInst = getGlobalInst; exports.getHistory = getHistory; exports.getIEVersion = getIEVersion; exports.getJSON = getJSON; exports.getLocation = getLocation; exports.getMsCrypto = getMsCrypto; exports.getNavigator = getNavigator; exports.getPerformance = getPerformance; exports.getSetValue = getSetValue; exports.getWindow = getWindow; exports.hasDocument = hasDocument; exports.hasHistory = hasHistory; exports.hasJSON = hasJSON; exports.hasNavigator = hasNavigator; exports.hasOwnProperty = hasOwnProperty; exports.hasWindow = hasWindow; exports.initializePlugins = initializePlugins; exports.isArray = isArray; exports.isBeaconsSupported = isBeaconsSupported; exports.isBoolean = isBoolean; exports.isDate = isDate; exports.isError = isError; exports.isFetchSupported = isFetchSupported; exports.isFunction = isFunction; exports.isIE = isIE; exports.isNotNullOrUndefined = isNotNullOrUndefined; exports.isNotTruthy = isNotTruthy; exports.isNotUndefined = isNotUndefined; exports.isNullOrUndefined = isNullOrUndefined; exports.isNumber = isNumber; exports.isObject = isObject; exports.isReactNative = isReactNative; exports.isSafari = isSafari; exports.isString = isString; exports.isSymbol = isSymbol; exports.isTruthy = isTruthy; exports.isTypeof = isTypeof; exports.isUndefined = isUndefined; exports.isXhrSupported = isXhrSupported; exports.mergeEvtNamespace = mergeEvtNamespace; exports.mwcRandom32 = mwcRandom32; exports.mwcRandomSeed = mwcRandomSeed; exports.newGuid = newGuid; exports.newId = newId; exports.normalizeJsName = normalizeJsName; exports.objCreate = objCreateFn; exports.objDefineAccessors = objDefineAccessors; exports.objExtend = objExtend; exports.objForEachKey = objForEachKey; exports.objFreeze = objFreeze; exports.objKeys = objKeys; exports.objSeal = objSeal; exports.objToString = objToString; exports.optimizeObject = optimizeObject; exports.perfNow = perfNow; exports.proxyAssign = proxyAssign; exports.proxyFunctionAs = proxyFunctionAs; exports.proxyFunctions = proxyFunctions; exports.random32 = random32; exports.randomValue = randomValue; exports.removeEventHandler = removeEventHandler; exports.removeEventListeners = removeEventListeners; exports.removePageHideEventListener = removePageHideEventListener; exports.removePageShowEventListener = removePageShowEventListener; exports.removePageUnloadEventListener = removePageUnloadEventListener; exports.safeGetCookieMgr = safeGetCookieMgr; exports.safeGetLogger = safeGetLogger; exports.setCookie = setCookie; exports.setEnableEnvMocks = setEnableEnvMocks; exports.setGblPerfMgr = setGblPerfMgr; exports.setValue = setValue; exports.sortPlugins = sortPlugins; exports.strContains = strContains; exports.strEndsWith = strEndsWith; exports.strFunction = strShimFunction; exports.strObject = strShimObject; exports.strPrototype = strShimPrototype; exports.strStartsWith = strStartsWith; exports.strTrim = strTrim; exports.strUndefined = strShimUndefined; exports.throwError = throwError; exports.toISOString = toISOString; exports.uaDisallowsSameSiteNone = uaDisallowsSameSiteNone; exports.unloadComponents = unloadComponents; exports.useXDomainRequest = useXDomainRequest; (function(obj, prop, descriptor) { /* ai_es3_polyfil defineProperty */ var func = Object["defineProperty"]; if (func) { try { return func(obj, prop, descriptor); } catch(e) { /* IE8 defines defineProperty, but will throw */ } } if (descriptor && typeof descriptor.value !== undefined) { obj[prop] = descriptor.value; } return obj; })(exports, '__esModule', { value: true }); }));//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/browser/applicationinsights-core-js.js.map /*! * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ !function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(((n="undefined"!=typeof globalThis?globalThis:n||self).Microsoft=n.Microsoft||{},n.Microsoft.ApplicationInsights=n.Microsoft.ApplicationInsights||{}))}(this,function(n){"use strict";var u="function",a="object",e="undefined",o="prototype",E="hasOwnProperty",t=Object,I=t[o],N=t.assign,P=t.create,z=t.defineProperty,m=I[E],B=null;function K(n){return void 0===n&&(n=!0),B&&n||(typeof globalThis!==e&&globalThis&&(B=globalThis),typeof self!==e&&self&&(B=self),typeof window!==e&&window&&(B=window),typeof global!==e&&global&&(B=global)),B}function q(n){throw new TypeError(n)}function H(n){if(P)return P(n);if(null==n)return{};var e=typeof n;function t(){}return e!==a&&e!==u&&q("Object prototype may only be an Object:"+n),t[o]=n,new t}(K()||{}).Symbol,(K()||{}).Reflect;var V=function(n,e){return(V=t.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var t in e)e[E](t)&&(n[t]=e[t])})(n,e)};function W(n,e){function t(){this.constructor=n}typeof e!==u&&null!==e&&q("Class extends value "+e+" is not a constructor or null"),V(n,e),n[o]=null===e?H(e):(t[o]=e[o],new t)}function G(n,e){for(var t=0,r=e.length,i=n.length;t=o.maxInternalMessageLimit()||(r=!0,t="AITR_"+e.messageId,a[t]?r=!1:a[t]=!0,r&&(n<=o.telemetryLoggingLevel()&&(o.queue.push(e),i++,u(1===n?"error":"warn",e)),i===o.maxInternalMessageLimit()&&(r=new bt(23,t="Internal events throttle limit per PageView reached for this app.",!1),o.queue.push(r),1===n?o.errorToConsole(t):o.warnToConsole(t))))}})};function Et(n){return n||new St}function It(n,e,t,r,i,o){void 0===o&&(o=!1),(n||new St).throwInternal(e,t,r,i,o)}function Nt(n,e){Et(n).warnToConsole(e)}var Pt=null,Mt=(s.ParentContextKey="parent",s.ChildrenContextKey="childEvts",s);function s(n,i,e){var t,o=this,u=!1;o.start=ne(),o.name=n,o.isAsync=e,o.isChildEvt=function(){return!1},k(i)&&(u=$n(o,"payload",function(){return!t&&k(i)&&(t=i(),i=null),t})),o.getCtx=function(n){return n?(n===s.ParentContextKey||n===s.ChildrenContextKey?o:o.ctx||{})[n]:null},o.setCtx=function(n,e){n&&(n===s.ParentContextKey?(o[n]||(o.isChildEvt=function(){return!0}),o[n]=e):n===s.ChildrenContextKey?o[n]=e:(o.ctx=o.ctx||{})[n]=e)},o.complete=function(){var n=0,e=o.getCtx(s.ChildrenContextKey);if(C(e))for(var t=0;t>>=0),Ot=123456789+n&T,Dt=987654321-n&T,At=!0}function jt(){try{var n=2147483647&ne();Ut((Math.random()*Ft^n)+n)}catch(e){}}function Rt(n){return 0>>0:0}function zt(n){var e=0,t=ft()||st();return 0===(e=t&&t.getRandomValues?t.getRandomValues(new Uint32Array(1))[0]&T:e)&&dt()&&(At||jt(),e=Kt()&T),0===e&&(e=Math.floor(Ft*Math.random()|0)),n||(e>>>=0),e}function Bt(n){n?Ut(n):jt()}function Kt(n){var e=((Dt=36969*(65535&Dt)+(Dt>>16)&T)<<16)+(65535&(Ot=18e3*(65535&Ot)+(Ot>>16)&T))>>>0&T|0;return n||(e>>>=0),e}function qt(n){void 0===n&&(n=22);for(var e=zt()>>>0,t=0,r=g;r.length>>=6,5==++t&&(e=(zt()<<2&4294967295|3&e)>>>0,t=0);return r}var Ht=z,Vt="2.8.3",Wt="."+qt(6),Gt=0;function Jt(n){return 1===n.nodeType||9===n.nodeType||!+n.nodeType}function Qt(n,e){return jn(n+Gt+++((e=void 0!==e&&e)?"."+Vt:"")+Wt)}function Xt(n){var o={id:Qt("_aiData-"+(n||"")+"."+Vt),accept:Jt,get:function(n,e,t,r){var i=n[o.id];return i?i[jn(e)]:(r&&((i=function(n,e){var t=e[n.id];if(!t){t={};try{Jt(e)&&!function(n,e,t){if(Ht)try{return Ht(n,e,{value:t,enumerable:!1,configurable:!0}),1}catch(r){}}(e,n.id,t)&&(e[n.id]=t)}catch(r){}}return t}(o,n))[jn(e)]=t),t)},kill:function(n,e){if(n&&n[e])try{delete n[e]}catch(t){}}};return o}var $t=Xt("plugin");function Yt(n){return $t.get(n,"state",{},!0)}function Zt(t,r){for(var i,n=[],e=null,o=t.getNext();o;){var u=o.getPlugin();u&&(e&&k(e[X])&&k(u[J])&&e[X](u),(k(u[$])?u[$]():(i=Yt(u))[$])||n.push(u),e=u,o=o.getNext())}L(n,function(n){var e=t.core();n.initialize(t.getCfg(),e,r,t.getNext()),i=Yt(n),n[d]||i[d]||(i[d]=e),i[$]=!0,delete i[M]})}function nr(n){return n.sort(function(n,e){var t=0,r=k(e[J]);return k(n[J])?t=r?n[Q]-e[Q]:1:r&&(t=-1),t})}var er="TelemetryPluginChain",tr="_hasRun",rr="_getTelCtx",ir=0;function or(n,u,t,e){var r=null,i=[],o=(null!==e&&(r=e?function(n,e,t){for(;n;){if(n.getPlugin()===t)return n;n=n.getNext()}return R([t],e.config||{},e)}(n,t,e):n),{_next:function(){var n,e=r;return r=e?e.getNext():null,e||(n=i)&&0Fr&&c.push(n)}),Or(l,c,t,a)),l)),T?(-1!==(d=F(v,T))&&v.splice(d,1),-1!==(d=F(w,T))&&w.splice(d,1),T._setQueue(E)):(f=E,s=y,g=!1,(d={identifier:"ChannelControllerPlugin",priority:Fr,initialize:function(e,t,r,n){g=!0,L(f,function(n){n&&0>4&15]+e[n>>8&15]+e[n>>12&15]+e[n>>16&15]+e[n>>20&15]+e[n>>24&15]+e[n>>28&15];var i=e[8+(3&zt())|0];return t.substr(0,8)+t.substr(9,4)+"4"+t.substr(13,3)+i+t.substr(16,3)+t.substr(19,12)}var Ai={_canUseCookies:undefined,isTypeof:On,isUndefined:v,isNullOrUndefined:_,hasOwnProperty:Un,isFunction:k,isObject:x,isDate:zn,isArray:C,isError:Bn,isString:l,isNumber:Kn,isBoolean:qn,toISOString:Vn,arrForEach:L,arrIndexOf:F,arrMap:Wn,arrReduce:Gn,strTrim:h,objCreate:H,objKeys:Xn,objDefineAccessors:$n,addEventHandler:Ti,dateNow:ne,isIE:dt,disableCookies:ji,newGuid:ki,perfNow:Li,newId:qt,randomValue:Rt,random32:zt,mwcRandomSeed:Bt,mwcRandom32:Kt,generateW3CId:Fi},Oi=/[xy]/g,Di={Attach:bi,AttachEvent:bi,Detach:wi,DetachEvent:wi};function Ui(n,e){n=Tr(n,e),e=Ai._canUseCookies;return null===Mi&&(Mi=[],Pi=e,$n(Ai,"_canUseCookies",function(){return Pi},function(e){Pi=e,L(Mi,function(n){n.setEnabled(e)})})),-1===F(Mi,n)&&Mi.push(n),qn(e)&&n.setEnabled(e),qn(Pi)&&n.setEnabled(Pi),n}function ji(){Ui().setEnabled(!1)}var Ri=le({CRITICAL:1,WARNING:2}),zi=le({BrowserDoesNotSupportLocalStorage:0,BrowserCannotReadLocalStorage:1,BrowserCannotReadSessionStorage:2,BrowserCannotWriteLocalStorage:3,BrowserCannotWriteSessionStorage:4,BrowserFailedRemovalFromLocalStorage:5,BrowserFailedRemovalFromSessionStorage:6,CannotSendEmptyTelemetry:7,ClientPerformanceMathError:8,ErrorParsingAISessionCookie:9,ErrorPVCalc:10,ExceptionWhileLoggingError:11,FailedAddingTelemetryToBuffer:12,FailedMonitorAjaxAbort:13,FailedMonitorAjaxDur:14,FailedMonitorAjaxOpen:15,FailedMonitorAjaxRSC:16,FailedMonitorAjaxSend:17,FailedMonitorAjaxGetCorrelationHeader:18,FailedToAddHandlerForOnBeforeUnload:19,FailedToSendQueuedTelemetry:20,FailedToReportDataLoss:21,FlushFailed:22,MessageLimitPerPVExceeded:23,MissingRequiredFieldSpecification:24,NavigationTimingNotSupported:25,OnError:26,SessionRenewalDateIsZero:27,SenderNotInitialized:28,StartTrackEventFailed:29,StopTrackEventFailed:30,StartTrackFailed:31,StopTrackFailed:32,TelemetrySampledAndNotSent:33,TrackEventFailed:34,TrackExceptionFailed:35,TrackMetricFailed:36,TrackPVFailed:37,TrackPVFailedCalc:38,TrackTraceFailed:39,TransmissionFailed:40,FailedToSetStorageBuffer:41,FailedToRestoreStorageBuffer:42,InvalidBackendResponse:43,FailedToFixDepricatedValues:44,InvalidDurationValue:45,TelemetryEnvelopeInvalid:46,CreateEnvelopeError:47,CannotSerializeObject:48,CannotSerializeObjectNonSerializable:49,CircularReferenceDetected:50,ClearAuthContextFailed:51,ExceptionTruncated:52,IllegalCharsInName:53,ItemNotInArray:54,MaxAjaxPerPVExceeded:55,MessageTruncated:56,NameTooLong:57,SampleRateOutOfRange:58,SetAuthContextFailed:59,SetAuthContextFailedAccountName:60,StringValueTooLong:61,StartCalledMoreThanOnce:62,StopCalledWithoutStart:63,TelemetryInitializerFailed:64,TrackArgumentsNotSpecified:65,UrlTooLong:66,SessionStorageBufferFull:67,CannotAccessCookie:68,IdTooLong:69,InvalidEvent:70,FailedMonitorAjaxSetRequestHeader:71,SendBrowserInfoOnUserInit:72,PluginException:73,NotificationException:74,SnippetScriptLoadFailure:99,InvalidInstrumentationKey:100,CannotParseAiBlobValue:101,InvalidContentBlob:102,TrackPageActionEventFailed:103,FailedAddingCustomDefinedRequestContext:104,InMemoryStorageBufferFull:105}),Bi="_aiHooks",Ki=["req","rsp","hkErr","fnErr"];function qi(n,e){if(n)for(var t=0;t=o&&!(n=r===i)){for(var u=0;u" } ], "releaseTag": "Public", "name": "_InternalMessageId", "variableTypeTokenRange": { "startIndex": 1, "endIndex": 6 } }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!_IRegisteredEvents:interface", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export interface _IRegisteredEvents " } ], "releaseTag": "Public", "name": "_IRegisteredEvents", "members": [ { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!_IRegisteredEvents#handler:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "handler: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "handler", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!_IRegisteredEvents#name:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "name: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "name", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } } ], "extendsTokenRanges": [] }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!_legacyCookieMgr:function(1)", "docComment": "/**\n * Helper to support backward compatibility for users that use the legacy cookie handling functions and the use the internal CoreUtils._canUseCookies global flag to enable/disable cookies usage. Note: This has the following deliberate side-effects - Creates the global (legacy) cookie manager if it does not already exist - Attempts to add \"listeners\" to the CoreUtils._canUseCookies property to support the legacy usage\n *\n * @param config - \n *\n * @param logger - \n *\n * @returns \n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function _legacyCookieMgr(config?: " }, { "kind": "Reference", "text": "IConfiguration", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration:interface" }, { "kind": "Content", "text": ", logger?: " }, { "kind": "Reference", "text": "IDiagnosticLogger", "canonicalReference": "@microsoft/applicationinsights-core-js!IDiagnosticLogger:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "ICookieMgr", "canonicalReference": "@microsoft/applicationinsights-core-js!ICookieMgr:interface" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "config", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": true }, { "parameterName": "logger", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": true } ], "name": "_legacyCookieMgr" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!_logInternalMessage:function(1)", "docComment": "/**\n * Logs a message to the internal queue.\n *\n * @param logger - The Diagnostic Logger instance to use.\n *\n * @param severity - The severity of the log message\n *\n * @param message - The message to log.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function _logInternalMessage(logger: " }, { "kind": "Reference", "text": "IDiagnosticLogger", "canonicalReference": "@microsoft/applicationinsights-core-js!IDiagnosticLogger:interface" }, { "kind": "Content", "text": ", severity: " }, { "kind": "Reference", "text": "LoggingSeverity", "canonicalReference": "@microsoft/applicationinsights-core-js!LoggingSeverity:type" }, { "kind": "Content", "text": ", message: " }, { "kind": "Reference", "text": "_InternalLogMessage", "canonicalReference": "@microsoft/applicationinsights-core-js!_InternalLogMessage:class" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "logger", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "severity", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "message", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": false } ], "name": "_logInternalMessage" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!_throwInternal:function(1)", "docComment": "/**\n * This is a helper method which will call throwInternal on the passed logger, will throw exceptions in debug mode or attempt to log the error as a console warning. This helper is provided mostly to better support minification as logger.throwInternal() will not compress the publish \"throwInternal\" used throughout the code.\n *\n * @param logger - The Diagnostic Logger instance to use.\n *\n * @param severity - The severity of the log message\n *\n * @param message - The log message.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function _throwInternal(logger: " }, { "kind": "Reference", "text": "IDiagnosticLogger", "canonicalReference": "@microsoft/applicationinsights-core-js!IDiagnosticLogger:interface" }, { "kind": "Content", "text": ", severity: " }, { "kind": "Reference", "text": "LoggingSeverity", "canonicalReference": "@microsoft/applicationinsights-core-js!LoggingSeverity:type" }, { "kind": "Content", "text": ", msgId: " }, { "kind": "Reference", "text": "_InternalMessageId", "canonicalReference": "@microsoft/applicationinsights-core-js!_InternalMessageId:type" }, { "kind": "Content", "text": ", msg: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ", properties?: " }, { "kind": "Reference", "text": "Object", "canonicalReference": "!Object:interface" }, { "kind": "Content", "text": ", isUserAct?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 13, "endIndex": 14 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "logger", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "severity", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "msgId", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": false }, { "parameterName": "msg", "parameterTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "isOptional": false }, { "parameterName": "properties", "parameterTypeTokenRange": { "startIndex": 9, "endIndex": 10 }, "isOptional": true }, { "parameterName": "isUserAct", "parameterTypeTokenRange": { "startIndex": 11, "endIndex": 12 }, "isOptional": true } ], "name": "_throwInternal" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!_warnToConsole:function(1)", "docComment": "/**\n * This is a helper method which will call warnToConsole on the passed logger with the provided message.\n *\n * @param logger - The Diagnostic Logger instance to use.\n *\n * @param message - The log message.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function _warnToConsole(logger: " }, { "kind": "Reference", "text": "IDiagnosticLogger", "canonicalReference": "@microsoft/applicationinsights-core-js!IDiagnosticLogger:interface" }, { "kind": "Content", "text": ", message: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "logger", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "message", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false } ], "name": "_warnToConsole" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!addEventHandler:function(1)", "docComment": "/**\n * Trys to add an event handler for the specified event to the window, body and document\n *\n * @param eventName - The name of the event\n *\n * @param callback - The callback function that needs to be executed for the given event\n *\n * @param evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace. @return {boolean} - true if the handler was successfully added\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function addEventHandler(eventName: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ", callback: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ", evtNamespace?: " }, { "kind": "Content", "text": "string | string[] | null" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "eventName", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "callback", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "evtNamespace", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": true } ], "name": "addEventHandler" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!addEventListeners:function(1)", "docComment": "/**\n * Bind the listener to the array of events\n *\n * @param events - An string array of event names to bind the listener to\n *\n * @param listener - The event callback to call when the event is triggered\n *\n * @param excludeEvents - [Optional] An array of events that should not be hooked (if possible), unless no other events can be.\n *\n * @param evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.\n *\n * @returns true - when at least one of the events was registered otherwise false\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function addEventListeners(events: " }, { "kind": "Content", "text": "string[]" }, { "kind": "Content", "text": ", listener: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ", excludeEvents?: " }, { "kind": "Content", "text": "string[]" }, { "kind": "Content", "text": ", evtNamespace?: " }, { "kind": "Content", "text": "string | string[]" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 9, "endIndex": 10 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "events", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "listener", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "excludeEvents", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": true }, { "parameterName": "evtNamespace", "parameterTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "isOptional": true } ], "name": "addEventListeners" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!addPageHideEventListener:function(1)", "docComment": "/**\n * Listen to the pagehide and visibility changing to 'hidden' events, because the 'visibilitychange' uses an internal proxy to detect the visibility state you SHOULD use a unique namespace when if you plan to call removePageShowEventListener as the remove ignores the listener argument for the 'visibilitychange' event.\n *\n * @param listener - The event callback to call when a page hide event is triggered\n *\n * @param excludeEvents - [Optional] An array of events that should not be hooked (if possible), unless no other events can be.\n *\n * @param evtNamespace - [Optional] A Namespace to append to the event listeners so they can be uniquely identified and removed based on this namespace. This call also adds an additional unique \"pageshow\" namespace to the events so that only the matching \"removePageHideEventListener\" can remove these events. Suggestion: pass as true if you are also calling addPageUnloadEventListener as that also hooks pagehide\n *\n * @returns true - when at least one of the events was registered otherwise false\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function addPageHideEventListener(listener: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ", excludeEvents?: " }, { "kind": "Content", "text": "string[] | null" }, { "kind": "Content", "text": ", evtNamespace?: " }, { "kind": "Content", "text": "string | string[] | null" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "listener", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "excludeEvents", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": true }, { "parameterName": "evtNamespace", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": true } ], "name": "addPageHideEventListener" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!addPageShowEventListener:function(1)", "docComment": "/**\n * Listen to the pageshow and visibility changing to 'visible' events, because the 'visibilitychange' uses an internal proxy to detect the visibility state you SHOULD use a unique namespace when if you plan to call removePageShowEventListener as the remove ignores the listener argument for the 'visibilitychange' event.\n *\n * @param listener - The event callback to call when a page is show event is triggered\n *\n * @param excludeEvents - [Optional] An array of events that should not be hooked (if possible), unless no other events can be.\n *\n * @param evtNamespace - [Optional/Recommended] A Namespace to append to the event listeners so they can be uniquely identified and removed based on this namespace. This call also adds an additional unique \"pageshow\" namespace to the events so that only the matching \"removePageShowEventListener\" can remove these events.\n *\n * @returns true - when at least one of the events was registered otherwise false\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function addPageShowEventListener(listener: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ", excludeEvents?: " }, { "kind": "Content", "text": "string[] | null" }, { "kind": "Content", "text": ", evtNamespace?: " }, { "kind": "Content", "text": "string | string[] | null" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "listener", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "excludeEvents", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": true }, { "parameterName": "evtNamespace", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": true } ], "name": "addPageShowEventListener" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!addPageUnloadEventListener:function(1)", "docComment": "/**\n * Listen to the 'beforeunload', 'unload' and 'pagehide' events which indicates a page unload is occurring, this does NOT listen to the 'visibilitychange' event as while it does indicate that the page is being hidden it does not *necessarily* mean that the page is being completely unloaded, it can mean that the user is just navigating to a different Tab and may come back (without unloading the page). As such you may also need to listen to the 'addPageHideEventListener' and 'addPageShowEventListener' events.\n *\n * @param listener - The event callback to call when a page unload event is triggered\n *\n * @param excludeEvents - [Optional] An array of events that should not be hooked, unless no other events can be.\n *\n * @param evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.\n *\n * @returns true - when at least one of the events was registered otherwise false\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function addPageUnloadEventListener(listener: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ", excludeEvents?: " }, { "kind": "Content", "text": "string[]" }, { "kind": "Content", "text": ", evtNamespace?: " }, { "kind": "Content", "text": "string | string[]" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "listener", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "excludeEvents", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": true }, { "parameterName": "evtNamespace", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": true } ], "name": "addPageUnloadEventListener" }, { "kind": "Class", "canonicalReference": "@microsoft/applicationinsights-core-js!AppInsightsCore:class", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare class AppInsightsCore extends " }, { "kind": "Reference", "text": "BaseCore", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseCore:class" }, { "kind": "Content", "text": " " }, { "kind": "Content", "text": "implements " }, { "kind": "Reference", "text": "IAppInsightsCore", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore:interface" }, { "kind": "Content", "text": " " } ], "releaseTag": "Public", "name": "AppInsightsCore", "members": [ { "kind": "Constructor", "canonicalReference": "@microsoft/applicationinsights-core-js!AppInsightsCore:constructor(1)", "docComment": "/**\n * Constructs a new instance of the `AppInsightsCore` class\n */\n", "excerptTokens": [ { "kind": "Content", "text": "constructor();" } ], "releaseTag": "Public", "overloadIndex": 1, "parameters": [] }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!AppInsightsCore#initialize:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "initialize(config: " }, { "kind": "Reference", "text": "IConfiguration", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration:interface" }, { "kind": "Content", "text": ", extensions: " }, { "kind": "Reference", "text": "IPlugin", "canonicalReference": "@microsoft/applicationinsights-core-js!IPlugin:interface" }, { "kind": "Content", "text": "[]" }, { "kind": "Content", "text": ", logger?: " }, { "kind": "Reference", "text": "IDiagnosticLogger", "canonicalReference": "@microsoft/applicationinsights-core-js!IDiagnosticLogger:interface" }, { "kind": "Content", "text": ", notificationManager?: " }, { "kind": "Reference", "text": "INotificationManager", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationManager:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 10, "endIndex": 11 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "config", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "extensions", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 5 }, "isOptional": false }, { "parameterName": "logger", "parameterTypeTokenRange": { "startIndex": 6, "endIndex": 7 }, "isOptional": true }, { "parameterName": "notificationManager", "parameterTypeTokenRange": { "startIndex": 8, "endIndex": 9 }, "isOptional": true } ], "name": "initialize" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!AppInsightsCore#track:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "track(telemetryItem: " }, { "kind": "Reference", "text": "ITelemetryItem", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryItem:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "telemetryItem", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "track" } ], "extendsTokenRange": { "startIndex": 1, "endIndex": 2 }, "implementsTokenRanges": [ { "startIndex": 4, "endIndex": 5 } ] }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!areCookiesSupported:function(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare function areCookiesSupported(logger?: " }, { "kind": "Reference", "text": "IDiagnosticLogger", "canonicalReference": "@microsoft/applicationinsights-core-js!IDiagnosticLogger:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "logger", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": true } ], "name": "areCookiesSupported" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!arrForEach:function(1)", "docComment": "/**\n * Performs the specified action for each element in an array. This helper exists to avoid adding a polyfil for older browsers that do not define Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page checks for presence/absence of the prototype implementation. Note: For consistency this will not use the Array.prototype.xxxx implementation if it exists as this would cause a testing requirement to test with and without the implementations\n *\n * @param callbackfn - A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. It can return -1 to break out of the loop\n *\n * @param thisArg - [Optional] An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function arrForEach(arr: " }, { "kind": "Content", "text": "T[]" }, { "kind": "Content", "text": ", callbackfn: " }, { "kind": "Content", "text": "(value: T, index?: number, array?: T[]) => undefined | void | number" }, { "kind": "Content", "text": ", thisArg?: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 9, "endIndex": 10 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "arr", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "callbackfn", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": false }, { "parameterName": "thisArg", "parameterTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "isOptional": true } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 1, "endIndex": 2 } } ], "name": "arrForEach" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!arrIndexOf:function(1)", "docComment": "/**\n * Returns the index of the first occurrence of a value in an array. This helper exists to avoid adding a polyfil for older browsers that do not define Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page checks for presence/absence of the prototype implementation. Note: For consistency this will not use the Array.prototype.xxxx implementation if it exists as this would cause a testing requirement to test with and without the implementations\n *\n * @param searchElement - The value to locate in the array.\n *\n * @param fromIndex - The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function arrIndexOf(arr: " }, { "kind": "Content", "text": "T[]" }, { "kind": "Content", "text": ", searchElement: " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": ", fromIndex?: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "arr", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "searchElement", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "fromIndex", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": true } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "arrIndexOf" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!arrMap:function(1)", "docComment": "/**\n * Calls a defined callback function on each element of an array, and returns an array that contains the results. This helper exists to avoid adding a polyfil for older browsers that do not define Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page checks for presence/absence of the prototype implementation. Note: For consistency this will not use the Array.prototype.xxxx implementation if it exists as this would cause a testing requirement to test with and without the implementations\n *\n * @param callbackfn - A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.\n *\n * @param thisArg - An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function arrMap(arr: " }, { "kind": "Content", "text": "T[]" }, { "kind": "Content", "text": ", callbackfn: " }, { "kind": "Content", "text": "(value: T, index?: number, array?: T[]) => R" }, { "kind": "Content", "text": ", thisArg?: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "R[]" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "arr", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "callbackfn", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "thisArg", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": true } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } }, { "typeParameterName": "R", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "arrMap" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!arrReduce:function(1)", "docComment": "/**\n * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. This helper exists to avoid adding a polyfil for older browsers that do not define Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page checks for presence/absence of the prototype implementation. Note: For consistency this will not use the Array.prototype.xxxx implementation if it exists as this would cause a testing requirement to test with and without the implementations\n *\n * @param callbackfn - A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\n *\n * @param initialValue - If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function arrReduce(arr: " }, { "kind": "Content", "text": "T[]" }, { "kind": "Content", "text": ", callbackfn: " }, { "kind": "Content", "text": "(previousValue: T | R, currentValue?: T, currentIndex?: number, array?: T[]) => R" }, { "kind": "Content", "text": ", initialValue?: " }, { "kind": "Content", "text": "R" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "R" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "arr", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "callbackfn", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "initialValue", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": true } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } }, { "typeParameterName": "R", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "arrReduce" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!attachEvent:function(1)", "docComment": "/**\n * Binds the specified function to an event, so that the function gets called whenever the event fires on the object\n *\n * @param obj - Object to add the event too.\n *\n * @param eventNameWithoutOn - String that specifies any of the standard DHTML Events without \"on\" prefix and optional (dot \".\" prefixed) namespaces \"click\" \"click.mynamespace\".\n *\n * @param handlerRef - Pointer that specifies the function to call when event fires\n *\n * @param useCapture - [Optional] Defaults to false\n *\n * @returns True if the function was bound successfully to the event, otherwise false\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function attachEvent(obj: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ", eventNameWithoutOn: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ", handlerRef: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ", useCapture?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 9, "endIndex": 10 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "obj", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "eventNameWithoutOn", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "handlerRef", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": false }, { "parameterName": "useCapture", "parameterTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "isOptional": true } ], "name": "attachEvent" }, { "kind": "Class", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseCore:class", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare class BaseCore implements " }, { "kind": "Reference", "text": "IAppInsightsCore", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore:interface" }, { "kind": "Content", "text": " " } ], "releaseTag": "Public", "name": "BaseCore", "members": [ { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseCore#_extensions:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "_extensions: " }, { "kind": "Reference", "text": "IPlugin", "canonicalReference": "@microsoft/applicationinsights-core-js!IPlugin:interface" }, { "kind": "Content", "text": "[]" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "_extensions", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "isStatic": false }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseCore#_updateHook:member(1)", "docComment": "/**\n * Hook for Core extensions to allow them to update their own configuration before updating all of the plugins.\n *\n * @param updateCtx - The plugin update context\n *\n * @param updateState - The Update State\n *\n * @returns boolean - True means the extension class will call updateState otherwise the Core will\n */\n", "excerptTokens": [ { "kind": "Content", "text": "protected _updateHook?(updateCtx: " }, { "kind": "Reference", "text": "IProcessTelemetryUpdateContext", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryUpdateContext:interface" }, { "kind": "Content", "text": ", updateState: " }, { "kind": "Reference", "text": "ITelemetryUpdateState", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryUpdateState:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void | boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "isStatic": false, "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "updateCtx", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "updateState", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false } ], "name": "_updateHook" }, { "kind": "Constructor", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseCore:constructor(1)", "docComment": "/**\n * Constructs a new instance of the `BaseCore` class\n */\n", "excerptTokens": [ { "kind": "Content", "text": "constructor();" } ], "releaseTag": "Public", "overloadIndex": 1, "parameters": [] }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseCore#addNotificationListener:member(1)", "docComment": "/**\n * Adds a notification listener. The SDK calls methods on the listener when an appropriate notification is raised. The added plugins must raise notifications. If the plugins do not implement the notifications, then no methods will be called.\n *\n * @param listener - An INotificationListener object.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "addNotificationListener(listener: " }, { "kind": "Reference", "text": "INotificationListener", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationListener:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "listener", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "addNotificationListener" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseCore#addPlugin:member(1)", "docComment": "/**\n * Add a new plugin to the installation\n *\n * @param plugin - The new plugin to add\n *\n * @param replaceExisting - should any existing plugin be replaced, default is false\n *\n * @param doAsync - Should the add be performed asynchronously\n *\n * @param addCb - [Optional] callback to call after the plugin has been added\n */\n", "excerptTokens": [ { "kind": "Content", "text": "addPlugin(plugin: " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": ", replaceExisting?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ", doAsync?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ", addCb?: " }, { "kind": "Content", "text": "(added?: boolean) => void" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 14, "endIndex": 15 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "plugin", "parameterTypeTokenRange": { "startIndex": 6, "endIndex": 7 }, "isOptional": false }, { "parameterName": "replaceExisting", "parameterTypeTokenRange": { "startIndex": 8, "endIndex": 9 }, "isOptional": true }, { "parameterName": "doAsync", "parameterTypeTokenRange": { "startIndex": 10, "endIndex": 11 }, "isOptional": true }, { "parameterName": "addCb", "parameterTypeTokenRange": { "startIndex": 12, "endIndex": 13 }, "isOptional": true } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 1, "endIndex": 2 }, "defaultTypeTokenRange": { "startIndex": 4, "endIndex": 5 } } ], "name": "addPlugin" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseCore#addTelemetryInitializer:member(1)", "docComment": "/**\n * Add a telemetry processor to decorate or drop telemetry events.\n *\n * @param telemetryInitializer - The Telemetry Initializer function\n *\n * @returns - A ITelemetryInitializerHandler to enable the initializer to be removed\n */\n", "excerptTokens": [ { "kind": "Content", "text": "addTelemetryInitializer(telemetryInitializer: " }, { "kind": "Reference", "text": "TelemetryInitializerFunction", "canonicalReference": "@microsoft/applicationinsights-core-js!TelemetryInitializerFunction:type" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "ITelemetryInitializerHandler", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryInitializerHandler:interface" }, { "kind": "Content", "text": " | void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 5 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "telemetryInitializer", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "addTelemetryInitializer" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseCore#addUnloadCb:member(1)", "docComment": "/**\n * Add an unload handler that will be called when the SDK is being unloaded\n *\n * @param handler - the handler\n */\n", "excerptTokens": [ { "kind": "Content", "text": "addUnloadCb(handler: " }, { "kind": "Reference", "text": "UnloadHandler", "canonicalReference": "@microsoft/applicationinsights-core-js!UnloadHandler:type" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "handler", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "addUnloadCb" }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseCore#config:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "config: " }, { "kind": "Reference", "text": "IConfiguration", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "config", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseCore.defaultConfig:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "static defaultConfig: " }, { "kind": "Reference", "text": "IConfiguration", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "defaultConfig", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": true }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseCore#eventCnt:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "eventCnt(): " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "eventCnt" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseCore#evtNamespace:member(1)", "docComment": "/**\n * Returns the unique event namespace that should be used\n */\n", "excerptTokens": [ { "kind": "Content", "text": "evtNamespace(): " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "evtNamespace" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseCore#flush:member(1)", "docComment": "/**\n * Flush and send any batched / cached data immediately\n *\n * @param async - send data asynchronously when true (defaults to true)\n *\n * @param callBack - if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called. If the caller doesn't return true the caller should assume that it may never be called.\n *\n * @param sendReason - specify the reason that you are calling \"flush\" defaults to ManualFlush (1) if not specified\n *\n * @returns - true if the callback will be return after the flush is complete otherwise the caller should assume that any provided callback will never be called\n */\n", "excerptTokens": [ { "kind": "Content", "text": "flush(isAsync?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ", callBack?: " }, { "kind": "Content", "text": "(flushComplete?: boolean) => void" }, { "kind": "Content", "text": ", sendReason?: " }, { "kind": "Reference", "text": "SendRequestReason", "canonicalReference": "@microsoft/applicationinsights-core-js!SendRequestReason:enum" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "isAsync", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": true }, { "parameterName": "callBack", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": true }, { "parameterName": "sendReason", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": true } ], "name": "flush" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseCore#getCookieMgr:member(1)", "docComment": "/**\n * Get the current cookie manager for this instance\n */\n", "excerptTokens": [ { "kind": "Content", "text": "getCookieMgr(): " }, { "kind": "Reference", "text": "ICookieMgr", "canonicalReference": "@microsoft/applicationinsights-core-js!ICookieMgr:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "getCookieMgr" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseCore#getNotifyMgr:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "getNotifyMgr(): " }, { "kind": "Reference", "text": "INotificationManager", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationManager:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "getNotifyMgr" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseCore#getPerfMgr:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "getPerfMgr(): " }, { "kind": "Reference", "text": "IPerfManager", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfManager:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "getPerfMgr" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseCore#getPlugin:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "getPlugin(pluginIdentifier: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "ILoadedPlugin", "canonicalReference": "@microsoft/applicationinsights-core-js!ILoadedPlugin:interface" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 8, "endIndex": 10 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "pluginIdentifier", "parameterTypeTokenRange": { "startIndex": 6, "endIndex": 7 }, "isOptional": false } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 1, "endIndex": 2 }, "defaultTypeTokenRange": { "startIndex": 4, "endIndex": 5 } } ], "name": "getPlugin" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseCore#getProcessTelContext:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "getProcessTelContext(): " }, { "kind": "Reference", "text": "IProcessTelemetryContext", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryContext:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "getProcessTelContext" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseCore#getTransmissionControls:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "getTransmissionControls(): " }, { "kind": "Reference", "text": "IChannelControls", "canonicalReference": "@microsoft/applicationinsights-core-js!IChannelControls:interface" }, { "kind": "Content", "text": "[][]" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "getTransmissionControls" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseCore#initialize:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "initialize(config: " }, { "kind": "Reference", "text": "IConfiguration", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration:interface" }, { "kind": "Content", "text": ", extensions: " }, { "kind": "Reference", "text": "IPlugin", "canonicalReference": "@microsoft/applicationinsights-core-js!IPlugin:interface" }, { "kind": "Content", "text": "[]" }, { "kind": "Content", "text": ", logger?: " }, { "kind": "Reference", "text": "IDiagnosticLogger", "canonicalReference": "@microsoft/applicationinsights-core-js!IDiagnosticLogger:interface" }, { "kind": "Content", "text": ", notificationManager?: " }, { "kind": "Reference", "text": "INotificationManager", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationManager:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 10, "endIndex": 11 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "config", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "extensions", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 5 }, "isOptional": false }, { "parameterName": "logger", "parameterTypeTokenRange": { "startIndex": 6, "endIndex": 7 }, "isOptional": true }, { "parameterName": "notificationManager", "parameterTypeTokenRange": { "startIndex": 8, "endIndex": 9 }, "isOptional": true } ], "name": "initialize" }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseCore#isInitialized:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "isInitialized: " }, { "kind": "Content", "text": "() => boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "isInitialized", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseCore#logger:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "logger: " }, { "kind": "Reference", "text": "IDiagnosticLogger", "canonicalReference": "@microsoft/applicationinsights-core-js!IDiagnosticLogger:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "logger", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseCore#pollInternalLogs:member(1)", "docComment": "/**\n * Periodically check logger.queue for\n */\n", "excerptTokens": [ { "kind": "Content", "text": "pollInternalLogs(eventName?: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "eventName", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": true } ], "name": "pollInternalLogs" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseCore#releaseQueue:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "protected releaseQueue(): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "releaseQueue" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseCore#removeNotificationListener:member(1)", "docComment": "/**\n * Removes all instances of the listener.\n *\n * @param listener - INotificationListener to remove.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "removeNotificationListener(listener: " }, { "kind": "Reference", "text": "INotificationListener", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationListener:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "listener", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "removeNotificationListener" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseCore#setCookieMgr:member(1)", "docComment": "/**\n * Set the current cookie manager for this instance\n *\n * @param cookieMgr - The manager, if set to null/undefined will cause the default to be created\n */\n", "excerptTokens": [ { "kind": "Content", "text": "setCookieMgr(cookieMgr: " }, { "kind": "Reference", "text": "ICookieMgr", "canonicalReference": "@microsoft/applicationinsights-core-js!ICookieMgr:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "cookieMgr", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "setCookieMgr" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseCore#setPerfMgr:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "setPerfMgr(perfMgr: " }, { "kind": "Reference", "text": "IPerfManager", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfManager:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "perfMgr", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "setPerfMgr" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseCore#stopPollingInternalLogs:member(1)", "docComment": "/**\n * Periodically check logger.queue for\n */\n", "excerptTokens": [ { "kind": "Content", "text": "stopPollingInternalLogs(): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "stopPollingInternalLogs" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseCore#track:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "track(telemetryItem: " }, { "kind": "Reference", "text": "ITelemetryItem", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryItem:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "telemetryItem", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "track" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseCore#unload:member(1)", "docComment": "/**\n * Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous unload call return `true` stating that all plugins reported that they also unloaded, the recommended approach is to create a new instance and initialize that instance. This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable to successfully remove any global references or they may just be completing the unload process asynchronously.\n *\n * @param isAsync - Can the unload be performed asynchronously (default)\n *\n * @param unloadComplete - An optional callback that will be called once the unload has completed\n *\n * @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the unload. Defaults to 5 seconds.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "unload(isAsync?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ", unloadComplete?: " }, { "kind": "Content", "text": "(unloadState: " }, { "kind": "Reference", "text": "ITelemetryUnloadState", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryUnloadState:interface" }, { "kind": "Content", "text": ") => void" }, { "kind": "Content", "text": ", cbTimeout?: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 9, "endIndex": 10 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "isAsync", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": true }, { "parameterName": "unloadComplete", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 6 }, "isOptional": true }, { "parameterName": "cbTimeout", "parameterTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "isOptional": true } ], "name": "unload" } ], "implementsTokenRanges": [ { "startIndex": 1, "endIndex": 2 } ] }, { "kind": "Class", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseTelemetryPlugin:class", "docComment": "/**\n * BaseTelemetryPlugin provides a basic implementation of the ITelemetryPlugin interface so that plugins can avoid implementation the same set of boiler plate code as well as provide a base implementation so that new default implementations can be added without breaking all plugins.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare abstract class BaseTelemetryPlugin implements " }, { "kind": "Reference", "text": "ITelemetryPlugin", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryPlugin:interface" }, { "kind": "Content", "text": " " } ], "releaseTag": "Public", "name": "BaseTelemetryPlugin", "members": [ { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseTelemetryPlugin#_addHook:member(1)", "docComment": "/**\n * Add this hook so that it is automatically removed during unloading\n *\n * @param hooks - The single hook or an array of IInstrumentHook objects\n */\n", "excerptTokens": [ { "kind": "Content", "text": "protected _addHook(hooks: " }, { "kind": "Reference", "text": "IInstrumentHook", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentHook:interface" }, { "kind": "Content", "text": " | " }, { "kind": "Reference", "text": "IInstrumentHook", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentHook:interface" }, { "kind": "Content", "text": "[]" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 6, "endIndex": 7 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "hooks", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 5 }, "isOptional": false } ], "name": "_addHook" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseTelemetryPlugin#_addUnloadCb:member(1)", "docComment": "/**\n * Add an unload handler that will be called when the SDK is being unloaded\n *\n * @param handler - the handler\n */\n", "excerptTokens": [ { "kind": "Content", "text": "protected _addUnloadCb(handler: " }, { "kind": "Reference", "text": "UnloadHandler", "canonicalReference": "@microsoft/applicationinsights-core-js!UnloadHandler:type" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "handler", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "_addUnloadCb" }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseTelemetryPlugin#_doTeardown:member", "docComment": "/**\n * Teardown / Unload hook to allow implementations to perform some additional unload operations before the BaseTelemetryPlugin finishes it's removal.\n *\n * @param unloadCtx - This is the context that should be used during unloading.\n *\n * @param unloadState - The details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.\n *\n * @param asyncCallback - An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async unload/teardown operations.\n *\n * @returns boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "protected _doTeardown?: " }, { "kind": "Content", "text": "(unloadCtx?: " }, { "kind": "Reference", "text": "IProcessTelemetryUnloadContext", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryUnloadContext:interface" }, { "kind": "Content", "text": ", unloadState?: " }, { "kind": "Reference", "text": "ITelemetryUnloadState", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryUnloadState:interface" }, { "kind": "Content", "text": ", asyncCallback?: () => void) => void | boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "_doTeardown", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 6 }, "isStatic": false }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseTelemetryPlugin#_doUpdate:member", "docComment": "/**\n * Extension hook to allow implementations to perform some additional update operations before the BaseTelemetryPlugin finishes it's removal\n *\n * @param updateCtx - This is the context that should be used during updating.\n *\n * @param updateState - The details / state of the update process, it holds details like the current and previous configuration.\n *\n * @param asyncCallback - An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async update operations.\n *\n * @returns boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "protected _doUpdate?: " }, { "kind": "Content", "text": "(updateCtx?: " }, { "kind": "Reference", "text": "IProcessTelemetryUpdateContext", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryUpdateContext:interface" }, { "kind": "Content", "text": ", updateState?: " }, { "kind": "Reference", "text": "ITelemetryUpdateState", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryUpdateState:interface" }, { "kind": "Content", "text": ", asyncCallback?: () => void) => void | boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "_doUpdate", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 6 }, "isStatic": false }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseTelemetryPlugin#_getTelCtx:member", "docComment": "/**\n * Helper to return the current IProcessTelemetryContext, if the passed argument exists this just returns that value (helps with minification for callers), otherwise it will return the configured context or a temporary one.\n *\n * @param currentCtx - [Optional] The current execution context\n */\n", "excerptTokens": [ { "kind": "Content", "text": "protected _getTelCtx: " }, { "kind": "Content", "text": "(currentCtx?: " }, { "kind": "Reference", "text": "IProcessTelemetryContext", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryContext:interface" }, { "kind": "Content", "text": ") => " }, { "kind": "Reference", "text": "IProcessTelemetryContext", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryContext:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "_getTelCtx", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 5 }, "isStatic": false }, { "kind": "Constructor", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseTelemetryPlugin:constructor(1)", "docComment": "/**\n * Constructs a new instance of the `BaseTelemetryPlugin` class\n */\n", "excerptTokens": [ { "kind": "Content", "text": "constructor();" } ], "releaseTag": "Public", "overloadIndex": 1, "parameters": [] }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseTelemetryPlugin#core:member", "docComment": "/**\n * Holds the core instance that was used during initialization\n */\n", "excerptTokens": [ { "kind": "Content", "text": "core: " }, { "kind": "Reference", "text": "IAppInsightsCore", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "core", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseTelemetryPlugin#diagLog:member", "docComment": "/**\n * Returns the current diagnostic logger that can be used to log issues, if no logger is currently assigned a new default one will be created and returned.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "diagLog: " }, { "kind": "Content", "text": "(itemCtx?: " }, { "kind": "Reference", "text": "IProcessTelemetryContext", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryContext:interface" }, { "kind": "Content", "text": ") => " }, { "kind": "Reference", "text": "IDiagnosticLogger", "canonicalReference": "@microsoft/applicationinsights-core-js!IDiagnosticLogger:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "diagLog", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 5 }, "isStatic": false }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseTelemetryPlugin#identifier:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "identifier: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "identifier", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseTelemetryPlugin#initialize:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "initialize(config: " }, { "kind": "Reference", "text": "IConfiguration", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration:interface" }, { "kind": "Content", "text": ", core: " }, { "kind": "Reference", "text": "IAppInsightsCore", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore:interface" }, { "kind": "Content", "text": ", extensions: " }, { "kind": "Reference", "text": "IPlugin", "canonicalReference": "@microsoft/applicationinsights-core-js!IPlugin:interface" }, { "kind": "Content", "text": "[]" }, { "kind": "Content", "text": ", pluginChain?: " }, { "kind": "Reference", "text": "ITelemetryPluginChain", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryPluginChain:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 10, "endIndex": 11 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "config", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "core", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "extensions", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 7 }, "isOptional": false }, { "parameterName": "pluginChain", "parameterTypeTokenRange": { "startIndex": 8, "endIndex": 9 }, "isOptional": true } ], "name": "initialize" }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseTelemetryPlugin#isInitialized:member", "docComment": "/**\n * Returns whether the plugin has been initialized\n */\n", "excerptTokens": [ { "kind": "Content", "text": "isInitialized: " }, { "kind": "Content", "text": "() => boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "isInitialized", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseTelemetryPlugin#priority:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "priority: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "priority", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseTelemetryPlugin#processNext:member", "docComment": "/**\n * Call back for telemetry processing before it it is sent\n *\n * @param env - This is the current event being reported\n *\n * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances can optionally use this to access the current core instance or define / pass additional information to later plugins (vs appending items to the telemetry item)\n */\n", "excerptTokens": [ { "kind": "Content", "text": "processNext: " }, { "kind": "Content", "text": "(env: " }, { "kind": "Reference", "text": "ITelemetryItem", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryItem:interface" }, { "kind": "Content", "text": ", itemCtx: " }, { "kind": "Reference", "text": "IProcessTelemetryContext", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryContext:interface" }, { "kind": "Content", "text": ") => void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "processNext", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 6 }, "isStatic": false }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseTelemetryPlugin#processTelemetry:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "abstract processTelemetry(env: " }, { "kind": "Reference", "text": "ITelemetryItem", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryItem:interface" }, { "kind": "Content", "text": ", itemCtx?: " }, { "kind": "Reference", "text": "IProcessTelemetryContext", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryContext:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "env", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "itemCtx", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": true } ], "name": "processTelemetry" }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseTelemetryPlugin#setInitialized:member", "docComment": "/**\n * Internal helper to allow setting of the internal initialized setting for inherited instances and unit testing\n */\n", "excerptTokens": [ { "kind": "Content", "text": "protected setInitialized: " }, { "kind": "Content", "text": "(isInitialized: boolean) => void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "setInitialized", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseTelemetryPlugin#setNextPlugin:member", "docComment": "/**\n * Set next extension for telemetry processing\n */\n", "excerptTokens": [ { "kind": "Content", "text": "setNextPlugin: " }, { "kind": "Content", "text": "(next: " }, { "kind": "Reference", "text": "ITelemetryPlugin", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryPlugin:interface" }, { "kind": "Content", "text": " | " }, { "kind": "Reference", "text": "ITelemetryPluginChain", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryPluginChain:interface" }, { "kind": "Content", "text": ") => void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "setNextPlugin", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 6 }, "isStatic": false }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseTelemetryPlugin#teardown:member(1)", "docComment": "/**\n * Tear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further processTelemetry calls are ignored and it just calls the processNext() with the provided context.\n *\n * @param unloadCtx - This is the context that should be used during unloading.\n *\n * @param unloadState - The details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.\n *\n * @returns boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "teardown(unloadCtx?: " }, { "kind": "Reference", "text": "IProcessTelemetryUnloadContext", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryUnloadContext:interface" }, { "kind": "Content", "text": ", unloadState?: " }, { "kind": "Reference", "text": "ITelemetryUnloadState", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryUnloadState:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void | boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "unloadCtx", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": true }, { "parameterName": "unloadState", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": true } ], "name": "teardown" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseTelemetryPlugin#update:member(1)", "docComment": "/**\n * The the plugin should re-evaluate configuration and update any cached configuration settings.\n *\n * @param updateCtx - This is the context that should be used during updating.\n *\n * @param updateState - The details / state of the update process, it holds details like the current and previous configuration.\n *\n * @returns boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "update(updateCtx: " }, { "kind": "Reference", "text": "IProcessTelemetryUpdateContext", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryUpdateContext:interface" }, { "kind": "Content", "text": ", updateState: " }, { "kind": "Reference", "text": "ITelemetryUpdateState", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryUpdateState:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void | boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "updateCtx", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "updateState", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false } ], "name": "update" }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!BaseTelemetryPlugin#version:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "version?: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "version", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false } ], "implementsTokenRanges": [ { "startIndex": 1, "endIndex": 2 } ] }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!canUseCookies:function(1)", "docComment": "/**\n * @deprecated\n *\n * - Use the core.getCookieMgr().isEnabled() Helper method to tell if document.cookie object is available and whether it can be used.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function canUseCookies(logger: " }, { "kind": "Reference", "text": "IDiagnosticLogger", "canonicalReference": "@microsoft/applicationinsights-core-js!IDiagnosticLogger:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "logger", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "canUseCookies" }, { "kind": "Variable", "canonicalReference": "@microsoft/applicationinsights-core-js!CoreUtils:var", "docComment": "/**\n * Provides a collection of utility functions, included for backward compatibility with previous releases.\n *\n * @deprecated\n *\n * Marking this instance as deprecated in favor of direct usage of the helper functions as direct usage provides better tree-shaking and minification by avoiding the inclusion of the unused items in your resulting code.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "CoreUtils: " }, { "kind": "Reference", "text": "ICoreUtils", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils:interface" } ], "releaseTag": "Public", "name": "CoreUtils", "variableTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!createClassFromInterface:function(1)", "docComment": "/**\n * Simpler helper to create a dynamic class that implements the interface and populates the values with the defaults. Only instance properties (hasOwnProperty) values are copied from the defaults to the new instance\n *\n * @param defaults - Simple helper\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function createClassFromInterface(defaults?: " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "new () => T" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "defaults", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": true } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "createClassFromInterface" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!createCookieMgr:function(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare function createCookieMgr(rootConfig?: " }, { "kind": "Reference", "text": "IConfiguration", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration:interface" }, { "kind": "Content", "text": ", logger?: " }, { "kind": "Reference", "text": "IDiagnosticLogger", "canonicalReference": "@microsoft/applicationinsights-core-js!IDiagnosticLogger:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "ICookieMgr", "canonicalReference": "@microsoft/applicationinsights-core-js!ICookieMgr:interface" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "rootConfig", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": true }, { "parameterName": "logger", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": true } ], "name": "createCookieMgr" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!createEnumMap:function(1)", "docComment": "/**\n * Create a 2 index map that maps an enum's key as both the key and value, X[\"key\"] => \"key\" and X[0] => \"keyof 0\".\n *\n * @param values - The values to populate on the new object\n *\n * @returns \n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function createEnumMap(values: " }, { "kind": "Content", "text": "{\n [key in keyof E]: E[keyof E];\n}" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "EnumMap", "canonicalReference": "@microsoft/applicationinsights-core-js!EnumMap:type" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 5, "endIndex": 7 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "values", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false } ], "typeParameters": [ { "typeParameterName": "E", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } }, { "typeParameterName": "I", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 1, "endIndex": 2 } } ], "name": "createEnumMap" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!createEnumStyle:function(1)", "docComment": "/**\n * Create an enum style object which has both the key => value and value => key mappings\n *\n * @param values - The values to populate on the new object\n *\n * @returns \n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function createEnumStyle(values: " }, { "kind": "Content", "text": "{\n [key in keyof E]: E[keyof E];\n}" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "EnumValue", "canonicalReference": "@microsoft/applicationinsights-core-js!EnumValue:type" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 5 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "values", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "typeParameters": [ { "typeParameterName": "E", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "createEnumStyle" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!createProcessTelemetryContext:function(1)", "docComment": "/**\n * Creates a new Telemetry Item context with the current config, core and plugin execution chain\n *\n * @param plugins - The plugin instances that will be executed\n *\n * @param config - The current config\n *\n * @param core - The current core instance\n *\n * @param startAt - Identifies the next plugin to execute, if null there is no \"next\" plugin and if undefined it should assume the start of the chain\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function createProcessTelemetryContext(telemetryChain: " }, { "kind": "Reference", "text": "ITelemetryPluginChain", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryPluginChain:interface" }, { "kind": "Content", "text": " | null" }, { "kind": "Content", "text": ", config: " }, { "kind": "Reference", "text": "IConfiguration", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration:interface" }, { "kind": "Content", "text": ", core: " }, { "kind": "Reference", "text": "IAppInsightsCore", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore:interface" }, { "kind": "Content", "text": ", startAt?: " }, { "kind": "Reference", "text": "IPlugin", "canonicalReference": "@microsoft/applicationinsights-core-js!IPlugin:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "IProcessTelemetryContext", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryContext:interface" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 10, "endIndex": 11 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "telemetryChain", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "isOptional": false }, { "parameterName": "config", "parameterTypeTokenRange": { "startIndex": 4, "endIndex": 5 }, "isOptional": false }, { "parameterName": "core", "parameterTypeTokenRange": { "startIndex": 6, "endIndex": 7 }, "isOptional": false }, { "parameterName": "startAt", "parameterTypeTokenRange": { "startIndex": 8, "endIndex": 9 }, "isOptional": true } ], "name": "createProcessTelemetryContext" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!createUniqueNamespace:function(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare function createUniqueNamespace(name: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ", includeVersion?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "name", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "includeVersion", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": true } ], "name": "createUniqueNamespace" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!createUnloadHandlerContainer:function(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare function createUnloadHandlerContainer(): " }, { "kind": "Content", "text": "{\n add: (handler: " }, { "kind": "Reference", "text": "UnloadHandler", "canonicalReference": "@microsoft/applicationinsights-core-js!UnloadHandler:type" }, { "kind": "Content", "text": ") => void;\n run: (unloadCtx: " }, { "kind": "Reference", "text": "IProcessTelemetryUnloadContext", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryUnloadContext:interface" }, { "kind": "Content", "text": ", unloadState: " }, { "kind": "Reference", "text": "ITelemetryUnloadState", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryUnloadState:interface" }, { "kind": "Content", "text": ") => void;\n}" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 1, "endIndex": 8 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "createUnloadHandlerContainer" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!createValueMap:function(1)", "docComment": "/**\n * Create a 2 index map that maps an enum's key and value to the defined map value, X[\"key\"] => mapValue and X[0] => mapValue. Generic values - E = the const enum type (typeof eRequestHeaders); - V = Identifies the valid values for the keys, this should include both the enum numeric and string key of the type. The resulting \"Value\" of each entry identifies the valid values withing the assignments.\n *\n * @param values - The values to populate on the new object\n *\n * @returns \n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function createValueMap(values: " }, { "kind": "Content", "text": "{\n [key in keyof E]: [E[keyof E], V[keyof V]];\n}" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "V" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "values", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false } ], "typeParameters": [ { "typeParameterName": "E", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } }, { "typeParameterName": "V", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 1, "endIndex": 2 } } ], "name": "createValueMap" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!dateNow:function(1)", "docComment": "/**\n * Return the current time via the Date now() function (if available) and falls back to (new Date()).getTime() if now() is unavailable (IE8 or less) https://caniuse.com/#search=Date.now\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function dateNow(): " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "dateNow" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!deepFreeze:function(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare function deepFreeze(obj: " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "obj", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "deepFreeze" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!deleteCookie:function(1)", "docComment": "/**\n * @deprecated\n *\n * - Use the core.getCookieMgr().del() Deletes a cookie by setting it's expiration time in the past.\n *\n * @param name - The name of the cookie to delete.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function deleteCookie(logger: " }, { "kind": "Reference", "text": "IDiagnosticLogger", "canonicalReference": "@microsoft/applicationinsights-core-js!IDiagnosticLogger:interface" }, { "kind": "Content", "text": ", name: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "logger", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "name", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false } ], "name": "deleteCookie" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!detachEvent:function(1)", "docComment": "/**\n * Removes an event handler for the specified event\n *\n * @param Object - to remove the event from\n *\n * @param eventNameWithoutOn - The name of the event, with optional namespaces or just the namespaces, such as \"click\", \"click.mynamespace\" or \".mynamespace\"\n *\n * @param handlerRef - The callback function that needs to be removed from the given event, when using a namespace (with or without a qualifying event) this may be null to remove all previously attached event handlers otherwise this will only remove events with this specific handler.\n *\n * @param useCapture - [Optional] Defaults to false\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function detachEvent(obj: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ", eventNameWithoutOn: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ", handlerRef: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ", useCapture?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 9, "endIndex": 10 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "obj", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "eventNameWithoutOn", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "handlerRef", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": false }, { "parameterName": "useCapture", "parameterTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "isOptional": true } ], "name": "detachEvent" }, { "kind": "Class", "canonicalReference": "@microsoft/applicationinsights-core-js!DiagnosticLogger:class", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare class DiagnosticLogger implements " }, { "kind": "Reference", "text": "IDiagnosticLogger", "canonicalReference": "@microsoft/applicationinsights-core-js!IDiagnosticLogger:interface" }, { "kind": "Content", "text": " " } ], "releaseTag": "Public", "name": "DiagnosticLogger", "members": [ { "kind": "Constructor", "canonicalReference": "@microsoft/applicationinsights-core-js!DiagnosticLogger:constructor(1)", "docComment": "/**\n * Constructs a new instance of the `DiagnosticLogger` class\n */\n", "excerptTokens": [ { "kind": "Content", "text": "constructor(config?: " }, { "kind": "Reference", "text": "IConfiguration", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration:interface" }, { "kind": "Content", "text": ");" } ], "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "config", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": true } ] }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!DiagnosticLogger#consoleLoggingLevel:member(1)", "docComment": "/**\n * 0: OFF (default) 1: CRITICAL 2: >= WARNING\n */\n", "excerptTokens": [ { "kind": "Content", "text": "consoleLoggingLevel(): " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "consoleLoggingLevel" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!DiagnosticLogger#enableDebugExceptions:member(1)", "docComment": "/**\n * When this is true the SDK will throw exceptions to aid in debugging.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "enableDebugExceptions(): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "enableDebugExceptions" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!DiagnosticLogger#errorToConsole:member(1)", "docComment": "/**\n * This will write an error to the console if possible\n *\n * @param message - The warning message\n */\n", "excerptTokens": [ { "kind": "Content", "text": "errorToConsole(message: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "message", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "errorToConsole" }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!DiagnosticLogger#identifier:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "identifier: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "identifier", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!DiagnosticLogger#logInternalMessage:member(1)", "docComment": "/**\n * Logs a message to the internal queue.\n *\n * @param severity - The severity of the log message\n *\n * @param message - The message to log.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "logInternalMessage(severity: " }, { "kind": "Reference", "text": "LoggingSeverity", "canonicalReference": "@microsoft/applicationinsights-core-js!LoggingSeverity:type" }, { "kind": "Content", "text": ", message: " }, { "kind": "Reference", "text": "_InternalLogMessage", "canonicalReference": "@microsoft/applicationinsights-core-js!_InternalLogMessage:class" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "severity", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "message", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false } ], "name": "logInternalMessage" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!DiagnosticLogger#maxInternalMessageLimit:member(1)", "docComment": "/**\n * The maximum number of internal messages allowed to be sent per page view\n */\n", "excerptTokens": [ { "kind": "Content", "text": "maxInternalMessageLimit(): " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "maxInternalMessageLimit" }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!DiagnosticLogger#queue:member", "docComment": "/**\n * The internal logging queue\n */\n", "excerptTokens": [ { "kind": "Content", "text": "queue: " }, { "kind": "Reference", "text": "_InternalLogMessage", "canonicalReference": "@microsoft/applicationinsights-core-js!_InternalLogMessage:class" }, { "kind": "Content", "text": "[]" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "queue", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "isStatic": false }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!DiagnosticLogger#resetInternalMessageCount:member(1)", "docComment": "/**\n * Resets the internal message count\n */\n", "excerptTokens": [ { "kind": "Content", "text": "resetInternalMessageCount(): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "resetInternalMessageCount" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!DiagnosticLogger#telemetryLoggingLevel:member(1)", "docComment": "/**\n * 0: OFF 1: CRITICAL (default) 2: >= WARNING\n */\n", "excerptTokens": [ { "kind": "Content", "text": "telemetryLoggingLevel(): " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "telemetryLoggingLevel" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!DiagnosticLogger#throwInternal:member(1)", "docComment": "/**\n * This method will throw exceptions in debug mode or attempt to log the error as a console warning.\n *\n * @param severity - The severity of the log message\n *\n * @param message - The log message.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "throwInternal(severity: " }, { "kind": "Reference", "text": "LoggingSeverity", "canonicalReference": "@microsoft/applicationinsights-core-js!LoggingSeverity:type" }, { "kind": "Content", "text": ", msgId: " }, { "kind": "Reference", "text": "_InternalMessageId", "canonicalReference": "@microsoft/applicationinsights-core-js!_InternalMessageId:type" }, { "kind": "Content", "text": ", msg: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ", properties?: " }, { "kind": "Reference", "text": "Object", "canonicalReference": "!Object:interface" }, { "kind": "Content", "text": ", isUserAct?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 11, "endIndex": 12 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "severity", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "msgId", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "msg", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": false }, { "parameterName": "properties", "parameterTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "isOptional": true }, { "parameterName": "isUserAct", "parameterTypeTokenRange": { "startIndex": 9, "endIndex": 10 }, "isOptional": true } ], "name": "throwInternal" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!DiagnosticLogger#warnToConsole:member(1)", "docComment": "/**\n * This will write a warning to the console if possible\n *\n * @param message - The warning message\n */\n", "excerptTokens": [ { "kind": "Content", "text": "warnToConsole(message: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "message", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "warnToConsole" } ], "implementsTokenRanges": [ { "startIndex": 1, "endIndex": 2 } ] }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!disableCookies:function(1)", "docComment": "/**\n * @deprecated\n *\n * - Use the core.getCookieMgr().disable() Force the SDK not to store and read any data from cookies.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function disableCookies(): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "disableCookies" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!doPerf:function(1)", "docComment": "/**\n * Helper function to wrap a function with a perf event\n *\n * @param mgrSource - The Performance Manager or a Performance provider source (may be null)\n *\n * @param getSource - The callback to create the source name for the event (if perf monitoring is enabled)\n *\n * @param func - The function to call and measure\n *\n * @param details - A function to return the payload details\n *\n * @param isAsync - Is the event / function being call asynchronously or synchronously\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function doPerf(mgrSource: " }, { "kind": "Reference", "text": "IPerfManagerProvider", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfManagerProvider:interface" }, { "kind": "Content", "text": " | " }, { "kind": "Reference", "text": "IPerfManager", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfManager:interface" }, { "kind": "Content", "text": ", getSource: " }, { "kind": "Content", "text": "() => string" }, { "kind": "Content", "text": ", func: " }, { "kind": "Content", "text": "(perfEvt?: " }, { "kind": "Reference", "text": "IPerfEvent", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfEvent:interface" }, { "kind": "Content", "text": ") => T" }, { "kind": "Content", "text": ", details?: " }, { "kind": "Content", "text": "() => any" }, { "kind": "Content", "text": ", isAsync?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 15, "endIndex": 16 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "mgrSource", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 4 }, "isOptional": false }, { "parameterName": "getSource", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": false }, { "parameterName": "func", "parameterTypeTokenRange": { "startIndex": 7, "endIndex": 10 }, "isOptional": false }, { "parameterName": "details", "parameterTypeTokenRange": { "startIndex": 11, "endIndex": 12 }, "isOptional": true }, { "parameterName": "isAsync", "parameterTypeTokenRange": { "startIndex": 13, "endIndex": 14 }, "isOptional": true } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "doPerf" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!dumpObj:function(1)", "docComment": "/**\n * Returns string representation of an object suitable for diagnostics logging.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function dumpObj(object: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "object", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "dumpObj" }, { "kind": "Enum", "canonicalReference": "@microsoft/applicationinsights-core-js!eEventsDiscardedReason:enum", "docComment": "/**\n * The eEventsDiscardedReason enumeration contains a set of values that specify the reason for discarding an event.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare const enum eEventsDiscardedReason " } ], "releaseTag": "Public", "name": "eEventsDiscardedReason", "members": [ { "kind": "EnumMember", "canonicalReference": "@microsoft/applicationinsights-core-js!eEventsDiscardedReason.InvalidEvent:member", "docComment": "/**\n * The event is invalid.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "InvalidEvent = " }, { "kind": "Content", "text": "2" } ], "releaseTag": "Public", "name": "InvalidEvent", "initializerTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "EnumMember", "canonicalReference": "@microsoft/applicationinsights-core-js!eEventsDiscardedReason.KillSwitch:member", "docComment": "/**\n * The server is not accepting events from this instrumentation key.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "KillSwitch = " }, { "kind": "Content", "text": "4" } ], "releaseTag": "Public", "name": "KillSwitch", "initializerTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "EnumMember", "canonicalReference": "@microsoft/applicationinsights-core-js!eEventsDiscardedReason.NonRetryableStatus:member", "docComment": "/**\n * Status set to non-retryable.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "NonRetryableStatus = " }, { "kind": "Content", "text": "1" } ], "releaseTag": "Public", "name": "NonRetryableStatus", "initializerTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "EnumMember", "canonicalReference": "@microsoft/applicationinsights-core-js!eEventsDiscardedReason.QueueFull:member", "docComment": "/**\n * The event queue is full.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "QueueFull = " }, { "kind": "Content", "text": "5" } ], "releaseTag": "Public", "name": "QueueFull", "initializerTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "EnumMember", "canonicalReference": "@microsoft/applicationinsights-core-js!eEventsDiscardedReason.SizeLimitExceeded:member", "docComment": "/**\n * The size of the event is too large.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "SizeLimitExceeded = " }, { "kind": "Content", "text": "3" } ], "releaseTag": "Public", "name": "SizeLimitExceeded", "initializerTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "EnumMember", "canonicalReference": "@microsoft/applicationinsights-core-js!eEventsDiscardedReason.Unknown:member", "docComment": "/**\n * Unknown.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "Unknown = " }, { "kind": "Content", "text": "0" } ], "releaseTag": "Public", "name": "Unknown", "initializerTokenRange": { "startIndex": 1, "endIndex": 2 } } ] }, { "kind": "Enum", "canonicalReference": "@microsoft/applicationinsights-core-js!eLoggingSeverity:enum", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare const enum eLoggingSeverity " } ], "releaseTag": "Public", "name": "eLoggingSeverity", "members": [ { "kind": "EnumMember", "canonicalReference": "@microsoft/applicationinsights-core-js!eLoggingSeverity.CRITICAL:member", "docComment": "/**\n * Error will be sent as internal telemetry\n */\n", "excerptTokens": [ { "kind": "Content", "text": "CRITICAL = " }, { "kind": "Content", "text": "1" } ], "releaseTag": "Public", "name": "CRITICAL", "initializerTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "EnumMember", "canonicalReference": "@microsoft/applicationinsights-core-js!eLoggingSeverity.WARNING:member", "docComment": "/**\n * Error will NOT be sent as internal telemetry, and will only be shown in browser console\n */\n", "excerptTokens": [ { "kind": "Content", "text": "WARNING = " }, { "kind": "Content", "text": "2" } ], "releaseTag": "Public", "name": "WARNING", "initializerTokenRange": { "startIndex": 1, "endIndex": 2 } } ] }, { "kind": "TypeAlias", "canonicalReference": "@microsoft/applicationinsights-core-js!EnumMap:type", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare type EnumMap = " }, { "kind": "Content", "text": "{\n readonly [key in keyof E extends string ? keyof E : never]: key extends string ? key : keyof E;\n} & I" }, { "kind": "Content", "text": ";" } ], "releaseTag": "Public", "name": "EnumMap", "typeParameters": [ { "typeParameterName": "E", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "typeParameterName": "I", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 3, "endIndex": 4 } } ], "typeTokenRange": { "startIndex": 5, "endIndex": 6 } }, { "kind": "TypeAlias", "canonicalReference": "@microsoft/applicationinsights-core-js!EnumValue:type", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare type EnumValue = " }, { "kind": "Content", "text": "{\n readonly [key in keyof E]: E[key];\n}" }, { "kind": "Content", "text": ";" } ], "releaseTag": "Public", "name": "EnumValue", "typeParameters": [ { "typeParameterName": "E", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 1, "endIndex": 2 } } ], "typeTokenRange": { "startIndex": 3, "endIndex": 4 } }, { "kind": "Variable", "canonicalReference": "@microsoft/applicationinsights-core-js!EventHelper:var", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "EventHelper: " }, { "kind": "Reference", "text": "IEventHelper", "canonicalReference": "@microsoft/applicationinsights-core-js!IEventHelper:interface" } ], "releaseTag": "Public", "name": "EventHelper", "variableTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!eventOff:function(1)", "docComment": "/**\n * Removes an event handler for the specified event\n *\n * @param Object - to remove the event from\n *\n * @param eventName - The name of the event, with optional namespaces or just the namespaces, such as \"click\", \"click.mynamespace\" or \".mynamespace\"\n *\n * @param handlerRef - The callback function that needs to be removed from the given event, when using a namespace (with or without a qualifying event) this may be null to remove all previously attached event handlers otherwise this will only remove events with this specific handler.\n *\n * @param evtNamespace - [Optional] Additional namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace, if the eventName also includes a namespace the namespace(s) are merged into a single namespace\n *\n * @param useCapture - [Optional] Defaults to false\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function eventOff(target: " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": ", eventName: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ", handlerRef: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ", evtNamespace?: " }, { "kind": "Content", "text": "string | string[] | null" }, { "kind": "Content", "text": ", useCapture?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 11, "endIndex": 12 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "target", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "eventName", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "handlerRef", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": false }, { "parameterName": "evtNamespace", "parameterTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "isOptional": true }, { "parameterName": "useCapture", "parameterTypeTokenRange": { "startIndex": 9, "endIndex": 10 }, "isOptional": true } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "eventOff" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!eventOn:function(1)", "docComment": "/**\n * Binds the specified function to an event, so that the function gets called whenever the event fires on the object\n *\n * @param obj - Object to add the event too.\n *\n * @param eventName - String that specifies any of the standard DHTML Events without \"on\" prefix, if may also include an optional (dot \".\" prefixed) namespaces \"click\" \"click.mynamespace\" in addition to specific namespaces.\n *\n * @param handlerRef - Pointer that specifies the function to call when event fires\n *\n * @param evtNamespace - [Optional] Additional namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace, if the eventName also includes a namespace the namespace(s) are merged into a single namespace\n *\n * @param useCapture - [Optional] Defaults to false\n *\n * @returns True if the function was bound successfully to the event, otherwise false\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function eventOn(target: " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": ", eventName: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ", handlerRef: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ", evtNamespace?: " }, { "kind": "Content", "text": "string | string[] | null" }, { "kind": "Content", "text": ", useCapture?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 11, "endIndex": 12 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "target", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "eventName", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "handlerRef", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": false }, { "parameterName": "evtNamespace", "parameterTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "isOptional": true }, { "parameterName": "useCapture", "parameterTypeTokenRange": { "startIndex": 9, "endIndex": 10 }, "isOptional": true } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "eventOn" }, { "kind": "TypeAlias", "canonicalReference": "@microsoft/applicationinsights-core-js!EventsDiscardedReason:type", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare type EventsDiscardedReason = " }, { "kind": "Content", "text": "number | " }, { "kind": "Reference", "text": "eEventsDiscardedReason", "canonicalReference": "@microsoft/applicationinsights-core-js!eEventsDiscardedReason:enum" }, { "kind": "Content", "text": ";" } ], "releaseTag": "Public", "name": "EventsDiscardedReason", "typeTokenRange": { "startIndex": 1, "endIndex": 3 } }, { "kind": "Variable", "canonicalReference": "@microsoft/applicationinsights-core-js!EventsDiscardedReason:var", "docComment": "/**\n * The EventsDiscardedReason enumeration contains a set of values that specify the reason for discarding an event.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "EventsDiscardedReason: " }, { "kind": "Content", "text": "import(\"../JavaScriptSDK.Enums/EnumHelperFuncs\")." }, { "kind": "Reference", "text": "EnumValue", "canonicalReference": "@microsoft/applicationinsights-core-js!EnumValue:type" }, { "kind": "Content", "text": "" } ], "releaseTag": "Public", "name": "EventsDiscardedReason", "variableTypeTokenRange": { "startIndex": 1, "endIndex": 6 } }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!generateW3CId:function(1)", "docComment": "/**\n * generate W3C trace id\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function generateW3CId(): " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "generateW3CId" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!getConsole:function(1)", "docComment": "/**\n * Returns the global console object\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function getConsole(): " }, { "kind": "Reference", "text": "Console", "canonicalReference": "!Console:interface" }, { "kind": "Content", "text": " | null" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "getConsole" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!getCookie:function(1)", "docComment": "/**\n * @deprecated\n *\n * - Use the core.getCookieMgr().get() helper method to access userId and sessionId cookie\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function getCookie(logger: " }, { "kind": "Reference", "text": "IDiagnosticLogger", "canonicalReference": "@microsoft/applicationinsights-core-js!IDiagnosticLogger:interface" }, { "kind": "Content", "text": ", name: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "logger", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "name", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false } ], "name": "getCookie" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!getCrypto:function(1)", "docComment": "/**\n * Returns the crypto object if it is present otherwise null. This helper is used to access the crypto object from the current global instance which could be window or globalThis for a web worker\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function getCrypto(): " }, { "kind": "Reference", "text": "Crypto", "canonicalReference": "!Crypto:interface" }, { "kind": "Content", "text": " | null" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "getCrypto" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!getDebugExt:function(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare function getDebugExt(config: " }, { "kind": "Reference", "text": "IConfiguration", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "IDbgExtension", "canonicalReference": "@microsoft/applicationinsights-core-js!IDbgExtension:interface" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "config", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "getDebugExt" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!getDebugListener:function(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare function getDebugListener(config: " }, { "kind": "Reference", "text": "IConfiguration", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "INotificationListener", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationListener:interface" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "config", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "getDebugListener" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!getDocument:function(1)", "docComment": "/**\n * Returns the global document object if it is present otherwise null. This helper is used to access the document object without causing an exception \"Uncaught ReferenceError: document is not defined\"\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function getDocument(): " }, { "kind": "Reference", "text": "Document", "canonicalReference": "!Document:interface" }, { "kind": "Content", "text": " | null" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "getDocument" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!getExceptionName:function(1)", "docComment": "/**\n * Returns the name of object if it's an Error. Otherwise, returns empty string.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function getExceptionName(object: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "object", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "getExceptionName" }, { "kind": "Enum", "canonicalReference": "@microsoft/applicationinsights-core-js!GetExtCfgMergeType:enum", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare const enum GetExtCfgMergeType " } ], "releaseTag": "Public", "name": "GetExtCfgMergeType", "members": [ { "kind": "EnumMember", "canonicalReference": "@microsoft/applicationinsights-core-js!GetExtCfgMergeType.MergeDefaultFromRootOrDefault:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "MergeDefaultFromRootOrDefault = " }, { "kind": "Content", "text": "2" } ], "releaseTag": "Public", "name": "MergeDefaultFromRootOrDefault", "initializerTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "EnumMember", "canonicalReference": "@microsoft/applicationinsights-core-js!GetExtCfgMergeType.MergeDefaultOnly:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "MergeDefaultOnly = " }, { "kind": "Content", "text": "1" } ], "releaseTag": "Public", "name": "MergeDefaultOnly", "initializerTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "EnumMember", "canonicalReference": "@microsoft/applicationinsights-core-js!GetExtCfgMergeType.None:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "None = " }, { "kind": "Content", "text": "0" } ], "releaseTag": "Public", "name": "None", "initializerTokenRange": { "startIndex": 1, "endIndex": 2 } } ] }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!getGblPerfMgr:function(1)", "docComment": "/**\n * Get the current global performance manager that will be used with no performance manager is supplied.\n *\n * @returns - The current default manager\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function getGblPerfMgr(): " }, { "kind": "Reference", "text": "IPerfManager", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfManager:interface" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "getGblPerfMgr" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!getGlobalInst:function(1)", "docComment": "/**\n * Return the named global object if available, will return null if the object is not available.\n *\n * @param name - The globally named object\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function getGlobalInst(name: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "name", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "getGlobalInst" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!getHistory:function(1)", "docComment": "/**\n * Returns the global history object if it is present otherwise null. This helper is used to access the history object without causing an exception \"Uncaught ReferenceError: history is not defined\"\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function getHistory(): " }, { "kind": "Reference", "text": "History", "canonicalReference": "!History:interface" }, { "kind": "Content", "text": " | null" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "getHistory" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!getIEVersion:function(1)", "docComment": "/**\n * Gets IE version returning the document emulation mode if we are running on IE, or null otherwise\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function getIEVersion(userAgentStr?: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "userAgentStr", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": true } ], "name": "getIEVersion" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!getJSON:function(1)", "docComment": "/**\n * Returns the global JSON object if it is present otherwise null. This helper is used to access the JSON object without causing an exception \"Uncaught ReferenceError: JSON is not defined\"\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function getJSON(): " }, { "kind": "Reference", "text": "JSON", "canonicalReference": "!JSON:interface" }, { "kind": "Content", "text": " | null" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "getJSON" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!getLocation:function(1)", "docComment": "/**\n * Returns the global location object if it is present otherwise null. This helper is used to access the location object without causing an exception \"Uncaught ReferenceError: location is not defined\"\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function getLocation(checkForMock?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "Location", "canonicalReference": "!Location:interface" }, { "kind": "Content", "text": " | null" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 5 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "checkForMock", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": true } ], "name": "getLocation" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!getMsCrypto:function(1)", "docComment": "/**\n * Returns the crypto object if it is present otherwise null. This helper is used to access the crypto object from the current global instance which could be window or globalThis for a web worker\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function getMsCrypto(): " }, { "kind": "Reference", "text": "Crypto", "canonicalReference": "!Crypto:interface" }, { "kind": "Content", "text": " | null" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "getMsCrypto" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!getNavigator:function(1)", "docComment": "/**\n * Returns the global navigator object if it is present otherwise null. This helper is used to access the navigator object without causing an exception \"Uncaught ReferenceError: navigator is not defined\"\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function getNavigator(): " }, { "kind": "Reference", "text": "Navigator", "canonicalReference": "!Navigator:interface" }, { "kind": "Content", "text": " | null" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "getNavigator" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!getPerformance:function(1)", "docComment": "/**\n * Returns the performance object if it is present otherwise null. This helper is used to access the performance object from the current global instance which could be window or globalThis for a web worker\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function getPerformance(): " }, { "kind": "Reference", "text": "Performance", "canonicalReference": "!Performance:interface" }, { "kind": "Content", "text": " | null" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "getPerformance" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!getSetValue:function(1)", "docComment": "/**\n * Returns the current value from the target object if not null or undefined otherwise sets the new value and returns it\n *\n * @param target - The target object to return or set the default value\n *\n * @param field - The key for the field to set on the target\n *\n * @param defValue - [Optional] The value to set if not already present, when not provided a empty object will be added\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function getSetValue(target: " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": ", field: " }, { "kind": "Content", "text": "K" }, { "kind": "Content", "text": ", defValue?: " }, { "kind": "Content", "text": "T[K]" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "T[K]" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 9, "endIndex": 10 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "target", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "field", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": false }, { "parameterName": "defValue", "parameterTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "isOptional": true } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } }, { "typeParameterName": "K", "constraintTokenRange": { "startIndex": 1, "endIndex": 2 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "getSetValue" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!getWindow:function(1)", "docComment": "/**\n * Returns the global window object if it is present otherwise null. This helper is used to access the window object without causing an exception \"Uncaught ReferenceError: window is not defined\"\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function getWindow(): " }, { "kind": "Reference", "text": "Window", "canonicalReference": "!Window:interface" }, { "kind": "Content", "text": " | null" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "getWindow" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!hasDocument:function(1)", "docComment": "/**\n * Checks if document object is available, this is required as we support the API running without a window /document (eg. Node server, electron webworkers) and if we attempt to assign a document object to a local variable or pass as an argument an \"Uncaught ReferenceError: document is not defined\" exception will be thrown. Defined as a function to support lazy / late binding environments.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function hasDocument(): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "hasDocument" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!hasHistory:function(1)", "docComment": "/**\n * Checks if history object is available, this is required as we support the API running without a window /document (eg. Node server, electron webworkers) and if we attempt to assign a history object to a local variable or pass as an argument an \"Uncaught ReferenceError: history is not defined\" exception will be thrown. Defined as a function to support lazy / late binding environments.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function hasHistory(): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "hasHistory" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!hasJSON:function(1)", "docComment": "/**\n * Checks if JSON object is available, this is required as we support the API running without a window /document (eg. Node server, electron webworkers) and if we attempt to assign a history object to a local variable or pass as an argument an \"Uncaught ReferenceError: JSON is not defined\" exception will be thrown. Defined as a function to support lazy / late binding environments.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function hasJSON(): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "hasJSON" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!hasNavigator:function(1)", "docComment": "/**\n * Checks if navigator object is available, this is required as we support the API running without a window /document (eg. Node server, electron webworkers) and if we attempt to assign a navigator object to a local variable or pass as an argument an \"Uncaught ReferenceError: navigator is not defined\" exception will be thrown. Defined as a function to support lazy / late binding environments.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function hasNavigator(): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "hasNavigator" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!hasOwnProperty:function(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare function hasOwnProperty(obj: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ", prop: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "obj", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "prop", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false } ], "name": "hasOwnProperty" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!hasWindow:function(1)", "docComment": "/**\n * Checks if window object is available, this is required as we support the API running without a window /document (eg. Node server, electron webworkers) and if we attempt to assign a window object to a local variable or pass as an argument an \"Uncaught ReferenceError: window is not defined\" exception will be thrown. Defined as a function to support lazy / late binding environments.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function hasWindow(): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "hasWindow" }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore:interface", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export interface IAppInsightsCore extends " }, { "kind": "Reference", "text": "IPerfManagerProvider", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfManagerProvider:interface" }, { "kind": "Content", "text": " " } ], "releaseTag": "Public", "name": "IAppInsightsCore", "members": [ { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore#addNotificationListener:member(1)", "docComment": "/**\n * Adds a notification listener. The SDK calls methods on the listener when an appropriate notification is raised. The added plugins must raise notifications. If the plugins do not implement the notifications, then no methods will be called.\n *\n * @param listener - An INotificationListener object.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "addNotificationListener?(listener: " }, { "kind": "Reference", "text": "INotificationListener", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationListener:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "listener", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "addNotificationListener" }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore#addPlugin:member(1)", "docComment": "/**\n * Add a new plugin to the installation\n *\n * @param plugin - The new plugin to add\n *\n * @param replaceExisting - should any existing plugin be replaced, default is false\n *\n * @param doAsync - Should the add be performed asynchronously\n *\n * @param addCb - [Optional] callback to call after the plugin has been added\n */\n", "excerptTokens": [ { "kind": "Content", "text": "addPlugin(plugin: " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": ", replaceExisting?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ", doAsync?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ", addCb?: " }, { "kind": "Content", "text": "(added?: boolean) => void" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 14, "endIndex": 15 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "plugin", "parameterTypeTokenRange": { "startIndex": 6, "endIndex": 7 }, "isOptional": false }, { "parameterName": "replaceExisting", "parameterTypeTokenRange": { "startIndex": 8, "endIndex": 9 }, "isOptional": true }, { "parameterName": "doAsync", "parameterTypeTokenRange": { "startIndex": 10, "endIndex": 11 }, "isOptional": true }, { "parameterName": "addCb", "parameterTypeTokenRange": { "startIndex": 12, "endIndex": 13 }, "isOptional": true } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 1, "endIndex": 2 }, "defaultTypeTokenRange": { "startIndex": 4, "endIndex": 5 } } ], "name": "addPlugin" }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore#addTelemetryInitializer:member(1)", "docComment": "/**\n * Add a telemetry processor to decorate or drop telemetry events.\n *\n * @param telemetryInitializer - The Telemetry Initializer function\n *\n * @returns - A ITelemetryInitializerHandler to enable the initializer to be removed\n */\n", "excerptTokens": [ { "kind": "Content", "text": "addTelemetryInitializer(telemetryInitializer: " }, { "kind": "Reference", "text": "TelemetryInitializerFunction", "canonicalReference": "@microsoft/applicationinsights-core-js!TelemetryInitializerFunction:type" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "ITelemetryInitializerHandler", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryInitializerHandler:interface" }, { "kind": "Content", "text": " | void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 5 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "telemetryInitializer", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "addTelemetryInitializer" }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore#addUnloadCb:member(1)", "docComment": "/**\n * Add a handler that will be called when the SDK is being unloaded\n *\n * @param handler - the handler\n */\n", "excerptTokens": [ { "kind": "Content", "text": "addUnloadCb(handler: " }, { "kind": "Reference", "text": "UnloadHandler", "canonicalReference": "@microsoft/applicationinsights-core-js!UnloadHandler:type" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "handler", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "addUnloadCb" }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore#config:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "config: " }, { "kind": "Reference", "text": "IConfiguration", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "config", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore#evtNamespace:member(1)", "docComment": "/**\n * Returns the unique event namespace that should be used when registering events\n */\n", "excerptTokens": [ { "kind": "Content", "text": "evtNamespace(): " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "evtNamespace" }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore#flush:member(1)", "docComment": "/**\n * Flush and send any batched / cached data immediately\n *\n * @param async - send data asynchronously when true (defaults to true)\n *\n * @param callBack - if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called. If the caller doesn't return true the caller should assume that it may never be called.\n *\n * @param sendReason - specify the reason that you are calling \"flush\" defaults to ManualFlush (1) if not specified\n *\n * @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the unload. Defaults to 5 seconds.\n *\n * @returns - true if the callback will be return after the flush is complete otherwise the caller should assume that any provided callback will never be called\n */\n", "excerptTokens": [ { "kind": "Content", "text": "flush(isAsync?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ", callBack?: " }, { "kind": "Content", "text": "(flushComplete?: boolean) => void" }, { "kind": "Content", "text": ", sendReason?: " }, { "kind": "Reference", "text": "SendRequestReason", "canonicalReference": "@microsoft/applicationinsights-core-js!SendRequestReason:enum" }, { "kind": "Content", "text": ", cbTimeout?: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "boolean | void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 9, "endIndex": 10 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "isAsync", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": true }, { "parameterName": "callBack", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": true }, { "parameterName": "sendReason", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": true }, { "parameterName": "cbTimeout", "parameterTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "isOptional": true } ], "name": "flush" }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore#getCookieMgr:member(1)", "docComment": "/**\n * Get the current cookie manager for this instance\n */\n", "excerptTokens": [ { "kind": "Content", "text": "getCookieMgr(): " }, { "kind": "Reference", "text": "ICookieMgr", "canonicalReference": "@microsoft/applicationinsights-core-js!ICookieMgr:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "getCookieMgr" }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore#getNotifyMgr:member(1)", "docComment": "/**\n * Get the current notification manager\n */\n", "excerptTokens": [ { "kind": "Content", "text": "getNotifyMgr(): " }, { "kind": "Reference", "text": "INotificationManager", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationManager:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "getNotifyMgr" }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore#getPlugin:member(1)", "docComment": "/**\n * Find and return the (first) plugin with the specified identifier if present\n *\n * @param pluginIdentifier - \n */\n", "excerptTokens": [ { "kind": "Content", "text": "getPlugin(pluginIdentifier: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "ILoadedPlugin", "canonicalReference": "@microsoft/applicationinsights-core-js!ILoadedPlugin:interface" }, { "kind": "Content", "text": "" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 8, "endIndex": 10 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "pluginIdentifier", "parameterTypeTokenRange": { "startIndex": 6, "endIndex": 7 }, "isOptional": false } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 1, "endIndex": 2 }, "defaultTypeTokenRange": { "startIndex": 4, "endIndex": 5 } } ], "name": "getPlugin" }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore#getProcessTelContext:member(1)", "docComment": "/**\n * Return a new instance of the IProcessTelemetryContext for processing events\n */\n", "excerptTokens": [ { "kind": "Content", "text": "getProcessTelContext(): " }, { "kind": "Reference", "text": "IProcessTelemetryContext", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryContext:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "getProcessTelContext" }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore#getTransmissionControls:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "getTransmissionControls(): " }, { "kind": "Reference", "text": "IChannelControls", "canonicalReference": "@microsoft/applicationinsights-core-js!IChannelControls:interface" }, { "kind": "Content", "text": "[][]" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "getTransmissionControls" }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore#initialize:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "initialize(config: " }, { "kind": "Reference", "text": "IConfiguration", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration:interface" }, { "kind": "Content", "text": ", extensions: " }, { "kind": "Reference", "text": "IPlugin", "canonicalReference": "@microsoft/applicationinsights-core-js!IPlugin:interface" }, { "kind": "Content", "text": "[]" }, { "kind": "Content", "text": ", logger?: " }, { "kind": "Reference", "text": "IDiagnosticLogger", "canonicalReference": "@microsoft/applicationinsights-core-js!IDiagnosticLogger:interface" }, { "kind": "Content", "text": ", notificationManager?: " }, { "kind": "Reference", "text": "INotificationManager", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationManager:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 10, "endIndex": 11 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "config", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "extensions", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 5 }, "isOptional": false }, { "parameterName": "logger", "parameterTypeTokenRange": { "startIndex": 6, "endIndex": 7 }, "isOptional": true }, { "parameterName": "notificationManager", "parameterTypeTokenRange": { "startIndex": 8, "endIndex": 9 }, "isOptional": true } ], "name": "initialize" }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore#isInitialized:member", "docComment": "/**\n * Returns a value that indicates whether the instance has already been previously initialized.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "isInitialized?: " }, { "kind": "Content", "text": "() => boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "isInitialized", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore#logger:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "logger: " }, { "kind": "Reference", "text": "IDiagnosticLogger", "canonicalReference": "@microsoft/applicationinsights-core-js!IDiagnosticLogger:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "logger", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore#pollInternalLogs:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "pollInternalLogs?(eventName?: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "eventName", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": true } ], "name": "pollInternalLogs" }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore#removeNotificationListener:member(1)", "docComment": "/**\n * Removes all instances of the listener.\n *\n * @param listener - INotificationListener to remove.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "removeNotificationListener?(listener: " }, { "kind": "Reference", "text": "INotificationListener", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationListener:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "listener", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "removeNotificationListener" }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore#setCookieMgr:member(1)", "docComment": "/**\n * Set the current cookie manager for this instance\n *\n * @param cookieMgr - The manager, if set to null/undefined will cause the default to be created\n */\n", "excerptTokens": [ { "kind": "Content", "text": "setCookieMgr(cookieMgr: " }, { "kind": "Reference", "text": "ICookieMgr", "canonicalReference": "@microsoft/applicationinsights-core-js!ICookieMgr:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "cookieMgr", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "setCookieMgr" }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore#stopPollingInternalLogs:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "stopPollingInternalLogs?(): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "stopPollingInternalLogs" }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore#track:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "track(telemetryItem: " }, { "kind": "Reference", "text": "ITelemetryItem", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryItem:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "telemetryItem", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "track" }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore#unload:member(1)", "docComment": "/**\n * Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous unload call return `true` stating that all plugins reported that they also unloaded, the recommended approach is to create a new instance and initialize that instance. This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable to successfully remove any global references or they may just be completing the unload process asynchronously.\n *\n * @param isAsync - Can the unload be performed asynchronously (default)\n *\n * @param unloadComplete - An optional callback that will be called once the unload has completed\n *\n * @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the unload. Defaults to 5 seconds.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "unload(isAsync?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ", unloadComplete?: " }, { "kind": "Content", "text": "(unloadState: " }, { "kind": "Reference", "text": "ITelemetryUnloadState", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryUnloadState:interface" }, { "kind": "Content", "text": ") => void" }, { "kind": "Content", "text": ", cbTimeout?: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 9, "endIndex": 10 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "isAsync", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": true }, { "parameterName": "unloadComplete", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 6 }, "isOptional": true }, { "parameterName": "cbTimeout", "parameterTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "isOptional": true } ], "name": "unload" } ], "extendsTokenRanges": [ { "startIndex": 1, "endIndex": 2 } ] }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!IBaseProcessingContext:interface", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export interface IBaseProcessingContext " } ], "releaseTag": "Public", "name": "IBaseProcessingContext", "members": [ { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IBaseProcessingContext#core:member", "docComment": "/**\n * The current core instance for the request\n */\n", "excerptTokens": [ { "kind": "Content", "text": "core: " }, { "kind": "Content", "text": "() => " }, { "kind": "Reference", "text": "IAppInsightsCore", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "core", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 3 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IBaseProcessingContext#createNew:member", "docComment": "/**\n * Create a new context using the core and config from the current instance, returns a new instance of the same type\n *\n * @param plugins - The execution order to process the plugins, if null or not supplied then the current execution order will be copied.\n *\n * @param startAt - The plugin to start processing from, if missing from the execution order then the next plugin will be NOT set.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "createNew: " }, { "kind": "Content", "text": "(plugins?: " }, { "kind": "Reference", "text": "IPlugin", "canonicalReference": "@microsoft/applicationinsights-core-js!IPlugin:interface" }, { "kind": "Content", "text": "[] | " }, { "kind": "Reference", "text": "ITelemetryPluginChain", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryPluginChain:interface" }, { "kind": "Content", "text": ", startAt?: " }, { "kind": "Reference", "text": "IPlugin", "canonicalReference": "@microsoft/applicationinsights-core-js!IPlugin:interface" }, { "kind": "Content", "text": ") => " }, { "kind": "Reference", "text": "IBaseProcessingContext", "canonicalReference": "@microsoft/applicationinsights-core-js!IBaseProcessingContext:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "createNew", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 9 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IBaseProcessingContext#diagLog:member", "docComment": "/**\n * THe current diagnostic logger for the request\n */\n", "excerptTokens": [ { "kind": "Content", "text": "diagLog: " }, { "kind": "Content", "text": "() => " }, { "kind": "Reference", "text": "IDiagnosticLogger", "canonicalReference": "@microsoft/applicationinsights-core-js!IDiagnosticLogger:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "diagLog", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 3 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IBaseProcessingContext#getCfg:member", "docComment": "/**\n * Gets the current core config instance\n */\n", "excerptTokens": [ { "kind": "Content", "text": "getCfg: " }, { "kind": "Content", "text": "() => " }, { "kind": "Reference", "text": "IConfiguration", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "getCfg", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 3 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IBaseProcessingContext#getConfig:member", "docComment": "/**\n * Gets the named config from either the named identifier extension or core config if neither exist then the default value is returned\n *\n * @param identifier - The named extension identifier\n *\n * @param field - The config field name\n *\n * @param defaultValue - The default value to return if no defined config exists\n */\n", "excerptTokens": [ { "kind": "Content", "text": "getConfig: " }, { "kind": "Content", "text": "(identifier: string, field: string, defaultValue?: number | string | boolean | string[] | " }, { "kind": "Reference", "text": "RegExp", "canonicalReference": "!RegExp:interface" }, { "kind": "Content", "text": "[] | " }, { "kind": "Reference", "text": "Function", "canonicalReference": "!Function:interface" }, { "kind": "Content", "text": ") => number | string | boolean | string[] | " }, { "kind": "Reference", "text": "RegExp", "canonicalReference": "!RegExp:interface" }, { "kind": "Content", "text": "[] | " }, { "kind": "Reference", "text": "Function", "canonicalReference": "!Function:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "getConfig", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 9 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IBaseProcessingContext#getExtCfg:member", "docComment": "/**\n * Gets the named extension config\n */\n", "excerptTokens": [ { "kind": "Content", "text": "getExtCfg: " }, { "kind": "Content", "text": "(identifier: string, defaultValue?: T | any, mergeDefault?: " }, { "kind": "Reference", "text": "GetExtCfgMergeType", "canonicalReference": "@microsoft/applicationinsights-core-js!GetExtCfgMergeType:enum" }, { "kind": "Content", "text": ") => T" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "getExtCfg", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 4 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IBaseProcessingContext#getNext:member", "docComment": "/**\n * Returns the next configured plugin proxy\n */\n", "excerptTokens": [ { "kind": "Content", "text": "getNext: " }, { "kind": "Content", "text": "() => " }, { "kind": "Reference", "text": "ITelemetryPluginChain", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryPluginChain:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "getNext", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 3 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IBaseProcessingContext#hasNext:member", "docComment": "/**\n * Helper to allow plugins to check and possibly shortcut executing code only required if there is a nextPlugin\n */\n", "excerptTokens": [ { "kind": "Content", "text": "hasNext: " }, { "kind": "Content", "text": "() => boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "hasNext", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IBaseProcessingContext#iterate:member", "docComment": "/**\n * Synchronously iterate over the context chain running the callback for each plugin, once every plugin has been executed via the callback, any associated onComplete will be called.\n *\n * @param callback - The function call for each plugin in the context chain\n */\n", "excerptTokens": [ { "kind": "Content", "text": "iterate: " }, { "kind": "Content", "text": "(callback: (plugin: T) => void) => void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "iterate", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 6 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IBaseProcessingContext#onComplete:member", "docComment": "/**\n * Set the function to call when the current chain has executed all processNext or unloadNext items.\n *\n * @param onComplete - The onComplete to call\n *\n * @param that - The \"this\" value to use for the onComplete call, if not provided or undefined defaults to the current context\n *\n * @param args - Any additional arguments to pass to the onComplete function\n */\n", "excerptTokens": [ { "kind": "Content", "text": "onComplete: " }, { "kind": "Content", "text": "(onComplete: () => void, that?: any, ...args: any[]) => void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "onComplete", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IBaseProcessingContext#setNext:member", "docComment": "/**\n * Helper to set the next plugin proxy\n */\n", "excerptTokens": [ { "kind": "Content", "text": "setNext: " }, { "kind": "Content", "text": "(nextCtx: " }, { "kind": "Reference", "text": "ITelemetryPluginChain", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryPluginChain:interface" }, { "kind": "Content", "text": ") => void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "setNext", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 4 } } ], "extendsTokenRanges": [] }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!IChannelControls:interface", "docComment": "/**\n * Provides data transmission capabilities\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export interface IChannelControls extends " }, { "kind": "Reference", "text": "ITelemetryPlugin", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryPlugin:interface" }, { "kind": "Content", "text": " " } ], "releaseTag": "Public", "name": "IChannelControls", "members": [ { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IChannelControls#flush:member(1)", "docComment": "/**\n * Flush to send data immediately; channel should default to sending data asynchronously\n *\n * @param async - send data asynchronously when true\n *\n * @param callBack - if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called. If the caller doesn't return true the caller should assume that it may never be called.\n *\n * @param sendReason - specify the reason that you are calling \"flush\" defaults to ManualFlush (1) if not specified\n *\n * @returns - true if the callback will be return after the flush is complete otherwise the caller should assume that any provided callback will never be called\n */\n", "excerptTokens": [ { "kind": "Content", "text": "flush(async: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ", callBack?: " }, { "kind": "Content", "text": "(flushComplete?: boolean) => void" }, { "kind": "Content", "text": ", sendReason?: " }, { "kind": "Reference", "text": "SendRequestReason", "canonicalReference": "@microsoft/applicationinsights-core-js!SendRequestReason:enum" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "boolean | void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "async", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "callBack", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": true }, { "parameterName": "sendReason", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": true } ], "name": "flush" }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IChannelControls#pause:member(1)", "docComment": "/**\n * Pause sending data\n */\n", "excerptTokens": [ { "kind": "Content", "text": "pause(): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "pause" }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IChannelControls#resume:member(1)", "docComment": "/**\n * Resume sending data\n */\n", "excerptTokens": [ { "kind": "Content", "text": "resume(): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "resume" }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IChannelControls#teardown:member", "docComment": "/**\n * Tear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further processTelemetry calls are ignored and it just calls the processNext() with the provided context.\n *\n * @param unloadCtx - This is the context that should be used during unloading.\n *\n * @param unloadState - The details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.\n *\n * @returns boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "teardown: " }, { "kind": "Content", "text": "(unloadCtx?: " }, { "kind": "Reference", "text": "IProcessTelemetryUnloadContext", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryUnloadContext:interface" }, { "kind": "Content", "text": ", unloadState?: " }, { "kind": "Reference", "text": "ITelemetryUnloadState", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryUnloadState:interface" }, { "kind": "Content", "text": ") => void | boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "teardown", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 6 } } ], "extendsTokenRanges": [ { "startIndex": 1, "endIndex": 2 } ] }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration:interface", "docComment": "/**\n * Configuration provided to SDK core\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export interface IConfiguration " } ], "releaseTag": "Public", "name": "IConfiguration", "members": [ { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration#channels:member", "docComment": "/**\n * Channel queues that is setup by caller in desired order. If channels are provided here, core will ignore any channels that are already setup, example if there is a SKU with an initialized channel\n */\n", "excerptTokens": [ { "kind": "Content", "text": "channels?: " }, { "kind": "Reference", "text": "IChannelControls", "canonicalReference": "@microsoft/applicationinsights-core-js!IChannelControls:interface" }, { "kind": "Content", "text": "[][]" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "channels", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 3 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration#connectionString:member", "docComment": "/**\n * Connection string of resource. Either this or instrumentationKey must be specified.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "connectionString?: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "connectionString", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration#cookieCfg:member", "docComment": "/**\n * [Optional] A Cookie Manager configuration which includes hooks to allow interception of the get, set and delete cookie operations. If this configuration is specified any specified enabled and domain properties will take precedence over the cookieDomain and disableCookiesUsage values.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "cookieCfg?: " }, { "kind": "Reference", "text": "ICookieMgrConfig", "canonicalReference": "@microsoft/applicationinsights-core-js!ICookieMgrConfig:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "cookieCfg", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration#cookieDomain:member", "docComment": "/**\n * @description Custom cookie domain. This is helpful if you want to share Application Insights cookies across subdomains. It can be set here or as part of the cookieCfg.domain, the cookieCfg takes precedence if both are specified. @type {string}\n *\n * @defaultValue\n *\n * \"\"\n */\n", "excerptTokens": [ { "kind": "Content", "text": "cookieDomain?: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "cookieDomain", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration#cookiePath:member", "docComment": "/**\n * @description Custom cookie path. This is helpful if you want to share Application Insights cookies behind an application gateway. It can be set here or as part of the cookieCfg.domain, the cookieCfg takes precedence if both are specified. @type {string}\n *\n * @defaultValue\n *\n * \"\"\n */\n", "excerptTokens": [ { "kind": "Content", "text": "cookiePath?: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "cookiePath", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration#createPerfMgr:member", "docComment": "/**\n * [Optional] Callback function that will be called to create a the IPerfManager instance when required and ```enablePerfMgr``` is enabled, this enables you to override the default creation of a PerfManager() without needing to ```setPerfMgr()``` after initialization.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "createPerfMgr?: " }, { "kind": "Content", "text": "(core: " }, { "kind": "Reference", "text": "IAppInsightsCore", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore:interface" }, { "kind": "Content", "text": ", notificationManager: " }, { "kind": "Reference", "text": "INotificationManager", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationManager:interface" }, { "kind": "Content", "text": ") => " }, { "kind": "Reference", "text": "IPerfManager", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfManager:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "createPerfMgr", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 7 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration#diagnosticLogInterval:member", "docComment": "/**\n * Polling interval (in ms) for internal logging queue\n */\n", "excerptTokens": [ { "kind": "Content", "text": "diagnosticLogInterval?: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "diagnosticLogInterval", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration#disableCookiesUsage:member", "docComment": "/**\n * [Optional] A boolean that indicated whether to disable the use of cookies by the SDK. If true, the SDK will not store or read any data from cookies. Cookie usage can be re-enabled after initialization via the core.getCookieMgr().enable().\n */\n", "excerptTokens": [ { "kind": "Content", "text": "disableCookiesUsage?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "disableCookiesUsage", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration#disableDbgExt:member", "docComment": "/**\n * [Optional] A flag for performance optimization to disable attempting to use the Chrome Debug Extension, if disabled and the extension is installed this will not send any notifications.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "disableDbgExt?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "disableDbgExt", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration#disableInstrumentationKeyValidation:member", "docComment": "/**\n * @type {boolean} Flag that disables the Instrumentation Key validation.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "disableInstrumentationKeyValidation?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "disableInstrumentationKeyValidation", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration#disablePageShowEvents:member", "docComment": "/**\n * [Optional] An array of page show events that you would like to be ignored, special note there must be at lease one valid show event hooked, if you list all or the runtime environment only supports a listed (disabled) event it will STILL be hooked, if required by the SDK. Page Show events include \"pageshow\" and \"visibilitychange\" (with 'visible' state)\n */\n", "excerptTokens": [ { "kind": "Content", "text": "disablePageShowEvents?: " }, { "kind": "Content", "text": "string[]" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "disablePageShowEvents", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration#disablePageUnloadEvents:member", "docComment": "/**\n * [Optional] An array of the page unload events that you would like to be ignored, special note there must be at least one valid unload event hooked, if you list all or the runtime environment only supports a listed \"disabled\" event it will still be hooked, if required by the SDK. Unload events include \"beforeunload\", \"unload\", \"visibilitychange\" (with 'hidden' state) and \"pagehide\"\n */\n", "excerptTokens": [ { "kind": "Content", "text": "disablePageUnloadEvents?: " }, { "kind": "Content", "text": "string[]" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "disablePageUnloadEvents", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration#enableDebugExceptions:member", "docComment": "/**\n * If enabled, uncaught exceptions will be thrown to help with debugging\n */\n", "excerptTokens": [ { "kind": "Content", "text": "enableDebugExceptions?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "enableDebugExceptions", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration#enablePerfMgr:member", "docComment": "/**\n * [Optional] When enabled this will create local perfEvents based on sections of the code that have been instrumented to emit perfEvents (via the doPerf()) when this is enabled. This can be used to identify performance issues within the SDK, the way you are using it or optionally your own instrumented code. The provided IPerfManager implementation does NOT send any additional telemetry events to the server it will only fire the new perfEvent() on the INotificationManager which you can listen to. This also does not use the window.performance API, so it will work in environments where this API is not supported.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "enablePerfMgr?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "enablePerfMgr", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration#endpointUrl:member", "docComment": "/**\n * Endpoint where telemetry data is sent\n */\n", "excerptTokens": [ { "kind": "Content", "text": "endpointUrl?: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "endpointUrl", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration#extensionConfig:member", "docComment": "/**\n * Extension configs loaded in SDK\n */\n", "excerptTokens": [ { "kind": "Content", "text": "extensionConfig?: " }, { "kind": "Content", "text": "{\n [key: string]: any;\n }" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "extensionConfig", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration#extensions:member", "docComment": "/**\n * Additional plugins that should be loaded by core at runtime\n */\n", "excerptTokens": [ { "kind": "Content", "text": "extensions?: " }, { "kind": "Reference", "text": "ITelemetryPlugin", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryPlugin:interface" }, { "kind": "Content", "text": "[]" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "extensions", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 3 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration#idLength:member", "docComment": "/**\n * [Optional] Identifies the default length used to generate random session and user id's if non currently exists for the user / session. Defaults to 22, previous default value was 5, if you need to keep the previous maximum length you should set this value to 5.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "idLength?: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "idLength", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration#instrumentationKey:member", "docComment": "/**\n * Instrumentation key of resource. Either this or connectionString must be specified.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "instrumentationKey?: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "instrumentationKey", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration#loggingLevelConsole:member", "docComment": "/**\n * Console logging level. All logs with a severity level higher than the configured level will be printed to console. Otherwise they are suppressed. ie Level 2 will print both CRITICAL and WARNING logs to console, level 1 prints only CRITICAL.\n *\n * Note: Logs sent as telemetry to instrumentation key will also be logged to console if their severity meets the configured loggingConsoleLevel\n *\n * 0: ALL console logging off 1: logs to console: severity >= CRITICAL 2: logs to console: severity >= WARNING\n */\n", "excerptTokens": [ { "kind": "Content", "text": "loggingLevelConsole?: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "loggingLevelConsole", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration#loggingLevelTelemetry:member", "docComment": "/**\n * Telemtry logging level to instrumentation key. All logs with a severity level higher than the configured level will sent as telemetry data to the configured instrumentation key.\n *\n * 0: ALL iKey logging off 1: logs to iKey: severity >= CRITICAL 2: logs to iKey: severity >= WARNING\n */\n", "excerptTokens": [ { "kind": "Content", "text": "loggingLevelTelemetry?: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "loggingLevelTelemetry", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration#maxMessageLimit:member", "docComment": "/**\n * Maximum number of iKey transmitted logging telemetry per page view\n */\n", "excerptTokens": [ { "kind": "Content", "text": "maxMessageLimit?: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "maxMessageLimit", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration#perfEvtsSendAll:member", "docComment": "/**\n * [Optional] Fire every single performance event not just the top level root performance event. Defaults to false.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "perfEvtsSendAll?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "perfEvtsSendAll", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } } ], "extendsTokenRanges": [] }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!ICookieMgr:interface", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export interface ICookieMgr " } ], "releaseTag": "Public", "name": "ICookieMgr", "members": [ { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICookieMgr#del:member(1)", "docComment": "/**\n * Delete/Remove the named cookie if cookie support is available and enabled. Note: Not using \"delete\" as the name because it's a reserved word which would cause issues on older browsers\n *\n * @param name - The name of the cookie\n *\n * @param path - [optional] Path to set for the cookie, if not supplied will default to \"/\"\n *\n * @returns - True if the cookie was marked for deletion otherwise false (Because cookie usage is not enabled or available)\n */\n", "excerptTokens": [ { "kind": "Content", "text": "del(name: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ", path?: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "name", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "path", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": true } ], "name": "del" }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICookieMgr#get:member(1)", "docComment": "/**\n * Get the value of the named cookie\n *\n * @param name - The name of the cookie\n */\n", "excerptTokens": [ { "kind": "Content", "text": "get(name: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "name", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "get" }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICookieMgr#isEnabled:member(1)", "docComment": "/**\n * Can the system use cookies, if this returns false then all cookie setting and access functions will return nothing\n */\n", "excerptTokens": [ { "kind": "Content", "text": "isEnabled(): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "isEnabled" }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICookieMgr#purge:member(1)", "docComment": "/**\n * Purge the cookie from the system if cookie support is available, this function ignores the enabled setting of the manager so any cookie will be removed. Note: Not using \"delete\" as the name because it's a reserved word which would cause issues on older browsers\n *\n * @param name - The name of the cookie\n *\n * @param path - [optional] Path to set for the cookie, if not supplied will default to \"/\"\n *\n * @returns - True if the cookie was marked for deletion otherwise false (Because cookie usage is not available)\n */\n", "excerptTokens": [ { "kind": "Content", "text": "purge(name: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ", path?: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "name", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "path", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": true } ], "name": "purge" }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICookieMgr#set:member(1)", "docComment": "/**\n * Set the named cookie with the value and optional domain and optional\n *\n * @param name - The name of the cookie\n *\n * @param value - The value of the cookie (Must already be encoded)\n *\n * @param maxAgeSec - [optional] The maximum number of SECONDS that this cookie should survive\n *\n * @param domain - [optional] The domain to set for the cookie\n *\n * @param path - [optional] Path to set for the cookie, if not supplied will default to \"/\"\n *\n * @returns - True if the cookie was set otherwise false (Because cookie usage is not enabled or available)\n */\n", "excerptTokens": [ { "kind": "Content", "text": "set(name: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ", value: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ", maxAgeSec?: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ", domain?: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ", path?: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 11, "endIndex": 12 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "name", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "value", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "maxAgeSec", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": true }, { "parameterName": "domain", "parameterTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "isOptional": true }, { "parameterName": "path", "parameterTypeTokenRange": { "startIndex": 9, "endIndex": 10 }, "isOptional": true } ], "name": "set" }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICookieMgr#setEnabled:member(1)", "docComment": "/**\n * Enable or Disable the usage of cookies\n */\n", "excerptTokens": [ { "kind": "Content", "text": "setEnabled(value: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "value", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "setEnabled" } ], "extendsTokenRanges": [] }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!ICookieMgrConfig:interface", "docComment": "/**\n * Configuration definition for instance based cookie management configuration\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export interface ICookieMgrConfig " } ], "releaseTag": "Public", "name": "ICookieMgrConfig", "members": [ { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICookieMgrConfig#delCookie:member", "docComment": "/**\n * Hook function to delete the named cookie with the specified value, separated from setCookie to avoid the need to parse the value to determine whether the cookie is being added or removed.\n *\n * @param name - The name of the cookie\n *\n * @param cookieValue - The value to set to expire the cookie\n */\n", "excerptTokens": [ { "kind": "Content", "text": "delCookie?: " }, { "kind": "Content", "text": "(name: string, cookieValue: string) => void" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "delCookie", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICookieMgrConfig#domain:member", "docComment": "/**\n * Custom cookie domain. This is helpful if you want to share Application Insights cookies across subdomains.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "domain?: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "domain", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICookieMgrConfig#enabled:member", "docComment": "/**\n * Defaults to true, A boolean that indicates whether the use of cookies by the SDK is enabled by the current instance. If false, the instance of the SDK initialized by this configuration will not store or read any data from cookies\n */\n", "excerptTokens": [ { "kind": "Content", "text": "enabled?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "enabled", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICookieMgrConfig#getCookie:member", "docComment": "/**\n * Hook function to fetch the named cookie value.\n *\n * @param name - The name of the cookie\n */\n", "excerptTokens": [ { "kind": "Content", "text": "getCookie?: " }, { "kind": "Content", "text": "(name: string) => string" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "getCookie", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICookieMgrConfig#path:member", "docComment": "/**\n * Specifies the path to use for the cookie, defaults to '/'\n */\n", "excerptTokens": [ { "kind": "Content", "text": "path?: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "path", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICookieMgrConfig#setCookie:member", "docComment": "/**\n * Hook function to set the named cookie with the specified value.\n *\n * @param name - The name of the cookie\n *\n * @param value - The value to set for the cookie\n */\n", "excerptTokens": [ { "kind": "Content", "text": "setCookie?: " }, { "kind": "Content", "text": "(name: string, value: string) => void" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "setCookie", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } } ], "extendsTokenRanges": [] }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils:interface", "docComment": "/**\n * Provides a collection of utility functions, included for backward compatibility with previous releases.\n *\n * @deprecated\n *\n * Marking this interface and instance as deprecated in favor of direct usage of the helper functions as direct usage provides better tree-shaking and minification by avoiding the inclusion of the unused items in your resulting code.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export interface ICoreUtils " } ], "releaseTag": "Public", "name": "ICoreUtils", "members": [ { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#_canUseCookies:member", "docComment": "/**\n * Internal - Do not use directly.\n *\n * @deprecated\n *\n * Direct usage of this property is not recommend\n */\n", "excerptTokens": [ { "kind": "Content", "text": "_canUseCookies: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "_canUseCookies", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#addEventHandler:member", "docComment": "/**\n * Trys to add an event handler for the specified event to the window, body and document\n *\n * @param eventName - The name of the event\n *\n * @param callback - The callback function that needs to be executed for the given event @return {boolean} - true if the handler was successfully added\n */\n", "excerptTokens": [ { "kind": "Content", "text": "addEventHandler: " }, { "kind": "Content", "text": "(eventName: string, callback: any, evtNamespace?: string | string[]) => boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "addEventHandler", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#arrForEach:member", "docComment": "/**\n * Performs the specified action for each element in an array. This helper exists to avoid adding a polyfil for older browsers that do not define Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page checks for presence/absence of the prototype implementation. Note: For consistency this will not use the Array.prototype.xxxx implementation if it exists as this would cause a testing requirement to test with and without the implementations\n *\n * @param callbackfn - A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. It can return -1 to break out of the loop\n *\n * @param thisArg - [Optional] An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "arrForEach: " }, { "kind": "Content", "text": "(arr: T[], callbackfn: (value: T, index?: number, array?: T[]) => void | number, thisArg?: any) => void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "arrForEach", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#arrIndexOf:member", "docComment": "/**\n * Returns the index of the first occurrence of a value in an array. This helper exists to avoid adding a polyfil for older browsers that do not define Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page checks for presence/absence of the prototype implementation. Note: For consistency this will not use the Array.prototype.xxxx implementation if it exists as this would cause a testing requirement to test with and without the implementations\n *\n * @param searchElement - The value to locate in the array.\n *\n * @param fromIndex - The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "arrIndexOf: " }, { "kind": "Content", "text": "(arr: T[], searchElement: T, fromIndex?: number) => number" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "arrIndexOf", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#arrMap:member", "docComment": "/**\n * Calls a defined callback function on each element of an array, and returns an array that contains the results. This helper exists to avoid adding a polyfil for older browsers that do not define Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page checks for presence/absence of the prototype implementation. Note: For consistency this will not use the Array.prototype.xxxx implementation if it exists as this would cause a testing requirement to test with and without the implementations\n *\n * @param callbackfn - A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.\n *\n * @param thisArg - An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "arrMap: " }, { "kind": "Content", "text": "(arr: T[], callbackfn: (value: T, index?: number, array?: T[]) => R, thisArg?: any) => R[]" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "arrMap", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#arrReduce:member", "docComment": "/**\n * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. This helper exists to avoid adding a polyfil for older browsers that do not define Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page checks for presence/absence of the prototype implementation. Note: For consistency this will not use the Array.prototype.xxxx implementation if it exists as this would cause a testing requirement to test with and without the implementations\n *\n * @param callbackfn - A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\n *\n * @param initialValue - If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "arrReduce: " }, { "kind": "Content", "text": "(arr: T[], callbackfn: (previousValue: T | R, currentValue?: T, currentIndex?: number, array?: T[]) => R, initialValue?: R) => R" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "arrReduce", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#dateNow:member", "docComment": "/**\n * Return the current time via the Date now() function (if available) and falls back to (new Date()).getTime() if now() is unavailable (IE8 or less) https://caniuse.com/#search=Date.now\n */\n", "excerptTokens": [ { "kind": "Content", "text": "dateNow: " }, { "kind": "Content", "text": "() => number" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "dateNow", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#disableCookies:member", "docComment": "/**\n * @deprecated\n *\n * - Use the core.getCookieMgr().disable() Force the SDK not to store and read any data from cookies.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "disableCookies: " }, { "kind": "Content", "text": "() => void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "disableCookies", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#generateW3CId:member", "docComment": "/**\n * generate W3C trace id\n */\n", "excerptTokens": [ { "kind": "Content", "text": "generateW3CId: " }, { "kind": "Content", "text": "() => string" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "generateW3CId", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#hasOwnProperty:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "hasOwnProperty: " }, { "kind": "Content", "text": "(obj: any, prop: string) => boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "hasOwnProperty", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#isArray:member", "docComment": "/**\n * Check if an object is of type Array\n */\n", "excerptTokens": [ { "kind": "Content", "text": "isArray: " }, { "kind": "Content", "text": "(obj: any) => boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "isArray", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#isBoolean:member", "docComment": "/**\n * Checks if the type of value is a boolean.\n *\n * @param value - Value to be checked. @return {boolean} True if the value is a boolean, false otherwise.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "isBoolean: " }, { "kind": "Content", "text": "(value: any) => " }, { "kind": "Reference", "text": "value", "canonicalReference": "@microsoft/applicationinsights-core-js!~value" }, { "kind": "Content", "text": " is boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "isBoolean", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 4 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#isDate:member", "docComment": "/**\n * Check if an object is of type Date\n */\n", "excerptTokens": [ { "kind": "Content", "text": "isDate: " }, { "kind": "Content", "text": "(obj: any) => " }, { "kind": "Reference", "text": "obj", "canonicalReference": "@microsoft/applicationinsights-core-js!~obj" }, { "kind": "Content", "text": " is " }, { "kind": "Reference", "text": "Date", "canonicalReference": "!Date:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "isDate", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 5 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#isError:member", "docComment": "/**\n * Check if an object is of type Error\n */\n", "excerptTokens": [ { "kind": "Content", "text": "isError: " }, { "kind": "Content", "text": "(obj: any) => " }, { "kind": "Reference", "text": "obj", "canonicalReference": "@microsoft/applicationinsights-core-js!~obj" }, { "kind": "Content", "text": " is " }, { "kind": "Reference", "text": "Error", "canonicalReference": "!Error:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "isError", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 5 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#isFunction:member", "docComment": "/**\n * Checks if the passed of value is a function.\n *\n * @param value - Value to be checked. @return {boolean} True if the value is a boolean, false otherwise.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "isFunction: " }, { "kind": "Content", "text": "(value: any) => " }, { "kind": "Reference", "text": "value", "canonicalReference": "@microsoft/applicationinsights-core-js!~value" }, { "kind": "Content", "text": " is " }, { "kind": "Reference", "text": "Function", "canonicalReference": "!Function:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "isFunction", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 5 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#isIE:member", "docComment": "/**\n * Identifies whether the current environment appears to be IE\n */\n", "excerptTokens": [ { "kind": "Content", "text": "isIE: " }, { "kind": "Content", "text": "() => boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "isIE", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#isNullOrUndefined:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "isNullOrUndefined: " }, { "kind": "Content", "text": "(value: any) => boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "isNullOrUndefined", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#isNumber:member", "docComment": "/**\n * Checks if the type of value is a number.\n *\n * @param value - Value to be checked. @return {boolean} True if the value is a number, false otherwise.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "isNumber: " }, { "kind": "Content", "text": "(value: any) => " }, { "kind": "Reference", "text": "value", "canonicalReference": "@microsoft/applicationinsights-core-js!~value" }, { "kind": "Content", "text": " is number" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "isNumber", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 4 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#isObject:member", "docComment": "/**\n * Checks if the passed of value is a function.\n *\n * @param value - Value to be checked. @return {boolean} True if the value is a boolean, false otherwise.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "isObject: " }, { "kind": "Content", "text": "(value: any) => boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "isObject", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#isString:member", "docComment": "/**\n * Checks if the type of value is a string.\n *\n * @param value - Value to be checked. @return {boolean} True if the value is a string, false otherwise.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "isString: " }, { "kind": "Content", "text": "(value: any) => " }, { "kind": "Reference", "text": "value", "canonicalReference": "@microsoft/applicationinsights-core-js!~value" }, { "kind": "Content", "text": " is string" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "isString", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 4 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#isTypeof:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "isTypeof: " }, { "kind": "Content", "text": "(value: any, theType: string) => boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "isTypeof", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#isUndefined:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "isUndefined: " }, { "kind": "Content", "text": "(value: any) => boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "isUndefined", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#mwcRandom32:member", "docComment": "/**\n * Generate a random 32-bit number between (0x000000..0xFFFFFFFF) or (-0x80000000..0x7FFFFFFF), using MWC (Multiply with carry) instead of Math.random() defaults to un-signed. Used as a replacement random generator for IE to avoid issues with older IE instances.\n *\n * @param signed - True to return a signed 32-bit number (-0x80000000..0x7FFFFFFF) otherwise an unsigned one (0x000000..0xFFFFFFFF)\n */\n", "excerptTokens": [ { "kind": "Content", "text": "mwcRandom32: " }, { "kind": "Content", "text": "(signed?: boolean) => number" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "mwcRandom32", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#mwcRandomSeed:member", "docComment": "/**\n * Seed the MWC random number generator with the specified seed or a random value\n *\n * @param value - optional the number to used as the seed, if undefined, null or zero a random value will be chosen\n */\n", "excerptTokens": [ { "kind": "Content", "text": "mwcRandomSeed: " }, { "kind": "Content", "text": "(value?: number) => void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "mwcRandomSeed", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#newGuid:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "newGuid: " }, { "kind": "Content", "text": "() => string" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "newGuid", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#newId:member", "docComment": "/**\n * Generate random base64 id string. The default length is 22 which is 132-bits so almost the same as a GUID but as base64 (the previous default was 5)\n *\n * @param maxLength - Optional value to specify the length of the id to be generated, defaults to 22\n */\n", "excerptTokens": [ { "kind": "Content", "text": "newId: " }, { "kind": "Content", "text": "(maxLength?: number) => string" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "newId", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#objCreate:member", "docComment": "/**\n * Creates an object that has the specified prototype, and that optionally contains specified properties. This helper exists to avoid adding a polyfil for older browsers that do not define Object.create eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation. Note: For consistency this will not use the Object.create implementation if it exists as this would cause a testing requirement to test with and without the implementations\n *\n * @param obj - Object to use as a prototype. May be null\n */\n", "excerptTokens": [ { "kind": "Content", "text": "objCreate: " }, { "kind": "Content", "text": "(obj: object) => any" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "objCreate", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#objDefineAccessors:member", "docComment": "/**\n * Try to define get/set object property accessors for the target object/prototype, this will provide compatibility with existing API definition when run within an ES5+ container that supports accessors but still enable the code to be loaded and executed in an ES3 container, providing basic IE8 compatibility.\n *\n * @param target - The object on which to define the property.\n *\n * @param prop - The name of the property to be defined or modified.\n *\n * @param getProp - The getter function to wire against the getter.\n *\n * @param setProp - The setter function to wire against the setter.\n *\n * @returns True if it was able to create the accessors otherwise false\n */\n", "excerptTokens": [ { "kind": "Content", "text": "objDefineAccessors: " }, { "kind": "Content", "text": "(target: any, prop: string, getProp?: () => T, setProp?: (v: T) => void) => boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "objDefineAccessors", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#objKeys:member", "docComment": "/**\n * Returns the names of the enumerable string properties and methods of an object. This helper exists to avoid adding a polyfil for older browsers that do not define Object.keys eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation. Note: For consistency this will not use the Object.keys implementation if it exists as this would cause a testing requirement to test with and without the implementations\n *\n * @param obj - Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "objKeys: " }, { "kind": "Content", "text": "(obj: {}) => string[]" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "objKeys", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#perfNow:member", "docComment": "/**\n * Return the current value of the Performance Api now() function (if available) and fallback to dateNow() if it is unavailable (IE9 or less) https://caniuse.com/#search=performance.now\n */\n", "excerptTokens": [ { "kind": "Content", "text": "perfNow: " }, { "kind": "Content", "text": "() => number" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "perfNow", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#random32:member", "docComment": "/**\n * generate a random 32-bit number (0x000000..0xFFFFFFFF) or (-0x80000000..0x7FFFFFFF), defaults un-unsigned.\n *\n * @param signed - True to return a signed 32-bit number (-0x80000000..0x7FFFFFFF) otherwise an unsigned one (0x000000..0xFFFFFFFF)\n */\n", "excerptTokens": [ { "kind": "Content", "text": "random32: " }, { "kind": "Content", "text": "(signed?: boolean) => number" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "random32", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#randomValue:member", "docComment": "/**\n * Generate a random value between 0 and maxValue, max value should be limited to a 32-bit maximum. So maxValue(16) will produce a number from 0..16 (range of 17)\n *\n * @param maxValue - \n */\n", "excerptTokens": [ { "kind": "Content", "text": "randomValue: " }, { "kind": "Content", "text": "(maxValue: number) => number" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "randomValue", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#strTrim:member", "docComment": "/**\n * helper method to trim strings (IE8 does not implement String.prototype.trim)\n */\n", "excerptTokens": [ { "kind": "Content", "text": "strTrim: " }, { "kind": "Content", "text": "(str: any) => string" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "strTrim", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICoreUtils#toISOString:member", "docComment": "/**\n * Convert a date to I.S.O. format in IE8\n */\n", "excerptTokens": [ { "kind": "Content", "text": "toISOString: " }, { "kind": "Content", "text": "(date: " }, { "kind": "Reference", "text": "Date", "canonicalReference": "!Date:interface" }, { "kind": "Content", "text": ") => string" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "toISOString", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 4 } } ], "extendsTokenRanges": [] }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!ICustomProperties:interface", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export interface ICustomProperties " } ], "releaseTag": "Public", "name": "ICustomProperties", "members": [ { "kind": "IndexSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ICustomProperties:index(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "[key: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "]: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "key", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ] } ], "extendsTokenRanges": [] }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!IDbgExtension:interface", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export interface IDbgExtension " } ], "releaseTag": "Public", "name": "IDbgExtension", "members": [ { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IDbgExtension#debugMsg:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "debugMsg?: " }, { "kind": "Content", "text": "(name: string, data: any) => void" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "debugMsg", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IDbgExtension#diagLog:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "diagLog?: " }, { "kind": "Content", "text": "(name: string, data: any) => void" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "diagLog", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IDbgExtension#disable:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "disable: " }, { "kind": "Content", "text": "() => void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "disable", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IDbgExtension#enable:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "enable: " }, { "kind": "Content", "text": "() => void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "enable", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IDbgExtension#isEnabled:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "isEnabled: " }, { "kind": "Content", "text": "() => boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "isEnabled", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IDbgExtension#listener:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "listener: " }, { "kind": "Reference", "text": "INotificationListener", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationListener:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "listener", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IDbgExtension#sendEvt:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "sendEvt?: " }, { "kind": "Content", "text": "(name: string, data: any) => void" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "sendEvt", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } } ], "extendsTokenRanges": [] }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!IDiagnosticLogger:interface", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export interface IDiagnosticLogger " } ], "releaseTag": "Public", "name": "IDiagnosticLogger", "members": [ { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IDiagnosticLogger#consoleLoggingLevel:member", "docComment": "/**\n * 0: OFF 1: only critical (default) 2: critical + info\n */\n", "excerptTokens": [ { "kind": "Content", "text": "consoleLoggingLevel: " }, { "kind": "Content", "text": "() => number" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "consoleLoggingLevel", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IDiagnosticLogger#enableDebugExceptions:member", "docComment": "/**\n * When this is true the SDK will throw exceptions to aid in debugging.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "enableDebugExceptions: " }, { "kind": "Content", "text": "() => boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "enableDebugExceptions", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IDiagnosticLogger#errorToConsole:member(1)", "docComment": "/**\n * This will write an error to the console if possible. Provided by the default DiagnosticLogger instance, and internally the SDK will fall back to warnToConsole, however, direct callers MUST check for its existence on the logger as you can provide your own IDiagnosticLogger instance.\n *\n * @param message - The error message\n */\n", "excerptTokens": [ { "kind": "Content", "text": "errorToConsole?(message: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "message", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "errorToConsole" }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IDiagnosticLogger#logInternalMessage:member(1)", "docComment": "/**\n * Logs a message to the internal queue.\n *\n * @param severity - The severity of the log message\n *\n * @param message - The message to log.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "logInternalMessage?(severity: " }, { "kind": "Reference", "text": "LoggingSeverity", "canonicalReference": "@microsoft/applicationinsights-core-js!LoggingSeverity:type" }, { "kind": "Content", "text": ", message: " }, { "kind": "Reference", "text": "_InternalLogMessage", "canonicalReference": "@microsoft/applicationinsights-core-js!_InternalLogMessage:class" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "severity", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "message", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false } ], "name": "logInternalMessage" }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IDiagnosticLogger#maxInternalMessageLimit:member", "docComment": "/**\n * The maximum number of internal messages allowed to be sent per page view\n */\n", "excerptTokens": [ { "kind": "Content", "text": "maxInternalMessageLimit: " }, { "kind": "Content", "text": "() => number" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "maxInternalMessageLimit", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IDiagnosticLogger#queue:member", "docComment": "/**\n * The internal logging queue\n */\n", "excerptTokens": [ { "kind": "Content", "text": "queue: " }, { "kind": "Reference", "text": "_InternalLogMessage", "canonicalReference": "@microsoft/applicationinsights-core-js!_InternalLogMessage:class" }, { "kind": "Content", "text": "[]" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "queue", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 3 } }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IDiagnosticLogger#resetInternalMessageCount:member(1)", "docComment": "/**\n * Resets the internal message count\n */\n", "excerptTokens": [ { "kind": "Content", "text": "resetInternalMessageCount(): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "resetInternalMessageCount" }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IDiagnosticLogger#telemetryLoggingLevel:member", "docComment": "/**\n * 0: OFF (default) 1: CRITICAL 2: WARNING\n */\n", "excerptTokens": [ { "kind": "Content", "text": "telemetryLoggingLevel: " }, { "kind": "Content", "text": "() => number" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "telemetryLoggingLevel", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IDiagnosticLogger#throwInternal:member(1)", "docComment": "/**\n * This method will throw exceptions in debug mode or attempt to log the error as a console warning.\n *\n * @param severity - The severity of the log message\n *\n * @param message - The log message.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "throwInternal(severity: " }, { "kind": "Reference", "text": "LoggingSeverity", "canonicalReference": "@microsoft/applicationinsights-core-js!LoggingSeverity:type" }, { "kind": "Content", "text": ", msgId: " }, { "kind": "Reference", "text": "_InternalMessageId", "canonicalReference": "@microsoft/applicationinsights-core-js!_InternalMessageId:type" }, { "kind": "Content", "text": ", msg: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ", properties?: " }, { "kind": "Reference", "text": "Object", "canonicalReference": "!Object:interface" }, { "kind": "Content", "text": ", isUserAct?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 11, "endIndex": 12 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "severity", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "msgId", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "msg", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": false }, { "parameterName": "properties", "parameterTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "isOptional": true }, { "parameterName": "isUserAct", "parameterTypeTokenRange": { "startIndex": 9, "endIndex": 10 }, "isOptional": true } ], "name": "throwInternal" }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IDiagnosticLogger#warnToConsole:member(1)", "docComment": "/**\n * This will write a warning to the console if possible\n *\n * @param message - The warning message\n */\n", "excerptTokens": [ { "kind": "Content", "text": "warnToConsole(message: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "message", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "warnToConsole" } ], "extendsTokenRanges": [] }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!IEventHelper:interface", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export interface IEventHelper " } ], "releaseTag": "Public", "name": "IEventHelper", "members": [ { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IEventHelper#Attach:member", "docComment": "/**\n * Binds the specified function to an event, so that the function gets called whenever the event fires on the object\n *\n * @param obj - Object to add the event too.\n *\n * @param eventNameWithoutOn - String that specifies any of the standard DHTML Events without \"on\" prefix\n *\n * @param handlerRef - Pointer that specifies the function to call when event fires\n *\n * @returns True if the function was bound successfully to the event, otherwise false\n */\n", "excerptTokens": [ { "kind": "Content", "text": "Attach: " }, { "kind": "Content", "text": "(obj: any, eventNameWithoutOn: string, handlerRef: any) => boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "Attach", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IEventHelper#AttachEvent:member", "docComment": "/**\n * Binds the specified function to an event, so that the function gets called whenever the event fires on the object\n *\n * @deprecated\n *\n * Use {@link EventHelper#Attach} as we are already in a class call EventHelper the extra \"Event\" just causes a larger result\n *\n * @param obj - Object to add the event too.\n *\n * @param eventNameWithoutOn - String that specifies any of the standard DHTML Events without \"on\" prefix\n *\n * @param handlerRef - Pointer that specifies the function to call when event fires\n *\n * @returns True if the function was bound successfully to the event, otherwise false\n */\n", "excerptTokens": [ { "kind": "Content", "text": "AttachEvent: " }, { "kind": "Content", "text": "(obj: any, eventNameWithoutOn: string, handlerRef: any) => boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "AttachEvent", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IEventHelper#Detach:member", "docComment": "/**\n * Removes an event handler for the specified event\n *\n * @param eventName - The name of the event\n *\n * @param callback - The callback function that needs to be executed for the given event @return {boolean} - true if the handler was successfully added\n */\n", "excerptTokens": [ { "kind": "Content", "text": "Detach: " }, { "kind": "Content", "text": "(obj: any, eventNameWithoutOn: string, handlerRef: any) => void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "Detach", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IEventHelper#DetachEvent:member", "docComment": "/**\n * Removes an event handler for the specified event\n *\n * @deprecated\n *\n * Use {@link EventHelper#Detach} as we are already in a class call EventHelper the extra \"Event\" just causes a larger result\n *\n * @param eventName - The name of the event\n *\n * @param callback - The callback function that needs to be executed for the given event @return {boolean} - true if the handler was successfully added\n */\n", "excerptTokens": [ { "kind": "Content", "text": "DetachEvent: " }, { "kind": "Content", "text": "(obj: any, eventNameWithoutOn: string, handlerRef: any) => void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "DetachEvent", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } } ], "extendsTokenRanges": [] }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentCallDetails:interface", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export interface IInstrumentCallDetails " } ], "releaseTag": "Public", "name": "IInstrumentCallDetails", "members": [ { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentCallDetails#ctx:member", "docComment": "/**\n * This returns an object that the hook function can use to store hook specific context, it it not shared with any other hook instances and is unique for the current call. A hook implementation can use this to pass / share context between different hook callbacks eg. request/response requst/hookErrors etc.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "ctx: " }, { "kind": "Content", "text": "() => any" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "ctx", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentCallDetails#err:member", "docComment": "/**\n * The error (exception) which occurred while executing the original method\n */\n", "excerptTokens": [ { "kind": "Content", "text": "err?: " }, { "kind": "Reference", "text": "Error", "canonicalReference": "!Error:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "err", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentCallDetails#evt:member", "docComment": "/**\n * The Event object from (window.event) at the start of the original call\n */\n", "excerptTokens": [ { "kind": "Content", "text": "evt?: " }, { "kind": "Reference", "text": "Event", "canonicalReference": "!Event:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "evt", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentCallDetails#inst:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "inst: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "inst", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentCallDetails#name:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "name: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "name", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentCallDetails#rslt:member", "docComment": "/**\n * The result of the original method, only populated after the original method has returned\n */\n", "excerptTokens": [ { "kind": "Content", "text": "rslt?: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "rslt", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentCallDetails#set:member", "docComment": "/**\n * Allows the hook functions to replace the original arguments\n *\n * @param idx - The argument index (0 based)\n *\n * @param value - The new value for the argument\n */\n", "excerptTokens": [ { "kind": "Content", "text": "set: " }, { "kind": "Content", "text": "(idx: number, value: any) => void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "set", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } } ], "extendsTokenRanges": [] }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentHook:interface", "docComment": "/**\n * The holder of the specific instance callback\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export interface IInstrumentHook " } ], "releaseTag": "Public", "name": "IInstrumentHook", "members": [ { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentHook#cbks:member", "docComment": "/**\n * Holds the callbacks\n */\n", "excerptTokens": [ { "kind": "Content", "text": "cbks: " }, { "kind": "Reference", "text": "IInstrumentHooksCallbacks", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentHooksCallbacks:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "cbks", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentHook#id:member", "docComment": "/**\n * Unique Id for this callback on the hooked method\n */\n", "excerptTokens": [ { "kind": "Content", "text": "id: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "id", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentHook#rm:member", "docComment": "/**\n * Remove this hook from the function\n */\n", "excerptTokens": [ { "kind": "Content", "text": "rm: " }, { "kind": "Content", "text": "() => void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "rm", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } } ], "extendsTokenRanges": [] }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentHooks:interface", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export interface IInstrumentHooks " } ], "releaseTag": "Public", "name": "IInstrumentHooks", "members": [ { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentHooks#f:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "f: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "f", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentHooks#h:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "h: " }, { "kind": "Reference", "text": "IInstrumentHook", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentHook:interface" }, { "kind": "Content", "text": "[]" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "h", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 3 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentHooks#i:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "i: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "i", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentHooks#n:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "n: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "n", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } } ], "extendsTokenRanges": [] }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentHooksCallbacks:interface", "docComment": "/**\n * The callbacks to call for the instrumented function, you must provide at least the request and/or response callbacks, both are not required. You must always supply the error callback\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export interface IInstrumentHooksCallbacks " } ], "releaseTag": "Public", "name": "IInstrumentHooksCallbacks", "members": [ { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentHooksCallbacks#fnErr:member", "docComment": "/**\n * The callback to call if the original function causes an exception, even if you supply a callback the original exception will still be thrown\n */\n", "excerptTokens": [ { "kind": "Content", "text": "fnErr?: " }, { "kind": "Reference", "text": "InstrumentorHooksCallback", "canonicalReference": "@microsoft/applicationinsights-core-js!InstrumentorHooksCallback:type" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "fnErr", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentHooksCallbacks#hkErr:member", "docComment": "/**\n * The callback to call if the hook function causes an exception\n */\n", "excerptTokens": [ { "kind": "Content", "text": "hkErr?: " }, { "kind": "Reference", "text": "InstrumentorHooksCallback", "canonicalReference": "@microsoft/applicationinsights-core-js!InstrumentorHooksCallback:type" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "hkErr", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentHooksCallbacks#ns:member", "docComment": "/**\n * [Optional] Namespace details (same as the namespace used for events), useful for debugging and testing to identify the source of the instrumented hooks\n */\n", "excerptTokens": [ { "kind": "Content", "text": "ns?: " }, { "kind": "Content", "text": "string | string[]" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "ns", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentHooksCallbacks#req:member", "docComment": "/**\n * The hook callback to call before the original function is called\n */\n", "excerptTokens": [ { "kind": "Content", "text": "req?: " }, { "kind": "Reference", "text": "InstrumentorHooksCallback", "canonicalReference": "@microsoft/applicationinsights-core-js!InstrumentorHooksCallback:type" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "req", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentHooksCallbacks#rsp:member", "docComment": "/**\n * The hook callback to call after the original function was called\n */\n", "excerptTokens": [ { "kind": "Content", "text": "rsp?: " }, { "kind": "Reference", "text": "InstrumentorHooksCallback", "canonicalReference": "@microsoft/applicationinsights-core-js!InstrumentorHooksCallback:type" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "rsp", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } } ], "extendsTokenRanges": [] }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!ILoadedPlugin:interface", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export interface ILoadedPlugin " } ], "releaseTag": "Public", "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 1, "endIndex": 2 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "ILoadedPlugin", "members": [ { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ILoadedPlugin#isEnabled:member", "docComment": "/**\n * Identifies whether the plugin is enabled and can process events. This is slightly different from isInitialized as the plugin may be initialized but disabled via the setEnabled() or it may be a shared plugin which has had it's teardown function called from another instance..\n *\n * @returns boolean = true if the plugin is in a state where it is operational.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "isEnabled: " }, { "kind": "Content", "text": "() => boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "isEnabled", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ILoadedPlugin#plugin:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "plugin: " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "plugin", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ILoadedPlugin#remove:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "remove: " }, { "kind": "Content", "text": "(isAsync?: boolean, removeCb?: (removed?: boolean) => void) => void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "remove", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ILoadedPlugin#setEnabled:member", "docComment": "/**\n * You can optionally enable / disable a plugin from processing events. Setting enabled to true will not necessarily cause the `isEnabled()` to also return true as the plugin must also have been successfully initialized and not had it's `teardown` method called (unless it's also been re-initialized)\n */\n", "excerptTokens": [ { "kind": "Content", "text": "setEnabled: " }, { "kind": "Content", "text": "(isEnabled: boolean) => void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "setEnabled", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } } ], "extendsTokenRanges": [] }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!initializePlugins:function(1)", "docComment": "/**\n * Initialize the queue of plugins\n *\n * @param plugins - The array of plugins to initialize and setting of the next plugin\n *\n * @param config - The current config for the instance\n *\n * @param core - THe current core instance\n *\n * @param extensions - The extensions\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function initializePlugins(processContext: " }, { "kind": "Reference", "text": "IProcessTelemetryContext", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryContext:interface" }, { "kind": "Content", "text": ", extensions: " }, { "kind": "Reference", "text": "IPlugin", "canonicalReference": "@microsoft/applicationinsights-core-js!IPlugin:interface" }, { "kind": "Content", "text": "[]" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 6, "endIndex": 7 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "processContext", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "extensions", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 5 }, "isOptional": false } ], "name": "initializePlugins" }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationListener:interface", "docComment": "/**\n * An interface used for the notification listener. @interface\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export interface INotificationListener " } ], "releaseTag": "Public", "name": "INotificationListener", "members": [ { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationListener#eventsDiscarded:member", "docComment": "/**\n * [Optional] A function called when events are discarded.\n *\n * @param events - The array of events that have been discarded.\n *\n * @param reason - The reason for discarding the events. The EventsDiscardedReason constant should be used to check the different values.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "eventsDiscarded?: " }, { "kind": "Content", "text": "(events: " }, { "kind": "Reference", "text": "ITelemetryItem", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryItem:interface" }, { "kind": "Content", "text": "[], reason: number) => void" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "eventsDiscarded", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 4 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationListener#eventsSendRequest:member", "docComment": "/**\n * [Optional] A function called when the events have been requested to be sent to the sever.\n *\n * @param sendReason - The reason why the event batch is being sent.\n *\n * @param isAsync - A flag which identifies whether the requests are being sent in an async or sync manner.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "eventsSendRequest?: " }, { "kind": "Content", "text": "(sendReason: number, isAsync?: boolean) => void" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "eventsSendRequest", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationListener#eventsSent:member", "docComment": "/**\n * [Optional] A function called when events are sent.\n *\n * @param events - The array of events that have been sent.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "eventsSent?: " }, { "kind": "Content", "text": "(events: " }, { "kind": "Reference", "text": "ITelemetryItem", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryItem:interface" }, { "kind": "Content", "text": "[]) => void" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "eventsSent", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 4 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationListener#perfEvent:member", "docComment": "/**\n * [Optional] This event is sent if you have enabled perf events, they are primarily used to track internal performance testing and debugging the event can be displayed via the debug plugin extension.\n *\n * @param perfEvent - \n */\n", "excerptTokens": [ { "kind": "Content", "text": "perfEvent?: " }, { "kind": "Content", "text": "(perfEvent: " }, { "kind": "Reference", "text": "IPerfEvent", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfEvent:interface" }, { "kind": "Content", "text": ") => void" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "perfEvent", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 4 } } ], "extendsTokenRanges": [] }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationManager:interface", "docComment": "/**\n * Class to manage sending notifications to all the listeners.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export interface INotificationManager " } ], "releaseTag": "Public", "name": "INotificationManager", "members": [ { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationManager#addNotificationListener:member(1)", "docComment": "/**\n * Adds a notification listener.\n *\n * @param listener - The notification listener to be added.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "addNotificationListener(listener: " }, { "kind": "Reference", "text": "INotificationListener", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationListener:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "listener", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "addNotificationListener" }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationManager#eventsDiscarded:member(1)", "docComment": "/**\n * Notification for events being discarded.\n *\n * @param events - The array of events that have been discarded by the SDK.\n *\n * @param reason - The reason for which the SDK discarded the events. The EventsDiscardedReason constant should be used to check the different values.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "eventsDiscarded(events: " }, { "kind": "Reference", "text": "ITelemetryItem", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryItem:interface" }, { "kind": "Content", "text": "[]" }, { "kind": "Content", "text": ", reason: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 6, "endIndex": 7 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "events", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "isOptional": false }, { "parameterName": "reason", "parameterTypeTokenRange": { "startIndex": 4, "endIndex": 5 }, "isOptional": false } ], "name": "eventsDiscarded" }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationManager#eventsSendRequest:member(1)", "docComment": "/**\n * [Optional] A function called when the events have been requested to be sent to the sever.\n *\n * @param sendReason - The reason why the event batch is being sent.\n *\n * @param isAsync - A flag which identifies whether the requests are being sent in an async or sync manner.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "eventsSendRequest?(sendReason: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ", isAsync: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "sendReason", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "isAsync", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false } ], "name": "eventsSendRequest" }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationManager#eventsSent:member(1)", "docComment": "/**\n * Notification for events sent.\n *\n * @param events - The array of events that have been sent.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "eventsSent(events: " }, { "kind": "Reference", "text": "ITelemetryItem", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryItem:interface" }, { "kind": "Content", "text": "[]" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 4, "endIndex": 5 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "events", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "isOptional": false } ], "name": "eventsSent" }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationManager#listeners:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "listeners: " }, { "kind": "Reference", "text": "INotificationListener", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationListener:interface" }, { "kind": "Content", "text": "[]" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "listeners", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 3 } }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationManager#perfEvent:member(1)", "docComment": "/**\n * [Optional] This event is sent if you have enabled perf events, they are primarily used to track internal performance testing and debugging the event can be displayed via the debug plugin extension.\n *\n * @param perfEvent - \n */\n", "excerptTokens": [ { "kind": "Content", "text": "perfEvent?(perfEvent: " }, { "kind": "Reference", "text": "IPerfEvent", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfEvent:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "perfEvent", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "perfEvent" }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationManager#removeNotificationListener:member(1)", "docComment": "/**\n * Removes all instances of the listener.\n *\n * @param listener - AWTNotificationListener to remove.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "removeNotificationListener(listener: " }, { "kind": "Reference", "text": "INotificationListener", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationListener:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "listener", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "removeNotificationListener" } ], "extendsTokenRanges": [] }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!InstrumentEvent:function(1)", "docComment": "/**\n * Add an instrumentation hook to the provided named \"event\" for the target class / object, this doesn't check whether the named \"event\" is in fact a function and just assigns the instrumentation hook to the target[evtName]\n *\n * @param target - The target object\n *\n * @param evtName - The name of the event\n *\n * @param callbacks - The callbacks to configure and call whenever the function is called\n *\n * @param checkPrototype - If the function doesn't exist on the target should it attempt to hook the prototype function\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function InstrumentEvent(target: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ", evtName: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ", callbacks: " }, { "kind": "Reference", "text": "IInstrumentHooksCallbacks", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentHooksCallbacks:interface" }, { "kind": "Content", "text": ", checkPrototype?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "IInstrumentHook", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentHook:interface" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 9, "endIndex": 10 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "target", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "evtName", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "callbacks", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": false }, { "parameterName": "checkPrototype", "parameterTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "isOptional": true } ], "name": "InstrumentEvent" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!InstrumentFunc:function(1)", "docComment": "/**\n * Intercept the named prototype functions for the target class / object\n *\n * @param target - The target object\n *\n * @param funcName - The function name\n *\n * @param callbacks - The callbacks to configure and call whenever the function is called\n *\n * @param checkPrototype - If the function doesn't exist on the target should it attempt to hook the prototype function\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function InstrumentFunc(target: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ", funcName: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ", callbacks: " }, { "kind": "Reference", "text": "IInstrumentHooksCallbacks", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentHooksCallbacks:interface" }, { "kind": "Content", "text": ", checkPrototype?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "IInstrumentHook", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentHook:interface" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 9, "endIndex": 10 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "target", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "funcName", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "callbacks", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": false }, { "parameterName": "checkPrototype", "parameterTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "isOptional": true } ], "name": "InstrumentFunc" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!InstrumentFuncs:function(1)", "docComment": "/**\n * Intercept the named functions for the target class / object\n *\n * @param target - The target object\n *\n * @param funcNames - The function names to intercept and call\n *\n * @param callbacks - The callbacks to configure and call whenever the function is called\n *\n * @param checkPrototype - If the function doesn't exist on the target should it attempt to hook the prototype function\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function InstrumentFuncs(target: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ", funcNames: " }, { "kind": "Content", "text": "string[]" }, { "kind": "Content", "text": ", callbacks: " }, { "kind": "Reference", "text": "IInstrumentHooksCallbacks", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentHooksCallbacks:interface" }, { "kind": "Content", "text": ", checkPrototype?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "IInstrumentHook", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentHook:interface" }, { "kind": "Content", "text": "[]" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 9, "endIndex": 11 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "target", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "funcNames", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "callbacks", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": false }, { "parameterName": "checkPrototype", "parameterTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "isOptional": true } ], "name": "InstrumentFuncs" }, { "kind": "TypeAlias", "canonicalReference": "@microsoft/applicationinsights-core-js!InstrumentorHooksCallback:type", "docComment": "/**\n * A callback function that will be called for the wrapped instrumentation function before the original function is executed.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare type InstrumentorHooksCallback = " }, { "kind": "Content", "text": "(funcArgs: " }, { "kind": "Reference", "text": "IInstrumentCallDetails", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentCallDetails:interface" }, { "kind": "Content", "text": ", ...orgArgs: any[]) => void" }, { "kind": "Content", "text": ";" } ], "releaseTag": "Public", "name": "InstrumentorHooksCallback", "typeTokenRange": { "startIndex": 1, "endIndex": 4 } }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!InstrumentProto:function(1)", "docComment": "/**\n * Intercept the named prototype functions for the target class / object\n *\n * @param target - The target object\n *\n * @param funcName - The function name\n *\n * @param callbacks - The callbacks to configure and call whenever the function is called\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function InstrumentProto(target: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ", funcName: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ", callbacks: " }, { "kind": "Reference", "text": "IInstrumentHooksCallbacks", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentHooksCallbacks:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "IInstrumentHook", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentHook:interface" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "target", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "funcName", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "callbacks", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": false } ], "name": "InstrumentProto" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!InstrumentProtos:function(1)", "docComment": "/**\n * Intercept the named prototype functions for the target class / object\n *\n * @param target - The target object\n *\n * @param funcNames - The function names to intercept and call\n *\n * @param callbacks - The callbacks to configure and call whenever the function is called\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function InstrumentProtos(target: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ", funcNames: " }, { "kind": "Content", "text": "string[]" }, { "kind": "Content", "text": ", callbacks: " }, { "kind": "Reference", "text": "IInstrumentHooksCallbacks", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentHooksCallbacks:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "IInstrumentHook", "canonicalReference": "@microsoft/applicationinsights-core-js!IInstrumentHook:interface" }, { "kind": "Content", "text": "[]" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 7, "endIndex": 9 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "target", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "funcNames", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "callbacks", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": false } ], "name": "InstrumentProtos" }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfEvent:interface", "docComment": "/**\n * This interface identifies the details of an internal performance event - it does not represent an outgoing reported event\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export interface IPerfEvent " } ], "releaseTag": "Public", "name": "IPerfEvent", "members": [ { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfEvent#childEvts:member", "docComment": "/**\n * The child perf events that are contained within the total time of this event.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "childEvts?: " }, { "kind": "Reference", "text": "IPerfEvent", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfEvent:interface" }, { "kind": "Content", "text": "[]" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "childEvts", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 3 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfEvent#complete:member", "docComment": "/**\n * Mark this event as completed, calculating the total execution time.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "complete: " }, { "kind": "Content", "text": "() => void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "complete", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfEvent#exTime:member", "docComment": "/**\n * Identifies the exclusive time spent in for this event (not including child events), this will be undefined until the event is completed.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "exTime?: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "exTime", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfEvent#getCtx:member", "docComment": "/**\n * Get the names additional context associated with this perf event\n */\n", "excerptTokens": [ { "kind": "Content", "text": "getCtx?: " }, { "kind": "Content", "text": "(key: string) => any" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "getCtx", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfEvent#isAsync:member", "docComment": "/**\n * Is this occurring from an asynchronous event\n */\n", "excerptTokens": [ { "kind": "Content", "text": "isAsync: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "isAsync", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfEvent#isChildEvt:member", "docComment": "/**\n * Identifies whether this event is a child event of a parent\n */\n", "excerptTokens": [ { "kind": "Content", "text": "isChildEvt: " }, { "kind": "Content", "text": "() => boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "isChildEvt", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfEvent#name:member", "docComment": "/**\n * The name of the performance event\n */\n", "excerptTokens": [ { "kind": "Content", "text": "name: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "name", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfEvent#parent:member", "docComment": "/**\n * The Parent event that was started before this event was created\n */\n", "excerptTokens": [ { "kind": "Content", "text": "parent?: " }, { "kind": "Reference", "text": "IPerfEvent", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfEvent:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "parent", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfEvent#payload:member", "docComment": "/**\n * The payload (contents) of the perfEvent, may be null or only set after the event has completed depending on the runtime environment.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "payload: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "payload", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfEvent#setCtx:member", "docComment": "/**\n * Set the named additional context to be associated with this perf event, this will replace any existing value\n */\n", "excerptTokens": [ { "kind": "Content", "text": "setCtx?: " }, { "kind": "Content", "text": "(key: string, value: any) => void" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "setCtx", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfEvent#start:member", "docComment": "/**\n * The start time of the performance event\n */\n", "excerptTokens": [ { "kind": "Content", "text": "start: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "start", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfEvent#time:member", "docComment": "/**\n * Identifies the total inclusive time spent for this event, including the time spent for child events, this will be undefined until the event is completed\n */\n", "excerptTokens": [ { "kind": "Content", "text": "time?: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "time", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } } ], "extendsTokenRanges": [] }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfManager:interface", "docComment": "/**\n * This defines an internal performance manager for tracking and reporting the internal performance of the SDK -- It does not represent or report any event to the server.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export interface IPerfManager " } ], "releaseTag": "Public", "name": "IPerfManager", "members": [ { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfManager#create:member(1)", "docComment": "/**\n * Create a new event and start timing, the manager may return null/undefined to indicate that it does not want to monitor this source event.\n *\n * @param src - The source name of the event\n *\n * @param payloadDetails - An optional callback function to fetch the payload details for the event.\n *\n * @param isAsync - Is the event occurring from a async event\n */\n", "excerptTokens": [ { "kind": "Content", "text": "create(src: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ", payloadDetails?: " }, { "kind": "Content", "text": "() => any" }, { "kind": "Content", "text": ", isAsync?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "IPerfEvent", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfEvent:interface" }, { "kind": "Content", "text": " | null | undefined" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 7, "endIndex": 9 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "src", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "payloadDetails", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": true }, { "parameterName": "isAsync", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": true } ], "name": "create" }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfManager#fire:member(1)", "docComment": "/**\n * Complete the perfEvent and fire any notifications.\n *\n * @param perfEvent - Fire the event which will also complete the passed event\n */\n", "excerptTokens": [ { "kind": "Content", "text": "fire(perfEvent: " }, { "kind": "Reference", "text": "IPerfEvent", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfEvent:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "perfEvent", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "fire" }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfManager#getCtx:member(1)", "docComment": "/**\n * Get the execution context value\n *\n * @param key - The context key\n */\n", "excerptTokens": [ { "kind": "Content", "text": "getCtx(key: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "key", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "getCtx" }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfManager#setCtx:member(1)", "docComment": "/**\n * Set an execution context value\n *\n * @param key - The context key name\n *\n * @param value - The value\n */\n", "excerptTokens": [ { "kind": "Content", "text": "setCtx(key: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ", value: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "key", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "value", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false } ], "name": "setCtx" } ], "extendsTokenRanges": [] }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfManagerProvider:interface", "docComment": "/**\n * Identifies an interface to a host that can provide an IPerfManager implementation\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export interface IPerfManagerProvider " } ], "releaseTag": "Public", "name": "IPerfManagerProvider", "members": [ { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfManagerProvider#getPerfMgr:member(1)", "docComment": "/**\n * Get the current performance manager\n */\n", "excerptTokens": [ { "kind": "Content", "text": "getPerfMgr(): " }, { "kind": "Reference", "text": "IPerfManager", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfManager:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "getPerfMgr" }, { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfManagerProvider#setPerfMgr:member(1)", "docComment": "/**\n * Set the current performance manager\n *\n * @param perfMgr - The performance manager\n */\n", "excerptTokens": [ { "kind": "Content", "text": "setPerfMgr(perfMgr: " }, { "kind": "Reference", "text": "IPerfManager", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfManager:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "perfMgr", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "setPerfMgr" } ], "extendsTokenRanges": [] }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!IPlugin:interface", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export interface IPlugin " } ], "releaseTag": "Public", "name": "IPlugin", "members": [ { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IPlugin#identifier:member", "docComment": "/**\n * Extension name\n */\n", "excerptTokens": [ { "kind": "Content", "text": "readonly identifier: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "identifier", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IPlugin#initialize:member", "docComment": "/**\n * Initialize plugin loaded by SDK\n *\n * @param config - The config for the plugin to use\n *\n * @param core - The current App Insights core to use for initializing this plugin instance\n *\n * @param extensions - The complete set of extensions to be used for initializing the plugin\n *\n * @param pluginChain - [Optional] specifies the current plugin chain which identifies the set of plugins and the order they should be executed for the current request.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "initialize: " }, { "kind": "Content", "text": "(config: " }, { "kind": "Reference", "text": "IConfiguration", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration:interface" }, { "kind": "Content", "text": ", core: " }, { "kind": "Reference", "text": "IAppInsightsCore", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore:interface" }, { "kind": "Content", "text": ", extensions: " }, { "kind": "Reference", "text": "IPlugin", "canonicalReference": "@microsoft/applicationinsights-core-js!IPlugin:interface" }, { "kind": "Content", "text": "[], pluginChain?: " }, { "kind": "Reference", "text": "ITelemetryPluginChain", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryPluginChain:interface" }, { "kind": "Content", "text": ") => void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "initialize", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 10 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IPlugin#isInitialized:member", "docComment": "/**\n * Returns a value that indicates whether the plugin has already been previously initialized. New plugins should implement this method to avoid being initialized more than once.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "isInitialized?: " }, { "kind": "Content", "text": "() => boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "isInitialized", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IPlugin#teardown:member", "docComment": "/**\n * Tear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further processTelemetry calls are ignored and it just calls the processNext() with the provided context.\n *\n * @param unloadCtx - This is the context that should be used during unloading.\n *\n * @param unloadState - The details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.\n *\n * @returns boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "teardown?: " }, { "kind": "Content", "text": "(unloadCtx: " }, { "kind": "Reference", "text": "IProcessTelemetryUnloadContext", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryUnloadContext:interface" }, { "kind": "Content", "text": ", unloadState?: " }, { "kind": "Reference", "text": "ITelemetryUnloadState", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryUnloadState:interface" }, { "kind": "Content", "text": ") => void | boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "teardown", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 6 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IPlugin#version:member", "docComment": "/**\n * Plugin version (available in data.properties.version in common schema)\n */\n", "excerptTokens": [ { "kind": "Content", "text": "readonly version?: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "version", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } } ], "extendsTokenRanges": [] }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryContext:interface", "docComment": "/**\n * The current context for the current call to processTelemetry(), used to support sharing the same plugin instance between multiple AppInsights instances\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export interface IProcessTelemetryContext extends " }, { "kind": "Reference", "text": "IBaseProcessingContext", "canonicalReference": "@microsoft/applicationinsights-core-js!IBaseProcessingContext:interface" }, { "kind": "Content", "text": " " } ], "releaseTag": "Public", "name": "IProcessTelemetryContext", "members": [ { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryContext#createNew:member", "docComment": "/**\n * Create a new context using the core and config from the current instance, returns a new instance of the same type\n *\n * @param plugins - The execution order to process the plugins, if null or not supplied then the current execution order will be copied.\n *\n * @param startAt - The plugin to start processing from, if missing from the execution order then the next plugin will be NOT set.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "createNew: " }, { "kind": "Content", "text": "(plugins?: " }, { "kind": "Reference", "text": "IPlugin", "canonicalReference": "@microsoft/applicationinsights-core-js!IPlugin:interface" }, { "kind": "Content", "text": "[] | " }, { "kind": "Reference", "text": "ITelemetryPluginChain", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryPluginChain:interface" }, { "kind": "Content", "text": ", startAt?: " }, { "kind": "Reference", "text": "IPlugin", "canonicalReference": "@microsoft/applicationinsights-core-js!IPlugin:interface" }, { "kind": "Content", "text": ") => " }, { "kind": "Reference", "text": "IProcessTelemetryContext", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryContext:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "createNew", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 9 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryContext#processNext:member", "docComment": "/**\n * Call back for telemetry processing before it it is sent\n *\n * @param env - This is the current event being reported\n *\n * @returns boolean (true) if there is no more plugins to process otherwise false or undefined (void)\n */\n", "excerptTokens": [ { "kind": "Content", "text": "processNext: " }, { "kind": "Content", "text": "(env: " }, { "kind": "Reference", "text": "ITelemetryItem", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryItem:interface" }, { "kind": "Content", "text": ") => boolean | void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "processNext", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 4 } } ], "extendsTokenRanges": [ { "startIndex": 1, "endIndex": 2 } ] }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryUnloadContext:interface", "docComment": "/**\n * The current context for the current call to teardown() implementations, used to support when plugins are being removed or the SDK is being unloaded.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export interface IProcessTelemetryUnloadContext extends " }, { "kind": "Reference", "text": "IBaseProcessingContext", "canonicalReference": "@microsoft/applicationinsights-core-js!IBaseProcessingContext:interface" }, { "kind": "Content", "text": " " } ], "releaseTag": "Public", "name": "IProcessTelemetryUnloadContext", "members": [ { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryUnloadContext#createNew:member", "docComment": "/**\n * Create a new context using the core and config from the current instance, returns a new instance of the same type\n *\n * @param plugins - The execution order to process the plugins, if null or not supplied then the current execution order will be copied.\n *\n * @param startAt - The plugin to start processing from, if missing from the execution order then the next plugin will be NOT set.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "createNew: " }, { "kind": "Content", "text": "(plugins?: " }, { "kind": "Reference", "text": "IPlugin", "canonicalReference": "@microsoft/applicationinsights-core-js!IPlugin:interface" }, { "kind": "Content", "text": "[] | " }, { "kind": "Reference", "text": "ITelemetryPluginChain", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryPluginChain:interface" }, { "kind": "Content", "text": ", startAt?: " }, { "kind": "Reference", "text": "IPlugin", "canonicalReference": "@microsoft/applicationinsights-core-js!IPlugin:interface" }, { "kind": "Content", "text": ") => " }, { "kind": "Reference", "text": "IProcessTelemetryUnloadContext", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryUnloadContext:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "createNew", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 9 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryUnloadContext#processNext:member", "docComment": "/**\n * This Plugin has finished unloading, so unload the next one\n *\n * @param uploadState - The state of the unload process\n *\n * @returns boolean (true) if there is no more plugins to process otherwise false or undefined (void)\n */\n", "excerptTokens": [ { "kind": "Content", "text": "processNext: " }, { "kind": "Content", "text": "(unloadState: " }, { "kind": "Reference", "text": "ITelemetryUnloadState", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryUnloadState:interface" }, { "kind": "Content", "text": ") => boolean | void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "processNext", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 4 } } ], "extendsTokenRanges": [ { "startIndex": 1, "endIndex": 2 } ] }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryUpdateContext:interface", "docComment": "/**\n * The current context for the current call to the plugin update() implementations, used to support the notifications for when plugins are added, removed or the configuration was changed.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export interface IProcessTelemetryUpdateContext extends " }, { "kind": "Reference", "text": "IBaseProcessingContext", "canonicalReference": "@microsoft/applicationinsights-core-js!IBaseProcessingContext:interface" }, { "kind": "Content", "text": " " } ], "releaseTag": "Public", "name": "IProcessTelemetryUpdateContext", "members": [ { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryUpdateContext#createNew:member", "docComment": "/**\n * Create a new context using the core and config from the current instance, returns a new instance of the same type\n *\n * @param plugins - The execution order to process the plugins, if null or not supplied then the current execution order will be copied.\n *\n * @param startAt - The plugin to start processing from, if missing from the execution order then the next plugin will be NOT set.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "createNew: " }, { "kind": "Content", "text": "(plugins?: " }, { "kind": "Reference", "text": "IPlugin", "canonicalReference": "@microsoft/applicationinsights-core-js!IPlugin:interface" }, { "kind": "Content", "text": "[] | " }, { "kind": "Reference", "text": "ITelemetryPluginChain", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryPluginChain:interface" }, { "kind": "Content", "text": ", startAt?: " }, { "kind": "Reference", "text": "IPlugin", "canonicalReference": "@microsoft/applicationinsights-core-js!IPlugin:interface" }, { "kind": "Content", "text": ") => " }, { "kind": "Reference", "text": "IProcessTelemetryUpdateContext", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryUpdateContext:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "createNew", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 9 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryUpdateContext#processNext:member", "docComment": "/**\n * This Plugin has finished unloading, so unload the next one\n *\n * @param updateState - The update State\n *\n * @returns boolean (true) if there is no more plugins to process otherwise false or undefined (void)\n */\n", "excerptTokens": [ { "kind": "Content", "text": "processNext: " }, { "kind": "Content", "text": "(updateState: " }, { "kind": "Reference", "text": "ITelemetryUpdateState", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryUpdateState:interface" }, { "kind": "Content", "text": ") => boolean | void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "processNext", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 4 } } ], "extendsTokenRanges": [ { "startIndex": 1, "endIndex": 2 } ] }, { "kind": "Variable", "canonicalReference": "@microsoft/applicationinsights-core-js!isArray:var", "docComment": "/**\n * Check if an object is of type Array with optional generic T, the generic type is not validated and exists to help with TypeScript validation only.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "isArray: " }, { "kind": "Content", "text": "(obj: any) => " }, { "kind": "Reference", "text": "obj", "canonicalReference": "@microsoft/applicationinsights-core-js!~obj" }, { "kind": "Content", "text": " is " }, { "kind": "Reference", "text": "Array", "canonicalReference": "!Array:interface" }, { "kind": "Content", "text": "" } ], "releaseTag": "Public", "name": "isArray", "variableTypeTokenRange": { "startIndex": 1, "endIndex": 6 } }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!isBeaconsSupported:function(1)", "docComment": "/**\n * Checks if HTML5 Beacons are supported in the current environment.\n *\n * @returns True if supported, false otherwise.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function isBeaconsSupported(): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "isBeaconsSupported" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!isBoolean:function(1)", "docComment": "/**\n * Checks if the type of value is a boolean.\n *\n * @param value - Value to be checked. @return {boolean} True if the value is a boolean, false otherwise.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function isBoolean(value: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "value", "canonicalReference": "@microsoft/applicationinsights-core-js!~value" }, { "kind": "Content", "text": " is boolean" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 5 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "value", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "isBoolean" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!isDate:function(1)", "docComment": "/**\n * Check if an object is of type Date\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function isDate(obj: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "obj", "canonicalReference": "@microsoft/applicationinsights-core-js!~obj" }, { "kind": "Content", "text": " is " }, { "kind": "Reference", "text": "Date", "canonicalReference": "!Date:interface" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "obj", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "isDate" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!isError:function(1)", "docComment": "/**\n * Check if an object is of type Error\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function isError(obj: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "obj", "canonicalReference": "@microsoft/applicationinsights-core-js!~obj" }, { "kind": "Content", "text": " is " }, { "kind": "Reference", "text": "Error", "canonicalReference": "!Error:interface" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "obj", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "isError" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!isFetchSupported:function(1)", "docComment": "/**\n * Checks if the Fetch API is supported in the current environment.\n *\n * @param withKeepAlive - [Optional] If True, check if fetch is available and it supports the keepalive feature, otherwise only check if fetch is supported\n *\n * @returns True if supported, otherwise false\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function isFetchSupported(withKeepAlive?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "withKeepAlive", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": true } ], "name": "isFetchSupported" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!isFunction:function(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare function isFunction(value: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "value", "canonicalReference": "@microsoft/applicationinsights-core-js!~value" }, { "kind": "Content", "text": " is " }, { "kind": "Reference", "text": "Function", "canonicalReference": "!Function:interface" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "value", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "isFunction" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!isIE:function(1)", "docComment": "/**\n * Identifies whether the current environment appears to be IE\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function isIE(): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "isIE" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!isNotNullOrUndefined:function(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare function isNotNullOrUndefined(value: " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "value", "canonicalReference": "@microsoft/applicationinsights-core-js!~value" }, { "kind": "Content", "text": " is T" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 5 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "value", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "isNotNullOrUndefined" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!isNotTruthy:function(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare function isNotTruthy(value: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "value", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "isNotTruthy" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!isNotUndefined:function(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare function isNotUndefined(value: " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "value", "canonicalReference": "@microsoft/applicationinsights-core-js!~value" }, { "kind": "Content", "text": " is T" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 5 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "value", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "isNotUndefined" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!isNullOrUndefined:function(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare function isNullOrUndefined(value: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "value", "canonicalReference": "@microsoft/applicationinsights-core-js!~value" }, { "kind": "Content", "text": " is null | undefined" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 5 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "value", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "isNullOrUndefined" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!isNumber:function(1)", "docComment": "/**\n * Checks if the type of value is a number.\n *\n * @param value - Value to be checked. @return {boolean} True if the value is a number, false otherwise.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function isNumber(value: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "value", "canonicalReference": "@microsoft/applicationinsights-core-js!~value" }, { "kind": "Content", "text": " is number" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 5 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "value", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "isNumber" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!isObject:function(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare function isObject(value: " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "value", "canonicalReference": "@microsoft/applicationinsights-core-js!~value" }, { "kind": "Content", "text": " is T" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 5 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "value", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "isObject" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!isReactNative:function(1)", "docComment": "/**\n * Returns whether the environment is reporting that we are running in a React Native Environment\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function isReactNative(): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "isReactNative" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!isSafari:function(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare function isSafari(userAgentStr?: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "userAgentStr", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": true } ], "name": "isSafari" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!isString:function(1)", "docComment": "/**\n * Checks if the type of value is a string.\n *\n * @param value - Value to be checked. @return {boolean} True if the value is a string, false otherwise.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function isString(value: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "value", "canonicalReference": "@microsoft/applicationinsights-core-js!~value" }, { "kind": "Content", "text": " is string" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 5 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "value", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "isString" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!isSymbol:function(1)", "docComment": "/**\n * Checks if the type of value is a Symbol. This only returns a boolean as returning value is Symbol will cause issues for older TypeScript consumers\n *\n * @param value - Value to be checked. @return {boolean} True if the value is a Symbol, false otherwise.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function isSymbol(value: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "value", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "isSymbol" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!isTruthy:function(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare function isTruthy(value: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "value", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "isTruthy" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!isTypeof:function(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare function isTypeof(value: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ", theType: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "value", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "theType", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false } ], "name": "isTypeof" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!isUndefined:function(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare function isUndefined(value: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "value", "canonicalReference": "@microsoft/applicationinsights-core-js!~value" }, { "kind": "Content", "text": " is undefined" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 5 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "value", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "isUndefined" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!isXhrSupported:function(1)", "docComment": "/**\n * Checks if XMLHttpRequest is supported\n *\n * @returns True if supported, otherwise false\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function isXhrSupported(): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "isXhrSupported" }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryInitializerContainer:interface", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export interface ITelemetryInitializerContainer " } ], "releaseTag": "Public", "name": "ITelemetryInitializerContainer", "members": [ { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryInitializerContainer#addTelemetryInitializer:member(1)", "docComment": "/**\n * Add a telemetry processor to decorate or drop telemetry events.\n *\n * @param telemetryInitializer - The Telemetry Initializer function\n *\n * @returns - A ITelemetryInitializerHandler to enable the initializer to be removed\n */\n", "excerptTokens": [ { "kind": "Content", "text": "addTelemetryInitializer(telemetryInitializer: " }, { "kind": "Reference", "text": "TelemetryInitializerFunction", "canonicalReference": "@microsoft/applicationinsights-core-js!TelemetryInitializerFunction:type" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "ITelemetryInitializerHandler", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryInitializerHandler:interface" }, { "kind": "Content", "text": " | void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 5 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "telemetryInitializer", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "addTelemetryInitializer" } ], "extendsTokenRanges": [] }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryInitializerHandler:interface", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export interface ITelemetryInitializerHandler " } ], "releaseTag": "Public", "name": "ITelemetryInitializerHandler", "members": [ { "kind": "MethodSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryInitializerHandler#remove:member(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "remove(): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "remove" } ], "extendsTokenRanges": [] }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryItem:interface", "docComment": "/**\n * Telemety item supported in Core\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export interface ITelemetryItem " } ], "releaseTag": "Public", "name": "ITelemetryItem", "members": [ { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryItem#baseData:member", "docComment": "/**\n * Based on schema for part B\n */\n", "excerptTokens": [ { "kind": "Content", "text": "baseData?: " }, { "kind": "Content", "text": "{\n [key: string]: any;\n }" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "baseData", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryItem#baseType:member", "docComment": "/**\n * Telemetry type used for part B\n */\n", "excerptTokens": [ { "kind": "Content", "text": "baseType?: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "baseType", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryItem#data:member", "docComment": "/**\n * Custom data\n */\n", "excerptTokens": [ { "kind": "Content", "text": "data?: " }, { "kind": "Reference", "text": "ICustomProperties", "canonicalReference": "@microsoft/applicationinsights-core-js!ICustomProperties:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "data", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryItem#ext:member", "docComment": "/**\n * System context properties of the telemetry item, example: ip address, city etc\n */\n", "excerptTokens": [ { "kind": "Content", "text": "ext?: " }, { "kind": "Content", "text": "{\n [key: string]: any;\n }" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "ext", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryItem#iKey:member", "docComment": "/**\n * Identifier of the resource that uniquely identifies which resource data is sent to\n */\n", "excerptTokens": [ { "kind": "Content", "text": "iKey?: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "iKey", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryItem#name:member", "docComment": "/**\n * Unique name of the telemetry item\n */\n", "excerptTokens": [ { "kind": "Content", "text": "name: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "name", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryItem#tags:member", "docComment": "/**\n * System context property extensions that are not global (not in ctx)\n */\n", "excerptTokens": [ { "kind": "Content", "text": "tags?: " }, { "kind": "Reference", "text": "Tags", "canonicalReference": "@microsoft/applicationinsights-core-js!Tags:interface" }, { "kind": "Content", "text": " & " }, { "kind": "Reference", "text": "Tags", "canonicalReference": "@microsoft/applicationinsights-core-js!Tags:interface" }, { "kind": "Content", "text": "[]" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "tags", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 5 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryItem#time:member", "docComment": "/**\n * Timestamp when item was sent\n */\n", "excerptTokens": [ { "kind": "Content", "text": "time?: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "time", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryItem#ver:member", "docComment": "/**\n * CommonSchema Version of this SDK\n */\n", "excerptTokens": [ { "kind": "Content", "text": "ver?: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "ver", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } } ], "extendsTokenRanges": [] }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryPlugin:interface", "docComment": "/**\n * Configuration provided to SDK core\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export interface ITelemetryPlugin extends " }, { "kind": "Reference", "text": "ITelemetryProcessor", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryProcessor:interface" }, { "kind": "Content", "text": ", " }, { "kind": "Reference", "text": "IPlugin", "canonicalReference": "@microsoft/applicationinsights-core-js!IPlugin:interface" }, { "kind": "Content", "text": " " } ], "releaseTag": "Public", "name": "ITelemetryPlugin", "members": [ { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryPlugin#priority:member", "docComment": "/**\n * Priority of the extension\n */\n", "excerptTokens": [ { "kind": "Content", "text": "readonly priority: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "priority", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryPlugin#setNextPlugin:member", "docComment": "/**\n * Set next extension for telemetry processing, this is not optional as plugins should use the processNext() function of the passed IProcessTelemetryContext instead. It is being kept for now for backward compatibility only.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "setNextPlugin?: " }, { "kind": "Content", "text": "(next: " }, { "kind": "Reference", "text": "ITelemetryPlugin", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryPlugin:interface" }, { "kind": "Content", "text": " | " }, { "kind": "Reference", "text": "ITelemetryPluginChain", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryPluginChain:interface" }, { "kind": "Content", "text": ") => void" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "setNextPlugin", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 6 } } ], "extendsTokenRanges": [ { "startIndex": 1, "endIndex": 2 }, { "startIndex": 3, "endIndex": 4 } ] }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryPluginChain:interface", "docComment": "/**\n * Configuration provided to SDK core\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export interface ITelemetryPluginChain extends " }, { "kind": "Reference", "text": "ITelemetryProcessor", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryProcessor:interface" }, { "kind": "Content", "text": " " } ], "releaseTag": "Public", "name": "ITelemetryPluginChain", "members": [ { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryPluginChain#getNext:member", "docComment": "/**\n * Returns the next plugin\n */\n", "excerptTokens": [ { "kind": "Content", "text": "getNext: " }, { "kind": "Content", "text": "() => " }, { "kind": "Reference", "text": "ITelemetryPluginChain", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryPluginChain:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "getNext", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 3 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryPluginChain#getPlugin:member", "docComment": "/**\n * Returns the underlying plugin that is being proxied for the processTelemetry call\n */\n", "excerptTokens": [ { "kind": "Content", "text": "getPlugin: " }, { "kind": "Content", "text": "() => " }, { "kind": "Reference", "text": "ITelemetryPlugin", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryPlugin:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "getPlugin", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 3 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryPluginChain#unload:member", "docComment": "/**\n * This plugin is being unloaded and should remove any hooked events and cleanup any global/scoped values, after this call the plugin will be removed from the telemetry processing chain and will no longer receive any events..\n *\n * @param unloadCtx - The unload context to use for this call.\n *\n * @param unloadState - The details of the unload operation\n */\n", "excerptTokens": [ { "kind": "Content", "text": "unload?: " }, { "kind": "Content", "text": "(unloadCtx: " }, { "kind": "Reference", "text": "IProcessTelemetryUnloadContext", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryUnloadContext:interface" }, { "kind": "Content", "text": ", unloadState: " }, { "kind": "Reference", "text": "ITelemetryUnloadState", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryUnloadState:interface" }, { "kind": "Content", "text": ") => void" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "unload", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 6 } } ], "extendsTokenRanges": [ { "startIndex": 1, "endIndex": 2 } ] }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryUnloadState:interface", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export interface ITelemetryUnloadState " } ], "releaseTag": "Public", "name": "ITelemetryUnloadState", "members": [ { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryUnloadState#flushComplete:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "flushComplete?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "flushComplete", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryUnloadState#isAsync:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "isAsync: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "isAsync", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryUnloadState#reason:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "reason: " }, { "kind": "Reference", "text": "TelemetryUnloadReason", "canonicalReference": "@microsoft/applicationinsights-core-js!TelemetryUnloadReason:enum" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "reason", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } } ], "extendsTokenRanges": [] }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryUpdateState:interface", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export interface ITelemetryUpdateState " } ], "releaseTag": "Public", "name": "ITelemetryUpdateState", "members": [ { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryUpdateState#added:member", "docComment": "/**\n * This holds a collection of plugins that have been added (if the reason identifies that one or more plugins have been added)\n */\n", "excerptTokens": [ { "kind": "Content", "text": "added?: " }, { "kind": "Reference", "text": "IPlugin", "canonicalReference": "@microsoft/applicationinsights-core-js!IPlugin:interface" }, { "kind": "Content", "text": "[]" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "added", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 3 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryUpdateState#reason:member", "docComment": "/**\n * Identifies the reason for the update notification, this is a bitwise numeric value\n */\n", "excerptTokens": [ { "kind": "Content", "text": "reason: " }, { "kind": "Reference", "text": "TelemetryUpdateReason", "canonicalReference": "@microsoft/applicationinsights-core-js!TelemetryUpdateReason:enum" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "reason", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryUpdateState#removed:member", "docComment": "/**\n * This holds a collection of plugins that have been removed (if the reason identifies that one or more plugins have been removed)\n */\n", "excerptTokens": [ { "kind": "Content", "text": "removed?: " }, { "kind": "Reference", "text": "IPlugin", "canonicalReference": "@microsoft/applicationinsights-core-js!IPlugin:interface" }, { "kind": "Content", "text": "[]" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "removed", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 3 } } ], "extendsTokenRanges": [] }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!IUnloadableComponent:interface", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export interface IUnloadableComponent " } ], "releaseTag": "Public", "name": "IUnloadableComponent", "members": [ { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IUnloadableComponent#_doUnload:member", "docComment": "/**\n * Teardown / Unload hook to allow implementations to perform some additional unload operations before the BaseTelemetryPlugin finishes it's removal.\n *\n * @param unloadCtx - This is the context that should be used during unloading.\n *\n * @param unloadState - The details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.\n *\n * @param asyncCallback - An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async unload/teardown operations.\n *\n * @returns boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "_doUnload?: " }, { "kind": "Content", "text": "(unloadCtx?: " }, { "kind": "Reference", "text": "IProcessTelemetryUnloadContext", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryUnloadContext:interface" }, { "kind": "Content", "text": ", unloadState?: " }, { "kind": "Reference", "text": "ITelemetryUnloadState", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryUnloadState:interface" }, { "kind": "Content", "text": ", asyncCallback?: () => void) => void | boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "_doUnload", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 6 } } ], "extendsTokenRanges": [] }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!IUnloadHandlerContainer:interface", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export interface IUnloadHandlerContainer " } ], "releaseTag": "Public", "name": "IUnloadHandlerContainer", "members": [ { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IUnloadHandlerContainer#add:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "add: " }, { "kind": "Content", "text": "(handler: " }, { "kind": "Reference", "text": "UnloadHandler", "canonicalReference": "@microsoft/applicationinsights-core-js!UnloadHandler:type" }, { "kind": "Content", "text": ") => void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "add", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 4 } }, { "kind": "PropertySignature", "canonicalReference": "@microsoft/applicationinsights-core-js!IUnloadHandlerContainer#run:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "run: " }, { "kind": "Content", "text": "(itemCtx: " }, { "kind": "Reference", "text": "IProcessTelemetryUnloadContext", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryUnloadContext:interface" }, { "kind": "Content", "text": ", unloadState: " }, { "kind": "Reference", "text": "ITelemetryUnloadState", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryUnloadState:interface" }, { "kind": "Content", "text": ") => void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "run", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 6 } } ], "extendsTokenRanges": [] }, { "kind": "TypeAlias", "canonicalReference": "@microsoft/applicationinsights-core-js!LoggingSeverity:type", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare type LoggingSeverity = " }, { "kind": "Content", "text": "number | " }, { "kind": "Reference", "text": "eLoggingSeverity", "canonicalReference": "@microsoft/applicationinsights-core-js!eLoggingSeverity:enum" }, { "kind": "Content", "text": ";" } ], "releaseTag": "Public", "name": "LoggingSeverity", "typeTokenRange": { "startIndex": 1, "endIndex": 3 } }, { "kind": "Variable", "canonicalReference": "@microsoft/applicationinsights-core-js!LoggingSeverity:var", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "LoggingSeverity: " }, { "kind": "Content", "text": "import(\"../JavaScriptSDK.Enums/EnumHelperFuncs\")." }, { "kind": "Reference", "text": "EnumValue", "canonicalReference": "@microsoft/applicationinsights-core-js!EnumValue:type" }, { "kind": "Content", "text": "" } ], "releaseTag": "Public", "name": "LoggingSeverity", "variableTypeTokenRange": { "startIndex": 1, "endIndex": 6 } }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!mergeEvtNamespace:function(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare function mergeEvtNamespace(theNamespace: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ", namespaces?: " }, { "kind": "Content", "text": "string | string[] | null" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "string | string[]" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "theNamespace", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "namespaces", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": true } ], "name": "mergeEvtNamespace" }, { "kind": "Variable", "canonicalReference": "@microsoft/applicationinsights-core-js!MinChannelPriorty:var", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "MinChannelPriorty: " }, { "kind": "Content", "text": "number" } ], "releaseTag": "Public", "name": "MinChannelPriorty", "variableTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!mwcRandom32:function(1)", "docComment": "/**\n * Generate a random 32-bit number between (0x000000..0xFFFFFFFF) or (-0x80000000..0x7FFFFFFF), using MWC (Multiply with carry) instead of Math.random() defaults to un-signed. Used as a replacement random generator for IE to avoid issues with older IE instances.\n *\n * @param signed - True to return a signed 32-bit number (-0x80000000..0x7FFFFFFF) otherwise an unsigned one (0x000000..0xFFFFFFFF)\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function mwcRandom32(signed?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "signed", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": true } ], "name": "mwcRandom32" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!mwcRandomSeed:function(1)", "docComment": "/**\n * Seed the MWC random number generator with the specified seed or a random value\n *\n * @param value - optional the number to used as the seed, if undefined, null or zero a random value will be chosen\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function mwcRandomSeed(value?: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "value", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": true } ], "name": "mwcRandomSeed" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!newGuid:function(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare function newGuid(): " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "newGuid" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!newId:function(1)", "docComment": "/**\n * Generate random base64 id string. The default length is 22 which is 132-bits so almost the same as a GUID but as base64 (the previous default was 5)\n *\n * @param maxLength - Optional value to specify the length of the id to be generated, defaults to 22\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function newId(maxLength?: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "maxLength", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": true } ], "name": "newId" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!normalizeJsName:function(1)", "docComment": "/**\n * Validates that the string name conforms to the JS IdentifierName specification and if not normalizes the name so that it would. This method does not identify or change any keywords meaning that if you pass in a known keyword the same value will be returned. This is a simplified version\n *\n * @param name - The name to validate\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function normalizeJsName(name: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "name", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "normalizeJsName" }, { "kind": "Class", "canonicalReference": "@microsoft/applicationinsights-core-js!NotificationManager:class", "docComment": "/**\n * Class to manage sending notifications to all the listeners.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare class NotificationManager implements " }, { "kind": "Reference", "text": "INotificationManager", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationManager:interface" }, { "kind": "Content", "text": " " } ], "releaseTag": "Public", "name": "NotificationManager", "members": [ { "kind": "Constructor", "canonicalReference": "@microsoft/applicationinsights-core-js!NotificationManager:constructor(1)", "docComment": "/**\n * Constructs a new instance of the `NotificationManager` class\n */\n", "excerptTokens": [ { "kind": "Content", "text": "constructor(config?: " }, { "kind": "Reference", "text": "IConfiguration", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration:interface" }, { "kind": "Content", "text": ");" } ], "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "config", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": true } ] }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!NotificationManager#addNotificationListener:member(1)", "docComment": "/**\n * Adds a notification listener.\n *\n * @param listener - The notification listener to be added.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "addNotificationListener(listener: " }, { "kind": "Reference", "text": "INotificationListener", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationListener:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "listener", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "addNotificationListener" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!NotificationManager#eventsDiscarded:member(1)", "docComment": "/**\n * Notification for events being discarded.\n *\n * @param events - The array of events that have been discarded by the SDK.\n *\n * @param reason - The reason for which the SDK discarded the events. The EventsDiscardedReason constant should be used to check the different values.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "eventsDiscarded(events: " }, { "kind": "Reference", "text": "ITelemetryItem", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryItem:interface" }, { "kind": "Content", "text": "[]" }, { "kind": "Content", "text": ", reason: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 6, "endIndex": 7 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "events", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "isOptional": false }, { "parameterName": "reason", "parameterTypeTokenRange": { "startIndex": 4, "endIndex": 5 }, "isOptional": false } ], "name": "eventsDiscarded" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!NotificationManager#eventsSendRequest:member(1)", "docComment": "/**\n * [Optional] A function called when the events have been requested to be sent to the sever.\n *\n * @param sendReason - The reason why the event batch is being sent.\n *\n * @param isAsync - A flag which identifies whether the requests are being sent in an async or sync manner.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "eventsSendRequest?(sendReason: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ", isAsync: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "isStatic": false, "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "sendReason", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "isAsync", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false } ], "name": "eventsSendRequest" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!NotificationManager#eventsSent:member(1)", "docComment": "/**\n * Notification for events sent.\n *\n * @param events - The array of events that have been sent.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "eventsSent(events: " }, { "kind": "Reference", "text": "ITelemetryItem", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryItem:interface" }, { "kind": "Content", "text": "[]" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 4, "endIndex": 5 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "events", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "isOptional": false } ], "name": "eventsSent" }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!NotificationManager#listeners:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "listeners: " }, { "kind": "Reference", "text": "INotificationListener", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationListener:interface" }, { "kind": "Content", "text": "[]" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "listeners", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "isStatic": false }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!NotificationManager#perfEvent:member(1)", "docComment": "/**\n * [Optional] This event is sent if you have enabled perf events, they are primarily used to track internal performance testing and debugging the event can be displayed via the debug plugin extension.\n *\n * @param perfEvent - \n */\n", "excerptTokens": [ { "kind": "Content", "text": "perfEvent?(perfEvent: " }, { "kind": "Reference", "text": "IPerfEvent", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfEvent:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "isStatic": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "perfEvent", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "perfEvent" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!NotificationManager#removeNotificationListener:member(1)", "docComment": "/**\n * Removes all instances of the listener.\n *\n * @param listener - AWTNotificationListener to remove.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "removeNotificationListener(listener: " }, { "kind": "Reference", "text": "INotificationListener", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationListener:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "listener", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "removeNotificationListener" } ], "implementsTokenRanges": [ { "startIndex": 1, "endIndex": 2 } ] }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!objDefineAccessors:function(1)", "docComment": "/**\n * Try to define get/set object property accessors for the target object/prototype, this will provide compatibility with existing API definition when run within an ES5+ container that supports accessors but still enable the code to be loaded and executed in an ES3 container, providing basic IE8 compatibility.\n *\n * @param target - The object on which to define the property.\n *\n * @param prop - The name of the property to be defined or modified.\n *\n * @param getProp - The getter function to wire against the getter.\n *\n * @param setProp - The setter function to wire against the setter.\n *\n * @returns True if it was able to create the accessors otherwise false\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function objDefineAccessors(target: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ", prop: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ", getProp?: " }, { "kind": "Content", "text": "() => T" }, { "kind": "Content", "text": ", setProp?: " }, { "kind": "Content", "text": "(v: T) => void" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 9, "endIndex": 10 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "target", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "prop", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "getProp", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": true }, { "parameterName": "setProp", "parameterTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "isOptional": true } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "objDefineAccessors" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!objExtend:function(1)", "docComment": "/**\n * Pass in the objects to merge as arguments, this will only \"merge\" (extend) properties that are owned by the object. It will NOT merge inherited or non-enumerable properties.\n *\n * @param obj1 - object to merge. Set this argument to 'true' for a deep extend.\n *\n * @param obj2 - object to merge.\n *\n * @param obj3 - object to merge.\n *\n * @param obj4 - object to merge.\n *\n * @param obj5 - object to merge.\n *\n * @returns The extended first object.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function objExtend(deepExtend?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ", obj2?: " }, { "kind": "Content", "text": "T2" }, { "kind": "Content", "text": ", obj3?: " }, { "kind": "Content", "text": "T3" }, { "kind": "Content", "text": ", obj4?: " }, { "kind": "Content", "text": "T4" }, { "kind": "Content", "text": ", obj5?: " }, { "kind": "Content", "text": "T5" }, { "kind": "Content", "text": ", obj6?: " }, { "kind": "Content", "text": "T6" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "T2 & T3 & T4 & T5 & T6" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 13, "endIndex": 14 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "deepExtend", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": true }, { "parameterName": "obj2", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": true }, { "parameterName": "obj3", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": true }, { "parameterName": "obj4", "parameterTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "isOptional": true }, { "parameterName": "obj5", "parameterTypeTokenRange": { "startIndex": 9, "endIndex": 10 }, "isOptional": true }, { "parameterName": "obj6", "parameterTypeTokenRange": { "startIndex": 11, "endIndex": 12 }, "isOptional": true } ], "typeParameters": [ { "typeParameterName": "T2", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } }, { "typeParameterName": "T3", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } }, { "typeParameterName": "T4", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } }, { "typeParameterName": "T5", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } }, { "typeParameterName": "T6", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "objExtend" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!objExtend:function(2)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare function objExtend(obj1?: " }, { "kind": "Content", "text": "T1" }, { "kind": "Content", "text": ", obj2?: " }, { "kind": "Content", "text": "T2" }, { "kind": "Content", "text": ", obj3?: " }, { "kind": "Content", "text": "T3" }, { "kind": "Content", "text": ", obj4?: " }, { "kind": "Content", "text": "T4" }, { "kind": "Content", "text": ", obj5?: " }, { "kind": "Content", "text": "T5" }, { "kind": "Content", "text": ", obj6?: " }, { "kind": "Content", "text": "T6" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "T1 & T2 & T3 & T4 & T5 & T6" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 13, "endIndex": 14 }, "releaseTag": "Public", "overloadIndex": 2, "parameters": [ { "parameterName": "obj1", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": true }, { "parameterName": "obj2", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": true }, { "parameterName": "obj3", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": true }, { "parameterName": "obj4", "parameterTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "isOptional": true }, { "parameterName": "obj5", "parameterTypeTokenRange": { "startIndex": 9, "endIndex": 10 }, "isOptional": true }, { "parameterName": "obj6", "parameterTypeTokenRange": { "startIndex": 11, "endIndex": 12 }, "isOptional": true } ], "typeParameters": [ { "typeParameterName": "T1", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } }, { "typeParameterName": "T2", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } }, { "typeParameterName": "T3", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } }, { "typeParameterName": "T4", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } }, { "typeParameterName": "T5", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } }, { "typeParameterName": "T6", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "objExtend" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!objForEachKey:function(1)", "docComment": "/**\n * This is a helper function for the equivalent of arForEach(objKeys(target), callbackFn), this is a performance optimization to avoid the creation of a new array for large objects\n *\n * @param target - The target object to find and process the keys\n *\n * @param callbackfn - The function to call with the details\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function objForEachKey(target: " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": ", callbackfn: " }, { "kind": "Content", "text": "(name: string, value: T[keyof T]) => void" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "target", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "callbackfn", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": false } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 1, "endIndex": 2 } } ], "name": "objForEachKey" }, { "kind": "Variable", "canonicalReference": "@microsoft/applicationinsights-core-js!objFreeze:var", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "objFreeze: " }, { "kind": "Content", "text": "(value: T) => T" } ], "releaseTag": "Public", "name": "objFreeze", "variableTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!objKeys:function(1)", "docComment": "/**\n * Returns the names of the enumerable string properties and methods of an object. This helper exists to avoid adding a polyfil for older browsers that do not define Object.keys eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation. Note: For consistency this will not use the Object.keys implementation if it exists as this would cause a testing requirement to test with and without the implementations\n *\n * @param obj - Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function objKeys(obj: " }, { "kind": "Content", "text": "{}" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "string[]" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "obj", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "objKeys" }, { "kind": "Variable", "canonicalReference": "@microsoft/applicationinsights-core-js!objSeal:var", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "objSeal: " }, { "kind": "Content", "text": "(value: T) => T" } ], "releaseTag": "Public", "name": "objSeal", "variableTypeTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!objToString:function(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare function objToString(obj: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "obj", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "objToString" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!optimizeObject:function(1)", "docComment": "/**\n * A helper function to assist with JIT performance for objects that have properties added / removed dynamically this is primarily for chromium based browsers and has limited effects on Firefox and none of IE. Only call this function after you have finished \"updating\" the object, calling this within loops reduces or defeats the benefits. This helps when iterating using for..in, objKeys() and objForEach()\n *\n * @param theObject - The object to be optimized if possible\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function optimizeObject(theObject: " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "theObject", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "optimizeObject" }, { "kind": "Class", "canonicalReference": "@microsoft/applicationinsights-core-js!PerfEvent:class", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare class PerfEvent implements " }, { "kind": "Reference", "text": "IPerfEvent", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfEvent:interface" }, { "kind": "Content", "text": " " } ], "releaseTag": "Public", "name": "PerfEvent", "members": [ { "kind": "Constructor", "canonicalReference": "@microsoft/applicationinsights-core-js!PerfEvent:constructor(1)", "docComment": "/**\n * Constructs a new instance of the `PerfEvent` class\n */\n", "excerptTokens": [ { "kind": "Content", "text": "constructor(name: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ", payloadDetails: " }, { "kind": "Content", "text": "() => any" }, { "kind": "Content", "text": ", isAsync: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ");" } ], "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "name", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "payloadDetails", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "isAsync", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": false } ] }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!PerfEvent.ChildrenContextKey:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "static ChildrenContextKey: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "ChildrenContextKey", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": true }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!PerfEvent#complete:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "complete: " }, { "kind": "Content", "text": "() => void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "complete", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!PerfEvent#exTime:member", "docComment": "/**\n * Identifies the exclusive time spent in for this event (not including child events), this will be undefined until the event is completed.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "exTime?: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "exTime", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!PerfEvent#getCtx:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "getCtx?: " }, { "kind": "Content", "text": "(key: string) => any | null | undefined" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "getCtx", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!PerfEvent#isAsync:member", "docComment": "/**\n * Is this occurring from an asynchronous event\n */\n", "excerptTokens": [ { "kind": "Content", "text": "isAsync: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "isAsync", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!PerfEvent#isChildEvt:member", "docComment": "/**\n * Identifies whether this event is a child event of a parent\n */\n", "excerptTokens": [ { "kind": "Content", "text": "isChildEvt: " }, { "kind": "Content", "text": "() => boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "isChildEvt", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!PerfEvent#name:member", "docComment": "/**\n * The name of the event\n */\n", "excerptTokens": [ { "kind": "Content", "text": "name: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "name", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!PerfEvent.ParentContextKey:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "static ParentContextKey: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "ParentContextKey", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": true }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!PerfEvent#payload:member", "docComment": "/**\n * The payload (contents) of the perfEvent, may be null or only set after the event has completed depending on the runtime environment.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "payload: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "payload", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!PerfEvent#setCtx:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "setCtx?: " }, { "kind": "Content", "text": "(key: string, value: any) => void" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "setCtx", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!PerfEvent#start:member", "docComment": "/**\n * The start time of the event in ms\n */\n", "excerptTokens": [ { "kind": "Content", "text": "start: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "start", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!PerfEvent#time:member", "docComment": "/**\n * Identifies the total inclusive time spent for this event, including the time spent for child events, this will be undefined until the event is completed\n */\n", "excerptTokens": [ { "kind": "Content", "text": "time?: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ";" } ], "isOptional": true, "releaseTag": "Public", "name": "time", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false } ], "implementsTokenRanges": [ { "startIndex": 1, "endIndex": 2 } ] }, { "kind": "Class", "canonicalReference": "@microsoft/applicationinsights-core-js!PerfManager:class", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare class PerfManager implements " }, { "kind": "Reference", "text": "IPerfManager", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfManager:interface" }, { "kind": "Content", "text": " " } ], "releaseTag": "Public", "name": "PerfManager", "members": [ { "kind": "Constructor", "canonicalReference": "@microsoft/applicationinsights-core-js!PerfManager:constructor(1)", "docComment": "/**\n * Constructs a new instance of the `PerfManager` class\n */\n", "excerptTokens": [ { "kind": "Content", "text": "constructor(manager?: " }, { "kind": "Reference", "text": "INotificationManager", "canonicalReference": "@microsoft/applicationinsights-core-js!INotificationManager:interface" }, { "kind": "Content", "text": ");" } ], "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "manager", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": true } ] }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!PerfManager#create:member(1)", "docComment": "/**\n * Create a new event and start timing, the manager may return null/undefined to indicate that it does not want to monitor this source event.\n *\n * @param src - The source name of the event\n *\n * @param payloadDetails - An optional callback function to fetch the payload details for the event.\n *\n * @param isAsync - Is the event occurring from a async event\n */\n", "excerptTokens": [ { "kind": "Content", "text": "create(src: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ", payload?: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ", isAsync?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "IPerfEvent", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfEvent:interface" }, { "kind": "Content", "text": " | null | undefined" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 7, "endIndex": 9 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "src", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "payload", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": true }, { "parameterName": "isAsync", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": true } ], "name": "create" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!PerfManager#fire:member(1)", "docComment": "/**\n * Complete the perfEvent and fire any notifications.\n *\n * @param perfEvent - Fire the event which will also complete the passed event\n */\n", "excerptTokens": [ { "kind": "Content", "text": "fire(perfEvent: " }, { "kind": "Reference", "text": "IPerfEvent", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfEvent:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "perfEvent", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "fire" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!PerfManager#getCtx:member(1)", "docComment": "/**\n * Get the execution context value\n *\n * @param key - The context key\n */\n", "excerptTokens": [ { "kind": "Content", "text": "getCtx(key: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "key", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "getCtx" }, { "kind": "Method", "canonicalReference": "@microsoft/applicationinsights-core-js!PerfManager#setCtx:member(1)", "docComment": "/**\n * Set an execution context value\n *\n * @param key - The context key name\n *\n * @param value - The value\n */\n", "excerptTokens": [ { "kind": "Content", "text": "setCtx(key: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ", value: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "isStatic": false, "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "key", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "value", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false } ], "name": "setCtx" } ], "implementsTokenRanges": [ { "startIndex": 1, "endIndex": 2 } ] }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!perfNow:function(1)", "docComment": "/**\n * Return the current value of the Performance Api now() function (if available) and fallback to dateNow() if it is unavailable (IE9 or less) https://caniuse.com/#search=performance.now\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function perfNow(): " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "perfNow" }, { "kind": "Class", "canonicalReference": "@microsoft/applicationinsights-core-js!ProcessTelemetryContext:class", "docComment": "/**\n * This class will be removed!\n *\n * @deprecated\n *\n * use createProcessTelemetryContext() instead\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare class ProcessTelemetryContext implements " }, { "kind": "Reference", "text": "IProcessTelemetryContext", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryContext:interface" }, { "kind": "Content", "text": " " } ], "releaseTag": "Public", "name": "ProcessTelemetryContext", "members": [ { "kind": "Constructor", "canonicalReference": "@microsoft/applicationinsights-core-js!ProcessTelemetryContext:constructor(1)", "docComment": "/**\n * Creates a new Telemetry Item context with the current config, core and plugin execution chain\n *\n * @param plugins - The plugin instances that will be executed\n *\n * @param config - The current config\n *\n * @param core - The current core instance\n */\n", "excerptTokens": [ { "kind": "Content", "text": "constructor(pluginChain: " }, { "kind": "Reference", "text": "ITelemetryPluginChain", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryPluginChain:interface" }, { "kind": "Content", "text": ", config: " }, { "kind": "Reference", "text": "IConfiguration", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration:interface" }, { "kind": "Content", "text": ", core: " }, { "kind": "Reference", "text": "IAppInsightsCore", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore:interface" }, { "kind": "Content", "text": ", startAt?: " }, { "kind": "Reference", "text": "IPlugin", "canonicalReference": "@microsoft/applicationinsights-core-js!IPlugin:interface" }, { "kind": "Content", "text": ");" } ], "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "pluginChain", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "config", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "core", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": false }, { "parameterName": "startAt", "parameterTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "isOptional": true } ] }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!ProcessTelemetryContext#core:member", "docComment": "/**\n * Returns the IAppInsightsCore instance for the current request\n */\n", "excerptTokens": [ { "kind": "Content", "text": "core: " }, { "kind": "Content", "text": "() => " }, { "kind": "Reference", "text": "IAppInsightsCore", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "core", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "isStatic": false }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!ProcessTelemetryContext#createNew:member", "docComment": "/**\n * Create a new context using the core and config from the current instance\n *\n * @param plugins - The execution order to process the plugins, if null or not supplied then the current execution order will be copied.\n *\n * @param startAt - The plugin to start processing from, if missing from the execution order then the next plugin will be NOT set.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "createNew: " }, { "kind": "Content", "text": "(plugins?: " }, { "kind": "Reference", "text": "IPlugin", "canonicalReference": "@microsoft/applicationinsights-core-js!IPlugin:interface" }, { "kind": "Content", "text": "[] | " }, { "kind": "Reference", "text": "ITelemetryPluginChain", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryPluginChain:interface" }, { "kind": "Content", "text": ", startAt?: " }, { "kind": "Reference", "text": "IPlugin", "canonicalReference": "@microsoft/applicationinsights-core-js!IPlugin:interface" }, { "kind": "Content", "text": ") => " }, { "kind": "Reference", "text": "IProcessTelemetryContext", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryContext:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "createNew", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 9 }, "isStatic": false }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!ProcessTelemetryContext#diagLog:member", "docComment": "/**\n * Returns the current IDiagnosticsLogger for the current request\n */\n", "excerptTokens": [ { "kind": "Content", "text": "diagLog: " }, { "kind": "Content", "text": "() => " }, { "kind": "Reference", "text": "IDiagnosticLogger", "canonicalReference": "@microsoft/applicationinsights-core-js!IDiagnosticLogger:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "diagLog", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "isStatic": false }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!ProcessTelemetryContext#getCfg:member", "docComment": "/**\n * Gets the current core config instance\n */\n", "excerptTokens": [ { "kind": "Content", "text": "getCfg: " }, { "kind": "Content", "text": "() => " }, { "kind": "Reference", "text": "IConfiguration", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "getCfg", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "isStatic": false }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!ProcessTelemetryContext#getConfig:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "getConfig: " }, { "kind": "Content", "text": "(identifier: string, field: string, defaultValue?: number | string | boolean | string[] | " }, { "kind": "Reference", "text": "RegExp", "canonicalReference": "!RegExp:interface" }, { "kind": "Content", "text": "[] | " }, { "kind": "Reference", "text": "Function", "canonicalReference": "!Function:interface" }, { "kind": "Content", "text": ") => number | string | boolean | string[] | " }, { "kind": "Reference", "text": "RegExp", "canonicalReference": "!RegExp:interface" }, { "kind": "Content", "text": "[] | " }, { "kind": "Reference", "text": "Function", "canonicalReference": "!Function:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "getConfig", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 9 }, "isStatic": false }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!ProcessTelemetryContext#getExtCfg:member", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "getExtCfg: " }, { "kind": "Content", "text": "(identifier: string, defaultValue?: T | any) => T" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "getExtCfg", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!ProcessTelemetryContext#getNext:member", "docComment": "/**\n * Returns the next configured plugin proxy\n */\n", "excerptTokens": [ { "kind": "Content", "text": "getNext: " }, { "kind": "Content", "text": "() => " }, { "kind": "Reference", "text": "ITelemetryPluginChain", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryPluginChain:interface" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "getNext", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 3 }, "isStatic": false }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!ProcessTelemetryContext#hasNext:member", "docComment": "/**\n * Helper to allow inherited classes to check and possibly shortcut executing code only required if there is a nextPlugin\n */\n", "excerptTokens": [ { "kind": "Content", "text": "hasNext: " }, { "kind": "Content", "text": "() => boolean" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "hasNext", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!ProcessTelemetryContext#iterate:member", "docComment": "/**\n * Synchronously iterate over the context chain running the callback for each plugin, once every plugin has been executed via the callback, any associated onComplete will be called.\n *\n * @param callback - The function call for each plugin in the context chain\n */\n", "excerptTokens": [ { "kind": "Content", "text": "iterate: " }, { "kind": "Content", "text": "(callback: (plugin: T) => void) => void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "iterate", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 6 }, "isStatic": false }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!ProcessTelemetryContext#onComplete:member", "docComment": "/**\n * Set the function to call when the current chain has executed all processNext or unloadNext items.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "onComplete: " }, { "kind": "Content", "text": "(onComplete: () => void) => void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "onComplete", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isStatic": false }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!ProcessTelemetryContext#processNext:member", "docComment": "/**\n * Call back for telemetry processing before it it is sent\n *\n * @param env - This is the current event being reported\n *\n * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances can optionally use this to access the current core instance or define / pass additional information to later plugins (vs appending items to the telemetry item)\n *\n * @returns boolean (true) if there is no more plugins to process otherwise false or undefined (void)\n */\n", "excerptTokens": [ { "kind": "Content", "text": "processNext: " }, { "kind": "Content", "text": "(env: " }, { "kind": "Reference", "text": "ITelemetryItem", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryItem:interface" }, { "kind": "Content", "text": ") => boolean | void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "processNext", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 4 }, "isStatic": false }, { "kind": "Property", "canonicalReference": "@microsoft/applicationinsights-core-js!ProcessTelemetryContext#setNext:member", "docComment": "/**\n * Helper to set the next plugin proxy\n */\n", "excerptTokens": [ { "kind": "Content", "text": "setNext: " }, { "kind": "Content", "text": "(nextCtx: " }, { "kind": "Reference", "text": "ITelemetryPluginChain", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryPluginChain:interface" }, { "kind": "Content", "text": ") => void" }, { "kind": "Content", "text": ";" } ], "isOptional": false, "releaseTag": "Public", "name": "setNext", "propertyTypeTokenRange": { "startIndex": 1, "endIndex": 4 }, "isStatic": false } ], "implementsTokenRanges": [ { "startIndex": 1, "endIndex": 2 } ] }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!proxyAssign:function(1)", "docComment": "/**\n * Effectively assigns all enumerable properties (not just own properties) and functions (including inherited prototype) from the source object to the target, it attempts to use proxy getters / setters (if possible) and proxy functions to avoid potential implementation issues by assigning prototype functions as instance ones\n *\n * This method is the primary method used to \"update\" the snippet proxy with the ultimate implementations.\n *\n * Special ES3 Notes: Updates (setting) of direct property values on the target or indirectly on the source object WILL NOT WORK PROPERLY, updates to the properties of \"referenced\" object will work (target.context.newValue = 10 => will be reflected in the source.context as it's the same object). ES3 Failures: assigning target.myProp = 3 -> Won't change source.myProp = 3, likewise the reverse would also fail.\n *\n * @param target - The target object to be assigned with the source properties and functions\n *\n * @param source - The source object which will be assigned / called by setting / calling the targets proxies\n *\n * @param chkSet - An optional callback to determine whether a specific property/function should be proxied\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function proxyAssign(target: " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": ", source: " }, { "kind": "Content", "text": "S" }, { "kind": "Content", "text": ", chkSet?: " }, { "kind": "Content", "text": "(name: string, isFunc?: boolean, source?: S, target?: T) => boolean" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "target", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "source", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "chkSet", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": true } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } }, { "typeParameterName": "S", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "proxyAssign" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!proxyFunctionAs:function(1)", "docComment": "/**\n * Creates a proxy function on the target which internally will call the source version with all arguments passed to the target method.\n *\n * @param target - The target object to be assigned with the source properties and functions\n *\n * @param name - The function name that will be added on the target\n *\n * @param source - The source object which will be assigned / called by setting / calling the targets proxies\n *\n * @param theFunc - The function name on the source that will be proxied on the target\n *\n * @param overwriteTarget - If `false` this will not replace any pre-existing name otherwise (the default) it will overwrite any existing name\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function proxyFunctionAs(target: " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": ", name: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ", source: " }, { "kind": "Content", "text": "S | (() => S)" }, { "kind": "Content", "text": ", theFunc: " }, { "kind": "Content", "text": "(keyof S)" }, { "kind": "Content", "text": ", overwriteTarget?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 11, "endIndex": 12 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "target", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "name", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "source", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": false }, { "parameterName": "theFunc", "parameterTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "isOptional": false }, { "parameterName": "overwriteTarget", "parameterTypeTokenRange": { "startIndex": 9, "endIndex": 10 }, "isOptional": true } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } }, { "typeParameterName": "S", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "proxyFunctionAs" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!proxyFunctions:function(1)", "docComment": "/**\n * Creates proxy functions on the target which internally will call the source version with all arguments passed to the target method.\n *\n * @param target - The target object to be assigned with the source properties and functions\n *\n * @param source - The source object which will be assigned / called by setting / calling the targets proxies\n *\n * @param functionsToProxy - An array of function names that will be proxied on the target\n *\n * @param overwriteTarget - If false this will not replace any pre-existing name otherwise (the default) it will overwrite any existing name\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function proxyFunctions(target: " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": ", source: " }, { "kind": "Content", "text": "S | (() => S)" }, { "kind": "Content", "text": ", functionsToProxy: " }, { "kind": "Content", "text": "(keyof S)[]" }, { "kind": "Content", "text": ", overwriteTarget?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 9, "endIndex": 10 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "target", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "source", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "functionsToProxy", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": false }, { "parameterName": "overwriteTarget", "parameterTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "isOptional": true } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } }, { "typeParameterName": "S", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "proxyFunctions" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!random32:function(1)", "docComment": "/**\n * generate a random 32-bit number (0x000000..0xFFFFFFFF) or (-0x80000000..0x7FFFFFFF), defaults un-unsigned.\n *\n * @param signed - True to return a signed 32-bit number (-0x80000000..0x7FFFFFFF) otherwise an unsigned one (0x000000..0xFFFFFFFF)\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function random32(signed?: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "signed", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": true } ], "name": "random32" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!randomValue:function(1)", "docComment": "/**\n * Generate a random value between 0 and maxValue, max value should be limited to a 32-bit maximum. So maxValue(16) will produce a number from 0..16 (range of 17)\n *\n * @param maxValue - \n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function randomValue(maxValue: " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "number" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "maxValue", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "randomValue" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!removeEventHandler:function(1)", "docComment": "/**\n * Trys to remove event handler(s) for the specified event/namespace to the window, body and document\n *\n * @param eventName - The name of the event, with optional namespaces or just the namespaces, such as \"click\", \"click.mynamespace\" or \".mynamespace\"\n *\n * @param callback - - The callback function that needs to be removed from the given event, when using a namespace (with or without a qualifying event) this may be null to remove all previously attached event handlers otherwise this will only remove events with this specific handler.\n *\n * @param evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function removeEventHandler(eventName: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ", callback: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ", evtNamespace?: " }, { "kind": "Content", "text": "string | string[] | null" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "eventName", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "callback", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "evtNamespace", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": true } ], "name": "removeEventHandler" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!removeEventListeners:function(1)", "docComment": "/**\n * Remove the listener from the array of events\n *\n * @param events - An string array of event names to bind the listener to\n *\n * @param listener - The event callback to call when the event is triggered\n *\n * @param evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function removeEventListeners(events: " }, { "kind": "Content", "text": "string[]" }, { "kind": "Content", "text": ", listener: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ", evtNamespace?: " }, { "kind": "Content", "text": "string | string[]" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "events", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "listener", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "evtNamespace", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": true } ], "name": "removeEventListeners" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!removePageHideEventListener:function(1)", "docComment": "/**\n * Removes the pageHide event listeners added by addPageHideEventListener, because the 'visibilitychange' uses an internal proxy to detect the visibility state you SHOULD use a unique namespace when calling addPageHideEventListener as the remove ignores the listener argument for the 'visibilitychange' event.\n *\n * @param listener - The specific listener to remove for the 'pageshow' event only (ignored for 'visibilitychange')\n *\n * @param evtNamespace - The unique namespace used when calling addPageShowEventListener\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function removePageHideEventListener(listener: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ", evtNamespace?: " }, { "kind": "Content", "text": "string | string[] | null" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "listener", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "evtNamespace", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": true } ], "name": "removePageHideEventListener" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!removePageShowEventListener:function(1)", "docComment": "/**\n * Removes the pageShow event listeners added by addPageShowEventListener, because the 'visibilitychange' uses an internal proxy to detect the visibility state you SHOULD use a unique namespace when calling addPageShowEventListener as the remove ignores the listener argument for the 'visibilitychange' event.\n *\n * @param listener - The specific listener to remove for the 'pageshow' event only (ignored for 'visibilitychange')\n *\n * @param evtNamespace - The unique namespace used when calling addPageShowEventListener\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function removePageShowEventListener(listener: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ", evtNamespace?: " }, { "kind": "Content", "text": "string | string[] | null" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "listener", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "evtNamespace", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": true } ], "name": "removePageShowEventListener" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!removePageUnloadEventListener:function(1)", "docComment": "/**\n * Remove any matching 'beforeunload', 'unload' and 'pagehide' events that may have been added via addEventListener, addEventListeners, addPageUnloadEventListener or addPageHideEventListener.\n *\n * @param listener - The specific event callback to to be removed\n *\n * @param evtNamespace - [Optional] Namespace(s) uniquely identified and removed based on this namespace.\n *\n * @returns true - when at least one of the events was registered otherwise false\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function removePageUnloadEventListener(listener: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ", evtNamespace?: " }, { "kind": "Content", "text": "string | string[]" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "listener", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "evtNamespace", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": true } ], "name": "removePageUnloadEventListener" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!safeGetCookieMgr:function(1)", "docComment": "/**\n * Helper to return the ICookieMgr from the core (if not null/undefined) or a default implementation associated with the configuration or a legacy default.\n *\n * @param core - \n *\n * @param config - \n *\n * @returns \n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function safeGetCookieMgr(core: " }, { "kind": "Reference", "text": "IAppInsightsCore", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore:interface" }, { "kind": "Content", "text": ", config?: " }, { "kind": "Reference", "text": "IConfiguration", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "ICookieMgr", "canonicalReference": "@microsoft/applicationinsights-core-js!ICookieMgr:interface" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "core", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "config", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": true } ], "name": "safeGetCookieMgr" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!safeGetLogger:function(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare function safeGetLogger(core: " }, { "kind": "Reference", "text": "IAppInsightsCore", "canonicalReference": "@microsoft/applicationinsights-core-js!IAppInsightsCore:interface" }, { "kind": "Content", "text": ", config?: " }, { "kind": "Reference", "text": "IConfiguration", "canonicalReference": "@microsoft/applicationinsights-core-js!IConfiguration:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Reference", "text": "IDiagnosticLogger", "canonicalReference": "@microsoft/applicationinsights-core-js!IDiagnosticLogger:interface" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "core", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "config", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": true } ], "name": "safeGetLogger" }, { "kind": "Enum", "canonicalReference": "@microsoft/applicationinsights-core-js!SendRequestReason:enum", "docComment": "/**\n * The EventsDiscardedReason enumeration contains a set of values that specify the reason for discarding an event.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare const enum SendRequestReason " } ], "releaseTag": "Public", "name": "SendRequestReason", "members": [ { "kind": "EnumMember", "canonicalReference": "@microsoft/applicationinsights-core-js!SendRequestReason.ManualFlush:member", "docComment": "/**\n * A manual flush request was received\n */\n", "excerptTokens": [ { "kind": "Content", "text": "ManualFlush = " }, { "kind": "Content", "text": "1" } ], "releaseTag": "Public", "name": "ManualFlush", "initializerTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "EnumMember", "canonicalReference": "@microsoft/applicationinsights-core-js!SendRequestReason.MaxBatchSize:member", "docComment": "/**\n * Maximum batch size would be exceeded\n */\n", "excerptTokens": [ { "kind": "Content", "text": "MaxBatchSize = " }, { "kind": "Content", "text": "10" } ], "releaseTag": "Public", "name": "MaxBatchSize", "initializerTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "EnumMember", "canonicalReference": "@microsoft/applicationinsights-core-js!SendRequestReason.MaxQueuedEvents:member", "docComment": "/**\n * The Maximum number of events have already been queued\n */\n", "excerptTokens": [ { "kind": "Content", "text": "MaxQueuedEvents = " }, { "kind": "Content", "text": "20" } ], "releaseTag": "Public", "name": "MaxQueuedEvents", "initializerTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "EnumMember", "canonicalReference": "@microsoft/applicationinsights-core-js!SendRequestReason.NormalSchedule:member", "docComment": "/**\n * Events are being sent based on the normal event schedule / timer.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "NormalSchedule = " }, { "kind": "Content", "text": "1" } ], "releaseTag": "Public", "name": "NormalSchedule", "initializerTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "EnumMember", "canonicalReference": "@microsoft/applicationinsights-core-js!SendRequestReason.Resumed:member", "docComment": "/**\n * The Channel was resumed\n */\n", "excerptTokens": [ { "kind": "Content", "text": "Resumed = " }, { "kind": "Content", "text": "4" } ], "releaseTag": "Public", "name": "Resumed", "initializerTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "EnumMember", "canonicalReference": "@microsoft/applicationinsights-core-js!SendRequestReason.Retry:member", "docComment": "/**\n * The event(s) being sent as a retry\n */\n", "excerptTokens": [ { "kind": "Content", "text": "Retry = " }, { "kind": "Content", "text": "5" } ], "releaseTag": "Public", "name": "Retry", "initializerTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "EnumMember", "canonicalReference": "@microsoft/applicationinsights-core-js!SendRequestReason.SdkUnload:member", "docComment": "/**\n * The SDK is unloading\n */\n", "excerptTokens": [ { "kind": "Content", "text": "SdkUnload = " }, { "kind": "Content", "text": "6" } ], "releaseTag": "Public", "name": "SdkUnload", "initializerTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "EnumMember", "canonicalReference": "@microsoft/applicationinsights-core-js!SendRequestReason.SyncEvent:member", "docComment": "/**\n * The event(s) being sent are sync events\n */\n", "excerptTokens": [ { "kind": "Content", "text": "SyncEvent = " }, { "kind": "Content", "text": "3" } ], "releaseTag": "Public", "name": "SyncEvent", "initializerTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "EnumMember", "canonicalReference": "@microsoft/applicationinsights-core-js!SendRequestReason.Undefined:member", "docComment": "/**\n * No specific reason was specified\n */\n", "excerptTokens": [ { "kind": "Content", "text": "Undefined = " }, { "kind": "Content", "text": "0" } ], "releaseTag": "Public", "name": "Undefined", "initializerTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "EnumMember", "canonicalReference": "@microsoft/applicationinsights-core-js!SendRequestReason.Unload:member", "docComment": "/**\n * Unload event is being processed\n */\n", "excerptTokens": [ { "kind": "Content", "text": "Unload = " }, { "kind": "Content", "text": "2" } ], "releaseTag": "Public", "name": "Unload", "initializerTokenRange": { "startIndex": 1, "endIndex": 2 } } ] }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!setCookie:function(1)", "docComment": "/**\n * @deprecated\n *\n * - Use the core.getCookieMgr().set() helper method to set userId and sessionId cookie\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function setCookie(logger: " }, { "kind": "Reference", "text": "IDiagnosticLogger", "canonicalReference": "@microsoft/applicationinsights-core-js!IDiagnosticLogger:interface" }, { "kind": "Content", "text": ", name: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ", value: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ", domain?: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 9, "endIndex": 10 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "logger", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "name", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "value", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": false }, { "parameterName": "domain", "parameterTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "isOptional": true } ], "name": "setCookie" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!setEnableEnvMocks:function(1)", "docComment": "/**\n * Enable the lookup of test mock objects if requested\n *\n * @param enabled - \n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function setEnableEnvMocks(enabled: " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "enabled", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "setEnableEnvMocks" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!setGblPerfMgr:function(1)", "docComment": "/**\n * Set the global performance manager to use when there is no core instance or it has not been initialized yet.\n *\n * @param perfManager - The IPerfManager instance to use when no performance manager is supplied.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function setGblPerfMgr(perfManager: " }, { "kind": "Reference", "text": "IPerfManager", "canonicalReference": "@microsoft/applicationinsights-core-js!IPerfManager:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "perfManager", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "setGblPerfMgr" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!setValue:function(1)", "docComment": "/**\n * Sets the provided value on the target instance using the field name when the provided chk function returns true, the chk function will only be called if the new value is no equal to the original value.\n *\n * @param target - The target object\n *\n * @param field - The key of the target\n *\n * @param value - The value to set\n *\n * @param valChk - [Optional] Callback to check the value that if supplied will be called check if the new value can be set\n *\n * @param srcChk - [Optional] Callback to check to original value that if supplied will be called if the new value should be set (if allowed)\n *\n * @returns The existing or new value, depending what was set\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function setValue(target: " }, { "kind": "Content", "text": "T" }, { "kind": "Content", "text": ", field: " }, { "kind": "Content", "text": "K" }, { "kind": "Content", "text": ", value: " }, { "kind": "Content", "text": "T[K]" }, { "kind": "Content", "text": ", valChk?: " }, { "kind": "Content", "text": "((value: T[K]) => boolean) | null" }, { "kind": "Content", "text": ", srcChk?: " }, { "kind": "Content", "text": "((value: T[K]) => boolean) | null" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "T[K]" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 13, "endIndex": 14 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "target", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false }, { "parameterName": "field", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": false }, { "parameterName": "value", "parameterTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "isOptional": false }, { "parameterName": "valChk", "parameterTypeTokenRange": { "startIndex": 9, "endIndex": 10 }, "isOptional": true }, { "parameterName": "srcChk", "parameterTypeTokenRange": { "startIndex": 11, "endIndex": 12 }, "isOptional": true } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } }, { "typeParameterName": "K", "constraintTokenRange": { "startIndex": 1, "endIndex": 2 }, "defaultTypeTokenRange": { "startIndex": 0, "endIndex": 0 } } ], "name": "setValue" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!sortPlugins:function(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare function sortPlugins(plugins: " }, { "kind": "Content", "text": "T[]" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "T[]" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "plugins", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false } ], "typeParameters": [ { "typeParameterName": "T", "constraintTokenRange": { "startIndex": 0, "endIndex": 0 }, "defaultTypeTokenRange": { "startIndex": 1, "endIndex": 2 } } ], "name": "sortPlugins" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!strContains:function(1)", "docComment": "/**\n * A simple wrapper (for minification support) to check if the value contains the search string.\n *\n * @param value - The string value to check for the existence of the search value\n *\n * @param search - The value search within the value\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function strContains(value: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ", search: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "value", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "search", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false } ], "name": "strContains" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!strEndsWith:function(1)", "docComment": "/**\n * The strEndsWith() method determines whether a string ends with the characters of a specified string, returning true or false as appropriate.\n *\n * @param value - The value to check whether it ends with the search value.\n *\n * @param search - The characters to be searched for at the end of the value.\n *\n * @returns true if the given search value is found at the end of the string, otherwise false.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function strEndsWith(value: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ", search: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "value", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "search", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false } ], "name": "strEndsWith" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!strStartsWith:function(1)", "docComment": "/**\n * The strStartsWith() method determines whether a string starts with the characters of the specified string, returning true or false as appropriate.\n *\n * @param value - The value to check whether it ends with the search value.\n *\n * @param checkValue - The characters to be searched for at the start of the value.\n *\n * @returns true if the given search value is found at the start of the string, otherwise false.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function strStartsWith(value: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ", checkValue: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "value", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false }, { "parameterName": "checkValue", "parameterTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "isOptional": false } ], "name": "strStartsWith" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!strTrim:function(1)", "docComment": "/**\n * helper method to trim strings (IE8 does not implement String.prototype.trim)\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function strTrim(str: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "str", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "strTrim" }, { "kind": "Interface", "canonicalReference": "@microsoft/applicationinsights-core-js!Tags:interface", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export interface Tags " } ], "releaseTag": "Public", "name": "Tags", "members": [ { "kind": "IndexSignature", "canonicalReference": "@microsoft/applicationinsights-core-js!Tags:index(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "[key: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "]: " }, { "kind": "Content", "text": "any" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "key", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ] } ], "extendsTokenRanges": [] }, { "kind": "TypeAlias", "canonicalReference": "@microsoft/applicationinsights-core-js!TelemetryInitializerFunction:type", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare type TelemetryInitializerFunction = " }, { "kind": "Content", "text": "(item: T) => boolean | void" }, { "kind": "Content", "text": ";" } ], "releaseTag": "Public", "name": "TelemetryInitializerFunction", "typeTokenRange": { "startIndex": 1, "endIndex": 4 } }, { "kind": "Enum", "canonicalReference": "@microsoft/applicationinsights-core-js!TelemetryUnloadReason:enum", "docComment": "/**\n * The TelemetryUnloadReason enumeration contains the possible reasons for why a plugin is being unloaded / torndown().\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare const enum TelemetryUnloadReason " } ], "releaseTag": "Public", "name": "TelemetryUnloadReason", "members": [ { "kind": "EnumMember", "canonicalReference": "@microsoft/applicationinsights-core-js!TelemetryUnloadReason.ManualTeardown:member", "docComment": "/**\n * Teardown has been called without any context.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "ManualTeardown = " }, { "kind": "Content", "text": "0" } ], "releaseTag": "Public", "name": "ManualTeardown", "initializerTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "EnumMember", "canonicalReference": "@microsoft/applicationinsights-core-js!TelemetryUnloadReason.PluginReplace:member", "docComment": "/**\n * This instance of the plugin is being removed and replaced\n */\n", "excerptTokens": [ { "kind": "Content", "text": "PluginReplace = " }, { "kind": "Content", "text": "2" } ], "releaseTag": "Public", "name": "PluginReplace", "initializerTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "EnumMember", "canonicalReference": "@microsoft/applicationinsights-core-js!TelemetryUnloadReason.PluginUnload:member", "docComment": "/**\n * Just this plugin is being removed\n */\n", "excerptTokens": [ { "kind": "Content", "text": "PluginUnload = " }, { "kind": "Content", "text": "1" } ], "releaseTag": "Public", "name": "PluginUnload", "initializerTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "EnumMember", "canonicalReference": "@microsoft/applicationinsights-core-js!TelemetryUnloadReason.SdkUnload:member", "docComment": "/**\n * The entire SDK is being unloaded\n */\n", "excerptTokens": [ { "kind": "Content", "text": "SdkUnload = " }, { "kind": "Content", "text": "50" } ], "releaseTag": "Public", "name": "SdkUnload", "initializerTokenRange": { "startIndex": 1, "endIndex": 2 } } ] }, { "kind": "Enum", "canonicalReference": "@microsoft/applicationinsights-core-js!TelemetryUpdateReason:enum", "docComment": "/**\n * The TelemetryUpdateReason enumeration contains a set of bit-wise values that specify the reason for update request.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare const enum TelemetryUpdateReason " } ], "releaseTag": "Public", "name": "TelemetryUpdateReason", "members": [ { "kind": "EnumMember", "canonicalReference": "@microsoft/applicationinsights-core-js!TelemetryUpdateReason.PluginAdded:member", "docComment": "/**\n * One or more plugins have been added\n */\n", "excerptTokens": [ { "kind": "Content", "text": "PluginAdded = " }, { "kind": "Content", "text": "16" } ], "releaseTag": "Public", "name": "PluginAdded", "initializerTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "EnumMember", "canonicalReference": "@microsoft/applicationinsights-core-js!TelemetryUpdateReason.PluginRemoved:member", "docComment": "/**\n * One or more plugins have been removed\n */\n", "excerptTokens": [ { "kind": "Content", "text": "PluginRemoved = " }, { "kind": "Content", "text": "32" } ], "releaseTag": "Public", "name": "PluginRemoved", "initializerTokenRange": { "startIndex": 1, "endIndex": 2 } }, { "kind": "EnumMember", "canonicalReference": "@microsoft/applicationinsights-core-js!TelemetryUpdateReason.Unknown:member", "docComment": "/**\n * Unknown.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "Unknown = " }, { "kind": "Content", "text": "0" } ], "releaseTag": "Public", "name": "Unknown", "initializerTokenRange": { "startIndex": 1, "endIndex": 2 } } ] }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!throwError:function(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare function throwError(message: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "never" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "message", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "throwError" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!toISOString:function(1)", "docComment": "/**\n * Convert a date to I.S.O. format in IE8\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function toISOString(date: " }, { "kind": "Reference", "text": "Date", "canonicalReference": "!Date:interface" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "date", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "toISOString" }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!uaDisallowsSameSiteNone:function(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare function uaDisallowsSameSiteNone(userAgent: " }, { "kind": "Content", "text": "string" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "boolean" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "userAgent", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "isOptional": false } ], "name": "uaDisallowsSameSiteNone" }, { "kind": "Variable", "canonicalReference": "@microsoft/applicationinsights-core-js!Undefined:var", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "Undefined = \"undefined\"" } ], "releaseTag": "Public", "name": "Undefined", "variableTypeTokenRange": { "startIndex": 0, "endIndex": 0 } }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!unloadComponents:function(1)", "docComment": "/**\n * Teardown / Unload helper to perform teardown/unloading operations for the provided components synchronously or asynchronously, this will call any _doTeardown() or _doUnload() functions on the provided components to allow them to finish removal.\n *\n * @param components - The components you want to unload\n *\n * @param unloadCtx - This is the context that should be used during unloading.\n *\n * @param unloadState - The details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.\n *\n * @param asyncCallback - An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async unload/teardown operations.\n *\n * @returns boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.\n */\n", "excerptTokens": [ { "kind": "Content", "text": "export declare function unloadComponents(components: " }, { "kind": "Content", "text": "any | " }, { "kind": "Reference", "text": "IUnloadableComponent", "canonicalReference": "@microsoft/applicationinsights-core-js!IUnloadableComponent:interface" }, { "kind": "Content", "text": "[]" }, { "kind": "Content", "text": ", unloadCtx?: " }, { "kind": "Reference", "text": "IProcessTelemetryUnloadContext", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryUnloadContext:interface" }, { "kind": "Content", "text": ", unloadState?: " }, { "kind": "Reference", "text": "ITelemetryUnloadState", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryUnloadState:interface" }, { "kind": "Content", "text": ", asyncCallback?: " }, { "kind": "Content", "text": "() => void" }, { "kind": "Content", "text": "): " }, { "kind": "Content", "text": "void | boolean" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 11, "endIndex": 12 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [ { "parameterName": "components", "parameterTypeTokenRange": { "startIndex": 1, "endIndex": 4 }, "isOptional": false }, { "parameterName": "unloadCtx", "parameterTypeTokenRange": { "startIndex": 5, "endIndex": 6 }, "isOptional": true }, { "parameterName": "unloadState", "parameterTypeTokenRange": { "startIndex": 7, "endIndex": 8 }, "isOptional": true }, { "parameterName": "asyncCallback", "parameterTypeTokenRange": { "startIndex": 9, "endIndex": 10 }, "isOptional": true } ], "name": "unloadComponents" }, { "kind": "TypeAlias", "canonicalReference": "@microsoft/applicationinsights-core-js!UnloadHandler:type", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare type UnloadHandler = " }, { "kind": "Content", "text": "(itemCtx: " }, { "kind": "Reference", "text": "IProcessTelemetryUnloadContext", "canonicalReference": "@microsoft/applicationinsights-core-js!IProcessTelemetryUnloadContext:interface" }, { "kind": "Content", "text": ", unloadState: " }, { "kind": "Reference", "text": "ITelemetryUnloadState", "canonicalReference": "@microsoft/applicationinsights-core-js!ITelemetryUnloadState:interface" }, { "kind": "Content", "text": ") => void" }, { "kind": "Content", "text": ";" } ], "releaseTag": "Public", "name": "UnloadHandler", "typeTokenRange": { "startIndex": 1, "endIndex": 6 } }, { "kind": "Function", "canonicalReference": "@microsoft/applicationinsights-core-js!useXDomainRequest:function(1)", "docComment": "", "excerptTokens": [ { "kind": "Content", "text": "export declare function useXDomainRequest(): " }, { "kind": "Content", "text": "boolean | undefined" }, { "kind": "Content", "text": ";" } ], "returnTypeTokenRange": { "startIndex": 1, "endIndex": 2 }, "releaseTag": "Public", "overloadIndex": 1, "parameters": [], "name": "useXDomainRequest" } ] } ] } ## API Report File for "@microsoft/applicationinsights-core-js" > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts import { getGlobal } from '@microsoft/applicationinsights-shims'; import { objCreateFn as objCreate } from '@microsoft/applicationinsights-shims'; import { strShimFunction as strFunction } from '@microsoft/applicationinsights-shims'; import { strShimObject as strObject } from '@microsoft/applicationinsights-shims'; import { strShimPrototype as strPrototype } from '@microsoft/applicationinsights-shims'; import { strShimUndefined as strUndefined } from '@microsoft/applicationinsights-shims'; // @public export function __getRegisteredEvents(target: any, eventName?: string, evtNamespace?: string | string[]): _IRegisteredEvents[]; // @public export function addEventHandler(eventName: string, callback: any, evtNamespace?: string | string[] | null): boolean; // @public export function addEventListeners(events: string[], listener: any, excludeEvents?: string[], evtNamespace?: string | string[]): boolean; // @public export function addPageHideEventListener(listener: any, excludeEvents?: string[] | null, evtNamespace?: string | string[] | null): boolean; // @public export function addPageShowEventListener(listener: any, excludeEvents?: string[] | null, evtNamespace?: string | string[] | null): boolean; // @public export function addPageUnloadEventListener(listener: any, excludeEvents?: string[], evtNamespace?: string | string[]): boolean; // @public (undocumented) export class AppInsightsCore extends BaseCore implements IAppInsightsCore { constructor(); // (undocumented) initialize(config: IConfiguration, extensions: IPlugin[], logger?: IDiagnosticLogger, notificationManager?: INotificationManager): void; // (undocumented) track(telemetryItem: ITelemetryItem): void; } // @public (undocumented) export function areCookiesSupported(logger?: IDiagnosticLogger): any; // @public export function arrForEach(arr: T[], callbackfn: (value: T, index?: number, array?: T[]) => undefined | void | number, thisArg?: any): void; // @public export function arrIndexOf(arr: T[], searchElement: T, fromIndex?: number): number; // @public export function arrMap(arr: T[], callbackfn: (value: T, index?: number, array?: T[]) => R, thisArg?: any): R[]; // @public export function arrReduce(arr: T[], callbackfn: (previousValue: T | R, currentValue?: T, currentIndex?: number, array?: T[]) => R, initialValue?: R): R; // @public export function attachEvent(obj: any, eventNameWithoutOn: string, handlerRef: any, useCapture?: boolean): boolean; // @public (undocumented) export class BaseCore implements IAppInsightsCore { constructor(); addNotificationListener(listener: INotificationListener): void; addPlugin(plugin: T, replaceExisting?: boolean, doAsync?: boolean, addCb?: (added?: boolean) => void): void; addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler | void; addUnloadCb(handler: UnloadHandler): void; // (undocumented) config: IConfiguration; // (undocumented) static defaultConfig: IConfiguration; // (undocumented) eventCnt(): number; evtNamespace(): string; // (undocumented) _extensions: IPlugin[]; flush(isAsync?: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason): void; getCookieMgr(): ICookieMgr; // (undocumented) getNotifyMgr(): INotificationManager; // (undocumented) getPerfMgr(): IPerfManager; // (undocumented) getPlugin(pluginIdentifier: string): ILoadedPlugin; // (undocumented) getProcessTelContext(): IProcessTelemetryContext; // (undocumented) getTransmissionControls(): IChannelControls[][]; // (undocumented) initialize(config: IConfiguration, extensions: IPlugin[], logger?: IDiagnosticLogger, notificationManager?: INotificationManager): void; // (undocumented) isInitialized: () => boolean; // (undocumented) logger: IDiagnosticLogger; pollInternalLogs(eventName?: string): number; // (undocumented) protected releaseQueue(): void; removeNotificationListener(listener: INotificationListener): void; setCookieMgr(cookieMgr: ICookieMgr): void; // (undocumented) setPerfMgr(perfMgr: IPerfManager): void; stopPollingInternalLogs(): void; // (undocumented) track(telemetryItem: ITelemetryItem): void; unload(isAsync?: boolean, unloadComplete?: (unloadState: ITelemetryUnloadState) => void, cbTimeout?: number): void; protected _updateHook?(updateCtx: IProcessTelemetryUpdateContext, updateState: ITelemetryUpdateState): void | boolean; } // @public export abstract class BaseTelemetryPlugin implements ITelemetryPlugin { constructor(); protected _addHook(hooks: IInstrumentHook | IInstrumentHook[]): void; protected _addUnloadCb(handler: UnloadHandler): void; core: IAppInsightsCore; diagLog: (itemCtx?: IProcessTelemetryContext) => IDiagnosticLogger; protected _doTeardown?: (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState, asyncCallback?: () => void) => void | boolean; protected _doUpdate?: (updateCtx?: IProcessTelemetryUpdateContext, updateState?: ITelemetryUpdateState, asyncCallback?: () => void) => void | boolean; protected _getTelCtx: (currentCtx?: IProcessTelemetryContext) => IProcessTelemetryContext; // (undocumented) identifier: string; // (undocumented) initialize(config: IConfiguration, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain): void; isInitialized: () => boolean; // (undocumented) priority: number; processNext: (env: ITelemetryItem, itemCtx: IProcessTelemetryContext) => void; // (undocumented) abstract processTelemetry(env: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void; protected setInitialized: (isInitialized: boolean) => void; setNextPlugin: (next: ITelemetryPlugin | ITelemetryPluginChain) => void; teardown(unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState): void | boolean; update(updateCtx: IProcessTelemetryUpdateContext, updateState: ITelemetryUpdateState): void | boolean; // (undocumented) version?: string; } // @public @deprecated (undocumented) export function canUseCookies(logger: IDiagnosticLogger): any; // @public @deprecated export const CoreUtils: ICoreUtils; // @public export function createClassFromInterface(defaults?: T): new () => T; // @public (undocumented) export function createCookieMgr(rootConfig?: IConfiguration, logger?: IDiagnosticLogger): ICookieMgr; // @public export function createEnumMap(values: { [key in keyof E]: E[keyof E]; }): EnumMap; // @public export function createEnumStyle(values: { [key in keyof E]: E[keyof E]; }): EnumValue; // @public export function createProcessTelemetryContext(telemetryChain: ITelemetryPluginChain | null, config: IConfiguration, core: IAppInsightsCore, startAt?: IPlugin): IProcessTelemetryContext; // @public (undocumented) export function createUniqueNamespace(name: string, includeVersion?: boolean): string; // @public (undocumented) export function createUnloadHandlerContainer(): { add: (handler: UnloadHandler) => void; run: (unloadCtx: IProcessTelemetryUnloadContext, unloadState: ITelemetryUnloadState) => void; }; // @public export function createValueMap(values: { [key in keyof E]: [E[keyof E], V[keyof V]]; }): V; // @public export function dateNow(): number; // @public (undocumented) export function deepFreeze(obj: T): T; // @public @deprecated (undocumented) export function deleteCookie(logger: IDiagnosticLogger, name: string): boolean; // @public export function detachEvent(obj: any, eventNameWithoutOn: string, handlerRef: any, useCapture?: boolean): void; // @public (undocumented) export class DiagnosticLogger implements IDiagnosticLogger { constructor(config?: IConfiguration); consoleLoggingLevel(): number; enableDebugExceptions(): boolean; errorToConsole(message: string): void; // (undocumented) identifier: string; logInternalMessage(severity: LoggingSeverity, message: _InternalLogMessage): void; maxInternalMessageLimit(): number; queue: _InternalLogMessage[]; resetInternalMessageCount(): void; telemetryLoggingLevel(): number; throwInternal(severity: LoggingSeverity, msgId: _InternalMessageId, msg: string, properties?: Object, isUserAct?: boolean): void; warnToConsole(message: string): void; } // @public @deprecated (undocumented) export function disableCookies(): void; // @public export function doPerf(mgrSource: IPerfManagerProvider | IPerfManager, getSource: () => string, func: (perfEvt?: IPerfEvent) => T, details?: () => any, isAsync?: boolean): T; // @public export function dumpObj(object: any): string; // @public export const enum eEventsDiscardedReason { InvalidEvent = 2, KillSwitch = 4, NonRetryableStatus = 1, QueueFull = 5, SizeLimitExceeded = 3, Unknown = 0 } // @public (undocumented) export const enum _eInternalMessageId { // (undocumented) BrowserCannotReadLocalStorage = 1, // (undocumented) BrowserCannotReadSessionStorage = 2, // (undocumented) BrowserCannotWriteLocalStorage = 3, // (undocumented) BrowserCannotWriteSessionStorage = 4, // (undocumented) BrowserDoesNotSupportLocalStorage = 0, // (undocumented) BrowserFailedRemovalFromLocalStorage = 5, // (undocumented) BrowserFailedRemovalFromSessionStorage = 6, // (undocumented) CannotAccessCookie = 68, // (undocumented) CannotParseAiBlobValue = 101, // (undocumented) CannotSendEmptyTelemetry = 7, // (undocumented) CannotSerializeObject = 48, // (undocumented) CannotSerializeObjectNonSerializable = 49, // (undocumented) CircularReferenceDetected = 50, // (undocumented) ClearAuthContextFailed = 51, // (undocumented) ClientPerformanceMathError = 8, // (undocumented) CreateEnvelopeError = 47, // (undocumented) ErrorParsingAISessionCookie = 9, // (undocumented) ErrorPVCalc = 10, // (undocumented) ExceptionTruncated = 52, // (undocumented) ExceptionWhileLoggingError = 11, // (undocumented) FailedAddingCustomDefinedRequestContext = 104, // (undocumented) FailedAddingTelemetryToBuffer = 12, // (undocumented) FailedMonitorAjaxAbort = 13, // (undocumented) FailedMonitorAjaxDur = 14, // (undocumented) FailedMonitorAjaxGetCorrelationHeader = 18, // (undocumented) FailedMonitorAjaxOpen = 15, // (undocumented) FailedMonitorAjaxRSC = 16, // (undocumented) FailedMonitorAjaxSend = 17, // (undocumented) FailedMonitorAjaxSetRequestHeader = 71, // (undocumented) FailedToAddHandlerForOnBeforeUnload = 19, // (undocumented) FailedToFixDepricatedValues = 44, // (undocumented) FailedToReportDataLoss = 21, // (undocumented) FailedToRestoreStorageBuffer = 42, // (undocumented) FailedToSendQueuedTelemetry = 20, // (undocumented) FailedToSetStorageBuffer = 41, // (undocumented) FlushFailed = 22, // (undocumented) IdTooLong = 69, // (undocumented) IllegalCharsInName = 53, // (undocumented) InMemoryStorageBufferFull = 105, // (undocumented) InvalidBackendResponse = 43, // (undocumented) InvalidContentBlob = 102, // (undocumented) InvalidDurationValue = 45, // (undocumented) InvalidEvent = 70, // (undocumented) InvalidInstrumentationKey = 100, // (undocumented) ItemNotInArray = 54, // (undocumented) MaxAjaxPerPVExceeded = 55, // (undocumented) MessageLimitPerPVExceeded = 23, // (undocumented) MessageTruncated = 56, // (undocumented) MissingRequiredFieldSpecification = 24, // (undocumented) NameTooLong = 57, // (undocumented) NavigationTimingNotSupported = 25, // (undocumented) NotificationException = 74, // (undocumented) OnError = 26, // (undocumented) PluginException = 73, // (undocumented) SampleRateOutOfRange = 58, // (undocumented) SendBrowserInfoOnUserInit = 72, // (undocumented) SenderNotInitialized = 28, // (undocumented) SessionRenewalDateIsZero = 27, // (undocumented) SessionStorageBufferFull = 67, // (undocumented) SetAuthContextFailed = 59, // (undocumented) SetAuthContextFailedAccountName = 60, // (undocumented) SnippetScriptLoadFailure = 99, // (undocumented) StartCalledMoreThanOnce = 62, // (undocumented) StartTrackEventFailed = 29, // (undocumented) StartTrackFailed = 31, // (undocumented) StopCalledWithoutStart = 63, // (undocumented) StopTrackEventFailed = 30, // (undocumented) StopTrackFailed = 32, // (undocumented) StringValueTooLong = 61, // (undocumented) TelemetryEnvelopeInvalid = 46, // (undocumented) TelemetryInitializerFailed = 64, // (undocumented) TelemetrySampledAndNotSent = 33, // (undocumented) TrackArgumentsNotSpecified = 65, // (undocumented) TrackEventFailed = 34, // (undocumented) TrackExceptionFailed = 35, // (undocumented) TrackMetricFailed = 36, // (undocumented) TrackPageActionEventFailed = 103, // (undocumented) TrackPVFailed = 37, // (undocumented) TrackPVFailedCalc = 38, // (undocumented) TrackTraceFailed = 39, // (undocumented) TransmissionFailed = 40, // (undocumented) UrlTooLong = 66 } // @public (undocumented) export const enum eLoggingSeverity { CRITICAL = 1, WARNING = 2 } // @public (undocumented) export type EnumMap = { readonly [key in keyof E extends string ? keyof E : never]: key extends string ? key : keyof E; } & I; // @public (undocumented) export type EnumValue = { readonly [key in keyof E]: E[key]; }; // @public (undocumented) export const EventHelper: IEventHelper; // @public export function eventOff(target: T, eventName: string, handlerRef: any, evtNamespace?: string | string[] | null, useCapture?: boolean): void; // @public export function eventOn(target: T, eventName: string, handlerRef: any, evtNamespace?: string | string[] | null, useCapture?: boolean): boolean; // @public export const EventsDiscardedReason: EnumValue; // @public (undocumented) export type EventsDiscardedReason = number | eEventsDiscardedReason; // @public export function generateW3CId(): string; // @public export function getConsole(): Console | null; // @public @deprecated (undocumented) export function getCookie(logger: IDiagnosticLogger, name: string): string; // @public export function getCrypto(): Crypto | null; // @public (undocumented) export function getDebugExt(config: IConfiguration): IDbgExtension; // @public (undocumented) export function getDebugListener(config: IConfiguration): INotificationListener; // @public export function getDocument(): Document | null; // @public export function getExceptionName(object: any): string; // @public (undocumented) export const enum GetExtCfgMergeType { // (undocumented) MergeDefaultFromRootOrDefault = 2, // (undocumented) MergeDefaultOnly = 1, // (undocumented) None = 0 } // @public export function getGblPerfMgr(): IPerfManager; export { getGlobal } // @public export function getGlobalInst(name: string): T; // @public export function getHistory(): History | null; // @public export function getIEVersion(userAgentStr?: string): number; // @public export function getJSON(): JSON | null; // @public export function getLocation(checkForMock?: boolean): Location | null; // @public export function getMsCrypto(): Crypto | null; // @public export function getNavigator(): Navigator | null; // @public export function getPerformance(): Performance | null; // @public export function getSetValue(target: T, field: K, defValue?: T[K]): T[K]; // @public export function getWindow(): Window | null; // @public export function hasDocument(): boolean; // @public export function hasHistory(): boolean; // @public export function hasJSON(): boolean; // @public export function hasNavigator(): boolean; // @public (undocumented) export function hasOwnProperty(obj: any, prop: string): boolean; // @public export function hasWindow(): boolean; // @public (undocumented) export interface IAppInsightsCore extends IPerfManagerProvider { addNotificationListener?(listener: INotificationListener): void; addPlugin(plugin: T, replaceExisting?: boolean, doAsync?: boolean, addCb?: (added?: boolean) => void): void; addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler | void; addUnloadCb(handler: UnloadHandler): void; // (undocumented) config: IConfiguration; evtNamespace(): string; flush(isAsync?: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason, cbTimeout?: number): boolean | void; getCookieMgr(): ICookieMgr; getNotifyMgr(): INotificationManager; getPlugin(pluginIdentifier: string): ILoadedPlugin; getProcessTelContext(): IProcessTelemetryContext; // (undocumented) getTransmissionControls(): IChannelControls[][]; // (undocumented) initialize(config: IConfiguration, extensions: IPlugin[], logger?: IDiagnosticLogger, notificationManager?: INotificationManager): void; isInitialized?: () => boolean; // (undocumented) logger: IDiagnosticLogger; // (undocumented) pollInternalLogs?(eventName?: string): number; removeNotificationListener?(listener: INotificationListener): void; setCookieMgr(cookieMgr: ICookieMgr): void; // (undocumented) stopPollingInternalLogs?(): void; // (undocumented) track(telemetryItem: ITelemetryItem): void; unload(isAsync?: boolean, unloadComplete?: (unloadState: ITelemetryUnloadState) => void, cbTimeout?: number): void; } // @public (undocumented) export interface IBaseProcessingContext { core: () => IAppInsightsCore; createNew: (plugins?: IPlugin[] | ITelemetryPluginChain, startAt?: IPlugin) => IBaseProcessingContext; diagLog: () => IDiagnosticLogger; getCfg: () => IConfiguration; getConfig: (identifier: string, field: string, defaultValue?: number | string | boolean | string[] | RegExp[] | Function) => number | string | boolean | string[] | RegExp[] | Function; getExtCfg: (identifier: string, defaultValue?: T | any, mergeDefault?: GetExtCfgMergeType) => T; getNext: () => ITelemetryPluginChain; hasNext: () => boolean; iterate: (callback: (plugin: T) => void) => void; onComplete: (onComplete: () => void, that?: any, ...args: any[]) => void; setNext: (nextCtx: ITelemetryPluginChain) => void; } // @public export interface IChannelControls extends ITelemetryPlugin { flush(async: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason): boolean | void; pause(): void; resume(): void; teardown: (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState) => void | boolean; } // @public export interface IConfiguration { channels?: IChannelControls[][]; connectionString?: string; cookieCfg?: ICookieMgrConfig; cookieDomain?: string; cookiePath?: string; createPerfMgr?: (core: IAppInsightsCore, notificationManager: INotificationManager) => IPerfManager; diagnosticLogInterval?: number; disableCookiesUsage?: boolean; disableDbgExt?: boolean; disableInstrumentationKeyValidation?: boolean; disablePageShowEvents?: string[]; disablePageUnloadEvents?: string[]; enableDebugExceptions?: boolean; enablePerfMgr?: boolean; endpointUrl?: string; extensionConfig?: { [key: string]: any; }; extensions?: ITelemetryPlugin[]; idLength?: number; instrumentationKey?: string; loggingLevelConsole?: number; loggingLevelTelemetry?: number; maxMessageLimit?: number; perfEvtsSendAll?: boolean; } // @public (undocumented) export interface ICookieMgr { del(name: string, path?: string): boolean; get(name: string): string; isEnabled(): boolean; purge(name: string, path?: string): boolean; set(name: string, value: string, maxAgeSec?: number, domain?: string, path?: string): boolean; setEnabled(value: boolean): void; } // @public export interface ICookieMgrConfig { delCookie?: (name: string, cookieValue: string) => void; domain?: string; enabled?: boolean; getCookie?: (name: string) => string; path?: string; setCookie?: (name: string, value: string) => void; } // @public @deprecated export interface ICoreUtils { addEventHandler: (eventName: string, callback: any, evtNamespace?: string | string[]) => boolean; arrForEach: (arr: T[], callbackfn: (value: T, index?: number, array?: T[]) => void | number, thisArg?: any) => void; arrIndexOf: (arr: T[], searchElement: T, fromIndex?: number) => number; arrMap: (arr: T[], callbackfn: (value: T, index?: number, array?: T[]) => R, thisArg?: any) => R[]; arrReduce: (arr: T[], callbackfn: (previousValue: T | R, currentValue?: T, currentIndex?: number, array?: T[]) => R, initialValue?: R) => R; // @deprecated _canUseCookies: boolean; dateNow: () => number; // @deprecated (undocumented) disableCookies: () => void; generateW3CId: () => string; // (undocumented) hasOwnProperty: (obj: any, prop: string) => boolean; isArray: (obj: any) => boolean; isBoolean: (value: any) => value is boolean; isDate: (obj: any) => obj is Date; isError: (obj: any) => obj is Error; isFunction: (value: any) => value is Function; isIE: () => boolean; // (undocumented) isNullOrUndefined: (value: any) => boolean; isNumber: (value: any) => value is number; isObject: (value: any) => boolean; isString: (value: any) => value is string; // (undocumented) isTypeof: (value: any, theType: string) => boolean; // (undocumented) isUndefined: (value: any) => boolean; mwcRandom32: (signed?: boolean) => number; mwcRandomSeed: (value?: number) => void; // (undocumented) newGuid: () => string; newId: (maxLength?: number) => string; objCreate: (obj: object) => any; objDefineAccessors: (target: any, prop: string, getProp?: () => T, setProp?: (v: T) => void) => boolean; objKeys: (obj: {}) => string[]; perfNow: () => number; random32: (signed?: boolean) => number; randomValue: (maxValue: number) => number; strTrim: (str: any) => string; toISOString: (date: Date) => string; } // @public (undocumented) export interface ICustomProperties { // (undocumented) [key: string]: any; } // @public (undocumented) export interface IDbgExtension { // (undocumented) debugMsg?: (name: string, data: any) => void; // (undocumented) diagLog?: (name: string, data: any) => void; // (undocumented) disable: () => void; // (undocumented) enable: () => void; // (undocumented) isEnabled: () => boolean; // (undocumented) listener: INotificationListener; // (undocumented) sendEvt?: (name: string, data: any) => void; } // @public (undocumented) export interface IDiagnosticLogger { consoleLoggingLevel: () => number; enableDebugExceptions: () => boolean; errorToConsole?(message: string): void; logInternalMessage?(severity: LoggingSeverity, message: _InternalLogMessage): void; maxInternalMessageLimit: () => number; queue: _InternalLogMessage[]; resetInternalMessageCount(): void; telemetryLoggingLevel: () => number; throwInternal(severity: LoggingSeverity, msgId: _InternalMessageId, msg: string, properties?: Object, isUserAct?: boolean): void; warnToConsole(message: string): void; } // @public (undocumented) export interface IEventHelper { Attach: (obj: any, eventNameWithoutOn: string, handlerRef: any) => boolean; // @deprecated AttachEvent: (obj: any, eventNameWithoutOn: string, handlerRef: any) => boolean; Detach: (obj: any, eventNameWithoutOn: string, handlerRef: any) => void; // @deprecated DetachEvent: (obj: any, eventNameWithoutOn: string, handlerRef: any) => void; } // @public (undocumented) export interface IInstrumentCallDetails { ctx: () => any; err?: Error; evt?: Event; // (undocumented) inst: any; // (undocumented) name: string; rslt?: any; set: (idx: number, value: any) => void; } // @public export interface IInstrumentHook { cbks: IInstrumentHooksCallbacks; id: number; rm: () => void; } // @public (undocumented) export interface IInstrumentHooks { // (undocumented) f: any; // (undocumented) h: IInstrumentHook[]; // (undocumented) i: number; // (undocumented) n: string; } // @public export interface IInstrumentHooksCallbacks { fnErr?: InstrumentorHooksCallback; hkErr?: InstrumentorHooksCallback; ns?: string | string[]; req?: InstrumentorHooksCallback; rsp?: InstrumentorHooksCallback; } // @public (undocumented) export interface ILoadedPlugin { isEnabled: () => boolean; // (undocumented) plugin: T; // (undocumented) remove: (isAsync?: boolean, removeCb?: (removed?: boolean) => void) => void; setEnabled: (isEnabled: boolean) => void; } // @public export function initializePlugins(processContext: IProcessTelemetryContext, extensions: IPlugin[]): void; // @public export interface INotificationListener { eventsDiscarded?: (events: ITelemetryItem[], reason: number) => void; eventsSendRequest?: (sendReason: number, isAsync?: boolean) => void; eventsSent?: (events: ITelemetryItem[]) => void; perfEvent?: (perfEvent: IPerfEvent) => void; } // @public export interface INotificationManager { addNotificationListener(listener: INotificationListener): void; eventsDiscarded(events: ITelemetryItem[], reason: number): void; eventsSendRequest?(sendReason: number, isAsync: boolean): void; eventsSent(events: ITelemetryItem[]): void; // (undocumented) listeners: INotificationListener[]; perfEvent?(perfEvent: IPerfEvent): void; removeNotificationListener(listener: INotificationListener): void; } // @public export function InstrumentEvent(target: any, evtName: string, callbacks: IInstrumentHooksCallbacks, checkPrototype?: boolean): IInstrumentHook; // @public export function InstrumentFunc(target: any, funcName: string, callbacks: IInstrumentHooksCallbacks, checkPrototype?: boolean): IInstrumentHook; // @public export function InstrumentFuncs(target: any, funcNames: string[], callbacks: IInstrumentHooksCallbacks, checkPrototype?: boolean): IInstrumentHook[]; // @public export type InstrumentorHooksCallback = (funcArgs: IInstrumentCallDetails, ...orgArgs: any[]) => void; // @public export function InstrumentProto(target: any, funcName: string, callbacks: IInstrumentHooksCallbacks): IInstrumentHook; // @public export function InstrumentProtos(target: any, funcNames: string[], callbacks: IInstrumentHooksCallbacks): IInstrumentHook[]; // @public (undocumented) export class _InternalLogMessage { constructor(msgId: _InternalMessageId, msg: string, isUserAct?: boolean, properties?: Object); // (undocumented) static dataType: string; // (undocumented) message: string; // (undocumented) messageId: _InternalMessageId; } // @public export const _InternalMessageId: EnumValue; // @public (undocumented) export type _InternalMessageId = number | _eInternalMessageId; // @public export interface IPerfEvent { childEvts?: IPerfEvent[]; complete: () => void; exTime?: number; getCtx?: (key: string) => any; isAsync: boolean; isChildEvt: () => boolean; name: string; parent?: IPerfEvent; payload: any; setCtx?: (key: string, value: any) => void; start: number; time?: number; } // @public export interface IPerfManager { create(src: string, payloadDetails?: () => any, isAsync?: boolean): IPerfEvent | null | undefined; fire(perfEvent: IPerfEvent): void; getCtx(key: string): any; setCtx(key: string, value: any): void; } // @public export interface IPerfManagerProvider { getPerfMgr(): IPerfManager; setPerfMgr(perfMgr: IPerfManager): void; } // @public (undocumented) export interface IPlugin { readonly identifier: string; initialize: (config: IConfiguration, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain) => void; isInitialized?: () => boolean; teardown?: (unloadCtx: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState) => void | boolean; readonly version?: string; } // @public export interface IProcessTelemetryContext extends IBaseProcessingContext { createNew: (plugins?: IPlugin[] | ITelemetryPluginChain, startAt?: IPlugin) => IProcessTelemetryContext; processNext: (env: ITelemetryItem) => boolean | void; } // @public export interface IProcessTelemetryUnloadContext extends IBaseProcessingContext { createNew: (plugins?: IPlugin[] | ITelemetryPluginChain, startAt?: IPlugin) => IProcessTelemetryUnloadContext; processNext: (unloadState: ITelemetryUnloadState) => boolean | void; } // @public export interface IProcessTelemetryUpdateContext extends IBaseProcessingContext { createNew: (plugins?: IPlugin[] | ITelemetryPluginChain, startAt?: IPlugin) => IProcessTelemetryUpdateContext; processNext: (updateState: ITelemetryUpdateState) => boolean | void; } // @public (undocumented) export interface _IRegisteredEvents { // (undocumented) handler: any; // (undocumented) name: string; } // @public export let isArray: (obj: any) => obj is Array; // @public export function isBeaconsSupported(): boolean; // @public export function isBoolean(value: any): value is boolean; // @public export function isDate(obj: any): obj is Date; // @public export function isError(obj: any): obj is Error; // @public export function isFetchSupported(withKeepAlive?: boolean): boolean; // @public (undocumented) export function isFunction(value: any): value is Function; // @public export function isIE(): boolean; // @public (undocumented) export function isNotNullOrUndefined(value: T): value is T; // @public (undocumented) export function isNotTruthy(value: any): boolean; // @public (undocumented) export function isNotUndefined(value: T): value is T; // @public (undocumented) export function isNullOrUndefined(value: any): value is null | undefined; // @public export function isNumber(value: any): value is number; // @public (undocumented) export function isObject(value: T): value is T; // @public export function isReactNative(): boolean; // @public (undocumented) export function isSafari(userAgentStr?: string): boolean; // @public export function isString(value: any): value is string; // @public export function isSymbol(value: any): boolean; // @public (undocumented) export function isTruthy(value: any): boolean; // @public (undocumented) export function isTypeof(value: any, theType: string): boolean; // @public (undocumented) export function isUndefined(value: any): value is undefined; // @public export function isXhrSupported(): boolean; // @public (undocumented) export interface ITelemetryInitializerContainer { addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler | void; } // @public (undocumented) export interface ITelemetryInitializerHandler { // (undocumented) remove(): void; } // @public export interface ITelemetryItem { baseData?: { [key: string]: any; }; baseType?: string; data?: ICustomProperties; ext?: { [key: string]: any; }; iKey?: string; name: string; tags?: Tags & Tags[]; time?: string; ver?: string; } // Warning: (ae-forgotten-export) The symbol "ITelemetryProcessor" needs to be exported by the entry point applicationinsights-core-js.d.ts // // @public export interface ITelemetryPlugin extends ITelemetryProcessor, IPlugin { readonly priority: number; setNextPlugin?: (next: ITelemetryPlugin | ITelemetryPluginChain) => void; } // @public export interface ITelemetryPluginChain extends ITelemetryProcessor { getNext: () => ITelemetryPluginChain; getPlugin: () => ITelemetryPlugin; unload?: (unloadCtx: IProcessTelemetryUnloadContext, unloadState: ITelemetryUnloadState) => void; } // @public (undocumented) export interface ITelemetryUnloadState { // (undocumented) flushComplete?: boolean; // (undocumented) isAsync: boolean; // (undocumented) reason: TelemetryUnloadReason; } // @public (undocumented) export interface ITelemetryUpdateState { added?: IPlugin[]; reason: TelemetryUpdateReason; removed?: IPlugin[]; } // @public (undocumented) export interface IUnloadableComponent { _doUnload?: (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState, asyncCallback?: () => void) => void | boolean; } // @public (undocumented) export interface IUnloadHandlerContainer { // (undocumented) add: (handler: UnloadHandler) => void; // (undocumented) run: (itemCtx: IProcessTelemetryUnloadContext, unloadState: ITelemetryUnloadState) => void; } // @public export function _legacyCookieMgr(config?: IConfiguration, logger?: IDiagnosticLogger): ICookieMgr; // @public (undocumented) export const LoggingSeverity: EnumValue; // @public (undocumented) export type LoggingSeverity = number | eLoggingSeverity; // @public export function _logInternalMessage(logger: IDiagnosticLogger, severity: LoggingSeverity, message: _InternalLogMessage): void; // @public (undocumented) export function mergeEvtNamespace(theNamespace: string, namespaces?: string | string[] | null): string | string[]; // @public (undocumented) export const MinChannelPriorty: number; // @public export function mwcRandom32(signed?: boolean): number; // @public export function mwcRandomSeed(value?: number): void; // @public (undocumented) export function newGuid(): string; // @public export function newId(maxLength?: number): string; // @public export function normalizeJsName(name: string): string; // @public export class NotificationManager implements INotificationManager { constructor(config?: IConfiguration); addNotificationListener(listener: INotificationListener): void; eventsDiscarded(events: ITelemetryItem[], reason: number): void; eventsSendRequest?(sendReason: number, isAsync: boolean): void; eventsSent(events: ITelemetryItem[]): void; // (undocumented) listeners: INotificationListener[]; perfEvent?(perfEvent: IPerfEvent): void; removeNotificationListener(listener: INotificationListener): void; } export { objCreate } // @public export function objDefineAccessors(target: any, prop: string, getProp?: () => T, setProp?: (v: T) => void): boolean; // @public export function objExtend(deepExtend?: boolean, obj2?: T2, obj3?: T3, obj4?: T4, obj5?: T5, obj6?: T6): T2 & T3 & T4 & T5 & T6; // @public (undocumented) export function objExtend(obj1?: T1, obj2?: T2, obj3?: T3, obj4?: T4, obj5?: T5, obj6?: T6): T1 & T2 & T3 & T4 & T5 & T6; // @public export function objForEachKey(target: T, callbackfn: (name: string, value: T[keyof T]) => void): void; // @public (undocumented) export const objFreeze: (value: T) => T; // @public export function objKeys(obj: {}): string[]; // @public (undocumented) export const objSeal: (value: T) => T; // @public (undocumented) export function objToString(obj: any): any; // @public export function optimizeObject(theObject: T): T; // @public (undocumented) export class PerfEvent implements IPerfEvent { constructor(name: string, payloadDetails: () => any, isAsync: boolean); // (undocumented) static ChildrenContextKey: string; // (undocumented) complete: () => void; exTime?: number; // (undocumented) getCtx?: (key: string) => any | null | undefined; isAsync: boolean; isChildEvt: () => boolean; name: string; // (undocumented) static ParentContextKey: string; payload: any; // (undocumented) setCtx?: (key: string, value: any) => void; start: number; time?: number; } // @public (undocumented) export class PerfManager implements IPerfManager { constructor(manager?: INotificationManager); create(src: string, payload?: any, isAsync?: boolean): IPerfEvent | null | undefined; fire(perfEvent: IPerfEvent): void; getCtx(key: string): any; setCtx(key: string, value: any): void; } // @public export function perfNow(): number; // @public @deprecated export class ProcessTelemetryContext implements IProcessTelemetryContext { constructor(pluginChain: ITelemetryPluginChain, config: IConfiguration, core: IAppInsightsCore, startAt?: IPlugin); core: () => IAppInsightsCore; createNew: (plugins?: IPlugin[] | ITelemetryPluginChain, startAt?: IPlugin) => IProcessTelemetryContext; diagLog: () => IDiagnosticLogger; getCfg: () => IConfiguration; // (undocumented) getConfig: (identifier: string, field: string, defaultValue?: number | string | boolean | string[] | RegExp[] | Function) => number | string | boolean | string[] | RegExp[] | Function; // (undocumented) getExtCfg: (identifier: string, defaultValue?: T | any) => T; getNext: () => ITelemetryPluginChain; hasNext: () => boolean; iterate: (callback: (plugin: T) => void) => void; onComplete: (onComplete: () => void) => void; processNext: (env: ITelemetryItem) => boolean | void; setNext: (nextCtx: ITelemetryPluginChain) => void; } // @public export function proxyAssign(target: T, source: S, chkSet?: (name: string, isFunc?: boolean, source?: S, target?: T) => boolean): T; // @public export function proxyFunctionAs(target: T, name: string, source: S | (() => S), theFunc: (keyof S), overwriteTarget?: boolean): void; // @public export function proxyFunctions(target: T, source: S | (() => S), functionsToProxy: (keyof S)[], overwriteTarget?: boolean): T; // @public export function random32(signed?: boolean): number; // @public export function randomValue(maxValue: number): number; // @public export function removeEventHandler(eventName: string, callback: any, evtNamespace?: string | string[] | null): void; // @public export function removeEventListeners(events: string[], listener: any, evtNamespace?: string | string[]): void; // @public export function removePageHideEventListener(listener: any, evtNamespace?: string | string[] | null): void; // @public export function removePageShowEventListener(listener: any, evtNamespace?: string | string[] | null): void; // @public export function removePageUnloadEventListener(listener: any, evtNamespace?: string | string[]): void; // @public export function safeGetCookieMgr(core: IAppInsightsCore, config?: IConfiguration): ICookieMgr; // @public (undocumented) export function safeGetLogger(core: IAppInsightsCore, config?: IConfiguration): IDiagnosticLogger; // @public export const enum SendRequestReason { ManualFlush = 1, MaxBatchSize = 10, MaxQueuedEvents = 20, NormalSchedule = 1, Resumed = 4, Retry = 5, SdkUnload = 6, SyncEvent = 3, Undefined = 0, Unload = 2 } // @public @deprecated (undocumented) export function setCookie(logger: IDiagnosticLogger, name: string, value: string, domain?: string): void; // @public export function setEnableEnvMocks(enabled: boolean): void; // @public export function setGblPerfMgr(perfManager: IPerfManager): void; // @public export function setValue(target: T, field: K, value: T[K], valChk?: ((value: T[K]) => boolean) | null, srcChk?: ((value: T[K]) => boolean) | null): T[K]; // @public (undocumented) export function sortPlugins(plugins: T[]): T[]; // @public export function strContains(value: string, search: string): boolean; // @public export function strEndsWith(value: string, search: string): boolean; export { strFunction } export { strObject } export { strPrototype } // @public export function strStartsWith(value: string, checkValue: string): boolean; // @public export function strTrim(str: any): string; export { strUndefined } // @public (undocumented) export interface Tags { // (undocumented) [key: string]: any; } // @public (undocumented) export type TelemetryInitializerFunction = (item: T) => boolean | void; // @public export const enum TelemetryUnloadReason { ManualTeardown = 0, PluginReplace = 2, PluginUnload = 1, SdkUnload = 50 } // @public export const enum TelemetryUpdateReason { PluginAdded = 16, PluginRemoved = 32, Unknown = 0 } // @public (undocumented) export function throwError(message: string): never; // @public export function _throwInternal(logger: IDiagnosticLogger, severity: LoggingSeverity, msgId: _InternalMessageId, msg: string, properties?: Object, isUserAct?: boolean): void; // @public export function toISOString(date: Date): string; // @public (undocumented) export function uaDisallowsSameSiteNone(userAgent: string): boolean; // @public (undocumented) export const Undefined = "undefined"; // @public export function unloadComponents(components: any | IUnloadableComponent[], unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState, asyncCallback?: () => void): void | boolean; // @public (undocumented) export type UnloadHandler = (itemCtx: IProcessTelemetryUnloadContext, unloadState: ITelemetryUnloadState) => void; // @public (undocumented) export function useXDomainRequest(): boolean | undefined; // @public export function _warnToConsole(logger: IDiagnosticLogger, message: string): void; // (No @packageDocumentation comment for this package) ``` /*! * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.Microsoft = global.Microsoft || {}, global.Microsoft.ApplicationInsights = global.Microsoft.ApplicationInsights || {}))); })(this, (function (exports) { 'use strict'; var MinChannelPriorty = 100; var strShimFunction = "function"; var strShimObject = "object"; var strShimUndefined = "undefined"; var strShimPrototype = "prototype"; var strShimHasOwnProperty = "hasOwnProperty"; var ObjClass = Object; var ObjProto = ObjClass[strShimPrototype]; var ObjAssign = ObjClass["assign"]; var ObjCreate = ObjClass["create"]; var ObjDefineProperty = ObjClass["defineProperty"]; var ObjHasOwnProperty = ObjProto[strShimHasOwnProperty]; var _cachedGlobal = null; function getGlobal(useCached) { if (useCached === void 0) { useCached = true; } if (!_cachedGlobal || !useCached) { if (typeof globalThis !== strShimUndefined && globalThis) { _cachedGlobal = globalThis; } if (typeof self !== strShimUndefined && self) { _cachedGlobal = self; } if (typeof window !== strShimUndefined && window) { _cachedGlobal = window; } if (typeof global !== strShimUndefined && global) { _cachedGlobal = global; } } return _cachedGlobal; } function throwTypeError(message) { throw new TypeError(message); } function objCreateFn(obj) { var func = ObjCreate; if (func) { return func(obj); } if (obj == null) { return {}; } var type = typeof obj; if (type !== strShimObject && type !== strShimFunction) { throwTypeError("Object prototype may only be an Object:" + obj); } function tmpFunc() { } tmpFunc[strShimPrototype] = obj; return new tmpFunc(); } (getGlobal() || {})["Symbol"]; (getGlobal() || {})["Reflect"]; var extendStaticsFn = function (d, b) { extendStaticsFn = ObjClass["setPrototypeOf"] || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) { if (b[strShimHasOwnProperty](p)) { d[p] = b[p]; } } }; return extendStaticsFn(d, b); }; function __extendsFn(d, b) { if (typeof b !== strShimFunction && b !== null) { throwTypeError("Class extends value " + String(b) + " is not a constructor or null"); } extendStaticsFn(d, b); function __() { this.constructor = d; } d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new __()); } function __spreadArrayFn(to, from) { for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) { to[j] = from[i]; } return to; } var strEmpty = ""; var strProcessTelemetry = "processTelemetry"; var strPriority = "priority"; var strSetNextPlugin = "setNextPlugin"; var strIsInitialized = "isInitialized"; var strTeardown = "teardown"; var strCore = "core"; var strUpdate = "update"; var strDisabled = "disabled"; var strDoTeardown = "_doTeardown"; var strProcessNext = "processNext"; var strResume = "resume"; var strPause = "pause"; var strNotificationListener = "NotificationListener"; var strAddNotificationListener = "add" + strNotificationListener; var strRemoveNotificationListener = "remove" + strNotificationListener; var strEventsSent = "eventsSent"; var strEventsDiscarded = "eventsDiscarded"; var strEventsSendRequest = "eventsSendRequest"; var strPerfEvent = "perfEvent"; var strToISOString = "toISOString"; var cStrEndsWith = "endsWith"; var cStrStartsWith = "startsWith"; var strIndexOf = "indexOf"; var strMap = "map"; var strReduce = "reduce"; var cStrTrim = "trim"; var strToString = "toString"; var str__Proto$1 = "__proto__"; var strConstructor = "constructor"; var _objDefineProperty$1 = ObjDefineProperty; var _objFreeze = ObjClass.freeze; var _objSeal = ObjClass.seal; var _objKeys = ObjClass.keys; var StringProto = String[strShimPrototype]; var _strTrim = StringProto[cStrTrim]; var _strEndsWith = StringProto[cStrEndsWith]; var _strStartsWith = StringProto[cStrStartsWith]; var DateProto = Date[strShimPrototype]; var _dataToISOString = DateProto[strToISOString]; var _isArray = Array.isArray; var _objToString = ObjProto[strToString]; var _fnToString = ObjHasOwnProperty[strToString]; var _objFunctionString = _fnToString.call(ObjClass); var rCamelCase = /-([a-z])/g; var rNormalizeInvalid = /([^\w\d_$])/g; var rLeadingNumeric = /^(\d+[\w\d_$])/; var _objGetPrototypeOf$1 = Object["getPrototypeOf"]; function _getObjProto$1(target) { if (target) { if (_objGetPrototypeOf$1) { return _objGetPrototypeOf$1(target); } var newProto = target[str__Proto$1] || target[strShimPrototype] || target[strConstructor]; if (newProto) { return newProto; } } return null; } function objToString(obj) { return _objToString.call(obj); } function isTypeof(value, theType) { return typeof value === theType; } function isUndefined(value) { return value === undefined || typeof value === strShimUndefined; } function isNotUndefined(value) { return !isUndefined(value); } function isNullOrUndefined(value) { return (value === null || isUndefined(value)); } function isNotNullOrUndefined(value) { return !isNullOrUndefined(value); } function hasOwnProperty(obj, prop) { return !!(obj && ObjHasOwnProperty.call(obj, prop)); } function isObject(value) { return !!(value && typeof value === strShimObject); } function isFunction(value) { return !!(value && typeof value === strShimFunction); } function normalizeJsName(name) { var value = name; if (value && isString(value)) { value = value.replace(rCamelCase, function (_all, letter) { return letter.toUpperCase(); }); value = value.replace(rNormalizeInvalid, "_"); value = value.replace(rLeadingNumeric, function (_all, match) { return "_" + match; }); } return value; } function objForEachKey(target, callbackfn) { if (target) { for (var prop in target) { if (ObjHasOwnProperty.call(target, prop)) { callbackfn.call(target, prop, target[prop]); } } } } function strEndsWith(value, search) { var result = false; if (value && search && !(result = value === search)) { result = _strEndsWith ? value[cStrEndsWith](search) : _strEndsWithPoly(value, search); } return result; } function _strEndsWithPoly(value, search) { var result = false; var searchLen = search ? search.length : 0; var valLen = value ? value.length : 0; if (searchLen && valLen && valLen >= searchLen && !(result = value === search)) { var pos = valLen - 1; for (var lp = searchLen - 1; lp >= 0; lp--) { if (value[pos] != search[lp]) { return false; } pos--; } result = true; } return result; } function strStartsWith(value, checkValue) { var result = false; if (value && checkValue && !(result = value === checkValue)) { result = _strStartsWith ? value[cStrStartsWith](checkValue) : _strStartsWithPoly(value, checkValue); } return result; } function _strStartsWithPoly(value, checkValue) { var result = false; var chkLen = checkValue ? checkValue.length : 0; if (value && chkLen && value.length >= chkLen && !(result = value === checkValue)) { for (var lp = 0; lp < chkLen; lp++) { if (value[lp] !== checkValue[lp]) { return false; } } result = true; } return result; } function strContains(value, search) { if (value && search) { return value.indexOf(search) !== -1; } return false; } function isDate(obj) { return !!(obj && _objToString.call(obj) === "[object Date]"); } var isArray = _isArray || _isArrayPoly; function _isArrayPoly(obj) { return !!(obj && _objToString.call(obj) === "[object Array]"); } function isError(obj) { return !!(obj && _objToString.call(obj) === "[object Error]"); } function isString(value) { return typeof value === "string"; } function isNumber(value) { return typeof value === "number"; } function isBoolean(value) { return typeof value === "boolean"; } function isSymbol(value) { return typeof value === "symbol"; } function isPlainObject(value) { var result = false; if (value && typeof value === "object") { var proto = _objGetPrototypeOf$1 ? _objGetPrototypeOf$1(value) : _getObjProto$1(value); if (!proto) { result = true; } else { if (proto[strConstructor] && ObjHasOwnProperty.call(proto, strConstructor)) { proto = proto[strConstructor]; } result = typeof proto === strShimFunction && _fnToString.call(proto) === _objFunctionString; } } return result; } function toISOString(date) { if (date) { return _dataToISOString ? date[strToISOString]() : _toISOStringPoly(date); } } function _toISOStringPoly(date) { if (date && date.getUTCFullYear) { var pad = function (num) { var r = String(num); if (r.length === 1) { r = "0" + r; } return r; }; return date.getUTCFullYear() + "-" + pad(date.getUTCMonth() + 1) + "-" + pad(date.getUTCDate()) + "T" + pad(date.getUTCHours()) + ":" + pad(date.getUTCMinutes()) + ":" + pad(date.getUTCSeconds()) + "." + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5) + "Z"; } } function arrForEach(arr, callbackfn, thisArg) { var len = arr.length; try { for (var idx = 0; idx < len; idx++) { if (idx in arr) { if (callbackfn.call(thisArg || arr, arr[idx], idx, arr) === -1) { break; } } } } catch (e) { } } function arrIndexOf(arr, searchElement, fromIndex) { if (arr) { if (arr[strIndexOf]) { return arr[strIndexOf](searchElement, fromIndex); } var len = arr.length; var from = fromIndex || 0; try { for (var lp = Math.max(from >= 0 ? from : len - Math.abs(from), 0); lp < len; lp++) { if (lp in arr && arr[lp] === searchElement) { return lp; } } } catch (e) { } } return -1; } function arrMap(arr, callbackfn, thisArg) { var results; if (arr) { if (arr[strMap]) { return arr[strMap](callbackfn, thisArg); } var len = arr.length; var _this = thisArg || arr; results = new Array(len); try { for (var lp = 0; lp < len; lp++) { if (lp in arr) { results[lp] = callbackfn.call(_this, arr[lp], arr); } } } catch (e) { } } return results; } function arrReduce(arr, callbackfn, initialValue) { var value; if (arr) { if (arr[strReduce]) { return arr[strReduce](callbackfn, initialValue); } var len = arr.length; var lp = 0; if (arguments.length >= 3) { value = arguments[2]; } else { while (lp < len && !(lp in arr)) { lp++; } value = arr[lp++]; } while (lp < len) { if (lp in arr) { value = callbackfn(value, arr[lp], lp, arr); } lp++; } } return value; } function strTrim(str) { if (str) { str = (_strTrim && str[cStrTrim]) ? str[cStrTrim]() : (str.replace ? str.replace(/^\s+|\s+$/g, "") : str); } return str; } var _objKeysHasDontEnumBug = !({ toString: null }).propertyIsEnumerable("toString"); var _objKeysDontEnums = [ "toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor" ]; function objKeys(obj) { var objType = typeof obj; if (objType !== strShimFunction && (objType !== strShimObject || obj === null)) { throwTypeError("objKeys called on non-object"); } if (!_objKeysHasDontEnumBug && _objKeys) { return _objKeys(obj); } var result = []; for (var prop in obj) { if (obj && ObjHasOwnProperty.call(obj, prop)) { result.push(prop); } } if (_objKeysHasDontEnumBug) { var dontEnumsLength = _objKeysDontEnums.length; for (var lp = 0; lp < dontEnumsLength; lp++) { if (obj && ObjHasOwnProperty.call(obj, _objKeysDontEnums[lp])) { result.push(_objKeysDontEnums[lp]); } } } return result; } function objDefineAccessors(target, prop, getProp, setProp) { if (_objDefineProperty$1) { try { var descriptor = { enumerable: true, configurable: true }; if (getProp) { descriptor.get = getProp; } if (setProp) { descriptor.set = setProp; } _objDefineProperty$1(target, prop, descriptor); return true; } catch (e) { } } return false; } function _doNothing(value) { return value; } function deepFreeze(obj) { if (_objFreeze) { objForEachKey(obj, function (name, value) { if (isArray(value) || isObject(value)) { _objFreeze(value); } }); } return objFreeze(obj); } var objFreeze = _objFreeze || _doNothing; var objSeal = _objSeal || _doNothing; function dateNow() { var dt = Date; return dt.now ? dt.now() : new dt().getTime(); } function getExceptionName(object) { if (isError(object)) { return object.name; } return strEmpty; } function setValue(target, field, value, valChk, srcChk) { var theValue = value; if (target) { theValue = target[field]; if (theValue !== value && (!srcChk || srcChk(theValue)) && (!valChk || valChk(value))) { theValue = value; target[field] = theValue; } } return theValue; } function getSetValue(target, field, defValue) { var theValue; if (target) { theValue = target[field]; if (!theValue && isNullOrUndefined(theValue)) { theValue = !isUndefined(defValue) ? defValue : {}; target[field] = theValue; } } else { theValue = !isUndefined(defValue) ? defValue : {}; } return theValue; } function isNotTruthy(value) { return !value; } function isTruthy(value) { return !!value; } function throwError(message) { throw new Error(message); } function _createProxyFunction(source, funcName) { var srcFunc = null; var src = null; if (isFunction(source)) { srcFunc = source; } else { src = source; } return function () { var originalArguments = arguments; if (srcFunc) { src = srcFunc(); } if (src) { return src[funcName].apply(src, originalArguments); } }; } function proxyAssign(target, source, chkSet) { if (target && source && isObject(target) && isObject(source)) { var _loop_1 = function (field) { if (isString(field)) { var value = source[field]; if (isFunction(value)) { if (!chkSet || chkSet(field, true, source, target)) { target[field] = _createProxyFunction(source, field); } } else if (!chkSet || chkSet(field, false, source, target)) { if (hasOwnProperty(target, field)) { delete target[field]; } if (!objDefineAccessors(target, field, function () { return source[field]; }, function (theValue) { source[field] = theValue; })) { target[field] = value; } } } }; for (var field in source) { _loop_1(field); } } return target; } function proxyFunctionAs(target, name, source, theFunc, overwriteTarget) { if (target && name && source) { if (overwriteTarget !== false || isUndefined(target[name])) { target[name] = _createProxyFunction(source, theFunc); } } } function proxyFunctions(target, source, functionsToProxy, overwriteTarget) { if (target && source && isObject(target) && isArray(functionsToProxy)) { arrForEach(functionsToProxy, function (theFuncName) { if (isString(theFuncName)) { proxyFunctionAs(target, theFuncName, source, theFuncName, overwriteTarget); } }); } return target; } function createClassFromInterface(defaults) { return /** @class */ (function () { function class_1() { var _this_1 = this; if (defaults) { objForEachKey(defaults, function (field, value) { _this_1[field] = value; }); } } return class_1; }()); } function optimizeObject(theObject) { if (theObject && ObjAssign) { theObject = ObjClass(ObjAssign({}, theObject)); } return theObject; } function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) { var theArgs = arguments; var extended = theArgs[0] || {}; var argLen = theArgs.length; var deep = false; var idx = 1; if (argLen > 0 && isBoolean(extended)) { deep = extended; extended = theArgs[idx] || {}; idx++; } if (!isObject(extended)) { extended = {}; } for (; idx < argLen; idx++) { var arg = theArgs[idx]; var isArgArray = isArray(arg); var isArgObj = isObject(arg); for (var prop in arg) { var propOk = (isArgArray && (prop in arg)) || (isArgObj && (ObjHasOwnProperty.call(arg, prop))); if (!propOk) { continue; } var newValue = arg[prop]; var isNewArray = void 0; if (deep && newValue && ((isNewArray = isArray(newValue)) || isPlainObject(newValue))) { var clone = extended[prop]; if (isNewArray) { if (!isArray(clone)) { clone = []; } } else if (!isPlainObject(clone)) { clone = {}; } newValue = objExtend(deep, clone, newValue); } if (newValue !== undefined) { extended[prop] = newValue; } } } return extended; } function createEnumStyle(values) { var enumClass = {}; objForEachKey(values, function (field, value) { enumClass[field] = value; enumClass[value] = field; }); return deepFreeze(enumClass); } function createEnumMap(values) { var mapClass = {}; objForEachKey(values, function (field, value) { mapClass[field] = field; mapClass[value] = field; }); return deepFreeze(mapClass); } function createValueMap(values) { var mapClass = {}; objForEachKey(values, function (field, value) { mapClass[field] = value[1]; mapClass[value[0]] = value[1]; }); return deepFreeze(mapClass); } var EventsDiscardedReason = createEnumStyle({ Unknown: 0 , NonRetryableStatus: 1 , InvalidEvent: 2 , SizeLimitExceeded: 3 , KillSwitch: 4 , QueueFull: 5 }); /*! * Microsoft Dynamic Proto Utility, 1.1.6 * Copyright (c) Microsoft and contributors. All rights reserved. */ var Constructor = 'constructor'; var Prototype = 'prototype'; var strFunction = 'function'; var DynInstFuncTable = '_dynInstFuncs'; var DynProxyTag = '_isDynProxy'; var DynClassName = '_dynClass'; var DynClassNamePrefix = '_dynCls$'; var DynInstChkTag = '_dynInstChk'; var DynAllowInstChkTag = DynInstChkTag; var DynProtoDefaultOptions = '_dfOpts'; var UnknownValue = '_unknown_'; var str__Proto = "__proto__"; var DynProtoBaseProto = "_dyn" + str__Proto; var DynProtoCurrent = "_dynInstProto"; var strUseBaseInst = 'useBaseInst'; var strSetInstFuncs = 'setInstFuncs'; var Obj = Object; var _objGetPrototypeOf = Obj["getPrototypeOf"]; var _objGetOwnProps = Obj["getOwnPropertyNames"]; var _dynamicNames = 0; function _hasOwnProperty(obj, prop) { return obj && Obj[Prototype].hasOwnProperty.call(obj, prop); } function _isObjectOrArrayPrototype(target) { return target && (target === Obj[Prototype] || target === Array[Prototype]); } function _isObjectArrayOrFunctionPrototype(target) { return _isObjectOrArrayPrototype(target) || target === Function[Prototype]; } function _getObjProto(target) { var newProto; if (target) { if (_objGetPrototypeOf) { return _objGetPrototypeOf(target); } var curProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null); newProto = target[DynProtoBaseProto] || curProto; if (!_hasOwnProperty(target, DynProtoBaseProto)) { delete target[DynProtoCurrent]; newProto = target[DynProtoBaseProto] = target[DynProtoCurrent] || target[DynProtoBaseProto]; target[DynProtoCurrent] = curProto; } } return newProto; } function _forEachProp(target, func) { var props = []; if (_objGetOwnProps) { props = _objGetOwnProps(target); } else { for (var name_1 in target) { if (typeof name_1 === "string" && _hasOwnProperty(target, name_1)) { props.push(name_1); } } } if (props && props.length > 0) { for (var lp = 0; lp < props.length; lp++) { func(props[lp]); } } } function _isDynamicCandidate(target, funcName, skipOwn) { return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName))); } function _throwTypeError(message) { throw new TypeError("DynamicProto: " + message); } function _getInstanceFuncs(thisTarget) { var instFuncs = {}; _forEachProp(thisTarget, function (name) { if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) { instFuncs[name] = thisTarget[name]; } }); return instFuncs; } function _hasVisited(values, value) { for (var lp = values.length - 1; lp >= 0; lp--) { if (values[lp] === value) { return true; } } return false; } function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) { function _instFuncProxy(target, funcHost, funcName) { var theFunc = funcHost[funcName]; if (theFunc[DynProxyTag] && useBaseInst) { var instFuncTable = target[DynInstFuncTable] || {}; if (instFuncTable[DynAllowInstChkTag] !== false) { theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc; } } return function () { return theFunc.apply(target, arguments); }; } var baseFuncs = {}; _forEachProp(instFuncs, function (name) { baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name); }); var baseProto = _getObjProto(classProto); var visited = []; while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) { _forEachProp(baseProto, function (name) { if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) { baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name); } }); visited.push(baseProto); baseProto = _getObjProto(baseProto); } return baseFuncs; } function _getInstFunc(target, funcName, proto, currentDynProtoProxy) { var instFunc = null; if (target && _hasOwnProperty(proto, DynClassName)) { var instFuncTable = target[DynInstFuncTable] || {}; instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName]; if (!instFunc) { _throwTypeError("Missing [" + funcName + "] " + strFunction); } if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) { var canAddInst = !_hasOwnProperty(target, funcName); var objProto = _getObjProto(target); var visited = []; while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) { var protoFunc = objProto[funcName]; if (protoFunc) { canAddInst = (protoFunc === currentDynProtoProxy); break; } visited.push(objProto); objProto = _getObjProto(objProto); } try { if (canAddInst) { target[funcName] = instFunc; } instFunc[DynInstChkTag] = 1; } catch (e) { instFuncTable[DynAllowInstChkTag] = false; } } } return instFunc; } function _getProtoFunc(funcName, proto, currentDynProtoProxy) { var protoFunc = proto[funcName]; if (protoFunc === currentDynProtoProxy) { protoFunc = _getObjProto(proto)[funcName]; } if (typeof protoFunc !== strFunction) { _throwTypeError("[" + funcName + "] is not a " + strFunction); } return protoFunc; } function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) { function _createDynamicPrototype(proto, funcName) { var dynProtoProxy = function () { var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy); return instFunc.apply(this, arguments); }; dynProtoProxy[DynProxyTag] = 1; return dynProtoProxy; } if (!_isObjectOrArrayPrototype(proto)) { var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {}; var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {}); if (instFuncTable[DynAllowInstChkTag] !== false) { instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc; } _forEachProp(target, function (name) { if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) { instFuncs_1[name] = target[name]; delete target[name]; if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) { proto[name] = _createDynamicPrototype(proto, name); } } }); } } function _checkPrototype(classProto, thisTarget) { if (_objGetPrototypeOf) { var visited = []; var thisProto = _getObjProto(thisTarget); while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) { if (thisProto === classProto) { return true; } visited.push(thisProto); thisProto = _getObjProto(thisProto); } return false; } return true; } function _getObjName(target, unknownValue) { if (_hasOwnProperty(target, Prototype)) { return target.name || unknownValue || UnknownValue; } return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue; } function dynamicProto(theClass, target, delegateFunc, options) { if (!_hasOwnProperty(theClass, Prototype)) { _throwTypeError("theClass is an invalid class definition."); } var classProto = theClass[Prototype]; if (!_checkPrototype(classProto, target)) { _throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]"); } var className = null; if (_hasOwnProperty(classProto, DynClassName)) { className = classProto[DynClassName]; } else { className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _dynamicNames; _dynamicNames++; classProto[DynClassName] = className; } var perfOptions = dynamicProto[DynProtoDefaultOptions]; var useBaseInst = !!perfOptions[strUseBaseInst]; if (useBaseInst && options && options[strUseBaseInst] !== undefined) { useBaseInst = !!options[strUseBaseInst]; } var instFuncs = _getInstanceFuncs(target); var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst); delegateFunc(target, baseFuncs); var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs]; if (setInstanceFunc && options) { setInstanceFunc = !!options[strSetInstFuncs]; } _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false); } var perfDefaults = { setInstFuncs: true, useBaseInst: true }; dynamicProto[DynProtoDefaultOptions] = perfDefaults; var strWindow = "window"; var strDocument = "document"; var strDocumentMode = "documentMode"; var strNavigator = "navigator"; var strHistory = "history"; var strLocation = "location"; var strConsole = "console"; var strPerformance = "performance"; var strJSON = "JSON"; var strCrypto = "crypto"; var strMsCrypto = "msCrypto"; var strReactNative = "ReactNative"; var strMsie = "msie"; var strTrident = "trident/"; var strXMLHttpRequest = "XMLHttpRequest"; var _isTrident = null; var _navUserAgentCheck = null; var _enableMocks = false; var _useXDomainRequest = null; var _beaconsSupported = null; function _hasProperty(theClass, property) { var supported = false; if (theClass) { try { supported = property in theClass; if (!supported) { var proto = theClass[strShimPrototype]; if (proto) { supported = property in proto; } } } catch (e) { } if (!supported) { try { var tmp = new theClass(); supported = !isUndefined(tmp[property]); } catch (e) { } } } return supported; } function setEnableEnvMocks(enabled) { _enableMocks = enabled; } function getGlobalInst(name) { var gbl = getGlobal(); if (gbl && gbl[name]) { return gbl[name]; } if (name === strWindow && hasWindow()) { return window; } return null; } function hasWindow() { return Boolean(typeof window === strShimObject && window); } function getWindow() { if (hasWindow()) { return window; } return getGlobalInst(strWindow); } function hasDocument() { return Boolean(typeof document === strShimObject && document); } function getDocument() { if (hasDocument()) { return document; } return getGlobalInst(strDocument); } function hasNavigator() { return Boolean(typeof navigator === strShimObject && navigator); } function getNavigator() { if (hasNavigator()) { return navigator; } return getGlobalInst(strNavigator); } function hasHistory() { return Boolean(typeof history === strShimObject && history); } function getHistory() { if (hasHistory()) { return history; } return getGlobalInst(strHistory); } function getLocation(checkForMock) { if (checkForMock && _enableMocks) { var mockLocation = getGlobalInst("__mockLocation"); if (mockLocation) { return mockLocation; } } if (typeof location === strShimObject && location) { return location; } return getGlobalInst(strLocation); } function getConsole() { if (typeof console !== strShimUndefined) { return console; } return getGlobalInst(strConsole); } function getPerformance() { return getGlobalInst(strPerformance); } function hasJSON() { return Boolean((typeof JSON === strShimObject && JSON) || getGlobalInst(strJSON) !== null); } function getJSON() { if (hasJSON()) { return JSON || getGlobalInst(strJSON); } return null; } function getCrypto() { return getGlobalInst(strCrypto); } function getMsCrypto() { return getGlobalInst(strMsCrypto); } function isReactNative() { var nav = getNavigator(); if (nav && nav.product) { return nav.product === strReactNative; } return false; } function isIE() { var nav = getNavigator(); if (nav && (nav.userAgent !== _navUserAgentCheck || _isTrident === null)) { _navUserAgentCheck = nav.userAgent; var userAgent = (_navUserAgentCheck || strEmpty).toLowerCase(); _isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident)); } return _isTrident; } function getIEVersion(userAgentStr) { if (userAgentStr === void 0) { userAgentStr = null; } if (!userAgentStr) { var navigator_1 = getNavigator() || {}; userAgentStr = navigator_1 ? (navigator_1.userAgent || strEmpty).toLowerCase() : strEmpty; } var ua = (userAgentStr || strEmpty).toLowerCase(); if (strContains(ua, strMsie)) { var doc = getDocument() || {}; return Math.max(parseInt(ua.split(strMsie)[1]), (doc[strDocumentMode] || 0)); } else if (strContains(ua, strTrident)) { var tridentVer = parseInt(ua.split(strTrident)[1]); if (tridentVer) { return tridentVer + 4; } } return null; } function dumpObj(object) { var objectTypeDump = Object[strShimPrototype].toString.call(object); var propertyValueDump = strEmpty; if (objectTypeDump === "[object Error]") { propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'"; } else if (hasJSON()) { propertyValueDump = getJSON().stringify(object); } return objectTypeDump + propertyValueDump; } function isSafari(userAgentStr) { if (!userAgentStr || !isString(userAgentStr)) { var navigator_2 = getNavigator() || {}; userAgentStr = navigator_2 ? (navigator_2.userAgent || strEmpty).toLowerCase() : strEmpty; } var ua = (userAgentStr || strEmpty).toLowerCase(); return (ua.indexOf("safari") >= 0); } function isBeaconsSupported() { if (_beaconsSupported === null) { _beaconsSupported = hasNavigator() && Boolean(getNavigator().sendBeacon); } return _beaconsSupported; } function isFetchSupported(withKeepAlive) { var isSupported = false; try { isSupported = !!getGlobalInst("fetch"); var request = getGlobalInst("Request"); if (isSupported && withKeepAlive && request) { isSupported = _hasProperty(request, "keepalive"); } } catch (e) { } return isSupported; } function useXDomainRequest() { if (_useXDomainRequest === null) { _useXDomainRequest = (typeof XDomainRequest !== strShimUndefined); if (_useXDomainRequest && isXhrSupported()) { _useXDomainRequest = _useXDomainRequest && !_hasProperty(getGlobalInst(strXMLHttpRequest), "withCredentials"); } } return _useXDomainRequest; } function isXhrSupported() { var isSupported = false; try { var xmlHttpRequest = getGlobalInst(strXMLHttpRequest); isSupported = !!xmlHttpRequest; } catch (e) { } return isSupported; } var listenerFuncs = ["eventsSent", "eventsDiscarded", "eventsSendRequest", "perfEvent"]; var _aiNamespace = null; var _debugListener; function _listenerProxyFunc(name, config) { return function () { var args = arguments; var dbgExt = getDebugExt(config); if (dbgExt) { var listener = dbgExt.listener; if (listener && listener[name]) { listener[name].apply(listener, args); } } }; } function _getExtensionNamespace() { var target = getGlobalInst("Microsoft"); if (target) { _aiNamespace = target["ApplicationInsights"]; } return _aiNamespace; } function getDebugExt(config) { var ns = _aiNamespace; if (!ns && config.disableDbgExt !== true) { ns = _aiNamespace || _getExtensionNamespace(); } return ns ? ns["ChromeDbgExt"] : null; } function getDebugListener(config) { if (!_debugListener) { _debugListener = {}; for (var lp = 0; lp < listenerFuncs.length; lp++) { _debugListener[listenerFuncs[lp]] = _listenerProxyFunc(listenerFuncs[lp], config); } } return _debugListener; } var AiNonUserActionablePrefix = "AI (Internal): "; var AiUserActionablePrefix = "AI: "; var AIInternalMessagePrefix = "AITR_"; var strErrorToConsole = "errorToConsole"; var strWarnToConsole = "warnToConsole"; function _sanitizeDiagnosticText(text) { if (text) { return "\"" + text.replace(/\"/g, strEmpty) + "\""; } return strEmpty; } function _logToConsole(func, message) { var theConsole = getConsole(); if (!!theConsole) { var logFunc = "log"; if (theConsole[func]) { logFunc = func; } if (isFunction(theConsole[logFunc])) { theConsole[logFunc](message); } } } var _InternalLogMessage = /** @class */ (function () { function _InternalLogMessage(msgId, msg, isUserAct, properties) { if (isUserAct === void 0) { isUserAct = false; } var _self = this; _self.messageId = msgId; _self.message = (isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) + msgId; var strProps = strEmpty; if (hasJSON()) { strProps = getJSON().stringify(properties); } var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : strEmpty) + (properties ? " props:" + _sanitizeDiagnosticText(strProps) : strEmpty); _self.message += diagnosticText; } _InternalLogMessage.dataType = "MessageData"; return _InternalLogMessage; }()); function safeGetLogger(core, config) { return (core || {}).logger || new DiagnosticLogger(config); } var DiagnosticLogger = /** @class */ (function () { function DiagnosticLogger(config) { this.identifier = "DiagnosticLogger"; this.queue = []; var _messageCount = 0; var _messageLogged = {}; dynamicProto(DiagnosticLogger, this, function (_self) { if (isNullOrUndefined(config)) { config = {}; } _self.consoleLoggingLevel = function () { return _getConfigValue("loggingLevelConsole", 0); }; _self.telemetryLoggingLevel = function () { return _getConfigValue("loggingLevelTelemetry", 1); }; _self.maxInternalMessageLimit = function () { return _getConfigValue("maxMessageLimit", 25); }; _self.enableDebugExceptions = function () { return _getConfigValue("enableDebugExceptions", false); }; _self.throwInternal = function (severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } var message = new _InternalLogMessage(msgId, msg, isUserAct, properties); if (_self.enableDebugExceptions()) { throw dumpObj(message); } else { var logFunc = severity === 1 ? strErrorToConsole : strWarnToConsole; if (!isUndefined(message.message)) { var logLevel = _self.consoleLoggingLevel(); if (isUserAct) { var messageKey = +message.messageId; if (!_messageLogged[messageKey] && logLevel >= severity) { _self[logFunc](message.message); _messageLogged[messageKey] = true; } } else { if (logLevel >= severity) { _self[logFunc](message.message); } } _self.logInternalMessage(severity, message); } else { _debugExtMsg("throw" + (severity === 1 ? "Critical" : "Warning"), message); } } }; _self.warnToConsole = function (message) { _logToConsole("warn", message); _debugExtMsg("warning", message); }; _self.errorToConsole = function (message) { _logToConsole("error", message); _debugExtMsg("error", message); }; _self.resetInternalMessageCount = function () { _messageCount = 0; _messageLogged = {}; }; _self.logInternalMessage = function (severity, message) { if (_areInternalMessagesThrottled()) { return; } var logMessage = true; var messageKey = AIInternalMessagePrefix + message.messageId; if (_messageLogged[messageKey]) { logMessage = false; } else { _messageLogged[messageKey] = true; } if (logMessage) { if (severity <= _self.telemetryLoggingLevel()) { _self.queue.push(message); _messageCount++; _debugExtMsg((severity === 1 ? "error" : "warn"), message); } if (_messageCount === _self.maxInternalMessageLimit()) { var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app."; var throttleMessage = new _InternalLogMessage(23 , throttleLimitMessage, false); _self.queue.push(throttleMessage); if (severity === 1 ) { _self.errorToConsole(throttleLimitMessage); } else { _self.warnToConsole(throttleLimitMessage); } } } }; function _getConfigValue(name, defValue) { var value = config[name]; if (!isNullOrUndefined(value)) { return value; } return defValue; } function _areInternalMessagesThrottled() { return _messageCount >= _self.maxInternalMessageLimit(); } function _debugExtMsg(name, data) { var dbgExt = getDebugExt(config); if (dbgExt && dbgExt.diagLog) { dbgExt.diagLog(name, data); } } }); } return DiagnosticLogger; }()); function _getLogger(logger) { return (logger || new DiagnosticLogger()); } function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } (logger || new DiagnosticLogger()).throwInternal(severity, msgId, msg, properties, isUserAct); } function _warnToConsole(logger, message) { _getLogger(logger).warnToConsole(message); } function _logInternalMessage(logger, severity, message) { _getLogger(logger).logInternalMessage(severity, message); } var strExecutionContextKey = "ctx"; var _defaultPerfManager = null; var PerfEvent = /** @class */ (function () { function PerfEvent(name, payloadDetails, isAsync) { var _self = this; var accessorDefined = false; _self.start = dateNow(); _self.name = name; _self.isAsync = isAsync; _self.isChildEvt = function () { return false; }; if (isFunction(payloadDetails)) { var theDetails_1; accessorDefined = objDefineAccessors(_self, "payload", function () { if (!theDetails_1 && isFunction(payloadDetails)) { theDetails_1 = payloadDetails(); payloadDetails = null; } return theDetails_1; }); } _self.getCtx = function (key) { if (key) { if (key === PerfEvent.ParentContextKey || key === PerfEvent.ChildrenContextKey) { return _self[key]; } return (_self[strExecutionContextKey] || {})[key]; } return null; }; _self.setCtx = function (key, value) { if (key) { if (key === PerfEvent.ParentContextKey) { if (!_self[key]) { _self.isChildEvt = function () { return true; }; } _self[key] = value; } else if (key === PerfEvent.ChildrenContextKey) { _self[key] = value; } else { var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {}; ctx[key] = value; } } }; _self.complete = function () { var childTime = 0; var childEvts = _self.getCtx(PerfEvent.ChildrenContextKey); if (isArray(childEvts)) { for (var lp = 0; lp < childEvts.length; lp++) { var childEvt = childEvts[lp]; if (childEvt) { childTime += childEvt.time; } } } _self.time = dateNow() - _self.start; _self.exTime = _self.time - childTime; _self.complete = function () { }; if (!accessorDefined && isFunction(payloadDetails)) { _self.payload = payloadDetails(); } }; } PerfEvent.ParentContextKey = "parent"; PerfEvent.ChildrenContextKey = "childEvts"; return PerfEvent; }()); var PerfManager = /** @class */ (function () { function PerfManager(manager) { this.ctx = {}; dynamicProto(PerfManager, this, function (_self) { _self.create = function (src, payloadDetails, isAsync) { return new PerfEvent(src, payloadDetails, isAsync); }; _self.fire = function (perfEvent) { if (perfEvent) { perfEvent.complete(); if (manager && isFunction(manager.perfEvent)) { manager.perfEvent(perfEvent); } } }; _self.setCtx = function (key, value) { if (key) { var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {}; ctx[key] = value; } }; _self.getCtx = function (key) { return (_self[strExecutionContextKey] || {})[key]; }; }); } return PerfManager; }()); var doPerfActiveKey = "CoreUtils.doPerf"; function doPerf(mgrSource, getSource, func, details, isAsync) { if (mgrSource) { var perfMgr = mgrSource; if (isFunction(perfMgr["getPerfMgr"])) { perfMgr = perfMgr["getPerfMgr"](); } if (perfMgr) { var perfEvt = void 0; var currentActive = perfMgr.getCtx(doPerfActiveKey); try { perfEvt = perfMgr.create(getSource(), details, isAsync); if (perfEvt) { if (currentActive && perfEvt.setCtx) { perfEvt.setCtx(PerfEvent.ParentContextKey, currentActive); if (currentActive.getCtx && currentActive.setCtx) { var children = currentActive.getCtx(PerfEvent.ChildrenContextKey); if (!children) { children = []; currentActive.setCtx(PerfEvent.ChildrenContextKey, children); } children.push(perfEvt); } } perfMgr.setCtx(doPerfActiveKey, perfEvt); return func(perfEvt); } } catch (ex) { if (perfEvt && perfEvt.setCtx) { perfEvt.setCtx("exception", ex); } } finally { if (perfEvt) { perfMgr.fire(perfEvt); } perfMgr.setCtx(doPerfActiveKey, currentActive); } } } return func(); } function setGblPerfMgr(perfManager) { _defaultPerfManager = perfManager; } function getGblPerfMgr() { return _defaultPerfManager; } var UInt32Mask = 0x100000000; var MaxUInt32 = 0xffffffff; var _mwcSeeded = false; var _mwcW = 123456789; var _mwcZ = 987654321; function _mwcSeed(seedValue) { if (seedValue < 0) { seedValue >>>= 0; } _mwcW = (123456789 + seedValue) & MaxUInt32; _mwcZ = (987654321 - seedValue) & MaxUInt32; _mwcSeeded = true; } function _autoSeedMwc() { try { var now = dateNow() & 0x7fffffff; _mwcSeed(((Math.random() * UInt32Mask) ^ now) + now); } catch (e) { } } function randomValue(maxValue) { if (maxValue > 0) { return Math.floor((random32() / MaxUInt32) * (maxValue + 1)) >>> 0; } return 0; } function random32(signed) { var value = 0; var c = getCrypto() || getMsCrypto(); if (c && c.getRandomValues) { value = c.getRandomValues(new Uint32Array(1))[0] & MaxUInt32; } if (value === 0 && isIE()) { if (!_mwcSeeded) { _autoSeedMwc(); } value = mwcRandom32() & MaxUInt32; } if (value === 0) { value = Math.floor((UInt32Mask * Math.random()) | 0); } if (!signed) { value >>>= 0; } return value; } function mwcRandomSeed(value) { if (!value) { _autoSeedMwc(); } else { _mwcSeed(value); } } function mwcRandom32(signed) { _mwcZ = (36969 * (_mwcZ & 0xFFFF) + (_mwcZ >> 16)) & MaxUInt32; _mwcW = (18000 * (_mwcW & 0xFFFF) + (_mwcW >> 16)) & MaxUInt32; var value = (((_mwcZ << 16) + (_mwcW & 0xFFFF)) >>> 0) & MaxUInt32 | 0; if (!signed) { value >>>= 0; } return value; } function newId(maxLength) { if (maxLength === void 0) { maxLength = 22; } var base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; var number = random32() >>> 0; var chars = 0; var result = strEmpty; while (result.length < maxLength) { chars++; result += base64chars.charAt(number & 0x3F); number >>>= 6; if (chars === 5) { number = (((random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0; chars = 0; } } return result; } var _objDefineProperty = ObjDefineProperty; var version = "2.8.3"; var instanceName = "." + newId(6); var _dataUid = 0; function _createAccessor(target, prop, value) { if (_objDefineProperty) { try { _objDefineProperty(target, prop, { value: value, enumerable: false, configurable: true }); return true; } catch (e) { } } return false; } function _canAcceptData(target) { return target.nodeType === 1 || target.nodeType === 9 || !(+target.nodeType); } function _getCache(data, target) { var theCache = target[data.id]; if (!theCache) { theCache = {}; try { if (_canAcceptData(target)) { if (!_createAccessor(target, data.id, theCache)) { target[data.id] = theCache; } } } catch (e) { } } return theCache; } function createUniqueNamespace(name, includeVersion) { if (includeVersion === void 0) { includeVersion = false; } return normalizeJsName(name + (_dataUid++) + (includeVersion ? "." + version : "") + instanceName); } function createElmNodeData(name) { var data = { id: createUniqueNamespace("_aiData-" + (name || "") + "." + version), accept: function (target) { return _canAcceptData(target); }, get: function (target, name, defValue, addDefault) { var theCache = target[data.id]; if (!theCache) { if (addDefault) { theCache = _getCache(data, target); theCache[normalizeJsName(name)] = defValue; } return defValue; } return theCache[normalizeJsName(name)]; }, kill: function (target, name) { if (target && target[name]) { try { delete target[name]; } catch (e) { } } } }; return data; } var strDoUnload = "_doUnload"; var pluginStateData = createElmNodeData("plugin"); function _getPluginState(plugin) { return pluginStateData.get(plugin, "state", {}, true); } function initializePlugins(processContext, extensions) { var initPlugins = []; var lastPlugin = null; var proxy = processContext.getNext(); var pluginState; while (proxy) { var thePlugin = proxy.getPlugin(); if (thePlugin) { if (lastPlugin && isFunction(lastPlugin[strSetNextPlugin]) && isFunction(thePlugin[strProcessTelemetry])) { lastPlugin[strSetNextPlugin](thePlugin); } var isInitialized = false; if (isFunction(thePlugin[strIsInitialized])) { isInitialized = thePlugin[strIsInitialized](); } else { pluginState = _getPluginState(thePlugin); isInitialized = pluginState[strIsInitialized]; } if (!isInitialized) { initPlugins.push(thePlugin); } lastPlugin = thePlugin; proxy = proxy.getNext(); } } arrForEach(initPlugins, function (thePlugin) { var core = processContext.core(); thePlugin.initialize(processContext.getCfg(), core, extensions, processContext.getNext()); pluginState = _getPluginState(thePlugin); if (!thePlugin[strCore] && !pluginState[strCore]) { pluginState[strCore] = core; } pluginState[strIsInitialized] = true; delete pluginState[strTeardown]; }); } function sortPlugins(plugins) { return plugins.sort(function (extA, extB) { var result = 0; var bHasProcess = isFunction(extB[strProcessTelemetry]); if (isFunction(extA[strProcessTelemetry])) { result = bHasProcess ? extA[strPriority] - extB[strPriority] : 1; } else if (bHasProcess) { result = -1; } return result; }); } function unloadComponents(components, unloadCtx, unloadState, asyncCallback) { var idx = 0; function _doUnload() { while (idx < components.length) { var component = components[idx++]; if (component) { var func = component[strDoUnload] || component[strDoTeardown]; if (isFunction(func)) { if (func.call(component, unloadCtx, unloadState, _doUnload) === true) { return true; } } } } } return _doUnload(); } var strTelemetryPluginChain = "TelemetryPluginChain"; var strHasRunFlags = "_hasRun"; var strGetTelCtx = "_getTelCtx"; var _chainId = 0; function _getNextProxyStart(proxy, core, startAt) { while (proxy) { if (proxy.getPlugin() === startAt) { return proxy; } proxy = proxy.getNext(); } return createTelemetryProxyChain([startAt], core.config || {}, core); } function _createInternalContext(telemetryChain, config, core, startAt) { var _nextProxy = null; var _onComplete = []; if (startAt !== null) { _nextProxy = startAt ? _getNextProxyStart(telemetryChain, core, startAt) : telemetryChain; } var context = { _next: _moveNext, ctx: { core: function () { return core; }, diagLog: function () { return safeGetLogger(core, config); }, getCfg: function () { return config; }, getExtCfg: _getExtCfg, getConfig: _getConfig, hasNext: function () { return !!_nextProxy; }, getNext: function () { return _nextProxy; }, setNext: function (nextPlugin) { _nextProxy = nextPlugin; }, iterate: _iterateChain, onComplete: _addOnComplete } }; function _addOnComplete(onComplete, that) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } if (onComplete) { _onComplete.push({ func: onComplete, self: !isUndefined(that) ? that : context.ctx, args: args }); } } function _moveNext() { var nextProxy = _nextProxy; _nextProxy = nextProxy ? nextProxy.getNext() : null; if (!nextProxy) { var onComplete = _onComplete; if (onComplete && onComplete.length > 0) { arrForEach(onComplete, function (completeDetails) { try { completeDetails.func.call(completeDetails.self, completeDetails.args); } catch (e) { _throwInternal(core.logger, 2 , 73 , "Unexpected Exception during onComplete - " + dumpObj(e)); } }); _onComplete = []; } } return nextProxy; } function _getExtCfg(identifier, defaultValue, mergeDefault) { if (defaultValue === void 0) { defaultValue = {}; } if (mergeDefault === void 0) { mergeDefault = 0 ; } var theConfig; if (config) { var extConfig = config.extensionConfig; if (extConfig && identifier) { theConfig = extConfig[identifier]; } } if (!theConfig) { theConfig = defaultValue; } else if (isObject(defaultValue)) { if (mergeDefault !== 0 ) { var newConfig_1 = objExtend(true, defaultValue, theConfig); if (config && mergeDefault === 2 ) { objForEachKey(defaultValue, function (field) { if (isNullOrUndefined(newConfig_1[field])) { var cfgValue = config[field]; if (!isNullOrUndefined(cfgValue)) { newConfig_1[field] = cfgValue; } } }); } theConfig = newConfig_1; } } return theConfig; } function _getConfig(identifier, field, defaultValue) { if (defaultValue === void 0) { defaultValue = false; } var theValue; var extConfig = _getExtCfg(identifier, null); if (extConfig && !isNullOrUndefined(extConfig[field])) { theValue = extConfig[field]; } else if (config && !isNullOrUndefined(config[field])) { theValue = config[field]; } return !isNullOrUndefined(theValue) ? theValue : defaultValue; } function _iterateChain(cb) { var nextPlugin; while (!!(nextPlugin = context._next())) { var plugin = nextPlugin.getPlugin(); if (plugin) { cb(plugin); } } } return context; } function createProcessTelemetryContext(telemetryChain, config, core, startAt) { var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(env) { var nextPlugin = internalContext._next(); nextPlugin && nextPlugin.processTelemetry(env, context); return !nextPlugin; } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryContext(plugins || context.getNext(), config, core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } function createProcessTelemetryUnloadContext(telemetryChain, core, startAt) { var config = core.config || {}; var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(unloadState) { var nextPlugin = internalContext._next(); nextPlugin && nextPlugin.unload(context, unloadState); return !nextPlugin; } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryUnloadContext(plugins || context.getNext(), core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } function createProcessTelemetryUpdateContext(telemetryChain, core, startAt) { var config = core.config || {}; var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(updateState) { return context.iterate(function (plugin) { if (isFunction(plugin.update)) { plugin.update(context, updateState); } }); } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryUpdateContext(plugins || context.getNext(), core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } function createTelemetryProxyChain(plugins, config, core, startAt) { var firstProxy = null; var add = startAt ? false : true; if (isArray(plugins) && plugins.length > 0) { var lastProxy_1 = null; arrForEach(plugins, function (thePlugin) { if (!add && startAt === thePlugin) { add = true; } if (add && thePlugin && isFunction(thePlugin.processTelemetry)) { var newProxy = createTelemetryPluginProxy(thePlugin, config, core); if (!firstProxy) { firstProxy = newProxy; } if (lastProxy_1) { lastProxy_1._setNext(newProxy); } lastProxy_1 = newProxy; } }); } if (startAt && !firstProxy) { return createTelemetryProxyChain([startAt], config, core); } return firstProxy; } function createTelemetryPluginProxy(plugin, config, core) { var nextProxy = null; var hasProcessTelemetry = isFunction(plugin.processTelemetry); var hasSetNext = isFunction(plugin.setNextPlugin); var chainId; if (plugin) { chainId = plugin.identifier + "-" + plugin.priority + "-" + _chainId++; } else { chainId = "Unknown-0-" + _chainId++; } var proxyChain = { getPlugin: function () { return plugin; }, getNext: function () { return nextProxy; }, processTelemetry: _processTelemetry, unload: _unloadPlugin, update: _updatePlugin, _id: chainId, _setNext: function (nextPlugin) { nextProxy = nextPlugin; } }; function _getTelCtx() { var itemCtx; if (plugin && isFunction(plugin[strGetTelCtx])) { itemCtx = plugin[strGetTelCtx](); } if (!itemCtx) { itemCtx = createProcessTelemetryContext(proxyChain, config, core); } return itemCtx; } function _processChain(itemCtx, processPluginFn, name, details, isAsync) { var hasRun = false; var identifier = plugin ? plugin.identifier : strTelemetryPluginChain; var hasRunContext = itemCtx[strHasRunFlags]; if (!hasRunContext) { hasRunContext = itemCtx[strHasRunFlags] = {}; } itemCtx.setNext(nextProxy); if (plugin) { doPerf(itemCtx[strCore](), function () { return identifier + ":" + name; }, function () { hasRunContext[chainId] = true; try { var nextId = nextProxy ? nextProxy._id : strEmpty; if (nextId) { hasRunContext[nextId] = false; } hasRun = processPluginFn(itemCtx); } catch (error) { var hasNextRun = nextProxy ? hasRunContext[nextProxy._id] : true; if (hasNextRun) { hasRun = true; } if (!nextProxy || !hasNextRun) { _throwInternal(itemCtx.diagLog(), 1 , 73 , "Plugin [" + identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext)); } } }, details, isAsync); } return hasRun; } function _processTelemetry(env, itemCtx) { itemCtx = itemCtx || _getTelCtx(); function _callProcessTelemetry(itemCtx) { if (!plugin || !hasProcessTelemetry) { return false; } var pluginState = _getPluginState(plugin); if (pluginState.teardown || pluginState[strDisabled]) { return false; } if (hasSetNext) { plugin.setNextPlugin(nextProxy); } plugin.processTelemetry(env, itemCtx); return true; } if (!_processChain(itemCtx, _callProcessTelemetry, "processTelemetry", function () { return ({ item: env }); }, !(env.sync))) { itemCtx.processNext(env); } } function _unloadPlugin(unloadCtx, unloadState) { function _callTeardown() { var hasRun = false; if (plugin) { var pluginState = _getPluginState(plugin); var pluginCore = plugin[strCore] || pluginState.core; if (plugin && (!pluginCore || pluginCore === unloadCtx[strCore]()) && !pluginState[strTeardown]) { pluginState[strCore] = null; pluginState[strTeardown] = true; pluginState[strIsInitialized] = false; if (plugin[strTeardown] && plugin[strTeardown](unloadCtx, unloadState) === true) { hasRun = true; } } } return hasRun; } if (!_processChain(unloadCtx, _callTeardown, "unload", function () { }, unloadState.isAsync)) { unloadCtx.processNext(unloadState); } } function _updatePlugin(updateCtx, updateState) { function _callUpdate() { var hasRun = false; if (plugin) { var pluginState = _getPluginState(plugin); var pluginCore = plugin[strCore] || pluginState.core; if (plugin && (!pluginCore || pluginCore === updateCtx[strCore]()) && !pluginState[strTeardown]) { if (plugin[strUpdate] && plugin[strUpdate](updateCtx, updateState) === true) { hasRun = true; } } } return hasRun; } if (!_processChain(updateCtx, _callUpdate, "update", function () { }, false)) { updateCtx.processNext(updateState); } } return objFreeze(proxyChain); } var ProcessTelemetryContext = /** @class */ (function () { function ProcessTelemetryContext(pluginChain, config, core, startAt) { var _self = this; var context = createProcessTelemetryContext(pluginChain, config, core, startAt); proxyFunctions(_self, context, objKeys(context)); } return ProcessTelemetryContext; }()); var strToGMTString = "toGMTString"; var strToUTCString = "toUTCString"; var strCookie = "cookie"; var strExpires = "expires"; var strEnabled = "enabled"; var strIsCookieUseDisabled = "isCookieUseDisabled"; var strDisableCookiesUsage = "disableCookiesUsage"; var strConfigCookieMgr = "_ckMgr"; var _supportsCookies = null; var _allowUaSameSite = null; var _parsedCookieValue = null; var _doc = getDocument(); var _cookieCache = {}; var _globalCookieConfig = {}; function _gblCookieMgr(config, logger) { var inst = createCookieMgr[strConfigCookieMgr] || _globalCookieConfig[strConfigCookieMgr]; if (!inst) { inst = createCookieMgr[strConfigCookieMgr] = createCookieMgr(config, logger); _globalCookieConfig[strConfigCookieMgr] = inst; } return inst; } function _isMgrEnabled(cookieMgr) { if (cookieMgr) { return cookieMgr.isEnabled(); } return true; } function _createCookieMgrConfig(rootConfig) { var cookieMgrCfg = rootConfig.cookieCfg = rootConfig.cookieCfg || {}; setValue(cookieMgrCfg, "domain", rootConfig.cookieDomain, isNotNullOrUndefined, isNullOrUndefined); setValue(cookieMgrCfg, "path", rootConfig.cookiePath || "/", null, isNullOrUndefined); if (isNullOrUndefined(cookieMgrCfg[strEnabled])) { var cookieEnabled = void 0; if (!isUndefined(rootConfig[strIsCookieUseDisabled])) { cookieEnabled = !rootConfig[strIsCookieUseDisabled]; } if (!isUndefined(rootConfig[strDisableCookiesUsage])) { cookieEnabled = !rootConfig[strDisableCookiesUsage]; } cookieMgrCfg[strEnabled] = cookieEnabled; } return cookieMgrCfg; } function safeGetCookieMgr(core, config) { var cookieMgr; if (core) { cookieMgr = core.getCookieMgr(); } else if (config) { var cookieCfg = config.cookieCfg; if (cookieCfg[strConfigCookieMgr]) { cookieMgr = cookieCfg[strConfigCookieMgr]; } else { cookieMgr = createCookieMgr(config); } } if (!cookieMgr) { cookieMgr = _gblCookieMgr(config, (core || {}).logger); } return cookieMgr; } function createCookieMgr(rootConfig, logger) { var cookieMgrConfig = _createCookieMgrConfig(rootConfig || _globalCookieConfig); var _path = cookieMgrConfig.path || "/"; var _domain = cookieMgrConfig.domain; var _enabled = cookieMgrConfig[strEnabled] !== false; var cookieMgr = { isEnabled: function () { var enabled = _enabled && areCookiesSupported(logger); var gblManager = _globalCookieConfig[strConfigCookieMgr]; if (enabled && gblManager && cookieMgr !== gblManager) { enabled = _isMgrEnabled(gblManager); } return enabled; }, setEnabled: function (value) { _enabled = value !== false; }, set: function (name, value, maxAgeSec, domain, path) { var result = false; if (_isMgrEnabled(cookieMgr)) { var values = {}; var theValue = strTrim(value || strEmpty); var idx = theValue.indexOf(";"); if (idx !== -1) { theValue = strTrim(value.substring(0, idx)); values = _extractParts(value.substring(idx + 1)); } setValue(values, "domain", domain || _domain, isTruthy, isUndefined); if (!isNullOrUndefined(maxAgeSec)) { var _isIE = isIE(); if (isUndefined(values[strExpires])) { var nowMs = dateNow(); var expireMs = nowMs + (maxAgeSec * 1000); if (expireMs > 0) { var expiry = new Date(); expiry.setTime(expireMs); setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || strEmpty, isTruthy); } } if (!_isIE) { setValue(values, "max-age", strEmpty + maxAgeSec, null, isUndefined); } } var location_1 = getLocation(); if (location_1 && location_1.protocol === "https:") { setValue(values, "secure", null, null, isUndefined); if (_allowUaSameSite === null) { _allowUaSameSite = !uaDisallowsSameSiteNone((getNavigator() || {}).userAgent); } if (_allowUaSameSite) { setValue(values, "SameSite", "None", null, isUndefined); } } setValue(values, "path", path || _path, null, isUndefined); var setCookieFn = cookieMgrConfig.setCookie || _setCookieValue; setCookieFn(name, _formatCookieValue(theValue, values)); result = true; } return result; }, get: function (name) { var value = strEmpty; if (_isMgrEnabled(cookieMgr)) { value = (cookieMgrConfig.getCookie || _getCookieValue)(name); } return value; }, del: function (name, path) { var result = false; if (_isMgrEnabled(cookieMgr)) { result = cookieMgr.purge(name, path); } return result; }, purge: function (name, path) { var _a; var result = false; if (areCookiesSupported(logger)) { var values = (_a = {}, _a["path"] = path ? path : "/", _a[strExpires] = "Thu, 01 Jan 1970 00:00:01 GMT", _a); if (!isIE()) { values["max-age"] = "0"; } var delCookie = cookieMgrConfig.delCookie || _setCookieValue; delCookie(name, _formatCookieValue(strEmpty, values)); result = true; } return result; } }; cookieMgr[strConfigCookieMgr] = cookieMgr; return cookieMgr; } function areCookiesSupported(logger) { if (_supportsCookies === null) { _supportsCookies = false; try { var doc = _doc || {}; _supportsCookies = doc[strCookie] !== undefined; } catch (e) { _throwInternal(logger, 2 , 68 , "Cannot access document.cookie - " + getExceptionName(e), { exception: dumpObj(e) }); } } return _supportsCookies; } function _extractParts(theValue) { var values = {}; if (theValue && theValue.length) { var parts = strTrim(theValue).split(";"); arrForEach(parts, function (thePart) { thePart = strTrim(thePart || strEmpty); if (thePart) { var idx = thePart.indexOf("="); if (idx === -1) { values[thePart] = null; } else { values[strTrim(thePart.substring(0, idx))] = strTrim(thePart.substring(idx + 1)); } } }); } return values; } function _formatDate(theDate, func) { if (isFunction(theDate[func])) { return theDate[func](); } return null; } function _formatCookieValue(value, values) { var cookieValue = value || strEmpty; objForEachKey(values, function (name, theValue) { cookieValue += "; " + name + (!isNullOrUndefined(theValue) ? "=" + theValue : strEmpty); }); return cookieValue; } function _getCookieValue(name) { var cookieValue = strEmpty; if (_doc) { var theCookie = _doc[strCookie] || strEmpty; if (_parsedCookieValue !== theCookie) { _cookieCache = _extractParts(theCookie); _parsedCookieValue = theCookie; } cookieValue = strTrim(_cookieCache[name] || strEmpty); } return cookieValue; } function _setCookieValue(name, cookieValue) { if (_doc) { _doc[strCookie] = name + "=" + cookieValue; } } function uaDisallowsSameSiteNone(userAgent) { if (!isString(userAgent)) { return false; } if (strContains(userAgent, "CPU iPhone OS 12") || strContains(userAgent, "iPad; CPU OS 12")) { return true; } if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strContains(userAgent, "Version/") && strContains(userAgent, "Safari")) { return true; } if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strEndsWith(userAgent, "AppleWebKit/605.1.15 (KHTML, like Gecko)")) { return true; } if (strContains(userAgent, "Chrome/5") || strContains(userAgent, "Chrome/6")) { return true; } if (strContains(userAgent, "UnrealEngine") && !strContains(userAgent, "Chrome")) { return true; } if (strContains(userAgent, "UCBrowser/12") || strContains(userAgent, "UCBrowser/11")) { return true; } return false; } var strIKey = "iKey"; var strExtensionConfig = "extensionConfig"; var ChannelControllerPriority = 500; var ChannelValidationMessage = "Channel has invalid priority - "; function _addChannelQueue(channelQueue, queue, config, core) { if (queue && isArray(queue) && queue.length > 0) { queue = queue.sort(function (a, b) { return a.priority - b.priority; }); arrForEach(queue, function (queueItem) { if (queueItem.priority < ChannelControllerPriority) { throwError(ChannelValidationMessage + queueItem.identifier); } }); channelQueue.push({ queue: objFreeze(queue), chain: createTelemetryProxyChain(queue, config, core) }); } } function createChannelControllerPlugin(channelQueue, core) { var _a; function _getTelCtx() { return createProcessTelemetryContext(null, core.config, core, null); } function _processChannelQueue(theChannels, itemCtx, processFn, onComplete) { var waiting = theChannels ? (theChannels.length + 1) : 1; function _runChainOnComplete() { waiting--; if (waiting === 0) { onComplete && onComplete(); onComplete = null; } } if (waiting > 0) { arrForEach(theChannels, function (channels) { if (channels && channels.queue.length > 0) { var channelChain = channels.chain; var chainCtx = itemCtx.createNew(channelChain); chainCtx.onComplete(_runChainOnComplete); processFn(chainCtx); } else { waiting--; } }); } _runChainOnComplete(); } function _doUpdate(updateCtx, updateState) { var theUpdateState = updateState || { reason: 0 }; _processChannelQueue(channelQueue, updateCtx, function (chainCtx) { chainCtx[strProcessNext](theUpdateState); }, function () { updateCtx[strProcessNext](theUpdateState); }); return true; } function _doTeardown(unloadCtx, unloadState) { var theUnloadState = unloadState || { reason: 0 , isAsync: false }; _processChannelQueue(channelQueue, unloadCtx, function (chainCtx) { chainCtx[strProcessNext](theUnloadState); }, function () { unloadCtx[strProcessNext](theUnloadState); isInitialized = false; }); return true; } function _getChannel(pluginIdentifier) { var thePlugin = null; if (channelQueue && channelQueue.length > 0) { arrForEach(channelQueue, function (channels) { if (channels && channels.queue.length > 0) { arrForEach(channels.queue, function (ext) { if (ext.identifier === pluginIdentifier) { thePlugin = ext; return -1; } }); if (thePlugin) { return -1; } } }); } return thePlugin; } var isInitialized = false; var channelController = (_a = { identifier: "ChannelControllerPlugin", priority: ChannelControllerPriority, initialize: function (config, core, extensions, pluginChain) { isInitialized = true; arrForEach(channelQueue, function (channels) { if (channels && channels.queue.length > 0) { initializePlugins(createProcessTelemetryContext(channels.chain, config, core), extensions); } }); }, isInitialized: function () { return isInitialized; }, processTelemetry: function (item, itemCtx) { _processChannelQueue(channelQueue, itemCtx || _getTelCtx(), function (chainCtx) { chainCtx[strProcessNext](item); }, function () { itemCtx[strProcessNext](item); }); }, update: _doUpdate }, _a[strPause] = function () { _processChannelQueue(channelQueue, _getTelCtx(), function (chainCtx) { chainCtx.iterate(function (plugin) { plugin[strPause] && plugin[strPause](); }); }, null); }, _a[strResume] = function () { _processChannelQueue(channelQueue, _getTelCtx(), function (chainCtx) { chainCtx.iterate(function (plugin) { plugin[strResume] && plugin[strResume](); }); }, null); }, _a[strTeardown] = _doTeardown, _a.getChannel = _getChannel, _a.flush = function (isAsync, callBack, sendReason, cbTimeout) { var waiting = 1; var doneIterating = false; var cbTimer = null; cbTimeout = cbTimeout || 5000; function doCallback() { waiting--; if (doneIterating && waiting === 0) { if (cbTimer) { clearTimeout(cbTimer); cbTimer = null; } callBack && callBack(doneIterating); callBack = null; } } _processChannelQueue(channelQueue, _getTelCtx(), function (chainCtx) { chainCtx.iterate(function (plugin) { if (plugin.flush) { waiting++; var handled_1 = false; if (!plugin.flush(isAsync, function () { handled_1 = true; doCallback(); }, sendReason)) { if (!handled_1) { if (isAsync && cbTimer == null) { cbTimer = setTimeout(function () { cbTimer = null; doCallback(); }, cbTimeout); } else { doCallback(); } } } } }); }, function () { doneIterating = true; doCallback(); }); return true; }, _a._setQueue = function (queue) { channelQueue = queue; }, _a); return channelController; } function createChannelQueues(channels, extensions, config, core) { var channelQueue = []; if (channels) { arrForEach(channels, function (queue) { return _addChannelQueue(channelQueue, queue, config, core); }); } if (extensions) { var extensionQueue_1 = []; arrForEach(extensions, function (plugin) { if (plugin.priority > ChannelControllerPriority) { extensionQueue_1.push(plugin); } }); _addChannelQueue(channelQueue, extensionQueue_1, config, core); } return channelQueue; } function createUnloadHandlerContainer() { var handlers = []; function _addHandler(handler) { if (handler) { handlers.push(handler); } } function _runHandlers(unloadCtx, unloadState) { arrForEach(handlers, function (handler) { try { handler(unloadCtx, unloadState); } catch (e) { _throwInternal(unloadCtx.diagLog(), 2 , 73 , "Unexpected error calling unload handler - " + dumpObj(e)); } }); handlers = []; } return { add: _addHandler, run: _runHandlers }; } var strGetPlugin = "getPlugin"; var BaseTelemetryPlugin = /** @class */ (function () { function BaseTelemetryPlugin() { var _self = this; var _isinitialized; var _rootCtx; var _nextPlugin; var _unloadHandlerContainer; var _hooks; _initDefaults(); dynamicProto(BaseTelemetryPlugin, _self, function (_self) { _self.initialize = function (config, core, extensions, pluginChain) { _setDefaults(config, core, pluginChain); _isinitialized = true; }; _self.teardown = function (unloadCtx, unloadState) { var core = _self.core; if (!core || (unloadCtx && core !== unloadCtx.core())) { return; } var result; var unloadDone = false; var theUnloadCtx = unloadCtx || createProcessTelemetryUnloadContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin); var theUnloadState = unloadState || { reason: 0 , isAsync: false }; function _unloadCallback() { if (!unloadDone) { unloadDone = true; _unloadHandlerContainer.run(theUnloadCtx, unloadState); arrForEach(_hooks, function (fn) { fn.rm(); }); _hooks = []; if (result === true) { theUnloadCtx.processNext(theUnloadState); } _initDefaults(); } } if (!_self[strDoTeardown] || _self[strDoTeardown](theUnloadCtx, theUnloadState, _unloadCallback) !== true) { _unloadCallback(); } else { result = true; } return result; }; _self.update = function (updateCtx, updateState) { var core = _self.core; if (!core || (updateCtx && core !== updateCtx.core())) { return; } var result; var updateDone = false; var theUpdateCtx = updateCtx || createProcessTelemetryUpdateContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin); var theUpdateState = updateState || { reason: 0 }; function _updateCallback() { if (!updateDone) { updateDone = true; _setDefaults(theUpdateCtx.getCfg(), theUpdateCtx.core(), theUpdateCtx.getNext()); } } if (!_self._doUpdate || _self._doUpdate(theUpdateCtx, theUpdateState, _updateCallback) !== true) { _updateCallback(); } else { result = true; } return result; }; _self._addHook = function (hooks) { if (hooks) { if (isArray(hooks)) { _hooks = _hooks.concat(hooks); } else { _hooks.push(hooks); } } }; proxyFunctionAs(_self, "_addUnloadCb", function () { return _unloadHandlerContainer; }, "add"); }); _self.diagLog = function (itemCtx) { return _getTelCtx(itemCtx).diagLog(); }; _self[strIsInitialized] = function () { return _isinitialized; }; _self.setInitialized = function (isInitialized) { _isinitialized = isInitialized; }; _self[strSetNextPlugin] = function (next) { _nextPlugin = next; }; _self.processNext = function (env, itemCtx) { if (itemCtx) { itemCtx.processNext(env); } else if (_nextPlugin && isFunction(_nextPlugin.processTelemetry)) { _nextPlugin.processTelemetry(env, null); } }; _self._getTelCtx = _getTelCtx; function _getTelCtx(currentCtx) { if (currentCtx === void 0) { currentCtx = null; } var itemCtx = currentCtx; if (!itemCtx) { var rootCtx = _rootCtx || createProcessTelemetryContext(null, {}, _self.core); if (_nextPlugin && _nextPlugin[strGetPlugin]) { itemCtx = rootCtx.createNew(null, _nextPlugin[strGetPlugin]); } else { itemCtx = rootCtx.createNew(null, _nextPlugin); } } return itemCtx; } function _setDefaults(config, core, pluginChain) { if (config) { setValue(config, strExtensionConfig, [], null, isNullOrUndefined); } if (!pluginChain && core) { pluginChain = core.getProcessTelContext().getNext(); } var nextPlugin = _nextPlugin; if (_nextPlugin && _nextPlugin[strGetPlugin]) { nextPlugin = _nextPlugin[strGetPlugin](); } _self.core = core; _rootCtx = createProcessTelemetryContext(pluginChain, config, core, nextPlugin); } function _initDefaults() { _isinitialized = false; _self.core = null; _rootCtx = null; _nextPlugin = null; _hooks = []; _unloadHandlerContainer = createUnloadHandlerContainer(); } } return BaseTelemetryPlugin; }()); var TelemetryInitializerPlugin = /** @class */ (function (_super) { __extendsFn(TelemetryInitializerPlugin, _super); function TelemetryInitializerPlugin() { var _this = _super.call(this) || this; _this.identifier = "TelemetryInitializerPlugin"; _this.priority = 199; var _id; var _initializers; _initDefaults(); dynamicProto(TelemetryInitializerPlugin, _this, function (_self, _base) { _self.addTelemetryInitializer = function (telemetryInitializer) { var theInitializer = { id: _id++, fn: telemetryInitializer }; _initializers.push(theInitializer); var handler = { remove: function () { arrForEach(_initializers, function (initializer, idx) { if (initializer.id === theInitializer.id) { _initializers.splice(idx, 1); return -1; } }); } }; return handler; }; _self.processTelemetry = function (item, itemCtx) { var doNotSendItem = false; var telemetryInitializersCount = _initializers.length; for (var i = 0; i < telemetryInitializersCount; ++i) { var telemetryInitializer = _initializers[i]; if (telemetryInitializer) { try { if (telemetryInitializer.fn.apply(null, [item]) === false) { doNotSendItem = true; break; } } catch (e) { _throwInternal(itemCtx.diagLog(), 1 , 64 , "One of telemetry initializers failed, telemetry item will not be sent: " + getExceptionName(e), { exception: dumpObj(e) }, true); } } } if (!doNotSendItem) { _self.processNext(item, itemCtx); } }; _self[strDoTeardown] = function () { _initDefaults(); }; }); function _initDefaults() { _id = 0; _initializers = []; } return _this; } return TelemetryInitializerPlugin; }(BaseTelemetryPlugin)); var strValidationError = "Plugins must provide initialize method"; var strNotificationManager = "_notificationManager"; var strSdkUnloadingError = "SDK is still unloading..."; var strSdkNotInitialized = "SDK is not initialized"; var defaultInitConfig = { loggingLevelConsole: 1 }; function _createPerfManager(core, notificationMgr) { return new PerfManager(notificationMgr); } function _validateExtensions(logger, channelPriority, allExtensions) { var coreExtensions = []; var extPriorities = {}; arrForEach(allExtensions, function (ext) { if (isNullOrUndefined(ext) || isNullOrUndefined(ext.initialize)) { throwError(strValidationError); } var extPriority = ext.priority; var identifier = ext.identifier; if (ext && extPriority) { if (!isNullOrUndefined(extPriorities[extPriority])) { _warnToConsole(logger, "Two extensions have same priority #" + extPriority + " - " + extPriorities[extPriority] + ", " + identifier); } else { extPriorities[extPriority] = identifier; } } if (!extPriority || extPriority < channelPriority) { coreExtensions.push(ext); } }); return { all: allExtensions, core: coreExtensions }; } function _isPluginPresent(thePlugin, plugins) { var exists = false; arrForEach(plugins, function (plugin) { if (plugin === thePlugin) { exists = true; return -1; } }); return exists; } function _createDummyNotificationManager() { var _a; return objCreateFn((_a = {}, _a[strAddNotificationListener] = function (listener) { }, _a[strRemoveNotificationListener] = function (listener) { }, _a[strEventsSent] = function (events) { }, _a[strEventsDiscarded] = function (events, reason) { }, _a[strEventsSendRequest] = function (sendReason, isAsync) { }, _a)); } var BaseCore = /** @class */ (function () { function BaseCore() { var _isInitialized; var _eventQueue; var _notificationManager; var _perfManager; var _cfgPerfManager; var _cookieManager; var _pluginChain; var _configExtensions; var _coreExtensions; var _channelControl; var _channelConfig; var _channelQueue; var _isUnloading; var _telemetryInitializerPlugin; var _internalLogsEventName; var _evtNamespace; var _unloadHandlers; var _debugListener; var _internalLogPoller = 0; dynamicProto(BaseCore, this, function (_self) { _initDefaults(); _self.isInitialized = function () { return _isInitialized; }; _self.initialize = function (config, extensions, logger, notificationManager) { if (_isUnloading) { throwError(strSdkUnloadingError); } if (_self.isInitialized()) { throwError("Core should not be initialized more than once"); } if (!config || isNullOrUndefined(config.instrumentationKey)) { throwError("Please provide instrumentation key"); } _notificationManager = notificationManager; _self[strNotificationManager] = notificationManager; _self.config = config || {}; _initDebugListener(config); _initPerfManager(config); config.extensions = isNullOrUndefined(config.extensions) ? [] : config.extensions; _initExtConfig(config); if (logger) { _self.logger = logger; } _configExtensions = []; _configExtensions.push.apply(_configExtensions, __spreadArrayFn(__spreadArrayFn([], extensions, false), config.extensions)); _channelConfig = (config || {}).channels; _initPluginChain(config, null); if (!_channelQueue || _channelQueue.length === 0) { throwError("No channels available"); } _isInitialized = true; _self.releaseQueue(); }; _self.getTransmissionControls = function () { var controls = []; if (_channelQueue) { arrForEach(_channelQueue, function (channels) { controls.push(channels.queue); }); } return objFreeze(controls); }; _self.track = function (telemetryItem) { setValue(telemetryItem, strIKey, _self.config.instrumentationKey, null, isNotTruthy); setValue(telemetryItem, "time", toISOString(new Date()), null, isNotTruthy); setValue(telemetryItem, "ver", "4.0", null, isNullOrUndefined); if (!_isUnloading && _self.isInitialized()) { _createTelCtx().processNext(telemetryItem); } else { _eventQueue.push(telemetryItem); } }; _self.getProcessTelContext = _createTelCtx; _self.getNotifyMgr = function () { if (!_notificationManager) { _notificationManager = _createDummyNotificationManager(); _self[strNotificationManager] = _notificationManager; } return _notificationManager; }; _self[strAddNotificationListener] = function (listener) { if (_notificationManager) { _notificationManager[strAddNotificationListener](listener); } }; _self[strRemoveNotificationListener] = function (listener) { if (_notificationManager) { _notificationManager[strRemoveNotificationListener](listener); } }; _self.getCookieMgr = function () { if (!_cookieManager) { _cookieManager = createCookieMgr(_self.config, _self.logger); } return _cookieManager; }; _self.setCookieMgr = function (cookieMgr) { _cookieManager = cookieMgr; }; _self.getPerfMgr = function () { if (!_perfManager && !_cfgPerfManager) { if (_self.config && _self.config.enablePerfMgr && isFunction(_self.config.createPerfMgr)) { _cfgPerfManager = _self.config.createPerfMgr(_self, _self.getNotifyMgr()); } } return _perfManager || _cfgPerfManager || getGblPerfMgr(); }; _self.setPerfMgr = function (perfMgr) { _perfManager = perfMgr; }; _self.eventCnt = function () { return _eventQueue.length; }; _self.releaseQueue = function () { if (_isInitialized && _eventQueue.length > 0) { var eventQueue = _eventQueue; _eventQueue = []; arrForEach(eventQueue, function (event) { _createTelCtx().processNext(event); }); } }; _self.pollInternalLogs = function (eventName) { _internalLogsEventName = eventName || null; var interval = _self.config.diagnosticLogInterval; if (!interval || !(interval > 0)) { interval = 10000; } if (_internalLogPoller) { clearInterval(_internalLogPoller); } _internalLogPoller = setInterval(function () { _flushInternalLogs(); }, interval); return _internalLogPoller; }; _self.stopPollingInternalLogs = function () { if (_internalLogPoller) { clearInterval(_internalLogPoller); _internalLogPoller = 0; _flushInternalLogs(); } }; proxyFunctions(_self, function () { return _telemetryInitializerPlugin; }, ["addTelemetryInitializer"]); _self.unload = function (isAsync, unloadComplete, cbTimeout) { if (isAsync === void 0) { isAsync = true; } if (!_isInitialized) { throwError(strSdkNotInitialized); } if (_isUnloading) { throwError(strSdkUnloadingError); } var unloadState = { reason: 50 , isAsync: isAsync, flushComplete: false }; var processUnloadCtx = createProcessTelemetryUnloadContext(_getPluginChain(), _self); processUnloadCtx.onComplete(function () { _initDefaults(); unloadComplete && unloadComplete(unloadState); }, _self); function _doUnload(flushComplete) { unloadState.flushComplete = flushComplete; _isUnloading = true; _unloadHandlers.run(processUnloadCtx, unloadState); _self.stopPollingInternalLogs(); processUnloadCtx.processNext(unloadState); } if (!_flushChannels(isAsync, _doUnload, 6 , cbTimeout)) { _doUnload(false); } }; _self.getPlugin = _getPlugin; _self.addPlugin = function (plugin, replaceExisting, isAsync, addCb) { if (!plugin) { addCb && addCb(false); _logOrThrowError(strValidationError); return; } var existingPlugin = _getPlugin(plugin.identifier); if (existingPlugin && !replaceExisting) { addCb && addCb(false); _logOrThrowError("Plugin [" + plugin.identifier + "] is already loaded!"); return; } var updateState = { reason: 16 }; function _addPlugin(removed) { _configExtensions.push(plugin); updateState.added = [plugin]; _initPluginChain(_self.config, updateState); addCb && addCb(true); } if (existingPlugin) { var removedPlugins_1 = [existingPlugin.plugin]; var unloadState = { reason: 2 , isAsync: !!isAsync }; _removePlugins(removedPlugins_1, unloadState, function (removed) { if (!removed) { addCb && addCb(false); } else { updateState.removed = removedPlugins_1; updateState.reason |= 32 ; _addPlugin(); } }); } else { _addPlugin(); } }; _self.evtNamespace = function () { return _evtNamespace; }; _self.flush = _flushChannels; proxyFunctionAs(_self, "addUnloadCb", function () { return _unloadHandlers; }, "add"); function _initDefaults() { _isInitialized = false; _self.config = objExtend(true, {}, defaultInitConfig); _self.logger = new DiagnosticLogger(_self.config); _self._extensions = []; _telemetryInitializerPlugin = new TelemetryInitializerPlugin(); _eventQueue = []; _notificationManager = null; _perfManager = null; _cfgPerfManager = null; _cookieManager = null; _pluginChain = null; _coreExtensions = null; _configExtensions = []; _channelControl = null; _channelConfig = null; _channelQueue = null; _isUnloading = false; _internalLogsEventName = null; _evtNamespace = createUniqueNamespace("AIBaseCore", true); _unloadHandlers = createUnloadHandlerContainer(); } function _createTelCtx() { return createProcessTelemetryContext(_getPluginChain(), _self.config, _self); } function _initPluginChain(config, updateState) { var theExtensions = _validateExtensions(_self.logger, ChannelControllerPriority, _configExtensions); _coreExtensions = theExtensions.core; _pluginChain = null; var allExtensions = theExtensions.all; _channelQueue = objFreeze(createChannelQueues(_channelConfig, allExtensions, config, _self)); if (_channelControl) { var idx = arrIndexOf(allExtensions, _channelControl); if (idx !== -1) { allExtensions.splice(idx, 1); } idx = arrIndexOf(_coreExtensions, _channelControl); if (idx !== -1) { _coreExtensions.splice(idx, 1); } _channelControl._setQueue(_channelQueue); } else { _channelControl = createChannelControllerPlugin(_channelQueue, _self); } allExtensions.push(_channelControl); _coreExtensions.push(_channelControl); _self._extensions = sortPlugins(allExtensions); _channelControl.initialize(config, _self, allExtensions); initializePlugins(_createTelCtx(), allExtensions); _self._extensions = objFreeze(sortPlugins(_coreExtensions || [])).slice(); if (updateState) { _doUpdate(updateState); } } function _getPlugin(pluginIdentifier) { var theExt = null; var thePlugin = null; arrForEach(_self._extensions, function (ext) { if (ext.identifier === pluginIdentifier && ext !== _channelControl && ext !== _telemetryInitializerPlugin) { thePlugin = ext; return -1; } }); if (!thePlugin && _channelControl) { thePlugin = _channelControl.getChannel(pluginIdentifier); } if (thePlugin) { theExt = { plugin: thePlugin, setEnabled: function (enabled) { _getPluginState(thePlugin)[strDisabled] = !enabled; }, isEnabled: function () { var pluginState = _getPluginState(thePlugin); return !pluginState[strTeardown] && !pluginState[strDisabled]; }, remove: function (isAsync, removeCb) { if (isAsync === void 0) { isAsync = true; } var pluginsToRemove = [thePlugin]; var unloadState = { reason: 1 , isAsync: isAsync }; _removePlugins(pluginsToRemove, unloadState, function (removed) { if (removed) { _initPluginChain(_self.config, { reason: 32 , removed: pluginsToRemove }); } removeCb && removeCb(removed); }); } }; } return theExt; } function _getPluginChain() { if (!_pluginChain) { var extensions = (_coreExtensions || []).slice(); if (arrIndexOf(extensions, _telemetryInitializerPlugin) === -1) { extensions.push(_telemetryInitializerPlugin); } _pluginChain = createTelemetryProxyChain(sortPlugins(extensions), _self.config, _self); } return _pluginChain; } function _removePlugins(thePlugins, unloadState, removeComplete) { if (thePlugins && thePlugins.length > 0) { var unloadChain = createTelemetryProxyChain(thePlugins, _self.config, _self); var unloadCtx = createProcessTelemetryUnloadContext(unloadChain, _self); unloadCtx.onComplete(function () { var removed = false; var newConfigExtensions = []; arrForEach(_configExtensions, function (plugin, idx) { if (!_isPluginPresent(plugin, thePlugins)) { newConfigExtensions.push(plugin); } else { removed = true; } }); _configExtensions = newConfigExtensions; var newChannelConfig = []; if (_channelConfig) { arrForEach(_channelConfig, function (queue, idx) { var newQueue = []; arrForEach(queue, function (channel) { if (!_isPluginPresent(channel, thePlugins)) { newQueue.push(channel); } else { removed = true; } }); newChannelConfig.push(newQueue); }); _channelConfig = newChannelConfig; } removeComplete && removeComplete(removed); }); unloadCtx.processNext(unloadState); } else { removeComplete(false); } } function _flushInternalLogs() { var queue = _self.logger ? _self.logger.queue : []; if (queue) { arrForEach(queue, function (logMessage) { var item = { name: _internalLogsEventName ? _internalLogsEventName : "InternalMessageId: " + logMessage.messageId, iKey: _self.config.instrumentationKey, time: toISOString(new Date()), baseType: _InternalLogMessage.dataType, baseData: { message: logMessage.message } }; _self.track(item); }); queue.length = 0; } } function _flushChannels(isAsync, callBack, sendReason, cbTimeout) { if (_channelControl) { return _channelControl.flush(isAsync, callBack, sendReason || 6 , cbTimeout); } callBack && callBack(false); return true; } function _initDebugListener(config) { if (config.disableDbgExt === true && _debugListener) { _notificationManager[strRemoveNotificationListener](_debugListener); _debugListener = null; } if (_notificationManager && !_debugListener && config.disableDbgExt !== true) { _debugListener = getDebugListener(config); _notificationManager[strAddNotificationListener](_debugListener); } } function _initPerfManager(config) { if (!config.enablePerfMgr && _cfgPerfManager) { _cfgPerfManager = null; } if (config.enablePerfMgr) { setValue(_self.config, "createPerfMgr", _createPerfManager); } } function _initExtConfig(config) { var extConfig = getSetValue(config, strExtensionConfig); extConfig.NotificationManager = _notificationManager; } function _doUpdate(updateState) { var updateCtx = createProcessTelemetryUpdateContext(_getPluginChain(), _self); if (!_self._updateHook || _self._updateHook(updateCtx, updateState) !== true) { updateCtx.processNext(updateState); } } function _logOrThrowError(message) { var logger = _self.logger; if (logger) { _throwInternal(logger, 2 , 73 , message); } else { throwError(message); } } }); } return BaseCore; }()); function _runListeners(listeners, name, isAsync, callback) { arrForEach(listeners, function (listener) { if (listener && listener[name]) { if (isAsync) { setTimeout(function () { return callback(listener); }, 0); } else { try { callback(listener); } catch (e) { } } } }); } var NotificationManager = /** @class */ (function () { function NotificationManager(config) { this.listeners = []; var perfEvtsSendAll = !!(config || {}).perfEvtsSendAll; dynamicProto(NotificationManager, this, function (_self) { _self[strAddNotificationListener] = function (listener) { _self.listeners.push(listener); }; _self[strRemoveNotificationListener] = function (listener) { var index = arrIndexOf(_self.listeners, listener); while (index > -1) { _self.listeners.splice(index, 1); index = arrIndexOf(_self.listeners, listener); } }; _self[strEventsSent] = function (events) { _runListeners(_self.listeners, strEventsSent, true, function (listener) { listener[strEventsSent](events); }); }; _self[strEventsDiscarded] = function (events, reason) { _runListeners(_self.listeners, strEventsDiscarded, true, function (listener) { listener[strEventsDiscarded](events, reason); }); }; _self[strEventsSendRequest] = function (sendReason, isAsync) { _runListeners(_self.listeners, strEventsSendRequest, isAsync, function (listener) { listener[strEventsSendRequest](sendReason, isAsync); }); }; _self[strPerfEvent] = function (perfEvent) { if (perfEvent) { if (perfEvtsSendAll || !perfEvent.isChildEvt()) { _runListeners(_self.listeners, strPerfEvent, false, function (listener) { if (perfEvent.isAsync) { setTimeout(function () { return listener[strPerfEvent](perfEvent); }, 0); } else { listener[strPerfEvent](perfEvent); } }); } } }; }); } return NotificationManager; }()); var AppInsightsCore = /** @class */ (function (_super) { __extendsFn(AppInsightsCore, _super); function AppInsightsCore() { var _this = _super.call(this) || this; dynamicProto(AppInsightsCore, _this, function (_self, _base) { _self.initialize = function (config, extensions, logger, notificationManager) { _base.initialize(config, extensions, logger || new DiagnosticLogger(config), notificationManager || new NotificationManager(config)); }; _self.track = function (telemetryItem) { doPerf(_self.getPerfMgr(), function () { return "AppInsightsCore:track"; }, function () { if (telemetryItem === null) { _notifyInvalidEvent(telemetryItem); throwError("Invalid telemetry item"); } _validateTelemetryItem(telemetryItem); _base.track(telemetryItem); }, function () { return ({ item: telemetryItem }); }, !(telemetryItem.sync)); }; function _validateTelemetryItem(telemetryItem) { if (isNullOrUndefined(telemetryItem.name)) { _notifyInvalidEvent(telemetryItem); throwError("telemetry name required"); } } function _notifyInvalidEvent(telemetryItem) { var manager = _self.getNotifyMgr(); if (manager) { manager.eventsDiscarded([telemetryItem], 2 ); } } }); return _this; } return AppInsightsCore; }(BaseCore)); var strOnPrefix = "on"; var strAttachEvent = "attachEvent"; var strAddEventHelper = "addEventListener"; var strDetachEvent = "detachEvent"; var strRemoveEventListener = "removeEventListener"; var strEvents = "events"; var strVisibilityChangeEvt = "visibilitychange"; var strPageHide = "pagehide"; var strPageShow = "pageshow"; var strUnload = "unload"; var strBeforeUnload = "beforeunload"; var strPageHideNamespace = createUniqueNamespace("aiEvtPageHide"); var strPageShowNamespace = createUniqueNamespace("aiEvtPageShow"); var rRemoveEmptyNs = /\.[\.]+/g; var rRemoveTrailingEmptyNs = /[\.]+$/; var _guid = 1; var elmNodeData = createElmNodeData("events"); var eventNamespace = /^([^.]*)(?:\.(.+)|)/; function _normalizeNamespace(name) { if (name && name.replace) { return name.replace(/^\s*\.*|\.*\s*$/g, ""); } return name; } function _getEvtNamespace(eventName, evtNamespace) { if (evtNamespace) { var theNamespace_1 = ""; if (isArray(evtNamespace)) { theNamespace_1 = ""; arrForEach(evtNamespace, function (name) { name = _normalizeNamespace(name); if (name) { if (name[0] !== ".") { name = "." + name; } theNamespace_1 += name; } }); } else { theNamespace_1 = _normalizeNamespace(evtNamespace); } if (theNamespace_1) { if (theNamespace_1[0] !== ".") { theNamespace_1 = "." + theNamespace_1; } eventName = (eventName || "") + theNamespace_1; } } var parsedEvent = (eventNamespace.exec(eventName || "") || []); return { type: parsedEvent[1], ns: ((parsedEvent[2] || "").replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, "").split(".").sort()).join(".") }; } function __getRegisteredEvents(target, eventName, evtNamespace) { var theEvents = []; var eventCache = elmNodeData.get(target, strEvents, {}, false); var evtName = _getEvtNamespace(eventName, evtNamespace); objForEachKey(eventCache, function (evtType, registeredEvents) { arrForEach(registeredEvents, function (value) { if (!evtName.type || evtName.type === value.evtName.type) { if (!evtName.ns || evtName.ns === evtName.ns) { theEvents.push({ name: value.evtName.type + (value.evtName.ns ? "." + value.evtName.ns : ""), handler: value.handler }); } } }); }); return theEvents; } function _getRegisteredEvents(target, evtName, addDefault) { if (addDefault === void 0) { addDefault = true; } var aiEvts = elmNodeData.get(target, strEvents, {}, addDefault); var registeredEvents = aiEvts[evtName]; if (!registeredEvents) { registeredEvents = aiEvts[evtName] = []; } return registeredEvents; } function _doDetach(obj, evtName, handlerRef, useCapture) { if (obj && evtName && evtName.type) { if (obj[strRemoveEventListener]) { obj[strRemoveEventListener](evtName.type, handlerRef, useCapture); } else if (obj[strDetachEvent]) { obj[strDetachEvent](strOnPrefix + evtName.type, handlerRef); } } } function _doAttach(obj, evtName, handlerRef, useCapture) { var result = false; if (obj && evtName && evtName.type && handlerRef) { if (obj[strAddEventHelper]) { obj[strAddEventHelper](evtName.type, handlerRef, useCapture); result = true; } else if (obj[strAttachEvent]) { obj[strAttachEvent](strOnPrefix + evtName.type, handlerRef); result = true; } } return result; } function _doUnregister(target, events, evtName, unRegFn) { var idx = events.length; while (idx--) { var theEvent = events[idx]; if (theEvent) { if (!evtName.ns || evtName.ns === theEvent.evtName.ns) { if (!unRegFn || unRegFn(theEvent)) { _doDetach(target, theEvent.evtName, theEvent.handler, theEvent.capture); events.splice(idx, 1); } } } } } function _unregisterEvents(target, evtName, unRegFn) { if (evtName.type) { _doUnregister(target, _getRegisteredEvents(target, evtName.type), evtName, unRegFn); } else { var eventCache = elmNodeData.get(target, strEvents, {}); objForEachKey(eventCache, function (evtType, events) { _doUnregister(target, events, evtName, unRegFn); }); if (objKeys(eventCache).length === 0) { elmNodeData.kill(target, strEvents); } } } function mergeEvtNamespace(theNamespace, namespaces) { var newNamespaces; if (namespaces) { if (isArray(namespaces)) { newNamespaces = [theNamespace].concat(namespaces); } else { newNamespaces = [theNamespace, namespaces]; } newNamespaces = (_getEvtNamespace("xx", newNamespaces).ns).split("."); } else { newNamespaces = theNamespace; } return newNamespaces; } function eventOn(target, eventName, handlerRef, evtNamespace, useCapture) { if (useCapture === void 0) { useCapture = false; } var result = false; if (target) { try { var evtName = _getEvtNamespace(eventName, evtNamespace); result = _doAttach(target, evtName, handlerRef, useCapture); if (result && elmNodeData.accept(target)) { var registeredEvent = { guid: _guid++, evtName: evtName, handler: handlerRef, capture: useCapture }; _getRegisteredEvents(target, evtName.type).push(registeredEvent); } } catch (e) { } } return result; } function eventOff(target, eventName, handlerRef, evtNamespace, useCapture) { if (useCapture === void 0) { useCapture = false; } if (target) { try { var evtName_1 = _getEvtNamespace(eventName, evtNamespace); var found_1 = false; _unregisterEvents(target, evtName_1, function (regEvent) { if ((evtName_1.ns && !handlerRef) || regEvent.handler === handlerRef) { found_1 = true; return true; } return false; }); if (!found_1) { _doDetach(target, evtName_1, handlerRef, useCapture); } } catch (e) { } } } function attachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) { if (useCapture === void 0) { useCapture = false; } return eventOn(obj, eventNameWithoutOn, handlerRef, null, useCapture); } function detachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) { if (useCapture === void 0) { useCapture = false; } eventOff(obj, eventNameWithoutOn, handlerRef, null, useCapture); } function addEventHandler(eventName, callback, evtNamespace) { var result = false; var w = getWindow(); if (w) { result = eventOn(w, eventName, callback, evtNamespace); result = eventOn(w["body"], eventName, callback, evtNamespace) || result; } var doc = getDocument(); if (doc) { result = eventOn(doc, eventName, callback, evtNamespace) || result; } return result; } function removeEventHandler(eventName, callback, evtNamespace) { var w = getWindow(); if (w) { eventOff(w, eventName, callback, evtNamespace); eventOff(w["body"], eventName, callback, evtNamespace); } var doc = getDocument(); if (doc) { eventOff(doc, eventName, callback, evtNamespace); } } function _addEventListeners(events, listener, excludeEvents, evtNamespace) { var added = false; if (listener && events && events.length > 0) { arrForEach(events, function (name) { if (name) { if (!excludeEvents || arrIndexOf(excludeEvents, name) === -1) { added = addEventHandler(name, listener, evtNamespace) || added; } } }); } return added; } function addEventListeners(events, listener, excludeEvents, evtNamespace) { var added = false; if (listener && events && isArray(events)) { added = _addEventListeners(events, listener, excludeEvents, evtNamespace); if (!added && excludeEvents && excludeEvents.length > 0) { added = _addEventListeners(events, listener, null, evtNamespace); } } return added; } function removeEventListeners(events, listener, evtNamespace) { if (events && isArray(events)) { arrForEach(events, function (name) { if (name) { removeEventHandler(name, listener, evtNamespace); } }); } } function addPageUnloadEventListener(listener, excludeEvents, evtNamespace) { return addEventListeners([strBeforeUnload, strUnload, strPageHide], listener, excludeEvents, evtNamespace); } function removePageUnloadEventListener(listener, evtNamespace) { removeEventListeners([strBeforeUnload, strUnload, strPageHide], listener, evtNamespace); } function addPageHideEventListener(listener, excludeEvents, evtNamespace) { function _handlePageVisibility(evt) { var doc = getDocument(); if (listener && doc && doc.visibilityState === "hidden") { listener(evt); } } var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace); var pageUnloadAdded = _addEventListeners([strPageHide], listener, excludeEvents, newNamespaces); if (!excludeEvents || arrIndexOf(excludeEvents, strVisibilityChangeEvt) === -1) { pageUnloadAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageUnloadAdded; } if (!pageUnloadAdded && excludeEvents) { pageUnloadAdded = addPageHideEventListener(listener, null, evtNamespace); } return pageUnloadAdded; } function removePageHideEventListener(listener, evtNamespace) { var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace); removeEventListeners([strPageHide], listener, newNamespaces); removeEventListeners([strVisibilityChangeEvt], null, newNamespaces); } function addPageShowEventListener(listener, excludeEvents, evtNamespace) { function _handlePageVisibility(evt) { var doc = getDocument(); if (listener && doc && doc.visibilityState === "visible") { listener(evt); } } var newNamespaces = mergeEvtNamespace(strPageShowNamespace, evtNamespace); var pageShowAdded = _addEventListeners([strPageShow], listener, excludeEvents, newNamespaces); pageShowAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageShowAdded; if (!pageShowAdded && excludeEvents) { pageShowAdded = addPageShowEventListener(listener, null, evtNamespace); } return pageShowAdded; } function removePageShowEventListener(listener, evtNamespace) { var newNamespaces = mergeEvtNamespace(strPageShowNamespace, evtNamespace); removeEventListeners([strPageShow], listener, newNamespaces); removeEventListeners([strVisibilityChangeEvt], null, newNamespaces); } var _cookieMgrs = null; var _canUseCookies; var Undefined = strShimUndefined; function newGuid() { function randomHexDigit() { return randomValue(15); } return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(GuidRegex, function (c) { var r = (randomHexDigit() | 0), v = (c === "x" ? r : r & 0x3 | 0x8); return v.toString(16); }); } function perfNow() { var perf = getPerformance(); if (perf && perf.now) { return perf.now(); } return dateNow(); } function generateW3CId() { var hexValues = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]; var oct = strEmpty, tmp; for (var a = 0; a < 4; a++) { tmp = random32(); oct += hexValues[tmp & 0xF] + hexValues[tmp >> 4 & 0xF] + hexValues[tmp >> 8 & 0xF] + hexValues[tmp >> 12 & 0xF] + hexValues[tmp >> 16 & 0xF] + hexValues[tmp >> 20 & 0xF] + hexValues[tmp >> 24 & 0xF] + hexValues[tmp >> 28 & 0xF]; } var clockSequenceHi = hexValues[8 + (random32() & 0x03) | 0]; return oct.substr(0, 8) + oct.substr(9, 4) + "4" + oct.substr(13, 3) + clockSequenceHi + oct.substr(16, 3) + oct.substr(19, 12); } var CoreUtils = { _canUseCookies: undefined, isTypeof: isTypeof, isUndefined: isUndefined, isNullOrUndefined: isNullOrUndefined, hasOwnProperty: hasOwnProperty, isFunction: isFunction, isObject: isObject, isDate: isDate, isArray: isArray, isError: isError, isString: isString, isNumber: isNumber, isBoolean: isBoolean, toISOString: toISOString, arrForEach: arrForEach, arrIndexOf: arrIndexOf, arrMap: arrMap, arrReduce: arrReduce, strTrim: strTrim, objCreate: objCreateFn, objKeys: objKeys, objDefineAccessors: objDefineAccessors, addEventHandler: addEventHandler, dateNow: dateNow, isIE: isIE, disableCookies: disableCookies, newGuid: newGuid, perfNow: perfNow, newId: newId, randomValue: randomValue, random32: random32, mwcRandomSeed: mwcRandomSeed, mwcRandom32: mwcRandom32, generateW3CId: generateW3CId }; var GuidRegex = /[xy]/g; var EventHelper = { Attach: attachEvent, AttachEvent: attachEvent, Detach: detachEvent, DetachEvent: detachEvent }; function _legacyCookieMgr(config, logger) { var cookieMgr = _gblCookieMgr(config, logger); var legacyCanUseCookies = CoreUtils._canUseCookies; if (_cookieMgrs === null) { _cookieMgrs = []; _canUseCookies = legacyCanUseCookies; objDefineAccessors(CoreUtils, "_canUseCookies", function () { return _canUseCookies; }, function (value) { _canUseCookies = value; arrForEach(_cookieMgrs, function (mgr) { mgr.setEnabled(value); }); }); } if (arrIndexOf(_cookieMgrs, cookieMgr) === -1) { _cookieMgrs.push(cookieMgr); } if (isBoolean(legacyCanUseCookies)) { cookieMgr.setEnabled(legacyCanUseCookies); } if (isBoolean(_canUseCookies)) { cookieMgr.setEnabled(_canUseCookies); } return cookieMgr; } function disableCookies() { _legacyCookieMgr().setEnabled(false); } function canUseCookies(logger) { return _legacyCookieMgr(null, logger).isEnabled(); } function getCookie(logger, name) { return _legacyCookieMgr(null, logger).get(name); } function setCookie(logger, name, value, domain) { _legacyCookieMgr(null, logger).set(name, value, null, domain); } function deleteCookie(logger, name) { return _legacyCookieMgr(null, logger).del(name); } var LoggingSeverity = createEnumStyle({ CRITICAL: 1 , WARNING: 2 }); var _InternalMessageId = createEnumStyle({ BrowserDoesNotSupportLocalStorage: 0 , BrowserCannotReadLocalStorage: 1 , BrowserCannotReadSessionStorage: 2 , BrowserCannotWriteLocalStorage: 3 , BrowserCannotWriteSessionStorage: 4 , BrowserFailedRemovalFromLocalStorage: 5 , BrowserFailedRemovalFromSessionStorage: 6 , CannotSendEmptyTelemetry: 7 , ClientPerformanceMathError: 8 , ErrorParsingAISessionCookie: 9 , ErrorPVCalc: 10 , ExceptionWhileLoggingError: 11 , FailedAddingTelemetryToBuffer: 12 , FailedMonitorAjaxAbort: 13 , FailedMonitorAjaxDur: 14 , FailedMonitorAjaxOpen: 15 , FailedMonitorAjaxRSC: 16 , FailedMonitorAjaxSend: 17 , FailedMonitorAjaxGetCorrelationHeader: 18 , FailedToAddHandlerForOnBeforeUnload: 19 , FailedToSendQueuedTelemetry: 20 , FailedToReportDataLoss: 21 , FlushFailed: 22 , MessageLimitPerPVExceeded: 23 , MissingRequiredFieldSpecification: 24 , NavigationTimingNotSupported: 25 , OnError: 26 , SessionRenewalDateIsZero: 27 , SenderNotInitialized: 28 , StartTrackEventFailed: 29 , StopTrackEventFailed: 30 , StartTrackFailed: 31 , StopTrackFailed: 32 , TelemetrySampledAndNotSent: 33 , TrackEventFailed: 34 , TrackExceptionFailed: 35 , TrackMetricFailed: 36 , TrackPVFailed: 37 , TrackPVFailedCalc: 38 , TrackTraceFailed: 39 , TransmissionFailed: 40 , FailedToSetStorageBuffer: 41 , FailedToRestoreStorageBuffer: 42 , InvalidBackendResponse: 43 , FailedToFixDepricatedValues: 44 , InvalidDurationValue: 45 , TelemetryEnvelopeInvalid: 46 , CreateEnvelopeError: 47 , CannotSerializeObject: 48 , CannotSerializeObjectNonSerializable: 49 , CircularReferenceDetected: 50 , ClearAuthContextFailed: 51 , ExceptionTruncated: 52 , IllegalCharsInName: 53 , ItemNotInArray: 54 , MaxAjaxPerPVExceeded: 55 , MessageTruncated: 56 , NameTooLong: 57 , SampleRateOutOfRange: 58 , SetAuthContextFailed: 59 , SetAuthContextFailedAccountName: 60 , StringValueTooLong: 61 , StartCalledMoreThanOnce: 62 , StopCalledWithoutStart: 63 , TelemetryInitializerFailed: 64 , TrackArgumentsNotSpecified: 65 , UrlTooLong: 66 , SessionStorageBufferFull: 67 , CannotAccessCookie: 68 , IdTooLong: 69 , InvalidEvent: 70 , FailedMonitorAjaxSetRequestHeader: 71 , SendBrowserInfoOnUserInit: 72 , PluginException: 73 , NotificationException: 74 , SnippetScriptLoadFailure: 99 , InvalidInstrumentationKey: 100 , CannotParseAiBlobValue: 101 , InvalidContentBlob: 102 , TrackPageActionEventFailed: 103 , FailedAddingCustomDefinedRequestContext: 104 , InMemoryStorageBufferFull: 105 }); var aiInstrumentHooks = "_aiHooks"; var cbNames = [ "req", "rsp", "hkErr", "fnErr" ]; function _arrLoop(arr, fn) { if (arr) { for (var lp = 0; lp < arr.length; lp++) { if (fn(arr[lp], lp)) { break; } } } } function _doCallbacks(hooks, callDetails, cbArgs, hookCtx, type) { if (type >= 0 && type <= 2 ) { _arrLoop(hooks, function (hook, idx) { var cbks = hook.cbks; var cb = cbks[cbNames[type]]; if (cb) { callDetails.ctx = function () { var ctx = hookCtx[idx] = (hookCtx[idx] || {}); return ctx; }; try { cb.apply(callDetails.inst, cbArgs); } catch (err) { var orgEx = callDetails.err; try { var hookErrorCb = cbks[cbNames[2 ]]; if (hookErrorCb) { callDetails.err = err; hookErrorCb.apply(callDetails.inst, cbArgs); } } catch (e) { } finally { callDetails.err = orgEx; } } } }); } } function _createFunctionHook(aiHook) { return function () { var funcThis = this; var orgArgs = arguments; var hooks = aiHook.h; var funcArgs = { name: aiHook.n, inst: funcThis, ctx: null, set: _replaceArg }; var hookCtx = []; var cbArgs = _createArgs([funcArgs], orgArgs); funcArgs.evt = getGlobalInst("event"); function _createArgs(target, theArgs) { _arrLoop(theArgs, function (arg) { target.push(arg); }); return target; } function _replaceArg(idx, value) { orgArgs = _createArgs([], orgArgs); orgArgs[idx] = value; cbArgs = _createArgs([funcArgs], orgArgs); } _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 0 ); var theFunc = aiHook.f; if (theFunc) { try { funcArgs.rslt = theFunc.apply(funcThis, orgArgs); } catch (err) { funcArgs.err = err; _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 3 ); throw err; } } _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 1 ); return funcArgs.rslt; }; } function _getOwner(target, name, checkPrototype) { var owner = null; if (target) { if (hasOwnProperty(target, name)) { owner = target; } else if (checkPrototype) { owner = _getOwner(_getObjProto$1(target), name, false); } } return owner; } function InstrumentProto(target, funcName, callbacks) { if (target) { return InstrumentFunc(target[strShimPrototype], funcName, callbacks, false); } return null; } function InstrumentProtos(target, funcNames, callbacks) { if (target) { return InstrumentFuncs(target[strShimPrototype], funcNames, callbacks, false); } return null; } function _createInstrumentHook(owner, funcName, fn, callbacks) { var aiHook = fn && fn[aiInstrumentHooks]; if (!aiHook) { aiHook = { i: 0, n: funcName, f: fn, h: [] }; var newFunc = _createFunctionHook(aiHook); newFunc[aiInstrumentHooks] = aiHook; owner[funcName] = newFunc; } var theHook = { id: aiHook.i, cbks: callbacks, rm: function () { var id = this.id; _arrLoop(aiHook.h, function (hook, idx) { if (hook.id === id) { aiHook.h.splice(idx, 1); return 1; } }); } }; aiHook.i++; aiHook.h.push(theHook); return theHook; } function InstrumentFunc(target, funcName, callbacks, checkPrototype) { if (checkPrototype === void 0) { checkPrototype = true; } if (target && funcName && callbacks) { var owner = _getOwner(target, funcName, checkPrototype); if (owner) { var fn = owner[funcName]; if (typeof fn === strShimFunction) { return _createInstrumentHook(owner, funcName, fn, callbacks); } } } return null; } function InstrumentFuncs(target, funcNames, callbacks, checkPrototype) { if (checkPrototype === void 0) { checkPrototype = true; } var hooks = null; _arrLoop(funcNames, function (funcName) { var hook = InstrumentFunc(target, funcName, callbacks, checkPrototype); if (hook) { if (!hooks) { hooks = []; } hooks.push(hook); } }); return hooks; } function InstrumentEvent(target, evtName, callbacks, checkPrototype) { if (target && evtName && callbacks) { var owner = _getOwner(target, evtName, checkPrototype) || target; if (owner) { return _createInstrumentHook(owner, evtName, owner[evtName], callbacks); } } return null; } exports.AppInsightsCore = AppInsightsCore; exports.BaseCore = BaseCore; exports.BaseTelemetryPlugin = BaseTelemetryPlugin; exports.CoreUtils = CoreUtils; exports.DiagnosticLogger = DiagnosticLogger; exports.EventHelper = EventHelper; exports.EventsDiscardedReason = EventsDiscardedReason; exports.InstrumentEvent = InstrumentEvent; exports.InstrumentFunc = InstrumentFunc; exports.InstrumentFuncs = InstrumentFuncs; exports.InstrumentProto = InstrumentProto; exports.InstrumentProtos = InstrumentProtos; exports.LoggingSeverity = LoggingSeverity; exports.MinChannelPriorty = MinChannelPriorty; exports.NotificationManager = NotificationManager; exports.PerfEvent = PerfEvent; exports.PerfManager = PerfManager; exports.ProcessTelemetryContext = ProcessTelemetryContext; exports.Undefined = Undefined; exports._InternalLogMessage = _InternalLogMessage; exports._InternalMessageId = _InternalMessageId; exports.__getRegisteredEvents = __getRegisteredEvents; exports._legacyCookieMgr = _legacyCookieMgr; exports._logInternalMessage = _logInternalMessage; exports._throwInternal = _throwInternal; exports._warnToConsole = _warnToConsole; exports.addEventHandler = addEventHandler; exports.addEventListeners = addEventListeners; exports.addPageHideEventListener = addPageHideEventListener; exports.addPageShowEventListener = addPageShowEventListener; exports.addPageUnloadEventListener = addPageUnloadEventListener; exports.areCookiesSupported = areCookiesSupported; exports.arrForEach = arrForEach; exports.arrIndexOf = arrIndexOf; exports.arrMap = arrMap; exports.arrReduce = arrReduce; exports.attachEvent = attachEvent; exports.canUseCookies = canUseCookies; exports.createClassFromInterface = createClassFromInterface; exports.createCookieMgr = createCookieMgr; exports.createEnumMap = createEnumMap; exports.createEnumStyle = createEnumStyle; exports.createProcessTelemetryContext = createProcessTelemetryContext; exports.createUniqueNamespace = createUniqueNamespace; exports.createUnloadHandlerContainer = createUnloadHandlerContainer; exports.createValueMap = createValueMap; exports.dateNow = dateNow; exports.deepFreeze = deepFreeze; exports.deleteCookie = deleteCookie; exports.detachEvent = detachEvent; exports.disableCookies = disableCookies; exports.doPerf = doPerf; exports.dumpObj = dumpObj; exports.eventOff = eventOff; exports.eventOn = eventOn; exports.generateW3CId = generateW3CId; exports.getConsole = getConsole; exports.getCookie = getCookie; exports.getCrypto = getCrypto; exports.getDebugExt = getDebugExt; exports.getDebugListener = getDebugListener; exports.getDocument = getDocument; exports.getExceptionName = getExceptionName; exports.getGblPerfMgr = getGblPerfMgr; exports.getGlobal = getGlobal; exports.getGlobalInst = getGlobalInst; exports.getHistory = getHistory; exports.getIEVersion = getIEVersion; exports.getJSON = getJSON; exports.getLocation = getLocation; exports.getMsCrypto = getMsCrypto; exports.getNavigator = getNavigator; exports.getPerformance = getPerformance; exports.getSetValue = getSetValue; exports.getWindow = getWindow; exports.hasDocument = hasDocument; exports.hasHistory = hasHistory; exports.hasJSON = hasJSON; exports.hasNavigator = hasNavigator; exports.hasOwnProperty = hasOwnProperty; exports.hasWindow = hasWindow; exports.initializePlugins = initializePlugins; exports.isArray = isArray; exports.isBeaconsSupported = isBeaconsSupported; exports.isBoolean = isBoolean; exports.isDate = isDate; exports.isError = isError; exports.isFetchSupported = isFetchSupported; exports.isFunction = isFunction; exports.isIE = isIE; exports.isNotNullOrUndefined = isNotNullOrUndefined; exports.isNotTruthy = isNotTruthy; exports.isNotUndefined = isNotUndefined; exports.isNullOrUndefined = isNullOrUndefined; exports.isNumber = isNumber; exports.isObject = isObject; exports.isReactNative = isReactNative; exports.isSafari = isSafari; exports.isString = isString; exports.isSymbol = isSymbol; exports.isTruthy = isTruthy; exports.isTypeof = isTypeof; exports.isUndefined = isUndefined; exports.isXhrSupported = isXhrSupported; exports.mergeEvtNamespace = mergeEvtNamespace; exports.mwcRandom32 = mwcRandom32; exports.mwcRandomSeed = mwcRandomSeed; exports.newGuid = newGuid; exports.newId = newId; exports.normalizeJsName = normalizeJsName; exports.objCreate = objCreateFn; exports.objDefineAccessors = objDefineAccessors; exports.objExtend = objExtend; exports.objForEachKey = objForEachKey; exports.objFreeze = objFreeze; exports.objKeys = objKeys; exports.objSeal = objSeal; exports.objToString = objToString; exports.optimizeObject = optimizeObject; exports.perfNow = perfNow; exports.proxyAssign = proxyAssign; exports.proxyFunctionAs = proxyFunctionAs; exports.proxyFunctions = proxyFunctions; exports.random32 = random32; exports.randomValue = randomValue; exports.removeEventHandler = removeEventHandler; exports.removeEventListeners = removeEventListeners; exports.removePageHideEventListener = removePageHideEventListener; exports.removePageShowEventListener = removePageShowEventListener; exports.removePageUnloadEventListener = removePageUnloadEventListener; exports.safeGetCookieMgr = safeGetCookieMgr; exports.safeGetLogger = safeGetLogger; exports.setCookie = setCookie; exports.setEnableEnvMocks = setEnableEnvMocks; exports.setGblPerfMgr = setGblPerfMgr; exports.setValue = setValue; exports.sortPlugins = sortPlugins; exports.strContains = strContains; exports.strEndsWith = strEndsWith; exports.strFunction = strShimFunction; exports.strObject = strShimObject; exports.strPrototype = strShimPrototype; exports.strStartsWith = strStartsWith; exports.strTrim = strTrim; exports.strUndefined = strShimUndefined; exports.throwError = throwError; exports.toISOString = toISOString; exports.uaDisallowsSameSiteNone = uaDisallowsSameSiteNone; exports.unloadComponents = unloadComponents; exports.useXDomainRequest = useXDomainRequest; (function(obj, prop, descriptor) { /* ai_es3_polyfil defineProperty */ var func = Object["defineProperty"]; if (func) { try { return func(obj, prop, descriptor); } catch(e) { /* IE8 defines defineProperty, but will throw */ } } if (descriptor && typeof descriptor.value !== undefined) { obj[prop] = descriptor.value; } return obj; })(exports, '__esModule', { value: true }); }));//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist/applicationinsights-core-js.js.map /*! * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ !function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(((n="undefined"!=typeof globalThis?globalThis:n||self).Microsoft=n.Microsoft||{},n.Microsoft.ApplicationInsights=n.Microsoft.ApplicationInsights||{}))}(this,function(n){"use strict";var u="function",a="object",e="undefined",o="prototype",E="hasOwnProperty",t=Object,I=t[o],N=t.assign,P=t.create,z=t.defineProperty,m=I[E],B=null;function K(n){return void 0===n&&(n=!0),B&&n||(typeof globalThis!==e&&globalThis&&(B=globalThis),typeof self!==e&&self&&(B=self),typeof window!==e&&window&&(B=window),typeof global!==e&&global&&(B=global)),B}function q(n){throw new TypeError(n)}function H(n){if(P)return P(n);if(null==n)return{};var e=typeof n;function t(){}return e!==a&&e!==u&&q("Object prototype may only be an Object:"+n),t[o]=n,new t}(K()||{}).Symbol,(K()||{}).Reflect;var V=function(n,e){return(V=t.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var t in e)e[E](t)&&(n[t]=e[t])})(n,e)};function W(n,e){function t(){this.constructor=n}typeof e!==u&&null!==e&&q("Class extends value "+e+" is not a constructor or null"),V(n,e),n[o]=null===e?H(e):(t[o]=e[o],new t)}function G(n,e){for(var t=0,r=e.length,i=n.length;t=o.maxInternalMessageLimit()||(r=!0,t="AITR_"+e.messageId,a[t]?r=!1:a[t]=!0,r&&(n<=o.telemetryLoggingLevel()&&(o.queue.push(e),i++,u(1===n?"error":"warn",e)),i===o.maxInternalMessageLimit()&&(r=new bt(23,t="Internal events throttle limit per PageView reached for this app.",!1),o.queue.push(r),1===n?o.errorToConsole(t):o.warnToConsole(t))))}})};function Et(n){return n||new St}function It(n,e,t,r,i,o){void 0===o&&(o=!1),(n||new St).throwInternal(e,t,r,i,o)}function Nt(n,e){Et(n).warnToConsole(e)}var Pt=null,Mt=(s.ParentContextKey="parent",s.ChildrenContextKey="childEvts",s);function s(n,i,e){var t,o=this,u=!1;o.start=ne(),o.name=n,o.isAsync=e,o.isChildEvt=function(){return!1},k(i)&&(u=$n(o,"payload",function(){return!t&&k(i)&&(t=i(),i=null),t})),o.getCtx=function(n){return n?(n===s.ParentContextKey||n===s.ChildrenContextKey?o:o.ctx||{})[n]:null},o.setCtx=function(n,e){n&&(n===s.ParentContextKey?(o[n]||(o.isChildEvt=function(){return!0}),o[n]=e):n===s.ChildrenContextKey?o[n]=e:(o.ctx=o.ctx||{})[n]=e)},o.complete=function(){var n=0,e=o.getCtx(s.ChildrenContextKey);if(C(e))for(var t=0;t>>=0),Ot=123456789+n&T,Dt=987654321-n&T,At=!0}function jt(){try{var n=2147483647&ne();Ut((Math.random()*Ft^n)+n)}catch(e){}}function Rt(n){return 0>>0:0}function zt(n){var e=0,t=ft()||st();return 0===(e=t&&t.getRandomValues?t.getRandomValues(new Uint32Array(1))[0]&T:e)&&dt()&&(At||jt(),e=Kt()&T),0===e&&(e=Math.floor(Ft*Math.random()|0)),n||(e>>>=0),e}function Bt(n){n?Ut(n):jt()}function Kt(n){var e=((Dt=36969*(65535&Dt)+(Dt>>16)&T)<<16)+(65535&(Ot=18e3*(65535&Ot)+(Ot>>16)&T))>>>0&T|0;return n||(e>>>=0),e}function qt(n){void 0===n&&(n=22);for(var e=zt()>>>0,t=0,r=g;r.length>>=6,5==++t&&(e=(zt()<<2&4294967295|3&e)>>>0,t=0);return r}var Ht=z,Vt="2.8.3",Wt="."+qt(6),Gt=0;function Jt(n){return 1===n.nodeType||9===n.nodeType||!+n.nodeType}function Qt(n,e){return jn(n+Gt+++((e=void 0!==e&&e)?"."+Vt:"")+Wt)}function Xt(n){var o={id:Qt("_aiData-"+(n||"")+"."+Vt),accept:Jt,get:function(n,e,t,r){var i=n[o.id];return i?i[jn(e)]:(r&&((i=function(n,e){var t=e[n.id];if(!t){t={};try{Jt(e)&&!function(n,e,t){if(Ht)try{return Ht(n,e,{value:t,enumerable:!1,configurable:!0}),1}catch(r){}}(e,n.id,t)&&(e[n.id]=t)}catch(r){}}return t}(o,n))[jn(e)]=t),t)},kill:function(n,e){if(n&&n[e])try{delete n[e]}catch(t){}}};return o}var $t=Xt("plugin");function Yt(n){return $t.get(n,"state",{},!0)}function Zt(t,r){for(var i,n=[],e=null,o=t.getNext();o;){var u=o.getPlugin();u&&(e&&k(e[X])&&k(u[J])&&e[X](u),(k(u[$])?u[$]():(i=Yt(u))[$])||n.push(u),e=u,o=o.getNext())}L(n,function(n){var e=t.core();n.initialize(t.getCfg(),e,r,t.getNext()),i=Yt(n),n[d]||i[d]||(i[d]=e),i[$]=!0,delete i[M]})}function nr(n){return n.sort(function(n,e){var t=0,r=k(e[J]);return k(n[J])?t=r?n[Q]-e[Q]:1:r&&(t=-1),t})}var er="TelemetryPluginChain",tr="_hasRun",rr="_getTelCtx",ir=0;function or(n,u,t,e){var r=null,i=[],o=(null!==e&&(r=e?function(n,e,t){for(;n;){if(n.getPlugin()===t)return n;n=n.getNext()}return R([t],e.config||{},e)}(n,t,e):n),{_next:function(){var n,e=r;return r=e?e.getNext():null,e||(n=i)&&0Fr&&c.push(n)}),Or(l,c,t,a)),l)),T?(-1!==(d=F(v,T))&&v.splice(d,1),-1!==(d=F(w,T))&&w.splice(d,1),T._setQueue(E)):(f=E,s=y,g=!1,(d={identifier:"ChannelControllerPlugin",priority:Fr,initialize:function(e,t,r,n){g=!0,L(f,function(n){n&&0>4&15]+e[n>>8&15]+e[n>>12&15]+e[n>>16&15]+e[n>>20&15]+e[n>>24&15]+e[n>>28&15];var i=e[8+(3&zt())|0];return t.substr(0,8)+t.substr(9,4)+"4"+t.substr(13,3)+i+t.substr(16,3)+t.substr(19,12)}var Ai={_canUseCookies:undefined,isTypeof:On,isUndefined:v,isNullOrUndefined:_,hasOwnProperty:Un,isFunction:k,isObject:x,isDate:zn,isArray:C,isError:Bn,isString:l,isNumber:Kn,isBoolean:qn,toISOString:Vn,arrForEach:L,arrIndexOf:F,arrMap:Wn,arrReduce:Gn,strTrim:h,objCreate:H,objKeys:Xn,objDefineAccessors:$n,addEventHandler:Ti,dateNow:ne,isIE:dt,disableCookies:ji,newGuid:ki,perfNow:Li,newId:qt,randomValue:Rt,random32:zt,mwcRandomSeed:Bt,mwcRandom32:Kt,generateW3CId:Fi},Oi=/[xy]/g,Di={Attach:bi,AttachEvent:bi,Detach:wi,DetachEvent:wi};function Ui(n,e){n=Tr(n,e),e=Ai._canUseCookies;return null===Mi&&(Mi=[],Pi=e,$n(Ai,"_canUseCookies",function(){return Pi},function(e){Pi=e,L(Mi,function(n){n.setEnabled(e)})})),-1===F(Mi,n)&&Mi.push(n),qn(e)&&n.setEnabled(e),qn(Pi)&&n.setEnabled(Pi),n}function ji(){Ui().setEnabled(!1)}var Ri=le({CRITICAL:1,WARNING:2}),zi=le({BrowserDoesNotSupportLocalStorage:0,BrowserCannotReadLocalStorage:1,BrowserCannotReadSessionStorage:2,BrowserCannotWriteLocalStorage:3,BrowserCannotWriteSessionStorage:4,BrowserFailedRemovalFromLocalStorage:5,BrowserFailedRemovalFromSessionStorage:6,CannotSendEmptyTelemetry:7,ClientPerformanceMathError:8,ErrorParsingAISessionCookie:9,ErrorPVCalc:10,ExceptionWhileLoggingError:11,FailedAddingTelemetryToBuffer:12,FailedMonitorAjaxAbort:13,FailedMonitorAjaxDur:14,FailedMonitorAjaxOpen:15,FailedMonitorAjaxRSC:16,FailedMonitorAjaxSend:17,FailedMonitorAjaxGetCorrelationHeader:18,FailedToAddHandlerForOnBeforeUnload:19,FailedToSendQueuedTelemetry:20,FailedToReportDataLoss:21,FlushFailed:22,MessageLimitPerPVExceeded:23,MissingRequiredFieldSpecification:24,NavigationTimingNotSupported:25,OnError:26,SessionRenewalDateIsZero:27,SenderNotInitialized:28,StartTrackEventFailed:29,StopTrackEventFailed:30,StartTrackFailed:31,StopTrackFailed:32,TelemetrySampledAndNotSent:33,TrackEventFailed:34,TrackExceptionFailed:35,TrackMetricFailed:36,TrackPVFailed:37,TrackPVFailedCalc:38,TrackTraceFailed:39,TransmissionFailed:40,FailedToSetStorageBuffer:41,FailedToRestoreStorageBuffer:42,InvalidBackendResponse:43,FailedToFixDepricatedValues:44,InvalidDurationValue:45,TelemetryEnvelopeInvalid:46,CreateEnvelopeError:47,CannotSerializeObject:48,CannotSerializeObjectNonSerializable:49,CircularReferenceDetected:50,ClearAuthContextFailed:51,ExceptionTruncated:52,IllegalCharsInName:53,ItemNotInArray:54,MaxAjaxPerPVExceeded:55,MessageTruncated:56,NameTooLong:57,SampleRateOutOfRange:58,SetAuthContextFailed:59,SetAuthContextFailedAccountName:60,StringValueTooLong:61,StartCalledMoreThanOnce:62,StopCalledWithoutStart:63,TelemetryInitializerFailed:64,TrackArgumentsNotSpecified:65,UrlTooLong:66,SessionStorageBufferFull:67,CannotAccessCookie:68,IdTooLong:69,InvalidEvent:70,FailedMonitorAjaxSetRequestHeader:71,SendBrowserInfoOnUserInit:72,PluginException:73,NotificationException:74,SnippetScriptLoadFailure:99,InvalidInstrumentationKey:100,CannotParseAiBlobValue:101,InvalidContentBlob:102,TrackPageActionEventFailed:103,FailedAddingCustomDefinedRequestContext:104,InMemoryStorageBufferFull:105}),Bi="_aiHooks",Ki=["req","rsp","hkErr","fnErr"];function qi(n,e){if(n)for(var t=0;t=o&&!(n=r===i)){for(var u=0;u 0) { var eventQueue = _eventQueue; _eventQueue = []; arrForEach(eventQueue, function (event) { _createTelCtx().processNext(event); }); } }; /** * Periodically check logger.queue for log messages to be flushed */ _self.pollInternalLogs = function (eventName) { _internalLogsEventName = eventName || null; var interval = _self.config.diagnosticLogInterval; if (!interval || !(interval > 0)) { interval = 10000; } if (_internalLogPoller) { clearInterval(_internalLogPoller); } _internalLogPoller = setInterval(function () { _flushInternalLogs(); }, interval); return _internalLogPoller; }; /** * Stop polling log messages from logger.queue */ _self.stopPollingInternalLogs = function () { if (_internalLogPoller) { clearInterval(_internalLogPoller); _internalLogPoller = 0; _flushInternalLogs(); } }; // Add addTelemetryInitializer proxyFunctions(_self, function () { return _telemetryInitializerPlugin; }, ["addTelemetryInitializer"]); _self.unload = function (isAsync, unloadComplete, cbTimeout) { if (isAsync === void 0) { isAsync = true; } if (!_isInitialized) { // The SDK is not initialized throwError(strSdkNotInitialized); } // Check if the SDK still unloading so throw if (_isUnloading) { // The SDK is already unloading throwError(strSdkUnloadingError); } var unloadState = { reason: 50 /* SdkUnload */, isAsync: isAsync, flushComplete: false }; var processUnloadCtx = createProcessTelemetryUnloadContext(_getPluginChain(), _self); processUnloadCtx.onComplete(function () { _initDefaults(); unloadComplete && unloadComplete(unloadState); }, _self); function _doUnload(flushComplete) { unloadState.flushComplete = flushComplete; _isUnloading = true; // Run all of the unload handlers first (before unloading the plugins) _unloadHandlers.run(processUnloadCtx, unloadState); // Stop polling the internal logs _self.stopPollingInternalLogs(); // Start unloading the components, from this point onwards the SDK should be considered to be in an unstable state processUnloadCtx.processNext(unloadState); } if (!_flushChannels(isAsync, _doUnload, 6 /* SdkUnload */, cbTimeout)) { _doUnload(false); } }; _self.getPlugin = _getPlugin; _self.addPlugin = function (plugin, replaceExisting, isAsync, addCb) { if (!plugin) { addCb && addCb(false); _logOrThrowError(strValidationError); return; } var existingPlugin = _getPlugin(plugin.identifier); if (existingPlugin && !replaceExisting) { addCb && addCb(false); _logOrThrowError("Plugin [" + plugin.identifier + "] is already loaded!"); return; } var updateState = { reason: 16 /* PluginAdded */ }; function _addPlugin(removed) { _configExtensions.push(plugin); updateState.added = [plugin]; // Re-Initialize the plugin chain _initPluginChain(_self.config, updateState); addCb && addCb(true); } if (existingPlugin) { var removedPlugins_1 = [existingPlugin.plugin]; var unloadState = { reason: 2 /* PluginReplace */, isAsync: !!isAsync }; _removePlugins(removedPlugins_1, unloadState, function (removed) { if (!removed) { // Previous plugin was successfully removed or was not installed addCb && addCb(false); } else { updateState.removed = removedPlugins_1; updateState.reason |= 32 /* PluginRemoved */; _addPlugin(true); } }); } else { _addPlugin(false); } }; _self.evtNamespace = function () { return _evtNamespace; }; _self.flush = _flushChannels; // Create the addUnloadCb proxyFunctionAs(_self, "addUnloadCb", function () { return _unloadHandlers; }, "add"); function _initDefaults() { _isInitialized = false; // Use a default logger so initialization errors are not dropped on the floor with full logging _self.config = objExtend(true, {}, defaultInitConfig); _self.logger = new DiagnosticLogger(_self.config); _self._extensions = []; _telemetryInitializerPlugin = new TelemetryInitializerPlugin(); _eventQueue = []; _notificationManager = null; _perfManager = null; _cfgPerfManager = null; _cookieManager = null; _pluginChain = null; _coreExtensions = null; _configExtensions = []; _channelControl = null; _channelConfig = null; _channelQueue = null; _isUnloading = false; _internalLogsEventName = null; _evtNamespace = createUniqueNamespace("AIBaseCore", true); _unloadHandlers = createUnloadHandlerContainer(); } function _createTelCtx() { return createProcessTelemetryContext(_getPluginChain(), _self.config, _self); } // Initialize or Re-initialize the plugins function _initPluginChain(config, updateState) { // Extension validation var theExtensions = _validateExtensions(_self.logger, ChannelControllerPriority, _configExtensions); _coreExtensions = theExtensions.core; _pluginChain = null; // Sort the complete set of extensions by priority var allExtensions = theExtensions.all; // Initialize the Channel Queues and the channel plugins first _channelQueue = objFreeze(createChannelQueues(_channelConfig, allExtensions, config, _self)); if (_channelControl) { // During add / remove of a plugin this may get called again, so don't re-add if already present // But we also want the controller as the last, so remove if already present // And reusing the existing instance, just in case an installed plugin has a reference and // is using it. var idx = arrIndexOf(allExtensions, _channelControl); if (idx !== -1) { allExtensions.splice(idx, 1); } idx = arrIndexOf(_coreExtensions, _channelControl); if (idx !== -1) { _coreExtensions.splice(idx, 1); } _channelControl._setQueue(_channelQueue); } else { _channelControl = createChannelControllerPlugin(_channelQueue, _self); } // Add on "channelController" as the last "plugin" allExtensions.push(_channelControl); _coreExtensions.push(_channelControl); // Required to allow plugins to call core.getPlugin() during their own initialization _self._extensions = sortPlugins(allExtensions); // Initialize the controls _channelControl.initialize(config, _self, allExtensions); initializePlugins(_createTelCtx(), allExtensions); // Now reset the extensions to just those being managed by Basecore _self._extensions = objFreeze(sortPlugins(_coreExtensions || [])).slice(); if (updateState) { _doUpdate(updateState); } } function _getPlugin(pluginIdentifier) { var theExt = null; var thePlugin = null; arrForEach(_self._extensions, function (ext) { if (ext.identifier === pluginIdentifier && ext !== _channelControl && ext !== _telemetryInitializerPlugin) { thePlugin = ext; return -1; } }); if (!thePlugin && _channelControl) { // Check the channel Controller thePlugin = _channelControl.getChannel(pluginIdentifier); } if (thePlugin) { theExt = { plugin: thePlugin, setEnabled: function (enabled) { _getPluginState(thePlugin)[strDisabled] = !enabled; }, isEnabled: function () { var pluginState = _getPluginState(thePlugin); return !pluginState[strTeardown] && !pluginState[strDisabled]; }, remove: function (isAsync, removeCb) { if (isAsync === void 0) { isAsync = true; } var pluginsToRemove = [thePlugin]; var unloadState = { reason: 1 /* PluginUnload */, isAsync: isAsync }; _removePlugins(pluginsToRemove, unloadState, function (removed) { if (removed) { // Re-Initialize the plugin chain _initPluginChain(_self.config, { reason: 32 /* PluginRemoved */, removed: pluginsToRemove }); } removeCb && removeCb(removed); }); } }; } return theExt; } function _getPluginChain() { if (!_pluginChain) { // copy the collection of extensions var extensions = (_coreExtensions || []).slice(); // During add / remove this may get called again, so don't readd if already present if (arrIndexOf(extensions, _telemetryInitializerPlugin) === -1) { extensions.push(_telemetryInitializerPlugin); } _pluginChain = createTelemetryProxyChain(sortPlugins(extensions), _self.config, _self); } return _pluginChain; } function _removePlugins(thePlugins, unloadState, removeComplete) { if (thePlugins && thePlugins.length > 0) { var unloadChain = createTelemetryProxyChain(thePlugins, _self.config, _self); var unloadCtx = createProcessTelemetryUnloadContext(unloadChain, _self); unloadCtx.onComplete(function () { var removed = false; // Remove the listed config extensions var newConfigExtensions = []; arrForEach(_configExtensions, function (plugin, idx) { if (!_isPluginPresent(plugin, thePlugins)) { newConfigExtensions.push(plugin); } else { removed = true; } }); _configExtensions = newConfigExtensions; // Re-Create the channel config var newChannelConfig = []; if (_channelConfig) { arrForEach(_channelConfig, function (queue, idx) { var newQueue = []; arrForEach(queue, function (channel) { if (!_isPluginPresent(channel, thePlugins)) { newQueue.push(channel); } else { removed = true; } }); newChannelConfig.push(newQueue); }); _channelConfig = newChannelConfig; } removeComplete && removeComplete(removed); }); unloadCtx.processNext(unloadState); } else { removeComplete(false); } } function _flushInternalLogs() { var queue = _self.logger ? _self.logger.queue : []; if (queue) { arrForEach(queue, function (logMessage) { var item = { name: _internalLogsEventName ? _internalLogsEventName : "InternalMessageId: " + logMessage.messageId, iKey: _self.config.instrumentationKey, time: toISOString(new Date()), baseType: _InternalLogMessage.dataType, baseData: { message: logMessage.message } }; _self.track(item); }); queue.length = 0; } } function _flushChannels(isAsync, callBack, sendReason, cbTimeout) { if (_channelControl) { return _channelControl.flush(isAsync, callBack, sendReason || 6 /* SdkUnload */, cbTimeout); } callBack && callBack(false); return true; } function _initDebugListener(config) { if (config.disableDbgExt === true && _debugListener) { // Remove any previously loaded debug listener _notificationManager[strRemoveNotificationListener](_debugListener); _debugListener = null; } if (_notificationManager && !_debugListener && config.disableDbgExt !== true) { _debugListener = getDebugListener(config); _notificationManager[strAddNotificationListener](_debugListener); } } function _initPerfManager(config) { if (!config.enablePerfMgr && _cfgPerfManager) { // Remove any existing config based performance manager _cfgPerfManager = null; } if (config.enablePerfMgr) { // Set the performance manager creation function if not defined setValue(_self.config, "createPerfMgr", _createPerfManager); } } function _initExtConfig(config) { var extConfig = getSetValue(config, strExtensionConfig); extConfig.NotificationManager = _notificationManager; } function _doUpdate(updateState) { var updateCtx = createProcessTelemetryUpdateContext(_getPluginChain(), _self); if (!_self._updateHook || _self._updateHook(updateCtx, updateState) !== true) { updateCtx.processNext(updateState); } } function _logOrThrowError(message) { var logger = _self.logger; if (logger) { // there should always be a logger _throwInternal(logger, 2 /* WARNING */, 73 /* PluginException */, message); } else { throwError(message); } } }); } // Removed Stub for BaseCore.prototype.initialize. // Removed Stub for BaseCore.prototype.getTransmissionControls. // Removed Stub for BaseCore.prototype.track. // Removed Stub for BaseCore.prototype.getProcessTelContext. // Removed Stub for BaseCore.prototype.getNotifyMgr. // Removed Stub for BaseCore.prototype.addNotificationListener. // Removed Stub for BaseCore.prototype.removeNotificationListener. // Removed Stub for BaseCore.prototype.getCookieMgr. // Removed Stub for BaseCore.prototype.setCookieMgr. // Removed Stub for BaseCore.prototype.getPerfMgr. // Removed Stub for BaseCore.prototype.setPerfMgr. // Removed Stub for BaseCore.prototype.eventCnt. // Removed Stub for BaseCore.prototype.pollInternalLogs. // Removed Stub for BaseCore.prototype.stopPollingInternalLogs. // Removed Stub for BaseCore.prototype.addTelemetryInitializer. // Removed Stub for BaseCore.prototype.unload. // Removed Stub for BaseCore.prototype.getPlugin. // Removed Stub for BaseCore.prototype.addPlugin. // Removed Stub for BaseCore.prototype.evtNamespace. // Removed Stub for BaseCore.prototype.addUnloadCb. // Removed Stub for BaseCore.prototype.flush. // Removed Stub for BaseCore.prototype.releaseQueue. // Removed Stub for BaseCore.prototype._updateHook. return BaseCore; }()); export { BaseCore }; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/BaseCore.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ "use strict"; import dynamicProto from "@microsoft/dynamicproto-js"; import { createProcessTelemetryContext, createProcessTelemetryUnloadContext, createProcessTelemetryUpdateContext } from "./ProcessTelemetryContext"; import { arrForEach, isArray, isFunction, isNullOrUndefined, proxyFunctionAs, setValue } from "./HelperFuncs"; import { strExtensionConfig } from "./Constants"; import { createUnloadHandlerContainer } from "./UnloadHandlerContainer"; import { strDoTeardown, strIsInitialized, strSetNextPlugin } from "./InternalConstants"; var strGetPlugin = "getPlugin"; /** * BaseTelemetryPlugin provides a basic implementation of the ITelemetryPlugin interface so that plugins * can avoid implementation the same set of boiler plate code as well as provide a base * implementation so that new default implementations can be added without breaking all plugins. */ var BaseTelemetryPlugin = /** @class */ (function () { function BaseTelemetryPlugin() { var _self = this; // Setting _self here as it's used outside of the dynamicProto as well // NOTE!: DON'T set default values here, instead set them in the _initDefaults() function as it is also called during teardown() var _isinitialized; var _rootCtx; // Used as the root context, holding the current config and initialized core var _nextPlugin; // Used for backward compatibility where plugins don't call the main pipeline var _unloadHandlerContainer; var _hooks; _initDefaults(); dynamicProto(BaseTelemetryPlugin, _self, function (_self) { _self.initialize = function (config, core, extensions, pluginChain) { _setDefaults(config, core, pluginChain); _isinitialized = true; }; _self.teardown = function (unloadCtx, unloadState) { // If this plugin has already been torn down (not operational) or is not initialized (core is not set) // or the core being used for unload was not the same core used for initialization. var core = _self.core; if (!core || (unloadCtx && core !== unloadCtx.core())) { // Do Nothing as either the plugin is not initialized or was not initialized by the current core return; } var result; var unloadDone = false; var theUnloadCtx = unloadCtx || createProcessTelemetryUnloadContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin); var theUnloadState = unloadState || { reason: 0 /* ManualTeardown */, isAsync: false }; function _unloadCallback() { if (!unloadDone) { unloadDone = true; _unloadHandlerContainer.run(theUnloadCtx, unloadState); // Remove all instrumentation hooks arrForEach(_hooks, function (fn) { fn.rm(); }); _hooks = []; if (result === true) { theUnloadCtx.processNext(theUnloadState); } _initDefaults(); } } if (!_self[strDoTeardown] || _self[strDoTeardown](theUnloadCtx, theUnloadState, _unloadCallback) !== true) { _unloadCallback(); } else { // Tell the caller that we will be calling processNext() result = true; } return result; }; _self.update = function (updateCtx, updateState) { // If this plugin has already been torn down (not operational) or is not initialized (core is not set) // or the core being used for unload was not the same core used for initialization. var core = _self.core; if (!core || (updateCtx && core !== updateCtx.core())) { // Do Nothing return; } var result; var updateDone = false; var theUpdateCtx = updateCtx || createProcessTelemetryUpdateContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin); var theUpdateState = updateState || { reason: 0 /* Unknown */ }; function _updateCallback() { if (!updateDone) { updateDone = true; _setDefaults(theUpdateCtx.getCfg(), theUpdateCtx.core(), theUpdateCtx.getNext()); } } if (!_self._doUpdate || _self._doUpdate(theUpdateCtx, theUpdateState, _updateCallback) !== true) { _updateCallback(); } else { result = true; } return result; }; _self._addHook = function (hooks) { if (hooks) { if (isArray(hooks)) { _hooks = _hooks.concat(hooks); } else { _hooks.push(hooks); } } }; proxyFunctionAs(_self, "_addUnloadCb", function () { return _unloadHandlerContainer; }, "add"); }); // These are added after the dynamicProto so that are not moved to the prototype _self.diagLog = function (itemCtx) { return _getTelCtx(itemCtx).diagLog(); }; _self[strIsInitialized] = function () { return _isinitialized; }; _self.setInitialized = function (isInitialized) { _isinitialized = isInitialized; }; // _self.getNextPlugin = () => DO NOT IMPLEMENT // Sub-classes of this base class *should* not be relying on this value and instead // should use processNext() function. If you require access to the plugin use the // IProcessTelemetryContext.getNext().getPlugin() while in the pipeline, Note getNext() may return null. _self[strSetNextPlugin] = function (next) { _nextPlugin = next; }; _self.processNext = function (env, itemCtx) { if (itemCtx) { // Normal core execution sequence itemCtx.processNext(env); } else if (_nextPlugin && isFunction(_nextPlugin.processTelemetry)) { // Looks like backward compatibility or out of band processing. And as it looks // like a ITelemetryPlugin or ITelemetryPluginChain, just call processTelemetry _nextPlugin.processTelemetry(env, null); } }; _self._getTelCtx = _getTelCtx; function _getTelCtx(currentCtx) { if (currentCtx === void 0) { currentCtx = null; } var itemCtx = currentCtx; if (!itemCtx) { var rootCtx = _rootCtx || createProcessTelemetryContext(null, {}, _self.core); // tslint:disable-next-line: prefer-conditional-expression if (_nextPlugin && _nextPlugin[strGetPlugin]) { // Looks like a chain object itemCtx = rootCtx.createNew(null, _nextPlugin[strGetPlugin]); } else { itemCtx = rootCtx.createNew(null, _nextPlugin); } } return itemCtx; } function _setDefaults(config, core, pluginChain) { if (config) { // Make sure the extensionConfig exists setValue(config, strExtensionConfig, [], null, isNullOrUndefined); } if (!pluginChain && core) { // Get the first plugin from the core pluginChain = core.getProcessTelContext().getNext(); } var nextPlugin = _nextPlugin; if (_nextPlugin && _nextPlugin[strGetPlugin]) { // If it looks like a proxy/chain then get the plugin nextPlugin = _nextPlugin[strGetPlugin](); } // Support legacy plugins where core was defined as a property _self.core = core; _rootCtx = createProcessTelemetryContext(pluginChain, config, core, nextPlugin); } function _initDefaults() { _isinitialized = false; _self.core = null; _rootCtx = null; _nextPlugin = null; _hooks = []; _unloadHandlerContainer = createUnloadHandlerContainer(); } } // Removed Stub for BaseTelemetryPlugin.prototype.initialize. // Removed Stub for BaseTelemetryPlugin.prototype.teardown. // Removed Stub for BaseTelemetryPlugin.prototype.update. // Removed Stub for BaseTelemetryPlugin.prototype._addUnloadCb. // Removed Stub for BaseTelemetryPlugin.prototype._addHook. return BaseTelemetryPlugin; }()); export { BaseTelemetryPlugin }; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ // import { arrForEach, isArray, objFreeze, throwError } from "./HelperFuncs"; import { strPause, strProcessNext, strResume, strTeardown } from "./InternalConstants"; import { createProcessTelemetryContext, createTelemetryProxyChain } from "./ProcessTelemetryContext"; import { initializePlugins } from "./TelemetryHelpers"; export var ChannelControllerPriority = 500; var ChannelValidationMessage = "Channel has invalid priority - "; function _addChannelQueue(channelQueue, queue, config, core) { if (queue && isArray(queue) && queue.length > 0) { queue = queue.sort(function (a, b) { return a.priority - b.priority; }); arrForEach(queue, function (queueItem) { if (queueItem.priority < ChannelControllerPriority) { throwError(ChannelValidationMessage + queueItem.identifier); } }); channelQueue.push({ queue: objFreeze(queue), chain: createTelemetryProxyChain(queue, config, core) }); } } export function createChannelControllerPlugin(channelQueue, core) { var _a; function _getTelCtx() { return createProcessTelemetryContext(null, core.config, core, null); } function _processChannelQueue(theChannels, itemCtx, processFn, onComplete) { var waiting = theChannels ? (theChannels.length + 1) : 1; function _runChainOnComplete() { waiting--; if (waiting === 0) { onComplete && onComplete(); onComplete = null; } } if (waiting > 0) { arrForEach(theChannels, function (channels) { // pass on to first item in queue if (channels && channels.queue.length > 0) { var channelChain = channels.chain; var chainCtx = itemCtx.createNew(channelChain); chainCtx.onComplete(_runChainOnComplete); // Cause this chain to start processing processFn(chainCtx); } else { waiting--; } }); } _runChainOnComplete(); } function _doUpdate(updateCtx, updateState) { var theUpdateState = updateState || { reason: 0 /* Unknown */ }; _processChannelQueue(channelQueue, updateCtx, function (chainCtx) { chainCtx[strProcessNext](theUpdateState); }, function () { updateCtx[strProcessNext](theUpdateState); }); return true; } function _doTeardown(unloadCtx, unloadState) { var theUnloadState = unloadState || { reason: 0 /* ManualTeardown */, isAsync: false }; _processChannelQueue(channelQueue, unloadCtx, function (chainCtx) { chainCtx[strProcessNext](theUnloadState); }, function () { unloadCtx[strProcessNext](theUnloadState); isInitialized = false; }); return true; } function _getChannel(pluginIdentifier) { var thePlugin = null; if (channelQueue && channelQueue.length > 0) { arrForEach(channelQueue, function (channels) { // pass on to first item in queue if (channels && channels.queue.length > 0) { arrForEach(channels.queue, function (ext) { if (ext.identifier === pluginIdentifier) { thePlugin = ext; // Cause arrForEach to stop iterating return -1; } }); if (thePlugin) { // Cause arrForEach to stop iterating return -1; } } }); } return thePlugin; } var isInitialized = false; var channelController = (_a = { identifier: "ChannelControllerPlugin", priority: ChannelControllerPriority, initialize: function (config, core, extensions, pluginChain) { isInitialized = true; arrForEach(channelQueue, function (channels) { if (channels && channels.queue.length > 0) { initializePlugins(createProcessTelemetryContext(channels.chain, config, core), extensions); } }); }, isInitialized: function () { return isInitialized; }, processTelemetry: function (item, itemCtx) { _processChannelQueue(channelQueue, itemCtx || _getTelCtx(), function (chainCtx) { chainCtx[strProcessNext](item); }, function () { itemCtx[strProcessNext](item); }); }, update: _doUpdate }, _a[strPause] = function () { _processChannelQueue(channelQueue, _getTelCtx(), function (chainCtx) { chainCtx.iterate(function (plugin) { plugin[strPause] && plugin[strPause](); }); }, null); }, _a[strResume] = function () { _processChannelQueue(channelQueue, _getTelCtx(), function (chainCtx) { chainCtx.iterate(function (plugin) { plugin[strResume] && plugin[strResume](); }); }, null); }, _a[strTeardown] = _doTeardown, _a.getChannel = _getChannel, _a.flush = function (isAsync, callBack, sendReason, cbTimeout) { // Setting waiting to one so that we don't call the callBack until we finish iterating var waiting = 1; var doneIterating = false; var cbTimer = null; cbTimeout = cbTimeout || 5000; function doCallback() { waiting--; if (doneIterating && waiting === 0) { if (cbTimer) { clearTimeout(cbTimer); cbTimer = null; } callBack && callBack(doneIterating); callBack = null; } } _processChannelQueue(channelQueue, _getTelCtx(), function (chainCtx) { chainCtx.iterate(function (plugin) { if (plugin.flush) { waiting++; var handled_1 = false; // Not all channels will call this callback for every scenario if (!plugin.flush(isAsync, function () { handled_1 = true; doCallback(); }, sendReason)) { if (!handled_1) { // If any channel doesn't return true and it didn't call the callback, then we should assume that the callback // will never be called, so use a timeout to allow the channel(s) some time to "finish" before triggering any // followup function (such as unloading) if (isAsync && cbTimer == null) { cbTimer = setTimeout(function () { cbTimer = null; doCallback(); }, cbTimeout); } else { doCallback(); } } } } }); }, function () { doneIterating = true; doCallback(); }); return true; }, _a._setQueue = function (queue) { channelQueue = queue; }, _a); return channelController; } export function createChannelQueues(channels, extensions, config, core) { var channelQueue = []; if (channels) { // Add and sort the configuration channel queues arrForEach(channels, function (queue) { return _addChannelQueue(channelQueue, queue, config, core); }); } if (extensions) { // Create a new channel queue for any extensions with a priority > the ChannelControllerPriority var extensionQueue_1 = []; arrForEach(extensions, function (plugin) { if (plugin.priority > ChannelControllerPriority) { extensionQueue_1.push(plugin); } }); _addChannelQueue(channelQueue, extensionQueue_1, config, core); } return channelQueue; } //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/ChannelController.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ export var strIKey = "iKey"; export var strExtensionConfig = "extensionConfig"; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/Constants.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ import { dumpObj, getDocument, getLocation, getNavigator, isIE } from "./EnvUtils"; import { arrForEach, dateNow, getExceptionName, isFunction, isNotNullOrUndefined, isNullOrUndefined, isString, isTruthy, isUndefined, objForEachKey, setValue, strContains, strEndsWith, strTrim } from "./HelperFuncs"; import { strEmpty } from "./InternalConstants"; import { _throwInternal } from "./DiagnosticLogger"; var strToGMTString = "toGMTString"; var strToUTCString = "toUTCString"; var strCookie = "cookie"; var strExpires = "expires"; var strEnabled = "enabled"; var strIsCookieUseDisabled = "isCookieUseDisabled"; var strDisableCookiesUsage = "disableCookiesUsage"; var strConfigCookieMgr = "_ckMgr"; var _supportsCookies = null; var _allowUaSameSite = null; var _parsedCookieValue = null; var _doc = getDocument(); var _cookieCache = {}; var _globalCookieConfig = {}; /** * @ignore * DO NOT USE or export from the module, this is exposed as public to support backward compatibility of previous static utility methods only. * If you want to manager cookies either use the ICookieMgr available from the core instance via getCookieMgr() or create * your own instance of the CookieMgr and use that. * Using this directly for enabling / disabling cookie handling will not only affect your usage but EVERY user of cookies. * Example, if you are using a shared component that is also using Application Insights you will affect their cookie handling. * @param logger - The DiagnosticLogger to use for reporting errors. */ export function _gblCookieMgr(config, logger) { // Stash the global instance against the BaseCookieMgr class var inst = createCookieMgr[strConfigCookieMgr] || _globalCookieConfig[strConfigCookieMgr]; if (!inst) { // Note: not using the getSetValue() helper as that would require always creating a temporary cookieMgr // that ultimately is never used inst = createCookieMgr[strConfigCookieMgr] = createCookieMgr(config, logger); _globalCookieConfig[strConfigCookieMgr] = inst; } return inst; } function _isMgrEnabled(cookieMgr) { if (cookieMgr) { return cookieMgr.isEnabled(); } return true; } function _createCookieMgrConfig(rootConfig) { var cookieMgrCfg = rootConfig.cookieCfg = rootConfig.cookieCfg || {}; // Sets the values from the root config if not already present on the cookieMgrCfg setValue(cookieMgrCfg, "domain", rootConfig.cookieDomain, isNotNullOrUndefined, isNullOrUndefined); setValue(cookieMgrCfg, "path", rootConfig.cookiePath || "/", null, isNullOrUndefined); if (isNullOrUndefined(cookieMgrCfg[strEnabled])) { // Set the enabled from the provided setting or the legacy root values var cookieEnabled = void 0; if (!isUndefined(rootConfig[strIsCookieUseDisabled])) { cookieEnabled = !rootConfig[strIsCookieUseDisabled]; } if (!isUndefined(rootConfig[strDisableCookiesUsage])) { cookieEnabled = !rootConfig[strDisableCookiesUsage]; } cookieMgrCfg[strEnabled] = cookieEnabled; } return cookieMgrCfg; } /** * Helper to return the ICookieMgr from the core (if not null/undefined) or a default implementation * associated with the configuration or a legacy default. * @param core * @param config * @returns */ export function safeGetCookieMgr(core, config) { var cookieMgr; if (core) { // Always returns an instance cookieMgr = core.getCookieMgr(); } else if (config) { var cookieCfg = config.cookieCfg; if (cookieCfg[strConfigCookieMgr]) { cookieMgr = cookieCfg[strConfigCookieMgr]; } else { cookieMgr = createCookieMgr(config); } } if (!cookieMgr) { // Get or initialize the default global (legacy) cookie manager if we couldn't find one cookieMgr = _gblCookieMgr(config, (core || {}).logger); } return cookieMgr; } export function createCookieMgr(rootConfig, logger) { var cookieMgrConfig = _createCookieMgrConfig(rootConfig || _globalCookieConfig); var _path = cookieMgrConfig.path || "/"; var _domain = cookieMgrConfig.domain; // Explicitly checking against false, so that setting to undefined will === true var _enabled = cookieMgrConfig[strEnabled] !== false; var cookieMgr = { isEnabled: function () { var enabled = _enabled && areCookiesSupported(logger); // Using an indirect lookup for any global cookie manager to support tree shaking for SDK's // that don't use the "applicationinsights-core" version of the default cookie function var gblManager = _globalCookieConfig[strConfigCookieMgr]; if (enabled && gblManager && cookieMgr !== gblManager) { // Make sure the GlobalCookie Manager instance (if not this instance) is also enabled. // As the global (deprecated) functions may have been called (for backward compatibility) enabled = _isMgrEnabled(gblManager); } return enabled; }, setEnabled: function (value) { // Explicitly checking against false, so that setting to undefined will === true _enabled = value !== false; }, set: function (name, value, maxAgeSec, domain, path) { var result = false; if (_isMgrEnabled(cookieMgr)) { var values = {}; var theValue = strTrim(value || strEmpty); var idx = theValue.indexOf(";"); if (idx !== -1) { theValue = strTrim(value.substring(0, idx)); values = _extractParts(value.substring(idx + 1)); } // Only update domain if not already present (isUndefined) and the value is truthy (not null, undefined or empty string) setValue(values, "domain", domain || _domain, isTruthy, isUndefined); if (!isNullOrUndefined(maxAgeSec)) { var _isIE = isIE(); if (isUndefined(values[strExpires])) { var nowMs = dateNow(); // Only add expires if not already present var expireMs = nowMs + (maxAgeSec * 1000); // Sanity check, if zero or -ve then ignore if (expireMs > 0) { var expiry = new Date(); expiry.setTime(expireMs); setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || strEmpty, isTruthy); } } if (!_isIE) { // Only replace if not already present setValue(values, "max-age", strEmpty + maxAgeSec, null, isUndefined); } } var location_1 = getLocation(); if (location_1 && location_1.protocol === "https:") { setValue(values, "secure", null, null, isUndefined); // Only set same site if not also secure if (_allowUaSameSite === null) { _allowUaSameSite = !uaDisallowsSameSiteNone((getNavigator() || {}).userAgent); } if (_allowUaSameSite) { setValue(values, "SameSite", "None", null, isUndefined); } } setValue(values, "path", path || _path, null, isUndefined); var setCookieFn = cookieMgrConfig.setCookie || _setCookieValue; setCookieFn(name, _formatCookieValue(theValue, values)); result = true; } return result; }, get: function (name) { var value = strEmpty; if (_isMgrEnabled(cookieMgr)) { value = (cookieMgrConfig.getCookie || _getCookieValue)(name); } return value; }, del: function (name, path) { var result = false; if (_isMgrEnabled(cookieMgr)) { // Only remove the cookie if the manager and cookie support has not been disabled result = cookieMgr.purge(name, path); } return result; }, purge: function (name, path) { var _a; var result = false; if (areCookiesSupported(logger)) { // Setting the expiration date in the past immediately removes the cookie var values = (_a = {}, _a["path"] = path ? path : "/", _a[strExpires] = "Thu, 01 Jan 1970 00:00:01 GMT", _a); if (!isIE()) { // Set max age to expire now values["max-age"] = "0"; } var delCookie = cookieMgrConfig.delCookie || _setCookieValue; delCookie(name, _formatCookieValue(strEmpty, values)); result = true; } return result; } }; // Associated this cookie manager with the config cookieMgr[strConfigCookieMgr] = cookieMgr; return cookieMgr; } /* * Helper method to tell if document.cookie object is supported by the runtime */ export function areCookiesSupported(logger) { if (_supportsCookies === null) { _supportsCookies = false; try { var doc = _doc || {}; _supportsCookies = doc[strCookie] !== undefined; } catch (e) { _throwInternal(logger, 2 /* WARNING */, 68 /* CannotAccessCookie */, "Cannot access document.cookie - " + getExceptionName(e), { exception: dumpObj(e) }); } } return _supportsCookies; } function _extractParts(theValue) { var values = {}; if (theValue && theValue.length) { var parts = strTrim(theValue).split(";"); arrForEach(parts, function (thePart) { thePart = strTrim(thePart || strEmpty); if (thePart) { var idx = thePart.indexOf("="); if (idx === -1) { values[thePart] = null; } else { values[strTrim(thePart.substring(0, idx))] = strTrim(thePart.substring(idx + 1)); } } }); } return values; } function _formatDate(theDate, func) { if (isFunction(theDate[func])) { return theDate[func](); } return null; } function _formatCookieValue(value, values) { var cookieValue = value || strEmpty; objForEachKey(values, function (name, theValue) { cookieValue += "; " + name + (!isNullOrUndefined(theValue) ? "=" + theValue : strEmpty); }); return cookieValue; } function _getCookieValue(name) { var cookieValue = strEmpty; if (_doc) { var theCookie = _doc[strCookie] || strEmpty; if (_parsedCookieValue !== theCookie) { _cookieCache = _extractParts(theCookie); _parsedCookieValue = theCookie; } cookieValue = strTrim(_cookieCache[name] || strEmpty); } return cookieValue; } function _setCookieValue(name, cookieValue) { if (_doc) { _doc[strCookie] = name + "=" + cookieValue; } } export function uaDisallowsSameSiteNone(userAgent) { if (!isString(userAgent)) { return false; } // Cover all iOS based browsers here. This includes: // - Safari on iOS 12 for iPhone, iPod Touch, iPad // - WkWebview on iOS 12 for iPhone, iPod Touch, iPad // - Chrome on iOS 12 for iPhone, iPod Touch, iPad // All of which are broken by SameSite=None, because they use the iOS networking stack if (strContains(userAgent, "CPU iPhone OS 12") || strContains(userAgent, "iPad; CPU OS 12")) { return true; } // Cover Mac OS X based browsers that use the Mac OS networking stack. This includes: // - Safari on Mac OS X // This does not include: // - Internal browser on Mac OS X // - Chrome on Mac OS X // - Chromium on Mac OS X // Because they do not use the Mac OS networking stack. if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strContains(userAgent, "Version/") && strContains(userAgent, "Safari")) { return true; } // Cover Mac OS X internal browsers that use the Mac OS networking stack. This includes: // - Internal browser on Mac OS X // This does not include: // - Safari on Mac OS X // - Chrome on Mac OS X // - Chromium on Mac OS X // Because they do not use the Mac OS networking stack. if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strEndsWith(userAgent, "AppleWebKit/605.1.15 (KHTML, like Gecko)")) { return true; } // Cover Chrome 50-69, because some versions are broken by SameSite=None, and none in this range require it. // Note: this covers some pre-Chromium Edge versions, but pre-Chromim Edge does not require SameSite=None, so this is fine. // Note: this regex applies to Windows, Mac OS X, and Linux, deliberately. if (strContains(userAgent, "Chrome/5") || strContains(userAgent, "Chrome/6")) { return true; } // Unreal Engine runs Chromium 59, but does not advertise as Chrome until 4.23. Treat versions of Unreal // that don't specify their Chrome version as lacking support for SameSite=None. if (strContains(userAgent, "UnrealEngine") && !strContains(userAgent, "Chrome")) { return true; } // UCBrowser < 12.13.2 ignores Set-Cookie headers with SameSite=None // NB: this rule isn't complete - you need regex to make a complete rule. // See: https://www.chromium.org/updates/same-site/incompatible-clients if (strContains(userAgent, "UCBrowser/12") || strContains(userAgent, "UCBrowser/11")) { return true; } return false; } //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/CookieMgr.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ "use strict"; import { objCreateFn, strShimUndefined } from "@microsoft/applicationinsights-shims"; import { _gblCookieMgr } from "./CookieMgr"; import { getPerformance, isIE } from "./EnvUtils"; import { arrForEach, arrIndexOf, arrMap, arrReduce, dateNow, hasOwnProperty, isArray, isBoolean, isDate, isError, isFunction, isNullOrUndefined, isNumber, isObject, isString, isTypeof, isUndefined, objDefineAccessors, objKeys, strTrim, toISOString } from "./HelperFuncs"; import { addEventHandler, attachEvent, detachEvent } from "./EventHelpers"; import { randomValue, random32, mwcRandomSeed, mwcRandom32, newId } from "./RandomHelper"; import { strEmpty } from "./InternalConstants"; var _cookieMgrs = null; var _canUseCookies; // legacy supported config // Added to help with minfication export var Undefined = strShimUndefined; export function newGuid() { function randomHexDigit() { return randomValue(15); // Get a random value from 0..15 } return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(GuidRegex, function (c) { var r = (randomHexDigit() | 0), v = (c === "x" ? r : r & 0x3 | 0x8); return v.toString(16); }); } /** * Return the current value of the Performance Api now() function (if available) and fallback to dateNow() if it is unavailable (IE9 or less) * https://caniuse.com/#search=performance.now */ export function perfNow() { var perf = getPerformance(); if (perf && perf.now) { return perf.now(); } return dateNow(); } /** * The strEndsWith() method determines whether a string ends with the characters of a specified string, returning true or false as appropriate. * @param value - The value to check whether it ends with the search value. * @param search - The characters to be searched for at the end of the value. * @returns true if the given search value is found at the end of the string, otherwise false. */ export function strEndsWith(value, search) { if (value && search) { var len = value.length; var start = len - search.length; return value.substring(start >= 0 ? start : 0, len) === search; } return false; } /** * generate W3C trace id */ export function generateW3CId() { var hexValues = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]; // rfc4122 version 4 UUID without dashes and with lowercase letters var oct = strEmpty, tmp; for (var a = 0; a < 4; a++) { tmp = random32(); oct += hexValues[tmp & 0xF] + hexValues[tmp >> 4 & 0xF] + hexValues[tmp >> 8 & 0xF] + hexValues[tmp >> 12 & 0xF] + hexValues[tmp >> 16 & 0xF] + hexValues[tmp >> 20 & 0xF] + hexValues[tmp >> 24 & 0xF] + hexValues[tmp >> 28 & 0xF]; } // "Set the two most significant bits (bits 6 and 7) of the clock_seq_hi_and_reserved to zero and one, respectively" var clockSequenceHi = hexValues[8 + (random32() & 0x03) | 0]; return oct.substr(0, 8) + oct.substr(9, 4) + "4" + oct.substr(13, 3) + clockSequenceHi + oct.substr(16, 3) + oct.substr(19, 12); } /** * Provides a collection of utility functions, included for backward compatibility with previous releases. * @deprecated Marking this instance as deprecated in favor of direct usage of the helper functions * as direct usage provides better tree-shaking and minification by avoiding the inclusion of the unused items * in your resulting code. */ export var CoreUtils = { _canUseCookies: undefined, isTypeof: isTypeof, isUndefined: isUndefined, isNullOrUndefined: isNullOrUndefined, hasOwnProperty: hasOwnProperty, isFunction: isFunction, isObject: isObject, isDate: isDate, isArray: isArray, isError: isError, isString: isString, isNumber: isNumber, isBoolean: isBoolean, toISOString: toISOString, arrForEach: arrForEach, arrIndexOf: arrIndexOf, arrMap: arrMap, arrReduce: arrReduce, strTrim: strTrim, objCreate: objCreateFn, objKeys: objKeys, objDefineAccessors: objDefineAccessors, addEventHandler: addEventHandler, dateNow: dateNow, isIE: isIE, disableCookies: disableCookies, newGuid: newGuid, perfNow: perfNow, newId: newId, randomValue: randomValue, random32: random32, mwcRandomSeed: mwcRandomSeed, mwcRandom32: mwcRandom32, generateW3CId: generateW3CId }; var GuidRegex = /[xy]/g; export var EventHelper = { Attach: attachEvent, AttachEvent: attachEvent, Detach: detachEvent, DetachEvent: detachEvent }; /** * Helper to support backward compatibility for users that use the legacy cookie handling functions and the use the internal * CoreUtils._canUseCookies global flag to enable/disable cookies usage. * Note: This has the following deliberate side-effects * - Creates the global (legacy) cookie manager if it does not already exist * - Attempts to add "listeners" to the CoreUtils._canUseCookies property to support the legacy usage * @param config * @param logger * @returns */ export function _legacyCookieMgr(config, logger) { var cookieMgr = _gblCookieMgr(config, logger); var legacyCanUseCookies = CoreUtils._canUseCookies; if (_cookieMgrs === null) { _cookieMgrs = []; _canUseCookies = legacyCanUseCookies; // Dynamically create get/set property accessors for backward compatibility for enabling / disabling cookies // this WILL NOT work for ES3 browsers (< IE8) objDefineAccessors(CoreUtils, "_canUseCookies", function () { return _canUseCookies; }, function (value) { _canUseCookies = value; arrForEach(_cookieMgrs, function (mgr) { mgr.setEnabled(value); }); }); } if (arrIndexOf(_cookieMgrs, cookieMgr) === -1) { _cookieMgrs.push(cookieMgr); } if (isBoolean(legacyCanUseCookies)) { cookieMgr.setEnabled(legacyCanUseCookies); } if (isBoolean(_canUseCookies)) { cookieMgr.setEnabled(_canUseCookies); } return cookieMgr; } /** * @deprecated - Use the core.getCookieMgr().disable() * Force the SDK not to store and read any data from cookies. */ export function disableCookies() { _legacyCookieMgr().setEnabled(false); } /** * @deprecated - Use the core.getCookieMgr().isEnabled() * Helper method to tell if document.cookie object is available and whether it can be used. */ export function canUseCookies(logger) { return _legacyCookieMgr(null, logger).isEnabled(); } /** * @deprecated - Use the core.getCookieMgr().get() * helper method to access userId and sessionId cookie */ export function getCookie(logger, name) { return _legacyCookieMgr(null, logger).get(name); } /** * @deprecated - Use the core.getCookieMgr().set() * helper method to set userId and sessionId cookie */ export function setCookie(logger, name, value, domain) { _legacyCookieMgr(null, logger).set(name, value, null, domain); } /** * @deprecated - Use the core.getCookieMgr().del() * Deletes a cookie by setting it's expiration time in the past. * @param name - The name of the cookie to delete. */ export function deleteCookie(logger, name) { return _legacyCookieMgr(null, logger).del(name); } //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/CoreUtils.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ import { ObjDefineProperty } from "@microsoft/applicationinsights-shims"; import { normalizeJsName } from "./HelperFuncs"; import { newId } from "./RandomHelper"; var _objDefineProperty = ObjDefineProperty; var version = "2.8.3"; var instanceName = "." + newId(6); var _dataUid = 0; function _createAccessor(target, prop, value) { if (_objDefineProperty) { try { _objDefineProperty(target, prop, { value: value, enumerable: false, configurable: true }); return true; } catch (e) { // IE8 Defines a defineProperty on Object but it's only supported for DOM elements so it will throw // We will just ignore this here. } } return false; } // Accepts only: // - Node // - Node.ELEMENT_NODE // - Node.DOCUMENT_NODE // - Object // - Any function _canAcceptData(target) { return target.nodeType === 1 || target.nodeType === 9 || !(+target.nodeType); } function _getCache(data, target) { var theCache = target[data.id]; if (!theCache) { theCache = {}; try { if (_canAcceptData(target)) { if (!_createAccessor(target, data.id, theCache)) { // Environment doesn't support accessor, so just use direct assignment target[data.id] = theCache; } } } catch (e) { // Not all environments allow extending all objects, so just ignore the cache in those cases } } return theCache; } export function createUniqueNamespace(name, includeVersion) { if (includeVersion === void 0) { includeVersion = false; } return normalizeJsName(name + (_dataUid++) + (includeVersion ? "." + version : "") + instanceName); } export function createElmNodeData(name) { var data = { id: createUniqueNamespace("_aiData-" + (name || "") + "." + version), accept: function (target) { return _canAcceptData(target); }, get: function (target, name, defValue, addDefault) { var theCache = target[data.id]; if (!theCache) { if (addDefault) { // Side effect is adds the cache theCache = _getCache(data, target); theCache[normalizeJsName(name)] = defValue; } return defValue; } return theCache[normalizeJsName(name)]; }, kill: function (target, name) { if (target && target[name]) { try { delete target[name]; } catch (e) { // Just cleaning up, so if this fails -- ignore } } } }; return data; } //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/DataCacheHelper.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ import { getGlobalInst } from "./EnvUtils"; var listenerFuncs = ["eventsSent", "eventsDiscarded", "eventsSendRequest", "perfEvent"]; var _aiNamespace = null; var _debugListener; function _listenerProxyFunc(name, config) { return function () { var args = arguments; var dbgExt = getDebugExt(config); if (dbgExt) { var listener = dbgExt.listener; if (listener && listener[name]) { listener[name].apply(listener, args); } } }; } function _getExtensionNamespace() { // Cache the lookup of the global namespace object var target = getGlobalInst("Microsoft"); if (target) { _aiNamespace = target["ApplicationInsights"]; } return _aiNamespace; } export function getDebugExt(config) { var ns = _aiNamespace; if (!ns && config.disableDbgExt !== true) { ns = _aiNamespace || _getExtensionNamespace(); } return ns ? ns["ChromeDbgExt"] : null; } export function getDebugListener(config) { if (!_debugListener) { _debugListener = {}; for (var lp = 0; lp < listenerFuncs.length; lp++) { _debugListener[listenerFuncs[lp]] = _listenerProxyFunc(listenerFuncs[lp], config); } } return _debugListener; } //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/DbgExtensionUtils.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ "use strict"; import { hasJSON, getJSON, getConsole, dumpObj } from "./EnvUtils"; import dynamicProto from "@microsoft/dynamicproto-js"; import { isFunction, isNullOrUndefined, isUndefined } from "./HelperFuncs"; import { getDebugExt } from "./DbgExtensionUtils"; import { strEmpty } from "./InternalConstants"; /** * For user non actionable traces use AI Internal prefix. */ var AiNonUserActionablePrefix = "AI (Internal): "; /** * Prefix of the traces in portal. */ var AiUserActionablePrefix = "AI: "; /** * Session storage key for the prefix for the key indicating message type already logged */ var AIInternalMessagePrefix = "AITR_"; var strErrorToConsole = "errorToConsole"; var strWarnToConsole = "warnToConsole"; function _sanitizeDiagnosticText(text) { if (text) { return "\"" + text.replace(/\"/g, strEmpty) + "\""; } return strEmpty; } function _logToConsole(func, message) { var theConsole = getConsole(); if (!!theConsole) { var logFunc = "log"; if (theConsole[func]) { logFunc = func; } if (isFunction(theConsole[logFunc])) { theConsole[logFunc](message); } } } var _InternalLogMessage = /** @class */ (function () { function _InternalLogMessage(msgId, msg, isUserAct, properties) { if (isUserAct === void 0) { isUserAct = false; } var _self = this; _self.messageId = msgId; _self.message = (isUserAct ? AiUserActionablePrefix : AiNonUserActionablePrefix) + msgId; var strProps = strEmpty; if (hasJSON()) { strProps = getJSON().stringify(properties); } var diagnosticText = (msg ? " message:" + _sanitizeDiagnosticText(msg) : strEmpty) + (properties ? " props:" + _sanitizeDiagnosticText(strProps) : strEmpty); _self.message += diagnosticText; } _InternalLogMessage.dataType = "MessageData"; return _InternalLogMessage; }()); export { _InternalLogMessage }; export function safeGetLogger(core, config) { return (core || {}).logger || new DiagnosticLogger(config); } var DiagnosticLogger = /** @class */ (function () { function DiagnosticLogger(config) { this.identifier = "DiagnosticLogger"; /** * The internal logging queue */ this.queue = []; /** * Count of internal messages sent */ var _messageCount = 0; /** * Holds information about what message types were already logged to console or sent to server. */ var _messageLogged = {}; dynamicProto(DiagnosticLogger, this, function (_self) { if (isNullOrUndefined(config)) { config = {}; } _self.consoleLoggingLevel = function () { return _getConfigValue("loggingLevelConsole", 0); }; _self.telemetryLoggingLevel = function () { return _getConfigValue("loggingLevelTelemetry", 1); }; _self.maxInternalMessageLimit = function () { return _getConfigValue("maxMessageLimit", 25); }; _self.enableDebugExceptions = function () { return _getConfigValue("enableDebugExceptions", false); }; /** * This method will throw exceptions in debug mode or attempt to log the error as a console warning. * @param severity {LoggingSeverity} - The severity of the log message * @param message {_InternalLogMessage} - The log message. */ _self.throwInternal = function (severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } var message = new _InternalLogMessage(msgId, msg, isUserAct, properties); if (_self.enableDebugExceptions()) { throw dumpObj(message); } else { // Get the logging function and fallback to warnToConsole of for some reason errorToConsole doesn't exist var logFunc = severity === 1 /* CRITICAL */ ? strErrorToConsole : strWarnToConsole; if (!isUndefined(message.message)) { var logLevel = _self.consoleLoggingLevel(); if (isUserAct) { // check if this message type was already logged to console for this page view and if so, don't log it again var messageKey = +message.messageId; if (!_messageLogged[messageKey] && logLevel >= severity) { _self[logFunc](message.message); _messageLogged[messageKey] = true; } } else { // Only log traces if the console Logging Level is >= the throwInternal severity level if (logLevel >= severity) { _self[logFunc](message.message); } } _self.logInternalMessage(severity, message); } else { _debugExtMsg("throw" + (severity === 1 /* CRITICAL */ ? "Critical" : "Warning"), message); } } }; /** * This will write a warning to the console if possible * @param message {string} - The warning message */ _self.warnToConsole = function (message) { _logToConsole("warn", message); _debugExtMsg("warning", message); }; /** * This will write an error to the console if possible * @param message {string} - The error message */ _self.errorToConsole = function (message) { _logToConsole("error", message); _debugExtMsg("error", message); }; /** * Resets the internal message count */ _self.resetInternalMessageCount = function () { _messageCount = 0; _messageLogged = {}; }; /** * Logs a message to the internal queue. * @param severity {LoggingSeverity} - The severity of the log message * @param message {_InternalLogMessage} - The message to log. */ _self.logInternalMessage = function (severity, message) { if (_areInternalMessagesThrottled()) { return; } // check if this message type was already logged for this session and if so, don't log it again var logMessage = true; var messageKey = AIInternalMessagePrefix + message.messageId; // if the session storage is not available, limit to only one message type per page view if (_messageLogged[messageKey]) { logMessage = false; } else { _messageLogged[messageKey] = true; } if (logMessage) { // Push the event in the internal queue if (severity <= _self.telemetryLoggingLevel()) { _self.queue.push(message); _messageCount++; _debugExtMsg((severity === 1 /* CRITICAL */ ? "error" : "warn"), message); } // When throttle limit reached, send a special event if (_messageCount === _self.maxInternalMessageLimit()) { var throttleLimitMessage = "Internal events throttle limit per PageView reached for this app."; var throttleMessage = new _InternalLogMessage(23 /* MessageLimitPerPVExceeded */, throttleLimitMessage, false); _self.queue.push(throttleMessage); if (severity === 1 /* CRITICAL */) { _self.errorToConsole(throttleLimitMessage); } else { _self.warnToConsole(throttleLimitMessage); } } } }; function _getConfigValue(name, defValue) { var value = config[name]; if (!isNullOrUndefined(value)) { return value; } return defValue; } function _areInternalMessagesThrottled() { return _messageCount >= _self.maxInternalMessageLimit(); } function _debugExtMsg(name, data) { var dbgExt = getDebugExt(config); if (dbgExt && dbgExt.diagLog) { dbgExt.diagLog(name, data); } } }); } // Removed Stub for DiagnosticLogger.prototype.enableDebugExceptions. // Removed Stub for DiagnosticLogger.prototype.consoleLoggingLevel. // Removed Stub for DiagnosticLogger.prototype.telemetryLoggingLevel. // Removed Stub for DiagnosticLogger.prototype.maxInternalMessageLimit. // Removed Stub for DiagnosticLogger.prototype.throwInternal. // Removed Stub for DiagnosticLogger.prototype.warnToConsole. // Removed Stub for DiagnosticLogger.prototype.errorToConsole. // Removed Stub for DiagnosticLogger.prototype.resetInternalMessageCount. // Removed Stub for DiagnosticLogger.prototype.logInternalMessage. return DiagnosticLogger; }()); export { DiagnosticLogger }; function _getLogger(logger) { return (logger || new DiagnosticLogger()); } /** * This is a helper method which will call throwInternal on the passed logger, will throw exceptions in * debug mode or attempt to log the error as a console warning. This helper is provided mostly to better * support minification as logger.throwInternal() will not compress the publish "throwInternal" used throughout * the code. * @param logger - The Diagnostic Logger instance to use. * @param severity {LoggingSeverity} - The severity of the log message * @param message {_InternalLogMessage} - The log message. */ export function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) { if (isUserAct === void 0) { isUserAct = false; } (logger || new DiagnosticLogger()).throwInternal(severity, msgId, msg, properties, isUserAct); } /** * This is a helper method which will call warnToConsole on the passed logger with the provided message. * @param logger - The Diagnostic Logger instance to use. * @param message {_InternalLogMessage} - The log message. */ export function _warnToConsole(logger, message) { _getLogger(logger).warnToConsole(message); } /** * Logs a message to the internal queue. * @param logger - The Diagnostic Logger instance to use. * @param severity {LoggingSeverity} - The severity of the log message * @param message {_InternalLogMessage} - The message to log. */ export function _logInternalMessage(logger, severity, message) { _getLogger(logger).logInternalMessage(severity, message); } //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/DiagnosticLogger.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ "use strict"; import { getGlobal, strShimUndefined, strShimObject, strShimPrototype } from "@microsoft/applicationinsights-shims"; import { strEmpty } from "./InternalConstants"; import { isString, isUndefined, strContains } from "./HelperFuncs"; /** * This file exists to hold environment utilities that are required to check and * validate the current operating environment. Unless otherwise required, please * only use defined methods (functions) in this class so that users of these * functions/properties only need to include those that are used within their own modules. */ var strWindow = "window"; var strDocument = "document"; var strDocumentMode = "documentMode"; var strNavigator = "navigator"; var strHistory = "history"; var strLocation = "location"; var strConsole = "console"; var strPerformance = "performance"; var strJSON = "JSON"; var strCrypto = "crypto"; var strMsCrypto = "msCrypto"; var strReactNative = "ReactNative"; var strMsie = "msie"; var strTrident = "trident/"; var strXMLHttpRequest = "XMLHttpRequest"; var _isTrident = null; var _navUserAgentCheck = null; var _enableMocks = false; var _useXDomainRequest = null; var _beaconsSupported = null; function _hasProperty(theClass, property) { var supported = false; if (theClass) { try { supported = property in theClass; if (!supported) { var proto = theClass[strShimPrototype]; if (proto) { supported = property in proto; } } } catch (e) { // Do Nothing } if (!supported) { try { var tmp = new theClass(); supported = !isUndefined(tmp[property]); } catch (e) { // Do Nothing } } } return supported; } /** * Enable the lookup of test mock objects if requested * @param enabled */ export function setEnableEnvMocks(enabled) { _enableMocks = enabled; } /** * Return the named global object if available, will return null if the object is not available. * @param name The globally named object */ export function getGlobalInst(name) { var gbl = getGlobal(); if (gbl && gbl[name]) { return gbl[name]; } // Test workaround, for environments where .window (when global == window) doesn't return the base window if (name === strWindow && hasWindow()) { // tslint:disable-next-line: no-angle-bracket-type-assertion return window; } return null; } /** * Checks if window object is available, this is required as we support the API running without a * window /document (eg. Node server, electron webworkers) and if we attempt to assign a window * object to a local variable or pass as an argument an "Uncaught ReferenceError: window is not defined" * exception will be thrown. * Defined as a function to support lazy / late binding environments. */ export function hasWindow() { return Boolean(typeof window === strShimObject && window); } /** * Returns the global window object if it is present otherwise null. * This helper is used to access the window object without causing an exception * "Uncaught ReferenceError: window is not defined" */ export function getWindow() { if (hasWindow()) { return window; } // Return the global instance or null return getGlobalInst(strWindow); } /** * Checks if document object is available, this is required as we support the API running without a * window /document (eg. Node server, electron webworkers) and if we attempt to assign a document * object to a local variable or pass as an argument an "Uncaught ReferenceError: document is not defined" * exception will be thrown. * Defined as a function to support lazy / late binding environments. */ export function hasDocument() { return Boolean(typeof document === strShimObject && document); } /** * Returns the global document object if it is present otherwise null. * This helper is used to access the document object without causing an exception * "Uncaught ReferenceError: document is not defined" */ export function getDocument() { if (hasDocument()) { return document; } return getGlobalInst(strDocument); } /** * Checks if navigator object is available, this is required as we support the API running without a * window /document (eg. Node server, electron webworkers) and if we attempt to assign a navigator * object to a local variable or pass as an argument an "Uncaught ReferenceError: navigator is not defined" * exception will be thrown. * Defined as a function to support lazy / late binding environments. */ export function hasNavigator() { return Boolean(typeof navigator === strShimObject && navigator); } /** * Returns the global navigator object if it is present otherwise null. * This helper is used to access the navigator object without causing an exception * "Uncaught ReferenceError: navigator is not defined" */ export function getNavigator() { if (hasNavigator()) { return navigator; } return getGlobalInst(strNavigator); } /** * Checks if history object is available, this is required as we support the API running without a * window /document (eg. Node server, electron webworkers) and if we attempt to assign a history * object to a local variable or pass as an argument an "Uncaught ReferenceError: history is not defined" * exception will be thrown. * Defined as a function to support lazy / late binding environments. */ export function hasHistory() { return Boolean(typeof history === strShimObject && history); } /** * Returns the global history object if it is present otherwise null. * This helper is used to access the history object without causing an exception * "Uncaught ReferenceError: history is not defined" */ export function getHistory() { if (hasHistory()) { return history; } return getGlobalInst(strHistory); } /** * Returns the global location object if it is present otherwise null. * This helper is used to access the location object without causing an exception * "Uncaught ReferenceError: location is not defined" */ export function getLocation(checkForMock) { if (checkForMock && _enableMocks) { var mockLocation = getGlobalInst("__mockLocation"); if (mockLocation) { return mockLocation; } } if (typeof location === strShimObject && location) { return location; } return getGlobalInst(strLocation); } /** * Returns the global console object */ export function getConsole() { if (typeof console !== strShimUndefined) { return console; } return getGlobalInst(strConsole); } /** * Returns the performance object if it is present otherwise null. * This helper is used to access the performance object from the current * global instance which could be window or globalThis for a web worker */ export function getPerformance() { return getGlobalInst(strPerformance); } /** * Checks if JSON object is available, this is required as we support the API running without a * window /document (eg. Node server, electron webworkers) and if we attempt to assign a history * object to a local variable or pass as an argument an "Uncaught ReferenceError: JSON is not defined" * exception will be thrown. * Defined as a function to support lazy / late binding environments. */ export function hasJSON() { return Boolean((typeof JSON === strShimObject && JSON) || getGlobalInst(strJSON) !== null); } /** * Returns the global JSON object if it is present otherwise null. * This helper is used to access the JSON object without causing an exception * "Uncaught ReferenceError: JSON is not defined" */ export function getJSON() { if (hasJSON()) { return JSON || getGlobalInst(strJSON); } return null; } /** * Returns the crypto object if it is present otherwise null. * This helper is used to access the crypto object from the current * global instance which could be window or globalThis for a web worker */ export function getCrypto() { return getGlobalInst(strCrypto); } /** * Returns the crypto object if it is present otherwise null. * This helper is used to access the crypto object from the current * global instance which could be window or globalThis for a web worker */ export function getMsCrypto() { return getGlobalInst(strMsCrypto); } /** * Returns whether the environment is reporting that we are running in a React Native Environment */ export function isReactNative() { // If running in React Native, navigator.product will be populated var nav = getNavigator(); if (nav && nav.product) { return nav.product === strReactNative; } return false; } /** * Identifies whether the current environment appears to be IE */ export function isIE() { var nav = getNavigator(); if (nav && (nav.userAgent !== _navUserAgentCheck || _isTrident === null)) { // Added to support test mocking of the user agent _navUserAgentCheck = nav.userAgent; var userAgent = (_navUserAgentCheck || strEmpty).toLowerCase(); _isTrident = (strContains(userAgent, strMsie) || strContains(userAgent, strTrident)); } return _isTrident; } /** * Gets IE version returning the document emulation mode if we are running on IE, or null otherwise */ export function getIEVersion(userAgentStr) { if (userAgentStr === void 0) { userAgentStr = null; } if (!userAgentStr) { var navigator_1 = getNavigator() || {}; userAgentStr = navigator_1 ? (navigator_1.userAgent || strEmpty).toLowerCase() : strEmpty; } var ua = (userAgentStr || strEmpty).toLowerCase(); // Also check for documentMode in case X-UA-Compatible meta tag was included in HTML. if (strContains(ua, strMsie)) { var doc = getDocument() || {}; return Math.max(parseInt(ua.split(strMsie)[1]), (doc[strDocumentMode] || 0)); } else if (strContains(ua, strTrident)) { var tridentVer = parseInt(ua.split(strTrident)[1]); if (tridentVer) { return tridentVer + 4; } } return null; } /** * Returns string representation of an object suitable for diagnostics logging. */ export function dumpObj(object) { var objectTypeDump = Object[strShimPrototype].toString.call(object); var propertyValueDump = strEmpty; if (objectTypeDump === "[object Error]") { propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'"; } else if (hasJSON()) { propertyValueDump = getJSON().stringify(object); } return objectTypeDump + propertyValueDump; } export function isSafari(userAgentStr) { if (!userAgentStr || !isString(userAgentStr)) { var navigator_2 = getNavigator() || {}; userAgentStr = navigator_2 ? (navigator_2.userAgent || strEmpty).toLowerCase() : strEmpty; } var ua = (userAgentStr || strEmpty).toLowerCase(); return (ua.indexOf("safari") >= 0); } /** * Checks if HTML5 Beacons are supported in the current environment. * @returns True if supported, false otherwise. */ export function isBeaconsSupported() { if (_beaconsSupported === null) { _beaconsSupported = hasNavigator() && Boolean(getNavigator().sendBeacon); } return _beaconsSupported; } /** * Checks if the Fetch API is supported in the current environment. * @param withKeepAlive - [Optional] If True, check if fetch is available and it supports the keepalive feature, otherwise only check if fetch is supported * @returns True if supported, otherwise false */ export function isFetchSupported(withKeepAlive) { var isSupported = false; try { isSupported = !!getGlobalInst("fetch"); var request = getGlobalInst("Request"); if (isSupported && withKeepAlive && request) { isSupported = _hasProperty(request, "keepalive"); } } catch (e) { // Just Swallow any failure during availability checks } return isSupported; } export function useXDomainRequest() { if (_useXDomainRequest === null) { _useXDomainRequest = (typeof XDomainRequest !== strShimUndefined); if (_useXDomainRequest && isXhrSupported()) { _useXDomainRequest = _useXDomainRequest && !_hasProperty(getGlobalInst(strXMLHttpRequest), "withCredentials"); } } return _useXDomainRequest; } /** * Checks if XMLHttpRequest is supported * @returns True if supported, otherwise false */ export function isXhrSupported() { var isSupported = false; try { var xmlHttpRequest = getGlobalInst(strXMLHttpRequest); isSupported = !!xmlHttpRequest; } catch (e) { // Just Swallow any failure during availability checks } return isSupported; } //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/EnvUtils.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ import { createElmNodeData, createUniqueNamespace } from "./DataCacheHelper"; import { getDocument, getWindow } from "./EnvUtils"; import { arrForEach, arrIndexOf, isArray, objForEachKey, objKeys } from "./HelperFuncs"; // Added to help with minfication var strOnPrefix = "on"; var strAttachEvent = "attachEvent"; var strAddEventHelper = "addEventListener"; var strDetachEvent = "detachEvent"; var strRemoveEventListener = "removeEventListener"; var strEvents = "events"; var strVisibilityChangeEvt = "visibilitychange"; var strPageHide = "pagehide"; var strPageShow = "pageshow"; var strUnload = "unload"; var strBeforeUnload = "beforeunload"; var strPageHideNamespace = createUniqueNamespace("aiEvtPageHide"); var strPageShowNamespace = createUniqueNamespace("aiEvtPageShow"); var rRemoveEmptyNs = /\.[\.]+/g; var rRemoveTrailingEmptyNs = /[\.]+$/; var _guid = 1; var elmNodeData = createElmNodeData("events"); var eventNamespace = /^([^.]*)(?:\.(.+)|)/; function _normalizeNamespace(name) { if (name && name.replace) { return name.replace(/^\s*\.*|\.*\s*$/g, ""); } return name; } function _getEvtNamespace(eventName, evtNamespace) { if (evtNamespace) { var theNamespace_1 = ""; if (isArray(evtNamespace)) { theNamespace_1 = ""; arrForEach(evtNamespace, function (name) { name = _normalizeNamespace(name); if (name) { if (name[0] !== ".") { name = "." + name; } theNamespace_1 += name; } }); } else { theNamespace_1 = _normalizeNamespace(evtNamespace); } if (theNamespace_1) { if (theNamespace_1[0] !== ".") { theNamespace_1 = "." + theNamespace_1; } // We may only have the namespace and not an eventName eventName = (eventName || "") + theNamespace_1; } } var parsedEvent = (eventNamespace.exec(eventName || "") || []); return { type: parsedEvent[1], ns: ((parsedEvent[2] || "").replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, "").split(".").sort()).join(".") }; } /** * Get all of the registered events on the target object, this is primarily used for testing cleanup but may also be used by * applications to remove their own events * @param target - The EventTarget that has registered events * @param eventName - [Optional] The name of the event to return the registered handlers and full name (with namespaces) * @param evtNamespace - [Optional] Additional namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace, * if the eventName also includes a namespace the namespace(s) are merged into a single namespace */ export function __getRegisteredEvents(target, eventName, evtNamespace) { var theEvents = []; var eventCache = elmNodeData.get(target, strEvents, {}, false); var evtName = _getEvtNamespace(eventName, evtNamespace); objForEachKey(eventCache, function (evtType, registeredEvents) { arrForEach(registeredEvents, function (value) { if (!evtName.type || evtName.type === value.evtName.type) { if (!evtName.ns || evtName.ns === evtName.ns) { theEvents.push({ name: value.evtName.type + (value.evtName.ns ? "." + value.evtName.ns : ""), handler: value.handler }); } } }); }); return theEvents; } // Exported for internal unit testing only function _getRegisteredEvents(target, evtName, addDefault) { if (addDefault === void 0) { addDefault = true; } var aiEvts = elmNodeData.get(target, strEvents, {}, addDefault); var registeredEvents = aiEvts[evtName]; if (!registeredEvents) { registeredEvents = aiEvts[evtName] = []; } return registeredEvents; } function _doDetach(obj, evtName, handlerRef, useCapture) { if (obj && evtName && evtName.type) { if (obj[strRemoveEventListener]) { obj[strRemoveEventListener](evtName.type, handlerRef, useCapture); } else if (obj[strDetachEvent]) { obj[strDetachEvent](strOnPrefix + evtName.type, handlerRef); } } } function _doAttach(obj, evtName, handlerRef, useCapture) { var result = false; if (obj && evtName && evtName.type && handlerRef) { if (obj[strAddEventHelper]) { // all browsers except IE before version 9 obj[strAddEventHelper](evtName.type, handlerRef, useCapture); result = true; } else if (obj[strAttachEvent]) { // IE before version 9 obj[strAttachEvent](strOnPrefix + evtName.type, handlerRef); result = true; } } return result; } function _doUnregister(target, events, evtName, unRegFn) { var idx = events.length; while (idx--) { var theEvent = events[idx]; if (theEvent) { if (!evtName.ns || evtName.ns === theEvent.evtName.ns) { if (!unRegFn || unRegFn(theEvent)) { _doDetach(target, theEvent.evtName, theEvent.handler, theEvent.capture); // Remove the registered event events.splice(idx, 1); } } } } } function _unregisterEvents(target, evtName, unRegFn) { if (evtName.type) { _doUnregister(target, _getRegisteredEvents(target, evtName.type), evtName, unRegFn); } else { var eventCache = elmNodeData.get(target, strEvents, {}); objForEachKey(eventCache, function (evtType, events) { _doUnregister(target, events, evtName, unRegFn); }); // Cleanup if (objKeys(eventCache).length === 0) { elmNodeData.kill(target, strEvents); } } } export function mergeEvtNamespace(theNamespace, namespaces) { var newNamespaces; if (namespaces) { if (isArray(namespaces)) { newNamespaces = [theNamespace].concat(namespaces); } else { newNamespaces = [theNamespace, namespaces]; } // resort the namespaces so they are always in order newNamespaces = (_getEvtNamespace("xx", newNamespaces).ns).split("."); } else { newNamespaces = theNamespace; } return newNamespaces; } /** * Binds the specified function to an event, so that the function gets called whenever the event fires on the object * @param obj Object to add the event too. * @param eventName String that specifies any of the standard DHTML Events without "on" prefix, if may also include an optional (dot "." prefixed) * namespaces "click" "click.mynamespace" in addition to specific namespaces. * @param handlerRef Pointer that specifies the function to call when event fires * @param evtNamespace - [Optional] Additional namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace, * if the eventName also includes a namespace the namespace(s) are merged into a single namespace * @param useCapture [Optional] Defaults to false * @returns True if the function was bound successfully to the event, otherwise false */ export function eventOn(target, eventName, handlerRef, evtNamespace, useCapture) { if (useCapture === void 0) { useCapture = false; } var result = false; if (target) { try { var evtName = _getEvtNamespace(eventName, evtNamespace); result = _doAttach(target, evtName, handlerRef, useCapture); if (result && elmNodeData.accept(target)) { var registeredEvent = { guid: _guid++, evtName: evtName, handler: handlerRef, capture: useCapture }; _getRegisteredEvents(target, evtName.type).push(registeredEvent); } } catch (e) { // Just Ignore any error so that we don't break any execution path } } return result; } /** * Removes an event handler for the specified event * @param Object to remove the event from * @param eventName {string} - The name of the event, with optional namespaces or just the namespaces, * such as "click", "click.mynamespace" or ".mynamespace" * @param handlerRef {any} - The callback function that needs to be removed from the given event, when using a * namespace (with or without a qualifying event) this may be null to remove all previously attached event handlers * otherwise this will only remove events with this specific handler. * @param evtNamespace - [Optional] Additional namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace, * if the eventName also includes a namespace the namespace(s) are merged into a single namespace * @param useCapture [Optional] Defaults to false */ export function eventOff(target, eventName, handlerRef, evtNamespace, useCapture) { if (useCapture === void 0) { useCapture = false; } if (target) { try { var evtName_1 = _getEvtNamespace(eventName, evtNamespace); var found_1 = false; _unregisterEvents(target, evtName_1, function (regEvent) { if ((evtName_1.ns && !handlerRef) || regEvent.handler === handlerRef) { found_1 = true; return true; } return false; }); if (!found_1) { // fallback to try and remove as requested _doDetach(target, evtName_1, handlerRef, useCapture); } } catch (e) { // Just Ignore any error so that we don't break any execution path } } } /** * Binds the specified function to an event, so that the function gets called whenever the event fires on the object * @param obj Object to add the event too. * @param eventNameWithoutOn String that specifies any of the standard DHTML Events without "on" prefix and optional (dot "." prefixed) namespaces "click" "click.mynamespace". * @param handlerRef Pointer that specifies the function to call when event fires * @param useCapture [Optional] Defaults to false * @returns True if the function was bound successfully to the event, otherwise false */ export function attachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) { if (useCapture === void 0) { useCapture = false; } return eventOn(obj, eventNameWithoutOn, handlerRef, null, useCapture); } /** * Removes an event handler for the specified event * @param Object to remove the event from * @param eventNameWithoutOn {string} - The name of the event, with optional namespaces or just the namespaces, * such as "click", "click.mynamespace" or ".mynamespace" * @param handlerRef {any} - The callback function that needs to be removed from the given event, when using a * namespace (with or without a qualifying event) this may be null to remove all previously attached event handlers * otherwise this will only remove events with this specific handler. * @param useCapture [Optional] Defaults to false */ export function detachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) { if (useCapture === void 0) { useCapture = false; } eventOff(obj, eventNameWithoutOn, handlerRef, null, useCapture); } /** * Trys to add an event handler for the specified event to the window, body and document * @param eventName {string} - The name of the event * @param callback {any} - The callback function that needs to be executed for the given event * @param evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace. * @return {boolean} - true if the handler was successfully added */ export function addEventHandler(eventName, callback, evtNamespace) { var result = false; var w = getWindow(); if (w) { result = eventOn(w, eventName, callback, evtNamespace); result = eventOn(w["body"], eventName, callback, evtNamespace) || result; } var doc = getDocument(); if (doc) { result = eventOn(doc, eventName, callback, evtNamespace) || result; } return result; } /** * Trys to remove event handler(s) for the specified event/namespace to the window, body and document * @param eventName {string} - The name of the event, with optional namespaces or just the namespaces, * such as "click", "click.mynamespace" or ".mynamespace" * @param callback {any} - - The callback function that needs to be removed from the given event, when using a * namespace (with or without a qualifying event) this may be null to remove all previously attached event handlers * otherwise this will only remove events with this specific handler. * @param evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace. */ export function removeEventHandler(eventName, callback, evtNamespace) { var w = getWindow(); if (w) { eventOff(w, eventName, callback, evtNamespace); eventOff(w["body"], eventName, callback, evtNamespace); } var doc = getDocument(); if (doc) { eventOff(doc, eventName, callback, evtNamespace); } } /** * Bind the listener to the array of events * @param events An string array of event names to bind the listener to * @param listener The event callback to call when the event is triggered * @param excludeEvents - [Optional] An array of events that should not be hooked (if possible), unless no other events can be. * @param evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace. * @returns true - when at least one of the events was registered otherwise false */ function _addEventListeners(events, listener, excludeEvents, evtNamespace) { var added = false; if (listener && events && events.length > 0) { arrForEach(events, function (name) { if (name) { if (!excludeEvents || arrIndexOf(excludeEvents, name) === -1) { added = addEventHandler(name, listener, evtNamespace) || added; } } }); } return added; } /** * Bind the listener to the array of events * @param events An string array of event names to bind the listener to * @param listener The event callback to call when the event is triggered * @param excludeEvents - [Optional] An array of events that should not be hooked (if possible), unless no other events can be. * @param evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace. * @returns true - when at least one of the events was registered otherwise false */ export function addEventListeners(events, listener, excludeEvents, evtNamespace) { var added = false; if (listener && events && isArray(events)) { added = _addEventListeners(events, listener, excludeEvents, evtNamespace); if (!added && excludeEvents && excludeEvents.length > 0) { // Failed to add any listeners and we excluded some, so just attempt to add the excluded events added = _addEventListeners(events, listener, null, evtNamespace); } } return added; } /** * Remove the listener from the array of events * @param events An string array of event names to bind the listener to * @param listener The event callback to call when the event is triggered * @param evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace. */ export function removeEventListeners(events, listener, evtNamespace) { if (events && isArray(events)) { arrForEach(events, function (name) { if (name) { removeEventHandler(name, listener, evtNamespace); } }); } } /** * Listen to the 'beforeunload', 'unload' and 'pagehide' events which indicates a page unload is occurring, * this does NOT listen to the 'visibilitychange' event as while it does indicate that the page is being hidden * it does not *necessarily* mean that the page is being completely unloaded, it can mean that the user is * just navigating to a different Tab and may come back (without unloading the page). As such you may also * need to listen to the 'addPageHideEventListener' and 'addPageShowEventListener' events. * @param listener - The event callback to call when a page unload event is triggered * @param excludeEvents - [Optional] An array of events that should not be hooked, unless no other events can be. * @param evtNamespace - [Optional] Namespace(s) to append to the event listeners so they can be uniquely identified and removed based on this namespace. * @returns true - when at least one of the events was registered otherwise false */ export function addPageUnloadEventListener(listener, excludeEvents, evtNamespace) { // Hook the unload event for the document, window and body to ensure that the client events are flushed to the server // As just hooking the window does not always fire (on chrome) for page navigation's. return addEventListeners([strBeforeUnload, strUnload, strPageHide], listener, excludeEvents, evtNamespace); } /** * Remove any matching 'beforeunload', 'unload' and 'pagehide' events that may have been added via addEventListener, * addEventListeners, addPageUnloadEventListener or addPageHideEventListener. * @param listener - The specific event callback to to be removed * @param evtNamespace - [Optional] Namespace(s) uniquely identified and removed based on this namespace. * @returns true - when at least one of the events was registered otherwise false */ export function removePageUnloadEventListener(listener, evtNamespace) { removeEventListeners([strBeforeUnload, strUnload, strPageHide], listener, evtNamespace); } /** * Listen to the pagehide and visibility changing to 'hidden' events, because the 'visibilitychange' uses * an internal proxy to detect the visibility state you SHOULD use a unique namespace when if you plan to call * removePageShowEventListener as the remove ignores the listener argument for the 'visibilitychange' event. * @param listener - The event callback to call when a page hide event is triggered * @param excludeEvents - [Optional] An array of events that should not be hooked (if possible), unless no other events can be. * @param evtNamespace - [Optional] A Namespace to append to the event listeners so they can be uniquely identified and removed * based on this namespace. This call also adds an additional unique "pageshow" namespace to the events * so that only the matching "removePageHideEventListener" can remove these events. * Suggestion: pass as true if you are also calling addPageUnloadEventListener as that also hooks pagehide * @returns true - when at least one of the events was registered otherwise false */ export function addPageHideEventListener(listener, excludeEvents, evtNamespace) { function _handlePageVisibility(evt) { var doc = getDocument(); if (listener && doc && doc.visibilityState === "hidden") { listener(evt); } } // add the unique page show namespace to any provided namespace so we can only remove the ones added by "pagehide" var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace); var pageUnloadAdded = _addEventListeners([strPageHide], listener, excludeEvents, newNamespaces); if (!excludeEvents || arrIndexOf(excludeEvents, strVisibilityChangeEvt) === -1) { pageUnloadAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageUnloadAdded; } if (!pageUnloadAdded && excludeEvents) { // Failed to add any listeners and we where requested to exclude some, so just call again without excluding anything pageUnloadAdded = addPageHideEventListener(listener, null, evtNamespace); } return pageUnloadAdded; } /** * Removes the pageHide event listeners added by addPageHideEventListener, because the 'visibilitychange' uses * an internal proxy to detect the visibility state you SHOULD use a unique namespace when calling addPageHideEventListener * as the remove ignores the listener argument for the 'visibilitychange' event. * @param listener - The specific listener to remove for the 'pageshow' event only (ignored for 'visibilitychange') * @param evtNamespace - The unique namespace used when calling addPageShowEventListener */ export function removePageHideEventListener(listener, evtNamespace) { // add the unique page show namespace to any provided namespace so we only remove the ones added by "pagehide" var newNamespaces = mergeEvtNamespace(strPageHideNamespace, evtNamespace); removeEventListeners([strPageHide], listener, newNamespaces); removeEventListeners([strVisibilityChangeEvt], null, newNamespaces); } /** * Listen to the pageshow and visibility changing to 'visible' events, because the 'visibilitychange' uses * an internal proxy to detect the visibility state you SHOULD use a unique namespace when if you plan to call * removePageShowEventListener as the remove ignores the listener argument for the 'visibilitychange' event. * @param listener - The event callback to call when a page is show event is triggered * @param excludeEvents - [Optional] An array of events that should not be hooked (if possible), unless no other events can be. * @param evtNamespace - [Optional/Recommended] A Namespace to append to the event listeners so they can be uniquely * identified and removed based on this namespace. This call also adds an additional unique "pageshow" namespace to the events * so that only the matching "removePageShowEventListener" can remove these events. * @returns true - when at least one of the events was registered otherwise false */ export function addPageShowEventListener(listener, excludeEvents, evtNamespace) { function _handlePageVisibility(evt) { var doc = getDocument(); if (listener && doc && doc.visibilityState === "visible") { listener(evt); } } // add the unique page show namespace to any provided namespace so we can only remove the ones added by "pageshow" var newNamespaces = mergeEvtNamespace(strPageShowNamespace, evtNamespace); var pageShowAdded = _addEventListeners([strPageShow], listener, excludeEvents, newNamespaces); pageShowAdded = _addEventListeners([strVisibilityChangeEvt], _handlePageVisibility, excludeEvents, newNamespaces) || pageShowAdded; if (!pageShowAdded && excludeEvents) { // Failed to add any listeners and we where requested to exclude some, so just call again without excluding anything pageShowAdded = addPageShowEventListener(listener, null, evtNamespace); } return pageShowAdded; } /** * Removes the pageShow event listeners added by addPageShowEventListener, because the 'visibilitychange' uses * an internal proxy to detect the visibility state you SHOULD use a unique namespace when calling addPageShowEventListener * as the remove ignores the listener argument for the 'visibilitychange' event. * @param listener - The specific listener to remove for the 'pageshow' event only (ignored for 'visibilitychange') * @param evtNamespace - The unique namespace used when calling addPageShowEventListener */ export function removePageShowEventListener(listener, evtNamespace) { // add the unique page show namespace to any provided namespace so we only remove the ones added by "pageshow" var newNamespaces = mergeEvtNamespace(strPageShowNamespace, evtNamespace); removeEventListeners([strPageShow], listener, newNamespaces); removeEventListeners([strVisibilityChangeEvt], null, newNamespaces); } //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/EventHelpers.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ import { strShimUndefined, strShimObject, strShimFunction, throwTypeError, ObjClass, ObjProto, ObjAssign, ObjHasOwnProperty, ObjDefineProperty, strShimPrototype } from "@microsoft/applicationinsights-shims"; import { strEmpty } from "./InternalConstants"; // RESTRICT and AVOID circular dependencies you should not import other contained modules or export the contents of this file directly // Added to help with minfication var strToISOString = "toISOString"; var cStrEndsWith = "endsWith"; var cStrStartsWith = "startsWith"; var strIndexOf = "indexOf"; var strMap = "map"; var strReduce = "reduce"; var cStrTrim = "trim"; var strToString = "toString"; /** * Constant string defined to support minimization * @ignore */ var str__Proto = "__proto__"; /** * Constant string defined to support minimization * @ignore */ var strConstructor = "constructor"; var _objDefineProperty = ObjDefineProperty; var _objFreeze = ObjClass.freeze; var _objSeal = ObjClass.seal; var _objKeys = ObjClass.keys; var StringProto = String[strShimPrototype]; var _strTrim = StringProto[cStrTrim]; var _strEndsWith = StringProto[cStrEndsWith]; var _strStartsWith = StringProto[cStrStartsWith]; var DateProto = Date[strShimPrototype]; var _dataToISOString = DateProto[strToISOString]; var _isArray = Array.isArray; var _objToString = ObjProto[strToString]; var _fnToString = ObjHasOwnProperty[strToString]; // Cache what this browser reports as the object function constructor (as a string) var _objFunctionString = _fnToString.call(ObjClass); var rCamelCase = /-([a-z])/g; var rNormalizeInvalid = /([^\w\d_$])/g; var rLeadingNumeric = /^(\d+[\w\d_$])/; /** * Pre-lookup to check if we are running on a modern browser (i.e. not IE8) * @ignore */ var _objGetPrototypeOf = Object["getPrototypeOf"]; /** * Helper used to get the prototype of the target object as getPrototypeOf is not available in an ES3 environment. * @ignore */ export function _getObjProto(target) { if (target) { // This method doesn't existing in older browsers (e.g. IE8) if (_objGetPrototypeOf) { return _objGetPrototypeOf(target); } // target[Constructor] May break if the constructor has been changed or removed var newProto = target[str__Proto] || target[strShimPrototype] || target[strConstructor]; if (newProto) { return newProto; } } return null; } export function objToString(obj) { return _objToString.call(obj); } export function isTypeof(value, theType) { return typeof value === theType; } export function isUndefined(value) { return value === undefined || typeof value === strShimUndefined; } export function isNotUndefined(value) { return !isUndefined(value); } export function isNullOrUndefined(value) { return (value === null || isUndefined(value)); } export function isNotNullOrUndefined(value) { return !isNullOrUndefined(value); } export function hasOwnProperty(obj, prop) { return !!(obj && ObjHasOwnProperty.call(obj, prop)); } export function isObject(value) { // Changing to inline for performance return !!(value && typeof value === strShimObject); } export function isFunction(value) { // Changing to inline for performance return !!(value && typeof value === strShimFunction); } export function isPromiseLike(value) { return value && isFunction(value.then); } /** * Validates that the string name conforms to the JS IdentifierName specification and if not * normalizes the name so that it would. This method does not identify or change any keywords * meaning that if you pass in a known keyword the same value will be returned. * This is a simplified version * @param name The name to validate */ export function normalizeJsName(name) { var value = name; if (value && isString(value)) { // CamelCase everything after the "-" and remove the dash value = value.replace(rCamelCase, function (_all, letter) { return letter.toUpperCase(); }); value = value.replace(rNormalizeInvalid, "_"); value = value.replace(rLeadingNumeric, function (_all, match) { return "_" + match; }); } return value; } /** * This is a helper function for the equivalent of arForEach(objKeys(target), callbackFn), this is a * performance optimization to avoid the creation of a new array for large objects * @param target The target object to find and process the keys * @param callbackfn The function to call with the details */ export function objForEachKey(target, callbackfn) { if (target) { for (var prop in target) { if (ObjHasOwnProperty.call(target, prop)) { callbackfn.call(target, prop, target[prop]); } } } } /** * The strEndsWith() method determines whether a string ends with the characters of a specified string, returning true or false as appropriate. * @param value - The value to check whether it ends with the search value. * @param search - The characters to be searched for at the end of the value. * @returns true if the given search value is found at the end of the string, otherwise false. */ export function strEndsWith(value, search) { var result = false; if (value && search && !(result = value === search)) { // For Performance try and use the native instance, using string lookup of the function to easily pass the ES3 build checks and minification result = _strEndsWith ? value[cStrEndsWith](search) : _strEndsWithPoly(value, search); } return result; } /** * The _strEndsWith() method determines whether a string ends with the characters of a specified string, returning true or false as appropriate. * @param value - The value to check whether it ends with the search value. * @param search - The characters to be searched for at the end of the value. * @returns true if the given search value is found at the end of the string, otherwise false. */ export function _strEndsWithPoly(value, search) { var result = false; var searchLen = search ? search.length : 0; var valLen = value ? value.length : 0; if (searchLen && valLen && valLen >= searchLen && !(result = value === search)) { var pos = valLen - 1; for (var lp = searchLen - 1; lp >= 0; lp--) { if (value[pos] != search[lp]) { return false; } pos--; } result = true; } return result; } /** * The strStartsWith() method determines whether a string starts with the characters of the specified string, returning true or false as appropriate. * @param value - The value to check whether it ends with the search value. * @param checkValue - The characters to be searched for at the start of the value. * @returns true if the given search value is found at the start of the string, otherwise false. */ export function strStartsWith(value, checkValue) { var result = false; if (value && checkValue && !(result = value === checkValue)) { // For Performance try and use the native instance, using string lookup of the function to easily pass the ES3 build checks and minification result = _strStartsWith ? value[cStrStartsWith](checkValue) : _strStartsWithPoly(value, checkValue); } return result; } /** * The strStartsWith() method determines whether a string starts with the characters of the specified string, returning true or false as appropriate. * @param value - The value to check whether it ends with the search value. * @param checkValue - The characters to be searched for at the start of the value. * @returns true if the given search value is found at the start of the string, otherwise false. */ export function _strStartsWithPoly(value, checkValue) { // Using helper for performance and because string startsWith() is not available on IE var result = false; var chkLen = checkValue ? checkValue.length : 0; if (value && chkLen && value.length >= chkLen && !(result = value === checkValue)) { for (var lp = 0; lp < chkLen; lp++) { if (value[lp] !== checkValue[lp]) { return false; } } result = true; } return result; } /** * A simple wrapper (for minification support) to check if the value contains the search string. * @param value - The string value to check for the existence of the search value * @param search - The value search within the value */ export function strContains(value, search) { if (value && search) { return value.indexOf(search) !== -1; } return false; } /** * Check if an object is of type Date */ export function isDate(obj) { return !!(obj && _objToString.call(obj) === "[object Date]"); } /** * Check if an object is of type Array with optional generic T, the generic type is not validated * and exists to help with TypeScript validation only. */ export var isArray = _isArray || _isArrayPoly; function _isArrayPoly(obj) { return !!(obj && _objToString.call(obj) === "[object Array]"); } /** * Check if an object is of type Error */ export function isError(obj) { return !!(obj && _objToString.call(obj) === "[object Error]"); } /** * Checks if the type of value is a string. * @param {any} value - Value to be checked. * @return {boolean} True if the value is a string, false otherwise. */ export function isString(value) { // Changing to inline for performance return typeof value === "string"; } /** * Checks if the type of value is a number. * @param {any} value - Value to be checked. * @return {boolean} True if the value is a number, false otherwise. */ export function isNumber(value) { // Changing to inline for performance return typeof value === "number"; } /** * Checks if the type of value is a boolean. * @param {any} value - Value to be checked. * @return {boolean} True if the value is a boolean, false otherwise. */ export function isBoolean(value) { // Changing to inline for performance return typeof value === "boolean"; } /** * Checks if the type of value is a Symbol. * This only returns a boolean as returning value is Symbol will cause issues for older TypeScript consumers * @param {any} value - Value to be checked. * @return {boolean} True if the value is a Symbol, false otherwise. */ export function isSymbol(value) { return typeof value === "symbol"; } /** * Checks if the type of the value is a normal plain object (not a null or data) * @param value */ export function isPlainObject(value) { var result = false; if (value && typeof value === "object") { // Inlining _objGetPrototypeOf for performance to avoid an additional function call var proto = _objGetPrototypeOf ? _objGetPrototypeOf(value) : _getObjProto(value); if (!proto) { // No prototype found so this is a plain Object eg. 'Object.create(null)' result = true; } else { // Objects that have a prototype are plain only if they were created using the Object global (native) function if (proto[strConstructor] && ObjHasOwnProperty.call(proto, strConstructor)) { proto = proto[strConstructor]; } result = typeof proto === strShimFunction && _fnToString.call(proto) === _objFunctionString; } } return result; } /** * Convert a date to I.S.O. format in IE8 */ export function toISOString(date) { if (date) { // For Performance try and use the native instance, using string lookup of the function to easily pass the ES3 build checks and minification return _dataToISOString ? date[strToISOString]() : _toISOStringPoly(date); } } /** * Convert a date to I.S.O. format in IE8 */ export function _toISOStringPoly(date) { if (date && date.getUTCFullYear) { var pad = function (num) { var r = String(num); if (r.length === 1) { r = "0" + r; } return r; }; return date.getUTCFullYear() + "-" + pad(date.getUTCMonth() + 1) + "-" + pad(date.getUTCDate()) + "T" + pad(date.getUTCHours()) + ":" + pad(date.getUTCMinutes()) + ":" + pad(date.getUTCSeconds()) + "." + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5) + "Z"; } } /** * Performs the specified action for each element in an array. This helper exists to avoid adding a polyfil for older browsers * that do not define Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page checks for presence/absence of the prototype * implementation. Note: For consistency this will not use the Array.prototype.xxxx implementation if it exists as this would * cause a testing requirement to test with and without the implementations * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. It can return -1 to break out of the loop * @param thisArg [Optional] An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. */ export function arrForEach(arr, callbackfn, thisArg) { var len = arr.length; try { for (var idx = 0; idx < len; idx++) { if (idx in arr) { if (callbackfn.call(thisArg || arr, arr[idx], idx, arr) === -1) { break; } } } } catch (e) { // This can happen with some native browser objects, but should not happen for the type we are checking for } } /** * Returns the index of the first occurrence of a value in an array. This helper exists to avoid adding a polyfil for older browsers * that do not define Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page checks for presence/absence of the prototype * implementation. Note: For consistency this will not use the Array.prototype.xxxx implementation if it exists as this would * cause a testing requirement to test with and without the implementations * @param searchElement The value to locate in the array. * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. */ export function arrIndexOf(arr, searchElement, fromIndex) { if (arr) { // For Performance try and use the native instance, using string lookup of the function to easily pass the ES3 build checks and minification if (arr[strIndexOf]) { return arr[strIndexOf](searchElement, fromIndex); } var len = arr.length; var from = fromIndex || 0; try { for (var lp = Math.max(from >= 0 ? from : len - Math.abs(from), 0); lp < len; lp++) { if (lp in arr && arr[lp] === searchElement) { return lp; } } } catch (e) { // This can happen with some native browser objects, but should not happen for the type we are checking for } } return -1; } /** * Calls a defined callback function on each element of an array, and returns an array that contains the results. This helper exists * to avoid adding a polyfil for older browsers that do not define Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page * checks for presence/absence of the prototype implementation. Note: For consistency this will not use the Array.prototype.xxxx * implementation if it exists as this would cause a testing requirement to test with and without the implementations * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. */ export function arrMap(arr, callbackfn, thisArg) { var results; if (arr) { // For Performance try and use the native instance, using string lookup of the function to easily pass the ES3 build checks and minification if (arr[strMap]) { return arr[strMap](callbackfn, thisArg); } var len = arr.length; var _this = thisArg || arr; results = new Array(len); try { for (var lp = 0; lp < len; lp++) { if (lp in arr) { results[lp] = callbackfn.call(_this, arr[lp], arr); } } } catch (e) { // This can happen with some native browser objects, but should not happen for the type we are checking for } } return results; } /** * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is * provided as an argument in the next call to the callback function. This helper exists to avoid adding a polyfil for older browsers that do not define * Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page checks for presence/absence of the prototype implementation. Note: For consistency * this will not use the Array.prototype.xxxx implementation if it exists as this would cause a testing requirement to test with and without the implementations * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. */ export function arrReduce(arr, callbackfn, initialValue) { var value; if (arr) { // For Performance try and use the native instance, using string lookup of the function to easily pass the ES3 build checks and minification if (arr[strReduce]) { return arr[strReduce](callbackfn, initialValue); } var len = arr.length; var lp = 0; // Specifically checking the number of passed arguments as the value could be anything if (arguments.length >= 3) { value = arguments[2]; } else { while (lp < len && !(lp in arr)) { lp++; } value = arr[lp++]; } while (lp < len) { if (lp in arr) { value = callbackfn(value, arr[lp], lp, arr); } lp++; } } return value; } /** * helper method to trim strings (IE8 does not implement String.prototype.trim) */ export function strTrim(str) { if (str) { // For Performance try and use the native instance, using string lookup of the function to easily pass the ES3 build checks and minification str = (_strTrim && str[cStrTrim]) ? str[cStrTrim]() : (str.replace ? str.replace(/^\s+|\s+$/g, "") : str); } return str; } var _objKeysHasDontEnumBug = !({ toString: null }).propertyIsEnumerable("toString"); var _objKeysDontEnums = [ "toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor" ]; /** * Returns the names of the enumerable string properties and methods of an object. This helper exists to avoid adding a polyfil for older browsers * that do not define Object.keys eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation. * Note: For consistency this will not use the Object.keys implementation if it exists as this would cause a testing requirement to test with and without the implementations * @param obj Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. */ export function objKeys(obj) { var objType = typeof obj; if (objType !== strShimFunction && (objType !== strShimObject || obj === null)) { throwTypeError("objKeys called on non-object"); } // For Performance try and use the native instance, using string lookup of the function to easily pass the ES3 build checks and minification if (!_objKeysHasDontEnumBug && _objKeys) { return _objKeys(obj); } var result = []; for (var prop in obj) { if (obj && ObjHasOwnProperty.call(obj, prop)) { result.push(prop); } } if (_objKeysHasDontEnumBug) { var dontEnumsLength = _objKeysDontEnums.length; for (var lp = 0; lp < dontEnumsLength; lp++) { if (obj && ObjHasOwnProperty.call(obj, _objKeysDontEnums[lp])) { result.push(_objKeysDontEnums[lp]); } } } return result; } /** * Try to define get/set object property accessors for the target object/prototype, this will provide compatibility with * existing API definition when run within an ES5+ container that supports accessors but still enable the code to be loaded * and executed in an ES3 container, providing basic IE8 compatibility. * @param target The object on which to define the property. * @param prop The name of the property to be defined or modified. * @param getProp The getter function to wire against the getter. * @param setProp The setter function to wire against the setter. * @returns True if it was able to create the accessors otherwise false */ export function objDefineAccessors(target, prop, getProp, setProp) { if (_objDefineProperty) { try { var descriptor = { enumerable: true, configurable: true }; if (getProp) { descriptor.get = getProp; } if (setProp) { descriptor.set = setProp; } _objDefineProperty(target, prop, descriptor); return true; } catch (e) { // IE8 Defines a defineProperty on Object but it's only supported for DOM elements so it will throw // We will just ignore this here. } } return false; } function _doNothing(value) { return value; } export function deepFreeze(obj) { if (_objFreeze) { objForEachKey(obj, function (name, value) { if (isArray(value) || isObject(value)) { _objFreeze(value); } }); } return objFreeze(obj); } export var objFreeze = _objFreeze || _doNothing; export var objSeal = _objSeal || _doNothing; /** * Return the current time via the Date now() function (if available) and falls back to (new Date()).getTime() if now() is unavailable (IE8 or less) * https://caniuse.com/#search=Date.now */ export function dateNow() { var dt = Date; return dt.now ? dt.now() : new dt().getTime(); } /** * Returns the name of object if it's an Error. Otherwise, returns empty string. */ export function getExceptionName(object) { if (isError(object)) { return object.name; } return strEmpty; } /** * Sets the provided value on the target instance using the field name when the provided chk function returns true, the chk * function will only be called if the new value is no equal to the original value. * @param target - The target object * @param field - The key of the target * @param value - The value to set * @param valChk - [Optional] Callback to check the value that if supplied will be called check if the new value can be set * @param srcChk - [Optional] Callback to check to original value that if supplied will be called if the new value should be set (if allowed) * @returns The existing or new value, depending what was set */ export function setValue(target, field, value, valChk, srcChk) { var theValue = value; if (target) { theValue = target[field]; if (theValue !== value && (!srcChk || srcChk(theValue)) && (!valChk || valChk(value))) { theValue = value; target[field] = theValue; } } return theValue; } /** * Returns the current value from the target object if not null or undefined otherwise sets the new value and returns it * @param target - The target object to return or set the default value * @param field - The key for the field to set on the target * @param defValue - [Optional] The value to set if not already present, when not provided a empty object will be added */ export function getSetValue(target, field, defValue) { var theValue; if (target) { theValue = target[field]; if (!theValue && isNullOrUndefined(theValue)) { // Supports having the default as null theValue = !isUndefined(defValue) ? defValue : {}; target[field] = theValue; } } else { // Expanded for performance so we only check defValue if required theValue = !isUndefined(defValue) ? defValue : {}; } return theValue; } export function isNotTruthy(value) { return !value; } export function isTruthy(value) { return !!value; } export function throwError(message) { throw new Error(message); } function _createProxyFunction(source, funcName) { var srcFunc = null; var src = null; if (isFunction(source)) { srcFunc = source; } else { src = source; } return function () { // Capture the original arguments passed to the method var originalArguments = arguments; if (srcFunc) { src = srcFunc(); } if (src) { return src[funcName].apply(src, originalArguments); } }; } /** * Effectively assigns all enumerable properties (not just own properties) and functions (including inherited prototype) from * the source object to the target, it attempts to use proxy getters / setters (if possible) and proxy functions to avoid potential * implementation issues by assigning prototype functions as instance ones * * This method is the primary method used to "update" the snippet proxy with the ultimate implementations. * * Special ES3 Notes: * Updates (setting) of direct property values on the target or indirectly on the source object WILL NOT WORK PROPERLY, updates to the * properties of "referenced" object will work (target.context.newValue = 10 => will be reflected in the source.context as it's the * same object). ES3 Failures: assigning target.myProp = 3 -> Won't change source.myProp = 3, likewise the reverse would also fail. * @param target - The target object to be assigned with the source properties and functions * @param source - The source object which will be assigned / called by setting / calling the targets proxies * @param chkSet - An optional callback to determine whether a specific property/function should be proxied */ export function proxyAssign(target, source, chkSet) { if (target && source && isObject(target) && isObject(source)) { var _loop_1 = function (field) { if (isString(field)) { var value = source[field]; if (isFunction(value)) { if (!chkSet || chkSet(field, true, source, target)) { // Create a proxy function rather than just copying the (possible) prototype to the new object as an instance function target[field] = _createProxyFunction(source, field); } } else if (!chkSet || chkSet(field, false, source, target)) { if (hasOwnProperty(target, field)) { // Remove any previous instance property delete target[field]; } if (!objDefineAccessors(target, field, function () { return source[field]; }, function (theValue) { source[field] = theValue; })) { // Unable to create an accessor, so just assign the values as a fallback // -- this will (mostly) work for objects // -- but will fail for accessing primitives (if the source changes it) and all types of "setters" as the source won't be modified target[field] = value; } } } }; // effectively apply/proxy full source to the target instance for (var field in source) { _loop_1(field); } } return target; } /** * Creates a proxy function on the target which internally will call the source version with all arguments passed to the target method. * * @param target - The target object to be assigned with the source properties and functions * @param name - The function name that will be added on the target * @param source - The source object which will be assigned / called by setting / calling the targets proxies * @param theFunc - The function name on the source that will be proxied on the target * @param overwriteTarget - If `false` this will not replace any pre-existing name otherwise (the default) it will overwrite any existing name */ export function proxyFunctionAs(target, name, source, theFunc, overwriteTarget) { if (target && name && source) { if (overwriteTarget !== false || isUndefined(target[name])) { target[name] = _createProxyFunction(source, theFunc); } } } /** * Creates proxy functions on the target which internally will call the source version with all arguments passed to the target method. * * @param target - The target object to be assigned with the source properties and functions * @param source - The source object which will be assigned / called by setting / calling the targets proxies * @param functionsToProxy - An array of function names that will be proxied on the target * @param overwriteTarget - If false this will not replace any pre-existing name otherwise (the default) it will overwrite any existing name */ export function proxyFunctions(target, source, functionsToProxy, overwriteTarget) { if (target && source && isObject(target) && isArray(functionsToProxy)) { arrForEach(functionsToProxy, function (theFuncName) { if (isString(theFuncName)) { proxyFunctionAs(target, theFuncName, source, theFuncName, overwriteTarget); } }); } return target; } /** * Simpler helper to create a dynamic class that implements the interface and populates the values with the defaults. * Only instance properties (hasOwnProperty) values are copied from the defaults to the new instance * @param defaults Simple helper */ export function createClassFromInterface(defaults) { return /** @class */ (function () { function class_1() { var _this_1 = this; if (defaults) { objForEachKey(defaults, function (field, value) { _this_1[field] = value; }); } } return class_1; }()); } /** * A helper function to assist with JIT performance for objects that have properties added / removed dynamically * this is primarily for chromium based browsers and has limited effects on Firefox and none of IE. Only call this * function after you have finished "updating" the object, calling this within loops reduces or defeats the benefits. * This helps when iterating using for..in, objKeys() and objForEach() * @param theObject - The object to be optimized if possible */ export function optimizeObject(theObject) { // V8 Optimization to cause the JIT compiler to create a new optimized object for looking up the own properties // primarily for object with <= 19 properties for >= 20 the effect is reduced or non-existent if (theObject && ObjAssign) { theObject = ObjClass(ObjAssign({}, theObject)); } return theObject; } export function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) { // Variables var theArgs = arguments; var extended = theArgs[0] || {}; var argLen = theArgs.length; var deep = false; var idx = 1; // Check for "Deep" flag if (argLen > 0 && isBoolean(extended)) { deep = extended; extended = theArgs[idx] || {}; idx++; } // Handle case when target is a string or something (possible in deep copy) if (!isObject(extended)) { extended = {}; } // Loop through each remaining object and conduct a merge for (; idx < argLen; idx++) { var arg = theArgs[idx]; var isArgArray = isArray(arg); var isArgObj = isObject(arg); for (var prop in arg) { var propOk = (isArgArray && (prop in arg)) || (isArgObj && (ObjHasOwnProperty.call(arg, prop))); if (!propOk) { continue; } var newValue = arg[prop]; var isNewArray = void 0; // If deep merge and property is an object, merge properties if (deep && newValue && ((isNewArray = isArray(newValue)) || isPlainObject(newValue))) { // Grab the current value of the extended object var clone = extended[prop]; if (isNewArray) { if (!isArray(clone)) { // We can't "merge" an array with a non-array so overwrite the original clone = []; } } else if (!isPlainObject(clone)) { // We can't "merge" an object with a non-object clone = {}; } // Never move the original objects always clone them newValue = objExtend(deep, clone, newValue); } // Assign the new (or previous) value (unless undefined) if (newValue !== undefined) { extended[prop] = newValue; } } } return extended; } //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/HelperFuncs.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ import { strShimFunction, strShimPrototype } from "@microsoft/applicationinsights-shims"; import { hasOwnProperty, _getObjProto } from "./HelperFuncs"; import { getGlobalInst } from "./EnvUtils"; var aiInstrumentHooks = "_aiHooks"; var cbNames = [ "req", "rsp", "hkErr", "fnErr" ]; /** @ignore */ function _arrLoop(arr, fn) { if (arr) { for (var lp = 0; lp < arr.length; lp++) { if (fn(arr[lp], lp)) { break; } } } } /** @ignore */ function _doCallbacks(hooks, callDetails, cbArgs, hookCtx, type) { if (type >= 0 /* Request */ && type <= 2 /* HookError */) { _arrLoop(hooks, function (hook, idx) { var cbks = hook.cbks; var cb = cbks[cbNames[type]]; if (cb) { // Set the specific hook context implementation using a lazy creation pattern callDetails.ctx = function () { var ctx = hookCtx[idx] = (hookCtx[idx] || {}); return ctx; }; try { cb.apply(callDetails.inst, cbArgs); } catch (err) { var orgEx = callDetails.err; try { // Report Hook error via the callback var hookErrorCb = cbks[cbNames[2 /* HookError */]]; if (hookErrorCb) { callDetails.err = err; hookErrorCb.apply(callDetails.inst, cbArgs); } } catch (e) { // Not much we can do here -- swallowing the exception to avoid crashing the hosting app } finally { // restore the original exception (if any) callDetails.err = orgEx; } } } }); } } /** @ignore */ function _createFunctionHook(aiHook) { // Define a temporary method that queues-up a the real method call return function () { var funcThis = this; // Capture the original arguments passed to the method var orgArgs = arguments; var hooks = aiHook.h; var funcArgs = { name: aiHook.n, inst: funcThis, ctx: null, set: _replaceArg }; var hookCtx = []; var cbArgs = _createArgs([funcArgs], orgArgs); funcArgs.evt = getGlobalInst("event"); function _createArgs(target, theArgs) { _arrLoop(theArgs, function (arg) { target.push(arg); }); return target; } function _replaceArg(idx, value) { orgArgs = _createArgs([], orgArgs); orgArgs[idx] = value; cbArgs = _createArgs([funcArgs], orgArgs); } // Call the pre-request hooks _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 0 /* Request */); // Call the original function was called var theFunc = aiHook.f; if (theFunc) { try { funcArgs.rslt = theFunc.apply(funcThis, orgArgs); } catch (err) { // Report the request callback funcArgs.err = err; _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 3 /* FunctionError */); // rethrow the original exception so anyone listening for it can catch the exception throw err; } } // Call the post-request hooks _doCallbacks(hooks, funcArgs, cbArgs, hookCtx, 1 /* Response */); return funcArgs.rslt; }; } /** @ignore */ function _getOwner(target, name, checkPrototype) { var owner = null; if (target) { if (hasOwnProperty(target, name)) { owner = target; } else if (checkPrototype) { owner = _getOwner(_getObjProto(target), name, false); } } return owner; } /** * Intercept the named prototype functions for the target class / object * @param target - The target object * @param funcName - The function name * @param callbacks - The callbacks to configure and call whenever the function is called */ export function InstrumentProto(target, funcName, callbacks) { if (target) { return InstrumentFunc(target[strShimPrototype], funcName, callbacks, false); } return null; } /** * Intercept the named prototype functions for the target class / object * @param target - The target object * @param funcNames - The function names to intercept and call * @param callbacks - The callbacks to configure and call whenever the function is called */ export function InstrumentProtos(target, funcNames, callbacks) { if (target) { return InstrumentFuncs(target[strShimPrototype], funcNames, callbacks, false); } return null; } function _createInstrumentHook(owner, funcName, fn, callbacks) { var aiHook = fn && fn[aiInstrumentHooks]; if (!aiHook) { // Only hook the function once aiHook = { i: 0, n: funcName, f: fn, h: [] }; // Override (hook) the original function var newFunc = _createFunctionHook(aiHook); newFunc[aiInstrumentHooks] = aiHook; // Tag and store the function hooks owner[funcName] = newFunc; } var theHook = { // tslint:disable:object-literal-shorthand id: aiHook.i, cbks: callbacks, rm: function () { // DO NOT Use () => { shorthand for the function as the this gets replaced // with the outer this and not the this for theHook instance. var id = this.id; _arrLoop(aiHook.h, function (hook, idx) { if (hook.id === id) { aiHook.h.splice(idx, 1); return 1; } }); } // tslint:enable:object-literal-shorthand }; aiHook.i++; aiHook.h.push(theHook); return theHook; } /** * Intercept the named prototype functions for the target class / object * @param target - The target object * @param funcName - The function name * @param callbacks - The callbacks to configure and call whenever the function is called * @param checkPrototype - If the function doesn't exist on the target should it attempt to hook the prototype function */ export function InstrumentFunc(target, funcName, callbacks, checkPrototype) { if (checkPrototype === void 0) { checkPrototype = true; } if (target && funcName && callbacks) { var owner = _getOwner(target, funcName, checkPrototype); if (owner) { var fn = owner[funcName]; if (typeof fn === strShimFunction) { return _createInstrumentHook(owner, funcName, fn, callbacks); } } } return null; } /** * Intercept the named functions for the target class / object * @param target - The target object * @param funcNames - The function names to intercept and call * @param callbacks - The callbacks to configure and call whenever the function is called * @param checkPrototype - If the function doesn't exist on the target should it attempt to hook the prototype function */ export function InstrumentFuncs(target, funcNames, callbacks, checkPrototype) { if (checkPrototype === void 0) { checkPrototype = true; } var hooks = null; _arrLoop(funcNames, function (funcName) { var hook = InstrumentFunc(target, funcName, callbacks, checkPrototype); if (hook) { if (!hooks) { hooks = []; } hooks.push(hook); } }); return hooks; } /** * Add an instrumentation hook to the provided named "event" for the target class / object, this doesn't check whether the * named "event" is in fact a function and just assigns the instrumentation hook to the target[evtName] * @param target - The target object * @param evtName - The name of the event * @param callbacks - The callbacks to configure and call whenever the function is called * @param checkPrototype - If the function doesn't exist on the target should it attempt to hook the prototype function */ export function InstrumentEvent(target, evtName, callbacks, checkPrototype) { if (target && evtName && callbacks) { var owner = _getOwner(target, evtName, checkPrototype) || target; if (owner) { return _createInstrumentHook(owner, evtName, owner[evtName], callbacks); } } return null; } //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/InstrumentHooks.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ // Note: DON'T Export these const from the package as we are still targeting ES3 this will export a mutable variables that someone could change!!! export var strEmpty = ""; export var strProcessTelemetry = "processTelemetry"; export var strPriority = "priority"; export var strSetNextPlugin = "setNextPlugin"; export var strIsInitialized = "isInitialized"; export var strTeardown = "teardown"; export var strCore = "core"; export var strUpdate = "update"; export var strDisabled = "disabled"; export var strDoTeardown = "_doTeardown"; export var strProcessNext = "processNext"; export var strResume = "resume"; export var strPause = "pause"; export var strNotificationListener = "NotificationListener"; export var strAddNotificationListener = "add" + strNotificationListener; export var strRemoveNotificationListener = "remove" + strNotificationListener; export var strEventsSent = "eventsSent"; export var strEventsDiscarded = "eventsDiscarded"; export var strEventsSendRequest = "eventsSendRequest"; export var strPerfEvent = "perfEvent"; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/InternalConstants.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ import dynamicProto from "@microsoft/dynamicproto-js"; import { arrForEach, arrIndexOf } from "./HelperFuncs"; import { strAddNotificationListener, strEventsDiscarded, strEventsSendRequest, strEventsSent, strPerfEvent, strRemoveNotificationListener } from "./InternalConstants"; function _runListeners(listeners, name, isAsync, callback) { arrForEach(listeners, function (listener) { if (listener && listener[name]) { if (isAsync) { setTimeout(function () { return callback(listener); }, 0); } else { try { callback(listener); } catch (e) { // Catch errors to ensure we don't block sending the requests } } } }); } /** * Class to manage sending notifications to all the listeners. */ var NotificationManager = /** @class */ (function () { function NotificationManager(config) { this.listeners = []; var perfEvtsSendAll = !!(config || {}).perfEvtsSendAll; dynamicProto(NotificationManager, this, function (_self) { _self[strAddNotificationListener] = function (listener) { _self.listeners.push(listener); }; /** * Removes all instances of the listener. * @param {INotificationListener} listener - AWTNotificationListener to remove. */ _self[strRemoveNotificationListener] = function (listener) { var index = arrIndexOf(_self.listeners, listener); while (index > -1) { _self.listeners.splice(index, 1); index = arrIndexOf(_self.listeners, listener); } }; /** * Notification for events sent. * @param {ITelemetryItem[]} events - The array of events that have been sent. */ _self[strEventsSent] = function (events) { _runListeners(_self.listeners, strEventsSent, true, function (listener) { listener[strEventsSent](events); }); }; /** * Notification for events being discarded. * @param {ITelemetryItem[]} events - The array of events that have been discarded by the SDK. * @param {number} reason - The reason for which the SDK discarded the events. The EventsDiscardedReason * constant should be used to check the different values. */ _self[strEventsDiscarded] = function (events, reason) { _runListeners(_self.listeners, strEventsDiscarded, true, function (listener) { listener[strEventsDiscarded](events, reason); }); }; /** * [Optional] A function called when the events have been requested to be sent to the sever. * @param {number} sendReason - The reason why the event batch is being sent. * @param {boolean} isAsync - A flag which identifies whether the requests are being sent in an async or sync manner. */ _self[strEventsSendRequest] = function (sendReason, isAsync) { _runListeners(_self.listeners, strEventsSendRequest, isAsync, function (listener) { listener[strEventsSendRequest](sendReason, isAsync); }); }; _self[strPerfEvent] = function (perfEvent) { if (perfEvent) { // Send all events or only parent events if (perfEvtsSendAll || !perfEvent.isChildEvt()) { _runListeners(_self.listeners, strPerfEvent, false, function (listener) { if (perfEvent.isAsync) { setTimeout(function () { return listener[strPerfEvent](perfEvent); }, 0); } else { listener[strPerfEvent](perfEvent); } }); } } }; }); } // Removed Stub for NotificationManager.prototype.addNotificationListener. // Removed Stub for NotificationManager.prototype.removeNotificationListener. // Removed Stub for NotificationManager.prototype.eventsSent. // Removed Stub for NotificationManager.prototype.eventsDiscarded. // Removed Stub for NotificationManager.prototype.eventsSendRequest. return NotificationManager; }()); export { NotificationManager }; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/NotificationManager.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ import dynamicProto from "@microsoft/dynamicproto-js"; import { dateNow, isArray, isFunction, objDefineAccessors } from "./HelperFuncs"; var strExecutionContextKey = "ctx"; var _defaultPerfManager = null; var PerfEvent = /** @class */ (function () { function PerfEvent(name, payloadDetails, isAsync) { var _self = this; var accessorDefined = false; _self.start = dateNow(); _self.name = name; _self.isAsync = isAsync; _self.isChildEvt = function () { return false; }; if (isFunction(payloadDetails)) { // Create an accessor to minimize the potential performance impact of executing the payloadDetails callback var theDetails_1; accessorDefined = objDefineAccessors(_self, "payload", function () { // Delay the execution of the payloadDetails until needed if (!theDetails_1 && isFunction(payloadDetails)) { theDetails_1 = payloadDetails(); // clear it out now so the referenced objects can be garbage collected payloadDetails = null; } return theDetails_1; }); } _self.getCtx = function (key) { if (key) { // The parent and child links are located directly on the object (for better viewing in the DebugPlugin) if (key === PerfEvent.ParentContextKey || key === PerfEvent.ChildrenContextKey) { return _self[key]; } return (_self[strExecutionContextKey] || {})[key]; } return null; }; _self.setCtx = function (key, value) { if (key) { // Put the parent and child links directly on the object (for better viewing in the DebugPlugin) if (key === PerfEvent.ParentContextKey) { // Simple assumption, if we are setting a parent then we must be a child if (!_self[key]) { _self.isChildEvt = function () { return true; }; } _self[key] = value; } else if (key === PerfEvent.ChildrenContextKey) { _self[key] = value; } else { var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {}; ctx[key] = value; } } }; _self.complete = function () { var childTime = 0; var childEvts = _self.getCtx(PerfEvent.ChildrenContextKey); if (isArray(childEvts)) { for (var lp = 0; lp < childEvts.length; lp++) { var childEvt = childEvts[lp]; if (childEvt) { childTime += childEvt.time; } } } _self.time = dateNow() - _self.start; _self.exTime = _self.time - childTime; _self.complete = function () { }; if (!accessorDefined && isFunction(payloadDetails)) { // If we couldn't define the property set during complete -- to minimize the perf impact until after the time _self.payload = payloadDetails(); } }; } PerfEvent.ParentContextKey = "parent"; PerfEvent.ChildrenContextKey = "childEvts"; return PerfEvent; }()); export { PerfEvent }; var PerfManager = /** @class */ (function () { function PerfManager(manager) { /** * General bucket used for execution context set and retrieved via setCtx() and getCtx. * Defined as private so it can be visualized via the DebugPlugin */ this.ctx = {}; dynamicProto(PerfManager, this, function (_self) { _self.create = function (src, payloadDetails, isAsync) { // TODO (@MSNev): at some point we will want to add additional configuration to "select" which events to instrument // for now this is just a simple do everything. return new PerfEvent(src, payloadDetails, isAsync); }; _self.fire = function (perfEvent) { if (perfEvent) { perfEvent.complete(); if (manager && isFunction(manager.perfEvent)) { manager.perfEvent(perfEvent); } } }; _self.setCtx = function (key, value) { if (key) { var ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {}; ctx[key] = value; } }; _self.getCtx = function (key) { return (_self[strExecutionContextKey] || {})[key]; }; }); } // Removed Stub for PerfManager.prototype.create. // Removed Stub for PerfManager.prototype.fire. // Removed Stub for PerfManager.prototype.setCtx. // Removed Stub for PerfManager.prototype.getCtx. return PerfManager; }()); export { PerfManager }; var doPerfActiveKey = "CoreUtils.doPerf"; /** * Helper function to wrap a function with a perf event * @param mgrSource - The Performance Manager or a Performance provider source (may be null) * @param getSource - The callback to create the source name for the event (if perf monitoring is enabled) * @param func - The function to call and measure * @param details - A function to return the payload details * @param isAsync - Is the event / function being call asynchronously or synchronously */ export function doPerf(mgrSource, getSource, func, details, isAsync) { if (mgrSource) { var perfMgr = mgrSource; if (isFunction(perfMgr["getPerfMgr"])) { // Looks like a perf manager provider object perfMgr = perfMgr["getPerfMgr"](); } if (perfMgr) { var perfEvt = void 0; var currentActive = perfMgr.getCtx(doPerfActiveKey); try { perfEvt = perfMgr.create(getSource(), details, isAsync); if (perfEvt) { if (currentActive && perfEvt.setCtx) { perfEvt.setCtx(PerfEvent.ParentContextKey, currentActive); if (currentActive.getCtx && currentActive.setCtx) { var children = currentActive.getCtx(PerfEvent.ChildrenContextKey); if (!children) { children = []; currentActive.setCtx(PerfEvent.ChildrenContextKey, children); } children.push(perfEvt); } } // Set this event as the active event now perfMgr.setCtx(doPerfActiveKey, perfEvt); return func(perfEvt); } } catch (ex) { if (perfEvt && perfEvt.setCtx) { perfEvt.setCtx("exception", ex); } } finally { // fire the perf event if (perfEvt) { perfMgr.fire(perfEvt); } // Reset the active event to the previous value perfMgr.setCtx(doPerfActiveKey, currentActive); } } } return func(); } /** * Set the global performance manager to use when there is no core instance or it has not been initialized yet. * @param perfManager - The IPerfManager instance to use when no performance manager is supplied. */ export function setGblPerfMgr(perfManager) { _defaultPerfManager = perfManager; } /** * Get the current global performance manager that will be used with no performance manager is supplied. * @returns - The current default manager */ export function getGblPerfMgr() { return _defaultPerfManager; } //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/PerfManager.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ "use strict"; import { safeGetLogger, _throwInternal } from "./DiagnosticLogger"; import { arrForEach, isArray, isFunction, isNullOrUndefined, isObject, isUndefined, objExtend, objForEachKey, objFreeze, objKeys, proxyFunctions } from "./HelperFuncs"; import { doPerf } from "./PerfManager"; import { dumpObj } from "./EnvUtils"; import { strCore, strDisabled, strEmpty, strIsInitialized, strTeardown, strUpdate } from "./InternalConstants"; import { _getPluginState } from "./TelemetryHelpers"; var strTelemetryPluginChain = "TelemetryPluginChain"; var strHasRunFlags = "_hasRun"; var strGetTelCtx = "_getTelCtx"; var _chainId = 0; function _getNextProxyStart(proxy, core, startAt) { while (proxy) { if (proxy.getPlugin() === startAt) { return proxy; } proxy = proxy.getNext(); } // This wasn't found in the existing chain so create an isolated one with just this plugin return createTelemetryProxyChain([startAt], core.config || {}, core); } /** * @ignore * @param telemetryChain * @param config * @param core * @param startAt - Identifies the next plugin to execute, if null there is no "next" plugin and if undefined it should assume the start of the chain * @returns */ function _createInternalContext(telemetryChain, config, core, startAt) { // We have a special case where we want to start execution from this specific plugin // or we simply reuse the existing telemetry plugin chain (normal execution case) var _nextProxy = null; // By Default set as no next plugin var _onComplete = []; if (startAt !== null) { // There is no next element (null) vs not defined (undefined) so use the full chain _nextProxy = startAt ? _getNextProxyStart(telemetryChain, core, startAt) : telemetryChain; } var context = { _next: _moveNext, ctx: { core: function () { return core; }, diagLog: function () { return safeGetLogger(core, config); }, getCfg: function () { return config; }, getExtCfg: _getExtCfg, getConfig: _getConfig, hasNext: function () { return !!_nextProxy; }, getNext: function () { return _nextProxy; }, setNext: function (nextPlugin) { _nextProxy = nextPlugin; }, iterate: _iterateChain, onComplete: _addOnComplete } }; function _addOnComplete(onComplete, that) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } if (onComplete) { _onComplete.push({ func: onComplete, self: !isUndefined(that) ? that : context.ctx, args: args }); } } function _moveNext() { var nextProxy = _nextProxy; // Automatically move to the next plugin _nextProxy = nextProxy ? nextProxy.getNext() : null; if (!nextProxy) { var onComplete = _onComplete; if (onComplete && onComplete.length > 0) { arrForEach(onComplete, function (completeDetails) { try { completeDetails.func.call(completeDetails.self, completeDetails.args); } catch (e) { _throwInternal(core.logger, 2 /* WARNING */, 73 /* PluginException */, "Unexpected Exception during onComplete - " + dumpObj(e)); } }); _onComplete = []; } } return nextProxy; } function _getExtCfg(identifier, defaultValue, mergeDefault) { if (defaultValue === void 0) { defaultValue = {}; } if (mergeDefault === void 0) { mergeDefault = 0 /* None */; } var theConfig; if (config) { var extConfig = config.extensionConfig; if (extConfig && identifier) { theConfig = extConfig[identifier]; } } if (!theConfig) { // Just use the defaults theConfig = defaultValue; } else if (isObject(defaultValue)) { if (mergeDefault !== 0 /* None */) { // Merge the defaults and configured values var newConfig_1 = objExtend(true, defaultValue, theConfig); if (config && mergeDefault === 2 /* MergeDefaultFromRootOrDefault */) { // Enumerate over the defaultValues and if not already populated attempt to // find a value from the root config objForEachKey(defaultValue, function (field) { // for each unspecified field, set the default value if (isNullOrUndefined(newConfig_1[field])) { var cfgValue = config[field]; if (!isNullOrUndefined(cfgValue)) { newConfig_1[field] = cfgValue; } } }); } theConfig = newConfig_1; } } return theConfig; } function _getConfig(identifier, field, defaultValue) { if (defaultValue === void 0) { defaultValue = false; } var theValue; var extConfig = _getExtCfg(identifier, null); if (extConfig && !isNullOrUndefined(extConfig[field])) { theValue = extConfig[field]; } else if (config && !isNullOrUndefined(config[field])) { theValue = config[field]; } return !isNullOrUndefined(theValue) ? theValue : defaultValue; } function _iterateChain(cb) { // Keep processing until we reach the end of the chain var nextPlugin; while (!!(nextPlugin = context._next())) { var plugin = nextPlugin.getPlugin(); if (plugin) { // callback with the current on cb(plugin); } } } return context; } /** * Creates a new Telemetry Item context with the current config, core and plugin execution chain * @param plugins - The plugin instances that will be executed * @param config - The current config * @param core - The current core instance * @param startAt - Identifies the next plugin to execute, if null there is no "next" plugin and if undefined it should assume the start of the chain */ export function createProcessTelemetryContext(telemetryChain, config, core, startAt) { var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(env) { var nextPlugin = internalContext._next(); // Run the next plugin which will call "processNext()" nextPlugin && nextPlugin.processTelemetry(env, context); return !nextPlugin; } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryContext(plugins || context.getNext(), config, core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } /** * Creates a new Telemetry Item context with the current config, core and plugin execution chain for handling the unloading of the chain * @param plugins - The plugin instances that will be executed * @param config - The current config * @param core - The current core instance * @param startAt - Identifies the next plugin to execute, if null there is no "next" plugin and if undefined it should assume the start of the chain */ export function createProcessTelemetryUnloadContext(telemetryChain, core, startAt) { var config = core.config || {}; var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(unloadState) { var nextPlugin = internalContext._next(); nextPlugin && nextPlugin.unload(context, unloadState); return !nextPlugin; } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryUnloadContext(plugins || context.getNext(), core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } /** * Creates a new Telemetry Item context with the current config, core and plugin execution chain for updating the configuration * @param plugins - The plugin instances that will be executed * @param config - The current config * @param core - The current core instance * @param startAt - Identifies the next plugin to execute, if null there is no "next" plugin and if undefined it should assume the start of the chain */ export function createProcessTelemetryUpdateContext(telemetryChain, core, startAt) { var config = core.config || {}; var internalContext = _createInternalContext(telemetryChain, config, core, startAt); var context = internalContext.ctx; function _processNext(updateState) { return context.iterate(function (plugin) { if (isFunction(plugin.update)) { plugin.update(context, updateState); } }); } function _createNew(plugins, startAt) { if (plugins === void 0) { plugins = null; } if (isArray(plugins)) { plugins = createTelemetryProxyChain(plugins, config, core, startAt); } return createProcessTelemetryUpdateContext(plugins || context.getNext(), core, startAt); } context.processNext = _processNext; context.createNew = _createNew; return context; } /** * Creates an execution chain from the array of plugins * @param plugins - The array of plugins that will be executed in this order * @param defItemCtx - The default execution context to use when no telemetry context is passed to processTelemetry(), this * should be for legacy plugins only. Currently, only used for passing the current core instance and to provide better error * reporting (hasRun) when errors occur. */ export function createTelemetryProxyChain(plugins, config, core, startAt) { var firstProxy = null; var add = startAt ? false : true; if (isArray(plugins) && plugins.length > 0) { // Create the proxies and wire up the next plugin chain var lastProxy_1 = null; arrForEach(plugins, function (thePlugin) { if (!add && startAt === thePlugin) { add = true; } if (add && thePlugin && isFunction(thePlugin.processTelemetry)) { // Only add plugins that are processors var newProxy = createTelemetryPluginProxy(thePlugin, config, core); if (!firstProxy) { firstProxy = newProxy; } if (lastProxy_1) { // Set this new proxy as the next for the previous one lastProxy_1._setNext(newProxy); } lastProxy_1 = newProxy; } }); } if (startAt && !firstProxy) { // Special case where the "startAt" was not in the original list of plugins return createTelemetryProxyChain([startAt], config, core); } return firstProxy; } /** * Create the processing telemetry proxy instance, the proxy is used to abstract the current plugin to allow monitoring and * execution plugins while passing around the dynamic execution state (IProcessTelemetryContext), the proxy instance no longer * contains any execution state and can be reused between requests (this was not the case for 2.7.2 and earlier with the * TelemetryPluginChain class). * @param plugin - The plugin instance to proxy * @param config - The default execution context to use when no telemetry context is passed to processTelemetry(), this * should be for legacy plugins only. Currently, only used for passing the current core instance and to provide better error * reporting (hasRun) when errors occur. * @returns */ export function createTelemetryPluginProxy(plugin, config, core) { var nextProxy = null; var hasProcessTelemetry = isFunction(plugin.processTelemetry); var hasSetNext = isFunction(plugin.setNextPlugin); var chainId; if (plugin) { chainId = plugin.identifier + "-" + plugin.priority + "-" + _chainId++; } else { chainId = "Unknown-0-" + _chainId++; } var proxyChain = { getPlugin: function () { return plugin; }, getNext: function () { return nextProxy; }, processTelemetry: _processTelemetry, unload: _unloadPlugin, update: _updatePlugin, _id: chainId, _setNext: function (nextPlugin) { nextProxy = nextPlugin; } }; function _getTelCtx() { var itemCtx; // Looks like a plugin didn't pass the (optional) context, so create a new one if (plugin && isFunction(plugin[strGetTelCtx])) { // This plugin extends from the BaseTelemetryPlugin so lets use it itemCtx = plugin[strGetTelCtx](); } if (!itemCtx) { // Create a temporary one itemCtx = createProcessTelemetryContext(proxyChain, config, core); } return itemCtx; } function _processChain(itemCtx, processPluginFn, name, details, isAsync) { var hasRun = false; var identifier = plugin ? plugin.identifier : strTelemetryPluginChain; var hasRunContext = itemCtx[strHasRunFlags]; if (!hasRunContext) { // Assign and populate hasRunContext = itemCtx[strHasRunFlags] = {}; } // Ensure that we keep the context in sync itemCtx.setNext(nextProxy); if (plugin) { doPerf(itemCtx[strCore](), function () { return identifier + ":" + name; }, function () { // Mark this component as having run hasRunContext[chainId] = true; try { // Set a flag on the next plugin so we know if it was attempted to be executed var nextId = nextProxy ? nextProxy._id : strEmpty; if (nextId) { hasRunContext[nextId] = false; } hasRun = processPluginFn(itemCtx); } catch (error) { var hasNextRun = nextProxy ? hasRunContext[nextProxy._id] : true; if (hasNextRun) { // The next plugin after us has already run so set this one as complete hasRun = true; } if (!nextProxy || !hasNextRun) { // Either we have no next plugin or the current one did not attempt to call the next plugin // Which means the current one is the root of the failure so log/report this failure _throwInternal(itemCtx.diagLog(), 1 /* CRITICAL */, 73 /* PluginException */, "Plugin [" + identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext)); } } }, details, isAsync); } return hasRun; } function _processTelemetry(env, itemCtx) { itemCtx = itemCtx || _getTelCtx(); function _callProcessTelemetry(itemCtx) { if (!plugin || !hasProcessTelemetry) { return false; } var pluginState = _getPluginState(plugin); if (pluginState.teardown || pluginState[strDisabled]) { return false; } // Ensure that we keep the context in sync (for processNext()), just in case a plugin // doesn't calls processTelemetry() instead of itemContext.processNext() or some // other form of error occurred if (hasSetNext) { // Backward compatibility setting the next plugin on the instance plugin.setNextPlugin(nextProxy); } plugin.processTelemetry(env, itemCtx); // Process Telemetry is expected to call itemCtx.processNext() or nextPlugin.processTelemetry() return true; } if (!_processChain(itemCtx, _callProcessTelemetry, "processTelemetry", function () { return ({ item: env }); }, !(env.sync))) { // The underlying plugin is either not defined, not enabled or does not have a processTelemetry implementation // so we still want the next plugin to be executed. itemCtx.processNext(env); } } function _unloadPlugin(unloadCtx, unloadState) { function _callTeardown() { // Setting default of hasRun as false so the proxyProcessFn() is called as teardown() doesn't have to exist or call unloadNext(). var hasRun = false; if (plugin) { var pluginState = _getPluginState(plugin); var pluginCore = plugin[strCore] || pluginState.core; // Only teardown the plugin if it was initialized by the current core (i.e. It's not a shared plugin) if (plugin && (!pluginCore || pluginCore === unloadCtx[strCore]()) && !pluginState[strTeardown]) { // Handle plugins that don't extend from the BaseTelemetryPlugin pluginState[strCore] = null; pluginState[strTeardown] = true; pluginState[strIsInitialized] = false; if (plugin[strTeardown] && plugin[strTeardown](unloadCtx, unloadState) === true) { // plugin told us that it was going to (or has) call unloadCtx.processNext() hasRun = true; } } } return hasRun; } if (!_processChain(unloadCtx, _callTeardown, "unload", function () { }, unloadState.isAsync)) { // Only called if we hasRun was not true unloadCtx.processNext(unloadState); } } function _updatePlugin(updateCtx, updateState) { function _callUpdate() { // Setting default of hasRun as false so the proxyProcessFn() is called as teardown() doesn't have to exist or call unloadNext(). var hasRun = false; if (plugin) { var pluginState = _getPluginState(plugin); var pluginCore = plugin[strCore] || pluginState.core; // Only update the plugin if it was initialized by the current core (i.e. It's not a shared plugin) if (plugin && (!pluginCore || pluginCore === updateCtx[strCore]()) && !pluginState[strTeardown]) { if (plugin[strUpdate] && plugin[strUpdate](updateCtx, updateState) === true) { // plugin told us that it was going to (or has) call unloadCtx.processNext() hasRun = true; } } } return hasRun; } if (!_processChain(updateCtx, _callUpdate, "update", function () { }, false)) { // Only called if we hasRun was not true updateCtx.processNext(updateState); } } return objFreeze(proxyChain); } /** * This class will be removed! * @deprecated use createProcessTelemetryContext() instead */ var ProcessTelemetryContext = /** @class */ (function () { /** * Creates a new Telemetry Item context with the current config, core and plugin execution chain * @param plugins - The plugin instances that will be executed * @param config - The current config * @param core - The current core instance */ function ProcessTelemetryContext(pluginChain, config, core, startAt) { var _self = this; var context = createProcessTelemetryContext(pluginChain, config, core, startAt); // Proxy all functions of the context to this object proxyFunctions(_self, context, objKeys(context)); } return ProcessTelemetryContext; }()); export { ProcessTelemetryContext }; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ import { getCrypto, getMsCrypto, isIE } from "./EnvUtils"; import { dateNow } from "./HelperFuncs"; import { strEmpty } from "./InternalConstants"; var UInt32Mask = 0x100000000; var MaxUInt32 = 0xffffffff; // MWC based Random generator (for IE) var _mwcSeeded = false; var _mwcW = 123456789; var _mwcZ = 987654321; // Takes any integer function _mwcSeed(seedValue) { if (seedValue < 0) { // Make sure we end up with a positive number and not -ve one. seedValue >>>= 0; } _mwcW = (123456789 + seedValue) & MaxUInt32; _mwcZ = (987654321 - seedValue) & MaxUInt32; _mwcSeeded = true; } function _autoSeedMwc() { // Simple initialization using default Math.random() - So we inherit any entropy from the browser // and bitwise XOR with the current milliseconds try { var now = dateNow() & 0x7fffffff; _mwcSeed(((Math.random() * UInt32Mask) ^ now) + now); } catch (e) { // Don't crash if something goes wrong } } /** * Generate a random value between 0 and maxValue, max value should be limited to a 32-bit maximum. * So maxValue(16) will produce a number from 0..16 (range of 17) * @param maxValue */ export function randomValue(maxValue) { if (maxValue > 0) { return Math.floor((random32() / MaxUInt32) * (maxValue + 1)) >>> 0; } return 0; } /** * generate a random 32-bit number (0x000000..0xFFFFFFFF) or (-0x80000000..0x7FFFFFFF), defaults un-unsigned. * @param signed - True to return a signed 32-bit number (-0x80000000..0x7FFFFFFF) otherwise an unsigned one (0x000000..0xFFFFFFFF) */ export function random32(signed) { var value = 0; var c = getCrypto() || getMsCrypto(); if (c && c.getRandomValues) { // Make sure the number is converted into the specified range (-0x80000000..0x7FFFFFFF) value = c.getRandomValues(new Uint32Array(1))[0] & MaxUInt32; } if (value === 0 && isIE()) { // For IE 6, 7, 8 (especially on XP) Math.random is not very random if (!_mwcSeeded) { // Set the seed for the Mwc algorithm _autoSeedMwc(); } // Don't use Math.random for IE // Make sure the number is converted into the specified range (-0x80000000..0x7FFFFFFF) value = mwcRandom32() & MaxUInt32; } if (value === 0) { // Make sure the number is converted into the specified range (-0x80000000..0x7FFFFFFF) value = Math.floor((UInt32Mask * Math.random()) | 0); } if (!signed) { // Make sure we end up with a positive number and not -ve one. value >>>= 0; } return value; } /** * Seed the MWC random number generator with the specified seed or a random value * @param value - optional the number to used as the seed, if undefined, null or zero a random value will be chosen */ export function mwcRandomSeed(value) { if (!value) { _autoSeedMwc(); } else { _mwcSeed(value); } } /** * Generate a random 32-bit number between (0x000000..0xFFFFFFFF) or (-0x80000000..0x7FFFFFFF), using MWC (Multiply with carry) * instead of Math.random() defaults to un-signed. * Used as a replacement random generator for IE to avoid issues with older IE instances. * @param signed - True to return a signed 32-bit number (-0x80000000..0x7FFFFFFF) otherwise an unsigned one (0x000000..0xFFFFFFFF) */ export function mwcRandom32(signed) { _mwcZ = (36969 * (_mwcZ & 0xFFFF) + (_mwcZ >> 16)) & MaxUInt32; _mwcW = (18000 * (_mwcW & 0xFFFF) + (_mwcW >> 16)) & MaxUInt32; var value = (((_mwcZ << 16) + (_mwcW & 0xFFFF)) >>> 0) & MaxUInt32 | 0; if (!signed) { // Make sure we end up with a positive number and not -ve one. value >>>= 0; } return value; } /** * Generate random base64 id string. * The default length is 22 which is 132-bits so almost the same as a GUID but as base64 (the previous default was 5) * @param maxLength - Optional value to specify the length of the id to be generated, defaults to 22 */ export function newId(maxLength) { if (maxLength === void 0) { maxLength = 22; } var base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; // Start with an initial random number, consuming the value in reverse byte order var number = random32() >>> 0; // Make sure it's a +ve number var chars = 0; var result = strEmpty; while (result.length < maxLength) { chars++; result += base64chars.charAt(number & 0x3F); number >>>= 6; // Zero fill with right shift if (chars === 5) { // 5 base64 characters === 30 bits so we don't have enough bits for another base64 char // So add on another 30 bits and make sure it's +ve number = (((random32() << 2) & 0xFFFFFFFF) | (number & 0x03)) >>> 0; chars = 0; // We need to reset the number every 5 chars (30 bits) } } return result; } //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/RandomHelper.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ "use strict"; import { arrForEach, isFunction } from "./HelperFuncs"; import { strCore, strDoTeardown, strIsInitialized, strPriority, strProcessTelemetry, strSetNextPlugin, strTeardown } from "./InternalConstants"; import { createElmNodeData } from "./DataCacheHelper"; var strDoUnload = "_doUnload"; var pluginStateData = createElmNodeData("plugin"); export function _getPluginState(plugin) { return pluginStateData.get(plugin, "state", {}, true); } /** * Initialize the queue of plugins * @param plugins - The array of plugins to initialize and setting of the next plugin * @param config The current config for the instance * @param core THe current core instance * @param extensions The extensions */ export function initializePlugins(processContext, extensions) { // Set the next plugin and identified the uninitialized plugins var initPlugins = []; var lastPlugin = null; var proxy = processContext.getNext(); var pluginState; while (proxy) { var thePlugin = proxy.getPlugin(); if (thePlugin) { if (lastPlugin && isFunction(lastPlugin[strSetNextPlugin]) && isFunction(thePlugin[strProcessTelemetry])) { // Set this plugin as the next for the previous one lastPlugin[strSetNextPlugin](thePlugin); } var isInitialized = false; if (isFunction(thePlugin[strIsInitialized])) { isInitialized = thePlugin[strIsInitialized](); } else { pluginState = _getPluginState(thePlugin); isInitialized = pluginState[strIsInitialized]; } if (!isInitialized) { initPlugins.push(thePlugin); } lastPlugin = thePlugin; proxy = proxy.getNext(); } } // Now initialize the plugins arrForEach(initPlugins, function (thePlugin) { var core = processContext.core(); thePlugin.initialize(processContext.getCfg(), core, extensions, processContext.getNext()); pluginState = _getPluginState(thePlugin); // Only add the core to the state if the plugin didn't set it (doesn't extent from BaseTelemetryPlugin) if (!thePlugin[strCore] && !pluginState[strCore]) { pluginState[strCore] = core; } pluginState[strIsInitialized] = true; delete pluginState[strTeardown]; }); } export function sortPlugins(plugins) { // Sort by priority return plugins.sort(function (extA, extB) { var result = 0; var bHasProcess = isFunction(extB[strProcessTelemetry]); if (isFunction(extA[strProcessTelemetry])) { result = bHasProcess ? extA[strPriority] - extB[strPriority] : 1; } else if (bHasProcess) { result = -1; } return result; }); // sort complete } /** * Teardown / Unload helper to perform teardown/unloading operations for the provided components synchronously or asynchronously, this will call any * _doTeardown() or _doUnload() functions on the provided components to allow them to finish removal. * @param components - The components you want to unload * @param unloadCtx - This is the context that should be used during unloading. * @param unloadState - The details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload. * @param asyncCallback - An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async unload/teardown operations. * @returns boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations. */ export function unloadComponents(components, unloadCtx, unloadState, asyncCallback) { var idx = 0; function _doUnload() { while (idx < components.length) { var component = components[idx++]; if (component) { var func = component[strDoUnload] || component[strDoTeardown]; if (isFunction(func)) { if (func.call(component, unloadCtx, unloadState, _doUnload) === true) { return true; } } } } } return _doUnload(); } //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/TelemetryHelpers.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ // // import { __extendsFn as __extends } from "@microsoft/applicationinsights-shims"; import dynamicProto from "@microsoft/dynamicproto-js"; import { BaseTelemetryPlugin } from "./BaseTelemetryPlugin"; import { _throwInternal } from "./DiagnosticLogger"; import { dumpObj } from "./EnvUtils"; import { arrForEach, getExceptionName } from "./HelperFuncs"; import { strDoTeardown } from "./InternalConstants"; var TelemetryInitializerPlugin = /** @class */ (function (_super) { __extends(TelemetryInitializerPlugin, _super); function TelemetryInitializerPlugin() { var _this = _super.call(this) || this; _this.identifier = "TelemetryInitializerPlugin"; _this.priority = 199; // NOTE!: DON'T set default values here, instead set them in the _initDefaults() function as it is also called during teardown() var _id; var _initializers; _initDefaults(); dynamicProto(TelemetryInitializerPlugin, _this, function (_self, _base) { _self.addTelemetryInitializer = function (telemetryInitializer) { var theInitializer = { id: _id++, fn: telemetryInitializer }; _initializers.push(theInitializer); var handler = { remove: function () { arrForEach(_initializers, function (initializer, idx) { if (initializer.id === theInitializer.id) { _initializers.splice(idx, 1); return -1; } }); } }; return handler; }; _self.processTelemetry = function (item, itemCtx) { var doNotSendItem = false; var telemetryInitializersCount = _initializers.length; for (var i = 0; i < telemetryInitializersCount; ++i) { var telemetryInitializer = _initializers[i]; if (telemetryInitializer) { try { if (telemetryInitializer.fn.apply(null, [item]) === false) { doNotSendItem = true; break; } } catch (e) { // log error but dont stop executing rest of the telemetry initializers // doNotSendItem = true; _throwInternal(itemCtx.diagLog(), 1 /* CRITICAL */, 64 /* TelemetryInitializerFailed */, "One of telemetry initializers failed, telemetry item will not be sent: " + getExceptionName(e), { exception: dumpObj(e) }, true); } } } if (!doNotSendItem) { _self.processNext(item, itemCtx); } }; _self[strDoTeardown] = function () { _initDefaults(); }; }); function _initDefaults() { _id = 0; _initializers = []; } return _this; } // Removed Stub for TelemetryInitializerPlugin.prototype.addTelemetryInitializer. // Removed Stub for TelemetryInitializerPlugin.prototype.processTelemetry. return TelemetryInitializerPlugin; }(BaseTelemetryPlugin)); export { TelemetryInitializerPlugin }; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/TelemetryInitializerPlugin.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ import { _throwInternal } from "./DiagnosticLogger"; import { dumpObj } from "./EnvUtils"; import { arrForEach } from "./HelperFuncs"; export function createUnloadHandlerContainer() { var handlers = []; function _addHandler(handler) { if (handler) { handlers.push(handler); } } function _runHandlers(unloadCtx, unloadState) { arrForEach(handlers, function (handler) { try { handler(unloadCtx, unloadState); } catch (e) { _throwInternal(unloadCtx.diagLog(), 2 /* WARNING */, 73 /* PluginException */, "Unexpected error calling unload handler - " + dumpObj(e)); } }); handlers = []; } return { add: _addHandler, run: _runHandlers }; } //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/UnloadHandlerContainer.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ import { objForEachKey, deepFreeze } from "../JavaScriptSDK/HelperFuncs"; /** * Create an enum style object which has both the key => value and value => key mappings * @param values - The values to populate on the new object * @returns */ export function createEnumStyle(values) { var enumClass = {}; objForEachKey(values, function (field, value) { enumClass[field] = value; enumClass[value] = field; }); return deepFreeze(enumClass); } /** * Create a 2 index map that maps an enum's key as both the key and value, X["key"] => "key" and X[0] => "keyof 0". * @param values - The values to populate on the new object * @returns */ export function createEnumMap(values) { var mapClass = {}; objForEachKey(values, function (field, value) { mapClass[field] = field; mapClass[value] = field; }); return deepFreeze(mapClass); } /** * Create a 2 index map that maps an enum's key and value to the defined map value, X["key"] => mapValue and X[0] => mapValue. * Generic values * - E = the const enum type (typeof eRequestHeaders); * - V = Identifies the valid values for the keys, this should include both the enum numeric and string key of the type. The * resulting "Value" of each entry identifies the valid values withing the assignments. * @param values - The values to populate on the new object * @returns */ export function createValueMap(values) { var mapClass = {}; objForEachKey(values, function (field, value) { mapClass[field] = value[1]; mapClass[value[0]] = value[1]; }); return deepFreeze(mapClass); } //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Enums/EnumHelperFuncs.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ import { createEnumStyle } from "../JavaScriptSDK.Enums/EnumHelperFuncs"; /** * The EventsDiscardedReason enumeration contains a set of values that specify the reason for discarding an event. */ export var EventsDiscardedReason = createEnumStyle({ /** * Unknown. */ Unknown: 0 /* Unknown */, /** * Status set to non-retryable. */ NonRetryableStatus: 1 /* NonRetryableStatus */, /** * The event is invalid. */ InvalidEvent: 2 /* InvalidEvent */, /** * The size of the event is too large. */ SizeLimitExceeded: 3 /* SizeLimitExceeded */, /** * The server is not accepting events from this instrumentation key. */ KillSwitch: 4 /* KillSwitch */, /** * The event queue is full. */ QueueFull: 5 /* QueueFull */ }); //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Enums/EventsDiscardedReason.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ import { createEnumStyle } from "../JavaScriptSDK.Enums/EnumHelperFuncs"; export var LoggingSeverity = createEnumStyle({ CRITICAL: 1 /* CRITICAL */, WARNING: 2 /* WARNING */ }); /** * Internal message ID. Please create a new one for every conceptually different message. Please keep alphabetically ordered */ export var _InternalMessageId = createEnumStyle({ // Non user actionable BrowserDoesNotSupportLocalStorage: 0 /* BrowserDoesNotSupportLocalStorage */, BrowserCannotReadLocalStorage: 1 /* BrowserCannotReadLocalStorage */, BrowserCannotReadSessionStorage: 2 /* BrowserCannotReadSessionStorage */, BrowserCannotWriteLocalStorage: 3 /* BrowserCannotWriteLocalStorage */, BrowserCannotWriteSessionStorage: 4 /* BrowserCannotWriteSessionStorage */, BrowserFailedRemovalFromLocalStorage: 5 /* BrowserFailedRemovalFromLocalStorage */, BrowserFailedRemovalFromSessionStorage: 6 /* BrowserFailedRemovalFromSessionStorage */, CannotSendEmptyTelemetry: 7 /* CannotSendEmptyTelemetry */, ClientPerformanceMathError: 8 /* ClientPerformanceMathError */, ErrorParsingAISessionCookie: 9 /* ErrorParsingAISessionCookie */, ErrorPVCalc: 10 /* ErrorPVCalc */, ExceptionWhileLoggingError: 11 /* ExceptionWhileLoggingError */, FailedAddingTelemetryToBuffer: 12 /* FailedAddingTelemetryToBuffer */, FailedMonitorAjaxAbort: 13 /* FailedMonitorAjaxAbort */, FailedMonitorAjaxDur: 14 /* FailedMonitorAjaxDur */, FailedMonitorAjaxOpen: 15 /* FailedMonitorAjaxOpen */, FailedMonitorAjaxRSC: 16 /* FailedMonitorAjaxRSC */, FailedMonitorAjaxSend: 17 /* FailedMonitorAjaxSend */, FailedMonitorAjaxGetCorrelationHeader: 18 /* FailedMonitorAjaxGetCorrelationHeader */, FailedToAddHandlerForOnBeforeUnload: 19 /* FailedToAddHandlerForOnBeforeUnload */, FailedToSendQueuedTelemetry: 20 /* FailedToSendQueuedTelemetry */, FailedToReportDataLoss: 21 /* FailedToReportDataLoss */, FlushFailed: 22 /* FlushFailed */, MessageLimitPerPVExceeded: 23 /* MessageLimitPerPVExceeded */, MissingRequiredFieldSpecification: 24 /* MissingRequiredFieldSpecification */, NavigationTimingNotSupported: 25 /* NavigationTimingNotSupported */, OnError: 26 /* OnError */, SessionRenewalDateIsZero: 27 /* SessionRenewalDateIsZero */, SenderNotInitialized: 28 /* SenderNotInitialized */, StartTrackEventFailed: 29 /* StartTrackEventFailed */, StopTrackEventFailed: 30 /* StopTrackEventFailed */, StartTrackFailed: 31 /* StartTrackFailed */, StopTrackFailed: 32 /* StopTrackFailed */, TelemetrySampledAndNotSent: 33 /* TelemetrySampledAndNotSent */, TrackEventFailed: 34 /* TrackEventFailed */, TrackExceptionFailed: 35 /* TrackExceptionFailed */, TrackMetricFailed: 36 /* TrackMetricFailed */, TrackPVFailed: 37 /* TrackPVFailed */, TrackPVFailedCalc: 38 /* TrackPVFailedCalc */, TrackTraceFailed: 39 /* TrackTraceFailed */, TransmissionFailed: 40 /* TransmissionFailed */, FailedToSetStorageBuffer: 41 /* FailedToSetStorageBuffer */, FailedToRestoreStorageBuffer: 42 /* FailedToRestoreStorageBuffer */, InvalidBackendResponse: 43 /* InvalidBackendResponse */, FailedToFixDepricatedValues: 44 /* FailedToFixDepricatedValues */, InvalidDurationValue: 45 /* InvalidDurationValue */, TelemetryEnvelopeInvalid: 46 /* TelemetryEnvelopeInvalid */, CreateEnvelopeError: 47 /* CreateEnvelopeError */, // User actionable CannotSerializeObject: 48 /* CannotSerializeObject */, CannotSerializeObjectNonSerializable: 49 /* CannotSerializeObjectNonSerializable */, CircularReferenceDetected: 50 /* CircularReferenceDetected */, ClearAuthContextFailed: 51 /* ClearAuthContextFailed */, ExceptionTruncated: 52 /* ExceptionTruncated */, IllegalCharsInName: 53 /* IllegalCharsInName */, ItemNotInArray: 54 /* ItemNotInArray */, MaxAjaxPerPVExceeded: 55 /* MaxAjaxPerPVExceeded */, MessageTruncated: 56 /* MessageTruncated */, NameTooLong: 57 /* NameTooLong */, SampleRateOutOfRange: 58 /* SampleRateOutOfRange */, SetAuthContextFailed: 59 /* SetAuthContextFailed */, SetAuthContextFailedAccountName: 60 /* SetAuthContextFailedAccountName */, StringValueTooLong: 61 /* StringValueTooLong */, StartCalledMoreThanOnce: 62 /* StartCalledMoreThanOnce */, StopCalledWithoutStart: 63 /* StopCalledWithoutStart */, TelemetryInitializerFailed: 64 /* TelemetryInitializerFailed */, TrackArgumentsNotSpecified: 65 /* TrackArgumentsNotSpecified */, UrlTooLong: 66 /* UrlTooLong */, SessionStorageBufferFull: 67 /* SessionStorageBufferFull */, CannotAccessCookie: 68 /* CannotAccessCookie */, IdTooLong: 69 /* IdTooLong */, InvalidEvent: 70 /* InvalidEvent */, FailedMonitorAjaxSetRequestHeader: 71 /* FailedMonitorAjaxSetRequestHeader */, SendBrowserInfoOnUserInit: 72 /* SendBrowserInfoOnUserInit */, PluginException: 73 /* PluginException */, NotificationException: 74 /* NotificationException */, SnippetScriptLoadFailure: 99 /* SnippetScriptLoadFailure */, InvalidInstrumentationKey: 100 /* InvalidInstrumentationKey */, CannotParseAiBlobValue: 101 /* CannotParseAiBlobValue */, InvalidContentBlob: 102 /* InvalidContentBlob */, TrackPageActionEventFailed: 103 /* TrackPageActionEventFailed */, FailedAddingCustomDefinedRequestContext: 104 /* FailedAddingCustomDefinedRequestContext */, InMemoryStorageBufferFull: 105 /* InMemoryStorageBufferFull */ }); //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ export {}; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Enums/SendRequestReason.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ export {}; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Enums/TelemetryUnloadReason.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ export {}; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Enums/TelemetryUpdateReason.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ export {}; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/IAppInsightsCore.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ "use strict"; export var MinChannelPriorty = 100; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/IChannelControls.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ "use strict"; export {}; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/IConfiguration.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ export {}; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/ICookieMgr.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ export {}; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/IDbgExtension.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ "use strict"; export {}; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/IDiagnosticLogger.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ export {}; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/IInstrumentHooks.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ "use strict"; export {}; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/INotificationListener.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ export {}; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/INotificationManager.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ export {}; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/IPerfEvent.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ export {}; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/IPerfManager.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ "use strict"; export {}; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/IProcessTelemetryContext.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ export {}; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/ITelemetryInitializers.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ "use strict"; export {}; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/ITelemetryItem.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ "use strict"; export {}; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPlugin.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ export {}; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPluginChain.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ export {}; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUnloadState.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ export {}; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUpdateState.js.map/* * Application Insights JavaScript SDK - Core, 2.8.3 * Copyright (c) Microsoft and contributors. All rights reserved. */ export {}; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/IUnloadableComponent.js.map MIT License Copyright (c) Microsoft Corporation. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE { "name": "@microsoft/applicationinsights-shims", "author": "Microsoft Application Insights Team", "version": "2.0.1", "description": "Microsoft Application Insights JavaScript SDK - Shim functions", "homepage": "https://github.com/microsoft/ApplicationInsights-JS/tree/master/tools/shims", "keywords": [ "azure", "cloud", "microsoft", "application insights", "tslib", "es3" ], "main": "dist/umd/applicationinsights-shims.js", "module": "dist-esm/applicationinsights-shims.js", "types": "types/applicationinsights-shims.d.ts", "scripts": { "clean": "grunt clean", "build": "npm run build:esm && npm run build:bundle", "build:esm": "grunt shims", "build:bundle": "rollup -c rollup.config.js", "rebuild": "npm run build", "test": "grunt shimstest", "lint": "tslint -p tsconfig.json" }, "repository": { "type": "git", "url": "https://github.com/microsoft/ApplicationInsights-JS/tree/master/tools/shims" }, "license": "MIT", "sideEffects": [ "**/TsLibGlobals.js", "**/TsLibGlobals.ts" ], "devDependencies": { "@microsoft/ai-test-framework": "0.0.1", "@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0", "@microsoft/applicationinsights-rollup-es3" : "1.1.3", "grunt": "^1.4.1", "grunt-cli": "^1.4.3", "grunt-contrib-qunit": "^5.0.1", "@nevware21/grunt-ts-plugin": "^0.4.3", "@nevware21/grunt-eslint-ts": "^0.2.2", "@rollup/plugin-commonjs": "^18.0.0", "@rollup/plugin-node-resolve": "^11.2.1", "@rollup/plugin-replace": "^2.3.3", "rollup-plugin-minify-es": "^1.1.1", "rollup": "^2.32.0", "typescript": "^4.3.4" }, "dependencies": { } } { "compilerOptions": { "sourceMap": true, "inlineSources": true, "noImplicitAny": true, "module": "es6", "moduleResolution": "node", "target": "es3", "forceConsistentCasingInFileNames": true, "importHelpers": false, "noEmitHelpers": true, "alwaysStrict": true, "declaration": true, "declarationDir": "tools/shims/types", "outDir": "./dist-esm", "rootDir": "tools/shims/src", "suppressImplicitAnyIndexErrors": true, "allowSyntheticDefaultImports": true }, "include": [ "./src/**/*.ts" ], "exclude": ["./node_modules/**"] }/*! * Microsoft Application Insights JavaScript SDK - Shim functions, 2.0.1 * Copyright (c) Microsoft and contributors. All rights reserved. */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.Microsoft = global.Microsoft || {}, global.Microsoft.ApplicationInsights = global.Microsoft.ApplicationInsights || {}, global.Microsoft.ApplicationInsights.Shims = {}))); })(this, (function (exports) { 'use strict'; var strShimFunction = "function"; var strShimObject = "object"; var strShimUndefined = "undefined"; var strShimPrototype = "prototype"; var strShimHasOwnProperty = "hasOwnProperty"; var strDefault = "default"; var ObjClass = Object; var ObjProto = ObjClass[strShimPrototype]; var ObjAssign = ObjClass["assign"]; var ObjCreate = ObjClass["create"]; var ObjDefineProperty = ObjClass["defineProperty"]; var ObjHasOwnProperty = ObjProto[strShimHasOwnProperty]; var _cachedGlobal = null; /** * Returns the current global scope object, for a normal web page this will be the current * window, for a Web Worker this will be current worker global scope via "self". The internal * implementation returns the first available instance object in the following order * - globalThis (New standard) * - self (Will return the current window instance for supported browsers) * - window (fallback for older browser implementations) * - global (NodeJS standard) * - (When all else fails) * While the return type is a Window for the normal case, not all environments will support all * of the properties or functions. */ function getGlobal(useCached) { if (useCached === void 0) { useCached = true; } if (!_cachedGlobal || !useCached) { if (typeof globalThis !== strShimUndefined && globalThis) { _cachedGlobal = globalThis; } if (typeof self !== strShimUndefined && self) { _cachedGlobal = self; } if (typeof window !== strShimUndefined && window) { _cachedGlobal = window; } if (typeof global !== strShimUndefined && global) { _cachedGlobal = global; } } return _cachedGlobal; } function throwTypeError(message) { throw new TypeError(message); } /** * Creates an object that has the specified prototype, and that optionally contains specified properties. This helper exists to avoid adding a polyfil * for older browsers that do not define Object.create eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation. * Note: For consistency this will not use the Object.create implementation if it exists as this would cause a testing requirement to test with and without the implementations * @param obj Object to use as a prototype. May be null */ function objCreateFn(obj) { var func = ObjCreate; // Use build in Object.create if (func) { // Use Object create method if it exists return func(obj); } if (obj == null) { return {}; } var type = typeof obj; if (type !== strShimObject && type !== strShimFunction) { throwTypeError("Object prototype may only be an Object:" + obj); } function tmpFunc() { } tmpFunc[strShimPrototype] = obj; return new tmpFunc(); } // Most of these functions have been directly shamelessly "lifted" from the https://github.com/@microsoft/tslib and // modified to be ES3 compatible and applying several minification and tree-shaking techniques so that Application Insights // can successfully use TypeScript "importHelpers" which imports tslib during compilation but it will use these at runtime // Which is also why all of the functions have not been included as Application Insights currently doesn't use or require // them. var SymbolObj = (getGlobal() || {})["Symbol"]; var ReflectObj = (getGlobal() || {})["Reflect"]; var __hasReflect = !!ReflectObj; var strDecorate = "decorate"; var strMetadata = "metadata"; var strGetOwnPropertySymbols = "getOwnPropertySymbols"; var strIterator = "iterator"; var __objAssignFnImpl = function (t) { // tslint:disable-next-line: ban-comma-operator for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) { if (ObjProto[strShimHasOwnProperty].call(s, p)) { t[p] = s[p]; } } } return t; }; var __assignFn = ObjAssign || __objAssignFnImpl; // tslint:disable-next-line: only-arrow-functions var extendStaticsFn = function (d, b) { extendStaticsFn = ObjClass["setPrototypeOf"] || // tslint:disable-next-line: only-arrow-functions ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || // tslint:disable-next-line: only-arrow-functions function (d, b) { for (var p in b) { if (b[strShimHasOwnProperty](p)) { d[p] = b[p]; } } }; return extendStaticsFn(d, b); }; function __extendsFn(d, b) { if (typeof b !== strShimFunction && b !== null) { throwTypeError("Class extends value " + String(b) + " is not a constructor or null"); } extendStaticsFn(d, b); function __() { this.constructor = d; } // tslint:disable-next-line: ban-comma-operator d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new __()); } function __restFn(s, e) { var t = {}; for (var k in s) { if (ObjHasOwnProperty.call(s, k) && e.indexOf(k) < 0) { t[k] = s[k]; } } if (s != null && typeof ObjClass[strGetOwnPropertySymbols] === strShimFunction) { for (var i = 0, p = ObjClass[strGetOwnPropertySymbols](s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && ObjProto["propertyIsEnumerable"].call(s, p[i])) { t[p[i]] = s[p[i]]; } } } return t; } function __decorateFn(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = ObjClass["getOwnPropertyDescriptor"](target, key) : desc, d; if (__hasReflect && typeof ReflectObj[strDecorate] === strShimFunction) { r = ReflectObj[strDecorate](decorators, target, key, desc); } else { for (var i = decorators.length - 1; i >= 0; i--) { // eslint-disable-next-line no-cond-assign if (d = decorators[i]) { r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; } } } // tslint:disable-next-line:ban-comma-operator return c > 3 && r && ObjDefineProperty(target, key, r), r; } function __paramFn(paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); }; } function __metadataFn(metadataKey, metadataValue) { if (__hasReflect && ReflectObj[strMetadata] === strShimFunction) { return ReflectObj[strMetadata](metadataKey, metadataValue); } } function __exportStarFn(m, o) { for (var p in m) { if (p !== strDefault && !ObjHasOwnProperty.call(o, p)) { __createBindingFn(o, m, p); } } } function __createBindingFn(o, m, k, k2) { if (k2 === undefined) { k2 = k; } if (ObjCreate) { ObjDefineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } }); } else { o[k2] = m[k]; } } function __valuesFn(o) { var s = typeof SymbolObj === strShimFunction && SymbolObj[strIterator], m = s && o[s], i = 0; if (m) { return m.call(o); } if (o && typeof o.length === "number") { return { next: function () { if (o && i >= o.length) { o = void 0; } return { value: o && o[i++], done: !o }; } }; } throwTypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); } function __readFn(o, n) { var m = typeof SymbolObj === strShimFunction && o[SymbolObj[strIterator]]; if (!m) { return o; } var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) { ar.push(r.value); } } catch (error) { e = { error: error }; } finally { try { // tslint:disable-next-line:no-conditional-assignment if (r && !r.done && (m = i["return"])) { m.call(i); } } finally { if (e) { // eslint-disable-next-line no-unsafe-finally throw e.error; } } } return ar; } /** @deprecated */ function __spreadArraysFn() { var theArgs = arguments; // Calculate new total size for (var s = 0, i = 0, il = theArgs.length; i < il; i++) { s += theArgs[i].length; } // Create new full array for (var r = Array(s), k = 0, i = 0; i < il; i++) { for (var a = theArgs[i], j = 0, jl = a.length; j < jl; j++, k++) { r[k] = a[j]; } } return r; } function __spreadArrayFn(to, from) { for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) { to[j] = from[i]; } return to; } function __makeTemplateObjectFn(cooked, raw) { if (ObjDefineProperty) { ObjDefineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; } function __importStarFn(mod) { if (mod && mod.__esModule) { return mod; } var result = {}; if (mod != null) { for (var k in mod) { if (k !== strDefault && Object.prototype.hasOwnProperty.call(mod, k)) { __createBindingFn(result, mod, k); } } } // Set default module if (ObjCreate) { ObjDefineProperty(result, strDefault, { enumerable: true, value: mod }); } else { result[strDefault] = mod; } return result; } function __importDefaultFn(mod) { return (mod && mod.__esModule) ? mod : { strDefault: mod }; } function __exposeGlobalTsLib() { var globalObj = getGlobal() || {}; // tslint:disable: only-arrow-functions (function (root, assignFn, extendsFn, createBindingFn) { // Assign the globally scoped versions of the functions -- used when consuming individual ts files // If check is to support NativeScript where these are marked as readonly if (!root.__assign) { root.__assign = ObjAssign || assignFn; } if (!root.__extends) { root.__extends = extendsFn; } if (!root.__createBinding) { root.__createBinding = createBindingFn; } })(globalObj, __assignFn, __extendsFn, __createBindingFn); // Assign local variables that will be used for embedded scenarios, if check is to support NativeScript where these are marked as readonly if (!__assign) { __assign = globalObj.__assign; } if (!__extends) { __extends = globalObj.__extends; } if (!__createBinding) { __createBinding = globalObj.__createBinding; } } exports.ObjAssign = ObjAssign; exports.ObjClass = ObjClass; exports.ObjCreate = ObjCreate; exports.ObjDefineProperty = ObjDefineProperty; exports.ObjHasOwnProperty = ObjHasOwnProperty; exports.ObjProto = ObjProto; exports.__assignFn = __assignFn; exports.__createBindingFn = __createBindingFn; exports.__decorateFn = __decorateFn; exports.__exportStarFn = __exportStarFn; exports.__exposeGlobalTsLib = __exposeGlobalTsLib; exports.__extendsFn = __extendsFn; exports.__importDefaultFn = __importDefaultFn; exports.__importStarFn = __importStarFn; exports.__makeTemplateObjectFn = __makeTemplateObjectFn; exports.__metadataFn = __metadataFn; exports.__paramFn = __paramFn; exports.__readFn = __readFn; exports.__restFn = __restFn; exports.__spreadArrayFn = __spreadArrayFn; exports.__spreadArraysFn = __spreadArraysFn; exports.__valuesFn = __valuesFn; exports.getGlobal = getGlobal; exports.objCreateFn = objCreateFn; exports.strDefault = strDefault; exports.strShimFunction = strShimFunction; exports.strShimHasOwnProperty = strShimHasOwnProperty; exports.strShimObject = strShimObject; exports.strShimPrototype = strShimPrototype; exports.strShimUndefined = strShimUndefined; exports.throwTypeError = throwTypeError; (function(obj, prop, descriptor) { /* ai_es3_polyfil defineProperty */ var func = Object["defineProperty"]; if (func) { try { return func(obj, prop, descriptor); } catch(e) { /* IE8 defines defineProperty, but will throw */ } } if (descriptor && typeof descriptor.value !== undefined) { obj[prop] = descriptor.value; } return obj; })(exports, '__esModule', { value: true }); })); /*! * Microsoft Application Insights JavaScript SDK - Shim functions, 2.0.1 * Copyright (c) Microsoft and contributors. All rights reserved. */ var e=this,n=function(e){"use strict";var f="function",a="object",n="undefined",r="prototype",l="hasOwnProperty",o="default",u=Object,_=u[r],d=u.assign,i=u.create,s=u.defineProperty,p=_[l],t=null;function y(e){return void 0===e&&(e=!0),t&&e||(typeof globalThis!=n&&globalThis&&(t=globalThis),typeof self!=n&&self&&(t=self),typeof window!=n&&window&&(t=window),typeof global!=n&&global&&(t=global)),t}function g(e){throw new TypeError(e)}function b(e){if(i)return i(e);if(null==e)return{};var n=typeof e;function t(){}return n!==a&&n!==f&&g("Object prototype may only be an Object:"+e),t[r]=e,new t}var v=(y()||{}).Symbol,c=(y()||{}).Reflect,h=!!c,m="decorate",O="metadata",w="getOwnPropertySymbols",j="iterator",F=d||function(e){for(var n,t=1,r=arguments.length;t=e.length?void 0:e)&&e[r++],done:!e}}}:void g(n?"Object is not iterable.":"Symbol.iterator is not defined.")},e.getGlobal=y,e.objCreateFn=b,e.strDefault=o,e.strShimFunction=f,e.strShimHasOwnProperty=l,e.strShimObject=a,e.strShimPrototype=r,e.strShimUndefined=n,e.throwTypeError=g;var T="__esModule",A={value:!0},M=Object.defineProperty;if(M)try{return void M(e,T,A)}catch(B){}typeof A.value!==undefined&&(e[T]=A.value)};"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(((e="undefined"!=typeof globalThis?globalThis:e||self).Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights=e.Microsoft.ApplicationInsights||{},e.Microsoft.ApplicationInsights.Shims={})); // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. export { strShimFunction, strShimObject, strShimUndefined, strShimPrototype, strShimHasOwnProperty, strDefault, ObjClass, ObjProto, ObjAssign, ObjCreate, ObjDefineProperty, ObjHasOwnProperty } from "./Constants"; export { throwTypeError, objCreateFn, getGlobal } from "./Helpers"; export { __assignFn, __extendsFn, __restFn, __spreadArrayFn, __spreadArraysFn, __decorateFn, __paramFn, __metadataFn, __createBindingFn, __valuesFn, __readFn, __makeTemplateObjectFn, __importDefaultFn, __importStarFn, __exportStarFn } from "./TsLibShims"; export { __exposeGlobalTsLib } from "./TsLibGlobals"; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-shims/dist-esm/applicationinsights-shims.js.map// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. export var strShimFunction = "function"; export var strShimObject = "object"; export var strShimUndefined = "undefined"; export var strShimPrototype = "prototype"; export var strShimHasOwnProperty = "hasOwnProperty"; export var strDefault = "default"; export var ObjClass = Object; export var ObjProto = ObjClass[strShimPrototype]; export var ObjAssign = ObjClass["assign"]; export var ObjCreate = ObjClass["create"]; export var ObjDefineProperty = ObjClass["defineProperty"]; export var ObjHasOwnProperty = ObjProto[strShimHasOwnProperty]; //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-shims/dist-esm/Constants.js.map// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { ObjCreate, strShimFunction, strShimObject, strShimPrototype, strShimUndefined } from "./Constants"; var _cachedGlobal = null; /** * Returns the current global scope object, for a normal web page this will be the current * window, for a Web Worker this will be current worker global scope via "self". The internal * implementation returns the first available instance object in the following order * - globalThis (New standard) * - self (Will return the current window instance for supported browsers) * - window (fallback for older browser implementations) * - global (NodeJS standard) * - (When all else fails) * While the return type is a Window for the normal case, not all environments will support all * of the properties or functions. */ export function getGlobal(useCached) { if (useCached === void 0) { useCached = true; } if (!_cachedGlobal || !useCached) { if (typeof globalThis !== strShimUndefined && globalThis) { _cachedGlobal = globalThis; } if (typeof self !== strShimUndefined && self) { _cachedGlobal = self; } if (typeof window !== strShimUndefined && window) { _cachedGlobal = window; } if (typeof global !== strShimUndefined && global) { _cachedGlobal = global; } } return _cachedGlobal; } export function throwTypeError(message) { throw new TypeError(message); } /** * Creates an object that has the specified prototype, and that optionally contains specified properties. This helper exists to avoid adding a polyfil * for older browsers that do not define Object.create eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation. * Note: For consistency this will not use the Object.create implementation if it exists as this would cause a testing requirement to test with and without the implementations * @param obj Object to use as a prototype. May be null */ export function objCreateFn(obj) { var func = ObjCreate; // Use build in Object.create if (func) { // Use Object create method if it exists return func(obj); } if (obj == null) { return {}; } var type = typeof obj; if (type !== strShimObject && type !== strShimFunction) { throwTypeError("Object prototype may only be an Object:" + obj); } function tmpFunc() { } tmpFunc[strShimPrototype] = obj; return new tmpFunc(); } //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-shims/dist-esm/Helpers.js.map// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { ObjAssign } from "./Constants"; import { getGlobal } from "./Helpers"; import { __assignFn, __createBindingFn, __extendsFn } from "./TsLibShims"; export function __exposeGlobalTsLib() { var globalObj = getGlobal() || {}; // tslint:disable: only-arrow-functions (function (root, assignFn, extendsFn, createBindingFn) { // Assign the globally scoped versions of the functions -- used when consuming individual ts files // If check is to support NativeScript where these are marked as readonly if (!root.__assign) { root.__assign = ObjAssign || assignFn; } if (!root.__extends) { root.__extends = extendsFn; } if (!root.__createBinding) { root.__createBinding = createBindingFn; } })(globalObj, __assignFn, __extendsFn, __createBindingFn); // Assign local variables that will be used for embedded scenarios, if check is to support NativeScript where these are marked as readonly if (!__assign) { __assign = globalObj.__assign; } if (!__extends) { __extends = globalObj.__extends; } if (!__createBinding) { __createBinding = globalObj.__createBinding; } } //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-shims/dist-esm/TsLibGlobals.js.map// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { ObjAssign, ObjClass, ObjCreate, ObjDefineProperty, ObjHasOwnProperty, ObjProto, strDefault, strShimFunction, strShimHasOwnProperty, strShimPrototype } from "./Constants"; import { getGlobal, objCreateFn, throwTypeError } from "./Helpers"; // Most of these functions have been directly shamelessly "lifted" from the https://github.com/@microsoft/tslib and // modified to be ES3 compatible and applying several minification and tree-shaking techniques so that Application Insights // can successfully use TypeScript "importHelpers" which imports tslib during compilation but it will use these at runtime // Which is also why all of the functions have not been included as Application Insights currently doesn't use or require // them. export var SymbolObj = (getGlobal() || {})["Symbol"]; export var ReflectObj = (getGlobal() || {})["Reflect"]; export var __hasSymbol = !!SymbolObj; export var __hasReflect = !!ReflectObj; var strDecorate = "decorate"; var strMetadata = "metadata"; var strGetOwnPropertySymbols = "getOwnPropertySymbols"; var strIterator = "iterator"; export var __objAssignFnImpl = function (t) { // tslint:disable-next-line: ban-comma-operator for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) { if (ObjProto[strShimHasOwnProperty].call(s, p)) { t[p] = s[p]; } } } return t; }; export var __assignFn = ObjAssign || __objAssignFnImpl; // tslint:disable-next-line: only-arrow-functions var extendStaticsFn = function (d, b) { extendStaticsFn = ObjClass["setPrototypeOf"] || // tslint:disable-next-line: only-arrow-functions ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || // tslint:disable-next-line: only-arrow-functions function (d, b) { for (var p in b) { if (b[strShimHasOwnProperty](p)) { d[p] = b[p]; } } }; return extendStaticsFn(d, b); }; export function __extendsFn(d, b) { if (typeof b !== strShimFunction && b !== null) { throwTypeError("Class extends value " + String(b) + " is not a constructor or null"); } extendStaticsFn(d, b); function __() { this.constructor = d; } // tslint:disable-next-line: ban-comma-operator d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new __()); } export function __restFn(s, e) { var t = {}; for (var k in s) { if (ObjHasOwnProperty.call(s, k) && e.indexOf(k) < 0) { t[k] = s[k]; } } if (s != null && typeof ObjClass[strGetOwnPropertySymbols] === strShimFunction) { for (var i = 0, p = ObjClass[strGetOwnPropertySymbols](s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && ObjProto["propertyIsEnumerable"].call(s, p[i])) { t[p[i]] = s[p[i]]; } } } return t; } export function __decorateFn(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = ObjClass["getOwnPropertyDescriptor"](target, key) : desc, d; if (__hasReflect && typeof ReflectObj[strDecorate] === strShimFunction) { r = ReflectObj[strDecorate](decorators, target, key, desc); } else { for (var i = decorators.length - 1; i >= 0; i--) { // eslint-disable-next-line no-cond-assign if (d = decorators[i]) { r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; } } } // tslint:disable-next-line:ban-comma-operator return c > 3 && r && ObjDefineProperty(target, key, r), r; } export function __paramFn(paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); }; } export function __metadataFn(metadataKey, metadataValue) { if (__hasReflect && ReflectObj[strMetadata] === strShimFunction) { return ReflectObj[strMetadata](metadataKey, metadataValue); } } export function __exportStarFn(m, o) { for (var p in m) { if (p !== strDefault && !ObjHasOwnProperty.call(o, p)) { __createBindingFn(o, m, p); } } } export function __createBindingFn(o, m, k, k2) { if (k2 === undefined) { k2 = k; } if (ObjCreate) { ObjDefineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } }); } else { o[k2] = m[k]; } } export function __valuesFn(o) { var s = typeof SymbolObj === strShimFunction && SymbolObj[strIterator], m = s && o[s], i = 0; if (m) { return m.call(o); } if (o && typeof o.length === "number") { return { next: function () { if (o && i >= o.length) { o = void 0; } return { value: o && o[i++], done: !o }; } }; } throwTypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); } export function __readFn(o, n) { var m = typeof SymbolObj === strShimFunction && o[SymbolObj[strIterator]]; if (!m) { return o; } var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) { ar.push(r.value); } } catch (error) { e = { error: error }; } finally { try { // tslint:disable-next-line:no-conditional-assignment if (r && !r.done && (m = i["return"])) { m.call(i); } } finally { if (e) { // eslint-disable-next-line no-unsafe-finally throw e.error; } } } return ar; } /** @deprecated */ export function __spreadArraysFn() { var theArgs = arguments; // Calculate new total size for (var s = 0, i = 0, il = theArgs.length; i < il; i++) { s += theArgs[i].length; } // Create new full array for (var r = Array(s), k = 0, i = 0; i < il; i++) { for (var a = theArgs[i], j = 0, jl = a.length; j < jl; j++, k++) { r[k] = a[j]; } } return r; } export function __spreadArrayFn(to, from) { for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) { to[j] = from[i]; } return to; } export function __makeTemplateObjectFn(cooked, raw) { if (ObjDefineProperty) { ObjDefineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; } export function __importStarFn(mod) { if (mod && mod.__esModule) { return mod; } var result = {}; if (mod != null) { for (var k in mod) { if (k !== strDefault && Object.prototype.hasOwnProperty.call(mod, k)) { __createBindingFn(result, mod, k); } } } // Set default module if (ObjCreate) { ObjDefineProperty(result, strDefault, { enumerable: true, value: mod }); } else { result[strDefault] = mod; } return result; } export function __importDefaultFn(mod) { return (mod && mod.__esModule) ? mod : { strDefault: mod }; } //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/applicationinsights-shims/dist-esm/TsLibShims.js.map/*! * Microsoft Application Insights JavaScript SDK - Shim functions, 2.0.1 * Copyright (c) Microsoft and contributors. All rights reserved. */ var strShimFunction = "function"; var strShimObject = "object"; var strShimUndefined = "undefined"; var strShimPrototype = "prototype"; var strShimHasOwnProperty = "hasOwnProperty"; var strDefault = "default"; var ObjClass = Object; var ObjProto = ObjClass[strShimPrototype]; var ObjAssign = ObjClass["assign"]; var ObjCreate = ObjClass["create"]; var ObjDefineProperty = ObjClass["defineProperty"]; var ObjHasOwnProperty = ObjProto[strShimHasOwnProperty]; var _cachedGlobal = null; /** * Returns the current global scope object, for a normal web page this will be the current * window, for a Web Worker this will be current worker global scope via "self". The internal * implementation returns the first available instance object in the following order * - globalThis (New standard) * - self (Will return the current window instance for supported browsers) * - window (fallback for older browser implementations) * - global (NodeJS standard) * - (When all else fails) * While the return type is a Window for the normal case, not all environments will support all * of the properties or functions. */ function getGlobal(useCached) { if (useCached === void 0) { useCached = true; } if (!_cachedGlobal || !useCached) { if (typeof globalThis !== strShimUndefined && globalThis) { _cachedGlobal = globalThis; } if (typeof self !== strShimUndefined && self) { _cachedGlobal = self; } if (typeof window !== strShimUndefined && window) { _cachedGlobal = window; } if (typeof global !== strShimUndefined && global) { _cachedGlobal = global; } } return _cachedGlobal; } function throwTypeError(message) { throw new TypeError(message); } /** * Creates an object that has the specified prototype, and that optionally contains specified properties. This helper exists to avoid adding a polyfil * for older browsers that do not define Object.create eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation. * Note: For consistency this will not use the Object.create implementation if it exists as this would cause a testing requirement to test with and without the implementations * @param obj Object to use as a prototype. May be null */ function objCreateFn(obj) { var func = ObjCreate; // Use build in Object.create if (func) { // Use Object create method if it exists return func(obj); } if (obj == null) { return {}; } var type = typeof obj; if (type !== strShimObject && type !== strShimFunction) { throwTypeError("Object prototype may only be an Object:" + obj); } function tmpFunc() { } tmpFunc[strShimPrototype] = obj; return new tmpFunc(); } // Most of these functions have been directly shamelessly "lifted" from the https://github.com/@microsoft/tslib and // modified to be ES3 compatible and applying several minification and tree-shaking techniques so that Application Insights // can successfully use TypeScript "importHelpers" which imports tslib during compilation but it will use these at runtime // Which is also why all of the functions have not been included as Application Insights currently doesn't use or require // them. var SymbolObj = (getGlobal() || {})["Symbol"]; var ReflectObj = (getGlobal() || {})["Reflect"]; var __hasReflect = !!ReflectObj; var strDecorate = "decorate"; var strMetadata = "metadata"; var strGetOwnPropertySymbols = "getOwnPropertySymbols"; var strIterator = "iterator"; var __objAssignFnImpl = function (t) { // tslint:disable-next-line: ban-comma-operator for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) { if (ObjProto[strShimHasOwnProperty].call(s, p)) { t[p] = s[p]; } } } return t; }; var __assignFn = ObjAssign || __objAssignFnImpl; // tslint:disable-next-line: only-arrow-functions var extendStaticsFn = function (d, b) { extendStaticsFn = ObjClass["setPrototypeOf"] || // tslint:disable-next-line: only-arrow-functions ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || // tslint:disable-next-line: only-arrow-functions function (d, b) { for (var p in b) { if (b[strShimHasOwnProperty](p)) { d[p] = b[p]; } } }; return extendStaticsFn(d, b); }; function __extendsFn(d, b) { if (typeof b !== strShimFunction && b !== null) { throwTypeError("Class extends value " + String(b) + " is not a constructor or null"); } extendStaticsFn(d, b); function __() { this.constructor = d; } // tslint:disable-next-line: ban-comma-operator d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new __()); } function __restFn(s, e) { var t = {}; for (var k in s) { if (ObjHasOwnProperty.call(s, k) && e.indexOf(k) < 0) { t[k] = s[k]; } } if (s != null && typeof ObjClass[strGetOwnPropertySymbols] === strShimFunction) { for (var i = 0, p = ObjClass[strGetOwnPropertySymbols](s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && ObjProto["propertyIsEnumerable"].call(s, p[i])) { t[p[i]] = s[p[i]]; } } } return t; } function __decorateFn(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = ObjClass["getOwnPropertyDescriptor"](target, key) : desc, d; if (__hasReflect && typeof ReflectObj[strDecorate] === strShimFunction) { r = ReflectObj[strDecorate](decorators, target, key, desc); } else { for (var i = decorators.length - 1; i >= 0; i--) { // eslint-disable-next-line no-cond-assign if (d = decorators[i]) { r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; } } } // tslint:disable-next-line:ban-comma-operator return c > 3 && r && ObjDefineProperty(target, key, r), r; } function __paramFn(paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); }; } function __metadataFn(metadataKey, metadataValue) { if (__hasReflect && ReflectObj[strMetadata] === strShimFunction) { return ReflectObj[strMetadata](metadataKey, metadataValue); } } function __exportStarFn(m, o) { for (var p in m) { if (p !== strDefault && !ObjHasOwnProperty.call(o, p)) { __createBindingFn(o, m, p); } } } function __createBindingFn(o, m, k, k2) { if (k2 === undefined) { k2 = k; } if (ObjCreate) { ObjDefineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } }); } else { o[k2] = m[k]; } } function __valuesFn(o) { var s = typeof SymbolObj === strShimFunction && SymbolObj[strIterator], m = s && o[s], i = 0; if (m) { return m.call(o); } if (o && typeof o.length === "number") { return { next: function () { if (o && i >= o.length) { o = void 0; } return { value: o && o[i++], done: !o }; } }; } throwTypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); } function __readFn(o, n) { var m = typeof SymbolObj === strShimFunction && o[SymbolObj[strIterator]]; if (!m) { return o; } var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) { ar.push(r.value); } } catch (error) { e = { error: error }; } finally { try { // tslint:disable-next-line:no-conditional-assignment if (r && !r.done && (m = i["return"])) { m.call(i); } } finally { if (e) { // eslint-disable-next-line no-unsafe-finally throw e.error; } } } return ar; } /** @deprecated */ function __spreadArraysFn() { var theArgs = arguments; // Calculate new total size for (var s = 0, i = 0, il = theArgs.length; i < il; i++) { s += theArgs[i].length; } // Create new full array for (var r = Array(s), k = 0, i = 0; i < il; i++) { for (var a = theArgs[i], j = 0, jl = a.length; j < jl; j++, k++) { r[k] = a[j]; } } return r; } function __spreadArrayFn(to, from) { for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) { to[j] = from[i]; } return to; } function __makeTemplateObjectFn(cooked, raw) { if (ObjDefineProperty) { ObjDefineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; } function __importStarFn(mod) { if (mod && mod.__esModule) { return mod; } var result = {}; if (mod != null) { for (var k in mod) { if (k !== strDefault && Object.prototype.hasOwnProperty.call(mod, k)) { __createBindingFn(result, mod, k); } } } // Set default module if (ObjCreate) { ObjDefineProperty(result, strDefault, { enumerable: true, value: mod }); } else { result[strDefault] = mod; } return result; } function __importDefaultFn(mod) { return (mod && mod.__esModule) ? mod : { strDefault: mod }; } function __exposeGlobalTsLib() { var globalObj = getGlobal() || {}; // tslint:disable: only-arrow-functions (function (root, assignFn, extendsFn, createBindingFn) { // Assign the globally scoped versions of the functions -- used when consuming individual ts files // If check is to support NativeScript where these are marked as readonly if (!root.__assign) { root.__assign = ObjAssign || assignFn; } if (!root.__extends) { root.__extends = extendsFn; } if (!root.__createBinding) { root.__createBinding = createBindingFn; } })(globalObj, __assignFn, __extendsFn, __createBindingFn); // Assign local variables that will be used for embedded scenarios, if check is to support NativeScript where these are marked as readonly if (!__assign) { __assign = globalObj.__assign; } if (!__extends) { __extends = globalObj.__extends; } if (!__createBinding) { __createBinding = globalObj.__createBinding; } } export { ObjAssign, ObjClass, ObjCreate, ObjDefineProperty, ObjHasOwnProperty, ObjProto, __assignFn, __createBindingFn, __decorateFn, __exportStarFn, __exposeGlobalTsLib, __extendsFn, __importDefaultFn, __importStarFn, __makeTemplateObjectFn, __metadataFn, __paramFn, __readFn, __restFn, __spreadArrayFn, __spreadArraysFn, __valuesFn, getGlobal, objCreateFn, strDefault, strShimFunction, strShimHasOwnProperty, strShimObject, strShimPrototype, strShimUndefined, throwTypeError }; /*! * Microsoft Application Insights JavaScript SDK - Shim functions, 2.0.1 * Copyright (c) Microsoft and contributors. All rights reserved. */ var strShimFunction = "function"; var strShimObject = "object"; var strShimUndefined = "undefined"; var strShimPrototype = "prototype"; var strShimHasOwnProperty = "hasOwnProperty"; var strDefault = "default"; var ObjClass = Object; var ObjProto = ObjClass[strShimPrototype]; var ObjAssign = ObjClass["assign"]; var ObjCreate = ObjClass["create"]; var ObjDefineProperty = ObjClass["defineProperty"]; var ObjHasOwnProperty = ObjProto[strShimHasOwnProperty]; var _cachedGlobal = null; /** * Returns the current global scope object, for a normal web page this will be the current * window, for a Web Worker this will be current worker global scope via "self". The internal * implementation returns the first available instance object in the following order * - globalThis (New standard) * - self (Will return the current window instance for supported browsers) * - window (fallback for older browser implementations) * - global (NodeJS standard) * - (When all else fails) * While the return type is a Window for the normal case, not all environments will support all * of the properties or functions. */ function getGlobal(useCached) { if (useCached === void 0) { useCached = true; } if (!_cachedGlobal || !useCached) { if (typeof globalThis !== strShimUndefined && globalThis) { _cachedGlobal = globalThis; } if (typeof self !== strShimUndefined && self) { _cachedGlobal = self; } if (typeof window !== strShimUndefined && window) { _cachedGlobal = window; } if (typeof global !== strShimUndefined && global) { _cachedGlobal = global; } } return _cachedGlobal; } function throwTypeError(message) { throw new TypeError(message); } /** * Creates an object that has the specified prototype, and that optionally contains specified properties. This helper exists to avoid adding a polyfil * for older browsers that do not define Object.create eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation. * Note: For consistency this will not use the Object.create implementation if it exists as this would cause a testing requirement to test with and without the implementations * @param obj Object to use as a prototype. May be null */ function objCreateFn(obj) { var func = ObjCreate; // Use build in Object.create if (func) { // Use Object create method if it exists return func(obj); } if (obj == null) { return {}; } var type = typeof obj; if (type !== strShimObject && type !== strShimFunction) { throwTypeError("Object prototype may only be an Object:" + obj); } function tmpFunc() { } tmpFunc[strShimPrototype] = obj; return new tmpFunc(); } // Most of these functions have been directly shamelessly "lifted" from the https://github.com/@microsoft/tslib and // modified to be ES3 compatible and applying several minification and tree-shaking techniques so that Application Insights // can successfully use TypeScript "importHelpers" which imports tslib during compilation but it will use these at runtime // Which is also why all of the functions have not been included as Application Insights currently doesn't use or require // them. var SymbolObj = (getGlobal() || {})["Symbol"]; var ReflectObj = (getGlobal() || {})["Reflect"]; var __hasReflect = !!ReflectObj; var strDecorate = "decorate"; var strMetadata = "metadata"; var strGetOwnPropertySymbols = "getOwnPropertySymbols"; var strIterator = "iterator"; var __objAssignFnImpl = function (t) { // tslint:disable-next-line: ban-comma-operator for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) { if (ObjProto[strShimHasOwnProperty].call(s, p)) { t[p] = s[p]; } } } return t; }; var __assignFn = ObjAssign || __objAssignFnImpl; // tslint:disable-next-line: only-arrow-functions var extendStaticsFn = function (d, b) { extendStaticsFn = ObjClass["setPrototypeOf"] || // tslint:disable-next-line: only-arrow-functions ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || // tslint:disable-next-line: only-arrow-functions function (d, b) { for (var p in b) { if (b[strShimHasOwnProperty](p)) { d[p] = b[p]; } } }; return extendStaticsFn(d, b); }; function __extendsFn(d, b) { if (typeof b !== strShimFunction && b !== null) { throwTypeError("Class extends value " + String(b) + " is not a constructor or null"); } extendStaticsFn(d, b); function __() { this.constructor = d; } // tslint:disable-next-line: ban-comma-operator d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new __()); } function __restFn(s, e) { var t = {}; for (var k in s) { if (ObjHasOwnProperty.call(s, k) && e.indexOf(k) < 0) { t[k] = s[k]; } } if (s != null && typeof ObjClass[strGetOwnPropertySymbols] === strShimFunction) { for (var i = 0, p = ObjClass[strGetOwnPropertySymbols](s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && ObjProto["propertyIsEnumerable"].call(s, p[i])) { t[p[i]] = s[p[i]]; } } } return t; } function __decorateFn(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = ObjClass["getOwnPropertyDescriptor"](target, key) : desc, d; if (__hasReflect && typeof ReflectObj[strDecorate] === strShimFunction) { r = ReflectObj[strDecorate](decorators, target, key, desc); } else { for (var i = decorators.length - 1; i >= 0; i--) { // eslint-disable-next-line no-cond-assign if (d = decorators[i]) { r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; } } } // tslint:disable-next-line:ban-comma-operator return c > 3 && r && ObjDefineProperty(target, key, r), r; } function __paramFn(paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); }; } function __metadataFn(metadataKey, metadataValue) { if (__hasReflect && ReflectObj[strMetadata] === strShimFunction) { return ReflectObj[strMetadata](metadataKey, metadataValue); } } function __exportStarFn(m, o) { for (var p in m) { if (p !== strDefault && !ObjHasOwnProperty.call(o, p)) { __createBindingFn(o, m, p); } } } function __createBindingFn(o, m, k, k2) { if (k2 === undefined) { k2 = k; } if (ObjCreate) { ObjDefineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } }); } else { o[k2] = m[k]; } } function __valuesFn(o) { var s = typeof SymbolObj === strShimFunction && SymbolObj[strIterator], m = s && o[s], i = 0; if (m) { return m.call(o); } if (o && typeof o.length === "number") { return { next: function () { if (o && i >= o.length) { o = void 0; } return { value: o && o[i++], done: !o }; } }; } throwTypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); } function __readFn(o, n) { var m = typeof SymbolObj === strShimFunction && o[SymbolObj[strIterator]]; if (!m) { return o; } var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) { ar.push(r.value); } } catch (error) { e = { error: error }; } finally { try { // tslint:disable-next-line:no-conditional-assignment if (r && !r.done && (m = i["return"])) { m.call(i); } } finally { if (e) { // eslint-disable-next-line no-unsafe-finally throw e.error; } } } return ar; } /** @deprecated */ function __spreadArraysFn() { var theArgs = arguments; // Calculate new total size for (var s = 0, i = 0, il = theArgs.length; i < il; i++) { s += theArgs[i].length; } // Create new full array for (var r = Array(s), k = 0, i = 0; i < il; i++) { for (var a = theArgs[i], j = 0, jl = a.length; j < jl; j++, k++) { r[k] = a[j]; } } return r; } function __spreadArrayFn(to, from) { for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) { to[j] = from[i]; } return to; } function __makeTemplateObjectFn(cooked, raw) { if (ObjDefineProperty) { ObjDefineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; } function __importStarFn(mod) { if (mod && mod.__esModule) { return mod; } var result = {}; if (mod != null) { for (var k in mod) { if (k !== strDefault && Object.prototype.hasOwnProperty.call(mod, k)) { __createBindingFn(result, mod, k); } } } // Set default module if (ObjCreate) { ObjDefineProperty(result, strDefault, { enumerable: true, value: mod }); } else { result[strDefault] = mod; } return result; } function __importDefaultFn(mod) { return (mod && mod.__esModule) ? mod : { strDefault: mod }; } function __exposeGlobalTsLib() { var globalObj = getGlobal() || {}; // tslint:disable: only-arrow-functions (function (root, assignFn, extendsFn, createBindingFn) { // Assign the globally scoped versions of the functions -- used when consuming individual ts files // If check is to support NativeScript where these are marked as readonly if (!root.__assign) { root.__assign = ObjAssign || assignFn; } if (!root.__extends) { root.__extends = extendsFn; } if (!root.__createBinding) { root.__createBinding = createBindingFn; } })(globalObj, __assignFn, __extendsFn, __createBindingFn); // Assign local variables that will be used for embedded scenarios, if check is to support NativeScript where these are marked as readonly if (!__assign) { __assign = globalObj.__assign; } if (!__extends) { __extends = globalObj.__extends; } if (!__createBinding) { __createBinding = globalObj.__createBinding; } } export { ObjAssign, ObjClass, ObjCreate, ObjDefineProperty, ObjHasOwnProperty, ObjProto, __assignFn, __createBindingFn, __decorateFn, __exportStarFn, __exposeGlobalTsLib, __extendsFn, __importDefaultFn, __importStarFn, __makeTemplateObjectFn, __metadataFn, __paramFn, __readFn, __restFn, __spreadArrayFn, __spreadArraysFn, __valuesFn, getGlobal, objCreateFn, strDefault, strShimFunction, strShimHasOwnProperty, strShimObject, strShimPrototype, strShimUndefined, throwTypeError }; /*! * Microsoft Application Insights JavaScript SDK - Shim functions, 2.0.1 * Copyright (c) Microsoft and contributors. All rights reserved. */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.Microsoft = global.Microsoft || {}, global.Microsoft.ApplicationInsights = global.Microsoft.ApplicationInsights || {}, global.Microsoft.ApplicationInsights.Shims = {}))); })(this, (function (exports) { 'use strict'; var strShimFunction = "function"; var strShimObject = "object"; var strShimUndefined = "undefined"; var strShimPrototype = "prototype"; var strShimHasOwnProperty = "hasOwnProperty"; var strDefault = "default"; var ObjClass = Object; var ObjProto = ObjClass[strShimPrototype]; var ObjAssign = ObjClass["assign"]; var ObjCreate = ObjClass["create"]; var ObjDefineProperty = ObjClass["defineProperty"]; var ObjHasOwnProperty = ObjProto[strShimHasOwnProperty]; var _cachedGlobal = null; /** * Returns the current global scope object, for a normal web page this will be the current * window, for a Web Worker this will be current worker global scope via "self". The internal * implementation returns the first available instance object in the following order * - globalThis (New standard) * - self (Will return the current window instance for supported browsers) * - window (fallback for older browser implementations) * - global (NodeJS standard) * - (When all else fails) * While the return type is a Window for the normal case, not all environments will support all * of the properties or functions. */ function getGlobal(useCached) { if (useCached === void 0) { useCached = true; } if (!_cachedGlobal || !useCached) { if (typeof globalThis !== strShimUndefined && globalThis) { _cachedGlobal = globalThis; } if (typeof self !== strShimUndefined && self) { _cachedGlobal = self; } if (typeof window !== strShimUndefined && window) { _cachedGlobal = window; } if (typeof global !== strShimUndefined && global) { _cachedGlobal = global; } } return _cachedGlobal; } function throwTypeError(message) { throw new TypeError(message); } /** * Creates an object that has the specified prototype, and that optionally contains specified properties. This helper exists to avoid adding a polyfil * for older browsers that do not define Object.create eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation. * Note: For consistency this will not use the Object.create implementation if it exists as this would cause a testing requirement to test with and without the implementations * @param obj Object to use as a prototype. May be null */ function objCreateFn(obj) { var func = ObjCreate; // Use build in Object.create if (func) { // Use Object create method if it exists return func(obj); } if (obj == null) { return {}; } var type = typeof obj; if (type !== strShimObject && type !== strShimFunction) { throwTypeError("Object prototype may only be an Object:" + obj); } function tmpFunc() { } tmpFunc[strShimPrototype] = obj; return new tmpFunc(); } // Most of these functions have been directly shamelessly "lifted" from the https://github.com/@microsoft/tslib and // modified to be ES3 compatible and applying several minification and tree-shaking techniques so that Application Insights // can successfully use TypeScript "importHelpers" which imports tslib during compilation but it will use these at runtime // Which is also why all of the functions have not been included as Application Insights currently doesn't use or require // them. var SymbolObj = (getGlobal() || {})["Symbol"]; var ReflectObj = (getGlobal() || {})["Reflect"]; var __hasReflect = !!ReflectObj; var strDecorate = "decorate"; var strMetadata = "metadata"; var strGetOwnPropertySymbols = "getOwnPropertySymbols"; var strIterator = "iterator"; var __objAssignFnImpl = function (t) { // tslint:disable-next-line: ban-comma-operator for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) { if (ObjProto[strShimHasOwnProperty].call(s, p)) { t[p] = s[p]; } } } return t; }; var __assignFn = ObjAssign || __objAssignFnImpl; // tslint:disable-next-line: only-arrow-functions var extendStaticsFn = function (d, b) { extendStaticsFn = ObjClass["setPrototypeOf"] || // tslint:disable-next-line: only-arrow-functions ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || // tslint:disable-next-line: only-arrow-functions function (d, b) { for (var p in b) { if (b[strShimHasOwnProperty](p)) { d[p] = b[p]; } } }; return extendStaticsFn(d, b); }; function __extendsFn(d, b) { if (typeof b !== strShimFunction && b !== null) { throwTypeError("Class extends value " + String(b) + " is not a constructor or null"); } extendStaticsFn(d, b); function __() { this.constructor = d; } // tslint:disable-next-line: ban-comma-operator d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new __()); } function __restFn(s, e) { var t = {}; for (var k in s) { if (ObjHasOwnProperty.call(s, k) && e.indexOf(k) < 0) { t[k] = s[k]; } } if (s != null && typeof ObjClass[strGetOwnPropertySymbols] === strShimFunction) { for (var i = 0, p = ObjClass[strGetOwnPropertySymbols](s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && ObjProto["propertyIsEnumerable"].call(s, p[i])) { t[p[i]] = s[p[i]]; } } } return t; } function __decorateFn(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = ObjClass["getOwnPropertyDescriptor"](target, key) : desc, d; if (__hasReflect && typeof ReflectObj[strDecorate] === strShimFunction) { r = ReflectObj[strDecorate](decorators, target, key, desc); } else { for (var i = decorators.length - 1; i >= 0; i--) { // eslint-disable-next-line no-cond-assign if (d = decorators[i]) { r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; } } } // tslint:disable-next-line:ban-comma-operator return c > 3 && r && ObjDefineProperty(target, key, r), r; } function __paramFn(paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); }; } function __metadataFn(metadataKey, metadataValue) { if (__hasReflect && ReflectObj[strMetadata] === strShimFunction) { return ReflectObj[strMetadata](metadataKey, metadataValue); } } function __exportStarFn(m, o) { for (var p in m) { if (p !== strDefault && !ObjHasOwnProperty.call(o, p)) { __createBindingFn(o, m, p); } } } function __createBindingFn(o, m, k, k2) { if (k2 === undefined) { k2 = k; } if (ObjCreate) { ObjDefineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } }); } else { o[k2] = m[k]; } } function __valuesFn(o) { var s = typeof SymbolObj === strShimFunction && SymbolObj[strIterator], m = s && o[s], i = 0; if (m) { return m.call(o); } if (o && typeof o.length === "number") { return { next: function () { if (o && i >= o.length) { o = void 0; } return { value: o && o[i++], done: !o }; } }; } throwTypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); } function __readFn(o, n) { var m = typeof SymbolObj === strShimFunction && o[SymbolObj[strIterator]]; if (!m) { return o; } var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) { ar.push(r.value); } } catch (error) { e = { error: error }; } finally { try { // tslint:disable-next-line:no-conditional-assignment if (r && !r.done && (m = i["return"])) { m.call(i); } } finally { if (e) { // eslint-disable-next-line no-unsafe-finally throw e.error; } } } return ar; } /** @deprecated */ function __spreadArraysFn() { var theArgs = arguments; // Calculate new total size for (var s = 0, i = 0, il = theArgs.length; i < il; i++) { s += theArgs[i].length; } // Create new full array for (var r = Array(s), k = 0, i = 0; i < il; i++) { for (var a = theArgs[i], j = 0, jl = a.length; j < jl; j++, k++) { r[k] = a[j]; } } return r; } function __spreadArrayFn(to, from) { for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) { to[j] = from[i]; } return to; } function __makeTemplateObjectFn(cooked, raw) { if (ObjDefineProperty) { ObjDefineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; } function __importStarFn(mod) { if (mod && mod.__esModule) { return mod; } var result = {}; if (mod != null) { for (var k in mod) { if (k !== strDefault && Object.prototype.hasOwnProperty.call(mod, k)) { __createBindingFn(result, mod, k); } } } // Set default module if (ObjCreate) { ObjDefineProperty(result, strDefault, { enumerable: true, value: mod }); } else { result[strDefault] = mod; } return result; } function __importDefaultFn(mod) { return (mod && mod.__esModule) ? mod : { strDefault: mod }; } function __exposeGlobalTsLib() { var globalObj = getGlobal() || {}; // tslint:disable: only-arrow-functions (function (root, assignFn, extendsFn, createBindingFn) { // Assign the globally scoped versions of the functions -- used when consuming individual ts files // If check is to support NativeScript where these are marked as readonly if (!root.__assign) { root.__assign = ObjAssign || assignFn; } if (!root.__extends) { root.__extends = extendsFn; } if (!root.__createBinding) { root.__createBinding = createBindingFn; } })(globalObj, __assignFn, __extendsFn, __createBindingFn); // Assign local variables that will be used for embedded scenarios, if check is to support NativeScript where these are marked as readonly if (!__assign) { __assign = globalObj.__assign; } if (!__extends) { __extends = globalObj.__extends; } if (!__createBinding) { __createBinding = globalObj.__createBinding; } } exports.ObjAssign = ObjAssign; exports.ObjClass = ObjClass; exports.ObjCreate = ObjCreate; exports.ObjDefineProperty = ObjDefineProperty; exports.ObjHasOwnProperty = ObjHasOwnProperty; exports.ObjProto = ObjProto; exports.__assignFn = __assignFn; exports.__createBindingFn = __createBindingFn; exports.__decorateFn = __decorateFn; exports.__exportStarFn = __exportStarFn; exports.__exposeGlobalTsLib = __exposeGlobalTsLib; exports.__extendsFn = __extendsFn; exports.__importDefaultFn = __importDefaultFn; exports.__importStarFn = __importStarFn; exports.__makeTemplateObjectFn = __makeTemplateObjectFn; exports.__metadataFn = __metadataFn; exports.__paramFn = __paramFn; exports.__readFn = __readFn; exports.__restFn = __restFn; exports.__spreadArrayFn = __spreadArrayFn; exports.__spreadArraysFn = __spreadArraysFn; exports.__valuesFn = __valuesFn; exports.getGlobal = getGlobal; exports.objCreateFn = objCreateFn; exports.strDefault = strDefault; exports.strShimFunction = strShimFunction; exports.strShimHasOwnProperty = strShimHasOwnProperty; exports.strShimObject = strShimObject; exports.strShimPrototype = strShimPrototype; exports.strShimUndefined = strShimUndefined; exports.throwTypeError = throwTypeError; (function(obj, prop, descriptor) { /* ai_es3_polyfil defineProperty */ var func = Object["defineProperty"]; if (func) { try { return func(obj, prop, descriptor); } catch(e) { /* IE8 defines defineProperty, but will throw */ } } if (descriptor && typeof descriptor.value !== undefined) { obj[prop] = descriptor.value; } return obj; })(exports, '__esModule', { value: true }); })); /*! * Microsoft Application Insights JavaScript SDK - Shim functions, 2.0.1 * Copyright (c) Microsoft and contributors. All rights reserved. */ var e=this,n=function(e){"use strict";var f="function",a="object",n="undefined",r="prototype",l="hasOwnProperty",o="default",u=Object,_=u[r],d=u.assign,i=u.create,s=u.defineProperty,p=_[l],t=null;function y(e){return void 0===e&&(e=!0),t&&e||(typeof globalThis!=n&&globalThis&&(t=globalThis),typeof self!=n&&self&&(t=self),typeof window!=n&&window&&(t=window),typeof global!=n&&global&&(t=global)),t}function g(e){throw new TypeError(e)}function b(e){if(i)return i(e);if(null==e)return{};var n=typeof e;function t(){}return n!==a&&n!==f&&g("Object prototype may only be an Object:"+e),t[r]=e,new t}var v=(y()||{}).Symbol,c=(y()||{}).Reflect,h=!!c,m="decorate",O="metadata",w="getOwnPropertySymbols",j="iterator",F=d||function(e){for(var n,t=1,r=arguments.length;t=e.length?void 0:e)&&e[r++],done:!e}}}:void g(n?"Object is not iterable.":"Symbol.iterator is not defined.")},e.getGlobal=y,e.objCreateFn=b,e.strDefault=o,e.strShimFunction=f,e.strShimHasOwnProperty=l,e.strShimObject=a,e.strShimPrototype=r,e.strShimUndefined=n,e.throwTypeError=g;var T="__esModule",A={value:!0},M=Object.defineProperty;if(M)try{return void M(e,T,A)}catch(B){}typeof A.value!==undefined&&(e[T]=A.value)};"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(((e="undefined"!=typeof globalThis?globalThis:e||self).Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights=e.Microsoft.ApplicationInsights||{},e.Microsoft.ApplicationInsights.Shims={})); MIT License Copyright (c) Microsoft Corporation. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE  yH'870! t73UY,/EuQ>DﻯSW]-ʐg挪.N+U֖_A(zl|0 Ş NRRB<EHӷQW<6K>O࣫UE??CBYݚ$x})2xS%e 4yҶ`)i S8E_&ɋ& ?[3J~dI4<.. ڮI@e?K8Kyy]%#`߷`C_O˪w<;0΃w5wSd6 }KUg=%ϒ}SŃDj^7s2aީW~2oŠ;@5E̦Q;YZ;̒#Wt=_/qۯS'XVzR'skTQY<՝bwOb˭wx/OJdlT\x^T& pTpq_*Y3G] J_n=s_';Uد퓹ߚ%AD{[K/`i0$'KVyCn6} ު{R(A^2rJz(8U$r:'KY`ՙ!QyeOةzޕ`w[ v:Zҗ'nZ~[Cg0͸s҃l$%r}%nZ:S=,qaV[٠kam_kV) ! Q_'8_zeV6_]QS<0 8i?hdq* >Y'W0A$@9n}r'u?_+_|So(^TD~AS5BlkpT:ެYC@ϓqCϼ YiU\t]Yf/q? @ɝ,9h<]__-ߢ%)Wڧ`oW䌾̹yq=ۃ-͌Y] C*R' afj4AXO/33@"/| DZsR?3: /u;*CAT8Wgty4aקx^sv0oטoǦl+83mʡ?s^!=]Sf/6 n0zA;W/w p <_//Z4Us|Pv9$e_^8|(u#PXzvc3~Vs˫ygb7fy 8Jݕ׹/֏uB >6?559SdIw{BnCB03ϊom>;  6ȁs9wG+uhLڧlm_dΌxQN@u bD G1 dϷJ"d{_}N\a0l`lR+/O%~|=Ŀyުay?_%f@OIDo(U ߛ5`:R>[KsHg]0z9?pK- % ܵi{'y=[:|M&^GUNK ,6>{={#Nzӣ2D+_Z%ReNw(}~w3g7V #Ybd|n}ͬOpdY`?=o-gHw`7xA> @w`PCswÀPWzw{+}o\rva׀f{fZW'~V٠GY}ob}4}W{?te߭u \ lﱄ+f~B/_%;F2zwx/}>zzY]ыwu*h~<}Aߠv~rG9_g߯5zmJ⬤(9x{ݗp}a>-6|ؾDw߀y,x?b/#C/CIcq|ߗqH_Jʭي?>1= ,K{Air~cgBߡ1P7[=>k;/5@8oeϪs ̩`>3 $I;Iv_8M2~Eџ#3ӟSc?߫T?ROi~4O>s&>hϩ>sꣵ?hϩ>OQ1OÎ菹?tK!C?~o~ߋSoYBz٣?=ȧ짣̧ԧ䧣ħ0;5qZN"w04! ;hA%6?^?a?^oo旹$/n__Z6<9/^J7/G728`{yMJ,L /Y0m;cf-{c^xqWD~|( _? 7[5ї+_K>|ɀ/9%˽L0+ |=ry yKm=o/ˇ~gԏS%FqLgԏH%t,?~7,I=G>$vύH'Vd޲~nEGQ?+?Z䭷~s3>ԟ} ~ϩ{nA>P/فCo~A|8_n"?{a疮޽{ ūq~GˋY}w:w*w%9v@49*9Y[XG'uUE"T"2 5&GaAJUbe"!d*fnfyAZ ڶAW!:S N-tV2B?]x5(eǸ v la[˾:Pt5$pNYwꇞk&}4Das^yDU 5$Á\ǣ5ѥ7pnhFYQ*ߒbiX6N r[3>,"3{.z4d y8N1|͠f,14拗̫$vF =Q>Q2:qa^{,VqjՖu ^pao ]@MNMuh\86:H$7l AfPҺ@Ŭ4Q1!K,% =n?蘮j\hmAoˈVzxCc􃦫!/tk_PWV[$]bo>nq) \A.E٤t.8ieI/N+Fȓr躇׵Dk-.A{RZFqx?FUDa'V" \ZYM(dcDQzJX?KPrۈ)L ܈Yu8ˉ4^|]xA%|G@8E_Rz8mA\6h'8|~ӰUDQ 7EiDP$ Lo rmJE^Nne!,>:pvɱ7? R,XZtB&fV@킊,)4-B_j'nIx4ٔ܃tXSQ }ʛ R7+j \p$IiU܆\`loR*.,& lSu1Y Êg9!ӥr<'3ZϻxD4iG'ṵݮf!GF-NY*+M[QbA"QLED &E&;Y0e9FR,EqBki !E޸5iP&Yl/FZ[PBB z*#/a@;dY$_m頮3R[l4c8pGP /fd-KF? rDbn (9=d)hw5*,74H۳V-)B|wwK5vOz*|Y"ynBdOL1tík)ؕ5Wx2\԰!2 ]ktN4nA[Rit@YQ^k` pӷllM?+SO*=Н0(J0J0\lDc$\Of6ǐcMx1)Q 7Aɛ)Ί|)7] fdb!(:4"Ғnx7CZcUGHuN]7GrR\]ӖtEx6RlnĚq.Xuð>t8ҒZ:b\NI j, T~5&d~m+Fmm`֫*:bYP9/\w+_K8K5Xx.sXnGB̙eQZ!YI*ދƐ - Jk;@Nr/.u"y⳼Bjt r nHxB. $& ) ޜTű+PTPM'e\Zҭ"Jo j 5lA~=$.F&p^F!b3[zHԩZ8ÚƝʤC#9]s %FDa^@pɭuO+ j ;*%DD@۲ޘ%AN(dzxdS.o،E7gzٌ2EnػuE =b/6!/litp`'Pk,wB5-">6\%ZW382^ʥ$tS 8coZBRX~ zxUp>!A[cPv%:6>voĿ1jxM[6:'M+܏|Tխoݺ.7# &wn'}c'..`XCkBrEUB~Bp9nLE\[9#|̯FZ"*ZUE{ C&ɄbJH C(%fRі:V7gc]^ku>˥k7>C=&6~uV츒 v/ȱBئ /n92. `wc <1,xVN3xΙBIӥz"p(v:]BL0Ԕ.x୔_\ YlIjՐl1xl}G6Fn!M! "3~e'MڔO(nzeZ;f79W([sEƐ!$lkɵ=jH1 >>W! Bl92±;OHP!׉tt\DK$Da|Dn66d`gow86:Ȋ[kaۚ h'4\NfXq ͽkк5}ՐURϑE27@+%\3 &Aghv6JZcך%iL{*OFd! ͵R:iq5PJ3!C+@ι=B;쎇ą/C}s Lrc7y]:_5U*"-w`n pÝQH*͵b ( 4)𣅌>Vbx9,n)*)M yqdkPƈ1l|L< ]#d%v ^‹qTšרLN3A8T۩ȝ/`^ld#X' jPr&Car%K]уc֣ uU[CᣇvrA >KctQo%S*bdQR*>UJ]t ojǢ;D\"="̴TT 6܂%`ȧF6r#YvR`QoF?=]x/ތ=ie +gT11(E u%ݑH#0Cr& ƈ9աPD~=md`ܷ[vx<]v[;ҵtwݹ@EzâI8T8DI6QKàY_La{W쉵c+_lMJgk!?*c\4.@;Զ=EK|,;lF!!f^sxt؂B݂6 glY f_P+nt izuL|LSINV9fu\I-;Ku喲3`B/@2C4}XOA/x-Uو:GgWe5BMndi/fZUc.ؽn u hoݯu e0}ﮋ0LW2ꞙ΃7FT´o2ʈ yYk<Rs?O9N3%> 1 ~Y6t} ԅ}I A:kT@=@=wxD_m ݉5zW:X 31a}͹'>6xݮ:(&MC72`Ntω pl6 ;G{⢰%mP1tdfTOmf]h,EH[R)[ղN$ Ne:(mGmeή<#îHXBCn MB wAR~Ej"ݮو Y F6+DmҦ&,bq4o=ah6ڏ$c9-Y\t{xRV+H\ w6 x9#ު=iNoUqK+1Dv]LCA'X->pN!(M<<P|ed+b{B# 7JdHCVq` F[ώy]np+#oŔ-vJt! ~ID+fYV sH,amE6w]]]\5v*C\Nx+l-R]w RQ*ׁ 5N<,^u laa#!ӲJxڰaԵ{c!U-͈-3E 擨tq+6ev1M1GQdppOEF J$x z 6pUյԭ) Ug(PN=KkAU\Ä[Yuhn0TKÊs+^+dR7R>w=_@ɦyWJ \Q]JMaƒF{ad/cVI:^83qEpV ,hb+rV!rK0]0)*!r_&W.q(N7:;1zay3 a;E5!펙iҦӹb2V=}Pш=0Ϫ+ZG7&s;1w+u{0ŠC"23#.Q~0 9o)+hA%rvDw]ۈq`&tya G:&Z<.(ػE8@Lϵ{]U쾄Xd݄ +iKU64Duz5l-y,Lb$n&[l ;p<ͰKdfAnԻ_2W^ UM(Qa e=Oǔ:#=Mj3B;31LJά˒ВڱfEdQ%Yxm4V))[:2 l.tڨ꽅P)W;[0Sj/+mxhNHНlX&M—;R_U2A_a뗧̏-4(AUk? U~X:a T$}ػwύCR`,c&pje_*W}4vttJ-KzswXP%MMq/\進2Yy[y+Iy1*{bRE9 f`3\&( "?}rC>B-qBVno+'hneT'(MC,1,7B}m gb.2[.0r!t\RBS$" U)!ӻ% ~9>~\"-%búS!`wH B6|d} H# eZ{Q!h ..i9`OUx*7!iz'R3le\7gy@!=>K#Ʉiг-fTX{㖟YŽlwM.HyeaL]7:Q%yy9Oem ohp6כ Lb![[z 1<4@ME"1_/sU $(zBjǞ*;t!NN+-UɥLOS] O':j*59uZBeuZ9Ԁvخƛ-#ݱhoqUM<^j@ Lr2k2V%by[t=!mQWwÕԮdCH'LZlQb!~|E*0^ 2!xpJWG^7j"zjmQJ&;B%7]['Blp@[Px&{ vAHJd1ԠĹvB4;N^!жP<)BO 5w%#j zkY61Pj#61t`.NYo:o{_ҳTը3 ,i6֤p2ݓ}sA5{\;tѐmmʧϛma/05 pM/Z%UﺆzEʬYCǎ6VwV&7Ǘ| 8klryMAy)e1+QD@8hߣގ?1D.fgg6N=9> /5؄z+6"(ObJ+iWPj>nu y{oA#FgСUYTP\_sf \ͺ uٚ\w |ٰ 5KQB5`V#8M/ t&ONbmi:5F8 Y>MUٔyG!HC7 hj[^[O>ҿ9]alݫ"$T-=zY C[[j;K_SJ6` >)2%dž`a<JirИ}!8/~~#>ҩJi\&U"oNdkE 2e$q%@3X'W$]:[5nvNG2tEzufPlYa`mmƉzڷ/ ~O\e|+WlG!ZM* d,υ`z"A1̄a_Dx,F0/(@8KRM -ʂ3iFM|>?ӡ#/=AD- 91fM"G_[ g?1wKT7n3q~a_$pT_-ŷ'5jSf䆹?`3{~LGH$褏a{GqM㶈3 I \;u z QћM0 jG&wrͅsպ`^I܈'P)$v\5L8d|[lt;E#?÷_3]{e1Ot0 !LEZ:#O*tOk,.J +LI`T`-/#=ZƳGʏ'$ΛabqytGAtdm_V4(sTB$O}Tˌ\NͽC))g0y.6ķ񫕡5 R/[f`[ueSlaS}13ۡ$.֍]4̛4|`>kF]3~\ila:̇uȲ{bKC-j P|qBt6<6nБ`w(2#3?N{탛DLXn1y=gk`n 4uBvOaH?3XgmU?ޘrcΧt2phoi1¹$o+s9{A $ݺ"{^@OS4 u}\ciiLʨx1._(D.] ƞK6>vs ~ ~@ENn)OۋE`l0y(;h\sBRC@wЀ^]a-Oa@7p eXtrɀl ^{f}ptF-j% !۔ims UkiQY8P'{C4Dh~&MK/6 C?D =8h'f"IӉ5e _@6srj8"sN9% HoEvݏTSaei2FÞs.IE9g7m[TL(_׌e.M=L晫`?@k~!GzUT-1 @T*5x]]q~%m^њjXu Ƞ XQ>e~5t·ڙme/ 敕oJHyr0S'<9-Ak~)by|sjsֻķx~yF~ ڋu@F]{a˘{0jc,+שxz3>x])QJEW 4Ebe~6ҬS̋2C7cQV PuIw·}i%;ge/^GԔ}W~+ٷ?kvl++|ʬ9!j*^N^-ʋп_{˺5޸zW̟ 騸# du=Qcl)!{5<"m}~1t2z4HpV@;V_C oOi”נ5&oT5`!bŮ<+WSEKP7S4:^l-#eGG'6A7^^+~V  T-i]r~~Isې9#oՀЂ.&B}˹%n5.?kp+u!W&3C"Cz].u)  STA+70YWl\jVaU̸"yjstn^dlIDr*QF3٪K%+g˂D珘K::gȍɜlRήB_p-}Y G&kiHEfVkPşL,K.uSY .ѰDs6Y44dBJ/{- >SEWg-jXܱ:|;)k 2/$ڿi#P̫)XFCH=p l_] _FEaw31OSm~vt.:fws‡/cU<伬@RG8U)F&|V^qDlnw^''+ۀf#k/(N`MKpa2`CF|w(M_f}تY"v?lPx K,5-bҙc=Sn$03+*9O.`k3U@LJC,v6wi=R ۴<bEzsdK,`7&R?>e['c$"vQ{4Ȑ']&",aqI4TvXi"olR{@HZ@ve6ƛ˧@di`HEULWm&"gMiٝL$Y/ 6\'$+ګMkeV[ϻ"{usBt\cKNݓ#j:`hd9 =f4>X~xLޗf0 <.Mٍ$fW9/J$.?9׎l@?#A c餖x1Q8 J q]B/&,nq6wO 'p8D<>-(,.TGE!ڶZk(kϏ0ԧl^ /[ū~D@ *?}6əZdLv`[:>V %1D^o|+..uJRpɏ>'&:ꓱa-@L`"iOdq..4(7` ry'gIpF6H[7{4g@M9NZBxC VFK>1xODEt+atC*Qyu$+aIE\.4a#0 ҆enL&C~(agq@C~. D0) cPԊc *,(RK?g-J_E_s/WGP 0m0 KlKYnx趌;V{ںv;h 6 ӨEC6)GNM30G䧡9t,WbXq:퐮)͖(4i:C(vaXZjFMjbBLѰ4G8|T䦊-7_x `h́b w힗N?8. q ¡3=lD9`59WMfwAn~bN{Kj~YBUq2`C]ᘡX3z$es3}~o}Hu#0O23/1}s6{ey;QY/(qRVxGK2ܴQyCGFCYJB%l8 "t~Rg@f@ϏYK)l-v4@_4bW 5Hń@, +TʋmsXu Y~^jXXZWyv2O!O^^HS~fix3-/сXAdY NW90!b]b3ފ(*Ƃ\gIajtYY2i omyC>߾7; ٧S!r *;WD,ϵ}wqBw]8A5W -H5x<٩Li8fNtQ0cp n6Luz)6?X_].dXq/ԯHgj?{:GXh9Y"rѩ MB*}ޗ~jٻO 0QCt:2#]* aġƏA H_8O +JZ|ug< 8 UF`~AN5/)6Vƅ)<&Dg#~w ,T0iozI@<O"1rAg׾a ICAVEnb#nuI(Ubgrl,+ϕ8~_-g['~$`+\)Zsy?`IP!S 25WɯYv1jy/ނ;d4}#+6 x3J:"vkx^16\XYbtt*&`|)K,.4bhϻ[ {Ǯl"Ƅ`f Ij룑0f0(|Lz/â.bgb"߽3ڿ!:Di$U]\%5Ɠ~8SS-FyD$E;K5˓#yF{5ȹ`mۻlڇ*w ӫ"LcF*H_HVgyT0A(`B+H51L4؋' CzLj4ꝓ| Br%7uiHeC"5dibFQ_V0@OZpʑYR+2H~)ܓ >/MzJ@qR٤ψ)nWowQH1a.TҬN/_OZ!0}n@)JM1'urCnM R| >,n1dfC>IF*Yf1z kM#5<~zH, ]/OȓK,KW]l[%D 6.}JНRg)CS=+W+=u⦒}mQx ;u]@YK*ep[EvmL"Gp[ x#L]/&>%b|f|5Vdamb~,: xEtw;`X3Ebkxn5Y^f9FZaDI%:_nq@ Q]SFI,2$!JF1h6u+>]-Lyă 7Ra{|*~3^e RT?u|FR+雴>F4,d' W(3f00 kH:|G,ihro6xѨ^Dc.40fpݲ;SN8MH'aI9z#J1v=RL@_&&◷Ni r35>H6`E:JGW3 '#Zd??L(#)vt  J?[CV0y L Al>7xs?QȟW@kKʠqwpn@mɈ}5^(SF6N"=\MK^70VDt]oY4߆j5dT[ґ 9dI졿Sлf_>!Un[Ԗ>LHJO`p6cE A7v)svct̗cϹ7VI/tYi:Y8$Tvo50a;jZ]TQeԳKi7${[& A k/vH8~m?b)0;C F7EWGs7/Ge}˜R>C1Ln4F EHxܹy]VB:.HyU(mO;s@+D+3b_άhޤ*v~1AgYM tHo5_BiSO\k) t>>/PU?hC-7V+qnelڪ+NOg8;X?bY$ ிY5_1/'BQ]wk/=% l2q7 SHE ~Hdۅ)tI ~#q(v=q ;ֿOrob]QGik2Rq"f}>=`.:Xdj'skiDQS#пxbh rnAKh\HCK+5$ž`q1s1;QQ6lO4$aIZ/_(>2"j|3(uW>J-_/#*FdOc£%,DTIo.(l/=1^^i-hٛ/2<?FЕ8|R 6(ϦR}dbW NfMY|?J +=z?8-? W_v\*<8`1+Aԃ`HR(!IcJ5<2V]=iS?-9M #$0kE6_Y& W oRU#B &L Fk_f}DޖU5?mb ¿ z/S3e71]Hdߠk{]AA@?8Ja2Xe;GEx;x޸MN80b, 9UiHyH#jm^_pEAȚJ]jxjBp2ehƈO*(ܦVrj1oīiֹ205KsIkbAD~-*6& Q CeW˔^b] _(65HΚuS߅,i(<"1>j dGdፑyB:k l-q2 I?4ܴV|xd^/3HG13iZ` .QgF#Az#כz07G%$DuQ8QN`; I5]a3e_5-s$ cލf2yS7BZ#~9o"&Q T 1I(U?.<̎J&m|Oi33 7]/qQr]bM&);*.ACu%EDqbQ5::vWo=p~Ԍ3U47)wSb ;^TCHO:d]fjp:p DŽ/<u>'ʮXЌB&ܒr+;@bz2\|3ѱ[;#2If8S͹lI' 83=Yz*.rQQ1׉}Uxu?F^7eY7Z@}C/wp g [m@.i_iAeR!Gj#EaRQAL_wac٣> QJK~GMo)Mph X u9+7;ڀ9|y{s%_qΖ8ϼK,;LS7^\f3 J}y&jzlDZB9jf"11WG%13b0la*xNU ZgGXvd8~t`ZjS ZbgeLbS"oD>]qZG#t#:!0y 8 J681^]c{}Q{Pɮ;ZT<6cG{`I!ڏH9 Ͳ|&5ϹWL{#PHWpԟ&zpQh}WZLaG}Ļ\^~f>?4a !K_>GWX(9G8 wnouFͻcHٟ*CwaO-S1;I<_eY,3V }~写Tl'#YbB̚~CPSQL,d:O]LYHYtԬ)4ǿ!LUz|'uMW,#xE3$?D*B%N`ٿʘ\e?KE5W>40i_Lz,keR_ߧȐ46X{8SGNFq Aa>ߟr.'9 s>ThQ'w(i_2 &8D7.ݻ eXȸ꺐=CM6+nͯݫFr[]w˪Smqo?u O^so=3yQ7K( P.k7cC+g#z{mΙ4۴ "}l|w%ɿn OnVd\lބ0yr'jYnKܴmz1rw_V'dhG' !BepDBlu+,"]!&F)pI7[.JrWEOR.M y2lI!IO3 jn5 |\L~'h alܨj}qOʯDe16(D#D7 t QyryBp_4.EG}/j|@%oh85Z{\3dCXg@D-*0a$F%fhyWN;cD &v݌Dw,ERS{¯ C>c[*Tی` K5$iyS aIF QT[-NUTACr0Xn“ F9)u ASP[u[Tų5` oBMK wO\'7W"RQn{ן笫\*xzBsZM0L-9iXKJtMբa,l1H0"P5eǛp#ۇZ!fI|IE=Ë(|Pl@.XaAmEPɞvՋE*umega(w' M!!X?qyN4ALY/&.KùP9B~$n,,M[ 7=Kݎ("U?4LkiGRdk܅n ] GBewOԼtq%z=%\pV#0> ֨ȷb<1?$w˧a0QQvx;oJNOcŭhz5VvQeNpNESf'Ʃ˹,~8ɚyUD@MGu뎩CDq4qbA0_/ٷe?s7TVȔq8 =k΢ז$@BHZcm}̪TUɬ<<<\DG8ToGdX1uױ l] 42;_92\a8j%_ڮB!K4-A˭\n $Ckf5XS+ɬ`n~R)e7O1w} <]ʷY4Zt75AݢO #0 6SvRU+Rsz0_;nf>_-- $7wbYl$CP X0 쪸'%O\0l qS99t77c(vaAbTz< %eYyGEx6r [ۈE57%>( `8:1Ij_ qʮv=p!t"]Tsal<7N \2 MCl#N( xX4h֢ t/'ufM\Θd11 ,E=9+f is=r=B0 gNRBKS B!5C1ok~@4rS:Q%&$Gb9%eu~EV!eU)MAeQW/s4}/;xPBV|2钳 |1?yBpٮ:Gu7LYsZ b%_\jPv0 3 :xnWX8L)YzL:B{F>FcE\7p I,;] }|J`K cryaM !ؒh-{^/rV;IuMt+2gR2سau:IS}Bmweqz{\1}ݳgG$!/#ʹYٸm[+18i_8E-m(658*gmlUJlbYt'gԍdMƨ صrƋV?8|ZiKƶ3@q[5!)aNrn5!y >:RM!> q5i@ M_3 Ѵǘh87 Ɇ(hr1Tk%ae v~Әb5%IVo0:jXJxn{IFi|˱Q&:őԭɔLC2@h`q.C&At%IH)]CKq>vbF41X7mr.`i{(PZLKm'<и>3H{W pIu4ZGɅP8R|ܭę"b>#Nєkճ`x+ݵw@vM>Ўv/ugT#(=? J7>1D9n#>k6(O:OQMiQceaMOcߏ34BWb3V w]C;ٌӔNuɚ㳮 xf<`Tn`A1&*i bhδ^ 㱮ge34Fc |&)qTN\"^NNzكPYQR.$!Kғ7?P5|94EGjW䞌ְ:[&zp\O0K):|WQETKi . wM1D^]6^#BGn]n/!P+Y*gpoܨ%jzL%abj'i a] {J4X@ʱd"i,_ o H42CyΝ" W+>v=Y1bF9ьqzE+^ٰ*s U5,Y]&)]Zz M\t"$mV(ʑy8P Y[aK G"NsDmfm&6xʶYB2 v2`}XXt6lhu=cEWc^^o>6 p߮Oy.ev 63zxo+έs_=q6U@wS<* ?l8S;!]j% {PmW!"rL\j\)qf$'fҸlScBydw 7MyN+:=W,t|jCX1Op݄DE*OW>41oIswY]8 mRtn Z]Tm&]0ل<a&`hR}Op $ -c41$4rjV} 4n;pե(~Ԅi7@l+ Ud,d$IsMWa^en|PJ9 P|l|w^s0(  41$*#cˇ˝[YMŠHaH\Zn:ȕn %{", Ж _EC\d2=/ҽ[/7*S4#ɼfM֦)G@V| WKүӌ##S%rc d.!4pq6:vH aUKhq*wjhe OS-is;-I)OwN*oCc{e1-~gf 7=TZulȜT[{4dt8Xi3Uܞha&.\Ew"|FzڒarX DӣV3,&ɶ%ZfApʽ )ˬ_;KLj)Smc*hYs)6hERVv +;RhʚdBLn '|4{= RXMxi{+c5ZDH*ZDjtZicyIV\X!BDLj{['JҚxJŢ 4- g-`A z!Qr)̊[O]DkZ/cVΏ ;mP:^ g 2VZ"vXx)T:|(d,UHCr_76OaZ8+w6옐+%sK:Ѝqc5e=Wv0+j)3L=YD"r x;yEYQ|7㤱Y>RI #$;Ol T~.B vdy:}jw_}Ҙ1MN">y,fՎ㳫l$jy:WN.Zqڭ Dn,̶zVjy5nBvX0 ^1leK 4ANԎZeh3k Sa)R2W۲(cb6f` dZ!4T]u!\3,@+D#hk .<G*lJQ;5QVOSOww 9SVBC' ?3RLGΧ|'Z1H{PA3%~zuΫ _*Pm38ET;)!S('r'jȁcmƄK?fu7umY}C#M`nth:U{Y&)y/AݕYcLaK c1 tg 1qTa-gw[ܞVIufG̋dJpg7NCM1bC/g';gG0U;}GU.Gf̕[jfR] iW[jQgΆAɊOr]b*>Nc EjkEHŰ:[=Ֆ vd=]94AGԨ%W+cdTᾟ<%20µ!֝EGMyZK+h(1ط܄)L)|󄑯$iL6rkhl̀H-jKN"YK 4v=]=5@_炟%Qdpqg@yEͮ[UAZDZ?RGzYga7 /zV^)#yV&:AĤRmENlIsFu:Al7H WCG2&ڄߘQ0&YO)\0[ti^Ѫ_O8YF'=@ԋ1Ns7^SW̙}]^#:JMNy'gdH2sф%qTl5wKK OlȫZ$l͂ܟTU)lD؟j! ?Ot,`>AM˟w]:3 \7ÔYsbhnlx:=mihH*>ZB} "}iۜHIF%8q\Nl;ّT=x=L1{"c9! 0!1J9eWȣ:|LVzC;x1`hra/Y}`uFMZǝ+~SaS/<5Q6g>nd+s_ '\YX \*:$M*N\29 b rY)z9>Vm^Y䇡 p[aB4N6$k_aX9{i–SdWQkxjj<@k[L1<'T n $EOr[ MZGREtxrnWBkG- A\0Ga9YvH̤' P'(ȼYec7gi.V"IL&/2J m9Oj؈ulE,|mA+:Y^Ɯmy]Λxy}L ޔJQnIM)m.}\w dSl4hzM\!љ0 ӻE)Ք Zw_BǖZJm5u"UQBq30Om& en{rG G cDV\mϨSmBRQZ5VAܞYD| Y2R.f9zGQ#*oSO y[`*u 0ZKWa;_(np8EMĐ23.ImwE!L0nm&ɑ(+ elu7hrQXTUPGD塄:B)du>ٓ3ː6&6m:@cK8epM}>Rif-U%#~̏%go7#rhS`>,)ՃGD?ȧڱ\pͤf]գ13\ֻi" w$lxBRFׂ0+iw:^朳- 1kmym$FP>rI[0m%D'ZӼm[.mнMG_E z]fy}0VI|~vm }6b7f:❣(ӘL뽑iFLd Oz!]]/a*Y\:spl숻I"*h-7vvqm:FEgY<-3}/y6awwۘi$gG1u 9۔>H2:焛: +A4WԪV"ѦDl W5 勓&s G6!9xg͝=jngh <RO`.2H~74$)0WN;F$^qqHd):]󁙑l^,XfL&8G]D7|H:퓇2gY(+JjL^$,pU_f1M|\7}jRN5Ⱥ>|l04yORb=qc-Ib 5Yq""[ jUN bM[DUMH Jc>Zg$b\ƙ{i+l$n\yC8dZnY2b]Lˡ=5 ;9"
/`3kΐ\a8.'_ Q2}Brf0':f g3 1͍^ʼnœizT1K"JaLSmQ.'tl !1k<݆lI/\84t@)| ֘GS7k nQ#vO1Js/-ALg, m :Kyo {joC9kM y? YˊlZ\>,΍QA.'ʜ"MEg5R;g#9`;҆hm7CDkr'j_;9w9r6r&;z/3]eSfILC |1J(ϯQu]/Y'|jbOlm RK\] W Rwu!9r'=Rx~݆\O@Og Qw0Ҭ9=ل % ;I85x^Pdg&80)88muC{x"ĵ$YTֶs0}pdX:s]'[딒<\~޻ M2$9XH8?R-ibHg3>AINCհ}qEh5dkc;uxfJ#8!Q|@gSO/'M7ʁ\?gVY_`tÙ!D_?]WԨҹW/+Ke:nV:_&k=(N)v{/d6H}װA*@yސoo'7|L4?ĸ1jt "|#yC&G If7 EsGSBq&yHP9j7ȯ>(M|1Bq5P8oP| ^+7ϛP>(Wb7xosƿӼe&FOt(e^8?A)3/(|_P7e 㽢Z_!pC5mdx λDXc0~.M'Cܻn2?ݖ;e=r?LJ-q>r ,o~++LnlLa s$74oFVv]h3q Mê1saInE6~rpI~HT v~C CX>ރvC?1?,wCư,w,hd O S>X[FbeRT#+@iFw?ø SqF pj O S[1?)< nQ7%^nT!αv }|C7E7g?V5C!7xt?J>SovLOs`3-T!ê|k>g>ųk.WxDN@@kIv#7( Z-#މxCځCxIO[9Us yutSVݖ?@\{Ln>¼Wov^M-o}T{uC'Nrpr+nR>ӟҁ|?/[8]vh ?$^9BՉ  po`?{KCNN^}Ш-MpPoaĀhUu`}V?9.[_!|BwPnh{3![Z1T67Pni$z POF ~%61?|  6`2rKp+cc>{Kr#FcpC> ~KOWh]/{2Flu"AgJoƟ=\|3a?Z_[՟VnVO KJs~O[{O@9G˟\#b Qz; }@on <-c _z?--ψȷt1߮1#gp/%װ@[f_da/7Ξ䲦!G_AA|}tsP~T. Cqǿֶ_`{̼k}H+ɿ󿐿 |!W_'MO r}-E dƙ WMA=u^_f%b /^i ߓz3$T_}8_hŻM|zS1hMU4᧲!w~/ __?˹:|gwU .ۈ_$/ek]}qcƗv /FjF_'߶M\٥dwciO_ǘ~iLjw={߇6}gEƙQ?XG=_{=pWYYw__6*8}5xwqxbfu%r' ;m{3<xx\ [:2?m'g:(]᛼z||~A¾s:nwqfU~חe״eq O;YHjg+w?o @Brֳiܻه~Iw_ n|^xex>bi<&G^F?x}Һ4oȞS=ȟ ICߨ} F[ß(d_υ3)i GASޒn~sA?;|gD$/-_+߰/}u2w?E)'=b4K#V$7?H+U`;Qa仟d/9ye\?(op{ 忮Rj/JT^6sROݹ/O[~J @e 骥x}xG_;=WxhØ&= {^D/8 o,ɲ4פE ݟ^]=/٘B0>(|=|gzx`vo#^g:h >D~ aW+KU/^}?#tt\?ѳ+LծC}aMuM̿?.O:>Q^e?P_m>}kď?~n$uhm;Gf~R&VŖh?nW/j' ^0f0%*Q~`2FxεW9 ~m?p>\bci~rş_7WٵacWa<~4jN~x9D-a& Y~i_& $ z~ܫ>-~]Zca:_/rb`~^Y_=i^uyvЂ'0wA^c36wBُd7-+/Ww?P?[ύ m(0eDmC߉]l WW<(x|q[[(u.}Şg63ü_k_pď]CZ4I \B$_^8{k/>x٫_{tp}$jȼQ?ƃW~o6}u[uZ:uo~kK(Y`ßP?WZb xQis<.x1ͪ*.}Ow 7EN⾈bPlɖ]K/31x_D擉Dm[X,|= Z?IOҺ~F\j2Gɹ@?#\OOsȵ؉[P{Oo?pV?X]Z<9a5θ+z[#j} '_U[_aM\"r"`(3D?? _x3B߆^5s` g;iA[gО T_!]1}_w|FӔ墑I ȋs5ވ|DKLG=P?1;ãO/EZީ*3{{j9VLZz)ˀ?=> %:rv^:m^JXH_G_~Pz rǧ}]vϡϮ4EI/ Q=bC"*>#AaJWz ;M+jh M~f8g.{~'Ə@e&)wY;H< (QthK?}߿7:dux9#CtM|Qҕɗwnbq1H6;W^}(pM ÃЩ~=M/38_}>?1;cGooS(FˆwO9nf9NZʼۋ6ݐ/ y+>l|5ܷLr|oEIyӸ~ES>LonWσ5GY8TwWoɳJX~MrU-+(pbƎj7 *#w}Q羅@kuLۚ-_-}*t=Qm%ST<0[~>^{v=?7g?*"g_KTl_oH= \?`߱{?a7}NuGrhZ.e>v^s#C}ᅛC_"qǴ5ܯѺM>%įbD!x77VM{aY x!Em5BhLN+\zqSI$#{ XCn|PFx5 G# ~yf?aO޹hbgY-<}OoL?R|Fq-xsYQk/]C?oL%؃۾{r,α-W? {Oƺ̩ɯgQvvy?~Bs޸cTsΖi%r2 _p iL&܎UBD))B!mm'93hx lהؔ`OLS$WpQ54n6uBrr!ClV|Y֞/0oHPHۈsumv$e`|m.h,FFбN?̉7,m7LM2Hv2+Q⨄DLLB+S$aQ͖aK*E\B?C9莝ȚFDMClha)&,.6>VY-!TU(f 9xVqb},˳hYjZ\$&n)Ͽ -w*PЯ3nx󑞑!r.z?}ǻgnirjCUll 崕dsK{t^lH4!xs-pA -Lǘ/gJ8J3 `k) =QVLꊄd+ ak+iZ}}I[aJW3n5ZDԻi"iBdCj[y"aPeQiն5\AITMNزY5Ml6j|&H`7%.ø*P#7bKNx`0tNRݟ^P3fAk5džń ARƅMUСDkъc\#`]",6v$0t1p'vSW cUeZW:?蜘7\%yf=o[U $͝QblOŐCk"-ך4RhX]9^ bo0 c`dB/\O+ 'O0>Sb"@\ЬBy =]f#SV([̈oEfەޕ8aG֋j8(BkUrFSL#~M,o`YB<rjNwiꚞl$V>4~j:1#ƞ.Ǥ>TkyTXmNNX)|Ҡ.`h nU+(MI _V VX@!5g2Ħ4np2Qr!$ɠqdҐ:tI1NкsG m(Z:'8Q1Bd~{#fĿI>*pȩXU9X H^Y.2+=~o#|tٍ폜{ߌ~S}d{w3Q_u?yP|~9aFc}>Ǚ>_D5S^rBU' ~>UW'wL߫gc/_οy/} L3h>tG݌# {*d7|i}?3 2?HNp/S^|Wq$Xn//Mҷm})1;=d@Pvs&uT%}MZ|"5OK骻aP/qo=*G2 ЧHEI!?~TUtK>U? >_p͞{\ҳܿW[ONhWMRW4|]_<PAxnv>?55SUװ{,W=—׾_pszӃ;M w 't!Y05w @@X=S938C KϹQi> ޖ^wp-t yG^@\4̣/1^jܤHy !rP$(T诊q C7ߝ7L?i$ޛ//u?|cv{ql"ߟ㹢 ~є0gVy E9R0h? m) S0 3d4èب{¿ĬK/O(ݏg74dO.ė> 3_S:_ qk4nyr-ܡwyA)?[S///+'۪t8JeT.df^ 9`ڋ?W4?:au?=rZY-^zQ=(2:_Γ:|!YނVUs6KVw+Hbo_8; —yvnr|eħ6K/+d}P?5hr!>߽S•o/\/=]2e&۲NO=WbFwܷ/VzĠojW\2d{u9j̣y.׫ֱE.t:#?; +:9 "p>g`תyJ!Ͳ\E˝:u흣i\l_қ]%x>j:sG`yXIa ~:S+IG/Xˉ-3YlT羲j/>M?lKP l_EA@_ZbB{aAʝFR/ћ!NJ]"okP뛠^ޙ wǯSx8y}'z֬6n{uo޲oÿo^㎽39y߭>{H\W$=ɋڮGf?=#yx;>uWv}cp`޸+8oL;>{|/~=0L޸yFH.6gzc}AE!O.ĝ~$t^w@:ʲ/=,rXG:EwQ}eO{yN9e_xê3K<[+<['?]o2{*BgkLK/u8\Bx-F7+y1=~)j sF)W[SwӋUYrz5GpnGw(-v',d lirq58]ҋ٧tv_I^Xىcy 9zvǖ=y"WIJ8;^nTq<ӹL޳z;/q+8o\s?|zQOGNWpim1xu߉_*)d{VieetQz~ڙ{.uV?EשsZ dd=^M?pdy_|O_ (B؛OKbWY,CW8/LL{V{=x>I`%wec/DW/+A#`zub #Kl:y֞ǵ,a3!!C`ӓ#zdty=>_Qv9A$rvg]{|~'6ՕۍK3?rΗ}_5zq\J(ߏKg)㡗CWc»WP;G=t[ Mg $ Kw1w>eq|]8s+h^vw>X=ǚ7ԫ߼_ݰ%@:+=_\|yxoc?Wk/N T}D}}7D?u6i ~szwۛ}#jlS}vgiim֧sU|{& *(r^xE@|u|^ yM׀M+36Ja>_G+Z^4;? XܛC_f?Ir߯ݙ߃MG~#"ڗ]uCyr7q'$yT"In>=G/CR"=o:"}Kx$վԛUdӡnW[>x+s1?BQVzžuwYfل[>UWAպf*}(g>iNrRdYV&Z%p\V!ĘԕIthVz6hhY_rE=;IJTVq-&,04f[3 E8ݬZL*4%anͻe#cLI+~ 2\5mqJ>Eҳ ĠC N2GPz D]DYጠӼ!ڙ/ )kxxk CI@g=:Ğ&Dn>)❂xОN'ZHrtL#^p*t%D \#42Nx&W$jmw'̘qu4yg$\T;h#@1T!-< 0c+mp~A'd2_m@MvD))%EСr1(Zɗ5>t~FƛLeBzZqR3޴ /1XmIGLL=$PzV!fv_8?a.+3?'-HAbV Dmq,ڒnD. MlfI9fƘC@9ϝ'p:[)㘲]< ӡk*8KH:h8I<ؠ3 &#UP /O:Wsv^.]1 1,&ٓtvPZ&NXL::u={}6CjGàsJ*Si~@cmS'+I^$1': ӌ-ڐQH0Oơ> ۠I85v2BqCѰ`$jn6lp2 Jev$NTOr,#K ˶'lISc8BB;tF'Kh)i]>Jf.Z(pٕ6VYj-_6VO1lK]ig,p5]GPՎ;ڜyVV2&|85lxL!4 ӎi 5ilh0K b%&8P5yܙ*-~3J*_6"ut2Bd/ ӽx2dx$TCTvADQеF7lbaiscj8 5PehPEMj J*nadAp3gBCPV0ҕ&S\[.V閦I,xR݈Fb 6qiN&C|] ۘ+Hg yTv `b"2䆔OD+Ieԏ{\ 2"'mNRhʅCvG<(vkd qס΄ܐV3kGlc!癓Vy̸ȅUc[_TriY)ETmUPQMe";8UlSo,^q8#V83mei 謫F? Nڂ5ػ'ޑc sin,jNf}3>PzA3o弍0+'P5770uL:cAeDÆfU<+dp29pt@ketx2Ӂy~#TWLubh3B34*(Q:OCsTq mL.*L99?2mDU3bc$!tsn.2jݶ-;KB rԥ݆ܨ'2_Y 7 3 ةg{ Fڙt{*SJ"w!a=f]-c4:@5&MP FntҤqftjq1|Lx/ Ⱓd92 RCy~xV XbiE5$w<0 x!zabꎦXOZƁ=>C&Cƒ5:ãHBLJшHe 6H![N,^)3 t22 #V9'o <2<3[a'QU^zNS@j p>Zگ?,Y]=!a +Xڶẻօ)2k S>ЪPX@ۦ>FFWr*q/,#Kc ~%/A1ߐζD%FkOt.v 8Cb)ACT밾w&ne =fa8栓iƋŹ6zWmNergD﷤MqZsLg{A Hh#4V=BY@uAY@t0VȲ媰)YX""c9UQse7exú@:7PgY$혓b8Q )TDɢ>w6[ 4ڍr );)%;ƫZڮN!<=z܅"mrU8L[gH';^X 'yjۨ;Bu{(`)q΋đ-i XRJTd^G1; ɳo817!)X&@ryH4|T&p,C#I׎8%LfXZvy &*H]D)Yuf B;3j[ @Oˣ:dր{g p[|5'3ULy aWs-pA[8A')5K~{-HtO Ilr0Y@22WKF}vAkahG VS8vj* 9K-"FO8= ة;ul5LFB2㓒X,lac^Uqv ;q*qTЌ0MҞWФTm6##-ErZf9؛~;MN:ȭHH=mW ڙ`bpVR@@'22!bQ}qM gi> xHx+kO>VL( gcm>V9qYl12m+ \G iǡBH($D 02mnIbe[öYCn5<Ƹ6fd55;YjLQ;YKЎ明+X dw"H=>;GC'Ǔw,zhnrիGYjE C&eC bb,M:" n啍Z9%.]Z ߪbm+/}*>5]e.Fބ h dIX9F;wɭE>1 xo+ Hoaϩb(6M[Ws5Y{j=Qc RlJ4!C6=0 Z,~U2ڨ7,fr.Em+lHJD|Ϻ@TcɫNhIED}3zl Yү+|&nb$|y Ao79HaMH,rCSXZX+fasdFk`ߌKD6ڒyII̧)_xZ Id\Cp-;`׵Rn9z} RI%thp0^'BSieIiŢÔarGo4ǛO }C@J4c$NpFFO |횝OgI#VH+ ]詤w2#Z֭@rcc8Dg%У)ΐ?KԵ>>)}Lpkaza,[0g+KRO`myL4kt0"X@4Qeg onN3I\*}~Ϯ;L0>ϛVR 6c$GԃifIН7,Z?N#TGث4qi8KjznPF7r:Q'[q b[qY'6F"X4Q5ׇctQ 6' gm|`8`C@၁Ͳ":'cq w##Y.c"ؤ3d=lSSvyK uXu/c,C_IH+zC`M}Z@j L.Cش{atsQ&q)୘55m`;seRHhnB*l 4^ T3Laf! L9T%L앿\'Hrj0ܹq$u,24E 5Eˍ1pZFH-<>ux9< VL&U&:My uǂA șsŖ9ؑis+3םi+rjy봊̦*zޮXwNydFjZ112Ab͈£Vn.K.MuxsclٲؤġFfЁ:slvd'a*4<1iug nk%,CrZ™LL%,iA dlۙ9rMFklؖ`+hr|;ȰL6׉rȤ6cC|ӒPgK T_;|PVkU]A m߳Ҕ\lt0:bIylZjw mL+\f l*YW4wMD hb2x!Kj&*+S3mq.v0g.:a)%-X99YpJ4E 8HB;*{")gs@K:f_ͲQ>Rm-l] ^sSZ%(˂I6JPhnYN&ү)DrfYb-eZ3WBLQ}~Ł㯇vp 949q>eOb :~j097+&sHfH#B 0!#㝉H_.Ev &˜sڈ<+5Q9OT7SvҴ#5Vdn=l nFE:i-%CőU )m6WDm;300: 3`v.#v*vuNRfA\SB//q·,F`gaFRm|tz\_mFTݣ"sDp4g32$aDʽC4r lCنh20č]I,s,S4>NxB;Zqf&s!'30+Prm-NYK<"2A$ 飝oJ!f WdYLC_v}:e/( 9!(  >bAZi<[:Yv7v]kHug=lO$7 9^ٮhjXW[Yát4f=*9XF{.gA#Ii)N =G'PQvCC#yI+٦McZ1YP. 4@d dA3ʧSkDfb/iJf/>50Ge(a\\ t5h sR:LX#D&Sg[M jʱF-wት(VNC2j{+ ۗ9Wж"Zd+ tGDv&[n,k6vL ܏f|FlO%;,ȏaFBkݬDFV-z5\'Z1vDͰW/1pKt$zBvNqOt(#a…q: n񀬧]rZ'Z?Tny(BSX64bѓd7b%4p$̱l w4sfaS9#׎ZiHKLP8C>b6b&d_s7jY5"'|yZכHiԿJ}ys[ץw~ 6 J>y2*n '*Bn%SvWE*coYdtٮ1%IIk 8ynMxEQYLsΙWe^khl6YaxߧF8aU}tZ FsT5mΈ-d bb'K4o]qݓQپDž 9_H:[npȔH"9pƍw&8Rx[o X>@w3v>~w|MmOH7XdD rē ֱP,L}eEVhg5rk}ga 2!YOS_σFJ*Jfܼߎ,4r#rLwQbM9cl1_]~)A 5?z?DMC2ڈ9ћ:ɉEdܓD6#kJ&Q(jӿ>}$LOS, 7KbH3bȧ\1 8yrw) * ?RW}_{^?}&\P(4is&2LhRij[a?S~ 5f)TلR )JߩmTt4 398kقa_t6-O]_ 0gMf֠r82Iry!pq~7Mt!d_o`~>IN JhRrR.Wdi=a_iD)y,|CPgŦT}2]'wmBkTәLV"IhZC ϋ o)+KME-ӗ$fKU&6MﵱqBnv&ǕYm74iDr{(VI&o~8L`J]0> ;4S {J%^:8;0 !~=豣e=$x>z㡔>6Ʉ*עͻ2 4#ۖt"opUW){Y VkUgϚN`=-,Yjj֙Ѵ kQxuɾ8SǻFÚ=q_ѐő-F/ю2涷&{X}=RkG1C©̞uxxasu{wEny5\?KcXI Y6+7 ݡ<)H6/,f #7>v 7bt16#g>y egw\d5 W%n-%!QeKO(WҬ;nw y{Q#F{0UYV6P\_s|7\ f]:7l-\Yw B; I5QJ5`֌:8ME vjLNbmi:5CFxE9-ጆr4R̓ G!HCV hj\[_[O >ߞ9?Ε~LW>sU T@^&]Fџyݯn7o'(_5gȿJr,Xu %H 0Um;zY C[?'[s\̣/)% p)ڿ:%ہ`a6Jm\~K&U`NfE |Ad~CYXr.6ɓH:V˻ӑ@nDG|Mx{=˾ +}(60oK&Fڷ/!~O\cr+WW!ZM iIA f]A^ͥ aMw,K?BLGP?'<~_߳N (VLI69VZ40Ao иTj 77h WKl¶? oHlA :S<$3xD0LA:j!/|vFr7TyMR&>/c(|KzR:9WW6\ $ n*@~ry<$Q{ɱ83U 7'S ,nE 3 f,,j*#QJu̘tsq0"]<z&G)'$k.0Y]dr˱z]0nGatd_VD(s5Bd_Tˌ\X¥!w))g0e.6ķ D- Ҁ.Gf`[meSa[}~c>fKq"$-]4̛4|`)mF[3~|l,deđMZ~3+^=0ZDܜAGvXݑC ~>Y96w̓Gh<&b2Q<[Kvs)A Chq>mK@z\nWu>}֦A-CZSh89+s9{Q$̇U$Xݺ"}^@OK2M}\>ciB*t>1.%d_g.<[^[EU ,j5NB p#^}MҊ^,cVѻYL0D-ҖT 桜q Ɨ҄"2p=;Czf u!`pX|w/ v j+Vn=2 $8k7x(yBjٸ\šwX[hVctX̒2!Q&B2yZm}Q_' (kÃ~X"n-:K410~\L $Hn0+1G4S2-D$х6^d}H$X&#qt9kYs#sjy^>~DG}Ͼf2 Q:dh Ӌ$ny&'.9>Rkfo_o`E? dW)uCP.ZTt,kB&UƪԤ,\Uc_ң̷f}3'suEtYܼTDȎD^v9ͭQ&&#>"?WN8^ 2r5 C]$:e;9ܸevN^ R>eւ}yR'yCx%/ol˺5xvW̟U# du=Qc)ϐF˽>A:|y d$ ;$/WZn'{7ak0x}LYIU~v:Q0I|lbKkY"%ocbqMzR'`*=r0RImZW(q٩'-c_K!uLђ돷?vcv/l/#ie*DO'>a4^^/~V  \-]r~IWr?g*Ԋmφ.&b}˽eo0pB؟5V&﮳G"Cz]. u%. fPbTA+_D? ^ ظ"8?լðk$$b$ ݺ(+ؒ,4bgw4/?VO$/*TW6>Io)##/&sI;· c:?r<a2+5Zw#Ei[YcoB$3p!f~iv-$jt Lm.!SR{} 94l:lNU^ŀ~X`cT⮓pT7 ~.0Pn>|#ܡ͔ ~b/f~MB5RT_s 1 iTUA}Jc><.xǪmX&:¿\)>.(ϋh,nlg> q' 9w$]7] 0/}Evv ظnR<&7%so2E5Cь%ka쇷.2L]ݢ(l\</Gsxb3 >\-"6QU$<4kz#`聯%q+[Ƒk.r9LcY om2[o ǃFs`CvmaxOH(V^ޯIeJ >#ɿι!io>B! Z,V~-~]~a8w;eq$qH, 7\>'$'V͌MkuVGϻ"{u͆:sBt|zcMNۓ#j>ph9m=f <>XlQ qI͠ `2|]cIͩWu)A`I\a5=xލ{_ƨ]ހ"29 8SF\6`y3H= bp@JX$)?}}( ޴~NDR JyPj?_Ԟz-l(HRWH"gvhU|oI&3ߺзbN/C,Oݼ~wRQ9A|@2l껙%L.0OSg ?cAΙ6\N'>dsIEأ)8 juӲsV 7Z% "?/c]5MkK7ĩH_LR;پ#&xRz4?L!@LԸF4o>'va!4gUox5 Z)x}\_AEJ~xO%9g´y?{`^RJS3 j-g.ā>4EFY.Ee~Xi _`ȳ9tج7IaL@o:6QPVQBVR%` :/? їL]ixOeؖ3n+vB%FM i=/qhq\B GVUڨvλ-LlI-,{U< ?8P%8fz*Id#ms웡1b7- ž,T O23/gC6{e'IY?,vSVK ҴQǧh׬]VhGӆ:d_3!b\ObǬ'bI;H+w ~01e6J~qbjwℓ<=dWmJn2OI0اS!r *;WD*ϵ}1viB'.\ՍX+|Z=~7]F<3'Ovz_J km 3V}azG,&[Kʺ~NMݒAl,n㯮t GhlDθW$ 3p.Uc0,4}s,]VcN!re:diA5?jWP8eF9Oo~~'_MB:xIѐ ={n WH_ώbǻ(8+ #)Wf_ԘmDt,!WgG <Φ~4o 0rMZsZdD;ϡ?sCVͻ&78sτou$f٥e ๅ"vlDFsW ` 80{ KXC[YYf~0DUrWMIF*YkV1 kM#7zH,]L$K,WYl[e% Mݱ.J7_S,>_Q;։JaE3@r4vndY,ro=ĶY:I oc:6j㍜2`zK'ǐ3j +7@ztTvHfhr#כ \k8l}kʹˆJs?&l1lGuMV$ĐFR4IFg[hg' WW8i[ j.[ ͡s02\EX/@o$ӯ46\׊@!o2@HIx]CQpl Y}\hcw9,%9DwU>XN"yۧIތ,爏O=H!B7`da$255ѕp9+n_`80\#P/(Y17_7t&Kݦ_bbLeG3Ss<(4ǽ VҌ"&gۍi>gjR_Û_bBZ_R 6dޖج'XzAH 9uiApyTŒWyOZwym4/V?> "}fZoWWØm_Ў&T(sHz a, 37Z]b Ļ&zۍU[:35ky!~/?K>;gh^;9ymr+ix\B _.f$"xaP\).3d><|έsX=w$e+dxPy%۽=k%|ʬg4nHΏ0A {.vBʿsq}|MՙzHqh~}Z(xTev~s x"3yU 3!pu UT&UQ<ªH:}9HU%v~1FgxM tHD^biS+:?w^!*]/JZ[Y8GlD^73C 6*|GyR5ձ^*s|NvQ9Z;>?&n\^c*)H5c|{:e?_q.iwa"9s:ɲ'1@N .جr7J(019}m#YF6Δ>rHĬs.a<{6$ q=⯠@a@6Z^Z6byW+Ĉ"`b !Q@n|?RM< k5/iFi^@58Ra\ .f>fc7*JˁԆ$l9Ye1 ZaXdCZ]hJvG辘?-w"eD색w-xt*)xpxEUk{! ֐O+rWZ ZVh3z5+!O 5=Ty:十)w|;]Ɍ7PHܣڣ1RîpeWȣ~ԟlf5 z0 Q<~_j#"2ispYiC@ƪK?sz'mK e"g{fͤS5R\! YjCZlTkDILM;lgP[zl&Jp/ǩ j[,enbhMN+6‚=Ͻ[Wdf +N2+`nv 6i%qE1sdL?jQ'hz'*EvVKA&P&_֩/xiNI1eI1\ybhA[x9{i֜HIl)do"~cG8s67$M,-b8Tl_/;*Q$Ҿg|>yg~J^3LRU|+\KZ74G|DYqbQ5::Vo=p3Uu/)Kb ;^BTGH_:d]f< jx Xۂ<u>/ήXьB8BnY]d gb|,Ibi>Y؋-]1ec߁ 5~ʖxN֌Xn<l O;g~~P Zш3Yo9?왗S$^RJ?G*AnH$h~wWSg'y7sxLu1Пn=6C2k~FjY9ρ˝\0[ r{ '{/Lˍ7dppX=|k8_e)~mDշ3g,,W6RrAT˗7&{Zk@.i^e9aer!DZZ#EaZQaLoacŧ шNKȣνSz4zJ$\Z);6Bcގ !6d@n >d-ҳ#Zwva?-9T1 wspޫZ^k<P9}g.wdU)EIzCL#[8 ި@^euٕ1֫/Z6ZĔbp`h8YԔH[4OpQ-.N -1N~xC̞>+c*Oɮ;ZT}6cGhI!H2> cY!^k@&̿Pz(+qCXSQO,du@*]LYHYtܬ)4ǿ!BUF|'uOG*ˑZj|Iݢf"Kcbe weuuLir4<`#@΢W=40i_Lz,keRQXsr,6X{SGiMNZ Aa>9wDtSi)TV)otqqX􍨥Ƌ{BJ݂ EoRH=Gˤq3{\uݏ|SM1+n߫N[]wͪSio?uO^s/l= ǙP(%T]D^,v1ܡ !0!T=q;On۟s 6m]=gyza[Y<7x/y;j^K ܴcrv/X2"#>5/]3Ax_} XXIgſ !UB7eqDBl8usCHu}A' {8$[Sʂ|qzDvf XE@R.M wƳ(P9R$(;;잙m= 5qk:o5cR_@*4!c.yzBn|IiI}ᆡfw6$.v9"Qa gf|J7#s1R3^a(gn6 9nh'PU!H)hf.'>j[vvEػ*qXm&ؔG pfa\Q_5Cؓ1ȈT1(7(ik7޲ԃŹ VSGΟs0IC"q0È0:NjGHph_DIg3FNՒnO@)a¹mRt0Yf@t.n.2LЗse|&#qXf/W]/Zq z6iG*wyE!y_0OQmBMo1 za5;ɃfMn#I+u փ}cwHH }T$UUw)uJK2Nq"cBBBJ<?,ϴBQBT>Nj  8@'WJVUx Q%De րToK2=q>:OGC򂿆 !D7lQC|QdtRFdĕWm?iR#ݘڙDBAg. qRt%R"ƏdAJvឤ:4v'Ю3cx, 8AUHJtlzȥ+M25ɲ3AVhA fmRL'Z;ph&9So{PAno?h ߀rvhD &0Uupü%{Eک}u@ir m؊2I6}nVw<2'6ɋ/Ύe|uu]C.塔xu}f}hvt-ʲ]]hy5S=T)[=$O[_Ie+Lj76#ѯmҲ7r4^VHO8ktEt`p(.@n;&^=/)YxUЫǍK;^K =eE1}>&,<?S>>+=#1Y7ќX=_" Et#%}ۜ]yYb1⥭][:٪蚹@90,γigȶ`'Bj@Rnm0 (ewLƫo[W|,avk M*efDq=d'HW̌q&t,ߙT${OM' oS>f%2RLM^>Nt@9JtI@A۟G&Gpx̟y,dHbx&<X!d+ny;sM3R͡H1ZH.SfC5k wKoBS͛˴^IhST9>ȇ-Afԍױ0q4׫R5mxˀaMKGk8iW3p|-2SC"Z{Uj4Q !tWrtk$Rر,k?j잡 ތuzg@d~w)S=.DJݷC@Q~q}e7P<;iٴ?jWB4YDm١kqMN Ʉ"?[u R+Hf*QOscvk7~HO>N-&i}JR~<-nO)7 `:X$6T%=cl7s]dq-KP.z+&)>'5rZå %,o< o1PM\sAsܘYZdG¾w<Áz&DѬpfzb5J2e*5%c1jp6&o8fHQqȖ.C6.4#C^ۈӓx5'/E%*mGjt!R2DgTGx͡debI9d4%&o[u:Ҝ.u6~11HҌ3˝5UՌ?h0ZzvU`P(klXETCR˾:<#H%޴QhOA~ޜZJBv<>a9G?'y$zeg כ lͪp!Pn:4 7n~!}`?{kT:<)u emf Tԛ.!W!mVGZ%g]7C&-w:MFBO(2lc{qÑGUs/3J"cՎ-+Zv:p/3 kҙ8(_K.VeH5-)feYMapF"?;d7iGZx;_DEb7@^cOWiEh)霅j}]=ץV.@O{|sq R Z|w_=BskUepVTSg,^͍:D}vQ_=0̇7[Qr+mEN}U}] 6L0 '2j.ă$B@o[4uթlH$D%KN PMg/2 :-f2ze!3X{>_ZO0Fe#`ۭ+,3J?w5 ˦aJ6u u>Czۨ˘ ehU$1*Z!{}(AɅE #ˎ- ~SxəѧTjp5CU 9K$ V?qBBd+40}!F>>ԭcӫzss!# ܳ)}G܇00^XKŷ4S0kcf>nC[#kc&H0JA1Vm*ݜ6˯UPn^5 !Taauu(6LѨG(>Ajh^G0 U~_W l^Lp$7HQOɊLol ;tw;=9 lN.nm:&98 &D"dH.%@?A翩G3U-$YJeЄ= Юʚt q9jX׵}VJ)A`Gq x@<2E;j@c4`]keXR5(9N_ I$#Q&WDYD1 Wlb=(&CէEpj(V{=%R^b`Gdy/s_ U\5|Rmn(yXZ.$邶s[!%9un-x@MGffG~ cKw5n(.x*@hekt=\8tr~ůx9YJḂG*Օrw(/(NGyڂy=LJm㕞Z]hdϐ b0uk̃0LY#1M1 >CxFǯ3 ~[qK%{ľ>#/D|%`bCǒ^ `5ÏcncpY2gޱUQ[VOX.5]#j qTI!^pGΐ3ϪtfX^4DfSh9pWS<]ؕػO +!@k=yխC'vg# s-R R.My!ϐERcRJۧ.7&s(bM.1u`Ii9DC)AW=)G܅b^C$sE` !d_}Fݙu3.g^<}e{֩ԈiP%=/ 59 '%'(m]fP@jzU ? Ѕ^+bUeHL\!:a0,uPgȥ{fH#,ۊ4G)퍪 fU_?_[5hFaA  \ڎup/q_̇$β$^=e &kr`%m^6ٝ\WHqnPM JPW|G|{ᓅt[HԹ``A/T>H2%4[Ct|>`̥;|BTn)YQV<&،@z 2i4 RU*AfU9J9P 3v3#uL  oqcW,If9Y͡oO|rw{!*$ ~RsX<%&ax+D,* ?Nޡf2N[k3.9U׻Ӿy5Jmbw/Vf>!j|]sơ-P\o,FQ'*Q9X Y> Ip\= NTaԩ׍ \6il[F=- 3Rh}UuTkkjP0cQ'>7*S\P 5+yM1 ,I# J)8uaHtP`xnjL;Ȝ2kgV+ݷoU}^PQOOl Zg)v`Vu4#oz.#a'<5t{(&:j xQVP:O2ǸzUfdڅ?;y{93CZ~F2󽊺 NAakoyj|B?sJp) ~u\XN@ѯʽ -L 0 686<}˧웥m\6[ $H{M)It$wOޮ74f3;qgMMB(J1BF/~UEj2_-cb06E(ՆNۤD޽`Y@5|ЛLgۓ2Xވ mk%^: 8M}tvG K\pvVLqixAc|?cd1t!6C\bpj5KsZgpbޥWre}K#ə a9ODV4GhZ:lUH)6+= TG\BEJ>1df>aӍ7^I+X͚rD:^nZr}$Qܻ'J{lYrT-B&Rи xy=W'4 l& /yXe3q>mn_`lԱ3":0?={\t3 y[#-%Ћc"rGVh;B 0AŻCkF}99~>7g|WK$/=gs#Hڿ.|lYsʪ?2jAmsVb1Md?ڄr&Rx{|%Ӂ6B\D<YNm H,K猾?@yd?Qزy-dBo͘6tI^܍M\)ۅQHo. qfeWޑiRc0%WQcKxw1 b`}_~o|o:BozHNAH״q妼ݓ!C$;6 Yðp4)߈"O9U;ŸeWrj2OðhF# 5~?g}&p$X22\\̤Hx܄5%gFj ʠN n獳/3C/kbpZȡ'Xς+(e/g VmyD$/Mw o9Tbm⠱(qzYe+׃G"x6uu<8ղHL?[)#]5&p-֌ bM8B"B1bj)Lf ^3NZʶiҳ!YAV_uS8DzVE{i@3$GwDjb7/:%Q{:bꙗbbOrr'v,zuF |Y. g[| =p6~z!KNF6+ ¦@O7KsC|Kp UIht*z"y8F+XWlyA/՝R1DL9#x2^e Wfj)Dv2_mH4QD䝁.G]o.r\.F@.(HN>t{ u:VSʹO½uVAEq? xc>;3B%' GtIo"~WK"^/եpI#O+Œ 4Эq4C !YSađxTJ"B6 ~r/:f4,J%=i\U6A(u:Kef\sx]Twðp!:aCF\=(L@k7=S՛Tb\Oggxrt헳IV%ǸDݡtgV-Ͼ=Mla::fLq,~)V;,?Vޛ[:Z3!3hL(),Ke>rr(hcv[6x*J@%ɧ0L7S' @2ppٹو $ަż?Jao_uѡG^?O9apθxX(H%~:QoF-]pNv"N^,y\!Gu]U]>#N2I㤪lh>!n,g'¥dڅ';l6,Iօ~<2VѷHM|mX\Gl{fbtchd3`.2{}pcSyܲnb!M[xC=%ۅ;G@aZ{t6Mx2Qe x‹W 4Ņ>8ud TE?O`C$zG(koY&OM^ ꧻn.BTYzLA#=&Sʰjz s~9Ea(~w3TcI噊[9Z{6[o{OOgN:LbOAtv7kd {;ը%f*r%bP\Hh,[G-/NFꆾ 愆\‚ςP-T*[!d`M.ei }hX:TW 1_Nn 9V˺L DoO-uj:-ԉ~5ߞ|ДT ݮģ|~2WզFlkozc7ÝFSξWy];~VKO8tퟷ}hW:<]ַ;}O.UFפQ 8@~=x Ҧ>Pad1#0}Rsמ tC(G['O'A =vV49]4+M/YlMrC jgyV}Йj Ju,Mئ$O5GZ boA O7|{~CE^mtè< Բ7¤Si|YJDZ :9,q7>چ{c)A)tB|^ qB>;x&9D4ᢅ>El$Boa"g4i\ww χy+V%vհ؉xqh] rLߑ;)4tnd+!Oq*%CB EI#kqkTQ|] ̆> .&lQBB0%%0ܝ Sף@_Qƾ_M{FpqGL SMCxlU9&K|v(LC 'Gnecd7/.E]wyɡ2GXjɲ .E3_UVw"Hw7W?{(  2v b;&z,>C@WqaEL6|ϓot|N !?ek5K}9unYU=Cb'H\\:y< W2:DXFuwktNRc:mR2ýj.qgfϠt{su>y;T=Vc[:X U  6 [+yyc'!I $", Ho࡮ϪlJ*jQ-2R&MU)mW[C48iNFMWK2/r+yrj?LLIvw|;D@O ;4?(ֻ ]u??ե3Ubíjl]5U؟C©ZwQI&͓9bH> JXE0rF.3( UP6sG!1A@f1ժxvfrp^eqxOE]*ùuCBƖP!?OudVKGQa>L$ VU@>cI0A>9ӯuHYh>3:U"ݰzעah NZ%el9Ыɝ nNTɭZ}>;4eI#S$I  ԅ911DuӚC?q/I?? o:R=NjoOEv|" Q?f1;? k#}(Yfc{?aY&?}lg7Qq0R6{c8(5W@A 8>.}<_z?ǭzWEV8(l+ج>Ə}3 AA~] 3ga.Ga~۽}t} 폻 !|߇@.wRg@&4ͧ~]FQ iaVQ0(Wm4wFQ=yQ }`bw:Wfޏ0 q_$`ޛC@ԟd@s V,tf!F{QӼB8% $|YF}c6|%? /y#LѼc*̹~,ğC'Ebo~#\, WF} sg21> Aq~"sO` 3{˜냙LN_fן2wǟ# $H8B!w?)Ů>$bK@a <|Lvw#E}\x`x~/ƁbK@aq h|NGF@:{MdFu.8Ou?<8Q?|.Gii?i/Wј6?+4O?B||3LܟA WG]ʨ?%+ˏxvJ /~&$3*jhJ WAuğw`ӵ~ \ ? }`,)ם}c?0|}F(Jxo~jNw3#8(1]/GǷS{_f~Jd)ܸv||)s8/e|5z E?q=P"_7_u﬏`,ޅk?W Çۧ9Usϫ{ cȯi̠ >f/ᧇ_]vܚcd` ?{D,s6 qܸ΄k$,Ӷq۸۹0Q]$jǁ,᜝T*Jun/?؃+XWp~>%6} ^=(MZ" D5D E'@ʭ&~&5pB]^vgO~] SL3Wʿݟԫ`ۗn*X-ʸL;?tUZɟ eZB>=^fK_G~I D+Wɢٟѫ`Зm*mxP|JW/gպLW+WӑHw᪺_#M#^rEÕ$Ưr'rotG/_49G՟{~J?i~Ǝc/o*Q"ݿ4G௤/(Lw~>Sc7}F_mw33B8ڏ˝ _.vfo h +PWًܘ_m*zAU5?Un1'=Q,^MpC||wNMO[\>)ka(:I>VJn2V~}Jⴱ]#qr 觽r̗Irg"zų҈V+H]^$|._iy`¡qzԟmմ 3F={l>CwϽ N>=劣a:P-ϽN$z;׈ rXJ+/"_".rH}16 eB㘸Pg ԍd*T%ɻI#1os,y#zgqGγ"Wv#'Ta,/:Btn7͎Ԃj%Cx3Gi+L"a i`?ӺUpVZVnl=;ǟ'jFz(ɐrL5 6(s{(Gz3|,{UN\P)j4갋{B*F#~ˣ8KQQ}Y^ԿxwÒGP).S; &|jЇI7bi߉nM1zJ(ހ_nҋ'2j*2hNđ͵̪Zc4ڭ0,>Ips%J,1^YAuhKft8e wgT#wxRNt8-32tT *M*, v^0MW>ڪu<E ˑB̠}:On7ɸS%.J gڥkfntri\(ɍ1mqzM|'BK .ON͊;|am|ԎQpo޼ ,16YH[x,6Fq!~J-4@`yθL]תVk!bYg! Tb8GĭiaTr)Y)q~ӑ; 3Z@,Ǎ(Y.rɉ79v$mݱrv~\.ݝu֯/)Et+VblՌtƓa/ዺ5NJHmU=k88*g>5)V2E՗Jn4Q+C!5)iM-QV ҸߚØ6zHoX MJtV@.(UŤ$ 3z_ ^`8-1<$OHa[͍|lJ'x–3 ^:(u KfMhwceGra~1 AFsb j [^}7ztJ'FX} Fݡ3P^H :ZftRܾtNw5/"ε+[t9GuD}VN7ϖI -c4ۜҥL;$/)uFun|TкUAaa"(5Mc~t4HƷ8լ֛iǯԨL)Dw6֎5xPMMEP]vQ -SN[n*]ί/E븭ܤ²f^Q[: FP@nUy# 9]7<$#_125s'Jb UdШRw WFK{;ahDb o8DƋ+5|fi_6',%ٲfó5ro U]kn<׵VTI1:kcRV|W^HE.#O;ߦ*_=P@{2P[^O6)Xz_j+= +'>)0aL@tC0~__硷nG2 ٦σC5Jḧ:\A拏o8t,36jGV7ѭFG7C?Y;|PBRIv N/PLO\-0Qá0N[f Sf.qBa4`Xb JptE'i`̢݌{hR("ڧbWWzcpVd,nFBcN?rW?ߜR%WX˪N"*8tt2^aWt=Hk(% @Ӡx_fh{*{No[cJ]0J _ ֜D5#:ia6>]3f:A1]R#jN\O!*U>类RM5sLj1[3[Lv#,kr?&je1-MΪ *_u/Ɉ/ɇ.Ɇj\ MTkFK.d7fu* DE}Ufr2ּO-_v7īELy18zb*q\0Q\'*Tq3IEI$QySލ}pb\\nc+zTsh='W>UݷI2Z`O[Ar= uNvk` z:N ;Y'sZX  LIoJ1qk6su^$`H( +5#dPN9U{iNa9OcךZ׃ XyZ{[k '%ЙOd_ѐ0#t" 6}T'dPS;/>nzE`f{~ꅠbK^ BQ]a:zAaK]aM-6pl҂^5:aFHAHney \naT+>,fŭ9c*/Nhy00 )C";zѕVYDpրTi 7"asY`S_˚j5DoJk.{(sxBUɦƅCݸ"Pna5'0ji*D{OZ:hkrKQ?CΧ@Nұ9kEqP3ew@ NG9. g .`5MYqӘ4Ch N{]6];IY mx >EKp]LSu(5P;d1R|\_JXFd{z  c`V uS{h:Qh7 Gɝ0QhWES<)CGewUQs(AaZJQ*B=_mҘQے,TQ/#|+ü* ],-vo.5HBeBޫn4, []Qam``"<@>:ghX8MSV\=ÁD5?TÿNd0ڸ`x;SGȗ5~Oqxn&ܮRGI)//3E!am~K:Z1ZmG ۓ`(;ɍFދW+O[o;ooo$UV;/߾J7[6^>~;/GW[[/={d/}u}:ݟ~:ڒn=k'__?O{oE47Oko{&+_JWGۃg^e6g7^}*K'Kkbisox_>كΣ/qr{W7o^wkNrx=9z<]yo xߚVn{yу'Gœփb;}~|R n|Zr^ۭѧvw˭ۭkgY(~_zt{o흼H_Ϻ-LGõ'޼Io% |ykk[(ʧ{pIet{s'rkk{w~vrv_O^}q2J(?V\A@m>COҎ*7XFYq]d[Q*-r{ ~7xl޳;o~{oڏq{zlkz}{[Ϟ-d߿ 7}tt泇Q+>*i=lo^oůۓӽwOq{pZG_n?=}?~:Ywx~ˍ'ntGuZ;7Vn\/㷧~&^_?*~v}ݣ7e:}ˋIzӵ{/z .Mzxٛ'׏_>׊[/l;}4yqY ?~޹buF,}];<:=rgeۛ.ևu}ѓⷛk[;o?=˶펊W>}y~=zUy*^=[NG^$oGO:ݣϺϷ~{6n=]z*[I?~,9zzcx=:y|}mlOwY[8y핣Igiz+>mK룇OշO|fmVӝۿoWn}.<}duֻ__|=\{t~=GoOo_zsY~c}%'n:_͞n=:(~o^ohv{S~syddupʳۧ?W߻^߻럯oǓ7{_Ln7n޼w~>ۙ>4zt>Z=gϏ^}yyk0?h?}ˇˣ{/j}Z{՗w{d{}+xʗm7K'?n_[y4x|ɃæTZ ,㦇=VoмyբQg]dmeoѫ[^)}qSUg2PubrrCkrq\xZ|.΄%u9zDӪ;g䄺d(쀧.:@U'v~AL[|M53;t/ :8z~xGl S5\unj{Fژ}E$^X=+_1Q#$~ 7gҝ%uA z]ڤ%lX=utfNQ;&wzD/$zT(ݿϯ mڬ9)`ҷGP(yvt8ꏓ\B=p0"y_(_Tڊ°:RMMm4J4: (Q^L6'Nb1r4_)ET2uwٲ-[Uabv*n  1+`Wp'`Iɢ_[tZaBJo7İJ3zHd_[E% ES(iOJ"Q˂ͷBsZ5`GS~X?! ~\`{:ジBOSrg<ݼi4ɖZ(kzzal% ,,v25h~%JbґP_J~⅛ ;*rVdUo=^ gbi{ G^$:~m.?!iIBaAqnn悽_SBTH]7u`\L c@=9Q8S/!Q ^J'xb4*yf"KY/`9͹ȕH,j5.VV0 ݕMs{k8AJ, i' *Ws&W0EsKVB6Y52[X"_ E* zR"SLf22Yڣ"v(OHE[etq}F nZqcr2FwO 6T/Qq⭭Zjgۃ8;;4EGuq>'1Ui]Kt-yhDs%'pq$S=M0/y;瑾!͢a7;IhyP 2se"$SA1^tOC.`хFć8ꦽ^zzx zNb\OΞ"^z4!n-Bjݴ`TCX_P7(9ǃ~6?ZL?lQJ zPh4 `EUY` B8ԜCϣ&KR!7VNA;rDդ'~T 6Yeb9Zk7o#|tNo sx+$XdE=݇0e7ɐ[ S$Yd&. ]H2;ºjONi(06-CI7I]w[1Wx@!ŠT͊k㢊BOD(FFe_mbL@9x՞Мbx@ُHmA3·HR~GASދ0ڧ lN6u'j]D e*UAv "8TE>Bٸ T0_nL-&gpD4v0)f'̴hyt2_ |A i^3"-oQ,;pםCP_j>3=|"{hXmD0p7,&WǦ]X 4&M-f5a:^(<9jWX/8x'^M#z4& Y ʙԗoP*UN69tsjxisRrr7;G, F`aZ˸ai{Iv{Ao=5A9آQGBE>HE^v͔aOU|aDڋJt ]mݒ$%al]B@PY {(iM]7@?WIԷ vacYv0dODE.NLEdkmOX PD'7@U[h2Q5kF9QyQkrԲH&v? sB1GKm EiGJܞ(buRܹ3B2zm\R0?+<m #6]:ȫ/ [tO 0ER#$F|T66'-T_ԟ_BsdGe_XZ2݀r* E 6Pan\75 8H,, >V$1݅UlXamʼ¤_&M/V$!A`eHjp投$J awi8[St =UsHM U ϕ8` h<6L潩 pQ@S/)l5?lUw!DV&_B82U34's IƤP3gZ0]4̮,99Egxmfɝ|*HC0jV ͜7KQp$T)Hկdjq]l F7ÏnS2H(^ NKG^]MQ՟f!**\сyH?QŗFެе De|*)Pd4c'`7Ը Y+1KF7M&&(tpG V6xo'М5#LebYAl=I=.O+&QI+VD^-VjNpR[Hčƻ7k3cnc׿K|Ai.EPs#?@C \l?danOD%=5\VYB9¥Ŕ&bfƍ0joF,ߦт PMkjm\֕,W*?M혷]r{,?QI} 9ۼ>ړ?}6+eLOs4)h IK/H3,a֔.& )BPrI%c`$a:r8m'vKЊ1EYҌ=AgQ̋@@ۛP΁x4Q$ c_ڮ`S0f1z!(| V_))W5NU:~3ކyu,@9!wن R0R"}!Faj}3DG*·L ݣ <0lB%ycj@V4Áiâs|lCnŨe~haU}qX8[Ӗc5WUh@SAKE Q1wVvΘdjB ָLU%g;gHWQ 2?gSu;)ZV-cD}cCι7" U&BLk`.>GUZQ4ˬ08`+x<'dZ&.1S[jPQX:q>L D DH#O/TºzZEIkhm)Ff4l )y?Փ( 6Mh S W5oT k+RCߢ^  Jv*1HeU=BM)\]!I x q7H @ٺ ؏:UPJ#GkUoCvrrH! Sf:3" ~I:q)%^KJ {ED>ct W3XP"9s.Do&{?m\gGA̬ g~~+>{:lb[%"_FZ.a[`4*P `06)2нSpAE0؏OPbJ %dƭS+(LXB1֥4إYN' PxLo d4Vm[YcW>,1p-W7*fE{_-C908,=MSE8B\Xo-<\C0 3[_#a7xU_ i~7F8Rׂ?'&0i;sM5 P} 6524ŵ uKRnpӝq\%S7E BKYڰc^D$Y#gV䮟,-N̓9z8֌;zt]cMR2ٷQe"2UzS_Ӣa9d&f)Z5ZDs-G Cy\O3Nڷd8">Qv$jI (oCx/jF?mЫ6CLGlcG}gv>pͪSaJ[򇥖')iGmwq{t끈5+WWIRnmoPrj]'ccl|JY=Ol|bâΤ4 a/iD.dG hhjNM:9+b!8c=1 t,Q& LMkdHyPxnXU9+E2M /.Ya_ite(z>$q]`MCeihL.qkFJt; &D52i!)-#4*>n7AR%!Ew.|ՏX!hFfEa*#-m@[R>~}H})H6 @PnfMZ$L`}W uQɥ 8gjlʰnf&uGZIb9 [ې+x㩢Z0>KlHœ#t"2>Y[Vc9 52$2Kzy^ i#T1ƙFf6$O' BSC-Sh?3m/Dfal&`\?Dૉ c/+7pw=е>V;va0J/`glW<^%nO|Bh *pKiPyDZ_% ~PA r9jbsP=H#_0Wk7 FχC5-" ,MT+'0 rr>4O uq ^{r^x \ت͐iHjHT ĐCE?e"p4:V_]5*f)IϻX+cv()M$"OJ}$ZT@qe1# 4yPR Ru-Uikv\k[9晾CafU!F֪VZ]KQݩ,\*tQjXNl /vݧSDoBr|~"o}a̙nS@MLT Nvd#oMN>2HEz0{Ps1lT0cr chv9^>8x^" 8!g#vfi x.uis!qV֝ 'т2>Μ9v#N[S]Bd,@Ф1OM4C(n#7Qu' ^03/Jhp&cQ| n]^DM#cZZ@ Op)\6q3Cz!B5iy_`UJۉƖZ%[Zu^rrf2[}j+o@`8b-!4k$t lEk򚐷+z^$/V&U#z\eMqѭF Xע5> S(|`O䯑<n{njj>|m{j1KWԚտP_%D}H#8.Blfdg7&v̺fO 饌[W̊}1+9-toy !;#QPxKqyE MҦhTmۑ8 ҳ ԸN 7qn`.GYӦA511;'2oAM|)r-SvRi ǾOZR8K.@TtWMd6G&Ś[ByrEvd)LEk Qa2|{yȥp%Ƅ r4nk~3UN0M)_( gř$xSKߛ,uFg'3 #݄NeξG,#TI*QqCrc6 d:OQM렭M/~W'X-~ҟRzɦ`HQmjCrK }Id7iPNwŸV+-=#t >xTIBN!ҭI]1W8rKa RYjx& EӤ oB22Ge JO$WoCLFj)cIv2a.iRJ Դ +t6 5~k~,ek5v3ˁ.MpC+Z{ VӉ U$'Tk,z*e+Oӄ3vo%3qq U27UNuiB5hׂj/f CJ>N/oC j:w1H*>Ԃ:%3(K3ȚU6O^%G;gx[dRd-B(Eu[P/( 'ֿKX\(bRoKYsڶW_WȰe~!._/nu]@ P&ADe#X_ffO9=;e;fLz.Z}++a_aRCSjW;W+2S+3Ȓ"J|+pTBۺί&"O+p:h+@@ؐ`X W0y/Wo+ Ta@Ed+Ru6*].ϝal܏OH·SG? Z&^zf~qQvY5.7~6Sw]$:Mf1i+iqaBՠz n8+3m*1V9"ѿ0gy@MJ cd rXXt $[KNwJg[أm"Ҷ^)3fawJ2/d 0`BLM6)luuuʵf@$Cpj77EIGfņ)`^gUF]ЭQ D(Ç诛R]t^s[Olu:2d!OD.X6 BU[p&vEu *Ѹ0CMߤ#ruRbz!=E 2qϘ6 ~rX8=Hc>)sg!y00Oü0E!ώsf\?MLp;1J4Ķt[&XzHԼC{B $?i5Im x.y*Ӊ߷cd CdI.{!3A41CPgytgSi($oJ.'TQ+(bC+zҨ*̴Of!7+e,x#G=Iyhmd,JO"d(yTwcJ ) lZJ&s8= ǥRz 9M@~>ڒ]Ƚ{-$UxtB ({L˹lmVZ֍Gx8JQ ,l@IÎ+wE5y+!cM-0'ֿ-Cn_»P~ϲ 2?UGo嬜tI]۲&Yy zѹm} "A:1@Νs #$t?.MH)~ydE}$`woaX22nose6r(2'"ӈÜXeppEB|lnv)-{a?jEŻv5檟 Ə6ı5!8ŻGt5e!N_LPMZ:])ױn BNs{-CI1tZNH<7QD ~cu9K.4xwٴ`D9DJVl=a,9KJmȭo\K^~#Y U l)8<"Ws$A (@D4"5aY D9Az93Yi} ʱͪ$$5NvZ +n2H7)͞MaEN-73z1t:Mݒ$A6K79E+\&_nL O[L Ѕ?XD3N^ }."=0qQ7QqzD~ZNH˛gV*w|FLN*6*FbҫƜb/슣.a;$]`2jJ>؋95%sTIʂű?( A] nr9xtuxHJbXa)( ԮAQ%C̖ 1T't0gy7ؑ !]~i܉:O rM5r#N,˱.(޴WWy4KlIjjŽ(wyKӌHq̈iɖ<&0˩]. ꈮ+CK"'r:<,ZP3[QvZIl\ \nH$Os+J5Ӵ]0(iuSxѦ 9K8oS'farWlqaIKN=. 87ꂜ?ðOs u4*Y7EhI\Kx1$u,i%/&Afh{CMEf"v eR3OLXwh m;? m5p.e#/ G,!CKYHP"zdE:kfk [u˙^{N7}a;lʏ hf}Bk!*25C!soB4F+{] iUeֺּv Kdpu & xc68KI/QA+fY/Qkt0W~ 6qvu ku<\kyB ^ ) kkQT&9^3,x5АȏMNal= -ܑ䬔W3AͣPH{ X|x .M#\va[ ֶ` K占 ˨j֭ Sn8'1thdC G fh3.:xHBV 'ꗷ #jg! _y m\ņ{i^,q/@9a8AK1kx<H;0Bq:R6i7;8Z8)VZhݼ IYY!^mM ;٨@ sJ%f8%rjcS{rdLE™J(F%P #B@nsC (nY'. ʌkzC $W$O!š H/N8FNaR/6n- *5&`4.!Ʃ&-K@L) ؄_܉ޠ^p'4b9PFDA_*2' r]yWn x6M|wVjn v'F 1V)afV`-`f0S$ˇ @ E:bJU~{ zD~IP&`s7rj/MԬa؄pVJ$?C[1h~u>̛ͯEY}np WcZ^ Wbö@&Z"eRFIڭ HM|A;'\S|B ŵ\Y$JC 7D($w-\F&a#jei{ȡܙ`b,2%C.Ue #m7ngXVaa7@uHHRK#!LJU< |3o"/Z,sm1[G.(vhp27?Js8RE?;za0#xN@@431ϊ@"`L> iŀLd&nB zt @}7k7_vGgfܔp9\A'0Rޢhhttd3Lds.rKQ@KYDgUIƖxNNg>0PJ9FjC5*"XKsċ]yyT MJX |*2j).vg ل٣ǞUw}[d@ :z1[H?4Zj;ȭ #{F'/۟ߤSپOmPfHCGi~?0a*BX{B"]q4ԸU ޭ{D诛J'31/-^9_R%Md FVpXUu&Xʈ֫F(> @IJQG Jh@u3'h5` |ig-k0d8#@]O;k`ԾwPN+{H1BNUBqE)̣sBLv'4tݰ:h3ϔeA욈 7hx)|q 8wHO.YMA^l; '~>"*hEޔ{ҀIbۦM]'q!*8IfJ{\e9.צzNۓPbgH1h P:lg%a&M[ؒ_IؐՍ!|rA]hT[IP/AecpwY<$tؔ5<HC @{X();;93en0nJDnzuayPl}3M |KD06&X#L,-Zi=HcPy^ EbF4o3.:Hl)ֱP+W]8s=5dM.Yնc|x7B}3u[cܙ,GIR&>DK#iWemˬч^\F'LY hFQk5f&q{+k4^ ,#Jу$M9n 컙ClR$EiCtBZ4'a'~rCEDa4Z\QpBEgt#$pd0hJ`-6rԄo$QG/^!D%*7*K EcylDac88YՐgQ_ X%`nN0>X!gx`穄8e)z4QxoL^E-E_<.kb)_l[FBu;pg]dB9n%K(8(ƮFğMGTR N5 I/cp8$y^71D-g%XjH0{Qڏ:SqGq, q'1U z!&y*Ӓ[^+DF u]rspe#Gdv s[yf=p_Q(W.>JJ+[-6}@~hz`.[jWϤ{@c o d0N+ 8@d^XaP\ڞ "َJfH$Ywq6]jM0 `,&Q2#)m[;!W`JɔPqm&B&p9Aნw*r(lY2mxv-3"pO07ڟI(kkp(&Y9MNq,'A)Yf(d?2)l'5>J6z1(H+KQ#0'M-}pcz5Z ~}7v;Ć'9VaW{Ǧ[$,!ugU8:_Ln>_="Xyw\L2+h^>vC=M~'q9] 8=Ⱥ~E3U4?2OpP b:CJ˩}-YK-0ykF u$t)"Px[ɁoT4܆ty;`wf]oCL|D}0\\m]LF0;PlH02"y%e}W)/p$,Wk4+ڽӸF4ړ7.\팆a{4*USe#w!9*pFv6a %%2ZU7Y L hm^o^A"NsgT4F¡rM. u.U/^0 ,fZ9 qʣ+s ֵo+88}!u'O΀BAC B9{ɳZ}+Y8>n߭{<MS+?s&Y҈!M&ע:^-V+:9bv0 oǃY 4I)5*ֿIp"U|/` )ǰ&εIGxU})&BCH A-*UɍM3b_mi%/w-3qwA"%ɺVXApqD>=qDg2g@MUfX5s3I"MsPֽ3N~(UI:0I%`TR8dDAحqAPm.a(GLE 4HVŴxN_|_D0Ŋ}N, Ӥ/~Uz#S M|^V6.0oY0C&Muj7R6d=E|h|G9nȠ5lA;nkрm7 _-oAq ĻET? `! UAk14[b\i:{sb1|hZЂ9}CK^m_4&)戡4sKgCMosM0 2HwvpM'lǴɁ o+%כ}52ɜ:W\{ccމ>XZ4:.79* j[+1qJvo@>N[~ľz  +Cm%nRti#jbMHD:?D">zX&w]@#s[{M]& gDdk0 C(IfIi<raZփhd_[uVFhezZj+ a\\B!Grf8F []5 +.ȡK ˩Wu Nx[_jno /B ׇdo Nbe^TZ ٌ*9K.^g^fvl3TK{  \YBQn,\.'&L`MNfnZ՘]D$#8_ca39OeHi:LלF5fnNz(#%umf>VGd!5Gh+`sJUşG2$TpI;r2E/y^$`5]%a We-2J//i4HIo t=p(҆MTɬZʑXNi\ol{"Gt2n֣O' 8D RE"6u݄m9|`rp)pp9FYdkΊ )J*Ykc"s%N@ J^w"?O1Dg6 1ܜ_ȈJVk&GώIoxARN~{.|?gqpgIlbcfc~Z&fŭ+)*_U}.(GҮmшA3.e)yzN!,Rʏ+Kh|<rQÅ<11N~bߨ i;,m*uP`,Zgq)sIxmF;xSF,f`x vw$LiV0g^{'準ԤOB<w~ 1T߯wtZOn]<;6y@>K&l6y1} do,%yD[{^:*"-|GR,IN0_d̾E&t47pBNFեΛwG:8'( j+AvID^ظ?)NiF!ʈAt͡PK&BO閸&$]?,sa'tMeWRp)2Ef-AIՈ7GZ3&huW7o$($2:yY\m/2TQc#dY1}Y:LjhgXg*ESNY ŷ"Uh6d&P6;+$-V * ྂ^/t9ՃޤՔ:@:LIlDp*f S^TA:B!knk9lwjF8© 1nWGG,٘<,Ofd "Qr3ɷqQ4֌ll]r\@ߓ|?3a.os0\<.θ#9`[9"Ggd&s5ߚi$B7=ɭVK eEiZSv.Ey ݯqQ.9ϰZWJY}*~WE 9jZ(* :k 9kƑ&hWuH @-|xv??:m 5NoRuZ$1~%e@pvocH_]z6u k'Y@j;Gq+%Ĺ邬㢰^+a損 tvPl;ŔJ,NBNsTu.ZࡦHT- dD'Q3I)z?WC l'[@v`J{`V#m->5ɨait*ʵB@z4)cm*qŦ $vشۍt4.W &/2h GeE}3C+t(ij$)H/b^ULR5Bh2 T7< ƓT s`0*3p`N\}ЯE~Fխ=XZB.Xc+I9]h|E7+9'>ݶi%;LvYtL+d?[,T: ޢP!7ثTHj]43}etJ,rK38J /m:~D[ƳbT#?!izO"^&nmuQՒ$P! ~1xm%i Mֆ<By9:GAafNPBw8ƜvhŒq5.=DDn2pQȯzHw ϗ DM2n1S7q dxݤ] 4e4N"2#K$C f [$jYуKӽba Nlr[%K͙oxA_]I7?mkFĨVZ#Vaև-"Jk6E2A!Oz㋗'.VԮ_A)9p/ `Jr_ tʪ![;ظ.3-#gfۡx't#TG&FZGmBzȆ<4GЀjS ZF)l\ EnrUzzq4;!䍤xR 7~R7VIx}t(&mR:Z!awJt*F> {_a' NաiǓozb lA?p h#W. NBwC<40ՠJsW.p-^%7 ,x ~""G[BḚ\oxTfI8e[\Tx<4TFn@׾Q(Zo0WwqCcm*.Δ9Afv,)vٌCg'g-unKVBC{َzH\U5EeMnP/7t45Up?BEZC s 9P EEOD"=;Pp[ SN5͋HZ1,ZWcsR.Ϭߢvp3w+,Ptf2yt-)aan3x JG O64*,-tg E#O2AŌ934%a=W,S*10Kz$^fmW'Hz,  WIqNևfInlj A4~jN9V K#c&Bv;ĹnDm(EԻ0*D{+iHI6i2K4 3Sv,mL\#"E貭S/ssn]<&E<%ѭA-{h3b_"  2KqU08鏝99f)׈Cȳ媞I6<0:ug VË\Q-ԶiEbr "R]lIk5j6C\M:(& 9&۫O_7Xd|bXٱ]aawSEywQ $ y g2>VKug % ޛ]s&=re:Kȏ4.9sx԰>]ͱv)#[͘ArKZ4wnaR^HG+ۢTcU>)gn 6 ͣ/z8nh%3Gף/G H f\aK 3*E~g.^"-cjT5xIOԘmL2'Lk^l8yуZ3BJeW-kkG`4= scdz+ 5ŰV4f -0i# % 3%9Hcref9L1 2985lo5&f?@i6k@O߆᳴Qc8YJsC>sHȈ)cpl:S@&F"0at;^t3C(Y0>;r%]iOs3șt噱bh#BQyNHL9I3?H Mg8N/'MҌ# NTa6^gX+Qs9\Ůnawvh Wt9!0Fzp-tl`5$;O?_%`E*:'FL8'ByBc}yiSwL!K)41܉uHu$"v{F4/DZɭv ]Rm'H3TG5|D"v^;8vbgjY{S:{glMq78DR w4 mQiP1nE]>ߠs] 5vA:c^q!PlF1W40gL+FB!#mߘSظxue7g'j5bp΃&a ̷yv30N<9c+C$U V}D% eIj$KLZ67FtN=[@>`0a\ toH5BsGYP4pLٚpb.+(Qbxh=a\džL1c! Dr ںedner_hs2PO8x&-*k/~_/btYb3j;RT&I$ldo$ ҅ZK=7@o΀= Ѥ߲:%8ɠeR,Q}Ł`ITO]f ƜJAP{GJ^&ܾ7ނ=:Gf}Fo\2 \A(늄AqSxQ} <.>GVسhف]6'J߸m@e/b/~AdELICp۟&0`.zxq5M&Zω3QxjH;oVz^1vhBhy >ҁ(@Q7_4Mƃ_}$㚋ٹhʅa1vne{Pr5R{u>W^ͣf.2f /.Z|7OD( ` U'P8ߺ)!F M7f܃B0щY>X\=oE)Dž`IX'17 CEMh{=msW*]xo>>AiaD53%N փϫ+rAPMx &B*䌃w0j4FݬXA(U ǼAKxCs$ ~ZS ^/+w7ڜGo\$RTWLV0 ,O4w0{=t8XDk QӶ(v+t3󴭌G>j$/A )<7]9{Ow]dS'Y1e۴Ws3(}#5 @)LfxwfD"f$sͪ'S}617W@+5K* *A OYڊ!4lSg{; {u5w_F:ho)iP%/B:kvF//`oi04Yw_p$` w]KM,_W˝x  u]%%@Аjv'L 2=ir]!9YŸ<#{E\"ޝoeߨq'3N(Z ?Ӕ:G2`2D/-?K&N_oDG] L4 L/Q~GP_|`aPup[[z|;r2a$.7?с|Ip{RAu  _]x:yO`,1 5uڌĭWsico< VO\u FtNzs/f_˿vi(`>{K@7 !,y $r`@ƫۺE} O;L;yCG(|[wzl&K} _\m({{}/0WW`x \<1jcK'au8~Pm6`)zOD:Y`CH'ڏG @O0[72_D]c%#}=r2E?q^mh_~(Z x F5}}hx"n+{45737+WhUݕ+ïR}?FU&6  1><<@ v;/xlw@_qq( -ee/L @R?fg` %4=a*p o~GS+:~hG@}d"_T %Hv2H&g9ߨ CMFaѤvs"iMp-QaGK]o`$.sXǂ ㈘3q'Ⱦ"mX3r 翳tegT-HغdӒt;y0 9 QςWl V&Z~?0|uO@GZnuܛ!q.֥W# |+3.с`h^ܗbW|m֯eb֘NjJ̥`ZT$S& yo.yǩ3&̫ѿWMx^-CRz}a*(0&P P~O,Ћ u"W›ΖHn)xKSw`ߩVr'1i).ԽsRv?,;Cn|NƭPkǘZgw> ,Xg_}51*Iκ~0Xm02薭k_^1zk!?".TG^G{`dA^Axaaw,I7~(ym]qdAr֕z-WE7qm\! IJ8gECz惩]w*y3P ח"gmN-NMKU6 e[(Fu&*aa랟mE5`ޢR9mY de,DoG>RzH~|e5\4#L{Zl`Y?N2>*fݥ򵔴t 0\1[["ѪsuaK Kyӿqs שf=蝺v_48WhY!#I$f'j,`{` kL ]ǤB`:zGK-'ݍ8Ą~VJxڂ ڑ;K# ^c10d^&Y"F}T3'+gar8/v-oC:9;hQ뾎 k#E4ÁďHLtsg ?b9i6MzqlzV8߬UYZ*9mi?߈jwaTh 4z)˯"G3,|<L0J|p.4ƭG4?;Dٯ|y7K.SvHeY#+MPw0@7[QX :t:O?YuN)I":Dϥqv3pWo``/`,>'' JO]gLk!aF>~$C!\L?P0bN;Hi 1~&3:" [!>/qGץd[}movQeRعS )yꞃ M=?qgY%DFRJcm"?]\H b|Bwau zb{$&ӻn-=P ]Y\R{R_ #28> ?4@=Tȏs_8C}'teV cktN],hjh3yK!'&0o0`2DBڑ'(> (ʜD@39;uY)ՠ#npLrn}pmRlNDV`S{cݖp6&\7d uZ\3O"KCDL8ڂޯ{g`E_\rie."n' S `4hѠc.I-oa+*g&ʔxAə+z " ΄8V^H//~'Kۋ|1^sTu7/9̱m 7&*_ˆlZ? .xfC xӊۚec_,P@ ^.K3Ȃq ΰ?eL Œc=tqCdOG&DcdAx el,[;nC8 ԳEylPƕ}Bork> w|e1jGl.{K7"{Z o9ogڗbi6@ Q %Rmif`6K])ey<ZMu*:gUjw7h8c5{D^tG T{"@Kw;\A`""Ν/ gwau6Z G:tn>C~m*3q`6;=yQ8{(Kp~ܾ\}k0Z!*MؠyepYXm(ƍg\ Ь?2y|jlWc mrC-_FZ7ʑD3H(qóevuglMh "\%-%p.Z>]"2f׮as\{ S[ƒ`?ߜLfxCANBaB7g#$ #^]?6-pܪ 6u" &K?JL$Gȅ*p8R^sC+h͖)t 5V,+ x "w@=v/D́nbGUXb]khrgµްNQxzDorBHB7On`؅%cIgF,OߑFRsz*8473=[Hުp_=0cHcll/?0vq\8LfrDz ACY_wU]YׯwUJ@5 K9J./qG*U1<`]@b"N$^>Qgu+vو# ϪDL<AFDؓj[ GAf w4[` E-i(3m?*gtM16\!:h%J7Wfkz7ek#9Ј*sc] 0C^ \r "w { J+ f/WkpL>+ߌo9/\}e.|Þ*`$o; S.~օPsD|1ð+RP[.%]n2ql'svpyg?+q.~\֜j9؆3bBCuwΓmoܲas.$rbJmE8=ጠWCpffL|҃6Ħkx4טܼnYXh_pqvնX b½u [ho- O"]W=q%x98%7H]u/nN3WRG~j26A=Xs2]_C4,:E6L_}R4<2MvrwxF?q^4O:}m\2T"ɲ]cxyGo?Yp-:\-c.z_+*H<÷lznwuxNe ;se ͘-7X8z@SJ'o a$2?k:F?놖_7pu@o4]L&HXtCzD}8AڅH[$\t =?h!%V?uw |l |ՠ)vfN=n1BEg\䅮H^B9$} XpiCqOxmMKԵYOURk(}(Ѹ'Uac{>Gnym=G dvfL'H٬ ÉZ,9C]?` ~[歶(Go4D hMPi'JfQ~QLRƫ-3?}~wBDWg>Gd0Z%m>3+m9Ƌ`a9[A('!Dy/X L,h{#6`/O+y>-*P$z/5Wdx+#1TrWs-.b@|С?(l?=#+] tY%+Ļ?R 78̻ȫ]S/c[1 Qc2%ȔB a&ghUqo1\={L "} n}PNz^;j5ƭ(:EZ8NjBhuwog!ӹX?۽J+hvnV&&nY főMPWm H`#{| lLucu;[ʚz#hssѢMWJEN16bg2ad0md:[$ῶH"S./Ux0B}oxeeo1Ho'DޏvwDa0axirv؃Lpb)PЏѧ`48߄+;.Y *<|S nj 7Tk5SB°p ¢A;^hA= Xxjǔ C^507Yhr{=[Rx:p , \^ཋk1G0Җz ;?;.7{4Gt 4e\:4N@ fѷη,s^@P!_NAGIXd T#jQW2fY~đdEKAcA_\։bev{:BlX tGb*Q봏{x}}M <yH?8bOibE]jI] UO8Xp3pk&qpւVakܚu gNHL jTrcIxD;HGOyK a.ܕDpsYYqK5X 0^ù4cUaUL y+rxgR7]=:R7s_;Vظ5Z:tH߱@'{GhPp0F @ ~ӯ\7 fςJ{ qL9h!G0' l`^F0>`,OwX< Cx< ~]l!TN}|!_|+Cݬ$/R~ۯ0T ,%ᄹ>ޔ~&j6sн&`7߿| ~Lˌ_moOL[)g(pol!M~t}(Q6f5_cA#'o`NDU "OIQ`«2}`^êE8?4 } EQO xw !e?;HX\[^s2z3{7 v pun yO bk`l{ aR` F  ģihl+@X9wh@a^\(kct;|+ & xkvC̚z5XV tk1Wш55GB 6*%eb p`oQD HkG2L/C@[Nwo%KM5](b^!_2mʼn`ڟ mW+hp}Q2N`[E+;6>d_loгYlC ( `:&P B C Epagx/BbU3;@&571.A+iGi[(AR LJD;w]nʩ/JPI47 IP!" n!|tpCgVK(ydDu^ߗ){x' >%@U0@"@.P^?\5/ )4H(hƝ\[i4 A Gx6Ae]ixEqraR;~UY`{8ug/Li@<D#v{ lS Q]Yy>1(Fu{u(Pbm(ݰ;`RZ 2PDnsρPr~b `5(&;2P` G,pbD^&.>#GZ&+U8QCЙ ŰՠX"xm- ?dt ##sPVSļ7Գ:I,x}! |c*`YXr',>!Vdhaz'#f|(a2KGIdp+>4ZQY!n0̶U;X6xI+*ьtCL=?TKE-1G?p6?UnP`O 50 OK8f*P:23S@.`vEy+G@- |M,W tc }@cZQK}Жyϭq~$BZ47wGVkھRdY֡"VxRfl£;piR{ppam$E]G >º\z^~]cv}hDagwQ B4=$DPQ"2 4bBY\֊NL4u$-%f ~*݆\LZG.'GF^}1KSWHGU95r䜉[ODlU pL!H˹Pc Ҕa"F = xA G,ԇC synT |,+@UND' '䋀c=0UR`J<қb6aO;Q~T6Dg6 ;Z0>dGJ01D}Sl$ BLArFleݶ5Q0r`ƒlX_u k fT"mIP3Ƃi2f/8ѐf߅QRPg{r'Q޲杯 `ߋOK.ĩ,0c؈T_L%/9 ?or-mX} Vl3QYSHMͮox%x0"&t2wjQtpjl  0r(fTwSB-ڦ)cX]]ԕmGB핢ƪKU)$B*9w4[k%Fx+:K߀ yߣ<9^f\އBσSc#?zdvtRݵs<Ľ}KG̽}Kӽ}xKG۽}KyJS8oࣷ۸ML&|KCİo7MnizѹZo}A!mFX884444444 +)iEWG9J8h^(xEeWI\Q&~EeW\Q&| ϗy 77^)o7pyz~{=_ϙsyY=D5:';SM80n)z(Β1 0i{hb] b4[p61{&A0^D06扳F녖3}􆃣e:JWNVՑtk]fdwSI&x6r!&2rɇ^It :)f9s)?'avBt+g2‰8E$f*G"=:ḕƒ yv1V3d,hw1`VĄ QL ޣtt+d6)';`b{IA+zc) [q/E' :D4> %}.K3)9ok{/m }$MۥY[UZ}g84;`8S |kF?z6=3Aq"t5Pn쟪6|(;yN?Sg7Zgݧ9<>?°Tylw2҂KTE!4'V/?H(_ԫVy 967Q` NpIM`&OyIˎF.AI'Kmiܫ+-[A_lh4.LYi#DKnSD?KD`bJ;U]d Sb!B$(BcyZńȡ? U=;D#Ѿ vX?nɧu(Ǎ6|P |c;L jQ'ԘZ9lnЃ~.R$*hx?ND=e4C`-ÜvWhstk_ RVl3Mrv g'9:oCv?K4s?8kF61_#PtBw]*n QI6ZC`zo FN?ˑ0$\`ՎçQgu/JI}> ӳ(Z< V#_bnwJSiUHQ^דV=6c`(ԞG@sS?I99qf,9ުV4ƻ͢Imze.p|yz8Na9'Gӕ,EHÍEsKvf|U쏹v=Xf(;룎ܗrjr6F %7mZ9Sa%pq\n'+~򇶫)<Ϻ>UJo#zqX2 |)%D7vSON˧|TOA6߯&ɋJ_Z}j+ᾧM'~IR`i̪y0e3ᰨ3 Ű_E/:NtlXjע23}KZ6-gZZrfmF UbOdq ;f`TJRWn 7 (Zj$,hzN[J\%bR ļ^φ ύlqnZi׈{MUrr.jJBz jBu;,ZV}j.өٓ60UQ%(z6>OeKj.zcjXE <7{r8La0Xd&iKce;ոXyxuޞW`U_]Iޭ;A)3-G}9o>WV\jF^|_>Gi%Wl%Z`S$ b=좍`lX:.I$kS֭b>ˁM1  ^x8LN\RbRlf"*Kx%q8rݜ-QoWu춹("J>k5fIrJLD C9:]l>%J /G^,OY?wŬ =/rJ6u*Z8+y:6Zr@Ki1Wz]rf/jry$ԗWu^ME+)ԙ*LfukxSxڲҜ%qżڴ&\KB*+jAR>h9[O\@Z&b}^$bd=+f^g=a_VUM)ܔ /ǁaZZl僑I \g`r3V48vgZmDZX22d X⣓?WOcrb3o6j=ṃnf_ &,\9IU&>DW;ٰXߤ >smCuQJ`M`[wgb3׹}>6?Ruttl6GNmOlyu~WKDOvY_ğMY^v|6MfXXhTKn>0*JFtq:ʡ <_\*+$iV%s(?(RA.*#Ũ4fY0<{ ^Z=$S4$}))¡C/>mHɤTNN&^aߤT)寫@0yVY-i?^%U'[7~lR,kB{nWEmtӲ NC}&HʧVM;n)oMZTi:r d%|q@`%|:.bVlݗb6Rq$Uv0&j thwZL:?6zv_ʛFc:[N}1>$۹Ybc@ @̴T+Pاj2lv 'IJϯZ<8*ghTi_zs#ua jf\?/=-\>9jʴJB3@lTV;.TUϡxaSq-$lS٦6gj+*!>ͧ~gy(FP`XF3У9wLSҲ,Lg zSR-H[>ƨ+xYty2!r4oTnusld1ou6ᕟ&FRէ5 Y/Q'm3n?pP敌?5-* mm/ۗ&ࡊ.20gR6{Yϥ(ӌVKOl)m3MGE-Sܷڇ p.hfCV\H#J#OzYYOR2ܩ,DVMe쟎T b#O1x@n/,]mřUfxR*lY%.`F]=٭DO2u)8E6k&&k^xެ"Sf]h:Othvhsz)D\̋t2!Rs%5'{y{R7ihAGZmV }*A9j| -ne[N`GhZ,O'=OU`=i]M.2B&UVd"z4v)4;f<[˛Nd0YB!Wfz>ʗֲ,?mEqУ7٨b5/r<+%]Wµe}1rAɋIQbl+.ҍFANn*jr7`#\o>VԞFLrTd?ى%M̈́X"j[i@穙J`wSPJ8Wˌ:;EMd Re\7 (e ym#n/סnt= ;;1j8SEABMzfp>fy>Sj3>l?hO ="~'@-6V-jܩgXZ>9nkQ(c"+8іxs@*{ 2Kkrb/ll\e}IIZUĎ4B@R`fjY|V%}B,FO?ܘgȡx l"yl>zH.;lh)ùT#cF |*/Jͯ뢠eJ|BT[u>kjw @ρNtjN*Z9>=p͜fH_p,p=)ct/g`IzֿGS m)-})t4O=0k?}un)TWۋmi63ROpC]U7nQ,t"y0(-b8͋|3_̵D{?SF0WF쬮U 澳ȅr]`Nl5_e- ܴ m`~i䯩wxvEA qmGɳ[L(} 'h v?hC@SJK/V5,ߍ"ʧVɡuxwd;v|ѫ=UJ1(>-^IȥyV+.;ljL}St## ˟Ҽ\ $da~POB+S\F)l v`3NrNjbZͦe{h,FkYfEZKnZX#eTwj{7dˢD)tk^ӿ[NB>!k˜ChB%q%xb0q0w\#W~I>'^UU'(ZGkNoz[4EILĦj^'&OB?{ķ @EX(=Q+qOӽ?<)_,¶.KLyovִn}_DάӸʇS"rqkpjzlPŪM2nZqW7\ {iWA%Y6z4JYhU?S+;)[9 *]5[VOKq3}+FxA1?eV\b:lPݭˣ/A 58U9Gjla |ѿܓ.쪻 (t,:z(@\lt&J`?(՟KTWzŞ<xI?fN3>?GZ: ٲWm6>sAḈkBMZ`XӱE:[y*a@ +VJM0@Zw\G:u0㩽tӡLMw 䪠IH(kztH?/Ay]lJTF4 vUo2Aj|'ޫYk+LD"zcLy~EQY/Vs5a߯҃OT1_nV̾T܍FR탡@$q F A 퓤>FCF}lL%/U*z\Hwt4ٳZ^t ~IU6e8l@ ؃yİYJ4'CoYb*YTAb%/sx W'Dw5.ّWӽEOV*>ի" ɛg uUqgk~sl!~qªp(#4&DaH7WCq3pQB 'ny;cS X/_t*d~KátZ9Nv⨕xX{]ފs^baLPZr yDt}\KR\CB2H0e <;FR~ggtuZ5uY5dl9vVmVw@cPCl'M šdmLwHfz> ֍1j7tSBK>_/9m[joWP6uuY?\’ۏ\hT+:8c =t7Fщ8 xKbT |NM6 O5[Q|gx~Vcr?Kld݃._{:SOWz0ޓ&glaר?:!6[ؤj8rV: #0ws0BY$1q>[oYu+n,xA¤T {֠ 7) cf?uuwI!NwTImc]5dD#Ig2u#Edtn߷*.$(%/y2=0rjޝ&7ClYۡآ@uq/Өj#dD@BUG|_ 欎E~_j5I8_+ֻP.z0LsOZؤ$Iׯ1%X&fO+,vrFxK/5>Fq Upc\b{3ui.vZT6iq;% o\I=(Y5L)39dģCWQq*Y5vI~y sGzȨY+3}lLjZFڰ^;2a>n燽#Dy#խQ6¸G<㚘v yBv ;frͷJLQ2p5$:0ǹȵnR ݣ6dYMDz`ŷ\GJ)|ao$DA_:YNw=R-bj z!U~ ozu0!l+ U[J# Ixu0,9˺Ӆ}˨Գzy|sӽC SGsp;'t /s%,yB9`\\30,{y$w8eGi7mz{g?Z F Sx*k?ekԅ\O90~v2`r9ߴ qL_Ngf m4Y3o{N'K}?WYf& ~c!ζ?n\ m\v_Ou<3X~؋Dۀ ߋ"~uc-IaeQ_ӉyIqC_E9N#.K i+)Svl7 Z;3EV.\M|X8< bl3S'2OUVZ6>#e1 xzfvDZo1}i'=ƭ{Ԫ*V FHWR CS"X?`Yu31葅:(uIY!vN]([my|p&Au(av)5^]S02~2a/[_fMGF֟>_@[b6Ƚw+12շiyyQZ*,`J2BQ% bpdPփ1G S{ž)D-ĕT"ȅf?VQd 8Zkc6*Xӱ 4s/*gn,{GP8WCVۡi@/s l.XU!i2Y/+ZBkg̛7O~1' U˷ OK5jVL'q,k]Lw -CMju1?\v >rHfپC}™ܮѳ, 2|lO^r q.6H!r \k 'C'5lI} rb m$wj@?F+a 6xq[w)m\a^\]ob  a%<}37 ) }ӧZ%+lK/l+uyc1[;dqmy̠ iF_iGMN}E꪿K.fVu-"3u$!#(Tǫm%2HE_JH#7:EI*E֙*I6vru2 !Bʯo5iY<"HíxDfo52LxQ{dgbA;4f5@02ë <ȧ3L =.g H~r ̙6y^Q4N@.[&9k_#ͼ?QeӲŮ)Aɬ7ȗVG s>,@j+n2NɘV _ٱj!$ɳpm.;~ijh3#.g%{X8.ޘ3yN []{xTîw.1"e=CBa^tmn jFFڳJe_gU_ Sȟk ~ R0]u~ iLy콜@$AQ4k^g+sM-o#7?$CEu@{.j&r*^1^[\Dvzo$vnSsoP0ox)ױ4 JcOJqIUƴ3ߞU=&? .f`cyȌC Uj i)7MIQ~Àk?:#o|5lvsI(ѢO=tMOnF=kVN3`b5yߟǏB!{(+SH]?1ύaa^?9`1o>Aw 3v9;ئ>mn|o$Xd$ , &ֱPG§p_ߚ-*iI?<N[*FmdIj/=:Ҕ\|"CjJ뭥/iHm/pV[AֈQrR L?gt)>C?K)Nۭ'1J) BJ$aWiXlYkXEEWvY!xρÚqt6aT/ȱOI r2Z|D(44q#~ R= ٠#l:××2ȇ f7]D`g C^f!Tc#0bSZF@ߺ&H3*Y!)1X #d WA |focu)aMܰRR ;A?~T$B2ރhf-v<4gHs&%Ͱ\v[SuʡY*(3[\ wk_a>Pds( 2B@ta:<:䵌l ="c19"G\!OPA&)*><䅭C=v5c~G& bFBvUW%c)26t {$AHK)KcGy>#bL<yYmHtrAثڡr1aLD=\B)&1[r2y6Ʀ y]Laia3I#2#LJ̾lf)*1jDCl EͰcog(?pOQqFU͞sI3!y {L{GW#H)^H^(>"lB5Ok+i<i:&ۖ|_#%jlsUW))(|{a 8i?k:\WfS`M˰XW=gtX'-ӥ㍆,}c8޶P.O;ǰ* =T>IkG1CƩžu0vΰz"7p8h~7i+q& 9w>`éjV>8p:G#؎t^)%싮f,go6O#1쮓#F<6rFWf_;C.[~x$up%:L>}eʕ@&( q H:5)B_%\ pZ ͅ/"Răv]4Yd;1B8H.?5 ;j'7Q98RLU ujLήjtjFލ^%r[ h'#ڌD b#1 $Cy2~U} @N޸p{n涞}ݞ9U]z=+IFRn*$/=<\7| r5JWne0H䨜*SUx'`.-~05}4| /=d[@; [S60p CƎ&QAWr!vN۠j'lREX[-f:xQq_`̛ԩ'Bb(rO ceGNh]MH b=ޮp]I`F/r'3M@_k_&0Xpϗq}f:ʻrcٷ|OQ34> ][z3;*;} $C'c4:׈1Uy0]AL2ثQ?cdazY(^j k)\B,N5}x $@?eaU\|MI˨r'ۋЮp`;)qйܼf摻UZ<1{#CZf-:p%Vds޹[ea>eJ#yL,LW)v94 Ydˆ}U.U֋vєkwm:t Y>'go?g/IDqRO҇#*Yݺ">E-lriɦ{, =/QH17 X[eq:t)n{%n5U_(@dQu2`7k.Vz<Ʊ([O͇_Gf2AW[;? S5)_C9Ez_Lia,& 9$d{vP"kϿj U\v{slT[mیL GGe|}}!5lE.YoPXWi|5谘%bDLik0{,\݃݇°'HYʬ Zax Ġo`6 Jnz2sTNtJUЛHe,d/\&,!D{5I9yTKyY|Qnk Iu-#/LV@Ya%>DEoR#׽&kn_"jKs Ms7+7BGBZC'z&dRzlJMJRbK2n"bNt۷50/OI~+TD|LjX_Ms)X8^fY[_j..yO= C]$9eH ;#v-q!|=%,*T#!I  ؆.&][ nga/?kt+u˫~wY/@&u K<4̠ȩ:p8oXWl\\V.a52yZ{tEn]dRT연DzkjgAp4S?3O*J,d痜 Kǯ::sdI9upe,uD8}5?Lx2[0W8:$XDG<_-Ѯ4xEnGBU7$3q>ۏ@3ݳBCuLm.rR{}9/}dO+uz28ߞaEqK8Vn2K 渠 QxF ?G=7.n6w#7(^`MOz8kڼ֢wzYCWf2ӷþ¿SG\B9B9E2K  x/IVⷖ>.MG+ +OKs^Obrq>!|)^[y0R6o=Y??doHgNz㼟Pi{vDC $' Ǭ&fV=>Q&n \p qLXF2ssjU%@lWXMW띳 dDHk˦ R/"(jBT(g,8m!Ї.E[$'Hgp$Ue߇QSZ +|SEխk"$%9pu-rfj1V@-;e܉m2÷.Mz6?$e=>|!]]-t+#<@ϙKʙd*n5 KD+ZWy.uLZTI r.T3Dp,:A'K~դ/,Wύ+dqj@h?Bbh7Gt첫 o-qj4F924%a:~}/ 8 /yirn/6B4U1 i剠}XpMZr;@"EA`>N:.WzPekGo9^ӻhSՉ\k´y{/9{幙h(,s7s0(;趌7=m]]oą8CfC-1)g_$Ɖ%J_[չvL0 8?wqZ\قVW{WH °'A|H5|S?̬'xc3˶o d5~->S?%J ,9L1Tsj13A$8G^D(oFRÌ-cЃK`ʌ]4d[#l`R,BWʊmt-oUSʡ_!2[>6E1 T_lXO_ byEY~3AkXMN[LG ¼xt\@^baxJtỦ9z|<Q-mJ-n2'ek(`RZ< Ǔ&&qC% ݦ it M|%<!x#oDf-^RQwV6>0S9Ғw;jVDzcbN|SyQVZzheSv/9{GUVZ\kԀ>lWOKɟ%]hnSvC_-|hK45gܫ C ųs Ʊϙxkz,ܩ>b0wȂ05}B[p+VU'!8tmstnJ2]v9j7]pJ2[ɹUbaZ<ގ0ǽDrIFj]kV5 kM#_T 7t2Hd: 2Qq[f[n;޻  8d<gΚʏb>̶hZvS ]HUr'l5=ĶY: Z)f 5F7`~ުKUI!kAgRd]M';AU\Bwg{JV4J /վ ;(_`ͽV7{2qP(?Ve̐c·o|ɥVgm~eT@<px%؞^n- Zb&^4T,e-yt@t]o!{1kimAJ@!/ @BH$pאu08GDkYx6E٬A\hc̜,%;$@1N~N"VsGlFqVsWOj2x_K7`d`zg2 5ѵ9+n,.0g5ChbhN N혛VOf6TGPQ EqFzP+lyA VF37%Ot四#"Z_r6-1o`]u9r sr%xS$ղ~kҺK/s mXA?9.3bwέX3w$Z/WA1!%O++NjbxJ&Jj}̻!;o[XQT,^vb}sƉ]b[):SA-:hMEF)`YfOqS('cR+P#w׺.;xHjjYAxO氪k;s@+%+3s/gQ>GeV_5!NkM,:%gBz+99 oL zWrA<n,\3JwQX H7 Q8u*5裎_R:w #Ç7*R+})QV"{jw.~绩0TC](Wϖd's׃;_\+Ȍ/]AS+:xwLiv3Xogx*0j|,/mgp7}&%lk@_^M41G97tD0.̋ IF.>ڄ| _U߰bA=1t E󾸮j{Zj3HXT,ݵe򒎿Uimv)3S5}rs9ל; QN9?:3|41Cҋ.+h<˚pOuGb*\#Ɲ̡7ew,&$J^(,2  wV%'ֳfU1"?Pr:WgϔpJRƔ qK] Ex|o#Bv)m~34zCK8/]'{)3cu&vT̎I}0Cm\֯b%6]>S6AT5ɨ!m=!ƸHزGνʴݬEtPr>p52THdYd̜PY<_x ] jO!"eɄO~JjD7Vlho9 Hq@#Sb >[Ȇz|fÕJK[C^D׭Yg|z~}P\ 8P1u8EW6A RX:vtKLH),X-Xhzo~3+V#=C&/?%@%/- /=Z:Cg~X5.a2gg 6zM|-֩SKvl'˰6nM }o1T[aL5W5mE=qݓ&Ruokrg_JO(4ZϖĦ"Vaҏ*gSOPIה{T=Oo)Q5vuџ:^%[+>{-3LRݠ~a‹ ;5ERc+-"n Gn}*yvhM8@KIgholr*ubm˲ 7._ BB}ك/}`0C|ѯ}C-c}M}C9z׾W0D[>l%gWbtT'0ߐz51 iX,18b.ksl4YJh {Efe7 m=7W$bzZq"-"{jjTttӷ_ -ZFH9rvPa%i+ɅJm 4_T^?(R1S˜hQ5@*6Pa =klNZECB^vg,4gܤU׿7 MTg,;pص=jm=\pF[%X[A!#e8],G/~*$w]X)t7<(UbDU*%J_B5xEqKIšH{Km@.*虄ոr5עZUޕ}"Kmx]' k0~d(n~V DzC1*9SЧ<\pZfcu3ȇoH~2*%'RݙQEMSBhD[uU;l N`s ]e6b3 7w?˪P ԗe/)ϿB.00_(¯#k2 !r%P]TdE艼sƽ%qxXzzg}*L20٫ @ƒ@m2GX!2`H@ᦵc=D(? zQ8*5?Pb a}=}ZrEzF]q6\nyB.)@ YPi? ؙx72'Z걟}SD8}@T3Վdƣ Qr}@XcXX'&ސ* b'vݍG=1̾Qo.}>_^2z ӊhs7vQ!鯮nzkԊ^=8J(NӜs.U*Q<5oBI̺۩ze_ |4kp޷Di=ԃOM瘞oVhԓ}DWտx@FXMI (|k] dyc^|:1 -pY;KkI44l~:~W~Wh4(̵Cyx%t3-q7sh~c|Oڏ 9?_10Fn RGf4!^wh9-Sy>UшЭ텒ȕ ̒ zBFrs@^cʨw΋z'3khl ؈9 ĕsW Y/UDy~ `QzJYY !ƞ$9d)MTc~aGfQ81]1C'^_^am!vW"bWuY}S ޶}fNNmvs3T,(,7V |9"TY8.AxYI$]C8{07}+5@̯2lpolś"h..IkqӠ^,mjqu;cs=jJn)dž\͘2QbL{c}N>?U9ǎʽ%&=afï#) 5PVC/~Ax<6; q? 7`;n^3^'QZ0R))zI a G PJAbkYU'UoEx>[\[r[-" fD'`-? Go!He~,ayv[?h)ca a_F=7cPT릗S:zgF)J7h+ 50ɭI-b^6P*)R^[1i(?1h&<) +J'[Kl 4͘9{%`O-1g\ c&WAuYȂ~uȺf? 08c?]Aj{& E Ce 4M}ֈ(TܖtKM;9QpIcz7>$ ~.!BOۑ'NTjDqcm-o|7 H5'[Sb,߄`"FJeҴ*`3m7fe["2$+*4M9w";>mZe3s h+>j $5AWQկ^Os<߆Q8r q#C@^z5izd׵%Ύ&M6I|rZx&J?29:POlBnqps'գD1GN\ֲR$v]pW[vM[k@#- coyoYOo6[`Ko[]96]aq1?-*g؝Jݙ1SfZ,1Kpek'V|!Y `WF"uu6=(1Hl3ogN`L0́Kl43i0_ +vXaF;w \Uٙ;#3uv}E::Q'p ^erq܉\IKT٢YۿT}䏟fg"kh T Mc8"{K:0 e&cDvqH\οc5dWX\)as&Vh;S{XB8T{Oi~HtD!(ss{gnUD n+ʤ nr_{vk:~_ 밫 37J@d}TUBP06\xBDnk|BnFyEdkrOo\U|+6*4+~3G3[4Py]# ($3D8m$%QIyS/ )ψZi ^/%w`AXl@|XIu*ȏ&:`m\We}\"}ayogPcm)\w{S A_ǓV/  _~/4oAS_ n0zOcb39ʴ{$. /^J5bL#;=7Ppŷd e X/[ ]W*HPEE탒&4FE$sL!D Zdkq>lߎ  ,3]iΘ1Na#mQ~juSoO,a#9ɉt'b,gb'c[@Q LٱA\~UpvZp\ڢ=[ &0ʃzФc߭A3w% a(x7էˣ9>ˡNb6uvES^i)J2Gˈ(|{s'qO]\@^W42>OҽّܶE-!"7%.%HX&Az[(ճA4L.1KIMP_߻|Rs3p{~n6j/_GuK$^$ʯfJrJuu 9{"ٟW mlyjз;gtYE}rTMb& .}AUj rrDٜ;v{ǁo_8, Pǂ*|q(#tY yXrt#V*wVH&"̷U0s4LCXf}ΝPkґ qU/3BsV˥ܺ{,DJngm+Ɖ4q~pp᰾`oI/SEը`m_zn3'K7|ikukWL[Nk2T۫$; G0v0cސMUjv=QxY`˨ZR3Z3R)5T8 7|=8XUjt?h+yʣT< uyR{؃"6(eIG'DH꠸D![jM۠,aV|~eUPdjX$ͩj5&Sͷšg?]sZx}Xwwe5xCv|6KC|ϹY՝l.I/TNY p|IYM#.Hxݢ9qO.jAWȟ1&F{\mḊ_^QT;񰌋8KP^dð1p1٠Q g\.#id]F+/(l8Q⨃5`wf*D$Gg;߆1y%?+ mE*3a!rb~MWC⚲;G?`8Lk̓wI RbZf$YGouFeYp^=<{Mw-#x\z: GAl`  ?<8 @=ߏ iun=A[$,BHB& ]iA*(D!sNf׌=40YcS~S)CUз쨘O,^ӹDZ׾#,hZ ,))1k6">s&d+[f~yNdE}^e}W-սZq1Sp/3iK?e~A. >`mfih\"9|?5gkVXt}iWiNNnduةcp'__ZedYJ'D[BNzr A-;zWUWh^S_9[wFs]c¹vݟ N{O&\ذorZi HmQ֝'E.„<׿aD&PݰϑXU ?N?-g.Tz5!5+#7X4 kN&lk^Kԣi5sJA DdS̀ Q$_!yUzѣQ)DzH (1/ v+tDd[F\ A .p:~;ZT -KgZe5V4VĎ>UY&&+q'wf"J!ERwpoN vFyHs_[VYZ^Y3s v+[iߏ|HsxtEcJ~=w.gr&F~?/]Ldڈ:xBZ+^g;.M 6@=s?nY= E;lyk-:yX7WI#ZM5ڡz'IJX;&kF?U FJ2|%yZ*/Xv9Ԕtլ6q!6zq0Џ("V䐢I2@|qLP!9$;eW'@k_QʪRDzfDUW2gstB ӪM}"JM x1MxXD@y'&]M#/@~,) BYgoN;`Qo:͔;eO_{IgJasO-UҼiq# 7Hޕ7+$g JK(] HgůܡKݤ$AtmxBEDL+ AF0::y?F߂]~`MEa&ٍji 0jKBDHZIj]dyIzٚxq=NjF~6ֲ4FȈbCghF- B HY>=ݲu@8+ kougn =љb Qnu."O>=k}xlچ_[\ߺuO1̅2@зUoSL9dx2dI 0bBl/F@X#cSz7*pfPoU\bC"jY,Iο/q)V.XqTwd͊n~q^#Qcoɜ"]7:׶P%c+`5&@7u?4A)(MBs.-X@HD>>Qo]m(*ڊϣzb*#9qZ/yܸC9uOfO #eVWH&U޿q>@VРzÉcp[XC޴gҤ8B}f,#" w..d_;зM/5%=*Dʶ<ޯV@(Hm0 zݿg c>WS?ZK҅AзQLH/R䈯a #~h:ɌÌ'l!ģQC8[T}_&[ڱ! ~rqAB{psz$__G^!#hi؄!Siģa"DjbY_l |!j y䋅KAJL BiXKm+ݓA,b>d'0 O$a|S~c<+mߌx|v-X% E8CX̰}Սg1\M|a&2*vJn!/MIqN^m\/[wۃ4 zM ~AITQ]z? 2/$0 Dqw;/76x4~fzI>N{neM#?-ap bV,i׋unhBh?ҍ0X]45 W֓D|̪9v47f\1 a>7/fw˦77}o~?lso-B}c~ }/U: K'(ϸTLi(懙X^K Ge.I.IˇM^i)~.R/GW󎀰=~a[ȿ?gɠ^~!&f|Dmrπy *{'/),konٿM_H.]}([9&_Cq?OXnކV[ɑB|))D ~ZRUczu5qa=,g;_g,&V䏵Urk+A $+X 'd!r/&LɥC)1G6*K'lAQO 8In%QѾb{CJ8s>E}vG*w93"3svf~{sAy=].ƉvʳC>X GqX3** ԬߌO|+߬Ww'O<,eϵ+ZlZWOacҞ:Jmrry|/gYv~?Qz{HX|&5陧|sSвQb[@/\hc.ߑ #qU毊WXWrT{ eMGqv7ӹ}^Q'wM9w<U+xQ^l8rGV={qqIwn{6ϟf^>-̞sXn7JE7Dw^U*.VUniz9t3Wmqs{uX/&Z=䇙"uҫ2&(kgJ9Qu}T4YU5rgY%L_N]Nlh1_-G˳܌ś1i2ZomYfم1S.v.7>(O;t¹=-4Ye|])kxkʍ=J<,ᬐw'8e~ݥyB3]bqfBNqǢ~3ٴz/8ysƳU>ND梎k wǮ}07e,cF;{=U&A!8ʃbuSR(ѝ^qvL QoZTywDm΂m]tzkWt"kOL3Ѵ<vIʜxwZcBfL#Y'R|'t:r:7OLn5< Es&ǹ+2j׋k}<=S׮55ԳȼmiPu,T0/rEko[ՓieT\#42J{t~.;# Cm<$J傪kc=Yc }a/"FJv6|TT'&Q+??׹ N q?7 X J:&Jӈu \Q9Tg '307R56kM?y?͍i;]䒅eɘp1f&Ggzxl]uFlzwjnqN){iq6φ`B3˃>.M]fjj;==.X7N پNӉh s#~cqvtm7Qlr+v{n%5q~]Uy8ϗuuj餑gsm޿3L$_zΩ$U#}n?03K`ޢw~0&ح0~gGӣB=pTc G駪;fv.bՊseuʼn?V]Dž}箜vu8vZ+ݣG;xlgR\VyN.l/nפ&~Ttօl`NՀ zVľMe껹+þ0;7J]?]t1Ȼig|qsezTڥnsMz&z$8x=rNLh+rz8Eu>X^\_Xj:]:%oINÕ\Nƍ8Luk,f㣓Sʹ/8f*f;[ǥq>J ]eqԸrGْo帳'Gs [ЮKN"]]}^/s~ T#cLEEO";sLCʲ6|wwXv }YK>Ӧ3TfwY*ج>%Zۊ<_ަj9$'*Ӵ:;6绗LZrW+t2{j<㹜hNO|grk*'|4C]Ϧty}Ton T|k_>iF5"62Óxݻ4 ܹ8锬nUK2ݼ΅f=n$nXfR3+}yڍflr1ϤxiOu~;(lV/7NgiV xtȽwfvEA:BՈ7sǛ ~7n0>@rB х2=zmr[[j m 5j|UE)q MUeC{T} "oףjJ{7Uk}/~*뮬XCK; "[*uнR PJem[鯁M7m0ƹj%AE EugX{fmnzފ-ڢ fj;hM_?[0p[$b/@77 {[{ћZ51o]m@[Xm6n#bQ޶}{97n̛XWv T:Gnhhl+mm} G$}e3zW6<rd[4a_6op+1nQ%ha|Ss/Fv6B^Omw3 wdQywۡ779}0/󭘝`j:m TzCE#J[4/Rò- iR6%qC3:4 R,߆6EX6)@I !n4G̷K{ڞw9Z*{Xw#)Iuhiw@iԷ7p 8Pt: a uuRq:hEޣK%0d%;lQD6T]/AHlȻ#OH%g  0e= $ՃL=A&Kc g >J0{l(HK{O7ej::m?90rd8uJ }d1;ӝov2uɽc.IJ;r ~$qq/:c7(pI`=%"(A](Ѡ$p-+3_?-t$*dv H="/,`͞%Y`&!v?f;2rgC<6f!AW611Ofg TP-@6hU#k Y[pN&PEBYg%n\8ōɠ1g׆+3+^U|]kҲЈ3,Gstx3тG/FM < 1@V`_pίu=p <Ǝzk㎿ՍVȶV`\Cb _SP%f(4#G$&ୁC!2@(x0ɢ 5QCr  l 2mkpT[d^/8[!  -qcH|nO6x;og aU1M#[aZ ;tp^ NPa_( ^U)?WAI ^ù_%s@eKa GۨFЬ -!<9˯Yu[6{oqu&SѺ~ ZHUäx8T=7&Z R֌ ٹ Z_?߀fr(8ס2oʙKQ+z[zΙ9e4I0'}ZZ1 ߗ ؔΛnO=< ]~PmUZaX+wdyM$,&M{~A/p9¡cjx=(fHx«5]}#8 W eJpyA?#4Kah[la]ء>Np5c p=/=HC߇Z VZ sZrR Y)Hu?^/J\{ Fu;6nhy`l.ۡͰaE}y)  }N\돤̚5 <678yRؙynӆKE.պTDRaK֭A'YI>\Bp= x&SSS.`n-%~CƦe7;\-Z+&T ,&, *2£-1CyƸNJ"e|֍a '"#Vpe;0P~ڃ$]Ϳ6u%D۰ )\a%*#PqW\rHG+^I E(۫?L *@A-vm 2-()?Rp·R‹) +ë"`욈+3Ȥڦp5]1R&d#*;/.]Kx& lDo:kQx XCvTZrD G8z(CL< M&`!pt|dîkY=g^QH@_E#7:,xj{suWc1_ͣŮR007 y8ߡswa4t HIK?PrAd.a;ZwyYayy 8LSn߇Ey0F1ZvtLj"*/C^"T k2E!Z3!++U͞u<:a}: B9@5;"d qYK;XA 1XgIp^;U^,R b혵Tmҏx,8RH$H_,ﹰъCvw8ЀJCKE OCRpH3YybHU'R qLsKE LG]]Q"`Gqfv>o歷H9n+ u*u:̈́:np&\!Q/N U{J&—WcwPޞytZ8x}Famai:Á0."t|hSgѰ`Ѓ8﫼Fڮ+ b ||Y(۫ZlN3Q%|?<!"⋢f?Nog  1|%03Z$>1J9bMF7!8HmY>R/!m½ &P2WbB"K}઄p<8{ e${J 1)N8*P>}M~E$e@u4%֠hXU)@ J)0H9~HL|Ybu B/OL)H ^Fvs%#o*?(ZpkN =bGeݳ~WrU*/  %Oo!xkeUu=$zz<Ȼ)#L]װC(0\|9@=ӰTv.\K;_9_-BsQGύZ.~'FlG}urӘ%f,BoUWO& To525-a8ԯfi/AP?'r||<>6՚v~x2ٌrbZu~..wg)6[au-rl<6Ô^Zvpt{ג'Ѽ0.21QlKv=IV"vz]?WϺˎǹZ/6/G 5lהB&盛:]t]Iƚ\{G?:x*]է{ٍE.:ToRo4~GD9=.gۏ|6;Z-{^/Խ<7 -.JB1]gt,fѼ6h\Uf؍Z?NͮWcN;-w2y,)7U?-=3빂5>.nl=^Rʼn9կn3u;E\7sgفu^gˌ3~ߺ%OxkP2Ia,bG Box;+W%9ubjg"Pȳt{|'=պN?@:mG]\0.R[LFh\P[- Z^,T!c~T'V鮰sqԫt<+̎CPƦF~ Gx{8i]O'D؏ˣz9RSX)e:Xn|;ywVk/u*2_6j>kU7T;WR'7O&1tx~rYNj.rX[lTj]UqhZeͭJj 1>< :הR*&nwl.Uf;̖B,ּWb{pT,O⬔לVmn3ec=gd"-ذǷE%sYlEwxxԿ3ûel*R;9-?%:=ׯڹ"i\Ob煋 F7~Ozp>(wٕsqt.ُ{UEM*d xpVOTǫbNW˗M;ii0>eQQvwZpG 7i+5ލB7(-Eݺ~'s'IaM)TB!mH<TuR3VWuXbP/i ّ6^"ӵ5Ed"n68 է8_LDN.pwY;P% C_ĺl  d;i|>:!Lcks/<ڟ,TcT+J[͚ͨ7ׄ~Fwxw&Z Dٌ>;_n$BJa){-*.<ElKAAρO@ǡVNeɢvOq][U5ٚX%:IK GL!g:>~tUql|#AK>JabmFK> "\z 1"/7DPxf]F% XksK`̞҃(T Y!SvOX0SIvP zS&y@X+XYS\Ӭc}cDO@0  f' 5p8%HVRK/%8ryHf8NO!)sw| #{.4Mޠ3&'EriCg3;2|a]0X  .We>( iL]3l 6 bKPad"m, 傾J/M_WxE<#dC;9pӧA x O7+Y90χ y$c k.M[2q7@_VY ~[ BAK' !/<1:}Y$G^n+UGt+Lg aTS LCXzw|$@ZQ/0-Ue}(JPfPW" PHL3?}C`W`nv❔RY fmuB`bJ&g^N6$+mRQVv`aXdǁp](dų9goȎu(! )eCXm H:%!9 wԁSp*5#O^1l>|E)qv(˱_f t@u)B۽x`gCk>ރ=#C7<)iv4qn֓4GQ`0Tڅفbb`h1YL弡)q'tv:h?H>Y€`bޠO[xD22>-/'Z";΋n`A$8I+v-9~kC ZrhZ8!Ώ./Mb.?8,P- &oR,]77&u TM266@8QEG;TPC B́f3@LA@Nq7O +t>tB,Abc"wv`@%VR}oJJ((mqB.OAKVYꓫY#t7]:W? uYؼi<Q4f>K,W'`HnMڗ:nw c0<`D`72k@Jtќ,➔Jҍ]kuJUM"fKޟ%L7 ]H Gup!|KN Plȓҷvbӥ_\n^`88,e4aw%[ 'I#0ҟx552-i!t/V:{\O@w+x}߼fH=$A$HD2@>L/z@($$8"@i5Jk  ǣJ5ˆK4Eh,C ==֗z¹!iZh_T53&VCp5 x`P[T̠P1Cm%SxA`,~HL6vI͕Mz0Lu@R@jy%L1|A0ӡt@?,RBSo tz^A })w<jmA_(6+/4`aWm!A6oÜ@ 4O6'o##  eVpeB༳dY&ȯ^5\c(e 6"R; 0T }FK*rp'KE?˻pĈG(|02HPH5n!]$TՍԅ4GoE?PC]5J"_ W;Y}}/z6UCN$v8= F2kWbX|1\eː+|:$Pȱb"mYPTuFb |Qo;{\9@AvD 8>+\wb"mCn1. *Մp3 pxgv84ѢtPB͹Mo7 2TlEvu𑷂G 6ѿ8τ_+FC`A shVv?aZIO=฀4!^16mՀ*Q./Lχ|2m8˄.Y'4 (yi#|9q|xږn&]\{%Gr_sT#aߢ@)d2#m+^DH a׫QO,$æp83r"=j>G6Ԧg~6n-)r|m *.A~21W e.6hǐ/3\W'8;lP>RpZ÷-A[cP;xL y\o bn|E?䎽;+gnАNri(oVpnWؖLDMV\>|'REHtvT 0'_Ǫ#]aTO@mv5)FV&B$k_PyW]E_hi=2Fh@ĴD +\ @֜3d*BZ܉ (Ba5h!}D΢Eynp=z' CGMh@ Va ,Ҳ.:@{%dkdN^÷y؛pwW q_AVQ񲤸W{ a% NP])~DxxQ3v}qLտFlq-tDjtJ\`˨#hD 3)lD5l 3:3+`aM'=_HCMҖ*V]Nnl?UK61l njY8pF"e tw+{HL(Tb$L;sL̼NDHemq4"tdۊUBG;, S~8F I7[)wX4 x; ADfysB/B; rс40$ WaÉ2 \AH4.>Ɩ^}3v:Z%be6ĕɟfAN4'"83h|@U\" Q㉥o)y¯}S:q#l0 gn>vW۝g>hdŜQZI׮`?NoA3q >OhT} [5bS35~:g{[;`gyU=}ԚA''.=i,{,Qs'kh/XT.;ڃO›Z{*\䤫䂏*Z܇[4_4w$S(Nb2"a07bQ$6:4$T2 I2 A&-掅ay!v!H$>փ4 PjxfxF"}xDžKt`ؑCK &G6!8` %b=bZ8VİCnqAˊ>b,+\uZr-l1Ɖ%)zya/^#4m@[OlH&{>>`3w8dbd309TH(dS , Ƞ]࿳_ (T`|j]LvPGI]"$A{ieC3>H UU{@̶& r5 :gҪ@k]z,K!n<%F9fQ}DjDqB0na}B!qxcKr _l9΃oZidE& Q&AA. (G[;$5@)95ܦG⁨ u#=˱d)+3ĨkpJk <R 7 kÕ:,pNo11٫/d%@ؒ<i)p5Eb#p!c[ǐD136l3KC<t?>J`&B{!F_ihU7lNW F!~ _mw@/A{pN["> R}',x|GzkaEwY4Q /G+򂜲c#cG7F艔 P xټ uxH?;Y:zp4 ^硢=qx&~3@v5üq쫇.޲!_f9Ixn1[(`)Zȁ֞C%F F:b? '$D4 j3jx~ ~ X12w9LL!OOxDCU}ı`d*Ą#~dma@ 6/YyL +ԋtY[RlW2(,l!'P'ⴒl~x[㲃E4l 2 xaA@ 9.،6zyfaQ\`>r9h,>~69C ~[p0 %p*u}_{2-*p\԰LXUj֤n4 cM M c ~}p^V{]_]kpdnK4V]l'űb1d_uX$"dFbTpB(z Ķ ^Ƀ\a|siNP -Hȱa܎/nEzLY=Î-7 ~HWT^dKTآ^EKPDVMҕ]<҉Kpc^\?M4q Mb Z*;P)Bqњ; P{\f)pF|:uV`0Q~obGtf&ahv+Mkv O5!Ч4ɚku.&'Σ8gf)+d5[TS1$lARq$2Y|8*n~h ȿ D9 M߀ m pNx F7/kU f;j0zJA%wlchKwΣ}p#Gb`p i'"Hr=g@V Ec,5\u1{+9Ґ)OdOclcd F]KLer=Ft9Q4I6TmNҳpd _/N#oBهİ*.:fL<ɾ:停D#jO@ӻئIPeFp5Dm/+saSյ.+0x[{4@QAI 8f"K#v9]p(Ob:d;; z [AsKpˢ$U2 0.X11UѮ(򒖘hSө>AtҮ` a|R̄@?֛ۢs5s} `^[@XV$gg Uj[!|l]ϿVw Շi{8 sZFcL${[O-vu{o]u)֥8eEG!i!YO}ٱ00CYIuFW`?o{|uςhHjddl!߳}O3=~-1 O˞X38:No-{P+;G+$lP To9=O}*߱~ŅJPS|RR.GoDk˾|~| (:?V!l/5#fzJ|B\7H@Js|!ʰ҅h! ŭlWnʒ? Z@d~%=S["l!"K^d>C*/H߂t-H1KTte4 &Br/$a`E(cQ4q@ J}(wb<\gM[MC+Ϣy_rF@r pl> N\|'_-Fڇ_ B 8?E΃Ky*ߢ: ]w/F 2(%WCB/vowsOq޽بjb?д6'4Vi0@? OdA~[״~"M(D}$'R?OQ18mHwDj'҉? 5DB@acT, ßp|q~"'h!"@4%)4ڳ3NYx1` 'P)I҈Yqz NTL!$H.d&7lUՔΎB;DIy':W^aPٳ@8Bm*@.Z( д@jbfh'N7c0 C:!>d d: kln:L`G0 -v K(쿫س[.|cTUaEp]?>;}ɖ#&*:T w{/R"%B،^?<%4̀bδsڙ~Q;3b;3z˹&&_ķӡ𘠯#RdL؞ٞ}&{ms-̾͋ys` IO7CJkw fZ/:c\2 _+ѾPk>b,I^Q`_I܇w'x"ɷ߱Q~^6Ž9DbX1H1ɲrXA(6%E!NТ3!26KB'WřAP..WNj ٭yLjB.8D[f)lu`Ӆ"OQ$5H7o@gņVY&W;B˾wxBa@ i(woIH0 [x:2}tфw-Ӷx>:{6+&}g=(iA,FCIwT~_*aDw(.Co?`yVT6IK=01HQ^O(ǾJI3bžl4ރ=ژ=w{}0؃C̠h{.f]gTQ~CL={(ƴ!p0ك1{{rA19$˞fA^[fbƁ'*ui?4>q0шj<jŕ{dxO&{`O3&.}Ɇ='=03GlкYޛӘ=Rfqyraޓ}o}W_P`w_< WLhah>6N^Z}B١|i*&Y i F,!$ 62TL8ҢmIY@9h`BJC?PLR{ea({gtŸ+}S)DŽ,p"$W1&j(nP`X~npd*-u ^ӮJ(y?ꧢܴX-',<G/ Jt ]qc5wz"QRȉ6e8CB\0ٖy #:/(qcg \%XT}s)@ENJiO8Fh>JJLmXX@ \Q::0$e4 #"y镪¦ZpHpZ#%a/HjOWI*9 J" g]Cb`@PnbLg)PmNaU#1'< J"Mxg=Agf-#eFY-a2wA@`\P[M3B'[Xb}r ƅ~)b|r "}p|ۃ]02@8aOO%bΈ njA S, A< _IM7Oڤ'bR#2*EL/6 E+\gr kccO~2)D.AVp\z<ϹH2`6ѺxOæ݁<`Iqгл@$ytP2Ɍ V.%Hɡ;$w l+!%t]tс.a*dOEL5XtyqԦ8G/IV8h䋄r($rp,Tpt!bo#DP&RPQBya;VΥuY\4'{a"<7|4qLy%US ",צKkـaѫ0y%BR0aP9KhpG:Q~1 Tñ/(-W G0z*%@)&hiBu TUo;yבAFu=Da"?YyCzK/xh]Oß4N@?~͞ZAXF §jVt\Kb2fD0V O_8\|Ȅq.K,ڳN/9u4 '+$ ]lhuUNJM[WO(0C%&i ?W[?Mֻ -C(YD+CH@Է)'ab9FEt |2RJl"-4X@Sa?8r-F o4DLН&Dt߹%<[{w|):Kܺˣ'* Tp] *0jw!j2tiA)0]6B QYxr1~} 71ċФA\p!8, ^van{{;N3,+T B)7,9cOp Fn iY#ACijU $%& dD04x\9Rns`C}H{znᚠt+dxPD&OP8 F8em,w6lUȨeC?} ank&768ꔡlUx8$73j۸N6L+o;@㻙a4IkSQtNMHtR:YݞsF|Q W>,HCCV;(TE2M+;/I+QDCxPApDW"+N>ǩٖΑn;>HBatLwd *$8TUt ;&q=Kꋈ,!O-=B/!MQCK67tQ"kAT(Z`` ޡC[`VǼZ /6 , r3YaWXqᷰ6p J2bVnP:n+T-$.5lVLgUB@VR.UU1" 1]8sAKy7bN /CQ%j^W`Ŏk={Fs%\hq?<_"襌/R$T# $8 4߱7s@cL:xLũYx88 )ibؑߙOч{6{ 35-!Kvn6_UV{!əwLT*JZH"VTɻOF6fp*,39wk#UTC%/"d )m7wgTx]XGD,n-Qy-~L)P!LJU< l3o"֯1/Y/$>Qrv9ޮ| !sS+n+WCtgŹ; HlÈE[Q2;b$w@[FVɎ]iҊLdeB2xS*x'2h:3I粼6 w |7C?35ZtAJ -2NlD¢.MOL(\ʆZdMB˂ ٕ!/t4F<բ bN 46ƃ_ݯ\wgQҳk!z( *"hNS!6e!' O(mJ/"XQ_i9V `WOn"6K %jO (|xjVZmal-ptSzEc>4υO@$YN`ոb޻] m455D*''} t34eSD!L雳3Y@㲤D䪅YE՗\ͳJQ VB my di"\9F|ie;#T>/d"m#ݔo9N`HXBqYϘM%Ԑl6d}=>eOoMʙ!)sb(j QW#aM#iU[iY N<7$gc 6BZӸT{_R`zG0SCbn`-)0u% } m Z`}"{@ I+^ IɀwIF"aI - (tg#k3hSG%9* 6EEa|E*cڪ}DEjFE0~Xma>z^ՐG^ AW\K swR&`b, +^$Q4)|Сb;F!5-9Ƚ'"e"Oae}Ɗcʓ:!9N,#ko%  i}WtXbsxՁ9Z?K7)}S&X/]ۦ4L[Vn(F2;3Q@:%x:E*")y!{ [B#B~tmZ-~\Cp+CdـnB}wT*q-aŜd-FLn ;rGD"@8yh -}TUf@*18d-ws/(~5KfkJ4Fی_#V֡ Kj2|y#J(_oB9:NN;badlCpg}'q:s' ~ +!xR&Lt[" kФ~y-OdsUW$1H985.Š[>EB4Db[j d! ,zK!11n~i6e9aI:уcHVwʹķ#J{0skkW+U0Ȭo<}̌5L *GpJ›o" 3bH9 lMy3i˺\Z&6"!]m ȑi ҆;fDQPЧhh"1/⟂)Hi "P 1.mF IFalI^2 khź2(M&8`NF_Pu$A[)o'l oXsQC̺kr:HY[Gb#Ճ #E6xPa lcԃc=!e$CF8 eǫzq1 anE5܀fZ|;2=]Ag)z*@E$`]P>eZ:!khPu.# JsD߽*D ;WeTJe0<|B& 7TIJM/iǒ U3l u,7"[!Z0V~EGF@SAgѩ<< b\ ;7zEՊp1^6AZ}ީȕva-ӆ~2#wv&왴;&X'KNy< ֆ<K8֖'A)YP~GL^S D8H(q]&t+Gv$bK 'XN'VxRJ{'ujC|3Ow14 ZbѯϱZYHHpDo\S\@7nslKs̪WD8"u-$&\W颱K uϘf۰pN]3&HFT청UJ :k\bqg Vw\vʏ0lUW9 T?Ot9oZthtOuXp7GER!Vщm,*3R/eP !+fi4)ZYvKA)H4 tv"\ܷ*rst YЇ60/ejBq zNYXZu>G*edxy c9cG8I  k&=8~@xEH|*Z:UEvD*Z.@,xV*k낂4T5s2ЫC=NR/{?xlxkӰ 8-$ֲފ(~u.o ^K"B_XT0lV5A9O ]zc消ʋ@e"]jtX4yN@*C,VR?O7ømEVFz]ʁ9O1$a@.i OR)-ʓWk ,Enh[#5P m8 7R~#shVjXC'/8EiripL`o$՗)-:ɱv̐f;h'2!"`V¼`` m@Rg? MD =TE4e- Jz@f">\ oRӽf[$̶0&LȴN^6?bz@/)ەnd2 0@~Ɯ3AwJWOXp _vFPs)4Q*/[YSe)g.9kVKXg"Ze7Ȃz .0o#DMq稘0q-26H˹TzN/P+y-/$]ᣝ(e75o[%<8H!O΀B@C |P5ee쥟-k!VfAf%TIK K.$؄gn2'ɉX#%kܙjŇ{4"p*Pw1w!rfJ#&y !/qwxJ*[am& ^z7AT{]lh$y%Siq}&77;}ASE/ymp);  YIjq( ZZOf@K=[6w.er@el hV1L{ed&2sr@s.Z7MYJ]5d*= c Qerz I"*f'M6R6Ir{^wQ 2͉坦hCȉրm7A[W;H S}EUdOCp5r%dQ qrR<$'<]c4N8##/E*h@-oKRm9.D~FP %Y^wG;E_8 NqBg"5ke3.d{ or Z1"gŲz+ˠ~z-pEcA4u-0b jtKA# 𓊖hҊFQ-E4xyi*4kMӓ1냳0*T& 'Dd$ qt+ҰnT;5aB[P}m8DfX:BM(L8o0PH=큠aZ jaXF9{t58EPZl/(m6$-Qry)bWf,bfz)bYVV=mD_c~L}pS5`AEDG[8aU:zq |rMA]vA9Dم\#RPZF ؘov`ӌ*ϝDirerp۱ IHv@ﭜƎ dс9@&IߺE/Ho~W%i]Y))edP!3UkQ9+5>-jO`SцJ4#K' o`oc `WH*u.]xnܒ~98Ώp#Me5V\J3LVxXps%Ɓ-rqi!׷3^XHE]1dxO{]{3)K#gǠ75?ةOP0V8U5iU3K;8 H >%ޢ:T7P ,sG)MLe▇<ʼnLIݪ/B't%#X@6nS䳫'|hj . #MV ͇g%G)#lݪ yT<(vKµ5=tbI]Ы[NNܶHF}Nc4y]ýL`HL<&(jl+@vȃiq}|i8UFĕ*@g> [2 `-ф1ǧRvKK{Ҥ,7)s\O&h&|& ?EtEmѣW5AHՈ7{B3Pf; |s^Y#-D!+_6/ǽ2yj" `s7,@ _CZ`,"Of醌r*N,2O|El1 CJ='imHb1P" ŧƙ|hAXzКTAGP<ץ<|pl.wi82[@4NUQdD{jDdbUdY.:ق(x;~-9@!^d:^ y3{f܀Mf6 8䎠öc(9"X/^MBV&4D=ɥR eI^Au"SҸ@AWڰU4gCKޗꢗGTTj6Zi[mJNnBo4$ FATBi/Og`CMષF enC< O@s HJcUmN]^-?ڦsVŠ=o7-vn@q[ g^R+mA6".,;فUS3hc: 9Q2hֆK$6&S౎Zp|u#"ӯ.˸Ƞ}*!0E CE+EM>or>4;T,M"ʹ+H!JmFWW%Y-]}3"mip;X<@SW&0E &]g(7a?Uۛ)eh$}TMLʩQsZ$5vە\5"hmIuf 1nBL\bIܭ9DeK@ԢEUƇ; uBdcOCh#&ϐ,PSZ' #˫1}cL]gmɘh n^= y ݜªK::&a8Se1h4xޤqҲMPrNgǓH(꾑ugE ^^d85gK&~_j2ZG'F3 &8AMmI>mFİV!V!ׇ!"v{ kGA6/F!O)Bu1M"8[8F/b,~dzʥVX (7fT)wT|23B-PE UL0h'2%6#f 6 EkG$doܺ t!z?4~VR23'O̻̓bfPo\Cp )|\L1M0bTdFl(;?o NX(C4A[-n`-%ډi&t ";:dcd穌Ƙ[ȵ 1'F#)=I:,E/ )4!lb?AV &4'"- rêJ|0}m}V-L6d}Klf)M>/n@(l黧ᪧFׅ!Aj 6{nSe)&XaR_@"Qc2=juf mI(]~濒,Y'Y-1!W,zOyEWY`aЗ{z%}(˭^ *.#4eUovt'ܐQltU0ڗ _CR+"45dvxVS T >h4G&t`mo-JFlK`eJ&mO;A8ON ܬxwJ9wu]R9V4I&K4K5&-PDa@4&W G*6*Jgq^u!xɣbM&.HX̍t 1{mAk8<%iMaݡ{~~R f)X7LIT3a#bQk_]K;LWx+G![к n ]X+Efp&*q%ki9զ%s!9Yrl8YE-XT 37lqP]$4Ǡ1ƾ;iAƵHmHӮGl"$y';I?/ӭS"sKTNk!qy r_ElEo_^ퟫ+o֛sau<"ҙ&^F\ _RKތQ!in<3gS0dz5Ǝ)p~BDi!Ho'0tҁNZ ڙah,[rVRUUdS^> N"upuwNJGS5c$ld쨣_Dt5f¸rxɞ_Աߵ\]TzԨVv/x2{b+jŸ{(}D8bzEаz^!!Qe61yf[,+WĿ.ޠ,uyUN*$($"t@.HJR QOΓ+Hj SĄ֊lr8 ]`b),ZsQa||bBcPdeV)AW]ae0!߲d'm=XKHDQd< BռV+h;>@}U*v-ች)n_I7nKPv(6$5M[Mi eG< 3~tͰp>n5[_ ]M  L[W(~1 ,7*7ofM4&9jSo:@e]aٟݭMx_N=u==9];f 뇇'P8 olq`k\p OW8 `'"BZ֒PS }{ݼ`rxˊlifBG)=192hfF"W7iO?e~ Jd#l1 AcX!}{n="EDs56y5tm^],+Y*ƼON=JzSSt|Dţ$9(ńT1Wd&K.9kb0NH`d?J@PH"E2 ;1?嗩㇥Hk+xDfy7ZƿJJZB%nMq}8 N:\*63Mb`Q~+QU0^ lݒ4ܧw&e$As7kN%ɜ* 0ϻ.\uxE[\iILd㕊R (/}TGiAR,jg//3Ƥ}A-BKg) ('¥_$MR?e ֬I) M)_7x45xÏ^u \9i}a2QJn6& aha(d j܈0k2K(b ŮI 2亸+!i;x u ;+bM<_V S|KCe|O%gE]P*_@Tn\;sl9|y,isK})ʊh%|EG)Ӊ_VBٜ웟?YkE8k0 Da ,=K^9d˥T,"'I ?li}l_Sױb8>I$lyQ1aVX_^ _ْ`߼@=(̊^ ĻZ`݋N- TdNH@V׿aXI؛l cn1 `aNAN~|E3cҭ41b:Ҽ =G#L~RO^}uk OW1GEs?:<>ڼ?<ۺ.#v\`0ʁ4`Ul:*0_ g0#YrDlkf\2 7/ iv1ȑC^8{@"jl8q3B GU{(G0(ȣjCmװy\=/ameo m"R9ztPòb ǢQt fOagvv8^QŰiRNēwrP2=BO f/\E^!![gs0_aV2zh"l (kX`0QíxGVWM'#kFg(tY > !e*хbw/׈\:PsA0)N Ic5v5yuVQ g NMI<7; m?D"| j￰ 0@Q!]zt@"). ƕIkBQ$6QXkO0Jn~ JwV/쌞:ha)1mQqVOC;>kVZ2UbOv8U E+DZ:&nx T:~3oo -6/@LX{{+x.&v0ڿv*0#8\Y* ]#A4.ɖ~\/ -^\ m߷`FZ2f }#- yy G/2 )^vh@G[?ZE7PY\9: 5+h疂;_H6>ىP틐J;8I+buv|# JPs`Z-3ٔ"/ꭊu̐gze/gt0Y)LfXо 3 0逗15ЏKāu|^ v P-4?j:TЍ7ӀݽY jnQC;K{=Ȼ߹7g\۾bm^|YTRp72^w0SpkY,!3\7*+6mwSc?DuIheNR9lkS^tDrm,u֖!{ߤ$Skw]F끅FGZYw```/=U;>DBL2uضRLRaHF1[ Ԭ+I1(F<2`>n%d`15EzkAĘ4@,4h&zstYU&}c CUg _ށ@ ؊%0R[edQKj%=BQ+wo%`1U-(\_ zfZ+l`,蘠3UXSI? [2B !:a拸GEЂ?qm'Y?<{Cd͜k̄ iRm} Ƶ4/ z$>_dW.sFl2k*~ j}5}' C<(fܹ1:4DtpI_ɝ9/Y=l;5$"GIe{8˓v/m("| £ǡ6hpهP p=5{)X\ m@Do6{"=3L|[ڌ) Q"1p M/ @($\^BOYG#ݷͰM|{e3ؽ,XI:ݨtCZ&LyV E!jжA D!4! o vҡ#D:^y|s;6%=iCV!Ee\w7?"vﺖCn?e]YUt!y<︶JpT0#$2lO<:ϟaL!'+HTX9XiiEdV0WtP}\gy|]Ѻnl]V)}EQoA(&OK)Umw+gQRuZ`jHUqWP%&v!¢ >ϭ'EaF32hl(9F2$sYqtغ0?KIZfGN{ewJXi+ 'b;ʌRS%x;!DmfĚ$]U| IhuKc%`f}^Bysϱ>.E?X|-{:a׷hҦꂏ작d5E2E4rQ!aB* Kr8ȥKwA|_Ah2":ۻ7bVLOIH\4a$b e< H5> Opbw6zIq2vZakye!ƵvC &4/BNEO(ߖy 턀;3#8H_S4ߨX͠a:5.qZ%] _BVA-Q6&*;۲h.KEſddv/"!&2mv&sۓv`TyݽkJRMuPg &nmŏ]N8Vo+?@e* leZTӉj%^ ZPa,'@( @ɋ:Q{'v5E^_o]_*!* 'xtTʺ1Lr7Oxo7DM?r%1_Z`@IB,mdv+ěf֌]LY`@Vȭ,ӛ>^7ψc>Ch1tkcOi/DUɞ[q "ؒ~E2{4F=8 a*[ TDw|wH>tTn7ouywrؤDZ‚ .!~DM?D3)ĨKB`shkf*l6ҋ1v?f^}$/j=mي/Pک)XH ڔ)%־=5#Ԕ~Dyxj#"EQju^!!8n 3DDΔ7[.O.]Oim]A|z ț lF" f\7O-Qc8 L.h 053:x,s<=3lMmm‚gڃy 3dLfڳs^nlY0P]t933B ӈ&=ai}LoM5(VnKh~ 2W35?iKX#"E=:CKS9%d2(us)(6O(EDNLjt(ٛI m8l 4#o!Ii)YT1w(^gԀ`fzNQ@T(ϣ !ֿ`9x"i7lQzm{>Vwk!xzɢDLX"";FfF2Λ£l\ W5z,B>˃^¸ !7A}¸/y11GdPI?b| fpww= >g2Ex1 >A0 j췤PWWWcT[Fo%D{ !n钛ʅ>0qQ,CBi`+߳vW4\VzVpȜnNUFl9߃+$G8H8E7-1 l4z)@ UI#M#"eƏ q_Y7EZ57fUv-sEs,jw5 :6•zM*`8l:3{1e? F YfSA!N'aQrE?d\vqɍ94"<EZ ,t% <-KdN$4 1ˌ,u =.co 2tثcI1:Gm\rS<VKlnVQԂ<|ܭ% #.jӑT S ETftղn܁fa2Z [BnAZeGV1^ՁwBD} Hz~uɔkhh N6TS JhkcwmoWc$owHJ 8kynY=gO]/A$W5<+m$w7jP(]߱/~DO꣼ė_S܏w?BVˌCW^x-uG]Jͪ n{WeTA1Z@ OH~:Ch` t QȨ>ϋv mTCPۉBiq dWU#=ޣU)H\մt {v!Jt8XoF!2&&XH uTUi:B`Ӽ6xB`la|hR)W~1+]cLod;r@܍[v JA\_bH=!6iCP2}9Ӌ|bC7!EFey "yo[ay-c ¡!ˋ."F)Kb#s97;;ӸWmbr3c,84)d…3kM^UءkJ9.9w'۠oj!j\jeZ5^ۉUԴd-aEWu Zj65 d}a ?[uPc4ucrY< a}M뻶IbւƧ^.WioCpa/JrFWa;`#3pꋜ|41:mʛ+-X̐X=\'.qUzKfPO܏'b7D%emjֺ$2f+8HZe4֟c$\'3y˳\ K;HAG]oQ[1nm̀-n<ݠ-yŤznz 뵮#/+,ዩ>.ct6ӎl!qr'k7 9J|U?B@fWyhK^ QgvTǫ_sBSUWNFPW9SEUG`^!WO _u&oH/A)Z.5R ́c$%[8orIYkdS3G-ԾtHv1Ƌ)i OэDWT{iS<|`j>AИ€$a 0q`[2'LRq 羓?:s𳖀'cW[q$)ZxƭiJo+j-\'A E8Aש>G÷'ySOE{a[kCF`]Ao  |HZڐEUjoqk7By^]-4 -tR7REBUt:o*`jr1܇6( 7t2zhB{٦ Xddjր `ENyL*ׅDpӼ% -}:SUE ,i߀*"0]%A~JBLy^?WZHL2e䠆Qs9=G9 IUm[?1:|]\+ZώѴy!1R ]Q?.t%=bۣk~G68\tG/\J/C"yIs)vXrk{W.FPmGYiDmR}c`IUab 6{R!o5ٟ- iftVDW 7]%or m \y{zY{Ẑm܄fޚ'k%ۚgPÞϋZro^DNEZL߯O? >'2muU?TWG=}ּ2H 7zyln#L:$k$sKk;|u Y~owc GBiw.̪ oᏼU߽Vf>u fo$(2$pYg(#bh_t|A&U09<F@pX<6UJo) )Dʥjaa5թ_@;ƥy(wcIm\ CAura@Z'1&)JeOyO_Yt&xT@pi |N Zc]o̢Oy &!?o!vAJw k)N¨JpЈIm|~'2 a>M?͎كz~-u`OO5(`'sz>swjt}o?RXLxn_k쐦I;%;k͠8&x Dy*О)Mk[YD.B,"V/)|D.tMZiD 1<{|Jx4ZAez9%zRϧE8QWGY(͠< ķ3//-䏀x3q'x4А3tO9TŋL,`䮛#PiOӄ;;")pcҭ @s ߼-:(&imZ\1`t3:a|IG$GH+OT(FDa7>l㿯m;4im ş<A0Sp2^Ck*NԚ2}a/~}.6VWَ%%sY^c!Ƿ7Z,T^$h%45 {Vn@Xyu0q_z!ۗ _mES=Dmj 7Q,"=ky!a BQy_bb|+lL;z ;|=DQAlnߧ/"NSbE|u|X<>RB_?PRd[VP[9~VE[TI:`;d0}RQMϋ{Ҵx`Be}@RfH1'vXAݨC3VuӞ"m⍋ 7d&v9/;d$M2_ГfU`M9ada W&1踇C"8qke͂&UmUg `f_Ee\pH„5*~y pupu%Ӎ6*u&l܉"r34u2UU^<1a cՖ9ėT:ȓv%n4Z74>ܧ~#CY+  =VqxLzĸθ<1~Q [}n..\[㔝e ;~ּqq&u(U!P`@_}Y𷙶[8FPjz>3W^Ybyffq_?})D A 80&{G̜ra $}bk:JՄ_2MOWVܝnQm^h*{1;;k?ƸKeO >|_:] Y.+A[J0ΔilGnfR=t7P!Vո6*>nahˋ &MQYgB+8TX@bsK3e!@l-^v9BnÞ{oe.[sPdgslz{8$`aZ ,K2h~+0<[1`55?9.؍kWo!pVc-oTz]ZFmGoV܎ibbFI}uz,F_ެ퇬TC*IzϤXc+vϠ=g,ZOlqj6^Yos3 1yD YzpĠ hb' ۡ0I@ƍbGQe3Ղ苫s؟$+k(8yvzRH z_l+:)|Y>_W٢*~lj7LD:(n(wo򳘒ŐcI̠`" (xm; LSFY^nt`-F %ӬcaM_ yxaec҇+w+he@8J/Mal`I5  #v1F5"RN 4*jM5DŽa1oj6ڴH| #R8 4 j|0dknɫ*!6Oo6e9."D> ѻ01ONͧ?dvmPAjaLsě_N +`F1?9%v)e|g6hEqq)hmfTq.zN˖Y2+̨< I 94Ǭh1[a軶~ҽ"mɕ ' [n(tn8@Ic&Z-V٘95l+ݍY%Q ]`0Krq$<#m`PLK)/V $kCv|ሉA¸ Mg6$O5<{sR ӷDƹ1qjt*Gšk ;obwŹY`^~VJ;v11=LmuZb<ա>?ZA#jiFأK{EnuO/mSZ*(1#Q3n9: UX+I]QpJb(k\ʼv)_HN| țİIV1822Wj_i+ę3@-G=KٕK{!clMdA)gk ޔTK9 1y8yH^bѮ823`7Dp'c.a]-='P q|or Ċ >oGO5 rHeJ ;n덤ch|aӕ$ި\_ ʧ$㰳3 [R5}Kc6N)8׿REY]$7}znpgK[ajOdI \њr]J!U 6_G)@)z[ӕLWic_s/ݖ ąJ*Q5ObI,Ճ3)LW^AriƽDZdaasMׇ'ާ!3q= 6?@Mx37,f_d%f}5X#x8 7]J[/ҽK5Mc^kӸc}#0ߟ{znI*w]!(p0jqToމZ~' `ӷ7%&‹:#GLenNcL~G7yW陙eeKNj sdz9L\4gKf,bS.eϘ=R|K.e϶=R6-uPQʋ t2z^D/"QE"r~uJ;b%[Ƚ!o8E8fO_;.9.:.8;9κa=vk|i~=?q6Yx|_zW>ٞ9ӭz^z{NjOǽwOLsx({Ly\ǭVqqnv1^{U9ݛm'{Y6f.*n|X[:&ggt84)/,?Mw^6tEL%4ϟiiq~tr2X0Ow'g̻r`bra}qkqz^GK݅vYMfη;*I/5wdS}Y^}]߭o,NFE:ڞ6wXKn'?mN6'Riws4_?+=n<4jʍh[ݭO>ms_3۵R\}HJKwKǹ9igX|>~<~|ya1yl">=6uJ?ܕzs5~:|w\gm޶Jyc\|Ѫ,fvK&kˏ{a kvpqZ<^~N?]ϕO;k{͇睥GixN~zܛpƿx>tx}i0ݜ=LvAoT?֗iZUߖ[O ;OoK枢d;sZ=壇ǥY\=zl͍pv}=]zMm6X4f^TwZP9ϕ>n|x~߸8\\nۓɽO}~yspvIO[O냣Bsy2ytЬLn^<Ovn?ʹ盥w3d;[gɇOkSm?ϯ?w֞&޶ɅӳS=uN337և\ytx}-=o^WzGG;͞ߚ靼oOʇvǃ§ϛ\ގǽ<{p1}=>6wOv?n8}ٍosoٸ,>~މO6[~}lۻƬٮɅ݋˓3vyusd3T=nw{sicgZ?aSּYy}t}=}zx]5.ٌ/G;.f(%KG[P~s~ܩ[GOdzŇOA7^J}<[9ͦgۻQicvo~kostr\=9)wInyy19ɿ[;+哭ǃwNzV]_^fAlupqo/Rsd|Z^z9,]ژm}؛_8*c}m'٘In{kiksqqw0;yR{kycv&7gZmzgdv|hig~n6`t4y_w?-ˇ7 w^p{oln+ٹ?[<}wrn/ֶf/g7kI]&;gOw7GGGoזrmwWw烣 ^Xl.ot؝h67'۟oj} փɇӻ󞿰[}(պ0=] 7xcylmޝ4.nhiuP~4ٛg'Ý`֏-'skwIژpq䷷ٽaqcC6&;?k,)va.j&Z,h\}9zRF฿ֳȭP^LxAe2ZovȬ(1iKs:~ C,~Kd,PA9S_'gZT` N8J!A#!x&[j#!VQ\v 5fۓ̹II/B30}Pj~ ,6 9첚gٖ"K<wKvxNa[. @T {s#uj:l_X.][oh#⮦_6Y$MQ?npd]IJx"8#DŚLWq`E>QoǯYeTPޭ<?:Kk;o_U #*PRE)~Xaݣ&Qxݥj5؆$tƫ'][o>3T$F6B k 9q9@0Ve!saD޾ )BF,WMbC2_#+Cñ5*&tFP }ieJv0-ܘkezBt7_00||蹰$Bv';CYNWWG(FNӹ1) O9E'P E.\*i˪N|R$ -+ڏL\ 3n\qkPo0/$<=~]HC L?ͤ#4B٤=1tW%7g9 6ltd E~ћ@64q\q!teQ}?Fɋ*<3X^oB%Q"G.Pxܫ 8߽Y˫8r꨾ h Az|:oQ~e u(gzl*7k%,L!Z/7c6uhgsދ jX׹wpF/}M5V( 0q|D$n#Ou2?U& |`RłX dBRiqrAG>o),~U(¦{; 7^lAc#DMPazc']0/Y>`(]x Pqi׽zuSxZru~}WꑟT7h5nV P|j *'s^ES&1ʰ"/{ L4A [L@< ؉<"=ePB<’vYXQ0 P7ϫ&i|QM!=@U2&5j/݃h5WrK:DJ7kQǠ_~. k inC.RZXf{^"ǟO`'DqߎyAT|,^,gz*GD3#@Kd5ט&䷅XIfjt!G)禎28_2:5hY:BL6D9zwwĻ$  Ɲ9q`:9bf%]0Q_7򜦵x|.mJJ(e!q>'_aYN^bJ*^I#aȵ\a>?P:ˡfp[~+95#qTg&ؾz7]_*ټI+IM`Z7!tmR|g㫫 &[{-I rlL4;^sdX(w]jT ԌD\Vpar{6\RdwT6_ԠCȭnУow - xMaEeE>O o_/0a0XhKDƼl{U].j`xPE*Hn;H;iJss޸h xXhWIjj[ҝzhJmEa 9TY ƹ(=\t\=2:ΫRr;+&0 V@v3K2̀7ڕ܇ `sh`!׶?'-+}A7h7QgD!(++?C~! HYϚlBuQ͛ku bLP@%OAR+&ŗSni8nV@k1ԮnmGŦ86 I[>=W\b^ 7<Z>Oy=/XzѾ7I؜z-,w+D>@tz6r7*%Y"S'y)m).Eas`h LP2:yQY!LRqu5̧rU%V'O_hxZcYs,TY}Zg4QE4q/Ana,,@"VMW?Ct: B_m- zY%=xt-zl2𷶔d]5]]]951It–P;LuLur?\6?6MVžFI6)?@cMّHGabSq aU-2^s7Z<-o^g a%GȆΗ1Qb  9~͊LYgq7ťU °X07ZE PtS$;}0eCƟrrpzà8S[o5̫h= Yع6R=1 zJ1uۍnG9}jkݱxH :Jt\/zI)g Ene3JVy7ߪJ02?Y*ɱT[lA<zSᱏRX×{#o$:48ذt-;Gvm( *- E0yQLcFJ/9D~3&_~|996ދ_[Q kW捕@b@-'ЅcШ@}M1u}E_΀«spVq?H}TߞVZB1poӉc.B>=VaɎ,Ti3.~=0v\}틪Iox8o ؃|bܝ^ZP!hdkxV]k캕+>WmY-COKyԍ `5^T`Gf0PY!.haYv ¡0n~ R9 E glr ogݎkQ?I|'S ~n!!:HiÎ23v704&] : j5oʽ%Sɹ[Swwu'Fc29<*m'y3C4)/:xy5}cScwfD+0@m{B^Sc#cnQ&\w)Hvo4(:ırèq>|b^!uCՒ]$M0nsGhS;1ۍPY- X-%!C'ɡ_~ D!jNO'ȍƐ -t/žMU Z""N>7G~r.Zܕw鳊B6 /jhϐ=ky>~"5/ig7i^z2U:.-bL/k_)⢧^/=8Y_ ˲_<"JjuB[2/+0{Lsjv޼^|ȆGTB:&rq4U:v;"7OytcJe}POURzvtǂ|fD.a\X N3#j>]}K~_?}m{ˡ:D9 ޔb P3 4C~L@ds!_A:2S?RxөsN<).--ɚW0c2*jpNN7N'&vdXrm{=Iif$^|-<8Ե)BmJȜ$]B@cc$_B K^w_n}8:Ax/':HBr\ѻOШ{EkW.E*e#k=ZpLH0}Q1/51:q6b k:n~LAWf}A-jG> =NWB8օa1M_KK{Kefn҅ w6EL4FA@6nĕCն[cg}Xzv,ء2kߤ=27QhUxAWF 4}$#ޣa! %s[tLUF\C)+H։M(YJ`|s@a-AvwDXT돤sb꼊~^| VE \I@(<gQl|/?^xyϿgO|Ev/MC2_^BE_NOYdz 8sc]t0SǾi;id9q~7[v ~~" 0xRC?/䞹Wv#ŽS vgRqr&*Sv,chspC:߷9i?kdVz2tF`,,=J3È9F@v IQJtvOڿۣ!t_}d>P#b%UL;t4atVhmj d ,@"s[mg!V"Mx@N0O(f|@^_!xe0t#|n16Tda(+~Xd/s'Ԯ>S B,1ҩ+Ip [v9{!w轘 wOaT 뮞"qn7]?=}R2;U7=~VU~|xemd뎛s o1&LdEF# Naw8KF栬>24.44rVmUmLlUo#"ء wSɯm' چU%a>!'^Hl"IQRi @$pw'wĊf"? ۣ#츩O{a;꯾Jk8}0{e,aO^ߑv?+.A_ᅬr_oӠQ_;}CwU zWE>? 4iYtM}c=cfh+8/oфqI+cC?Iaq^?{&~θI"/ }$fvn5g+8> HΠ6o߫Ц*GȤer=S^ 5;=[ԀS;p{:q?K]C4zQHα!ļW U$LsaL 1%k$2[uNPeFjhhHIDKC'2)%1ش>م3bDv9GY 7gjCR7&~TPʂfaV(mlS]-s`_9Ԙo G޳+@o u)8wƍXOBOD}*=BN"(蘢ڍ+)ȻĪ"6C_3 k]Z]-տ}82M{}a*RŽl$xwjtbhQ#GDz*5D hj ~΄QQrb9qj`Y%9\2-!Cv_G+8'1+h% zs9Ix4,lYmX5&E|TnYL̩x{=W:;wH B5WJz8ԣ )w-B%~k@AI]\~R^d jdr+}$OC^cz᝿ }ulw, += }p_, /_`dp)Ǫh}C,Ӕ/+\v,g CqRIȊyp&q[P9d;sH}%cHR+]3P~&&ԾQwJQNUZ*1LPEa3Jd.ӽ3T׆^3~^s?429p* 9'3j-ދ|9x F'#dl`|&[d%iXC<#<;^9QގQ҆"_h骮88 Y.wp Df^]J7wH ; tnm?>iGFo|U~ Z&>saڌ<.I[x D=-жZ7s?z-%e+̷1D^ hO*aЁv1/=6lnSҎ !M:̯/ NiO Ny@wYNI0 `}CHW1@c &:A:Vf$8d}ͥ̑?.Rg(" &ߓ:!]5ycۘσhp7_U:Cv*XY<[WM'>t $A $%{y Z>τ̄K MV٪Sz l!8nZ>g5h+F\I,ZL!l!낂LOb5 lD-X%g59NLưGɘ2lI ;Ż:.?C {έK3¬rh [,{W$#)``08) @W"X5zT{ 5}%ZT%T7l#)4-Qly*;BDzP%CŶ|96!0/` _#,[^~ ^M$2IAm@WKALfd]a"b@tIc[Ȳ`+9c]UNӬ `imktwv؉3~)7x@fSӵ5EYHf I]{q-һuOዴQ//PUyA j2KQwĝVt/! tSm4"kEGY&ʴ&vQXo#h})Um8:HPb wuDJ>Db%M ͣF2 s=-H5oĔi];ȿKF ~bo} I쵻yQumN1hXM|6L>2#B~*1މO7- @"*?`~*IA1 9ɏ;#a&MW!t )H iɕ<in/^`kw_"mi\řLEsIJ*^TfU"EW <{/R #Rwnm.+G~du4E~g)?XK :[SDWg%L?c_GLJ y&| *BV5L3Pѻ*ByC%ZG%r+Kٱv3/d[&Wivp[e>eR&. v~% ..{dzcAT6<mTVx'A"kHO.Da$Q~2%2X2 ݌M: Ќgnn2> l|'4}<(P =_"?Y*Z9z$Oq ӖjH|ϺaʑJ1ceT"V<8.c )ʩW uuesyo-os}J&D0[y^9yr}F̌0((~4:)8[)ЉW;FiDWyM/˸_<#ta!>_u}m,;}͉nPiv94YbѪcuJj#3\rMƿVg%{I]fپ.(.zdr26$2Rmն0*MeaEq==EδNJP oogս-=m:oo>4:佡+_,t^F %p՟2|Χ9eK?ocؠ¯/qs(-&zu0ꌜ 2@#zv .j4UZw*=`͵m''z+w|h]P %~j _`5d@ì8P!gGGtLqd߸@w :Bp*8Ozq'*3|[ˬO̎:qJ x21j DŽE-9+ y 6Re)3GEϼ GaeiL^K%!I^U%\Kw|N@tV?SՎ BV - ?B$}hpӣ6_!G@n2aq'$bʗ`hKu~{+ؐMU蹳:5k)Vc+W;][4 桋O5O) ף-2%/O%?aK؄G(b)e|Zg?H_U$u |#m@x5oe۞otWEQlQj{d𶮾(tP FVS4dN%gO(_N:M8p"Hk%Q}3q~ǀ:$nkg%|oXܡ>;x,"d U@_CK)ME\=YfXy5O(5[hBEF8|=nؽv{}NaSg NYx )*jd]I[4NJ\m'Z ?ƯaZ4BH*!Rg -jޑ3;7Kc^7<ͧh#zS5@&D{`zh8#ɄDm>K3Ǹc($|Xپm K#t8ĺ ˽~KVQ@|{Y֨YVgF_iumPWiR~}/'y3aauښh%ըsmEt'k#33 H1j6D"z AfaAr~|g$qŵRo)bjÈrƚ2uyӾR$P8wnG? \+xocn}#량4J@YTZ9ռ!+%}q6m.-0afBh,%}87.*&D3 `Q [?535|W+ۭp,u%*SaVY]NzD֦jRz}/&JQvJpEruK6*Ϸm,5݉14Y\ W '2lxѰW{dd (aO(5y,4X~N3O:NXr]mJ)6Y͸%xe1׿tO?އn-0ң$H7vNũ2(ERuT[+Mz?K>۱1OX|^33oɞc-EU7apI׆7eJY!R'8- ʲj)588F-'Gi3,aKW?M갌¯,ô-ۯR em|وh\%d@} r_rzJۺhb5v9;ƕe]?nH!73x=BZĉQ2ҰXGIb< `JQ<<؊v2x $|#۲l Vu]z=:eM3ѣ$¯U-׆W}[ˬ:T \y~iq 3cchBOd bC8C4if/#Hz~GneGr| d0=23-#2yмI:>>N^8U#:-\/j/W8?ͽagn-c@NH|})7:\z_e}]s48>O/(V|*L&8_ZV]dQjeK{}""KMG(*>J?h% q8ρ981b>Nf0 ^.O]/|4.qe.U@`ۨԗys:>}#b]MBriT_TyQ푾k ²r\31Ě^h)KagPPS,N(wIXL%EV;*Zz$MYDS*bDAkENjN4DAb˦|܆"n} 'agK78@rfO;@n{'HALNU<[>h>DK\Hl}MK`;< g?L$׸Y{~ tZtwԪ6(}x< :>N SkiH2o+^KJf)Yޅ` Ze% jyl·<ܗنX֫\,s6;4{dg~[t"cIny&@|bu /t^ܪE&,FзZf9VF-cˤ1p鍵\㊛y, /ۛv'!*(I=˰Z%h<;5݊_睛U5N= }DKotX;djgf.Hv'X\Jfzq RI5}=s`=q08BlSKl5@/GIIM%3x6[;IO_ 4P #͗|g/l6uڐ$cV=)_@sàw 7X9_鎨cO"q3E/`P$b<+_ \bb+}Xa\ hj l  R $TR6lφSc.S b<\[g<6[&~Q sHoVY~GqEw<R N}X5w"\$&yHrddbXC&0f}K|q;kY|JbQX6SqKq(m+n λqX- iKfuFxdܖ󻏾<*{Bz(U6iB;=XBx!{DrX.ejv .>zN4End,}H /p?+Q^$x]B}]4Yb`C 'f.I3ŰuxtIihiYp} jERpvE^ͻ, *'uɣ,9@w(A ,m Q0`IhywP<£φvD(#"A'uMvyUA9l6X#V{|n%8>)Xkr_)*+د_wnda3`0z[T^z`CԴXGR VoiěH:I)xQ[t=Ɵc7%}*%O.0X;Mޏ6g~('^/wFG6˾Vâf&"^Wl&lę(叵:8MX(=ZemLyU>; y)1|فSh5x h7J;9)nvHw8,6qK ™?JsR&= T#ECXq,Kj0tceRRN: ~R٩z yyڻa nrMR7-$=Dij1c.Mx|!pmڣԉ6=LB1]>JȪ3edǂuhi53S!T^琖pifool]uG FD)EUS[$#^hn\g*n)0[tiźhm 20"d{y0\<\L͔ڋ]' L 7W:-) Zq}5qlAl<ǔx |-#`.I(+BI]5M*-wv#!EUrU/ItcStq)5*Mz4)7Mex5)g<6hP[ G$>noߜ3Hz{` Zq'hL BMQ~`}@YcK(e8t{~UMhm7{ހ!VH̨Q=ڄ> X;(7B&C}ڪ^MXol1{8IeN(82xstl#ȝ1ዏmO@̈́zmFzr{*Y"ϵuh (>ev_iS޶*MP8'vWS{d63-G<.[C!hc3gM)7 6 -_ג&}&VT'B}6ie򝣊Рwى#vkV>:JEJQݶ&Ϫo wp::z)jad華NSy@5nmp`/'6#; N :hS CK 5 W/B+ ߜLvTBF[8gCOK@]LC]s=9',/>IpA]/U,+>AU)>;b|Tj(*HI$@A:|XnGjRJޚm/v]( j(y$j~woZg<ʓ/i-g; e|pROZ]=ꑓb6e <Pϣs7zGOObYA|-32Ī}]޻'uC2_k Vs!5=s #=V3̬Jpjc9/m5p+YuEb3 P,{d6lSg &rZM|FS^Jr^U@;Ӻ2tJ;V!?xW}NG(1ɠq39҂bN9tIgJ=L 8\rϢF/Tk ˾otl :3VM+Ͼ>Y'g.rթ< v8Y hbQG {>]], .Wx57⏬ f'z܍; ֍CoNѩKk,&$yJ߽PXe(WrOg5>=լ<}Jx(ƯCJ\NStϞ)sIqS{'đ).u%E&mɧ(71{>M ,-r\@PB9 K&o\6XbvLNd }g¶-rT\t{Leln lsR$X~ av{ aY9>|k+ڑHȘ9xTo-t>@+=+Y)K&\McV%"1c]}Y $hK7$1sSZY8% F'K G66u[\RVuk bC"v;D^Cj$YwSoT!%ͣ;hG-bB(Hngj4G {ÞY183QaBpQmIa_ WSxwkM*-?&d CѶ޸}'RuZkr´g~ipWIN%5T~%Tt^vr#f5{ -%hSXBjNQ&@Wbk{xei) wu^tlL0>?*LG<[[_ cgzn?Os QWcholr "Qp_|-&`~y=P yfR,,E}`0C\*֨ePoľ`_vpW7j`]0>h̺^~L3Û\JU,bV8wū=Ob|rIէcdn*pWf6ycѰ8f/Y`QiQd|}|55:@$ki&Ej\0gGr6ɅcO *%zJDFW\ )}BhQ5@*6"RK>zL띴# ɖ&ziy4Z8㳈Ҝ|f]Ť?XhZeRE;1Mk{l]{ጶB6O돃BGu0b*F5+ckF|VVj'ⷔ+/Q 9 C/H{Q!жOWC$$?{- ήU]72~Në>[;#{@uKH,o`5߀}Wə>Q>D52OG>|4~Gr&Q,9/2uB Z W_bA*2fHSw_mf l1U1ȯ2_ g#k+2< !rK /)#;+5E+ M&ҫo=J56ibq R= l =UV-LTq2z Mݳ9Wx n8O3JS ҈ 8DJ;j sӨ@J?0Ku=G[$A:؜sP=7f-&fRBc9'? [e&.hu|@tNf*ʙOEϾ+v6jqyI?X0Rq.()RڊE7I҆_ݟ]L>@m2GXs!0`|%7D sTk(_BnZ6D N}z~ m*' $ \R  3 NS~@4QU3!'=:'AmdhO.c?!ƙP//k=ӊh6s㳕f;ᨍHoҔz@pXo͝ZYޫ([mDq`_zL訖V:e[ 1Kt#CFAI?  LӉ K"dރ/bl29_AE.`}2ܽ~{}tRnGfhE65l2bw~*F] `уP΋ uǯ~8 @1刎/A} "2uS#+aFKu%I\OrMIZsfs!X}ėZ9( T h?9c &N'fh(9 ~ W5Tdy GlN.q4 i~6+//_'Z"5i Lưip4xp/HB"&DI1g>J́546#Q~}*q;TNsrϧY?u(7@i$FTFd+Kဏc.6ݳJ>zC=|I_fI9G$ļ!0ªr/X@^DuNzU?E,cvГ fg|+}^*v#̵Cyxw3-q5shX1'{Y#bl"o!G=7 o$Gf4!^(`:-Sy">FQЭ)¯)h%:E{*s^L=; _SGޖXli {cSRS9d,(6#x~ +ef9c3_{LLk(q`V0P 1]bzc|uT Nd߯lX;@Nhh]Dv=kfi+%t{tϚaإPEc`򡋫%[Sk8hzxo[{.M-; B:BO8~SV&412?kr1+4@Hc]Do.r<ˢ=#9jP!#ۖ$nuQ V83&y!nlo>Nv'',rǟꛅ{~+Ʋ?|qUq68|UDõS/6TBS?u;c!Mǎ%}@l'_G8Sk*L_~Ax<wYtd$  7`d;n^3bKIÐfrmQ|o %w Sf+R,1i%T5+sxHVſ+nڃdyHnp]Hw{ ɘZ${~l3ogn"d`v̈nC(blX[t[۹cY%3XgGQ# 5 7/h9*'pXʝDq-w=`QǢo)~s&Vh;S{B8Ty֤{VӴC?CZt)CE~厹=gU@un+ʠ-7>z`;i:,\WKnuUԆt%ow>* yxuU(SH_ZryDvDx..oS}³)ݲy15v!}M Kx5]/gE 뭖j}n`ON׶{$+Ս̆7aD 7eM9笫IW$q! ^b[n/yڊ$@OFvHq҆}[FpVuWgd.Hlڣ^Ë!,X5%w2'{kBW{8%^lNZ17(,YV%6ޠjM@ $qull#-9^[RO|˟z)HLV|FgO ~-\}Ov&y ͥo`Tl8hm$. ?"YdP7sL߼ԡRf\9'{W,T =4n /cxV]lѭL`˜69O:2u$Ыڟ\F,ӂut xݚ>ZzBZJW_(߲A&4)Vc#tԂY_Rm"5UjQo 4g vacˉa'BLew[_A s,g]tHrr> @KIXV᰾`oIϗSEQR`m_zn3'}oб ֮·dWIv?a\( a$¿!/S6UAZ+-3zPaM͸OcJ=O )#nŅbq."sY yϕGpj$II]_` klBX {ZtBāĨ >NsK uUtӍo>jrL {ie硪X;kBrJfIz`20@-ceC+lAG|dCn6:PQ^b" zhI+2ֽ7_˄Kҕ@T*s.T3VcR^K=< 9|Ҵ[ӷʟg%NMZ-pڐM\[g=ǰ|vYnh\5j*1Ꚅs_qK^voY5a6Uڴ.~6?ީSݜK\kk%vXt^KH/UBmRZ'e܅%>`'LjSc-ϴX||ՖG4qdihN%GV.&pS˺Q\#dN;jƔ2zWͫ3:lgu>6+[/Ӻ53\Ac1X7 s`Ea!FEwzFo7MS мʄLhmʋMnr o%N3?g_O쩌~9wXZƄl,1FD>jx}Y;I~:yrm{ܸ$~+x{b6-#yOǂ76^n_oU0$$JtfNTefeeL` Q՜R}D%w$`%S̯=m+u:m^_YMPA jz>"*UfX̯,HRjP6."_H=[@Ӥڒ*RUY+#c$MS%H8 Y)MnԮ1j+XӾh8ϏNxS(K{^flg}rSڎu"Ts9a:pח\߭z FIkWbvo>A&-T;卼k<<9i\vʄ0hTSQTPa5 جU p9OG>h#gZ9Uٴv$VRNJjωE.=\9v9ӮrZ756e͚MB j&]*(Y"hm!Ʋ"UE7D:2iZZIEsBWa Z-Z;Չ!̝^2cMfUpqiCVg NԔm,'I]47\51XhOqhnxV;Yە66 Tcԡ[0]΍n-ff/ (?Zm`IMkَ3ڢ2EF,9}nWk=o0#Fa2@tFyҲiv<-U|XA- gòr;Q.(/Sȡlg % n'<53|쉅;v:]˫x|qbF~ #(U =\5+j:pktauD,-ndr}Rmt+Rm-~Fxt3,5"cdٱL &IR_L{dMd̑ݖ> Ħ17!R?1f93^m 0a|f1um3UͼP̓١Rs[bF[רfe ^L֙>%ݺ MP y-fpϛ9X^#kΰmmf7%W-jCR4?d*vͮ2l4EJqS42R qiY [},4P;#yn0޳o9H//"14jPhUQkEu R+Wjd PЛ e] i)%7h|h8Gx8͛sJf١欖cIΨYՁ38|ժݦnzOWZnks~CQ;1NdQeYoU)nݒll["E͒XL0o5pOvK;-b7q֮1Li_'ӟǽ?.yIKYR"mnKVZ1 eHy%KDȵe-Vda|'i[A׌,ru=-<9k7teۭcvv? nT vYs ʝr{)75tȮLU1jz7NJ u]֟Moz84Ny9Y$%}C o&JˍM']t:.1ʺ!gSn1+p|IZ^I]jϺH\%ζ*Ze;Fɭ,j"MTdgʋ^cYԤ[tq/TzxHSb%y)JH&:2#ks荝1W)LbV).a 3[uu̟ܓXj66 ByD,V`6%]tަhy-IZ[baP̴&0*lNK:}eJ=v'>*k4gG97irv<Êˠ5%7BYŤxoy1#faUcڭ1(Vsm;{i^a0z{mP/KF"a%y6lްN|% "IyH`K^vcܶ[VJ :U 4sAinBfFVW*.-]Gפ,hQpvf#ŮZvqj-eZ ]z,~kamTܩ: ]Y5z<&vƩLIۺ^UXA.1-d^cDX$@ɳ®6TK.:m,[3f޺ۮc"mw'~k4hG9m1i"CSFvЛᤳ d8BYټ<"]a ) P3Y0Un̺ /+=V櫜;ibwEW<"H\M ALMi@  ѠZ9VVl8={[X9l}< uuCL;eޖB_G[+a+ڼ!5Z|HZL5~ NxEdl܍uVKsCEu&ljnKO5Qj>^d^!,y vuq(<פ۵5@ņ*VB@L":64:/1ֆ5ZQn[} Dޅ~ʮ\6Yidkv4B->HvEg˰ʼӜvX3YR4=>Nmȏ^dInbjٷhS큽6Sm8%LŴՀs):pzx _YY(){X2LS[)yNz"BR{9u]`dQص'LlPZVl' o3h03Znt/=ϊnRtG!7n; lfvInUKFR޲qT/GQ'e{6̰).1ҽ#͍ͼ2]aΠC+mYd3AS_BUt$u=\4 #Q!S4)D0zm]%oCŻk)2I|Dji:Yu2℮dթJJowb7GpC(4KK Ge|1L}iԡƸCo){XC&ssPH%s S+^97fvMzaFgZN ӌ*z|rsȪSojg@Ti ʷvs\;򧷫˖~}xL̸F!ԢZ2a0XŲor]n%g,EVsvJ`SRCI;b_ ߍ{fڅEc>Bép󐂻IT3 ӄ3mfN} c[qMw[5t KnJmPf%,gaγTֽ|E+kcO<4R=ݝ`7OӉDMsmFḶKXh~X.yo-; f* }q\LםJ6~#2O ,ؕٸG],Twc\JOaSCˢ >˵sYĿ kf^ubx[X?%af˄ңյR4a&nQ*P'T#jלzS Kz~X3M+B4/c [7%TP)-R( b4{L)C#7 PFx%r%^h5}o:c6;.[mEMe܍۩>0'F =nvԈzbf*/X|d~˜=z٬IΌLlR,_׸M_lMvѝ#zgIۡ fQ\}1=e-6|Z 3aQVaε"9Xd6aiUi.q0-;iKn&N?ff}8ոnfj L3 8VG/ץTb@zV9sÎ[i2DY7tk9(w%fbwUD*5ɹ<Z1wh[6Ĝl8_8=8uG9= C@刷 l{Nn$X^0IhDZ5o6[N ^3R f~H_vWF \SQi, <)h8ER{ juʷNtU^P'ۨEKn3e3je6rW(Vu7Po-B2]5ltf9P@v=\|J3Ҏ[5]:pvq,AwyeQ!=n r#=/ =QGXux2۝wwÖiL|*8a9ɏP8ߟb9)OT>m:sMczl2guNj2Ӽ7.N{b҉ou1N7juI-PRuFue *moRRkPI*[x"#@pg{ﶷCwU:Q3X~X3j..0/gl;Oֈص8m V#rr2J"lh4l )Xg(~n;-ꇼtB07{evNn\hDbl O9[3͂A>׶(U<10"_1$ȁh"V;!cT1ԋmkLS0-AZA o*lN+˵nkJZZȥz䵲u J[iL¶9g*S[Lf.w=8[j1F(R-)T$=e;kEugCqHF80T2[jmt  څ"k?tݚ<"^&h'GA@ kZZ6:H!YbUUEw\@7Tf]T4[r u( Fc-zڧ@QQ|0&qɳ璓%ݝq  @ B4KWDW]i"2V8R\Pm]y&zZUyVXo˝X)Y?[jz HW5rzV˜ˉ{;3ΪOnf;g!FI!t?EG9YGڀEfj>U`ҊdEw"pd?umGqT⺵V|0@ F(q u0sݙTZBAA]w5Hl+M=SC hW i,Kmčk,;mcJ3\oArfMӣѢ/mrBZ͌8ϑr9>[ZbU\km~_+3'r-`mfi6I/UO0 M%lg4k2u;| Fv@V1`mWCH쩬Qkf# P&WX.WqN)Fo iJMR˺6l0Pan"C,K*pv3=cvs[ɳ2U2qބ8k;pKQHVtYqiW'Râ2ƣ\:BT;P 6vڌKgN>bZ_ڝ-:vMXC2s\,6/[zZs.z#@d-鮚됝-ݭ-}ڢa"-sx--ioUõZa}Pw2c9}+O8g¯l:`r[i}Čewfb%[v%p5aM3#i.F[愎Ify#ôJâՁf66^jJ."+V % ƶ1k}iےa[2RmʌuՔ$fC~Iv7KbMD]EúԕekU;4>FC+rUl7KV'6tUq bz9y1 Q]1ଉk0+ZJoyy[]ި##Rzݫ˓jfLo@_Ih  fsX:|`}r>@5F,gr=ՈWȴ7.,xNȺ`d x9{BrnxYAUC@o>m]XsF-íhzF&T =S4r&cfwnMJ9$a/ i^mhfeɴ g%} ݉F}'pژ26YkvڌŒ4ti2C`^4Ji,c3 ]tڽܖfrbC /=VAb?"*΢!|o)cX)َǢv<`RW''$:d@{_^Ep;b+mmfR}c &,f&,wGa @ք>/($[8B{ C^Cp';b' ޭys#;ycI;P^@܄N\e*^73CN ?|~{=p= ŠWQ=wa@g:*˽܅k>t&1ȇ0 p5v  x":xw#gy?G h ӄ}nV?ߊ!3`)ؗ{G.,y@o@H}Bp5x>Ps߆4澕Ok|#4>TsˢwOp#T7cS*n8.lSw_?U}ݧ߃J>w|p>dnt܂qv]gBx ځ; dѻ}?F@;pv Z8ЈM-HWPOSoD@n̟`{pOM6z?m|ɝ ǩ"z/ݘOI}jߍX5lT.XkJ<*e #Kh>Ry߂#T~⾍ϒG+|ʾ g1Ck>VY?b|\ǐ?Ty_Cp#->RG(wP%6>[o@M?b nF(xD@l%Γ^A@q;E}gXqoz>ڢ }1hMП>?0p$BBw"X{"v7b~ؽ#-;r Cm]ɢhvj!Ol$cz{\P/#FVD^~$ށqHxڗ\3?h,l~Dr;1>P_*8!r/cތCeBY3Kǧ˵{/iT>11tY&.?qs^# +=zy';)xay4)wxyG{)|?h܁R5@yPB|ixŽ27y>Rѿϒ;[*HU{'To@=Pw}~!$Rw7`y~O#[Q=R?F?F? (ߎZo@=jz%Qizoٽ{>Ҧa#l͝ib1υ`XAޒc/emO!Wկ3p]tJVr< ~눐kTIuv  J=]E;4Wp>B|1*=y֓.JgtP`|EogL %zh}7ߎkȑ+mˆ=9܆1̃Qߎz6q_q=Y"|}z-rσ>40%F/S."훹NIpǰ=q} p1l  o9lLa_wZN [to%SvێMj[&˃%t-`,Q4,r: m2XPϨh'Ȫ$ }zaccrȲc_o0 9F8Kb',H,JCBlvؐ) fD苊2X)J_hyWT]8W^Ni[/` k׿KRp>XrSO|^#sl8}<O X$xYS5"3;3 FAkoWHA/5<7tVνī6r 47BȰ&YvBϋL;uoˌ;rqC;Imp^ 92s_MA  2[ߢMY|TO?sruG^ 6O p`_wwu0KId1r ũ{%xb]UXG^8ՠP!9XT&%Z M[OBdz,J'6mbXP+vGB!Qrt&$RQ7 JڀxĀ#C1ѐNܞ3|hp`niO¥,cK:z/^> .p֒EBIJ-TKO4/]AK ;o}s%`:w&2WM,enܬVv B?3JZv$+懧a0N?}f=mk|^P/R8OA\mNO]y}P h&Ho"@])`׬[`aIF;^=u $;q{BO#h R{F'y :7LÇ[=dX݋KO/5xqݾ^[27rs)ǣ̼ѡWG^zetѡn3 |~LV*__wa$+*yȰ__vs/nOF7 /,h9`V=GbN"} LK:+\ZH|;)1]"WV1&XAh2 ڧlQ$t8߷c~%%HH KPN &fgr _g-sR G/G (EKîDu$ 4aAf݋czIM|SAԹv%[ק<ۣCWfkY#/2h@?{l㕾譝 m @ɿ@YH?ci'7ηo'L4b/v}R@_/}#`/x|pY8PSj#ӛBy58YVJ)uD:%(p=_ld8 <}԰3vI>yQ>) >o{Zqҟ$0mхoC!Q ]V-kna^QI-t0vV_TA`mJì8`}d[ JDSub\N&52&M>T*G sN/&.T"]8#1a{T Rj37VWCnj]lu~䄸@1?R|n+%ݽ=CX|t!)WG̉ ~=tAصK+ݥ$I ƞfy MO 淫?'GI8gN1z1v6;:]ÜyڻNωꏯNuT14qy{Xs|~|~˴;km'*}5thsGF͑šu^15~6/yG]u}'Gw N7Ym7ge{zvvBkySrZȅ~Þ Yԋ/o\k̦N+a.;|Ƿ 'FBoN$ iK&._~X{EK%㞺B?W'YbU<07aw<ɮ<85/_ t&7OlwS҉BQ=VC۠g;Wm|*/>:߆~OL\:G7gxyQVE|wy%<.h[1+B~9V0#H[.Nq_AtyGA^6.9*]q" W]78s 6X0JP w\Yz_+qpnQ^2S8z\KP\oheÍ}!u~AxMK;CQG{Phxq(uI]H!U7s~wt*d~tuoႵu G1}5I̥۫WRWI((q;؅+A~{ﱋ<\pwM v\S_Ά=^T=G-y׋H^ w.ǜ\ y4KBt8u2 /5q?(JH_Kݧ]m[dK:_'1^K9[ztU=Hu<ˀ۾~ئ7uEid:RJTE+qD֣UQa.ו>USTJ].ׇymCQP8jCߛL)JwJ:(z< 3͵Lqa]ezI{dz,62j֞v7i\ؐ}5Q2JgQMW"c'N6Uq(rb^앆"r$ Xvg):V4gI + e?tH/+t%>(n0D%"C4lGբPΕjd>/6kC8!j=ݘ&U Wҍ޺e] Wx0b=-i>S;Jj8Rs:kxguD}YL^'#3Sծg*m5.0<6>>Ez58,#6Յ6%Y}:e13V*&QZL-㉤%ma*c]Up1{Ftz1m1*zv)xWs·x+^pSCoS\@7P[Yl5qmgWڐiWMvWFJZq59CMatfT*s3v;2Y/G4cZ.ڵb^3b7T-BܙCe؁3Lj^vƝٻBk=Xɒ̦gYszg*$߬׬ls3}O1ٝ|[wvt]FGtif=nJ-Zh+Պz+_jۤYbQU-E K;M{gM*W>j< -O*RY֝EkY)vcWM:Kv==Z/hhݨ-ZŌaSQRn24R6IvRMކJ3}oq@ncmX֨8 B:ݲo'pCɘZQBz65r0jLэ%U9of{QKf=]Xϛbr]oԆ.6ԡTfbIE#!zd/XQ_IqVdJiv3PXM^˛g]/;lu[lMjKOp(qKO.Ax?n!,=ܔ`( W\^F)Sҩ-mY *,;$,{9na\>̺߯w}mS0R;AUUr,{(<{د:L|ͨyxzjEc'z%Pq(B/u?2PoL =8/U6o+ճ/=M p1(zsOYH^(q>'oe^)NpSc nCĆ 5{ﺺq< Hi~$'2IOʯ_-.N"{.?^) ߳e\_* z(ZH걞B7kcmWC#,Xh{*HnhX~0|w%R^s,SM)(%~UOC˵$/#lMYO#c h2ϋS-i<~5_۞|I2'5*+K* J%jg7C>w0YPDtY0as(__~R8$z@`Pp(WAd?2R~T>O^T!^H}d|ƒ`R%zUEP"g%V0?RbGJL} !ȥs g E>G&h}֊+V+D $JSM D{@E; ^Myj}#;@0;!:*t*…&%X6Ys8 RiP|W&tR@u0뀘@``7o?m 1 تB&5d"h^,5t嬠ABoaѕj 0q2{`dw ]p2@ #9x&LRςa#Nh! 2ڰ1| ?n(;UrY<0"i=+ e\ k`DHayc=ާПW*I!%*66D^ J(p\0),X{SPXR R= " 4< +1B;X@ b R'B :0eY  ;3!p#(jA!8Cq[$pF#J(XJXD gnA,qІל khVWf`+@* PF">$躵bɀߟCC `Y.YԜ~n ^B x J %l]>AU Tkb *b%` <8R TDCD$PQpy_ #åJ(B,u;Q@ !?y&,&MGDF`Ԟ} yЄ L}Ww!珐1[3@G0?&/TA/?K|Q%3r,"!t5,% U-F]mU~ԣdZ(5l],=hLbG$7P?1h2ѽoo QAɷ/5mn"uE]zu!8hnm "hLj Z؁bS hw\GS(ID>qS{eH Bw ԋ|HٛُAp~߄ͽ_\31+U 7NY ćABFBO>@~{=yVޣ?Bnƿ]09a7 ;qi\[Rw\Kޮ#Jñ5wX^;nBWhl:ܝRAGQmE hoeO-".R+]0,1EFGc4؛mߊ/~=EOj"~m*<6'; Oa?y= hwB moZ:e ᑜɫ/*W6{cfvtuukԓJl:\oau/bx~$˂ǡ *ƷBa`Co90-`yoL#) yܲ!7G&D( WY~/1DZ/8Z 0gE LHA/HB@vȡ O@}.ۯ{6^VMC79`|1#vB[6tpX7C Azw[Q$}P>?=V@n~k3пQoP?lU~ z̈́n+X:G?,pu{>C%{?I?籎;vT:%["B*H "8sߢ_k*ȁ8~֣jh"j<ESoh|onj5Cd>䟷M&k$^vI!jkH>5UVD&Iߢc=NG2S2H{q"r'ɖnX =PwD9~Plp,ٷN?N[G -Ӓjw?`TC; px w{æܟ/C8W9 ]ϯ⃎?a(  G8nϸGx]n$vtww7oۋ;DCwY !׶a@ԟ}|o:8.E+V4ArjsJ)]~1 e/E^l ƩX*f5M'$Wؾ Y7z@y"vNkw=/*{|se$zig0egxj,$30aX(5"D5s;3 x u 9f#ܡ*f4C NQB9uP㚎TXI0`ݡ*)!epi2e@c\rm9c@ 8dgzca[6xVsuR)Hm^j3+Q3%ϩLL µaLw(5C?e I3q \HF+ɳ|7J2:zpoO#u ݋BI=q%EUj8I';(֠Ul#ᣫK9N-H |ߗ1xDd,@18]8 >:$*fQmM^81Q4Q 0Ah|89ӪDI.C呚s{*(& EfU X'A=ӸLυ_?#V V!)}'XW`aQM ʘ,S=`HpEP,]4m=XC6Du r|ƵYauHD0p/ b'n9lݾlB^W~a UH ,bkoX{tVV'F&ߌ=()w= t\ BBx ֔+!7-_VaiyB40{M(Iq (.›- [3E[kx{Uu1D@jj%#? {r)fa/X_ѱD&+&AP4'S7W%bkS[$pQZpuƣ nj8F('tɴfvE CP<^O~1] QU6{|{ H"9u;5U9b35, ȇ3 5@>-yjEI .q ijҟАEiLե:_ XnkeÂ{a>.:~XXE:9kh4  }*AaX0|{d"cjJ"D\%,BKϓzF?y*>#Ҧ(Ivg(qv=^Ivq@`S{8㹺׮n$qf6~D$Ѩ~UIz?wM8(ݧ'_^젓 IۂWXhWaI-}6ə_8` .m3-;FL@; TH咅 Sv C^ʀ sn1N>cv2Op 'Cd]т$%w.(J:@[ X4n'6[) Qh|Ub|!CK*扣 zhdUل7aYCy 8AєiNCCGE$H*0y'C\6YNv\2}]أeL:yĒNt N`H.cy@TN1e[hnV$o+ސG$XeILђEp&$'wx9/t:e%Ѱ Wiz2öݩΖXI6hD\\%0=&n˓P/Tywd3NByJ1iѯ]iր8kus8'\|\׫.6y5.ʣt)3'SI!gYtqT8=>y:pjvtYVȇ=D6pY4vBƸpUyAu iT^AF#hk Z*LPV.R^BJyFLCyU-hL cSq2`HӔ =<+N_mpRsj:WI˫k^O.s@rHĝaK۰mA&eB:*`rY ,ʞ<Ź}z`EJCfΦeeQdD` ʻΡXhjs D}ekٸAt򅔚*mh-R"̺pN$ɂ*~/1Hr@!YOJ6t64d'(cIN$iը,ɭn}tbH]Ro PX#W42yt_n`mu=IㄘYeMXFFw3IP $KYo8xw ĭ-N*YUXmN_tT7}$J@{tt,,ve6ِ^6jʼn1킘} 0pu~8~xāgNRU| 5gzkF~Ŭӯw3׼#zRWֲδO&[ko;}/ȜV9-͕/(OsH5 Nxwh*H?tkLbR ~UOaoܽ[нĂ|yGXc~c~QΉx'u!o?>ynȯBi Ѕ;2﹆̉oVf$ 0Xdu ( 'Z-i6@/zP$-ؓE+R, |_h u+9w)),z*-ncKK5p_XR~3~3D8.h{O^\+о{%"[[m6VC$}kDB8D/OSS"w#J,ș{4CAZ 6kγUSp-pTn^=1Qe5NХ(gsv)=`s+w}`@3yxk/ktwxj>1dIg kRQoݯz Kc5|2~ߠ'y% ƕݘ6FJ0=Yxͯa9(WW|%r3xmB;hWkylDK6o+n?=\s{g33lh'iCV]'{>$-Oa1T'6^YszeX^ɾ+=l8{/*˕-]Bl*Eu_QtD9C b}(Ao~CEqM]о80%^BؓB4ʣjmLx+;Ikoѵ- o?ݹݿōklyUG(.ĻYUO!}@?v;,]vĀ~I`d^ YbPQA|eFWWuQ,]*)7Xb1xd?PC;pa:=:ro V@|2=t"hqb184M*cZn@ jqM=![0nλ+`- l红 b@Z$P'ȚU$C`RkUh/N Ԉ;{ \i׊kΘ%b3 }qRT%꓉ +6RW^'Fs2Vf#91(̈wQM_X)2Ee|5d@ kp<9R 7@߇%:yrT%V,ܱ~ʦ#n&;Kg53ab@2@Zf!=Do6tk rri혵ԫ/"zX7{㊎zŷ<=C~w6E(Y!yۺRfzy~1Gw„*"b3\;Zp*VX2M>&7_.8{;eN]r-`Zj*yû|l߃OUPtWJp6N Gpbmك)3#oc6"턱CkZ( Eh=Ej;N*4 q`2x=>EEzʤ!K\s->?nYW& O >}ѕ09 prǻ/ole4krtʷg ]'VW4iK|L'wɫ& ibrK~Tźf'tGnD>T忇HM׸U/Ͽ9{JWrG ǔLhוK<[F]0D/5ނd7?Mƨ_*_Lu}z{'8Q[UoNɋ_=Kڐn㲨w0TmdalzY"R( yb@eȠdbY"\4a>d>d3{ExڧeṃM5 0֓Om[㣼>^O*\nMeJQQ힤U,N2?h+I]y˭fWi)!/Hbm  ;uJVQc\ 늸C(e2]W-%x>?'3T":D)YZ.ud]#C3(9vRVOGDjТ_-K ɂK.1_ ?:LsUZx0Jϰm1Z؜w,{%Nu5sZ;7`J?īI*]fHӜ܇\t1L*ɔlk!Jr,ܭAz,h+M Wfg)p|AuZM^dx3wX+q}7Tz 1[ͭ;vr<9S;S3p5j8ʝs#䐁ӊ~ L-pL~oGj-#w T8}oq|@y -+[=*0/"#"E=i~.'Yy֕xJ&<nYq?aQ#LWmTwIIYPgOч~Zu ͥG㫳5 =_}[bt8r}q%cz[VܶM^h'E1ٝJo>- ^B7e?1  ;`Ge:>%!bL:e9H?2a?1)5g)p Xv|[fg >鏳LNH\%3C|R · 5WaF+X0Lo(>`c:r-:hUs l@0q^ ꣡jҧˡ~Xc.}I쌆 ^; p?^W5{S$2X oo)*& ye+p9Tٲk#]2+RB%~B6_ eo'/#B48&5 e4!͹#-Ű琚"a;) ȄH4tWoDkG5ˆ)6LX4Σӓ#}9&ݮmVvۖnHF Edw2lgI΀Ѯd6٥cz~ ֱ3H;=eG"Q4H=/v&(Ed0Z1R~r^h` s9SKԚdLޖ?ԇnjs~+afndrU9r3r95Y#a{l瞖/{b-'Ѣœ/q`:9Y?CrBs|HO1LB } n8xdi*4'I gN% K5}}ޡXfStsOR|\ֆ` _<S:zrg(Wxe>e=ML¥옞F=1=D""? tҒl K<BiZ ]rLo ӑW97ܥFS0=$-eeyF39i1;RC1Ἕ s0|??a2 kc3кN_)9ɗFXe}EF9ix pp2qٔ>BЬ. !t#+_> iph5ʤi|:Dw?&/ba6.:9Cr{ mt/s-dFrq-N[<) x'u ӾIz'GyGzgKW/`¾}zb}?+P`#z/^Q m'QgU_E$ع0=sZ%CCI 0*Ȱn 4Myjm䞸 =uJ.S<=H~'xg | o۵_/y`+jnٽmfn{ɂ}go]f2,X"fq0xg t9\\G ]S\m.較6y{)z9y}]6Lg.Uȶ=OK@?nszK^j X&4dӰB,5˂Jsx0R;78gnd4K2e)3ߥFQbT68i8]c<naz=4eJbYU>%D͒c>4]DvtM/o^d1+vNv}"'vWߝ]]xe(i}dL `v^-,/÷)}ޚ/ғlZ//3-p]+BơC/Gt/=59Y{&UZX >i/0Ko,We~EWCcdMT"v8KNiم0/~pgdƽ68@W ֗SnyQ5; ;eS Deo}uv:K6bmmc"]耨Vy܆{ƃf\cyRKøPcP(rhxJq|(v؁cod._e1%>"+Wum 63v.yރ> PV- G$UTP+gn38{d˄o ǿt^B-Nmnfki?9)6CT#& )9n\uI/M _pG!Pk&9ǜW`!3΂M@eh/#MfwZ7;&+'+=˥wP1v8B]d.l+n(^ k0;`L/ճ.c QxĝB/zj'N}yɳg\Ϟ adk$׼ P6@td s^h%Mi?1!V~ :J"ᴍ!7:->eOWnD B:L~ ;mT]-O]%|v>v`pSFW4\w 7 v |0ԛ:3?u<&Wb2CBA9o/;\{DG#$ܲI 4cY(8x 52?} `aHrz{ * {i`Bjǿ Dln(@V-eFk5LƓh;A؊9 :)8$xW)T,^O퍖eϼ; $@)r<ϭd :&YhQL$ ;,n/ҙL!+ &:744@&J:VVlܨ7K?wɕOQ}6Ϡg9w0-wgo #p4|3lF=bw6BK+=IF!`r#y:_`;N.l!+$ӯű `,ƻbX/{cIݸ(6!@xTip8Y3.)۽ѩ;yL spR 2JByuӯ𜠐#{Իܦ@:H'@/0 sʲ0C*'?Nrbd,3%O4 ulR: gFSA-mH|v̨ HW9Mq"BEnY_AeDmȍOܟO"[׵P=t%~~uw8u8k1r:ݳqiWWqԶIl,0eLܡ:KZyNM+e;fp@KQsL9RBq(͏yjNu?p#߁j1t/]Y>3\*[Ҵ^tXíx C5FLAyi`%MD-w9Yp/å 7_\s?Q+KGN/a0W^,SaP'j1eJHEs}=iW 'YV:5*n6a)+[|optcE@T5/R5jѾ~A@1HؚmzE4sMc*j: +g7Ѱ=M0m GlFqİqxYOn<}z1Y#\^mhۮnru06HtLF:Pdm- Թ6{wHJW};mM@oVBxO#**OnͫsϹ=+s(`zƫuu,oD6m %0챨N&t>S[0(v7, Q"QK ǖyX $4 KЊ"!D!z PU܆r@G,4ZVc<$O3vL9 ˴Z76&XBM$GNudI*Ihe̻c)Wvgُ$ U2;v~Dc ( b`k5Cwj~͚mw7,J6 $UrF"H6t=i܆}pjwpn A<-㏇ɮ/? X>/Mjj ;n^|*5X;S*H|Y1#ۧ 4r(LAHYb}\MvR&hJO:7okvULsY+ u9J=dMX`v+s*(: +ƪ*bC=Hupz51k#C$>Ded3+ KhQ,nǞC}NU}e/c~XVkkiuv?ǘeLe莻izF}ldk~ssO~(%ûb5 dDG > mվFc7_6W|9opM #F2&%%m/tÉ ,gܟ/AúamTramuT(Ζ Bcri:Dpa&3ҰKO˚OǪ| .i'ac}W? uQrkl]8 .2]!9CGV|W ؛Kh\:P`T1Msje:iXkޡ0yY9٫ax7g_qRRaNJ`E!hii$@~B)]Xf+Wo&YeEŸ2?eNMa\ܤ UeHϖ躰p0:҅qpr8>IWfyU ibn2޽:uq*訵8r ؍ (W,P} ErD#h8ѧqCd;5;@ 1߾1+r3TO]"eVd+,af*wd.ooh-v7Ͳ=lIF&kx'..h7u\Oni?a4k,$@m8sEkG涜s'ڭ~0%( !E O! @|^;lluρTrs`n)} E) ѭ"^W_Z:MB0Uw)VKGpv39&jՕ z B?i݊nTkU{HK7%5 q"&{UDˏ+ BPn8ئs1 tL RU4k eoc2tf%Lxc+֟u9jA~k++-NWBS#5Hb}jIey[Gy8yZ@wL%u-LuHDb lbKuQ5l&2zׁnE¯|ڑASJW&g\6:5mOG9l<`ݏqr40Աp|GG@kG %F4 <Hg}ZPᕕ[|4a]0qkVY`~L˳/dڌa'&)RۋvimNZ*t3ċгi2b]Uqk e3kyG~<7s=p9tU' 3WWGX9}WӴnI0#Q*/?9N+ pUq/d{_;xx5n2+Ҿq>_-2*C94KQ!^ޔfךABtS'*=NK 'D(ípPF*8ְD}x#omEeŨf y(A]w4M2*"g=זP$gԼbJE?aYv#-,w.֭ľې?x.y ,c+:Z5vys96 ]E=ْ4LFCXE:}^0+!F4% PMԶy; lÑeSl&VlΏ*ߣg۹뾼uV e x +]ޘ%s!jGw*,%?@kXZURqēEvR:;nn.[#RvUfp )K PK…dBsgQNaߘ6 !&6zp|ij[6mtֻVvUv[N[yXR@k-%<&F곸Y6.d։lL3lߥ#kCv̹7b|x 8= yޱ]͈F@Rz )@|sv".h(lޠ ׍JˑfN@d/-bah-ۂʹ#ٍ "f49N[qӰ03@fZD xblPM޾aϣY,xځUƓ-߲** (_PA,z93ýmφr[;4+inc{owUOǀhx,gsN a:oRڼ{@!c IW᱒/?469c鱚`@NYFH@q(C!UcF/z`6/}fCU@CMቛzsm?'!,^4(>#~u^,Kq`~m5 =apW]zA]zDK/.?RaCswٱ |^]oUzDblkқ(c%5`6Hz0{zRBE 1O2!>!:C#{ނRBXAQ\rrR^yFcъ;Izx .8r?&ЏN]Ri ~cY~vOX`mT.'%o O~u|@LAهiRc/·@Ja8zeQ*| #fS+b8\|JMio\[vKEѠFk*g!0q[ɒ}r GZ!@C.%l+ ]^3vEK)_"c/ wlo:0"к)|`O䧉yg 4V}wEV`X 7 yگKx.z<=H5T-4AD6VbKbG5?Ո.n]+6eͰw!"EHdC)xK eU MҦ5mH dV7*@;wnc4֖ش#Cdg@N:T)#q Gt2~VfX6N>z-svŠT&鉚H|+$x( R .Fk5ͤ&ږ&"8_5XB: XcZluw*OΟvRDhm ,7C5b>JL4hu)ّ}I&K&2T͊ZbOz5f,$Td{1u8Z 4#T*qEvxFk'h&K%h+8+'-|G9C[hȤn)4' Y:? ?Pɢ2Aנ] Q%MT7lj־Ġ.Hȴ,lHld%([~f/x&[MZF f]ٲˏHM%O7HѰ "|7 n^:qȚTV6p>6]oMCk _~-EXIqq9>_'\SNor'Oո~U&] & y1oHpEA3oG>O@.Oy)uY<\ I{U2|q^[4W̮yXG}CL>lion? ;[@g2_| ktOר߼5t\C0Èl-5X6ap >~ dw*P<fh=2?4?ޡz  8'҄kq >W7F,+K;s)8qn:tñJn2Ϣđ0AJw:ɪ "At `xނi4-8b^ssIO:)c+,>^eS?oDh)W7C?ߘg>? 852-h.p-<4\oⲓOls|>l>|?w\NĻ:}# QcIe;qM,3+%@?8=Mr4 r:5,Vl1T,G@}*ŏ0bpz+8K^ [rÌ?:<9uIOD~~~~x~~T{nx]|w2´k?_f}Y*R#ssj ٖv~q7̠%Hyv)? "W*c p2:!|}I`:S8Ps7"͈kIA.3IX=W/Rٓ*We~o lbV"aXYtmIYk;A37oأmm`[8j/! ۔w%4ʬhnGÈZC~f:#Bhu攋c@zdCpjP63ǍԢbCH (! y%?G] pHxQ e8L>cH0XZ:bfkGx;deC`Dyt,`-.|xlݣ01 <|#r B7-f! 8$U`b;"ӏźӲ*!yO'EU!OC@c;%%㚇կA 0J>b&-|%. {-,iCh-Va 92GEY2IQ ,M~kGjPc"9th](wvpĐ= eXf˨Rkɖ^? ańOEvDIJp.paadW>@țѹ Zo$Gh1J܄-kHY2A~癬pZrl+"%$dUU\l;ז-J]!uϦ0ԪDqF!'꺒x֌_ 8}b:Y5v:%Cs9FUqY;KU5F*n:׍)FMƈ fiM1v)#1L#ТIXGeQ4\uƙdk;50M+eI7D*L/I vx%MbPK'Z9.5˲l&m SԿZ'umlLj U?D3NWBRn܀#w2wh5xy\VTE$y 90Rrzf׉:$ 22BOؕ&3]&NI;\`B{%D,>1UDE8^Xp-Zd}x1 #6Eݾz,'1!rQi]/ҹZ ?' |Ly&Pua_6ǎD@zPAM\ĵv<2 WUb܄!4`hnC }(OI2KraeqQ~P"x-|=_0 ׈eɗ ^n)N1M[Lۇ(P 96 TƌB 5ői|)M"Qrc.I O ^wLl3iȫ]Sxo#9Do&xe=tBӼ$t.L7Gsv˖? |y >hɖhZD*X,TR-yMXKњkx? ֦%/~fxg_|NE.SGY~tL-rSMvn>¢ms-CFL;GLm/, 2!gmbASհ!F ^t;=r7rڊv=sY= Х }cՇٰ۰u@ xfzov8T(T!̹1ye^()<ªy~_® NzN"6,y8E]eWՙ.kᯗ^Ì huHudElc0SQ~s?-gy^JRw]2;ibOm4Jt-KpȻy~v¬PaAam Lok%K_!ڦc SkoHz#@6 .^!KS.| ,X&p#aWwBȍ.3ׁ|Q(UB+v7 xUn_2+m&FC74EvV ۸)O H3Y(`LERsB8CK jCYWxaWemm5DCn9[Od{r'yW:voĕj?m6rQ[AcN̺sS fPJXy+96MGca(tp^9tCbLX3mo>bw;MF$t8.g,B}#tCq{9bpŢ'w'ҙ26Qe;p7 W*tq Z/A]NOEոj"#]#֨ZD{HZ˹O8=_Y ἖?/͊sdvr;پQcp8W`MѪ\Pb׿O 2I gMq#S4ޱ?9CUj(.sdt2F4:&wQO.5}఑L0YZr bQE.mu7?>=c ;"qw**iCLJU2 |3l"oX(bN@\Ph 7שp7չ ^tlWDoyEATA#  ݧ ҆h%$2KGfdQ,ĄEKC/ TGev: lfZL/"C_o1ZtNYNXvIb.M\xsY`.o2&$| "g ݯ|z,to4{dz,h}tMC+xJbbWyĝΒ u)\o06:2|p8i?;??FM'=m,7C`bSXd!dO(Pc@m/1r+AxT7p3*H>0Э}Ϯ4ppӮTFV s#nQ1`-Nm{ZB&5_'Y4$~,-Ne,1<4;~VZVllrÖl#3 i}ǹv4Bd%NZ ,3ش(Q{W =-['4l43E*!G_k L80af(i~8;{msekq-lH+^E,*!fXW ֏&`2w>OS yݑF/("ѺQ>p33$o#:MBe}3?v[#SEZmdU_/:}CC%L+9S jXk!g8Li$+>ƻ}hCoR sC#1jH{5{_cV-> %F05$&Y,#JуR߁P(Ihc{rjۮ-j&jʆW'dEp{r&) 15&iaqt҅ HG  bQ02 Z|䨆oGqDH @eƍlqm|m+qoqq;E4C"2]Hrr-~|IM`]gx1b穥igi4xF)yyIzne/Ebą2.ѳÛ|Sr!@i OVp! I k;: 3 [2D @ڍ,8vXeRNV,;h1莈LqК>a GSeC*OgZ[F}_ݢmfkJ4FF\cVנɪ~2y=(_oEyy ;91v`Q3z,N'8sxg|C(elTH%uigVyyoT_wsL`= 5df`s»Gn;cv hqw~v?ưb˂42%sN \a@Z'OUnʪixC3tZ{B f鮔b7V~T"WiCADlEqy9y|"mⱍomb!몈HOjHu6YWgni cgA$r SDb+^h6@ Ts,CPǸQKJ.jS,=V9΃<;h ǐ];Ok|&A-4gCĥmX!): ^쥈; SM3BlfpLdRpiE@f>{z\ KƺkC٭5GaoVI 01uĬUWWGE7xPq$hsJdO\,aI?4̿HY ~\eB4Nᇹ ܐap[)ux$X 8KILvok҂p`|(,v!B[.-fVhZ]9bB5`)lI}BF(A ‹ iᣬbCڱCn`̮ޟIZc ozn* c4ksa9 52;?l,E=ճΐ-Hsqw<+vFbc[6Ky봶;'7GcP|,[[+,*Ԋ;Tz!Z9~- -E{nUL`Lݷeځ'[,a`+$͞څ8}ڡc(Qwދ%bUO b@zXNX{A*HDfb)a'$+TR\Im'D*z.,=Cلa$S&1hMqfa,+\rpqW݆WUWGY:b&M V7P#bWGZ 0'AI5X=|@$c~['cA0U'gjqXh\N>cԵwnMB`7\Db0ohݭ~qA:G]a ]gzzn>zm#ͻ9:imD|vu.N~=O uY$uq&l yunkgt*HKCPU9p|fmz <'o.eX>-!"1xek1z(TBT4\+3n_ 6&wvpp~"H >ILqr3ux7fkYpݑ3y}C$/ˈ=9ʼnk> Oz2a-䔓|jgax]3[SKxA\4Џx˥Iɷl] ݋#| 0J uy<E$Rh[ƎF+Ͱd%A v(h3Ș}s " W+JiyS.(1@v !\Tݟ^TӉA3w(VoB@,uO(q<,MIS[ӟ?2Spr O&0o@p Dz ŢO6H6'b3<4+owoQOr ؀8eXܫPPo@/OrZ, )sǹx'E l(r!L!4; Z|6+@$W0gO'Ι0 ,T &$~iA tP\5GZE^Ep5!U,!#_Ӫ*y*(]rݻyHa9Y<3CVR{=1lˌǗ!rMlT<ﵽy$Y!U@݃]U/z}>lH@AI> ;A_uq.;gk5}˨_T~ZTJ)Mn!7|M H!hT\N[ )~~>tڤ 6Nߤ׃shq4#290VӅZ" o.oY>|>Mz ,k[a6SRœ/vi}ᛦp!yrº3:X%N1SIQh9S,+R7GZ2"y%~I^_3L֛ɛ[!4oiɪJs\F>FjdSVWZt3TN(h]="u)!^ g-3"m:,,uvY LP V(7*f~ I+wFIyQVfΠ ^nWFC^cRVt73B 1 !L&$w]Q͒P!_ee60$ dcEm|? t9uw 9;Ä81l1Ɩ]RY2%:sz yks=:֝"zKv[&aP .r8o rk.Ddej?BN&2#$m~#Ί\hq`KDj\#[7=c&gxCG]01>Ayb\E5<*t}X/ lUx)]6>r\akI3|8WM'N&Td];]Q d~{١PԠ͌*p~i6W8~ )ϣ`/[AϞr{ cґ0_j5?AU=.m,tFLEd6߀{oj,۸vtê[6:؄.=-`fD'h\x}x$k.7=U47n܀_iS*-~G66gT|WZUU$#-QUh ʅ h T0N,; 9@7Ks fƈBMwUXyZ 1ʝKYLmLL|V`!hߨ9C1ښw#V۸EU/Be#W>WoB%h\sbL\WȺ08tm"w, g?MoPIY ނVW@W}{ӁhXL ؋"*XGvk k082Pةޔyaв}Q /8PbF*p0p)?GH=81G,]QQpź B>:$7mZ4tUq>:aHBE\Շxy2iO"w})- g|A ] >ؐ}ߩ:FxFzi:,yι "&YGQiS.-iF!tFNzYzaJC"~"P8m qGItA-OHe3Ȁ.QZ="g3< l%Cz1Yӊ0" r'#FDS Ө28CN2]0I `'gчA#/wttyRܛÞ؞h}U3T$t$N$j=^"PDJ%O%Nl/kR@Ctd2OΉ:ڀҢ# uFُcsMѵ F +Yi ^5nSri1b4I ԋLeCؓ6,ז]B-e۵ +@۠ IB14azΕަW>e=64+: MMӺD WeOB )9y`H'7 ؁lFd[dyx` jj ]OХ\n+F ze7[Y@k)a!ZtXRRa\ҨM¤d~ s͓M 2 bH"O+֝)vص sP@AzdFj ; N0`\MW.fe/05H? ȱK#VMD۩ 絢61(Zf낙H&dr `-2rT&Okdظ4%~.۵x^.׀ kBs5B̖-vڭm)Xm+mK7߁3`ʞtSB`{v Bl@uq j5sk +0T:$Xm~?~, YOPܪ(X``{^ۣg-z73wiF~<={rNK^ol3vcoKYn _ omTq!+ƁKn]\iH0~妪;=}we$ $77I94=)32322"222 o4/y@Шi1tEm o͵G jԇ* [ТAx4t#j+fDtG 1P.>Azfhy᳴ fK\J~(_ m@!̍.f|DF̦,!ә"544 ;B̂YI'+XD][f/+ߌE,1)Yݚ_̄JFcrˏx$Xr5t uniͦ`@}y XwIFM bo.Kl~z#U b! J_RO- ٣gv)ý c|fAfv >|FAM2EmRD/N,CHڸ"xJp .< R /{P>o؞ܓV53m-Y^(ByKxQ}Gy=5}O4Wqfr/zNm-$tm:,(":A $k^*.d|;d =d悭u2|o?8GܭsN&$#Qod@0Y@, M_嚋-4sw`LZ~* y~Yy}(/t=񺐯^?P3 VׇnW X䫆:@|^Z1Oݘ `_=ڽ9{%.iϟ`AuL(O9w͌q7.&^㠟iB؅?(# h:ݡfEDU]q #*oPTm&Ѓ 9;d7nF*tՀc %EF1r$ ~ZS`7n%q$" H,>pZز.1c;Ă'7ϚG[i Ee>Q#|I0#Fg6̷hėW~js$RS!-.~}]^[iD Hi6_7kW`'Mzf#6ӗw7Hyo`,)5A7dϏ_mLtlu;?Ex.qA]\R90P l%؝M?DJN0lo'a߶n[yIrNn[ns'dtsDʌx&ذnb*mǿ'W=k  ~E)q3T dwt/;&6@Tg<˫vL1Z޶6kkno?nd , ײ.c\3L1_Ůq:8F8l rfo3W I 0*0>(R׷S(~UnC3P56=pF#eQ G@)B~  ?fVÝQQ!jϠsP4 LNݳ AÙTKyo} |i#?۲3Jx~oP7qmóEw BI`WWjv'ZD EYFr]!9i}y4+"G,q]E=Mf5xldq^{*‰A6&݇pA﬿4eA!X.ǐ 3?`i݇?K&N5{ >u-44DQ=r?r_4 _n"]ԽIx4%BA~ ޡ :g㣭=D"j+}?rطwpVe8KAoxET,}y'+N0(vKx_?^ Z}$|7)I(sv`j˛תJWލIA_*   k}y7 ^ԔxǎCIp%o-+G9`q#<nj ˶YШm \#›ߓ hiu?F'DA}"W1W8 D|f2w/jrF+i.1+ ebS33? G!˚/8"B̕Cn|PZg 򜯭Xg_=cT;:`-F&ʌkX}e8Q[ hx`=|QWOՒGM1{ g%8-y+JB/WKE|lϔEbUwZ`j\o>|5h% yU !'DM[W`Bl~,G=K@~^LO!{~>0_Dv%X[h&' L"װ߮vp]d[(4#(KHO-alX1o@pP'?MFK1[p\VL` .L-@️lqgH\8x^ 韱1D9@^TV̈ymnL;J}/B^+ceqwH QR%j, {` T zB3ZIt>jn$(&`}+T-Xn82 kp^qϜ-,YxԓEvgt̠35jaR4f?k-oM{\0uø6r_D+pNZDjX?|чȌn"6?Lhƫ4Ӵmَ1ε%z|jWĵ‘!*sW-W'E̶yZ֡Wz0\/ɽ9ϟUrrYC&]Q޽I;;zM0 m_YD' S \ SxnqCȼ`LzMlqh9tnjNT7 Fo<=Ma; ]L;GR({ Q.¯/e I2$=D? #/$`S^!8li}vRb3q)`0[I+kQ̵c1I^Es@>ij}r.~] NjI^k(c)xxu$bg?DK{.ၯЙ?X~@Ey0',..AEYȖ4`F$9 P4HsFu;~w{#o^Rz}*yNkLD_,vebOPę(8}4/f(۪HىZ*5miB-VRe}_zJ+Bz;/=#pt}p9 g!褑&(/jE4zrLGP^g7? yϣXٝr:E>iT6\U xd{c+VȀu[w]:_~|e8g5XSD b}&I= sB.XQiT-|Tߢ9n|;_u{.uIkd dY0`MRUuzZz5Ji'j(Y5L,ϗj%B)GR|l#,TAY:[d`6w513:Ii0&&^6QX%m*dѧ*^9;EݙiMEQɕ3S,w D$XܟR}U{(a$^6S86FQ_q!Å$,gTwrQYKς׳03$Q}jј-{ԕ-O%G #1ƫyX'Pd5U;'P5] d<8^gE&0'_yC~o"|FL$!y2V@Qf%\ѷ)<<dz ΗN@^Qs_ Ys>; +h% ,/K>"B`aEdk W[PQb{AL?0\HPh*Զq+Px,hnhӠs㻃' " ^] qx&F??/!/z^gSZm⬻͑ftnN15x,m8* n*i5dbؒoڻDfb / HGWLQ͕JDg9qgeLJ)z #/J ɞ{B-xǤŦ]H8H w5{0P^B%W n$TaqAj`;GvS]_30) [ !^Kdjfv aԫK`} 2lD/{쁯c ء MFXZd7IZB`pv* ڝQޠ{#KNZE1Q="?CBy4J}:\ n2D@a>0VQ{:`7!6)80`{|<;| (@ \ޣ ^.xqҧ[0[#,M8\y˼fԮap0;4γt}4Vk`P*?6΂/[55/./I;t%&@YO~Yz>ꇫayqѨ}G#M)LLB"1[xJE'H$"TZսYuQnBj6$?(\8⿮;jm^u`JܜU9Rצx>SL& '"~Kc4X}08q5@D#@` >NCn#fPэ~k'c0ko=A+ Lt2tL_mYӗ/_oV{[ $\ ]hBnCn)7nÁ..0>u6[ Q(O5Fa+{Urv987=2O~8B1d `vVe:nw"B,j_7UNTm5>qcS{|ơF%IUMC,+!s1x5J5KW)*&:VȞEzkofc0Ğ8|2KB/]s{Ee fϡas@\{'El/e&2Mď( c \nD.)rց PJQ3/znjFVt 5Vx, x fGɁxD́nPQ5ADݿ:Mqނ סi dƝJ.*3_ Ȫ"+o:;5K>T /ȗ/2Ʈa "PkedOoG ޟqlϹC(oK7߰7[b<-z_u!:\Q9 q P`a!.T 9Ϊ mI`d^yG72Gqܩ+/wx\Jrs 7>Ykjr=pL3gƄ‡vmw{<Γmoܲ{XfWأ"kZܞpEW!0>uwadzakx5טnUhh_pqZj,~\19A{Xu.kCDك~8@W}qÃ98]E?={ } -X/Gyj26A=5@--X Ps+J## @Ǧq9;5tsw~\iݟt .%ېܽ˥DmiFҢM?@0evZo8; oo4]`[Mx6fd _?-'&ca^pͮX4jm0o _u1 ߁;DpW?m@Xd/B[` N""a$X5Uڌ0scL^ʸ_q`Icb-p0!Sor[} CZX=.ZOk={ƫ?^C({\k#  ]~}9EGs\&CGԉCFc[H&#L'7%;x%u}Qx6,EYBj 2!UP Aц\&%QEeõ.۪]Z*oJ4.ɯ~eـϑ<~,`tt:})w9t[xP?ey-m; QB~@|]IbA }Ȋ A5G(G:L~~w u&,bgC̵nG>;c*Y 4P`,Mn! !qF.wi:#Ƃ߹]V0} jڪ'>a2$x$XH0U8 P`sW!& *}`|:])jgV&h}xEp5x[?b{Pfci"_V%ZjZ~>ݻbP7h5u<^m`lzJe HЁ*'Qo3d0Z'nA+̫@Es F/Wgn! QȹX9` 71Ѡ4I{0č;32GoGl/XpzJ֖W@CŐCQG~fA67&ZfH/PzC"v-9S׹ni""DEEH K e.E?C'RSlsRa: gwS[RGYc̢c7aIwo v64][ȩg/͎; 9;;Nw³OųUq&U۩ 0* ?~[$}N} Z3skѢGMW͆DV16bW Gv߷E -_[WnS.?U|a( #qާk"AA<j + K;8>kMٙ~ ̾?! p(N Y Ѩqɾ,Q!ondCg!‰u!9#3 7җ'Ԍb[ah?K /eȄ/ Tͻ;"ՈZTUY4-}qd)Y C{Ҩxu2腎r{:glت  'bUwdۇ^lK·{xM/MHZ' nՄ=Б \*k/hgV[ʝUAa~.j s71a*9e.LжgPwׄY9 T} s"8sluhչE֪l5Lx̓P\jҷJycw 9 7]CZousم^ ,7HgS={A&[yO|1~ǡ"+~kX*XozvR/w_;S-tHѭ@'xOhP0 F [@ ~ӯ!\7 fςFw@a|Hg!?BDy`&HL'O0p"i4PW?{@W>ϯ?YGwWizB|J@G}XiK~o¬ukT|ӻ.<ޙϗ}layW0קw'[.o窢)@s$gAӁ 5C܊jԸ=˚?w%~xGQj4XSA3`˟d?<<IQf`1;2>RaU"8>$_ Ec@l8*~oqUPxɳ-+7]ؿaE3 O{! P.f,K>N0= ˱40P K ᙣTah2fHK$#xUQ$MF G2h4od3X*X8ÏQj~Sxk!ꏢ2b+/kߨǍV@ï\sD!`sB%LRf0ql*@" Bitߪt%A9к94tOQŜmB5 `-mXqVdqmٰ@t):Jf9V=|XCEզۧۀd zvQ@a{7j<ط`BF hb::ܜ~`Ht4d-0. BlUـlhdg]pW Y1D%t|DxcV1 DMYAS](-qWP~r˲I+9㤳ET_0K2Wto6T+`BѤ*8!|+[- ){Ylm@F38+fߞLKva `H_[韷Be2;I R'-2N~%"/DAo Xސ{ ń9Ow"#.I~CvqqǸ|*jˇ at4Bf2;K+#J+$=-^j=;䙢 ,7lOnG+@T$P6Qkc!w3[U@M F36f ,lOˆg?8A hy:̽(`&k3# |-6O>՛<0nL1Qڍ-& lc xaA47Cc7[l("$| l+n쁒3wV%9/P1aZ1Pt\:|u?z<{8y^~]?shDawQ; \RwO3@'"Hw韔T0֑/nSQ ó7KpybWGZצqҞ_~/-gvq SUѪ =pw@;"Xw07:ތaa@I XVWI{$QD|K><*>_nmYz߽ԸaRϿJ0a- nEf>2րP;! c͌sa)ޞXab8DWc/yd !(kmG9a_,(,[N`}CsX|?3vQrzѲ@6%d$SqI."#⟹u!GS9{"h1xZyYA`LFSwA>GS9qh$rmcl~khDMƝeCJ+%(5]ԝbk {ԧkGH|"p{e2FRnKA Drcfiy4LнM< gUs-J^ؗ({N]!EwȠ.x%JkB^`Ȇ=i9uA2M$F_c[ #\C!´klT -v*5; X/~byŐ@cɸ"`t5aR~Ol6Ƥ.87kH>Ql݆X)6B ,ArFl̥MnۏN u^/(Ga/ou ,Xچ2&5̀R nO)'[4@H?y6.亍usB^=}z2`sQ&xŧ~f*4cU_L.%59ݘx?@&}q-NWX]Ls{+‡GNJXA(.{cpM׭^`|#xP,&t2jYtpkjpL -C[/->/4{/%ԦmZ<}8E]:v?2?vHQ4ݔJ#ЖDP~SN`&[h$Ќ)KΖp7Qm<+ЌÇp9<88888883[fwI7=˸'sN9ȻsƼK9'лs>K9׻sK9'߻|RQʛ t6zDo"7QM&r~u؝?-S:C"z h3BnjӔӤӄӸӘӨӈ0OoĤ^]\X*¹w!Bʤn(L2n(L$^/jxmR@7o)z{=-2_OӰ%= ztV4v`l" 9aFw|q DH3yF.9, v~AO&H0 ʋ&:qv_q{0r/ppLjQCrҐ<4$! )g5S]7 ‚9̅M,Zp̥{%=*:)f;( N<&O1U* d$nu1ELUF}Gs*9 2b ҫ4fg8cp1`IWĤYL r*2ŴNE h:FRN>"U(s✘zěC0a:C1X {Zɭͽm1}$M5t?ߡϲ{qmuLP2 |k?F.3M @eB&S UQ-с%;\2HzÕ|3tFd3XF42MG5?.Wc&,{nvX^*^Cy.a.mBI{e4S}wnNwIhяny]a&pi:*HZn2)1j$^z'%*wYl\}_QrɬwDwɶ q`<&LNSCqKr%|4o\*3Y(/|I\ƪbx'M%6\]UY3< &-!Q* 5߮eRFZxX8kK! ̾Z&Gzkp*`+̸:[rr?(DNץv1<ܼSS:v:8e-؎cWo.j(յpvŅ,.rLBSH6t,Z .<z+\䢋f4TG-Lwr=(ڍV]FͦQ^cqfSDއG)WoCpnBb$,A nέpkiij3dvg*_ZHP U;{=Lj&>Ea^D.̦"N*Xp\1-6pcر2biQoJVnd\R.viuqBV%~WR?ǻ}#YIlOKr6:$Va(%fSS)[*|BV5znKIapig,>`åo#f91RŤH(U7VJ8XJs3XoNoRy(}irVR6s6r3e2`{<.v8\:\DtЦD.t5JߵTFבn."l~å~W&ܠtfqE/X&9n>378ml!e*[N~)h|L ӓ <,j Z+:fvڂӅ4H3qW~EGdbE5ru=q(1[9a L{vl)%[nU/`z=c3WGA2>5AqlBEL95id'K -HP3Ӫ%{d."ux_n.م9 kEѥ|b[&1~ҙ,n3rR( J9UqZkЋwZf14 p[E#<vhXAh׫ƴ^O2Lkcu6*2{~\6JXY(+#®h_ڍ=8'9rA~5)f}WrtnlnnܨΤ#Y>$d#Xse5VT"MyX/`l3cE]Lⶒ:/E9[<؈4* \]/u6^CuN]v(F%141rP.#eg{R;fXXJhcO+d&Tv:jj(6!dyḥCNƴ^ɈLc8WBR8a!0~d<cnl\fMΕu9HgPc;}|Is8iD Z&*mQt`Vrjl7ϑ}hӃZׇnoVf-˙nV`c6LɗvY.#ϫyV+9 q:eT(g[Yף0Y_{Dzr\-tz8baq(yNn[HCdfbjܧҳaRzel U2p Źdf[RtێG!06 t;T<[f\ne"e.zo6XJ^:d-srj)P%dњkhk[U-tkM<_?ΐUZQ-,۝.D|NX ~<6f Dq׈T謞fڠ8qb\'9P.zw[ 1ǮZnGR!;g|Q8%-`՞XFݶ&9M s%&"9Qوu(wqgXfPsޕR_VS*PN\jRqSLWya>uhWn\bbͷʳY7;mo7 kLVcӇSfٞ7n_Bl2NHK:ry\H8Vm]8Lp"2Á\t;NtM.sǃ`͵cԨtj˄e0?6;_$t+@ŝZm>[uykXLvP7]U.LԫrZ3칑%q8kz;3+~cz)sv7.:,CL2T[{t,('NIW8@7Bz-yޞRy._+J\KRӻn^kmR>%&tקkF`Mgyq 2_ Zb=6t4\e8S FyvTMpn^2>?B9*CJyHы0hD燱RRSvZ鏓Gzh?gJHy].p|k%zZ޴hҞc>gr>LN;;`>lYMzȆr- ղ" ON 284U;I7ro:)j6JJ˙}# k\Pr:[k&=Hã(Æ,ʣZII˖iA6jt*H%=vphT`*4 ؞J4btRfAa\.:7#Ǧ҈"3?$PugÑ_wK U.@Wg;9 mZ7 5'"Jp<ęΓpJ'åGv"Be*ޟ\/O.aVsbD(.np, 2}MBVy/0BsNxQ^h{hrThN iMcFUcXÆČ'%1K3R}+|:h)tgaB^.qo}ZFb8X GsX~wr5F9Ɩ<E&jyZM/zQ썽I|-RA$ IQ*{OڳP,%*ҌʝvZm VE׸4B!Y<6# P2h3Zel&ljEFd(5FzQcGbʮW_ w.Q%Y\*mz<4Ӏr8^cˍjnK84]:y)vJ<ۻ}EnLï1r5S+UύĴzYJJ3Q+W˩β=Iq~ M_,tCQSF6\U;jFc ȯ`簾0Rz:/gzv=(j2[v+32`.ё5D{堔؆{ 4pQkLƤKivź8);$'*/Jlj>^ asA;Zt!dw⃻\ kbTN^`zV=8c󾞚͝28'#19a|(N;m}RK'=zz l1F9_;`iXm`u?3K>4(^]yWm>ۤLvj[EbQ&0-Jq'.,7¢=1&J,Zm.VhRӍv7iE3loM‡]eD vJL]oKK[ aGmL6h؜\"4f@6pǞh@;lܼUc#}` e@0hLYVF[5(f@Τ==b%dUz_H@_C݂()@4} j(ҵ~(vN.dU[1,C[AֲJdsiQq$rپRe)Yȏ8.j=sLwu_l,Vq=.oSq;l9.i6A6m_&N r>VP'.)AK jdw '}zaRKv42)G,OsV-[*>El+MX$Mr|bUB4<9o8)XWl#~K&<[4-6+y${z,K+9 46/*dbk$IMU.9Od0hn#3evV|엫~}TS4/sxUQIeN6'dzQuLn^iⳉ0ldJJ0Wj}9,6 e&wd9߯1y*Z.#L%=2,C|jk]Y,ӗʤsP; *`_ ȼVp'J}n'Lc|!wZb_ĮNl4*MRlUM099]t^FZb6ز1X:JI;kF23~d77 sU1UIڳh@z )ms^f^;Ϋx%Zt _1DREe~t~9Ҁr|[]tE6L5_ftшv5o#]p.X-JhYڗ_A] T:*d`UYçӊ@|R-<;." θoFv&2(+QdI-R~2jku$sb)6KIV2.*od\:_l0g,?G& x$MeOq_ )pnxQ u]>e+;}w8DFa(vu/.YyS$ϗdu˱lõ;yX.srZH@wz&ft>5MVM)qX6¸.R|wlzZk~8=J[0JD8˛ExӸG쥝h&8 ,BjP˕Ֆ@2ukBw 4،v8,1jȞ%!@dI,Lv~طוld sΆm"#HRp72ηܦ $|.F*@\BLΧ`?(5|ЫR_N%y& ,(fLnDDG=T,zxWYnKjX6C W ?v|3t# N®UdGe8WCt|Xiy/ ژ,7[%)%ήj% P֭cB)58=R^LRmU:w`e% Ydؖ?n.j-_\Dqa\K{62&|q-k~6Zbrk}a\bb:`RS}JߤcHvbE4YYmTk17ShPvB;mdnv$78/A=hk"]"?[[0ݟes jh^|~,b&.DD5Kc#.u{2^.8[Oӽh(miO.)~gQy;G2~:~liVma(rFEMsùlYmcM莞JFDa*%2)AZ z\ =pf-W+`/4wsVMsZl ƆOA~,dm'1j{TIț#%.D4/f&3H{7HkuQ"(Q*N5B ,gtզViuu1yup/'ً^􂂙9o0˓'pe#%yWnsZFUJo՗m2&9 у\v`ÿKT&gbM QnAOpU>̮B#QcD<{6"/," 5=vQ?-m4dE]U/Mz5Vh"{@FaD]TVCgʱ7m!@c'Z{ߏ:l&P4P_$ο>4(JY1BVm+c+Һc&zQO2Oۄ8cIDO#V<*oiS,NÙ<G`fnnust.%*4⭖.sA`:Ro 4gwloxCgM;a!סAe H!{<\(IO ͊ΘU*yq?&Or=[b62n4,>A*oShJKzh$gӓ?L;1}dG޲~T}le.m'8;%sos3Nh&U&9TV*]+{ʦdlzhYTLX3,O9*g$g ꘔY.".?@~Ϯj-b|~ȷܫOe+Qn- 1]>9"g)@zc+Jƻ-l*%k#2 どѠnl}@Յ>gd\JE`\]"nC^$rlk] uد2|G/WFb"j]GbJ+(  m t! Bt+[ = p0sP4>˺eӅH pEXhu=V [3&qn{p;fhߐfgD,C":8Kb^M'}?Qz]̔qz*:e/7ڬFӎQB&gw֓ƨ>%i9G)T_S>#,gv~ľ3&xs 1L+~N o=eiד&>qH³-XIcvͥAzTG3d׍|0m )]}W7RX&Qv tMǭ]HDw,.q8.Hk6B&i[k):{^;ћ֛I2~d$Dr. ,cXykn]L[wRR+,2>6%>n=4I#ulJcC~z.#{YϹwU.e ס24}2w KPNf #r_Щeq i*aj;.^6Og\<_Z*nÏ_dU2(q1-FԷ' ɀszғ)`[ _w[5>㕭0Xu[k P]J8Wj1PQx̅\,FHK q|0@]3gYrshw>Y*o02^;W<D7Txme/!`Nן!>v~#1X+ GPIdhJRo2i"Gٵ߀x ĸë,^>I1ćj3~e1)0 EDz6? f]ßyÝ)v+Xj~4F&CU*?f3@Z)2u\s@#6"D׮YX(q&u8{uY5LeVZ0ే"QBHQ]5J~2y̢ID;A09BגZ{Yn~tX{eru9D^Lle(a ٭IH}3'ݦ*ߠ_aRcioY|'DzV0{VE@>jhRkwəlFD:T(P_e` `KZ̧Sn$a>?5`k<w RV1:;{~Ȧ-fzo(chhH O;k33[\aIk܉fqڌ8Wt XAȧ+>.U\RAD΍5#MI!].S}wmD_G p/GVMVQ4}uM-OB=I侰/b#!PNzdn9̞5[L P|2=) k |l1qlf&N+o_Z$kP9T>}[9/œs6R!: VOM[SzTެn)d$)dygmRqEAh/=d2TL8t|V"#45c9"_ WX$)v GϔSwIyDL| P>Mqƻ}45\yV!/,a2A#=gA۫w}TvU0N+^_ < \{ރpv_EDfO*' GwkDa2f ;ș5^V_|˷3e)|׹Gsly}|1`A$󨢈"=p@ԭ[` M>hpإ}i*/T3t>1$>c`+Uq &k/)OGC{V,bC 9~v%cv&).L&^ˮtEdLtq偗]i^4@ 1viddEg-.! iҩca ]TP!c5Ml6Br~tNp$کTWY?bCO+:5e~!2޼N)`zU"T"={=ezF)0%LNT=+Dfץl=zh~I E|M\2!Dsl,M OܖgYߌ-V(?Z5MPP[M kͶ*RFOiL%;+UZ&M4-F ]t_\=}a͟N60bX˄Ys2>,i.E_fަ/ѳM.Z ϾzEȭY^N4VwW(F/ɛ#A9},BsG? bl6Rmݡ4l*gU5QYO1!y5:ٝSQ/?dS^S1E&_aFذ۩DC?f$6*ՃWڮL٬&juJ>dAFGϠ1S'y֛ egvlxC.PSuL^d;>lЄ Џņ,N!uTu(Oe ' t&OLrdl qn)b|&ݛe)'&܌XFlp ;2 YVoNޘPynb}$:U]"2-?J )>6p00&NF /L7}kɁNO,lB[-F2xa~]ؠ)O'w>K&>y"]5S.kl7"=݋, 酜Wb-j}Op&?ܳNrM:!o_^tT[̰@Iw V<$@c8zx_zŐbAF*wCS "&8)9C\v/yY:CaŒY;aUq]C҈(j ݟ4AI`@><Ap7~^8nqLS>jjgu3DZ|W/Ғ>r,wn9ڪ?UB[* CqzBEpJբN ~B1eQ8Ho'ǝVC 1J(?#I|+.,@ܽRape[y9b.^*rS\Sa#Rm_ Ix2u`R/1X*|W~ 5D*)tXl|h'H1r6G~W~D0X 37si)+ *ǿM=: 2>KI* Zӫ1ɏ$o3\Bqazo2*lmh @9I\3si {ejSZBAO!\n>niۏ+Ej<Id\x\2Zԕ\? Pgoqo4cn+bŤdik/vm9XgKA>Z>FS[*6)P;P&jYWѽ~a\T컅GzX^ܑB  "o;s;Hz/8ϟ1X:n"GÐ:)~,0gTprMhk~ O}kI\/b.{E,U `IHR +'5u|yX` {XZ#2,^nTcf56KW钍\j%_IfkAWn˯Ctjb<=Z75;帣O#E}9uOvN:K-D8A lO_]:8D[\|2*:F]>lE[$;MPpמ[іѝWmu!Mȟmvnj#0aRK bj =?s^~9(QVTL+Fgy(=5'#+SWqW晫A?膝gBk #ֽ*֖Eoզ@V<^3W_l IĮW!ZZ"c{]0>6Z!&9B`pOPt1)P_;*4 ~%^{YNi<M,P|B:7cc|t4l+#+rʬ9z%j^N^-(1'}KeݰmDkEB:,.An]zt4H#{Fm ^xWDz_` kO'/Mc9 o fGxH0>05MM?$g) ѣ^c/&o\; _ j] {V=)o _WLrTv21uTJ/+3֋;Ê؃R 7} s|=Rmk8cקa*j0Q2>}251 ԫkO&ߪ7Æ `T)iκI]8|Gq ֐9! 2\TL:B}ޒb3Qߟ5pUC†C1r].gD(SB6z+2M - h*Ly4 ݼ8/ 3Dr*VFS٪jťbyFst#fhLgy ^mFu>XK]6!J^Mp_Z.} Ge&mkPefZIpd* ×z㫆sPK$hBqܕo1PPBB K~r!ݗC"úLU(>BˠmuU8 ;>o +Gp]{ĨMDB/~CBV TNw\g*#\A%}ue2u٬8|j`Gy>>6C/wbwr/2P= ͺV ^VWRG0*T lWML{:d{SndwÃWFCM==uR7A~5i>kއ5Kq+_]Eϛyyclhk1̚JAxxK?5Pi& -ھe H:iUVt7sfθ,"8Y¼2SA$bU{Gѻ2H/[ww4xQyITuHeB7E)  ])iG_*& x|Y̒OB~n|O@(COWWeW[&_w-Е7j \߷sJc's;uOph á_ɉI]sA8lGf<ح81n_gܥ%!bWlʴϧu١UfD kK'(m:!ZNJj%EhV 8-׆Cļ&GgEE* HVK~eq0C}ԫ4udG$0qAL]T2볉SL':~ j>$: C L +Yأ o~wR\)`}9u1Om!nn &+ySyi_f> ܲ)A%~j2,_QͪR((|HXUv'*'`aX[d*MA+QIօ]ؿNis  ** m4@J>,(MZͺD򜒂<?1xs\R2ÿs|o ]kByؿE^22#1by-f6%$̂Ouh/2"wl uEw}!:h 4 Ql|3x \g({w㟖QC8Pqy]oP퐮VYC36(@Ǻ #nմ!d>cA-MyE]9xÇDn 2q<K):7.S{^:P25RCh·1ωj4h\6E7s.tu[!LqJqq"Ϸr行6-@4Zoqk7fe2a!(8yۏS3cYc91M8zyj3 .CTv+| ,/sHI`FL;*,|}4Zgfj563=_CH5=|Zԛ KYG)㊕= ʾ/+nfqz2=y |_u/23}GGG5*-N-W{źWH BÝ%l5KU R-e OѽXߕeY7^"t?Muk)WԫF` O4b% h{fm|8I8vhP[c B0Xh_Ey+H!4dP~66^:TY2*$u(?2YWÝ% <y@Zq.:VD0gEZDc=' [nb\Zo,l Si|2}qb_s{v8Id!SǔZxxGOϧ﬙ Jk=JxO59Ty("^66Uצ@nLd/QGԟΝ@8|RIܰ. K]{l|@63jE(;lVH}wq')]MZzIySv/9}ӃJW_s@J%K&h._SoC3vF?-xHDc8c{˿Rmgo "AQ7MX!Ù]Jtl5}d6}Vb19Fǖx uh8`nߍW`I'? AK?,A竻iiao~̬"3Be2ŗƺ4E'$˜mrmँ*Eq$b<sϞ}E5MÇSZE,{IlGXou Xm!HMPf[ "tfC~:m bεFNs~_rT|kV63ݩi]_cJn3`Pr oҠZ,ڎҀ\G,خv k- 4,T!mzg^Q6 q` :qT}]4~xFpēP|2 k&p1(1J;Sr&o=I\zE&LE͌M8\=oJfiڦ* ;i 뒴* aU ^ПRՃ^WŌP|mтt}W^r4Z4J>*7pO:,U ]CqGsV~Lq~ f=É9;b.`aɾWY@M/CrW{ROT V`8MIAfKA!s&NBb1s 9mj܇;nPY>E[zi-9W=$Drq\>1.SZ"Mr#xwnDueqWSҔ5+l͕:qSE?Զjv]R:OJ^KL+Ur[wmL"VBZElMsWe֟]dd~)XMe'XdcDdwpxE B0Y`~ʖPO⨯)'CVH/FGg*UKFeBQ~6?R`gUV0I'1'S %Hjt9YJ-\f`K4 i7̙.xϧ-Wk1WNA/$0אv{ ҸQhQMsPs2D}\ؙrz/G3"@XCy4۷Q,H鯞ո`旀9o@Meb"k~au|B{ Y+a26mli4tK9 B\GӧS= Եǽ Vٲb*gք᝷ >|65?}on\5G< Äd /t.ԭw!@}5טLbMQ}ZDT{PI.Tm[/0C TDw"J׾#M*skGyjf{sGjpdkz1v\|\e'bB\K^9n?>F޺jakiAGj x[@݆D]\4awbzO '1.w|m봆 3@jd\ z\iQ°EPdEtx2=g5pϐr9"BVV A?lGܕLMF3{uCz~}211*LsqƎl )4;C ކbcob羈܍?$Ge]ǣN_Oe&/Zv$I :[{$PKE.+q}nl+ɒϯS%ϺH?"ٜ8T-^Y _S/'Q] @I&PSle(^QI7 Qp |ph)Ll~u a!,8;ϟ$4wWr?aEK.u؏ b[6ULh!XBkb;3z{@S;89CHojNH2 J<#Xo _Lf'_Usu [z(cnCK6%AgMݶ-?0>L=:wţ+1;X7{-J17>*x5 $$bhWyPx;՟D(&WaجOK6a%k^D|dH!9qvWh/i;vmponEiv}VOKŻ5uJ8-kގFUmdЋStн>R$yJ ^(,s"z wz+9;3jK>F",ߟc3:>ϡi:{ϔ9r_. QjC1jIwxtY/%f(u1a?ftm)[Q.GT7J+'[W?m)Ki}3A3f9͟bm,c& A&[T];,EaۑaZGν {ʰ YQrjtꊶǒb{ 2+ -@ ;ґ?y2O2o6Qaߺڌt 3ц/I5cm1pB@OηtV8IwD<TbRѶKZ Ο,ʞc f:>vPh^B2C{Ӷ}| $x\m=|h(_RALp<-*8Wh.xČ^[mͳcaw]g;:kӘ$$KK?^S%&N"4ܒ8M%εqtE87âa^=xk0퟾09U_DGAi6e}TGFt] Wv\y_pک}/,8Hx{$5*X.+P qRk@ t;S2)Ƶ5zPHL;i+d}jҶ~J@˰;7$ȲUnME*WFV)ֶ[3 YohVا0a(07VÞܰ(C/%?le;Z0viCdR(8oB Q8 GN60*J)bbE>4EљAhy Jڧ%j`v˞ cSي((-&> n@?V2tZ] zZH_L0RY gkʮ5Xᙓ8.<$]7-I٭7 XAldk`ExUwLհ28']̰ \0T~%1uA-pG&*,|xqK?%ϝI9&5>y2(dG;&oQLN+41(k P6!mw!5h7tf> p!F(n[&`7BۅB!=݀gb ;^ ˩Df8*T9 x eSn҇\]hk˃zEl(}śabd1\rh@)zA3;),ok'MsɻB?1:xd'Uy&^OB v~jfpˋ[@8*'U+zAVO'eXgO6cOj 7k )Phv_l Ɏb_l2n4bVABw|D֚6hb'f |Iهk*]  $_g^?(B Ϩ̘!c\iH#HK0Td"R> >fzH֘ d {<4J]mYD}G-_YU4I& ;h^ʼ5Ys,2ۃ疲~/o,COn886MH.pksVpf)KL?I)U}^fVwAH9"n'XBR je>HW Q.N=see֙ͷqj_$7R)N)T/Hu@YI]iC\޳Q m*%gW 38/^/@DJ[)Kvn.f>cNQz{["'!wb%]7vIIVr=ٌVo`agUfmGFXv!"n=Jjz{Ju {WY(5U<3jFU izh͹pݐhWl|d:XF!R _YXq  +|a<[ΐ;K`9GNZč8 ݦb+AS k1M|ZuӤ;Zq*ϱP3{^|(ztm1W7:o:#f}xK}BqԚϊBvr(m o`;|դɓt)2ۅ'dV}(PտsanJDϟŒR7_7e"X#87*0Ic&PO7vҢӉp0@RP(99(R3d*?t DUƎ͗52Sl׆Gvlr;G  (Vt)=]*W`WoE/Dw'S!? R VlU`.^(\Z 0CTǧnǴ$zڨ;`_ILqqM/)+ua3ٕ37O0,Da;LO鰒V*aoY~s}ˡD#àݺAtATE:btdIbX8-2]J nIG ?Oꙛ֭VKeFGW5A[A BB f3 74*.rԛ@u.h%̅PDUC&8b>"s$"{38k-IN<(0UAF]LF@2 iW 61iF[ @9xFx]I`Bx9x eॶL"2Y^kљ3KM`> u'i+A %Y#T 5sHc溍v>\j&[zy*t%TO.z*NSڳCF-7l{>6>NcXxҴݸggj<&8g$&;Z"8mAbH9WŃ[ٰƪ*7' s;Yžj]\CU(LTبڍ+iʼ9[ ~R.C{Xt AŸbQ9[$>Y9݃Ct6`Qdnn_0="/L&ۧ+^Yj狖 GHfҚjM@jWѫԷ DPvCYa|l{KwJu0ǺEEd%zQX1F3xb.2D#-bI{=nb5tH@MV}/ud:5ro($ 6q$x[Vd&V412cRF<7.7ſfLNbhf7ҾFjzqcG:952N[v)0<$ &P4DZ4gr0N) pmcPc?(m|MZЩC*lDKq ]h)H GJ`kpS *ן;[]3wAּ; Ts&|]E VCcu"u#!3ھuO 빇x)5aT> / |3-yy(j ! (ݬbvD@ܛ"oo%,-9%u&ic{b {1/>vHy~,~~\7,וam]4Xw4/%h%*9}{=S&ku䴿j7&,Cr.uSph} `.PP"$N3qneӇJ켼2QɍG󁹞Alz2젤41 NɛDO#C`@n-@6SB!ȅcSR7"0NZ7Bl[wËM O9y9;"GBz^z{(y.zciT!9H]H%۶YqdoC Y{[B C{ |fS_lqykp<_ c 7;#aZ"1tcmfHozp,+)P|ҺĄ i Oa3ȽEmhsT1NPKYZwM*.Žotn&A2AlEl$S ^wK3w,4tݰ3."d`OlnM(06-n>LN,(ҡ|? ZN},;WSRqX 6åleȵ[]MGxrN B'g[2e.K4MJS g]jcr94#$#Ewż,KXP)n[+=r)-Jmw/NY]p^t-&y`V2 G+|W `d;4nV 9fq'~leu1Ϝ*t~=c A46!y{ڛwJXX;2ΗZDq\/-><^[y>dڿI$ˇ~R4=u5ꞷB$n#ĞfFcfqui ʓ;Zt PїJ,me )biz `֔N٢ nrx3w^jvZ>]:o<7h޴#cx+lrxT@lB {]O4NM58x4O% 3NQI}0>Cיpщ>=8e$yKl|GJCʰ}YeŒk1T4}{R9tCLt,F{+& CNjAw|2:⍑H\KpswuM^ Q6\7N fNE^rS~f9 >Ld^'q+jp{P{13{g';& Z#9,ֆ7g ׯRtVuaJ-ltk;Lg,Mjd51>vm]᡼8y[r^ᑃ+ztټF~ɵY7@kh_6(4ݮ>a J<jfl\nx,&d/җW:p~ '!nOo!ϡ쁁G>et p[wML4ql.pu 5Ȑ|ZpO\|̡qHRoWzoORF miG>WwLfu`NBj橧i9U+o($D`Oq6^1ljuE@LXG{Meŷ^ Rd2U"y N!շ~`@9۩GO\^ 6XA *`uXnamk.Hj'կ#9WkU @OʼVFuo W4~]:ئ?Ny+ ~f6^z5OIqA"?^/cjw*U;L<9 t+ݗy6`r>@p쩆;s8/t"[VK(}ռ6V߾R^0<%J,0~tKw9BKH%*2S& WCK% t>n61dO'efDr|{!Fck~}k3D:l Uq~ GTh%,qEًLc-;VI/NrTec?B}{ bne Cеˢ(B|.W"O tti0zcX"_(^ƬX H#)1:(~F횭/ r-H[&݋ulQJto3CdSX$yYZ#_j҉ڒ9bH%jeLJƣ{7Sczl bgEc/DA#Ux <QV[l0PmU|G3?4ļA*7u1?fC(oU8^S f@nO3+reBΌ<hmPBu|m8Т< /~ еߺShQ#MJ-֣j|bqdf!~~yݒ/!Bَ~ೢR@xf!>whUg>?F/TVTd4gA6?b\m( LA(̿ *!-֕oIRuR3uZ3P)1T8w V|-p;?fX(+tt߆69yD8t4yR[e'؁NW(yﰧDHj0a.kbS n|n%aY=JYߞzi{!%"mLԗ?vzE(gF,CO^PfV%Dx& ew>ShXVCS_Ds.XfHs*WPXï.> lg i.K HG󎆽=[D,˺AJB7'ڠndѦk칪 Z5nв;5ڜ8sjКk,$k l7vфY[3-!nΧ6ݑޮ8݌K?Ʌ\nHe90ɴX9Ci;ݗVڞ}Ii'.9,vw8B kiDy]L\h#Rw;C04ybrhjAT ޿~HtQ!rA4Y-JCBa{t[l{˴/jHLqIzA1XՂ܃ܟtPOAAO_~ۻa[5 xoF M7"%4Z[d>"sXx]C~Eﻯuxs(CՇ M 2^sYf$uUSŲ"$ۺ Ke;ͧ&O-ˏQN*>+8?nb VP%Mk6rQE&>a4*pICooS Z 36XTv_s Nyw(o#b:uƑmRW:Q1SPݭ65Bfsk{ߠo:{|+?1^B|eYل=;9e5ά:7aS].4:|٭_p=lF/B,{?֔>}u^fep"|~Шӥ^l?5!PSkiIG ;_ Kl,}a?.)4*X Hd:vq%Z3*sQ<{W5ͯ3O&=Kz7eo|Jտz_74ώGpjR_.Uu[,<@gܺ8'9o3_{5&fk^I,\L,| ^Hi2t&]xc v1B)[UCvr ?Onmw۵pރ/=hmj.ԙI3 VB ΁}_3;:! B'M#2{kIH$M#:Cc[ܺ#d&nJ̯qNo3P A[f<)lSӢ<{0R+T߬zOB]Y0&B"ڢyO7a׷oyK?uޏ&'CPصYTWZb)? 3x: xSd=VjrU ddzo?3b J?,-U;%_h2Z=c>q;Z,YɁDzvR}!BY^"r@罕 :,a^+3> ?k{^25UK[)B|wlEDs 66ufi#+AcElb 3RU[3Կ5t-/.G3xy LNb=&2'0B~uvp% jDzsvpuϜL(8Wn[eABwꙎ< XJ4~ o r1y(KF|;"s"d%Duq[ hk^//QT+#+LZ9)<2Evo( wKLdcc-S>W>c%Wb:Eb.x.D]CH﵇:0Z8YZڠu<2NzH5!ECc_ \Ay6owuZw<%?ݿ{{r|G$nRɢMl/#t6fClp~R|7胀M *JݹBU#|GoaT.-]Iɋ*>Iq_6MߟpuW#TXޢLQ@_͑R2` qW!d~|wL~9zKS:P ^IS By^gg8F+u`^nOdef?{2OgLwBpA}qoW)8v#3m-].2B4HJS/IKQB=-gt6 7jyPzpbSU3Ѱ6"16U)|. ү[Ň*()brBm5博j "l"]F\fI㪚:&w'C7{j.\߻s(ʍÅm]w!:wG.|}k5iB|x BAvk %) ]II >\ʹ4@Y3+/u&'-֙lf ^*fG!>kK&==!u% azoM,( cSP20'a\==uwwj#%m#de 5Ku讴Āo6C\k<Q$u)Y0ѩ@u{T{nCnA{$ YTDo.#rӵf# knO= 6B ˔}z[m۬<_P:Is=ڰaʨӛGl5`p+\/fx.nk7:o+[v7> BjV;*keul^v Y0INuWdϳS9KrJC-hWGEqMCݻ%@JBH[u)-ct3cZ|{~yήb*fG:c rD @i&n# l oszJ G qc-pm`{T/ E((oVޜ@<,$7N>m9$2<"q4uF0W,"|`]|U~ oPn^Z@\!%,D"~hj\xczqb5 Z쯳{G#F\":oSS}/fZ:G{]zP4?q=l7'#&g.-)wmĥy}t>:ԕKUtk}JRXk42 tL-0DRcaatry2v5h$2"}`w7KxD.3 uZa݊8=#ɢx̲6 67| օ{;<~ @ݽ֚-"####"##"cMC AxB7㇗j-R'T 1BA|3EԈι0g&j:_;IV3 j\:fy0%Eq\|Mεf1sTm|xS{96cF d8JWaJOR}iN4q^mkn0]7&~ёS[j>7C,̞В}hˋlU??]<r\IdgprqW9V3L1ΕT1A2/ }-6nuWϷ>6(H.gdZ熉F̗M%5߫?>uN,u o|?<.>)$a~LiVoֳh4;ch{I|7#sٸ6-u\b5Rvi_^'eW;W{<1"h$>vwU2u.\wj#ZU%}lk}߭7_Gt񱭘,T=5-_7xǧͷ7u}?0yv>)(+k$?IK?ߢ=M/^oէA݂m},:ZAhMOb%{-JL? Y7ܝ.*Ar~mb׽>wo%/s^ s3%v} ezy|=ojJO=b*>|%F]eVDzCd*\(}AqF9Q({8@M!wFYR3ƃsE[o`z.rrԊ*"9zOW׍DM5ʴs8 NQFchݽu<|;w׽tXx*_Ҥ.t_O jt çB*{z̰^8%YqӼJZ.wz~#)?+[=ʏĩy2]u_ؗШX,|n:60sZ{Uy'^\ =o*%ɥ h$onAZ:WץU FBByr6,}Rj5q0O^귽caںJߚr nnڅ|l3Iq7Ōbܞtt5G-{C2=9b3b㤙Lb\tS9$.R>:v}$p3]Or93yEĻ(uu _N5{vOSs14{1O^|;hǍ9~z2&9Nڋy;CL9<{<Cռɴj=3;7KAϵWrM.;mM&r}>:Ggl-5i>e|{ldKԔv$bZ̮Q+ q>ɭ|lYX뷞^Ij[?xUŨeN5ӝ+1fkmeHvJޣp|qg-tifju2^x?lA+Te{ǫVq9ϗ.M5TX=. Кg_[||OyyoT554ç2~(Of5ފ7쭑f"/JLng:ht޹q4+E3~۽W =Q s4f|<-^scCշ%5=夞*4# m#7WIi)Çz36'"V|ިXgf\_Z*]эpj6+YKƬP9.ޏT&4 h,7g|X'lY΄YVJȯkU3ӫ;,]${4ڳBMu8u3YutS鵅;ݽ{d]o^sl0K͛Mpvhmv<1I' x= ZZckP;*/+Jcʒ}:M^Je{HU%y=I mf{C|yw=V%6\/S36?+k, Z5DB)ob+i;|MRѨ49U'B2ΤSm(wFWɶ֋w%[Nkz26<+rmw@{0352,%sͦ˦VTF/|&~KiZi%ϭl 3i*3C4xju#R\3s8>.n:ʙ_Ж<}{uIy*޻9ai~]o,L/#oޔy/+\_?LٮҢHH4=\X|P8{}r})MCf# [пƏj^C[wyXk8*fOoͧMMmz|@qȫx6&a|t7S˻Jl{\c VUBЍg_ VW軸?d}rO;Þѥ7Le3.OgO)j:-vUM~l!\$2) o@Y2Dܦ` ,~.鑱(lc o[J;qtԑy]ߒ@m -<`7r01c125~$yؒJA,vw7^J ;[}]S@bɎ'Ʒyw1s!qy?MoQb|ߏ!mz QDn5o˄8W"tptO񽪛} Cto^w0Lދ+٫{u/z]_^/ y{YWOGAۧPߤ}߫ 濰~*7e*"%tءYkS,! UϾ Q3n*CT_a# 5OBc_}j=vݧۢ}ه 긝`V[m^.|Em~\74cS/7D]wbv=0zQrݎwة%s[+8!dO]wGS,1.\A3s뛰R׎zo[ok|(^z,z]swfz}3Eg=k.[?L-aUBY;t 4TXBcsG5}aj0kv9Lc]cPw!EQ纼 "뮦/d?q_ *A^}_Rx#HԖd.;/HR"(sD$اR%ۚ>׏t3dƯ1Ԉ,vmh#}"hO}Fۭ]=<: "N0hc sJGy0騲E$JI2!T{(p:!#ҵқGpm3 D!ڢQ5H!EUDW',4Bh[QSJETd A?󪢫Hapy$NaTE: )=IqOF֓œDH"8`?7 ]5|~3p1S;jjgj"!$J?`U Q>& \OØUd'N4J mM6`Fa7% XOpgD12O,>\Z<;YҔNA 3UjP#QxpT'<+zcd9#9*]ޔ . eD?9K /FNs7Of4(DN?p)e ,~٘lwe7q`SW!eWi4V5Շ3b'7 sa'< [l_s5, -p-O{騣|a=־Gl:0s ㍹|NnmƣY]CO @'ܒ׶&t̓(",1`i7<(&, Y0QqQtx 0^Og5s}h3۲~t=fE j쳍ӎ_"-j /֗ɒ-5dsGG !Tfx0/GxY)o X;#`3}3Eoߒ2'7 (nwͷ3 f,;U6j̃kglĢkÀ7 ƧЊmnwtpd[lCu(,r.H*b =5ӆ!J3 #hGOnSG,g&u΀""2mٿjI/n|w^zfB-[^(^&,B4L%d-jaSX@/EcVep== qv~ _ X$POAuٞk01e#'!0HA?L0ݰ{42R뾏U~ ]-,}z^U~܋+JZdRzi7^z^>]'368%.dtI%I@ Q5L&$X|w>#OH(gHLY\vŠV␸UA@X$s0b)2BQHq@WmleܕjkϵDYa1-C=ܞ7+E^Z!cN_nB lFujm@DE‚S?#]?Rb|/WD̽ oa%`WZdom{xW @ҵs4i.g0twM  6;q|i#e|ͶE(Tϻ]VQ4QvlYSY;] d|dЏ|% N7Jvc(K%k }eܸ. @F;D#~y!yfO,>#:{O1+{x{jt^Wyﰽ^;4s.#dY#H%tC w3#6pGS~"Ž(#}I%X~'4|$~ |C9aC1ȦRheS JdzRٰ؆uO &\kD a&t^p;U Htڸ"|\n/ Po%' =%R+EwOQgeoO8싉_cC nLDjYa e4vzLu:%>)F&гQcS+8cwq؏S~m:c0 wX)(=wN>J" wx#o4}ہ}f[HRM8A0t)ai>i$eڡ|Nho"|Ԧٚ[/LZ*Dtd2٪/x0f}|7dkDY>u%9kz(=:w_  U|̵)X= a5|u@QHӏ,އFUKC;Qh \3p*+Sj#.]prY (*0YRevW6nOXu4}".UO͡w~~{?sj>WrC4%bV=Srt_hkTɽR7sawQ, )Vˤn;zܐweo k b;^j0$j]?VH=bRbȟctV+iavZJxrHb"uVkǯDžSrٹ~kkbvȊ|f_ϪB.y>YRx\x, ّW1ɐO/_חI7cz^*=rF3͸.̋t!WǗp6mc?Sk)\?MX-wڧꤑR5"L㦡׫(9^QܦwJWf2?{}S:rղ9m0y\r( utWmyӖ+dx6s0^nzq ZO X]x{}tOd.u盌o~T/ÆYPMu!4B"ޱU47ϲ'RYH,Cq 9EwJXr[h|?'xRI\TZŇ򃋇 çz)Wrq!1=ϥ\r9>fr7>]OLdכsgpэƹF-x|~ϊj0*~S^'fgׯW&jYY/痱vjlllߎ_291]?ogǏ]*ploct1w&;o&^z7t{yyq+]bR8X$v0 qS = zgV&eݫ29moVYO+}q5K YtgRHux_t*|Mڜެh_bWBfW}RQ&Ԇ`]`t|OpU|ΰ\*~I5`?po1X;0ŵYy \]2;ʻOc{]cckע !K\R-S-e86nwN 1D#z|Ž`[Lv $Y{5OQR"Ea EK艄]sx Kt5Qϊx>~B'zD?Hů?3;xY轫U4 qk;R/Y74U}s}M~9N(T:Hhv0WxR#s cߒnb=r@Ftn;RԄġ&b[Dĥ_/6졷0B+"t#̲?E |2 j”#wg$('lAJQ_,jG*{KSi[t$o?L& FziժBQ{(f w8bZb"L b톐 kB"88*m{' Ctkh$ mjZAEiC~cПDz0;`|&L[svKRrIHFgVbiy־ºRoH0։/> Y̼AXԃ'@PQd(=Zf~Uv6zpH9fSG:V.hS;Dӻ<`$P%Oxt@XB%ljLkl8p#\N#Q-(NRh'xYFoT@"]#4BMH 3$|"\55 ~sl&S9ZU|&N W@ {^ceqB1^ ::q^8Ld#yIPƳ(`H[*[Ú6"ӈ$Y% Z Q> `@Lˀ@JN$m0 Dlh\m1w@o 99校"0\Gy<֔RA#:Bݒ6FKxZ@ %wMVOј-C碴9Ē:x@$iO<" ň<$UkŸk2)~k3! W]̩A,6ShRT2I~&!+=fWw#e<^8JV߷e;ʭngQ#j3}W G̻K%2W" ݱF?-muyy'O.a_ΏƲ(CD<%#nChpv)&O7_AV֦3\ 9A 7]a`GF (XlaoY3b\Tef@ߵt!cE,SD'qsDaBZF[PCR߁+Żr4૔vV~Ϳ!%h~Fp!*NY{!3/< Qf&N8Rm#Öut@u#U1UTՆ³>]B%]Q^2k;: O8 w%DXD8G/ 8ڨ7!hY'Xԥ/EHe ]4|01詑˹@a{) v?l/O'6U7hLحȱ8E=YS?G Q7"V!KnڥoD/\dGcuх: >F` GrJGuv8{1=ᲃ"=4Lq;ѰHHΏDNSU8s,[ac pƳx ]Ȝvyf"kMmbF m+V`[P-Cu6}dG(Gp>gs 3+XaĊb眩CH J5^`lȂ +2fꆭt@w\ӓ?{pw6od3넕Sn/,.q>DV:BpX]ө "du>٠\Dh<CI5dJ zler[JAoѤxq$9vă  "cTpFwbz xBL m䄏=o츶ջ x(vM^_ٜ?hkF9Gtā)[ђadžlPAؘ{1%,muƶ ;Ze5xA軡u3N7dD$}hVyPXܙk-eC۸{>R?xO{C^;>.w_'mx+q~O|^G=;ljt(qX+Uѹ~$\:Ӕ$w^v.t` ,Cu/cP=vh#1udz^ӈa]#+6+P${|d>?IQlTHuVYwF) @[&h ^R=#dmVb$jYLL R.:HqI  h3kJ+#Ciy WDUElC.xX^Gp&wN!uXPUbXؐjQwIkjGm@U'Υ`B*XkhƑJeh3 "Fj[p]"];;D:,JuJV'%P ;k"jJl'ӎ@V Y(\<h#pHzìHeOU lf;,3IDGyh%R-Cfā*g} G(m,a;!nE bJMHLҖ&l t6mi6,za&.Vt q?;H;o lD(8vbWARq&n0K9XI:ڕg\rr8-ɡZ[YF ?2ukh&$d!\}km $HS:nluö-oFMOj /* ]3a)ףEk0敇F5,^6,NDM>yp_)H:0=$4O $(e/tݾG\-Mhv')GM/ÿ_:NhBoص>\ C2)kaMvYde*b/F<%( HKEoaHқ\o#>8jEF2¤H$6DMF2L"AĴ]Yzqܷ@fvX'v2ٖidžkbm\*Iv"8[2ya8Qhezd#BI li!YBHP z]Wj^*o's:ܛv;g6$rmt$Xhýlk XCE!mXX8! gL81m>88Rx;iz2K kb5U >Y {?g<>%^Fh'&6]!Ô=34 bn$D CމD6pRs<=ip4G:h>~_ș~I"GBzxm.Mf?B Axw4&+zaG}6( l@&|l>N:@CCI*@ء&Bݠk8%-r lj ?L,.EP@(άs\ @8PEֹ(%A B{,˘0K^BPbV+&>I?v+\(|poH<:pV$C.>Jp.w }N^p*G@.Fpo(jȪACάB:6rAeoA?&aY82=JH!=3*T5T܀i BuDBn0? 0Kz:)p}тK `)d&~ p"?q/9'`-'7خWdM PV"I%T"crR;$Ug2KKX9?CI?ii Z3fe7X Q<3.GTŻnr>P:D߃J@ld dzBBH4vdU'bۅ Fˆ71=Y'A520pvfx\kB] phgRj0@zt_d!)yE| = >;<֩hPXоŀ:<Va`W1`+f Z-cq䬾]ZL4d#)Z?ӝu-=4-PjxDž{_š:pu[ nAT. *C>95r3ROcuv"6AYdh . b#~[f5 }.8v3j q#q :a[7R5^FY>I}\* ; t1ܺJ1@/#ЙGGi0?hD&:d=-dgb֜i[~0zx7;epe `g{Ⱥ;ǔ\>W͈:U"$| ހ䴾w:0d$tts$Yz4 )=}L<;CeHBpRL"s@OEXjvDzoQc \Y uB'RUcc KhҐMc?WBc$ @~Zk񃑞Jaě Bh ߗ&8DȬ/yE #FB%cMGl,l$*bM# {H ~Dhf K&q誩u?PHl0 gHãs{~ DW9b2oP+:?f̞,u+t)-߷ 6 C?X%[ԁ).'i&{5If4 |7Py}N*k"?jگ)tDa\|GI* R0N%7T). s|2)f=j^qFiO5~ qmOTxVeF7#3]9%"4,A$GޑJɌ +sc< g,#! y[4Y-i98ݜG=?wԑ㏋?t7!߀:+w`!O7Fwg㨙ʷ5uZD7&&p;M~ xM=h{4x^`feQӵΗaOO=m(O\HwxYT=6uCbBԑH|Kgglt8^6QA+!ʫ3sK|7*Z8Hy$?z/{(D^G35 M*Pؐ)F'ۍ!*p WA{)MEɦ4;Z&ޥ1!L '}8pӏ1-Njd_\Mx:A^ QAG[H6Ź%Fmܑ[NX725zr~g1Vts[scF ZTiCtC.!8ā2 OΏ5Dع%?.lO6upAX8!]Q;}T ;O!>H+sIUYFkH%K{T;!옋ųa5du)FNB,FNARÑÑBC>&o?)~o X~08OP6ud[pPwzYizx'@PxcM+p}K كBKLEV?"-u⋧IA\N\-)OkZ὾]sL&]$Pl:QP7[RqF&dMe`ߌ{g[҂_% ًt.΋,seIzvg!jQִZ= ޔh _Jh_i`GG+v-!RiݐF+1`Z䌘VLjV D>OyK$Pbf_䀃"^xS'a:yEDE4R(=d@/#? ra=*O,V%/u4}` ;wy&EF/k9W:}(LUu<&+zPۈI!@|>%磶*\7 |w(o[;F>Q@ct[Qtgb钝R꺥 &xfb0 7 M#֖vB&w9E oLb?z βkx 2wD 5Xd IWUo~sܚm]kbչ! `3}J+߬Wǵ$䁗ٕ豝p6rdͩȷq`$q ¡wg )D-Z`WR) xǾX(bA7ڐqKzJD+ֆ]v | E'U!$u {$%CF+k1i[{>֡їL0 .JEZ.(!*HDsNOvA 3OMNs"edbCLJ]-t89H限ŹGV [ ;f=,!<1)@ s†E`N{нp]{:쓐Shh=b#qrG26|ZeJ }sCl#٭W3:]2\MD`uz \㜩4ȹfsv}wC>p ,k) F+Tp6p0BĒ<]6g;WN >¦ˁwo3\XK9>cp.Rn3oʕlwaI9{ҳ!^PkwˮO>;Ӹ׏]e;gvԐh*VA ~As׺P!R ix-r3`qD4x_Dt@}vVRVí_y )WH7ه0z=$n-D|oIėrQ cul==q#9&.F3CؕU`xL\h_E h͉3,RfPqs{![위2]@W / PKdl1 d$eB@he</@7`yHo(w#끲c:8h*%H8ւ&W)D;/6X~SGEM|j[?v7\߁eK㥹]{;$D,hB^n3E[L zM*l,ʂ3`o to}ڳI.*uطf=Rt;y݇l7߅l虰#AM(z# Kfm{E曆.6S&'p\F4W8o_ش?HִsJ~~VuבU8BHvUi/i ja# -vc?,"M/X S!ΔE,=tJɂX*D"`U^p|9֖yeH!|Jr?V GCFj!q]^/ƲqU%#E>@^dSe<8|óClŸCCPZĩ/^} Q[7p!nQ|{MEA|Bs_?q4V)j 0cCT *أ5̾}#'̠dŋj.-W)|+/Kwo|ۉzPn~ _ \0"L+ cYkK'KCJi'\MJ,#fAuU2cyu<'OG\2s4AS^,▿Ro*&oҁ! !}a J+B9zDN) 48>Nbjɟm8 12t1wUJK^S~Z%fD(w܎.;:8wxE41nb&6LX{e ^pa8~Ou:Nu?AR'  Gb >y|1PHLdi4$YL͞#jᲅHh"Yx]t¶Ivc p}wv\ERl)9q tH!]EŲ}ڃ 0~%K]/~uJ6Q@ Ժ͒=Ym2eϜ#0"Qf@188 @4 `5\-H%3+RՋC*A9ȓPg/ۤ/Q r_XCrpAe[8CW9KP@Qoʴ#KrV,)=\c-o]Ϯ~ RwobYs0]煻>FV!>4~X$UϙZg`˃{(h6pS4>88HݻB+vp]BT(*_G]ŁLbo1&،' Wٱ?LrcSD*FL/Ky@v9sn# 89|=G~xOШ}{ܡ@ tuOQ`mጞsW91rrr>/0,&;E=٤tI_W'n_t9q4 ʥh]#gQ @cD/""A@8!ܽ|jv8w/nn@9ѕ"&|pXA_daVqݷA ގ]I ɋMdeͤU\f%[]f.U9^5X)JhX1 V^܍kv̒3 $$7m: P1U t{ؐ-2={ pYhe-^tYV V3 ,܀ɁZ! E}4mq:ط /} tpVAÓLLdfG!jfg21&Ӄz RZ8ըvd5o>oAWX(-"Zyi+㩭֋x7WgO­Ke;&$cKRHe:P|㱉$+<ኇ|3CxmO{/"K2bc0z}C.qߛjZa_'6~P{M Mkemܷݛ׵$ *?v.߬^OT2mz!_*N+9ܙp 9H"XŲ=%-޳v6T!`;G6 e^!7$Tk\7>fֱg3;@iGeXvaVRQF>C R@q 7w\i)Q?Mp\SrQe6H(Ӡ*Ik6قwR*Uݏ !U0vuǀP+l ݭ']5gnliq`4Q#2퐦qe{(zlfwl-@o`ҜWQO;1az XˋVEigI /[)BPH4H>@RLEHQe{8>f.Q?)Bբ3_ovیjԬzˆ`| ż_T{/sH1)>+K'2) +cU'1Іs{Cv:ey12gT#A$~DfqgV)Ф=#n*c|P%/%BZ];kn1fn wCii?Eݡo4JD7խwò%d+\Cnz34İ]/)1shF+я",U{j'BXmY[\Q:R nbZ?3 ?.{ZF?^g P(T!6fVD2 T\8-0i`M^asl-fnZLPHtǧ}P|ǿ]3+ׂ-w- mͼ g–+>G: V[K8$жQ:P 0j.TSs,G CZ1H1u*c;L7`FQ ́0Dq洴v ;\WL+zZov!YcU*RDt5!`VtVuM̄x$M s[[xx]BE3 0Ĭ'_ We- N#'rPO8骠y^|Pm.w'ӯW y/" n,zR{*{}4kU=Vh1:u ?%-e$]}gKp<\tÄ x. Ohp2`#ޜA6`sr60ҡpD##ӒdxY2 A%ҕF3Uar!]YF8 nŊQg9 ďjZN&v" "˛l!kn3 MEkXG=ϧ\VL&(E@l@dJ<٭#;] ]M #7>Q9oK0}*;べN;0Uq*wۺg;xy54`i:J__L*JB9tK0!_>Vk!j\^iaF%CڻțZP>QEطlARG8n?hDBGk2>y]cXWc5%鯃vp(`6k0)Մ3Y 2=+LOZb+yE WyX~ ذ?}wkOCuR ZASP G^]zOV ɩ|, Ӗ9L`Bz'V=*rĖWepRM[G1clY## | !)- DK- kgaNz9oLuAj>8VFXƉWꊲ[v[LlJJj<"FTBmXO+\ɨYg~HNG8xׇ. VYs|b|p 0-(~ڀfD= cՁ[)@|wD<]Q8TA'F2J -sY),ƤcUȌQ  $A )OD 7Zz~;q|/Gb gSc/9G^m137)p̱mP_A<>hǿ<ϭ,pnrӉ9alw\>\USJLrsOէwoȸtzTs!NYFH@nᥐ1ӌ^;YV75S }d 4χSFm@4Ru4(| p/~s՝P,ōy=mc5 -N!!qCr:7L 0Tͱ.;fӊVh}պj]JЄDK5QjJHk <#ILBp6PD! VR52I LMa\B?wOIV4-uU{vB~9Ysnf@6K˧!V>4Б q\jEU$W^ftaF>3OGP'q?J#2gף?_=)}p7-B*ԁ zT-Pt#YkwN*ւhB!(*\`9e%dB!=ʻ\6 Qv\? #hDs8O),Br 6<-H.Kcƈmjdv4 B!UcA'p3y3N1g XPlP11GlTm\''ŀqP ~Zɱm (oz .Š1@ Fdj[OV)i"uէX>R-"kЭ$D"`D3@tR9>RB=FtD)#}:pC[ & X7{GtB aEaGf^ocψ݂~cQ#)J{q6'xk+qPdpS6 Vcn-ӓz ,b ,mU\F4H sѠزˎHHM%7@SՑF4LH!MQ1QJ'2Pbߟ1w^XsLKP/XId~9>ff\9_RNMݯz'_Qc?OXk; d]'>*aD~7"|ERY_@[ᩞ<2m{f!EEX!^&Dt'"'.0VG[>kgj6( oVНp"' ztc1X={WP=GЮOn j[imXt91_ݯxk<cS$J0aҜ'HZܳ@<43K{xFʧ?WO3pF>KY+.eo"7{KURmsYqL P)q8[EݹMxSLwW1v-CtR@><`0r;.C~[ _7|g졀<Aiփ :)LV{EO1ER9Nxڀ=yY=ovE"{a2[Ľ PM  "{psKop^۾ww {aÿ;a/PU㸺ګ ^\$5}\N?>fE';Gߞ;-eEW;?]s}㑎IvU8{f|?p3Vnh;YΝ*yg;o3wL1~$RwDgEi3} i;$&C(4 '>`*|;Py/w߼;4 À`.v",%6d7_3swgxIv1wyeOg纼&܊]ػgZ!q.+7h^8s'͕S`ڦ#n:.=#Hq=|&Nv&FsvI9z0=[`Y Me تQ?Q?wtS /` B:8;-|gN3"4tLCh.h @p sx>M?|>?t;nd|jk5>ۤtRn.p 5 wU^fv8 R-&bE(IWŝ/ݟ_%>?;>ӳ#h.zq/ɽf|}xٍnHz>$fi8Og8?Kg}f{GCM0Z{ܜvMLB?^2G#'Vl\s>tN"̳=ͯv<^yۅA53fl TMʯM1 p53JmR+}CP9+?̌U)CчJzBD{ͣ4VYܡgtL;s^է?KdzWSyBP>ȫ̓4TDbZ|,}ԙ3?k:ͩ>bHo 14K}:nmܓLUF6򣞍C:+sEXFGy}jnJJu}T|\e9[g}Aݻ<%ѹt>.+EȫfGYNK,/ԝ7cH9OCvi@C4t"p|vIL-V\:5{aT Ox1iGGrhଅϫbB)p6ŽBG&2X>*-o e8 $(i6`wM`Cr;q k:rVo9:>%SM6wUd ?4-G{!ٲe $"m1kF(P5Y87C2W>A8Rj>jjݻ[4qL\Λ  ы,Tvc XPۃ/ ƊgtsT?O+kJBeGg9!YDLݢU3ܕbK38hrj^kJSHb!]E'dDHP vSP䧊i!B+@kχ {^M.(8H݊D!ȬIWPbٴ9>΀=Cc_MKV~3Y˅C`N g?E^t/A (م=:Džnf H9W6gr!ͅ V}]I&)!88.v݆ҀpplQ:[lrCmrNHj_]WqE xOlPZ`ݷN\;zş; vdu#u ƸH8"9fn|$6D g+h>Qgɧy$&žNʲ}15FItF*LJd HV_$7%vNrMl ꩸z+p*[%fviΦH5矯X6f&_dƚqOꄛ{&eB Q䕐Ģ97A/ƕ#Œ|xZqs<%=ȞmW-92BX'*.-Gr.0Bg%D,>15DI8GOEFxr#z4{wz1x 7u~XLbX)rv -$N̞u0Ϛqؐ /)hZ"t r+7a`]sL[p梷c4`ۡߨ*dLjnh,&Š r[cym Z6; psd(Ո}ͷEwaP&ĬU(hJ4"C] o`~+^עzz}0nAGiZ nv8RT(TGb!̹1d^{()!}Hy0pjE0f3X_Z=Cxyh@y[=WR+Oz̔mHDbn~Eb@Hwj vxT !t J|9ey;˒m"(e׏PdoAA*t1~I(w#" P<3uhM) Zdjqpf~֦kp>+ǚʘBm: 5E*-;`[]֝ΧM _3r8(.sT =VV)۫0rN.ݪbpKL͎v.ۺ)1yL @j"TkmR,s$NlC!%LD$)g#>N _:,SWq᝻(CaH! qDd.ux .%Rsg6بʒaWEx 嶺1|ޘY#"y-D>Ji,=+FmMD Һ~ƒ8Gcv䲏m7H@GF@搸Nn;e~T1`= G"$?:BWi4܊3C0(S b@ԣÙDԗ pS*پe1A@ǁL\˛e81_Aw?kcA6YFF'(;#f1J^Ԝ5K9@MiJgU*1trƚxALgff JZZ[R RA+XJbbWy3:qd€q}EREK\WBgs"!NG8;cc$لBb/*kܽ2VD@uZ1J/4%4P3ܪ0b7)U\; AY$tЭE:ή4zDiW"шoy3L":Q:׸-u,dAZ l;۷MbqTpp’, DpE#wcww5Ԧ|8.m, 剖]!FJXBXG¼r7 ^~js;_6hdIlPj uÀU^"_Ts'\n a8U] g~ jYXN.'T>0{Xɠq)73GKaf̮@|B7N?Vv66=~Vl gD=Bn#4T"0Q{؉Ucc#[w/%uۏ"D` ra!IB ŷM.dA ,3&9\,Xmz\Дhr?<< Ъt&8&* m/1=>S|9*? %p`f]@nVNih ~TlE>fQ.Ё3JdQpurke≠ԉDM#IUwH'sC˙> ?/-Tl'H7"H#%GudUR$f]+6@SN[)A8Lov͹Y HBoeVQ$pQ]B`rk8F>~3KX)xj_et> ʤC]g1һ7XSXr!ÎꞬD>(Hj;: 6ctl[T"Ɇi F6Z 2lS09ZFLxxo*3;z""sk#{?rP#t8v8 ȓFI[vT^TS]9zNXGG6HR%'CT5.LUhm:%ff B$K+Dzȃ#zQKs `G[枩0̆F^蕘oO%SM,ї(9h'+%RlH'Bvh23IOq,A7[N&0UEa&V+ J#u`eȳ:xjB`\ -60ƶlUUspo e'd RɺZcf ph vݩȑѹG]W?h{ cN왌,AvI/^I2/áP4X qKBIPK _hB@G4ϫV^đ([&W)芌,[?VQkO< ~jƗ!>(X~V(: V0ԓ:lqŪϱYHG_&z#-{ȘU"K8"*];4PE래fN pM&;JE" tmEg V?2_%x8+;#Y,7g"j!9Z1rD6KsL ԋTCs X(U@f'2ܖ]v YÄ %;@(OԳmםbH p jdxU%h,'x\xB\i[HDaD D+ş)^IKE[b%IP;\OU\X ૪kt9iU6q z*F'/wO^>~X+%yC䍣$R&foEd?:o ވ#:Br,Uc8|ўsnmAj ^TJס+O6xxhH7 [g .v?6ҵáWq dp4D0]̹x3}Hi; P(؊lh[gTkPgfZ6@oDBJak _&[\O@aQ˻cBq˻/)-{ijMZHb$!0fyż`m-@\v,fP*]DS]lYWdsȫ|rx ډTB:`9๹URbicIz M|ow쏷f4`b c*eVkŋ'3PæK]<,J8]H׌^@"6L HV3/֍ 0kV?-P J q TF5t Nl/2?5f] RȲ&[DndMW vkDƳ=i83PAQ0ɏ 1 HpU1h#(dDuAW%]P26W%,D㘍jj-aV𔼡qJּ_ MҝCn! ֻ|˩h l5 6ȬYo:5 |D}PoP'zWfvB19fByIfi-|ۮk_d*`?Ĝ3 jZ% ox_)47q䠩e%y靷Cl:HɄ.g Ԓ5 ZڌS?a՚܇U&M 8HZź}FIaFFvMe7m'c٬V9E&4ah{]$N7Q?Tĕ!m& <)GC (8 I3;csbiJzz+Wi73_mjpP@&E:UdOCp,\ Yv5J؀XJI:ף;ftxHY}P:xڻأMAj2hgF>!/e˻O:Rg@}@L>+{6AiDD>cACmeh?#4Tbs=ApR'ޱԮ}"7X~&_\ 'cI:;+ ,m!qKk|e g3H&Xao)h~C\1_<9=,Cѵ;`X+n*|> 7O l0)hMqFaeQZw\.I;,\cZtކᷚUWG:"&-QmE8WX\++b AZ#x#Dž$ǖ{zOHQj_ۓ(k +sGgl_E-I@5{c\vf1$-Q:yt!1+sP$1K.I/%YhFˎ p$4uYأ dЅ8BJG}WzW#08`i}iWct7?o벐0@@ 5f}sB"gO P]3DG[)z |t9.O@8Dمo鈼T":Ѩ@1Vzح:|z)SGm7 d'>I5vdEׂ~4/f5C%yA,=h}Jt1I&Y))e$mM]tFXJptEKdz·g<N)\aAI3X=}H!.8 ΅8WOuuEl9f~9W8HXh5Ww)J9^jpT8yw/w^we=z3uc趸s-Kqtoopw1 'g4)tSyJ~Ŧ`"ݬ6Ȧ@ y:#vޔ.4 \{ɺ'mcDُAJyL^]p[ŖcZJqm !OØZ-ʢP EcUpc]!tſqwL)vP.J"&1ɟ1f@ $#gLI^>[rMRk$?j˗ hI*SN6;kaow|vMzEOP.F>s4/K z G)#n y|<('IBkFF;='X`riɘm4 :D!W?]TJsΛe#Dd@ N ! 3q}J5rRGaʘAITb( (KR&Re45}#|xG{)3Tq'$fh2&tsb5jD uGƕ-IBp xcZVYK@ _VOkZ ,b^.v3*NB7HB0\fN+ IN2PN+8=(>g&aP3{К9HH\_`Lss˃7GhxswF2ZJEp *p(2ɣcyY0, <Ȓ(N#ٷe6–c(K{s+Ҷ缄cc9Ml9y6NlL io&@&:]^!nCRrJH8uՙ|ĺ>^XOવXZ9EhHiH $[jH@ FTBmK4E·nնF Um^C'{ȆM 9~ a-ۇ紷s@\ Z_/gdm 5 pd0)%̽㦰M GyѦh#qau'ұE\ӉQ\% p ĢgSug DW6}XOGg$t7d0wCYɋ!8/idY%dh./ޟFZdQ)\ϴ'̃w8A[zԐ@6S;lڸ# wAL׸ }>!0ÀM8TR4ją$.[kyrAyxQIMr8lx9XFjy|jv|أ]G{VtQt#gQmFW]Lg,{cK3l:X` bd"(~'fCBlog/*H:MW41,ke%s b[5qeHH?-,MXѽjg1~XCC,n!*-I b󻌇̄0C^@dcpOCh#oeH=(̩ "holi%8-JI;)`sρWXs:f&a2Q.2XBy:޵hjqҶCЪrG((8dsάyD;+Zri+:qgK& $[57ӽbZ&gxB&DZd_ <1UH?Eo) JP))^9] Ÿ>?՘ #NO\OIxE ! ۳jSv3rfPTb/vW )A̗m C|}0- vZk3ٕAG7譥&FW*:L.'Pz7`Βx۝NLEd|" [bVm:">Blt M"6[d.FuCnѼHG\B擄$h$馗X;$ĝ:9]P$ +/ըnQ*f蝠[qc';vŎn$qݴ^]6rTyٷ8_2`?&t]`~ԗ[mO``-9*qbݻ0k8mJ@I}_ k`ʽˑ^hSmSxmBz<\TzAa6 HJ =W`B(m4VelAFјJ ʃ+L<^m|[ Dkwcأ-$Ĭ>jH \A4s?M0ݼmbU] Kӳgx~˘ .)I@c(4 12,H L$5Z2<wM Qϛ7XQzEL#Ot.{ s)"N=ZS6K d]&˳z*Qb,N#z h L7(;%ge'h1+\qz$u.GdhB ] ~R7lz8e}4(&oB:z!>7r~Vx> BaVFw+N)7]#5Ó2J3`öFD3YMGs~IM4Gy;fAr֞קb* c!q#DDL$p !> me(yT6#6 Yk#r6 M}<#e` FZqdX#2 :I1?c1 jPfѤ9Eb/Ricä>gE5ےY[j.)WqOldn{sMst&4$%˪71iZKcǙDa@EC5]r+[icxSaزX|49Qq,th\8Vh>C^G9f|uh;]o`ݰ](&ac:`Qj߫V .Zv)i0-+hʆ;3"dž쪋[$ T*4L2icp r-l8Užuf+fu8&M1WxܙjIG* Zija^3r7HFs ҐҺfg`>QJdump/U$ywwGC5.p}{ vtiwߵgF EĪE1*c=~0Oa.]4 XlJJ6BL@^TH w68|+􄹒@WZ5gJ3cL_Nbj.tXUyNy%NI?2:vp/Ǔ4# Sp@ ha Z0XJH o~QH E A*:$geEb# }NΤvp@M=[jL8BqU/7Z[[ɽB?߁G)&;A=礋dDKwN{敨MzNoHq X Ӯ7tO[lvLՔ".ُR(Rx>\ R5)A/PQoETG[ׅOؔޕx%3ƠG a{y[~!#at3l] ˹[0@wo FvvuKPʨ`w}~MaԁhғvvL" Cْê>2C/`9^V~^IiBҲ3Ys72wձj9$mE0LW$|/ҽǿıZ.e5j>~:=X`{{$a\!Sey>fL? C_=f`#UaG9xzĹSU #dF`5}eauyy<)]G%ux<6Z5+aބ}A+#jw?u7ǟ_ Yl2F [0wC[)wxsB_zn"EX9ں}e1Ek8:˜@ ge~QKY|J3N K471ga )zJ#Lʝ&uRvF[5+S#ǏH$卅A<"#CqRHRM`[k<sΣl=^t^iqjEES_|*˓Ꮸ2n Ћ/a<1kYUob'x(lͤ =nC?WAj a}GV9(XhÚ;+Qyn.b0[R9mucٸh~'yzw@nͰYPpnS.6Xj0w[Ufm}AU#-!ՙOadsF_)^+M߆맬>h08[ g*~zi Ut=\n@>z#Ҵݘf5@k՛؆fZ;jԜ0k7(_3Qd>݈\ْE_!Q |]3oHچ9["C߀tC:')aSnlFRoD$@;h4 M蝽EtЦ共B85p!B~bۆ\M7@h {/gmYf'Mw~#bM#oD"=\4O!C~iSXB 9Вl+ڎ*4W7-ul7Gζ6 64FT\ʝ 1fFxۈ|7o4TSQlahGػkZg峞CiiTD֭;D-mtwZj4qs۔a5$`}IkHX;XNElfN_x9uY=5tew0؝MtB=iwmv? Sqkthmgֽw>ѿOnX ®fpw=X)@-&3"&g{8i Â,غO[V`@epޒ촞w ;~zWv>u,nW/5x%oܝRWE=su OӌN0G=qz/_?~tG=}|rw[7 l:W3SMf}cf1KNf?g4`ކwț͆ Utc" U(Y~=Oo0zH͛ usv6Y1Ϯ?yPzQ|~Qkm0 wxqGwl2ԷnD~rXPN (ڇI7w¯h@a'N+o_P_Sjv]9Rd_s؛wXSIcvw'Z=Z>Tx;ښ51`tqV)wMZ]ֳqs+xqQ02m_Yـ˼. g _-7z#Ve>9 &i+cG[pw]wu>0;I fI"y@i)W`|of@3 -ԂR[EH{&yS7wĆRv_9opLU?jFJo2H50ſcACvcIRX\•5(Z:fT !uXkyVf(a-*&Q/-y3z>bR`(fӨ8(I)Ў/ɤ7(eUL?&8 ^lyH>0xMѾ?VN 77ŶW|~ e3d}v参bt] ~Z{j1BauUmD]?J \Jm܏*Q0mX̻vy I_6̵LLߵc\cpBJzT0x15αxOf+9hsKWRi;I~?j•fN\qI+}Nմy[# {|ިWh80S+ /&9zc_01>Q9#F#!pI &0 2Ư:\o1iP?rRƛ4|/yP俠88 h`x$I?<;OoX?sK[׍uϵm԰L:er=hJ`2ͺTѮbܲ9څNE Dqhe^- pxaei O][!t<NNQ_WIsJI끅}G  84+8K0rw3 m w/'?b5ʛd#C .lwqxC(ۿ>O1XOz,1$OyWM{?@RT/Ue|x!`8Lx妸<7y6֡=F,Z𩩽b?~lMyB.[OJ]p!CL҂ʭ#npf^gq l<'1YO:&xߣ~<C4l~Z'o%c!E{wj"pG9W`:!w;L¥?L|ISv j;hC,+O:|$:雖Ǯ"ɥ"فc!8 C5^)] 2{Cך6}~@Ls7.nROR}:{H"GٺN!9N_i{8˓mvBz$~oIR@:E@6RT7QǣP4Xs 66K={&- ۀdSQ. R}УHNAkzBįqcpGo&*/:g $qs|[?]@֤v|9žyV8>^%1(b:byM+=0fr9UcϊZo]҄~ñ1c5fFit-u=qhkhxqhx;<)+&{y "̘K$T8? !Yiy'.=5:bHܘ[ֽzS.tkFg5Bf͓'*}zR/3j8.xڅHm>WtSG[Y|U*)&|njM~KE\ JxJ6idFV oTP9GPD> Tܝ۔T\vBUVm5 NKj++6nRw꫿J-g0$2no8:Oo32Ra`eKdS=̑ ToE_!{ik%N+FK`f@=♔X5|Z|%uz@UC輙km/qJPl|7", V:O<hs[@g<@).cF4Tf}ޟ.y3]2}zܧSg-[o3nnojH0EVR,p!F5]%( LI6,1J|^F(i}! )&VhCk{wE~^9bMȘu<& PLD욟4l ;  5۩$::">(r<,DL:N:(wgoh.vp5*3p\O(T3vؒqO?R})pVnymLB.h)M`_v\GcFWome|NɽCQiRc5r_P!1!UIJ@q] sU!=^~g6 XAHd[C2ʘ7~X;J[A1; Ge{͚-Q6&*;nK_*"(hDG/ֶw=Ňj˔2j?!,:ӦG`AkCʉL_B!d@#L5v_; Ģ>MLԔ@jHhERQ2y@1:Q˽ZC;pFINN^|ɭ>zk }у/w(M'8G~}&lKT[p@}X bIߐI7.ւS~,0 +LW(Kz8Yλ863vI1'E} N9j;(,!ҍu]ae"# {qrM pH,.O1o}mwc]tڛEuJ {1dR]}yWu{B흈5N:ۉA[43twŰ_ggc7EyIkzҲ}_Pҩ]7gIF_QG5Տkq?CHk0")S.¿兛%uk!{wɾ ]F97UGCl V7،Cv:`A^tƜ񖽄Z++L#s(y, 7ChZr/DP|?բt?֙ҚWk}_"O,v+HD%wTDW2o$T槮Qh+ߏHmP89_:<٩]K "ax̶!fKeXD7<|ĥ\an)pBb5 &?X-0~ʻpB㓋kW}\1=3Oҭd<*c0Ł]b^,JDp<ű4FϷ|0gn£4qr:tt'_7 HƐAe! ~5RdrAwwV[&27ÏCPx QG[_%2<8::ڢ%No*}y| ] Эt|);0q$C||?~4n [`miVIZ812w7G#_>RyH?&)U.f_O,xopm| nҝ /JI=.&/3{D(}},0?BdF(+7T˚n|,mY.ݬ/*_}UXCHXys%vw\vD̛F1:G"XkH|' 2*~0)GI^xHli{t`<I@s`IZ:A;'>+h"$S qbC!V:3]?}ӴIa،FFo\brޏW< η[ikʬ|#KDW8oƭ Mrq qs : 2Ba䐞 $7s/HGQw.ӗG\ ٬5+{5aђnrvw;t(OvrՈJ7߅p4s$*",=q)H08=t ۍ-~:/MM@Ɣy.F}f#$)渺,3Ecu bep?WiFerrǘ)~ݮ 3p=r'9vUCx< \\, PxcQ,>PlH26vΐ+ԹO& -S)/13(}.+.x:8Fw;3&%h[!xGx腷׺Y.ct73WnwpT T#Y5P!$ze/-+: 0u%^O]E""X7I&ПŪ^&##U5'uhԱ0I^bbgQA?_@Vu]|=eg@;a1Ц9p:Id-@TF DgZ(}3 S4wbLNҫD{ /%<0"ϽAN9 QXn4X7$ (];ݣh dp4iڪ]g3ZYIn=4ѭK(tZq^?x7k56rXZK: _-T6z].bgq[Q hn YBP+;D?{^-4!!d*#g :r]qA_CHa&eHJLpbC}Cùȃ.]wyуl ! QZrQS/ hM(00'eD"70i[yQl$%DzML^ mopē0w4 >osn8sÈ $%;JA=ʍ,Hd#@ $oWU?9~g WMF\PH4b Py,,CG Mh{Ţ<IR>3JQQB۪h+sA,^k"к}ڑ*xy::tuZxd$_&Jk$D߹]3W3fr\{_B /G#X8[ۊ[?5Z.ố4GG#`( CzkG=@V{f4s:71v˥g)Џ V,کOլPm祭zߜ'YJ}2$#D,Gߓ _kԿddL[Z#a6/Uʔq&9RUd;B#dEfVkd6N{Ft[YUW??dھYu/6FT](/T?%Od(= j2DG9:Bo]T?8 #$%#)>bLMB6ofk7O%x 7 Vwx@Xj[ZB't!QG> if57j`hxܛjO |naQUԈ \˼F,rקF է1qTl` u+3^TQ^]ۢs,=M ;!E.JZY;[M=йuo}+޻-}X/p4Ԋ5Ɖ́4OW+*p>ISTe9R/,*v!+ \i |ŇSd1ez?Ĝ7*^<WExƃ==ѣd7q5(3>_IT.#*l$Mng/ɋtS1?/OS/b=KfQr{CH[4M h5K?M0w=ᐨ(]#-6q#?у?у}!g bmV}ehWf-F+XEqv|ļjK C@/AvcB~ҟ]}ze=\CΪ2_7\k!WoPgfםJⓝk5',xi&5b$&pv){ُ T$]al~fE>-ft"'e #ڶ>+Y`xʹ# c=lYE2 w*RCIr}ƈ#O?K?{wm;!h x˗B7n2^Zde6sI^4r"^(bl};EU k,~-LBh;ZF`(uzI`!{=XQS4ŝ=+Y^gY:;PKlp1:غз~+\,ѭBM,='+o<,It3k4:QV:|]z{ۣ]#Yx IeYVaev/0hC[Nl,Pzz4ato9;r}khO&g $y)FDRM(P+i<bt:<:˲~,><ܞS<5kr`sX*5zsL_{W^ϪX~ hʴu(?U$ojgE׍Vg\qC"oť$B4MBcA 2x*9e D`N[Dս~De ,bzm|4MNI&:h|)& Ѓwl4n߾?Dś߾wEv~Z|r"+ƃG9B4V,]#p(b_+Z^N"'E%BQJRlJvª tkN}>ӸFVD{*켂 7cczeΖtf*T/A>] isdG1e`ĒkQ*;gؠ2G(XwC(/"oLΗ;#<Xb F]:M?vY j(Y b܀wD!ulQfw0j?1[;N&r4H@Z͐t6< }ȽU-V5vBݻTSHU ;}5'@$V  ;e*7{k&O b#RHmGO0#>ҏ79fk7=}1urCȠӈ0YK&`g-EheyL{1b* U%A9D8K(MV(CƧ.@( !r|-yߡY/\G0F(DSQaJPSCV2$ (7n#טr pb6Vb}9Nfp:)R6eU<3t/e+oFm Jrװpiw?0>/a \I.,UaUݺK`V1&%}s7T9( AT.m˼ˏܮ d^bƪbVԍQVvTSuufT5G]@=C)oaLQmJfP_~ų"iQO Z_cN%![3%d6\M8z{q?m{VYgdY%qPc#o1Q8~wѷ)QmFrMk@QoX #TP-XD!"EQ[t;qiԌ'a]7 w-Q8P Th%Y\P&Pt@m'dX]$~$3a_dy fI hji}(>y"Z)q\Oc_OsOe춂HOA'+AX)MS?H1K?م(Vo{?cNe.?=?hE] +ow۞4G > 9FToS:QQuQ9=7ϥ,z| M.0j'EeMva-#g>1@@UEP=";` ?%8['mJiO'%KUU7;!!N$!Cn$(çBZ&B'82NkTK})wskBf<1V<87n\q,}wl}Cb%'sс⿴4J@(+UXcTCiO_r0yQ}yÂJ&ܢQ"jwI p?fx%rxH#Ym 7 3įK̈I׏RiC }D^1]Q%=(4Yi{| &r2yXLYJΫ]|q!Rl1@=uؤ߂_ m$g#gh^;N -P X*Sx߭8K7ug0`qSYv@ۃ~uֳL{:x6BTF %>}+8o )#6SpY/b<: JPT1' ">uDlS@F AGEt"@o1;Ɖ(izs|)է3㏉ . l]DV5?Q\(Y9Z /ɱTyME h':]`Dfd04R% 6 6R<'LɾF"Ζ8y2)oyjEX##t ݃.|^wb~JiaңKa/tt#`XF\Oܺ3AxBL:B/Yf0_[j5S|&*̀\Z5乔|i>%ZWnI=_Sd_e f&KBpd=hG`5%8C*=m7]9%)[]ywVw֥GcFx:򧕆h)ZaVy+q=pz 1l B,  Xk}0җFm*M!bV1(˨Is>^̈"(N\*-+,nl4#.?SVK%ͳ<ЪRRg +zbDjןVsIP(#O(`aXë^A!U*a /r-lgYPJ I#u38 0Bth䕅 , ZʹHi)QgdĝҤ}5%_Š ke$])$QkxYD- )p?r4ɇ'Sl"@>4{)nR(Xd7,dQ `Fwu3"+VaI>[s4jrIodx$f˄d:z+Ugnx-iZ>K !qz|FNځ_lGX-ްv`W)̺eoAx_nfD囘ng^6=9 5*,nP|$&a%ǁ,/#w10SS֊ ADߞʳW ~>:@?GKkѕvjђ_j4bܢgZTJ|K(t%9D;nl`5S>=$kT9ԁ fqī[ l6K~;t;:d$Vg m3Md$F!R+^Ǫxӗ,훇)o F: w|,{0~t=O=!vhx@E$78uӳMtۢ/ŌVvYh1d]JB TZB݀q[GʺqÙ MmϤ-qw*zT F}zPHI=|ٗ [b]svZF ?h/X/$ϩn x˰j.:!'`ۃI3/ChXmg3; fPY̱t߁+.J<ƹxQ-aJ-K g-2ɬsm-vl@|H` J[⠍c!j\Po,Ġ{BZKTI-6U&d O}Ɏ0(dh4ЮNZe8m7;M[n!u`.gGǶz:jrӻ<颷>H߳b=!0) RkT<~@7cvrF := !苸u(먄YFtfǓ,|jGLٮa!<0=6!|7!ӇYDDg [OsJ }d}e;7L+l&mP~&|WWQr:TNq$=4\=4J[`O|֟JF`>gGeTgoe80ժw}pY$Ǩ5T9<<,||u[yq<;^?VɜY[D$Mp^^ƃ!Eqjo~fwi-d˘.KЎ@fCZ 6e"fVtn_GGv BQlQ:J2ș5\"wۀ]*C맳e+79L SPg"O t#1~>{f:X69$m X Lf"!1sCRR8-e,TL 1Y x8[պI蹢B/w36w` cZLS7gK9jFU$2!ѯOx&m=ٛL`g"!ؾ*>]NKZrcFi 2\-,UxYv=Ǝn6p0QvG^ NE/ {cx{m{Ґwހ!n9!O XmPgR-5]#&KZ9}Jdvӧ(I0Zy11fr q8N;?A5.z@ WrL':ɋ:P1KYB{u?D@ӄܙǙlwah2Lb,S`1&0`OG \qFH >b4jНkxwVOw?;V]0 ;jTv2Kpj7ZJh]JS(Zd&D$_SC_*d1qIqä|J*sۧ*BRn z+}55IUA${UPT6֦#A)~kz+#iG:SܼэZorQUQ"6E* e,ODNuiD*ݭQ5 KrӳÖS# ]yeh*T\$v)B>9 ҂Z%@uRB Ѐ H@-Pj^'iBq wJğ5h?~gۄkI٧ǾK|u["rĞs+i=AROGVk8Pʳ"O%mS2y&L1Y{!6a&]-N=*D2am :ɨSA) JNsBV858mpJJN |ӈz fî7BٔF5y =@ F$z29QNYZSXbԅ̲*n45i4SV4 ϬJ:qf}-$Zn2SΊj5'\ي)21Xڠ%6-!)J{ajaVl5VI0-Q`C$MKqځߡjK}-fsU@]RLr4ťM˚$-Ėvi--ZܩuBV,$lʲ>9[ߵ 욾r-++QWWڢVwFXMWiJVqY@TIS&$QTT}UrJ}jRZVH)QRV%DWT~&$zPV4$43F6H'vs ;hjRhҌfRd"d3 PKĒI%;_Nreo4J66D&fMG ydԑu֥0eH3"ׅ,UQdw4mDZP DݐBVR,N5Oq}cK$} 4&S?|Lh;"}ԣ|4#|kNlia0&wD%#pQuﭚԱб2hQra$5(ׅ{Ƶ!o\5"n\ƖI6e'lAh@(jK,.Ic C3C=# _ۯZƎkm}BF:FƁ'Ԕ4U#mY^lxQv. D(٢e6׊fiŦ(b}rjԊfbS\9E)Jh@(p$}N5$N&&X]0]mD3$$6Mh z#6@h@XaFt͑!.h;$A4@(7aC!!@}jtOCptWboxv>t:C|FA:C:C|>t:C|fqr:C|L>tJu:C|>Ae>t>D>t:C|:C|!r:C|>t:C|>/>tBw:C>N|>t>tk| C# ؖWaCHI2w;w:6]p$<?t>;UZZv8i?iϖbn xVq+M1}dr7˲ |% 7uUYp3bQ#/bȅ .5 p3}FZXbP15R p}PFxDW3l Ψ>LE`P mQpՠ /˭7VJ+8*@ԁt֤`UnZ\yУ6p7B>`,~b*,_ze aEo iV=uA!ځԫ-CW DDw$OL >PDP*›X/n#ڮd5@#ׁȪNBG๖]<$p/8s[Ľ-0 %; 땠x5lˀ%ԃ8ڜ`kLTڇL8^Wlb)Ep{8w6>OہXqi4!e W)DgP.S H5 IWxCS U %Y bA*jTkO!\EXgȊLh7[yߘ_F6\| X*FW#K,6%+,AjAZX}{w=4mB)burz*\bǸp+^lʷEz] <_"ie'p,e} fMv00Ȓ > :La1*HW1l#P`]/dm&#xxڄK-fd<W8}mh.>F54n545&FR#EP <-jmT5^˴ j`zz ^3 UY=Ffd`xF5\c < 7vON.7Xu74OMÑY d[`,b> crdB-sx4 !qtԑշaVks\QFǺ GV_菪T^o xAdawR < feGǻQڍAVCd^3kBT7qekK0!x*uW Fp!xM ـthW'2]bt(PMv!Dw%w&w E]հ"xVɎR-\tM .`F@#:@T^v 6\\e(3rDٹ&#VaG$/.~]|$.> wAIT?bQ=O8x'߄_߄VuQM*;N n&x<F-C V \)yp[,UPr~3K — `Qn dw @LV6chȄq*Z`&9ք3 ڐ&>Til2U-:.8q =< `NN=l$S>I&l{On yAQzҩZ5{ O*'5ڄ? E*yKbc@(6P2[Cɔv  JfHjAQjՄE0E냣<嘟$E &E/s9 bɇK9sLaZh J)i tU_b)4K?B;6]I1cKp a>CE:Χp_˃Oš<~{ѫ~ctybBӚT=mrASUO쩞]BӈU5ꥄ'\Q\#(9zFSݗ[珪F+Tᓲ[䔺 :t2녚W>T=ᝪgE)lSzV᠖4J\TG-_/ DvUkm6W YiY.o%\yCV?yY˪58*:nqHx #;w9do %\^hW\F!8XySՅco* j{\RDZ Er8b.ksͯ/l~0? 68,t W^Z,42.zV0z;3!ٮxͅ5%nsI[TpyW9.Y= %Uq7gn,6])́&x)B[ >z FZhjhl:kȕ5Ԕ/$Q4gۼiV-qYO>e%5o pӐO9 v,$rM>vʷ6X6\`tM1Z=kpu@r.zVcc(F./ƭŸ?wm|s{܄>h߭_=M8ukiKprK-qq\lu߯nܶ\]l-vZ6ܯ9ߙۊ'mrh;^3[ȗÕϓe2Wjƍ/'ĕ]}9k_M~{8 kkUyuׂZ:)VsWkVkWu5jp[6ॶIVpPKN+tf\0ͷ]G;\<.Y6X*˭*XSYΧme ʵvռ9-%{UIn#i~Ƹ"s"WCC_u@^69e|R*x8.564^#>vy}ub3b cŭ*Se%j[XpƜö~7qyӤ6 x9Mkp w#>wZV \/x--4Q ^`#N`Й7Fms8mH[rN}y}m~0bz+rvӫsռE>^ž׮9ϮѱZ=!0Gk]ݪ\r+rCsj\LnM.u]ܵ]+5]+n>-s[֐Vmk׶y@X>ۚ4*[1+LMup֮ISkQx5y8D%'m6C<ms6;9 l7_cq~e];N6dy*vcs;95䊭G*P07l=^9a `vv&kӼrWCy9˞YpVsm˵ 8\ׂUokC|Z(jY~V`r bV){l*8W@'\uO_"+<׏?ZzAQ݃i2S֐=xofgыc ( >|Q7X+D 2f {A:t8=6M .{|NL.>'G0x2}Oˀ{Yyнysr!I2W{37yp<` 0}ݮ81>O߇}[r9כ'??;nQD[ރ%"' $'PO&0*] Oe0̠~.Ft$~g}v8TĹ7!q# !HIJy\_Œ[BU;`s)+r{<5{.e / {[3>Ղʥ@Ã;n~88C/ j;&VO|}4CP_,z/_$>w&gPT|˗Ov !2 ΆЏӡ===U<6 xAo!d[L%+1an:ߪB^@{6 ώߞMՄ}`k֞ɭ[j(B>;x\oܘ??̇K/D7Ҫ=s׽|xHg'7oQ=e_`Po㡠ċZufCbr\.tOV_~< $bToo/DzRM \2N/-BA1`I@ROh{]=!TPԇ'.v_$HG\KE2.N`9\b@us9 ep*ޙߜ@ FÈ gT},8E{Q8bFP6i Z{(=F*W4* 9%vd͆KY=A>čav`]@/O%xazNrk pֹp34 :„B6DF:bHL =tp%]O(Ij: #0bx /H sMs5mδ }amCԆ2j{|MΤRˋXK-m/Em//ҀTK|ɰRG{ 6~$D4^bWO*'ڞ0ڞШ=yKAcRKH@˚i{@k h{齯i{eLHKm/^B^XKD/=m]m/Dk{z#d2gFˌXڞ3+#m/Q(^ʴXKzh{VRR]|qb u:߿qvU}NƳ HVa[`US9 }Hݴ}HIq"%~ׯb]K<$:B-mgg.ɦF I?S3h%~i[\O422xUƮ G_s֔d]G  ҁf1 N뛊#é2LvzƅsmIĈF\)ܼhwwMW^앎;,S>sqգ0'5 UVӡ[kc, $tFu@v_Q-LD_Ѯ]wvI/wB_$fe]2^RS7"{0F聘 k<)]N•"˓_O.^w'ոW\[L:P5]^-"Xf%RE~ElHB;83_1׃2BޗDAJqƩe  !?'pA+[o:P|: : ~D@O>q!,-aew XaOvju4A~0:fQPW}3n3/=Ju0 k2|y^eCmӷc;L~s'k3O0J*H?DK~on2mCiKlq\;A.~?\ N<A1M9\,OeyaʴTtp:_h@){ ajHn *ӧO=V] 'uD P)/Ъ˨ Q'f!Ytj6G- A]8PZ&=V9MFI"36Y3t.^3q})w0b}o HSNT+(¨gWR|Ҧ"C 2%I!e$Xte+"<Օ@8h94;`"O_ Y]d O2}Ps/e_eCX#̮}=g>[ ^Oz\R@ܱK24cF]S,!U_O!{*R0&;TJ2h7tŃ;9UܒfM/+ed>C΃#^;@VQ`x7[cuv=bg {|KiL屫}je+ޖ:mɰi7N>1m?'ގgڹC Dw*PK ' E޲穮/ \7OѤi^z2V#wclse8).Xzy RK(6# !uy3`P>u$Ue[^6<Yn!I6zzIgi?^eڌf-O)R󳞑,aU}fƱޟ(o})D] ˞Y_ 4h 78H=Y"mbQJԧ7Q0֌STJaTZ0[=ޫ#ܸVὒBĦjBe6V| ց5 EbKoInoy{rca9ZmZ CtyW7Kk>h/*y9s$ok kUiΟWLbc ˶ )-8H0bq +k+!%W8j\`&L iM@mi 1D඄Pbe%dRT8ަﺙo6&C ҰIV`M&7ltfܽP-a,[N""L.~W&Df47+[M6/5sgXRMɐCeb_oҝ[y޿_~5  zPv*nUϒ.i2: Ńn`|pOSА_GF_rk,%YDnF9QWbe)rVeb{q9@c6:V`"D?|paMC#HeP`| AZ ʘ5$s`;̏$:"!N'q{ֲ% Ԏ3tZ9Y`z~*OI(g>5UYWyM>YD|:^_]C>qi>I-o#]y_YI:\U y8 - '+`Ȃ[ >q:8A 9 OTaN@s LOğ '#NsN0?5>`^|P'ӛ7! %8D4Nbp &U8 ~ vp ޷zk^LKpK*88؈<Џ|gJ)ro޼pO '885qEzNYo8q'x W1 'x>MpS :zyy_ ƐPoi1q U9N0A`pLo.N0 R`ˇNw `Sg\4^nWO"'8Aan.zGq%.N0ȅ NS}}1#'x&: FNpD98AhbY' J8q 'R &qf3m`Z8-`>LO5N0'# ~83 ~ 'tI?.N08TG L~:8E85p \*O-{_oمS>}b}+S\. Sޔ*r"tx!z\p'"w(r]E.Wa*r)r"Ur1iP9IW'B^+rϕPm.+r *rPR&' $Ms3eMO¿jҎ"`}EkAƫp.<ű>Jrȍ\煊'ŅO܃z'W"υBT*rk=υ#H8ƟͅTs?"40ƟP YTs ?\NcZP8~ĸIJ *rSXA.G?ѡ":)S䞒"Ts.+KsR2L?ң"7AEW4*l"I+\'LKt?Q\ B)rMIo2A{ ыc_ȩ/R/(rT+PX\ KCn%.6o8^jEս=~aK"o x?9XeHh:& }&pt1[a=RsY8WX{fI¬A_[g2["oم"~ R'*c9tG@n|QTD>dtEޞ4<uź䊇(ȑˋ k)Q,O|(]r'ÉXN{X>rˉXk(rQ,?mQ+''}[K(_n)ɉ|sP,Y v˗ GbJ延O!_VQ,ŒUKX~>)T,())buBO|>[s'y0's$^2}2d.=}2O`Iu0xѶ>ak>I<JjА>MXd"Iy@'AS$>IOH|(D N} >ă^BIR|F|I1''L?ң>>DI+#O%O~]OPd DE?:ނ''FLB⚐>X ḴiV'8׫cORH_['x2d'9OGV ]:X98TnHdd2񾷘եcy3Y+St3K]r9}Oa\t.YW͏G}H<6s}ɿ=7ǚnyAcT˽G}R᏾(I_o,@~KQyRX[߼"{|} ;\>]Սoj<7yUQY|*>|]'#^pJ%AoP|v=*?xqys٣7?y7O?| _Woi6G4h+KYzdI^_ :~GX7Fvuoo{;z>M>p?ï{1~ir4=}?1A~PYO~gIT"cSa ~*$OA _yS$/4n|!E_&i9MǗE<'cQ8,xgq+J^gѡgu~Bvײ?N7Ǟ`+(fQVJ6Z䰃FiT~T#HM0N#P asEA"~8*mc8*2hA{Hazf=n0_&ӬwdnFv, Kڋmd;GG0|~!fMA>Hā_,B3='~~W{XSdhx_Ƌg6+%XM$MvɣoȘXd~1*QEzB޼ ПF:&z @Pn=96xHrpDL{ɦJoX~ ls}RdrՈ#^ʈ=9#H= $Gzc_) 5C+)7l9ͤE< 1>Hy{(yOD#zdP)Ǽ  nƪ!+= ҃R cmypG7"=gRf^fpMLf_D33tͩ׳Vtou+MJ3ԸYU@P9m}+ 6-WE層r-dYpwzM Ν9aehEXZ&Ьڳc 6҈!9;Qi ir?U5_9~ʾ N(3Qw*2b>xU02J)qګYj Q2eSUNbgPt?r9d |cOU2\jd8V8y䦼L!QXK\-1Omr@1n"1Y_7nC9)<ڹdS:R &,?Y6ieύu?뮧h[&ɽڲ$xFpIV#5nr3,0@WNHfަ҂ M44Af)2 SGr٥NAnY/ #'K|ge}[Ědp硷PFVH{9h IKxƔ5;en`+ꃄ `!@;xǴ>̴g# 1~_J1PDG l@e>&p&KhƝ#4^~%Gm&BEa ^Rn_=z+\@Nz0g#Z^G|Jƶ'QTG7ѝ_ hMF%^"h2PhoҬtb"YM WeqP~nsñNnKo[ۇ#FiwG?FYSߝF{Thn>~ zv jVr1)fALHP]+;"{4FO +r4-GW3'PUҳOVĈZ&d RrLS;F}-^"HT ʩ*0`=U@TϹ,*-| ӘH2nDK\ Oi:}[Sc(̖Ch@[]%WoR6iuYEf>*7͝|_U#]p6MҎY[Ѷ4GmKg\jUU4!:f2>1';|?&k`Qݣ IuEuXN i!Hv[*'3~FAqz4V^L@f9$ݺ̈́[H"%TvetYJKBNlH j1U,i}?~_Jt+N EG))*J|!rd`:6X  yl%*A2y`K@((aR(:blvH%uA]>a h,cQmut&@8e=©g`IV kʮlSNNh>㥜b 4mԜڝd;krJGeBOtxPpͺ]/R~=!jF.VVN('ūԌc G9.,>-<>qT: `%烓YO>E!~T 9 Rp9 8 ̮V|(\B'_/Œ6N!rw_ yoQ:,?AT*Iє҇aʀ2@ c !Z?3"wqc)!\Bj{Ǧ`^Hrn[Lk&5^.ơ;/WN;y+;醹ѻ`,1 q̚cL+Ph$%'Is`tWa &ע聱rb+Ys~ILB%:YFfH'Y=xVܼC:ѳ67bޕ2 :ɃňPu7K} g]]5Dw>Cty(d^m粭.cW!9e\y,IdD߀tgUs d鬌¢*ke<T&jiЀhD k\e t)5{I_WrҊh)karLr*OmmX{P[j+>q i*~ѧU{ ֧uA`@FʜL]nᘴjďWoC(cV\$F9O6bHiG4*uo_[OVش73޳J´]gIppqNʪuǫ\n 8?~1z/ƹV3:WW/zչB 3cf "-RUJ!%ê+F⇙!+}ҷGŦhzv͢GѿkiHUd]LCgAw'@sf~27ُj؎̶X }Z=(}*[víYͭ6XS[6[~(I:YYk{TCd<c yF)d:Z$KsEc7{`tqﳔHPz4RVq: =Th,wͦ8LY-8]>2cNiNSoQ9EϠT B8]Ax !:v A 6f p"\9qaD w 0z|0:wwA:5浴f_*tm/xN'r,FpOKKYȹ?St3WY?+d=`Ѝj\m`GG_WcTj.9* )G¾E#[Bw qIOL^P\.>SiIuNZA*d@Q|$T9bmar\Jm 3â<7c9?۔h;@\qrHsh RV%hd&u93=e J2RDՖd;ԠO\\N2Z_d&me"0z]B` j+MfElט]R}1O>i7d 1,oo&$OTckt[xMxcdM/E{y'TakZʪYyY?8[ (Xxp"ӧ82FMVtkG'Kid&+/gKR[:8&-'JEє VA,'{n9F/8 |yxxrV$ՂT%5.2偯mg8&|/G9d{91@F (Qy#L[o:*m|jϒR9In[&rWN);w/'Zfv2bw&8mR {@GgG_y] «טow&*'/ {_4Sc/ћ1[k-HlB~w{3^3nf3ƝdKi,iION7^;T5$}0˥)OURs;B_YN%Z F 00odJ&K[)p'68_UB3-]yw!n㚇sK;=n?+XE׬^oah I&>i#byX ({2/w=FBnrYCQِLq۲ȎD^# h2Out=N $JW (wZ;fuXgOᎫ.etrXjhpENLw!JfG/y%%v.;\~Zvty$g1.%ɟGF/\è}G y</ɵi*~PZsrqlc&(#Ot{U̻=N>I<7fJ7c{]mF>%eS$mOslj;IUJژUe%V ^/Q? {gע . oНG`, l1/{Pt/&{GжOtAZ4ίx2W85itւ6̶yק<ҡ̐> 0;vǢCaRl7gA胿EYϏLmmQ*;*e/ꋂ#v?4Ff/pq 27~gjZԝ; jPt{׮]2 |/T'ã}` ag1$|ѵcw!rc;IǰweEYY1GV9-m *N?›=NTd/B(Eu[0/*'vw6͇rh}K9ks8E1 b"A~TwهC_3)hHD~xqhv h|W;ڹxyuvLz7.AS}[>fef~ 5̮wW|?0S3Ȓ? @|pTBgo;? <頁9S?2A@А< pn03+_(cX [q@6_\=OIއn''{6;O xO=?w(.g*8Ş4VL/|`vyĹ.͠z~8+ mhqpE# `0xtR43Dvznο߃i4[0U 99؋::k ϱxx_ =7o}!3R?mI^]Zy` Tp7qdOˡsYsymq!oϙ:z᡹ ->_t%f %\%@?,ؓ=Ϫ$ɂ\ؿ`fb6E(I}O@qp˚?oBI2@_{rwь<) ɞQq~=lq~~G> nDk̴ _hA9տhP2#ˋO&l㝀t}@N wc=1x _gKsuUaL\,Y~^y#21=1Z$$/(՚2'H :zک9+ABT p/>6-&m E#H2΢G *K/)n[OhV(5Gʕ(t@R5-N!)L8NeS"mԶb4{-LxWƅ\& HSZ7-0B:h[jK"q6 ~rUtN Xg5靀?sSd dIO䡲3R샼~ny\>o 8\Lr$'˳#kb"u*Um+S4R7 Vst!u rJcgU6ie5j`2; ֈ}/ʩ{GWҍzvg\.jSal{gD9%wz * j*Sp7fQ9) =lYa^$ [zضp@#@N,Pk$% sqa}thzJS#kQWmq]sqKjTmC1/ h΀]MKV~SYɁC`!<'?ENp.NA7P؅5:ʼnefª$rh+k39i} ʾͦ$Nv​pplQ6ݳ 9Qb|uMIy"b-:%Cs=di2Yjq;4J#&ÈPk &21 =HG9&uv|gήi23RaVbA"Rl}x"$OL;\|5o>b)6TO]@SIxH$AP6ݥM^??^nL!%ƚpOjL{&%Š f\+!)pID8W푆AF9#ٜyV8UѾIgr5ldG7ĆW92_%ʳ.a͇$r.0B{%D,.15gIJpb>zW`Fh\nz1xuzhJbXi($ ;EY_#fS_NahzTb=6$ͫbB)wn<2UX/?XfB>nv7^uAK]iRI\IN5.ze $x׈mɕ<)UNLKÅ:S!r`<# ئ^} E6$VGqS;.RАi^uCT0MKf% 6>o ZOFW?1.tBbi=v.Wxwzsz˖f_ | þ(h)*`bf-Xt'3m-7k.k/&Afxg7.C E.S gQdLZDi^]#O],Xh v_Y68lkpsn~e-d)k RD APzm ۯSvri9륤h^@!u塯}5)ۃr}Ym UVŚ qPL8978";f[%J aUmUBv&fX4pKpph\R]Wn{ha(W܏yb,}R+I*b4-N 7Ǭ=X 6%ٕۨy u!۔yn(B ^ݒ3Т2;d8'4%c ;Rޫ׿`Q) @>MAKS@2dEzvz,7tEq#(23S:E䋚q]" $ۡGBL%xJB@/o+&joNl6bAis:W e t$Gc8Aˬ`Ԇt~vMQ^h֩?'[5WNV4ٺ,cͬvӦ†CN6+mCX3#Snfs\Q rᠼr,rlOÐ hN8tCbTP2MXrc; X@YW|*C+3"689b"J|E)ܵb3ywF1I7=e 1x ;R\fF?ZFgg LKeKXlL)!_y}*{ 2:4BM/r}3" ų͉!PL`/GXl:"wS؀,M0r76]Y>)-&b6XAϾX %غlO6U' @E:bT#jI#ys].]铹5 . Sbh!F]uv:nEQCpj+ N&H W^XpPD@dL2] FZ ؝pMC 5|ٹh82D4xF&"#6fp,-9; ‘EGP= ڢ_."kXi]9Kwk <=h\^XH{Td4Rx|Xȣ6&byٺ%q0-FsN첇nK@[搹Vis?P`@F40-Vz-#@)UCc?(iłLeT 2`!D=: \WMN'|𑰃gFO8eF6ƊrT_TojbyQucsӟva..E^3mY3P N.'JT>-0f{ȠHN*ka^A n~Ґ)pzhςeA1`Xk:H (=_|bXcc͟cJ_|xnVZ1lc [%{:{}i a}ǹ6o4B['AI lXO Q{Wt=p=UFS0rCb 1 oG`!Yb-qC m{Ş ~P#\B>1kW)ɹ!:Wl赦U{aowpf0^Z#SCbi}jV)ZS;`% },C Q~SPub3hfΕ NH$Ld]Qnr?aFB+.TTx:HvVzʣXnd"A~`ًW:bR~F 6:XcwtETC"i^ΌpQLZ/~b}'m2< O!VpY+돢 8zP/^uIJKN6rɪșH)̺g>ٵ((A$Lgv\f] :JUR$pQ]"`ud_9?[7)1Sa&Xf|y:q+V2: Pit})̹aGilEñ|Q/P2?G^xxe,@ҍ,wHeP׆&V$h1-v쎈DqК _[?{쵏ʈ,36Ǐ?^6-93 J_ݣmfkJ4FȯP9o^ވPuq?WqNNi\6_e}1 3LY9({2yF mAI|y;w;2w\g|7r5f1:\=vg3 r\,@{NfSգs(0}W5Id`GJn2U3qi>!4*=q!eI!R"8&sͫx~=ׂ51?̍HfĶܰU= q'1S 2iЂvAiimC,k3h]P5iqq` oL2*l|e_Ņhlb$zŦcYMR:{&7e3(Rux #`]Tp0kqa9 6Xڝ <سPIssqw(SCu^a-ӆ綺~2#O cVX^%'$baA'*W`Ic< H:B!s20qPYHt+/H e[ 늌,?V`;ն 5tjo?,9fп''j1E_cY޻g\ >Z?bkI\}#zqQ8J`VYhgmQ@0$\ݷeּҁ'CPabyI.8F1zgmlםb D8|U*rBǙci릁Dt6({j9~xE? ih)k$ ד M- =/5w@d+/ NאWZzE; ݶؖ~q}hs.]O=aE;S'|P!bēCJipuZ"K -0xkE6 u6iX%_!F+!%d ÑIh4 cm%ޞv(<3p(ӽf$̎0&L;d$/y6?== Yo9ەi <6 OsFļӚf4bI^vF`Kf}_P#`4ʃq,]yl%<.%1g&`vPR]:(UAvg5PZ8Gchsپ FRϨفo]_@2p. ^ cE uʣ9l߶ok88KaN$n YJ{鳅Y}yuy,b7 DZ醼P'ފ4Q\DUOP ALӈ%!;sW'lH'S,qF6;׃|ڡH@2*N:/K\Gz$T2X!~)$^hLUzcFj=|y /qxJYⰂ6꤉|fZ/&'v; 5Ue5wl*-g9DH,3-sv( MI:3yUp-iNQK?8ed1xAqN&ar =&d ҭb<'w]emDsjFВ6MbVyL06<]W6Z•!m&p >yJdxrZ@< }'Fz}e +#ZQ =jbMHD9 ̬";.0=%vnm^7v?&B2rh> VBgĀJl8/_'c?ѝ)(.bb^1ºN1HmZ%̿x1unr< ?VOy^Y?!gC8 ~TWWX Xp6A`‹7薂F@'-ѧŁq4dm#i*¦RYۘgat.tM0ba8Q —Y9nkLʆ<@ 0fQI^AFfn|j+ a,QH}6As?[e~3uXop ,#gJs5?,=<'6]Ki'!a]LN̅@K׉r؁nM r 19pi"Ķ=<,h t Uux2 3( "]0.SQ[t24Txs&1EC7(v~ F-D!q˲f{q|^* 'k×Xp ~\E Ǭ(R! Wc0yY N2P" N3#| , &f&Iy${/0b&)A#Tp[H@FT4NUQd=\5GG,^YQ5+?r?TGo󦩇e.-^ PWL}w 诵!4> g& m~; e!r$ؼt|Vg~'I*d4S=[[[F(kfu\!)9%utƬTG>{j]-y^TK6h5Z>AhHi.rA~w!12 5Su @-|x6)n;T;6 {@ Cj86;[}[imS瀹@_k}=<ykW ~RJsݎ:+ Ga6# ktv0l;F,ZNBOwT%8xi=[ :Lbcujq$"W<:d]%d'>LړViݓP8g8?9iU'rbw< @<H78O2ئW\` bM+L|au(GP]?%ӯm\d>@eEaɁ**Z)*llBm5kyrAyxAf_HMB[pC $*Ĭx9X .y8#>i|(;xkO*"?l+]H9%B6Fۄ'yY Ɩ_g:#ٖ`Iy&(HFp ӥ6 ^TUb/Pi:c47.JJo ͌bk uەbK"eitF*~C1W10Œܭ9D%IBjQ>bnJ8D6QN m` 9uB 3b887n۴KV㬖vYՓ hY=ϯvhsϗuMxM2bn7b )xۤdqҲMP_PX'噑qEY7h˥)X@ĩ-1R>Plk׃>ckY3DD(n7\p(i3en%ʼnia e=i宿YQBoEZ`83XTd/wWm )A]K7x '>_$O( ǒr[zmk[A赥&ƻ¿Plҵ*n&6)Kv6n71EɂKh53,YMY޲ ځ.Xa#X$bE`_۬qq7DGv{'"D OOW=\x섿h4΢w^mKw^rd[y9-eZqOT ڤX(# SVU*ξ"Х/3g?PE]looH_%iS*j?GW^PlmSMYiڄX yL#x٣SZF)U\\qD Ȫ㦶*'y7h)Um^t :X>4u}qi^e/"p.%P*]|kJ\fQ^kx~ZV;*"\ EiD˃7L.;%g5e'h0)\pzde=z.ddxB ]~R7HyhPM"( tt&Bޏ\뫐*rG )[Ṍ/Y>Y9K8!vtqT[#1qe` F6bPHIZ(ը ʬ..~8 l8(\ʀ*osJIGt:`8Ԉ%AbB\ܿ%ݦ\8jU?Ee.jO%]D&ҍ& gѹA#-wxp!Qܩ&tR#c9:=N &aNG6G)&Ѷ EM8@dX1&c{ ^*u<6hS H]@^OJ1#iNq/WmKɿ|d+6ODk5Q:5K2G)u."ۘ'/C,זmL`[Ե[@S B1M ,uɕޢ*Ųl*򆖔HS|Dcz2'C %Y`%1ЀlDɺ '=ZE+? P r;!@p`X?H3V'۵a[ژ%ZΌ[eUyt \;T,)b0.iTXP)_3bfO͓]q1#0e1א'klZs8m~)X( K2c4px ~}PKr,򩧝scՂ4[17kۉ}סPO]#;٨ `n) @~ VYDi$3Rky|H fS sl$E=b_LA.Ϋ9nkBs-B,DP;;Ňm ؗh?tfCF_^ljf;xBr?]dDc{zzm4q] u5\=y_E(M,E{F|EEc78F]3BpA0lNBN}Ͱ`dU>1bBagY 廝l]X=F f\ qy}WB%AQ7Q[ *.]#4eZܐQ8{/ Q1@Rԣ(D` 'eAYp)f&\H ].X~*Ez~B8}Ԯ6̅dKαQqY䢖rN,9UŽvf+=յ?&!L(Ao w<MjOjIG*Z+Z:|/a)Бtg ~q'V"XRQBV" wÚ]$m@"h ̺6Ԯ_3"+QHyq.msg=(w(0?)%M\A{@tlŦ{+2V%/! tI hVIw686 !, s%d&hۜ))֌E^#pҧk98ǍK`Q sʗ|94+ 5Ā&J6۰} +/Wt4Y󛦗v=EU~ٰRfφhȖ>d' G9.M89-QmL8Bq{\{[KhIlg{V+RPT"w?{IɈ46Wtmm6/|7܌ȨP+cy!8_:mۍ8z{t6:d ʰdzxM)R5(R!HQi (\Ct ~x{VmׅOؔ9nˋTBJ@2(v0)*,\^^VVG?7@MR`w^1*ʆLY:YYOGka(ΖJ\EfpUe>m8F,!vCqexO 4_ԱZ.e5>-g 鞏MIxa`{H¸MCxܛ1t\<4,%awuy!׀'Qe37ͳbYKRuvWK{,Lz5RA@IxqH?lF% (MJY!D=kg;O⮐n = ucC"McCll, Gޢv|_UX:yX%sႦ.'t5+{G( Ռm7|wդg6鷷\eCvm.)y%V+/i'>@JE+pS0v i*_K7n[Pv(.džP#MRiEwv\݄L `9zQm·|<-gy5༇}Xط~TM &<7j:m}ei.6iiM鮸1LZ5/5ٷ@5]1:N'>(gM|~ɛGO^yclFHTŋo >$ |c&ϝԸ pOWEgs7UUka#V0HP5̰}aavyy8 ]% yn9̄F)9hF3#?kwoMZv@?KiW[d#ti!t5a"Pb(.(YCUh7;kզabM ThCwH> @mnWżA%:"cb`<# y_;;`sf2%[dg@֐b}XV[΁$i?u yPJf[P>m^Qh|K@R04׶0Fo_]ł3](Wm٥ϋwE+>eHmVvf}A:T|9Yl2ۻW7l>w?b| g빊:+lb٠1=p(>eB8N9-/_erTX>栔R}@\LS9kc9ND$Q%# es%lCbypnej"\G4{γ%`e)@RhRU`[k<qΣd9^ir"jEU_|˓ʸB/<1b(>N.;P|lƊͨ X FsP-OVXH-uOS:RiLc$C#qR 1VGx] 5`7] \ld13{qx%JB:7,k$p %d6I gkVjK2UkV{{b@|b<"XDv٠GɃ)zh/n KC!G6S$يommG]+(Zepk[+S uYs{7FX];ATjyņ[|[/4\.AI5Slym,FlZ@Aui96$S F[xkW+_}[# MVdX~ #X%ʬ~eV2q`:XO)E̳dRWzy@bl`6l6;ovN|* wk`nM tM" )5ʹpN0=]Zh-M(,GUq ը ^WzmOyT<~'LaWY!o0I ;a'/jzbpUq/_i.@V F\;OtD T'rxyJY95R_"bA]te&~[ msoy#~^E8}؃Yɚz>߾zshVUEtL=i,no}Aȝ-H*[̇ql ,7]S;+}z$ShMnqWXYjJfBJNF?OncX)$to'd(8-9Nʪ4䷛~|-D3fc3niffƔgkK4,]2+'V|i1cNO|G^_,rPrlQ|(ڣj+lǰy-y`N+C}]s!+#GZ,?77}h21o6ajoa'gh78@@u9G;8]sUy9 ʟꝃafҘYFlj-x\o@iB*|4ޮ f0:?g+ǫ tRzɱֺe5/p1 fv凕uEд0XnZQu>) at;Zcw on }:QjJ"i@W4v +A0U}QeHx@cAAp%\Զh]޼keh:CݵOIA?sC! $=|}5LX]y(Ѯ=$%Ǹ&Ebzt w"qiyM1OwE}֬`FR0CM-*!f93 ҟd6ڱ0w}K@ @8$*Oqvlgy'%Y?iꤛ08MԽ_y폫=O˦ V]{Jo,Uh[c hW۽Z {pXcj]+A4ƿ2?|KƂh FSucHB&7[0k-_B^EX:ūG]o otM'^>)kFqz<8J#FڑH3UcJ_4=i1+÷+?ecuβ/L Gx9B8!D v$~\" zLjkOkɦAX!SA7t?LN)uYKk[҂BG;aJ{|p]1Ձ;7Kouv[`%kiԶڥ]f` TZY^U앙6û٩ٱ}[fǦ 2gr?zwD6p'-C1nǻfϮ> FBrQT|(F 5 ' "foa^]r-uh-I tnpI4Gt?fka*K!L!?u: ~eYoö#' NEk|/£ǡV6hH#X+-^,=[t  [!CTTzT7it+GL|[ =/BT$_ux1 H{!]A ۀDWǥjקsGo]כ:x{5'j IuVLKZ>L{V>]J!hh A+P ȹmB6mf˶;,rLGQXkzb8ĦF&TP)jE]QIw *uw.BwGZ*GK*mwU~WVM1}+ rk+%VnT_Wb,fId ^r4uΟRS2 Ra`KdU{Cg;^G <|ho72[8d;A zS)jhqL7J &^"JPh|6", UZM@c%U>abf>0[:WV`oG1Q0bH0Nɮ)aUpiȨinލ$a?G;f!bQASY%\.m>GEr ]:l@TyM8lv]_*_Jkʹ<=%zXD\!Kk'ސ䰞W6Eؚb/LZ@Q\tsZ̾P p\"zw{2[ sCZ|#6fCy$@k|D;H[A1;ͬCh1+z(7o/Duɞ[1EaaNLYl"}.< 'nHcsl]VB6U!1`> ;$ :٫8Vjof&jvCtfwB\eq7hf;Mu+ Vhf`a#xcOc F$U=mٮ/vRԖ/XhR'ѓ,qv#XԬQ B!Fr +*CD{ Aכ`Z[Gרo < f iGע(qa\> Gw p ϼ<ϐeK7wVmF ,yU{9o1},"r̃ 9G#-՚xFpPkG4?xf̦ZXf6fJk^4]ዠ?4JX#R1OЩ)wϲY/~#D \Z[ZGn\?YzB#rпxx'i.(Ʌɂ Ű=l)hH-$) qճUswKٚjdΨ1 ̈zNQ s X:фHc/G7FD)lZNj/I=dhOG\<}=wdIE=c:jfOBRteFw- t46z†hg1-x HH/47mJUrމB[Jz{uMq6vɆcx_>~c  7I|rgBzvtzhϞ>ֽ*3G_浬[W8lu~UWW_h KmtI) t;VxkbMJ1ZGXKH\'32*}?A5n'~GK;%FB{Lݣ} ϗ4F*ޜ24t:">'h"$PS Qd+{iOWeV#HCrKLIJoSVE1+7=NX(\fo٠8A1\OY |"{CVӖeJk|b+~ 7/!"/q}2-@9.Ɍ,dǗndG/n<#wġ)H7 .ɬ5 {5`+d4v_JP]r;yHy wqV]Pn[1n6,i4]R[y@Sh8^(:2yeK*_cP2+/&7bZOFԫ=״{VQZN ;GD), K5րъYT}}tտ,hfhY7M+^W-R'e E8AשG'yS<7E{u䰸zjl$p]6I-Nq[Ah諾Gj7,!\tn_lՒLC BauUt,~QEG*::k);T;tR4 ~T3Q ,rQք sQ"YQ F08Vd^I(eS7*HcKlF+$*\ \Mghv&,P.L>+r \c1z\@kTk64Av3ywQg洵dL7\# AEfs=4 |&a@͂\({W18]EdYeC$(HQI^W.2+R=UT&d+q嘵rmuX]=.̭DhZ\~ClF ]{IX(Apdw(GcEw;qY.^U'+$yIK)NXrSYon³-sVnZC23U̦[=9 \̖VbZHoNDN(K\͗ Jnr m< Xh 6`n޴0cl)蘬lY=V=UJoP*j*5 Md/?i#G( ey鮎0Zywu9ʶArWFHafGn; (f%HC %kG15wi``,}s߽-^a: Mʂ.hl;-׽k_m+󉶅-,C% B8ߞ>+P.L! -Y6/τWh%hoj)8,^pq0(Ani/ )DRX;BXMww}^ *ݶAXfWJP0~^V^=P cBt~CwnD9G̗p'h͜J7¼JOh4W3-I8H @Q2G6u1^~xj}xq^LYY[e |੧}h)fW4M ,AU̾t ).ura8SJ[ /b!P%ߋ҅_)Djҥv!ӈp;ox5ZA%%Kg}8Q{ژTWaw4 E|? B! -Ǜ;i߄Bf /[*^U6?Lg@KFv{N[VHs V_7!eE.ͬ>22py+`јg$w¸G$G5Hr&K#Rc+FGO_WE4M5"WLx|%2ҋzt?ĭ))ef_~oK|Zq07;JK0q0~@%K+yߺ {Cpo`UJ0f~Cs Ĵ^ o*Q1j/1d1讙io-`/wx#ny8M3RŊ<~UykNۚ+`Bh20uvKP5]j,=Jv&إ9gK,Uզl= paH P1zT6SA) ~v_ͻQK}nB;{,|Ih7jI>/*gAe!B,H`BsWiQ?({AoT+ KuJi9viV͉3l;*n>d;n&pO& 6l ܿL=*}Ǡ>gK!{oP;W鸒tI~OpA \7`;w˒~Hâ N Cg[: /;nh  $dE)|$/j#U 4yËΦ5$7jhS{|=-8 JFL]@fSܗoQRsM^ IiT 槦ߧ$%$,(QMprL+;nW=SlmV)xų .>-N<VoDV* ~Ŏ6W, e Տʻ&]I1" :jeBd$W4fK{Ia~rd~S-bN!$jA ִ}gCb[Hj}`[Vnȇg)%7]f> b['2_oIiy{ڃW¾X=ޛQ~ Cde^TKG)D s<ǘ)B Z!}Ez RLCnvd ͂f"o!ACtS 5cZ*xĀOG` 0]wxs$rt'3!:ՊDqa}#.i>I4k`iǦߟ*2#ߋG/f}zmy_}ڸ}tzbw˅ȝǟCWqNOüK*RÞ1XUymAq νJ5w݈ab<+O”Wx56_PUn+p+Rhgv8GrQ@O@oogFzȼݏ D+ [#k ޔԡUR`@ْ?̮6V^<γ&oZ_ cNMgc?l>%ud/C+AsdsXcC6`b{*'1`-%npvw|2Cf!twcn `5S#%r@T1 QF{b. & A'}'l4vN`g> 5gƲPUm&&pSguVWus8HCecNaZ!h]{Ie=-FsEI(j50`fx_ R`H>\Gшߴص{6jU/{R/9Rȶ.n b .;ՖKCL[[G[BZ',y}|N-S0c-3@h øԜ'`lbv5ȝ\`qGM Sgɝ~{ŵb[Ad9`d#4)*Edz.mgVju~ e\@h9=eE}eۋ0kOnW=<=[ ]k8_̃pǘ ng|{|,S t{(qكiRi5/ǦIfŘv0aju ڙ`Y%8G@RwoKLr%Z<)~ꮀYrTw{VN?MAW$Z^>;dz7WV||[(3gI)Gn"|;]/f Nɼ %W6URN>|`X!\@75QSZ>@{.2{@>LAv lrNϙgUgޤQns1pV&wyF^y)Qta> i[RH^Inܞ2wxB-jSЖY~wҳG^ Jߪ1VإiɻWhO^J?Oa|UtU~xfmJl秗mhvY 7$p'dWnQlCPB9\Z8iX'YuOgmVmp @YS!մRT 9^AXE%Y@"Chla` ,'~_PVMxIXЌ)P務o 2r !"#Hwrt6ՃYr?UkBj)]R/KɼA{;ޓrq*މ[$8O!d{E)ӥ0)zRF. *gn'Ӣ:@wn8FW^+0M@@RʦL+E;ʎ/ے쏤!0$GHeuy]}(qƲE`/UUǶKU+޲x;.@.m}qO?ʘ)%hR {QB i{8ڠ@ ji=*ib6[lx kv7zPRno.ӰLb11xLgm-P'[ַNo,$kuhcP9S^X)HFLg"M#)4oNI?Vݢ Ӓc5 O&fp@JRqOy;*ct*ƻ}|8PFMV^_rGskil2vf;Yo *vBŀ3%LB]@d'Ҹ(b23h;>WG30%#_w0Ԣ'b89c2۔0(8 ucm阁wf.)2Ne5szOᘏ(\>P _\&l'(=󓶭k&0bh8dQY:^@SAuNsAuy7Б"ь58k L{)lY![k6ýPTVIt% qZۊg$޹>^\uX'AX)#@k:ί} Xܸ*V^N[+:c|5s>+ &]tt4VkPnA_G2jY&(el:Fqv0l"px,}Hy#9"Z4l3NZ'û %#MYn4ثxj"FvAQ^Z4:ۍڬ#;uY2>!,4,A]J7yƒ h~^u%Tۮ9 {g}۶H@R RC[3}:]\}dhQV2Y屢"t4.OҾ n8 -yUx7#J?(8SI eo .>?1*3@bDԨt`0xȇfP7ͨ07,+DИ9S,-+ug#0ǫˮC5KQ[hI lQKǹ|WH-]Wz?'sj9*LdzU _G)˃&5^k*)*@m:Ya{c?TM (5vЪYw30z=Lc,KX;d/׆4(eLAq!EAdV7.q@CJq0tϳ٤ǒ9!86NfuL#NuV=hb w/DJpa&~K>rgO";ϧY9?_cƬCYYm`=?Ǥݚ>,2BqȀpU_ɳewCaB+;iy jJ5R~:^΀# yڋْ껱< Xԉݝ?7k⳶:9 0jBl x^bhtM50On"!o]fMfW%QTe ʚwz'(ƹ!S_O'*I R$ e!<LkL:lzÓGlPc8i7E`"D$4VWrKGG\Sm }t)ekʉN3TZ } ]a_<&7l)Bx3huvs5rMͮkYۭQX~wQ1T3=u՚:t5jj" qAגN;6Q3KI6%wX weү'SpR <&8ߟ$ kscptx?<"n\ R[F@MðEs Rx4.7 D be-QHVB*~aVzzt#m>?ܔdEؐ%j((Qé\bƟ~*-25ۧ`>{PfN(։ \_*pӚk,y$S+@'5pAƊ!OIb T)dou:nr;AJ N&Fb7 lDTms^ʝaɜ2Uk ֜=Q B`pYI!O펻M0>{~Fn;ɂ(a!C)q%"mbM-G9jr-qsx|w!+|9CTFGu1>]X<wȰp1N|z|^'oiy)|)ryt([`yg_MfoT郛/0Np$aEC摉G!N]-\ Uu؇ Hϔbmf*Xj_ŠG zfʄUu>~޵>Vcka9ZI3=#B#f-lg[.,ڱ26>DE~Q|DBJ-h"V]jx\UEk1:8ӦA~t#^zb\!3OVNYj0"JhrqiGUfLup1_z>2(íH]zB gU!f՚䝃mzIh5h$kXK@gu\J@OVA2 i`Sč(BHlkTya,aR~xt4;:7zAٰ]xid*DMuOg P8ҪaC[Pm ?ցd]E#),%qnQ7{k yr8'j;_KU۫'XSZDtgS 8x`%/H+nH)]ۍZҺY[֊Ќ4*<&N/%i׆#`"y}w[>\'q#J"bֲ]%td4=RR#ٴ/(=׀(FMk@i*Pv(-N8q7{Gڝ~㍳.'*GW18 =8Dy]gs ܤw@__+o,<5D-޼lClN) s7S::y!lؘpRT&2/+x[Vs`dQFPͳә!b``+ڸr<]@Pb܅#Xa_mK#fZ"!}xveW0%^/kj_VjvDz|ܜ0)쑇$lQjuܨr%"yiy15HaQg k"yIgPC!of}z7p EFwZ 5.< vM! L snZ2؟\bhϩm/dXY3h~]hE?\T=NJ!Mirdm( >?r7+cvuZ naB&8p!)^Em f`~ MTWtd(Ӂ{7)a X xPt8n)8l薕A+V?dh׭"X_&)ͶZغs@Mb63<*bV!k_'?=`18--Tgrs ?3Jfg]U"KmN-ёfp mt͑?tn3S:ٹ\ٴ fPr#0|=i ojMܼ8jjãcBǝneʌفw|3p_6?WW+!x(o"֏l\kW!֋|N5rY9 y2F\@m6;ғ-"Ɠr0YP0Iވ8/j^ǵy`jKlhzW!P6_<j`X~f1~C;4t> "yմA9z26;caydE_ 948[5PDBK r/ H^-GrH iYǭR =V[?R$j{YIҖ >̜M|66([&ԊV<f:n |jffie ݑ9DQM%/}?Ϋ 0/+S,\O<ۯ'&[.G-**XГR܇ҀQ_78y1xU4o؄*Z4./Ar "xZp&#f,KƢ+33*}Jtv{ڑAѸSߣ1Qs:4)M7OhzX2 6xWǶ1ی8=YPK&[ad_p1u:l'AuMO]CC5[HW ?BGg宎3 &=r\@^ZZ%#/CN,!m \6S1 g@+5RV~WE>իa2T]X%LG+I5+r/ei&4Bn(mĢ"ˠZN`DK<5-~8_Bj:˙ҫ7D FgCz\}z ԔXyPBVSlIpɳY>m_ð,銬(8m5h:Ui Fw9*AgֹU;n7)@xcg+D| e~xb82F*Y Sm $! 8?>o~x_?|jt1L1o^u{?:5J ަ;/ٛ Ư|Ɂ)(nEl4.%lŕ)g rPޠz\\e l~٢iΈC."ƹay+"* :z\Fm/)6U~!P|񨼁x,^p&H(bbEuvmJ=t"`PRFd.9 n/5NlG^ }~ $|Bo֞cق뭓jy[Z~ -?n`M5p/ߝDUfڽQwQ:c5͹\UK)4ZuUմᒩp!/.ûHjl]<=-@]ԃ[ŔØ fw|4/Lpo]-ݹ݄X})츇\QMuNkoԺ)(KL`f9A#zqH.^xCeZgǽ!yc@W{Y<\6ROҹ=PC_ oש,@#YM^/G^1KŠRb Č1'ZݪZ_-WS"[Iͣڧ䬑8>:9[_vz{U],;BׂPY 7^[ruLZ5: %+Ne=]3UrQ[%y]:*^Sѕƻ%J]Dt%S X0Ñ>`!頤]դwiB ɑ=Z$dCُPV_(+r?qtCs$[ܭc䖦[N0Y,D *ȡ]vP>߼*x-.7+f%xm4'iWвv@tWS [FsuCE.jϿ:j.bf opגsCs r 7Wo]| ae WECy'hWʋ0A0'I &?| M o2yӇbhqzZ۪uw?*-5KX,xޥ`C^i|P͉w0,91(4*1󹘟>[8*+ܤY?݇Kx8v%.fo7w4L ZCPFH?L۷y\|?rHVU21@ Ҿ !wɫ8Ӳ"4RƏG[}^GdWZFO4ݽT;Y0v,a`io@SdlaWU ,:`ݷGf>r!:FgF!70;j60NI6wpPp M7eU`h1_F@. tTٹ(ќB}͊ႽvinD6lm|)2f܊s|M>?۶nfcʨٓe'=42k"H Dyk~U$=H$*ElcMlX΀}Xla Jb[y&Wj!5=<,!m3eKCu%_xs4qmRj#*BЬwl:[\`kh$Ep>$'xn$dKV#UbDE|qNO {;e_OzHy)Pd^nLx_]3w.փS\WX|d/ ꥒʑ-x* *n܀~/l@6k5R'_)ãlzPh4x/`m+v+vD&$#8:)ٞE3}GAȎvY% ˣ 1 $BͯsMI ͼ%("}DJ(kғ@nicno:(Zlbov|>1FY=.ήG,YEx.%;3r tn3 `h>"Y)mc/1%-s ^t2uǫHpJRD,[e4D a-1r$zj<|S DJ/JYN o2J mܺ<ÛvwӌVA>4̉M̹9Z*7z{U|]" ]NqG :~ E3FZnOKGjipvG ;ʯ^Paz׫E^*GkJ>W,+K`8) ꦃԌ?@f&!i)Y5M~D0Yp%WDMOP^ؘ=&a$n⦊BDov eh!A+~ /Xj1UJpL$rU3 =1ngQ 41lEg6o1p!Q׍/<Zl1}ovAy,q9k^Cռ0n{^0m%Dۅ,'% zrm3g^?S{󧆚o *{ !pU%(m8|_9z6>4~hͅߘWJsOA}Ѫf' 徐G"rHK-M"Rś/2gjvh+`չ.* CMF\`NmH>dZ;wj h'+gAxU\VQqWeblto҉g Yte.}Zu*::Vg].N\V+%dIFbj'(v@m[^Њ+-wAq.imp0NےN(4>2jzI WǢ7,+Љ`<10\4gW|Hf,}<+Y~!T :b-6FTh^@߭й}lI3]vVˡGZN/ZE鳣DZ:h"@b@G-L\ֽ7HS@8B%!jVCi|wd._E,=rqYoV-sn:_Dׁ@υ`~k- j9@ 'N pvD KԴbee.f ' >ִީ)$1 ppKSCW zr^<؆%!>9 ]SvZ敤/k5Я٬=+*c щx:Iwq4?t`7gI^aT~Dt =}ySN!Uèu<=i6mSW~{K-T6k"qA5( wQ1K*YV -hP)nz4!*Lge].FMɸj2{le}hm>0R(&>Na,"Raj:4+|El)tI·>^ܝ$4A ֩|ڵi1(!(kaD2VL=ufM˯ sLH YLYK#.c %JGx5];,QӒLES4F"ئS)F\ovKڭ$r ѸUoۜ(n31$wU5=+;OHĿ:/=7~.W4K#qKBx?T ĉCVt=Jd&XL9#3?tG:F% ms "XpF^xHYpf.$6n-͎*b>ȧ6 s$R{jߦ Eǎ˛<eKiۖGG:>YNya"{[0czn lמ ȱPD>q .#G!G!؉.S>:Z7n$1>}D-c ݼW;0S\Ͱ>sNjn7ee)ޖ?YaAh|tfl10pZr<]@pb܅<#w; 0VKai sk{Ikˆv/dఴ4֩%ow9ƻ'h"2=8?[V#6|byK̞Sy6-`'MaH` xȔOˁ)uZ KE턛Cz̹YE93/.1JEk` 좘OЬd3-ъdQUox9/P*au@eg,!& -LYڲVpe.$Kٍ H(^AA24SW;h{"?0XX|qa^ a[<ؖa4a-aaG?lz6YL1ne֝^XԔVMA<KߟOO;XE+u2}VNGY>33JJ fg (ĵVۜͣ#v~?ܤgtu|s72^hC, G>Ba Q{&W͛*йyqԢ*ՆGGG!;;.k$;fm~pW4CQTE=1ٹ2Y]/9`vW2Ff0g$3l@ p߸{uŨm & Jj4"a ǵփkѸ=p^ю)/L AQpא3%<% R#&՚_@3`'cSn~> C MjHm *r"Ɓ^Jp|a@+dj ]I"M| VK٘ʭ[u$jP{3WK0#2sa ,R 86x [3 AXV%[0鶛EL cl'G聳}g2u7=+2`c`FljG# 8v4+ᵩyLnq'E>9:IXcaCO9A*z Mbh np^ ^Uךolv\Ut.OW-HAH$`LFXYE{GmgqT kCVnKbGޒOs6D ō+M\l 6󡎴c<1{:㧳ZB!Y"% '@mM3 uRE.ij},gO EUz36I('dkˤ@0iHYÀA"Hдdr4<-7 ^ 9ϫgHΆ63A6UVއ-=5ܵEc% ZGU)ɒ⍨`F2ƖS[Cv'ܵPԵ삽 ?`6UHauԆT(Ț 5i5Jh:GW %ɳY>/5J ;Y6Y`ĶȞmJvC%H癔]% kԀ3}t]/*ne0t~1Us77ϕK8Ijt<%)2h-<1@i!#YyaI}/kExV![W|R~6nxƌ3&vԮz F@1VvRM!L>797Fp26 һn6׺>677s{wwmonmmoo~u=C;^À`2ƈ"7}<2n}~]yʼj]u[F1kfakla✈4p1*b{9iZj؃VzΛ<1wVi>3 Lz{Y;Ow:oKw\/MUcB*5ΌC-z#0ݱCmz xxQ2G3 ׀ [{WW]ϏM5vL,#$- `/Q^56NLj@o м,ܺbTfy ]иpQ/[mFV (:}[=I\w[xfiߔݿT>-0Cm_'3(@%66[ww<>Xh+]h+tn.u+oﻲw̳qw_w ~̳eͳ{ݭ6?e_ۉcP'5'zBb*dgԻ}ՕeUrn+-Ut6ú\M{FnFD%(ﹶ|ꚹ㚹Ƈ\ŻDE3rZLo-!h2%X"߽ܾ?*^Yi&tYHYX0_'3(0fFԁlU/V͏aɯ\{f5|^}+*.Lffah_RG}cg8WOtEij%ܾMF5 ġ7e5o1M*^TqTF%}5,g(vXl2&C9`T8X ݴxz䷽c\Óx8*s#0^В[3(GCQ7 <-,`4܎L %7R wW!g|z=G61d%_#%g7m_^B{@O h*o*CŠD/{G(de75 l1} UYa"_Sw o T^oӅAb>L{H #Zvx*G+<,dD >@/| /9Ul}IH__H> Rb~pҹt u  %&$c|>[wB{sZ[jb10fo#Ƕ<_Tj9^(1͠My23 dFa r9UfSϴ13gf/TM݄[2zI. Ev̵P'~mpŶn.Y^8O{5{4M;)Ra92ƀy9r0ɫ4pJWgdx1t*#2 -$:7({,?~J${͇C6WX9"aL +}h !A3[1p 0 / ,x73`t;󄽐2 $sgy98W[Yxuϋ齘 Mv e<__ 9 F7vW|J ya?A(}㬁s& P3՜*E,d~ a!'@$=MNQ&" Mj @z1LQBwl4u 00~U1ġPl#h#<Oތ=x+/H϶kɋ[^8j%a:]BXyU.FP`:"y0x;aGY:G_Axcð TnƓ`.'  3;Jr-N Tܶ4/"3ܹ(_T*YYRP𻓗%|wlN1G3g1@9{L7g'm6v/H8f:[ySu=>j '-RL0_  Ɔ3pEOtwN_;/w f̱ ' c9fFZ劲"Pfq!^Ac1&CIm cȷ%e]LRxjvT'{3Pڧ"z(U#80rDf JX!=&pQ ZW% 1l޶ 7.+uOP"US D;F]PbEAGEj>󩓵J!eYՉ]QU( (a]M(•Qv})4Qk  \cz;(^U)(Q8GY7 HWaD2bcS`'}S7{% R^$z͎p+ ԂVPRfjD})W)#%;"^cEt16]EAf#pmi-d=q2 OXBƷY\'V`QIR)/y)p'8A1W)>\gEUXܺ#Z@0,g D @ 2k} D۷aGHs"mR# @# nˡCVj ~bfnLLKL5M 8VG9:rCewE&O3#4+$ [{"C7%W|t^vٽ93XSH6 balX;vyYjpޠ1mmp=f`:J:\Ȋ^iaOaYL=(S{Sćh}pvg,([lCv Jv"{wf]-U#Rfx6,QYmU @yOvmi!cӬ%6ˤxZT!DiErmcvv$`׼Mw,[i-3gmJۖP߮l(QͅXvlKh'_Z4NBlv@S8Q,=Fʒl̹N.L+&#|n =p.6à dvHV#ڊ,FȆ5Zj$h5$@%5[¯'R_oX TuaD!tb`78^![ȅ=A>.f))/m*T)TBEP9_Á>yqXZ\AciYP[ $#bj$!9/=zI>(VX}B4%aWtHaVBW5(v #VRT=yACLzUG,|(@U2QhR"bY4abd;(epuXb$u+V4^N&]30M"Y\BfŞ"0(wSKp`銓m ԃ#'* $xfݵa+ ?dlPxem\V,/ ~d#ˍh-c/w'б Aʦ|UZ*ٽ)eGלuZVXúN<v/=iIzib UT_+z _$cծ5JKIb^ IBf̅tS_-|ekJIgnަ &`Րss/"6hB̈́<j)ރ*Rc4M+#T5ɻ֦~{N3=8mO(>zpH¹ĮJd"wfd _Ы0! !!T |Cq՚5VE=9x,!wyVʣ|q6xI0]g˩i;3f uTVimCWujjC[Aoy;`8\ҫ-<3#wϷ;" h|;LunJD=9~RE+#]JC g=`_<%v!Spt UMy]Ln(s@.AC|)S"H3}Bx pN!8OmD"fPdhut Sܱ;r- kvj^P!\*3ЕD&`rA[7NƬ\5fra?W3K2}ix'Q+FnGRP"*XAR,53jVxӊn]`x i'2jAmx_zG ! Qa菋7S C70TczK(Dvuk^%sPxq"a b _T<]FԲ閡55v5 > NAASѫ7 NNW<Mfe! hŃS k0I7OkDml%>+m.aM}B?dzAog,102:`~n:Ļ<I7L55!hiC [}AKMt wHW! k9-Ttx=& ~ƺ {`1R²%*J/GtO:zwТ ZTua?ŠwWZҝ]޴eTYfY`^ Ř]D+"\etA08 z&ڃ$" ⸄fCE17?<7l(jKd(֠)d0|79s:,"ATW"kA=ƞÒ]7HQIQ Z 3Z@RVT_pG.!B.])m;Pդn;CC1$y)b$~@9īzq5 RmEOHa;ûW{ hɁ C ʹ"{Ch] XuaeYtd$+UؠEpBI($b# lӧ-w^..xv׭ 5k7M]i JAӰzonzIdiP.حD~WGP}\[S6}6K2C྆@ q%k($ה˓*y}RǚHį'ܼܕ]pRR6 KZ1k惷`1RaV(=P =8̽ 'ڭrVWB6.Z숊Od% h=GZȩ6b^OɁs&",\P:FR Kɲ^kfucMMVbG:M o:E'KJ!`dǪ6 Z 4\Ԝ3!\PXc,N7Pxxr<, /^2P,hh;7?%Dcetub$bߒ6Eۭsl[ef7qFy-ɧS侀T)DȖa^Pa?O??'{{Ok뽽^ۇU=*XY{J/*=;{DVz{;1^^=Jg6j*E()_qyUP1U٤ҥd&{0o`oo@ظ+K>7xyrE4~X^6pW?/Bo^yn$eww@m7owTơY,B\i5=2l`1s"O-(pEX,_ciʔ ǏHR BY acP>D]?"nƫsNC5^>gA/8-HJTO˙¦܋G|?Q#NAjhXƭ2Y OjFN]Ǯ!#+P]]Gx5zs SWzi:ͫ40,db0m>N^%5IK.G:)qH[6p7~ 7נcjD\z4PRz䖼k0%ƒ$wa0{;4Rs'о}r`A]9jIUg ɵ?qJ-c%ǫ"Jd ,*t'o~ :`owc)}su"nsNOJEpW/_lf??o@ z+* ".}o?ɚkwzq߱N[;#ʣ]C ;8rgw'̀u*?<oyySxn9p6`d9f_ i#r)i lƍ2535U;1N4 vZYyBanƏJ= 8*=1 l=b.K kpR7DT=5@!%VpacbOkm8W97+cB xXiUf6w'+ U8t22OKRݧZP fmML٤m"ӶE>ݡANk%uWanz1Y۞gARJ"@굒*[56#EޛYHV4ZI<Ο~4ϊQy1,ef`csss{{;K=ڼy?ݝ{ۛ[[ۛwmnmo޾c~V, 9COf|޵wkNuZN+VE~7ɦ 6x*exvjnYWdlZ%fOdu9!zQ %JIwۡTJrژ+MfpcȢFflnW$n =Ou %v{ 0CYB({+l%PbcXIJ@ʖA'٭qlxs GQ#0 U 0_]qS_RBD, i8/ مK2G3b1yLE(,(S9 $(IB4&HKZ0wZOq8~M#i-q4#y0 p%I ,2-0xqaD ')SGφ%HxH 4ģt]8!ʆ~@x T JEl!6nF{S;Ĺ4G-:M3X"ٸNTb.e 7p&DSE͍<2Ԍy4Ey~UGn%~G㚍* ' 8“ ms.h04zs76%!ځ_'^Ls%=ũWHH\)'"bm^,Dc-i%<"235QAe9;M27~#cȐF8(9a#@ _cAIpCÉQǦ&*USL6GsԨ+Ra)VGyUJ&IR87]dqOTjtVP$ ^*6+q JY%Y<Λ-臬Y|xdM$3-MÄ>5:3HJ.Vɥ{JsՈm^ KkC᪹vmi!t GUf~ѫ(ư/yUd^?\ыL&=:|R(麕[K %Op~Ts&Ӟ{£j]ѐ; M)[D(!3:`IRaTY({ 4e]'69UkҌW]Le(+nOZXN;h+qL6A(eW#A%:N/0)"_Ais;a FxBIzFtj -Ao7`uҚi9_g9xyYt33n S8t0mB~yI"pͿBi1Bf:E4,[Ʉm) g"5ftRc4 V۪N >'fJ7JiMLym3+IMX) M"QKZU-F)HB_kEO ,h&,z.!^Pg僥+N Sʎ𪀰{J0eTݵ1Cvpb/98XEV1EgFTҶU="9i5[nvn|:| ڞˆ(g=NGeiAc2MKi6ȩU{S j$9봆\úe%v/=iIzib UT_+z _$cծ5Jb@qCl/ p>Fá㔑(Y6HटM]&;*TrvJLz1"P%*jla§^w)A%t^hidFYʳ]t 枡^bli}43aX7d b@З7gԶY^q)D5զ`rTKR.sIKOs5rsORBIQHصzip-ʵt+w]DZE# : hʂ"X5+@]rՌO /=.ZS4!u!(8##B=yzh37q"^Sع̀qᰫ BMĠߚIAlx ׋O#W _ZR2$rWt !1"v7u6v{@MCp@Z<{@EJxcew*^T ytoi&])GI0P8B)tZ3N ;b$|C„G:XS) R'l3jzr(ų5wy8<+]QW>̟Id8#]Q u|[,3cʾQ7JAMk[JCtVS zCW΃׬:l?$&2II)y4o J9/ `Nt*}-~]9Lm6L*W5vv1힣αtP8DvNee, ]-l@d&9P/ۘE^hJ, o#*` lUgaJV#2c7kQʻD )j0~@v[ lL;p.\^M#ÑU;ʕBdϩ)V33_$WFbq=H+kcW*Գ}nUw&ř}Cd̺YʕQ38n&p5t. ۧN;܈Z!4r;*'zY=0W bY7ca$BLAÔgf㏳*wWQ. G?\Hз0 `9x|QfwӃŽQ˦[۝ט.'8U^ORD4638mV;_7N-pUr$)1o9S׉VD+`p$L+ŗ H^iEUk q ړ NƧ?<7l(jKd(֠)d0|79s:,"ATW"kA=ƞÒ]7HQIQ Z 3Z@RVT_pG.F0xL.])m;Pդn;CC1$y)b$~@9īzq5 RmEOHa;ûW{ hɁ C ʹ"{Ch] XuaeYtd$+UؠEpBI($b# lӧ-w^..xv׭ 5k7M]i JAӰzonzIdiP.حD~WGP}\[S6}6K2C྆@ q%k($ה˓*y}RǚHį'ܼܕ]pRR6 KZ1k惷`1RaV(=P =8̽ 'ڭrVWB6.Z숊Od% h=GZȩ6b^OɁs&",\P:FR Kɲ^kfucMMVbG:M o:E'KJ!`dǪ6 Z 4\Ԝ3!\PXc,N7Pxxr<, /^2P,hh;7?%Dcetub$bߒ6Eۭsl[ef7qFy-ɧS侀T)DȖa^PaE^??y=~}~&ҋMo7TᄁX܃$hl*4 Zx Ԭh*R*9 \KPw߼*lRin岕xa4+Fظ}O _H.MNkl?L_>^޼*4A*S{ԥE:%hATVXkzdؾ·lst;<|Iܷ.Eo+U`ԹU=ǏHRfUY ansХ~GVo:D>*Nf UVa-Hl1wU\ C \Tv5gxtD8'=O6?U8uh`e`\Cvu-kLUSsI$^frnK޷0uY@tLIby]dmʼn77N.A xȒRcsJV[r wOOOO9d ca[:.%6'}6'Әk=}őTN$5-/3yv]T6/?Τ@I7Pjkc`e(O?h)~)/ֺqب2\L.U "q -/7*D@xD\M'}/)inqlT*%#ᏋiXЅh}Ef|c/l[QTi(_G[<VrdZ4"/LZFSY7kL^>STi- ad~݋?F#FrqFETIÑ(X}H-N|\>w,,vQk"'>9Mz \md ؞^޳ b&7v؛YҁT[I$oW`"SXSEZih p${ 0fܢɤbzR^*O9 du6=G n*qiujn`ms_Tg-{m3ٍ.NhPv^gwI9RPc\=;Le^nKOcZI[ŕ:d9 ȕZvcODFbV2FZdͦ;Zi?ZQDǸ>:έfM'{,aNGw ӓ:QDy6I~W:~9:f ."Ru8]2T8tǦft|)# D{}_c\?͹3nq Nw;c$Dc77|Z揓 kĂ9d1}x.q/$EJ}IMԧ3 D+bEq}_UnfX _6ѴE\+_xKU6Z޺+^]e҈)Ag?;nd$AUo6Xemwwh?p Ivǎu Qn fm󿴻W+3dfDIkK1'4(%9VJu^{tsn!#{ՙZð̇7؄鉚m!#:Zze\':h色mBuك,JIl"CBEpNĨˌ/Kb1>d)3)L8=]r=U:9H `CW^>YHQ^ģ7=HYŒfIS} -@~ X ypD{E$7g>\Lgw՝3pP{qxxx^z{?mY9Cʇs^?vû{;hN=;{;;w fq1*ed}0] qv ~_gL~{<%B)/^R95pod }>0^ ^^ͨn;@_(r~T|+U.2}ƏYNe3o \xd&$ׅZ rW叄FY .VEPW%,up~^^+"S]IUoP)AK˅_DA؇[C <-Մ5px,Lkȕ(\W1 (^[m*N,~˴ $_ޣx&"HDtI5X M<}_1_Je $aoqEhI=98OƫOCao.!AY MmϤ\Z&P׵h|b%C0_1-GZ"1 #/2;/^ny8gp=P p1R3pF@x 1> jx`d:++@p.Fvf1Q͈#G.ҨUuU#)EE_mJ*^uc?/NFFл%lZ@#*B|Υ_FW@E"4LwB\>h,u [<\:?çְGQfx u'\*_c4*28@ōT,[rva|Wc3jzWġ{?p Iܩ]i5wfAL7 CWd4lKM_)lC%J_ÌPM b&x=Pջ!;AFȢ 3ۃJ< 0r{:CEȤTN~R)C~`<u)r7H{1#:zG봢$!KT)]<؆MƚKjuOl! 1?5`Ep0UIJaiJ6diah<_РKey!E#wl1,)BF /-DKEhHY#R+Φ(KL 30JR+怃ƂCIN _zSFod(&\":82 'k>c4]_NB)(p25z6@s`&dЁGt&&E9ڠЩHfR l>!O_Z!ϫf Ba: '&M>aj(XؒjNY Kk%l=q0 Vvn+c^fe(8^u{G}7b VRT>iQ`5G!iji&G.Trв㝊ebk DiB2QsyfWSd<#Gtˬ:U͛jhGSapdZ&HfHaBT+ `՞gv0sIKgoֆ)|M(\5fmWoRC!uˎ L @T2CTY`} 2E[ޔp>*k/<+.Nbr Ĉ3g9-?_2\_7D/"t:DZRauk #<#lfwLmh \j8XEG}׉PO{ȊզY;i00~;Mol1HU c楱ڎr&'/L) =GN^,ǯGeU[x՘4Q!ȣw] M[(Vj9KzMY~p~X~5ah@Sk6$^ps2"ߛh=\>l'BLʦz9"6a@#ԧŀx0}|~56j*,*kƺNs&9 ^LlNsΆ2_-/dz? %f5{ܠ)AZq2il~՘"Dq(CǿY ʯldZ &Bίw商ićv+~CS5]UУGJ4y^O+xNS,712$= B"-UmF!kߚaTU{!R:%aF^ZUab^_/A˻l;*v=h;|«YT!3Yϖ1\w x*t[u*Vtx2CW+-kl쎵FX6_o+br1%=u2E%rK(q]L `JGQ윦 ymUXZj6D X+G !cw)z--oyR4wo+K'Э5 D{j=ޒ{Y&R%)Sv*Q@4e8J'dT0g׋dG/+##}L3>K -%g3hO{6ao!ZBW**Ӛ4b |gU2:{Conc:B_ι_vCG;~Ӎ܆|Ux3wm_QvM[$< 9pi,U  -\Cmn,[u&Ebo.FVLtๅLkzF> J)pKM{;nIe?.hu!(ɣ" BG㙹Y"?s{-ޜf`dƅͮ"l` hG5a66qW'kw) L ,6$dFXO6ko i۔io Sn>Wc|aIN)ֶ;ա^T {RuLGhT_ƹfPk2h@lT8)F |Hb+ ]!?ùԠ6'muq7b wyvu+>ə ;`^v u rQnyj4V煝Q vm2؇(s;N+^*H7fs+-ڙ#?wDNCvJi0%1ѱA.zMcr{dJ*MTI}?>*TME]X>@˝4A8,vxv:G8Zր utc9_`> fhL1}8"o[+-ԪgcJf#*aQ kz+s"); hz^vw/ pyA-J[6z}[Vzrenf+3Qbd1?i\kZҺXu[ՁX4@ĥ 8l'; L VA=1#pO ʯEC<7ɶ7tY?KXR+J鷳~'oUo>F?. ?u}0 ݋ӗ% _/G:WRw{i倃r=}6p[_5[4)U Pp0r5<&IZ+lc =  +fusppxs{? *qby@aMv9Cn񻷿p'mj4Gߍ6vYCh`_p h-^Š)Z`[Y=y0 *<$]:Ύe/r +9Eg{N'L=Okl5laqJ8krF Wk\;pm$y6ϧ UDN 9 Ծhz{#?1yװrhR6,X/ldh(mJ/Q #XGsѦ~(Z&ą*]^n]*%h4ez.ӊ ٧A4&W'3nDxZg}p{{GEgӋ%?]U L6M%25(u5&EnjXW甀,,ѡ̶=[R榷,(9tbHP `'*HM5*u6wl흔:jk.])񣒷GҌ2ø%6 #Y>|,) 9OELoi(C>O*`o#o.x# WAh̷B!6PyMȞS_ bU`e)[ dveҩ+vU"ءeF6Ndx9b-0gyk7=Lr[J h8wW>;evFoqQl ^KWл: +*wגJ-(4>)P>cj̅v[J8g1˕Dc26_vDNj13YE*haWGnanV XV <Cgҡ̇ȫpl'3g*SM٦Z{f>٩.:N kMַ@"Y"i&aJʿg+u@W82rPZTK6Khhv1Gy)h!lc gxz>N2ұaACV\xz@G\\:CLg$U>^Ci^~ =a [Ҧjr+m,7Ԭję~#^y?S2kz9t/vH[o'B7۔R# b"jњBc[sj\˴gQM:rL }f=/|o&I56s[ Wio˓UGkiG)w!R_[UdR>JS^pI.ːe˛eLyT(`SthAz%sq0͆\]]=|]-:R/זR _N3:NOTD5TUnsM_h_'&UTlUEvՑKt|%2ԎieH%(L8FwtB/k5ҧRpMsw;S5#NxlQrJ NqD1kޞoC۔XW?2 ", 퓐S ZOi_1:%IM͕/3uv]TJPITU\稰o.CyZAKDLyɰFmPbwT5LoN2p2"=&DH2;϶HV46-O4Nm;Jd gS3_@eG^+mEWS|oT>Zɑkшxk-Me@x1zyLS0 xK7[3S_ELiljE7V/bntOK$]pdd0EDHO/jӯ'9Wi*H-%'lñ'IEM=ft`:'v6Ny&2U+{Z5ՋH\$YFlMa6m^h-L*QQ+EP}:kSjp.Mϑb13O_ld??uS>7T+N{󮋭MVqw`ms_Tg-{m3ٍ.NhPv^gwI9RPc\=;Le^nKOcZI[ŕ:d9 ȕZvcODFbV2FZdͦ;Zi?ZQDǸ>:έfM'{,aNGw ӓ:QDy6I~W:~9:f ."Ru8]2T8tǦft|)# D{}_c\?͹3nq Nw;c$Dc77|Z揓 kĂ9d1}x.q/$EJ}IMԧ3 D+bEq}_UnfX _6ѴE\+_xKU6Z޺+^]e҈)Ag?;nd$AUo6Xemwwh?p Ivǎu Qn fm󿴻W+3dfDIkK1'4(%9VJu^{tsn!#{ՙZð̇7؄鉚m!#:Zze\':h色mBuك,JIl"CBEpNĨˌ/Kb1>d)3)L8=]r=U:9H `CW^>YHQ^ģ7=HYŒfIS} -@~ X ypD{E$7g>\Lgw՝b8}8<<~/{ܽw( Zg *!~zK>;\';P;DI+bxC; lvM۽2H}11ud×x=K4esE7zM^@x%3{y6H0w}£ zQS8T,?f7;"-paǚ^j7_?g5l\[gN,A]yOb{pNu'oVW@/_-5.~an /jD T0n!Ws[_8znI.f!8QRo^sP,6Db~yze"%`U߃4}|*6p4Rgke:% l<j?߮3;kgo'7n)>r5kkBqs_עJTh~1F2ƴ8Fk0hߋ_Ȱ?x ϲ0M^@3TR=vhHm  듮V |4+W 9V"2րjV%)*ِY kr:"|%BDRB.iu5lg-=e qfHsBV8,1i4+(I %N 81|YOuaɣX܂FsŊ`vL@X2J` t}: w@E5A-m-3ˉ[<E^!sB 1 ;H{l\8jQ`C_))%5o{mўI?}YPY9*Bxдb'.F,Pכ)З4v4yי.e0~T#^Zqj56>yH|9iԜ?cd2bΘ~In"bwWLEW $8bIK MydE rQMOXar1`hV*B&"Y|JE6X8Z>A k?i<%6K ,Ъ֚.6A髽 t W:^caK>WGJ9Ydp,ˮy(l ZfoSs[^SR0=zYsux{^`݈PXIQE4HvRUBB؏w*ɮd9Z=nTKD͛]MtTvVzyvXASh M53p~>l$N};l `tRQ]&պX_uPo`s{?>ҽ.7s*W5oyΖNj %o#E }R43XJU{VϹ&.E[(7p؛]ͿMKGX"K pXUXџ+akPO+L2{4]V(;R%g-/\?.Bs3) /!Oe{yJ4.;3$2E&RM QeQ-4ewlyS>@3CR@P?;抑 #Μņ V(RkXj|ɀp[~gRXoflrU.@$v>KumF1Hz&1%pe:\ `_'B=M"+bWnw. ff7Qœ6K°S4Ų0#RT%R^=Z<)a,kWD"|3ڤ)9j;>ʙ400)4,0c/e8 zWo53WcpDRDʒ#bqvIRT+p7n-X峫.-zJ4eYOyn`ՄuTNِxyˈ|op1)LS:8ăyf諭V6K 붊j:8i\8^b@{2V99N|Mt@$L:Jqjiɤuu>Wcơ f\&(ftWjFmk5@ {;C;agWڭf 5'OI>FVwUA+YX|y>y;M%fڳk˼ovX DSWQ }kSUHp`d:)yEjMȃWVxA*N~-nH duOSd>[pmdޅ'_⥫mթX7 ]q;֞ZcIz;, CP|ݖol|8{\,q *dM/3/u9rw1\V&_9k*m^)GysNv3AuVYck:oU؜1`%ܮlB.YnX񖶤P'Jܽ,@2|Y&%[zKAgٖk^$J L?FžєU(lQ]/ ,w Lu`?37,<ҟ5Π=~ B2mk ](W(:Oxjڪb# (t@R:XJL~y-ވ-laۍyʣ|O$g2쀱{%D7E噪wfҔKZٞvF)0h\ڭU:$bmX;z#Wޘͭpzjg\?E@; )]b ÔD=7zV.aNt+}4͏SOG<$vFCp>LP5vb-wР 4^kY6LPe8[d|<_.2iMmP) Eeh8MƯ%@(쀴Zy|/4/b(nI9lYuPE22qWYG,pGt"[?Rؕ~^+|ĝѓ{ Lx )Z8R],GW.Aw2͑hm ҍެFSD:HfGC%'uF1MSt2cO{ :jh X(|6㍄q6;?_|hG]x%x{E+W?Oavpnvz ufAŽJsJ3.ZurήiKF>'cVnn5WbzfN2}PGx'3Q3Z^ZRЯgi/7- xe0~7g 6{-5?(nx* +xkmfq4&dt<:;e%Aq83"f?-ɚl%)Q}I3\q~o?&T ;-h紃ckTPegKԊ'_jˡKٰ$+Wc퓍W8WZh(ED'tO` DVj2>|tOF{Et2{dX$gє]蹔VL+\ʃd~JVX\-;*ⱾjaqD2ۢoyKU:8M#Q@}4&T 5ր{BΪ2QHbES?gwR$#t\ǏJ!JGK3b boۀd$<1qؿ jb#nWWx>«>@ ۏ6^.Z_2 x 2C }7!{N}m.CUl1ٕIWQ@`> cc8ےr"CPA_XZ2oI*5'}EUz0yX$حZd"*O-nӪBէZ@Ǚ搯E#Pk˓Ux}RcMWW]씑g /-Gxb7/v\A~|f4\S]K*S@9{*돩}2Nm)Ť.WB7qpϻ|/dM]}dZ)hc9Z5D JH0" ±PF(L%7YgJ3kdZJV@:-A4[dv\o HV) +]5f~!C!hhQ-X.nŠe!#}+x8K Yqqq 1i"cs{q8Vx>F,~m{R$o)JE˭m@PgIx-)oGRL`H_yqir{ӫ~;PRxzxR m<}БI1py>"_5ǶNG4Ŗiϼg5Ut$DUX6t{_XLj4mfҺ'# Waӎ$RJt!TUpKw_l#o&*3QEE"Es,i+5n9 O+l"\٠cU.v|s.+G=,XGgQ4_ݕ4C9GwjDUJ&dzWea(e%YY[e:U~|&{tK3˥$tfds~Դxrщ1>e&"Ю+Fg;(B&RU-rMẉ i-O2%ZW;YB߅YU*A$N2p42"=&tH2;϶HV46-[4Nm;Jd9YZCS3_#pױ,oz%_m+*땧ҝJ^Ft[kh*zxI=ˣgj6*M!ϐ{w2rn$nD[[Q4O9Շ2%8{b(u q(RzIUچJ@Ki=p,Ia|qp:ft`:Ֆxd3 [pk-TiT/"q*gu)v5hLٴy5h2GE.'}:kSjp.Mϑb=xzb# w2G\uګw]lm~+XYt,uLvSŵJmRݨקfm?[Fj^u0, 6/O({;O̐tQ~SͮV륯W''ȘL ՕZvbJa3({(ZN&,2W_62\m8F?Ȼ9IJ g6H^l;H"Yh~asګU߿$К"_F3UǮ1hzfd+jۺv^q$Ir|z:zl[(x}9Rs遻'aȐh*$12 y(lq O@0vL-NO\Oss6&}شЕO|2<0RtAs(CD:3wVodYT_C P+胟zB:Vk,$^j&~?;?;ٝrug:;ydj~2߿ߋ~?<:|pA7w?<:_{9/cox핺";51[V_]Ş{|Ը\J}512PMXd\Ro}5be%نDI xgALJ xXa=] :h"2DDPU}uT6a@HW$X~Гdzat?8fj,F\ɟޤ٦L8eR Q]n,VOz8$ *Q|-K,"k}/>~"/?ˎ|6y{PI!=`k'OZ Hѐ_!/XJ)*  2/iw0|ogkCՌy9r"Z9\'a|Pu/"2րjV%)*ِY kr:"|%BDRB.iu5lg-=e qfHsBV8,1i4+(I %N 81|YOuaɣX܂FsŊ`vL@X2J` t}: w@E5A-m-3ˉ[<E^!sB 1 ;H{l\8jQ`C_))%5o{mўI?}YPY9*Bxдb'.F,Pכ)З4v4yי.e0~T#^Zqj56>yH|9iԜ?cd2bΘ~In"bwWLEW $8bIK MydE rQMOXar1`hV*B&"Y|JE6X8Z>A k?i<%6K ,Ъ֚.6A髽 t W:^caK>WGJ9Ydp,ˮy(l ZfoSs[^SR0=zYsux{^`݈PXIQE4HvRUBB؏w*ɮd9Z=nTKD͛]MtTvVzyvXASh M53p~>l$N};l `tRQ]&պX_uPo`s{?>ҽ.7s*W5oyΖNj %o#E }R43XJU{VϹ&.E[(7p؛]ͿMKGX"K pXUXџ+akPO+L2{4]V(;R%g-/\?.Bs3) /!Oe{yJ4.;3$2E&RM QeQ-4ewlyS>@3CR@P?;抑 #Μņ V(RkXj|ɀp[~gRXoflrU.@$v>KumF1Hz&1%pe:\ `_'B=M"+bWnw. ff7Qœ6K°S4Ų0#RT%R^=Z<)a,kWD"|3ڤ)9j;>ʙ400)4,0c/e8 zWo53WcpDRDʒ#bqvIRT+p7n-X峫.-zJ4eYOyn`ՄuTNِxyˈ|op1)LS:8ăyf諭V6K 붊j:8i\8^b@{2V99N|Mt@$L:Jqjiɤuu>Wcơ f\&(ftWjFmk5@ {;C;agWڭf 5'OI>FVwUA+YX|y>y;M%fڳk˼ovX DSWQ }kSUHp`d:)yEjMȃWVxA*N~-nH duOSd>[pmdޅ'_⥫mթX7 ]q;֞ZcIz;, CP|ݖol|8{\,q *dM/3/u9rw1\V&_9k*m^)GysNv3AuVYck:oU؜1`%ܮlB.YnX񖶤P'Jܽ,@2|Y&%[zKAgٖk^$J L?FžєU(lQ]/ ,w Lu`?37,<ҟ5Π=~ B2mk ](W(:Oxjڪb# (t@R:XJL~y-ވ-laۍyʣ|O$g2쀱{%D7E噪wfҔKZٞvF)0h\ڭU:$bmX;z#Wޘͭpzjg\?E@; )]b ÔD=7zV.aNt+}4͏SOG<$vFCp>LP5vb-wР 4^kY6LPe8[d|<_.2iMmP) Eeh8MƯ%@(쀴Zy|/4/b(nI9lYuPE22qWYG,pGt"[?Rؕ~^+|ĝѓ{ Lx )Z8R],GW.Aw2͑hm ҍެFSD:HfGC%'uF1MSt2cO{ :jh X(|6㍄q6;?_|hG]x%x{E+W?Oavpnvz ufAŽJsJ3.ZurήiKF>'cVnn5WbzfN2}PGx'3Q3Z^ZRЯgi/7- xe0~7g 6{-5?(nx* +xkmfq4&dt<:;e%Aq83"f?-ɚl%)Q}I3\q~o?&T ;-h紃ckTPegKԊ'_jˡKٰ$+Wc퓍W8WZh(ED'tO` DVj2>|tOF{Et2{dX$gє]蹔VL+\ʃd~JVX\-;*ⱾjaqD2ۢoyKU:8M#Q@}4&T 5ր{BΪ2QHbES?gwR$#t\ǏJ!JGK3b boۀd$<1qؿ jb#nWWx>«>@ ۏ6^.Z_2 x 2C }7!{N}m.CUl1ٕIWQ@`> cc8ےr"CPA_XZ2oI*5'}EUz0yX$حZd"*O-nӪBէZ@Ǚ搯E#Pk˓Ux}RcMWW]씑g /-Gxb7/v\A~|f4\S]K*S@9{*돩}2Nm)Ť.WB7qpϻ|/dM]}dZ)hc9Z5D JH0" ±PF(L%7YgJ3kdZJV@:-A4[dv\o HV) +]5f~!C!hhQ-X.nŠe!#}+x8K Yqqq 1i"cs{q8Vx>F,~m{R$o)JE˭m@PgIx-)oGRL`H_iMEv! *>HsM)4 :0e &2L;)d<5w: L{9ڤ#.$g֟ޣfTIo3v/n0=XuIv$R r,%[Eƪ-C4nM O YގTG J?E8\WB2 ׌ȅ 'H%ߢ I#rm)uE4DձjIT.^;[uXO?~b\Ul[5ZDmXA$Aǩ,]"C\VxX22Ti+i~tP's:V(}*Tww7U=\47%<G46Mu#0YN+q) ݰ> i:UүKS]":|I2gOe[Zp d(JU5 S02NT?ɔ k]}8lf E.&~^UVD) GB*#"Z^oBV$#l$O^hESjrE;ٶyTJ>5z #4cvD/K"Vqu;U;ב+O;㯕k ֢T 7zGl0Uh p2ty5{;UĶVS%bG|c!"Lw;q$ޱd'JFݮACo\D61|ps᫒4b{zy6y.o_DZ\0%N3򉝄 b^L V`M"IjrVi7)[6dMZs&}TJz4wڮ@Z/\nsXpOT 9J^=bkU|+XYt,uLvSŵJmRݨקfm?[Fj^u0, 6/O({;O̐tQ~SͮV륯W''ȘL ՕZvbJa3({(ZN&,2W_62\m8F?Ȼ9IJ g6H^l;H"Yh~asګU߿$К"_F3UǮ1hzfd+jۺv^q$Ir|z:zl[(x}9Rs遻'aȐh*$12 y(lq O@0vL-NO\Oss6&}شЕO|2<0RtAs(CD:3wVodYT_C P+胟zB:Vk,$^j&~?;?;ٝrugv]{lk~2߿ߋ~?<:|p~sããMmY9Cʇs^?vû{;hN=;{;;w fq1*ed}0] qv ~_gL~{<%B)/^R95pod }>0^ ^^ͨn;@_(r~T|+U.2}ƏYNe3o \xd&$ׅZ rW叄FY .VEPW%,up~^^+"S]IUoP)AK˅_DA؇[C <-Մ5px,Lkȕ(\W1 (^[m*N,~˴ $_ޣx&"HDtI5X M<}_1_Je $aoqEhI=98OƫOCao.!AY MmϤ\Z&P׵h|b%C0_1-GZ"1 #/2;/^ny8gp=P p1R3pF@x 1> jx`d:++@p.Fvf1Q͈#G.ҨUuU#)EE_mJ*^uc?/NFFл%lZ@#*B|Υ_FW@E"4LwB\>h,u [<\:?çְGQfx u'\*_c4*28@ōT,[rva|Wc3jzWġ{?p Iܩ]i5wfAL7 CWd4lKM_)lC%J_ÌPM b&x=Pջ!;AFȢ 3ۃJ< 0r{:CEȤTN~R)C~`<u)r7H{1#:zG봢$!KT)]<؆MƚKjuOl! 1?5`Ep0UIJaiJ6diah<_РKey!E#wl1,)BF /-DKEhHY#R+Φ(KL 30JR+怃ƂCIN _zSFod(&\":82 'k>c4]_NB)(p25z6@s`&dЁGt&&E9ڠЩHfR l>!O_Z!ϫf Ba: '&M>aj(XؒjNY Kk%l=q0 Vvn+c^fe(8^u{G}7b VRT>iQ`5G!iji&G.Trв㝊ebk DiB2QsyfWSd<#Gtˬ:U͛jhGSapdZ&HfHaBT+ `՞gv0sIKgoֆ)|M(\5fmWoRC!uˎ L @T2CTY`} 2E[ޔp>*k/<+.Nbr Ĉ3g9-?_2\_7D/"t:DZRauk #<#lfwLmh \j8XEG}׉PO{ȊզY;i00~;Mol1HU c楱ڎr&'/L) =GN^,ǯGeU[x՘4Q!ȣw] M[(Vj9KzMY~p~X~5ah@Sk6$^ps2"ߛh=\>l'BLʦz9"6a@#ԧŀx0}|~56j*,*kƺNs&9 ^LlNsΆ2_-/dz? %f5{ܠ)AZq2il~՘"Dq(CǿY ʯldZ &Bίw商ićv+~CS5]UУGJ4y^O+xNS,712$= B"-UmF!kߚaTU{!R:%aF^ZUab^_/A˻l;*v=h;|«YT!3Yϖ1\w x*t[u*Vtx2CW+-kl쎵FX6_o+br1%=u2E%rK(q]L `JGQ윦 ymUXZj6D X+G !cw)z--oyR4wo+K'Э5 D{j=ޒ{Y&R%)Sv*Q@4e8J'dT0g׋dG/+##}L3>K -%g3hO{6ao!ZBW**Ӛ4b |gU2:{Conc:B_ι_vCG;~Ӎ܆|Ux3wm_QvM[$< 9pi,U  -\Cmn,[u&Ebo.FVLtๅLkzF> J)pKM{;nIe?.hu!(ɣ" BG㙹Y"?s{-ޜf`dƅͮ"l` hG5a66qW'kw) L ,6$dFXO6ko i۔io Sn>Wc|aIN)ֶ;ա^T {RuLGhT_ƹfPk2h@lT8)F |Hb+ ]!?ùԠ6'muq7b wyvu+>ə ;`^v u rQnyj4V煝Q vm2؇(s;N+^*H7fs+-ڙ#?wDNCvJi0%1ѱA.zMcr{dJ*MTI}?>*TME]X>@˝4A8,vxv:G8Zր utc9_`> fhL1}8"o[+-ԪgcJf#*aQ kz+s"); hz^vw/ pyA-J[6z}[Vzrenf+3Qbd1?i\kZҺXu[ՁX4@ĥ 8l'; L VA=1#pO ʯEC<7ɶ7tY?KXR+J鷳~'oUo>F?. ?u} ݋ӗ% _/G:WRw{i倃r=}6p[_5[4)U Pp0r5<&IZ+lc =  +fusppxs{? *qby@aMv9Cn񻷿p'mj4Gߍ6vYCh`_p h-^Š)Z`[Y=y0 *<$]:Ύe/r +9Eg{N'L=Okl5laqJ8krF Wk\;pm$y6ϧ UDN 9 Ծhz{#?1yװrhR6,X/ldh(mJ/Q #XGsѦ~(Z&ą*]^n]*%h4ez.ӊ ٧A4&W'3nDxZg}p{{GEgӋ%?]U L6M%25(u5&EnjXW甀,,ѡ̶=[R榷,(9tbHP `'*HM5*u6wl흔:jk.])񣒷GҌ2ø%6 #Y>|,) 9OELoi(C>O*`o#o.x# WAh̷B!6PyMȞS_ bU`e)[ dveҩ+vU"ءeF6Ndx9b-0gyk7=Lr[J h8wW>;evFoqQl ^KWл: +*wגJ-(4>)P>cj̅v[J8g1˕Dc26_vDNj13YE*haWGnanV XV <Cgҡ̇ȫpl'3g*SM٦Z{f>٩.:N kMַ@"Y"i&aJʿg+u@W82rPZTK6Khhv1Gy)h!lc gxz>N2ұaACV\xz@G\\:CLg$U>^Ci^~ =a [Ҧjr+m,7Ԭję~#^y?S2kz9|qi{ӫ~;FxzxR g<}Б1yXT.ۚ;UZ=rTmґDcU]@3鏣e~|3IѤJJ~G:Z\uM;H) .r[ʇTi˛.%y$ގTG JQF0OO׸e&D.$]>A.UT8zkKmUM'UK5iA~가 ~ [=1iH|fEU[5Śc+r;"_ $4(KdٜKQjqT7MWw;MaN{QէRc /n{$iro1Jni@I1FZY[e:U~!P- 퓾jiARӾ"uKD'GJ=x*ٗYÁ.o(U"tG;*DPR:Q$S^2uQe,]hUDD) A*#"Z^oU$#l$O^hESjRE;ٶyTJFhZ֐LEG.F;i8 tUw6jE'T鳂3<|Xs[vh|U¬\qupx5& bbvM;}Ď}(N7^ONSk[BuK^bgQz3)HXa 'ɭQ9kޗĪ  hMWnLϻ~`vjunnnbWVl=}z=S6g O-g?59=h}qͅ?8G~> dbY|g*e0l`8#p|gCѐk~ wg9!r.,2>uA zn^hC@8AR0xg@  NÒ ՓA L&BH `@ﲚx򾢾nQk{1 i'-lɕ 'LWo3^;k .ZɏxoRlx&jtWīQX X"ᐈP"0Ea2i'\bɇpо_XD}<-ʖo9~;a0C&c :f=ŀ듮V#RQޡg iAE:cphDj8e1Q1Os\4㋠>:7ſ0kPMIUCw%E W%8MG4P)ebD㘰eFn!#9?%<])#ؕl.aA|NPg$ ?p'"h8i2z6*AM)"'`BC r#xʣ7t&/U F+b Bico0sl1 9M=Xl\]+~'-(%50Յ6Gq2w#Q=?G,T10?~TO60o۠Y JjLKXC,7v#-FW_tAM4nI=ЊH1H@Hf_^\jBq}h`0֒4yt"k[87a/T(:DT:X'AI^ #Az̋:EPc)#YcyL61cJ0#|zd$;YBB#Z5{x8vE@SlJ?I賨r91hV @҈dc΄j u!G/MUڦiE:NhAVo @9x)-ZRy> ] <΢j%t=q0 C.[sW-9zIWt] H%ƫr(8^ujk~ Ғ7bVR~SU>Z2䁋h#U90,q%xY4mP ,: D*G#xdbҶl"hkQ)g/el&JoY3ѧ@>J@`Q' ck.2q m9eD3UlSj-T-4{=0rYo `u{? >{Lo;qx5Ў`x:S4|:B2nHaBT U{|eAϹJTy:3B](wKC኱wv1nZڿi(, w ư9CQ\?DxIjs׃}B-,ܺ,Ɨ͆/iWKYh:ž;Sl_V5JT`[RʧqڰC"g: $0, ^OcHUMos"5YƋE2 N ՄȉTe'F\8 ѫ wiWA%:.T[ 7e:uqlGCE;f ?l6` :,?`2;Hz_7b`; FfWۦ<#> en'-3s0b4EQCqi\ 4GC9ƍڙ|1fOIE?z(shJRrJ8a{aϑLE"7/LYz$bX E{ż쒸Z؋bϮZNc8hJNvje-ѐx y͈x"i;BRv:4RO}cq nW#jh VVK'X]Cmt[)8ڋj5hιDG6xGsJt7BʠV Z}22!v,G"rh5O>3p6Ti&&\ۚƕ$|ֻۄg@$JY {UfԗͰ\A{S::0Jv*I+yk_X$F rq7um!j׃#'*=L0bz\讍񋅿t`-832V|J;վ܈蠕,Ikk7B_m6f6q8|{:=R-;ܯۧ ꡬJ7/ÏsJΐ s-&.%D攀 ``0v5DsKK؝v=ޑ 7 Wה%3: _4cm)wS=\별 v)GHAr`%e8J'T0gUBdG)CG&K1?3|@ZŸAOK-)v5$\KJBQyVy"V9 P>*]d=]9Ч6VQCh#[9}xjMn6 $ UԽf[,n ɫ45O`W^y@&s0Y^[ -\l7Tv|MwʽG]­ (8!-fZ_;SI(©f82vf%L^CNQn4dQ I`wȞt'ʭ97 2.lv`YVI[>)*A`ښ|yך/hCBjk EsUmnʜm̴wӁ 2aO{6ʶi$5L툳2|doZ)~4AOCfbWak2Qwn#{F>D4ĒLo`kpN5&+ ȡq֯VϪK| K0yf#|8ȟId#$Drbny*ΌrJ*煕Qr vj;6Do6I_a7i<-%^yl.s~N?̑+x;M"ynJD›zZλi ]cJ7MG9Ix#!hlpUj'|.oQsX28Wθ7==zfjjtc/0we3"oJ:SmGgS0a*Y%و°Ȍukj{EeK* Qjy|*/4.٫ 0nZQ9lYS뉾2k?3*,W#Ƕ 1M<tZкVn^PboZcnD9Q re}R>=Ֆ+>== A BHUՆ+^zv|%^RU<t3e(.b)^]9תVĸ+} ]dj4kUk6p =~pp;388E *؊*5hiuT v{+ۻp{mY(ixE Aк{oy )гTcM#V@yԣsՔS{B*翷e#D~ GW+*u.] cS!vUfČ>Y]p26)!S3G4C:>1lW>« [ys:Sl?2s+`ItgBm<ɁC }7Eػ^ > jRI-z\Gldnׄ8Z70\֯Xqn]ݐA\)#:VݻGFR24lV)OMd"7«>ui޹# \ύmg7|*JʈJM}y28^&"+.^\k]pP & K5keޙN\DEyFA&E1ϿsOu=S痉sB֝ӨJfbcRV_vDËf$Ha^zna9BNQ䓒x" wZ֥C, fadj7YboAΘ2ܵ$VE[ $F-,1|KEmۤ@rkҰs{0KAx 5q]<)p$:l}L mޠS<>z؀bACQ\J#c\\:CTѹ8q,2-WB}K^D-ֱmE\5µkF×?.Yw\$Y삦Qo`Cn\, .m1T1|ԥڶaR[m#tnñY0!b,ہ)#;_gb< )Jŋ"gҊ x@*`v6䶒&QVZ6qû-:k=< dp+1U㳍Ö7ׯ9=|y],\ݷȖš궡ݍ[Ѫ!m{=cJۋ䡝C8Kͅ}֔kOJXjoZ#1Z2l/ƶ57_߬BMAŊbe'RyY錾Ds'tA3d$QC&K9&WZ{R.!f(LvVΙ¡k8mu@%4p((maCFSl{F'q78Y_A>lF5+±7|3\5&(13]>\Wx/OHZ I֯f^%mJ >=JE$9ɖ*m§UlIkkՉu7Ja.Z\}طFB4 mgj%>&]SH/^3.Ne#:ۯ 1.Q٣*bzɄY3j rTbBnV]b!-3(8Pl[ӒkdUȵͦmv2V9/_9faF4xje[Vd:;HWy*\gYh>й-y;Od \k O>*aV8s:8<ڈM1KmVl>bG˾\ H^''B-: %/D1C(mf`sz`S$Q0nٓV([5KbJ 4&S3v&-6x5Y 3`##,(q|!fDu$iFeI} -@ ~!y3&33Wgo+JWLV]?0yoͿZkվZ\][\_jumsc~jfLA`cVks|{I=W7NuqgxNAAjMڞGC&*0"ׁ 5]Ev^% f|7Oh7 y-/1~\F/W4wd;[թUaC +vV*=ioxY:z'֋]Iv(q{%$$vLKStߣͥ_$DهCޝzABtܳh7RD:dq)@e%{YW#K~Su=2(.8K6TO~&2$Lpj;ʕGŁ:b[DP$z}&W2/3]7xeS4(pk1`}C"%h18E7s%"2.R~a}۷([޾Z8"(B p4@SO^ HaGyNޟ0!jh &'v.!3Om[ᔡKUG<=2.[ؕ_7l'8rk2# J[UYiKJt0DQBw^[a)|sXGn(T(GHS: *QDIlQUt@eqrb m0p9C VE  O!M86W)E @9*tJT=O#~Q +]( 1c4aZDS A&%VEc. NTIjb1P.OLdf 8v bWg1V:) `窓0Be>m7). AQ7ɍ)әT{3` ]xϱBxϟh7`q Vv B 8˜[T\?NjVJ> ލ #GRPq0QՊ<Wmg@#$(ۛ1/a a\ u;5ПӸ%WJ+{# }NxURl, zxKXZ!ڭn`ބ+PsW:tR`|&U{1~g1/$g}CÎQƧG0Tg5%v0sƍ)1d&Sl,dU 9GjՈMIc %M-)^ &"@  Z)@J9!:O-*Q) umy- +YiiKЂz<.*\߂8îzZ~E9 (=]Y %[pc6ƤI_1y\fS$ }L wLAYՐ+Sڃo=K)iâL pd2Ȳ*{@d/8<+.;-VF"'Rq6DHPL]-ƗHl2̗So-7fd LG!ű zst#<& jwԃ&sX,Vʨu"*#}UMZu_mF󌰚|< }B(JE =Ʀqa/xH57kgĞLA<>Q'詒!#ã)]H*ᤆf >GV0lLH2u*Fwj;)E8ݮn`ڷYQ:DD785#㭇ЧDM!O{d7H=Q#ǁxpԻ]q6XaX- bu Ypӑn+! h/Bd892f-dz-")f9{*Zq4ppʄyʡ:< >ȿg3 Fuk1 {6E['гMՈ&Ct:}d+)>΋?ds&BRUb=mk[0NXn(e-UF!R_6sO(&u\|ae}/YSN]02eMq6d0ҁT[Y?DS+-kl_Ts#V$= |2ۘvq{\J>@p,JjljsvoV&::j*ݼ ?)5;C*ϵȚ= S4xø.-aw)xGj3\Q8wo\S [2|ӌ>qOg4[s*ًlv#maˁ(lRU -% w,ĪRYYh) Vr>-ն`/ۍאp-+ E O]iZ47@֪t!uTtCXE U/l ȯ;Zu5r۠77WSm5jB+:b'Jk<]!eKBe/zm M6s%HsGSq:=5:'G\)*v 2ʶx ЛIKh}N'9>X \HU,v0y Q\:5GBQGA6$!{,ᙹD~,Н;D+:vt踰g!Z&]boM`o8mjk]k6J<0K %`Uu)s1.O*6X|˄]<jcd4ۨ*Vv8 3;#,e%-:=3G?wDFC*6䉺)9sR o j9 ,bNt)}4uOn<$vuUMx𹘾F͝c Ƞ^:tpZV䫩 5βM̈](ROOO oMEĪgeJ f# Ò"3o8{K/2De~^aиg+xiGeN'HdϨ(63\&.h]Bl1gBXvZ@}M>Ɲ{/k5$oaK=u@plh9Bw4#8-{pʗ_NF`TNWIj!Åsi[<"8j| "=d$,*5x%y#t|O H ĝ.>GCh:]8NT $]cȦ0D$;OE_PǬ]U R'lmEO`:ۋΉl%2% $d5sScz0Ī +KŢ#W'bW@ vm>r>-_R\sjP\rYFbƹu_*vCq XX7w~I=#`\[<5; ԉy('7ܦ+d>pIf W?7Bq ()#*5*z}RƚįOxq5λ+2vq~B+rP6/iKWЫK[yg:qR>=L_&΅ VXwNR+!šqIq׻Z} /"J Uy鹅}t 9FOJPp<4iY9`;l$*Jug_Jd>9cKs&;\Zm%t|z -;mbJϵڦF/9r!4Ԩ 6khvq9%3.p? {nOc Eq*}oqq QI"GDZkzdGxڶ_ ABop(-yiYZǶYpjq_b=_þU2);԰XF' 2+MOQ2%S/q9E&DPGOƈ qd+&´8@#MTc1hðFte;ν!VzNt.셿ګw,攣4QZWE\nJ ^߅kуcB6SJdPSRk 6{UbE7o?fH?=G4A#* ~=m3JTv DTɲKY1~"Zz@S}*gfvq[\Z^߹ζ)&b[vV}w@1WFM@wh *=1+\m`+TKR;W7vDpkcoDg}\dL l # @971gz#$! 05^WwVgphݮU SkDiͯ_m>kO#(h |6^Sw#ۋ"CgݡwU߁7uTm9Jg0c/xz#;$ /EḴ/iP5rNg 6&M=ڹA9Np,ى8OM ,^ߛ F)N:D\yPk+<׹@.;m|=8m'XEKϛm3Cnhjc=9Pckѫ% |EEuP$kҽ_@Bo_.>6>jӦkxz`¦9m j,\9qOx%oՋ&˃{x:rt怅O fX2~VAE/ @m=jYxF%k)ml7il߳@LkL؀䧍|o-/>bk(c:#"(x740 %fmLdhFyFp̎z=t@PsRG$װiSP3Gr~}p [:k\B'=6ۃ#kqAjќ8|&!Bk=輵NЫ^}ʮq 5^Y9mg\G\ԛ{&Ш0z_\~sJY-ꐻ1lƙ{=l$Y=B(t> oX"'Oa\'zb5iNشǐU݊t蜽RC۴H<!JswE=STmob+Iym={פiCd|řuT(fʿψ)5K)TisPO. |?@LoHp`EP;ď!Qu~h$9~nj{ >yЂ4M PGafv}ezt RZ$mm|_N/H90IFߵs{-Ku·(dֲ~T߮,!>>gYɇ G,: j.X[-\߼ l؟W+, 0kX6I80.}$y8T>Ÿ@o~>)*؟6Xe2S*;$9 AȀGA+.rvij#e+qT&-M*YNIn7APd 8;+ŖM2R^_p.yCo?"OtH^w&2hݟE`]ЫSf5.'8p >b]!>4/0CQݮ_}~sylNZ?+l?9ֽ;g5f NƵxX3QI+8T$6׍2U*{P;rШ[ح%;BsSE*A` o^xRq]7.Zĩ-hwOHGDM(BuR(uw8Z~$?w0 ;'wN f*'0KN [ŠwN ;'𿝅ϣ5u4'wN ;'rr#'owl0&''oh'o$K:''wN [\N ;'wN [O - ;'c9z1WwN ;'m(m'wN ;'?/w;/&owN ;'7_E`s-ON {&wN ;' `, ;'oMUJ33FN ;'wv>ք=фwN ;'U[ˍݍSNw6𿭢wO.霄wN ;'o9r ;'wN ;'o=w6$w}ń]]tN ;'wɞwN ;gzhymܠ ޞeYs2,YjANAEaЫ(Ei5ooJigTQ֯"q2]@BazYw,hRj\1UF=8!L*ZPa *Z02&5zcׯd M/pCڜe2k)Ae7oȨv3\GtZkeXU1'&o]G]-F(IX[ [0B)h Zae!ao'?S 1x9#M;}"JЯ儳Buji$_}`m,,uNW^7E0eg2tO^}j+ֹo"{e zWu\nSX90D1ԣF5;Wt\VvcB,H> x;Aٌް}y<-'xb˲Nk,!,%xrr^H z\>P 7[E^ӑ\7xhߚPSj~SFQ7X;'[/l a`{7X6~g8 l5<k0X|~궝%+x!Zx 5K~vL(Up 4um`hgG'݆c5[ `B(fN&ٙ 8PmHV*^,859VLД7NRy,%d0rYD:15[S2zumr n*Fa˛ ~Cje =SodQ\Vtٲ8T6q⺻+8͇:>o^}}lk'Q%g_^cBѠ)f-֊m״CGhٗ+^${|D4%t[g!(Fx} ylN7b5 2{J:ec }IX b@dsΤe“ӦԖ`ܡ#:>a,Bוw[~vxa=8Č豎=h2,i(Y=Q 5:o$V`&՟;ۧJw^$2,{X]]ܬŞ>v^յV6?P?u3|̠Hr159=h}qŇnq}nyyEN':Ÿ; T` pt5FBmOQǣ!_~ Jy|ӥre.Ȣt{;eW83o3 wݖxTp9ABO?}#|ݗ^rQu_Fg*M0 ㏕H;1I+ p\IyFԈIrmrŠ$Zk 㓸b1b~7fP)A /a"í!|rBB!` \8Y$)d" ?|28@2ܒцp`~):`^H%'nxBLF%Ae5}E}JՍb@HO1-!N(Z=>{+O^gw)\xޤ&L8BW śu->E!E`4~eӢOg)}o~V=y[-or,wF \aLǎ1TuN{)']F㣼CO'tπ8H5u4D;p'4- p0b#bH UiA};tn#..~aVjfyKKzq % hR&(ň1aBFr~yy/3Ч+ b"TLvB~QEl Rn8_O NP^1Yl fxQ.1TF2&$JEV/*q5F 8AU8tԲ_@pJ+C|kDi*!`?5ګ#B8in_bht:<wIܕn> dؾB*ẌZkEo<@z(+hoCS!HJc0D )h mӉ!c/Xޛ\SE %%R:!NQ@>ދ9#ycV#)S(k"JJ&KBݲA9 6Ch PT8aq J鐦YoE"JJ :X@Ε߃ KQ-<@⩅ NVX1j!'$bqИq( vZ'k&i| K ygRlAGr+\3I‚*sINDp2elU6S@E F>3u3a(cS#Gƚ;Bm9cƔ 2a)6G8Hv*qG#jijD q ٔr/~^ FgQar c @NɜrN G'6XC`_ ΫD MBtЂj vWA3+60r?R[`h},8(5g@x(EռKz`46m](n[s,'4l+,cKWgPp.p]إ%oĀ ( (X T} MeF rta`Y(Jhv14"5G bYuj9.//%TGĤm!"D֢R.^,M3$g X'ţOg|2,&/8NAּʼn]X%d A rʈg*znZZhN{`P~8*|lzvj Y^,MuhCYөatd&M$3,Ä\4%ʾstfx6LQ;cbݴ%PhGY.oAaW=r\- ~\щ  [XuY/i _Ҥ<.)u=w&;jȕllʷOaQD&u@I2aTY@4ޔ8EkeP # NpfWA$(&ӮDK t$.s]˩Է^3n2&#Ju؎vXq9HO;mxu9X jew:ӑJoxŪۉwn-@rͺM#yFX}>>N[%f `hҸ`kD]#;LqД"nW70tCq,B([!Ev"쐧=2auh(Б@<8nݮFԸV0Nd, SqΕk!j2ќsim؃ُ Qv3=n A8d8UeB~YY,)Hyoj' BԮuGOxU@{2`&?L]  t[p*fd5v/}A+Ynf|ml|;vq8 tt=.[{Sr[v ( N5.uI5u_;Oy+K OACY5n^ Cyiٝ!ZdM\JQX),ajjE;W{#5o`A(7)KfudiƎVR3bzrg CAE S6JqN6H`ϪɎ[S;ELcfB),,?+9j[0 lSkHЕ s'4DrVE|gU:*{rO amЪGsWםQ-՚g9mH\{̶Y^W%ɵijL%aD%n[۹n8w#.b{b[Pne[qC[ͤ%wdsAԓTPMYQS,p.e$I*͌Ji;(.ht!(ɣ  B=yY"?s}O[sJ;o:@Ad\ Pҳs.1&|R7MU܃65u5% %_І0:ܔ9ۘix_, e.Y51ك 2mTEm+HjEw͙ge 2ߴSi‡ʹĮdF=F87)F*h}d#h%<BjPeMVC_UaatG\p?퓌ɰFI3Td5Tv +m3`vm6lfCnhӔy[bK\ڙ#Wǟ;" HvJDDݔ 97wJ1 Ɣ>|o揺'ZsB;GC:I&x@F➌ s p:U$jsh!\cyxxFBjdS01}-k~9RtPuo)\JV'?DEZ'8ns2ݬV39p5t.%tG쀚.Dji4KC=0Ɩ7tЏq/Wt҃ۚx #ڟV Sfѯv(26=??]~s͏4!X{q.@OfҖ-GiT IƼ,ݢZ9 %H -Ζc8PbҰ/s*Uq9VdF7 m o;!h^ b! <ë:l{]=tw Ogpq T6U%*2kVwQjiQ>D~uQRJ7gǮ FGQ "^)/UohsG.J=WVTn9P\Ǧl?B*-͈}0W:d(mwSB""fi(xu|cVٮ*q}ʅW)}6"t~d0vE Wz x 2n9w@|bՆbё٫N]+ ^ Z;6i ݖ/k) q9ln(`.r_#vܺ/!RFt,Λw jdi0.حRDnW}ӼsGn2$3h!8oTdpx>)cMDWx'\ݕF{8?en9L(4jp׊+%ͭ˼3F)swMTc򌂎Mbz/ v+;Q͕a8Ƥ]숆GdI*¼>rZi'%D(8K0ߝ X6y %Ⱥ3/N%ojT1ϥekH.:Ifx [`=Yb\۶IB1aZKmU#`9 jTkz˵ 4T8ySItb x׽Ax| ұłr7FǸt$sqƁX5z=d2b#6>jӦkxz`¦9m j,`9qOx%oՋ&˃{x:rt怅O fX2~VAE/ m=jYxF%k)ml7il߳@LkL؀䧍|o-/>bk(c:#"(x740 &fmLdhFyFp̎z=t@DF y4`]~5zI8q4A|2? =h}R4&4eIUٱ?md9TJwH>sbQV\()ՠݽG8VJM.;[U",ܠo7<Ⱥ (/A0>#qtwV-dQZ]ć.~>Dfz!a?VW*k\ :Oq6@|l?^B|hj ^a]7g vv~ )V1~r{w0j@$k!6uk f0REVpJImԧ-dثG%TvQcc [KFwJ7\7XOaT+%с(=fF W6Rbo\S[~}? *Z=;Qlh렧p4`ՄG|wN߃&6'wN ;Q%cI ;kw@P1wN ;'y&A&wN ;']RZn$nMwЄ$m 7}wI$wN ;ˑK ;'wN ;ɐ%'w?G/&wN ;' MwN ;'%ńMCwN ;'wFwN W$?7ö́G|wN߃&6'wN ;Q%cI ;kw@P1wN ;'y&A&wN ;']RZn$nMwЄ$m 7}wI$wN ;ˑK ;'wN ;ɐ%'w?G/&wN ;' MwN <'P %A{O>#(8#|q/GπНU.!D!_'{~1L[ !?!|IKF 1B!|9nj~"!ۄ>B5JkF燄8Acpτ~\¿8BO[BnB@"H !S/!!"&p!I|I>t/Cӭ!|t%NB%#B_!|W/!nBDW|"!w|yu#{>j#> ;'AwN ;'Kjvw$5U ; ( ;'wN Y swN ;'%wN ;'dH ВwN ;Iߟwu ;'wN ۆN&{N ;'NP ;A}'/!P߇' toď>*>7bTw$Dwt н `}o[Нн3ѽ{U{_0ǿ 5{_͊&ѽ?'ѽ ngA1fB A$%{;>m/fEd.J_{wNw_{wBTt F6\>Dt醙{d]{ts"DF$i{t%N{&tCF*C`to+н/$jNн_hlz6<^-w?_߫V7|{ |-GvGlӚl8N;{軀!޺C=k?T/gɨx2Te8/w+cxҡ+ P˜/VWW^me?PV!9~?o a W4N>'^iyY'W7_۸w??șFa~}s<#.|`Gd`y `9BDg5==e^K84?Z&("uעp> LK"b9Gc=U$ijnpD.c@n>WA7~⌾FjK5qol<ՙT~(j}}Cw12ݡ M`N4ɱyi b;_ZA\Eax:@J!mNTsMW)2!/r+E^K^N'Su4mVO.Hb՘xGQOz##9:O١gOR\|Uo>GJos5_[ظ?șR\U n^/ptv,ݘ+%zo\#9-b8;#/XOzjI{3#tŞSivHVA n_Sq΄) {u(=:r :`hk]Wi?{_O T(BfEfQ9 ѠhT)%RI$"  !H~{ny9{~f= | Z;b  f@^d`;q g3tzc}8 0.Ief1Q%S Ia:-6s**4E!V7fjHxcY@7$$Go DBQ;(eJ}7AGp[ahM-2*NI|%"[:Y: G!*iA8Wa}7Z%cVlM%y/hM}/7>æ u`,uq,vy+LlW9n{D7nA/ߋQWczFY`*Xm L~@]/ -$/5{)$'R J(d@B1 *jȠ 9ȿX? /|ae@$v} j3ZYZ½G+#e~ 3i+0\ (Sg q~+$ d |8fP!0A|WJ KZŹQ3,A"{Ȳa !K0ØF Vp Z$"YЀBvl p¬c0eҝ Д QuuZ1ꢎQ *DwJ`7Ϗ1\W^h(/Mb49m>&/P)ax{ >&ԧ08O0; kQP#ELz N.(/B&+o'\ ,mS?b\Ba&D>BV'ʬa.cie mm|0xO%R"p^>o`v "1QLDrZ@G8܁[3څX|Bh%G<FQ+ 30'Ŋ9uh+a0Q^q`Xk'Dh,(4\?iaF AXQU0, ȁ_&"nU4Hdp9e4 @+4!f_=j!paP(t)azv͂ۇ^=$Ç8p) SɊ"0 V"ӓ@A,NY& ʲaQtP#BF/zN,q`u@t0jB)hm  DFd઄*BÏ=BY D@SfL`<%˪2$yh%j@@xEL5acMb\g?:ucaUY$uyǂ/cZ ȁ_`6 ݆^yGo`P+w#{S@L%ϙ^zh bxC@E v X"210hg 2b2 k J*F mKʨYR* {0}+!77va? ;{d-h )2, p u; ~:3Jw py׻P]j1 @#(Z> , an%GSKCE]G/[ILR#zU%J"8/KXqdN,- mI3`>H3B o5U `}hr:87 BxHЛ +K] "@L(/#,(E R!PNBe QG/,[ez4&:/ŬiQxaLaH`hHFL 5Pmc\⎊e}U=Tn`H#G +cWa4aqDذ a!ЊTf?KT?axAf hX,,S [CbZx 3@BFeU((p:ȲBa0⣮"H ԗLkVMheA>P(7H< HK+ G4iS@fT⃂2*|'f 51T2:U&M^Z'>. ǔE r؎( E Р>oQ R>-"7L+V*?݄u L a߰Eqc@P5QD◄e"!x#OG(C0*2*Qt(PNdL4gK0 ~})F`kiJ`eREkYɗ/ᆜE7:Z0/ ҙ+v(Ṗ)l=F% f_0>vs: F'Agrp )7 ś.(ؖ1fMDa$e8ndF @SU,c!t;@D 0QvIZ eɌ&i4Z" "~ZnbGi;z4V҅h ! aw^`{9d fA:b3qt0`80 a ;Ū0VBX?l1fBK)ja{ԌV ëBC#~.S PX @b^ maV a825da@}H Ƃ̟E"f>vOl~|uI?5:dv 9֒1_yvਡ0+\pv.p>c `1 x XAcDXRVmep,&~Hx!"R8)I׎rM1-<¿A{º~ ~zi~t@G #ɻMd$YF0dwb.Tђ, xwB"hS2Lpe;4Y2da%FƇ"B62" %xv, ܡ~DbB扉p:ڤk^i픦%80)tٯlU]aVY PɃ̼ݽRg85H/[tw0z5{C;+/ߋM dnloY 8wn?qP%2}b0s&0 t`EkǼs`ܦ⣱C^de,=eJ-hBDܶ~a]ѸT eQDl /,4:`d4=95XQlCQb sSbApPʠlYp"6/r,S!PXZ8%͵"bt3Jxp \HN%ؤph7# 01ۄNDSƟh939 dg"pHn&\C8z ]Y_,4V C {* av) lTCF %6O ,s,B+,_++>p5U(=` ?@S/l[bã0~66}ɰ1,t4`PYGF pt,ނS6=3`~/hP7%TUz2B!$ܹE_ Y.H32!ox%eԱf`x>v8&A=~äH&IFmQʒ@1OXII}A1 @@ߠHt6S{)߳VI8;)*"ЃI0EЇ(, ~L'ő}}%.>ER>dЂȞ0 x0n`^'bFeaFObkSlXX ̱;〛Z0fJ/f'S$ :‚@0vh,9s4G"V0!Jaode1:dA{2ÝMb D3˼3 nk4ɒT~ⓠ%@wV0*`Sp̨ddqɣ/T I4L 3[l";CQ\=>tE:Հ+ep;Ԥ鋬cte\" 0 9CK&%0cY_&RV1%qa#c6?bF5!J M !(@{صqvHCE:cL@ucok<w-76ZwQG035`Z _, x @@gH}9ɛo<(R}/<N y(ՎT#/!YM*0.FcsX-|TF'B DG-_@xFꮀ~ZLǕaǼ }ttq&Q׵ߌߌ P"HZ1S\n'5bՑQR9_a_ 2 c `aAVB4@x[4w H!k1DC O_N-v377aH Mf5\@V0rԢ05IјBil*6=)fX D" W,,dp1L ](oR( #?[ۢet`8 Spd fUL7tv""u0b}T16UDO$0Lw'ЪPpwDE<3 H#͏,) 2Y a^0\,@Al;4 |*ldf^0)La!gLR"JS 5D ~-_=Q g @ F[hƟt`؝PȚ*د{"#n QHBCB; ;7" }`C/^~_> E'4ދ|<"z"_ NM 9Wr0Eg`*݆2H "V/+: $ㇱ@x 3?I̱ÖzF3 K`'1 O ZЙy t!@2`@,lcRPQu?Q Pa҆5G ȝS%"(G+a">ӗJE".: %EƐ4'ˣyrvF`R Q|ƚ>\Y< Y$oo(郌uJ HP$:j`2=`x%J )^0]Mi!L "5$1 &{h A cQ0D<ӌ)#$Hri0&2s*pPR4߰m4Ԣ.@C@!jB'53#q1U0cl]f#K|T?TFX0my,D0W`+lv [q udkMA7H<}A+2hvJ`$O *´^~5ecXFr0XnX4(ȹ1*8-RhXcǍa_ 7L&GIQh&HrZhT3[2 rf+l*4H̑'qlw h%cCȉ!tGplbY@̌wcOq4J&%u_,/*:Q}OTWF@ ;B }D"Q-)H-J8cPGb"6DneyD0̟E`Qctg cǝ0n D #E.IXe1! x |QQ`ժ=+".́3 e( \E2= \ѰD82Z &@P^(Ad`T#ĐѾ! f*$crj 2(Ҧ,B=GTQ]PM $s@@DCZh' cPFd$k=suT ?;+HP , hDgxR o*8 U؆ CȊ>ؘgc;uWh85vZpܗ@ݰgX6g'S#9+gsC04pp*˘ AʓNPʯ'K\PSGd_ bC0bU$#0Z" \H?Zؠ݁qxjTg؟zq@ql, bD8 Y106%מ`D&!(OXFUI%l 60ʐ V?уt@`QTU@ e?xZ4֘ȨTѭvh|e?MC"|7yL*j: - e=FCN'L0#˲Ɋ"%rDP*&6jR02kKĈH'hlO?2 s" ݂cX>B"J5;ƸA2~ 4^"bM)kJ9>`V ?g beiʔ5) o"Q]'W~Z[ J`-/7_/.Ɲx¶voQhtђg7_b}G\TT[X?oڎE90IHmICB.I̶X/;\V;뷞彶y䅚+FSeWt|`UDkz؏1Go֥vs}+ZfXC55g=_9ilcx.ͷݞ\?uZH>Ȳmm[#ezD{ ?^&-^a:DvNIm R惞gzDB];˲=CvGDMk1I+NP:ZP~_Hv_;&g.};ZZG:.,pQsLv.5#TS2^*B{#=u%\L꠰n<}ӃߏC&.dpIc:Y-T RlYi7}ͽ9jZߏ\,vbvCk]HN%˝`h~'lcDGyiovHyǞg9\7hǂsOY\gB<>?Q_]}HոѺz6}]"7~EU۸#p)ʙT:Ir &ܖ[)y͕ycd5;Qc<=$G>ߛw\B-MBW6׶tN㶝$k>Sou-#L|_Ti2NX1O~d C#[$0OQ^2mSrN1m>Yp7:ޘ* {KxR~ })G_ O{+ŻDW6ܑ-m_˩{虊AZk&B%ɺm%D6{?UI l(:Y8q[Jz?~]yy/\'3ŇۦLV%RU,4bWґw% yag!%Q͵f/~< R1{BڬI'ժ<+Ӳ-Qqt29{)`0Ł5iJwFDN0E&_vN4q%hpu{utÒWX:{A*m27^uלZxȠ}H9!_S1N%QfMlOF>8LOڄ9j\ouyݗ\xzOFAcH$U=߾й3b'j6G/ %KמHz{{c b݆J8նl~$';]bcʆW"ᙻ6ujlS>3a%9d7ɄLvp;=l vtn;|݃wL}-}a˪3KFfVB'Oʪn6؞ޖ_6yO9wJ)?%^vr[>8+禗1$]&\=V)~\ 3{ok :Ց8Cbc#5F̎"GRr' yc ,̤܋B%Ɠ>򩟈[_"9_Stxe GJ} gRUޘ3eB G L]!I~~]c 4N^IVx͠$\2sE oك kަ~ ;|kPnA9ofw] 6UߺKzcNmۍſ^SqgAAL)d=n*Nψk[*9c}rj CgGӥfVF}giAy&Yޒ,_LuWdpP-Mt^>`/V1=-cM|Aܼ ml`VM ׮49 I?%VzeIq+e;kh؂<Ɵ#.BDq͎1}ƍ9*fY/tŔ9JY'bn09)?RϓYܸ9EBLPZOlկoo r&]bdVף%EC2iBخX|7mj5; )m4O2KXƁ Ff]NBSO#XRvX$oh]%!Mm>YOd5ŇU%)N57\l[h=on'yrBA)7xf"9Zon7XlMyC"-]F)E&o;;Sg(šV|00sy B-9IsD }OsjNS" "m,&I nϊ՟cBUb_s6㙌B.l<<fs4!D8 3= wT)Hy@!+ZG\7'}yA+n_9iV1ϱ?pMUq w4MN p³ڙ(5z^}mک̈́@ s=䶕!7%(M8zo<64{8rpg2 u{t|T<#* J-ނmb}!*twC'DN3 R?ӏFZ_Ztg֥yV瞺 N$ϸGxP~zIFm |T %7ův׵a%#Tzoo*>ysIJDɬ0­BW1qlGj6z;զVA  NK+)S|[95ǓŵvfUl6CBg7 |Cw"whFH)YwkQu9~WB؜G~{Oow^HSyw.\u@ =TbmTYǬl Zkǯw (QT8+'חSjDnO줵}Zmo ?HMzjB/-ye* ]b nA6swEWMΞCٽ+=OY2->iTD [;"!봨 @ YvDXOmyxiPo{4ȯDȹ U- }H疼HYrCx>~=#uM&W}+f!K:lӱ"OrnƜbAZBm3Nܯ))Uѥaq鳐z׎}I㼉eңIo\"Zvx Ǚ%@l<2JjZFztb69y3ZCG;Ѳgj"V+)| ){lz`CQ)ID6[S0K!+E|K4 gQ9,<~by)kyD$n<(v]8_dg4/S^q"G~ՀH>WxWu!ёk$h^H䱢ǩ bׯ$Wt{)vrirYWsր˱k]5L9G4ߎΗ߹oۅ\mG.v;+;Y:;IBĸjÞ;Kmoz|}EքI=\ ~|)c/]u&WiѬ(5W4oKߕ~g3ųyuwZ-:>r+cKŒUfn2"v/x݇ȢvoKD~i~ks2lߊq46ygIFomc.b04gMPZYPX*ڋtc> &\D*:iwVra&fEUATN{g%D3{cqL|h 6ш[iw vH;ڕ~l2_֎c;M"?/[ .+W`%te7f^rIq~f ΧBuT^D+|HZ5u'v' I VkeMYUv+H"za\ rD7iU; s#D7Od])eUeyIR7.s tOe؛N4}TR3Gw9oi|EeǼԢ\v2EGUN&dˀ&۶(5u>8 ?pʵ4-+yOT;ޠ7t(yw|\7(=;p4-zӒv>ki8$ڰCOjKj׬7z JݤW={Y?s[ug[U7rl|A76MH0)o?ȥE?>@}I]:ޖlmi+^ W|3o6)5GP^)% *)?Oս3?DpdyƈoN=xo_ {ÆJSKJV40 _>a~y|'5XR壶 /+:oDoHj:4,޽r&Yq7sr~հ3s@zu558{ccwEK_>mȼ3on鲰>7Wh5qH9sw7=_DNM~~Rx=i"o"-CO/ֽk͍n5- VT/Fza6#Ez CtW?TE.b+ͭSľ QSWq1$

Note that `iframe` owner elements will return\\ncorresponding document elements as their child nodes.

","dependencies":["Runtime"],"types":[{"id":"NodeId","description":"Unique DOM node identifier.","type":"integer"},{"id":"BackendNodeId","description":"Unique DOM node identifier used to reference a node that may not have been pushed to the\\nfront-end.","type":"integer"},{"id":"BackendNode","description":"Backend node with a friendly name.","type":"object","properties":[{"name":"nodeType","description":"`Node`\'s nodeType.","type":"integer"},{"name":"nodeName","description":"`Node`\'s nodeName.","type":"string"},{"name":"backendNodeId","$ref":"BackendNodeId"}]},{"id":"PseudoType","description":"Pseudo element type.","type":"string","enum":["first-line","first-letter","before","after","backdrop","selection","first-line-inherited","scrollbar","scrollbar-thumb","scrollbar-button","scrollbar-track","scrollbar-track-piece","scrollbar-corner","resizer","input-list-button"]},{"id":"ShadowRootType","description":"Shadow root type.","type":"string","enum":["user-agent","open","closed"]},{"id":"Node","description":"DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes.\\nDOMNode is a base node mirror type.","type":"object","properties":[{"name":"nodeId","description":"Node identifier that is passed into the rest of the DOM messages as the `nodeId`. Backend\\nwill only push node with given `id` once. It is aware of all requested nodes and will only\\nfire DOM events for nodes known to the client.","$ref":"NodeId"},{"name":"parentId","description":"The id of the parent node if any.","optional":true,"$ref":"NodeId"},{"name":"backendNodeId","description":"The BackendNodeId for this node.","$ref":"BackendNodeId"},{"name":"nodeType","description":"`Node`\'s nodeType.","type":"integer"},{"name":"nodeName","description":"`Node`\'s nodeName.","type":"string"},{"name":"localName","description":"`Node`\'s localName.","type":"string"},{"name":"nodeValue","description":"`Node`\'s nodeValue.","type":"string"},{"name":"childNodeCount","description":"Child count for `Container` nodes.","optional":true,"type":"integer"},{"name":"children","description":"Child nodes of this node when requested with children.","optional":true,"type":"array","items":{"$ref":"Node"}},{"name":"attributes","description":"Attributes of the `Element` node in the form of flat array `[name1, value1, name2, value2]`.","optional":true,"type":"array","items":{"type":"string"}},{"name":"documentURL","description":"Document URL that `Document` or `FrameOwner` node points to.","optional":true,"type":"string"},{"name":"baseURL","description":"Base URL that `Document` or `FrameOwner` node uses for URL completion.","optional":true,"type":"string"},{"name":"publicId","description":"`DocumentType`\'s publicId.","optional":true,"type":"string"},{"name":"systemId","description":"`DocumentType`\'s systemId.","optional":true,"type":"string"},{"name":"internalSubset","description":"`DocumentType`\'s internalSubset.","optional":true,"type":"string"},{"name":"xmlVersion","description":"`Document`\'s XML version in case of XML documents.","optional":true,"type":"string"},{"name":"name","description":"`Attr`\'s name.","optional":true,"type":"string"},{"name":"value","description":"`Attr`\'s value.","optional":true,"type":"string"},{"name":"pseudoType","description":"Pseudo element type for this node.","optional":true,"$ref":"PseudoType"},{"name":"shadowRootType","description":"Shadow root type.","optional":true,"$ref":"ShadowRootType"},{"name":"frameId","description":"Frame ID for frame owner elements.","optional":true,"$ref":"Page.FrameId"},{"name":"contentDocument","description":"Content document for frame owner elements.","optional":true,"$ref":"Node"},{"name":"shadowRoots","description":"Shadow root list for given element host.","optional":true,"type":"array","items":{"$ref":"Node"}},{"name":"templateContent","description":"Content document fragment for template elements.","optional":true,"$ref":"Node"},{"name":"pseudoElements","description":"Pseudo elements associated with this node.","optional":true,"type":"array","items":{"$ref":"Node"}},{"name":"importedDocument","description":"Import document for the HTMLImport links.","optional":true,"$ref":"Node"},{"name":"distributedNodes","description":"Distributed nodes for given insertion point.","optional":true,"type":"array","items":{"$ref":"BackendNode"}},{"name":"isSVG","description":"Whether the node is SVG.","optional":true,"type":"boolean"}]},{"id":"RGBA","description":"A structure holding an RGBA color.","type":"object","properties":[{"name":"r","description":"The red component, in the [0-255] range.","type":"integer"},{"name":"g","description":"The green component, in the [0-255] range.","type":"integer"},{"name":"b","description":"The blue component, in the [0-255] range.","type":"integer"},{"name":"a","description":"The alpha component, in the [0-1] range (default: 1).","optional":true,"type":"number"}]},{"id":"Quad","description":"An array of quad vertices, x immediately followed by y for each point, points clock-wise.","type":"array","items":{"type":"number"}},{"id":"BoxModel","description":"Box model.","type":"object","properties":[{"name":"content","description":"Content box","$ref":"Quad"},{"name":"padding","description":"Padding box","$ref":"Quad"},{"name":"border","description":"Border box","$ref":"Quad"},{"name":"margin","description":"Margin box","$ref":"Quad"},{"name":"width","description":"Node width","type":"integer"},{"name":"height","description":"Node height","type":"integer"},{"name":"shapeOutside","description":"Shape outside coordinates","optional":true,"$ref":"ShapeOutsideInfo"}]},{"id":"ShapeOutsideInfo","description":"CSS Shape Outside details.","type":"object","properties":[{"name":"bounds","description":"Shape bounds","$ref":"Quad"},{"name":"shape","description":"Shape coordinate details","type":"array","items":{"type":"any"}},{"name":"marginShape","description":"Margin shape bounds","type":"array","items":{"type":"any"}}]},{"id":"Rect","description":"Rectangle.","type":"object","properties":[{"name":"x","description":"X coordinate","type":"number"},{"name":"y","description":"Y coordinate","type":"number"},{"name":"width","description":"Rectangle width","type":"number"},{"name":"height","description":"Rectangle height","type":"number"}]}],"commands":[{"name":"collectClassNamesFromSubtree","description":"Collects class names for the node with given id and all of it\'s child nodes.","experimental":true,"parameters":[{"name":"nodeId","description":"Id of the node to collect class names.","$ref":"NodeId"}],"returns":[{"name":"classNames","description":"Class name list.","type":"array","items":{"type":"string"}}]},{"name":"copyTo","description":"Creates a deep copy of the specified node and places it into the target container before the\\ngiven anchor.","experimental":true,"parameters":[{"name":"nodeId","description":"Id of the node to copy.","$ref":"NodeId"},{"name":"targetNodeId","description":"Id of the element to drop the copy into.","$ref":"NodeId"},{"name":"insertBeforeNodeId","description":"Drop the copy before this node (if absent, the copy becomes the last child of\\n`targetNodeId`).","optional":true,"$ref":"NodeId"}],"returns":[{"name":"nodeId","description":"Id of the node clone.","$ref":"NodeId"}]},{"name":"describeNode","description":"Describes node given its id, does not require domain to be enabled. Does not start tracking any\\nobjects, can be used for automation.","parameters":[{"name":"nodeId","description":"Identifier of the node.","optional":true,"$ref":"NodeId"},{"name":"backendNodeId","description":"Identifier of the backend node.","optional":true,"$ref":"BackendNodeId"},{"name":"objectId","description":"JavaScript object id of the node wrapper.","optional":true,"$ref":"Runtime.RemoteObjectId"},{"name":"depth","description":"The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the\\nentire subtree or provide an integer larger than 0.","optional":true,"type":"integer"},{"name":"pierce","description":"Whether or not iframes and shadow roots should be traversed when returning the subtree\\n(default is false).","optional":true,"type":"boolean"}],"returns":[{"name":"node","description":"Node description.","$ref":"Node"}]},{"name":"disable","description":"Disables DOM agent for the given page."},{"name":"discardSearchResults","description":"Discards search results from the session with the given id. `getSearchResults` should no longer\\nbe called for that search.","experimental":true,"parameters":[{"name":"searchId","description":"Unique search session identifier.","type":"string"}]},{"name":"enable","description":"Enables DOM agent for the given page."},{"name":"focus","description":"Focuses the given element.","parameters":[{"name":"nodeId","description":"Identifier of the node.","optional":true,"$ref":"NodeId"},{"name":"backendNodeId","description":"Identifier of the backend node.","optional":true,"$ref":"BackendNodeId"},{"name":"objectId","description":"JavaScript object id of the node wrapper.","optional":true,"$ref":"Runtime.RemoteObjectId"}]},{"name":"getAttributes","description":"Returns attributes for the specified node.","parameters":[{"name":"nodeId","description":"Id of the node to retrieve attibutes for.","$ref":"NodeId"}],"returns":[{"name":"attributes","description":"An interleaved array of node attribute names and values.","type":"array","items":{"type":"string"}}]},{"name":"getBoxModel","description":"Returns boxes for the given node.","parameters":[{"name":"nodeId","description":"Identifier of the node.","optional":true,"$ref":"NodeId"},{"name":"backendNodeId","description":"Identifier of the backend node.","optional":true,"$ref":"BackendNodeId"},{"name":"objectId","description":"JavaScript object id of the node wrapper.","optional":true,"$ref":"Runtime.RemoteObjectId"}],"returns":[{"name":"model","description":"Box model for the node.","$ref":"BoxModel"}]},{"name":"getContentQuads","description":"Returns quads that describe node position on the page. This method\\nmight return multiple quads for inline nodes.","experimental":true,"parameters":[{"name":"nodeId","description":"Identifier of the node.","optional":true,"$ref":"NodeId"},{"name":"backendNodeId","description":"Identifier of the backend node.","optional":true,"$ref":"BackendNodeId"},{"name":"objectId","description":"JavaScript object id of the node wrapper.","optional":true,"$ref":"Runtime.RemoteObjectId"}],"returns":[{"name":"quads","description":"Quads that describe node layout relative to viewport.","type":"array","items":{"$ref":"Quad"}}]},{"name":"getDocument","description":"Returns the root DOM node (and optionally the subtree) to the caller.","parameters":[{"name":"depth","description":"The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the\\nentire subtree or provide an integer larger than 0.","optional":true,"type":"integer"},{"name":"pierce","description":"Whether or not iframes and shadow roots should be traversed when returning the subtree\\n(default is false).","optional":true,"type":"boolean"}],"returns":[{"name":"root","description":"Resulting node.","$ref":"Node"}]},{"name":"getFlattenedDocument","description":"Returns the root DOM node (and optionally the subtree) to the caller.","parameters":[{"name":"depth","description":"The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the\\nentire subtree or provide an integer larger than 0.","optional":true,"type":"integer"},{"name":"pierce","description":"Whether or not iframes and shadow roots should be traversed when returning the subtree\\n(default is false).","optional":true,"type":"boolean"}],"returns":[{"name":"nodes","description":"Resulting node.","type":"array","items":{"$ref":"Node"}}]},{"name":"getNodeForLocation","description":"Returns node id at given location. Depending on whether DOM domain is enabled, nodeId is\\neither returned or not.","experimental":true,"parameters":[{"name":"x","description":"X coordinate.","type":"integer"},{"name":"y","description":"Y coordinate.","type":"integer"},{"name":"includeUserAgentShadowDOM","description":"False to skip to the nearest non-UA shadow root ancestor (default: false).","optional":true,"type":"boolean"}],"returns":[{"name":"backendNodeId","description":"Resulting node.","$ref":"BackendNodeId"},{"name":"nodeId","description":"Id of the node at given coordinates, only when enabled and requested document.","optional":true,"$ref":"NodeId"}]},{"name":"getOuterHTML","description":"Returns node\'s HTML markup.","parameters":[{"name":"nodeId","description":"Identifier of the node.","optional":true,"$ref":"NodeId"},{"name":"backendNodeId","description":"Identifier of the backend node.","optional":true,"$ref":"BackendNodeId"},{"name":"objectId","description":"JavaScript object id of the node wrapper.","optional":true,"$ref":"Runtime.RemoteObjectId"}],"returns":[{"name":"outerHTML","description":"Outer HTML markup.","type":"string"}]},{"name":"getRelayoutBoundary","description":"Returns the id of the nearest ancestor that is a relayout boundary.","experimental":true,"parameters":[{"name":"nodeId","description":"Id of the node.","$ref":"NodeId"}],"returns":[{"name":"nodeId","description":"Relayout boundary node id for the given node.","$ref":"NodeId"}]},{"name":"getSearchResults","description":"Returns search results from given `fromIndex` to given `toIndex` from the search with the given\\nidentifier.","experimental":true,"parameters":[{"name":"searchId","description":"Unique search session identifier.","type":"string"},{"name":"fromIndex","description":"Start index of the search result to be returned.","type":"integer"},{"name":"toIndex","description":"End index of the search result to be returned.","type":"integer"}],"returns":[{"name":"nodeIds","description":"Ids of the search result nodes.","type":"array","items":{"$ref":"NodeId"}}]},{"name":"hideHighlight","description":"Hides any highlight.","redirect":"Overlay"},{"name":"highlightNode","description":"Highlights DOM node.","redirect":"Overlay"},{"name":"highlightRect","description":"Highlights given rectangle.","redirect":"Overlay"},{"name":"markUndoableState","description":"Marks last undoable state.","experimental":true},{"name":"moveTo","description":"Moves node into the new container, places it before the given anchor.","parameters":[{"name":"nodeId","description":"Id of the node to move.","$ref":"NodeId"},{"name":"targetNodeId","description":"Id of the element to drop the moved node into.","$ref":"NodeId"},{"name":"insertBeforeNodeId","description":"Drop node before this one (if absent, the moved node becomes the last child of\\n`targetNodeId`).","optional":true,"$ref":"NodeId"}],"returns":[{"name":"nodeId","description":"New id of the moved node.","$ref":"NodeId"}]},{"name":"performSearch","description":"Searches for a given string in the DOM tree. Use `getSearchResults` to access search results or\\n`cancelSearch` to end this search session.","experimental":true,"parameters":[{"name":"query","description":"Plain text or query selector or XPath search query.","type":"string"},{"name":"includeUserAgentShadowDOM","description":"True to search in user agent shadow DOM.","optional":true,"type":"boolean"}],"returns":[{"name":"searchId","description":"Unique search session identifier.","type":"string"},{"name":"resultCount","description":"Number of search results.","type":"integer"}]},{"name":"pushNodeByPathToFrontend","description":"Requests that the node is sent to the caller given its path. // FIXME, use XPath","experimental":true,"parameters":[{"name":"path","description":"Path to node in the proprietary format.","type":"string"}],"returns":[{"name":"nodeId","description":"Id of the node for given path.","$ref":"NodeId"}]},{"name":"pushNodesByBackendIdsToFrontend","description":"Requests that a batch of nodes is sent to the caller given their backend node ids.","experimental":true,"parameters":[{"name":"backendNodeIds","description":"The array of backend node ids.","type":"array","items":{"$ref":"BackendNodeId"}}],"returns":[{"name":"nodeIds","description":"The array of ids of pushed nodes that correspond to the backend ids specified in\\nbackendNodeIds.","type":"array","items":{"$ref":"NodeId"}}]},{"name":"querySelector","description":"Executes `querySelector` on a given node.","parameters":[{"name":"nodeId","description":"Id of the node to query upon.","$ref":"NodeId"},{"name":"selector","description":"Selector string.","type":"string"}],"returns":[{"name":"nodeId","description":"Query selector result.","$ref":"NodeId"}]},{"name":"querySelectorAll","description":"Executes `querySelectorAll` on a given node.","parameters":[{"name":"nodeId","description":"Id of the node to query upon.","$ref":"NodeId"},{"name":"selector","description":"Selector string.","type":"string"}],"returns":[{"name":"nodeIds","description":"Query selector result.","type":"array","items":{"$ref":"NodeId"}}]},{"name":"redo","description":"Re-does the last undone action.","experimental":true},{"name":"removeAttribute","description":"Removes attribute with given name from an element with given id.","parameters":[{"name":"nodeId","description":"Id of the element to remove attribute from.","$ref":"NodeId"},{"name":"name","description":"Name of the attribute to remove.","type":"string"}]},{"name":"removeNode","description":"Removes node with given id.","parameters":[{"name":"nodeId","description":"Id of the node to remove.","$ref":"NodeId"}]},{"name":"requestChildNodes","description":"Requests that children of the node with given id are returned to the caller in form of\\n`setChildNodes` events where not only immediate children are retrieved, but all children down to\\nthe specified depth.","parameters":[{"name":"nodeId","description":"Id of the node to get children for.","$ref":"NodeId"},{"name":"depth","description":"The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the\\nentire subtree or provide an integer larger than 0.","optional":true,"type":"integer"},{"name":"pierce","description":"Whether or not iframes and shadow roots should be traversed when returning the sub-tree\\n(default is false).","optional":true,"type":"boolean"}]},{"name":"requestNode","description":"Requests that the node is sent to the caller given the JavaScript node object reference. All\\nnodes that form the path from the node to the root are also sent to the client as a series of\\n`setChildNodes` notifications.","parameters":[{"name":"objectId","description":"JavaScript object id to convert into node.","$ref":"Runtime.RemoteObjectId"}],"returns":[{"name":"nodeId","description":"Node id for given object.","$ref":"NodeId"}]},{"name":"resolveNode","description":"Resolves the JavaScript node object for a given NodeId or BackendNodeId.","parameters":[{"name":"nodeId","description":"Id of the node to resolve.","optional":true,"$ref":"NodeId"},{"name":"backendNodeId","description":"Backend identifier of the node to resolve.","optional":true,"$ref":"DOM.BackendNodeId"},{"name":"objectGroup","description":"Symbolic group name that can be used to release multiple objects.","optional":true,"type":"string"},{"name":"executionContextId","description":"Execution context in which to resolve the node.","optional":true,"$ref":"Runtime.ExecutionContextId"}],"returns":[{"name":"object","description":"JavaScript object wrapper for given node.","$ref":"Runtime.RemoteObject"}]},{"name":"setAttributeValue","description":"Sets attribute for an element with given id.","parameters":[{"name":"nodeId","description":"Id of the element to set attribute for.","$ref":"NodeId"},{"name":"name","description":"Attribute name.","type":"string"},{"name":"value","description":"Attribute value.","type":"string"}]},{"name":"setAttributesAsText","description":"Sets attributes on element with given id. This method is useful when user edits some existing\\nattribute value and types in several attribute name/value pairs.","parameters":[{"name":"nodeId","description":"Id of the element to set attributes for.","$ref":"NodeId"},{"name":"text","description":"Text with a number of attributes. Will parse this text using HTML parser.","type":"string"},{"name":"name","description":"Attribute name to replace with new attributes derived from text in case text parsed\\nsuccessfully.","optional":true,"type":"string"}]},{"name":"setFileInputFiles","description":"Sets files for the given file input element.","parameters":[{"name":"files","description":"Array of file paths to set.","type":"array","items":{"type":"string"}},{"name":"nodeId","description":"Identifier of the node.","optional":true,"$ref":"NodeId"},{"name":"backendNodeId","description":"Identifier of the backend node.","optional":true,"$ref":"BackendNodeId"},{"name":"objectId","description":"JavaScript object id of the node wrapper.","optional":true,"$ref":"Runtime.RemoteObjectId"}]},{"name":"getFileInfo","description":"Returns file information for the given\\nFile wrapper.","experimental":true,"parameters":[{"name":"objectId","description":"JavaScript object id of the node wrapper.","$ref":"Runtime.RemoteObjectId"}],"returns":[{"name":"path","type":"string"}]},{"name":"setInspectedNode","description":"Enables console to refer to the node with given id via $x (see Command Line API for more details\\n$x functions).","experimental":true,"parameters":[{"name":"nodeId","description":"DOM node id to be accessible by means of $x command line API.","$ref":"NodeId"}]},{"name":"setNodeName","description":"Sets node name for a node with given id.","parameters":[{"name":"nodeId","description":"Id of the node to set name for.","$ref":"NodeId"},{"name":"name","description":"New node\'s name.","type":"string"}],"returns":[{"name":"nodeId","description":"New node\'s id.","$ref":"NodeId"}]},{"name":"setNodeValue","description":"Sets node value for a node with given id.","parameters":[{"name":"nodeId","description":"Id of the node to set value for.","$ref":"NodeId"},{"name":"value","description":"New node\'s value.","type":"string"}]},{"name":"setOuterHTML","description":"Sets node HTML markup, returns new node id.","parameters":[{"name":"nodeId","description":"Id of the node to set markup for.","$ref":"NodeId"},{"name":"outerHTML","description":"Outer HTML markup to set.","type":"string"}]},{"name":"undo","description":"Undoes the last performed action.","experimental":true},{"name":"getFrameOwner","description":"Returns iframe node that owns iframe with the given domain.","experimental":true,"parameters":[{"name":"frameId","$ref":"Page.FrameId"}],"returns":[{"name":"backendNodeId","description":"Resulting node.","$ref":"BackendNodeId"},{"name":"nodeId","description":"Id of the node at given coordinates, only when enabled and requested document.","optional":true,"$ref":"NodeId"}]}],"events":[{"name":"attributeModified","description":"Fired when `Element`\'s attribute is modified.","parameters":[{"name":"nodeId","description":"Id of the node that has changed.","$ref":"NodeId"},{"name":"name","description":"Attribute name.","type":"string"},{"name":"value","description":"Attribute value.","type":"string"}]},{"name":"attributeRemoved","description":"Fired when `Element`\'s attribute is removed.","parameters":[{"name":"nodeId","description":"Id of the node that has changed.","$ref":"NodeId"},{"name":"name","description":"A ttribute name.","type":"string"}]},{"name":"characterDataModified","description":"Mirrors `DOMCharacterDataModified` event.","parameters":[{"name":"nodeId","description":"Id of the node that has changed.","$ref":"NodeId"},{"name":"characterData","description":"New text value.","type":"string"}]},{"name":"childNodeCountUpdated","description":"Fired when `Container`\'s child node count has changed.","parameters":[{"name":"nodeId","description":"Id of the node that has changed.","$ref":"NodeId"},{"name":"childNodeCount","description":"New node count.","type":"integer"}]},{"name":"childNodeInserted","description":"Mirrors `DOMNodeInserted` event.","parameters":[{"name":"parentNodeId","description":"Id of the node that has changed.","$ref":"NodeId"},{"name":"previousNodeId","description":"If of the previous siblint.","$ref":"NodeId"},{"name":"node","description":"Inserted node data.","$ref":"Node"}]},{"name":"childNodeRemoved","description":"Mirrors `DOMNodeRemoved` event.","parameters":[{"name":"parentNodeId","description":"Parent id.","$ref":"NodeId"},{"name":"nodeId","description":"Id of the node that has been removed.","$ref":"NodeId"}]},{"name":"distributedNodesUpdated","description":"Called when distrubution is changed.","experimental":true,"parameters":[{"name":"insertionPointId","description":"Insertion point where distrubuted nodes were updated.","$ref":"NodeId"},{"name":"distributedNodes","description":"Distributed nodes for given insertion point.","type":"array","items":{"$ref":"BackendNode"}}]},{"name":"documentUpdated","description":"Fired when `Document` has been totally updated. Node ids are no longer valid."},{"name":"inlineStyleInvalidated","description":"Fired when `Element`\'s inline style is modified via a CSS property modification.","experimental":true,"parameters":[{"name":"nodeIds","description":"Ids of the nodes for which the inline styles have been invalidated.","type":"array","items":{"$ref":"NodeId"}}]},{"name":"pseudoElementAdded","description":"Called when a pseudo element is added to an element.","experimental":true,"parameters":[{"name":"parentId","description":"Pseudo element\'s parent element id.","$ref":"NodeId"},{"name":"pseudoElement","description":"The added pseudo element.","$ref":"Node"}]},{"name":"pseudoElementRemoved","description":"Called when a pseudo element is removed from an element.","experimental":true,"parameters":[{"name":"parentId","description":"Pseudo element\'s parent element id.","$ref":"NodeId"},{"name":"pseudoElementId","description":"The removed pseudo element id.","$ref":"NodeId"}]},{"name":"setChildNodes","description":"Fired when backend wants to provide client with the missing DOM structure. This happens upon\\nmost of the calls requesting node ids.","parameters":[{"name":"parentId","description":"Parent node id to populate with children.","$ref":"NodeId"},{"name":"nodes","description":"Child nodes array.","type":"array","items":{"$ref":"Node"}}]},{"name":"shadowRootPopped","description":"Called when shadow root is popped from the element.","experimental":true,"parameters":[{"name":"hostId","description":"Host element id.","$ref":"NodeId"},{"name":"rootId","description":"Shadow root id.","$ref":"NodeId"}]},{"name":"shadowRootPushed","description":"Called when shadow root is pushed into the element.","experimental":true,"parameters":[{"name":"hostId","description":"Host element id.","$ref":"NodeId"},{"name":"root","description":"Shadow root.","$ref":"Node"}]}]},{"domain":"DOMDebugger","description":"DOM debugging allows setting breakpoints on particular DOM operations and events. JavaScript\\nexecution will stop on these operations as if there was a regular breakpoint set.","dependencies":["DOM","Debugger","Runtime"],"types":[{"id":"DOMBreakpointType","description":"DOM breakpoint type.","type":"string","enum":["subtree-modified","attribute-modified","node-removed"]},{"id":"EventListener","description":"Object event listener.","type":"object","properties":[{"name":"type","description":"`EventListener`\'s type.","type":"string"},{"name":"useCapture","description":"`EventListener`\'s useCapture.","type":"boolean"},{"name":"passive","description":"`EventListener`\'s passive flag.","type":"boolean"},{"name":"once","description":"`EventListener`\'s once flag.","type":"boolean"},{"name":"scriptId","description":"Script id of the handler code.","$ref":"Runtime.ScriptId"},{"name":"lineNumber","description":"Line number in the script (0-based).","type":"integer"},{"name":"columnNumber","description":"Column number in the script (0-based).","type":"integer"},{"name":"handler","description":"Event handler function value.","optional":true,"$ref":"Runtime.RemoteObject"},{"name":"originalHandler","description":"Event original handler function value.","optional":true,"$ref":"Runtime.RemoteObject"},{"name":"backendNodeId","description":"Node the listener is added to (if any).","optional":true,"$ref":"DOM.BackendNodeId"}]}],"commands":[{"name":"getEventListeners","description":"Returns event listeners of the given object.","parameters":[{"name":"objectId","description":"Identifier of the object to return listeners for.","$ref":"Runtime.RemoteObjectId"},{"name":"depth","description":"The maximum depth at which Node children should be retrieved, defaults to 1. Use -1 for the\\nentire subtree or provide an integer larger than 0.","optional":true,"type":"integer"},{"name":"pierce","description":"Whether or not iframes and shadow roots should be traversed when returning the subtree\\n(default is false). Reports listeners for all contexts if pierce is enabled.","optional":true,"type":"boolean"}],"returns":[{"name":"listeners","description":"Array of relevant listeners.","type":"array","items":{"$ref":"EventListener"}}]},{"name":"removeDOMBreakpoint","description":"Removes DOM breakpoint that was set using `setDOMBreakpoint`.","parameters":[{"name":"nodeId","description":"Identifier of the node to remove breakpoint from.","$ref":"DOM.NodeId"},{"name":"type","description":"Type of the breakpoint to remove.","$ref":"DOMBreakpointType"}]},{"name":"removeEventListenerBreakpoint","description":"Removes breakpoint on particular DOM event.","parameters":[{"name":"eventName","description":"Event name.","type":"string"},{"name":"targetName","description":"EventTarget interface name.","experimental":true,"optional":true,"type":"string"}]},{"name":"removeInstrumentationBreakpoint","description":"Removes breakpoint on particular native event.","experimental":true,"parameters":[{"name":"eventName","description":"Instrumentation name to stop on.","type":"string"}]},{"name":"removeXHRBreakpoint","description":"Removes breakpoint from XMLHttpRequest.","parameters":[{"name":"url","description":"Resource URL substring.","type":"string"}]},{"name":"setDOMBreakpoint","description":"Sets breakpoint on particular operation with DOM.","parameters":[{"name":"nodeId","description":"Identifier of the node to set breakpoint on.","$ref":"DOM.NodeId"},{"name":"type","description":"Type of the operation to stop upon.","$ref":"DOMBreakpointType"}]},{"name":"setEventListenerBreakpoint","description":"Sets breakpoint on particular DOM event.","parameters":[{"name":"eventName","description":"DOM Event name to stop on (any DOM event will do).","type":"string"},{"name":"targetName","description":"EventTarget interface name to stop on. If equal to `\\"*\\"` or not provided, will stop on any\\nEventTarget.","experimental":true,"optional":true,"type":"string"}]},{"name":"setInstrumentationBreakpoint","description":"Sets breakpoint on particular native event.","experimental":true,"parameters":[{"name":"eventName","description":"Instrumentation name to stop on.","type":"string"}]},{"name":"setXHRBreakpoint","description":"Sets breakpoint on XMLHttpRequest.","parameters":[{"name":"url","description":"Resource URL substring. All XHRs having this substring in the URL will get stopped upon.","type":"string"}]}]},{"domain":"DOMSnapshot","description":"This domain facilitates obtaining document snapshots with DOM, layout, and style information.","experimental":true,"dependencies":["CSS","DOM","DOMDebugger","Page"],"types":[{"id":"DOMNode","description":"A Node in the DOM tree.","type":"object","properties":[{"name":"nodeType","description":"`Node`\'s nodeType.","type":"integer"},{"name":"nodeName","description":"`Node`\'s nodeName.","type":"string"},{"name":"nodeValue","description":"`Node`\'s nodeValue.","type":"string"},{"name":"textValue","description":"Only set for textarea elements, contains the text value.","optional":true,"type":"string"},{"name":"inputValue","description":"Only set for input elements, contains the input\'s associated text value.","optional":true,"type":"string"},{"name":"inputChecked","description":"Only set for radio and checkbox input elements, indicates if the element has been checked","optional":true,"type":"boolean"},{"name":"optionSelected","description":"Only set for option elements, indicates if the element has been selected","optional":true,"type":"boolean"},{"name":"backendNodeId","description":"`Node`\'s id, corresponds to DOM.Node.backendNodeId.","$ref":"DOM.BackendNodeId"},{"name":"childNodeIndexes","description":"The indexes of the node\'s child nodes in the `domNodes` array returned by `getSnapshot`, if\\nany.","optional":true,"type":"array","items":{"type":"integer"}},{"name":"attributes","description":"Attributes of an `Element` node.","optional":true,"type":"array","items":{"$ref":"NameValue"}},{"name":"pseudoElementIndexes","description":"Indexes of pseudo elements associated with this node in the `domNodes` array returned by\\n`getSnapshot`, if any.","optional":true,"type":"array","items":{"type":"integer"}},{"name":"layoutNodeIndex","description":"The index of the node\'s related layout tree node in the `layoutTreeNodes` array returned by\\n`getSnapshot`, if any.","optional":true,"type":"integer"},{"name":"documentURL","description":"Document URL that `Document` or `FrameOwner` node points to.","optional":true,"type":"string"},{"name":"baseURL","description":"Base URL that `Document` or `FrameOwner` node uses for URL completion.","optional":true,"type":"string"},{"name":"contentLanguage","description":"Only set for documents, contains the document\'s content language.","optional":true,"type":"string"},{"name":"documentEncoding","description":"Only set for documents, contains the document\'s character set encoding.","optional":true,"type":"string"},{"name":"publicId","description":"`DocumentType` node\'s publicId.","optional":true,"type":"string"},{"name":"systemId","description":"`DocumentType` node\'s systemId.","optional":true,"type":"string"},{"name":"frameId","description":"Frame ID for frame owner elements and also for the document node.","optional":true,"$ref":"Page.FrameId"},{"name":"contentDocumentIndex","description":"The index of a frame owner element\'s content document in the `domNodes` array returned by\\n`getSnapshot`, if any.","optional":true,"type":"integer"},{"name":"pseudoType","description":"Type of a pseudo element node.","optional":true,"$ref":"DOM.PseudoType"},{"name":"shadowRootType","description":"Shadow root type.","optional":true,"$ref":"DOM.ShadowRootType"},{"name":"isClickable","description":"Whether this DOM node responds to mouse clicks. This includes nodes that have had click\\nevent listeners attached via JavaScript as well as anchor tags that naturally navigate when\\nclicked.","optional":true,"type":"boolean"},{"name":"eventListeners","description":"Details of the node\'s event listeners, if any.","optional":true,"type":"array","items":{"$ref":"DOMDebugger.EventListener"}},{"name":"currentSourceURL","description":"The selected url for nodes with a srcset attribute.","optional":true,"type":"string"},{"name":"originURL","description":"The url of the script (if any) that generates this node.","optional":true,"type":"string"},{"name":"scrollOffsetX","description":"Scroll offsets, set when this node is a Document.","optional":true,"type":"number"},{"name":"scrollOffsetY","optional":true,"type":"number"}]},{"id":"InlineTextBox","description":"Details of post layout rendered text positions. The exact layout should not be regarded as\\nstable and may change between versions.","type":"object","properties":[{"name":"boundingBox","description":"The bounding box in document coordinates. Note that scroll offset of the document is ignored.","$ref":"DOM.Rect"},{"name":"startCharacterIndex","description":"The starting index in characters, for this post layout textbox substring. Characters that\\nwould be represented as a surrogate pair in UTF-16 have length 2.","type":"integer"},{"name":"numCharacters","description":"The number of characters in this post layout textbox substring. Characters that would be\\nrepresented as a surrogate pair in UTF-16 have length 2.","type":"integer"}]},{"id":"LayoutTreeNode","description":"Details of an element in the DOM tree with a LayoutObject.","type":"object","properties":[{"name":"domNodeIndex","description":"The index of the related DOM node in the `domNodes` array returned by `getSnapshot`.","type":"integer"},{"name":"boundingBox","description":"The bounding box in document coordinates. Note that scroll offset of the document is ignored.","$ref":"DOM.Rect"},{"name":"layoutText","description":"Contents of the LayoutText, if any.","optional":true,"type":"string"},{"name":"inlineTextNodes","description":"The post-layout inline text nodes, if any.","optional":true,"type":"array","items":{"$ref":"InlineTextBox"}},{"name":"styleIndex","description":"Index into the `computedStyles` array returned by `getSnapshot`.","optional":true,"type":"integer"},{"name":"paintOrder","description":"Global paint order index, which is determined by the stacking order of the nodes. Nodes\\nthat are painted together will have the same index. Only provided if includePaintOrder in\\ngetSnapshot was true.","optional":true,"type":"integer"},{"name":"isStackingContext","description":"Set to true to indicate the element begins a new stacking context.","optional":true,"type":"boolean"}]},{"id":"ComputedStyle","description":"A subset of the full ComputedStyle as defined by the request whitelist.","type":"object","properties":[{"name":"properties","description":"Name/value pairs of computed style properties.","type":"array","items":{"$ref":"NameValue"}}]},{"id":"NameValue","description":"A name/value pair.","type":"object","properties":[{"name":"name","description":"Attribute/property name.","type":"string"},{"name":"value","description":"Attribute/property value.","type":"string"}]},{"id":"StringIndex","description":"Index of the string in the strings table.","type":"integer"},{"id":"ArrayOfStrings","description":"Index of the string in the strings table.","type":"array","items":{"$ref":"StringIndex"}},{"id":"RareStringData","description":"Data that is only present on rare nodes.","type":"object","properties":[{"name":"index","type":"array","items":{"type":"integer"}},{"name":"value","type":"array","items":{"$ref":"StringIndex"}}]},{"id":"RareBooleanData","type":"object","properties":[{"name":"index","type":"array","items":{"type":"integer"}}]},{"id":"RareIntegerData","type":"object","properties":[{"name":"index","type":"array","items":{"type":"integer"}},{"name":"value","type":"array","items":{"type":"integer"}}]},{"id":"Rectangle","type":"array","items":{"type":"number"}},{"id":"DocumentSnapshot","description":"Document snapshot.","type":"object","properties":[{"name":"documentURL","description":"Document URL that `Document` or `FrameOwner` node points to.","$ref":"StringIndex"},{"name":"baseURL","description":"Base URL that `Document` or `FrameOwner` node uses for URL completion.","$ref":"StringIndex"},{"name":"contentLanguage","description":"Contains the document\'s content language.","$ref":"StringIndex"},{"name":"encodingName","description":"Contains the document\'s character set encoding.","$ref":"StringIndex"},{"name":"publicId","description":"`DocumentType` node\'s publicId.","$ref":"StringIndex"},{"name":"systemId","description":"`DocumentType` node\'s systemId.","$ref":"StringIndex"},{"name":"frameId","description":"Frame ID for frame owner elements and also for the document node.","$ref":"StringIndex"},{"name":"nodes","description":"A table with dom nodes.","$ref":"NodeTreeSnapshot"},{"name":"layout","description":"The nodes in the layout tree.","$ref":"LayoutTreeSnapshot"},{"name":"textBoxes","description":"The post-layout inline text nodes.","$ref":"TextBoxSnapshot"},{"name":"scrollOffsetX","description":"Horizontal scroll offset.","optional":true,"type":"number"},{"name":"scrollOffsetY","description":"Vertical scroll offset.","optional":true,"type":"number"}]},{"id":"NodeTreeSnapshot","description":"Table containing nodes.","type":"object","properties":[{"name":"parentIndex","description":"Parent node index.","optional":true,"type":"array","items":{"type":"integer"}},{"name":"nodeType","description":"`Node`\'s nodeType.","optional":true,"type":"array","items":{"type":"integer"}},{"name":"nodeName","description":"`Node`\'s nodeName.","optional":true,"type":"array","items":{"$ref":"StringIndex"}},{"name":"nodeValue","description":"`Node`\'s nodeValue.","optional":true,"type":"array","items":{"$ref":"StringIndex"}},{"name":"backendNodeId","description":"`Node`\'s id, corresponds to DOM.Node.backendNodeId.","optional":true,"type":"array","items":{"$ref":"DOM.BackendNodeId"}},{"name":"attributes","description":"Attributes of an `Element` node. Flatten name, value pairs.","optional":true,"type":"array","items":{"$ref":"ArrayOfStrings"}},{"name":"textValue","description":"Only set for textarea elements, contains the text value.","optional":true,"$ref":"RareStringData"},{"name":"inputValue","description":"Only set for input elements, contains the input\'s associated text value.","optional":true,"$ref":"RareStringData"},{"name":"inputChecked","description":"Only set for radio and checkbox input elements, indicates if the element has been checked","optional":true,"$ref":"RareBooleanData"},{"name":"optionSelected","description":"Only set for option elements, indicates if the element has been selected","optional":true,"$ref":"RareBooleanData"},{"name":"contentDocumentIndex","description":"The index of the document in the list of the snapshot documents.","optional":true,"$ref":"RareIntegerData"},{"name":"pseudoType","description":"Type of a pseudo element node.","optional":true,"$ref":"RareStringData"},{"name":"isClickable","description":"Whether this DOM node responds to mouse clicks. This includes nodes that have had click\\nevent listeners attached via JavaScript as well as anchor tags that naturally navigate when\\nclicked.","optional":true,"$ref":"RareBooleanData"},{"name":"currentSourceURL","description":"The selected url for nodes with a srcset attribute.","optional":true,"$ref":"RareStringData"},{"name":"originURL","description":"The url of the script (if any) that generates this node.","optional":true,"$ref":"RareStringData"}]},{"id":"LayoutTreeSnapshot","description":"Table of details of an element in the DOM tree with a LayoutObject.","type":"object","properties":[{"name":"nodeIndex","description":"Index of the corresponding node in the `NodeTreeSnapshot` array returned by `captureSnapshot`.","type":"array","items":{"type":"integer"}},{"name":"styles","description":"Array of indexes specifying computed style strings, filtered according to the `computedStyles` parameter passed to `captureSnapshot`.","type":"array","items":{"$ref":"ArrayOfStrings"}},{"name":"bounds","description":"The absolute position bounding box.","type":"array","items":{"$ref":"Rectangle"}},{"name":"text","description":"Contents of the LayoutText, if any.","type":"array","items":{"$ref":"StringIndex"}},{"name":"stackingContexts","description":"Stacking context information.","$ref":"RareBooleanData"},{"name":"offsetRects","description":"The offset rect of nodes. Only available when includeDOMRects is set to true","optional":true,"type":"array","items":{"$ref":"Rectangle"}},{"name":"scrollRects","description":"The scroll rect of nodes. Only available when includeDOMRects is set to true","optional":true,"type":"array","items":{"$ref":"Rectangle"}},{"name":"clientRects","description":"The client rect of nodes. Only available when includeDOMRects is set to true","optional":true,"type":"array","items":{"$ref":"Rectangle"}}]},{"id":"TextBoxSnapshot","description":"Table of details of the post layout rendered text positions. The exact layout should not be regarded as\\nstable and may change between versions.","type":"object","properties":[{"name":"layoutIndex","description":"Index of the layout tree node that owns this box collection.","type":"array","items":{"type":"integer"}},{"name":"bounds","description":"The absolute position bounding box.","type":"array","items":{"$ref":"Rectangle"}},{"name":"start","description":"The starting index in characters, for this post layout textbox substring. Characters that\\nwould be represented as a surrogate pair in UTF-16 have length 2.","type":"array","items":{"type":"integer"}},{"name":"length","description":"The number of characters in this post layout textbox substring. Characters that would be\\nrepresented as a surrogate pair in UTF-16 have length 2.","type":"array","items":{"type":"integer"}}]}],"commands":[{"name":"disable","description":"Disables DOM snapshot agent for the given page."},{"name":"enable","description":"Enables DOM snapshot agent for the given page."},{"name":"getSnapshot","description":"Returns a document snapshot, including the full DOM tree of the root node (including iframes,\\ntemplate contents, and imported documents) in a flattened array, as well as layout and\\nwhite-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is\\nflattened.","deprecated":true,"parameters":[{"name":"computedStyleWhitelist","description":"Whitelist of computed styles to return.","type":"array","items":{"type":"string"}},{"name":"includeEventListeners","description":"Whether or not to retrieve details of DOM listeners (default false).","optional":true,"type":"boolean"},{"name":"includePaintOrder","description":"Whether to determine and include the paint order index of LayoutTreeNodes (default false).","optional":true,"type":"boolean"},{"name":"includeUserAgentShadowTree","description":"Whether to include UA shadow tree in the snapshot (default false).","optional":true,"type":"boolean"}],"returns":[{"name":"domNodes","description":"The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document.","type":"array","items":{"$ref":"DOMNode"}},{"name":"layoutTreeNodes","description":"The nodes in the layout tree.","type":"array","items":{"$ref":"LayoutTreeNode"}},{"name":"computedStyles","description":"Whitelisted ComputedStyle properties for each node in the layout tree.","type":"array","items":{"$ref":"ComputedStyle"}}]},{"name":"captureSnapshot","description":"Returns a document snapshot, including the full DOM tree of the root node (including iframes,\\ntemplate contents, and imported documents) in a flattened array, as well as layout and\\nwhite-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is\\nflattened.","parameters":[{"name":"computedStyles","description":"Whitelist of computed styles to return.","type":"array","items":{"type":"string"}},{"name":"includeDOMRects","description":"Whether to include DOM rectangles (offsetRects, clientRects, scrollRects) into the snapshot","optional":true,"type":"boolean"}],"returns":[{"name":"documents","description":"The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document.","type":"array","items":{"$ref":"DocumentSnapshot"}},{"name":"strings","description":"Shared string table that all string properties refer to with indexes.","type":"array","items":{"type":"string"}}]}]},{"domain":"DOMStorage","description":"Query and modify DOM storage.","experimental":true,"types":[{"id":"StorageId","description":"DOM Storage identifier.","type":"object","properties":[{"name":"securityOrigin","description":"Security origin for the storage.","type":"string"},{"name":"isLocalStorage","description":"Whether the storage is local storage (not session storage).","type":"boolean"}]},{"id":"Item","description":"DOM Storage item.","type":"array","items":{"type":"string"}}],"commands":[{"name":"clear","parameters":[{"name":"storageId","$ref":"StorageId"}]},{"name":"disable","description":"Disables storage tracking, prevents storage events from being sent to the client."},{"name":"enable","description":"Enables storage tracking, storage events will now be delivered to the client."},{"name":"getDOMStorageItems","parameters":[{"name":"storageId","$ref":"StorageId"}],"returns":[{"name":"entries","type":"array","items":{"$ref":"Item"}}]},{"name":"removeDOMStorageItem","parameters":[{"name":"storageId","$ref":"StorageId"},{"name":"key","type":"string"}]},{"name":"setDOMStorageItem","parameters":[{"name":"storageId","$ref":"StorageId"},{"name":"key","type":"string"},{"name":"value","type":"string"}]}],"events":[{"name":"domStorageItemAdded","parameters":[{"name":"storageId","$ref":"StorageId"},{"name":"key","type":"string"},{"name":"newValue","type":"string"}]},{"name":"domStorageItemRemoved","parameters":[{"name":"storageId","$ref":"StorageId"},{"name":"key","type":"string"}]},{"name":"domStorageItemUpdated","parameters":[{"name":"storageId","$ref":"StorageId"},{"name":"key","type":"string"},{"name":"oldValue","type":"string"},{"name":"newValue","type":"string"}]},{"name":"domStorageItemsCleared","parameters":[{"name":"storageId","$ref":"StorageId"}]}]},{"domain":"Database","experimental":true,"types":[{"id":"DatabaseId","description":"Unique identifier of Database object.","type":"string"},{"id":"Database","description":"Database object.","type":"object","properties":[{"name":"id","description":"Database ID.","$ref":"DatabaseId"},{"name":"domain","description":"Database domain.","type":"string"},{"name":"name","description":"Database name.","type":"string"},{"name":"version","description":"Database version.","type":"string"}]},{"id":"Error","description":"Database error.","type":"object","properties":[{"name":"message","description":"Error message.","type":"string"},{"name":"code","description":"Error code.","type":"integer"}]}],"commands":[{"name":"disable","description":"Disables database tracking, prevents database events from being sent to the client."},{"name":"enable","description":"Enables database tracking, database events will now be delivered to the client."},{"name":"executeSQL","parameters":[{"name":"databaseId","$ref":"DatabaseId"},{"name":"query","type":"string"}],"returns":[{"name":"columnNames","optional":true,"type":"array","items":{"type":"string"}},{"name":"values","optional":true,"type":"array","items":{"type":"any"}},{"name":"sqlError","optional":true,"$ref":"Error"}]},{"name":"getDatabaseTableNames","parameters":[{"name":"databaseId","$ref":"DatabaseId"}],"returns":[{"name":"tableNames","type":"array","items":{"type":"string"}}]}],"events":[{"name":"addDatabase","parameters":[{"name":"database","$ref":"Database"}]}]},{"domain":"DeviceOrientation","experimental":true,"commands":[{"name":"clearDeviceOrientationOverride","description":"Clears the overridden Device Orientation."},{"name":"setDeviceOrientationOverride","description":"Overrides the Device Orientation.","parameters":[{"name":"alpha","description":"Mock alpha","type":"number"},{"name":"beta","description":"Mock beta","type":"number"},{"name":"gamma","description":"Mock gamma","type":"number"}]}]},{"domain":"Emulation","description":"This domain emulates different environments for the page.","dependencies":["DOM","Page","Runtime"],"types":[{"id":"ScreenOrientation","description":"Screen orientation.","type":"object","properties":[{"name":"type","description":"Orientation type.","type":"string","enum":["portraitPrimary","portraitSecondary","landscapePrimary","landscapeSecondary"]},{"name":"angle","description":"Orientation angle.","type":"integer"}]},{"id":"VirtualTimePolicy","description":"advance: If the scheduler runs out of immediate work, the virtual time base may fast forward to\\nallow the next delayed task (if any) to run; pause: The virtual time base may not advance;\\npauseIfNetworkFetchesPending: The virtual time base may not advance if there are any pending\\nresource fetches.","experimental":true,"type":"string","enum":["advance","pause","pauseIfNetworkFetchesPending"]}],"commands":[{"name":"canEmulate","description":"Tells whether emulation is supported.","returns":[{"name":"result","description":"True if emulation is supported.","type":"boolean"}]},{"name":"clearDeviceMetricsOverride","description":"Clears the overriden device metrics."},{"name":"clearGeolocationOverride","description":"Clears the overriden Geolocation Position and Error."},{"name":"resetPageScaleFactor","description":"Requests that page scale factor is reset to initial values.","experimental":true},{"name":"setFocusEmulationEnabled","description":"Enables or disables simulating a focused and active page.","experimental":true,"parameters":[{"name":"enabled","description":"Whether to enable to disable focus emulation.","type":"boolean"}]},{"name":"setCPUThrottlingRate","description":"Enables CPU throttling to emulate slow CPUs.","experimental":true,"parameters":[{"name":"rate","description":"Throttling rate as a slowdown factor (1 is no throttle, 2 is 2x slowdown, etc).","type":"number"}]},{"name":"setDefaultBackgroundColorOverride","description":"Sets or clears an override of the default background color of the frame. This override is used\\nif the content does not specify one.","parameters":[{"name":"color","description":"RGBA of the default background color. If not specified, any existing override will be\\ncleared.","optional":true,"$ref":"DOM.RGBA"}]},{"name":"setDeviceMetricsOverride","description":"Overrides the values of device screen dimensions (window.screen.width, window.screen.height,\\nwindow.innerWidth, window.innerHeight, and \\"device-width\\"/\\"device-height\\"-related CSS media\\nquery results).","parameters":[{"name":"width","description":"Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.","type":"integer"},{"name":"height","description":"Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.","type":"integer"},{"name":"deviceScaleFactor","description":"Overriding device scale factor value. 0 disables the override.","type":"number"},{"name":"mobile","description":"Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text\\nautosizing and more.","type":"boolean"},{"name":"scale","description":"Scale to apply to resulting view image.","experimental":true,"optional":true,"type":"number"},{"name":"screenWidth","description":"Overriding screen width value in pixels (minimum 0, maximum 10000000).","experimental":true,"optional":true,"type":"integer"},{"name":"screenHeight","description":"Overriding screen height value in pixels (minimum 0, maximum 10000000).","experimental":true,"optional":true,"type":"integer"},{"name":"positionX","description":"Overriding view X position on screen in pixels (minimum 0, maximum 10000000).","experimental":true,"optional":true,"type":"integer"},{"name":"positionY","description":"Overriding view Y position on screen in pixels (minimum 0, maximum 10000000).","experimental":true,"optional":true,"type":"integer"},{"name":"dontSetVisibleSize","description":"Do not set visible view size, rely upon explicit setVisibleSize call.","experimental":true,"optional":true,"type":"boolean"},{"name":"screenOrientation","description":"Screen orientation override.","optional":true,"$ref":"ScreenOrientation"},{"name":"viewport","description":"If set, the visible area of the page will be overridden to this viewport. This viewport\\nchange is not observed by the page, e.g. viewport-relative elements do not change positions.","experimental":true,"optional":true,"$ref":"Page.Viewport"}]},{"name":"setScrollbarsHidden","experimental":true,"parameters":[{"name":"hidden","description":"Whether scrollbars should be always hidden.","type":"boolean"}]},{"name":"setDocumentCookieDisabled","experimental":true,"parameters":[{"name":"disabled","description":"Whether document.coookie API should be disabled.","type":"boolean"}]},{"name":"setEmitTouchEventsForMouse","experimental":true,"parameters":[{"name":"enabled","description":"Whether touch emulation based on mouse input should be enabled.","type":"boolean"},{"name":"configuration","description":"Touch/gesture events configuration. Default: current platform.","optional":true,"type":"string","enum":["mobile","desktop"]}]},{"name":"setEmulatedMedia","description":"Emulates the given media for CSS media queries.","parameters":[{"name":"media","description":"Media type to emulate. Empty string disables the override.","type":"string"}]},{"name":"setGeolocationOverride","description":"Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position\\nunavailable.","parameters":[{"name":"latitude","description":"Mock latitude","optional":true,"type":"number"},{"name":"longitude","description":"Mock longitude","optional":true,"type":"number"},{"name":"accuracy","description":"Mock accuracy","optional":true,"type":"number"}]},{"name":"setNavigatorOverrides","description":"Overrides value returned by the javascript navigator object.","experimental":true,"deprecated":true,"parameters":[{"name":"platform","description":"The platform navigator.platform should return.","type":"string"}]},{"name":"setPageScaleFactor","description":"Sets a specified page scale factor.","experimental":true,"parameters":[{"name":"pageScaleFactor","description":"Page scale factor.","type":"number"}]},{"name":"setScriptExecutionDisabled","description":"Switches script execution in the page.","parameters":[{"name":"value","description":"Whether script execution should be disabled in the page.","type":"boolean"}]},{"name":"setTouchEmulationEnabled","description":"Enables touch on platforms which do not support them.","parameters":[{"name":"enabled","description":"Whether the touch event emulation should be enabled.","type":"boolean"},{"name":"maxTouchPoints","description":"Maximum touch points supported. Defaults to one.","optional":true,"type":"integer"}]},{"name":"setVirtualTimePolicy","description":"Turns on virtual time for all frames (replacing real-time with a synthetic time source) and sets\\nthe current virtual time policy. Note this supersedes any previous time budget.","experimental":true,"parameters":[{"name":"policy","$ref":"VirtualTimePolicy"},{"name":"budget","description":"If set, after this many virtual milliseconds have elapsed virtual time will be paused and a\\nvirtualTimeBudgetExpired event is sent.","optional":true,"type":"number"},{"name":"maxVirtualTimeTaskStarvationCount","description":"If set this specifies the maximum number of tasks that can be run before virtual is forced\\nforwards to prevent deadlock.","optional":true,"type":"integer"},{"name":"waitForNavigation","description":"If set the virtual time policy change should be deferred until any frame starts navigating.\\nNote any previous deferred policy change is superseded.","optional":true,"type":"boolean"},{"name":"initialVirtualTime","description":"If set, base::Time::Now will be overriden to initially return this value.","optional":true,"$ref":"Network.TimeSinceEpoch"}],"returns":[{"name":"virtualTimeTicksBase","description":"Absolute timestamp at which virtual time was first enabled (up time in milliseconds).","type":"number"}]},{"name":"setTimezoneOverride","description":"Overrides default host system timezone with the specified one.","experimental":true,"parameters":[{"name":"timezoneId","description":"The timezone identifier. If empty, disables the override and\\nrestores default host system timezone.","type":"string"}]},{"name":"setVisibleSize","description":"Resizes the frame/viewport of the page. Note that this does not affect the frame\'s container\\n(e.g. browser window). Can be used to produce screenshots of the specified size. Not supported\\non Android.","experimental":true,"deprecated":true,"parameters":[{"name":"width","description":"Frame width (DIP).","type":"integer"},{"name":"height","description":"Frame height (DIP).","type":"integer"}]},{"name":"setUserAgentOverride","description":"Allows overriding user agent with the given string.","parameters":[{"name":"userAgent","description":"User agent to use.","type":"string"},{"name":"acceptLanguage","description":"Browser langugage to emulate.","optional":true,"type":"string"},{"name":"platform","description":"The platform navigator.platform should return.","optional":true,"type":"string"}]}],"events":[{"name":"virtualTimeBudgetExpired","description":"Notification sent after the virtual time budget for the current VirtualTimePolicy has run out.","experimental":true}]},{"domain":"HeadlessExperimental","description":"This domain provides experimental commands only supported in headless mode.","experimental":true,"dependencies":["Page","Runtime"],"types":[{"id":"ScreenshotParams","description":"Encoding options for a screenshot.","type":"object","properties":[{"name":"format","description":"Image compression format (defaults to png).","optional":true,"type":"string","enum":["jpeg","png"]},{"name":"quality","description":"Compression quality from range [0..100] (jpeg only).","optional":true,"type":"integer"}]}],"commands":[{"name":"beginFrame","description":"Sends a BeginFrame to the target and returns when the frame was completed. Optionally captures a\\nscreenshot from the resulting frame. Requires that the target was created with enabled\\nBeginFrameControl. Designed for use with --run-all-compositor-stages-before-draw, see also\\nhttps://goo.gl/3zHXhB for more background.","parameters":[{"name":"frameTimeTicks","description":"Timestamp of this BeginFrame in Renderer TimeTicks (milliseconds of uptime). If not set,\\nthe current time will be used.","optional":true,"type":"number"},{"name":"interval","description":"The interval between BeginFrames that is reported to the compositor, in milliseconds.\\nDefaults to a 60 frames/second interval, i.e. about 16.666 milliseconds.","optional":true,"type":"number"},{"name":"noDisplayUpdates","description":"Whether updates should not be committed and drawn onto the display. False by default. If\\ntrue, only side effects of the BeginFrame will be run, such as layout and animations, but\\nany visual updates may not be visible on the display or in screenshots.","optional":true,"type":"boolean"},{"name":"screenshot","description":"If set, a screenshot of the frame will be captured and returned in the response. Otherwise,\\nno screenshot will be captured. Note that capturing a screenshot can fail, for example,\\nduring renderer initialization. In such a case, no screenshot data will be returned.","optional":true,"$ref":"ScreenshotParams"}],"returns":[{"name":"hasDamage","description":"Whether the BeginFrame resulted in damage and, thus, a new frame was committed to the\\ndisplay. Reported for diagnostic uses, may be removed in the future.","type":"boolean"},{"name":"screenshotData","description":"Base64-encoded image data of the screenshot, if one was requested and successfully taken.","optional":true,"type":"string"}]},{"name":"disable","description":"Disables headless events for the target."},{"name":"enable","description":"Enables headless events for the target."}],"events":[{"name":"needsBeginFramesChanged","description":"Issued when the target starts or stops needing BeginFrames.","parameters":[{"name":"needsBeginFrames","description":"True if BeginFrames are needed, false otherwise.","type":"boolean"}]}]},{"domain":"IO","description":"Input/Output operations for streams produced by DevTools.","types":[{"id":"StreamHandle","description":"This is either obtained from another method or specifed as `blob:<uuid>` where\\n`<uuid>` is an UUID of a Blob.","type":"string"}],"commands":[{"name":"close","description":"Close the stream, discard any temporary backing storage.","parameters":[{"name":"handle","description":"Handle of the stream to close.","$ref":"StreamHandle"}]},{"name":"read","description":"Read a chunk of the stream","parameters":[{"name":"handle","description":"Handle of the stream to read.","$ref":"StreamHandle"},{"name":"offset","description":"Seek to the specified offset before reading (if not specificed, proceed with offset\\nfollowing the last read). Some types of streams may only support sequential reads.","optional":true,"type":"integer"},{"name":"size","description":"Maximum number of bytes to read (left upon the agent discretion if not specified).","optional":true,"type":"integer"}],"returns":[{"name":"base64Encoded","description":"Set if the data is base64-encoded","optional":true,"type":"boolean"},{"name":"data","description":"Data that were read.","type":"string"},{"name":"eof","description":"Set if the end-of-file condition occured while reading.","type":"boolean"}]},{"name":"resolveBlob","description":"Return UUID of Blob object specified by a remote object id.","parameters":[{"name":"objectId","description":"Object id of a Blob object wrapper.","$ref":"Runtime.RemoteObjectId"}],"returns":[{"name":"uuid","description":"UUID of the specified Blob.","type":"string"}]}]},{"domain":"IndexedDB","experimental":true,"dependencies":["Runtime"],"types":[{"id":"DatabaseWithObjectStores","description":"Database with an array of object stores.","type":"object","properties":[{"name":"name","description":"Database name.","type":"string"},{"name":"version","description":"Database version (type is not \'integer\', as the standard\\nrequires the version number to be \'unsigned long long\')","type":"number"},{"name":"objectStores","description":"Object stores in this database.","type":"array","items":{"$ref":"ObjectStore"}}]},{"id":"ObjectStore","description":"Object store.","type":"object","properties":[{"name":"name","description":"Object store name.","type":"string"},{"name":"keyPath","description":"Object store key path.","$ref":"KeyPath"},{"name":"autoIncrement","description":"If true, object store has auto increment flag set.","type":"boolean"},{"name":"indexes","description":"Indexes in this object store.","type":"array","items":{"$ref":"ObjectStoreIndex"}}]},{"id":"ObjectStoreIndex","description":"Object store index.","type":"object","properties":[{"name":"name","description":"Index name.","type":"string"},{"name":"keyPath","description":"Index key path.","$ref":"KeyPath"},{"name":"unique","description":"If true, index is unique.","type":"boolean"},{"name":"multiEntry","description":"If true, index allows multiple entries for a key.","type":"boolean"}]},{"id":"Key","description":"Key.","type":"object","properties":[{"name":"type","description":"Key type.","type":"string","enum":["number","string","date","array"]},{"name":"number","description":"Number value.","optional":true,"type":"number"},{"name":"string","description":"String value.","optional":true,"type":"string"},{"name":"date","description":"Date value.","optional":true,"type":"number"},{"name":"array","description":"Array value.","optional":true,"type":"array","items":{"$ref":"Key"}}]},{"id":"KeyRange","description":"Key range.","type":"object","properties":[{"name":"lower","description":"Lower bound.","optional":true,"$ref":"Key"},{"name":"upper","description":"Upper bound.","optional":true,"$ref":"Key"},{"name":"lowerOpen","description":"If true lower bound is open.","type":"boolean"},{"name":"upperOpen","description":"If true upper bound is open.","type":"boolean"}]},{"id":"DataEntry","description":"Data entry.","type":"object","properties":[{"name":"key","description":"Key object.","$ref":"Runtime.RemoteObject"},{"name":"primaryKey","description":"Primary key object.","$ref":"Runtime.RemoteObject"},{"name":"value","description":"Value object.","$ref":"Runtime.RemoteObject"}]},{"id":"KeyPath","description":"Key path.","type":"object","properties":[{"name":"type","description":"Key path type.","type":"string","enum":["null","string","array"]},{"name":"string","description":"String value.","optional":true,"type":"string"},{"name":"array","description":"Array value.","optional":true,"type":"array","items":{"type":"string"}}]}],"commands":[{"name":"clearObjectStore","description":"Clears all entries from an object store.","parameters":[{"name":"securityOrigin","description":"Security origin.","type":"string"},{"name":"databaseName","description":"Database name.","type":"string"},{"name":"objectStoreName","description":"Object store name.","type":"string"}]},{"name":"deleteDatabase","description":"Deletes a database.","parameters":[{"name":"securityOrigin","description":"Security origin.","type":"string"},{"name":"databaseName","description":"Database name.","type":"string"}]},{"name":"deleteObjectStoreEntries","description":"Delete a range of entries from an object store","parameters":[{"name":"securityOrigin","type":"string"},{"name":"databaseName","type":"string"},{"name":"objectStoreName","type":"string"},{"name":"keyRange","description":"Range of entry keys to delete","$ref":"KeyRange"}]},{"name":"disable","description":"Disables events from backend."},{"name":"enable","description":"Enables events from backend."},{"name":"requestData","description":"Requests data from object store or index.","parameters":[{"name":"securityOrigin","description":"Security origin.","type":"string"},{"name":"databaseName","description":"Database name.","type":"string"},{"name":"objectStoreName","description":"Object store name.","type":"string"},{"name":"indexName","description":"Index name, empty string for object store data requests.","type":"string"},{"name":"skipCount","description":"Number of records to skip.","type":"integer"},{"name":"pageSize","description":"Number of records to fetch.","type":"integer"},{"name":"keyRange","description":"Key range.","optional":true,"$ref":"KeyRange"}],"returns":[{"name":"objectStoreDataEntries","description":"Array of object store data entries.","type":"array","items":{"$ref":"DataEntry"}},{"name":"hasMore","description":"If true, there are more entries to fetch in the given range.","type":"boolean"}]},{"name":"getMetadata","description":"Gets metadata of an object store","parameters":[{"name":"securityOrigin","description":"Security origin.","type":"string"},{"name":"databaseName","description":"Database name.","type":"string"},{"name":"objectStoreName","description":"Object store name.","type":"string"}],"returns":[{"name":"entriesCount","description":"the entries count","type":"number"},{"name":"keyGeneratorValue","description":"the current value of key generator, to become the next inserted\\nkey into the object store. Valid if objectStore.autoIncrement\\nis true.","type":"number"}]},{"name":"requestDatabase","description":"Requests database with given name in given frame.","parameters":[{"name":"securityOrigin","description":"Security origin.","type":"string"},{"name":"databaseName","description":"Database name.","type":"string"}],"returns":[{"name":"databaseWithObjectStores","description":"Database with an array of object stores.","$ref":"DatabaseWithObjectStores"}]},{"name":"requestDatabaseNames","description":"Requests database names for given security origin.","parameters":[{"name":"securityOrigin","description":"Security origin.","type":"string"}],"returns":[{"name":"databaseNames","description":"Database names for origin.","type":"array","items":{"type":"string"}}]}]},{"domain":"Input","types":[{"id":"TouchPoint","type":"object","properties":[{"name":"x","description":"X coordinate of the event relative to the main frame\'s viewport in CSS pixels.","type":"number"},{"name":"y","description":"Y coordinate of the event relative to the main frame\'s viewport in CSS pixels. 0 refers to\\nthe top of the viewport and Y increases as it proceeds towards the bottom of the viewport.","type":"number"},{"name":"radiusX","description":"X radius of the touch area (default: 1.0).","optional":true,"type":"number"},{"name":"radiusY","description":"Y radius of the touch area (default: 1.0).","optional":true,"type":"number"},{"name":"rotationAngle","description":"Rotation angle (default: 0.0).","optional":true,"type":"number"},{"name":"force","description":"Force (default: 1.0).","optional":true,"type":"number"},{"name":"id","description":"Identifier used to track touch sources between events, must be unique within an event.","optional":true,"type":"number"}]},{"id":"GestureSourceType","experimental":true,"type":"string","enum":["default","touch","mouse"]},{"id":"TimeSinceEpoch","description":"UTC time in seconds, counted from January 1, 1970.","type":"number"}],"commands":[{"name":"dispatchKeyEvent","description":"Dispatches a key event to the page.","parameters":[{"name":"type","description":"Type of the key event.","type":"string","enum":["keyDown","keyUp","rawKeyDown","char"]},{"name":"modifiers","description":"Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8\\n(default: 0).","optional":true,"type":"integer"},{"name":"timestamp","description":"Time at which the event occurred.","optional":true,"$ref":"TimeSinceEpoch"},{"name":"text","description":"Text as generated by processing a virtual key code with a keyboard layout. Not needed for\\nfor `keyUp` and `rawKeyDown` events (default: \\"\\")","optional":true,"type":"string"},{"name":"unmodifiedText","description":"Text that would have been generated by the keyboard if no modifiers were pressed (except for\\nshift). Useful for shortcut (accelerator) key handling (default: \\"\\").","optional":true,"type":"string"},{"name":"keyIdentifier","description":"Unique key identifier (e.g., \'U+0041\') (default: \\"\\").","optional":true,"type":"string"},{"name":"code","description":"Unique DOM defined string value for each physical key (e.g., \'KeyA\') (default: \\"\\").","optional":true,"type":"string"},{"name":"key","description":"Unique DOM defined string value describing the meaning of the key in the context of active\\nmodifiers, keyboard layout, etc (e.g., \'AltGr\') (default: \\"\\").","optional":true,"type":"string"},{"name":"windowsVirtualKeyCode","description":"Windows virtual key code (default: 0).","optional":true,"type":"integer"},{"name":"nativeVirtualKeyCode","description":"Native virtual key code (default: 0).","optional":true,"type":"integer"},{"name":"autoRepeat","description":"Whether the event was generated from auto repeat (default: false).","optional":true,"type":"boolean"},{"name":"isKeypad","description":"Whether the event was generated from the keypad (default: false).","optional":true,"type":"boolean"},{"name":"isSystemKey","description":"Whether the event was a system key event (default: false).","optional":true,"type":"boolean"},{"name":"location","description":"Whether the event was from the left or right side of the keyboard. 1=Left, 2=Right (default:\\n0).","optional":true,"type":"integer"}]},{"name":"insertText","description":"This method emulates inserting text that doesn\'t come from a key press,\\nfor example an emoji keyboard or an IME.","experimental":true,"parameters":[{"name":"text","description":"The text to insert.","type":"string"}]},{"name":"dispatchMouseEvent","description":"Dispatches a mouse event to the page.","parameters":[{"name":"type","description":"Type of the mouse event.","type":"string","enum":["mousePressed","mouseReleased","mouseMoved","mouseWheel"]},{"name":"x","description":"X coordinate of the event relative to the main frame\'s viewport in CSS pixels.","type":"number"},{"name":"y","description":"Y coordinate of the event relative to the main frame\'s viewport in CSS pixels. 0 refers to\\nthe top of the viewport and Y increases as it proceeds towards the bottom of the viewport.","type":"number"},{"name":"modifiers","description":"Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8\\n(default: 0).","optional":true,"type":"integer"},{"name":"timestamp","description":"Time at which the event occurred.","optional":true,"$ref":"TimeSinceEpoch"},{"name":"button","description":"Mouse button (default: \\"none\\").","optional":true,"type":"string","enum":["none","left","middle","right","back","forward"]},{"name":"buttons","description":"A number indicating which buttons are pressed on the mouse when a mouse event is triggered.\\nLeft=1, Right=2, Middle=4, Back=8, Forward=16, None=0.","optional":true,"type":"integer"},{"name":"clickCount","description":"Number of times the mouse button was clicked (default: 0).","optional":true,"type":"integer"},{"name":"deltaX","description":"X delta in CSS pixels for mouse wheel event (default: 0).","optional":true,"type":"number"},{"name":"deltaY","description":"Y delta in CSS pixels for mouse wheel event (default: 0).","optional":true,"type":"number"},{"name":"pointerType","description":"Pointer type (default: \\"mouse\\").","optional":true,"type":"string","enum":["mouse","pen"]}]},{"name":"dispatchTouchEvent","description":"Dispatches a touch event to the page.","parameters":[{"name":"type","description":"Type of the touch event. TouchEnd and TouchCancel must not contain any touch points, while\\nTouchStart and TouchMove must contains at least one.","type":"string","enum":["touchStart","touchEnd","touchMove","touchCancel"]},{"name":"touchPoints","description":"Active touch points on the touch device. One event per any changed point (compared to\\nprevious touch event in a sequence) is generated, emulating pressing/moving/releasing points\\none by one.","type":"array","items":{"$ref":"TouchPoint"}},{"name":"modifiers","description":"Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8\\n(default: 0).","optional":true,"type":"integer"},{"name":"timestamp","description":"Time at which the event occurred.","optional":true,"$ref":"TimeSinceEpoch"}]},{"name":"emulateTouchFromMouseEvent","description":"Emulates touch event from the mouse event parameters.","experimental":true,"parameters":[{"name":"type","description":"Type of the mouse event.","type":"string","enum":["mousePressed","mouseReleased","mouseMoved","mouseWheel"]},{"name":"x","description":"X coordinate of the mouse pointer in DIP.","type":"integer"},{"name":"y","description":"Y coordinate of the mouse pointer in DIP.","type":"integer"},{"name":"button","description":"Mouse button.","type":"string","enum":["none","left","middle","right"]},{"name":"timestamp","description":"Time at which the event occurred (default: current time).","optional":true,"$ref":"TimeSinceEpoch"},{"name":"deltaX","description":"X delta in DIP for mouse wheel event (default: 0).","optional":true,"type":"number"},{"name":"deltaY","description":"Y delta in DIP for mouse wheel event (default: 0).","optional":true,"type":"number"},{"name":"modifiers","description":"Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8\\n(default: 0).","optional":true,"type":"integer"},{"name":"clickCount","description":"Number of times the mouse button was clicked (default: 0).","optional":true,"type":"integer"}]},{"name":"setIgnoreInputEvents","description":"Ignores input events (useful while auditing page).","parameters":[{"name":"ignore","description":"Ignores input events processing when set to true.","type":"boolean"}]},{"name":"synthesizePinchGesture","description":"Synthesizes a pinch gesture over a time period by issuing appropriate touch events.","experimental":true,"parameters":[{"name":"x","description":"X coordinate of the start of the gesture in CSS pixels.","type":"number"},{"name":"y","description":"Y coordinate of the start of the gesture in CSS pixels.","type":"number"},{"name":"scaleFactor","description":"Relative scale factor after zooming (>1.0 zooms in, <1.0 zooms out).","type":"number"},{"name":"relativeSpeed","description":"Relative pointer speed in pixels per second (default: 800).","optional":true,"type":"integer"},{"name":"gestureSourceType","description":"Which type of input events to be generated (default: \'default\', which queries the platform\\nfor the preferred input type).","optional":true,"$ref":"GestureSourceType"}]},{"name":"synthesizeScrollGesture","description":"Synthesizes a scroll gesture over a time period by issuing appropriate touch events.","experimental":true,"parameters":[{"name":"x","description":"X coordinate of the start of the gesture in CSS pixels.","type":"number"},{"name":"y","description":"Y coordinate of the start of the gesture in CSS pixels.","type":"number"},{"name":"xDistance","description":"The distance to scroll along the X axis (positive to scroll left).","optional":true,"type":"number"},{"name":"yDistance","description":"The distance to scroll along the Y axis (positive to scroll up).","optional":true,"type":"number"},{"name":"xOverscroll","description":"The number of additional pixels to scroll back along the X axis, in addition to the given\\ndistance.","optional":true,"type":"number"},{"name":"yOverscroll","description":"The number of additional pixels to scroll back along the Y axis, in addition to the given\\ndistance.","optional":true,"type":"number"},{"name":"preventFling","description":"Prevent fling (default: true).","optional":true,"type":"boolean"},{"name":"speed","description":"Swipe speed in pixels per second (default: 800).","optional":true,"type":"integer"},{"name":"gestureSourceType","description":"Which type of input events to be generated (default: \'default\', which queries the platform\\nfor the preferred input type).","optional":true,"$ref":"GestureSourceType"},{"name":"repeatCount","description":"The number of times to repeat the gesture (default: 0).","optional":true,"type":"integer"},{"name":"repeatDelayMs","description":"The number of milliseconds delay between each repeat. (default: 250).","optional":true,"type":"integer"},{"name":"interactionMarkerName","description":"The name of the interaction markers to generate, if not empty (default: \\"\\").","optional":true,"type":"string"}]},{"name":"synthesizeTapGesture","description":"Synthesizes a tap gesture over a time period by issuing appropriate touch events.","experimental":true,"parameters":[{"name":"x","description":"X coordinate of the start of the gesture in CSS pixels.","type":"number"},{"name":"y","description":"Y coordinate of the start of the gesture in CSS pixels.","type":"number"},{"name":"duration","description":"Duration between touchdown and touchup events in ms (default: 50).","optional":true,"type":"integer"},{"name":"tapCount","description":"Number of times to perform the tap (e.g. 2 for double tap, default: 1).","optional":true,"type":"integer"},{"name":"gestureSourceType","description":"Which type of input events to be generated (default: \'default\', which queries the platform\\nfor the preferred input type).","optional":true,"$ref":"GestureSourceType"}]}]},{"domain":"Inspector","experimental":true,"commands":[{"name":"disable","description":"Disables inspector domain notifications."},{"name":"enable","description":"Enables inspector domain notifications."}],"events":[{"name":"detached","description":"Fired when remote debugging connection is about to be terminated. Contains detach reason.","parameters":[{"name":"reason","description":"The reason why connection has been terminated.","type":"string"}]},{"name":"targetCrashed","description":"Fired when debugging target has crashed"},{"name":"targetReloadedAfterCrash","description":"Fired when debugging target has reloaded after crash"}]},{"domain":"LayerTree","experimental":true,"dependencies":["DOM"],"types":[{"id":"LayerId","description":"Unique Layer identifier.","type":"string"},{"id":"SnapshotId","description":"Unique snapshot identifier.","type":"string"},{"id":"ScrollRect","description":"Rectangle where scrolling happens on the main thread.","type":"object","properties":[{"name":"rect","description":"Rectangle itself.","$ref":"DOM.Rect"},{"name":"type","description":"Reason for rectangle to force scrolling on the main thread","type":"string","enum":["RepaintsOnScroll","TouchEventHandler","WheelEventHandler"]}]},{"id":"StickyPositionConstraint","description":"Sticky position constraints.","type":"object","properties":[{"name":"stickyBoxRect","description":"Layout rectangle of the sticky element before being shifted","$ref":"DOM.Rect"},{"name":"containingBlockRect","description":"Layout rectangle of the containing block of the sticky element","$ref":"DOM.Rect"},{"name":"nearestLayerShiftingStickyBox","description":"The nearest sticky layer that shifts the sticky box","optional":true,"$ref":"LayerId"},{"name":"nearestLayerShiftingContainingBlock","description":"The nearest sticky layer that shifts the containing block","optional":true,"$ref":"LayerId"}]},{"id":"PictureTile","description":"Serialized fragment of layer picture along with its offset within the layer.","type":"object","properties":[{"name":"x","description":"Offset from owning layer left boundary","type":"number"},{"name":"y","description":"Offset from owning layer top boundary","type":"number"},{"name":"picture","description":"Base64-encoded snapshot data.","type":"string"}]},{"id":"Layer","description":"Information about a compositing layer.","type":"object","properties":[{"name":"layerId","description":"The unique id for this layer.","$ref":"LayerId"},{"name":"parentLayerId","description":"The id of parent (not present for root).","optional":true,"$ref":"LayerId"},{"name":"backendNodeId","description":"The backend id for the node associated with this layer.","optional":true,"$ref":"DOM.BackendNodeId"},{"name":"offsetX","description":"Offset from parent layer, X coordinate.","type":"number"},{"name":"offsetY","description":"Offset from parent layer, Y coordinate.","type":"number"},{"name":"width","description":"Layer width.","type":"number"},{"name":"height","description":"Layer height.","type":"number"},{"name":"transform","description":"Transformation matrix for layer, default is identity matrix","optional":true,"type":"array","items":{"type":"number"}},{"name":"anchorX","description":"Transform anchor point X, absent if no transform specified","optional":true,"type":"number"},{"name":"anchorY","description":"Transform anchor point Y, absent if no transform specified","optional":true,"type":"number"},{"name":"anchorZ","description":"Transform anchor point Z, absent if no transform specified","optional":true,"type":"number"},{"name":"paintCount","description":"Indicates how many time this layer has painted.","type":"integer"},{"name":"drawsContent","description":"Indicates whether this layer hosts any content, rather than being used for\\ntransform/scrolling purposes only.","type":"boolean"},{"name":"invisible","description":"Set if layer is not visible.","optional":true,"type":"boolean"},{"name":"scrollRects","description":"Rectangles scrolling on main thread only.","optional":true,"type":"array","items":{"$ref":"ScrollRect"}},{"name":"stickyPositionConstraint","description":"Sticky position constraint information","optional":true,"$ref":"StickyPositionConstraint"}]},{"id":"PaintProfile","description":"Array of timings, one per paint step.","type":"array","items":{"type":"number"}}],"commands":[{"name":"compositingReasons","description":"Provides the reasons why the given layer was composited.","parameters":[{"name":"layerId","description":"The id of the layer for which we want to get the reasons it was composited.","$ref":"LayerId"}],"returns":[{"name":"compositingReasons","description":"A list of strings specifying reasons for the given layer to become composited.","type":"array","items":{"type":"string"}}]},{"name":"disable","description":"Disables compositing tree inspection."},{"name":"enable","description":"Enables compositing tree inspection."},{"name":"loadSnapshot","description":"Returns the snapshot identifier.","parameters":[{"name":"tiles","description":"An array of tiles composing the snapshot.","type":"array","items":{"$ref":"PictureTile"}}],"returns":[{"name":"snapshotId","description":"The id of the snapshot.","$ref":"SnapshotId"}]},{"name":"makeSnapshot","description":"Returns the layer snapshot identifier.","parameters":[{"name":"layerId","description":"The id of the layer.","$ref":"LayerId"}],"returns":[{"name":"snapshotId","description":"The id of the layer snapshot.","$ref":"SnapshotId"}]},{"name":"profileSnapshot","parameters":[{"name":"snapshotId","description":"The id of the layer snapshot.","$ref":"SnapshotId"},{"name":"minRepeatCount","description":"The maximum number of times to replay the snapshot (1, if not specified).","optional":true,"type":"integer"},{"name":"minDuration","description":"The minimum duration (in seconds) to replay the snapshot.","optional":true,"type":"number"},{"name":"clipRect","description":"The clip rectangle to apply when replaying the snapshot.","optional":true,"$ref":"DOM.Rect"}],"returns":[{"name":"timings","description":"The array of paint profiles, one per run.","type":"array","items":{"$ref":"PaintProfile"}}]},{"name":"releaseSnapshot","description":"Releases layer snapshot captured by the back-end.","parameters":[{"name":"snapshotId","description":"The id of the layer snapshot.","$ref":"SnapshotId"}]},{"name":"replaySnapshot","description":"Replays the layer snapshot and returns the resulting bitmap.","parameters":[{"name":"snapshotId","description":"The id of the layer snapshot.","$ref":"SnapshotId"},{"name":"fromStep","description":"The first step to replay from (replay from the very start if not specified).","optional":true,"type":"integer"},{"name":"toStep","description":"The last step to replay to (replay till the end if not specified).","optional":true,"type":"integer"},{"name":"scale","description":"The scale to apply while replaying (defaults to 1).","optional":true,"type":"number"}],"returns":[{"name":"dataURL","description":"A data: URL for resulting image.","type":"string"}]},{"name":"snapshotCommandLog","description":"Replays the layer snapshot and returns canvas log.","parameters":[{"name":"snapshotId","description":"The id of the layer snapshot.","$ref":"SnapshotId"}],"returns":[{"name":"commandLog","description":"The array of canvas function calls.","type":"array","items":{"type":"object"}}]}],"events":[{"name":"layerPainted","parameters":[{"name":"layerId","description":"The id of the painted layer.","$ref":"LayerId"},{"name":"clip","description":"Clip rectangle.","$ref":"DOM.Rect"}]},{"name":"layerTreeDidChange","parameters":[{"name":"layers","description":"Layer tree, absent if not in the comspositing mode.","optional":true,"type":"array","items":{"$ref":"Layer"}}]}]},{"domain":"Log","description":"Provides access to log entries.","dependencies":["Runtime","Network"],"types":[{"id":"LogEntry","description":"Log entry.","type":"object","properties":[{"name":"source","description":"Log entry source.","type":"string","enum":["xml","javascript","network","storage","appcache","rendering","security","deprecation","worker","violation","intervention","recommendation","other"]},{"name":"level","description":"Log entry severity.","type":"string","enum":["verbose","info","warning","error"]},{"name":"text","description":"Logged text.","type":"string"},{"name":"timestamp","description":"Timestamp when this entry was added.","$ref":"Runtime.Timestamp"},{"name":"url","description":"URL of the resource if known.","optional":true,"type":"string"},{"name":"lineNumber","description":"Line number in the resource.","optional":true,"type":"integer"},{"name":"stackTrace","description":"JavaScript stack trace.","optional":true,"$ref":"Runtime.StackTrace"},{"name":"networkRequestId","description":"Identifier of the network request associated with this entry.","optional":true,"$ref":"Network.RequestId"},{"name":"workerId","description":"Identifier of the worker associated with this entry.","optional":true,"type":"string"},{"name":"args","description":"Call arguments.","optional":true,"type":"array","items":{"$ref":"Runtime.RemoteObject"}}]},{"id":"ViolationSetting","description":"Violation configuration setting.","type":"object","properties":[{"name":"name","description":"Violation type.","type":"string","enum":["longTask","longLayout","blockedEvent","blockedParser","discouragedAPIUse","handler","recurringHandler"]},{"name":"threshold","description":"Time threshold to trigger upon.","type":"number"}]}],"commands":[{"name":"clear","description":"Clears the log."},{"name":"disable","description":"Disables log domain, prevents further log entries from being reported to the client."},{"name":"enable","description":"Enables log domain, sends the entries collected so far to the client by means of the\\n`entryAdded` notification."},{"name":"startViolationsReport","description":"start violation reporting.","parameters":[{"name":"config","description":"Configuration for violations.","type":"array","items":{"$ref":"ViolationSetting"}}]},{"name":"stopViolationsReport","description":"Stop violation reporting."}],"events":[{"name":"entryAdded","description":"Issued when new message was logged.","parameters":[{"name":"entry","description":"The entry.","$ref":"LogEntry"}]}]},{"domain":"Memory","experimental":true,"types":[{"id":"PressureLevel","description":"Memory pressure level.","type":"string","enum":["moderate","critical"]},{"id":"SamplingProfileNode","description":"Heap profile sample.","type":"object","properties":[{"name":"size","description":"Size of the sampled allocation.","type":"number"},{"name":"total","description":"Total bytes attributed to this sample.","type":"number"},{"name":"stack","description":"Execution stack at the point of allocation.","type":"array","items":{"type":"string"}}]},{"id":"SamplingProfile","description":"Array of heap profile samples.","type":"object","properties":[{"name":"samples","type":"array","items":{"$ref":"SamplingProfileNode"}},{"name":"modules","type":"array","items":{"$ref":"Module"}}]},{"id":"Module","description":"Executable module information","type":"object","properties":[{"name":"name","description":"Name of the module.","type":"string"},{"name":"uuid","description":"UUID of the module.","type":"string"},{"name":"baseAddress","description":"Base address where the module is loaded into memory. Encoded as a decimal\\nor hexadecimal (0x prefixed) string.","type":"string"},{"name":"size","description":"Size of the module in bytes.","type":"number"}]}],"commands":[{"name":"getDOMCounters","returns":[{"name":"documents","type":"integer"},{"name":"nodes","type":"integer"},{"name":"jsEventListeners","type":"integer"}]},{"name":"prepareForLeakDetection"},{"name":"forciblyPurgeJavaScriptMemory","description":"Simulate OomIntervention by purging V8 memory."},{"name":"setPressureNotificationsSuppressed","description":"Enable/disable suppressing memory pressure notifications in all processes.","parameters":[{"name":"suppressed","description":"If true, memory pressure notifications will be suppressed.","type":"boolean"}]},{"name":"simulatePressureNotification","description":"Simulate a memory pressure notification in all processes.","parameters":[{"name":"level","description":"Memory pressure level of the notification.","$ref":"PressureLevel"}]},{"name":"startSampling","description":"Start collecting native memory profile.","parameters":[{"name":"samplingInterval","description":"Average number of bytes between samples.","optional":true,"type":"integer"},{"name":"suppressRandomness","description":"Do not randomize intervals between samples.","optional":true,"type":"boolean"}]},{"name":"stopSampling","description":"Stop collecting native memory profile."},{"name":"getAllTimeSamplingProfile","description":"Retrieve native memory allocations profile\\ncollected since renderer process startup.","returns":[{"name":"profile","$ref":"SamplingProfile"}]},{"name":"getBrowserSamplingProfile","description":"Retrieve native memory allocations profile\\ncollected since browser process startup.","returns":[{"name":"profile","$ref":"SamplingProfile"}]},{"name":"getSamplingProfile","description":"Retrieve native memory allocations profile collected since last\\n`startSampling` call.","returns":[{"name":"profile","$ref":"SamplingProfile"}]}]},{"domain":"Network","description":"Network domain allows tracking network activities of the page. It exposes information about http,\\nfile, data and other requests and responses, their headers, bodies, timing, etc.","dependencies":["Debugger","Runtime","Security"],"types":[{"id":"ResourceType","description":"Resource type as it was perceived by the rendering engine.","type":"string","enum":["Document","Stylesheet","Image","Media","Font","Script","TextTrack","XHR","Fetch","EventSource","WebSocket","Manifest","SignedExchange","Ping","CSPViolationReport","Other"]},{"id":"LoaderId","description":"Unique loader identifier.","type":"string"},{"id":"RequestId","description":"Unique request identifier.","type":"string"},{"id":"InterceptionId","description":"Unique intercepted request identifier.","type":"string"},{"id":"ErrorReason","description":"Network level fetch failure reason.","type":"string","enum":["Failed","Aborted","TimedOut","AccessDenied","ConnectionClosed","ConnectionReset","ConnectionRefused","ConnectionAborted","ConnectionFailed","NameNotResolved","InternetDisconnected","AddressUnreachable","BlockedByClient","BlockedByResponse"]},{"id":"TimeSinceEpoch","description":"UTC time in seconds, counted from January 1, 1970.","type":"number"},{"id":"MonotonicTime","description":"Monotonically increasing time in seconds since an arbitrary point in the past.","type":"number"},{"id":"Headers","description":"Request / response headers as keys / values of JSON object.","type":"object"},{"id":"ConnectionType","description":"The underlying connection technology that the browser is supposedly using.","type":"string","enum":["none","cellular2g","cellular3g","cellular4g","bluetooth","ethernet","wifi","wimax","other"]},{"id":"CookieSameSite","description":"Represents the cookie\'s \'SameSite\' status:\\nhttps://tools.ietf.org/html/draft-west-first-party-cookies","type":"string","enum":["Strict","Lax","Extended","None"]},{"id":"ResourceTiming","description":"Timing information for the request.","type":"object","properties":[{"name":"requestTime","description":"Timing\'s requestTime is a baseline in seconds, while the other numbers are ticks in\\nmilliseconds relatively to this requestTime.","type":"number"},{"name":"proxyStart","description":"Started resolving proxy.","type":"number"},{"name":"proxyEnd","description":"Finished resolving proxy.","type":"number"},{"name":"dnsStart","description":"Started DNS address resolve.","type":"number"},{"name":"dnsEnd","description":"Finished DNS address resolve.","type":"number"},{"name":"connectStart","description":"Started connecting to the remote host.","type":"number"},{"name":"connectEnd","description":"Connected to the remote host.","type":"number"},{"name":"sslStart","description":"Started SSL handshake.","type":"number"},{"name":"sslEnd","description":"Finished SSL handshake.","type":"number"},{"name":"workerStart","description":"Started running ServiceWorker.","experimental":true,"type":"number"},{"name":"workerReady","description":"Finished Starting ServiceWorker.","experimental":true,"type":"number"},{"name":"sendStart","description":"Started sending request.","type":"number"},{"name":"sendEnd","description":"Finished sending request.","type":"number"},{"name":"pushStart","description":"Time the server started pushing request.","experimental":true,"type":"number"},{"name":"pushEnd","description":"Time the server finished pushing request.","experimental":true,"type":"number"},{"name":"receiveHeadersEnd","description":"Finished receiving response headers.","type":"number"}]},{"id":"ResourcePriority","description":"Loading priority of a resource request.","type":"string","enum":["VeryLow","Low","Medium","High","VeryHigh"]},{"id":"Request","description":"HTTP request data.","type":"object","properties":[{"name":"url","description":"Request URL (without fragment).","type":"string"},{"name":"urlFragment","description":"Fragment of the requested URL starting with hash, if present.","optional":true,"type":"string"},{"name":"method","description":"HTTP request method.","type":"string"},{"name":"headers","description":"HTTP request headers.","$ref":"Headers"},{"name":"postData","description":"HTTP POST request data.","optional":true,"type":"string"},{"name":"hasPostData","description":"True when the request has POST data. Note that postData might still be omitted when this flag is true when the data is too long.","optional":true,"type":"boolean"},{"name":"mixedContentType","description":"The mixed content type of the request.","optional":true,"$ref":"Security.MixedContentType"},{"name":"initialPriority","description":"Priority of the resource request at the time request is sent.","$ref":"ResourcePriority"},{"name":"referrerPolicy","description":"The referrer policy of the request, as defined in https://www.w3.org/TR/referrer-policy/","type":"string","enum":["unsafe-url","no-referrer-when-downgrade","no-referrer","origin","origin-when-cross-origin","same-origin","strict-origin","strict-origin-when-cross-origin"]},{"name":"isLinkPreload","description":"Whether is loaded via link preload.","optional":true,"type":"boolean"}]},{"id":"SignedCertificateTimestamp","description":"Details of a signed certificate timestamp (SCT).","type":"object","properties":[{"name":"status","description":"Validation status.","type":"string"},{"name":"origin","description":"Origin.","type":"string"},{"name":"logDescription","description":"Log name / description.","type":"string"},{"name":"logId","description":"Log ID.","type":"string"},{"name":"timestamp","description":"Issuance date.","$ref":"TimeSinceEpoch"},{"name":"hashAlgorithm","description":"Hash algorithm.","type":"string"},{"name":"signatureAlgorithm","description":"Signature algorithm.","type":"string"},{"name":"signatureData","description":"Signature data.","type":"string"}]},{"id":"SecurityDetails","description":"Security details about a request.","type":"object","properties":[{"name":"protocol","description":"Protocol name (e.g. \\"TLS 1.2\\" or \\"QUIC\\").","type":"string"},{"name":"keyExchange","description":"Key Exchange used by the connection, or the empty string if not applicable.","type":"string"},{"name":"keyExchangeGroup","description":"(EC)DH group used by the connection, if applicable.","optional":true,"type":"string"},{"name":"cipher","description":"Cipher name.","type":"string"},{"name":"mac","description":"TLS MAC. Note that AEAD ciphers do not have separate MACs.","optional":true,"type":"string"},{"name":"certificateId","description":"Certificate ID value.","$ref":"Security.CertificateId"},{"name":"subjectName","description":"Certificate subject name.","type":"string"},{"name":"sanList","description":"Subject Alternative Name (SAN) DNS names and IP addresses.","type":"array","items":{"type":"string"}},{"name":"issuer","description":"Name of the issuing CA.","type":"string"},{"name":"validFrom","description":"Certificate valid from date.","$ref":"TimeSinceEpoch"},{"name":"validTo","description":"Certificate valid to (expiration) date","$ref":"TimeSinceEpoch"},{"name":"signedCertificateTimestampList","description":"List of signed certificate timestamps (SCTs).","type":"array","items":{"$ref":"SignedCertificateTimestamp"}},{"name":"certificateTransparencyCompliance","description":"Whether the request complied with Certificate Transparency policy","$ref":"CertificateTransparencyCompliance"}]},{"id":"CertificateTransparencyCompliance","description":"Whether the request complied with Certificate Transparency policy.","type":"string","enum":["unknown","not-compliant","compliant"]},{"id":"BlockedReason","description":"The reason why request was blocked.","type":"string","enum":["other","csp","mixed-content","origin","inspector","subresource-filter","content-type","collapsed-by-client"]},{"id":"Response","description":"HTTP response data.","type":"object","properties":[{"name":"url","description":"Response URL. This URL can be different from CachedResource.url in case of redirect.","type":"string"},{"name":"status","description":"HTTP response status code.","type":"integer"},{"name":"statusText","description":"HTTP response status text.","type":"string"},{"name":"headers","description":"HTTP response headers.","$ref":"Headers"},{"name":"headersText","description":"HTTP response headers text.","optional":true,"type":"string"},{"name":"mimeType","description":"Resource mimeType as determined by the browser.","type":"string"},{"name":"requestHeaders","description":"Refined HTTP request headers that were actually transmitted over the network.","optional":true,"$ref":"Headers"},{"name":"requestHeadersText","description":"HTTP request headers text.","optional":true,"type":"string"},{"name":"connectionReused","description":"Specifies whether physical connection was actually reused for this request.","type":"boolean"},{"name":"connectionId","description":"Physical connection id that was actually used for this request.","type":"number"},{"name":"remoteIPAddress","description":"Remote IP address.","optional":true,"type":"string"},{"name":"remotePort","description":"Remote port.","optional":true,"type":"integer"},{"name":"fromDiskCache","description":"Specifies that the request was served from the disk cache.","optional":true,"type":"boolean"},{"name":"fromServiceWorker","description":"Specifies that the request was served from the ServiceWorker.","optional":true,"type":"boolean"},{"name":"fromPrefetchCache","description":"Specifies that the request was served from the prefetch cache.","optional":true,"type":"boolean"},{"name":"encodedDataLength","description":"Total number of bytes received for this request so far.","type":"number"},{"name":"timing","description":"Timing information for the given request.","optional":true,"$ref":"ResourceTiming"},{"name":"protocol","description":"Protocol used to fetch this request.","optional":true,"type":"string"},{"name":"securityState","description":"Security state of the request resource.","$ref":"Security.SecurityState"},{"name":"securityDetails","description":"Security details for the request.","optional":true,"$ref":"SecurityDetails"}]},{"id":"WebSocketRequest","description":"WebSocket request data.","type":"object","properties":[{"name":"headers","description":"HTTP request headers.","$ref":"Headers"}]},{"id":"WebSocketResponse","description":"WebSocket response data.","type":"object","properties":[{"name":"status","description":"HTTP response status code.","type":"integer"},{"name":"statusText","description":"HTTP response status text.","type":"string"},{"name":"headers","description":"HTTP response headers.","$ref":"Headers"},{"name":"headersText","description":"HTTP response headers text.","optional":true,"type":"string"},{"name":"requestHeaders","description":"HTTP request headers.","optional":true,"$ref":"Headers"},{"name":"requestHeadersText","description":"HTTP request headers text.","optional":true,"type":"string"}]},{"id":"WebSocketFrame","description":"WebSocket message data. This represents an entire WebSocket message, not just a fragmented frame as the name suggests.","type":"object","properties":[{"name":"opcode","description":"WebSocket message opcode.","type":"number"},{"name":"mask","description":"WebSocket message mask.","type":"boolean"},{"name":"payloadData","description":"WebSocket message payload data.\\nIf the opcode is 1, this is a text message and payloadData is a UTF-8 string.\\nIf the opcode isn\'t 1, then payloadData is a base64 encoded string representing binary data.","type":"string"}]},{"id":"CachedResource","description":"Information about the cached resource.","type":"object","properties":[{"name":"url","description":"Resource URL. This is the url of the original network request.","type":"string"},{"name":"type","description":"Type of this resource.","$ref":"ResourceType"},{"name":"response","description":"Cached response data.","optional":true,"$ref":"Response"},{"name":"bodySize","description":"Cached response body size.","type":"number"}]},{"id":"Initiator","description":"Information about the request initiator.","type":"object","properties":[{"name":"type","description":"Type of this initiator.","type":"string","enum":["parser","script","preload","SignedExchange","other"]},{"name":"stack","description":"Initiator JavaScript stack trace, set for Script only.","optional":true,"$ref":"Runtime.StackTrace"},{"name":"url","description":"Initiator URL, set for Parser type or for Script type (when script is importing module) or for SignedExchange type.","optional":true,"type":"string"},{"name":"lineNumber","description":"Initiator line number, set for Parser type or for Script type (when script is importing\\nmodule) (0-based).","optional":true,"type":"number"}]},{"id":"Cookie","description":"Cookie object","type":"object","properties":[{"name":"name","description":"Cookie name.","type":"string"},{"name":"value","description":"Cookie value.","type":"string"},{"name":"domain","description":"Cookie domain.","type":"string"},{"name":"path","description":"Cookie path.","type":"string"},{"name":"expires","description":"Cookie expiration date as the number of seconds since the UNIX epoch.","type":"number"},{"name":"size","description":"Cookie size.","type":"integer"},{"name":"httpOnly","description":"True if cookie is http-only.","type":"boolean"},{"name":"secure","description":"True if cookie is secure.","type":"boolean"},{"name":"session","description":"True in case of session cookie.","type":"boolean"},{"name":"sameSite","description":"Cookie SameSite type.","optional":true,"$ref":"CookieSameSite"}]},{"id":"CookieParam","description":"Cookie parameter object","type":"object","properties":[{"name":"name","description":"Cookie name.","type":"string"},{"name":"value","description":"Cookie value.","type":"string"},{"name":"url","description":"The request-URI to associate with the setting of the cookie. This value can affect the\\ndefault domain and path values of the created cookie.","optional":true,"type":"string"},{"name":"domain","description":"Cookie domain.","optional":true,"type":"string"},{"name":"path","description":"Cookie path.","optional":true,"type":"string"},{"name":"secure","description":"True if cookie is secure.","optional":true,"type":"boolean"},{"name":"httpOnly","description":"True if cookie is http-only.","optional":true,"type":"boolean"},{"name":"sameSite","description":"Cookie SameSite type.","optional":true,"$ref":"CookieSameSite"},{"name":"expires","description":"Cookie expiration date, session cookie if not set","optional":true,"$ref":"TimeSinceEpoch"}]},{"id":"AuthChallenge","description":"Authorization challenge for HTTP status code 401 or 407.","experimental":true,"type":"object","properties":[{"name":"source","description":"Source of the authentication challenge.","optional":true,"type":"string","enum":["Server","Proxy"]},{"name":"origin","description":"Origin of the challenger.","type":"string"},{"name":"scheme","description":"The authentication scheme used, such as basic or digest","type":"string"},{"name":"realm","description":"The realm of the challenge. May be empty.","type":"string"}]},{"id":"AuthChallengeResponse","description":"Response to an AuthChallenge.","experimental":true,"type":"object","properties":[{"name":"response","description":"The decision on what to do in response to the authorization challenge. Default means\\ndeferring to the default behavior of the net stack, which will likely either the Cancel\\nauthentication or display a popup dialog box.","type":"string","enum":["Default","CancelAuth","ProvideCredentials"]},{"name":"username","description":"The username to provide, possibly empty. Should only be set if response is\\nProvideCredentials.","optional":true,"type":"string"},{"name":"password","description":"The password to provide, possibly empty. Should only be set if response is\\nProvideCredentials.","optional":true,"type":"string"}]},{"id":"InterceptionStage","description":"Stages of the interception to begin intercepting. Request will intercept before the request is\\nsent. Response will intercept after the response is received.","experimental":true,"type":"string","enum":["Request","HeadersReceived"]},{"id":"RequestPattern","description":"Request pattern for interception.","experimental":true,"type":"object","properties":[{"name":"urlPattern","description":"Wildcards (\'*\' -> zero or more, \'?\' -> exactly one) are allowed. Escape character is\\nbackslash. Omitting is equivalent to \\"*\\".","optional":true,"type":"string"},{"name":"resourceType","description":"If set, only requests for matching resource types will be intercepted.","optional":true,"$ref":"ResourceType"},{"name":"interceptionStage","description":"Stage at wich to begin intercepting requests. Default is Request.","optional":true,"$ref":"InterceptionStage"}]},{"id":"SignedExchangeSignature","description":"Information about a signed exchange signature.\\nhttps://wicg.github.io/webpackage/draft-yasskin-httpbis-origin-signed-exchanges-impl.html#rfc.section.3.1","experimental":true,"type":"object","properties":[{"name":"label","description":"Signed exchange signature label.","type":"string"},{"name":"signature","description":"The hex string of signed exchange signature.","type":"string"},{"name":"integrity","description":"Signed exchange signature integrity.","type":"string"},{"name":"certUrl","description":"Signed exchange signature cert Url.","optional":true,"type":"string"},{"name":"certSha256","description":"The hex string of signed exchange signature cert sha256.","optional":true,"type":"string"},{"name":"validityUrl","description":"Signed exchange signature validity Url.","type":"string"},{"name":"date","description":"Signed exchange signature date.","type":"integer"},{"name":"expires","description":"Signed exchange signature expires.","type":"integer"},{"name":"certificates","description":"The encoded certificates.","optional":true,"type":"array","items":{"type":"string"}}]},{"id":"SignedExchangeHeader","description":"Information about a signed exchange header.\\nhttps://wicg.github.io/webpackage/draft-yasskin-httpbis-origin-signed-exchanges-impl.html#cbor-representation","experimental":true,"type":"object","properties":[{"name":"requestUrl","description":"Signed exchange request URL.","type":"string"},{"name":"responseCode","description":"Signed exchange response code.","type":"integer"},{"name":"responseHeaders","description":"Signed exchange response headers.","$ref":"Headers"},{"name":"signatures","description":"Signed exchange response signature.","type":"array","items":{"$ref":"SignedExchangeSignature"}},{"name":"headerIntegrity","description":"Signed exchange header integrity hash in the form of \\"sha256-\\".","type":"string"}]},{"id":"SignedExchangeErrorField","description":"Field type for a signed exchange related error.","experimental":true,"type":"string","enum":["signatureSig","signatureIntegrity","signatureCertUrl","signatureCertSha256","signatureValidityUrl","signatureTimestamps"]},{"id":"SignedExchangeError","description":"Information about a signed exchange response.","experimental":true,"type":"object","properties":[{"name":"message","description":"Error message.","type":"string"},{"name":"signatureIndex","description":"The index of the signature which caused the error.","optional":true,"type":"integer"},{"name":"errorField","description":"The field which caused the error.","optional":true,"$ref":"SignedExchangeErrorField"}]},{"id":"SignedExchangeInfo","description":"Information about a signed exchange response.","experimental":true,"type":"object","properties":[{"name":"outerResponse","description":"The outer response of signed HTTP exchange which was received from network.","$ref":"Response"},{"name":"header","description":"Information about the signed exchange header.","optional":true,"$ref":"SignedExchangeHeader"},{"name":"securityDetails","description":"Security details for the signed exchange header.","optional":true,"$ref":"SecurityDetails"},{"name":"errors","description":"Errors occurred while handling the signed exchagne.","optional":true,"type":"array","items":{"$ref":"SignedExchangeError"}}]}],"commands":[{"name":"canClearBrowserCache","description":"Tells whether clearing browser cache is supported.","deprecated":true,"returns":[{"name":"result","description":"True if browser cache can be cleared.","type":"boolean"}]},{"name":"canClearBrowserCookies","description":"Tells whether clearing browser cookies is supported.","deprecated":true,"returns":[{"name":"result","description":"True if browser cookies can be cleared.","type":"boolean"}]},{"name":"canEmulateNetworkConditions","description":"Tells whether emulation of network conditions is supported.","deprecated":true,"returns":[{"name":"result","description":"True if emulation of network conditions is supported.","type":"boolean"}]},{"name":"clearBrowserCache","description":"Clears browser cache."},{"name":"clearBrowserCookies","description":"Clears browser cookies."},{"name":"continueInterceptedRequest","description":"Response to Network.requestIntercepted which either modifies the request to continue with any\\nmodifications, or blocks it, or completes it with the provided response bytes. If a network\\nfetch occurs as a result which encounters a redirect an additional Network.requestIntercepted\\nevent will be sent with the same InterceptionId.\\nDeprecated, use Fetch.continueRequest, Fetch.fulfillRequest and Fetch.failRequest instead.","experimental":true,"deprecated":true,"parameters":[{"name":"interceptionId","$ref":"InterceptionId"},{"name":"errorReason","description":"If set this causes the request to fail with the given reason. Passing `Aborted` for requests\\nmarked with `isNavigationRequest` also cancels the navigation. Must not be set in response\\nto an authChallenge.","optional":true,"$ref":"ErrorReason"},{"name":"rawResponse","description":"If set the requests completes using with the provided base64 encoded raw response, including\\nHTTP status line and headers etc... Must not be set in response to an authChallenge.","optional":true,"type":"string"},{"name":"url","description":"If set the request url will be modified in a way that\'s not observable by page. Must not be\\nset in response to an authChallenge.","optional":true,"type":"string"},{"name":"method","description":"If set this allows the request method to be overridden. Must not be set in response to an\\nauthChallenge.","optional":true,"type":"string"},{"name":"postData","description":"If set this allows postData to be set. Must not be set in response to an authChallenge.","optional":true,"type":"string"},{"name":"headers","description":"If set this allows the request headers to be changed. Must not be set in response to an\\nauthChallenge.","optional":true,"$ref":"Headers"},{"name":"authChallengeResponse","description":"Response to a requestIntercepted with an authChallenge. Must not be set otherwise.","optional":true,"$ref":"AuthChallengeResponse"}]},{"name":"deleteCookies","description":"Deletes browser cookies with matching name and url or domain/path pair.","parameters":[{"name":"name","description":"Name of the cookies to remove.","type":"string"},{"name":"url","description":"If specified, deletes all the cookies with the given name where domain and path match\\nprovided URL.","optional":true,"type":"string"},{"name":"domain","description":"If specified, deletes only cookies with the exact domain.","optional":true,"type":"string"},{"name":"path","description":"If specified, deletes only cookies with the exact path.","optional":true,"type":"string"}]},{"name":"disable","description":"Disables network tracking, prevents network events from being sent to the client."},{"name":"emulateNetworkConditions","description":"Activates emulation of network conditions.","parameters":[{"name":"offline","description":"True to emulate internet disconnection.","type":"boolean"},{"name":"latency","description":"Minimum latency from request sent to response headers received (ms).","type":"number"},{"name":"downloadThroughput","description":"Maximal aggregated download throughput (bytes/sec). -1 disables download throttling.","type":"number"},{"name":"uploadThroughput","description":"Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling.","type":"number"},{"name":"connectionType","description":"Connection type if known.","optional":true,"$ref":"ConnectionType"}]},{"name":"enable","description":"Enables network tracking, network events will now be delivered to the client.","parameters":[{"name":"maxTotalBufferSize","description":"Buffer size in bytes to use when preserving network payloads (XHRs, etc).","experimental":true,"optional":true,"type":"integer"},{"name":"maxResourceBufferSize","description":"Per-resource buffer size in bytes to use when preserving network payloads (XHRs, etc).","experimental":true,"optional":true,"type":"integer"},{"name":"maxPostDataSize","description":"Longest post body size (in bytes) that would be included in requestWillBeSent notification","optional":true,"type":"integer"}]},{"name":"getAllCookies","description":"Returns all browser cookies. Depending on the backend support, will return detailed cookie\\ninformation in the `cookies` field.","returns":[{"name":"cookies","description":"Array of cookie objects.","type":"array","items":{"$ref":"Cookie"}}]},{"name":"getCertificate","description":"Returns the DER-encoded certificate.","experimental":true,"parameters":[{"name":"origin","description":"Origin to get certificate for.","type":"string"}],"returns":[{"name":"tableNames","type":"array","items":{"type":"string"}}]},{"name":"getCookies","description":"Returns all browser cookies for the current URL. Depending on the backend support, will return\\ndetailed cookie information in the `cookies` field.","parameters":[{"name":"urls","description":"The list of URLs for which applicable cookies will be fetched","optional":true,"type":"array","items":{"type":"string"}}],"returns":[{"name":"cookies","description":"Array of cookie objects.","type":"array","items":{"$ref":"Cookie"}}]},{"name":"getResponseBody","description":"Returns content served for the given request.","parameters":[{"name":"requestId","description":"Identifier of the network request to get content for.","$ref":"RequestId"}],"returns":[{"name":"body","description":"Response body.","type":"string"},{"name":"base64Encoded","description":"True, if content was sent as base64.","type":"boolean"}]},{"name":"getRequestPostData","description":"Returns post data sent with the request. Returns an error when no data was sent with the request.","parameters":[{"name":"requestId","description":"Identifier of the network request to get content for.","$ref":"RequestId"}],"returns":[{"name":"postData","description":"Request body string, omitting files from multipart requests","type":"string"}]},{"name":"getResponseBodyForInterception","description":"Returns content served for the given currently intercepted request.","experimental":true,"parameters":[{"name":"interceptionId","description":"Identifier for the intercepted request to get body for.","$ref":"InterceptionId"}],"returns":[{"name":"body","description":"Response body.","type":"string"},{"name":"base64Encoded","description":"True, if content was sent as base64.","type":"boolean"}]},{"name":"takeResponseBodyForInterceptionAsStream","description":"Returns a handle to the stream representing the response body. Note that after this command,\\nthe intercepted request can\'t be continued as is -- you either need to cancel it or to provide\\nthe response body. The stream only supports sequential read, IO.read will fail if the position\\nis specified.","experimental":true,"parameters":[{"name":"interceptionId","$ref":"InterceptionId"}],"returns":[{"name":"stream","$ref":"IO.StreamHandle"}]},{"name":"replayXHR","description":"This method sends a new XMLHttpRequest which is identical to the original one. The following\\nparameters should be identical: method, url, async, request body, extra headers, withCredentials\\nattribute, user, password.","experimental":true,"parameters":[{"name":"requestId","description":"Identifier of XHR to replay.","$ref":"RequestId"}]},{"name":"searchInResponseBody","description":"Searches for given string in response content.","experimental":true,"parameters":[{"name":"requestId","description":"Identifier of the network response to search.","$ref":"RequestId"},{"name":"query","description":"String to search for.","type":"string"},{"name":"caseSensitive","description":"If true, search is case sensitive.","optional":true,"type":"boolean"},{"name":"isRegex","description":"If true, treats string parameter as regex.","optional":true,"type":"boolean"}],"returns":[{"name":"result","description":"List of search matches.","type":"array","items":{"$ref":"Debugger.SearchMatch"}}]},{"name":"setBlockedURLs","description":"Blocks URLs from loading.","experimental":true,"parameters":[{"name":"urls","description":"URL patterns to block. Wildcards (\'*\') are allowed.","type":"array","items":{"type":"string"}}]},{"name":"setBypassServiceWorker","description":"Toggles ignoring of service worker for each request.","experimental":true,"parameters":[{"name":"bypass","description":"Bypass service worker and load from network.","type":"boolean"}]},{"name":"setCacheDisabled","description":"Toggles ignoring cache for each request. If `true`, cache will not be used.","parameters":[{"name":"cacheDisabled","description":"Cache disabled state.","type":"boolean"}]},{"name":"setCookie","description":"Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.","parameters":[{"name":"name","description":"Cookie name.","type":"string"},{"name":"value","description":"Cookie value.","type":"string"},{"name":"url","description":"The request-URI to associate with the setting of the cookie. This value can affect the\\ndefault domain and path values of the created cookie.","optional":true,"type":"string"},{"name":"domain","description":"Cookie domain.","optional":true,"type":"string"},{"name":"path","description":"Cookie path.","optional":true,"type":"string"},{"name":"secure","description":"True if cookie is secure.","optional":true,"type":"boolean"},{"name":"httpOnly","description":"True if cookie is http-only.","optional":true,"type":"boolean"},{"name":"sameSite","description":"Cookie SameSite type.","optional":true,"$ref":"CookieSameSite"},{"name":"expires","description":"Cookie expiration date, session cookie if not set","optional":true,"$ref":"TimeSinceEpoch"}],"returns":[{"name":"success","description":"True if successfully set cookie.","type":"boolean"}]},{"name":"setCookies","description":"Sets given cookies.","parameters":[{"name":"cookies","description":"Cookies to be set.","type":"array","items":{"$ref":"CookieParam"}}]},{"name":"setDataSizeLimitsForTest","description":"For testing.","experimental":true,"parameters":[{"name":"maxTotalSize","description":"Maximum total buffer size.","type":"integer"},{"name":"maxResourceSize","description":"Maximum per-resource size.","type":"integer"}]},{"name":"setExtraHTTPHeaders","description":"Specifies whether to always send extra HTTP headers with the requests from this page.","parameters":[{"name":"headers","description":"Map with extra HTTP headers.","$ref":"Headers"}]},{"name":"setRequestInterception","description":"Sets the requests to intercept that match the provided patterns and optionally resource types.\\nDeprecated, please use Fetch.enable instead.","experimental":true,"deprecated":true,"parameters":[{"name":"patterns","description":"Requests matching any of these patterns will be forwarded and wait for the corresponding\\ncontinueInterceptedRequest call.","type":"array","items":{"$ref":"RequestPattern"}}]},{"name":"setUserAgentOverride","description":"Allows overriding user agent with the given string.","redirect":"Emulation","parameters":[{"name":"userAgent","description":"User agent to use.","type":"string"},{"name":"acceptLanguage","description":"Browser langugage to emulate.","optional":true,"type":"string"},{"name":"platform","description":"The platform navigator.platform should return.","optional":true,"type":"string"}]}],"events":[{"name":"dataReceived","description":"Fired when data chunk was received over the network.","parameters":[{"name":"requestId","description":"Request identifier.","$ref":"RequestId"},{"name":"timestamp","description":"Timestamp.","$ref":"MonotonicTime"},{"name":"dataLength","description":"Data chunk length.","type":"integer"},{"name":"encodedDataLength","description":"Actual bytes received (might be less than dataLength for compressed encodings).","type":"integer"}]},{"name":"eventSourceMessageReceived","description":"Fired when EventSource message is received.","parameters":[{"name":"requestId","description":"Request identifier.","$ref":"RequestId"},{"name":"timestamp","description":"Timestamp.","$ref":"MonotonicTime"},{"name":"eventName","description":"Message type.","type":"string"},{"name":"eventId","description":"Message identifier.","type":"string"},{"name":"data","description":"Message content.","type":"string"}]},{"name":"loadingFailed","description":"Fired when HTTP request has failed to load.","parameters":[{"name":"requestId","description":"Request identifier.","$ref":"RequestId"},{"name":"timestamp","description":"Timestamp.","$ref":"MonotonicTime"},{"name":"type","description":"Resource type.","$ref":"ResourceType"},{"name":"errorText","description":"User friendly error message.","type":"string"},{"name":"canceled","description":"True if loading was canceled.","optional":true,"type":"boolean"},{"name":"blockedReason","description":"The reason why loading was blocked, if any.","optional":true,"$ref":"BlockedReason"}]},{"name":"loadingFinished","description":"Fired when HTTP request has finished loading.","parameters":[{"name":"requestId","description":"Request identifier.","$ref":"RequestId"},{"name":"timestamp","description":"Timestamp.","$ref":"MonotonicTime"},{"name":"encodedDataLength","description":"Total number of bytes received for this request.","type":"number"},{"name":"shouldReportCorbBlocking","description":"Set when 1) response was blocked by Cross-Origin Read Blocking and also\\n2) this needs to be reported to the DevTools console.","optional":true,"type":"boolean"}]},{"name":"requestIntercepted","description":"Details of an intercepted HTTP request, which must be either allowed, blocked, modified or\\nmocked.\\nDeprecated, use Fetch.requestPaused instead.","experimental":true,"deprecated":true,"parameters":[{"name":"interceptionId","description":"Each request the page makes will have a unique id, however if any redirects are encountered\\nwhile processing that fetch, they will be reported with the same id as the original fetch.\\nLikewise if HTTP authentication is needed then the same fetch id will be used.","$ref":"InterceptionId"},{"name":"request","$ref":"Request"},{"name":"frameId","description":"The id of the frame that initiated the request.","$ref":"Page.FrameId"},{"name":"resourceType","description":"How the requested resource will be used.","$ref":"ResourceType"},{"name":"isNavigationRequest","description":"Whether this is a navigation request, which can abort the navigation completely.","type":"boolean"},{"name":"isDownload","description":"Set if the request is a navigation that will result in a download.\\nOnly present after response is received from the server (i.e. HeadersReceived stage).","optional":true,"type":"boolean"},{"name":"redirectUrl","description":"Redirect location, only sent if a redirect was intercepted.","optional":true,"type":"string"},{"name":"authChallenge","description":"Details of the Authorization Challenge encountered. If this is set then\\ncontinueInterceptedRequest must contain an authChallengeResponse.","optional":true,"$ref":"AuthChallenge"},{"name":"responseErrorReason","description":"Response error if intercepted at response stage or if redirect occurred while intercepting\\nrequest.","optional":true,"$ref":"ErrorReason"},{"name":"responseStatusCode","description":"Response code if intercepted at response stage or if redirect occurred while intercepting\\nrequest or auth retry occurred.","optional":true,"type":"integer"},{"name":"responseHeaders","description":"Response headers if intercepted at the response stage or if redirect occurred while\\nintercepting request or auth retry occurred.","optional":true,"$ref":"Headers"},{"name":"requestId","description":"If the intercepted request had a corresponding requestWillBeSent event fired for it, then\\nthis requestId will be the same as the requestId present in the requestWillBeSent event.","optional":true,"$ref":"RequestId"}]},{"name":"requestServedFromCache","description":"Fired if request ended up loading from cache.","parameters":[{"name":"requestId","description":"Request identifier.","$ref":"RequestId"}]},{"name":"requestWillBeSent","description":"Fired when page is about to send HTTP request.","parameters":[{"name":"requestId","description":"Request identifier.","$ref":"RequestId"},{"name":"loaderId","description":"Loader identifier. Empty string if the request is fetched from worker.","$ref":"LoaderId"},{"name":"documentURL","description":"URL of the document this request is loaded for.","type":"string"},{"name":"request","description":"Request data.","$ref":"Request"},{"name":"timestamp","description":"Timestamp.","$ref":"MonotonicTime"},{"name":"wallTime","description":"Timestamp.","$ref":"TimeSinceEpoch"},{"name":"initiator","description":"Request initiator.","$ref":"Initiator"},{"name":"redirectResponse","description":"Redirect response data.","optional":true,"$ref":"Response"},{"name":"type","description":"Type of this resource.","optional":true,"$ref":"ResourceType"},{"name":"frameId","description":"Frame identifier.","optional":true,"$ref":"Page.FrameId"},{"name":"hasUserGesture","description":"Whether the request is initiated by a user gesture. Defaults to false.","optional":true,"type":"boolean"}]},{"name":"resourceChangedPriority","description":"Fired when resource loading priority is changed","experimental":true,"parameters":[{"name":"requestId","description":"Request identifier.","$ref":"RequestId"},{"name":"newPriority","description":"New priority","$ref":"ResourcePriority"},{"name":"timestamp","description":"Timestamp.","$ref":"MonotonicTime"}]},{"name":"signedExchangeReceived","description":"Fired when a signed exchange was received over the network","experimental":true,"parameters":[{"name":"requestId","description":"Request identifier.","$ref":"RequestId"},{"name":"info","description":"Information about the signed exchange response.","$ref":"SignedExchangeInfo"}]},{"name":"responseReceived","description":"Fired when HTTP response is available.","parameters":[{"name":"requestId","description":"Request identifier.","$ref":"RequestId"},{"name":"loaderId","description":"Loader identifier. Empty string if the request is fetched from worker.","$ref":"LoaderId"},{"name":"timestamp","description":"Timestamp.","$ref":"MonotonicTime"},{"name":"type","description":"Resource type.","$ref":"ResourceType"},{"name":"response","description":"Response data.","$ref":"Response"},{"name":"frameId","description":"Frame identifier.","optional":true,"$ref":"Page.FrameId"}]},{"name":"webSocketClosed","description":"Fired when WebSocket is closed.","parameters":[{"name":"requestId","description":"Request identifier.","$ref":"RequestId"},{"name":"timestamp","description":"Timestamp.","$ref":"MonotonicTime"}]},{"name":"webSocketCreated","description":"Fired upon WebSocket creation.","parameters":[{"name":"requestId","description":"Request identifier.","$ref":"RequestId"},{"name":"url","description":"WebSocket request URL.","type":"string"},{"name":"initiator","description":"Request initiator.","optional":true,"$ref":"Initiator"}]},{"name":"webSocketFrameError","description":"Fired when WebSocket message error occurs.","parameters":[{"name":"requestId","description":"Request identifier.","$ref":"RequestId"},{"name":"timestamp","description":"Timestamp.","$ref":"MonotonicTime"},{"name":"errorMessage","description":"WebSocket error message.","type":"string"}]},{"name":"webSocketFrameReceived","description":"Fired when WebSocket message is received.","parameters":[{"name":"requestId","description":"Request identifier.","$ref":"RequestId"},{"name":"timestamp","description":"Timestamp.","$ref":"MonotonicTime"},{"name":"response","description":"WebSocket response data.","$ref":"WebSocketFrame"}]},{"name":"webSocketFrameSent","description":"Fired when WebSocket message is sent.","parameters":[{"name":"requestId","description":"Request identifier.","$ref":"RequestId"},{"name":"timestamp","description":"Timestamp.","$ref":"MonotonicTime"},{"name":"response","description":"WebSocket response data.","$ref":"WebSocketFrame"}]},{"name":"webSocketHandshakeResponseReceived","description":"Fired when WebSocket handshake response becomes available.","parameters":[{"name":"requestId","description":"Request identifier.","$ref":"RequestId"},{"name":"timestamp","description":"Timestamp.","$ref":"MonotonicTime"},{"name":"response","description":"WebSocket response data.","$ref":"WebSocketResponse"}]},{"name":"webSocketWillSendHandshakeRequest","description":"Fired when WebSocket is about to initiate handshake.","parameters":[{"name":"requestId","description":"Request identifier.","$ref":"RequestId"},{"name":"timestamp","description":"Timestamp.","$ref":"MonotonicTime"},{"name":"wallTime","description":"UTC Timestamp.","$ref":"TimeSinceEpoch"},{"name":"request","description":"WebSocket request data.","$ref":"WebSocketRequest"}]}]},{"domain":"Overlay","description":"This domain provides various functionality related to drawing atop the inspected page.","experimental":true,"dependencies":["DOM","Page","Runtime"],"types":[{"id":"HighlightConfig","description":"Configuration data for the highlighting of page elements.","type":"object","properties":[{"name":"showInfo","description":"Whether the node info tooltip should be shown (default: false).","optional":true,"type":"boolean"},{"name":"showStyles","description":"Whether the node styles in the tooltip (default: false).","optional":true,"type":"boolean"},{"name":"showRulers","description":"Whether the rulers should be shown (default: false).","optional":true,"type":"boolean"},{"name":"showExtensionLines","description":"Whether the extension lines from node to the rulers should be shown (default: false).","optional":true,"type":"boolean"},{"name":"contentColor","description":"The content box highlight fill color (default: transparent).","optional":true,"$ref":"DOM.RGBA"},{"name":"paddingColor","description":"The padding highlight fill color (default: transparent).","optional":true,"$ref":"DOM.RGBA"},{"name":"borderColor","description":"The border highlight fill color (default: transparent).","optional":true,"$ref":"DOM.RGBA"},{"name":"marginColor","description":"The margin highlight fill color (default: transparent).","optional":true,"$ref":"DOM.RGBA"},{"name":"eventTargetColor","description":"The event target element highlight fill color (default: transparent).","optional":true,"$ref":"DOM.RGBA"},{"name":"shapeColor","description":"The shape outside fill color (default: transparent).","optional":true,"$ref":"DOM.RGBA"},{"name":"shapeMarginColor","description":"The shape margin fill color (default: transparent).","optional":true,"$ref":"DOM.RGBA"},{"name":"cssGridColor","description":"The grid layout color (default: transparent).","optional":true,"$ref":"DOM.RGBA"}]},{"id":"InspectMode","type":"string","enum":["searchForNode","searchForUAShadowDOM","captureAreaScreenshot","showDistances","none"]}],"commands":[{"name":"disable","description":"Disables domain notifications."},{"name":"enable","description":"Enables domain notifications."},{"name":"getHighlightObjectForTest","description":"For testing.","parameters":[{"name":"nodeId","description":"Id of the node to get highlight object for.","$ref":"DOM.NodeId"},{"name":"includeDistance","description":"Whether to include distance info.","optional":true,"type":"boolean"},{"name":"includeStyle","description":"Whether to include style info.","optional":true,"type":"boolean"}],"returns":[{"name":"highlight","description":"Highlight data for the node.","type":"object"}]},{"name":"hideHighlight","description":"Hides any highlight."},{"name":"highlightFrame","description":"Highlights owner element of the frame with given id.","parameters":[{"name":"frameId","description":"Identifier of the frame to highlight.","$ref":"Page.FrameId"},{"name":"contentColor","description":"The content box highlight fill color (default: transparent).","optional":true,"$ref":"DOM.RGBA"},{"name":"contentOutlineColor","description":"The content box highlight outline color (default: transparent).","optional":true,"$ref":"DOM.RGBA"}]},{"name":"highlightNode","description":"Highlights DOM node with given id or with the given JavaScript object wrapper. Either nodeId or\\nobjectId must be specified.","parameters":[{"name":"highlightConfig","description":"A descriptor for the highlight appearance.","$ref":"HighlightConfig"},{"name":"nodeId","description":"Identifier of the node to highlight.","optional":true,"$ref":"DOM.NodeId"},{"name":"backendNodeId","description":"Identifier of the backend node to highlight.","optional":true,"$ref":"DOM.BackendNodeId"},{"name":"objectId","description":"JavaScript object id of the node to be highlighted.","optional":true,"$ref":"Runtime.RemoteObjectId"},{"name":"selector","description":"Selectors to highlight relevant nodes.","optional":true,"type":"string"}]},{"name":"highlightQuad","description":"Highlights given quad. Coordinates are absolute with respect to the main frame viewport.","parameters":[{"name":"quad","description":"Quad to highlight","$ref":"DOM.Quad"},{"name":"color","description":"The highlight fill color (default: transparent).","optional":true,"$ref":"DOM.RGBA"},{"name":"outlineColor","description":"The highlight outline color (default: transparent).","optional":true,"$ref":"DOM.RGBA"}]},{"name":"highlightRect","description":"Highlights given rectangle. Coordinates are absolute with respect to the main frame viewport.","parameters":[{"name":"x","description":"X coordinate","type":"integer"},{"name":"y","description":"Y coordinate","type":"integer"},{"name":"width","description":"Rectangle width","type":"integer"},{"name":"height","description":"Rectangle height","type":"integer"},{"name":"color","description":"The highlight fill color (default: transparent).","optional":true,"$ref":"DOM.RGBA"},{"name":"outlineColor","description":"The highlight outline color (default: transparent).","optional":true,"$ref":"DOM.RGBA"}]},{"name":"setInspectMode","description":"Enters the \'inspect\' mode. In this mode, elements that user is hovering over are highlighted.\\nBackend then generates \'inspectNodeRequested\' event upon element selection.","parameters":[{"name":"mode","description":"Set an inspection mode.","$ref":"InspectMode"},{"name":"highlightConfig","description":"A descriptor for the highlight appearance of hovered-over nodes. May be omitted if `enabled\\n== false`.","optional":true,"$ref":"HighlightConfig"}]},{"name":"setShowAdHighlights","description":"Highlights owner element of all frames detected to be ads.","parameters":[{"name":"show","description":"True for showing ad highlights","type":"boolean"}]},{"name":"setPausedInDebuggerMessage","parameters":[{"name":"message","description":"The message to display, also triggers resume and step over controls.","optional":true,"type":"string"}]},{"name":"setShowDebugBorders","description":"Requests that backend shows debug borders on layers","parameters":[{"name":"show","description":"True for showing debug borders","type":"boolean"}]},{"name":"setShowFPSCounter","description":"Requests that backend shows the FPS counter","parameters":[{"name":"show","description":"True for showing the FPS counter","type":"boolean"}]},{"name":"setShowPaintRects","description":"Requests that backend shows paint rectangles","parameters":[{"name":"result","description":"True for showing paint rectangles","type":"boolean"}]},{"name":"setShowLayoutShiftRegions","description":"Requests that backend shows layout shift regions","parameters":[{"name":"result","description":"True for showing layout shift regions","type":"boolean"}]},{"name":"setShowScrollBottleneckRects","description":"Requests that backend shows scroll bottleneck rects","parameters":[{"name":"show","description":"True for showing scroll bottleneck rects","type":"boolean"}]},{"name":"setShowHitTestBorders","description":"Requests that backend shows hit-test borders on layers","parameters":[{"name":"show","description":"True for showing hit-test borders","type":"boolean"}]},{"name":"setShowViewportSizeOnResize","description":"Paints viewport size upon main frame resize.","parameters":[{"name":"show","description":"Whether to paint size or not.","type":"boolean"}]}],"events":[{"name":"inspectNodeRequested","description":"Fired when the node should be inspected. This happens after call to `setInspectMode` or when\\nuser manually inspects an element.","parameters":[{"name":"backendNodeId","description":"Id of the node to inspect.","$ref":"DOM.BackendNodeId"}]},{"name":"nodeHighlightRequested","description":"Fired when the node should be highlighted. This happens after call to `setInspectMode`.","parameters":[{"name":"nodeId","$ref":"DOM.NodeId"}]},{"name":"screenshotRequested","description":"Fired when user asks to capture screenshot of some area on the page.","parameters":[{"name":"viewport","description":"Viewport to capture, in device independent pixels (dip).","$ref":"Page.Viewport"}]},{"name":"inspectModeCanceled","description":"Fired when user cancels the inspect mode."}]},{"domain":"Page","description":"Actions and events related to the inspected page belong to the page domain.","dependencies":["Debugger","DOM","IO","Network","Runtime"],"types":[{"id":"FrameId","description":"Unique frame identifier.","type":"string"},{"id":"Frame","description":"Information about the Frame on the page.","type":"object","properties":[{"name":"id","description":"Frame unique identifier.","type":"string"},{"name":"parentId","description":"Parent frame identifier.","optional":true,"type":"string"},{"name":"loaderId","description":"Identifier of the loader associated with this frame.","$ref":"Network.LoaderId"},{"name":"name","description":"Frame\'s name as specified in the tag.","optional":true,"type":"string"},{"name":"url","description":"Frame document\'s URL without fragment.","type":"string"},{"name":"urlFragment","description":"Frame document\'s URL fragment including the \'#\'.","experimental":true,"optional":true,"type":"string"},{"name":"securityOrigin","description":"Frame document\'s security origin.","type":"string"},{"name":"mimeType","description":"Frame document\'s mimeType as determined by the browser.","type":"string"},{"name":"unreachableUrl","description":"If the frame failed to load, this contains the URL that could not be loaded. Note that unlike url above, this URL may contain a fragment.","experimental":true,"optional":true,"type":"string"}]},{"id":"FrameResource","description":"Information about the Resource on the page.","experimental":true,"type":"object","properties":[{"name":"url","description":"Resource URL.","type":"string"},{"name":"type","description":"Type of this resource.","$ref":"Network.ResourceType"},{"name":"mimeType","description":"Resource mimeType as determined by the browser.","type":"string"},{"name":"lastModified","description":"last-modified timestamp as reported by server.","optional":true,"$ref":"Network.TimeSinceEpoch"},{"name":"contentSize","description":"Resource content size.","optional":true,"type":"number"},{"name":"failed","description":"True if the resource failed to load.","optional":true,"type":"boolean"},{"name":"canceled","description":"True if the resource was canceled during loading.","optional":true,"type":"boolean"}]},{"id":"FrameResourceTree","description":"Information about the Frame hierarchy along with their cached resources.","experimental":true,"type":"object","properties":[{"name":"frame","description":"Frame information for this tree item.","$ref":"Frame"},{"name":"childFrames","description":"Child frames.","optional":true,"type":"array","items":{"$ref":"FrameResourceTree"}},{"name":"resources","description":"Information about frame resources.","type":"array","items":{"$ref":"FrameResource"}}]},{"id":"FrameTree","description":"Information about the Frame hierarchy.","type":"object","properties":[{"name":"frame","description":"Frame information for this tree item.","$ref":"Frame"},{"name":"childFrames","description":"Child frames.","optional":true,"type":"array","items":{"$ref":"FrameTree"}}]},{"id":"ScriptIdentifier","description":"Unique script identifier.","type":"string"},{"id":"TransitionType","description":"Transition type.","type":"string","enum":["link","typed","address_bar","auto_bookmark","auto_subframe","manual_subframe","generated","auto_toplevel","form_submit","reload","keyword","keyword_generated","other"]},{"id":"NavigationEntry","description":"Navigation history entry.","type":"object","properties":[{"name":"id","description":"Unique id of the navigation history entry.","type":"integer"},{"name":"url","description":"URL of the navigation history entry.","type":"string"},{"name":"userTypedURL","description":"URL that the user typed in the url bar.","type":"string"},{"name":"title","description":"Title of the navigation history entry.","type":"string"},{"name":"transitionType","description":"Transition type.","$ref":"TransitionType"}]},{"id":"ScreencastFrameMetadata","description":"Screencast frame metadata.","experimental":true,"type":"object","properties":[{"name":"offsetTop","description":"Top offset in DIP.","type":"number"},{"name":"pageScaleFactor","description":"Page scale factor.","type":"number"},{"name":"deviceWidth","description":"Device screen width in DIP.","type":"number"},{"name":"deviceHeight","description":"Device screen height in DIP.","type":"number"},{"name":"scrollOffsetX","description":"Position of horizontal scroll in CSS pixels.","type":"number"},{"name":"scrollOffsetY","description":"Position of vertical scroll in CSS pixels.","type":"number"},{"name":"timestamp","description":"Frame swap timestamp.","optional":true,"$ref":"Network.TimeSinceEpoch"}]},{"id":"DialogType","description":"Javascript dialog type.","type":"string","enum":["alert","confirm","prompt","beforeunload"]},{"id":"AppManifestError","description":"Error while paring app manifest.","type":"object","properties":[{"name":"message","description":"Error message.","type":"string"},{"name":"critical","description":"If criticial, this is a non-recoverable parse error.","type":"integer"},{"name":"line","description":"Error line.","type":"integer"},{"name":"column","description":"Error column.","type":"integer"}]},{"id":"LayoutViewport","description":"Layout viewport position and dimensions.","type":"object","properties":[{"name":"pageX","description":"Horizontal offset relative to the document (CSS pixels).","type":"integer"},{"name":"pageY","description":"Vertical offset relative to the document (CSS pixels).","type":"integer"},{"name":"clientWidth","description":"Width (CSS pixels), excludes scrollbar if present.","type":"integer"},{"name":"clientHeight","description":"Height (CSS pixels), excludes scrollbar if present.","type":"integer"}]},{"id":"VisualViewport","description":"Visual viewport position, dimensions, and scale.","type":"object","properties":[{"name":"offsetX","description":"Horizontal offset relative to the layout viewport (CSS pixels).","type":"number"},{"name":"offsetY","description":"Vertical offset relative to the layout viewport (CSS pixels).","type":"number"},{"name":"pageX","description":"Horizontal offset relative to the document (CSS pixels).","type":"number"},{"name":"pageY","description":"Vertical offset relative to the document (CSS pixels).","type":"number"},{"name":"clientWidth","description":"Width (CSS pixels), excludes scrollbar if present.","type":"number"},{"name":"clientHeight","description":"Height (CSS pixels), excludes scrollbar if present.","type":"number"},{"name":"scale","description":"Scale relative to the ideal viewport (size at width=device-width).","type":"number"},{"name":"zoom","description":"Page zoom factor (CSS to device independent pixels ratio).","optional":true,"type":"number"}]},{"id":"Viewport","description":"Viewport for capturing screenshot.","type":"object","properties":[{"name":"x","description":"X offset in device independent pixels (dip).","type":"number"},{"name":"y","description":"Y offset in device independent pixels (dip).","type":"number"},{"name":"width","description":"Rectangle width in device independent pixels (dip).","type":"number"},{"name":"height","description":"Rectangle height in device independent pixels (dip).","type":"number"},{"name":"scale","description":"Page scale factor.","type":"number"}]},{"id":"FontFamilies","description":"Generic font families collection.","experimental":true,"type":"object","properties":[{"name":"standard","description":"The standard font-family.","optional":true,"type":"string"},{"name":"fixed","description":"The fixed font-family.","optional":true,"type":"string"},{"name":"serif","description":"The serif font-family.","optional":true,"type":"string"},{"name":"sansSerif","description":"The sansSerif font-family.","optional":true,"type":"string"},{"name":"cursive","description":"The cursive font-family.","optional":true,"type":"string"},{"name":"fantasy","description":"The fantasy font-family.","optional":true,"type":"string"},{"name":"pictograph","description":"The pictograph font-family.","optional":true,"type":"string"}]},{"id":"FontSizes","description":"Default font sizes.","experimental":true,"type":"object","properties":[{"name":"standard","description":"Default standard font size.","optional":true,"type":"integer"},{"name":"fixed","description":"Default fixed font size.","optional":true,"type":"integer"}]},{"id":"ClientNavigationReason","experimental":true,"type":"string","enum":["formSubmissionGet","formSubmissionPost","httpHeaderRefresh","scriptInitiated","metaTagRefresh","pageBlockInterstitial","reload"]}],"commands":[{"name":"addScriptToEvaluateOnLoad","description":"Deprecated, please use addScriptToEvaluateOnNewDocument instead.","experimental":true,"deprecated":true,"parameters":[{"name":"scriptSource","type":"string"}],"returns":[{"name":"identifier","description":"Identifier of the added script.","$ref":"ScriptIdentifier"}]},{"name":"addScriptToEvaluateOnNewDocument","description":"Evaluates given script in every frame upon creation (before loading frame\'s scripts).","parameters":[{"name":"source","type":"string"},{"name":"worldName","description":"If specified, creates an isolated world with the given name and evaluates given script in it.\\nThis world name will be used as the ExecutionContextDescription::name when the corresponding\\nevent is emitted.","experimental":true,"optional":true,"type":"string"}],"returns":[{"name":"identifier","description":"Identifier of the added script.","$ref":"ScriptIdentifier"}]},{"name":"bringToFront","description":"Brings page to front (activates tab)."},{"name":"captureScreenshot","description":"Capture page screenshot.","parameters":[{"name":"format","description":"Image compression format (defaults to png).","optional":true,"type":"string","enum":["jpeg","png"]},{"name":"quality","description":"Compression quality from range [0..100] (jpeg only).","optional":true,"type":"integer"},{"name":"clip","description":"Capture the screenshot of a given region only.","optional":true,"$ref":"Viewport"},{"name":"fromSurface","description":"Capture the screenshot from the surface, rather than the view. Defaults to true.","experimental":true,"optional":true,"type":"boolean"}],"returns":[{"name":"data","description":"Base64-encoded image data.","type":"string"}]},{"name":"captureSnapshot","description":"Returns a snapshot of the page as a string. For MHTML format, the serialization includes\\niframes, shadow DOM, external resources, and element-inline styles.","experimental":true,"parameters":[{"name":"format","description":"Format (defaults to mhtml).","optional":true,"type":"string","enum":["mhtml"]}],"returns":[{"name":"data","description":"Serialized page data.","type":"string"}]},{"name":"clearDeviceMetricsOverride","description":"Clears the overriden device metrics.","experimental":true,"deprecated":true,"redirect":"Emulation"},{"name":"clearDeviceOrientationOverride","description":"Clears the overridden Device Orientation.","experimental":true,"deprecated":true,"redirect":"DeviceOrientation"},{"name":"clearGeolocationOverride","description":"Clears the overriden Geolocation Position and Error.","deprecated":true,"redirect":"Emulation"},{"name":"createIsolatedWorld","description":"Creates an isolated world for the given frame.","parameters":[{"name":"frameId","description":"Id of the frame in which the isolated world should be created.","$ref":"FrameId"},{"name":"worldName","description":"An optional name which is reported in the Execution Context.","optional":true,"type":"string"},{"name":"grantUniveralAccess","description":"Whether or not universal access should be granted to the isolated world. This is a powerful\\noption, use with caution.","optional":true,"type":"boolean"}],"returns":[{"name":"executionContextId","description":"Execution context of the isolated world.","$ref":"Runtime.ExecutionContextId"}]},{"name":"deleteCookie","description":"Deletes browser cookie with given name, domain and path.","experimental":true,"deprecated":true,"redirect":"Network","parameters":[{"name":"cookieName","description":"Name of the cookie to remove.","type":"string"},{"name":"url","description":"URL to match cooke domain and path.","type":"string"}]},{"name":"disable","description":"Disables page domain notifications."},{"name":"enable","description":"Enables page domain notifications."},{"name":"getAppManifest","returns":[{"name":"url","description":"Manifest location.","type":"string"},{"name":"errors","type":"array","items":{"$ref":"AppManifestError"}},{"name":"data","description":"Manifest content.","optional":true,"type":"string"}]},{"name":"getInstallabilityErrors","experimental":true,"returns":[{"name":"errors","type":"array","items":{"type":"string"}}]},{"name":"getCookies","description":"Returns all browser cookies. Depending on the backend support, will return detailed cookie\\ninformation in the `cookies` field.","experimental":true,"deprecated":true,"redirect":"Network","returns":[{"name":"cookies","description":"Array of cookie objects.","type":"array","items":{"$ref":"Network.Cookie"}}]},{"name":"getFrameTree","description":"Returns present frame tree structure.","returns":[{"name":"frameTree","description":"Present frame tree structure.","$ref":"FrameTree"}]},{"name":"getLayoutMetrics","description":"Returns metrics relating to the layouting of the page, such as viewport bounds/scale.","returns":[{"name":"layoutViewport","description":"Metrics relating to the layout viewport.","$ref":"LayoutViewport"},{"name":"visualViewport","description":"Metrics relating to the visual viewport.","$ref":"VisualViewport"},{"name":"contentSize","description":"Size of scrollable area.","$ref":"DOM.Rect"}]},{"name":"getNavigationHistory","description":"Returns navigation history for the current page.","returns":[{"name":"currentIndex","description":"Index of the current navigation history entry.","type":"integer"},{"name":"entries","description":"Array of navigation history entries.","type":"array","items":{"$ref":"NavigationEntry"}}]},{"name":"resetNavigationHistory","description":"Resets navigation history for the current page."},{"name":"getResourceContent","description":"Returns content of the given resource.","experimental":true,"parameters":[{"name":"frameId","description":"Frame id to get resource for.","$ref":"FrameId"},{"name":"url","description":"URL of the resource to get content for.","type":"string"}],"returns":[{"name":"content","description":"Resource content.","type":"string"},{"name":"base64Encoded","description":"True, if content was served as base64.","type":"boolean"}]},{"name":"getResourceTree","description":"Returns present frame / resource tree structure.","experimental":true,"returns":[{"name":"frameTree","description":"Present frame / resource tree structure.","$ref":"FrameResourceTree"}]},{"name":"handleJavaScriptDialog","description":"Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).","parameters":[{"name":"accept","description":"Whether to accept or dismiss the dialog.","type":"boolean"},{"name":"promptText","description":"The text to enter into the dialog prompt before accepting. Used only if this is a prompt\\ndialog.","optional":true,"type":"string"}]},{"name":"navigate","description":"Navigates current page to the given URL.","parameters":[{"name":"url","description":"URL to navigate the page to.","type":"string"},{"name":"referrer","description":"Referrer URL.","optional":true,"type":"string"},{"name":"transitionType","description":"Intended transition type.","optional":true,"$ref":"TransitionType"},{"name":"frameId","description":"Frame id to navigate, if not specified navigates the top frame.","optional":true,"$ref":"FrameId"}],"returns":[{"name":"frameId","description":"Frame id that has navigated (or failed to navigate)","$ref":"FrameId"},{"name":"loaderId","description":"Loader identifier.","optional":true,"$ref":"Network.LoaderId"},{"name":"errorText","description":"User friendly error message, present if and only if navigation has failed.","optional":true,"type":"string"}]},{"name":"navigateToHistoryEntry","description":"Navigates current page to the given history entry.","parameters":[{"name":"entryId","description":"Unique id of the entry to navigate to.","type":"integer"}]},{"name":"printToPDF","description":"Print page as PDF.","parameters":[{"name":"landscape","description":"Paper orientation. Defaults to false.","optional":true,"type":"boolean"},{"name":"displayHeaderFooter","description":"Display header and footer. Defaults to false.","optional":true,"type":"boolean"},{"name":"printBackground","description":"Print background graphics. Defaults to false.","optional":true,"type":"boolean"},{"name":"scale","description":"Scale of the webpage rendering. Defaults to 1.","optional":true,"type":"number"},{"name":"paperWidth","description":"Paper width in inches. Defaults to 8.5 inches.","optional":true,"type":"number"},{"name":"paperHeight","description":"Paper height in inches. Defaults to 11 inches.","optional":true,"type":"number"},{"name":"marginTop","description":"Top margin in inches. Defaults to 1cm (~0.4 inches).","optional":true,"type":"number"},{"name":"marginBottom","description":"Bottom margin in inches. Defaults to 1cm (~0.4 inches).","optional":true,"type":"number"},{"name":"marginLeft","description":"Left margin in inches. Defaults to 1cm (~0.4 inches).","optional":true,"type":"number"},{"name":"marginRight","description":"Right margin in inches. Defaults to 1cm (~0.4 inches).","optional":true,"type":"number"},{"name":"pageRanges","description":"Paper ranges to print, e.g., \'1-5, 8, 11-13\'. Defaults to the empty string, which means\\nprint all pages.","optional":true,"type":"string"},{"name":"ignoreInvalidPageRanges","description":"Whether to silently ignore invalid but successfully parsed page ranges, such as \'3-2\'.\\nDefaults to false.","optional":true,"type":"boolean"},{"name":"headerTemplate","description":"HTML template for the print header. Should be valid HTML markup with following\\nclasses used to inject printing values into them:\\n- `date`: formatted print date\\n- `title`: document title\\n- `url`: document location\\n- `pageNumber`: current page number\\n- `totalPages`: total pages in the document\\n\\nFor example, `` would generate span containing the title.","optional":true,"type":"string"},{"name":"footerTemplate","description":"HTML template for the print footer. Should use the same format as the `headerTemplate`.","optional":true,"type":"string"},{"name":"preferCSSPageSize","description":"Whether or not to prefer page size as defined by css. Defaults to false,\\nin which case the content will be scaled to fit the paper size.","optional":true,"type":"boolean"},{"name":"transferMode","description":"return as stream","experimental":true,"optional":true,"type":"string","enum":["ReturnAsBase64","ReturnAsStream"]}],"returns":[{"name":"data","description":"Base64-encoded pdf data. Empty if |returnAsStream| is specified.","type":"string"},{"name":"stream","description":"A handle of the stream that holds resulting PDF data.","experimental":true,"optional":true,"$ref":"IO.StreamHandle"}]},{"name":"reload","description":"Reloads given page optionally ignoring the cache.","parameters":[{"name":"ignoreCache","description":"If true, browser cache is ignored (as if the user pressed Shift+refresh).","optional":true,"type":"boolean"},{"name":"scriptToEvaluateOnLoad","description":"If set, the script will be injected into all frames of the inspected page after reload.\\nArgument will be ignored if reloading dataURL origin.","optional":true,"type":"string"}]},{"name":"removeScriptToEvaluateOnLoad","description":"Deprecated, please use removeScriptToEvaluateOnNewDocument instead.","experimental":true,"deprecated":true,"parameters":[{"name":"identifier","$ref":"ScriptIdentifier"}]},{"name":"removeScriptToEvaluateOnNewDocument","description":"Removes given script from the list.","parameters":[{"name":"identifier","$ref":"ScriptIdentifier"}]},{"name":"screencastFrameAck","description":"Acknowledges that a screencast frame has been received by the frontend.","experimental":true,"parameters":[{"name":"sessionId","description":"Frame number.","type":"integer"}]},{"name":"searchInResource","description":"Searches for given string in resource content.","experimental":true,"parameters":[{"name":"frameId","description":"Frame id for resource to search in.","$ref":"FrameId"},{"name":"url","description":"URL of the resource to search in.","type":"string"},{"name":"query","description":"String to search for.","type":"string"},{"name":"caseSensitive","description":"If true, search is case sensitive.","optional":true,"type":"boolean"},{"name":"isRegex","description":"If true, treats string parameter as regex.","optional":true,"type":"boolean"}],"returns":[{"name":"result","description":"List of search matches.","type":"array","items":{"$ref":"Debugger.SearchMatch"}}]},{"name":"setAdBlockingEnabled","description":"Enable Chrome\'s experimental ad filter on all sites.","experimental":true,"parameters":[{"name":"enabled","description":"Whether to block ads.","type":"boolean"}]},{"name":"setBypassCSP","description":"Enable page Content Security Policy by-passing.","experimental":true,"parameters":[{"name":"enabled","description":"Whether to bypass page CSP.","type":"boolean"}]},{"name":"setDeviceMetricsOverride","description":"Overrides the values of device screen dimensions (window.screen.width, window.screen.height,\\nwindow.innerWidth, window.innerHeight, and \\"device-width\\"/\\"device-height\\"-related CSS media\\nquery results).","experimental":true,"deprecated":true,"redirect":"Emulation","parameters":[{"name":"width","description":"Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.","type":"integer"},{"name":"height","description":"Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.","type":"integer"},{"name":"deviceScaleFactor","description":"Overriding device scale factor value. 0 disables the override.","type":"number"},{"name":"mobile","description":"Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text\\nautosizing and more.","type":"boolean"},{"name":"scale","description":"Scale to apply to resulting view image.","optional":true,"type":"number"},{"name":"screenWidth","description":"Overriding screen width value in pixels (minimum 0, maximum 10000000).","optional":true,"type":"integer"},{"name":"screenHeight","description":"Overriding screen height value in pixels (minimum 0, maximum 10000000).","optional":true,"type":"integer"},{"name":"positionX","description":"Overriding view X position on screen in pixels (minimum 0, maximum 10000000).","optional":true,"type":"integer"},{"name":"positionY","description":"Overriding view Y position on screen in pixels (minimum 0, maximum 10000000).","optional":true,"type":"integer"},{"name":"dontSetVisibleSize","description":"Do not set visible view size, rely upon explicit setVisibleSize call.","optional":true,"type":"boolean"},{"name":"screenOrientation","description":"Screen orientation override.","optional":true,"$ref":"Emulation.ScreenOrientation"},{"name":"viewport","description":"The viewport dimensions and scale. If not set, the override is cleared.","optional":true,"$ref":"Viewport"}]},{"name":"setDeviceOrientationOverride","description":"Overrides the Device Orientation.","experimental":true,"deprecated":true,"redirect":"DeviceOrientation","parameters":[{"name":"alpha","description":"Mock alpha","type":"number"},{"name":"beta","description":"Mock beta","type":"number"},{"name":"gamma","description":"Mock gamma","type":"number"}]},{"name":"setFontFamilies","description":"Set generic font families.","experimental":true,"parameters":[{"name":"fontFamilies","description":"Specifies font families to set. If a font family is not specified, it won\'t be changed.","$ref":"FontFamilies"}]},{"name":"setFontSizes","description":"Set default font sizes.","experimental":true,"parameters":[{"name":"fontSizes","description":"Specifies font sizes to set. If a font size is not specified, it won\'t be changed.","$ref":"FontSizes"}]},{"name":"setDocumentContent","description":"Sets given markup as the document\'s HTML.","parameters":[{"name":"frameId","description":"Frame id to set HTML for.","$ref":"FrameId"},{"name":"html","description":"HTML content to set.","type":"string"}]},{"name":"setDownloadBehavior","description":"Set the behavior when downloading a file.","experimental":true,"parameters":[{"name":"behavior","description":"Whether to allow all or deny all download requests, or use default Chrome behavior if\\navailable (otherwise deny).","type":"string","enum":["deny","allow","default"]},{"name":"downloadPath","description":"The default path to save downloaded files to. This is requred if behavior is set to \'allow\'","optional":true,"type":"string"}]},{"name":"setGeolocationOverride","description":"Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position\\nunavailable.","deprecated":true,"redirect":"Emulation","parameters":[{"name":"latitude","description":"Mock latitude","optional":true,"type":"number"},{"name":"longitude","description":"Mock longitude","optional":true,"type":"number"},{"name":"accuracy","description":"Mock accuracy","optional":true,"type":"number"}]},{"name":"setLifecycleEventsEnabled","description":"Controls whether page will emit lifecycle events.","experimental":true,"parameters":[{"name":"enabled","description":"If true, starts emitting lifecycle events.","type":"boolean"}]},{"name":"setTouchEmulationEnabled","description":"Toggles mouse event-based touch event emulation.","experimental":true,"deprecated":true,"redirect":"Emulation","parameters":[{"name":"enabled","description":"Whether the touch event emulation should be enabled.","type":"boolean"},{"name":"configuration","description":"Touch/gesture events configuration. Default: current platform.","optional":true,"type":"string","enum":["mobile","desktop"]}]},{"name":"startScreencast","description":"Starts sending each frame using the `screencastFrame` event.","experimental":true,"parameters":[{"name":"format","description":"Image compression format.","optional":true,"type":"string","enum":["jpeg","png"]},{"name":"quality","description":"Compression quality from range [0..100].","optional":true,"type":"integer"},{"name":"maxWidth","description":"Maximum screenshot width.","optional":true,"type":"integer"},{"name":"maxHeight","description":"Maximum screenshot height.","optional":true,"type":"integer"},{"name":"everyNthFrame","description":"Send every n-th frame.","optional":true,"type":"integer"}]},{"name":"stopLoading","description":"Force the page stop all navigations and pending resource fetches."},{"name":"crash","description":"Crashes renderer on the IO thread, generates minidumps.","experimental":true},{"name":"close","description":"Tries to close page, running its beforeunload hooks, if any.","experimental":true},{"name":"setWebLifecycleState","description":"Tries to update the web lifecycle state of the page.\\nIt will transition the page to the given state according to:\\nhttps://github.com/WICG/web-lifecycle/","experimental":true,"parameters":[{"name":"state","description":"Target lifecycle state","type":"string","enum":["frozen","active"]}]},{"name":"stopScreencast","description":"Stops sending each frame in the `screencastFrame`.","experimental":true},{"name":"setProduceCompilationCache","description":"Forces compilation cache to be generated for every subresource script.","experimental":true,"parameters":[{"name":"enabled","type":"boolean"}]},{"name":"addCompilationCache","description":"Seeds compilation cache for given url. Compilation cache does not survive\\ncross-process navigation.","experimental":true,"parameters":[{"name":"url","type":"string"},{"name":"data","description":"Base64-encoded data","type":"string"}]},{"name":"clearCompilationCache","description":"Clears seeded compilation cache.","experimental":true},{"name":"generateTestReport","description":"Generates a report for testing.","experimental":true,"parameters":[{"name":"message","description":"Message to be displayed in the report.","type":"string"},{"name":"group","description":"Specifies the endpoint group to deliver the report to.","optional":true,"type":"string"}]},{"name":"waitForDebugger","description":"Pauses page execution. Can be resumed using generic Runtime.runIfWaitingForDebugger.","experimental":true},{"name":"setInterceptFileChooserDialog","description":"Intercept file chooser requests and transfer control to protocol clients.\\nWhen file chooser interception is enabled, native file chooser dialog is not shown.\\nInstead, a protocol event `Page.fileChooserOpened` is emitted.\\nFile chooser can be handled with `page.handleFileChooser` command.","experimental":true,"parameters":[{"name":"enabled","type":"boolean"}]},{"name":"handleFileChooser","description":"Accepts or cancels an intercepted file chooser dialog.","experimental":true,"parameters":[{"name":"action","type":"string","enum":["accept","cancel","fallback"]},{"name":"files","description":"Array of absolute file paths to set, only respected with `accept` action.","optional":true,"type":"array","items":{"type":"string"}}]}],"events":[{"name":"domContentEventFired","parameters":[{"name":"timestamp","$ref":"Network.MonotonicTime"}]},{"name":"fileChooserOpened","description":"Emitted only when `page.interceptFileChooser` is enabled.","parameters":[{"name":"mode","type":"string","enum":["selectSingle","selectMultiple"]}]},{"name":"frameAttached","description":"Fired when frame has been attached to its parent.","parameters":[{"name":"frameId","description":"Id of the frame that has been attached.","$ref":"FrameId"},{"name":"parentFrameId","description":"Parent frame identifier.","$ref":"FrameId"},{"name":"stack","description":"JavaScript stack trace of when frame was attached, only set if frame initiated from script.","optional":true,"$ref":"Runtime.StackTrace"}]},{"name":"frameClearedScheduledNavigation","description":"Fired when frame no longer has a scheduled navigation.","deprecated":true,"parameters":[{"name":"frameId","description":"Id of the frame that has cleared its scheduled navigation.","$ref":"FrameId"}]},{"name":"frameDetached","description":"Fired when frame has been detached from its parent.","parameters":[{"name":"frameId","description":"Id of the frame that has been detached.","$ref":"FrameId"}]},{"name":"frameNavigated","description":"Fired once navigation of the frame has completed. Frame is now associated with the new loader.","parameters":[{"name":"frame","description":"Frame object.","$ref":"Frame"}]},{"name":"frameResized","experimental":true},{"name":"frameRequestedNavigation","description":"Fired when a renderer-initiated navigation is requested.\\nNavigation may still be cancelled after the event is issued.","experimental":true,"parameters":[{"name":"frameId","description":"Id of the frame that is being navigated.","$ref":"FrameId"},{"name":"reason","description":"The reason for the navigation.","$ref":"ClientNavigationReason"},{"name":"url","description":"The destination URL for the requested navigation.","type":"string"}]},{"name":"frameScheduledNavigation","description":"Fired when frame schedules a potential navigation.","deprecated":true,"parameters":[{"name":"frameId","description":"Id of the frame that has scheduled a navigation.","$ref":"FrameId"},{"name":"delay","description":"Delay (in seconds) until the navigation is scheduled to begin. The navigation is not\\nguaranteed to start.","type":"number"},{"name":"reason","description":"The reason for the navigation.","type":"string","enum":["formSubmissionGet","formSubmissionPost","httpHeaderRefresh","scriptInitiated","metaTagRefresh","pageBlockInterstitial","reload"]},{"name":"url","description":"The destination URL for the scheduled navigation.","type":"string"}]},{"name":"frameStartedLoading","description":"Fired when frame has started loading.","experimental":true,"parameters":[{"name":"frameId","description":"Id of the frame that has started loading.","$ref":"FrameId"}]},{"name":"frameStoppedLoading","description":"Fired when frame has stopped loading.","experimental":true,"parameters":[{"name":"frameId","description":"Id of the frame that has stopped loading.","$ref":"FrameId"}]},{"name":"downloadWillBegin","description":"Fired when page is about to start a download.","experimental":true,"parameters":[{"name":"frameId","description":"Id of the frame that caused download to begin.","$ref":"FrameId"},{"name":"url","description":"URL of the resource being downloaded.","type":"string"}]},{"name":"interstitialHidden","description":"Fired when interstitial page was hidden"},{"name":"interstitialShown","description":"Fired when interstitial page was shown"},{"name":"javascriptDialogClosed","description":"Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) has been\\nclosed.","parameters":[{"name":"result","description":"Whether dialog was confirmed.","type":"boolean"},{"name":"userInput","description":"User input in case of prompt.","type":"string"}]},{"name":"javascriptDialogOpening","description":"Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to\\nopen.","parameters":[{"name":"url","description":"Frame url.","type":"string"},{"name":"message","description":"Message that will be displayed by the dialog.","type":"string"},{"name":"type","description":"Dialog type.","$ref":"DialogType"},{"name":"hasBrowserHandler","description":"True iff browser is capable showing or acting on the given dialog. When browser has no\\ndialog handler for given target, calling alert while Page domain is engaged will stall\\nthe page execution. Execution can be resumed via calling Page.handleJavaScriptDialog.","type":"boolean"},{"name":"defaultPrompt","description":"Default dialog prompt.","optional":true,"type":"string"}]},{"name":"lifecycleEvent","description":"Fired for top level page lifecycle events such as navigation, load, paint, etc.","parameters":[{"name":"frameId","description":"Id of the frame.","$ref":"FrameId"},{"name":"loaderId","description":"Loader identifier. Empty string if the request is fetched from worker.","$ref":"Network.LoaderId"},{"name":"name","type":"string"},{"name":"timestamp","$ref":"Network.MonotonicTime"}]},{"name":"loadEventFired","parameters":[{"name":"timestamp","$ref":"Network.MonotonicTime"}]},{"name":"navigatedWithinDocument","description":"Fired when same-document navigation happens, e.g. due to history API usage or anchor navigation.","experimental":true,"parameters":[{"name":"frameId","description":"Id of the frame.","$ref":"FrameId"},{"name":"url","description":"Frame\'s new url.","type":"string"}]},{"name":"screencastFrame","description":"Compressed image data requested by the `startScreencast`.","experimental":true,"parameters":[{"name":"data","description":"Base64-encoded compressed image.","type":"string"},{"name":"metadata","description":"Screencast frame metadata.","$ref":"ScreencastFrameMetadata"},{"name":"sessionId","description":"Frame number.","type":"integer"}]},{"name":"screencastVisibilityChanged","description":"Fired when the page with currently enabled screencast was shown or hidden `.","experimental":true,"parameters":[{"name":"visible","description":"True if the page is visible.","type":"boolean"}]},{"name":"windowOpen","description":"Fired when a new window is going to be opened, via window.open(), link click, form submission,\\netc.","parameters":[{"name":"url","description":"The URL for the new window.","type":"string"},{"name":"windowName","description":"Window name.","type":"string"},{"name":"windowFeatures","description":"An array of enabled window features.","type":"array","items":{"type":"string"}},{"name":"userGesture","description":"Whether or not it was triggered by user gesture.","type":"boolean"}]},{"name":"compilationCacheProduced","description":"Issued for every compilation cache generated. Is only available\\nif Page.setGenerateCompilationCache is enabled.","experimental":true,"parameters":[{"name":"url","type":"string"},{"name":"data","description":"Base64-encoded data","type":"string"}]}]},{"domain":"Performance","types":[{"id":"Metric","description":"Run-time execution metric.","type":"object","properties":[{"name":"name","description":"Metric name.","type":"string"},{"name":"value","description":"Metric value.","type":"number"}]}],"commands":[{"name":"disable","description":"Disable collecting and reporting metrics."},{"name":"enable","description":"Enable collecting and reporting metrics."},{"name":"setTimeDomain","description":"Sets time domain to use for collecting and reporting duration metrics.\\nNote that this must be called before enabling metrics collection. Calling\\nthis method while metrics collection is enabled returns an error.","experimental":true,"parameters":[{"name":"timeDomain","description":"Time domain","type":"string","enum":["timeTicks","threadTicks"]}]},{"name":"getMetrics","description":"Retrieve current values of run-time metrics.","returns":[{"name":"metrics","description":"Current values for run-time metrics.","type":"array","items":{"$ref":"Metric"}}]}],"events":[{"name":"metrics","description":"Current values of the metrics.","parameters":[{"name":"metrics","description":"Current values of the metrics.","type":"array","items":{"$ref":"Metric"}},{"name":"title","description":"Timestamp title.","type":"string"}]}]},{"domain":"Security","description":"Security","types":[{"id":"CertificateId","description":"An internal certificate ID value.","type":"integer"},{"id":"MixedContentType","description":"A description of mixed content (HTTP resources on HTTPS pages), as defined by\\nhttps://www.w3.org/TR/mixed-content/#categories","type":"string","enum":["blockable","optionally-blockable","none"]},{"id":"SecurityState","description":"The security level of a page or resource.","type":"string","enum":["unknown","neutral","insecure","secure","info"]},{"id":"SecurityStateExplanation","description":"An explanation of an factor contributing to the security state.","type":"object","properties":[{"name":"securityState","description":"Security state representing the severity of the factor being explained.","$ref":"SecurityState"},{"name":"title","description":"Title describing the type of factor.","type":"string"},{"name":"summary","description":"Short phrase describing the type of factor.","type":"string"},{"name":"description","description":"Full text explanation of the factor.","type":"string"},{"name":"mixedContentType","description":"The type of mixed content described by the explanation.","$ref":"MixedContentType"},{"name":"certificate","description":"Page certificate.","type":"array","items":{"type":"string"}},{"name":"recommendations","description":"Recommendations to fix any issues.","optional":true,"type":"array","items":{"type":"string"}}]},{"id":"InsecureContentStatus","description":"Information about insecure content on the page.","deprecated":true,"type":"object","properties":[{"name":"ranMixedContent","description":"Always false.","type":"boolean"},{"name":"displayedMixedContent","description":"Always false.","type":"boolean"},{"name":"containedMixedForm","description":"Always false.","type":"boolean"},{"name":"ranContentWithCertErrors","description":"Always false.","type":"boolean"},{"name":"displayedContentWithCertErrors","description":"Always false.","type":"boolean"},{"name":"ranInsecureContentStyle","description":"Always set to unknown.","$ref":"SecurityState"},{"name":"displayedInsecureContentStyle","description":"Always set to unknown.","$ref":"SecurityState"}]},{"id":"CertificateErrorAction","description":"The action to take when a certificate error occurs. continue will continue processing the\\nrequest and cancel will cancel the request.","type":"string","enum":["continue","cancel"]}],"commands":[{"name":"disable","description":"Disables tracking security state changes."},{"name":"enable","description":"Enables tracking security state changes."},{"name":"setIgnoreCertificateErrors","description":"Enable/disable whether all certificate errors should be ignored.","experimental":true,"parameters":[{"name":"ignore","description":"If true, all certificate errors will be ignored.","type":"boolean"}]},{"name":"handleCertificateError","description":"Handles a certificate error that fired a certificateError event.","deprecated":true,"parameters":[{"name":"eventId","description":"The ID of the event.","type":"integer"},{"name":"action","description":"The action to take on the certificate error.","$ref":"CertificateErrorAction"}]},{"name":"setOverrideCertificateErrors","description":"Enable/disable overriding certificate errors. If enabled, all certificate error events need to\\nbe handled by the DevTools client and should be answered with `handleCertificateError` commands.","deprecated":true,"parameters":[{"name":"override","description":"If true, certificate errors will be overridden.","type":"boolean"}]}],"events":[{"name":"certificateError","description":"There is a certificate error. If overriding certificate errors is enabled, then it should be\\nhandled with the `handleCertificateError` command. Note: this event does not fire if the\\ncertificate error has been allowed internally. Only one client per target should override\\ncertificate errors at the same time.","deprecated":true,"parameters":[{"name":"eventId","description":"The ID of the event.","type":"integer"},{"name":"errorType","description":"The type of the error.","type":"string"},{"name":"requestURL","description":"The url that was requested.","type":"string"}]},{"name":"securityStateChanged","description":"The security state of the page changed.","parameters":[{"name":"securityState","description":"Security state.","$ref":"SecurityState"},{"name":"schemeIsCryptographic","description":"True if the page was loaded over cryptographic transport such as HTTPS.","deprecated":true,"type":"boolean"},{"name":"explanations","description":"List of explanations for the security state. If the overall security state is `insecure` or\\n`warning`, at least one corresponding explanation should be included.","type":"array","items":{"$ref":"SecurityStateExplanation"}},{"name":"insecureContentStatus","description":"Information about insecure content on the page.","deprecated":true,"$ref":"InsecureContentStatus"},{"name":"summary","description":"Overrides user-visible description of the state.","optional":true,"type":"string"}]}]},{"domain":"ServiceWorker","experimental":true,"types":[{"id":"RegistrationID","type":"string"},{"id":"ServiceWorkerRegistration","description":"ServiceWorker registration.","type":"object","properties":[{"name":"registrationId","$ref":"RegistrationID"},{"name":"scopeURL","type":"string"},{"name":"isDeleted","type":"boolean"}]},{"id":"ServiceWorkerVersionRunningStatus","type":"string","enum":["stopped","starting","running","stopping"]},{"id":"ServiceWorkerVersionStatus","type":"string","enum":["new","installing","installed","activating","activated","redundant"]},{"id":"ServiceWorkerVersion","description":"ServiceWorker version.","type":"object","properties":[{"name":"versionId","type":"string"},{"name":"registrationId","$ref":"RegistrationID"},{"name":"scriptURL","type":"string"},{"name":"runningStatus","$ref":"ServiceWorkerVersionRunningStatus"},{"name":"status","$ref":"ServiceWorkerVersionStatus"},{"name":"scriptLastModified","description":"The Last-Modified header value of the main script.","optional":true,"type":"number"},{"name":"scriptResponseTime","description":"The time at which the response headers of the main script were received from the server.\\nFor cached script it is the last time the cache entry was validated.","optional":true,"type":"number"},{"name":"controlledClients","optional":true,"type":"array","items":{"$ref":"Target.TargetID"}},{"name":"targetId","optional":true,"$ref":"Target.TargetID"}]},{"id":"ServiceWorkerErrorMessage","description":"ServiceWorker error message.","type":"object","properties":[{"name":"errorMessage","type":"string"},{"name":"registrationId","$ref":"RegistrationID"},{"name":"versionId","type":"string"},{"name":"sourceURL","type":"string"},{"name":"lineNumber","type":"integer"},{"name":"columnNumber","type":"integer"}]}],"commands":[{"name":"deliverPushMessage","parameters":[{"name":"origin","type":"string"},{"name":"registrationId","$ref":"RegistrationID"},{"name":"data","type":"string"}]},{"name":"disable"},{"name":"dispatchSyncEvent","parameters":[{"name":"origin","type":"string"},{"name":"registrationId","$ref":"RegistrationID"},{"name":"tag","type":"string"},{"name":"lastChance","type":"boolean"}]},{"name":"enable"},{"name":"inspectWorker","parameters":[{"name":"versionId","type":"string"}]},{"name":"setForceUpdateOnPageLoad","parameters":[{"name":"forceUpdateOnPageLoad","type":"boolean"}]},{"name":"skipWaiting","parameters":[{"name":"scopeURL","type":"string"}]},{"name":"startWorker","parameters":[{"name":"scopeURL","type":"string"}]},{"name":"stopAllWorkers"},{"name":"stopWorker","parameters":[{"name":"versionId","type":"string"}]},{"name":"unregister","parameters":[{"name":"scopeURL","type":"string"}]},{"name":"updateRegistration","parameters":[{"name":"scopeURL","type":"string"}]}],"events":[{"name":"workerErrorReported","parameters":[{"name":"errorMessage","$ref":"ServiceWorkerErrorMessage"}]},{"name":"workerRegistrationUpdated","parameters":[{"name":"registrations","type":"array","items":{"$ref":"ServiceWorkerRegistration"}}]},{"name":"workerVersionUpdated","parameters":[{"name":"versions","type":"array","items":{"$ref":"ServiceWorkerVersion"}}]}]},{"domain":"Storage","experimental":true,"types":[{"id":"StorageType","description":"Enum of possible storage types.","type":"string","enum":["appcache","cookies","file_systems","indexeddb","local_storage","shader_cache","websql","service_workers","cache_storage","all","other"]},{"id":"UsageForType","description":"Usage for a storage type.","type":"object","properties":[{"name":"storageType","description":"Name of storage type.","$ref":"StorageType"},{"name":"usage","description":"Storage usage (bytes).","type":"number"}]}],"commands":[{"name":"clearDataForOrigin","description":"Clears storage for origin.","parameters":[{"name":"origin","description":"Security origin.","type":"string"},{"name":"storageTypes","description":"Comma separated list of StorageType to clear.","type":"string"}]},{"name":"getUsageAndQuota","description":"Returns usage and quota in bytes.","parameters":[{"name":"origin","description":"Security origin.","type":"string"}],"returns":[{"name":"usage","description":"Storage usage (bytes).","type":"number"},{"name":"quota","description":"Storage quota (bytes).","type":"number"},{"name":"usageBreakdown","description":"Storage usage per type (bytes).","type":"array","items":{"$ref":"UsageForType"}}]},{"name":"trackCacheStorageForOrigin","description":"Registers origin to be notified when an update occurs to its cache storage list.","parameters":[{"name":"origin","description":"Security origin.","type":"string"}]},{"name":"trackIndexedDBForOrigin","description":"Registers origin to be notified when an update occurs to its IndexedDB.","parameters":[{"name":"origin","description":"Security origin.","type":"string"}]},{"name":"untrackCacheStorageForOrigin","description":"Unregisters origin from receiving notifications for cache storage.","parameters":[{"name":"origin","description":"Security origin.","type":"string"}]},{"name":"untrackIndexedDBForOrigin","description":"Unregisters origin from receiving notifications for IndexedDB.","parameters":[{"name":"origin","description":"Security origin.","type":"string"}]}],"events":[{"name":"cacheStorageContentUpdated","description":"A cache\'s contents have been modified.","parameters":[{"name":"origin","description":"Origin to update.","type":"string"},{"name":"cacheName","description":"Name of cache in origin.","type":"string"}]},{"name":"cacheStorageListUpdated","description":"A cache has been added/deleted.","parameters":[{"name":"origin","description":"Origin to update.","type":"string"}]},{"name":"indexedDBContentUpdated","description":"The origin\'s IndexedDB object store has been modified.","parameters":[{"name":"origin","description":"Origin to update.","type":"string"},{"name":"databaseName","description":"Database to update.","type":"string"},{"name":"objectStoreName","description":"ObjectStore to update.","type":"string"}]},{"name":"indexedDBListUpdated","description":"The origin\'s IndexedDB database list has been modified.","parameters":[{"name":"origin","description":"Origin to update.","type":"string"}]}]},{"domain":"SystemInfo","description":"The SystemInfo domain defines methods and events for querying low-level system information.","experimental":true,"types":[{"id":"GPUDevice","description":"Describes a single graphics processor (GPU).","type":"object","properties":[{"name":"vendorId","description":"PCI ID of the GPU vendor, if available; 0 otherwise.","type":"number"},{"name":"deviceId","description":"PCI ID of the GPU device, if available; 0 otherwise.","type":"number"},{"name":"vendorString","description":"String description of the GPU vendor, if the PCI ID is not available.","type":"string"},{"name":"deviceString","description":"String description of the GPU device, if the PCI ID is not available.","type":"string"},{"name":"driverVendor","description":"String description of the GPU driver vendor.","type":"string"},{"name":"driverVersion","description":"String description of the GPU driver version.","type":"string"}]},{"id":"Size","description":"Describes the width and height dimensions of an entity.","type":"object","properties":[{"name":"width","description":"Width in pixels.","type":"integer"},{"name":"height","description":"Height in pixels.","type":"integer"}]},{"id":"VideoDecodeAcceleratorCapability","description":"Describes a supported video decoding profile with its associated minimum and\\nmaximum resolutions.","type":"object","properties":[{"name":"profile","description":"Video codec profile that is supported, e.g. VP9 Profile 2.","type":"string"},{"name":"maxResolution","description":"Maximum video dimensions in pixels supported for this |profile|.","$ref":"Size"},{"name":"minResolution","description":"Minimum video dimensions in pixels supported for this |profile|.","$ref":"Size"}]},{"id":"VideoEncodeAcceleratorCapability","description":"Describes a supported video encoding profile with its associated maximum\\nresolution and maximum framerate.","type":"object","properties":[{"name":"profile","description":"Video codec profile that is supported, e.g H264 Main.","type":"string"},{"name":"maxResolution","description":"Maximum video dimensions in pixels supported for this |profile|.","$ref":"Size"},{"name":"maxFramerateNumerator","description":"Maximum encoding framerate in frames per second supported for this\\n|profile|, as fraction\'s numerator and denominator, e.g. 24/1 fps,\\n24000/1001 fps, etc.","type":"integer"},{"name":"maxFramerateDenominator","type":"integer"}]},{"id":"SubsamplingFormat","description":"YUV subsampling type of the pixels of a given image.","type":"string","enum":["yuv420","yuv422","yuv444"]},{"id":"ImageDecodeAcceleratorCapability","description":"Describes a supported image decoding profile with its associated minimum and\\nmaximum resolutions and subsampling.","type":"object","properties":[{"name":"imageType","description":"Image coded, e.g. Jpeg.","type":"string"},{"name":"maxDimensions","description":"Maximum supported dimensions of the image in pixels.","$ref":"Size"},{"name":"minDimensions","description":"Minimum supported dimensions of the image in pixels.","$ref":"Size"},{"name":"subsamplings","description":"Optional array of supported subsampling formats, e.g. 4:2:0, if known.","type":"array","items":{"$ref":"SubsamplingFormat"}}]},{"id":"GPUInfo","description":"Provides information about the GPU(s) on the system.","type":"object","properties":[{"name":"devices","description":"The graphics devices on the system. Element 0 is the primary GPU.","type":"array","items":{"$ref":"GPUDevice"}},{"name":"auxAttributes","description":"An optional dictionary of additional GPU related attributes.","optional":true,"type":"object"},{"name":"featureStatus","description":"An optional dictionary of graphics features and their status.","optional":true,"type":"object"},{"name":"driverBugWorkarounds","description":"An optional array of GPU driver bug workarounds.","type":"array","items":{"type":"string"}},{"name":"videoDecoding","description":"Supported accelerated video decoding capabilities.","type":"array","items":{"$ref":"VideoDecodeAcceleratorCapability"}},{"name":"videoEncoding","description":"Supported accelerated video encoding capabilities.","type":"array","items":{"$ref":"VideoEncodeAcceleratorCapability"}},{"name":"imageDecoding","description":"Supported accelerated image decoding capabilities.","type":"array","items":{"$ref":"ImageDecodeAcceleratorCapability"}}]},{"id":"ProcessInfo","description":"Represents process info.","type":"object","properties":[{"name":"type","description":"Specifies process type.","type":"string"},{"name":"id","description":"Specifies process id.","type":"integer"},{"name":"cpuTime","description":"Specifies cumulative CPU usage in seconds across all threads of the\\nprocess since the process start.","type":"number"}]}],"commands":[{"name":"getInfo","description":"Returns information about the system.","returns":[{"name":"gpu","description":"Information about the GPUs on the system.","$ref":"GPUInfo"},{"name":"modelName","description":"A platform-dependent description of the model of the machine. On Mac OS, this is, for\\nexample, \'MacBookPro\'. Will be the empty string if not supported.","type":"string"},{"name":"modelVersion","description":"A platform-dependent description of the version of the machine. On Mac OS, this is, for\\nexample, \'10.1\'. Will be the empty string if not supported.","type":"string"},{"name":"commandLine","description":"The command line string used to launch the browser. Will be the empty string if not\\nsupported.","type":"string"}]},{"name":"getProcessInfo","description":"Returns information about all running processes.","returns":[{"name":"processInfo","description":"An array of process info blocks.","type":"array","items":{"$ref":"ProcessInfo"}}]}]},{"domain":"Target","description":"Supports additional targets discovery and allows to attach to them.","types":[{"id":"TargetID","type":"string"},{"id":"SessionID","description":"Unique identifier of attached debugging session.","type":"string"},{"id":"BrowserContextID","experimental":true,"type":"string"},{"id":"TargetInfo","type":"object","properties":[{"name":"targetId","$ref":"TargetID"},{"name":"type","type":"string"},{"name":"title","type":"string"},{"name":"url","type":"string"},{"name":"attached","description":"Whether the target has an attached client.","type":"boolean"},{"name":"openerId","description":"Opener target Id","optional":true,"$ref":"TargetID"},{"name":"browserContextId","experimental":true,"optional":true,"$ref":"BrowserContextID"}]},{"id":"RemoteLocation","experimental":true,"type":"object","properties":[{"name":"host","type":"string"},{"name":"port","type":"integer"}]}],"commands":[{"name":"activateTarget","description":"Activates (focuses) the target.","parameters":[{"name":"targetId","$ref":"TargetID"}]},{"name":"attachToTarget","description":"Attaches to the target with given id.","parameters":[{"name":"targetId","$ref":"TargetID"},{"name":"flatten","description":"Enables \\"flat\\" access to the session via specifying sessionId attribute in the commands.","experimental":true,"optional":true,"type":"boolean"}],"returns":[{"name":"sessionId","description":"Id assigned to the session.","$ref":"SessionID"}]},{"name":"attachToBrowserTarget","description":"Attaches to the browser target, only uses flat sessionId mode.","experimental":true,"returns":[{"name":"sessionId","description":"Id assigned to the session.","$ref":"SessionID"}]},{"name":"closeTarget","description":"Closes the target. If the target is a page that gets closed too.","parameters":[{"name":"targetId","$ref":"TargetID"}],"returns":[{"name":"success","type":"boolean"}]},{"name":"exposeDevToolsProtocol","description":"Inject object to the target\'s main frame that provides a communication\\nchannel with browser target.\\n\\nInjected object will be available as `window[bindingName]`.\\n\\nThe object has the follwing API:\\n- `binding.send(json)` - a method to send messages over the remote debugging protocol\\n- `binding.onmessage = json => handleMessage(json)` - a callback that will be called for the protocol notifications and command responses.","experimental":true,"parameters":[{"name":"targetId","$ref":"TargetID"},{"name":"bindingName","description":"Binding name, \'cdp\' if not specified.","optional":true,"type":"string"}]},{"name":"createBrowserContext","description":"Creates a new empty BrowserContext. Similar to an incognito profile but you can have more than\\none.","experimental":true,"returns":[{"name":"browserContextId","description":"The id of the context created.","$ref":"BrowserContextID"}]},{"name":"getBrowserContexts","description":"Returns all browser contexts created with `Target.createBrowserContext` method.","experimental":true,"returns":[{"name":"browserContextIds","description":"An array of browser context ids.","type":"array","items":{"$ref":"BrowserContextID"}}]},{"name":"createTarget","description":"Creates a new page.","parameters":[{"name":"url","description":"The initial URL the page will be navigated to.","type":"string"},{"name":"width","description":"Frame width in DIP (headless chrome only).","optional":true,"type":"integer"},{"name":"height","description":"Frame height in DIP (headless chrome only).","optional":true,"type":"integer"},{"name":"browserContextId","description":"The browser context to create the page in.","optional":true,"$ref":"BrowserContextID"},{"name":"enableBeginFrameControl","description":"Whether BeginFrames for this target will be controlled via DevTools (headless chrome only,\\nnot supported on MacOS yet, false by default).","experimental":true,"optional":true,"type":"boolean"},{"name":"newWindow","description":"Whether to create a new Window or Tab (chrome-only, false by default).","optional":true,"type":"boolean"},{"name":"background","description":"Whether to create the target in background or foreground (chrome-only,\\nfalse by default).","optional":true,"type":"boolean"}],"returns":[{"name":"targetId","description":"The id of the page opened.","$ref":"TargetID"}]},{"name":"detachFromTarget","description":"Detaches session with given id.","parameters":[{"name":"sessionId","description":"Session to detach.","optional":true,"$ref":"SessionID"},{"name":"targetId","description":"Deprecated.","deprecated":true,"optional":true,"$ref":"TargetID"}]},{"name":"disposeBrowserContext","description":"Deletes a BrowserContext. All the belonging pages will be closed without calling their\\nbeforeunload hooks.","experimental":true,"parameters":[{"name":"browserContextId","$ref":"BrowserContextID"}]},{"name":"getTargetInfo","description":"Returns information about a target.","experimental":true,"parameters":[{"name":"targetId","optional":true,"$ref":"TargetID"}],"returns":[{"name":"targetInfo","$ref":"TargetInfo"}]},{"name":"getTargets","description":"Retrieves a list of available targets.","returns":[{"name":"targetInfos","description":"The list of targets.","type":"array","items":{"$ref":"TargetInfo"}}]},{"name":"sendMessageToTarget","description":"Sends protocol message over session with given id.","parameters":[{"name":"message","type":"string"},{"name":"sessionId","description":"Identifier of the session.","optional":true,"$ref":"SessionID"},{"name":"targetId","description":"Deprecated.","deprecated":true,"optional":true,"$ref":"TargetID"}]},{"name":"setAutoAttach","description":"Controls whether to automatically attach to new targets which are considered to be related to\\nthis one. When turned on, attaches to all existing related targets as well. When turned off,\\nautomatically detaches from all currently attached targets.","experimental":true,"parameters":[{"name":"autoAttach","description":"Whether to auto-attach to related targets.","type":"boolean"},{"name":"waitForDebuggerOnStart","description":"Whether to pause new targets when attaching to them. Use `Runtime.runIfWaitingForDebugger`\\nto run paused targets.","type":"boolean"},{"name":"flatten","description":"Enables \\"flat\\" access to the session via specifying sessionId attribute in the commands.","experimental":true,"optional":true,"type":"boolean"}]},{"name":"setDiscoverTargets","description":"Controls whether to discover available targets and notify via\\n`targetCreated/targetInfoChanged/targetDestroyed` events.","parameters":[{"name":"discover","description":"Whether to discover available targets.","type":"boolean"}]},{"name":"setRemoteLocations","description":"Enables target discovery for the specified locations, when `setDiscoverTargets` was set to\\n`true`.","experimental":true,"parameters":[{"name":"locations","description":"List of remote locations.","type":"array","items":{"$ref":"RemoteLocation"}}]}],"events":[{"name":"attachedToTarget","description":"Issued when attached to target because of auto-attach or `attachToTarget` command.","experimental":true,"parameters":[{"name":"sessionId","description":"Identifier assigned to the session used to send/receive messages.","$ref":"SessionID"},{"name":"targetInfo","$ref":"TargetInfo"},{"name":"waitingForDebugger","type":"boolean"}]},{"name":"detachedFromTarget","description":"Issued when detached from target for any reason (including `detachFromTarget` command). Can be\\nissued multiple times per target if multiple sessions have been attached to it.","experimental":true,"parameters":[{"name":"sessionId","description":"Detached session identifier.","$ref":"SessionID"},{"name":"targetId","description":"Deprecated.","deprecated":true,"optional":true,"$ref":"TargetID"}]},{"name":"receivedMessageFromTarget","description":"Notifies about a new protocol message received from the session (as reported in\\n`attachedToTarget` event).","parameters":[{"name":"sessionId","description":"Identifier of a session which sends a message.","$ref":"SessionID"},{"name":"message","type":"string"},{"name":"targetId","description":"Deprecated.","deprecated":true,"optional":true,"$ref":"TargetID"}]},{"name":"targetCreated","description":"Issued when a possible inspection target is created.","parameters":[{"name":"targetInfo","$ref":"TargetInfo"}]},{"name":"targetDestroyed","description":"Issued when a target is destroyed.","parameters":[{"name":"targetId","$ref":"TargetID"}]},{"name":"targetCrashed","description":"Issued when a target has crashed.","parameters":[{"name":"targetId","$ref":"TargetID"},{"name":"status","description":"Termination status type.","type":"string"},{"name":"errorCode","description":"Termination error code.","type":"integer"}]},{"name":"targetInfoChanged","description":"Issued when some information about a target has changed. This only happens between\\n`targetCreated` and `targetDestroyed`.","parameters":[{"name":"targetInfo","$ref":"TargetInfo"}]}]},{"domain":"Tethering","description":"The Tethering domain defines methods and events for browser port binding.","experimental":true,"commands":[{"name":"bind","description":"Request browser port binding.","parameters":[{"name":"port","description":"Port number to bind.","type":"integer"}]},{"name":"unbind","description":"Request browser port unbinding.","parameters":[{"name":"port","description":"Port number to unbind.","type":"integer"}]}],"events":[{"name":"accepted","description":"Informs that port was successfully bound and got a specified connection id.","parameters":[{"name":"port","description":"Port number that was successfully bound.","type":"integer"},{"name":"connectionId","description":"Connection id to be used.","type":"string"}]}]},{"domain":"Tracing","experimental":true,"dependencies":["IO"],"types":[{"id":"MemoryDumpConfig","description":"Configuration for memory dump. Used only when \\"memory-infra\\" category is enabled.","type":"object"},{"id":"TraceConfig","type":"object","properties":[{"name":"recordMode","description":"Controls how the trace buffer stores data.","optional":true,"type":"string","enum":["recordUntilFull","recordContinuously","recordAsMuchAsPossible","echoToConsole"]},{"name":"enableSampling","description":"Turns on JavaScript stack sampling.","optional":true,"type":"boolean"},{"name":"enableSystrace","description":"Turns on system tracing.","optional":true,"type":"boolean"},{"name":"enableArgumentFilter","description":"Turns on argument filter.","optional":true,"type":"boolean"},{"name":"includedCategories","description":"Included category filters.","optional":true,"type":"array","items":{"type":"string"}},{"name":"excludedCategories","description":"Excluded category filters.","optional":true,"type":"array","items":{"type":"string"}},{"name":"syntheticDelays","description":"Configuration to synthesize the delays in tracing.","optional":true,"type":"array","items":{"type":"string"}},{"name":"memoryDumpConfig","description":"Configuration for memory dump triggers. Used only when \\"memory-infra\\" category is enabled.","optional":true,"$ref":"MemoryDumpConfig"}]},{"id":"StreamFormat","description":"Data format of a trace. Can be either the legacy JSON format or the\\nprotocol buffer format. Note that the JSON format will be deprecated soon.","type":"string","enum":["json","proto"]},{"id":"StreamCompression","description":"Compression type to use for traces returned via streams.","type":"string","enum":["none","gzip"]}],"commands":[{"name":"end","description":"Stop trace events collection."},{"name":"getCategories","description":"Gets supported tracing categories.","returns":[{"name":"categories","description":"A list of supported tracing categories.","type":"array","items":{"type":"string"}}]},{"name":"recordClockSyncMarker","description":"Record a clock sync marker in the trace.","parameters":[{"name":"syncId","description":"The ID of this clock sync marker","type":"string"}]},{"name":"requestMemoryDump","description":"Request a global memory dump.","returns":[{"name":"dumpGuid","description":"GUID of the resulting global memory dump.","type":"string"},{"name":"success","description":"True iff the global memory dump succeeded.","type":"boolean"}]},{"name":"start","description":"Start trace events collection.","parameters":[{"name":"categories","description":"Category/tag filter","deprecated":true,"optional":true,"type":"string"},{"name":"options","description":"Tracing options","deprecated":true,"optional":true,"type":"string"},{"name":"bufferUsageReportingInterval","description":"If set, the agent will issue bufferUsage events at this interval, specified in milliseconds","optional":true,"type":"number"},{"name":"transferMode","description":"Whether to report trace events as series of dataCollected events or to save trace to a\\nstream (defaults to `ReportEvents`).","optional":true,"type":"string","enum":["ReportEvents","ReturnAsStream"]},{"name":"streamFormat","description":"Trace data format to use. This only applies when using `ReturnAsStream`\\ntransfer mode (defaults to `json`).","optional":true,"$ref":"StreamFormat"},{"name":"streamCompression","description":"Compression format to use. This only applies when using `ReturnAsStream`\\ntransfer mode (defaults to `none`)","optional":true,"$ref":"StreamCompression"},{"name":"traceConfig","optional":true,"$ref":"TraceConfig"}]}],"events":[{"name":"bufferUsage","parameters":[{"name":"percentFull","description":"A number in range [0..1] that indicates the used size of event buffer as a fraction of its\\ntotal size.","optional":true,"type":"number"},{"name":"eventCount","description":"An approximate number of events in the trace log.","optional":true,"type":"number"},{"name":"value","description":"A number in range [0..1] that indicates the used size of event buffer as a fraction of its\\ntotal size.","optional":true,"type":"number"}]},{"name":"dataCollected","description":"Contains an bucket of collected trace events. When tracing is stopped collected events will be\\nsend as a sequence of dataCollected events followed by tracingComplete event.","parameters":[{"name":"value","type":"array","items":{"type":"object"}}]},{"name":"tracingComplete","description":"Signals that tracing is stopped and there is no trace buffers pending flush, all data were\\ndelivered via dataCollected events.","parameters":[{"name":"dataLossOccurred","description":"Indicates whether some trace data is known to have been lost, e.g. because the trace ring\\nbuffer wrapped around.","type":"boolean"},{"name":"stream","description":"A handle of the stream that holds resulting trace data.","optional":true,"$ref":"IO.StreamHandle"},{"name":"traceFormat","description":"Trace data format of returned stream.","optional":true,"$ref":"StreamFormat"},{"name":"streamCompression","description":"Compression format of returned stream.","optional":true,"$ref":"StreamCompression"}]}]},{"domain":"Fetch","description":"A domain for letting clients substitute browser\'s network layer with client code.","experimental":true,"dependencies":["Network","IO","Page"],"types":[{"id":"RequestId","description":"Unique request identifier.","type":"string"},{"id":"RequestStage","description":"Stages of the request to handle. Request will intercept before the request is\\nsent. Response will intercept after the response is received (but before response\\nbody is received.","experimental":true,"type":"string","enum":["Request","Response"]},{"id":"RequestPattern","experimental":true,"type":"object","properties":[{"name":"urlPattern","description":"Wildcards (\'*\' -> zero or more, \'?\' -> exactly one) are allowed. Escape character is\\nbackslash. Omitting is equivalent to \\"*\\".","optional":true,"type":"string"},{"name":"resourceType","description":"If set, only requests for matching resource types will be intercepted.","optional":true,"$ref":"Network.ResourceType"},{"name":"requestStage","description":"Stage at wich to begin intercepting requests. Default is Request.","optional":true,"$ref":"RequestStage"}]},{"id":"HeaderEntry","description":"Response HTTP header entry","type":"object","properties":[{"name":"name","type":"string"},{"name":"value","type":"string"}]},{"id":"AuthChallenge","description":"Authorization challenge for HTTP status code 401 or 407.","experimental":true,"type":"object","properties":[{"name":"source","description":"Source of the authentication challenge.","optional":true,"type":"string","enum":["Server","Proxy"]},{"name":"origin","description":"Origin of the challenger.","type":"string"},{"name":"scheme","description":"The authentication scheme used, such as basic or digest","type":"string"},{"name":"realm","description":"The realm of the challenge. May be empty.","type":"string"}]},{"id":"AuthChallengeResponse","description":"Response to an AuthChallenge.","experimental":true,"type":"object","properties":[{"name":"response","description":"The decision on what to do in response to the authorization challenge. Default means\\ndeferring to the default behavior of the net stack, which will likely either the Cancel\\nauthentication or display a popup dialog box.","type":"string","enum":["Default","CancelAuth","ProvideCredentials"]},{"name":"username","description":"The username to provide, possibly empty. Should only be set if response is\\nProvideCredentials.","optional":true,"type":"string"},{"name":"password","description":"The password to provide, possibly empty. Should only be set if response is\\nProvideCredentials.","optional":true,"type":"string"}]}],"commands":[{"name":"disable","description":"Disables the fetch domain."},{"name":"enable","description":"Enables issuing of requestPaused events. A request will be paused until client\\ncalls one of failRequest, fulfillRequest or continueRequest/continueWithAuth.","parameters":[{"name":"patterns","description":"If specified, only requests matching any of these patterns will produce\\nfetchRequested event and will be paused until clients response. If not set,\\nall requests will be affected.","optional":true,"type":"array","items":{"$ref":"RequestPattern"}},{"name":"handleAuthRequests","description":"If true, authRequired events will be issued and requests will be paused\\nexpecting a call to continueWithAuth.","optional":true,"type":"boolean"}]},{"name":"failRequest","description":"Causes the request to fail with specified reason.","parameters":[{"name":"requestId","description":"An id the client received in requestPaused event.","$ref":"RequestId"},{"name":"errorReason","description":"Causes the request to fail with the given reason.","$ref":"Network.ErrorReason"}]},{"name":"fulfillRequest","description":"Provides response to the request.","parameters":[{"name":"requestId","description":"An id the client received in requestPaused event.","$ref":"RequestId"},{"name":"responseCode","description":"An HTTP response code.","type":"integer"},{"name":"responseHeaders","description":"Response headers.","type":"array","items":{"$ref":"HeaderEntry"}},{"name":"body","description":"A response body.","optional":true,"type":"string"},{"name":"responsePhrase","description":"A textual representation of responseCode.\\nIf absent, a standard phrase mathcing responseCode is used.","optional":true,"type":"string"}]},{"name":"continueRequest","description":"Continues the request, optionally modifying some of its parameters.","parameters":[{"name":"requestId","description":"An id the client received in requestPaused event.","$ref":"RequestId"},{"name":"url","description":"If set, the request url will be modified in a way that\'s not observable by page.","optional":true,"type":"string"},{"name":"method","description":"If set, the request method is overridden.","optional":true,"type":"string"},{"name":"postData","description":"If set, overrides the post data in the request.","optional":true,"type":"string"},{"name":"headers","description":"If set, overrides the request headrts.","optional":true,"type":"array","items":{"$ref":"HeaderEntry"}}]},{"name":"continueWithAuth","description":"Continues a request supplying authChallengeResponse following authRequired event.","parameters":[{"name":"requestId","description":"An id the client received in authRequired event.","$ref":"RequestId"},{"name":"authChallengeResponse","description":"Response to with an authChallenge.","$ref":"AuthChallengeResponse"}]},{"name":"getResponseBody","description":"Causes the body of the response to be received from the server and\\nreturned as a single string. May only be issued for a request that\\nis paused in the Response stage and is mutually exclusive with\\ntakeResponseBodyForInterceptionAsStream. Calling other methods that\\naffect the request or disabling fetch domain before body is received\\nresults in an undefined behavior.","parameters":[{"name":"requestId","description":"Identifier for the intercepted request to get body for.","$ref":"RequestId"}],"returns":[{"name":"body","description":"Response body.","type":"string"},{"name":"base64Encoded","description":"True, if content was sent as base64.","type":"boolean"}]},{"name":"takeResponseBodyAsStream","description":"Returns a handle to the stream representing the response body.\\nThe request must be paused in the HeadersReceived stage.\\nNote that after this command the request can\'t be continued\\nas is -- client either needs to cancel it or to provide the\\nresponse body.\\nThe stream only supports sequential read, IO.read will fail if the position\\nis specified.\\nThis method is mutually exclusive with getResponseBody.\\nCalling other methods that affect the request or disabling fetch\\ndomain before body is received results in an undefined behavior.","parameters":[{"name":"requestId","$ref":"RequestId"}],"returns":[{"name":"stream","$ref":"IO.StreamHandle"}]}],"events":[{"name":"requestPaused","description":"Issued when the domain is enabled and the request URL matches the\\nspecified filter. The request is paused until the client responds\\nwith one of continueRequest, failRequest or fulfillRequest.\\nThe stage of the request can be determined by presence of responseErrorReason\\nand responseStatusCode -- the request is at the response stage if either\\nof these fields is present and in the request stage otherwise.","parameters":[{"name":"requestId","description":"Each request the page makes will have a unique id.","$ref":"RequestId"},{"name":"request","description":"The details of the request.","$ref":"Network.Request"},{"name":"frameId","description":"The id of the frame that initiated the request.","$ref":"Page.FrameId"},{"name":"resourceType","description":"How the requested resource will be used.","$ref":"Network.ResourceType"},{"name":"responseErrorReason","description":"Response error if intercepted at response stage.","optional":true,"$ref":"Network.ErrorReason"},{"name":"responseStatusCode","description":"Response code if intercepted at response stage.","optional":true,"type":"integer"},{"name":"responseHeaders","description":"Response headers if intercepted at the response stage.","optional":true,"type":"array","items":{"$ref":"HeaderEntry"}},{"name":"networkId","description":"If the intercepted request had a corresponding Network.requestWillBeSent event fired for it,\\nthen this networkId will be the same as the requestId present in the requestWillBeSent event.","optional":true,"$ref":"RequestId"}]},{"name":"authRequired","description":"Issued when the domain is enabled with handleAuthRequests set to true.\\nThe request is paused until client responds with continueWithAuth.","parameters":[{"name":"requestId","description":"Each request the page makes will have a unique id.","$ref":"RequestId"},{"name":"request","description":"The details of the request.","$ref":"Network.Request"},{"name":"frameId","description":"The id of the frame that initiated the request.","$ref":"Page.FrameId"},{"name":"resourceType","description":"How the requested resource will be used.","$ref":"Network.ResourceType"},{"name":"authChallenge","description":"Details of the Authorization Challenge encountered.\\nIf this is set, client should respond with continueRequest that\\ncontains AuthChallengeResponse.","$ref":"AuthChallenge"}]}]},{"domain":"WebAudio","description":"This domain allows inspection of Web Audio API.\\nhttps://webaudio.github.io/web-audio-api/","experimental":true,"types":[{"id":"ContextId","description":"Context\'s UUID in string","type":"string"},{"id":"ContextType","description":"Enum of BaseAudioContext types","type":"string","enum":["realtime","offline"]},{"id":"ContextState","description":"Enum of AudioContextState from the spec","type":"string","enum":["suspended","running","closed"]},{"id":"ContextRealtimeData","description":"Fields in AudioContext that change in real-time.","type":"object","properties":[{"name":"currentTime","description":"The current context time in second in BaseAudioContext.","type":"number"},{"name":"renderCapacity","description":"The time spent on rendering graph divided by render qunatum duration,\\nand multiplied by 100. 100 means the audio renderer reached the full\\ncapacity and glitch may occur.","type":"number"},{"name":"callbackIntervalMean","description":"A running mean of callback interval.","type":"number"},{"name":"callbackIntervalVariance","description":"A running variance of callback interval.","type":"number"}]},{"id":"BaseAudioContext","description":"Protocol object for BaseAudioContext","type":"object","properties":[{"name":"contextId","$ref":"ContextId"},{"name":"contextType","$ref":"ContextType"},{"name":"contextState","$ref":"ContextState"},{"name":"realtimeData","optional":true,"$ref":"ContextRealtimeData"},{"name":"callbackBufferSize","description":"Platform-dependent callback buffer size.","type":"number"},{"name":"maxOutputChannelCount","description":"Number of output channels supported by audio hardware in use.","type":"number"},{"name":"sampleRate","description":"Context sample rate.","type":"number"}]}],"commands":[{"name":"enable","description":"Enables the WebAudio domain and starts sending context lifetime events."},{"name":"disable","description":"Disables the WebAudio domain."},{"name":"getRealtimeData","description":"Fetch the realtime data from the registered contexts.","parameters":[{"name":"contextId","$ref":"ContextId"}],"returns":[{"name":"realtimeData","$ref":"ContextRealtimeData"}]}],"events":[{"name":"contextCreated","description":"Notifies that a new BaseAudioContext has been created.","parameters":[{"name":"context","$ref":"BaseAudioContext"}]},{"name":"contextDestroyed","description":"Notifies that existing BaseAudioContext has been destroyed.","parameters":[{"name":"contextId","$ref":"ContextId"}]},{"name":"contextChanged","description":"Notifies that existing BaseAudioContext has changed some properties (id stays the same)..","parameters":[{"name":"context","$ref":"BaseAudioContext"}]}]},{"domain":"WebAuthn","description":"This domain allows configuring virtual authenticators to test the WebAuthn\\nAPI.","experimental":true,"types":[{"id":"AuthenticatorId","type":"string"},{"id":"AuthenticatorProtocol","type":"string","enum":["u2f","ctap2"]},{"id":"AuthenticatorTransport","type":"string","enum":["usb","nfc","ble","cable","internal"]},{"id":"VirtualAuthenticatorOptions","type":"object","properties":[{"name":"protocol","$ref":"AuthenticatorProtocol"},{"name":"transport","$ref":"AuthenticatorTransport"},{"name":"hasResidentKey","type":"boolean"},{"name":"hasUserVerification","type":"boolean"},{"name":"automaticPresenceSimulation","description":"If set to true, tests of user presence will succeed immediately.\\nOtherwise, they will not be resolved. Defaults to true.","optional":true,"type":"boolean"}]},{"id":"Credential","type":"object","properties":[{"name":"credentialId","type":"string"},{"name":"rpIdHash","description":"SHA-256 hash of the Relying Party ID the credential is scoped to. Must\\nbe 32 bytes long.\\nSee https://w3c.github.io/webauthn/#rpidhash","type":"string"},{"name":"privateKey","description":"The private key in PKCS#8 format.","type":"string"},{"name":"signCount","description":"Signature counter. This is incremented by one for each successful\\nassertion.\\nSee https://w3c.github.io/webauthn/#signature-counter","type":"integer"}]}],"commands":[{"name":"enable","description":"Enable the WebAuthn domain and start intercepting credential storage and\\nretrieval with a virtual authenticator."},{"name":"disable","description":"Disable the WebAuthn domain."},{"name":"addVirtualAuthenticator","description":"Creates and adds a virtual authenticator.","parameters":[{"name":"options","$ref":"VirtualAuthenticatorOptions"}],"returns":[{"name":"authenticatorId","$ref":"AuthenticatorId"}]},{"name":"removeVirtualAuthenticator","description":"Removes the given authenticator.","parameters":[{"name":"authenticatorId","$ref":"AuthenticatorId"}]},{"name":"addCredential","description":"Adds the credential to the specified authenticator.","parameters":[{"name":"authenticatorId","$ref":"AuthenticatorId"},{"name":"credential","$ref":"Credential"}]},{"name":"getCredentials","description":"Returns all the credentials stored in the given virtual authenticator.","parameters":[{"name":"authenticatorId","$ref":"AuthenticatorId"}],"returns":[{"name":"credentials","type":"array","items":{"$ref":"Credential"}}]},{"name":"clearCredentials","description":"Clears all the credentials from the specified device.","parameters":[{"name":"authenticatorId","$ref":"AuthenticatorId"}]},{"name":"setUserVerified","description":"Sets whether User Verification succeeds or fails for an authenticator.\\nThe default is true.","parameters":[{"name":"authenticatorId","$ref":"AuthenticatorId"},{"name":"isUserVerified","type":"boolean"}]}]},{"domain":"Console","description":"This domain is deprecated - use Runtime or Log instead.","deprecated":true,"dependencies":["Runtime"],"types":[{"id":"ConsoleMessage","description":"Console message.","type":"object","properties":[{"name":"source","description":"Message source.","type":"string","enum":["xml","javascript","network","console-api","storage","appcache","rendering","security","other","deprecation","worker"]},{"name":"level","description":"Message severity.","type":"string","enum":["log","warning","error","debug","info"]},{"name":"text","description":"Message text.","type":"string"},{"name":"url","description":"URL of the message origin.","optional":true,"type":"string"},{"name":"line","description":"Line number in the resource that generated this message (1-based).","optional":true,"type":"integer"},{"name":"column","description":"Column number in the resource that generated this message (1-based).","optional":true,"type":"integer"}]}],"commands":[{"name":"clearMessages","description":"Does nothing."},{"name":"disable","description":"Disables console domain, prevents further console messages from being reported to the client."},{"name":"enable","description":"Enables console domain, sends the messages collected so far to the client by means of the\\n`messageAdded` notification."}],"events":[{"name":"messageAdded","description":"Issued when new console message is added.","parameters":[{"name":"message","description":"Console message that has been added.","$ref":"ConsoleMessage"}]}]},{"domain":"Debugger","description":"Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing\\nbreakpoints, stepping through execution, exploring stack traces, etc.","dependencies":["Runtime"],"types":[{"id":"BreakpointId","description":"Breakpoint identifier.","type":"string"},{"id":"CallFrameId","description":"Call frame identifier.","type":"string"},{"id":"Location","description":"Location in the source code.","type":"object","properties":[{"name":"scriptId","description":"Script identifier as reported in the `Debugger.scriptParsed`.","$ref":"Runtime.ScriptId"},{"name":"lineNumber","description":"Line number in the script (0-based).","type":"integer"},{"name":"columnNumber","description":"Column number in the script (0-based).","optional":true,"type":"integer"}]},{"id":"ScriptPosition","description":"Location in the source code.","experimental":true,"type":"object","properties":[{"name":"lineNumber","type":"integer"},{"name":"columnNumber","type":"integer"}]},{"id":"CallFrame","description":"JavaScript call frame. Array of call frames form the call stack.","type":"object","properties":[{"name":"callFrameId","description":"Call frame identifier. This identifier is only valid while the virtual machine is paused.","$ref":"CallFrameId"},{"name":"functionName","description":"Name of the JavaScript function called on this call frame.","type":"string"},{"name":"functionLocation","description":"Location in the source code.","optional":true,"$ref":"Location"},{"name":"location","description":"Location in the source code.","$ref":"Location"},{"name":"url","description":"JavaScript script name or url.","type":"string"},{"name":"scopeChain","description":"Scope chain for this call frame.","type":"array","items":{"$ref":"Scope"}},{"name":"this","description":"`this` object for this call frame.","$ref":"Runtime.RemoteObject"},{"name":"returnValue","description":"The value being returned, if the function is at return point.","optional":true,"$ref":"Runtime.RemoteObject"}]},{"id":"Scope","description":"Scope description.","type":"object","properties":[{"name":"type","description":"Scope type.","type":"string","enum":["global","local","with","closure","catch","block","script","eval","module"]},{"name":"object","description":"Object representing the scope. For `global` and `with` scopes it represents the actual\\nobject; for the rest of the scopes, it is artificial transient object enumerating scope\\nvariables as its properties.","$ref":"Runtime.RemoteObject"},{"name":"name","optional":true,"type":"string"},{"name":"startLocation","description":"Location in the source code where scope starts","optional":true,"$ref":"Location"},{"name":"endLocation","description":"Location in the source code where scope ends","optional":true,"$ref":"Location"}]},{"id":"SearchMatch","description":"Search match for resource.","type":"object","properties":[{"name":"lineNumber","description":"Line number in resource content.","type":"number"},{"name":"lineContent","description":"Line with match content.","type":"string"}]},{"id":"BreakLocation","type":"object","properties":[{"name":"scriptId","description":"Script identifier as reported in the `Debugger.scriptParsed`.","$ref":"Runtime.ScriptId"},{"name":"lineNumber","description":"Line number in the script (0-based).","type":"integer"},{"name":"columnNumber","description":"Column number in the script (0-based).","optional":true,"type":"integer"},{"name":"type","optional":true,"type":"string","enum":["debuggerStatement","call","return"]}]}],"commands":[{"name":"continueToLocation","description":"Continues execution until specific location is reached.","parameters":[{"name":"location","description":"Location to continue to.","$ref":"Location"},{"name":"targetCallFrames","optional":true,"type":"string","enum":["any","current"]}]},{"name":"disable","description":"Disables debugger for given page."},{"name":"enable","description":"Enables debugger for the given page. Clients should not assume that the debugging has been\\nenabled until the result for this command is received.","parameters":[{"name":"maxScriptsCacheSize","description":"The maximum size in bytes of collected scripts (not referenced by other heap objects)\\nthe debugger can hold. Puts no limit if paramter is omitted.","experimental":true,"optional":true,"type":"number"}],"returns":[{"name":"debuggerId","description":"Unique identifier of the debugger.","experimental":true,"$ref":"Runtime.UniqueDebuggerId"}]},{"name":"evaluateOnCallFrame","description":"Evaluates expression on a given call frame.","parameters":[{"name":"callFrameId","description":"Call frame identifier to evaluate on.","$ref":"CallFrameId"},{"name":"expression","description":"Expression to evaluate.","type":"string"},{"name":"objectGroup","description":"String object group name to put result into (allows rapid releasing resulting object handles\\nusing `releaseObjectGroup`).","optional":true,"type":"string"},{"name":"includeCommandLineAPI","description":"Specifies whether command line API should be available to the evaluated expression, defaults\\nto false.","optional":true,"type":"boolean"},{"name":"silent","description":"In silent mode exceptions thrown during evaluation are not reported and do not pause\\nexecution. Overrides `setPauseOnException` state.","optional":true,"type":"boolean"},{"name":"returnByValue","description":"Whether the result is expected to be a JSON object that should be sent by value.","optional":true,"type":"boolean"},{"name":"generatePreview","description":"Whether preview should be generated for the result.","experimental":true,"optional":true,"type":"boolean"},{"name":"throwOnSideEffect","description":"Whether to throw an exception if side effect cannot be ruled out during evaluation.","optional":true,"type":"boolean"},{"name":"timeout","description":"Terminate execution after timing out (number of milliseconds).","experimental":true,"optional":true,"$ref":"Runtime.TimeDelta"}],"returns":[{"name":"result","description":"Object wrapper for the evaluation result.","$ref":"Runtime.RemoteObject"},{"name":"exceptionDetails","description":"Exception details.","optional":true,"$ref":"Runtime.ExceptionDetails"}]},{"name":"getPossibleBreakpoints","description":"Returns possible locations for breakpoint. scriptId in start and end range locations should be\\nthe same.","parameters":[{"name":"start","description":"Start of range to search possible breakpoint locations in.","$ref":"Location"},{"name":"end","description":"End of range to search possible breakpoint locations in (excluding). When not specified, end\\nof scripts is used as end of range.","optional":true,"$ref":"Location"},{"name":"restrictToFunction","description":"Only consider locations which are in the same (non-nested) function as start.","optional":true,"type":"boolean"}],"returns":[{"name":"locations","description":"List of the possible breakpoint locations.","type":"array","items":{"$ref":"BreakLocation"}}]},{"name":"getScriptSource","description":"Returns source for the script with given id.","parameters":[{"name":"scriptId","description":"Id of the script to get source for.","$ref":"Runtime.ScriptId"}],"returns":[{"name":"scriptSource","description":"Script source.","type":"string"}]},{"name":"getStackTrace","description":"Returns stack trace with given `stackTraceId`.","experimental":true,"parameters":[{"name":"stackTraceId","$ref":"Runtime.StackTraceId"}],"returns":[{"name":"stackTrace","$ref":"Runtime.StackTrace"}]},{"name":"pause","description":"Stops on the next JavaScript statement."},{"name":"pauseOnAsyncCall","experimental":true,"parameters":[{"name":"parentStackTraceId","description":"Debugger will pause when async call with given stack trace is started.","$ref":"Runtime.StackTraceId"}]},{"name":"removeBreakpoint","description":"Removes JavaScript breakpoint.","parameters":[{"name":"breakpointId","$ref":"BreakpointId"}]},{"name":"restartFrame","description":"Restarts particular call frame from the beginning.","parameters":[{"name":"callFrameId","description":"Call frame identifier to evaluate on.","$ref":"CallFrameId"}],"returns":[{"name":"callFrames","description":"New stack trace.","type":"array","items":{"$ref":"CallFrame"}},{"name":"asyncStackTrace","description":"Async stack trace, if any.","optional":true,"$ref":"Runtime.StackTrace"},{"name":"asyncStackTraceId","description":"Async stack trace, if any.","experimental":true,"optional":true,"$ref":"Runtime.StackTraceId"}]},{"name":"resume","description":"Resumes JavaScript execution."},{"name":"searchInContent","description":"Searches for given string in script content.","parameters":[{"name":"scriptId","description":"Id of the script to search in.","$ref":"Runtime.ScriptId"},{"name":"query","description":"String to search for.","type":"string"},{"name":"caseSensitive","description":"If true, search is case sensitive.","optional":true,"type":"boolean"},{"name":"isRegex","description":"If true, treats string parameter as regex.","optional":true,"type":"boolean"}],"returns":[{"name":"result","description":"List of search matches.","type":"array","items":{"$ref":"SearchMatch"}}]},{"name":"setAsyncCallStackDepth","description":"Enables or disables async call stacks tracking.","parameters":[{"name":"maxDepth","description":"Maximum depth of async call stacks. Setting to `0` will effectively disable collecting async\\ncall stacks (default).","type":"integer"}]},{"name":"setBlackboxPatterns","description":"Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in\\nscripts with url matching one of the patterns. VM will try to leave blackboxed script by\\nperforming \'step in\' several times, finally resorting to \'step out\' if unsuccessful.","experimental":true,"parameters":[{"name":"patterns","description":"Array of regexps that will be used to check script url for blackbox state.","type":"array","items":{"type":"string"}}]},{"name":"setBlackboxedRanges","description":"Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted\\nscripts by performing \'step in\' several times, finally resorting to \'step out\' if unsuccessful.\\nPositions array contains positions where blackbox state is changed. First interval isn\'t\\nblackboxed. Array should be sorted.","experimental":true,"parameters":[{"name":"scriptId","description":"Id of the script.","$ref":"Runtime.ScriptId"},{"name":"positions","type":"array","items":{"$ref":"ScriptPosition"}}]},{"name":"setBreakpoint","description":"Sets JavaScript breakpoint at a given location.","parameters":[{"name":"location","description":"Location to set breakpoint in.","$ref":"Location"},{"name":"condition","description":"Expression to use as a breakpoint condition. When specified, debugger will only stop on the\\nbreakpoint if this expression evaluates to true.","optional":true,"type":"string"}],"returns":[{"name":"breakpointId","description":"Id of the created breakpoint for further reference.","$ref":"BreakpointId"},{"name":"actualLocation","description":"Location this breakpoint resolved into.","$ref":"Location"}]},{"name":"setInstrumentationBreakpoint","description":"Sets instrumentation breakpoint.","parameters":[{"name":"instrumentation","description":"Instrumentation name.","type":"string","enum":["beforeScriptExecution","beforeScriptWithSourceMapExecution"]}],"returns":[{"name":"breakpointId","description":"Id of the created breakpoint for further reference.","$ref":"BreakpointId"}]},{"name":"setBreakpointByUrl","description":"Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this\\ncommand is issued, all existing parsed scripts will have breakpoints resolved and returned in\\n`locations` property. Further matching script parsing will result in subsequent\\n`breakpointResolved` events issued. This logical breakpoint will survive page reloads.","parameters":[{"name":"lineNumber","description":"Line number to set breakpoint at.","type":"integer"},{"name":"url","description":"URL of the resources to set breakpoint on.","optional":true,"type":"string"},{"name":"urlRegex","description":"Regex pattern for the URLs of the resources to set breakpoints on. Either `url` or\\n`urlRegex` must be specified.","optional":true,"type":"string"},{"name":"scriptHash","description":"Script hash of the resources to set breakpoint on.","optional":true,"type":"string"},{"name":"columnNumber","description":"Offset in the line to set breakpoint at.","optional":true,"type":"integer"},{"name":"condition","description":"Expression to use as a breakpoint condition. When specified, debugger will only stop on the\\nbreakpoint if this expression evaluates to true.","optional":true,"type":"string"}],"returns":[{"name":"breakpointId","description":"Id of the created breakpoint for further reference.","$ref":"BreakpointId"},{"name":"locations","description":"List of the locations this breakpoint resolved into upon addition.","type":"array","items":{"$ref":"Location"}}]},{"name":"setBreakpointOnFunctionCall","description":"Sets JavaScript breakpoint before each call to the given function.\\nIf another function was created from the same source as a given one,\\ncalling it will also trigger the breakpoint.","experimental":true,"parameters":[{"name":"objectId","description":"Function object id.","$ref":"Runtime.RemoteObjectId"},{"name":"condition","description":"Expression to use as a breakpoint condition. When specified, debugger will\\nstop on the breakpoint if this expression evaluates to true.","optional":true,"type":"string"}],"returns":[{"name":"breakpointId","description":"Id of the created breakpoint for further reference.","$ref":"BreakpointId"}]},{"name":"setBreakpointsActive","description":"Activates / deactivates all breakpoints on the page.","parameters":[{"name":"active","description":"New value for breakpoints active state.","type":"boolean"}]},{"name":"setPauseOnExceptions","description":"Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or\\nno exceptions. Initial pause on exceptions state is `none`.","parameters":[{"name":"state","description":"Pause on exceptions mode.","type":"string","enum":["none","uncaught","all"]}]},{"name":"setReturnValue","description":"Changes return value in top frame. Available only at return break position.","experimental":true,"parameters":[{"name":"newValue","description":"New return value.","$ref":"Runtime.CallArgument"}]},{"name":"setScriptSource","description":"Edits JavaScript source live.","parameters":[{"name":"scriptId","description":"Id of the script to edit.","$ref":"Runtime.ScriptId"},{"name":"scriptSource","description":"New content of the script.","type":"string"},{"name":"dryRun","description":"If true the change will not actually be applied. Dry run may be used to get result\\ndescription without actually modifying the code.","optional":true,"type":"boolean"}],"returns":[{"name":"callFrames","description":"New stack trace in case editing has happened while VM was stopped.","optional":true,"type":"array","items":{"$ref":"CallFrame"}},{"name":"stackChanged","description":"Whether current call stack was modified after applying the changes.","optional":true,"type":"boolean"},{"name":"asyncStackTrace","description":"Async stack trace, if any.","optional":true,"$ref":"Runtime.StackTrace"},{"name":"asyncStackTraceId","description":"Async stack trace, if any.","experimental":true,"optional":true,"$ref":"Runtime.StackTraceId"},{"name":"exceptionDetails","description":"Exception details if any.","optional":true,"$ref":"Runtime.ExceptionDetails"}]},{"name":"setSkipAllPauses","description":"Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).","parameters":[{"name":"skip","description":"New value for skip pauses state.","type":"boolean"}]},{"name":"setVariableValue","description":"Changes value of variable in a callframe. Object-based scopes are not supported and must be\\nmutated manually.","parameters":[{"name":"scopeNumber","description":"0-based number of scope as was listed in scope chain. Only \'local\', \'closure\' and \'catch\'\\nscope types are allowed. Other scopes could be manipulated manually.","type":"integer"},{"name":"variableName","description":"Variable name.","type":"string"},{"name":"newValue","description":"New variable value.","$ref":"Runtime.CallArgument"},{"name":"callFrameId","description":"Id of callframe that holds variable.","$ref":"CallFrameId"}]},{"name":"stepInto","description":"Steps into the function call.","parameters":[{"name":"breakOnAsyncCall","description":"Debugger will issue additional Debugger.paused notification if any async task is scheduled\\nbefore next pause.","experimental":true,"optional":true,"type":"boolean"}]},{"name":"stepOut","description":"Steps out of the function call."},{"name":"stepOver","description":"Steps over the statement."}],"events":[{"name":"breakpointResolved","description":"Fired when breakpoint is resolved to an actual script and location.","parameters":[{"name":"breakpointId","description":"Breakpoint unique identifier.","$ref":"BreakpointId"},{"name":"location","description":"Actual breakpoint location.","$ref":"Location"}]},{"name":"paused","description":"Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.","parameters":[{"name":"callFrames","description":"Call stack the virtual machine stopped on.","type":"array","items":{"$ref":"CallFrame"}},{"name":"reason","description":"Pause reason.","type":"string","enum":["ambiguous","assert","debugCommand","DOM","EventListener","exception","instrumentation","OOM","other","promiseRejection","XHR"]},{"name":"data","description":"Object containing break-specific auxiliary properties.","optional":true,"type":"object"},{"name":"hitBreakpoints","description":"Hit breakpoints IDs","optional":true,"type":"array","items":{"type":"string"}},{"name":"asyncStackTrace","description":"Async stack trace, if any.","optional":true,"$ref":"Runtime.StackTrace"},{"name":"asyncStackTraceId","description":"Async stack trace, if any.","experimental":true,"optional":true,"$ref":"Runtime.StackTraceId"},{"name":"asyncCallStackTraceId","description":"Just scheduled async call will have this stack trace as parent stack during async execution.\\nThis field is available only after `Debugger.stepInto` call with `breakOnAsynCall` flag.","experimental":true,"optional":true,"$ref":"Runtime.StackTraceId"}]},{"name":"resumed","description":"Fired when the virtual machine resumed execution."},{"name":"scriptFailedToParse","description":"Fired when virtual machine fails to parse the script.","parameters":[{"name":"scriptId","description":"Identifier of the script parsed.","$ref":"Runtime.ScriptId"},{"name":"url","description":"URL or name of the script parsed (if any).","type":"string"},{"name":"startLine","description":"Line offset of the script within the resource with given URL (for script tags).","type":"integer"},{"name":"startColumn","description":"Column offset of the script within the resource with given URL.","type":"integer"},{"name":"endLine","description":"Last line of the script.","type":"integer"},{"name":"endColumn","description":"Length of the last line of the script.","type":"integer"},{"name":"executionContextId","description":"Specifies script creation context.","$ref":"Runtime.ExecutionContextId"},{"name":"hash","description":"Content hash of the script.","type":"string"},{"name":"executionContextAuxData","description":"Embedder-specific auxiliary data.","optional":true,"type":"object"},{"name":"sourceMapURL","description":"URL of source map associated with script (if any).","optional":true,"type":"string"},{"name":"hasSourceURL","description":"True, if this script has sourceURL.","optional":true,"type":"boolean"},{"name":"isModule","description":"True, if this script is ES6 module.","optional":true,"type":"boolean"},{"name":"length","description":"This script length.","optional":true,"type":"integer"},{"name":"stackTrace","description":"JavaScript top stack frame of where the script parsed event was triggered if available.","experimental":true,"optional":true,"$ref":"Runtime.StackTrace"}]},{"name":"scriptParsed","description":"Fired when virtual machine parses script. This event is also fired for all known and uncollected\\nscripts upon enabling debugger.","parameters":[{"name":"scriptId","description":"Identifier of the script parsed.","$ref":"Runtime.ScriptId"},{"name":"url","description":"URL or name of the script parsed (if any).","type":"string"},{"name":"startLine","description":"Line offset of the script within the resource with given URL (for script tags).","type":"integer"},{"name":"startColumn","description":"Column offset of the script within the resource with given URL.","type":"integer"},{"name":"endLine","description":"Last line of the script.","type":"integer"},{"name":"endColumn","description":"Length of the last line of the script.","type":"integer"},{"name":"executionContextId","description":"Specifies script creation context.","$ref":"Runtime.ExecutionContextId"},{"name":"hash","description":"Content hash of the script.","type":"string"},{"name":"executionContextAuxData","description":"Embedder-specific auxiliary data.","optional":true,"type":"object"},{"name":"isLiveEdit","description":"True, if this script is generated as a result of the live edit operation.","experimental":true,"optional":true,"type":"boolean"},{"name":"sourceMapURL","description":"URL of source map associated with script (if any).","optional":true,"type":"string"},{"name":"hasSourceURL","description":"True, if this script has sourceURL.","optional":true,"type":"boolean"},{"name":"isModule","description":"True, if this script is ES6 module.","optional":true,"type":"boolean"},{"name":"length","description":"This script length.","optional":true,"type":"integer"},{"name":"stackTrace","description":"JavaScript top stack frame of where the script parsed event was triggered if available.","experimental":true,"optional":true,"$ref":"Runtime.StackTrace"}]}]},{"domain":"HeapProfiler","experimental":true,"dependencies":["Runtime"],"types":[{"id":"HeapSnapshotObjectId","description":"Heap snapshot object id.","type":"string"},{"id":"SamplingHeapProfileNode","description":"Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes.","type":"object","properties":[{"name":"callFrame","description":"Function location.","$ref":"Runtime.CallFrame"},{"name":"selfSize","description":"Allocations size in bytes for the node excluding children.","type":"number"},{"name":"id","description":"Node id. Ids are unique across all profiles collected between startSampling and stopSampling.","type":"integer"},{"name":"children","description":"Child nodes.","type":"array","items":{"$ref":"SamplingHeapProfileNode"}}]},{"id":"SamplingHeapProfileSample","description":"A single sample from a sampling profile.","type":"object","properties":[{"name":"size","description":"Allocation size in bytes attributed to the sample.","type":"number"},{"name":"nodeId","description":"Id of the corresponding profile tree node.","type":"integer"},{"name":"ordinal","description":"Time-ordered sample ordinal number. It is unique across all profiles retrieved\\nbetween startSampling and stopSampling.","type":"number"}]},{"id":"SamplingHeapProfile","description":"Sampling profile.","type":"object","properties":[{"name":"head","$ref":"SamplingHeapProfileNode"},{"name":"samples","type":"array","items":{"$ref":"SamplingHeapProfileSample"}}]}],"commands":[{"name":"addInspectedHeapObject","description":"Enables console to refer to the node with given id via $x (see Command Line API for more details\\n$x functions).","parameters":[{"name":"heapObjectId","description":"Heap snapshot object id to be accessible by means of $x command line API.","$ref":"HeapSnapshotObjectId"}]},{"name":"collectGarbage"},{"name":"disable"},{"name":"enable"},{"name":"getHeapObjectId","parameters":[{"name":"objectId","description":"Identifier of the object to get heap object id for.","$ref":"Runtime.RemoteObjectId"}],"returns":[{"name":"heapSnapshotObjectId","description":"Id of the heap snapshot object corresponding to the passed remote object id.","$ref":"HeapSnapshotObjectId"}]},{"name":"getObjectByHeapObjectId","parameters":[{"name":"objectId","$ref":"HeapSnapshotObjectId"},{"name":"objectGroup","description":"Symbolic group name that can be used to release multiple objects.","optional":true,"type":"string"}],"returns":[{"name":"result","description":"Evaluation result.","$ref":"Runtime.RemoteObject"}]},{"name":"getSamplingProfile","returns":[{"name":"profile","description":"Return the sampling profile being collected.","$ref":"SamplingHeapProfile"}]},{"name":"startSampling","parameters":[{"name":"samplingInterval","description":"Average sample interval in bytes. Poisson distribution is used for the intervals. The\\ndefault value is 32768 bytes.","optional":true,"type":"number"}]},{"name":"startTrackingHeapObjects","parameters":[{"name":"trackAllocations","optional":true,"type":"boolean"}]},{"name":"stopSampling","returns":[{"name":"profile","description":"Recorded sampling heap profile.","$ref":"SamplingHeapProfile"}]},{"name":"stopTrackingHeapObjects","parameters":[{"name":"reportProgress","description":"If true \'reportHeapSnapshotProgress\' events will be generated while snapshot is being taken\\nwhen the tracking is stopped.","optional":true,"type":"boolean"}]},{"name":"takeHeapSnapshot","parameters":[{"name":"reportProgress","description":"If true \'reportHeapSnapshotProgress\' events will be generated while snapshot is being taken.","optional":true,"type":"boolean"}]}],"events":[{"name":"addHeapSnapshotChunk","parameters":[{"name":"chunk","type":"string"}]},{"name":"heapStatsUpdate","description":"If heap objects tracking has been started then backend may send update for one or more fragments","parameters":[{"name":"statsUpdate","description":"An array of triplets. Each triplet describes a fragment. The first integer is the fragment\\nindex, the second integer is a total count of objects for the fragment, the third integer is\\na total size of the objects for the fragment.","type":"array","items":{"type":"integer"}}]},{"name":"lastSeenObjectId","description":"If heap objects tracking has been started then backend regularly sends a current value for last\\nseen object id and corresponding timestamp. If the were changes in the heap since last event\\nthen one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.","parameters":[{"name":"lastSeenObjectId","type":"integer"},{"name":"timestamp","type":"number"}]},{"name":"reportHeapSnapshotProgress","parameters":[{"name":"done","type":"integer"},{"name":"total","type":"integer"},{"name":"finished","optional":true,"type":"boolean"}]},{"name":"resetProfiles"}]},{"domain":"Profiler","dependencies":["Runtime","Debugger"],"types":[{"id":"ProfileNode","description":"Profile node. Holds callsite information, execution statistics and child nodes.","type":"object","properties":[{"name":"id","description":"Unique id of the node.","type":"integer"},{"name":"callFrame","description":"Function location.","$ref":"Runtime.CallFrame"},{"name":"hitCount","description":"Number of samples where this node was on top of the call stack.","optional":true,"type":"integer"},{"name":"children","description":"Child node ids.","optional":true,"type":"array","items":{"type":"integer"}},{"name":"deoptReason","description":"The reason of being not optimized. The function may be deoptimized or marked as don\'t\\noptimize.","optional":true,"type":"string"},{"name":"positionTicks","description":"An array of source position ticks.","optional":true,"type":"array","items":{"$ref":"PositionTickInfo"}}]},{"id":"Profile","description":"Profile.","type":"object","properties":[{"name":"nodes","description":"The list of profile nodes. First item is the root node.","type":"array","items":{"$ref":"ProfileNode"}},{"name":"startTime","description":"Profiling start timestamp in microseconds.","type":"number"},{"name":"endTime","description":"Profiling end timestamp in microseconds.","type":"number"},{"name":"samples","description":"Ids of samples top nodes.","optional":true,"type":"array","items":{"type":"integer"}},{"name":"timeDeltas","description":"Time intervals between adjacent samples in microseconds. The first delta is relative to the\\nprofile startTime.","optional":true,"type":"array","items":{"type":"integer"}}]},{"id":"PositionTickInfo","description":"Specifies a number of samples attributed to a certain source position.","type":"object","properties":[{"name":"line","description":"Source line number (1-based).","type":"integer"},{"name":"ticks","description":"Number of samples attributed to the source line.","type":"integer"}]},{"id":"CoverageRange","description":"Coverage data for a source range.","type":"object","properties":[{"name":"startOffset","description":"JavaScript script source offset for the range start.","type":"integer"},{"name":"endOffset","description":"JavaScript script source offset for the range end.","type":"integer"},{"name":"count","description":"Collected execution count of the source range.","type":"integer"}]},{"id":"FunctionCoverage","description":"Coverage data for a JavaScript function.","type":"object","properties":[{"name":"functionName","description":"JavaScript function name.","type":"string"},{"name":"ranges","description":"Source ranges inside the function with coverage data.","type":"array","items":{"$ref":"CoverageRange"}},{"name":"isBlockCoverage","description":"Whether coverage data for this function has block granularity.","type":"boolean"}]},{"id":"ScriptCoverage","description":"Coverage data for a JavaScript script.","type":"object","properties":[{"name":"scriptId","description":"JavaScript script id.","$ref":"Runtime.ScriptId"},{"name":"url","description":"JavaScript script name or url.","type":"string"},{"name":"functions","description":"Functions contained in the script that has coverage data.","type":"array","items":{"$ref":"FunctionCoverage"}}]},{"id":"TypeObject","description":"Describes a type collected during runtime.","experimental":true,"type":"object","properties":[{"name":"name","description":"Name of a type collected with type profiling.","type":"string"}]},{"id":"TypeProfileEntry","description":"Source offset and types for a parameter or return value.","experimental":true,"type":"object","properties":[{"name":"offset","description":"Source offset of the parameter or end of function for return values.","type":"integer"},{"name":"types","description":"The types for this parameter or return value.","type":"array","items":{"$ref":"TypeObject"}}]},{"id":"ScriptTypeProfile","description":"Type profile data collected during runtime for a JavaScript script.","experimental":true,"type":"object","properties":[{"name":"scriptId","description":"JavaScript script id.","$ref":"Runtime.ScriptId"},{"name":"url","description":"JavaScript script name or url.","type":"string"},{"name":"entries","description":"Type profile entries for parameters and return values of the functions in the script.","type":"array","items":{"$ref":"TypeProfileEntry"}}]}],"commands":[{"name":"disable"},{"name":"enable"},{"name":"getBestEffortCoverage","description":"Collect coverage data for the current isolate. The coverage data may be incomplete due to\\ngarbage collection.","returns":[{"name":"result","description":"Coverage data for the current isolate.","type":"array","items":{"$ref":"ScriptCoverage"}}]},{"name":"setSamplingInterval","description":"Changes CPU profiler sampling interval. Must be called before CPU profiles recording started.","parameters":[{"name":"interval","description":"New sampling interval in microseconds.","type":"integer"}]},{"name":"start"},{"name":"startPreciseCoverage","description":"Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code\\ncoverage may be incomplete. Enabling prevents running optimized code and resets execution\\ncounters.","parameters":[{"name":"callCount","description":"Collect accurate call counts beyond simple \'covered\' or \'not covered\'.","optional":true,"type":"boolean"},{"name":"detailed","description":"Collect block-based coverage.","optional":true,"type":"boolean"}]},{"name":"startTypeProfile","description":"Enable type profile.","experimental":true},{"name":"stop","returns":[{"name":"profile","description":"Recorded profile.","$ref":"Profile"}]},{"name":"stopPreciseCoverage","description":"Disable precise code coverage. Disabling releases unnecessary execution count records and allows\\nexecuting optimized code."},{"name":"stopTypeProfile","description":"Disable type profile. Disabling releases type profile data collected so far.","experimental":true},{"name":"takePreciseCoverage","description":"Collect coverage data for the current isolate, and resets execution counters. Precise code\\ncoverage needs to have started.","returns":[{"name":"result","description":"Coverage data for the current isolate.","type":"array","items":{"$ref":"ScriptCoverage"}}]},{"name":"takeTypeProfile","description":"Collect type profile.","experimental":true,"returns":[{"name":"result","description":"Type profile for all scripts since startTypeProfile() was turned on.","type":"array","items":{"$ref":"ScriptTypeProfile"}}]}],"events":[{"name":"consoleProfileFinished","parameters":[{"name":"id","type":"string"},{"name":"location","description":"Location of console.profileEnd().","$ref":"Debugger.Location"},{"name":"profile","$ref":"Profile"},{"name":"title","description":"Profile title passed as an argument to console.profile().","optional":true,"type":"string"}]},{"name":"consoleProfileStarted","description":"Sent when new profile recording is started using console.profile() call.","parameters":[{"name":"id","type":"string"},{"name":"location","description":"Location of console.profile().","$ref":"Debugger.Location"},{"name":"title","description":"Profile title passed as an argument to console.profile().","optional":true,"type":"string"}]}]},{"domain":"Runtime","description":"Runtime domain exposes JavaScript runtime by means of remote evaluation and mirror objects.\\nEvaluation results are returned as mirror object that expose object type, string representation\\nand unique identifier that can be used for further object reference. Original objects are\\nmaintained in memory unless they are either explicitly released or are released along with the\\nother objects in their object group.","types":[{"id":"ScriptId","description":"Unique script identifier.","type":"string"},{"id":"RemoteObjectId","description":"Unique object identifier.","type":"string"},{"id":"UnserializableValue","description":"Primitive value which cannot be JSON-stringified. Includes values `-0`, `NaN`, `Infinity`,\\n`-Infinity`, and bigint literals.","type":"string"},{"id":"RemoteObject","description":"Mirror object referencing original JavaScript object.","type":"object","properties":[{"name":"type","description":"Object type.","type":"string","enum":["object","function","undefined","string","number","boolean","symbol","bigint"]},{"name":"subtype","description":"Object subtype hint. Specified for `object` type values only.","optional":true,"type":"string","enum":["array","null","node","regexp","date","map","set","weakmap","weakset","iterator","generator","error","proxy","promise","typedarray","arraybuffer","dataview"]},{"name":"className","description":"Object class (constructor) name. Specified for `object` type values only.","optional":true,"type":"string"},{"name":"value","description":"Remote object value in case of primitive values or JSON values (if it was requested).","optional":true,"type":"any"},{"name":"unserializableValue","description":"Primitive value which can not be JSON-stringified does not have `value`, but gets this\\nproperty.","optional":true,"$ref":"UnserializableValue"},{"name":"description","description":"String representation of the object.","optional":true,"type":"string"},{"name":"objectId","description":"Unique object identifier (for non-primitive values).","optional":true,"$ref":"RemoteObjectId"},{"name":"preview","description":"Preview containing abbreviated property values. Specified for `object` type values only.","experimental":true,"optional":true,"$ref":"ObjectPreview"},{"name":"customPreview","experimental":true,"optional":true,"$ref":"CustomPreview"}]},{"id":"CustomPreview","experimental":true,"type":"object","properties":[{"name":"header","description":"The JSON-stringified result of formatter.header(object, config) call.\\nIt contains json ML array that represents RemoteObject.","type":"string"},{"name":"bodyGetterId","description":"If formatter returns true as a result of formatter.hasBody call then bodyGetterId will\\ncontain RemoteObjectId for the function that returns result of formatter.body(object, config) call.\\nThe result value is json ML array.","optional":true,"$ref":"RemoteObjectId"}]},{"id":"ObjectPreview","description":"Object containing abbreviated remote object value.","experimental":true,"type":"object","properties":[{"name":"type","description":"Object type.","type":"string","enum":["object","function","undefined","string","number","boolean","symbol","bigint"]},{"name":"subtype","description":"Object subtype hint. Specified for `object` type values only.","optional":true,"type":"string","enum":["array","null","node","regexp","date","map","set","weakmap","weakset","iterator","generator","error"]},{"name":"description","description":"String representation of the object.","optional":true,"type":"string"},{"name":"overflow","description":"True iff some of the properties or entries of the original object did not fit.","type":"boolean"},{"name":"properties","description":"List of the properties.","type":"array","items":{"$ref":"PropertyPreview"}},{"name":"entries","description":"List of the entries. Specified for `map` and `set` subtype values only.","optional":true,"type":"array","items":{"$ref":"EntryPreview"}}]},{"id":"PropertyPreview","experimental":true,"type":"object","properties":[{"name":"name","description":"Property name.","type":"string"},{"name":"type","description":"Object type. Accessor means that the property itself is an accessor property.","type":"string","enum":["object","function","undefined","string","number","boolean","symbol","accessor","bigint"]},{"name":"value","description":"User-friendly property value string.","optional":true,"type":"string"},{"name":"valuePreview","description":"Nested value preview.","optional":true,"$ref":"ObjectPreview"},{"name":"subtype","description":"Object subtype hint. Specified for `object` type values only.","optional":true,"type":"string","enum":["array","null","node","regexp","date","map","set","weakmap","weakset","iterator","generator","error"]}]},{"id":"EntryPreview","experimental":true,"type":"object","properties":[{"name":"key","description":"Preview of the key. Specified for map-like collection entries.","optional":true,"$ref":"ObjectPreview"},{"name":"value","description":"Preview of the value.","$ref":"ObjectPreview"}]},{"id":"PropertyDescriptor","description":"Object property descriptor.","type":"object","properties":[{"name":"name","description":"Property name or symbol description.","type":"string"},{"name":"value","description":"The value associated with the property.","optional":true,"$ref":"RemoteObject"},{"name":"writable","description":"True if the value associated with the property may be changed (data descriptors only).","optional":true,"type":"boolean"},{"name":"get","description":"A function which serves as a getter for the property, or `undefined` if there is no getter\\n(accessor descriptors only).","optional":true,"$ref":"RemoteObject"},{"name":"set","description":"A function which serves as a setter for the property, or `undefined` if there is no setter\\n(accessor descriptors only).","optional":true,"$ref":"RemoteObject"},{"name":"configurable","description":"True if the type of this property descriptor may be changed and if the property may be\\ndeleted from the corresponding object.","type":"boolean"},{"name":"enumerable","description":"True if this property shows up during enumeration of the properties on the corresponding\\nobject.","type":"boolean"},{"name":"wasThrown","description":"True if the result was thrown during the evaluation.","optional":true,"type":"boolean"},{"name":"isOwn","description":"True if the property is owned for the object.","optional":true,"type":"boolean"},{"name":"symbol","description":"Property symbol object, if the property is of the `symbol` type.","optional":true,"$ref":"RemoteObject"}]},{"id":"InternalPropertyDescriptor","description":"Object internal property descriptor. This property isn\'t normally visible in JavaScript code.","type":"object","properties":[{"name":"name","description":"Conventional property name.","type":"string"},{"name":"value","description":"The value associated with the property.","optional":true,"$ref":"RemoteObject"}]},{"id":"PrivatePropertyDescriptor","description":"Object private field descriptor.","experimental":true,"type":"object","properties":[{"name":"name","description":"Private property name.","type":"string"},{"name":"value","description":"The value associated with the private property.","$ref":"RemoteObject"}]},{"id":"CallArgument","description":"Represents function call argument. Either remote object id `objectId`, primitive `value`,\\nunserializable primitive value or neither of (for undefined) them should be specified.","type":"object","properties":[{"name":"value","description":"Primitive value or serializable javascript object.","optional":true,"type":"any"},{"name":"unserializableValue","description":"Primitive value which can not be JSON-stringified.","optional":true,"$ref":"UnserializableValue"},{"name":"objectId","description":"Remote object handle.","optional":true,"$ref":"RemoteObjectId"}]},{"id":"ExecutionContextId","description":"Id of an execution context.","type":"integer"},{"id":"ExecutionContextDescription","description":"Description of an isolated world.","type":"object","properties":[{"name":"id","description":"Unique id of the execution context. It can be used to specify in which execution context\\nscript evaluation should be performed.","$ref":"ExecutionContextId"},{"name":"origin","description":"Execution context origin.","type":"string"},{"name":"name","description":"Human readable name describing given context.","type":"string"},{"name":"auxData","description":"Embedder-specific auxiliary data.","optional":true,"type":"object"}]},{"id":"ExceptionDetails","description":"Detailed information about exception (or error) that was thrown during script compilation or\\nexecution.","type":"object","properties":[{"name":"exceptionId","description":"Exception id.","type":"integer"},{"name":"text","description":"Exception text, which should be used together with exception object when available.","type":"string"},{"name":"lineNumber","description":"Line number of the exception location (0-based).","type":"integer"},{"name":"columnNumber","description":"Column number of the exception location (0-based).","type":"integer"},{"name":"scriptId","description":"Script ID of the exception location.","optional":true,"$ref":"ScriptId"},{"name":"url","description":"URL of the exception location, to be used when the script was not reported.","optional":true,"type":"string"},{"name":"stackTrace","description":"JavaScript stack trace if available.","optional":true,"$ref":"StackTrace"},{"name":"exception","description":"Exception object if available.","optional":true,"$ref":"RemoteObject"},{"name":"executionContextId","description":"Identifier of the context where exception happened.","optional":true,"$ref":"ExecutionContextId"}]},{"id":"Timestamp","description":"Number of milliseconds since epoch.","type":"number"},{"id":"TimeDelta","description":"Number of milliseconds.","type":"number"},{"id":"CallFrame","description":"Stack entry for runtime errors and assertions.","type":"object","properties":[{"name":"functionName","description":"JavaScript function name.","type":"string"},{"name":"scriptId","description":"JavaScript script id.","$ref":"ScriptId"},{"name":"url","description":"JavaScript script name or url.","type":"string"},{"name":"lineNumber","description":"JavaScript script line number (0-based).","type":"integer"},{"name":"columnNumber","description":"JavaScript script column number (0-based).","type":"integer"}]},{"id":"StackTrace","description":"Call frames for assertions or error messages.","type":"object","properties":[{"name":"description","description":"String label of this stack trace. For async traces this may be a name of the function that\\ninitiated the async call.","optional":true,"type":"string"},{"name":"callFrames","description":"JavaScript function name.","type":"array","items":{"$ref":"CallFrame"}},{"name":"parent","description":"Asynchronous JavaScript stack trace that preceded this stack, if available.","optional":true,"$ref":"StackTrace"},{"name":"parentId","description":"Asynchronous JavaScript stack trace that preceded this stack, if available.","experimental":true,"optional":true,"$ref":"StackTraceId"}]},{"id":"UniqueDebuggerId","description":"Unique identifier of current debugger.","experimental":true,"type":"string"},{"id":"StackTraceId","description":"If `debuggerId` is set stack trace comes from another debugger and can be resolved there. This\\nallows to track cross-debugger calls. See `Runtime.StackTrace` and `Debugger.paused` for usages.","experimental":true,"type":"object","properties":[{"name":"id","type":"string"},{"name":"debuggerId","optional":true,"$ref":"UniqueDebuggerId"}]}],"commands":[{"name":"awaitPromise","description":"Add handler to promise with given promise object id.","parameters":[{"name":"promiseObjectId","description":"Identifier of the promise.","$ref":"RemoteObjectId"},{"name":"returnByValue","description":"Whether the result is expected to be a JSON object that should be sent by value.","optional":true,"type":"boolean"},{"name":"generatePreview","description":"Whether preview should be generated for the result.","optional":true,"type":"boolean"}],"returns":[{"name":"result","description":"Promise result. Will contain rejected value if promise was rejected.","$ref":"RemoteObject"},{"name":"exceptionDetails","description":"Exception details if stack strace is available.","optional":true,"$ref":"ExceptionDetails"}]},{"name":"callFunctionOn","description":"Calls function with given declaration on the given object. Object group of the result is\\ninherited from the target object.","parameters":[{"name":"functionDeclaration","description":"Declaration of the function to call.","type":"string"},{"name":"objectId","description":"Identifier of the object to call function on. Either objectId or executionContextId should\\nbe specified.","optional":true,"$ref":"RemoteObjectId"},{"name":"arguments","description":"Call arguments. All call arguments must belong to the same JavaScript world as the target\\nobject.","optional":true,"type":"array","items":{"$ref":"CallArgument"}},{"name":"silent","description":"In silent mode exceptions thrown during evaluation are not reported and do not pause\\nexecution. Overrides `setPauseOnException` state.","optional":true,"type":"boolean"},{"name":"returnByValue","description":"Whether the result is expected to be a JSON object which should be sent by value.","optional":true,"type":"boolean"},{"name":"generatePreview","description":"Whether preview should be generated for the result.","experimental":true,"optional":true,"type":"boolean"},{"name":"userGesture","description":"Whether execution should be treated as initiated by user in the UI.","optional":true,"type":"boolean"},{"name":"awaitPromise","description":"Whether execution should `await` for resulting value and return once awaited promise is\\nresolved.","optional":true,"type":"boolean"},{"name":"executionContextId","description":"Specifies execution context which global object will be used to call function on. Either\\nexecutionContextId or objectId should be specified.","optional":true,"$ref":"ExecutionContextId"},{"name":"objectGroup","description":"Symbolic group name that can be used to release multiple objects. If objectGroup is not\\nspecified and objectId is, objectGroup will be inherited from object.","optional":true,"type":"string"}],"returns":[{"name":"result","description":"Call result.","$ref":"RemoteObject"},{"name":"exceptionDetails","description":"Exception details.","optional":true,"$ref":"ExceptionDetails"}]},{"name":"compileScript","description":"Compiles expression.","parameters":[{"name":"expression","description":"Expression to compile.","type":"string"},{"name":"sourceURL","description":"Source url to be set for the script.","type":"string"},{"name":"persistScript","description":"Specifies whether the compiled script should be persisted.","type":"boolean"},{"name":"executionContextId","description":"Specifies in which execution context to perform script run. If the parameter is omitted the\\nevaluation will be performed in the context of the inspected page.","optional":true,"$ref":"ExecutionContextId"}],"returns":[{"name":"scriptId","description":"Id of the script.","optional":true,"$ref":"ScriptId"},{"name":"exceptionDetails","description":"Exception details.","optional":true,"$ref":"ExceptionDetails"}]},{"name":"disable","description":"Disables reporting of execution contexts creation."},{"name":"discardConsoleEntries","description":"Discards collected exceptions and console API calls."},{"name":"enable","description":"Enables reporting of execution contexts creation by means of `executionContextCreated` event.\\nWhen the reporting gets enabled the event will be sent immediately for each existing execution\\ncontext."},{"name":"evaluate","description":"Evaluates expression on global object.","parameters":[{"name":"expression","description":"Expression to evaluate.","type":"string"},{"name":"objectGroup","description":"Symbolic group name that can be used to release multiple objects.","optional":true,"type":"string"},{"name":"includeCommandLineAPI","description":"Determines whether Command Line API should be available during the evaluation.","optional":true,"type":"boolean"},{"name":"silent","description":"In silent mode exceptions thrown during evaluation are not reported and do not pause\\nexecution. Overrides `setPauseOnException` state.","optional":true,"type":"boolean"},{"name":"contextId","description":"Specifies in which execution context to perform evaluation. If the parameter is omitted the\\nevaluation will be performed in the context of the inspected page.","optional":true,"$ref":"ExecutionContextId"},{"name":"returnByValue","description":"Whether the result is expected to be a JSON object that should be sent by value.","optional":true,"type":"boolean"},{"name":"generatePreview","description":"Whether preview should be generated for the result.","experimental":true,"optional":true,"type":"boolean"},{"name":"userGesture","description":"Whether execution should be treated as initiated by user in the UI.","optional":true,"type":"boolean"},{"name":"awaitPromise","description":"Whether execution should `await` for resulting value and return once awaited promise is\\nresolved.","optional":true,"type":"boolean"},{"name":"throwOnSideEffect","description":"Whether to throw an exception if side effect cannot be ruled out during evaluation.","experimental":true,"optional":true,"type":"boolean"},{"name":"timeout","description":"Terminate execution after timing out (number of milliseconds).","experimental":true,"optional":true,"$ref":"TimeDelta"}],"returns":[{"name":"result","description":"Evaluation result.","$ref":"RemoteObject"},{"name":"exceptionDetails","description":"Exception details.","optional":true,"$ref":"ExceptionDetails"}]},{"name":"getIsolateId","description":"Returns the isolate id.","experimental":true,"returns":[{"name":"id","description":"The isolate id.","type":"string"}]},{"name":"getHeapUsage","description":"Returns the JavaScript heap usage.\\nIt is the total usage of the corresponding isolate not scoped to a particular Runtime.","experimental":true,"returns":[{"name":"usedSize","description":"Used heap size in bytes.","type":"number"},{"name":"totalSize","description":"Allocated heap size in bytes.","type":"number"}]},{"name":"getProperties","description":"Returns properties of a given object. Object group of the result is inherited from the target\\nobject.","parameters":[{"name":"objectId","description":"Identifier of the object to return properties for.","$ref":"RemoteObjectId"},{"name":"ownProperties","description":"If true, returns properties belonging only to the element itself, not to its prototype\\nchain.","optional":true,"type":"boolean"},{"name":"accessorPropertiesOnly","description":"If true, returns accessor properties (with getter/setter) only; internal properties are not\\nreturned either.","experimental":true,"optional":true,"type":"boolean"},{"name":"generatePreview","description":"Whether preview should be generated for the results.","experimental":true,"optional":true,"type":"boolean"}],"returns":[{"name":"result","description":"Object properties.","type":"array","items":{"$ref":"PropertyDescriptor"}},{"name":"internalProperties","description":"Internal object properties (only of the element itself).","optional":true,"type":"array","items":{"$ref":"InternalPropertyDescriptor"}},{"name":"privateProperties","description":"Object private properties.","experimental":true,"optional":true,"type":"array","items":{"$ref":"PrivatePropertyDescriptor"}},{"name":"exceptionDetails","description":"Exception details.","optional":true,"$ref":"ExceptionDetails"}]},{"name":"globalLexicalScopeNames","description":"Returns all let, const and class variables from global scope.","parameters":[{"name":"executionContextId","description":"Specifies in which execution context to lookup global scope variables.","optional":true,"$ref":"ExecutionContextId"}],"returns":[{"name":"names","type":"array","items":{"type":"string"}}]},{"name":"queryObjects","parameters":[{"name":"prototypeObjectId","description":"Identifier of the prototype to return objects for.","$ref":"RemoteObjectId"},{"name":"objectGroup","description":"Symbolic group name that can be used to release the results.","optional":true,"type":"string"}],"returns":[{"name":"objects","description":"Array with objects.","$ref":"RemoteObject"}]},{"name":"releaseObject","description":"Releases remote object with given id.","parameters":[{"name":"objectId","description":"Identifier of the object to release.","$ref":"RemoteObjectId"}]},{"name":"releaseObjectGroup","description":"Releases all remote objects that belong to a given group.","parameters":[{"name":"objectGroup","description":"Symbolic object group name.","type":"string"}]},{"name":"runIfWaitingForDebugger","description":"Tells inspected instance to run if it was waiting for debugger to attach."},{"name":"runScript","description":"Runs script with given id in a given context.","parameters":[{"name":"scriptId","description":"Id of the script to run.","$ref":"ScriptId"},{"name":"executionContextId","description":"Specifies in which execution context to perform script run. If the parameter is omitted the\\nevaluation will be performed in the context of the inspected page.","optional":true,"$ref":"ExecutionContextId"},{"name":"objectGroup","description":"Symbolic group name that can be used to release multiple objects.","optional":true,"type":"string"},{"name":"silent","description":"In silent mode exceptions thrown during evaluation are not reported and do not pause\\nexecution. Overrides `setPauseOnException` state.","optional":true,"type":"boolean"},{"name":"includeCommandLineAPI","description":"Determines whether Command Line API should be available during the evaluation.","optional":true,"type":"boolean"},{"name":"returnByValue","description":"Whether the result is expected to be a JSON object which should be sent by value.","optional":true,"type":"boolean"},{"name":"generatePreview","description":"Whether preview should be generated for the result.","optional":true,"type":"boolean"},{"name":"awaitPromise","description":"Whether execution should `await` for resulting value and return once awaited promise is\\nresolved.","optional":true,"type":"boolean"}],"returns":[{"name":"result","description":"Run result.","$ref":"RemoteObject"},{"name":"exceptionDetails","description":"Exception details.","optional":true,"$ref":"ExceptionDetails"}]},{"name":"setAsyncCallStackDepth","description":"Enables or disables async call stacks tracking.","redirect":"Debugger","parameters":[{"name":"maxDepth","description":"Maximum depth of async call stacks. Setting to `0` will effectively disable collecting async\\ncall stacks (default).","type":"integer"}]},{"name":"setCustomObjectFormatterEnabled","experimental":true,"parameters":[{"name":"enabled","type":"boolean"}]},{"name":"setMaxCallStackSizeToCapture","experimental":true,"parameters":[{"name":"size","type":"integer"}]},{"name":"terminateExecution","description":"Terminate current or next JavaScript execution.\\nWill cancel the termination when the outer-most script execution ends.","experimental":true},{"name":"addBinding","description":"If executionContextId is empty, adds binding with the given name on the\\nglobal objects of all inspected contexts, including those created later,\\nbindings survive reloads.\\nIf executionContextId is specified, adds binding only on global object of\\ngiven execution context.\\nBinding function takes exactly one argument, this argument should be string,\\nin case of any other input, function throws an exception.\\nEach binding function call produces Runtime.bindingCalled notification.","experimental":true,"parameters":[{"name":"name","type":"string"},{"name":"executionContextId","optional":true,"$ref":"ExecutionContextId"}]},{"name":"removeBinding","description":"This method does not remove binding function from global object but\\nunsubscribes current runtime agent from Runtime.bindingCalled notifications.","experimental":true,"parameters":[{"name":"name","type":"string"}]}],"events":[{"name":"bindingCalled","description":"Notification is issued every time when binding is called.","experimental":true,"parameters":[{"name":"name","type":"string"},{"name":"payload","type":"string"},{"name":"executionContextId","description":"Identifier of the context where the call was made.","$ref":"ExecutionContextId"}]},{"name":"consoleAPICalled","description":"Issued when console API was called.","parameters":[{"name":"type","description":"Type of the call.","type":"string","enum":["log","debug","info","error","warning","dir","dirxml","table","trace","clear","startGroup","startGroupCollapsed","endGroup","assert","profile","profileEnd","count","timeEnd"]},{"name":"args","description":"Call arguments.","type":"array","items":{"$ref":"RemoteObject"}},{"name":"executionContextId","description":"Identifier of the context where the call was made.","$ref":"ExecutionContextId"},{"name":"timestamp","description":"Call timestamp.","$ref":"Timestamp"},{"name":"stackTrace","description":"Stack trace captured when the call was made. The async stack chain is automatically reported for\\nthe following call types: `assert`, `error`, `trace`, `warning`. For other types the async call\\nchain can be retrieved using `Debugger.getStackTrace` and `stackTrace.parentId` field.","optional":true,"$ref":"StackTrace"},{"name":"context","description":"Console context descriptor for calls on non-default console context (not console.*):\\n\'anonymous#unique-logger-id\' for call on unnamed context, \'name#unique-logger-id\' for call\\non named context.","experimental":true,"optional":true,"type":"string"}]},{"name":"exceptionRevoked","description":"Issued when unhandled exception was revoked.","parameters":[{"name":"reason","description":"Reason describing why exception was revoked.","type":"string"},{"name":"exceptionId","description":"The id of revoked exception, as reported in `exceptionThrown`.","type":"integer"}]},{"name":"exceptionThrown","description":"Issued when exception was thrown and unhandled.","parameters":[{"name":"timestamp","description":"Timestamp of the exception.","$ref":"Timestamp"},{"name":"exceptionDetails","$ref":"ExceptionDetails"}]},{"name":"executionContextCreated","description":"Issued when new execution context is created.","parameters":[{"name":"context","description":"A newly created execution context.","$ref":"ExecutionContextDescription"}]},{"name":"executionContextDestroyed","description":"Issued when execution context is destroyed.","parameters":[{"name":"executionContextId","description":"Id of the destroyed context","$ref":"ExecutionContextId"}]},{"name":"executionContextsCleared","description":"Issued when all executionContexts were cleared in browser"},{"name":"inspectRequested","description":"Issued when object should be inspected (for example, as a result of inspect() command line API\\ncall).","parameters":[{"name":"object","$ref":"RemoteObject"},{"name":"hints","type":"object"}]}]},{"domain":"Schema","description":"This domain is deprecated.","deprecated":true,"types":[{"id":"Domain","description":"Description of the protocol domain.","type":"object","properties":[{"name":"name","description":"Domain name.","type":"string"},{"name":"version","description":"Domain version.","type":"string"}]}],"commands":[{"name":"getDomains","description":"Returns supported domains.","returns":[{"name":"domains","description":"List of supported domains.","type":"array","items":{"$ref":"Domain"}}]}]}]}')},function(e,t,n){"use strict";(function(t){const r=n(56),i=n(379),o=n(75).format,a=n(75).parse,s=n(382),c=n(383),p=n(151),d=n(139);class u extends Error{constructor(e,t){let{message:n}=t;t.data&&(n+=` (${t.data})`),super(n),this.request=e,this.response=t}}e.exports=class extends r{constructor(e,t){super();e=e||{},this.host=e.host||p.HOST,this.port=e.port||p.PORT,this.secure=!!e.secure,this.useHostName=!!e.useHostName,this.alterPath=e.alterPath||(e=>e),this.protocol=e.protocol,this.local=!!e.local,this.target=e.target||(e=>{let t,n=e.find(e=>!!e.webSocketDebuggerUrl&&(t=t||e,"page"===e.type));if(n=n||t,n)return n;throw new Error("No inspectable targets")}),this._notifier=t,this._callbacks={},this._nextCommandId=1,this.webSocketUrl=void 0,this._start()}inspect(e,t){return t.customInspect=!1,i.inspect(this,t)}send(e,t,n){return"function"==typeof t&&(n=t,t=void 0),"function"==typeof n?void this._enqueueCommand(e,t,n):new Promise((n,r)=>{this._enqueueCommand(e,t,(i,o)=>{if(i){const n={method:e,params:t};r(i instanceof Error?i:new u(n,o))}else n(o)})})}close(e){const t=e=>{3===this._ws.readyState?e():(this._ws.removeAllListeners("close"),this._ws.once("close",()=>{this._ws.removeAllListeners(),e()}),this._ws.close())};return"function"==typeof e?void t(e):new Promise((e,n)=>{t(e)})}async _start(){const e={host:this.host,port:this.port,secure:this.secure,useHostName:this.useHostName,alterPath:this.alterPath};try{const n=await this._fetchDebuggerURL(e),r=a(n);r.pathname=e.alterPath(r.pathname),this.webSocketUrl=o(r),e.host=r.hostname,e.port=r.port||e.port;const i=await this._fetchProtocol(e);c.prepare(this,i),await this._connectToWebSocket(),t.nextTick(()=>{this._notifier.emit("connect",this)})}catch(e){this._notifier.emit("error",e)}}async _fetchDebuggerURL(e){const t=this.target;switch(typeof t){case"string":{let n=t;if(n.startsWith("/")&&(n=`ws://${this.host}:${this.port}${n}`),n.match(/^wss?:/i))return n;return(await d.List(e)).find(e=>e.id===n).webSocketDebuggerUrl}case"object":return t.webSocketDebuggerUrl;case"function":{const n=t,r=await d.List(e),i=n(r);return("number"==typeof i?r[i]:i).webSocketDebuggerUrl}default:throw new Error(`Invalid target argument "${this.target}"`)}}async _fetchProtocol(e){return this.protocol?this.protocol:(e.local=this.local,await d.Protocol(e))}_connectToWebSocket(){return new Promise((e,t)=>{try{this.secure&&(this.webSocketUrl=this.webSocketUrl.replace(/^ws:/i,"wss:")),this._ws=new s(this.webSocketUrl)}catch(e){return void t(e)}this._ws.on("open",()=>{e()}),this._ws.on("message",e=>{const t=JSON.parse(e);this._handleMessage(t)}),this._ws.on("close",e=>{this.emit("disconnect")}),this._ws.on("error",e=>{t(e)})})}_handleMessage(e){if(e.id){const t=this._callbacks[e.id];if(!t)return;e.error?t(!0,e.error):t(!1,e.result||{}),delete this._callbacks[e.id],0===Object.keys(this._callbacks).length&&this.emit("ready")}else e.method&&(this.emit("event",e),this.emit(e.method,e.params))}_enqueueCommand(e,t,n){const r=this._nextCommandId++,i={id:r,method:e,params:t||{}};this._ws.send(JSON.stringify(i),e=>{e?"function"==typeof n&&n(e):this._callbacks[r]=n})}}}).call(this,n(30))},function(e,t,n){(function(e){var r=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}})),c=r[n];n=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),f(n)?r.showHidden=n:n&&t._extend(r,n),b(r.showHidden)&&(r.showHidden=!1),b(r.depth)&&(r.depth=2),b(r.colors)&&(r.colors=!1),b(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=c),d(r,e,r.depth)}function c(e,t){var n=s.styles[t];return n?"["+s.colors[n][0]+"m"+e+"["+s.colors[n][1]+"m":e}function p(e,t){return e}function d(e,n,r){if(e.customInspect&&n&&I(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,e);return y(i)||(i=d(e,i,r)),i}var o=function(e,t){if(b(t))return e.stylize("undefined","undefined");if(y(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(g(t))return e.stylize(""+t,"number");if(f(t))return e.stylize(""+t,"boolean");if(h(t))return e.stylize("null","null")}(e,n);if(o)return o;var a=Object.keys(n),s=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(n)),x(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return u(n);if(0===a.length){if(I(n)){var c=n.name?": "+n.name:"";return e.stylize("[Function"+c+"]","special")}if(v(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(S(n))return e.stylize(Date.prototype.toString.call(n),"date");if(x(n))return u(n)}var p,w="",T=!1,R=["{","}"];(m(n)&&(T=!0,R=["[","]"]),I(n))&&(w=" [Function"+(n.name?": "+n.name:"")+"]");return v(n)&&(w=" "+RegExp.prototype.toString.call(n)),S(n)&&(w=" "+Date.prototype.toUTCString.call(n)),x(n)&&(w=" "+u(n)),0!==a.length||T&&0!=n.length?r<0?v(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),p=T?function(e,t,n,r,i){for(var o=[],a=0,s=t.length;a=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(p,w,R)):R[0]+w+R[1]}function u(e){return"["+Error.prototype.toString.call(e)+"]"}function l(e,t,n,r,i,o){var a,s,c;if((c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(s=e.stylize("[Setter]","special")),O(r,i)||(a="["+i+"]"),s||(e.seen.indexOf(c.value)<0?(s=h(n)?d(e,c.value,null):d(e,c.value,n-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),b(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function m(e){return Array.isArray(e)}function f(e){return"boolean"==typeof e}function h(e){return null===e}function g(e){return"number"==typeof e}function y(e){return"string"==typeof e}function b(e){return void 0===e}function v(e){return w(e)&&"[object RegExp]"===T(e)}function w(e){return"object"==typeof e&&null!==e}function S(e){return w(e)&&"[object Date]"===T(e)}function x(e){return w(e)&&("[object Error]"===T(e)||e instanceof Error)}function I(e){return"function"==typeof e}function T(e){return Object.prototype.toString.call(e)}function R(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(n){if(b(o)&&(o=e.env.NODE_DEBUG||""),n=n.toUpperCase(),!a[n])if(new RegExp("\\b"+n+"\\b","i").test(o)){var r=e.pid;a[n]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",n,r,e)}}else a[n]=function(){};return a[n]},t.inspect=s,s.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]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=m,t.isBoolean=f,t.isNull=h,t.isNullOrUndefined=function(e){return null==e},t.isNumber=g,t.isString=y,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=b,t.isRegExp=v,t.isObject=w,t.isDate=S,t.isError=x,t.isFunction=I,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=n(380);var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function C(){var e=new Date,t=[R(e.getHours()),R(e.getMinutes()),R(e.getSeconds())].join(":");return[e.getDate(),k[e.getMonth()],t].join(" ")}function O(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",C(),t.format.apply(t,arguments))},t.inherits=n(381),t._extend=function(e,t){if(!t||!w(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e};var $="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function E(e,t){if(!e){var n=new Error("Promise was rejected with a falsy value");n.reason=e,e=n}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if($&&e[$]){var t;if("function"!=typeof(t=e[$]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,$,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,n,r=new Promise((function(e,r){t=e,n=r})),i=[],o=0;o{this.emit("open")},this._ws.onclose=()=>{this.emit("close")},this._ws.onmessage=e=>{this.emit("message",e.data)},this._ws.onerror=()=>{this.emit("error",new Error("WebSocket error"))}}close(){this._ws.close()}send(e,t){try{this._ws.send(e),t()}catch(e){t(e)}}}},function(e,t,n){"use strict";function r(e,t,n){e.category=t,Object.keys(n).forEach(r=>{"name"!==r&&(e[r]="type"===t&&"properties"===r||"parameters"===r?function(e){const t={};return e.forEach(e=>{const n=e.name;delete e.name,t[n]=e}),t}(n[r]):n[r])})}e.exports.prepare=function(e,t){e.protocol=t,t.domains.forEach(t=>{const n=t.domain;e[n]={},(t.commands||[]).forEach(t=>{!function(e,t,n){const i=(r,i)=>e.send(`${t}.${n.name}`,r,i);r(i,"command",n),e[t][n.name]=i}(e,n,t)}),(t.events||[]).forEach(t=>{!function(e,t,n){const i=`${t}.${n.name}`,o=t=>"function"==typeof t?(e.on(i,t),()=>e.removeListener(i,t)):new Promise((t,n)=>{e.once(i,t)});r(o,"event",n),e[t][n.name]=o}(e,n,t)}),(t.types||[]).forEach(t=>{!function(e,t,n){const i={};r(i,"type",n),e[t][n.id]=i}(e,n,t)})})}}]);'use strict'; const EventEmitter = require('events'); const devtools = require('./lib/devtools.js'); const Chrome = require('./lib/chrome.js'); function CDP(options, callback) { if (typeof options === 'function') { callback = options; options = undefined; } const notifier = new EventEmitter(); if (typeof callback === 'function') { // allow to register the error callback later process.nextTick(() => { new Chrome(options, notifier); }); return notifier.once('connect', callback); } else { return new Promise((fulfill, reject) => { notifier.once('connect', fulfill); notifier.once('error', reject); new Chrome(options, notifier); }); } } module.exports = CDP; module.exports.Protocol = devtools.Protocol; module.exports.List = devtools.List; module.exports.New = devtools.New; module.exports.Activate = devtools.Activate; module.exports.Close = devtools.Close; module.exports.Version = devtools.Version; Copyright (c) 2020 Andrea Cardaci Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "chrome-remote-interface", "author": "Andrea Cardaci ", "license": "MIT", "contributors": [ "Andrey Sidorov ", "Greg Cochard " ], "description": "Chrome Debugging Protocol interface", "keywords": [ "chrome", "debug", "protocol", "remote", "interface" ], "homepage": "https://github.com/cyrus-and/chrome-remote-interface", "version": "0.28.2", "repository": { "type": "git", "url": "git://github.com/cyrus-and/chrome-remote-interface.git" }, "bugs": { "url": "http://github.com/cyrus-and/chrome-remote-interface/issues" }, "engine-strict": { "node": ">=8" }, "dependencies": { "commander": "2.11.x", "ws": "^7.2.0" }, "files": [ "lib", "bin", "index.js", "chrome-remote-interface.js", "webpack.config.js" ], "bin": { "chrome-remote-interface": "./bin/client.js" }, "main": "index.js", "browser": "chrome-remote-interface.js", "devDependencies": { "babel-core": "^6.26.3", "babel-loader": "6.x.x", "babel-polyfill": "^6.26.0", "babel-preset-env": "^1.7.0", "eslint": "^4.19.1", "json-loader": "^0.5.4", "mocha": "^5.2.0", "webpack": "^4.35.3", "webpack-cli": "^3.3.6" }, "scripts": { "test": "./scripts/run-tests.sh", "webpack": "webpack", "prepare": "webpack" } } 'use strict'; function criWrapper(_, options, callback) { window.criRequest(options, callback); // eslint-disable-line no-undef } module.exports = { mode: 'production', resolve: { alias: { 'ws': './websocket-wrapper.js' } }, externals: [ { './external-request.js': `var (${criWrapper})` } ], entry: ['babel-polyfill', './index.js'], output: { path: __dirname, filename: 'chrome-remote-interface.js', libraryTarget: process.env.TARGET || 'commonjs2', library: 'CDP' } }; #!/usr/bin/env node 'use strict'; const repl = require('repl'); const util = require('util'); const fs = require('fs'); const path = require('path'); const program = require('commander'); const CDP = require('../'); const packageInfo = require('../package.json'); function display(object) { return util.inspect(object, { colors: process.stdout.isTTY, depth: null }); } function toJSON(object) { return JSON.stringify(object, null, 4); } /// function inspect(target, args, options) { options.local = args.local; // otherwise the active target if (target) { if (args.webSocket) { // by WebSocket URL options.target = target; } else { // by target id options.target = (targets) => { return targets.findIndex((_target) => { return _target.id === target; }); }; } } if (args.protocol) { options.protocol = JSON.parse(fs.readFileSync(args.protocol)); } CDP(options, (client) => { const cdpRepl = repl.start({ prompt: '\x1b[32m>>>\x1b[0m ', ignoreUndefined: true, writer: display }); // XXX always await promises on the REPL const defaultEval = cdpRepl.eval; cdpRepl.eval = (cmd, context, filename, callback) => { defaultEval(cmd, context, filename, async (err, result) => { if (err) { // propagate errors from the eval callback(err); } else { // awaits the promise and either return result or error try { callback(null, await Promise.resolve(result)); } catch (err) { callback(err); } } }); }; const homePath = process.env.HOME || process.env.USERPROFILE; const historyFile = path.join(homePath, '.cri_history'); const historySize = 10000; function loadHistory() { // attempt to open the history file let fd; try { fd = fs.openSync(historyFile, 'r'); } catch (err) { return; // no history file present } // populate the REPL history fs.readFileSync(fd, 'utf8') .split('\n') .filter((entry) => { return entry.trim(); }) .reverse() // to be compatible with repl.history files .forEach((entry) => { cdpRepl.history.push(entry); }); } function saveHistory() { // only store the last chunk const entries = cdpRepl.history.slice(0, historySize).reverse().join('\n'); fs.writeFileSync(historyFile, entries + '\n'); } // utility custom command cdpRepl.defineCommand('target', { help: 'Display the current target', action: () => { console.log(client.webSocketUrl); cdpRepl.displayPrompt(); } }); // utility to purge all the event handlers cdpRepl.defineCommand('reset', { help: 'Remove all the registered event handlers', action: () => { client.removeAllListeners(); cdpRepl.displayPrompt(); } }); // enable history loadHistory(); // disconnect on exit cdpRepl.on('exit', () => { console.log(); client.close(); saveHistory(); }); // exit on disconnection client.on('disconnect', () => { console.error('Disconnected.'); saveHistory(); process.exit(1); }); // add protocol API for (const domainObject of client.protocol.domains) { // walk the domain names const domainName = domainObject.domain; cdpRepl.context[domainName] = {}; // walk the items in the domain for (const itemName in client[domainName]) { // add CDP object to the REPL context const cdpObject = client[domainName][itemName]; cdpRepl.context[domainName][itemName] = cdpObject; } } }).on('error', (err) => { console.error('Cannot connect to remote endpoint:', err.toString()); }); } function list(options) { CDP.List(options, (err, targets) => { if (err) { console.error(err.toString()); process.exit(1); } console.log(toJSON(targets)); }); } function _new(url, options) { options.url = url; CDP.New(options, (err, target) => { if (err) { console.error(err.toString()); process.exit(1); } console.log(toJSON(target)); }); } function activate(args, options) { options.id = args; CDP.Activate(options, (err) => { if (err) { console.error(err.toString()); process.exit(1); } }); } function close(args, options) { options.id = args; CDP.Close(options, (err) => { if (err) { console.error(err.toString()); process.exit(1); } }); } function version(options) { CDP.Version(options, (err, info) => { if (err) { console.error(err.toString()); process.exit(1); } console.log(toJSON(info)); }); } function protocol(args, options) { options.local = args.local; CDP.Protocol(options, (err, protocol) => { if (err) { console.error(err.toString()); process.exit(1); } console.log(toJSON(protocol)); }); } /// let action; program .option('-v, --v', 'Show this module version') .option('-t, --host ', 'HTTP frontend host') .option('-p, --port ', 'HTTP frontend port') .option('-s, --secure', 'HTTPS/WSS frontend') .option('-n, --use-host-name', 'Do not perform a DNS lookup of the host'); program .command('inspect []') .description('inspect a target (defaults to the first available target)') .option('-w, --web-socket', 'interpret as a WebSocket URL instead of a target id') .option('-j, --protocol ', 'Chrome Debugging Protocol descriptor (overrides `--local`)') .option('-l, --local', 'Use the local protocol descriptor') .action((target, args) => { action = inspect.bind(null, target, args); }); program .command('list') .description('list all the available targets/tabs') .action(() => { action = list; }); program .command('new []') .description('create a new target/tab') .action((url) => { action = _new.bind(null, url); }); program .command('activate ') .description('activate a target/tab by id') .action((id) => { action = activate.bind(null, id); }); program .command('close ') .description('close a target/tab by id') .action((id) => { action = close.bind(null, id); }); program .command('version') .description('show the browser version') .action(() => { action = version; }); program .command('protocol') .description('show the currently available protocol descriptor') .option('-l, --local', 'Return the local protocol descriptor') .action((args) => { action = protocol.bind(null, args); }); program.parse(process.argv); // common options const options = { host: program.host, port: program.port, secure: program.secure, useHostName: program.useHostName }; if (action) { action(options); } else { if (program.v) { console.log(packageInfo.version); } else { program.outputHelp(); process.exit(1); } } 'use strict'; function arrayToObject(parameters) { const keyValue = {}; parameters.forEach((parameter) =>{ const name = parameter.name; delete parameter.name; keyValue[name] = parameter; }); return keyValue; } function decorate(to, category, object) { to.category = category; Object.keys(object).forEach((field) => { // skip the 'name' field as it is part of the function prototype if (field === 'name') { return; } // commands and events have parameters whereas types have properties if (category === 'type' && field === 'properties' || field === 'parameters') { to[field] = arrayToObject(object[field]); } else { to[field] = object[field]; } }); } function addCommand(chrome, domainName, command) { const handler = (params, callback) => { return chrome.send(`${domainName}.${command.name}`, params, callback); }; decorate(handler, 'command', command); chrome[domainName][command.name] = handler; } function addEvent(chrome, domainName, event) { const eventName = `${domainName}.${event.name}`; const handler = (handler) => { if (typeof handler === 'function') { chrome.on(eventName, handler); return () => chrome.removeListener(eventName, handler); } else { return new Promise((fulfill, reject) => { chrome.once(eventName, fulfill); }); } }; decorate(handler, 'event', event); chrome[domainName][event.name] = handler; } function addType(chrome, domainName, type) { const help = {}; decorate(help, 'type', type); chrome[domainName][type.id] = help; } function prepare(object, protocol) { // assign the protocol and generate the shorthands object.protocol = protocol; protocol.domains.forEach((domain) => { const domainName = domain.domain; object[domainName] = {}; // add commands (domain.commands || []).forEach((command) => { addCommand(object, domainName, command); }); // add events (domain.events || []).forEach((event) => { addEvent(object, domainName, event); }); // add types (domain.types || []).forEach((type) => { addType(object, domainName, type); }); }); } module.exports.prepare = prepare; 'use strict'; const EventEmitter = require('events'); const util = require('util'); const formatUrl = require('url').format; const parseUrl = require('url').parse; const WebSocket = require('ws'); const api = require('./api.js'); const defaults = require('./defaults.js'); const devtools = require('./devtools.js'); class ProtocolError extends Error { constructor(request, response) { let {message} = response; if (response.data) { message += ` (${response.data})`; } super(message); // attach the original response as well this.request = request; this.response = response; } } class Chrome extends EventEmitter { constructor(options, notifier) { super(); // options const defaultTarget = (targets) => { // prefer type = 'page' inspectabe targets as they represents // browser tabs (fall back to the first instectable target // otherwise) let backup; let target = targets.find((target) => { if (target.webSocketDebuggerUrl) { backup = backup || target; return target.type === 'page'; } else { return false; } }); target = target || backup; if (target) { return target; } else { throw new Error('No inspectable targets'); } }; options = options || {}; this.host = options.host || defaults.HOST; this.port = options.port || defaults.PORT; this.secure = !!(options.secure); this.useHostName = !!(options.useHostName); this.alterPath = options.alterPath || ((path) => path); this.protocol = options.protocol; this.local = !!(options.local); this.target = options.target || defaultTarget; // locals this._notifier = notifier; this._callbacks = {}; this._nextCommandId = 1; // properties this.webSocketUrl = undefined; // operations this._start(); } // avoid misinterpreting protocol's members as custom util.inspect functions inspect(depth, options) { options.customInspect = false; return util.inspect(this, options); } send(method, params, callback) { if (typeof params === 'function') { callback = params; params = undefined; } // return a promise when a callback is not provided if (typeof callback === 'function') { this._enqueueCommand(method, params, callback); return undefined; } else { return new Promise((fulfill, reject) => { this._enqueueCommand(method, params, (error, response) => { if (error) { const request = {method, params}; reject( error instanceof Error ? error // low-level WebSocket error : new ProtocolError(request, response) ); } else { fulfill(response); } }); }); } } close(callback) { const closeWebSocket = (callback) => { // don't close if it's already closed if (this._ws.readyState === 3) { callback(); } else { // don't notify on user-initiated shutdown ('disconnect' event) this._ws.removeAllListeners('close'); this._ws.once('close', () => { this._ws.removeAllListeners(); callback(); }); this._ws.close(); } }; if (typeof callback === 'function') { closeWebSocket(callback); return undefined; } else { return new Promise((fulfill, reject) => { closeWebSocket(fulfill); }); } } // initiate the connection process async _start() { const options = { host: this.host, port: this.port, secure: this.secure, useHostName: this.useHostName, alterPath: this.alterPath }; try { // fetch the WebSocket debugger URL const url = await this._fetchDebuggerURL(options); // allow the user to alter the URL const urlObject = parseUrl(url); urlObject.pathname = options.alterPath(urlObject.pathname); this.webSocketUrl = formatUrl(urlObject); // update the connection parameters using the debugging URL options.host = urlObject.hostname; options.port = urlObject.port || options.port; // fetch the protocol and prepare the API const protocol = await this._fetchProtocol(options); api.prepare(this, protocol); // finally connect to the WebSocket await this._connectToWebSocket(); // since the handler is executed synchronously, the emit() must be // performed in the next tick so that uncaught errors in the client code // are not intercepted by the Promise mechanism and therefore reported // via the 'error' event process.nextTick(() => { this._notifier.emit('connect', this); }); } catch (err) { this._notifier.emit('error', err); } } // fetch the WebSocket URL according to 'target' async _fetchDebuggerURL(options) { const userTarget = this.target; switch (typeof userTarget) { case 'string': { let idOrUrl = userTarget; // use default host and port if omitted (and a relative URL is specified) if (idOrUrl.startsWith('/')) { idOrUrl = `ws://${this.host}:${this.port}${idOrUrl}`; } // a WebSocket URL is specified by the user (e.g., node-inspector) if (idOrUrl.match(/^wss?:/i)) { return idOrUrl; // done! } // a target id is specified by the user else { const targets = await devtools.List(options); const object = targets.find((target) => target.id === idOrUrl); return object.webSocketDebuggerUrl; } } case 'object': { const object = userTarget; return object.webSocketDebuggerUrl; } case 'function': { const func = userTarget; const targets = await devtools.List(options); const result = func(targets); const object = typeof result === 'number' ? targets[result] : result; return object.webSocketDebuggerUrl; } default: throw new Error(`Invalid target argument "${this.target}"`); } } // fetch the protocol according to 'protocol' and 'local' async _fetchProtocol(options) { // if a protocol has been provided then use it if (this.protocol) { return this.protocol; } // otherwise user either the local or the remote version else { options.local = this.local; return await devtools.Protocol(options); } } // establish the WebSocket connection and start processing user commands _connectToWebSocket() { return new Promise((fulfill, reject) => { // create the WebSocket try { if (this.secure) { this.webSocketUrl = this.webSocketUrl.replace(/^ws:/i, 'wss:'); } this._ws = new WebSocket(this.webSocketUrl); } catch (err) { // handles bad URLs reject(err); return; } // set up event handlers this._ws.on('open', () => { fulfill(); }); this._ws.on('message', (data) => { const message = JSON.parse(data); this._handleMessage(message); }); this._ws.on('close', (code) => { this.emit('disconnect'); }); this._ws.on('error', (err) => { reject(err); }); }); } // handle the messages read from the WebSocket _handleMessage(message) { // command response if (message.id) { const callback = this._callbacks[message.id]; if (!callback) { return; } // interpret the lack of both 'error' and 'result' as success // (this may happen with node-inspector) if (message.error) { callback(true, message.error); } else { callback(false, message.result || {}); } // unregister command response callback delete this._callbacks[message.id]; // notify when there are no more pending commands if (Object.keys(this._callbacks).length === 0) { this.emit('ready'); } } // event else if (message.method) { this.emit('event', message); this.emit(message.method, message.params); } } // send a command to the remote endpoint and register a callback for the reply _enqueueCommand(method, params, callback) { const id = this._nextCommandId++; const message = { id, method, params: params || {} }; this._ws.send(JSON.stringify(message), (err) => { if (err) { // handle low-level WebSocket errors if (typeof callback === 'function') { callback(err); } } else { this._callbacks[id] = callback; } }); } } module.exports = Chrome; 'use strict'; module.exports.HOST = 'localhost'; module.exports.PORT = 9222; 'use strict'; const http = require('http'); const https = require('https'); const defaults = require('./defaults.js'); const externalRequest = require('./external-request.js'); // options.path must be specified; callback(err, data) function devToolsInterface(options, callback) { options.host = options.host || defaults.HOST; options.port = options.port || defaults.PORT; options.secure = !!(options.secure); options.useHostName = !!(options.useHostName); options.alterPath = options.alterPath || ((path) => path); // allow the user to alter the path const newOptions = {...options}; newOptions.path = options.alterPath(options.path); externalRequest(options.secure ? https : http, newOptions, callback); } // wrapper that allows to return a promise if the callback is omitted, it works // for DevTools methods function promisesWrapper(func) { return (options, callback) => { // options is an optional argument if (typeof options === 'function') { callback = options; options = undefined; } options = options || {}; // just call the function otherwise wrap a promise around its execution if (typeof callback === 'function') { func(options, callback); return undefined; } else { return new Promise((fulfill, reject) => { func(options, (err, result) => { if (err) { reject(err); } else { fulfill(result); } }); }); } }; } function Protocol(options, callback) { // if the local protocol is requested if (options.local) { const localDescriptor = require('./protocol.json'); callback(null, localDescriptor); return; } // try to fecth the protocol remotely options.path = '/json/protocol'; devToolsInterface(options, (err, descriptor) => { if (err) { callback(err); } else { callback(null, JSON.parse(descriptor)); } }); } function List(options, callback) { options.path = '/json/list'; devToolsInterface(options, (err, tabs) => { if (err) { callback(err); } else { callback(null, JSON.parse(tabs)); } }); } function New(options, callback) { options.path = '/json/new'; if (Object.prototype.hasOwnProperty.call(options, 'url')) { options.path += `?${options.url}`; } devToolsInterface(options, (err, tab) => { if (err) { callback(err); } else { callback(null, JSON.parse(tab)); } }); } function Activate(options, callback) { options.path = '/json/activate/' + options.id; devToolsInterface(options, (err) => { if (err) { callback(err); } else { callback(null); } }); } function Close(options, callback) { options.path = '/json/close/' + options.id; devToolsInterface(options, (err) => { if (err) { callback(err); } else { callback(null); } }); } function Version(options, callback) { options.path = '/json/version'; devToolsInterface(options, (err, versionInfo) => { if (err) { callback(err); } else { callback(null, JSON.parse(versionInfo)); } }); } module.exports.Protocol = promisesWrapper(Protocol); module.exports.List = promisesWrapper(List); module.exports.New = promisesWrapper(New); module.exports.Activate = promisesWrapper(Activate); module.exports.Close = promisesWrapper(Close); module.exports.Version = promisesWrapper(Version); 'use strict'; const dns = require('dns'); const util = require('util'); const REQUEST_TIMEOUT = 10000; // callback(err, data) async function externalRequest(transport, options, callback) { // perform the DNS lookup manually so that the HTTP host header generated by // http.get will contain the IP address, this is needed because since Chrome // 66 the host header cannot contain an host name different than localhost // (see https://github.com/cyrus-and/chrome-remote-interface/issues/340) if (!options.useHostName) { try { const {address} = await util.promisify(dns.lookup)(options.host); options = Object.assign({}, options); options.host = address; } catch (err) { callback(err); return; } } // perform the actual request const request = transport.get(options, (response) => { let data = ''; response.on('data', (chunk) => { data += chunk; }); response.on('end', () => { if (response.statusCode === 200) { callback(null, data); } else { callback(new Error(data)); } }); }); request.setTimeout(REQUEST_TIMEOUT, () => { request.abort(); }); request.on('error', callback); } module.exports = externalRequest; { "version": { "major": "1", "minor": "3" }, "domains": [ { "domain": "Accessibility", "experimental": true, "dependencies": [ "DOM" ], "types": [ { "id": "AXNodeId", "description": "Unique accessibility node identifier.", "type": "string" }, { "id": "AXValueType", "description": "Enum of possible property types.", "type": "string", "enum": [ "boolean", "tristate", "booleanOrUndefined", "idref", "idrefList", "integer", "node", "nodeList", "number", "string", "computedString", "token", "tokenList", "domRelation", "role", "internalRole", "valueUndefined" ] }, { "id": "AXValueSourceType", "description": "Enum of possible property sources.", "type": "string", "enum": [ "attribute", "implicit", "style", "contents", "placeholder", "relatedElement" ] }, { "id": "AXValueNativeSourceType", "description": "Enum of possible native property sources (as a subtype of a particular AXValueSourceType).", "type": "string", "enum": [ "figcaption", "label", "labelfor", "labelwrapped", "legend", "tablecaption", "title", "other" ] }, { "id": "AXValueSource", "description": "A single source for a computed AX property.", "type": "object", "properties": [ { "name": "type", "description": "What type of source this is.", "$ref": "AXValueSourceType" }, { "name": "value", "description": "The value of this property source.", "optional": true, "$ref": "AXValue" }, { "name": "attribute", "description": "The name of the relevant attribute, if any.", "optional": true, "type": "string" }, { "name": "attributeValue", "description": "The value of the relevant attribute, if any.", "optional": true, "$ref": "AXValue" }, { "name": "superseded", "description": "Whether this source is superseded by a higher priority source.", "optional": true, "type": "boolean" }, { "name": "nativeSource", "description": "The native markup source for this value, e.g. a [otherDirs...]') * .description('run teardown commands') * .action(function(dir, otherDirs) { * console.log('dir "%s"', dir); * if (otherDirs) { * otherDirs.forEach(function (oDir) { * console.log('dir "%s"', oDir); * }); * } * }); * * program * .command('*') * .description('deploy the given env') * .action(function(env) { * console.log('deploying "%s"', env); * }); * * program.parse(process.argv); * * @param {String} name * @param {String} [desc] for git-style sub-commands * @return {Command} the new command * @api public */ Command.prototype.command = function(name, desc, opts) { opts = opts || {}; var args = name.split(/ +/); var cmd = new Command(args.shift()); if (desc) { cmd.description(desc); this.executables = true; this._execs[cmd._name] = true; if (opts.isDefault) this.defaultExecutable = cmd._name; } cmd._noHelp = !!opts.noHelp; this.commands.push(cmd); cmd.parseExpectedArgs(args); cmd.parent = this; if (desc) return this; return cmd; }; /** * Define argument syntax for the top-level command. * * @api public */ Command.prototype.arguments = function (desc) { return this.parseExpectedArgs(desc.split(/ +/)); }; /** * Add an implicit `help [cmd]` subcommand * which invokes `--help` for the given command. * * @api private */ Command.prototype.addImplicitHelpCommand = function() { this.command('help [cmd]', 'display help for [cmd]'); }; /** * Parse expected `args`. * * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`. * * @param {Array} args * @return {Command} for chaining * @api public */ Command.prototype.parseExpectedArgs = function(args) { if (!args.length) return; var self = this; args.forEach(function(arg) { var argDetails = { required: false, name: '', variadic: false }; switch (arg[0]) { case '<': argDetails.required = true; argDetails.name = arg.slice(1, -1); break; case '[': argDetails.name = arg.slice(1, -1); break; } if (argDetails.name.length > 3 && argDetails.name.slice(-3) === '...') { argDetails.variadic = true; argDetails.name = argDetails.name.slice(0, -3); } if (argDetails.name) { self._args.push(argDetails); } }); return this; }; /** * Register callback `fn` for the command. * * Examples: * * program * .command('help') * .description('display verbose help') * .action(function() { * // output help here * }); * * @param {Function} fn * @return {Command} for chaining * @api public */ Command.prototype.action = function(fn) { var self = this; var listener = function(args, unknown) { // Parse any so-far unknown options args = args || []; unknown = unknown || []; var parsed = self.parseOptions(unknown); // Output help if necessary outputHelpIfNecessary(self, parsed.unknown); // If there are still any unknown options, then we simply // die, unless someone asked for help, in which case we give it // to them, and then we die. if (parsed.unknown.length > 0) { self.unknownOption(parsed.unknown[0]); } // Leftover arguments need to be pushed back. Fixes issue #56 if (parsed.args.length) args = parsed.args.concat(args); self._args.forEach(function(arg, i) { if (arg.required && null == args[i]) { self.missingArgument(arg.name); } else if (arg.variadic) { if (i !== self._args.length - 1) { self.variadicArgNotLast(arg.name); } args[i] = args.splice(i); } }); // Always append ourselves to the end of the arguments, // to make sure we match the number of arguments the user // expects if (self._args.length) { args[self._args.length] = self; } else { args.push(self); } fn.apply(self, args); }; var parent = this.parent || this; var name = parent === this ? '*' : this._name; parent.on('command:' + name, listener); if (this._alias) parent.on('command:' + this._alias, listener); return this; }; /** * Define option with `flags`, `description` and optional * coercion `fn`. * * The `flags` string should contain both the short and long flags, * separated by comma, a pipe or space. The following are all valid * all will output this way when `--help` is used. * * "-p, --pepper" * "-p|--pepper" * "-p --pepper" * * Examples: * * // simple boolean defaulting to false * program.option('-p, --pepper', 'add pepper'); * * --pepper * program.pepper * // => Boolean * * // simple boolean defaulting to true * program.option('-C, --no-cheese', 'remove cheese'); * * program.cheese * // => true * * --no-cheese * program.cheese * // => false * * // required argument * program.option('-C, --chdir ', 'change the working directory'); * * --chdir /tmp * program.chdir * // => "/tmp" * * // optional argument * program.option('-c, --cheese [type]', 'add cheese [marble]'); * * @param {String} flags * @param {String} description * @param {Function|*} [fn] or default * @param {*} [defaultValue] * @return {Command} for chaining * @api public */ Command.prototype.option = function(flags, description, fn, defaultValue) { var self = this , option = new Option(flags, description) , oname = option.name() , name = camelcase(oname); // default as 3rd arg if (typeof fn != 'function') { if (fn instanceof RegExp) { var regex = fn; fn = function(val, def) { var m = regex.exec(val); return m ? m[0] : def; } } else { defaultValue = fn; fn = null; } } // preassign default value only for --no-*, [optional], or if (false == option.bool || option.optional || option.required) { // when --no-* we make sure default is true if (false == option.bool) defaultValue = true; // preassign only if we have a default if (undefined !== defaultValue) self[name] = defaultValue; } // register the option this.options.push(option); // when it's passed assign the value // and conditionally invoke the callback this.on('option:' + oname, function(val) { // coercion if (null !== val && fn) val = fn(val, undefined === self[name] ? defaultValue : self[name]); // unassigned or bool if ('boolean' == typeof self[name] || 'undefined' == typeof self[name]) { // if no value, bool true, and we have a default, then use it! if (null == val) { self[name] = option.bool ? defaultValue || true : false; } else { self[name] = val; } } else if (null !== val) { // reassign self[name] = val; } }); return this; }; /** * Allow unknown options on the command line. * * @param {Boolean} arg if `true` or omitted, no error will be thrown * for unknown options. * @api public */ Command.prototype.allowUnknownOption = function(arg) { this._allowUnknownOption = arguments.length === 0 || arg; return this; }; /** * Parse `argv`, settings options and invoking commands when defined. * * @param {Array} argv * @return {Command} for chaining * @api public */ Command.prototype.parse = function(argv) { // implicit help if (this.executables) this.addImplicitHelpCommand(); // store raw args this.rawArgs = argv; // guess name this._name = this._name || basename(argv[1], '.js'); // github-style sub-commands with no sub-command if (this.executables && argv.length < 3 && !this.defaultExecutable) { // this user needs help argv.push('--help'); } // process argv var parsed = this.parseOptions(this.normalize(argv.slice(2))); var args = this.args = parsed.args; var result = this.parseArgs(this.args, parsed.unknown); // executable sub-commands var name = result.args[0]; var aliasCommand = null; // check alias of sub commands if (name) { aliasCommand = this.commands.filter(function(command) { return command.alias() === name; })[0]; } if (this._execs[name] && typeof this._execs[name] != "function") { return this.executeSubCommand(argv, args, parsed.unknown); } else if (aliasCommand) { // is alias of a subCommand args[0] = aliasCommand._name; return this.executeSubCommand(argv, args, parsed.unknown); } else if (this.defaultExecutable) { // use the default subcommand args.unshift(this.defaultExecutable); return this.executeSubCommand(argv, args, parsed.unknown); } return result; }; /** * Execute a sub-command executable. * * @param {Array} argv * @param {Array} args * @param {Array} unknown * @api private */ Command.prototype.executeSubCommand = function(argv, args, unknown) { args = args.concat(unknown); if (!args.length) this.help(); if ('help' == args[0] && 1 == args.length) this.help(); // --help if ('help' == args[0]) { args[0] = args[1]; args[1] = '--help'; } // executable var f = argv[1]; // name of the subcommand, link `pm-install` var bin = basename(f, '.js') + '-' + args[0]; // In case of globally installed, get the base dir where executable // subcommand file should be located at var baseDir , link = fs.lstatSync(f).isSymbolicLink() ? fs.readlinkSync(f) : f; // when symbolink is relative path if (link !== f && link.charAt(0) !== '/') { link = path.join(dirname(f), link) } baseDir = dirname(link); // prefer local `./` to bin in the $PATH var localBin = path.join(baseDir, bin); // whether bin file is a js script with explicit `.js` extension var isExplicitJS = false; if (exists(localBin + '.js')) { bin = localBin + '.js'; isExplicitJS = true; } else if (exists(localBin)) { bin = localBin; } args = args.slice(1); var proc; if (process.platform !== 'win32') { if (isExplicitJS) { args.unshift(bin); // add executable arguments to spawn args = (process.execArgv || []).concat(args); proc = spawn('node', args, { stdio: 'inherit', customFds: [0, 1, 2] }); } else { proc = spawn(bin, args, { stdio: 'inherit', customFds: [0, 1, 2] }); } } else { args.unshift(bin); proc = spawn(process.execPath, args, { stdio: 'inherit'}); } var signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP']; signals.forEach(function(signal) { process.on(signal, function(){ if ((proc.killed === false) && (proc.exitCode === null)){ proc.kill(signal); } }); }); proc.on('close', process.exit.bind(process)); proc.on('error', function(err) { if (err.code == "ENOENT") { console.error('\n %s(1) does not exist, try --help\n', bin); } else if (err.code == "EACCES") { console.error('\n %s(1) not executable. try chmod or run with root\n', bin); } process.exit(1); }); // Store the reference to the child process this.runningCommand = proc; }; /** * Normalize `args`, splitting joined short flags. For example * the arg "-abc" is equivalent to "-a -b -c". * This also normalizes equal sign and splits "--abc=def" into "--abc def". * * @param {Array} args * @return {Array} * @api private */ Command.prototype.normalize = function(args) { var ret = [] , arg , lastOpt , index; for (var i = 0, len = args.length; i < len; ++i) { arg = args[i]; if (i > 0) { lastOpt = this.optionFor(args[i-1]); } if (arg === '--') { // Honor option terminator ret = ret.concat(args.slice(i)); break; } else if (lastOpt && lastOpt.required) { ret.push(arg); } else if (arg.length > 1 && '-' == arg[0] && '-' != arg[1]) { arg.slice(1).split('').forEach(function(c) { ret.push('-' + c); }); } else if (/^--/.test(arg) && ~(index = arg.indexOf('='))) { ret.push(arg.slice(0, index), arg.slice(index + 1)); } else { ret.push(arg); } } return ret; }; /** * Parse command `args`. * * When listener(s) are available those * callbacks are invoked, otherwise the "*" * event is emitted and those actions are invoked. * * @param {Array} args * @return {Command} for chaining * @api private */ Command.prototype.parseArgs = function(args, unknown) { var name; if (args.length) { name = args[0]; if (this.listeners('command:' + name).length) { this.emit('command:' + args.shift(), args, unknown); } else { this.emit('command:*', args); } } else { outputHelpIfNecessary(this, unknown); // If there were no args and we have unknown options, // then they are extraneous and we need to error. if (unknown.length > 0) { this.unknownOption(unknown[0]); } } return this; }; /** * Return an option matching `arg` if any. * * @param {String} arg * @return {Option} * @api private */ Command.prototype.optionFor = function(arg) { for (var i = 0, len = this.options.length; i < len; ++i) { if (this.options[i].is(arg)) { return this.options[i]; } } }; /** * Parse options from `argv` returning `argv` * void of these options. * * @param {Array} argv * @return {Array} * @api public */ Command.prototype.parseOptions = function(argv) { var args = [] , len = argv.length , literal , option , arg; var unknownOptions = []; // parse options for (var i = 0; i < len; ++i) { arg = argv[i]; // literal args after -- if (literal) { args.push(arg); continue; } if ('--' == arg) { literal = true; continue; } // find matching Option option = this.optionFor(arg); // option is defined if (option) { // requires arg if (option.required) { arg = argv[++i]; if (null == arg) return this.optionMissingArgument(option); this.emit('option:' + option.name(), arg); // optional arg } else if (option.optional) { arg = argv[i+1]; if (null == arg || ('-' == arg[0] && '-' != arg)) { arg = null; } else { ++i; } this.emit('option:' + option.name(), arg); // bool } else { this.emit('option:' + option.name()); } continue; } // looks like an option if (arg.length > 1 && '-' == arg[0]) { unknownOptions.push(arg); // If the next argument looks like it might be // an argument for this option, we pass it on. // If it isn't, then it'll simply be ignored if (argv[i+1] && '-' != argv[i+1][0]) { unknownOptions.push(argv[++i]); } continue; } // arg args.push(arg); } return { args: args, unknown: unknownOptions }; }; /** * Return an object containing options as key-value pairs * * @return {Object} * @api public */ Command.prototype.opts = function() { var result = {} , len = this.options.length; for (var i = 0 ; i < len; i++) { var key = camelcase(this.options[i].name()); result[key] = key === 'version' ? this._version : this[key]; } return result; }; /** * Argument `name` is missing. * * @param {String} name * @api private */ Command.prototype.missingArgument = function(name) { console.error(); console.error(" error: missing required argument `%s'", name); console.error(); process.exit(1); }; /** * `Option` is missing an argument, but received `flag` or nothing. * * @param {String} option * @param {String} flag * @api private */ Command.prototype.optionMissingArgument = function(option, flag) { console.error(); if (flag) { console.error(" error: option `%s' argument missing, got `%s'", option.flags, flag); } else { console.error(" error: option `%s' argument missing", option.flags); } console.error(); process.exit(1); }; /** * Unknown option `flag`. * * @param {String} flag * @api private */ Command.prototype.unknownOption = function(flag) { if (this._allowUnknownOption) return; console.error(); console.error(" error: unknown option `%s'", flag); console.error(); process.exit(1); }; /** * Variadic argument with `name` is not the last argument as required. * * @param {String} name * @api private */ Command.prototype.variadicArgNotLast = function(name) { console.error(); console.error(" error: variadic arguments must be last `%s'", name); console.error(); process.exit(1); }; /** * Set the program version to `str`. * * This method auto-registers the "-V, --version" flag * which will print the version number when passed. * * @param {String} str * @param {String} [flags] * @return {Command} for chaining * @api public */ Command.prototype.version = function(str, flags) { if (0 == arguments.length) return this._version; this._version = str; flags = flags || '-V, --version'; this.option(flags, 'output the version number'); this.on('option:version', function() { process.stdout.write(str + '\n'); process.exit(0); }); return this; }; /** * Set the description to `str`. * * @param {String} str * @return {String|Command} * @api public */ Command.prototype.description = function(str) { if (0 === arguments.length) return this._description; this._description = str; return this; }; /** * Set an alias for the command * * @param {String} alias * @return {String|Command} * @api public */ Command.prototype.alias = function(alias) { var command = this; if(this.commands.length !== 0) { command = this.commands[this.commands.length - 1] } if (arguments.length === 0) return command._alias; command._alias = alias; return this; }; /** * Set / get the command usage `str`. * * @param {String} str * @return {String|Command} * @api public */ Command.prototype.usage = function(str) { var args = this._args.map(function(arg) { return humanReadableArgName(arg); }); var usage = '[options]' + (this.commands.length ? ' [command]' : '') + (this._args.length ? ' ' + args.join(' ') : ''); if (0 == arguments.length) return this._usage || usage; this._usage = str; return this; }; /** * Get or set the name of the command * * @param {String} str * @return {String|Command} * @api public */ Command.prototype.name = function(str) { if (0 === arguments.length) return this._name; this._name = str; return this; }; /** * Return the largest option length. * * @return {Number} * @api private */ Command.prototype.largestOptionLength = function() { return this.options.reduce(function(max, option) { return Math.max(max, option.flags.length); }, 0); }; /** * Return help for options. * * @return {String} * @api private */ Command.prototype.optionHelp = function() { var width = this.largestOptionLength(); // Append the help information return this.options.map(function(option) { return pad(option.flags, width) + ' ' + option.description; }).concat([pad('-h, --help', width) + ' ' + 'output usage information']) .join('\n'); }; /** * Return command help documentation. * * @return {String} * @api private */ Command.prototype.commandHelp = function() { if (!this.commands.length) return ''; var commands = this.commands.filter(function(cmd) { return !cmd._noHelp; }).map(function(cmd) { var args = cmd._args.map(function(arg) { return humanReadableArgName(arg); }).join(' '); return [ cmd._name + (cmd._alias ? '|' + cmd._alias : '') + (cmd.options.length ? ' [options]' : '') + ' ' + args , cmd._description ]; }); var width = commands.reduce(function(max, command) { return Math.max(max, command[0].length); }, 0); return [ '' , ' Commands:' , '' , commands.map(function(cmd) { var desc = cmd[1] ? ' ' + cmd[1] : ''; return pad(cmd[0], width) + desc; }).join('\n').replace(/^/gm, ' ') , '' ].join('\n'); }; /** * Return program help documentation. * * @return {String} * @api private */ Command.prototype.helpInformation = function() { var desc = []; if (this._description) { desc = [ ' ' + this._description , '' ]; } var cmdName = this._name; if (this._alias) { cmdName = cmdName + '|' + this._alias; } var usage = [ '' ,' Usage: ' + cmdName + ' ' + this.usage() , '' ]; var cmds = []; var commandHelp = this.commandHelp(); if (commandHelp) cmds = [commandHelp]; var options = [ '' , ' Options:' , '' , '' + this.optionHelp().replace(/^/gm, ' ') , '' ]; return usage .concat(desc) .concat(options) .concat(cmds) .join('\n'); }; /** * Output help information for this command * * @api public */ Command.prototype.outputHelp = function(cb) { if (!cb) { cb = function(passthru) { return passthru; } } process.stdout.write(cb(this.helpInformation())); this.emit('--help'); }; /** * Output help information and exit. * * @api public */ Command.prototype.help = function(cb) { this.outputHelp(cb); process.exit(); }; /** * Camel-case the given `flag` * * @param {String} flag * @return {String} * @api private */ function camelcase(flag) { return flag.split('-').reduce(function(str, word) { return str + word[0].toUpperCase() + word.slice(1); }); } /** * Pad `str` to `width`. * * @param {String} str * @param {Number} width * @return {String} * @api private */ function pad(str, width) { var len = Math.max(0, width - str.length); return str + Array(len + 1).join(' '); } /** * Output help information if necessary * * @param {Command} command to output help for * @param {Array} array of options to search for -h or --help * @api private */ function outputHelpIfNecessary(cmd, options) { options = options || []; for (var i = 0; i < options.length; i++) { if (options[i] == '--help' || options[i] == '-h') { cmd.outputHelp(); process.exit(0); } } } /** * Takes an argument an returns its human readable equivalent for help usage. * * @param {Object} arg * @return {String} * @api private */ function humanReadableArgName(arg) { var nameOutput = arg.name + (arg.variadic === true ? '...' : ''); return arg.required ? '<' + nameOutput + '>' : '[' + nameOutput + ']' } // for versions before node v0.8 when there weren't `fs.existsSync` function exists(file) { try { if (fs.statSync(file).isFile()) { return true; } } catch (e) { return false; } } (The MIT License) Copyright (c) 2011 TJ Holowaychuk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "commander", "version": "2.11.0", "description": "the complete solution for node.js command-line programs", "keywords": [ "commander", "command", "option", "parser" ], "author": "TJ Holowaychuk ", "license": "MIT", "repository": { "type": "git", "url": "https://github.com/tj/commander.js.git" }, "devDependencies": { "should": "^11.2.1", "sinon": "^2.3.5" }, "scripts": { "test": "make test" }, "main": "index", "files": [ "index.js" ], "dependencies": {} } # Commander.js [![Build Status](https://api.travis-ci.org/tj/commander.js.svg?branch=master)](http://travis-ci.org/tj/commander.js) [![NPM Version](http://img.shields.io/npm/v/commander.svg?style=flat)](https://www.npmjs.org/package/commander) [![NPM Downloads](https://img.shields.io/npm/dm/commander.svg?style=flat)](https://www.npmjs.org/package/commander) [![Join the chat at https://gitter.im/tj/commander.js](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/tj/commander.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/commander-rb/commander). [API documentation](http://tj.github.com/commander.js/) ## Installation $ npm install commander --save ## Option parsing Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options. ```js #!/usr/bin/env node /** * Module dependencies. */ var program = require('commander'); program .version('0.1.0') .option('-p, --peppers', 'Add peppers') .option('-P, --pineapple', 'Add pineapple') .option('-b, --bbq-sauce', 'Add bbq sauce') .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble') .parse(process.argv); console.log('you ordered a pizza with:'); if (program.peppers) console.log(' - peppers'); if (program.pineapple) console.log(' - pineapple'); if (program.bbqSauce) console.log(' - bbq'); console.log(' - %s cheese', program.cheese); ``` Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc. ## Coercion ```js function range(val) { return val.split('..').map(Number); } function list(val) { return val.split(','); } function collect(val, memo) { memo.push(val); return memo; } function increaseVerbosity(v, total) { return total + 1; } program .version('0.1.0') .usage('[options] ') .option('-i, --integer ', 'An integer argument', parseInt) .option('-f, --float ', 'A float argument', parseFloat) .option('-r, --range ..', 'A range', range) .option('-l, --list ', 'A list', list) .option('-o, --optional [value]', 'An optional value') .option('-c, --collect [value]', 'A repeatable value', collect, []) .option('-v, --verbose', 'A value that can be increased', increaseVerbosity, 0) .parse(process.argv); console.log(' int: %j', program.integer); console.log(' float: %j', program.float); console.log(' optional: %j', program.optional); program.range = program.range || []; console.log(' range: %j..%j', program.range[0], program.range[1]); console.log(' list: %j', program.list); console.log(' collect: %j', program.collect); console.log(' verbosity: %j', program.verbose); console.log(' args: %j', program.args); ``` ## Regular Expression ```js program .version('0.1.0') .option('-s --size ', 'Pizza size', /^(large|medium|small)$/i, 'medium') .option('-d --drink [drink]', 'Drink', /^(coke|pepsi|izze)$/i) .parse(process.argv); console.log(' size: %j', program.size); console.log(' drink: %j', program.drink); ``` ## Variadic arguments The last argument of a command can be variadic, and only the last argument. To make an argument variadic you have to append `...` to the argument name. Here is an example: ```js #!/usr/bin/env node /** * Module dependencies. */ var program = require('commander'); program .version('0.1.0') .command('rmdir [otherDirs...]') .action(function (dir, otherDirs) { console.log('rmdir %s', dir); if (otherDirs) { otherDirs.forEach(function (oDir) { console.log('rmdir %s', oDir); }); } }); program.parse(process.argv); ``` An `Array` is used for the value of a variadic argument. This applies to `program.args` as well as the argument passed to your action as demonstrated above. ## Specify the argument syntax ```js #!/usr/bin/env node var program = require('commander'); program .version('0.1.0') .arguments(' [env]') .action(function (cmd, env) { cmdValue = cmd; envValue = env; }); program.parse(process.argv); if (typeof cmdValue === 'undefined') { console.error('no command given!'); process.exit(1); } console.log('command:', cmdValue); console.log('environment:', envValue || "no environment given"); ``` Angled brackets (e.g. ``) indicate required input. Square brackets (e.g. `[env]`) indicate optional input. ## Git-style sub-commands ```js // file: ./examples/pm var program = require('commander'); program .version('0.1.0') .command('install [name]', 'install one or more packages') .command('search [query]', 'search with optional query') .command('list', 'list packages installed', {isDefault: true}) .parse(process.argv); ``` When `.command()` is invoked with a description argument, no `.action(callback)` should be called to handle sub-commands, otherwise there will be an error. This tells commander that you're going to use separate executables for sub-commands, much like `git(1)` and other popular tools. The commander will try to search the executables in the directory of the entry script (like `./examples/pm`) with the name `program-command`, like `pm-install`, `pm-search`. Options can be passed with the call to `.command()`. Specifying `true` for `opts.noHelp` will remove the option from the generated help output. Specifying `true` for `opts.isDefault` will run the subcommand if no other subcommand is specified. If the program is designed to be installed globally, make sure the executables have proper modes, like `755`. ### `--harmony` You can enable `--harmony` option in two ways: * Use `#! /usr/bin/env node --harmony` in the sub-commands scripts. Note some os version don’t support this pattern. * Use the `--harmony` option when call the command, like `node --harmony examples/pm publish`. The `--harmony` option will be preserved when spawning sub-command process. ## Automated --help The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free: ``` $ ./examples/pizza --help Usage: pizza [options] An application for pizzas ordering Options: -h, --help output usage information -V, --version output the version number -p, --peppers Add peppers -P, --pineapple Add pineapple -b, --bbq Add bbq sauce -c, --cheese Add the specified type of cheese [marble] -C, --no-cheese You do not want any cheese ``` ## Custom help You can display arbitrary `-h, --help` information by listening for "--help". Commander will automatically exit once you are done so that the remainder of your program does not execute causing undesired behaviours, for example in the following executable "stuff" will not output when `--help` is used. ```js #!/usr/bin/env node /** * Module dependencies. */ var program = require('commander'); program .version('0.1.0') .option('-f, --foo', 'enable some foo') .option('-b, --bar', 'enable some bar') .option('-B, --baz', 'enable some baz'); // must be before .parse() since // node's emit() is immediate program.on('--help', function(){ console.log(' Examples:'); console.log(''); console.log(' $ custom-help --help'); console.log(' $ custom-help -h'); console.log(''); }); program.parse(process.argv); console.log('stuff'); ``` Yields the following help output when `node script-name.js -h` or `node script-name.js --help` are run: ``` Usage: custom-help [options] Options: -h, --help output usage information -V, --version output the version number -f, --foo enable some foo -b, --bar enable some bar -B, --baz enable some baz Examples: $ custom-help --help $ custom-help -h ``` ## .outputHelp(cb) Output help information without exiting. Optional callback cb allows post-processing of help text before it is displayed. If you want to display help by default (e.g. if no command was provided), you can use something like: ```js var program = require('commander'); var colors = require('colors'); program .version('0.1.0') .command('getstream [url]', 'get stream URL') .parse(process.argv); if (!process.argv.slice(2).length) { program.outputHelp(make_red); } function make_red(txt) { return colors.red(txt); //display the help text in red on the console } ``` ## .help(cb) Output help information and exit immediately. Optional callback cb allows post-processing of help text before it is displayed. ## Examples ```js var program = require('commander'); program .version('0.1.0') .option('-C, --chdir ', 'change the working directory') .option('-c, --config ', 'set config path. defaults to ./deploy.conf') .option('-T, --no-tests', 'ignore test hook'); program .command('setup [env]') .description('run setup commands for all envs') .option("-s, --setup_mode [mode]", "Which setup mode to use") .action(function(env, options){ var mode = options.setup_mode || "normal"; env = env || 'all'; console.log('setup for %s env(s) with %s mode', env, mode); }); program .command('exec ') .alias('ex') .description('execute the given remote cmd') .option("-e, --exec_mode ", "Which exec mode to use") .action(function(cmd, options){ console.log('exec "%s" using %s mode', cmd, options.exec_mode); }).on('--help', function() { console.log(' Examples:'); console.log(); console.log(' $ deploy exec sequential'); console.log(' $ deploy exec async'); console.log(); }); program .command('*') .action(function(env){ console.log('deploying "%s"', env); }); program.parse(process.argv); ``` More Demos can be found in the [examples](https://github.com/tj/commander.js/tree/master/examples) directory. ## License MIT "use strict"; module.exports = function () { // https://mths.be/emoji return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g; }; Copyright Mathias Bynens Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "emoji-regex", "version": "8.0.0", "description": "A regular expression to match all Emoji-only symbols as per the Unicode Standard.", "homepage": "https://mths.be/emoji-regex", "main": "index.js", "types": "index.d.ts", "keywords": [ "unicode", "regex", "regexp", "regular expressions", "code points", "symbols", "characters", "emoji" ], "license": "MIT", "author": { "name": "Mathias Bynens", "url": "https://mathiasbynens.be/" }, "repository": { "type": "git", "url": "https://github.com/mathiasbynens/emoji-regex.git" }, "bugs": "https://github.com/mathiasbynens/emoji-regex/issues", "files": [ "LICENSE-MIT.txt", "index.js", "index.d.ts", "text.js", "es2015/index.js", "es2015/text.js" ], "scripts": { "build": "rm -rf -- es2015; babel src -d .; NODE_ENV=es2015 babel src -d ./es2015; node script/inject-sequences.js", "test": "mocha", "test:watch": "npm run test -- --watch" }, "devDependencies": { "@babel/cli": "^7.2.3", "@babel/core": "^7.3.4", "@babel/plugin-proposal-unicode-property-regex": "^7.2.0", "@babel/preset-env": "^7.3.4", "mocha": "^6.0.2", "regexgen": "^1.3.0", "unicode-12.0.0": "^0.7.9" } } "use strict"; module.exports = function () { // https://mths.be/emoji return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F?|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g; }; "use strict"; module.exports = () => { // https://mths.be/emoji return /\u{1F3F4}\u{E0067}\u{E0062}(?:\u{E0065}\u{E006E}\u{E0067}|\u{E0073}\u{E0063}\u{E0074}|\u{E0077}\u{E006C}\u{E0073})\u{E007F}|\u{1F468}(?:\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}\u{1F3FB}|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FE}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F468}|[\u{1F468}\u{1F469}]\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}]|[\u{1F468}\u{1F469}]\u200D[\u{1F466}\u{1F467}]|[\u2695\u2696\u2708]\uFE0F|[\u{1F466}\u{1F467}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|(?:\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708])\uFE0F|\u{1F3FB}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}]|[\u{1F3FB}-\u{1F3FF}])|(?:\u{1F9D1}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F469})\u{1F3FB}|\u{1F9D1}(?:\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]|\u200D\u{1F91D}\u200D\u{1F9D1})|(?:\u{1F9D1}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FF}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}-\u{1F3FE}]|(?:\u{1F9D1}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}\u{1F3FC}]|\u{1F469}(?:\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FD}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FB}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FC}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}\u{1F3FE}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F469}\u200D\u{1F469}\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|(?:\u{1F9D1}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}-\u{1F3FD}]|\u{1F469}\u200D\u{1F466}\u200D\u{1F466}|\u{1F469}\u200D\u{1F469}\u200D[\u{1F466}\u{1F467}]|(?:\u{1F441}\uFE0F\u200D\u{1F5E8}|\u{1F469}(?:\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708]|\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}]\uFE0F|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}])\u200D[\u2640\u2642]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D6}-\u{1F9DD}](?:[\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\u{1F3F4}\u200D\u2620)\uFE0F|\u{1F469}\u200D\u{1F467}\u200D[\u{1F466}\u{1F467}]|\u{1F3F3}\uFE0F\u200D\u{1F308}|\u{1F415}\u200D\u{1F9BA}|\u{1F469}\u200D\u{1F466}|\u{1F469}\u200D\u{1F467}|\u{1F1FD}\u{1F1F0}|\u{1F1F4}\u{1F1F2}|\u{1F1F6}\u{1F1E6}|[#\*0-9]\uFE0F\u20E3|\u{1F1E7}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EF}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|\u{1F1F9}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1ED}\u{1F1EF}-\u{1F1F4}\u{1F1F7}\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FF}]|\u{1F1EA}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1ED}\u{1F1F7}-\u{1F1FA}]|\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]|\u{1F1F7}[\u{1F1EA}\u{1F1F4}\u{1F1F8}\u{1F1FA}\u{1F1FC}]|\u{1F469}[\u{1F3FB}-\u{1F3FF}]|\u{1F1F2}[\u{1F1E6}\u{1F1E8}-\u{1F1ED}\u{1F1F0}-\u{1F1FF}]|\u{1F1E6}[\u{1F1E8}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F2}\u{1F1F4}\u{1F1F6}-\u{1F1FA}\u{1F1FC}\u{1F1FD}\u{1F1FF}]|\u{1F1F0}[\u{1F1EA}\u{1F1EC}-\u{1F1EE}\u{1F1F2}\u{1F1F3}\u{1F1F5}\u{1F1F7}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|\u{1F1ED}[\u{1F1F0}\u{1F1F2}\u{1F1F3}\u{1F1F7}\u{1F1F9}\u{1F1FA}]|\u{1F1E9}[\u{1F1EA}\u{1F1EC}\u{1F1EF}\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1FF}]|\u{1F1FE}[\u{1F1EA}\u{1F1F9}]|\u{1F1EC}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EE}\u{1F1F1}-\u{1F1F3}\u{1F1F5}-\u{1F1FA}\u{1F1FC}\u{1F1FE}]|\u{1F1F8}[\u{1F1E6}-\u{1F1EA}\u{1F1EC}-\u{1F1F4}\u{1F1F7}-\u{1F1F9}\u{1F1FB}\u{1F1FD}-\u{1F1FF}]|\u{1F1EB}[\u{1F1EE}-\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1F7}]|\u{1F1F5}[\u{1F1E6}\u{1F1EA}-\u{1F1ED}\u{1F1F0}-\u{1F1F3}\u{1F1F7}-\u{1F1F9}\u{1F1FC}\u{1F1FE}]|\u{1F1FB}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1EE}\u{1F1F3}\u{1F1FA}]|\u{1F1F3}[\u{1F1E6}\u{1F1E8}\u{1F1EA}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F4}\u{1F1F5}\u{1F1F7}\u{1F1FA}\u{1F1FF}]|\u{1F1E8}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1EE}\u{1F1F0}-\u{1F1F5}\u{1F1F7}\u{1F1FA}-\u{1F1FF}]|\u{1F1F1}[\u{1F1E6}-\u{1F1E8}\u{1F1EE}\u{1F1F0}\u{1F1F7}-\u{1F1FB}\u{1F1FE}]|\u{1F1FF}[\u{1F1E6}\u{1F1F2}\u{1F1FC}]|\u{1F1FC}[\u{1F1EB}\u{1F1F8}]|\u{1F1FA}[\u{1F1E6}\u{1F1EC}\u{1F1F2}\u{1F1F3}\u{1F1F8}\u{1F1FE}\u{1F1FF}]|\u{1F1EE}[\u{1F1E8}-\u{1F1EA}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}]|\u{1F1EF}[\u{1F1EA}\u{1F1F2}\u{1F1F4}\u{1F1F5}]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D6}-\u{1F9DD}][\u{1F3FB}-\u{1F3FF}]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]|[\u261D\u270A-\u270D\u{1F385}\u{1F3C2}\u{1F3C7}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}\u{1F467}\u{1F46B}-\u{1F46D}\u{1F470}\u{1F472}\u{1F474}-\u{1F476}\u{1F478}\u{1F47C}\u{1F483}\u{1F485}\u{1F4AA}\u{1F574}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F64C}\u{1F64F}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F930}-\u{1F936}\u{1F9B5}\u{1F9B6}\u{1F9BB}\u{1F9D2}-\u{1F9D5}][\u{1F3FB}-\u{1F3FF}]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F393}\u{1F3A0}-\u{1F3CA}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F4}\u{1F3F8}-\u{1F43E}\u{1F440}\u{1F442}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F57A}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5FB}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CC}\u{1F6D0}-\u{1F6D2}\u{1F6D5}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]|[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299\u{1F004}\u{1F0CF}\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F202}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F321}\u{1F324}-\u{1F393}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}-\u{1F3F0}\u{1F3F3}-\u{1F3F5}\u{1F3F7}-\u{1F4FD}\u{1F4FF}-\u{1F53D}\u{1F549}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F56F}\u{1F570}\u{1F573}-\u{1F57A}\u{1F587}\u{1F58A}-\u{1F58D}\u{1F590}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5A5}\u{1F5A8}\u{1F5B1}\u{1F5B2}\u{1F5BC}\u{1F5C2}-\u{1F5C4}\u{1F5D1}-\u{1F5D3}\u{1F5DC}-\u{1F5DE}\u{1F5E1}\u{1F5E3}\u{1F5E8}\u{1F5EF}\u{1F5F3}\u{1F5FA}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CB}-\u{1F6D2}\u{1F6D5}\u{1F6E0}-\u{1F6E5}\u{1F6E9}\u{1F6EB}\u{1F6EC}\u{1F6F0}\u{1F6F3}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]\uFE0F|[\u261D\u26F9\u270A-\u270D\u{1F385}\u{1F3C2}-\u{1F3C4}\u{1F3C7}\u{1F3CA}-\u{1F3CC}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}-\u{1F478}\u{1F47C}\u{1F481}-\u{1F483}\u{1F485}-\u{1F487}\u{1F48F}\u{1F491}\u{1F4AA}\u{1F574}\u{1F575}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F645}-\u{1F647}\u{1F64B}-\u{1F64F}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91F}\u{1F926}\u{1F930}-\u{1F939}\u{1F93C}-\u{1F93E}\u{1F9B5}\u{1F9B6}\u{1F9B8}\u{1F9B9}\u{1F9BB}\u{1F9CD}-\u{1F9CF}\u{1F9D1}-\u{1F9DD}]/gu; }; "use strict"; module.exports = () => { // https://mths.be/emoji return /\u{1F3F4}\u{E0067}\u{E0062}(?:\u{E0065}\u{E006E}\u{E0067}|\u{E0073}\u{E0063}\u{E0074}|\u{E0077}\u{E006C}\u{E0073})\u{E007F}|\u{1F468}(?:\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}\u{1F3FB}|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FE}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F468}|[\u{1F468}\u{1F469}]\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}]|[\u{1F468}\u{1F469}]\u200D[\u{1F466}\u{1F467}]|[\u2695\u2696\u2708]\uFE0F|[\u{1F466}\u{1F467}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|(?:\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708])\uFE0F|\u{1F3FB}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}]|[\u{1F3FB}-\u{1F3FF}])|(?:\u{1F9D1}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F469})\u{1F3FB}|\u{1F9D1}(?:\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]|\u200D\u{1F91D}\u200D\u{1F9D1})|(?:\u{1F9D1}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FF}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}-\u{1F3FE}]|(?:\u{1F9D1}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}\u{1F3FC}]|\u{1F469}(?:\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FD}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FB}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FC}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}\u{1F3FE}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F469}\u200D\u{1F469}\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|(?:\u{1F9D1}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}-\u{1F3FD}]|\u{1F469}\u200D\u{1F466}\u200D\u{1F466}|\u{1F469}\u200D\u{1F469}\u200D[\u{1F466}\u{1F467}]|(?:\u{1F441}\uFE0F\u200D\u{1F5E8}|\u{1F469}(?:\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708]|\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}]\uFE0F|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}])\u200D[\u2640\u2642]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D6}-\u{1F9DD}](?:[\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\u{1F3F4}\u200D\u2620)\uFE0F|\u{1F469}\u200D\u{1F467}\u200D[\u{1F466}\u{1F467}]|\u{1F3F3}\uFE0F\u200D\u{1F308}|\u{1F415}\u200D\u{1F9BA}|\u{1F469}\u200D\u{1F466}|\u{1F469}\u200D\u{1F467}|\u{1F1FD}\u{1F1F0}|\u{1F1F4}\u{1F1F2}|\u{1F1F6}\u{1F1E6}|[#\*0-9]\uFE0F\u20E3|\u{1F1E7}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EF}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|\u{1F1F9}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1ED}\u{1F1EF}-\u{1F1F4}\u{1F1F7}\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FF}]|\u{1F1EA}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1ED}\u{1F1F7}-\u{1F1FA}]|\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]|\u{1F1F7}[\u{1F1EA}\u{1F1F4}\u{1F1F8}\u{1F1FA}\u{1F1FC}]|\u{1F469}[\u{1F3FB}-\u{1F3FF}]|\u{1F1F2}[\u{1F1E6}\u{1F1E8}-\u{1F1ED}\u{1F1F0}-\u{1F1FF}]|\u{1F1E6}[\u{1F1E8}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F2}\u{1F1F4}\u{1F1F6}-\u{1F1FA}\u{1F1FC}\u{1F1FD}\u{1F1FF}]|\u{1F1F0}[\u{1F1EA}\u{1F1EC}-\u{1F1EE}\u{1F1F2}\u{1F1F3}\u{1F1F5}\u{1F1F7}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|\u{1F1ED}[\u{1F1F0}\u{1F1F2}\u{1F1F3}\u{1F1F7}\u{1F1F9}\u{1F1FA}]|\u{1F1E9}[\u{1F1EA}\u{1F1EC}\u{1F1EF}\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1FF}]|\u{1F1FE}[\u{1F1EA}\u{1F1F9}]|\u{1F1EC}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EE}\u{1F1F1}-\u{1F1F3}\u{1F1F5}-\u{1F1FA}\u{1F1FC}\u{1F1FE}]|\u{1F1F8}[\u{1F1E6}-\u{1F1EA}\u{1F1EC}-\u{1F1F4}\u{1F1F7}-\u{1F1F9}\u{1F1FB}\u{1F1FD}-\u{1F1FF}]|\u{1F1EB}[\u{1F1EE}-\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1F7}]|\u{1F1F5}[\u{1F1E6}\u{1F1EA}-\u{1F1ED}\u{1F1F0}-\u{1F1F3}\u{1F1F7}-\u{1F1F9}\u{1F1FC}\u{1F1FE}]|\u{1F1FB}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1EE}\u{1F1F3}\u{1F1FA}]|\u{1F1F3}[\u{1F1E6}\u{1F1E8}\u{1F1EA}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F4}\u{1F1F5}\u{1F1F7}\u{1F1FA}\u{1F1FF}]|\u{1F1E8}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1EE}\u{1F1F0}-\u{1F1F5}\u{1F1F7}\u{1F1FA}-\u{1F1FF}]|\u{1F1F1}[\u{1F1E6}-\u{1F1E8}\u{1F1EE}\u{1F1F0}\u{1F1F7}-\u{1F1FB}\u{1F1FE}]|\u{1F1FF}[\u{1F1E6}\u{1F1F2}\u{1F1FC}]|\u{1F1FC}[\u{1F1EB}\u{1F1F8}]|\u{1F1FA}[\u{1F1E6}\u{1F1EC}\u{1F1F2}\u{1F1F3}\u{1F1F8}\u{1F1FE}\u{1F1FF}]|\u{1F1EE}[\u{1F1E8}-\u{1F1EA}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}]|\u{1F1EF}[\u{1F1EA}\u{1F1F2}\u{1F1F4}\u{1F1F5}]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D6}-\u{1F9DD}][\u{1F3FB}-\u{1F3FF}]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]|[\u261D\u270A-\u270D\u{1F385}\u{1F3C2}\u{1F3C7}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}\u{1F467}\u{1F46B}-\u{1F46D}\u{1F470}\u{1F472}\u{1F474}-\u{1F476}\u{1F478}\u{1F47C}\u{1F483}\u{1F485}\u{1F4AA}\u{1F574}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F64C}\u{1F64F}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F930}-\u{1F936}\u{1F9B5}\u{1F9B6}\u{1F9BB}\u{1F9D2}-\u{1F9D5}][\u{1F3FB}-\u{1F3FF}]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F393}\u{1F3A0}-\u{1F3CA}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F4}\u{1F3F8}-\u{1F43E}\u{1F440}\u{1F442}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F57A}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5FB}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CC}\u{1F6D0}-\u{1F6D2}\u{1F6D5}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]|[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299\u{1F004}\u{1F0CF}\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F202}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F321}\u{1F324}-\u{1F393}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}-\u{1F3F0}\u{1F3F3}-\u{1F3F5}\u{1F3F7}-\u{1F4FD}\u{1F4FF}-\u{1F53D}\u{1F549}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F56F}\u{1F570}\u{1F573}-\u{1F57A}\u{1F587}\u{1F58A}-\u{1F58D}\u{1F590}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5A5}\u{1F5A8}\u{1F5B1}\u{1F5B2}\u{1F5BC}\u{1F5C2}-\u{1F5C4}\u{1F5D1}-\u{1F5D3}\u{1F5DC}-\u{1F5DE}\u{1F5E1}\u{1F5E3}\u{1F5E8}\u{1F5EF}\u{1F5F3}\u{1F5FA}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CB}-\u{1F6D2}\u{1F6D5}\u{1F6E0}-\u{1F6E5}\u{1F6E9}\u{1F6EB}\u{1F6EC}\u{1F6F0}\u{1F6F3}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]\uFE0F?|[\u261D\u26F9\u270A-\u270D\u{1F385}\u{1F3C2}-\u{1F3C4}\u{1F3C7}\u{1F3CA}-\u{1F3CC}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}-\u{1F478}\u{1F47C}\u{1F481}-\u{1F483}\u{1F485}-\u{1F487}\u{1F48F}\u{1F491}\u{1F4AA}\u{1F574}\u{1F575}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F645}-\u{1F647}\u{1F64B}-\u{1F64F}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91F}\u{1F926}\u{1F930}-\u{1F939}\u{1F93C}-\u{1F93E}\u{1F9B5}\u{1F9B6}\u{1F9B8}\u{1F9B9}\u{1F9BB}\u{1F9CD}-\u{1F9CF}\u{1F9D1}-\u{1F9DD}]/gu; }; var fs = require('fs'); var util = require('util'); var stream = require('stream'); var Readable = stream.Readable; var Writable = stream.Writable; var PassThrough = stream.PassThrough; var Pend = require('pend'); var EventEmitter = require('events').EventEmitter; exports.createFromBuffer = createFromBuffer; exports.createFromFd = createFromFd; exports.BufferSlicer = BufferSlicer; exports.FdSlicer = FdSlicer; util.inherits(FdSlicer, EventEmitter); function FdSlicer(fd, options) { options = options || {}; EventEmitter.call(this); this.fd = fd; this.pend = new Pend(); this.pend.max = 1; this.refCount = 0; this.autoClose = !!options.autoClose; } FdSlicer.prototype.read = function(buffer, offset, length, position, callback) { var self = this; self.pend.go(function(cb) { fs.read(self.fd, buffer, offset, length, position, function(err, bytesRead, buffer) { cb(); callback(err, bytesRead, buffer); }); }); }; FdSlicer.prototype.write = function(buffer, offset, length, position, callback) { var self = this; self.pend.go(function(cb) { fs.write(self.fd, buffer, offset, length, position, function(err, written, buffer) { cb(); callback(err, written, buffer); }); }); }; FdSlicer.prototype.createReadStream = function(options) { return new ReadStream(this, options); }; FdSlicer.prototype.createWriteStream = function(options) { return new WriteStream(this, options); }; FdSlicer.prototype.ref = function() { this.refCount += 1; }; FdSlicer.prototype.unref = function() { var self = this; self.refCount -= 1; if (self.refCount > 0) return; if (self.refCount < 0) throw new Error("invalid unref"); if (self.autoClose) { fs.close(self.fd, onCloseDone); } function onCloseDone(err) { if (err) { self.emit('error', err); } else { self.emit('close'); } } }; util.inherits(ReadStream, Readable); function ReadStream(context, options) { options = options || {}; Readable.call(this, options); this.context = context; this.context.ref(); this.start = options.start || 0; this.endOffset = options.end; this.pos = this.start; this.destroyed = false; } ReadStream.prototype._read = function(n) { var self = this; if (self.destroyed) return; var toRead = Math.min(self._readableState.highWaterMark, n); if (self.endOffset != null) { toRead = Math.min(toRead, self.endOffset - self.pos); } if (toRead <= 0) { self.destroyed = true; self.push(null); self.context.unref(); return; } self.context.pend.go(function(cb) { if (self.destroyed) return cb(); var buffer = new Buffer(toRead); fs.read(self.context.fd, buffer, 0, toRead, self.pos, function(err, bytesRead) { if (err) { self.destroy(err); } else if (bytesRead === 0) { self.destroyed = true; self.push(null); self.context.unref(); } else { self.pos += bytesRead; self.push(buffer.slice(0, bytesRead)); } cb(); }); }); }; ReadStream.prototype.destroy = function(err) { if (this.destroyed) return; err = err || new Error("stream destroyed"); this.destroyed = true; this.emit('error', err); this.context.unref(); }; util.inherits(WriteStream, Writable); function WriteStream(context, options) { options = options || {}; Writable.call(this, options); this.context = context; this.context.ref(); this.start = options.start || 0; this.endOffset = (options.end == null) ? Infinity : +options.end; this.bytesWritten = 0; this.pos = this.start; this.destroyed = false; this.on('finish', this.destroy.bind(this)); } WriteStream.prototype._write = function(buffer, encoding, callback) { var self = this; if (self.destroyed) return; if (self.pos + buffer.length > self.endOffset) { var err = new Error("maximum file length exceeded"); err.code = 'ETOOBIG'; self.destroy(); callback(err); return; } self.context.pend.go(function(cb) { if (self.destroyed) return cb(); fs.write(self.context.fd, buffer, 0, buffer.length, self.pos, function(err, bytes) { if (err) { self.destroy(); cb(); callback(err); } else { self.bytesWritten += bytes; self.pos += bytes; self.emit('progress'); cb(); callback(); } }); }); }; WriteStream.prototype.destroy = function() { if (this.destroyed) return; this.destroyed = true; this.context.unref(); }; util.inherits(BufferSlicer, EventEmitter); function BufferSlicer(buffer, options) { EventEmitter.call(this); options = options || {}; this.refCount = 0; this.buffer = buffer; this.maxChunkSize = options.maxChunkSize || Number.MAX_SAFE_INTEGER; } BufferSlicer.prototype.read = function(buffer, offset, length, position, callback) { var end = position + length; var delta = end - this.buffer.length; var written = (delta > 0) ? delta : length; this.buffer.copy(buffer, offset, position, end); setImmediate(function() { callback(null, written); }); }; BufferSlicer.prototype.write = function(buffer, offset, length, position, callback) { buffer.copy(this.buffer, position, offset, offset + length); setImmediate(function() { callback(null, length, buffer); }); }; BufferSlicer.prototype.createReadStream = function(options) { options = options || {}; var readStream = new PassThrough(options); readStream.destroyed = false; readStream.start = options.start || 0; readStream.endOffset = options.end; // by the time this function returns, we'll be done. readStream.pos = readStream.endOffset || this.buffer.length; // respect the maxChunkSize option to slice up the chunk into smaller pieces. var entireSlice = this.buffer.slice(readStream.start, readStream.pos); var offset = 0; while (true) { var nextOffset = offset + this.maxChunkSize; if (nextOffset >= entireSlice.length) { // last chunk if (offset < entireSlice.length) { readStream.write(entireSlice.slice(offset, entireSlice.length)); } break; } readStream.write(entireSlice.slice(offset, nextOffset)); offset = nextOffset; } readStream.end(); readStream.destroy = function() { readStream.destroyed = true; }; return readStream; }; BufferSlicer.prototype.createWriteStream = function(options) { var bufferSlicer = this; options = options || {}; var writeStream = new Writable(options); writeStream.start = options.start || 0; writeStream.endOffset = (options.end == null) ? this.buffer.length : +options.end; writeStream.bytesWritten = 0; writeStream.pos = writeStream.start; writeStream.destroyed = false; writeStream._write = function(buffer, encoding, callback) { if (writeStream.destroyed) return; var end = writeStream.pos + buffer.length; if (end > writeStream.endOffset) { var err = new Error("maximum file length exceeded"); err.code = 'ETOOBIG'; writeStream.destroyed = true; callback(err); return; } buffer.copy(bufferSlicer.buffer, writeStream.pos, 0, buffer.length); writeStream.bytesWritten += buffer.length; writeStream.pos = end; writeStream.emit('progress'); callback(); }; writeStream.destroy = function() { writeStream.destroyed = true; }; return writeStream; }; BufferSlicer.prototype.ref = function() { this.refCount += 1; }; BufferSlicer.prototype.unref = function() { this.refCount -= 1; if (this.refCount < 0) { throw new Error("invalid unref"); } }; function createFromBuffer(buffer, options) { return new BufferSlicer(buffer, options); } function createFromFd(fd, options) { return new FdSlicer(fd, options); } Copyright (c) 2014 Andrew Kelley Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "fd-slicer", "version": "1.1.0", "description": "safely create multiple ReadStream or WriteStream objects from the same file descriptor", "main": "index.js", "scripts": { "test": "mocha --reporter spec --check-leaks", "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/test.js", "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --timeout 10000 --reporter spec --check-leaks test/test.js" }, "author": "Andrew Kelley ", "license": "MIT", "devDependencies": { "istanbul": "~0.3.3", "mocha": "~2.0.1", "stream-equal": "~0.1.5", "streamsink": "~1.2.0" }, "dependencies": { "pend": "~1.2.0" }, "directories": { "test": "test" }, "repository": { "type": "git", "url": "git://github.com/andrewrk/node-fd-slicer.git" }, "bugs": { "url": "https://github.com/andrewrk/node-fd-slicer/issues" }, "keywords": [ "createReadStream", "createWriteStream" ] } /** * Module dependencies. */ var sep = require('path').sep || '/'; /** * Module exports. */ module.exports = fileUriToPath; /** * File URI to Path function. * * @param {String} uri * @return {String} path * @api public */ function fileUriToPath (uri) { if ('string' != typeof uri || uri.length <= 7 || 'file://' != uri.substring(0, 7)) { throw new TypeError('must pass in a file:// URI to convert to a file path'); } var rest = decodeURI(uri.substring(7)); var firstSlash = rest.indexOf('/'); var host = rest.substring(0, firstSlash); var path = rest.substring(firstSlash + 1); // 2. Scheme Definition // As a special case, can be the string "localhost" or the empty // string; this is interpreted as "the machine from which the URL is // being interpreted". if ('localhost' == host) host = ''; if (host) { host = sep + sep + host; } // 3.2 Drives, drive letters, mount points, file system root // Drive letters are mapped into the top of a file URI in various ways, // depending on the implementation; some applications substitute // vertical bar ("|") for the colon after the drive letter, yielding // "file:///c|/tmp/test.txt". In some cases, the colon is left // unchanged, as in "file:///c:/tmp/test.txt". In other cases, the // colon is simply omitted, as in "file:///c/tmp/test.txt". path = path.replace(/^(.+)\|/, '$1:'); // for Windows, we need to invert the path separators from what a URI uses if (sep == '\\') { path = path.replace(/\//g, '\\'); } if (/^.+\:/.test(path)) { // has Windows drive at beginning of path } else { // unix path… path = sep + path; } return host + path; } Copyright (c) 2014 Nathan Rajlich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "file-uri-to-path", "version": "1.0.0", "description": "Convert a file: URI to a file path", "main": "index.js", "types": "index.d.ts", "directories": { "test": "test" }, "scripts": { "test": "mocha --reporter spec" }, "repository": { "type": "git", "url": "git://github.com/TooTallNate/file-uri-to-path.git" }, "keywords": [ "file", "uri", "convert", "path" ], "author": "Nathan Rajlich (http://n8.io/)", "license": "MIT", "bugs": { "url": "https://github.com/TooTallNate/file-uri-to-path/issues" }, "homepage": "https://github.com/TooTallNate/file-uri-to-path", "devDependencies": { "mocha": "3" } } try { var util = require('util'); /* istanbul ignore next */ if (typeof util.inherits !== 'function') throw ''; module.exports = util.inherits; } catch (e) { /* istanbul ignore next */ module.exports = require('./inherits_browser.js'); } if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { if (superCtor) { ctor.super_ = superCtor ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }) } }; } else { // old school shim for old browsers module.exports = function inherits(ctor, superCtor) { if (superCtor) { ctor.super_ = superCtor var TempCtor = function () {} TempCtor.prototype = superCtor.prototype ctor.prototype = new TempCtor() ctor.prototype.constructor = ctor } } } The ISC License Copyright (c) Isaac Z. Schlueter Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "inherits", "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", "version": "2.0.4", "keywords": [ "inheritance", "class", "klass", "oop", "object-oriented", "inherits", "browser", "browserify" ], "main": "./inherits.js", "browser": "./inherits_browser.js", "repository": "git://github.com/isaacs/inherits", "license": "ISC", "scripts": { "test": "tap" }, "devDependencies": { "tap": "^14.2.4" }, "files": [ "inherits.js", "inherits_browser.js" ] } 'use strict'; /* eslint-disable yoda */ module.exports = x => { if (Number.isNaN(x)) { return false; } // code points are derived from: // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt if ( x >= 0x1100 && ( x <= 0x115f || // Hangul Jamo x === 0x2329 || // LEFT-POINTING ANGLE BRACKET x === 0x232a || // RIGHT-POINTING ANGLE BRACKET // CJK Radicals Supplement .. Enclosed CJK Letters and Months (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) || // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A (0x3250 <= x && x <= 0x4dbf) || // CJK Unified Ideographs .. Yi Radicals (0x4e00 <= x && x <= 0xa4c6) || // Hangul Jamo Extended-A (0xa960 <= x && x <= 0xa97c) || // Hangul Syllables (0xac00 <= x && x <= 0xd7a3) || // CJK Compatibility Ideographs (0xf900 <= x && x <= 0xfaff) || // Vertical Forms (0xfe10 <= x && x <= 0xfe19) || // CJK Compatibility Forms .. Small Form Variants (0xfe30 <= x && x <= 0xfe6b) || // Halfwidth and Fullwidth Forms (0xff01 <= x && x <= 0xff60) || (0xffe0 <= x && x <= 0xffe6) || // Kana Supplement (0x1b000 <= x && x <= 0x1b001) || // Enclosed Ideographic Supplement (0x1f200 <= x && x <= 0x1f251) || // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane (0x20000 <= x && x <= 0x3fffd) ) ) { return true; } return false; }; The MIT License (MIT) Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "is-fullwidth-code-point", "version": "2.0.0", "description": "Check if the character represented by a given Unicode code point is fullwidth", "license": "MIT", "repository": "sindresorhus/is-fullwidth-code-point", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=4" }, "scripts": { "test": "xo && ava" }, "files": [ "index.js" ], "keywords": [ "fullwidth", "full-width", "full", "width", "unicode", "character", "char", "string", "str", "codepoint", "code", "point", "is", "detect", "check" ], "devDependencies": { "ava": "*", "xo": "*" }, "xo": { "esnext": true } } #!/usr/bin/env node var proc = require('child_process') var os = require('os') var path = require('path') if (!buildFromSource()) { proc.exec('node-gyp-build-test', function (err, stdout, stderr) { if (err) { if (verbose()) console.error(stderr) preinstall() } }) } else { preinstall() } function build () { var args = [os.platform() === 'win32' ? 'node-gyp.cmd' : 'node-gyp', 'rebuild'] try { args = [ process.execPath, path.join(require.resolve('node-gyp/package.json'), '..', require('node-gyp/package.json').bin['node-gyp']), 'rebuild' ] } catch (_) {} proc.spawn(args[0], args.slice(1), { stdio: 'inherit' }).on('exit', function (code) { if (code || !process.argv[3]) process.exit(code) exec(process.argv[3]).on('exit', function (code) { process.exit(code) }) }) } function preinstall () { if (!process.argv[2]) return build() exec(process.argv[2]).on('exit', function (code) { if (code) process.exit(code) build() }) } function exec (cmd) { if (process.platform !== 'win32') { var shell = os.platform() === 'android' ? 'sh' : '/bin/sh' return proc.spawn(shell, ['-c', '--', cmd], { stdio: 'inherit' }) } return proc.spawn(process.env.comspec || 'cmd.exe', ['/s', '/c', '"' + cmd + '"'], { windowsVerbatimArguments: true, stdio: 'inherit' }) } function buildFromSource () { return hasFlag('--build-from-source') || process.env.npm_config_build_from_source === 'true' } function verbose () { return hasFlag('--verbose') || process.env.npm_config_loglevel === 'verbose' } // TODO (next major): remove in favor of env.npm_config_* which works since npm // 0.1.8 while npm_config_argv will stop working in npm 7. See npm/rfcs#90 function hasFlag (flag) { if (!process.env.npm_config_argv) return false try { return JSON.parse(process.env.npm_config_argv).original.indexOf(flag) !== -1 } catch (_) { return false } } #!/usr/bin/env node process.env.NODE_ENV = 'test' var path = require('path') var test = null try { var pkg = require(path.join(process.cwd(), 'package.json')) if (pkg.name && process.env[pkg.name.toUpperCase().replace(/-/g, '_')]) { process.exit(0) } test = pkg.prebuild.test } catch (err) { // do nothing } if (test) require(path.join(process.cwd(), test)) else require('./')() var fs = require('fs') var path = require('path') var os = require('os') // Workaround to fix webpack's build warnings: 'the request of a dependency is an expression' var runtimeRequire = typeof __webpack_require__ === 'function' ? __non_webpack_require__ : require // eslint-disable-line var vars = (process.config && process.config.variables) || {} var prebuildsOnly = !!process.env.PREBUILDS_ONLY var abi = process.versions.modules // TODO: support old node where this is undef var runtime = isElectron() ? 'electron' : 'node' var arch = os.arch() var platform = os.platform() var libc = process.env.LIBC || (isAlpine(platform) ? 'musl' : 'glibc') var armv = process.env.ARM_VERSION || (arch === 'arm64' ? '8' : vars.arm_version) || '' var uv = (process.versions.uv || '').split('.')[0] module.exports = load function load (dir) { return runtimeRequire(load.path(dir)) } load.path = function (dir) { dir = path.resolve(dir || '.') try { var name = runtimeRequire(path.join(dir, 'package.json')).name.toUpperCase().replace(/-/g, '_') if (process.env[name + '_PREBUILD']) dir = process.env[name + '_PREBUILD'] } catch (err) {} if (!prebuildsOnly) { var release = getFirst(path.join(dir, 'build/Release'), matchBuild) if (release) return release var debug = getFirst(path.join(dir, 'build/Debug'), matchBuild) if (debug) return debug } var prebuild = resolve(dir) if (prebuild) return prebuild var nearby = resolve(path.dirname(process.execPath)) if (nearby) return nearby var target = [ 'platform=' + platform, 'arch=' + arch, 'runtime=' + runtime, 'abi=' + abi, 'uv=' + uv, armv ? 'armv=' + armv : '', 'libc=' + libc, 'node=' + process.versions.node, process.versions.electron ? 'electron=' + process.versions.electron : '', typeof __webpack_require__ === 'function' ? 'webpack=true' : '' // eslint-disable-line ].filter(Boolean).join(' ') throw new Error('No native build was found for ' + target + '\n loaded from: ' + dir + '\n') function resolve (dir) { // Find matching "prebuilds/-" directory var tuples = readdirSync(path.join(dir, 'prebuilds')).map(parseTuple) var tuple = tuples.filter(matchTuple(platform, arch)).sort(compareTuples)[0] if (!tuple) return // Find most specific flavor first var prebuilds = path.join(dir, 'prebuilds', tuple.name) var parsed = readdirSync(prebuilds).map(parseTags) var candidates = parsed.filter(matchTags(runtime, abi)) var winner = candidates.sort(compareTags(runtime))[0] if (winner) return path.join(prebuilds, winner.file) } } function readdirSync (dir) { try { return fs.readdirSync(dir) } catch (err) { return [] } } function getFirst (dir, filter) { var files = readdirSync(dir).filter(filter) return files[0] && path.join(dir, files[0]) } function matchBuild (name) { return /\.node$/.test(name) } function parseTuple (name) { // Example: darwin-x64+arm64 var arr = name.split('-') if (arr.length !== 2) return var platform = arr[0] var architectures = arr[1].split('+') if (!platform) return if (!architectures.length) return if (!architectures.every(Boolean)) return return { name, platform, architectures } } function matchTuple (platform, arch) { return function (tuple) { if (tuple == null) return false if (tuple.platform !== platform) return false return tuple.architectures.includes(arch) } } function compareTuples (a, b) { // Prefer single-arch prebuilds over multi-arch return a.architectures.length - b.architectures.length } function parseTags (file) { var arr = file.split('.') var extension = arr.pop() var tags = { file: file, specificity: 0 } if (extension !== 'node') return for (var i = 0; i < arr.length; i++) { var tag = arr[i] if (tag === 'node' || tag === 'electron' || tag === 'node-webkit') { tags.runtime = tag } else if (tag === 'napi') { tags.napi = true } else if (tag.slice(0, 3) === 'abi') { tags.abi = tag.slice(3) } else if (tag.slice(0, 2) === 'uv') { tags.uv = tag.slice(2) } else if (tag.slice(0, 4) === 'armv') { tags.armv = tag.slice(4) } else if (tag === 'glibc' || tag === 'musl') { tags.libc = tag } else { continue } tags.specificity++ } return tags } function matchTags (runtime, abi) { return function (tags) { if (tags == null) return false if (tags.runtime !== runtime && !runtimeAgnostic(tags)) return false if (tags.abi !== abi && !tags.napi) return false if (tags.uv && tags.uv !== uv) return false if (tags.armv && tags.armv !== armv) return false if (tags.libc && tags.libc !== libc) return false return true } } function runtimeAgnostic (tags) { return tags.runtime === 'node' && tags.napi } function compareTags (runtime) { // Precedence: non-agnostic runtime, abi over napi, then by specificity. return function (a, b) { if (a.runtime !== b.runtime) { return a.runtime === runtime ? -1 : 1 } else if (a.abi !== b.abi) { return a.abi ? -1 : 1 } else if (a.specificity !== b.specificity) { return a.specificity > b.specificity ? -1 : 1 } else { return 0 } } } function isElectron () { if (process.versions && process.versions.electron) return true if (process.env.ELECTRON_RUN_AS_NODE) return true return typeof window !== 'undefined' && window.process && window.process.type === 'renderer' } function isAlpine (platform) { return platform === 'linux' && fs.existsSync('/etc/alpine-release') } // Exposed for unit tests // TODO: move to lib load.parseTags = parseTags load.matchTags = matchTags load.compareTags = compareTags load.parseTuple = parseTuple load.matchTuple = matchTuple load.compareTuples = compareTuples The MIT License (MIT) Copyright (c) 2017 Mathias Buus Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #!/usr/bin/env node /* I am only useful as an install script to make node-gyp not compile for purely optional native deps */ process.exit(0) { "name": "node-gyp-build", "version": "4.3.0", "description": "Build tool and bindings loader for node-gyp that supports prebuilds", "main": "index.js", "devDependencies": { "array-shuffle": "^1.0.1", "standard": "^14.0.0", "tape": "^5.0.0" }, "scripts": { "test": "standard && node test" }, "bin": { "node-gyp-build": "./bin.js", "node-gyp-build-optional": "./optional.js", "node-gyp-build-test": "./build-test.js" }, "repository": { "type": "git", "url": "https://github.com/prebuild/node-gyp-build.git" }, "author": "Mathias Buus (@mafintosh)", "license": "MIT", "bugs": { "url": "https://github.com/prebuild/node-gyp-build/issues" }, "homepage": "https://github.com/prebuild/node-gyp-build" } { 'variables' : { 'node_engine_include_dir%': 'deps/v8/include', 'node_host_binary%': 'node', 'node_with_ltcg%': 'true', }, 'target_defaults': { 'type': 'loadable_module', 'win_delay_load_hook': 'true', 'product_prefix': '', 'conditions': [ [ 'node_engine=="chakracore"', { 'variables': { 'node_engine_include_dir%': 'deps/chakrashim/include' }, }] ], 'include_dirs': [ '<(node_root_dir)/include/node', '<(node_root_dir)/src', '<(node_root_dir)/deps/openssl/config', '<(node_root_dir)/deps/openssl/openssl/include', '<(node_root_dir)/deps/uv/include', '<(node_root_dir)/deps/zlib', '<(node_root_dir)/<(node_engine_include_dir)' ], 'defines!': [ 'BUILDING_UV_SHARED=1', # Inherited from common.gypi. 'BUILDING_V8_SHARED=1', # Inherited from common.gypi. ], 'defines': [ 'NODE_GYP_MODULE_NAME=>(_target_name)', 'USING_UV_SHARED=1', 'USING_V8_SHARED=1', # Warn when using deprecated V8 APIs. 'V8_DEPRECATION_WARNINGS=1' ], 'target_conditions': [ ['_type=="loadable_module"', { 'product_extension': 'node', 'defines': [ 'BUILDING_NODE_EXTENSION' ], 'xcode_settings': { 'OTHER_LDFLAGS': [ '-undefined dynamic_lookup' ], }, }], ['_type=="static_library"', { # set to `1` to *disable* the -T thin archive 'ld' flag. # older linkers don't support this flag. 'standalone_static_library': '<(standalone_static_library)' }], ['_type!="executable"', { 'conditions': [ [ 'OS=="android"', { 'cflags!': [ '-fPIE' ], }] ] }], ['_win_delay_load_hook=="true"', { # If the addon specifies `'win_delay_load_hook': 'true'` in its # binding.gyp, link a delay-load hook into the DLL. This hook ensures # that the addon will work regardless of whether the node/iojs binary # is named node.exe, iojs.exe, or something else. 'conditions': [ [ 'OS=="win"', { 'defines': [ 'HOST_BINARY=\"<(node_host_binary)<(EXECUTABLE_SUFFIX)\"', ], 'sources': [ '<(node_gyp_dir)/src/win_delay_load_hook.cc', ], 'msvs_settings': { 'VCLinkerTool': { 'DelayLoadDLLs': [ '<(node_host_binary)<(EXECUTABLE_SUFFIX)' ], # Don't print a linker warning when no imports from either .exe # are used. 'AdditionalOptions': [ '/ignore:4199' ], }, }, }], ], }], ], 'conditions': [ [ 'OS=="mac"', { 'defines': [ '_DARWIN_USE_64_BIT_INODE=1' ], 'xcode_settings': { 'DYLIB_INSTALL_NAME_BASE': '@rpath' }, }], [ 'OS=="aix"', { 'ldflags': [ '-Wl,-bimport:<(node_exp_file)' ], }], [ 'OS=="zos"', { 'cflags': [ '-q64', '-Wc,DLL', '-qlonglong', '-qenum=int', '-qxclang=-fexec-charset=ISO8859-1' ], 'defines': [ '_ALL_SOURCE=1', 'MAP_FAILED=-1', '_UNIX03_SOURCE=1' ], 'ldflags': [ '-q64', '<(node_exp_file)' ], }], [ 'OS=="win"', { 'conditions': [ ['node_engine=="chakracore"', { 'library_dirs': [ '<(node_root_dir)/$(ConfigurationName)' ], 'libraries': [ '<@(node_engine_libs)' ], }], ['node_with_ltcg=="true"', { 'msvs_settings': { 'VCCLCompilerTool': { 'WholeProgramOptimization': 'true' # /GL, whole program optimization, needed for LTCG }, 'VCLibrarianTool': { 'AdditionalOptions': [ '/LTCG:INCREMENTAL', # incremental link-time code generation ] }, 'VCLinkerTool': { 'OptimizeReferences': 2, # /OPT:REF 'EnableCOMDATFolding': 2, # /OPT:ICF 'LinkIncremental': 1, # disable incremental linking 'AdditionalOptions': [ '/LTCG:INCREMENTAL', # incremental link-time code generation ] } } }] ], 'libraries': [ '-lkernel32.lib', '-luser32.lib', '-lgdi32.lib', '-lwinspool.lib', '-lcomdlg32.lib', '-ladvapi32.lib', '-lshell32.lib', '-lole32.lib', '-loleaut32.lib', '-luuid.lib', '-lodbc32.lib', '-lDelayImp.lib', '-l"<(node_lib_file)"' ], 'msvs_disabled_warnings': [ # warning C4251: 'node::ObjectWrap::handle_' : class 'v8::Persistent' # needs to have dll-interface to be used by # clients of class 'node::ObjectWrap' 4251 ], }, { # OS!="win" 'defines': [ '_LARGEFILE_SOURCE', '_FILE_OFFSET_BITS=64' ], }], [ 'OS in "freebsd openbsd netbsd solaris android" or \ (OS=="linux" and target_arch!="ia32")', { 'cflags': [ '-fPIC' ], }], ] } } (The MIT License) Copyright (c) 2012 Nathan Rajlich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # Installation notes for macOS Catalina (v10.15) _This document specifically refers to upgrades from previous versions of macOS to Catalina (10.15). It should be removed from the source repository when Catalina ceases to be the latest macOS version or when future Catalina versions no longer raise these issues._ **Both upgrading to macOS Catalina and running a Software Update in Catalina may cause normal `node-gyp` installations to fail. This might manifest as the following error during `npm install`:** ```console gyp: No Xcode or CLT version detected! ``` ## node-gyp v7 The newest release of `node-gyp` should solve this problem. If you are using `node-gyp` directly then you should be able to install v7 and use it as-is. If you need to use `node-gyp` from within `npm` (e.g. through `npm install`), you will have to install `node-gyp` (either globally with `-g` or to a predictable location) and tell `npm` where the new version is. Either use: * `npm config set node_gyp `; or * run `npm` with an environment variable prefix: `npm_config_node_gyp= npm install` Where "path to node-gyp" is to the `node-gyp` executable which may be a symlink in your global bin directory (e.g. `/usr/local/bin/node-gyp`), or a path to the `node-gyp` installation directory and the `bin/node-gyp.js` file within it (e.g. `/usr/local/lib/node_modules/node-gyp/bin/node-gyp.js`). **If you use `npm config set` to change your global `node_gyp` you are responsible for keeping it up to date and can't rely on `npm` to give you a newer version when available.** Use `npm config delete node_gyp` to unset this configuration option. ## Fixing Catalina for older versions of `node-gyp` ### Is my Mac running macOS Catalina? Let's first make sure that your Mac is running Catalina: ``` % sw_vers ProductName: Mac OS X ProductVersion: 10.15 BuildVersion: 19A602 ``` If `ProductVersion` is less then `10.15` then this document is not for you. Normal install docs for `node-gyp` on macOS can be found at https://github.com/nodejs/node-gyp#on-macos ### The acid test To see if `Xcode Command Line Tools` is installed in a way that will work with `node-gyp`, run: ``` curl -sL https://github.com/nodejs/node-gyp/raw/master/macOS_Catalina_acid_test.sh | bash ``` If test succeeded, _you are done_! You should be ready to [install](https://github.com/nodejs/node-gyp#installation) `node-gyp`. If test failed, there is a problem with your Xcode Command Line Tools installation. [Continue to Solutions](#Solutions). ### Solutions There are three ways to install the Xcode libraries `node-gyp` needs on macOS. People running Catalina have had success with some but not others in a way that has been unpredictable. 1. With the full Xcode (~7.6 GB download) from the `App Store` app. 2. With the _much_ smaller Xcode Command Line Tools via `xcode-select --install` 3. With the _much_ smaller Xcode Command Line Tools via manual download. **For people running the latest version of Catalina (10.15.2 at the time of this writing), this has worked when the other two solutions haven't.** ### Installing `node-gyp` using the full Xcode 1. `xcodebuild -version` should show `Xcode 11.1` or later. * If not, then install/upgrade Xcode from the App Store app. 2. Open the Xcode app and... * Under __Preferences > Locations__ select the tools if their location is empty. * Allow Xcode app to do an essential install of the most recent compiler tools. 3. Once all installations are _complete_, quit out of Xcode. 4. `sudo xcodebuild -license accept` # If you agree with the licensing terms. 5. `softwareupdate -l` # No listing is a good sign. * If Xcode or Tools upgrades are listed, use "Software Upgrade" to install them. 6. `xcode-select -version` # Should return `xcode-select version 2370` or later. 7. `xcode-select -print-path` # Should return `/Applications/Xcode.app/Contents/Developer` 8. Try the [_acid test_ steps above](#The-acid-test) to see if your Mac is ready. 9. If the _acid test_ does _not_ pass then... 10. `sudo xcode-select --reset` # Enter root password. No output is normal. 11. Repeat step 7 above. Is the path different this time? Repeat the _acid test_. ### Installing `node-gyp` using the Xcode Command Line Tools via `xcode-select --install` 1. If the _acid test_ has not succeeded, then try `xcode-select --install` 2. If the installation command returns `xcode-select: error: command line tools are already installed, use "Software Update" to install updates`, continue to [remove and reinstall](#i-did-all-that-and-the-acid-test-still-does-not-pass--) 3. Wait until the install process is _complete_. 4. `softwareupdate -l` # No listing is a good sign. * If Xcode or Tools upgrades are listed, use "Software Update" to install them. 5. `xcode-select -version` # Should return `xcode-select version 2370` or later. 6. `xcode-select -print-path` # Should return `/Library/Developer/CommandLineTools` 7. Try the [_acid test_ steps above](#The-acid-test) to see if your Mac is ready. 8. If the _acid test_ does _not_ pass then... 9. `sudo xcode-select --reset` # Enter root password. No output is normal. 10. Repeat step 5 above. Is the path different this time? Repeat the _acid test_. ### Installing `node-gyp` using the Xcode Command Line Tools via manual download 1. Download the appropriate version of the "Command Line Tools for Xcode" for your version of Catalina from . As of MacOS 10.15.5, that's [Command_Line_Tools_for_Xcode_11.5.dmg](https://download.developer.apple.com/Developer_Tools/Command_Line_Tools_for_Xcode_11.5/Command_Line_Tools_for_Xcode_11.5.dmg) 2. Install the package. 3. Run the [_acid test_ steps above](#The-acid-test). ### I did all that and the acid test still does not pass :-( 1. `sudo rm -rf $(xcode-select -print-path)` # Enter root password. No output is normal. 2. `sudo rm -rf /Library/Developer/CommandLineTools` # Enter root password. 3. `sudo xcode-select --reset` 4. `xcode-select --install` 5. If the [_acid test_ steps above](#The-acid-test) still does _not_ pass then... 6. `npm explore npm -g -- npm install node-gyp@latest` 7. `npm explore npm -g -- npm explore npm-lifecycle -- npm install node-gyp@latest` 8. If the _acid test_ still does _not_ pass then... 9. Add a comment to https://github.com/nodejs/node-gyp/issues/1927 so we can improve. Lessons learned from: * https://github.com/nodejs/node-gyp/issues/1779 * https://github.com/nodejs/node-gyp/issues/1861 * https://github.com/nodejs/node-gyp/issues/1927 and elsewhere * Thanks to @rrrix for discovering Solution 3 #!/bin/bash pkgs=( "com.apple.pkg.DeveloperToolsCLILeo" # standalone "com.apple.pkg.DeveloperToolsCLI" # from XCode "com.apple.pkg.CLTools_Executables" # Mavericks ) for pkg in "${pkgs[@]}"; do output=$(/usr/sbin/pkgutil --pkg-info "$pkg" 2>/dev/null) if [ "$output" ]; then version=$(echo "$output" | grep 'version' | cut -d' ' -f2) break fi done if [ "$version" ]; then echo "Command Line Tools version: $version" else echo >&2 'Command Line Tools not found' fi { "name": "node-gyp", "description": "Node.js native addon build tool", "license": "MIT", "keywords": [ "native", "addon", "module", "c", "c++", "bindings", "gyp" ], "version": "9.0.0", "installVersion": 9, "author": "Nathan Rajlich (http://tootallnate.net)", "repository": { "type": "git", "url": "git://github.com/nodejs/node-gyp.git" }, "preferGlobal": true, "bin": "./bin/node-gyp.js", "main": "./lib/node-gyp.js", "dependencies": { "env-paths": "^2.2.0", "glob": "^7.1.4", "graceful-fs": "^4.2.6", "make-fetch-happen": "^10.0.3", "nopt": "^5.0.0", "npmlog": "^6.0.0", "rimraf": "^3.0.2", "semver": "^7.3.5", "tar": "^6.1.2", "which": "^2.0.2" }, "engines": { "node": "^12.22 || ^14.13 || >=16" }, "devDependencies": { "bindings": "^1.5.0", "nan": "^2.14.2", "require-inject": "^1.4.4", "standard": "^14.3.4", "tap": "^12.7.0" }, "scripts": { "lint": "standard */*.js test/**/*.js", "test": "npm run lint && tap --timeout=120 test/test-*" } } If you believe you have found a security issue in the software in this repository, please consult https://github.com/nodejs/node/blob/HEAD/SECURITY.md.#!/usr/bin/env python3 import argparse import os import shutil import subprocess import tarfile import tempfile import urllib.request BASE_URL = "https://github.com/nodejs/gyp-next/archive/" CHECKOUT_PATH = os.path.dirname(os.path.realpath(__file__)) CHECKOUT_GYP_PATH = os.path.join(CHECKOUT_PATH, "gyp") parser = argparse.ArgumentParser() parser.add_argument("tag", help="gyp tag to update to") args = parser.parse_args() tar_url = BASE_URL + args.tag + ".tar.gz" changed_files = subprocess.check_output(["git", "diff", "--name-only"]).strip() if changed_files: raise Exception("Can't update gyp while you have uncommitted changes in node-gyp") with tempfile.TemporaryDirectory() as tmp_dir: tar_file = os.path.join(tmp_dir, "gyp.tar.gz") unzip_target = os.path.join(tmp_dir, "gyp") with open(tar_file, "wb") as f: print("Downloading gyp-next@" + args.tag + " into temporary directory...") print("From: " + tar_url) with urllib.request.urlopen(tar_url) as in_file: f.write(in_file.read()) print("Unzipping...") with tarfile.open(tar_file, "r:gz") as tar_ref: tar_ref.extractall(unzip_target) print("Moving to current checkout (" + CHECKOUT_PATH + ")...") if os.path.exists(CHECKOUT_GYP_PATH): shutil.rmtree(CHECKOUT_GYP_PATH) shutil.move( os.path.join(unzip_target, os.listdir(unzip_target)[0]), CHECKOUT_GYP_PATH ) subprocess.check_output(["git", "add", "gyp"], cwd=CHECKOUT_PATH) subprocess.check_output(["git", "commit", "-m", "feat(gyp): update gyp to " + args.tag]) #!/usr/bin/env node 'use strict' process.title = 'node-gyp' const envPaths = require('env-paths') const gyp = require('../') const log = require('npmlog') const os = require('os') /** * Process and execute the selected commands. */ const prog = gyp() var completed = false prog.parseArgv(process.argv) prog.devDir = prog.opts.devdir var homeDir = os.homedir() if (prog.devDir) { prog.devDir = prog.devDir.replace(/^~/, homeDir) } else if (homeDir) { prog.devDir = envPaths('node-gyp', { suffix: '' }).cache } else { throw new Error( "node-gyp requires that the user's home directory is specified " + 'in either of the environmental variables HOME or USERPROFILE. ' + 'Overide with: --devdir /path/to/.node-gyp') } if (prog.todo.length === 0) { if (~process.argv.indexOf('-v') || ~process.argv.indexOf('--version')) { console.log('v%s', prog.version) } else { console.log('%s', prog.usage()) } process.exit(0) } log.info('it worked if it ends with', 'ok') log.verbose('cli', process.argv) log.info('using', 'node-gyp@%s', prog.version) log.info('using', 'node@%s | %s | %s', process.versions.node, process.platform, process.arch) /** * Change dir if -C/--directory was passed. */ var dir = prog.opts.directory if (dir) { var fs = require('fs') try { var stat = fs.statSync(dir) if (stat.isDirectory()) { log.info('chdir', dir) process.chdir(dir) } else { log.warn('chdir', dir + ' is not a directory') } } catch (e) { if (e.code === 'ENOENT') { log.warn('chdir', dir + ' is not a directory') } else { log.warn('chdir', 'error during chdir() "%s"', e.message) } } } function run () { var command = prog.todo.shift() if (!command) { // done! completed = true log.info('ok') return } prog.commands[command.name](command.args, function (err) { if (err) { log.error(command.name + ' error') log.error('stack', err.stack) errorMessage() log.error('not ok') return process.exit(1) } if (command.name === 'list') { var versions = arguments[1] if (versions.length > 0) { versions.forEach(function (version) { console.log(version) }) } else { console.log('No node development files installed. Use `node-gyp install` to install a version.') } } else if (arguments.length >= 2) { console.log.apply(console, [].slice.call(arguments, 1)) } // now run the next command in the queue process.nextTick(run) }) } process.on('exit', function (code) { if (!completed && !code) { log.error('Completion callback never invoked!') issueMessage() process.exit(6) } }) process.on('uncaughtException', function (err) { log.error('UNCAUGHT EXCEPTION') log.error('stack', err.stack) issueMessage() process.exit(7) }) function errorMessage () { // copied from npm's lib/utils/error-handler.js var os = require('os') log.error('System', os.type() + ' ' + os.release()) log.error('command', process.argv .map(JSON.stringify).join(' ')) log.error('cwd', process.cwd()) log.error('node -v', process.version) log.error('node-gyp -v', 'v' + prog.package.version) } function issueMessage () { errorMessage() log.error('', ['Node-gyp failed to build your package.', 'Try to update npm and/or node-gyp and if it does not help file an issue with the package author.' ].join('\n')) } // start running the given commands! run() 'use strict' const fs = require('graceful-fs') const path = require('path') const glob = require('glob') const log = require('npmlog') const which = require('which') const win = process.platform === 'win32' function build (gyp, argv, callback) { var platformMake = 'make' if (process.platform === 'aix') { platformMake = 'gmake' } else if (process.platform.indexOf('bsd') !== -1) { platformMake = 'gmake' } else if (win && argv.length > 0) { argv = argv.map(function (target) { return '/t:' + target }) } var makeCommand = gyp.opts.make || process.env.MAKE || platformMake var command = win ? 'msbuild' : makeCommand var jobs = gyp.opts.jobs || process.env.JOBS var buildType var config var arch var nodeDir var guessedSolution loadConfigGypi() /** * Load the "config.gypi" file that was generated during "configure". */ function loadConfigGypi () { var configPath = path.resolve('build', 'config.gypi') fs.readFile(configPath, 'utf8', function (err, data) { if (err) { if (err.code === 'ENOENT') { callback(new Error('You must run `node-gyp configure` first!')) } else { callback(err) } return } config = JSON.parse(data.replace(/#.+\n/, '')) // get the 'arch', 'buildType', and 'nodeDir' vars from the config buildType = config.target_defaults.default_configuration arch = config.variables.target_arch nodeDir = config.variables.nodedir if ('debug' in gyp.opts) { buildType = gyp.opts.debug ? 'Debug' : 'Release' } if (!buildType) { buildType = 'Release' } log.verbose('build type', buildType) log.verbose('architecture', arch) log.verbose('node dev dir', nodeDir) if (win) { findSolutionFile() } else { doWhich() } }) } /** * On Windows, find the first build/*.sln file. */ function findSolutionFile () { glob('build/*.sln', function (err, files) { if (err) { return callback(err) } if (files.length === 0) { return callback(new Error('Could not find *.sln file. Did you run "configure"?')) } guessedSolution = files[0] log.verbose('found first Solution file', guessedSolution) doWhich() }) } /** * Uses node-which to locate the msbuild / make executable. */ function doWhich () { // On Windows use msbuild provided by node-gyp configure if (win) { if (!config.variables.msbuild_path) { return callback(new Error( 'MSBuild is not set, please run `node-gyp configure`.')) } command = config.variables.msbuild_path log.verbose('using MSBuild:', command) doBuild() return } // First make sure we have the build command in the PATH which(command, function (err, execPath) { if (err) { // Some other error or 'make' not found on Unix, report that to the user callback(err) return } log.verbose('`which` succeeded for `' + command + '`', execPath) doBuild() }) } /** * Actually spawn the process and compile the module. */ function doBuild () { // Enable Verbose build var verbose = log.levels[log.level] <= log.levels.verbose var j if (!win && verbose) { argv.push('V=1') } if (win && !verbose) { argv.push('/clp:Verbosity=minimal') } if (win) { // Turn off the Microsoft logo on Windows argv.push('/nologo') } // Specify the build type, Release by default if (win) { // Convert .gypi config target_arch to MSBuild /Platform // Since there are many ways to state '32-bit Intel', default to it. // N.B. msbuild's Condition string equality tests are case-insensitive. var archLower = arch.toLowerCase() var p = archLower === 'x64' ? 'x64' : (archLower === 'arm' ? 'ARM' : (archLower === 'arm64' ? 'ARM64' : 'Win32')) argv.push('/p:Configuration=' + buildType + ';Platform=' + p) if (jobs) { j = parseInt(jobs, 10) if (!isNaN(j) && j > 0) { argv.push('/m:' + j) } else if (jobs.toUpperCase() === 'MAX') { argv.push('/m:' + require('os').cpus().length) } } } else { argv.push('BUILDTYPE=' + buildType) // Invoke the Makefile in the 'build' dir. argv.push('-C') argv.push('build') if (jobs) { j = parseInt(jobs, 10) if (!isNaN(j) && j > 0) { argv.push('--jobs') argv.push(j) } else if (jobs.toUpperCase() === 'MAX') { argv.push('--jobs') argv.push(require('os').cpus().length) } } } if (win) { // did the user specify their own .sln file? var hasSln = argv.some(function (arg) { return path.extname(arg) === '.sln' }) if (!hasSln) { argv.unshift(gyp.opts.solution || guessedSolution) } } var proc = gyp.spawn(command, argv) proc.on('exit', onExit) } function onExit (code, signal) { if (code !== 0) { return callback(new Error('`' + command + '` failed with exit code: ' + code)) } if (signal) { return callback(new Error('`' + command + '` got signal: ' + signal)) } callback() } } module.exports = build module.exports.usage = 'Invokes `' + (win ? 'msbuild' : 'make') + '` and builds the module' 'use strict' const rm = require('rimraf') const log = require('npmlog') function clean (gyp, argv, callback) { // Remove the 'build' dir var buildDir = 'build' log.verbose('clean', 'removing "%s" directory', buildDir) rm(buildDir, callback) } module.exports = clean module.exports.usage = 'Removes any generated build files and the "out" dir' 'use strict' const fs = require('graceful-fs') const path = require('path') const log = require('npmlog') const os = require('os') const processRelease = require('./process-release') const win = process.platform === 'win32' const findNodeDirectory = require('./find-node-directory') const createConfigGypi = require('./create-config-gypi') const msgFormat = require('util').format var findPython = require('./find-python') if (win) { var findVisualStudio = require('./find-visualstudio') } function configure (gyp, argv, callback) { var python var buildDir = path.resolve('build') var configNames = ['config.gypi', 'common.gypi'] var configs = [] var nodeDir var release = processRelease(argv, gyp, process.version, process.release) findPython(gyp.opts.python, function (err, found) { if (err) { callback(err) } else { python = found getNodeDir() } }) function getNodeDir () { // 'python' should be set by now process.env.PYTHON = python if (gyp.opts.nodedir) { // --nodedir was specified. use that for the dev files nodeDir = gyp.opts.nodedir.replace(/^~/, os.homedir()) log.verbose('get node dir', 'compiling against specified --nodedir dev files: %s', nodeDir) createBuildDir() } else { // if no --nodedir specified, ensure node dependencies are installed if ('v' + release.version !== process.version) { // if --target was given, then determine a target version to compile for log.verbose('get node dir', 'compiling against --target node version: %s', release.version) } else { // if no --target was specified then use the current host node version log.verbose('get node dir', 'no --target version specified, falling back to host node version: %s', release.version) } if (!release.semver) { // could not parse the version string with semver return callback(new Error('Invalid version number: ' + release.version)) } // If the tarball option is set, always remove and reinstall the headers // into devdir. Otherwise only install if they're not already there. gyp.opts.ensure = !gyp.opts.tarball gyp.commands.install([release.version], function (err) { if (err) { return callback(err) } log.verbose('get node dir', 'target node version installed:', release.versionDir) nodeDir = path.resolve(gyp.devDir, release.versionDir) createBuildDir() }) } } function createBuildDir () { log.verbose('build dir', 'attempting to create "build" dir: %s', buildDir) fs.mkdir(buildDir, { recursive: true }, function (err, isNew) { if (err) { return callback(err) } log.verbose( 'build dir', '"build" dir needed to be created?', isNew ? 'Yes' : 'No' ) if (win) { findVisualStudio(release.semver, gyp.opts.msvs_version, createConfigFile) } else { createConfigFile() } }) } function createConfigFile (err, vsInfo) { if (err) { return callback(err) } if (process.platform === 'win32') { process.env.GYP_MSVS_VERSION = Math.min(vsInfo.versionYear, 2015) process.env.GYP_MSVS_OVERRIDE_PATH = vsInfo.path } createConfigGypi({ gyp, buildDir, nodeDir, vsInfo }).then(configPath => { configs.push(configPath) findConfigs() }).catch(err => { callback(err) }) } function findConfigs () { var name = configNames.shift() if (!name) { return runGyp() } var fullPath = path.resolve(name) log.verbose(name, 'checking for gypi file: %s', fullPath) fs.stat(fullPath, function (err) { if (err) { if (err.code === 'ENOENT') { findConfigs() // check next gypi filename } else { callback(err) } } else { log.verbose(name, 'found gypi file') configs.push(fullPath) findConfigs() } }) } function runGyp (err) { if (err) { return callback(err) } if (!~argv.indexOf('-f') && !~argv.indexOf('--format')) { if (win) { log.verbose('gyp', 'gyp format was not specified; forcing "msvs"') // force the 'make' target for non-Windows argv.push('-f', 'msvs') } else { log.verbose('gyp', 'gyp format was not specified; forcing "make"') // force the 'make' target for non-Windows argv.push('-f', 'make') } } // include all the ".gypi" files that were found configs.forEach(function (config) { argv.push('-I', config) }) // For AIX and z/OS we need to set up the path to the exports file // which contains the symbols needed for linking. var nodeExpFile if (process.platform === 'aix' || process.platform === 'os390') { var ext = process.platform === 'aix' ? 'exp' : 'x' var nodeRootDir = findNodeDirectory() var candidates if (process.platform === 'aix') { candidates = [ 'include/node/node', 'out/Release/node', 'out/Debug/node', 'node' ].map(function (file) { return file + '.' + ext }) } else { candidates = [ 'out/Release/lib.target/libnode', 'out/Debug/lib.target/libnode', 'out/Release/obj.target/libnode', 'out/Debug/obj.target/libnode', 'lib/libnode' ].map(function (file) { return file + '.' + ext }) } var logprefix = 'find exports file' nodeExpFile = findAccessibleSync(logprefix, nodeRootDir, candidates) if (nodeExpFile !== undefined) { log.verbose(logprefix, 'Found exports file: %s', nodeExpFile) } else { var msg = msgFormat('Could not find node.%s file in %s', ext, nodeRootDir) log.error(logprefix, 'Could not find exports file') return callback(new Error(msg)) } } // this logic ported from the old `gyp_addon` python file var gypScript = path.resolve(__dirname, '..', 'gyp', 'gyp_main.py') var addonGypi = path.resolve(__dirname, '..', 'addon.gypi') var commonGypi = path.resolve(nodeDir, 'include/node/common.gypi') fs.stat(commonGypi, function (err) { if (err) { commonGypi = path.resolve(nodeDir, 'common.gypi') } var outputDir = 'build' if (win) { // Windows expects an absolute path outputDir = buildDir } var nodeGypDir = path.resolve(__dirname, '..') var nodeLibFile = path.join(nodeDir, !gyp.opts.nodedir ? '<(target_arch)' : '$(Configuration)', release.name + '.lib') argv.push('-I', addonGypi) argv.push('-I', commonGypi) argv.push('-Dlibrary=shared_library') argv.push('-Dvisibility=default') argv.push('-Dnode_root_dir=' + nodeDir) if (process.platform === 'aix' || process.platform === 'os390') { argv.push('-Dnode_exp_file=' + nodeExpFile) } argv.push('-Dnode_gyp_dir=' + nodeGypDir) // Do this to keep Cygwin environments happy, else the unescaped '\' gets eaten up, // resulting in bad paths, Ex c:parentFolderfolderanotherFolder instead of c:\parentFolder\folder\anotherFolder if (win) { nodeLibFile = nodeLibFile.replace(/\\/g, '\\\\') } argv.push('-Dnode_lib_file=' + nodeLibFile) argv.push('-Dmodule_root_dir=' + process.cwd()) argv.push('-Dnode_engine=' + (gyp.opts.node_engine || process.jsEngine || 'v8')) argv.push('--depth=.') argv.push('--no-parallel') // tell gyp to write the Makefile/Solution files into output_dir argv.push('--generator-output', outputDir) // tell make to write its output into the same dir argv.push('-Goutput_dir=.') // enforce use of the "binding.gyp" file argv.unshift('binding.gyp') // execute `gyp` from the current target nodedir argv.unshift(gypScript) // make sure python uses files that came with this particular node package var pypath = [path.join(__dirname, '..', 'gyp', 'pylib')] if (process.env.PYTHONPATH) { pypath.push(process.env.PYTHONPATH) } process.env.PYTHONPATH = pypath.join(win ? ';' : ':') var cp = gyp.spawn(python, argv) cp.on('exit', onCpExit) }) } function onCpExit (code) { if (code !== 0) { callback(new Error('`gyp` failed with exit code: ' + code)) } else { // we're done callback() } } } /** * Returns the first file or directory from an array of candidates that is * readable by the current user, or undefined if none of the candidates are * readable. */ function findAccessibleSync (logprefix, dir, candidates) { for (var next = 0; next < candidates.length; next++) { var candidate = path.resolve(dir, candidates[next]) try { var fd = fs.openSync(candidate, 'r') } catch (e) { // this candidate was not found or not readable, do nothing log.silly(logprefix, 'Could not open %s: %s', candidate, e.message) continue } fs.closeSync(fd) log.silly(logprefix, 'Found readable %s', candidate) return candidate } return undefined } module.exports = configure module.exports.test = { findAccessibleSync: findAccessibleSync } module.exports.usage = 'Generates ' + (win ? 'MSVC project files' : 'a Makefile') + ' for the current module' 'use strict' const fs = require('graceful-fs') const log = require('npmlog') const path = require('path') function parseConfigGypi (config) { // translated from tools/js2c.py of Node.js // 1. string comments config = config.replace(/#.*/g, '') // 2. join multiline strings config = config.replace(/'$\s+'/mg, '') // 3. normalize string literals from ' into " config = config.replace(/'/g, '"') return JSON.parse(config) } async function getBaseConfigGypi ({ gyp, nodeDir }) { // try reading $nodeDir/include/node/config.gypi first when: // 1. --dist-url or --nodedir is specified // 2. and --force-process-config is not specified const useCustomHeaders = gyp.opts.nodedir || gyp.opts.disturl || gyp.opts['dist-url'] const shouldReadConfigGypi = useCustomHeaders && !gyp.opts['force-process-config'] if (shouldReadConfigGypi && nodeDir) { try { const baseConfigGypiPath = path.resolve(nodeDir, 'include/node/config.gypi') const baseConfigGypi = await fs.promises.readFile(baseConfigGypiPath) return parseConfigGypi(baseConfigGypi.toString()) } catch (err) { log.warn('read config.gypi', err.message) } } // fallback to process.config if it is invalid return JSON.parse(JSON.stringify(process.config)) } async function getCurrentConfigGypi ({ gyp, nodeDir, vsInfo }) { const config = await getBaseConfigGypi({ gyp, nodeDir }) if (!config.target_defaults) { config.target_defaults = {} } if (!config.variables) { config.variables = {} } const defaults = config.target_defaults const variables = config.variables // don't inherit the "defaults" from the base config.gypi. // doing so could cause problems in cases where the `node` executable was // compiled on a different machine (with different lib/include paths) than // the machine where the addon is being built to defaults.cflags = [] defaults.defines = [] defaults.include_dirs = [] defaults.libraries = [] // set the default_configuration prop if ('debug' in gyp.opts) { defaults.default_configuration = gyp.opts.debug ? 'Debug' : 'Release' } if (!defaults.default_configuration) { defaults.default_configuration = 'Release' } // set the target_arch variable variables.target_arch = gyp.opts.arch || process.arch || 'ia32' if (variables.target_arch === 'arm64') { defaults.msvs_configuration_platform = 'ARM64' defaults.xcode_configuration_platform = 'arm64' } // set the node development directory variables.nodedir = nodeDir // disable -T "thin" static archives by default variables.standalone_static_library = gyp.opts.thin ? 0 : 1 if (process.platform === 'win32') { defaults.msbuild_toolset = vsInfo.toolset if (vsInfo.sdk) { defaults.msvs_windows_target_platform_version = vsInfo.sdk } if (variables.target_arch === 'arm64') { if (vsInfo.versionMajor > 15 || (vsInfo.versionMajor === 15 && vsInfo.versionMajor >= 9)) { defaults.msvs_enable_marmasm = 1 } else { log.warn('Compiling ARM64 assembly is only available in\n' + 'Visual Studio 2017 version 15.9 and above') } } variables.msbuild_path = vsInfo.msBuild } // loop through the rest of the opts and add the unknown ones as variables. // this allows for module-specific configure flags like: // // $ node-gyp configure --shared-libxml2 Object.keys(gyp.opts).forEach(function (opt) { if (opt === 'argv') { return } if (opt in gyp.configDefs) { return } variables[opt.replace(/-/g, '_')] = gyp.opts[opt] }) return config } async function createConfigGypi ({ gyp, buildDir, nodeDir, vsInfo }) { const configFilename = 'config.gypi' const configPath = path.resolve(buildDir, configFilename) log.verbose('build/' + configFilename, 'creating config file') const config = await getCurrentConfigGypi({ gyp, nodeDir, vsInfo }) // ensures that any boolean values in config.gypi get stringified function boolsToString (k, v) { if (typeof v === 'boolean') { return String(v) } return v } log.silly('build/' + configFilename, config) // now write out the config.gypi file to the build/ dir const prefix = '# Do not edit. File was generated by node-gyp\'s "configure" step' const json = JSON.stringify(config, boolsToString, 2) log.verbose('build/' + configFilename, 'writing out config file: %s', configPath) await fs.promises.writeFile(configPath, [prefix, json, ''].join('\n')) return configPath } module.exports = createConfigGypi module.exports.test = { parseConfigGypi: parseConfigGypi, getCurrentConfigGypi: getCurrentConfigGypi } 'use strict' const path = require('path') const log = require('npmlog') function findNodeDirectory (scriptLocation, processObj) { // set dirname and process if not passed in // this facilitates regression tests if (scriptLocation === undefined) { scriptLocation = __dirname } if (processObj === undefined) { processObj = process } // Have a look to see what is above us, to try and work out where we are var npmParentDirectory = path.join(scriptLocation, '../../../..') log.verbose('node-gyp root', 'npm_parent_directory is ' + path.basename(npmParentDirectory)) var nodeRootDir = '' log.verbose('node-gyp root', 'Finding node root directory') if (path.basename(npmParentDirectory) === 'deps') { // We are in a build directory where this script lives in // deps/npm/node_modules/node-gyp/lib nodeRootDir = path.join(npmParentDirectory, '..') log.verbose('node-gyp root', 'in build directory, root = ' + nodeRootDir) } else if (path.basename(npmParentDirectory) === 'node_modules') { // We are in a node install directory where this script lives in // lib/node_modules/npm/node_modules/node-gyp/lib or // node_modules/npm/node_modules/node-gyp/lib depending on the // platform if (processObj.platform === 'win32') { nodeRootDir = path.join(npmParentDirectory, '..') } else { nodeRootDir = path.join(npmParentDirectory, '../..') } log.verbose('node-gyp root', 'in install directory, root = ' + nodeRootDir) } else { // We don't know where we are, try working it out from the location // of the node binary var nodeDir = path.dirname(processObj.execPath) var directoryUp = path.basename(nodeDir) if (directoryUp === 'bin') { nodeRootDir = path.join(nodeDir, '..') } else if (directoryUp === 'Release' || directoryUp === 'Debug') { // If we are a recently built node, and the directory structure // is that of a repository. If we are on Windows then we only need // to go one level up, everything else, two if (processObj.platform === 'win32') { nodeRootDir = path.join(nodeDir, '..') } else { nodeRootDir = path.join(nodeDir, '../..') } } // Else return the default blank, "". } return nodeRootDir } module.exports = findNodeDirectory 'use strict' const log = require('npmlog') const semver = require('semver') const cp = require('child_process') const extend = require('util')._extend // eslint-disable-line const win = process.platform === 'win32' const logWithPrefix = require('./util').logWithPrefix const systemDrive = process.env.SystemDrive || 'C:' const username = process.env.USERNAME || process.env.USER || getOsUserInfo() const localAppData = process.env.LOCALAPPDATA || `${systemDrive}\\${username}\\AppData\\Local` const foundLocalAppData = process.env.LOCALAPPDATA || username const programFiles = process.env.ProgramW6432 || process.env.ProgramFiles || `${systemDrive}\\Program Files` const programFilesX86 = process.env['ProgramFiles(x86)'] || `${programFiles} (x86)` const winDefaultLocationsArray = [] for (const majorMinor of ['39', '38', '37', '36']) { if (foundLocalAppData) { winDefaultLocationsArray.push( `${localAppData}\\Programs\\Python\\Python${majorMinor}\\python.exe`, `${programFiles}\\Python${majorMinor}\\python.exe`, `${localAppData}\\Programs\\Python\\Python${majorMinor}-32\\python.exe`, `${programFiles}\\Python${majorMinor}-32\\python.exe`, `${programFilesX86}\\Python${majorMinor}-32\\python.exe` ) } else { winDefaultLocationsArray.push( `${programFiles}\\Python${majorMinor}\\python.exe`, `${programFiles}\\Python${majorMinor}-32\\python.exe`, `${programFilesX86}\\Python${majorMinor}-32\\python.exe` ) } } function getOsUserInfo () { try { return require('os').userInfo().username } catch (e) {} } function PythonFinder (configPython, callback) { this.callback = callback this.configPython = configPython this.errorLog = [] } PythonFinder.prototype = { log: logWithPrefix(log, 'find Python'), argsExecutable: ['-c', 'import sys; print(sys.executable);'], argsVersion: ['-c', 'import sys; print("%s.%s.%s" % sys.version_info[:3]);'], semverRange: '>=3.6.0', // These can be overridden for testing: execFile: cp.execFile, env: process.env, win: win, pyLauncher: 'py.exe', winDefaultLocations: winDefaultLocationsArray, // Logs a message at verbose level, but also saves it to be displayed later // at error level if an error occurs. This should help diagnose the problem. addLog: function addLog (message) { this.log.verbose(message) this.errorLog.push(message) }, // Find Python by trying a sequence of possibilities. // Ignore errors, keep trying until Python is found. findPython: function findPython () { const SKIP = 0; const FAIL = 1 var toCheck = getChecks.apply(this) function getChecks () { if (this.env.NODE_GYP_FORCE_PYTHON) { return [{ before: () => { this.addLog( 'checking Python explicitly set from NODE_GYP_FORCE_PYTHON') this.addLog('- process.env.NODE_GYP_FORCE_PYTHON is ' + `"${this.env.NODE_GYP_FORCE_PYTHON}"`) }, check: this.checkCommand, arg: this.env.NODE_GYP_FORCE_PYTHON }] } var checks = [ { before: () => { if (!this.configPython) { this.addLog( 'Python is not set from command line or npm configuration') return SKIP } this.addLog('checking Python explicitly set from command line or ' + 'npm configuration') this.addLog('- "--python=" or "npm config get python" is ' + `"${this.configPython}"`) }, check: this.checkCommand, arg: this.configPython }, { before: () => { if (!this.env.PYTHON) { this.addLog('Python is not set from environment variable ' + 'PYTHON') return SKIP } this.addLog('checking Python explicitly set from environment ' + 'variable PYTHON') this.addLog(`- process.env.PYTHON is "${this.env.PYTHON}"`) }, check: this.checkCommand, arg: this.env.PYTHON }, { before: () => { this.addLog('checking if "python3" can be used') }, check: this.checkCommand, arg: 'python3' }, { before: () => { this.addLog('checking if "python" can be used') }, check: this.checkCommand, arg: 'python' } ] if (this.win) { for (var i = 0; i < this.winDefaultLocations.length; ++i) { const location = this.winDefaultLocations[i] checks.push({ before: () => { this.addLog('checking if Python is ' + `${location}`) }, check: this.checkExecPath, arg: location }) } checks.push({ before: () => { this.addLog( 'checking if the py launcher can be used to find Python 3') }, check: this.checkPyLauncher }) } return checks } function runChecks (err) { this.log.silly('runChecks: err = %j', (err && err.stack) || err) const check = toCheck.shift() if (!check) { return this.fail() } const before = check.before.apply(this) if (before === SKIP) { return runChecks.apply(this) } if (before === FAIL) { return this.fail() } const args = [runChecks.bind(this)] if (check.arg) { args.unshift(check.arg) } check.check.apply(this, args) } runChecks.apply(this) }, // Check if command is a valid Python to use. // Will exit the Python finder on success. // If on Windows, run in a CMD shell to support BAT/CMD launchers. checkCommand: function checkCommand (command, errorCallback) { var exec = command var args = this.argsExecutable var shell = false if (this.win) { // Arguments have to be manually quoted exec = `"${exec}"` args = args.map(a => `"${a}"`) shell = true } this.log.verbose(`- executing "${command}" to get executable path`) this.run(exec, args, shell, function (err, execPath) { // Possible outcomes: // - Error: not in PATH, not executable or execution fails // - Gibberish: the next command to check version will fail // - Absolute path to executable if (err) { this.addLog(`- "${command}" is not in PATH or produced an error`) return errorCallback(err) } this.addLog(`- executable path is "${execPath}"`) this.checkExecPath(execPath, errorCallback) }.bind(this)) }, // Check if the py launcher can find a valid Python to use. // Will exit the Python finder on success. // Distributions of Python on Windows by default install with the "py.exe" // Python launcher which is more likely to exist than the Python executable // being in the $PATH. // Because the Python launcher supports Python 2 and Python 3, we should // explicitly request a Python 3 version. This is done by supplying "-3" as // the first command line argument. Since "py.exe -3" would be an invalid // executable for "execFile", we have to use the launcher to figure out // where the actual "python.exe" executable is located. checkPyLauncher: function checkPyLauncher (errorCallback) { this.log.verbose( `- executing "${this.pyLauncher}" to get Python 3 executable path`) this.run(this.pyLauncher, ['-3', ...this.argsExecutable], false, function (err, execPath) { // Possible outcomes: same as checkCommand if (err) { this.addLog( `- "${this.pyLauncher}" is not in PATH or produced an error`) return errorCallback(err) } this.addLog(`- executable path is "${execPath}"`) this.checkExecPath(execPath, errorCallback) }.bind(this)) }, // Check if a Python executable is the correct version to use. // Will exit the Python finder on success. checkExecPath: function checkExecPath (execPath, errorCallback) { this.log.verbose(`- executing "${execPath}" to get version`) this.run(execPath, this.argsVersion, false, function (err, version) { // Possible outcomes: // - Error: executable can not be run (likely meaning the command wasn't // a Python executable and the previous command produced gibberish) // - Gibberish: somehow the last command produced an executable path, // this will fail when verifying the version // - Version of the Python executable if (err) { this.addLog(`- "${execPath}" could not be run`) return errorCallback(err) } this.addLog(`- version is "${version}"`) const range = new semver.Range(this.semverRange) var valid = false try { valid = range.test(version) } catch (err) { this.log.silly('range.test() threw:\n%s', err.stack) this.addLog(`- "${execPath}" does not have a valid version`) this.addLog('- is it a Python executable?') return errorCallback(err) } if (!valid) { this.addLog(`- version is ${version} - should be ${this.semverRange}`) this.addLog('- THIS VERSION OF PYTHON IS NOT SUPPORTED') return errorCallback(new Error( `Found unsupported Python version ${version}`)) } this.succeed(execPath, version) }.bind(this)) }, // Run an executable or shell command, trimming the output. run: function run (exec, args, shell, callback) { var env = extend({}, this.env) env.TERM = 'dumb' const opts = { env: env, shell: shell } this.log.silly('execFile: exec = %j', exec) this.log.silly('execFile: args = %j', args) this.log.silly('execFile: opts = %j', opts) try { this.execFile(exec, args, opts, execFileCallback.bind(this)) } catch (err) { this.log.silly('execFile: threw:\n%s', err.stack) return callback(err) } function execFileCallback (err, stdout, stderr) { this.log.silly('execFile result: err = %j', (err && err.stack) || err) this.log.silly('execFile result: stdout = %j', stdout) this.log.silly('execFile result: stderr = %j', stderr) if (err) { return callback(err) } const execPath = stdout.trim() callback(null, execPath) } }, succeed: function succeed (execPath, version) { this.log.info(`using Python version ${version} found at "${execPath}"`) process.nextTick(this.callback.bind(null, null, execPath)) }, fail: function fail () { const errorLog = this.errorLog.join('\n') const pathExample = this.win ? 'C:\\Path\\To\\python.exe' : '/path/to/pythonexecutable' // For Windows 80 col console, use up to the column before the one marked // with X (total 79 chars including logger prefix, 58 chars usable here): // X const info = [ '**********************************************************', 'You need to install the latest version of Python.', 'Node-gyp should be able to find and use Python. If not,', 'you can try one of the following options:', `- Use the switch --python="${pathExample}"`, ' (accepted by both node-gyp and npm)', '- Set the environment variable PYTHON', '- Set the npm configuration variable python:', ` npm config set python "${pathExample}"`, 'For more information consult the documentation at:', 'https://github.com/nodejs/node-gyp#installation', '**********************************************************' ].join('\n') this.log.error(`\n${errorLog}\n\n${info}\n`) process.nextTick(this.callback.bind(null, new Error( 'Could not find any Python installation to use'))) } } function findPython (configPython, callback) { var finder = new PythonFinder(configPython, callback) finder.findPython() } module.exports = findPython module.exports.test = { PythonFinder: PythonFinder, findPython: findPython } // Copyright 2017 - Refael Ackermann // Distributed under MIT style license // See accompanying file LICENSE at https://github.com/node4good/windows-autoconf // Usage: // powershell -ExecutionPolicy Unrestricted -Command "Add-Type -Path Find-VisualStudio.cs; [VisualStudioConfiguration.Main]::PrintJson()" // This script needs to be compatible with PowerShell v2 to run on Windows 2008R2 and Windows 7. using System; using System.Text; using System.Runtime.InteropServices; using System.Collections.Generic; namespace VisualStudioConfiguration { [Flags] public enum InstanceState : uint { None = 0, Local = 1, Registered = 2, NoRebootRequired = 4, NoErrors = 8, Complete = 4294967295, } [Guid("6380BCFF-41D3-4B2E-8B2E-BF8A6810C848")] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] [ComImport] public interface IEnumSetupInstances { void Next([MarshalAs(UnmanagedType.U4), In] int celt, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.Interface), Out] ISetupInstance[] rgelt, [MarshalAs(UnmanagedType.U4)] out int pceltFetched); void Skip([MarshalAs(UnmanagedType.U4), In] int celt); void Reset(); [return: MarshalAs(UnmanagedType.Interface)] IEnumSetupInstances Clone(); } [Guid("42843719-DB4C-46C2-8E7C-64F1816EFD5B")] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] [ComImport] public interface ISetupConfiguration { } [Guid("26AAB78C-4A60-49D6-AF3B-3C35BC93365D")] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] [ComImport] public interface ISetupConfiguration2 : ISetupConfiguration { [return: MarshalAs(UnmanagedType.Interface)] IEnumSetupInstances EnumInstances(); [return: MarshalAs(UnmanagedType.Interface)] ISetupInstance GetInstanceForCurrentProcess(); [return: MarshalAs(UnmanagedType.Interface)] ISetupInstance GetInstanceForPath([MarshalAs(UnmanagedType.LPWStr), In] string path); [return: MarshalAs(UnmanagedType.Interface)] IEnumSetupInstances EnumAllInstances(); } [Guid("B41463C3-8866-43B5-BC33-2B0676F7F42E")] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] [ComImport] public interface ISetupInstance { } [Guid("89143C9A-05AF-49B0-B717-72E218A2185C")] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] [ComImport] public interface ISetupInstance2 : ISetupInstance { [return: MarshalAs(UnmanagedType.BStr)] string GetInstanceId(); [return: MarshalAs(UnmanagedType.Struct)] System.Runtime.InteropServices.ComTypes.FILETIME GetInstallDate(); [return: MarshalAs(UnmanagedType.BStr)] string GetInstallationName(); [return: MarshalAs(UnmanagedType.BStr)] string GetInstallationPath(); [return: MarshalAs(UnmanagedType.BStr)] string GetInstallationVersion(); [return: MarshalAs(UnmanagedType.BStr)] string GetDisplayName([MarshalAs(UnmanagedType.U4), In] int lcid); [return: MarshalAs(UnmanagedType.BStr)] string GetDescription([MarshalAs(UnmanagedType.U4), In] int lcid); [return: MarshalAs(UnmanagedType.BStr)] string ResolvePath([MarshalAs(UnmanagedType.LPWStr), In] string pwszRelativePath); [return: MarshalAs(UnmanagedType.U4)] InstanceState GetState(); [return: MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_UNKNOWN)] ISetupPackageReference[] GetPackages(); ISetupPackageReference GetProduct(); [return: MarshalAs(UnmanagedType.BStr)] string GetProductPath(); [return: MarshalAs(UnmanagedType.VariantBool)] bool IsLaunchable(); [return: MarshalAs(UnmanagedType.VariantBool)] bool IsComplete(); [return: MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_UNKNOWN)] ISetupPropertyStore GetProperties(); [return: MarshalAs(UnmanagedType.BStr)] string GetEnginePath(); } [Guid("DA8D8A16-B2B6-4487-A2F1-594CCCCD6BF5")] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] [ComImport] public interface ISetupPackageReference { [return: MarshalAs(UnmanagedType.BStr)] string GetId(); [return: MarshalAs(UnmanagedType.BStr)] string GetVersion(); [return: MarshalAs(UnmanagedType.BStr)] string GetChip(); [return: MarshalAs(UnmanagedType.BStr)] string GetLanguage(); [return: MarshalAs(UnmanagedType.BStr)] string GetBranch(); [return: MarshalAs(UnmanagedType.BStr)] string GetType(); [return: MarshalAs(UnmanagedType.BStr)] string GetUniqueId(); [return: MarshalAs(UnmanagedType.VariantBool)] bool GetIsExtension(); } [Guid("c601c175-a3be-44bc-91f6-4568d230fc83")] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] [ComImport] public interface ISetupPropertyStore { [return: MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_BSTR)] string[] GetNames(); object GetValue([MarshalAs(UnmanagedType.LPWStr), In] string pwszName); } [Guid("42843719-DB4C-46C2-8E7C-64F1816EFD5B")] [CoClass(typeof(SetupConfigurationClass))] [ComImport] public interface SetupConfiguration : ISetupConfiguration2, ISetupConfiguration { } [Guid("177F0C4A-1CD3-4DE7-A32C-71DBBB9FA36D")] [ClassInterface(ClassInterfaceType.None)] [ComImport] public class SetupConfigurationClass { } public static class Main { public static void PrintJson() { ISetupConfiguration query = new SetupConfiguration(); ISetupConfiguration2 query2 = (ISetupConfiguration2)query; IEnumSetupInstances e = query2.EnumAllInstances(); int pceltFetched; ISetupInstance2[] rgelt = new ISetupInstance2[1]; List instances = new List(); while (true) { e.Next(1, rgelt, out pceltFetched); if (pceltFetched <= 0) { Console.WriteLine(String.Format("[{0}]", string.Join(",", instances.ToArray()))); return; } try { instances.Add(InstanceJson(rgelt[0])); } catch (COMException) { // Ignore instances that can't be queried. } } } private static string JsonString(string s) { return "\"" + s.Replace("\\", "\\\\").Replace("\"", "\\\"") + "\""; } private static string InstanceJson(ISetupInstance2 setupInstance2) { // Visual Studio component directory: // https://docs.microsoft.com/en-us/visualstudio/install/workload-and-component-ids StringBuilder json = new StringBuilder(); json.Append("{"); string path = JsonString(setupInstance2.GetInstallationPath()); json.Append(String.Format("\"path\":{0},", path)); string version = JsonString(setupInstance2.GetInstallationVersion()); json.Append(String.Format("\"version\":{0},", version)); List packages = new List(); foreach (ISetupPackageReference package in setupInstance2.GetPackages()) { string id = JsonString(package.GetId()); packages.Add(id); } json.Append(String.Format("\"packages\":[{0}]", string.Join(",", packages.ToArray()))); json.Append("}"); return json.ToString(); } } } 'use strict' const log = require('npmlog') const execFile = require('child_process').execFile const fs = require('fs') const path = require('path').win32 const logWithPrefix = require('./util').logWithPrefix const regSearchKeys = require('./util').regSearchKeys function findVisualStudio (nodeSemver, configMsvsVersion, callback) { const finder = new VisualStudioFinder(nodeSemver, configMsvsVersion, callback) finder.findVisualStudio() } function VisualStudioFinder (nodeSemver, configMsvsVersion, callback) { this.nodeSemver = nodeSemver this.configMsvsVersion = configMsvsVersion this.callback = callback this.errorLog = [] this.validVersions = [] } VisualStudioFinder.prototype = { log: logWithPrefix(log, 'find VS'), regSearchKeys: regSearchKeys, // Logs a message at verbose level, but also saves it to be displayed later // at error level if an error occurs. This should help diagnose the problem. addLog: function addLog (message) { this.log.verbose(message) this.errorLog.push(message) }, findVisualStudio: function findVisualStudio () { this.configVersionYear = null this.configPath = null if (this.configMsvsVersion) { this.addLog('msvs_version was set from command line or npm config') if (this.configMsvsVersion.match(/^\d{4}$/)) { this.configVersionYear = parseInt(this.configMsvsVersion, 10) this.addLog( `- looking for Visual Studio version ${this.configVersionYear}`) } else { this.configPath = path.resolve(this.configMsvsVersion) this.addLog( `- looking for Visual Studio installed in "${this.configPath}"`) } } else { this.addLog('msvs_version not set from command line or npm config') } if (process.env.VCINSTALLDIR) { this.envVcInstallDir = path.resolve(process.env.VCINSTALLDIR, '..') this.addLog('running in VS Command Prompt, installation path is:\n' + `"${this.envVcInstallDir}"\n- will only use this version`) } else { this.addLog('VCINSTALLDIR not set, not running in VS Command Prompt') } this.findVisualStudio2017OrNewer((info) => { if (info) { return this.succeed(info) } this.findVisualStudio2015((info) => { if (info) { return this.succeed(info) } this.findVisualStudio2013((info) => { if (info) { return this.succeed(info) } this.fail() }) }) }) }, succeed: function succeed (info) { this.log.info(`using VS${info.versionYear} (${info.version}) found at:` + `\n"${info.path}"` + '\nrun with --verbose for detailed information') process.nextTick(this.callback.bind(null, null, info)) }, fail: function fail () { if (this.configMsvsVersion && this.envVcInstallDir) { this.errorLog.push( 'msvs_version does not match this VS Command Prompt or the', 'installation cannot be used.') } else if (this.configMsvsVersion) { // If msvs_version was specified but finding VS failed, print what would // have been accepted this.errorLog.push('') if (this.validVersions) { this.errorLog.push('valid versions for msvs_version:') this.validVersions.forEach((version) => { this.errorLog.push(`- "${version}"`) }) } else { this.errorLog.push('no valid versions for msvs_version were found') } } const errorLog = this.errorLog.join('\n') // For Windows 80 col console, use up to the column before the one marked // with X (total 79 chars including logger prefix, 62 chars usable here): // X const infoLog = [ '**************************************************************', 'You need to install the latest version of Visual Studio', 'including the "Desktop development with C++" workload.', 'For more information consult the documentation at:', 'https://github.com/nodejs/node-gyp#on-windows', '**************************************************************' ].join('\n') this.log.error(`\n${errorLog}\n\n${infoLog}\n`) process.nextTick(this.callback.bind(null, new Error( 'Could not find any Visual Studio installation to use'))) }, // Invoke the PowerShell script to get information about Visual Studio 2017 // or newer installations findVisualStudio2017OrNewer: function findVisualStudio2017OrNewer (cb) { var ps = path.join(process.env.SystemRoot, 'System32', 'WindowsPowerShell', 'v1.0', 'powershell.exe') var csFile = path.join(__dirname, 'Find-VisualStudio.cs') var psArgs = [ '-ExecutionPolicy', 'Unrestricted', '-NoProfile', '-Command', '&{Add-Type -Path \'' + csFile + '\';' + '[VisualStudioConfiguration.Main]::PrintJson()}' ] this.log.silly('Running', ps, psArgs) var child = execFile(ps, psArgs, { encoding: 'utf8' }, (err, stdout, stderr) => { this.parseData(err, stdout, stderr, cb) }) child.stdin.end() }, // Parse the output of the PowerShell script and look for an installation // of Visual Studio 2017 or newer to use parseData: function parseData (err, stdout, stderr, cb) { this.log.silly('PS stderr = %j', stderr) const failPowershell = () => { this.addLog( 'could not use PowerShell to find Visual Studio 2017 or newer, try re-running with \'--loglevel silly\' for more details') cb(null) } if (err) { this.log.silly('PS err = %j', err && (err.stack || err)) return failPowershell() } var vsInfo try { vsInfo = JSON.parse(stdout) } catch (e) { this.log.silly('PS stdout = %j', stdout) this.log.silly(e) return failPowershell() } if (!Array.isArray(vsInfo)) { this.log.silly('PS stdout = %j', stdout) return failPowershell() } vsInfo = vsInfo.map((info) => { this.log.silly(`processing installation: "${info.path}"`) info.path = path.resolve(info.path) var ret = this.getVersionInfo(info) ret.path = info.path ret.msBuild = this.getMSBuild(info, ret.versionYear) ret.toolset = this.getToolset(info, ret.versionYear) ret.sdk = this.getSDK(info) return ret }) this.log.silly('vsInfo:', vsInfo) // Remove future versions or errors parsing version number vsInfo = vsInfo.filter((info) => { if (info.versionYear) { return true } this.addLog(`unknown version "${info.version}" found at "${info.path}"`) return false }) // Sort to place newer versions first vsInfo.sort((a, b) => b.versionYear - a.versionYear) for (var i = 0; i < vsInfo.length; ++i) { const info = vsInfo[i] this.addLog(`checking VS${info.versionYear} (${info.version}) found ` + `at:\n"${info.path}"`) if (info.msBuild) { this.addLog('- found "Visual Studio C++ core features"') } else { this.addLog('- "Visual Studio C++ core features" missing') continue } if (info.toolset) { this.addLog(`- found VC++ toolset: ${info.toolset}`) } else { this.addLog('- missing any VC++ toolset') continue } if (info.sdk) { this.addLog(`- found Windows SDK: ${info.sdk}`) } else { this.addLog('- missing any Windows SDK') continue } if (!this.checkConfigVersion(info.versionYear, info.path)) { continue } return cb(info) } this.addLog( 'could not find a version of Visual Studio 2017 or newer to use') cb(null) }, // Helper - process version information getVersionInfo: function getVersionInfo (info) { const match = /^(\d+)\.(\d+)\..*/.exec(info.version) if (!match) { this.log.silly('- failed to parse version:', info.version) return {} } this.log.silly('- version match = %j', match) var ret = { version: info.version, versionMajor: parseInt(match[1], 10), versionMinor: parseInt(match[2], 10) } if (ret.versionMajor === 15) { ret.versionYear = 2017 return ret } if (ret.versionMajor === 16) { ret.versionYear = 2019 return ret } if (ret.versionMajor === 17) { ret.versionYear = 2022 return ret } this.log.silly('- unsupported version:', ret.versionMajor) return {} }, // Helper - process MSBuild information getMSBuild: function getMSBuild (info, versionYear) { const pkg = 'Microsoft.VisualStudio.VC.MSBuild.Base' const msbuildPath = path.join(info.path, 'MSBuild', 'Current', 'Bin', 'MSBuild.exe') if (info.packages.indexOf(pkg) !== -1) { this.log.silly('- found VC.MSBuild.Base') if (versionYear === 2017) { return path.join(info.path, 'MSBuild', '15.0', 'Bin', 'MSBuild.exe') } if (versionYear === 2019) { return msbuildPath } } // visual studio 2022 don't has msbuild pkg if (fs.existsSync(msbuildPath)) { return msbuildPath } return null }, // Helper - process toolset information getToolset: function getToolset (info, versionYear) { const pkg = 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64' const express = 'Microsoft.VisualStudio.WDExpress' if (info.packages.indexOf(pkg) !== -1) { this.log.silly('- found VC.Tools.x86.x64') } else if (info.packages.indexOf(express) !== -1) { this.log.silly('- found Visual Studio Express (looking for toolset)') } else { return null } if (versionYear === 2017) { return 'v141' } else if (versionYear === 2019) { return 'v142' } else if (versionYear === 2022) { return 'v143' } this.log.silly('- invalid versionYear:', versionYear) return null }, // Helper - process Windows SDK information getSDK: function getSDK (info) { const win8SDK = 'Microsoft.VisualStudio.Component.Windows81SDK' const win10SDKPrefix = 'Microsoft.VisualStudio.Component.Windows10SDK.' var Win10SDKVer = 0 info.packages.forEach((pkg) => { if (!pkg.startsWith(win10SDKPrefix)) { return } const parts = pkg.split('.') if (parts.length > 5 && parts[5] !== 'Desktop') { this.log.silly('- ignoring non-Desktop Win10SDK:', pkg) return } const foundSdkVer = parseInt(parts[4], 10) if (isNaN(foundSdkVer)) { // Microsoft.VisualStudio.Component.Windows10SDK.IpOverUsb this.log.silly('- failed to parse Win10SDK number:', pkg) return } this.log.silly('- found Win10SDK:', foundSdkVer) Win10SDKVer = Math.max(Win10SDKVer, foundSdkVer) }) if (Win10SDKVer !== 0) { return `10.0.${Win10SDKVer}.0` } else if (info.packages.indexOf(win8SDK) !== -1) { this.log.silly('- found Win8SDK') return '8.1' } return null }, // Find an installation of Visual Studio 2015 to use findVisualStudio2015: function findVisualStudio2015 (cb) { return this.findOldVS({ version: '14.0', versionMajor: 14, versionMinor: 0, versionYear: 2015, toolset: 'v140' }, cb) }, // Find an installation of Visual Studio 2013 to use findVisualStudio2013: function findVisualStudio2013 (cb) { if (this.nodeSemver.major >= 9) { this.addLog( 'not looking for VS2013 as it is only supported up to Node.js 8') return cb(null) } return this.findOldVS({ version: '12.0', versionMajor: 12, versionMinor: 0, versionYear: 2013, toolset: 'v120' }, cb) }, // Helper - common code for VS2013 and VS2015 findOldVS: function findOldVS (info, cb) { const regVC7 = ['HKLM\\Software\\Microsoft\\VisualStudio\\SxS\\VC7', 'HKLM\\Software\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VC7'] const regMSBuild = 'HKLM\\Software\\Microsoft\\MSBuild\\ToolsVersions' this.addLog(`looking for Visual Studio ${info.versionYear}`) this.regSearchKeys(regVC7, info.version, [], (err, res) => { if (err) { this.addLog('- not found') return cb(null) } const vsPath = path.resolve(res, '..') this.addLog(`- found in "${vsPath}"`) const msBuildRegOpts = process.arch === 'ia32' ? [] : ['/reg:32'] this.regSearchKeys([`${regMSBuild}\\${info.version}`], 'MSBuildToolsPath', msBuildRegOpts, (err, res) => { if (err) { this.addLog( '- could not find MSBuild in registry for this version') return cb(null) } const msBuild = path.join(res, 'MSBuild.exe') this.addLog(`- MSBuild in "${msBuild}"`) if (!this.checkConfigVersion(info.versionYear, vsPath)) { return cb(null) } info.path = vsPath info.msBuild = msBuild info.sdk = null cb(info) }) }) }, // After finding a usable version of Visual Studio: // - add it to validVersions to be displayed at the end if a specific // version was requested and not found; // - check if this is the version that was requested. // - check if this matches the Visual Studio Command Prompt checkConfigVersion: function checkConfigVersion (versionYear, vsPath) { this.validVersions.push(versionYear) this.validVersions.push(vsPath) if (this.configVersionYear && this.configVersionYear !== versionYear) { this.addLog('- msvs_version does not match this version') return false } if (this.configPath && path.relative(this.configPath, vsPath) !== '') { this.addLog('- msvs_version does not point to this installation') return false } if (this.envVcInstallDir && path.relative(this.envVcInstallDir, vsPath) !== '') { this.addLog('- does not match this Visual Studio Command Prompt') return false } return true } } module.exports = findVisualStudio module.exports.test = { VisualStudioFinder: VisualStudioFinder, findVisualStudio: findVisualStudio } 'use strict' const fs = require('graceful-fs') const os = require('os') const tar = require('tar') const path = require('path') const util = require('util') const stream = require('stream') const crypto = require('crypto') const log = require('npmlog') const semver = require('semver') const fetch = require('make-fetch-happen') const processRelease = require('./process-release') const win = process.platform === 'win32' const streamPipeline = util.promisify(stream.pipeline) /** * @param {typeof import('graceful-fs')} fs */ async function install (fs, gyp, argv) { const release = processRelease(argv, gyp, process.version, process.release) // Determine which node dev files version we are installing log.verbose('install', 'input version string %j', release.version) if (!release.semver) { // could not parse the version string with semver throw new Error('Invalid version number: ' + release.version) } if (semver.lt(release.version, '0.8.0')) { throw new Error('Minimum target version is `0.8.0` or greater. Got: ' + release.version) } // 0.x.y-pre versions are not published yet and cannot be installed. Bail. if (release.semver.prerelease[0] === 'pre') { log.verbose('detected "pre" node version', release.version) if (!gyp.opts.nodedir) { throw new Error('"pre" versions of node cannot be installed, use the --nodedir flag instead') } log.verbose('--nodedir flag was passed; skipping install', gyp.opts.nodedir) return } // flatten version into String log.verbose('install', 'installing version: %s', release.versionDir) // the directory where the dev files will be installed const devDir = path.resolve(gyp.devDir, release.versionDir) // If '--ensure' was passed, then don't *always* install the version; // check if it is already installed, and only install when needed if (gyp.opts.ensure) { log.verbose('install', '--ensure was passed, so won\'t reinstall if already installed') try { await fs.promises.stat(devDir) } catch (err) { if (err.code === 'ENOENT') { log.verbose('install', 'version not already installed, continuing with install', release.version) try { return await go() } catch (err) { return rollback(err) } } else if (err.code === 'EACCES') { return eaccesFallback(err) } throw err } log.verbose('install', 'version is already installed, need to check "installVersion"') const installVersionFile = path.resolve(devDir, 'installVersion') let installVersion = 0 try { const ver = await fs.promises.readFile(installVersionFile, 'ascii') installVersion = parseInt(ver, 10) || 0 } catch (err) { if (err.code !== 'ENOENT') { throw err } } log.verbose('got "installVersion"', installVersion) log.verbose('needs "installVersion"', gyp.package.installVersion) if (installVersion < gyp.package.installVersion) { log.verbose('install', 'version is no good; reinstalling') try { return await go() } catch (err) { return rollback(err) } } log.verbose('install', 'version is good') } else { try { return await go() } catch (err) { return rollback(err) } } async function go () { log.verbose('ensuring nodedir is created', devDir) // first create the dir for the node dev files try { const created = await fs.promises.mkdir(devDir, { recursive: true }) if (created) { log.verbose('created nodedir', created) } } catch (err) { if (err.code === 'EACCES') { return eaccesFallback(err) } throw err } // now download the node tarball const tarPath = gyp.opts.tarball let extractCount = 0 const contentShasums = {} const expectShasums = {} // checks if a file to be extracted from the tarball is valid. // only .h header files and the gyp files get extracted function isValid (path) { const isValid = valid(path) if (isValid) { log.verbose('extracted file from tarball', path) extractCount++ } else { // invalid log.silly('ignoring from tarball', path) } return isValid } // download the tarball and extract! if (tarPath) { await tar.extract({ file: tarPath, strip: 1, filter: isValid, cwd: devDir }) } else { try { const res = await download(gyp, release.tarballUrl) if (res.status !== 200) { throw new Error(`${res.status} response downloading ${release.tarballUrl}`) } await streamPipeline( res.body, // content checksum new ShaSum((_, checksum) => { const filename = path.basename(release.tarballUrl).trim() contentShasums[filename] = checksum log.verbose('content checksum', filename, checksum) }), tar.extract({ strip: 1, cwd: devDir, filter: isValid }) ) } catch (err) { // something went wrong downloading the tarball? if (err.code === 'ENOTFOUND') { throw new Error('This is most likely not a problem with node-gyp or the package itself and\n' + 'is related to network connectivity. In most cases you are behind a proxy or have bad \n' + 'network settings.') } throw err } } // invoked after the tarball has finished being extracted if (extractCount === 0) { throw new Error('There was a fatal problem while downloading/extracting the tarball') } log.verbose('tarball', 'done parsing tarball') const installVersionPath = path.resolve(devDir, 'installVersion') await Promise.all([ // need to download node.lib ...(win ? downloadNodeLib() : []), // write the "installVersion" file fs.promises.writeFile(installVersionPath, gyp.package.installVersion + '\n'), // Only download SHASUMS.txt if we downloaded something in need of SHA verification ...(!tarPath || win ? [downloadShasums()] : []) ]) log.verbose('download contents checksum', JSON.stringify(contentShasums)) // check content shasums for (const k in contentShasums) { log.verbose('validating download checksum for ' + k, '(%s == %s)', contentShasums[k], expectShasums[k]) if (contentShasums[k] !== expectShasums[k]) { throw new Error(k + ' local checksum ' + contentShasums[k] + ' not match remote ' + expectShasums[k]) } } async function downloadShasums () { log.verbose('check download content checksum, need to download `SHASUMS256.txt`...') log.verbose('checksum url', release.shasumsUrl) const res = await download(gyp, release.shasumsUrl) if (res.status !== 200) { throw new Error(`${res.status} status code downloading checksum`) } for (const line of (await res.text()).trim().split('\n')) { const items = line.trim().split(/\s+/) if (items.length !== 2) { return } // 0035d18e2dcf9aad669b1c7c07319e17abfe3762 ./node-v0.11.4.tar.gz const name = items[1].replace(/^\.\//, '') expectShasums[name] = items[0] } log.verbose('checksum data', JSON.stringify(expectShasums)) } function downloadNodeLib () { log.verbose('on Windows; need to download `' + release.name + '.lib`...') const archs = ['ia32', 'x64', 'arm64'] return archs.map(async (arch) => { const dir = path.resolve(devDir, arch) const targetLibPath = path.resolve(dir, release.name + '.lib') const { libUrl, libPath } = release[arch] const name = `${arch} ${release.name}.lib` log.verbose(name, 'dir', dir) log.verbose(name, 'url', libUrl) await fs.promises.mkdir(dir, { recursive: true }) log.verbose('streaming', name, 'to:', targetLibPath) const res = await download(gyp, libUrl) if (res.status === 403 || res.status === 404) { if (arch === 'arm64') { // Arm64 is a newer platform on Windows and not all node distributions provide it. log.verbose(`${name} was not found in ${libUrl}`) } else { log.warn(`${name} was not found in ${libUrl}`) } return } else if (res.status !== 200) { throw new Error(`${res.status} status code downloading ${name}`) } return streamPipeline( res.body, new ShaSum((_, checksum) => { contentShasums[libPath] = checksum log.verbose('content checksum', libPath, checksum) }), fs.createWriteStream(targetLibPath) ) }) } // downloadNodeLib() } // go() /** * Checks if a given filename is "valid" for this installation. */ function valid (file) { // header files const extname = path.extname(file) return extname === '.h' || extname === '.gypi' } async function rollback (err) { log.warn('install', 'got an error, rolling back install') // roll-back the install if anything went wrong await util.promisify(gyp.commands.remove)([release.versionDir]) throw err } /** * The EACCES fallback is a workaround for npm's `sudo` behavior, where * it drops the permissions before invoking any child processes (like * node-gyp). So what happens is the "nobody" user doesn't have * permission to create the dev dir. As a fallback, make the tmpdir() be * the dev dir for this installation. This is not ideal, but at least * the compilation will succeed... */ async function eaccesFallback (err) { const noretry = '--node_gyp_internal_noretry' if (argv.indexOf(noretry) !== -1) { throw err } const tmpdir = os.tmpdir() gyp.devDir = path.resolve(tmpdir, '.node-gyp') let userString = '' try { // os.userInfo can fail on some systems, it's not critical here userString = ` ("${os.userInfo().username}")` } catch (e) {} log.warn('EACCES', 'current user%s does not have permission to access the dev dir "%s"', userString, devDir) log.warn('EACCES', 'attempting to reinstall using temporary dev dir "%s"', gyp.devDir) if (process.cwd() === tmpdir) { log.verbose('tmpdir == cwd', 'automatically will remove dev files after to save disk space') gyp.todo.push({ name: 'remove', args: argv }) } return util.promisify(gyp.commands.install)([noretry].concat(argv)) } } class ShaSum extends stream.Transform { constructor (callback) { super() this._callback = callback this._digester = crypto.createHash('sha256') } _transform (chunk, _, callback) { this._digester.update(chunk) callback(null, chunk) } _flush (callback) { this._callback(null, this._digester.digest('hex')) callback() } } async function download (gyp, url) { log.http('GET', url) const requestOpts = { headers: { 'User-Agent': `node-gyp v${gyp.version} (node ${process.version})`, Connection: 'keep-alive' }, proxy: gyp.opts.proxy, noProxy: gyp.opts.noproxy } const cafile = gyp.opts.cafile if (cafile) { requestOpts.ca = await readCAFile(cafile) } const res = await fetch(url, requestOpts) log.http(res.status, res.url) return res } async function readCAFile (filename) { // The CA file can contain multiple certificates so split on certificate // boundaries. [\S\s]*? is used to match everything including newlines. const ca = await fs.promises.readFile(filename, 'utf8') const re = /(-----BEGIN CERTIFICATE-----[\S\s]*?-----END CERTIFICATE-----)/g return ca.match(re) } module.exports = function (gyp, argv, callback) { install(fs, gyp, argv).then(callback.bind(undefined, null), callback) } module.exports.test = { download, install, readCAFile } module.exports.usage = 'Install node development files for the specified node version.' 'use strict' const fs = require('graceful-fs') const log = require('npmlog') function list (gyp, args, callback) { var devDir = gyp.devDir log.verbose('list', 'using node-gyp dir:', devDir) fs.readdir(devDir, onreaddir) function onreaddir (err, versions) { if (err && err.code !== 'ENOENT') { return callback(err) } if (Array.isArray(versions)) { versions = versions.filter(function (v) { return v !== 'current' }) } else { versions = [] } callback(null, versions) } } module.exports = list module.exports.usage = 'Prints a listing of the currently installed node development files' 'use strict' const path = require('path') const nopt = require('nopt') const log = require('npmlog') const childProcess = require('child_process') const EE = require('events').EventEmitter const inherits = require('util').inherits const commands = [ // Module build commands 'build', 'clean', 'configure', 'rebuild', // Development Header File management commands 'install', 'list', 'remove' ] const aliases = { ls: 'list', rm: 'remove' } // differentiate node-gyp's logs from npm's log.heading = 'gyp' function gyp () { return new Gyp() } function Gyp () { var self = this this.devDir = '' this.commands = {} commands.forEach(function (command) { self.commands[command] = function (argv, callback) { log.verbose('command', command, argv) return require('./' + command)(self, argv, callback) } }) } inherits(Gyp, EE) exports.Gyp = Gyp var proto = Gyp.prototype /** * Export the contents of the package.json. */ proto.package = require('../package.json') /** * nopt configuration definitions */ proto.configDefs = { help: Boolean, // everywhere arch: String, // 'configure' cafile: String, // 'install' debug: Boolean, // 'build' directory: String, // bin make: String, // 'build' msvs_version: String, // 'configure' ensure: Boolean, // 'install' solution: String, // 'build' (windows only) proxy: String, // 'install' noproxy: String, // 'install' devdir: String, // everywhere nodedir: String, // 'configure' loglevel: String, // everywhere python: String, // 'configure' 'dist-url': String, // 'install' tarball: String, // 'install' jobs: String, // 'build' thin: String, // 'configure' 'force-process-config': Boolean // 'configure' } /** * nopt shorthands */ proto.shorthands = { release: '--no-debug', C: '--directory', debug: '--debug', j: '--jobs', silly: '--loglevel=silly', verbose: '--loglevel=verbose', silent: '--loglevel=silent' } /** * expose the command aliases for the bin file to use. */ proto.aliases = aliases /** * Parses the given argv array and sets the 'opts', * 'argv' and 'command' properties. */ proto.parseArgv = function parseOpts (argv) { this.opts = nopt(this.configDefs, this.shorthands, argv) this.argv = this.opts.argv.remain.slice() var commands = this.todo = [] // create a copy of the argv array with aliases mapped argv = this.argv.map(function (arg) { // is this an alias? if (arg in this.aliases) { arg = this.aliases[arg] } return arg }, this) // process the mapped args into "command" objects ("name" and "args" props) argv.slice().forEach(function (arg) { if (arg in this.commands) { var args = argv.splice(0, argv.indexOf(arg)) argv.shift() if (commands.length > 0) { commands[commands.length - 1].args = args } commands.push({ name: arg, args: [] }) } }, this) if (commands.length > 0) { commands[commands.length - 1].args = argv.splice(0) } // support for inheriting config env variables from npm var npmConfigPrefix = 'npm_config_' Object.keys(process.env).forEach(function (name) { if (name.indexOf(npmConfigPrefix) !== 0) { return } var val = process.env[name] if (name === npmConfigPrefix + 'loglevel') { log.level = val } else { // add the user-defined options to the config name = name.substring(npmConfigPrefix.length) // gyp@741b7f1 enters an infinite loop when it encounters // zero-length options so ensure those don't get through. if (name) { // convert names like force_process_config to force-process-config if (name.includes('_')) { name = name.replace(/_/g, '-') } this.opts[name] = val } } }, this) if (this.opts.loglevel) { log.level = this.opts.loglevel } log.resume() } /** * Spawns a child process and emits a 'spawn' event. */ proto.spawn = function spawn (command, args, opts) { if (!opts) { opts = {} } if (!opts.silent && !opts.stdio) { opts.stdio = [0, 1, 2] } var cp = childProcess.spawn(command, args, opts) log.info('spawn', command) log.info('spawn args', args) return cp } /** * Returns the usage instructions for node-gyp. */ proto.usage = function usage () { var str = [ '', ' Usage: node-gyp [options]', '', ' where is one of:', commands.map(function (c) { return ' - ' + c + ' - ' + require('./' + c).usage }).join('\n'), '', 'node-gyp@' + this.version + ' ' + path.resolve(__dirname, '..'), 'node@' + process.versions.node ].join('\n') return str } /** * Version number getter. */ Object.defineProperty(proto, 'version', { get: function () { return this.package.version }, enumerable: true }) module.exports = exports = gyp /* eslint-disable node/no-deprecated-api */ 'use strict' const semver = require('semver') const url = require('url') const path = require('path') const log = require('npmlog') // versions where -headers.tar.gz started shipping const headersTarballRange = '>= 3.0.0 || ~0.12.10 || ~0.10.42' const bitsre = /\/win-(x86|x64|arm64)\// const bitsreV3 = /\/win-(x86|ia32|x64)\// // io.js v3.x.x shipped with "ia32" but should // have been "x86" // Captures all the logic required to determine download URLs, local directory and // file names. Inputs come from command-line switches (--target, --dist-url), // `process.version` and `process.release` where it exists. function processRelease (argv, gyp, defaultVersion, defaultRelease) { var version = (semver.valid(argv[0]) && argv[0]) || gyp.opts.target || defaultVersion var versionSemver = semver.parse(version) var overrideDistUrl = gyp.opts['dist-url'] || gyp.opts.disturl var isDefaultVersion var isNamedForLegacyIojs var name var distBaseUrl var baseUrl var libUrl32 var libUrl64 var libUrlArm64 var tarballUrl var canGetHeaders if (!versionSemver) { // not a valid semver string, nothing we can do return { version: version } } // flatten version into String version = versionSemver.version // defaultVersion should come from process.version so ought to be valid semver isDefaultVersion = version === semver.parse(defaultVersion).version // can't use process.release if we're using --target=x.y.z if (!isDefaultVersion) { defaultRelease = null } if (defaultRelease) { // v3 onward, has process.release name = defaultRelease.name.replace(/io\.js/, 'iojs') // remove the '.' for directory naming purposes } else { // old node or alternative --target= // semver.satisfies() doesn't like prerelease tags so test major directly isNamedForLegacyIojs = versionSemver.major >= 1 && versionSemver.major < 4 // isNamedForLegacyIojs is required to support Electron < 4 (in particular Electron 3) // as previously this logic was used to ensure "iojs" was used to download iojs releases // and "node" for node releases. Unfortunately the logic was broad enough that electron@3 // published release assets as "iojs" so that the node-gyp logic worked. Once Electron@3 has // been EOL for a while (late 2019) we should remove this hack. name = isNamedForLegacyIojs ? 'iojs' : 'node' } // check for the nvm.sh standard mirror env variables if (!overrideDistUrl && process.env.NODEJS_ORG_MIRROR) { overrideDistUrl = process.env.NODEJS_ORG_MIRROR } if (overrideDistUrl) { log.verbose('download', 'using dist-url', overrideDistUrl) } if (overrideDistUrl) { distBaseUrl = overrideDistUrl.replace(/\/+$/, '') } else { distBaseUrl = 'https://nodejs.org/dist' } distBaseUrl += '/v' + version + '/' // new style, based on process.release so we have a lot of the data we need if (defaultRelease && defaultRelease.headersUrl && !overrideDistUrl) { baseUrl = url.resolve(defaultRelease.headersUrl, './') libUrl32 = resolveLibUrl(name, defaultRelease.libUrl || baseUrl || distBaseUrl, 'x86', versionSemver.major) libUrl64 = resolveLibUrl(name, defaultRelease.libUrl || baseUrl || distBaseUrl, 'x64', versionSemver.major) libUrlArm64 = resolveLibUrl(name, defaultRelease.libUrl || baseUrl || distBaseUrl, 'arm64', versionSemver.major) tarballUrl = defaultRelease.headersUrl } else { // older versions without process.release are captured here and we have to make // a lot of assumptions, additionally if you --target=x.y.z then we can't use the // current process.release baseUrl = distBaseUrl libUrl32 = resolveLibUrl(name, baseUrl, 'x86', versionSemver.major) libUrl64 = resolveLibUrl(name, baseUrl, 'x64', versionSemver.major) libUrlArm64 = resolveLibUrl(name, baseUrl, 'arm64', versionSemver.major) // making the bold assumption that anything with a version number >3.0.0 will // have a *-headers.tar.gz file in its dist location, even some frankenstein // custom version canGetHeaders = semver.satisfies(versionSemver, headersTarballRange) tarballUrl = url.resolve(baseUrl, name + '-v' + version + (canGetHeaders ? '-headers' : '') + '.tar.gz') } return { version: version, semver: versionSemver, name: name, baseUrl: baseUrl, tarballUrl: tarballUrl, shasumsUrl: url.resolve(baseUrl, 'SHASUMS256.txt'), versionDir: (name !== 'node' ? name + '-' : '') + version, ia32: { libUrl: libUrl32, libPath: normalizePath(path.relative(url.parse(baseUrl).path, url.parse(libUrl32).path)) }, x64: { libUrl: libUrl64, libPath: normalizePath(path.relative(url.parse(baseUrl).path, url.parse(libUrl64).path)) }, arm64: { libUrl: libUrlArm64, libPath: normalizePath(path.relative(url.parse(baseUrl).path, url.parse(libUrlArm64).path)) } } } function normalizePath (p) { return path.normalize(p).replace(/\\/g, '/') } function resolveLibUrl (name, defaultUrl, arch, versionMajor) { var base = url.resolve(defaultUrl, './') var hasLibUrl = bitsre.test(defaultUrl) || (versionMajor === 3 && bitsreV3.test(defaultUrl)) if (!hasLibUrl) { // let's assume it's a baseUrl then if (versionMajor >= 1) { return url.resolve(base, 'win-' + arch + '/' + name + '.lib') } // prior to io.js@1.0.0 32-bit node.lib lives in /, 64-bit lives in /x64/ return url.resolve(base, (arch === 'x86' ? '' : arch + '/') + name + '.lib') } // else we have a proper url to a .lib, just make sure it's the right arch return defaultUrl.replace(versionMajor === 3 ? bitsreV3 : bitsre, '/win-' + arch + '/') } module.exports = processRelease 'use strict' function rebuild (gyp, argv, callback) { gyp.todo.push( { name: 'clean', args: [] } , { name: 'configure', args: argv } , { name: 'build', args: [] } ) process.nextTick(callback) } module.exports = rebuild module.exports.usage = 'Runs "clean", "configure" and "build" all at once' 'use strict' const fs = require('fs') const rm = require('rimraf') const path = require('path') const log = require('npmlog') const semver = require('semver') function remove (gyp, argv, callback) { var devDir = gyp.devDir log.verbose('remove', 'using node-gyp dir:', devDir) // get the user-specified version to remove var version = argv[0] || gyp.opts.target log.verbose('remove', 'removing target version:', version) if (!version) { return callback(new Error('You must specify a version number to remove. Ex: "' + process.version + '"')) } var versionSemver = semver.parse(version) if (versionSemver) { // flatten the version Array into a String version = versionSemver.version } var versionPath = path.resolve(gyp.devDir, version) log.verbose('remove', 'removing development files for version:', version) // first check if its even installed fs.stat(versionPath, function (err) { if (err) { if (err.code === 'ENOENT') { callback(null, 'version was already uninstalled: ' + version) } else { callback(err) } return } // Go ahead and delete the dir rm(versionPath, callback) }) } module.exports = exports = remove module.exports.usage = 'Removes the node development files for the specified version' 'use strict' const log = require('npmlog') const execFile = require('child_process').execFile const path = require('path') function logWithPrefix (log, prefix) { function setPrefix (logFunction) { return (...args) => logFunction.apply(null, [ prefix, ...args ]) // eslint-disable-line } return { silly: setPrefix(log.silly), verbose: setPrefix(log.verbose), info: setPrefix(log.info), warn: setPrefix(log.warn), error: setPrefix(log.error) } } function regGetValue (key, value, addOpts, cb) { const outReValue = value.replace(/\W/g, '.') const outRe = new RegExp(`^\\s+${outReValue}\\s+REG_\\w+\\s+(\\S.*)$`, 'im') const reg = path.join(process.env.SystemRoot, 'System32', 'reg.exe') const regArgs = ['query', key, '/v', value].concat(addOpts) log.silly('reg', 'running', reg, regArgs) const child = execFile(reg, regArgs, { encoding: 'utf8' }, function (err, stdout, stderr) { log.silly('reg', 'reg.exe stdout = %j', stdout) if (err || stderr.trim() !== '') { log.silly('reg', 'reg.exe err = %j', err && (err.stack || err)) log.silly('reg', 'reg.exe stderr = %j', stderr) return cb(err, stderr) } const result = outRe.exec(stdout) if (!result) { log.silly('reg', 'error parsing stdout') return cb(new Error('Could not parse output of reg.exe')) } log.silly('reg', 'found: %j', result[1]) cb(null, result[1]) }) child.stdin.end() } function regSearchKeys (keys, value, addOpts, cb) { var i = 0 const search = () => { log.silly('reg-search', 'looking for %j in %j', value, keys[i]) regGetValue(keys[i], value, addOpts, (err, res) => { ++i if (err && i < keys.length) { return search() } cb(err, res) }) } search() } module.exports = { logWithPrefix: logWithPrefix, regGetValue: regGetValue, regSearchKeys: regSearchKeys } # Names should be added to this file like so: # Name or Organization Google Inc. <*@google.com> Bloomberg Finance L.P. <*@bloomberg.net> IBM Inc. <*@*.ibm.com> Yandex LLC <*@yandex-team.ru> Steven Knight Ryan Norton David J. Sankel Eric N. Vander Weele Tom Freudenberg Julien Brianceau Refael Ackermann Ujjwal Sharma #!/bin/sh # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. set -e base=$(dirname "$0") exec python "${base}/gyp_main.py" "$@" @rem Copyright (c) 2009 Google Inc. All rights reserved. @rem Use of this source code is governed by a BSD-style license that can be @rem found in the LICENSE file. @python "%~dp0gyp_main.py" %* #!/usr/bin/env python3 # Copyright (c) 2009 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import sys import subprocess def IsCygwin(): # Function copied from pylib/gyp/common.py try: out = subprocess.Popen( "uname", stdout=subprocess.PIPE, stderr=subprocess.STDOUT ) stdout, _ = out.communicate() return "CYGWIN" in stdout.decode("utf-8") except Exception: return False def UnixifyPath(path): try: if not IsCygwin(): return path out = subprocess.Popen( ["cygpath", "-u", path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT ) stdout, _ = out.communicate() return stdout.decode("utf-8") except Exception: return path # Make sure we're using the version of pylib in this repo, not one installed # elsewhere on the system. Also convert to Unix style path on Cygwin systems, # else the 'gyp' library will not be found path = UnixifyPath(sys.argv[0]) sys.path.insert(0, os.path.join(os.path.dirname(path), "pylib")) import gyp # noqa: E402 if __name__ == "__main__": sys.exit(gyp.script_main()) Copyright (c) 2020 Node.js contributors. All rights reserved. Copyright (c) 2009 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. flake8 pytest #!/usr/bin/env python3 # Copyright (c) 2009 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from os import path from setuptools import setup here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, "README.md")) as in_file: long_description = in_file.read() setup( name="gyp-next", version="0.10.0", description="A fork of the GYP build system for use in the Node.js projects", long_description=long_description, long_description_content_type="text/markdown", author="Node.js contributors", author_email="ryzokuken@disroot.org", url="https://github.com/nodejs/gyp-next", package_dir={"": "pylib"}, packages=["gyp", "gyp.generator"], entry_points={"console_scripts": ["gyp=gyp:script_main"]}, python_requires=">=3.6", classifiers=[ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", ], ) #!/usr/bin/env python3 # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """gyptest.py -- test runner for GYP tests.""" import argparse import os import platform import subprocess import sys import time def is_test_name(f): return f.startswith("gyptest") and f.endswith(".py") def find_all_gyptest_files(directory): result = [] for root, dirs, files in os.walk(directory): result.extend([os.path.join(root, f) for f in files if is_test_name(f)]) result.sort() return result def main(argv=None): if argv is None: argv = sys.argv parser = argparse.ArgumentParser() parser.add_argument("-a", "--all", action="store_true", help="run all tests") parser.add_argument("-C", "--chdir", action="store", help="change to directory") parser.add_argument( "-f", "--format", action="store", default="", help="run tests with the specified formats", ) parser.add_argument( "-G", "--gyp_option", action="append", default=[], help="Add -G options to the gyp command line", ) parser.add_argument( "-l", "--list", action="store_true", help="list available tests and exit" ) parser.add_argument( "-n", "--no-exec", action="store_true", help="no execute, just print the command line", ) parser.add_argument( "--path", action="append", default=[], help="additional $PATH directory" ) parser.add_argument( "-q", "--quiet", action="store_true", help="quiet, don't print anything unless there are failures", ) parser.add_argument( "-v", "--verbose", action="store_true", help="print configuration info and test results.", ) parser.add_argument("tests", nargs="*") args = parser.parse_args(argv[1:]) if args.chdir: os.chdir(args.chdir) if args.path: extra_path = [os.path.abspath(p) for p in args.path] extra_path = os.pathsep.join(extra_path) os.environ["PATH"] = extra_path + os.pathsep + os.environ["PATH"] if not args.tests: if not args.all: sys.stderr.write("Specify -a to get all tests.\n") return 1 args.tests = ["test"] tests = [] for arg in args.tests: if os.path.isdir(arg): tests.extend(find_all_gyptest_files(os.path.normpath(arg))) else: if not is_test_name(os.path.basename(arg)): print(arg, "is not a valid gyp test name.", file=sys.stderr) sys.exit(1) tests.append(arg) if args.list: for test in tests: print(test) sys.exit(0) os.environ["PYTHONPATH"] = os.path.abspath("test/lib") if args.verbose: print_configuration_info() if args.gyp_option and not args.quiet: print("Extra Gyp options: %s\n" % args.gyp_option) if args.format: format_list = args.format.split(",") else: format_list = { "aix5": ["make"], "freebsd7": ["make"], "freebsd8": ["make"], "openbsd5": ["make"], "cygwin": ["msvs"], "win32": ["msvs", "ninja"], "linux": ["make", "ninja"], "linux2": ["make", "ninja"], "linux3": ["make", "ninja"], # TODO: Re-enable xcode-ninja. # https://bugs.chromium.org/p/gyp/issues/detail?id=530 # 'darwin': ['make', 'ninja', 'xcode', 'xcode-ninja'], "darwin": ["make", "ninja", "xcode"], }[sys.platform] gyp_options = [] for option in args.gyp_option: gyp_options += ["-G", option] runner = Runner(format_list, tests, gyp_options, args.verbose) runner.run() if not args.quiet: runner.print_results() return 1 if runner.failures else 0 def print_configuration_info(): print("Test configuration:") if sys.platform == "darwin": sys.path.append(os.path.abspath("test/lib")) import TestMac print(f" Mac {platform.mac_ver()[0]} {platform.mac_ver()[2]}") print(f" Xcode {TestMac.Xcode.Version()}") elif sys.platform == "win32": sys.path.append(os.path.abspath("pylib")) import gyp.MSVSVersion print(" Win %s %s\n" % platform.win32_ver()[0:2]) print(" MSVS %s" % gyp.MSVSVersion.SelectVisualStudioVersion().Description()) elif sys.platform in ("linux", "linux2"): print(" Linux %s" % " ".join(platform.linux_distribution())) print(f" Python {platform.python_version()}") print(f" PYTHONPATH={os.environ['PYTHONPATH']}") print() class Runner: def __init__(self, formats, tests, gyp_options, verbose): self.formats = formats self.tests = tests self.verbose = verbose self.gyp_options = gyp_options self.failures = [] self.num_tests = len(formats) * len(tests) num_digits = len(str(self.num_tests)) self.fmt_str = "[%%%dd/%%%dd] (%%s) %%s" % (num_digits, num_digits) self.isatty = sys.stdout.isatty() and not self.verbose self.env = os.environ.copy() self.hpos = 0 def run(self): run_start = time.time() i = 1 for fmt in self.formats: for test in self.tests: self.run_test(test, fmt, i) i += 1 if self.isatty: self.erase_current_line() self.took = time.time() - run_start def run_test(self, test, fmt, i): if self.isatty: self.erase_current_line() msg = self.fmt_str % (i, self.num_tests, fmt, test) self.print_(msg) start = time.time() cmd = [sys.executable, test] + self.gyp_options self.env["TESTGYP_FORMAT"] = fmt proc = subprocess.Popen( cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=self.env ) proc.wait() took = time.time() - start stdout = proc.stdout.read().decode("utf8") if proc.returncode == 2: res = "skipped" elif proc.returncode: res = "failed" self.failures.append(f"({test}) {fmt}") else: res = "passed" res_msg = f" {res} {took:.3f}s" self.print_(res_msg) if stdout and not stdout.endswith(("PASSED\n", "NO RESULT\n")): print() print("\n".join(f" {line}" for line in stdout.splitlines())) elif not self.isatty: print() def print_(self, msg): print(msg, end="") index = msg.rfind("\n") if index == -1: self.hpos += len(msg) else: self.hpos = len(msg) - index sys.stdout.flush() def erase_current_line(self): print("\b" * self.hpos + " " * self.hpos + "\b" * self.hpos, end="") sys.stdout.flush() self.hpos = 0 def print_results(self): num_failures = len(self.failures) if num_failures: print() if num_failures == 1: print("Failed the following test:") else: print("Failed the following %d tests:" % num_failures) print("\t" + "\n\t".join(sorted(self.failures))) print() print( "Ran %d tests in %.3fs, %d failed." % (self.num_tests, self.took, num_failures) ) print() if __name__ == "__main__": sys.exit(main()) /* * When this file is linked to a DLL, it sets up a delay-load hook that * intervenes when the DLL is trying to load the host executable * dynamically. Instead of trying to locate the .exe file it'll just * return a handle to the process image. * * This allows compiled addons to work when the host executable is renamed. */ #ifdef _MSC_VER #pragma managed(push, off) #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include #include #include static FARPROC WINAPI load_exe_hook(unsigned int event, DelayLoadInfo* info) { HMODULE m; if (event != dliNotePreLoadLibrary) return NULL; if (_stricmp(info->szDll, HOST_BINARY) != 0) return NULL; m = GetModuleHandle(NULL); return (FARPROC) m; } decltype(__pfnDliNotifyHook2) __pfnDliNotifyHook2 = load_exe_hook; #pragma managed(pop) #endif #!/usr/bin/env python3 # Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Using the JSON dumped by the dump-dependency-json generator, generate input suitable for graphviz to render a dependency graph of targets.""" import collections import json import sys def ParseTarget(target): target, _, suffix = target.partition("#") filename, _, target = target.partition(":") return filename, target, suffix def LoadEdges(filename, targets): """Load the edges map from the dump file, and filter it to only show targets in |targets| and their depedendents.""" file = open("dump.json") edges = json.load(file) file.close() # Copy out only the edges we're interested in from the full edge list. target_edges = {} to_visit = targets[:] while to_visit: src = to_visit.pop() if src in target_edges: continue target_edges[src] = edges[src] to_visit.extend(edges[src]) return target_edges def WriteGraph(edges): """Print a graphviz graph to stdout. |edges| is a map of target to a list of other targets it depends on.""" # Bucket targets by file. files = collections.defaultdict(list) for src, dst in edges.items(): build_file, target_name, toolset = ParseTarget(src) files[build_file].append(src) print("digraph D {") print(" fontsize=8") # Used by subgraphs. print(" node [fontsize=8]") # Output nodes by file. We must first write out each node within # its file grouping before writing out any edges that may refer # to those nodes. for filename, targets in files.items(): if len(targets) == 1: # If there's only one node for this file, simplify # the display by making it a box without an internal node. target = targets[0] build_file, target_name, toolset = ParseTarget(target) print( f' "{target}" [shape=box, label="{filename}\\n{target_name}"]' ) else: # Group multiple nodes together in a subgraph. print(' subgraph "cluster_%s" {' % filename) print(' label = "%s"' % filename) for target in targets: build_file, target_name, toolset = ParseTarget(target) print(f' "{target}" [label="{target_name}"]') print(" }") # Now that we've placed all the nodes within subgraphs, output all # the edges between nodes. for src, dsts in edges.items(): for dst in dsts: print(f' "{src}" -> "{dst}"') print("}") def main(): if len(sys.argv) < 2: print(__doc__, file=sys.stderr) print(file=sys.stderr) print("usage: %s target1 target2..." % (sys.argv[0]), file=sys.stderr) return 1 edges = LoadEdges("dump.json", sys.argv[1:]) WriteGraph(edges) return 0 if __name__ == "__main__": sys.exit(main()) #!/usr/bin/env python3 # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Pretty-prints the contents of a GYP file.""" import sys import re # Regex to remove comments when we're counting braces. COMMENT_RE = re.compile(r"\s*#.*") # Regex to remove quoted strings when we're counting braces. # It takes into account quoted quotes, and makes sure that the quotes match. # NOTE: It does not handle quotes that span more than one line, or # cases where an escaped quote is preceded by an escaped backslash. QUOTE_RE_STR = r'(?P[\'"])(.*?)(? 0: after = True # This catches the special case of a closing brace having something # other than just whitespace ahead of it -- we don't want to # unindent that until after this line is printed so it stays with # the previous indentation level. if cnt < 0 and closing_prefix_re.match(stripline): after = True return (cnt, after) def prettyprint_input(lines): """Does the main work of indenting the input based on the brace counts.""" indent = 0 basic_offset = 2 for line in lines: if COMMENT_RE.match(line): print(line) else: line = line.strip("\r\n\t ") # Otherwise doesn't strip \r on Unix. if len(line) > 0: (brace_diff, after) = count_braces(line) if brace_diff != 0: if after: print(" " * (basic_offset * indent) + line) indent += brace_diff else: indent += brace_diff print(" " * (basic_offset * indent) + line) else: print(" " * (basic_offset * indent) + line) else: print("") def main(): if len(sys.argv) > 1: data = open(sys.argv[1]).read().splitlines() else: data = sys.stdin.read().splitlines() # Split up the double braces. lines = split_double_braces(data) # Indent and print the output. prettyprint_input(lines) return 0 if __name__ == "__main__": sys.exit(main()) #!/usr/bin/env python3 # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Prints the information in a sln file in a diffable way. It first outputs each projects in alphabetical order with their dependencies. Then it outputs a possible build order. """ import os import re import sys import pretty_vcproj __author__ = "nsylvain (Nicolas Sylvain)" def BuildProject(project, built, projects, deps): # if all dependencies are done, we can build it, otherwise we try to build the # dependency. # This is not infinite-recursion proof. for dep in deps[project]: if dep not in built: BuildProject(dep, built, projects, deps) print(project) built.append(project) def ParseSolution(solution_file): # All projects, their clsid and paths. projects = dict() # A list of dependencies associated with a project. dependencies = dict() # Regular expressions that matches the SLN format. # The first line of a project definition. begin_project = re.compile( r'^Project\("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942' r'}"\) = "(.*)", "(.*)", "(.*)"$' ) # The last line of a project definition. end_project = re.compile("^EndProject$") # The first line of a dependency list. begin_dep = re.compile(r"ProjectSection\(ProjectDependencies\) = postProject$") # The last line of a dependency list. end_dep = re.compile("EndProjectSection$") # A line describing a dependency. dep_line = re.compile(" *({.*}) = ({.*})$") in_deps = False solution = open(solution_file) for line in solution: results = begin_project.search(line) if results: # Hack to remove icu because the diff is too different. if results.group(1).find("icu") != -1: continue # We remove "_gyp" from the names because it helps to diff them. current_project = results.group(1).replace("_gyp", "") projects[current_project] = [ results.group(2).replace("_gyp", ""), results.group(3), results.group(2), ] dependencies[current_project] = [] continue results = end_project.search(line) if results: current_project = None continue results = begin_dep.search(line) if results: in_deps = True continue results = end_dep.search(line) if results: in_deps = False continue results = dep_line.search(line) if results and in_deps and current_project: dependencies[current_project].append(results.group(1)) continue # Change all dependencies clsid to name instead. for project in dependencies: # For each dependencies in this project new_dep_array = [] for dep in dependencies[project]: # Look for the project name matching this cldis for project_info in projects: if projects[project_info][1] == dep: new_dep_array.append(project_info) dependencies[project] = sorted(new_dep_array) return (projects, dependencies) def PrintDependencies(projects, deps): print("---------------------------------------") print("Dependencies for all projects") print("---------------------------------------") print("-- --") for (project, dep_list) in sorted(deps.items()): print("Project : %s" % project) print("Path : %s" % projects[project][0]) if dep_list: for dep in dep_list: print(" - %s" % dep) print("") print("-- --") def PrintBuildOrder(projects, deps): print("---------------------------------------") print("Build order ") print("---------------------------------------") print("-- --") built = [] for (project, _) in sorted(deps.items()): if project not in built: BuildProject(project, built, projects, deps) print("-- --") def PrintVCProj(projects): for project in projects: print("-------------------------------------") print("-------------------------------------") print(project) print(project) print(project) print("-------------------------------------") print("-------------------------------------") project_path = os.path.abspath( os.path.join(os.path.dirname(sys.argv[1]), projects[project][2]) ) pretty = pretty_vcproj argv = [ "", project_path, "$(SolutionDir)=%s\\" % os.path.dirname(sys.argv[1]), ] argv.extend(sys.argv[3:]) pretty.main(argv) def main(): # check if we have exactly 1 parameter. if len(sys.argv) < 2: print('Usage: %s "c:\\path\\to\\project.sln"' % sys.argv[0]) return 1 (projects, deps) = ParseSolution(sys.argv[1]) PrintDependencies(projects, deps) PrintBuildOrder(projects, deps) if "--recursive" in sys.argv: PrintVCProj(projects) return 0 if __name__ == "__main__": sys.exit(main()) #!/usr/bin/env python3 # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Make the format of a vcproj really pretty. This script normalize and sort an xml. It also fetches all the properties inside linked vsprops and include them explicitly in the vcproj. It outputs the resulting xml to stdout. """ import os import sys from xml.dom.minidom import parse from xml.dom.minidom import Node __author__ = "nsylvain (Nicolas Sylvain)" ARGUMENTS = None REPLACEMENTS = dict() def cmp(x, y): return (x > y) - (x < y) class CmpTuple: """Compare function between 2 tuple.""" def __call__(self, x, y): return cmp(x[0], y[0]) class CmpNode: """Compare function between 2 xml nodes.""" def __call__(self, x, y): def get_string(node): node_string = "node" node_string += node.nodeName if node.nodeValue: node_string += node.nodeValue if node.attributes: # We first sort by name, if present. node_string += node.getAttribute("Name") all_nodes = [] for (name, value) in node.attributes.items(): all_nodes.append((name, value)) all_nodes.sort(CmpTuple()) for (name, value) in all_nodes: node_string += name node_string += value return node_string return cmp(get_string(x), get_string(y)) def PrettyPrintNode(node, indent=0): if node.nodeType == Node.TEXT_NODE: if node.data.strip(): print("{}{}".format(" " * indent, node.data.strip())) return if node.childNodes: node.normalize() # Get the number of attributes attr_count = 0 if node.attributes: attr_count = node.attributes.length # Print the main tag if attr_count == 0: print("{}<{}>".format(" " * indent, node.nodeName)) else: print("{}<{}".format(" " * indent, node.nodeName)) all_attributes = [] for (name, value) in node.attributes.items(): all_attributes.append((name, value)) all_attributes.sort(CmpTuple()) for (name, value) in all_attributes: print('{} {}="{}"'.format(" " * indent, name, value)) print("%s>" % (" " * indent)) if node.nodeValue: print("{} {}".format(" " * indent, node.nodeValue)) for sub_node in node.childNodes: PrettyPrintNode(sub_node, indent=indent + 2) print("{}".format(" " * indent, node.nodeName)) def FlattenFilter(node): """Returns a list of all the node and sub nodes.""" node_list = [] if node.attributes and node.getAttribute("Name") == "_excluded_files": # We don't add the "_excluded_files" filter. return [] for current in node.childNodes: if current.nodeName == "Filter": node_list.extend(FlattenFilter(current)) else: node_list.append(current) return node_list def FixFilenames(filenames, current_directory): new_list = [] for filename in filenames: if filename: for key in REPLACEMENTS: filename = filename.replace(key, REPLACEMENTS[key]) os.chdir(current_directory) filename = filename.strip("\"' ") if filename.startswith("$"): new_list.append(filename) else: new_list.append(os.path.abspath(filename)) return new_list def AbsoluteNode(node): """Makes all the properties we know about in this node absolute.""" if node.attributes: for (name, value) in node.attributes.items(): if name in [ "InheritedPropertySheets", "RelativePath", "AdditionalIncludeDirectories", "IntermediateDirectory", "OutputDirectory", "AdditionalLibraryDirectories", ]: # We want to fix up these paths path_list = value.split(";") new_list = FixFilenames(path_list, os.path.dirname(ARGUMENTS[1])) node.setAttribute(name, ";".join(new_list)) if not value: node.removeAttribute(name) def CleanupVcproj(node): """For each sub node, we call recursively this function.""" for sub_node in node.childNodes: AbsoluteNode(sub_node) CleanupVcproj(sub_node) # Normalize the node, and remove all extraneous whitespaces. for sub_node in node.childNodes: if sub_node.nodeType == Node.TEXT_NODE: sub_node.data = sub_node.data.replace("\r", "") sub_node.data = sub_node.data.replace("\n", "") sub_node.data = sub_node.data.rstrip() # Fix all the semicolon separated attributes to be sorted, and we also # remove the dups. if node.attributes: for (name, value) in node.attributes.items(): sorted_list = sorted(value.split(";")) unique_list = [] for i in sorted_list: if not unique_list.count(i): unique_list.append(i) node.setAttribute(name, ";".join(unique_list)) if not value: node.removeAttribute(name) if node.childNodes: node.normalize() # For each node, take a copy, and remove it from the list. node_array = [] while node.childNodes and node.childNodes[0]: # Take a copy of the node and remove it from the list. current = node.childNodes[0] node.removeChild(current) # If the child is a filter, we want to append all its children # to this same list. if current.nodeName == "Filter": node_array.extend(FlattenFilter(current)) else: node_array.append(current) # Sort the list. node_array.sort(CmpNode()) # Insert the nodes in the correct order. for new_node in node_array: # But don't append empty tool node. if new_node.nodeName == "Tool": if new_node.attributes and new_node.attributes.length == 1: # This one was empty. continue if new_node.nodeName == "UserMacro": continue node.appendChild(new_node) def GetConfiguationNodes(vcproj): # TODO(nsylvain): Find a better way to navigate the xml. nodes = [] for node in vcproj.childNodes: if node.nodeName == "Configurations": for sub_node in node.childNodes: if sub_node.nodeName == "Configuration": nodes.append(sub_node) return nodes def GetChildrenVsprops(filename): dom = parse(filename) if dom.documentElement.attributes: vsprops = dom.documentElement.getAttribute("InheritedPropertySheets") return FixFilenames(vsprops.split(";"), os.path.dirname(filename)) return [] def SeekToNode(node1, child2): # A text node does not have properties. if child2.nodeType == Node.TEXT_NODE: return None # Get the name of the current node. current_name = child2.getAttribute("Name") if not current_name: # There is no name. We don't know how to merge. return None # Look through all the nodes to find a match. for sub_node in node1.childNodes: if sub_node.nodeName == child2.nodeName: name = sub_node.getAttribute("Name") if name == current_name: return sub_node # No match. We give up. return None def MergeAttributes(node1, node2): # No attributes to merge? if not node2.attributes: return for (name, value2) in node2.attributes.items(): # Don't merge the 'Name' attribute. if name == "Name": continue value1 = node1.getAttribute(name) if value1: # The attribute exist in the main node. If it's equal, we leave it # untouched, otherwise we concatenate it. if value1 != value2: node1.setAttribute(name, ";".join([value1, value2])) else: # The attribute does not exist in the main node. We append this one. node1.setAttribute(name, value2) # If the attribute was a property sheet attributes, we remove it, since # they are useless. if name == "InheritedPropertySheets": node1.removeAttribute(name) def MergeProperties(node1, node2): MergeAttributes(node1, node2) for child2 in node2.childNodes: child1 = SeekToNode(node1, child2) if child1: MergeProperties(child1, child2) else: node1.appendChild(child2.cloneNode(True)) def main(argv): """Main function of this vcproj prettifier.""" global ARGUMENTS ARGUMENTS = argv # check if we have exactly 1 parameter. if len(argv) < 2: print( 'Usage: %s "c:\\path\\to\\vcproj.vcproj" [key1=value1] ' "[key2=value2]" % argv[0] ) return 1 # Parse the keys for i in range(2, len(argv)): (key, value) = argv[i].split("=") REPLACEMENTS[key] = value # Open the vcproj and parse the xml. dom = parse(argv[1]) # First thing we need to do is find the Configuration Node and merge them # with the vsprops they include. for configuration_node in GetConfiguationNodes(dom.documentElement): # Get the property sheets associated with this configuration. vsprops = configuration_node.getAttribute("InheritedPropertySheets") # Fix the filenames to be absolute. vsprops_list = FixFilenames( vsprops.strip().split(";"), os.path.dirname(argv[1]) ) # Extend the list of vsprops with all vsprops contained in the current # vsprops. for current_vsprops in vsprops_list: vsprops_list.extend(GetChildrenVsprops(current_vsprops)) # Now that we have all the vsprops, we need to merge them. for current_vsprops in vsprops_list: MergeProperties(configuration_node, parse(current_vsprops).documentElement) # Now that everything is merged, we need to cleanup the xml. CleanupVcproj(dom.documentElement) # Finally, we use the prett xml function to print the vcproj back to the # user. # print dom.toprettyxml(newl="\n") PrettyPrintNode(dom.documentElement) return 0 if __name__ == "__main__": sys.exit(main(sys.argv)) pretty_vcproj: Usage: pretty_vcproj.py "c:\path\to\vcproj.vcproj" [key1=value1] [key2=value2] They key/value pair are used to resolve vsprops name. For example, if I want to diff the base.vcproj project: pretty_vcproj.py z:\dev\src-chrome\src\base\build\base.vcproj "$(SolutionDir)=z:\dev\src-chrome\src\chrome\\" "$(CHROMIUM_BUILD)=" "$(CHROME_BUILD_TYPE)=" > original.txt pretty_vcproj.py z:\dev\src-chrome\src\base\base_gyp.vcproj "$(SolutionDir)=z:\dev\src-chrome\src\chrome\\" "$(CHROMIUM_BUILD)=" "$(CHROME_BUILD_TYPE)=" > gyp.txt And you can use your favorite diff tool to see the changes. Note: In the case of base.vcproj, the original vcproj is one level up the generated one. I suggest you do a search and replace for '"..\' and replace it with '"' in original.txt before you perform the diff.## 7.0 - Raise error if `options.cwd` is specified, and not a directory ## 6.0 - Remove comment and negation pattern support - Ignore patterns are always in `dot:true` mode ## 5.0 - Deprecate comment and negation patterns - Fix regression in `mark` and `nodir` options from making all cache keys absolute path. - Abort if `fs.readdir` returns an error that's unexpected - Don't emit `match` events for ignored items - Treat ENOTSUP like ENOTDIR in readdir ## 4.5 - Add `options.follow` to always follow directory symlinks in globstar - Add `options.realpath` to call `fs.realpath` on all results - Always cache based on absolute path ## 4.4 - Add `options.ignore` - Fix handling of broken symlinks ## 4.3 - Bump minimatch to 2.x - Pass all tests on Windows ## 4.2 - Add `glob.hasMagic` function - Add `options.nodir` flag ## 4.1 - Refactor sync and async implementations for performance - Throw if callback provided to sync glob function - Treat symbolic links in globstar results the same as Bash 4.3 ## 4.0 - Use `^` for dependency versions (bumped major because this breaks older npm versions) - Ensure callbacks are only ever called once - switch to ISC license ## 3.x - Rewrite in JavaScript - Add support for setting root, cwd, and windows support - Cache many fs calls - Add globstar support - emit match events ## 2.x - Use `glob.h` and `fnmatch.h` from NetBSD ## 1.x - `glob.h` static binding. exports.alphasort = alphasort exports.alphasorti = alphasorti exports.setopts = setopts exports.ownProp = ownProp exports.makeAbs = makeAbs exports.finish = finish exports.mark = mark exports.isIgnored = isIgnored exports.childrenIgnored = childrenIgnored function ownProp (obj, field) { return Object.prototype.hasOwnProperty.call(obj, field) } var path = require("path") var minimatch = require("minimatch") var isAbsolute = require("path-is-absolute") var Minimatch = minimatch.Minimatch function alphasorti (a, b) { return a.toLowerCase().localeCompare(b.toLowerCase()) } function alphasort (a, b) { return a.localeCompare(b) } function setupIgnores (self, options) { self.ignore = options.ignore || [] if (!Array.isArray(self.ignore)) self.ignore = [self.ignore] if (self.ignore.length) { self.ignore = self.ignore.map(ignoreMap) } } // ignore patterns are always in dot:true mode. function ignoreMap (pattern) { var gmatcher = null if (pattern.slice(-3) === '/**') { var gpattern = pattern.replace(/(\/\*\*)+$/, '') gmatcher = new Minimatch(gpattern, { dot: true }) } return { matcher: new Minimatch(pattern, { dot: true }), gmatcher: gmatcher } } function setopts (self, pattern, options) { if (!options) options = {} // base-matching: just use globstar for that. if (options.matchBase && -1 === pattern.indexOf("/")) { if (options.noglobstar) { throw new Error("base matching requires globstar") } pattern = "**/" + pattern } self.silent = !!options.silent self.pattern = pattern self.strict = options.strict !== false self.realpath = !!options.realpath self.realpathCache = options.realpathCache || Object.create(null) self.follow = !!options.follow self.dot = !!options.dot self.mark = !!options.mark self.nodir = !!options.nodir if (self.nodir) self.mark = true self.sync = !!options.sync self.nounique = !!options.nounique self.nonull = !!options.nonull self.nosort = !!options.nosort self.nocase = !!options.nocase self.stat = !!options.stat self.noprocess = !!options.noprocess self.absolute = !!options.absolute self.maxLength = options.maxLength || Infinity self.cache = options.cache || Object.create(null) self.statCache = options.statCache || Object.create(null) self.symlinks = options.symlinks || Object.create(null) setupIgnores(self, options) self.changedCwd = false var cwd = process.cwd() if (!ownProp(options, "cwd")) self.cwd = cwd else { self.cwd = path.resolve(options.cwd) self.changedCwd = self.cwd !== cwd } self.root = options.root || path.resolve(self.cwd, "/") self.root = path.resolve(self.root) if (process.platform === "win32") self.root = self.root.replace(/\\/g, "/") // TODO: is an absolute `cwd` supposed to be resolved against `root`? // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) if (process.platform === "win32") self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") self.nomount = !!options.nomount // disable comments and negation in Minimatch. // Note that they are not supported in Glob itself anyway. options.nonegate = true options.nocomment = true self.minimatch = new Minimatch(pattern, options) self.options = self.minimatch.options } function finish (self) { var nou = self.nounique var all = nou ? [] : Object.create(null) for (var i = 0, l = self.matches.length; i < l; i ++) { var matches = self.matches[i] if (!matches || Object.keys(matches).length === 0) { if (self.nonull) { // do like the shell, and spit out the literal glob var literal = self.minimatch.globSet[i] if (nou) all.push(literal) else all[literal] = true } } else { // had matches var m = Object.keys(matches) if (nou) all.push.apply(all, m) else m.forEach(function (m) { all[m] = true }) } } if (!nou) all = Object.keys(all) if (!self.nosort) all = all.sort(self.nocase ? alphasorti : alphasort) // at *some* point we statted all of these if (self.mark) { for (var i = 0; i < all.length; i++) { all[i] = self._mark(all[i]) } if (self.nodir) { all = all.filter(function (e) { var notDir = !(/\/$/.test(e)) var c = self.cache[e] || self.cache[makeAbs(self, e)] if (notDir && c) notDir = c !== 'DIR' && !Array.isArray(c) return notDir }) } } if (self.ignore.length) all = all.filter(function(m) { return !isIgnored(self, m) }) self.found = all } function mark (self, p) { var abs = makeAbs(self, p) var c = self.cache[abs] var m = p if (c) { var isDir = c === 'DIR' || Array.isArray(c) var slash = p.slice(-1) === '/' if (isDir && !slash) m += '/' else if (!isDir && slash) m = m.slice(0, -1) if (m !== p) { var mabs = makeAbs(self, m) self.statCache[mabs] = self.statCache[abs] self.cache[mabs] = self.cache[abs] } } return m } // lotta situps... function makeAbs (self, f) { var abs = f if (f.charAt(0) === '/') { abs = path.join(self.root, f) } else if (isAbsolute(f) || f === '') { abs = f } else if (self.changedCwd) { abs = path.resolve(self.cwd, f) } else { abs = path.resolve(f) } if (process.platform === 'win32') abs = abs.replace(/\\/g, '/') return abs } // Return true, if pattern ends with globstar '**', for the accompanying parent directory. // Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents function isIgnored (self, path) { if (!self.ignore.length) return false return self.ignore.some(function(item) { return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) }) } function childrenIgnored (self, path) { if (!self.ignore.length) return false return self.ignore.some(function(item) { return !!(item.gmatcher && item.gmatcher.match(path)) }) } // Approach: // // 1. Get the minimatch set // 2. For each pattern in the set, PROCESS(pattern, false) // 3. Store matches per-set, then uniq them // // PROCESS(pattern, inGlobStar) // Get the first [n] items from pattern that are all strings // Join these together. This is PREFIX. // If there is no more remaining, then stat(PREFIX) and // add to matches if it succeeds. END. // // If inGlobStar and PREFIX is symlink and points to dir // set ENTRIES = [] // else readdir(PREFIX) as ENTRIES // If fail, END // // with ENTRIES // If pattern[n] is GLOBSTAR // // handle the case where the globstar match is empty // // by pruning it out, and testing the resulting pattern // PROCESS(pattern[0..n] + pattern[n+1 .. $], false) // // handle other cases. // for ENTRY in ENTRIES (not dotfiles) // // attach globstar + tail onto the entry // // Mark that this entry is a globstar match // PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) // // else // not globstar // for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) // Test ENTRY against pattern[n] // If fails, continue // If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) // // Caveat: // Cache all stats and readdirs results to minimize syscall. Since all // we ever care about is existence and directory-ness, we can just keep // `true` for files, and [children,...] for directories, or `false` for // things that don't exist. module.exports = glob var fs = require('fs') var rp = require('fs.realpath') var minimatch = require('minimatch') var Minimatch = minimatch.Minimatch var inherits = require('inherits') var EE = require('events').EventEmitter var path = require('path') var assert = require('assert') var isAbsolute = require('path-is-absolute') var globSync = require('./sync.js') var common = require('./common.js') var alphasort = common.alphasort var alphasorti = common.alphasorti var setopts = common.setopts var ownProp = common.ownProp var inflight = require('inflight') var util = require('util') var childrenIgnored = common.childrenIgnored var isIgnored = common.isIgnored var once = require('once') function glob (pattern, options, cb) { if (typeof options === 'function') cb = options, options = {} if (!options) options = {} if (options.sync) { if (cb) throw new TypeError('callback provided to sync glob') return globSync(pattern, options) } return new Glob(pattern, options, cb) } glob.sync = globSync var GlobSync = glob.GlobSync = globSync.GlobSync // old api surface glob.glob = glob function extend (origin, add) { if (add === null || typeof add !== 'object') { return origin } var keys = Object.keys(add) var i = keys.length while (i--) { origin[keys[i]] = add[keys[i]] } return origin } glob.hasMagic = function (pattern, options_) { var options = extend({}, options_) options.noprocess = true var g = new Glob(pattern, options) var set = g.minimatch.set if (!pattern) return false if (set.length > 1) return true for (var j = 0; j < set[0].length; j++) { if (typeof set[0][j] !== 'string') return true } return false } glob.Glob = Glob inherits(Glob, EE) function Glob (pattern, options, cb) { if (typeof options === 'function') { cb = options options = null } if (options && options.sync) { if (cb) throw new TypeError('callback provided to sync glob') return new GlobSync(pattern, options) } if (!(this instanceof Glob)) return new Glob(pattern, options, cb) setopts(this, pattern, options) this._didRealPath = false // process each pattern in the minimatch set var n = this.minimatch.set.length // The matches are stored as {: true,...} so that // duplicates are automagically pruned. // Later, we do an Object.keys() on these. // Keep them as a list so we can fill in when nonull is set. this.matches = new Array(n) if (typeof cb === 'function') { cb = once(cb) this.on('error', cb) this.on('end', function (matches) { cb(null, matches) }) } var self = this this._processing = 0 this._emitQueue = [] this._processQueue = [] this.paused = false if (this.noprocess) return this if (n === 0) return done() var sync = true for (var i = 0; i < n; i ++) { this._process(this.minimatch.set[i], i, false, done) } sync = false function done () { --self._processing if (self._processing <= 0) { if (sync) { process.nextTick(function () { self._finish() }) } else { self._finish() } } } } Glob.prototype._finish = function () { assert(this instanceof Glob) if (this.aborted) return if (this.realpath && !this._didRealpath) return this._realpath() common.finish(this) this.emit('end', this.found) } Glob.prototype._realpath = function () { if (this._didRealpath) return this._didRealpath = true var n = this.matches.length if (n === 0) return this._finish() var self = this for (var i = 0; i < this.matches.length; i++) this._realpathSet(i, next) function next () { if (--n === 0) self._finish() } } Glob.prototype._realpathSet = function (index, cb) { var matchset = this.matches[index] if (!matchset) return cb() var found = Object.keys(matchset) var self = this var n = found.length if (n === 0) return cb() var set = this.matches[index] = Object.create(null) found.forEach(function (p, i) { // If there's a problem with the stat, then it means that // one or more of the links in the realpath couldn't be // resolved. just return the abs value in that case. p = self._makeAbs(p) rp.realpath(p, self.realpathCache, function (er, real) { if (!er) set[real] = true else if (er.syscall === 'stat') set[p] = true else self.emit('error', er) // srsly wtf right here if (--n === 0) { self.matches[index] = set cb() } }) }) } Glob.prototype._mark = function (p) { return common.mark(this, p) } Glob.prototype._makeAbs = function (f) { return common.makeAbs(this, f) } Glob.prototype.abort = function () { this.aborted = true this.emit('abort') } Glob.prototype.pause = function () { if (!this.paused) { this.paused = true this.emit('pause') } } Glob.prototype.resume = function () { if (this.paused) { this.emit('resume') this.paused = false if (this._emitQueue.length) { var eq = this._emitQueue.slice(0) this._emitQueue.length = 0 for (var i = 0; i < eq.length; i ++) { var e = eq[i] this._emitMatch(e[0], e[1]) } } if (this._processQueue.length) { var pq = this._processQueue.slice(0) this._processQueue.length = 0 for (var i = 0; i < pq.length; i ++) { var p = pq[i] this._processing-- this._process(p[0], p[1], p[2], p[3]) } } } } Glob.prototype._process = function (pattern, index, inGlobStar, cb) { assert(this instanceof Glob) assert(typeof cb === 'function') if (this.aborted) return this._processing++ if (this.paused) { this._processQueue.push([pattern, index, inGlobStar, cb]) return } //console.error('PROCESS %d', this._processing, pattern) // Get the first [n] parts of pattern that are all strings. var n = 0 while (typeof pattern[n] === 'string') { n ++ } // now n is the index of the first one that is *not* a string. // see if there's anything else var prefix switch (n) { // if not, then this is rather simple case pattern.length: this._processSimple(pattern.join('/'), index, cb) return case 0: // pattern *starts* with some non-trivial item. // going to readdir(cwd), but not include the prefix in matches. prefix = null break default: // pattern has some string bits in the front. // whatever it starts with, whether that's 'absolute' like /foo/bar, // or 'relative' like '../baz' prefix = pattern.slice(0, n).join('/') break } var remain = pattern.slice(n) // get the list of entries. var read if (prefix === null) read = '.' else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { if (!prefix || !isAbsolute(prefix)) prefix = '/' + prefix read = prefix } else read = prefix var abs = this._makeAbs(read) //if ignored, skip _processing if (childrenIgnored(this, read)) return cb() var isGlobStar = remain[0] === minimatch.GLOBSTAR if (isGlobStar) this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) else this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) } Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { var self = this this._readdir(abs, inGlobStar, function (er, entries) { return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) }) } Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { // if the abs isn't a dir, then nothing can match! if (!entries) return cb() // It will only match dot entries if it starts with a dot, or if // dot is set. Stuff like @(.foo|.bar) isn't allowed. var pn = remain[0] var negate = !!this.minimatch.negate var rawGlob = pn._glob var dotOk = this.dot || rawGlob.charAt(0) === '.' var matchedEntries = [] for (var i = 0; i < entries.length; i++) { var e = entries[i] if (e.charAt(0) !== '.' || dotOk) { var m if (negate && !prefix) { m = !e.match(pn) } else { m = e.match(pn) } if (m) matchedEntries.push(e) } } //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) var len = matchedEntries.length // If there are no matched entries, then nothing matches. if (len === 0) return cb() // if this is the last remaining pattern bit, then no need for // an additional stat *unless* the user has specified mark or // stat explicitly. We know they exist, since readdir returned // them. if (remain.length === 1 && !this.mark && !this.stat) { if (!this.matches[index]) this.matches[index] = Object.create(null) for (var i = 0; i < len; i ++) { var e = matchedEntries[i] if (prefix) { if (prefix !== '/') e = prefix + '/' + e else e = prefix + e } if (e.charAt(0) === '/' && !this.nomount) { e = path.join(this.root, e) } this._emitMatch(index, e) } // This was the last one, and no stats were needed return cb() } // now test all matched entries as stand-ins for that part // of the pattern. remain.shift() for (var i = 0; i < len; i ++) { var e = matchedEntries[i] var newPattern if (prefix) { if (prefix !== '/') e = prefix + '/' + e else e = prefix + e } this._process([e].concat(remain), index, inGlobStar, cb) } cb() } Glob.prototype._emitMatch = function (index, e) { if (this.aborted) return if (isIgnored(this, e)) return if (this.paused) { this._emitQueue.push([index, e]) return } var abs = isAbsolute(e) ? e : this._makeAbs(e) if (this.mark) e = this._mark(e) if (this.absolute) e = abs if (this.matches[index][e]) return if (this.nodir) { var c = this.cache[abs] if (c === 'DIR' || Array.isArray(c)) return } this.matches[index][e] = true var st = this.statCache[abs] if (st) this.emit('stat', e, st) this.emit('match', e) } Glob.prototype._readdirInGlobStar = function (abs, cb) { if (this.aborted) return // follow all symlinked directories forever // just proceed as if this is a non-globstar situation if (this.follow) return this._readdir(abs, false, cb) var lstatkey = 'lstat\0' + abs var self = this var lstatcb = inflight(lstatkey, lstatcb_) if (lstatcb) fs.lstat(abs, lstatcb) function lstatcb_ (er, lstat) { if (er && er.code === 'ENOENT') return cb() var isSym = lstat && lstat.isSymbolicLink() self.symlinks[abs] = isSym // If it's not a symlink or a dir, then it's definitely a regular file. // don't bother doing a readdir in that case. if (!isSym && lstat && !lstat.isDirectory()) { self.cache[abs] = 'FILE' cb() } else self._readdir(abs, false, cb) } } Glob.prototype._readdir = function (abs, inGlobStar, cb) { if (this.aborted) return cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) if (!cb) return //console.error('RD %j %j', +inGlobStar, abs) if (inGlobStar && !ownProp(this.symlinks, abs)) return this._readdirInGlobStar(abs, cb) if (ownProp(this.cache, abs)) { var c = this.cache[abs] if (!c || c === 'FILE') return cb() if (Array.isArray(c)) return cb(null, c) } var self = this fs.readdir(abs, readdirCb(this, abs, cb)) } function readdirCb (self, abs, cb) { return function (er, entries) { if (er) self._readdirError(abs, er, cb) else self._readdirEntries(abs, entries, cb) } } Glob.prototype._readdirEntries = function (abs, entries, cb) { if (this.aborted) return // if we haven't asked to stat everything, then just // assume that everything in there exists, so we can avoid // having to stat it a second time. if (!this.mark && !this.stat) { for (var i = 0; i < entries.length; i ++) { var e = entries[i] if (abs === '/') e = abs + e else e = abs + '/' + e this.cache[e] = true } } this.cache[abs] = entries return cb(null, entries) } Glob.prototype._readdirError = function (f, er, cb) { if (this.aborted) return // handle errors, and cache the information switch (er.code) { case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 case 'ENOTDIR': // totally normal. means it *does* exist. var abs = this._makeAbs(f) this.cache[abs] = 'FILE' if (abs === this.cwdAbs) { var error = new Error(er.code + ' invalid cwd ' + this.cwd) error.path = this.cwd error.code = er.code this.emit('error', error) this.abort() } break case 'ENOENT': // not terribly unusual case 'ELOOP': case 'ENAMETOOLONG': case 'UNKNOWN': this.cache[this._makeAbs(f)] = false break default: // some unusual error. Treat as failure. this.cache[this._makeAbs(f)] = false if (this.strict) { this.emit('error', er) // If the error is handled, then we abort // if not, we threw out of here this.abort() } if (!this.silent) console.error('glob error', er) break } return cb() } Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { var self = this this._readdir(abs, inGlobStar, function (er, entries) { self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) }) } Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { //console.error('pgs2', prefix, remain[0], entries) // no entries means not a dir, so it can never have matches // foo.txt/** doesn't match foo.txt if (!entries) return cb() // test without the globstar, and with every child both below // and replacing the globstar. var remainWithoutGlobStar = remain.slice(1) var gspref = prefix ? [ prefix ] : [] var noGlobStar = gspref.concat(remainWithoutGlobStar) // the noGlobStar pattern exits the inGlobStar state this._process(noGlobStar, index, false, cb) var isSym = this.symlinks[abs] var len = entries.length // If it's a symlink, and we're in a globstar, then stop if (isSym && inGlobStar) return cb() for (var i = 0; i < len; i++) { var e = entries[i] if (e.charAt(0) === '.' && !this.dot) continue // these two cases enter the inGlobStar state var instead = gspref.concat(entries[i], remainWithoutGlobStar) this._process(instead, index, true, cb) var below = gspref.concat(entries[i], remain) this._process(below, index, true, cb) } cb() } Glob.prototype._processSimple = function (prefix, index, cb) { // XXX review this. Shouldn't it be doing the mounting etc // before doing stat? kinda weird? var self = this this._stat(prefix, function (er, exists) { self._processSimple2(prefix, index, er, exists, cb) }) } Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { //console.error('ps2', prefix, exists) if (!this.matches[index]) this.matches[index] = Object.create(null) // If it doesn't exist, then just mark the lack of results if (!exists) return cb() if (prefix && isAbsolute(prefix) && !this.nomount) { var trail = /[\/\\]$/.test(prefix) if (prefix.charAt(0) === '/') { prefix = path.join(this.root, prefix) } else { prefix = path.resolve(this.root, prefix) if (trail) prefix += '/' } } if (process.platform === 'win32') prefix = prefix.replace(/\\/g, '/') // Mark this as a match this._emitMatch(index, prefix) cb() } // Returns either 'DIR', 'FILE', or false Glob.prototype._stat = function (f, cb) { var abs = this._makeAbs(f) var needDir = f.slice(-1) === '/' if (f.length > this.maxLength) return cb() if (!this.stat && ownProp(this.cache, abs)) { var c = this.cache[abs] if (Array.isArray(c)) c = 'DIR' // It exists, but maybe not how we need it if (!needDir || c === 'DIR') return cb(null, c) if (needDir && c === 'FILE') return cb() // otherwise we have to stat, because maybe c=true // if we know it exists, but not what it is. } var exists var stat = this.statCache[abs] if (stat !== undefined) { if (stat === false) return cb(null, stat) else { var type = stat.isDirectory() ? 'DIR' : 'FILE' if (needDir && type === 'FILE') return cb() else return cb(null, type, stat) } } var self = this var statcb = inflight('stat\0' + abs, lstatcb_) if (statcb) fs.lstat(abs, statcb) function lstatcb_ (er, lstat) { if (lstat && lstat.isSymbolicLink()) { // If it's a symlink, then treat it as the target, unless // the target does not exist, then treat it as a file. return fs.stat(abs, function (er, stat) { if (er) self._stat2(f, abs, null, lstat, cb) else self._stat2(f, abs, er, stat, cb) }) } else { self._stat2(f, abs, er, lstat, cb) } } } Glob.prototype._stat2 = function (f, abs, er, stat, cb) { if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { this.statCache[abs] = false return cb() } var needDir = f.slice(-1) === '/' this.statCache[abs] = stat if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) return cb(null, false, stat) var c = true if (stat) c = stat.isDirectory() ? 'DIR' : 'FILE' this.cache[abs] = this.cache[abs] || c if (needDir && c === 'FILE') return cb() return cb(null, c, stat) } The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ## Glob Logo Glob's logo created by Tanya Brassie , licensed under a Creative Commons Attribution-ShareAlike 4.0 International License https://creativecommons.org/licenses/by-sa/4.0/ { "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "name": "glob", "description": "a little globber", "version": "7.1.6", "repository": { "type": "git", "url": "git://github.com/isaacs/node-glob.git" }, "main": "glob.js", "files": [ "glob.js", "sync.js", "common.js" ], "engines": { "node": "*" }, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, "devDependencies": { "mkdirp": "0", "rimraf": "^2.2.8", "tap": "^12.0.1", "tick": "0.0.6" }, "scripts": { "prepublish": "npm run benchclean", "profclean": "rm -f v8.log profile.txt", "test": "tap test/*.js --cov", "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js", "bench": "bash benchmark.sh", "prof": "bash prof.sh && cat profile.txt", "benchclean": "node benchclean.js" }, "license": "ISC", "funding": { "url": "https://github.com/sponsors/isaacs" } } module.exports = globSync globSync.GlobSync = GlobSync var fs = require('fs') var rp = require('fs.realpath') var minimatch = require('minimatch') var Minimatch = minimatch.Minimatch var Glob = require('./glob.js').Glob var util = require('util') var path = require('path') var assert = require('assert') var isAbsolute = require('path-is-absolute') var common = require('./common.js') var alphasort = common.alphasort var alphasorti = common.alphasorti var setopts = common.setopts var ownProp = common.ownProp var childrenIgnored = common.childrenIgnored var isIgnored = common.isIgnored function globSync (pattern, options) { if (typeof options === 'function' || arguments.length === 3) throw new TypeError('callback provided to sync glob\n'+ 'See: https://github.com/isaacs/node-glob/issues/167') return new GlobSync(pattern, options).found } function GlobSync (pattern, options) { if (!pattern) throw new Error('must provide pattern') if (typeof options === 'function' || arguments.length === 3) throw new TypeError('callback provided to sync glob\n'+ 'See: https://github.com/isaacs/node-glob/issues/167') if (!(this instanceof GlobSync)) return new GlobSync(pattern, options) setopts(this, pattern, options) if (this.noprocess) return this var n = this.minimatch.set.length this.matches = new Array(n) for (var i = 0; i < n; i ++) { this._process(this.minimatch.set[i], i, false) } this._finish() } GlobSync.prototype._finish = function () { assert(this instanceof GlobSync) if (this.realpath) { var self = this this.matches.forEach(function (matchset, index) { var set = self.matches[index] = Object.create(null) for (var p in matchset) { try { p = self._makeAbs(p) var real = rp.realpathSync(p, self.realpathCache) set[real] = true } catch (er) { if (er.syscall === 'stat') set[self._makeAbs(p)] = true else throw er } } }) } common.finish(this) } GlobSync.prototype._process = function (pattern, index, inGlobStar) { assert(this instanceof GlobSync) // Get the first [n] parts of pattern that are all strings. var n = 0 while (typeof pattern[n] === 'string') { n ++ } // now n is the index of the first one that is *not* a string. // See if there's anything else var prefix switch (n) { // if not, then this is rather simple case pattern.length: this._processSimple(pattern.join('/'), index) return case 0: // pattern *starts* with some non-trivial item. // going to readdir(cwd), but not include the prefix in matches. prefix = null break default: // pattern has some string bits in the front. // whatever it starts with, whether that's 'absolute' like /foo/bar, // or 'relative' like '../baz' prefix = pattern.slice(0, n).join('/') break } var remain = pattern.slice(n) // get the list of entries. var read if (prefix === null) read = '.' else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { if (!prefix || !isAbsolute(prefix)) prefix = '/' + prefix read = prefix } else read = prefix var abs = this._makeAbs(read) //if ignored, skip processing if (childrenIgnored(this, read)) return var isGlobStar = remain[0] === minimatch.GLOBSTAR if (isGlobStar) this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) else this._processReaddir(prefix, read, abs, remain, index, inGlobStar) } GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { var entries = this._readdir(abs, inGlobStar) // if the abs isn't a dir, then nothing can match! if (!entries) return // It will only match dot entries if it starts with a dot, or if // dot is set. Stuff like @(.foo|.bar) isn't allowed. var pn = remain[0] var negate = !!this.minimatch.negate var rawGlob = pn._glob var dotOk = this.dot || rawGlob.charAt(0) === '.' var matchedEntries = [] for (var i = 0; i < entries.length; i++) { var e = entries[i] if (e.charAt(0) !== '.' || dotOk) { var m if (negate && !prefix) { m = !e.match(pn) } else { m = e.match(pn) } if (m) matchedEntries.push(e) } } var len = matchedEntries.length // If there are no matched entries, then nothing matches. if (len === 0) return // if this is the last remaining pattern bit, then no need for // an additional stat *unless* the user has specified mark or // stat explicitly. We know they exist, since readdir returned // them. if (remain.length === 1 && !this.mark && !this.stat) { if (!this.matches[index]) this.matches[index] = Object.create(null) for (var i = 0; i < len; i ++) { var e = matchedEntries[i] if (prefix) { if (prefix.slice(-1) !== '/') e = prefix + '/' + e else e = prefix + e } if (e.charAt(0) === '/' && !this.nomount) { e = path.join(this.root, e) } this._emitMatch(index, e) } // This was the last one, and no stats were needed return } // now test all matched entries as stand-ins for that part // of the pattern. remain.shift() for (var i = 0; i < len; i ++) { var e = matchedEntries[i] var newPattern if (prefix) newPattern = [prefix, e] else newPattern = [e] this._process(newPattern.concat(remain), index, inGlobStar) } } GlobSync.prototype._emitMatch = function (index, e) { if (isIgnored(this, e)) return var abs = this._makeAbs(e) if (this.mark) e = this._mark(e) if (this.absolute) { e = abs } if (this.matches[index][e]) return if (this.nodir) { var c = this.cache[abs] if (c === 'DIR' || Array.isArray(c)) return } this.matches[index][e] = true if (this.stat) this._stat(e) } GlobSync.prototype._readdirInGlobStar = function (abs) { // follow all symlinked directories forever // just proceed as if this is a non-globstar situation if (this.follow) return this._readdir(abs, false) var entries var lstat var stat try { lstat = fs.lstatSync(abs) } catch (er) { if (er.code === 'ENOENT') { // lstat failed, doesn't exist return null } } var isSym = lstat && lstat.isSymbolicLink() this.symlinks[abs] = isSym // If it's not a symlink or a dir, then it's definitely a regular file. // don't bother doing a readdir in that case. if (!isSym && lstat && !lstat.isDirectory()) this.cache[abs] = 'FILE' else entries = this._readdir(abs, false) return entries } GlobSync.prototype._readdir = function (abs, inGlobStar) { var entries if (inGlobStar && !ownProp(this.symlinks, abs)) return this._readdirInGlobStar(abs) if (ownProp(this.cache, abs)) { var c = this.cache[abs] if (!c || c === 'FILE') return null if (Array.isArray(c)) return c } try { return this._readdirEntries(abs, fs.readdirSync(abs)) } catch (er) { this._readdirError(abs, er) return null } } GlobSync.prototype._readdirEntries = function (abs, entries) { // if we haven't asked to stat everything, then just // assume that everything in there exists, so we can avoid // having to stat it a second time. if (!this.mark && !this.stat) { for (var i = 0; i < entries.length; i ++) { var e = entries[i] if (abs === '/') e = abs + e else e = abs + '/' + e this.cache[e] = true } } this.cache[abs] = entries // mark and cache dir-ness return entries } GlobSync.prototype._readdirError = function (f, er) { // handle errors, and cache the information switch (er.code) { case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 case 'ENOTDIR': // totally normal. means it *does* exist. var abs = this._makeAbs(f) this.cache[abs] = 'FILE' if (abs === this.cwdAbs) { var error = new Error(er.code + ' invalid cwd ' + this.cwd) error.path = this.cwd error.code = er.code throw error } break case 'ENOENT': // not terribly unusual case 'ELOOP': case 'ENAMETOOLONG': case 'UNKNOWN': this.cache[this._makeAbs(f)] = false break default: // some unusual error. Treat as failure. this.cache[this._makeAbs(f)] = false if (this.strict) throw er if (!this.silent) console.error('glob error', er) break } } GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { var entries = this._readdir(abs, inGlobStar) // no entries means not a dir, so it can never have matches // foo.txt/** doesn't match foo.txt if (!entries) return // test without the globstar, and with every child both below // and replacing the globstar. var remainWithoutGlobStar = remain.slice(1) var gspref = prefix ? [ prefix ] : [] var noGlobStar = gspref.concat(remainWithoutGlobStar) // the noGlobStar pattern exits the inGlobStar state this._process(noGlobStar, index, false) var len = entries.length var isSym = this.symlinks[abs] // If it's a symlink, and we're in a globstar, then stop if (isSym && inGlobStar) return for (var i = 0; i < len; i++) { var e = entries[i] if (e.charAt(0) === '.' && !this.dot) continue // these two cases enter the inGlobStar state var instead = gspref.concat(entries[i], remainWithoutGlobStar) this._process(instead, index, true) var below = gspref.concat(entries[i], remain) this._process(below, index, true) } } GlobSync.prototype._processSimple = function (prefix, index) { // XXX review this. Shouldn't it be doing the mounting etc // before doing stat? kinda weird? var exists = this._stat(prefix) if (!this.matches[index]) this.matches[index] = Object.create(null) // If it doesn't exist, then just mark the lack of results if (!exists) return if (prefix && isAbsolute(prefix) && !this.nomount) { var trail = /[\/\\]$/.test(prefix) if (prefix.charAt(0) === '/') { prefix = path.join(this.root, prefix) } else { prefix = path.resolve(this.root, prefix) if (trail) prefix += '/' } } if (process.platform === 'win32') prefix = prefix.replace(/\\/g, '/') // Mark this as a match this._emitMatch(index, prefix) } // Returns either 'DIR', 'FILE', or false GlobSync.prototype._stat = function (f) { var abs = this._makeAbs(f) var needDir = f.slice(-1) === '/' if (f.length > this.maxLength) return false if (!this.stat && ownProp(this.cache, abs)) { var c = this.cache[abs] if (Array.isArray(c)) c = 'DIR' // It exists, but maybe not how we need it if (!needDir || c === 'DIR') return c if (needDir && c === 'FILE') return false // otherwise we have to stat, because maybe c=true // if we know it exists, but not what it is. } var exists var stat = this.statCache[abs] if (!stat) { var lstat try { lstat = fs.lstatSync(abs) } catch (er) { if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { this.statCache[abs] = false return false } } if (lstat && lstat.isSymbolicLink()) { try { stat = fs.statSync(abs) } catch (er) { stat = lstat } } else { stat = lstat } } this.statCache[abs] = stat var c = true if (stat) c = stat.isDirectory() ? 'DIR' : 'FILE' this.cache[abs] = this.cache[abs] || c if (needDir && c === 'FILE') return false return c } GlobSync.prototype._mark = function (p) { return common.mark(this, p) } GlobSync.prototype._makeAbs = function (f) { return common.makeAbs(this, f) } 'use strict' module.exports = clone var getPrototypeOf = Object.getPrototypeOf || function (obj) { return obj.__proto__ } function clone (obj) { if (obj === null || typeof obj !== 'object') return obj if (obj instanceof Object) var copy = { __proto__: getPrototypeOf(obj) } else var copy = Object.create(null) Object.getOwnPropertyNames(obj).forEach(function (key) { Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) }) return copy } var fs = require('fs') var polyfills = require('./polyfills.js') var legacy = require('./legacy-streams.js') var clone = require('./clone.js') var util = require('util') /* istanbul ignore next - node 0.x polyfill */ var gracefulQueue var previousSymbol /* istanbul ignore else - node 0.x polyfill */ if (typeof Symbol === 'function' && typeof Symbol.for === 'function') { gracefulQueue = Symbol.for('graceful-fs.queue') // This is used in testing by future versions previousSymbol = Symbol.for('graceful-fs.previous') } else { gracefulQueue = '___graceful-fs.queue' previousSymbol = '___graceful-fs.previous' } function noop () {} function publishQueue(context, queue) { Object.defineProperty(context, gracefulQueue, { get: function() { return queue } }) } var debug = noop if (util.debuglog) debug = util.debuglog('gfs4') else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) debug = function() { var m = util.format.apply(util, arguments) m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') console.error(m) } // Once time initialization if (!fs[gracefulQueue]) { // This queue can be shared by multiple loaded instances var queue = global[gracefulQueue] || [] publishQueue(fs, queue) // Patch fs.close/closeSync to shared queue version, because we need // to retry() whenever a close happens *anywhere* in the program. // This is essential when multiple graceful-fs instances are // in play at the same time. fs.close = (function (fs$close) { function close (fd, cb) { return fs$close.call(fs, fd, function (err) { // This function uses the graceful-fs shared queue if (!err) { resetQueue() } if (typeof cb === 'function') cb.apply(this, arguments) }) } Object.defineProperty(close, previousSymbol, { value: fs$close }) return close })(fs.close) fs.closeSync = (function (fs$closeSync) { function closeSync (fd) { // This function uses the graceful-fs shared queue fs$closeSync.apply(fs, arguments) resetQueue() } Object.defineProperty(closeSync, previousSymbol, { value: fs$closeSync }) return closeSync })(fs.closeSync) if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { process.on('exit', function() { debug(fs[gracefulQueue]) require('assert').equal(fs[gracefulQueue].length, 0) }) } } if (!global[gracefulQueue]) { publishQueue(global, fs[gracefulQueue]); } module.exports = patch(clone(fs)) if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) { module.exports = patch(fs) fs.__patched = true; } function patch (fs) { // Everything that references the open() function needs to be in here polyfills(fs) fs.gracefulify = patch fs.createReadStream = createReadStream fs.createWriteStream = createWriteStream var fs$readFile = fs.readFile fs.readFile = readFile function readFile (path, options, cb) { if (typeof options === 'function') cb = options, options = null return go$readFile(path, options, cb) function go$readFile (path, options, cb, startTime) { return fs$readFile(path, options, function (err) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()]) else { if (typeof cb === 'function') cb.apply(this, arguments) } }) } } var fs$writeFile = fs.writeFile fs.writeFile = writeFile function writeFile (path, data, options, cb) { if (typeof options === 'function') cb = options, options = null return go$writeFile(path, data, options, cb) function go$writeFile (path, data, options, cb, startTime) { return fs$writeFile(path, data, options, function (err) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) else { if (typeof cb === 'function') cb.apply(this, arguments) } }) } } var fs$appendFile = fs.appendFile if (fs$appendFile) fs.appendFile = appendFile function appendFile (path, data, options, cb) { if (typeof options === 'function') cb = options, options = null return go$appendFile(path, data, options, cb) function go$appendFile (path, data, options, cb, startTime) { return fs$appendFile(path, data, options, function (err) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) else { if (typeof cb === 'function') cb.apply(this, arguments) } }) } } var fs$copyFile = fs.copyFile if (fs$copyFile) fs.copyFile = copyFile function copyFile (src, dest, flags, cb) { if (typeof flags === 'function') { cb = flags flags = 0 } return go$copyFile(src, dest, flags, cb) function go$copyFile (src, dest, flags, cb, startTime) { return fs$copyFile(src, dest, flags, function (err) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()]) else { if (typeof cb === 'function') cb.apply(this, arguments) } }) } } var fs$readdir = fs.readdir fs.readdir = readdir function readdir (path, options, cb) { if (typeof options === 'function') cb = options, options = null return go$readdir(path, options, cb) function go$readdir (path, options, cb, startTime) { return fs$readdir(path, options, function (err, files) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$readdir, [path, options, cb], err, startTime || Date.now(), Date.now()]) else { if (files && files.sort) files.sort() if (typeof cb === 'function') cb.call(this, err, files) } }) } } if (process.version.substr(0, 4) === 'v0.8') { var legStreams = legacy(fs) ReadStream = legStreams.ReadStream WriteStream = legStreams.WriteStream } var fs$ReadStream = fs.ReadStream if (fs$ReadStream) { ReadStream.prototype = Object.create(fs$ReadStream.prototype) ReadStream.prototype.open = ReadStream$open } var fs$WriteStream = fs.WriteStream if (fs$WriteStream) { WriteStream.prototype = Object.create(fs$WriteStream.prototype) WriteStream.prototype.open = WriteStream$open } Object.defineProperty(fs, 'ReadStream', { get: function () { return ReadStream }, set: function (val) { ReadStream = val }, enumerable: true, configurable: true }) Object.defineProperty(fs, 'WriteStream', { get: function () { return WriteStream }, set: function (val) { WriteStream = val }, enumerable: true, configurable: true }) // legacy names var FileReadStream = ReadStream Object.defineProperty(fs, 'FileReadStream', { get: function () { return FileReadStream }, set: function (val) { FileReadStream = val }, enumerable: true, configurable: true }) var FileWriteStream = WriteStream Object.defineProperty(fs, 'FileWriteStream', { get: function () { return FileWriteStream }, set: function (val) { FileWriteStream = val }, enumerable: true, configurable: true }) function ReadStream (path, options) { if (this instanceof ReadStream) return fs$ReadStream.apply(this, arguments), this else return ReadStream.apply(Object.create(ReadStream.prototype), arguments) } function ReadStream$open () { var that = this open(that.path, that.flags, that.mode, function (err, fd) { if (err) { if (that.autoClose) that.destroy() that.emit('error', err) } else { that.fd = fd that.emit('open', fd) that.read() } }) } function WriteStream (path, options) { if (this instanceof WriteStream) return fs$WriteStream.apply(this, arguments), this else return WriteStream.apply(Object.create(WriteStream.prototype), arguments) } function WriteStream$open () { var that = this open(that.path, that.flags, that.mode, function (err, fd) { if (err) { that.destroy() that.emit('error', err) } else { that.fd = fd that.emit('open', fd) } }) } function createReadStream (path, options) { return new fs.ReadStream(path, options) } function createWriteStream (path, options) { return new fs.WriteStream(path, options) } var fs$open = fs.open fs.open = open function open (path, flags, mode, cb) { if (typeof mode === 'function') cb = mode, mode = null return go$open(path, flags, mode, cb) function go$open (path, flags, mode, cb, startTime) { return fs$open(path, flags, mode, function (err, fd) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()]) else { if (typeof cb === 'function') cb.apply(this, arguments) } }) } } return fs } function enqueue (elem) { debug('ENQUEUE', elem[0].name, elem[1]) fs[gracefulQueue].push(elem) retry() } // keep track of the timeout between retry() calls var retryTimer // reset the startTime and lastTime to now // this resets the start of the 60 second overall timeout as well as the // delay between attempts so that we'll retry these jobs sooner function resetQueue () { var now = Date.now() for (var i = 0; i < fs[gracefulQueue].length; ++i) { // entries that are only a length of 2 are from an older version, don't // bother modifying those since they'll be retried anyway. if (fs[gracefulQueue][i].length > 2) { fs[gracefulQueue][i][3] = now // startTime fs[gracefulQueue][i][4] = now // lastTime } } // call retry to make sure we're actively processing the queue retry() } function retry () { // clear the timer and remove it to help prevent unintended concurrency clearTimeout(retryTimer) retryTimer = undefined if (fs[gracefulQueue].length === 0) return var elem = fs[gracefulQueue].shift() var fn = elem[0] var args = elem[1] // these items may be unset if they were added by an older graceful-fs var err = elem[2] var startTime = elem[3] var lastTime = elem[4] // if we don't have a startTime we have no way of knowing if we've waited // long enough, so go ahead and retry this item now if (startTime === undefined) { debug('RETRY', fn.name, args) fn.apply(null, args) } else if (Date.now() - startTime >= 60000) { // it's been more than 60 seconds total, bail now debug('TIMEOUT', fn.name, args) var cb = args.pop() if (typeof cb === 'function') cb.call(null, err) } else { // the amount of time between the last attempt and right now var sinceAttempt = Date.now() - lastTime // the amount of time between when we first tried, and when we last tried // rounded up to at least 1 var sinceStart = Math.max(lastTime - startTime, 1) // backoff. wait longer than the total time we've been retrying, but only // up to a maximum of 100ms var desiredDelay = Math.min(sinceStart * 1.2, 100) // it's been long enough since the last retry, do it again if (sinceAttempt >= desiredDelay) { debug('RETRY', fn.name, args) fn.apply(null, args.concat([startTime])) } else { // if we can't do this job yet, push it to the end of the queue // and let the next iteration check again fs[gracefulQueue].push(elem) } } // schedule our next run if one isn't already scheduled if (retryTimer === undefined) { retryTimer = setTimeout(retry, 0) } } var Stream = require('stream').Stream module.exports = legacy function legacy (fs) { return { ReadStream: ReadStream, WriteStream: WriteStream } function ReadStream (path, options) { if (!(this instanceof ReadStream)) return new ReadStream(path, options); Stream.call(this); var self = this; this.path = path; this.fd = null; this.readable = true; this.paused = false; this.flags = 'r'; this.mode = 438; /*=0666*/ this.bufferSize = 64 * 1024; options = options || {}; // Mixin options into this var keys = Object.keys(options); for (var index = 0, length = keys.length; index < length; index++) { var key = keys[index]; this[key] = options[key]; } if (this.encoding) this.setEncoding(this.encoding); if (this.start !== undefined) { if ('number' !== typeof this.start) { throw TypeError('start must be a Number'); } if (this.end === undefined) { this.end = Infinity; } else if ('number' !== typeof this.end) { throw TypeError('end must be a Number'); } if (this.start > this.end) { throw new Error('start must be <= end'); } this.pos = this.start; } if (this.fd !== null) { process.nextTick(function() { self._read(); }); return; } fs.open(this.path, this.flags, this.mode, function (err, fd) { if (err) { self.emit('error', err); self.readable = false; return; } self.fd = fd; self.emit('open', fd); self._read(); }) } function WriteStream (path, options) { if (!(this instanceof WriteStream)) return new WriteStream(path, options); Stream.call(this); this.path = path; this.fd = null; this.writable = true; this.flags = 'w'; this.encoding = 'binary'; this.mode = 438; /*=0666*/ this.bytesWritten = 0; options = options || {}; // Mixin options into this var keys = Object.keys(options); for (var index = 0, length = keys.length; index < length; index++) { var key = keys[index]; this[key] = options[key]; } if (this.start !== undefined) { if ('number' !== typeof this.start) { throw TypeError('start must be a Number'); } if (this.start < 0) { throw new Error('start must be >= zero'); } this.pos = this.start; } this.busy = false; this._queue = []; if (this.fd === null) { this._open = fs.open; this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); this.flush(); } } } The ISC License Copyright (c) Isaac Z. Schlueter, Ben Noordhuis, and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "graceful-fs", "description": "A drop-in replacement for fs, making various improvements.", "version": "4.2.9", "repository": { "type": "git", "url": "https://github.com/isaacs/node-graceful-fs" }, "main": "graceful-fs.js", "directories": { "test": "test" }, "scripts": { "preversion": "npm test", "postversion": "npm publish", "postpublish": "git push origin --follow-tags", "test": "nyc --silent node test.js | tap -c -", "posttest": "nyc report" }, "keywords": [ "fs", "module", "reading", "retry", "retries", "queue", "error", "errors", "handling", "EMFILE", "EAGAIN", "EINVAL", "EPERM", "EACCESS" ], "license": "ISC", "devDependencies": { "import-fresh": "^2.0.0", "mkdirp": "^0.5.0", "rimraf": "^2.2.8", "tap": "^12.7.0" }, "files": [ "fs.js", "graceful-fs.js", "legacy-streams.js", "polyfills.js", "clone.js" ] } var constants = require('constants') var origCwd = process.cwd var cwd = null var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform process.cwd = function() { if (!cwd) cwd = origCwd.call(process) return cwd } try { process.cwd() } catch (er) {} // This check is needed until node.js 12 is required if (typeof process.chdir === 'function') { var chdir = process.chdir process.chdir = function (d) { cwd = null chdir.call(process, d) } if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir) } module.exports = patch function patch (fs) { // (re-)implement some things that are known busted or missing. // lchmod, broken prior to 0.6.2 // back-port the fix here. if (constants.hasOwnProperty('O_SYMLINK') && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { patchLchmod(fs) } // lutimes implementation, or no-op if (!fs.lutimes) { patchLutimes(fs) } // https://github.com/isaacs/node-graceful-fs/issues/4 // Chown should not fail on einval or eperm if non-root. // It should not fail on enosys ever, as this just indicates // that a fs doesn't support the intended operation. fs.chown = chownFix(fs.chown) fs.fchown = chownFix(fs.fchown) fs.lchown = chownFix(fs.lchown) fs.chmod = chmodFix(fs.chmod) fs.fchmod = chmodFix(fs.fchmod) fs.lchmod = chmodFix(fs.lchmod) fs.chownSync = chownFixSync(fs.chownSync) fs.fchownSync = chownFixSync(fs.fchownSync) fs.lchownSync = chownFixSync(fs.lchownSync) fs.chmodSync = chmodFixSync(fs.chmodSync) fs.fchmodSync = chmodFixSync(fs.fchmodSync) fs.lchmodSync = chmodFixSync(fs.lchmodSync) fs.stat = statFix(fs.stat) fs.fstat = statFix(fs.fstat) fs.lstat = statFix(fs.lstat) fs.statSync = statFixSync(fs.statSync) fs.fstatSync = statFixSync(fs.fstatSync) fs.lstatSync = statFixSync(fs.lstatSync) // if lchmod/lchown do not exist, then make them no-ops if (!fs.lchmod) { fs.lchmod = function (path, mode, cb) { if (cb) process.nextTick(cb) } fs.lchmodSync = function () {} } if (!fs.lchown) { fs.lchown = function (path, uid, gid, cb) { if (cb) process.nextTick(cb) } fs.lchownSync = function () {} } // on Windows, A/V software can lock the directory, causing this // to fail with an EACCES or EPERM if the directory contains newly // created files. Try again on failure, for up to 60 seconds. // Set the timeout this long because some Windows Anti-Virus, such as Parity // bit9, may lock files for up to a minute, causing npm package install // failures. Also, take care to yield the scheduler. Windows scheduling gives // CPU to a busy looping process, which can cause the program causing the lock // contention to be starved of CPU by node, so the contention doesn't resolve. if (platform === "win32") { fs.rename = (function (fs$rename) { return function (from, to, cb) { var start = Date.now() var backoff = 0; fs$rename(from, to, function CB (er) { if (er && (er.code === "EACCES" || er.code === "EPERM") && Date.now() - start < 60000) { setTimeout(function() { fs.stat(to, function (stater, st) { if (stater && stater.code === "ENOENT") fs$rename(from, to, CB); else cb(er) }) }, backoff) if (backoff < 100) backoff += 10; return; } if (cb) cb(er) }) }})(fs.rename) } // if read() returns EAGAIN, then just try it again. fs.read = (function (fs$read) { function read (fd, buffer, offset, length, position, callback_) { var callback if (callback_ && typeof callback_ === 'function') { var eagCounter = 0 callback = function (er, _, __) { if (er && er.code === 'EAGAIN' && eagCounter < 10) { eagCounter ++ return fs$read.call(fs, fd, buffer, offset, length, position, callback) } callback_.apply(this, arguments) } } return fs$read.call(fs, fd, buffer, offset, length, position, callback) } // This ensures `util.promisify` works as it does for native `fs.read`. if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read) return read })(fs.read) fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) { var eagCounter = 0 while (true) { try { return fs$readSync.call(fs, fd, buffer, offset, length, position) } catch (er) { if (er.code === 'EAGAIN' && eagCounter < 10) { eagCounter ++ continue } throw er } } }})(fs.readSync) function patchLchmod (fs) { fs.lchmod = function (path, mode, callback) { fs.open( path , constants.O_WRONLY | constants.O_SYMLINK , mode , function (err, fd) { if (err) { if (callback) callback(err) return } // prefer to return the chmod error, if one occurs, // but still try to close, and report closing errors if they occur. fs.fchmod(fd, mode, function (err) { fs.close(fd, function(err2) { if (callback) callback(err || err2) }) }) }) } fs.lchmodSync = function (path, mode) { var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) // prefer to return the chmod error, if one occurs, // but still try to close, and report closing errors if they occur. var threw = true var ret try { ret = fs.fchmodSync(fd, mode) threw = false } finally { if (threw) { try { fs.closeSync(fd) } catch (er) {} } else { fs.closeSync(fd) } } return ret } } function patchLutimes (fs) { if (constants.hasOwnProperty("O_SYMLINK")) { fs.lutimes = function (path, at, mt, cb) { fs.open(path, constants.O_SYMLINK, function (er, fd) { if (er) { if (cb) cb(er) return } fs.futimes(fd, at, mt, function (er) { fs.close(fd, function (er2) { if (cb) cb(er || er2) }) }) }) } fs.lutimesSync = function (path, at, mt) { var fd = fs.openSync(path, constants.O_SYMLINK) var ret var threw = true try { ret = fs.futimesSync(fd, at, mt) threw = false } finally { if (threw) { try { fs.closeSync(fd) } catch (er) {} } else { fs.closeSync(fd) } } return ret } } else { fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } fs.lutimesSync = function () {} } } function chmodFix (orig) { if (!orig) return orig return function (target, mode, cb) { return orig.call(fs, target, mode, function (er) { if (chownErOk(er)) er = null if (cb) cb.apply(this, arguments) }) } } function chmodFixSync (orig) { if (!orig) return orig return function (target, mode) { try { return orig.call(fs, target, mode) } catch (er) { if (!chownErOk(er)) throw er } } } function chownFix (orig) { if (!orig) return orig return function (target, uid, gid, cb) { return orig.call(fs, target, uid, gid, function (er) { if (chownErOk(er)) er = null if (cb) cb.apply(this, arguments) }) } } function chownFixSync (orig) { if (!orig) return orig return function (target, uid, gid) { try { return orig.call(fs, target, uid, gid) } catch (er) { if (!chownErOk(er)) throw er } } } function statFix (orig) { if (!orig) return orig // Older versions of Node erroneously returned signed integers for // uid + gid. return function (target, options, cb) { if (typeof options === 'function') { cb = options options = null } function callback (er, stats) { if (stats) { if (stats.uid < 0) stats.uid += 0x100000000 if (stats.gid < 0) stats.gid += 0x100000000 } if (cb) cb.apply(this, arguments) } return options ? orig.call(fs, target, options, callback) : orig.call(fs, target, callback) } } function statFixSync (orig) { if (!orig) return orig // Older versions of Node erroneously returned signed integers for // uid + gid. return function (target, options) { var stats = options ? orig.call(fs, target, options) : orig.call(fs, target) if (stats) { if (stats.uid < 0) stats.uid += 0x100000000 if (stats.gid < 0) stats.gid += 0x100000000 } return stats; } } // ENOSYS means that the fs doesn't support the op. Just ignore // that, because it doesn't matter. // // if there's no getuid, or if getuid() is something other // than 0, and the error is EINVAL or EPERM, then just ignore // it. // // This specific case is a silent failure in cp, install, tar, // and most other unix tools that manage permissions. // // When running as root, or if other types of errors are // encountered, then it's strict. function chownErOk (er) { if (!er) return true if (er.code === "ENOSYS") return true var nonroot = !process.getuid || process.getuid() !== 0 if (nonroot) { if (er.code === "EINVAL" || er.code === "EPERM") return true } return false } } ISC License Copyright npm, Inc. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND NPM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NPM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "author": "GitHub Inc.", "name": "npmlog", "description": "logger for npm", "version": "6.0.1", "repository": { "type": "git", "url": "https://github.com/npm/npmlog.git" }, "main": "lib/log.js", "files": [ "bin", "lib" ], "scripts": { "test": "tap", "npmclilint": "npmcli-lint", "lint": "eslint '**/*.js'", "lintfix": "npm run lint -- --fix", "posttest": "npm run lint", "postsnap": "npm run lintfix --", "postlint": "npm-template-check", "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", "snap": "tap", "template-copy": "npm-template-copy --force" }, "dependencies": { "are-we-there-yet": "^3.0.0", "console-control-strings": "^1.1.0", "gauge": "^4.0.0", "set-blocking": "^2.0.0" }, "devDependencies": { "@npmcli/template-oss": "^2.7.1", "tap": "^15.1.6" }, "license": "ISC", "engines": { "node": "^12.13.0 || ^14.15.0 || >=16" }, "tap": { "branches": 95 }, "templateOSS": { "version": "2.7.1" } } #!/usr/bin/env node const rimraf = require('./') const path = require('path') const isRoot = arg => /^(\/|[a-zA-Z]:\\)$/.test(path.resolve(arg)) const filterOutRoot = arg => { const ok = preserveRoot === false || !isRoot(arg) if (!ok) { console.error(`refusing to remove ${arg}`) console.error('Set --no-preserve-root to allow this') } return ok } let help = false let dashdash = false let noglob = false let preserveRoot = true const args = process.argv.slice(2).filter(arg => { if (dashdash) return !!arg else if (arg === '--') dashdash = true else if (arg === '--no-glob' || arg === '-G') noglob = true else if (arg === '--glob' || arg === '-g') noglob = false else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) help = true else if (arg === '--preserve-root') preserveRoot = true else if (arg === '--no-preserve-root') preserveRoot = false else return !!arg }).filter(arg => !preserveRoot || filterOutRoot(arg)) const go = n => { if (n >= args.length) return const options = noglob ? { glob: false } : {} rimraf(args[n], options, er => { if (er) throw er go(n+1) }) } if (help || args.length === 0) { // If they didn't ask for help, then this is not a "success" const log = help ? console.log : console.error log('Usage: rimraf [ ...]') log('') log(' Deletes all files and folders at "path" recursively.') log('') log('Options:') log('') log(' -h, --help Display this usage info') log(' -G, --no-glob Do not expand glob patterns in arguments') log(' -g, --glob Expand glob patterns in arguments (default)') log(' --preserve-root Do not remove \'/\' (default)') log(' --no-preserve-root Do not treat \'/\' specially') log(' -- Stop parsing flags') process.exit(help ? 0 : 1) } else go(0) The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "rimraf", "version": "3.0.2", "main": "rimraf.js", "description": "A deep deletion module for node (like `rm -rf`)", "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "license": "ISC", "repository": "git://github.com/isaacs/rimraf.git", "scripts": { "preversion": "npm test", "postversion": "npm publish", "postpublish": "git push origin --follow-tags", "test": "tap test/*.js" }, "bin": "./bin.js", "dependencies": { "glob": "^7.1.3" }, "files": [ "LICENSE", "README.md", "bin.js", "rimraf.js" ], "devDependencies": { "mkdirp": "^0.5.1", "tap": "^12.1.1" }, "funding": { "url": "https://github.com/sponsors/isaacs" } } const assert = require("assert") const path = require("path") const fs = require("fs") let glob = undefined try { glob = require("glob") } catch (_err) { // treat glob as optional. } const defaultGlobOpts = { nosort: true, silent: true } // for EMFILE handling let timeout = 0 const isWindows = (process.platform === "win32") const defaults = options => { const methods = [ 'unlink', 'chmod', 'stat', 'lstat', 'rmdir', 'readdir' ] methods.forEach(m => { options[m] = options[m] || fs[m] m = m + 'Sync' options[m] = options[m] || fs[m] }) options.maxBusyTries = options.maxBusyTries || 3 options.emfileWait = options.emfileWait || 1000 if (options.glob === false) { options.disableGlob = true } if (options.disableGlob !== true && glob === undefined) { throw Error('glob dependency not found, set `options.disableGlob = true` if intentional') } options.disableGlob = options.disableGlob || false options.glob = options.glob || defaultGlobOpts } const rimraf = (p, options, cb) => { if (typeof options === 'function') { cb = options options = {} } assert(p, 'rimraf: missing path') assert.equal(typeof p, 'string', 'rimraf: path should be a string') assert.equal(typeof cb, 'function', 'rimraf: callback function required') assert(options, 'rimraf: invalid options argument provided') assert.equal(typeof options, 'object', 'rimraf: options should be object') defaults(options) let busyTries = 0 let errState = null let n = 0 const next = (er) => { errState = errState || er if (--n === 0) cb(errState) } const afterGlob = (er, results) => { if (er) return cb(er) n = results.length if (n === 0) return cb() results.forEach(p => { const CB = (er) => { if (er) { if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") && busyTries < options.maxBusyTries) { busyTries ++ // try again, with the same exact callback as this one. return setTimeout(() => rimraf_(p, options, CB), busyTries * 100) } // this one won't happen if graceful-fs is used. if (er.code === "EMFILE" && timeout < options.emfileWait) { return setTimeout(() => rimraf_(p, options, CB), timeout ++) } // already gone if (er.code === "ENOENT") er = null } timeout = 0 next(er) } rimraf_(p, options, CB) }) } if (options.disableGlob || !glob.hasMagic(p)) return afterGlob(null, [p]) options.lstat(p, (er, stat) => { if (!er) return afterGlob(null, [p]) glob(p, options.glob, afterGlob) }) } // Two possible strategies. // 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR // 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR // // Both result in an extra syscall when you guess wrong. However, there // are likely far more normal files in the world than directories. This // is based on the assumption that a the average number of files per // directory is >= 1. // // If anyone ever complains about this, then I guess the strategy could // be made configurable somehow. But until then, YAGNI. const rimraf_ = (p, options, cb) => { assert(p) assert(options) assert(typeof cb === 'function') // sunos lets the root user unlink directories, which is... weird. // so we have to lstat here and make sure it's not a dir. options.lstat(p, (er, st) => { if (er && er.code === "ENOENT") return cb(null) // Windows can EPERM on stat. Life is suffering. if (er && er.code === "EPERM" && isWindows) fixWinEPERM(p, options, er, cb) if (st && st.isDirectory()) return rmdir(p, options, er, cb) options.unlink(p, er => { if (er) { if (er.code === "ENOENT") return cb(null) if (er.code === "EPERM") return (isWindows) ? fixWinEPERM(p, options, er, cb) : rmdir(p, options, er, cb) if (er.code === "EISDIR") return rmdir(p, options, er, cb) } return cb(er) }) }) } const fixWinEPERM = (p, options, er, cb) => { assert(p) assert(options) assert(typeof cb === 'function') options.chmod(p, 0o666, er2 => { if (er2) cb(er2.code === "ENOENT" ? null : er) else options.stat(p, (er3, stats) => { if (er3) cb(er3.code === "ENOENT" ? null : er) else if (stats.isDirectory()) rmdir(p, options, er, cb) else options.unlink(p, cb) }) }) } const fixWinEPERMSync = (p, options, er) => { assert(p) assert(options) try { options.chmodSync(p, 0o666) } catch (er2) { if (er2.code === "ENOENT") return else throw er } let stats try { stats = options.statSync(p) } catch (er3) { if (er3.code === "ENOENT") return else throw er } if (stats.isDirectory()) rmdirSync(p, options, er) else options.unlinkSync(p) } const rmdir = (p, options, originalEr, cb) => { assert(p) assert(options) assert(typeof cb === 'function') // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) // if we guessed wrong, and it's not a directory, then // raise the original error. options.rmdir(p, er => { if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) rmkids(p, options, cb) else if (er && er.code === "ENOTDIR") cb(originalEr) else cb(er) }) } const rmkids = (p, options, cb) => { assert(p) assert(options) assert(typeof cb === 'function') options.readdir(p, (er, files) => { if (er) return cb(er) let n = files.length if (n === 0) return options.rmdir(p, cb) let errState files.forEach(f => { rimraf(path.join(p, f), options, er => { if (errState) return if (er) return cb(errState = er) if (--n === 0) options.rmdir(p, cb) }) }) }) } // this looks simpler, and is strictly *faster*, but will // tie up the JavaScript thread and fail on excessively // deep directory trees. const rimrafSync = (p, options) => { options = options || {} defaults(options) assert(p, 'rimraf: missing path') assert.equal(typeof p, 'string', 'rimraf: path should be a string') assert(options, 'rimraf: missing options') assert.equal(typeof options, 'object', 'rimraf: options should be object') let results if (options.disableGlob || !glob.hasMagic(p)) { results = [p] } else { try { options.lstatSync(p) results = [p] } catch (er) { results = glob.sync(p, options.glob) } } if (!results.length) return for (let i = 0; i < results.length; i++) { const p = results[i] let st try { st = options.lstatSync(p) } catch (er) { if (er.code === "ENOENT") return // Windows can EPERM on stat. Life is suffering. if (er.code === "EPERM" && isWindows) fixWinEPERMSync(p, options, er) } try { // sunos lets the root user unlink directories, which is... weird. if (st && st.isDirectory()) rmdirSync(p, options, null) else options.unlinkSync(p) } catch (er) { if (er.code === "ENOENT") return if (er.code === "EPERM") return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) if (er.code !== "EISDIR") throw er rmdirSync(p, options, er) } } } const rmdirSync = (p, options, originalEr) => { assert(p) assert(options) try { options.rmdirSync(p) } catch (er) { if (er.code === "ENOENT") return if (er.code === "ENOTDIR") throw originalEr if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") rmkidsSync(p, options) } } const rmkidsSync = (p, options) => { assert(p) assert(options) options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)) // We only end up here once we got ENOTEMPTY at least once, and // at this point, we are guaranteed to have removed all the kids. // So, we know that it won't be ENOENT or ENOTDIR or anything else. // try really hard to delete stuff on windows, because it has a // PROFOUNDLY annoying habit of not closing handles promptly when // files are deleted, resulting in spurious ENOTEMPTY errors. const retries = isWindows ? 100 : 1 let i = 0 do { let threw = true try { const ret = options.rmdirSync(p, options) threw = false return ret } finally { if (++i < retries && threw) continue } } while (true) } module.exports = rimraf rimraf.sync = rimrafSync // just pre-load all the stuff that index.js lazily exports const internalRe = require('./internal/re') module.exports = { re: internalRe.re, src: internalRe.src, tokens: internalRe.t, SEMVER_SPEC_VERSION: require('./internal/constants').SEMVER_SPEC_VERSION, SemVer: require('./classes/semver'), compareIdentifiers: require('./internal/identifiers').compareIdentifiers, rcompareIdentifiers: require('./internal/identifiers').rcompareIdentifiers, parse: require('./functions/parse'), valid: require('./functions/valid'), clean: require('./functions/clean'), inc: require('./functions/inc'), diff: require('./functions/diff'), major: require('./functions/major'), minor: require('./functions/minor'), patch: require('./functions/patch'), prerelease: require('./functions/prerelease'), compare: require('./functions/compare'), rcompare: require('./functions/rcompare'), compareLoose: require('./functions/compare-loose'), compareBuild: require('./functions/compare-build'), sort: require('./functions/sort'), rsort: require('./functions/rsort'), gt: require('./functions/gt'), lt: require('./functions/lt'), eq: require('./functions/eq'), neq: require('./functions/neq'), gte: require('./functions/gte'), lte: require('./functions/lte'), cmp: require('./functions/cmp'), coerce: require('./functions/coerce'), Comparator: require('./classes/comparator'), Range: require('./classes/range'), satisfies: require('./functions/satisfies'), toComparators: require('./ranges/to-comparators'), maxSatisfying: require('./ranges/max-satisfying'), minSatisfying: require('./ranges/min-satisfying'), minVersion: require('./ranges/min-version'), validRange: require('./ranges/valid'), outside: require('./ranges/outside'), gtr: require('./ranges/gtr'), ltr: require('./ranges/ltr'), intersects: require('./ranges/intersects'), simplifyRange: require('./ranges/simplify'), subset: require('./ranges/subset'), } The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "semver", "version": "7.3.5", "description": "The semantic version parser used by npm.", "main": "index.js", "scripts": { "test": "tap", "snap": "tap", "preversion": "npm test", "postversion": "npm publish", "postpublish": "git push origin --follow-tags" }, "devDependencies": { "tap": "^14.10.7" }, "license": "ISC", "repository": "https://github.com/npm/node-semver", "bin": { "semver": "bin/semver.js" }, "files": [ "bin/**/*.js", "range.bnf", "classes/**/*.js", "functions/**/*.js", "internal/**/*.js", "ranges/**/*.js", "index.js", "preload.js" ], "tap": { "check-coverage": true, "coverage-map": "map.js" }, "engines": { "node": ">=10" }, "dependencies": { "lru-cache": "^6.0.0" } } // XXX remove in v8 or beyond module.exports = require('./index.js') range-set ::= range ( logical-or range ) * logical-or ::= ( ' ' ) * '||' ( ' ' ) * range ::= hyphen | simple ( ' ' simple ) * | '' hyphen ::= partial ' - ' partial simple ::= primitive | partial | tilde | caret primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? xr ::= 'x' | 'X' | '*' | nr nr ::= '0' | [1-9] ( [0-9] ) * tilde ::= '~' partial caret ::= '^' partial qualifier ::= ( '-' pre )? ( '+' build )? pre ::= parts build ::= parts parts ::= part ( '.' part ) * part ::= nr | [-0-9A-Za-z]+ // Copyright (c) 2013 Google Inc. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // This file is used to generate an empty .pdb -- with a 4KB pagesize -- that is // then used during the final link for modules that have large PDBs. Otherwise, // the linker will generate a pdb with a page size of 1KB, which imposes a limit // of 1GB on the .pdb. By generating an initial empty .pdb with the compiler // (rather than the linker), this limit is avoided. With this in place PDBs may // grow to 2GB. // // This file is referenced by the msvs_large_pdb mechanism in MSVSUtil.py. # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import errno import filecmp import os.path import re import tempfile import sys import subprocess from collections.abc import MutableSet # A minimal memoizing decorator. It'll blow up if the args aren't immutable, # among other "problems". class memoize: def __init__(self, func): self.func = func self.cache = {} def __call__(self, *args): try: return self.cache[args] except KeyError: result = self.func(*args) self.cache[args] = result return result class GypError(Exception): """Error class representing an error, which is to be presented to the user. The main entry point will catch and display this. """ pass def ExceptionAppend(e, msg): """Append a message to the given exception's message.""" if not e.args: e.args = (msg,) elif len(e.args) == 1: e.args = (str(e.args[0]) + " " + msg,) else: e.args = (str(e.args[0]) + " " + msg,) + e.args[1:] def FindQualifiedTargets(target, qualified_list): """ Given a list of qualified targets, return the qualified targets for the specified |target|. """ return [t for t in qualified_list if ParseQualifiedTarget(t)[1] == target] def ParseQualifiedTarget(target): # Splits a qualified target into a build file, target name and toolset. # NOTE: rsplit is used to disambiguate the Windows drive letter separator. target_split = target.rsplit(":", 1) if len(target_split) == 2: [build_file, target] = target_split else: build_file = None target_split = target.rsplit("#", 1) if len(target_split) == 2: [target, toolset] = target_split else: toolset = None return [build_file, target, toolset] def ResolveTarget(build_file, target, toolset): # This function resolves a target into a canonical form: # - a fully defined build file, either absolute or relative to the current # directory # - a target name # - a toolset # # build_file is the file relative to which 'target' is defined. # target is the qualified target. # toolset is the default toolset for that target. [parsed_build_file, target, parsed_toolset] = ParseQualifiedTarget(target) if parsed_build_file: if build_file: # If a relative path, parsed_build_file is relative to the directory # containing build_file. If build_file is not in the current directory, # parsed_build_file is not a usable path as-is. Resolve it by # interpreting it as relative to build_file. If parsed_build_file is # absolute, it is usable as a path regardless of the current directory, # and os.path.join will return it as-is. build_file = os.path.normpath( os.path.join(os.path.dirname(build_file), parsed_build_file) ) # Further (to handle cases like ../cwd), make it relative to cwd) if not os.path.isabs(build_file): build_file = RelativePath(build_file, ".") else: build_file = parsed_build_file if parsed_toolset: toolset = parsed_toolset return [build_file, target, toolset] def BuildFile(fully_qualified_target): # Extracts the build file from the fully qualified target. return ParseQualifiedTarget(fully_qualified_target)[0] def GetEnvironFallback(var_list, default): """Look up a key in the environment, with fallback to secondary keys and finally falling back to a default value.""" for var in var_list: if var in os.environ: return os.environ[var] return default def QualifiedTarget(build_file, target, toolset): # "Qualified" means the file that a target was defined in and the target # name, separated by a colon, suffixed by a # and the toolset name: # /path/to/file.gyp:target_name#toolset fully_qualified = build_file + ":" + target if toolset: fully_qualified = fully_qualified + "#" + toolset return fully_qualified @memoize def RelativePath(path, relative_to, follow_path_symlink=True): # Assuming both |path| and |relative_to| are relative to the current # directory, returns a relative path that identifies path relative to # relative_to. # If |follow_symlink_path| is true (default) and |path| is a symlink, then # this method returns a path to the real file represented by |path|. If it is # false, this method returns a path to the symlink. If |path| is not a # symlink, this option has no effect. # Convert to normalized (and therefore absolute paths). if follow_path_symlink: path = os.path.realpath(path) else: path = os.path.abspath(path) relative_to = os.path.realpath(relative_to) # On Windows, we can't create a relative path to a different drive, so just # use the absolute path. if sys.platform == "win32": if ( os.path.splitdrive(path)[0].lower() != os.path.splitdrive(relative_to)[0].lower() ): return path # Split the paths into components. path_split = path.split(os.path.sep) relative_to_split = relative_to.split(os.path.sep) # Determine how much of the prefix the two paths share. prefix_len = len(os.path.commonprefix([path_split, relative_to_split])) # Put enough ".." components to back up out of relative_to to the common # prefix, and then append the part of path_split after the common prefix. relative_split = [os.path.pardir] * ( len(relative_to_split) - prefix_len ) + path_split[prefix_len:] if len(relative_split) == 0: # The paths were the same. return "" # Turn it back into a string and we're done. return os.path.join(*relative_split) @memoize def InvertRelativePath(path, toplevel_dir=None): """Given a path like foo/bar that is relative to toplevel_dir, return the inverse relative path back to the toplevel_dir. E.g. os.path.normpath(os.path.join(path, InvertRelativePath(path))) should always produce the empty string, unless the path contains symlinks. """ if not path: return path toplevel_dir = "." if toplevel_dir is None else toplevel_dir return RelativePath(toplevel_dir, os.path.join(toplevel_dir, path)) def FixIfRelativePath(path, relative_to): # Like RelativePath but returns |path| unchanged if it is absolute. if os.path.isabs(path): return path return RelativePath(path, relative_to) def UnrelativePath(path, relative_to): # Assuming that |relative_to| is relative to the current directory, and |path| # is a path relative to the dirname of |relative_to|, returns a path that # identifies |path| relative to the current directory. rel_dir = os.path.dirname(relative_to) return os.path.normpath(os.path.join(rel_dir, path)) # re objects used by EncodePOSIXShellArgument. See IEEE 1003.1 XCU.2.2 at # http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_02 # and the documentation for various shells. # _quote is a pattern that should match any argument that needs to be quoted # with double-quotes by EncodePOSIXShellArgument. It matches the following # characters appearing anywhere in an argument: # \t, \n, space parameter separators # # comments # $ expansions (quoted to always expand within one argument) # % called out by IEEE 1003.1 XCU.2.2 # & job control # ' quoting # (, ) subshell execution # *, ?, [ pathname expansion # ; command delimiter # <, >, | redirection # = assignment # {, } brace expansion (bash) # ~ tilde expansion # It also matches the empty string, because "" (or '') is the only way to # represent an empty string literal argument to a POSIX shell. # # This does not match the characters in _escape, because those need to be # backslash-escaped regardless of whether they appear in a double-quoted # string. _quote = re.compile("[\t\n #$%&'()*;<=>?[{|}~]|^$") # _escape is a pattern that should match any character that needs to be # escaped with a backslash, whether or not the argument matched the _quote # pattern. _escape is used with re.sub to backslash anything in _escape's # first match group, hence the (parentheses) in the regular expression. # # _escape matches the following characters appearing anywhere in an argument: # " to prevent POSIX shells from interpreting this character for quoting # \ to prevent POSIX shells from interpreting this character for escaping # ` to prevent POSIX shells from interpreting this character for command # substitution # Missing from this list is $, because the desired behavior of # EncodePOSIXShellArgument is to permit parameter (variable) expansion. # # Also missing from this list is !, which bash will interpret as the history # expansion character when history is enabled. bash does not enable history # by default in non-interactive shells, so this is not thought to be a problem. # ! was omitted from this list because bash interprets "\!" as a literal string # including the backslash character (avoiding history expansion but retaining # the backslash), which would not be correct for argument encoding. Handling # this case properly would also be problematic because bash allows the history # character to be changed with the histchars shell variable. Fortunately, # as history is not enabled in non-interactive shells and # EncodePOSIXShellArgument is only expected to encode for non-interactive # shells, there is no room for error here by ignoring !. _escape = re.compile(r'(["\\`])') def EncodePOSIXShellArgument(argument): """Encodes |argument| suitably for consumption by POSIX shells. argument may be quoted and escaped as necessary to ensure that POSIX shells treat the returned value as a literal representing the argument passed to this function. Parameter (variable) expansions beginning with $ are allowed to remain intact without escaping the $, to allow the argument to contain references to variables to be expanded by the shell. """ if not isinstance(argument, str): argument = str(argument) if _quote.search(argument): quote = '"' else: quote = "" encoded = quote + re.sub(_escape, r"\\\1", argument) + quote return encoded def EncodePOSIXShellList(list): """Encodes |list| suitably for consumption by POSIX shells. Returns EncodePOSIXShellArgument for each item in list, and joins them together using the space character as an argument separator. """ encoded_arguments = [] for argument in list: encoded_arguments.append(EncodePOSIXShellArgument(argument)) return " ".join(encoded_arguments) def DeepDependencyTargets(target_dicts, roots): """Returns the recursive list of target dependencies.""" dependencies = set() pending = set(roots) while pending: # Pluck out one. r = pending.pop() # Skip if visited already. if r in dependencies: continue # Add it. dependencies.add(r) # Add its children. spec = target_dicts[r] pending.update(set(spec.get("dependencies", []))) pending.update(set(spec.get("dependencies_original", []))) return list(dependencies - set(roots)) def BuildFileTargets(target_list, build_file): """From a target_list, returns the subset from the specified build_file. """ return [p for p in target_list if BuildFile(p) == build_file] def AllTargets(target_list, target_dicts, build_file): """Returns all targets (direct and dependencies) for the specified build_file. """ bftargets = BuildFileTargets(target_list, build_file) deptargets = DeepDependencyTargets(target_dicts, bftargets) return bftargets + deptargets def WriteOnDiff(filename): """Write to a file only if the new contents differ. Arguments: filename: name of the file to potentially write to. Returns: A file like object which will write to temporary file and only overwrite the target if it differs (on close). """ class Writer: """Wrapper around file which only covers the target if it differs.""" def __init__(self): # On Cygwin remove the "dir" argument # `C:` prefixed paths are treated as relative, # consequently ending up with current dir "/cygdrive/c/..." # being prefixed to those, which was # obviously a non-existent path, # for example: "/cygdrive/c//C:\". # For more details see: # https://docs.python.org/2/library/tempfile.html#tempfile.mkstemp base_temp_dir = "" if IsCygwin() else os.path.dirname(filename) # Pick temporary file. tmp_fd, self.tmp_path = tempfile.mkstemp( suffix=".tmp", prefix=os.path.split(filename)[1] + ".gyp.", dir=base_temp_dir, ) try: self.tmp_file = os.fdopen(tmp_fd, "wb") except Exception: # Don't leave turds behind. os.unlink(self.tmp_path) raise def __getattr__(self, attrname): # Delegate everything else to self.tmp_file return getattr(self.tmp_file, attrname) def close(self): try: # Close tmp file. self.tmp_file.close() # Determine if different. same = False try: same = filecmp.cmp(self.tmp_path, filename, False) except OSError as e: if e.errno != errno.ENOENT: raise if same: # The new file is identical to the old one, just get rid of the new # one. os.unlink(self.tmp_path) else: # The new file is different from the old one, # or there is no old one. # Rename the new file to the permanent name. # # tempfile.mkstemp uses an overly restrictive mode, resulting in a # file that can only be read by the owner, regardless of the umask. # There's no reason to not respect the umask here, # which means that an extra hoop is required # to fetch it and reset the new file's mode. # # No way to get the umask without setting a new one? Set a safe one # and then set it back to the old value. umask = os.umask(0o77) os.umask(umask) os.chmod(self.tmp_path, 0o666 & ~umask) if sys.platform == "win32" and os.path.exists(filename): # NOTE: on windows (but not cygwin) rename will not replace an # existing file, so it must be preceded with a remove. # Sadly there is no way to make the switch atomic. os.remove(filename) os.rename(self.tmp_path, filename) except Exception: # Don't leave turds behind. os.unlink(self.tmp_path) raise def write(self, s): self.tmp_file.write(s.encode("utf-8")) return Writer() def EnsureDirExists(path): """Make sure the directory for |path| exists.""" try: os.makedirs(os.path.dirname(path)) except OSError: pass def GetFlavor(params): """Returns |params.flavor| if it's set, the system's default flavor else.""" flavors = { "cygwin": "win", "win32": "win", "darwin": "mac", } if "flavor" in params: return params["flavor"] if sys.platform in flavors: return flavors[sys.platform] if sys.platform.startswith("sunos"): return "solaris" if sys.platform.startswith(("dragonfly", "freebsd")): return "freebsd" if sys.platform.startswith("openbsd"): return "openbsd" if sys.platform.startswith("netbsd"): return "netbsd" if sys.platform.startswith("aix"): return "aix" if sys.platform.startswith(("os390", "zos")): return "zos" return "linux" def CopyTool(flavor, out_path, generator_flags={}): """Finds (flock|mac|win)_tool.gyp in the gyp directory and copies it to |out_path|.""" # aix and solaris just need flock emulation. mac and win use more complicated # support scripts. prefix = {"aix": "flock", "solaris": "flock", "mac": "mac", "win": "win"}.get( flavor, None ) if not prefix: return # Slurp input file. source_path = os.path.join( os.path.dirname(os.path.abspath(__file__)), "%s_tool.py" % prefix ) with open(source_path) as source_file: source = source_file.readlines() # Set custom header flags. header = "# Generated by gyp. Do not edit.\n" mac_toolchain_dir = generator_flags.get("mac_toolchain_dir", None) if flavor == "mac" and mac_toolchain_dir: header += "import os;\nos.environ['DEVELOPER_DIR']='%s'\n" % mac_toolchain_dir # Add header and write it out. tool_path = os.path.join(out_path, "gyp-%s-tool" % prefix) with open(tool_path, "w") as tool_file: tool_file.write("".join([source[0], header] + source[1:])) # Make file executable. os.chmod(tool_path, 0o755) # From Alex Martelli, # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52560 # ASPN: Python Cookbook: Remove duplicates from a sequence # First comment, dated 2001/10/13. # (Also in the printed Python Cookbook.) def uniquer(seq, idfun=lambda x: x): seen = {} result = [] for item in seq: marker = idfun(item) if marker in seen: continue seen[marker] = 1 result.append(item) return result # Based on http://code.activestate.com/recipes/576694/. class OrderedSet(MutableSet): def __init__(self, iterable=None): self.end = end = [] end += [None, end, end] # sentinel node for doubly linked list self.map = {} # key --> [key, prev, next] if iterable is not None: self |= iterable def __len__(self): return len(self.map) def __contains__(self, key): return key in self.map def add(self, key): if key not in self.map: end = self.end curr = end[1] curr[2] = end[1] = self.map[key] = [key, curr, end] def discard(self, key): if key in self.map: key, prev_item, next_item = self.map.pop(key) prev_item[2] = next_item next_item[1] = prev_item def __iter__(self): end = self.end curr = end[2] while curr is not end: yield curr[0] curr = curr[2] def __reversed__(self): end = self.end curr = end[1] while curr is not end: yield curr[0] curr = curr[1] # The second argument is an addition that causes a pylint warning. def pop(self, last=True): # pylint: disable=W0221 if not self: raise KeyError("set is empty") key = self.end[1][0] if last else self.end[2][0] self.discard(key) return key def __repr__(self): if not self: return f"{self.__class__.__name__}()" return f"{self.__class__.__name__}({list(self)!r})" def __eq__(self, other): if isinstance(other, OrderedSet): return len(self) == len(other) and list(self) == list(other) return set(self) == set(other) # Extensions to the recipe. def update(self, iterable): for i in iterable: if i not in self: self.add(i) class CycleError(Exception): """An exception raised when an unexpected cycle is detected.""" def __init__(self, nodes): self.nodes = nodes def __str__(self): return "CycleError: cycle involving: " + str(self.nodes) def TopologicallySorted(graph, get_edges): r"""Topologically sort based on a user provided edge definition. Args: graph: A list of node names. get_edges: A function mapping from node name to a hashable collection of node names which this node has outgoing edges to. Returns: A list containing all of the node in graph in topological order. It is assumed that calling get_edges once for each node and caching is cheaper than repeatedly calling get_edges. Raises: CycleError in the event of a cycle. Example: graph = {'a': '$(b) $(c)', 'b': 'hi', 'c': '$(b)'} def GetEdges(node): return re.findall(r'\$\(([^))]\)', graph[node]) print TopologicallySorted(graph.keys(), GetEdges) ==> ['a', 'c', b'] """ get_edges = memoize(get_edges) visited = set() visiting = set() ordered_nodes = [] def Visit(node): if node in visiting: raise CycleError(visiting) if node in visited: return visited.add(node) visiting.add(node) for neighbor in get_edges(node): Visit(neighbor) visiting.remove(node) ordered_nodes.insert(0, node) for node in sorted(graph): Visit(node) return ordered_nodes def CrossCompileRequested(): # TODO: figure out how to not build extra host objects in the # non-cross-compile case when this is enabled, and enable unconditionally. return ( os.environ.get("GYP_CROSSCOMPILE") or os.environ.get("AR_host") or os.environ.get("CC_host") or os.environ.get("CXX_host") or os.environ.get("AR_target") or os.environ.get("CC_target") or os.environ.get("CXX_target") ) def IsCygwin(): try: out = subprocess.Popen( "uname", stdout=subprocess.PIPE, stderr=subprocess.STDOUT ) stdout = out.communicate()[0].decode("utf-8") return "CYGWIN" in str(stdout) except Exception: return False #!/usr/bin/env python3 # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unit tests for the common.py file.""" import gyp.common import unittest import sys class TestTopologicallySorted(unittest.TestCase): def test_Valid(self): """Test that sorting works on a valid graph with one possible order.""" graph = { "a": ["b", "c"], "b": [], "c": ["d"], "d": ["b"], } def GetEdge(node): return tuple(graph[node]) self.assertEqual( gyp.common.TopologicallySorted(graph.keys(), GetEdge), ["a", "c", "d", "b"] ) def test_Cycle(self): """Test that an exception is thrown on a cyclic graph.""" graph = { "a": ["b"], "b": ["c"], "c": ["d"], "d": ["a"], } def GetEdge(node): return tuple(graph[node]) self.assertRaises( gyp.common.CycleError, gyp.common.TopologicallySorted, graph.keys(), GetEdge ) class TestGetFlavor(unittest.TestCase): """Test that gyp.common.GetFlavor works as intended""" original_platform = "" def setUp(self): self.original_platform = sys.platform def tearDown(self): sys.platform = self.original_platform def assertFlavor(self, expected, argument, param): sys.platform = argument self.assertEqual(expected, gyp.common.GetFlavor(param)) def test_platform_default(self): self.assertFlavor("freebsd", "freebsd9", {}) self.assertFlavor("freebsd", "freebsd10", {}) self.assertFlavor("openbsd", "openbsd5", {}) self.assertFlavor("solaris", "sunos5", {}) self.assertFlavor("solaris", "sunos", {}) self.assertFlavor("linux", "linux2", {}) self.assertFlavor("linux", "linux3", {}) self.assertFlavor("linux", "linux", {}) def test_param(self): self.assertFlavor("foobar", "linux2", {"flavor": "foobar"}) if __name__ == "__main__": unittest.main() # Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import sys import re import os import locale from functools import reduce def XmlToString(content, encoding="utf-8", pretty=False): """ Writes the XML content to disk, touching the file only if it has changed. Visual Studio files have a lot of pre-defined structures. This function makes it easy to represent these structures as Python data structures, instead of having to create a lot of function calls. Each XML element of the content is represented as a list composed of: 1. The name of the element, a string, 2. The attributes of the element, a dictionary (optional), and 3+. The content of the element, if any. Strings are simple text nodes and lists are child elements. Example 1: becomes ['test'] Example 2: This is it! becomes ['myelement', {'a':'value1', 'b':'value2'}, ['childtype', 'This is'], ['childtype', 'it!'], ] Args: content: The structured content to be converted. encoding: The encoding to report on the first XML line. pretty: True if we want pretty printing with indents and new lines. Returns: The XML content as a string. """ # We create a huge list of all the elements of the file. xml_parts = ['' % encoding] if pretty: xml_parts.append("\n") _ConstructContentList(xml_parts, content, pretty) # Convert it to a string return "".join(xml_parts) def _ConstructContentList(xml_parts, specification, pretty, level=0): """ Appends the XML parts corresponding to the specification. Args: xml_parts: A list of XML parts to be appended to. specification: The specification of the element. See EasyXml docs. pretty: True if we want pretty printing with indents and new lines. level: Indentation level. """ # The first item in a specification is the name of the element. if pretty: indentation = " " * level new_line = "\n" else: indentation = "" new_line = "" name = specification[0] if not isinstance(name, str): raise Exception( "The first item of an EasyXml specification should be " "a string. Specification was " + str(specification) ) xml_parts.append(indentation + "<" + name) # Optionally in second position is a dictionary of the attributes. rest = specification[1:] if rest and isinstance(rest[0], dict): for at, val in sorted(rest[0].items()): xml_parts.append(f' {at}="{_XmlEscape(val, attr=True)}"') rest = rest[1:] if rest: xml_parts.append(">") all_strings = reduce(lambda x, y: x and isinstance(y, str), rest, True) multi_line = not all_strings if multi_line and new_line: xml_parts.append(new_line) for child_spec in rest: # If it's a string, append a text node. # Otherwise recurse over that child definition if isinstance(child_spec, str): xml_parts.append(_XmlEscape(child_spec)) else: _ConstructContentList(xml_parts, child_spec, pretty, level + 1) if multi_line and indentation: xml_parts.append(indentation) xml_parts.append(f"{new_line}") else: xml_parts.append("/>%s" % new_line) def WriteXmlIfChanged(content, path, encoding="utf-8", pretty=False, win32=(sys.platform == "win32")): """ Writes the XML content to disk, touching the file only if it has changed. Args: content: The structured content to be written. path: Location of the file. encoding: The encoding to report on the first line of the XML file. pretty: True if we want pretty printing with indents and new lines. """ xml_string = XmlToString(content, encoding, pretty) if win32 and os.linesep != "\r\n": xml_string = xml_string.replace("\n", "\r\n") default_encoding = locale.getdefaultlocale()[1] if default_encoding and default_encoding.upper() != encoding.upper(): xml_string = xml_string.encode(encoding) # Get the old content try: with open(path) as file: existing = file.read() except OSError: existing = None # It has changed, write it if existing != xml_string: with open(path, "wb") as file: file.write(xml_string) _xml_escape_map = { '"': """, "'": "'", "<": "<", ">": ">", "&": "&", "\n": " ", "\r": " ", } _xml_escape_re = re.compile("(%s)" % "|".join(map(re.escape, _xml_escape_map.keys()))) def _XmlEscape(value, attr=False): """ Escape a string for inclusion in XML.""" def replace(match): m = match.string[match.start() : match.end()] # don't replace single quotes in attrs if attr and m == "'": return m return _xml_escape_map[m] return _xml_escape_re.sub(replace, value) #!/usr/bin/env python3 # Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Unit tests for the easy_xml.py file. """ import gyp.easy_xml as easy_xml import unittest from io import StringIO class TestSequenceFunctions(unittest.TestCase): def setUp(self): self.stderr = StringIO() def test_EasyXml_simple(self): self.assertEqual( easy_xml.XmlToString(["test"]), '', ) self.assertEqual( easy_xml.XmlToString(["test"], encoding="Windows-1252"), '', ) def test_EasyXml_simple_with_attributes(self): self.assertEqual( easy_xml.XmlToString(["test2", {"a": "value1", "b": "value2"}]), '', ) def test_EasyXml_escaping(self): original = "'\"\r&\nfoo" converted = "<test>'" & foo" converted_apos = converted.replace("'", "'") self.assertEqual( easy_xml.XmlToString(["test3", {"a": original}, original]), '%s' % (converted, converted_apos), ) def test_EasyXml_pretty(self): self.assertEqual( easy_xml.XmlToString( ["test3", ["GrandParent", ["Parent1", ["Child"]], ["Parent2"]]], pretty=True, ), '\n' "\n" " \n" " \n" " \n" " \n" " \n" " \n" "\n", ) def test_EasyXml_complex(self): # We want to create: target = ( '' "" '' "{D2250C20-3A94-4FB9-AF73-11BC5B73884B}" "Win32Proj" "automated_ui_tests" "" '' "' "Application" "Unicode" "" "" ) xml = easy_xml.XmlToString( [ "Project", [ "PropertyGroup", {"Label": "Globals"}, ["ProjectGuid", "{D2250C20-3A94-4FB9-AF73-11BC5B73884B}"], ["Keyword", "Win32Proj"], ["RootNamespace", "automated_ui_tests"], ], ["Import", {"Project": "$(VCTargetsPath)\\Microsoft.Cpp.props"}], [ "PropertyGroup", { "Condition": "'$(Configuration)|$(Platform)'=='Debug|Win32'", "Label": "Configuration", }, ["ConfigurationType", "Application"], ["CharacterSet", "Unicode"], ], ] ) self.assertEqual(xml, target) if __name__ == "__main__": unittest.main() #!/usr/bin/env python3 # Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """These functions are executed via gyp-flock-tool when using the Makefile generator. Used on systems that don't have a built-in flock.""" import fcntl import os import struct import subprocess import sys def main(args): executor = FlockTool() executor.Dispatch(args) class FlockTool: """This class emulates the 'flock' command.""" def Dispatch(self, args): """Dispatches a string command to a method.""" if len(args) < 1: raise Exception("Not enough arguments") method = "Exec%s" % self._CommandifyName(args[0]) getattr(self, method)(*args[1:]) def _CommandifyName(self, name_string): """Transforms a tool name like copy-info-plist to CopyInfoPlist""" return name_string.title().replace("-", "") def ExecFlock(self, lockfile, *cmd_list): """Emulates the most basic behavior of Linux's flock(1).""" # Rely on exception handling to report errors. # Note that the stock python on SunOS has a bug # where fcntl.flock(fd, LOCK_EX) always fails # with EBADF, that's why we use this F_SETLK # hack instead. fd = os.open(lockfile, os.O_WRONLY | os.O_NOCTTY | os.O_CREAT, 0o666) if sys.platform.startswith("aix"): # Python on AIX is compiled with LARGEFILE support, which changes the # struct size. op = struct.pack("hhIllqq", fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0) else: op = struct.pack("hhllhhl", fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0) fcntl.fcntl(fd, fcntl.F_SETLK, op) return subprocess.call(cmd_list) if __name__ == "__main__": sys.exit(main(sys.argv[1:])) # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import ast import gyp.common import gyp.simple_copy import multiprocessing import os.path import re import shlex import signal import subprocess import sys import threading import traceback from distutils.version import StrictVersion from gyp.common import GypError from gyp.common import OrderedSet # A list of types that are treated as linkable. linkable_types = [ "executable", "shared_library", "loadable_module", "mac_kernel_extension", "windows_driver", ] # A list of sections that contain links to other targets. dependency_sections = ["dependencies", "export_dependent_settings"] # base_path_sections is a list of sections defined by GYP that contain # pathnames. The generators can provide more keys, the two lists are merged # into path_sections, but you should call IsPathSection instead of using either # list directly. base_path_sections = [ "destination", "files", "include_dirs", "inputs", "libraries", "outputs", "sources", ] path_sections = set() # These per-process dictionaries are used to cache build file data when loading # in parallel mode. per_process_data = {} per_process_aux_data = {} def IsPathSection(section): # If section ends in one of the '=+?!' characters, it's applied to a section # without the trailing characters. '/' is notably absent from this list, # because there's no way for a regular expression to be treated as a path. while section and section[-1:] in "=+?!": section = section[:-1] if section in path_sections: return True # Sections matching the regexp '_(dir|file|path)s?$' are also # considered PathSections. Using manual string matching since that # is much faster than the regexp and this can be called hundreds of # thousands of times so micro performance matters. if "_" in section: tail = section[-6:] if tail[-1] == "s": tail = tail[:-1] if tail[-5:] in ("_file", "_path"): return True return tail[-4:] == "_dir" return False # base_non_configuration_keys is a list of key names that belong in the target # itself and should not be propagated into its configurations. It is merged # with a list that can come from the generator to # create non_configuration_keys. base_non_configuration_keys = [ # Sections that must exist inside targets and not configurations. "actions", "configurations", "copies", "default_configuration", "dependencies", "dependencies_original", "libraries", "postbuilds", "product_dir", "product_extension", "product_name", "product_prefix", "rules", "run_as", "sources", "standalone_static_library", "suppress_wildcard", "target_name", "toolset", "toolsets", "type", # Sections that can be found inside targets or configurations, but that # should not be propagated from targets into their configurations. "variables", ] non_configuration_keys = [] # Keys that do not belong inside a configuration dictionary. invalid_configuration_keys = [ "actions", "all_dependent_settings", "configurations", "dependencies", "direct_dependent_settings", "libraries", "link_settings", "sources", "standalone_static_library", "target_name", "type", ] # Controls whether or not the generator supports multiple toolsets. multiple_toolsets = False # Paths for converting filelist paths to output paths: { # toplevel, # qualified_output_dir, # } generator_filelist_paths = None def GetIncludedBuildFiles(build_file_path, aux_data, included=None): """Return a list of all build files included into build_file_path. The returned list will contain build_file_path as well as all other files that it included, either directly or indirectly. Note that the list may contain files that were included into a conditional section that evaluated to false and was not merged into build_file_path's dict. aux_data is a dict containing a key for each build file or included build file. Those keys provide access to dicts whose "included" keys contain lists of all other files included by the build file. included should be left at its default None value by external callers. It is used for recursion. The returned list will not contain any duplicate entries. Each build file in the list will be relative to the current directory. """ if included is None: included = [] if build_file_path in included: return included included.append(build_file_path) for included_build_file in aux_data[build_file_path].get("included", []): GetIncludedBuildFiles(included_build_file, aux_data, included) return included def CheckedEval(file_contents): """Return the eval of a gyp file. The gyp file is restricted to dictionaries and lists only, and repeated keys are not allowed. Note that this is slower than eval() is. """ syntax_tree = ast.parse(file_contents) assert isinstance(syntax_tree, ast.Module) c1 = syntax_tree.body assert len(c1) == 1 c2 = c1[0] assert isinstance(c2, ast.Expr) return CheckNode(c2.value, []) def CheckNode(node, keypath): if isinstance(node, ast.Dict): dict = {} for key, value in zip(node.keys, node.values): assert isinstance(key, ast.Str) key = key.s if key in dict: raise GypError( "Key '" + key + "' repeated at level " + repr(len(keypath) + 1) + " with key path '" + ".".join(keypath) + "'" ) kp = list(keypath) # Make a copy of the list for descending this node. kp.append(key) dict[key] = CheckNode(value, kp) return dict elif isinstance(node, ast.List): children = [] for index, child in enumerate(node.elts): kp = list(keypath) # Copy list. kp.append(repr(index)) children.append(CheckNode(child, kp)) return children elif isinstance(node, ast.Str): return node.s else: raise TypeError( "Unknown AST node at key path '" + ".".join(keypath) + "': " + repr(node) ) def LoadOneBuildFile(build_file_path, data, aux_data, includes, is_target, check): if build_file_path in data: return data[build_file_path] if os.path.exists(build_file_path): build_file_contents = open(build_file_path, encoding='utf-8').read() else: raise GypError(f"{build_file_path} not found (cwd: {os.getcwd()})") build_file_data = None try: if check: build_file_data = CheckedEval(build_file_contents) else: build_file_data = eval(build_file_contents, {"__builtins__": {}}, None) except SyntaxError as e: e.filename = build_file_path raise except Exception as e: gyp.common.ExceptionAppend(e, "while reading " + build_file_path) raise if type(build_file_data) is not dict: raise GypError("%s does not evaluate to a dictionary." % build_file_path) data[build_file_path] = build_file_data aux_data[build_file_path] = {} # Scan for includes and merge them in. if "skip_includes" not in build_file_data or not build_file_data["skip_includes"]: try: if is_target: LoadBuildFileIncludesIntoDict( build_file_data, build_file_path, data, aux_data, includes, check ) else: LoadBuildFileIncludesIntoDict( build_file_data, build_file_path, data, aux_data, None, check ) except Exception as e: gyp.common.ExceptionAppend( e, "while reading includes of " + build_file_path ) raise return build_file_data def LoadBuildFileIncludesIntoDict( subdict, subdict_path, data, aux_data, includes, check ): includes_list = [] if includes is not None: includes_list.extend(includes) if "includes" in subdict: for include in subdict["includes"]: # "include" is specified relative to subdict_path, so compute the real # path to include by appending the provided "include" to the directory # in which subdict_path resides. relative_include = os.path.normpath( os.path.join(os.path.dirname(subdict_path), include) ) includes_list.append(relative_include) # Unhook the includes list, it's no longer needed. del subdict["includes"] # Merge in the included files. for include in includes_list: if "included" not in aux_data[subdict_path]: aux_data[subdict_path]["included"] = [] aux_data[subdict_path]["included"].append(include) gyp.DebugOutput(gyp.DEBUG_INCLUDES, "Loading Included File: '%s'", include) MergeDicts( subdict, LoadOneBuildFile(include, data, aux_data, None, False, check), subdict_path, include, ) # Recurse into subdictionaries. for k, v in subdict.items(): if type(v) is dict: LoadBuildFileIncludesIntoDict(v, subdict_path, data, aux_data, None, check) elif type(v) is list: LoadBuildFileIncludesIntoList(v, subdict_path, data, aux_data, check) # This recurses into lists so that it can look for dicts. def LoadBuildFileIncludesIntoList(sublist, sublist_path, data, aux_data, check): for item in sublist: if type(item) is dict: LoadBuildFileIncludesIntoDict( item, sublist_path, data, aux_data, None, check ) elif type(item) is list: LoadBuildFileIncludesIntoList(item, sublist_path, data, aux_data, check) # Processes toolsets in all the targets. This recurses into condition entries # since they can contain toolsets as well. def ProcessToolsetsInDict(data): if "targets" in data: target_list = data["targets"] new_target_list = [] for target in target_list: # If this target already has an explicit 'toolset', and no 'toolsets' # list, don't modify it further. if "toolset" in target and "toolsets" not in target: new_target_list.append(target) continue if multiple_toolsets: toolsets = target.get("toolsets", ["target"]) else: toolsets = ["target"] # Make sure this 'toolsets' definition is only processed once. if "toolsets" in target: del target["toolsets"] if len(toolsets) > 0: # Optimization: only do copies if more than one toolset is specified. for build in toolsets[1:]: new_target = gyp.simple_copy.deepcopy(target) new_target["toolset"] = build new_target_list.append(new_target) target["toolset"] = toolsets[0] new_target_list.append(target) data["targets"] = new_target_list if "conditions" in data: for condition in data["conditions"]: if type(condition) is list: for condition_dict in condition[1:]: if type(condition_dict) is dict: ProcessToolsetsInDict(condition_dict) # TODO(mark): I don't love this name. It just means that it's going to load # a build file that contains targets and is expected to provide a targets dict # that contains the targets... def LoadTargetBuildFile( build_file_path, data, aux_data, variables, includes, depth, check, load_dependencies, ): # If depth is set, predefine the DEPTH variable to be a relative path from # this build file's directory to the directory identified by depth. if depth: # TODO(dglazkov) The backslash/forward-slash replacement at the end is a # temporary measure. This should really be addressed by keeping all paths # in POSIX until actual project generation. d = gyp.common.RelativePath(depth, os.path.dirname(build_file_path)) if d == "": variables["DEPTH"] = "." else: variables["DEPTH"] = d.replace("\\", "/") # The 'target_build_files' key is only set when loading target build files in # the non-parallel code path, where LoadTargetBuildFile is called # recursively. In the parallel code path, we don't need to check whether the # |build_file_path| has already been loaded, because the 'scheduled' set in # ParallelState guarantees that we never load the same |build_file_path| # twice. if "target_build_files" in data: if build_file_path in data["target_build_files"]: # Already loaded. return False data["target_build_files"].add(build_file_path) gyp.DebugOutput( gyp.DEBUG_INCLUDES, "Loading Target Build File '%s'", build_file_path ) build_file_data = LoadOneBuildFile( build_file_path, data, aux_data, includes, True, check ) # Store DEPTH for later use in generators. build_file_data["_DEPTH"] = depth # Set up the included_files key indicating which .gyp files contributed to # this target dict. if "included_files" in build_file_data: raise GypError(build_file_path + " must not contain included_files key") included = GetIncludedBuildFiles(build_file_path, aux_data) build_file_data["included_files"] = [] for included_file in included: # included_file is relative to the current directory, but it needs to # be made relative to build_file_path's directory. included_relative = gyp.common.RelativePath( included_file, os.path.dirname(build_file_path) ) build_file_data["included_files"].append(included_relative) # Do a first round of toolsets expansion so that conditions can be defined # per toolset. ProcessToolsetsInDict(build_file_data) # Apply "pre"/"early" variable expansions and condition evaluations. ProcessVariablesAndConditionsInDict( build_file_data, PHASE_EARLY, variables, build_file_path ) # Since some toolsets might have been defined conditionally, perform # a second round of toolsets expansion now. ProcessToolsetsInDict(build_file_data) # Look at each project's target_defaults dict, and merge settings into # targets. if "target_defaults" in build_file_data: if "targets" not in build_file_data: raise GypError("Unable to find targets in build file %s" % build_file_path) index = 0 while index < len(build_file_data["targets"]): # This procedure needs to give the impression that target_defaults is # used as defaults, and the individual targets inherit from that. # The individual targets need to be merged into the defaults. Make # a deep copy of the defaults for each target, merge the target dict # as found in the input file into that copy, and then hook up the # copy with the target-specific data merged into it as the replacement # target dict. old_target_dict = build_file_data["targets"][index] new_target_dict = gyp.simple_copy.deepcopy( build_file_data["target_defaults"] ) MergeDicts( new_target_dict, old_target_dict, build_file_path, build_file_path ) build_file_data["targets"][index] = new_target_dict index += 1 # No longer needed. del build_file_data["target_defaults"] # Look for dependencies. This means that dependency resolution occurs # after "pre" conditionals and variable expansion, but before "post" - # in other words, you can't put a "dependencies" section inside a "post" # conditional within a target. dependencies = [] if "targets" in build_file_data: for target_dict in build_file_data["targets"]: if "dependencies" not in target_dict: continue for dependency in target_dict["dependencies"]: dependencies.append( gyp.common.ResolveTarget(build_file_path, dependency, None)[0] ) if load_dependencies: for dependency in dependencies: try: LoadTargetBuildFile( dependency, data, aux_data, variables, includes, depth, check, load_dependencies, ) except Exception as e: gyp.common.ExceptionAppend( e, "while loading dependencies of %s" % build_file_path ) raise else: return (build_file_path, dependencies) def CallLoadTargetBuildFile( global_flags, build_file_path, variables, includes, depth, check, generator_input_info, ): """Wrapper around LoadTargetBuildFile for parallel processing. This wrapper is used when LoadTargetBuildFile is executed in a worker process. """ try: signal.signal(signal.SIGINT, signal.SIG_IGN) # Apply globals so that the worker process behaves the same. for key, value in global_flags.items(): globals()[key] = value SetGeneratorGlobals(generator_input_info) result = LoadTargetBuildFile( build_file_path, per_process_data, per_process_aux_data, variables, includes, depth, check, False, ) if not result: return result (build_file_path, dependencies) = result # We can safely pop the build_file_data from per_process_data because it # will never be referenced by this process again, so we don't need to keep # it in the cache. build_file_data = per_process_data.pop(build_file_path) # This gets serialized and sent back to the main process via a pipe. # It's handled in LoadTargetBuildFileCallback. return (build_file_path, build_file_data, dependencies) except GypError as e: sys.stderr.write("gyp: %s\n" % e) return None except Exception as e: print("Exception:", e, file=sys.stderr) print(traceback.format_exc(), file=sys.stderr) return None class ParallelProcessingError(Exception): pass class ParallelState: """Class to keep track of state when processing input files in parallel. If build files are loaded in parallel, use this to keep track of state during farming out and processing parallel jobs. It's stored in a global so that the callback function can have access to it. """ def __init__(self): # The multiprocessing pool. self.pool = None # The condition variable used to protect this object and notify # the main loop when there might be more data to process. self.condition = None # The "data" dict that was passed to LoadTargetBuildFileParallel self.data = None # The number of parallel calls outstanding; decremented when a response # was received. self.pending = 0 # The set of all build files that have been scheduled, so we don't # schedule the same one twice. self.scheduled = set() # A list of dependency build file paths that haven't been scheduled yet. self.dependencies = [] # Flag to indicate if there was an error in a child process. self.error = False def LoadTargetBuildFileCallback(self, result): """Handle the results of running LoadTargetBuildFile in another process. """ self.condition.acquire() if not result: self.error = True self.condition.notify() self.condition.release() return (build_file_path0, build_file_data0, dependencies0) = result self.data[build_file_path0] = build_file_data0 self.data["target_build_files"].add(build_file_path0) for new_dependency in dependencies0: if new_dependency not in self.scheduled: self.scheduled.add(new_dependency) self.dependencies.append(new_dependency) self.pending -= 1 self.condition.notify() self.condition.release() def LoadTargetBuildFilesParallel( build_files, data, variables, includes, depth, check, generator_input_info ): parallel_state = ParallelState() parallel_state.condition = threading.Condition() # Make copies of the build_files argument that we can modify while working. parallel_state.dependencies = list(build_files) parallel_state.scheduled = set(build_files) parallel_state.pending = 0 parallel_state.data = data try: parallel_state.condition.acquire() while parallel_state.dependencies or parallel_state.pending: if parallel_state.error: break if not parallel_state.dependencies: parallel_state.condition.wait() continue dependency = parallel_state.dependencies.pop() parallel_state.pending += 1 global_flags = { "path_sections": globals()["path_sections"], "non_configuration_keys": globals()["non_configuration_keys"], "multiple_toolsets": globals()["multiple_toolsets"], } if not parallel_state.pool: parallel_state.pool = multiprocessing.Pool(multiprocessing.cpu_count()) parallel_state.pool.apply_async( CallLoadTargetBuildFile, args=( global_flags, dependency, variables, includes, depth, check, generator_input_info, ), callback=parallel_state.LoadTargetBuildFileCallback, ) except KeyboardInterrupt as e: parallel_state.pool.terminate() raise e parallel_state.condition.release() parallel_state.pool.close() parallel_state.pool.join() parallel_state.pool = None if parallel_state.error: sys.exit(1) # Look for the bracket that matches the first bracket seen in a # string, and return the start and end as a tuple. For example, if # the input is something like "<(foo <(bar)) blah", then it would # return (1, 13), indicating the entire string except for the leading # "<" and trailing " blah". LBRACKETS = set("{[(") BRACKETS = {"}": "{", "]": "[", ")": "("} def FindEnclosingBracketGroup(input_str): stack = [] start = -1 for index, char in enumerate(input_str): if char in LBRACKETS: stack.append(char) if start == -1: start = index elif char in BRACKETS: if not stack: return (-1, -1) if stack.pop() != BRACKETS[char]: return (-1, -1) if not stack: return (start, index + 1) return (-1, -1) def IsStrCanonicalInt(string): """Returns True if |string| is in its canonical integer form. The canonical form is such that str(int(string)) == string. """ if type(string) is str: # This function is called a lot so for maximum performance, avoid # involving regexps which would otherwise make the code much # shorter. Regexps would need twice the time of this function. if string: if string == "0": return True if string[0] == "-": string = string[1:] if not string: return False if "1" <= string[0] <= "9": return string.isdigit() return False # This matches things like "<(asdf)", "(?P<(?:(?:!?@?)|\|)?)" r"(?P[-a-zA-Z0-9_.]+)?" r"\((?P\s*\[?)" r"(?P.*?)(\]?)\))" ) # This matches the same as early_variable_re, but with '>' instead of '<'. late_variable_re = re.compile( r"(?P(?P>(?:(?:!?@?)|\|)?)" r"(?P[-a-zA-Z0-9_.]+)?" r"\((?P\s*\[?)" r"(?P.*?)(\]?)\))" ) # This matches the same as early_variable_re, but with '^' instead of '<'. latelate_variable_re = re.compile( r"(?P(?P[\^](?:(?:!?@?)|\|)?)" r"(?P[-a-zA-Z0-9_.]+)?" r"\((?P\s*\[?)" r"(?P.*?)(\]?)\))" ) # Global cache of results from running commands so they don't have to be run # more then once. cached_command_results = {} def FixupPlatformCommand(cmd): if sys.platform == "win32": if type(cmd) is list: cmd = [re.sub("^cat ", "type ", cmd[0])] + cmd[1:] else: cmd = re.sub("^cat ", "type ", cmd) return cmd PHASE_EARLY = 0 PHASE_LATE = 1 PHASE_LATELATE = 2 def ExpandVariables(input, phase, variables, build_file): # Look for the pattern that gets expanded into variables if phase == PHASE_EARLY: variable_re = early_variable_re expansion_symbol = "<" elif phase == PHASE_LATE: variable_re = late_variable_re expansion_symbol = ">" elif phase == PHASE_LATELATE: variable_re = latelate_variable_re expansion_symbol = "^" else: assert False input_str = str(input) if IsStrCanonicalInt(input_str): return int(input_str) # Do a quick scan to determine if an expensive regex search is warranted. if expansion_symbol not in input_str: return input_str # Get the entire list of matches as a list of MatchObject instances. # (using findall here would return strings instead of MatchObjects). matches = list(variable_re.finditer(input_str)) if not matches: return input_str output = input_str # Reverse the list of matches so that replacements are done right-to-left. # That ensures that earlier replacements won't mess up the string in a # way that causes later calls to find the earlier substituted text instead # of what's intended for replacement. matches.reverse() for match_group in matches: match = match_group.groupdict() gyp.DebugOutput(gyp.DEBUG_VARIABLES, "Matches: %r", match) # match['replace'] is the substring to look for, match['type'] # is the character code for the replacement type (< > ! <| >| <@ # >@ !@), match['is_array'] contains a '[' for command # arrays, and match['content'] is the name of the variable (< >) # or command to run (!). match['command_string'] is an optional # command string. Currently, only 'pymod_do_main' is supported. # run_command is true if a ! variant is used. run_command = "!" in match["type"] command_string = match["command_string"] # file_list is true if a | variant is used. file_list = "|" in match["type"] # Capture these now so we can adjust them later. replace_start = match_group.start("replace") replace_end = match_group.end("replace") # Find the ending paren, and re-evaluate the contained string. (c_start, c_end) = FindEnclosingBracketGroup(input_str[replace_start:]) # Adjust the replacement range to match the entire command # found by FindEnclosingBracketGroup (since the variable_re # probably doesn't match the entire command if it contained # nested variables). replace_end = replace_start + c_end # Find the "real" replacement, matching the appropriate closing # paren, and adjust the replacement start and end. replacement = input_str[replace_start:replace_end] # Figure out what the contents of the variable parens are. contents_start = replace_start + c_start + 1 contents_end = replace_end - 1 contents = input_str[contents_start:contents_end] # Do filter substitution now for <|(). # Admittedly, this is different than the evaluation order in other # contexts. However, since filtration has no chance to run on <|(), # this seems like the only obvious way to give them access to filters. if file_list: processed_variables = gyp.simple_copy.deepcopy(variables) ProcessListFiltersInDict(contents, processed_variables) # Recurse to expand variables in the contents contents = ExpandVariables(contents, phase, processed_variables, build_file) else: # Recurse to expand variables in the contents contents = ExpandVariables(contents, phase, variables, build_file) # Strip off leading/trailing whitespace so that variable matches are # simpler below (and because they are rarely needed). contents = contents.strip() # expand_to_list is true if an @ variant is used. In that case, # the expansion should result in a list. Note that the caller # is to be expecting a list in return, and not all callers do # because not all are working in list context. Also, for list # expansions, there can be no other text besides the variable # expansion in the input string. expand_to_list = "@" in match["type"] and input_str == replacement if run_command or file_list: # Find the build file's directory, so commands can be run or file lists # generated relative to it. build_file_dir = os.path.dirname(build_file) if build_file_dir == "" and not file_list: # If build_file is just a leaf filename indicating a file in the # current directory, build_file_dir might be an empty string. Set # it to None to signal to subprocess.Popen that it should run the # command in the current directory. build_file_dir = None # Support <|(listfile.txt ...) which generates a file # containing items from a gyp list, generated at gyp time. # This works around actions/rules which have more inputs than will # fit on the command line. if file_list: if type(contents) is list: contents_list = contents else: contents_list = contents.split(" ") replacement = contents_list[0] if os.path.isabs(replacement): raise GypError('| cannot handle absolute paths, got "%s"' % replacement) if not generator_filelist_paths: path = os.path.join(build_file_dir, replacement) else: if os.path.isabs(build_file_dir): toplevel = generator_filelist_paths["toplevel"] rel_build_file_dir = gyp.common.RelativePath( build_file_dir, toplevel ) else: rel_build_file_dir = build_file_dir qualified_out_dir = generator_filelist_paths["qualified_out_dir"] path = os.path.join(qualified_out_dir, rel_build_file_dir, replacement) gyp.common.EnsureDirExists(path) replacement = gyp.common.RelativePath(path, build_file_dir) f = gyp.common.WriteOnDiff(path) for i in contents_list[1:]: f.write("%s\n" % i) f.close() elif run_command: use_shell = True if match["is_array"]: contents = eval(contents) use_shell = False # Check for a cached value to avoid executing commands, or generating # file lists more than once. The cache key contains the command to be # run as well as the directory to run it from, to account for commands # that depend on their current directory. # TODO(http://code.google.com/p/gyp/issues/detail?id=111): In theory, # someone could author a set of GYP files where each time the command # is invoked it produces different output by design. When the need # arises, the syntax should be extended to support no caching off a # command's output so it is run every time. cache_key = (str(contents), build_file_dir) cached_value = cached_command_results.get(cache_key, None) if cached_value is None: gyp.DebugOutput( gyp.DEBUG_VARIABLES, "Executing command '%s' in directory '%s'", contents, build_file_dir, ) replacement = "" if command_string == "pymod_do_main": # (sources/) etc. to resolve to # and empty list if undefined. This allows actions to: # 'action!': [ # '>@(_sources!)', # ], # 'action/': [ # '>@(_sources/)', # ], replacement = [] else: raise GypError( "Undefined variable " + contents + " in " + build_file ) else: replacement = variables[contents] if isinstance(replacement, bytes) and not isinstance(replacement, str): replacement = replacement.decode("utf-8") # done on Python 3 only if type(replacement) is list: for item in replacement: if isinstance(item, bytes) and not isinstance(item, str): item = item.decode("utf-8") # done on Python 3 only if not contents[-1] == "/" and type(item) not in (str, int): raise GypError( "Variable " + contents + " must expand to a string or list of strings; " + "list contains a " + item.__class__.__name__ ) # Run through the list and handle variable expansions in it. Since # the list is guaranteed not to contain dicts, this won't do anything # with conditions sections. ProcessVariablesAndConditionsInList( replacement, phase, variables, build_file ) elif type(replacement) not in (str, int): raise GypError( "Variable " + contents + " must expand to a string or list of strings; " + "found a " + replacement.__class__.__name__ ) if expand_to_list: # Expanding in list context. It's guaranteed that there's only one # replacement to do in |input_str| and that it's this replacement. See # above. if type(replacement) is list: # If it's already a list, make a copy. output = replacement[:] else: # Split it the same way sh would split arguments. output = shlex.split(str(replacement)) else: # Expanding in string context. encoded_replacement = "" if type(replacement) is list: # When expanding a list into string context, turn the list items # into a string in a way that will work with a subprocess call. # # TODO(mark): This isn't completely correct. This should # call a generator-provided function that observes the # proper list-to-argument quoting rules on a specific # platform instead of just calling the POSIX encoding # routine. encoded_replacement = gyp.common.EncodePOSIXShellList(replacement) else: encoded_replacement = replacement output = ( output[:replace_start] + str(encoded_replacement) + output[replace_end:] ) # Prepare for the next match iteration. input_str = output if output == input: gyp.DebugOutput( gyp.DEBUG_VARIABLES, "Found only identity matches on %r, avoiding infinite " "recursion.", output, ) else: # Look for more matches now that we've replaced some, to deal with # expanding local variables (variables defined in the same # variables block as this one). gyp.DebugOutput(gyp.DEBUG_VARIABLES, "Found output %r, recursing.", output) if type(output) is list: if output and type(output[0]) is list: # Leave output alone if it's a list of lists. # We don't want such lists to be stringified. pass else: new_output = [] for item in output: new_output.append( ExpandVariables(item, phase, variables, build_file) ) output = new_output else: output = ExpandVariables(output, phase, variables, build_file) # Convert all strings that are canonically-represented integers into integers. if type(output) is list: for index, outstr in enumerate(output): if IsStrCanonicalInt(outstr): output[index] = int(outstr) elif IsStrCanonicalInt(output): output = int(output) return output # The same condition is often evaluated over and over again so it # makes sense to cache as much as possible between evaluations. cached_conditions_asts = {} def EvalCondition(condition, conditions_key, phase, variables, build_file): """Returns the dict that should be used or None if the result was that nothing should be used.""" if type(condition) is not list: raise GypError(conditions_key + " must be a list") if len(condition) < 2: # It's possible that condition[0] won't work in which case this # attempt will raise its own IndexError. That's probably fine. raise GypError( conditions_key + " " + condition[0] + " must be at least length 2, not " + str(len(condition)) ) i = 0 result = None while i < len(condition): cond_expr = condition[i] true_dict = condition[i + 1] if type(true_dict) is not dict: raise GypError( "{} {} must be followed by a dictionary, not {}".format( conditions_key, cond_expr, type(true_dict) ) ) if len(condition) > i + 2 and type(condition[i + 2]) is dict: false_dict = condition[i + 2] i = i + 3 if i != len(condition): raise GypError( "{} {} has {} unexpected trailing items".format( conditions_key, cond_expr, len(condition) - i ) ) else: false_dict = None i = i + 2 if result is None: result = EvalSingleCondition( cond_expr, true_dict, false_dict, phase, variables, build_file ) return result def EvalSingleCondition(cond_expr, true_dict, false_dict, phase, variables, build_file): """Returns true_dict if cond_expr evaluates to true, and false_dict otherwise.""" # Do expansions on the condition itself. Since the condition can naturally # contain variable references without needing to resort to GYP expansion # syntax, this is of dubious value for variables, but someone might want to # use a command expansion directly inside a condition. cond_expr_expanded = ExpandVariables(cond_expr, phase, variables, build_file) if type(cond_expr_expanded) not in (str, int): raise ValueError( "Variable expansion in this context permits str and int " + "only, found " + cond_expr_expanded.__class__.__name__ ) try: if cond_expr_expanded in cached_conditions_asts: ast_code = cached_conditions_asts[cond_expr_expanded] else: ast_code = compile(cond_expr_expanded, "", "eval") cached_conditions_asts[cond_expr_expanded] = ast_code env = {"__builtins__": {}, "v": StrictVersion} if eval(ast_code, env, variables): return true_dict return false_dict except SyntaxError as e: syntax_error = SyntaxError( "%s while evaluating condition '%s' in %s " "at character %d." % (str(e.args[0]), e.text, build_file, e.offset), e.filename, e.lineno, e.offset, e.text, ) raise syntax_error except NameError as e: gyp.common.ExceptionAppend( e, f"while evaluating condition '{cond_expr_expanded}' in {build_file}", ) raise GypError(e) def ProcessConditionsInDict(the_dict, phase, variables, build_file): # Process a 'conditions' or 'target_conditions' section in the_dict, # depending on phase. # early -> conditions # late -> target_conditions # latelate -> no conditions # # Each item in a conditions list consists of cond_expr, a string expression # evaluated as the condition, and true_dict, a dict that will be merged into # the_dict if cond_expr evaluates to true. Optionally, a third item, # false_dict, may be present. false_dict is merged into the_dict if # cond_expr evaluates to false. # # Any dict merged into the_dict will be recursively processed for nested # conditionals and other expansions, also according to phase, immediately # prior to being merged. if phase == PHASE_EARLY: conditions_key = "conditions" elif phase == PHASE_LATE: conditions_key = "target_conditions" elif phase == PHASE_LATELATE: return else: assert False if conditions_key not in the_dict: return conditions_list = the_dict[conditions_key] # Unhook the conditions list, it's no longer needed. del the_dict[conditions_key] for condition in conditions_list: merge_dict = EvalCondition( condition, conditions_key, phase, variables, build_file ) if merge_dict is not None: # Expand variables and nested conditinals in the merge_dict before # merging it. ProcessVariablesAndConditionsInDict( merge_dict, phase, variables, build_file ) MergeDicts(the_dict, merge_dict, build_file, build_file) def LoadAutomaticVariablesFromDict(variables, the_dict): # Any keys with plain string values in the_dict become automatic variables. # The variable name is the key name with a "_" character prepended. for key, value in the_dict.items(): if type(value) in (str, int, list): variables["_" + key] = value def LoadVariablesFromVariablesDict(variables, the_dict, the_dict_key): # Any keys in the_dict's "variables" dict, if it has one, becomes a # variable. The variable name is the key name in the "variables" dict. # Variables that end with the % character are set only if they are unset in # the variables dict. the_dict_key is the name of the key that accesses # the_dict in the_dict's parent dict. If the_dict's parent is not a dict # (it could be a list or it could be parentless because it is a root dict), # the_dict_key will be None. for key, value in the_dict.get("variables", {}).items(): if type(value) not in (str, int, list): continue if key.endswith("%"): variable_name = key[:-1] if variable_name in variables: # If the variable is already set, don't set it. continue if the_dict_key == "variables" and variable_name in the_dict: # If the variable is set without a % in the_dict, and the_dict is a # variables dict (making |variables| a variables sub-dict of a # variables dict), use the_dict's definition. value = the_dict[variable_name] else: variable_name = key variables[variable_name] = value def ProcessVariablesAndConditionsInDict( the_dict, phase, variables_in, build_file, the_dict_key=None ): """Handle all variable and command expansion and conditional evaluation. This function is the public entry point for all variable expansions and conditional evaluations. The variables_in dictionary will not be modified by this function. """ # Make a copy of the variables_in dict that can be modified during the # loading of automatics and the loading of the variables dict. variables = variables_in.copy() LoadAutomaticVariablesFromDict(variables, the_dict) if "variables" in the_dict: # Make sure all the local variables are added to the variables # list before we process them so that you can reference one # variable from another. They will be fully expanded by recursion # in ExpandVariables. for key, value in the_dict["variables"].items(): variables[key] = value # Handle the associated variables dict first, so that any variable # references within can be resolved prior to using them as variables. # Pass a copy of the variables dict to avoid having it be tainted. # Otherwise, it would have extra automatics added for everything that # should just be an ordinary variable in this scope. ProcessVariablesAndConditionsInDict( the_dict["variables"], phase, variables, build_file, "variables" ) LoadVariablesFromVariablesDict(variables, the_dict, the_dict_key) for key, value in the_dict.items(): # Skip "variables", which was already processed if present. if key != "variables" and type(value) is str: expanded = ExpandVariables(value, phase, variables, build_file) if type(expanded) not in (str, int): raise ValueError( "Variable expansion in this context permits str and int " + "only, found " + expanded.__class__.__name__ + " for " + key ) the_dict[key] = expanded # Variable expansion may have resulted in changes to automatics. Reload. # TODO(mark): Optimization: only reload if no changes were made. variables = variables_in.copy() LoadAutomaticVariablesFromDict(variables, the_dict) LoadVariablesFromVariablesDict(variables, the_dict, the_dict_key) # Process conditions in this dict. This is done after variable expansion # so that conditions may take advantage of expanded variables. For example, # if the_dict contains: # {'type': '<(library_type)', # 'conditions': [['_type=="static_library"', { ... }]]}, # _type, as used in the condition, will only be set to the value of # library_type if variable expansion is performed before condition # processing. However, condition processing should occur prior to recursion # so that variables (both automatic and "variables" dict type) may be # adjusted by conditions sections, merged into the_dict, and have the # intended impact on contained dicts. # # This arrangement means that a "conditions" section containing a "variables" # section will only have those variables effective in subdicts, not in # the_dict. The workaround is to put a "conditions" section within a # "variables" section. For example: # {'conditions': [['os=="mac"', {'variables': {'define': 'IS_MAC'}}]], # 'defines': ['<(define)'], # 'my_subdict': {'defines': ['<(define)']}}, # will not result in "IS_MAC" being appended to the "defines" list in the # current scope but would result in it being appended to the "defines" list # within "my_subdict". By comparison: # {'variables': {'conditions': [['os=="mac"', {'define': 'IS_MAC'}]]}, # 'defines': ['<(define)'], # 'my_subdict': {'defines': ['<(define)']}}, # will append "IS_MAC" to both "defines" lists. # Evaluate conditions sections, allowing variable expansions within them # as well as nested conditionals. This will process a 'conditions' or # 'target_conditions' section, perform appropriate merging and recursive # conditional and variable processing, and then remove the conditions section # from the_dict if it is present. ProcessConditionsInDict(the_dict, phase, variables, build_file) # Conditional processing may have resulted in changes to automatics or the # variables dict. Reload. variables = variables_in.copy() LoadAutomaticVariablesFromDict(variables, the_dict) LoadVariablesFromVariablesDict(variables, the_dict, the_dict_key) # Recurse into child dicts, or process child lists which may result in # further recursion into descendant dicts. for key, value in the_dict.items(): # Skip "variables" and string values, which were already processed if # present. if key == "variables" or type(value) is str: continue if type(value) is dict: # Pass a copy of the variables dict so that subdicts can't influence # parents. ProcessVariablesAndConditionsInDict( value, phase, variables, build_file, key ) elif type(value) is list: # The list itself can't influence the variables dict, and # ProcessVariablesAndConditionsInList will make copies of the variables # dict if it needs to pass it to something that can influence it. No # copy is necessary here. ProcessVariablesAndConditionsInList(value, phase, variables, build_file) elif type(value) is not int: raise TypeError("Unknown type " + value.__class__.__name__ + " for " + key) def ProcessVariablesAndConditionsInList(the_list, phase, variables, build_file): # Iterate using an index so that new values can be assigned into the_list. index = 0 while index < len(the_list): item = the_list[index] if type(item) is dict: # Make a copy of the variables dict so that it won't influence anything # outside of its own scope. ProcessVariablesAndConditionsInDict(item, phase, variables, build_file) elif type(item) is list: ProcessVariablesAndConditionsInList(item, phase, variables, build_file) elif type(item) is str: expanded = ExpandVariables(item, phase, variables, build_file) if type(expanded) in (str, int): the_list[index] = expanded elif type(expanded) is list: the_list[index : index + 1] = expanded index += len(expanded) # index now identifies the next item to examine. Continue right now # without falling into the index increment below. continue else: raise ValueError( "Variable expansion in this context permits strings and " + "lists only, found " + expanded.__class__.__name__ + " at " + index ) elif type(item) is not int: raise TypeError( "Unknown type " + item.__class__.__name__ + " at index " + index ) index = index + 1 def BuildTargetsDict(data): """Builds a dict mapping fully-qualified target names to their target dicts. |data| is a dict mapping loaded build files by pathname relative to the current directory. Values in |data| are build file contents. For each |data| value with a "targets" key, the value of the "targets" key is taken as a list containing target dicts. Each target's fully-qualified name is constructed from the pathname of the build file (|data| key) and its "target_name" property. These fully-qualified names are used as the keys in the returned dict. These keys provide access to the target dicts, the dicts in the "targets" lists. """ targets = {} for build_file in data["target_build_files"]: for target in data[build_file].get("targets", []): target_name = gyp.common.QualifiedTarget( build_file, target["target_name"], target["toolset"] ) if target_name in targets: raise GypError("Duplicate target definitions for " + target_name) targets[target_name] = target return targets def QualifyDependencies(targets): """Make dependency links fully-qualified relative to the current directory. |targets| is a dict mapping fully-qualified target names to their target dicts. For each target in this dict, keys known to contain dependency links are examined, and any dependencies referenced will be rewritten so that they are fully-qualified and relative to the current directory. All rewritten dependencies are suitable for use as keys to |targets| or a similar dict. """ all_dependency_sections = [ dep + op for dep in dependency_sections for op in ("", "!", "/") ] for target, target_dict in targets.items(): target_build_file = gyp.common.BuildFile(target) toolset = target_dict["toolset"] for dependency_key in all_dependency_sections: dependencies = target_dict.get(dependency_key, []) for index, dep in enumerate(dependencies): dep_file, dep_target, dep_toolset = gyp.common.ResolveTarget( target_build_file, dep, toolset ) if not multiple_toolsets: # Ignore toolset specification in the dependency if it is specified. dep_toolset = toolset dependency = gyp.common.QualifiedTarget( dep_file, dep_target, dep_toolset ) dependencies[index] = dependency # Make sure anything appearing in a list other than "dependencies" also # appears in the "dependencies" list. if ( dependency_key != "dependencies" and dependency not in target_dict["dependencies"] ): raise GypError( "Found " + dependency + " in " + dependency_key + " of " + target + ", but not in dependencies" ) def ExpandWildcardDependencies(targets, data): """Expands dependencies specified as build_file:*. For each target in |targets|, examines sections containing links to other targets. If any such section contains a link of the form build_file:*, it is taken as a wildcard link, and is expanded to list each target in build_file. The |data| dict provides access to build file dicts. Any target that does not wish to be included by wildcard can provide an optional "suppress_wildcard" key in its target dict. When present and true, a wildcard dependency link will not include such targets. All dependency names, including the keys to |targets| and the values in each dependency list, must be qualified when this function is called. """ for target, target_dict in targets.items(): target_build_file = gyp.common.BuildFile(target) for dependency_key in dependency_sections: dependencies = target_dict.get(dependency_key, []) # Loop this way instead of "for dependency in" or "for index in range" # because the dependencies list will be modified within the loop body. index = 0 while index < len(dependencies): ( dependency_build_file, dependency_target, dependency_toolset, ) = gyp.common.ParseQualifiedTarget(dependencies[index]) if dependency_target != "*" and dependency_toolset != "*": # Not a wildcard. Keep it moving. index = index + 1 continue if dependency_build_file == target_build_file: # It's an error for a target to depend on all other targets in # the same file, because a target cannot depend on itself. raise GypError( "Found wildcard in " + dependency_key + " of " + target + " referring to same build file" ) # Take the wildcard out and adjust the index so that the next # dependency in the list will be processed the next time through the # loop. del dependencies[index] index = index - 1 # Loop through the targets in the other build file, adding them to # this target's list of dependencies in place of the removed # wildcard. dependency_target_dicts = data[dependency_build_file]["targets"] for dependency_target_dict in dependency_target_dicts: if int(dependency_target_dict.get("suppress_wildcard", False)): continue dependency_target_name = dependency_target_dict["target_name"] if ( dependency_target != "*" and dependency_target != dependency_target_name ): continue dependency_target_toolset = dependency_target_dict["toolset"] if ( dependency_toolset != "*" and dependency_toolset != dependency_target_toolset ): continue dependency = gyp.common.QualifiedTarget( dependency_build_file, dependency_target_name, dependency_target_toolset, ) index = index + 1 dependencies.insert(index, dependency) index = index + 1 def Unify(items): """Removes duplicate elements from items, keeping the first element.""" seen = {} return [seen.setdefault(e, e) for e in items if e not in seen] def RemoveDuplicateDependencies(targets): """Makes sure every dependency appears only once in all targets's dependency lists.""" for target_name, target_dict in targets.items(): for dependency_key in dependency_sections: dependencies = target_dict.get(dependency_key, []) if dependencies: target_dict[dependency_key] = Unify(dependencies) def Filter(items, item): """Removes item from items.""" res = {} return [res.setdefault(e, e) for e in items if e != item] def RemoveSelfDependencies(targets): """Remove self dependencies from targets that have the prune_self_dependency variable set.""" for target_name, target_dict in targets.items(): for dependency_key in dependency_sections: dependencies = target_dict.get(dependency_key, []) if dependencies: for t in dependencies: if t == target_name: if ( targets[t] .get("variables", {}) .get("prune_self_dependency", 0) ): target_dict[dependency_key] = Filter( dependencies, target_name ) def RemoveLinkDependenciesFromNoneTargets(targets): """Remove dependencies having the 'link_dependency' attribute from the 'none' targets.""" for target_name, target_dict in targets.items(): for dependency_key in dependency_sections: dependencies = target_dict.get(dependency_key, []) if dependencies: for t in dependencies: if target_dict.get("type", None) == "none": if targets[t].get("variables", {}).get("link_dependency", 0): target_dict[dependency_key] = Filter( target_dict[dependency_key], t ) class DependencyGraphNode: """ Attributes: ref: A reference to an object that this DependencyGraphNode represents. dependencies: List of DependencyGraphNodes on which this one depends. dependents: List of DependencyGraphNodes that depend on this one. """ class CircularException(GypError): pass def __init__(self, ref): self.ref = ref self.dependencies = [] self.dependents = [] def __repr__(self): return "" % self.ref def FlattenToList(self): # flat_list is the sorted list of dependencies - actually, the list items # are the "ref" attributes of DependencyGraphNodes. Every target will # appear in flat_list after all of its dependencies, and before all of its # dependents. flat_list = OrderedSet() def ExtractNodeRef(node): """Extracts the object that the node represents from the given node.""" return node.ref # in_degree_zeros is the list of DependencyGraphNodes that have no # dependencies not in flat_list. Initially, it is a copy of the children # of this node, because when the graph was built, nodes with no # dependencies were made implicit dependents of the root node. in_degree_zeros = sorted(self.dependents[:], key=ExtractNodeRef) while in_degree_zeros: # Nodes in in_degree_zeros have no dependencies not in flat_list, so they # can be appended to flat_list. Take these nodes out of in_degree_zeros # as work progresses, so that the next node to process from the list can # always be accessed at a consistent position. node = in_degree_zeros.pop() flat_list.add(node.ref) # Look at dependents of the node just added to flat_list. Some of them # may now belong in in_degree_zeros. for node_dependent in sorted(node.dependents, key=ExtractNodeRef): is_in_degree_zero = True # TODO: We want to check through the # node_dependent.dependencies list but if it's long and we # always start at the beginning, then we get O(n^2) behaviour. for node_dependent_dependency in sorted( node_dependent.dependencies, key=ExtractNodeRef ): if node_dependent_dependency.ref not in flat_list: # The dependent one or more dependencies not in flat_list. # There will be more chances to add it to flat_list # when examining it again as a dependent of those other # dependencies, provided that there are no cycles. is_in_degree_zero = False break if is_in_degree_zero: # All of the dependent's dependencies are already in flat_list. Add # it to in_degree_zeros where it will be processed in a future # iteration of the outer loop. in_degree_zeros += [node_dependent] return list(flat_list) def FindCycles(self): """ Returns a list of cycles in the graph, where each cycle is its own list. """ results = [] visited = set() def Visit(node, path): for child in node.dependents: if child in path: results.append([child] + path[: path.index(child) + 1]) elif child not in visited: visited.add(child) Visit(child, [child] + path) visited.add(self) Visit(self, [self]) return results def DirectDependencies(self, dependencies=None): """Returns a list of just direct dependencies.""" if dependencies is None: dependencies = [] for dependency in self.dependencies: # Check for None, corresponding to the root node. if dependency.ref and dependency.ref not in dependencies: dependencies.append(dependency.ref) return dependencies def _AddImportedDependencies(self, targets, dependencies=None): """Given a list of direct dependencies, adds indirect dependencies that other dependencies have declared to export their settings. This method does not operate on self. Rather, it operates on the list of dependencies in the |dependencies| argument. For each dependency in that list, if any declares that it exports the settings of one of its own dependencies, those dependencies whose settings are "passed through" are added to the list. As new items are added to the list, they too will be processed, so it is possible to import settings through multiple levels of dependencies. This method is not terribly useful on its own, it depends on being "primed" with a list of direct dependencies such as one provided by DirectDependencies. DirectAndImportedDependencies is intended to be the public entry point. """ if dependencies is None: dependencies = [] index = 0 while index < len(dependencies): dependency = dependencies[index] dependency_dict = targets[dependency] # Add any dependencies whose settings should be imported to the list # if not already present. Newly-added items will be checked for # their own imports when the list iteration reaches them. # Rather than simply appending new items, insert them after the # dependency that exported them. This is done to more closely match # the depth-first method used by DeepDependencies. add_index = 1 for imported_dependency in dependency_dict.get( "export_dependent_settings", [] ): if imported_dependency not in dependencies: dependencies.insert(index + add_index, imported_dependency) add_index = add_index + 1 index = index + 1 return dependencies def DirectAndImportedDependencies(self, targets, dependencies=None): """Returns a list of a target's direct dependencies and all indirect dependencies that a dependency has advertised settings should be exported through the dependency for. """ dependencies = self.DirectDependencies(dependencies) return self._AddImportedDependencies(targets, dependencies) def DeepDependencies(self, dependencies=None): """Returns an OrderedSet of all of a target's dependencies, recursively.""" if dependencies is None: # Using a list to get ordered output and a set to do fast "is it # already added" checks. dependencies = OrderedSet() for dependency in self.dependencies: # Check for None, corresponding to the root node. if dependency.ref is None: continue if dependency.ref not in dependencies: dependency.DeepDependencies(dependencies) dependencies.add(dependency.ref) return dependencies def _LinkDependenciesInternal( self, targets, include_shared_libraries, dependencies=None, initial=True ): """Returns an OrderedSet of dependency targets that are linked into this target. This function has a split personality, depending on the setting of |initial|. Outside callers should always leave |initial| at its default setting. When adding a target to the list of dependencies, this function will recurse into itself with |initial| set to False, to collect dependencies that are linked into the linkable target for which the list is being built. If |include_shared_libraries| is False, the resulting dependencies will not include shared_library targets that are linked into this target. """ if dependencies is None: # Using a list to get ordered output and a set to do fast "is it # already added" checks. dependencies = OrderedSet() # Check for None, corresponding to the root node. if self.ref is None: return dependencies # It's kind of sucky that |targets| has to be passed into this function, # but that's presently the easiest way to access the target dicts so that # this function can find target types. if "target_name" not in targets[self.ref]: raise GypError("Missing 'target_name' field in target.") if "type" not in targets[self.ref]: raise GypError( "Missing 'type' field in target %s" % targets[self.ref]["target_name"] ) target_type = targets[self.ref]["type"] is_linkable = target_type in linkable_types if initial and not is_linkable: # If this is the first target being examined and it's not linkable, # return an empty list of link dependencies, because the link # dependencies are intended to apply to the target itself (initial is # True) and this target won't be linked. return dependencies # Don't traverse 'none' targets if explicitly excluded. if target_type == "none" and not targets[self.ref].get( "dependencies_traverse", True ): dependencies.add(self.ref) return dependencies # Executables, mac kernel extensions, windows drivers and loadable modules # are already fully and finally linked. Nothing else can be a link # dependency of them, there can only be dependencies in the sense that a # dependent target might run an executable or load the loadable_module. if not initial and target_type in ( "executable", "loadable_module", "mac_kernel_extension", "windows_driver", ): return dependencies # Shared libraries are already fully linked. They should only be included # in |dependencies| when adjusting static library dependencies (in order to # link against the shared_library's import lib), but should not be included # in |dependencies| when propagating link_settings. # The |include_shared_libraries| flag controls which of these two cases we # are handling. if ( not initial and target_type == "shared_library" and not include_shared_libraries ): return dependencies # The target is linkable, add it to the list of link dependencies. if self.ref not in dependencies: dependencies.add(self.ref) if initial or not is_linkable: # If this is a subsequent target and it's linkable, don't look any # further for linkable dependencies, as they'll already be linked into # this target linkable. Always look at dependencies of the initial # target, and always look at dependencies of non-linkables. for dependency in self.dependencies: dependency._LinkDependenciesInternal( targets, include_shared_libraries, dependencies, False ) return dependencies def DependenciesForLinkSettings(self, targets): """ Returns a list of dependency targets whose link_settings should be merged into this target. """ # TODO(sbaig) Currently, chrome depends on the bug that shared libraries' # link_settings are propagated. So for now, we will allow it, unless the # 'allow_sharedlib_linksettings_propagation' flag is explicitly set to # False. Once chrome is fixed, we can remove this flag. include_shared_libraries = targets[self.ref].get( "allow_sharedlib_linksettings_propagation", True ) return self._LinkDependenciesInternal(targets, include_shared_libraries) def DependenciesToLinkAgainst(self, targets): """ Returns a list of dependency targets that are linked into this target. """ return self._LinkDependenciesInternal(targets, True) def BuildDependencyList(targets): # Create a DependencyGraphNode for each target. Put it into a dict for easy # access. dependency_nodes = {} for target, spec in targets.items(): if target not in dependency_nodes: dependency_nodes[target] = DependencyGraphNode(target) # Set up the dependency links. Targets that have no dependencies are treated # as dependent on root_node. root_node = DependencyGraphNode(None) for target, spec in targets.items(): target_node = dependency_nodes[target] dependencies = spec.get("dependencies") if not dependencies: target_node.dependencies = [root_node] root_node.dependents.append(target_node) else: for dependency in dependencies: dependency_node = dependency_nodes.get(dependency) if not dependency_node: raise GypError( "Dependency '%s' not found while " "trying to load target %s" % (dependency, target) ) target_node.dependencies.append(dependency_node) dependency_node.dependents.append(target_node) flat_list = root_node.FlattenToList() # If there's anything left unvisited, there must be a circular dependency # (cycle). if len(flat_list) != len(targets): if not root_node.dependents: # If all targets have dependencies, add the first target as a dependent # of root_node so that the cycle can be discovered from root_node. target = next(iter(targets)) target_node = dependency_nodes[target] target_node.dependencies.append(root_node) root_node.dependents.append(target_node) cycles = [] for cycle in root_node.FindCycles(): paths = [node.ref for node in cycle] cycles.append("Cycle: %s" % " -> ".join(paths)) raise DependencyGraphNode.CircularException( "Cycles in dependency graph detected:\n" + "\n".join(cycles) ) return [dependency_nodes, flat_list] def VerifyNoGYPFileCircularDependencies(targets): # Create a DependencyGraphNode for each gyp file containing a target. Put # it into a dict for easy access. dependency_nodes = {} for target in targets: build_file = gyp.common.BuildFile(target) if build_file not in dependency_nodes: dependency_nodes[build_file] = DependencyGraphNode(build_file) # Set up the dependency links. for target, spec in targets.items(): build_file = gyp.common.BuildFile(target) build_file_node = dependency_nodes[build_file] target_dependencies = spec.get("dependencies", []) for dependency in target_dependencies: try: dependency_build_file = gyp.common.BuildFile(dependency) except GypError as e: gyp.common.ExceptionAppend( e, "while computing dependencies of .gyp file %s" % build_file ) raise if dependency_build_file == build_file: # A .gyp file is allowed to refer back to itself. continue dependency_node = dependency_nodes.get(dependency_build_file) if not dependency_node: raise GypError("Dependency '%s' not found" % dependency_build_file) if dependency_node not in build_file_node.dependencies: build_file_node.dependencies.append(dependency_node) dependency_node.dependents.append(build_file_node) # Files that have no dependencies are treated as dependent on root_node. root_node = DependencyGraphNode(None) for build_file_node in dependency_nodes.values(): if len(build_file_node.dependencies) == 0: build_file_node.dependencies.append(root_node) root_node.dependents.append(build_file_node) flat_list = root_node.FlattenToList() # If there's anything left unvisited, there must be a circular dependency # (cycle). if len(flat_list) != len(dependency_nodes): if not root_node.dependents: # If all files have dependencies, add the first file as a dependent # of root_node so that the cycle can be discovered from root_node. file_node = next(iter(dependency_nodes.values())) file_node.dependencies.append(root_node) root_node.dependents.append(file_node) cycles = [] for cycle in root_node.FindCycles(): paths = [node.ref for node in cycle] cycles.append("Cycle: %s" % " -> ".join(paths)) raise DependencyGraphNode.CircularException( "Cycles in .gyp file dependency graph detected:\n" + "\n".join(cycles) ) def DoDependentSettings(key, flat_list, targets, dependency_nodes): # key should be one of all_dependent_settings, direct_dependent_settings, # or link_settings. for target in flat_list: target_dict = targets[target] build_file = gyp.common.BuildFile(target) if key == "all_dependent_settings": dependencies = dependency_nodes[target].DeepDependencies() elif key == "direct_dependent_settings": dependencies = dependency_nodes[target].DirectAndImportedDependencies( targets ) elif key == "link_settings": dependencies = dependency_nodes[target].DependenciesForLinkSettings(targets) else: raise GypError( "DoDependentSettings doesn't know how to determine " "dependencies for " + key ) for dependency in dependencies: dependency_dict = targets[dependency] if key not in dependency_dict: continue dependency_build_file = gyp.common.BuildFile(dependency) MergeDicts( target_dict, dependency_dict[key], build_file, dependency_build_file ) def AdjustStaticLibraryDependencies( flat_list, targets, dependency_nodes, sort_dependencies ): # Recompute target "dependencies" properties. For each static library # target, remove "dependencies" entries referring to other static libraries, # unless the dependency has the "hard_dependency" attribute set. For each # linkable target, add a "dependencies" entry referring to all of the # target's computed list of link dependencies (including static libraries # if no such entry is already present. for target in flat_list: target_dict = targets[target] target_type = target_dict["type"] if target_type == "static_library": if "dependencies" not in target_dict: continue target_dict["dependencies_original"] = target_dict.get("dependencies", [])[ : ] # A static library should not depend on another static library unless # the dependency relationship is "hard," which should only be done when # a dependent relies on some side effect other than just the build # product, like a rule or action output. Further, if a target has a # non-hard dependency, but that dependency exports a hard dependency, # the non-hard dependency can safely be removed, but the exported hard # dependency must be added to the target to keep the same dependency # ordering. dependencies = dependency_nodes[target].DirectAndImportedDependencies( targets ) index = 0 while index < len(dependencies): dependency = dependencies[index] dependency_dict = targets[dependency] # Remove every non-hard static library dependency and remove every # non-static library dependency that isn't a direct dependency. if ( dependency_dict["type"] == "static_library" and not dependency_dict.get("hard_dependency", False) ) or ( dependency_dict["type"] != "static_library" and dependency not in target_dict["dependencies"] ): # Take the dependency out of the list, and don't increment index # because the next dependency to analyze will shift into the index # formerly occupied by the one being removed. del dependencies[index] else: index = index + 1 # Update the dependencies. If the dependencies list is empty, it's not # needed, so unhook it. if len(dependencies) > 0: target_dict["dependencies"] = dependencies else: del target_dict["dependencies"] elif target_type in linkable_types: # Get a list of dependency targets that should be linked into this # target. Add them to the dependencies list if they're not already # present. link_dependencies = dependency_nodes[target].DependenciesToLinkAgainst( targets ) for dependency in link_dependencies: if dependency == target: continue if "dependencies" not in target_dict: target_dict["dependencies"] = [] if dependency not in target_dict["dependencies"]: target_dict["dependencies"].append(dependency) # Sort the dependencies list in the order from dependents to dependencies. # e.g. If A and B depend on C and C depends on D, sort them in A, B, C, D. # Note: flat_list is already sorted in the order from dependencies to # dependents. if sort_dependencies and "dependencies" in target_dict: target_dict["dependencies"] = [ dep for dep in reversed(flat_list) if dep in target_dict["dependencies"] ] # Initialize this here to speed up MakePathRelative. exception_re = re.compile(r"""["']?[-/$<>^]""") def MakePathRelative(to_file, fro_file, item): # If item is a relative path, it's relative to the build file dict that it's # coming from. Fix it up to make it relative to the build file dict that # it's going into. # Exception: any |item| that begins with these special characters is # returned without modification. # / Used when a path is already absolute (shortcut optimization; # such paths would be returned as absolute anyway) # $ Used for build environment variables # - Used for some build environment flags (such as -lapr-1 in a # "libraries" section) # < Used for our own variable and command expansions (see ExpandVariables) # > Used for our own variable and command expansions (see ExpandVariables) # ^ Used for our own variable and command expansions (see ExpandVariables) # # "/' Used when a value is quoted. If these are present, then we # check the second character instead. # if to_file == fro_file or exception_re.match(item): return item else: # TODO(dglazkov) The backslash/forward-slash replacement at the end is a # temporary measure. This should really be addressed by keeping all paths # in POSIX until actual project generation. ret = os.path.normpath( os.path.join( gyp.common.RelativePath( os.path.dirname(fro_file), os.path.dirname(to_file) ), item, ) ).replace("\\", "/") if item.endswith("/"): ret += "/" return ret def MergeLists(to, fro, to_file, fro_file, is_paths=False, append=True): # Python documentation recommends objects which do not support hash # set this value to None. Python library objects follow this rule. def is_hashable(val): return val.__hash__ # If x is hashable, returns whether x is in s. Else returns whether x is in items. def is_in_set_or_list(x, s, items): if is_hashable(x): return x in s return x in items prepend_index = 0 # Make membership testing of hashables in |to| (in particular, strings) # faster. hashable_to_set = {x for x in to if is_hashable(x)} for item in fro: singleton = False if type(item) in (str, int): # The cheap and easy case. if is_paths: to_item = MakePathRelative(to_file, fro_file, item) else: to_item = item if not (type(item) is str and item.startswith("-")): # Any string that doesn't begin with a "-" is a singleton - it can # only appear once in a list, to be enforced by the list merge append # or prepend. singleton = True elif type(item) is dict: # Make a copy of the dictionary, continuing to look for paths to fix. # The other intelligent aspects of merge processing won't apply because # item is being merged into an empty dict. to_item = {} MergeDicts(to_item, item, to_file, fro_file) elif type(item) is list: # Recurse, making a copy of the list. If the list contains any # descendant dicts, path fixing will occur. Note that here, custom # values for is_paths and append are dropped; those are only to be # applied to |to| and |fro|, not sublists of |fro|. append shouldn't # matter anyway because the new |to_item| list is empty. to_item = [] MergeLists(to_item, item, to_file, fro_file) else: raise TypeError( "Attempt to merge list item of unsupported type " + item.__class__.__name__ ) if append: # If appending a singleton that's already in the list, don't append. # This ensures that the earliest occurrence of the item will stay put. if not singleton or not is_in_set_or_list(to_item, hashable_to_set, to): to.append(to_item) if is_hashable(to_item): hashable_to_set.add(to_item) else: # If prepending a singleton that's already in the list, remove the # existing instance and proceed with the prepend. This ensures that the # item appears at the earliest possible position in the list. while singleton and to_item in to: to.remove(to_item) # Don't just insert everything at index 0. That would prepend the new # items to the list in reverse order, which would be an unwelcome # surprise. to.insert(prepend_index, to_item) if is_hashable(to_item): hashable_to_set.add(to_item) prepend_index = prepend_index + 1 def MergeDicts(to, fro, to_file, fro_file): # I wanted to name the parameter "from" but it's a Python keyword... for k, v in fro.items(): # It would be nice to do "if not k in to: to[k] = v" but that wouldn't give # copy semantics. Something else may want to merge from the |fro| dict # later, and having the same dict ref pointed to twice in the tree isn't # what anyone wants considering that the dicts may subsequently be # modified. if k in to: bad_merge = False if type(v) in (str, int): if type(to[k]) not in (str, int): bad_merge = True elif not isinstance(v, type(to[k])): bad_merge = True if bad_merge: raise TypeError( "Attempt to merge dict value of type " + v.__class__.__name__ + " into incompatible type " + to[k].__class__.__name__ + " for key " + k ) if type(v) in (str, int): # Overwrite the existing value, if any. Cheap and easy. is_path = IsPathSection(k) if is_path: to[k] = MakePathRelative(to_file, fro_file, v) else: to[k] = v elif type(v) is dict: # Recurse, guaranteeing copies will be made of objects that require it. if k not in to: to[k] = {} MergeDicts(to[k], v, to_file, fro_file) elif type(v) is list: # Lists in dicts can be merged with different policies, depending on # how the key in the "from" dict (k, the from-key) is written. # # If the from-key has ...the to-list will have this action # this character appended:... applied when receiving the from-list: # = replace # + prepend # ? set, only if to-list does not yet exist # (none) append # # This logic is list-specific, but since it relies on the associated # dict key, it's checked in this dict-oriented function. ext = k[-1] append = True if ext == "=": list_base = k[:-1] lists_incompatible = [list_base, list_base + "?"] to[list_base] = [] elif ext == "+": list_base = k[:-1] lists_incompatible = [list_base + "=", list_base + "?"] append = False elif ext == "?": list_base = k[:-1] lists_incompatible = [list_base, list_base + "=", list_base + "+"] else: list_base = k lists_incompatible = [list_base + "=", list_base + "?"] # Some combinations of merge policies appearing together are meaningless. # It's stupid to replace and append simultaneously, for example. Append # and prepend are the only policies that can coexist. for list_incompatible in lists_incompatible: if list_incompatible in fro: raise GypError( "Incompatible list policies " + k + " and " + list_incompatible ) if list_base in to: if ext == "?": # If the key ends in "?", the list will only be merged if it doesn't # already exist. continue elif type(to[list_base]) is not list: # This may not have been checked above if merging in a list with an # extension character. raise TypeError( "Attempt to merge dict value of type " + v.__class__.__name__ + " into incompatible type " + to[list_base].__class__.__name__ + " for key " + list_base + "(" + k + ")" ) else: to[list_base] = [] # Call MergeLists, which will make copies of objects that require it. # MergeLists can recurse back into MergeDicts, although this will be # to make copies of dicts (with paths fixed), there will be no # subsequent dict "merging" once entering a list because lists are # always replaced, appended to, or prepended to. is_paths = IsPathSection(list_base) MergeLists(to[list_base], v, to_file, fro_file, is_paths, append) else: raise TypeError( "Attempt to merge dict value of unsupported type " + v.__class__.__name__ + " for key " + k ) def MergeConfigWithInheritance( new_configuration_dict, build_file, target_dict, configuration, visited ): # Skip if previously visited. if configuration in visited: return # Look at this configuration. configuration_dict = target_dict["configurations"][configuration] # Merge in parents. for parent in configuration_dict.get("inherit_from", []): MergeConfigWithInheritance( new_configuration_dict, build_file, target_dict, parent, visited + [configuration], ) # Merge it into the new config. MergeDicts(new_configuration_dict, configuration_dict, build_file, build_file) # Drop abstract. if "abstract" in new_configuration_dict: del new_configuration_dict["abstract"] def SetUpConfigurations(target, target_dict): # key_suffixes is a list of key suffixes that might appear on key names. # These suffixes are handled in conditional evaluations (for =, +, and ?) # and rules/exclude processing (for ! and /). Keys with these suffixes # should be treated the same as keys without. key_suffixes = ["=", "+", "?", "!", "/"] build_file = gyp.common.BuildFile(target) # Provide a single configuration by default if none exists. # TODO(mark): Signal an error if default_configurations exists but # configurations does not. if "configurations" not in target_dict: target_dict["configurations"] = {"Default": {}} if "default_configuration" not in target_dict: concrete = [ i for (i, config) in target_dict["configurations"].items() if not config.get("abstract") ] target_dict["default_configuration"] = sorted(concrete)[0] merged_configurations = {} configs = target_dict["configurations"] for (configuration, old_configuration_dict) in configs.items(): # Skip abstract configurations (saves work only). if old_configuration_dict.get("abstract"): continue # Configurations inherit (most) settings from the enclosing target scope. # Get the inheritance relationship right by making a copy of the target # dict. new_configuration_dict = {} for (key, target_val) in target_dict.items(): key_ext = key[-1:] if key_ext in key_suffixes: key_base = key[:-1] else: key_base = key if key_base not in non_configuration_keys: new_configuration_dict[key] = gyp.simple_copy.deepcopy(target_val) # Merge in configuration (with all its parents first). MergeConfigWithInheritance( new_configuration_dict, build_file, target_dict, configuration, [] ) merged_configurations[configuration] = new_configuration_dict # Put the new configurations back into the target dict as a configuration. for configuration in merged_configurations.keys(): target_dict["configurations"][configuration] = merged_configurations[ configuration ] # Now drop all the abstract ones. configs = target_dict["configurations"] target_dict["configurations"] = { k: v for k, v in configs.items() if not v.get("abstract") } # Now that all of the target's configurations have been built, go through # the target dict's keys and remove everything that's been moved into a # "configurations" section. delete_keys = [] for key in target_dict: key_ext = key[-1:] if key_ext in key_suffixes: key_base = key[:-1] else: key_base = key if key_base not in non_configuration_keys: delete_keys.append(key) for key in delete_keys: del target_dict[key] # Check the configurations to see if they contain invalid keys. for configuration in target_dict["configurations"].keys(): configuration_dict = target_dict["configurations"][configuration] for key in configuration_dict.keys(): if key in invalid_configuration_keys: raise GypError( "%s not allowed in the %s configuration, found in " "target %s" % (key, configuration, target) ) def ProcessListFiltersInDict(name, the_dict): """Process regular expression and exclusion-based filters on lists. An exclusion list is in a dict key named with a trailing "!", like "sources!". Every item in such a list is removed from the associated main list, which in this example, would be "sources". Removed items are placed into a "sources_excluded" list in the dict. Regular expression (regex) filters are contained in dict keys named with a trailing "/", such as "sources/" to operate on the "sources" list. Regex filters in a dict take the form: 'sources/': [ ['exclude', '_(linux|mac|win)\\.cc$'], ['include', '_mac\\.cc$'] ], The first filter says to exclude all files ending in _linux.cc, _mac.cc, and _win.cc. The second filter then includes all files ending in _mac.cc that are now or were once in the "sources" list. Items matching an "exclude" filter are subject to the same processing as would occur if they were listed by name in an exclusion list (ending in "!"). Items matching an "include" filter are brought back into the main list if previously excluded by an exclusion list or exclusion regex filter. Subsequent matching "exclude" patterns can still cause items to be excluded after matching an "include". """ # Look through the dictionary for any lists whose keys end in "!" or "/". # These are lists that will be treated as exclude lists and regular # expression-based exclude/include lists. Collect the lists that are # needed first, looking for the lists that they operate on, and assemble # then into |lists|. This is done in a separate loop up front, because # the _included and _excluded keys need to be added to the_dict, and that # can't be done while iterating through it. lists = [] del_lists = [] for key, value in the_dict.items(): operation = key[-1] if operation != "!" and operation != "/": continue if type(value) is not list: raise ValueError( name + " key " + key + " must be list, not " + value.__class__.__name__ ) list_key = key[:-1] if list_key not in the_dict: # This happens when there's a list like "sources!" but no corresponding # "sources" list. Since there's nothing for it to operate on, queue up # the "sources!" list for deletion now. del_lists.append(key) continue if type(the_dict[list_key]) is not list: value = the_dict[list_key] raise ValueError( name + " key " + list_key + " must be list, not " + value.__class__.__name__ + " when applying " + {"!": "exclusion", "/": "regex"}[operation] ) if list_key not in lists: lists.append(list_key) # Delete the lists that are known to be unneeded at this point. for del_list in del_lists: del the_dict[del_list] for list_key in lists: the_list = the_dict[list_key] # Initialize the list_actions list, which is parallel to the_list. Each # item in list_actions identifies whether the corresponding item in # the_list should be excluded, unconditionally preserved (included), or # whether no exclusion or inclusion has been applied. Items for which # no exclusion or inclusion has been applied (yet) have value -1, items # excluded have value 0, and items included have value 1. Includes and # excludes override previous actions. All items in list_actions are # initialized to -1 because no excludes or includes have been processed # yet. list_actions = list((-1,) * len(the_list)) exclude_key = list_key + "!" if exclude_key in the_dict: for exclude_item in the_dict[exclude_key]: for index, list_item in enumerate(the_list): if exclude_item == list_item: # This item matches the exclude_item, so set its action to 0 # (exclude). list_actions[index] = 0 # The "whatever!" list is no longer needed, dump it. del the_dict[exclude_key] regex_key = list_key + "/" if regex_key in the_dict: for regex_item in the_dict[regex_key]: [action, pattern] = regex_item pattern_re = re.compile(pattern) if action == "exclude": # This item matches an exclude regex, set its value to 0 (exclude). action_value = 0 elif action == "include": # This item matches an include regex, set its value to 1 (include). action_value = 1 else: # This is an action that doesn't make any sense. raise ValueError( "Unrecognized action " + action + " in " + name + " key " + regex_key ) for index, list_item in enumerate(the_list): if list_actions[index] == action_value: # Even if the regex matches, nothing will change so continue # (regex searches are expensive). continue if pattern_re.search(list_item): # Regular expression match. list_actions[index] = action_value # The "whatever/" list is no longer needed, dump it. del the_dict[regex_key] # Add excluded items to the excluded list. # # Note that exclude_key ("sources!") is different from excluded_key # ("sources_excluded"). The exclude_key list is input and it was already # processed and deleted; the excluded_key list is output and it's about # to be created. excluded_key = list_key + "_excluded" if excluded_key in the_dict: raise GypError( name + " key " + excluded_key + " must not be present prior " " to applying exclusion/regex filters for " + list_key ) excluded_list = [] # Go backwards through the list_actions list so that as items are deleted, # the indices of items that haven't been seen yet don't shift. That means # that things need to be prepended to excluded_list to maintain them in the # same order that they existed in the_list. for index in range(len(list_actions) - 1, -1, -1): if list_actions[index] == 0: # Dump anything with action 0 (exclude). Keep anything with action 1 # (include) or -1 (no include or exclude seen for the item). excluded_list.insert(0, the_list[index]) del the_list[index] # If anything was excluded, put the excluded list into the_dict at # excluded_key. if len(excluded_list) > 0: the_dict[excluded_key] = excluded_list # Now recurse into subdicts and lists that may contain dicts. for key, value in the_dict.items(): if type(value) is dict: ProcessListFiltersInDict(key, value) elif type(value) is list: ProcessListFiltersInList(key, value) def ProcessListFiltersInList(name, the_list): for item in the_list: if type(item) is dict: ProcessListFiltersInDict(name, item) elif type(item) is list: ProcessListFiltersInList(name, item) def ValidateTargetType(target, target_dict): """Ensures the 'type' field on the target is one of the known types. Arguments: target: string, name of target. target_dict: dict, target spec. Raises an exception on error. """ VALID_TARGET_TYPES = ( "executable", "loadable_module", "static_library", "shared_library", "mac_kernel_extension", "none", "windows_driver", ) target_type = target_dict.get("type", None) if target_type not in VALID_TARGET_TYPES: raise GypError( "Target %s has an invalid target type '%s'. " "Must be one of %s." % (target, target_type, "/".join(VALID_TARGET_TYPES)) ) if ( target_dict.get("standalone_static_library", 0) and not target_type == "static_library" ): raise GypError( "Target %s has type %s but standalone_static_library flag is" " only valid for static_library type." % (target, target_type) ) def ValidateRulesInTarget(target, target_dict, extra_sources_for_rules): """Ensures that the rules sections in target_dict are valid and consistent, and determines which sources they apply to. Arguments: target: string, name of target. target_dict: dict, target spec containing "rules" and "sources" lists. extra_sources_for_rules: a list of keys to scan for rule matches in addition to 'sources'. """ # Dicts to map between values found in rules' 'rule_name' and 'extension' # keys and the rule dicts themselves. rule_names = {} rule_extensions = {} rules = target_dict.get("rules", []) for rule in rules: # Make sure that there's no conflict among rule names and extensions. rule_name = rule["rule_name"] if rule_name in rule_names: raise GypError( f"rule {rule_name} exists in duplicate, target {target}" ) rule_names[rule_name] = rule rule_extension = rule["extension"] if rule_extension.startswith("."): rule_extension = rule_extension[1:] if rule_extension in rule_extensions: raise GypError( ( "extension %s associated with multiple rules, " + "target %s rules %s and %s" ) % ( rule_extension, target, rule_extensions[rule_extension]["rule_name"], rule_name, ) ) rule_extensions[rule_extension] = rule # Make sure rule_sources isn't already there. It's going to be # created below if needed. if "rule_sources" in rule: raise GypError( "rule_sources must not exist in input, target %s rule %s" % (target, rule_name) ) rule_sources = [] source_keys = ["sources"] source_keys.extend(extra_sources_for_rules) for source_key in source_keys: for source in target_dict.get(source_key, []): (source_root, source_extension) = os.path.splitext(source) if source_extension.startswith("."): source_extension = source_extension[1:] if source_extension == rule_extension: rule_sources.append(source) if len(rule_sources) > 0: rule["rule_sources"] = rule_sources def ValidateRunAsInTarget(target, target_dict, build_file): target_name = target_dict.get("target_name") run_as = target_dict.get("run_as") if not run_as: return if type(run_as) is not dict: raise GypError( "The 'run_as' in target %s from file %s should be a " "dictionary." % (target_name, build_file) ) action = run_as.get("action") if not action: raise GypError( "The 'run_as' in target %s from file %s must have an " "'action' section." % (target_name, build_file) ) if type(action) is not list: raise GypError( "The 'action' for 'run_as' in target %s from file %s " "must be a list." % (target_name, build_file) ) working_directory = run_as.get("working_directory") if working_directory and type(working_directory) is not str: raise GypError( "The 'working_directory' for 'run_as' in target %s " "in file %s should be a string." % (target_name, build_file) ) environment = run_as.get("environment") if environment and type(environment) is not dict: raise GypError( "The 'environment' for 'run_as' in target %s " "in file %s should be a dictionary." % (target_name, build_file) ) def ValidateActionsInTarget(target, target_dict, build_file): """Validates the inputs to the actions in a target.""" target_name = target_dict.get("target_name") actions = target_dict.get("actions", []) for action in actions: action_name = action.get("action_name") if not action_name: raise GypError( "Anonymous action in target %s. " "An action must have an 'action_name' field." % target_name ) inputs = action.get("inputs", None) if inputs is None: raise GypError("Action in target %s has no inputs." % target_name) action_command = action.get("action") if action_command and not action_command[0]: raise GypError("Empty action as command in target %s." % target_name) def TurnIntIntoStrInDict(the_dict): """Given dict the_dict, recursively converts all integers into strings. """ # Use items instead of iteritems because there's no need to try to look at # reinserted keys and their associated values. for k, v in the_dict.items(): if type(v) is int: v = str(v) the_dict[k] = v elif type(v) is dict: TurnIntIntoStrInDict(v) elif type(v) is list: TurnIntIntoStrInList(v) if type(k) is int: del the_dict[k] the_dict[str(k)] = v def TurnIntIntoStrInList(the_list): """Given list the_list, recursively converts all integers into strings. """ for index, item in enumerate(the_list): if type(item) is int: the_list[index] = str(item) elif type(item) is dict: TurnIntIntoStrInDict(item) elif type(item) is list: TurnIntIntoStrInList(item) def PruneUnwantedTargets(targets, flat_list, dependency_nodes, root_targets, data): """Return only the targets that are deep dependencies of |root_targets|.""" qualified_root_targets = [] for target in root_targets: target = target.strip() qualified_targets = gyp.common.FindQualifiedTargets(target, flat_list) if not qualified_targets: raise GypError("Could not find target %s" % target) qualified_root_targets.extend(qualified_targets) wanted_targets = {} for target in qualified_root_targets: wanted_targets[target] = targets[target] for dependency in dependency_nodes[target].DeepDependencies(): wanted_targets[dependency] = targets[dependency] wanted_flat_list = [t for t in flat_list if t in wanted_targets] # Prune unwanted targets from each build_file's data dict. for build_file in data["target_build_files"]: if "targets" not in data[build_file]: continue new_targets = [] for target in data[build_file]["targets"]: qualified_name = gyp.common.QualifiedTarget( build_file, target["target_name"], target["toolset"] ) if qualified_name in wanted_targets: new_targets.append(target) data[build_file]["targets"] = new_targets return wanted_targets, wanted_flat_list def VerifyNoCollidingTargets(targets): """Verify that no two targets in the same directory share the same name. Arguments: targets: A list of targets in the form 'path/to/file.gyp:target_name'. """ # Keep a dict going from 'subdirectory:target_name' to 'foo.gyp'. used = {} for target in targets: # Separate out 'path/to/file.gyp, 'target_name' from # 'path/to/file.gyp:target_name'. path, name = target.rsplit(":", 1) # Separate out 'path/to', 'file.gyp' from 'path/to/file.gyp'. subdir, gyp = os.path.split(path) # Use '.' for the current directory '', so that the error messages make # more sense. if not subdir: subdir = "." # Prepare a key like 'path/to:target_name'. key = subdir + ":" + name if key in used: # Complain if this target is already used. raise GypError( 'Duplicate target name "%s" in directory "%s" used both ' 'in "%s" and "%s".' % (name, subdir, gyp, used[key]) ) used[key] = gyp def SetGeneratorGlobals(generator_input_info): # Set up path_sections and non_configuration_keys with the default data plus # the generator-specific data. global path_sections path_sections = set(base_path_sections) path_sections.update(generator_input_info["path_sections"]) global non_configuration_keys non_configuration_keys = base_non_configuration_keys[:] non_configuration_keys.extend(generator_input_info["non_configuration_keys"]) global multiple_toolsets multiple_toolsets = generator_input_info["generator_supports_multiple_toolsets"] global generator_filelist_paths generator_filelist_paths = generator_input_info["generator_filelist_paths"] def Load( build_files, variables, includes, depth, generator_input_info, check, circular_check, parallel, root_targets, ): SetGeneratorGlobals(generator_input_info) # A generator can have other lists (in addition to sources) be processed # for rules. extra_sources_for_rules = generator_input_info["extra_sources_for_rules"] # Load build files. This loads every target-containing build file into # the |data| dictionary such that the keys to |data| are build file names, # and the values are the entire build file contents after "early" or "pre" # processing has been done and includes have been resolved. # NOTE: data contains both "target" files (.gyp) and "includes" (.gypi), as # well as meta-data (e.g. 'included_files' key). 'target_build_files' keeps # track of the keys corresponding to "target" files. data = {"target_build_files": set()} # Normalize paths everywhere. This is important because paths will be # used as keys to the data dict and for references between input files. build_files = set(map(os.path.normpath, build_files)) if parallel: LoadTargetBuildFilesParallel( build_files, data, variables, includes, depth, check, generator_input_info ) else: aux_data = {} for build_file in build_files: try: LoadTargetBuildFile( build_file, data, aux_data, variables, includes, depth, check, True ) except Exception as e: gyp.common.ExceptionAppend(e, "while trying to load %s" % build_file) raise # Build a dict to access each target's subdict by qualified name. targets = BuildTargetsDict(data) # Fully qualify all dependency links. QualifyDependencies(targets) # Remove self-dependencies from targets that have 'prune_self_dependencies' # set to 1. RemoveSelfDependencies(targets) # Expand dependencies specified as build_file:*. ExpandWildcardDependencies(targets, data) # Remove all dependencies marked as 'link_dependency' from the targets of # type 'none'. RemoveLinkDependenciesFromNoneTargets(targets) # Apply exclude (!) and regex (/) list filters only for dependency_sections. for target_name, target_dict in targets.items(): tmp_dict = {} for key_base in dependency_sections: for op in ("", "!", "/"): key = key_base + op if key in target_dict: tmp_dict[key] = target_dict[key] del target_dict[key] ProcessListFiltersInDict(target_name, tmp_dict) # Write the results back to |target_dict|. for key in tmp_dict: target_dict[key] = tmp_dict[key] # Make sure every dependency appears at most once. RemoveDuplicateDependencies(targets) if circular_check: # Make sure that any targets in a.gyp don't contain dependencies in other # .gyp files that further depend on a.gyp. VerifyNoGYPFileCircularDependencies(targets) [dependency_nodes, flat_list] = BuildDependencyList(targets) if root_targets: # Remove, from |targets| and |flat_list|, the targets that are not deep # dependencies of the targets specified in |root_targets|. targets, flat_list = PruneUnwantedTargets( targets, flat_list, dependency_nodes, root_targets, data ) # Check that no two targets in the same directory have the same name. VerifyNoCollidingTargets(flat_list) # Handle dependent settings of various types. for settings_type in [ "all_dependent_settings", "direct_dependent_settings", "link_settings", ]: DoDependentSettings(settings_type, flat_list, targets, dependency_nodes) # Take out the dependent settings now that they've been published to all # of the targets that require them. for target in flat_list: if settings_type in targets[target]: del targets[target][settings_type] # Make sure static libraries don't declare dependencies on other static # libraries, but that linkables depend on all unlinked static libraries # that they need so that their link steps will be correct. gii = generator_input_info if gii["generator_wants_static_library_dependencies_adjusted"]: AdjustStaticLibraryDependencies( flat_list, targets, dependency_nodes, gii["generator_wants_sorted_dependencies"], ) # Apply "post"/"late"/"target" variable expansions and condition evaluations. for target in flat_list: target_dict = targets[target] build_file = gyp.common.BuildFile(target) ProcessVariablesAndConditionsInDict( target_dict, PHASE_LATE, variables, build_file ) # Move everything that can go into a "configurations" section into one. for target in flat_list: target_dict = targets[target] SetUpConfigurations(target, target_dict) # Apply exclude (!) and regex (/) list filters. for target in flat_list: target_dict = targets[target] ProcessListFiltersInDict(target, target_dict) # Apply "latelate" variable expansions and condition evaluations. for target in flat_list: target_dict = targets[target] build_file = gyp.common.BuildFile(target) ProcessVariablesAndConditionsInDict( target_dict, PHASE_LATELATE, variables, build_file ) # Make sure that the rules make sense, and build up rule_sources lists as # needed. Not all generators will need to use the rule_sources lists, but # some may, and it seems best to build the list in a common spot. # Also validate actions and run_as elements in targets. for target in flat_list: target_dict = targets[target] build_file = gyp.common.BuildFile(target) ValidateTargetType(target, target_dict) ValidateRulesInTarget(target, target_dict, extra_sources_for_rules) ValidateRunAsInTarget(target, target_dict, build_file) ValidateActionsInTarget(target, target_dict, build_file) # Generators might not expect ints. Turn them into strs. TurnIntIntoStrInDict(data) # TODO(mark): Return |data| for now because the generator needs a list of # build files that came in. In the future, maybe it should just accept # a list, and not the whole data dict. return [flat_list, targets, data] #!/usr/bin/env python3 # Copyright 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unit tests for the input.py file.""" import gyp.input import unittest class TestFindCycles(unittest.TestCase): def setUp(self): self.nodes = {} for x in ("a", "b", "c", "d", "e"): self.nodes[x] = gyp.input.DependencyGraphNode(x) def _create_dependency(self, dependent, dependency): dependent.dependencies.append(dependency) dependency.dependents.append(dependent) def test_no_cycle_empty_graph(self): for label, node in self.nodes.items(): self.assertEqual([], node.FindCycles()) def test_no_cycle_line(self): self._create_dependency(self.nodes["a"], self.nodes["b"]) self._create_dependency(self.nodes["b"], self.nodes["c"]) self._create_dependency(self.nodes["c"], self.nodes["d"]) for label, node in self.nodes.items(): self.assertEqual([], node.FindCycles()) def test_no_cycle_dag(self): self._create_dependency(self.nodes["a"], self.nodes["b"]) self._create_dependency(self.nodes["a"], self.nodes["c"]) self._create_dependency(self.nodes["b"], self.nodes["c"]) for label, node in self.nodes.items(): self.assertEqual([], node.FindCycles()) def test_cycle_self_reference(self): self._create_dependency(self.nodes["a"], self.nodes["a"]) self.assertEqual( [[self.nodes["a"], self.nodes["a"]]], self.nodes["a"].FindCycles() ) def test_cycle_two_nodes(self): self._create_dependency(self.nodes["a"], self.nodes["b"]) self._create_dependency(self.nodes["b"], self.nodes["a"]) self.assertEqual( [[self.nodes["a"], self.nodes["b"], self.nodes["a"]]], self.nodes["a"].FindCycles(), ) self.assertEqual( [[self.nodes["b"], self.nodes["a"], self.nodes["b"]]], self.nodes["b"].FindCycles(), ) def test_two_cycles(self): self._create_dependency(self.nodes["a"], self.nodes["b"]) self._create_dependency(self.nodes["b"], self.nodes["a"]) self._create_dependency(self.nodes["b"], self.nodes["c"]) self._create_dependency(self.nodes["c"], self.nodes["b"]) cycles = self.nodes["a"].FindCycles() self.assertTrue([self.nodes["a"], self.nodes["b"], self.nodes["a"]] in cycles) self.assertTrue([self.nodes["b"], self.nodes["c"], self.nodes["b"]] in cycles) self.assertEqual(2, len(cycles)) def test_big_cycle(self): self._create_dependency(self.nodes["a"], self.nodes["b"]) self._create_dependency(self.nodes["b"], self.nodes["c"]) self._create_dependency(self.nodes["c"], self.nodes["d"]) self._create_dependency(self.nodes["d"], self.nodes["e"]) self._create_dependency(self.nodes["e"], self.nodes["a"]) self.assertEqual( [ [ self.nodes["a"], self.nodes["b"], self.nodes["c"], self.nodes["d"], self.nodes["e"], self.nodes["a"], ] ], self.nodes["a"].FindCycles(), ) if __name__ == "__main__": unittest.main() #!/usr/bin/env python3 # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utility functions to perform Xcode-style build steps. These functions are executed via gyp-mac-tool when using the Makefile generator. """ import fcntl import fnmatch import glob import json import os import plistlib import re import shutil import struct import subprocess import sys import tempfile def main(args): executor = MacTool() exit_code = executor.Dispatch(args) if exit_code is not None: sys.exit(exit_code) class MacTool: """This class performs all the Mac tooling steps. The methods can either be executed directly, or dispatched from an argument list.""" def Dispatch(self, args): """Dispatches a string command to a method.""" if len(args) < 1: raise Exception("Not enough arguments") method = "Exec%s" % self._CommandifyName(args[0]) return getattr(self, method)(*args[1:]) def _CommandifyName(self, name_string): """Transforms a tool name like copy-info-plist to CopyInfoPlist""" return name_string.title().replace("-", "") def ExecCopyBundleResource(self, source, dest, convert_to_binary): """Copies a resource file to the bundle/Resources directory, performing any necessary compilation on each resource.""" convert_to_binary = convert_to_binary == "True" extension = os.path.splitext(source)[1].lower() if os.path.isdir(source): # Copy tree. # TODO(thakis): This copies file attributes like mtime, while the # single-file branch below doesn't. This should probably be changed to # be consistent with the single-file branch. if os.path.exists(dest): shutil.rmtree(dest) shutil.copytree(source, dest) elif extension == ".xib": return self._CopyXIBFile(source, dest) elif extension == ".storyboard": return self._CopyXIBFile(source, dest) elif extension == ".strings" and not convert_to_binary: self._CopyStringsFile(source, dest) else: if os.path.exists(dest): os.unlink(dest) shutil.copy(source, dest) if convert_to_binary and extension in (".plist", ".strings"): self._ConvertToBinary(dest) def _CopyXIBFile(self, source, dest): """Compiles a XIB file with ibtool into a binary plist in the bundle.""" # ibtool sometimes crashes with relative paths. See crbug.com/314728. base = os.path.dirname(os.path.realpath(__file__)) if os.path.relpath(source): source = os.path.join(base, source) if os.path.relpath(dest): dest = os.path.join(base, dest) args = ["xcrun", "ibtool", "--errors", "--warnings", "--notices"] if os.environ["XCODE_VERSION_ACTUAL"] > "0700": args.extend(["--auto-activate-custom-fonts"]) if "IPHONEOS_DEPLOYMENT_TARGET" in os.environ: args.extend( [ "--target-device", "iphone", "--target-device", "ipad", "--minimum-deployment-target", os.environ["IPHONEOS_DEPLOYMENT_TARGET"], ] ) else: args.extend( [ "--target-device", "mac", "--minimum-deployment-target", os.environ["MACOSX_DEPLOYMENT_TARGET"], ] ) args.extend( ["--output-format", "human-readable-text", "--compile", dest, source] ) ibtool_section_re = re.compile(r"/\*.*\*/") ibtool_re = re.compile(r".*note:.*is clipping its content") try: stdout = subprocess.check_output(args) except subprocess.CalledProcessError as e: print(e.output) raise current_section_header = None for line in stdout.splitlines(): if ibtool_section_re.match(line): current_section_header = line elif not ibtool_re.match(line): if current_section_header: print(current_section_header) current_section_header = None print(line) return 0 def _ConvertToBinary(self, dest): subprocess.check_call( ["xcrun", "plutil", "-convert", "binary1", "-o", dest, dest] ) def _CopyStringsFile(self, source, dest): """Copies a .strings file using iconv to reconvert the input into UTF-16.""" input_code = self._DetectInputEncoding(source) or "UTF-8" # Xcode's CpyCopyStringsFile / builtin-copyStrings seems to call # CFPropertyListCreateFromXMLData() behind the scenes; at least it prints # CFPropertyListCreateFromXMLData(): Old-style plist parser: missing # semicolon in dictionary. # on invalid files. Do the same kind of validation. import CoreFoundation with open(source, "rb") as in_file: s = in_file.read() d = CoreFoundation.CFDataCreate(None, s, len(s)) _, error = CoreFoundation.CFPropertyListCreateFromXMLData(None, d, 0, None) if error: return with open(dest, "wb") as fp: fp.write(s.decode(input_code).encode("UTF-16")) def _DetectInputEncoding(self, file_name): """Reads the first few bytes from file_name and tries to guess the text encoding. Returns None as a guess if it can't detect it.""" with open(file_name, "rb") as fp: try: header = fp.read(3) except Exception: return None if header.startswith(b"\xFE\xFF"): return "UTF-16" elif header.startswith(b"\xFF\xFE"): return "UTF-16" elif header.startswith(b"\xEF\xBB\xBF"): return "UTF-8" else: return None def ExecCopyInfoPlist(self, source, dest, convert_to_binary, *keys): """Copies the |source| Info.plist to the destination directory |dest|.""" # Read the source Info.plist into memory. with open(source) as fd: lines = fd.read() # Insert synthesized key/value pairs (e.g. BuildMachineOSBuild). plist = plistlib.readPlistFromString(lines) if keys: plist.update(json.loads(keys[0])) lines = plistlib.writePlistToString(plist) # Go through all the environment variables and replace them as variables in # the file. IDENT_RE = re.compile(r"[_/\s]") for key in os.environ: if key.startswith("_"): continue evar = "${%s}" % key evalue = os.environ[key] lines = lines.replace(lines, evar, evalue) # Xcode supports various suffices on environment variables, which are # all undocumented. :rfc1034identifier is used in the standard project # template these days, and :identifier was used earlier. They are used to # convert non-url characters into things that look like valid urls -- # except that the replacement character for :identifier, '_' isn't valid # in a URL either -- oops, hence :rfc1034identifier was born. evar = "${%s:identifier}" % key evalue = IDENT_RE.sub("_", os.environ[key]) lines = lines.replace(lines, evar, evalue) evar = "${%s:rfc1034identifier}" % key evalue = IDENT_RE.sub("-", os.environ[key]) lines = lines.replace(lines, evar, evalue) # Remove any keys with values that haven't been replaced. lines = lines.splitlines() for i in range(len(lines)): if lines[i].strip().startswith("${"): lines[i] = None lines[i - 1] = None lines = "\n".join(line for line in lines if line is not None) # Write out the file with variables replaced. with open(dest, "w") as fd: fd.write(lines) # Now write out PkgInfo file now that the Info.plist file has been # "compiled". self._WritePkgInfo(dest) if convert_to_binary == "True": self._ConvertToBinary(dest) def _WritePkgInfo(self, info_plist): """This writes the PkgInfo file from the data stored in Info.plist.""" plist = plistlib.readPlist(info_plist) if not plist: return # Only create PkgInfo for executable types. package_type = plist["CFBundlePackageType"] if package_type != "APPL": return # The format of PkgInfo is eight characters, representing the bundle type # and bundle signature, each four characters. If that is missing, four # '?' characters are used instead. signature_code = plist.get("CFBundleSignature", "????") if len(signature_code) != 4: # Wrong length resets everything, too. signature_code = "?" * 4 dest = os.path.join(os.path.dirname(info_plist), "PkgInfo") with open(dest, "w") as fp: fp.write(f"{package_type}{signature_code}") def ExecFlock(self, lockfile, *cmd_list): """Emulates the most basic behavior of Linux's flock(1).""" # Rely on exception handling to report errors. fd = os.open(lockfile, os.O_RDONLY | os.O_NOCTTY | os.O_CREAT, 0o666) fcntl.flock(fd, fcntl.LOCK_EX) return subprocess.call(cmd_list) def ExecFilterLibtool(self, *cmd_list): """Calls libtool and filters out '/path/to/libtool: file: foo.o has no symbols'.""" libtool_re = re.compile( r"^.*libtool: (?:for architecture: \S* )?" r"file: .* has no symbols$" ) libtool_re5 = re.compile( r"^.*libtool: warning for library: " + r".* the table of contents is empty " + r"\(no object file members in the library define global symbols\)$" ) env = os.environ.copy() # Ref: # http://www.opensource.apple.com/source/cctools/cctools-809/misc/libtool.c # The problem with this flag is that it resets the file mtime on the file to # epoch=0, e.g. 1970-1-1 or 1969-12-31 depending on timezone. env["ZERO_AR_DATE"] = "1" libtoolout = subprocess.Popen(cmd_list, stderr=subprocess.PIPE, env=env) err = libtoolout.communicate()[1].decode("utf-8") for line in err.splitlines(): if not libtool_re.match(line) and not libtool_re5.match(line): print(line, file=sys.stderr) # Unconditionally touch the output .a file on the command line if present # and the command succeeded. A bit hacky. if not libtoolout.returncode: for i in range(len(cmd_list) - 1): if cmd_list[i] == "-o" and cmd_list[i + 1].endswith(".a"): os.utime(cmd_list[i + 1], None) break return libtoolout.returncode def ExecPackageIosFramework(self, framework): # Find the name of the binary based on the part before the ".framework". binary = os.path.basename(framework).split(".")[0] module_path = os.path.join(framework, "Modules") if not os.path.exists(module_path): os.mkdir(module_path) module_template = ( "framework module %s {\n" ' umbrella header "%s.h"\n' "\n" " export *\n" " module * { export * }\n" "}\n" % (binary, binary) ) with open(os.path.join(module_path, "module.modulemap"), "w") as module_file: module_file.write(module_template) def ExecPackageFramework(self, framework, version): """Takes a path to Something.framework and the Current version of that and sets up all the symlinks.""" # Find the name of the binary based on the part before the ".framework". binary = os.path.basename(framework).split(".")[0] CURRENT = "Current" RESOURCES = "Resources" VERSIONS = "Versions" if not os.path.exists(os.path.join(framework, VERSIONS, version, binary)): # Binary-less frameworks don't seem to contain symlinks (see e.g. # chromium's out/Debug/org.chromium.Chromium.manifest/ bundle). return # Move into the framework directory to set the symlinks correctly. pwd = os.getcwd() os.chdir(framework) # Set up the Current version. self._Relink(version, os.path.join(VERSIONS, CURRENT)) # Set up the root symlinks. self._Relink(os.path.join(VERSIONS, CURRENT, binary), binary) self._Relink(os.path.join(VERSIONS, CURRENT, RESOURCES), RESOURCES) # Back to where we were before! os.chdir(pwd) def _Relink(self, dest, link): """Creates a symlink to |dest| named |link|. If |link| already exists, it is overwritten.""" if os.path.lexists(link): os.remove(link) os.symlink(dest, link) def ExecCompileIosFrameworkHeaderMap(self, out, framework, *all_headers): framework_name = os.path.basename(framework).split(".")[0] all_headers = [os.path.abspath(header) for header in all_headers] filelist = {} for header in all_headers: filename = os.path.basename(header) filelist[filename] = header filelist[os.path.join(framework_name, filename)] = header WriteHmap(out, filelist) def ExecCopyIosFrameworkHeaders(self, framework, *copy_headers): header_path = os.path.join(framework, "Headers") if not os.path.exists(header_path): os.makedirs(header_path) for header in copy_headers: shutil.copy(header, os.path.join(header_path, os.path.basename(header))) def ExecCompileXcassets(self, keys, *inputs): """Compiles multiple .xcassets files into a single .car file. This invokes 'actool' to compile all the inputs .xcassets files. The |keys| arguments is a json-encoded dictionary of extra arguments to pass to 'actool' when the asset catalogs contains an application icon or a launch image. Note that 'actool' does not create the Assets.car file if the asset catalogs does not contains imageset. """ command_line = [ "xcrun", "actool", "--output-format", "human-readable-text", "--compress-pngs", "--notices", "--warnings", "--errors", ] is_iphone_target = "IPHONEOS_DEPLOYMENT_TARGET" in os.environ if is_iphone_target: platform = os.environ["CONFIGURATION"].split("-")[-1] if platform not in ("iphoneos", "iphonesimulator"): platform = "iphonesimulator" command_line.extend( [ "--platform", platform, "--target-device", "iphone", "--target-device", "ipad", "--minimum-deployment-target", os.environ["IPHONEOS_DEPLOYMENT_TARGET"], "--compile", os.path.abspath(os.environ["CONTENTS_FOLDER_PATH"]), ] ) else: command_line.extend( [ "--platform", "macosx", "--target-device", "mac", "--minimum-deployment-target", os.environ["MACOSX_DEPLOYMENT_TARGET"], "--compile", os.path.abspath(os.environ["UNLOCALIZED_RESOURCES_FOLDER_PATH"]), ] ) if keys: keys = json.loads(keys) for key, value in keys.items(): arg_name = "--" + key if isinstance(value, bool): if value: command_line.append(arg_name) elif isinstance(value, list): for v in value: command_line.append(arg_name) command_line.append(str(v)) else: command_line.append(arg_name) command_line.append(str(value)) # Note: actool crashes if inputs path are relative, so use os.path.abspath # to get absolute path name for inputs. command_line.extend(map(os.path.abspath, inputs)) subprocess.check_call(command_line) def ExecMergeInfoPlist(self, output, *inputs): """Merge multiple .plist files into a single .plist file.""" merged_plist = {} for path in inputs: plist = self._LoadPlistMaybeBinary(path) self._MergePlist(merged_plist, plist) plistlib.writePlist(merged_plist, output) def ExecCodeSignBundle(self, key, entitlements, provisioning, path, preserve): """Code sign a bundle. This function tries to code sign an iOS bundle, following the same algorithm as Xcode: 1. pick the provisioning profile that best match the bundle identifier, and copy it into the bundle as embedded.mobileprovision, 2. copy Entitlements.plist from user or SDK next to the bundle, 3. code sign the bundle. """ substitutions, overrides = self._InstallProvisioningProfile( provisioning, self._GetCFBundleIdentifier() ) entitlements_path = self._InstallEntitlements( entitlements, substitutions, overrides ) args = ["codesign", "--force", "--sign", key] if preserve == "True": args.extend(["--deep", "--preserve-metadata=identifier,entitlements"]) else: args.extend(["--entitlements", entitlements_path]) args.extend(["--timestamp=none", path]) subprocess.check_call(args) def _InstallProvisioningProfile(self, profile, bundle_identifier): """Installs embedded.mobileprovision into the bundle. Args: profile: string, optional, short name of the .mobileprovision file to use, if empty or the file is missing, the best file installed will be used bundle_identifier: string, value of CFBundleIdentifier from Info.plist Returns: A tuple containing two dictionary: variables substitutions and values to overrides when generating the entitlements file. """ source_path, provisioning_data, team_id = self._FindProvisioningProfile( profile, bundle_identifier ) target_path = os.path.join( os.environ["BUILT_PRODUCTS_DIR"], os.environ["CONTENTS_FOLDER_PATH"], "embedded.mobileprovision", ) shutil.copy2(source_path, target_path) substitutions = self._GetSubstitutions(bundle_identifier, team_id + ".") return substitutions, provisioning_data["Entitlements"] def _FindProvisioningProfile(self, profile, bundle_identifier): """Finds the .mobileprovision file to use for signing the bundle. Checks all the installed provisioning profiles (or if the user specified the PROVISIONING_PROFILE variable, only consult it) and select the most specific that correspond to the bundle identifier. Args: profile: string, optional, short name of the .mobileprovision file to use, if empty or the file is missing, the best file installed will be used bundle_identifier: string, value of CFBundleIdentifier from Info.plist Returns: A tuple of the path to the selected provisioning profile, the data of the embedded plist in the provisioning profile and the team identifier to use for code signing. Raises: SystemExit: if no .mobileprovision can be used to sign the bundle. """ profiles_dir = os.path.join( os.environ["HOME"], "Library", "MobileDevice", "Provisioning Profiles" ) if not os.path.isdir(profiles_dir): print( "cannot find mobile provisioning for %s" % (bundle_identifier), file=sys.stderr, ) sys.exit(1) provisioning_profiles = None if profile: profile_path = os.path.join(profiles_dir, profile + ".mobileprovision") if os.path.exists(profile_path): provisioning_profiles = [profile_path] if not provisioning_profiles: provisioning_profiles = glob.glob( os.path.join(profiles_dir, "*.mobileprovision") ) valid_provisioning_profiles = {} for profile_path in provisioning_profiles: profile_data = self._LoadProvisioningProfile(profile_path) app_id_pattern = profile_data.get("Entitlements", {}).get( "application-identifier", "" ) for team_identifier in profile_data.get("TeamIdentifier", []): app_id = f"{team_identifier}.{bundle_identifier}" if fnmatch.fnmatch(app_id, app_id_pattern): valid_provisioning_profiles[app_id_pattern] = ( profile_path, profile_data, team_identifier, ) if not valid_provisioning_profiles: print( "cannot find mobile provisioning for %s" % (bundle_identifier), file=sys.stderr, ) sys.exit(1) # If the user has multiple provisioning profiles installed that can be # used for ${bundle_identifier}, pick the most specific one (ie. the # provisioning profile whose pattern is the longest). selected_key = max(valid_provisioning_profiles, key=lambda v: len(v)) return valid_provisioning_profiles[selected_key] def _LoadProvisioningProfile(self, profile_path): """Extracts the plist embedded in a provisioning profile. Args: profile_path: string, path to the .mobileprovision file Returns: Content of the plist embedded in the provisioning profile as a dictionary. """ with tempfile.NamedTemporaryFile() as temp: subprocess.check_call( ["security", "cms", "-D", "-i", profile_path, "-o", temp.name] ) return self._LoadPlistMaybeBinary(temp.name) def _MergePlist(self, merged_plist, plist): """Merge |plist| into |merged_plist|.""" for key, value in plist.items(): if isinstance(value, dict): merged_value = merged_plist.get(key, {}) if isinstance(merged_value, dict): self._MergePlist(merged_value, value) merged_plist[key] = merged_value else: merged_plist[key] = value else: merged_plist[key] = value def _LoadPlistMaybeBinary(self, plist_path): """Loads into a memory a plist possibly encoded in binary format. This is a wrapper around plistlib.readPlist that tries to convert the plist to the XML format if it can't be parsed (assuming that it is in the binary format). Args: plist_path: string, path to a plist file, in XML or binary format Returns: Content of the plist as a dictionary. """ try: # First, try to read the file using plistlib that only supports XML, # and if an exception is raised, convert a temporary copy to XML and # load that copy. return plistlib.readPlist(plist_path) except Exception: pass with tempfile.NamedTemporaryFile() as temp: shutil.copy2(plist_path, temp.name) subprocess.check_call(["plutil", "-convert", "xml1", temp.name]) return plistlib.readPlist(temp.name) def _GetSubstitutions(self, bundle_identifier, app_identifier_prefix): """Constructs a dictionary of variable substitutions for Entitlements.plist. Args: bundle_identifier: string, value of CFBundleIdentifier from Info.plist app_identifier_prefix: string, value for AppIdentifierPrefix Returns: Dictionary of substitutions to apply when generating Entitlements.plist. """ return { "CFBundleIdentifier": bundle_identifier, "AppIdentifierPrefix": app_identifier_prefix, } def _GetCFBundleIdentifier(self): """Extracts CFBundleIdentifier value from Info.plist in the bundle. Returns: Value of CFBundleIdentifier in the Info.plist located in the bundle. """ info_plist_path = os.path.join( os.environ["TARGET_BUILD_DIR"], os.environ["INFOPLIST_PATH"] ) info_plist_data = self._LoadPlistMaybeBinary(info_plist_path) return info_plist_data["CFBundleIdentifier"] def _InstallEntitlements(self, entitlements, substitutions, overrides): """Generates and install the ${BundleName}.xcent entitlements file. Expands variables "$(variable)" pattern in the source entitlements file, add extra entitlements defined in the .mobileprovision file and the copy the generated plist to "${BundlePath}.xcent". Args: entitlements: string, optional, path to the Entitlements.plist template to use, defaults to "${SDKROOT}/Entitlements.plist" substitutions: dictionary, variable substitutions overrides: dictionary, values to add to the entitlements Returns: Path to the generated entitlements file. """ source_path = entitlements target_path = os.path.join( os.environ["BUILT_PRODUCTS_DIR"], os.environ["PRODUCT_NAME"] + ".xcent" ) if not source_path: source_path = os.path.join(os.environ["SDKROOT"], "Entitlements.plist") shutil.copy2(source_path, target_path) data = self._LoadPlistMaybeBinary(target_path) data = self._ExpandVariables(data, substitutions) if overrides: for key in overrides: if key not in data: data[key] = overrides[key] plistlib.writePlist(data, target_path) return target_path def _ExpandVariables(self, data, substitutions): """Expands variables "$(variable)" in data. Args: data: object, can be either string, list or dictionary substitutions: dictionary, variable substitutions to perform Returns: Copy of data where each references to "$(variable)" has been replaced by the corresponding value found in substitutions, or left intact if the key was not found. """ if isinstance(data, str): for key, value in substitutions.items(): data = data.replace("$(%s)" % key, value) return data if isinstance(data, list): return [self._ExpandVariables(v, substitutions) for v in data] if isinstance(data, dict): return {k: self._ExpandVariables(data[k], substitutions) for k in data} return data def NextGreaterPowerOf2(x): return 2 ** (x).bit_length() def WriteHmap(output_name, filelist): """Generates a header map based on |filelist|. Per Mark Mentovai: A header map is structured essentially as a hash table, keyed by names used in #includes, and providing pathnames to the actual files. The implementation below and the comment above comes from inspecting: http://www.opensource.apple.com/source/distcc/distcc-2503/distcc_dist/include_server/headermap.py?txt while also looking at the implementation in clang in: https://llvm.org/svn/llvm-project/cfe/trunk/lib/Lex/HeaderMap.cpp """ magic = 1751998832 version = 1 _reserved = 0 count = len(filelist) capacity = NextGreaterPowerOf2(count) strings_offset = 24 + (12 * capacity) max_value_length = max(len(value) for value in filelist.values()) out = open(output_name, "wb") out.write( struct.pack( " y) - (x < y) # Initialize random number generator random.seed() # GUIDs for project types ENTRY_TYPE_GUIDS = { "project": "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}", "folder": "{2150E333-8FDC-42A3-9474-1A3956D46DE8}", } # ------------------------------------------------------------------------------ # Helper functions def MakeGuid(name, seed="msvs_new"): """Returns a GUID for the specified target name. Args: name: Target name. seed: Seed for MD5 hash. Returns: A GUID-line string calculated from the name and seed. This generates something which looks like a GUID, but depends only on the name and seed. This means the same name/seed will always generate the same GUID, so that projects and solutions which refer to each other can explicitly determine the GUID to refer to explicitly. It also means that the GUID will not change when the project for a target is rebuilt. """ # Calculate a MD5 signature for the seed and name. d = hashlib.md5((str(seed) + str(name)).encode("utf-8")).hexdigest().upper() # Convert most of the signature to GUID form (discard the rest) guid = ( "{" + d[:8] + "-" + d[8:12] + "-" + d[12:16] + "-" + d[16:20] + "-" + d[20:32] + "}" ) return guid # ------------------------------------------------------------------------------ class MSVSSolutionEntry: def __cmp__(self, other): # Sort by name then guid (so things are in order on vs2008). return cmp((self.name, self.get_guid()), (other.name, other.get_guid())) class MSVSFolder(MSVSSolutionEntry): """Folder in a Visual Studio project or solution.""" def __init__(self, path, name=None, entries=None, guid=None, items=None): """Initializes the folder. Args: path: Full path to the folder. name: Name of the folder. entries: List of folder entries to nest inside this folder. May contain Folder or Project objects. May be None, if the folder is empty. guid: GUID to use for folder, if not None. items: List of solution items to include in the folder project. May be None, if the folder does not directly contain items. """ if name: self.name = name else: # Use last layer. self.name = os.path.basename(path) self.path = path self.guid = guid # Copy passed lists (or set to empty lists) self.entries = sorted(entries or [], key=attrgetter("path")) self.items = list(items or []) self.entry_type_guid = ENTRY_TYPE_GUIDS["folder"] def get_guid(self): if self.guid is None: # Use consistent guids for folders (so things don't regenerate). self.guid = MakeGuid(self.path, seed="msvs_folder") return self.guid # ------------------------------------------------------------------------------ class MSVSProject(MSVSSolutionEntry): """Visual Studio project.""" def __init__( self, path, name=None, dependencies=None, guid=None, spec=None, build_file=None, config_platform_overrides=None, fixpath_prefix=None, ): """Initializes the project. Args: path: Absolute path to the project file. name: Name of project. If None, the name will be the same as the base name of the project file. dependencies: List of other Project objects this project is dependent upon, if not None. guid: GUID to use for project, if not None. spec: Dictionary specifying how to build this project. build_file: Filename of the .gyp file that the vcproj file comes from. config_platform_overrides: optional dict of configuration platforms to used in place of the default for this target. fixpath_prefix: the path used to adjust the behavior of _fixpath """ self.path = path self.guid = guid self.spec = spec self.build_file = build_file # Use project filename if name not specified self.name = name or os.path.splitext(os.path.basename(path))[0] # Copy passed lists (or set to empty lists) self.dependencies = list(dependencies or []) self.entry_type_guid = ENTRY_TYPE_GUIDS["project"] if config_platform_overrides: self.config_platform_overrides = config_platform_overrides else: self.config_platform_overrides = {} self.fixpath_prefix = fixpath_prefix self.msbuild_toolset = None def set_dependencies(self, dependencies): self.dependencies = list(dependencies or []) def get_guid(self): if self.guid is None: # Set GUID from path # TODO(rspangler): This is fragile. # 1. We can't just use the project filename sans path, since there could # be multiple projects with the same base name (for example, # foo/unittest.vcproj and bar/unittest.vcproj). # 2. The path needs to be relative to $SOURCE_ROOT, so that the project # GUID is the same whether it's included from base/base.sln or # foo/bar/baz/baz.sln. # 3. The GUID needs to be the same each time this builder is invoked, so # that we don't need to rebuild the solution when the project changes. # 4. We should be able to handle pre-built project files by reading the # GUID from the files. self.guid = MakeGuid(self.name) return self.guid def set_msbuild_toolset(self, msbuild_toolset): self.msbuild_toolset = msbuild_toolset # ------------------------------------------------------------------------------ class MSVSSolution: """Visual Studio solution.""" def __init__( self, path, version, entries=None, variants=None, websiteProperties=True ): """Initializes the solution. Args: path: Path to solution file. version: Format version to emit. entries: List of entries in solution. May contain Folder or Project objects. May be None, if the folder is empty. variants: List of build variant strings. If none, a default list will be used. websiteProperties: Flag to decide if the website properties section is generated. """ self.path = path self.websiteProperties = websiteProperties self.version = version # Copy passed lists (or set to empty lists) self.entries = list(entries or []) if variants: # Copy passed list self.variants = variants[:] else: # Use default self.variants = ["Debug|Win32", "Release|Win32"] # TODO(rspangler): Need to be able to handle a mapping of solution config # to project config. Should we be able to handle variants being a dict, # or add a separate variant_map variable? If it's a dict, we can't # guarantee the order of variants since dict keys aren't ordered. # TODO(rspangler): Automatically write to disk for now; should delay until # node-evaluation time. self.Write() def Write(self, writer=gyp.common.WriteOnDiff): """Writes the solution file to disk. Raises: IndexError: An entry appears multiple times. """ # Walk the entry tree and collect all the folders and projects. all_entries = set() entries_to_check = self.entries[:] while entries_to_check: e = entries_to_check.pop(0) # If this entry has been visited, nothing to do. if e in all_entries: continue all_entries.add(e) # If this is a folder, check its entries too. if isinstance(e, MSVSFolder): entries_to_check += e.entries all_entries = sorted(all_entries, key=attrgetter("path")) # Open file and print header f = writer(self.path) f.write( "Microsoft Visual Studio Solution File, " "Format Version %s\r\n" % self.version.SolutionVersion() ) f.write("# %s\r\n" % self.version.Description()) # Project entries sln_root = os.path.split(self.path)[0] for e in all_entries: relative_path = gyp.common.RelativePath(e.path, sln_root) # msbuild does not accept an empty folder_name. # use '.' in case relative_path is empty. folder_name = relative_path.replace("/", "\\") or "." f.write( 'Project("%s") = "%s", "%s", "%s"\r\n' % ( e.entry_type_guid, # Entry type GUID e.name, # Folder name folder_name, # Folder name (again) e.get_guid(), # Entry GUID ) ) # TODO(rspangler): Need a way to configure this stuff if self.websiteProperties: f.write( "\tProjectSection(WebsiteProperties) = preProject\r\n" '\t\tDebug.AspNetCompiler.Debug = "True"\r\n' '\t\tRelease.AspNetCompiler.Debug = "False"\r\n' "\tEndProjectSection\r\n" ) if isinstance(e, MSVSFolder): if e.items: f.write("\tProjectSection(SolutionItems) = preProject\r\n") for i in e.items: f.write(f"\t\t{i} = {i}\r\n") f.write("\tEndProjectSection\r\n") if isinstance(e, MSVSProject): if e.dependencies: f.write("\tProjectSection(ProjectDependencies) = postProject\r\n") for d in e.dependencies: f.write(f"\t\t{d.get_guid()} = {d.get_guid()}\r\n") f.write("\tEndProjectSection\r\n") f.write("EndProject\r\n") # Global section f.write("Global\r\n") # Configurations (variants) f.write("\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\r\n") for v in self.variants: f.write(f"\t\t{v} = {v}\r\n") f.write("\tEndGlobalSection\r\n") # Sort config guids for easier diffing of solution changes. config_guids = [] config_guids_overrides = {} for e in all_entries: if isinstance(e, MSVSProject): config_guids.append(e.get_guid()) config_guids_overrides[e.get_guid()] = e.config_platform_overrides config_guids.sort() f.write("\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\r\n") for g in config_guids: for v in self.variants: nv = config_guids_overrides[g].get(v, v) # Pick which project configuration to build for this solution # configuration. f.write( "\t\t%s.%s.ActiveCfg = %s\r\n" % ( g, # Project GUID v, # Solution build configuration nv, # Project build config for that solution config ) ) # Enable project in this solution configuration. f.write( "\t\t%s.%s.Build.0 = %s\r\n" % ( g, # Project GUID v, # Solution build configuration nv, # Project build config for that solution config ) ) f.write("\tEndGlobalSection\r\n") # TODO(rspangler): Should be able to configure this stuff too (though I've # never seen this be any different) f.write("\tGlobalSection(SolutionProperties) = preSolution\r\n") f.write("\t\tHideSolutionNode = FALSE\r\n") f.write("\tEndGlobalSection\r\n") # Folder mappings # Omit this section if there are no folders if any([e.entries for e in all_entries if isinstance(e, MSVSFolder)]): f.write("\tGlobalSection(NestedProjects) = preSolution\r\n") for e in all_entries: if not isinstance(e, MSVSFolder): continue # Does not apply to projects, only folders for subentry in e.entries: f.write(f"\t\t{subentry.get_guid()} = {e.get_guid()}\r\n") f.write("\tEndGlobalSection\r\n") f.write("EndGlobal\r\n") f.close() # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Visual Studio project reader/writer.""" import gyp.easy_xml as easy_xml # ------------------------------------------------------------------------------ class Tool: """Visual Studio tool.""" def __init__(self, name, attrs=None): """Initializes the tool. Args: name: Tool name. attrs: Dict of tool attributes; may be None. """ self._attrs = attrs or {} self._attrs["Name"] = name def _GetSpecification(self): """Creates an element for the tool. Returns: A new xml.dom.Element for the tool. """ return ["Tool", self._attrs] class Filter: """Visual Studio filter - that is, a virtual folder.""" def __init__(self, name, contents=None): """Initializes the folder. Args: name: Filter (folder) name. contents: List of filenames and/or Filter objects contained. """ self.name = name self.contents = list(contents or []) # ------------------------------------------------------------------------------ class Writer: """Visual Studio XML project writer.""" def __init__(self, project_path, version, name, guid=None, platforms=None): """Initializes the project. Args: project_path: Path to the project file. version: Format version to emit. name: Name of the project. guid: GUID to use for project, if not None. platforms: Array of string, the supported platforms. If null, ['Win32'] """ self.project_path = project_path self.version = version self.name = name self.guid = guid # Default to Win32 for platforms. if not platforms: platforms = ["Win32"] # Initialize the specifications of the various sections. self.platform_section = ["Platforms"] for platform in platforms: self.platform_section.append(["Platform", {"Name": platform}]) self.tool_files_section = ["ToolFiles"] self.configurations_section = ["Configurations"] self.files_section = ["Files"] # Keep a dict keyed on filename to speed up access. self.files_dict = dict() def AddToolFile(self, path): """Adds a tool file to the project. Args: path: Relative path from project to tool file. """ self.tool_files_section.append(["ToolFile", {"RelativePath": path}]) def _GetSpecForConfiguration(self, config_type, config_name, attrs, tools): """Returns the specification for a configuration. Args: config_type: Type of configuration node. config_name: Configuration name. attrs: Dict of configuration attributes; may be None. tools: List of tools (strings or Tool objects); may be None. Returns: """ # Handle defaults if not attrs: attrs = {} if not tools: tools = [] # Add configuration node and its attributes node_attrs = attrs.copy() node_attrs["Name"] = config_name specification = [config_type, node_attrs] # Add tool nodes and their attributes if tools: for t in tools: if isinstance(t, Tool): specification.append(t._GetSpecification()) else: specification.append(Tool(t)._GetSpecification()) return specification def AddConfig(self, name, attrs=None, tools=None): """Adds a configuration to the project. Args: name: Configuration name. attrs: Dict of configuration attributes; may be None. tools: List of tools (strings or Tool objects); may be None. """ spec = self._GetSpecForConfiguration("Configuration", name, attrs, tools) self.configurations_section.append(spec) def _AddFilesToNode(self, parent, files): """Adds files and/or filters to the parent node. Args: parent: Destination node files: A list of Filter objects and/or relative paths to files. Will call itself recursively, if the files list contains Filter objects. """ for f in files: if isinstance(f, Filter): node = ["Filter", {"Name": f.name}] self._AddFilesToNode(node, f.contents) else: node = ["File", {"RelativePath": f}] self.files_dict[f] = node parent.append(node) def AddFiles(self, files): """Adds files to the project. Args: files: A list of Filter objects and/or relative paths to files. This makes a copy of the file/filter tree at the time of this call. If you later add files to a Filter object which was passed into a previous call to AddFiles(), it will not be reflected in this project. """ self._AddFilesToNode(self.files_section, files) # TODO(rspangler) This also doesn't handle adding files to an existing # filter. That is, it doesn't merge the trees. def AddFileConfig(self, path, config, attrs=None, tools=None): """Adds a configuration to a file. Args: path: Relative path to the file. config: Name of configuration to add. attrs: Dict of configuration attributes; may be None. tools: List of tools (strings or Tool objects); may be None. Raises: ValueError: Relative path does not match any file added via AddFiles(). """ # Find the file node with the right relative path parent = self.files_dict.get(path) if not parent: raise ValueError('AddFileConfig: file "%s" not in project.' % path) # Add the config to the file node spec = self._GetSpecForConfiguration("FileConfiguration", config, attrs, tools) parent.append(spec) def WriteIfChanged(self): """Writes the project file.""" # First create XML content definition content = [ "VisualStudioProject", { "ProjectType": "Visual C++", "Version": self.version.ProjectVersion(), "Name": self.name, "ProjectGUID": self.guid, "RootNamespace": self.name, "Keyword": "Win32Proj", }, self.platform_section, self.tool_files_section, self.configurations_section, ["References"], # empty section self.files_section, ["Globals"], # empty section ] easy_xml.WriteXmlIfChanged(content, self.project_path, encoding="Windows-1252") # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. r"""Code to validate and convert settings of the Microsoft build tools. This file contains code to validate and convert settings of the Microsoft build tools. The function ConvertToMSBuildSettings(), ValidateMSVSSettings(), and ValidateMSBuildSettings() are the entry points. This file was created by comparing the projects created by Visual Studio 2008 and Visual Studio 2010 for all available settings through the user interface. The MSBuild schemas were also considered. They are typically found in the MSBuild install directory, e.g. c:\Program Files (x86)\MSBuild """ import re import sys # Dictionaries of settings validators. The key is the tool name, the value is # a dictionary mapping setting names to validation functions. _msvs_validators = {} _msbuild_validators = {} # A dictionary of settings converters. The key is the tool name, the value is # a dictionary mapping setting names to conversion functions. _msvs_to_msbuild_converters = {} # Tool name mapping from MSVS to MSBuild. _msbuild_name_of_tool = {} class _Tool: """Represents a tool used by MSVS or MSBuild. Attributes: msvs_name: The name of the tool in MSVS. msbuild_name: The name of the tool in MSBuild. """ def __init__(self, msvs_name, msbuild_name): self.msvs_name = msvs_name self.msbuild_name = msbuild_name def _AddTool(tool): """Adds a tool to the four dictionaries used to process settings. This only defines the tool. Each setting also needs to be added. Args: tool: The _Tool object to be added. """ _msvs_validators[tool.msvs_name] = {} _msbuild_validators[tool.msbuild_name] = {} _msvs_to_msbuild_converters[tool.msvs_name] = {} _msbuild_name_of_tool[tool.msvs_name] = tool.msbuild_name def _GetMSBuildToolSettings(msbuild_settings, tool): """Returns an MSBuild tool dictionary. Creates it if needed.""" return msbuild_settings.setdefault(tool.msbuild_name, {}) class _Type: """Type of settings (Base class).""" def ValidateMSVS(self, value): """Verifies that the value is legal for MSVS. Args: value: the value to check for this type. Raises: ValueError if value is not valid for MSVS. """ def ValidateMSBuild(self, value): """Verifies that the value is legal for MSBuild. Args: value: the value to check for this type. Raises: ValueError if value is not valid for MSBuild. """ def ConvertToMSBuild(self, value): """Returns the MSBuild equivalent of the MSVS value given. Args: value: the MSVS value to convert. Returns: the MSBuild equivalent. Raises: ValueError if value is not valid. """ return value class _String(_Type): """A setting that's just a string.""" def ValidateMSVS(self, value): if not isinstance(value, str): raise ValueError("expected string; got %r" % value) def ValidateMSBuild(self, value): if not isinstance(value, str): raise ValueError("expected string; got %r" % value) def ConvertToMSBuild(self, value): # Convert the macros return ConvertVCMacrosToMSBuild(value) class _StringList(_Type): """A settings that's a list of strings.""" def ValidateMSVS(self, value): if not isinstance(value, (list, str)): raise ValueError("expected string list; got %r" % value) def ValidateMSBuild(self, value): if not isinstance(value, (list, str)): raise ValueError("expected string list; got %r" % value) def ConvertToMSBuild(self, value): # Convert the macros if isinstance(value, list): return [ConvertVCMacrosToMSBuild(i) for i in value] else: return ConvertVCMacrosToMSBuild(value) class _Boolean(_Type): """Boolean settings, can have the values 'false' or 'true'.""" def _Validate(self, value): if value != "true" and value != "false": raise ValueError("expected bool; got %r" % value) def ValidateMSVS(self, value): self._Validate(value) def ValidateMSBuild(self, value): self._Validate(value) def ConvertToMSBuild(self, value): self._Validate(value) return value class _Integer(_Type): """Integer settings.""" def __init__(self, msbuild_base=10): _Type.__init__(self) self._msbuild_base = msbuild_base def ValidateMSVS(self, value): # Try to convert, this will raise ValueError if invalid. self.ConvertToMSBuild(value) def ValidateMSBuild(self, value): # Try to convert, this will raise ValueError if invalid. int(value, self._msbuild_base) def ConvertToMSBuild(self, value): msbuild_format = (self._msbuild_base == 10) and "%d" or "0x%04x" return msbuild_format % int(value) class _Enumeration(_Type): """Type of settings that is an enumeration. In MSVS, the values are indexes like '0', '1', and '2'. MSBuild uses text labels that are more representative, like 'Win32'. Constructor args: label_list: an array of MSBuild labels that correspond to the MSVS index. In the rare cases where MSVS has skipped an index value, None is used in the array to indicate the unused spot. new: an array of labels that are new to MSBuild. """ def __init__(self, label_list, new=None): _Type.__init__(self) self._label_list = label_list self._msbuild_values = {value for value in label_list if value is not None} if new is not None: self._msbuild_values.update(new) def ValidateMSVS(self, value): # Try to convert. It will raise an exception if not valid. self.ConvertToMSBuild(value) def ValidateMSBuild(self, value): if value not in self._msbuild_values: raise ValueError("unrecognized enumerated value %s" % value) def ConvertToMSBuild(self, value): index = int(value) if index < 0 or index >= len(self._label_list): raise ValueError( "index value (%d) not in expected range [0, %d)" % (index, len(self._label_list)) ) label = self._label_list[index] if label is None: raise ValueError("converted value for %s not specified." % value) return label # Instantiate the various generic types. _boolean = _Boolean() _integer = _Integer() # For now, we don't do any special validation on these types: _string = _String() _file_name = _String() _folder_name = _String() _file_list = _StringList() _folder_list = _StringList() _string_list = _StringList() # Some boolean settings went from numerical values to boolean. The # mapping is 0: default, 1: false, 2: true. _newly_boolean = _Enumeration(["", "false", "true"]) def _Same(tool, name, setting_type): """Defines a setting that has the same name in MSVS and MSBuild. Args: tool: a dictionary that gives the names of the tool for MSVS and MSBuild. name: the name of the setting. setting_type: the type of this setting. """ _Renamed(tool, name, name, setting_type) def _Renamed(tool, msvs_name, msbuild_name, setting_type): """Defines a setting for which the name has changed. Args: tool: a dictionary that gives the names of the tool for MSVS and MSBuild. msvs_name: the name of the MSVS setting. msbuild_name: the name of the MSBuild setting. setting_type: the type of this setting. """ def _Translate(value, msbuild_settings): msbuild_tool_settings = _GetMSBuildToolSettings(msbuild_settings, tool) msbuild_tool_settings[msbuild_name] = setting_type.ConvertToMSBuild(value) _msvs_validators[tool.msvs_name][msvs_name] = setting_type.ValidateMSVS _msbuild_validators[tool.msbuild_name][msbuild_name] = setting_type.ValidateMSBuild _msvs_to_msbuild_converters[tool.msvs_name][msvs_name] = _Translate def _Moved(tool, settings_name, msbuild_tool_name, setting_type): _MovedAndRenamed( tool, settings_name, msbuild_tool_name, settings_name, setting_type ) def _MovedAndRenamed( tool, msvs_settings_name, msbuild_tool_name, msbuild_settings_name, setting_type ): """Defines a setting that may have moved to a new section. Args: tool: a dictionary that gives the names of the tool for MSVS and MSBuild. msvs_settings_name: the MSVS name of the setting. msbuild_tool_name: the name of the MSBuild tool to place the setting under. msbuild_settings_name: the MSBuild name of the setting. setting_type: the type of this setting. """ def _Translate(value, msbuild_settings): tool_settings = msbuild_settings.setdefault(msbuild_tool_name, {}) tool_settings[msbuild_settings_name] = setting_type.ConvertToMSBuild(value) _msvs_validators[tool.msvs_name][msvs_settings_name] = setting_type.ValidateMSVS validator = setting_type.ValidateMSBuild _msbuild_validators[msbuild_tool_name][msbuild_settings_name] = validator _msvs_to_msbuild_converters[tool.msvs_name][msvs_settings_name] = _Translate def _MSVSOnly(tool, name, setting_type): """Defines a setting that is only found in MSVS. Args: tool: a dictionary that gives the names of the tool for MSVS and MSBuild. name: the name of the setting. setting_type: the type of this setting. """ def _Translate(unused_value, unused_msbuild_settings): # Since this is for MSVS only settings, no translation will happen. pass _msvs_validators[tool.msvs_name][name] = setting_type.ValidateMSVS _msvs_to_msbuild_converters[tool.msvs_name][name] = _Translate def _MSBuildOnly(tool, name, setting_type): """Defines a setting that is only found in MSBuild. Args: tool: a dictionary that gives the names of the tool for MSVS and MSBuild. name: the name of the setting. setting_type: the type of this setting. """ def _Translate(value, msbuild_settings): # Let msbuild-only properties get translated as-is from msvs_settings. tool_settings = msbuild_settings.setdefault(tool.msbuild_name, {}) tool_settings[name] = value _msbuild_validators[tool.msbuild_name][name] = setting_type.ValidateMSBuild _msvs_to_msbuild_converters[tool.msvs_name][name] = _Translate def _ConvertedToAdditionalOption(tool, msvs_name, flag): """Defines a setting that's handled via a command line option in MSBuild. Args: tool: a dictionary that gives the names of the tool for MSVS and MSBuild. msvs_name: the name of the MSVS setting that if 'true' becomes a flag flag: the flag to insert at the end of the AdditionalOptions """ def _Translate(value, msbuild_settings): if value == "true": tool_settings = _GetMSBuildToolSettings(msbuild_settings, tool) if "AdditionalOptions" in tool_settings: new_flags = "{} {}".format(tool_settings["AdditionalOptions"], flag) else: new_flags = flag tool_settings["AdditionalOptions"] = new_flags _msvs_validators[tool.msvs_name][msvs_name] = _boolean.ValidateMSVS _msvs_to_msbuild_converters[tool.msvs_name][msvs_name] = _Translate def _CustomGeneratePreprocessedFile(tool, msvs_name): def _Translate(value, msbuild_settings): tool_settings = _GetMSBuildToolSettings(msbuild_settings, tool) if value == "0": tool_settings["PreprocessToFile"] = "false" tool_settings["PreprocessSuppressLineNumbers"] = "false" elif value == "1": # /P tool_settings["PreprocessToFile"] = "true" tool_settings["PreprocessSuppressLineNumbers"] = "false" elif value == "2": # /EP /P tool_settings["PreprocessToFile"] = "true" tool_settings["PreprocessSuppressLineNumbers"] = "true" else: raise ValueError("value must be one of [0, 1, 2]; got %s" % value) # Create a bogus validator that looks for '0', '1', or '2' msvs_validator = _Enumeration(["a", "b", "c"]).ValidateMSVS _msvs_validators[tool.msvs_name][msvs_name] = msvs_validator msbuild_validator = _boolean.ValidateMSBuild msbuild_tool_validators = _msbuild_validators[tool.msbuild_name] msbuild_tool_validators["PreprocessToFile"] = msbuild_validator msbuild_tool_validators["PreprocessSuppressLineNumbers"] = msbuild_validator _msvs_to_msbuild_converters[tool.msvs_name][msvs_name] = _Translate fix_vc_macro_slashes_regex_list = ("IntDir", "OutDir") fix_vc_macro_slashes_regex = re.compile( r"(\$\((?:%s)\))(?:[\\/]+)" % "|".join(fix_vc_macro_slashes_regex_list) ) # Regular expression to detect keys that were generated by exclusion lists _EXCLUDED_SUFFIX_RE = re.compile("^(.*)_excluded$") def _ValidateExclusionSetting(setting, settings, error_msg, stderr=sys.stderr): """Verify that 'setting' is valid if it is generated from an exclusion list. If the setting appears to be generated from an exclusion list, the root name is checked. Args: setting: A string that is the setting name to validate settings: A dictionary where the keys are valid settings error_msg: The message to emit in the event of error stderr: The stream receiving the error messages. """ # This may be unrecognized because it's an exclusion list. If the # setting name has the _excluded suffix, then check the root name. unrecognized = True m = re.match(_EXCLUDED_SUFFIX_RE, setting) if m: root_setting = m.group(1) unrecognized = root_setting not in settings if unrecognized: # We don't know this setting. Give a warning. print(error_msg, file=stderr) def FixVCMacroSlashes(s): """Replace macros which have excessive following slashes. These macros are known to have a built-in trailing slash. Furthermore, many scripts hiccup on processing paths with extra slashes in the middle. This list is probably not exhaustive. Add as needed. """ if "$" in s: s = fix_vc_macro_slashes_regex.sub(r"\1", s) return s def ConvertVCMacrosToMSBuild(s): """Convert the MSVS macros found in the string to the MSBuild equivalent. This list is probably not exhaustive. Add as needed. """ if "$" in s: replace_map = { "$(ConfigurationName)": "$(Configuration)", "$(InputDir)": "%(RelativeDir)", "$(InputExt)": "%(Extension)", "$(InputFileName)": "%(Filename)%(Extension)", "$(InputName)": "%(Filename)", "$(InputPath)": "%(Identity)", "$(ParentName)": "$(ProjectFileName)", "$(PlatformName)": "$(Platform)", "$(SafeInputName)": "%(Filename)", } for old, new in replace_map.items(): s = s.replace(old, new) s = FixVCMacroSlashes(s) return s def ConvertToMSBuildSettings(msvs_settings, stderr=sys.stderr): """Converts MSVS settings (VS2008 and earlier) to MSBuild settings (VS2010+). Args: msvs_settings: A dictionary. The key is the tool name. The values are themselves dictionaries of settings and their values. stderr: The stream receiving the error messages. Returns: A dictionary of MSBuild settings. The key is either the MSBuild tool name or the empty string (for the global settings). The values are themselves dictionaries of settings and their values. """ msbuild_settings = {} for msvs_tool_name, msvs_tool_settings in msvs_settings.items(): if msvs_tool_name in _msvs_to_msbuild_converters: msvs_tool = _msvs_to_msbuild_converters[msvs_tool_name] for msvs_setting, msvs_value in msvs_tool_settings.items(): if msvs_setting in msvs_tool: # Invoke the translation function. try: msvs_tool[msvs_setting](msvs_value, msbuild_settings) except ValueError as e: print( "Warning: while converting %s/%s to MSBuild, " "%s" % (msvs_tool_name, msvs_setting, e), file=stderr, ) else: _ValidateExclusionSetting( msvs_setting, msvs_tool, ( "Warning: unrecognized setting %s/%s " "while converting to MSBuild." % (msvs_tool_name, msvs_setting) ), stderr, ) else: print( "Warning: unrecognized tool %s while converting to " "MSBuild." % msvs_tool_name, file=stderr, ) return msbuild_settings def ValidateMSVSSettings(settings, stderr=sys.stderr): """Validates that the names of the settings are valid for MSVS. Args: settings: A dictionary. The key is the tool name. The values are themselves dictionaries of settings and their values. stderr: The stream receiving the error messages. """ _ValidateSettings(_msvs_validators, settings, stderr) def ValidateMSBuildSettings(settings, stderr=sys.stderr): """Validates that the names of the settings are valid for MSBuild. Args: settings: A dictionary. The key is the tool name. The values are themselves dictionaries of settings and their values. stderr: The stream receiving the error messages. """ _ValidateSettings(_msbuild_validators, settings, stderr) def _ValidateSettings(validators, settings, stderr): """Validates that the settings are valid for MSBuild or MSVS. We currently only validate the names of the settings, not their values. Args: validators: A dictionary of tools and their validators. settings: A dictionary. The key is the tool name. The values are themselves dictionaries of settings and their values. stderr: The stream receiving the error messages. """ for tool_name in settings: if tool_name in validators: tool_validators = validators[tool_name] for setting, value in settings[tool_name].items(): if setting in tool_validators: try: tool_validators[setting](value) except ValueError as e: print( f"Warning: for {tool_name}/{setting}, {e}", file=stderr, ) else: _ValidateExclusionSetting( setting, tool_validators, (f"Warning: unrecognized setting {tool_name}/{setting}"), stderr, ) else: print("Warning: unrecognized tool %s" % (tool_name), file=stderr) # MSVS and MBuild names of the tools. _compile = _Tool("VCCLCompilerTool", "ClCompile") _link = _Tool("VCLinkerTool", "Link") _midl = _Tool("VCMIDLTool", "Midl") _rc = _Tool("VCResourceCompilerTool", "ResourceCompile") _lib = _Tool("VCLibrarianTool", "Lib") _manifest = _Tool("VCManifestTool", "Manifest") _masm = _Tool("MASM", "MASM") _armasm = _Tool("ARMASM", "ARMASM") _AddTool(_compile) _AddTool(_link) _AddTool(_midl) _AddTool(_rc) _AddTool(_lib) _AddTool(_manifest) _AddTool(_masm) _AddTool(_armasm) # Add sections only found in the MSBuild settings. _msbuild_validators[""] = {} _msbuild_validators["ProjectReference"] = {} _msbuild_validators["ManifestResourceCompile"] = {} # Descriptions of the compiler options, i.e. VCCLCompilerTool in MSVS and # ClCompile in MSBuild. # See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\cl.xml" for # the schema of the MSBuild ClCompile settings. # Options that have the same name in MSVS and MSBuild _Same(_compile, "AdditionalIncludeDirectories", _folder_list) # /I _Same(_compile, "AdditionalOptions", _string_list) _Same(_compile, "AdditionalUsingDirectories", _folder_list) # /AI _Same(_compile, "AssemblerListingLocation", _file_name) # /Fa _Same(_compile, "BrowseInformationFile", _file_name) _Same(_compile, "BufferSecurityCheck", _boolean) # /GS _Same(_compile, "DisableLanguageExtensions", _boolean) # /Za _Same(_compile, "DisableSpecificWarnings", _string_list) # /wd _Same(_compile, "EnableFiberSafeOptimizations", _boolean) # /GT _Same(_compile, "EnablePREfast", _boolean) # /analyze Visible='false' _Same(_compile, "ExpandAttributedSource", _boolean) # /Fx _Same(_compile, "FloatingPointExceptions", _boolean) # /fp:except _Same(_compile, "ForceConformanceInForLoopScope", _boolean) # /Zc:forScope _Same(_compile, "ForcedIncludeFiles", _file_list) # /FI _Same(_compile, "ForcedUsingFiles", _file_list) # /FU _Same(_compile, "GenerateXMLDocumentationFiles", _boolean) # /doc _Same(_compile, "IgnoreStandardIncludePath", _boolean) # /X _Same(_compile, "MinimalRebuild", _boolean) # /Gm _Same(_compile, "OmitDefaultLibName", _boolean) # /Zl _Same(_compile, "OmitFramePointers", _boolean) # /Oy _Same(_compile, "PreprocessorDefinitions", _string_list) # /D _Same(_compile, "ProgramDataBaseFileName", _file_name) # /Fd _Same(_compile, "RuntimeTypeInfo", _boolean) # /GR _Same(_compile, "ShowIncludes", _boolean) # /showIncludes _Same(_compile, "SmallerTypeCheck", _boolean) # /RTCc _Same(_compile, "StringPooling", _boolean) # /GF _Same(_compile, "SuppressStartupBanner", _boolean) # /nologo _Same(_compile, "TreatWChar_tAsBuiltInType", _boolean) # /Zc:wchar_t _Same(_compile, "UndefineAllPreprocessorDefinitions", _boolean) # /u _Same(_compile, "UndefinePreprocessorDefinitions", _string_list) # /U _Same(_compile, "UseFullPaths", _boolean) # /FC _Same(_compile, "WholeProgramOptimization", _boolean) # /GL _Same(_compile, "XMLDocumentationFileName", _file_name) _Same(_compile, "CompileAsWinRT", _boolean) # /ZW _Same( _compile, "AssemblerOutput", _Enumeration( [ "NoListing", "AssemblyCode", # /FA "All", # /FAcs "AssemblyAndMachineCode", # /FAc "AssemblyAndSourceCode", ] ), ) # /FAs _Same( _compile, "BasicRuntimeChecks", _Enumeration( [ "Default", "StackFrameRuntimeCheck", # /RTCs "UninitializedLocalUsageCheck", # /RTCu "EnableFastChecks", ] ), ) # /RTC1 _Same( _compile, "BrowseInformation", _Enumeration(["false", "true", "true"]) # /FR ) # /Fr _Same( _compile, "CallingConvention", _Enumeration(["Cdecl", "FastCall", "StdCall", "VectorCall"]), # /Gd # /Gr # /Gz ) # /Gv _Same( _compile, "CompileAs", _Enumeration(["Default", "CompileAsC", "CompileAsCpp"]), # /TC ) # /TP _Same( _compile, "DebugInformationFormat", _Enumeration( [ "", # Disabled "OldStyle", # /Z7 None, "ProgramDatabase", # /Zi "EditAndContinue", ] ), ) # /ZI _Same( _compile, "EnableEnhancedInstructionSet", _Enumeration( [ "NotSet", "StreamingSIMDExtensions", # /arch:SSE "StreamingSIMDExtensions2", # /arch:SSE2 "AdvancedVectorExtensions", # /arch:AVX (vs2012+) "NoExtensions", # /arch:IA32 (vs2012+) # This one only exists in the new msbuild format. "AdvancedVectorExtensions2", # /arch:AVX2 (vs2013r2+) ] ), ) _Same( _compile, "ErrorReporting", _Enumeration( [ "None", # /errorReport:none "Prompt", # /errorReport:prompt "Queue", ], # /errorReport:queue new=["Send"], ), ) # /errorReport:send" _Same( _compile, "ExceptionHandling", _Enumeration(["false", "Sync", "Async"], new=["SyncCThrow"]), # /EHsc # /EHa ) # /EHs _Same( _compile, "FavorSizeOrSpeed", _Enumeration(["Neither", "Speed", "Size"]) # /Ot ) # /Os _Same( _compile, "FloatingPointModel", _Enumeration(["Precise", "Strict", "Fast"]), # /fp:precise # /fp:strict ) # /fp:fast _Same( _compile, "InlineFunctionExpansion", _Enumeration( ["Default", "OnlyExplicitInline", "AnySuitable"], # /Ob1 # /Ob2 new=["Disabled"], ), ) # /Ob0 _Same( _compile, "Optimization", _Enumeration(["Disabled", "MinSpace", "MaxSpeed", "Full"]), # /Od # /O1 # /O2 ) # /Ox _Same( _compile, "RuntimeLibrary", _Enumeration( [ "MultiThreaded", # /MT "MultiThreadedDebug", # /MTd "MultiThreadedDLL", # /MD "MultiThreadedDebugDLL", ] ), ) # /MDd _Same( _compile, "StructMemberAlignment", _Enumeration( [ "Default", "1Byte", # /Zp1 "2Bytes", # /Zp2 "4Bytes", # /Zp4 "8Bytes", # /Zp8 "16Bytes", ] ), ) # /Zp16 _Same( _compile, "WarningLevel", _Enumeration( [ "TurnOffAllWarnings", # /W0 "Level1", # /W1 "Level2", # /W2 "Level3", # /W3 "Level4", ], # /W4 new=["EnableAllWarnings"], ), ) # /Wall # Options found in MSVS that have been renamed in MSBuild. _Renamed( _compile, "EnableFunctionLevelLinking", "FunctionLevelLinking", _boolean ) # /Gy _Renamed(_compile, "EnableIntrinsicFunctions", "IntrinsicFunctions", _boolean) # /Oi _Renamed(_compile, "KeepComments", "PreprocessKeepComments", _boolean) # /C _Renamed(_compile, "ObjectFile", "ObjectFileName", _file_name) # /Fo _Renamed(_compile, "OpenMP", "OpenMPSupport", _boolean) # /openmp _Renamed( _compile, "PrecompiledHeaderThrough", "PrecompiledHeaderFile", _file_name ) # Used with /Yc and /Yu _Renamed( _compile, "PrecompiledHeaderFile", "PrecompiledHeaderOutputFile", _file_name ) # /Fp _Renamed( _compile, "UsePrecompiledHeader", "PrecompiledHeader", _Enumeration( ["NotUsing", "Create", "Use"] # VS recognized '' for this value too. # /Yc ), ) # /Yu _Renamed(_compile, "WarnAsError", "TreatWarningAsError", _boolean) # /WX _ConvertedToAdditionalOption(_compile, "DefaultCharIsUnsigned", "/J") # MSVS options not found in MSBuild. _MSVSOnly(_compile, "Detect64BitPortabilityProblems", _boolean) _MSVSOnly(_compile, "UseUnicodeResponseFiles", _boolean) # MSBuild options not found in MSVS. _MSBuildOnly(_compile, "BuildingInIDE", _boolean) _MSBuildOnly( _compile, "CompileAsManaged", _Enumeration([], new=["false", "true"]) ) # /clr _MSBuildOnly(_compile, "CreateHotpatchableImage", _boolean) # /hotpatch _MSBuildOnly(_compile, "MultiProcessorCompilation", _boolean) # /MP _MSBuildOnly(_compile, "PreprocessOutputPath", _string) # /Fi _MSBuildOnly(_compile, "ProcessorNumber", _integer) # the number of processors _MSBuildOnly(_compile, "TrackerLogDirectory", _folder_name) _MSBuildOnly(_compile, "TreatSpecificWarningsAsErrors", _string_list) # /we _MSBuildOnly(_compile, "UseUnicodeForAssemblerListing", _boolean) # /FAu # Defines a setting that needs very customized processing _CustomGeneratePreprocessedFile(_compile, "GeneratePreprocessedFile") # Directives for converting MSVS VCLinkerTool to MSBuild Link. # See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\link.xml" for # the schema of the MSBuild Link settings. # Options that have the same name in MSVS and MSBuild _Same(_link, "AdditionalDependencies", _file_list) _Same(_link, "AdditionalLibraryDirectories", _folder_list) # /LIBPATH # /MANIFESTDEPENDENCY: _Same(_link, "AdditionalManifestDependencies", _file_list) _Same(_link, "AdditionalOptions", _string_list) _Same(_link, "AddModuleNamesToAssembly", _file_list) # /ASSEMBLYMODULE _Same(_link, "AllowIsolation", _boolean) # /ALLOWISOLATION _Same(_link, "AssemblyLinkResource", _file_list) # /ASSEMBLYLINKRESOURCE _Same(_link, "BaseAddress", _string) # /BASE _Same(_link, "CLRUnmanagedCodeCheck", _boolean) # /CLRUNMANAGEDCODECHECK _Same(_link, "DelayLoadDLLs", _file_list) # /DELAYLOAD _Same(_link, "DelaySign", _boolean) # /DELAYSIGN _Same(_link, "EmbedManagedResourceFile", _file_list) # /ASSEMBLYRESOURCE _Same(_link, "EnableUAC", _boolean) # /MANIFESTUAC _Same(_link, "EntryPointSymbol", _string) # /ENTRY _Same(_link, "ForceSymbolReferences", _file_list) # /INCLUDE _Same(_link, "FunctionOrder", _file_name) # /ORDER _Same(_link, "GenerateDebugInformation", _boolean) # /DEBUG _Same(_link, "GenerateMapFile", _boolean) # /MAP _Same(_link, "HeapCommitSize", _string) _Same(_link, "HeapReserveSize", _string) # /HEAP _Same(_link, "IgnoreAllDefaultLibraries", _boolean) # /NODEFAULTLIB _Same(_link, "IgnoreEmbeddedIDL", _boolean) # /IGNOREIDL _Same(_link, "ImportLibrary", _file_name) # /IMPLIB _Same(_link, "KeyContainer", _file_name) # /KEYCONTAINER _Same(_link, "KeyFile", _file_name) # /KEYFILE _Same(_link, "ManifestFile", _file_name) # /ManifestFile _Same(_link, "MapExports", _boolean) # /MAPINFO:EXPORTS _Same(_link, "MapFileName", _file_name) _Same(_link, "MergedIDLBaseFileName", _file_name) # /IDLOUT _Same(_link, "MergeSections", _string) # /MERGE _Same(_link, "MidlCommandFile", _file_name) # /MIDL _Same(_link, "ModuleDefinitionFile", _file_name) # /DEF _Same(_link, "OutputFile", _file_name) # /OUT _Same(_link, "PerUserRedirection", _boolean) _Same(_link, "Profile", _boolean) # /PROFILE _Same(_link, "ProfileGuidedDatabase", _file_name) # /PGD _Same(_link, "ProgramDatabaseFile", _file_name) # /PDB _Same(_link, "RegisterOutput", _boolean) _Same(_link, "SetChecksum", _boolean) # /RELEASE _Same(_link, "StackCommitSize", _string) _Same(_link, "StackReserveSize", _string) # /STACK _Same(_link, "StripPrivateSymbols", _file_name) # /PDBSTRIPPED _Same(_link, "SupportUnloadOfDelayLoadedDLL", _boolean) # /DELAY:UNLOAD _Same(_link, "SuppressStartupBanner", _boolean) # /NOLOGO _Same(_link, "SwapRunFromCD", _boolean) # /SWAPRUN:CD _Same(_link, "TurnOffAssemblyGeneration", _boolean) # /NOASSEMBLY _Same(_link, "TypeLibraryFile", _file_name) # /TLBOUT _Same(_link, "TypeLibraryResourceID", _integer) # /TLBID _Same(_link, "UACUIAccess", _boolean) # /uiAccess='true' _Same(_link, "Version", _string) # /VERSION _Same(_link, "EnableCOMDATFolding", _newly_boolean) # /OPT:ICF _Same(_link, "FixedBaseAddress", _newly_boolean) # /FIXED _Same(_link, "LargeAddressAware", _newly_boolean) # /LARGEADDRESSAWARE _Same(_link, "OptimizeReferences", _newly_boolean) # /OPT:REF _Same(_link, "RandomizedBaseAddress", _newly_boolean) # /DYNAMICBASE _Same(_link, "TerminalServerAware", _newly_boolean) # /TSAWARE _subsystem_enumeration = _Enumeration( [ "NotSet", "Console", # /SUBSYSTEM:CONSOLE "Windows", # /SUBSYSTEM:WINDOWS "Native", # /SUBSYSTEM:NATIVE "EFI Application", # /SUBSYSTEM:EFI_APPLICATION "EFI Boot Service Driver", # /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER "EFI ROM", # /SUBSYSTEM:EFI_ROM "EFI Runtime", # /SUBSYSTEM:EFI_RUNTIME_DRIVER "WindowsCE", ], # /SUBSYSTEM:WINDOWSCE new=["POSIX"], ) # /SUBSYSTEM:POSIX _target_machine_enumeration = _Enumeration( [ "NotSet", "MachineX86", # /MACHINE:X86 None, "MachineARM", # /MACHINE:ARM "MachineEBC", # /MACHINE:EBC "MachineIA64", # /MACHINE:IA64 None, "MachineMIPS", # /MACHINE:MIPS "MachineMIPS16", # /MACHINE:MIPS16 "MachineMIPSFPU", # /MACHINE:MIPSFPU "MachineMIPSFPU16", # /MACHINE:MIPSFPU16 None, None, None, "MachineSH4", # /MACHINE:SH4 None, "MachineTHUMB", # /MACHINE:THUMB "MachineX64", ] ) # /MACHINE:X64 _Same( _link, "AssemblyDebug", _Enumeration(["", "true", "false"]) # /ASSEMBLYDEBUG ) # /ASSEMBLYDEBUG:DISABLE _Same( _link, "CLRImageType", _Enumeration( [ "Default", "ForceIJWImage", # /CLRIMAGETYPE:IJW "ForcePureILImage", # /Switch="CLRIMAGETYPE:PURE "ForceSafeILImage", ] ), ) # /Switch="CLRIMAGETYPE:SAFE _Same( _link, "CLRThreadAttribute", _Enumeration( [ "DefaultThreadingAttribute", # /CLRTHREADATTRIBUTE:NONE "MTAThreadingAttribute", # /CLRTHREADATTRIBUTE:MTA "STAThreadingAttribute", ] ), ) # /CLRTHREADATTRIBUTE:STA _Same( _link, "DataExecutionPrevention", _Enumeration(["", "false", "true"]), # /NXCOMPAT:NO ) # /NXCOMPAT _Same( _link, "Driver", _Enumeration(["NotSet", "Driver", "UpOnly", "WDM"]), # /Driver # /DRIVER:UPONLY ) # /DRIVER:WDM _Same( _link, "LinkTimeCodeGeneration", _Enumeration( [ "Default", "UseLinkTimeCodeGeneration", # /LTCG "PGInstrument", # /LTCG:PGInstrument "PGOptimization", # /LTCG:PGOptimize "PGUpdate", ] ), ) # /LTCG:PGUpdate _Same( _link, "ShowProgress", _Enumeration( ["NotSet", "LinkVerbose", "LinkVerboseLib"], # /VERBOSE # /VERBOSE:Lib new=[ "LinkVerboseICF", # /VERBOSE:ICF "LinkVerboseREF", # /VERBOSE:REF "LinkVerboseSAFESEH", # /VERBOSE:SAFESEH "LinkVerboseCLR", ], ), ) # /VERBOSE:CLR _Same(_link, "SubSystem", _subsystem_enumeration) _Same(_link, "TargetMachine", _target_machine_enumeration) _Same( _link, "UACExecutionLevel", _Enumeration( [ "AsInvoker", # /level='asInvoker' "HighestAvailable", # /level='highestAvailable' "RequireAdministrator", ] ), ) # /level='requireAdministrator' _Same(_link, "MinimumRequiredVersion", _string) _Same(_link, "TreatLinkerWarningAsErrors", _boolean) # /WX # Options found in MSVS that have been renamed in MSBuild. _Renamed( _link, "ErrorReporting", "LinkErrorReporting", _Enumeration( [ "NoErrorReport", # /ERRORREPORT:NONE "PromptImmediately", # /ERRORREPORT:PROMPT "QueueForNextLogin", ], # /ERRORREPORT:QUEUE new=["SendErrorReport"], ), ) # /ERRORREPORT:SEND _Renamed( _link, "IgnoreDefaultLibraryNames", "IgnoreSpecificDefaultLibraries", _file_list ) # /NODEFAULTLIB _Renamed(_link, "ResourceOnlyDLL", "NoEntryPoint", _boolean) # /NOENTRY _Renamed(_link, "SwapRunFromNet", "SwapRunFromNET", _boolean) # /SWAPRUN:NET _Moved(_link, "GenerateManifest", "", _boolean) _Moved(_link, "IgnoreImportLibrary", "", _boolean) _Moved(_link, "LinkIncremental", "", _newly_boolean) _Moved(_link, "LinkLibraryDependencies", "ProjectReference", _boolean) _Moved(_link, "UseLibraryDependencyInputs", "ProjectReference", _boolean) # MSVS options not found in MSBuild. _MSVSOnly(_link, "OptimizeForWindows98", _newly_boolean) _MSVSOnly(_link, "UseUnicodeResponseFiles", _boolean) # MSBuild options not found in MSVS. _MSBuildOnly(_link, "BuildingInIDE", _boolean) _MSBuildOnly(_link, "ImageHasSafeExceptionHandlers", _boolean) # /SAFESEH _MSBuildOnly(_link, "LinkDLL", _boolean) # /DLL Visible='false' _MSBuildOnly(_link, "LinkStatus", _boolean) # /LTCG:STATUS _MSBuildOnly(_link, "PreventDllBinding", _boolean) # /ALLOWBIND _MSBuildOnly(_link, "SupportNobindOfDelayLoadedDLL", _boolean) # /DELAY:NOBIND _MSBuildOnly(_link, "TrackerLogDirectory", _folder_name) _MSBuildOnly(_link, "MSDOSStubFileName", _file_name) # /STUB Visible='false' _MSBuildOnly(_link, "SectionAlignment", _integer) # /ALIGN _MSBuildOnly(_link, "SpecifySectionAttributes", _string) # /SECTION _MSBuildOnly( _link, "ForceFileOutput", _Enumeration( [], new=[ "Enabled", # /FORCE # /FORCE:MULTIPLE "MultiplyDefinedSymbolOnly", "UndefinedSymbolOnly", ], ), ) # /FORCE:UNRESOLVED _MSBuildOnly( _link, "CreateHotPatchableImage", _Enumeration( [], new=[ "Enabled", # /FUNCTIONPADMIN "X86Image", # /FUNCTIONPADMIN:5 "X64Image", # /FUNCTIONPADMIN:6 "ItaniumImage", ], ), ) # /FUNCTIONPADMIN:16 _MSBuildOnly( _link, "CLRSupportLastError", _Enumeration( [], new=[ "Enabled", # /CLRSupportLastError "Disabled", # /CLRSupportLastError:NO # /CLRSupportLastError:SYSTEMDLL "SystemDlls", ], ), ) # Directives for converting VCResourceCompilerTool to ResourceCompile. # See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\rc.xml" for # the schema of the MSBuild ResourceCompile settings. _Same(_rc, "AdditionalOptions", _string_list) _Same(_rc, "AdditionalIncludeDirectories", _folder_list) # /I _Same(_rc, "Culture", _Integer(msbuild_base=16)) _Same(_rc, "IgnoreStandardIncludePath", _boolean) # /X _Same(_rc, "PreprocessorDefinitions", _string_list) # /D _Same(_rc, "ResourceOutputFileName", _string) # /fo _Same(_rc, "ShowProgress", _boolean) # /v # There is no UI in VisualStudio 2008 to set the following properties. # However they are found in CL and other tools. Include them here for # completeness, as they are very likely to have the same usage pattern. _Same(_rc, "SuppressStartupBanner", _boolean) # /nologo _Same(_rc, "UndefinePreprocessorDefinitions", _string_list) # /u # MSBuild options not found in MSVS. _MSBuildOnly(_rc, "NullTerminateStrings", _boolean) # /n _MSBuildOnly(_rc, "TrackerLogDirectory", _folder_name) # Directives for converting VCMIDLTool to Midl. # See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\midl.xml" for # the schema of the MSBuild Midl settings. _Same(_midl, "AdditionalIncludeDirectories", _folder_list) # /I _Same(_midl, "AdditionalOptions", _string_list) _Same(_midl, "CPreprocessOptions", _string) # /cpp_opt _Same(_midl, "ErrorCheckAllocations", _boolean) # /error allocation _Same(_midl, "ErrorCheckBounds", _boolean) # /error bounds_check _Same(_midl, "ErrorCheckEnumRange", _boolean) # /error enum _Same(_midl, "ErrorCheckRefPointers", _boolean) # /error ref _Same(_midl, "ErrorCheckStubData", _boolean) # /error stub_data _Same(_midl, "GenerateStublessProxies", _boolean) # /Oicf _Same(_midl, "GenerateTypeLibrary", _boolean) _Same(_midl, "HeaderFileName", _file_name) # /h _Same(_midl, "IgnoreStandardIncludePath", _boolean) # /no_def_idir _Same(_midl, "InterfaceIdentifierFileName", _file_name) # /iid _Same(_midl, "MkTypLibCompatible", _boolean) # /mktyplib203 _Same(_midl, "OutputDirectory", _string) # /out _Same(_midl, "PreprocessorDefinitions", _string_list) # /D _Same(_midl, "ProxyFileName", _file_name) # /proxy _Same(_midl, "RedirectOutputAndErrors", _file_name) # /o _Same(_midl, "SuppressStartupBanner", _boolean) # /nologo _Same(_midl, "TypeLibraryName", _file_name) # /tlb _Same(_midl, "UndefinePreprocessorDefinitions", _string_list) # /U _Same(_midl, "WarnAsError", _boolean) # /WX _Same( _midl, "DefaultCharType", _Enumeration(["Unsigned", "Signed", "Ascii"]), # /char unsigned # /char signed ) # /char ascii7 _Same( _midl, "TargetEnvironment", _Enumeration( [ "NotSet", "Win32", # /env win32 "Itanium", # /env ia64 "X64", # /env x64 "ARM64", # /env arm64 ] ), ) _Same( _midl, "EnableErrorChecks", _Enumeration(["EnableCustom", "None", "All"]), # /error none ) # /error all _Same( _midl, "StructMemberAlignment", _Enumeration(["NotSet", "1", "2", "4", "8"]), # Zp1 # Zp2 # Zp4 ) # Zp8 _Same( _midl, "WarningLevel", _Enumeration(["0", "1", "2", "3", "4"]), # /W0 # /W1 # /W2 # /W3 ) # /W4 _Renamed(_midl, "DLLDataFileName", "DllDataFileName", _file_name) # /dlldata _Renamed(_midl, "ValidateParameters", "ValidateAllParameters", _boolean) # /robust # MSBuild options not found in MSVS. _MSBuildOnly(_midl, "ApplicationConfigurationMode", _boolean) # /app_config _MSBuildOnly(_midl, "ClientStubFile", _file_name) # /cstub _MSBuildOnly( _midl, "GenerateClientFiles", _Enumeration([], new=["Stub", "None"]) # /client stub ) # /client none _MSBuildOnly( _midl, "GenerateServerFiles", _Enumeration([], new=["Stub", "None"]) # /client stub ) # /client none _MSBuildOnly(_midl, "LocaleID", _integer) # /lcid DECIMAL _MSBuildOnly(_midl, "ServerStubFile", _file_name) # /sstub _MSBuildOnly(_midl, "SuppressCompilerWarnings", _boolean) # /no_warn _MSBuildOnly(_midl, "TrackerLogDirectory", _folder_name) _MSBuildOnly( _midl, "TypeLibFormat", _Enumeration([], new=["NewFormat", "OldFormat"]) # /newtlb ) # /oldtlb # Directives for converting VCLibrarianTool to Lib. # See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\lib.xml" for # the schema of the MSBuild Lib settings. _Same(_lib, "AdditionalDependencies", _file_list) _Same(_lib, "AdditionalLibraryDirectories", _folder_list) # /LIBPATH _Same(_lib, "AdditionalOptions", _string_list) _Same(_lib, "ExportNamedFunctions", _string_list) # /EXPORT _Same(_lib, "ForceSymbolReferences", _string) # /INCLUDE _Same(_lib, "IgnoreAllDefaultLibraries", _boolean) # /NODEFAULTLIB _Same(_lib, "IgnoreSpecificDefaultLibraries", _file_list) # /NODEFAULTLIB _Same(_lib, "ModuleDefinitionFile", _file_name) # /DEF _Same(_lib, "OutputFile", _file_name) # /OUT _Same(_lib, "SuppressStartupBanner", _boolean) # /NOLOGO _Same(_lib, "UseUnicodeResponseFiles", _boolean) _Same(_lib, "LinkTimeCodeGeneration", _boolean) # /LTCG _Same(_lib, "TargetMachine", _target_machine_enumeration) # TODO(jeanluc) _link defines the same value that gets moved to # ProjectReference. We may want to validate that they are consistent. _Moved(_lib, "LinkLibraryDependencies", "ProjectReference", _boolean) _MSBuildOnly(_lib, "DisplayLibrary", _string) # /LIST Visible='false' _MSBuildOnly( _lib, "ErrorReporting", _Enumeration( [], new=[ "PromptImmediately", # /ERRORREPORT:PROMPT "QueueForNextLogin", # /ERRORREPORT:QUEUE "SendErrorReport", # /ERRORREPORT:SEND "NoErrorReport", ], ), ) # /ERRORREPORT:NONE _MSBuildOnly(_lib, "MinimumRequiredVersion", _string) _MSBuildOnly(_lib, "Name", _file_name) # /NAME _MSBuildOnly(_lib, "RemoveObjects", _file_list) # /REMOVE _MSBuildOnly(_lib, "SubSystem", _subsystem_enumeration) _MSBuildOnly(_lib, "TrackerLogDirectory", _folder_name) _MSBuildOnly(_lib, "TreatLibWarningAsErrors", _boolean) # /WX _MSBuildOnly(_lib, "Verbose", _boolean) # Directives for converting VCManifestTool to Mt. # See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\mt.xml" for # the schema of the MSBuild Lib settings. # Options that have the same name in MSVS and MSBuild _Same(_manifest, "AdditionalManifestFiles", _file_list) # /manifest _Same(_manifest, "AdditionalOptions", _string_list) _Same(_manifest, "AssemblyIdentity", _string) # /identity: _Same(_manifest, "ComponentFileName", _file_name) # /dll _Same(_manifest, "GenerateCatalogFiles", _boolean) # /makecdfs _Same(_manifest, "InputResourceManifests", _string) # /inputresource _Same(_manifest, "OutputManifestFile", _file_name) # /out _Same(_manifest, "RegistrarScriptFile", _file_name) # /rgs _Same(_manifest, "ReplacementsFile", _file_name) # /replacements _Same(_manifest, "SuppressStartupBanner", _boolean) # /nologo _Same(_manifest, "TypeLibraryFile", _file_name) # /tlb: _Same(_manifest, "UpdateFileHashes", _boolean) # /hashupdate _Same(_manifest, "UpdateFileHashesSearchPath", _file_name) _Same(_manifest, "VerboseOutput", _boolean) # /verbose # Options that have moved location. _MovedAndRenamed( _manifest, "ManifestResourceFile", "ManifestResourceCompile", "ResourceOutputFileName", _file_name, ) _Moved(_manifest, "EmbedManifest", "", _boolean) # MSVS options not found in MSBuild. _MSVSOnly(_manifest, "DependencyInformationFile", _file_name) _MSVSOnly(_manifest, "UseFAT32Workaround", _boolean) _MSVSOnly(_manifest, "UseUnicodeResponseFiles", _boolean) # MSBuild options not found in MSVS. _MSBuildOnly(_manifest, "EnableDPIAwareness", _boolean) _MSBuildOnly(_manifest, "GenerateCategoryTags", _boolean) # /category _MSBuildOnly( _manifest, "ManifestFromManagedAssembly", _file_name ) # /managedassemblyname _MSBuildOnly(_manifest, "OutputResourceManifests", _string) # /outputresource _MSBuildOnly(_manifest, "SuppressDependencyElement", _boolean) # /nodependency _MSBuildOnly(_manifest, "TrackerLogDirectory", _folder_name) # Directives for MASM. # See "$(VCTargetsPath)\BuildCustomizations\masm.xml" for the schema of the # MSBuild MASM settings. # Options that have the same name in MSVS and MSBuild. _Same(_masm, "UseSafeExceptionHandlers", _boolean) # /safeseh #!/usr/bin/env python3 # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unit tests for the MSVSSettings.py file.""" import unittest import gyp.MSVSSettings as MSVSSettings from io import StringIO class TestSequenceFunctions(unittest.TestCase): def setUp(self): self.stderr = StringIO() def _ExpectedWarnings(self, expected): """Compares recorded lines to expected warnings.""" self.stderr.seek(0) actual = self.stderr.read().split("\n") actual = [line for line in actual if line] self.assertEqual(sorted(expected), sorted(actual)) def testValidateMSVSSettings_tool_names(self): """Tests that only MSVS tool names are allowed.""" MSVSSettings.ValidateMSVSSettings( { "VCCLCompilerTool": {}, "VCLinkerTool": {}, "VCMIDLTool": {}, "foo": {}, "VCResourceCompilerTool": {}, "VCLibrarianTool": {}, "VCManifestTool": {}, "ClCompile": {}, }, self.stderr, ) self._ExpectedWarnings( ["Warning: unrecognized tool foo", "Warning: unrecognized tool ClCompile"] ) def testValidateMSVSSettings_settings(self): """Tests that for invalid MSVS settings.""" MSVSSettings.ValidateMSVSSettings( { "VCCLCompilerTool": { "AdditionalIncludeDirectories": "folder1;folder2", "AdditionalOptions": ["string1", "string2"], "AdditionalUsingDirectories": "folder1;folder2", "AssemblerListingLocation": "a_file_name", "AssemblerOutput": "0", "BasicRuntimeChecks": "5", "BrowseInformation": "fdkslj", "BrowseInformationFile": "a_file_name", "BufferSecurityCheck": "true", "CallingConvention": "-1", "CompileAs": "1", "DebugInformationFormat": "2", "DefaultCharIsUnsigned": "true", "Detect64BitPortabilityProblems": "true", "DisableLanguageExtensions": "true", "DisableSpecificWarnings": "string1;string2", "EnableEnhancedInstructionSet": "1", "EnableFiberSafeOptimizations": "true", "EnableFunctionLevelLinking": "true", "EnableIntrinsicFunctions": "true", "EnablePREfast": "true", "Enableprefast": "bogus", "ErrorReporting": "1", "ExceptionHandling": "1", "ExpandAttributedSource": "true", "FavorSizeOrSpeed": "1", "FloatingPointExceptions": "true", "FloatingPointModel": "1", "ForceConformanceInForLoopScope": "true", "ForcedIncludeFiles": "file1;file2", "ForcedUsingFiles": "file1;file2", "GeneratePreprocessedFile": "1", "GenerateXMLDocumentationFiles": "true", "IgnoreStandardIncludePath": "true", "InlineFunctionExpansion": "1", "KeepComments": "true", "MinimalRebuild": "true", "ObjectFile": "a_file_name", "OmitDefaultLibName": "true", "OmitFramePointers": "true", "OpenMP": "true", "Optimization": "1", "PrecompiledHeaderFile": "a_file_name", "PrecompiledHeaderThrough": "a_file_name", "PreprocessorDefinitions": "string1;string2", "ProgramDataBaseFileName": "a_file_name", "RuntimeLibrary": "1", "RuntimeTypeInfo": "true", "ShowIncludes": "true", "SmallerTypeCheck": "true", "StringPooling": "true", "StructMemberAlignment": "1", "SuppressStartupBanner": "true", "TreatWChar_tAsBuiltInType": "true", "UndefineAllPreprocessorDefinitions": "true", "UndefinePreprocessorDefinitions": "string1;string2", "UseFullPaths": "true", "UsePrecompiledHeader": "1", "UseUnicodeResponseFiles": "true", "WarnAsError": "true", "WarningLevel": "1", "WholeProgramOptimization": "true", "XMLDocumentationFileName": "a_file_name", "ZZXYZ": "bogus", }, "VCLinkerTool": { "AdditionalDependencies": "file1;file2", "AdditionalDependencies_excluded": "file3", "AdditionalLibraryDirectories": "folder1;folder2", "AdditionalManifestDependencies": "file1;file2", "AdditionalOptions": "a string1", "AddModuleNamesToAssembly": "file1;file2", "AllowIsolation": "true", "AssemblyDebug": "2", "AssemblyLinkResource": "file1;file2", "BaseAddress": "a string1", "CLRImageType": "2", "CLRThreadAttribute": "2", "CLRUnmanagedCodeCheck": "true", "DataExecutionPrevention": "2", "DelayLoadDLLs": "file1;file2", "DelaySign": "true", "Driver": "2", "EmbedManagedResourceFile": "file1;file2", "EnableCOMDATFolding": "2", "EnableUAC": "true", "EntryPointSymbol": "a string1", "ErrorReporting": "2", "FixedBaseAddress": "2", "ForceSymbolReferences": "file1;file2", "FunctionOrder": "a_file_name", "GenerateDebugInformation": "true", "GenerateManifest": "true", "GenerateMapFile": "true", "HeapCommitSize": "a string1", "HeapReserveSize": "a string1", "IgnoreAllDefaultLibraries": "true", "IgnoreDefaultLibraryNames": "file1;file2", "IgnoreEmbeddedIDL": "true", "IgnoreImportLibrary": "true", "ImportLibrary": "a_file_name", "KeyContainer": "a_file_name", "KeyFile": "a_file_name", "LargeAddressAware": "2", "LinkIncremental": "2", "LinkLibraryDependencies": "true", "LinkTimeCodeGeneration": "2", "ManifestFile": "a_file_name", "MapExports": "true", "MapFileName": "a_file_name", "MergedIDLBaseFileName": "a_file_name", "MergeSections": "a string1", "MidlCommandFile": "a_file_name", "ModuleDefinitionFile": "a_file_name", "OptimizeForWindows98": "1", "OptimizeReferences": "2", "OutputFile": "a_file_name", "PerUserRedirection": "true", "Profile": "true", "ProfileGuidedDatabase": "a_file_name", "ProgramDatabaseFile": "a_file_name", "RandomizedBaseAddress": "2", "RegisterOutput": "true", "ResourceOnlyDLL": "true", "SetChecksum": "true", "ShowProgress": "2", "StackCommitSize": "a string1", "StackReserveSize": "a string1", "StripPrivateSymbols": "a_file_name", "SubSystem": "2", "SupportUnloadOfDelayLoadedDLL": "true", "SuppressStartupBanner": "true", "SwapRunFromCD": "true", "SwapRunFromNet": "true", "TargetMachine": "2", "TerminalServerAware": "2", "TurnOffAssemblyGeneration": "true", "TypeLibraryFile": "a_file_name", "TypeLibraryResourceID": "33", "UACExecutionLevel": "2", "UACUIAccess": "true", "UseLibraryDependencyInputs": "true", "UseUnicodeResponseFiles": "true", "Version": "a string1", }, "VCMIDLTool": { "AdditionalIncludeDirectories": "folder1;folder2", "AdditionalOptions": "a string1", "CPreprocessOptions": "a string1", "DefaultCharType": "1", "DLLDataFileName": "a_file_name", "EnableErrorChecks": "1", "ErrorCheckAllocations": "true", "ErrorCheckBounds": "true", "ErrorCheckEnumRange": "true", "ErrorCheckRefPointers": "true", "ErrorCheckStubData": "true", "GenerateStublessProxies": "true", "GenerateTypeLibrary": "true", "HeaderFileName": "a_file_name", "IgnoreStandardIncludePath": "true", "InterfaceIdentifierFileName": "a_file_name", "MkTypLibCompatible": "true", "notgood": "bogus", "OutputDirectory": "a string1", "PreprocessorDefinitions": "string1;string2", "ProxyFileName": "a_file_name", "RedirectOutputAndErrors": "a_file_name", "StructMemberAlignment": "1", "SuppressStartupBanner": "true", "TargetEnvironment": "1", "TypeLibraryName": "a_file_name", "UndefinePreprocessorDefinitions": "string1;string2", "ValidateParameters": "true", "WarnAsError": "true", "WarningLevel": "1", }, "VCResourceCompilerTool": { "AdditionalOptions": "a string1", "AdditionalIncludeDirectories": "folder1;folder2", "Culture": "1003", "IgnoreStandardIncludePath": "true", "notgood2": "bogus", "PreprocessorDefinitions": "string1;string2", "ResourceOutputFileName": "a string1", "ShowProgress": "true", "SuppressStartupBanner": "true", "UndefinePreprocessorDefinitions": "string1;string2", }, "VCLibrarianTool": { "AdditionalDependencies": "file1;file2", "AdditionalLibraryDirectories": "folder1;folder2", "AdditionalOptions": "a string1", "ExportNamedFunctions": "string1;string2", "ForceSymbolReferences": "a string1", "IgnoreAllDefaultLibraries": "true", "IgnoreSpecificDefaultLibraries": "file1;file2", "LinkLibraryDependencies": "true", "ModuleDefinitionFile": "a_file_name", "OutputFile": "a_file_name", "SuppressStartupBanner": "true", "UseUnicodeResponseFiles": "true", }, "VCManifestTool": { "AdditionalManifestFiles": "file1;file2", "AdditionalOptions": "a string1", "AssemblyIdentity": "a string1", "ComponentFileName": "a_file_name", "DependencyInformationFile": "a_file_name", "GenerateCatalogFiles": "true", "InputResourceManifests": "a string1", "ManifestResourceFile": "a_file_name", "OutputManifestFile": "a_file_name", "RegistrarScriptFile": "a_file_name", "ReplacementsFile": "a_file_name", "SuppressStartupBanner": "true", "TypeLibraryFile": "a_file_name", "UpdateFileHashes": "truel", "UpdateFileHashesSearchPath": "a_file_name", "UseFAT32Workaround": "true", "UseUnicodeResponseFiles": "true", "VerboseOutput": "true", }, }, self.stderr, ) self._ExpectedWarnings( [ "Warning: for VCCLCompilerTool/BasicRuntimeChecks, " "index value (5) not in expected range [0, 4)", "Warning: for VCCLCompilerTool/BrowseInformation, " "invalid literal for int() with base 10: 'fdkslj'", "Warning: for VCCLCompilerTool/CallingConvention, " "index value (-1) not in expected range [0, 4)", "Warning: for VCCLCompilerTool/DebugInformationFormat, " "converted value for 2 not specified.", "Warning: unrecognized setting VCCLCompilerTool/Enableprefast", "Warning: unrecognized setting VCCLCompilerTool/ZZXYZ", "Warning: for VCLinkerTool/TargetMachine, " "converted value for 2 not specified.", "Warning: unrecognized setting VCMIDLTool/notgood", "Warning: unrecognized setting VCResourceCompilerTool/notgood2", "Warning: for VCManifestTool/UpdateFileHashes, " "expected bool; got 'truel'" "", ] ) def testValidateMSBuildSettings_settings(self): """Tests that for invalid MSBuild settings.""" MSVSSettings.ValidateMSBuildSettings( { "ClCompile": { "AdditionalIncludeDirectories": "folder1;folder2", "AdditionalOptions": ["string1", "string2"], "AdditionalUsingDirectories": "folder1;folder2", "AssemblerListingLocation": "a_file_name", "AssemblerOutput": "NoListing", "BasicRuntimeChecks": "StackFrameRuntimeCheck", "BrowseInformation": "false", "BrowseInformationFile": "a_file_name", "BufferSecurityCheck": "true", "BuildingInIDE": "true", "CallingConvention": "Cdecl", "CompileAs": "CompileAsC", "CompileAsManaged": "true", "CreateHotpatchableImage": "true", "DebugInformationFormat": "ProgramDatabase", "DisableLanguageExtensions": "true", "DisableSpecificWarnings": "string1;string2", "EnableEnhancedInstructionSet": "StreamingSIMDExtensions", "EnableFiberSafeOptimizations": "true", "EnablePREfast": "true", "Enableprefast": "bogus", "ErrorReporting": "Prompt", "ExceptionHandling": "SyncCThrow", "ExpandAttributedSource": "true", "FavorSizeOrSpeed": "Neither", "FloatingPointExceptions": "true", "FloatingPointModel": "Precise", "ForceConformanceInForLoopScope": "true", "ForcedIncludeFiles": "file1;file2", "ForcedUsingFiles": "file1;file2", "FunctionLevelLinking": "false", "GenerateXMLDocumentationFiles": "true", "IgnoreStandardIncludePath": "true", "InlineFunctionExpansion": "OnlyExplicitInline", "IntrinsicFunctions": "false", "MinimalRebuild": "true", "MultiProcessorCompilation": "true", "ObjectFileName": "a_file_name", "OmitDefaultLibName": "true", "OmitFramePointers": "true", "OpenMPSupport": "true", "Optimization": "Disabled", "PrecompiledHeader": "NotUsing", "PrecompiledHeaderFile": "a_file_name", "PrecompiledHeaderOutputFile": "a_file_name", "PreprocessKeepComments": "true", "PreprocessorDefinitions": "string1;string2", "PreprocessOutputPath": "a string1", "PreprocessSuppressLineNumbers": "false", "PreprocessToFile": "false", "ProcessorNumber": "33", "ProgramDataBaseFileName": "a_file_name", "RuntimeLibrary": "MultiThreaded", "RuntimeTypeInfo": "true", "ShowIncludes": "true", "SmallerTypeCheck": "true", "StringPooling": "true", "StructMemberAlignment": "1Byte", "SuppressStartupBanner": "true", "TrackerLogDirectory": "a_folder", "TreatSpecificWarningsAsErrors": "string1;string2", "TreatWarningAsError": "true", "TreatWChar_tAsBuiltInType": "true", "UndefineAllPreprocessorDefinitions": "true", "UndefinePreprocessorDefinitions": "string1;string2", "UseFullPaths": "true", "UseUnicodeForAssemblerListing": "true", "WarningLevel": "TurnOffAllWarnings", "WholeProgramOptimization": "true", "XMLDocumentationFileName": "a_file_name", "ZZXYZ": "bogus", }, "Link": { "AdditionalDependencies": "file1;file2", "AdditionalLibraryDirectories": "folder1;folder2", "AdditionalManifestDependencies": "file1;file2", "AdditionalOptions": "a string1", "AddModuleNamesToAssembly": "file1;file2", "AllowIsolation": "true", "AssemblyDebug": "", "AssemblyLinkResource": "file1;file2", "BaseAddress": "a string1", "BuildingInIDE": "true", "CLRImageType": "ForceIJWImage", "CLRSupportLastError": "Enabled", "CLRThreadAttribute": "MTAThreadingAttribute", "CLRUnmanagedCodeCheck": "true", "CreateHotPatchableImage": "X86Image", "DataExecutionPrevention": "false", "DelayLoadDLLs": "file1;file2", "DelaySign": "true", "Driver": "NotSet", "EmbedManagedResourceFile": "file1;file2", "EnableCOMDATFolding": "false", "EnableUAC": "true", "EntryPointSymbol": "a string1", "FixedBaseAddress": "false", "ForceFileOutput": "Enabled", "ForceSymbolReferences": "file1;file2", "FunctionOrder": "a_file_name", "GenerateDebugInformation": "true", "GenerateMapFile": "true", "HeapCommitSize": "a string1", "HeapReserveSize": "a string1", "IgnoreAllDefaultLibraries": "true", "IgnoreEmbeddedIDL": "true", "IgnoreSpecificDefaultLibraries": "a_file_list", "ImageHasSafeExceptionHandlers": "true", "ImportLibrary": "a_file_name", "KeyContainer": "a_file_name", "KeyFile": "a_file_name", "LargeAddressAware": "false", "LinkDLL": "true", "LinkErrorReporting": "SendErrorReport", "LinkStatus": "true", "LinkTimeCodeGeneration": "UseLinkTimeCodeGeneration", "ManifestFile": "a_file_name", "MapExports": "true", "MapFileName": "a_file_name", "MergedIDLBaseFileName": "a_file_name", "MergeSections": "a string1", "MidlCommandFile": "a_file_name", "MinimumRequiredVersion": "a string1", "ModuleDefinitionFile": "a_file_name", "MSDOSStubFileName": "a_file_name", "NoEntryPoint": "true", "OptimizeReferences": "false", "OutputFile": "a_file_name", "PerUserRedirection": "true", "PreventDllBinding": "true", "Profile": "true", "ProfileGuidedDatabase": "a_file_name", "ProgramDatabaseFile": "a_file_name", "RandomizedBaseAddress": "false", "RegisterOutput": "true", "SectionAlignment": "33", "SetChecksum": "true", "ShowProgress": "LinkVerboseREF", "SpecifySectionAttributes": "a string1", "StackCommitSize": "a string1", "StackReserveSize": "a string1", "StripPrivateSymbols": "a_file_name", "SubSystem": "Console", "SupportNobindOfDelayLoadedDLL": "true", "SupportUnloadOfDelayLoadedDLL": "true", "SuppressStartupBanner": "true", "SwapRunFromCD": "true", "SwapRunFromNET": "true", "TargetMachine": "MachineX86", "TerminalServerAware": "false", "TrackerLogDirectory": "a_folder", "TreatLinkerWarningAsErrors": "true", "TurnOffAssemblyGeneration": "true", "TypeLibraryFile": "a_file_name", "TypeLibraryResourceID": "33", "UACExecutionLevel": "AsInvoker", "UACUIAccess": "true", "Version": "a string1", }, "ResourceCompile": { "AdditionalIncludeDirectories": "folder1;folder2", "AdditionalOptions": "a string1", "Culture": "0x236", "IgnoreStandardIncludePath": "true", "NullTerminateStrings": "true", "PreprocessorDefinitions": "string1;string2", "ResourceOutputFileName": "a string1", "ShowProgress": "true", "SuppressStartupBanner": "true", "TrackerLogDirectory": "a_folder", "UndefinePreprocessorDefinitions": "string1;string2", }, "Midl": { "AdditionalIncludeDirectories": "folder1;folder2", "AdditionalOptions": "a string1", "ApplicationConfigurationMode": "true", "ClientStubFile": "a_file_name", "CPreprocessOptions": "a string1", "DefaultCharType": "Signed", "DllDataFileName": "a_file_name", "EnableErrorChecks": "EnableCustom", "ErrorCheckAllocations": "true", "ErrorCheckBounds": "true", "ErrorCheckEnumRange": "true", "ErrorCheckRefPointers": "true", "ErrorCheckStubData": "true", "GenerateClientFiles": "Stub", "GenerateServerFiles": "None", "GenerateStublessProxies": "true", "GenerateTypeLibrary": "true", "HeaderFileName": "a_file_name", "IgnoreStandardIncludePath": "true", "InterfaceIdentifierFileName": "a_file_name", "LocaleID": "33", "MkTypLibCompatible": "true", "OutputDirectory": "a string1", "PreprocessorDefinitions": "string1;string2", "ProxyFileName": "a_file_name", "RedirectOutputAndErrors": "a_file_name", "ServerStubFile": "a_file_name", "StructMemberAlignment": "NotSet", "SuppressCompilerWarnings": "true", "SuppressStartupBanner": "true", "TargetEnvironment": "Itanium", "TrackerLogDirectory": "a_folder", "TypeLibFormat": "NewFormat", "TypeLibraryName": "a_file_name", "UndefinePreprocessorDefinitions": "string1;string2", "ValidateAllParameters": "true", "WarnAsError": "true", "WarningLevel": "1", }, "Lib": { "AdditionalDependencies": "file1;file2", "AdditionalLibraryDirectories": "folder1;folder2", "AdditionalOptions": "a string1", "DisplayLibrary": "a string1", "ErrorReporting": "PromptImmediately", "ExportNamedFunctions": "string1;string2", "ForceSymbolReferences": "a string1", "IgnoreAllDefaultLibraries": "true", "IgnoreSpecificDefaultLibraries": "file1;file2", "LinkTimeCodeGeneration": "true", "MinimumRequiredVersion": "a string1", "ModuleDefinitionFile": "a_file_name", "Name": "a_file_name", "OutputFile": "a_file_name", "RemoveObjects": "file1;file2", "SubSystem": "Console", "SuppressStartupBanner": "true", "TargetMachine": "MachineX86i", "TrackerLogDirectory": "a_folder", "TreatLibWarningAsErrors": "true", "UseUnicodeResponseFiles": "true", "Verbose": "true", }, "Manifest": { "AdditionalManifestFiles": "file1;file2", "AdditionalOptions": "a string1", "AssemblyIdentity": "a string1", "ComponentFileName": "a_file_name", "EnableDPIAwareness": "fal", "GenerateCatalogFiles": "truel", "GenerateCategoryTags": "true", "InputResourceManifests": "a string1", "ManifestFromManagedAssembly": "a_file_name", "notgood3": "bogus", "OutputManifestFile": "a_file_name", "OutputResourceManifests": "a string1", "RegistrarScriptFile": "a_file_name", "ReplacementsFile": "a_file_name", "SuppressDependencyElement": "true", "SuppressStartupBanner": "true", "TrackerLogDirectory": "a_folder", "TypeLibraryFile": "a_file_name", "UpdateFileHashes": "true", "UpdateFileHashesSearchPath": "a_file_name", "VerboseOutput": "true", }, "ProjectReference": { "LinkLibraryDependencies": "true", "UseLibraryDependencyInputs": "true", }, "ManifestResourceCompile": {"ResourceOutputFileName": "a_file_name"}, "": { "EmbedManifest": "true", "GenerateManifest": "true", "IgnoreImportLibrary": "true", "LinkIncremental": "false", }, }, self.stderr, ) self._ExpectedWarnings( [ "Warning: unrecognized setting ClCompile/Enableprefast", "Warning: unrecognized setting ClCompile/ZZXYZ", "Warning: unrecognized setting Manifest/notgood3", "Warning: for Manifest/GenerateCatalogFiles, " "expected bool; got 'truel'", "Warning: for Lib/TargetMachine, unrecognized enumerated value " "MachineX86i", "Warning: for Manifest/EnableDPIAwareness, expected bool; got 'fal'", ] ) def testConvertToMSBuildSettings_empty(self): """Tests an empty conversion.""" msvs_settings = {} expected_msbuild_settings = {} actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings( msvs_settings, self.stderr ) self.assertEqual(expected_msbuild_settings, actual_msbuild_settings) self._ExpectedWarnings([]) def testConvertToMSBuildSettings_minimal(self): """Tests a minimal conversion.""" msvs_settings = { "VCCLCompilerTool": { "AdditionalIncludeDirectories": "dir1", "AdditionalOptions": "/foo", "BasicRuntimeChecks": "0", }, "VCLinkerTool": { "LinkTimeCodeGeneration": "1", "ErrorReporting": "1", "DataExecutionPrevention": "2", }, } expected_msbuild_settings = { "ClCompile": { "AdditionalIncludeDirectories": "dir1", "AdditionalOptions": "/foo", "BasicRuntimeChecks": "Default", }, "Link": { "LinkTimeCodeGeneration": "UseLinkTimeCodeGeneration", "LinkErrorReporting": "PromptImmediately", "DataExecutionPrevention": "true", }, } actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings( msvs_settings, self.stderr ) self.assertEqual(expected_msbuild_settings, actual_msbuild_settings) self._ExpectedWarnings([]) def testConvertToMSBuildSettings_warnings(self): """Tests conversion that generates warnings.""" msvs_settings = { "VCCLCompilerTool": { "AdditionalIncludeDirectories": "1", "AdditionalOptions": "2", # These are incorrect values: "BasicRuntimeChecks": "12", "BrowseInformation": "21", "UsePrecompiledHeader": "13", "GeneratePreprocessedFile": "14", }, "VCLinkerTool": { # These are incorrect values: "Driver": "10", "LinkTimeCodeGeneration": "31", "ErrorReporting": "21", "FixedBaseAddress": "6", }, "VCResourceCompilerTool": { # Custom "Culture": "1003" }, } expected_msbuild_settings = { "ClCompile": { "AdditionalIncludeDirectories": "1", "AdditionalOptions": "2", }, "Link": {}, "ResourceCompile": { # Custom "Culture": "0x03eb" }, } actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings( msvs_settings, self.stderr ) self.assertEqual(expected_msbuild_settings, actual_msbuild_settings) self._ExpectedWarnings( [ "Warning: while converting VCCLCompilerTool/BasicRuntimeChecks to " "MSBuild, index value (12) not in expected range [0, 4)", "Warning: while converting VCCLCompilerTool/BrowseInformation to " "MSBuild, index value (21) not in expected range [0, 3)", "Warning: while converting VCCLCompilerTool/UsePrecompiledHeader to " "MSBuild, index value (13) not in expected range [0, 3)", "Warning: while converting " "VCCLCompilerTool/GeneratePreprocessedFile to " "MSBuild, value must be one of [0, 1, 2]; got 14", "Warning: while converting VCLinkerTool/Driver to " "MSBuild, index value (10) not in expected range [0, 4)", "Warning: while converting VCLinkerTool/LinkTimeCodeGeneration to " "MSBuild, index value (31) not in expected range [0, 5)", "Warning: while converting VCLinkerTool/ErrorReporting to " "MSBuild, index value (21) not in expected range [0, 3)", "Warning: while converting VCLinkerTool/FixedBaseAddress to " "MSBuild, index value (6) not in expected range [0, 3)", ] ) def testConvertToMSBuildSettings_full_synthetic(self): """Tests conversion of all the MSBuild settings.""" msvs_settings = { "VCCLCompilerTool": { "AdditionalIncludeDirectories": "folder1;folder2;folder3", "AdditionalOptions": "a_string", "AdditionalUsingDirectories": "folder1;folder2;folder3", "AssemblerListingLocation": "a_file_name", "AssemblerOutput": "0", "BasicRuntimeChecks": "1", "BrowseInformation": "2", "BrowseInformationFile": "a_file_name", "BufferSecurityCheck": "true", "CallingConvention": "0", "CompileAs": "1", "DebugInformationFormat": "4", "DefaultCharIsUnsigned": "true", "Detect64BitPortabilityProblems": "true", "DisableLanguageExtensions": "true", "DisableSpecificWarnings": "d1;d2;d3", "EnableEnhancedInstructionSet": "0", "EnableFiberSafeOptimizations": "true", "EnableFunctionLevelLinking": "true", "EnableIntrinsicFunctions": "true", "EnablePREfast": "true", "ErrorReporting": "1", "ExceptionHandling": "2", "ExpandAttributedSource": "true", "FavorSizeOrSpeed": "0", "FloatingPointExceptions": "true", "FloatingPointModel": "1", "ForceConformanceInForLoopScope": "true", "ForcedIncludeFiles": "file1;file2;file3", "ForcedUsingFiles": "file1;file2;file3", "GeneratePreprocessedFile": "1", "GenerateXMLDocumentationFiles": "true", "IgnoreStandardIncludePath": "true", "InlineFunctionExpansion": "2", "KeepComments": "true", "MinimalRebuild": "true", "ObjectFile": "a_file_name", "OmitDefaultLibName": "true", "OmitFramePointers": "true", "OpenMP": "true", "Optimization": "3", "PrecompiledHeaderFile": "a_file_name", "PrecompiledHeaderThrough": "a_file_name", "PreprocessorDefinitions": "d1;d2;d3", "ProgramDataBaseFileName": "a_file_name", "RuntimeLibrary": "0", "RuntimeTypeInfo": "true", "ShowIncludes": "true", "SmallerTypeCheck": "true", "StringPooling": "true", "StructMemberAlignment": "1", "SuppressStartupBanner": "true", "TreatWChar_tAsBuiltInType": "true", "UndefineAllPreprocessorDefinitions": "true", "UndefinePreprocessorDefinitions": "d1;d2;d3", "UseFullPaths": "true", "UsePrecompiledHeader": "1", "UseUnicodeResponseFiles": "true", "WarnAsError": "true", "WarningLevel": "2", "WholeProgramOptimization": "true", "XMLDocumentationFileName": "a_file_name", }, "VCLinkerTool": { "AdditionalDependencies": "file1;file2;file3", "AdditionalLibraryDirectories": "folder1;folder2;folder3", "AdditionalLibraryDirectories_excluded": "folder1;folder2;folder3", "AdditionalManifestDependencies": "file1;file2;file3", "AdditionalOptions": "a_string", "AddModuleNamesToAssembly": "file1;file2;file3", "AllowIsolation": "true", "AssemblyDebug": "0", "AssemblyLinkResource": "file1;file2;file3", "BaseAddress": "a_string", "CLRImageType": "1", "CLRThreadAttribute": "2", "CLRUnmanagedCodeCheck": "true", "DataExecutionPrevention": "0", "DelayLoadDLLs": "file1;file2;file3", "DelaySign": "true", "Driver": "1", "EmbedManagedResourceFile": "file1;file2;file3", "EnableCOMDATFolding": "0", "EnableUAC": "true", "EntryPointSymbol": "a_string", "ErrorReporting": "0", "FixedBaseAddress": "1", "ForceSymbolReferences": "file1;file2;file3", "FunctionOrder": "a_file_name", "GenerateDebugInformation": "true", "GenerateManifest": "true", "GenerateMapFile": "true", "HeapCommitSize": "a_string", "HeapReserveSize": "a_string", "IgnoreAllDefaultLibraries": "true", "IgnoreDefaultLibraryNames": "file1;file2;file3", "IgnoreEmbeddedIDL": "true", "IgnoreImportLibrary": "true", "ImportLibrary": "a_file_name", "KeyContainer": "a_file_name", "KeyFile": "a_file_name", "LargeAddressAware": "2", "LinkIncremental": "1", "LinkLibraryDependencies": "true", "LinkTimeCodeGeneration": "2", "ManifestFile": "a_file_name", "MapExports": "true", "MapFileName": "a_file_name", "MergedIDLBaseFileName": "a_file_name", "MergeSections": "a_string", "MidlCommandFile": "a_file_name", "ModuleDefinitionFile": "a_file_name", "OptimizeForWindows98": "1", "OptimizeReferences": "0", "OutputFile": "a_file_name", "PerUserRedirection": "true", "Profile": "true", "ProfileGuidedDatabase": "a_file_name", "ProgramDatabaseFile": "a_file_name", "RandomizedBaseAddress": "1", "RegisterOutput": "true", "ResourceOnlyDLL": "true", "SetChecksum": "true", "ShowProgress": "0", "StackCommitSize": "a_string", "StackReserveSize": "a_string", "StripPrivateSymbols": "a_file_name", "SubSystem": "2", "SupportUnloadOfDelayLoadedDLL": "true", "SuppressStartupBanner": "true", "SwapRunFromCD": "true", "SwapRunFromNet": "true", "TargetMachine": "3", "TerminalServerAware": "2", "TurnOffAssemblyGeneration": "true", "TypeLibraryFile": "a_file_name", "TypeLibraryResourceID": "33", "UACExecutionLevel": "1", "UACUIAccess": "true", "UseLibraryDependencyInputs": "false", "UseUnicodeResponseFiles": "true", "Version": "a_string", }, "VCResourceCompilerTool": { "AdditionalIncludeDirectories": "folder1;folder2;folder3", "AdditionalOptions": "a_string", "Culture": "1003", "IgnoreStandardIncludePath": "true", "PreprocessorDefinitions": "d1;d2;d3", "ResourceOutputFileName": "a_string", "ShowProgress": "true", "SuppressStartupBanner": "true", "UndefinePreprocessorDefinitions": "d1;d2;d3", }, "VCMIDLTool": { "AdditionalIncludeDirectories": "folder1;folder2;folder3", "AdditionalOptions": "a_string", "CPreprocessOptions": "a_string", "DefaultCharType": "0", "DLLDataFileName": "a_file_name", "EnableErrorChecks": "2", "ErrorCheckAllocations": "true", "ErrorCheckBounds": "true", "ErrorCheckEnumRange": "true", "ErrorCheckRefPointers": "true", "ErrorCheckStubData": "true", "GenerateStublessProxies": "true", "GenerateTypeLibrary": "true", "HeaderFileName": "a_file_name", "IgnoreStandardIncludePath": "true", "InterfaceIdentifierFileName": "a_file_name", "MkTypLibCompatible": "true", "OutputDirectory": "a_string", "PreprocessorDefinitions": "d1;d2;d3", "ProxyFileName": "a_file_name", "RedirectOutputAndErrors": "a_file_name", "StructMemberAlignment": "3", "SuppressStartupBanner": "true", "TargetEnvironment": "1", "TypeLibraryName": "a_file_name", "UndefinePreprocessorDefinitions": "d1;d2;d3", "ValidateParameters": "true", "WarnAsError": "true", "WarningLevel": "4", }, "VCLibrarianTool": { "AdditionalDependencies": "file1;file2;file3", "AdditionalLibraryDirectories": "folder1;folder2;folder3", "AdditionalLibraryDirectories_excluded": "folder1;folder2;folder3", "AdditionalOptions": "a_string", "ExportNamedFunctions": "d1;d2;d3", "ForceSymbolReferences": "a_string", "IgnoreAllDefaultLibraries": "true", "IgnoreSpecificDefaultLibraries": "file1;file2;file3", "LinkLibraryDependencies": "true", "ModuleDefinitionFile": "a_file_name", "OutputFile": "a_file_name", "SuppressStartupBanner": "true", "UseUnicodeResponseFiles": "true", }, "VCManifestTool": { "AdditionalManifestFiles": "file1;file2;file3", "AdditionalOptions": "a_string", "AssemblyIdentity": "a_string", "ComponentFileName": "a_file_name", "DependencyInformationFile": "a_file_name", "EmbedManifest": "true", "GenerateCatalogFiles": "true", "InputResourceManifests": "a_string", "ManifestResourceFile": "my_name", "OutputManifestFile": "a_file_name", "RegistrarScriptFile": "a_file_name", "ReplacementsFile": "a_file_name", "SuppressStartupBanner": "true", "TypeLibraryFile": "a_file_name", "UpdateFileHashes": "true", "UpdateFileHashesSearchPath": "a_file_name", "UseFAT32Workaround": "true", "UseUnicodeResponseFiles": "true", "VerboseOutput": "true", }, } expected_msbuild_settings = { "ClCompile": { "AdditionalIncludeDirectories": "folder1;folder2;folder3", "AdditionalOptions": "a_string /J", "AdditionalUsingDirectories": "folder1;folder2;folder3", "AssemblerListingLocation": "a_file_name", "AssemblerOutput": "NoListing", "BasicRuntimeChecks": "StackFrameRuntimeCheck", "BrowseInformation": "true", "BrowseInformationFile": "a_file_name", "BufferSecurityCheck": "true", "CallingConvention": "Cdecl", "CompileAs": "CompileAsC", "DebugInformationFormat": "EditAndContinue", "DisableLanguageExtensions": "true", "DisableSpecificWarnings": "d1;d2;d3", "EnableEnhancedInstructionSet": "NotSet", "EnableFiberSafeOptimizations": "true", "EnablePREfast": "true", "ErrorReporting": "Prompt", "ExceptionHandling": "Async", "ExpandAttributedSource": "true", "FavorSizeOrSpeed": "Neither", "FloatingPointExceptions": "true", "FloatingPointModel": "Strict", "ForceConformanceInForLoopScope": "true", "ForcedIncludeFiles": "file1;file2;file3", "ForcedUsingFiles": "file1;file2;file3", "FunctionLevelLinking": "true", "GenerateXMLDocumentationFiles": "true", "IgnoreStandardIncludePath": "true", "InlineFunctionExpansion": "AnySuitable", "IntrinsicFunctions": "true", "MinimalRebuild": "true", "ObjectFileName": "a_file_name", "OmitDefaultLibName": "true", "OmitFramePointers": "true", "OpenMPSupport": "true", "Optimization": "Full", "PrecompiledHeader": "Create", "PrecompiledHeaderFile": "a_file_name", "PrecompiledHeaderOutputFile": "a_file_name", "PreprocessKeepComments": "true", "PreprocessorDefinitions": "d1;d2;d3", "PreprocessSuppressLineNumbers": "false", "PreprocessToFile": "true", "ProgramDataBaseFileName": "a_file_name", "RuntimeLibrary": "MultiThreaded", "RuntimeTypeInfo": "true", "ShowIncludes": "true", "SmallerTypeCheck": "true", "StringPooling": "true", "StructMemberAlignment": "1Byte", "SuppressStartupBanner": "true", "TreatWarningAsError": "true", "TreatWChar_tAsBuiltInType": "true", "UndefineAllPreprocessorDefinitions": "true", "UndefinePreprocessorDefinitions": "d1;d2;d3", "UseFullPaths": "true", "WarningLevel": "Level2", "WholeProgramOptimization": "true", "XMLDocumentationFileName": "a_file_name", }, "Link": { "AdditionalDependencies": "file1;file2;file3", "AdditionalLibraryDirectories": "folder1;folder2;folder3", "AdditionalManifestDependencies": "file1;file2;file3", "AdditionalOptions": "a_string", "AddModuleNamesToAssembly": "file1;file2;file3", "AllowIsolation": "true", "AssemblyDebug": "", "AssemblyLinkResource": "file1;file2;file3", "BaseAddress": "a_string", "CLRImageType": "ForceIJWImage", "CLRThreadAttribute": "STAThreadingAttribute", "CLRUnmanagedCodeCheck": "true", "DataExecutionPrevention": "", "DelayLoadDLLs": "file1;file2;file3", "DelaySign": "true", "Driver": "Driver", "EmbedManagedResourceFile": "file1;file2;file3", "EnableCOMDATFolding": "", "EnableUAC": "true", "EntryPointSymbol": "a_string", "FixedBaseAddress": "false", "ForceSymbolReferences": "file1;file2;file3", "FunctionOrder": "a_file_name", "GenerateDebugInformation": "true", "GenerateMapFile": "true", "HeapCommitSize": "a_string", "HeapReserveSize": "a_string", "IgnoreAllDefaultLibraries": "true", "IgnoreEmbeddedIDL": "true", "IgnoreSpecificDefaultLibraries": "file1;file2;file3", "ImportLibrary": "a_file_name", "KeyContainer": "a_file_name", "KeyFile": "a_file_name", "LargeAddressAware": "true", "LinkErrorReporting": "NoErrorReport", "LinkTimeCodeGeneration": "PGInstrument", "ManifestFile": "a_file_name", "MapExports": "true", "MapFileName": "a_file_name", "MergedIDLBaseFileName": "a_file_name", "MergeSections": "a_string", "MidlCommandFile": "a_file_name", "ModuleDefinitionFile": "a_file_name", "NoEntryPoint": "true", "OptimizeReferences": "", "OutputFile": "a_file_name", "PerUserRedirection": "true", "Profile": "true", "ProfileGuidedDatabase": "a_file_name", "ProgramDatabaseFile": "a_file_name", "RandomizedBaseAddress": "false", "RegisterOutput": "true", "SetChecksum": "true", "ShowProgress": "NotSet", "StackCommitSize": "a_string", "StackReserveSize": "a_string", "StripPrivateSymbols": "a_file_name", "SubSystem": "Windows", "SupportUnloadOfDelayLoadedDLL": "true", "SuppressStartupBanner": "true", "SwapRunFromCD": "true", "SwapRunFromNET": "true", "TargetMachine": "MachineARM", "TerminalServerAware": "true", "TurnOffAssemblyGeneration": "true", "TypeLibraryFile": "a_file_name", "TypeLibraryResourceID": "33", "UACExecutionLevel": "HighestAvailable", "UACUIAccess": "true", "Version": "a_string", }, "ResourceCompile": { "AdditionalIncludeDirectories": "folder1;folder2;folder3", "AdditionalOptions": "a_string", "Culture": "0x03eb", "IgnoreStandardIncludePath": "true", "PreprocessorDefinitions": "d1;d2;d3", "ResourceOutputFileName": "a_string", "ShowProgress": "true", "SuppressStartupBanner": "true", "UndefinePreprocessorDefinitions": "d1;d2;d3", }, "Midl": { "AdditionalIncludeDirectories": "folder1;folder2;folder3", "AdditionalOptions": "a_string", "CPreprocessOptions": "a_string", "DefaultCharType": "Unsigned", "DllDataFileName": "a_file_name", "EnableErrorChecks": "All", "ErrorCheckAllocations": "true", "ErrorCheckBounds": "true", "ErrorCheckEnumRange": "true", "ErrorCheckRefPointers": "true", "ErrorCheckStubData": "true", "GenerateStublessProxies": "true", "GenerateTypeLibrary": "true", "HeaderFileName": "a_file_name", "IgnoreStandardIncludePath": "true", "InterfaceIdentifierFileName": "a_file_name", "MkTypLibCompatible": "true", "OutputDirectory": "a_string", "PreprocessorDefinitions": "d1;d2;d3", "ProxyFileName": "a_file_name", "RedirectOutputAndErrors": "a_file_name", "StructMemberAlignment": "4", "SuppressStartupBanner": "true", "TargetEnvironment": "Win32", "TypeLibraryName": "a_file_name", "UndefinePreprocessorDefinitions": "d1;d2;d3", "ValidateAllParameters": "true", "WarnAsError": "true", "WarningLevel": "4", }, "Lib": { "AdditionalDependencies": "file1;file2;file3", "AdditionalLibraryDirectories": "folder1;folder2;folder3", "AdditionalOptions": "a_string", "ExportNamedFunctions": "d1;d2;d3", "ForceSymbolReferences": "a_string", "IgnoreAllDefaultLibraries": "true", "IgnoreSpecificDefaultLibraries": "file1;file2;file3", "ModuleDefinitionFile": "a_file_name", "OutputFile": "a_file_name", "SuppressStartupBanner": "true", "UseUnicodeResponseFiles": "true", }, "Manifest": { "AdditionalManifestFiles": "file1;file2;file3", "AdditionalOptions": "a_string", "AssemblyIdentity": "a_string", "ComponentFileName": "a_file_name", "GenerateCatalogFiles": "true", "InputResourceManifests": "a_string", "OutputManifestFile": "a_file_name", "RegistrarScriptFile": "a_file_name", "ReplacementsFile": "a_file_name", "SuppressStartupBanner": "true", "TypeLibraryFile": "a_file_name", "UpdateFileHashes": "true", "UpdateFileHashesSearchPath": "a_file_name", "VerboseOutput": "true", }, "ManifestResourceCompile": {"ResourceOutputFileName": "my_name"}, "ProjectReference": { "LinkLibraryDependencies": "true", "UseLibraryDependencyInputs": "false", }, "": { "EmbedManifest": "true", "GenerateManifest": "true", "IgnoreImportLibrary": "true", "LinkIncremental": "false", }, } self.maxDiff = 9999 # on failure display a long diff actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings( msvs_settings, self.stderr ) self.assertEqual(expected_msbuild_settings, actual_msbuild_settings) self._ExpectedWarnings([]) def testConvertToMSBuildSettings_actual(self): """Tests the conversion of an actual project. A VS2008 project with most of the options defined was created through the VS2008 IDE. It was then converted to VS2010. The tool settings found in the .vcproj and .vcxproj files were converted to the two dictionaries msvs_settings and expected_msbuild_settings. Note that for many settings, the VS2010 converter adds macros like %(AdditionalIncludeDirectories) to make sure than inherited values are included. Since the Gyp projects we generate do not use inheritance, we removed these macros. They were: ClCompile: AdditionalIncludeDirectories: ';%(AdditionalIncludeDirectories)' AdditionalOptions: ' %(AdditionalOptions)' AdditionalUsingDirectories: ';%(AdditionalUsingDirectories)' DisableSpecificWarnings: ';%(DisableSpecificWarnings)', ForcedIncludeFiles: ';%(ForcedIncludeFiles)', ForcedUsingFiles: ';%(ForcedUsingFiles)', PreprocessorDefinitions: ';%(PreprocessorDefinitions)', UndefinePreprocessorDefinitions: ';%(UndefinePreprocessorDefinitions)', Link: AdditionalDependencies: ';%(AdditionalDependencies)', AdditionalLibraryDirectories: ';%(AdditionalLibraryDirectories)', AdditionalManifestDependencies: ';%(AdditionalManifestDependencies)', AdditionalOptions: ' %(AdditionalOptions)', AddModuleNamesToAssembly: ';%(AddModuleNamesToAssembly)', AssemblyLinkResource: ';%(AssemblyLinkResource)', DelayLoadDLLs: ';%(DelayLoadDLLs)', EmbedManagedResourceFile: ';%(EmbedManagedResourceFile)', ForceSymbolReferences: ';%(ForceSymbolReferences)', IgnoreSpecificDefaultLibraries: ';%(IgnoreSpecificDefaultLibraries)', ResourceCompile: AdditionalIncludeDirectories: ';%(AdditionalIncludeDirectories)', AdditionalOptions: ' %(AdditionalOptions)', PreprocessorDefinitions: ';%(PreprocessorDefinitions)', Manifest: AdditionalManifestFiles: ';%(AdditionalManifestFiles)', AdditionalOptions: ' %(AdditionalOptions)', InputResourceManifests: ';%(InputResourceManifests)', """ msvs_settings = { "VCCLCompilerTool": { "AdditionalIncludeDirectories": "dir1", "AdditionalOptions": "/more", "AdditionalUsingDirectories": "test", "AssemblerListingLocation": "$(IntDir)\\a", "AssemblerOutput": "1", "BasicRuntimeChecks": "3", "BrowseInformation": "1", "BrowseInformationFile": "$(IntDir)\\e", "BufferSecurityCheck": "false", "CallingConvention": "1", "CompileAs": "1", "DebugInformationFormat": "4", "DefaultCharIsUnsigned": "true", "Detect64BitPortabilityProblems": "true", "DisableLanguageExtensions": "true", "DisableSpecificWarnings": "abc", "EnableEnhancedInstructionSet": "1", "EnableFiberSafeOptimizations": "true", "EnableFunctionLevelLinking": "true", "EnableIntrinsicFunctions": "true", "EnablePREfast": "true", "ErrorReporting": "2", "ExceptionHandling": "2", "ExpandAttributedSource": "true", "FavorSizeOrSpeed": "2", "FloatingPointExceptions": "true", "FloatingPointModel": "1", "ForceConformanceInForLoopScope": "false", "ForcedIncludeFiles": "def", "ForcedUsingFiles": "ge", "GeneratePreprocessedFile": "2", "GenerateXMLDocumentationFiles": "true", "IgnoreStandardIncludePath": "true", "InlineFunctionExpansion": "1", "KeepComments": "true", "MinimalRebuild": "true", "ObjectFile": "$(IntDir)\\b", "OmitDefaultLibName": "true", "OmitFramePointers": "true", "OpenMP": "true", "Optimization": "3", "PrecompiledHeaderFile": "$(IntDir)\\$(TargetName).pche", "PrecompiledHeaderThrough": "StdAfx.hd", "PreprocessorDefinitions": "WIN32;_DEBUG;_CONSOLE", "ProgramDataBaseFileName": "$(IntDir)\\vc90b.pdb", "RuntimeLibrary": "3", "RuntimeTypeInfo": "false", "ShowIncludes": "true", "SmallerTypeCheck": "true", "StringPooling": "true", "StructMemberAlignment": "3", "SuppressStartupBanner": "false", "TreatWChar_tAsBuiltInType": "false", "UndefineAllPreprocessorDefinitions": "true", "UndefinePreprocessorDefinitions": "wer", "UseFullPaths": "true", "UsePrecompiledHeader": "0", "UseUnicodeResponseFiles": "false", "WarnAsError": "true", "WarningLevel": "3", "WholeProgramOptimization": "true", "XMLDocumentationFileName": "$(IntDir)\\c", }, "VCLinkerTool": { "AdditionalDependencies": "zx", "AdditionalLibraryDirectories": "asd", "AdditionalManifestDependencies": "s2", "AdditionalOptions": "/mor2", "AddModuleNamesToAssembly": "d1", "AllowIsolation": "false", "AssemblyDebug": "1", "AssemblyLinkResource": "d5", "BaseAddress": "23423", "CLRImageType": "3", "CLRThreadAttribute": "1", "CLRUnmanagedCodeCheck": "true", "DataExecutionPrevention": "0", "DelayLoadDLLs": "d4", "DelaySign": "true", "Driver": "2", "EmbedManagedResourceFile": "d2", "EnableCOMDATFolding": "1", "EnableUAC": "false", "EntryPointSymbol": "f5", "ErrorReporting": "2", "FixedBaseAddress": "1", "ForceSymbolReferences": "d3", "FunctionOrder": "fssdfsd", "GenerateDebugInformation": "true", "GenerateManifest": "false", "GenerateMapFile": "true", "HeapCommitSize": "13", "HeapReserveSize": "12", "IgnoreAllDefaultLibraries": "true", "IgnoreDefaultLibraryNames": "flob;flok", "IgnoreEmbeddedIDL": "true", "IgnoreImportLibrary": "true", "ImportLibrary": "f4", "KeyContainer": "f7", "KeyFile": "f6", "LargeAddressAware": "2", "LinkIncremental": "0", "LinkLibraryDependencies": "false", "LinkTimeCodeGeneration": "1", "ManifestFile": "$(IntDir)\\$(TargetFileName).2intermediate.manifest", "MapExports": "true", "MapFileName": "d5", "MergedIDLBaseFileName": "f2", "MergeSections": "f5", "MidlCommandFile": "f1", "ModuleDefinitionFile": "sdsd", "OptimizeForWindows98": "2", "OptimizeReferences": "2", "OutputFile": "$(OutDir)\\$(ProjectName)2.exe", "PerUserRedirection": "true", "Profile": "true", "ProfileGuidedDatabase": "$(TargetDir)$(TargetName).pgdd", "ProgramDatabaseFile": "Flob.pdb", "RandomizedBaseAddress": "1", "RegisterOutput": "true", "ResourceOnlyDLL": "true", "SetChecksum": "false", "ShowProgress": "1", "StackCommitSize": "15", "StackReserveSize": "14", "StripPrivateSymbols": "d3", "SubSystem": "1", "SupportUnloadOfDelayLoadedDLL": "true", "SuppressStartupBanner": "false", "SwapRunFromCD": "true", "SwapRunFromNet": "true", "TargetMachine": "1", "TerminalServerAware": "1", "TurnOffAssemblyGeneration": "true", "TypeLibraryFile": "f3", "TypeLibraryResourceID": "12", "UACExecutionLevel": "2", "UACUIAccess": "true", "UseLibraryDependencyInputs": "true", "UseUnicodeResponseFiles": "false", "Version": "333", }, "VCResourceCompilerTool": { "AdditionalIncludeDirectories": "f3", "AdditionalOptions": "/more3", "Culture": "3084", "IgnoreStandardIncludePath": "true", "PreprocessorDefinitions": "_UNICODE;UNICODE2", "ResourceOutputFileName": "$(IntDir)/$(InputName)3.res", "ShowProgress": "true", }, "VCManifestTool": { "AdditionalManifestFiles": "sfsdfsd", "AdditionalOptions": "afdsdafsd", "AssemblyIdentity": "sddfdsadfsa", "ComponentFileName": "fsdfds", "DependencyInformationFile": "$(IntDir)\\mt.depdfd", "EmbedManifest": "false", "GenerateCatalogFiles": "true", "InputResourceManifests": "asfsfdafs", "ManifestResourceFile": "$(IntDir)\\$(TargetFileName).embed.manifest.resfdsf", "OutputManifestFile": "$(TargetPath).manifestdfs", "RegistrarScriptFile": "sdfsfd", "ReplacementsFile": "sdffsd", "SuppressStartupBanner": "false", "TypeLibraryFile": "sfsd", "UpdateFileHashes": "true", "UpdateFileHashesSearchPath": "sfsd", "UseFAT32Workaround": "true", "UseUnicodeResponseFiles": "false", "VerboseOutput": "true", }, } expected_msbuild_settings = { "ClCompile": { "AdditionalIncludeDirectories": "dir1", "AdditionalOptions": "/more /J", "AdditionalUsingDirectories": "test", "AssemblerListingLocation": "$(IntDir)a", "AssemblerOutput": "AssemblyCode", "BasicRuntimeChecks": "EnableFastChecks", "BrowseInformation": "true", "BrowseInformationFile": "$(IntDir)e", "BufferSecurityCheck": "false", "CallingConvention": "FastCall", "CompileAs": "CompileAsC", "DebugInformationFormat": "EditAndContinue", "DisableLanguageExtensions": "true", "DisableSpecificWarnings": "abc", "EnableEnhancedInstructionSet": "StreamingSIMDExtensions", "EnableFiberSafeOptimizations": "true", "EnablePREfast": "true", "ErrorReporting": "Queue", "ExceptionHandling": "Async", "ExpandAttributedSource": "true", "FavorSizeOrSpeed": "Size", "FloatingPointExceptions": "true", "FloatingPointModel": "Strict", "ForceConformanceInForLoopScope": "false", "ForcedIncludeFiles": "def", "ForcedUsingFiles": "ge", "FunctionLevelLinking": "true", "GenerateXMLDocumentationFiles": "true", "IgnoreStandardIncludePath": "true", "InlineFunctionExpansion": "OnlyExplicitInline", "IntrinsicFunctions": "true", "MinimalRebuild": "true", "ObjectFileName": "$(IntDir)b", "OmitDefaultLibName": "true", "OmitFramePointers": "true", "OpenMPSupport": "true", "Optimization": "Full", "PrecompiledHeader": "NotUsing", # Actual conversion gives '' "PrecompiledHeaderFile": "StdAfx.hd", "PrecompiledHeaderOutputFile": "$(IntDir)$(TargetName).pche", "PreprocessKeepComments": "true", "PreprocessorDefinitions": "WIN32;_DEBUG;_CONSOLE", "PreprocessSuppressLineNumbers": "true", "PreprocessToFile": "true", "ProgramDataBaseFileName": "$(IntDir)vc90b.pdb", "RuntimeLibrary": "MultiThreadedDebugDLL", "RuntimeTypeInfo": "false", "ShowIncludes": "true", "SmallerTypeCheck": "true", "StringPooling": "true", "StructMemberAlignment": "4Bytes", "SuppressStartupBanner": "false", "TreatWarningAsError": "true", "TreatWChar_tAsBuiltInType": "false", "UndefineAllPreprocessorDefinitions": "true", "UndefinePreprocessorDefinitions": "wer", "UseFullPaths": "true", "WarningLevel": "Level3", "WholeProgramOptimization": "true", "XMLDocumentationFileName": "$(IntDir)c", }, "Link": { "AdditionalDependencies": "zx", "AdditionalLibraryDirectories": "asd", "AdditionalManifestDependencies": "s2", "AdditionalOptions": "/mor2", "AddModuleNamesToAssembly": "d1", "AllowIsolation": "false", "AssemblyDebug": "true", "AssemblyLinkResource": "d5", "BaseAddress": "23423", "CLRImageType": "ForceSafeILImage", "CLRThreadAttribute": "MTAThreadingAttribute", "CLRUnmanagedCodeCheck": "true", "DataExecutionPrevention": "", "DelayLoadDLLs": "d4", "DelaySign": "true", "Driver": "UpOnly", "EmbedManagedResourceFile": "d2", "EnableCOMDATFolding": "false", "EnableUAC": "false", "EntryPointSymbol": "f5", "FixedBaseAddress": "false", "ForceSymbolReferences": "d3", "FunctionOrder": "fssdfsd", "GenerateDebugInformation": "true", "GenerateMapFile": "true", "HeapCommitSize": "13", "HeapReserveSize": "12", "IgnoreAllDefaultLibraries": "true", "IgnoreEmbeddedIDL": "true", "IgnoreSpecificDefaultLibraries": "flob;flok", "ImportLibrary": "f4", "KeyContainer": "f7", "KeyFile": "f6", "LargeAddressAware": "true", "LinkErrorReporting": "QueueForNextLogin", "LinkTimeCodeGeneration": "UseLinkTimeCodeGeneration", "ManifestFile": "$(IntDir)$(TargetFileName).2intermediate.manifest", "MapExports": "true", "MapFileName": "d5", "MergedIDLBaseFileName": "f2", "MergeSections": "f5", "MidlCommandFile": "f1", "ModuleDefinitionFile": "sdsd", "NoEntryPoint": "true", "OptimizeReferences": "true", "OutputFile": "$(OutDir)$(ProjectName)2.exe", "PerUserRedirection": "true", "Profile": "true", "ProfileGuidedDatabase": "$(TargetDir)$(TargetName).pgdd", "ProgramDatabaseFile": "Flob.pdb", "RandomizedBaseAddress": "false", "RegisterOutput": "true", "SetChecksum": "false", "ShowProgress": "LinkVerbose", "StackCommitSize": "15", "StackReserveSize": "14", "StripPrivateSymbols": "d3", "SubSystem": "Console", "SupportUnloadOfDelayLoadedDLL": "true", "SuppressStartupBanner": "false", "SwapRunFromCD": "true", "SwapRunFromNET": "true", "TargetMachine": "MachineX86", "TerminalServerAware": "false", "TurnOffAssemblyGeneration": "true", "TypeLibraryFile": "f3", "TypeLibraryResourceID": "12", "UACExecutionLevel": "RequireAdministrator", "UACUIAccess": "true", "Version": "333", }, "ResourceCompile": { "AdditionalIncludeDirectories": "f3", "AdditionalOptions": "/more3", "Culture": "0x0c0c", "IgnoreStandardIncludePath": "true", "PreprocessorDefinitions": "_UNICODE;UNICODE2", "ResourceOutputFileName": "$(IntDir)%(Filename)3.res", "ShowProgress": "true", }, "Manifest": { "AdditionalManifestFiles": "sfsdfsd", "AdditionalOptions": "afdsdafsd", "AssemblyIdentity": "sddfdsadfsa", "ComponentFileName": "fsdfds", "GenerateCatalogFiles": "true", "InputResourceManifests": "asfsfdafs", "OutputManifestFile": "$(TargetPath).manifestdfs", "RegistrarScriptFile": "sdfsfd", "ReplacementsFile": "sdffsd", "SuppressStartupBanner": "false", "TypeLibraryFile": "sfsd", "UpdateFileHashes": "true", "UpdateFileHashesSearchPath": "sfsd", "VerboseOutput": "true", }, "ProjectReference": { "LinkLibraryDependencies": "false", "UseLibraryDependencyInputs": "true", }, "": { "EmbedManifest": "false", "GenerateManifest": "false", "IgnoreImportLibrary": "true", "LinkIncremental": "", }, "ManifestResourceCompile": { "ResourceOutputFileName": "$(IntDir)$(TargetFileName).embed.manifest.resfdsf" }, } self.maxDiff = 9999 # on failure display a long diff actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings( msvs_settings, self.stderr ) self.assertEqual(expected_msbuild_settings, actual_msbuild_settings) self._ExpectedWarnings([]) if __name__ == "__main__": unittest.main() # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Visual Studio project reader/writer.""" import gyp.easy_xml as easy_xml class Writer: """Visual Studio XML tool file writer.""" def __init__(self, tool_file_path, name): """Initializes the tool file. Args: tool_file_path: Path to the tool file. name: Name of the tool file. """ self.tool_file_path = tool_file_path self.name = name self.rules_section = ["Rules"] def AddCustomBuildRule( self, name, cmd, description, additional_dependencies, outputs, extensions ): """Adds a rule to the tool file. Args: name: Name of the rule. description: Description of the rule. cmd: Command line of the rule. additional_dependencies: other files which may trigger the rule. outputs: outputs of the rule. extensions: extensions handled by the rule. """ rule = [ "CustomBuildRule", { "Name": name, "ExecutionDescription": description, "CommandLine": cmd, "Outputs": ";".join(outputs), "FileExtensions": ";".join(extensions), "AdditionalDependencies": ";".join(additional_dependencies), }, ] self.rules_section.append(rule) def WriteIfChanged(self): """Writes the tool file.""" content = [ "VisualStudioToolFile", {"Version": "8.00", "Name": self.name}, self.rules_section, ] easy_xml.WriteXmlIfChanged( content, self.tool_file_path, encoding="Windows-1252" ) # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Visual Studio user preferences file writer.""" import os import re import socket # for gethostname import gyp.easy_xml as easy_xml # ------------------------------------------------------------------------------ def _FindCommandInPath(command): """If there are no slashes in the command given, this function searches the PATH env to find the given command, and converts it to an absolute path. We have to do this because MSVS is looking for an actual file to launch a debugger on, not just a command line. Note that this happens at GYP time, so anything needing to be built needs to have a full path.""" if "/" in command or "\\" in command: # If the command already has path elements (either relative or # absolute), then assume it is constructed properly. return command else: # Search through the path list and find an existing file that # we can access. paths = os.environ.get("PATH", "").split(os.pathsep) for path in paths: item = os.path.join(path, command) if os.path.isfile(item) and os.access(item, os.X_OK): return item return command def _QuoteWin32CommandLineArgs(args): new_args = [] for arg in args: # Replace all double-quotes with double-double-quotes to escape # them for cmd shell, and then quote the whole thing if there # are any. if arg.find('"') != -1: arg = '""'.join(arg.split('"')) arg = '"%s"' % arg # Otherwise, if there are any spaces, quote the whole arg. elif re.search(r"[ \t\n]", arg): arg = '"%s"' % arg new_args.append(arg) return new_args class Writer: """Visual Studio XML user user file writer.""" def __init__(self, user_file_path, version, name): """Initializes the user file. Args: user_file_path: Path to the user file. version: Version info. name: Name of the user file. """ self.user_file_path = user_file_path self.version = version self.name = name self.configurations = {} def AddConfig(self, name): """Adds a configuration to the project. Args: name: Configuration name. """ self.configurations[name] = ["Configuration", {"Name": name}] def AddDebugSettings( self, config_name, command, environment={}, working_directory="" ): """Adds a DebugSettings node to the user file for a particular config. Args: command: command line to run. First element in the list is the executable. All elements of the command will be quoted if necessary. working_directory: other files which may trigger the rule. (optional) """ command = _QuoteWin32CommandLineArgs(command) abs_command = _FindCommandInPath(command[0]) if environment and isinstance(environment, dict): env_list = [f'{key}="{val}"' for (key, val) in environment.items()] environment = " ".join(env_list) else: environment = "" n_cmd = [ "DebugSettings", { "Command": abs_command, "WorkingDirectory": working_directory, "CommandArguments": " ".join(command[1:]), "RemoteMachine": socket.gethostname(), "Environment": environment, "EnvironmentMerge": "true", # Currently these are all "dummy" values that we're just setting # in the default manner that MSVS does it. We could use some of # these to add additional capabilities, I suppose, but they might # not have parity with other platforms then. "Attach": "false", "DebuggerType": "3", # 'auto' debugger "Remote": "1", "RemoteCommand": "", "HttpUrl": "", "PDBPath": "", "SQLDebugging": "", "DebuggerFlavor": "0", "MPIRunCommand": "", "MPIRunArguments": "", "MPIRunWorkingDirectory": "", "ApplicationCommand": "", "ApplicationArguments": "", "ShimCommand": "", "MPIAcceptMode": "", "MPIAcceptFilter": "", }, ] # Find the config, and add it if it doesn't exist. if config_name not in self.configurations: self.AddConfig(config_name) # Add the DebugSettings onto the appropriate config. self.configurations[config_name].append(n_cmd) def WriteIfChanged(self): """Writes the user file.""" configs = ["Configurations"] for config, spec in sorted(self.configurations.items()): configs.append(spec) content = [ "VisualStudioUserFile", {"Version": self.version.ProjectVersion(), "Name": self.name}, configs, ] easy_xml.WriteXmlIfChanged( content, self.user_file_path, encoding="Windows-1252" ) # Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utility functions shared amongst the Windows generators.""" import copy import os # A dictionary mapping supported target types to extensions. TARGET_TYPE_EXT = { "executable": "exe", "loadable_module": "dll", "shared_library": "dll", "static_library": "lib", "windows_driver": "sys", } def _GetLargePdbShimCcPath(): """Returns the path of the large_pdb_shim.cc file.""" this_dir = os.path.abspath(os.path.dirname(__file__)) src_dir = os.path.abspath(os.path.join(this_dir, "..", "..")) win_data_dir = os.path.join(src_dir, "data", "win") large_pdb_shim_cc = os.path.join(win_data_dir, "large-pdb-shim.cc") return large_pdb_shim_cc def _DeepCopySomeKeys(in_dict, keys): """Performs a partial deep-copy on |in_dict|, only copying the keys in |keys|. Arguments: in_dict: The dictionary to copy. keys: The keys to be copied. If a key is in this list and doesn't exist in |in_dict| this is not an error. Returns: The partially deep-copied dictionary. """ d = {} for key in keys: if key not in in_dict: continue d[key] = copy.deepcopy(in_dict[key]) return d def _SuffixName(name, suffix): """Add a suffix to the end of a target. Arguments: name: name of the target (foo#target) suffix: the suffix to be added Returns: Target name with suffix added (foo_suffix#target) """ parts = name.rsplit("#", 1) parts[0] = f"{parts[0]}_{suffix}" return "#".join(parts) def _ShardName(name, number): """Add a shard number to the end of a target. Arguments: name: name of the target (foo#target) number: shard number Returns: Target name with shard added (foo_1#target) """ return _SuffixName(name, str(number)) def ShardTargets(target_list, target_dicts): """Shard some targets apart to work around the linkers limits. Arguments: target_list: List of target pairs: 'base/base.gyp:base'. target_dicts: Dict of target properties keyed on target pair. Returns: Tuple of the new sharded versions of the inputs. """ # Gather the targets to shard, and how many pieces. targets_to_shard = {} for t in target_dicts: shards = int(target_dicts[t].get("msvs_shard", 0)) if shards: targets_to_shard[t] = shards # Shard target_list. new_target_list = [] for t in target_list: if t in targets_to_shard: for i in range(targets_to_shard[t]): new_target_list.append(_ShardName(t, i)) else: new_target_list.append(t) # Shard target_dict. new_target_dicts = {} for t in target_dicts: if t in targets_to_shard: for i in range(targets_to_shard[t]): name = _ShardName(t, i) new_target_dicts[name] = copy.copy(target_dicts[t]) new_target_dicts[name]["target_name"] = _ShardName( new_target_dicts[name]["target_name"], i ) sources = new_target_dicts[name].get("sources", []) new_sources = [] for pos in range(i, len(sources), targets_to_shard[t]): new_sources.append(sources[pos]) new_target_dicts[name]["sources"] = new_sources else: new_target_dicts[t] = target_dicts[t] # Shard dependencies. for t in sorted(new_target_dicts): for deptype in ("dependencies", "dependencies_original"): dependencies = copy.copy(new_target_dicts[t].get(deptype, [])) new_dependencies = [] for d in dependencies: if d in targets_to_shard: for i in range(targets_to_shard[d]): new_dependencies.append(_ShardName(d, i)) else: new_dependencies.append(d) new_target_dicts[t][deptype] = new_dependencies return (new_target_list, new_target_dicts) def _GetPdbPath(target_dict, config_name, vars): """Returns the path to the PDB file that will be generated by a given configuration. The lookup proceeds as follows: - Look for an explicit path in the VCLinkerTool configuration block. - Look for an 'msvs_large_pdb_path' variable. - Use '<(PRODUCT_DIR)/<(product_name).(exe|dll).pdb' if 'product_name' is specified. - Use '<(PRODUCT_DIR)/<(target_name).(exe|dll).pdb'. Arguments: target_dict: The target dictionary to be searched. config_name: The name of the configuration of interest. vars: A dictionary of common GYP variables with generator-specific values. Returns: The path of the corresponding PDB file. """ config = target_dict["configurations"][config_name] msvs = config.setdefault("msvs_settings", {}) linker = msvs.get("VCLinkerTool", {}) pdb_path = linker.get("ProgramDatabaseFile") if pdb_path: return pdb_path variables = target_dict.get("variables", {}) pdb_path = variables.get("msvs_large_pdb_path", None) if pdb_path: return pdb_path pdb_base = target_dict.get("product_name", target_dict["target_name"]) pdb_base = "{}.{}.pdb".format(pdb_base, TARGET_TYPE_EXT[target_dict["type"]]) pdb_path = vars["PRODUCT_DIR"] + "/" + pdb_base return pdb_path def InsertLargePdbShims(target_list, target_dicts, vars): """Insert a shim target that forces the linker to use 4KB pagesize PDBs. This is a workaround for targets with PDBs greater than 1GB in size, the limit for the 1KB pagesize PDBs created by the linker by default. Arguments: target_list: List of target pairs: 'base/base.gyp:base'. target_dicts: Dict of target properties keyed on target pair. vars: A dictionary of common GYP variables with generator-specific values. Returns: Tuple of the shimmed version of the inputs. """ # Determine which targets need shimming. targets_to_shim = [] for t in target_dicts: target_dict = target_dicts[t] # We only want to shim targets that have msvs_large_pdb enabled. if not int(target_dict.get("msvs_large_pdb", 0)): continue # This is intended for executable, shared_library and loadable_module # targets where every configuration is set up to produce a PDB output. # If any of these conditions is not true then the shim logic will fail # below. targets_to_shim.append(t) large_pdb_shim_cc = _GetLargePdbShimCcPath() for t in targets_to_shim: target_dict = target_dicts[t] target_name = target_dict.get("target_name") base_dict = _DeepCopySomeKeys( target_dict, ["configurations", "default_configuration", "toolset"] ) # This is the dict for copying the source file (part of the GYP tree) # to the intermediate directory of the project. This is necessary because # we can't always build a relative path to the shim source file (on Windows # GYP and the project may be on different drives), and Ninja hates absolute # paths (it ends up generating the .obj and .obj.d alongside the source # file, polluting GYPs tree). copy_suffix = "large_pdb_copy" copy_target_name = target_name + "_" + copy_suffix full_copy_target_name = _SuffixName(t, copy_suffix) shim_cc_basename = os.path.basename(large_pdb_shim_cc) shim_cc_dir = vars["SHARED_INTERMEDIATE_DIR"] + "/" + copy_target_name shim_cc_path = shim_cc_dir + "/" + shim_cc_basename copy_dict = copy.deepcopy(base_dict) copy_dict["target_name"] = copy_target_name copy_dict["type"] = "none" copy_dict["sources"] = [large_pdb_shim_cc] copy_dict["copies"] = [ {"destination": shim_cc_dir, "files": [large_pdb_shim_cc]} ] # This is the dict for the PDB generating shim target. It depends on the # copy target. shim_suffix = "large_pdb_shim" shim_target_name = target_name + "_" + shim_suffix full_shim_target_name = _SuffixName(t, shim_suffix) shim_dict = copy.deepcopy(base_dict) shim_dict["target_name"] = shim_target_name shim_dict["type"] = "static_library" shim_dict["sources"] = [shim_cc_path] shim_dict["dependencies"] = [full_copy_target_name] # Set up the shim to output its PDB to the same location as the final linker # target. for config_name, config in shim_dict.get("configurations").items(): pdb_path = _GetPdbPath(target_dict, config_name, vars) # A few keys that we don't want to propagate. for key in ["msvs_precompiled_header", "msvs_precompiled_source", "test"]: config.pop(key, None) msvs = config.setdefault("msvs_settings", {}) # Update the compiler directives in the shim target. compiler = msvs.setdefault("VCCLCompilerTool", {}) compiler["DebugInformationFormat"] = "3" compiler["ProgramDataBaseFileName"] = pdb_path # Set the explicit PDB path in the appropriate configuration of the # original target. config = target_dict["configurations"][config_name] msvs = config.setdefault("msvs_settings", {}) linker = msvs.setdefault("VCLinkerTool", {}) linker["GenerateDebugInformation"] = "true" linker["ProgramDatabaseFile"] = pdb_path # Add the new targets. They must go to the beginning of the list so that # the dependency generation works as expected in ninja. target_list.insert(0, full_copy_target_name) target_list.insert(0, full_shim_target_name) target_dicts[full_copy_target_name] = copy_dict target_dicts[full_shim_target_name] = shim_dict # Update the original target to depend on the shim target. target_dict.setdefault("dependencies", []).append(full_shim_target_name) return (target_list, target_dicts) # Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Handle version information related to Visual Stuio.""" import errno import os import re import subprocess import sys import glob def JoinPath(*args): return os.path.normpath(os.path.join(*args)) class VisualStudioVersion: """Information regarding a version of Visual Studio.""" def __init__( self, short_name, description, solution_version, project_version, flat_sln, uses_vcxproj, path, sdk_based, default_toolset=None, compatible_sdks=None, ): self.short_name = short_name self.description = description self.solution_version = solution_version self.project_version = project_version self.flat_sln = flat_sln self.uses_vcxproj = uses_vcxproj self.path = path self.sdk_based = sdk_based self.default_toolset = default_toolset compatible_sdks = compatible_sdks or [] compatible_sdks.sort(key=lambda v: float(v.replace("v", "")), reverse=True) self.compatible_sdks = compatible_sdks def ShortName(self): return self.short_name def Description(self): """Get the full description of the version.""" return self.description def SolutionVersion(self): """Get the version number of the sln files.""" return self.solution_version def ProjectVersion(self): """Get the version number of the vcproj or vcxproj files.""" return self.project_version def FlatSolution(self): return self.flat_sln def UsesVcxproj(self): """Returns true if this version uses a vcxproj file.""" return self.uses_vcxproj def ProjectExtension(self): """Returns the file extension for the project.""" return self.uses_vcxproj and ".vcxproj" or ".vcproj" def Path(self): """Returns the path to Visual Studio installation.""" return self.path def ToolPath(self, tool): """Returns the path to a given compiler tool. """ return os.path.normpath(os.path.join(self.path, "VC/bin", tool)) def DefaultToolset(self): """Returns the msbuild toolset version that will be used in the absence of a user override.""" return self.default_toolset def _SetupScriptInternal(self, target_arch): """Returns a command (with arguments) to be used to set up the environment.""" assert target_arch in ("x86", "x64"), "target_arch not supported" # If WindowsSDKDir is set and SetEnv.Cmd exists then we are using the # depot_tools build tools and should run SetEnv.Cmd to set up the # environment. The check for WindowsSDKDir alone is not sufficient because # this is set by running vcvarsall.bat. sdk_dir = os.environ.get("WindowsSDKDir", "") setup_path = JoinPath(sdk_dir, "Bin", "SetEnv.Cmd") if self.sdk_based and sdk_dir and os.path.exists(setup_path): return [setup_path, "/" + target_arch] is_host_arch_x64 = ( os.environ.get("PROCESSOR_ARCHITECTURE") == "AMD64" or os.environ.get("PROCESSOR_ARCHITEW6432") == "AMD64" ) # For VS2017 (and newer) it's fairly easy if self.short_name >= "2017": script_path = JoinPath( self.path, "VC", "Auxiliary", "Build", "vcvarsall.bat" ) # Always use a native executable, cross-compiling if necessary. host_arch = "amd64" if is_host_arch_x64 else "x86" msvc_target_arch = "amd64" if target_arch == "x64" else "x86" arg = host_arch if host_arch != msvc_target_arch: arg += "_" + msvc_target_arch return [script_path, arg] # We try to find the best version of the env setup batch. vcvarsall = JoinPath(self.path, "VC", "vcvarsall.bat") if target_arch == "x86": if ( self.short_name >= "2013" and self.short_name[-1] != "e" and is_host_arch_x64 ): # VS2013 and later, non-Express have a x64-x86 cross that we want # to prefer. return [vcvarsall, "amd64_x86"] else: # Otherwise, the standard x86 compiler. We don't use VC/vcvarsall.bat # for x86 because vcvarsall calls vcvars32, which it can only find if # VS??COMNTOOLS is set, which isn't guaranteed. return [JoinPath(self.path, "Common7", "Tools", "vsvars32.bat")] elif target_arch == "x64": arg = "x86_amd64" # Use the 64-on-64 compiler if we're not using an express edition and # we're running on a 64bit OS. if self.short_name[-1] != "e" and is_host_arch_x64: arg = "amd64" return [vcvarsall, arg] def SetupScript(self, target_arch): script_data = self._SetupScriptInternal(target_arch) script_path = script_data[0] if not os.path.exists(script_path): raise Exception( "%s is missing - make sure VC++ tools are installed." % script_path ) return script_data def _RegistryQueryBase(sysdir, key, value): """Use reg.exe to read a particular key. While ideally we might use the win32 module, we would like gyp to be python neutral, so for instance cygwin python lacks this module. Arguments: sysdir: The system subdirectory to attempt to launch reg.exe from. key: The registry key to read from. value: The particular value to read. Return: stdout from reg.exe, or None for failure. """ # Skip if not on Windows or Python Win32 setup issue if sys.platform not in ("win32", "cygwin"): return None # Setup params to pass to and attempt to launch reg.exe cmd = [os.path.join(os.environ.get("WINDIR", ""), sysdir, "reg.exe"), "query", key] if value: cmd.extend(["/v", value]) p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) # Obtain the stdout from reg.exe, reading to the end so p.returncode is valid # Note that the error text may be in [1] in some cases text = p.communicate()[0].decode("utf-8") # Check return code from reg.exe; officially 0==success and 1==error if p.returncode: return None return text def _RegistryQuery(key, value=None): r"""Use reg.exe to read a particular key through _RegistryQueryBase. First tries to launch from %WinDir%\Sysnative to avoid WoW64 redirection. If that fails, it falls back to System32. Sysnative is available on Vista and up and available on Windows Server 2003 and XP through KB patch 942589. Note that Sysnative will always fail if using 64-bit python due to it being a virtual directory and System32 will work correctly in the first place. KB 942589 - http://support.microsoft.com/kb/942589/en-us. Arguments: key: The registry key. value: The particular registry value to read (optional). Return: stdout from reg.exe, or None for failure. """ text = None try: text = _RegistryQueryBase("Sysnative", key, value) except OSError as e: if e.errno == errno.ENOENT: text = _RegistryQueryBase("System32", key, value) else: raise return text def _RegistryGetValueUsingWinReg(key, value): """Use the _winreg module to obtain the value of a registry key. Args: key: The registry key. value: The particular registry value to read. Return: contents of the registry key's value, or None on failure. Throws ImportError if winreg is unavailable. """ from winreg import HKEY_LOCAL_MACHINE, OpenKey, QueryValueEx try: root, subkey = key.split("\\", 1) assert root == "HKLM" # Only need HKLM for now. with OpenKey(HKEY_LOCAL_MACHINE, subkey) as hkey: return QueryValueEx(hkey, value)[0] except OSError: return None def _RegistryGetValue(key, value): """Use _winreg or reg.exe to obtain the value of a registry key. Using _winreg is preferable because it solves an issue on some corporate environments where access to reg.exe is locked down. However, we still need to fallback to reg.exe for the case where the _winreg module is not available (for example in cygwin python). Args: key: The registry key. value: The particular registry value to read. Return: contents of the registry key's value, or None on failure. """ try: return _RegistryGetValueUsingWinReg(key, value) except ImportError: pass # Fallback to reg.exe if we fail to import _winreg. text = _RegistryQuery(key, value) if not text: return None # Extract value. match = re.search(r"REG_\w+\s+([^\r]+)\r\n", text) if not match: return None return match.group(1) def _CreateVersion(name, path, sdk_based=False): """Sets up MSVS project generation. Setup is based off the GYP_MSVS_VERSION environment variable or whatever is autodetected if GYP_MSVS_VERSION is not explicitly specified. If a version is passed in that doesn't match a value in versions python will throw a error. """ if path: path = os.path.normpath(path) versions = { "2022": VisualStudioVersion( "2022", "Visual Studio 2022", solution_version="12.00", project_version="17.0", flat_sln=False, uses_vcxproj=True, path=path, sdk_based=sdk_based, default_toolset="v143", compatible_sdks=["v8.1", "v10.0"], ), "2019": VisualStudioVersion( "2019", "Visual Studio 2019", solution_version="12.00", project_version="16.0", flat_sln=False, uses_vcxproj=True, path=path, sdk_based=sdk_based, default_toolset="v142", compatible_sdks=["v8.1", "v10.0"], ), "2017": VisualStudioVersion( "2017", "Visual Studio 2017", solution_version="12.00", project_version="15.0", flat_sln=False, uses_vcxproj=True, path=path, sdk_based=sdk_based, default_toolset="v141", compatible_sdks=["v8.1", "v10.0"], ), "2015": VisualStudioVersion( "2015", "Visual Studio 2015", solution_version="12.00", project_version="14.0", flat_sln=False, uses_vcxproj=True, path=path, sdk_based=sdk_based, default_toolset="v140", ), "2013": VisualStudioVersion( "2013", "Visual Studio 2013", solution_version="13.00", project_version="12.0", flat_sln=False, uses_vcxproj=True, path=path, sdk_based=sdk_based, default_toolset="v120", ), "2013e": VisualStudioVersion( "2013e", "Visual Studio 2013", solution_version="13.00", project_version="12.0", flat_sln=True, uses_vcxproj=True, path=path, sdk_based=sdk_based, default_toolset="v120", ), "2012": VisualStudioVersion( "2012", "Visual Studio 2012", solution_version="12.00", project_version="4.0", flat_sln=False, uses_vcxproj=True, path=path, sdk_based=sdk_based, default_toolset="v110", ), "2012e": VisualStudioVersion( "2012e", "Visual Studio 2012", solution_version="12.00", project_version="4.0", flat_sln=True, uses_vcxproj=True, path=path, sdk_based=sdk_based, default_toolset="v110", ), "2010": VisualStudioVersion( "2010", "Visual Studio 2010", solution_version="11.00", project_version="4.0", flat_sln=False, uses_vcxproj=True, path=path, sdk_based=sdk_based, ), "2010e": VisualStudioVersion( "2010e", "Visual C++ Express 2010", solution_version="11.00", project_version="4.0", flat_sln=True, uses_vcxproj=True, path=path, sdk_based=sdk_based, ), "2008": VisualStudioVersion( "2008", "Visual Studio 2008", solution_version="10.00", project_version="9.00", flat_sln=False, uses_vcxproj=False, path=path, sdk_based=sdk_based, ), "2008e": VisualStudioVersion( "2008e", "Visual Studio 2008", solution_version="10.00", project_version="9.00", flat_sln=True, uses_vcxproj=False, path=path, sdk_based=sdk_based, ), "2005": VisualStudioVersion( "2005", "Visual Studio 2005", solution_version="9.00", project_version="8.00", flat_sln=False, uses_vcxproj=False, path=path, sdk_based=sdk_based, ), "2005e": VisualStudioVersion( "2005e", "Visual Studio 2005", solution_version="9.00", project_version="8.00", flat_sln=True, uses_vcxproj=False, path=path, sdk_based=sdk_based, ), } return versions[str(name)] def _ConvertToCygpath(path): """Convert to cygwin path if we are using cygwin.""" if sys.platform == "cygwin": p = subprocess.Popen(["cygpath", path], stdout=subprocess.PIPE) path = p.communicate()[0].decode("utf-8").strip() return path def _DetectVisualStudioVersions(versions_to_check, force_express): """Collect the list of installed visual studio versions. Returns: A list of visual studio versions installed in descending order of usage preference. Base this on the registry and a quick check if devenv.exe exists. Possibilities are: 2005(e) - Visual Studio 2005 (8) 2008(e) - Visual Studio 2008 (9) 2010(e) - Visual Studio 2010 (10) 2012(e) - Visual Studio 2012 (11) 2013(e) - Visual Studio 2013 (12) 2015 - Visual Studio 2015 (14) 2017 - Visual Studio 2017 (15) 2019 - Visual Studio 2019 (16) 2022 - Visual Studio 2022 (17) Where (e) is e for express editions of MSVS and blank otherwise. """ version_to_year = { "8.0": "2005", "9.0": "2008", "10.0": "2010", "11.0": "2012", "12.0": "2013", "14.0": "2015", "15.0": "2017", "16.0": "2019", "17.0": "2022", } versions = [] for version in versions_to_check: # Old method of searching for which VS version is installed # We don't use the 2010-encouraged-way because we also want to get the # path to the binaries, which it doesn't offer. keys = [ r"HKLM\Software\Microsoft\VisualStudio\%s" % version, r"HKLM\Software\Wow6432Node\Microsoft\VisualStudio\%s" % version, r"HKLM\Software\Microsoft\VCExpress\%s" % version, r"HKLM\Software\Wow6432Node\Microsoft\VCExpress\%s" % version, ] for index in range(len(keys)): path = _RegistryGetValue(keys[index], "InstallDir") if not path: continue path = _ConvertToCygpath(path) # Check for full. full_path = os.path.join(path, "devenv.exe") express_path = os.path.join(path, "*express.exe") if not force_express and os.path.exists(full_path): # Add this one. versions.append( _CreateVersion( version_to_year[version], os.path.join(path, "..", "..") ) ) # Check for express. elif glob.glob(express_path): # Add this one. versions.append( _CreateVersion( version_to_year[version] + "e", os.path.join(path, "..", "..") ) ) # The old method above does not work when only SDK is installed. keys = [ r"HKLM\Software\Microsoft\VisualStudio\SxS\VC7", r"HKLM\Software\Wow6432Node\Microsoft\VisualStudio\SxS\VC7", r"HKLM\Software\Microsoft\VisualStudio\SxS\VS7", r"HKLM\Software\Wow6432Node\Microsoft\VisualStudio\SxS\VS7", ] for index in range(len(keys)): path = _RegistryGetValue(keys[index], version) if not path: continue path = _ConvertToCygpath(path) if version == "15.0": if os.path.exists(path): versions.append(_CreateVersion("2017", path)) elif version != "14.0": # There is no Express edition for 2015. versions.append( _CreateVersion( version_to_year[version] + "e", os.path.join(path, ".."), sdk_based=True, ) ) return versions def SelectVisualStudioVersion(version="auto", allow_fallback=True): """Select which version of Visual Studio projects to generate. Arguments: version: Hook to allow caller to force a particular version (vs auto). Returns: An object representing a visual studio project format version. """ # In auto mode, check environment variable for override. if version == "auto": version = os.environ.get("GYP_MSVS_VERSION", "auto") version_map = { "auto": ("17.0", "16.0", "15.0", "14.0", "12.0", "10.0", "9.0", "8.0", "11.0"), "2005": ("8.0",), "2005e": ("8.0",), "2008": ("9.0",), "2008e": ("9.0",), "2010": ("10.0",), "2010e": ("10.0",), "2012": ("11.0",), "2012e": ("11.0",), "2013": ("12.0",), "2013e": ("12.0",), "2015": ("14.0",), "2017": ("15.0",), "2019": ("16.0",), "2022": ("17.0",), } override_path = os.environ.get("GYP_MSVS_OVERRIDE_PATH") if override_path: msvs_version = os.environ.get("GYP_MSVS_VERSION") if not msvs_version: raise ValueError( "GYP_MSVS_OVERRIDE_PATH requires GYP_MSVS_VERSION to be " "set to a particular version (e.g. 2010e)." ) return _CreateVersion(msvs_version, override_path, sdk_based=True) version = str(version) versions = _DetectVisualStudioVersions(version_map[version], "e" in version) if not versions: if not allow_fallback: raise ValueError("Could not locate Visual Studio installation.") if version == "auto": # Default to 2005 if we couldn't find anything return _CreateVersion("2005", None) else: return _CreateVersion(version, None) return versions[0] # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ This module helps emulate Visual Studio 2008 behavior on top of other build systems, primarily ninja. """ import collections import os import re import subprocess import sys from gyp.common import OrderedSet import gyp.MSVSUtil import gyp.MSVSVersion windows_quoter_regex = re.compile(r'(\\*)"') def QuoteForRspFile(arg, quote_cmd=True): """Quote a command line argument so that it appears as one argument when processed via cmd.exe and parsed by CommandLineToArgvW (as is typical for Windows programs).""" # See http://goo.gl/cuFbX and http://goo.gl/dhPnp including the comment # threads. This is actually the quoting rules for CommandLineToArgvW, not # for the shell, because the shell doesn't do anything in Windows. This # works more or less because most programs (including the compiler, etc.) # use that function to handle command line arguments. # Use a heuristic to try to find args that are paths, and normalize them if arg.find("/") > 0 or arg.count("/") > 1: arg = os.path.normpath(arg) # For a literal quote, CommandLineToArgvW requires 2n+1 backslashes # preceding it, and results in n backslashes + the quote. So we substitute # in 2* what we match, +1 more, plus the quote. if quote_cmd: arg = windows_quoter_regex.sub(lambda mo: 2 * mo.group(1) + '\\"', arg) # %'s also need to be doubled otherwise they're interpreted as batch # positional arguments. Also make sure to escape the % so that they're # passed literally through escaping so they can be singled to just the # original %. Otherwise, trying to pass the literal representation that # looks like an environment variable to the shell (e.g. %PATH%) would fail. arg = arg.replace("%", "%%") # These commands are used in rsp files, so no escaping for the shell (via ^) # is necessary. # As a workaround for programs that don't use CommandLineToArgvW, gyp # supports msvs_quote_cmd=0, which simply disables all quoting. if quote_cmd: # Finally, wrap the whole thing in quotes so that the above quote rule # applies and whitespace isn't a word break. return f'"{arg}"' return arg def EncodeRspFileList(args, quote_cmd): """Process a list of arguments using QuoteCmdExeArgument.""" # Note that the first argument is assumed to be the command. Don't add # quotes around it because then built-ins like 'echo', etc. won't work. # Take care to normpath only the path in the case of 'call ../x.bat' because # otherwise the whole thing is incorrectly interpreted as a path and not # normalized correctly. if not args: return "" if args[0].startswith("call "): call, program = args[0].split(" ", 1) program = call + " " + os.path.normpath(program) else: program = os.path.normpath(args[0]) return (program + " " + " ".join(QuoteForRspFile(arg, quote_cmd) for arg in args[1:])) def _GenericRetrieve(root, default, path): """Given a list of dictionary keys |path| and a tree of dicts |root|, find value at path, or return |default| if any of the path doesn't exist.""" if not root: return default if not path: return root return _GenericRetrieve(root.get(path[0]), default, path[1:]) def _AddPrefix(element, prefix): """Add |prefix| to |element| or each subelement if element is iterable.""" if element is None: return element # Note, not Iterable because we don't want to handle strings like that. if isinstance(element, list) or isinstance(element, tuple): return [prefix + e for e in element] else: return prefix + element def _DoRemapping(element, map): """If |element| then remap it through |map|. If |element| is iterable then each item will be remapped. Any elements not found will be removed.""" if map is not None and element is not None: if not callable(map): map = map.get # Assume it's a dict, otherwise a callable to do the remap. if isinstance(element, list) or isinstance(element, tuple): element = filter(None, [map(elem) for elem in element]) else: element = map(element) return element def _AppendOrReturn(append, element): """If |append| is None, simply return |element|. If |append| is not None, then add |element| to it, adding each item in |element| if it's a list or tuple.""" if append is not None and element is not None: if isinstance(element, list) or isinstance(element, tuple): append.extend(element) else: append.append(element) else: return element def _FindDirectXInstallation(): """Try to find an installation location for the DirectX SDK. Check for the standard environment variable, and if that doesn't exist, try to find via the registry. May return None if not found in either location.""" # Return previously calculated value, if there is one if hasattr(_FindDirectXInstallation, "dxsdk_dir"): return _FindDirectXInstallation.dxsdk_dir dxsdk_dir = os.environ.get("DXSDK_DIR") if not dxsdk_dir: # Setup params to pass to and attempt to launch reg.exe. cmd = ["reg.exe", "query", r"HKLM\Software\Microsoft\DirectX", "/s"] p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout = p.communicate()[0].decode("utf-8") for line in stdout.splitlines(): if "InstallPath" in line: dxsdk_dir = line.split(" ")[3] + "\\" # Cache return value _FindDirectXInstallation.dxsdk_dir = dxsdk_dir return dxsdk_dir def GetGlobalVSMacroEnv(vs_version): """Get a dict of variables mapping internal VS macro names to their gyp equivalents. Returns all variables that are independent of the target.""" env = {} # '$(VSInstallDir)' and '$(VCInstallDir)' are available when and only when # Visual Studio is actually installed. if vs_version.Path(): env["$(VSInstallDir)"] = vs_version.Path() env["$(VCInstallDir)"] = os.path.join(vs_version.Path(), "VC") + "\\" # Chromium uses DXSDK_DIR in include/lib paths, but it may or may not be # set. This happens when the SDK is sync'd via src-internal, rather than # by typical end-user installation of the SDK. If it's not set, we don't # want to leave the unexpanded variable in the path, so simply strip it. dxsdk_dir = _FindDirectXInstallation() env["$(DXSDK_DIR)"] = dxsdk_dir if dxsdk_dir else "" # Try to find an installation location for the Windows DDK by checking # the WDK_DIR environment variable, may be None. env["$(WDK_DIR)"] = os.environ.get("WDK_DIR", "") return env def ExtractSharedMSVSSystemIncludes(configs, generator_flags): """Finds msvs_system_include_dirs that are common to all targets, removes them from all targets, and returns an OrderedSet containing them.""" all_system_includes = OrderedSet(configs[0].get("msvs_system_include_dirs", [])) for config in configs[1:]: system_includes = config.get("msvs_system_include_dirs", []) all_system_includes = all_system_includes & OrderedSet(system_includes) if not all_system_includes: return None # Expand macros in all_system_includes. env = GetGlobalVSMacroEnv(GetVSVersion(generator_flags)) expanded_system_includes = OrderedSet( [ExpandMacros(include, env) for include in all_system_includes] ) if any(["$" in include for include in expanded_system_includes]): # Some path relies on target-specific variables, bail. return None # Remove system includes shared by all targets from the targets. for config in configs: includes = config.get("msvs_system_include_dirs", []) if includes: # Don't insert a msvs_system_include_dirs key if not needed. # This must check the unexpanded includes list: new_includes = [i for i in includes if i not in all_system_includes] config["msvs_system_include_dirs"] = new_includes return expanded_system_includes class MsvsSettings: """A class that understands the gyp 'msvs_...' values (especially the msvs_settings field). They largely correpond to the VS2008 IDE DOM. This class helps map those settings to command line options.""" def __init__(self, spec, generator_flags): self.spec = spec self.vs_version = GetVSVersion(generator_flags) supported_fields = [ ("msvs_configuration_attributes", dict), ("msvs_settings", dict), ("msvs_system_include_dirs", list), ("msvs_disabled_warnings", list), ("msvs_precompiled_header", str), ("msvs_precompiled_source", str), ("msvs_configuration_platform", str), ("msvs_target_platform", str), ] configs = spec["configurations"] for field, default in supported_fields: setattr(self, field, {}) for configname, config in configs.items(): getattr(self, field)[configname] = config.get(field, default()) self.msvs_cygwin_dirs = spec.get("msvs_cygwin_dirs", ["."]) unsupported_fields = [ "msvs_prebuild", "msvs_postbuild", ] unsupported = [] for field in unsupported_fields: for config in configs.values(): if field in config: unsupported += [ "{} not supported (target {}).".format( field, spec["target_name"] ) ] if unsupported: raise Exception("\n".join(unsupported)) def GetExtension(self): """Returns the extension for the target, with no leading dot. Uses 'product_extension' if specified, otherwise uses MSVS defaults based on the target type. """ ext = self.spec.get("product_extension", None) if ext: return ext return gyp.MSVSUtil.TARGET_TYPE_EXT.get(self.spec["type"], "") def GetVSMacroEnv(self, base_to_build=None, config=None): """Get a dict of variables mapping internal VS macro names to their gyp equivalents.""" target_arch = self.GetArch(config) if target_arch == "x86": target_platform = "Win32" else: target_platform = target_arch target_name = self.spec.get("product_prefix", "") + self.spec.get( "product_name", self.spec["target_name"] ) target_dir = base_to_build + "\\" if base_to_build else "" target_ext = "." + self.GetExtension() target_file_name = target_name + target_ext replacements = { "$(InputName)": "${root}", "$(InputPath)": "${source}", "$(IntDir)": "$!INTERMEDIATE_DIR", "$(OutDir)\\": target_dir, "$(PlatformName)": target_platform, "$(ProjectDir)\\": "", "$(ProjectName)": self.spec["target_name"], "$(TargetDir)\\": target_dir, "$(TargetExt)": target_ext, "$(TargetFileName)": target_file_name, "$(TargetName)": target_name, "$(TargetPath)": os.path.join(target_dir, target_file_name), } replacements.update(GetGlobalVSMacroEnv(self.vs_version)) return replacements def ConvertVSMacros(self, s, base_to_build=None, config=None): """Convert from VS macro names to something equivalent.""" env = self.GetVSMacroEnv(base_to_build, config=config) return ExpandMacros(s, env) def AdjustLibraries(self, libraries): """Strip -l from library if it's specified with that.""" libs = [lib[2:] if lib.startswith("-l") else lib for lib in libraries] return [ lib + ".lib" if not lib.lower().endswith(".lib") and not lib.lower().endswith(".obj") else lib for lib in libs ] def _GetAndMunge(self, field, path, default, prefix, append, map): """Retrieve a value from |field| at |path| or return |default|. If |append| is specified, and the item is found, it will be appended to that object instead of returned. If |map| is specified, results will be remapped through |map| before being returned or appended.""" result = _GenericRetrieve(field, default, path) result = _DoRemapping(result, map) result = _AddPrefix(result, prefix) return _AppendOrReturn(append, result) class _GetWrapper: def __init__(self, parent, field, base_path, append=None): self.parent = parent self.field = field self.base_path = [base_path] self.append = append def __call__(self, name, map=None, prefix="", default=None): return self.parent._GetAndMunge( self.field, self.base_path + [name], default=default, prefix=prefix, append=self.append, map=map, ) def GetArch(self, config): """Get architecture based on msvs_configuration_platform and msvs_target_platform. Returns either 'x86' or 'x64'.""" configuration_platform = self.msvs_configuration_platform.get(config, "") platform = self.msvs_target_platform.get(config, "") if not platform: # If no specific override, use the configuration's. platform = configuration_platform # Map from platform to architecture. return {"Win32": "x86", "x64": "x64", "ARM64": "arm64"}.get(platform, "x86") def _TargetConfig(self, config): """Returns the target-specific configuration.""" # There's two levels of architecture/platform specification in VS. The # first level is globally for the configuration (this is what we consider # "the" config at the gyp level, which will be something like 'Debug' or # 'Release'), VS2015 and later only use this level if int(self.vs_version.short_name) >= 2015: return config # and a second target-specific configuration, which is an # override for the global one. |config| is remapped here to take into # account the local target-specific overrides to the global configuration. arch = self.GetArch(config) if arch == "x64" and not config.endswith("_x64"): config += "_x64" if arch == "x86" and config.endswith("_x64"): config = config.rsplit("_", 1)[0] return config def _Setting(self, path, config, default=None, prefix="", append=None, map=None): """_GetAndMunge for msvs_settings.""" return self._GetAndMunge( self.msvs_settings[config], path, default, prefix, append, map ) def _ConfigAttrib( self, path, config, default=None, prefix="", append=None, map=None ): """_GetAndMunge for msvs_configuration_attributes.""" return self._GetAndMunge( self.msvs_configuration_attributes[config], path, default, prefix, append, map, ) def AdjustIncludeDirs(self, include_dirs, config): """Updates include_dirs to expand VS specific paths, and adds the system include dirs used for platform SDK and similar.""" config = self._TargetConfig(config) includes = include_dirs + self.msvs_system_include_dirs[config] includes.extend( self._Setting( ("VCCLCompilerTool", "AdditionalIncludeDirectories"), config, default=[] ) ) return [self.ConvertVSMacros(p, config=config) for p in includes] def AdjustMidlIncludeDirs(self, midl_include_dirs, config): """Updates midl_include_dirs to expand VS specific paths, and adds the system include dirs used for platform SDK and similar.""" config = self._TargetConfig(config) includes = midl_include_dirs + self.msvs_system_include_dirs[config] includes.extend( self._Setting( ("VCMIDLTool", "AdditionalIncludeDirectories"), config, default=[] ) ) return [self.ConvertVSMacros(p, config=config) for p in includes] def GetComputedDefines(self, config): """Returns the set of defines that are injected to the defines list based on other VS settings.""" config = self._TargetConfig(config) defines = [] if self._ConfigAttrib(["CharacterSet"], config) == "1": defines.extend(("_UNICODE", "UNICODE")) if self._ConfigAttrib(["CharacterSet"], config) == "2": defines.append("_MBCS") defines.extend( self._Setting( ("VCCLCompilerTool", "PreprocessorDefinitions"), config, default=[] ) ) return defines def GetCompilerPdbName(self, config, expand_special): """Get the pdb file name that should be used for compiler invocations, or None if there's no explicit name specified.""" config = self._TargetConfig(config) pdbname = self._Setting(("VCCLCompilerTool", "ProgramDataBaseFileName"), config) if pdbname: pdbname = expand_special(self.ConvertVSMacros(pdbname)) return pdbname def GetMapFileName(self, config, expand_special): """Gets the explicitly overridden map file name for a target or returns None if it's not set.""" config = self._TargetConfig(config) map_file = self._Setting(("VCLinkerTool", "MapFileName"), config) if map_file: map_file = expand_special(self.ConvertVSMacros(map_file, config=config)) return map_file def GetOutputName(self, config, expand_special): """Gets the explicitly overridden output name for a target or returns None if it's not overridden.""" config = self._TargetConfig(config) type = self.spec["type"] root = "VCLibrarianTool" if type == "static_library" else "VCLinkerTool" # TODO(scottmg): Handle OutputDirectory without OutputFile. output_file = self._Setting((root, "OutputFile"), config) if output_file: output_file = expand_special( self.ConvertVSMacros(output_file, config=config) ) return output_file def GetPDBName(self, config, expand_special, default): """Gets the explicitly overridden pdb name for a target or returns default if it's not overridden, or if no pdb will be generated.""" config = self._TargetConfig(config) output_file = self._Setting(("VCLinkerTool", "ProgramDatabaseFile"), config) generate_debug_info = self._Setting( ("VCLinkerTool", "GenerateDebugInformation"), config ) if generate_debug_info == "true": if output_file: return expand_special(self.ConvertVSMacros(output_file, config=config)) else: return default else: return None def GetNoImportLibrary(self, config): """If NoImportLibrary: true, ninja will not expect the output to include an import library.""" config = self._TargetConfig(config) noimplib = self._Setting(("NoImportLibrary",), config) return noimplib == "true" def GetAsmflags(self, config): """Returns the flags that need to be added to ml invocations.""" config = self._TargetConfig(config) asmflags = [] safeseh = self._Setting(("MASM", "UseSafeExceptionHandlers"), config) if safeseh == "true": asmflags.append("/safeseh") return asmflags def GetCflags(self, config): """Returns the flags that need to be added to .c and .cc compilations.""" config = self._TargetConfig(config) cflags = [] cflags.extend(["/wd" + w for w in self.msvs_disabled_warnings[config]]) cl = self._GetWrapper( self, self.msvs_settings[config], "VCCLCompilerTool", append=cflags ) cl( "Optimization", map={"0": "d", "1": "1", "2": "2", "3": "x"}, prefix="/O", default="2", ) cl("InlineFunctionExpansion", prefix="/Ob") cl("DisableSpecificWarnings", prefix="/wd") cl("StringPooling", map={"true": "/GF"}) cl("EnableFiberSafeOptimizations", map={"true": "/GT"}) cl("OmitFramePointers", map={"false": "-", "true": ""}, prefix="/Oy") cl("EnableIntrinsicFunctions", map={"false": "-", "true": ""}, prefix="/Oi") cl("FavorSizeOrSpeed", map={"1": "t", "2": "s"}, prefix="/O") cl( "FloatingPointModel", map={"0": "precise", "1": "strict", "2": "fast"}, prefix="/fp:", default="0", ) cl("CompileAsManaged", map={"false": "", "true": "/clr"}) cl("WholeProgramOptimization", map={"true": "/GL"}) cl("WarningLevel", prefix="/W") cl("WarnAsError", map={"true": "/WX"}) cl( "CallingConvention", map={"0": "d", "1": "r", "2": "z", "3": "v"}, prefix="/G", ) cl("DebugInformationFormat", map={"1": "7", "3": "i", "4": "I"}, prefix="/Z") cl("RuntimeTypeInfo", map={"true": "/GR", "false": "/GR-"}) cl("EnableFunctionLevelLinking", map={"true": "/Gy", "false": "/Gy-"}) cl("MinimalRebuild", map={"true": "/Gm"}) cl("BufferSecurityCheck", map={"true": "/GS", "false": "/GS-"}) cl("BasicRuntimeChecks", map={"1": "s", "2": "u", "3": "1"}, prefix="/RTC") cl( "RuntimeLibrary", map={"0": "T", "1": "Td", "2": "D", "3": "Dd"}, prefix="/M", ) cl("ExceptionHandling", map={"1": "sc", "2": "a"}, prefix="/EH") cl("DefaultCharIsUnsigned", map={"true": "/J"}) cl( "TreatWChar_tAsBuiltInType", map={"false": "-", "true": ""}, prefix="/Zc:wchar_t", ) cl("EnablePREfast", map={"true": "/analyze"}) cl("AdditionalOptions", prefix="") cl( "EnableEnhancedInstructionSet", map={"1": "SSE", "2": "SSE2", "3": "AVX", "4": "IA32", "5": "AVX2"}, prefix="/arch:", ) cflags.extend( [ "/FI" + f for f in self._Setting( ("VCCLCompilerTool", "ForcedIncludeFiles"), config, default=[] ) ] ) if float(self.vs_version.project_version) >= 12.0: # New flag introduced in VS2013 (project version 12.0) Forces writes to # the program database (PDB) to be serialized through MSPDBSRV.EXE. # https://msdn.microsoft.com/en-us/library/dn502518.aspx cflags.append("/FS") # ninja handles parallelism by itself, don't have the compiler do it too. cflags = [x for x in cflags if not x.startswith("/MP")] return cflags def _GetPchFlags(self, config, extension): """Get the flags to be added to the cflags for precompiled header support.""" config = self._TargetConfig(config) # The PCH is only built once by a particular source file. Usage of PCH must # only be for the same language (i.e. C vs. C++), so only include the pch # flags when the language matches. if self.msvs_precompiled_header[config]: source_ext = os.path.splitext(self.msvs_precompiled_source[config])[1] if _LanguageMatchesForPch(source_ext, extension): pch = self.msvs_precompiled_header[config] pchbase = os.path.split(pch)[1] return ["/Yu" + pch, "/FI" + pch, "/Fp${pchprefix}." + pchbase + ".pch"] return [] def GetCflagsC(self, config): """Returns the flags that need to be added to .c compilations.""" config = self._TargetConfig(config) return self._GetPchFlags(config, ".c") def GetCflagsCC(self, config): """Returns the flags that need to be added to .cc compilations.""" config = self._TargetConfig(config) return ["/TP"] + self._GetPchFlags(config, ".cc") def _GetAdditionalLibraryDirectories(self, root, config, gyp_to_build_path): """Get and normalize the list of paths in AdditionalLibraryDirectories setting.""" config = self._TargetConfig(config) libpaths = self._Setting( (root, "AdditionalLibraryDirectories"), config, default=[] ) libpaths = [ os.path.normpath(gyp_to_build_path(self.ConvertVSMacros(p, config=config))) for p in libpaths ] return ['/LIBPATH:"' + p + '"' for p in libpaths] def GetLibFlags(self, config, gyp_to_build_path): """Returns the flags that need to be added to lib commands.""" config = self._TargetConfig(config) libflags = [] lib = self._GetWrapper( self, self.msvs_settings[config], "VCLibrarianTool", append=libflags ) libflags.extend( self._GetAdditionalLibraryDirectories( "VCLibrarianTool", config, gyp_to_build_path ) ) lib("LinkTimeCodeGeneration", map={"true": "/LTCG"}) lib( "TargetMachine", map={"1": "X86", "17": "X64", "3": "ARM"}, prefix="/MACHINE:", ) lib("AdditionalOptions") return libflags def GetDefFile(self, gyp_to_build_path): """Returns the .def file from sources, if any. Otherwise returns None.""" spec = self.spec if spec["type"] in ("shared_library", "loadable_module", "executable"): def_files = [ s for s in spec.get("sources", []) if s.lower().endswith(".def") ] if len(def_files) == 1: return gyp_to_build_path(def_files[0]) elif len(def_files) > 1: raise Exception("Multiple .def files") return None def _GetDefFileAsLdflags(self, ldflags, gyp_to_build_path): """.def files get implicitly converted to a ModuleDefinitionFile for the linker in the VS generator. Emulate that behaviour here.""" def_file = self.GetDefFile(gyp_to_build_path) if def_file: ldflags.append('/DEF:"%s"' % def_file) def GetPGDName(self, config, expand_special): """Gets the explicitly overridden pgd name for a target or returns None if it's not overridden.""" config = self._TargetConfig(config) output_file = self._Setting(("VCLinkerTool", "ProfileGuidedDatabase"), config) if output_file: output_file = expand_special( self.ConvertVSMacros(output_file, config=config) ) return output_file def GetLdflags( self, config, gyp_to_build_path, expand_special, manifest_base_name, output_name, is_executable, build_dir, ): """Returns the flags that need to be added to link commands, and the manifest files.""" config = self._TargetConfig(config) ldflags = [] ld = self._GetWrapper( self, self.msvs_settings[config], "VCLinkerTool", append=ldflags ) self._GetDefFileAsLdflags(ldflags, gyp_to_build_path) ld("GenerateDebugInformation", map={"true": "/DEBUG"}) # TODO: These 'map' values come from machineTypeOption enum, # and does not have an official value for ARM64 in VS2017 (yet). # It needs to verify the ARM64 value when machineTypeOption is updated. ld( "TargetMachine", map={"1": "X86", "17": "X64", "3": "ARM", "18": "ARM64"}, prefix="/MACHINE:", ) ldflags.extend( self._GetAdditionalLibraryDirectories( "VCLinkerTool", config, gyp_to_build_path ) ) ld("DelayLoadDLLs", prefix="/DELAYLOAD:") ld("TreatLinkerWarningAsErrors", prefix="/WX", map={"true": "", "false": ":NO"}) out = self.GetOutputName(config, expand_special) if out: ldflags.append("/OUT:" + out) pdb = self.GetPDBName(config, expand_special, output_name + ".pdb") if pdb: ldflags.append("/PDB:" + pdb) pgd = self.GetPGDName(config, expand_special) if pgd: ldflags.append("/PGD:" + pgd) map_file = self.GetMapFileName(config, expand_special) ld("GenerateMapFile", map={"true": "/MAP:" + map_file if map_file else "/MAP"}) ld("MapExports", map={"true": "/MAPINFO:EXPORTS"}) ld("AdditionalOptions", prefix="") minimum_required_version = self._Setting( ("VCLinkerTool", "MinimumRequiredVersion"), config, default="" ) if minimum_required_version: minimum_required_version = "," + minimum_required_version ld( "SubSystem", map={ "1": "CONSOLE%s" % minimum_required_version, "2": "WINDOWS%s" % minimum_required_version, }, prefix="/SUBSYSTEM:", ) stack_reserve_size = self._Setting( ("VCLinkerTool", "StackReserveSize"), config, default="" ) if stack_reserve_size: stack_commit_size = self._Setting( ("VCLinkerTool", "StackCommitSize"), config, default="" ) if stack_commit_size: stack_commit_size = "," + stack_commit_size ldflags.append(f"/STACK:{stack_reserve_size}{stack_commit_size}") ld("TerminalServerAware", map={"1": ":NO", "2": ""}, prefix="/TSAWARE") ld("LinkIncremental", map={"1": ":NO", "2": ""}, prefix="/INCREMENTAL") ld("BaseAddress", prefix="/BASE:") ld("FixedBaseAddress", map={"1": ":NO", "2": ""}, prefix="/FIXED") ld("RandomizedBaseAddress", map={"1": ":NO", "2": ""}, prefix="/DYNAMICBASE") ld("DataExecutionPrevention", map={"1": ":NO", "2": ""}, prefix="/NXCOMPAT") ld("OptimizeReferences", map={"1": "NOREF", "2": "REF"}, prefix="/OPT:") ld("ForceSymbolReferences", prefix="/INCLUDE:") ld("EnableCOMDATFolding", map={"1": "NOICF", "2": "ICF"}, prefix="/OPT:") ld( "LinkTimeCodeGeneration", map={"1": "", "2": ":PGINSTRUMENT", "3": ":PGOPTIMIZE", "4": ":PGUPDATE"}, prefix="/LTCG", ) ld("IgnoreDefaultLibraryNames", prefix="/NODEFAULTLIB:") ld("ResourceOnlyDLL", map={"true": "/NOENTRY"}) ld("EntryPointSymbol", prefix="/ENTRY:") ld("Profile", map={"true": "/PROFILE"}) ld("LargeAddressAware", map={"1": ":NO", "2": ""}, prefix="/LARGEADDRESSAWARE") # TODO(scottmg): This should sort of be somewhere else (not really a flag). ld("AdditionalDependencies", prefix="") if self.GetArch(config) == "x86": safeseh_default = "true" else: safeseh_default = None ld( "ImageHasSafeExceptionHandlers", map={"false": ":NO", "true": ""}, prefix="/SAFESEH", default=safeseh_default, ) # If the base address is not specifically controlled, DYNAMICBASE should # be on by default. if not any("DYNAMICBASE" in flag or flag == "/FIXED" for flag in ldflags): ldflags.append("/DYNAMICBASE") # If the NXCOMPAT flag has not been specified, default to on. Despite the # documentation that says this only defaults to on when the subsystem is # Vista or greater (which applies to the linker), the IDE defaults it on # unless it's explicitly off. if not any("NXCOMPAT" in flag for flag in ldflags): ldflags.append("/NXCOMPAT") have_def_file = any(flag.startswith("/DEF:") for flag in ldflags) ( manifest_flags, intermediate_manifest, manifest_files, ) = self._GetLdManifestFlags( config, manifest_base_name, gyp_to_build_path, is_executable and not have_def_file, build_dir, ) ldflags.extend(manifest_flags) return ldflags, intermediate_manifest, manifest_files def _GetLdManifestFlags( self, config, name, gyp_to_build_path, allow_isolation, build_dir ): """Returns a 3-tuple: - the set of flags that need to be added to the link to generate a default manifest - the intermediate manifest that the linker will generate that should be used to assert it doesn't add anything to the merged one. - the list of all the manifest files to be merged by the manifest tool and included into the link.""" generate_manifest = self._Setting( ("VCLinkerTool", "GenerateManifest"), config, default="true" ) if generate_manifest != "true": # This means not only that the linker should not generate the intermediate # manifest but also that the manifest tool should do nothing even when # additional manifests are specified. return ["/MANIFEST:NO"], [], [] output_name = name + ".intermediate.manifest" flags = [ "/MANIFEST", "/ManifestFile:" + output_name, ] # Instead of using the MANIFESTUAC flags, we generate a .manifest to # include into the list of manifests. This allows us to avoid the need to # do two passes during linking. The /MANIFEST flag and /ManifestFile are # still used, and the intermediate manifest is used to assert that the # final manifest we get from merging all the additional manifest files # (plus the one we generate here) isn't modified by merging the # intermediate into it. # Always NO, because we generate a manifest file that has what we want. flags.append("/MANIFESTUAC:NO") config = self._TargetConfig(config) enable_uac = self._Setting( ("VCLinkerTool", "EnableUAC"), config, default="true" ) manifest_files = [] generated_manifest_outer = ( "" "" "%s" ) if enable_uac == "true": execution_level = self._Setting( ("VCLinkerTool", "UACExecutionLevel"), config, default="0" ) execution_level_map = { "0": "asInvoker", "1": "highestAvailable", "2": "requireAdministrator", } ui_access = self._Setting( ("VCLinkerTool", "UACUIAccess"), config, default="false" ) inner = """ """.format( execution_level_map[execution_level], ui_access, ) else: inner = "" generated_manifest_contents = generated_manifest_outer % inner generated_name = name + ".generated.manifest" # Need to join with the build_dir here as we're writing it during # generation time, but we return the un-joined version because the build # will occur in that directory. We only write the file if the contents # have changed so that simply regenerating the project files doesn't # cause a relink. build_dir_generated_name = os.path.join(build_dir, generated_name) gyp.common.EnsureDirExists(build_dir_generated_name) f = gyp.common.WriteOnDiff(build_dir_generated_name) f.write(generated_manifest_contents) f.close() manifest_files = [generated_name] if allow_isolation: flags.append("/ALLOWISOLATION") manifest_files += self._GetAdditionalManifestFiles(config, gyp_to_build_path) return flags, output_name, manifest_files def _GetAdditionalManifestFiles(self, config, gyp_to_build_path): """Gets additional manifest files that are added to the default one generated by the linker.""" files = self._Setting( ("VCManifestTool", "AdditionalManifestFiles"), config, default=[] ) if isinstance(files, str): files = files.split(";") return [ os.path.normpath(gyp_to_build_path(self.ConvertVSMacros(f, config=config))) for f in files ] def IsUseLibraryDependencyInputs(self, config): """Returns whether the target should be linked via Use Library Dependency Inputs (using component .objs of a given .lib).""" config = self._TargetConfig(config) uldi = self._Setting(("VCLinkerTool", "UseLibraryDependencyInputs"), config) return uldi == "true" def IsEmbedManifest(self, config): """Returns whether manifest should be linked into binary.""" config = self._TargetConfig(config) embed = self._Setting( ("VCManifestTool", "EmbedManifest"), config, default="true" ) return embed == "true" def IsLinkIncremental(self, config): """Returns whether the target should be linked incrementally.""" config = self._TargetConfig(config) link_inc = self._Setting(("VCLinkerTool", "LinkIncremental"), config) return link_inc != "1" def GetRcflags(self, config, gyp_to_ninja_path): """Returns the flags that need to be added to invocations of the resource compiler.""" config = self._TargetConfig(config) rcflags = [] rc = self._GetWrapper( self, self.msvs_settings[config], "VCResourceCompilerTool", append=rcflags ) rc("AdditionalIncludeDirectories", map=gyp_to_ninja_path, prefix="/I") rcflags.append("/I" + gyp_to_ninja_path(".")) rc("PreprocessorDefinitions", prefix="/d") # /l arg must be in hex without leading '0x' rc("Culture", prefix="/l", map=lambda x: hex(int(x))[2:]) return rcflags def BuildCygwinBashCommandLine(self, args, path_to_base): """Build a command line that runs args via cygwin bash. We assume that all incoming paths are in Windows normpath'd form, so they need to be converted to posix style for the part of the command line that's passed to bash. We also have to do some Visual Studio macro emulation here because various rules use magic VS names for things. Also note that rules that contain ninja variables cannot be fixed here (for example ${source}), so the outer generator needs to make sure that the paths that are written out are in posix style, if the command line will be used here.""" cygwin_dir = os.path.normpath( os.path.join(path_to_base, self.msvs_cygwin_dirs[0]) ) cd = ("cd %s" % path_to_base).replace("\\", "/") args = [a.replace("\\", "/").replace('"', '\\"') for a in args] args = ["'%s'" % a.replace("'", "'\\''") for a in args] bash_cmd = " ".join(args) cmd = ( 'call "%s\\setup_env.bat" && set CYGWIN=nontsec && ' % cygwin_dir + f'bash -c "{cd} ; {bash_cmd}"' ) return cmd RuleShellFlags = collections.namedtuple("RuleShellFlags", ["cygwin", "quote"]) def GetRuleShellFlags(self, rule): """Return RuleShellFlags about how the given rule should be run. This includes whether it should run under cygwin (msvs_cygwin_shell), and whether the commands should be quoted (msvs_quote_cmd).""" # If the variable is unset, or set to 1 we use cygwin cygwin = int(rule.get("msvs_cygwin_shell", self.spec.get("msvs_cygwin_shell", 1))) != 0 # Default to quoting. There's only a few special instances where the # target command uses non-standard command line parsing and handle quotes # and quote escaping differently. quote_cmd = int(rule.get("msvs_quote_cmd", 1)) assert quote_cmd != 0 or cygwin != 1, \ "msvs_quote_cmd=0 only applicable for msvs_cygwin_shell=0" return MsvsSettings.RuleShellFlags(cygwin, quote_cmd) def _HasExplicitRuleForExtension(self, spec, extension): """Determine if there's an explicit rule for a particular extension.""" for rule in spec.get("rules", []): if rule["extension"] == extension: return True return False def _HasExplicitIdlActions(self, spec): """Determine if an action should not run midl for .idl files.""" return any( [action.get("explicit_idl_action", 0) for action in spec.get("actions", [])] ) def HasExplicitIdlRulesOrActions(self, spec): """Determine if there's an explicit rule or action for idl files. When there isn't we need to generate implicit rules to build MIDL .idl files.""" return self._HasExplicitRuleForExtension( spec, "idl" ) or self._HasExplicitIdlActions(spec) def HasExplicitAsmRules(self, spec): """Determine if there's an explicit rule for asm files. When there isn't we need to generate implicit rules to assemble .asm files.""" return self._HasExplicitRuleForExtension(spec, "asm") def GetIdlBuildData(self, source, config): """Determine the implicit outputs for an idl file. Returns output directory, outputs, and variables and flags that are required.""" config = self._TargetConfig(config) midl_get = self._GetWrapper(self, self.msvs_settings[config], "VCMIDLTool") def midl(name, default=None): return self.ConvertVSMacros(midl_get(name, default=default), config=config) tlb = midl("TypeLibraryName", default="${root}.tlb") header = midl("HeaderFileName", default="${root}.h") dlldata = midl("DLLDataFileName", default="dlldata.c") iid = midl("InterfaceIdentifierFileName", default="${root}_i.c") proxy = midl("ProxyFileName", default="${root}_p.c") # Note that .tlb is not included in the outputs as it is not always # generated depending on the content of the input idl file. outdir = midl("OutputDirectory", default="") output = [header, dlldata, iid, proxy] variables = [ ("tlb", tlb), ("h", header), ("dlldata", dlldata), ("iid", iid), ("proxy", proxy), ] # TODO(scottmg): Are there configuration settings to set these flags? target_platform = self.GetArch(config) if target_platform == "x86": target_platform = "win32" flags = ["/char", "signed", "/env", target_platform, "/Oicf"] return outdir, output, variables, flags def _LanguageMatchesForPch(source_ext, pch_source_ext): c_exts = (".c",) cc_exts = (".cc", ".cxx", ".cpp") return (source_ext in c_exts and pch_source_ext in c_exts) or ( source_ext in cc_exts and pch_source_ext in cc_exts ) class PrecompiledHeader: """Helper to generate dependencies and build rules to handle generation of precompiled headers. Interface matches the GCH handler in xcode_emulation.py. """ def __init__( self, settings, config, gyp_to_build_path, gyp_to_unique_output, obj_ext ): self.settings = settings self.config = config pch_source = self.settings.msvs_precompiled_source[self.config] self.pch_source = gyp_to_build_path(pch_source) filename, _ = os.path.splitext(pch_source) self.output_obj = gyp_to_unique_output(filename + obj_ext).lower() def _PchHeader(self): """Get the header that will appear in an #include line for all source files.""" return self.settings.msvs_precompiled_header[self.config] def GetObjDependencies(self, sources, objs, arch): """Given a list of sources files and the corresponding object files, returns a list of the pch files that should be depended upon. The additional wrapping in the return value is for interface compatibility with make.py on Mac, and xcode_emulation.py.""" assert arch is None if not self._PchHeader(): return [] pch_ext = os.path.splitext(self.pch_source)[1] for source in sources: if _LanguageMatchesForPch(os.path.splitext(source)[1], pch_ext): return [(None, None, self.output_obj)] return [] def GetPchBuildCommands(self, arch): """Not used on Windows as there are no additional build steps required (instead, existing steps are modified in GetFlagsModifications below).""" return [] def GetFlagsModifications( self, input, output, implicit, command, cflags_c, cflags_cc, expand_special ): """Get the modified cflags and implicit dependencies that should be used for the pch compilation step.""" if input == self.pch_source: pch_output = ["/Yc" + self._PchHeader()] if command == "cxx": return ( [("cflags_cc", map(expand_special, cflags_cc + pch_output))], self.output_obj, [], ) elif command == "cc": return ( [("cflags_c", map(expand_special, cflags_c + pch_output))], self.output_obj, [], ) return [], output, implicit vs_version = None def GetVSVersion(generator_flags): global vs_version if not vs_version: vs_version = gyp.MSVSVersion.SelectVisualStudioVersion( generator_flags.get("msvs_version", "auto"), allow_fallback=False ) return vs_version def _GetVsvarsSetupArgs(generator_flags, arch): vs = GetVSVersion(generator_flags) return vs.SetupScript() def ExpandMacros(string, expansions): """Expand $(Variable) per expansions dict. See MsvsSettings.GetVSMacroEnv for the canonical way to retrieve a suitable dict.""" if "$" in string: for old, new in expansions.items(): assert "$(" not in new, new string = string.replace(old, new) return string def _ExtractImportantEnvironment(output_of_set): """Extracts environment variables required for the toolchain to run from a textual dump output by the cmd.exe 'set' command.""" envvars_to_save = ( "goma_.*", # TODO(scottmg): This is ugly, but needed for goma. "include", "lib", "libpath", "path", "pathext", "systemroot", "temp", "tmp", ) env = {} # This occasionally happens and leads to misleading SYSTEMROOT error messages # if not caught here. if output_of_set.count("=") == 0: raise Exception("Invalid output_of_set. Value is:\n%s" % output_of_set) for line in output_of_set.splitlines(): for envvar in envvars_to_save: if re.match(envvar + "=", line.lower()): var, setting = line.split("=", 1) if envvar == "path": # Our own rules (for running gyp-win-tool) and other actions in # Chromium rely on python being in the path. Add the path to this # python here so that if it's not in the path when ninja is run # later, python will still be found. setting = os.path.dirname(sys.executable) + os.pathsep + setting env[var.upper()] = setting break for required in ("SYSTEMROOT", "TEMP", "TMP"): if required not in env: raise Exception( 'Environment variable "%s" ' "required to be set to valid path" % required ) return env def _FormatAsEnvironmentBlock(envvar_dict): """Format as an 'environment block' directly suitable for CreateProcess. Briefly this is a list of key=value\0, terminated by an additional \0. See CreateProcess documentation for more details.""" block = "" nul = "\0" for key, value in envvar_dict.items(): block += key + "=" + value + nul block += nul return block def _ExtractCLPath(output_of_where): """Gets the path to cl.exe based on the output of calling the environment setup batch file, followed by the equivalent of `where`.""" # Take the first line, as that's the first found in the PATH. for line in output_of_where.strip().splitlines(): if line.startswith("LOC:"): return line[len("LOC:") :].strip() def GenerateEnvironmentFiles( toplevel_build_dir, generator_flags, system_includes, open_out ): """It's not sufficient to have the absolute path to the compiler, linker, etc. on Windows, as those tools rely on .dlls being in the PATH. We also need to support both x86 and x64 compilers within the same build (to support msvs_target_platform hackery). Different architectures require a different compiler binary, and different supporting environment variables (INCLUDE, LIB, LIBPATH). So, we extract the environment here, wrap all invocations of compiler tools (cl, link, lib, rc, midl, etc.) via win_tool.py which sets up the environment, and then we do not prefix the compiler with an absolute path, instead preferring something like "cl.exe" in the rule which will then run whichever the environment setup has put in the path. When the following procedure to generate environment files does not meet your requirement (e.g. for custom toolchains), you can pass "-G ninja_use_custom_environment_files" to the gyp to suppress file generation and use custom environment files prepared by yourself.""" archs = ("x86", "x64") if generator_flags.get("ninja_use_custom_environment_files", 0): cl_paths = {} for arch in archs: cl_paths[arch] = "cl.exe" return cl_paths vs = GetVSVersion(generator_flags) cl_paths = {} for arch in archs: # Extract environment variables for subprocesses. args = vs.SetupScript(arch) args.extend(("&&", "set")) popen = subprocess.Popen( args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT ) variables = popen.communicate()[0].decode("utf-8") if popen.returncode != 0: raise Exception('"%s" failed with error %d' % (args, popen.returncode)) env = _ExtractImportantEnvironment(variables) # Inject system includes from gyp files into INCLUDE. if system_includes: system_includes = system_includes | OrderedSet( env.get("INCLUDE", "").split(";") ) env["INCLUDE"] = ";".join(system_includes) env_block = _FormatAsEnvironmentBlock(env) f = open_out(os.path.join(toplevel_build_dir, "environment." + arch), "w") f.write(env_block) f.close() # Find cl.exe location for this architecture. args = vs.SetupScript(arch) args.extend( ("&&", "for", "%i", "in", "(cl.exe)", "do", "@echo", "LOC:%~$PATH:i") ) popen = subprocess.Popen(args, shell=True, stdout=subprocess.PIPE) output = popen.communicate()[0].decode("utf-8") cl_paths[arch] = _ExtractCLPath(output) return cl_paths def VerifyMissingSources(sources, build_dir, generator_flags, gyp_to_ninja): """Emulate behavior of msvs_error_on_missing_sources present in the msvs generator: Check that all regular source files, i.e. not created at run time, exist on disk. Missing files cause needless recompilation when building via VS, and we want this check to match for people/bots that build using ninja, so they're not surprised when the VS build fails.""" if int(generator_flags.get("msvs_error_on_missing_sources", 0)): no_specials = filter(lambda x: "$" not in x, sources) relative = [os.path.join(build_dir, gyp_to_ninja(s)) for s in no_specials] missing = [x for x in relative if not os.path.exists(x)] if missing: # They'll look like out\Release\..\..\stuff\things.cc, so normalize the # path for a slightly less crazy looking output. cleaned_up = [os.path.normpath(x) for x in missing] raise Exception("Missing input files:\n%s" % "\n".join(cleaned_up)) # Sets some values in default_variables, which are required for many # generators, run on Windows. def CalculateCommonVariables(default_variables, params): generator_flags = params.get("generator_flags", {}) # Set a variable so conditions can be based on msvs_version. msvs_version = gyp.msvs_emulation.GetVSVersion(generator_flags) default_variables["MSVS_VERSION"] = msvs_version.ShortName() # To determine processor word size on Windows, in addition to checking # PROCESSOR_ARCHITECTURE (which reflects the word size of the current # process), it is also necessary to check PROCESSOR_ARCHITEW6432 (which # contains the actual word size of the system when running thru WOW64). if "64" in os.environ.get("PROCESSOR_ARCHITECTURE", "") or "64" in os.environ.get( "PROCESSOR_ARCHITEW6432", "" ): default_variables["MSVS_OS_BITS"] = 64 else: default_variables["MSVS_OS_BITS"] = 32 # This file comes from # https://github.com/martine/ninja/blob/master/misc/ninja_syntax.py # Do not edit! Edit the upstream one instead. """Python module for generating .ninja files. Note that this is emphatically not a required piece of Ninja; it's just a helpful utility for build-file-generation systems that already use Python. """ import textwrap def escape_path(word): return word.replace("$ ", "$$ ").replace(" ", "$ ").replace(":", "$:") class Writer: def __init__(self, output, width=78): self.output = output self.width = width def newline(self): self.output.write("\n") def comment(self, text): for line in textwrap.wrap(text, self.width - 2): self.output.write("# " + line + "\n") def variable(self, key, value, indent=0): if value is None: return if isinstance(value, list): value = " ".join(filter(None, value)) # Filter out empty strings. self._line(f"{key} = {value}", indent) def pool(self, name, depth): self._line("pool %s" % name) self.variable("depth", depth, indent=1) def rule( self, name, command, description=None, depfile=None, generator=False, pool=None, restat=False, rspfile=None, rspfile_content=None, deps=None, ): self._line("rule %s" % name) self.variable("command", command, indent=1) if description: self.variable("description", description, indent=1) if depfile: self.variable("depfile", depfile, indent=1) if generator: self.variable("generator", "1", indent=1) if pool: self.variable("pool", pool, indent=1) if restat: self.variable("restat", "1", indent=1) if rspfile: self.variable("rspfile", rspfile, indent=1) if rspfile_content: self.variable("rspfile_content", rspfile_content, indent=1) if deps: self.variable("deps", deps, indent=1) def build( self, outputs, rule, inputs=None, implicit=None, order_only=None, variables=None ): outputs = self._as_list(outputs) all_inputs = self._as_list(inputs)[:] out_outputs = list(map(escape_path, outputs)) all_inputs = list(map(escape_path, all_inputs)) if implicit: implicit = map(escape_path, self._as_list(implicit)) all_inputs.append("|") all_inputs.extend(implicit) if order_only: order_only = map(escape_path, self._as_list(order_only)) all_inputs.append("||") all_inputs.extend(order_only) self._line( "build {}: {}".format(" ".join(out_outputs), " ".join([rule] + all_inputs)) ) if variables: if isinstance(variables, dict): iterator = iter(variables.items()) else: iterator = iter(variables) for key, val in iterator: self.variable(key, val, indent=1) return outputs def include(self, path): self._line("include %s" % path) def subninja(self, path): self._line("subninja %s" % path) def default(self, paths): self._line("default %s" % " ".join(self._as_list(paths))) def _count_dollars_before_index(self, s, i): """Returns the number of '$' characters right in front of s[i].""" dollar_count = 0 dollar_index = i - 1 while dollar_index > 0 and s[dollar_index] == "$": dollar_count += 1 dollar_index -= 1 return dollar_count def _line(self, text, indent=0): """Write 'text' word-wrapped at self.width characters.""" leading_space = " " * indent while len(leading_space) + len(text) > self.width: # The text is too wide; wrap if possible. # Find the rightmost space that would obey our width constraint and # that's not an escaped space. available_space = self.width - len(leading_space) - len(" $") space = available_space while True: space = text.rfind(" ", 0, space) if space < 0 or self._count_dollars_before_index(text, space) % 2 == 0: break if space < 0: # No such space; just use the first unescaped space we can find. space = available_space - 1 while True: space = text.find(" ", space + 1) if ( space < 0 or self._count_dollars_before_index(text, space) % 2 == 0 ): break if space < 0: # Give up on breaking. break self.output.write(leading_space + text[0:space] + " $\n") text = text[space + 1 :] # Subsequent lines are continuations, so indent them. leading_space = " " * (indent + 2) self.output.write(leading_space + text + "\n") def _as_list(self, input): if input is None: return [] if isinstance(input, list): return input return [input] def escape(string): """Escape a string such that it can be embedded into a Ninja file without further interpretation.""" assert "\n" not in string, "Ninja syntax does not allow newlines" # We only have one special metacharacter: '$'. return string.replace("$", "$$") # Copyright 2014 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A clone of the default copy.deepcopy that doesn't handle cyclic structures or complex types except for dicts and lists. This is because gyp copies so large structure that small copy overhead ends up taking seconds in a project the size of Chromium.""" class Error(Exception): pass __all__ = ["Error", "deepcopy"] def deepcopy(x): """Deep copy operation on gyp objects such as strings, ints, dicts and lists. More than twice as fast as copy.deepcopy but much less generic.""" try: return _deepcopy_dispatch[type(x)](x) except KeyError: raise Error( "Unsupported type %s for deepcopy. Use copy.deepcopy " + "or expand simple_copy support." % type(x) ) _deepcopy_dispatch = d = {} def _deepcopy_atomic(x): return x types = bool, float, int, str, type, type(None) for x in types: d[x] = _deepcopy_atomic def _deepcopy_list(x): return [deepcopy(a) for a in x] d[list] = _deepcopy_list def _deepcopy_dict(x): y = {} for key, value in x.items(): y[deepcopy(key)] = deepcopy(value) return y d[dict] = _deepcopy_dict del d #!/usr/bin/env python3 # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utility functions for Windows builds. These functions are executed via gyp-win-tool when using the ninja generator. """ import os import re import shutil import subprocess import stat import string import sys BASE_DIR = os.path.dirname(os.path.abspath(__file__)) # A regex matching an argument corresponding to the output filename passed to # link.exe. _LINK_EXE_OUT_ARG = re.compile("/OUT:(?P.+)$", re.IGNORECASE) def main(args): executor = WinTool() exit_code = executor.Dispatch(args) if exit_code is not None: sys.exit(exit_code) class WinTool: """This class performs all the Windows tooling steps. The methods can either be executed directly, or dispatched from an argument list.""" def _UseSeparateMspdbsrv(self, env, args): """Allows to use a unique instance of mspdbsrv.exe per linker instead of a shared one.""" if len(args) < 1: raise Exception("Not enough arguments") if args[0] != "link.exe": return # Use the output filename passed to the linker to generate an endpoint name # for mspdbsrv.exe. endpoint_name = None for arg in args: m = _LINK_EXE_OUT_ARG.match(arg) if m: endpoint_name = re.sub( r"\W+", "", "%s_%d" % (m.group("out"), os.getpid()) ) break if endpoint_name is None: return # Adds the appropriate environment variable. This will be read by link.exe # to know which instance of mspdbsrv.exe it should connect to (if it's # not set then the default endpoint is used). env["_MSPDBSRV_ENDPOINT_"] = endpoint_name def Dispatch(self, args): """Dispatches a string command to a method.""" if len(args) < 1: raise Exception("Not enough arguments") method = "Exec%s" % self._CommandifyName(args[0]) return getattr(self, method)(*args[1:]) def _CommandifyName(self, name_string): """Transforms a tool name like recursive-mirror to RecursiveMirror.""" return name_string.title().replace("-", "") def _GetEnv(self, arch): """Gets the saved environment from a file for a given architecture.""" # The environment is saved as an "environment block" (see CreateProcess # and msvs_emulation for details). We convert to a dict here. # Drop last 2 NULs, one for list terminator, one for trailing vs. separator. pairs = open(arch).read()[:-2].split("\0") kvs = [item.split("=", 1) for item in pairs] return dict(kvs) def ExecStamp(self, path): """Simple stamp command.""" open(path, "w").close() def ExecRecursiveMirror(self, source, dest): """Emulation of rm -rf out && cp -af in out.""" if os.path.exists(dest): if os.path.isdir(dest): def _on_error(fn, path, excinfo): # The operation failed, possibly because the file is set to # read-only. If that's why, make it writable and try the op again. if not os.access(path, os.W_OK): os.chmod(path, stat.S_IWRITE) fn(path) shutil.rmtree(dest, onerror=_on_error) else: if not os.access(dest, os.W_OK): # Attempt to make the file writable before deleting it. os.chmod(dest, stat.S_IWRITE) os.unlink(dest) if os.path.isdir(source): shutil.copytree(source, dest) else: shutil.copy2(source, dest) def ExecLinkWrapper(self, arch, use_separate_mspdbsrv, *args): """Filter diagnostic output from link that looks like: ' Creating library ui.dll.lib and object ui.dll.exp' This happens when there are exports from the dll or exe. """ env = self._GetEnv(arch) if use_separate_mspdbsrv == "True": self._UseSeparateMspdbsrv(env, args) if sys.platform == "win32": args = list(args) # *args is a tuple by default, which is read-only. args[0] = args[0].replace("/", "\\") # https://docs.python.org/2/library/subprocess.html: # "On Unix with shell=True [...] if args is a sequence, the first item # specifies the command string, and any additional items will be treated as # additional arguments to the shell itself. That is to say, Popen does the # equivalent of: # Popen(['/bin/sh', '-c', args[0], args[1], ...])" # For that reason, since going through the shell doesn't seem necessary on # non-Windows don't do that there. link = subprocess.Popen( args, shell=sys.platform == "win32", env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, ) out = link.communicate()[0].decode("utf-8") for line in out.splitlines(): if ( not line.startswith(" Creating library ") and not line.startswith("Generating code") and not line.startswith("Finished generating code") ): print(line) return link.returncode def ExecLinkWithManifests( self, arch, embed_manifest, out, ldcmd, resname, mt, rc, intermediate_manifest, *manifests ): """A wrapper for handling creating a manifest resource and then executing a link command.""" # The 'normal' way to do manifests is to have link generate a manifest # based on gathering dependencies from the object files, then merge that # manifest with other manifests supplied as sources, convert the merged # manifest to a resource, and then *relink*, including the compiled # version of the manifest resource. This breaks incremental linking, and # is generally overly complicated. Instead, we merge all the manifests # provided (along with one that includes what would normally be in the # linker-generated one, see msvs_emulation.py), and include that into the # first and only link. We still tell link to generate a manifest, but we # only use that to assert that our simpler process did not miss anything. variables = { "python": sys.executable, "arch": arch, "out": out, "ldcmd": ldcmd, "resname": resname, "mt": mt, "rc": rc, "intermediate_manifest": intermediate_manifest, "manifests": " ".join(manifests), } add_to_ld = "" if manifests: subprocess.check_call( "%(python)s gyp-win-tool manifest-wrapper %(arch)s %(mt)s -nologo " "-manifest %(manifests)s -out:%(out)s.manifest" % variables ) if embed_manifest == "True": subprocess.check_call( "%(python)s gyp-win-tool manifest-to-rc %(arch)s %(out)s.manifest" " %(out)s.manifest.rc %(resname)s" % variables ) subprocess.check_call( "%(python)s gyp-win-tool rc-wrapper %(arch)s %(rc)s " "%(out)s.manifest.rc" % variables ) add_to_ld = " %(out)s.manifest.res" % variables subprocess.check_call(ldcmd + add_to_ld) # Run mt.exe on the theoretically complete manifest we generated, merging # it with the one the linker generated to confirm that the linker # generated one does not add anything. This is strictly unnecessary for # correctness, it's only to verify that e.g. /MANIFESTDEPENDENCY was not # used in a #pragma comment. if manifests: # Merge the intermediate one with ours to .assert.manifest, then check # that .assert.manifest is identical to ours. subprocess.check_call( "%(python)s gyp-win-tool manifest-wrapper %(arch)s %(mt)s -nologo " "-manifest %(out)s.manifest %(intermediate_manifest)s " "-out:%(out)s.assert.manifest" % variables ) assert_manifest = "%(out)s.assert.manifest" % variables our_manifest = "%(out)s.manifest" % variables # Load and normalize the manifests. mt.exe sometimes removes whitespace, # and sometimes doesn't unfortunately. with open(our_manifest) as our_f: with open(assert_manifest) as assert_f: translator = str.maketrans('', '', string.whitespace) our_data = our_f.read().translate(translator) assert_data = assert_f.read().translate(translator) if our_data != assert_data: os.unlink(out) def dump(filename): print(filename, file=sys.stderr) print("-----", file=sys.stderr) with open(filename) as f: print(f.read(), file=sys.stderr) print("-----", file=sys.stderr) dump(intermediate_manifest) dump(our_manifest) dump(assert_manifest) sys.stderr.write( 'Linker generated manifest "%s" added to final manifest "%s" ' '(result in "%s"). ' "Were /MANIFEST switches used in #pragma statements? " % (intermediate_manifest, our_manifest, assert_manifest) ) return 1 def ExecManifestWrapper(self, arch, *args): """Run manifest tool with environment set. Strip out undesirable warning (some XML blocks are recognized by the OS loader, but not the manifest tool).""" env = self._GetEnv(arch) popen = subprocess.Popen( args, shell=True, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT ) out = popen.communicate()[0].decode("utf-8") for line in out.splitlines(): if line and "manifest authoring warning 81010002" not in line: print(line) return popen.returncode def ExecManifestToRc(self, arch, *args): """Creates a resource file pointing a SxS assembly manifest. |args| is tuple containing path to resource file, path to manifest file and resource name which can be "1" (for executables) or "2" (for DLLs).""" manifest_path, resource_path, resource_name = args with open(resource_path, "w") as output: output.write( '#include \n%s RT_MANIFEST "%s"' % (resource_name, os.path.abspath(manifest_path).replace("\\", "/")) ) def ExecMidlWrapper(self, arch, outdir, tlb, h, dlldata, iid, proxy, idl, *flags): """Filter noisy filenames output from MIDL compile step that isn't quietable via command line flags. """ args = ( ["midl", "/nologo"] + list(flags) + [ "/out", outdir, "/tlb", tlb, "/h", h, "/dlldata", dlldata, "/iid", iid, "/proxy", proxy, idl, ] ) env = self._GetEnv(arch) popen = subprocess.Popen( args, shell=True, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT ) out = popen.communicate()[0].decode("utf-8") # Filter junk out of stdout, and write filtered versions. Output we want # to filter is pairs of lines that look like this: # Processing C:\Program Files (x86)\Microsoft SDKs\...\include\objidl.idl # objidl.idl lines = out.splitlines() prefixes = ("Processing ", "64 bit Processing ") processing = {os.path.basename(x) for x in lines if x.startswith(prefixes)} for line in lines: if not line.startswith(prefixes) and line not in processing: print(line) return popen.returncode def ExecAsmWrapper(self, arch, *args): """Filter logo banner from invocations of asm.exe.""" env = self._GetEnv(arch) popen = subprocess.Popen( args, shell=True, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT ) out = popen.communicate()[0].decode("utf-8") for line in out.splitlines(): if ( not line.startswith("Copyright (C) Microsoft Corporation") and not line.startswith("Microsoft (R) Macro Assembler") and not line.startswith(" Assembling: ") and line ): print(line) return popen.returncode def ExecRcWrapper(self, arch, *args): """Filter logo banner from invocations of rc.exe. Older versions of RC don't support the /nologo flag.""" env = self._GetEnv(arch) popen = subprocess.Popen( args, shell=True, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT ) out = popen.communicate()[0].decode("utf-8") for line in out.splitlines(): if ( not line.startswith("Microsoft (R) Windows (R) Resource Compiler") and not line.startswith("Copyright (C) Microsoft Corporation") and line ): print(line) return popen.returncode def ExecActionWrapper(self, arch, rspfile, *dir): """Runs an action command line from a response file using the environment for |arch|. If |dir| is supplied, use that as the working directory.""" env = self._GetEnv(arch) # TODO(scottmg): This is a temporary hack to get some specific variables # through to actions that are set after gyp-time. http://crbug.com/333738. for k, v in os.environ.items(): if k not in env: env[k] = v args = open(rspfile).read() dir = dir[0] if dir else None return subprocess.call(args, shell=True, env=env, cwd=dir) def ExecClCompile(self, project_dir, selected_files): """Executed by msvs-ninja projects when the 'ClCompile' target is used to build selected C/C++ files.""" project_dir = os.path.relpath(project_dir, BASE_DIR) selected_files = selected_files.split(";") ninja_targets = [ os.path.join(project_dir, filename) + "^^" for filename in selected_files ] cmd = ["ninja.exe"] cmd.extend(ninja_targets) return subprocess.call(cmd, shell=True, cwd=BASE_DIR) if __name__ == "__main__": sys.exit(main(sys.argv[1:])) # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Xcode project file generator. This module is both an Xcode project file generator and a documentation of the Xcode project file format. Knowledge of the project file format was gained based on extensive experience with Xcode, and by making changes to projects in Xcode.app and observing the resultant changes in the associated project files. XCODE PROJECT FILES The generator targets the file format as written by Xcode 3.2 (specifically, 3.2.6), but past experience has taught that the format has not changed significantly in the past several years, and future versions of Xcode are able to read older project files. Xcode project files are "bundled": the project "file" from an end-user's perspective is actually a directory with an ".xcodeproj" extension. The project file from this module's perspective is actually a file inside this directory, always named "project.pbxproj". This file contains a complete description of the project and is all that is needed to use the xcodeproj. Other files contained in the xcodeproj directory are simply used to store per-user settings, such as the state of various UI elements in the Xcode application. The project.pbxproj file is a property list, stored in a format almost identical to the NeXTstep property list format. The file is able to carry Unicode data, and is encoded in UTF-8. The root element in the property list is a dictionary that contains several properties of minimal interest, and two properties of immense interest. The most important property is a dictionary named "objects". The entire structure of the project is represented by the children of this property. The objects dictionary is keyed by unique 96-bit values represented by 24 uppercase hexadecimal characters. Each value in the objects dictionary is itself a dictionary, describing an individual object. Each object in the dictionary is a member of a class, which is identified by the "isa" property of each object. A variety of classes are represented in a project file. Objects can refer to other objects by ID, using the 24-character hexadecimal object key. A project's objects form a tree, with a root object of class PBXProject at the root. As an example, the PBXProject object serves as parent to an XCConfigurationList object defining the build configurations used in the project, a PBXGroup object serving as a container for all files referenced in the project, and a list of target objects, each of which defines a target in the project. There are several different types of target object, such as PBXNativeTarget and PBXAggregateTarget. In this module, this relationship is expressed by having each target type derive from an abstract base named XCTarget. The project.pbxproj file's root dictionary also contains a property, sibling to the "objects" dictionary, named "rootObject". The value of rootObject is a 24-character object key referring to the root PBXProject object in the objects dictionary. In Xcode, every file used as input to a target or produced as a final product of a target must appear somewhere in the hierarchy rooted at the PBXGroup object referenced by the PBXProject's mainGroup property. A PBXGroup is generally represented as a folder in the Xcode application. PBXGroups can contain other PBXGroups as well as PBXFileReferences, which are pointers to actual files. Each XCTarget contains a list of build phases, represented in this module by the abstract base XCBuildPhase. Examples of concrete XCBuildPhase derivations are PBXSourcesBuildPhase and PBXFrameworksBuildPhase, which correspond to the "Compile Sources" and "Link Binary With Libraries" phases displayed in the Xcode application. Files used as input to these phases (for example, source files in the former case and libraries and frameworks in the latter) are represented by PBXBuildFile objects, referenced by elements of "files" lists in XCTarget objects. Each PBXBuildFile object refers to a PBXBuildFile object as a "weak" reference: it does not "own" the PBXBuildFile, which is owned by the root object's mainGroup or a descendant group. In most cases, the layer of indirection between an XCBuildPhase and a PBXFileReference via a PBXBuildFile appears extraneous, but there's actually one reason for this: file-specific compiler flags are added to the PBXBuildFile object so as to allow a single file to be a member of multiple targets while having distinct compiler flags for each. These flags can be modified in the Xcode applciation in the "Build" tab of a File Info window. When a project is open in the Xcode application, Xcode will rewrite it. As such, this module is careful to adhere to the formatting used by Xcode, to avoid insignificant changes appearing in the file when it is used in the Xcode application. This will keep version control repositories happy, and makes it possible to compare a project file used in Xcode to one generated by this module to determine if any significant changes were made in the application. Xcode has its own way of assigning 24-character identifiers to each object, which is not duplicated here. Because the identifier only is only generated once, when an object is created, and is then left unchanged, there is no need to attempt to duplicate Xcode's behavior in this area. The generator is free to select any identifier, even at random, to refer to the objects it creates, and Xcode will retain those identifiers and use them when subsequently rewriting the project file. However, the generator would choose new random identifiers each time the project files are generated, leading to difficulties comparing "used" project files to "pristine" ones produced by this module, and causing the appearance of changes as every object identifier is changed when updated projects are checked in to a version control repository. To mitigate this problem, this module chooses identifiers in a more deterministic way, by hashing a description of each object as well as its parent and ancestor objects. This strategy should result in minimal "shift" in IDs as successive generations of project files are produced. THIS MODULE This module introduces several classes, all derived from the XCObject class. Nearly all of the "brains" are built into the XCObject class, which understands how to create and modify objects, maintain the proper tree structure, compute identifiers, and print objects. For the most part, classes derived from XCObject need only provide a _schema class object, a dictionary that expresses what properties objects of the class may contain. Given this structure, it's possible to build a minimal project file by creating objects of the appropriate types and making the proper connections: config_list = XCConfigurationList() group = PBXGroup() project = PBXProject({'buildConfigurationList': config_list, 'mainGroup': group}) With the project object set up, it can be added to an XCProjectFile object. XCProjectFile is a pseudo-class in the sense that it is a concrete XCObject subclass that does not actually correspond to a class type found in a project file. Rather, it is used to represent the project file's root dictionary. Printing an XCProjectFile will print the entire project file, including the full "objects" dictionary. project_file = XCProjectFile({'rootObject': project}) project_file.ComputeIDs() project_file.Print() Xcode project files are always encoded in UTF-8. This module will accept strings of either the str class or the unicode class. Strings of class str are assumed to already be encoded in UTF-8. Obviously, if you're just using ASCII, you won't encounter difficulties because ASCII is a UTF-8 subset. Strings of class unicode are handled properly and encoded in UTF-8 when a project file is output. """ import gyp.common from functools import cmp_to_key import hashlib from operator import attrgetter import posixpath import re import struct import sys def cmp(x, y): return (x > y) - (x < y) # See XCObject._EncodeString. This pattern is used to determine when a string # can be printed unquoted. Strings that match this pattern may be printed # unquoted. Strings that do not match must be quoted and may be further # transformed to be properly encoded. Note that this expression matches the # characters listed with "+", for 1 or more occurrences: if a string is empty, # it must not match this pattern, because it needs to be encoded as "". _unquoted = re.compile("^[A-Za-z0-9$./_]+$") # Strings that match this pattern are quoted regardless of what _unquoted says. # Oddly, Xcode will quote any string with a run of three or more underscores. _quoted = re.compile("___") # This pattern should match any character that needs to be escaped by # XCObject._EncodeString. See that function. _escaped = re.compile('[\\\\"]|[\x00-\x1f]') # Used by SourceTreeAndPathFromPath _path_leading_variable = re.compile(r"^\$\((.*?)\)(/(.*))?$") def SourceTreeAndPathFromPath(input_path): """Given input_path, returns a tuple with sourceTree and path values. Examples: input_path (source_tree, output_path) '$(VAR)/path' ('VAR', 'path') '$(VAR)' ('VAR', None) 'path' (None, 'path') """ source_group_match = _path_leading_variable.match(input_path) if source_group_match: source_tree = source_group_match.group(1) output_path = source_group_match.group(3) # This may be None. else: source_tree = None output_path = input_path return (source_tree, output_path) def ConvertVariablesToShellSyntax(input_string): return re.sub(r"\$\((.*?)\)", "${\\1}", input_string) class XCObject: """The abstract base of all class types used in Xcode project files. Class variables: _schema: A dictionary defining the properties of this class. The keys to _schema are string property keys as used in project files. Values are a list of four or five elements: [ is_list, property_type, is_strong, is_required, default ] is_list: True if the property described is a list, as opposed to a single element. property_type: The type to use as the value of the property, or if is_list is True, the type to use for each element of the value's list. property_type must be an XCObject subclass, or one of the built-in types str, int, or dict. is_strong: If property_type is an XCObject subclass, is_strong is True to assert that this class "owns," or serves as parent, to the property value (or, if is_list is True, values). is_strong must be False if property_type is not an XCObject subclass. is_required: True if the property is required for the class. Note that is_required being True does not preclude an empty string ("", in the case of property_type str) or list ([], in the case of is_list True) from being set for the property. default: Optional. If is_required is True, default may be set to provide a default value for objects that do not supply their own value. If is_required is True and default is not provided, users of the class must supply their own value for the property. Note that although the values of the array are expressed in boolean terms, subclasses provide values as integers to conserve horizontal space. _should_print_single_line: False in XCObject. Subclasses whose objects should be written to the project file in the alternate single-line format, such as PBXFileReference and PBXBuildFile, should set this to True. _encode_transforms: Used by _EncodeString to encode unprintable characters. The index into this list is the ordinal of the character to transform; each value is a string used to represent the character in the output. XCObject provides an _encode_transforms list suitable for most XCObject subclasses. _alternate_encode_transforms: Provided for subclasses that wish to use the alternate encoding rules. Xcode seems to use these rules when printing objects in single-line format. Subclasses that desire this behavior should set _encode_transforms to _alternate_encode_transforms. _hashables: A list of XCObject subclasses that can be hashed by ComputeIDs to construct this object's ID. Most classes that need custom hashing behavior should do it by overriding Hashables, but in some cases an object's parent may wish to push a hashable value into its child, and it can do so by appending to _hashables. Attributes: id: The object's identifier, a 24-character uppercase hexadecimal string. Usually, objects being created should not set id until the entire project file structure is built. At that point, UpdateIDs() should be called on the root object to assign deterministic values for id to each object in the tree. parent: The object's parent. This is set by a parent XCObject when a child object is added to it. _properties: The object's property dictionary. An object's properties are described by its class' _schema variable. """ _schema = {} _should_print_single_line = False # See _EncodeString. _encode_transforms = [] i = 0 while i < ord(" "): _encode_transforms.append("\\U%04x" % i) i = i + 1 _encode_transforms[7] = "\\a" _encode_transforms[8] = "\\b" _encode_transforms[9] = "\\t" _encode_transforms[10] = "\\n" _encode_transforms[11] = "\\v" _encode_transforms[12] = "\\f" _encode_transforms[13] = "\\n" _alternate_encode_transforms = list(_encode_transforms) _alternate_encode_transforms[9] = chr(9) _alternate_encode_transforms[10] = chr(10) _alternate_encode_transforms[11] = chr(11) def __init__(self, properties=None, id=None, parent=None): self.id = id self.parent = parent self._properties = {} self._hashables = [] self._SetDefaultsFromSchema() self.UpdateProperties(properties) def __repr__(self): try: name = self.Name() except NotImplementedError: return f"<{self.__class__.__name__} at 0x{id(self):x}>" return f"<{self.__class__.__name__} {name!r} at 0x{id(self):x}>" def Copy(self): """Make a copy of this object. The new object will have its own copy of lists and dicts. Any XCObject objects owned by this object (marked "strong") will be copied in the new object, even those found in lists. If this object has any weak references to other XCObjects, the same references are added to the new object without making a copy. """ that = self.__class__(id=self.id, parent=self.parent) for key, value in self._properties.items(): is_strong = self._schema[key][2] if isinstance(value, XCObject): if is_strong: new_value = value.Copy() new_value.parent = that that._properties[key] = new_value else: that._properties[key] = value elif isinstance(value, (str, int)): that._properties[key] = value elif isinstance(value, list): if is_strong: # If is_strong is True, each element is an XCObject, so it's safe to # call Copy. that._properties[key] = [] for item in value: new_item = item.Copy() new_item.parent = that that._properties[key].append(new_item) else: that._properties[key] = value[:] elif isinstance(value, dict): # dicts are never strong. if is_strong: raise TypeError( "Strong dict for key " + key + " in " + self.__class__.__name__ ) else: that._properties[key] = value.copy() else: raise TypeError( "Unexpected type " + value.__class__.__name__ + " for key " + key + " in " + self.__class__.__name__ ) return that def Name(self): """Return the name corresponding to an object. Not all objects necessarily need to be nameable, and not all that do have a "name" property. Override as needed. """ # If the schema indicates that "name" is required, try to access the # property even if it doesn't exist. This will result in a KeyError # being raised for the property that should be present, which seems more # appropriate than NotImplementedError in this case. if "name" in self._properties or ( "name" in self._schema and self._schema["name"][3] ): return self._properties["name"] raise NotImplementedError(self.__class__.__name__ + " must implement Name") def Comment(self): """Return a comment string for the object. Most objects just use their name as the comment, but PBXProject uses different values. The returned comment is not escaped and does not have any comment marker strings applied to it. """ return self.Name() def Hashables(self): hashables = [self.__class__.__name__] name = self.Name() if name is not None: hashables.append(name) hashables.extend(self._hashables) return hashables def HashablesForChild(self): return None def ComputeIDs(self, recursive=True, overwrite=True, seed_hash=None): """Set "id" properties deterministically. An object's "id" property is set based on a hash of its class type and name, as well as the class type and name of all ancestor objects. As such, it is only advisable to call ComputeIDs once an entire project file tree is built. If recursive is True, recurse into all descendant objects and update their hashes. If overwrite is True, any existing value set in the "id" property will be replaced. """ def _HashUpdate(hash, data): """Update hash with data's length and contents. If the hash were updated only with the value of data, it would be possible for clowns to induce collisions by manipulating the names of their objects. By adding the length, it's exceedingly less likely that ID collisions will be encountered, intentionally or not. """ hash.update(struct.pack(">i", len(data))) if isinstance(data, str): data = data.encode("utf-8") hash.update(data) if seed_hash is None: seed_hash = hashlib.sha1() hash = seed_hash.copy() hashables = self.Hashables() assert len(hashables) > 0 for hashable in hashables: _HashUpdate(hash, hashable) if recursive: hashables_for_child = self.HashablesForChild() if hashables_for_child is None: child_hash = hash else: assert len(hashables_for_child) > 0 child_hash = seed_hash.copy() for hashable in hashables_for_child: _HashUpdate(child_hash, hashable) for child in self.Children(): child.ComputeIDs(recursive, overwrite, child_hash) if overwrite or self.id is None: # Xcode IDs are only 96 bits (24 hex characters), but a SHA-1 digest is # is 160 bits. Instead of throwing out 64 bits of the digest, xor them # into the portion that gets used. assert hash.digest_size % 4 == 0 digest_int_count = hash.digest_size // 4 digest_ints = struct.unpack(">" + "I" * digest_int_count, hash.digest()) id_ints = [0, 0, 0] for index in range(0, digest_int_count): id_ints[index % 3] ^= digest_ints[index] self.id = "%08X%08X%08X" % tuple(id_ints) def EnsureNoIDCollisions(self): """Verifies that no two objects have the same ID. Checks all descendants. """ ids = {} descendants = self.Descendants() for descendant in descendants: if descendant.id in ids: other = ids[descendant.id] raise KeyError( 'Duplicate ID %s, objects "%s" and "%s" in "%s"' % ( descendant.id, str(descendant._properties), str(other._properties), self._properties["rootObject"].Name(), ) ) ids[descendant.id] = descendant def Children(self): """Returns a list of all of this object's owned (strong) children.""" children = [] for property, attributes in self._schema.items(): (is_list, property_type, is_strong) = attributes[0:3] if is_strong and property in self._properties: if not is_list: children.append(self._properties[property]) else: children.extend(self._properties[property]) return children def Descendants(self): """Returns a list of all of this object's descendants, including this object. """ children = self.Children() descendants = [self] for child in children: descendants.extend(child.Descendants()) return descendants def PBXProjectAncestor(self): # The base case for recursion is defined at PBXProject.PBXProjectAncestor. if self.parent: return self.parent.PBXProjectAncestor() return None def _EncodeComment(self, comment): """Encodes a comment to be placed in the project file output, mimicking Xcode behavior. """ # This mimics Xcode behavior by wrapping the comment in "/*" and "*/". If # the string already contains a "*/", it is turned into "(*)/". This keeps # the file writer from outputting something that would be treated as the # end of a comment in the middle of something intended to be entirely a # comment. return "/* " + comment.replace("*/", "(*)/") + " */" def _EncodeTransform(self, match): # This function works closely with _EncodeString. It will only be called # by re.sub with match.group(0) containing a character matched by the # the _escaped expression. char = match.group(0) # Backslashes (\) and quotation marks (") are always replaced with a # backslash-escaped version of the same. Everything else gets its # replacement from the class' _encode_transforms array. if char == "\\": return "\\\\" if char == '"': return '\\"' return self._encode_transforms[ord(char)] def _EncodeString(self, value): """Encodes a string to be placed in the project file output, mimicking Xcode behavior. """ # Use quotation marks when any character outside of the range A-Z, a-z, 0-9, # $ (dollar sign), . (period), and _ (underscore) is present. Also use # quotation marks to represent empty strings. # # Escape " (double-quote) and \ (backslash) by preceding them with a # backslash. # # Some characters below the printable ASCII range are encoded specially: # 7 ^G BEL is encoded as "\a" # 8 ^H BS is encoded as "\b" # 11 ^K VT is encoded as "\v" # 12 ^L NP is encoded as "\f" # 127 ^? DEL is passed through as-is without escaping # - In PBXFileReference and PBXBuildFile objects: # 9 ^I HT is passed through as-is without escaping # 10 ^J NL is passed through as-is without escaping # 13 ^M CR is passed through as-is without escaping # - In other objects: # 9 ^I HT is encoded as "\t" # 10 ^J NL is encoded as "\n" # 13 ^M CR is encoded as "\n" rendering it indistinguishable from # 10 ^J NL # All other characters within the ASCII control character range (0 through # 31 inclusive) are encoded as "\U001f" referring to the Unicode code point # in hexadecimal. For example, character 14 (^N SO) is encoded as "\U000e". # Characters above the ASCII range are passed through to the output encoded # as UTF-8 without any escaping. These mappings are contained in the # class' _encode_transforms list. if _unquoted.search(value) and not _quoted.search(value): return value return '"' + _escaped.sub(self._EncodeTransform, value) + '"' def _XCPrint(self, file, tabs, line): file.write("\t" * tabs + line) def _XCPrintableValue(self, tabs, value, flatten_list=False): """Returns a representation of value that may be printed in a project file, mimicking Xcode's behavior. _XCPrintableValue can handle str and int values, XCObjects (which are made printable by returning their id property), and list and dict objects composed of any of the above types. When printing a list or dict, and _should_print_single_line is False, the tabs parameter is used to determine how much to indent the lines corresponding to the items in the list or dict. If flatten_list is True, single-element lists will be transformed into strings. """ printable = "" comment = None if self._should_print_single_line: sep = " " element_tabs = "" end_tabs = "" else: sep = "\n" element_tabs = "\t" * (tabs + 1) end_tabs = "\t" * tabs if isinstance(value, XCObject): printable += value.id comment = value.Comment() elif isinstance(value, str): printable += self._EncodeString(value) elif isinstance(value, str): printable += self._EncodeString(value.encode("utf-8")) elif isinstance(value, int): printable += str(value) elif isinstance(value, list): if flatten_list and len(value) <= 1: if len(value) == 0: printable += self._EncodeString("") else: printable += self._EncodeString(value[0]) else: printable = "(" + sep for item in value: printable += ( element_tabs + self._XCPrintableValue(tabs + 1, item, flatten_list) + "," + sep ) printable += end_tabs + ")" elif isinstance(value, dict): printable = "{" + sep for item_key, item_value in sorted(value.items()): printable += ( element_tabs + self._XCPrintableValue(tabs + 1, item_key, flatten_list) + " = " + self._XCPrintableValue(tabs + 1, item_value, flatten_list) + ";" + sep ) printable += end_tabs + "}" else: raise TypeError("Can't make " + value.__class__.__name__ + " printable") if comment: printable += " " + self._EncodeComment(comment) return printable def _XCKVPrint(self, file, tabs, key, value): """Prints a key and value, members of an XCObject's _properties dictionary, to file. tabs is an int identifying the indentation level. If the class' _should_print_single_line variable is True, tabs is ignored and the key-value pair will be followed by a space insead of a newline. """ if self._should_print_single_line: printable = "" after_kv = " " else: printable = "\t" * tabs after_kv = "\n" # Xcode usually prints remoteGlobalIDString values in PBXContainerItemProxy # objects without comments. Sometimes it prints them with comments, but # the majority of the time, it doesn't. To avoid unnecessary changes to # the project file after Xcode opens it, don't write comments for # remoteGlobalIDString. This is a sucky hack and it would certainly be # cleaner to extend the schema to indicate whether or not a comment should # be printed, but since this is the only case where the problem occurs and # Xcode itself can't seem to make up its mind, the hack will suffice. # # Also see PBXContainerItemProxy._schema['remoteGlobalIDString']. if key == "remoteGlobalIDString" and isinstance(self, PBXContainerItemProxy): value_to_print = value.id else: value_to_print = value # PBXBuildFile's settings property is represented in the output as a dict, # but a hack here has it represented as a string. Arrange to strip off the # quotes so that it shows up in the output as expected. if key == "settings" and isinstance(self, PBXBuildFile): strip_value_quotes = True else: strip_value_quotes = False # In another one-off, let's set flatten_list on buildSettings properties # of XCBuildConfiguration objects, because that's how Xcode treats them. if key == "buildSettings" and isinstance(self, XCBuildConfiguration): flatten_list = True else: flatten_list = False try: printable_key = self._XCPrintableValue(tabs, key, flatten_list) printable_value = self._XCPrintableValue(tabs, value_to_print, flatten_list) if ( strip_value_quotes and len(printable_value) > 1 and printable_value[0] == '"' and printable_value[-1] == '"' ): printable_value = printable_value[1:-1] printable += printable_key + " = " + printable_value + ";" + after_kv except TypeError as e: gyp.common.ExceptionAppend(e, 'while printing key "%s"' % key) raise self._XCPrint(file, 0, printable) def Print(self, file=sys.stdout): """Prints a reprentation of this object to file, adhering to Xcode output formatting. """ self.VerifyHasRequiredProperties() if self._should_print_single_line: # When printing an object in a single line, Xcode doesn't put any space # between the beginning of a dictionary (or presumably a list) and the # first contained item, so you wind up with snippets like # ...CDEF = {isa = PBXFileReference; fileRef = 0123... # If it were me, I would have put a space in there after the opening # curly, but I guess this is just another one of those inconsistencies # between how Xcode prints PBXFileReference and PBXBuildFile objects as # compared to other objects. Mimic Xcode's behavior here by using an # empty string for sep. sep = "" end_tabs = 0 else: sep = "\n" end_tabs = 2 # Start the object. For example, '\t\tPBXProject = {\n'. self._XCPrint(file, 2, self._XCPrintableValue(2, self) + " = {" + sep) # "isa" isn't in the _properties dictionary, it's an intrinsic property # of the class which the object belongs to. Xcode always outputs "isa" # as the first element of an object dictionary. self._XCKVPrint(file, 3, "isa", self.__class__.__name__) # The remaining elements of an object dictionary are sorted alphabetically. for property, value in sorted(self._properties.items()): self._XCKVPrint(file, 3, property, value) # End the object. self._XCPrint(file, end_tabs, "};\n") def UpdateProperties(self, properties, do_copy=False): """Merge the supplied properties into the _properties dictionary. The input properties must adhere to the class schema or a KeyError or TypeError exception will be raised. If adding an object of an XCObject subclass and the schema indicates a strong relationship, the object's parent will be set to this object. If do_copy is True, then lists, dicts, strong-owned XCObjects, and strong-owned XCObjects in lists will be copied instead of having their references added. """ if properties is None: return for property, value in properties.items(): # Make sure the property is in the schema. if property not in self._schema: raise KeyError(property + " not in " + self.__class__.__name__) # Make sure the property conforms to the schema. (is_list, property_type, is_strong) = self._schema[property][0:3] if is_list: if value.__class__ != list: raise TypeError( property + " of " + self.__class__.__name__ + " must be list, not " + value.__class__.__name__ ) for item in value: if not isinstance(item, property_type) and not ( isinstance(item, str) and property_type == str ): # Accept unicode where str is specified. str is treated as # UTF-8-encoded. raise TypeError( "item of " + property + " of " + self.__class__.__name__ + " must be " + property_type.__name__ + ", not " + item.__class__.__name__ ) elif not isinstance(value, property_type) and not ( isinstance(value, str) and property_type == str ): # Accept unicode where str is specified. str is treated as # UTF-8-encoded. raise TypeError( property + " of " + self.__class__.__name__ + " must be " + property_type.__name__ + ", not " + value.__class__.__name__ ) # Checks passed, perform the assignment. if do_copy: if isinstance(value, XCObject): if is_strong: self._properties[property] = value.Copy() else: self._properties[property] = value elif isinstance(value, (str, int)): self._properties[property] = value elif isinstance(value, list): if is_strong: # If is_strong is True, each element is an XCObject, # so it's safe to call Copy. self._properties[property] = [] for item in value: self._properties[property].append(item.Copy()) else: self._properties[property] = value[:] elif isinstance(value, dict): self._properties[property] = value.copy() else: raise TypeError( "Don't know how to copy a " + value.__class__.__name__ + " object for " + property + " in " + self.__class__.__name__ ) else: self._properties[property] = value # Set up the child's back-reference to this object. Don't use |value| # any more because it may not be right if do_copy is true. if is_strong: if not is_list: self._properties[property].parent = self else: for item in self._properties[property]: item.parent = self def HasProperty(self, key): return key in self._properties def GetProperty(self, key): return self._properties[key] def SetProperty(self, key, value): self.UpdateProperties({key: value}) def DelProperty(self, key): if key in self._properties: del self._properties[key] def AppendProperty(self, key, value): # TODO(mark): Support ExtendProperty too (and make this call that)? # Schema validation. if key not in self._schema: raise KeyError(key + " not in " + self.__class__.__name__) (is_list, property_type, is_strong) = self._schema[key][0:3] if not is_list: raise TypeError(key + " of " + self.__class__.__name__ + " must be list") if not isinstance(value, property_type): raise TypeError( "item of " + key + " of " + self.__class__.__name__ + " must be " + property_type.__name__ + ", not " + value.__class__.__name__ ) # If the property doesn't exist yet, create a new empty list to receive the # item. self._properties[key] = self._properties.get(key, []) # Set up the ownership link. if is_strong: value.parent = self # Store the item. self._properties[key].append(value) def VerifyHasRequiredProperties(self): """Ensure that all properties identified as required by the schema are set. """ # TODO(mark): A stronger verification mechanism is needed. Some # subclasses need to perform validation beyond what the schema can enforce. for property, attributes in self._schema.items(): (is_list, property_type, is_strong, is_required) = attributes[0:4] if is_required and property not in self._properties: raise KeyError(self.__class__.__name__ + " requires " + property) def _SetDefaultsFromSchema(self): """Assign object default values according to the schema. This will not overwrite properties that have already been set.""" defaults = {} for property, attributes in self._schema.items(): (is_list, property_type, is_strong, is_required) = attributes[0:4] if ( is_required and len(attributes) >= 5 and property not in self._properties ): default = attributes[4] defaults[property] = default if len(defaults) > 0: # Use do_copy=True so that each new object gets its own copy of strong # objects, lists, and dicts. self.UpdateProperties(defaults, do_copy=True) class XCHierarchicalElement(XCObject): """Abstract base for PBXGroup and PBXFileReference. Not represented in a project file.""" # TODO(mark): Do name and path belong here? Probably so. # If path is set and name is not, name may have a default value. Name will # be set to the basename of path, if the basename of path is different from # the full value of path. If path is already just a leaf name, name will # not be set. _schema = XCObject._schema.copy() _schema.update( { "comments": [0, str, 0, 0], "fileEncoding": [0, str, 0, 0], "includeInIndex": [0, int, 0, 0], "indentWidth": [0, int, 0, 0], "lineEnding": [0, int, 0, 0], "sourceTree": [0, str, 0, 1, ""], "tabWidth": [0, int, 0, 0], "usesTabs": [0, int, 0, 0], "wrapsLines": [0, int, 0, 0], } ) def __init__(self, properties=None, id=None, parent=None): # super XCObject.__init__(self, properties, id, parent) if "path" in self._properties and "name" not in self._properties: path = self._properties["path"] name = posixpath.basename(path) if name != "" and path != name: self.SetProperty("name", name) if "path" in self._properties and ( "sourceTree" not in self._properties or self._properties["sourceTree"] == "" ): # If the pathname begins with an Xcode variable like "$(SDKROOT)/", take # the variable out and make the path be relative to that variable by # assigning the variable name as the sourceTree. (source_tree, path) = SourceTreeAndPathFromPath(self._properties["path"]) if source_tree is not None: self._properties["sourceTree"] = source_tree if path is not None: self._properties["path"] = path if ( source_tree is not None and path is None and "name" not in self._properties ): # The path was of the form "$(SDKROOT)" with no path following it. # This object is now relative to that variable, so it has no path # attribute of its own. It does, however, keep a name. del self._properties["path"] self._properties["name"] = source_tree def Name(self): if "name" in self._properties: return self._properties["name"] elif "path" in self._properties: return self._properties["path"] else: # This happens in the case of the root PBXGroup. return None def Hashables(self): """Custom hashables for XCHierarchicalElements. XCHierarchicalElements are special. Generally, their hashes shouldn't change if the paths don't change. The normal XCObject implementation of Hashables adds a hashable for each object, which means that if the hierarchical structure changes (possibly due to changes caused when TakeOverOnlyChild runs and encounters slight changes in the hierarchy), the hashes will change. For example, if a project file initially contains a/b/f1 and a/b becomes collapsed into a/b, f1 will have a single parent a/b. If someone later adds a/f2 to the project file, a/b can no longer be collapsed, and f1 winds up with parent b and grandparent a. That would be sufficient to change f1's hash. To counteract this problem, hashables for all XCHierarchicalElements except for the main group (which has neither a name nor a path) are taken to be just the set of path components. Because hashables are inherited from parents, this provides assurance that a/b/f1 has the same set of hashables whether its parent is b or a/b. The main group is a special case. As it is permitted to have no name or path, it is permitted to use the standard XCObject hash mechanism. This is not considered a problem because there can be only one main group. """ if self == self.PBXProjectAncestor()._properties["mainGroup"]: # super return XCObject.Hashables(self) hashables = [] # Put the name in first, ensuring that if TakeOverOnlyChild collapses # children into a top-level group like "Source", the name always goes # into the list of hashables without interfering with path components. if "name" in self._properties: # Make it less likely for people to manipulate hashes by following the # pattern of always pushing an object type value onto the list first. hashables.append(self.__class__.__name__ + ".name") hashables.append(self._properties["name"]) # NOTE: This still has the problem that if an absolute path is encountered, # including paths with a sourceTree, they'll still inherit their parents' # hashables, even though the paths aren't relative to their parents. This # is not expected to be much of a problem in practice. path = self.PathFromSourceTreeAndPath() if path is not None: components = path.split(posixpath.sep) for component in components: hashables.append(self.__class__.__name__ + ".path") hashables.append(component) hashables.extend(self._hashables) return hashables def Compare(self, other): # Allow comparison of these types. PBXGroup has the highest sort rank; # PBXVariantGroup is treated as equal to PBXFileReference. valid_class_types = { PBXFileReference: "file", PBXGroup: "group", PBXVariantGroup: "file", } self_type = valid_class_types[self.__class__] other_type = valid_class_types[other.__class__] if self_type == other_type: # If the two objects are of the same sort rank, compare their names. return cmp(self.Name(), other.Name()) # Otherwise, sort groups before everything else. if self_type == "group": return -1 return 1 def CompareRootGroup(self, other): # This function should be used only to compare direct children of the # containing PBXProject's mainGroup. These groups should appear in the # listed order. # TODO(mark): "Build" is used by gyp.generator.xcode, perhaps the # generator should have a way of influencing this list rather than having # to hardcode for the generator here. order = [ "Source", "Intermediates", "Projects", "Frameworks", "Products", "Build", ] # If the groups aren't in the listed order, do a name comparison. # Otherwise, groups in the listed order should come before those that # aren't. self_name = self.Name() other_name = other.Name() self_in = isinstance(self, PBXGroup) and self_name in order other_in = isinstance(self, PBXGroup) and other_name in order if not self_in and not other_in: return self.Compare(other) if self_name in order and other_name not in order: return -1 if other_name in order and self_name not in order: return 1 # If both groups are in the listed order, go by the defined order. self_index = order.index(self_name) other_index = order.index(other_name) if self_index < other_index: return -1 if self_index > other_index: return 1 return 0 def PathFromSourceTreeAndPath(self): # Turn the object's sourceTree and path properties into a single flat # string of a form comparable to the path parameter. If there's a # sourceTree property other than "", wrap it in $(...) for the # comparison. components = [] if self._properties["sourceTree"] != "": components.append("$(" + self._properties["sourceTree"] + ")") if "path" in self._properties: components.append(self._properties["path"]) if len(components) > 0: return posixpath.join(*components) return None def FullPath(self): # Returns a full path to self relative to the project file, or relative # to some other source tree. Start with self, and walk up the chain of # parents prepending their paths, if any, until no more parents are # available (project-relative path) or until a path relative to some # source tree is found. xche = self path = None while isinstance(xche, XCHierarchicalElement) and ( path is None or (not path.startswith("/") and not path.startswith("$")) ): this_path = xche.PathFromSourceTreeAndPath() if this_path is not None and path is not None: path = posixpath.join(this_path, path) elif this_path is not None: path = this_path xche = xche.parent return path class PBXGroup(XCHierarchicalElement): """ Attributes: _children_by_path: Maps pathnames of children of this PBXGroup to the actual child XCHierarchicalElement objects. _variant_children_by_name_and_path: Maps (name, path) tuples of PBXVariantGroup children to the actual child PBXVariantGroup objects. """ _schema = XCHierarchicalElement._schema.copy() _schema.update( { "children": [1, XCHierarchicalElement, 1, 1, []], "name": [0, str, 0, 0], "path": [0, str, 0, 0], } ) def __init__(self, properties=None, id=None, parent=None): # super XCHierarchicalElement.__init__(self, properties, id, parent) self._children_by_path = {} self._variant_children_by_name_and_path = {} for child in self._properties.get("children", []): self._AddChildToDicts(child) def Hashables(self): # super hashables = XCHierarchicalElement.Hashables(self) # It is not sufficient to just rely on name and parent to build a unique # hashable : a node could have two child PBXGroup sharing a common name. # To add entropy the hashable is enhanced with the names of all its # children. for child in self._properties.get("children", []): child_name = child.Name() if child_name is not None: hashables.append(child_name) return hashables def HashablesForChild(self): # To avoid a circular reference the hashables used to compute a child id do # not include the child names. return XCHierarchicalElement.Hashables(self) def _AddChildToDicts(self, child): # Sets up this PBXGroup object's dicts to reference the child properly. child_path = child.PathFromSourceTreeAndPath() if child_path: if child_path in self._children_by_path: raise ValueError("Found multiple children with path " + child_path) self._children_by_path[child_path] = child if isinstance(child, PBXVariantGroup): child_name = child._properties.get("name", None) key = (child_name, child_path) if key in self._variant_children_by_name_and_path: raise ValueError( "Found multiple PBXVariantGroup children with " + "name " + str(child_name) + " and path " + str(child_path) ) self._variant_children_by_name_and_path[key] = child def AppendChild(self, child): # Callers should use this instead of calling # AppendProperty('children', child) directly because this function # maintains the group's dicts. self.AppendProperty("children", child) self._AddChildToDicts(child) def GetChildByName(self, name): # This is not currently optimized with a dict as GetChildByPath is because # it has few callers. Most callers probably want GetChildByPath. This # function is only useful to get children that have names but no paths, # which is rare. The children of the main group ("Source", "Products", # etc.) is pretty much the only case where this likely to come up. # # TODO(mark): Maybe this should raise an error if more than one child is # present with the same name. if "children" not in self._properties: return None for child in self._properties["children"]: if child.Name() == name: return child return None def GetChildByPath(self, path): if not path: return None if path in self._children_by_path: return self._children_by_path[path] return None def GetChildByRemoteObject(self, remote_object): # This method is a little bit esoteric. Given a remote_object, which # should be a PBXFileReference in another project file, this method will # return this group's PBXReferenceProxy object serving as a local proxy # for the remote PBXFileReference. # # This function might benefit from a dict optimization as GetChildByPath # for some workloads, but profiling shows that it's not currently a # problem. if "children" not in self._properties: return None for child in self._properties["children"]: if not isinstance(child, PBXReferenceProxy): continue container_proxy = child._properties["remoteRef"] if container_proxy._properties["remoteGlobalIDString"] == remote_object: return child return None def AddOrGetFileByPath(self, path, hierarchical): """Returns an existing or new file reference corresponding to path. If hierarchical is True, this method will create or use the necessary hierarchical group structure corresponding to path. Otherwise, it will look in and create an item in the current group only. If an existing matching reference is found, it is returned, otherwise, a new one will be created, added to the correct group, and returned. If path identifies a directory by virtue of carrying a trailing slash, this method returns a PBXFileReference of "folder" type. If path identifies a variant, by virtue of it identifying a file inside a directory with an ".lproj" extension, this method returns a PBXVariantGroup containing the variant named by path, and possibly other variants. For all other paths, a "normal" PBXFileReference will be returned. """ # Adding or getting a directory? Directories end with a trailing slash. is_dir = False if path.endswith("/"): is_dir = True path = posixpath.normpath(path) if is_dir: path = path + "/" # Adding or getting a variant? Variants are files inside directories # with an ".lproj" extension. Xcode uses variants for localization. For # a variant path/to/Language.lproj/MainMenu.nib, put a variant group named # MainMenu.nib inside path/to, and give it a variant named Language. In # this example, grandparent would be set to path/to and parent_root would # be set to Language. variant_name = None parent = posixpath.dirname(path) grandparent = posixpath.dirname(parent) parent_basename = posixpath.basename(parent) (parent_root, parent_ext) = posixpath.splitext(parent_basename) if parent_ext == ".lproj": variant_name = parent_root if grandparent == "": grandparent = None # Putting a directory inside a variant group is not currently supported. assert not is_dir or variant_name is None path_split = path.split(posixpath.sep) if ( len(path_split) == 1 or ((is_dir or variant_name is not None) and len(path_split) == 2) or not hierarchical ): # The PBXFileReference or PBXVariantGroup will be added to or gotten from # this PBXGroup, no recursion necessary. if variant_name is None: # Add or get a PBXFileReference. file_ref = self.GetChildByPath(path) if file_ref is not None: assert file_ref.__class__ == PBXFileReference else: file_ref = PBXFileReference({"path": path}) self.AppendChild(file_ref) else: # Add or get a PBXVariantGroup. The variant group name is the same # as the basename (MainMenu.nib in the example above). grandparent # specifies the path to the variant group itself, and path_split[-2:] # is the path of the specific variant relative to its group. variant_group_name = posixpath.basename(path) variant_group_ref = self.AddOrGetVariantGroupByNameAndPath( variant_group_name, grandparent ) variant_path = posixpath.sep.join(path_split[-2:]) variant_ref = variant_group_ref.GetChildByPath(variant_path) if variant_ref is not None: assert variant_ref.__class__ == PBXFileReference else: variant_ref = PBXFileReference( {"name": variant_name, "path": variant_path} ) variant_group_ref.AppendChild(variant_ref) # The caller is interested in the variant group, not the specific # variant file. file_ref = variant_group_ref return file_ref else: # Hierarchical recursion. Add or get a PBXGroup corresponding to the # outermost path component, and then recurse into it, chopping off that # path component. next_dir = path_split[0] group_ref = self.GetChildByPath(next_dir) if group_ref is not None: assert group_ref.__class__ == PBXGroup else: group_ref = PBXGroup({"path": next_dir}) self.AppendChild(group_ref) return group_ref.AddOrGetFileByPath( posixpath.sep.join(path_split[1:]), hierarchical ) def AddOrGetVariantGroupByNameAndPath(self, name, path): """Returns an existing or new PBXVariantGroup for name and path. If a PBXVariantGroup identified by the name and path arguments is already present as a child of this object, it is returned. Otherwise, a new PBXVariantGroup with the correct properties is created, added as a child, and returned. This method will generally be called by AddOrGetFileByPath, which knows when to create a variant group based on the structure of the pathnames passed to it. """ key = (name, path) if key in self._variant_children_by_name_and_path: variant_group_ref = self._variant_children_by_name_and_path[key] assert variant_group_ref.__class__ == PBXVariantGroup return variant_group_ref variant_group_properties = {"name": name} if path is not None: variant_group_properties["path"] = path variant_group_ref = PBXVariantGroup(variant_group_properties) self.AppendChild(variant_group_ref) return variant_group_ref def TakeOverOnlyChild(self, recurse=False): """If this PBXGroup has only one child and it's also a PBXGroup, take it over by making all of its children this object's children. This function will continue to take over only children when those children are groups. If there are three PBXGroups representing a, b, and c, with c inside b and b inside a, and a and b have no other children, this will result in a taking over both b and c, forming a PBXGroup for a/b/c. If recurse is True, this function will recurse into children and ask them to collapse themselves by taking over only children as well. Assuming an example hierarchy with files at a/b/c/d1, a/b/c/d2, and a/b/c/d3/e/f (d1, d2, and f are files, the rest are groups), recursion will result in a group for a/b/c containing a group for d3/e. """ # At this stage, check that child class types are PBXGroup exactly, # instead of using isinstance. The only subclass of PBXGroup, # PBXVariantGroup, should not participate in reparenting in the same way: # reparenting by merging different object types would be wrong. while ( len(self._properties["children"]) == 1 and self._properties["children"][0].__class__ == PBXGroup ): # Loop to take over the innermost only-child group possible. child = self._properties["children"][0] # Assume the child's properties, including its children. Save a copy # of this object's old properties, because they'll still be needed. # This object retains its existing id and parent attributes. old_properties = self._properties self._properties = child._properties self._children_by_path = child._children_by_path if ( "sourceTree" not in self._properties or self._properties["sourceTree"] == "" ): # The child was relative to its parent. Fix up the path. Note that # children with a sourceTree other than "" are not relative to # their parents, so no path fix-up is needed in that case. if "path" in old_properties: if "path" in self._properties: # Both the original parent and child have paths set. self._properties["path"] = posixpath.join( old_properties["path"], self._properties["path"] ) else: # Only the original parent has a path, use it. self._properties["path"] = old_properties["path"] if "sourceTree" in old_properties: # The original parent had a sourceTree set, use it. self._properties["sourceTree"] = old_properties["sourceTree"] # If the original parent had a name set, keep using it. If the original # parent didn't have a name but the child did, let the child's name # live on. If the name attribute seems unnecessary now, get rid of it. if "name" in old_properties and old_properties["name"] not in ( None, self.Name(), ): self._properties["name"] = old_properties["name"] if ( "name" in self._properties and "path" in self._properties and self._properties["name"] == self._properties["path"] ): del self._properties["name"] # Notify all children of their new parent. for child in self._properties["children"]: child.parent = self # If asked to recurse, recurse. if recurse: for child in self._properties["children"]: if child.__class__ == PBXGroup: child.TakeOverOnlyChild(recurse) def SortGroup(self): self._properties["children"] = sorted( self._properties["children"], key=cmp_to_key(lambda x, y: x.Compare(y)) ) # Recurse. for child in self._properties["children"]: if isinstance(child, PBXGroup): child.SortGroup() class XCFileLikeElement(XCHierarchicalElement): # Abstract base for objects that can be used as the fileRef property of # PBXBuildFile. def PathHashables(self): # A PBXBuildFile that refers to this object will call this method to # obtain additional hashables specific to this XCFileLikeElement. Don't # just use this object's hashables, they're not specific and unique enough # on their own (without access to the parent hashables.) Instead, provide # hashables that identify this object by path by getting its hashables as # well as the hashables of ancestor XCHierarchicalElement objects. hashables = [] xche = self while isinstance(xche, XCHierarchicalElement): xche_hashables = xche.Hashables() for index, xche_hashable in enumerate(xche_hashables): hashables.insert(index, xche_hashable) xche = xche.parent return hashables class XCContainerPortal(XCObject): # Abstract base for objects that can be used as the containerPortal property # of PBXContainerItemProxy. pass class XCRemoteObject(XCObject): # Abstract base for objects that can be used as the remoteGlobalIDString # property of PBXContainerItemProxy. pass class PBXFileReference(XCFileLikeElement, XCContainerPortal, XCRemoteObject): _schema = XCFileLikeElement._schema.copy() _schema.update( { "explicitFileType": [0, str, 0, 0], "lastKnownFileType": [0, str, 0, 0], "name": [0, str, 0, 0], "path": [0, str, 0, 1], } ) # Weird output rules for PBXFileReference. _should_print_single_line = True # super _encode_transforms = XCFileLikeElement._alternate_encode_transforms def __init__(self, properties=None, id=None, parent=None): # super XCFileLikeElement.__init__(self, properties, id, parent) if "path" in self._properties and self._properties["path"].endswith("/"): self._properties["path"] = self._properties["path"][:-1] is_dir = True else: is_dir = False if ( "path" in self._properties and "lastKnownFileType" not in self._properties and "explicitFileType" not in self._properties ): # TODO(mark): This is the replacement for a replacement for a quick hack. # It is no longer incredibly sucky, but this list needs to be extended. extension_map = { "a": "archive.ar", "app": "wrapper.application", "bdic": "file", "bundle": "wrapper.cfbundle", "c": "sourcecode.c.c", "cc": "sourcecode.cpp.cpp", "cpp": "sourcecode.cpp.cpp", "css": "text.css", "cxx": "sourcecode.cpp.cpp", "dart": "sourcecode", "dylib": "compiled.mach-o.dylib", "framework": "wrapper.framework", "gyp": "sourcecode", "gypi": "sourcecode", "h": "sourcecode.c.h", "hxx": "sourcecode.cpp.h", "icns": "image.icns", "java": "sourcecode.java", "js": "sourcecode.javascript", "kext": "wrapper.kext", "m": "sourcecode.c.objc", "mm": "sourcecode.cpp.objcpp", "nib": "wrapper.nib", "o": "compiled.mach-o.objfile", "pdf": "image.pdf", "pl": "text.script.perl", "plist": "text.plist.xml", "pm": "text.script.perl", "png": "image.png", "py": "text.script.python", "r": "sourcecode.rez", "rez": "sourcecode.rez", "s": "sourcecode.asm", "storyboard": "file.storyboard", "strings": "text.plist.strings", "swift": "sourcecode.swift", "ttf": "file", "xcassets": "folder.assetcatalog", "xcconfig": "text.xcconfig", "xcdatamodel": "wrapper.xcdatamodel", "xcdatamodeld": "wrapper.xcdatamodeld", "xib": "file.xib", "y": "sourcecode.yacc", } prop_map = { "dart": "explicitFileType", "gyp": "explicitFileType", "gypi": "explicitFileType", } if is_dir: file_type = "folder" prop_name = "lastKnownFileType" else: basename = posixpath.basename(self._properties["path"]) (root, ext) = posixpath.splitext(basename) # Check the map using a lowercase extension. # TODO(mark): Maybe it should try with the original case first and fall # back to lowercase, in case there are any instances where case # matters. There currently aren't. if ext != "": ext = ext[1:].lower() # TODO(mark): "text" is the default value, but "file" is appropriate # for unrecognized files not containing text. Xcode seems to choose # based on content. file_type = extension_map.get(ext, "text") prop_name = prop_map.get(ext, "lastKnownFileType") self._properties[prop_name] = file_type class PBXVariantGroup(PBXGroup, XCFileLikeElement): """PBXVariantGroup is used by Xcode to represent localizations.""" # No additions to the schema relative to PBXGroup. pass # PBXReferenceProxy is also an XCFileLikeElement subclass. It is defined below # because it uses PBXContainerItemProxy, defined below. class XCBuildConfiguration(XCObject): _schema = XCObject._schema.copy() _schema.update( { "baseConfigurationReference": [0, PBXFileReference, 0, 0], "buildSettings": [0, dict, 0, 1, {}], "name": [0, str, 0, 1], } ) def HasBuildSetting(self, key): return key in self._properties["buildSettings"] def GetBuildSetting(self, key): return self._properties["buildSettings"][key] def SetBuildSetting(self, key, value): # TODO(mark): If a list, copy? self._properties["buildSettings"][key] = value def AppendBuildSetting(self, key, value): if key not in self._properties["buildSettings"]: self._properties["buildSettings"][key] = [] self._properties["buildSettings"][key].append(value) def DelBuildSetting(self, key): if key in self._properties["buildSettings"]: del self._properties["buildSettings"][key] def SetBaseConfiguration(self, value): self._properties["baseConfigurationReference"] = value class XCConfigurationList(XCObject): # _configs is the default list of configurations. _configs = [ XCBuildConfiguration({"name": "Debug"}), XCBuildConfiguration({"name": "Release"}), ] _schema = XCObject._schema.copy() _schema.update( { "buildConfigurations": [1, XCBuildConfiguration, 1, 1, _configs], "defaultConfigurationIsVisible": [0, int, 0, 1, 1], "defaultConfigurationName": [0, str, 0, 1, "Release"], } ) def Name(self): return ( "Build configuration list for " + self.parent.__class__.__name__ + ' "' + self.parent.Name() + '"' ) def ConfigurationNamed(self, name): """Convenience accessor to obtain an XCBuildConfiguration by name.""" for configuration in self._properties["buildConfigurations"]: if configuration._properties["name"] == name: return configuration raise KeyError(name) def DefaultConfiguration(self): """Convenience accessor to obtain the default XCBuildConfiguration.""" return self.ConfigurationNamed(self._properties["defaultConfigurationName"]) def HasBuildSetting(self, key): """Determines the state of a build setting in all XCBuildConfiguration child objects. If all child objects have key in their build settings, and the value is the same in all child objects, returns 1. If no child objects have the key in their build settings, returns 0. If some, but not all, child objects have the key in their build settings, or if any children have different values for the key, returns -1. """ has = None value = None for configuration in self._properties["buildConfigurations"]: configuration_has = configuration.HasBuildSetting(key) if has is None: has = configuration_has elif has != configuration_has: return -1 if configuration_has: configuration_value = configuration.GetBuildSetting(key) if value is None: value = configuration_value elif value != configuration_value: return -1 if not has: return 0 return 1 def GetBuildSetting(self, key): """Gets the build setting for key. All child XCConfiguration objects must have the same value set for the setting, or a ValueError will be raised. """ # TODO(mark): This is wrong for build settings that are lists. The list # contents should be compared (and a list copy returned?) value = None for configuration in self._properties["buildConfigurations"]: configuration_value = configuration.GetBuildSetting(key) if value is None: value = configuration_value else: if value != configuration_value: raise ValueError("Variant values for " + key) return value def SetBuildSetting(self, key, value): """Sets the build setting for key to value in all child XCBuildConfiguration objects. """ for configuration in self._properties["buildConfigurations"]: configuration.SetBuildSetting(key, value) def AppendBuildSetting(self, key, value): """Appends value to the build setting for key, which is treated as a list, in all child XCBuildConfiguration objects. """ for configuration in self._properties["buildConfigurations"]: configuration.AppendBuildSetting(key, value) def DelBuildSetting(self, key): """Deletes the build setting key from all child XCBuildConfiguration objects. """ for configuration in self._properties["buildConfigurations"]: configuration.DelBuildSetting(key) def SetBaseConfiguration(self, value): """Sets the build configuration in all child XCBuildConfiguration objects. """ for configuration in self._properties["buildConfigurations"]: configuration.SetBaseConfiguration(value) class PBXBuildFile(XCObject): _schema = XCObject._schema.copy() _schema.update( { "fileRef": [0, XCFileLikeElement, 0, 1], "settings": [0, str, 0, 0], # hack, it's a dict } ) # Weird output rules for PBXBuildFile. _should_print_single_line = True _encode_transforms = XCObject._alternate_encode_transforms def Name(self): # Example: "main.cc in Sources" return self._properties["fileRef"].Name() + " in " + self.parent.Name() def Hashables(self): # super hashables = XCObject.Hashables(self) # It is not sufficient to just rely on Name() to get the # XCFileLikeElement's name, because that is not a complete pathname. # PathHashables returns hashables unique enough that no two # PBXBuildFiles should wind up with the same set of hashables, unless # someone adds the same file multiple times to the same target. That # would be considered invalid anyway. hashables.extend(self._properties["fileRef"].PathHashables()) return hashables class XCBuildPhase(XCObject): """Abstract base for build phase classes. Not represented in a project file. Attributes: _files_by_path: A dict mapping each path of a child in the files list by path (keys) to the corresponding PBXBuildFile children (values). _files_by_xcfilelikeelement: A dict mapping each XCFileLikeElement (keys) to the corresponding PBXBuildFile children (values). """ # TODO(mark): Some build phase types, like PBXShellScriptBuildPhase, don't # actually have a "files" list. XCBuildPhase should not have "files" but # another abstract subclass of it should provide this, and concrete build # phase types that do have "files" lists should be derived from that new # abstract subclass. XCBuildPhase should only provide buildActionMask and # runOnlyForDeploymentPostprocessing, and not files or the various # file-related methods and attributes. _schema = XCObject._schema.copy() _schema.update( { "buildActionMask": [0, int, 0, 1, 0x7FFFFFFF], "files": [1, PBXBuildFile, 1, 1, []], "runOnlyForDeploymentPostprocessing": [0, int, 0, 1, 0], } ) def __init__(self, properties=None, id=None, parent=None): # super XCObject.__init__(self, properties, id, parent) self._files_by_path = {} self._files_by_xcfilelikeelement = {} for pbxbuildfile in self._properties.get("files", []): self._AddBuildFileToDicts(pbxbuildfile) def FileGroup(self, path): # Subclasses must override this by returning a two-element tuple. The # first item in the tuple should be the PBXGroup to which "path" should be # added, either as a child or deeper descendant. The second item should # be a boolean indicating whether files should be added into hierarchical # groups or one single flat group. raise NotImplementedError(self.__class__.__name__ + " must implement FileGroup") def _AddPathToDict(self, pbxbuildfile, path): """Adds path to the dict tracking paths belonging to this build phase. If the path is already a member of this build phase, raises an exception. """ if path in self._files_by_path: raise ValueError("Found multiple build files with path " + path) self._files_by_path[path] = pbxbuildfile def _AddBuildFileToDicts(self, pbxbuildfile, path=None): """Maintains the _files_by_path and _files_by_xcfilelikeelement dicts. If path is specified, then it is the path that is being added to the phase, and pbxbuildfile must contain either a PBXFileReference directly referencing that path, or it must contain a PBXVariantGroup that itself contains a PBXFileReference referencing the path. If path is not specified, either the PBXFileReference's path or the paths of all children of the PBXVariantGroup are taken as being added to the phase. If the path is already present in the phase, raises an exception. If the PBXFileReference or PBXVariantGroup referenced by pbxbuildfile are already present in the phase, referenced by a different PBXBuildFile object, raises an exception. This does not raise an exception when a PBXFileReference or PBXVariantGroup reappear and are referenced by the same PBXBuildFile that has already introduced them, because in the case of PBXVariantGroup objects, they may correspond to multiple paths that are not all added simultaneously. When this situation occurs, the path needs to be added to _files_by_path, but nothing needs to change in _files_by_xcfilelikeelement, and the caller should have avoided adding the PBXBuildFile if it is already present in the list of children. """ xcfilelikeelement = pbxbuildfile._properties["fileRef"] paths = [] if path is not None: # It's best when the caller provides the path. if isinstance(xcfilelikeelement, PBXVariantGroup): paths.append(path) else: # If the caller didn't provide a path, there can be either multiple # paths (PBXVariantGroup) or one. if isinstance(xcfilelikeelement, PBXVariantGroup): for variant in xcfilelikeelement._properties["children"]: paths.append(variant.FullPath()) else: paths.append(xcfilelikeelement.FullPath()) # Add the paths first, because if something's going to raise, the # messages provided by _AddPathToDict are more useful owing to its # having access to a real pathname and not just an object's Name(). for a_path in paths: self._AddPathToDict(pbxbuildfile, a_path) # If another PBXBuildFile references this XCFileLikeElement, there's a # problem. if ( xcfilelikeelement in self._files_by_xcfilelikeelement and self._files_by_xcfilelikeelement[xcfilelikeelement] != pbxbuildfile ): raise ValueError( "Found multiple build files for " + xcfilelikeelement.Name() ) self._files_by_xcfilelikeelement[xcfilelikeelement] = pbxbuildfile def AppendBuildFile(self, pbxbuildfile, path=None): # Callers should use this instead of calling # AppendProperty('files', pbxbuildfile) directly because this function # maintains the object's dicts. Better yet, callers can just call AddFile # with a pathname and not worry about building their own PBXBuildFile # objects. self.AppendProperty("files", pbxbuildfile) self._AddBuildFileToDicts(pbxbuildfile, path) def AddFile(self, path, settings=None): (file_group, hierarchical) = self.FileGroup(path) file_ref = file_group.AddOrGetFileByPath(path, hierarchical) if file_ref in self._files_by_xcfilelikeelement and isinstance( file_ref, PBXVariantGroup ): # There's already a PBXBuildFile in this phase corresponding to the # PBXVariantGroup. path just provides a new variant that belongs to # the group. Add the path to the dict. pbxbuildfile = self._files_by_xcfilelikeelement[file_ref] self._AddBuildFileToDicts(pbxbuildfile, path) else: # Add a new PBXBuildFile to get file_ref into the phase. if settings is None: pbxbuildfile = PBXBuildFile({"fileRef": file_ref}) else: pbxbuildfile = PBXBuildFile({"fileRef": file_ref, "settings": settings}) self.AppendBuildFile(pbxbuildfile, path) class PBXHeadersBuildPhase(XCBuildPhase): # No additions to the schema relative to XCBuildPhase. def Name(self): return "Headers" def FileGroup(self, path): return self.PBXProjectAncestor().RootGroupForPath(path) class PBXResourcesBuildPhase(XCBuildPhase): # No additions to the schema relative to XCBuildPhase. def Name(self): return "Resources" def FileGroup(self, path): return self.PBXProjectAncestor().RootGroupForPath(path) class PBXSourcesBuildPhase(XCBuildPhase): # No additions to the schema relative to XCBuildPhase. def Name(self): return "Sources" def FileGroup(self, path): return self.PBXProjectAncestor().RootGroupForPath(path) class PBXFrameworksBuildPhase(XCBuildPhase): # No additions to the schema relative to XCBuildPhase. def Name(self): return "Frameworks" def FileGroup(self, path): (root, ext) = posixpath.splitext(path) if ext != "": ext = ext[1:].lower() if ext == "o": # .o files are added to Xcode Frameworks phases, but conceptually aren't # frameworks, they're more like sources or intermediates. Redirect them # to show up in one of those other groups. return self.PBXProjectAncestor().RootGroupForPath(path) else: return (self.PBXProjectAncestor().FrameworksGroup(), False) class PBXShellScriptBuildPhase(XCBuildPhase): _schema = XCBuildPhase._schema.copy() _schema.update( { "inputPaths": [1, str, 0, 1, []], "name": [0, str, 0, 0], "outputPaths": [1, str, 0, 1, []], "shellPath": [0, str, 0, 1, "/bin/sh"], "shellScript": [0, str, 0, 1], "showEnvVarsInLog": [0, int, 0, 0], } ) def Name(self): if "name" in self._properties: return self._properties["name"] return "ShellScript" class PBXCopyFilesBuildPhase(XCBuildPhase): _schema = XCBuildPhase._schema.copy() _schema.update( { "dstPath": [0, str, 0, 1], "dstSubfolderSpec": [0, int, 0, 1], "name": [0, str, 0, 0], } ) # path_tree_re matches "$(DIR)/path", "$(DIR)/$(DIR2)/path" or just "$(DIR)". # Match group 1 is "DIR", group 3 is "path" or "$(DIR2") or "$(DIR2)/path" # or None. If group 3 is "path", group 4 will be None otherwise group 4 is # "DIR2" and group 6 is "path". path_tree_re = re.compile(r"^\$\((.*?)\)(/(\$\((.*?)\)(/(.*)|)|(.*)|)|)$") # path_tree_{first,second}_to_subfolder map names of Xcode variables to the # associated dstSubfolderSpec property value used in a PBXCopyFilesBuildPhase # object. path_tree_first_to_subfolder = { # Types that can be chosen via the Xcode UI. "BUILT_PRODUCTS_DIR": 16, # Products Directory "BUILT_FRAMEWORKS_DIR": 10, # Not an official Xcode macro. # Existed before support for the # names below was added. Maps to # "Frameworks". } path_tree_second_to_subfolder = { "WRAPPER_NAME": 1, # Wrapper # Although Xcode's friendly name is "Executables", the destination # is demonstrably the value of the build setting # EXECUTABLE_FOLDER_PATH not EXECUTABLES_FOLDER_PATH. "EXECUTABLE_FOLDER_PATH": 6, # Executables. "UNLOCALIZED_RESOURCES_FOLDER_PATH": 7, # Resources "JAVA_FOLDER_PATH": 15, # Java Resources "FRAMEWORKS_FOLDER_PATH": 10, # Frameworks "SHARED_FRAMEWORKS_FOLDER_PATH": 11, # Shared Frameworks "SHARED_SUPPORT_FOLDER_PATH": 12, # Shared Support "PLUGINS_FOLDER_PATH": 13, # PlugIns # For XPC Services, Xcode sets both dstPath and dstSubfolderSpec. # Note that it re-uses the BUILT_PRODUCTS_DIR value for # dstSubfolderSpec. dstPath is set below. "XPCSERVICES_FOLDER_PATH": 16, # XPC Services. } def Name(self): if "name" in self._properties: return self._properties["name"] return "CopyFiles" def FileGroup(self, path): return self.PBXProjectAncestor().RootGroupForPath(path) def SetDestination(self, path): """Set the dstSubfolderSpec and dstPath properties from path. path may be specified in the same notation used for XCHierarchicalElements, specifically, "$(DIR)/path". """ path_tree_match = self.path_tree_re.search(path) if path_tree_match: path_tree = path_tree_match.group(1) if path_tree in self.path_tree_first_to_subfolder: subfolder = self.path_tree_first_to_subfolder[path_tree] relative_path = path_tree_match.group(3) if relative_path is None: relative_path = "" if subfolder == 16 and path_tree_match.group(4) is not None: # BUILT_PRODUCTS_DIR (16) is the first element in a path whose # second element is possibly one of the variable names in # path_tree_second_to_subfolder. Xcode sets the values of all these # variables to relative paths so .gyp files must prefix them with # BUILT_PRODUCTS_DIR, e.g. # $(BUILT_PRODUCTS_DIR)/$(PLUGINS_FOLDER_PATH). Then # xcode_emulation.py can export these variables with the same values # as Xcode yet make & ninja files can determine the absolute path # to the target. Xcode uses the dstSubfolderSpec value set here # to determine the full path. # # An alternative of xcode_emulation.py setting the values to # absolute paths when exporting these variables has been # ruled out because then the values would be different # depending on the build tool. # # Another alternative is to invent new names for the variables used # to match to the subfolder indices in the second table. .gyp files # then will not need to prepend $(BUILT_PRODUCTS_DIR) because # xcode_emulation.py can set the values of those variables to # the absolute paths when exporting. This is possibly the thinking # behind BUILT_FRAMEWORKS_DIR which is used in exactly this manner. # # Requiring prepending BUILT_PRODUCTS_DIR has been chosen because # this same way could be used to specify destinations in .gyp files # that pre-date this addition to GYP. However they would only work # with the Xcode generator. # The previous version of xcode_emulation.py # does not export these variables. Such files will get the benefit # of the Xcode UI showing the proper destination name simply by # regenerating the projects with this version of GYP. path_tree = path_tree_match.group(4) relative_path = path_tree_match.group(6) separator = "/" if path_tree in self.path_tree_second_to_subfolder: subfolder = self.path_tree_second_to_subfolder[path_tree] if relative_path is None: relative_path = "" separator = "" if path_tree == "XPCSERVICES_FOLDER_PATH": relative_path = ( "$(CONTENTS_FOLDER_PATH)/XPCServices" + separator + relative_path ) else: # subfolder = 16 from above # The second element of the path is an unrecognized variable. # Include it and any remaining elements in relative_path. relative_path = path_tree_match.group(3) else: # The path starts with an unrecognized Xcode variable # name like $(SRCROOT). Xcode will still handle this # as an "absolute path" that starts with the variable. subfolder = 0 relative_path = path elif path.startswith("/"): # Special case. Absolute paths are in dstSubfolderSpec 0. subfolder = 0 relative_path = path[1:] else: raise ValueError( f"Can't use path {path} in a {self.__class__.__name__}" ) self._properties["dstPath"] = relative_path self._properties["dstSubfolderSpec"] = subfolder class PBXBuildRule(XCObject): _schema = XCObject._schema.copy() _schema.update( { "compilerSpec": [0, str, 0, 1], "filePatterns": [0, str, 0, 0], "fileType": [0, str, 0, 1], "isEditable": [0, int, 0, 1, 1], "outputFiles": [1, str, 0, 1, []], "script": [0, str, 0, 0], } ) def Name(self): # Not very inspired, but it's what Xcode uses. return self.__class__.__name__ def Hashables(self): # super hashables = XCObject.Hashables(self) # Use the hashables of the weak objects that this object refers to. hashables.append(self._properties["fileType"]) if "filePatterns" in self._properties: hashables.append(self._properties["filePatterns"]) return hashables class PBXContainerItemProxy(XCObject): # When referencing an item in this project file, containerPortal is the # PBXProject root object of this project file. When referencing an item in # another project file, containerPortal is a PBXFileReference identifying # the other project file. # # When serving as a proxy to an XCTarget (in this project file or another), # proxyType is 1. When serving as a proxy to a PBXFileReference (in another # project file), proxyType is 2. Type 2 is used for references to the # producs of the other project file's targets. # # Xcode is weird about remoteGlobalIDString. Usually, it's printed without # a comment, indicating that it's tracked internally simply as a string, but # sometimes it's printed with a comment (usually when the object is initially # created), indicating that it's tracked as a project file object at least # sometimes. This module always tracks it as an object, but contains a hack # to prevent it from printing the comment in the project file output. See # _XCKVPrint. _schema = XCObject._schema.copy() _schema.update( { "containerPortal": [0, XCContainerPortal, 0, 1], "proxyType": [0, int, 0, 1], "remoteGlobalIDString": [0, XCRemoteObject, 0, 1], "remoteInfo": [0, str, 0, 1], } ) def __repr__(self): props = self._properties name = "{}.gyp:{}".format(props["containerPortal"].Name(), props["remoteInfo"]) return f"<{self.__class__.__name__} {name!r} at 0x{id(self):x}>" def Name(self): # Admittedly not the best name, but it's what Xcode uses. return self.__class__.__name__ def Hashables(self): # super hashables = XCObject.Hashables(self) # Use the hashables of the weak objects that this object refers to. hashables.extend(self._properties["containerPortal"].Hashables()) hashables.extend(self._properties["remoteGlobalIDString"].Hashables()) return hashables class PBXTargetDependency(XCObject): # The "target" property accepts an XCTarget object, and obviously not # NoneType. But XCTarget is defined below, so it can't be put into the # schema yet. The definition of PBXTargetDependency can't be moved below # XCTarget because XCTarget's own schema references PBXTargetDependency. # Python doesn't deal well with this circular relationship, and doesn't have # a real way to do forward declarations. To work around, the type of # the "target" property is reset below, after XCTarget is defined. # # At least one of "name" and "target" is required. _schema = XCObject._schema.copy() _schema.update( { "name": [0, str, 0, 0], "target": [0, None.__class__, 0, 0], "targetProxy": [0, PBXContainerItemProxy, 1, 1], } ) def __repr__(self): name = self._properties.get("name") or self._properties["target"].Name() return f"<{self.__class__.__name__} {name!r} at 0x{id(self):x}>" def Name(self): # Admittedly not the best name, but it's what Xcode uses. return self.__class__.__name__ def Hashables(self): # super hashables = XCObject.Hashables(self) # Use the hashables of the weak objects that this object refers to. hashables.extend(self._properties["targetProxy"].Hashables()) return hashables class PBXReferenceProxy(XCFileLikeElement): _schema = XCFileLikeElement._schema.copy() _schema.update( { "fileType": [0, str, 0, 1], "path": [0, str, 0, 1], "remoteRef": [0, PBXContainerItemProxy, 1, 1], } ) class XCTarget(XCRemoteObject): # An XCTarget is really just an XCObject, the XCRemoteObject thing is just # to allow PBXProject to be used in the remoteGlobalIDString property of # PBXContainerItemProxy. # # Setting a "name" property at instantiation may also affect "productName", # which may in turn affect the "PRODUCT_NAME" build setting in children of # "buildConfigurationList". See __init__ below. _schema = XCRemoteObject._schema.copy() _schema.update( { "buildConfigurationList": [ 0, XCConfigurationList, 1, 1, XCConfigurationList(), ], "buildPhases": [1, XCBuildPhase, 1, 1, []], "dependencies": [1, PBXTargetDependency, 1, 1, []], "name": [0, str, 0, 1], "productName": [0, str, 0, 1], } ) def __init__( self, properties=None, id=None, parent=None, force_outdir=None, force_prefix=None, force_extension=None, ): # super XCRemoteObject.__init__(self, properties, id, parent) # Set up additional defaults not expressed in the schema. If a "name" # property was supplied, set "productName" if it is not present. Also set # the "PRODUCT_NAME" build setting in each configuration, but only if # the setting is not present in any build configuration. if "name" in self._properties: if "productName" not in self._properties: self.SetProperty("productName", self._properties["name"]) if "productName" in self._properties: if "buildConfigurationList" in self._properties: configs = self._properties["buildConfigurationList"] if configs.HasBuildSetting("PRODUCT_NAME") == 0: configs.SetBuildSetting( "PRODUCT_NAME", self._properties["productName"] ) def AddDependency(self, other): pbxproject = self.PBXProjectAncestor() other_pbxproject = other.PBXProjectAncestor() if pbxproject == other_pbxproject: # Add a dependency to another target in the same project file. container = PBXContainerItemProxy( { "containerPortal": pbxproject, "proxyType": 1, "remoteGlobalIDString": other, "remoteInfo": other.Name(), } ) dependency = PBXTargetDependency( {"target": other, "targetProxy": container} ) self.AppendProperty("dependencies", dependency) else: # Add a dependency to a target in a different project file. other_project_ref = pbxproject.AddOrGetProjectReference(other_pbxproject)[1] container = PBXContainerItemProxy( { "containerPortal": other_project_ref, "proxyType": 1, "remoteGlobalIDString": other, "remoteInfo": other.Name(), } ) dependency = PBXTargetDependency( {"name": other.Name(), "targetProxy": container} ) self.AppendProperty("dependencies", dependency) # Proxy all of these through to the build configuration list. def ConfigurationNamed(self, name): return self._properties["buildConfigurationList"].ConfigurationNamed(name) def DefaultConfiguration(self): return self._properties["buildConfigurationList"].DefaultConfiguration() def HasBuildSetting(self, key): return self._properties["buildConfigurationList"].HasBuildSetting(key) def GetBuildSetting(self, key): return self._properties["buildConfigurationList"].GetBuildSetting(key) def SetBuildSetting(self, key, value): return self._properties["buildConfigurationList"].SetBuildSetting(key, value) def AppendBuildSetting(self, key, value): return self._properties["buildConfigurationList"].AppendBuildSetting(key, value) def DelBuildSetting(self, key): return self._properties["buildConfigurationList"].DelBuildSetting(key) # Redefine the type of the "target" property. See PBXTargetDependency._schema # above. PBXTargetDependency._schema["target"][1] = XCTarget class PBXNativeTarget(XCTarget): # buildPhases is overridden in the schema to be able to set defaults. # # NOTE: Contrary to most objects, it is advisable to set parent when # constructing PBXNativeTarget. A parent of an XCTarget must be a PBXProject # object. A parent reference is required for a PBXNativeTarget during # construction to be able to set up the target defaults for productReference, # because a PBXBuildFile object must be created for the target and it must # be added to the PBXProject's mainGroup hierarchy. _schema = XCTarget._schema.copy() _schema.update( { "buildPhases": [ 1, XCBuildPhase, 1, 1, [PBXSourcesBuildPhase(), PBXFrameworksBuildPhase()], ], "buildRules": [1, PBXBuildRule, 1, 1, []], "productReference": [0, PBXFileReference, 0, 1], "productType": [0, str, 0, 1], } ) # Mapping from Xcode product-types to settings. The settings are: # filetype : used for explicitFileType in the project file # prefix : the prefix for the file name # suffix : the suffix for the file name _product_filetypes = { "com.apple.product-type.application": ["wrapper.application", "", ".app"], "com.apple.product-type.application.watchapp": [ "wrapper.application", "", ".app", ], "com.apple.product-type.watchkit-extension": [ "wrapper.app-extension", "", ".appex", ], "com.apple.product-type.app-extension": ["wrapper.app-extension", "", ".appex"], "com.apple.product-type.bundle": ["wrapper.cfbundle", "", ".bundle"], "com.apple.product-type.framework": ["wrapper.framework", "", ".framework"], "com.apple.product-type.library.dynamic": [ "compiled.mach-o.dylib", "lib", ".dylib", ], "com.apple.product-type.library.static": ["archive.ar", "lib", ".a"], "com.apple.product-type.tool": ["compiled.mach-o.executable", "", ""], "com.apple.product-type.bundle.unit-test": ["wrapper.cfbundle", "", ".xctest"], "com.apple.product-type.bundle.ui-testing": ["wrapper.cfbundle", "", ".xctest"], "com.googlecode.gyp.xcode.bundle": ["compiled.mach-o.dylib", "", ".so"], "com.apple.product-type.kernel-extension": ["wrapper.kext", "", ".kext"], } def __init__( self, properties=None, id=None, parent=None, force_outdir=None, force_prefix=None, force_extension=None, ): # super XCTarget.__init__(self, properties, id, parent) if ( "productName" in self._properties and "productType" in self._properties and "productReference" not in self._properties and self._properties["productType"] in self._product_filetypes ): products_group = None pbxproject = self.PBXProjectAncestor() if pbxproject is not None: products_group = pbxproject.ProductsGroup() if products_group is not None: (filetype, prefix, suffix) = self._product_filetypes[ self._properties["productType"] ] # Xcode does not have a distinct type for loadable modules that are # pure BSD targets (not in a bundle wrapper). GYP allows such modules # to be specified by setting a target type to loadable_module without # having mac_bundle set. These are mapped to the pseudo-product type # com.googlecode.gyp.xcode.bundle. # # By picking up this special type and converting it to a dynamic # library (com.apple.product-type.library.dynamic) with fix-ups, # single-file loadable modules can be produced. # # MACH_O_TYPE is changed to mh_bundle to produce the proper file type # (as opposed to mh_dylib). In order for linking to succeed, # DYLIB_CURRENT_VERSION and DYLIB_COMPATIBILITY_VERSION must be # cleared. They are meaningless for type mh_bundle. # # Finally, the .so extension is forcibly applied over the default # (.dylib), unless another forced extension is already selected. # .dylib is plainly wrong, and .bundle is used by loadable_modules in # bundle wrappers (com.apple.product-type.bundle). .so seems an odd # choice because it's used as the extension on many other systems that # don't distinguish between linkable shared libraries and non-linkable # loadable modules, but there's precedent: Python loadable modules on # Mac OS X use an .so extension. if self._properties["productType"] == "com.googlecode.gyp.xcode.bundle": self._properties[ "productType" ] = "com.apple.product-type.library.dynamic" self.SetBuildSetting("MACH_O_TYPE", "mh_bundle") self.SetBuildSetting("DYLIB_CURRENT_VERSION", "") self.SetBuildSetting("DYLIB_COMPATIBILITY_VERSION", "") if force_extension is None: force_extension = suffix[1:] if ( self._properties["productType"] == "com.apple.product-type-bundle.unit.test" or self._properties["productType"] == "com.apple.product-type-bundle.ui-testing" ): if force_extension is None: force_extension = suffix[1:] if force_extension is not None: # If it's a wrapper (bundle), set WRAPPER_EXTENSION. # Extension override. suffix = "." + force_extension if filetype.startswith("wrapper."): self.SetBuildSetting("WRAPPER_EXTENSION", force_extension) else: self.SetBuildSetting("EXECUTABLE_EXTENSION", force_extension) if filetype.startswith("compiled.mach-o.executable"): product_name = self._properties["productName"] product_name += suffix suffix = "" self.SetProperty("productName", product_name) self.SetBuildSetting("PRODUCT_NAME", product_name) # Xcode handles most prefixes based on the target type, however there # are exceptions. If a "BSD Dynamic Library" target is added in the # Xcode UI, Xcode sets EXECUTABLE_PREFIX. This check duplicates that # behavior. if force_prefix is not None: prefix = force_prefix if filetype.startswith("wrapper."): self.SetBuildSetting("WRAPPER_PREFIX", prefix) else: self.SetBuildSetting("EXECUTABLE_PREFIX", prefix) if force_outdir is not None: self.SetBuildSetting("TARGET_BUILD_DIR", force_outdir) # TODO(tvl): Remove the below hack. # http://code.google.com/p/gyp/issues/detail?id=122 # Some targets include the prefix in the target_name. These targets # really should just add a product_name setting that doesn't include # the prefix. For example: # target_name = 'libevent', product_name = 'event' # This check cleans up for them. product_name = self._properties["productName"] prefix_len = len(prefix) if prefix_len and (product_name[:prefix_len] == prefix): product_name = product_name[prefix_len:] self.SetProperty("productName", product_name) self.SetBuildSetting("PRODUCT_NAME", product_name) ref_props = { "explicitFileType": filetype, "includeInIndex": 0, "path": prefix + product_name + suffix, "sourceTree": "BUILT_PRODUCTS_DIR", } file_ref = PBXFileReference(ref_props) products_group.AppendChild(file_ref) self.SetProperty("productReference", file_ref) def GetBuildPhaseByType(self, type): if "buildPhases" not in self._properties: return None the_phase = None for phase in self._properties["buildPhases"]: if isinstance(phase, type): # Some phases may be present in multiples in a well-formed project file, # but phases like PBXSourcesBuildPhase may only be present singly, and # this function is intended as an aid to GetBuildPhaseByType. Loop # over the entire list of phases and assert if more than one of the # desired type is found. assert the_phase is None the_phase = phase return the_phase def HeadersPhase(self): headers_phase = self.GetBuildPhaseByType(PBXHeadersBuildPhase) if headers_phase is None: headers_phase = PBXHeadersBuildPhase() # The headers phase should come before the resources, sources, and # frameworks phases, if any. insert_at = len(self._properties["buildPhases"]) for index, phase in enumerate(self._properties["buildPhases"]): if ( isinstance(phase, PBXResourcesBuildPhase) or isinstance(phase, PBXSourcesBuildPhase) or isinstance(phase, PBXFrameworksBuildPhase) ): insert_at = index break self._properties["buildPhases"].insert(insert_at, headers_phase) headers_phase.parent = self return headers_phase def ResourcesPhase(self): resources_phase = self.GetBuildPhaseByType(PBXResourcesBuildPhase) if resources_phase is None: resources_phase = PBXResourcesBuildPhase() # The resources phase should come before the sources and frameworks # phases, if any. insert_at = len(self._properties["buildPhases"]) for index, phase in enumerate(self._properties["buildPhases"]): if isinstance(phase, PBXSourcesBuildPhase) or isinstance( phase, PBXFrameworksBuildPhase ): insert_at = index break self._properties["buildPhases"].insert(insert_at, resources_phase) resources_phase.parent = self return resources_phase def SourcesPhase(self): sources_phase = self.GetBuildPhaseByType(PBXSourcesBuildPhase) if sources_phase is None: sources_phase = PBXSourcesBuildPhase() self.AppendProperty("buildPhases", sources_phase) return sources_phase def FrameworksPhase(self): frameworks_phase = self.GetBuildPhaseByType(PBXFrameworksBuildPhase) if frameworks_phase is None: frameworks_phase = PBXFrameworksBuildPhase() self.AppendProperty("buildPhases", frameworks_phase) return frameworks_phase def AddDependency(self, other): # super XCTarget.AddDependency(self, other) static_library_type = "com.apple.product-type.library.static" shared_library_type = "com.apple.product-type.library.dynamic" framework_type = "com.apple.product-type.framework" if ( isinstance(other, PBXNativeTarget) and "productType" in self._properties and self._properties["productType"] != static_library_type and "productType" in other._properties and ( other._properties["productType"] == static_library_type or ( ( other._properties["productType"] == shared_library_type or other._properties["productType"] == framework_type ) and ( (not other.HasBuildSetting("MACH_O_TYPE")) or other.GetBuildSetting("MACH_O_TYPE") != "mh_bundle" ) ) ) ): file_ref = other.GetProperty("productReference") pbxproject = self.PBXProjectAncestor() other_pbxproject = other.PBXProjectAncestor() if pbxproject != other_pbxproject: other_project_product_group = pbxproject.AddOrGetProjectReference( other_pbxproject )[0] file_ref = other_project_product_group.GetChildByRemoteObject(file_ref) self.FrameworksPhase().AppendProperty( "files", PBXBuildFile({"fileRef": file_ref}) ) class PBXAggregateTarget(XCTarget): pass class PBXProject(XCContainerPortal): # A PBXProject is really just an XCObject, the XCContainerPortal thing is # just to allow PBXProject to be used in the containerPortal property of # PBXContainerItemProxy. """ Attributes: path: "sample.xcodeproj". TODO(mark) Document me! _other_pbxprojects: A dictionary, keyed by other PBXProject objects. Each value is a reference to the dict in the projectReferences list associated with the keyed PBXProject. """ _schema = XCContainerPortal._schema.copy() _schema.update( { "attributes": [0, dict, 0, 0], "buildConfigurationList": [ 0, XCConfigurationList, 1, 1, XCConfigurationList(), ], "compatibilityVersion": [0, str, 0, 1, "Xcode 3.2"], "hasScannedForEncodings": [0, int, 0, 1, 1], "mainGroup": [0, PBXGroup, 1, 1, PBXGroup()], "projectDirPath": [0, str, 0, 1, ""], "projectReferences": [1, dict, 0, 0], "projectRoot": [0, str, 0, 1, ""], "targets": [1, XCTarget, 1, 1, []], } ) def __init__(self, properties=None, id=None, parent=None, path=None): self.path = path self._other_pbxprojects = {} # super return XCContainerPortal.__init__(self, properties, id, parent) def Name(self): name = self.path if name[-10:] == ".xcodeproj": name = name[:-10] return posixpath.basename(name) def Path(self): return self.path def Comment(self): return "Project object" def Children(self): # super children = XCContainerPortal.Children(self) # Add children that the schema doesn't know about. Maybe there's a more # elegant way around this, but this is the only case where we need to own # objects in a dictionary (that is itself in a list), and three lines for # a one-off isn't that big a deal. if "projectReferences" in self._properties: for reference in self._properties["projectReferences"]: children.append(reference["ProductGroup"]) return children def PBXProjectAncestor(self): return self def _GroupByName(self, name): if "mainGroup" not in self._properties: self.SetProperty("mainGroup", PBXGroup()) main_group = self._properties["mainGroup"] group = main_group.GetChildByName(name) if group is None: group = PBXGroup({"name": name}) main_group.AppendChild(group) return group # SourceGroup and ProductsGroup are created by default in Xcode's own # templates. def SourceGroup(self): return self._GroupByName("Source") def ProductsGroup(self): return self._GroupByName("Products") # IntermediatesGroup is used to collect source-like files that are generated # by rules or script phases and are placed in intermediate directories such # as DerivedSources. def IntermediatesGroup(self): return self._GroupByName("Intermediates") # FrameworksGroup and ProjectsGroup are top-level groups used to collect # frameworks and projects. def FrameworksGroup(self): return self._GroupByName("Frameworks") def ProjectsGroup(self): return self._GroupByName("Projects") def RootGroupForPath(self, path): """Returns a PBXGroup child of this object to which path should be added. This method is intended to choose between SourceGroup and IntermediatesGroup on the basis of whether path is present in a source directory or an intermediates directory. For the purposes of this determination, any path located within a derived file directory such as PROJECT_DERIVED_FILE_DIR is treated as being in an intermediates directory. The returned value is a two-element tuple. The first element is the PBXGroup, and the second element specifies whether that group should be organized hierarchically (True) or as a single flat list (False). """ # TODO(mark): make this a class variable and bind to self on call? # Also, this list is nowhere near exhaustive. # INTERMEDIATE_DIR and SHARED_INTERMEDIATE_DIR are used by # gyp.generator.xcode. There should probably be some way for that module # to push the names in, rather than having to hard-code them here. source_tree_groups = { "DERIVED_FILE_DIR": (self.IntermediatesGroup, True), "INTERMEDIATE_DIR": (self.IntermediatesGroup, True), "PROJECT_DERIVED_FILE_DIR": (self.IntermediatesGroup, True), "SHARED_INTERMEDIATE_DIR": (self.IntermediatesGroup, True), } (source_tree, path) = SourceTreeAndPathFromPath(path) if source_tree is not None and source_tree in source_tree_groups: (group_func, hierarchical) = source_tree_groups[source_tree] group = group_func() return (group, hierarchical) # TODO(mark): make additional choices based on file extension. return (self.SourceGroup(), True) def AddOrGetFileInRootGroup(self, path): """Returns a PBXFileReference corresponding to path in the correct group according to RootGroupForPath's heuristics. If an existing PBXFileReference for path exists, it will be returned. Otherwise, one will be created and returned. """ (group, hierarchical) = self.RootGroupForPath(path) return group.AddOrGetFileByPath(path, hierarchical) def RootGroupsTakeOverOnlyChildren(self, recurse=False): """Calls TakeOverOnlyChild for all groups in the main group.""" for group in self._properties["mainGroup"]._properties["children"]: if isinstance(group, PBXGroup): group.TakeOverOnlyChild(recurse) def SortGroups(self): # Sort the children of the mainGroup (like "Source" and "Products") # according to their defined order. self._properties["mainGroup"]._properties["children"] = sorted( self._properties["mainGroup"]._properties["children"], key=cmp_to_key(lambda x, y: x.CompareRootGroup(y)), ) # Sort everything else by putting group before files, and going # alphabetically by name within sections of groups and files. SortGroup # is recursive. for group in self._properties["mainGroup"]._properties["children"]: if not isinstance(group, PBXGroup): continue if group.Name() == "Products": # The Products group is a special case. Instead of sorting # alphabetically, sort things in the order of the targets that # produce the products. To do this, just build up a new list of # products based on the targets. products = [] for target in self._properties["targets"]: if not isinstance(target, PBXNativeTarget): continue product = target._properties["productReference"] # Make sure that the product is already in the products group. assert product in group._properties["children"] products.append(product) # Make sure that this process doesn't miss anything that was already # in the products group. assert len(products) == len(group._properties["children"]) group._properties["children"] = products else: group.SortGroup() def AddOrGetProjectReference(self, other_pbxproject): """Add a reference to another project file (via PBXProject object) to this one. Returns [ProductGroup, ProjectRef]. ProductGroup is a PBXGroup object in this project file that contains a PBXReferenceProxy object for each product of each PBXNativeTarget in the other project file. ProjectRef is a PBXFileReference to the other project file. If this project file already references the other project file, the existing ProductGroup and ProjectRef are returned. The ProductGroup will still be updated if necessary. """ if "projectReferences" not in self._properties: self._properties["projectReferences"] = [] product_group = None project_ref = None if other_pbxproject not in self._other_pbxprojects: # This project file isn't yet linked to the other one. Establish the # link. product_group = PBXGroup({"name": "Products"}) # ProductGroup is strong. product_group.parent = self # There's nothing unique about this PBXGroup, and if left alone, it will # wind up with the same set of hashables as all other PBXGroup objects # owned by the projectReferences list. Add the hashables of the # remote PBXProject that it's related to. product_group._hashables.extend(other_pbxproject.Hashables()) # The other project reports its path as relative to the same directory # that this project's path is relative to. The other project's path # is not necessarily already relative to this project. Figure out the # pathname that this project needs to use to refer to the other one. this_path = posixpath.dirname(self.Path()) projectDirPath = self.GetProperty("projectDirPath") if projectDirPath: if posixpath.isabs(projectDirPath[0]): this_path = projectDirPath else: this_path = posixpath.join(this_path, projectDirPath) other_path = gyp.common.RelativePath(other_pbxproject.Path(), this_path) # ProjectRef is weak (it's owned by the mainGroup hierarchy). project_ref = PBXFileReference( { "lastKnownFileType": "wrapper.pb-project", "path": other_path, "sourceTree": "SOURCE_ROOT", } ) self.ProjectsGroup().AppendChild(project_ref) ref_dict = {"ProductGroup": product_group, "ProjectRef": project_ref} self._other_pbxprojects[other_pbxproject] = ref_dict self.AppendProperty("projectReferences", ref_dict) # Xcode seems to sort this list case-insensitively self._properties["projectReferences"] = sorted( self._properties["projectReferences"], key=lambda x: x["ProjectRef"].Name().lower ) else: # The link already exists. Pull out the relevnt data. project_ref_dict = self._other_pbxprojects[other_pbxproject] product_group = project_ref_dict["ProductGroup"] project_ref = project_ref_dict["ProjectRef"] self._SetUpProductReferences(other_pbxproject, product_group, project_ref) inherit_unique_symroot = self._AllSymrootsUnique(other_pbxproject, False) targets = other_pbxproject.GetProperty("targets") if all(self._AllSymrootsUnique(t, inherit_unique_symroot) for t in targets): dir_path = project_ref._properties["path"] product_group._hashables.extend(dir_path) return [product_group, project_ref] def _AllSymrootsUnique(self, target, inherit_unique_symroot): # Returns True if all configurations have a unique 'SYMROOT' attribute. # The value of inherit_unique_symroot decides, if a configuration is assumed # to inherit a unique 'SYMROOT' attribute from its parent, if it doesn't # define an explicit value for 'SYMROOT'. symroots = self._DefinedSymroots(target) for s in self._DefinedSymroots(target): if ( s is not None and not self._IsUniqueSymrootForTarget(s) or s is None and not inherit_unique_symroot ): return False return True if symroots else inherit_unique_symroot def _DefinedSymroots(self, target): # Returns all values for the 'SYMROOT' attribute defined in all # configurations for this target. If any configuration doesn't define the # 'SYMROOT' attribute, None is added to the returned set. If all # configurations don't define the 'SYMROOT' attribute, an empty set is # returned. config_list = target.GetProperty("buildConfigurationList") symroots = set() for config in config_list.GetProperty("buildConfigurations"): setting = config.GetProperty("buildSettings") if "SYMROOT" in setting: symroots.add(setting["SYMROOT"]) else: symroots.add(None) if len(symroots) == 1 and None in symroots: return set() return symroots def _IsUniqueSymrootForTarget(self, symroot): # This method returns True if all configurations in target contain a # 'SYMROOT' attribute that is unique for the given target. A value is # unique, if the Xcode macro '$SRCROOT' appears in it in any form. uniquifier = ["$SRCROOT", "$(SRCROOT)"] if any(x in symroot for x in uniquifier): return True return False def _SetUpProductReferences(self, other_pbxproject, product_group, project_ref): # TODO(mark): This only adds references to products in other_pbxproject # when they don't exist in this pbxproject. Perhaps it should also # remove references from this pbxproject that are no longer present in # other_pbxproject. Perhaps it should update various properties if they # change. for target in other_pbxproject._properties["targets"]: if not isinstance(target, PBXNativeTarget): continue other_fileref = target._properties["productReference"] if product_group.GetChildByRemoteObject(other_fileref) is None: # Xcode sets remoteInfo to the name of the target and not the name # of its product, despite this proxy being a reference to the product. container_item = PBXContainerItemProxy( { "containerPortal": project_ref, "proxyType": 2, "remoteGlobalIDString": other_fileref, "remoteInfo": target.Name(), } ) # TODO(mark): Does sourceTree get copied straight over from the other # project? Can the other project ever have lastKnownFileType here # instead of explicitFileType? (Use it if so?) Can path ever be # unset? (I don't think so.) Can other_fileref have name set, and # does it impact the PBXReferenceProxy if so? These are the questions # that perhaps will be answered one day. reference_proxy = PBXReferenceProxy( { "fileType": other_fileref._properties["explicitFileType"], "path": other_fileref._properties["path"], "sourceTree": other_fileref._properties["sourceTree"], "remoteRef": container_item, } ) product_group.AppendChild(reference_proxy) def SortRemoteProductReferences(self): # For each remote project file, sort the associated ProductGroup in the # same order that the targets are sorted in the remote project file. This # is the sort order used by Xcode. def CompareProducts(x, y, remote_products): # x and y are PBXReferenceProxy objects. Go through their associated # PBXContainerItem to get the remote PBXFileReference, which will be # present in the remote_products list. x_remote = x._properties["remoteRef"]._properties["remoteGlobalIDString"] y_remote = y._properties["remoteRef"]._properties["remoteGlobalIDString"] x_index = remote_products.index(x_remote) y_index = remote_products.index(y_remote) # Use the order of each remote PBXFileReference in remote_products to # determine the sort order. return cmp(x_index, y_index) for other_pbxproject, ref_dict in self._other_pbxprojects.items(): # Build up a list of products in the remote project file, ordered the # same as the targets that produce them. remote_products = [] for target in other_pbxproject._properties["targets"]: if not isinstance(target, PBXNativeTarget): continue remote_products.append(target._properties["productReference"]) # Sort the PBXReferenceProxy children according to the list of remote # products. product_group = ref_dict["ProductGroup"] product_group._properties["children"] = sorted( product_group._properties["children"], key=cmp_to_key( lambda x, y, rp=remote_products: CompareProducts(x, y, rp)), ) class XCProjectFile(XCObject): _schema = XCObject._schema.copy() _schema.update( { "archiveVersion": [0, int, 0, 1, 1], "classes": [0, dict, 0, 1, {}], "objectVersion": [0, int, 0, 1, 46], "rootObject": [0, PBXProject, 1, 1], } ) def ComputeIDs(self, recursive=True, overwrite=True, hash=None): # Although XCProjectFile is implemented here as an XCObject, it's not a # proper object in the Xcode sense, and it certainly doesn't have its own # ID. Pass through an attempt to update IDs to the real root object. if recursive: self._properties["rootObject"].ComputeIDs(recursive, overwrite, hash) def Print(self, file=sys.stdout): self.VerifyHasRequiredProperties() # Add the special "objects" property, which will be caught and handled # separately during printing. This structure allows a fairly standard # loop do the normal printing. self._properties["objects"] = {} self._XCPrint(file, 0, "// !$*UTF8*$!\n") if self._should_print_single_line: self._XCPrint(file, 0, "{ ") else: self._XCPrint(file, 0, "{\n") for property, value in sorted( self._properties.items() ): if property == "objects": self._PrintObjects(file) else: self._XCKVPrint(file, 1, property, value) self._XCPrint(file, 0, "}\n") del self._properties["objects"] def _PrintObjects(self, file): if self._should_print_single_line: self._XCPrint(file, 0, "objects = {") else: self._XCPrint(file, 1, "objects = {\n") objects_by_class = {} for object in self.Descendants(): if object == self: continue class_name = object.__class__.__name__ if class_name not in objects_by_class: objects_by_class[class_name] = [] objects_by_class[class_name].append(object) for class_name in sorted(objects_by_class): self._XCPrint(file, 0, "\n") self._XCPrint(file, 0, "/* Begin " + class_name + " section */\n") for object in sorted( objects_by_class[class_name], key=attrgetter("id") ): object.Print(file) self._XCPrint(file, 0, "/* End " + class_name + " section */\n") if self._should_print_single_line: self._XCPrint(file, 0, "}; ") else: self._XCPrint(file, 1, "};\n") # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ This module contains classes that help to emulate xcodebuild behavior on top of other build systems, such as make and ninja. """ import copy import gyp.common import os import os.path import re import shlex import subprocess import sys from gyp.common import GypError # Populated lazily by XcodeVersion, for efficiency, and to fix an issue when # "xcodebuild" is called too quickly (it has been found to return incorrect # version number). XCODE_VERSION_CACHE = None # Populated lazily by GetXcodeArchsDefault, to an |XcodeArchsDefault| instance # corresponding to the installed version of Xcode. XCODE_ARCHS_DEFAULT_CACHE = None def XcodeArchsVariableMapping(archs, archs_including_64_bit=None): """Constructs a dictionary with expansion for $(ARCHS_STANDARD) variable, and optionally for $(ARCHS_STANDARD_INCLUDING_64_BIT).""" mapping = {"$(ARCHS_STANDARD)": archs} if archs_including_64_bit: mapping["$(ARCHS_STANDARD_INCLUDING_64_BIT)"] = archs_including_64_bit return mapping class XcodeArchsDefault: """A class to resolve ARCHS variable from xcode_settings, resolving Xcode macros and implementing filtering by VALID_ARCHS. The expansion of macros depends on the SDKROOT used ("macosx", "iphoneos", "iphonesimulator") and on the version of Xcode. """ # Match variable like $(ARCHS_STANDARD). variable_pattern = re.compile(r"\$\([a-zA-Z_][a-zA-Z0-9_]*\)$") def __init__(self, default, mac, iphonesimulator, iphoneos): self._default = (default,) self._archs = {"mac": mac, "ios": iphoneos, "iossim": iphonesimulator} def _VariableMapping(self, sdkroot): """Returns the dictionary of variable mapping depending on the SDKROOT.""" sdkroot = sdkroot.lower() if "iphoneos" in sdkroot: return self._archs["ios"] elif "iphonesimulator" in sdkroot: return self._archs["iossim"] else: return self._archs["mac"] def _ExpandArchs(self, archs, sdkroot): """Expands variables references in ARCHS, and remove duplicates.""" variable_mapping = self._VariableMapping(sdkroot) expanded_archs = [] for arch in archs: if self.variable_pattern.match(arch): variable = arch try: variable_expansion = variable_mapping[variable] for arch in variable_expansion: if arch not in expanded_archs: expanded_archs.append(arch) except KeyError: print('Warning: Ignoring unsupported variable "%s".' % variable) elif arch not in expanded_archs: expanded_archs.append(arch) return expanded_archs def ActiveArchs(self, archs, valid_archs, sdkroot): """Expands variables references in ARCHS, and filter by VALID_ARCHS if it is defined (if not set, Xcode accept any value in ARCHS, otherwise, only values present in VALID_ARCHS are kept).""" expanded_archs = self._ExpandArchs(archs or self._default, sdkroot or "") if valid_archs: filtered_archs = [] for arch in expanded_archs: if arch in valid_archs: filtered_archs.append(arch) expanded_archs = filtered_archs return expanded_archs def GetXcodeArchsDefault(): """Returns the |XcodeArchsDefault| object to use to expand ARCHS for the installed version of Xcode. The default values used by Xcode for ARCHS and the expansion of the variables depends on the version of Xcode used. For all version anterior to Xcode 5.0 or posterior to Xcode 5.1 included uses $(ARCHS_STANDARD) if ARCHS is unset, while Xcode 5.0 to 5.0.2 uses $(ARCHS_STANDARD_INCLUDING_64_BIT). This variable was added to Xcode 5.0 and deprecated with Xcode 5.1. For "macosx" SDKROOT, all version starting with Xcode 5.0 includes 64-bit architecture as part of $(ARCHS_STANDARD) and default to only building it. For "iphoneos" and "iphonesimulator" SDKROOT, 64-bit architectures are part of $(ARCHS_STANDARD_INCLUDING_64_BIT) from Xcode 5.0. From Xcode 5.1, they are also part of $(ARCHS_STANDARD). All these rules are coded in the construction of the |XcodeArchsDefault| object to use depending on the version of Xcode detected. The object is for performance reason.""" global XCODE_ARCHS_DEFAULT_CACHE if XCODE_ARCHS_DEFAULT_CACHE: return XCODE_ARCHS_DEFAULT_CACHE xcode_version, _ = XcodeVersion() if xcode_version < "0500": XCODE_ARCHS_DEFAULT_CACHE = XcodeArchsDefault( "$(ARCHS_STANDARD)", XcodeArchsVariableMapping(["i386"]), XcodeArchsVariableMapping(["i386"]), XcodeArchsVariableMapping(["armv7"]), ) elif xcode_version < "0510": XCODE_ARCHS_DEFAULT_CACHE = XcodeArchsDefault( "$(ARCHS_STANDARD_INCLUDING_64_BIT)", XcodeArchsVariableMapping(["x86_64"], ["x86_64"]), XcodeArchsVariableMapping(["i386"], ["i386", "x86_64"]), XcodeArchsVariableMapping( ["armv7", "armv7s"], ["armv7", "armv7s", "arm64"] ), ) else: XCODE_ARCHS_DEFAULT_CACHE = XcodeArchsDefault( "$(ARCHS_STANDARD)", XcodeArchsVariableMapping(["x86_64"], ["x86_64"]), XcodeArchsVariableMapping(["i386", "x86_64"], ["i386", "x86_64"]), XcodeArchsVariableMapping( ["armv7", "armv7s", "arm64"], ["armv7", "armv7s", "arm64"] ), ) return XCODE_ARCHS_DEFAULT_CACHE class XcodeSettings: """A class that understands the gyp 'xcode_settings' object.""" # Populated lazily by _SdkPath(). Shared by all XcodeSettings, so cached # at class-level for efficiency. _sdk_path_cache = {} _platform_path_cache = {} _sdk_root_cache = {} # Populated lazily by GetExtraPlistItems(). Shared by all XcodeSettings, so # cached at class-level for efficiency. _plist_cache = {} # Populated lazily by GetIOSPostbuilds. Shared by all XcodeSettings, so # cached at class-level for efficiency. _codesigning_key_cache = {} def __init__(self, spec): self.spec = spec self.isIOS = False self.mac_toolchain_dir = None self.header_map_path = None # Per-target 'xcode_settings' are pushed down into configs earlier by gyp. # This means self.xcode_settings[config] always contains all settings # for that config -- the per-target settings as well. Settings that are # the same for all configs are implicitly per-target settings. self.xcode_settings = {} configs = spec["configurations"] for configname, config in configs.items(): self.xcode_settings[configname] = config.get("xcode_settings", {}) self._ConvertConditionalKeys(configname) if self.xcode_settings[configname].get("IPHONEOS_DEPLOYMENT_TARGET", None): self.isIOS = True # This is only non-None temporarily during the execution of some methods. self.configname = None # Used by _AdjustLibrary to match .a and .dylib entries in libraries. self.library_re = re.compile(r"^lib([^/]+)\.(a|dylib)$") def _ConvertConditionalKeys(self, configname): """Converts or warns on conditional keys. Xcode supports conditional keys, such as CODE_SIGN_IDENTITY[sdk=iphoneos*]. This is a partial implementation with some keys converted while the rest force a warning.""" settings = self.xcode_settings[configname] conditional_keys = [key for key in settings if key.endswith("]")] for key in conditional_keys: # If you need more, speak up at http://crbug.com/122592 if key.endswith("[sdk=iphoneos*]"): if configname.endswith("iphoneos"): new_key = key.split("[")[0] settings[new_key] = settings[key] else: print( "Warning: Conditional keys not implemented, ignoring:", " ".join(conditional_keys), ) del settings[key] def _Settings(self): assert self.configname return self.xcode_settings[self.configname] def _Test(self, test_key, cond_key, default): return self._Settings().get(test_key, default) == cond_key def _Appendf(self, lst, test_key, format_str, default=None): if test_key in self._Settings(): lst.append(format_str % str(self._Settings()[test_key])) elif default: lst.append(format_str % str(default)) def _WarnUnimplemented(self, test_key): if test_key in self._Settings(): print('Warning: Ignoring not yet implemented key "%s".' % test_key) def IsBinaryOutputFormat(self, configname): default = "binary" if self.isIOS else "xml" format = self.xcode_settings[configname].get("INFOPLIST_OUTPUT_FORMAT", default) return format == "binary" def IsIosFramework(self): return self.spec["type"] == "shared_library" and self._IsBundle() and self.isIOS def _IsBundle(self): return ( int(self.spec.get("mac_bundle", 0)) != 0 or self._IsXCTest() or self._IsXCUiTest() ) def _IsXCTest(self): return int(self.spec.get("mac_xctest_bundle", 0)) != 0 def _IsXCUiTest(self): return int(self.spec.get("mac_xcuitest_bundle", 0)) != 0 def _IsIosAppExtension(self): return int(self.spec.get("ios_app_extension", 0)) != 0 def _IsIosWatchKitExtension(self): return int(self.spec.get("ios_watchkit_extension", 0)) != 0 def _IsIosWatchApp(self): return int(self.spec.get("ios_watch_app", 0)) != 0 def GetFrameworkVersion(self): """Returns the framework version of the current target. Only valid for bundles.""" assert self._IsBundle() return self.GetPerTargetSetting("FRAMEWORK_VERSION", default="A") def GetWrapperExtension(self): """Returns the bundle extension (.app, .framework, .plugin, etc). Only valid for bundles.""" assert self._IsBundle() if self.spec["type"] in ("loadable_module", "shared_library"): default_wrapper_extension = { "loadable_module": "bundle", "shared_library": "framework", }[self.spec["type"]] wrapper_extension = self.GetPerTargetSetting( "WRAPPER_EXTENSION", default=default_wrapper_extension ) return "." + self.spec.get("product_extension", wrapper_extension) elif self.spec["type"] == "executable": if self._IsIosAppExtension() or self._IsIosWatchKitExtension(): return "." + self.spec.get("product_extension", "appex") else: return "." + self.spec.get("product_extension", "app") else: assert False, "Don't know extension for '{}', target '{}'".format( self.spec["type"], self.spec["target_name"], ) def GetProductName(self): """Returns PRODUCT_NAME.""" return self.spec.get("product_name", self.spec["target_name"]) def GetFullProductName(self): """Returns FULL_PRODUCT_NAME.""" if self._IsBundle(): return self.GetWrapperName() else: return self._GetStandaloneBinaryPath() def GetWrapperName(self): """Returns the directory name of the bundle represented by this target. Only valid for bundles.""" assert self._IsBundle() return self.GetProductName() + self.GetWrapperExtension() def GetBundleContentsFolderPath(self): """Returns the qualified path to the bundle's contents folder. E.g. Chromium.app/Contents or Foo.bundle/Versions/A. Only valid for bundles.""" if self.isIOS: return self.GetWrapperName() assert self._IsBundle() if self.spec["type"] == "shared_library": return os.path.join( self.GetWrapperName(), "Versions", self.GetFrameworkVersion() ) else: # loadable_modules have a 'Contents' folder like executables. return os.path.join(self.GetWrapperName(), "Contents") def GetBundleResourceFolder(self): """Returns the qualified path to the bundle's resource folder. E.g. Chromium.app/Contents/Resources. Only valid for bundles.""" assert self._IsBundle() if self.isIOS: return self.GetBundleContentsFolderPath() return os.path.join(self.GetBundleContentsFolderPath(), "Resources") def GetBundleExecutableFolderPath(self): """Returns the qualified path to the bundle's executables folder. E.g. Chromium.app/Contents/MacOS. Only valid for bundles.""" assert self._IsBundle() if self.spec["type"] in ("shared_library") or self.isIOS: return self.GetBundleContentsFolderPath() elif self.spec["type"] in ("executable", "loadable_module"): return os.path.join(self.GetBundleContentsFolderPath(), "MacOS") def GetBundleJavaFolderPath(self): """Returns the qualified path to the bundle's Java resource folder. E.g. Chromium.app/Contents/Resources/Java. Only valid for bundles.""" assert self._IsBundle() return os.path.join(self.GetBundleResourceFolder(), "Java") def GetBundleFrameworksFolderPath(self): """Returns the qualified path to the bundle's frameworks folder. E.g, Chromium.app/Contents/Frameworks. Only valid for bundles.""" assert self._IsBundle() return os.path.join(self.GetBundleContentsFolderPath(), "Frameworks") def GetBundleSharedFrameworksFolderPath(self): """Returns the qualified path to the bundle's frameworks folder. E.g, Chromium.app/Contents/SharedFrameworks. Only valid for bundles.""" assert self._IsBundle() return os.path.join(self.GetBundleContentsFolderPath(), "SharedFrameworks") def GetBundleSharedSupportFolderPath(self): """Returns the qualified path to the bundle's shared support folder. E.g, Chromium.app/Contents/SharedSupport. Only valid for bundles.""" assert self._IsBundle() if self.spec["type"] == "shared_library": return self.GetBundleResourceFolder() else: return os.path.join(self.GetBundleContentsFolderPath(), "SharedSupport") def GetBundlePlugInsFolderPath(self): """Returns the qualified path to the bundle's plugins folder. E.g, Chromium.app/Contents/PlugIns. Only valid for bundles.""" assert self._IsBundle() return os.path.join(self.GetBundleContentsFolderPath(), "PlugIns") def GetBundleXPCServicesFolderPath(self): """Returns the qualified path to the bundle's XPC services folder. E.g, Chromium.app/Contents/XPCServices. Only valid for bundles.""" assert self._IsBundle() return os.path.join(self.GetBundleContentsFolderPath(), "XPCServices") def GetBundlePlistPath(self): """Returns the qualified path to the bundle's plist file. E.g. Chromium.app/Contents/Info.plist. Only valid for bundles.""" assert self._IsBundle() if ( self.spec["type"] in ("executable", "loadable_module") or self.IsIosFramework() ): return os.path.join(self.GetBundleContentsFolderPath(), "Info.plist") else: return os.path.join( self.GetBundleContentsFolderPath(), "Resources", "Info.plist" ) def GetProductType(self): """Returns the PRODUCT_TYPE of this target.""" if self._IsIosAppExtension(): assert self._IsBundle(), ( "ios_app_extension flag requires mac_bundle " "(target %s)" % self.spec["target_name"] ) return "com.apple.product-type.app-extension" if self._IsIosWatchKitExtension(): assert self._IsBundle(), ( "ios_watchkit_extension flag requires " "mac_bundle (target %s)" % self.spec["target_name"] ) return "com.apple.product-type.watchkit-extension" if self._IsIosWatchApp(): assert self._IsBundle(), ( "ios_watch_app flag requires mac_bundle " "(target %s)" % self.spec["target_name"] ) return "com.apple.product-type.application.watchapp" if self._IsXCUiTest(): assert self._IsBundle(), ( "mac_xcuitest_bundle flag requires mac_bundle " "(target %s)" % self.spec["target_name"] ) return "com.apple.product-type.bundle.ui-testing" if self._IsBundle(): return { "executable": "com.apple.product-type.application", "loadable_module": "com.apple.product-type.bundle", "shared_library": "com.apple.product-type.framework", }[self.spec["type"]] else: return { "executable": "com.apple.product-type.tool", "loadable_module": "com.apple.product-type.library.dynamic", "shared_library": "com.apple.product-type.library.dynamic", "static_library": "com.apple.product-type.library.static", }[self.spec["type"]] def GetMachOType(self): """Returns the MACH_O_TYPE of this target.""" # Weird, but matches Xcode. if not self._IsBundle() and self.spec["type"] == "executable": return "" return { "executable": "mh_execute", "static_library": "staticlib", "shared_library": "mh_dylib", "loadable_module": "mh_bundle", }[self.spec["type"]] def _GetBundleBinaryPath(self): """Returns the name of the bundle binary of by this target. E.g. Chromium.app/Contents/MacOS/Chromium. Only valid for bundles.""" assert self._IsBundle() return os.path.join( self.GetBundleExecutableFolderPath(), self.GetExecutableName() ) def _GetStandaloneExecutableSuffix(self): if "product_extension" in self.spec: return "." + self.spec["product_extension"] return { "executable": "", "static_library": ".a", "shared_library": ".dylib", "loadable_module": ".so", }[self.spec["type"]] def _GetStandaloneExecutablePrefix(self): return self.spec.get( "product_prefix", { "executable": "", "static_library": "lib", "shared_library": "lib", # Non-bundled loadable_modules are called foo.so for some reason # (that is, .so and no prefix) with the xcode build -- match that. "loadable_module": "", }[self.spec["type"]], ) def _GetStandaloneBinaryPath(self): """Returns the name of the non-bundle binary represented by this target. E.g. hello_world. Only valid for non-bundles.""" assert not self._IsBundle() assert self.spec["type"] in ( "executable", "shared_library", "static_library", "loadable_module", ), ("Unexpected type %s" % self.spec["type"]) target = self.spec["target_name"] if self.spec["type"] == "static_library": if target[:3] == "lib": target = target[3:] elif self.spec["type"] in ("loadable_module", "shared_library"): if target[:3] == "lib": target = target[3:] target_prefix = self._GetStandaloneExecutablePrefix() target = self.spec.get("product_name", target) target_ext = self._GetStandaloneExecutableSuffix() return target_prefix + target + target_ext def GetExecutableName(self): """Returns the executable name of the bundle represented by this target. E.g. Chromium.""" if self._IsBundle(): return self.spec.get("product_name", self.spec["target_name"]) else: return self._GetStandaloneBinaryPath() def GetExecutablePath(self): """Returns the qualified path to the primary executable of the bundle represented by this target. E.g. Chromium.app/Contents/MacOS/Chromium.""" if self._IsBundle(): return self._GetBundleBinaryPath() else: return self._GetStandaloneBinaryPath() def GetActiveArchs(self, configname): """Returns the architectures this target should be built for.""" config_settings = self.xcode_settings[configname] xcode_archs_default = GetXcodeArchsDefault() return xcode_archs_default.ActiveArchs( config_settings.get("ARCHS"), config_settings.get("VALID_ARCHS"), config_settings.get("SDKROOT"), ) def _GetSdkVersionInfoItem(self, sdk, infoitem): # xcodebuild requires Xcode and can't run on Command Line Tools-only # systems from 10.7 onward. # Since the CLT has no SDK paths anyway, returning None is the # most sensible route and should still do the right thing. try: return GetStdoutQuiet(["xcrun", "--sdk", sdk, infoitem]) except GypError: pass def _SdkRoot(self, configname): if configname is None: configname = self.configname return self.GetPerConfigSetting("SDKROOT", configname, default="") def _XcodePlatformPath(self, configname=None): sdk_root = self._SdkRoot(configname) if sdk_root not in XcodeSettings._platform_path_cache: platform_path = self._GetSdkVersionInfoItem( sdk_root, "--show-sdk-platform-path" ) XcodeSettings._platform_path_cache[sdk_root] = platform_path return XcodeSettings._platform_path_cache[sdk_root] def _SdkPath(self, configname=None): sdk_root = self._SdkRoot(configname) if sdk_root.startswith("/"): return sdk_root return self._XcodeSdkPath(sdk_root) def _XcodeSdkPath(self, sdk_root): if sdk_root not in XcodeSettings._sdk_path_cache: sdk_path = self._GetSdkVersionInfoItem(sdk_root, "--show-sdk-path") XcodeSettings._sdk_path_cache[sdk_root] = sdk_path if sdk_root: XcodeSettings._sdk_root_cache[sdk_path] = sdk_root return XcodeSettings._sdk_path_cache[sdk_root] def _AppendPlatformVersionMinFlags(self, lst): self._Appendf(lst, "MACOSX_DEPLOYMENT_TARGET", "-mmacosx-version-min=%s") if "IPHONEOS_DEPLOYMENT_TARGET" in self._Settings(): # TODO: Implement this better? sdk_path_basename = os.path.basename(self._SdkPath()) if sdk_path_basename.lower().startswith("iphonesimulator"): self._Appendf( lst, "IPHONEOS_DEPLOYMENT_TARGET", "-mios-simulator-version-min=%s" ) else: self._Appendf( lst, "IPHONEOS_DEPLOYMENT_TARGET", "-miphoneos-version-min=%s" ) def GetCflags(self, configname, arch=None): """Returns flags that need to be added to .c, .cc, .m, and .mm compilations.""" # This functions (and the similar ones below) do not offer complete # emulation of all xcode_settings keys. They're implemented on demand. self.configname = configname cflags = [] sdk_root = self._SdkPath() if "SDKROOT" in self._Settings() and sdk_root: cflags.append("-isysroot %s" % sdk_root) if self.header_map_path: cflags.append("-I%s" % self.header_map_path) if self._Test("CLANG_WARN_CONSTANT_CONVERSION", "YES", default="NO"): cflags.append("-Wconstant-conversion") if self._Test("GCC_CHAR_IS_UNSIGNED_CHAR", "YES", default="NO"): cflags.append("-funsigned-char") if self._Test("GCC_CW_ASM_SYNTAX", "YES", default="YES"): cflags.append("-fasm-blocks") if "GCC_DYNAMIC_NO_PIC" in self._Settings(): if self._Settings()["GCC_DYNAMIC_NO_PIC"] == "YES": cflags.append("-mdynamic-no-pic") else: pass # TODO: In this case, it depends on the target. xcode passes # mdynamic-no-pic by default for executable and possibly static lib # according to mento if self._Test("GCC_ENABLE_PASCAL_STRINGS", "YES", default="YES"): cflags.append("-mpascal-strings") self._Appendf(cflags, "GCC_OPTIMIZATION_LEVEL", "-O%s", default="s") if self._Test("GCC_GENERATE_DEBUGGING_SYMBOLS", "YES", default="YES"): dbg_format = self._Settings().get("DEBUG_INFORMATION_FORMAT", "dwarf") if dbg_format == "dwarf": cflags.append("-gdwarf-2") elif dbg_format == "stabs": raise NotImplementedError("stabs debug format is not supported yet.") elif dbg_format == "dwarf-with-dsym": cflags.append("-gdwarf-2") else: raise NotImplementedError("Unknown debug format %s" % dbg_format) if self._Settings().get("GCC_STRICT_ALIASING") == "YES": cflags.append("-fstrict-aliasing") elif self._Settings().get("GCC_STRICT_ALIASING") == "NO": cflags.append("-fno-strict-aliasing") if self._Test("GCC_SYMBOLS_PRIVATE_EXTERN", "YES", default="NO"): cflags.append("-fvisibility=hidden") if self._Test("GCC_TREAT_WARNINGS_AS_ERRORS", "YES", default="NO"): cflags.append("-Werror") if self._Test("GCC_WARN_ABOUT_MISSING_NEWLINE", "YES", default="NO"): cflags.append("-Wnewline-eof") # In Xcode, this is only activated when GCC_COMPILER_VERSION is clang or # llvm-gcc. It also requires a fairly recent libtool, and # if the system clang isn't used, DYLD_LIBRARY_PATH needs to contain the # path to the libLTO.dylib that matches the used clang. if self._Test("LLVM_LTO", "YES", default="NO"): cflags.append("-flto") self._AppendPlatformVersionMinFlags(cflags) # TODO: if self._Test("COPY_PHASE_STRIP", "YES", default="NO"): self._WarnUnimplemented("COPY_PHASE_STRIP") self._WarnUnimplemented("GCC_DEBUGGING_SYMBOLS") self._WarnUnimplemented("GCC_ENABLE_OBJC_EXCEPTIONS") # TODO: This is exported correctly, but assigning to it is not supported. self._WarnUnimplemented("MACH_O_TYPE") self._WarnUnimplemented("PRODUCT_TYPE") # If GYP_CROSSCOMPILE (--cross-compiling), disable architecture-specific # additions and assume these will be provided as required via CC_host, # CXX_host, CC_target and CXX_target. if not gyp.common.CrossCompileRequested(): if arch is not None: archs = [arch] else: assert self.configname archs = self.GetActiveArchs(self.configname) if len(archs) != 1: # TODO: Supporting fat binaries will be annoying. self._WarnUnimplemented("ARCHS") archs = ["i386"] cflags.append("-arch " + archs[0]) if archs[0] in ("i386", "x86_64"): if self._Test("GCC_ENABLE_SSE3_EXTENSIONS", "YES", default="NO"): cflags.append("-msse3") if self._Test( "GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS", "YES", default="NO" ): cflags.append("-mssse3") # Note 3rd 's'. if self._Test("GCC_ENABLE_SSE41_EXTENSIONS", "YES", default="NO"): cflags.append("-msse4.1") if self._Test("GCC_ENABLE_SSE42_EXTENSIONS", "YES", default="NO"): cflags.append("-msse4.2") cflags += self._Settings().get("WARNING_CFLAGS", []) if self._IsXCTest(): platform_root = self._XcodePlatformPath(configname) if platform_root: cflags.append("-F" + platform_root + "/Developer/Library/Frameworks/") if sdk_root: framework_root = sdk_root else: framework_root = "" config = self.spec["configurations"][self.configname] framework_dirs = config.get("mac_framework_dirs", []) for directory in framework_dirs: cflags.append("-F" + directory.replace("$(SDKROOT)", framework_root)) self.configname = None return cflags def GetCflagsC(self, configname): """Returns flags that need to be added to .c, and .m compilations.""" self.configname = configname cflags_c = [] if self._Settings().get("GCC_C_LANGUAGE_STANDARD", "") == "ansi": cflags_c.append("-ansi") else: self._Appendf(cflags_c, "GCC_C_LANGUAGE_STANDARD", "-std=%s") cflags_c += self._Settings().get("OTHER_CFLAGS", []) self.configname = None return cflags_c def GetCflagsCC(self, configname): """Returns flags that need to be added to .cc, and .mm compilations.""" self.configname = configname cflags_cc = [] clang_cxx_language_standard = self._Settings().get( "CLANG_CXX_LANGUAGE_STANDARD" ) # Note: Don't make c++0x to c++11 so that c++0x can be used with older # clangs that don't understand c++11 yet (like Xcode 4.2's). if clang_cxx_language_standard: cflags_cc.append("-std=%s" % clang_cxx_language_standard) self._Appendf(cflags_cc, "CLANG_CXX_LIBRARY", "-stdlib=%s") if self._Test("GCC_ENABLE_CPP_RTTI", "NO", default="YES"): cflags_cc.append("-fno-rtti") if self._Test("GCC_ENABLE_CPP_EXCEPTIONS", "NO", default="YES"): cflags_cc.append("-fno-exceptions") if self._Test("GCC_INLINES_ARE_PRIVATE_EXTERN", "YES", default="NO"): cflags_cc.append("-fvisibility-inlines-hidden") if self._Test("GCC_THREADSAFE_STATICS", "NO", default="YES"): cflags_cc.append("-fno-threadsafe-statics") # Note: This flag is a no-op for clang, it only has an effect for gcc. if self._Test("GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO", "NO", default="YES"): cflags_cc.append("-Wno-invalid-offsetof") other_ccflags = [] for flag in self._Settings().get("OTHER_CPLUSPLUSFLAGS", ["$(inherited)"]): # TODO: More general variable expansion. Missing in many other places too. if flag in ("$inherited", "$(inherited)", "${inherited}"): flag = "$OTHER_CFLAGS" if flag in ("$OTHER_CFLAGS", "$(OTHER_CFLAGS)", "${OTHER_CFLAGS}"): other_ccflags += self._Settings().get("OTHER_CFLAGS", []) else: other_ccflags.append(flag) cflags_cc += other_ccflags self.configname = None return cflags_cc def _AddObjectiveCGarbageCollectionFlags(self, flags): gc_policy = self._Settings().get("GCC_ENABLE_OBJC_GC", "unsupported") if gc_policy == "supported": flags.append("-fobjc-gc") elif gc_policy == "required": flags.append("-fobjc-gc-only") def _AddObjectiveCARCFlags(self, flags): if self._Test("CLANG_ENABLE_OBJC_ARC", "YES", default="NO"): flags.append("-fobjc-arc") def _AddObjectiveCMissingPropertySynthesisFlags(self, flags): if self._Test( "CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS", "YES", default="NO" ): flags.append("-Wobjc-missing-property-synthesis") def GetCflagsObjC(self, configname): """Returns flags that need to be added to .m compilations.""" self.configname = configname cflags_objc = [] self._AddObjectiveCGarbageCollectionFlags(cflags_objc) self._AddObjectiveCARCFlags(cflags_objc) self._AddObjectiveCMissingPropertySynthesisFlags(cflags_objc) self.configname = None return cflags_objc def GetCflagsObjCC(self, configname): """Returns flags that need to be added to .mm compilations.""" self.configname = configname cflags_objcc = [] self._AddObjectiveCGarbageCollectionFlags(cflags_objcc) self._AddObjectiveCARCFlags(cflags_objcc) self._AddObjectiveCMissingPropertySynthesisFlags(cflags_objcc) if self._Test("GCC_OBJC_CALL_CXX_CDTORS", "YES", default="NO"): cflags_objcc.append("-fobjc-call-cxx-cdtors") self.configname = None return cflags_objcc def GetInstallNameBase(self): """Return DYLIB_INSTALL_NAME_BASE for this target.""" # Xcode sets this for shared_libraries, and for nonbundled loadable_modules. if self.spec["type"] != "shared_library" and ( self.spec["type"] != "loadable_module" or self._IsBundle() ): return None install_base = self.GetPerTargetSetting( "DYLIB_INSTALL_NAME_BASE", default="/Library/Frameworks" if self._IsBundle() else "/usr/local/lib", ) return install_base def _StandardizePath(self, path): """Do :standardizepath processing for path.""" # I'm not quite sure what :standardizepath does. Just call normpath(), # but don't let @executable_path/../foo collapse to foo. if "/" in path: prefix, rest = "", path if path.startswith("@"): prefix, rest = path.split("/", 1) rest = os.path.normpath(rest) # :standardizepath path = os.path.join(prefix, rest) return path def GetInstallName(self): """Return LD_DYLIB_INSTALL_NAME for this target.""" # Xcode sets this for shared_libraries, and for nonbundled loadable_modules. if self.spec["type"] != "shared_library" and ( self.spec["type"] != "loadable_module" or self._IsBundle() ): return None default_install_name = ( "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)" ) install_name = self.GetPerTargetSetting( "LD_DYLIB_INSTALL_NAME", default=default_install_name ) # Hardcode support for the variables used in chromium for now, to # unblock people using the make build. if "$" in install_name: assert install_name in ( "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/" "$(WRAPPER_NAME)/$(PRODUCT_NAME)", default_install_name, ), ( "Variables in LD_DYLIB_INSTALL_NAME are not generally supported " "yet in target '%s' (got '%s')" % (self.spec["target_name"], install_name) ) install_name = install_name.replace( "$(DYLIB_INSTALL_NAME_BASE:standardizepath)", self._StandardizePath(self.GetInstallNameBase()), ) if self._IsBundle(): # These are only valid for bundles, hence the |if|. install_name = install_name.replace( "$(WRAPPER_NAME)", self.GetWrapperName() ) install_name = install_name.replace( "$(PRODUCT_NAME)", self.GetProductName() ) else: assert "$(WRAPPER_NAME)" not in install_name assert "$(PRODUCT_NAME)" not in install_name install_name = install_name.replace( "$(EXECUTABLE_PATH)", self.GetExecutablePath() ) return install_name def _MapLinkerFlagFilename(self, ldflag, gyp_to_build_path): """Checks if ldflag contains a filename and if so remaps it from gyp-directory-relative to build-directory-relative.""" # This list is expanded on demand. # They get matched as: # -exported_symbols_list file # -Wl,exported_symbols_list file # -Wl,exported_symbols_list,file LINKER_FILE = r"(\S+)" WORD = r"\S+" linker_flags = [ ["-exported_symbols_list", LINKER_FILE], # Needed for NaCl. ["-unexported_symbols_list", LINKER_FILE], ["-reexported_symbols_list", LINKER_FILE], ["-sectcreate", WORD, WORD, LINKER_FILE], # Needed for remoting. ] for flag_pattern in linker_flags: regex = re.compile("(?:-Wl,)?" + "[ ,]".join(flag_pattern)) m = regex.match(ldflag) if m: ldflag = ( ldflag[: m.start(1)] + gyp_to_build_path(m.group(1)) + ldflag[m.end(1) :] ) # Required for ffmpeg (no idea why they don't use LIBRARY_SEARCH_PATHS, # TODO(thakis): Update ffmpeg.gyp): if ldflag.startswith("-L"): ldflag = "-L" + gyp_to_build_path(ldflag[len("-L") :]) return ldflag def GetLdflags(self, configname, product_dir, gyp_to_build_path, arch=None): """Returns flags that need to be passed to the linker. Args: configname: The name of the configuration to get ld flags for. product_dir: The directory where products such static and dynamic libraries are placed. This is added to the library search path. gyp_to_build_path: A function that converts paths relative to the current gyp file to paths relative to the build directory. """ self.configname = configname ldflags = [] # The xcode build is relative to a gyp file's directory, and OTHER_LDFLAGS # can contain entries that depend on this. Explicitly absolutify these. for ldflag in self._Settings().get("OTHER_LDFLAGS", []): ldflags.append(self._MapLinkerFlagFilename(ldflag, gyp_to_build_path)) if self._Test("DEAD_CODE_STRIPPING", "YES", default="NO"): ldflags.append("-Wl,-dead_strip") if self._Test("PREBINDING", "YES", default="NO"): ldflags.append("-Wl,-prebind") self._Appendf( ldflags, "DYLIB_COMPATIBILITY_VERSION", "-compatibility_version %s" ) self._Appendf(ldflags, "DYLIB_CURRENT_VERSION", "-current_version %s") self._AppendPlatformVersionMinFlags(ldflags) if "SDKROOT" in self._Settings() and self._SdkPath(): ldflags.append("-isysroot " + self._SdkPath()) for library_path in self._Settings().get("LIBRARY_SEARCH_PATHS", []): ldflags.append("-L" + gyp_to_build_path(library_path)) if "ORDER_FILE" in self._Settings(): ldflags.append( "-Wl,-order_file " + "-Wl," + gyp_to_build_path(self._Settings()["ORDER_FILE"]) ) if not gyp.common.CrossCompileRequested(): if arch is not None: archs = [arch] else: assert self.configname archs = self.GetActiveArchs(self.configname) if len(archs) != 1: # TODO: Supporting fat binaries will be annoying. self._WarnUnimplemented("ARCHS") archs = ["i386"] ldflags.append("-arch " + archs[0]) # Xcode adds the product directory by default. # Rewrite -L. to -L./ to work around http://www.openradar.me/25313838 ldflags.append("-L" + (product_dir if product_dir != "." else "./")) install_name = self.GetInstallName() if install_name and self.spec["type"] != "loadable_module": ldflags.append("-install_name " + install_name.replace(" ", r"\ ")) for rpath in self._Settings().get("LD_RUNPATH_SEARCH_PATHS", []): ldflags.append("-Wl,-rpath," + rpath) sdk_root = self._SdkPath() if not sdk_root: sdk_root = "" config = self.spec["configurations"][self.configname] framework_dirs = config.get("mac_framework_dirs", []) for directory in framework_dirs: ldflags.append("-F" + directory.replace("$(SDKROOT)", sdk_root)) if self._IsXCTest(): platform_root = self._XcodePlatformPath(configname) if sdk_root and platform_root: ldflags.append("-F" + platform_root + "/Developer/Library/Frameworks/") ldflags.append("-framework XCTest") is_extension = self._IsIosAppExtension() or self._IsIosWatchKitExtension() if sdk_root and is_extension: # Adds the link flags for extensions. These flags are common for all # extensions and provide loader and main function. # These flags reflect the compilation options used by xcode to compile # extensions. xcode_version, _ = XcodeVersion() if xcode_version < "0900": ldflags.append("-lpkstart") ldflags.append( sdk_root + "/System/Library/PrivateFrameworks/PlugInKit.framework/PlugInKit" ) else: ldflags.append("-e _NSExtensionMain") ldflags.append("-fapplication-extension") self._Appendf(ldflags, "CLANG_CXX_LIBRARY", "-stdlib=%s") self.configname = None return ldflags def GetLibtoolflags(self, configname): """Returns flags that need to be passed to the static linker. Args: configname: The name of the configuration to get ld flags for. """ self.configname = configname libtoolflags = [] for libtoolflag in self._Settings().get("OTHER_LDFLAGS", []): libtoolflags.append(libtoolflag) # TODO(thakis): ARCHS? self.configname = None return libtoolflags def GetPerTargetSettings(self): """Gets a list of all the per-target settings. This will only fetch keys whose values are the same across all configurations.""" first_pass = True result = {} for configname in sorted(self.xcode_settings.keys()): if first_pass: result = dict(self.xcode_settings[configname]) first_pass = False else: for key, value in self.xcode_settings[configname].items(): if key not in result: continue elif result[key] != value: del result[key] return result def GetPerConfigSetting(self, setting, configname, default=None): if configname in self.xcode_settings: return self.xcode_settings[configname].get(setting, default) else: return self.GetPerTargetSetting(setting, default) def GetPerTargetSetting(self, setting, default=None): """Tries to get xcode_settings.setting from spec. Assumes that the setting has the same value in all configurations and throws otherwise.""" is_first_pass = True result = None for configname in sorted(self.xcode_settings.keys()): if is_first_pass: result = self.xcode_settings[configname].get(setting, None) is_first_pass = False else: assert result == self.xcode_settings[configname].get(setting, None), ( "Expected per-target setting for '%s', got per-config setting " "(target %s)" % (setting, self.spec["target_name"]) ) if result is None: return default return result def _GetStripPostbuilds(self, configname, output_binary, quiet): """Returns a list of shell commands that contain the shell commands necessary to strip this target's binary. These should be run as postbuilds before the actual postbuilds run.""" self.configname = configname result = [] if self._Test("DEPLOYMENT_POSTPROCESSING", "YES", default="NO") and self._Test( "STRIP_INSTALLED_PRODUCT", "YES", default="NO" ): default_strip_style = "debugging" if ( self.spec["type"] == "loadable_module" or self._IsIosAppExtension() ) and self._IsBundle(): default_strip_style = "non-global" elif self.spec["type"] == "executable": default_strip_style = "all" strip_style = self._Settings().get("STRIP_STYLE", default_strip_style) strip_flags = {"all": "", "non-global": "-x", "debugging": "-S"}[ strip_style ] explicit_strip_flags = self._Settings().get("STRIPFLAGS", "") if explicit_strip_flags: strip_flags += " " + _NormalizeEnvVarReferences(explicit_strip_flags) if not quiet: result.append("echo STRIP\\(%s\\)" % self.spec["target_name"]) result.append(f"strip {strip_flags} {output_binary}") self.configname = None return result def _GetDebugInfoPostbuilds(self, configname, output, output_binary, quiet): """Returns a list of shell commands that contain the shell commands necessary to massage this target's debug information. These should be run as postbuilds before the actual postbuilds run.""" self.configname = configname # For static libraries, no dSYMs are created. result = [] if ( self._Test("GCC_GENERATE_DEBUGGING_SYMBOLS", "YES", default="YES") and self._Test( "DEBUG_INFORMATION_FORMAT", "dwarf-with-dsym", default="dwarf" ) and self.spec["type"] != "static_library" ): if not quiet: result.append("echo DSYMUTIL\\(%s\\)" % self.spec["target_name"]) result.append("dsymutil {} -o {}".format(output_binary, output + ".dSYM")) self.configname = None return result def _GetTargetPostbuilds(self, configname, output, output_binary, quiet=False): """Returns a list of shell commands that contain the shell commands to run as postbuilds for this target, before the actual postbuilds.""" # dSYMs need to build before stripping happens. return self._GetDebugInfoPostbuilds( configname, output, output_binary, quiet ) + self._GetStripPostbuilds(configname, output_binary, quiet) def _GetIOSPostbuilds(self, configname, output_binary): """Return a shell command to codesign the iOS output binary so it can be deployed to a device. This should be run as the very last step of the build.""" if not ( self.isIOS and (self.spec["type"] == "executable" or self._IsXCTest()) or self.IsIosFramework() ): return [] postbuilds = [] product_name = self.GetFullProductName() settings = self.xcode_settings[configname] # Xcode expects XCTests to be copied into the TEST_HOST dir. if self._IsXCTest(): source = os.path.join("${BUILT_PRODUCTS_DIR}", product_name) test_host = os.path.dirname(settings.get("TEST_HOST")) xctest_destination = os.path.join(test_host, "PlugIns", product_name) postbuilds.extend([f"ditto {source} {xctest_destination}"]) key = self._GetIOSCodeSignIdentityKey(settings) if not key: return postbuilds # Warn for any unimplemented signing xcode keys. unimpl = ["OTHER_CODE_SIGN_FLAGS"] unimpl = set(unimpl) & set(self.xcode_settings[configname].keys()) if unimpl: print( "Warning: Some codesign keys not implemented, ignoring: %s" % ", ".join(sorted(unimpl)) ) if self._IsXCTest(): # For device xctests, Xcode copies two extra frameworks into $TEST_HOST. test_host = os.path.dirname(settings.get("TEST_HOST")) frameworks_dir = os.path.join(test_host, "Frameworks") platform_root = self._XcodePlatformPath(configname) frameworks = [ "Developer/Library/PrivateFrameworks/IDEBundleInjection.framework", "Developer/Library/Frameworks/XCTest.framework", ] for framework in frameworks: source = os.path.join(platform_root, framework) destination = os.path.join(frameworks_dir, os.path.basename(framework)) postbuilds.extend([f"ditto {source} {destination}"]) # Then re-sign everything with 'preserve=True' postbuilds.extend( [ '%s code-sign-bundle "%s" "%s" "%s" "%s" %s' % ( os.path.join("${TARGET_BUILD_DIR}", "gyp-mac-tool"), key, settings.get("CODE_SIGN_ENTITLEMENTS", ""), settings.get("PROVISIONING_PROFILE", ""), destination, True, ) ] ) plugin_dir = os.path.join(test_host, "PlugIns") targets = [os.path.join(plugin_dir, product_name), test_host] for target in targets: postbuilds.extend( [ '%s code-sign-bundle "%s" "%s" "%s" "%s" %s' % ( os.path.join("${TARGET_BUILD_DIR}", "gyp-mac-tool"), key, settings.get("CODE_SIGN_ENTITLEMENTS", ""), settings.get("PROVISIONING_PROFILE", ""), target, True, ) ] ) postbuilds.extend( [ '%s code-sign-bundle "%s" "%s" "%s" "%s" %s' % ( os.path.join("${TARGET_BUILD_DIR}", "gyp-mac-tool"), key, settings.get("CODE_SIGN_ENTITLEMENTS", ""), settings.get("PROVISIONING_PROFILE", ""), os.path.join("${BUILT_PRODUCTS_DIR}", product_name), False, ) ] ) return postbuilds def _GetIOSCodeSignIdentityKey(self, settings): identity = settings.get("CODE_SIGN_IDENTITY") if not identity: return None if identity not in XcodeSettings._codesigning_key_cache: output = subprocess.check_output( ["security", "find-identity", "-p", "codesigning", "-v"] ) for line in output.splitlines(): if identity in line: fingerprint = line.split()[1] cache = XcodeSettings._codesigning_key_cache assert identity not in cache or fingerprint == cache[identity], ( "Multiple codesigning fingerprints for identity: %s" % identity ) XcodeSettings._codesigning_key_cache[identity] = fingerprint return XcodeSettings._codesigning_key_cache.get(identity, "") def AddImplicitPostbuilds( self, configname, output, output_binary, postbuilds=[], quiet=False ): """Returns a list of shell commands that should run before and after |postbuilds|.""" assert output_binary is not None pre = self._GetTargetPostbuilds(configname, output, output_binary, quiet) post = self._GetIOSPostbuilds(configname, output_binary) return pre + postbuilds + post def _AdjustLibrary(self, library, config_name=None): if library.endswith(".framework"): l_flag = "-framework " + os.path.splitext(os.path.basename(library))[0] else: m = self.library_re.match(library) if m: l_flag = "-l" + m.group(1) else: l_flag = library sdk_root = self._SdkPath(config_name) if not sdk_root: sdk_root = "" # Xcode 7 started shipping with ".tbd" (text based stubs) files instead of # ".dylib" without providing a real support for them. What it does, for # "/usr/lib" libraries, is do "-L/usr/lib -lname" which is dependent on the # library order and cause collision when building Chrome. # # Instead substitute ".tbd" to ".dylib" in the generated project when the # following conditions are both true: # - library is referenced in the gyp file as "$(SDKROOT)/**/*.dylib", # - the ".dylib" file does not exists but a ".tbd" file do. library = l_flag.replace("$(SDKROOT)", sdk_root) if l_flag.startswith("$(SDKROOT)"): basename, ext = os.path.splitext(library) if ext == ".dylib" and not os.path.exists(library): tbd_library = basename + ".tbd" if os.path.exists(tbd_library): library = tbd_library return library def AdjustLibraries(self, libraries, config_name=None): """Transforms entries like 'Cocoa.framework' in libraries into entries like '-framework Cocoa', 'libcrypto.dylib' into '-lcrypto', etc. """ libraries = [self._AdjustLibrary(library, config_name) for library in libraries] return libraries def _BuildMachineOSBuild(self): return GetStdout(["sw_vers", "-buildVersion"]) def _XcodeIOSDeviceFamily(self, configname): family = self.xcode_settings[configname].get("TARGETED_DEVICE_FAMILY", "1") return [int(x) for x in family.split(",")] def GetExtraPlistItems(self, configname=None): """Returns a dictionary with extra items to insert into Info.plist.""" if configname not in XcodeSettings._plist_cache: cache = {} cache["BuildMachineOSBuild"] = self._BuildMachineOSBuild() xcode_version, xcode_build = XcodeVersion() cache["DTXcode"] = xcode_version cache["DTXcodeBuild"] = xcode_build compiler = self.xcode_settings[configname].get("GCC_VERSION") if compiler is not None: cache["DTCompiler"] = compiler sdk_root = self._SdkRoot(configname) if not sdk_root: sdk_root = self._DefaultSdkRoot() sdk_version = self._GetSdkVersionInfoItem(sdk_root, "--show-sdk-version") cache["DTSDKName"] = sdk_root + (sdk_version or "") if xcode_version >= "0720": cache["DTSDKBuild"] = self._GetSdkVersionInfoItem( sdk_root, "--show-sdk-build-version" ) elif xcode_version >= "0430": cache["DTSDKBuild"] = sdk_version else: cache["DTSDKBuild"] = cache["BuildMachineOSBuild"] if self.isIOS: cache["MinimumOSVersion"] = self.xcode_settings[configname].get( "IPHONEOS_DEPLOYMENT_TARGET" ) cache["DTPlatformName"] = sdk_root cache["DTPlatformVersion"] = sdk_version if configname.endswith("iphoneos"): cache["CFBundleSupportedPlatforms"] = ["iPhoneOS"] cache["DTPlatformBuild"] = cache["DTSDKBuild"] else: cache["CFBundleSupportedPlatforms"] = ["iPhoneSimulator"] # This is weird, but Xcode sets DTPlatformBuild to an empty field # for simulator builds. cache["DTPlatformBuild"] = "" XcodeSettings._plist_cache[configname] = cache # Include extra plist items that are per-target, not per global # XcodeSettings. items = dict(XcodeSettings._plist_cache[configname]) if self.isIOS: items["UIDeviceFamily"] = self._XcodeIOSDeviceFamily(configname) return items def _DefaultSdkRoot(self): """Returns the default SDKROOT to use. Prior to version 5.0.0, if SDKROOT was not explicitly set in the Xcode project, then the environment variable was empty. Starting with this version, Xcode uses the name of the newest SDK installed. """ xcode_version, _ = XcodeVersion() if xcode_version < "0500": return "" default_sdk_path = self._XcodeSdkPath("") default_sdk_root = XcodeSettings._sdk_root_cache.get(default_sdk_path) if default_sdk_root: return default_sdk_root try: all_sdks = GetStdout(["xcodebuild", "-showsdks"]) except GypError: # If xcodebuild fails, there will be no valid SDKs return "" for line in all_sdks.splitlines(): items = line.split() if len(items) >= 3 and items[-2] == "-sdk": sdk_root = items[-1] sdk_path = self._XcodeSdkPath(sdk_root) if sdk_path == default_sdk_path: return sdk_root return "" class MacPrefixHeader: """A class that helps with emulating Xcode's GCC_PREFIX_HEADER feature. This feature consists of several pieces: * If GCC_PREFIX_HEADER is present, all compilations in that project get an additional |-include path_to_prefix_header| cflag. * If GCC_PRECOMPILE_PREFIX_HEADER is present too, then the prefix header is instead compiled, and all other compilations in the project get an additional |-include path_to_compiled_header| instead. + Compiled prefix headers have the extension gch. There is one gch file for every language used in the project (c, cc, m, mm), since gch files for different languages aren't compatible. + gch files themselves are built with the target's normal cflags, but they obviously don't get the |-include| flag. Instead, they need a -x flag that describes their language. + All o files in the target need to depend on the gch file, to make sure it's built before any o file is built. This class helps with some of these tasks, but it needs help from the build system for writing dependencies to the gch files, for writing build commands for the gch files, and for figuring out the location of the gch files. """ def __init__( self, xcode_settings, gyp_path_to_build_path, gyp_path_to_build_output ): """If xcode_settings is None, all methods on this class are no-ops. Args: gyp_path_to_build_path: A function that takes a gyp-relative path, and returns a path relative to the build directory. gyp_path_to_build_output: A function that takes a gyp-relative path and a language code ('c', 'cc', 'm', or 'mm'), and that returns a path to where the output of precompiling that path for that language should be placed (without the trailing '.gch'). """ # This doesn't support per-configuration prefix headers. Good enough # for now. self.header = None self.compile_headers = False if xcode_settings: self.header = xcode_settings.GetPerTargetSetting("GCC_PREFIX_HEADER") self.compile_headers = ( xcode_settings.GetPerTargetSetting( "GCC_PRECOMPILE_PREFIX_HEADER", default="NO" ) != "NO" ) self.compiled_headers = {} if self.header: if self.compile_headers: for lang in ["c", "cc", "m", "mm"]: self.compiled_headers[lang] = gyp_path_to_build_output( self.header, lang ) self.header = gyp_path_to_build_path(self.header) def _CompiledHeader(self, lang, arch): assert self.compile_headers h = self.compiled_headers[lang] if arch: h += "." + arch return h def GetInclude(self, lang, arch=None): """Gets the cflags to include the prefix header for language |lang|.""" if self.compile_headers and lang in self.compiled_headers: return "-include %s" % self._CompiledHeader(lang, arch) elif self.header: return "-include %s" % self.header else: return "" def _Gch(self, lang, arch): """Returns the actual file name of the prefix header for language |lang|.""" assert self.compile_headers return self._CompiledHeader(lang, arch) + ".gch" def GetObjDependencies(self, sources, objs, arch=None): """Given a list of source files and the corresponding object files, returns a list of (source, object, gch) tuples, where |gch| is the build-directory relative path to the gch file each object file depends on. |compilable[i]| has to be the source file belonging to |objs[i]|.""" if not self.header or not self.compile_headers: return [] result = [] for source, obj in zip(sources, objs): ext = os.path.splitext(source)[1] lang = { ".c": "c", ".cpp": "cc", ".cc": "cc", ".cxx": "cc", ".m": "m", ".mm": "mm", }.get(ext, None) if lang: result.append((source, obj, self._Gch(lang, arch))) return result def GetPchBuildCommands(self, arch=None): """Returns [(path_to_gch, language_flag, language, header)]. |path_to_gch| and |header| are relative to the build directory. """ if not self.header or not self.compile_headers: return [] return [ (self._Gch("c", arch), "-x c-header", "c", self.header), (self._Gch("cc", arch), "-x c++-header", "cc", self.header), (self._Gch("m", arch), "-x objective-c-header", "m", self.header), (self._Gch("mm", arch), "-x objective-c++-header", "mm", self.header), ] def XcodeVersion(): """Returns a tuple of version and build version of installed Xcode.""" # `xcodebuild -version` output looks like # Xcode 4.6.3 # Build version 4H1503 # or like # Xcode 3.2.6 # Component versions: DevToolsCore-1809.0; DevToolsSupport-1806.0 # BuildVersion: 10M2518 # Convert that to ('0463', '4H1503') or ('0326', '10M2518'). global XCODE_VERSION_CACHE if XCODE_VERSION_CACHE: return XCODE_VERSION_CACHE version = "" build = "" try: version_list = GetStdoutQuiet(["xcodebuild", "-version"]).splitlines() # In some circumstances xcodebuild exits 0 but doesn't return # the right results; for example, a user on 10.7 or 10.8 with # a bogus path set via xcode-select # In that case this may be a CLT-only install so fall back to # checking that version. if len(version_list) < 2: raise GypError("xcodebuild returned unexpected results") version = version_list[0].split()[-1] # Last word on first line build = version_list[-1].split()[-1] # Last word on last line except GypError: # Xcode not installed so look for XCode Command Line Tools version = CLTVersion() # macOS Catalina returns 11.0.0.0.1.1567737322 if not version: raise GypError("No Xcode or CLT version detected!") # Be careful to convert "4.2.3" to "0423" and "11.0.0" to "1100": version = version.split(".")[:3] # Just major, minor, micro version[0] = version[0].zfill(2) # Add a leading zero if major is one digit version = ("".join(version) + "00")[:4] # Limit to exactly four characters XCODE_VERSION_CACHE = (version, build) return XCODE_VERSION_CACHE # This function ported from the logic in Homebrew's CLT version check def CLTVersion(): """Returns the version of command-line tools from pkgutil.""" # pkgutil output looks like # package-id: com.apple.pkg.CLTools_Executables # version: 5.0.1.0.1.1382131676 # volume: / # location: / # install-time: 1382544035 # groups: com.apple.FindSystemFiles.pkg-group # com.apple.DevToolsBoth.pkg-group # com.apple.DevToolsNonRelocatableShared.pkg-group STANDALONE_PKG_ID = "com.apple.pkg.DeveloperToolsCLILeo" FROM_XCODE_PKG_ID = "com.apple.pkg.DeveloperToolsCLI" MAVERICKS_PKG_ID = "com.apple.pkg.CLTools_Executables" regex = re.compile("version: (?P.+)") for key in [MAVERICKS_PKG_ID, STANDALONE_PKG_ID, FROM_XCODE_PKG_ID]: try: output = GetStdout(["/usr/sbin/pkgutil", "--pkg-info", key]) return re.search(regex, output).groupdict()["version"] except GypError: continue regex = re.compile(r'Command Line Tools for Xcode\s+(?P\S+)') try: output = GetStdout(["/usr/sbin/softwareupdate", "--history"]) return re.search(regex, output).groupdict()["version"] except GypError: return None def GetStdoutQuiet(cmdlist): """Returns the content of standard output returned by invoking |cmdlist|. Ignores the stderr. Raises |GypError| if the command return with a non-zero return code.""" job = subprocess.Popen(cmdlist, stdout=subprocess.PIPE, stderr=subprocess.PIPE) out = job.communicate()[0].decode("utf-8") if job.returncode != 0: raise GypError("Error %d running %s" % (job.returncode, cmdlist[0])) return out.rstrip("\n") def GetStdout(cmdlist): """Returns the content of standard output returned by invoking |cmdlist|. Raises |GypError| if the command return with a non-zero return code.""" job = subprocess.Popen(cmdlist, stdout=subprocess.PIPE) out = job.communicate()[0].decode("utf-8") if job.returncode != 0: sys.stderr.write(out + "\n") raise GypError("Error %d running %s" % (job.returncode, cmdlist[0])) return out.rstrip("\n") def MergeGlobalXcodeSettingsToSpec(global_dict, spec): """Merges the global xcode_settings dictionary into each configuration of the target represented by spec. For keys that are both in the global and the local xcode_settings dict, the local key gets precedence. """ # The xcode generator special-cases global xcode_settings and does something # that amounts to merging in the global xcode_settings into each local # xcode_settings dict. global_xcode_settings = global_dict.get("xcode_settings", {}) for config in spec["configurations"].values(): if "xcode_settings" in config: new_settings = global_xcode_settings.copy() new_settings.update(config["xcode_settings"]) config["xcode_settings"] = new_settings def IsMacBundle(flavor, spec): """Returns if |spec| should be treated as a bundle. Bundles are directories with a certain subdirectory structure, instead of just a single file. Bundle rules do not produce a binary but also package resources into that directory.""" is_mac_bundle = ( int(spec.get("mac_xctest_bundle", 0)) != 0 or int(spec.get("mac_xcuitest_bundle", 0)) != 0 or (int(spec.get("mac_bundle", 0)) != 0 and flavor == "mac") ) if is_mac_bundle: assert spec["type"] != "none", ( 'mac_bundle targets cannot have type none (target "%s")' % spec["target_name"] ) return is_mac_bundle def GetMacBundleResources(product_dir, xcode_settings, resources): """Yields (output, resource) pairs for every resource in |resources|. Only call this for mac bundle targets. Args: product_dir: Path to the directory containing the output bundle, relative to the build directory. xcode_settings: The XcodeSettings of the current target. resources: A list of bundle resources, relative to the build directory. """ dest = os.path.join(product_dir, xcode_settings.GetBundleResourceFolder()) for res in resources: output = dest # The make generator doesn't support it, so forbid it everywhere # to keep the generators more interchangeable. assert " " not in res, "Spaces in resource filenames not supported (%s)" % res # Split into (path,file). res_parts = os.path.split(res) # Now split the path into (prefix,maybe.lproj). lproj_parts = os.path.split(res_parts[0]) # If the resource lives in a .lproj bundle, add that to the destination. if lproj_parts[1].endswith(".lproj"): output = os.path.join(output, lproj_parts[1]) output = os.path.join(output, res_parts[1]) # Compiled XIB files are referred to by .nib. if output.endswith(".xib"): output = os.path.splitext(output)[0] + ".nib" # Compiled storyboard files are referred to by .storyboardc. if output.endswith(".storyboard"): output = os.path.splitext(output)[0] + ".storyboardc" yield output, res def GetMacInfoPlist(product_dir, xcode_settings, gyp_path_to_build_path): """Returns (info_plist, dest_plist, defines, extra_env), where: * |info_plist| is the source plist path, relative to the build directory, * |dest_plist| is the destination plist path, relative to the build directory, * |defines| is a list of preprocessor defines (empty if the plist shouldn't be preprocessed, * |extra_env| is a dict of env variables that should be exported when invoking |mac_tool copy-info-plist|. Only call this for mac bundle targets. Args: product_dir: Path to the directory containing the output bundle, relative to the build directory. xcode_settings: The XcodeSettings of the current target. gyp_to_build_path: A function that converts paths relative to the current gyp file to paths relative to the build directory. """ info_plist = xcode_settings.GetPerTargetSetting("INFOPLIST_FILE") if not info_plist: return None, None, [], {} # The make generator doesn't support it, so forbid it everywhere # to keep the generators more interchangeable. assert " " not in info_plist, ( "Spaces in Info.plist filenames not supported (%s)" % info_plist ) info_plist = gyp_path_to_build_path(info_plist) # If explicitly set to preprocess the plist, invoke the C preprocessor and # specify any defines as -D flags. if ( xcode_settings.GetPerTargetSetting("INFOPLIST_PREPROCESS", default="NO") == "YES" ): # Create an intermediate file based on the path. defines = shlex.split( xcode_settings.GetPerTargetSetting( "INFOPLIST_PREPROCESSOR_DEFINITIONS", default="" ) ) else: defines = [] dest_plist = os.path.join(product_dir, xcode_settings.GetBundlePlistPath()) extra_env = xcode_settings.GetPerTargetSettings() return info_plist, dest_plist, defines, extra_env def _GetXcodeEnv( xcode_settings, built_products_dir, srcroot, configuration, additional_settings=None ): """Return the environment variables that Xcode would set. See http://developer.apple.com/library/mac/#documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html#//apple_ref/doc/uid/TP40003931-CH3-SW153 for a full list. Args: xcode_settings: An XcodeSettings object. If this is None, this function returns an empty dict. built_products_dir: Absolute path to the built products dir. srcroot: Absolute path to the source root. configuration: The build configuration name. additional_settings: An optional dict with more values to add to the result. """ if not xcode_settings: return {} # This function is considered a friend of XcodeSettings, so let it reach into # its implementation details. spec = xcode_settings.spec # These are filled in on an as-needed basis. env = { "BUILT_FRAMEWORKS_DIR": built_products_dir, "BUILT_PRODUCTS_DIR": built_products_dir, "CONFIGURATION": configuration, "PRODUCT_NAME": xcode_settings.GetProductName(), # For FULL_PRODUCT_NAME see: # /Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/Specifications/MacOSX\ Product\ Types.xcspec # noqa: E501 "SRCROOT": srcroot, "SOURCE_ROOT": "${SRCROOT}", # This is not true for static libraries, but currently the env is only # written for bundles: "TARGET_BUILD_DIR": built_products_dir, "TEMP_DIR": "${TMPDIR}", "XCODE_VERSION_ACTUAL": XcodeVersion()[0], } if xcode_settings.GetPerConfigSetting("SDKROOT", configuration): env["SDKROOT"] = xcode_settings._SdkPath(configuration) else: env["SDKROOT"] = "" if xcode_settings.mac_toolchain_dir: env["DEVELOPER_DIR"] = xcode_settings.mac_toolchain_dir if spec["type"] in ( "executable", "static_library", "shared_library", "loadable_module", ): env["EXECUTABLE_NAME"] = xcode_settings.GetExecutableName() env["EXECUTABLE_PATH"] = xcode_settings.GetExecutablePath() env["FULL_PRODUCT_NAME"] = xcode_settings.GetFullProductName() mach_o_type = xcode_settings.GetMachOType() if mach_o_type: env["MACH_O_TYPE"] = mach_o_type env["PRODUCT_TYPE"] = xcode_settings.GetProductType() if xcode_settings._IsBundle(): # xcodeproj_file.py sets the same Xcode subfolder value for this as for # FRAMEWORKS_FOLDER_PATH so Xcode builds will actually use FFP's value. env["BUILT_FRAMEWORKS_DIR"] = os.path.join( built_products_dir + os.sep + xcode_settings.GetBundleFrameworksFolderPath() ) env["CONTENTS_FOLDER_PATH"] = xcode_settings.GetBundleContentsFolderPath() env["EXECUTABLE_FOLDER_PATH"] = xcode_settings.GetBundleExecutableFolderPath() env[ "UNLOCALIZED_RESOURCES_FOLDER_PATH" ] = xcode_settings.GetBundleResourceFolder() env["JAVA_FOLDER_PATH"] = xcode_settings.GetBundleJavaFolderPath() env["FRAMEWORKS_FOLDER_PATH"] = xcode_settings.GetBundleFrameworksFolderPath() env[ "SHARED_FRAMEWORKS_FOLDER_PATH" ] = xcode_settings.GetBundleSharedFrameworksFolderPath() env[ "SHARED_SUPPORT_FOLDER_PATH" ] = xcode_settings.GetBundleSharedSupportFolderPath() env["PLUGINS_FOLDER_PATH"] = xcode_settings.GetBundlePlugInsFolderPath() env["XPCSERVICES_FOLDER_PATH"] = xcode_settings.GetBundleXPCServicesFolderPath() env["INFOPLIST_PATH"] = xcode_settings.GetBundlePlistPath() env["WRAPPER_NAME"] = xcode_settings.GetWrapperName() install_name = xcode_settings.GetInstallName() if install_name: env["LD_DYLIB_INSTALL_NAME"] = install_name install_name_base = xcode_settings.GetInstallNameBase() if install_name_base: env["DYLIB_INSTALL_NAME_BASE"] = install_name_base xcode_version, _ = XcodeVersion() if xcode_version >= "0500" and not env.get("SDKROOT"): sdk_root = xcode_settings._SdkRoot(configuration) if not sdk_root: sdk_root = xcode_settings._XcodeSdkPath("") if sdk_root is None: sdk_root = "" env["SDKROOT"] = sdk_root if not additional_settings: additional_settings = {} else: # Flatten lists to strings. for k in additional_settings: if not isinstance(additional_settings[k], str): additional_settings[k] = " ".join(additional_settings[k]) additional_settings.update(env) for k in additional_settings: additional_settings[k] = _NormalizeEnvVarReferences(additional_settings[k]) return additional_settings def _NormalizeEnvVarReferences(str): """Takes a string containing variable references in the form ${FOO}, $(FOO), or $FOO, and returns a string with all variable references in the form ${FOO}. """ # $FOO -> ${FOO} str = re.sub(r"\$([a-zA-Z_][a-zA-Z0-9_]*)", r"${\1}", str) # $(FOO) -> ${FOO} matches = re.findall(r"(\$\(([a-zA-Z0-9\-_]+)\))", str) for match in matches: to_replace, variable = match assert "$(" not in match, "$($(FOO)) variables not supported: " + match str = str.replace(to_replace, "${" + variable + "}") return str def ExpandEnvVars(string, expansions): """Expands ${VARIABLES}, $(VARIABLES), and $VARIABLES in string per the expansions list. If the variable expands to something that references another variable, this variable is expanded as well if it's in env -- until no variables present in env are left.""" for k, v in reversed(expansions): string = string.replace("${" + k + "}", v) string = string.replace("$(" + k + ")", v) string = string.replace("$" + k, v) return string def _TopologicallySortedEnvVarKeys(env): """Takes a dict |env| whose values are strings that can refer to other keys, for example env['foo'] = '$(bar) and $(baz)'. Returns a list L of all keys of env such that key2 is after key1 in L if env[key2] refers to env[key1]. Throws an Exception in case of dependency cycles. """ # Since environment variables can refer to other variables, the evaluation # order is important. Below is the logic to compute the dependency graph # and sort it. regex = re.compile(r"\$\{([a-zA-Z0-9\-_]+)\}") def GetEdges(node): # Use a definition of edges such that user_of_variable -> used_varible. # This happens to be easier in this case, since a variable's # definition contains all variables it references in a single string. # We can then reverse the result of the topological sort at the end. # Since: reverse(topsort(DAG)) = topsort(reverse_edges(DAG)) matches = {v for v in regex.findall(env[node]) if v in env} for dependee in matches: assert "${" not in dependee, "Nested variables not supported: " + dependee return matches try: # Topologically sort, and then reverse, because we used an edge definition # that's inverted from the expected result of this function (see comment # above). order = gyp.common.TopologicallySorted(env.keys(), GetEdges) order.reverse() return order except gyp.common.CycleError as e: raise GypError( "Xcode environment variables are cyclically dependent: " + str(e.nodes) ) def GetSortedXcodeEnv( xcode_settings, built_products_dir, srcroot, configuration, additional_settings=None ): env = _GetXcodeEnv( xcode_settings, built_products_dir, srcroot, configuration, additional_settings ) return [(key, env[key]) for key in _TopologicallySortedEnvVarKeys(env)] def GetSpecPostbuildCommands(spec, quiet=False): """Returns the list of postbuilds explicitly defined on |spec|, in a form executable by a shell.""" postbuilds = [] for postbuild in spec.get("postbuilds", []): if not quiet: postbuilds.append( "echo POSTBUILD\\(%s\\) %s" % (spec["target_name"], postbuild["postbuild_name"]) ) postbuilds.append(gyp.common.EncodePOSIXShellList(postbuild["action"])) return postbuilds def _HasIOSTarget(targets): """Returns true if any target contains the iOS specific key IPHONEOS_DEPLOYMENT_TARGET.""" for target_dict in targets.values(): for config in target_dict["configurations"].values(): if config.get("xcode_settings", {}).get("IPHONEOS_DEPLOYMENT_TARGET"): return True return False def _AddIOSDeviceConfigurations(targets): """Clone all targets and append -iphoneos to the name. Configure these targets to build for iOS devices and use correct architectures for those builds.""" for target_dict in targets.values(): toolset = target_dict["toolset"] configs = target_dict["configurations"] for config_name, simulator_config_dict in dict(configs).items(): iphoneos_config_dict = copy.deepcopy(simulator_config_dict) configs[config_name + "-iphoneos"] = iphoneos_config_dict configs[config_name + "-iphonesimulator"] = simulator_config_dict if toolset == "target": simulator_config_dict["xcode_settings"]["SDKROOT"] = "iphonesimulator" iphoneos_config_dict["xcode_settings"]["SDKROOT"] = "iphoneos" return targets def CloneConfigurationForDeviceAndEmulator(target_dicts): """If |target_dicts| contains any iOS targets, automatically create -iphoneos targets for iOS device builds.""" if _HasIOSTarget(target_dicts): return _AddIOSDeviceConfigurations(target_dicts) return target_dicts # Copyright (c) 2014 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Xcode-ninja wrapper project file generator. This updates the data structures passed to the Xcode gyp generator to build with ninja instead. The Xcode project itself is transformed into a list of executable targets, each with a build step to build with ninja, and a target with every source and resource file. This appears to sidestep some of the major performance headaches experienced using complex projects and large number of targets within Xcode. """ import errno import gyp.generator.ninja import os import re import xml.sax.saxutils def _WriteWorkspace(main_gyp, sources_gyp, params): """ Create a workspace to wrap main and sources gyp paths. """ (build_file_root, build_file_ext) = os.path.splitext(main_gyp) workspace_path = build_file_root + ".xcworkspace" options = params["options"] if options.generator_output: workspace_path = os.path.join(options.generator_output, workspace_path) try: os.makedirs(workspace_path) except OSError as e: if e.errno != errno.EEXIST: raise output_string = ( '\n' + '\n' ) for gyp_name in [main_gyp, sources_gyp]: name = os.path.splitext(os.path.basename(gyp_name))[0] + ".xcodeproj" name = xml.sax.saxutils.quoteattr("group:" + name) output_string += " \n" % name output_string += "\n" workspace_file = os.path.join(workspace_path, "contents.xcworkspacedata") try: with open(workspace_file) as input_file: input_string = input_file.read() if input_string == output_string: return except OSError: # Ignore errors if the file doesn't exist. pass with open(workspace_file, "w") as output_file: output_file.write(output_string) def _TargetFromSpec(old_spec, params): """ Create fake target for xcode-ninja wrapper. """ # Determine ninja top level build dir (e.g. /path/to/out). ninja_toplevel = None jobs = 0 if params: options = params["options"] ninja_toplevel = os.path.join( options.toplevel_dir, gyp.generator.ninja.ComputeOutputDir(params) ) jobs = params.get("generator_flags", {}).get("xcode_ninja_jobs", 0) target_name = old_spec.get("target_name") product_name = old_spec.get("product_name", target_name) product_extension = old_spec.get("product_extension") ninja_target = {} ninja_target["target_name"] = target_name ninja_target["product_name"] = product_name if product_extension: ninja_target["product_extension"] = product_extension ninja_target["toolset"] = old_spec.get("toolset") ninja_target["default_configuration"] = old_spec.get("default_configuration") ninja_target["configurations"] = {} # Tell Xcode to look in |ninja_toplevel| for build products. new_xcode_settings = {} if ninja_toplevel: new_xcode_settings["CONFIGURATION_BUILD_DIR"] = ( "%s/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)" % ninja_toplevel ) if "configurations" in old_spec: for config in old_spec["configurations"]: old_xcode_settings = old_spec["configurations"][config].get( "xcode_settings", {} ) if "IPHONEOS_DEPLOYMENT_TARGET" in old_xcode_settings: new_xcode_settings["CODE_SIGNING_REQUIRED"] = "NO" new_xcode_settings["IPHONEOS_DEPLOYMENT_TARGET"] = old_xcode_settings[ "IPHONEOS_DEPLOYMENT_TARGET" ] for key in ["BUNDLE_LOADER", "TEST_HOST"]: if key in old_xcode_settings: new_xcode_settings[key] = old_xcode_settings[key] ninja_target["configurations"][config] = {} ninja_target["configurations"][config][ "xcode_settings" ] = new_xcode_settings ninja_target["mac_bundle"] = old_spec.get("mac_bundle", 0) ninja_target["mac_xctest_bundle"] = old_spec.get("mac_xctest_bundle", 0) ninja_target["ios_app_extension"] = old_spec.get("ios_app_extension", 0) ninja_target["ios_watchkit_extension"] = old_spec.get("ios_watchkit_extension", 0) ninja_target["ios_watchkit_app"] = old_spec.get("ios_watchkit_app", 0) ninja_target["type"] = old_spec["type"] if ninja_toplevel: ninja_target["actions"] = [ { "action_name": "Compile and copy %s via ninja" % target_name, "inputs": [], "outputs": [], "action": [ "env", "PATH=%s" % os.environ["PATH"], "ninja", "-C", new_xcode_settings["CONFIGURATION_BUILD_DIR"], target_name, ], "message": "Compile and copy %s via ninja" % target_name, }, ] if jobs > 0: ninja_target["actions"][0]["action"].extend(("-j", jobs)) return ninja_target def IsValidTargetForWrapper(target_extras, executable_target_pattern, spec): """Limit targets for Xcode wrapper. Xcode sometimes performs poorly with too many targets, so only include proper executable targets, with filters to customize. Arguments: target_extras: Regular expression to always add, matching any target. executable_target_pattern: Regular expression limiting executable targets. spec: Specifications for target. """ target_name = spec.get("target_name") # Always include targets matching target_extras. if target_extras is not None and re.search(target_extras, target_name): return True # Otherwise just show executable targets and xc_tests. if int(spec.get("mac_xctest_bundle", 0)) != 0 or ( spec.get("type", "") == "executable" and spec.get("product_extension", "") != "bundle" ): # If there is a filter and the target does not match, exclude the target. if executable_target_pattern is not None: if not re.search(executable_target_pattern, target_name): return False return True return False def CreateWrapper(target_list, target_dicts, data, params): """Initialize targets for the ninja wrapper. This sets up the necessary variables in the targets to generate Xcode projects that use ninja as an external builder. Arguments: target_list: List of target pairs: 'base/base.gyp:base'. target_dicts: Dict of target properties keyed on target pair. data: Dict of flattened build files keyed on gyp path. params: Dict of global options for gyp. """ orig_gyp = params["build_files"][0] for gyp_name, gyp_dict in data.items(): if gyp_name == orig_gyp: depth = gyp_dict["_DEPTH"] # Check for custom main gyp name, otherwise use the default CHROMIUM_GYP_FILE # and prepend .ninja before the .gyp extension. generator_flags = params.get("generator_flags", {}) main_gyp = generator_flags.get("xcode_ninja_main_gyp", None) if main_gyp is None: (build_file_root, build_file_ext) = os.path.splitext(orig_gyp) main_gyp = build_file_root + ".ninja" + build_file_ext # Create new |target_list|, |target_dicts| and |data| data structures. new_target_list = [] new_target_dicts = {} new_data = {} # Set base keys needed for |data|. new_data[main_gyp] = {} new_data[main_gyp]["included_files"] = [] new_data[main_gyp]["targets"] = [] new_data[main_gyp]["xcode_settings"] = data[orig_gyp].get("xcode_settings", {}) # Normally the xcode-ninja generator includes only valid executable targets. # If |xcode_ninja_executable_target_pattern| is set, that list is reduced to # executable targets that match the pattern. (Default all) executable_target_pattern = generator_flags.get( "xcode_ninja_executable_target_pattern", None ) # For including other non-executable targets, add the matching target name # to the |xcode_ninja_target_pattern| regular expression. (Default none) target_extras = generator_flags.get("xcode_ninja_target_pattern", None) for old_qualified_target in target_list: spec = target_dicts[old_qualified_target] if IsValidTargetForWrapper(target_extras, executable_target_pattern, spec): # Add to new_target_list. target_name = spec.get("target_name") new_target_name = f"{main_gyp}:{target_name}#target" new_target_list.append(new_target_name) # Add to new_target_dicts. new_target_dicts[new_target_name] = _TargetFromSpec(spec, params) # Add to new_data. for old_target in data[old_qualified_target.split(":")[0]]["targets"]: if old_target["target_name"] == target_name: new_data_target = {} new_data_target["target_name"] = old_target["target_name"] new_data_target["toolset"] = old_target["toolset"] new_data[main_gyp]["targets"].append(new_data_target) # Create sources target. sources_target_name = "sources_for_indexing" sources_target = _TargetFromSpec( { "target_name": sources_target_name, "toolset": "target", "default_configuration": "Default", "mac_bundle": "0", "type": "executable", }, None, ) # Tell Xcode to look everywhere for headers. sources_target["configurations"] = {"Default": {"include_dirs": [depth]}} # Put excluded files into the sources target so they can be opened in Xcode. skip_excluded_files = not generator_flags.get( "xcode_ninja_list_excluded_files", True ) sources = [] for target, target_dict in target_dicts.items(): base = os.path.dirname(target) files = target_dict.get("sources", []) + target_dict.get( "mac_bundle_resources", [] ) if not skip_excluded_files: files.extend( target_dict.get("sources_excluded", []) + target_dict.get("mac_bundle_resources_excluded", []) ) for action in target_dict.get("actions", []): files.extend(action.get("inputs", [])) if not skip_excluded_files: files.extend(action.get("inputs_excluded", [])) # Remove files starting with $. These are mostly intermediate files for the # build system. files = [file for file in files if not file.startswith("$")] # Make sources relative to root build file. relative_path = os.path.dirname(main_gyp) sources += [ os.path.relpath(os.path.join(base, file), relative_path) for file in files ] sources_target["sources"] = sorted(set(sources)) # Put sources_to_index in it's own gyp. sources_gyp = os.path.join(os.path.dirname(main_gyp), sources_target_name + ".gyp") fully_qualified_target_name = f"{sources_gyp}:{sources_target_name}#target" # Add to new_target_list, new_target_dicts and new_data. new_target_list.append(fully_qualified_target_name) new_target_dicts[fully_qualified_target_name] = sources_target new_data_target = {} new_data_target["target_name"] = sources_target["target_name"] new_data_target["_DEPTH"] = depth new_data_target["toolset"] = "target" new_data[sources_gyp] = {} new_data[sources_gyp]["targets"] = [] new_data[sources_gyp]["included_files"] = [] new_data[sources_gyp]["xcode_settings"] = data[orig_gyp].get("xcode_settings", {}) new_data[sources_gyp]["targets"].append(new_data_target) # Write workspace to file. _WriteWorkspace(main_gyp, sources_gyp, params) return (new_target_list, new_target_dicts, new_data) # Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Applies a fix to CR LF TAB handling in xml.dom. Fixes this: http://code.google.com/p/chromium/issues/detail?id=76293 Working around this: http://bugs.python.org/issue5752 TODO(bradnelson): Consider dropping this when we drop XP support. """ import xml.dom.minidom def _Replacement_write_data(writer, data, is_attrib=False): """Writes datachars to writer.""" data = data.replace("&", "&").replace("<", "<") data = data.replace('"', """).replace(">", ">") if is_attrib: data = data.replace("\r", " ").replace("\n", " ").replace("\t", " ") writer.write(data) def _Replacement_writexml(self, writer, indent="", addindent="", newl=""): # indent = current indentation # addindent = indentation to add to higher levels # newl = newline string writer.write(indent + "<" + self.tagName) attrs = self._get_attributes() a_names = sorted(attrs.keys()) for a_name in a_names: writer.write(' %s="' % a_name) _Replacement_write_data(writer, attrs[a_name].value, is_attrib=True) writer.write('"') if self.childNodes: writer.write(">%s" % newl) for node in self.childNodes: node.writexml(writer, indent + addindent, addindent, newl) writer.write(f"{indent}{newl}") else: writer.write("/>%s" % newl) class XmlFix: """Object to manage temporary patching of xml.dom.minidom.""" def __init__(self): # Preserve current xml.dom.minidom functions. self.write_data = xml.dom.minidom._write_data self.writexml = xml.dom.minidom.Element.writexml # Inject replacement versions of a function and a method. xml.dom.minidom._write_data = _Replacement_write_data xml.dom.minidom.Element.writexml = _Replacement_writexml def Cleanup(self): if self.write_data: xml.dom.minidom._write_data = self.write_data xml.dom.minidom.Element.writexml = self.writexml self.write_data = None def __del__(self): self.Cleanup() #!/usr/bin/env python3 # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import copy import gyp.input import argparse import os.path import re import shlex import sys import traceback from gyp.common import GypError # Default debug modes for GYP debug = {} # List of "official" debug modes, but you can use anything you like. DEBUG_GENERAL = "general" DEBUG_VARIABLES = "variables" DEBUG_INCLUDES = "includes" def DebugOutput(mode, message, *args): if "all" in gyp.debug or mode in gyp.debug: ctx = ("unknown", 0, "unknown") try: f = traceback.extract_stack(limit=2) if f: ctx = f[0][:3] except Exception: pass if args: message %= args print( "%s:%s:%d:%s %s" % (mode.upper(), os.path.basename(ctx[0]), ctx[1], ctx[2], message) ) def FindBuildFiles(): extension = ".gyp" files = os.listdir(os.getcwd()) build_files = [] for file in files: if file.endswith(extension): build_files.append(file) return build_files def Load( build_files, format, default_variables={}, includes=[], depth=".", params=None, check=False, circular_check=True, ): """ Loads one or more specified build files. default_variables and includes will be copied before use. Returns the generator for the specified format and the data returned by loading the specified build files. """ if params is None: params = {} if "-" in format: format, params["flavor"] = format.split("-", 1) default_variables = copy.copy(default_variables) # Default variables provided by this program and its modules should be # named WITH_CAPITAL_LETTERS to provide a distinct "best practice" namespace, # avoiding collisions with user and automatic variables. default_variables["GENERATOR"] = format default_variables["GENERATOR_FLAVOR"] = params.get("flavor", "") # Format can be a custom python file, or by default the name of a module # within gyp.generator. if format.endswith(".py"): generator_name = os.path.splitext(format)[0] path, generator_name = os.path.split(generator_name) # Make sure the path to the custom generator is in sys.path # Don't worry about removing it once we are done. Keeping the path # to each generator that is used in sys.path is likely harmless and # arguably a good idea. path = os.path.abspath(path) if path not in sys.path: sys.path.insert(0, path) else: generator_name = "gyp.generator." + format # These parameters are passed in order (as opposed to by key) # because ActivePython cannot handle key parameters to __import__. generator = __import__(generator_name, globals(), locals(), generator_name) for (key, val) in generator.generator_default_variables.items(): default_variables.setdefault(key, val) # Give the generator the opportunity to set additional variables based on # the params it will receive in the output phase. if getattr(generator, "CalculateVariables", None): generator.CalculateVariables(default_variables, params) # Give the generator the opportunity to set generator_input_info based on # the params it will receive in the output phase. if getattr(generator, "CalculateGeneratorInputInfo", None): generator.CalculateGeneratorInputInfo(params) # Fetch the generator specific info that gets fed to input, we use getattr # so we can default things and the generators only have to provide what # they need. generator_input_info = { "non_configuration_keys": getattr( generator, "generator_additional_non_configuration_keys", [] ), "path_sections": getattr(generator, "generator_additional_path_sections", []), "extra_sources_for_rules": getattr( generator, "generator_extra_sources_for_rules", [] ), "generator_supports_multiple_toolsets": getattr( generator, "generator_supports_multiple_toolsets", False ), "generator_wants_static_library_dependencies_adjusted": getattr( generator, "generator_wants_static_library_dependencies_adjusted", True ), "generator_wants_sorted_dependencies": getattr( generator, "generator_wants_sorted_dependencies", False ), "generator_filelist_paths": getattr( generator, "generator_filelist_paths", None ), } # Process the input specific to this generator. result = gyp.input.Load( build_files, default_variables, includes[:], depth, generator_input_info, check, circular_check, params["parallel"], params["root_targets"], ) return [generator] + result def NameValueListToDict(name_value_list): """ Takes an array of strings of the form 'NAME=VALUE' and creates a dictionary of the pairs. If a string is simply NAME, then the value in the dictionary is set to True. If VALUE can be converted to an integer, it is. """ result = {} for item in name_value_list: tokens = item.split("=", 1) if len(tokens) == 2: # If we can make it an int, use that, otherwise, use the string. try: token_value = int(tokens[1]) except ValueError: token_value = tokens[1] # Set the variable to the supplied value. result[tokens[0]] = token_value else: # No value supplied, treat it as a boolean and set it. result[tokens[0]] = True return result def ShlexEnv(env_name): flags = os.environ.get(env_name, []) if flags: flags = shlex.split(flags) return flags def FormatOpt(opt, value): if opt.startswith("--"): return f"{opt}={value}" return opt + value def RegenerateAppendFlag(flag, values, predicate, env_name, options): """Regenerate a list of command line flags, for an option of action='append'. The |env_name|, if given, is checked in the environment and used to generate an initial list of options, then the options that were specified on the command line (given in |values|) are appended. This matches the handling of environment variables and command line flags where command line flags override the environment, while not requiring the environment to be set when the flags are used again. """ flags = [] if options.use_environment and env_name: for flag_value in ShlexEnv(env_name): value = FormatOpt(flag, predicate(flag_value)) if value in flags: flags.remove(value) flags.append(value) if values: for flag_value in values: flags.append(FormatOpt(flag, predicate(flag_value))) return flags def RegenerateFlags(options): """Given a parsed options object, and taking the environment variables into account, returns a list of flags that should regenerate an equivalent options object (even in the absence of the environment variables.) Any path options will be normalized relative to depth. The format flag is not included, as it is assumed the calling generator will set that as appropriate. """ def FixPath(path): path = gyp.common.FixIfRelativePath(path, options.depth) if not path: return os.path.curdir return path def Noop(value): return value # We always want to ignore the environment when regenerating, to avoid # duplicate or changed flags in the environment at the time of regeneration. flags = ["--ignore-environment"] for name, metadata in options._regeneration_metadata.items(): opt = metadata["opt"] value = getattr(options, name) value_predicate = metadata["type"] == "path" and FixPath or Noop action = metadata["action"] env_name = metadata["env_name"] if action == "append": flags.extend( RegenerateAppendFlag(opt, value, value_predicate, env_name, options) ) elif action in ("store", None): # None is a synonym for 'store'. if value: flags.append(FormatOpt(opt, value_predicate(value))) elif options.use_environment and env_name and os.environ.get(env_name): flags.append(FormatOpt(opt, value_predicate(os.environ.get(env_name)))) elif action in ("store_true", "store_false"): if (action == "store_true" and value) or ( action == "store_false" and not value ): flags.append(opt) elif options.use_environment and env_name: print( "Warning: environment regeneration unimplemented " "for %s flag %r env_name %r" % (action, opt, env_name), file=sys.stderr, ) else: print( "Warning: regeneration unimplemented for action %r " "flag %r" % (action, opt), file=sys.stderr, ) return flags class RegeneratableOptionParser(argparse.ArgumentParser): def __init__(self, usage): self.__regeneratable_options = {} argparse.ArgumentParser.__init__(self, usage=usage) def add_argument(self, *args, **kw): """Add an option to the parser. This accepts the same arguments as ArgumentParser.add_argument, plus the following: regenerate: can be set to False to prevent this option from being included in regeneration. env_name: name of environment variable that additional values for this option come from. type: adds type='path', to tell the regenerator that the values of this option need to be made relative to options.depth """ env_name = kw.pop("env_name", None) if "dest" in kw and kw.pop("regenerate", True): dest = kw["dest"] # The path type is needed for regenerating, for optparse we can just treat # it as a string. type = kw.get("type") if type == "path": kw["type"] = str self.__regeneratable_options[dest] = { "action": kw.get("action"), "type": type, "env_name": env_name, "opt": args[0], } argparse.ArgumentParser.add_argument(self, *args, **kw) def parse_args(self, *args): values, args = argparse.ArgumentParser.parse_known_args(self, *args) values._regeneration_metadata = self.__regeneratable_options return values, args def gyp_main(args): my_name = os.path.basename(sys.argv[0]) usage = "usage: %(prog)s [options ...] [build_file ...]" parser = RegeneratableOptionParser(usage=usage.replace("%s", "%(prog)s")) parser.add_argument( "--build", dest="configs", action="append", help="configuration for build after project generation", ) parser.add_argument( "--check", dest="check", action="store_true", help="check format of gyp files" ) parser.add_argument( "--config-dir", dest="config_dir", action="store", env_name="GYP_CONFIG_DIR", default=None, help="The location for configuration files like " "include.gypi.", ) parser.add_argument( "-d", "--debug", dest="debug", metavar="DEBUGMODE", action="append", default=[], help="turn on a debugging " 'mode for debugging GYP. Supported modes are "variables", ' '"includes" and "general" or "all" for all of them.', ) parser.add_argument( "-D", dest="defines", action="append", metavar="VAR=VAL", env_name="GYP_DEFINES", help="sets variable VAR to value VAL", ) parser.add_argument( "--depth", dest="depth", metavar="PATH", type="path", help="set DEPTH gyp variable to a relative path to PATH", ) parser.add_argument( "-f", "--format", dest="formats", action="append", env_name="GYP_GENERATORS", regenerate=False, help="output formats to generate", ) parser.add_argument( "-G", dest="generator_flags", action="append", default=[], metavar="FLAG=VAL", env_name="GYP_GENERATOR_FLAGS", help="sets generator flag FLAG to VAL", ) parser.add_argument( "--generator-output", dest="generator_output", action="store", default=None, metavar="DIR", type="path", env_name="GYP_GENERATOR_OUTPUT", help="puts generated build files under DIR", ) parser.add_argument( "--ignore-environment", dest="use_environment", action="store_false", default=True, regenerate=False, help="do not read options from environment variables", ) parser.add_argument( "-I", "--include", dest="includes", action="append", metavar="INCLUDE", type="path", help="files to include in all loaded .gyp files", ) # --no-circular-check disables the check for circular relationships between # .gyp files. These relationships should not exist, but they've only been # observed to be harmful with the Xcode generator. Chromium's .gyp files # currently have some circular relationships on non-Mac platforms, so this # option allows the strict behavior to be used on Macs and the lenient # behavior to be used elsewhere. # TODO(mark): Remove this option when http://crbug.com/35878 is fixed. parser.add_argument( "--no-circular-check", dest="circular_check", action="store_false", default=True, regenerate=False, help="don't check for circular relationships between files", ) parser.add_argument( "--no-parallel", action="store_true", default=False, help="Disable multiprocessing", ) parser.add_argument( "-S", "--suffix", dest="suffix", default="", help="suffix to add to generated files", ) parser.add_argument( "--toplevel-dir", dest="toplevel_dir", action="store", default=None, metavar="DIR", type="path", help="directory to use as the root of the source tree", ) parser.add_argument( "-R", "--root-target", dest="root_targets", action="append", metavar="TARGET", help="include only TARGET and its deep dependencies", ) options, build_files_arg = parser.parse_args(args) build_files = build_files_arg # Set up the configuration directory (defaults to ~/.gyp) if not options.config_dir: home = None home_dot_gyp = None if options.use_environment: home_dot_gyp = os.environ.get("GYP_CONFIG_DIR", None) if home_dot_gyp: home_dot_gyp = os.path.expanduser(home_dot_gyp) if not home_dot_gyp: home_vars = ["HOME"] if sys.platform in ("cygwin", "win32"): home_vars.append("USERPROFILE") for home_var in home_vars: home = os.getenv(home_var) if home: home_dot_gyp = os.path.join(home, ".gyp") if not os.path.exists(home_dot_gyp): home_dot_gyp = None else: break else: home_dot_gyp = os.path.expanduser(options.config_dir) if home_dot_gyp and not os.path.exists(home_dot_gyp): home_dot_gyp = None if not options.formats: # If no format was given on the command line, then check the env variable. generate_formats = [] if options.use_environment: generate_formats = os.environ.get("GYP_GENERATORS", []) if generate_formats: generate_formats = re.split(r"[\s,]", generate_formats) if generate_formats: options.formats = generate_formats else: # Nothing in the variable, default based on platform. if sys.platform == "darwin": options.formats = ["xcode"] elif sys.platform in ("win32", "cygwin"): options.formats = ["msvs"] else: options.formats = ["make"] if not options.generator_output and options.use_environment: g_o = os.environ.get("GYP_GENERATOR_OUTPUT") if g_o: options.generator_output = g_o options.parallel = not options.no_parallel for mode in options.debug: gyp.debug[mode] = 1 # Do an extra check to avoid work when we're not debugging. if DEBUG_GENERAL in gyp.debug: DebugOutput(DEBUG_GENERAL, "running with these options:") for option, value in sorted(options.__dict__.items()): if option[0] == "_": continue if isinstance(value, str): DebugOutput(DEBUG_GENERAL, " %s: '%s'", option, value) else: DebugOutput(DEBUG_GENERAL, " %s: %s", option, value) if not build_files: build_files = FindBuildFiles() if not build_files: raise GypError((usage + "\n\n%s: error: no build_file") % (my_name, my_name)) # TODO(mark): Chromium-specific hack! # For Chromium, the gyp "depth" variable should always be a relative path # to Chromium's top-level "src" directory. If no depth variable was set # on the command line, try to find a "src" directory by looking at the # absolute path to each build file's directory. The first "src" component # found will be treated as though it were the path used for --depth. if not options.depth: for build_file in build_files: build_file_dir = os.path.abspath(os.path.dirname(build_file)) build_file_dir_components = build_file_dir.split(os.path.sep) components_len = len(build_file_dir_components) for index in range(components_len - 1, -1, -1): if build_file_dir_components[index] == "src": options.depth = os.path.sep.join(build_file_dir_components) break del build_file_dir_components[index] # If the inner loop found something, break without advancing to another # build file. if options.depth: break if not options.depth: raise GypError( "Could not automatically locate src directory. This is" "a temporary Chromium feature that will be removed. Use" "--depth as a workaround." ) # If toplevel-dir is not set, we assume that depth is the root of our source # tree. if not options.toplevel_dir: options.toplevel_dir = options.depth # -D on the command line sets variable defaults - D isn't just for define, # it's for default. Perhaps there should be a way to force (-F?) a # variable's value so that it can't be overridden by anything else. cmdline_default_variables = {} defines = [] if options.use_environment: defines += ShlexEnv("GYP_DEFINES") if options.defines: defines += options.defines cmdline_default_variables = NameValueListToDict(defines) if DEBUG_GENERAL in gyp.debug: DebugOutput( DEBUG_GENERAL, "cmdline_default_variables: %s", cmdline_default_variables ) # Set up includes. includes = [] # If ~/.gyp/include.gypi exists, it'll be forcibly included into every # .gyp file that's loaded, before anything else is included. if home_dot_gyp: default_include = os.path.join(home_dot_gyp, "include.gypi") if os.path.exists(default_include): print("Using overrides found in " + default_include) includes.append(default_include) # Command-line --include files come after the default include. if options.includes: includes.extend(options.includes) # Generator flags should be prefixed with the target generator since they # are global across all generator runs. gen_flags = [] if options.use_environment: gen_flags += ShlexEnv("GYP_GENERATOR_FLAGS") if options.generator_flags: gen_flags += options.generator_flags generator_flags = NameValueListToDict(gen_flags) if DEBUG_GENERAL in gyp.debug.keys(): DebugOutput(DEBUG_GENERAL, "generator_flags: %s", generator_flags) # Generate all requested formats (use a set in case we got one format request # twice) for format in set(options.formats): params = { "options": options, "build_files": build_files, "generator_flags": generator_flags, "cwd": os.getcwd(), "build_files_arg": build_files_arg, "gyp_binary": sys.argv[0], "home_dot_gyp": home_dot_gyp, "parallel": options.parallel, "root_targets": options.root_targets, "target_arch": cmdline_default_variables.get("target_arch", ""), } # Start with the default variables from the command line. [generator, flat_list, targets, data] = Load( build_files, format, cmdline_default_variables, includes, options.depth, params, options.check, options.circular_check, ) # TODO(mark): Pass |data| for now because the generator needs a list of # build files that came in. In the future, maybe it should just accept # a list, and not the whole data dict. # NOTE: flat_list is the flattened dependency graph specifying the order # that targets may be built. Build systems that operate serially or that # need to have dependencies defined before dependents reference them should # generate targets in the order specified in flat_list. generator.GenerateOutput(flat_list, targets, data, params) if options.configs: valid_configs = targets[flat_list[0]]["configurations"] for conf in options.configs: if conf not in valid_configs: raise GypError("Invalid config specified via --build: %s" % conf) generator.PerformBuild(data, options.configs, params) # Done return 0 def main(args): try: return gyp_main(args) except GypError as e: sys.stderr.write("gyp: %s\n" % e) return 1 # NOTE: setuptools generated console_scripts calls function with no arguments def script_main(): return main(sys.argv[1:]) if __name__ == "__main__": sys.exit(script_main()) ;;; gyp-tests.el - unit tests for gyp-mode. ;; Copyright (c) 2012 Google Inc. All rights reserved. ;; Use of this source code is governed by a BSD-style license that can be ;; found in the LICENSE file. ;; The recommended way to run these tests is to run them from the command-line, ;; with the run-unit-tests.sh script. (require 'cl) (require 'ert) (require 'gyp) (defconst samples (directory-files "testdata" t ".gyp$") "List of golden samples to check") (defun fontify (filename) (with-temp-buffer (insert-file-contents-literally filename) (gyp-mode) (font-lock-fontify-buffer) (buffer-string))) (defun read-golden-sample (filename) (with-temp-buffer (insert-file-contents-literally (concat filename ".fontified")) (read (current-buffer)))) (defun equivalent-face (face) "For the purposes of face comparison, we're not interested in the differences between certain faces. For example, the difference between font-lock-comment-delimiter and font-lock-comment-face." (cl-case face ((font-lock-comment-delimiter-face) font-lock-comment-face) (t face))) (defun text-face-properties (s) "Extract the text properties from s" (let ((result (list t))) (dotimes (i (length s)) (setq result (cons (equivalent-face (get-text-property i 'face s)) result))) (nreverse result))) (ert-deftest test-golden-samples () "Check that fontification produces the same results as the golden samples" (dolist (sample samples) (let ((golden (read-golden-sample sample)) (fontified (fontify sample))) (should (equal golden fontified)) (should (equal (text-face-properties golden) (text-face-properties fontified)))))) (defun create-golden-sample (filename) "Create a golden sample by fontifying filename and writing out the printable representation of the fontified buffer (with text properties) to the FILENAME.fontified" (with-temp-file (concat filename ".fontified") (print (fontify filename) (current-buffer)))) (defun create-golden-samples () "Recreate the golden samples" (dolist (sample samples) (create-golden-sample sample))) ;;; gyp.el - font-lock-mode support for gyp files. ;; Copyright (c) 2012 Google Inc. All rights reserved. ;; Use of this source code is governed by a BSD-style license that can be ;; found in the LICENSE file. ;; Put this somewhere in your load-path and ;; (require 'gyp) (require 'python) (require 'cl) (when (string-match "python-mode.el" (symbol-file 'python-mode 'defun)) (error (concat "python-mode must be loaded from python.el (bundled with " "recent emacsen), not from the older and less maintained " "python-mode.el"))) (defadvice python-indent-calculate-levels (after gyp-outdent-closing-parens activate) "De-indent closing parens, braces, and brackets in gyp-mode." (when (and (eq major-mode 'gyp-mode) (string-match "^ *[])}][],)}]* *$" (buffer-substring-no-properties (line-beginning-position) (line-end-position)))) (setf (first python-indent-levels) (- (first python-indent-levels) python-continuation-offset)))) (defadvice python-indent-guess-indent-offset (around gyp-indent-guess-indent-offset activate) "Guess correct indent offset in gyp-mode." (or (and (not (eq major-mode 'gyp-mode)) ad-do-it) (save-excursion (save-restriction (widen) (goto-char (point-min)) ;; Find first line ending with an opening brace that is not a comment. (or (and (re-search-forward "\\(^[[{]$\\|^.*[^#].*[[{]$\\)") (forward-line) (/= (current-indentation) 0) (set (make-local-variable 'python-indent-offset) (current-indentation)) (set (make-local-variable 'python-continuation-offset) (current-indentation))) (message "Can't guess gyp indent offset, using default: %s" python-continuation-offset)))))) (define-derived-mode gyp-mode python-mode "Gyp" "Major mode for editing .gyp files. See http://code.google.com/p/gyp/" ;; gyp-parse-history is a stack of (POSITION . PARSE-STATE) tuples, ;; with greater positions at the top of the stack. PARSE-STATE ;; is a list of section symbols (see gyp-section-name and gyp-parse-to) ;; with most nested section symbol at the front of the list. (set (make-local-variable 'gyp-parse-history) '((1 . (list)))) (gyp-add-font-lock-keywords)) (defun gyp-set-indentation () "Hook function to configure python indentation to suit gyp mode." (set (make-local-variable 'python-indent-offset) 2) (set (make-local-variable 'python-continuation-offset) 2) (set (make-local-variable 'python-indent-guess-indent-offset) t) (python-indent-guess-indent-offset)) (add-hook 'gyp-mode-hook 'gyp-set-indentation) (add-to-list 'auto-mode-alist '("\\.gyp\\'" . gyp-mode)) (add-to-list 'auto-mode-alist '("\\.gypi\\'" . gyp-mode)) (add-to-list 'auto-mode-alist '("/\\.gclient\\'" . gyp-mode)) ;;; Font-lock support (defconst gyp-dependencies-regexp (regexp-opt (list "dependencies" "export_dependent_settings")) "Regular expression to introduce 'dependencies' section") (defconst gyp-sources-regexp (regexp-opt (list "action" "files" "include_dirs" "includes" "inputs" "libraries" "outputs" "sources")) "Regular expression to introduce 'sources' sections") (defconst gyp-conditions-regexp (regexp-opt (list "conditions" "target_conditions")) "Regular expression to introduce conditions sections") (defconst gyp-variables-regexp "^variables" "Regular expression to introduce variables sections") (defconst gyp-defines-regexp "^defines" "Regular expression to introduce 'defines' sections") (defconst gyp-targets-regexp "^targets" "Regular expression to introduce 'targets' sections") (defun gyp-section-name (section) "Map the sections we are interested in from SECTION to symbol. SECTION is a string from the buffer that introduces a section. The result is a symbol representing the kind of section. This allows us to treat (for the purposes of font-lock) several different section names as the same kind of section. For example, a 'sources section can be introduced by the 'sources', 'inputs', 'outputs' keyword. 'other is the default section kind when a more specific match is not made." (cond ((string-match-p gyp-dependencies-regexp section) 'dependencies) ((string-match-p gyp-sources-regexp section) 'sources) ((string-match-p gyp-variables-regexp section) 'variables) ((string-match-p gyp-conditions-regexp section) 'conditions) ((string-match-p gyp-targets-regexp section) 'targets) ((string-match-p gyp-defines-regexp section) 'defines) (t 'other))) (defun gyp-invalidate-parse-states-after (target-point) "Erase any parse information after target-point." (while (> (caar gyp-parse-history) target-point) (setq gyp-parse-history (cdr gyp-parse-history)))) (defun gyp-parse-point () "The point of the last parse state added by gyp-parse-to." (caar gyp-parse-history)) (defun gyp-parse-sections () "A list of section symbols holding at the last parse state point." (cdar gyp-parse-history)) (defun gyp-inside-dictionary-p () "Predicate returning true if the parser is inside a dictionary." (not (eq (cadar gyp-parse-history) 'list))) (defun gyp-add-parse-history (point sections) "Add parse state SECTIONS to the parse history at POINT so that parsing can be resumed instantly." (while (>= (caar gyp-parse-history) point) (setq gyp-parse-history (cdr gyp-parse-history))) (setq gyp-parse-history (cons (cons point sections) gyp-parse-history))) (defun gyp-parse-to (target-point) "Parses from (point) to TARGET-POINT adding the parse state information to gyp-parse-state-history. Parsing stops if TARGET-POINT is reached or if a string literal has been parsed. Returns nil if no further parsing can be done, otherwise returns the position of the start of a parsed string, leaving the point at the end of the string." (let ((parsing t) string-start) (while parsing (setq string-start nil) ;; Parse up to a character that starts a sexp, or if the nesting ;; level decreases. (let ((state (parse-partial-sexp (gyp-parse-point) target-point -1 t)) (sections (gyp-parse-sections))) (if (= (nth 0 state) -1) (setq sections (cdr sections)) ; pop out a level (cond ((looking-at-p "['\"]") ; a string (setq string-start (point)) (goto-char (scan-sexps (point) 1)) (if (gyp-inside-dictionary-p) ;; Look for sections inside a dictionary (let ((section (gyp-section-name (buffer-substring-no-properties (+ 1 string-start) (- (point) 1))))) (setq sections (cons section (cdr sections))))) ;; Stop after the string so it can be fontified. (setq target-point (point))) ((looking-at-p "{") ;; Inside a dictionary. Increase nesting. (forward-char 1) (setq sections (cons 'unknown sections))) ((looking-at-p "\\[") ;; Inside a list. Increase nesting (forward-char 1) (setq sections (cons 'list sections))) ((not (eobp)) ;; other (forward-char 1)))) (gyp-add-parse-history (point) sections) (setq parsing (< (point) target-point)))) string-start)) (defun gyp-section-at-point () "Transform the last parse state, which is a list of nested sections and return the section symbol that should be used to determine font-lock information for the string. Can return nil indicating the string should not have any attached section." (let ((sections (gyp-parse-sections))) (cond ((eq (car sections) 'conditions) ;; conditions can occur in a variables section, but we still want to ;; highlight it as a keyword. nil) ((and (eq (car sections) 'list) (eq (cadr sections) 'list)) ;; conditions and sources can have items in [[ ]] (caddr sections)) (t (cadr sections))))) (defun gyp-section-match (limit) "Parse from (point) to LIMIT returning by means of match data what was matched. The group of the match indicates what style font-lock should apply. See also `gyp-add-font-lock-keywords'." (gyp-invalidate-parse-states-after (point)) (let ((group nil) (string-start t)) (while (and (< (point) limit) (not group) string-start) (setq string-start (gyp-parse-to limit)) (if string-start (setq group (cl-case (gyp-section-at-point) ('dependencies 1) ('variables 2) ('conditions 2) ('sources 3) ('defines 4) (nil nil))))) (if group (progn ;; Set the match data to indicate to the font-lock mechanism the ;; highlighting to be performed. (set-match-data (append (list string-start (point)) (make-list (* (1- group) 2) nil) (list (1+ string-start) (1- (point))))) t)))) ;;; Please see http://code.google.com/p/gyp/wiki/GypLanguageSpecification for ;;; canonical list of keywords. (defun gyp-add-font-lock-keywords () "Add gyp-mode keywords to font-lock mechanism." ;; TODO(jknotten): Move all the keyword highlighting into gyp-section-match ;; so that we can do the font-locking in a single font-lock pass. (font-lock-add-keywords nil (list ;; Top-level keywords (list (concat "['\"]\\(" (regexp-opt (list "action" "action_name" "actions" "cflags" "cflags_cc" "conditions" "configurations" "copies" "defines" "dependencies" "destination" "direct_dependent_settings" "export_dependent_settings" "extension" "files" "include_dirs" "includes" "inputs" "ldflags" "libraries" "link_settings" "mac_bundle" "message" "msvs_external_rule" "outputs" "product_name" "process_outputs_as_sources" "rules" "rule_name" "sources" "suppress_wildcard" "target_conditions" "target_defaults" "target_defines" "target_name" "toolsets" "targets" "type" "variables" "xcode_settings")) "[!/+=]?\\)") 1 'font-lock-keyword-face t) ;; Type of target (list (concat "['\"]\\(" (regexp-opt (list "loadable_module" "static_library" "shared_library" "executable" "none")) "\\)") 1 'font-lock-type-face t) (list "\\(?:target\\|action\\)_name['\"]\\s-*:\\s-*['\"]\\([^ '\"]*\\)" 1 'font-lock-function-name-face t) (list 'gyp-section-match (list 1 'font-lock-function-name-face t t) ; dependencies (list 2 'font-lock-variable-name-face t t) ; variables, conditions (list 3 'font-lock-constant-face t t) ; sources (list 4 'font-lock-preprocessor-face t t)) ; preprocessor ;; Variable expansion (list "<@?(\\([^\n )]+\\))" 1 'font-lock-variable-name-face t) ;; Command expansion (list " mrs / 10) { var newSize = Math.floor(mrs * 0.9) this.record = this.record.slice(-1 * newSize) } this.emitLog(m) }.bind(log) log.emitLog = function (m) { if (this._paused) { this._buffer.push(m) return } if (this.progressEnabled) { this.gauge.pulse(m.prefix) } var l = this.levels[m.level] if (l === undefined) { return } if (l < this.levels[this.level]) { return } if (l > 0 && !isFinite(l)) { return } // If 'disp' is null or undefined, use the lvl as a default // Allows: '', 0 as valid disp var disp = log.disp[m.level] != null ? log.disp[m.level] : m.level this.clearProgress() m.message.split(/\r?\n/).forEach(function (line) { var heading = this.heading if (heading) { this.write(heading, this.headingStyle) this.write(' ') } this.write(disp, log.style[m.level]) var p = m.prefix || '' if (p) { this.write(' ') } this.write(p, this.prefixStyle) this.write(' ' + line + '\n') }, this) this.showProgress() } log._format = function (msg, style) { if (!stream) { return } var output = '' if (this.useColor()) { style = style || {} var settings = [] if (style.fg) { settings.push(style.fg) } if (style.bg) { settings.push('bg' + style.bg[0].toUpperCase() + style.bg.slice(1)) } if (style.bold) { settings.push('bold') } if (style.underline) { settings.push('underline') } if (style.inverse) { settings.push('inverse') } if (settings.length) { output += consoleControl.color(settings) } if (style.beep) { output += consoleControl.beep() } } output += msg if (this.useColor()) { output += consoleControl.color('reset') } return output } log.write = function (msg, style) { if (!stream) { return } stream.write(this._format(msg, style)) } log.addLevel = function (lvl, n, style, disp) { // If 'disp' is null or undefined, use the lvl as a default if (disp == null) { disp = lvl } this.levels[lvl] = n this.style[lvl] = style if (!this[lvl]) { this[lvl] = function () { var a = new Array(arguments.length + 1) a[0] = lvl for (var i = 0; i < arguments.length; i++) { a[i + 1] = arguments[i] } return this.log.apply(this, a) }.bind(this) } this.disp[lvl] = disp } log.prefixStyle = { fg: 'magenta' } log.headingStyle = { fg: 'white', bg: 'black' } log.style = {} log.levels = {} log.disp = {} log.addLevel('silly', -Infinity, { inverse: true }, 'sill') log.addLevel('verbose', 1000, { fg: 'cyan', bg: 'black' }, 'verb') log.addLevel('info', 2000, { fg: 'green' }) log.addLevel('timing', 2500, { fg: 'green', bg: 'black' }) log.addLevel('http', 3000, { fg: 'green', bg: 'black' }) log.addLevel('notice', 3500, { fg: 'cyan', bg: 'black' }) log.addLevel('warn', 4000, { fg: 'black', bg: 'yellow' }, 'WARN') log.addLevel('error', 5000, { fg: 'red', bg: 'black' }, 'ERR!') log.addLevel('silent', Infinity) // allow 'error' prefix log.on('error', function () {}) #!/usr/bin/env node // Standalone semver comparison program. // Exits successfully and prints matching version(s) if // any supplied version is valid and passes all tests. const argv = process.argv.slice(2) let versions = [] const range = [] let inc = null const version = require('../package.json').version let loose = false let includePrerelease = false let coerce = false let rtl = false let identifier const semver = require('../') let reverse = false const options = {} const main = () => { if (!argv.length) return help() while (argv.length) { let a = argv.shift() const indexOfEqualSign = a.indexOf('=') if (indexOfEqualSign !== -1) { a = a.slice(0, indexOfEqualSign) argv.unshift(a.slice(indexOfEqualSign + 1)) } switch (a) { case '-rv': case '-rev': case '--rev': case '--reverse': reverse = true break case '-l': case '--loose': loose = true break case '-p': case '--include-prerelease': includePrerelease = true break case '-v': case '--version': versions.push(argv.shift()) break case '-i': case '--inc': case '--increment': switch (argv[0]) { case 'major': case 'minor': case 'patch': case 'prerelease': case 'premajor': case 'preminor': case 'prepatch': inc = argv.shift() break default: inc = 'patch' break } break case '--preid': identifier = argv.shift() break case '-r': case '--range': range.push(argv.shift()) break case '-c': case '--coerce': coerce = true break case '--rtl': rtl = true break case '--ltr': rtl = false break case '-h': case '--help': case '-?': return help() default: versions.push(a) break } } const options = { loose: loose, includePrerelease: includePrerelease, rtl: rtl } versions = versions.map((v) => { return coerce ? (semver.coerce(v, options) || { version: v }).version : v }).filter((v) => { return semver.valid(v) }) if (!versions.length) return fail() if (inc && (versions.length !== 1 || range.length)) { return failInc() } for (let i = 0, l = range.length; i < l; i++) { versions = versions.filter((v) => { return semver.satisfies(v, range[i], options) }) if (!versions.length) return fail() } return success(versions) } const failInc = () => { console.error('--inc can only be used on a single version with no range') fail() } const fail = () => process.exit(1) const success = () => { const compare = reverse ? 'rcompare' : 'compare' versions.sort((a, b) => { return semver[compare](a, b, options) }).map((v) => { return semver.clean(v, options) }).map((v) => { return inc ? semver.inc(v, inc, options, identifier) : v }).forEach((v, i, _) => { console.log(v) }) } const help = () => console.log( `SemVer ${version} A JavaScript implementation of the https://semver.org/ specification Copyright Isaac Z. Schlueter Usage: semver [options] [ [...]] Prints valid versions sorted by SemVer precedence Options: -r --range Print versions that match the specified range. -i --increment [] Increment a version by the specified level. Level can be one of: major, minor, patch, premajor, preminor, prepatch, or prerelease. Default level is 'patch'. Only one version may be specified. --preid Identifier to be used to prefix premajor, preminor, prepatch or prerelease version increments. -l --loose Interpret versions and ranges loosely -p --include-prerelease Always include prerelease versions in range matching -c --coerce Coerce a string into SemVer if possible (does not imply --loose) --rtl Coerce version strings right to left --ltr Coerce version strings left to right (default) Program exits successfully if any valid version satisfies all supplied ranges, and prints all satisfying versions. If no satisfying versions are found, then exits failure. Versions are printed in ascending order, so supplying multiple versions to the utility will just sort them.`) main() const ANY = Symbol('SemVer ANY') // hoisted class for cyclic dependency class Comparator { static get ANY () { return ANY } constructor (comp, options) { options = parseOptions(options) if (comp instanceof Comparator) { if (comp.loose === !!options.loose) { return comp } else { comp = comp.value } } debug('comparator', comp, options) this.options = options this.loose = !!options.loose this.parse(comp) if (this.semver === ANY) { this.value = '' } else { this.value = this.operator + this.semver.version } debug('comp', this) } parse (comp) { const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] const m = comp.match(r) if (!m) { throw new TypeError(`Invalid comparator: ${comp}`) } this.operator = m[1] !== undefined ? m[1] : '' if (this.operator === '=') { this.operator = '' } // if it literally is just '>' or '' then allow anything. if (!m[2]) { this.semver = ANY } else { this.semver = new SemVer(m[2], this.options.loose) } } toString () { return this.value } test (version) { debug('Comparator.test', version, this.options.loose) if (this.semver === ANY || version === ANY) { return true } if (typeof version === 'string') { try { version = new SemVer(version, this.options) } catch (er) { return false } } return cmp(version, this.operator, this.semver, this.options) } intersects (comp, options) { if (!(comp instanceof Comparator)) { throw new TypeError('a Comparator is required') } if (!options || typeof options !== 'object') { options = { loose: !!options, includePrerelease: false } } if (this.operator === '') { if (this.value === '') { return true } return new Range(comp.value, options).test(this.value) } else if (comp.operator === '') { if (comp.value === '') { return true } return new Range(this.value, options).test(comp.semver) } const sameDirectionIncreasing = (this.operator === '>=' || this.operator === '>') && (comp.operator === '>=' || comp.operator === '>') const sameDirectionDecreasing = (this.operator === '<=' || this.operator === '<') && (comp.operator === '<=' || comp.operator === '<') const sameSemVer = this.semver.version === comp.semver.version const differentDirectionsInclusive = (this.operator === '>=' || this.operator === '<=') && (comp.operator === '>=' || comp.operator === '<=') const oppositeDirectionsLessThan = cmp(this.semver, '<', comp.semver, options) && (this.operator === '>=' || this.operator === '>') && (comp.operator === '<=' || comp.operator === '<') const oppositeDirectionsGreaterThan = cmp(this.semver, '>', comp.semver, options) && (this.operator === '<=' || this.operator === '<') && (comp.operator === '>=' || comp.operator === '>') return ( sameDirectionIncreasing || sameDirectionDecreasing || (sameSemVer && differentDirectionsInclusive) || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan ) } } module.exports = Comparator const parseOptions = require('../internal/parse-options') const {re, t} = require('../internal/re') const cmp = require('../functions/cmp') const debug = require('../internal/debug') const SemVer = require('./semver') const Range = require('./range') module.exports = { SemVer: require('./semver.js'), Range: require('./range.js'), Comparator: require('./comparator.js') } // hoisted class for cyclic dependency class Range { constructor (range, options) { options = parseOptions(options) if (range instanceof Range) { if ( range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease ) { return range } else { return new Range(range.raw, options) } } if (range instanceof Comparator) { // just put it in the set and return this.raw = range.value this.set = [[range]] this.format() return this } this.options = options this.loose = !!options.loose this.includePrerelease = !!options.includePrerelease // First, split based on boolean or || this.raw = range this.set = range .split(/\s*\|\|\s*/) // map the range to a 2d array of comparators .map(range => this.parseRange(range.trim())) // throw out any comparator lists that are empty // this generally means that it was not a valid range, which is allowed // in loose mode, but will still throw if the WHOLE range is invalid. .filter(c => c.length) if (!this.set.length) { throw new TypeError(`Invalid SemVer Range: ${range}`) } // if we have any that are not the null set, throw out null sets. if (this.set.length > 1) { // keep the first one, in case they're all null sets const first = this.set[0] this.set = this.set.filter(c => !isNullSet(c[0])) if (this.set.length === 0) this.set = [first] else if (this.set.length > 1) { // if we have any that are *, then the range is just * for (const c of this.set) { if (c.length === 1 && isAny(c[0])) { this.set = [c] break } } } } this.format() } format () { this.range = this.set .map((comps) => { return comps.join(' ').trim() }) .join('||') .trim() return this.range } toString () { return this.range } parseRange (range) { range = range.trim() // memoize range parsing for performance. // this is a very hot path, and fully deterministic. const memoOpts = Object.keys(this.options).join(',') const memoKey = `parseRange:${memoOpts}:${range}` const cached = cache.get(memoKey) if (cached) return cached const loose = this.options.loose // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) debug('hyphen replace', range) // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) debug('comparator trim', range, re[t.COMPARATORTRIM]) // `~ 1.2.3` => `~1.2.3` range = range.replace(re[t.TILDETRIM], tildeTrimReplace) // `^ 1.2.3` => `^1.2.3` range = range.replace(re[t.CARETTRIM], caretTrimReplace) // normalize spaces range = range.split(/\s+/).join(' ') // At this point, the range is completely trimmed and // ready to be split into comparators. const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] const rangeList = range .split(' ') .map(comp => parseComparator(comp, this.options)) .join(' ') .split(/\s+/) // >=0.0.0 is equivalent to * .map(comp => replaceGTE0(comp, this.options)) // in loose mode, throw out any that are not valid comparators .filter(this.options.loose ? comp => !!comp.match(compRe) : () => true) .map(comp => new Comparator(comp, this.options)) // if any comparators are the null set, then replace with JUST null set // if more than one comparator, remove any * comparators // also, don't include the same comparator more than once const l = rangeList.length const rangeMap = new Map() for (const comp of rangeList) { if (isNullSet(comp)) return [comp] rangeMap.set(comp.value, comp) } if (rangeMap.size > 1 && rangeMap.has('')) rangeMap.delete('') const result = [...rangeMap.values()] cache.set(memoKey, result) return result } intersects (range, options) { if (!(range instanceof Range)) { throw new TypeError('a Range is required') } return this.set.some((thisComparators) => { return ( isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => { return ( isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => { return rangeComparators.every((rangeComparator) => { return thisComparator.intersects(rangeComparator, options) }) }) ) }) ) }) } // if ANY of the sets match ALL of its comparators, then pass test (version) { if (!version) { return false } if (typeof version === 'string') { try { version = new SemVer(version, this.options) } catch (er) { return false } } for (let i = 0; i < this.set.length; i++) { if (testSet(this.set[i], version, this.options)) { return true } } return false } } module.exports = Range const LRU = require('lru-cache') const cache = new LRU({ max: 1000 }) const parseOptions = require('../internal/parse-options') const Comparator = require('./comparator') const debug = require('../internal/debug') const SemVer = require('./semver') const { re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require('../internal/re') const isNullSet = c => c.value === '<0.0.0-0' const isAny = c => c.value === '' // take a set of comparators and determine whether there // exists a version which can satisfy it const isSatisfiable = (comparators, options) => { let result = true const remainingComparators = comparators.slice() let testComparator = remainingComparators.pop() while (result && remainingComparators.length) { result = remainingComparators.every((otherComparator) => { return testComparator.intersects(otherComparator, options) }) testComparator = remainingComparators.pop() } return result } // comprised of xranges, tildes, stars, and gtlt's at this point. // already replaced the hyphen ranges // turn into a set of JUST comparators. const parseComparator = (comp, options) => { debug('comp', comp, options) comp = replaceCarets(comp, options) debug('caret', comp) comp = replaceTildes(comp, options) debug('tildes', comp) comp = replaceXRanges(comp, options) debug('xrange', comp) comp = replaceStars(comp, options) debug('stars', comp) return comp } const isX = id => !id || id.toLowerCase() === 'x' || id === '*' // ~, ~> --> * (any, kinda silly) // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 const replaceTildes = (comp, options) => comp.trim().split(/\s+/).map((comp) => { return replaceTilde(comp, options) }).join(' ') const replaceTilde = (comp, options) => { const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] return comp.replace(r, (_, M, m, p, pr) => { debug('tilde', comp, _, M, m, p, pr) let ret if (isX(M)) { ret = '' } else if (isX(m)) { ret = `>=${M}.0.0 <${+M + 1}.0.0-0` } else if (isX(p)) { // ~1.2 == >=1.2.0 <1.3.0-0 ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0` } else if (pr) { debug('replaceTilde pr', pr) ret = `>=${M}.${m}.${p}-${pr } <${M}.${+m + 1}.0-0` } else { // ~1.2.3 == >=1.2.3 <1.3.0-0 ret = `>=${M}.${m}.${p } <${M}.${+m + 1}.0-0` } debug('tilde return', ret) return ret }) } // ^ --> * (any, kinda silly) // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 // ^1.2.3 --> >=1.2.3 <2.0.0-0 // ^1.2.0 --> >=1.2.0 <2.0.0-0 const replaceCarets = (comp, options) => comp.trim().split(/\s+/).map((comp) => { return replaceCaret(comp, options) }).join(' ') const replaceCaret = (comp, options) => { debug('caret', comp, options) const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] const z = options.includePrerelease ? '-0' : '' return comp.replace(r, (_, M, m, p, pr) => { debug('caret', comp, _, M, m, p, pr) let ret if (isX(M)) { ret = '' } else if (isX(m)) { ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0` } else if (isX(p)) { if (M === '0') { ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` } else { ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0` } } else if (pr) { debug('replaceCaret pr', pr) if (M === '0') { if (m === '0') { ret = `>=${M}.${m}.${p}-${pr } <${M}.${m}.${+p + 1}-0` } else { ret = `>=${M}.${m}.${p}-${pr } <${M}.${+m + 1}.0-0` } } else { ret = `>=${M}.${m}.${p}-${pr } <${+M + 1}.0.0-0` } } else { debug('no pr') if (M === '0') { if (m === '0') { ret = `>=${M}.${m}.${p }${z} <${M}.${m}.${+p + 1}-0` } else { ret = `>=${M}.${m}.${p }${z} <${M}.${+m + 1}.0-0` } } else { ret = `>=${M}.${m}.${p } <${+M + 1}.0.0-0` } } debug('caret return', ret) return ret }) } const replaceXRanges = (comp, options) => { debug('replaceXRanges', comp, options) return comp.split(/\s+/).map((comp) => { return replaceXRange(comp, options) }).join(' ') } const replaceXRange = (comp, options) => { comp = comp.trim() const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] return comp.replace(r, (ret, gtlt, M, m, p, pr) => { debug('xRange', comp, ret, gtlt, M, m, p, pr) const xM = isX(M) const xm = xM || isX(m) const xp = xm || isX(p) const anyX = xp if (gtlt === '=' && anyX) { gtlt = '' } // if we're including prereleases in the match, then we need // to fix this to -0, the lowest possible prerelease value pr = options.includePrerelease ? '-0' : '' if (xM) { if (gtlt === '>' || gtlt === '<') { // nothing is allowed ret = '<0.0.0-0' } else { // nothing is forbidden ret = '*' } } else if (gtlt && anyX) { // we know patch is an x, because we have any x at all. // replace X with 0 if (xm) { m = 0 } p = 0 if (gtlt === '>') { // >1 => >=2.0.0 // >1.2 => >=1.3.0 gtlt = '>=' if (xm) { M = +M + 1 m = 0 p = 0 } else { m = +m + 1 p = 0 } } else if (gtlt === '<=') { // <=0.7.x is actually <0.8.0, since any 0.7.x should // pass. Similarly, <=7.x is actually <8.0.0, etc. gtlt = '<' if (xm) { M = +M + 1 } else { m = +m + 1 } } if (gtlt === '<') pr = '-0' ret = `${gtlt + M}.${m}.${p}${pr}` } else if (xm) { ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0` } else if (xp) { ret = `>=${M}.${m}.0${pr } <${M}.${+m + 1}.0-0` } debug('xRange return', ret) return ret }) } // Because * is AND-ed with everything else in the comparator, // and '' means "any version", just remove the *s entirely. const replaceStars = (comp, options) => { debug('replaceStars', comp, options) // Looseness is ignored here. star is always as loose as it gets! return comp.trim().replace(re[t.STAR], '') } const replaceGTE0 = (comp, options) => { debug('replaceGTE0', comp, options) return comp.trim() .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '') } // This function is passed to string.replace(re[t.HYPHENRANGE]) // M, m, patch, prerelease, build // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 // 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do // 1.2 - 3.4 => >=1.2.0 <3.5.0-0 const hyphenReplace = incPr => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) => { if (isX(fM)) { from = '' } else if (isX(fm)) { from = `>=${fM}.0.0${incPr ? '-0' : ''}` } else if (isX(fp)) { from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}` } else if (fpr) { from = `>=${from}` } else { from = `>=${from}${incPr ? '-0' : ''}` } if (isX(tM)) { to = '' } else if (isX(tm)) { to = `<${+tM + 1}.0.0-0` } else if (isX(tp)) { to = `<${tM}.${+tm + 1}.0-0` } else if (tpr) { to = `<=${tM}.${tm}.${tp}-${tpr}` } else if (incPr) { to = `<${tM}.${tm}.${+tp + 1}-0` } else { to = `<=${to}` } return (`${from} ${to}`).trim() } const testSet = (set, version, options) => { for (let i = 0; i < set.length; i++) { if (!set[i].test(version)) { return false } } if (version.prerelease.length && !options.includePrerelease) { // Find the set of versions that are allowed to have prereleases // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 // That should allow `1.2.3-pr.2` to pass. // However, `1.2.4-alpha.notready` should NOT be allowed, // even though it's within the range set by the comparators. for (let i = 0; i < set.length; i++) { debug(set[i].semver) if (set[i].semver === Comparator.ANY) { continue } if (set[i].semver.prerelease.length > 0) { const allowed = set[i].semver if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { return true } } } // Version has a -pre, but it's not one of the ones we like. return false } return true } const debug = require('../internal/debug') const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants') const { re, t } = require('../internal/re') const parseOptions = require('../internal/parse-options') const { compareIdentifiers } = require('../internal/identifiers') class SemVer { constructor (version, options) { options = parseOptions(options) if (version instanceof SemVer) { if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) { return version } else { version = version.version } } else if (typeof version !== 'string') { throw new TypeError(`Invalid Version: ${version}`) } if (version.length > MAX_LENGTH) { throw new TypeError( `version is longer than ${MAX_LENGTH} characters` ) } debug('SemVer', version, options) this.options = options this.loose = !!options.loose // this isn't actually relevant for versions, but keep it so that we // don't run into trouble passing this.options around. this.includePrerelease = !!options.includePrerelease const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) if (!m) { throw new TypeError(`Invalid Version: ${version}`) } this.raw = version // these are actually numbers this.major = +m[1] this.minor = +m[2] this.patch = +m[3] if (this.major > MAX_SAFE_INTEGER || this.major < 0) { throw new TypeError('Invalid major version') } if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { throw new TypeError('Invalid minor version') } if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { throw new TypeError('Invalid patch version') } // numberify any prerelease numeric ids if (!m[4]) { this.prerelease = [] } else { this.prerelease = m[4].split('.').map((id) => { if (/^[0-9]+$/.test(id)) { const num = +id if (num >= 0 && num < MAX_SAFE_INTEGER) { return num } } return id }) } this.build = m[5] ? m[5].split('.') : [] this.format() } format () { this.version = `${this.major}.${this.minor}.${this.patch}` if (this.prerelease.length) { this.version += `-${this.prerelease.join('.')}` } return this.version } toString () { return this.version } compare (other) { debug('SemVer.compare', this.version, this.options, other) if (!(other instanceof SemVer)) { if (typeof other === 'string' && other === this.version) { return 0 } other = new SemVer(other, this.options) } if (other.version === this.version) { return 0 } return this.compareMain(other) || this.comparePre(other) } compareMain (other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } return ( compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch) ) } comparePre (other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } // NOT having a prerelease is > having one if (this.prerelease.length && !other.prerelease.length) { return -1 } else if (!this.prerelease.length && other.prerelease.length) { return 1 } else if (!this.prerelease.length && !other.prerelease.length) { return 0 } let i = 0 do { const a = this.prerelease[i] const b = other.prerelease[i] debug('prerelease compare', i, a, b) if (a === undefined && b === undefined) { return 0 } else if (b === undefined) { return 1 } else if (a === undefined) { return -1 } else if (a === b) { continue } else { return compareIdentifiers(a, b) } } while (++i) } compareBuild (other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } let i = 0 do { const a = this.build[i] const b = other.build[i] debug('prerelease compare', i, a, b) if (a === undefined && b === undefined) { return 0 } else if (b === undefined) { return 1 } else if (a === undefined) { return -1 } else if (a === b) { continue } else { return compareIdentifiers(a, b) } } while (++i) } // preminor will bump the version up to the next minor release, and immediately // down to pre-release. premajor and prepatch work the same way. inc (release, identifier) { switch (release) { case 'premajor': this.prerelease.length = 0 this.patch = 0 this.minor = 0 this.major++ this.inc('pre', identifier) break case 'preminor': this.prerelease.length = 0 this.patch = 0 this.minor++ this.inc('pre', identifier) break case 'prepatch': // If this is already a prerelease, it will bump to the next version // drop any prereleases that might already exist, since they are not // relevant at this point. this.prerelease.length = 0 this.inc('patch', identifier) this.inc('pre', identifier) break // If the input is a non-prerelease version, this acts the same as // prepatch. case 'prerelease': if (this.prerelease.length === 0) { this.inc('patch', identifier) } this.inc('pre', identifier) break case 'major': // If this is a pre-major version, bump up to the same major version. // Otherwise increment major. // 1.0.0-5 bumps to 1.0.0 // 1.1.0 bumps to 2.0.0 if ( this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0 ) { this.major++ } this.minor = 0 this.patch = 0 this.prerelease = [] break case 'minor': // If this is a pre-minor version, bump up to the same minor version. // Otherwise increment minor. // 1.2.0-5 bumps to 1.2.0 // 1.2.1 bumps to 1.3.0 if (this.patch !== 0 || this.prerelease.length === 0) { this.minor++ } this.patch = 0 this.prerelease = [] break case 'patch': // If this is not a pre-release version, it will increment the patch. // If it is a pre-release it will bump up to the same patch version. // 1.2.0-5 patches to 1.2.0 // 1.2.0 patches to 1.2.1 if (this.prerelease.length === 0) { this.patch++ } this.prerelease = [] break // This probably shouldn't be used publicly. // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. case 'pre': if (this.prerelease.length === 0) { this.prerelease = [0] } else { let i = this.prerelease.length while (--i >= 0) { if (typeof this.prerelease[i] === 'number') { this.prerelease[i]++ i = -2 } } if (i === -1) { // didn't increment anything this.prerelease.push(0) } } if (identifier) { // 1.2.0-beta.1 bumps to 1.2.0-beta.2, // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 if (this.prerelease[0] === identifier) { if (isNaN(this.prerelease[1])) { this.prerelease = [identifier, 0] } } else { this.prerelease = [identifier, 0] } } break default: throw new Error(`invalid increment argument: ${release}`) } this.format() this.raw = this.version return this } } module.exports = SemVer const parse = require('./parse') const clean = (version, options) => { const s = parse(version.trim().replace(/^[=v]+/, ''), options) return s ? s.version : null } module.exports = clean const eq = require('./eq') const neq = require('./neq') const gt = require('./gt') const gte = require('./gte') const lt = require('./lt') const lte = require('./lte') const cmp = (a, op, b, loose) => { switch (op) { case '===': if (typeof a === 'object') a = a.version if (typeof b === 'object') b = b.version return a === b case '!==': if (typeof a === 'object') a = a.version if (typeof b === 'object') b = b.version return a !== b case '': case '=': case '==': return eq(a, b, loose) case '!=': return neq(a, b, loose) case '>': return gt(a, b, loose) case '>=': return gte(a, b, loose) case '<': return lt(a, b, loose) case '<=': return lte(a, b, loose) default: throw new TypeError(`Invalid operator: ${op}`) } } module.exports = cmp const SemVer = require('../classes/semver') const parse = require('./parse') const {re, t} = require('../internal/re') const coerce = (version, options) => { if (version instanceof SemVer) { return version } if (typeof version === 'number') { version = String(version) } if (typeof version !== 'string') { return null } options = options || {} let match = null if (!options.rtl) { match = version.match(re[t.COERCE]) } else { // Find the right-most coercible string that does not share // a terminus with a more left-ward coercible string. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' // // Walk through the string checking with a /g regexp // Manually set the index so as to pick up overlapping matches. // Stop when we get a match that ends at the string end, since no // coercible string can be more right-ward without the same terminus. let next while ((next = re[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length) ) { if (!match || next.index + next[0].length !== match.index + match[0].length) { match = next } re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length } // leave it in a clean state re[t.COERCERTL].lastIndex = -1 } if (match === null) return null return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options) } module.exports = coerce const SemVer = require('../classes/semver') const compareBuild = (a, b, loose) => { const versionA = new SemVer(a, loose) const versionB = new SemVer(b, loose) return versionA.compare(versionB) || versionA.compareBuild(versionB) } module.exports = compareBuild const compare = require('./compare') const compareLoose = (a, b) => compare(a, b, true) module.exports = compareLoose const SemVer = require('../classes/semver') const compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose)) module.exports = compare const parse = require('./parse') const eq = require('./eq') const diff = (version1, version2) => { if (eq(version1, version2)) { return null } else { const v1 = parse(version1) const v2 = parse(version2) const hasPre = v1.prerelease.length || v2.prerelease.length const prefix = hasPre ? 'pre' : '' const defaultResult = hasPre ? 'prerelease' : '' for (const key in v1) { if (key === 'major' || key === 'minor' || key === 'patch') { if (v1[key] !== v2[key]) { return prefix + key } } } return defaultResult // may be undefined } } module.exports = diff const compare = require('./compare') const eq = (a, b, loose) => compare(a, b, loose) === 0 module.exports = eq const compare = require('./compare') const gt = (a, b, loose) => compare(a, b, loose) > 0 module.exports = gt const compare = require('./compare') const gte = (a, b, loose) => compare(a, b, loose) >= 0 module.exports = gte const SemVer = require('../classes/semver') const inc = (version, release, options, identifier) => { if (typeof (options) === 'string') { identifier = options options = undefined } try { return new SemVer(version, options).inc(release, identifier).version } catch (er) { return null } } module.exports = inc const compare = require('./compare') const lt = (a, b, loose) => compare(a, b, loose) < 0 module.exports = lt const compare = require('./compare') const lte = (a, b, loose) => compare(a, b, loose) <= 0 module.exports = lte const SemVer = require('../classes/semver') const major = (a, loose) => new SemVer(a, loose).major module.exports = major const SemVer = require('../classes/semver') const minor = (a, loose) => new SemVer(a, loose).minor module.exports = minor const compare = require('./compare') const neq = (a, b, loose) => compare(a, b, loose) !== 0 module.exports = neq const {MAX_LENGTH} = require('../internal/constants') const { re, t } = require('../internal/re') const SemVer = require('../classes/semver') const parseOptions = require('../internal/parse-options') const parse = (version, options) => { options = parseOptions(options) if (version instanceof SemVer) { return version } if (typeof version !== 'string') { return null } if (version.length > MAX_LENGTH) { return null } const r = options.loose ? re[t.LOOSE] : re[t.FULL] if (!r.test(version)) { return null } try { return new SemVer(version, options) } catch (er) { return null } } module.exports = parse const SemVer = require('../classes/semver') const patch = (a, loose) => new SemVer(a, loose).patch module.exports = patch const parse = require('./parse') const prerelease = (version, options) => { const parsed = parse(version, options) return (parsed && parsed.prerelease.length) ? parsed.prerelease : null } module.exports = prerelease const compare = require('./compare') const rcompare = (a, b, loose) => compare(b, a, loose) module.exports = rcompare const compareBuild = require('./compare-build') const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)) module.exports = rsort const Range = require('../classes/range') const satisfies = (version, range, options) => { try { range = new Range(range, options) } catch (er) { return false } return range.test(version) } module.exports = satisfies const compareBuild = require('./compare-build') const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)) module.exports = sort const parse = require('./parse') const valid = (version, options) => { const v = parse(version, options) return v ? v.version : null } module.exports = valid // Note: this is the semver.org version of the spec that it implements // Not necessarily the package version of this code. const SEMVER_SPEC_VERSION = '2.0.0' const MAX_LENGTH = 256 const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ 9007199254740991 // Max safe segment length for coercion. const MAX_SAFE_COMPONENT_LENGTH = 16 module.exports = { SEMVER_SPEC_VERSION, MAX_LENGTH, MAX_SAFE_INTEGER, MAX_SAFE_COMPONENT_LENGTH } const debug = ( typeof process === 'object' && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ) ? (...args) => console.error('SEMVER', ...args) : () => {} module.exports = debug const numeric = /^[0-9]+$/ const compareIdentifiers = (a, b) => { const anum = numeric.test(a) const bnum = numeric.test(b) if (anum && bnum) { a = +a b = +b } return a === b ? 0 : (anum && !bnum) ? -1 : (bnum && !anum) ? 1 : a < b ? -1 : 1 } const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a) module.exports = { compareIdentifiers, rcompareIdentifiers } // parse out just the options we care about so we always get a consistent // obj with keys in a consistent order. const opts = ['includePrerelease', 'loose', 'rtl'] const parseOptions = options => !options ? {} : typeof options !== 'object' ? { loose: true } : opts.filter(k => options[k]).reduce((options, k) => { options[k] = true return options }, {}) module.exports = parseOptions const { MAX_SAFE_COMPONENT_LENGTH } = require('./constants') const debug = require('./debug') exports = module.exports = {} // The actual regexps go on exports.re const re = exports.re = [] const src = exports.src = [] const t = exports.t = {} let R = 0 const createToken = (name, value, isGlobal) => { const index = R++ debug(index, value) t[name] = index src[index] = value re[index] = new RegExp(value, isGlobal ? 'g' : undefined) } // The following Regular Expressions can be used for tokenizing, // validating, and parsing SemVer version strings. // ## Numeric Identifier // A single `0`, or a non-zero digit followed by zero or more digits. createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*') createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+') // ## Non-numeric Identifier // Zero or more digits, followed by a letter or hyphen, and then zero or // more letters, digits, or hyphens. createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*') // ## Main Version // Three dot-separated numeric identifiers. createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` + `(${src[t.NUMERICIDENTIFIER]})\\.` + `(${src[t.NUMERICIDENTIFIER]})`) createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + `(${src[t.NUMERICIDENTIFIERLOOSE]})`) // ## Pre-release Version Identifier // A numeric identifier, or a non-numeric identifier. createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER] }|${src[t.NONNUMERICIDENTIFIER]})`) createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE] }|${src[t.NONNUMERICIDENTIFIER]})`) // ## Pre-release Version // Hyphen, followed by one or more dot-separated pre-release version // identifiers. createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER] }(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`) createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE] }(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`) // ## Build Metadata Identifier // Any combination of digits, letters, or hyphens. createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+') // ## Build Metadata // Plus sign, followed by one or more period-separated build metadata // identifiers. createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER] }(?:\\.${src[t.BUILDIDENTIFIER]})*))`) // ## Full Version String // A main version, followed optionally by a pre-release version and // build metadata. // Note that the only major, minor, patch, and pre-release sections of // the version string are capturing groups. The build metadata is not a // capturing group, because it should not ever be used in version // comparison. createToken('FULLPLAIN', `v?${src[t.MAINVERSION] }${src[t.PRERELEASE]}?${ src[t.BUILD]}?`) createToken('FULL', `^${src[t.FULLPLAIN]}$`) // like full, but allows v1.2.3 and =1.2.3, which people do sometimes. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty // common in the npm registry. createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE] }${src[t.PRERELEASELOOSE]}?${ src[t.BUILD]}?`) createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`) createToken('GTLT', '((?:<|>)?=?)') // Something like "2.*" or "1.2.x". // Note that "x.x" is a valid xRange identifer, meaning "any version" // Only the first item is strictly required. createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`) createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`) createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + `(?:${src[t.PRERELEASE]})?${ src[t.BUILD]}?` + `)?)?`) createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:${src[t.PRERELEASELOOSE]})?${ src[t.BUILD]}?` + `)?)?`) createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`) createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`) // Coercion. // Extract anything that could conceivably be a part of a valid semver createToken('COERCE', `${'(^|[^\\d])' + '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + `(?:$|[^\\d])`) createToken('COERCERTL', src[t.COERCE], true) // Tilde ranges. // Meaning is "reasonably at or greater than" createToken('LONETILDE', '(?:~>?)') createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true) exports.tildeTrimReplace = '$1~' createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`) createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`) // Caret ranges. // Meaning is "at least and backwards compatible with" createToken('LONECARET', '(?:\\^)') createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true) exports.caretTrimReplace = '$1^' createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`) createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`) // A simple gt/lt/eq thing, or just "" to indicate "any version" createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`) createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`) // An expression to strip any whitespace between the gtlt and the thing // it modifies, so that `> 1.2.3` ==> `>1.2.3` createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT] }\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true) exports.comparatorTrimReplace = '$1$2$3' // Something like `1.2.3 - 1.2.4` // Note that these all use the loose form, because they'll be // checked against either the strict or loose comparator form // later. createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` + `\\s+-\\s+` + `(${src[t.XRANGEPLAIN]})` + `\\s*$`) createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + `\\s+-\\s+` + `(${src[t.XRANGEPLAINLOOSE]})` + `\\s*$`) // Star ranges basically just allow anything at all. createToken('STAR', '(<|>)?=?\\s*\\*') // >=0.0.0 is like a star createToken('GTE0', '^\\s*>=\\s*0\.0\.0\\s*$') createToken('GTE0PRE', '^\\s*>=\\s*0\.0\.0-0\\s*$') // Determine if version is greater than all the versions possible in the range. const outside = require('./outside') const gtr = (version, range, options) => outside(version, range, '>', options) module.exports = gtr const Range = require('../classes/range') const intersects = (r1, r2, options) => { r1 = new Range(r1, options) r2 = new Range(r2, options) return r1.intersects(r2) } module.exports = intersects const outside = require('./outside') // Determine if version is less than all the versions possible in the range const ltr = (version, range, options) => outside(version, range, '<', options) module.exports = ltr const SemVer = require('../classes/semver') const Range = require('../classes/range') const maxSatisfying = (versions, range, options) => { let max = null let maxSV = null let rangeObj = null try { rangeObj = new Range(range, options) } catch (er) { return null } versions.forEach((v) => { if (rangeObj.test(v)) { // satisfies(v, range, options) if (!max || maxSV.compare(v) === -1) { // compare(max, v, true) max = v maxSV = new SemVer(max, options) } } }) return max } module.exports = maxSatisfying const SemVer = require('../classes/semver') const Range = require('../classes/range') const minSatisfying = (versions, range, options) => { let min = null let minSV = null let rangeObj = null try { rangeObj = new Range(range, options) } catch (er) { return null } versions.forEach((v) => { if (rangeObj.test(v)) { // satisfies(v, range, options) if (!min || minSV.compare(v) === 1) { // compare(min, v, true) min = v minSV = new SemVer(min, options) } } }) return min } module.exports = minSatisfying const SemVer = require('../classes/semver') const Range = require('../classes/range') const gt = require('../functions/gt') const minVersion = (range, loose) => { range = new Range(range, loose) let minver = new SemVer('0.0.0') if (range.test(minver)) { return minver } minver = new SemVer('0.0.0-0') if (range.test(minver)) { return minver } minver = null for (let i = 0; i < range.set.length; ++i) { const comparators = range.set[i] let setMin = null comparators.forEach((comparator) => { // Clone to avoid manipulating the comparator's semver object. const compver = new SemVer(comparator.semver.version) switch (comparator.operator) { case '>': if (compver.prerelease.length === 0) { compver.patch++ } else { compver.prerelease.push(0) } compver.raw = compver.format() /* fallthrough */ case '': case '>=': if (!setMin || gt(compver, setMin)) { setMin = compver } break case '<': case '<=': /* Ignore maximum versions */ break /* istanbul ignore next */ default: throw new Error(`Unexpected operation: ${comparator.operator}`) } }) if (setMin && (!minver || gt(minver, setMin))) minver = setMin } if (minver && range.test(minver)) { return minver } return null } module.exports = minVersion const SemVer = require('../classes/semver') const Comparator = require('../classes/comparator') const {ANY} = Comparator const Range = require('../classes/range') const satisfies = require('../functions/satisfies') const gt = require('../functions/gt') const lt = require('../functions/lt') const lte = require('../functions/lte') const gte = require('../functions/gte') const outside = (version, range, hilo, options) => { version = new SemVer(version, options) range = new Range(range, options) let gtfn, ltefn, ltfn, comp, ecomp switch (hilo) { case '>': gtfn = gt ltefn = lte ltfn = lt comp = '>' ecomp = '>=' break case '<': gtfn = lt ltefn = gte ltfn = gt comp = '<' ecomp = '<=' break default: throw new TypeError('Must provide a hilo val of "<" or ">"') } // If it satisfies the range it is not outside if (satisfies(version, range, options)) { return false } // From now on, variable terms are as if we're in "gtr" mode. // but note that everything is flipped for the "ltr" function. for (let i = 0; i < range.set.length; ++i) { const comparators = range.set[i] let high = null let low = null comparators.forEach((comparator) => { if (comparator.semver === ANY) { comparator = new Comparator('>=0.0.0') } high = high || comparator low = low || comparator if (gtfn(comparator.semver, high.semver, options)) { high = comparator } else if (ltfn(comparator.semver, low.semver, options)) { low = comparator } }) // If the edge version comparator has a operator then our version // isn't outside it if (high.operator === comp || high.operator === ecomp) { return false } // If the lowest version comparator has an operator and our version // is less than it then it isn't higher than the range if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { return false } else if (low.operator === ecomp && ltfn(version, low.semver)) { return false } } return true } module.exports = outside // given a set of versions and a range, create a "simplified" range // that includes the same versions that the original range does // If the original range is shorter than the simplified one, return that. const satisfies = require('../functions/satisfies.js') const compare = require('../functions/compare.js') module.exports = (versions, range, options) => { const set = [] let min = null let prev = null const v = versions.sort((a, b) => compare(a, b, options)) for (const version of v) { const included = satisfies(version, range, options) if (included) { prev = version if (!min) min = version } else { if (prev) { set.push([min, prev]) } prev = null min = null } } if (min) set.push([min, null]) const ranges = [] for (const [min, max] of set) { if (min === max) ranges.push(min) else if (!max && min === v[0]) ranges.push('*') else if (!max) ranges.push(`>=${min}`) else if (min === v[0]) ranges.push(`<=${max}`) else ranges.push(`${min} - ${max}`) } const simplified = ranges.join(' || ') const original = typeof range.raw === 'string' ? range.raw : String(range) return simplified.length < original.length ? simplified : range } const Range = require('../classes/range.js') const Comparator = require('../classes/comparator.js') const { ANY } = Comparator const satisfies = require('../functions/satisfies.js') const compare = require('../functions/compare.js') // Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff: // - Every simple range `r1, r2, ...` is a null set, OR // - Every simple range `r1, r2, ...` which is not a null set is a subset of // some `R1, R2, ...` // // Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff: // - If c is only the ANY comparator // - If C is only the ANY comparator, return true // - Else if in prerelease mode, return false // - else replace c with `[>=0.0.0]` // - If C is only the ANY comparator // - if in prerelease mode, return true // - else replace C with `[>=0.0.0]` // - Let EQ be the set of = comparators in c // - If EQ is more than one, return true (null set) // - Let GT be the highest > or >= comparator in c // - Let LT be the lowest < or <= comparator in c // - If GT and LT, and GT.semver > LT.semver, return true (null set) // - If any C is a = range, and GT or LT are set, return false // - If EQ // - If GT, and EQ does not satisfy GT, return true (null set) // - If LT, and EQ does not satisfy LT, return true (null set) // - If EQ satisfies every C, return true // - Else return false // - If GT // - If GT.semver is lower than any > or >= comp in C, return false // - If GT is >=, and GT.semver does not satisfy every C, return false // - If GT.semver has a prerelease, and not in prerelease mode // - If no C has a prerelease and the GT.semver tuple, return false // - If LT // - If LT.semver is greater than any < or <= comp in C, return false // - If LT is <=, and LT.semver does not satisfy every C, return false // - If GT.semver has a prerelease, and not in prerelease mode // - If no C has a prerelease and the LT.semver tuple, return false // - Else return true const subset = (sub, dom, options = {}) => { if (sub === dom) return true sub = new Range(sub, options) dom = new Range(dom, options) let sawNonNull = false OUTER: for (const simpleSub of sub.set) { for (const simpleDom of dom.set) { const isSub = simpleSubset(simpleSub, simpleDom, options) sawNonNull = sawNonNull || isSub !== null if (isSub) continue OUTER } // the null set is a subset of everything, but null simple ranges in // a complex range should be ignored. so if we saw a non-null range, // then we know this isn't a subset, but if EVERY simple range was null, // then it is a subset. if (sawNonNull) return false } return true } const simpleSubset = (sub, dom, options) => { if (sub === dom) return true if (sub.length === 1 && sub[0].semver === ANY) { if (dom.length === 1 && dom[0].semver === ANY) return true else if (options.includePrerelease) sub = [ new Comparator('>=0.0.0-0') ] else sub = [ new Comparator('>=0.0.0') ] } if (dom.length === 1 && dom[0].semver === ANY) { if (options.includePrerelease) return true else dom = [ new Comparator('>=0.0.0') ] } const eqSet = new Set() let gt, lt for (const c of sub) { if (c.operator === '>' || c.operator === '>=') gt = higherGT(gt, c, options) else if (c.operator === '<' || c.operator === '<=') lt = lowerLT(lt, c, options) else eqSet.add(c.semver) } if (eqSet.size > 1) return null let gtltComp if (gt && lt) { gtltComp = compare(gt.semver, lt.semver, options) if (gtltComp > 0) return null else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) return null } // will iterate one or zero times for (const eq of eqSet) { if (gt && !satisfies(eq, String(gt), options)) return null if (lt && !satisfies(eq, String(lt), options)) return null for (const c of dom) { if (!satisfies(eq, String(c), options)) return false } return true } let higher, lower let hasDomLT, hasDomGT // if the subset has a prerelease, we need a comparator in the superset // with the same tuple and a prerelease, or it's not a subset let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false // exception: <1.2.3-0 is the same as <1.2.3 if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === '<' && needDomLTPre.prerelease[0] === 0) { needDomLTPre = false } for (const c of dom) { hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=' hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=' if (gt) { if (needDomGTPre) { if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) { needDomGTPre = false } } if (c.operator === '>' || c.operator === '>=') { higher = higherGT(gt, c, options) if (higher === c && higher !== gt) return false } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) return false } if (lt) { if (needDomLTPre) { if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) { needDomLTPre = false } } if (c.operator === '<' || c.operator === '<=') { lower = lowerLT(lt, c, options) if (lower === c && lower !== lt) return false } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) return false } if (!c.operator && (lt || gt) && gtltComp !== 0) return false } // if there was a < or >, and nothing in the dom, then must be false // UNLESS it was limited by another range in the other direction. // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 if (gt && hasDomLT && !lt && gtltComp !== 0) return false if (lt && hasDomGT && !gt && gtltComp !== 0) return false // we needed a prerelease range in a specific tuple, but didn't get one // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0, // because it includes prereleases in the 1.2.3 tuple if (needDomGTPre || needDomLTPre) return false return true } // >=1.2.3 is lower than >1.2.3 const higherGT = (a, b, options) => { if (!a) return b const comp = compare(a.semver, b.semver, options) return comp > 0 ? a : comp < 0 ? b : b.operator === '>' && a.operator === '>=' ? b : a } // <=1.2.3 is higher than <1.2.3 const lowerLT = (a, b, options) => { if (!a) return b const comp = compare(a.semver, b.semver, options) return comp < 0 ? a : comp > 0 ? b : b.operator === '<' && a.operator === '<=' ? b : a } module.exports = subset const Range = require('../classes/range') // Mostly just for testing and legacy API reasons const toComparators = (range, options) => new Range(range, options).set .map(comp => comp.map(c => c.value).join(' ').trim().split(' ')) module.exports = toComparators const Range = require('../classes/range') const validRange = (range, options) => { try { // Return '*' instead of '' so that truthiness works. // This will throw if it's invalid anyway return new Range(range, options).range || '*' } catch (er) { return null } } module.exports = validRange # Copyright (c) 2014 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ This script is intended for use as a GYP_GENERATOR. It takes as input (by way of the generator flag config_path) the path of a json file that dictates the files and targets to search for. The following keys are supported: files: list of paths (relative) of the files to search for. test_targets: unqualified target names to search for. Any target in this list that depends upon a file in |files| is output regardless of the type of target or chain of dependencies. additional_compile_targets: Unqualified targets to search for in addition to test_targets. Targets in the combined list that depend upon a file in |files| are not necessarily output. For example, if the target is of type none then the target is not output (but one of the descendants of the target will be). The following is output: error: only supplied if there is an error. compile_targets: minimal set of targets that directly or indirectly (for targets of type none) depend on the files in |files| and is one of the supplied targets or a target that one of the supplied targets depends on. The expectation is this set of targets is passed into a build step. This list always contains the output of test_targets as well. test_targets: set of targets from the supplied |test_targets| that either directly or indirectly depend upon a file in |files|. This list if useful if additional processing needs to be done for certain targets after the build, such as running tests. status: outputs one of three values: none of the supplied files were found, one of the include files changed so that it should be assumed everything changed (in this case test_targets and compile_targets are not output) or at least one file was found. invalid_targets: list of supplied targets that were not found. Example: Consider a graph like the following: A D / \ B C A depends upon both B and C, A is of type none and B and C are executables. D is an executable, has no dependencies and nothing depends on it. If |additional_compile_targets| = ["A"], |test_targets| = ["B", "C"] and files = ["b.cc", "d.cc"] (B depends upon b.cc and D depends upon d.cc), then the following is output: |compile_targets| = ["B"] B must built as it depends upon the changed file b.cc and the supplied target A depends upon it. A is not output as a build_target as it is of type none with no rules and actions. |test_targets| = ["B"] B directly depends upon the change file b.cc. Even though the file d.cc, which D depends upon, has changed D is not output as it was not supplied by way of |additional_compile_targets| or |test_targets|. If the generator flag analyzer_output_path is specified, output is written there. Otherwise output is written to stdout. In Gyp the "all" target is shorthand for the root targets in the files passed to gyp. For example, if file "a.gyp" contains targets "a1" and "a2", and file "b.gyp" contains targets "b1" and "b2" and "a2" has a dependency on "b2" and gyp is supplied "a.gyp" then "all" consists of "a1" and "a2". Notice that "b1" and "b2" are not in the "all" target as "b.gyp" was not directly supplied to gyp. OTOH if both "a.gyp" and "b.gyp" are supplied to gyp then the "all" target includes "b1" and "b2". """ import gyp.common import json import os import posixpath debug = False found_dependency_string = "Found dependency" no_dependency_string = "No dependencies" # Status when it should be assumed that everything has changed. all_changed_string = "Found dependency (all)" # MatchStatus is used indicate if and how a target depends upon the supplied # sources. # The target's sources contain one of the supplied paths. MATCH_STATUS_MATCHES = 1 # The target has a dependency on another target that contains one of the # supplied paths. MATCH_STATUS_MATCHES_BY_DEPENDENCY = 2 # The target's sources weren't in the supplied paths and none of the target's # dependencies depend upon a target that matched. MATCH_STATUS_DOESNT_MATCH = 3 # The target doesn't contain the source, but the dependent targets have not yet # been visited to determine a more specific status yet. MATCH_STATUS_TBD = 4 generator_supports_multiple_toolsets = gyp.common.CrossCompileRequested() generator_wants_static_library_dependencies_adjusted = False generator_default_variables = {} for dirname in [ "INTERMEDIATE_DIR", "SHARED_INTERMEDIATE_DIR", "PRODUCT_DIR", "LIB_DIR", "SHARED_LIB_DIR", ]: generator_default_variables[dirname] = "!!!" for unused in [ "RULE_INPUT_PATH", "RULE_INPUT_ROOT", "RULE_INPUT_NAME", "RULE_INPUT_DIRNAME", "RULE_INPUT_EXT", "EXECUTABLE_PREFIX", "EXECUTABLE_SUFFIX", "STATIC_LIB_PREFIX", "STATIC_LIB_SUFFIX", "SHARED_LIB_PREFIX", "SHARED_LIB_SUFFIX", "CONFIGURATION_NAME", ]: generator_default_variables[unused] = "" def _ToGypPath(path): """Converts a path to the format used by gyp.""" if os.sep == "\\" and os.altsep == "/": return path.replace("\\", "/") return path def _ResolveParent(path, base_path_components): """Resolves |path|, which starts with at least one '../'. Returns an empty string if the path shouldn't be considered. See _AddSources() for a description of |base_path_components|.""" depth = 0 while path.startswith("../"): depth += 1 path = path[3:] # Relative includes may go outside the source tree. For example, an action may # have inputs in /usr/include, which are not in the source tree. if depth > len(base_path_components): return "" if depth == len(base_path_components): return path return ( "/".join(base_path_components[0 : len(base_path_components) - depth]) + "/" + path ) def _AddSources(sources, base_path, base_path_components, result): """Extracts valid sources from |sources| and adds them to |result|. Each source file is relative to |base_path|, but may contain '..'. To make resolving '..' easier |base_path_components| contains each of the directories in |base_path|. Additionally each source may contain variables. Such sources are ignored as it is assumed dependencies on them are expressed and tracked in some other means.""" # NOTE: gyp paths are always posix style. for source in sources: if not len(source) or source.startswith("!!!") or source.startswith("$"): continue # variable expansion may lead to //. org_source = source source = source[0] + source[1:].replace("//", "/") if source.startswith("../"): source = _ResolveParent(source, base_path_components) if len(source): result.append(source) continue result.append(base_path + source) if debug: print("AddSource", org_source, result[len(result) - 1]) def _ExtractSourcesFromAction(action, base_path, base_path_components, results): if "inputs" in action: _AddSources(action["inputs"], base_path, base_path_components, results) def _ToLocalPath(toplevel_dir, path): """Converts |path| to a path relative to |toplevel_dir|.""" if path == toplevel_dir: return "" if path.startswith(toplevel_dir + "/"): return path[len(toplevel_dir) + len("/") :] return path def _ExtractSources(target, target_dict, toplevel_dir): # |target| is either absolute or relative and in the format of the OS. Gyp # source paths are always posix. Convert |target| to a posix path relative to # |toplevel_dir_|. This is done to make it easy to build source paths. base_path = posixpath.dirname(_ToLocalPath(toplevel_dir, _ToGypPath(target))) base_path_components = base_path.split("/") # Add a trailing '/' so that _AddSources() can easily build paths. if len(base_path): base_path += "/" if debug: print("ExtractSources", target, base_path) results = [] if "sources" in target_dict: _AddSources(target_dict["sources"], base_path, base_path_components, results) # Include the inputs from any actions. Any changes to these affect the # resulting output. if "actions" in target_dict: for action in target_dict["actions"]: _ExtractSourcesFromAction(action, base_path, base_path_components, results) if "rules" in target_dict: for rule in target_dict["rules"]: _ExtractSourcesFromAction(rule, base_path, base_path_components, results) return results class Target: """Holds information about a particular target: deps: set of Targets this Target depends upon. This is not recursive, only the direct dependent Targets. match_status: one of the MatchStatus values. back_deps: set of Targets that have a dependency on this Target. visited: used during iteration to indicate whether we've visited this target. This is used for two iterations, once in building the set of Targets and again in _GetBuildTargets(). name: fully qualified name of the target. requires_build: True if the target type is such that it needs to be built. See _DoesTargetTypeRequireBuild for details. added_to_compile_targets: used when determining if the target was added to the set of targets that needs to be built. in_roots: true if this target is a descendant of one of the root nodes. is_executable: true if the type of target is executable. is_static_library: true if the type of target is static_library. is_or_has_linked_ancestor: true if the target does a link (eg executable), or if there is a target in back_deps that does a link.""" def __init__(self, name): self.deps = set() self.match_status = MATCH_STATUS_TBD self.back_deps = set() self.name = name # TODO(sky): I don't like hanging this off Target. This state is specific # to certain functions and should be isolated there. self.visited = False self.requires_build = False self.added_to_compile_targets = False self.in_roots = False self.is_executable = False self.is_static_library = False self.is_or_has_linked_ancestor = False class Config: """Details what we're looking for files: set of files to search for targets: see file description for details.""" def __init__(self): self.files = [] self.targets = set() self.additional_compile_target_names = set() self.test_target_names = set() def Init(self, params): """Initializes Config. This is a separate method as it raises an exception if there is a parse error.""" generator_flags = params.get("generator_flags", {}) config_path = generator_flags.get("config_path", None) if not config_path: return try: f = open(config_path) config = json.load(f) f.close() except OSError: raise Exception("Unable to open file " + config_path) except ValueError as e: raise Exception("Unable to parse config file " + config_path + str(e)) if not isinstance(config, dict): raise Exception("config_path must be a JSON file containing a dictionary") self.files = config.get("files", []) self.additional_compile_target_names = set( config.get("additional_compile_targets", []) ) self.test_target_names = set(config.get("test_targets", [])) def _WasBuildFileModified(build_file, data, files, toplevel_dir): """Returns true if the build file |build_file| is either in |files| or one of the files included by |build_file| is in |files|. |toplevel_dir| is the root of the source tree.""" if _ToLocalPath(toplevel_dir, _ToGypPath(build_file)) in files: if debug: print("gyp file modified", build_file) return True # First element of included_files is the file itself. if len(data[build_file]["included_files"]) <= 1: return False for include_file in data[build_file]["included_files"][1:]: # |included_files| are relative to the directory of the |build_file|. rel_include_file = _ToGypPath( gyp.common.UnrelativePath(include_file, build_file) ) if _ToLocalPath(toplevel_dir, rel_include_file) in files: if debug: print( "included gyp file modified, gyp_file=", build_file, "included file=", rel_include_file, ) return True return False def _GetOrCreateTargetByName(targets, target_name): """Creates or returns the Target at targets[target_name]. If there is no Target for |target_name| one is created. Returns a tuple of whether a new Target was created and the Target.""" if target_name in targets: return False, targets[target_name] target = Target(target_name) targets[target_name] = target return True, target def _DoesTargetTypeRequireBuild(target_dict): """Returns true if the target type is such that it needs to be built.""" # If a 'none' target has rules or actions we assume it requires a build. return bool( target_dict["type"] != "none" or target_dict.get("actions") or target_dict.get("rules") ) def _GenerateTargets(data, target_list, target_dicts, toplevel_dir, files, build_files): """Returns a tuple of the following: . A dictionary mapping from fully qualified name to Target. . A list of the targets that have a source file in |files|. . Targets that constitute the 'all' target. See description at top of file for details on the 'all' target. This sets the |match_status| of the targets that contain any of the source files in |files| to MATCH_STATUS_MATCHES. |toplevel_dir| is the root of the source tree.""" # Maps from target name to Target. name_to_target = {} # Targets that matched. matching_targets = [] # Queue of targets to visit. targets_to_visit = target_list[:] # Maps from build file to a boolean indicating whether the build file is in # |files|. build_file_in_files = {} # Root targets across all files. roots = set() # Set of Targets in |build_files|. build_file_targets = set() while len(targets_to_visit) > 0: target_name = targets_to_visit.pop() created_target, target = _GetOrCreateTargetByName(name_to_target, target_name) if created_target: roots.add(target) elif target.visited: continue target.visited = True target.requires_build = _DoesTargetTypeRequireBuild(target_dicts[target_name]) target_type = target_dicts[target_name]["type"] target.is_executable = target_type == "executable" target.is_static_library = target_type == "static_library" target.is_or_has_linked_ancestor = ( target_type == "executable" or target_type == "shared_library" ) build_file = gyp.common.ParseQualifiedTarget(target_name)[0] if build_file not in build_file_in_files: build_file_in_files[build_file] = _WasBuildFileModified( build_file, data, files, toplevel_dir ) if build_file in build_files: build_file_targets.add(target) # If a build file (or any of its included files) is modified we assume all # targets in the file are modified. if build_file_in_files[build_file]: print("matching target from modified build file", target_name) target.match_status = MATCH_STATUS_MATCHES matching_targets.append(target) else: sources = _ExtractSources( target_name, target_dicts[target_name], toplevel_dir ) for source in sources: if _ToGypPath(os.path.normpath(source)) in files: print("target", target_name, "matches", source) target.match_status = MATCH_STATUS_MATCHES matching_targets.append(target) break # Add dependencies to visit as well as updating back pointers for deps. for dep in target_dicts[target_name].get("dependencies", []): targets_to_visit.append(dep) created_dep_target, dep_target = _GetOrCreateTargetByName( name_to_target, dep ) if not created_dep_target: roots.discard(dep_target) target.deps.add(dep_target) dep_target.back_deps.add(target) return name_to_target, matching_targets, roots & build_file_targets def _GetUnqualifiedToTargetMapping(all_targets, to_find): """Returns a tuple of the following: . mapping (dictionary) from unqualified name to Target for all the Targets in |to_find|. . any target names not found. If this is empty all targets were found.""" result = {} if not to_find: return {}, [] to_find = set(to_find) for target_name in all_targets.keys(): extracted = gyp.common.ParseQualifiedTarget(target_name) if len(extracted) > 1 and extracted[1] in to_find: to_find.remove(extracted[1]) result[extracted[1]] = all_targets[target_name] if not to_find: return result, [] return result, [x for x in to_find] def _DoesTargetDependOnMatchingTargets(target): """Returns true if |target| or any of its dependencies is one of the targets containing the files supplied as input to analyzer. This updates |matches| of the Targets as it recurses. target: the Target to look for.""" if target.match_status == MATCH_STATUS_DOESNT_MATCH: return False if ( target.match_status == MATCH_STATUS_MATCHES or target.match_status == MATCH_STATUS_MATCHES_BY_DEPENDENCY ): return True for dep in target.deps: if _DoesTargetDependOnMatchingTargets(dep): target.match_status = MATCH_STATUS_MATCHES_BY_DEPENDENCY print("\t", target.name, "matches by dep", dep.name) return True target.match_status = MATCH_STATUS_DOESNT_MATCH return False def _GetTargetsDependingOnMatchingTargets(possible_targets): """Returns the list of Targets in |possible_targets| that depend (either directly on indirectly) on at least one of the targets containing the files supplied as input to analyzer. possible_targets: targets to search from.""" found = [] print("Targets that matched by dependency:") for target in possible_targets: if _DoesTargetDependOnMatchingTargets(target): found.append(target) return found def _AddCompileTargets(target, roots, add_if_no_ancestor, result): """Recurses through all targets that depend on |target|, adding all targets that need to be built (and are in |roots|) to |result|. roots: set of root targets. add_if_no_ancestor: If true and there are no ancestors of |target| then add |target| to |result|. |target| must still be in |roots|. result: targets that need to be built are added here.""" if target.visited: return target.visited = True target.in_roots = target in roots for back_dep_target in target.back_deps: _AddCompileTargets(back_dep_target, roots, False, result) target.added_to_compile_targets |= back_dep_target.added_to_compile_targets target.in_roots |= back_dep_target.in_roots target.is_or_has_linked_ancestor |= back_dep_target.is_or_has_linked_ancestor # Always add 'executable' targets. Even though they may be built by other # targets that depend upon them it makes detection of what is going to be # built easier. # And always add static_libraries that have no dependencies on them from # linkables. This is necessary as the other dependencies on them may be # static libraries themselves, which are not compile time dependencies. if target.in_roots and ( target.is_executable or ( not target.added_to_compile_targets and (add_if_no_ancestor or target.requires_build) ) or ( target.is_static_library and add_if_no_ancestor and not target.is_or_has_linked_ancestor ) ): print( "\t\tadding to compile targets", target.name, "executable", target.is_executable, "added_to_compile_targets", target.added_to_compile_targets, "add_if_no_ancestor", add_if_no_ancestor, "requires_build", target.requires_build, "is_static_library", target.is_static_library, "is_or_has_linked_ancestor", target.is_or_has_linked_ancestor, ) result.add(target) target.added_to_compile_targets = True def _GetCompileTargets(matching_targets, supplied_targets): """Returns the set of Targets that require a build. matching_targets: targets that changed and need to be built. supplied_targets: set of targets supplied to analyzer to search from.""" result = set() for target in matching_targets: print("finding compile targets for match", target.name) _AddCompileTargets(target, supplied_targets, True, result) return result def _WriteOutput(params, **values): """Writes the output, either to stdout or a file is specified.""" if "error" in values: print("Error:", values["error"]) if "status" in values: print(values["status"]) if "targets" in values: values["targets"].sort() print("Supplied targets that depend on changed files:") for target in values["targets"]: print("\t", target) if "invalid_targets" in values: values["invalid_targets"].sort() print("The following targets were not found:") for target in values["invalid_targets"]: print("\t", target) if "build_targets" in values: values["build_targets"].sort() print("Targets that require a build:") for target in values["build_targets"]: print("\t", target) if "compile_targets" in values: values["compile_targets"].sort() print("Targets that need to be built:") for target in values["compile_targets"]: print("\t", target) if "test_targets" in values: values["test_targets"].sort() print("Test targets:") for target in values["test_targets"]: print("\t", target) output_path = params.get("generator_flags", {}).get("analyzer_output_path", None) if not output_path: print(json.dumps(values)) return try: f = open(output_path, "w") f.write(json.dumps(values) + "\n") f.close() except OSError as e: print("Error writing to output file", output_path, str(e)) def _WasGypIncludeFileModified(params, files): """Returns true if one of the files in |files| is in the set of included files.""" if params["options"].includes: for include in params["options"].includes: if _ToGypPath(os.path.normpath(include)) in files: print("Include file modified, assuming all changed", include) return True return False def _NamesNotIn(names, mapping): """Returns a list of the values in |names| that are not in |mapping|.""" return [name for name in names if name not in mapping] def _LookupTargets(names, mapping): """Returns a list of the mapping[name] for each value in |names| that is in |mapping|.""" return [mapping[name] for name in names if name in mapping] def CalculateVariables(default_variables, params): """Calculate additional variables for use in the build (called by gyp).""" flavor = gyp.common.GetFlavor(params) if flavor == "mac": default_variables.setdefault("OS", "mac") elif flavor == "win": default_variables.setdefault("OS", "win") gyp.msvs_emulation.CalculateCommonVariables(default_variables, params) else: operating_system = flavor if flavor == "android": operating_system = "linux" # Keep this legacy behavior for now. default_variables.setdefault("OS", operating_system) class TargetCalculator: """Calculates the matching test_targets and matching compile_targets.""" def __init__( self, files, additional_compile_target_names, test_target_names, data, target_list, target_dicts, toplevel_dir, build_files, ): self._additional_compile_target_names = set(additional_compile_target_names) self._test_target_names = set(test_target_names) ( self._name_to_target, self._changed_targets, self._root_targets, ) = _GenerateTargets( data, target_list, target_dicts, toplevel_dir, frozenset(files), build_files ) ( self._unqualified_mapping, self.invalid_targets, ) = _GetUnqualifiedToTargetMapping( self._name_to_target, self._supplied_target_names_no_all() ) def _supplied_target_names(self): return self._additional_compile_target_names | self._test_target_names def _supplied_target_names_no_all(self): """Returns the supplied test targets without 'all'.""" result = self._supplied_target_names() result.discard("all") return result def is_build_impacted(self): """Returns true if the supplied files impact the build at all.""" return self._changed_targets def find_matching_test_target_names(self): """Returns the set of output test targets.""" assert self.is_build_impacted() # Find the test targets first. 'all' is special cased to mean all the # root targets. To deal with all the supplied |test_targets| are expanded # to include the root targets during lookup. If any of the root targets # match, we remove it and replace it with 'all'. test_target_names_no_all = set(self._test_target_names) test_target_names_no_all.discard("all") test_targets_no_all = _LookupTargets( test_target_names_no_all, self._unqualified_mapping ) test_target_names_contains_all = "all" in self._test_target_names if test_target_names_contains_all: test_targets = [ x for x in (set(test_targets_no_all) | set(self._root_targets)) ] else: test_targets = [x for x in test_targets_no_all] print("supplied test_targets") for target_name in self._test_target_names: print("\t", target_name) print("found test_targets") for target in test_targets: print("\t", target.name) print("searching for matching test targets") matching_test_targets = _GetTargetsDependingOnMatchingTargets(test_targets) matching_test_targets_contains_all = test_target_names_contains_all and set( matching_test_targets ) & set(self._root_targets) if matching_test_targets_contains_all: # Remove any of the targets for all that were not explicitly supplied, # 'all' is subsequentely added to the matching names below. matching_test_targets = [ x for x in (set(matching_test_targets) & set(test_targets_no_all)) ] print("matched test_targets") for target in matching_test_targets: print("\t", target.name) matching_target_names = [ gyp.common.ParseQualifiedTarget(target.name)[1] for target in matching_test_targets ] if matching_test_targets_contains_all: matching_target_names.append("all") print("\tall") return matching_target_names def find_matching_compile_target_names(self): """Returns the set of output compile targets.""" assert self.is_build_impacted() # Compile targets are found by searching up from changed targets. # Reset the visited status for _GetBuildTargets. for target in self._name_to_target.values(): target.visited = False supplied_targets = _LookupTargets( self._supplied_target_names_no_all(), self._unqualified_mapping ) if "all" in self._supplied_target_names(): supplied_targets = [ x for x in (set(supplied_targets) | set(self._root_targets)) ] print("Supplied test_targets & compile_targets") for target in supplied_targets: print("\t", target.name) print("Finding compile targets") compile_targets = _GetCompileTargets(self._changed_targets, supplied_targets) return [ gyp.common.ParseQualifiedTarget(target.name)[1] for target in compile_targets ] def GenerateOutput(target_list, target_dicts, data, params): """Called by gyp as the final stage. Outputs results.""" config = Config() try: config.Init(params) if not config.files: raise Exception( "Must specify files to analyze via config_path generator " "flag" ) toplevel_dir = _ToGypPath(os.path.abspath(params["options"].toplevel_dir)) if debug: print("toplevel_dir", toplevel_dir) if _WasGypIncludeFileModified(params, config.files): result_dict = { "status": all_changed_string, "test_targets": list(config.test_target_names), "compile_targets": list( config.additional_compile_target_names | config.test_target_names ), } _WriteOutput(params, **result_dict) return calculator = TargetCalculator( config.files, config.additional_compile_target_names, config.test_target_names, data, target_list, target_dicts, toplevel_dir, params["build_files"], ) if not calculator.is_build_impacted(): result_dict = { "status": no_dependency_string, "test_targets": [], "compile_targets": [], } if calculator.invalid_targets: result_dict["invalid_targets"] = calculator.invalid_targets _WriteOutput(params, **result_dict) return test_target_names = calculator.find_matching_test_target_names() compile_target_names = calculator.find_matching_compile_target_names() found_at_least_one_target = compile_target_names or test_target_names result_dict = { "test_targets": test_target_names, "status": found_dependency_string if found_at_least_one_target else no_dependency_string, "compile_targets": list(set(compile_target_names) | set(test_target_names)), } if calculator.invalid_targets: result_dict["invalid_targets"] = calculator.invalid_targets _WriteOutput(params, **result_dict) except Exception as e: _WriteOutput(params, error=str(e)) # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Notes: # # This generates makefiles suitable for inclusion into the Android build system # via an Android.mk file. It is based on make.py, the standard makefile # generator. # # The code below generates a separate .mk file for each target, but # all are sourced by the top-level GypAndroid.mk. This means that all # variables in .mk-files clobber one another, and furthermore that any # variables set potentially clash with other Android build system variables. # Try to avoid setting global variables where possible. import gyp import gyp.common import gyp.generator.make as make # Reuse global functions from make backend. import os import re import subprocess generator_default_variables = { "OS": "android", "EXECUTABLE_PREFIX": "", "EXECUTABLE_SUFFIX": "", "STATIC_LIB_PREFIX": "lib", "SHARED_LIB_PREFIX": "lib", "STATIC_LIB_SUFFIX": ".a", "SHARED_LIB_SUFFIX": ".so", "INTERMEDIATE_DIR": "$(gyp_intermediate_dir)", "SHARED_INTERMEDIATE_DIR": "$(gyp_shared_intermediate_dir)", "PRODUCT_DIR": "$(gyp_shared_intermediate_dir)", "SHARED_LIB_DIR": "$(builddir)/lib.$(TOOLSET)", "LIB_DIR": "$(obj).$(TOOLSET)", "RULE_INPUT_ROOT": "%(INPUT_ROOT)s", # This gets expanded by Python. "RULE_INPUT_DIRNAME": "%(INPUT_DIRNAME)s", # This gets expanded by Python. "RULE_INPUT_PATH": "$(RULE_SOURCES)", "RULE_INPUT_EXT": "$(suffix $<)", "RULE_INPUT_NAME": "$(notdir $<)", "CONFIGURATION_NAME": "$(GYP_CONFIGURATION)", } # Make supports multiple toolsets generator_supports_multiple_toolsets = True # Generator-specific gyp specs. generator_additional_non_configuration_keys = [ # Boolean to declare that this target does not want its name mangled. "android_unmangled_name", # Map of android build system variables to set. "aosp_build_settings", ] generator_additional_path_sections = [] generator_extra_sources_for_rules = [] ALL_MODULES_FOOTER = """\ # "gyp_all_modules" is a concatenation of the "gyp_all_modules" targets from # all the included sub-makefiles. This is just here to clarify. gyp_all_modules: """ header = """\ # This file is generated by gyp; do not edit. """ # Map gyp target types to Android module classes. MODULE_CLASSES = { "static_library": "STATIC_LIBRARIES", "shared_library": "SHARED_LIBRARIES", "executable": "EXECUTABLES", } def IsCPPExtension(ext): return make.COMPILABLE_EXTENSIONS.get(ext) == "cxx" def Sourceify(path): """Convert a path to its source directory form. The Android backend does not support options.generator_output, so this function is a noop.""" return path # Map from qualified target to path to output. # For Android, the target of these maps is a tuple ('static', 'modulename'), # ('dynamic', 'modulename'), or ('path', 'some/path') instead of a string, # since we link by module. target_outputs = {} # Map from qualified target to any linkable output. A subset # of target_outputs. E.g. when mybinary depends on liba, we want to # include liba in the linker line; when otherbinary depends on # mybinary, we just want to build mybinary first. target_link_deps = {} class AndroidMkWriter: """AndroidMkWriter packages up the writing of one target-specific Android.mk. Its only real entry point is Write(), and is mostly used for namespacing. """ def __init__(self, android_top_dir): self.android_top_dir = android_top_dir def Write( self, qualified_target, relative_target, base_path, output_filename, spec, configs, part_of_all, write_alias_target, sdk_version, ): """The main entry point: writes a .mk file for a single target. Arguments: qualified_target: target we're generating relative_target: qualified target name relative to the root base_path: path relative to source root we're building in, used to resolve target-relative paths output_filename: output .mk file name to write spec, configs: gyp info part_of_all: flag indicating this target is part of 'all' write_alias_target: flag indicating whether to create short aliases for this target sdk_version: what to emit for LOCAL_SDK_VERSION in output """ gyp.common.EnsureDirExists(output_filename) self.fp = open(output_filename, "w") self.fp.write(header) self.qualified_target = qualified_target self.relative_target = relative_target self.path = base_path self.target = spec["target_name"] self.type = spec["type"] self.toolset = spec["toolset"] deps, link_deps = self.ComputeDeps(spec) # Some of the generation below can add extra output, sources, or # link dependencies. All of the out params of the functions that # follow use names like extra_foo. extra_outputs = [] extra_sources = [] self.android_class = MODULE_CLASSES.get(self.type, "GYP") self.android_module = self.ComputeAndroidModule(spec) (self.android_stem, self.android_suffix) = self.ComputeOutputParts(spec) self.output = self.output_binary = self.ComputeOutput(spec) # Standard header. self.WriteLn("include $(CLEAR_VARS)\n") # Module class and name. self.WriteLn("LOCAL_MODULE_CLASS := " + self.android_class) self.WriteLn("LOCAL_MODULE := " + self.android_module) # Only emit LOCAL_MODULE_STEM if it's different to LOCAL_MODULE. # The library module classes fail if the stem is set. ComputeOutputParts # makes sure that stem == modulename in these cases. if self.android_stem != self.android_module: self.WriteLn("LOCAL_MODULE_STEM := " + self.android_stem) self.WriteLn("LOCAL_MODULE_SUFFIX := " + self.android_suffix) if self.toolset == "host": self.WriteLn("LOCAL_IS_HOST_MODULE := true") self.WriteLn("LOCAL_MULTILIB := $(GYP_HOST_MULTILIB)") elif sdk_version > 0: self.WriteLn( "LOCAL_MODULE_TARGET_ARCH := " "$(TARGET_$(GYP_VAR_PREFIX)ARCH)" ) self.WriteLn("LOCAL_SDK_VERSION := %s" % sdk_version) # Grab output directories; needed for Actions and Rules. if self.toolset == "host": self.WriteLn( "gyp_intermediate_dir := " "$(call local-intermediates-dir,,$(GYP_HOST_VAR_PREFIX))" ) else: self.WriteLn( "gyp_intermediate_dir := " "$(call local-intermediates-dir,,$(GYP_VAR_PREFIX))" ) self.WriteLn( "gyp_shared_intermediate_dir := " "$(call intermediates-dir-for,GYP,shared,,,$(GYP_VAR_PREFIX))" ) self.WriteLn() # List files this target depends on so that actions/rules/copies/sources # can depend on the list. # TODO: doesn't pull in things through transitive link deps; needed? target_dependencies = [x[1] for x in deps if x[0] == "path"] self.WriteLn("# Make sure our deps are built first.") self.WriteList( target_dependencies, "GYP_TARGET_DEPENDENCIES", local_pathify=True ) # Actions must come first, since they can generate more OBJs for use below. if "actions" in spec: self.WriteActions(spec["actions"], extra_sources, extra_outputs) # Rules must be early like actions. if "rules" in spec: self.WriteRules(spec["rules"], extra_sources, extra_outputs) if "copies" in spec: self.WriteCopies(spec["copies"], extra_outputs) # GYP generated outputs. self.WriteList(extra_outputs, "GYP_GENERATED_OUTPUTS", local_pathify=True) # Set LOCAL_ADDITIONAL_DEPENDENCIES so that Android's build rules depend # on both our dependency targets and our generated files. self.WriteLn("# Make sure our deps and generated files are built first.") self.WriteLn( "LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) " "$(GYP_GENERATED_OUTPUTS)" ) self.WriteLn() # Sources. if spec.get("sources", []) or extra_sources: self.WriteSources(spec, configs, extra_sources) self.WriteTarget( spec, configs, deps, link_deps, part_of_all, write_alias_target ) # Update global list of target outputs, used in dependency tracking. target_outputs[qualified_target] = ("path", self.output_binary) # Update global list of link dependencies. if self.type == "static_library": target_link_deps[qualified_target] = ("static", self.android_module) elif self.type == "shared_library": target_link_deps[qualified_target] = ("shared", self.android_module) self.fp.close() return self.android_module def WriteActions(self, actions, extra_sources, extra_outputs): """Write Makefile code for any 'actions' from the gyp input. extra_sources: a list that will be filled in with newly generated source files, if any extra_outputs: a list that will be filled in with any outputs of these actions (used to make other pieces dependent on these actions) """ for action in actions: name = make.StringToMakefileVariable( "{}_{}".format(self.relative_target, action["action_name"]) ) self.WriteLn('### Rules for action "%s":' % action["action_name"]) inputs = action["inputs"] outputs = action["outputs"] # Build up a list of outputs. # Collect the output dirs we'll need. dirs = set() for out in outputs: if not out.startswith("$"): print( 'WARNING: Action for target "%s" writes output to local path ' '"%s".' % (self.target, out) ) dir = os.path.split(out)[0] if dir: dirs.add(dir) if int(action.get("process_outputs_as_sources", False)): extra_sources += outputs # Prepare the actual command. command = gyp.common.EncodePOSIXShellList(action["action"]) if "message" in action: quiet_cmd = "Gyp action: %s ($@)" % action["message"] else: quiet_cmd = "Gyp action: %s ($@)" % name if len(dirs) > 0: command = "mkdir -p %s" % " ".join(dirs) + "; " + command cd_action = "cd $(gyp_local_path)/%s; " % self.path command = cd_action + command # The makefile rules are all relative to the top dir, but the gyp actions # are defined relative to their containing dir. This replaces the gyp_* # variables for the action rule with an absolute version so that the # output goes in the right place. # Only write the gyp_* rules for the "primary" output (:1); # it's superfluous for the "extra outputs", and this avoids accidentally # writing duplicate dummy rules for those outputs. main_output = make.QuoteSpaces(self.LocalPathify(outputs[0])) self.WriteLn("%s: gyp_local_path := $(LOCAL_PATH)" % main_output) self.WriteLn("%s: gyp_var_prefix := $(GYP_VAR_PREFIX)" % main_output) self.WriteLn( "%s: gyp_intermediate_dir := " "$(abspath $(gyp_intermediate_dir))" % main_output ) self.WriteLn( "%s: gyp_shared_intermediate_dir := " "$(abspath $(gyp_shared_intermediate_dir))" % main_output ) # Android's envsetup.sh adds a number of directories to the path including # the built host binary directory. This causes actions/rules invoked by # gyp to sometimes use these instead of system versions, e.g. bison. # The built host binaries may not be suitable, and can cause errors. # So, we remove them from the PATH using the ANDROID_BUILD_PATHS variable # set by envsetup. self.WriteLn( "%s: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))" % main_output ) # Don't allow spaces in input/output filenames, but make an exception for # filenames which start with '$(' since it's okay for there to be spaces # inside of make function/macro invocations. for input in inputs: if not input.startswith("$(") and " " in input: raise gyp.common.GypError( 'Action input filename "%s" in target %s contains a space' % (input, self.target) ) for output in outputs: if not output.startswith("$(") and " " in output: raise gyp.common.GypError( 'Action output filename "%s" in target %s contains a space' % (output, self.target) ) self.WriteLn( "%s: %s $(GYP_TARGET_DEPENDENCIES)" % (main_output, " ".join(map(self.LocalPathify, inputs))) ) self.WriteLn('\t@echo "%s"' % quiet_cmd) self.WriteLn("\t$(hide)%s\n" % command) for output in outputs[1:]: # Make each output depend on the main output, with an empty command # to force make to notice that the mtime has changed. self.WriteLn(f"{self.LocalPathify(output)}: {main_output} ;") extra_outputs += outputs self.WriteLn() self.WriteLn() def WriteRules(self, rules, extra_sources, extra_outputs): """Write Makefile code for any 'rules' from the gyp input. extra_sources: a list that will be filled in with newly generated source files, if any extra_outputs: a list that will be filled in with any outputs of these rules (used to make other pieces dependent on these rules) """ if len(rules) == 0: return for rule in rules: if len(rule.get("rule_sources", [])) == 0: continue name = make.StringToMakefileVariable( "{}_{}".format(self.relative_target, rule["rule_name"]) ) self.WriteLn('\n### Generated for rule "%s":' % name) self.WriteLn('# "%s":' % rule) inputs = rule.get("inputs") for rule_source in rule.get("rule_sources", []): (rule_source_dirname, rule_source_basename) = os.path.split(rule_source) (rule_source_root, rule_source_ext) = os.path.splitext( rule_source_basename ) outputs = [ self.ExpandInputRoot(out, rule_source_root, rule_source_dirname) for out in rule["outputs"] ] dirs = set() for out in outputs: if not out.startswith("$"): print( "WARNING: Rule for target %s writes output to local path %s" % (self.target, out) ) dir = os.path.dirname(out) if dir: dirs.add(dir) extra_outputs += outputs if int(rule.get("process_outputs_as_sources", False)): extra_sources.extend(outputs) components = [] for component in rule["action"]: component = self.ExpandInputRoot( component, rule_source_root, rule_source_dirname ) if "$(RULE_SOURCES)" in component: component = component.replace("$(RULE_SOURCES)", rule_source) components.append(component) command = gyp.common.EncodePOSIXShellList(components) cd_action = "cd $(gyp_local_path)/%s; " % self.path command = cd_action + command if dirs: command = "mkdir -p %s" % " ".join(dirs) + "; " + command # We set up a rule to build the first output, and then set up # a rule for each additional output to depend on the first. outputs = map(self.LocalPathify, outputs) main_output = outputs[0] self.WriteLn("%s: gyp_local_path := $(LOCAL_PATH)" % main_output) self.WriteLn("%s: gyp_var_prefix := $(GYP_VAR_PREFIX)" % main_output) self.WriteLn( "%s: gyp_intermediate_dir := " "$(abspath $(gyp_intermediate_dir))" % main_output ) self.WriteLn( "%s: gyp_shared_intermediate_dir := " "$(abspath $(gyp_shared_intermediate_dir))" % main_output ) # See explanation in WriteActions. self.WriteLn( "%s: export PATH := " "$(subst $(ANDROID_BUILD_PATHS),,$(PATH))" % main_output ) main_output_deps = self.LocalPathify(rule_source) if inputs: main_output_deps += " " main_output_deps += " ".join([self.LocalPathify(f) for f in inputs]) self.WriteLn( "%s: %s $(GYP_TARGET_DEPENDENCIES)" % (main_output, main_output_deps) ) self.WriteLn("\t%s\n" % command) for output in outputs[1:]: # Make each output depend on the main output, with an empty command # to force make to notice that the mtime has changed. self.WriteLn(f"{output}: {main_output} ;") self.WriteLn() self.WriteLn() def WriteCopies(self, copies, extra_outputs): """Write Makefile code for any 'copies' from the gyp input. extra_outputs: a list that will be filled in with any outputs of this action (used to make other pieces dependent on this action) """ self.WriteLn("### Generated for copy rule.") variable = make.StringToMakefileVariable(self.relative_target + "_copies") outputs = [] for copy in copies: for path in copy["files"]: # The Android build system does not allow generation of files into the # source tree. The destination should start with a variable, which will # typically be $(gyp_intermediate_dir) or # $(gyp_shared_intermediate_dir). Note that we can't use an assertion # because some of the gyp tests depend on this. if not copy["destination"].startswith("$"): print( "WARNING: Copy rule for target %s writes output to " "local path %s" % (self.target, copy["destination"]) ) # LocalPathify() calls normpath, stripping trailing slashes. path = Sourceify(self.LocalPathify(path)) filename = os.path.split(path)[1] output = Sourceify( self.LocalPathify(os.path.join(copy["destination"], filename)) ) self.WriteLn(f"{output}: {path} $(GYP_TARGET_DEPENDENCIES) | $(ACP)") self.WriteLn("\t@echo Copying: $@") self.WriteLn("\t$(hide) mkdir -p $(dir $@)") self.WriteLn("\t$(hide) $(ACP) -rpf $< $@") self.WriteLn() outputs.append(output) self.WriteLn( "{} = {}".format(variable, " ".join(map(make.QuoteSpaces, outputs))) ) extra_outputs.append("$(%s)" % variable) self.WriteLn() def WriteSourceFlags(self, spec, configs): """Write out the flags and include paths used to compile source files for the current target. Args: spec, configs: input from gyp. """ for configname, config in sorted(configs.items()): extracted_includes = [] self.WriteLn("\n# Flags passed to both C and C++ files.") cflags, includes_from_cflags = self.ExtractIncludesFromCFlags( config.get("cflags", []) + config.get("cflags_c", []) ) extracted_includes.extend(includes_from_cflags) self.WriteList(cflags, "MY_CFLAGS_%s" % configname) self.WriteList( config.get("defines"), "MY_DEFS_%s" % configname, prefix="-D", quoter=make.EscapeCppDefine, ) self.WriteLn("\n# Include paths placed before CFLAGS/CPPFLAGS") includes = list(config.get("include_dirs", [])) includes.extend(extracted_includes) includes = map(Sourceify, map(self.LocalPathify, includes)) includes = self.NormalizeIncludePaths(includes) self.WriteList(includes, "LOCAL_C_INCLUDES_%s" % configname) self.WriteLn("\n# Flags passed to only C++ (and not C) files.") self.WriteList(config.get("cflags_cc"), "LOCAL_CPPFLAGS_%s" % configname) self.WriteLn( "\nLOCAL_CFLAGS := $(MY_CFLAGS_$(GYP_CONFIGURATION)) " "$(MY_DEFS_$(GYP_CONFIGURATION))" ) # Undefine ANDROID for host modules # TODO: the source code should not use macro ANDROID to tell if it's host # or target module. if self.toolset == "host": self.WriteLn("# Undefine ANDROID for host modules") self.WriteLn("LOCAL_CFLAGS += -UANDROID") self.WriteLn( "LOCAL_C_INCLUDES := $(GYP_COPIED_SOURCE_ORIGIN_DIRS) " "$(LOCAL_C_INCLUDES_$(GYP_CONFIGURATION))" ) self.WriteLn("LOCAL_CPPFLAGS := $(LOCAL_CPPFLAGS_$(GYP_CONFIGURATION))") # Android uses separate flags for assembly file invocations, but gyp expects # the same CFLAGS to be applied: self.WriteLn("LOCAL_ASFLAGS := $(LOCAL_CFLAGS)") def WriteSources(self, spec, configs, extra_sources): """Write Makefile code for any 'sources' from the gyp input. These are source files necessary to build the current target. We need to handle shared_intermediate directory source files as a special case by copying them to the intermediate directory and treating them as a generated sources. Otherwise the Android build rules won't pick them up. Args: spec, configs: input from gyp. extra_sources: Sources generated from Actions or Rules. """ sources = filter(make.Compilable, spec.get("sources", [])) generated_not_sources = [x for x in extra_sources if not make.Compilable(x)] extra_sources = filter(make.Compilable, extra_sources) # Determine and output the C++ extension used by these sources. # We simply find the first C++ file and use that extension. all_sources = sources + extra_sources local_cpp_extension = ".cpp" for source in all_sources: (root, ext) = os.path.splitext(source) if IsCPPExtension(ext): local_cpp_extension = ext break if local_cpp_extension != ".cpp": self.WriteLn("LOCAL_CPP_EXTENSION := %s" % local_cpp_extension) # We need to move any non-generated sources that are coming from the # shared intermediate directory out of LOCAL_SRC_FILES and put them # into LOCAL_GENERATED_SOURCES. We also need to move over any C++ files # that don't match our local_cpp_extension, since Android will only # generate Makefile rules for a single LOCAL_CPP_EXTENSION. local_files = [] for source in sources: (root, ext) = os.path.splitext(source) if "$(gyp_shared_intermediate_dir)" in source: extra_sources.append(source) elif "$(gyp_intermediate_dir)" in source: extra_sources.append(source) elif IsCPPExtension(ext) and ext != local_cpp_extension: extra_sources.append(source) else: local_files.append(os.path.normpath(os.path.join(self.path, source))) # For any generated source, if it is coming from the shared intermediate # directory then we add a Make rule to copy them to the local intermediate # directory first. This is because the Android LOCAL_GENERATED_SOURCES # must be in the local module intermediate directory for the compile rules # to work properly. If the file has the wrong C++ extension, then we add # a rule to copy that to intermediates and use the new version. final_generated_sources = [] # If a source file gets copied, we still need to add the original source # directory as header search path, for GCC searches headers in the # directory that contains the source file by default. origin_src_dirs = [] for source in extra_sources: local_file = source if "$(gyp_intermediate_dir)/" not in local_file: basename = os.path.basename(local_file) local_file = "$(gyp_intermediate_dir)/" + basename (root, ext) = os.path.splitext(local_file) if IsCPPExtension(ext) and ext != local_cpp_extension: local_file = root + local_cpp_extension if local_file != source: self.WriteLn(f"{local_file}: {self.LocalPathify(source)}") self.WriteLn("\tmkdir -p $(@D); cp $< $@") origin_src_dirs.append(os.path.dirname(source)) final_generated_sources.append(local_file) # We add back in all of the non-compilable stuff to make sure that the # make rules have dependencies on them. final_generated_sources.extend(generated_not_sources) self.WriteList(final_generated_sources, "LOCAL_GENERATED_SOURCES") origin_src_dirs = gyp.common.uniquer(origin_src_dirs) origin_src_dirs = map(Sourceify, map(self.LocalPathify, origin_src_dirs)) self.WriteList(origin_src_dirs, "GYP_COPIED_SOURCE_ORIGIN_DIRS") self.WriteList(local_files, "LOCAL_SRC_FILES") # Write out the flags used to compile the source; this must be done last # so that GYP_COPIED_SOURCE_ORIGIN_DIRS can be used as an include path. self.WriteSourceFlags(spec, configs) def ComputeAndroidModule(self, spec): """Return the Android module name used for a gyp spec. We use the complete qualified target name to avoid collisions between duplicate targets in different directories. We also add a suffix to distinguish gyp-generated module names. """ if int(spec.get("android_unmangled_name", 0)): assert self.type != "shared_library" or self.target.startswith("lib") return self.target if self.type == "shared_library": # For reasons of convention, the Android build system requires that all # shared library modules are named 'libfoo' when generating -l flags. prefix = "lib_" else: prefix = "" if spec["toolset"] == "host": suffix = "_$(TARGET_$(GYP_VAR_PREFIX)ARCH)_host_gyp" else: suffix = "_gyp" if self.path: middle = make.StringToMakefileVariable(f"{self.path}_{self.target}") else: middle = make.StringToMakefileVariable(self.target) return "".join([prefix, middle, suffix]) def ComputeOutputParts(self, spec): """Return the 'output basename' of a gyp spec, split into filename + ext. Android libraries must be named the same thing as their module name, otherwise the linker can't find them, so product_name and so on must be ignored if we are building a library, and the "lib" prepending is not done for Android. """ assert self.type != "loadable_module" # TODO: not supported? target = spec["target_name"] target_prefix = "" target_ext = "" if self.type == "static_library": target = self.ComputeAndroidModule(spec) target_ext = ".a" elif self.type == "shared_library": target = self.ComputeAndroidModule(spec) target_ext = ".so" elif self.type == "none": target_ext = ".stamp" elif self.type != "executable": print( "ERROR: What output file should be generated?", "type", self.type, "target", target, ) if self.type != "static_library" and self.type != "shared_library": target_prefix = spec.get("product_prefix", target_prefix) target = spec.get("product_name", target) product_ext = spec.get("product_extension") if product_ext: target_ext = "." + product_ext target_stem = target_prefix + target return (target_stem, target_ext) def ComputeOutputBasename(self, spec): """Return the 'output basename' of a gyp spec. E.g., the loadable module 'foobar' in directory 'baz' will produce 'libfoobar.so' """ return "".join(self.ComputeOutputParts(spec)) def ComputeOutput(self, spec): """Return the 'output' (full output path) of a gyp spec. E.g., the loadable module 'foobar' in directory 'baz' will produce '$(obj)/baz/libfoobar.so' """ if self.type == "executable": # We install host executables into shared_intermediate_dir so they can be # run by gyp rules that refer to PRODUCT_DIR. path = "$(gyp_shared_intermediate_dir)" elif self.type == "shared_library": if self.toolset == "host": path = "$($(GYP_HOST_VAR_PREFIX)HOST_OUT_INTERMEDIATE_LIBRARIES)" else: path = "$($(GYP_VAR_PREFIX)TARGET_OUT_INTERMEDIATE_LIBRARIES)" else: # Other targets just get built into their intermediate dir. if self.toolset == "host": path = ( "$(call intermediates-dir-for,%s,%s,true,," "$(GYP_HOST_VAR_PREFIX))" % (self.android_class, self.android_module) ) else: path = "$(call intermediates-dir-for,{},{},,,$(GYP_VAR_PREFIX))".format( self.android_class, self.android_module, ) assert spec.get("product_dir") is None # TODO: not supported? return os.path.join(path, self.ComputeOutputBasename(spec)) def NormalizeIncludePaths(self, include_paths): """Normalize include_paths. Convert absolute paths to relative to the Android top directory. Args: include_paths: A list of unprocessed include paths. Returns: A list of normalized include paths. """ normalized = [] for path in include_paths: if path[0] == "/": path = gyp.common.RelativePath(path, self.android_top_dir) normalized.append(path) return normalized def ExtractIncludesFromCFlags(self, cflags): """Extract includes "-I..." out from cflags Args: cflags: A list of compiler flags, which may be mixed with "-I.." Returns: A tuple of lists: (clean_clfags, include_paths). "-I.." is trimmed. """ clean_cflags = [] include_paths = [] for flag in cflags: if flag.startswith("-I"): include_paths.append(flag[2:]) else: clean_cflags.append(flag) return (clean_cflags, include_paths) def FilterLibraries(self, libraries): """Filter the 'libraries' key to separate things that shouldn't be ldflags. Library entries that look like filenames should be converted to android module names instead of being passed to the linker as flags. Args: libraries: the value of spec.get('libraries') Returns: A tuple (static_lib_modules, dynamic_lib_modules, ldflags) """ static_lib_modules = [] dynamic_lib_modules = [] ldflags = [] for libs in libraries: # Libs can have multiple words. for lib in libs.split(): # Filter the system libraries, which are added by default by the Android # build system. if ( lib == "-lc" or lib == "-lstdc++" or lib == "-lm" or lib.endswith("libgcc.a") ): continue match = re.search(r"([^/]+)\.a$", lib) if match: static_lib_modules.append(match.group(1)) continue match = re.search(r"([^/]+)\.so$", lib) if match: dynamic_lib_modules.append(match.group(1)) continue if lib.startswith("-l"): ldflags.append(lib) return (static_lib_modules, dynamic_lib_modules, ldflags) def ComputeDeps(self, spec): """Compute the dependencies of a gyp spec. Returns a tuple (deps, link_deps), where each is a list of filenames that will need to be put in front of make for either building (deps) or linking (link_deps). """ deps = [] link_deps = [] if "dependencies" in spec: deps.extend( [ target_outputs[dep] for dep in spec["dependencies"] if target_outputs[dep] ] ) for dep in spec["dependencies"]: if dep in target_link_deps: link_deps.append(target_link_deps[dep]) deps.extend(link_deps) return (gyp.common.uniquer(deps), gyp.common.uniquer(link_deps)) def WriteTargetFlags(self, spec, configs, link_deps): """Write Makefile code to specify the link flags and library dependencies. spec, configs: input from gyp. link_deps: link dependency list; see ComputeDeps() """ # Libraries (i.e. -lfoo) # These must be included even for static libraries as some of them provide # implicit include paths through the build system. libraries = gyp.common.uniquer(spec.get("libraries", [])) static_libs, dynamic_libs, ldflags_libs = self.FilterLibraries(libraries) if self.type != "static_library": for configname, config in sorted(configs.items()): ldflags = list(config.get("ldflags", [])) self.WriteLn("") self.WriteList(ldflags, "LOCAL_LDFLAGS_%s" % configname) self.WriteList(ldflags_libs, "LOCAL_GYP_LIBS") self.WriteLn( "LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION)) " "$(LOCAL_GYP_LIBS)" ) # Link dependencies (i.e. other gyp targets this target depends on) # These need not be included for static libraries as within the gyp build # we do not use the implicit include path mechanism. if self.type != "static_library": static_link_deps = [x[1] for x in link_deps if x[0] == "static"] shared_link_deps = [x[1] for x in link_deps if x[0] == "shared"] else: static_link_deps = [] shared_link_deps = [] # Only write the lists if they are non-empty. if static_libs or static_link_deps: self.WriteLn("") self.WriteList(static_libs + static_link_deps, "LOCAL_STATIC_LIBRARIES") self.WriteLn("# Enable grouping to fix circular references") self.WriteLn("LOCAL_GROUP_STATIC_LIBRARIES := true") if dynamic_libs or shared_link_deps: self.WriteLn("") self.WriteList(dynamic_libs + shared_link_deps, "LOCAL_SHARED_LIBRARIES") def WriteTarget( self, spec, configs, deps, link_deps, part_of_all, write_alias_target ): """Write Makefile code to produce the final target of the gyp spec. spec, configs: input from gyp. deps, link_deps: dependency lists; see ComputeDeps() part_of_all: flag indicating this target is part of 'all' write_alias_target: flag indicating whether to create short aliases for this target """ self.WriteLn("### Rules for final target.") if self.type != "none": self.WriteTargetFlags(spec, configs, link_deps) settings = spec.get("aosp_build_settings", {}) if settings: self.WriteLn("### Set directly by aosp_build_settings.") for k, v in settings.items(): if isinstance(v, list): self.WriteList(v, k) else: self.WriteLn(f"{k} := {make.QuoteIfNecessary(v)}") self.WriteLn("") # Add to the set of targets which represent the gyp 'all' target. We use the # name 'gyp_all_modules' as the Android build system doesn't allow the use # of the Make target 'all' and because 'all_modules' is the equivalent of # the Make target 'all' on Android. if part_of_all and write_alias_target: self.WriteLn('# Add target alias to "gyp_all_modules" target.') self.WriteLn(".PHONY: gyp_all_modules") self.WriteLn("gyp_all_modules: %s" % self.android_module) self.WriteLn("") # Add an alias from the gyp target name to the Android module name. This # simplifies manual builds of the target, and is required by the test # framework. if self.target != self.android_module and write_alias_target: self.WriteLn("# Alias gyp target name.") self.WriteLn(".PHONY: %s" % self.target) self.WriteLn(f"{self.target}: {self.android_module}") self.WriteLn("") # Add the command to trigger build of the target type depending # on the toolset. Ex: BUILD_STATIC_LIBRARY vs. BUILD_HOST_STATIC_LIBRARY # NOTE: This has to come last! modifier = "" if self.toolset == "host": modifier = "HOST_" if self.type == "static_library": self.WriteLn("include $(BUILD_%sSTATIC_LIBRARY)" % modifier) elif self.type == "shared_library": self.WriteLn("LOCAL_PRELINK_MODULE := false") self.WriteLn("include $(BUILD_%sSHARED_LIBRARY)" % modifier) elif self.type == "executable": self.WriteLn("LOCAL_CXX_STL := libc++_static") # Executables are for build and test purposes only, so they're installed # to a directory that doesn't get included in the system image. self.WriteLn("LOCAL_MODULE_PATH := $(gyp_shared_intermediate_dir)") self.WriteLn("include $(BUILD_%sEXECUTABLE)" % modifier) else: self.WriteLn("LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp") self.WriteLn("LOCAL_UNINSTALLABLE_MODULE := true") if self.toolset == "target": self.WriteLn("LOCAL_2ND_ARCH_VAR_PREFIX := $(GYP_VAR_PREFIX)") else: self.WriteLn("LOCAL_2ND_ARCH_VAR_PREFIX := $(GYP_HOST_VAR_PREFIX)") self.WriteLn() self.WriteLn("include $(BUILD_SYSTEM)/base_rules.mk") self.WriteLn() self.WriteLn("$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)") self.WriteLn('\t$(hide) echo "Gyp timestamp: $@"') self.WriteLn("\t$(hide) mkdir -p $(dir $@)") self.WriteLn("\t$(hide) touch $@") self.WriteLn() self.WriteLn("LOCAL_2ND_ARCH_VAR_PREFIX :=") def WriteList( self, value_list, variable=None, prefix="", quoter=make.QuoteIfNecessary, local_pathify=False, ): """Write a variable definition that is a list of values. E.g. WriteList(['a','b'], 'foo', prefix='blah') writes out foo = blaha blahb but in a pretty-printed style. """ values = "" if value_list: value_list = [quoter(prefix + value) for value in value_list] if local_pathify: value_list = [self.LocalPathify(value) for value in value_list] values = " \\\n\t" + " \\\n\t".join(value_list) self.fp.write(f"{variable} :={values}\n\n") def WriteLn(self, text=""): self.fp.write(text + "\n") def LocalPathify(self, path): """Convert a subdirectory-relative path into a normalized path which starts with the make variable $(LOCAL_PATH) (i.e. the top of the project tree). Absolute paths, or paths that contain variables, are just normalized.""" if "$(" in path or os.path.isabs(path): # path is not a file in the project tree in this case, but calling # normpath is still important for trimming trailing slashes. return os.path.normpath(path) local_path = os.path.join("$(LOCAL_PATH)", self.path, path) local_path = os.path.normpath(local_path) # Check that normalizing the path didn't ../ itself out of $(LOCAL_PATH) # - i.e. that the resulting path is still inside the project tree. The # path may legitimately have ended up containing just $(LOCAL_PATH), though, # so we don't look for a slash. assert local_path.startswith( "$(LOCAL_PATH)" ), f"Path {path} attempts to escape from gyp path {self.path} !)" return local_path def ExpandInputRoot(self, template, expansion, dirname): if "%(INPUT_ROOT)s" not in template and "%(INPUT_DIRNAME)s" not in template: return template path = template % { "INPUT_ROOT": expansion, "INPUT_DIRNAME": dirname, } return os.path.normpath(path) def PerformBuild(data, configurations, params): # The android backend only supports the default configuration. options = params["options"] makefile = os.path.abspath(os.path.join(options.toplevel_dir, "GypAndroid.mk")) env = dict(os.environ) env["ONE_SHOT_MAKEFILE"] = makefile arguments = ["make", "-C", os.environ["ANDROID_BUILD_TOP"], "gyp_all_modules"] print("Building: %s" % arguments) subprocess.check_call(arguments, env=env) def GenerateOutput(target_list, target_dicts, data, params): options = params["options"] generator_flags = params.get("generator_flags", {}) limit_to_target_all = generator_flags.get("limit_to_target_all", False) write_alias_targets = generator_flags.get("write_alias_targets", True) sdk_version = generator_flags.get("aosp_sdk_version", 0) android_top_dir = os.environ.get("ANDROID_BUILD_TOP") assert android_top_dir, "$ANDROID_BUILD_TOP not set; you need to run lunch." def CalculateMakefilePath(build_file, base_name): """Determine where to write a Makefile for a given gyp file.""" # Paths in gyp files are relative to the .gyp file, but we want # paths relative to the source root for the master makefile. Grab # the path of the .gyp file as the base to relativize against. # E.g. "foo/bar" when we're constructing targets for "foo/bar/baz.gyp". base_path = gyp.common.RelativePath(os.path.dirname(build_file), options.depth) # We write the file in the base_path directory. output_file = os.path.join(options.depth, base_path, base_name) assert ( not options.generator_output ), "The Android backend does not support options.generator_output." base_path = gyp.common.RelativePath( os.path.dirname(build_file), options.toplevel_dir ) return base_path, output_file # TODO: search for the first non-'Default' target. This can go # away when we add verification that all targets have the # necessary configurations. default_configuration = None for target in target_list: spec = target_dicts[target] if spec["default_configuration"] != "Default": default_configuration = spec["default_configuration"] break if not default_configuration: default_configuration = "Default" makefile_name = "GypAndroid" + options.suffix + ".mk" makefile_path = os.path.join(options.toplevel_dir, makefile_name) assert ( not options.generator_output ), "The Android backend does not support options.generator_output." gyp.common.EnsureDirExists(makefile_path) root_makefile = open(makefile_path, "w") root_makefile.write(header) # We set LOCAL_PATH just once, here, to the top of the project tree. This # allows all the other paths we use to be relative to the Android.mk file, # as the Android build system expects. root_makefile.write("\nLOCAL_PATH := $(call my-dir)\n") # Find the list of targets that derive from the gyp file(s) being built. needed_targets = set() for build_file in params["build_files"]: for target in gyp.common.AllTargets(target_list, target_dicts, build_file): needed_targets.add(target) build_files = set() include_list = set() android_modules = {} for qualified_target in target_list: build_file, target, toolset = gyp.common.ParseQualifiedTarget(qualified_target) relative_build_file = gyp.common.RelativePath(build_file, options.toplevel_dir) build_files.add(relative_build_file) included_files = data[build_file]["included_files"] for included_file in included_files: # The included_files entries are relative to the dir of the build file # that included them, so we have to undo that and then make them relative # to the root dir. relative_include_file = gyp.common.RelativePath( gyp.common.UnrelativePath(included_file, build_file), options.toplevel_dir, ) abs_include_file = os.path.abspath(relative_include_file) # If the include file is from the ~/.gyp dir, we should use absolute path # so that relocating the src dir doesn't break the path. if params["home_dot_gyp"] and abs_include_file.startswith( params["home_dot_gyp"] ): build_files.add(abs_include_file) else: build_files.add(relative_include_file) base_path, output_file = CalculateMakefilePath( build_file, target + "." + toolset + options.suffix + ".mk" ) spec = target_dicts[qualified_target] configs = spec["configurations"] part_of_all = qualified_target in needed_targets if limit_to_target_all and not part_of_all: continue relative_target = gyp.common.QualifiedTarget( relative_build_file, target, toolset ) writer = AndroidMkWriter(android_top_dir) android_module = writer.Write( qualified_target, relative_target, base_path, output_file, spec, configs, part_of_all=part_of_all, write_alias_target=write_alias_targets, sdk_version=sdk_version, ) if android_module in android_modules: print( "ERROR: Android module names must be unique. The following " "targets both generate Android module name %s.\n %s\n %s" % (android_module, android_modules[android_module], qualified_target) ) return android_modules[android_module] = qualified_target # Our root_makefile lives at the source root. Compute the relative path # from there to the output_file for including. mkfile_rel_path = gyp.common.RelativePath( output_file, os.path.dirname(makefile_path) ) include_list.add(mkfile_rel_path) root_makefile.write("GYP_CONFIGURATION ?= %s\n" % default_configuration) root_makefile.write("GYP_VAR_PREFIX ?=\n") root_makefile.write("GYP_HOST_VAR_PREFIX ?=\n") root_makefile.write("GYP_HOST_MULTILIB ?= first\n") # Write out the sorted list of includes. root_makefile.write("\n") for include_file in sorted(include_list): root_makefile.write("include $(LOCAL_PATH)/" + include_file + "\n") root_makefile.write("\n") if write_alias_targets: root_makefile.write(ALL_MODULES_FOOTER) root_makefile.close() # Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """cmake output module This module is under development and should be considered experimental. This module produces cmake (2.8.8+) input as its output. One CMakeLists.txt is created for each configuration. This module's original purpose was to support editing in IDEs like KDevelop which use CMake for project management. It is also possible to use CMake to generate projects for other IDEs such as eclipse cdt and code::blocks. QtCreator will convert the CMakeLists.txt to a code::blocks cbp for the editor to read, but build using CMake. As a result QtCreator editor is unaware of compiler defines. The generated CMakeLists.txt can also be used to build on Linux. There is currently no support for building on platforms other than Linux. The generated CMakeLists.txt should properly compile all projects. However, there is a mismatch between gyp and cmake with regard to linking. All attempts are made to work around this, but CMake sometimes sees -Wl,--start-group as a library and incorrectly repeats it. As a result the output of this generator should not be relied on for building. When using with kdevelop, use version 4.4+. Previous versions of kdevelop will not be able to find the header file directories described in the generated CMakeLists.txt file. """ import multiprocessing import os import signal import subprocess import gyp.common import gyp.xcode_emulation _maketrans = str.maketrans generator_default_variables = { "EXECUTABLE_PREFIX": "", "EXECUTABLE_SUFFIX": "", "STATIC_LIB_PREFIX": "lib", "STATIC_LIB_SUFFIX": ".a", "SHARED_LIB_PREFIX": "lib", "SHARED_LIB_SUFFIX": ".so", "SHARED_LIB_DIR": "${builddir}/lib.${TOOLSET}", "LIB_DIR": "${obj}.${TOOLSET}", "INTERMEDIATE_DIR": "${obj}.${TOOLSET}/${TARGET}/geni", "SHARED_INTERMEDIATE_DIR": "${obj}/gen", "PRODUCT_DIR": "${builddir}", "RULE_INPUT_PATH": "${RULE_INPUT_PATH}", "RULE_INPUT_DIRNAME": "${RULE_INPUT_DIRNAME}", "RULE_INPUT_NAME": "${RULE_INPUT_NAME}", "RULE_INPUT_ROOT": "${RULE_INPUT_ROOT}", "RULE_INPUT_EXT": "${RULE_INPUT_EXT}", "CONFIGURATION_NAME": "${configuration}", } FULL_PATH_VARS = ("${CMAKE_CURRENT_LIST_DIR}", "${builddir}", "${obj}") generator_supports_multiple_toolsets = True generator_wants_static_library_dependencies_adjusted = True COMPILABLE_EXTENSIONS = { ".c": "cc", ".cc": "cxx", ".cpp": "cxx", ".cxx": "cxx", ".s": "s", # cc ".S": "s", # cc } def RemovePrefix(a, prefix): """Returns 'a' without 'prefix' if it starts with 'prefix'.""" return a[len(prefix) :] if a.startswith(prefix) else a def CalculateVariables(default_variables, params): """Calculate additional variables for use in the build (called by gyp).""" default_variables.setdefault("OS", gyp.common.GetFlavor(params)) def Compilable(filename): """Return true if the file is compilable (should be in OBJS).""" return any(filename.endswith(e) for e in COMPILABLE_EXTENSIONS) def Linkable(filename): """Return true if the file is linkable (should be on the link line).""" return filename.endswith(".o") def NormjoinPathForceCMakeSource(base_path, rel_path): """Resolves rel_path against base_path and returns the result. If rel_path is an absolute path it is returned unchanged. Otherwise it is resolved against base_path and normalized. If the result is a relative path, it is forced to be relative to the CMakeLists.txt. """ if os.path.isabs(rel_path): return rel_path if any([rel_path.startswith(var) for var in FULL_PATH_VARS]): return rel_path # TODO: do we need to check base_path for absolute variables as well? return os.path.join( "${CMAKE_CURRENT_LIST_DIR}", os.path.normpath(os.path.join(base_path, rel_path)) ) def NormjoinPath(base_path, rel_path): """Resolves rel_path against base_path and returns the result. TODO: what is this really used for? If rel_path begins with '$' it is returned unchanged. Otherwise it is resolved against base_path if relative, then normalized. """ if rel_path.startswith("$") and not rel_path.startswith("${configuration}"): return rel_path return os.path.normpath(os.path.join(base_path, rel_path)) def CMakeStringEscape(a): """Escapes the string 'a' for use inside a CMake string. This means escaping '\' otherwise it may be seen as modifying the next character '"' otherwise it will end the string ';' otherwise the string becomes a list The following do not need to be escaped '#' when the lexer is in string state, this does not start a comment The following are yet unknown '$' generator variables (like ${obj}) must not be escaped, but text $ should be escaped what is wanted is to know which $ come from generator variables """ return a.replace("\\", "\\\\").replace(";", "\\;").replace('"', '\\"') def SetFileProperty(output, source_name, property_name, values, sep): """Given a set of source file, sets the given property on them.""" output.write("set_source_files_properties(") output.write(source_name) output.write(" PROPERTIES ") output.write(property_name) output.write(' "') for value in values: output.write(CMakeStringEscape(value)) output.write(sep) output.write('")\n') def SetFilesProperty(output, variable, property_name, values, sep): """Given a set of source files, sets the given property on them.""" output.write("set_source_files_properties(") WriteVariable(output, variable) output.write(" PROPERTIES ") output.write(property_name) output.write(' "') for value in values: output.write(CMakeStringEscape(value)) output.write(sep) output.write('")\n') def SetTargetProperty(output, target_name, property_name, values, sep=""): """Given a target, sets the given property.""" output.write("set_target_properties(") output.write(target_name) output.write(" PROPERTIES ") output.write(property_name) output.write(' "') for value in values: output.write(CMakeStringEscape(value)) output.write(sep) output.write('")\n') def SetVariable(output, variable_name, value): """Sets a CMake variable.""" output.write("set(") output.write(variable_name) output.write(' "') output.write(CMakeStringEscape(value)) output.write('")\n') def SetVariableList(output, variable_name, values): """Sets a CMake variable to a list.""" if not values: return SetVariable(output, variable_name, "") if len(values) == 1: return SetVariable(output, variable_name, values[0]) output.write("list(APPEND ") output.write(variable_name) output.write('\n "') output.write('"\n "'.join([CMakeStringEscape(value) for value in values])) output.write('")\n') def UnsetVariable(output, variable_name): """Unsets a CMake variable.""" output.write("unset(") output.write(variable_name) output.write(")\n") def WriteVariable(output, variable_name, prepend=None): if prepend: output.write(prepend) output.write("${") output.write(variable_name) output.write("}") class CMakeTargetType: def __init__(self, command, modifier, property_modifier): self.command = command self.modifier = modifier self.property_modifier = property_modifier cmake_target_type_from_gyp_target_type = { "executable": CMakeTargetType("add_executable", None, "RUNTIME"), "static_library": CMakeTargetType("add_library", "STATIC", "ARCHIVE"), "shared_library": CMakeTargetType("add_library", "SHARED", "LIBRARY"), "loadable_module": CMakeTargetType("add_library", "MODULE", "LIBRARY"), "none": CMakeTargetType("add_custom_target", "SOURCES", None), } def StringToCMakeTargetName(a): """Converts the given string 'a' to a valid CMake target name. All invalid characters are replaced by '_'. Invalid for cmake: ' ', '/', '(', ')', '"' Invalid for make: ':' Invalid for unknown reasons but cause failures: '.' """ return a.translate(_maketrans(' /():."', "_______")) def WriteActions(target_name, actions, extra_sources, extra_deps, path_to_gyp, output): """Write CMake for the 'actions' in the target. Args: target_name: the name of the CMake target being generated. actions: the Gyp 'actions' dict for this target. extra_sources: [(, )] to append with generated source files. extra_deps: [] to append with generated targets. path_to_gyp: relative path from CMakeLists.txt being generated to the Gyp file in which the target being generated is defined. """ for action in actions: action_name = StringToCMakeTargetName(action["action_name"]) action_target_name = f"{target_name}__{action_name}" inputs = action["inputs"] inputs_name = action_target_name + "__input" SetVariableList( output, inputs_name, [NormjoinPathForceCMakeSource(path_to_gyp, dep) for dep in inputs], ) outputs = action["outputs"] cmake_outputs = [ NormjoinPathForceCMakeSource(path_to_gyp, out) for out in outputs ] outputs_name = action_target_name + "__output" SetVariableList(output, outputs_name, cmake_outputs) # Build up a list of outputs. # Collect the output dirs we'll need. dirs = {dir for dir in (os.path.dirname(o) for o in outputs) if dir} if int(action.get("process_outputs_as_sources", False)): extra_sources.extend(zip(cmake_outputs, outputs)) # add_custom_command output.write("add_custom_command(OUTPUT ") WriteVariable(output, outputs_name) output.write("\n") if len(dirs) > 0: for directory in dirs: output.write(" COMMAND ${CMAKE_COMMAND} -E make_directory ") output.write(directory) output.write("\n") output.write(" COMMAND ") output.write(gyp.common.EncodePOSIXShellList(action["action"])) output.write("\n") output.write(" DEPENDS ") WriteVariable(output, inputs_name) output.write("\n") output.write(" WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/") output.write(path_to_gyp) output.write("\n") output.write(" COMMENT ") if "message" in action: output.write(action["message"]) else: output.write(action_target_name) output.write("\n") output.write(" VERBATIM\n") output.write(")\n") # add_custom_target output.write("add_custom_target(") output.write(action_target_name) output.write("\n DEPENDS ") WriteVariable(output, outputs_name) output.write("\n SOURCES ") WriteVariable(output, inputs_name) output.write("\n)\n") extra_deps.append(action_target_name) def NormjoinRulePathForceCMakeSource(base_path, rel_path, rule_source): if rel_path.startswith(("${RULE_INPUT_PATH}", "${RULE_INPUT_DIRNAME}")): if any([rule_source.startswith(var) for var in FULL_PATH_VARS]): return rel_path return NormjoinPathForceCMakeSource(base_path, rel_path) def WriteRules(target_name, rules, extra_sources, extra_deps, path_to_gyp, output): """Write CMake for the 'rules' in the target. Args: target_name: the name of the CMake target being generated. actions: the Gyp 'actions' dict for this target. extra_sources: [(, )] to append with generated source files. extra_deps: [] to append with generated targets. path_to_gyp: relative path from CMakeLists.txt being generated to the Gyp file in which the target being generated is defined. """ for rule in rules: rule_name = StringToCMakeTargetName(target_name + "__" + rule["rule_name"]) inputs = rule.get("inputs", []) inputs_name = rule_name + "__input" SetVariableList( output, inputs_name, [NormjoinPathForceCMakeSource(path_to_gyp, dep) for dep in inputs], ) outputs = rule["outputs"] var_outputs = [] for count, rule_source in enumerate(rule.get("rule_sources", [])): action_name = rule_name + "_" + str(count) rule_source_dirname, rule_source_basename = os.path.split(rule_source) rule_source_root, rule_source_ext = os.path.splitext(rule_source_basename) SetVariable(output, "RULE_INPUT_PATH", rule_source) SetVariable(output, "RULE_INPUT_DIRNAME", rule_source_dirname) SetVariable(output, "RULE_INPUT_NAME", rule_source_basename) SetVariable(output, "RULE_INPUT_ROOT", rule_source_root) SetVariable(output, "RULE_INPUT_EXT", rule_source_ext) # Build up a list of outputs. # Collect the output dirs we'll need. dirs = {dir for dir in (os.path.dirname(o) for o in outputs) if dir} # Create variables for the output, as 'local' variable will be unset. these_outputs = [] for output_index, out in enumerate(outputs): output_name = action_name + "_" + str(output_index) SetVariable( output, output_name, NormjoinRulePathForceCMakeSource(path_to_gyp, out, rule_source), ) if int(rule.get("process_outputs_as_sources", False)): extra_sources.append(("${" + output_name + "}", out)) these_outputs.append("${" + output_name + "}") var_outputs.append("${" + output_name + "}") # add_custom_command output.write("add_custom_command(OUTPUT\n") for out in these_outputs: output.write(" ") output.write(out) output.write("\n") for directory in dirs: output.write(" COMMAND ${CMAKE_COMMAND} -E make_directory ") output.write(directory) output.write("\n") output.write(" COMMAND ") output.write(gyp.common.EncodePOSIXShellList(rule["action"])) output.write("\n") output.write(" DEPENDS ") WriteVariable(output, inputs_name) output.write(" ") output.write(NormjoinPath(path_to_gyp, rule_source)) output.write("\n") # CMAKE_CURRENT_LIST_DIR is where the CMakeLists.txt lives. # The cwd is the current build directory. output.write(" WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/") output.write(path_to_gyp) output.write("\n") output.write(" COMMENT ") if "message" in rule: output.write(rule["message"]) else: output.write(action_name) output.write("\n") output.write(" VERBATIM\n") output.write(")\n") UnsetVariable(output, "RULE_INPUT_PATH") UnsetVariable(output, "RULE_INPUT_DIRNAME") UnsetVariable(output, "RULE_INPUT_NAME") UnsetVariable(output, "RULE_INPUT_ROOT") UnsetVariable(output, "RULE_INPUT_EXT") # add_custom_target output.write("add_custom_target(") output.write(rule_name) output.write(" DEPENDS\n") for out in var_outputs: output.write(" ") output.write(out) output.write("\n") output.write("SOURCES ") WriteVariable(output, inputs_name) output.write("\n") for rule_source in rule.get("rule_sources", []): output.write(" ") output.write(NormjoinPath(path_to_gyp, rule_source)) output.write("\n") output.write(")\n") extra_deps.append(rule_name) def WriteCopies(target_name, copies, extra_deps, path_to_gyp, output): """Write CMake for the 'copies' in the target. Args: target_name: the name of the CMake target being generated. actions: the Gyp 'actions' dict for this target. extra_deps: [] to append with generated targets. path_to_gyp: relative path from CMakeLists.txt being generated to the Gyp file in which the target being generated is defined. """ copy_name = target_name + "__copies" # CMake gets upset with custom targets with OUTPUT which specify no output. have_copies = any(copy["files"] for copy in copies) if not have_copies: output.write("add_custom_target(") output.write(copy_name) output.write(")\n") extra_deps.append(copy_name) return class Copy: def __init__(self, ext, command): self.cmake_inputs = [] self.cmake_outputs = [] self.gyp_inputs = [] self.gyp_outputs = [] self.ext = ext self.inputs_name = None self.outputs_name = None self.command = command file_copy = Copy("", "copy") dir_copy = Copy("_dirs", "copy_directory") for copy in copies: files = copy["files"] destination = copy["destination"] for src in files: path = os.path.normpath(src) basename = os.path.split(path)[1] dst = os.path.join(destination, basename) copy = file_copy if os.path.basename(src) else dir_copy copy.cmake_inputs.append(NormjoinPathForceCMakeSource(path_to_gyp, src)) copy.cmake_outputs.append(NormjoinPathForceCMakeSource(path_to_gyp, dst)) copy.gyp_inputs.append(src) copy.gyp_outputs.append(dst) for copy in (file_copy, dir_copy): if copy.cmake_inputs: copy.inputs_name = copy_name + "__input" + copy.ext SetVariableList(output, copy.inputs_name, copy.cmake_inputs) copy.outputs_name = copy_name + "__output" + copy.ext SetVariableList(output, copy.outputs_name, copy.cmake_outputs) # add_custom_command output.write("add_custom_command(\n") output.write("OUTPUT") for copy in (file_copy, dir_copy): if copy.outputs_name: WriteVariable(output, copy.outputs_name, " ") output.write("\n") for copy in (file_copy, dir_copy): for src, dst in zip(copy.gyp_inputs, copy.gyp_outputs): # 'cmake -E copy src dst' will create the 'dst' directory if needed. output.write("COMMAND ${CMAKE_COMMAND} -E %s " % copy.command) output.write(src) output.write(" ") output.write(dst) output.write("\n") output.write("DEPENDS") for copy in (file_copy, dir_copy): if copy.inputs_name: WriteVariable(output, copy.inputs_name, " ") output.write("\n") output.write("WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/") output.write(path_to_gyp) output.write("\n") output.write("COMMENT Copying for ") output.write(target_name) output.write("\n") output.write("VERBATIM\n") output.write(")\n") # add_custom_target output.write("add_custom_target(") output.write(copy_name) output.write("\n DEPENDS") for copy in (file_copy, dir_copy): if copy.outputs_name: WriteVariable(output, copy.outputs_name, " ") output.write("\n SOURCES") if file_copy.inputs_name: WriteVariable(output, file_copy.inputs_name, " ") output.write("\n)\n") extra_deps.append(copy_name) def CreateCMakeTargetBaseName(qualified_target): """This is the name we would like the target to have.""" _, gyp_target_name, gyp_target_toolset = gyp.common.ParseQualifiedTarget( qualified_target ) cmake_target_base_name = gyp_target_name if gyp_target_toolset and gyp_target_toolset != "target": cmake_target_base_name += "_" + gyp_target_toolset return StringToCMakeTargetName(cmake_target_base_name) def CreateCMakeTargetFullName(qualified_target): """An unambiguous name for the target.""" gyp_file, gyp_target_name, gyp_target_toolset = gyp.common.ParseQualifiedTarget( qualified_target ) cmake_target_full_name = gyp_file + ":" + gyp_target_name if gyp_target_toolset and gyp_target_toolset != "target": cmake_target_full_name += "_" + gyp_target_toolset return StringToCMakeTargetName(cmake_target_full_name) class CMakeNamer: """Converts Gyp target names into CMake target names. CMake requires that target names be globally unique. One way to ensure this is to fully qualify the names of the targets. Unfortunately, this ends up with all targets looking like "chrome_chrome_gyp_chrome" instead of just "chrome". If this generator were only interested in building, it would be possible to fully qualify all target names, then create unqualified target names which depend on all qualified targets which should have had that name. This is more or less what the 'make' generator does with aliases. However, one goal of this generator is to create CMake files for use with IDEs, and fully qualified names are not as user friendly. Since target name collision is rare, we do the above only when required. Toolset variants are always qualified from the base, as this is required for building. However, it also makes sense for an IDE, as it is possible for defines to be different. """ def __init__(self, target_list): self.cmake_target_base_names_conficting = set() cmake_target_base_names_seen = set() for qualified_target in target_list: cmake_target_base_name = CreateCMakeTargetBaseName(qualified_target) if cmake_target_base_name not in cmake_target_base_names_seen: cmake_target_base_names_seen.add(cmake_target_base_name) else: self.cmake_target_base_names_conficting.add(cmake_target_base_name) def CreateCMakeTargetName(self, qualified_target): base_name = CreateCMakeTargetBaseName(qualified_target) if base_name in self.cmake_target_base_names_conficting: return CreateCMakeTargetFullName(qualified_target) return base_name def WriteTarget( namer, qualified_target, target_dicts, build_dir, config_to_use, options, generator_flags, all_qualified_targets, flavor, output, ): # The make generator does this always. # TODO: It would be nice to be able to tell CMake all dependencies. circular_libs = generator_flags.get("circular", True) if not generator_flags.get("standalone", False): output.write("\n#") output.write(qualified_target) output.write("\n") gyp_file, _, _ = gyp.common.ParseQualifiedTarget(qualified_target) rel_gyp_file = gyp.common.RelativePath(gyp_file, options.toplevel_dir) rel_gyp_dir = os.path.dirname(rel_gyp_file) # Relative path from build dir to top dir. build_to_top = gyp.common.InvertRelativePath(build_dir, options.toplevel_dir) # Relative path from build dir to gyp dir. build_to_gyp = os.path.join(build_to_top, rel_gyp_dir) path_from_cmakelists_to_gyp = build_to_gyp spec = target_dicts.get(qualified_target, {}) config = spec.get("configurations", {}).get(config_to_use, {}) xcode_settings = None if flavor == "mac": xcode_settings = gyp.xcode_emulation.XcodeSettings(spec) target_name = spec.get("target_name", "") target_type = spec.get("type", "") target_toolset = spec.get("toolset") cmake_target_type = cmake_target_type_from_gyp_target_type.get(target_type) if cmake_target_type is None: print( "Target %s has unknown target type %s, skipping." % (target_name, target_type) ) return SetVariable(output, "TARGET", target_name) SetVariable(output, "TOOLSET", target_toolset) cmake_target_name = namer.CreateCMakeTargetName(qualified_target) extra_sources = [] extra_deps = [] # Actions must come first, since they can generate more OBJs for use below. if "actions" in spec: WriteActions( cmake_target_name, spec["actions"], extra_sources, extra_deps, path_from_cmakelists_to_gyp, output, ) # Rules must be early like actions. if "rules" in spec: WriteRules( cmake_target_name, spec["rules"], extra_sources, extra_deps, path_from_cmakelists_to_gyp, output, ) # Copies if "copies" in spec: WriteCopies( cmake_target_name, spec["copies"], extra_deps, path_from_cmakelists_to_gyp, output, ) # Target and sources srcs = spec.get("sources", []) # Gyp separates the sheep from the goats based on file extensions. # A full separation is done here because of flag handing (see below). s_sources = [] c_sources = [] cxx_sources = [] linkable_sources = [] other_sources = [] for src in srcs: _, ext = os.path.splitext(src) src_type = COMPILABLE_EXTENSIONS.get(ext, None) src_norm_path = NormjoinPath(path_from_cmakelists_to_gyp, src) if src_type == "s": s_sources.append(src_norm_path) elif src_type == "cc": c_sources.append(src_norm_path) elif src_type == "cxx": cxx_sources.append(src_norm_path) elif Linkable(ext): linkable_sources.append(src_norm_path) else: other_sources.append(src_norm_path) for extra_source in extra_sources: src, real_source = extra_source _, ext = os.path.splitext(real_source) src_type = COMPILABLE_EXTENSIONS.get(ext, None) if src_type == "s": s_sources.append(src) elif src_type == "cc": c_sources.append(src) elif src_type == "cxx": cxx_sources.append(src) elif Linkable(ext): linkable_sources.append(src) else: other_sources.append(src) s_sources_name = None if s_sources: s_sources_name = cmake_target_name + "__asm_srcs" SetVariableList(output, s_sources_name, s_sources) c_sources_name = None if c_sources: c_sources_name = cmake_target_name + "__c_srcs" SetVariableList(output, c_sources_name, c_sources) cxx_sources_name = None if cxx_sources: cxx_sources_name = cmake_target_name + "__cxx_srcs" SetVariableList(output, cxx_sources_name, cxx_sources) linkable_sources_name = None if linkable_sources: linkable_sources_name = cmake_target_name + "__linkable_srcs" SetVariableList(output, linkable_sources_name, linkable_sources) other_sources_name = None if other_sources: other_sources_name = cmake_target_name + "__other_srcs" SetVariableList(output, other_sources_name, other_sources) # CMake gets upset when executable targets provide no sources. # http://www.cmake.org/pipermail/cmake/2010-July/038461.html dummy_sources_name = None has_sources = ( s_sources_name or c_sources_name or cxx_sources_name or linkable_sources_name or other_sources_name ) if target_type == "executable" and not has_sources: dummy_sources_name = cmake_target_name + "__dummy_srcs" SetVariable( output, dummy_sources_name, "${obj}.${TOOLSET}/${TARGET}/genc/dummy.c" ) output.write('if(NOT EXISTS "') WriteVariable(output, dummy_sources_name) output.write('")\n') output.write(' file(WRITE "') WriteVariable(output, dummy_sources_name) output.write('" "")\n') output.write("endif()\n") # CMake is opposed to setting linker directories and considers the practice # of setting linker directories dangerous. Instead, it favors the use of # find_library and passing absolute paths to target_link_libraries. # However, CMake does provide the command link_directories, which adds # link directories to targets defined after it is called. # As a result, link_directories must come before the target definition. # CMake unfortunately has no means of removing entries from LINK_DIRECTORIES. library_dirs = config.get("library_dirs") if library_dirs is not None: output.write("link_directories(") for library_dir in library_dirs: output.write(" ") output.write(NormjoinPath(path_from_cmakelists_to_gyp, library_dir)) output.write("\n") output.write(")\n") output.write(cmake_target_type.command) output.write("(") output.write(cmake_target_name) if cmake_target_type.modifier is not None: output.write(" ") output.write(cmake_target_type.modifier) if s_sources_name: WriteVariable(output, s_sources_name, " ") if c_sources_name: WriteVariable(output, c_sources_name, " ") if cxx_sources_name: WriteVariable(output, cxx_sources_name, " ") if linkable_sources_name: WriteVariable(output, linkable_sources_name, " ") if other_sources_name: WriteVariable(output, other_sources_name, " ") if dummy_sources_name: WriteVariable(output, dummy_sources_name, " ") output.write(")\n") # Let CMake know if the 'all' target should depend on this target. exclude_from_all = ( "TRUE" if qualified_target not in all_qualified_targets else "FALSE" ) SetTargetProperty(output, cmake_target_name, "EXCLUDE_FROM_ALL", exclude_from_all) for extra_target_name in extra_deps: SetTargetProperty( output, extra_target_name, "EXCLUDE_FROM_ALL", exclude_from_all ) # Output name and location. if target_type != "none": # Link as 'C' if there are no other files if not c_sources and not cxx_sources: SetTargetProperty(output, cmake_target_name, "LINKER_LANGUAGE", ["C"]) # Mark uncompiled sources as uncompiled. if other_sources_name: output.write("set_source_files_properties(") WriteVariable(output, other_sources_name, "") output.write(' PROPERTIES HEADER_FILE_ONLY "TRUE")\n') # Mark object sources as linkable. if linkable_sources_name: output.write("set_source_files_properties(") WriteVariable(output, other_sources_name, "") output.write(' PROPERTIES EXTERNAL_OBJECT "TRUE")\n') # Output directory target_output_directory = spec.get("product_dir") if target_output_directory is None: if target_type in ("executable", "loadable_module"): target_output_directory = generator_default_variables["PRODUCT_DIR"] elif target_type == "shared_library": target_output_directory = "${builddir}/lib.${TOOLSET}" elif spec.get("standalone_static_library", False): target_output_directory = generator_default_variables["PRODUCT_DIR"] else: base_path = gyp.common.RelativePath( os.path.dirname(gyp_file), options.toplevel_dir ) target_output_directory = "${obj}.${TOOLSET}" target_output_directory = os.path.join( target_output_directory, base_path ) cmake_target_output_directory = NormjoinPathForceCMakeSource( path_from_cmakelists_to_gyp, target_output_directory ) SetTargetProperty( output, cmake_target_name, cmake_target_type.property_modifier + "_OUTPUT_DIRECTORY", cmake_target_output_directory, ) # Output name default_product_prefix = "" default_product_name = target_name default_product_ext = "" if target_type == "static_library": static_library_prefix = generator_default_variables["STATIC_LIB_PREFIX"] default_product_name = RemovePrefix( default_product_name, static_library_prefix ) default_product_prefix = static_library_prefix default_product_ext = generator_default_variables["STATIC_LIB_SUFFIX"] elif target_type in ("loadable_module", "shared_library"): shared_library_prefix = generator_default_variables["SHARED_LIB_PREFIX"] default_product_name = RemovePrefix( default_product_name, shared_library_prefix ) default_product_prefix = shared_library_prefix default_product_ext = generator_default_variables["SHARED_LIB_SUFFIX"] elif target_type != "executable": print( "ERROR: What output file should be generated?", "type", target_type, "target", target_name, ) product_prefix = spec.get("product_prefix", default_product_prefix) product_name = spec.get("product_name", default_product_name) product_ext = spec.get("product_extension") if product_ext: product_ext = "." + product_ext else: product_ext = default_product_ext SetTargetProperty(output, cmake_target_name, "PREFIX", product_prefix) SetTargetProperty( output, cmake_target_name, cmake_target_type.property_modifier + "_OUTPUT_NAME", product_name, ) SetTargetProperty(output, cmake_target_name, "SUFFIX", product_ext) # Make the output of this target referenceable as a source. cmake_target_output_basename = product_prefix + product_name + product_ext cmake_target_output = os.path.join( cmake_target_output_directory, cmake_target_output_basename ) SetFileProperty(output, cmake_target_output, "GENERATED", ["TRUE"], "") # Includes includes = config.get("include_dirs") if includes: # This (target include directories) is what requires CMake 2.8.8 includes_name = cmake_target_name + "__include_dirs" SetVariableList( output, includes_name, [ NormjoinPathForceCMakeSource(path_from_cmakelists_to_gyp, include) for include in includes ], ) output.write("set_property(TARGET ") output.write(cmake_target_name) output.write(" APPEND PROPERTY INCLUDE_DIRECTORIES ") WriteVariable(output, includes_name, "") output.write(")\n") # Defines defines = config.get("defines") if defines is not None: SetTargetProperty( output, cmake_target_name, "COMPILE_DEFINITIONS", defines, ";" ) # Compile Flags - http://www.cmake.org/Bug/view.php?id=6493 # CMake currently does not have target C and CXX flags. # So, instead of doing... # cflags_c = config.get('cflags_c') # if cflags_c is not None: # SetTargetProperty(output, cmake_target_name, # 'C_COMPILE_FLAGS', cflags_c, ' ') # cflags_cc = config.get('cflags_cc') # if cflags_cc is not None: # SetTargetProperty(output, cmake_target_name, # 'CXX_COMPILE_FLAGS', cflags_cc, ' ') # Instead we must... cflags = config.get("cflags", []) cflags_c = config.get("cflags_c", []) cflags_cxx = config.get("cflags_cc", []) if xcode_settings: cflags = xcode_settings.GetCflags(config_to_use) cflags_c = xcode_settings.GetCflagsC(config_to_use) cflags_cxx = xcode_settings.GetCflagsCC(config_to_use) # cflags_objc = xcode_settings.GetCflagsObjC(config_to_use) # cflags_objcc = xcode_settings.GetCflagsObjCC(config_to_use) if (not cflags_c or not c_sources) and (not cflags_cxx or not cxx_sources): SetTargetProperty(output, cmake_target_name, "COMPILE_FLAGS", cflags, " ") elif c_sources and not (s_sources or cxx_sources): flags = [] flags.extend(cflags) flags.extend(cflags_c) SetTargetProperty(output, cmake_target_name, "COMPILE_FLAGS", flags, " ") elif cxx_sources and not (s_sources or c_sources): flags = [] flags.extend(cflags) flags.extend(cflags_cxx) SetTargetProperty(output, cmake_target_name, "COMPILE_FLAGS", flags, " ") else: # TODO: This is broken, one cannot generally set properties on files, # as other targets may require different properties on the same files. if s_sources and cflags: SetFilesProperty(output, s_sources_name, "COMPILE_FLAGS", cflags, " ") if c_sources and (cflags or cflags_c): flags = [] flags.extend(cflags) flags.extend(cflags_c) SetFilesProperty(output, c_sources_name, "COMPILE_FLAGS", flags, " ") if cxx_sources and (cflags or cflags_cxx): flags = [] flags.extend(cflags) flags.extend(cflags_cxx) SetFilesProperty(output, cxx_sources_name, "COMPILE_FLAGS", flags, " ") # Linker flags ldflags = config.get("ldflags") if ldflags is not None: SetTargetProperty(output, cmake_target_name, "LINK_FLAGS", ldflags, " ") # XCode settings xcode_settings = config.get("xcode_settings", {}) for xcode_setting, xcode_value in xcode_settings.items(): SetTargetProperty( output, cmake_target_name, "XCODE_ATTRIBUTE_%s" % xcode_setting, xcode_value, "" if isinstance(xcode_value, str) else " ", ) # Note on Dependencies and Libraries: # CMake wants to handle link order, resolving the link line up front. # Gyp does not retain or enforce specifying enough information to do so. # So do as other gyp generators and use --start-group and --end-group. # Give CMake as little information as possible so that it doesn't mess it up. # Dependencies rawDeps = spec.get("dependencies", []) static_deps = [] shared_deps = [] other_deps = [] for rawDep in rawDeps: dep_cmake_name = namer.CreateCMakeTargetName(rawDep) dep_spec = target_dicts.get(rawDep, {}) dep_target_type = dep_spec.get("type", None) if dep_target_type == "static_library": static_deps.append(dep_cmake_name) elif dep_target_type == "shared_library": shared_deps.append(dep_cmake_name) else: other_deps.append(dep_cmake_name) # ensure all external dependencies are complete before internal dependencies # extra_deps currently only depend on their own deps, so otherwise run early if static_deps or shared_deps or other_deps: for extra_dep in extra_deps: output.write("add_dependencies(") output.write(extra_dep) output.write("\n") for deps in (static_deps, shared_deps, other_deps): for dep in gyp.common.uniquer(deps): output.write(" ") output.write(dep) output.write("\n") output.write(")\n") linkable = target_type in ("executable", "loadable_module", "shared_library") other_deps.extend(extra_deps) if other_deps or (not linkable and (static_deps or shared_deps)): output.write("add_dependencies(") output.write(cmake_target_name) output.write("\n") for dep in gyp.common.uniquer(other_deps): output.write(" ") output.write(dep) output.write("\n") if not linkable: for deps in (static_deps, shared_deps): for lib_dep in gyp.common.uniquer(deps): output.write(" ") output.write(lib_dep) output.write("\n") output.write(")\n") # Libraries if linkable: external_libs = [lib for lib in spec.get("libraries", []) if len(lib) > 0] if external_libs or static_deps or shared_deps: output.write("target_link_libraries(") output.write(cmake_target_name) output.write("\n") if static_deps: write_group = circular_libs and len(static_deps) > 1 and flavor != "mac" if write_group: output.write("-Wl,--start-group\n") for dep in gyp.common.uniquer(static_deps): output.write(" ") output.write(dep) output.write("\n") if write_group: output.write("-Wl,--end-group\n") if shared_deps: for dep in gyp.common.uniquer(shared_deps): output.write(" ") output.write(dep) output.write("\n") if external_libs: for lib in gyp.common.uniquer(external_libs): output.write(' "') output.write(RemovePrefix(lib, "$(SDKROOT)")) output.write('"\n') output.write(")\n") UnsetVariable(output, "TOOLSET") UnsetVariable(output, "TARGET") def GenerateOutputForConfig(target_list, target_dicts, data, params, config_to_use): options = params["options"] generator_flags = params["generator_flags"] flavor = gyp.common.GetFlavor(params) # generator_dir: relative path from pwd to where make puts build files. # Makes migrating from make to cmake easier, cmake doesn't put anything here. # Each Gyp configuration creates a different CMakeLists.txt file # to avoid incompatibilities between Gyp and CMake configurations. generator_dir = os.path.relpath(options.generator_output or ".") # output_dir: relative path from generator_dir to the build directory. output_dir = generator_flags.get("output_dir", "out") # build_dir: relative path from source root to our output files. # e.g. "out/Debug" build_dir = os.path.normpath(os.path.join(generator_dir, output_dir, config_to_use)) toplevel_build = os.path.join(options.toplevel_dir, build_dir) output_file = os.path.join(toplevel_build, "CMakeLists.txt") gyp.common.EnsureDirExists(output_file) output = open(output_file, "w") output.write("cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)\n") output.write("cmake_policy(VERSION 2.8.8)\n") gyp_file, project_target, _ = gyp.common.ParseQualifiedTarget(target_list[-1]) output.write("project(") output.write(project_target) output.write(")\n") SetVariable(output, "configuration", config_to_use) ar = None cc = None cxx = None make_global_settings = data[gyp_file].get("make_global_settings", []) build_to_top = gyp.common.InvertRelativePath(build_dir, options.toplevel_dir) for key, value in make_global_settings: if key == "AR": ar = os.path.join(build_to_top, value) if key == "CC": cc = os.path.join(build_to_top, value) if key == "CXX": cxx = os.path.join(build_to_top, value) ar = gyp.common.GetEnvironFallback(["AR_target", "AR"], ar) cc = gyp.common.GetEnvironFallback(["CC_target", "CC"], cc) cxx = gyp.common.GetEnvironFallback(["CXX_target", "CXX"], cxx) if ar: SetVariable(output, "CMAKE_AR", ar) if cc: SetVariable(output, "CMAKE_C_COMPILER", cc) if cxx: SetVariable(output, "CMAKE_CXX_COMPILER", cxx) # The following appears to be as-yet undocumented. # http://public.kitware.com/Bug/view.php?id=8392 output.write("enable_language(ASM)\n") # ASM-ATT does not support .S files. # output.write('enable_language(ASM-ATT)\n') if cc: SetVariable(output, "CMAKE_ASM_COMPILER", cc) SetVariable(output, "builddir", "${CMAKE_CURRENT_BINARY_DIR}") SetVariable(output, "obj", "${builddir}/obj") output.write("\n") # TODO: Undocumented/unsupported (the CMake Java generator depends on it). # CMake by default names the object resulting from foo.c to be foo.c.o. # Gyp traditionally names the object resulting from foo.c foo.o. # This should be irrelevant, but some targets extract .o files from .a # and depend on the name of the extracted .o files. output.write("set(CMAKE_C_OUTPUT_EXTENSION_REPLACE 1)\n") output.write("set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1)\n") output.write("\n") # Force ninja to use rsp files. Otherwise link and ar lines can get too long, # resulting in 'Argument list too long' errors. # However, rsp files don't work correctly on Mac. if flavor != "mac": output.write("set(CMAKE_NINJA_FORCE_RESPONSE_FILE 1)\n") output.write("\n") namer = CMakeNamer(target_list) # The list of targets upon which the 'all' target should depend. # CMake has it's own implicit 'all' target, one is not created explicitly. all_qualified_targets = set() for build_file in params["build_files"]: for qualified_target in gyp.common.AllTargets( target_list, target_dicts, os.path.normpath(build_file) ): all_qualified_targets.add(qualified_target) for qualified_target in target_list: if flavor == "mac": gyp_file, _, _ = gyp.common.ParseQualifiedTarget(qualified_target) spec = target_dicts[qualified_target] gyp.xcode_emulation.MergeGlobalXcodeSettingsToSpec(data[gyp_file], spec) WriteTarget( namer, qualified_target, target_dicts, build_dir, config_to_use, options, generator_flags, all_qualified_targets, flavor, output, ) output.close() def PerformBuild(data, configurations, params): options = params["options"] generator_flags = params["generator_flags"] # generator_dir: relative path from pwd to where make puts build files. # Makes migrating from make to cmake easier, cmake doesn't put anything here. generator_dir = os.path.relpath(options.generator_output or ".") # output_dir: relative path from generator_dir to the build directory. output_dir = generator_flags.get("output_dir", "out") for config_name in configurations: # build_dir: relative path from source root to our output files. # e.g. "out/Debug" build_dir = os.path.normpath( os.path.join(generator_dir, output_dir, config_name) ) arguments = ["cmake", "-G", "Ninja"] print(f"Generating [{config_name}]: {arguments}") subprocess.check_call(arguments, cwd=build_dir) arguments = ["ninja", "-C", build_dir] print(f"Building [{config_name}]: {arguments}") subprocess.check_call(arguments) def CallGenerateOutputForConfig(arglist): # Ignore the interrupt signal so that the parent process catches it and # kills all multiprocessing children. signal.signal(signal.SIGINT, signal.SIG_IGN) target_list, target_dicts, data, params, config_name = arglist GenerateOutputForConfig(target_list, target_dicts, data, params, config_name) def GenerateOutput(target_list, target_dicts, data, params): user_config = params.get("generator_flags", {}).get("config", None) if user_config: GenerateOutputForConfig(target_list, target_dicts, data, params, user_config) else: config_names = target_dicts[target_list[0]]["configurations"] if params["parallel"]: try: pool = multiprocessing.Pool(len(config_names)) arglists = [] for config_name in config_names: arglists.append( (target_list, target_dicts, data, params, config_name) ) pool.map(CallGenerateOutputForConfig, arglists) except KeyboardInterrupt as e: pool.terminate() raise e else: for config_name in config_names: GenerateOutputForConfig( target_list, target_dicts, data, params, config_name ) # Copyright (c) 2016 Ben Noordhuis . All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import gyp.common import gyp.xcode_emulation import json import os generator_additional_non_configuration_keys = [] generator_additional_path_sections = [] generator_extra_sources_for_rules = [] generator_filelist_paths = None generator_supports_multiple_toolsets = True generator_wants_sorted_dependencies = False # Lifted from make.py. The actual values don't matter much. generator_default_variables = { "CONFIGURATION_NAME": "$(BUILDTYPE)", "EXECUTABLE_PREFIX": "", "EXECUTABLE_SUFFIX": "", "INTERMEDIATE_DIR": "$(obj).$(TOOLSET)/$(TARGET)/geni", "PRODUCT_DIR": "$(builddir)", "RULE_INPUT_DIRNAME": "%(INPUT_DIRNAME)s", "RULE_INPUT_EXT": "$(suffix $<)", "RULE_INPUT_NAME": "$(notdir $<)", "RULE_INPUT_PATH": "$(abspath $<)", "RULE_INPUT_ROOT": "%(INPUT_ROOT)s", "SHARED_INTERMEDIATE_DIR": "$(obj)/gen", "SHARED_LIB_PREFIX": "lib", "STATIC_LIB_PREFIX": "lib", "STATIC_LIB_SUFFIX": ".a", } def IsMac(params): return "mac" == gyp.common.GetFlavor(params) def CalculateVariables(default_variables, params): default_variables.setdefault("OS", gyp.common.GetFlavor(params)) def AddCommandsForTarget(cwd, target, params, per_config_commands): output_dir = params["generator_flags"].get("output_dir", "out") for configuration_name, configuration in target["configurations"].items(): if IsMac(params): xcode_settings = gyp.xcode_emulation.XcodeSettings(target) cflags = xcode_settings.GetCflags(configuration_name) cflags_c = xcode_settings.GetCflagsC(configuration_name) cflags_cc = xcode_settings.GetCflagsCC(configuration_name) else: cflags = configuration.get("cflags", []) cflags_c = configuration.get("cflags_c", []) cflags_cc = configuration.get("cflags_cc", []) cflags_c = cflags + cflags_c cflags_cc = cflags + cflags_cc defines = configuration.get("defines", []) defines = ["-D" + s for s in defines] # TODO(bnoordhuis) Handle generated source files. extensions = (".c", ".cc", ".cpp", ".cxx") sources = [s for s in target.get("sources", []) if s.endswith(extensions)] def resolve(filename): return os.path.abspath(os.path.join(cwd, filename)) # TODO(bnoordhuis) Handle generated header files. include_dirs = configuration.get("include_dirs", []) include_dirs = [s for s in include_dirs if not s.startswith("$(obj)")] includes = ["-I" + resolve(s) for s in include_dirs] defines = gyp.common.EncodePOSIXShellList(defines) includes = gyp.common.EncodePOSIXShellList(includes) cflags_c = gyp.common.EncodePOSIXShellList(cflags_c) cflags_cc = gyp.common.EncodePOSIXShellList(cflags_cc) commands = per_config_commands.setdefault(configuration_name, []) for source in sources: file = resolve(source) isc = source.endswith(".c") cc = "cc" if isc else "c++" cflags = cflags_c if isc else cflags_cc command = " ".join( ( cc, defines, includes, cflags, "-c", gyp.common.EncodePOSIXShellArgument(file), ) ) commands.append(dict(command=command, directory=output_dir, file=file)) def GenerateOutput(target_list, target_dicts, data, params): per_config_commands = {} for qualified_target, target in target_dicts.items(): build_file, target_name, toolset = gyp.common.ParseQualifiedTarget( qualified_target ) if IsMac(params): settings = data[build_file] gyp.xcode_emulation.MergeGlobalXcodeSettingsToSpec(settings, target) cwd = os.path.dirname(build_file) AddCommandsForTarget(cwd, target, params, per_config_commands) output_dir = params["generator_flags"].get("output_dir", "out") for configuration_name, commands in per_config_commands.items(): filename = os.path.join(output_dir, configuration_name, "compile_commands.json") gyp.common.EnsureDirExists(filename) fp = open(filename, "w") json.dump(commands, fp=fp, indent=0, check_circular=False) def PerformBuild(data, configurations, params): pass # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import gyp import gyp.common import gyp.msvs_emulation import json generator_supports_multiple_toolsets = True generator_wants_static_library_dependencies_adjusted = False generator_filelist_paths = {} generator_default_variables = {} for dirname in [ "INTERMEDIATE_DIR", "SHARED_INTERMEDIATE_DIR", "PRODUCT_DIR", "LIB_DIR", "SHARED_LIB_DIR", ]: # Some gyp steps fail if these are empty(!). generator_default_variables[dirname] = "dir" for unused in [ "RULE_INPUT_PATH", "RULE_INPUT_ROOT", "RULE_INPUT_NAME", "RULE_INPUT_DIRNAME", "RULE_INPUT_EXT", "EXECUTABLE_PREFIX", "EXECUTABLE_SUFFIX", "STATIC_LIB_PREFIX", "STATIC_LIB_SUFFIX", "SHARED_LIB_PREFIX", "SHARED_LIB_SUFFIX", "CONFIGURATION_NAME", ]: generator_default_variables[unused] = "" def CalculateVariables(default_variables, params): generator_flags = params.get("generator_flags", {}) for key, val in generator_flags.items(): default_variables.setdefault(key, val) default_variables.setdefault("OS", gyp.common.GetFlavor(params)) flavor = gyp.common.GetFlavor(params) if flavor == "win": gyp.msvs_emulation.CalculateCommonVariables(default_variables, params) def CalculateGeneratorInputInfo(params): """Calculate the generator specific info that gets fed to input (called by gyp).""" generator_flags = params.get("generator_flags", {}) if generator_flags.get("adjust_static_libraries", False): global generator_wants_static_library_dependencies_adjusted generator_wants_static_library_dependencies_adjusted = True toplevel = params["options"].toplevel_dir generator_dir = os.path.relpath(params["options"].generator_output or ".") # output_dir: relative path from generator_dir to the build directory. output_dir = generator_flags.get("output_dir", "out") qualified_out_dir = os.path.normpath( os.path.join(toplevel, generator_dir, output_dir, "gypfiles") ) global generator_filelist_paths generator_filelist_paths = { "toplevel": toplevel, "qualified_out_dir": qualified_out_dir, } def GenerateOutput(target_list, target_dicts, data, params): # Map of target -> list of targets it depends on. edges = {} # Queue of targets to visit. targets_to_visit = target_list[:] while len(targets_to_visit) > 0: target = targets_to_visit.pop() if target in edges: continue edges[target] = [] for dep in target_dicts[target].get("dependencies", []): edges[target].append(dep) targets_to_visit.append(dep) try: filepath = params["generator_flags"]["output_dir"] except KeyError: filepath = "." filename = os.path.join(filepath, "dump.json") f = open(filename, "w") json.dump(edges, f) f.close() print("Wrote json to %s." % filename) # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """GYP backend that generates Eclipse CDT settings files. This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML files that can be imported into an Eclipse CDT project. The XML file contains a list of include paths and symbols (i.e. defines). Because a full .cproject definition is not created by this generator, it's not possible to properly define the include dirs and symbols for each file individually. Instead, one set of includes/symbols is generated for the entire project. This works fairly well (and is a vast improvement in general), but may still result in a few indexer issues here and there. This generator has no automated tests, so expect it to be broken. """ from xml.sax.saxutils import escape import os.path import subprocess import gyp import gyp.common import gyp.msvs_emulation import shlex import xml.etree.cElementTree as ET generator_wants_static_library_dependencies_adjusted = False generator_default_variables = {} for dirname in ["INTERMEDIATE_DIR", "PRODUCT_DIR", "LIB_DIR", "SHARED_LIB_DIR"]: # Some gyp steps fail if these are empty(!), so we convert them to variables generator_default_variables[dirname] = "$" + dirname for unused in [ "RULE_INPUT_PATH", "RULE_INPUT_ROOT", "RULE_INPUT_NAME", "RULE_INPUT_DIRNAME", "RULE_INPUT_EXT", "EXECUTABLE_PREFIX", "EXECUTABLE_SUFFIX", "STATIC_LIB_PREFIX", "STATIC_LIB_SUFFIX", "SHARED_LIB_PREFIX", "SHARED_LIB_SUFFIX", "CONFIGURATION_NAME", ]: generator_default_variables[unused] = "" # Include dirs will occasionally use the SHARED_INTERMEDIATE_DIR variable as # part of the path when dealing with generated headers. This value will be # replaced dynamically for each configuration. generator_default_variables["SHARED_INTERMEDIATE_DIR"] = "$SHARED_INTERMEDIATE_DIR" def CalculateVariables(default_variables, params): generator_flags = params.get("generator_flags", {}) for key, val in generator_flags.items(): default_variables.setdefault(key, val) flavor = gyp.common.GetFlavor(params) default_variables.setdefault("OS", flavor) if flavor == "win": gyp.msvs_emulation.CalculateCommonVariables(default_variables, params) def CalculateGeneratorInputInfo(params): """Calculate the generator specific info that gets fed to input (called by gyp).""" generator_flags = params.get("generator_flags", {}) if generator_flags.get("adjust_static_libraries", False): global generator_wants_static_library_dependencies_adjusted generator_wants_static_library_dependencies_adjusted = True def GetAllIncludeDirectories( target_list, target_dicts, shared_intermediate_dirs, config_name, params, compiler_path, ): """Calculate the set of include directories to be used. Returns: A list including all the include_dir's specified for every target followed by any include directories that were added as cflag compiler options. """ gyp_includes_set = set() compiler_includes_list = [] # Find compiler's default include dirs. if compiler_path: command = shlex.split(compiler_path) command.extend(["-E", "-xc++", "-v", "-"]) proc = subprocess.Popen( args=command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, ) output = proc.communicate()[1].decode("utf-8") # Extract the list of include dirs from the output, which has this format: # ... # #include "..." search starts here: # #include <...> search starts here: # /usr/include/c++/4.6 # /usr/local/include # End of search list. # ... in_include_list = False for line in output.splitlines(): if line.startswith("#include"): in_include_list = True continue if line.startswith("End of search list."): break if in_include_list: include_dir = line.strip() if include_dir not in compiler_includes_list: compiler_includes_list.append(include_dir) flavor = gyp.common.GetFlavor(params) if flavor == "win": generator_flags = params.get("generator_flags", {}) for target_name in target_list: target = target_dicts[target_name] if config_name in target["configurations"]: config = target["configurations"][config_name] # Look for any include dirs that were explicitly added via cflags. This # may be done in gyp files to force certain includes to come at the end. # TODO(jgreenwald): Change the gyp files to not abuse cflags for this, and # remove this. if flavor == "win": msvs_settings = gyp.msvs_emulation.MsvsSettings(target, generator_flags) cflags = msvs_settings.GetCflags(config_name) else: cflags = config["cflags"] for cflag in cflags: if cflag.startswith("-I"): include_dir = cflag[2:] if include_dir not in compiler_includes_list: compiler_includes_list.append(include_dir) # Find standard gyp include dirs. if "include_dirs" in config: include_dirs = config["include_dirs"] for shared_intermediate_dir in shared_intermediate_dirs: for include_dir in include_dirs: include_dir = include_dir.replace( "$SHARED_INTERMEDIATE_DIR", shared_intermediate_dir ) if not os.path.isabs(include_dir): base_dir = os.path.dirname(target_name) include_dir = base_dir + "/" + include_dir include_dir = os.path.abspath(include_dir) gyp_includes_set.add(include_dir) # Generate a list that has all the include dirs. all_includes_list = list(gyp_includes_set) all_includes_list.sort() for compiler_include in compiler_includes_list: if compiler_include not in gyp_includes_set: all_includes_list.append(compiler_include) # All done. return all_includes_list def GetCompilerPath(target_list, data, options): """Determine a command that can be used to invoke the compiler. Returns: If this is a gyp project that has explicit make settings, try to determine the compiler from that. Otherwise, see if a compiler was specified via the CC_target environment variable. """ # First, see if the compiler is configured in make's settings. build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) make_global_settings_dict = data[build_file].get("make_global_settings", {}) for key, value in make_global_settings_dict: if key in ["CC", "CXX"]: return os.path.join(options.toplevel_dir, value) # Check to see if the compiler was specified as an environment variable. for key in ["CC_target", "CC", "CXX"]: compiler = os.environ.get(key) if compiler: return compiler return "gcc" def GetAllDefines(target_list, target_dicts, data, config_name, params, compiler_path): """Calculate the defines for a project. Returns: A dict that includes explicit defines declared in gyp files along with all of the default defines that the compiler uses. """ # Get defines declared in the gyp files. all_defines = {} flavor = gyp.common.GetFlavor(params) if flavor == "win": generator_flags = params.get("generator_flags", {}) for target_name in target_list: target = target_dicts[target_name] if flavor == "win": msvs_settings = gyp.msvs_emulation.MsvsSettings(target, generator_flags) extra_defines = msvs_settings.GetComputedDefines(config_name) else: extra_defines = [] if config_name in target["configurations"]: config = target["configurations"][config_name] target_defines = config["defines"] else: target_defines = [] for define in target_defines + extra_defines: split_define = define.split("=", 1) if len(split_define) == 1: split_define.append("1") if split_define[0].strip() in all_defines: # Already defined continue all_defines[split_define[0].strip()] = split_define[1].strip() # Get default compiler defines (if possible). if flavor == "win": return all_defines # Default defines already processed in the loop above. if compiler_path: command = shlex.split(compiler_path) command.extend(["-E", "-dM", "-"]) cpp_proc = subprocess.Popen( args=command, cwd=".", stdin=subprocess.PIPE, stdout=subprocess.PIPE ) cpp_output = cpp_proc.communicate()[0].decode("utf-8") cpp_lines = cpp_output.split("\n") for cpp_line in cpp_lines: if not cpp_line.strip(): continue cpp_line_parts = cpp_line.split(" ", 2) key = cpp_line_parts[1] if len(cpp_line_parts) >= 3: val = cpp_line_parts[2] else: val = "1" all_defines[key] = val return all_defines def WriteIncludePaths(out, eclipse_langs, include_dirs): """Write the includes section of a CDT settings export file.""" out.write( '
\n' ) out.write(' \n') for lang in eclipse_langs: out.write(' \n' % lang) for include_dir in include_dirs: out.write( ' %s\n' % include_dir ) out.write(" \n") out.write("
\n") def WriteMacros(out, eclipse_langs, defines): """Write the macros section of a CDT settings export file.""" out.write( '
\n' ) out.write(' \n') for lang in eclipse_langs: out.write(' \n' % lang) for key in sorted(defines): out.write( " %s%s\n" % (escape(key), escape(defines[key])) ) out.write(" \n") out.write("
\n") def GenerateOutputForConfig(target_list, target_dicts, data, params, config_name): options = params["options"] generator_flags = params.get("generator_flags", {}) # build_dir: relative path from source root to our output files. # e.g. "out/Debug" build_dir = os.path.join(generator_flags.get("output_dir", "out"), config_name) toplevel_build = os.path.join(options.toplevel_dir, build_dir) # Ninja uses out/Debug/gen while make uses out/Debug/obj/gen as the # SHARED_INTERMEDIATE_DIR. Include both possible locations. shared_intermediate_dirs = [ os.path.join(toplevel_build, "obj", "gen"), os.path.join(toplevel_build, "gen"), ] GenerateCdtSettingsFile( target_list, target_dicts, data, params, config_name, os.path.join(toplevel_build, "eclipse-cdt-settings.xml"), options, shared_intermediate_dirs, ) GenerateClasspathFile( target_list, target_dicts, options.toplevel_dir, toplevel_build, os.path.join(toplevel_build, "eclipse-classpath.xml"), ) def GenerateCdtSettingsFile( target_list, target_dicts, data, params, config_name, out_name, options, shared_intermediate_dirs, ): gyp.common.EnsureDirExists(out_name) with open(out_name, "w") as out: out.write('\n') out.write("\n") eclipse_langs = [ "C++ Source File", "C Source File", "Assembly Source File", "GNU C++", "GNU C", "Assembly", ] compiler_path = GetCompilerPath(target_list, data, options) include_dirs = GetAllIncludeDirectories( target_list, target_dicts, shared_intermediate_dirs, config_name, params, compiler_path, ) WriteIncludePaths(out, eclipse_langs, include_dirs) defines = GetAllDefines( target_list, target_dicts, data, config_name, params, compiler_path ) WriteMacros(out, eclipse_langs, defines) out.write("\n") def GenerateClasspathFile( target_list, target_dicts, toplevel_dir, toplevel_build, out_name ): """Generates a classpath file suitable for symbol navigation and code completion of Java code (such as in Android projects) by finding all .java and .jar files used as action inputs.""" gyp.common.EnsureDirExists(out_name) result = ET.Element("classpath") def AddElements(kind, paths): # First, we need to normalize the paths so they are all relative to the # toplevel dir. rel_paths = set() for path in paths: if os.path.isabs(path): rel_paths.add(os.path.relpath(path, toplevel_dir)) else: rel_paths.add(path) for path in sorted(rel_paths): entry_element = ET.SubElement(result, "classpathentry") entry_element.set("kind", kind) entry_element.set("path", path) AddElements("lib", GetJavaJars(target_list, target_dicts, toplevel_dir)) AddElements("src", GetJavaSourceDirs(target_list, target_dicts, toplevel_dir)) # Include the standard JRE container and a dummy out folder AddElements("con", ["org.eclipse.jdt.launching.JRE_CONTAINER"]) # Include a dummy out folder so that Eclipse doesn't use the default /bin # folder in the root of the project. AddElements("output", [os.path.join(toplevel_build, ".eclipse-java-build")]) ET.ElementTree(result).write(out_name) def GetJavaJars(target_list, target_dicts, toplevel_dir): """Generates a sequence of all .jars used as inputs.""" for target_name in target_list: target = target_dicts[target_name] for action in target.get("actions", []): for input_ in action["inputs"]: if os.path.splitext(input_)[1] == ".jar" and not input_.startswith("$"): if os.path.isabs(input_): yield input_ else: yield os.path.join(os.path.dirname(target_name), input_) def GetJavaSourceDirs(target_list, target_dicts, toplevel_dir): """Generates a sequence of all likely java package root directories.""" for target_name in target_list: target = target_dicts[target_name] for action in target.get("actions", []): for input_ in action["inputs"]: if os.path.splitext(input_)[1] == ".java" and not input_.startswith( "$" ): dir_ = os.path.dirname( os.path.join(os.path.dirname(target_name), input_) ) # If there is a parent 'src' or 'java' folder, navigate up to it - # these are canonical package root names in Chromium. This will # break if 'src' or 'java' exists in the package structure. This # could be further improved by inspecting the java file for the # package name if this proves to be too fragile in practice. parent_search = dir_ while os.path.basename(parent_search) not in ["src", "java"]: parent_search, _ = os.path.split(parent_search) if not parent_search or parent_search == toplevel_dir: # Didn't find a known root, just return the original path yield dir_ break else: yield parent_search def GenerateOutput(target_list, target_dicts, data, params): """Generate an XML settings file that can be imported into a CDT project.""" if params["options"].generator_output: raise NotImplementedError("--generator_output not implemented for eclipse") user_config = params.get("generator_flags", {}).get("config", None) if user_config: GenerateOutputForConfig(target_list, target_dicts, data, params, user_config) else: config_names = target_dicts[target_list[0]]["configurations"] for config_name in config_names: GenerateOutputForConfig( target_list, target_dicts, data, params, config_name ) # Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """gypd output module This module produces gyp input as its output. Output files are given the .gypd extension to avoid overwriting the .gyp files that they are generated from. Internal references to .gyp files (such as those found in "dependencies" sections) are not adjusted to point to .gypd files instead; unlike other paths, which are relative to the .gyp or .gypd file, such paths are relative to the directory from which gyp was run to create the .gypd file. This generator module is intended to be a sample and a debugging aid, hence the "d" for "debug" in .gypd. It is useful to inspect the results of the various merges, expansions, and conditional evaluations performed by gyp and to see a representation of what would be fed to a generator module. It's not advisable to rename .gypd files produced by this module to .gyp, because they will have all merges, expansions, and evaluations already performed and the relevant constructs not present in the output; paths to dependencies may be wrong; and various sections that do not belong in .gyp files such as such as "included_files" and "*_excluded" will be present. Output will also be stripped of comments. This is not intended to be a general-purpose gyp pretty-printer; for that, you probably just want to run "pprint.pprint(eval(open('source.gyp').read()))", which will still strip comments but won't do all of the other things done to this module's output. The specific formatting of the output generated by this module is subject to change. """ import gyp.common import pprint # These variables should just be spit back out as variable references. _generator_identity_variables = [ "CONFIGURATION_NAME", "EXECUTABLE_PREFIX", "EXECUTABLE_SUFFIX", "INTERMEDIATE_DIR", "LIB_DIR", "PRODUCT_DIR", "RULE_INPUT_ROOT", "RULE_INPUT_DIRNAME", "RULE_INPUT_EXT", "RULE_INPUT_NAME", "RULE_INPUT_PATH", "SHARED_INTERMEDIATE_DIR", "SHARED_LIB_DIR", "SHARED_LIB_PREFIX", "SHARED_LIB_SUFFIX", "STATIC_LIB_PREFIX", "STATIC_LIB_SUFFIX", ] # gypd doesn't define a default value for OS like many other generator # modules. Specify "-D OS=whatever" on the command line to provide a value. generator_default_variables = {} # gypd supports multiple toolsets generator_supports_multiple_toolsets = True # TODO(mark): This always uses <, which isn't right. The input module should # notify the generator to tell it which phase it is operating in, and this # module should use < for the early phase and then switch to > for the late # phase. Bonus points for carrying @ back into the output too. for v in _generator_identity_variables: generator_default_variables[v] = "<(%s)" % v def GenerateOutput(target_list, target_dicts, data, params): output_files = {} for qualified_target in target_list: [input_file, target] = gyp.common.ParseQualifiedTarget(qualified_target)[0:2] if input_file[-4:] != ".gyp": continue input_file_stem = input_file[:-4] output_file = input_file_stem + params["options"].suffix + ".gypd" output_files[output_file] = output_files.get(output_file, input_file) for output_file, input_file in output_files.items(): output = open(output_file, "w") pprint.pprint(data[input_file], output) output.close() # Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """gypsh output module gypsh is a GYP shell. It's not really a generator per se. All it does is fire up an interactive Python session with a few local variables set to the variables passed to the generator. Like gypd, it's intended as a debugging aid, to facilitate the exploration of .gyp structures after being processed by the input module. The expected usage is "gyp -f gypsh -D OS=desired_os". """ import code import sys # All of this stuff about generator variables was lovingly ripped from gypd.py. # That module has a much better description of what's going on and why. _generator_identity_variables = [ "EXECUTABLE_PREFIX", "EXECUTABLE_SUFFIX", "INTERMEDIATE_DIR", "PRODUCT_DIR", "RULE_INPUT_ROOT", "RULE_INPUT_DIRNAME", "RULE_INPUT_EXT", "RULE_INPUT_NAME", "RULE_INPUT_PATH", "SHARED_INTERMEDIATE_DIR", ] generator_default_variables = {} for v in _generator_identity_variables: generator_default_variables[v] = "<(%s)" % v def GenerateOutput(target_list, target_dicts, data, params): locals = { "target_list": target_list, "target_dicts": target_dicts, "data": data, } # Use a banner that looks like the stock Python one and like what # code.interact uses by default, but tack on something to indicate what # locals are available, and identify gypsh. banner = "Python {} on {}\nlocals.keys() = {}\ngypsh".format( sys.version, sys.platform, repr(sorted(locals.keys())), ) code.interact(banner, local=locals) # Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Notes: # # This is all roughly based on the Makefile system used by the Linux # kernel, but is a non-recursive make -- we put the entire dependency # graph in front of make and let it figure it out. # # The code below generates a separate .mk file for each target, but # all are sourced by the top-level Makefile. This means that all # variables in .mk-files clobber one another. Be careful to use := # where appropriate for immediate evaluation, and similarly to watch # that you're not relying on a variable value to last between different # .mk files. # # TODOs: # # Global settings and utility functions are currently stuffed in the # toplevel Makefile. It may make sense to generate some .mk files on # the side to keep the files readable. import os import re import subprocess import gyp import gyp.common import gyp.xcode_emulation from gyp.common import GetEnvironFallback import hashlib generator_default_variables = { "EXECUTABLE_PREFIX": "", "EXECUTABLE_SUFFIX": "", "STATIC_LIB_PREFIX": "lib", "SHARED_LIB_PREFIX": "lib", "STATIC_LIB_SUFFIX": ".a", "INTERMEDIATE_DIR": "$(obj).$(TOOLSET)/$(TARGET)/geni", "SHARED_INTERMEDIATE_DIR": "$(obj)/gen", "PRODUCT_DIR": "$(builddir)", "RULE_INPUT_ROOT": "%(INPUT_ROOT)s", # This gets expanded by Python. "RULE_INPUT_DIRNAME": "%(INPUT_DIRNAME)s", # This gets expanded by Python. "RULE_INPUT_PATH": "$(abspath $<)", "RULE_INPUT_EXT": "$(suffix $<)", "RULE_INPUT_NAME": "$(notdir $<)", "CONFIGURATION_NAME": "$(BUILDTYPE)", } # Make supports multiple toolsets generator_supports_multiple_toolsets = True # Request sorted dependencies in the order from dependents to dependencies. generator_wants_sorted_dependencies = False # Placates pylint. generator_additional_non_configuration_keys = [] generator_additional_path_sections = [] generator_extra_sources_for_rules = [] generator_filelist_paths = None def CalculateVariables(default_variables, params): """Calculate additional variables for use in the build (called by gyp).""" flavor = gyp.common.GetFlavor(params) if flavor == "mac": default_variables.setdefault("OS", "mac") default_variables.setdefault("SHARED_LIB_SUFFIX", ".dylib") default_variables.setdefault( "SHARED_LIB_DIR", generator_default_variables["PRODUCT_DIR"] ) default_variables.setdefault( "LIB_DIR", generator_default_variables["PRODUCT_DIR"] ) # Copy additional generator configuration data from Xcode, which is shared # by the Mac Make generator. import gyp.generator.xcode as xcode_generator global generator_additional_non_configuration_keys generator_additional_non_configuration_keys = getattr( xcode_generator, "generator_additional_non_configuration_keys", [] ) global generator_additional_path_sections generator_additional_path_sections = getattr( xcode_generator, "generator_additional_path_sections", [] ) global generator_extra_sources_for_rules generator_extra_sources_for_rules = getattr( xcode_generator, "generator_extra_sources_for_rules", [] ) COMPILABLE_EXTENSIONS.update({".m": "objc", ".mm": "objcxx"}) else: operating_system = flavor if flavor == "android": operating_system = "linux" # Keep this legacy behavior for now. default_variables.setdefault("OS", operating_system) if flavor == "aix": default_variables.setdefault("SHARED_LIB_SUFFIX", ".a") else: default_variables.setdefault("SHARED_LIB_SUFFIX", ".so") default_variables.setdefault("SHARED_LIB_DIR", "$(builddir)/lib.$(TOOLSET)") default_variables.setdefault("LIB_DIR", "$(obj).$(TOOLSET)") def CalculateGeneratorInputInfo(params): """Calculate the generator specific info that gets fed to input (called by gyp).""" generator_flags = params.get("generator_flags", {}) android_ndk_version = generator_flags.get("android_ndk_version", None) # Android NDK requires a strict link order. if android_ndk_version: global generator_wants_sorted_dependencies generator_wants_sorted_dependencies = True output_dir = params["options"].generator_output or params["options"].toplevel_dir builddir_name = generator_flags.get("output_dir", "out") qualified_out_dir = os.path.normpath( os.path.join(output_dir, builddir_name, "gypfiles") ) global generator_filelist_paths generator_filelist_paths = { "toplevel": params["options"].toplevel_dir, "qualified_out_dir": qualified_out_dir, } # The .d checking code below uses these functions: # wildcard, sort, foreach, shell, wordlist # wildcard can handle spaces, the rest can't. # Since I could find no way to make foreach work with spaces in filenames # correctly, the .d files have spaces replaced with another character. The .d # file for # Chromium\ Framework.framework/foo # is for example # out/Release/.deps/out/Release/Chromium?Framework.framework/foo # This is the replacement character. SPACE_REPLACEMENT = "?" LINK_COMMANDS_LINUX = """\ quiet_cmd_alink = AR($(TOOLSET)) $@ cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^) quiet_cmd_alink_thin = AR($(TOOLSET)) $@ cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^) # Due to circular dependencies between libraries :(, we wrap the # special "figure out circular dependencies" flags around the entire # input list during linking. quiet_cmd_link = LINK($(TOOLSET)) $@ cmd_link = $(LINK.$(TOOLSET)) -o $@ $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,--start-group $(LD_INPUTS) $(LIBS) -Wl,--end-group # We support two kinds of shared objects (.so): # 1) shared_library, which is just bundling together many dependent libraries # into a link line. # 2) loadable_module, which is generating a module intended for dlopen(). # # They differ only slightly: # In the former case, we want to package all dependent code into the .so. # In the latter case, we want to package just the API exposed by the # outermost module. # This means shared_library uses --whole-archive, while loadable_module doesn't. # (Note that --whole-archive is incompatible with the --start-group used in # normal linking.) # Other shared-object link notes: # - Set SONAME to the library filename so our binaries don't reference # the local, absolute paths used on the link command-line. quiet_cmd_solink = SOLINK($(TOOLSET)) $@ cmd_solink = $(LINK.$(TOOLSET)) -o $@ -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS) quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ cmd_solink_module = $(LINK.$(TOOLSET)) -o $@ -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS) """ # noqa: E501 LINK_COMMANDS_MAC = """\ quiet_cmd_alink = LIBTOOL-STATIC $@ cmd_alink = rm -f $@ && ./gyp-mac-tool filter-libtool libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %.o,$^) quiet_cmd_link = LINK($(TOOLSET)) $@ cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS) quiet_cmd_solink = SOLINK($(TOOLSET)) $@ cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS) quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ cmd_solink_module = $(LINK.$(TOOLSET)) -bundle $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) """ # noqa: E501 LINK_COMMANDS_ANDROID = """\ quiet_cmd_alink = AR($(TOOLSET)) $@ cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^) quiet_cmd_alink_thin = AR($(TOOLSET)) $@ cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^) # Due to circular dependencies between libraries :(, we wrap the # special "figure out circular dependencies" flags around the entire # input list during linking. quiet_cmd_link = LINK($(TOOLSET)) $@ quiet_cmd_link_host = LINK($(TOOLSET)) $@ cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS) cmd_link_host = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS) # Other shared-object link notes: # - Set SONAME to the library filename so our binaries don't reference # the local, absolute paths used on the link command-line. quiet_cmd_solink = SOLINK($(TOOLSET)) $@ cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS) quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS) quiet_cmd_solink_module_host = SOLINK_MODULE($(TOOLSET)) $@ cmd_solink_module_host = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) """ # noqa: E501 LINK_COMMANDS_AIX = """\ quiet_cmd_alink = AR($(TOOLSET)) $@ cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^) quiet_cmd_alink_thin = AR($(TOOLSET)) $@ cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^) quiet_cmd_link = LINK($(TOOLSET)) $@ cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) quiet_cmd_solink = SOLINK($(TOOLSET)) $@ cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) """ # noqa: E501 LINK_COMMANDS_OS390 = """\ quiet_cmd_alink = AR($(TOOLSET)) $@ cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^) quiet_cmd_alink_thin = AR($(TOOLSET)) $@ cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^) quiet_cmd_link = LINK($(TOOLSET)) $@ cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) quiet_cmd_solink = SOLINK($(TOOLSET)) $@ cmd_solink = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) -Wl,DLL quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ cmd_solink_module = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) -Wl,DLL """ # noqa: E501 # Header of toplevel Makefile. # This should go into the build tree, but it's easier to keep it here for now. SHARED_HEADER = ( """\ # We borrow heavily from the kernel build setup, though we are simpler since # we don't have Kconfig tweaking settings on us. # The implicit make rules have it looking for RCS files, among other things. # We instead explicitly write all the rules we care about. # It's even quicker (saves ~200ms) to pass -r on the command line. MAKEFLAGS=-r # The source directory tree. srcdir := %(srcdir)s abs_srcdir := $(abspath $(srcdir)) # The name of the builddir. builddir_name ?= %(builddir)s # The V=1 flag on command line makes us verbosely print command lines. ifdef V quiet= else quiet=quiet_ endif # Specify BUILDTYPE=Release on the command line for a release build. BUILDTYPE ?= %(default_configuration)s # Directory all our build output goes into. # Note that this must be two directories beneath src/ for unit tests to pass, # as they reach into the src/ directory for data with relative paths. builddir ?= $(builddir_name)/$(BUILDTYPE) abs_builddir := $(abspath $(builddir)) depsdir := $(builddir)/.deps # Object output directory. obj := $(builddir)/obj abs_obj := $(abspath $(obj)) # We build up a list of every single one of the targets so we can slurp in the # generated dependency rule Makefiles in one pass. all_deps := %(make_global_settings)s CC.target ?= %(CC.target)s CFLAGS.target ?= $(CPPFLAGS) $(CFLAGS) CXX.target ?= %(CXX.target)s CXXFLAGS.target ?= $(CPPFLAGS) $(CXXFLAGS) LINK.target ?= %(LINK.target)s LDFLAGS.target ?= $(LDFLAGS) AR.target ?= $(AR) # C++ apps need to be linked with g++. LINK ?= $(CXX.target) # TODO(evan): move all cross-compilation logic to gyp-time so we don't need # to replicate this environment fallback in make as well. CC.host ?= %(CC.host)s CFLAGS.host ?= $(CPPFLAGS_host) $(CFLAGS_host) CXX.host ?= %(CXX.host)s CXXFLAGS.host ?= $(CPPFLAGS_host) $(CXXFLAGS_host) LINK.host ?= %(LINK.host)s LDFLAGS.host ?= $(LDFLAGS_host) AR.host ?= %(AR.host)s # Define a dir function that can handle spaces. # http://www.gnu.org/software/make/manual/make.html#Syntax-of-Functions # "leading spaces cannot appear in the text of the first argument as written. # These characters can be put into the argument value by variable substitution." empty := space := $(empty) $(empty) # http://stackoverflow.com/questions/1189781/using-make-dir-or-notdir-on-a-path-with-spaces replace_spaces = $(subst $(space),""" + SPACE_REPLACEMENT + """,$1) unreplace_spaces = $(subst """ + SPACE_REPLACEMENT + """,$(space),$1) dirx = $(call unreplace_spaces,$(dir $(call replace_spaces,$1))) # Flags to make gcc output dependency info. Note that you need to be # careful here to use the flags that ccache and distcc can understand. # We write to a dep file on the side first and then rename at the end # so we can't end up with a broken dep file. depfile = $(depsdir)/$(call replace_spaces,$@).d DEPFLAGS = %(makedep_args)s -MF $(depfile).raw # We have to fixup the deps output in a few ways. # (1) the file output should mention the proper .o file. # ccache or distcc lose the path to the target, so we convert a rule of # the form: # foobar.o: DEP1 DEP2 # into # path/to/foobar.o: DEP1 DEP2 # (2) we want missing files not to cause us to fail to build. # We want to rewrite # foobar.o: DEP1 DEP2 \\ # DEP3 # to # DEP1: # DEP2: # DEP3: # so if the files are missing, they're just considered phony rules. # We have to do some pretty insane escaping to get those backslashes # and dollar signs past make, the shell, and sed at the same time. # Doesn't work with spaces, but that's fine: .d files have spaces in # their names replaced with other characters.""" r""" define fixup_dep # The depfile may not exist if the input file didn't have any #includes. touch $(depfile).raw # Fixup path as in (1). sed -e "s|^$(notdir $@)|$@|" $(depfile).raw >> $(depfile) # Add extra rules as in (2). # We remove slashes and replace spaces with new lines; # remove blank lines; # delete the first line and append a colon to the remaining lines. sed -e 's|\\||' -e 'y| |\n|' $(depfile).raw |\ grep -v '^$$' |\ sed -e 1d -e 's|$$|:|' \ >> $(depfile) rm $(depfile).raw endef """ """ # Command definitions: # - cmd_foo is the actual command to run; # - quiet_cmd_foo is the brief-output summary of the command. quiet_cmd_cc = CC($(TOOLSET)) $@ cmd_cc = $(CC.$(TOOLSET)) -o $@ $< $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c quiet_cmd_cxx = CXX($(TOOLSET)) $@ cmd_cxx = $(CXX.$(TOOLSET)) -o $@ $< $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c %(extra_commands)s quiet_cmd_touch = TOUCH $@ cmd_touch = touch $@ quiet_cmd_copy = COPY $@ # send stderr to /dev/null to ignore messages when linking directories. cmd_copy = ln -f "$<" "$@" 2>/dev/null || (rm -rf "$@" && cp %(copy_archive_args)s "$<" "$@") %(link_commands)s """ # noqa: E501 r""" # Define an escape_quotes function to escape single quotes. # This allows us to handle quotes properly as long as we always use # use single quotes and escape_quotes. escape_quotes = $(subst ','\'',$(1)) # This comment is here just to include a ' to unconfuse syntax highlighting. # Define an escape_vars function to escape '$' variable syntax. # This allows us to read/write command lines with shell variables (e.g. # $LD_LIBRARY_PATH), without triggering make substitution. escape_vars = $(subst $$,$$$$,$(1)) # Helper that expands to a shell command to echo a string exactly as it is in # make. This uses printf instead of echo because printf's behaviour with respect # to escape sequences is more portable than echo's across different shells # (e.g., dash, bash). exact_echo = printf '%%s\n' '$(call escape_quotes,$(1))' """ """ # Helper to compare the command we're about to run against the command # we logged the last time we ran the command. Produces an empty # string (false) when the commands match. # Tricky point: Make has no string-equality test function. # The kernel uses the following, but it seems like it would have false # positives, where one string reordered its arguments. # arg_check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \\ # $(filter-out $(cmd_$@), $(cmd_$(1)))) # We instead substitute each for the empty string into the other, and # say they're equal if both substitutions produce the empty string. # .d files contain """ + SPACE_REPLACEMENT + """ instead of spaces, take that into account. command_changed = $(or $(subst $(cmd_$(1)),,$(cmd_$(call replace_spaces,$@))),\\ $(subst $(cmd_$(call replace_spaces,$@)),,$(cmd_$(1)))) # Helper that is non-empty when a prerequisite changes. # Normally make does this implicitly, but we force rules to always run # so we can check their command lines. # $? -- new prerequisites # $| -- order-only dependencies prereq_changed = $(filter-out FORCE_DO_CMD,$(filter-out $|,$?)) # Helper that executes all postbuilds until one fails. define do_postbuilds @E=0;\\ for p in $(POSTBUILDS); do\\ eval $$p;\\ E=$$?;\\ if [ $$E -ne 0 ]; then\\ break;\\ fi;\\ done;\\ if [ $$E -ne 0 ]; then\\ rm -rf "$@";\\ exit $$E;\\ fi endef # do_cmd: run a command via the above cmd_foo names, if necessary. # Should always run for a given target to handle command-line changes. # Second argument, if non-zero, makes it do asm/C/C++ dependency munging. # Third argument, if non-zero, makes it do POSTBUILDS processing. # Note: We intentionally do NOT call dirx for depfile, since it contains """ + SPACE_REPLACEMENT + """ for # spaces already and dirx strips the """ + SPACE_REPLACEMENT + """ characters. define do_cmd $(if $(or $(command_changed),$(prereq_changed)), @$(call exact_echo, $($(quiet)cmd_$(1))) @mkdir -p "$(call dirx,$@)" "$(dir $(depfile))" $(if $(findstring flock,$(word %(flock_index)d,$(cmd_$1))), @$(cmd_$(1)) @echo " $(quiet_cmd_$(1)): Finished", @$(cmd_$(1)) ) @$(call exact_echo,$(call escape_vars,cmd_$(call replace_spaces,$@) := $(cmd_$(1)))) > $(depfile) @$(if $(2),$(fixup_dep)) $(if $(and $(3), $(POSTBUILDS)), $(call do_postbuilds) ) ) endef # Declare the "%(default_target)s" target first so it is the default, # even though we don't have the deps yet. .PHONY: %(default_target)s %(default_target)s: # make looks for ways to re-generate included makefiles, but in our case, we # don't have a direct way. Explicitly telling make that it has nothing to do # for them makes it go faster. %%.d: ; # Use FORCE_DO_CMD to force a target to run. Should be coupled with # do_cmd. .PHONY: FORCE_DO_CMD FORCE_DO_CMD: """ # noqa: E501 ) SHARED_HEADER_MAC_COMMANDS = """ quiet_cmd_objc = CXX($(TOOLSET)) $@ cmd_objc = $(CC.$(TOOLSET)) $(GYP_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $< quiet_cmd_objcxx = CXX($(TOOLSET)) $@ cmd_objcxx = $(CXX.$(TOOLSET)) $(GYP_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $< # Commands for precompiled header files. quiet_cmd_pch_c = CXX($(TOOLSET)) $@ cmd_pch_c = $(CC.$(TOOLSET)) $(GYP_PCH_CFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< quiet_cmd_pch_cc = CXX($(TOOLSET)) $@ cmd_pch_cc = $(CC.$(TOOLSET)) $(GYP_PCH_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< quiet_cmd_pch_m = CXX($(TOOLSET)) $@ cmd_pch_m = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $< quiet_cmd_pch_mm = CXX($(TOOLSET)) $@ cmd_pch_mm = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $< # gyp-mac-tool is written next to the root Makefile by gyp. # Use $(4) for the command, since $(2) and $(3) are used as flag by do_cmd # already. quiet_cmd_mac_tool = MACTOOL $(4) $< cmd_mac_tool = ./gyp-mac-tool $(4) $< "$@" quiet_cmd_mac_package_framework = PACKAGE FRAMEWORK $@ cmd_mac_package_framework = ./gyp-mac-tool package-framework "$@" $(4) quiet_cmd_infoplist = INFOPLIST $@ cmd_infoplist = $(CC.$(TOOLSET)) -E -P -Wno-trigraphs -x c $(INFOPLIST_DEFINES) "$<" -o "$@" """ # noqa: E501 def WriteRootHeaderSuffixRules(writer): extensions = sorted(COMPILABLE_EXTENSIONS.keys(), key=str.lower) writer.write("# Suffix rules, putting all outputs into $(obj).\n") for ext in extensions: writer.write("$(obj).$(TOOLSET)/%%.o: $(srcdir)/%%%s FORCE_DO_CMD\n" % ext) writer.write("\t@$(call do_cmd,%s,1)\n" % COMPILABLE_EXTENSIONS[ext]) writer.write("\n# Try building from generated source, too.\n") for ext in extensions: writer.write( "$(obj).$(TOOLSET)/%%.o: $(obj).$(TOOLSET)/%%%s FORCE_DO_CMD\n" % ext ) writer.write("\t@$(call do_cmd,%s,1)\n" % COMPILABLE_EXTENSIONS[ext]) writer.write("\n") for ext in extensions: writer.write("$(obj).$(TOOLSET)/%%.o: $(obj)/%%%s FORCE_DO_CMD\n" % ext) writer.write("\t@$(call do_cmd,%s,1)\n" % COMPILABLE_EXTENSIONS[ext]) writer.write("\n") SHARED_HEADER_SUFFIX_RULES_COMMENT1 = """\ # Suffix rules, putting all outputs into $(obj). """ SHARED_HEADER_SUFFIX_RULES_COMMENT2 = """\ # Try building from generated source, too. """ SHARED_FOOTER = """\ # "all" is a concatenation of the "all" targets from all the included # sub-makefiles. This is just here to clarify. all: # Add in dependency-tracking rules. $(all_deps) is the list of every single # target in our tree. Only consider the ones with .d (dependency) info: d_files := $(wildcard $(foreach f,$(all_deps),$(depsdir)/$(f).d)) ifneq ($(d_files),) include $(d_files) endif """ header = """\ # This file is generated by gyp; do not edit. """ # Maps every compilable file extension to the do_cmd that compiles it. COMPILABLE_EXTENSIONS = { ".c": "cc", ".cc": "cxx", ".cpp": "cxx", ".cxx": "cxx", ".s": "cc", ".S": "cc", } def Compilable(filename): """Return true if the file is compilable (should be in OBJS).""" for res in (filename.endswith(e) for e in COMPILABLE_EXTENSIONS): if res: return True return False def Linkable(filename): """Return true if the file is linkable (should be on the link line).""" return filename.endswith(".o") def Target(filename): """Translate a compilable filename to its .o target.""" return os.path.splitext(filename)[0] + ".o" def EscapeShellArgument(s): """Quotes an argument so that it will be interpreted literally by a POSIX shell. Taken from http://stackoverflow.com/questions/35817/whats-the-best-way-to-escape-ossystem-calls-in-python """ return "'" + s.replace("'", "'\\''") + "'" def EscapeMakeVariableExpansion(s): """Make has its own variable expansion syntax using $. We must escape it for string to be interpreted literally.""" return s.replace("$", "$$") def EscapeCppDefine(s): """Escapes a CPP define so that it will reach the compiler unaltered.""" s = EscapeShellArgument(s) s = EscapeMakeVariableExpansion(s) # '#' characters must be escaped even embedded in a string, else Make will # treat it as the start of a comment. return s.replace("#", r"\#") def QuoteIfNecessary(string): """TODO: Should this ideally be replaced with one or more of the above functions?""" if '"' in string: string = '"' + string.replace('"', '\\"') + '"' return string def StringToMakefileVariable(string): """Convert a string to a value that is acceptable as a make variable name.""" return re.sub("[^a-zA-Z0-9_]", "_", string) srcdir_prefix = "" def Sourceify(path): """Convert a path to its source directory form.""" if "$(" in path: return path if os.path.isabs(path): return path return srcdir_prefix + path def QuoteSpaces(s, quote=r"\ "): return s.replace(" ", quote) def SourceifyAndQuoteSpaces(path): """Convert a path to its source directory form and quote spaces.""" return QuoteSpaces(Sourceify(path)) # Map from qualified target to path to output. target_outputs = {} # Map from qualified target to any linkable output. A subset # of target_outputs. E.g. when mybinary depends on liba, we want to # include liba in the linker line; when otherbinary depends on # mybinary, we just want to build mybinary first. target_link_deps = {} class MakefileWriter: """MakefileWriter packages up the writing of one target-specific foobar.mk. Its only real entry point is Write(), and is mostly used for namespacing. """ def __init__(self, generator_flags, flavor): self.generator_flags = generator_flags self.flavor = flavor self.suffix_rules_srcdir = {} self.suffix_rules_objdir1 = {} self.suffix_rules_objdir2 = {} # Generate suffix rules for all compilable extensions. for ext in COMPILABLE_EXTENSIONS.keys(): # Suffix rules for source folder. self.suffix_rules_srcdir.update( { ext: ( """\ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(srcdir)/%%%s FORCE_DO_CMD \t@$(call do_cmd,%s,1) """ % (ext, COMPILABLE_EXTENSIONS[ext]) ) } ) # Suffix rules for generated source files. self.suffix_rules_objdir1.update( { ext: ( """\ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj).$(TOOLSET)/%%%s FORCE_DO_CMD \t@$(call do_cmd,%s,1) """ % (ext, COMPILABLE_EXTENSIONS[ext]) ) } ) self.suffix_rules_objdir2.update( { ext: ( """\ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD \t@$(call do_cmd,%s,1) """ % (ext, COMPILABLE_EXTENSIONS[ext]) ) } ) def Write( self, qualified_target, base_path, output_filename, spec, configs, part_of_all ): """The main entry point: writes a .mk file for a single target. Arguments: qualified_target: target we're generating base_path: path relative to source root we're building in, used to resolve target-relative paths output_filename: output .mk file name to write spec, configs: gyp info part_of_all: flag indicating this target is part of 'all' """ gyp.common.EnsureDirExists(output_filename) self.fp = open(output_filename, "w") self.fp.write(header) self.qualified_target = qualified_target self.path = base_path self.target = spec["target_name"] self.type = spec["type"] self.toolset = spec["toolset"] self.is_mac_bundle = gyp.xcode_emulation.IsMacBundle(self.flavor, spec) if self.flavor == "mac": self.xcode_settings = gyp.xcode_emulation.XcodeSettings(spec) else: self.xcode_settings = None deps, link_deps = self.ComputeDeps(spec) # Some of the generation below can add extra output, sources, or # link dependencies. All of the out params of the functions that # follow use names like extra_foo. extra_outputs = [] extra_sources = [] extra_link_deps = [] extra_mac_bundle_resources = [] mac_bundle_deps = [] if self.is_mac_bundle: self.output = self.ComputeMacBundleOutput(spec) self.output_binary = self.ComputeMacBundleBinaryOutput(spec) else: self.output = self.output_binary = self.ComputeOutput(spec) self.is_standalone_static_library = bool( spec.get("standalone_static_library", 0) ) self._INSTALLABLE_TARGETS = ("executable", "loadable_module", "shared_library") if self.is_standalone_static_library or self.type in self._INSTALLABLE_TARGETS: self.alias = os.path.basename(self.output) install_path = self._InstallableTargetInstallPath() else: self.alias = self.output install_path = self.output self.WriteLn("TOOLSET := " + self.toolset) self.WriteLn("TARGET := " + self.target) # Actions must come first, since they can generate more OBJs for use below. if "actions" in spec: self.WriteActions( spec["actions"], extra_sources, extra_outputs, extra_mac_bundle_resources, part_of_all, ) # Rules must be early like actions. if "rules" in spec: self.WriteRules( spec["rules"], extra_sources, extra_outputs, extra_mac_bundle_resources, part_of_all, ) if "copies" in spec: self.WriteCopies(spec["copies"], extra_outputs, part_of_all) # Bundle resources. if self.is_mac_bundle: all_mac_bundle_resources = ( spec.get("mac_bundle_resources", []) + extra_mac_bundle_resources ) self.WriteMacBundleResources(all_mac_bundle_resources, mac_bundle_deps) self.WriteMacInfoPlist(mac_bundle_deps) # Sources. all_sources = spec.get("sources", []) + extra_sources if all_sources: self.WriteSources( configs, deps, all_sources, extra_outputs, extra_link_deps, part_of_all, gyp.xcode_emulation.MacPrefixHeader( self.xcode_settings, lambda p: Sourceify(self.Absolutify(p)), self.Pchify, ), ) sources = [x for x in all_sources if Compilable(x)] if sources: self.WriteLn(SHARED_HEADER_SUFFIX_RULES_COMMENT1) extensions = {os.path.splitext(s)[1] for s in sources} for ext in extensions: if ext in self.suffix_rules_srcdir: self.WriteLn(self.suffix_rules_srcdir[ext]) self.WriteLn(SHARED_HEADER_SUFFIX_RULES_COMMENT2) for ext in extensions: if ext in self.suffix_rules_objdir1: self.WriteLn(self.suffix_rules_objdir1[ext]) for ext in extensions: if ext in self.suffix_rules_objdir2: self.WriteLn(self.suffix_rules_objdir2[ext]) self.WriteLn("# End of this set of suffix rules") # Add dependency from bundle to bundle binary. if self.is_mac_bundle: mac_bundle_deps.append(self.output_binary) self.WriteTarget( spec, configs, deps, extra_link_deps + link_deps, mac_bundle_deps, extra_outputs, part_of_all, ) # Update global list of target outputs, used in dependency tracking. target_outputs[qualified_target] = install_path # Update global list of link dependencies. if self.type in ("static_library", "shared_library"): target_link_deps[qualified_target] = self.output_binary # Currently any versions have the same effect, but in future the behavior # could be different. if self.generator_flags.get("android_ndk_version", None): self.WriteAndroidNdkModuleRule(self.target, all_sources, link_deps) self.fp.close() def WriteSubMake(self, output_filename, makefile_path, targets, build_dir): """Write a "sub-project" Makefile. This is a small, wrapper Makefile that calls the top-level Makefile to build the targets from a single gyp file (i.e. a sub-project). Arguments: output_filename: sub-project Makefile name to write makefile_path: path to the top-level Makefile targets: list of "all" targets for this sub-project build_dir: build output directory, relative to the sub-project """ gyp.common.EnsureDirExists(output_filename) self.fp = open(output_filename, "w") self.fp.write(header) # For consistency with other builders, put sub-project build output in the # sub-project dir (see test/subdirectory/gyptest-subdir-all.py). self.WriteLn( "export builddir_name ?= %s" % os.path.join(os.path.dirname(output_filename), build_dir) ) self.WriteLn(".PHONY: all") self.WriteLn("all:") if makefile_path: makefile_path = " -C " + makefile_path self.WriteLn("\t$(MAKE){} {}".format(makefile_path, " ".join(targets))) self.fp.close() def WriteActions( self, actions, extra_sources, extra_outputs, extra_mac_bundle_resources, part_of_all, ): """Write Makefile code for any 'actions' from the gyp input. extra_sources: a list that will be filled in with newly generated source files, if any extra_outputs: a list that will be filled in with any outputs of these actions (used to make other pieces dependent on these actions) part_of_all: flag indicating this target is part of 'all' """ env = self.GetSortedXcodeEnv() for action in actions: name = StringToMakefileVariable( "{}_{}".format(self.qualified_target, action["action_name"]) ) self.WriteLn('### Rules for action "%s":' % action["action_name"]) inputs = action["inputs"] outputs = action["outputs"] # Build up a list of outputs. # Collect the output dirs we'll need. dirs = set() for out in outputs: dir = os.path.split(out)[0] if dir: dirs.add(dir) if int(action.get("process_outputs_as_sources", False)): extra_sources += outputs if int(action.get("process_outputs_as_mac_bundle_resources", False)): extra_mac_bundle_resources += outputs # Write the actual command. action_commands = action["action"] if self.flavor == "mac": action_commands = [ gyp.xcode_emulation.ExpandEnvVars(command, env) for command in action_commands ] command = gyp.common.EncodePOSIXShellList(action_commands) if "message" in action: self.WriteLn( "quiet_cmd_{} = ACTION {} $@".format(name, action["message"]) ) else: self.WriteLn(f"quiet_cmd_{name} = ACTION {name} $@") if len(dirs) > 0: command = "mkdir -p %s" % " ".join(dirs) + "; " + command cd_action = "cd %s; " % Sourceify(self.path or ".") # command and cd_action get written to a toplevel variable called # cmd_foo. Toplevel variables can't handle things that change per # makefile like $(TARGET), so hardcode the target. command = command.replace("$(TARGET)", self.target) cd_action = cd_action.replace("$(TARGET)", self.target) # Set LD_LIBRARY_PATH in case the action runs an executable from this # build which links to shared libs from this build. # actions run on the host, so they should in theory only use host # libraries, but until everything is made cross-compile safe, also use # target libraries. # TODO(piman): when everything is cross-compile safe, remove lib.target self.WriteLn( "cmd_%s = LD_LIBRARY_PATH=$(builddir)/lib.host:" "$(builddir)/lib.target:$$LD_LIBRARY_PATH; " "export LD_LIBRARY_PATH; " "%s%s" % (name, cd_action, command) ) self.WriteLn() outputs = [self.Absolutify(o) for o in outputs] # The makefile rules are all relative to the top dir, but the gyp actions # are defined relative to their containing dir. This replaces the obj # variable for the action rule with an absolute version so that the output # goes in the right place. # Only write the 'obj' and 'builddir' rules for the "primary" output (:1); # it's superfluous for the "extra outputs", and this avoids accidentally # writing duplicate dummy rules for those outputs. # Same for environment. self.WriteLn("%s: obj := $(abs_obj)" % QuoteSpaces(outputs[0])) self.WriteLn("%s: builddir := $(abs_builddir)" % QuoteSpaces(outputs[0])) self.WriteSortedXcodeEnv(outputs[0], self.GetSortedXcodeEnv()) for input in inputs: assert " " not in input, ( "Spaces in action input filenames not supported (%s)" % input ) for output in outputs: assert " " not in output, ( "Spaces in action output filenames not supported (%s)" % output ) # See the comment in WriteCopies about expanding env vars. outputs = [gyp.xcode_emulation.ExpandEnvVars(o, env) for o in outputs] inputs = [gyp.xcode_emulation.ExpandEnvVars(i, env) for i in inputs] self.WriteDoCmd( outputs, [Sourceify(self.Absolutify(i)) for i in inputs], part_of_all=part_of_all, command=name, ) # Stuff the outputs in a variable so we can refer to them later. outputs_variable = "action_%s_outputs" % name self.WriteLn("{} := {}".format(outputs_variable, " ".join(outputs))) extra_outputs.append("$(%s)" % outputs_variable) self.WriteLn() self.WriteLn() def WriteRules( self, rules, extra_sources, extra_outputs, extra_mac_bundle_resources, part_of_all, ): """Write Makefile code for any 'rules' from the gyp input. extra_sources: a list that will be filled in with newly generated source files, if any extra_outputs: a list that will be filled in with any outputs of these rules (used to make other pieces dependent on these rules) part_of_all: flag indicating this target is part of 'all' """ env = self.GetSortedXcodeEnv() for rule in rules: name = StringToMakefileVariable( "{}_{}".format(self.qualified_target, rule["rule_name"]) ) count = 0 self.WriteLn("### Generated for rule %s:" % name) all_outputs = [] for rule_source in rule.get("rule_sources", []): dirs = set() (rule_source_dirname, rule_source_basename) = os.path.split(rule_source) (rule_source_root, rule_source_ext) = os.path.splitext( rule_source_basename ) outputs = [ self.ExpandInputRoot(out, rule_source_root, rule_source_dirname) for out in rule["outputs"] ] for out in outputs: dir = os.path.dirname(out) if dir: dirs.add(dir) if int(rule.get("process_outputs_as_sources", False)): extra_sources += outputs if int(rule.get("process_outputs_as_mac_bundle_resources", False)): extra_mac_bundle_resources += outputs inputs = [ Sourceify(self.Absolutify(i)) for i in [rule_source] + rule.get("inputs", []) ] actions = ["$(call do_cmd,%s_%d)" % (name, count)] if name == "resources_grit": # HACK: This is ugly. Grit intentionally doesn't touch the # timestamp of its output file when the file doesn't change, # which is fine in hash-based dependency systems like scons # and forge, but not kosher in the make world. After some # discussion, hacking around it here seems like the least # amount of pain. actions += ["@touch --no-create $@"] # See the comment in WriteCopies about expanding env vars. outputs = [gyp.xcode_emulation.ExpandEnvVars(o, env) for o in outputs] inputs = [gyp.xcode_emulation.ExpandEnvVars(i, env) for i in inputs] outputs = [self.Absolutify(o) for o in outputs] all_outputs += outputs # Only write the 'obj' and 'builddir' rules for the "primary" output # (:1); it's superfluous for the "extra outputs", and this avoids # accidentally writing duplicate dummy rules for those outputs. self.WriteLn("%s: obj := $(abs_obj)" % outputs[0]) self.WriteLn("%s: builddir := $(abs_builddir)" % outputs[0]) self.WriteMakeRule( outputs, inputs, actions, command="%s_%d" % (name, count) ) # Spaces in rule filenames are not supported, but rule variables have # spaces in them (e.g. RULE_INPUT_PATH expands to '$(abspath $<)'). # The spaces within the variables are valid, so remove the variables # before checking. variables_with_spaces = re.compile(r"\$\([^ ]* \$<\)") for output in outputs: output = re.sub(variables_with_spaces, "", output) assert " " not in output, ( "Spaces in rule filenames not yet supported (%s)" % output ) self.WriteLn("all_deps += %s" % " ".join(outputs)) action = [ self.ExpandInputRoot(ac, rule_source_root, rule_source_dirname) for ac in rule["action"] ] mkdirs = "" if len(dirs) > 0: mkdirs = "mkdir -p %s; " % " ".join(dirs) cd_action = "cd %s; " % Sourceify(self.path or ".") # action, cd_action, and mkdirs get written to a toplevel variable # called cmd_foo. Toplevel variables can't handle things that change # per makefile like $(TARGET), so hardcode the target. if self.flavor == "mac": action = [ gyp.xcode_emulation.ExpandEnvVars(command, env) for command in action ] action = gyp.common.EncodePOSIXShellList(action) action = action.replace("$(TARGET)", self.target) cd_action = cd_action.replace("$(TARGET)", self.target) mkdirs = mkdirs.replace("$(TARGET)", self.target) # Set LD_LIBRARY_PATH in case the rule runs an executable from this # build which links to shared libs from this build. # rules run on the host, so they should in theory only use host # libraries, but until everything is made cross-compile safe, also use # target libraries. # TODO(piman): when everything is cross-compile safe, remove lib.target self.WriteLn( "cmd_%(name)s_%(count)d = LD_LIBRARY_PATH=" "$(builddir)/lib.host:$(builddir)/lib.target:$$LD_LIBRARY_PATH; " "export LD_LIBRARY_PATH; " "%(cd_action)s%(mkdirs)s%(action)s" % { "action": action, "cd_action": cd_action, "count": count, "mkdirs": mkdirs, "name": name, } ) self.WriteLn( "quiet_cmd_%(name)s_%(count)d = RULE %(name)s_%(count)d $@" % {"count": count, "name": name} ) self.WriteLn() count += 1 outputs_variable = "rule_%s_outputs" % name self.WriteList(all_outputs, outputs_variable) extra_outputs.append("$(%s)" % outputs_variable) self.WriteLn("### Finished generating for rule: %s" % name) self.WriteLn() self.WriteLn("### Finished generating for all rules") self.WriteLn("") def WriteCopies(self, copies, extra_outputs, part_of_all): """Write Makefile code for any 'copies' from the gyp input. extra_outputs: a list that will be filled in with any outputs of this action (used to make other pieces dependent on this action) part_of_all: flag indicating this target is part of 'all' """ self.WriteLn("### Generated for copy rule.") variable = StringToMakefileVariable(self.qualified_target + "_copies") outputs = [] for copy in copies: for path in copy["files"]: # Absolutify() may call normpath, and will strip trailing slashes. path = Sourceify(self.Absolutify(path)) filename = os.path.split(path)[1] output = Sourceify( self.Absolutify(os.path.join(copy["destination"], filename)) ) # If the output path has variables in it, which happens in practice for # 'copies', writing the environment as target-local doesn't work, # because the variables are already needed for the target name. # Copying the environment variables into global make variables doesn't # work either, because then the .d files will potentially contain spaces # after variable expansion, and .d file handling cannot handle spaces. # As a workaround, manually expand variables at gyp time. Since 'copies' # can't run scripts, there's no need to write the env then. # WriteDoCmd() will escape spaces for .d files. env = self.GetSortedXcodeEnv() output = gyp.xcode_emulation.ExpandEnvVars(output, env) path = gyp.xcode_emulation.ExpandEnvVars(path, env) self.WriteDoCmd([output], [path], "copy", part_of_all) outputs.append(output) self.WriteLn( "{} = {}".format(variable, " ".join(QuoteSpaces(o) for o in outputs)) ) extra_outputs.append("$(%s)" % variable) self.WriteLn() def WriteMacBundleResources(self, resources, bundle_deps): """Writes Makefile code for 'mac_bundle_resources'.""" self.WriteLn("### Generated for mac_bundle_resources") for output, res in gyp.xcode_emulation.GetMacBundleResources( generator_default_variables["PRODUCT_DIR"], self.xcode_settings, [Sourceify(self.Absolutify(r)) for r in resources], ): _, ext = os.path.splitext(output) if ext != ".xcassets": # Make does not supports '.xcassets' emulation. self.WriteDoCmd( [output], [res], "mac_tool,,,copy-bundle-resource", part_of_all=True ) bundle_deps.append(output) def WriteMacInfoPlist(self, bundle_deps): """Write Makefile code for bundle Info.plist files.""" info_plist, out, defines, extra_env = gyp.xcode_emulation.GetMacInfoPlist( generator_default_variables["PRODUCT_DIR"], self.xcode_settings, lambda p: Sourceify(self.Absolutify(p)), ) if not info_plist: return if defines: # Create an intermediate file to store preprocessed results. intermediate_plist = "$(obj).$(TOOLSET)/$(TARGET)/" + os.path.basename( info_plist ) self.WriteList( defines, intermediate_plist + ": INFOPLIST_DEFINES", "-D", quoter=EscapeCppDefine, ) self.WriteMakeRule( [intermediate_plist], [info_plist], [ "$(call do_cmd,infoplist)", # "Convert" the plist so that any weird whitespace changes from the # preprocessor do not affect the XML parser in mac_tool. "@plutil -convert xml1 $@ $@", ], ) info_plist = intermediate_plist # plists can contain envvars and substitute them into the file. self.WriteSortedXcodeEnv( out, self.GetSortedXcodeEnv(additional_settings=extra_env) ) self.WriteDoCmd( [out], [info_plist], "mac_tool,,,copy-info-plist", part_of_all=True ) bundle_deps.append(out) def WriteSources( self, configs, deps, sources, extra_outputs, extra_link_deps, part_of_all, precompiled_header, ): """Write Makefile code for any 'sources' from the gyp input. These are source files necessary to build the current target. configs, deps, sources: input from gyp. extra_outputs: a list of extra outputs this action should be dependent on; used to serialize action/rules before compilation extra_link_deps: a list that will be filled in with any outputs of compilation (to be used in link lines) part_of_all: flag indicating this target is part of 'all' """ # Write configuration-specific variables for CFLAGS, etc. for configname in sorted(configs.keys()): config = configs[configname] self.WriteList( config.get("defines"), "DEFS_%s" % configname, prefix="-D", quoter=EscapeCppDefine, ) if self.flavor == "mac": cflags = self.xcode_settings.GetCflags( configname, arch=config.get("xcode_configuration_platform") ) cflags_c = self.xcode_settings.GetCflagsC(configname) cflags_cc = self.xcode_settings.GetCflagsCC(configname) cflags_objc = self.xcode_settings.GetCflagsObjC(configname) cflags_objcc = self.xcode_settings.GetCflagsObjCC(configname) else: cflags = config.get("cflags") cflags_c = config.get("cflags_c") cflags_cc = config.get("cflags_cc") self.WriteLn("# Flags passed to all source files.") self.WriteList(cflags, "CFLAGS_%s" % configname) self.WriteLn("# Flags passed to only C files.") self.WriteList(cflags_c, "CFLAGS_C_%s" % configname) self.WriteLn("# Flags passed to only C++ files.") self.WriteList(cflags_cc, "CFLAGS_CC_%s" % configname) if self.flavor == "mac": self.WriteLn("# Flags passed to only ObjC files.") self.WriteList(cflags_objc, "CFLAGS_OBJC_%s" % configname) self.WriteLn("# Flags passed to only ObjC++ files.") self.WriteList(cflags_objcc, "CFLAGS_OBJCC_%s" % configname) includes = config.get("include_dirs") if includes: includes = [Sourceify(self.Absolutify(i)) for i in includes] self.WriteList(includes, "INCS_%s" % configname, prefix="-I") compilable = list(filter(Compilable, sources)) objs = [self.Objectify(self.Absolutify(Target(c))) for c in compilable] self.WriteList(objs, "OBJS") for obj in objs: assert " " not in obj, "Spaces in object filenames not supported (%s)" % obj self.WriteLn( "# Add to the list of files we specially track " "dependencies for." ) self.WriteLn("all_deps += $(OBJS)") self.WriteLn() # Make sure our dependencies are built first. if deps: self.WriteMakeRule( ["$(OBJS)"], deps, comment="Make sure our dependencies are built " "before any of us.", order_only=True, ) # Make sure the actions and rules run first. # If they generate any extra headers etc., the per-.o file dep tracking # will catch the proper rebuilds, so order only is still ok here. if extra_outputs: self.WriteMakeRule( ["$(OBJS)"], extra_outputs, comment="Make sure our actions/rules run " "before any of us.", order_only=True, ) pchdeps = precompiled_header.GetObjDependencies(compilable, objs) if pchdeps: self.WriteLn("# Dependencies from obj files to their precompiled headers") for source, obj, gch in pchdeps: self.WriteLn(f"{obj}: {gch}") self.WriteLn("# End precompiled header dependencies") if objs: extra_link_deps.append("$(OBJS)") self.WriteLn( """\ # CFLAGS et al overrides must be target-local. # See "Target-specific Variable Values" in the GNU Make manual.""" ) self.WriteLn("$(OBJS): TOOLSET := $(TOOLSET)") self.WriteLn( "$(OBJS): GYP_CFLAGS := " "$(DEFS_$(BUILDTYPE)) " "$(INCS_$(BUILDTYPE)) " "%s " % precompiled_header.GetInclude("c") + "$(CFLAGS_$(BUILDTYPE)) " "$(CFLAGS_C_$(BUILDTYPE))" ) self.WriteLn( "$(OBJS): GYP_CXXFLAGS := " "$(DEFS_$(BUILDTYPE)) " "$(INCS_$(BUILDTYPE)) " "%s " % precompiled_header.GetInclude("cc") + "$(CFLAGS_$(BUILDTYPE)) " "$(CFLAGS_CC_$(BUILDTYPE))" ) if self.flavor == "mac": self.WriteLn( "$(OBJS): GYP_OBJCFLAGS := " "$(DEFS_$(BUILDTYPE)) " "$(INCS_$(BUILDTYPE)) " "%s " % precompiled_header.GetInclude("m") + "$(CFLAGS_$(BUILDTYPE)) " "$(CFLAGS_C_$(BUILDTYPE)) " "$(CFLAGS_OBJC_$(BUILDTYPE))" ) self.WriteLn( "$(OBJS): GYP_OBJCXXFLAGS := " "$(DEFS_$(BUILDTYPE)) " "$(INCS_$(BUILDTYPE)) " "%s " % precompiled_header.GetInclude("mm") + "$(CFLAGS_$(BUILDTYPE)) " "$(CFLAGS_CC_$(BUILDTYPE)) " "$(CFLAGS_OBJCC_$(BUILDTYPE))" ) self.WritePchTargets(precompiled_header.GetPchBuildCommands()) # If there are any object files in our input file list, link them into our # output. extra_link_deps += [source for source in sources if Linkable(source)] self.WriteLn() def WritePchTargets(self, pch_commands): """Writes make rules to compile prefix headers.""" if not pch_commands: return for gch, lang_flag, lang, input in pch_commands: extra_flags = { "c": "$(CFLAGS_C_$(BUILDTYPE))", "cc": "$(CFLAGS_CC_$(BUILDTYPE))", "m": "$(CFLAGS_C_$(BUILDTYPE)) $(CFLAGS_OBJC_$(BUILDTYPE))", "mm": "$(CFLAGS_CC_$(BUILDTYPE)) $(CFLAGS_OBJCC_$(BUILDTYPE))", }[lang] var_name = { "c": "GYP_PCH_CFLAGS", "cc": "GYP_PCH_CXXFLAGS", "m": "GYP_PCH_OBJCFLAGS", "mm": "GYP_PCH_OBJCXXFLAGS", }[lang] self.WriteLn( f"{gch}: {var_name} := {lang_flag} " + "$(DEFS_$(BUILDTYPE)) " "$(INCS_$(BUILDTYPE)) " "$(CFLAGS_$(BUILDTYPE)) " + extra_flags ) self.WriteLn(f"{gch}: {input} FORCE_DO_CMD") self.WriteLn("\t@$(call do_cmd,pch_%s,1)" % lang) self.WriteLn("") assert " " not in gch, "Spaces in gch filenames not supported (%s)" % gch self.WriteLn("all_deps += %s" % gch) self.WriteLn("") def ComputeOutputBasename(self, spec): """Return the 'output basename' of a gyp spec. E.g., the loadable module 'foobar' in directory 'baz' will produce 'libfoobar.so' """ assert not self.is_mac_bundle if self.flavor == "mac" and self.type in ( "static_library", "executable", "shared_library", "loadable_module", ): return self.xcode_settings.GetExecutablePath() target = spec["target_name"] target_prefix = "" target_ext = "" if self.type == "static_library": if target[:3] == "lib": target = target[3:] target_prefix = "lib" target_ext = ".a" elif self.type in ("loadable_module", "shared_library"): if target[:3] == "lib": target = target[3:] target_prefix = "lib" if self.flavor == "aix": target_ext = ".a" else: target_ext = ".so" elif self.type == "none": target = "%s.stamp" % target elif self.type != "executable": print( "ERROR: What output file should be generated?", "type", self.type, "target", target, ) target_prefix = spec.get("product_prefix", target_prefix) target = spec.get("product_name", target) product_ext = spec.get("product_extension") if product_ext: target_ext = "." + product_ext return target_prefix + target + target_ext def _InstallImmediately(self): return ( self.toolset == "target" and self.flavor == "mac" and self.type in ("static_library", "executable", "shared_library", "loadable_module") ) def ComputeOutput(self, spec): """Return the 'output' (full output path) of a gyp spec. E.g., the loadable module 'foobar' in directory 'baz' will produce '$(obj)/baz/libfoobar.so' """ assert not self.is_mac_bundle path = os.path.join("$(obj)." + self.toolset, self.path) if self.type == "executable" or self._InstallImmediately(): path = "$(builddir)" path = spec.get("product_dir", path) return os.path.join(path, self.ComputeOutputBasename(spec)) def ComputeMacBundleOutput(self, spec): """Return the 'output' (full output path) to a bundle output directory.""" assert self.is_mac_bundle path = generator_default_variables["PRODUCT_DIR"] return os.path.join(path, self.xcode_settings.GetWrapperName()) def ComputeMacBundleBinaryOutput(self, spec): """Return the 'output' (full output path) to the binary in a bundle.""" path = generator_default_variables["PRODUCT_DIR"] return os.path.join(path, self.xcode_settings.GetExecutablePath()) def ComputeDeps(self, spec): """Compute the dependencies of a gyp spec. Returns a tuple (deps, link_deps), where each is a list of filenames that will need to be put in front of make for either building (deps) or linking (link_deps). """ deps = [] link_deps = [] if "dependencies" in spec: deps.extend( [ target_outputs[dep] for dep in spec["dependencies"] if target_outputs[dep] ] ) for dep in spec["dependencies"]: if dep in target_link_deps: link_deps.append(target_link_deps[dep]) deps.extend(link_deps) # TODO: It seems we need to transitively link in libraries (e.g. -lfoo)? # This hack makes it work: # link_deps.extend(spec.get('libraries', [])) return (gyp.common.uniquer(deps), gyp.common.uniquer(link_deps)) def WriteDependencyOnExtraOutputs(self, target, extra_outputs): self.WriteMakeRule( [self.output_binary], extra_outputs, comment="Build our special outputs first.", order_only=True, ) def WriteTarget( self, spec, configs, deps, link_deps, bundle_deps, extra_outputs, part_of_all ): """Write Makefile code to produce the final target of the gyp spec. spec, configs: input from gyp. deps, link_deps: dependency lists; see ComputeDeps() extra_outputs: any extra outputs that our target should depend on part_of_all: flag indicating this target is part of 'all' """ self.WriteLn("### Rules for final target.") if extra_outputs: self.WriteDependencyOnExtraOutputs(self.output_binary, extra_outputs) self.WriteMakeRule( extra_outputs, deps, comment=("Preserve order dependency of " "special output on deps."), order_only=True, ) target_postbuilds = {} if self.type != "none": for configname in sorted(configs.keys()): config = configs[configname] if self.flavor == "mac": ldflags = self.xcode_settings.GetLdflags( configname, generator_default_variables["PRODUCT_DIR"], lambda p: Sourceify(self.Absolutify(p)), arch=config.get("xcode_configuration_platform"), ) # TARGET_POSTBUILDS_$(BUILDTYPE) is added to postbuilds later on. gyp_to_build = gyp.common.InvertRelativePath(self.path) target_postbuild = self.xcode_settings.AddImplicitPostbuilds( configname, QuoteSpaces( os.path.normpath(os.path.join(gyp_to_build, self.output)) ), QuoteSpaces( os.path.normpath( os.path.join(gyp_to_build, self.output_binary) ) ), ) if target_postbuild: target_postbuilds[configname] = target_postbuild else: ldflags = config.get("ldflags", []) # Compute an rpath for this output if needed. if any(dep.endswith(".so") or ".so." in dep for dep in deps): # We want to get the literal string "$ORIGIN" # into the link command, so we need lots of escaping. ldflags.append(r"-Wl,-rpath=\$$ORIGIN/") ldflags.append(r"-Wl,-rpath-link=\$(builddir)/") library_dirs = config.get("library_dirs", []) ldflags += [("-L%s" % library_dir) for library_dir in library_dirs] self.WriteList(ldflags, "LDFLAGS_%s" % configname) if self.flavor == "mac": self.WriteList( self.xcode_settings.GetLibtoolflags(configname), "LIBTOOLFLAGS_%s" % configname, ) libraries = spec.get("libraries") if libraries: # Remove duplicate entries libraries = gyp.common.uniquer(libraries) if self.flavor == "mac": libraries = self.xcode_settings.AdjustLibraries(libraries) self.WriteList(libraries, "LIBS") self.WriteLn( "%s: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE))" % QuoteSpaces(self.output_binary) ) self.WriteLn("%s: LIBS := $(LIBS)" % QuoteSpaces(self.output_binary)) if self.flavor == "mac": self.WriteLn( "%s: GYP_LIBTOOLFLAGS := $(LIBTOOLFLAGS_$(BUILDTYPE))" % QuoteSpaces(self.output_binary) ) # Postbuild actions. Like actions, but implicitly depend on the target's # output. postbuilds = [] if self.flavor == "mac": if target_postbuilds: postbuilds.append("$(TARGET_POSTBUILDS_$(BUILDTYPE))") postbuilds.extend(gyp.xcode_emulation.GetSpecPostbuildCommands(spec)) if postbuilds: # Envvars may be referenced by TARGET_POSTBUILDS_$(BUILDTYPE), # so we must output its definition first, since we declare variables # using ":=". self.WriteSortedXcodeEnv(self.output, self.GetSortedXcodePostbuildEnv()) for configname in target_postbuilds: self.WriteLn( "%s: TARGET_POSTBUILDS_%s := %s" % ( QuoteSpaces(self.output), configname, gyp.common.EncodePOSIXShellList(target_postbuilds[configname]), ) ) # Postbuilds expect to be run in the gyp file's directory, so insert an # implicit postbuild to cd to there. postbuilds.insert(0, gyp.common.EncodePOSIXShellList(["cd", self.path])) for i, postbuild in enumerate(postbuilds): if not postbuild.startswith("$"): postbuilds[i] = EscapeShellArgument(postbuild) self.WriteLn("%s: builddir := $(abs_builddir)" % QuoteSpaces(self.output)) self.WriteLn( "%s: POSTBUILDS := %s" % (QuoteSpaces(self.output), " ".join(postbuilds)) ) # A bundle directory depends on its dependencies such as bundle resources # and bundle binary. When all dependencies have been built, the bundle # needs to be packaged. if self.is_mac_bundle: # If the framework doesn't contain a binary, then nothing depends # on the actions -- make the framework depend on them directly too. self.WriteDependencyOnExtraOutputs(self.output, extra_outputs) # Bundle dependencies. Note that the code below adds actions to this # target, so if you move these two lines, move the lines below as well. self.WriteList([QuoteSpaces(dep) for dep in bundle_deps], "BUNDLE_DEPS") self.WriteLn("%s: $(BUNDLE_DEPS)" % QuoteSpaces(self.output)) # After the framework is built, package it. Needs to happen before # postbuilds, since postbuilds depend on this. if self.type in ("shared_library", "loadable_module"): self.WriteLn( "\t@$(call do_cmd,mac_package_framework,,,%s)" % self.xcode_settings.GetFrameworkVersion() ) # Bundle postbuilds can depend on the whole bundle, so run them after # the bundle is packaged, not already after the bundle binary is done. if postbuilds: self.WriteLn("\t@$(call do_postbuilds)") postbuilds = [] # Don't write postbuilds for target's output. # Needed by test/mac/gyptest-rebuild.py. self.WriteLn("\t@true # No-op, used by tests") # Since this target depends on binary and resources which are in # nested subfolders, the framework directory will be older than # its dependencies usually. To prevent this rule from executing # on every build (expensive, especially with postbuilds), expliclity # update the time on the framework directory. self.WriteLn("\t@touch -c %s" % QuoteSpaces(self.output)) if postbuilds: assert not self.is_mac_bundle, ( "Postbuilds for bundles should be done " "on the bundle, not the binary (target '%s')" % self.target ) assert "product_dir" not in spec, ( "Postbuilds do not work with " "custom product_dir" ) if self.type == "executable": self.WriteLn( "%s: LD_INPUTS := %s" % ( QuoteSpaces(self.output_binary), " ".join(QuoteSpaces(dep) for dep in link_deps), ) ) if self.toolset == "host" and self.flavor == "android": self.WriteDoCmd( [self.output_binary], link_deps, "link_host", part_of_all, postbuilds=postbuilds, ) else: self.WriteDoCmd( [self.output_binary], link_deps, "link", part_of_all, postbuilds=postbuilds, ) elif self.type == "static_library": for link_dep in link_deps: assert " " not in link_dep, ( "Spaces in alink input filenames not supported (%s)" % link_dep ) if ( self.flavor not in ("mac", "openbsd", "netbsd", "win") and not self.is_standalone_static_library ): self.WriteDoCmd( [self.output_binary], link_deps, "alink_thin", part_of_all, postbuilds=postbuilds, ) else: self.WriteDoCmd( [self.output_binary], link_deps, "alink", part_of_all, postbuilds=postbuilds, ) elif self.type == "shared_library": self.WriteLn( "%s: LD_INPUTS := %s" % ( QuoteSpaces(self.output_binary), " ".join(QuoteSpaces(dep) for dep in link_deps), ) ) self.WriteDoCmd( [self.output_binary], link_deps, "solink", part_of_all, postbuilds=postbuilds, ) elif self.type == "loadable_module": for link_dep in link_deps: assert " " not in link_dep, ( "Spaces in module input filenames not supported (%s)" % link_dep ) if self.toolset == "host" and self.flavor == "android": self.WriteDoCmd( [self.output_binary], link_deps, "solink_module_host", part_of_all, postbuilds=postbuilds, ) else: self.WriteDoCmd( [self.output_binary], link_deps, "solink_module", part_of_all, postbuilds=postbuilds, ) elif self.type == "none": # Write a stamp line. self.WriteDoCmd( [self.output_binary], deps, "touch", part_of_all, postbuilds=postbuilds ) else: print("WARNING: no output for", self.type, self.target) # Add an alias for each target (if there are any outputs). # Installable target aliases are created below. if (self.output and self.output != self.target) and ( self.type not in self._INSTALLABLE_TARGETS ): self.WriteMakeRule( [self.target], [self.output], comment="Add target alias", phony=True ) if part_of_all: self.WriteMakeRule( ["all"], [self.target], comment='Add target alias to "all" target.', phony=True, ) # Add special-case rules for our installable targets. # 1) They need to install to the build dir or "product" dir. # 2) They get shortcuts for building (e.g. "make chrome"). # 3) They are part of "make all". if self.type in self._INSTALLABLE_TARGETS or self.is_standalone_static_library: if self.type == "shared_library": file_desc = "shared library" elif self.type == "static_library": file_desc = "static library" else: file_desc = "executable" install_path = self._InstallableTargetInstallPath() installable_deps = [self.output] if ( self.flavor == "mac" and "product_dir" not in spec and self.toolset == "target" ): # On mac, products are created in install_path immediately. assert install_path == self.output, "{} != {}".format( install_path, self.output, ) # Point the target alias to the final binary output. self.WriteMakeRule( [self.target], [install_path], comment="Add target alias", phony=True ) if install_path != self.output: assert not self.is_mac_bundle # See comment a few lines above. self.WriteDoCmd( [install_path], [self.output], "copy", comment="Copy this to the %s output path." % file_desc, part_of_all=part_of_all, ) installable_deps.append(install_path) if self.output != self.alias and self.alias != self.target: self.WriteMakeRule( [self.alias], installable_deps, comment="Short alias for building this %s." % file_desc, phony=True, ) if part_of_all: self.WriteMakeRule( ["all"], [install_path], comment='Add %s to "all" target.' % file_desc, phony=True, ) def WriteList(self, value_list, variable=None, prefix="", quoter=QuoteIfNecessary): """Write a variable definition that is a list of values. E.g. WriteList(['a','b'], 'foo', prefix='blah') writes out foo = blaha blahb but in a pretty-printed style. """ values = "" if value_list: value_list = [quoter(prefix + value) for value in value_list] values = " \\\n\t" + " \\\n\t".join(value_list) self.fp.write(f"{variable} :={values}\n\n") def WriteDoCmd( self, outputs, inputs, command, part_of_all, comment=None, postbuilds=False ): """Write a Makefile rule that uses do_cmd. This makes the outputs dependent on the command line that was run, as well as support the V= make command line flag. """ suffix = "" if postbuilds: assert "," not in command suffix = ",,1" # Tell do_cmd to honor $POSTBUILDS self.WriteMakeRule( outputs, inputs, actions=[f"$(call do_cmd,{command}{suffix})"], comment=comment, command=command, force=True, ) # Add our outputs to the list of targets we read depfiles from. # all_deps is only used for deps file reading, and for deps files we replace # spaces with ? because escaping doesn't work with make's $(sort) and # other functions. outputs = [QuoteSpaces(o, SPACE_REPLACEMENT) for o in outputs] self.WriteLn("all_deps += %s" % " ".join(outputs)) def WriteMakeRule( self, outputs, inputs, actions=None, comment=None, order_only=False, force=False, phony=False, command=None, ): """Write a Makefile rule, with some extra tricks. outputs: a list of outputs for the rule (note: this is not directly supported by make; see comments below) inputs: a list of inputs for the rule actions: a list of shell commands to run for the rule comment: a comment to put in the Makefile above the rule (also useful for making this Python script's code self-documenting) order_only: if true, makes the dependency order-only force: if true, include FORCE_DO_CMD as an order-only dep phony: if true, the rule does not actually generate the named output, the output is just a name to run the rule command: (optional) command name to generate unambiguous labels """ outputs = [QuoteSpaces(o) for o in outputs] inputs = [QuoteSpaces(i) for i in inputs] if comment: self.WriteLn("# " + comment) if phony: self.WriteLn(".PHONY: " + " ".join(outputs)) if actions: self.WriteLn("%s: TOOLSET := $(TOOLSET)" % outputs[0]) force_append = " FORCE_DO_CMD" if force else "" if order_only: # Order only rule: Just write a simple rule. # TODO(evanm): just make order_only a list of deps instead of this hack. self.WriteLn( "{}: | {}{}".format(" ".join(outputs), " ".join(inputs), force_append) ) elif len(outputs) == 1: # Regular rule, one output: Just write a simple rule. self.WriteLn("{}: {}{}".format(outputs[0], " ".join(inputs), force_append)) else: # Regular rule, more than one output: Multiple outputs are tricky in # make. We will write three rules: # - All outputs depend on an intermediate file. # - Make .INTERMEDIATE depend on the intermediate. # - The intermediate file depends on the inputs and executes the # actual command. # - The intermediate recipe will 'touch' the intermediate file. # - The multi-output rule will have an do-nothing recipe. # Hash the target name to avoid generating overlong filenames. cmddigest = hashlib.sha1( (command or self.target).encode("utf-8") ).hexdigest() intermediate = "%s.intermediate" % cmddigest self.WriteLn("{}: {}".format(" ".join(outputs), intermediate)) self.WriteLn("\t%s" % "@:") self.WriteLn("{}: {}".format(".INTERMEDIATE", intermediate)) self.WriteLn( "{}: {}{}".format(intermediate, " ".join(inputs), force_append) ) actions.insert(0, "$(call do_cmd,touch)") if actions: for action in actions: self.WriteLn("\t%s" % action) self.WriteLn() def WriteAndroidNdkModuleRule(self, module_name, all_sources, link_deps): """Write a set of LOCAL_XXX definitions for Android NDK. These variable definitions will be used by Android NDK but do nothing for non-Android applications. Arguments: module_name: Android NDK module name, which must be unique among all module names. all_sources: A list of source files (will be filtered by Compilable). link_deps: A list of link dependencies, which must be sorted in the order from dependencies to dependents. """ if self.type not in ("executable", "shared_library", "static_library"): return self.WriteLn("# Variable definitions for Android applications") self.WriteLn("include $(CLEAR_VARS)") self.WriteLn("LOCAL_MODULE := " + module_name) self.WriteLn( "LOCAL_CFLAGS := $(CFLAGS_$(BUILDTYPE)) " "$(DEFS_$(BUILDTYPE)) " # LOCAL_CFLAGS is applied to both of C and C++. There is # no way to specify $(CFLAGS_C_$(BUILDTYPE)) only for C # sources. "$(CFLAGS_C_$(BUILDTYPE)) " # $(INCS_$(BUILDTYPE)) includes the prefix '-I' while # LOCAL_C_INCLUDES does not expect it. So put it in # LOCAL_CFLAGS. "$(INCS_$(BUILDTYPE))" ) # LOCAL_CXXFLAGS is obsolete and LOCAL_CPPFLAGS is preferred. self.WriteLn("LOCAL_CPPFLAGS := $(CFLAGS_CC_$(BUILDTYPE))") self.WriteLn("LOCAL_C_INCLUDES :=") self.WriteLn("LOCAL_LDLIBS := $(LDFLAGS_$(BUILDTYPE)) $(LIBS)") # Detect the C++ extension. cpp_ext = {".cc": 0, ".cpp": 0, ".cxx": 0} default_cpp_ext = ".cpp" for filename in all_sources: ext = os.path.splitext(filename)[1] if ext in cpp_ext: cpp_ext[ext] += 1 if cpp_ext[ext] > cpp_ext[default_cpp_ext]: default_cpp_ext = ext self.WriteLn("LOCAL_CPP_EXTENSION := " + default_cpp_ext) self.WriteList( list(map(self.Absolutify, filter(Compilable, all_sources))), "LOCAL_SRC_FILES", ) # Filter out those which do not match prefix and suffix and produce # the resulting list without prefix and suffix. def DepsToModules(deps, prefix, suffix): modules = [] for filepath in deps: filename = os.path.basename(filepath) if filename.startswith(prefix) and filename.endswith(suffix): modules.append(filename[len(prefix) : -len(suffix)]) return modules # Retrieve the default value of 'SHARED_LIB_SUFFIX' params = {"flavor": "linux"} default_variables = {} CalculateVariables(default_variables, params) self.WriteList( DepsToModules( link_deps, generator_default_variables["SHARED_LIB_PREFIX"], default_variables["SHARED_LIB_SUFFIX"], ), "LOCAL_SHARED_LIBRARIES", ) self.WriteList( DepsToModules( link_deps, generator_default_variables["STATIC_LIB_PREFIX"], generator_default_variables["STATIC_LIB_SUFFIX"], ), "LOCAL_STATIC_LIBRARIES", ) if self.type == "executable": self.WriteLn("include $(BUILD_EXECUTABLE)") elif self.type == "shared_library": self.WriteLn("include $(BUILD_SHARED_LIBRARY)") elif self.type == "static_library": self.WriteLn("include $(BUILD_STATIC_LIBRARY)") self.WriteLn() def WriteLn(self, text=""): self.fp.write(text + "\n") def GetSortedXcodeEnv(self, additional_settings=None): return gyp.xcode_emulation.GetSortedXcodeEnv( self.xcode_settings, "$(abs_builddir)", os.path.join("$(abs_srcdir)", self.path), "$(BUILDTYPE)", additional_settings, ) def GetSortedXcodePostbuildEnv(self): # CHROMIUM_STRIP_SAVE_FILE is a chromium-specific hack. # TODO(thakis): It would be nice to have some general mechanism instead. strip_save_file = self.xcode_settings.GetPerTargetSetting( "CHROMIUM_STRIP_SAVE_FILE", "" ) # Even if strip_save_file is empty, explicitly write it. Else a postbuild # might pick up an export from an earlier target. return self.GetSortedXcodeEnv( additional_settings={"CHROMIUM_STRIP_SAVE_FILE": strip_save_file} ) def WriteSortedXcodeEnv(self, target, env): for k, v in env: # For # foo := a\ b # the escaped space does the right thing. For # export foo := a\ b # it does not -- the backslash is written to the env as literal character. # So don't escape spaces in |env[k]|. self.WriteLn(f"{QuoteSpaces(target)}: export {k} := {v}") def Objectify(self, path): """Convert a path to its output directory form.""" if "$(" in path: path = path.replace("$(obj)/", "$(obj).%s/$(TARGET)/" % self.toolset) if "$(obj)" not in path: path = f"$(obj).{self.toolset}/$(TARGET)/{path}" return path def Pchify(self, path, lang): """Convert a prefix header path to its output directory form.""" path = self.Absolutify(path) if "$(" in path: path = path.replace( "$(obj)/", f"$(obj).{self.toolset}/$(TARGET)/pch-{lang}" ) return path return f"$(obj).{self.toolset}/$(TARGET)/pch-{lang}/{path}" def Absolutify(self, path): """Convert a subdirectory-relative path into a base-relative path. Skips over paths that contain variables.""" if "$(" in path: # Don't call normpath in this case, as it might collapse the # path too aggressively if it features '..'. However it's still # important to strip trailing slashes. return path.rstrip("/") return os.path.normpath(os.path.join(self.path, path)) def ExpandInputRoot(self, template, expansion, dirname): if "%(INPUT_ROOT)s" not in template and "%(INPUT_DIRNAME)s" not in template: return template path = template % { "INPUT_ROOT": expansion, "INPUT_DIRNAME": dirname, } return path def _InstallableTargetInstallPath(self): """Returns the location of the final output for an installable target.""" # Functionality removed for all platforms to match Xcode and hoist # shared libraries into PRODUCT_DIR for users: # Xcode puts shared_library results into PRODUCT_DIR, and some gyp files # rely on this. Emulate this behavior for mac. # if self.type == "shared_library" and ( # self.flavor != "mac" or self.toolset != "target" # ): # # Install all shared libs into a common directory (per toolset) for # # convenient access with LD_LIBRARY_PATH. # return "$(builddir)/lib.%s/%s" % (self.toolset, self.alias) return "$(builddir)/" + self.alias def WriteAutoRegenerationRule(params, root_makefile, makefile_name, build_files): """Write the target to regenerate the Makefile.""" options = params["options"] build_files_args = [ gyp.common.RelativePath(filename, options.toplevel_dir) for filename in params["build_files_arg"] ] gyp_binary = gyp.common.FixIfRelativePath( params["gyp_binary"], options.toplevel_dir ) if not gyp_binary.startswith(os.sep): gyp_binary = os.path.join(".", gyp_binary) root_makefile.write( "quiet_cmd_regen_makefile = ACTION Regenerating $@\n" "cmd_regen_makefile = cd $(srcdir); %(cmd)s\n" "%(makefile_name)s: %(deps)s\n" "\t$(call do_cmd,regen_makefile)\n\n" % { "makefile_name": makefile_name, "deps": " ".join(SourceifyAndQuoteSpaces(bf) for bf in build_files), "cmd": gyp.common.EncodePOSIXShellList( [gyp_binary, "-fmake"] + gyp.RegenerateFlags(options) + build_files_args ), } ) def PerformBuild(data, configurations, params): options = params["options"] for config in configurations: arguments = ["make"] if options.toplevel_dir and options.toplevel_dir != ".": arguments += "-C", options.toplevel_dir arguments.append("BUILDTYPE=" + config) print(f"Building [{config}]: {arguments}") subprocess.check_call(arguments) def GenerateOutput(target_list, target_dicts, data, params): options = params["options"] flavor = gyp.common.GetFlavor(params) generator_flags = params.get("generator_flags", {}) builddir_name = generator_flags.get("output_dir", "out") android_ndk_version = generator_flags.get("android_ndk_version", None) default_target = generator_flags.get("default_target", "all") def CalculateMakefilePath(build_file, base_name): """Determine where to write a Makefile for a given gyp file.""" # Paths in gyp files are relative to the .gyp file, but we want # paths relative to the source root for the master makefile. Grab # the path of the .gyp file as the base to relativize against. # E.g. "foo/bar" when we're constructing targets for "foo/bar/baz.gyp". base_path = gyp.common.RelativePath(os.path.dirname(build_file), options.depth) # We write the file in the base_path directory. output_file = os.path.join(options.depth, base_path, base_name) if options.generator_output: output_file = os.path.join( options.depth, options.generator_output, base_path, base_name ) base_path = gyp.common.RelativePath( os.path.dirname(build_file), options.toplevel_dir ) return base_path, output_file # TODO: search for the first non-'Default' target. This can go # away when we add verification that all targets have the # necessary configurations. default_configuration = None toolsets = {target_dicts[target]["toolset"] for target in target_list} for target in target_list: spec = target_dicts[target] if spec["default_configuration"] != "Default": default_configuration = spec["default_configuration"] break if not default_configuration: default_configuration = "Default" srcdir = "." makefile_name = "Makefile" + options.suffix makefile_path = os.path.join(options.toplevel_dir, makefile_name) if options.generator_output: global srcdir_prefix makefile_path = os.path.join( options.toplevel_dir, options.generator_output, makefile_name ) srcdir = gyp.common.RelativePath(srcdir, options.generator_output) srcdir_prefix = "$(srcdir)/" flock_command = "flock" copy_archive_arguments = "-af" makedep_arguments = "-MMD" header_params = { "default_target": default_target, "builddir": builddir_name, "default_configuration": default_configuration, "flock": flock_command, "flock_index": 1, "link_commands": LINK_COMMANDS_LINUX, "extra_commands": "", "srcdir": srcdir, "copy_archive_args": copy_archive_arguments, "makedep_args": makedep_arguments, "CC.target": GetEnvironFallback(("CC_target", "CC"), "$(CC)"), "AR.target": GetEnvironFallback(("AR_target", "AR"), "$(AR)"), "CXX.target": GetEnvironFallback(("CXX_target", "CXX"), "$(CXX)"), "LINK.target": GetEnvironFallback(("LINK_target", "LINK"), "$(LINK)"), "CC.host": GetEnvironFallback(("CC_host", "CC"), "gcc"), "AR.host": GetEnvironFallback(("AR_host", "AR"), "ar"), "CXX.host": GetEnvironFallback(("CXX_host", "CXX"), "g++"), "LINK.host": GetEnvironFallback(("LINK_host", "LINK"), "$(CXX.host)"), } if flavor == "mac": flock_command = "./gyp-mac-tool flock" header_params.update( { "flock": flock_command, "flock_index": 2, "link_commands": LINK_COMMANDS_MAC, "extra_commands": SHARED_HEADER_MAC_COMMANDS, } ) elif flavor == "android": header_params.update({"link_commands": LINK_COMMANDS_ANDROID}) elif flavor == "zos": copy_archive_arguments = "-fPR" makedep_arguments = "-qmakedep=gcc" header_params.update( { "copy_archive_args": copy_archive_arguments, "makedep_args": makedep_arguments, "link_commands": LINK_COMMANDS_OS390, "CC.target": GetEnvironFallback(("CC_target", "CC"), "njsc"), "CXX.target": GetEnvironFallback(("CXX_target", "CXX"), "njsc++"), "CC.host": GetEnvironFallback(("CC_host", "CC"), "njsc"), "CXX.host": GetEnvironFallback(("CXX_host", "CXX"), "njsc++"), } ) elif flavor == "solaris": copy_archive_arguments = "-pPRf@" header_params.update( { "copy_archive_args": copy_archive_arguments, "flock": "./gyp-flock-tool flock", "flock_index": 2, } ) elif flavor == "freebsd": # Note: OpenBSD has sysutils/flock. lockf seems to be FreeBSD specific. header_params.update({"flock": "lockf"}) elif flavor == "openbsd": copy_archive_arguments = "-pPRf" header_params.update({"copy_archive_args": copy_archive_arguments}) elif flavor == "aix": copy_archive_arguments = "-pPRf" header_params.update( { "copy_archive_args": copy_archive_arguments, "link_commands": LINK_COMMANDS_AIX, "flock": "./gyp-flock-tool flock", "flock_index": 2, } ) build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) make_global_settings_array = data[build_file].get("make_global_settings", []) wrappers = {} for key, value in make_global_settings_array: if key.endswith("_wrapper"): wrappers[key[: -len("_wrapper")]] = "$(abspath %s)" % value make_global_settings = "" for key, value in make_global_settings_array: if re.match(".*_wrapper", key): continue if value[0] != "$": value = "$(abspath %s)" % value wrapper = wrappers.get(key) if wrapper: value = f"{wrapper} {value}" del wrappers[key] if key in ("CC", "CC.host", "CXX", "CXX.host"): make_global_settings += ( "ifneq (,$(filter $(origin %s), undefined default))\n" % key ) # Let gyp-time envvars win over global settings. env_key = key.replace(".", "_") # CC.host -> CC_host if env_key in os.environ: value = os.environ[env_key] make_global_settings += f" {key} = {value}\n" make_global_settings += "endif\n" else: make_global_settings += f"{key} ?= {value}\n" # TODO(ukai): define cmd when only wrapper is specified in # make_global_settings. header_params["make_global_settings"] = make_global_settings gyp.common.EnsureDirExists(makefile_path) root_makefile = open(makefile_path, "w") root_makefile.write(SHARED_HEADER % header_params) # Currently any versions have the same effect, but in future the behavior # could be different. if android_ndk_version: root_makefile.write( "# Define LOCAL_PATH for build of Android applications.\n" "LOCAL_PATH := $(call my-dir)\n" "\n" ) for toolset in toolsets: root_makefile.write("TOOLSET := %s\n" % toolset) WriteRootHeaderSuffixRules(root_makefile) # Put build-time support tools next to the root Makefile. dest_path = os.path.dirname(makefile_path) gyp.common.CopyTool(flavor, dest_path) # Find the list of targets that derive from the gyp file(s) being built. needed_targets = set() for build_file in params["build_files"]: for target in gyp.common.AllTargets(target_list, target_dicts, build_file): needed_targets.add(target) build_files = set() include_list = set() for qualified_target in target_list: build_file, target, toolset = gyp.common.ParseQualifiedTarget(qualified_target) this_make_global_settings = data[build_file].get("make_global_settings", []) assert make_global_settings_array == this_make_global_settings, ( "make_global_settings needs to be the same for all targets " f"{this_make_global_settings} vs. {make_global_settings}" ) build_files.add(gyp.common.RelativePath(build_file, options.toplevel_dir)) included_files = data[build_file]["included_files"] for included_file in included_files: # The included_files entries are relative to the dir of the build file # that included them, so we have to undo that and then make them relative # to the root dir. relative_include_file = gyp.common.RelativePath( gyp.common.UnrelativePath(included_file, build_file), options.toplevel_dir, ) abs_include_file = os.path.abspath(relative_include_file) # If the include file is from the ~/.gyp dir, we should use absolute path # so that relocating the src dir doesn't break the path. if params["home_dot_gyp"] and abs_include_file.startswith( params["home_dot_gyp"] ): build_files.add(abs_include_file) else: build_files.add(relative_include_file) base_path, output_file = CalculateMakefilePath( build_file, target + "." + toolset + options.suffix + ".mk" ) spec = target_dicts[qualified_target] configs = spec["configurations"] if flavor == "mac": gyp.xcode_emulation.MergeGlobalXcodeSettingsToSpec(data[build_file], spec) writer = MakefileWriter(generator_flags, flavor) writer.Write( qualified_target, base_path, output_file, spec, configs, part_of_all=qualified_target in needed_targets, ) # Our root_makefile lives at the source root. Compute the relative path # from there to the output_file for including. mkfile_rel_path = gyp.common.RelativePath( output_file, os.path.dirname(makefile_path) ) include_list.add(mkfile_rel_path) # Write out per-gyp (sub-project) Makefiles. depth_rel_path = gyp.common.RelativePath(options.depth, os.getcwd()) for build_file in build_files: # The paths in build_files were relativized above, so undo that before # testing against the non-relativized items in target_list and before # calculating the Makefile path. build_file = os.path.join(depth_rel_path, build_file) gyp_targets = [ target_dicts[qualified_target]["target_name"] for qualified_target in target_list if qualified_target.startswith(build_file) and qualified_target in needed_targets ] # Only generate Makefiles for gyp files with targets. if not gyp_targets: continue base_path, output_file = CalculateMakefilePath( build_file, os.path.splitext(os.path.basename(build_file))[0] + ".Makefile" ) makefile_rel_path = gyp.common.RelativePath( os.path.dirname(makefile_path), os.path.dirname(output_file) ) writer.WriteSubMake(output_file, makefile_rel_path, gyp_targets, builddir_name) # Write out the sorted list of includes. root_makefile.write("\n") for include_file in sorted(include_list): # We wrap each .mk include in an if statement so users can tell make to # not load a file by setting NO_LOAD. The below make code says, only # load the .mk file if the .mk filename doesn't start with a token in # NO_LOAD. root_makefile.write( "ifeq ($(strip $(foreach prefix,$(NO_LOAD),\\\n" " $(findstring $(join ^,$(prefix)),\\\n" " $(join ^," + include_file + ")))),)\n" ) root_makefile.write(" include " + include_file + "\n") root_makefile.write("endif\n") root_makefile.write("\n") if not generator_flags.get("standalone") and generator_flags.get( "auto_regeneration", True ): WriteAutoRegenerationRule(params, root_makefile, makefile_name, build_files) root_makefile.write(SHARED_FOOTER) root_makefile.close() # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import ntpath import os import posixpath import re import subprocess import sys from collections import OrderedDict import gyp.common import gyp.easy_xml as easy_xml import gyp.generator.ninja as ninja_generator import gyp.MSVSNew as MSVSNew import gyp.MSVSProject as MSVSProject import gyp.MSVSSettings as MSVSSettings import gyp.MSVSToolFile as MSVSToolFile import gyp.MSVSUserFile as MSVSUserFile import gyp.MSVSUtil as MSVSUtil import gyp.MSVSVersion as MSVSVersion from gyp.common import GypError from gyp.common import OrderedSet # Regular expression for validating Visual Studio GUIDs. If the GUID # contains lowercase hex letters, MSVS will be fine. However, # IncrediBuild BuildConsole will parse the solution file, but then # silently skip building the target causing hard to track down errors. # Note that this only happens with the BuildConsole, and does not occur # if IncrediBuild is executed from inside Visual Studio. This regex # validates that the string looks like a GUID with all uppercase hex # letters. VALID_MSVS_GUID_CHARS = re.compile(r"^[A-F0-9\-]+$") generator_supports_multiple_toolsets = gyp.common.CrossCompileRequested() generator_default_variables = { "DRIVER_PREFIX": "", "DRIVER_SUFFIX": ".sys", "EXECUTABLE_PREFIX": "", "EXECUTABLE_SUFFIX": ".exe", "STATIC_LIB_PREFIX": "", "SHARED_LIB_PREFIX": "", "STATIC_LIB_SUFFIX": ".lib", "SHARED_LIB_SUFFIX": ".dll", "INTERMEDIATE_DIR": "$(IntDir)", "SHARED_INTERMEDIATE_DIR": "$(OutDir)/obj/global_intermediate", "OS": "win", "PRODUCT_DIR": "$(OutDir)", "LIB_DIR": "$(OutDir)lib", "RULE_INPUT_ROOT": "$(InputName)", "RULE_INPUT_DIRNAME": "$(InputDir)", "RULE_INPUT_EXT": "$(InputExt)", "RULE_INPUT_NAME": "$(InputFileName)", "RULE_INPUT_PATH": "$(InputPath)", "CONFIGURATION_NAME": "$(ConfigurationName)", } # The msvs specific sections that hold paths generator_additional_path_sections = [ "msvs_cygwin_dirs", "msvs_props", ] generator_additional_non_configuration_keys = [ "msvs_cygwin_dirs", "msvs_cygwin_shell", "msvs_large_pdb", "msvs_shard", "msvs_external_builder", "msvs_external_builder_out_dir", "msvs_external_builder_build_cmd", "msvs_external_builder_clean_cmd", "msvs_external_builder_clcompile_cmd", "msvs_enable_winrt", "msvs_requires_importlibrary", "msvs_enable_winphone", "msvs_application_type_revision", "msvs_target_platform_version", "msvs_target_platform_minversion", ] generator_filelist_paths = None # List of precompiled header related keys. precomp_keys = [ "msvs_precompiled_header", "msvs_precompiled_source", ] cached_username = None cached_domain = None # TODO(gspencer): Switch the os.environ calls to be # win32api.GetDomainName() and win32api.GetUserName() once the # python version in depot_tools has been updated to work on Vista # 64-bit. def _GetDomainAndUserName(): if sys.platform not in ("win32", "cygwin"): return ("DOMAIN", "USERNAME") global cached_username global cached_domain if not cached_domain or not cached_username: domain = os.environ.get("USERDOMAIN") username = os.environ.get("USERNAME") if not domain or not username: call = subprocess.Popen( ["net", "config", "Workstation"], stdout=subprocess.PIPE ) config = call.communicate()[0].decode("utf-8") username_re = re.compile(r"^User name\s+(\S+)", re.MULTILINE) username_match = username_re.search(config) if username_match: username = username_match.group(1) domain_re = re.compile(r"^Logon domain\s+(\S+)", re.MULTILINE) domain_match = domain_re.search(config) if domain_match: domain = domain_match.group(1) cached_domain = domain cached_username = username return (cached_domain, cached_username) fixpath_prefix = None def _NormalizedSource(source): """Normalize the path. But not if that gets rid of a variable, as this may expand to something larger than one directory. Arguments: source: The path to be normalize.d Returns: The normalized path. """ normalized = os.path.normpath(source) if source.count("$") == normalized.count("$"): source = normalized return source def _FixPath(path, separator="\\"): """Convert paths to a form that will make sense in a vcproj file. Arguments: path: The path to convert, may contain / etc. Returns: The path with all slashes made into backslashes. """ if ( fixpath_prefix and path and not os.path.isabs(path) and not path[0] == "$" and not _IsWindowsAbsPath(path) ): path = os.path.join(fixpath_prefix, path) if separator == "\\": path = path.replace("/", "\\") path = _NormalizedSource(path) if separator == "/": path = path.replace("\\", "/") if path and path[-1] == separator: path = path[:-1] return path def _IsWindowsAbsPath(path): """ On Cygwin systems Python needs a little help determining if a path is an absolute Windows path or not, so that it does not treat those as relative, which results in bad paths like: '..\\C:\\\\some_source_code_file.cc' """ return path.startswith("c:") or path.startswith("C:") def _FixPaths(paths, separator="\\"): """Fix each of the paths of the list.""" return [_FixPath(i, separator) for i in paths] def _ConvertSourcesToFilterHierarchy( sources, prefix=None, excluded=None, list_excluded=True, msvs_version=None ): """Converts a list split source file paths into a vcproj folder hierarchy. Arguments: sources: A list of source file paths split. prefix: A list of source file path layers meant to apply to each of sources. excluded: A set of excluded files. msvs_version: A MSVSVersion object. Returns: A hierarchy of filenames and MSVSProject.Filter objects that matches the layout of the source tree. For example: _ConvertSourcesToFilterHierarchy([['a', 'bob1.c'], ['b', 'bob2.c']], prefix=['joe']) --> [MSVSProject.Filter('a', contents=['joe\\a\\bob1.c']), MSVSProject.Filter('b', contents=['joe\\b\\bob2.c'])] """ if not prefix: prefix = [] result = [] excluded_result = [] folders = OrderedDict() # Gather files into the final result, excluded, or folders. for s in sources: if len(s) == 1: filename = _NormalizedSource("\\".join(prefix + s)) if filename in excluded: excluded_result.append(filename) else: result.append(filename) elif msvs_version and not msvs_version.UsesVcxproj(): # For MSVS 2008 and earlier, we need to process all files before walking # the sub folders. if not folders.get(s[0]): folders[s[0]] = [] folders[s[0]].append(s[1:]) else: contents = _ConvertSourcesToFilterHierarchy( [s[1:]], prefix + [s[0]], excluded=excluded, list_excluded=list_excluded, msvs_version=msvs_version, ) contents = MSVSProject.Filter(s[0], contents=contents) result.append(contents) # Add a folder for excluded files. if excluded_result and list_excluded: excluded_folder = MSVSProject.Filter( "_excluded_files", contents=excluded_result ) result.append(excluded_folder) if msvs_version and msvs_version.UsesVcxproj(): return result # Populate all the folders. for f in folders: contents = _ConvertSourcesToFilterHierarchy( folders[f], prefix=prefix + [f], excluded=excluded, list_excluded=list_excluded, msvs_version=msvs_version, ) contents = MSVSProject.Filter(f, contents=contents) result.append(contents) return result def _ToolAppend(tools, tool_name, setting, value, only_if_unset=False): if not value: return _ToolSetOrAppend(tools, tool_name, setting, value, only_if_unset) def _ToolSetOrAppend(tools, tool_name, setting, value, only_if_unset=False): # TODO(bradnelson): ugly hack, fix this more generally!!! if "Directories" in setting or "Dependencies" in setting: if type(value) == str: value = value.replace("/", "\\") else: value = [i.replace("/", "\\") for i in value] if not tools.get(tool_name): tools[tool_name] = dict() tool = tools[tool_name] if "CompileAsWinRT" == setting: return if tool.get(setting): if only_if_unset: return if type(tool[setting]) == list and type(value) == list: tool[setting] += value else: raise TypeError( 'Appending "%s" to a non-list setting "%s" for tool "%s" is ' "not allowed, previous value: %s" % (value, setting, tool_name, str(tool[setting])) ) else: tool[setting] = value def _ConfigTargetVersion(config_data): return config_data.get("msvs_target_version", "Windows7") def _ConfigPlatform(config_data): return config_data.get("msvs_configuration_platform", "Win32") def _ConfigBaseName(config_name, platform_name): if config_name.endswith("_" + platform_name): return config_name[0 : -len(platform_name) - 1] else: return config_name def _ConfigFullName(config_name, config_data): platform_name = _ConfigPlatform(config_data) return f"{_ConfigBaseName(config_name, platform_name)}|{platform_name}" def _ConfigWindowsTargetPlatformVersion(config_data, version): target_ver = config_data.get("msvs_windows_target_platform_version") if target_ver and re.match(r"^\d+", target_ver): return target_ver config_ver = config_data.get("msvs_windows_sdk_version") vers = [config_ver] if config_ver else version.compatible_sdks for ver in vers: for key in [ r"HKLM\Software\Microsoft\Microsoft SDKs\Windows\%s", r"HKLM\Software\Wow6432Node\Microsoft\Microsoft SDKs\Windows\%s", ]: sdk_dir = MSVSVersion._RegistryGetValue(key % ver, "InstallationFolder") if not sdk_dir: continue version = MSVSVersion._RegistryGetValue(key % ver, "ProductVersion") or "" # Find a matching entry in sdk_dir\include. expected_sdk_dir = r"%s\include" % sdk_dir names = sorted( ( x for x in ( os.listdir(expected_sdk_dir) if os.path.isdir(expected_sdk_dir) else [] ) if x.startswith(version) ), reverse=True, ) if names: return names[0] else: print( "Warning: No include files found for detected " "Windows SDK version %s" % (version), file=sys.stdout, ) def _BuildCommandLineForRuleRaw( spec, cmd, cygwin_shell, has_input_path, quote_cmd, do_setup_env ): if [x for x in cmd if "$(InputDir)" in x]: input_dir_preamble = ( "set INPUTDIR=$(InputDir)\n" "if NOT DEFINED INPUTDIR set INPUTDIR=.\\\n" "set INPUTDIR=%INPUTDIR:~0,-1%\n" ) else: input_dir_preamble = "" if cygwin_shell: # Find path to cygwin. cygwin_dir = _FixPath(spec.get("msvs_cygwin_dirs", ["."])[0]) # Prepare command. direct_cmd = cmd direct_cmd = [ i.replace("$(IntDir)", '`cygpath -m "${INTDIR}"`') for i in direct_cmd ] direct_cmd = [ i.replace("$(OutDir)", '`cygpath -m "${OUTDIR}"`') for i in direct_cmd ] direct_cmd = [ i.replace("$(InputDir)", '`cygpath -m "${INPUTDIR}"`') for i in direct_cmd ] if has_input_path: direct_cmd = [ i.replace("$(InputPath)", '`cygpath -m "${INPUTPATH}"`') for i in direct_cmd ] direct_cmd = ['\\"%s\\"' % i.replace('"', '\\\\\\"') for i in direct_cmd] # direct_cmd = gyp.common.EncodePOSIXShellList(direct_cmd) direct_cmd = " ".join(direct_cmd) # TODO(quote): regularize quoting path names throughout the module cmd = "" if do_setup_env: cmd += 'call "$(ProjectDir)%(cygwin_dir)s\\setup_env.bat" && ' cmd += "set CYGWIN=nontsec&& " if direct_cmd.find("NUMBER_OF_PROCESSORS") >= 0: cmd += "set /a NUMBER_OF_PROCESSORS_PLUS_1=%%NUMBER_OF_PROCESSORS%%+1&& " if direct_cmd.find("INTDIR") >= 0: cmd += "set INTDIR=$(IntDir)&& " if direct_cmd.find("OUTDIR") >= 0: cmd += "set OUTDIR=$(OutDir)&& " if has_input_path and direct_cmd.find("INPUTPATH") >= 0: cmd += "set INPUTPATH=$(InputPath) && " cmd += 'bash -c "%(cmd)s"' cmd = cmd % {"cygwin_dir": cygwin_dir, "cmd": direct_cmd} return input_dir_preamble + cmd else: # Convert cat --> type to mimic unix. if cmd[0] == "cat": command = ["type"] else: command = [cmd[0].replace("/", "\\")] # Add call before command to ensure that commands can be tied together one # after the other without aborting in Incredibuild, since IB makes a bat # file out of the raw command string, and some commands (like python) are # actually batch files themselves. command.insert(0, "call") # Fix the paths # TODO(quote): This is a really ugly heuristic, and will miss path fixing # for arguments like "--arg=path" or "/opt:path". # If the argument starts with a slash or dash, it's probably a command line # switch # Return the path with forward slashes because the command using it might # not support backslashes. arguments = [i if (i[:1] in "/-") else _FixPath(i, "/") for i in cmd[1:]] arguments = [i.replace("$(InputDir)", "%INPUTDIR%") for i in arguments] arguments = [MSVSSettings.FixVCMacroSlashes(i) for i in arguments] if quote_cmd: # Support a mode for using cmd directly. # Convert any paths to native form (first element is used directly). # TODO(quote): regularize quoting path names throughout the module arguments = ['"%s"' % i for i in arguments] # Collapse into a single command. return input_dir_preamble + " ".join(command + arguments) def _BuildCommandLineForRule(spec, rule, has_input_path, do_setup_env): # Currently this weird argument munging is used to duplicate the way a # python script would need to be run as part of the chrome tree. # Eventually we should add some sort of rule_default option to set this # per project. For now the behavior chrome needs is the default. mcs = rule.get("msvs_cygwin_shell") if mcs is None: mcs = int(spec.get("msvs_cygwin_shell", 1)) elif isinstance(mcs, str): mcs = int(mcs) quote_cmd = int(rule.get("msvs_quote_cmd", 1)) return _BuildCommandLineForRuleRaw( spec, rule["action"], mcs, has_input_path, quote_cmd, do_setup_env=do_setup_env ) def _AddActionStep(actions_dict, inputs, outputs, description, command): """Merge action into an existing list of actions. Care must be taken so that actions which have overlapping inputs either don't get assigned to the same input, or get collapsed into one. Arguments: actions_dict: dictionary keyed on input name, which maps to a list of dicts describing the actions attached to that input file. inputs: list of inputs outputs: list of outputs description: description of the action command: command line to execute """ # Require there to be at least one input (call sites will ensure this). assert inputs action = { "inputs": inputs, "outputs": outputs, "description": description, "command": command, } # Pick where to stick this action. # While less than optimal in terms of build time, attach them to the first # input for now. chosen_input = inputs[0] # Add it there. if chosen_input not in actions_dict: actions_dict[chosen_input] = [] actions_dict[chosen_input].append(action) def _AddCustomBuildToolForMSVS( p, spec, primary_input, inputs, outputs, description, cmd ): """Add a custom build tool to execute something. Arguments: p: the target project spec: the target project dict primary_input: input file to attach the build tool to inputs: list of inputs outputs: list of outputs description: description of the action cmd: command line to execute """ inputs = _FixPaths(inputs) outputs = _FixPaths(outputs) tool = MSVSProject.Tool( "VCCustomBuildTool", { "Description": description, "AdditionalDependencies": ";".join(inputs), "Outputs": ";".join(outputs), "CommandLine": cmd, }, ) # Add to the properties of primary input for each config. for config_name, c_data in spec["configurations"].items(): p.AddFileConfig( _FixPath(primary_input), _ConfigFullName(config_name, c_data), tools=[tool] ) def _AddAccumulatedActionsToMSVS(p, spec, actions_dict): """Add actions accumulated into an actions_dict, merging as needed. Arguments: p: the target project spec: the target project dict actions_dict: dictionary keyed on input name, which maps to a list of dicts describing the actions attached to that input file. """ for primary_input in actions_dict: inputs = OrderedSet() outputs = OrderedSet() descriptions = [] commands = [] for action in actions_dict[primary_input]: inputs.update(OrderedSet(action["inputs"])) outputs.update(OrderedSet(action["outputs"])) descriptions.append(action["description"]) commands.append(action["command"]) # Add the custom build step for one input file. description = ", and also ".join(descriptions) command = "\r\n".join(commands) _AddCustomBuildToolForMSVS( p, spec, primary_input=primary_input, inputs=inputs, outputs=outputs, description=description, cmd=command, ) def _RuleExpandPath(path, input_file): """Given the input file to which a rule applied, string substitute a path. Arguments: path: a path to string expand input_file: the file to which the rule applied. Returns: The string substituted path. """ path = path.replace( "$(InputName)", os.path.splitext(os.path.split(input_file)[1])[0] ) path = path.replace("$(InputDir)", os.path.dirname(input_file)) path = path.replace( "$(InputExt)", os.path.splitext(os.path.split(input_file)[1])[1] ) path = path.replace("$(InputFileName)", os.path.split(input_file)[1]) path = path.replace("$(InputPath)", input_file) return path def _FindRuleTriggerFiles(rule, sources): """Find the list of files which a particular rule applies to. Arguments: rule: the rule in question sources: the set of all known source files for this project Returns: The list of sources that trigger a particular rule. """ return rule.get("rule_sources", []) def _RuleInputsAndOutputs(rule, trigger_file): """Find the inputs and outputs generated by a rule. Arguments: rule: the rule in question. trigger_file: the main trigger for this rule. Returns: The pair of (inputs, outputs) involved in this rule. """ raw_inputs = _FixPaths(rule.get("inputs", [])) raw_outputs = _FixPaths(rule.get("outputs", [])) inputs = OrderedSet() outputs = OrderedSet() inputs.add(trigger_file) for i in raw_inputs: inputs.add(_RuleExpandPath(i, trigger_file)) for o in raw_outputs: outputs.add(_RuleExpandPath(o, trigger_file)) return (inputs, outputs) def _GenerateNativeRulesForMSVS(p, rules, output_dir, spec, options): """Generate a native rules file. Arguments: p: the target project rules: the set of rules to include output_dir: the directory in which the project/gyp resides spec: the project dict options: global generator options """ rules_filename = "{}{}.rules".format(spec["target_name"], options.suffix) rules_file = MSVSToolFile.Writer( os.path.join(output_dir, rules_filename), spec["target_name"] ) # Add each rule. for r in rules: rule_name = r["rule_name"] rule_ext = r["extension"] inputs = _FixPaths(r.get("inputs", [])) outputs = _FixPaths(r.get("outputs", [])) # Skip a rule with no action and no inputs. if "action" not in r and not r.get("rule_sources", []): continue cmd = _BuildCommandLineForRule(spec, r, has_input_path=True, do_setup_env=True) rules_file.AddCustomBuildRule( name=rule_name, description=r.get("message", rule_name), extensions=[rule_ext], additional_dependencies=inputs, outputs=outputs, cmd=cmd, ) # Write out rules file. rules_file.WriteIfChanged() # Add rules file to project. p.AddToolFile(rules_filename) def _Cygwinify(path): path = path.replace("$(OutDir)", "$(OutDirCygwin)") path = path.replace("$(IntDir)", "$(IntDirCygwin)") return path def _GenerateExternalRules(rules, output_dir, spec, sources, options, actions_to_add): """Generate an external makefile to do a set of rules. Arguments: rules: the list of rules to include output_dir: path containing project and gyp files spec: project specification data sources: set of sources known options: global generator options actions_to_add: The list of actions we will add to. """ filename = "{}_rules{}.mk".format(spec["target_name"], options.suffix) mk_file = gyp.common.WriteOnDiff(os.path.join(output_dir, filename)) # Find cygwin style versions of some paths. mk_file.write('OutDirCygwin:=$(shell cygpath -u "$(OutDir)")\n') mk_file.write('IntDirCygwin:=$(shell cygpath -u "$(IntDir)")\n') # Gather stuff needed to emit all: target. all_inputs = OrderedSet() all_outputs = OrderedSet() all_output_dirs = OrderedSet() first_outputs = [] for rule in rules: trigger_files = _FindRuleTriggerFiles(rule, sources) for tf in trigger_files: inputs, outputs = _RuleInputsAndOutputs(rule, tf) all_inputs.update(OrderedSet(inputs)) all_outputs.update(OrderedSet(outputs)) # Only use one target from each rule as the dependency for # 'all' so we don't try to build each rule multiple times. first_outputs.append(list(outputs)[0]) # Get the unique output directories for this rule. output_dirs = [os.path.split(i)[0] for i in outputs] for od in output_dirs: all_output_dirs.add(od) first_outputs_cyg = [_Cygwinify(i) for i in first_outputs] # Write out all: target, including mkdir for each output directory. mk_file.write("all: %s\n" % " ".join(first_outputs_cyg)) for od in all_output_dirs: if od: mk_file.write('\tmkdir -p `cygpath -u "%s"`\n' % od) mk_file.write("\n") # Define how each output is generated. for rule in rules: trigger_files = _FindRuleTriggerFiles(rule, sources) for tf in trigger_files: # Get all the inputs and outputs for this rule for this trigger file. inputs, outputs = _RuleInputsAndOutputs(rule, tf) inputs = [_Cygwinify(i) for i in inputs] outputs = [_Cygwinify(i) for i in outputs] # Prepare the command line for this rule. cmd = [_RuleExpandPath(c, tf) for c in rule["action"]] cmd = ['"%s"' % i for i in cmd] cmd = " ".join(cmd) # Add it to the makefile. mk_file.write("{}: {}\n".format(" ".join(outputs), " ".join(inputs))) mk_file.write("\t%s\n\n" % cmd) # Close up the file. mk_file.close() # Add makefile to list of sources. sources.add(filename) # Add a build action to call makefile. cmd = [ "make", "OutDir=$(OutDir)", "IntDir=$(IntDir)", "-j", "${NUMBER_OF_PROCESSORS_PLUS_1}", "-f", filename, ] cmd = _BuildCommandLineForRuleRaw(spec, cmd, True, False, True, True) # Insert makefile as 0'th input, so it gets the action attached there, # as this is easier to understand from in the IDE. all_inputs = list(all_inputs) all_inputs.insert(0, filename) _AddActionStep( actions_to_add, inputs=_FixPaths(all_inputs), outputs=_FixPaths(all_outputs), description="Running external rules for %s" % spec["target_name"], command=cmd, ) def _EscapeEnvironmentVariableExpansion(s): """Escapes % characters. Escapes any % characters so that Windows-style environment variable expansions will leave them alone. See http://connect.microsoft.com/VisualStudio/feedback/details/106127/cl-d-name-text-containing-percentage-characters-doesnt-compile to understand why we have to do this. Args: s: The string to be escaped. Returns: The escaped string. """ # noqa: E731,E123,E501 s = s.replace("%", "%%") return s quote_replacer_regex = re.compile(r'(\\*)"') def _EscapeCommandLineArgumentForMSVS(s): """Escapes a Windows command-line argument. So that the Win32 CommandLineToArgv function will turn the escaped result back into the original string. See http://msdn.microsoft.com/en-us/library/17w5ykft.aspx ("Parsing C++ Command-Line Arguments") to understand why we have to do this. Args: s: the string to be escaped. Returns: the escaped string. """ def _Replace(match): # For a literal quote, CommandLineToArgv requires an odd number of # backslashes preceding it, and it produces half as many literal backslashes # (rounded down). So we need to produce 2n+1 backslashes. return 2 * match.group(1) + '\\"' # Escape all quotes so that they are interpreted literally. s = quote_replacer_regex.sub(_Replace, s) # Now add unescaped quotes so that any whitespace is interpreted literally. s = '"' + s + '"' return s delimiters_replacer_regex = re.compile(r"(\\*)([,;]+)") def _EscapeVCProjCommandLineArgListItem(s): """Escapes command line arguments for MSVS. The VCProj format stores string lists in a single string using commas and semi-colons as separators, which must be quoted if they are to be interpreted literally. However, command-line arguments may already have quotes, and the VCProj parser is ignorant of the backslash escaping convention used by CommandLineToArgv, so the command-line quotes and the VCProj quotes may not be the same quotes. So to store a general command-line argument in a VCProj list, we need to parse the existing quoting according to VCProj's convention and quote any delimiters that are not already quoted by that convention. The quotes that we add will also be seen by CommandLineToArgv, so if backslashes precede them then we also have to escape those backslashes according to the CommandLineToArgv convention. Args: s: the string to be escaped. Returns: the escaped string. """ def _Replace(match): # For a non-literal quote, CommandLineToArgv requires an even number of # backslashes preceding it, and it produces half as many literal # backslashes. So we need to produce 2n backslashes. return 2 * match.group(1) + '"' + match.group(2) + '"' segments = s.split('"') # The unquoted segments are at the even-numbered indices. for i in range(0, len(segments), 2): segments[i] = delimiters_replacer_regex.sub(_Replace, segments[i]) # Concatenate back into a single string s = '"'.join(segments) if len(segments) % 2 == 0: # String ends while still quoted according to VCProj's convention. This # means the delimiter and the next list item that follow this one in the # .vcproj file will be misinterpreted as part of this item. There is nothing # we can do about this. Adding an extra quote would correct the problem in # the VCProj but cause the same problem on the final command-line. Moving # the item to the end of the list does works, but that's only possible if # there's only one such item. Let's just warn the user. print( "Warning: MSVS may misinterpret the odd number of " + "quotes in " + s, file=sys.stderr, ) return s def _EscapeCppDefineForMSVS(s): """Escapes a CPP define so that it will reach the compiler unaltered.""" s = _EscapeEnvironmentVariableExpansion(s) s = _EscapeCommandLineArgumentForMSVS(s) s = _EscapeVCProjCommandLineArgListItem(s) # cl.exe replaces literal # characters with = in preprocessor definitions for # some reason. Octal-encode to work around that. s = s.replace("#", "\\%03o" % ord("#")) return s quote_replacer_regex2 = re.compile(r'(\\+)"') def _EscapeCommandLineArgumentForMSBuild(s): """Escapes a Windows command-line argument for use by MSBuild.""" def _Replace(match): return (len(match.group(1)) / 2 * 4) * "\\" + '\\"' # Escape all quotes so that they are interpreted literally. s = quote_replacer_regex2.sub(_Replace, s) return s def _EscapeMSBuildSpecialCharacters(s): escape_dictionary = { "%": "%25", "$": "%24", "@": "%40", "'": "%27", ";": "%3B", "?": "%3F", "*": "%2A", } result = "".join([escape_dictionary.get(c, c) for c in s]) return result def _EscapeCppDefineForMSBuild(s): """Escapes a CPP define so that it will reach the compiler unaltered.""" s = _EscapeEnvironmentVariableExpansion(s) s = _EscapeCommandLineArgumentForMSBuild(s) s = _EscapeMSBuildSpecialCharacters(s) # cl.exe replaces literal # characters with = in preprocessor definitions for # some reason. Octal-encode to work around that. s = s.replace("#", "\\%03o" % ord("#")) return s def _GenerateRulesForMSVS( p, output_dir, options, spec, sources, excluded_sources, actions_to_add ): """Generate all the rules for a particular project. Arguments: p: the project output_dir: directory to emit rules to options: global options passed to the generator spec: the specification for this project sources: the set of all known source files in this project excluded_sources: the set of sources excluded from normal processing actions_to_add: deferred list of actions to add in """ rules = spec.get("rules", []) rules_native = [r for r in rules if not int(r.get("msvs_external_rule", 0))] rules_external = [r for r in rules if int(r.get("msvs_external_rule", 0))] # Handle rules that use a native rules file. if rules_native: _GenerateNativeRulesForMSVS(p, rules_native, output_dir, spec, options) # Handle external rules (non-native rules). if rules_external: _GenerateExternalRules( rules_external, output_dir, spec, sources, options, actions_to_add ) _AdjustSourcesForRules(rules, sources, excluded_sources, False) def _AdjustSourcesForRules(rules, sources, excluded_sources, is_msbuild): # Add outputs generated by each rule (if applicable). for rule in rules: # Add in the outputs from this rule. trigger_files = _FindRuleTriggerFiles(rule, sources) for trigger_file in trigger_files: # Remove trigger_file from excluded_sources to let the rule be triggered # (e.g. rule trigger ax_enums.idl is added to excluded_sources # because it's also in an action's inputs in the same project) excluded_sources.discard(_FixPath(trigger_file)) # Done if not processing outputs as sources. if int(rule.get("process_outputs_as_sources", False)): inputs, outputs = _RuleInputsAndOutputs(rule, trigger_file) inputs = OrderedSet(_FixPaths(inputs)) outputs = OrderedSet(_FixPaths(outputs)) inputs.remove(_FixPath(trigger_file)) sources.update(inputs) if not is_msbuild: excluded_sources.update(inputs) sources.update(outputs) def _FilterActionsFromExcluded(excluded_sources, actions_to_add): """Take inputs with actions attached out of the list of exclusions. Arguments: excluded_sources: list of source files not to be built. actions_to_add: dict of actions keyed on source file they're attached to. Returns: excluded_sources with files that have actions attached removed. """ must_keep = OrderedSet(_FixPaths(actions_to_add.keys())) return [s for s in excluded_sources if s not in must_keep] def _GetDefaultConfiguration(spec): return spec["configurations"][spec["default_configuration"]] def _GetGuidOfProject(proj_path, spec): """Get the guid for the project. Arguments: proj_path: Path of the vcproj or vcxproj file to generate. spec: The target dictionary containing the properties of the target. Returns: the guid. Raises: ValueError: if the specified GUID is invalid. """ # Pluck out the default configuration. default_config = _GetDefaultConfiguration(spec) # Decide the guid of the project. guid = default_config.get("msvs_guid") if guid: if VALID_MSVS_GUID_CHARS.match(guid) is None: raise ValueError( 'Invalid MSVS guid: "%s". Must match regex: "%s".' % (guid, VALID_MSVS_GUID_CHARS.pattern) ) guid = "{%s}" % guid guid = guid or MSVSNew.MakeGuid(proj_path) return guid def _GetMsbuildToolsetOfProject(proj_path, spec, version): """Get the platform toolset for the project. Arguments: proj_path: Path of the vcproj or vcxproj file to generate. spec: The target dictionary containing the properties of the target. version: The MSVSVersion object. Returns: the platform toolset string or None. """ # Pluck out the default configuration. default_config = _GetDefaultConfiguration(spec) toolset = default_config.get("msbuild_toolset") if not toolset and version.DefaultToolset(): toolset = version.DefaultToolset() if spec["type"] == "windows_driver": toolset = "WindowsKernelModeDriver10.0" return toolset def _GenerateProject(project, options, version, generator_flags, spec): """Generates a vcproj file. Arguments: project: the MSVSProject object. options: global generator options. version: the MSVSVersion object. generator_flags: dict of generator-specific flags. Returns: A list of source files that cannot be found on disk. """ default_config = _GetDefaultConfiguration(project.spec) # Skip emitting anything if told to with msvs_existing_vcproj option. if default_config.get("msvs_existing_vcproj"): return [] if version.UsesVcxproj(): return _GenerateMSBuildProject(project, options, version, generator_flags, spec) else: return _GenerateMSVSProject(project, options, version, generator_flags) def _GenerateMSVSProject(project, options, version, generator_flags): """Generates a .vcproj file. It may create .rules and .user files too. Arguments: project: The project object we will generate the file for. options: Global options passed to the generator. version: The VisualStudioVersion object. generator_flags: dict of generator-specific flags. """ spec = project.spec gyp.common.EnsureDirExists(project.path) platforms = _GetUniquePlatforms(spec) p = MSVSProject.Writer( project.path, version, spec["target_name"], project.guid, platforms ) # Get directory project file is in. project_dir = os.path.split(project.path)[0] gyp_path = _NormalizedSource(project.build_file) relative_path_of_gyp_file = gyp.common.RelativePath(gyp_path, project_dir) config_type = _GetMSVSConfigurationType(spec, project.build_file) for config_name, config in spec["configurations"].items(): _AddConfigurationToMSVSProject(p, spec, config_type, config_name, config) # Prepare list of sources and excluded sources. gyp_file = os.path.split(project.build_file)[1] sources, excluded_sources = _PrepareListOfSources(spec, generator_flags, gyp_file) # Add rules. actions_to_add = {} _GenerateRulesForMSVS( p, project_dir, options, spec, sources, excluded_sources, actions_to_add ) list_excluded = generator_flags.get("msvs_list_excluded_files", True) sources, excluded_sources, excluded_idl = _AdjustSourcesAndConvertToFilterHierarchy( spec, options, project_dir, sources, excluded_sources, list_excluded, version ) # Add in files. missing_sources = _VerifySourcesExist(sources, project_dir) p.AddFiles(sources) _AddToolFilesToMSVS(p, spec) _HandlePreCompiledHeaders(p, sources, spec) _AddActions(actions_to_add, spec, relative_path_of_gyp_file) _AddCopies(actions_to_add, spec) _WriteMSVSUserFile(project.path, version, spec) # NOTE: this stanza must appear after all actions have been decided. # Don't excluded sources with actions attached, or they won't run. excluded_sources = _FilterActionsFromExcluded(excluded_sources, actions_to_add) _ExcludeFilesFromBeingBuilt(p, spec, excluded_sources, excluded_idl, list_excluded) _AddAccumulatedActionsToMSVS(p, spec, actions_to_add) # Write it out. p.WriteIfChanged() return missing_sources def _GetUniquePlatforms(spec): """Returns the list of unique platforms for this spec, e.g ['win32', ...]. Arguments: spec: The target dictionary containing the properties of the target. Returns: The MSVSUserFile object created. """ # Gather list of unique platforms. platforms = OrderedSet() for configuration in spec["configurations"]: platforms.add(_ConfigPlatform(spec["configurations"][configuration])) platforms = list(platforms) return platforms def _CreateMSVSUserFile(proj_path, version, spec): """Generates a .user file for the user running this Gyp program. Arguments: proj_path: The path of the project file being created. The .user file shares the same path (with an appropriate suffix). version: The VisualStudioVersion object. spec: The target dictionary containing the properties of the target. Returns: The MSVSUserFile object created. """ (domain, username) = _GetDomainAndUserName() vcuser_filename = ".".join([proj_path, domain, username, "user"]) user_file = MSVSUserFile.Writer(vcuser_filename, version, spec["target_name"]) return user_file def _GetMSVSConfigurationType(spec, build_file): """Returns the configuration type for this project. It's a number defined by Microsoft. May raise an exception. Args: spec: The target dictionary containing the properties of the target. build_file: The path of the gyp file. Returns: An integer, the configuration type. """ try: config_type = { "executable": "1", # .exe "shared_library": "2", # .dll "loadable_module": "2", # .dll "static_library": "4", # .lib "windows_driver": "5", # .sys "none": "10", # Utility type }[spec["type"]] except KeyError: if spec.get("type"): raise GypError( "Target type %s is not a valid target type for " "target %s in %s." % (spec["type"], spec["target_name"], build_file) ) else: raise GypError( "Missing type field for target %s in %s." % (spec["target_name"], build_file) ) return config_type def _AddConfigurationToMSVSProject(p, spec, config_type, config_name, config): """Adds a configuration to the MSVS project. Many settings in a vcproj file are specific to a configuration. This function the main part of the vcproj file that's configuration specific. Arguments: p: The target project being generated. spec: The target dictionary containing the properties of the target. config_type: The configuration type, a number as defined by Microsoft. config_name: The name of the configuration. config: The dictionary that defines the special processing to be done for this configuration. """ # Get the information for this configuration include_dirs, midl_include_dirs, resource_include_dirs = _GetIncludeDirs(config) libraries = _GetLibraries(spec) library_dirs = _GetLibraryDirs(config) out_file, vc_tool, _ = _GetOutputFilePathAndTool(spec, msbuild=False) defines = _GetDefines(config) defines = [_EscapeCppDefineForMSVS(d) for d in defines] disabled_warnings = _GetDisabledWarnings(config) prebuild = config.get("msvs_prebuild") postbuild = config.get("msvs_postbuild") def_file = _GetModuleDefinition(spec) precompiled_header = config.get("msvs_precompiled_header") # Prepare the list of tools as a dictionary. tools = dict() # Add in user specified msvs_settings. msvs_settings = config.get("msvs_settings", {}) MSVSSettings.ValidateMSVSSettings(msvs_settings) # Prevent default library inheritance from the environment. _ToolAppend(tools, "VCLinkerTool", "AdditionalDependencies", ["$(NOINHERIT)"]) for tool in msvs_settings: settings = config["msvs_settings"][tool] for setting in settings: _ToolAppend(tools, tool, setting, settings[setting]) # Add the information to the appropriate tool _ToolAppend(tools, "VCCLCompilerTool", "AdditionalIncludeDirectories", include_dirs) _ToolAppend(tools, "VCMIDLTool", "AdditionalIncludeDirectories", midl_include_dirs) _ToolAppend( tools, "VCResourceCompilerTool", "AdditionalIncludeDirectories", resource_include_dirs, ) # Add in libraries. _ToolAppend(tools, "VCLinkerTool", "AdditionalDependencies", libraries) _ToolAppend(tools, "VCLinkerTool", "AdditionalLibraryDirectories", library_dirs) if out_file: _ToolAppend(tools, vc_tool, "OutputFile", out_file, only_if_unset=True) # Add defines. _ToolAppend(tools, "VCCLCompilerTool", "PreprocessorDefinitions", defines) _ToolAppend(tools, "VCResourceCompilerTool", "PreprocessorDefinitions", defines) # Change program database directory to prevent collisions. _ToolAppend( tools, "VCCLCompilerTool", "ProgramDataBaseFileName", "$(IntDir)$(ProjectName)\\vc80.pdb", only_if_unset=True, ) # Add disabled warnings. _ToolAppend(tools, "VCCLCompilerTool", "DisableSpecificWarnings", disabled_warnings) # Add Pre-build. _ToolAppend(tools, "VCPreBuildEventTool", "CommandLine", prebuild) # Add Post-build. _ToolAppend(tools, "VCPostBuildEventTool", "CommandLine", postbuild) # Turn on precompiled headers if appropriate. if precompiled_header: precompiled_header = os.path.split(precompiled_header)[1] _ToolAppend(tools, "VCCLCompilerTool", "UsePrecompiledHeader", "2") _ToolAppend( tools, "VCCLCompilerTool", "PrecompiledHeaderThrough", precompiled_header ) _ToolAppend(tools, "VCCLCompilerTool", "ForcedIncludeFiles", precompiled_header) # Loadable modules don't generate import libraries; # tell dependent projects to not expect one. if spec["type"] == "loadable_module": _ToolAppend(tools, "VCLinkerTool", "IgnoreImportLibrary", "true") # Set the module definition file if any. if def_file: _ToolAppend(tools, "VCLinkerTool", "ModuleDefinitionFile", def_file) _AddConfigurationToMSVS(p, spec, tools, config, config_type, config_name) def _GetIncludeDirs(config): """Returns the list of directories to be used for #include directives. Arguments: config: The dictionary that defines the special processing to be done for this configuration. Returns: The list of directory paths. """ # TODO(bradnelson): include_dirs should really be flexible enough not to # require this sort of thing. include_dirs = config.get("include_dirs", []) + config.get( "msvs_system_include_dirs", [] ) midl_include_dirs = config.get("midl_include_dirs", []) + config.get( "msvs_system_include_dirs", [] ) resource_include_dirs = config.get("resource_include_dirs", include_dirs) include_dirs = _FixPaths(include_dirs) midl_include_dirs = _FixPaths(midl_include_dirs) resource_include_dirs = _FixPaths(resource_include_dirs) return include_dirs, midl_include_dirs, resource_include_dirs def _GetLibraryDirs(config): """Returns the list of directories to be used for library search paths. Arguments: config: The dictionary that defines the special processing to be done for this configuration. Returns: The list of directory paths. """ library_dirs = config.get("library_dirs", []) library_dirs = _FixPaths(library_dirs) return library_dirs def _GetLibraries(spec): """Returns the list of libraries for this configuration. Arguments: spec: The target dictionary containing the properties of the target. Returns: The list of directory paths. """ libraries = spec.get("libraries", []) # Strip out -l, as it is not used on windows (but is needed so we can pass # in libraries that are assumed to be in the default library path). # Also remove duplicate entries, leaving only the last duplicate, while # preserving order. found = OrderedSet() unique_libraries_list = [] for entry in reversed(libraries): library = re.sub(r"^\-l", "", entry) if not os.path.splitext(library)[1]: library += ".lib" if library not in found: found.add(library) unique_libraries_list.append(library) unique_libraries_list.reverse() return unique_libraries_list def _GetOutputFilePathAndTool(spec, msbuild): """Returns the path and tool to use for this target. Figures out the path of the file this spec will create and the name of the VC tool that will create it. Arguments: spec: The target dictionary containing the properties of the target. Returns: A triple of (file path, name of the vc tool, name of the msbuild tool) """ # Select a name for the output file. out_file = "" vc_tool = "" msbuild_tool = "" output_file_map = { "executable": ("VCLinkerTool", "Link", "$(OutDir)", ".exe"), "shared_library": ("VCLinkerTool", "Link", "$(OutDir)", ".dll"), "loadable_module": ("VCLinkerTool", "Link", "$(OutDir)", ".dll"), "windows_driver": ("VCLinkerTool", "Link", "$(OutDir)", ".sys"), "static_library": ("VCLibrarianTool", "Lib", "$(OutDir)lib\\", ".lib"), } output_file_props = output_file_map.get(spec["type"]) if output_file_props and int(spec.get("msvs_auto_output_file", 1)): vc_tool, msbuild_tool, out_dir, suffix = output_file_props if spec.get("standalone_static_library", 0): out_dir = "$(OutDir)" out_dir = spec.get("product_dir", out_dir) product_extension = spec.get("product_extension") if product_extension: suffix = "." + product_extension elif msbuild: suffix = "$(TargetExt)" prefix = spec.get("product_prefix", "") product_name = spec.get("product_name", "$(ProjectName)") out_file = ntpath.join(out_dir, prefix + product_name + suffix) return out_file, vc_tool, msbuild_tool def _GetOutputTargetExt(spec): """Returns the extension for this target, including the dot If product_extension is specified, set target_extension to this to avoid MSB8012, returns None otherwise. Ignores any target_extension settings in the input files. Arguments: spec: The target dictionary containing the properties of the target. Returns: A string with the extension, or None """ target_extension = spec.get("product_extension") if target_extension: return "." + target_extension return None def _GetDefines(config): """Returns the list of preprocessor definitions for this configuration. Arguments: config: The dictionary that defines the special processing to be done for this configuration. Returns: The list of preprocessor definitions. """ defines = [] for d in config.get("defines", []): if type(d) == list: fd = "=".join([str(dpart) for dpart in d]) else: fd = str(d) defines.append(fd) return defines def _GetDisabledWarnings(config): return [str(i) for i in config.get("msvs_disabled_warnings", [])] def _GetModuleDefinition(spec): def_file = "" if spec["type"] in [ "shared_library", "loadable_module", "executable", "windows_driver", ]: def_files = [s for s in spec.get("sources", []) if s.endswith(".def")] if len(def_files) == 1: def_file = _FixPath(def_files[0]) elif def_files: raise ValueError( "Multiple module definition files in one target, target %s lists " "multiple .def files: %s" % (spec["target_name"], " ".join(def_files)) ) return def_file def _ConvertToolsToExpectedForm(tools): """Convert tools to a form expected by Visual Studio. Arguments: tools: A dictionary of settings; the tool name is the key. Returns: A list of Tool objects. """ tool_list = [] for tool, settings in tools.items(): # Collapse settings with lists. settings_fixed = {} for setting, value in settings.items(): if type(value) == list: if ( tool == "VCLinkerTool" and setting == "AdditionalDependencies" ) or setting == "AdditionalOptions": settings_fixed[setting] = " ".join(value) else: settings_fixed[setting] = ";".join(value) else: settings_fixed[setting] = value # Add in this tool. tool_list.append(MSVSProject.Tool(tool, settings_fixed)) return tool_list def _AddConfigurationToMSVS(p, spec, tools, config, config_type, config_name): """Add to the project file the configuration specified by config. Arguments: p: The target project being generated. spec: the target project dict. tools: A dictionary of settings; the tool name is the key. config: The dictionary that defines the special processing to be done for this configuration. config_type: The configuration type, a number as defined by Microsoft. config_name: The name of the configuration. """ attributes = _GetMSVSAttributes(spec, config, config_type) # Add in this configuration. tool_list = _ConvertToolsToExpectedForm(tools) p.AddConfig(_ConfigFullName(config_name, config), attrs=attributes, tools=tool_list) def _GetMSVSAttributes(spec, config, config_type): # Prepare configuration attributes. prepared_attrs = {} source_attrs = config.get("msvs_configuration_attributes", {}) for a in source_attrs: prepared_attrs[a] = source_attrs[a] # Add props files. vsprops_dirs = config.get("msvs_props", []) vsprops_dirs = _FixPaths(vsprops_dirs) if vsprops_dirs: prepared_attrs["InheritedPropertySheets"] = ";".join(vsprops_dirs) # Set configuration type. prepared_attrs["ConfigurationType"] = config_type output_dir = prepared_attrs.get( "OutputDirectory", "$(SolutionDir)$(ConfigurationName)" ) prepared_attrs["OutputDirectory"] = _FixPath(output_dir) + "\\" if "IntermediateDirectory" not in prepared_attrs: intermediate = "$(ConfigurationName)\\obj\\$(ProjectName)" prepared_attrs["IntermediateDirectory"] = _FixPath(intermediate) + "\\" else: intermediate = _FixPath(prepared_attrs["IntermediateDirectory"]) + "\\" intermediate = MSVSSettings.FixVCMacroSlashes(intermediate) prepared_attrs["IntermediateDirectory"] = intermediate return prepared_attrs def _AddNormalizedSources(sources_set, sources_array): sources_set.update(_NormalizedSource(s) for s in sources_array) def _PrepareListOfSources(spec, generator_flags, gyp_file): """Prepare list of sources and excluded sources. Besides the sources specified directly in the spec, adds the gyp file so that a change to it will cause a re-compile. Also adds appropriate sources for actions and copies. Assumes later stage will un-exclude files which have custom build steps attached. Arguments: spec: The target dictionary containing the properties of the target. gyp_file: The name of the gyp file. Returns: A pair of (list of sources, list of excluded sources). The sources will be relative to the gyp file. """ sources = OrderedSet() _AddNormalizedSources(sources, spec.get("sources", [])) excluded_sources = OrderedSet() # Add in the gyp file. if not generator_flags.get("standalone"): sources.add(gyp_file) # Add in 'action' inputs and outputs. for a in spec.get("actions", []): inputs = a["inputs"] inputs = [_NormalizedSource(i) for i in inputs] # Add all inputs to sources and excluded sources. inputs = OrderedSet(inputs) sources.update(inputs) if not spec.get("msvs_external_builder"): excluded_sources.update(inputs) if int(a.get("process_outputs_as_sources", False)): _AddNormalizedSources(sources, a.get("outputs", [])) # Add in 'copies' inputs and outputs. for cpy in spec.get("copies", []): _AddNormalizedSources(sources, cpy.get("files", [])) return (sources, excluded_sources) def _AdjustSourcesAndConvertToFilterHierarchy( spec, options, gyp_dir, sources, excluded_sources, list_excluded, version ): """Adjusts the list of sources and excluded sources. Also converts the sets to lists. Arguments: spec: The target dictionary containing the properties of the target. options: Global generator options. gyp_dir: The path to the gyp file being processed. sources: A set of sources to be included for this project. excluded_sources: A set of sources to be excluded for this project. version: A MSVSVersion object. Returns: A trio of (list of sources, list of excluded sources, path of excluded IDL file) """ # Exclude excluded sources coming into the generator. excluded_sources.update(OrderedSet(spec.get("sources_excluded", []))) # Add excluded sources into sources for good measure. sources.update(excluded_sources) # Convert to proper windows form. # NOTE: sources goes from being a set to a list here. # NOTE: excluded_sources goes from being a set to a list here. sources = _FixPaths(sources) # Convert to proper windows form. excluded_sources = _FixPaths(excluded_sources) excluded_idl = _IdlFilesHandledNonNatively(spec, sources) precompiled_related = _GetPrecompileRelatedFiles(spec) # Find the excluded ones, minus the precompiled header related ones. fully_excluded = [i for i in excluded_sources if i not in precompiled_related] # Convert to folders and the right slashes. sources = [i.split("\\") for i in sources] sources = _ConvertSourcesToFilterHierarchy( sources, excluded=fully_excluded, list_excluded=list_excluded, msvs_version=version, ) # Prune filters with a single child to flatten ugly directory structures # such as ../../src/modules/module1 etc. if version.UsesVcxproj(): while ( all([isinstance(s, MSVSProject.Filter) for s in sources]) and len({s.name for s in sources}) == 1 ): assert all([len(s.contents) == 1 for s in sources]) sources = [s.contents[0] for s in sources] else: while len(sources) == 1 and isinstance(sources[0], MSVSProject.Filter): sources = sources[0].contents return sources, excluded_sources, excluded_idl def _IdlFilesHandledNonNatively(spec, sources): # If any non-native rules use 'idl' as an extension exclude idl files. # Gather a list here to use later. using_idl = False for rule in spec.get("rules", []): if rule["extension"] == "idl" and int(rule.get("msvs_external_rule", 0)): using_idl = True break if using_idl: excluded_idl = [i for i in sources if i.endswith(".idl")] else: excluded_idl = [] return excluded_idl def _GetPrecompileRelatedFiles(spec): # Gather a list of precompiled header related sources. precompiled_related = [] for _, config in spec["configurations"].items(): for k in precomp_keys: f = config.get(k) if f: precompiled_related.append(_FixPath(f)) return precompiled_related def _ExcludeFilesFromBeingBuilt(p, spec, excluded_sources, excluded_idl, list_excluded): exclusions = _GetExcludedFilesFromBuild(spec, excluded_sources, excluded_idl) for file_name, excluded_configs in exclusions.items(): if not list_excluded and len(excluded_configs) == len(spec["configurations"]): # If we're not listing excluded files, then they won't appear in the # project, so don't try to configure them to be excluded. pass else: for config_name, config in excluded_configs: p.AddFileConfig( file_name, _ConfigFullName(config_name, config), {"ExcludedFromBuild": "true"}, ) def _GetExcludedFilesFromBuild(spec, excluded_sources, excluded_idl): exclusions = {} # Exclude excluded sources from being built. for f in excluded_sources: excluded_configs = [] for config_name, config in spec["configurations"].items(): precomped = [_FixPath(config.get(i, "")) for i in precomp_keys] # Don't do this for ones that are precompiled header related. if f not in precomped: excluded_configs.append((config_name, config)) exclusions[f] = excluded_configs # If any non-native rules use 'idl' as an extension exclude idl files. # Exclude them now. for f in excluded_idl: excluded_configs = [] for config_name, config in spec["configurations"].items(): excluded_configs.append((config_name, config)) exclusions[f] = excluded_configs return exclusions def _AddToolFilesToMSVS(p, spec): # Add in tool files (rules). tool_files = OrderedSet() for _, config in spec["configurations"].items(): for f in config.get("msvs_tool_files", []): tool_files.add(f) for f in tool_files: p.AddToolFile(f) def _HandlePreCompiledHeaders(p, sources, spec): # Pre-compiled header source stubs need a different compiler flag # (generate precompiled header) and any source file not of the same # kind (i.e. C vs. C++) as the precompiled header source stub needs # to have use of precompiled headers disabled. extensions_excluded_from_precompile = [] for config_name, config in spec["configurations"].items(): source = config.get("msvs_precompiled_source") if source: source = _FixPath(source) # UsePrecompiledHeader=1 for if using precompiled headers. tool = MSVSProject.Tool("VCCLCompilerTool", {"UsePrecompiledHeader": "1"}) p.AddFileConfig( source, _ConfigFullName(config_name, config), {}, tools=[tool] ) basename, extension = os.path.splitext(source) if extension == ".c": extensions_excluded_from_precompile = [".cc", ".cpp", ".cxx"] else: extensions_excluded_from_precompile = [".c"] def DisableForSourceTree(source_tree): for source in source_tree: if isinstance(source, MSVSProject.Filter): DisableForSourceTree(source.contents) else: basename, extension = os.path.splitext(source) if extension in extensions_excluded_from_precompile: for config_name, config in spec["configurations"].items(): tool = MSVSProject.Tool( "VCCLCompilerTool", { "UsePrecompiledHeader": "0", "ForcedIncludeFiles": "$(NOINHERIT)", }, ) p.AddFileConfig( _FixPath(source), _ConfigFullName(config_name, config), {}, tools=[tool], ) # Do nothing if there was no precompiled source. if extensions_excluded_from_precompile: DisableForSourceTree(sources) def _AddActions(actions_to_add, spec, relative_path_of_gyp_file): # Add actions. actions = spec.get("actions", []) # Don't setup_env every time. When all the actions are run together in one # batch file in VS, the PATH will grow too long. # Membership in this set means that the cygwin environment has been set up, # and does not need to be set up again. have_setup_env = set() for a in actions: # Attach actions to the gyp file if nothing else is there. inputs = a.get("inputs") or [relative_path_of_gyp_file] attached_to = inputs[0] need_setup_env = attached_to not in have_setup_env cmd = _BuildCommandLineForRule( spec, a, has_input_path=False, do_setup_env=need_setup_env ) have_setup_env.add(attached_to) # Add the action. _AddActionStep( actions_to_add, inputs=inputs, outputs=a.get("outputs", []), description=a.get("message", a["action_name"]), command=cmd, ) def _WriteMSVSUserFile(project_path, version, spec): # Add run_as and test targets. if "run_as" in spec: run_as = spec["run_as"] action = run_as.get("action", []) environment = run_as.get("environment", []) working_directory = run_as.get("working_directory", ".") elif int(spec.get("test", 0)): action = ["$(TargetPath)", "--gtest_print_time"] environment = [] working_directory = "." else: return # Nothing to add # Write out the user file. user_file = _CreateMSVSUserFile(project_path, version, spec) for config_name, c_data in spec["configurations"].items(): user_file.AddDebugSettings( _ConfigFullName(config_name, c_data), action, environment, working_directory ) user_file.WriteIfChanged() def _AddCopies(actions_to_add, spec): copies = _GetCopies(spec) for inputs, outputs, cmd, description in copies: _AddActionStep( actions_to_add, inputs=inputs, outputs=outputs, description=description, command=cmd, ) def _GetCopies(spec): copies = [] # Add copies. for cpy in spec.get("copies", []): for src in cpy.get("files", []): dst = os.path.join(cpy["destination"], os.path.basename(src)) # _AddCustomBuildToolForMSVS() will call _FixPath() on the inputs and # outputs, so do the same for our generated command line. if src.endswith("/"): src_bare = src[:-1] base_dir = posixpath.split(src_bare)[0] outer_dir = posixpath.split(src_bare)[1] fixed_dst = _FixPath(dst) full_dst = f'"{fixed_dst}\\{outer_dir}\\"' cmd = 'mkdir {} 2>nul & cd "{}" && xcopy /e /f /y "{}" {}'.format( full_dst, _FixPath(base_dir), outer_dir, full_dst, ) copies.append( ( [src], ["dummy_copies", dst], cmd, f"Copying {src} to {fixed_dst}", ) ) else: fix_dst = _FixPath(cpy["destination"]) cmd = 'mkdir "{}" 2>nul & set ERRORLEVEL=0 & copy /Y "{}" "{}"'.format( fix_dst, _FixPath(src), _FixPath(dst), ) copies.append(([src], [dst], cmd, f"Copying {src} to {fix_dst}")) return copies def _GetPathDict(root, path): # |path| will eventually be empty (in the recursive calls) if it was initially # relative; otherwise it will eventually end up as '\', 'D:\', etc. if not path or path.endswith(os.sep): return root parent, folder = os.path.split(path) parent_dict = _GetPathDict(root, parent) if folder not in parent_dict: parent_dict[folder] = dict() return parent_dict[folder] def _DictsToFolders(base_path, bucket, flat): # Convert to folders recursively. children = [] for folder, contents in bucket.items(): if type(contents) == dict: folder_children = _DictsToFolders( os.path.join(base_path, folder), contents, flat ) if flat: children += folder_children else: folder_children = MSVSNew.MSVSFolder( os.path.join(base_path, folder), name="(" + folder + ")", entries=folder_children, ) children.append(folder_children) else: children.append(contents) return children def _CollapseSingles(parent, node): # Recursively explorer the tree of dicts looking for projects which are # the sole item in a folder which has the same name as the project. Bring # such projects up one level. if type(node) == dict and len(node) == 1 and next(iter(node)) == parent + ".vcproj": return node[next(iter(node))] if type(node) != dict: return node for child in node: node[child] = _CollapseSingles(child, node[child]) return node def _GatherSolutionFolders(sln_projects, project_objects, flat): root = {} # Convert into a tree of dicts on path. for p in sln_projects: gyp_file, target = gyp.common.ParseQualifiedTarget(p)[0:2] if p.endswith("#host"): target += "_host" gyp_dir = os.path.dirname(gyp_file) path_dict = _GetPathDict(root, gyp_dir) path_dict[target + ".vcproj"] = project_objects[p] # Walk down from the top until we hit a folder that has more than one entry. # In practice, this strips the top-level "src/" dir from the hierarchy in # the solution. while len(root) == 1 and type(root[next(iter(root))]) == dict: root = root[next(iter(root))] # Collapse singles. root = _CollapseSingles("", root) # Merge buckets until everything is a root entry. return _DictsToFolders("", root, flat) def _GetPathOfProject(qualified_target, spec, options, msvs_version): default_config = _GetDefaultConfiguration(spec) proj_filename = default_config.get("msvs_existing_vcproj") if not proj_filename: proj_filename = spec["target_name"] if spec["toolset"] == "host": proj_filename += "_host" proj_filename = proj_filename + options.suffix + msvs_version.ProjectExtension() build_file = gyp.common.BuildFile(qualified_target) proj_path = os.path.join(os.path.dirname(build_file), proj_filename) fix_prefix = None if options.generator_output: project_dir_path = os.path.dirname(os.path.abspath(proj_path)) proj_path = os.path.join(options.generator_output, proj_path) fix_prefix = gyp.common.RelativePath( project_dir_path, os.path.dirname(proj_path) ) return proj_path, fix_prefix def _GetPlatformOverridesOfProject(spec): # Prepare a dict indicating which project configurations are used for which # solution configurations for this target. config_platform_overrides = {} for config_name, c in spec["configurations"].items(): config_fullname = _ConfigFullName(config_name, c) platform = c.get("msvs_target_platform", _ConfigPlatform(c)) fixed_config_fullname = "{}|{}".format( _ConfigBaseName(config_name, _ConfigPlatform(c)), platform, ) if spec["toolset"] == "host" and generator_supports_multiple_toolsets: fixed_config_fullname = f"{config_name}|x64" config_platform_overrides[config_fullname] = fixed_config_fullname return config_platform_overrides def _CreateProjectObjects(target_list, target_dicts, options, msvs_version): """Create a MSVSProject object for the targets found in target list. Arguments: target_list: the list of targets to generate project objects for. target_dicts: the dictionary of specifications. options: global generator options. msvs_version: the MSVSVersion object. Returns: A set of created projects, keyed by target. """ global fixpath_prefix # Generate each project. projects = {} for qualified_target in target_list: spec = target_dicts[qualified_target] proj_path, fixpath_prefix = _GetPathOfProject( qualified_target, spec, options, msvs_version ) guid = _GetGuidOfProject(proj_path, spec) overrides = _GetPlatformOverridesOfProject(spec) build_file = gyp.common.BuildFile(qualified_target) # Create object for this project. target_name = spec["target_name"] if spec["toolset"] == "host": target_name += "_host" obj = MSVSNew.MSVSProject( proj_path, name=target_name, guid=guid, spec=spec, build_file=build_file, config_platform_overrides=overrides, fixpath_prefix=fixpath_prefix, ) # Set project toolset if any (MS build only) if msvs_version.UsesVcxproj(): obj.set_msbuild_toolset( _GetMsbuildToolsetOfProject(proj_path, spec, msvs_version) ) projects[qualified_target] = obj # Set all the dependencies, but not if we are using an external builder like # ninja for project in projects.values(): if not project.spec.get("msvs_external_builder"): deps = project.spec.get("dependencies", []) deps = [projects[d] for d in deps] project.set_dependencies(deps) return projects def _InitNinjaFlavor(params, target_list, target_dicts): """Initialize targets for the ninja flavor. This sets up the necessary variables in the targets to generate msvs projects that use ninja as an external builder. The variables in the spec are only set if they have not been set. This allows individual specs to override the default values initialized here. Arguments: params: Params provided to the generator. target_list: List of target pairs: 'base/base.gyp:base'. target_dicts: Dict of target properties keyed on target pair. """ for qualified_target in target_list: spec = target_dicts[qualified_target] if spec.get("msvs_external_builder"): # The spec explicitly defined an external builder, so don't change it. continue path_to_ninja = spec.get("msvs_path_to_ninja", "ninja.exe") spec["msvs_external_builder"] = "ninja" if not spec.get("msvs_external_builder_out_dir"): gyp_file, _, _ = gyp.common.ParseQualifiedTarget(qualified_target) gyp_dir = os.path.dirname(gyp_file) configuration = "$(Configuration)" if params.get("target_arch") == "x64": configuration += "_x64" if params.get("target_arch") == "arm64": configuration += "_arm64" spec["msvs_external_builder_out_dir"] = os.path.join( gyp.common.RelativePath(params["options"].toplevel_dir, gyp_dir), ninja_generator.ComputeOutputDir(params), configuration, ) if not spec.get("msvs_external_builder_build_cmd"): spec["msvs_external_builder_build_cmd"] = [ path_to_ninja, "-C", "$(OutDir)", "$(ProjectName)", ] if not spec.get("msvs_external_builder_clean_cmd"): spec["msvs_external_builder_clean_cmd"] = [ path_to_ninja, "-C", "$(OutDir)", "-tclean", "$(ProjectName)", ] def CalculateVariables(default_variables, params): """Generated variables that require params to be known.""" generator_flags = params.get("generator_flags", {}) # Select project file format version (if unset, default to auto detecting). msvs_version = MSVSVersion.SelectVisualStudioVersion( generator_flags.get("msvs_version", "auto") ) # Stash msvs_version for later (so we don't have to probe the system twice). params["msvs_version"] = msvs_version # Set a variable so conditions can be based on msvs_version. default_variables["MSVS_VERSION"] = msvs_version.ShortName() # To determine processor word size on Windows, in addition to checking # PROCESSOR_ARCHITECTURE (which reflects the word size of the current # process), it is also necessary to check PROCESSOR_ARCITEW6432 (which # contains the actual word size of the system when running thru WOW64). if ( os.environ.get("PROCESSOR_ARCHITECTURE", "").find("64") >= 0 or os.environ.get("PROCESSOR_ARCHITEW6432", "").find("64") >= 0 ): default_variables["MSVS_OS_BITS"] = 64 else: default_variables["MSVS_OS_BITS"] = 32 if gyp.common.GetFlavor(params) == "ninja": default_variables["SHARED_INTERMEDIATE_DIR"] = "$(OutDir)gen" def PerformBuild(data, configurations, params): options = params["options"] msvs_version = params["msvs_version"] devenv = os.path.join(msvs_version.path, "Common7", "IDE", "devenv.com") for build_file, build_file_dict in data.items(): (build_file_root, build_file_ext) = os.path.splitext(build_file) if build_file_ext != ".gyp": continue sln_path = build_file_root + options.suffix + ".sln" if options.generator_output: sln_path = os.path.join(options.generator_output, sln_path) for config in configurations: arguments = [devenv, sln_path, "/Build", config] print(f"Building [{config}]: {arguments}") subprocess.check_call(arguments) def CalculateGeneratorInputInfo(params): if params.get("flavor") == "ninja": toplevel = params["options"].toplevel_dir qualified_out_dir = os.path.normpath( os.path.join( toplevel, ninja_generator.ComputeOutputDir(params), "gypfiles-msvs-ninja", ) ) global generator_filelist_paths generator_filelist_paths = { "toplevel": toplevel, "qualified_out_dir": qualified_out_dir, } def GenerateOutput(target_list, target_dicts, data, params): """Generate .sln and .vcproj files. This is the entry point for this generator. Arguments: target_list: List of target pairs: 'base/base.gyp:base'. target_dicts: Dict of target properties keyed on target pair. data: Dictionary containing per .gyp data. """ global fixpath_prefix options = params["options"] # Get the project file format version back out of where we stashed it in # GeneratorCalculatedVariables. msvs_version = params["msvs_version"] generator_flags = params.get("generator_flags", {}) # Optionally shard targets marked with 'msvs_shard': SHARD_COUNT. (target_list, target_dicts) = MSVSUtil.ShardTargets(target_list, target_dicts) # Optionally use the large PDB workaround for targets marked with # 'msvs_large_pdb': 1. (target_list, target_dicts) = MSVSUtil.InsertLargePdbShims( target_list, target_dicts, generator_default_variables ) # Optionally configure each spec to use ninja as the external builder. if params.get("flavor") == "ninja": _InitNinjaFlavor(params, target_list, target_dicts) # Prepare the set of configurations. configs = set() for qualified_target in target_list: spec = target_dicts[qualified_target] for config_name, config in spec["configurations"].items(): config_name = _ConfigFullName(config_name, config) configs.add(config_name) if config_name == "Release|arm64": configs.add("Release|x64") configs = list(configs) # Figure out all the projects that will be generated and their guids project_objects = _CreateProjectObjects( target_list, target_dicts, options, msvs_version ) # Generate each project. missing_sources = [] for project in project_objects.values(): fixpath_prefix = project.fixpath_prefix missing_sources.extend( _GenerateProject(project, options, msvs_version, generator_flags, spec) ) fixpath_prefix = None for build_file in data: # Validate build_file extension target_only_configs = configs if generator_supports_multiple_toolsets: target_only_configs = [i for i in configs if i.endswith("arm64")] if not build_file.endswith(".gyp"): continue sln_path = os.path.splitext(build_file)[0] + options.suffix + ".sln" if options.generator_output: sln_path = os.path.join(options.generator_output, sln_path) # Get projects in the solution, and their dependents. sln_projects = gyp.common.BuildFileTargets(target_list, build_file) sln_projects += gyp.common.DeepDependencyTargets(target_dicts, sln_projects) # Create folder hierarchy. root_entries = _GatherSolutionFolders( sln_projects, project_objects, flat=msvs_version.FlatSolution() ) # Create solution. sln = MSVSNew.MSVSSolution( sln_path, entries=root_entries, variants=target_only_configs, websiteProperties=False, version=msvs_version, ) sln.Write() if missing_sources: error_message = "Missing input files:\n" + "\n".join(set(missing_sources)) if generator_flags.get("msvs_error_on_missing_sources", False): raise GypError(error_message) else: print("Warning: " + error_message, file=sys.stdout) def _GenerateMSBuildFiltersFile( filters_path, source_files, rule_dependencies, extension_to_rule_name, platforms, toolset, ): """Generate the filters file. This file is used by Visual Studio to organize the presentation of source files into folders. Arguments: filters_path: The path of the file to be created. source_files: The hierarchical structure of all the sources. extension_to_rule_name: A dictionary mapping file extensions to rules. """ filter_group = [] source_group = [] _AppendFiltersForMSBuild( "", source_files, rule_dependencies, extension_to_rule_name, platforms, toolset, filter_group, source_group, ) if filter_group: content = [ "Project", { "ToolsVersion": "4.0", "xmlns": "http://schemas.microsoft.com/developer/msbuild/2003", }, ["ItemGroup"] + filter_group, ["ItemGroup"] + source_group, ] easy_xml.WriteXmlIfChanged(content, filters_path, pretty=True, win32=True) elif os.path.exists(filters_path): # We don't need this filter anymore. Delete the old filter file. os.unlink(filters_path) def _AppendFiltersForMSBuild( parent_filter_name, sources, rule_dependencies, extension_to_rule_name, platforms, toolset, filter_group, source_group, ): """Creates the list of filters and sources to be added in the filter file. Args: parent_filter_name: The name of the filter under which the sources are found. sources: The hierarchy of filters and sources to process. extension_to_rule_name: A dictionary mapping file extensions to rules. filter_group: The list to which filter entries will be appended. source_group: The list to which source entries will be appended. """ for source in sources: if isinstance(source, MSVSProject.Filter): # We have a sub-filter. Create the name of that sub-filter. if not parent_filter_name: filter_name = source.name else: filter_name = f"{parent_filter_name}\\{source.name}" # Add the filter to the group. filter_group.append( [ "Filter", {"Include": filter_name}, ["UniqueIdentifier", MSVSNew.MakeGuid(source.name)], ] ) # Recurse and add its dependents. _AppendFiltersForMSBuild( filter_name, source.contents, rule_dependencies, extension_to_rule_name, platforms, toolset, filter_group, source_group, ) else: # It's a source. Create a source entry. _, element = _MapFileToMsBuildSourceType( source, rule_dependencies, extension_to_rule_name, platforms, toolset ) source_entry = [element, {"Include": source}] # Specify the filter it is part of, if any. if parent_filter_name: source_entry.append(["Filter", parent_filter_name]) source_group.append(source_entry) def _MapFileToMsBuildSourceType( source, rule_dependencies, extension_to_rule_name, platforms, toolset ): """Returns the group and element type of the source file. Arguments: source: The source file name. extension_to_rule_name: A dictionary mapping file extensions to rules. Returns: A pair of (group this file should be part of, the label of element) """ _, ext = os.path.splitext(source) ext = ext.lower() if ext in extension_to_rule_name: group = "rule" element = extension_to_rule_name[ext] elif ext in [".cc", ".cpp", ".c", ".cxx", ".mm"]: group = "compile" element = "ClCompile" elif ext in [".h", ".hxx"]: group = "include" element = "ClInclude" elif ext == ".rc": group = "resource" element = "ResourceCompile" elif ext in [".s", ".asm"]: group = "masm" element = "MASM" if "arm64" in platforms and toolset == "target": element = "MARMASM" elif ext == ".idl": group = "midl" element = "Midl" elif source in rule_dependencies: group = "rule_dependency" element = "CustomBuild" else: group = "none" element = "None" return (group, element) def _GenerateRulesForMSBuild( output_dir, options, spec, sources, excluded_sources, props_files_of_rules, targets_files_of_rules, actions_to_add, rule_dependencies, extension_to_rule_name, ): # MSBuild rules are implemented using three files: an XML file, a .targets # file and a .props file. # For more details see: # https://devblogs.microsoft.com/cppblog/quick-help-on-vs2010-custom-build-rule/ rules = spec.get("rules", []) rules_native = [r for r in rules if not int(r.get("msvs_external_rule", 0))] rules_external = [r for r in rules if int(r.get("msvs_external_rule", 0))] msbuild_rules = [] for rule in rules_native: # Skip a rule with no action and no inputs. if "action" not in rule and not rule.get("rule_sources", []): continue msbuild_rule = MSBuildRule(rule, spec) msbuild_rules.append(msbuild_rule) rule_dependencies.update(msbuild_rule.additional_dependencies.split(";")) extension_to_rule_name[msbuild_rule.extension] = msbuild_rule.rule_name if msbuild_rules: base = spec["target_name"] + options.suffix props_name = base + ".props" targets_name = base + ".targets" xml_name = base + ".xml" props_files_of_rules.add(props_name) targets_files_of_rules.add(targets_name) props_path = os.path.join(output_dir, props_name) targets_path = os.path.join(output_dir, targets_name) xml_path = os.path.join(output_dir, xml_name) _GenerateMSBuildRulePropsFile(props_path, msbuild_rules) _GenerateMSBuildRuleTargetsFile(targets_path, msbuild_rules) _GenerateMSBuildRuleXmlFile(xml_path, msbuild_rules) if rules_external: _GenerateExternalRules( rules_external, output_dir, spec, sources, options, actions_to_add ) _AdjustSourcesForRules(rules, sources, excluded_sources, True) class MSBuildRule: """Used to store information used to generate an MSBuild rule. Attributes: rule_name: The rule name, sanitized to use in XML. target_name: The name of the target. after_targets: The name of the AfterTargets element. before_targets: The name of the BeforeTargets element. depends_on: The name of the DependsOn element. compute_output: The name of the ComputeOutput element. dirs_to_make: The name of the DirsToMake element. inputs: The name of the _inputs element. tlog: The name of the _tlog element. extension: The extension this rule applies to. description: The message displayed when this rule is invoked. additional_dependencies: A string listing additional dependencies. outputs: The outputs of this rule. command: The command used to run the rule. """ def __init__(self, rule, spec): self.display_name = rule["rule_name"] # Assure that the rule name is only characters and numbers self.rule_name = re.sub(r"\W", "_", self.display_name) # Create the various element names, following the example set by the # Visual Studio 2008 to 2010 conversion. I don't know if VS2010 # is sensitive to the exact names. self.target_name = "_" + self.rule_name self.after_targets = self.rule_name + "AfterTargets" self.before_targets = self.rule_name + "BeforeTargets" self.depends_on = self.rule_name + "DependsOn" self.compute_output = "Compute%sOutput" % self.rule_name self.dirs_to_make = self.rule_name + "DirsToMake" self.inputs = self.rule_name + "_inputs" self.tlog = self.rule_name + "_tlog" self.extension = rule["extension"] if not self.extension.startswith("."): self.extension = "." + self.extension self.description = MSVSSettings.ConvertVCMacrosToMSBuild( rule.get("message", self.rule_name) ) old_additional_dependencies = _FixPaths(rule.get("inputs", [])) self.additional_dependencies = ";".join( [ MSVSSettings.ConvertVCMacrosToMSBuild(i) for i in old_additional_dependencies ] ) old_outputs = _FixPaths(rule.get("outputs", [])) self.outputs = ";".join( [MSVSSettings.ConvertVCMacrosToMSBuild(i) for i in old_outputs] ) old_command = _BuildCommandLineForRule( spec, rule, has_input_path=True, do_setup_env=True ) self.command = MSVSSettings.ConvertVCMacrosToMSBuild(old_command) def _GenerateMSBuildRulePropsFile(props_path, msbuild_rules): """Generate the .props file.""" content = [ "Project", {"xmlns": "http://schemas.microsoft.com/developer/msbuild/2003"}, ] for rule in msbuild_rules: content.extend( [ [ "PropertyGroup", { "Condition": "'$(%s)' == '' and '$(%s)' == '' and " "'$(ConfigurationType)' != 'Makefile'" % (rule.before_targets, rule.after_targets) }, [rule.before_targets, "Midl"], [rule.after_targets, "CustomBuild"], ], [ "PropertyGroup", [ rule.depends_on, {"Condition": "'$(ConfigurationType)' != 'Makefile'"}, "_SelectedFiles;$(%s)" % rule.depends_on, ], ], [ "ItemDefinitionGroup", [ rule.rule_name, ["CommandLineTemplate", rule.command], ["Outputs", rule.outputs], ["ExecutionDescription", rule.description], ["AdditionalDependencies", rule.additional_dependencies], ], ], ] ) easy_xml.WriteXmlIfChanged(content, props_path, pretty=True, win32=True) def _GenerateMSBuildRuleTargetsFile(targets_path, msbuild_rules): """Generate the .targets file.""" content = [ "Project", {"xmlns": "http://schemas.microsoft.com/developer/msbuild/2003"}, ] item_group = [ "ItemGroup", [ "PropertyPageSchema", {"Include": "$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml"}, ], ] for rule in msbuild_rules: item_group.append( [ "AvailableItemName", {"Include": rule.rule_name}, ["Targets", rule.target_name], ] ) content.append(item_group) for rule in msbuild_rules: content.append( [ "UsingTask", { "TaskName": rule.rule_name, "TaskFactory": "XamlTaskFactory", "AssemblyName": "Microsoft.Build.Tasks.v4.0", }, ["Task", "$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml"], ] ) for rule in msbuild_rules: rule_name = rule.rule_name target_outputs = "%%(%s.Outputs)" % rule_name target_inputs = ( "%%(%s.Identity);%%(%s.AdditionalDependencies);" "$(MSBuildProjectFile)" ) % (rule_name, rule_name) rule_inputs = "%%(%s.Identity)" % rule_name extension_condition = ( "'%(Extension)'=='.obj' or " "'%(Extension)'=='.res' or " "'%(Extension)'=='.rsc' or " "'%(Extension)'=='.lib'" ) remove_section = [ "ItemGroup", {"Condition": "'@(SelectedFiles)' != ''"}, [ rule_name, { "Remove": "@(%s)" % rule_name, "Condition": "'%(Identity)' != '@(SelectedFiles)'", }, ], ] inputs_section = [ "ItemGroup", [rule.inputs, {"Include": "%%(%s.AdditionalDependencies)" % rule_name}], ] logging_section = [ "ItemGroup", [ rule.tlog, { "Include": "%%(%s.Outputs)" % rule_name, "Condition": ( "'%%(%s.Outputs)' != '' and " "'%%(%s.ExcludedFromBuild)' != 'true'" % (rule_name, rule_name) ), }, ["Source", "@(%s, '|')" % rule_name], ["Inputs", "@(%s -> '%%(Fullpath)', ';')" % rule.inputs], ], ] message_section = [ "Message", {"Importance": "High", "Text": "%%(%s.ExecutionDescription)" % rule_name}, ] write_tlog_section = [ "WriteLinesToFile", { "Condition": "'@(%s)' != '' and '%%(%s.ExcludedFromBuild)' != " "'true'" % (rule.tlog, rule.tlog), "File": "$(IntDir)$(ProjectName).write.1.tlog", "Lines": "^%%(%s.Source);@(%s->'%%(Fullpath)')" % (rule.tlog, rule.tlog), }, ] read_tlog_section = [ "WriteLinesToFile", { "Condition": "'@(%s)' != '' and '%%(%s.ExcludedFromBuild)' != " "'true'" % (rule.tlog, rule.tlog), "File": "$(IntDir)$(ProjectName).read.1.tlog", "Lines": f"^%({rule.tlog}.Source);%({rule.tlog}.Inputs)", }, ] command_and_input_section = [ rule_name, { "Condition": "'@(%s)' != '' and '%%(%s.ExcludedFromBuild)' != " "'true'" % (rule_name, rule_name), "EchoOff": "true", "StandardOutputImportance": "High", "StandardErrorImportance": "High", "CommandLineTemplate": "%%(%s.CommandLineTemplate)" % rule_name, "AdditionalOptions": "%%(%s.AdditionalOptions)" % rule_name, "Inputs": rule_inputs, }, ] content.extend( [ [ "Target", { "Name": rule.target_name, "BeforeTargets": "$(%s)" % rule.before_targets, "AfterTargets": "$(%s)" % rule.after_targets, "Condition": "'@(%s)' != ''" % rule_name, "DependsOnTargets": "$(%s);%s" % (rule.depends_on, rule.compute_output), "Outputs": target_outputs, "Inputs": target_inputs, }, remove_section, inputs_section, logging_section, message_section, write_tlog_section, read_tlog_section, command_and_input_section, ], [ "PropertyGroup", [ "ComputeLinkInputsTargets", "$(ComputeLinkInputsTargets);", "%s;" % rule.compute_output, ], [ "ComputeLibInputsTargets", "$(ComputeLibInputsTargets);", "%s;" % rule.compute_output, ], ], [ "Target", { "Name": rule.compute_output, "Condition": "'@(%s)' != ''" % rule_name, }, [ "ItemGroup", [ rule.dirs_to_make, { "Condition": "'@(%s)' != '' and " "'%%(%s.ExcludedFromBuild)' != 'true'" % (rule_name, rule_name), "Include": "%%(%s.Outputs)" % rule_name, }, ], [ "Link", { "Include": "%%(%s.Identity)" % rule.dirs_to_make, "Condition": extension_condition, }, ], [ "Lib", { "Include": "%%(%s.Identity)" % rule.dirs_to_make, "Condition": extension_condition, }, ], [ "ImpLib", { "Include": "%%(%s.Identity)" % rule.dirs_to_make, "Condition": extension_condition, }, ], ], [ "MakeDir", { "Directories": ( "@(%s->'%%(RootDir)%%(Directory)')" % rule.dirs_to_make ) }, ], ], ] ) easy_xml.WriteXmlIfChanged(content, targets_path, pretty=True, win32=True) def _GenerateMSBuildRuleXmlFile(xml_path, msbuild_rules): # Generate the .xml file content = [ "ProjectSchemaDefinitions", { "xmlns": ( "clr-namespace:Microsoft.Build.Framework.XamlTypes;" "assembly=Microsoft.Build.Framework" ), "xmlns:x": "http://schemas.microsoft.com/winfx/2006/xaml", "xmlns:sys": "clr-namespace:System;assembly=mscorlib", "xmlns:transformCallback": "Microsoft.Cpp.Dev10.ConvertPropertyCallback", }, ] for rule in msbuild_rules: content.extend( [ [ "Rule", { "Name": rule.rule_name, "PageTemplate": "tool", "DisplayName": rule.display_name, "Order": "200", }, [ "Rule.DataSource", [ "DataSource", {"Persistence": "ProjectFile", "ItemType": rule.rule_name}, ], ], [ "Rule.Categories", [ "Category", {"Name": "General"}, ["Category.DisplayName", ["sys:String", "General"]], ], [ "Category", {"Name": "Command Line", "Subtype": "CommandLine"}, ["Category.DisplayName", ["sys:String", "Command Line"]], ], ], [ "StringListProperty", { "Name": "Inputs", "Category": "Command Line", "IsRequired": "true", "Switch": " ", }, [ "StringListProperty.DataSource", [ "DataSource", { "Persistence": "ProjectFile", "ItemType": rule.rule_name, "SourceType": "Item", }, ], ], ], [ "StringProperty", { "Name": "CommandLineTemplate", "DisplayName": "Command Line", "Visible": "False", "IncludeInCommandLine": "False", }, ], [ "DynamicEnumProperty", { "Name": rule.before_targets, "Category": "General", "EnumProvider": "Targets", "IncludeInCommandLine": "False", }, [ "DynamicEnumProperty.DisplayName", ["sys:String", "Execute Before"], ], [ "DynamicEnumProperty.Description", [ "sys:String", "Specifies the targets for the build customization" " to run before.", ], ], [ "DynamicEnumProperty.ProviderSettings", [ "NameValuePair", { "Name": "Exclude", "Value": "^%s|^Compute" % rule.before_targets, }, ], ], [ "DynamicEnumProperty.DataSource", [ "DataSource", { "Persistence": "ProjectFile", "HasConfigurationCondition": "true", }, ], ], ], [ "DynamicEnumProperty", { "Name": rule.after_targets, "Category": "General", "EnumProvider": "Targets", "IncludeInCommandLine": "False", }, [ "DynamicEnumProperty.DisplayName", ["sys:String", "Execute After"], ], [ "DynamicEnumProperty.Description", [ "sys:String", ( "Specifies the targets for the build customization" " to run after." ), ], ], [ "DynamicEnumProperty.ProviderSettings", [ "NameValuePair", { "Name": "Exclude", "Value": "^%s|^Compute" % rule.after_targets, }, ], ], [ "DynamicEnumProperty.DataSource", [ "DataSource", { "Persistence": "ProjectFile", "ItemType": "", "HasConfigurationCondition": "true", }, ], ], ], [ "StringListProperty", { "Name": "Outputs", "DisplayName": "Outputs", "Visible": "False", "IncludeInCommandLine": "False", }, ], [ "StringProperty", { "Name": "ExecutionDescription", "DisplayName": "Execution Description", "Visible": "False", "IncludeInCommandLine": "False", }, ], [ "StringListProperty", { "Name": "AdditionalDependencies", "DisplayName": "Additional Dependencies", "IncludeInCommandLine": "False", "Visible": "false", }, ], [ "StringProperty", { "Subtype": "AdditionalOptions", "Name": "AdditionalOptions", "Category": "Command Line", }, [ "StringProperty.DisplayName", ["sys:String", "Additional Options"], ], [ "StringProperty.Description", ["sys:String", "Additional Options"], ], ], ], [ "ItemType", {"Name": rule.rule_name, "DisplayName": rule.display_name}, ], [ "FileExtension", {"Name": "*" + rule.extension, "ContentType": rule.rule_name}, ], [ "ContentType", { "Name": rule.rule_name, "DisplayName": "", "ItemType": rule.rule_name, }, ], ] ) easy_xml.WriteXmlIfChanged(content, xml_path, pretty=True, win32=True) def _GetConfigurationAndPlatform(name, settings, spec): configuration = name.rsplit("_", 1)[0] platform = settings.get("msvs_configuration_platform", "Win32") if spec["toolset"] == "host" and platform == "arm64": platform = "x64" # Host-only tools are always built for x64 return (configuration, platform) def _GetConfigurationCondition(name, settings, spec): return r"'$(Configuration)|$(Platform)'=='%s|%s'" % _GetConfigurationAndPlatform( name, settings, spec ) def _GetMSBuildProjectConfigurations(configurations, spec): group = ["ItemGroup", {"Label": "ProjectConfigurations"}] for (name, settings) in sorted(configurations.items()): configuration, platform = _GetConfigurationAndPlatform(name, settings, spec) designation = f"{configuration}|{platform}" group.append( [ "ProjectConfiguration", {"Include": designation}, ["Configuration", configuration], ["Platform", platform], ] ) return [group] def _GetMSBuildGlobalProperties(spec, version, guid, gyp_file_name): namespace = os.path.splitext(gyp_file_name)[0] properties = [ [ "PropertyGroup", {"Label": "Globals"}, ["ProjectGuid", guid], ["Keyword", "Win32Proj"], ["RootNamespace", namespace], ["IgnoreWarnCompileDuplicatedFilename", "true"], ] ] if ( os.environ.get("PROCESSOR_ARCHITECTURE") == "AMD64" or os.environ.get("PROCESSOR_ARCHITEW6432") == "AMD64" ): properties[0].append(["PreferredToolArchitecture", "x64"]) if spec.get("msvs_target_platform_version"): target_platform_version = spec.get("msvs_target_platform_version") properties[0].append(["WindowsTargetPlatformVersion", target_platform_version]) if spec.get("msvs_target_platform_minversion"): target_platform_minversion = spec.get("msvs_target_platform_minversion") properties[0].append( ["WindowsTargetPlatformMinVersion", target_platform_minversion] ) else: properties[0].append( ["WindowsTargetPlatformMinVersion", target_platform_version] ) if spec.get("msvs_enable_winrt"): properties[0].append(["DefaultLanguage", "en-US"]) properties[0].append(["AppContainerApplication", "true"]) if spec.get("msvs_application_type_revision"): app_type_revision = spec.get("msvs_application_type_revision") properties[0].append(["ApplicationTypeRevision", app_type_revision]) else: properties[0].append(["ApplicationTypeRevision", "8.1"]) if spec.get("msvs_enable_winphone"): properties[0].append(["ApplicationType", "Windows Phone"]) else: properties[0].append(["ApplicationType", "Windows Store"]) platform_name = None msvs_windows_sdk_version = None for configuration in spec["configurations"].values(): platform_name = platform_name or _ConfigPlatform(configuration) msvs_windows_sdk_version = ( msvs_windows_sdk_version or _ConfigWindowsTargetPlatformVersion(configuration, version) ) if platform_name and msvs_windows_sdk_version: break if msvs_windows_sdk_version: properties[0].append( ["WindowsTargetPlatformVersion", str(msvs_windows_sdk_version)] ) elif version.compatible_sdks: raise GypError( "%s requires any SDK of %s version, but none were found" % (version.description, version.compatible_sdks) ) if platform_name == "ARM": properties[0].append(["WindowsSDKDesktopARMSupport", "true"]) return properties def _GetMSBuildConfigurationDetails(spec, build_file): properties = {} for name, settings in spec["configurations"].items(): msbuild_attributes = _GetMSBuildAttributes(spec, settings, build_file) condition = _GetConfigurationCondition(name, settings, spec) character_set = msbuild_attributes.get("CharacterSet") config_type = msbuild_attributes.get("ConfigurationType") _AddConditionalProperty(properties, condition, "ConfigurationType", config_type) if config_type == "Driver": _AddConditionalProperty(properties, condition, "DriverType", "WDM") _AddConditionalProperty( properties, condition, "TargetVersion", _ConfigTargetVersion(settings) ) if character_set: if "msvs_enable_winrt" not in spec: _AddConditionalProperty( properties, condition, "CharacterSet", character_set ) return _GetMSBuildPropertyGroup(spec, "Configuration", properties) def _GetMSBuildLocalProperties(msbuild_toolset): # Currently the only local property we support is PlatformToolset properties = {} if msbuild_toolset: properties = [ [ "PropertyGroup", {"Label": "Locals"}, ["PlatformToolset", msbuild_toolset], ] ] return properties def _GetMSBuildPropertySheets(configurations, spec): user_props = r"$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" additional_props = {} props_specified = False for name, settings in sorted(configurations.items()): configuration = _GetConfigurationCondition(name, settings, spec) if "msbuild_props" in settings: additional_props[configuration] = _FixPaths(settings["msbuild_props"]) props_specified = True else: additional_props[configuration] = "" if not props_specified: return [ [ "ImportGroup", {"Label": "PropertySheets"}, [ "Import", { "Project": user_props, "Condition": "exists('%s')" % user_props, "Label": "LocalAppDataPlatform", }, ], ] ] else: sheets = [] for condition, props in additional_props.items(): import_group = [ "ImportGroup", {"Label": "PropertySheets", "Condition": condition}, [ "Import", { "Project": user_props, "Condition": "exists('%s')" % user_props, "Label": "LocalAppDataPlatform", }, ], ] for props_file in props: import_group.append(["Import", {"Project": props_file}]) sheets.append(import_group) return sheets def _ConvertMSVSBuildAttributes(spec, config, build_file): config_type = _GetMSVSConfigurationType(spec, build_file) msvs_attributes = _GetMSVSAttributes(spec, config, config_type) msbuild_attributes = {} for a in msvs_attributes: if a in ["IntermediateDirectory", "OutputDirectory"]: directory = MSVSSettings.ConvertVCMacrosToMSBuild(msvs_attributes[a]) if not directory.endswith("\\"): directory += "\\" msbuild_attributes[a] = directory elif a == "CharacterSet": msbuild_attributes[a] = _ConvertMSVSCharacterSet(msvs_attributes[a]) elif a == "ConfigurationType": msbuild_attributes[a] = _ConvertMSVSConfigurationType(msvs_attributes[a]) else: print("Warning: Do not know how to convert MSVS attribute " + a) return msbuild_attributes def _ConvertMSVSCharacterSet(char_set): if char_set.isdigit(): char_set = {"0": "MultiByte", "1": "Unicode", "2": "MultiByte"}[char_set] return char_set def _ConvertMSVSConfigurationType(config_type): if config_type.isdigit(): config_type = { "1": "Application", "2": "DynamicLibrary", "4": "StaticLibrary", "5": "Driver", "10": "Utility", }[config_type] return config_type def _GetMSBuildAttributes(spec, config, build_file): if "msbuild_configuration_attributes" not in config: msbuild_attributes = _ConvertMSVSBuildAttributes(spec, config, build_file) else: config_type = _GetMSVSConfigurationType(spec, build_file) config_type = _ConvertMSVSConfigurationType(config_type) msbuild_attributes = config.get("msbuild_configuration_attributes", {}) msbuild_attributes.setdefault("ConfigurationType", config_type) output_dir = msbuild_attributes.get( "OutputDirectory", "$(SolutionDir)$(Configuration)" ) msbuild_attributes["OutputDirectory"] = _FixPath(output_dir) + "\\" if "IntermediateDirectory" not in msbuild_attributes: intermediate = _FixPath("$(Configuration)") + "\\" msbuild_attributes["IntermediateDirectory"] = intermediate if "CharacterSet" in msbuild_attributes: msbuild_attributes["CharacterSet"] = _ConvertMSVSCharacterSet( msbuild_attributes["CharacterSet"] ) if "TargetName" not in msbuild_attributes: prefix = spec.get("product_prefix", "") product_name = spec.get("product_name", "$(ProjectName)") target_name = prefix + product_name msbuild_attributes["TargetName"] = target_name if "TargetExt" not in msbuild_attributes and "product_extension" in spec: ext = spec.get("product_extension") msbuild_attributes["TargetExt"] = "." + ext if spec.get("msvs_external_builder"): external_out_dir = spec.get("msvs_external_builder_out_dir", ".") msbuild_attributes["OutputDirectory"] = _FixPath(external_out_dir) + "\\" # Make sure that 'TargetPath' matches 'Lib.OutputFile' or 'Link.OutputFile' # (depending on the tool used) to avoid MSB8012 warning. msbuild_tool_map = { "executable": "Link", "shared_library": "Link", "loadable_module": "Link", "windows_driver": "Link", "static_library": "Lib", } msbuild_tool = msbuild_tool_map.get(spec["type"]) if msbuild_tool: msbuild_settings = config["finalized_msbuild_settings"] out_file = msbuild_settings[msbuild_tool].get("OutputFile") if out_file: msbuild_attributes["TargetPath"] = _FixPath(out_file) target_ext = msbuild_settings[msbuild_tool].get("TargetExt") if target_ext: msbuild_attributes["TargetExt"] = target_ext return msbuild_attributes def _GetMSBuildConfigurationGlobalProperties(spec, configurations, build_file): # TODO(jeanluc) We could optimize out the following and do it only if # there are actions. # TODO(jeanluc) Handle the equivalent of setting 'CYGWIN=nontsec'. new_paths = [] cygwin_dirs = spec.get("msvs_cygwin_dirs", ["."])[0] if cygwin_dirs: cyg_path = "$(MSBuildProjectDirectory)\\%s\\bin\\" % _FixPath(cygwin_dirs) new_paths.append(cyg_path) # TODO(jeanluc) Change the convention to have both a cygwin_dir and a # python_dir. python_path = cyg_path.replace("cygwin\\bin", "python_26") new_paths.append(python_path) if new_paths: new_paths = "$(ExecutablePath);" + ";".join(new_paths) properties = {} for (name, configuration) in sorted(configurations.items()): condition = _GetConfigurationCondition(name, configuration, spec) attributes = _GetMSBuildAttributes(spec, configuration, build_file) msbuild_settings = configuration["finalized_msbuild_settings"] _AddConditionalProperty( properties, condition, "IntDir", attributes["IntermediateDirectory"] ) _AddConditionalProperty( properties, condition, "OutDir", attributes["OutputDirectory"] ) _AddConditionalProperty( properties, condition, "TargetName", attributes["TargetName"] ) if "TargetExt" in attributes: _AddConditionalProperty( properties, condition, "TargetExt", attributes["TargetExt"] ) if attributes.get("TargetPath"): _AddConditionalProperty( properties, condition, "TargetPath", attributes["TargetPath"] ) if attributes.get("TargetExt"): _AddConditionalProperty( properties, condition, "TargetExt", attributes["TargetExt"] ) if new_paths: _AddConditionalProperty(properties, condition, "ExecutablePath", new_paths) tool_settings = msbuild_settings.get("", {}) for name, value in sorted(tool_settings.items()): formatted_value = _GetValueFormattedForMSBuild("", name, value) _AddConditionalProperty(properties, condition, name, formatted_value) return _GetMSBuildPropertyGroup(spec, None, properties) def _AddConditionalProperty(properties, condition, name, value): """Adds a property / conditional value pair to a dictionary. Arguments: properties: The dictionary to be modified. The key is the name of the property. The value is itself a dictionary; its key is the value and the value a list of condition for which this value is true. condition: The condition under which the named property has the value. name: The name of the property. value: The value of the property. """ if name not in properties: properties[name] = {} values = properties[name] if value not in values: values[value] = [] conditions = values[value] conditions.append(condition) # Regex for msvs variable references ( i.e. $(FOO) ). MSVS_VARIABLE_REFERENCE = re.compile(r"\$\(([a-zA-Z_][a-zA-Z0-9_]*)\)") def _GetMSBuildPropertyGroup(spec, label, properties): """Returns a PropertyGroup definition for the specified properties. Arguments: spec: The target project dict. label: An optional label for the PropertyGroup. properties: The dictionary to be converted. The key is the name of the property. The value is itself a dictionary; its key is the value and the value a list of condition for which this value is true. """ group = ["PropertyGroup"] if label: group.append({"Label": label}) num_configurations = len(spec["configurations"]) def GetEdges(node): # Use a definition of edges such that user_of_variable -> used_varible. # This happens to be easier in this case, since a variable's # definition contains all variables it references in a single string. edges = set() for value in sorted(properties[node].keys()): # Add to edges all $(...) references to variables. # # Variable references that refer to names not in properties are excluded # These can exist for instance to refer built in definitions like # $(SolutionDir). # # Self references are ignored. Self reference is used in a few places to # append to the default value. I.e. PATH=$(PATH);other_path edges.update( { v for v in MSVS_VARIABLE_REFERENCE.findall(value) if v in properties and v != node } ) return edges properties_ordered = gyp.common.TopologicallySorted(properties.keys(), GetEdges) # Walk properties in the reverse of a topological sort on # user_of_variable -> used_variable as this ensures variables are # defined before they are used. # NOTE: reverse(topsort(DAG)) = topsort(reverse_edges(DAG)) for name in reversed(properties_ordered): values = properties[name] for value, conditions in sorted(values.items()): if len(conditions) == num_configurations: # If the value is the same all configurations, # just add one unconditional entry. group.append([name, value]) else: for condition in conditions: group.append([name, {"Condition": condition}, value]) return [group] def _GetMSBuildToolSettingsSections(spec, configurations): groups = [] for (name, configuration) in sorted(configurations.items()): msbuild_settings = configuration["finalized_msbuild_settings"] group = [ "ItemDefinitionGroup", {"Condition": _GetConfigurationCondition(name, configuration, spec)}, ] for tool_name, tool_settings in sorted(msbuild_settings.items()): # Skip the tool named '' which is a holder of global settings handled # by _GetMSBuildConfigurationGlobalProperties. if tool_name: if tool_settings: tool = [tool_name] for name, value in sorted(tool_settings.items()): formatted_value = _GetValueFormattedForMSBuild( tool_name, name, value ) tool.append([name, formatted_value]) group.append(tool) groups.append(group) return groups def _FinalizeMSBuildSettings(spec, configuration): if "msbuild_settings" in configuration: converted = False msbuild_settings = configuration["msbuild_settings"] MSVSSettings.ValidateMSBuildSettings(msbuild_settings) else: converted = True msvs_settings = configuration.get("msvs_settings", {}) msbuild_settings = MSVSSettings.ConvertToMSBuildSettings(msvs_settings) include_dirs, midl_include_dirs, resource_include_dirs = _GetIncludeDirs( configuration ) libraries = _GetLibraries(spec) library_dirs = _GetLibraryDirs(configuration) out_file, _, msbuild_tool = _GetOutputFilePathAndTool(spec, msbuild=True) target_ext = _GetOutputTargetExt(spec) defines = _GetDefines(configuration) if converted: # Visual Studio 2010 has TR1 defines = [d for d in defines if d != "_HAS_TR1=0"] # Warn of ignored settings ignored_settings = ["msvs_tool_files"] for ignored_setting in ignored_settings: value = configuration.get(ignored_setting) if value: print( "Warning: The automatic conversion to MSBuild does not handle " "%s. Ignoring setting of %s" % (ignored_setting, str(value)) ) defines = [_EscapeCppDefineForMSBuild(d) for d in defines] disabled_warnings = _GetDisabledWarnings(configuration) prebuild = configuration.get("msvs_prebuild") postbuild = configuration.get("msvs_postbuild") def_file = _GetModuleDefinition(spec) precompiled_header = configuration.get("msvs_precompiled_header") # Add the information to the appropriate tool # TODO(jeanluc) We could optimize and generate these settings only if # the corresponding files are found, e.g. don't generate ResourceCompile # if you don't have any resources. _ToolAppend( msbuild_settings, "ClCompile", "AdditionalIncludeDirectories", include_dirs ) _ToolAppend( msbuild_settings, "Midl", "AdditionalIncludeDirectories", midl_include_dirs ) _ToolAppend( msbuild_settings, "ResourceCompile", "AdditionalIncludeDirectories", resource_include_dirs, ) # Add in libraries, note that even for empty libraries, we want this # set, to prevent inheriting default libraries from the environment. _ToolSetOrAppend(msbuild_settings, "Link", "AdditionalDependencies", libraries) _ToolAppend(msbuild_settings, "Link", "AdditionalLibraryDirectories", library_dirs) if out_file: _ToolAppend( msbuild_settings, msbuild_tool, "OutputFile", out_file, only_if_unset=True ) if target_ext: _ToolAppend( msbuild_settings, msbuild_tool, "TargetExt", target_ext, only_if_unset=True ) # Add defines. _ToolAppend(msbuild_settings, "ClCompile", "PreprocessorDefinitions", defines) _ToolAppend(msbuild_settings, "ResourceCompile", "PreprocessorDefinitions", defines) # Add disabled warnings. _ToolAppend( msbuild_settings, "ClCompile", "DisableSpecificWarnings", disabled_warnings ) # Turn on precompiled headers if appropriate. if precompiled_header: precompiled_header = os.path.split(precompiled_header)[1] _ToolAppend(msbuild_settings, "ClCompile", "PrecompiledHeader", "Use") _ToolAppend( msbuild_settings, "ClCompile", "PrecompiledHeaderFile", precompiled_header ) _ToolAppend( msbuild_settings, "ClCompile", "ForcedIncludeFiles", [precompiled_header] ) else: _ToolAppend(msbuild_settings, "ClCompile", "PrecompiledHeader", "NotUsing") # Turn off WinRT compilation _ToolAppend(msbuild_settings, "ClCompile", "CompileAsWinRT", "false") # Turn on import libraries if appropriate if spec.get("msvs_requires_importlibrary"): _ToolAppend(msbuild_settings, "", "IgnoreImportLibrary", "false") # Loadable modules don't generate import libraries; # tell dependent projects to not expect one. if spec["type"] == "loadable_module": _ToolAppend(msbuild_settings, "", "IgnoreImportLibrary", "true") # Set the module definition file if any. if def_file: _ToolAppend(msbuild_settings, "Link", "ModuleDefinitionFile", def_file) configuration["finalized_msbuild_settings"] = msbuild_settings if prebuild: _ToolAppend(msbuild_settings, "PreBuildEvent", "Command", prebuild) if postbuild: _ToolAppend(msbuild_settings, "PostBuildEvent", "Command", postbuild) def _GetValueFormattedForMSBuild(tool_name, name, value): if type(value) == list: # For some settings, VS2010 does not automatically extends the settings # TODO(jeanluc) Is this what we want? if name in [ "AdditionalIncludeDirectories", "AdditionalLibraryDirectories", "AdditionalOptions", "DelayLoadDLLs", "DisableSpecificWarnings", "PreprocessorDefinitions", ]: value.append("%%(%s)" % name) # For most tools, entries in a list should be separated with ';' but some # settings use a space. Check for those first. exceptions = { "ClCompile": ["AdditionalOptions"], "Link": ["AdditionalOptions"], "Lib": ["AdditionalOptions"], } if tool_name in exceptions and name in exceptions[tool_name]: char = " " else: char = ";" formatted_value = char.join( [MSVSSettings.ConvertVCMacrosToMSBuild(i) for i in value] ) else: formatted_value = MSVSSettings.ConvertVCMacrosToMSBuild(value) return formatted_value def _VerifySourcesExist(sources, root_dir): """Verifies that all source files exist on disk. Checks that all regular source files, i.e. not created at run time, exist on disk. Missing files cause needless recompilation but no otherwise visible errors. Arguments: sources: A recursive list of Filter/file names. root_dir: The root directory for the relative path names. Returns: A list of source files that cannot be found on disk. """ missing_sources = [] for source in sources: if isinstance(source, MSVSProject.Filter): missing_sources.extend(_VerifySourcesExist(source.contents, root_dir)) else: if "$" not in source: full_path = os.path.join(root_dir, source) if not os.path.exists(full_path): missing_sources.append(full_path) return missing_sources def _GetMSBuildSources( spec, sources, exclusions, rule_dependencies, extension_to_rule_name, actions_spec, sources_handled_by_action, list_excluded, ): groups = [ "none", "masm", "midl", "include", "compile", "resource", "rule", "rule_dependency", ] grouped_sources = {} for g in groups: grouped_sources[g] = [] _AddSources2( spec, sources, exclusions, grouped_sources, rule_dependencies, extension_to_rule_name, sources_handled_by_action, list_excluded, ) sources = [] for g in groups: if grouped_sources[g]: sources.append(["ItemGroup"] + grouped_sources[g]) if actions_spec: sources.append(["ItemGroup"] + actions_spec) return sources def _AddSources2( spec, sources, exclusions, grouped_sources, rule_dependencies, extension_to_rule_name, sources_handled_by_action, list_excluded, ): extensions_excluded_from_precompile = [] for source in sources: if isinstance(source, MSVSProject.Filter): _AddSources2( spec, source.contents, exclusions, grouped_sources, rule_dependencies, extension_to_rule_name, sources_handled_by_action, list_excluded, ) else: if source not in sources_handled_by_action: detail = [] excluded_configurations = exclusions.get(source, []) if len(excluded_configurations) == len(spec["configurations"]): detail.append(["ExcludedFromBuild", "true"]) else: for config_name, configuration in sorted(excluded_configurations): condition = _GetConfigurationCondition( config_name, configuration ) detail.append( ["ExcludedFromBuild", {"Condition": condition}, "true"] ) # Add precompile if needed for config_name, configuration in spec["configurations"].items(): precompiled_source = configuration.get( "msvs_precompiled_source", "" ) if precompiled_source != "": precompiled_source = _FixPath(precompiled_source) if not extensions_excluded_from_precompile: # If the precompiled header is generated by a C source, # we must not try to use it for C++ sources, # and vice versa. basename, extension = os.path.splitext(precompiled_source) if extension == ".c": extensions_excluded_from_precompile = [ ".cc", ".cpp", ".cxx", ] else: extensions_excluded_from_precompile = [".c"] if precompiled_source == source: condition = _GetConfigurationCondition( config_name, configuration, spec ) detail.append( ["PrecompiledHeader", {"Condition": condition}, "Create"] ) else: # Turn off precompiled header usage for source files of a # different type than the file that generated the # precompiled header. for extension in extensions_excluded_from_precompile: if source.endswith(extension): detail.append(["PrecompiledHeader", ""]) detail.append(["ForcedIncludeFiles", ""]) group, element = _MapFileToMsBuildSourceType( source, rule_dependencies, extension_to_rule_name, _GetUniquePlatforms(spec), spec["toolset"], ) if group == "compile" and not os.path.isabs(source): # Add an value to support duplicate source # file basenames, except for absolute paths to avoid paths # with more than 260 characters. file_name = os.path.splitext(source)[0] + ".obj" if file_name.startswith("..\\"): file_name = re.sub(r"^(\.\.\\)+", "", file_name) elif file_name.startswith("$("): file_name = re.sub(r"^\$\([^)]+\)\\", "", file_name) detail.append(["ObjectFileName", "$(IntDir)\\" + file_name]) grouped_sources[group].append([element, {"Include": source}] + detail) def _GetMSBuildProjectReferences(project): references = [] if project.dependencies: group = ["ItemGroup"] added_dependency_set = set() for dependency in project.dependencies: dependency_spec = dependency.spec should_skip_dep = False if project.spec["toolset"] == "target": if dependency_spec["toolset"] == "host": if dependency_spec["type"] == "static_library": should_skip_dep = True if dependency.name.startswith("run_"): should_skip_dep = False if should_skip_dep: continue canonical_name = dependency.name.replace("_host", "") added_dependency_set.add(canonical_name) guid = dependency.guid project_dir = os.path.split(project.path)[0] relative_path = gyp.common.RelativePath(dependency.path, project_dir) project_ref = [ "ProjectReference", {"Include": relative_path}, ["Project", guid], ["ReferenceOutputAssembly", "false"], ] for config in dependency.spec.get("configurations", {}).values(): if config.get("msvs_use_library_dependency_inputs", 0): project_ref.append(["UseLibraryDependencyInputs", "true"]) break # If it's disabled in any config, turn it off in the reference. if config.get("msvs_2010_disable_uldi_when_referenced", 0): project_ref.append(["UseLibraryDependencyInputs", "false"]) break group.append(project_ref) references.append(group) return references def _GenerateMSBuildProject(project, options, version, generator_flags, spec): spec = project.spec configurations = spec["configurations"] toolset = spec["toolset"] project_dir, project_file_name = os.path.split(project.path) gyp.common.EnsureDirExists(project.path) # Prepare list of sources and excluded sources. gyp_file = os.path.split(project.build_file)[1] sources, excluded_sources = _PrepareListOfSources(spec, generator_flags, gyp_file) # Add rules. actions_to_add = {} props_files_of_rules = set() targets_files_of_rules = set() rule_dependencies = set() extension_to_rule_name = {} list_excluded = generator_flags.get("msvs_list_excluded_files", True) platforms = _GetUniquePlatforms(spec) # Don't generate rules if we are using an external builder like ninja. if not spec.get("msvs_external_builder"): _GenerateRulesForMSBuild( project_dir, options, spec, sources, excluded_sources, props_files_of_rules, targets_files_of_rules, actions_to_add, rule_dependencies, extension_to_rule_name, ) else: rules = spec.get("rules", []) _AdjustSourcesForRules(rules, sources, excluded_sources, True) sources, excluded_sources, excluded_idl = _AdjustSourcesAndConvertToFilterHierarchy( spec, options, project_dir, sources, excluded_sources, list_excluded, version ) # Don't add actions if we are using an external builder like ninja. if not spec.get("msvs_external_builder"): _AddActions(actions_to_add, spec, project.build_file) _AddCopies(actions_to_add, spec) # NOTE: this stanza must appear after all actions have been decided. # Don't excluded sources with actions attached, or they won't run. excluded_sources = _FilterActionsFromExcluded(excluded_sources, actions_to_add) exclusions = _GetExcludedFilesFromBuild(spec, excluded_sources, excluded_idl) actions_spec, sources_handled_by_action = _GenerateActionsForMSBuild( spec, actions_to_add ) _GenerateMSBuildFiltersFile( project.path + ".filters", sources, rule_dependencies, extension_to_rule_name, platforms, toolset, ) missing_sources = _VerifySourcesExist(sources, project_dir) for configuration in configurations.values(): _FinalizeMSBuildSettings(spec, configuration) # Add attributes to root element import_default_section = [ ["Import", {"Project": r"$(VCTargetsPath)\Microsoft.Cpp.Default.props"}] ] import_cpp_props_section = [ ["Import", {"Project": r"$(VCTargetsPath)\Microsoft.Cpp.props"}] ] import_cpp_targets_section = [ ["Import", {"Project": r"$(VCTargetsPath)\Microsoft.Cpp.targets"}] ] import_masm_props_section = [ ["Import", {"Project": r"$(VCTargetsPath)\BuildCustomizations\masm.props"}] ] import_masm_targets_section = [ ["Import", {"Project": r"$(VCTargetsPath)\BuildCustomizations\masm.targets"}] ] import_marmasm_props_section = [ ["Import", {"Project": r"$(VCTargetsPath)\BuildCustomizations\marmasm.props"}] ] import_marmasm_targets_section = [ ["Import", {"Project": r"$(VCTargetsPath)\BuildCustomizations\marmasm.targets"}] ] macro_section = [["PropertyGroup", {"Label": "UserMacros"}]] content = [ "Project", { "xmlns": "http://schemas.microsoft.com/developer/msbuild/2003", "ToolsVersion": version.ProjectVersion(), "DefaultTargets": "Build", }, ] content += _GetMSBuildProjectConfigurations(configurations, spec) content += _GetMSBuildGlobalProperties( spec, version, project.guid, project_file_name ) content += import_default_section content += _GetMSBuildConfigurationDetails(spec, project.build_file) if spec.get("msvs_enable_winphone"): content += _GetMSBuildLocalProperties("v120_wp81") else: content += _GetMSBuildLocalProperties(project.msbuild_toolset) content += import_cpp_props_section content += import_masm_props_section if "arm64" in platforms and toolset == "target": content += import_marmasm_props_section content += _GetMSBuildExtensions(props_files_of_rules) content += _GetMSBuildPropertySheets(configurations, spec) content += macro_section content += _GetMSBuildConfigurationGlobalProperties( spec, configurations, project.build_file ) content += _GetMSBuildToolSettingsSections(spec, configurations) content += _GetMSBuildSources( spec, sources, exclusions, rule_dependencies, extension_to_rule_name, actions_spec, sources_handled_by_action, list_excluded, ) content += _GetMSBuildProjectReferences(project) content += import_cpp_targets_section content += import_masm_targets_section if "arm64" in platforms and toolset == "target": content += import_marmasm_targets_section content += _GetMSBuildExtensionTargets(targets_files_of_rules) if spec.get("msvs_external_builder"): content += _GetMSBuildExternalBuilderTargets(spec) # TODO(jeanluc) File a bug to get rid of runas. We had in MSVS: # has_run_as = _WriteMSVSUserFile(project.path, version, spec) easy_xml.WriteXmlIfChanged(content, project.path, pretty=True, win32=True) return missing_sources def _GetMSBuildExternalBuilderTargets(spec): """Return a list of MSBuild targets for external builders. The "Build" and "Clean" targets are always generated. If the spec contains 'msvs_external_builder_clcompile_cmd', then the "ClCompile" target will also be generated, to support building selected C/C++ files. Arguments: spec: The gyp target spec. Returns: List of MSBuild 'Target' specs. """ build_cmd = _BuildCommandLineForRuleRaw( spec, spec["msvs_external_builder_build_cmd"], False, False, False, False ) build_target = ["Target", {"Name": "Build"}] build_target.append(["Exec", {"Command": build_cmd}]) clean_cmd = _BuildCommandLineForRuleRaw( spec, spec["msvs_external_builder_clean_cmd"], False, False, False, False ) clean_target = ["Target", {"Name": "Clean"}] clean_target.append(["Exec", {"Command": clean_cmd}]) targets = [build_target, clean_target] if spec.get("msvs_external_builder_clcompile_cmd"): clcompile_cmd = _BuildCommandLineForRuleRaw( spec, spec["msvs_external_builder_clcompile_cmd"], False, False, False, False, ) clcompile_target = ["Target", {"Name": "ClCompile"}] clcompile_target.append(["Exec", {"Command": clcompile_cmd}]) targets.append(clcompile_target) return targets def _GetMSBuildExtensions(props_files_of_rules): extensions = ["ImportGroup", {"Label": "ExtensionSettings"}] for props_file in props_files_of_rules: extensions.append(["Import", {"Project": props_file}]) return [extensions] def _GetMSBuildExtensionTargets(targets_files_of_rules): targets_node = ["ImportGroup", {"Label": "ExtensionTargets"}] for targets_file in sorted(targets_files_of_rules): targets_node.append(["Import", {"Project": targets_file}]) return [targets_node] def _GenerateActionsForMSBuild(spec, actions_to_add): """Add actions accumulated into an actions_to_add, merging as needed. Arguments: spec: the target project dict actions_to_add: dictionary keyed on input name, which maps to a list of dicts describing the actions attached to that input file. Returns: A pair of (action specification, the sources handled by this action). """ sources_handled_by_action = OrderedSet() actions_spec = [] for primary_input, actions in actions_to_add.items(): if generator_supports_multiple_toolsets: primary_input = primary_input.replace(".exe", "_host.exe") inputs = OrderedSet() outputs = OrderedSet() descriptions = [] commands = [] for action in actions: def fixup_host_exe(i): if "$(OutDir)" in i: i = i.replace(".exe", "_host.exe") return i if generator_supports_multiple_toolsets: action["inputs"] = [fixup_host_exe(i) for i in action["inputs"]] inputs.update(OrderedSet(action["inputs"])) outputs.update(OrderedSet(action["outputs"])) descriptions.append(action["description"]) cmd = action["command"] if generator_supports_multiple_toolsets: cmd = cmd.replace(".exe", "_host.exe") # For most actions, add 'call' so that actions that invoke batch files # return and continue executing. msbuild_use_call provides a way to # disable this but I have not seen any adverse effect from doing that # for everything. if action.get("msbuild_use_call", True): cmd = "call " + cmd commands.append(cmd) # Add the custom build action for one input file. description = ", and also ".join(descriptions) # We can't join the commands simply with && because the command line will # get too long. See also _AddActions: cygwin's setup_env mustn't be called # for every invocation or the command that sets the PATH will grow too # long. command = "\r\n".join( [c + "\r\nif %errorlevel% neq 0 exit /b %errorlevel%" for c in commands] ) _AddMSBuildAction( spec, primary_input, inputs, outputs, command, description, sources_handled_by_action, actions_spec, ) return actions_spec, sources_handled_by_action def _AddMSBuildAction( spec, primary_input, inputs, outputs, cmd, description, sources_handled_by_action, actions_spec, ): command = MSVSSettings.ConvertVCMacrosToMSBuild(cmd) primary_input = _FixPath(primary_input) inputs_array = _FixPaths(inputs) outputs_array = _FixPaths(outputs) additional_inputs = ";".join([i for i in inputs_array if i != primary_input]) outputs = ";".join(outputs_array) sources_handled_by_action.add(primary_input) action_spec = ["CustomBuild", {"Include": primary_input}] action_spec.extend( # TODO(jeanluc) 'Document' for all or just if as_sources? [ ["FileType", "Document"], ["Command", command], ["Message", description], ["Outputs", outputs], ] ) if additional_inputs: action_spec.append(["AdditionalInputs", additional_inputs]) actions_spec.append(action_spec) #!/usr/bin/env python3 # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Unit tests for the msvs.py file. """ import gyp.generator.msvs as msvs import unittest from io import StringIO class TestSequenceFunctions(unittest.TestCase): def setUp(self): self.stderr = StringIO() def test_GetLibraries(self): self.assertEqual(msvs._GetLibraries({}), []) self.assertEqual(msvs._GetLibraries({"libraries": []}), []) self.assertEqual( msvs._GetLibraries({"other": "foo", "libraries": ["a.lib"]}), ["a.lib"] ) self.assertEqual(msvs._GetLibraries({"libraries": ["-la"]}), ["a.lib"]) self.assertEqual( msvs._GetLibraries( { "libraries": [ "a.lib", "b.lib", "c.lib", "-lb.lib", "-lb.lib", "d.lib", "a.lib", ] } ), ["c.lib", "b.lib", "d.lib", "a.lib"], ) if __name__ == "__main__": unittest.main() # Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import collections import copy import hashlib import json import multiprocessing import os.path import re import signal import subprocess import sys import gyp import gyp.common import gyp.msvs_emulation import gyp.MSVSUtil as MSVSUtil import gyp.xcode_emulation from io import StringIO from gyp.common import GetEnvironFallback import gyp.ninja_syntax as ninja_syntax generator_default_variables = { "EXECUTABLE_PREFIX": "", "EXECUTABLE_SUFFIX": "", "STATIC_LIB_PREFIX": "lib", "STATIC_LIB_SUFFIX": ".a", "SHARED_LIB_PREFIX": "lib", # Gyp expects the following variables to be expandable by the build # system to the appropriate locations. Ninja prefers paths to be # known at gyp time. To resolve this, introduce special # variables starting with $! and $| (which begin with a $ so gyp knows it # should be treated specially, but is otherwise an invalid # ninja/shell variable) that are passed to gyp here but expanded # before writing out into the target .ninja files; see # ExpandSpecial. # $! is used for variables that represent a path and that can only appear at # the start of a string, while $| is used for variables that can appear # anywhere in a string. "INTERMEDIATE_DIR": "$!INTERMEDIATE_DIR", "SHARED_INTERMEDIATE_DIR": "$!PRODUCT_DIR/gen", "PRODUCT_DIR": "$!PRODUCT_DIR", "CONFIGURATION_NAME": "$|CONFIGURATION_NAME", # Special variables that may be used by gyp 'rule' targets. # We generate definitions for these variables on the fly when processing a # rule. "RULE_INPUT_ROOT": "${root}", "RULE_INPUT_DIRNAME": "${dirname}", "RULE_INPUT_PATH": "${source}", "RULE_INPUT_EXT": "${ext}", "RULE_INPUT_NAME": "${name}", } # Placates pylint. generator_additional_non_configuration_keys = [] generator_additional_path_sections = [] generator_extra_sources_for_rules = [] generator_filelist_paths = None generator_supports_multiple_toolsets = gyp.common.CrossCompileRequested() def StripPrefix(arg, prefix): if arg.startswith(prefix): return arg[len(prefix) :] return arg def QuoteShellArgument(arg, flavor): """Quote a string such that it will be interpreted as a single argument by the shell.""" # Rather than attempting to enumerate the bad shell characters, just # allow common OK ones and quote anything else. if re.match(r"^[a-zA-Z0-9_=.\\/-]+$", arg): return arg # No quoting necessary. if flavor == "win": return gyp.msvs_emulation.QuoteForRspFile(arg) return "'" + arg.replace("'", "'" + '"\'"' + "'") + "'" def Define(d, flavor): """Takes a preprocessor define and returns a -D parameter that's ninja- and shell-escaped.""" if flavor == "win": # cl.exe replaces literal # characters with = in preprocessor definitions for # some reason. Octal-encode to work around that. d = d.replace("#", "\\%03o" % ord("#")) return QuoteShellArgument(ninja_syntax.escape("-D" + d), flavor) def AddArch(output, arch): """Adds an arch string to an output path.""" output, extension = os.path.splitext(output) return f"{output}.{arch}{extension}" class Target: """Target represents the paths used within a single gyp target. Conceptually, building a single target A is a series of steps: 1) actions/rules/copies generates source/resources/etc. 2) compiles generates .o files 3) link generates a binary (library/executable) 4) bundle merges the above in a mac bundle (Any of these steps can be optional.) From a build ordering perspective, a dependent target B could just depend on the last output of this series of steps. But some dependent commands sometimes need to reach inside the box. For example, when linking B it needs to get the path to the static library generated by A. This object stores those paths. To keep things simple, member variables only store concrete paths to single files, while methods compute derived values like "the last output of the target". """ def __init__(self, type): # Gyp type ("static_library", etc.) of this target. self.type = type # File representing whether any input dependencies necessary for # dependent actions have completed. self.preaction_stamp = None # File representing whether any input dependencies necessary for # dependent compiles have completed. self.precompile_stamp = None # File representing the completion of actions/rules/copies, if any. self.actions_stamp = None # Path to the output of the link step, if any. self.binary = None # Path to the file representing the completion of building the bundle, # if any. self.bundle = None # On Windows, incremental linking requires linking against all the .objs # that compose a .lib (rather than the .lib itself). That list is stored # here. In this case, we also need to save the compile_deps for the target, # so that the target that directly depends on the .objs can also depend # on those. self.component_objs = None self.compile_deps = None # Windows only. The import .lib is the output of a build step, but # because dependents only link against the lib (not both the lib and the # dll) we keep track of the import library here. self.import_lib = None # Track if this target contains any C++ files, to decide if gcc or g++ # should be used for linking. self.uses_cpp = False def Linkable(self): """Return true if this is a target that can be linked against.""" return self.type in ("static_library", "shared_library") def UsesToc(self, flavor): """Return true if the target should produce a restat rule based on a TOC file.""" # For bundles, the .TOC should be produced for the binary, not for # FinalOutput(). But the naive approach would put the TOC file into the # bundle, so don't do this for bundles for now. if flavor == "win" or self.bundle: return False return self.type in ("shared_library", "loadable_module") def PreActionInput(self, flavor): """Return the path, if any, that should be used as a dependency of any dependent action step.""" if self.UsesToc(flavor): return self.FinalOutput() + ".TOC" return self.FinalOutput() or self.preaction_stamp def PreCompileInput(self): """Return the path, if any, that should be used as a dependency of any dependent compile step.""" return self.actions_stamp or self.precompile_stamp def FinalOutput(self): """Return the last output of the target, which depends on all prior steps.""" return self.bundle or self.binary or self.actions_stamp # A small discourse on paths as used within the Ninja build: # All files we produce (both at gyp and at build time) appear in the # build directory (e.g. out/Debug). # # Paths within a given .gyp file are always relative to the directory # containing the .gyp file. Call these "gyp paths". This includes # sources as well as the starting directory a given gyp rule/action # expects to be run from. We call the path from the source root to # the gyp file the "base directory" within the per-.gyp-file # NinjaWriter code. # # All paths as written into the .ninja files are relative to the build # directory. Call these paths "ninja paths". # # We translate between these two notions of paths with two helper # functions: # # - GypPathToNinja translates a gyp path (i.e. relative to the .gyp file) # into the equivalent ninja path. # # - GypPathToUniqueOutput translates a gyp path into a ninja path to write # an output file; the result can be namespaced such that it is unique # to the input file name as well as the output target name. class NinjaWriter: def __init__( self, hash_for_rules, target_outputs, base_dir, build_dir, output_file, toplevel_build, output_file_name, flavor, toplevel_dir=None, ): """ base_dir: path from source root to directory containing this gyp file, by gyp semantics, all input paths are relative to this build_dir: path from source root to build output toplevel_dir: path to the toplevel directory """ self.hash_for_rules = hash_for_rules self.target_outputs = target_outputs self.base_dir = base_dir self.build_dir = build_dir self.ninja = ninja_syntax.Writer(output_file) self.toplevel_build = toplevel_build self.output_file_name = output_file_name self.flavor = flavor self.abs_build_dir = None if toplevel_dir is not None: self.abs_build_dir = os.path.abspath(os.path.join(toplevel_dir, build_dir)) self.obj_ext = ".obj" if flavor == "win" else ".o" if flavor == "win": # See docstring of msvs_emulation.GenerateEnvironmentFiles(). self.win_env = {} for arch in ("x86", "x64"): self.win_env[arch] = "environment." + arch # Relative path from build output dir to base dir. build_to_top = gyp.common.InvertRelativePath(build_dir, toplevel_dir) self.build_to_base = os.path.join(build_to_top, base_dir) # Relative path from base dir to build dir. base_to_top = gyp.common.InvertRelativePath(base_dir, toplevel_dir) self.base_to_build = os.path.join(base_to_top, build_dir) def ExpandSpecial(self, path, product_dir=None): """Expand specials like $!PRODUCT_DIR in |path|. If |product_dir| is None, assumes the cwd is already the product dir. Otherwise, |product_dir| is the relative path to the product dir. """ PRODUCT_DIR = "$!PRODUCT_DIR" if PRODUCT_DIR in path: if product_dir: path = path.replace(PRODUCT_DIR, product_dir) else: path = path.replace(PRODUCT_DIR + "/", "") path = path.replace(PRODUCT_DIR + "\\", "") path = path.replace(PRODUCT_DIR, ".") INTERMEDIATE_DIR = "$!INTERMEDIATE_DIR" if INTERMEDIATE_DIR in path: int_dir = self.GypPathToUniqueOutput("gen") # GypPathToUniqueOutput generates a path relative to the product dir, # so insert product_dir in front if it is provided. path = path.replace( INTERMEDIATE_DIR, os.path.join(product_dir or "", int_dir) ) CONFIGURATION_NAME = "$|CONFIGURATION_NAME" path = path.replace(CONFIGURATION_NAME, self.config_name) return path def ExpandRuleVariables(self, path, root, dirname, source, ext, name): if self.flavor == "win": path = self.msvs_settings.ConvertVSMacros(path, config=self.config_name) path = path.replace(generator_default_variables["RULE_INPUT_ROOT"], root) path = path.replace(generator_default_variables["RULE_INPUT_DIRNAME"], dirname) path = path.replace(generator_default_variables["RULE_INPUT_PATH"], source) path = path.replace(generator_default_variables["RULE_INPUT_EXT"], ext) path = path.replace(generator_default_variables["RULE_INPUT_NAME"], name) return path def GypPathToNinja(self, path, env=None): """Translate a gyp path to a ninja path, optionally expanding environment variable references in |path| with |env|. See the above discourse on path conversions.""" if env: if self.flavor == "mac": path = gyp.xcode_emulation.ExpandEnvVars(path, env) elif self.flavor == "win": path = gyp.msvs_emulation.ExpandMacros(path, env) if path.startswith("$!"): expanded = self.ExpandSpecial(path) if self.flavor == "win": expanded = os.path.normpath(expanded) return expanded if "$|" in path: path = self.ExpandSpecial(path) assert "$" not in path, path return os.path.normpath(os.path.join(self.build_to_base, path)) def GypPathToUniqueOutput(self, path, qualified=True): """Translate a gyp path to a ninja path for writing output. If qualified is True, qualify the resulting filename with the name of the target. This is necessary when e.g. compiling the same path twice for two separate output targets. See the above discourse on path conversions.""" path = self.ExpandSpecial(path) assert not path.startswith("$"), path # Translate the path following this scheme: # Input: foo/bar.gyp, target targ, references baz/out.o # Output: obj/foo/baz/targ.out.o (if qualified) # obj/foo/baz/out.o (otherwise) # (and obj.host instead of obj for cross-compiles) # # Why this scheme and not some other one? # 1) for a given input, you can compute all derived outputs by matching # its path, even if the input is brought via a gyp file with '..'. # 2) simple files like libraries and stamps have a simple filename. obj = "obj" if self.toolset != "target": obj += "." + self.toolset path_dir, path_basename = os.path.split(path) assert not os.path.isabs(path_dir), ( "'%s' can not be absolute path (see crbug.com/462153)." % path_dir ) if qualified: path_basename = self.name + "." + path_basename return os.path.normpath( os.path.join(obj, self.base_dir, path_dir, path_basename) ) def WriteCollapsedDependencies(self, name, targets, order_only=None): """Given a list of targets, return a path for a single file representing the result of building all the targets or None. Uses a stamp file if necessary.""" assert targets == [item for item in targets if item], targets if len(targets) == 0: assert not order_only return None if len(targets) > 1 or order_only: stamp = self.GypPathToUniqueOutput(name + ".stamp") targets = self.ninja.build(stamp, "stamp", targets, order_only=order_only) self.ninja.newline() return targets[0] def _SubninjaNameForArch(self, arch): output_file_base = os.path.splitext(self.output_file_name)[0] return f"{output_file_base}.{arch}.ninja" def WriteSpec(self, spec, config_name, generator_flags): """The main entry point for NinjaWriter: write the build rules for a spec. Returns a Target object, which represents the output paths for this spec. Returns None if there are no outputs (e.g. a settings-only 'none' type target).""" self.config_name = config_name self.name = spec["target_name"] self.toolset = spec["toolset"] config = spec["configurations"][config_name] self.target = Target(spec["type"]) self.is_standalone_static_library = bool( spec.get("standalone_static_library", 0) ) self.target_rpath = generator_flags.get("target_rpath", r"\$$ORIGIN/lib/") self.is_mac_bundle = gyp.xcode_emulation.IsMacBundle(self.flavor, spec) self.xcode_settings = self.msvs_settings = None if self.flavor == "mac": self.xcode_settings = gyp.xcode_emulation.XcodeSettings(spec) mac_toolchain_dir = generator_flags.get("mac_toolchain_dir", None) if mac_toolchain_dir: self.xcode_settings.mac_toolchain_dir = mac_toolchain_dir if self.flavor == "win": self.msvs_settings = gyp.msvs_emulation.MsvsSettings(spec, generator_flags) arch = self.msvs_settings.GetArch(config_name) self.ninja.variable("arch", self.win_env[arch]) self.ninja.variable("cc", "$cl_" + arch) self.ninja.variable("cxx", "$cl_" + arch) self.ninja.variable("cc_host", "$cl_" + arch) self.ninja.variable("cxx_host", "$cl_" + arch) self.ninja.variable("asm", "$ml_" + arch) if self.flavor == "mac": self.archs = self.xcode_settings.GetActiveArchs(config_name) if len(self.archs) > 1: self.arch_subninjas = { arch: ninja_syntax.Writer( OpenOutput( os.path.join( self.toplevel_build, self._SubninjaNameForArch(arch) ), "w", ) ) for arch in self.archs } # Compute predepends for all rules. # actions_depends is the dependencies this target depends on before running # any of its action/rule/copy steps. # compile_depends is the dependencies this target depends on before running # any of its compile steps. actions_depends = [] compile_depends = [] # TODO(evan): it is rather confusing which things are lists and which # are strings. Fix these. if "dependencies" in spec: for dep in spec["dependencies"]: if dep in self.target_outputs: target = self.target_outputs[dep] actions_depends.append(target.PreActionInput(self.flavor)) compile_depends.append(target.PreCompileInput()) if target.uses_cpp: self.target.uses_cpp = True actions_depends = [item for item in actions_depends if item] compile_depends = [item for item in compile_depends if item] actions_depends = self.WriteCollapsedDependencies( "actions_depends", actions_depends ) compile_depends = self.WriteCollapsedDependencies( "compile_depends", compile_depends ) self.target.preaction_stamp = actions_depends self.target.precompile_stamp = compile_depends # Write out actions, rules, and copies. These must happen before we # compile any sources, so compute a list of predependencies for sources # while we do it. extra_sources = [] mac_bundle_depends = [] self.target.actions_stamp = self.WriteActionsRulesCopies( spec, extra_sources, actions_depends, mac_bundle_depends ) # If we have actions/rules/copies, we depend directly on those, but # otherwise we depend on dependent target's actions/rules/copies etc. # We never need to explicitly depend on previous target's link steps, # because no compile ever depends on them. compile_depends_stamp = self.target.actions_stamp or compile_depends # Write out the compilation steps, if any. link_deps = [] try: sources = extra_sources + spec.get("sources", []) except TypeError: print("extra_sources: ", str(extra_sources)) print('spec.get("sources"): ', str(spec.get("sources"))) raise if sources: if self.flavor == "mac" and len(self.archs) > 1: # Write subninja file containing compile and link commands scoped to # a single arch if a fat binary is being built. for arch in self.archs: self.ninja.subninja(self._SubninjaNameForArch(arch)) pch = None if self.flavor == "win": gyp.msvs_emulation.VerifyMissingSources( sources, self.abs_build_dir, generator_flags, self.GypPathToNinja ) pch = gyp.msvs_emulation.PrecompiledHeader( self.msvs_settings, config_name, self.GypPathToNinja, self.GypPathToUniqueOutput, self.obj_ext, ) else: pch = gyp.xcode_emulation.MacPrefixHeader( self.xcode_settings, self.GypPathToNinja, lambda path, lang: self.GypPathToUniqueOutput(path + "-" + lang), ) link_deps = self.WriteSources( self.ninja, config_name, config, sources, compile_depends_stamp, pch, spec, ) # Some actions/rules output 'sources' that are already object files. obj_outputs = [f for f in sources if f.endswith(self.obj_ext)] if obj_outputs: if self.flavor != "mac" or len(self.archs) == 1: link_deps += [self.GypPathToNinja(o) for o in obj_outputs] else: print( "Warning: Actions/rules writing object files don't work with " "multiarch targets, dropping. (target %s)" % spec["target_name"] ) elif self.flavor == "mac" and len(self.archs) > 1: link_deps = collections.defaultdict(list) compile_deps = self.target.actions_stamp or actions_depends if self.flavor == "win" and self.target.type == "static_library": self.target.component_objs = link_deps self.target.compile_deps = compile_deps # Write out a link step, if needed. output = None is_empty_bundle = not link_deps and not mac_bundle_depends if link_deps or self.target.actions_stamp or actions_depends: output = self.WriteTarget( spec, config_name, config, link_deps, compile_deps ) if self.is_mac_bundle: mac_bundle_depends.append(output) # Bundle all of the above together, if needed. if self.is_mac_bundle: output = self.WriteMacBundle(spec, mac_bundle_depends, is_empty_bundle) if not output: return None assert self.target.FinalOutput(), output return self.target def _WinIdlRule(self, source, prebuild, outputs): """Handle the implicit VS .idl rule for one source file. Fills |outputs| with files that are generated.""" outdir, output, vars, flags = self.msvs_settings.GetIdlBuildData( source, self.config_name ) outdir = self.GypPathToNinja(outdir) def fix_path(path, rel=None): path = os.path.join(outdir, path) dirname, basename = os.path.split(source) root, ext = os.path.splitext(basename) path = self.ExpandRuleVariables(path, root, dirname, source, ext, basename) if rel: path = os.path.relpath(path, rel) return path vars = [(name, fix_path(value, outdir)) for name, value in vars] output = [fix_path(p) for p in output] vars.append(("outdir", outdir)) vars.append(("idlflags", flags)) input = self.GypPathToNinja(source) self.ninja.build(output, "idl", input, variables=vars, order_only=prebuild) outputs.extend(output) def WriteWinIdlFiles(self, spec, prebuild): """Writes rules to match MSVS's implicit idl handling.""" assert self.flavor == "win" if self.msvs_settings.HasExplicitIdlRulesOrActions(spec): return [] outputs = [] for source in filter(lambda x: x.endswith(".idl"), spec["sources"]): self._WinIdlRule(source, prebuild, outputs) return outputs def WriteActionsRulesCopies( self, spec, extra_sources, prebuild, mac_bundle_depends ): """Write out the Actions, Rules, and Copies steps. Return a path representing the outputs of these steps.""" outputs = [] if self.is_mac_bundle: mac_bundle_resources = spec.get("mac_bundle_resources", [])[:] else: mac_bundle_resources = [] extra_mac_bundle_resources = [] if "actions" in spec: outputs += self.WriteActions( spec["actions"], extra_sources, prebuild, extra_mac_bundle_resources ) if "rules" in spec: outputs += self.WriteRules( spec["rules"], extra_sources, prebuild, mac_bundle_resources, extra_mac_bundle_resources, ) if "copies" in spec: outputs += self.WriteCopies(spec["copies"], prebuild, mac_bundle_depends) if "sources" in spec and self.flavor == "win": outputs += self.WriteWinIdlFiles(spec, prebuild) if self.xcode_settings and self.xcode_settings.IsIosFramework(): self.WriteiOSFrameworkHeaders(spec, outputs, prebuild) stamp = self.WriteCollapsedDependencies("actions_rules_copies", outputs) if self.is_mac_bundle: xcassets = self.WriteMacBundleResources( extra_mac_bundle_resources + mac_bundle_resources, mac_bundle_depends ) partial_info_plist = self.WriteMacXCassets(xcassets, mac_bundle_depends) self.WriteMacInfoPlist(partial_info_plist, mac_bundle_depends) return stamp def GenerateDescription(self, verb, message, fallback): """Generate and return a description of a build step. |verb| is the short summary, e.g. ACTION or RULE. |message| is a hand-written description, or None if not available. |fallback| is the gyp-level name of the step, usable as a fallback. """ if self.toolset != "target": verb += "(%s)" % self.toolset if message: return f"{verb} {self.ExpandSpecial(message)}" else: return f"{verb} {self.name}: {fallback}" def WriteActions( self, actions, extra_sources, prebuild, extra_mac_bundle_resources ): # Actions cd into the base directory. env = self.GetToolchainEnv() all_outputs = [] for action in actions: # First write out a rule for the action. name = "{}_{}".format(action["action_name"], self.hash_for_rules) description = self.GenerateDescription( "ACTION", action.get("message", None), name ) win_shell_flags = ( self.msvs_settings.GetRuleShellFlags(action) if self.flavor == "win" else None ) args = action["action"] depfile = action.get("depfile", None) if depfile: depfile = self.ExpandSpecial(depfile, self.base_to_build) pool = "console" if int(action.get("ninja_use_console", 0)) else None rule_name, _ = self.WriteNewNinjaRule( name, args, description, win_shell_flags, env, pool, depfile=depfile ) inputs = [self.GypPathToNinja(i, env) for i in action["inputs"]] if int(action.get("process_outputs_as_sources", False)): extra_sources += action["outputs"] if int(action.get("process_outputs_as_mac_bundle_resources", False)): extra_mac_bundle_resources += action["outputs"] outputs = [self.GypPathToNinja(o, env) for o in action["outputs"]] # Then write out an edge using the rule. self.ninja.build(outputs, rule_name, inputs, order_only=prebuild) all_outputs += outputs self.ninja.newline() return all_outputs def WriteRules( self, rules, extra_sources, prebuild, mac_bundle_resources, extra_mac_bundle_resources, ): env = self.GetToolchainEnv() all_outputs = [] for rule in rules: # Skip a rule with no action and no inputs. if "action" not in rule and not rule.get("rule_sources", []): continue # First write out a rule for the rule action. name = "{}_{}".format(rule["rule_name"], self.hash_for_rules) args = rule["action"] description = self.GenerateDescription( "RULE", rule.get("message", None), ("%s " + generator_default_variables["RULE_INPUT_PATH"]) % name, ) win_shell_flags = ( self.msvs_settings.GetRuleShellFlags(rule) if self.flavor == "win" else None ) pool = "console" if int(rule.get("ninja_use_console", 0)) else None rule_name, args = self.WriteNewNinjaRule( name, args, description, win_shell_flags, env, pool ) # TODO: if the command references the outputs directly, we should # simplify it to just use $out. # Rules can potentially make use of some special variables which # must vary per source file. # Compute the list of variables we'll need to provide. special_locals = ("source", "root", "dirname", "ext", "name") needed_variables = {"source"} for argument in args: for var in special_locals: if "${%s}" % var in argument: needed_variables.add(var) needed_variables = sorted(needed_variables) def cygwin_munge(path): # pylint: disable=cell-var-from-loop if win_shell_flags and win_shell_flags.cygwin: return path.replace("\\", "/") return path inputs = [self.GypPathToNinja(i, env) for i in rule.get("inputs", [])] # If there are n source files matching the rule, and m additional rule # inputs, then adding 'inputs' to each build edge written below will # write m * n inputs. Collapsing reduces this to m + n. sources = rule.get("rule_sources", []) num_inputs = len(inputs) if prebuild: num_inputs += 1 if num_inputs > 2 and len(sources) > 2: inputs = [ self.WriteCollapsedDependencies( rule["rule_name"], inputs, order_only=prebuild ) ] prebuild = [] # For each source file, write an edge that generates all the outputs. for source in sources: source = os.path.normpath(source) dirname, basename = os.path.split(source) root, ext = os.path.splitext(basename) # Gather the list of inputs and outputs, expanding $vars if possible. outputs = [ self.ExpandRuleVariables(o, root, dirname, source, ext, basename) for o in rule["outputs"] ] if int(rule.get("process_outputs_as_sources", False)): extra_sources += outputs was_mac_bundle_resource = source in mac_bundle_resources if was_mac_bundle_resource or int( rule.get("process_outputs_as_mac_bundle_resources", False) ): extra_mac_bundle_resources += outputs # Note: This is n_resources * n_outputs_in_rule. # Put to-be-removed items in a set and # remove them all in a single pass # if this becomes a performance issue. if was_mac_bundle_resource: mac_bundle_resources.remove(source) extra_bindings = [] for var in needed_variables: if var == "root": extra_bindings.append(("root", cygwin_munge(root))) elif var == "dirname": # '$dirname' is a parameter to the rule action, which means # it shouldn't be converted to a Ninja path. But we don't # want $!PRODUCT_DIR in there either. dirname_expanded = self.ExpandSpecial( dirname, self.base_to_build ) extra_bindings.append( ("dirname", cygwin_munge(dirname_expanded)) ) elif var == "source": # '$source' is a parameter to the rule action, which means # it shouldn't be converted to a Ninja path. But we don't # want $!PRODUCT_DIR in there either. source_expanded = self.ExpandSpecial(source, self.base_to_build) extra_bindings.append(("source", cygwin_munge(source_expanded))) elif var == "ext": extra_bindings.append(("ext", ext)) elif var == "name": extra_bindings.append(("name", cygwin_munge(basename))) else: assert var is None, repr(var) outputs = [self.GypPathToNinja(o, env) for o in outputs] if self.flavor == "win": # WriteNewNinjaRule uses unique_name to create a rsp file on win. extra_bindings.append( ("unique_name", hashlib.md5(outputs[0]).hexdigest()) ) self.ninja.build( outputs, rule_name, self.GypPathToNinja(source), implicit=inputs, order_only=prebuild, variables=extra_bindings, ) all_outputs.extend(outputs) return all_outputs def WriteCopies(self, copies, prebuild, mac_bundle_depends): outputs = [] if self.xcode_settings: extra_env = self.xcode_settings.GetPerTargetSettings() env = self.GetToolchainEnv(additional_settings=extra_env) else: env = self.GetToolchainEnv() for to_copy in copies: for path in to_copy["files"]: # Normalize the path so trailing slashes don't confuse us. path = os.path.normpath(path) basename = os.path.split(path)[1] src = self.GypPathToNinja(path, env) dst = self.GypPathToNinja( os.path.join(to_copy["destination"], basename), env ) outputs += self.ninja.build(dst, "copy", src, order_only=prebuild) if self.is_mac_bundle: # gyp has mac_bundle_resources to copy things into a bundle's # Resources folder, but there's no built-in way to copy files # to other places in the bundle. # Hence, some targets use copies for this. # Check if this file is copied into the current bundle, # and if so add it to the bundle depends so # that dependent targets get rebuilt if the copy input changes. if dst.startswith( self.xcode_settings.GetBundleContentsFolderPath() ): mac_bundle_depends.append(dst) return outputs def WriteiOSFrameworkHeaders(self, spec, outputs, prebuild): """Prebuild steps to generate hmap files and copy headers to destination.""" framework = self.ComputeMacBundleOutput() all_sources = spec["sources"] copy_headers = spec["mac_framework_headers"] output = self.GypPathToUniqueOutput("headers.hmap") self.xcode_settings.header_map_path = output all_headers = map( self.GypPathToNinja, filter(lambda x: x.endswith(".h"), all_sources) ) variables = [ ("framework", framework), ("copy_headers", map(self.GypPathToNinja, copy_headers)), ] outputs.extend( self.ninja.build( output, "compile_ios_framework_headers", all_headers, variables=variables, order_only=prebuild, ) ) def WriteMacBundleResources(self, resources, bundle_depends): """Writes ninja edges for 'mac_bundle_resources'.""" xcassets = [] extra_env = self.xcode_settings.GetPerTargetSettings() env = self.GetSortedXcodeEnv(additional_settings=extra_env) env = self.ComputeExportEnvString(env) isBinary = self.xcode_settings.IsBinaryOutputFormat(self.config_name) for output, res in gyp.xcode_emulation.GetMacBundleResources( generator_default_variables["PRODUCT_DIR"], self.xcode_settings, map(self.GypPathToNinja, resources), ): output = self.ExpandSpecial(output) if os.path.splitext(output)[-1] != ".xcassets": self.ninja.build( output, "mac_tool", res, variables=[ ("mactool_cmd", "copy-bundle-resource"), ("env", env), ("binary", isBinary), ], ) bundle_depends.append(output) else: xcassets.append(res) return xcassets def WriteMacXCassets(self, xcassets, bundle_depends): """Writes ninja edges for 'mac_bundle_resources' .xcassets files. This add an invocation of 'actool' via the 'mac_tool.py' helper script. It assumes that the assets catalogs define at least one imageset and thus an Assets.car file will be generated in the application resources directory. If this is not the case, then the build will probably be done at each invocation of ninja.""" if not xcassets: return extra_arguments = {} settings_to_arg = { "XCASSETS_APP_ICON": "app-icon", "XCASSETS_LAUNCH_IMAGE": "launch-image", } settings = self.xcode_settings.xcode_settings[self.config_name] for settings_key, arg_name in settings_to_arg.items(): value = settings.get(settings_key) if value: extra_arguments[arg_name] = value partial_info_plist = None if extra_arguments: partial_info_plist = self.GypPathToUniqueOutput( "assetcatalog_generated_info.plist" ) extra_arguments["output-partial-info-plist"] = partial_info_plist outputs = [] outputs.append( os.path.join(self.xcode_settings.GetBundleResourceFolder(), "Assets.car") ) if partial_info_plist: outputs.append(partial_info_plist) keys = QuoteShellArgument(json.dumps(extra_arguments), self.flavor) extra_env = self.xcode_settings.GetPerTargetSettings() env = self.GetSortedXcodeEnv(additional_settings=extra_env) env = self.ComputeExportEnvString(env) bundle_depends.extend( self.ninja.build( outputs, "compile_xcassets", xcassets, variables=[("env", env), ("keys", keys)], ) ) return partial_info_plist def WriteMacInfoPlist(self, partial_info_plist, bundle_depends): """Write build rules for bundle Info.plist files.""" info_plist, out, defines, extra_env = gyp.xcode_emulation.GetMacInfoPlist( generator_default_variables["PRODUCT_DIR"], self.xcode_settings, self.GypPathToNinja, ) if not info_plist: return out = self.ExpandSpecial(out) if defines: # Create an intermediate file to store preprocessed results. intermediate_plist = self.GypPathToUniqueOutput( os.path.basename(info_plist) ) defines = " ".join([Define(d, self.flavor) for d in defines]) info_plist = self.ninja.build( intermediate_plist, "preprocess_infoplist", info_plist, variables=[("defines", defines)], ) env = self.GetSortedXcodeEnv(additional_settings=extra_env) env = self.ComputeExportEnvString(env) if partial_info_plist: intermediate_plist = self.GypPathToUniqueOutput("merged_info.plist") info_plist = self.ninja.build( intermediate_plist, "merge_infoplist", [partial_info_plist, info_plist] ) keys = self.xcode_settings.GetExtraPlistItems(self.config_name) keys = QuoteShellArgument(json.dumps(keys), self.flavor) isBinary = self.xcode_settings.IsBinaryOutputFormat(self.config_name) self.ninja.build( out, "copy_infoplist", info_plist, variables=[("env", env), ("keys", keys), ("binary", isBinary)], ) bundle_depends.append(out) def WriteSources( self, ninja_file, config_name, config, sources, predepends, precompiled_header, spec, ): """Write build rules to compile all of |sources|.""" if self.toolset == "host": self.ninja.variable("ar", "$ar_host") self.ninja.variable("cc", "$cc_host") self.ninja.variable("cxx", "$cxx_host") self.ninja.variable("ld", "$ld_host") self.ninja.variable("ldxx", "$ldxx_host") self.ninja.variable("nm", "$nm_host") self.ninja.variable("readelf", "$readelf_host") if self.flavor != "mac" or len(self.archs) == 1: return self.WriteSourcesForArch( self.ninja, config_name, config, sources, predepends, precompiled_header, spec, ) else: return { arch: self.WriteSourcesForArch( self.arch_subninjas[arch], config_name, config, sources, predepends, precompiled_header, spec, arch=arch, ) for arch in self.archs } def WriteSourcesForArch( self, ninja_file, config_name, config, sources, predepends, precompiled_header, spec, arch=None, ): """Write build rules to compile all of |sources|.""" extra_defines = [] if self.flavor == "mac": cflags = self.xcode_settings.GetCflags(config_name, arch=arch) cflags_c = self.xcode_settings.GetCflagsC(config_name) cflags_cc = self.xcode_settings.GetCflagsCC(config_name) cflags_objc = ["$cflags_c"] + self.xcode_settings.GetCflagsObjC(config_name) cflags_objcc = ["$cflags_cc"] + self.xcode_settings.GetCflagsObjCC( config_name ) elif self.flavor == "win": asmflags = self.msvs_settings.GetAsmflags(config_name) cflags = self.msvs_settings.GetCflags(config_name) cflags_c = self.msvs_settings.GetCflagsC(config_name) cflags_cc = self.msvs_settings.GetCflagsCC(config_name) extra_defines = self.msvs_settings.GetComputedDefines(config_name) # See comment at cc_command for why there's two .pdb files. pdbpath_c = pdbpath_cc = self.msvs_settings.GetCompilerPdbName( config_name, self.ExpandSpecial ) if not pdbpath_c: obj = "obj" if self.toolset != "target": obj += "." + self.toolset pdbpath = os.path.normpath(os.path.join(obj, self.base_dir, self.name)) pdbpath_c = pdbpath + ".c.pdb" pdbpath_cc = pdbpath + ".cc.pdb" self.WriteVariableList(ninja_file, "pdbname_c", [pdbpath_c]) self.WriteVariableList(ninja_file, "pdbname_cc", [pdbpath_cc]) self.WriteVariableList(ninja_file, "pchprefix", [self.name]) else: cflags = config.get("cflags", []) cflags_c = config.get("cflags_c", []) cflags_cc = config.get("cflags_cc", []) # Respect environment variables related to build, but target-specific # flags can still override them. if self.toolset == "target": cflags_c = ( os.environ.get("CPPFLAGS", "").split() + os.environ.get("CFLAGS", "").split() + cflags_c ) cflags_cc = ( os.environ.get("CPPFLAGS", "").split() + os.environ.get("CXXFLAGS", "").split() + cflags_cc ) elif self.toolset == "host": cflags_c = ( os.environ.get("CPPFLAGS_host", "").split() + os.environ.get("CFLAGS_host", "").split() + cflags_c ) cflags_cc = ( os.environ.get("CPPFLAGS_host", "").split() + os.environ.get("CXXFLAGS_host", "").split() + cflags_cc ) defines = config.get("defines", []) + extra_defines self.WriteVariableList( ninja_file, "defines", [Define(d, self.flavor) for d in defines] ) if self.flavor == "win": self.WriteVariableList( ninja_file, "asmflags", map(self.ExpandSpecial, asmflags) ) self.WriteVariableList( ninja_file, "rcflags", [ QuoteShellArgument(self.ExpandSpecial(f), self.flavor) for f in self.msvs_settings.GetRcflags( config_name, self.GypPathToNinja ) ], ) include_dirs = config.get("include_dirs", []) env = self.GetToolchainEnv() if self.flavor == "win": include_dirs = self.msvs_settings.AdjustIncludeDirs( include_dirs, config_name ) self.WriteVariableList( ninja_file, "includes", [ QuoteShellArgument("-I" + self.GypPathToNinja(i, env), self.flavor) for i in include_dirs ], ) if self.flavor == "win": midl_include_dirs = config.get("midl_include_dirs", []) midl_include_dirs = self.msvs_settings.AdjustMidlIncludeDirs( midl_include_dirs, config_name ) self.WriteVariableList( ninja_file, "midl_includes", [ QuoteShellArgument("-I" + self.GypPathToNinja(i, env), self.flavor) for i in midl_include_dirs ], ) pch_commands = precompiled_header.GetPchBuildCommands(arch) if self.flavor == "mac": # Most targets use no precompiled headers, so only write these if needed. for ext, var in [ ("c", "cflags_pch_c"), ("cc", "cflags_pch_cc"), ("m", "cflags_pch_objc"), ("mm", "cflags_pch_objcc"), ]: include = precompiled_header.GetInclude(ext, arch) if include: ninja_file.variable(var, include) arflags = config.get("arflags", []) self.WriteVariableList(ninja_file, "cflags", map(self.ExpandSpecial, cflags)) self.WriteVariableList( ninja_file, "cflags_c", map(self.ExpandSpecial, cflags_c) ) self.WriteVariableList( ninja_file, "cflags_cc", map(self.ExpandSpecial, cflags_cc) ) if self.flavor == "mac": self.WriteVariableList( ninja_file, "cflags_objc", map(self.ExpandSpecial, cflags_objc) ) self.WriteVariableList( ninja_file, "cflags_objcc", map(self.ExpandSpecial, cflags_objcc) ) self.WriteVariableList(ninja_file, "arflags", map(self.ExpandSpecial, arflags)) ninja_file.newline() outputs = [] has_rc_source = False for source in sources: filename, ext = os.path.splitext(source) ext = ext[1:] obj_ext = self.obj_ext if ext in ("cc", "cpp", "cxx"): command = "cxx" self.target.uses_cpp = True elif ext == "c" or (ext == "S" and self.flavor != "win"): command = "cc" elif ext == "s" and self.flavor != "win": # Doesn't generate .o.d files. command = "cc_s" elif ( self.flavor == "win" and ext in ("asm", "S") and not self.msvs_settings.HasExplicitAsmRules(spec) ): command = "asm" # Add the _asm suffix as msvs is capable of handling .cc and # .asm files of the same name without collision. obj_ext = "_asm.obj" elif self.flavor == "mac" and ext == "m": command = "objc" elif self.flavor == "mac" and ext == "mm": command = "objcxx" self.target.uses_cpp = True elif self.flavor == "win" and ext == "rc": command = "rc" obj_ext = ".res" has_rc_source = True else: # Ignore unhandled extensions. continue input = self.GypPathToNinja(source) output = self.GypPathToUniqueOutput(filename + obj_ext) if arch is not None: output = AddArch(output, arch) implicit = precompiled_header.GetObjDependencies([input], [output], arch) variables = [] if self.flavor == "win": variables, output, implicit = precompiled_header.GetFlagsModifications( input, output, implicit, command, cflags_c, cflags_cc, self.ExpandSpecial, ) ninja_file.build( output, command, input, implicit=[gch for _, _, gch in implicit], order_only=predepends, variables=variables, ) outputs.append(output) if has_rc_source: resource_include_dirs = config.get("resource_include_dirs", include_dirs) self.WriteVariableList( ninja_file, "resource_includes", [ QuoteShellArgument("-I" + self.GypPathToNinja(i, env), self.flavor) for i in resource_include_dirs ], ) self.WritePchTargets(ninja_file, pch_commands) ninja_file.newline() return outputs def WritePchTargets(self, ninja_file, pch_commands): """Writes ninja rules to compile prefix headers.""" if not pch_commands: return for gch, lang_flag, lang, input in pch_commands: var_name = { "c": "cflags_pch_c", "cc": "cflags_pch_cc", "m": "cflags_pch_objc", "mm": "cflags_pch_objcc", }[lang] map = { "c": "cc", "cc": "cxx", "m": "objc", "mm": "objcxx", } cmd = map.get(lang) ninja_file.build(gch, cmd, input, variables=[(var_name, lang_flag)]) def WriteLink(self, spec, config_name, config, link_deps, compile_deps): """Write out a link step. Fills out target.binary. """ if self.flavor != "mac" or len(self.archs) == 1: return self.WriteLinkForArch( self.ninja, spec, config_name, config, link_deps, compile_deps ) else: output = self.ComputeOutput(spec) inputs = [ self.WriteLinkForArch( self.arch_subninjas[arch], spec, config_name, config, link_deps[arch], compile_deps, arch=arch, ) for arch in self.archs ] extra_bindings = [] build_output = output if not self.is_mac_bundle: self.AppendPostbuildVariable(extra_bindings, spec, output, output) # TODO(yyanagisawa): more work needed to fix: # https://code.google.com/p/gyp/issues/detail?id=411 if ( spec["type"] in ("shared_library", "loadable_module") and not self.is_mac_bundle ): extra_bindings.append(("lib", output)) self.ninja.build( [output, output + ".TOC"], "solipo", inputs, variables=extra_bindings, ) else: self.ninja.build(build_output, "lipo", inputs, variables=extra_bindings) return output def WriteLinkForArch( self, ninja_file, spec, config_name, config, link_deps, compile_deps, arch=None ): """Write out a link step. Fills out target.binary. """ command = { "executable": "link", "loadable_module": "solink_module", "shared_library": "solink", }[spec["type"]] command_suffix = "" implicit_deps = set() solibs = set() order_deps = set() if compile_deps: # Normally, the compiles of the target already depend on compile_deps, # but a shared_library target might have no sources and only link together # a few static_library deps, so the link step also needs to depend # on compile_deps to make sure actions in the shared_library target # get run before the link. order_deps.add(compile_deps) if "dependencies" in spec: # Two kinds of dependencies: # - Linkable dependencies (like a .a or a .so): add them to the link line. # - Non-linkable dependencies (like a rule that generates a file # and writes a stamp file): add them to implicit_deps extra_link_deps = set() for dep in spec["dependencies"]: target = self.target_outputs.get(dep) if not target: continue linkable = target.Linkable() if linkable: new_deps = [] if ( self.flavor == "win" and target.component_objs and self.msvs_settings.IsUseLibraryDependencyInputs(config_name) ): new_deps = target.component_objs if target.compile_deps: order_deps.add(target.compile_deps) elif self.flavor == "win" and target.import_lib: new_deps = [target.import_lib] elif target.UsesToc(self.flavor): solibs.add(target.binary) implicit_deps.add(target.binary + ".TOC") else: new_deps = [target.binary] for new_dep in new_deps: if new_dep not in extra_link_deps: extra_link_deps.add(new_dep) link_deps.append(new_dep) final_output = target.FinalOutput() if not linkable or final_output != target.binary: implicit_deps.add(final_output) extra_bindings = [] if self.target.uses_cpp and self.flavor != "win": extra_bindings.append(("ld", "$ldxx")) output = self.ComputeOutput(spec, arch) if arch is None and not self.is_mac_bundle: self.AppendPostbuildVariable(extra_bindings, spec, output, output) is_executable = spec["type"] == "executable" # The ldflags config key is not used on mac or win. On those platforms # linker flags are set via xcode_settings and msvs_settings, respectively. if self.toolset == "target": env_ldflags = os.environ.get("LDFLAGS", "").split() elif self.toolset == "host": env_ldflags = os.environ.get("LDFLAGS_host", "").split() if self.flavor == "mac": ldflags = self.xcode_settings.GetLdflags( config_name, self.ExpandSpecial(generator_default_variables["PRODUCT_DIR"]), self.GypPathToNinja, arch, ) ldflags = env_ldflags + ldflags elif self.flavor == "win": manifest_base_name = self.GypPathToUniqueOutput( self.ComputeOutputFileName(spec) ) ( ldflags, intermediate_manifest, manifest_files, ) = self.msvs_settings.GetLdflags( config_name, self.GypPathToNinja, self.ExpandSpecial, manifest_base_name, output, is_executable, self.toplevel_build, ) ldflags = env_ldflags + ldflags self.WriteVariableList(ninja_file, "manifests", manifest_files) implicit_deps = implicit_deps.union(manifest_files) if intermediate_manifest: self.WriteVariableList( ninja_file, "intermediatemanifest", [intermediate_manifest] ) command_suffix = _GetWinLinkRuleNameSuffix( self.msvs_settings.IsEmbedManifest(config_name) ) def_file = self.msvs_settings.GetDefFile(self.GypPathToNinja) if def_file: implicit_deps.add(def_file) else: # Respect environment variables related to build, but target-specific # flags can still override them. ldflags = env_ldflags + config.get("ldflags", []) if is_executable and len(solibs): rpath = "lib/" if self.toolset != "target": rpath += self.toolset ldflags.append(r"-Wl,-rpath=\$$ORIGIN/%s" % rpath) else: ldflags.append("-Wl,-rpath=%s" % self.target_rpath) ldflags.append("-Wl,-rpath-link=%s" % rpath) self.WriteVariableList(ninja_file, "ldflags", map(self.ExpandSpecial, ldflags)) library_dirs = config.get("library_dirs", []) if self.flavor == "win": library_dirs = [ self.msvs_settings.ConvertVSMacros(library_dir, config_name) for library_dir in library_dirs ] library_dirs = [ "/LIBPATH:" + QuoteShellArgument(self.GypPathToNinja(library_dir), self.flavor) for library_dir in library_dirs ] else: library_dirs = [ QuoteShellArgument("-L" + self.GypPathToNinja(library_dir), self.flavor) for library_dir in library_dirs ] libraries = gyp.common.uniquer( map(self.ExpandSpecial, spec.get("libraries", [])) ) if self.flavor == "mac": libraries = self.xcode_settings.AdjustLibraries(libraries, config_name) elif self.flavor == "win": libraries = self.msvs_settings.AdjustLibraries(libraries) self.WriteVariableList(ninja_file, "libs", library_dirs + libraries) linked_binary = output if command in ("solink", "solink_module"): extra_bindings.append(("soname", os.path.split(output)[1])) extra_bindings.append(("lib", gyp.common.EncodePOSIXShellArgument(output))) if self.flavor != "win": link_file_list = output if self.is_mac_bundle: # 'Dependency Framework.framework/Versions/A/Dependency Framework' # -> 'Dependency Framework.framework.rsp' link_file_list = self.xcode_settings.GetWrapperName() if arch: link_file_list += "." + arch link_file_list += ".rsp" # If an rspfile contains spaces, ninja surrounds the filename with # quotes around it and then passes it to open(), creating a file with # quotes in its name (and when looking for the rsp file, the name # makes it through bash which strips the quotes) :-/ link_file_list = link_file_list.replace(" ", "_") extra_bindings.append( ( "link_file_list", gyp.common.EncodePOSIXShellArgument(link_file_list), ) ) if self.flavor == "win": extra_bindings.append(("binary", output)) if ( "/NOENTRY" not in ldflags and not self.msvs_settings.GetNoImportLibrary(config_name) ): self.target.import_lib = output + ".lib" extra_bindings.append( ("implibflag", "/IMPLIB:%s" % self.target.import_lib) ) pdbname = self.msvs_settings.GetPDBName( config_name, self.ExpandSpecial, output + ".pdb" ) output = [output, self.target.import_lib] if pdbname: output.append(pdbname) elif not self.is_mac_bundle: output = [output, output + ".TOC"] else: command = command + "_notoc" elif self.flavor == "win": extra_bindings.append(("binary", output)) pdbname = self.msvs_settings.GetPDBName( config_name, self.ExpandSpecial, output + ".pdb" ) if pdbname: output = [output, pdbname] if len(solibs): extra_bindings.append( ("solibs", gyp.common.EncodePOSIXShellList(sorted(solibs))) ) ninja_file.build( output, command + command_suffix, link_deps, implicit=sorted(implicit_deps), order_only=list(order_deps), variables=extra_bindings, ) return linked_binary def WriteTarget(self, spec, config_name, config, link_deps, compile_deps): extra_link_deps = any( self.target_outputs.get(dep).Linkable() for dep in spec.get("dependencies", []) if dep in self.target_outputs ) if spec["type"] == "none" or (not link_deps and not extra_link_deps): # TODO(evan): don't call this function for 'none' target types, as # it doesn't do anything, and we fake out a 'binary' with a stamp file. self.target.binary = compile_deps self.target.type = "none" elif spec["type"] == "static_library": self.target.binary = self.ComputeOutput(spec) if ( self.flavor not in ("mac", "openbsd", "netbsd", "win") and not self.is_standalone_static_library ): self.ninja.build( self.target.binary, "alink_thin", link_deps, order_only=compile_deps ) else: variables = [] if self.xcode_settings: libtool_flags = self.xcode_settings.GetLibtoolflags(config_name) if libtool_flags: variables.append(("libtool_flags", libtool_flags)) if self.msvs_settings: libflags = self.msvs_settings.GetLibFlags( config_name, self.GypPathToNinja ) variables.append(("libflags", libflags)) if self.flavor != "mac" or len(self.archs) == 1: self.AppendPostbuildVariable( variables, spec, self.target.binary, self.target.binary ) self.ninja.build( self.target.binary, "alink", link_deps, order_only=compile_deps, variables=variables, ) else: inputs = [] for arch in self.archs: output = self.ComputeOutput(spec, arch) self.arch_subninjas[arch].build( output, "alink", link_deps[arch], order_only=compile_deps, variables=variables, ) inputs.append(output) # TODO: It's not clear if # libtool_flags should be passed to the alink # call that combines single-arch .a files into a fat .a file. self.AppendPostbuildVariable( variables, spec, self.target.binary, self.target.binary ) self.ninja.build( self.target.binary, "alink", inputs, # FIXME: test proving order_only=compile_deps isn't # needed. variables=variables, ) else: self.target.binary = self.WriteLink( spec, config_name, config, link_deps, compile_deps ) return self.target.binary def WriteMacBundle(self, spec, mac_bundle_depends, is_empty): assert self.is_mac_bundle package_framework = spec["type"] in ("shared_library", "loadable_module") output = self.ComputeMacBundleOutput() if is_empty: output += ".stamp" variables = [] self.AppendPostbuildVariable( variables, spec, output, self.target.binary, is_command_start=not package_framework, ) if package_framework and not is_empty: if spec["type"] == "shared_library" and self.xcode_settings.isIOS: self.ninja.build( output, "package_ios_framework", mac_bundle_depends, variables=variables, ) else: variables.append(("version", self.xcode_settings.GetFrameworkVersion())) self.ninja.build( output, "package_framework", mac_bundle_depends, variables=variables ) else: self.ninja.build(output, "stamp", mac_bundle_depends, variables=variables) self.target.bundle = output return output def GetToolchainEnv(self, additional_settings=None): """Returns the variables toolchain would set for build steps.""" env = self.GetSortedXcodeEnv(additional_settings=additional_settings) if self.flavor == "win": env = self.GetMsvsToolchainEnv(additional_settings=additional_settings) return env def GetMsvsToolchainEnv(self, additional_settings=None): """Returns the variables Visual Studio would set for build steps.""" return self.msvs_settings.GetVSMacroEnv( "$!PRODUCT_DIR", config=self.config_name ) def GetSortedXcodeEnv(self, additional_settings=None): """Returns the variables Xcode would set for build steps.""" assert self.abs_build_dir abs_build_dir = self.abs_build_dir return gyp.xcode_emulation.GetSortedXcodeEnv( self.xcode_settings, abs_build_dir, os.path.join(abs_build_dir, self.build_to_base), self.config_name, additional_settings, ) def GetSortedXcodePostbuildEnv(self): """Returns the variables Xcode would set for postbuild steps.""" postbuild_settings = {} # CHROMIUM_STRIP_SAVE_FILE is a chromium-specific hack. # TODO(thakis): It would be nice to have some general mechanism instead. strip_save_file = self.xcode_settings.GetPerTargetSetting( "CHROMIUM_STRIP_SAVE_FILE" ) if strip_save_file: postbuild_settings["CHROMIUM_STRIP_SAVE_FILE"] = strip_save_file return self.GetSortedXcodeEnv(additional_settings=postbuild_settings) def AppendPostbuildVariable( self, variables, spec, output, binary, is_command_start=False ): """Adds a 'postbuild' variable if there is a postbuild for |output|.""" postbuild = self.GetPostbuildCommand(spec, output, binary, is_command_start) if postbuild: variables.append(("postbuilds", postbuild)) def GetPostbuildCommand(self, spec, output, output_binary, is_command_start): """Returns a shell command that runs all the postbuilds, and removes |output| if any of them fails. If |is_command_start| is False, then the returned string will start with ' && '.""" if not self.xcode_settings or spec["type"] == "none" or not output: return "" output = QuoteShellArgument(output, self.flavor) postbuilds = gyp.xcode_emulation.GetSpecPostbuildCommands(spec, quiet=True) if output_binary is not None: postbuilds = self.xcode_settings.AddImplicitPostbuilds( self.config_name, os.path.normpath(os.path.join(self.base_to_build, output)), QuoteShellArgument( os.path.normpath(os.path.join(self.base_to_build, output_binary)), self.flavor, ), postbuilds, quiet=True, ) if not postbuilds: return "" # Postbuilds expect to be run in the gyp file's directory, so insert an # implicit postbuild to cd to there. postbuilds.insert( 0, gyp.common.EncodePOSIXShellList(["cd", self.build_to_base]) ) env = self.ComputeExportEnvString(self.GetSortedXcodePostbuildEnv()) # G will be non-null if any postbuild fails. Run all postbuilds in a # subshell. commands = ( env + " (" + " && ".join([ninja_syntax.escape(command) for command in postbuilds]) ) command_string = ( commands + "); G=$$?; " # Remove the final output if any postbuild failed. "((exit $$G) || rm -rf %s) " % output + "&& exit $$G)" ) if is_command_start: return "(" + command_string + " && " else: return "$ && (" + command_string def ComputeExportEnvString(self, env): """Given an environment, returns a string looking like 'export FOO=foo; export BAR="${FOO} bar;' that exports |env| to the shell.""" export_str = [] for k, v in env: export_str.append( "export %s=%s;" % (k, ninja_syntax.escape(gyp.common.EncodePOSIXShellArgument(v))) ) return " ".join(export_str) def ComputeMacBundleOutput(self): """Return the 'output' (full output path) to a bundle output directory.""" assert self.is_mac_bundle path = generator_default_variables["PRODUCT_DIR"] return self.ExpandSpecial( os.path.join(path, self.xcode_settings.GetWrapperName()) ) def ComputeOutputFileName(self, spec, type=None): """Compute the filename of the final output for the current target.""" if not type: type = spec["type"] default_variables = copy.copy(generator_default_variables) CalculateVariables(default_variables, {"flavor": self.flavor}) # Compute filename prefix: the product prefix, or a default for # the product type. DEFAULT_PREFIX = { "loadable_module": default_variables["SHARED_LIB_PREFIX"], "shared_library": default_variables["SHARED_LIB_PREFIX"], "static_library": default_variables["STATIC_LIB_PREFIX"], "executable": default_variables["EXECUTABLE_PREFIX"], } prefix = spec.get("product_prefix", DEFAULT_PREFIX.get(type, "")) # Compute filename extension: the product extension, or a default # for the product type. DEFAULT_EXTENSION = { "loadable_module": default_variables["SHARED_LIB_SUFFIX"], "shared_library": default_variables["SHARED_LIB_SUFFIX"], "static_library": default_variables["STATIC_LIB_SUFFIX"], "executable": default_variables["EXECUTABLE_SUFFIX"], } extension = spec.get("product_extension") if extension: extension = "." + extension else: extension = DEFAULT_EXTENSION.get(type, "") if "product_name" in spec: # If we were given an explicit name, use that. target = spec["product_name"] else: # Otherwise, derive a name from the target name. target = spec["target_name"] if prefix == "lib": # Snip out an extra 'lib' from libs if appropriate. target = StripPrefix(target, "lib") if type in ( "static_library", "loadable_module", "shared_library", "executable", ): return f"{prefix}{target}{extension}" elif type == "none": return "%s.stamp" % target else: raise Exception("Unhandled output type %s" % type) def ComputeOutput(self, spec, arch=None): """Compute the path for the final output of the spec.""" type = spec["type"] if self.flavor == "win": override = self.msvs_settings.GetOutputName( self.config_name, self.ExpandSpecial ) if override: return override if ( arch is None and self.flavor == "mac" and type in ("static_library", "executable", "shared_library", "loadable_module") ): filename = self.xcode_settings.GetExecutablePath() else: filename = self.ComputeOutputFileName(spec, type) if arch is None and "product_dir" in spec: path = os.path.join(spec["product_dir"], filename) return self.ExpandSpecial(path) # Some products go into the output root, libraries go into shared library # dir, and everything else goes into the normal place. type_in_output_root = ["executable", "loadable_module"] if self.flavor == "mac" and self.toolset == "target": type_in_output_root += ["shared_library", "static_library"] elif self.flavor == "win" and self.toolset == "target": type_in_output_root += ["shared_library"] if arch is not None: # Make sure partial executables don't end up in a bundle or the regular # output directory. archdir = "arch" if self.toolset != "target": archdir = os.path.join("arch", "%s" % self.toolset) return os.path.join(archdir, AddArch(filename, arch)) elif type in type_in_output_root or self.is_standalone_static_library: return filename elif type == "shared_library": libdir = "lib" if self.toolset != "target": libdir = os.path.join("lib", "%s" % self.toolset) return os.path.join(libdir, filename) else: return self.GypPathToUniqueOutput(filename, qualified=False) def WriteVariableList(self, ninja_file, var, values): assert not isinstance(values, str) if values is None: values = [] ninja_file.variable(var, " ".join(values)) def WriteNewNinjaRule( self, name, args, description, win_shell_flags, env, pool, depfile=None ): """Write out a new ninja "rule" statement for a given command. Returns the name of the new rule, and a copy of |args| with variables expanded.""" if self.flavor == "win": args = [ self.msvs_settings.ConvertVSMacros( arg, self.base_to_build, config=self.config_name ) for arg in args ] description = self.msvs_settings.ConvertVSMacros( description, config=self.config_name ) elif self.flavor == "mac": # |env| is an empty list on non-mac. args = [gyp.xcode_emulation.ExpandEnvVars(arg, env) for arg in args] description = gyp.xcode_emulation.ExpandEnvVars(description, env) # TODO: we shouldn't need to qualify names; we do it because # currently the ninja rule namespace is global, but it really # should be scoped to the subninja. rule_name = self.name if self.toolset == "target": rule_name += "." + self.toolset rule_name += "." + name rule_name = re.sub("[^a-zA-Z0-9_]", "_", rule_name) # Remove variable references, but not if they refer to the magic rule # variables. This is not quite right, as it also protects these for # actions, not just for rules where they are valid. Good enough. protect = ["${root}", "${dirname}", "${source}", "${ext}", "${name}"] protect = "(?!" + "|".join(map(re.escape, protect)) + ")" description = re.sub(protect + r"\$", "_", description) # gyp dictates that commands are run from the base directory. # cd into the directory before running, and adjust paths in # the arguments to point to the proper locations. rspfile = None rspfile_content = None args = [self.ExpandSpecial(arg, self.base_to_build) for arg in args] if self.flavor == "win": rspfile = rule_name + ".$unique_name.rsp" # The cygwin case handles this inside the bash sub-shell. run_in = "" if win_shell_flags.cygwin else " " + self.build_to_base if win_shell_flags.cygwin: rspfile_content = self.msvs_settings.BuildCygwinBashCommandLine( args, self.build_to_base ) else: rspfile_content = gyp.msvs_emulation.EncodeRspFileList( args, win_shell_flags.quote) command = ( "%s gyp-win-tool action-wrapper $arch " % sys.executable + rspfile + run_in ) else: env = self.ComputeExportEnvString(env) command = gyp.common.EncodePOSIXShellList(args) command = "cd %s; " % self.build_to_base + env + command # GYP rules/actions express being no-ops by not touching their outputs. # Avoid executing downstream dependencies in this case by specifying # restat=1 to ninja. self.ninja.rule( rule_name, command, description, depfile=depfile, restat=True, pool=pool, rspfile=rspfile, rspfile_content=rspfile_content, ) self.ninja.newline() return rule_name, args def CalculateVariables(default_variables, params): """Calculate additional variables for use in the build (called by gyp).""" global generator_additional_non_configuration_keys global generator_additional_path_sections flavor = gyp.common.GetFlavor(params) if flavor == "mac": default_variables.setdefault("OS", "mac") default_variables.setdefault("SHARED_LIB_SUFFIX", ".dylib") default_variables.setdefault( "SHARED_LIB_DIR", generator_default_variables["PRODUCT_DIR"] ) default_variables.setdefault( "LIB_DIR", generator_default_variables["PRODUCT_DIR"] ) # Copy additional generator configuration data from Xcode, which is shared # by the Mac Ninja generator. import gyp.generator.xcode as xcode_generator generator_additional_non_configuration_keys = getattr( xcode_generator, "generator_additional_non_configuration_keys", [] ) generator_additional_path_sections = getattr( xcode_generator, "generator_additional_path_sections", [] ) global generator_extra_sources_for_rules generator_extra_sources_for_rules = getattr( xcode_generator, "generator_extra_sources_for_rules", [] ) elif flavor == "win": exts = gyp.MSVSUtil.TARGET_TYPE_EXT default_variables.setdefault("OS", "win") default_variables["EXECUTABLE_SUFFIX"] = "." + exts["executable"] default_variables["STATIC_LIB_PREFIX"] = "" default_variables["STATIC_LIB_SUFFIX"] = "." + exts["static_library"] default_variables["SHARED_LIB_PREFIX"] = "" default_variables["SHARED_LIB_SUFFIX"] = "." + exts["shared_library"] # Copy additional generator configuration data from VS, which is shared # by the Windows Ninja generator. import gyp.generator.msvs as msvs_generator generator_additional_non_configuration_keys = getattr( msvs_generator, "generator_additional_non_configuration_keys", [] ) generator_additional_path_sections = getattr( msvs_generator, "generator_additional_path_sections", [] ) gyp.msvs_emulation.CalculateCommonVariables(default_variables, params) else: operating_system = flavor if flavor == "android": operating_system = "linux" # Keep this legacy behavior for now. default_variables.setdefault("OS", operating_system) default_variables.setdefault("SHARED_LIB_SUFFIX", ".so") default_variables.setdefault( "SHARED_LIB_DIR", os.path.join("$!PRODUCT_DIR", "lib") ) default_variables.setdefault("LIB_DIR", os.path.join("$!PRODUCT_DIR", "obj")) def ComputeOutputDir(params): """Returns the path from the toplevel_dir to the build output directory.""" # generator_dir: relative path from pwd to where make puts build files. # Makes migrating from make to ninja easier, ninja doesn't put anything here. generator_dir = os.path.relpath(params["options"].generator_output or ".") # output_dir: relative path from generator_dir to the build directory. output_dir = params.get("generator_flags", {}).get("output_dir", "out") # Relative path from source root to our output files. e.g. "out" return os.path.normpath(os.path.join(generator_dir, output_dir)) def CalculateGeneratorInputInfo(params): """Called by __init__ to initialize generator values based on params.""" # E.g. "out/gypfiles" toplevel = params["options"].toplevel_dir qualified_out_dir = os.path.normpath( os.path.join(toplevel, ComputeOutputDir(params), "gypfiles") ) global generator_filelist_paths generator_filelist_paths = { "toplevel": toplevel, "qualified_out_dir": qualified_out_dir, } def OpenOutput(path, mode="w"): """Open |path| for writing, creating directories if necessary.""" gyp.common.EnsureDirExists(path) return open(path, mode) def CommandWithWrapper(cmd, wrappers, prog): wrapper = wrappers.get(cmd, "") if wrapper: return wrapper + " " + prog return prog def GetDefaultConcurrentLinks(): """Returns a best-guess for a number of concurrent links.""" pool_size = int(os.environ.get("GYP_LINK_CONCURRENCY", 0)) if pool_size: return pool_size if sys.platform in ("win32", "cygwin"): import ctypes class MEMORYSTATUSEX(ctypes.Structure): _fields_ = [ ("dwLength", ctypes.c_ulong), ("dwMemoryLoad", ctypes.c_ulong), ("ullTotalPhys", ctypes.c_ulonglong), ("ullAvailPhys", ctypes.c_ulonglong), ("ullTotalPageFile", ctypes.c_ulonglong), ("ullAvailPageFile", ctypes.c_ulonglong), ("ullTotalVirtual", ctypes.c_ulonglong), ("ullAvailVirtual", ctypes.c_ulonglong), ("sullAvailExtendedVirtual", ctypes.c_ulonglong), ] stat = MEMORYSTATUSEX() stat.dwLength = ctypes.sizeof(stat) ctypes.windll.kernel32.GlobalMemoryStatusEx(ctypes.byref(stat)) # VS 2015 uses 20% more working set than VS 2013 and can consume all RAM # on a 64 GB machine. mem_limit = max(1, stat.ullTotalPhys // (5 * (2 ** 30))) # total / 5GB hard_cap = max(1, int(os.environ.get("GYP_LINK_CONCURRENCY_MAX", 2 ** 32))) return min(mem_limit, hard_cap) elif sys.platform.startswith("linux"): if os.path.exists("/proc/meminfo"): with open("/proc/meminfo") as meminfo: memtotal_re = re.compile(r"^MemTotal:\s*(\d*)\s*kB") for line in meminfo: match = memtotal_re.match(line) if not match: continue # Allow 8Gb per link on Linux because Gold is quite memory hungry return max(1, int(match.group(1)) // (8 * (2 ** 20))) return 1 elif sys.platform == "darwin": try: avail_bytes = int(subprocess.check_output(["sysctl", "-n", "hw.memsize"])) # A static library debug build of Chromium's unit_tests takes ~2.7GB, so # 4GB per ld process allows for some more bloat. return max(1, avail_bytes // (4 * (2 ** 30))) # total / 4GB except subprocess.CalledProcessError: return 1 else: # TODO(scottmg): Implement this for other platforms. return 1 def _GetWinLinkRuleNameSuffix(embed_manifest): """Returns the suffix used to select an appropriate linking rule depending on whether the manifest embedding is enabled.""" return "_embed" if embed_manifest else "" def _AddWinLinkRules(master_ninja, embed_manifest): """Adds link rules for Windows platform to |master_ninja|.""" def FullLinkCommand(ldcmd, out, binary_type): resource_name = {"exe": "1", "dll": "2"}[binary_type] return ( "%(python)s gyp-win-tool link-with-manifests $arch %(embed)s " '%(out)s "%(ldcmd)s" %(resname)s $mt $rc "$intermediatemanifest" ' "$manifests" % { "python": sys.executable, "out": out, "ldcmd": ldcmd, "resname": resource_name, "embed": embed_manifest, } ) rule_name_suffix = _GetWinLinkRuleNameSuffix(embed_manifest) use_separate_mspdbsrv = int(os.environ.get("GYP_USE_SEPARATE_MSPDBSRV", "0")) != 0 dlldesc = "LINK%s(DLL) $binary" % rule_name_suffix.upper() dllcmd = ( "%s gyp-win-tool link-wrapper $arch %s " "$ld /nologo $implibflag /DLL /OUT:$binary " "@$binary.rsp" % (sys.executable, use_separate_mspdbsrv) ) dllcmd = FullLinkCommand(dllcmd, "$binary", "dll") master_ninja.rule( "solink" + rule_name_suffix, description=dlldesc, command=dllcmd, rspfile="$binary.rsp", rspfile_content="$libs $in_newline $ldflags", restat=True, pool="link_pool", ) master_ninja.rule( "solink_module" + rule_name_suffix, description=dlldesc, command=dllcmd, rspfile="$binary.rsp", rspfile_content="$libs $in_newline $ldflags", restat=True, pool="link_pool", ) # Note that ldflags goes at the end so that it has the option of # overriding default settings earlier in the command line. exe_cmd = ( "%s gyp-win-tool link-wrapper $arch %s " "$ld /nologo /OUT:$binary @$binary.rsp" % (sys.executable, use_separate_mspdbsrv) ) exe_cmd = FullLinkCommand(exe_cmd, "$binary", "exe") master_ninja.rule( "link" + rule_name_suffix, description="LINK%s $binary" % rule_name_suffix.upper(), command=exe_cmd, rspfile="$binary.rsp", rspfile_content="$in_newline $libs $ldflags", pool="link_pool", ) def GenerateOutputForConfig(target_list, target_dicts, data, params, config_name): options = params["options"] flavor = gyp.common.GetFlavor(params) generator_flags = params.get("generator_flags", {}) # build_dir: relative path from source root to our output files. # e.g. "out/Debug" build_dir = os.path.normpath(os.path.join(ComputeOutputDir(params), config_name)) toplevel_build = os.path.join(options.toplevel_dir, build_dir) master_ninja_file = OpenOutput(os.path.join(toplevel_build, "build.ninja")) master_ninja = ninja_syntax.Writer(master_ninja_file, width=120) # Put build-time support tools in out/{config_name}. gyp.common.CopyTool(flavor, toplevel_build, generator_flags) # Grab make settings for CC/CXX. # The rules are # - The priority from low to high is gcc/g++, the 'make_global_settings' in # gyp, the environment variable. # - If there is no 'make_global_settings' for CC.host/CXX.host or # 'CC_host'/'CXX_host' environment variable, cc_host/cxx_host should be set # to cc/cxx. if flavor == "win": ar = "lib.exe" # cc and cxx must be set to the correct architecture by overriding with one # of cl_x86 or cl_x64 below. cc = "UNSET" cxx = "UNSET" ld = "link.exe" ld_host = "$ld" else: ar = "ar" cc = "cc" cxx = "c++" ld = "$cc" ldxx = "$cxx" ld_host = "$cc_host" ldxx_host = "$cxx_host" ar_host = ar cc_host = None cxx_host = None cc_host_global_setting = None cxx_host_global_setting = None clang_cl = None nm = "nm" nm_host = "nm" readelf = "readelf" readelf_host = "readelf" build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) make_global_settings = data[build_file].get("make_global_settings", []) build_to_root = gyp.common.InvertRelativePath(build_dir, options.toplevel_dir) wrappers = {} for key, value in make_global_settings: if key == "AR": ar = os.path.join(build_to_root, value) if key == "AR.host": ar_host = os.path.join(build_to_root, value) if key == "CC": cc = os.path.join(build_to_root, value) if cc.endswith("clang-cl"): clang_cl = cc if key == "CXX": cxx = os.path.join(build_to_root, value) if key == "CC.host": cc_host = os.path.join(build_to_root, value) cc_host_global_setting = value if key == "CXX.host": cxx_host = os.path.join(build_to_root, value) cxx_host_global_setting = value if key == "LD": ld = os.path.join(build_to_root, value) if key == "LD.host": ld_host = os.path.join(build_to_root, value) if key == "LDXX": ldxx = os.path.join(build_to_root, value) if key == "LDXX.host": ldxx_host = os.path.join(build_to_root, value) if key == "NM": nm = os.path.join(build_to_root, value) if key == "NM.host": nm_host = os.path.join(build_to_root, value) if key == "READELF": readelf = os.path.join(build_to_root, value) if key == "READELF.host": readelf_host = os.path.join(build_to_root, value) if key.endswith("_wrapper"): wrappers[key[: -len("_wrapper")]] = os.path.join(build_to_root, value) # Support wrappers from environment variables too. for key, value in os.environ.items(): if key.lower().endswith("_wrapper"): key_prefix = key[: -len("_wrapper")] key_prefix = re.sub(r"\.HOST$", ".host", key_prefix) wrappers[key_prefix] = os.path.join(build_to_root, value) mac_toolchain_dir = generator_flags.get("mac_toolchain_dir", None) if mac_toolchain_dir: wrappers["LINK"] = "export DEVELOPER_DIR='%s' &&" % mac_toolchain_dir if flavor == "win": configs = [ target_dicts[qualified_target]["configurations"][config_name] for qualified_target in target_list ] shared_system_includes = None if not generator_flags.get("ninja_use_custom_environment_files", 0): shared_system_includes = gyp.msvs_emulation.ExtractSharedMSVSSystemIncludes( configs, generator_flags ) cl_paths = gyp.msvs_emulation.GenerateEnvironmentFiles( toplevel_build, generator_flags, shared_system_includes, OpenOutput ) for arch, path in sorted(cl_paths.items()): if clang_cl: # If we have selected clang-cl, use that instead. path = clang_cl command = CommandWithWrapper( "CC", wrappers, QuoteShellArgument(path, "win") ) if clang_cl: # Use clang-cl to cross-compile for x86 or x86_64. command += " -m32" if arch == "x86" else " -m64" master_ninja.variable("cl_" + arch, command) cc = GetEnvironFallback(["CC_target", "CC"], cc) master_ninja.variable("cc", CommandWithWrapper("CC", wrappers, cc)) cxx = GetEnvironFallback(["CXX_target", "CXX"], cxx) master_ninja.variable("cxx", CommandWithWrapper("CXX", wrappers, cxx)) if flavor == "win": master_ninja.variable("ld", ld) master_ninja.variable("idl", "midl.exe") master_ninja.variable("ar", ar) master_ninja.variable("rc", "rc.exe") master_ninja.variable("ml_x86", "ml.exe") master_ninja.variable("ml_x64", "ml64.exe") master_ninja.variable("mt", "mt.exe") else: master_ninja.variable("ld", CommandWithWrapper("LINK", wrappers, ld)) master_ninja.variable("ldxx", CommandWithWrapper("LINK", wrappers, ldxx)) master_ninja.variable("ar", GetEnvironFallback(["AR_target", "AR"], ar)) if flavor != "mac": # Mac does not use readelf/nm for .TOC generation, so avoiding polluting # the master ninja with extra unused variables. master_ninja.variable("nm", GetEnvironFallback(["NM_target", "NM"], nm)) master_ninja.variable( "readelf", GetEnvironFallback(["READELF_target", "READELF"], readelf) ) if generator_supports_multiple_toolsets: if not cc_host: cc_host = cc if not cxx_host: cxx_host = cxx master_ninja.variable("ar_host", GetEnvironFallback(["AR_host"], ar_host)) master_ninja.variable("nm_host", GetEnvironFallback(["NM_host"], nm_host)) master_ninja.variable( "readelf_host", GetEnvironFallback(["READELF_host"], readelf_host) ) cc_host = GetEnvironFallback(["CC_host"], cc_host) cxx_host = GetEnvironFallback(["CXX_host"], cxx_host) # The environment variable could be used in 'make_global_settings', like # ['CC.host', '$(CC)'] or ['CXX.host', '$(CXX)'], transform them here. if "$(CC)" in cc_host and cc_host_global_setting: cc_host = cc_host_global_setting.replace("$(CC)", cc) if "$(CXX)" in cxx_host and cxx_host_global_setting: cxx_host = cxx_host_global_setting.replace("$(CXX)", cxx) master_ninja.variable( "cc_host", CommandWithWrapper("CC.host", wrappers, cc_host) ) master_ninja.variable( "cxx_host", CommandWithWrapper("CXX.host", wrappers, cxx_host) ) if flavor == "win": master_ninja.variable("ld_host", ld_host) else: master_ninja.variable( "ld_host", CommandWithWrapper("LINK", wrappers, ld_host) ) master_ninja.variable( "ldxx_host", CommandWithWrapper("LINK", wrappers, ldxx_host) ) master_ninja.newline() master_ninja.pool("link_pool", depth=GetDefaultConcurrentLinks()) master_ninja.newline() deps = "msvc" if flavor == "win" else "gcc" if flavor != "win": master_ninja.rule( "cc", description="CC $out", command=( "$cc -MMD -MF $out.d $defines $includes $cflags $cflags_c " "$cflags_pch_c -c $in -o $out" ), depfile="$out.d", deps=deps, ) master_ninja.rule( "cc_s", description="CC $out", command=( "$cc $defines $includes $cflags $cflags_c " "$cflags_pch_c -c $in -o $out" ), ) master_ninja.rule( "cxx", description="CXX $out", command=( "$cxx -MMD -MF $out.d $defines $includes $cflags $cflags_cc " "$cflags_pch_cc -c $in -o $out" ), depfile="$out.d", deps=deps, ) else: # TODO(scottmg) Separate pdb names is a test to see if it works around # http://crbug.com/142362. It seems there's a race between the creation of # the .pdb by the precompiled header step for .cc and the compilation of # .c files. This should be handled by mspdbsrv, but rarely errors out with # c1xx : fatal error C1033: cannot open program database # By making the rules target separate pdb files this might be avoided. cc_command = ( "ninja -t msvc -e $arch " + "-- " "$cc /nologo /showIncludes /FC " "@$out.rsp /c $in /Fo$out /Fd$pdbname_c " ) cxx_command = ( "ninja -t msvc -e $arch " + "-- " "$cxx /nologo /showIncludes /FC " "@$out.rsp /c $in /Fo$out /Fd$pdbname_cc " ) master_ninja.rule( "cc", description="CC $out", command=cc_command, rspfile="$out.rsp", rspfile_content="$defines $includes $cflags $cflags_c", deps=deps, ) master_ninja.rule( "cxx", description="CXX $out", command=cxx_command, rspfile="$out.rsp", rspfile_content="$defines $includes $cflags $cflags_cc", deps=deps, ) master_ninja.rule( "idl", description="IDL $in", command=( "%s gyp-win-tool midl-wrapper $arch $outdir " "$tlb $h $dlldata $iid $proxy $in " "$midl_includes $idlflags" % sys.executable ), ) master_ninja.rule( "rc", description="RC $in", # Note: $in must be last otherwise rc.exe complains. command=( "%s gyp-win-tool rc-wrapper " "$arch $rc $defines $resource_includes $rcflags /fo$out $in" % sys.executable ), ) master_ninja.rule( "asm", description="ASM $out", command=( "%s gyp-win-tool asm-wrapper " "$arch $asm $defines $includes $asmflags /c /Fo $out $in" % sys.executable ), ) if flavor != "mac" and flavor != "win": master_ninja.rule( "alink", description="AR $out", command="rm -f $out && $ar rcs $arflags $out $in", ) master_ninja.rule( "alink_thin", description="AR $out", command="rm -f $out && $ar rcsT $arflags $out $in", ) # This allows targets that only need to depend on $lib's API to declare an # order-only dependency on $lib.TOC and avoid relinking such downstream # dependencies when $lib changes only in non-public ways. # The resulting string leaves an uninterpolated %{suffix} which # is used in the final substitution below. mtime_preserving_solink_base = ( "if [ ! -e $lib -o ! -e $lib.TOC ]; then " "%(solink)s && %(extract_toc)s > $lib.TOC; else " "%(solink)s && %(extract_toc)s > $lib.tmp && " "if ! cmp -s $lib.tmp $lib.TOC; then mv $lib.tmp $lib.TOC ; " "fi; fi" % { "solink": "$ld -shared $ldflags -o $lib -Wl,-soname=$soname %(suffix)s", "extract_toc": ( "{ $readelf -d $lib | grep SONAME ; " "$nm -gD -f p $lib | cut -f1-2 -d' '; }" ), } ) master_ninja.rule( "solink", description="SOLINK $lib", restat=True, command=mtime_preserving_solink_base % {"suffix": "@$link_file_list"}, # noqa: E501 rspfile="$link_file_list", rspfile_content=( "-Wl,--whole-archive $in $solibs -Wl," "--no-whole-archive $libs" ), pool="link_pool", ) master_ninja.rule( "solink_module", description="SOLINK(module) $lib", restat=True, command=mtime_preserving_solink_base % {"suffix": "@$link_file_list"}, rspfile="$link_file_list", rspfile_content="-Wl,--start-group $in $solibs $libs -Wl,--end-group", pool="link_pool", ) master_ninja.rule( "link", description="LINK $out", command=( "$ld $ldflags -o $out " "-Wl,--start-group $in $solibs $libs -Wl,--end-group" ), pool="link_pool", ) elif flavor == "win": master_ninja.rule( "alink", description="LIB $out", command=( "%s gyp-win-tool link-wrapper $arch False " "$ar /nologo /ignore:4221 /OUT:$out @$out.rsp" % sys.executable ), rspfile="$out.rsp", rspfile_content="$in_newline $libflags", ) _AddWinLinkRules(master_ninja, embed_manifest=True) _AddWinLinkRules(master_ninja, embed_manifest=False) else: master_ninja.rule( "objc", description="OBJC $out", command=( "$cc -MMD -MF $out.d $defines $includes $cflags $cflags_objc " "$cflags_pch_objc -c $in -o $out" ), depfile="$out.d", deps=deps, ) master_ninja.rule( "objcxx", description="OBJCXX $out", command=( "$cxx -MMD -MF $out.d $defines $includes $cflags $cflags_objcc " "$cflags_pch_objcc -c $in -o $out" ), depfile="$out.d", deps=deps, ) master_ninja.rule( "alink", description="LIBTOOL-STATIC $out, POSTBUILDS", command="rm -f $out && " "./gyp-mac-tool filter-libtool libtool $libtool_flags " "-static -o $out $in" "$postbuilds", ) master_ninja.rule( "lipo", description="LIPO $out, POSTBUILDS", command="rm -f $out && lipo -create $in -output $out$postbuilds", ) master_ninja.rule( "solipo", description="SOLIPO $out, POSTBUILDS", command=( "rm -f $lib $lib.TOC && lipo -create $in -output $lib$postbuilds &&" "%(extract_toc)s > $lib.TOC" % { "extract_toc": "{ otool -l $lib | grep LC_ID_DYLIB -A 5; " "nm -gP $lib | cut -f1-2 -d' ' | grep -v U$$; true; }" } ), ) # Record the public interface of $lib in $lib.TOC. See the corresponding # comment in the posix section above for details. solink_base = "$ld %(type)s $ldflags -o $lib %(suffix)s" mtime_preserving_solink_base = ( "if [ ! -e $lib -o ! -e $lib.TOC ] || " # Always force dependent targets to relink if this library # reexports something. Handling this correctly would require # recursive TOC dumping but this is rare in practice, so punt. "otool -l $lib | grep -q LC_REEXPORT_DYLIB ; then " "%(solink)s && %(extract_toc)s > $lib.TOC; " "else " "%(solink)s && %(extract_toc)s > $lib.tmp && " "if ! cmp -s $lib.tmp $lib.TOC; then " "mv $lib.tmp $lib.TOC ; " "fi; " "fi" % { "solink": solink_base, "extract_toc": "{ otool -l $lib | grep LC_ID_DYLIB -A 5; " "nm -gP $lib | cut -f1-2 -d' ' | grep -v U$$; true; }", } ) solink_suffix = "@$link_file_list$postbuilds" master_ninja.rule( "solink", description="SOLINK $lib, POSTBUILDS", restat=True, command=mtime_preserving_solink_base % {"suffix": solink_suffix, "type": "-shared"}, rspfile="$link_file_list", rspfile_content="$in $solibs $libs", pool="link_pool", ) master_ninja.rule( "solink_notoc", description="SOLINK $lib, POSTBUILDS", restat=True, command=solink_base % {"suffix": solink_suffix, "type": "-shared"}, rspfile="$link_file_list", rspfile_content="$in $solibs $libs", pool="link_pool", ) master_ninja.rule( "solink_module", description="SOLINK(module) $lib, POSTBUILDS", restat=True, command=mtime_preserving_solink_base % {"suffix": solink_suffix, "type": "-bundle"}, rspfile="$link_file_list", rspfile_content="$in $solibs $libs", pool="link_pool", ) master_ninja.rule( "solink_module_notoc", description="SOLINK(module) $lib, POSTBUILDS", restat=True, command=solink_base % {"suffix": solink_suffix, "type": "-bundle"}, rspfile="$link_file_list", rspfile_content="$in $solibs $libs", pool="link_pool", ) master_ninja.rule( "link", description="LINK $out, POSTBUILDS", command=("$ld $ldflags -o $out " "$in $solibs $libs$postbuilds"), pool="link_pool", ) master_ninja.rule( "preprocess_infoplist", description="PREPROCESS INFOPLIST $out", command=( "$cc -E -P -Wno-trigraphs -x c $defines $in -o $out && " "plutil -convert xml1 $out $out" ), ) master_ninja.rule( "copy_infoplist", description="COPY INFOPLIST $in", command="$env ./gyp-mac-tool copy-info-plist $in $out $binary $keys", ) master_ninja.rule( "merge_infoplist", description="MERGE INFOPLISTS $in", command="$env ./gyp-mac-tool merge-info-plist $out $in", ) master_ninja.rule( "compile_xcassets", description="COMPILE XCASSETS $in", command="$env ./gyp-mac-tool compile-xcassets $keys $in", ) master_ninja.rule( "compile_ios_framework_headers", description="COMPILE HEADER MAPS AND COPY FRAMEWORK HEADERS $in", command="$env ./gyp-mac-tool compile-ios-framework-header-map $out " "$framework $in && $env ./gyp-mac-tool " "copy-ios-framework-headers $framework $copy_headers", ) master_ninja.rule( "mac_tool", description="MACTOOL $mactool_cmd $in", command="$env ./gyp-mac-tool $mactool_cmd $in $out $binary", ) master_ninja.rule( "package_framework", description="PACKAGE FRAMEWORK $out, POSTBUILDS", command="./gyp-mac-tool package-framework $out $version$postbuilds " "&& touch $out", ) master_ninja.rule( "package_ios_framework", description="PACKAGE IOS FRAMEWORK $out, POSTBUILDS", command="./gyp-mac-tool package-ios-framework $out $postbuilds " "&& touch $out", ) if flavor == "win": master_ninja.rule( "stamp", description="STAMP $out", command="%s gyp-win-tool stamp $out" % sys.executable, ) else: master_ninja.rule( "stamp", description="STAMP $out", command="${postbuilds}touch $out" ) if flavor == "win": master_ninja.rule( "copy", description="COPY $in $out", command="%s gyp-win-tool recursive-mirror $in $out" % sys.executable, ) elif flavor == "zos": master_ninja.rule( "copy", description="COPY $in $out", command="rm -rf $out && cp -fRP $in $out", ) else: master_ninja.rule( "copy", description="COPY $in $out", command="ln -f $in $out 2>/dev/null || (rm -rf $out && cp -af $in $out)", ) master_ninja.newline() all_targets = set() for build_file in params["build_files"]: for target in gyp.common.AllTargets( target_list, target_dicts, os.path.normpath(build_file) ): all_targets.add(target) all_outputs = set() # target_outputs is a map from qualified target name to a Target object. target_outputs = {} # target_short_names is a map from target short name to a list of Target # objects. target_short_names = {} # short name of targets that were skipped because they didn't contain anything # interesting. # NOTE: there may be overlap between this an non_empty_target_names. empty_target_names = set() # Set of non-empty short target names. # NOTE: there may be overlap between this an empty_target_names. non_empty_target_names = set() for qualified_target in target_list: # qualified_target is like: third_party/icu/icu.gyp:icui18n#target build_file, name, toolset = gyp.common.ParseQualifiedTarget(qualified_target) this_make_global_settings = data[build_file].get("make_global_settings", []) assert make_global_settings == this_make_global_settings, ( "make_global_settings needs to be the same for all targets. " f"{this_make_global_settings} vs. {make_global_settings}" ) spec = target_dicts[qualified_target] if flavor == "mac": gyp.xcode_emulation.MergeGlobalXcodeSettingsToSpec(data[build_file], spec) # If build_file is a symlink, we must not follow it because there's a chance # it could point to a path above toplevel_dir, and we cannot correctly deal # with that case at the moment. build_file = gyp.common.RelativePath(build_file, options.toplevel_dir, False) qualified_target_for_hash = gyp.common.QualifiedTarget( build_file, name, toolset ) qualified_target_for_hash = qualified_target_for_hash.encode("utf-8") hash_for_rules = hashlib.md5(qualified_target_for_hash).hexdigest() base_path = os.path.dirname(build_file) obj = "obj" if toolset != "target": obj += "." + toolset output_file = os.path.join(obj, base_path, name + ".ninja") ninja_output = StringIO() writer = NinjaWriter( hash_for_rules, target_outputs, base_path, build_dir, ninja_output, toplevel_build, output_file, flavor, toplevel_dir=options.toplevel_dir, ) target = writer.WriteSpec(spec, config_name, generator_flags) if ninja_output.tell() > 0: # Only create files for ninja files that actually have contents. with OpenOutput(os.path.join(toplevel_build, output_file)) as ninja_file: ninja_file.write(ninja_output.getvalue()) ninja_output.close() master_ninja.subninja(output_file) if target: if name != target.FinalOutput() and spec["toolset"] == "target": target_short_names.setdefault(name, []).append(target) target_outputs[qualified_target] = target if qualified_target in all_targets: all_outputs.add(target.FinalOutput()) non_empty_target_names.add(name) else: empty_target_names.add(name) if target_short_names: # Write a short name to build this target. This benefits both the # "build chrome" case as well as the gyp tests, which expect to be # able to run actions and build libraries by their short name. master_ninja.newline() master_ninja.comment("Short names for targets.") for short_name in sorted(target_short_names): master_ninja.build( short_name, "phony", [x.FinalOutput() for x in target_short_names[short_name]], ) # Write phony targets for any empty targets that weren't written yet. As # short names are not necessarily unique only do this for short names that # haven't already been output for another target. empty_target_names = empty_target_names - non_empty_target_names if empty_target_names: master_ninja.newline() master_ninja.comment("Empty targets (output for completeness).") for name in sorted(empty_target_names): master_ninja.build(name, "phony") if all_outputs: master_ninja.newline() master_ninja.build("all", "phony", sorted(all_outputs)) master_ninja.default(generator_flags.get("default_target", "all")) master_ninja_file.close() def PerformBuild(data, configurations, params): options = params["options"] for config in configurations: builddir = os.path.join(options.toplevel_dir, "out", config) arguments = ["ninja", "-C", builddir] print(f"Building [{config}]: {arguments}") subprocess.check_call(arguments) def CallGenerateOutputForConfig(arglist): # Ignore the interrupt signal so that the parent process catches it and # kills all multiprocessing children. signal.signal(signal.SIGINT, signal.SIG_IGN) (target_list, target_dicts, data, params, config_name) = arglist GenerateOutputForConfig(target_list, target_dicts, data, params, config_name) def GenerateOutput(target_list, target_dicts, data, params): # Update target_dicts for iOS device builds. target_dicts = gyp.xcode_emulation.CloneConfigurationForDeviceAndEmulator( target_dicts ) user_config = params.get("generator_flags", {}).get("config", None) if gyp.common.GetFlavor(params) == "win": target_list, target_dicts = MSVSUtil.ShardTargets(target_list, target_dicts) target_list, target_dicts = MSVSUtil.InsertLargePdbShims( target_list, target_dicts, generator_default_variables ) if user_config: GenerateOutputForConfig(target_list, target_dicts, data, params, user_config) else: config_names = target_dicts[target_list[0]]["configurations"] if params["parallel"]: try: pool = multiprocessing.Pool(len(config_names)) arglists = [] for config_name in config_names: arglists.append( (target_list, target_dicts, data, params, config_name) ) pool.map(CallGenerateOutputForConfig, arglists) except KeyboardInterrupt as e: pool.terminate() raise e else: for config_name in config_names: GenerateOutputForConfig( target_list, target_dicts, data, params, config_name ) #!/usr/bin/env python3 # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Unit tests for the ninja.py file. """ import sys import unittest import gyp.generator.ninja as ninja class TestPrefixesAndSuffixes(unittest.TestCase): def test_BinaryNamesWindows(self): # These cannot run on non-Windows as they require a VS installation to # correctly handle variable expansion. if sys.platform.startswith("win"): writer = ninja.NinjaWriter( "foo", "wee", ".", ".", "build.ninja", ".", "build.ninja", "win" ) spec = {"target_name": "wee"} self.assertTrue( writer.ComputeOutputFileName(spec, "executable").endswith(".exe") ) self.assertTrue( writer.ComputeOutputFileName(spec, "shared_library").endswith(".dll") ) self.assertTrue( writer.ComputeOutputFileName(spec, "static_library").endswith(".lib") ) def test_BinaryNamesLinux(self): writer = ninja.NinjaWriter( "foo", "wee", ".", ".", "build.ninja", ".", "build.ninja", "linux" ) spec = {"target_name": "wee"} self.assertTrue("." not in writer.ComputeOutputFileName(spec, "executable")) self.assertTrue( writer.ComputeOutputFileName(spec, "shared_library").startswith("lib") ) self.assertTrue( writer.ComputeOutputFileName(spec, "static_library").startswith("lib") ) self.assertTrue( writer.ComputeOutputFileName(spec, "shared_library").endswith(".so") ) self.assertTrue( writer.ComputeOutputFileName(spec, "static_library").endswith(".a") ) if __name__ == "__main__": unittest.main() # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import filecmp import gyp.common import gyp.xcodeproj_file import gyp.xcode_ninja import errno import os import sys import posixpath import re import shutil import subprocess import tempfile # Project files generated by this module will use _intermediate_var as a # custom Xcode setting whose value is a DerivedSources-like directory that's # project-specific and configuration-specific. The normal choice, # DERIVED_FILE_DIR, is target-specific, which is thought to be too restrictive # as it is likely that multiple targets within a single project file will want # to access the same set of generated files. The other option, # PROJECT_DERIVED_FILE_DIR, is unsuitable because while it is project-specific, # it is not configuration-specific. INTERMEDIATE_DIR is defined as # $(PROJECT_DERIVED_FILE_DIR)/$(CONFIGURATION). _intermediate_var = "INTERMEDIATE_DIR" # SHARED_INTERMEDIATE_DIR is the same, except that it is shared among all # targets that share the same BUILT_PRODUCTS_DIR. _shared_intermediate_var = "SHARED_INTERMEDIATE_DIR" _library_search_paths_var = "LIBRARY_SEARCH_PATHS" generator_default_variables = { "EXECUTABLE_PREFIX": "", "EXECUTABLE_SUFFIX": "", "STATIC_LIB_PREFIX": "lib", "SHARED_LIB_PREFIX": "lib", "STATIC_LIB_SUFFIX": ".a", "SHARED_LIB_SUFFIX": ".dylib", # INTERMEDIATE_DIR is a place for targets to build up intermediate products. # It is specific to each build environment. It is only guaranteed to exist # and be constant within the context of a project, corresponding to a single # input file. Some build environments may allow their intermediate directory # to be shared on a wider scale, but this is not guaranteed. "INTERMEDIATE_DIR": "$(%s)" % _intermediate_var, "OS": "mac", "PRODUCT_DIR": "$(BUILT_PRODUCTS_DIR)", "LIB_DIR": "$(BUILT_PRODUCTS_DIR)", "RULE_INPUT_ROOT": "$(INPUT_FILE_BASE)", "RULE_INPUT_EXT": "$(INPUT_FILE_SUFFIX)", "RULE_INPUT_NAME": "$(INPUT_FILE_NAME)", "RULE_INPUT_PATH": "$(INPUT_FILE_PATH)", "RULE_INPUT_DIRNAME": "$(INPUT_FILE_DIRNAME)", "SHARED_INTERMEDIATE_DIR": "$(%s)" % _shared_intermediate_var, "CONFIGURATION_NAME": "$(CONFIGURATION)", } # The Xcode-specific sections that hold paths. generator_additional_path_sections = [ "mac_bundle_resources", "mac_framework_headers", "mac_framework_private_headers", # 'mac_framework_dirs', input already handles _dirs endings. ] # The Xcode-specific keys that exist on targets and aren't moved down to # configurations. generator_additional_non_configuration_keys = [ "ios_app_extension", "ios_watch_app", "ios_watchkit_extension", "mac_bundle", "mac_bundle_resources", "mac_framework_headers", "mac_framework_private_headers", "mac_xctest_bundle", "mac_xcuitest_bundle", "xcode_create_dependents_test_runner", ] # We want to let any rules apply to files that are resources also. generator_extra_sources_for_rules = [ "mac_bundle_resources", "mac_framework_headers", "mac_framework_private_headers", ] generator_filelist_paths = None # Xcode's standard set of library directories, which don't need to be duplicated # in LIBRARY_SEARCH_PATHS. This list is not exhaustive, but that's okay. xcode_standard_library_dirs = frozenset( ["$(SDKROOT)/usr/lib", "$(SDKROOT)/usr/local/lib"] ) def CreateXCConfigurationList(configuration_names): xccl = gyp.xcodeproj_file.XCConfigurationList({"buildConfigurations": []}) if len(configuration_names) == 0: configuration_names = ["Default"] for configuration_name in configuration_names: xcbc = gyp.xcodeproj_file.XCBuildConfiguration({"name": configuration_name}) xccl.AppendProperty("buildConfigurations", xcbc) xccl.SetProperty("defaultConfigurationName", configuration_names[0]) return xccl class XcodeProject: def __init__(self, gyp_path, path, build_file_dict): self.gyp_path = gyp_path self.path = path self.project = gyp.xcodeproj_file.PBXProject(path=path) projectDirPath = gyp.common.RelativePath( os.path.dirname(os.path.abspath(self.gyp_path)), os.path.dirname(path) or ".", ) self.project.SetProperty("projectDirPath", projectDirPath) self.project_file = gyp.xcodeproj_file.XCProjectFile( {"rootObject": self.project} ) self.build_file_dict = build_file_dict # TODO(mark): add destructor that cleans up self.path if created_dir is # True and things didn't complete successfully. Or do something even # better with "try"? self.created_dir = False try: os.makedirs(self.path) self.created_dir = True except OSError as e: if e.errno != errno.EEXIST: raise def Finalize1(self, xcode_targets, serialize_all_tests): # Collect a list of all of the build configuration names used by the # various targets in the file. It is very heavily advised to keep each # target in an entire project (even across multiple project files) using # the same set of configuration names. configurations = [] for xct in self.project.GetProperty("targets"): xccl = xct.GetProperty("buildConfigurationList") xcbcs = xccl.GetProperty("buildConfigurations") for xcbc in xcbcs: name = xcbc.GetProperty("name") if name not in configurations: configurations.append(name) # Replace the XCConfigurationList attached to the PBXProject object with # a new one specifying all of the configuration names used by the various # targets. try: xccl = CreateXCConfigurationList(configurations) self.project.SetProperty("buildConfigurationList", xccl) except Exception: sys.stderr.write("Problem with gyp file %s\n" % self.gyp_path) raise # The need for this setting is explained above where _intermediate_var is # defined. The comments below about wanting to avoid project-wide build # settings apply here too, but this needs to be set on a project-wide basis # so that files relative to the _intermediate_var setting can be displayed # properly in the Xcode UI. # # Note that for configuration-relative files such as anything relative to # _intermediate_var, for the purposes of UI tree view display, Xcode will # only resolve the configuration name once, when the project file is # opened. If the active build configuration is changed, the project file # must be closed and reopened if it is desired for the tree view to update. # This is filed as Apple radar 6588391. xccl.SetBuildSetting( _intermediate_var, "$(PROJECT_DERIVED_FILE_DIR)/$(CONFIGURATION)" ) xccl.SetBuildSetting( _shared_intermediate_var, "$(SYMROOT)/DerivedSources/$(CONFIGURATION)" ) # Set user-specified project-wide build settings and config files. This # is intended to be used very sparingly. Really, almost everything should # go into target-specific build settings sections. The project-wide # settings are only intended to be used in cases where Xcode attempts to # resolve variable references in a project context as opposed to a target # context, such as when resolving sourceTree references while building up # the tree tree view for UI display. # Any values set globally are applied to all configurations, then any # per-configuration values are applied. for xck, xcv in self.build_file_dict.get("xcode_settings", {}).items(): xccl.SetBuildSetting(xck, xcv) if "xcode_config_file" in self.build_file_dict: config_ref = self.project.AddOrGetFileInRootGroup( self.build_file_dict["xcode_config_file"] ) xccl.SetBaseConfiguration(config_ref) build_file_configurations = self.build_file_dict.get("configurations", {}) if build_file_configurations: for config_name in configurations: build_file_configuration_named = build_file_configurations.get( config_name, {} ) if build_file_configuration_named: xcc = xccl.ConfigurationNamed(config_name) for xck, xcv in build_file_configuration_named.get( "xcode_settings", {} ).items(): xcc.SetBuildSetting(xck, xcv) if "xcode_config_file" in build_file_configuration_named: config_ref = self.project.AddOrGetFileInRootGroup( build_file_configurations[config_name]["xcode_config_file"] ) xcc.SetBaseConfiguration(config_ref) # Sort the targets based on how they appeared in the input. # TODO(mark): Like a lot of other things here, this assumes internal # knowledge of PBXProject - in this case, of its "targets" property. # ordinary_targets are ordinary targets that are already in the project # file. run_test_targets are the targets that run unittests and should be # used for the Run All Tests target. support_targets are the action/rule # targets used by GYP file targets, just kept for the assert check. ordinary_targets = [] run_test_targets = [] support_targets = [] # targets is full list of targets in the project. targets = [] # does the it define it's own "all"? has_custom_all = False # targets_for_all is the list of ordinary_targets that should be listed # in this project's "All" target. It includes each non_runtest_target # that does not have suppress_wildcard set. targets_for_all = [] for target in self.build_file_dict["targets"]: target_name = target["target_name"] toolset = target["toolset"] qualified_target = gyp.common.QualifiedTarget( self.gyp_path, target_name, toolset ) xcode_target = xcode_targets[qualified_target] # Make sure that the target being added to the sorted list is already in # the unsorted list. assert xcode_target in self.project._properties["targets"] targets.append(xcode_target) ordinary_targets.append(xcode_target) if xcode_target.support_target: support_targets.append(xcode_target.support_target) targets.append(xcode_target.support_target) if not int(target.get("suppress_wildcard", False)): targets_for_all.append(xcode_target) if target_name.lower() == "all": has_custom_all = True # If this target has a 'run_as' attribute, add its target to the # targets, and add it to the test targets. if target.get("run_as"): # Make a target to run something. It should have one # dependency, the parent xcode target. xccl = CreateXCConfigurationList(configurations) run_target = gyp.xcodeproj_file.PBXAggregateTarget( { "name": "Run " + target_name, "productName": xcode_target.GetProperty("productName"), "buildConfigurationList": xccl, }, parent=self.project, ) run_target.AddDependency(xcode_target) command = target["run_as"] script = "" if command.get("working_directory"): script = ( script + 'cd "%s"\n' % gyp.xcodeproj_file.ConvertVariablesToShellSyntax( command.get("working_directory") ) ) if command.get("environment"): script = ( script + "\n".join( [ 'export %s="%s"' % ( key, gyp.xcodeproj_file.ConvertVariablesToShellSyntax( val ), ) for (key, val) in command.get("environment").items() ] ) + "\n" ) # Some test end up using sockets, files on disk, etc. and can get # confused if more then one test runs at a time. The generator # flag 'xcode_serialize_all_test_runs' controls the forcing of all # tests serially. It defaults to True. To get serial runs this # little bit of python does the same as the linux flock utility to # make sure only one runs at a time. command_prefix = "" if serialize_all_tests: command_prefix = """python -c "import fcntl, subprocess, sys file = open('$TMPDIR/GYP_serialize_test_runs', 'a') fcntl.flock(file.fileno(), fcntl.LOCK_EX) sys.exit(subprocess.call(sys.argv[1:]))" """ # If we were unable to exec for some reason, we want to exit # with an error, and fixup variable references to be shell # syntax instead of xcode syntax. script = ( script + "exec " + command_prefix + "%s\nexit 1\n" % gyp.xcodeproj_file.ConvertVariablesToShellSyntax( gyp.common.EncodePOSIXShellList(command.get("action")) ) ) ssbp = gyp.xcodeproj_file.PBXShellScriptBuildPhase( {"shellScript": script, "showEnvVarsInLog": 0} ) run_target.AppendProperty("buildPhases", ssbp) # Add the run target to the project file. targets.append(run_target) run_test_targets.append(run_target) xcode_target.test_runner = run_target # Make sure that the list of targets being replaced is the same length as # the one replacing it, but allow for the added test runner targets. assert len(self.project._properties["targets"]) == len(ordinary_targets) + len( support_targets ) self.project._properties["targets"] = targets # Get rid of unnecessary levels of depth in groups like the Source group. self.project.RootGroupsTakeOverOnlyChildren(True) # Sort the groups nicely. Do this after sorting the targets, because the # Products group is sorted based on the order of the targets. self.project.SortGroups() # Create an "All" target if there's more than one target in this project # file and the project didn't define its own "All" target. Put a generated # "All" target first so that people opening up the project for the first # time will build everything by default. if len(targets_for_all) > 1 and not has_custom_all: xccl = CreateXCConfigurationList(configurations) all_target = gyp.xcodeproj_file.PBXAggregateTarget( {"buildConfigurationList": xccl, "name": "All"}, parent=self.project ) for target in targets_for_all: all_target.AddDependency(target) # TODO(mark): This is evil because it relies on internal knowledge of # PBXProject._properties. It's important to get the "All" target first, # though. self.project._properties["targets"].insert(0, all_target) # The same, but for run_test_targets. if len(run_test_targets) > 1: xccl = CreateXCConfigurationList(configurations) run_all_tests_target = gyp.xcodeproj_file.PBXAggregateTarget( {"buildConfigurationList": xccl, "name": "Run All Tests"}, parent=self.project, ) for run_test_target in run_test_targets: run_all_tests_target.AddDependency(run_test_target) # Insert after the "All" target, which must exist if there is more than # one run_test_target. self.project._properties["targets"].insert(1, run_all_tests_target) def Finalize2(self, xcode_targets, xcode_target_to_target_dict): # Finalize2 needs to happen in a separate step because the process of # updating references to other projects depends on the ordering of targets # within remote project files. Finalize1 is responsible for sorting duty, # and once all project files are sorted, Finalize2 can come in and update # these references. # To support making a "test runner" target that will run all the tests # that are direct dependents of any given target, we look for # xcode_create_dependents_test_runner being set on an Aggregate target, # and generate a second target that will run the tests runners found under # the marked target. for bf_tgt in self.build_file_dict["targets"]: if int(bf_tgt.get("xcode_create_dependents_test_runner", 0)): tgt_name = bf_tgt["target_name"] toolset = bf_tgt["toolset"] qualified_target = gyp.common.QualifiedTarget( self.gyp_path, tgt_name, toolset ) xcode_target = xcode_targets[qualified_target] if isinstance(xcode_target, gyp.xcodeproj_file.PBXAggregateTarget): # Collect all the run test targets. all_run_tests = [] pbxtds = xcode_target.GetProperty("dependencies") for pbxtd in pbxtds: pbxcip = pbxtd.GetProperty("targetProxy") dependency_xct = pbxcip.GetProperty("remoteGlobalIDString") if hasattr(dependency_xct, "test_runner"): all_run_tests.append(dependency_xct.test_runner) # Directly depend on all the runners as they depend on the target # that builds them. if len(all_run_tests) > 0: run_all_target = gyp.xcodeproj_file.PBXAggregateTarget( { "name": "Run %s Tests" % tgt_name, "productName": tgt_name, }, parent=self.project, ) for run_test_target in all_run_tests: run_all_target.AddDependency(run_test_target) # Insert the test runner after the related target. idx = self.project._properties["targets"].index(xcode_target) self.project._properties["targets"].insert( idx + 1, run_all_target ) # Update all references to other projects, to make sure that the lists of # remote products are complete. Otherwise, Xcode will fill them in when # it opens the project file, which will result in unnecessary diffs. # TODO(mark): This is evil because it relies on internal knowledge of # PBXProject._other_pbxprojects. for other_pbxproject in self.project._other_pbxprojects.keys(): self.project.AddOrGetProjectReference(other_pbxproject) self.project.SortRemoteProductReferences() # Give everything an ID. self.project_file.ComputeIDs() # Make sure that no two objects in the project file have the same ID. If # multiple objects wind up with the same ID, upon loading the file, Xcode # will only recognize one object (the last one in the file?) and the # results are unpredictable. self.project_file.EnsureNoIDCollisions() def Write(self): # Write the project file to a temporary location first. Xcode watches for # changes to the project file and presents a UI sheet offering to reload # the project when it does change. However, in some cases, especially when # multiple projects are open or when Xcode is busy, things don't work so # seamlessly. Sometimes, Xcode is able to detect that a project file has # changed but can't unload it because something else is referencing it. # To mitigate this problem, and to avoid even having Xcode present the UI # sheet when an open project is rewritten for inconsequential changes, the # project file is written to a temporary file in the xcodeproj directory # first. The new temporary file is then compared to the existing project # file, if any. If they differ, the new file replaces the old; otherwise, # the new project file is simply deleted. Xcode properly detects a file # being renamed over an open project file as a change and so it remains # able to present the "project file changed" sheet under this system. # Writing to a temporary file first also avoids the possible problem of # Xcode rereading an incomplete project file. (output_fd, new_pbxproj_path) = tempfile.mkstemp( suffix=".tmp", prefix="project.pbxproj.gyp.", dir=self.path ) try: output_file = os.fdopen(output_fd, "w") self.project_file.Print(output_file) output_file.close() pbxproj_path = os.path.join(self.path, "project.pbxproj") same = False try: same = filecmp.cmp(pbxproj_path, new_pbxproj_path, False) except OSError as e: if e.errno != errno.ENOENT: raise if same: # The new file is identical to the old one, just get rid of the new # one. os.unlink(new_pbxproj_path) else: # The new file is different from the old one, or there is no old one. # Rename the new file to the permanent name. # # tempfile.mkstemp uses an overly restrictive mode, resulting in a # file that can only be read by the owner, regardless of the umask. # There's no reason to not respect the umask here, which means that # an extra hoop is required to fetch it and reset the new file's mode. # # No way to get the umask without setting a new one? Set a safe one # and then set it back to the old value. umask = os.umask(0o77) os.umask(umask) os.chmod(new_pbxproj_path, 0o666 & ~umask) os.rename(new_pbxproj_path, pbxproj_path) except Exception: # Don't leave turds behind. In fact, if this code was responsible for # creating the xcodeproj directory, get rid of that too. os.unlink(new_pbxproj_path) if self.created_dir: shutil.rmtree(self.path, True) raise def AddSourceToTarget(source, type, pbxp, xct): # TODO(mark): Perhaps source_extensions and library_extensions can be made a # little bit fancier. source_extensions = ["c", "cc", "cpp", "cxx", "m", "mm", "s", "swift"] # .o is conceptually more of a "source" than a "library," but Xcode thinks # of "sources" as things to compile and "libraries" (or "frameworks") as # things to link with. Adding an object file to an Xcode target's frameworks # phase works properly. library_extensions = ["a", "dylib", "framework", "o"] basename = posixpath.basename(source) (root, ext) = posixpath.splitext(basename) if ext: ext = ext[1:].lower() if ext in source_extensions and type != "none": xct.SourcesPhase().AddFile(source) elif ext in library_extensions and type != "none": xct.FrameworksPhase().AddFile(source) else: # Files that aren't added to a sources or frameworks build phase can still # go into the project file, just not as part of a build phase. pbxp.AddOrGetFileInRootGroup(source) def AddResourceToTarget(resource, pbxp, xct): # TODO(mark): Combine with AddSourceToTarget above? Or just inline this call # where it's used. xct.ResourcesPhase().AddFile(resource) def AddHeaderToTarget(header, pbxp, xct, is_public): # TODO(mark): Combine with AddSourceToTarget above? Or just inline this call # where it's used. settings = "{ATTRIBUTES = (%s, ); }" % ("Private", "Public")[is_public] xct.HeadersPhase().AddFile(header, settings) _xcode_variable_re = re.compile(r"(\$\((.*?)\))") def ExpandXcodeVariables(string, expansions): """Expands Xcode-style $(VARIABLES) in string per the expansions dict. In some rare cases, it is appropriate to expand Xcode variables when a project file is generated. For any substring $(VAR) in string, if VAR is a key in the expansions dict, $(VAR) will be replaced with expansions[VAR]. Any $(VAR) substring in string for which VAR is not a key in the expansions dict will remain in the returned string. """ matches = _xcode_variable_re.findall(string) if matches is None: return string matches.reverse() for match in matches: (to_replace, variable) = match if variable not in expansions: continue replacement = expansions[variable] string = re.sub(re.escape(to_replace), replacement, string) return string _xcode_define_re = re.compile(r"([\\\"\' ])") def EscapeXcodeDefine(s): """We must escape the defines that we give to XCode so that it knows not to split on spaces and to respect backslash and quote literals. However, we must not quote the define, or Xcode will incorrectly interpret variables especially $(inherited).""" return re.sub(_xcode_define_re, r"\\\1", s) def PerformBuild(data, configurations, params): options = params["options"] for build_file, build_file_dict in data.items(): (build_file_root, build_file_ext) = os.path.splitext(build_file) if build_file_ext != ".gyp": continue xcodeproj_path = build_file_root + options.suffix + ".xcodeproj" if options.generator_output: xcodeproj_path = os.path.join(options.generator_output, xcodeproj_path) for config in configurations: arguments = ["xcodebuild", "-project", xcodeproj_path] arguments += ["-configuration", config] print(f"Building [{config}]: {arguments}") subprocess.check_call(arguments) def CalculateGeneratorInputInfo(params): toplevel = params["options"].toplevel_dir if params.get("flavor") == "ninja": generator_dir = os.path.relpath(params["options"].generator_output or ".") output_dir = params.get("generator_flags", {}).get("output_dir", "out") output_dir = os.path.normpath(os.path.join(generator_dir, output_dir)) qualified_out_dir = os.path.normpath( os.path.join(toplevel, output_dir, "gypfiles-xcode-ninja") ) else: output_dir = os.path.normpath(os.path.join(toplevel, "xcodebuild")) qualified_out_dir = os.path.normpath( os.path.join(toplevel, output_dir, "gypfiles") ) global generator_filelist_paths generator_filelist_paths = { "toplevel": toplevel, "qualified_out_dir": qualified_out_dir, } def GenerateOutput(target_list, target_dicts, data, params): # Optionally configure each spec to use ninja as the external builder. ninja_wrapper = params.get("flavor") == "ninja" if ninja_wrapper: (target_list, target_dicts, data) = gyp.xcode_ninja.CreateWrapper( target_list, target_dicts, data, params ) options = params["options"] generator_flags = params.get("generator_flags", {}) parallel_builds = generator_flags.get("xcode_parallel_builds", True) serialize_all_tests = generator_flags.get("xcode_serialize_all_test_runs", True) upgrade_check_project_version = generator_flags.get( "xcode_upgrade_check_project_version", None ) # Format upgrade_check_project_version with leading zeros as needed. if upgrade_check_project_version: upgrade_check_project_version = str(upgrade_check_project_version) while len(upgrade_check_project_version) < 4: upgrade_check_project_version = "0" + upgrade_check_project_version skip_excluded_files = not generator_flags.get("xcode_list_excluded_files", True) xcode_projects = {} for build_file, build_file_dict in data.items(): (build_file_root, build_file_ext) = os.path.splitext(build_file) if build_file_ext != ".gyp": continue xcodeproj_path = build_file_root + options.suffix + ".xcodeproj" if options.generator_output: xcodeproj_path = os.path.join(options.generator_output, xcodeproj_path) xcp = XcodeProject(build_file, xcodeproj_path, build_file_dict) xcode_projects[build_file] = xcp pbxp = xcp.project # Set project-level attributes from multiple options project_attributes = {} if parallel_builds: project_attributes["BuildIndependentTargetsInParallel"] = "YES" if upgrade_check_project_version: project_attributes["LastUpgradeCheck"] = upgrade_check_project_version project_attributes[ "LastTestingUpgradeCheck" ] = upgrade_check_project_version project_attributes["LastSwiftUpdateCheck"] = upgrade_check_project_version pbxp.SetProperty("attributes", project_attributes) # Add gyp/gypi files to project if not generator_flags.get("standalone"): main_group = pbxp.GetProperty("mainGroup") build_group = gyp.xcodeproj_file.PBXGroup({"name": "Build"}) main_group.AppendChild(build_group) for included_file in build_file_dict["included_files"]: build_group.AddOrGetFileByPath(included_file, False) xcode_targets = {} xcode_target_to_target_dict = {} for qualified_target in target_list: [build_file, target_name, toolset] = gyp.common.ParseQualifiedTarget( qualified_target ) spec = target_dicts[qualified_target] if spec["toolset"] != "target": raise Exception( "Multiple toolsets not supported in xcode build (target %s)" % qualified_target ) configuration_names = [spec["default_configuration"]] for configuration_name in sorted(spec["configurations"].keys()): if configuration_name not in configuration_names: configuration_names.append(configuration_name) xcp = xcode_projects[build_file] pbxp = xcp.project # Set up the configurations for the target according to the list of names # supplied. xccl = CreateXCConfigurationList(configuration_names) # Create an XCTarget subclass object for the target. The type with # "+bundle" appended will be used if the target has "mac_bundle" set. # loadable_modules not in a mac_bundle are mapped to # com.googlecode.gyp.xcode.bundle, a pseudo-type that xcode.py interprets # to create a single-file mh_bundle. _types = { "executable": "com.apple.product-type.tool", "loadable_module": "com.googlecode.gyp.xcode.bundle", "shared_library": "com.apple.product-type.library.dynamic", "static_library": "com.apple.product-type.library.static", "mac_kernel_extension": "com.apple.product-type.kernel-extension", "executable+bundle": "com.apple.product-type.application", "loadable_module+bundle": "com.apple.product-type.bundle", "loadable_module+xctest": "com.apple.product-type.bundle.unit-test", "loadable_module+xcuitest": "com.apple.product-type.bundle.ui-testing", "shared_library+bundle": "com.apple.product-type.framework", "executable+extension+bundle": "com.apple.product-type.app-extension", "executable+watch+extension+bundle": "com.apple.product-type.watchkit-extension", "executable+watch+bundle": "com.apple.product-type.application.watchapp", "mac_kernel_extension+bundle": "com.apple.product-type.kernel-extension", } target_properties = { "buildConfigurationList": xccl, "name": target_name, } type = spec["type"] is_xctest = int(spec.get("mac_xctest_bundle", 0)) is_xcuitest = int(spec.get("mac_xcuitest_bundle", 0)) is_bundle = int(spec.get("mac_bundle", 0)) or is_xctest is_app_extension = int(spec.get("ios_app_extension", 0)) is_watchkit_extension = int(spec.get("ios_watchkit_extension", 0)) is_watch_app = int(spec.get("ios_watch_app", 0)) if type != "none": type_bundle_key = type if is_xcuitest: type_bundle_key += "+xcuitest" assert type == "loadable_module", ( "mac_xcuitest_bundle targets must have type loadable_module " "(target %s)" % target_name ) elif is_xctest: type_bundle_key += "+xctest" assert type == "loadable_module", ( "mac_xctest_bundle targets must have type loadable_module " "(target %s)" % target_name ) elif is_app_extension: assert is_bundle, ( "ios_app_extension flag requires mac_bundle " "(target %s)" % target_name ) type_bundle_key += "+extension+bundle" elif is_watchkit_extension: assert is_bundle, ( "ios_watchkit_extension flag requires mac_bundle " "(target %s)" % target_name ) type_bundle_key += "+watch+extension+bundle" elif is_watch_app: assert is_bundle, ( "ios_watch_app flag requires mac_bundle " "(target %s)" % target_name ) type_bundle_key += "+watch+bundle" elif is_bundle: type_bundle_key += "+bundle" xctarget_type = gyp.xcodeproj_file.PBXNativeTarget try: target_properties["productType"] = _types[type_bundle_key] except KeyError as e: gyp.common.ExceptionAppend( e, "-- unknown product type while " "writing target %s" % target_name, ) raise else: xctarget_type = gyp.xcodeproj_file.PBXAggregateTarget assert not is_bundle, ( 'mac_bundle targets cannot have type none (target "%s")' % target_name ) assert not is_xcuitest, ( 'mac_xcuitest_bundle targets cannot have type none (target "%s")' % target_name ) assert not is_xctest, ( 'mac_xctest_bundle targets cannot have type none (target "%s")' % target_name ) target_product_name = spec.get("product_name") if target_product_name is not None: target_properties["productName"] = target_product_name xct = xctarget_type( target_properties, parent=pbxp, force_outdir=spec.get("product_dir"), force_prefix=spec.get("product_prefix"), force_extension=spec.get("product_extension"), ) pbxp.AppendProperty("targets", xct) xcode_targets[qualified_target] = xct xcode_target_to_target_dict[xct] = spec spec_actions = spec.get("actions", []) spec_rules = spec.get("rules", []) # Xcode has some "issues" with checking dependencies for the "Compile # sources" step with any source files/headers generated by actions/rules. # To work around this, if a target is building anything directly (not # type "none"), then a second target is used to run the GYP actions/rules # and is made a dependency of this target. This way the work is done # before the dependency checks for what should be recompiled. support_xct = None # The Xcode "issues" don't affect xcode-ninja builds, since the dependency # logic all happens in ninja. Don't bother creating the extra targets in # that case. if type != "none" and (spec_actions or spec_rules) and not ninja_wrapper: support_xccl = CreateXCConfigurationList(configuration_names) support_target_suffix = generator_flags.get( "support_target_suffix", " Support" ) support_target_properties = { "buildConfigurationList": support_xccl, "name": target_name + support_target_suffix, } if target_product_name: support_target_properties["productName"] = ( target_product_name + " Support" ) support_xct = gyp.xcodeproj_file.PBXAggregateTarget( support_target_properties, parent=pbxp ) pbxp.AppendProperty("targets", support_xct) xct.AddDependency(support_xct) # Hang the support target off the main target so it can be tested/found # by the generator during Finalize. xct.support_target = support_xct prebuild_index = 0 # Add custom shell script phases for "actions" sections. for action in spec_actions: # There's no need to write anything into the script to ensure that the # output directories already exist, because Xcode will look at the # declared outputs and automatically ensure that they exist for us. # Do we have a message to print when this action runs? message = action.get("message") if message: message = "echo note: " + gyp.common.EncodePOSIXShellArgument(message) else: message = "" # Turn the list into a string that can be passed to a shell. action_string = gyp.common.EncodePOSIXShellList(action["action"]) # Convert Xcode-type variable references to sh-compatible environment # variable references. message_sh = gyp.xcodeproj_file.ConvertVariablesToShellSyntax(message) action_string_sh = gyp.xcodeproj_file.ConvertVariablesToShellSyntax( action_string ) script = "" # Include the optional message if message_sh: script += message_sh + "\n" # Be sure the script runs in exec, and that if exec fails, the script # exits signalling an error. script += "exec " + action_string_sh + "\nexit 1\n" ssbp = gyp.xcodeproj_file.PBXShellScriptBuildPhase( { "inputPaths": action["inputs"], "name": 'Action "' + action["action_name"] + '"', "outputPaths": action["outputs"], "shellScript": script, "showEnvVarsInLog": 0, } ) if support_xct: support_xct.AppendProperty("buildPhases", ssbp) else: # TODO(mark): this assumes too much knowledge of the internals of # xcodeproj_file; some of these smarts should move into xcodeproj_file # itself. xct._properties["buildPhases"].insert(prebuild_index, ssbp) prebuild_index = prebuild_index + 1 # TODO(mark): Should verify that at most one of these is specified. if int(action.get("process_outputs_as_sources", False)): for output in action["outputs"]: AddSourceToTarget(output, type, pbxp, xct) if int(action.get("process_outputs_as_mac_bundle_resources", False)): for output in action["outputs"]: AddResourceToTarget(output, pbxp, xct) # tgt_mac_bundle_resources holds the list of bundle resources so # the rule processing can check against it. if is_bundle: tgt_mac_bundle_resources = spec.get("mac_bundle_resources", []) else: tgt_mac_bundle_resources = [] # Add custom shell script phases driving "make" for "rules" sections. # # Xcode's built-in rule support is almost powerful enough to use directly, # but there are a few significant deficiencies that render them unusable. # There are workarounds for some of its inadequacies, but in aggregate, # the workarounds added complexity to the generator, and some workarounds # actually require input files to be crafted more carefully than I'd like. # Consequently, until Xcode rules are made more capable, "rules" input # sections will be handled in Xcode output by shell script build phases # performed prior to the compilation phase. # # The following problems with Xcode rules were found. The numbers are # Apple radar IDs. I hope that these shortcomings are addressed, I really # liked having the rules handled directly in Xcode during the period that # I was prototyping this. # # 6588600 Xcode compiles custom script rule outputs too soon, compilation # fails. This occurs when rule outputs from distinct inputs are # interdependent. The only workaround is to put rules and their # inputs in a separate target from the one that compiles the rule # outputs. This requires input file cooperation and it means that # process_outputs_as_sources is unusable. # 6584932 Need to declare that custom rule outputs should be excluded from # compilation. A possible workaround is to lie to Xcode about a # rule's output, giving it a dummy file it doesn't know how to # compile. The rule action script would need to touch the dummy. # 6584839 I need a way to declare additional inputs to a custom rule. # A possible workaround is a shell script phase prior to # compilation that touches a rule's primary input files if any # would-be additional inputs are newer than the output. Modifying # the source tree - even just modification times - feels dirty. # 6564240 Xcode "custom script" build rules always dump all environment # variables. This is a low-prioroty problem and is not a # show-stopper. rules_by_ext = {} for rule in spec_rules: rules_by_ext[rule["extension"]] = rule # First, some definitions: # # A "rule source" is a file that was listed in a target's "sources" # list and will have a rule applied to it on the basis of matching the # rule's "extensions" attribute. Rule sources are direct inputs to # rules. # # Rule definitions may specify additional inputs in their "inputs" # attribute. These additional inputs are used for dependency tracking # purposes. # # A "concrete output" is a rule output with input-dependent variables # resolved. For example, given a rule with: # 'extension': 'ext', 'outputs': ['$(INPUT_FILE_BASE).cc'], # if the target's "sources" list contained "one.ext" and "two.ext", # the "concrete output" for rule input "two.ext" would be "two.cc". If # a rule specifies multiple outputs, each input file that the rule is # applied to will have the same number of concrete outputs. # # If any concrete outputs are outdated or missing relative to their # corresponding rule_source or to any specified additional input, the # rule action must be performed to generate the concrete outputs. # concrete_outputs_by_rule_source will have an item at the same index # as the rule['rule_sources'] that it corresponds to. Each item is a # list of all of the concrete outputs for the rule_source. concrete_outputs_by_rule_source = [] # concrete_outputs_all is a flat list of all concrete outputs that this # rule is able to produce, given the known set of input files # (rule_sources) that apply to it. concrete_outputs_all = [] # messages & actions are keyed by the same indices as rule['rule_sources'] # and concrete_outputs_by_rule_source. They contain the message and # action to perform after resolving input-dependent variables. The # message is optional, in which case None is stored for each rule source. messages = [] actions = [] for rule_source in rule.get("rule_sources", []): rule_source_dirname, rule_source_basename = posixpath.split(rule_source) (rule_source_root, rule_source_ext) = posixpath.splitext( rule_source_basename ) # These are the same variable names that Xcode uses for its own native # rule support. Because Xcode's rule engine is not being used, they # need to be expanded as they are written to the makefile. rule_input_dict = { "INPUT_FILE_BASE": rule_source_root, "INPUT_FILE_SUFFIX": rule_source_ext, "INPUT_FILE_NAME": rule_source_basename, "INPUT_FILE_PATH": rule_source, "INPUT_FILE_DIRNAME": rule_source_dirname, } concrete_outputs_for_this_rule_source = [] for output in rule.get("outputs", []): # Fortunately, Xcode and make both use $(VAR) format for their # variables, so the expansion is the only transformation necessary. # Any remaining $(VAR)-type variables in the string can be given # directly to make, which will pick up the correct settings from # what Xcode puts into the environment. concrete_output = ExpandXcodeVariables(output, rule_input_dict) concrete_outputs_for_this_rule_source.append(concrete_output) # Add all concrete outputs to the project. pbxp.AddOrGetFileInRootGroup(concrete_output) concrete_outputs_by_rule_source.append( concrete_outputs_for_this_rule_source ) concrete_outputs_all.extend(concrete_outputs_for_this_rule_source) # TODO(mark): Should verify that at most one of these is specified. if int(rule.get("process_outputs_as_sources", False)): for output in concrete_outputs_for_this_rule_source: AddSourceToTarget(output, type, pbxp, xct) # If the file came from the mac_bundle_resources list or if the rule # is marked to process outputs as bundle resource, do so. was_mac_bundle_resource = rule_source in tgt_mac_bundle_resources if was_mac_bundle_resource or int( rule.get("process_outputs_as_mac_bundle_resources", False) ): for output in concrete_outputs_for_this_rule_source: AddResourceToTarget(output, pbxp, xct) # Do we have a message to print when this rule runs? message = rule.get("message") if message: message = gyp.common.EncodePOSIXShellArgument(message) message = ExpandXcodeVariables(message, rule_input_dict) messages.append(message) # Turn the list into a string that can be passed to a shell. action_string = gyp.common.EncodePOSIXShellList(rule["action"]) action = ExpandXcodeVariables(action_string, rule_input_dict) actions.append(action) if len(concrete_outputs_all) > 0: # TODO(mark): There's a possibility for collision here. Consider # target "t" rule "A_r" and target "t_A" rule "r". makefile_name = "%s.make" % re.sub( "[^a-zA-Z0-9_]", "_", "{}_{}".format(target_name, rule["rule_name"]) ) makefile_path = os.path.join( xcode_projects[build_file].path, makefile_name ) # TODO(mark): try/close? Write to a temporary file and swap it only # if it's got changes? makefile = open(makefile_path, "w") # make will build the first target in the makefile by default. By # convention, it's called "all". List all (or at least one) # concrete output for each rule source as a prerequisite of the "all" # target. makefile.write("all: \\\n") for concrete_output_index, concrete_output_by_rule_source in enumerate( concrete_outputs_by_rule_source ): # Only list the first (index [0]) concrete output of each input # in the "all" target. Otherwise, a parallel make (-j > 1) would # attempt to process each input multiple times simultaneously. # Otherwise, "all" could just contain the entire list of # concrete_outputs_all. concrete_output = concrete_output_by_rule_source[0] if ( concrete_output_index == len(concrete_outputs_by_rule_source) - 1 ): eol = "" else: eol = " \\" makefile.write(f" {concrete_output}{eol}\n") for (rule_source, concrete_outputs, message, action) in zip( rule["rule_sources"], concrete_outputs_by_rule_source, messages, actions, ): makefile.write("\n") # Add a rule that declares it can build each concrete output of a # rule source. Collect the names of the directories that are # required. concrete_output_dirs = [] for concrete_output_index, concrete_output in enumerate( concrete_outputs ): if concrete_output_index == 0: bol = "" else: bol = " " makefile.write(f"{bol}{concrete_output} \\\n") concrete_output_dir = posixpath.dirname(concrete_output) if ( concrete_output_dir and concrete_output_dir not in concrete_output_dirs ): concrete_output_dirs.append(concrete_output_dir) makefile.write(" : \\\n") # The prerequisites for this rule are the rule source itself and # the set of additional rule inputs, if any. prerequisites = [rule_source] prerequisites.extend(rule.get("inputs", [])) for prerequisite_index, prerequisite in enumerate(prerequisites): if prerequisite_index == len(prerequisites) - 1: eol = "" else: eol = " \\" makefile.write(f" {prerequisite}{eol}\n") # Make sure that output directories exist before executing the rule # action. if len(concrete_output_dirs) > 0: makefile.write( '\t@mkdir -p "%s"\n' % '" "'.join(concrete_output_dirs) ) # The rule message and action have already had # the necessary variable substitutions performed. if message: # Mark it with note: so Xcode picks it up in build output. makefile.write("\t@echo note: %s\n" % message) makefile.write("\t%s\n" % action) makefile.close() # It might be nice to ensure that needed output directories exist # here rather than in each target in the Makefile, but that wouldn't # work if there ever was a concrete output that had an input-dependent # variable anywhere other than in the leaf position. # Don't declare any inputPaths or outputPaths. If they're present, # Xcode will provide a slight optimization by only running the script # phase if any output is missing or outdated relative to any input. # Unfortunately, it will also assume that all outputs are touched by # the script, and if the outputs serve as files in a compilation # phase, they will be unconditionally rebuilt. Since make might not # rebuild everything that could be declared here as an output, this # extra compilation activity is unnecessary. With inputPaths and # outputPaths not supplied, make will always be called, but it knows # enough to not do anything when everything is up-to-date. # To help speed things up, pass -j COUNT to make so it does some work # in parallel. Don't use ncpus because Xcode will build ncpus targets # in parallel and if each target happens to have a rules step, there # would be ncpus^2 things going. With a machine that has 2 quad-core # Xeons, a build can quickly run out of processes based on # scheduling/other tasks, and randomly failing builds are no good. script = ( """JOB_COUNT="$(/usr/sbin/sysctl -n hw.ncpu)" if [ "${JOB_COUNT}" -gt 4 ]; then JOB_COUNT=4 fi exec xcrun make -f "${PROJECT_FILE_PATH}/%s" -j "${JOB_COUNT}" exit 1 """ % makefile_name ) ssbp = gyp.xcodeproj_file.PBXShellScriptBuildPhase( { "name": 'Rule "' + rule["rule_name"] + '"', "shellScript": script, "showEnvVarsInLog": 0, } ) if support_xct: support_xct.AppendProperty("buildPhases", ssbp) else: # TODO(mark): this assumes too much knowledge of the internals of # xcodeproj_file; some of these smarts should move # into xcodeproj_file itself. xct._properties["buildPhases"].insert(prebuild_index, ssbp) prebuild_index = prebuild_index + 1 # Extra rule inputs also go into the project file. Concrete outputs were # already added when they were computed. groups = ["inputs", "inputs_excluded"] if skip_excluded_files: groups = [x for x in groups if not x.endswith("_excluded")] for group in groups: for item in rule.get(group, []): pbxp.AddOrGetFileInRootGroup(item) # Add "sources". for source in spec.get("sources", []): (source_root, source_extension) = posixpath.splitext(source) if source_extension[1:] not in rules_by_ext: # AddSourceToTarget will add the file to a root group if it's not # already there. AddSourceToTarget(source, type, pbxp, xct) else: pbxp.AddOrGetFileInRootGroup(source) # Add "mac_bundle_resources" and "mac_framework_private_headers" if # it's a bundle of any type. if is_bundle: for resource in tgt_mac_bundle_resources: (resource_root, resource_extension) = posixpath.splitext(resource) if resource_extension[1:] not in rules_by_ext: AddResourceToTarget(resource, pbxp, xct) else: pbxp.AddOrGetFileInRootGroup(resource) for header in spec.get("mac_framework_private_headers", []): AddHeaderToTarget(header, pbxp, xct, False) # Add "mac_framework_headers". These can be valid for both frameworks # and static libraries. if is_bundle or type == "static_library": for header in spec.get("mac_framework_headers", []): AddHeaderToTarget(header, pbxp, xct, True) # Add "copies". pbxcp_dict = {} for copy_group in spec.get("copies", []): dest = copy_group["destination"] if dest[0] not in ("/", "$"): # Relative paths are relative to $(SRCROOT). dest = "$(SRCROOT)/" + dest code_sign = int(copy_group.get("xcode_code_sign", 0)) settings = (None, "{ATTRIBUTES = (CodeSignOnCopy, ); }")[code_sign] # Coalesce multiple "copies" sections in the same target with the same # "destination" property into the same PBXCopyFilesBuildPhase, otherwise # they'll wind up with ID collisions. pbxcp = pbxcp_dict.get(dest, None) if pbxcp is None: pbxcp = gyp.xcodeproj_file.PBXCopyFilesBuildPhase( {"name": "Copy to " + copy_group["destination"]}, parent=xct ) pbxcp.SetDestination(dest) # TODO(mark): The usual comment about this knowing too much about # gyp.xcodeproj_file internals applies. xct._properties["buildPhases"].insert(prebuild_index, pbxcp) pbxcp_dict[dest] = pbxcp for file in copy_group["files"]: pbxcp.AddFile(file, settings) # Excluded files can also go into the project file. if not skip_excluded_files: for key in [ "sources", "mac_bundle_resources", "mac_framework_headers", "mac_framework_private_headers", ]: excluded_key = key + "_excluded" for item in spec.get(excluded_key, []): pbxp.AddOrGetFileInRootGroup(item) # So can "inputs" and "outputs" sections of "actions" groups. groups = ["inputs", "inputs_excluded", "outputs", "outputs_excluded"] if skip_excluded_files: groups = [x for x in groups if not x.endswith("_excluded")] for action in spec.get("actions", []): for group in groups: for item in action.get(group, []): # Exclude anything in BUILT_PRODUCTS_DIR. They're products, not # sources. if not item.startswith("$(BUILT_PRODUCTS_DIR)/"): pbxp.AddOrGetFileInRootGroup(item) for postbuild in spec.get("postbuilds", []): action_string_sh = gyp.common.EncodePOSIXShellList(postbuild["action"]) script = "exec " + action_string_sh + "\nexit 1\n" # Make the postbuild step depend on the output of ld or ar from this # target. Apparently putting the script step after the link step isn't # sufficient to ensure proper ordering in all cases. With an input # declared but no outputs, the script step should run every time, as # desired. ssbp = gyp.xcodeproj_file.PBXShellScriptBuildPhase( { "inputPaths": ["$(BUILT_PRODUCTS_DIR)/$(EXECUTABLE_PATH)"], "name": 'Postbuild "' + postbuild["postbuild_name"] + '"', "shellScript": script, "showEnvVarsInLog": 0, } ) xct.AppendProperty("buildPhases", ssbp) # Add dependencies before libraries, because adding a dependency may imply # adding a library. It's preferable to keep dependencies listed first # during a link phase so that they can override symbols that would # otherwise be provided by libraries, which will usually include system # libraries. On some systems, ld is finicky and even requires the # libraries to be ordered in such a way that unresolved symbols in # earlier-listed libraries may only be resolved by later-listed libraries. # The Mac linker doesn't work that way, but other platforms do, and so # their linker invocations need to be constructed in this way. There's # no compelling reason for Xcode's linker invocations to differ. if "dependencies" in spec: for dependency in spec["dependencies"]: xct.AddDependency(xcode_targets[dependency]) # The support project also gets the dependencies (in case they are # needed for the actions/rules to work). if support_xct: support_xct.AddDependency(xcode_targets[dependency]) if "libraries" in spec: for library in spec["libraries"]: xct.FrameworksPhase().AddFile(library) # Add the library's directory to LIBRARY_SEARCH_PATHS if necessary. # I wish Xcode handled this automatically. library_dir = posixpath.dirname(library) if library_dir not in xcode_standard_library_dirs and ( not xct.HasBuildSetting(_library_search_paths_var) or library_dir not in xct.GetBuildSetting(_library_search_paths_var) ): xct.AppendBuildSetting(_library_search_paths_var, library_dir) for configuration_name in configuration_names: configuration = spec["configurations"][configuration_name] xcbc = xct.ConfigurationNamed(configuration_name) for include_dir in configuration.get("mac_framework_dirs", []): xcbc.AppendBuildSetting("FRAMEWORK_SEARCH_PATHS", include_dir) for include_dir in configuration.get("include_dirs", []): xcbc.AppendBuildSetting("HEADER_SEARCH_PATHS", include_dir) for library_dir in configuration.get("library_dirs", []): if library_dir not in xcode_standard_library_dirs and ( not xcbc.HasBuildSetting(_library_search_paths_var) or library_dir not in xcbc.GetBuildSetting(_library_search_paths_var) ): xcbc.AppendBuildSetting(_library_search_paths_var, library_dir) if "defines" in configuration: for define in configuration["defines"]: set_define = EscapeXcodeDefine(define) xcbc.AppendBuildSetting("GCC_PREPROCESSOR_DEFINITIONS", set_define) if "xcode_settings" in configuration: for xck, xcv in configuration["xcode_settings"].items(): xcbc.SetBuildSetting(xck, xcv) if "xcode_config_file" in configuration: config_ref = pbxp.AddOrGetFileInRootGroup( configuration["xcode_config_file"] ) xcbc.SetBaseConfiguration(config_ref) build_files = [] for build_file, build_file_dict in data.items(): if build_file.endswith(".gyp"): build_files.append(build_file) for build_file in build_files: xcode_projects[build_file].Finalize1(xcode_targets, serialize_all_tests) for build_file in build_files: xcode_projects[build_file].Finalize2(xcode_targets, xcode_target_to_target_dict) for build_file in build_files: xcode_projects[build_file].Write() #!/usr/bin/env python3 # Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Unit tests for the xcode.py file. """ import gyp.generator.xcode as xcode import unittest import sys class TestEscapeXcodeDefine(unittest.TestCase): if sys.platform == "darwin": def test_InheritedRemainsUnescaped(self): self.assertEqual(xcode.EscapeXcodeDefine("$(inherited)"), "$(inherited)") def test_Escaping(self): self.assertEqual(xcode.EscapeXcodeDefine('a b"c\\'), 'a\\ b\\"c\\\\') if __name__ == "__main__": unittest.main() o ۤ_c^X@srddlZddlZddlZddlZddlZddlZddlZddlm Z GdddZ Gddde Z ddZ d d Zd d Zd dZddZddZddZe d@ddZe dAddZddZddZedZedZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Z d,d-Z!d.d/Z"ifd0d1Z#d2d3fd4d5Z$Gd6d7d7e Z%Gd8d9d9e Z&d:d;Z'dd?Z)dS)BN) MutableSetc@seZdZddZddZdS)memoizecCs||_i|_dSN)funccache)selfrr7s z(FindQualifiedTargets..r)r Zqualified_listrrr FindQualifiedTargets2sr"cCsV|dd}t|dkr|\}}nd}|dd}t|dkr$|\}}nd}|||gS)N:r#)rsplitr)r Z target_split build_filetoolsetrrr r:s       rcCsbt|\}}}|r(|r&tjtjtj||}tj|s%t|d}n|}|r,|}|||gS)N.)rospathnormpathjoindirnameisabs RelativePath)r'r r(Zparsed_build_fileZparsed_toolsetrrr ResolveTargetMs    r1cCs t|dSNrr)Zfully_qualified_targetrrr BuildFilep r3cCs&|D]}|tjvrtj|Sq|S)zpLook up a key in the environment, with fallback to secondary keys and finally falling back to a default value.)r*environ)Zvar_listdefaultvarrrr GetEnvironFallbackus  r8cCs |d|}|r|d|}|S)Nr#r%r)r'r r(Zfully_qualifiedrrr QualifiedTarget~s  r9TcCs|r tj|}ntj|}tj|}tjdkr0tj|dtj|dkr0|S|tjj }|tjj }t tj ||g}tjj gt ||||d}t |dkradStjj |S)Nwin32r)r*r+realpathabspathsysplatform splitdrivelowersplitsepr commonprefixpardirr-)r+ relative_toZfollow_path_symlinkZ path_splitZrelative_to_splitZ prefix_lenZrelative_splitrrr r0s(        r0cCs,|s|S|dur dn|}t|tj||S)aGiven a path like foo/bar that is relative to toplevel_dir, return the inverse relative path back to the toplevel_dir. E.g. os.path.normpath(os.path.join(path, InvertRelativePath(path))) should always produce the empty string, unless the path contains symlinks. Nr))r0r*r+r-)r+ toplevel_dirrrr InvertRelativePathsrHcCstj|r|St||Sr)r*r+r/r0)r+rFrrr FixIfRelativePaths  rIcCs"tj|}tjtj||Sr)r*r+r.r,r-)r+rFZrel_dirrrr UnrelativePaths rJz[ #$%&'()*;<=>?[{|}~]|^$z(["\\`])cCs@t|ts t|}t|rd}nd}|ttd||}|S)aEncodes |argument| suitably for consumption by POSIX shells. argument may be quoted and escaped as necessary to ensure that POSIX shells treat the returned value as a literal representing the argument passed to this function. Parameter (variable) expansions beginning with $ are allowed to remain intact without escaping the $, to allow the argument to contain references to variables to be expanded by the shell. "r;z\\\1) isinstancer_quotesearchresub_escape)argumentquoteZencodedrrr EncodePOSIXShellArgument s  rTcCs&g}|D] }|t|qd|S)zEncodes |list| suitably for consumption by POSIX shells. Returns EncodePOSIXShellArgument for each item in list, and joins them together using the space character as an argument separator. r)appendrTr-)listZencoded_argumentsrRrrr EncodePOSIXShellList"s rWcCsvt}t|}|r3|}||vrq||||}|t|dg|t|dg|s t|t|S)z2Returns the recursive list of target dependencies. dependenciesdependencies_original)setpopaddupdategetrV) target_dictsrootsrXpendingrspecrrr DeepDependencyTargets/s  rdcsfdd|DS)zHFrom a target_list, returns the subset from the specified build_file. csg|] }t|kr|qSr)r3)rpr'rr r!Esz$BuildFileTargets..r) target_listr'rrfr BuildFileTargetsBsrhcCst||}t||}||S)zNReturns all targets (direct and dependencies) for the specified build_file. )rhrd)rgr_r'Z bftargetsZ deptargetsrrr AllTargetsHs  ricsGfddd}|S)zWrite to a file only if the new contents differ. Arguments: filename: name of the file to potentially write to. Returns: A file like object which will write to temporary file and only overwrite the target if it differs (on close). cs8eZdZdZfddZddZfddZdd Zd S) zWriteOnDiff..Writerz?Wrapper around file which only covers the target if it differs.csntrdntj}tjdtjdd|d\}|_z t|d|_ WdSt y6t |jw)Nr;z.tmprz.gyp.)suffixprefixdirwb) IsCygwinr*r+r.tempfileZmkstemprBtmp_pathfdopentmp_file Exceptionunlink)rZ base_temp_dirZtmp_fdfilenamerr r ]s    z$WriteOnDiff..Writer.__init__cSs t|j|Sr)getattrrr)rattrnamerrr __getattr__tr4z'WriteOnDiff..Writer.__getattr__c szd|jd}z t|jd}Wnty+}z |jtjkr!WYd}~nd}~ww|r7t |jWdSt d}t |t |jd|@t j dkr[tjr[tt|jWdStyrt |jw)NF?ir:)rrclosefilecmpZcmprpOSErrorerrnoZENOENTr*rtumaskchmodr>r?r+existsremoverenamers)rZsamerrrurr r{xs.        z!WriteOnDiff..Writer.closecSs|j|ddS)Nutf-8)rrwriteencode)rsrrr rsz!WriteOnDiff..Writer.writeN)rrrrr ryr{rrrurr WriterZs    +rr)rvrrrur WriteOnDiffPs LrcCs.z ttj|WdStyYdSw)z*Make sure the directory for |path| exists.N)r*makedirsr+r.r})r+rrr EnsureDirExistss  rcCsdddd}d|vr|dStj|vr|tjStjdr dStjdr(dStjd r0d Stjd r8d Stjd r@d Stjd rHd SdS)zFReturns |params.flavor| if it's set, the system's default flavor else.winmac)cygwinr:darwinflavorZsunossolaris)Z dragonflyfreebsdrZopenbsdZnetbsdaix)Zos390zosrlinux)r>r? startswith)paramsZflavorsrrr GetFlavors*        rc Csddddd|d}|sdStjtjtjtd|}t| }|}Wdn1s3wYd}|dd}|dkrL|rL|d |7}tj|d |} t| d } | d |d |g|ddWdn1swwYt | ddS)zRFinds (flock|mac|win)_tool.gyp in the gyp directory and copies it to |out_path|.Zflockrr)rrrrNz %s_tool.pyz!# Generated by gyp. Do not edit. mac_toolchain_dirz,import os; os.environ['DEVELOPER_DIR']='%s' z gyp-%s-toolwr;rri) r^r*r+r-r.r=__file__open readlinesrr) rZout_pathgenerator_flagsrk source_pathZ source_filesourceheaderrZ tool_pathZ tool_filerrr CopyTools(      &rcCs|Srr)xrrr srcCs:i}g}|D]}||}||vrqd||<||q|S)Nr)rU)seqZidfunseenr itemZmarkerrrr uniquers rc@sheZdZdddZddZddZdd Zd d Zd d ZddZ dddZ ddZ ddZ ddZ dS) OrderedSetNcCs6g|_}|d||g7}i|_|dur||O}dSdSr)endmap)riterablerrrr r s  zOrderedSet.__init__cCs t|jSr)rrrrrr __len__  zOrderedSet.__len__cCs ||jvSr)r)rkeyrrr __contains__ rzOrderedSet.__contains__cCs@||jvr|j}|d}|||g|d<|d<|j|<dSdS)Nrr$)rr)rrrcurrrrr r\s $zOrderedSet.addcCs4||jvr|j|\}}}||d<||d<dSdS)Nr$r)rr[)rrZ prev_itemZ next_itemrrr discards  zOrderedSet.discardcc:|j}|d}||ur|dV|d}||us dSdS)Nr$rrrrrrrr __iter__ zOrderedSet.__iter__ccr)Nrrrrrrr __reversed__#rzOrderedSet.__reversed__TcCs:|std|r|jddn|jdd}|||S)Nz set is emptyrrr$)r rr)rlastrrrr r[+s   zOrderedSet.popcCs*|s |jjdS|jjdt|dS)Nz()()) __class__rrVrrrr __repr__2szOrderedSet.__repr__cCs:t|trt|t|kot|t|kSt|t|kSr)rLrrrVrZ)rotherrrr __eq__7s  zOrderedSet.__eq__cCs |D] }||vr ||qdSr)r\)rrirrr r]=s  zOrderedSet.updaterT)rrrr rrr\rrrr[rrr]rrrr rs   rc@s eZdZdZddZddZdS) CycleErrorz9An exception raised when an unexpected cycle is detected.cCs ||_dSr)nodes)rrrrr r FrzCycleError.__init__cCsdt|jS)NzCycleError: cycle involving: )rrrrrr __str__IszCycleError.__str__N)rrrrr rrrrr rCs rcsFtttgfddt|D]}|qS)aTopologically sort based on a user provided edge definition. Args: graph: A list of node names. get_edges: A function mapping from node name to a hashable collection of node names which this node has outgoing edges to. Returns: A list containing all of the node in graph in topological order. It is assumed that calling get_edges once for each node and caching is cheaper than repeatedly calling get_edges. Raises: CycleError in the event of a cycle. Example: graph = {'a': '$(b) $(c)', 'b': 'hi', 'c': '$(b)'} def GetEdges(node): return re.findall(r'\$\(([^))]\)', graph[node]) print TopologicallySorted(graph.keys(), GetEdges) ==> ['a', 'c', b'] cs`|vrt|vrdS|||D]}|q|d|dSr2)rr\rinsert)nodeZneighborVisit get_edgesZ ordered_nodesvisitedZvisitingrr rgs     z"TopologicallySorted..Visit)rrZsorted)Zgraphrrrrr TopologicallySortedMs rcCsTtjdp)tjdp)tjdp)tjdp)tjdp)tjdp)tjdS)NZGYP_CROSSCOMPILEZAR_hostZCC_hostZCXX_hostZ AR_targetZ CC_targetZ CXX_target)r*r5r^rrrr CrossCompileRequestedxs       rcCsJztjdtjtjd}|dd}dt|vWSty$YdSw)Nuname)stdoutstderrrrCYGWINF) subprocessPopenPIPESTDOUT communicatedecoderrs)outrrrr rns  rnrr)*r~r|os.pathr*rOror>rZcollections.abcrrrsrrr"rr1r3r8r9r0rHrIrJcompilerMrQrTrWrdrhrirrrrrrrrrrnrrrr sP  #  .   "  Y ( A + o ۤ_c @sddlZddlZddlZddlZddlmZdddZdddZddejd kfd d Z d d ddddddZ e dd e eje ZdddZdS)N)reduceutf-8FcCs.d|g}|r |dt|||d|S)ay Writes the XML content to disk, touching the file only if it has changed. Visual Studio files have a lot of pre-defined structures. This function makes it easy to represent these structures as Python data structures, instead of having to create a lot of function calls. Each XML element of the content is represented as a list composed of: 1. The name of the element, a string, 2. The attributes of the element, a dictionary (optional), and 3+. The content of the element, if any. Strings are simple text nodes and lists are child elements. Example 1: becomes ['test'] Example 2: This is it! becomes ['myelement', {'a':'value1', 'b':'value2'}, ['childtype', 'This is'], ['childtype', 'it!'], ] Args: content: The structured content to be converted. encoding: The encoding to report on the first XML line. pretty: True if we want pretty printing with indents and new lines. Returns: The XML content as a string. z# )append_ConstructContentListjoin)contentencodingpretty xml_partsr >D:\a\_work\1\s\node_modules\node-gyp\gyp\pylib\gyp\easy_xml.py XmlToString s '   rc Cs\|r d|}d}nd}d}|d}t|tstdt|||d||dd}|rYt|dtrYt|dD]\}} |d |d t| d d d q>|dd}|r|dtdd|d } | } | rt|rt|||D]} t| tr|t| qvt || ||dqv| r|r|||d|d|dS|d|dS)a+ Appends the XML parts corresponding to the specification. Args: xml_parts: A list of XML parts to be appended to. specification: The specification of the element. See EasyXml docs. pretty: True if we want pretty printing with indents and new lines. level: Indentation level. z rrrzRThe first item of an EasyXml specification should be a string. Specification was <N z="Tattr">cSs|ot|tS)N) isinstancestr)xyr r r\sz'_ConstructContentList..z%s) rr Exceptionrdictsorteditems _XmlEscaperr) r Z specificationr levelZ indentationZnew_linenamerestatvalZ all_stringsZ multi_lineZ child_specr r rr<s@   "     rwin32c Cst|||}|rtjdkr|dd}td}|r(||kr(||}zt| }| }Wdn1s.replace)_xml_escape_resub)valuerr*r rrr s  r )rF)r)F)sysrer(r+ functoolsrrrplatformr6r>compilermapescapekeysrAr r r r rs(   02   o ۤ_cL@sddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlmZddlmZddlmZgdZddgZgdZeaiZiZd d Zgd Zgagd Zd adadddZddZ ddZ!ddZ"ddZ#ddZ$ddZ%ddZ&ddZ'Gd d!d!e(Z)Gd"d#d#Z*d$d%Z+ed&Z,d'd(d)d*Z-d+d,Z.d-d.Z/e0d/Z1e0d0Z2e0d1Z3iZ4d2d3Z5dZ6d4Z7d5Z8d6d7Z9iZ:d8d9Z;d:d;Zd?Z>d@dAZ? ddBdCZ@dDdEZAdFdGZBdHdIZCdJdKZDdLdMZEdNdOZFdPdQZGdRdSZHdTdUZIGdVdWdWZJdXdYZKdZd[ZLd\d]ZMd^d_ZNe0d`ZOdadbZPddddeZQdfdgZRdhdiZSdjdkZTdldmZUdndoZVdpdqZWdrdsZXdtduZYdvdwZZdxdyZ[dzd{Z\d|d}Z]d~dZ^ddZ_ddZ`dS)N) StrictVersion)GypError) OrderedSet) executableshared_libraryloadable_modulemac_kernel_extensionwindows_driver dependenciesexport_dependent_settings)Z destinationfilesZ include_dirsinputs librariesZoutputssourcescCs|r|dddvr|dd}|r|dddvs |tvr dSd|vrH|dd}|ddkr6|dd}|dddvr@dS|d dd kSd S) Nz=+?!T_is)Z_file_pathZ_dirF) path_sections)Zsectiontailr;D:\a\_work\1\s\node_modules\node-gyp\gyp\pylib\gyp\input.py IsPathSection8s    r)actionsconfigurationsZcopiesdefault_configurationr dependencies_originalrZ postbuildsZ product_dirZproduct_extensionZ product_nameZproduct_prefixrulesrun_asrstandalone_static_librarysuppress_wildcard target_nametoolsettoolsetstype variables) rall_dependent_settingsrr direct_dependent_settingsr link_settingsrr!r#r&FcCsH|durg}||vr |S||||dgD]}t|||q|S)aReturn a list of all build files included into build_file_path. The returned list will contain build_file_path as well as all other files that it included, either directly or indirectly. Note that the list may contain files that were included into a conditional section that evaluated to false and was not merged into build_file_path's dict. aux_data is a dict containing a key for each build file or included build file. Those keys provide access to dicts whose "included" keys contain lists of all other files included by the build file. included should be left at its default None value by external callers. It is used for recursion. The returned list will not contain any duplicate entries. Each build file in the list will be relative to the current directory. Nincluded)appendgetGetIncludedBuildFiles)build_file_pathaux_datar+Zincluded_build_filerrrr.s r.cCsTt|}t|tjs J|j}t|dksJ|d}t|tjs$Jt|jgS)zReturn the eval of a gyp file. The gyp file is restricted to dictionaries and lists only, and repeated keys are not allowed. Note that this is slower than eval() is. r) astZparse isinstanceZModulebodylenZExpr CheckNodevalue)Z file_contentsZ syntax_treeZc1Zc2rrr CheckedEvals  r8c Cst|tjrNi}t|j|jD]<\}}t|tjsJ|j}||vr;td|dt t |ddd |dt |}| |t||||<q|St|tjrug}t|jD]\}}t |}| t || t||q[|St|tjr~|jStdd |dt |) NzKey 'z' repeated at level r1z with key path '.'zUnknown AST node at key path 'z': )r3r2ZDictzipkeysvaluesZStrrrreprr5joinlistr,r6ZList enumerateelts TypeError) nodeZkeypathdictkeyr7Zkpchildrenindexchildrrrr6sJ    r6c CsV||vr||Stj|rt|dd}n t|dtdd}z|r-t|}nt|diid}Wn%t yF}z||_ d}~wt y[}z t j |d|d}~wwt|turhtd||||<i||<d|vsx|dsz|rt||||||W|St||||d|W|St y}z t j |d |d}~ww|S) Nutf-8)encodingz not found (cwd: ) __builtins__zwhile reading z%%s does not evaluate to a dictionary.Z skip_includeszwhile reading includes of )ospathexistsopenreadrgetcwdr8eval SyntaxErrorfilename ExceptiongypcommonExceptionAppendr&rELoadBuildFileIncludesIntoDict) r/datar0includesZ is_targetcheckZbuild_file_contentsbuild_file_dataerrrLoadOneBuildFilesV        rac Cs g}|dur ||d|vr-|dD]}tjtjtj||}||q|d=|D]-}d||vr=g||d<||d|ttj d|t |t |||dd|||q/| D]"\} } t | turut| |||d|qat | turt| ||||qadS)Nr]r+zLoading Included File: '%s'F)extendrNrOnormpathr?dirnamer,rX DebugOutputDEBUG_INCLUDES MergeDictsraitemsr&rEr[r@LoadBuildFileIncludesIntoList) ZsubdictZ subdict_pathr\r0r]r^Z includes_listincludeZrelative_includekvrrrr[s8       r[cCsJ|D] }t|turt||||d|qt|tur"t|||||qdSN)r&rEr[r@ri)ZsublistZ sublist_pathr\r0r^itemrrrri9s   ric Cs d|vr^|d}g}|D]M}d|vrd|vr||q tr&|ddg}ndg}d|vr0|d=t|dkrY|ddD]}tj|}||d<||q<|d|d<||q ||d<d|vr|dD]}t|tur|ddD] }t|t urt |qtqfdSdS)Ntargetsr$r%targetrr1 conditions) r,multiple_toolsetsr-r5rX simple_copydeepcopyr&r@rEProcessToolsetsInDict) r\Z target_listZnew_target_listrpr%build new_target conditionZcondition_dictrrrruEs<         ruc Cs2|rtj|tj|}|dkrd|d<n|dd|d<d|vr1||dvr*dS|d|ttj d|t ||||d |} || d <d | vrPt |d t ||} g| d <| D]} tj| tj|} | d  | q[t| t| t||t| d | vrd| vrt d|d} | t| dkr| d| }tj| d }t|||||| d| <| d7} | t| dks| d =g}d| vr| dD]}d|vrq|dD]}| tj||ddqq|r|D]&}z t||||||||Wqty}z tj|d|d}~wwdS||fS)Nr9ZDEPTH\/target_build_filesFzLoading Target Build File '%s'TZ_DEPTHZincluded_filesz$ must not contain included_files keyZtarget_defaultsroz'Unable to find targets in build file %srr1r z while loading dependencies of %s)rXrY RelativePathrNrOrdreplaceaddrerfrarr.r,ru#ProcessVariablesAndConditionsInDict PHASE_EARLYr5rsrtrg ResolveTargetLoadTargetBuildFilerWrZ)r/r\r0r'r]depthr^Zload_dependenciesdr_r+Z included_fileZincluded_relativerHZold_target_dictZnew_target_dictr target_dict dependencyr`rrrrjs             rc Csz9ttjtj|D] \}}|t|<q t|t|tt||||d} | s+| WS| \}} t |} || | fWSt yT} zt j d| WYd} ~ dSd} ~ wtyw} ztd| t j dttt j dWYd} ~ dSd} ~ ww)zWrapper around LoadTargetBuildFile for parallel processing. This wrapper is used when LoadTargetBuildFile is executed in a worker process. Fzgyp: %s Nz Exception:)file)signalSIGINTSIG_IGNrhglobalsSetGeneratorGlobalsrper_process_dataper_process_aux_datapoprsysstderrwriterWprint tracebackZ format_exc) global_flagsr/r'r]rr^generator_input_inforFr7resultr r_r`rrrCallLoadTargetBuildFiles<    rc@ eZdZdS)ParallelProcessingErrorN__name__ __module__ __qualname__rrrrr+rc@s eZdZdZddZddZdS) ParallelStateaClass to keep track of state when processing input files in parallel. If build files are loaded in parallel, use this to keep track of state during farming out and processing parallel jobs. It's stored in a global so that the callback function can have access to it. cCs0d|_d|_d|_d|_t|_g|_d|_dS)NrF)poolrxr\pendingset scheduledr errorselfrrr__init__7s zParallelState.__init__cCs|j|sd|_|j|jdS|\}}}||j|<|jd||D]}||jvr=|j||j |q*|j d8_ |j|jdS)zJHandle the results of running LoadTargetBuildFile in another process. TNr|r1) rxacquirernotifyreleaser\rrr r,r)rrZbuild_file_path0Zbuild_file_data0Z dependencies0Znew_dependencyrrrLoadTargetBuildFileCallbackJs"         z)ParallelState.LoadTargetBuildFileCallbackN)rrr__doc__rrrrrrr/s rc CsBt}t|_t||_t||_d|_||_ zW|j |js$|jrn|j r(nF|js1|j q|j }|jd7_tdtdtdd} |jsWtt|_|jjt| ||||||f|jd|js$|js$Wnty} z|j| d} ~ ww|j|j|jd|_|j rtddSdS)Nrr1rnon_configuration_keysrr)rrrr)argscallback)r threading Conditionrxr@r rrrr\rrwaitrrrmultiprocessingZPool cpu_countZ apply_asyncrrKeyboardInterrupt terminatercloser?rexit) build_filesr\r'r]rr^rZparallel_staterrr`rrrLoadTargetBuildFilesParallel_s`             rz{[({[()}]rLcCszg}d}t|D]2\}}|tvr|||dkr|}q|tvr:|s%dS|t|kr0dS|s:||dfSqdS)Nr)rrr1)rA LBRACKETSr,BRACKETSr) input_strstackstartrHcharrrrFindEnclosingBracketGroups" rcCsdt|tur0|r0|dkrdS|ddkr|dd}|sdSd|dkr-d kr0|SdSdS) z|Returns True if |string| is in its canonical integer form. The canonical form is such that str(int(string)) == string. 0Tr-r1NF19)r&strisdigit)stringrrrIsStrCanonicalInts   rzy(?P(?P<(?:(?:!?@?)|\|)?)(?P[-a-zA-Z0-9_.]+)?\((?P\s*\[?)(?P.*?)(\]?)\))zy(?P(?P>(?:(?:!?@?)|\|)?)(?P[-a-zA-Z0-9_.]+)?\((?P\s*\[?)(?P.*?)(\]?)\))z|(?P(?P[\^](?:(?:!?@?)|\|)?)(?P[-a-zA-Z0-9_.]+)?\((?P\s*\[?)(?P.*?)(\]?)\))cCsLtjdkr$t|turtdd|dg|dd}|Stdd|}|S)Nwin32z^cat ztype rr1)rplatformr&r@resub)cmdrrrFixupPlatformCommands   rr1c/ Cs|tkr t}d}n|tkrt}d}n |tkrt}d}nJt|}t|r)t|S||vr/|St | |}|s:|S|}| |D]} | } t t jd| d| dv} | d} d | dv} | d }| d }t||d\}}||}|||}||d }|d }|||}| rt j|}t||t||||}nt||||}|}d | dvo||k}| s| rtj|}|d kr| sd}| rAt|t ur|}n|d}|d}tj|rtd|tstj ||}n'tj|r td}t j!"||}n|}td}tj |||}t j!#|t j!"||}t j!$|}|d dD] }|%d|q0|&n*| rNd} | drQt'|}d} t||f}!t()|!d}"|"durBt t jd||d }| dkrt*}#|r~t+|t,j-t*z>t.|}$zt/|$d}%Wnt0y}&z td|$d|&fd}&~&wwt|%1|$d d2}Wt,j3t+|#n t,j3t+|#w|dusJne| rtd| |ft4|}zt5j6|| t5j7t5j7t5j7|d}'Wnt8y }&z td|&||fd}&~&ww|'9d \}(})|(:d}(|):d})|';dks)|)r9t,j<%|)td||'j=|f|(2}|t(|!<n)t t jd|||"}n||vrg|dd vr]g}ntd!|d"|||}t>|t?r|t>|ts||:d}t|t ur|D]2}*t>|*t?rt>|*ts|*:d}*|dd#kst|*ttfvrtd$|d%d&|*j@jAqtB||||nt|ttfvrtd$|d%d'|j@jA|rt|t ur|dd}n*t.t|}n"d }+t|t urt j!C|}+n|}+|d|t|+||d}|}qB||kr#t t jd(|n8t t jd)|t|t urT|r?t|dt ur?ng},|D] }*|,-t|*|||qC|,}nt||||}t|t urytD|D]\}-}.t|.rut|.||-<qf|St|rt|}|S)*N<>^Fz Matches: %r!r&command_string|r~r1@ry rz(| cannot handle absolute paths, got "%s"toplevelqualified_out_dirz%s TZis_arrayz(Executing command '%s' in directory '%s'Z pymod_do_mainz,Error importing pymod_do_mainmodule (%s): %sz$Unknown command string '%s' in '%s'.)shellstdoutrstdincwdz%%s while executing command '%s' in %srJz1Call to '%s' returned exit status %d while in %s.z2Had cache value for command '%s' in directory '%s'rrr{zUndefined variable  in r{z Variable z- must expand to a string or list of strings; zlist contains a zfound a z?Found only identity matches on %r, avoiding infinite recursion.zFound output %r, recursing.)Erearly_variable_re PHASE_LATElate_variable_rePHASE_LATELATElatelate_variable_rerrintr@ZfinditerreverseZ groupdictrXreDEBUG_VARIABLESrendrrsrtProcessListFiltersInDictExpandVariablesstriprNrOrdr&splitisabsrgenerator_filelist_pathsr?rYr}ZEnsureDirExistsZ WriteOnDiffrrrTcached_command_resultsr-rSchdirrr,shlex __import__ ImportErrorZDoMainrstriprr subprocessPopenPIPErW communicatedecoderr returncoder3bytes __class__r#ProcessVariablesAndConditionsInListZEncodePOSIXShellListrA)/inputphaser' build_fileZ variable_reZexpansion_symbolrZmatchesoutputZ match_groupmatchZ run_commandrZ file_listZ replace_startZ replace_endZc_startZc_endZ replacementZcontents_startZ contents_endcontentsZprocessed_variablesZexpand_to_listbuild_file_dirZ contents_listrOrZrel_build_file_dirrfiZ use_shellZ cache_keyZ cached_valueZoldwdZparsed_contentsZ py_moduler`pZp_stdoutZp_stderrrnZencoded_replacementZ new_outputrHZoutstrrrrrs                                                rc Cs(t|tur t|dt|dkr$t|d|ddtt|d}d}|t|kr||}||d}t|turItd||t|t||dkryt||dtury||d} |d }|t|krxtd ||t||nd} |d}|durt||| |||}|t|ks.|S) z]Returns the dict that should be used or None if the result was that nothing should be used.z must be a listrrrz must be at least length 2, not Nr1z.{} {} must be followed by a dictionary, not {}z&{} {} has {} unexpected trailing items)r&r@rr5rrEformatEvalSingleCondition) rxconditions_keyrr'rrr cond_expr true_dict false_dictrrr EvalConditionesV        $    rc Cst||||}t|ttfvrtd|jjz$|tvr!t|}n t|dd}|t|<it d}t |||r9|WS|WSt yb} zt dt| j d| j || jf| j| j| j| j } | d} ~ wty~} ztj| d|d |t| d} ~ ww) zMReturns true_dict if cond_expr evaluates to true, and false_dict otherwise.CVariable expansion in this context permits str and int only, found zrT)rMrlz9%s while evaluating condition '%s' in %s at character %d.rNzwhile evaluating condition 'z' in )rr&rr ValueErrorrrcached_conditions_astscompilerrTrUrtextoffsetrVlineno NameErrorrXrYrZr) rrrrr'rZcond_expr_expandedZast_codeenvr`Z syntax_errorrrrrsH    rcCs|tkrd}n|tkrd}n|tkrdSJ||vrdS||}||=|D]}t|||||}|durAt||||t||||q%dS)NrqZtarget_conditions)rrrrrrg)the_dictrr'rrZconditions_listrxZ merge_dictrrrProcessConditionsInDicts, r"cCs4|D]\}}t|tttfvr||d|<qdS)Nr)rhr&rrr@)r'r!rFr7rrrLoadAutomaticVariablesFromDicts  r#cCsx|diD]1\}}t|tttfvrq|dr3|dd}||vr&q|dkr2||vr2||}n|}|||<qdS)Nr'%r)r-rhr&rrr@endswith)r'r! the_dict_keyrFr7Z variable_namerrrLoadVariablesFromVariablesDicts   r'c Cs|}t||d|vr&|dD]\}}|||<qt|d|||dt||||D]-\}}|dkr]t|tur]t||||}t|ttfvrYt d|j j d||||<q0|}t||t|||t |||||}t||t||||D]>\}}|dkst|turqt|t urt|||||qt|turt||||qt|turtd|j j d|qdS)zHandle all variable and command expansion and conditional evaluation. This function is the public entry point for all variable expansions and conditional evaluations. The variables_in dictionary will not be modified by this function. r'rz for Unknown type N)copyr#rhrr'r&rrrrrrr"rEr@rrC) r!rZ variables_inrr&r'rFr7expandedrrrrsX     "      rcCsd}|t|kr||}t|turt||||n[t|tur(t||||nMt|turct||||}t|ttfvrB|||<n3t|turW||||d<|t|7}qt d|j j d|t|turut d|j j d||d}|t|ksdSdS)Nrr1zIVariable expansion in this context permits strings and lists only, found z at r(z at index ) r5r&rErr@rrrrrrrrC)the_listrr'rrHrnr*rrrrs<        rcCs`i}|dD]'}||dgD]}tj||d|d}||vr(td||||<qq|S)ayBuilds a dict mapping fully-qualified target names to their target dicts. |data| is a dict mapping loaded build files by pathname relative to the current directory. Values in |data| are build file contents. For each |data| value with a "targets" key, the value of the "targets" key is taken as a list containing target dicts. Each target's fully-qualified name is constructed from the pathname of the build file (|data| key) and its "target_name" property. These fully-qualified names are used as the keys in the returned dict. These keys provide access to the target dicts, the dicts in the "targets" lists. r|ror#r$z!Duplicate target definitions for )r-rXrYQualifiedTargetr)r\rorrpr#rrrBuildTargetsDicts   r-cCsddtD}|D]W\}}tj|}|d}|D]F}||g}t|D]9\}} tj|| |\} } } ts:|} tj | | | } | ||<|dkr`| |dvr`t d| d|d|dq'qq d S) aMake dependency links fully-qualified relative to the current directory. |targets| is a dict mapping fully-qualified target names to their target dicts. For each target in this dict, keys known to contain dependency links are examined, and any dependencies referenced will be rewritten so that they are fully-qualified and relative to the current directory. All rewritten dependencies are suitable for use as keys to |targets| or a similar dict. cSsg|] }dD]}||qqS)ryrr{r).0depoprrr s z'QualifyDependencies..r$r zFound r of z, but not in dependenciesN) dependency_sectionsrhrXrY BuildFiler-rArrrr,r)roZall_dependency_sectionsrprtarget_build_filer$dependency_keyr rHr0Zdep_fileZ dep_targetZ dep_toolsetrrrrQualifyDependenciessN     r8cCs:|D]\}}tj|}tD]}||g}d}|t|krtj||\}} } | dkr8| dkr8|d}q||krHtd|d|d||=|d}||d} | D]7} t | dd rbqW| d } | dkro| | kroqW| d }| dkr|| |kr|qWtj || |}|d}| ||qW|d}|t|ks qqd S) aExpands dependencies specified as build_file:*. For each target in |targets|, examines sections containing links to other targets. If any such section contains a link of the form build_file:*, it is taken as a wildcard link, and is expanded to list each target in build_file. The |data| dict provides access to build file dicts. Any target that does not wish to be included by wildcard can provide an optional "suppress_wildcard" key in its target dict. When present and true, a wildcard dependency link will not include such targets. All dependency names, including the keys to |targets| and the values in each dependency list, must be qualified when this function is called. r*r1zFound wildcard in r3z referring to same build fileror"Fr#r$N) rhrXrYr5r4r-r5ZParseQualifiedTargetrrr,insert)ror\rprr6r7r rHdependency_build_fileZdependency_targetZdependency_toolsetZdependency_target_dictsZdependency_target_dictZdependency_target_nameZdependency_target_toolsetrrrrExpandWildcardDependenciessh      r<csifdd|DS)zARemoves duplicate elements from items, keeping the first element.cs g|] }|vr||qSr setdefaultr/r`seenrrr2M zUnify..r)rhrr@rUnifyJsrCcCs<|D]\}}tD]}||g}|rt|||<q qdS)zRMakes sure every dependency appears only once in all targets's dependency lists.N)rhr4r-rC)ror#rr7r rrrRemoveDuplicateDependenciesPs  rDcsifdd|DS)zRemoves item from items.cs g|] }|kr||qSrr=r?rnresrrr2]rBzFilter..r)rhrnrrErFilterZsrGcCsh|D]-\}}tD]&}||g}|r0|D]}||kr/||diddr/t||||<qq qdS)zYRemove self dependencies from targets that have the prune_self_dependency variable set.r'Zprune_self_dependencyrNrhr4r-rGror#rr7r trrrRemoveSelfDependencies`s  rKcCst|D]3\}}tD],}||g}|r6|D]}|dddkr5||diddr5t|||||<qq qdS)zURemove dependencies having the 'link_dependency' attribute from the 'none' targets.r&Nnoner'Zlink_dependencyrrHrIrrr%RemoveLinkDependenciesFromNoneTargetsss rMc@seZdZdZGdddeZddZddZdd Zd d Z dd dZ dddZ dddZ dddZ dddZddZddZd S)DependencyGraphNodez Attributes: ref: A reference to an object that this DependencyGraphNode represents. dependencies: List of DependencyGraphNodes on which this one depends. dependents: List of DependencyGraphNodes that depend on this one. c@r)z%DependencyGraphNode.CircularExceptionNrrrrrCircularExceptionrrOcCs||_g|_g|_dSrm)refr dependents)rrPrrrrs zDependencyGraphNode.__init__cCs d|jS)NzrPrrrr__repr__s zDependencyGraphNode.__repr__cCst}dd}t|jdd|d}|rF|}||jt|j|dD]}d}t|j|dD] }|j|vr;d}nq0|rC||g7}q%|st|S)NcS|jS)zAExtracts the object that the node represents from the given node.rR)rDrrrExtractNodeRefsz9DependencyGraphNode.FlattenToList..ExtractNodeRef)rFTF)rsortedrQrrrPr r@)r flat_listrUZin_degree_zerosrDZnode_dependentZis_in_degree_zeroZnode_dependent_dependencyrrr FlattenToLists(    z!DependencyGraphNode.FlattenToListcs4gtfdd|||gS)zR Returns a list of cycles in the graph, where each cycle is its own list. c s^|jD])}||vr|g|d||dq|vr,|||g|qdS)Nr1)rQr,rHr)rDrOrIVisitZresultsvisitedrrrZs $ z-DependencyGraphNode.FindCycles..Visit)rrrrrYr FindCycless   zDependencyGraphNode.FindCyclesNcCs8|durg}|jD]}|jr|j|vr||jq |S)z+Returns a list of just direct dependencies.N)r rPr,rr rrrrDirectDependenciess  z&DependencyGraphNode.DirectDependenciescCsz|durg}d}|t|kr;||}||}d}|dgD]}||vr0|||||d}q|d}|t|ks|S)a^Given a list of direct dependencies, adds indirect dependencies that other dependencies have declared to export their settings. This method does not operate on self. Rather, it operates on the list of dependencies in the |dependencies| argument. For each dependency in that list, if any declares that it exports the settings of one of its own dependencies, those dependencies whose settings are "passed through" are added to the list. As new items are added to the list, they too will be processed, so it is possible to import settings through multiple levels of dependencies. This method is not terribly useful on its own, it depends on being "primed" with a list of direct dependencies such as one provided by DirectDependencies. DirectAndImportedDependencies is intended to be the public entry point. Nrr1r )r5r-r:)rror rHrdependency_dictZ add_indexZimported_dependencyrrr_AddImportedDependenciess"  z,DependencyGraphNode._AddImportedDependenciescCs||}|||S)zReturns a list of a target's direct dependencies and all indirect dependencies that a dependency has advertised settings should be exported through the dependency for. )r^r`)rror rrrDirectAndImportedDependenciess  z1DependencyGraphNode.DirectAndImportedDependenciescCsJ|durt}|jD]}|jdurq |j|vr"||||jq |S)zEReturns an OrderedSet of all of a target's dependencies, recursively.N)rr rPDeepDependenciesrr]rrrrbs     z$DependencyGraphNode.DeepDependenciesTcCs|durt}|jdur|Sd||jvrtdd||jvr+td||jd||jd}|tv}|r<|s<|S|dkrQ||jddsQ||j|S|sY|d vrY|S|sc|d krc|sc|S|j|vr||j|sr|s|jD] }||||d qu|S) auReturns an OrderedSet of dependency targets that are linked into this target. This function has a split personality, depending on the setting of |initial|. Outside callers should always leave |initial| at its default setting. When adding a target to the list of dependencies, this function will recurse into itself with |initial| set to False, to collect dependencies that are linked into the linkable target for which the list is being built. If |include_shared_libraries| is False, the resulting dependencies will not include shared_library targets that are linked into this target. Nr#z&Missing 'target_name' field in target.r&z!Missing 'type' field in target %srLZdependencies_traverseT)rrrr rF)rrPrlinkable_typesr-rr _LinkDependenciesInternal)rroinclude_shared_librariesr initial target_typeZ is_linkablerrrrrd-sF       z-DependencyGraphNode._LinkDependenciesInternalcCs||jdd}|||S)zi Returns a list of dependency targets whose link_settings should be merged into this target. Z(allow_sharedlib_linksettings_propagationT)rPr-rd)rrorerrrDependenciesForLinkSettingss  z/DependencyGraphNode.DependenciesForLinkSettingscCs ||dS)zP Returns a list of dependency targets that are linked into this target. T)rd)rrorrrDependenciesToLinkAgainsts z-DependencyGraphNode.DependenciesToLinkAgainstrm)NT)rrrrrrOrrSrXr\r^r`rarbrdrhrirrrrrNs3  *  ` rNc CsJi}|D]\}}||vrt|||<qtd}|D]:\}}||}|d}|s7|g|_|j|q|D]}||}|sJtd||f|j||j|q9q|} t| t|kr|js}t t |}||}|j||j|g} | D]} dd| D} | dd | qt dd | || gS) Nr z8Dependency '%s' not found while trying to load target %scSg|]}|jqSrrRr/rDrrrr2z'BuildDependencyList.. Cycle: %s -> z%Cycles in dependency graph detected:  )rhrNr-r rQr,rrXr5nextiterr\r?rO) rodependency_nodesrpspec root_nodeZ target_noder rdependency_noderWcyclescyclepathsrrrBuildDependencyListsL          ryc Csi}|D]}tj|}||vrt|||<q|D][\}}tj|}||}|dg}|D]D}ztj|}WntyQ} z tj| d|d} ~ ww||krWq1||} | sdtd|| |jvru|j | | j |q1qtd} | D]}t |jdkr|j | | j |q| } t | t |kr| j stt| } | j | | j | g}| D]}dd|D}| dd|qtd d |dS) Nr z,while computing dependencies of .gyp file %szDependency '%s' not foundrcSrjrrRrkrrrr2 rlz7VerifyNoGYPFileCircularDependencies..rmrnz/Cycles in .gyp file dependency graph detected: ro)rXrYr5rNrhr-rrZr r,rQr=r5rXrprqr\r?rO)rorrrprrsZbuild_file_nodeZtarget_dependenciesrr;r`rurtrWZ file_nodervrwrxrrr#VerifyNoGYPFileCircularDependenciessd                rzc Cs|D]R}||}tj|}|dkr||}n|dkr%|||}n|dkr1|||}ntd||D]}||} || vrDq9tj|} t|| ||| q9qdS)Nr(r)r*zCDoDependentSettings doesn't know how to determine dependencies for )rXrYr5rbrarhrrg) rFrWrorrrprrr rr_r;rrrDoDependentSettingss4   r{c sZ|D]}||d}|dkrmdvrqdgddd<|||}d}|t|kr^||}||} | ddkrD| ddrP| ddkrT|dvrT||=n|d}|t|ks0t|dkri|d<qd=q|tvr|||} | D]}||krqzdvrgd<|dvrd|qz|rdvrfd d t|Dd<qdS) Nr&static_libraryr rrZhard_dependencyFr1csg|] }|dvr|qS)r r)r/r0rrrr2s  z3AdjustStaticLibraryDependencies..)r-rar5rcrir,reversed) rWrorrZsort_dependenciesrprgr rHrr_Zlink_dependenciesrr}rAdjustStaticLibraryDependencies3sZ              rz ["']?[-/$<>^]c Csd||ks t|r |Stjtjtjtj |tj || dd}| dr0|d7}|S)Nrzr{) exception_rer rNrOrcr?rXrYr}rdr~r%)to_filefro_filernZretrrrMakePathRelatives rTc sHddfdd}d}fdd|D}|D]} d} t| ttfvr<|r,t||| } n| } t| tur9| d s;d } n(t| turLi} t| | ||nt| tur\g} t| | ||nt d | j j |r}| rn|| ||s|| | | r|| | q| r| |vr|| | r| |vs||| | r| | |d }qdS) NcSrTrm)__hash__)valrrr is_hashableszMergeLists..is_hashablecs|r||vS||vSrmr)xrrhrrris_in_set_or_listsz%MergeLists..is_in_set_or_listrcsh|]}|r|qSrr)r/rrrr zMergeLists..FrTz/Attempt to merge list item of unsupported type r1)r&rrr startswithrErgr@ MergeListsrCrrr,rremover:) tofrorris_pathsr,rZ prepend_indexZhashable_to_setrnZ singletonZto_itemrrrrsL          rcCsb|D])\}}||vrEd}t|ttfvr$t||ttfvr#d}n t|t||s/d}|rEtd|jjd||jjd|t|ttfvrat|}|r\t |||||<q|||<qt|t ury||vroi||<t |||||qt|t ur#|d}d} |dkr|dd} | | dg} g|| <n3|d kr|dd} | d| dg} d} n|dkr|dd} | | d| d g} n |} | d| dg} | D]} | |vrt d |d | q| |vr|dkrqt|| t urtd|jjd|| jjd| d |d ng|| <t| } t|| |||| | qtd|jjd|dS)NFTz$Attempt to merge dict value of type z into incompatible type z for key r=?+zIncompatible list policies z and rrLz0Attempt to merge dict value of unsupported type )rhr&rrr3rCrrrrrErgr@rr)rrrrrkrlZ bad_mergeZis_pathZextr,Z list_baseZlists_incompatibleZlist_incompatiblerrrrrgs           rgcCsd||vrdS|d|}|dgD] }t||||||gqt||||d|vr0|d=dSdS)NrZ inherit_fromabstract)r-MergeConfigWithInheritancerg)new_configuration_dictrr configurationr[configuration_dictparentrrrro s   rcCsgd}tj|}d|vrdii|d<d|vr+dd|dD}t|d|d<i}|d}|D]@\}}|dr?q5i} |D]#\} } | d d} | |vrZ| dd } n| } | tvrhtj| | | <qEt | |||g| ||<q5| D] }|||d|<qz|d}d d |D|d<g}|D]} | d d} | |vr| dd } n| } | tvr| | q|D]} || =q|d D]}|d|}| D]} | t vrt d | ||fqqdS) N)rrrrr{rZDefaultrcSsg|] \}}|ds|qSrr-)r/rZconfigrrrr2 s z'SetUpConfigurations..rrrcSs i|] \}}|ds||qSrr)r/rkrlrrr s z'SetUpConfigurations..z:%s not allowed in the %s configuration, found in target %s)rXrYr5rhrVr-rrsrtrr<r,invalid_configuration_keysr)rprZ key_suffixesrZconcreteZmerged_configurationsconfigsrZold_configuration_dictrrFZ target_valZkey_extkey_baseZ delete_keysrrrrSetUpConfigurations st             rcCsg}g}|D]a\}}|d}|dkr|dkrqt|tur-t|d|d|jj|dd}||vr=||qt||tur`||}t|d|d|jjddd d |||vri||q|D]}||=ql|D]}||} td t| } |d} | |vr|| D]} t| D] \} }| |krd | | <qq|| =|d}||vr||D]@}|\}}t |}|d krd }n|dkrd}ntd|d|d|t| D]\} }| | |krq| |r|| | <qq||=|d}||vr t |d|d|g}t t| dddD]} | | d kr*|d | | | | =qt|d kr7|||<qt|D]\}}t|turNt||qTarget %s has an invalid target type '%s'. Must be one of %s.r{r!rr|z_Target %s has type %s but standalone_static_library flag is only valid for static_library type.)r-rr?)rprZVALID_TARGET_TYPESrgrrrValidateTargetType s$  rcCs,i}i}|dg}|D]}|d}||vr td|d||||<|d}|dr3|dd}||vrEtd ||||d|f|||<d |vrUtd ||fg} d g} | || D]'} || gD]} tj| \} }|dr~|dd}||kr| | qiqat| d kr| |d <q dS)a]Ensures that the rules sections in target_dict are valid and consistent, and determines which sources they apply to. Arguments: target: string, name of target. target_dict: dict, target spec containing "rules" and "sources" lists. extra_sources_for_rules: a list of keys to scan for rule matches in addition to 'sources'. r rule_namezrule z exists in duplicate, target extensionr9r1NzFextension %s associated with multiple rules, target %s rules %s and %s rule_sourcesz7rule_sources must not exist in input, target %s rule %srr) r-rrrbrNrOsplitextr,r5)rprextra_sources_for_rulesZ rule_namesZrule_extensionsrZrulerZrule_extensionrZ source_keysZ source_keysourceZ source_rootZsource_extensionrrrValidateRulesInTarget s\           rcCs|d}|d}|sdSt|turtd||f|d}|s+td||ft|tur9td||f|d}|rNt|turNtd||f|d }|rct|turetd ||fdSdS) Nr#r z>The 'run_as' in target %s from file %s should be a dictionary.rzEThe 'run_as' in target %s from file %s must have an 'action' section.zCThe 'action' for 'run_as' in target %s from file %s must be a list.working_directoryzPThe 'working_directory' for 'run_as' in target %s in file %s should be a string. environmentzNThe 'environment' for 'run_as' in target %s in file %s should be a dictionary.)r-r&rErr@r)rprrr#r rrrrrrValidateRunAsInTarget sL       rc Cs|d}|dg}|D]0}|d}|std||dd}|dur,td||d}|r=|d s=td |q dS) z0Validates the inputs to the actions in a target.r#r action_namezKAnonymous action in target %s. An action must have an 'action_name' field.r Nz"Action in target %s has no inputs.rrz%Empty action as command in target %s.)r-r) rprrr#rrrr Zaction_commandrrrValidateActionsInTarget s$        rcCs||D]7\}}t|turt|}|||<nt|tur"t|n t|tur,t|t|tur;||=||t|<qdS)zGGiven dict the_dict, recursively converts all integers into strings. N)rhr&rrrETurnIntIntoStrInDictr@TurnIntIntoStrInList)r!rkrlrrrr. s       rcCsZt|D]&\}}t|turt|||<qt|tur t|qt|tur*t|qdS)zGGiven list the_list, recursively converts all integers into strings. N)rAr&rrrErr@r)r+rHrnrrrrA s    rc sg}|D]}|}tj||}|std|||qi|D]}|||<||D]}|||<q1q#fdd|D} |dD]/} d|| vrQqHg} || dD]}tj| |d|d} | vrp| |qY| || d<qH| fS)zEReturn only the targets that are deep dependencies of |root_targets|.zCould not find target %scsg|]}|vr|qSrr)r/rJZwanted_targetsrrr2] rz(PruneUnwantedTargets..r|ror#r$) rrXrYZFindQualifiedTargetsrrbrbr,r,) rorWrr root_targetsr\Zqualified_root_targetsrpZqualified_targetsrZwanted_flat_listrZ new_targetsZqualified_namerrrPruneUnwantedTargetsM s6      rcCsni}|D]0}|dd\}}tj|\}}|sd}|d|}||vr0td|||||f|||<qdS)zVerify that no two targets in the same directory share the same name. Arguments: targets: A list of targets in the form 'path/to/file.gyp:target_name'. :r1r9zHDuplicate target name "%s" in directory "%s" used both in "%s" and "%s".N)rsplitrNrOrr)roZusedrprOrZsubdirrXrFrrrVerifyNoCollidingTargetso s  rcCsDttat|dtddat|d|da|dadS)Nrr$generator_supports_multiple_toolsetsr) rbase_path_sectionsrupdatebase_non_configuration_keysrrbrrr)rrrrr s   rc  Cst||d} dti} tttjj|}|r#t|| |||||n*i} |D]%} z t| | | ||||dWq'tyL} z t j | d| d} ~ wwt | }t |t|t|| t||D]1\}}i}tD]}dD]}||}||vr||||<||=qrqnt|||D]}||||<qqft||rt|t|\}}|rt||||| \}}t|dD]}t|||||D] }|||vr|||=qq|}|drt||||d|D]}||}t j |} t|t|| q|D] }||}t||q|D] }||}t||q |D]}||}t j |} t|t|| q|D]$}||}t j |} t ||t!||| t"||| t#||| q/t$| ||| gS) Nrr|Tzwhile trying to load %sr.)r(r)r*4generator_wants_static_library_dependencies_adjusted#generator_wants_sorted_dependencies)%rrmaprNrOrcrrrWrXrYrZr-r8rKr<rMrhr4rrDrzryrrr{rr5rrrrrrrrr)rr'r]rrr^circular_checkparallelrrr\r0rr`ror#rZtmp_dictrr1rFrrrWZ settings_typerpZgiirrrLoad s                 rrm)FT)ar2 gyp.commonrXZgyp.simple_copyros.pathrNrrrrrrrZdistutils.versionrrrrcr4rrrrrrrrrrrrr.r8r6rar[rirurrrWrrrrrrrrrrrrrrrrrrrrr"r#r'rrr-r8r<rCrDrGrKrMrNryrzr{rrrrrgrrrrrrrrrrrrrrrrrrs      !#0* % 70?   m/+0 u%1R #4< X %JrV+"C# " o ۤ_c'3@sdZddlZddlZddlZddlmZddlZddZe dddZ dd d Z Gd d d Z Gddde Z Gddde ZGdddZdS)z7New implementation of Visual Studio project generation.N) attrgettercCs||k||kSN)xyrr=D:\a\_work\1\s\node_modules\node-gyp\gyp\pylib\gyp\MSVSNew.pycmpsrz&{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}z&{2150E333-8FDC-42A3-9474-1A3956D46DE8})projectfoldermsvs_newcCs|tt|t|d}d|ddd|ddd|ddd|ddd|dd d }|S) a#Returns a GUID for the specified target name. Args: name: Target name. seed: Seed for MD5 hash. Returns: A GUID-line string calculated from the name and seed. This generates something which looks like a GUID, but depends only on the name and seed. This means the same name/seed will always generate the same GUID, so that projects and solutions which refer to each other can explicitly determine the GUID to refer to explicitly. It also means that the GUID will not change when the project for a target is rebuilt. zutf-8{N-  })hashlibmd5strencode hexdigestupper)nameseeddguidrrrMakeGuid s0$       rc@seZdZddZdS)MSVSSolutionEntrycCst|j|f|j|fSr)rrget_guid)selfotherrrr__cmp__FszMSVSSolutionEntry.__cmp__N)__name__ __module__ __qualname__r#rrrrrEs rc@s"eZdZdZdddZddZdS) MSVSFolderz.Folder in a Visual Studio project or solution.NcCsX|r||_ntj||_||_||_t|pgtdd|_t|p"g|_ t d|_ dS)aInitializes the folder. Args: path: Full path to the folder. name: Name of the folder. entries: List of folder entries to nest inside this folder. May contain Folder or Project objects. May be None, if the folder is empty. guid: GUID to use for folder, if not None. items: List of solution items to include in the folder project. May be None, if the folder does not directly contain items. pathkeyr N) rosr(basenamersortedrentrieslistitemsENTRY_TYPE_GUIDSentry_type_guid)r!r(rr.rr0rrr__init__Ns zMSVSFolder.__init__cCs |jdur t|jdd|_|jS)NZ msvs_folder)r)rrr(r!rrrr is zMSVSFolder.get_guid)NNNN)r$r%r&__doc__r3r rrrrr'Ks  r'c@s@eZdZdZ       d ddZddZddZd d ZdS) MSVSProjectzVisual Studio project.Nc Csp||_||_||_||_|ptjtj|d|_t|pg|_ t d|_ |r-||_ ni|_ ||_ d|_dS)aInitializes the project. Args: path: Absolute path to the project file. name: Name of project. If None, the name will be the same as the base name of the project file. dependencies: List of other Project objects this project is dependent upon, if not None. guid: GUID to use for project, if not None. spec: Dictionary specifying how to build this project. build_file: Filename of the .gyp file that the vcproj file comes from. config_platform_overrides: optional dict of configuration platforms to used in place of the default for this target. fixpath_prefix: the path used to adjust the behavior of _fixpath rr N)r(rspec build_filer+splitextr,rr/ dependenciesr1r2config_platform_overridesfixpath_prefixmsbuild_toolset) r!r(rr:rr7r8r;r<rrrr3vs  zMSVSProject.__init__cCst|pg|_dSr)r/r:)r!r:rrrset_dependenciesszMSVSProject.set_dependenciescCs|jdur t|j|_|jSr)rrrr4rrrr s  zMSVSProject.get_guidcCs ||_dSr)r=)r!r=rrrset_msbuild_toolsets zMSVSProject.set_msbuild_toolset)NNNNNNN)r$r%r&r5r3r>r r?rrrrr6ss - r6c@s,eZdZdZ dddZejjfddZdS) MSVSSolutionzVisual Studio solution.NTcCsJ||_||_||_t|p g|_|r|dd|_nddg|_|dS)aInitializes the solution. Args: path: Path to solution file. version: Format version to emit. entries: List of entries in solution. May contain Folder or Project objects. May be None, if the folder is empty. variants: List of build variant strings. If none, a default list will be used. websiteProperties: Flag to decide if the website properties section is generated. Nz Debug|Win32z Release|Win32)r(websitePropertiesversionr/r.variantsWrite)r!r(rBr.rCrArrrr3s  zMSVSSolution.__init__c Cs,t}|jdd}|r'|d}||vrq ||t|tr%||j7}|s t|tdd}||j}| d|j | d|j t j|jd}|D]z}tj|j|}|ddpdd }| d |j|j||f|jr|| d t|tr|jr| d |jD]} | d | d| dq| dt|tr|jr| d|jD]} | d | d| dq| d| dqS| d| d|jD]} | d | d| dq| dg} i} |D]}t|tr | ||j| |<q| | d| D]&}|jD]} | || | }| d|| |f| d|| |fqq| d| d| d| dtdd|Dr| d|D]"}t|tsmqc|jD]}| d |d|dqpqc| d| d| dS)zfWrites the solution file to disk. Raises: IndexError: An entry appears multiple times. Nrr(r)z:Microsoft Visual Studio Solution File, Format Version %s z# %s /\.z"Project("%s") = "%s", "%s", "%s" z ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection z- ProjectSection(SolutionItems) = preProject z z = z z EndProjectSection z4 ProjectSection(ProjectDependencies) = postProject z EndProject zGlobal z> GlobalSection(SolutionConfigurationPlatforms) = preSolution z EndGlobalSection z> GlobalSection(ProjectConfigurationPlatforms) = postSolution z %s.%s.ActiveCfg = %s z %s.%s.Build.0 = %s z2 GlobalSection(SolutionProperties) = preSolution z HideSolutionNode = FALSE cSsg|] }t|tr|jqSr) isinstancer'r.).0errr dsz&MSVSSolution.Write..z. GlobalSection(NestedProjects) = preSolution z EndGlobal )!setr.popaddrHr'r-rr(writerBSolutionVersion Descriptionr+splitgypcommon RelativePathreplacer2rr rAr0r6r:rCappendr;sortgetanyclose)r!writerZ all_entriesZentries_to_checkrJfZsln_root relative_pathZ folder_nameirvZ config_guidsZconfig_guids_overridesgnvZsubentryrrrrDs             "                 $   zMSVSSolution.Write)NNT) r$r%r&r5r3rSrT WriteOnDiffrDrrrrr@s  %r@)r )r5rr+randomoperatorr gyp.commonrSrrr1rrr'r6r@rrrrs   %(Ko ۤ_cW@s>dZddlmZGdddZGdddZGdddZdS) z$Visual Studio project reader/writer.Nc@s"eZdZdZdddZddZdS)ToolzVisual Studio tool.NcCs|pi|_||jd<dS)zoInitializes the tool. Args: name: Tool name. attrs: Dict of tool attributes; may be None. NameNZ_attrs)selfnameattrsrAD:\a\_work\1\s\node_modules\node-gyp\gyp\pylib\gyp\MSVSProject.py__init__s z Tool.__init__cCs d|jgS)z]Creates an element for the tool. Returns: A new xml.dom.Element for the tool. rr)rrrr _GetSpecifications zTool._GetSpecificationN)__name__ __module__ __qualname____doc__r r rrrr r s  rc@seZdZdZdddZdS)Filterz1Visual Studio filter - that is, a virtual folder.NcCs||_t|pg|_dS)zInitializes the folder. Args: name: Filter (folder) name. contents: List of filenames and/or Filter objects contained. N)rlistcontents)rrrrrr r %szFilter.__init__r )r rrrr rrrr r"src@sVeZdZdZdddZddZddZdd d Zd d Zd dZ dddZ ddZ dS)Writerz!Visual Studio XML project writer.NcCsl||_||_||_||_|sdg}dg|_|D] }|jdd|igqdg|_dg|_dg|_t |_ dS) aInitializes the project. Args: project_path: Path to the project file. version: Format version to emit. name: Name of the project. guid: GUID to use for project, if not None. platforms: Array of string, the supported platforms. If null, ['Win32'] Win32Z PlatformsPlatformrZ ToolFilesZConfigurationsZFilesN) project_pathversionrguidplatform_sectionappendtool_files_sectionconfigurations_section files_sectiondict files_dict)rrrrr platformsplatformrrr r 6s  zWriter.__init__cCs|jdd|igdS)zeAdds a tool file to the project. Args: path: Relative path from project to tool file. ZToolFile RelativePathN)rr)rpathrrr AddToolFileTszWriter.AddToolFilecCsf|si}|sg}|}||d<||g}|r1|D]}t|tr'||q|t|q|S)a Returns the specification for a configuration. Args: config_type: Type of configuration node. config_name: Configuration name. attrs: Dict of configuration attributes; may be None. tools: List of tools (strings or Tool objects); may be None. Returns: r)copy isinstancerrr )r config_type config_namertoolsZ node_attrs specificationtrrr _GetSpecForConfiguration\s  zWriter._GetSpecForConfigurationcCs |d|||}|j|dS)zAdds a configuration to the project. Args: name: Configuration name. attrs: Dict of configuration attributes; may be None. tools: List of tools (strings or Tool objects); may be None. ConfigurationN)r-rr)rrrr*specrrr AddConfigzszWriter.AddConfigcCsV|D]&}t|trdd|jig}|||jn dd|ig}||j|<||qdS)zAdds files and/or filters to the parent node. Args: parent: Destination node files: A list of Filter objects and/or relative paths to files. Will call itself recursively, if the files list contains Filter objects. rrFiler#N)r'rr_AddFilesToNoderr r)rparentfilesfnoderrr r2s    zWriter._AddFilesToNodecCs||j|dS)aKAdds files to the project. Args: files: A list of Filter objects and/or relative paths to files. This makes a copy of the file/filter tree at the time of this call. If you later add files to a Filter object which was passed into a previous call to AddFiles(), it will not be reflected in this project. N)r2r)rr4rrr AddFiless zWriter.AddFilescCs:|j|}|std||d|||}||dS)a\Adds a configuration to a file. Args: path: Relative path to the file. config: Name of configuration to add. attrs: Dict of configuration attributes; may be None. tools: List of tools (strings or Tool objects); may be None. Raises: ValueError: Relative path does not match any file added via AddFiles(). z(AddFileConfig: file "%s" not in project.ZFileConfigurationN)r get ValueErrorr-r)rr$configrr*r3r/rrr AddFileConfigs  zWriter.AddFileConfigcCsPdd|j|j|j|jdd|j|j|jdg|jdgg}tj ||j ddd S) zWrites the project file.ZVisualStudioProjectz Visual C++ Win32Proj)Z ProjectTypeVersionrZ ProjectGUID RootNamespaceKeyword ReferencesGlobalsz Windows-1252)encodingN) rProjectVersionrrrrrreasy_xmlWriteXmlIfChangedr)rcontentrrr WriteIfChangeds zWriter.WriteIfChanged)NN) r rrrr r%r-r0r2r7r;rGrrrr r3s     r)r gyp.easy_xmlrDrrrrrrr s  o ۤ_c&@s$dZddlZddlZiZiZiZiZGdddZddZddZ Gd d d Z Gd d d e Z Gd dde Z Gddde Z Gddde ZGddde Ze ZeZe Ze Ze Ze Ze Ze ZegdZddZddZddZddZddZd d!Zd"d#Zd$d%Z d&Z!e"d'd(#e!Z$e"d)Z%ej&fd*d+Z'd,d-Z(d.d/Z)ej&fd0d1Z*ej&fd2d3Z+ej&fd4d5Z,d6d7Z-ed8d9Z.ed:d;Z/edd?Z1ed@dAZ2edBdCZ3edDdDZ4edEdEZ5ee.ee/ee0ee1ee2ee3ee4ee5iedF<iedG<iedH<ee.dIeee.dJeee.dKeee.dLeee.dMeee.dNeee.dOeee.dPeee.dQeee.dReee.dSeee.dTeee.dUeee.dVeee.dWeee.dXeee.dYeee.dZeee.d[eee.d\eee.d]eee.d^eee.d_eee.d`eee.daeee.dbeee.dceee.ddeee.deeee.dfeee.dgeee.dheee.dieee.djeee.dkegdlee.dmegdnee.doegdpee.dqegdree.dsegdtee.duegdvee.dwegdxee.dyegdzd{gd|ee.d}egd~dgd|ee.degdee.degdee.degddgd|ee.degdee.degdee.degdee.degddgd|ee.ddeee.ddeee.ddeee.ddeee.ddeee.ddeee.ddeee.ddegdee.ddeee.ddee.deee.deee.deee.degddgd|ee.deee.deee.deee.deee.deee.deee.dee e.dee/deee/deee/deee/dJeee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/dceee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deegddgd|Z6egdZ7ee/degdee/degdee/degdee/degdee/degdee/degdee/degdgdd|ee/de6ee/de7ee/degdee/deee/deee/dydegddgd|ee/ddeee/ddeee/ddeee/ddFeee/d dFeee/d dFeee/d dGeee/d dGeee/d eee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deee/deggdd|ee/deggdd|ee/deggdd|ee1dJeee1dIeee1deddee1dYeee1d]eee1deee1deee1dceee1dfeee1d eee1deee0dIeee0dJeee0d!eee0d"eee0d#eee0d$eee0d%eee0d&eee0d'eee0d(eee0d)eee0dYeee0d*eee0d+eee0d,eee0d]eee0d-eee0d.eee0dceee0d/eee0dfeee0deee0d0egd1ee0d2egd3ee0d4egd5ee0degd6ee0degd7ee0d8d9eee0d:d;eee0degd?d@gd|ee0dAegd?d@gd|ee0dBeee0dCeee0dDeee0deee0dEegdFdGgd|ee2deee2deee2dJeee2dHeee2deee2deee2deee2deee2deee2dceee2deee2deee2de7ee2d dGeee2dIeee2dyeggdJd|ee2deee2dKeee2dLeee2de6ee2deee2dMeee2dNeee3dOeee3dJeee3dPeee3dQeee3dReee3dSeee3dTeee3dUeee3dVeee3dceee3deee3dWeee3dXeee3dYeee3dZdHdeee3d[dFeee3d\eee3d]eee3deee3d^eee3d_eee3d`eee3daeee3dbeee3deee4dcedS(da9Code to validate and convert settings of the Microsoft build tools. This file contains code to validate and convert settings of the Microsoft build tools. The function ConvertToMSBuildSettings(), ValidateMSVSSettings(), and ValidateMSBuildSettings() are the entry points. This file was created by comparing the projects created by Visual Studio 2008 and Visual Studio 2010 for all available settings through the user interface. The MSBuild schemas were also considered. They are typically found in the MSBuild install directory, e.g. c:\Program Files (x86)\MSBuild Nc@seZdZdZddZdS)_ToolzRepresents a tool used by MSVS or MSBuild. Attributes: msvs_name: The name of the tool in MSVS. msbuild_name: The name of the tool in MSBuild. cCs||_||_dSN) msvs_name msbuild_name)selfrrrBD:\a\_work\1\s\node_modules\node-gyp\gyp\pylib\gyp\MSVSSettings.py__init__+s z_Tool.__init__N)__name__ __module__ __qualname____doc__r rrrrr#s rcCs.it|j<it|j<it|j<|jt|j<dS)zAdds a tool to the four dictionaries used to process settings. This only defines the tool. Each setting also needs to be added. Args: tool: The _Tool object to be added. N)_msvs_validatorsr_msbuild_validatorsr_msvs_to_msbuild_converters_msbuild_name_of_tooltoolrrr_AddTool0s   rcCs||jiS)z:Returns an MSBuild tool dictionary. Creates it if needed. setdefaultr)msbuild_settingsrrrr_GetMSBuildToolSettings>rc@(eZdZdZddZddZddZdS) _TypezType of settings (Base class).cCdS)zVerifies that the value is legal for MSVS. Args: value: the value to check for this type. Raises: ValueError if value is not valid for MSVS. Nrrvaluerrr ValidateMSVSFz_Type.ValidateMSVScCr)zVerifies that the value is legal for MSBuild. Args: value: the value to check for this type. Raises: ValueError if value is not valid for MSBuild. NrrrrrValidateMSBuildPr z_Type.ValidateMSBuildcCs|S)zReturns the MSBuild equivalent of the MSVS value given. Args: value: the MSVS value to convert. Returns: the MSBuild equivalent. Raises: ValueError if value is not valid. rrrrrConvertToMSBuildZs z_Type.ConvertToMSBuildNr r r r rr!r"rrrrrCs  rc@r) _StringzA setting that's just a string.cCt|ts td|dSNzexpected string; got %r isinstancestr ValueErrorrrrrrl  z_String.ValidateMSVScCr%r&r'rrrrr!pr+z_String.ValidateMSBuildcCst|SrConvertVCMacrosToMSBuildrrrrr"tsz_String.ConvertToMSBuildNr#rrrrr$i  r$c@r) _StringListz$A settings that's a list of strings.cCt|ttfs td|dSNzexpected string list; got %rr(listr)r*rrrrr| z_StringList.ValidateMSVScCr0r1r2rrrrr!r4z_StringList.ValidateMSBuildcCs t|tr dd|DSt|S)NcSsg|]}t|qSrr,).0irrr sz0_StringList.ConvertToMSBuild..)r(r3r-rrrrr"s z_StringList.ConvertToMSBuildNr#rrrrr/yr.r/c@s0eZdZdZddZddZddZdd Zd S) _Booleanz8Boolean settings, can have the values 'false' or 'true'.cCs$|dkr|dkrtd|dSdS)Ntruefalsezexpected bool; got %r)r*rrrr _Validates z_Boolean._ValidatecC||dSrr;rrrrrz_Boolean.ValidateMSVScCr<rr=rrrrr!r>z_Boolean.ValidateMSBuildcCs|||Srr=rrrrr"s z_Boolean.ConvertToMSBuildN)r r r r r;rr!r"rrrrr8s  r8c@s2eZdZdZd ddZddZddZd d Zd S) _IntegerzInteger settings. cCst|||_dSr)rr _msbuild_base)r msbuild_baserrrr s  z_Integer.__init__cCr<rr"rrrrrrz_Integer.ValidateMSVScCst||jdSr)intrArrrrr!sz_Integer.ValidateMSBuildcCs|jdkrdpd}|t|S)Nr@z%dz0x%04x)rArD)rrZmsbuild_formatrrrr"s z_Integer.ConvertToMSBuildN)r@r r r r r rr!r"rrrrr?s   r?c@s2eZdZdZd ddZddZddZd d ZdS) _EnumerationaType of settings that is an enumeration. In MSVS, the values are indexes like '0', '1', and '2'. MSBuild uses text labels that are more representative, like 'Win32'. Constructor args: label_list: an array of MSBuild labels that correspond to the MSVS index. In the rare cases where MSVS has skipped an index value, None is used in the array to indicate the unused spot. new: an array of labels that are new to MSBuild. NcCs<t|||_dd|D|_|dur|j|dSdS)NcSsh|]}|dur|qSrr)r5rrrr sz(_Enumeration.__init__..)rr _label_list_msbuild_valuesupdate)rZ label_listnewrrrr s z_Enumeration.__init__cCr<rrCrrrrrrz_Enumeration.ValidateMSVScCs||jvr td|dS)Nz unrecognized enumerated value %s)rIr*rrrrr!r+z_Enumeration.ValidateMSBuildcCsVt|}|dks|t|jkrtd|t|jf|j|}|dur)td||S)Nrz.index value (%d) not in expected range [0, %d)z%converted value for %s not specified.)rDlenrHr*)rrindexlabelrrrr"s   z_Enumeration.ConvertToMSBuildrrErrrrrFs   rF)r:r9cCst||||dS)zDefines a setting that has the same name in MSVS and MSBuild. Args: tool: a dictionary that gives the names of the tool for MSVS and MSBuild. name: the name of the setting. setting_type: the type of this setting. N)_Renamed)rname setting_typerrr_SamesrScsBfdd}jtj|<jtj<|tj|<dS)aDefines a setting for which the name has changed. Args: tool: a dictionary that gives the names of the tool for MSVS and MSBuild. msvs_name: the name of the MSVS setting. msbuild_name: the name of the MSBuild setting. setting_type: the type of this setting. cst|}||<dSr)rr")rrZmsbuild_tool_settingsrrRrrr _Translates z_Renamed.._TranslateN)rrrr!rrr)rrrrRrUrrTrrPs rPcCst|||||dSr)_MovedAndRenamed)rZ settings_namemsbuild_tool_namerRrrr_Moveds rXcsDfdd}jt|j|<j}|t<|t|j|<dS)aDefines a setting that may have moved to a new section. Args: tool: a dictionary that gives the names of the tool for MSVS and MSBuild. msvs_settings_name: the MSVS name of the setting. msbuild_tool_name: the name of the MSBuild tool to place the setting under. msbuild_settings_name: the MSBuild name of the setting. setting_type: the type of this setting. cs|i}||<dSr)rr"rr tool_settingsmsbuild_settings_namerWrRrrrUs z$_MovedAndRenamed.._TranslateN)rrrr!rr)rZmsvs_settings_namerWr\rRrU validatorrr[rrVs   rVcCs*dd}|jt|j|<|t|j|<dS)zDefines a setting that is only found in MSVS. Args: tool: a dictionary that gives the names of the tool for MSVS and MSBuild. name: the name of the setting. setting_type: the type of this setting. cSsdSrr)Z unused_valueZunused_msbuild_settingsrrrrU.sz_MSVSOnly.._TranslateN)rrrrrrQrRrUrrr _MSVSOnly%s r_cs0fdd}|jtj<|tj<dS)zDefines a setting that is only found in MSBuild. Args: tool: a dictionary that gives the names of the tool for MSVS and MSBuild. name: the name of the setting. setting_type: the type of this setting. cs|ji}||<dSrrrYrQrrrrU?s z _MSBuildOnly.._TranslateN)r!rrrrr^rr`r _MSBuildOnly6s racs0fdd}tjtj|<|tj|<dS)a+Defines a setting that's handled via a command line option in MSBuild. Args: tool: a dictionary that gives the names of the tool for MSVS and MSBuild. msvs_name: the name of the MSVS setting that if 'true' becomes a flag flag: the flag to insert at the end of the AdditionalOptions cs@|dkrt|}d|vrd|d}n}||d<dSdS)Nr9AdditionalOptionsz{} {})rformat)rrrZZ new_flagsflagrrrrUQs  z0_ConvertedToAdditionalOption.._TranslateN)_booleanrrrr)rrrerUrrdr_ConvertedToAdditionalOptionHs  rgcsZfdd}tgdj}|tj|<tj}tj}||d<||d<|tj|<dS)Ncsjt|}|dkrd|d<d|d<dS|dkr!d|d<d|d<dS|dkr/d|d<d|d<dStd|) N0r:PreprocessToFilePreprocessSuppressLineNumbers1r92z&value must be one of [0, 1, 2]; got %s)rr*rYrrrrU_s     z3_CustomGeneratePreprocessedFile.._Translate)abcrirj) rFrrrrfr!rrr)rrrUZmsvs_validatorZmsbuild_validatorZmsbuild_tool_validatorsrrr_CustomGeneratePreprocessedFile^s  rp)IntDirOutDirz(\$\((?:%s)\))(?:[\\/]+)|z^(.*)_excluded$cCs>d}tt|}|r|d}||v}|rt||ddSdS)aVerify that 'setting' is valid if it is generated from an exclusion list. If the setting appears to be generated from an exclusion list, the root name is checked. Args: setting: A string that is the setting name to validate settings: A dictionary where the keys are valid settings error_msg: The message to emit in the event of error stderr: The stream receiving the error messages. TfileN)rematch_EXCLUDED_SUFFIX_REgroupprint)settingsettingsZ error_msgstderrZ unrecognizedmZ root_settingrrr_ValidateExclusionSettings  rcCsd|vr td|}|S)aReplace macros which have excessive following slashes. These macros are known to have a built-in trailing slash. Furthermore, many scripts hiccup on processing paths with extra slashes in the middle. This list is probably not exhaustive. Add as needed. $z\1)fix_vc_macro_slashes_regexsub)srrrFixVCMacroSlashess rc CsJd|vr#dddddddd dd }|D] \}}|||}qt|}|S) zConvert the MSVS macros found in the string to the MSBuild equivalent. This list is probably not exhaustive. Add as needed. rz$(Configuration)z%(RelativeDir)z %(Extension)z%(Filename)%(Extension)z %(Filename)z %(Identity)z$(ProjectFileName)z $(Platform)) z$(ConfigurationName)z $(InputDir)z $(InputExt)z$(InputFileName)z $(InputName)z $(InputPath)z $(ParentName)z$(PlatformName)z$(SafeInputName))itemsreplacer)rZ replace_mapoldrKrrrr-s r-c Csi}|D]T\}}|tvrRt|}|D]:\}}||vrEz ||||WqtyD}ztd|||f|dWYd}~qd}~wwt||d||f|qqtd||dq|S)aConverts MSVS settings (VS2008 and earlier) to MSBuild settings (VS2010+). Args: msvs_settings: A dictionary. The key is the tool name. The values are themselves dictionaries of settings and their values. stderr: The stream receiving the error messages. Returns: A dictionary of MSBuild settings. The key is either the MSBuild tool name or the empty string (for the global settings). The values are themselves dictionaries of settings and their values. z.Warning: while converting %s/%s to MSBuild, %sruNz@Warning: unrecognized setting %s/%s while converting to MSBuild.z:Warning: unrecognized tool %s while converting to MSBuild.)rrr*r{r) msvs_settingsr~rZmsvs_tool_nameZmsvs_tool_settingsZ msvs_toolZ msvs_settingZ msvs_valueerrrConvertToMSBuildSettingssB rcCtt||dS)aValidates that the names of the settings are valid for MSVS. Args: settings: A dictionary. The key is the tool name. The values are themselves dictionaries of settings and their values. stderr: The stream receiving the error messages. N)_ValidateSettingsrr}r~rrrValidateMSVSSettingsrcCr)a Validates that the names of the settings are valid for MSBuild. Args: settings: A dictionary. The key is the tool name. The values are themselves dictionaries of settings and their values. stderr: The stream receiving the error messages. N)rrrrrrValidateMSBuildSettingsrrc Cs|D]Y}||vrS||}||D]?\}}||vrDz|||WqtyC}ztd|d|d||dWYd}~qd}~wwt||d|d||qqtd||dqdS)aValidates that the settings are valid for MSBuild or MSVS. We currently only validate the names of the settings, not their values. Args: validators: A dictionary of tools and their validators. settings: A dictionary. The key is the tool name. The values are themselves dictionaries of settings and their values. stderr: The stream receiving the error messages. z Warning: for /z, ruNzWarning: unrecognized setting zWarning: unrecognized tool %s)rr*r{r)Z validatorsr}r~ tool_nameZtool_validatorsr|rrrrrrs. rVCCLCompilerTool ClCompile VCLinkerToolLink VCMIDLToolMidlVCResourceCompilerToolResourceCompileVCLibrarianToolLibVCManifestToolZManifestMASMZARMASMrOProjectReferenceZManifestResourceCompileAdditionalIncludeDirectoriesrbZAdditionalUsingDirectoriesZAssemblerListingLocationZBrowseInformationFileBufferSecurityCheckZDisableLanguageExtensionsDisableSpecificWarningsEnableFiberSafeOptimizations EnablePREfastZExpandAttributedSourceZFloatingPointExceptionsZForceConformanceInForLoopScopeForcedIncludeFilesZForcedUsingFilesZGenerateXMLDocumentationFilesZIgnoreStandardIncludePathMinimalRebuildZOmitDefaultLibNameOmitFramePointersPreprocessorDefinitionsProgramDataBaseFileNameRuntimeTypeInfoZ ShowIncludesZSmallerTypeCheck StringPoolingZSuppressStartupBannerTreatWChar_tAsBuiltInTypeZ"UndefineAllPreprocessorDefinitionsZUndefinePreprocessorDefinitionsZ UseFullPathsWholeProgramOptimizationZXMLDocumentationFileNameCompileAsWinRTZAssemblerOutput)Z NoListingZ AssemblyCodeAllZAssemblyAndMachineCodeZAssemblyAndSourceCodeBasicRuntimeChecks)DefaultZStackFrameRuntimeCheckZUninitializedLocalUsageCheckZEnableFastChecksZBrowseInformation)r:r9r9CallingConvention)ZCdeclZFastCallZStdCallZ VectorCallZ CompileAs)rZ CompileAsCZ CompileAsCppDebugInformationFormat)rOZOldStyleNZProgramDatabaseZEditAndContinueEnableEnhancedInstructionSet)NotSetZStreamingSIMDExtensionsZStreamingSIMDExtensions2ZAdvancedVectorExtensionsZ NoExtensionsZAdvancedVectorExtensions2ZErrorReporting)NoneZPromptQueueZSend)rKExceptionHandling)r:ZSyncZAsyncZ SyncCThrowFavorSizeOrSpeed)ZNeitherZSpeedSizeFloatingPointModel)ZPreciseZStrictZFastInlineFunctionExpansion)rZOnlyExplicitInlineZ AnySuitableDisabled Optimization)rZMinSpaceZMaxSpeedFullRuntimeLibrary)Z MultiThreadedZMultiThreadedDebugZMultiThreadedDLLZMultiThreadedDebugDLLZStructMemberAlignment)rZ1ByteZ2BytesZ4BytesZ8BytesZ16Bytes WarningLevel)ZTurnOffAllWarningsZLevel1ZLevel2ZLevel3ZLevel4ZEnableAllWarningsEnableFunctionLevelLinkingZFunctionLevelLinkingEnableIntrinsicFunctionsZIntrinsicFunctionsZ KeepCommentsZPreprocessKeepCommentsZ ObjectFileObjectFileNameZOpenMPZ OpenMPSupportPrecompiledHeaderThroughPrecompiledHeaderFileZPrecompiledHeaderOutputFileUsePrecompiledHeaderPrecompiledHeader)NotUsingCreateUse WarnAsErrorZTreatWarningAsErrorDefaultCharIsUnsignedz/JZDetect64BitPortabilityProblemsZUseUnicodeResponseFilesZ BuildingInIDECompileAsManagedr:r9ZCreateHotpatchableImageZMultiProcessorCompilationZPreprocessOutputPathZProcessorNumberZTrackerLogDirectoryZTreatSpecificWarningsAsErrorsZUseUnicodeForAssemblerListingZGeneratePreprocessedFileAdditionalDependenciesAdditionalLibraryDirectoriesZAdditionalManifestDependenciesZAddModuleNamesToAssemblyZAllowIsolationZAssemblyLinkResource BaseAddressZCLRUnmanagedCodeCheck DelayLoadDLLsZ DelaySignZEmbedManagedResourceFile EnableUACEntryPointSymbolForceSymbolReferencesZ FunctionOrderGenerateDebugInformationGenerateMapFileZHeapCommitSizeZHeapReserveSizeZIgnoreAllDefaultLibrariesZIgnoreEmbeddedIDLZ ImportLibraryZ KeyContainerZKeyFileZ ManifestFile MapExports MapFileNameZMergedIDLBaseFileNameZ MergeSectionsZMidlCommandFileModuleDefinitionFile OutputFileZPerUserRedirectionProfileProfileGuidedDatabaseProgramDatabaseFileZRegisterOutputZ SetChecksumStackCommitSizeStackReserveSizeZStripPrivateSymbolsZSupportUnloadOfDelayLoadedDLLZ SwapRunFromCDZTurnOffAssemblyGenerationZTypeLibraryFileZTypeLibraryResourceID UACUIAccessVersionEnableCOMDATFoldingFixedBaseAddressLargeAddressAwareOptimizeReferencesRandomizedBaseAddressTerminalServerAware) rZConsoleWindowsNativezEFI ApplicationzEFI Boot Service DriverzEFI ROMz EFI RuntimeZ WindowsCEZPOSIX)rZ MachineX86NZ MachineARMZ MachineEBCZ MachineIA64NZ MachineMIPSZ MachineMIPS16ZMachineMIPSFPUZMachineMIPSFPU16NNNZ MachineSH4NZ MachineTHUMBZ MachineX64Z AssemblyDebug)rOr9r:Z CLRImageType)rZ ForceIJWImageZForcePureILImageZForceSafeILImageZCLRThreadAttribute)ZDefaultThreadingAttributeZMTAThreadingAttributeZSTAThreadingAttributeDataExecutionPreventionDriver)rrZUpOnlyWDMLinkTimeCodeGeneration)rZUseLinkTimeCodeGenerationZ PGInstrumentZPGOptimizationZPGUpdateZ ShowProgress)rZ LinkVerboseZLinkVerboseLib)ZLinkVerboseICFZLinkVerboseREFZLinkVerboseSAFESEHZLinkVerboseCLR SubSystem TargetMachineUACExecutionLevel)Z AsInvokerZHighestAvailableZRequireAdministratorMinimumRequiredVersionTreatLinkerWarningAsErrorsZLinkErrorReporting) NoErrorReportPromptImmediatelyQueueForNextLoginSendErrorReportIgnoreDefaultLibraryNamesZIgnoreSpecificDefaultLibrariesResourceOnlyDLLZ NoEntryPointZSwapRunFromNetZSwapRunFromNETGenerateManifestIgnoreImportLibraryLinkIncrementalZLinkLibraryDependenciesUseLibraryDependencyInputsZOptimizeForWindows98ImageHasSafeExceptionHandlersZLinkDLLZ LinkStatusZPreventDllBindingZSupportNobindOfDelayLoadedDLLZMSDOSStubFileNameZSectionAlignmentZSpecifySectionAttributesZForceFileOutput)EnabledZMultiplyDefinedSymbolOnlyZUndefinedSymbolOnlyZCreateHotPatchableImage)rZX86ImageZX64ImageZ ItaniumImageZCLRSupportLastError)rrZ SystemDllsCulture)rBZResourceOutputFileNameZNullTerminateStringsZCPreprocessOptionsZErrorCheckAllocationsZErrorCheckBoundsZErrorCheckEnumRangeZErrorCheckRefPointersZErrorCheckStubDataZGenerateStublessProxiesZGenerateTypeLibraryHeaderFileNameInterfaceIdentifierFileNameZMkTypLibCompatibleOutputDirectory ProxyFileNameZRedirectOutputAndErrorsTypeLibraryNameZDefaultCharType)ZUnsignedZSignedZAsciiZTargetEnvironment)rWin32ZItaniumX64ARM64ZEnableErrorChecks)Z EnableCustomrr)rrkrl48)rhrkrl3r DLLDataFileNameZDllDataFileNameZValidateParametersZValidateAllParametersZApplicationConfigurationModeZClientStubFileZGenerateClientFilesZStubrZGenerateServerFilesZLocaleIDZServerStubFileZSuppressCompilerWarningsZ TypeLibFormatZ NewFormatZ OldFormatZExportNamedFunctionsZDisplayLibrary)rrrrNameZ RemoveObjectsZTreatLibWarningAsErrorsVerboseAdditionalManifestFilesZAssemblyIdentityZComponentFileNameZGenerateCatalogFilesZInputResourceManifestsZOutputManifestFileZRegistrarScriptFileZReplacementsFileZUpdateFileHashesZUpdateFileHashesSearchPathZ VerboseOutputZManifestResourceFile EmbedManifestZDependencyInformationFileZUseFAT32WorkaroundZEnableDPIAwarenessZGenerateCategoryTagsZManifestFromManagedAssemblyZOutputResourceManifestsZSuppressDependencyElementUseSafeExceptionHandlers)8r rwsysrrrrrrrrr$r/r8r?rFrfZ_integer_stringZ _file_nameZ _folder_nameZ _file_listZ _folder_listZ _string_listZ_newly_booleanrSrPrXrVr_rargrpZfix_vc_macro_slashes_regex_listcompilejoinrryr~rrr-rrrr_compileZ_linkZ_midlZ_rcZ_libZ _manifestZ_masmZ_armasmZ_subsystem_enumerationZ_target_machine_enumerationrrrrs@  &*     0  $                                                                                                                                                                           o ۤ_c@s"dZddlmZGdddZdS)z$Visual Studio project reader/writer.Nc@s(eZdZdZddZddZddZdS) Writerz#Visual Studio XML tool file writer.cCs||_||_dg|_dS)zzInitializes the tool file. Args: tool_file_path: Path to the tool file. name: Name of the tool file. ZRulesN)tool_file_pathname rules_section)selfrrrBD:\a\_work\1\s\node_modules\node-gyp\gyp\pylib\gyp\MSVSToolFile.py__init__ s zWriter.__init__c Cs8d|||d|d|d|dg}|j|dS)a9Adds a rule to the tool file. Args: name: Name of the rule. description: Description of the rule. cmd: Command line of the rule. additional_dependencies: other files which may trigger the rule. outputs: outputs of the rule. extensions: extensions handled by the rule. ZCustomBuildRule;)NameExecutionDescription CommandLineOutputsZFileExtensionsAdditionalDependenciesN)joinrappend)rrcmd descriptionadditional_dependenciesoutputs extensionsrulerrrAddCustomBuildRules zWriter.AddCustomBuildRulecCs*dd|jd|jg}tj||jdddS)zWrites the tool file.ZVisualStudioToolFilez8.00)Versionr z Windows-1252)encodingN)rreasy_xmlWriteXmlIfChangedr)rcontentrrrWriteIfChanged2s  zWriter.WriteIfChangedN)__name__ __module__ __qualname____doc__r rrrrrrr s  r)r" gyp.easy_xmlrrrrrrs o ۤ_c@sJdZddlZddlZddlZddlmZddZddZGdddZdS) z+Visual Studio user preferences file writer.NcCshd|vsd|vr |Stjddtj}|D]}tj||}tj|r1t|tj r1|Sq|S)a{If there are no slashes in the command given, this function searches the PATH env to find the given command, and converts it to an absolute path. We have to do this because MSVS is looking for an actual file to launch a debugger on, not just a command line. Note that this happens at GYP time, so anything needing to be built needs to have a full path./\PATH) osenvirongetsplitpathseppathjoinisfileaccessX_OK)commandpathsr itemrBD:\a\_work\1\s\node_modules\node-gyp\gyp\pylib\gyp\MSVSUserFile.py_FindCommandInPathsrcCsXg}|D]%}|ddkrd|d}d|}n td|r$d|}||q|S)N"z""z"%s"z[ \t\n])findr r researchappend)argsnew_argsargrrr_QuoteWin32CommandLineArgs's   rc@s6eZdZdZddZddZidfddZd d Zd S) Writerz(Visual Studio XML user user file writer.cCs||_||_||_i|_dS)zInitializes the user file. Args: user_file_path: Path to the user file. version: Version info. name: Name of the user file. N)user_file_pathversionnameconfigurations)selfr!r"r#rrr__init__;s zWriter.__init__cCsdd|ig|j|<dS)zTAdds a configuration to the project. Args: name: Configuration name. ConfigurationNameN)r$)r%r#rrr AddConfigHszWriter.AddConfigrcCst|}t|d}|r t|tr dd|D}d|}nd}did|d|d d|d d d td |ddddddddddddddddddddddddddddddg}||jvrt| ||j| |d S) a;Adds a DebugSettings node to the user file for a particular config. Args: command: command line to run. First element in the list is the executable. All elements of the command will be quoted if necessary. working_directory: other files which may trigger the rule. (optional) rcSs g|] \}}|d|dqS)z="rr).0keyvalrrr `s z+Writer.AddDebugSettings.. rZ DebugSettingsCommandZWorkingDirectoryZCommandArgumentsNZ RemoteMachine EnvironmentZEnvironmentMergetrueZAttachfalseZ DebuggerType3ZRemote1Z RemoteCommandZHttpUrlZPDBPathZ SQLDebuggingZDebuggerFlavor0Z MPIRunCommandZMPIRunArgumentsZMPIRunWorkingDirectory)ZApplicationCommandZApplicationArgumentsZ ShimCommandZ MPIAcceptModeZMPIAcceptFilter) rr isinstancedictitemsr socket gethostnamer$r)r)r% config_namer environmentworking_directoryZ abs_commandZenv_listZn_cmdrrrAddDebugSettingsPsh      ! zWriter.AddDebugSettingscCsVdg}t|jD] \}}||q d|j|jd|g}tj||j dddS)zWrites the user file.ConfigurationsZVisualStudioUserFile)Versionr(z Windows-1252)encodingN) sortedr$r9rr"ProjectVersionr#easy_xmlWriteXmlIfChangedr!)r%configsconfigspeccontentrrrWriteIfChangeds  zWriter.WriteIfChangedN)__name__ __module__ __qualname____doc__r&r)r?rKrrrrr 8s  s o ۤ_c'@s`dZddlZddlZddddddZdd Zd d Zd d ZddZddZddZ ddZ dS)z8Utility functions shared amongst the Windows generators.Nexedlllibsys) executableloadable_moduleshared_librarystatic_librarywindows_drivercCsNtjtjt}tjtj|dd}tj|dd}tj|d}|S)z/Returns the path of the large_pdb_shim.cc file.z..datawinzlarge-pdb-shim.cc)ospathabspathdirname__file__join)this_dirsrc_dirZ win_data_dirlarge_pdb_shim_ccr>D:\a\_work\1\s\node_modules\node-gyp\gyp\pylib\gyp\MSVSUtil.py_GetLargePdbShimCcPaths rcCs.i}|D]}||vr qt||||<q|S)a-Performs a partial deep-copy on |in_dict|, only copying the keys in |keys|. Arguments: in_dict: The dictionary to copy. keys: The keys to be copied. If a key is in this list and doesn't exist in |in_dict| this is not an error. Returns: The partially deep-copied dictionary. )copydeepcopy)in_dictkeysdkeyrrr_DeepCopySomeKeyss  rcCs,|dd}|dd||d<d|S)zAdd a suffix to the end of a target. Arguments: name: name of the target (foo#target) suffix: the suffix to be added Returns: Target name with suffix added (foo_suffix#target) #r_)rsplitr)namesuffixpartsrrr _SuffixName0s  r'cCst|t|S)zAdd a shard number to the end of a target. Arguments: name: name of the target (foo#target) number: shard number Returns: Target name with shard added (foo_1#target) )r'str)r$numberrrr _ShardName>s r*c Csi}|D]}t||dd}|r|||<qg}|D]}||vr3t||D] }|t||q'q||qi}|D]U}||vrt||D]A}t||}t||||<t||d|||d<||dg} g} t|t| ||D] } | | | qz| ||d<qIq=||||<q=t|D]:}dD]5} t||| g} g}| D]}||vrt||D] }|t||qq||q|||| <qq||fS)a Shard some targets apart to work around the linkers limits. Arguments: target_list: List of target pairs: 'base/base.gyp:base'. target_dicts: Dict of target properties keyed on target pair. Returns: Tuple of the new sharded versions of the inputs. msvs_shardr target_namesources) dependenciesdependencies_original)intgetrangeappendr*rlensorted) target_list target_dictsZtargets_to_shardtZshardsnew_target_listiZnew_target_dictsr$r-Z new_sourcesposZdeptyper.Znew_dependenciesrrrr ShardTargetsJsT        r<c Cs|d|}|di}|di}|d}|r|S|di}|dd}|r+|S|d|d }d |t|d }|d d |}|S)aReturns the path to the PDB file that will be generated by a given configuration. The lookup proceeds as follows: - Look for an explicit path in the VCLinkerTool configuration block. - Look for an 'msvs_large_pdb_path' variable. - Use '<(PRODUCT_DIR)/<(product_name).(exe|dll).pdb' if 'product_name' is specified. - Use '<(PRODUCT_DIR)/<(target_name).(exe|dll).pdb'. Arguments: target_dict: The target dictionary to be searched. config_name: The name of the configuration of interest. vars: A dictionary of common GYP variables with generator-specific values. Returns: The path of the corresponding PDB file. configurations msvs_settings VCLinkerToolProgramDatabaseFile variablesZmsvs_large_pdb_pathN product_namer,z {}.{}.pdbtype PRODUCT_DIR/) setdefaultr1formatTARGET_TYPE_EXT) target_dict config_namevarsconfigmsvslinkerpdb_pathrAZpdb_baserrr _GetPdbPaths      rPcCsg}|D]}||}t|ddsq||qt}|D]}||}|d}t|gd}d} |d| } t|| } tj|} |dd| } | d| }t |}| |d<d |d <|g|d <| |gd g|d <d}|d|}t||}t |}||d<d|d <|g|d <| g|d<|d D]C\}}t |||}dD]}| |dq|di}|di}d|d<||d<|d|}|di}|di}d|d<||d<q|d| |d|||| <|||<|dg|q||fS)aInsert a shim target that forces the linker to use 4KB pagesize PDBs. This is a workaround for targets with PDBs greater than 1GB in size, the limit for the 1KB pagesize PDBs created by the linker by default. Arguments: target_list: List of target pairs: 'base/base.gyp:base'. target_dicts: Dict of target properties keyed on target pair. vars: A dictionary of common GYP variables with generator-specific values. Returns: Tuple of the shimmed version of the inputs. msvs_large_pdbrr,)r=default_configurationtoolsetZlarge_pdb_copyr"SHARED_INTERMEDIATE_DIRrEnonerCr-) destinationfilescopiesZlarge_pdb_shimr r.r=)msvs_precompiled_headermsvs_precompiled_sourcetestNr>VCCLCompilerTool3DebugInformationFormatProgramDataBaseFileNamer?trueGenerateDebugInformationr@)r0r1r3rrr'r rbasenamerritemsrPpoprFinsert)r6r7rKZtargets_to_shimr8rIrr,Z base_dictZ copy_suffixZcopy_target_nameZfull_copy_target_nameZshim_cc_basenameZ shim_cc_dirZ shim_cc_pathZ copy_dictZ shim_suffixZshim_target_nameZfull_shim_target_nameZ shim_dictrJrLrOrrMcompilerrNrrrInsertLargePdbShimssh                       rg) __doc__rr rHrrr'r*r<rPrgrrrrs    8 'o ۤ_cM@sdZddlZddlZddlZddlZddlZddlZddZGdddZddZ dd d Z d d Z d dZ dddZ ddZddZdddZdS)z3Handle version information related to Visual Stuio.NcGstjtjj|SNospathnormpathjoin)argsr AD:\a\_work\1\s\node_modules\node-gyp\gyp\pylib\gyp\MSVSVersion.pyJoinPathsr c@s~eZdZdZ  dddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZdS)VisualStudioVersionz1Information regarding a version of Visual Studio.Nc CsZ||_||_||_||_||_||_||_||_| |_| pg} | j dddd| |_ dS)NcSst|ddS)Nv)floatreplace)r r r r -sz.VisualStudioVersion.__init__..T)keyreverse) short_name descriptionsolution_versionproject_versionflat_sln uses_vcxprojr sdk_baseddefault_toolsetsortcompatible_sdks) selfrrrrrrrrrrr r r __init__s  zVisualStudioVersion.__init__cC|jSr)rrr r r ShortName0zVisualStudioVersion.ShortNamecCr )z(Get the full description of the version.)rr!r r r Description3zVisualStudioVersion.DescriptioncCr )z(Get the version number of the sln files.)rr!r r r SolutionVersion7r%z#VisualStudioVersion.SolutionVersioncCr )z6Get the version number of the vcproj or vcxproj files.)rr!r r r ProjectVersion;r%z"VisualStudioVersion.ProjectVersioncCr r)rr!r r r FlatSolution?r#z VisualStudioVersion.FlatSolutioncCr )z1Returns true if this version uses a vcxproj file.rr!r r r UsesVcxprojBr%zVisualStudioVersion.UsesVcxprojcCs|jrdpdS)z+Returns the file extension for the project.z.vcxprojz.vcprojr)r!r r r ProjectExtensionFsz$VisualStudioVersion.ProjectExtensioncCr )z/Returns the path to Visual Studio installation.)rr!r r r PathJr%zVisualStudioVersion.PathcCstjtj|jd|S)z+Returns the path to a given compiler tool. zVC/binr)rtoolr r r ToolPathNszVisualStudioVersion.ToolPathcCr )z\Returns the msbuild toolset version that will be used in the absence of a user override.)rr!r r r DefaultToolsetRsz"VisualStudioVersion.DefaultToolsetc Cs>|dvsJdtjdd}t|dd}|jr&|r&tj|r&|d|gStjdd kp5tjd d k}|jd krbt|jd d dd}|rHdnd}|dkrPdnd}|}||kr^|d|7}||gSt|jd d} |dkr|jdkr|jddkr|r| dgSt|jdddgS|dkrd}|jddkr|rd}| |gSdS)zLReturns a command (with arguments) to be used to set up the environment.)x86x64ztarget_arch not supportedZ WindowsSDKDirrBinz SetEnv.Cmd/PROCESSOR_ARCHITECTUREAMD64PROCESSOR_ARCHITEW64322017VC AuxiliaryBuildz vcvarsall.batamd64r0r1_2013eZ amd64_x86Common7ZToolsz vsvars32.bat x86_amd64N)renvirongetr rrexistsr) r target_archsdk_dirZ setup_pathZis_host_arch_x64 script_pathZ host_archZmsvc_target_archarg vcvarsallr r r _SetupScriptInternalWs@       z(VisualStudioVersion._SetupScriptInternalcCs.||}|d}tj|std||S)Nrz3%s is missing - make sure VC++ tools are installed.)rJrrrD Exception)rrEZ script_datarGr r r SetupScripts  zVisualStudioVersion.SetupScript)NN)__name__ __module__ __qualname____doc__rr"r$r&r'r(r*r+r,r.r/rJrLr r r r r s"   9r cCsttjdvrdStjtjdd|dd|g}|r |d|gtj |tj tj d}| d  d }|j r8dS|S) aUse reg.exe to read a particular key. While ideally we might use the win32 module, we would like gyp to be python neutral, so for instance cygwin python lacks this module. Arguments: sysdir: The system subdirectory to attempt to launch reg.exe from. key: The registry key to read from. value: The particular value to read. Return: stdout from reg.exe, or None for failure. )win32cygwinNZWINDIRrzreg.exequeryz/v)stdoutstderrrutf-8)sysplatformrrrrBrCextend subprocessPopenPIPE communicatedecode returncode)Zsysdirrvaluecmdptextr r r _RegistryQueryBases  rdc CsZd}z td||}W|Sty,}z|jtjkr td||}nWYd}~|Sd}~ww)aUse reg.exe to read a particular key through _RegistryQueryBase. First tries to launch from %WinDir%\Sysnative to avoid WoW64 redirection. If that fails, it falls back to System32. Sysnative is available on Vista and up and available on Windows Server 2003 and XP through KB patch 942589. Note that Sysnative will always fail if using 64-bit python due to it being a virtual directory and System32 will work correctly in the first place. KB 942589 - http://support.microsoft.com/kb/942589/en-us. Arguments: key: The registry key. value: The particular registry value to read (optional). Return: stdout from reg.exe, or None for failure. NZ SysnativeZSystem32)rdOSErrorerrnoENOENT)rr`rcr?r r r _RegistryQuerys  rhcCsddlm}m}m}z.|dd\}}|dksJ|||}|||dWdWS1s1wYWdStyBYdSw)aUse the _winreg module to obtain the value of a registry key. Args: key: The registry key. value: The particular registry value to read. Return: contents of the registry key's value, or None on failure. Throws ImportError if winreg is unavailable. r)HKEY_LOCAL_MACHINEOpenKey QueryValueEx\ZHKLMN)winregrirjrksplitre)rr`rirjrkrootsubkeyhkeyr r r _RegistryGetValueUsingWinRegs    ( rscCsPzt||WStyYnwt||}|sdStd|}|s#dS|dS)aUse _winreg or reg.exe to obtain the value of a registry key. Using _winreg is preferable because it solves an issue on some corporate environments where access to reg.exe is locked down. However, we still need to fallback to reg.exe for the case where the _winreg module is not available (for example in cygwin python). Args: key: The registry key. value: The particular registry value to read. Return: contents of the registry key's value, or None on failure. NzREG_\w+\s+([^\r]+)\r\nrm)rs ImportErrorrhresearchgroup)rr`rcmatchr r r _RegistryGetValues     ryFcCsx|rtj|}tdddddd||ddd gd td d dd dd||ddd gd tdddddd||ddd gd tdddddd||dd tdddddd||dd tdddddd||dd tdddd dd||d!d td"ddd dd||d!d td#d$d%d dd||d&td'd(d%d dd||d&td)d*d+d,dd||d&td-d*d+d,dd||d&td.d/d,d0dd||d&td1d/d,d0dd||d&d2}|t|S)3aSets up MSVS project generation. Setup is based off the GYP_MSVS_VERSION environment variable or whatever is autodetected if GYP_MSVS_VERSION is not explicitly specified. If a version is passed in that doesn't match a value in versions python will throw a error. 2022zVisual Studio 2022z12.0017.0FTZv143zv8.1zv10.0)rrrrrrrr2019zVisual Studio 201916.0Zv142r7zVisual Studio 201715.0Zv1412015zVisual Studio 201514.0Zv140)rrrrrrrr=zVisual Studio 2013z13.0012.0Zv1202013e2012zVisual Studio 2012z4.0Zv1102012e2010zVisual Studio 2010z11.00)rrrrrr2010ezVisual C++ Express 20102008zVisual Studio 2008z10.00z9.002008e2005zVisual Studio 2005z8.002005e)rzr|r7rr=rrrrrrrrr)rrrr str)namerrversionsr r r _CreateVersions:               rcCs8tjdkrtjd|gtjd}|dd}|S)z.Convert to cygwin path if we are using cygwin.rRcygpath)rTrrV)rWrXrZr[r\r]r^strip)rrbr r r _ConvertToCygpaths rc Cszddddddddd d }g}|D]}d |d |d |d|g}tt|D]N}t||d}|s2q&t|}tj|d}tj|d} |s]tj|r]|t ||tj|ddq&t | rt|t ||dtj|ddq&gd}tt|D]:}t|||}|sqt|}|dkrtj|r|t d|q|dkr|t ||dtj|dddqq|S)aCollect the list of installed visual studio versions. Returns: A list of visual studio versions installed in descending order of usage preference. Base this on the registry and a quick check if devenv.exe exists. Possibilities are: 2005(e) - Visual Studio 2005 (8) 2008(e) - Visual Studio 2008 (9) 2010(e) - Visual Studio 2010 (10) 2012(e) - Visual Studio 2012 (11) 2013(e) - Visual Studio 2013 (12) 2015 - Visual Studio 2015 (14) 2017 - Visual Studio 2017 (15) 2019 - Visual Studio 2019 (16) 2022 - Visual Studio 2022 (17) Where (e) is e for express editions of MSVS and blank otherwise. rrrrr=rr7r|rz) 8.09.010.011.0rrr~r}r{z'HKLM\Software\Microsoft\VisualStudio\%sz3HKLM\Software\Wow6432Node\Microsoft\VisualStudio\%sz$HKLM\Software\Microsoft\VCExpress\%sz0HKLM\Software\Wow6432Node\Microsoft\VCExpress\%sZ InstallDirz devenv.exez *express.exez..r?)z,HKLM\Software\Microsoft\VisualStudio\SxS\VC7z8HKLM\Software\Wow6432Node\Microsoft\VisualStudio\SxS\VC7z,HKLM\Software\Microsoft\VisualStudio\SxS\VS7z8HKLM\Software\Wow6432Node\Microsoft\VisualStudio\SxS\VS7r~rTr) rangelenryrrrrrDappendrglob) Zversions_to_checkZ force_expressZversion_to_yearrversionkeysindexr full_pathZ express_pathr r r _DetectVisualStudioVersionsst     rautoTcCs|dkr tjdd}dddddddddddd d d d d }tjd}|r8tjd}|s1tdt||ddSt|}t||d|v}|s[|sMtd|dkrVtddSt|dS|dS)zSelect which version of Visual Studio projects to generate. Arguments: version: Hook to allow caller to force a particular version (vs auto). Returns: An object representing a visual studio project format version. rZGYP_MSVS_VERSION) r{r}r~rrrrrr)r)r)r)r)r)r)r~)r})r{)rrrrrrrrrr=rrr7r|rzZGYP_MSVS_OVERRIDE_PATHz`GYP_MSVS_OVERRIDE_PATH requires GYP_MSVS_VERSION to be set to a particular version (e.g. 2010e).Trr?z,Could not locate Visual Studio installation.rNr)rrBrC ValueErrorrrr)rallow_fallbackZ version_mapZ override_path msvs_versionrr r r SelectVisualStudioVersionsF     rr)F)rT)rPrfrrurZrWrr r rdrhrsryrrrrr r r r s&  &\o ۤ_cV@sdZddlZddlZddlZddlZddlZddlmZddlZ ddl Z e dZ d0ddZ dd Zd d Zd d ZddZddZddZddZddZGdddZddZGdddZdaddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Z d,d-Z!d.d/Z"dS)1zg This module helps emulate Visual Studio 2008 behavior on top of other build systems, primarily ninja. N) OrderedSetz(\\*)"TcCs\|ddks|ddkrtj|}|rtdd|}|dd}|r,d|dS|S) zQuote a command line argument so that it appears as one argument when processed via cmd.exe and parsed by CommandLineToArgvW (as is typical for Windows programs)./rcSsd|ddS)Nr\")group)mor DD:\a\_work\1\s\node_modules\node-gyp\gyp\pylib\gyp\msvs_emulation.py)sz!QuoteForRspFile..%z%%")findcountospathnormpathwindows_quoter_regexsubreplace)arg quote_cmdr r r QuoteForRspFiles   rcsx|sdS|ddr |ddd\}}|dtj|}ntj|d}|ddfdd|ddDS) z6Process a list of arguments using QuoteCmdExeArgument.rzcall  rc3s|]}t|VqdSN)r).0rrr r Nz$EncodeRspFileList..N) startswithsplitrrrjoin)argsrcallprogramr rr EncodeRspFileList?sr&cCs.|s|S|s|St||d||ddS)zGiven a list of dictionary keys |path| and a tree of dicts |root|, find value at path, or return |default| if any of the path doesn't exist.rrN)_GenericRetrieveget)rootdefaultrr r r r'Qs r'cs:|dur|St|tst|trfdd|DS|S)zDAdd |prefix| to |element| or each subelement if element is iterable.Ncsg|]}|qSr r )reprefixr r az_AddPrefix..) isinstancelisttuple)elementr-r r,r _AddPrefix[s r4csZdur+|dur+tsjt|tst|tr'tdfdd|D}|S|}|S)zIf |element| then remap it through |map|. If |element| is iterable then each item will be remapped. Any elements not found will be removed.Ncsg|]}|qSr r )relemmapr r r.mr/z _DoRemapping..)callabler(r0r1r2filter)r3r7r r6r _DoRemappingfsr:cCsD|dur |dur t|tst|tr||dS||dS|S)zIf |append| is None, simply return |element|. If |append| is not None, then add |element| to it, adding each item in |element| if it's a list or tuple.N)r0r1r2extendappend)r<r3r r r _AppendOrReturnss r=cCsttdrtjStjd}|s;gd}tj|tjtjd}| d d}| D]}d|vr:| dd d }q+|t_|S) zTry to find an installation location for the DirectX SDK. Check for the standard environment variable, and if that doesn't exist, try to find via the registry. May return None if not found in either location. dxsdk_dirZ DXSDK_DIR)zreg.exequeryzHKLM\Software\Microsoft\DirectXz/s)stdoutstderrrutf-8Z InstallPathz \) hasattr_FindDirectXInstallationr>renvironr( subprocessPopenPIPE communicatedecode splitlinesr!)r>cmdpr@liner r r rFs   rFcCs^i}|r||d<tj|dd|d<t}|r |nd|d<tjdd|d<|S) zGet a dict of variables mapping internal VS macro names to their gyp equivalents. Returns all variables that are independent of the target.z$(VSInstallDir)VCrDz$(VCInstallDir)rz $(DXSDK_DIR)ZWDK_DIRz $(WDK_DIR))Pathrrr"rFrGr() vs_versionenvr>r r r GetGlobalVSMacroEnvs rUcst|ddg|ddD]}|dg}t|@qs#dStt|tfddD}tdd|Dr?dS|D]}|dg}|rXfdd|D}||d<qA|S) zFinds msvs_system_include_dirs that are common to all targets, removes them from all targets, and returns an OrderedSet containing them.rmsvs_system_include_dirsrNcsg|]}t|qSr ) ExpandMacrosrinclude)rTr r r.sz3ExtractSharedMSVSSystemIncludes..cSsg|]}d|vqS)$r rXr r r r.r/csg|]}|vr|qSr r )ri)all_system_includesr r r.)rr(rU GetVSVersionany)configsgenerator_flagsconfigsystem_includesZexpanded_system_includesincludesZ new_includesr )r\rTr ExtractSharedMSVSSystemIncludess&   rec@seZdZdZddZddZd]ddZd]d d Zd d Zd dZ GdddZ ddZ ddZ d^ddZ d^ddZddZddZddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd,d-Zd.d/Zd0d1Zd2d3Zd4d5Zd6d7Zd8d9Zd:d;Zdd?Z!d@dAZ"dBdCZ#dDdEZ$dFdGZ%dHdIZ&dJdKZ'dLdMZ(e)*dNdOdPgZ+dQdRZ,dSdTZ-dUdVZ.dWdXZ/dYdZZ0d[d\Z1dS)_ MsvsSettingszA class that understands the gyp 'msvs_...' values (especially the msvs_settings field). They largely correpond to the VS2008 IDE DOM. This class helps map those settings to command line options.c Cs||_t||_dtfdtfdtfdtfdtfdtfdtfdtfg}|d }|D]\}}t||i|D]\}}|||t |||<q6q(|d d g|_ d d g} g} | D]}| D]}||vro| d ||dg7} q^qX| rzt d| dS)Nmsvs_configuration_attributes msvs_settingsrVmsvs_disabled_warningsmsvs_precompiled_headermsvs_precompiled_sourcemsvs_configuration_platformmsvs_target_platformconfigurationsmsvs_cygwin_dirs. msvs_prebuildmsvs_postbuildz{} not supported (target {}). target_name )specr^rSdictr1strsetattritemsr(getattrrovaluesformat Exceptionr") selfruraZsupported_fieldsr`fieldr*Z confignamerbZunsupported_fieldsZ unsupportedr r r __init__sF    zMsvsSettings.__init__cCs,|jdd}|r |Stjj|jddS)zReturns the extension for the target, with no leading dot. Uses 'product_extension' if specified, otherwise uses MSVS defaults based on the target type. product_extensionNtyper)rur(gypMSVSUtilTARGET_TYPE_EXT)r~extr r r GetExtensionszMsvsSettings.GetExtensionNc Cs||}|dkr d}n|}|jdd|jd|jd}|r%|dnd}d|}||}d d d ||d|jd||||tj||d } | t|j | S) zYGet a dict of variables mapping internal VS macro names to their gyp equivalents.x86Win32product_prefixr product_namersrDrpz${root}z ${source}z$!INTERMEDIATE_DIR) z $(InputName)z $(InputPath)z $(IntDir)z $(OutDir)\z$(PlatformName)z$(ProjectDir)\z$(ProjectName)z $(TargetDir)\z $(TargetExt)z$(TargetFileName)z $(TargetName)z $(TargetPath)) GetArchrur(rrrr"updaterUrS) r~ base_to_buildrb target_archtarget_platformrs target_dir target_extZtarget_file_nameZ replacementsr r r GetVSMacroEnvs2    zMsvsSettings.GetVSMacroEnvcCs|j||d}t||S)z4Convert from VS macro names to something equivalent.rb)rrW)r~srrbrTr r r ConvertVSMacross zMsvsSettings.ConvertVSMacroscCsdd|D}dd|DS)z2Strip -l from library if it's specified with that.cSs&g|]}|dr|ddn|qS)z-lrNr rlibr r r r.%s&z0MsvsSettings.AdjustLibraries..cSs4g|]}|ds|ds|dn|qS)z.libz.objlowerendswithrr r r r.&s   r )r~ librarieslibsr r r AdjustLibraries#szMsvsSettings.AdjustLibrariescCs*t|||}t||}t||}t||S)aRetrieve a value from |field| at |path| or return |default|. If |append| is specified, and the item is found, it will be appended to that object instead of returned. If |map| is specified, results will be remapped through |map| before being returned or appended.)r'r:r4r=)r~rrr*r-r<r7resultr r r _GetAndMunge-s    zMsvsSettings._GetAndMungec@s eZdZdddZdddZdS) zMsvsSettings._GetWrapperNcCs||_||_|g|_||_dSr)parentr base_pathr<)r~rrrr<r r r r8s z!MsvsSettings._GetWrapper.__init__rcCs$|jj|j|j|g|||j|dS)N)r*r-r<r7)rrrrr<)r~namer7r-r*r r r __call__>s z!MsvsSettings._GetWrapper.__call__r)NrN)__name__ __module__ __qualname__rrr r r r _GetWrapper7s rcCs8|j|d}|j|d}|s|}dddd|dS)zvGet architecture based on msvs_configuration_platform and msvs_target_platform. Returns either 'x86' or 'x64'.rrx64arm64)rrARM64)rlr(rm)r~rbZconfiguration_platformplatformr r r rHs zMsvsSettings.GetArchcCs^t|jjdkr |S||}|dkr|ds|d7}|dkr-|dr-|ddd}|S)z*Returns the target-specific configuration.ir_x64r_rr)intrS short_namerrrsplit)r~rbarchr r r _TargetConfigRs zMsvsSettings._TargetConfigrcC||j||||||S)z_GetAndMunge for msvs_settings.)rrhr~rrbr*r-r<r7r r r _SettingdszMsvsSettings._SettingcCr)z/_GetAndMunge for msvs_configuration_attributes.)rrgrr r r _ConfigAttribjszMsvsSettings._ConfigAttribcB|j}|jdgdfdd|DS)z}Updates include_dirs to expand VS specific paths, and adds the system include dirs used for platform SDK and similar.)VCCLCompilerToolAdditionalIncludeDirectoriesr*cg|] }j|dqSrrrrOrbr~r r r.z2MsvsSettings.AdjustIncludeDirs..rrVr;r)r~ include_dirsrbrdr rr AdjustIncludeDirsw zMsvsSettings.AdjustIncludeDirscr)zUpdates midl_include_dirs to expand VS specific paths, and adds the system include dirs used for platform SDK and similar.) VCMIDLToolrrcrrrrrr r r.rz6MsvsSettings.AdjustMidlIncludeDirs..r)r~midl_include_dirsrbrdr rr AdjustMidlIncludeDirsrz"MsvsSettings.AdjustMidlIncludeDirscCs`||}g}|dg|dkr|d|dg|dkr#|d||jd|gd|S)zdReturns the set of defines that are injected to the defines list based on other VS settings. CharacterSet1)Z_UNICODEUNICODE2Z_MBCS)rPreprocessorDefinitionsr)rrr;r<r)r~rbdefinesr r r GetComputedDefiness   zMsvsSettings.GetComputedDefinescCs,||}|d|}|r|||}|S)zzGet the pdb file name that should be used for compiler invocations, or None if there's no explicit name specified.)rProgramDataBaseFileNamerrr)r~rbexpand_specialpdbnamer r r GetCompilerPdbNames  zMsvsSettings.GetCompilerPdbNamecC0||}|d|}|r||j||d}|S)zbGets the explicitly overridden map file name for a target or returns None if it's not set.) VCLinkerToolZ MapFileNamerr)r~rbrmap_filer r r GetMapFileNames  zMsvsSettings.GetMapFileNamecCsN||}|jd}|dkrdnd}||df|}|r%||j||d}|S)zgGets the explicitly overridden output name for a target or returns None if it's not overridden.rstatic_libraryVCLibrarianToolr OutputFiler)rrurr)r~rbrrr) output_filer r r GetOutputNames   zMsvsSettings.GetOutputNamecCsH||}|d|}|d|}|dkr"|r ||j||dS|SdS)zGets the explicitly overridden pdb name for a target or returns default if it's not overridden, or if no pdb will be generated.)rZProgramDatabaseFile)rGenerateDebugInformationtruerNr)r~rbrr*rZgenerate_debug_infor r r GetPDBNames  zMsvsSettings.GetPDBNamecC||}|d|}|dkS)z`If NoImportLibrary: true, ninja will not expect the output to include an import library.)ZNoImportLibraryrrr)r~rbZnoimplibr r r GetNoImportLibrary  zMsvsSettings.GetNoImportLibrarycCs0||}g}|d|}|dkr|d|S)z:Returns the flags that need to be added to ml invocations.)MASMZUseSafeExceptionHandlersrz/safeseh)rrr<)r~rbasmflagsZsafesehr r r GetAsmflagss   zMsvsSettings.GetAsmflagscCs||}g}|dd|j|D|j||j|d|d}|ddddd d d dd |d dd|ddd|dddid|dddid|dddddd|dddddd|d d!d"d#d d|d$d%d&d'd(d)d*d |d+dd,dd|d-dd.id|d/d0d|d1dd2id|d3dd4d5d6d d7d|d8d9d:d;d<d=d|d>d?d@dAd|dBdCdDdAd|dEddFid|dGdHdIdAd|dJd"dKddLdMd|dNdOdPdQdRd dSd|dTdUdVd#dWd|dXddYid|dZdddd[d|d\dd]id|d^dd|d_d`dadbdcdddedfd|dgd|jdh|gdiDt|jjdjkr8| dkdld|D}|S)mzCReturns the flags that need to be added to .c and .cc compilations.cSg|]}d|qS)/wdr )rwr r r r.r/z*MsvsSettings.GetCflags..rr<Z Optimizationdrrx)0rr3z/Or7r-r*ZInlineFunctionExpansionz/Obr,DisableSpecificWarningsrZ StringPoolingrz/GFr6ZEnableFiberSafeOptimizationsz/GTZOmitFramePointers-rfalserz/Oyr7r-ZEnableIntrinsicFunctionsz/OiZFavorSizeOrSpeedtrrrZFloatingPointModelZprecisestrictfastrrrz/fp:rZCompileAsManagedz/clrZWholeProgramOptimizationz/GLZ WarningLevelz/WZ WarnAsError/WXZCallingConventionrzvz/GZDebugInformationFormat7r[I)rr4z/ZZRuntimeTypeInfoz/GRz/GR-rrZEnableFunctionLevelLinkingz/Gyz/Gy-ZMinimalRebuildz/GmZBufferSecurityCheckz/GSz/GS-ZBasicRuntimeChecksu)rrrz/RTCZRuntimeLibraryTZTdDZDdz/MZExceptionHandlingZscaz/EHZDefaultCharIsUnsignedz/JZTreatWChar_tAsBuiltInTypez /Zc:wchar_tZ EnablePREfastz/analyzeAdditionalOptionsZEnableEnhancedInstructionSetZSSEZSSE2ZAVXZIA32ZAVX2)rrrr5z/arch:cSr)/FIr rfr r r r.s)rForcedIncludeFilesrg(@z/FScSsg|] }|ds|qS)z/MPrrrr r r r.*r) rr;rirrhrfloatrSZproject_versionr<)r~rbcflagsZclr r r GetCflagss          zMsvsSettings.GetCflagscCsl||}|j|r4tj|j|d}t||r4|j|}tj|d}d|d|d|dgSgS)zGGet the flags to be added to the cflags for precompiled header support.rz/Yur z/Fp${pchprefix}.z.pch)rrjrrsplitextrk_LanguageMatchesForPchr!)r~rb extension source_extpchZpchbaser r r _GetPchFlags-s    zMsvsSettings._GetPchFlagscCs||}||dS)z;Returns the flags that need to be added to .c compilations..crrr~rbr r r GetCflagsC;s  zMsvsSettings.GetCflagsCcCs||}dg||dS)z.cSsg|]}d|dqS)z /LIBPATH:"r r rr r r r.Pr]r)r~r)rbr"Zlibpathsr r!r _GetAdditionalLibraryDirectoriesEs  z-MsvsSettings._GetAdditionalLibraryDirectoriescCsl||}g}|j||j|d|d}||d|||dddid|ddd d d d d |d|S)z8Returns the flags that need to be added to lib commands.rrLinkTimeCodeGenerationr/LTCGr6 TargetMachineX86X64ARM)r17r /MACHINE:rr)rrrhr;r$)r~rbr"libflagsrr r r GetLibFlagsRs$  zMsvsSettings.GetLibFlagscCsX|j}|ddvr*dd|dgD}t|dkr ||dSt|dkr*tdd S) zDReturns the .def file from sources, if any. Otherwise returns None.r)shared_libraryloadable_module executablecSsg|] }|dr|qS)z.defrrrr r r r.ks z+MsvsSettings.GetDefFile..sourcesrrzMultiple .def filesN)rur(lenr})r~r"ru def_filesr r r GetDefFilegs     zMsvsSettings.GetDefFilecCs$||}|r|d|dSdS)z.def files get implicitly converted to a ModuleDefinitionFile for the linker in the VS generator. Emulate that behaviour here.z /DEF:"%s"N)r6r<)r~ldflagsr"def_filer r r _GetDefFileAsLdflagsts z!MsvsSettings._GetDefFileAsLdflagscCr)zdGets the explicitly overridden pgd name for a target or returns None if it's not overridden.)rZProfileGuidedDatabaserr)r~rbrrr r r GetPGDName{s   zMsvsSettings.GetPGDNamecCst||}g}|j||j|d|d} |||| dddid| ddd d d d d d||d||| ddd| dddddd|||} | rV|d| ||||d} | rh|d| | ||} | rw|d| | ||} | dd| rd| ndid| ddd id| d!dd|j d"|dd#}|rd$|}| d%d&|d'|d(d)d|j d*|dd#}|r|j d+|dd#}|rd$|}|d,||| d-ddd(d.d| d/ddd(d0d| d1d2d| d3ddd(d4d| d5ddd(d6d| d7ddd(d8d| d9d:d;d(dd| d?d@dAd(d.css|]}d|vVqdS)ZNXCOMPATNr rAr r r rscss|]}|dVqdS)z/DEF:NrrAr r r rr)rrrhr9r;r$rr<rr:rrrr__GetLdManifestFlags)r~rbr"rmanifest_base_name output_name is_executable build_dirr7ldoutpdbZpgdrZminimum_required_versionZstack_reserve_sizeZstack_commit_sizeZsafeseh_defaultZ have_def_fileZmanifest_flagsintermediate_manifestmanifest_filesr r r GetLdflagss                    zMsvsSettings.GetLdflagscCs$|jd|dd}|dkrdgggfS|d}dd|g}|d||}|jd |dd} g} d } | dkrU|jd |d d} d ddd} |jd|dd}d| | |}nd}| |}|d}tj||}tj |tj |}| || |g} |r|d| | ||7} ||| fS)aReturns a 3-tuple: - the set of flags that need to be added to the link to generate a default manifest - the intermediate manifest that the linker will generate that should be used to assert it doesn't add anything to the merged one. - the list of all the manifest files to be merged by the manifest tool and included into the link.)rZGenerateManifestrrz /MANIFEST:NOz.intermediate.manifestz /MANIFESTz/ManifestFile:z/MANIFESTUAC:NO)rZ EnableUACz%s)rZUACExecutionLevelrZ asInvokerZhighestAvailableZrequireAdministratorr)rZ UACUIAccessrz rz.generated.manifestz/ALLOWISOLATION)rr<rr|rrr"rcommonEnsureDirExists WriteOnDiffwriteclose_GetAdditionalManifestFiles)r~rbrr"Zallow_isolationrGZgenerate_manifestrEflagsZ enable_uacrLZgenerated_manifest_outerZexecution_levelZexecution_level_mapZ ui_accessinnerZgenerated_manifest_contentsZgenerated_nameZbuild_dir_generated_namer r r r rC s^          z MsvsSettings._GetLdManifestFlagscs:jdgd}t|tr|d}fdd|DS)zaGets additional manifest files that are added to the default one generated by the linker.)VCManifestToolZAdditionalManifestFilesr;c rrr r r!r r r.qr#z.)rr0rwr!)r~rbr"filesr r!r rSis  z(MsvsSettings._GetAdditionalManifestFilescCr)z~Returns whether the target should be linked via Use Library Dependency Inputs (using component .objs of a given .lib).)rUseLibraryDependencyInputsrr)r~rbZuldir r r IsUseLibraryDependencyInputsvrz)MsvsSettings.IsUseLibraryDependencyInputscCs"||}|jd|dd}|dkS)z6Returns whether manifest should be linked into binary.)rVZ EmbedManifestrrr)r~rbembedr r r IsEmbedManifest}s zMsvsSettings.IsEmbedManifestcCs||}|d|}|dkS)z:Returns whether the target should be linked incrementally.)rr>rr)r~rbZlink_incr r r IsLinkIncrementals  zMsvsSettings.IsLinkIncrementalcCsh||}g}|j||j|d|d}|d|dd|d|d|ddd |d d d d d|S)zXReturns the flags that need to be added to invocations of the resource compiler.VCResourceCompilerToolrrz/Irrprz/dr,ZCulturez/lcSstt|ddS)Nr)hexrrr r r r r/z)MsvsSettings.GetRcflags..r<)rrrhr<)r~rbZgyp_to_ninja_pathrcflagsrcr r r GetRcflagss  zMsvsSettings.GetRcflagscCsptjtj||jd}d|dd}dd|D}dd|D}d|}d |d |d |d }|S) akBuild a command line that runs args via cygwin bash. We assume that all incoming paths are in Windows normpath'd form, so they need to be converted to posix style for the part of the command line that's passed to bash. We also have to do some Visual Studio macro emulation here because various rules use magic VS names for things. Also note that rules that contain ninja variables cannot be fixed here (for example ${source}), so the outer generator needs to make sure that the paths that are written out are in posix style, if the command line will be used here.rzcd %srDrcSs g|] }|ddddqS)rDrr rrrrr r r r.s z;MsvsSettings.BuildCygwinBashCommandLine..cSsg|] }d|ddqS)z'%s''z'\''rdrer r r r.rz1call "%s\setup_env.bat" && set CYGWIN=nontsec && z bash -c "z ; r )rrrr"ror)r~r#Z path_to_base cygwin_dircdZbash_cmdrNr r r BuildCygwinBashCommandLines  z'MsvsSettings.BuildCygwinBashCommandLineRuleShellFlagscygwinquotecCsRt|d|jdddk}t|dd}|dks#|dks#Jdt||S)zReturn RuleShellFlags about how the given rule should be run. This includes whether it should run under cygwin (msvs_cygwin_shell), and whether the commands should be quoted (msvs_quote_cmd).msvs_cygwin_shellrrmsvs_quote_cmdz8msvs_quote_cmd=0 only applicable for msvs_cygwin_shell=0)rr(rurfrk)r~rulerlrr r r GetRuleShellFlagss  zMsvsSettings.GetRuleShellFlagscCs(|dgD] }|d|krdSqdS)zADetermine if there's an explicit rule for a particular extension.rulesrTFr()r~rurrpr r r _HasExplicitRuleForExtensions  z)MsvsSettings._HasExplicitRuleForExtensioncCstdd|dgDS)z:Determine if an action should not run midl for .idl files.cSsg|]}|ddqS)Zexplicit_idl_actionrrs)ractionr r r r.r]z7MsvsSettings._HasExplicitIdlActions..actions)r_r(r~rur r r _HasExplicitIdlActionssz#MsvsSettings._HasExplicitIdlActionscCs||dp ||S)zDetermine if there's an explicit rule or action for idl files. When there isn't we need to generate implicit rules to build MIDL .idl files.idl)rtrxrwr r r HasExplicitIdlRulesOrActionss z)MsvsSettings.HasExplicitIdlRulesOrActionscCs ||dS)zDetermine if there's an explicit rule for asm files. When there isn't we need to generate implicit rules to assemble .asm files.asm)rtrwr r r HasExplicitAsmRuless z MsvsSettings.HasExplicitAsmRulescsjddfdd }|ddd}|dd d}|d d d}|d d d}|ddd}|ddd} ||||g} d|fd|fd|fd|fd|fg} } | dkr^d} ddd| dg} | | | | fS)zDetermine the implicit outputs for an idl file. Returns output directory, outputs, and variables and flags that are required.rNcsj||ddS)Nrrr)rr*rbZmidl_getr~r r midlsz*MsvsSettings.GetIdlBuildData..midlZTypeLibraryNamez ${root}.tlbrZHeaderFileNamez ${root}.hZDLLDataFileNamez dlldata.cZInterfaceIdentifierFileNamez ${root}_i.cZ ProxyFileNamez ${root}_p.cOutputDirectoryrtlbhdlldataiidproxyrwin32z/charsignedz/envz/Oicfr)rrrhr)r~sourcerbr~rheaderrrroutdiroutput variablesrrTr r}r GetIdlBuildDatas*          zMsvsSettings.GetIdlBuildData)NN)NrNN)2rrr__doc__rrrrrrrrrrrrrrrrrrrrrrrrr$r.r6r9r:rMrCrSrZr\r]rcrj collections namedtuplerkrqrtrxrzr|rr r r r rfs`&           N   ^  rfcCs(d}d}||vr ||vp||vo||vS)N)r)rz.cxxz.cppr )rZpch_source_extZc_extsZcc_extsr r r rs rc@s8eZdZdZddZddZddZdd Zd d Zd S) PrecompiledHeaderzHelper to generate dependencies and build rules to handle generation of precompiled headers. Interface matches the GCH handler in xcode_emulation.py. c CsJ||_||_|jj|j}|||_tj|\}}||||_dSr) settingsrbrk pch_sourcerrrr output_obj) r~rrbr"Zgyp_to_unique_outputobj_extrfilenamerr r r rs  zPrecompiledHeader.__init__cCs|jj|jS)zQGet the header that will appear in an #include line for all source files.)rrjrb)r~r r r _PchHeaderszPrecompiledHeader._PchHeadercCs`|dusJ|s gStj|jd}|D]}ttj|d|r-dd|jfgSqgS)aGiven a list of sources files and the corresponding object files, returns a list of the pch files that should be depended upon. The additional wrapping in the return value is for interface compatibility with make.py on Mac, and xcode_emulation.py.Nr)rrrrrrr)r~r3ZobjsrZpch_extrr r r GetObjDependenciess z$PrecompiledHeader.GetObjDependenciescCsgS)zNot used on Windows as there are no additional build steps required (instead, existing steps are modified in GetFlagsModifications below).r )r~rr r r GetPchBuildCommands%sz%PrecompiledHeader.GetPchBuildCommandsc Csj||jkr0d|g}|dkrdt|||fg|jgfS|dkr0dt|||fg|jgfSg||fS)zkGet the modified cflags and implicit dependencies that should be used for the pch compilation step.z/Yccxx cflags_cccccflags_c)rrr7r) r~inputrimplicitcommandrrrZ pch_outputr r r GetFlagsModifications*s  z'PrecompiledHeader.GetFlagsModificationsN) rrrrrrrrrr r r r rs  rcCs tstjj|ddddatS)N msvs_versionautoF)Zallow_fallback)rSr MSVSVersionSelectVisualStudioVersionr()rar r r r^Cs  r^cCst|}|Sr)r^ SetupScript)rarvsr r r _GetVsvarsSetupArgsLsrcCs:d|vr|D]\}}d|vsJ||||}q|S)z}Expand $(Variable) per expansions dict. See MsvsSettings.GetVSMacroEnv for the canonical way to retrieve a suitable dict.rZz$()ryr)stringZ expansionsoldnewr r r rWQs rWcCsd}i}|ddkrtd||D]1}|D],}t|d|rE|dd\}}|dkr=tj t j tj |}||| <nqqdD] }||vrUtd|qI|S) z}Extracts environment variables required for the toolchain to run from a textual dump output by the cmd.exe 'set' command.) zgoma_.*rYrlibpathrpathextZ systemrootZtemptmp=rz#Invalid output_of_set. Value is: %srr)Z SYSTEMROOTTEMPTMPz:Environment variable "%s" required to be set to valid path)rr}rMrematchrr!rrdirnamesysr1pathsepupper)Z output_of_setZenvvars_to_saverTrPZenvvarvarsettingrequiredr r r _ExtractImportantEnvironment[s.     rcCs:d}d}|D]\}}||d||7}q||7}|S)zFormat as an 'environment block' directly suitable for CreateProcess. Briefly this is a list of key=value, terminated by an additional . See CreateProcess documentation for more details.rr)ry)Z envvar_dictblocknulkeyvaluer r r _FormatAsEnvironmentBlocks rcCs8|D]}|dr|tddSqdS)zGets the path to cl.exe based on the output of calling the environment setup batch file, followed by the equivalent of `where`.zLOC:N)striprMr r4)Zoutput_of_whererPr r r _ExtractCLPaths  rcCsFd}|ddri}|D]}d||<q |St|}i}|D]}||}|dtj|dtjtjd} | d d} | j dkrKt d || j ft | } |re|t | d d d B}d || d <t| } |tj|d |d} | | | ||}|dtj|dtjd} | d d}t|||<q|S)aIt's not sufficient to have the absolute path to the compiler, linker, etc. on Windows, as those tools rely on .dlls being in the PATH. We also need to support both x86 and x64 compilers within the same build (to support msvs_target_platform hackery). Different architectures require a different compiler binary, and different supporting environment variables (INCLUDE, LIB, LIBPATH). So, we extract the environment here, wrap all invocations of compiler tools (cl, link, lib, rc, midl, etc.) via win_tool.py which sets up the environment, and then we do not prefix the compiler with an absolute path, instead preferring something like "cl.exe" in the rule which will then run whichever the environment setup has put in the path. When the following procedure to generate environment files does not meet your requirement (e.g. for custom toolchains), you can pass "-G ninja_use_custom_environment_files" to the gyp to suppress file generation and use custom environment files prepared by yourself.)rr"ninja_use_custom_environment_filesrzcl.exe)&&setT)shellr@rArBz"%s" failed with error %dINCLUDErrWz environment.r)rforz%iinz(cl.exe)Zdoz@echoz LOC:%~$PATH:i)rr@)r(r^rr;rHrIrJSTDOUTrKrL returncoder}rrr!r"rrrrQrRr)Ztoplevel_build_dirrarcZopen_outarchscl_pathsrrr#popenrrTZ env_blockr rr r r GenerateEnvironmentFilessF        rcslt|ddr2tdd|}fdd|D}dd|D}|r4dd|D}td d |d Sd S) amEmulate behavior of msvs_error_on_missing_sources present in the msvs generator: Check that all regular source files, i.e. not created at run time, exist on disk. Missing files cause needless recompilation when building via VS, and we want this check to match for people/bots that build using ninja, so they're not surprised when the VS build fails.msvs_error_on_missing_sourcesrcSsd|vS)NrZr r`r r r r sz&VerifyMissingSources..csg|] }tj|qSr )rrr"r2rG gyp_to_ninjar r r.sz(VerifyMissingSources..cSsg|] }tj|s|qSr )rrexistsrr r r r.rgcSsg|]}tj|qSr )rrrrr r r r.r]zMissing input files: %srtN)rr(r9r}r")r3rGrarZ no_specialsZrelativemissingZ cleaned_upr rr VerifyMissingSourcessrcCs`|di}tj|}||d<dtjddvs$dtjddvr*d|d<dSd |d<dS) Nra MSVS_VERSION64PROCESSOR_ARCHITECTURErPROCESSOR_ARCHITEW6432@ MSVS_OS_BITS )r(rmsvs_emulationr^ ShortNamerrG)default_variablesparamsrarr r r CalculateCommonVariabless     r)T)#rrrrrHr gyp.commonr gyp.MSVSUtilrgyp.MSVSVersioncompilerrr&r'r4r:r=rFrUrerfrrrSr^rrWrrrrrrr r r r sL   (    9=  (  < o ۤ_c@s.dZddlZddZGdddZddZdS) zPython module for generating .ninja files. Note that this is emphatically not a required piece of Ninja; it's just a helpful utility for build-file-generation systems that already use Python. NcCs|ddddddS)Nz$ z$$  :z$:replace)wordrBD:\a\_work\1\s\node_modules\node-gyp\gyp\pylib\gyp\ninja_syntax.py escape_pathsr c@seZdZdddZddZddZd d d Zd d Z   d!ddZ d"ddZ ddZ ddZ ddZ ddZ d ddZddZd S)#WriterNcCs||_||_dSN)outputwidth)selfr rrrr__init__s zWriter.__init__cCs|jddS)N )r write)rrrrnewlineszWriter.newlinecCs0t||jdD] }|jd|dq dS)Nz# r)textwrapwraprr r)rtextlinerrrcommentszWriter.commentrcCs@|durdSt|trdtd|}||d||dS)Nrz = ) isinstancelistjoinfilter_line)rkeyvalueindentrrrvariables  zWriter.variablecCs"|d||jd|dddS)Nzpool %sdepthr!rr")rnamer#rrrpool&sz Writer.poolNFc Cs|d||jd|dd|r|jd|dd|r#|jd|dd|r-|jdddd|r7|jd |dd|rA|jd ddd|rK|jd |dd| rU|jd | dd| ra|jd | dddSdS)Nzrule %scommandr$r% descriptiondepfile generator1r(restatrspfilerspfile_contentdepsr&) rr'r)r*r+r,r(r.r/r0r1rrrrule*s& z Writer.rulec Cs||}||dd}ttt|}ttt|}|r0tt||}|d|||rDtt||}|d|||dd|d|g||rwt |t rdt | } nt |} | D] \} } |j | | ddqj|S)N|z||z build {}: {}rr$r%)_as_listrmapr appendextendrformatrrdictiteritemsr") routputsr2inputsimplicit order_only variables all_inputsZ out_outputsiteratorrvalrrrbuildJs,       z Writer.buildcC|d|dS)Nz include %srrpathrrrincludejzWriter.includecCrE)Nz subninja %srFrGrrrsubninjamrJzWriter.subninjacCs|dd||dS)Nz default %sr)rrr4)rpathsrrrdefaultpszWriter.defaultcCsHd}|d}|dkr"||dkr"|d7}|d8}|dkr"||dks|S)zs  o ۤ_c @sdZGdddeZddgZddZiZZddZee e e e e dfZ e D]Zeee<q&dd Zeee<d d Zeee<[dS) zA clone of the default copy.deepcopy that doesn't handle cyclic structures or complex types except for dicts and lists. This is because gyp copies so large structure that small copy overhead ends up taking seconds in a project the size of Chromium.c@s eZdZdS)ErrorN)__name__ __module__ __qualname__rrAD:\a\_work\1\s\node_modules\node-gyp\gyp\pylib\gyp\simple_copy.pyr srdeepcopycCs6z tt||WStytddt|w)zDeep copy operation on gyp objects such as strings, ints, dicts and lists. More than twice as fast as copy.deepcopy but much less generic.z4Unsupported type %s for deepcopy. Use copy.deepcopy zor expand simple_copy support.)_deepcopy_dispatchtypeKeyErrorrxrrrrs  cCs|SNrr rrr_deepcopy_atomic#srNcCsdd|DS)NcSsg|]}t|qSr)r).0arrr .sz"_deepcopy_list..rr rrr_deepcopy_list-srcCs*i}|D] \}}t||t|<q|Sr )itemsr)r ykeyvaluerrr_deepcopy_dict4sr)__doc__ Exceptionr__all__rrdrboolfloatintstrr typesr rlistrdictrrrrs o ۤ_c?@s*dZddlZddlZddlZddlZddlZddlZddlZddl Z ddlm Z da da d1ddZ GdddZdd ZGd d d ZGd d d ZddZddZddZddZddZddZddZddZ d1ddZd d!Zd"d#Zd$d%Z d1d&d'Zd2d)d*Zd+d,Z d-d.Z!d/d0Z"dS)3z~ This module contains classes that help to emulate xcodebuild behavior on top of other build systems, such as make and ninja. N)GypErrorcCsd|i}|r ||d<|S)zConstructs a dictionary with expansion for $(ARCHS_STANDARD) variable, and optionally for $(ARCHS_STANDARD_INCLUDING_64_BIT).$(ARCHS_STANDARD)"$(ARCHS_STANDARD_INCLUDING_64_BIT))archsZarchs_including_64_bitmappingrrED:\a\_work\1\s\node_modules\node-gyp\gyp\pylib\gyp\xcode_emulation.pyXcodeArchsVariableMappingsr c@s:eZdZdZedZddZddZddZ d d Z d S) XcodeArchsDefaultzA class to resolve ARCHS variable from xcode_settings, resolving Xcode macros and implementing filtering by VALID_ARCHS. The expansion of macros depends on the SDKROOT used ("macosx", "iphoneos", "iphonesimulator") and on the version of Xcode. z\$\([a-zA-Z_][a-zA-Z0-9_]*\)$cCs|f|_|||d|_dS)N)maciosiossim)_default_archs)selfdefaultr iphonesimulatoriphoneosrrr__init__2szXcodeArchsDefault.__init__cCs6|}d|vr |jdSd|vr|jdS|jdS)zDReturns the dictionary of variable mapping depending on the SDKROOT.rr rr r )lowerr)rsdkrootrrr_VariableMapping6s    z"XcodeArchsDefault._VariableMappingc Cs||}g}|D]7}|j|r7|}z||}|D] }||vr%||qWq ty6td|Yq w||vr@||q |S)z=Expands variables references in ARCHS, and remove duplicates.z,Warning: Ignoring unsupported variable "%s".)rvariable_patternmatchappendKeyErrorprint)rrrZvariable_mappingexpanded_archsarchvariableZvariable_expansionrrr _ExpandArchs@s&     zXcodeArchsDefault._ExpandArchscCsB||p|j|p d}|rg}|D] }||vr||q|}|S)zExpands variables references in ARCHS, and filter by VALID_ARCHS if it is defined (if not set, Xcode accept any value in ARCHS, otherwise, only values present in VALID_ARCHS are kept).)r rr)rrZ valid_archsrrZfiltered_archsrrrr ActiveArchsRs zXcodeArchsDefault.ActiveArchsN) __name__ __module__ __qualname____doc__recompilerrrr r"rrrrr (s  r cCstrtSt\}}|dkrtdtdgtdgtdgatS|dkr>tdtdgdgtdgddgtddggd atStdtdgdgtddgddgtgd gd atS) aReturns the |XcodeArchsDefault| object to use to expand ARCHS for the installed version of Xcode. The default values used by Xcode for ARCHS and the expansion of the variables depends on the version of Xcode used. For all version anterior to Xcode 5.0 or posterior to Xcode 5.1 included uses $(ARCHS_STANDARD) if ARCHS is unset, while Xcode 5.0 to 5.0.2 uses $(ARCHS_STANDARD_INCLUDING_64_BIT). This variable was added to Xcode 5.0 and deprecated with Xcode 5.1. For "macosx" SDKROOT, all version starting with Xcode 5.0 includes 64-bit architecture as part of $(ARCHS_STANDARD) and default to only building it. For "iphoneos" and "iphonesimulator" SDKROOT, 64-bit architectures are part of $(ARCHS_STANDARD_INCLUDING_64_BIT) from Xcode 5.0. From Xcode 5.1, they are also part of $(ARCHS_STANDARD). All these rules are coded in the construction of the |XcodeArchsDefault| object to use depending on the version of Xcode detected. The object is for performance reason.0500ri386armv7Z0510rx86_64armv7s)r+r-arm64)XCODE_ARCHS_DEFAULT_CACHE XcodeVersionr r ) xcode_version_rrrGetXcodeArchsDefault`s<     r3c@seZdZdZiZiZiZiZiZddZ ddZ ddZ dd Z dd d Z d dZddZddZddZddZddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Z d3d4Z!d5d6Z"d7d8Z#d9d:Z$d;d<Z%d=d>Z&d?d@Z'dAdBZ(dCdDZ)dEdFZ*dGdHZ+dIdJZ,dKdLZ-dMdNZ.dOdPZ/dQdRZ0ddSdTZ1ddUdVZ2dWdXZ3dYdZZ4dd[d\Z5d]d^Z6d_d`Z7dadbZ8dcddZ9dedfZ:dgdhZ;didjZdodpZ?dqdrZ@ddsdtZAdudvZBdwdxZCddydzZDdd{d|ZEd}d~ZFddZGdddZHddZIddZJgdfddZKdddZLdddZMddZNddZOdddZPddZQd S) XcodeSettingsz9A class that understands the gyp 'xcode_settings' object.cCs||_d|_d|_d|_i|_|d}|D]\}}|di|j|<|||j|ddr5d|_qd|_t d|_ dS)NFconfigurationsxcode_settingsIPHONEOS_DEPLOYMENT_TARGETTz^lib([^/]+)\.(a|dylib)$) specisIOSmac_toolchain_dirheader_map_pathr6itemsget_ConvertConditionalKeys confignamer'r( library_re)rr8configsr?configrrrrs zXcodeSettings.__init__cCsl|j|}dd|D}|D]%}|dr(|dr'|dd}||||<ntdd|||=qd S) zConverts or warns on conditional keys. Xcode supports conditional keys, such as CODE_SIGN_IDENTITY[sdk=iphoneos*]. This is a partial implementation with some keys converted while the rest force a warning.cSsg|] }|dr|qS)])endswith.0keyrrr sz9XcodeSettings._ConvertConditionalKeys..z[sdk=iphoneos*]r[rz4Warning: Conditional keys not implemented, ignoring: N)r6rDsplitrjoin)rr?settingsZconditional_keysrGZnew_keyrrrr>s    z%XcodeSettings._ConvertConditionalKeyscCs|jsJ|j|jSN)r?r6rrrr _Settingss  zXcodeSettings._SettingscCs||||kSrN)rPr=)rtest_keyZcond_keyrrrr_TestszXcodeSettings._TestNcCsH||vr||t||dS|r"||t|dSdSrN)rPrstr)rlstrQZ format_strrrrr_Appendfs zXcodeSettings._AppendfcCs ||vrtd|dSdS)Nz/Warning: Ignoring not yet implemented key "%s".)rPr)rrQrrr_WarnUnimplementeds z XcodeSettings._WarnUnimplementedcCs(|jrdnd}|j|d|}|dkS)NbinaryxmlZINFOPLIST_OUTPUT_FORMAT)r9r6r=)rr?rformatrrrIsBinaryOutputFormatsz"XcodeSettings.IsBinaryOutputFormatcCs|jddko |o |jS)Ntypeshared_library)r8 _IsBundler9rOrrrIsIosFrameworkszXcodeSettings.IsIosFrameworkcCs&t|jdddkp|p|S)N mac_bundler)intr8r= _IsXCTest _IsXCUiTestrOrrrr]s zXcodeSettings._IsBundlecCt|jdddkS)Nmac_xctest_bundlerr`r8r=rOrrrrazXcodeSettings._IsXCTestcCrc)Nmac_xcuitest_bundlerrerOrrrrbrfzXcodeSettings._IsXCUiTestcCrc)NZios_app_extensionrrerOrrr_IsIosAppExtensionrfz XcodeSettings._IsIosAppExtensioncCrc)NZios_watchkit_extensionrrerOrrr_IsIosWatchKitExtensionrfz%XcodeSettings._IsIosWatchKitExtensioncCrc)NZ ios_watch_apprrerOrrr_IsIosWatchApprfzXcodeSettings._IsIosWatchAppcCs|sJ|jdddS)zPReturns the framework version of the current target. Only valid for bundles.ZFRAMEWORK_VERSIONAr)r]GetPerTargetSettingrOrrrGetFrameworkVersions z!XcodeSettings.GetFrameworkVersioncCs|sJ|jddvr'ddd|jd}|jd|d}d|jd|S|jdd krH|s6|r?d|jdd Sd|jdd SJd |jd|jd)z[Returns the bundle extension (.app, .framework, .plugin, etc). Only valid for bundles.r[loadable_moduler\bundle frameworkZWRAPPER_EXTENSIONrl.product_extension executableZappexZappFz*Don't know extension for '{}', target '{}' target_name)r]r8rmr=rhrirY)rZdefault_wrapper_extensionZwrapper_extensionrrrGetWrapperExtensions& z!XcodeSettings.GetWrapperExtensioncCs|jd|jdS)zReturns PRODUCT_NAME. product_namervr8r=rOrrrGetProductNameszXcodeSettings.GetProductNamecC|r|S|S)zReturns FULL_PRODUCT_NAME.)r]GetWrapperName_GetStandaloneBinaryPathrOrrrGetFullProductName"sz XcodeSettings.GetFullProductNamecCs|sJ||S)z`Returns the directory name of the bundle represented by this target. Only valid for bundles.)r]rzrwrOrrrr|)s zXcodeSettings.GetWrapperNamecCsR|jr|S|s J|jddkr tj|d|Stj|dS)zReturns the qualified path to the bundle's contents folder. E.g. Chromium.app/Contents or Foo.bundle/Versions/A. Only valid for bundles.r[r\ZVersionsZContents)r9r|r]r8ospathrLrnrOrrrGetBundleContentsFolderPath/s z)XcodeSettings.GetBundleContentsFolderPathcCs,|sJ|jr |Stj|dS)z}Returns the qualified path to the bundle's resource folder. E.g. Chromium.app/Contents/Resources. Only valid for bundles. Resources)r]r9rrrrLrOrrrGetBundleResourceFolder=s z%XcodeSettings.GetBundleResourceFoldercCsL|sJ|jddvs|jr|S|jddvr$tj|dSdS)z|Returns the qualified path to the bundle's executables folder. E.g. Chromium.app/Contents/MacOS. Only valid for bundles.r[r\rurpZMacOSN)r]r8r9rrrrLrOrrrGetBundleExecutableFolderPathEs z+XcodeSettings.GetBundleExecutableFolderPathcC|sJtj|dS)zReturns the qualified path to the bundle's Java resource folder. E.g. Chromium.app/Contents/Resources/Java. Only valid for bundles.Java)r]rrrLrrOrrrGetBundleJavaFolderPathN z%XcodeSettings.GetBundleJavaFolderPathcCr)zReturns the qualified path to the bundle's frameworks folder. E.g, Chromium.app/Contents/Frameworks. Only valid for bundles. Frameworksr]rrrLrrOrrrGetBundleFrameworksFolderPathTrz+XcodeSettings.GetBundleFrameworksFolderPathcCr)zReturns the qualified path to the bundle's frameworks folder. E.g, Chromium.app/Contents/SharedFrameworks. Only valid for bundles.ZSharedFrameworksrrOrrr#GetBundleSharedFrameworksFolderPathZrz1XcodeSettings.GetBundleSharedFrameworksFolderPathcCs4|sJ|jddkr|Stj|dS)zReturns the qualified path to the bundle's shared support folder. E.g, Chromium.app/Contents/SharedSupport. Only valid for bundles.r[r\Z SharedSupport)r]r8rrrrLrrOrrr GetBundleSharedSupportFolderPath`s z.XcodeSettings.GetBundleSharedSupportFolderPathcCr)zzReturns the qualified path to the bundle's plugins folder. E.g, Chromium.app/Contents/PlugIns. Only valid for bundles.PlugInsrrOrrrGetBundlePlugInsFolderPathirz(XcodeSettings.GetBundlePlugInsFolderPathcCr)zReturns the qualified path to the bundle's XPC services folder. E.g, Chromium.app/Contents/XPCServices. Only valid for bundles.Z XPCServicesrrOrrrGetBundleXPCServicesFolderPathorz,XcodeSettings.GetBundleXPCServicesFolderPathcCsH|sJ|jddvs|rtj|dStj|ddS)zyReturns the qualified path to the bundle's plist file. E.g. Chromium.app/Contents/Info.plist. Only valid for bundles.r[rz Info.plistr)r]r8r^rrrLrrOrrrGetBundlePlistPathus  z XcodeSettings.GetBundlePlistPathcCs|r|sJd|jddS|r&|s$Jd|jddS|r9|s7Jd|jddS|rL|sJJd|jdd S|r[d d d d |jdSddddd|jdS)z(Returns the PRODUCT_TYPE of this target.z6ios_app_extension flag requires mac_bundle (target %s)rvz$com.apple.product-type.app-extensionz;ios_watchkit_extension flag requires mac_bundle (target %s)z)com.apple.product-type.watchkit-extensionz2ios_watch_app flag requires mac_bundle (target %s)z+com.apple.product-type.application.watchappz8mac_xcuitest_bundle flag requires mac_bundle (target %s)z(com.apple.product-type.bundle.ui-testingz"com.apple.product-type.applicationzcom.apple.product-type.bundlez com.apple.product-type.framework)rurpr\r[zcom.apple.product-type.toolz&com.apple.product-type.library.dynamicz%com.apple.product-type.library.static)rurpr\static_library)rhr]r8rirjrbrOrrrGetProductTypesT    zXcodeSettings.GetProductTypecCs2|s |jddkr dSddddd|jdS) z'Returns the MACH_O_TYPE of this target.r[rur!Z mh_executeZ staticlibZmh_dylibZ mh_bundlerurr\rp)r]r8rOrrr GetMachOTypeszXcodeSettings.GetMachOTypecCs"|sJtj||S)zReturns the name of the bundle binary of by this target. E.g. Chromium.app/Contents/MacOS/Chromium. Only valid for bundles.)r]rrrLrGetExecutableNamerOrrr_GetBundleBinaryPaths  z"XcodeSettings._GetBundleBinaryPathcCs0d|jvr d|jdSddddd|jdS) Nrtrsr!z.a.dylibz.sorr[)r8rOrrr_GetStandaloneExecutableSuffixs z,XcodeSettings._GetStandaloneExecutableSuffixcCs"|jdddddd|jdS)Nproduct_prefixr!librr[ryrOrrr_GetStandaloneExecutablePrefixsz,XcodeSettings._GetStandaloneExecutablePrefixcCs|rJ|jddvsJd|jd|jd}|jddkr1|dddkr0|dd}n|jdd vrF|dddkrF|dd}|}|jd |}|}|||S) zwReturns the name of the non-bundle binary represented by this target. E.g. hello_world. Only valid for non-bundles.r[)rur\rrpzUnexpected type %srvrNrrorx)r]r8rr=r)rtargetZ target_prefix target_extrrrr}s      z&XcodeSettings._GetStandaloneBinaryPathcCs$|r|jd|jdS|S)zXReturns the executable name of the bundle represented by this target. E.g. Chromium.rxrv)r]r8r=r}rOrrrrszXcodeSettings.GetExecutableNamecCr{)zReturns the qualified path to the primary executable of the bundle represented by this target. E.g. Chromium.app/Contents/MacOS/Chromium.)r]rr}rOrrrGetExecutablePathszXcodeSettings.GetExecutablePathcCs0|j|}t}||d|d|dS)z:Returns the architectures this target should be built for.ARCHSZ VALID_ARCHSSDKROOT)r6r3r"r=)rr?Zconfig_settingsZxcode_archs_defaultrrrGetActiveArchss zXcodeSettings.GetActiveArchscCs(z tdd||gWStyYdSw)NZxcrunz--sdk)GetStdoutQuietr)rZsdkZinfoitemrrr_GetSdkVersionInfoItems  z$XcodeSettings._GetSdkVersionInfoItemcCs|dur|j}|jd|ddS)Nrr!rl)r?GetPerConfigSetting)rr?rrr_SdkRootszXcodeSettings._SdkRootcCs4||}|tjvr||d}|tj|<tj|S)Nz--show-sdk-platform-path)rr4_platform_path_cacher)rr?sdk_rootZ platform_pathrrr_XcodePlatformPaths    z XcodeSettings._XcodePlatformPathcCs"||}|dr |S||S)N/)r startswith _XcodeSdkPath)rr?rrrr_SdkPaths   zXcodeSettings._SdkPathcCs8|tjvr||d}|tj|<|r|tj|<tj|S)Nz--show-sdk-path)r4_sdk_path_cacher_sdk_root_cache)rrsdk_pathrrrr%s     zXcodeSettings._XcodeSdkPathcCs`||ddd|vr.tj|}|dr%||dddS||dddSdS)NMACOSX_DEPLOYMENT_TARGETz-mmacosx-version-min=%sr7rz-mios-simulator-version-min=%sz-miphoneos-version-min=%s)rUrPrrbasenamerrr)rrTZsdk_path_basenamerrr_AppendPlatformVersionMinFlags-s z,XcodeSettings._AppendPlatformVersionMinFlagsc Cs||_g}|}d|vr|r|d||jr#|d|j|jddddr0|d|jd dddr=|d |jd dddrJ|d d |vr^|d dkr]|dn |jddddrl|d|j|dddd|jddddr|dd}|dkr|dn|dkrtd|dkr|dntd||ddkr|dn|ddkr|d|jddddr|d |jd!dddr|d"|jd#dddr|d$|jd%dddr|d&| ||jd'dddr | d'| d(| d)| d*| d+t j s|d,ur.|g}n |js4J||j}t|d-krI| d.d/g}|d0|d1|d1d2vr|jd3dddrg|d4|jd5dddru|d6|jd7dddr|d8|jd9dddr|d:||d;g7}|r||}|r|d<|d=|r|}nd>}|jd?|j} | d@g} | D]} |d<| dA|qd,|_|S)BzMReturns flags that need to be added to .c, .cc, .m, and .mm compilations.rz -isysroot %sz-I%sZCLANG_WARN_CONSTANT_CONVERSIONYESNOrlz-Wconstant-conversionZGCC_CHAR_IS_UNSIGNED_CHARz-funsigned-charZGCC_CW_ASM_SYNTAXz -fasm-blocksZGCC_DYNAMIC_NO_PICz-mdynamic-no-picZGCC_ENABLE_PASCAL_STRINGSz-mpascal-stringsZGCC_OPTIMIZATION_LEVELz-O%ssGCC_GENERATE_DEBUGGING_SYMBOLSDEBUG_INFORMATION_FORMATdwarfz -gdwarf-2Zstabsz(stabs debug format is not supported yet.dwarf-with-dsymzUnknown debug format %sZGCC_STRICT_ALIASINGz-fstrict-aliasingz-fno-strict-aliasingZGCC_SYMBOLS_PRIVATE_EXTERNz-fvisibility=hiddenZGCC_TREAT_WARNINGS_AS_ERRORSz-WerrorZGCC_WARN_ABOUT_MISSING_NEWLINEz -Wnewline-eofZLLVM_LTOz-fltoZCOPY_PHASE_STRIPZGCC_DEBUGGING_SYMBOLSZGCC_ENABLE_OBJC_EXCEPTIONS MACH_O_TYPE PRODUCT_TYPENrr*-arch r)r*r,ZGCC_ENABLE_SSE3_EXTENSIONSz-msse3Z)GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONSz-mssse3ZGCC_ENABLE_SSE41_EXTENSIONSz-msse4.1ZGCC_ENABLE_SSE42_EXTENSIONSz-msse4.2ZWARNING_CFLAGS-F/Developer/Library/Frameworks/r!r5mac_framework_dirs $(SDKROOT))r?rrPrr;rRrUr=NotImplementedErrorrrVgypcommonCrossCompileRequestedrlenrarr8replace) rr?rcflagsrZ dbg_formatr platform_rootZframework_rootrBframework_dirs directoryrrr GetCflags;s                                 zXcodeSettings.GetCflagscCsV||_g}|dddkr|dn||dd||dg7}d|_|S)z?Returns flags that need to be added to .c, and .m compilations.ZGCC_C_LANGUAGE_STANDARDr!ansiz-ansi-std=%s OTHER_CFLAGSN)r?rPr=rrU)rr?cflags_crrr GetCflagsCs zXcodeSettings.GetCflagsCcCs||_g}|d}|r|d|||dd|jddddr)|d |jd dddr6|d |jd dddrC|d |jddddrP|d|jddddr]|dg}|ddgD]}|dvrpd}|dvr||dg7}qh||qh||7}d|_|S)zAReturns flags that need to be added to .cc, and .mm compilations.ZCLANG_CXX_LANGUAGE_STANDARDrCLANG_CXX_LIBRARY -stdlib=%sZGCC_ENABLE_CPP_RTTIrrrlz -fno-rttiZGCC_ENABLE_CPP_EXCEPTIONSz-fno-exceptionsZGCC_INLINES_ARE_PRIVATE_EXTERNz-fvisibility-inlines-hiddenZGCC_THREADSAFE_STATICSz-fno-threadsafe-staticsZ%GCC_WARN_ABOUT_INVALID_OFFSETOF_MACROz-Wno-invalid-offsetofZOTHER_CPLUSPLUSFLAGS $(inherited))z $inheritedrz ${inherited} $OTHER_CFLAGS)rz$(OTHER_CFLAGS)z${OTHER_CFLAGS}rN)r?rPr=rrUrR)rr? cflags_ccZclang_cxx_language_standardZ other_ccflagsflagrrr GetCflagsCCs8      zXcodeSettings.GetCflagsCCcCs@|dd}|dkr|ddS|dkr|ddSdS)NZGCC_ENABLE_OBJC_GC unsupportedZ supportedz -fobjc-gcrequiredz-fobjc-gc-only)rPr=r)rflagsZ gc_policyrrr$_AddObjectiveCGarbageCollectionFlagss z2XcodeSettings._AddObjectiveCGarbageCollectionFlagscC"|jddddr|ddSdS)NZCLANG_ENABLE_OBJC_ARCrrrlz -fobjc-arcrRrrrrrr_AddObjectiveCARCFlagssz$XcodeSettings._AddObjectiveCARCFlagscCr)NZ*CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESISrrrlz!-Wobjc-missing-property-synthesisrrrrr+_AddObjectiveCMissingPropertySynthesisFlagss z9XcodeSettings._AddObjectiveCMissingPropertySynthesisFlagscCs2||_g}||||||d|_|S)z7Returns flags that need to be added to .m compilations.N)r?rrr)rr? cflags_objcrrr GetCflagsObjCs   zXcodeSettings.GetCflagsObjCcCsL||_g}|||||||jddddr!|dd|_|S)z8Returns flags that need to be added to .mm compilations.ZGCC_OBJC_CALL_CXX_CDTORSrrrlz-fobjc-call-cxx-cdtorsN)r?rrrrRr)rr? cflags_objccrrrGetCflagsObjCC s    zXcodeSettings.GetCflagsObjCCcCsF|jddkr|jddks|rdS|jd|rdndd}|S) z/Return DYLIB_INSTALL_NAME_BASE for this target.r[r\rpNDYLIB_INSTALL_NAME_BASEz/Library/Frameworksz/usr/local/librl)r8r]rm)r install_baserrrGetInstallNameBasesz XcodeSettings.GetInstallNameBasecCsJd|vr#d|}}|dr|dd\}}tj|}tj||}|S)z(Do :standardizepath processing for path.rr!@r)rrKrrnormpathrL)rrprefixrestrrr_StandardizePath&s   zXcodeSettings._StandardizePathcCs|jddkr|jddks|rdSd}|jd|d}d|vrf|d |fvs2Jd |jd |f|d ||}|rR|d |}|d|}n d |vsXJd|vs^J|d|}|S)z-Return LD_DYLIB_INSTALL_NAME for this target.r[r\rpNz=$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)LD_DYLIB_INSTALL_NAMErl$zJ$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(WRAPPER_NAME)/$(PRODUCT_NAME)z\Variables in LD_DYLIB_INSTALL_NAME are not generally supported yet in target '%s' (got '%s')rvz*$(DYLIB_INSTALL_NAME_BASE:standardizepath)z$(WRAPPER_NAME)z$(PRODUCT_NAME)z$(EXECUTABLE_PATH)) r8r]rmrrrr|rzr)rZdefault_install_name install_namerrrGetInstallName2sD     zXcodeSettings.GetInstallNamec Csd}d}d|gd|gd|gd|||gg}|D],}tdd|}||}|rB|d |d ||d ||d d }q|d rTd ||td d }|S) zuChecks if ldflag contains a filename and if so remaps it from gyp-directory-relative to build-directory-relative.z(\S+)z\S+z-exported_symbols_listz-unexported_symbols_listz-reexported_symbols_listz -sectcreatez (?:-Wl,)?z[ ,]Nr-L) r'r(rLrstartgroupendrr) rldflaggyp_to_build_pathZ LINKER_FILEZWORDZ linker_flagsZ flag_patternregexmrrr_MapLinkerFlagFilenamecs*    z$XcodeSettings._MapLinkerFlagFilenamecCs||_g}|dgD] }||||q |jddddr&|d|jddddr3|d||d d ||d d ||d |vrY|rY|d||dgD] }|d||qad|vr|d||dt j s|dur|g}n |jsJ| |j}t |dkr|ddg}|d|d|d|dkr|nd|} | r|jddkr|d| dd|d gD] } |d!| q|} | sd"} |jd#|j} | d$g} | D] }|d%|d&| q|r*||}| r*|r*|d%|d'|d(|p2|}| rZ|rZt\}}|d)krP|d*|| d+n|d,|d-||d.d/d|_|S)0aReturns flags that need to be passed to the linker. Args: configname: The name of the configuration to get ld flags for. product_dir: The directory where products such static and dynamic libraries are placed. This is added to the library search path. gyp_to_build_path: A function that converts paths relative to the current gyp file to paths relative to the build directory. OTHER_LDFLAGSZDEAD_CODE_STRIPPINGrrrlz-Wl,-dead_stripZ PREBINDINGz -Wl,-prebindZDYLIB_COMPATIBILITY_VERSIONz-compatibility_version %sZDYLIB_CURRENT_VERSIONz-current_version %srz -isysroot ZLIBRARY_SEARCH_PATHSrZ ORDER_FILEz-Wl,-order_file -Wl,Nrrr*rrrsz./r[rpz-install_name rJz\ ZLD_RUNPATH_SEARCH_PATHSz -Wl,-rpath,r!r5rrrrz-framework XCTestZ0900z -lpkstartz?/System/Library/PrivateFrameworks/PlugInKit.framework/PlugInKitz-e _NSExtensionMainz-fapplication-extensionrr)r?rPr=rrrRrUrrrrrrrrVrr8rrarrhrir0)rr? product_dirrrldflagsrZ library_pathrrrpathrrBrrrZ is_extensionr1r2rrr GetLdflagss                     zXcodeSettings.GetLdflagscCs4||_g}|dgD]}||q d|_|S)zReturns flags that need to be passed to the static linker. Args: configname: The name of the configuration to get ld flags for. rN)r?rPr=r)rr?Z libtoolflagsZ libtoolflagrrrGetLibtoolflagss  zXcodeSettings.GetLibtoolflagscCsld}i}t|jD](}|rt|j|}d}q |j|D]\}}||vr)q |||kr2||=q q |S)z~Gets a list of all the per-target settings. This will only fetch keys whose values are the same across all configurations.TF)sortedr6keysdictr<)rZ first_passresultr?rGvaluerrrGetPerTargetSettingss z"XcodeSettings.GetPerTargetSettingscCs(||jvr|j|||S|||SrN)r6r=rm)rsettingr?rrrrr s  z!XcodeSettings.GetPerConfigSettingcCstd}d}t|jD]&}|r|j||d}d}q ||j||dks1Jd||jdfq |dur8|S|S)zTries to get xcode_settings.setting from spec. Assumes that the setting has the same value in all configurations and throws otherwise.TNFzHExpected per-target setting for '%s', got per-config setting (target %s)rv)rr6rr=r8)rr rZ is_first_passrr?rrrrms z!XcodeSettings.GetPerTargetSettingc Cs||_g}|jddddrk|jddddrkd}|jddks"|r)|r)d }n |jdd kr2d }|d |}d ddd|}|dd }|rT|dt|7}|s`|d|jd|d|d|d|_|S)zReturns a list of shell commands that contain the shell commands necessary to strip this target's binary. These should be run as postbuilds before the actual postbuilds run.ZDEPLOYMENT_POSTPROCESSINGrrrlZSTRIP_INSTALLED_PRODUCT debuggingr[rp non-globalruallZ STRIP_STYLEr!z-xz-S)r r r Z STRIPFLAGSrJzecho STRIP\(%s\)rvzstrip N) r?rRr8rhr]rPr=_NormalizeEnvVarReferencesr) rr? output_binaryquietrZdefault_strip_styleZ strip_styleZ strip_flagsZexplicit_strip_flagsrrr_GetStripPostbuilds"s0 z!XcodeSettings._GetStripPostbuildscCsp||_g}|jddddr3|jddddr3|jddkr3|s(|d |jd |d ||d d |_|S)zReturns a list of shell commands that contain the shell commands necessary to massage this target's debug information. These should be run as postbuilds before the actual postbuilds run.rrrlrrrr[rzecho DSYMUTIL\(%s\)rvzdsymutil {} -o {}z.dSYMN)r?rRr8rrY)rr?outputrrrrrr_GetDebugInfoPostbuildsEsz%XcodeSettings._GetDebugInfoPostbuildsFcCs|||||||||S)zReturns a list of shell commands that contain the shell commands to run as postbuilds for this target, before the actual postbuilds.)rr)rr?rrrrrr_GetTargetPostbuilds[s  z"XcodeSettings._GetTargetPostbuildsc Cs4|jr|jddks|s|sgSg}|}|j|}|rGtjd|}tj | d}tj|d|}| d|d|g| |} | sP|Sdg} t | t |j|@} | rmtd d t| |rtj | d}tj|d } ||} d d g} | D];}tj| |}tj| tj|}| d|d|g| dtjdd| | dd| dd|dfgqtj|d}tj|||g}|D]}| dtjdd| | dd| dd|dfgq| dtjdd| | dd| ddtjd|dfg|S)zReturn a shell command to codesign the iOS output binary so it can be deployed to a device. This should be run as the very last step of the build.r[ruz${BUILT_PRODUCTS_DIR}Z TEST_HOSTrzditto rJZOTHER_CODE_SIGN_FLAGSz9Warning: Some codesign keys not implemented, ignoring: %sz, rz@Developer/Library/PrivateFrameworks/IDEBundleInjection.frameworkz-Developer/Library/Frameworks/XCTest.frameworkz*%s code-sign-bundle "%s" "%s" "%s" "%s" %sz${TARGET_BUILD_DIR}z gyp-mac-toolZCODE_SIGN_ENTITLEMENTSr!ZPROVISIONING_PROFILETF)r9r8rar^r~r6rrrLdirnamer=extend_GetIOSCodeSignIdentityKeysetrrrrr)rr?r postbuildsrxrMsourceZ test_hostZxctest_destinationrGZunimplZframeworks_dirrZ frameworksrr destinationZ plugin_dirtargetsrrrr_GetIOSPostbuildscs                zXcodeSettings._GetIOSPostbuildscCs|d}|s dS|tjvr>tgd}|D]$}||vr=|d}tj}||vs8|||ks8Jd||tj|<qtj|dS)NZCODE_SIGN_IDENTITY)Zsecurityz find-identityz-pZ codesigningz-vrz2Multiple codesigning fingerprints for identity: %sr!)r=r4_codesigning_key_cache subprocess check_output splitlinesrK)rrMidentityrlineZ fingerprintcacherrrrs"     z(XcodeSettings._GetIOSCodeSignIdentityKeycCs4|dusJ|||||}|||}|||S)zSReturns a list of shell commands that should run before and after |postbuilds|.N)rr)rr?rrrrprepostrrrAddImplicitPostbuildss   z#XcodeSettings.AddImplicitPostbuildsc Cs|drdtjtj|d}n|j|}|r$d|d}n|}||}|s/d}| d|}| drXtj|\}}|dkrXtj |sX|d }tj |rX|}|S) Nz .frameworkz -framework rz-lrr!rrz.tbd) rDrrsplitextrr@rrrrrexists) rlibrary config_nameZl_flagrrrextZ tbd_libraryrrr_AdjustLibrarys"     zXcodeSettings._AdjustLibrarycsfdd|D}|S)zTransforms entries like 'Cocoa.framework' in libraries into entries like '-framework Cocoa', 'libcrypto.dylib' into '-lcrypto', etc. csg|]}|qSr)r-)rFr*r+rrrrHz1XcodeSettings.AdjustLibraries..r)r librariesr+rr.rAdjustLibrariesszXcodeSettings.AdjustLibrariescCs tddgS)NZsw_versz -buildVersion) GetStdoutrOrrr_BuildMachineOSBuilds z"XcodeSettings._BuildMachineOSBuildcCs&|j|dd}dd|dDS)NZTARGETED_DEVICE_FAMILY1cSsg|]}t|qSr)r`)rFxrrrrH sz7XcodeSettings._XcodeIOSDeviceFamily..,)r6r=rK)rr?familyrrr_XcodeIOSDeviceFamilysz#XcodeSettings._XcodeIOSDeviceFamilyc CsL|tjvri}||d<t\}}||d<||d<|j|d}|dur*||d<||}|s5|}||d}||p?d|d <|d krP||d |d <n|d krY||d <n|d|d <|j r|j|d|d<||d<||d<| drdg|d<|d |d<n dg|d<d|d<|tj|<t tj|}|j r| ||d<|S)z@Returns a dictionary with extra items to insert into Info.plist.ZBuildMachineOSBuildZDTXcodeZ DTXcodeBuildZ GCC_VERSIONNZ DTCompilerz--show-sdk-versionr!Z DTSDKNameZ0720z--show-sdk-build-versionZ DTSDKBuildZ0430r7ZMinimumOSVersionZDTPlatformNameZDTPlatformVersionrZiPhoneOSZCFBundleSupportedPlatformsZDTPlatformBuildZiPhoneSimulatorZUIDeviceFamily) r4 _plist_cacher3r0r6r=r_DefaultSdkRootrr9rDrr8) rr?r$r1Z xcode_buildcompilerrZ sdk_versionr<rrrGetExtraPlistItems sJ             z XcodeSettings.GetExtraPlistItemsc Cst\}}|dkr dS|d}tj|}|r|Sztddg}Wn ty,YdSw|D]#}|}t |dkrT|ddkrT|d}||} | |krT|Sq1dS) zReturns the default SDKROOT to use. Prior to version 5.0.0, if SDKROOT was not explicitly set in the Xcode project, then the environment variable was empty. Starting with this version, Xcode uses the name of the newest SDK installed. r)r! xcodebuildz -showsdksrz-sdk) r0rr4rr=r2rr!rKr) rr1r2Zdefault_sdk_pathZdefault_sdk_rootZall_sdksr#r<rrrrrr:>s*      zXcodeSettings._DefaultSdkRootrNF)Rr#r$r%r&rrrr9rrr>rPrRrUrVrZr^r]rarbrhrirjrnrwrzr~r|rrrrrrrrrrrrrrrr}rrrrrrrrrrrrrrrrrrrrrrrr rrmrrrrrr'r-r1r3r8r<r:rrrrr4s   (        *    1 g  # _   3r4c@sFeZdZdZddZddZdddZd d Zdd d Zdd dZ dS)MacPrefixHeaderaA class that helps with emulating Xcode's GCC_PREFIX_HEADER feature. This feature consists of several pieces: * If GCC_PREFIX_HEADER is present, all compilations in that project get an additional |-include path_to_prefix_header| cflag. * If GCC_PRECOMPILE_PREFIX_HEADER is present too, then the prefix header is instead compiled, and all other compilations in the project get an additional |-include path_to_compiled_header| instead. + Compiled prefix headers have the extension gch. There is one gch file for every language used in the project (c, cc, m, mm), since gch files for different languages aren't compatible. + gch files themselves are built with the target's normal cflags, but they obviously don't get the |-include| flag. Instead, they need a -x flag that describes their language. + All o files in the target need to depend on the gch file, to make sure it's built before any o file is built. This class helps with some of these tasks, but it needs help from the build system for writing dependencies to the gch files, for writing build commands for the gch files, and for figuring out the location of the gch files. cCsrd|_d|_|r|d|_|jddddk|_i|_|jr7|jr/dD] }||j||j|<q#||j|_dSdS)aIf xcode_settings is None, all methods on this class are no-ops. Args: gyp_path_to_build_path: A function that takes a gyp-relative path, and returns a path relative to the build directory. gyp_path_to_build_output: A function that takes a gyp-relative path and a language code ('c', 'cc', 'm', or 'mm'), and that returns a path to where the output of precompiling that path for that language should be placed (without the trailing '.gch'). NFZGCC_PREFIX_HEADERZGCC_PRECOMPILE_PREFIX_HEADERrrl)cccrmm)headercompile_headersrmcompiled_headers)rr6gyp_path_to_build_pathZgyp_path_to_build_outputlangrrrrrs&  zMacPrefixHeader.__init__cCs(|jsJ|j|}|r|d|7}|S)Nrs)rFrG)rrIrhrrr_CompiledHeaders   zMacPrefixHeader._CompiledHeaderNcCs4|jr||jvrd|||S|jrd|jSdS)zAGets the cflags to include the prefix header for language |lang|.z -include %sr!)rFrGrKrErrIrrrr GetIncludes  zMacPrefixHeader.GetIncludecCs|jsJ|||dS)zFReturns the actual file name of the prefix header for language |lang|.z.gch)rFrKrLrrr_Gchs zMacPrefixHeader._Gchc Csr|jr|jsgSg}t||D]'\}}tj|d}ddddddd|d}|r6||||||fq|S)aGiven a list of source files and the corresponding object files, returns a list of (source, object, gch) tuples, where |gch| is the build-directory relative path to the gch file each object file depends on. |compilable[i]| has to be the source file belonging to |objs[i]|.rrBrCrrD)z.cz.cppz.ccz.cxxz.mz.mmN) rErFziprrr(r=rrN) rsourcesobjsrrrobjr,rIrrrGetObjDependenciess$ z"MacPrefixHeader.GetObjDependenciescCsd|jr|jsgS|d|dd|jf|d|dd|jf|d|dd|jf|d|dd|jfgS) zReturns [(path_to_gch, language_flag, language, header)]. |path_to_gch| and |header| are relative to the build directory. rBz -x c-headerrCz -x c++-headerrz-x objective-c-headerrDz-x objective-c++-header)rErFrN)rrrrrGetPchBuildCommandss z#MacPrefixHeader.GetPchBuildCommandsrN) r#r$r%r&rrKrMrNrSrTrrrrrA[s"  rAcCstrtSd}d}z$tddg}t|dkrtd|dd}|dd}Wnty>t}|s.+)z/usr/sbin/pkgutilz --pkg-inforZz/Command Line Tools for Xcode\s+(?P\S+)z/usr/sbin/softwareupdatez --historyN)r'r(r2search groupdictr)ZSTANDALONE_PKG_IDZFROM_XCODE_PKG_IDZMAVERICKS_PKG_IDrrGrrrrrXs$      rXcCsPtj|tjtjd}|dd}|jdkr#td|j|df|dS)zReturns the content of standard output returned by invoking |cmdlist|. Ignores the stderr. Raises |GypError| if the command return with a non-zero return code.)stdoutstderrrutf-8Error %d running %s )rPopenPIPE communicatedecode returncoderrstripZcmdlistZjoboutrrrrs   rcCs\tj|tjd}|dd}|jdkr)tj|dt d|j|df| dS)zReturns the content of standard output returned by invoking |cmdlist|. Raises |GypError| if the command return with a non-zero return code.)r^rr`rbra) rrcrdrerfrgsysr_writerrhrirrrr2s   r2cCsH|di}|dD]}d|vr!|}||d||d<q dS)zMerges the global xcode_settings dictionary into each configuration of the target represented by spec. For keys that are both in the global and the local xcode_settings dict, the local key gets precedence. r6r5N)r=valuescopyupdate)Z global_dictr8Zglobal_xcode_settingsrBZ new_settingsrrrMergeGlobalXcodeSettingsToSpec*s rpcCsht|dddkp!t|dddkp!t|dddko!|dk}|r2|ddks2Jd|d |S) zReturns if |spec| should be treated as a bundle. Bundles are directories with a certain subdirectory structure, instead of just a single file. Bundle rules do not produce a binary but also package resources into that directory.rdrrgr_r r[nonez6mac_bundle targets cannot have type none (target "%s")rv)r`r=)flavorr8 is_mac_bundlerrr IsMacBundle:srtccstj||}|D]X}|}d|vsJd|tj|}tj|d}|ddr8tj||d}tj||d}|drPtj|dd}|dr_tj|dd }||fVq d S) avYields (output, resource) pairs for every resource in |resources|. Only call this for mac bundle targets. Args: product_dir: Path to the directory containing the output bundle, relative to the build directory. xcode_settings: The XcodeSettings of the current target. resources: A list of bundle resources, relative to the build directory. rJz/Spaces in resource filenames not supported (%s)rrz.lprojz.xibz.nibz .storyboardz .storyboardcN)rrrLrrKrDr()rr6 resourcesdestresrZ res_partsZ lproj_partsrrrGetMacBundleResourcesNs      rxcCs|d}|s ddgifSd|vsJd|||}|jddddkr/t|jd d d}ng}tj||}|}||||fS) a)Returns (info_plist, dest_plist, defines, extra_env), where: * |info_plist| is the source plist path, relative to the build directory, * |dest_plist| is the destination plist path, relative to the build directory, * |defines| is a list of preprocessor defines (empty if the plist shouldn't be preprocessed, * |extra_env| is a dict of env variables that should be exported when invoking |mac_tool copy-info-plist|. Only call this for mac bundle targets. Args: product_dir: Path to the directory containing the output bundle, relative to the build directory. xcode_settings: The XcodeSettings of the current target. gyp_to_build_path: A function that converts paths relative to the current gyp file to paths relative to the build directory. ZINFOPLIST_FILENrJz1Spaces in Info.plist filenames not supported (%s)ZINFOPLIST_PREPROCESSrrlrZ"INFOPLIST_PREPROCESSOR_DEFINITIONSr!)rmshlexrKrrrLrr )rr6rH info_plistdefinesZ dest_plist extra_envrrrGetMacInfoPlistts&     r}c Cs.|siS|j}|||||d|dtdd }|d|r&|||d<nd|d<|jr2|j|d<|dd vrZ||d <||d <||d <| }|rT||d <| |d<| rt j |t j||d<||d<||d<||d<||d<||d<||d<||d<||d<||d<||d<||d<|}|r||d<|} | r| |d<t\} } | dkr|ds||} | s|d} | durd} | |d<|si}n|D]} t || t!sd|| || <q|"||D] } t#|| || <q |S) aReturn the environment variables that Xcode would set. See http://developer.apple.com/library/mac/#documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html#//apple_ref/doc/uid/TP40003931-CH3-SW153 for a full list. Args: xcode_settings: An XcodeSettings object. If this is None, this function returns an empty dict. built_products_dir: Absolute path to the built products dir. srcroot: Absolute path to the source root. configuration: The build configuration name. additional_settings: An optional dict with more values to add to the result. z ${SRCROOT}z ${TMPDIR}r) BUILT_FRAMEWORKS_DIRZBUILT_PRODUCTS_DIRZ CONFIGURATIONZ PRODUCT_NAMEZSRCROOTZ SOURCE_ROOTZTARGET_BUILD_DIRZTEMP_DIRZXCODE_VERSION_ACTUALrr!Z DEVELOPER_DIRr[rZEXECUTABLE_NAMEZEXECUTABLE_PATHZFULL_PRODUCT_NAMErrr~ZCONTENTS_FOLDER_PATHZEXECUTABLE_FOLDER_PATHZ!UNLOCALIZED_RESOURCES_FOLDER_PATHZJAVA_FOLDER_PATHZFRAMEWORKS_FOLDER_PATHZSHARED_FRAMEWORKS_FOLDER_PATHZSHARED_SUPPORT_FOLDER_PATHZPLUGINS_FOLDER_PATHZXPCSERVICES_FOLDER_PATHZINFOPLIST_PATHZ WRAPPER_NAMErrr)NrJ)$r8rzr0rrr:rrr~rrr]rrrLseprrrrrrrrrrr|rrr=rr isinstancerSror)r6built_products_dirsrcroot configurationadditional_settingsr8envZ mach_o_typerZinstall_name_baser1r2rkrrr _GetXcodeEnvs                   rcCsXtdd|}td|}|D]}|\}}d|vsJd|||d|d}q|S)zTakes a string containing variable references in the form ${FOO}, $(FOO), or $FOO, and returns a string with all variable references in the form ${FOO}. z\$([a-zA-Z_][a-zA-Z0-9_]*)z${\1}z(\$\(([a-zA-Z0-9\-_]+)\))$(z#$($(FOO)) variables not supported: ${})r'subfindallr)rSmatchesrZ to_replacerrrrrs rcCsNt|D] \}}|d|d|}|d|d|}|d||}q|S)aExpands ${VARIABLES}, $(VARIABLES), and $VARIABLES in string per the expansions list. If the variable expands to something that references another variable, this variable is expanded as well if it's in env -- until no variables present in env are left.rrr)r)reversedr)string expansionsrvrrr ExpandEnvVars-s rc shtdfdd}ztj|}||WStjjy3}z tdt |j d}~ww)aTakes a dict |env| whose values are strings that can refer to other keys, for example env['foo'] = '$(bar) and $(baz)'. Returns a list L of all keys of env such that key2 is after key1 in L if env[key2] refers to env[key1]. Throws an Exception in case of dependency cycles. z\$\{([a-zA-Z0-9\-_]+)\}cs>fdd|D}|D] }d|vsJd|q|S)Ncsh|]}|vr|qSrr)rFrrrr Kr/zC_TopologicallySortedEnvVarKeys..GetEdges..rz Nested variables not supported: )r)noderZdependeerrrrGetEdgesEsz0_TopologicallySortedEnvVarKeys..GetEdgesz6Xcode environment variables are cyclically dependent: N) r'r(rrTopologicallySortedrreverse CycleErrorrrSnodes)rrordererrr_TopologicallySortedEnvVarKeys9s   rcs&t|||||fddtDS)Ncsg|]}||fqSrrrErrrrHcr/z%GetSortedXcodeEnv..)rr)r6rrrrrrrGetSortedXcodeEnv]s rFcCsNg}|dgD]}|s|d|d|df|tj|dq|S)z_Returns the list of postbuilds explicitly defined on |spec|, in a form executable by a shell.rzecho POSTBUILD\(%s\) %srvZpostbuild_nameaction)r=rrrEncodePOSIXShellList)r8rr postbuildrrrGetSpecPostbuildCommandsfsrcCs>|D]}|dD]}|didrdSq qdS)zVReturns true if any target contains the iOS specific key IPHONEOS_DEPLOYMENT_TARGET.r5r6r7TF)rmr=)r target_dictrBrrr _HasIOSTargetts rcCsz|D]6}|d}|d}t|D]%\}}t|}|||d<|||d<|dkr9d|dd<d |dd<qq|S) zClone all targets and append -iphoneos to the name. Configure these targets to build for iOS devices and use correct architectures for those builds.toolsetr5z -iphoneosz-iphonesimulatorrrr6rr)rmrr<rndeepcopy)rrrrAr+Zsimulator_config_dictZiphoneos_config_dictrrr_AddIOSDeviceConfigurations~s      rcCst|rt|S|S)zkIf |target_dicts| contains any iOS targets, automatically create -iphoneos targets for iOS device builds.)rr) target_dictsrrr&CloneConfigurationForDeviceAndEmulatorsrrNr@)#r&rn gyp.commonrros.pathr'ryrrkrrWr/r r r3r4rAr0rXrr2rprtrxr}rrrrrrrrrrrrrsZ   84Ps'  &6 s %  o ۤ_c![@sddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z iZ dZ dZdZddZdd Zigd dd d fd dZddZddZddZddZddZGdddejZddZddZdd Zed!krveedSdS)"N)GypErrorZgeneralZ variablesincludescGsdtjvs |tjvrGd}ztjdd}|r|ddd}Wn ty'Ynw|r.||;}td|tj |d|d|d|fdSdS) Nall)unknownrr)Zlimitrz%s:%s:%d:%s %s) gypdebug tracebackZ extract_stack Exceptionprintupperospathbasename)modemessageargsctxfr>D:\a\_work\1\s\node_modules\node-gyp\gyp\pylib\gyp\__init__.py DebugOutputs$  $rcCs8d}tt}g}|D] }||r||q |S)N.gyp)rlistdirgetcwdendswithappend) extensionfiles build_filesfilerrrFindBuildFiles,s  r#.FTc Cs|duri}d|vr|dd\}|d<t|}||d<|dd|d<|drMtj|d }tj|\} }tj| } | tjvrLtj d | nd |}t |t t |} | j D] \} } || | q_t| d drv| ||t| d dr| |t| d gt| dgt| dgt| ddt| ddt| ddt| ddd} tj|||dd|| |||d|d }| g|S)z Loads one or more specified build files. default_variables and includes will be copied before use. Returns the generator for the specified format and the data returned by loading the specified build files. N-rZflavorZ GENERATORZGENERATOR_FLAVORz.pyrzgyp.generator.CalculateVariablesCalculateGeneratorInputInfoZ+generator_additional_non_configuration_keysZ"generator_additional_path_sectionsZ!generator_extra_sources_for_rules$generator_supports_multiple_toolsetsF4generator_wants_static_library_dependencies_adjustedT#generator_wants_sorted_dependenciesgenerator_filelist_paths)Znon_configuration_keysZ path_sectionsZextra_sources_for_rulesr)r*r+r,parallel root_targets)splitcopygetrrrsplitextabspathsysinsert __import__globalslocalsZgenerator_default_variablesitems setdefaultgetattrr'r(r inputLoad)r!formatZdefault_variablesrdepthparamscheckcircular_checkZgenerator_namer generatorkeyvalZgenerator_input_inforesultrrrr=6sl           r=c Cspi}|D]1}|dd}t|dkr/zt|d}Wn ty'|d}Ynw|||d<qd||d<q|S)z Takes an array of strings of the form 'NAME=VALUE' and creates a dictionary of the pairs. If a string is simply NAME, then the value in the dictionary is set to True. If VALUE can be converted to an integer, it is. =rrrT)r/lenint ValueError)Zname_value_listrFitemZtokensZ token_valuerrrNameValueListToDicts    rLcCs tj|g}|rt|}|SN)renvironr1shlexr/)env_nameflagsrrrShlexEnvs rRcCs |dr |d|S||S)Nz--rG) startswith)optvaluerrr FormatOpts rVcCslg}|jr#|r#t|D]}t|||}||vr||||q |r4|D] }|t|||q'|S)aRegenerate a list of command line flags, for an option of action='append'. The |env_name|, if given, is checked in the environment and used to generate an initial list of options, then the options that were specified on the command line (given in |values|) are appended. This matches the handling of environment variables and command line flags where command line flags override the environment, while not requiring the environment to be set when the flags are used again. )use_environmentrRrVremover)flagvalues predicaterPoptionsrQ flag_valuerUrrrRegenerateAppendFlags    r^c sDfdd}dd}dg}jD]\}}|d}t|}|ddkr'|p(|}|d } |d } | d krA|t|||| q| d vrl|rR|t|||qjrk| rktj | rk|t||tj | q| d vr| dkrv|s|| dkr|s||qjr| rt d| || ft j dqt d| |ft j dq|S)a}Given a parsed options object, and taking the environment variables into account, returns a list of flags that should regenerate an equivalent options object (even in the absence of the environment variables.) Any path options will be normalized relative to depth. The format flag is not included, as it is assumed the calling generator will set that as appropriate. cs tj|j}|stjjS|SrM)r commonZFixIfRelativePathr?rrcurdir)rr\rrFixPathsz RegenerateFlags..FixPathcSs|SrMr)rUrrrNoopszRegenerateFlags..Noop--ignore-environmentrTtyperactionrPr)storeN) store_true store_falserhrizJWarning: environment regeneration unimplemented for %s flag %r env_name %r)r"z9Warning: regeneration unimplemented for action %r flag %r)_regeneration_metadatar9r;extendr^rrVrWrrNr1r r4stderr) r\rbrcrQnameZmetadatarTrUZvalue_predicaterfrPrrarRegenerateFlagssL      rnc@s$eZdZddZddZddZdS)RegeneratableOptionParsercCsi|_tjj||ddS)Nusage)1_RegeneratableOptionParser__regeneratable_optionsargparseArgumentParser__init__)selfrqrrrrusz"RegeneratableOptionParser.__init__cOs~|dd}d|vr0|ddr0|d}|d}|dkr!t|d<|d|||d d |j|<tjj|g|Ri|dS) aAdd an option to the parser. This accepts the same arguments as ArgumentParser.add_argument, plus the following: regenerate: can be set to False to prevent this option from being included in regeneration. env_name: name of environment variable that additional values for this option come from. type: adds type='path', to tell the regenerator that the values of this option need to be made relative to options.depth rPNdest regenerateTrerrfr)rfrerPrT)popr1strrrrsrt add_argument)rvrkwrPrwrerrrr{s   z&RegeneratableOptionParser.add_argumentcGs(tjj|g|R\}}|j|_||fSrM)rsrtZparse_known_argsrrrj)rvrrZrrr parse_args6sz$RegeneratableOptionParser.parse_argsN)__name__ __module__ __qualname__rur{r}rrrrros roc#Cstjtjd}d}t|ddd}|jdddd d |jd d d dd |jddddddd|jdddddgdd|jddddddd |jd!d"d#d$d%d&|jd'd(d)dd*d+d,d-|jd.d/dgd0d1d2d3|jd4d5ddd6d$d7d8d9|jd:d;dd?|jd@dAdBddCd$dDdE|jdFdGd}tj%tj&|}|tjj'}t(|}t)|dfdldlD]}||dmkr tjj'||_$n||=q|j$rnq|j$s!t#dn|j*s)|j$|_*i}g}|j r7|t+d7}|j,r@||j,7}t-|}ttjvrPttdo|g}|rntj|dp}tj|rnt.dq||||j/rx|0|j/g}|j r|t+d17}|j1r||j17}t-|}ttj2vrttdr|t3|jD][}|||t4|tjd||j|j5| dsdOdt }t6|||||j$||j7|j8\}}}} |9||| ||j:r||ddu}!|j:D]}"|"|!vrt#dv|"q|;| |j:|qdS)wNrz.usage: %(prog)s [options ...] [build_file ...]z%sz%(prog)srpz--buildconfigsrz0configuration for build after project generation)rwrfhelpz--checkrArhzcheck format of gyp filesz --config-dir config_dirrgZGYP_CONFIG_DIRz7The location for configuration files like include.gypi.)rwrfrPdefaultrz-dz--debugr Z DEBUGMODEzturn on a debugging mode for debugging GYP. Supported modes are "variables", "includes" and "general" or "all" for all of them.)rwmetavarrfrrz-DdefineszVAR=VALZ GYP_DEFINESzsets variable VAR to value VAL)rwrfrrPrz--depthr?PATHrz1set DEPTH gyp variable to a relative path to PATH)rwrrerz-fz--formatformatsZGYP_GENERATORSFzoutput formats to generate)rwrfrPrxrz-Ggenerator_flagszFLAG=VALZGYP_GENERATOR_FLAGSzsets generator flag FLAG to VAL)rwrfrrrPrz--generator-outputgenerator_outputZDIRZGYP_GENERATOR_OUTPUTz$puts generated build files under DIR)rwrfrrrerPrrdrWriTz.do not read options from environment variables)rwrfrrxrz-Iz --includerZINCLUDEz)files to include in all loaded .gyp files)rwrfrrerz--no-circular-checkrBz4don't check for circular relationships between filesz --no-parallelzDisable multiprocessing)rfrrz-Sz--suffixsuffixr&z suffix to add to generated files)rwrrz--toplevel-dir toplevel_dirz/directory to use as the root of the source tree)rwrfrrrerz-Rz --root-targetr.ZTARGETz-include only TARGET and its deep dependencies)rwrfrrZHOME)cygwinwin32 USERPROFILErz[\s,]darwinZxcode)rrZmsvsZmakerzrunning with these options:_z %s: '%s'z %s: %sz %s: error: no build_filesrczCould not automatically locate src directory. This isa temporary Chromium feature that will be removed. Use--depth as a workaround.zcmdline_default_variables: %sz include.gypizUsing overrides found in zgenerator_flags: %s target_arch) r\r!rcwdbuild_files_argZ gyp_binary home_dot_gypr-r.rZconfigurationsz(Invalid config specified via --build: %s)r@rCZ flat_listtargetsdataZ valid_configsZconfrrrgyp_main<s                                     rc CsBzt|WSty }ztjd|WYd}~dSd}~ww)Nzgyp: %s r)rrr4rlwrite)rerrrmains rcCsttjddS)Nr)rr4rrrrr script_mainsr__main__)r0Z gyp.inputr rsZos.pathrrrOr4r Z gyp.commonrr rZDEBUG_VARIABLESZDEBUG_INCLUDESrr#r=rLrRrVr^rnrtrorrrr~exitrrrrsH   f;*R # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'variables': { 'chromium_code': 1, # Override to dynamically link the PulseAudio library. 'use_pulseaudio%': 0, # Override to dynamically link the cras (ChromeOS audio) library. 'use_cras%': 0, }, 'targets': [ { 'target_name': 'media', 'type': '<(component)', 'dependencies': [ 'yuv_convert', '../base/base.gyp:base', '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', '../build/temp_gyp/googleurl.gyp:googleurl', '../crypto/crypto.gyp:crypto', '../third_party/openmax/openmax.gyp:il', '../ui/ui.gyp:ui', ], 'defines': [ 'MEDIA_IMPLEMENTATION', ], 'include_dirs': [ '..', ], 'sources': [ 'audio/android/audio_manager_android.cc', 'audio/android/audio_manager_android.h', 'audio/android/audio_track_output_android.cc', 'audio/android/audio_track_output_android.h', 'audio/android/opensles_input.cc', 'audio/android/opensles_input.h', 'audio/android/opensles_output.cc', 'audio/android/opensles_output.h', 'audio/async_socket_io_handler.h', 'audio/async_socket_io_handler_posix.cc', 'audio/async_socket_io_handler_win.cc', 'audio/audio_buffers_state.cc', 'audio/audio_buffers_state.h', 'audio/audio_io.h', 'audio/audio_input_controller.cc', 'audio/audio_input_controller.h', 'audio/audio_input_stream_impl.cc', 'audio/audio_input_stream_impl.h', 'audio/audio_device_name.cc', 'audio/audio_device_name.h', 'audio/audio_manager.cc', 'audio/audio_manager.h', 'audio/audio_manager_base.cc', 'audio/audio_manager_base.h', 'audio/audio_output_controller.cc', 'audio/audio_output_controller.h', 'audio/audio_output_dispatcher.cc', 'audio/audio_output_dispatcher.h', 'audio/audio_output_dispatcher_impl.cc', 'audio/audio_output_dispatcher_impl.h', 'audio/audio_output_mixer.cc', 'audio/audio_output_mixer.h', 'audio/audio_output_proxy.cc', 'audio/audio_output_proxy.h', 'audio/audio_parameters.cc', 'audio/audio_parameters.h', 'audio/audio_util.cc', 'audio/audio_util.h', 'audio/cross_process_notification.cc', 'audio/cross_process_notification.h', 'audio/cross_process_notification_win.cc', 'audio/cross_process_notification_posix.cc', 'audio/fake_audio_input_stream.cc', 'audio/fake_audio_input_stream.h', 'audio/fake_audio_output_stream.cc', 'audio/fake_audio_output_stream.h', 'audio/linux/audio_manager_linux.cc', 'audio/linux/audio_manager_linux.h', 'audio/linux/alsa_input.cc', 'audio/linux/alsa_input.h', 'audio/linux/alsa_output.cc', 'audio/linux/alsa_output.h', 'audio/linux/alsa_util.cc', 'audio/linux/alsa_util.h', 'audio/linux/alsa_wrapper.cc', 'audio/linux/alsa_wrapper.h', 'audio/linux/cras_output.cc', 'audio/linux/cras_output.h', 'audio/openbsd/audio_manager_openbsd.cc', 'audio/openbsd/audio_manager_openbsd.h', 'audio/mac/audio_input_mac.cc', 'audio/mac/audio_input_mac.h', 'audio/mac/audio_low_latency_input_mac.cc', 'audio/mac/audio_low_latency_input_mac.h', 'audio/mac/audio_low_latency_output_mac.cc', 'audio/mac/audio_low_latency_output_mac.h', 'audio/mac/audio_manager_mac.cc', 'audio/mac/audio_manager_mac.h', 'audio/mac/audio_output_mac.cc', 'audio/mac/audio_output_mac.h', 'audio/null_audio_sink.cc', 'audio/null_audio_sink.h', 'audio/pulse/pulse_output.cc', 'audio/pulse/pulse_output.h', 'audio/sample_rates.cc', 'audio/sample_rates.h', 'audio/simple_sources.cc', 'audio/simple_sources.h', 'audio/win/audio_low_latency_input_win.cc', 'audio/win/audio_low_latency_input_win.h', 'audio/win/audio_low_latency_output_win.cc', 'audio/win/audio_low_latency_output_win.h', 'audio/win/audio_manager_win.cc', 'audio/win/audio_manager_win.h', 'audio/win/avrt_wrapper_win.cc', 'audio/win/avrt_wrapper_win.h', 'audio/win/device_enumeration_win.cc', 'audio/win/device_enumeration_win.h', 'audio/win/wavein_input_win.cc', 'audio/win/wavein_input_win.h', 'audio/win/waveout_output_win.cc', 'audio/win/waveout_output_win.h', 'base/android/media_jni_registrar.cc', 'base/android/media_jni_registrar.h', 'base/audio_decoder.cc', 'base/audio_decoder.h', 'base/audio_decoder_config.cc', 'base/audio_decoder_config.h', 'base/audio_renderer.h', 'base/audio_renderer_mixer.cc', 'base/audio_renderer_mixer.h', 'base/audio_renderer_mixer_input.cc', 'base/audio_renderer_mixer_input.h', 'base/bitstream_buffer.h', 'base/buffers.cc', 'base/buffers.h', 'base/byte_queue.cc', 'base/byte_queue.h', 'base/channel_layout.cc', 'base/channel_layout.h', 'base/clock.cc', 'base/clock.h', 'base/composite_filter.cc', 'base/composite_filter.h', 'base/data_buffer.cc', 'base/data_buffer.h', 'base/data_source.cc', 'base/data_source.h', 'base/decoder_buffer.cc', 'base/decoder_buffer.h', 'base/decrypt_config.cc', 'base/decrypt_config.h', 'base/decryptor.h', 'base/decryptor_client.h', 'base/demuxer.cc', 'base/demuxer.h', 'base/demuxer_stream.cc', 'base/demuxer_stream.h', 'base/djb2.cc', 'base/djb2.h', 'base/filter_collection.cc', 'base/filter_collection.h', 'base/filter_host.h', 'base/filters.cc', 'base/filters.h', 'base/h264_bitstream_converter.cc', 'base/h264_bitstream_converter.h', 'base/media.h', 'base/media_android.cc', 'base/media_export.h', 'base/media_log.cc', 'base/media_log.h', 'base/media_log_event.h', 'base/media_posix.cc', 'base/media_switches.cc', 'base/media_switches.h', 'base/media_win.cc', 'base/message_loop_factory.cc', 'base/message_loop_factory.h', 'base/pipeline.cc', 'base/pipeline.h', 'base/pipeline_status.cc', 'base/pipeline_status.h', 'base/ranges.cc', 'base/ranges.h', 'base/seekable_buffer.cc', 'base/seekable_buffer.h', 'base/state_matrix.cc', 'base/state_matrix.h', 'base/stream_parser.cc', 'base/stream_parser.h', 'base/stream_parser_buffer.cc', 'base/stream_parser_buffer.h', 'base/video_decoder.cc', 'base/video_decoder.h', 'base/video_decoder_config.cc', 'base/video_decoder_config.h', 'base/video_frame.cc', 'base/video_frame.h', 'base/video_renderer.h', 'base/video_util.cc', 'base/video_util.h', 'crypto/aes_decryptor.cc', 'crypto/aes_decryptor.h', 'ffmpeg/ffmpeg_common.cc', 'ffmpeg/ffmpeg_common.h', 'ffmpeg/file_protocol.cc', 'ffmpeg/file_protocol.h', 'filters/audio_file_reader.cc', 'filters/audio_file_reader.h', 'filters/audio_renderer_algorithm.cc', 'filters/audio_renderer_algorithm.h', 'filters/audio_renderer_impl.cc', 'filters/audio_renderer_impl.h', 'filters/bitstream_converter.cc', 'filters/bitstream_converter.h', 'filters/chunk_demuxer.cc', 'filters/chunk_demuxer.h', 'filters/chunk_demuxer_client.h', 'filters/dummy_demuxer.cc', 'filters/dummy_demuxer.h', 'filters/ffmpeg_audio_decoder.cc', 'filters/ffmpeg_audio_decoder.h', 'filters/ffmpeg_demuxer.cc', 'filters/ffmpeg_demuxer.h', 'filters/ffmpeg_h264_bitstream_converter.cc', 'filters/ffmpeg_h264_bitstream_converter.h', 'filters/ffmpeg_glue.cc', 'filters/ffmpeg_glue.h', 'filters/ffmpeg_video_decoder.cc', 'filters/ffmpeg_video_decoder.h', 'filters/file_data_source.cc', 'filters/file_data_source.h', 'filters/gpu_video_decoder.cc', 'filters/gpu_video_decoder.h', 'filters/in_memory_url_protocol.cc', 'filters/in_memory_url_protocol.h', 'filters/source_buffer_stream.cc', 'filters/source_buffer_stream.h', 'filters/video_frame_generator.cc', 'filters/video_frame_generator.h', 'filters/video_renderer_base.cc', 'filters/video_renderer_base.h', 'video/capture/fake_video_capture_device.cc', 'video/capture/fake_video_capture_device.h', 'video/capture/linux/video_capture_device_linux.cc', 'video/capture/linux/video_capture_device_linux.h', 'video/capture/mac/video_capture_device_mac.h', 'video/capture/mac/video_capture_device_mac.mm', 'video/capture/mac/video_capture_device_qtkit_mac.h', 'video/capture/mac/video_capture_device_qtkit_mac.mm', 'video/capture/video_capture.h', 'video/capture/video_capture_device.h', 'video/capture/video_capture_device_dummy.cc', 'video/capture/video_capture_device_dummy.h', 'video/capture/video_capture_proxy.cc', 'video/capture/video_capture_proxy.h', 'video/capture/video_capture_types.h', 'video/capture/win/filter_base_win.cc', 'video/capture/win/filter_base_win.h', 'video/capture/win/pin_base_win.cc', 'video/capture/win/pin_base_win.h', 'video/capture/win/sink_filter_observer_win.h', 'video/capture/win/sink_filter_win.cc', 'video/capture/win/sink_filter_win.h', 'video/capture/win/sink_input_pin_win.cc', 'video/capture/win/sink_input_pin_win.h', 'video/capture/win/video_capture_device_win.cc', 'video/capture/win/video_capture_device_win.h', 'video/picture.cc', 'video/picture.h', 'video/video_decode_accelerator.cc', 'video/video_decode_accelerator.h', 'webm/webm_constants.h', 'webm/webm_cluster_parser.cc', 'webm/webm_cluster_parser.h', 'webm/webm_content_encodings.cc', 'webm/webm_content_encodings.h', 'webm/webm_content_encodings_client.cc', 'webm/webm_content_encodings_client.h', 'webm/webm_info_parser.cc', 'webm/webm_info_parser.h', 'webm/webm_parser.cc', 'webm/webm_parser.h', 'webm/webm_stream_parser.cc', 'webm/webm_stream_parser.h', 'webm/webm_tracks_parser.cc', 'webm/webm_tracks_parser.h', ], 'direct_dependent_settings': { 'include_dirs': [ '..', ], }, 'conditions': [ # Android doesn't use ffmpeg, so make the dependency conditional # and exclude the sources which depend on ffmpeg. ['OS != "android"', { 'dependencies': [ '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg', ], }], ['OS == "android"', { 'sources!': [ 'base/media_posix.cc', 'ffmpeg/ffmpeg_common.cc', 'ffmpeg/ffmpeg_common.h', 'ffmpeg/file_protocol.cc', 'ffmpeg/file_protocol.h', 'filters/audio_file_reader.cc', 'filters/audio_file_reader.h', 'filters/bitstream_converter.cc', 'filters/bitstream_converter.h', 'filters/chunk_demuxer.cc', 'filters/chunk_demuxer.h', 'filters/chunk_demuxer_client.h', 'filters/ffmpeg_audio_decoder.cc', 'filters/ffmpeg_audio_decoder.h', 'filters/ffmpeg_demuxer.cc', 'filters/ffmpeg_demuxer.h', 'filters/ffmpeg_h264_bitstream_converter.cc', 'filters/ffmpeg_h264_bitstream_converter.h', 'filters/ffmpeg_glue.cc', 'filters/ffmpeg_glue.h', 'filters/ffmpeg_video_decoder.cc', 'filters/ffmpeg_video_decoder.h', 'filters/gpu_video_decoder.cc', 'filters/gpu_video_decoder.h', 'webm/webm_cluster_parser.cc', 'webm/webm_cluster_parser.h', 'webm/webm_stream_parser.cc', 'webm/webm_stream_parser.h', ], }], # The below 'android' condition were added temporarily and should be # removed in downstream, because there is no Java environment setup in # upstream yet. ['OS == "android"', { 'sources!':[ 'audio/android/audio_track_output_android.cc', ], 'sources':[ 'audio/android/audio_track_output_stub_android.cc', ], 'link_settings': { 'libraries': [ '-lOpenSLES', ], }, }], ['OS=="linux" or OS=="freebsd" or OS=="solaris"', { 'link_settings': { 'libraries': [ '-lasound', ], }, }], ['OS=="openbsd"', { 'sources/': [ ['exclude', '/alsa_' ], ['exclude', '/audio_manager_linux' ] ], 'link_settings': { 'libraries': [ ], }, }], ['OS!="openbsd"', { 'sources!': [ 'audio/openbsd/audio_manager_openbsd.cc', 'audio/openbsd/audio_manager_openbsd.h', ], }], ['OS=="linux"', { 'variables': { 'conditions': [ ['sysroot!=""', { 'pkg-config': '../build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)"', }, { 'pkg-config': 'pkg-config' }], ], }, 'conditions': [ ['use_cras == 1', { 'cflags': [ ' 1) return true for (var j = 0; j < set[0].length; j++) { if (typeof set[0][j] !== 'string') return true } return false } glob.Glob = Glob inherits(Glob, EE) function Glob (pattern, options, cb) { if (typeof options === 'function') { cb = options options = null } if (options && options.sync) { if (cb) throw new TypeError('callback provided to sync glob') return new GlobSync(pattern, options) } if (!(this instanceof Glob)) return new Glob(pattern, options, cb) setopts(this, pattern, options) this._didRealPath = false // process each pattern in the minimatch set var n = this.minimatch.set.length // The matches are stored as {: true,...} so that // duplicates are automagically pruned. // Later, we do an Object.keys() on these. // Keep them as a list so we can fill in when nonull is set. this.matches = new Array(n) if (typeof cb === 'function') { cb = once(cb) this.on('error', cb) this.on('end', function (matches) { cb(null, matches) }) } var self = this this._processing = 0 this._emitQueue = [] this._processQueue = [] this.paused = false if (this.noprocess) return this if (n === 0) return done() var sync = true for (var i = 0; i < n; i ++) { this._process(this.minimatch.set[i], i, false, done) } sync = false function done () { --self._processing if (self._processing <= 0) { if (sync) { process.nextTick(function () { self._finish() }) } else { self._finish() } } } } Glob.prototype._finish = function () { assert(this instanceof Glob) if (this.aborted) return if (this.realpath && !this._didRealpath) return this._realpath() common.finish(this) this.emit('end', this.found) } Glob.prototype._realpath = function () { if (this._didRealpath) return this._didRealpath = true var n = this.matches.length if (n === 0) return this._finish() var self = this for (var i = 0; i < this.matches.length; i++) this._realpathSet(i, next) function next () { if (--n === 0) self._finish() } } Glob.prototype._realpathSet = function (index, cb) { var matchset = this.matches[index] if (!matchset) return cb() var found = Object.keys(matchset) var self = this var n = found.length if (n === 0) return cb() var set = this.matches[index] = Object.create(null) found.forEach(function (p, i) { // If there's a problem with the stat, then it means that // one or more of the links in the realpath couldn't be // resolved. just return the abs value in that case. p = self._makeAbs(p) rp.realpath(p, self.realpathCache, function (er, real) { if (!er) set[real] = true else if (er.syscall === 'stat') set[p] = true else self.emit('error', er) // srsly wtf right here if (--n === 0) { self.matches[index] = set cb() } }) }) } Glob.prototype._mark = function (p) { return common.mark(this, p) } Glob.prototype._makeAbs = function (f) { return common.makeAbs(this, f) } Glob.prototype.abort = function () { this.aborted = true this.emit('abort') } Glob.prototype.pause = function () { if (!this.paused) { this.paused = true this.emit('pause') } } Glob.prototype.resume = function () { if (this.paused) { this.emit('resume') this.paused = false if (this._emitQueue.length) { var eq = this._emitQueue.slice(0) this._emitQueue.length = 0 for (var i = 0; i < eq.length; i ++) { var e = eq[i] this._emitMatch(e[0], e[1]) } } if (this._processQueue.length) { var pq = this._processQueue.slice(0) this._processQueue.length = 0 for (var i = 0; i < pq.length; i ++) { var p = pq[i] this._processing-- this._process(p[0], p[1], p[2], p[3]) } } } } Glob.prototype._process = function (pattern, index, inGlobStar, cb) { assert(this instanceof Glob) assert(typeof cb === 'function') if (this.aborted) return this._processing++ if (this.paused) { this._processQueue.push([pattern, index, inGlobStar, cb]) return } //console.error('PROCESS %d', this._processing, pattern) // Get the first [n] parts of pattern that are all strings. var n = 0 while (typeof pattern[n] === 'string') { n ++ } // now n is the index of the first one that is *not* a string. // see if there's anything else var prefix switch (n) { // if not, then this is rather simple case pattern.length: this._processSimple(pattern.join('/'), index, cb) return case 0: // pattern *starts* with some non-trivial item. // going to readdir(cwd), but not include the prefix in matches. prefix = null break default: // pattern has some string bits in the front. // whatever it starts with, whether that's 'absolute' like /foo/bar, // or 'relative' like '../baz' prefix = pattern.slice(0, n).join('/') break } var remain = pattern.slice(n) // get the list of entries. var read if (prefix === null) read = '.' else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { if (!prefix || !isAbsolute(prefix)) prefix = '/' + prefix read = prefix } else read = prefix var abs = this._makeAbs(read) //if ignored, skip _processing if (childrenIgnored(this, read)) return cb() var isGlobStar = remain[0] === minimatch.GLOBSTAR if (isGlobStar) this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) else this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) } Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { var self = this this._readdir(abs, inGlobStar, function (er, entries) { return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) }) } Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { // if the abs isn't a dir, then nothing can match! if (!entries) return cb() // It will only match dot entries if it starts with a dot, or if // dot is set. Stuff like @(.foo|.bar) isn't allowed. var pn = remain[0] var negate = !!this.minimatch.negate var rawGlob = pn._glob var dotOk = this.dot || rawGlob.charAt(0) === '.' var matchedEntries = [] for (var i = 0; i < entries.length; i++) { var e = entries[i] if (e.charAt(0) !== '.' || dotOk) { var m if (negate && !prefix) { m = !e.match(pn) } else { m = e.match(pn) } if (m) matchedEntries.push(e) } } //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) var len = matchedEntries.length // If there are no matched entries, then nothing matches. if (len === 0) return cb() // if this is the last remaining pattern bit, then no need for // an additional stat *unless* the user has specified mark or // stat explicitly. We know they exist, since readdir returned // them. if (remain.length === 1 && !this.mark && !this.stat) { if (!this.matches[index]) this.matches[index] = Object.create(null) for (var i = 0; i < len; i ++) { var e = matchedEntries[i] if (prefix) { if (prefix !== '/') e = prefix + '/' + e else e = prefix + e } if (e.charAt(0) === '/' && !this.nomount) { e = path.join(this.root, e) } this._emitMatch(index, e) } // This was the last one, and no stats were needed return cb() } // now test all matched entries as stand-ins for that part // of the pattern. remain.shift() for (var i = 0; i < len; i ++) { var e = matchedEntries[i] var newPattern if (prefix) { if (prefix !== '/') e = prefix + '/' + e else e = prefix + e } this._process([e].concat(remain), index, inGlobStar, cb) } cb() } Glob.prototype._emitMatch = function (index, e) { if (this.aborted) return if (isIgnored(this, e)) return if (this.paused) { this._emitQueue.push([index, e]) return } var abs = isAbsolute(e) ? e : this._makeAbs(e) if (this.mark) e = this._mark(e) if (this.absolute) e = abs if (this.matches[index][e]) return if (this.nodir) { var c = this.cache[abs] if (c === 'DIR' || Array.isArray(c)) return } this.matches[index][e] = true var st = this.statCache[abs] if (st) this.emit('stat', e, st) this.emit('match', e) } Glob.prototype._readdirInGlobStar = function (abs, cb) { if (this.aborted) return // follow all symlinked directories forever // just proceed as if this is a non-globstar situation if (this.follow) return this._readdir(abs, false, cb) var lstatkey = 'lstat\0' + abs var self = this var lstatcb = inflight(lstatkey, lstatcb_) if (lstatcb) fs.lstat(abs, lstatcb) function lstatcb_ (er, lstat) { if (er && er.code === 'ENOENT') return cb() var isSym = lstat && lstat.isSymbolicLink() self.symlinks[abs] = isSym // If it's not a symlink or a dir, then it's definitely a regular file. // don't bother doing a readdir in that case. if (!isSym && lstat && !lstat.isDirectory()) { self.cache[abs] = 'FILE' cb() } else self._readdir(abs, false, cb) } } Glob.prototype._readdir = function (abs, inGlobStar, cb) { if (this.aborted) return cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) if (!cb) return //console.error('RD %j %j', +inGlobStar, abs) if (inGlobStar && !ownProp(this.symlinks, abs)) return this._readdirInGlobStar(abs, cb) if (ownProp(this.cache, abs)) { var c = this.cache[abs] if (!c || c === 'FILE') return cb() if (Array.isArray(c)) return cb(null, c) } var self = this fs.readdir(abs, readdirCb(this, abs, cb)) } function readdirCb (self, abs, cb) { return function (er, entries) { if (er) self._readdirError(abs, er, cb) else self._readdirEntries(abs, entries, cb) } } Glob.prototype._readdirEntries = function (abs, entries, cb) { if (this.aborted) return // if we haven't asked to stat everything, then just // assume that everything in there exists, so we can avoid // having to stat it a second time. if (!this.mark && !this.stat) { for (var i = 0; i < entries.length; i ++) { var e = entries[i] if (abs === '/') e = abs + e else e = abs + '/' + e this.cache[e] = true } } this.cache[abs] = entries return cb(null, entries) } Glob.prototype._readdirError = function (f, er, cb) { if (this.aborted) return // handle errors, and cache the information switch (er.code) { case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 case 'ENOTDIR': // totally normal. means it *does* exist. var abs = this._makeAbs(f) this.cache[abs] = 'FILE' if (abs === this.cwdAbs) { var error = new Error(er.code + ' invalid cwd ' + this.cwd) error.path = this.cwd error.code = er.code this.emit('error', error) this.abort() } break case 'ENOENT': // not terribly unusual case 'ELOOP': case 'ENAMETOOLONG': case 'UNKNOWN': this.cache[this._makeAbs(f)] = false break default: // some unusual error. Treat as failure. this.cache[this._makeAbs(f)] = false if (this.strict) { this.emit('error', er) // If the error is handled, then we abort // if not, we threw out of here this.abort() } if (!this.silent) console.error('glob error', er) break } return cb() } Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { var self = this this._readdir(abs, inGlobStar, function (er, entries) { self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) }) } Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { //console.error('pgs2', prefix, remain[0], entries) // no entries means not a dir, so it can never have matches // foo.txt/** doesn't match foo.txt if (!entries) return cb() // test without the globstar, and with every child both below // and replacing the globstar. var remainWithoutGlobStar = remain.slice(1) var gspref = prefix ? [ prefix ] : [] var noGlobStar = gspref.concat(remainWithoutGlobStar) // the noGlobStar pattern exits the inGlobStar state this._process(noGlobStar, index, false, cb) var isSym = this.symlinks[abs] var len = entries.length // If it's a symlink, and we're in a globstar, then stop if (isSym && inGlobStar) return cb() for (var i = 0; i < len; i++) { var e = entries[i] if (e.charAt(0) === '.' && !this.dot) continue // these two cases enter the inGlobStar state var instead = gspref.concat(entries[i], remainWithoutGlobStar) this._process(instead, index, true, cb) var below = gspref.concat(entries[i], remain) this._process(below, index, true, cb) } cb() } Glob.prototype._processSimple = function (prefix, index, cb) { // XXX review this. Shouldn't it be doing the mounting etc // before doing stat? kinda weird? var self = this this._stat(prefix, function (er, exists) { self._processSimple2(prefix, index, er, exists, cb) }) } Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { //console.error('ps2', prefix, exists) if (!this.matches[index]) this.matches[index] = Object.create(null) // If it doesn't exist, then just mark the lack of results if (!exists) return cb() if (prefix && isAbsolute(prefix) && !this.nomount) { var trail = /[\/\\]$/.test(prefix) if (prefix.charAt(0) === '/') { prefix = path.join(this.root, prefix) } else { prefix = path.resolve(this.root, prefix) if (trail) prefix += '/' } } if (process.platform === 'win32') prefix = prefix.replace(/\\/g, '/') // Mark this as a match this._emitMatch(index, prefix) cb() } // Returns either 'DIR', 'FILE', or false Glob.prototype._stat = function (f, cb) { var abs = this._makeAbs(f) var needDir = f.slice(-1) === '/' if (f.length > this.maxLength) return cb() if (!this.stat && ownProp(this.cache, abs)) { var c = this.cache[abs] if (Array.isArray(c)) c = 'DIR' // It exists, but maybe not how we need it if (!needDir || c === 'DIR') return cb(null, c) if (needDir && c === 'FILE') return cb() // otherwise we have to stat, because maybe c=true // if we know it exists, but not what it is. } var exists var stat = this.statCache[abs] if (stat !== undefined) { if (stat === false) return cb(null, stat) else { var type = stat.isDirectory() ? 'DIR' : 'FILE' if (needDir && type === 'FILE') return cb() else return cb(null, type, stat) } } var self = this var statcb = inflight('stat\0' + abs, lstatcb_) if (statcb) fs.lstat(abs, statcb) function lstatcb_ (er, lstat) { if (lstat && lstat.isSymbolicLink()) { // If it's a symlink, then treat it as the target, unless // the target does not exist, then treat it as a file. return fs.stat(abs, function (er, stat) { if (er) self._stat2(f, abs, null, lstat, cb) else self._stat2(f, abs, er, stat, cb) }) } else { self._stat2(f, abs, er, lstat, cb) } } } Glob.prototype._stat2 = function (f, abs, er, stat, cb) { if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { this.statCache[abs] = false return cb() } var needDir = f.slice(-1) === '/' this.statCache[abs] = stat if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) return cb(null, false, stat) var c = true if (stat) c = stat.isDirectory() ? 'DIR' : 'FILE' this.cache[abs] = this.cache[abs] || c if (needDir && c === 'FILE') return cb() return cb(null, c, stat) } The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ## Glob Logo Glob's logo created by Tanya Brassie , licensed under a Creative Commons Attribution-ShareAlike 4.0 International License https://creativecommons.org/licenses/by-sa/4.0/ { "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "name": "glob", "description": "a little globber", "version": "7.1.7", "repository": { "type": "git", "url": "git://github.com/isaacs/node-glob.git" }, "main": "glob.js", "files": [ "glob.js", "sync.js", "common.js" ], "engines": { "node": "*" }, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, "devDependencies": { "mkdirp": "0", "rimraf": "^2.2.8", "tap": "^15.0.6", "tick": "0.0.6" }, "tap": { "before": "test/00-setup.js", "after": "test/zz-cleanup.js", "jobs": 1 }, "scripts": { "prepublish": "npm run benchclean", "profclean": "rm -f v8.log profile.txt", "test": "tap", "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js", "bench": "bash benchmark.sh", "prof": "bash prof.sh && cat profile.txt", "benchclean": "node benchclean.js" }, "license": "ISC", "funding": { "url": "https://github.com/sponsors/isaacs" } } module.exports = globSync globSync.GlobSync = GlobSync var fs = require('fs') var rp = require('fs.realpath') var minimatch = require('minimatch') var Minimatch = minimatch.Minimatch var Glob = require('./glob.js').Glob var util = require('util') var path = require('path') var assert = require('assert') var isAbsolute = require('path-is-absolute') var common = require('./common.js') var setopts = common.setopts var ownProp = common.ownProp var childrenIgnored = common.childrenIgnored var isIgnored = common.isIgnored function globSync (pattern, options) { if (typeof options === 'function' || arguments.length === 3) throw new TypeError('callback provided to sync glob\n'+ 'See: https://github.com/isaacs/node-glob/issues/167') return new GlobSync(pattern, options).found } function GlobSync (pattern, options) { if (!pattern) throw new Error('must provide pattern') if (typeof options === 'function' || arguments.length === 3) throw new TypeError('callback provided to sync glob\n'+ 'See: https://github.com/isaacs/node-glob/issues/167') if (!(this instanceof GlobSync)) return new GlobSync(pattern, options) setopts(this, pattern, options) if (this.noprocess) return this var n = this.minimatch.set.length this.matches = new Array(n) for (var i = 0; i < n; i ++) { this._process(this.minimatch.set[i], i, false) } this._finish() } GlobSync.prototype._finish = function () { assert(this instanceof GlobSync) if (this.realpath) { var self = this this.matches.forEach(function (matchset, index) { var set = self.matches[index] = Object.create(null) for (var p in matchset) { try { p = self._makeAbs(p) var real = rp.realpathSync(p, self.realpathCache) set[real] = true } catch (er) { if (er.syscall === 'stat') set[self._makeAbs(p)] = true else throw er } } }) } common.finish(this) } GlobSync.prototype._process = function (pattern, index, inGlobStar) { assert(this instanceof GlobSync) // Get the first [n] parts of pattern that are all strings. var n = 0 while (typeof pattern[n] === 'string') { n ++ } // now n is the index of the first one that is *not* a string. // See if there's anything else var prefix switch (n) { // if not, then this is rather simple case pattern.length: this._processSimple(pattern.join('/'), index) return case 0: // pattern *starts* with some non-trivial item. // going to readdir(cwd), but not include the prefix in matches. prefix = null break default: // pattern has some string bits in the front. // whatever it starts with, whether that's 'absolute' like /foo/bar, // or 'relative' like '../baz' prefix = pattern.slice(0, n).join('/') break } var remain = pattern.slice(n) // get the list of entries. var read if (prefix === null) read = '.' else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { if (!prefix || !isAbsolute(prefix)) prefix = '/' + prefix read = prefix } else read = prefix var abs = this._makeAbs(read) //if ignored, skip processing if (childrenIgnored(this, read)) return var isGlobStar = remain[0] === minimatch.GLOBSTAR if (isGlobStar) this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) else this._processReaddir(prefix, read, abs, remain, index, inGlobStar) } GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { var entries = this._readdir(abs, inGlobStar) // if the abs isn't a dir, then nothing can match! if (!entries) return // It will only match dot entries if it starts with a dot, or if // dot is set. Stuff like @(.foo|.bar) isn't allowed. var pn = remain[0] var negate = !!this.minimatch.negate var rawGlob = pn._glob var dotOk = this.dot || rawGlob.charAt(0) === '.' var matchedEntries = [] for (var i = 0; i < entries.length; i++) { var e = entries[i] if (e.charAt(0) !== '.' || dotOk) { var m if (negate && !prefix) { m = !e.match(pn) } else { m = e.match(pn) } if (m) matchedEntries.push(e) } } var len = matchedEntries.length // If there are no matched entries, then nothing matches. if (len === 0) return // if this is the last remaining pattern bit, then no need for // an additional stat *unless* the user has specified mark or // stat explicitly. We know they exist, since readdir returned // them. if (remain.length === 1 && !this.mark && !this.stat) { if (!this.matches[index]) this.matches[index] = Object.create(null) for (var i = 0; i < len; i ++) { var e = matchedEntries[i] if (prefix) { if (prefix.slice(-1) !== '/') e = prefix + '/' + e else e = prefix + e } if (e.charAt(0) === '/' && !this.nomount) { e = path.join(this.root, e) } this._emitMatch(index, e) } // This was the last one, and no stats were needed return } // now test all matched entries as stand-ins for that part // of the pattern. remain.shift() for (var i = 0; i < len; i ++) { var e = matchedEntries[i] var newPattern if (prefix) newPattern = [prefix, e] else newPattern = [e] this._process(newPattern.concat(remain), index, inGlobStar) } } GlobSync.prototype._emitMatch = function (index, e) { if (isIgnored(this, e)) return var abs = this._makeAbs(e) if (this.mark) e = this._mark(e) if (this.absolute) { e = abs } if (this.matches[index][e]) return if (this.nodir) { var c = this.cache[abs] if (c === 'DIR' || Array.isArray(c)) return } this.matches[index][e] = true if (this.stat) this._stat(e) } GlobSync.prototype._readdirInGlobStar = function (abs) { // follow all symlinked directories forever // just proceed as if this is a non-globstar situation if (this.follow) return this._readdir(abs, false) var entries var lstat var stat try { lstat = fs.lstatSync(abs) } catch (er) { if (er.code === 'ENOENT') { // lstat failed, doesn't exist return null } } var isSym = lstat && lstat.isSymbolicLink() this.symlinks[abs] = isSym // If it's not a symlink or a dir, then it's definitely a regular file. // don't bother doing a readdir in that case. if (!isSym && lstat && !lstat.isDirectory()) this.cache[abs] = 'FILE' else entries = this._readdir(abs, false) return entries } GlobSync.prototype._readdir = function (abs, inGlobStar) { var entries if (inGlobStar && !ownProp(this.symlinks, abs)) return this._readdirInGlobStar(abs) if (ownProp(this.cache, abs)) { var c = this.cache[abs] if (!c || c === 'FILE') return null if (Array.isArray(c)) return c } try { return this._readdirEntries(abs, fs.readdirSync(abs)) } catch (er) { this._readdirError(abs, er) return null } } GlobSync.prototype._readdirEntries = function (abs, entries) { // if we haven't asked to stat everything, then just // assume that everything in there exists, so we can avoid // having to stat it a second time. if (!this.mark && !this.stat) { for (var i = 0; i < entries.length; i ++) { var e = entries[i] if (abs === '/') e = abs + e else e = abs + '/' + e this.cache[e] = true } } this.cache[abs] = entries // mark and cache dir-ness return entries } GlobSync.prototype._readdirError = function (f, er) { // handle errors, and cache the information switch (er.code) { case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 case 'ENOTDIR': // totally normal. means it *does* exist. var abs = this._makeAbs(f) this.cache[abs] = 'FILE' if (abs === this.cwdAbs) { var error = new Error(er.code + ' invalid cwd ' + this.cwd) error.path = this.cwd error.code = er.code throw error } break case 'ENOENT': // not terribly unusual case 'ELOOP': case 'ENAMETOOLONG': case 'UNKNOWN': this.cache[this._makeAbs(f)] = false break default: // some unusual error. Treat as failure. this.cache[this._makeAbs(f)] = false if (this.strict) throw er if (!this.silent) console.error('glob error', er) break } } GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { var entries = this._readdir(abs, inGlobStar) // no entries means not a dir, so it can never have matches // foo.txt/** doesn't match foo.txt if (!entries) return // test without the globstar, and with every child both below // and replacing the globstar. var remainWithoutGlobStar = remain.slice(1) var gspref = prefix ? [ prefix ] : [] var noGlobStar = gspref.concat(remainWithoutGlobStar) // the noGlobStar pattern exits the inGlobStar state this._process(noGlobStar, index, false) var len = entries.length var isSym = this.symlinks[abs] // If it's a symlink, and we're in a globstar, then stop if (isSym && inGlobStar) return for (var i = 0; i < len; i++) { var e = entries[i] if (e.charAt(0) === '.' && !this.dot) continue // these two cases enter the inGlobStar state var instead = gspref.concat(entries[i], remainWithoutGlobStar) this._process(instead, index, true) var below = gspref.concat(entries[i], remain) this._process(below, index, true) } } GlobSync.prototype._processSimple = function (prefix, index) { // XXX review this. Shouldn't it be doing the mounting etc // before doing stat? kinda weird? var exists = this._stat(prefix) if (!this.matches[index]) this.matches[index] = Object.create(null) // If it doesn't exist, then just mark the lack of results if (!exists) return if (prefix && isAbsolute(prefix) && !this.nomount) { var trail = /[\/\\]$/.test(prefix) if (prefix.charAt(0) === '/') { prefix = path.join(this.root, prefix) } else { prefix = path.resolve(this.root, prefix) if (trail) prefix += '/' } } if (process.platform === 'win32') prefix = prefix.replace(/\\/g, '/') // Mark this as a match this._emitMatch(index, prefix) } // Returns either 'DIR', 'FILE', or false GlobSync.prototype._stat = function (f) { var abs = this._makeAbs(f) var needDir = f.slice(-1) === '/' if (f.length > this.maxLength) return false if (!this.stat && ownProp(this.cache, abs)) { var c = this.cache[abs] if (Array.isArray(c)) c = 'DIR' // It exists, but maybe not how we need it if (!needDir || c === 'DIR') return c if (needDir && c === 'FILE') return false // otherwise we have to stat, because maybe c=true // if we know it exists, but not what it is. } var exists var stat = this.statCache[abs] if (!stat) { var lstat try { lstat = fs.lstatSync(abs) } catch (er) { if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { this.statCache[abs] = false return false } } if (lstat && lstat.isSymbolicLink()) { try { stat = fs.statSync(abs) } catch (er) { stat = lstat } } else { stat = lstat } } this.statCache[abs] = stat var c = true if (stat) c = stat.isDirectory() ? 'DIR' : 'FILE' this.cache[abs] = this.cache[abs] || c if (needDir && c === 'FILE') return false return c } GlobSync.prototype._mark = function (p) { return common.mark(this, p) } GlobSync.prototype._makeAbs = function (f) { return common.makeAbs(this, f) } o ۤ_cK@sddlZddlZddlZddlZddlZddlZddlmZddlZ ddl m Z ddl m mZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZe dZ!e j"#Z$idddd d dd d d ddddddddddddddddddddd d!d"d#d$d%d&d'Z%d(d)gZ&gd*Z'da(d+d,gZ)da*da+d-d.Z,da-d/d0Z.dd2d3Z/d4d5Z0dd6d7Z1 dd9d:Z2ddd?Z4d@dAZ5dBdCZ6dDdEZ7dFdGZ8dHdIZ9dJdKZ:dLdMZ;dNdOZdTdUZ?dVdWZ@dXdYZAdZd[ZBd\d]ZCd^d_ZDd`daZEe dbZFdcddZGe deZHdfdgZIdhdiZJe djZKdkdlZLdmdnZMdodpZNdqdrZOdsdtZPdudvZQdwdxZRdydzZSd{d|ZTd}d~ZUddZVddZWddZXddZYddZZddZ[ddZ\ddZ]ddZ^ddZ_ddZ`ddZaddZbddZcddZdddZeddZfddZgddZhddZiddZjddZkddZlddZmddZnddZoddZpddZqddZrddZsddZtddZuddZvdd„ZwddĄZxddƄZyddȄZzddʄZ{dd̄Z|dd΄Z}ddЄZ~dd҄ZddԄZddքZdd؄ZGddڄdڃZdd܄ZddބZddZddZddZddZddZddZddZddZddZddZddZddZddZddZe dZddZddZddZddZddZddZdd Zd d Zd d ZddZddZddZddZddZdS(N) OrderedDict)GypError) OrderedSetz ^[A-F0-9\-]+$Z DRIVER_PREFIXZ DRIVER_SUFFIX.sysZEXECUTABLE_PREFIXZEXECUTABLE_SUFFIX.exeZSTATIC_LIB_PREFIXZSHARED_LIB_PREFIXZSTATIC_LIB_SUFFIX.libZSHARED_LIB_SUFFIX.dllZINTERMEDIATE_DIR $(IntDir)SHARED_INTERMEDIATE_DIRz!$(OutDir)/obj/global_intermediateZOSwinZ PRODUCT_DIR $(OutDir)ZLIB_DIRz $(OutDir)libZRULE_INPUT_ROOT $(InputName)ZRULE_INPUT_DIRNAME $(InputDir)ZRULE_INPUT_EXT $(InputExt)ZRULE_INPUT_NAME$(InputFileName) $(InputPath)z$(ConfigurationName))ZRULE_INPUT_PATHZCONFIGURATION_NAMEmsvs_cygwin_dirs msvs_props)rmsvs_cygwin_shellZmsvs_large_pdbZ msvs_shardmsvs_external_buildermsvs_external_builder_out_dirmsvs_external_builder_build_cmdmsvs_external_builder_clean_cmd#msvs_external_builder_clcompile_cmdmsvs_enable_winrtmsvs_requires_importlibrarymsvs_enable_winphonemsvs_application_type_revisionmsvs_target_platform_versionmsvs_target_platform_minversionmsvs_precompiled_headermsvs_precompiled_sourcecCstjdvrdStr tsXtjd}tjd}|r|sTtjgdtj d}| d d}t d t j}||}|rA|d }t d t j}||}|rT|d }|a|attfS) N)win32cygwin)ZDOMAINUSERNAMEZ USERDOMAINr%)ZnetconfigZ Workstation)stdoutrzutf-8z^User name\s+(\S+)z^Logon domain\s+(\S+))sysplatform cached_domaincached_usernameosenvironget subprocessPopenPIPE communicatedecoderecompile MULTILINEsearchgroup)domainusernamecallr&Z username_reZusername_matchZ domain_reZ domain_matchr=DD:\a\_work\1\s\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py_GetDomainAndUserNamels*        r?cCs(tj|}|d|dkr|}|S)zNormalize the path. But not if that gets rid of a variable, as this may expand to something larger than one directory. Arguments: source: The path to be normalize.d Returns: The normalized path. $)r-pathnormpathcount)source normalizedr=r=r>_NormalizedSources rF\cCstr|rtj|s|ddkst|stjt|}|dkr%|dd}t|}|dkr3|dd}|rA|d|krA|dd}|S)zConvert paths to a form that will make sense in a vcproj file. Arguments: path: The path to convert, may contain / etc. Returns: The path with all slashes made into backslashes. rr@rG/N)fixpath_prefixr-rAisabs_IsWindowsAbsPathjoinreplacerF)rA separatorr=r=r>_FixPaths$      rPcCs|dp |dS)z On Cygwin systems Python needs a little help determining if a path is an absolute Windows path or not, so that it does not treat those as relative, which results in bad paths like: '..\C:\\some_source_code_file.cc' zc:zC: startswithrAr=r=r>rLsrLcsfdd|DS)z"Fix each of the paths of the list.cg|]}t|qSr=rP.0irOr=r> z_FixPaths..r=)pathsrOr=rYr> _FixPathssr]Tc CsT|sg}g}g}t}|D]c}t|dkr.td||} | |vr(|| q || q |rO|sO||dsAg||d<||d|ddq t|ddg||dg|||d} tj |d| d} || q |r|rtj d|d} || |r|r|S|D]} t|| || g|||d} tj | | d} || q|S) aConverts a list split source file paths into a vcproj folder hierarchy. Arguments: sources: A list of source file paths split. prefix: A list of source file path layers meant to apply to each of sources. excluded: A set of excluded files. msvs_version: A MSVSVersion object. Returns: A hierarchy of filenames and MSVSProject.Filter objects that matches the layout of the source tree. For example: _ConvertSourcesToFilterHierarchy([['a', 'bob1.c'], ['b', 'bob2.c']], prefix=['joe']) --> [MSVSProject.Filter('a', contents=['joe\a\bob1.c']), MSVSProject.Filter('b', contents=['joe\b\bob2.c'])] r(rGrNexcluded list_excluded msvs_versioncontentsZ_excluded_files)prefixr_r`ra) rlenrFrMappend UsesVcxprojr/ _ConvertSourcesToFilterHierarchy MSVSProjectFilter) sourcesrdr_r`raresultZexcluded_resultZfolderssfilenamercZexcluded_folderfr=r=r>rhsT           rhFcCs|sdSt|||||dSN)_ToolSetOrAppend)tools tool_namesettingvalue only_if_unsetr=r=r> _ToolAppendsrwcCsd|vsd|vrt|tkr|dd}ndd|D}||s&t||<||}d|kr0dS||r_|r9dSt||tkrQt|tkrQ|||7<dStd|||t||f|||<dS) N DirectoriesZ DependenciesrHrGcSg|]}|ddqS)rHrGrNrVr=r=r>rZz$_ToolSetOrAppend..CompileAsWinRTzZAppending "%s" to a non-list setting "%s" for tool "%s" is not allowed, previous value: %s)typestrrNr/dictlist TypeError)rrrsrtrurvtoolr=r=r>rqs(     rqcC |ddS)NZmsvs_target_versionZWindows7r/ config_datar=r=r>_ConfigTargetVersion/ rcCr)Nmsvs_configuration_platformWin32rrr=r=r>_ConfigPlatform3rrcCs(|d|r|dt| dS|S)N_rr()endswithre) config_name platform_namer=r=r>_ConfigBaseName7srcCst|}t||d|S)N|)rr)rrrr=r=r>_ConfigFullName>src s|d}|rtd|r|S|d}|r|gnj}|D]K}dD]F}t||d}|s/q"t||dp8dd|}tfd d tj |rNt |ngDd d } | r_| d St dt j dq"qdS)NZ$msvs_windows_target_platform_versionz^\d+msvs_windows_sdk_version)z1HKLM\Software\Microsoft\Microsoft SDKs\Windows\%sz=HKLM\Software\Wow6432Node\Microsoft\Microsoft SDKs\Windows\%sZInstallationFolderProductVersionrz %s\includec3s|] }|r|VqdSrprQrWxversionr=r> Us z6_ConfigWindowsTargetPlatformVersion..T)reverserzCWarning: No include files found for detected Windows SDK version %sfile)r/r5matchcompatible_sdks MSVSVersionZ_RegistryGetValuesortedr-rAisdirlistdirprintr)r') rrZ target_verZ config_verversverkeyZsdk_dirZexpected_sdk_dirnamesr=rr>#_ConfigWindowsTargetPlatformVersionCs<       rc Csdd|Dr d}nd}|rt|ddgd}|}dd|D}d d|D}d d|D}|r9d d|D}d d|D}d |}d}|rM|d7}|d7}|ddkr\|d7}|ddkrg|d7}|ddkrr|d7}|r|ddkr|d7}|d7}|||d}||S|ddkrdg} n |dddg} | dddd|d dD} d!d| D} d"d| D} |rd#d| D} |d | | S)$NcSsg|]}d|vr|qS)rr=rr=r=r>rZnr{z/_BuildCommandLineForRuleRaw..z_set INPUTDIR=$(InputDir) if NOT DEFINED INPUTDIR set INPUTDIR=.\ set INPUTDIR=%INPUTDIR:~0,-1% rr.rcSry)r z`cygpath -m "${INTDIR}"`rzrVr=r=r>rZ| cSry)r z`cygpath -m "${OUTDIR}"`rzrVr=r=r>rZrcSry)rz`cygpath -m "${INPUTDIR}"`rzrVr=r=r>rZrcSry)rz`cygpath -m "${INPUTPATH}"`rzrVr=r=r>rZs cSsg|] }d|ddqS)z\"%s\""z\\\"rzrVr=r=r>rZ z4call "$(ProjectDir)%(cygwin_dir)s\setup_env.bat" && zset CYGWIN=nontsec&& ZNUMBER_OF_PROCESSORSz@set /a NUMBER_OF_PROCESSORS_PLUS_1=%%NUMBER_OF_PROCESSORS%%+1&& ZINTDIRzset INTDIR=$(IntDir)&& ZOUTDIRzset OUTDIR=$(OutDir)&& Z INPUTPATHzset INPUTPATH=$(InputPath) && zbash -c "%(cmd)s") cygwin_dircmdcatr}rHrGr<cSs*g|]}|dddvr|nt|dqS)Nr(z/-rHrUrVr=r=r>rZs*r(cSry)rz %INPUTDIR%rzrVr=r=r>rZr{cSg|]}t|qSr=) MSVSSettingsFixVCMacroSlashesrVr=r=r>rZr[cSg|]}d|qSz"%s"r=rVr=r=r>rZ)rPr/rMfindrNinsert) specrZ cygwin_shellhas_input_path quote_cmd do_setup_envZinput_dir_preamblerZ direct_cmdcommand argumentsr=r=r>_BuildCommandLineForRuleRawjs^   rcCs^|d}|durt|dd}n t|trt|}t|dd}t||d||||dS)Nrr(Zmsvs_quote_cmdaction)r)r/int isinstancer~r)rrulerrZmcsrr=r=r>_BuildCommandLineForRules  rcCs@|sJ||||d}|d}||vrg||<|||dS)aMerge action into an existing list of actions. Care must be taken so that actions which have overlapping inputs either don't get assigned to the same input, or get collapsed into one. Arguments: actions_dict: dictionary keyed on input name, which maps to a list of dicts describing the actions attached to that input file. inputs: list of inputs outputs: list of outputs description: description of the action command: command line to execute inputsoutputs descriptionrrNrf) actions_dictrrrrrZ chosen_inputr=r=r>_AddActionSteps rc Csht|}t|}td|d|d||d}|dD]\}} |jt|t|| |gdqdS)a8Add a custom build tool to execute something. Arguments: p: the target project spec: the target project dict primary_input: input file to attach the build tool to inputs: list of inputs outputs: list of outputs description: description of the action cmd: command line to execute ZVCCustomBuildTool;) DescriptionAdditionalDependenciesOutputs CommandLineconfigurationsrrN)r]riToolrMitems AddFileConfigrPr) pr primary_inputrrrrrrc_datar=r=r>_AddCustomBuildToolForMSVSs rc Cs|D]H}t}t}g}g}||D]"}|t|d|t|d||d||dqd|} d|} t|||||| | dqdS) aAdd actions accumulated into an actions_dict, merging as needed. Arguments: p: the target project spec: the target project dict actions_dict: dictionary keyed on input name, which maps to a list of dicts describing the actions attached to that input file. rrrr , and also  )rrrrrN)rupdaterfrMr) rrrrrr descriptionscommandsrrrr=r=r>_AddAccumulatedActionsToMSVSs,    rcCs|dtjtj|dd}|dtj|}|dtjtj|dd}|dtj|d}|d|}|S)zGiven the input file to which a rule applied, string substitute a path. Arguments: path: a path to string expand input_file: the file to which the rule applied. Returns: The string substituted path. rr(rrrrr)rNr-rAsplitextsplitdirname)rAZ input_filer=r=r>_RuleExpandPath/s  rcCs |dgS)zFind the list of files which a particular rule applies to. Arguments: rule: the rule in question sources: the set of all known source files for this project Returns: The list of sources that trigger a particular rule. rule_sourcesr)rrkr=r=r>_FindRuleTriggerFilesDs rcCsrt|dg}t|dg}t}t}|||D] }|t||q|D] }|t||q*||fS)zFind the inputs and outputs generated by a rule. Arguments: rule: the rule in question. trigger_file: the main trigger for this rule. Returns: The pair of (inputs, outputs) involved in this rule. rr)r]r/raddr)r trigger_fileZ raw_inputsZ raw_outputsrrrXor=r=r>_RuleInputsAndOutputsPs  rc Csd|d|j}ttj|||d}|D]=}|d}|d} t|dg} t|dg} d|vr=|dgs=qt ||d d d } |j ||d || g| | | d q| | |d S)zGenerate a native rules file. Arguments: p: the target project rules: the set of rules to include output_dir: the directory in which the project/gyp resides spec: the project dict options: global generator options z {}{}.rules target_name rule_name extensionrrrrTrrmessage)namer extensionsadditional_dependenciesrrN) formatsuffix MSVSToolFileWriterr-rArMr]r/rZAddCustomBuildRuleWriteIfChanged AddToolFile) rrules output_dirroptionsZrules_filenameZ rules_filerrZrule_extrrrr=r=r>_GenerateNativeRulesForMSVSes,   rcCs|dd}|dd}|S)Nr z$(OutDirCygwin)r z$(IntDirCygwin)rzrSr=r=r> _Cygwinifys  rc s(d|d|j}tjtj||}|d|dt }t } t } g} |D];} t | |} | D]1t | \}}| t || t || t|ddd|D}|D]}| |q]q4q+dd| D}|d d || D] }|r|d |qz|d |D]N} t | |} | D]Dt | \}}d d|D}dd|D}fdd| dD}dd|D}d |}|dd |d ||d|qq|||dddddd|g}t||dddd}t|}|d|t|t|t| d|d|ddS)aGGenerate an external makefile to do a set of rules. Arguments: rules: the list of rules to include output_dir: path containing project and gyp files spec: project specification data sources: set of sources known options: global generator options actions_to_add: The list of actions we will add to. z {}_rules{}.mkrz.OutDirCygwin:=$(shell cygpath -u "$(OutDir)") z.IntDirCygwin:=$(shell cygpath -u "$(IntDir)") rcSsg|] }tj|dqSr)r-rArrVr=r=r>rZrz*_GenerateExternalRules..cSg|]}t|qSr=rrVr=r=r>rZrzall: %s rz mkdir -p `cygpath -u "%s"`  cSrr=rrVr=r=r>rZrcSrr=rrVr=r=r>rZrcrTr=)rrWcZtfr=r>rZr[rcSrrr=rVr=r=r>rZrz{}: {} z %s makezOutDir=$(OutDir)zIntDir=$(IntDir)z-jz${NUMBER_OF_PROCESSORS_PLUS_1}z-fTFzRunning external rules for %srN)rrgypcommon WriteOnDiffr-rArMwriterrrrrfrrcloserrrr])rrrrkractions_to_addrnZmk_fileZ all_inputsZ all_outputsZall_output_dirsZ first_outputsr trigger_filesrrZ output_dirsZodZfirst_outputs_cygrr=rr>_GenerateExternalRulessv              r cCs|dd}|S)aEscapes % characters. Escapes any % characters so that Windows-style environment variable expansions will leave them alone. See http://connect.microsoft.com/VisualStudio/feedback/details/106127/cl-d-name-text-containing-percentage-characters-doesnt-compile to understand why we have to do this. Args: s: The string to be escaped. Returns: The escaped string. %z%%rzrmr=r=r>#_EscapeEnvironmentVariableExpansions rz(\\*)"cCs$dd}t||}d|d}|S)awEscapes a Windows command-line argument. So that the Win32 CommandLineToArgv function will turn the escaped result back into the original string. See http://msdn.microsoft.com/en-us/library/17w5ykft.aspx ("Parsing C++ Command-Line Arguments") to understand why we have to do this. Args: s: the string to be escaped. Returns: the escaped string. cSsd|ddS)Nr(\"r9rr=r=r>_Replace sz3_EscapeCommandLineArgumentForMSVS.._Replacer)quote_replacer_regexsubrmrr=r=r>!_EscapeCommandLineArgumentForMSVSs  rz (\\*)([,;]+)cCsldd}|d}tdt|dD] }t|||||<qd|}t|ddkr4td|tjd|S)aEscapes command line arguments for MSVS. The VCProj format stores string lists in a single string using commas and semi-colons as separators, which must be quoted if they are to be interpreted literally. However, command-line arguments may already have quotes, and the VCProj parser is ignorant of the backslash escaping convention used by CommandLineToArgv, so the command-line quotes and the VCProj quotes may not be the same quotes. So to store a general command-line argument in a VCProj list, we need to parse the existing quoting according to VCProj's convention and quote any delimiters that are not already quoted by that convention. The quotes that we add will also be seen by CommandLineToArgv, so if backslashes precede them then we also have to escape those backslashes according to the CommandLineToArgv convention. Args: s: the string to be escaped. Returns: the escaped string. cSs d|dd|ddS)Nrr(rrrr=r=r>r1s z5_EscapeVCProjCommandLineArgListItem.._Replacerrrz;Warning: MSVS may misinterpret the odd number of quotes in r) rrangeredelimiters_replacer_regexrrMrr)stderr)rmrsegmentsrXr=r=r>#_EscapeVCProjCommandLineArgListItems  rcC0t|}t|}t|}|ddtd}|SzBEscapes a CPP define so that it will reach the compiler unaltered.#z\%03o)rrrrNordrr=r=r>_EscapeCppDefineForMSVSL r#z(\\+)"cCsdd}t||}|S)z;Escapes a Windows command-line argument for use by MSBuild.cSst|dddddS)Nr(rrGr)rer9rr=r=r>r]sz6_EscapeCommandLineArgumentForMSBuild.._Replace)quote_replacer_regex2rrr=r=r>$_EscapeCommandLineArgumentForMSBuildZs r'cs0ddddddddd fd d |D}|S) Nz%25z%24z%40z%27z%3Bz%3Fz%2A)rr@@'r?*rcsg|]}||qSr=rrZescape_dictionaryr=r>rZor{z3_EscapeMSBuildSpecialCharacters..)rM)rmrlr=r,r>_EscapeMSBuildSpecialCharacterses r-cCrr )rr'r-rNr"rr=r=r>_EscapeCppDefineForMSBuildsr$r.c Csd|dg}dd|D}dd|D} |rt|||||| r)t| |||||t|||ddS)aGenerate all the rules for a particular project. Arguments: p: the project output_dir: directory to emit rules to options: global options passed to the generator spec: the specification for this project sources: the set of all known source files in this project excluded_sources: the set of sources excluded from normal processing actions_to_add: deferred list of actions to add in rcS g|] }t|dds|qSmsvs_external_rulerrr/rWrr=r=r>rZ z)_GenerateRulesForMSVS..cS g|] }t|ddr|qSr0r2r3r=r=r>rZr4FN)r/rr _AdjustSourcesForRules) rrrrrkexcluded_sourcesr r rules_nativerules_externalr=r=r>_GenerateRulesForMSVS~s  r:c Cs|D]F}t||}|D]<}|t|t|ddrGt||\}}tt|}tt|}|t|| ||sB| || |q qdS)Nprocess_outputs_as_sourcesF) rdiscardrPrr/rrr]remover) rrkr7Z is_msbuildrr rrrr=r=r>r6s       r6cs"tt|fdd|DS)a*Take inputs with actions attached out of the list of exclusions. Arguments: excluded_sources: list of source files not to be built. actions_to_add: dict of actions keyed on source file they're attached to. Returns: excluded_sources with files that have actions attached removed. cg|]}|vr|qSr=r=rWrmZ must_keepr=r>rZr{z._FilterActionsFromExcluded..)rr]keys)r7r r=r@r>_FilterActionsFromExcludeds rBcCs|d|dS)Nrdefault_configurationr=)rr=r=r>_GetDefaultConfigurationsrDcCsPt|}|d}|rt|durtd|tjfd|}|p%t|}|S)a Get the guid for the project. Arguments: proj_path: Path of the vcproj or vcxproj file to generate. spec: The target dictionary containing the properties of the target. Returns: the guid. Raises: ValueError: if the specified GUID is invalid. Z msvs_guidNz1Invalid MSVS guid: "%s". Must match regex: "%s".z{%s})rDr/VALID_MSVS_GUID_CHARSr ValueErrorpatternMSVSNewMakeGuid) proj_pathrdefault_configguidr=r=r>_GetGuidOfProjects rMcCs:t|}|d}|s|r|}|ddkrd}|S)aGet the platform toolset for the project. Arguments: proj_path: Path of the vcproj or vcxproj file to generate. spec: The target dictionary containing the properties of the target. version: The MSVSVersion object. Returns: the platform toolset string or None. msbuild_toolsetr}windows_driverzWindowsKernelModeDriver10.0)rDr/ZDefaultToolset)rJrrrKtoolsetr=r=r>_GetMsbuildToolsetOfProjects   rQcCs>t|j}|dr gS|rt|||||St||||S)aGenerates a vcproj file. Arguments: project: the MSVSProject object. options: global generator options. version: the MSVSVersion object. generator_flags: dict of generator-specific flags. Returns: A list of source files that cannot be found on disk. msvs_existing_vcproj)rDrr/rg_GenerateMSBuildProject_GenerateMSVSProject)projectrrgenerator_flagsrrKr=r=r>_GenerateProjects rWcCsr|j}tj|jt|}t|j||d|j|}t j |jd}t |j }tj ||} t||j } |dD] \} } t||| | | qrTsD            rTcCs6t}|dD] }|t|d|qt|}|S)zReturns the list of unique platforms for this spec, e.g ['win32', ...]. Arguments: spec: The target dictionary containing the properties of the target. Returns: The MSVSUserFile object created. r)rrrr)rrh configurationr=r=r>rZFs  rZcCs2t\}}d|||dg}t|||d}|S)aGenerates a .user file for the user running this Gyp program. Arguments: proj_path: The path of the project file being created. The .user file shares the same path (with an appropriate suffix). version: The VisualStudioVersion object. spec: The target dictionary containing the properties of the target. Returns: The MSVSUserFile object created. ruserr)r?rM MSVSUserFiler)rJrrr:r;Zvcuser_filename user_filer=r=r>_CreateMSVSUserFileVs rscCshzddddddd|d}W|Sty3|dr)td|d|d |ftd |d |fw) a(Returns the configuration type for this project. It's a number defined by Microsoft. May raise an exception. Args: spec: The target dictionary containing the properties of the target. build_file: The path of the gyp file. Returns: An integer, the configuration type. 124510) executableshared_libraryloadable_modulestatic_libraryrOnoner}z>Target type %s is not a valid target type for target %s in %s.rz'Missing type field for target %s in %s.)KeyErrorr/r)rr[rkr=r=r>r]gs0   r]cCst|\}}}t|}t|} t|dd\} } } t|} dd| D} t|}|d}|d}t|}|d}t}|di}t |t |d d d g|D]}|d|}|D] }t |||||q\qRt |d d |t |dd |t |dd |t |d d |t |d d| | rt || d| ddt |d d| t |dd| t |d ddddt |d d|t |dd|t |dd||rt j |d}t |d ddt |d d|t |d d||d d!krt |d d"d#|rt |d d$|t||||||d%S)&a+Adds a configuration to the MSVS project. Many settings in a vcproj file are specific to a configuration. This function the main part of the vcproj file that's configuration specific. Arguments: p: The target project being generated. spec: The target dictionary containing the properties of the target. config_type: The configuration type, a number as defined by Microsoft. config_name: The name of the configuration. config: The dictionary that defines the special processing to be done for this configuration. FmsbuildcSrr=)r#rWdr=r=r>rZrz2_AddConfigurationToMSVSProject.. msvs_prebuildmsvs_postbuildr! msvs_settings VCLinkerToolr $(NOINHERIT)VCCLCompilerToolAdditionalIncludeDirectoriesZ VCMIDLToolZVCResourceCompilerToolAdditionalLibraryDirectories OutputFileTrvPreprocessorDefinitionsZProgramDataBaseFileNamez $(IntDir)$(ProjectName)\vc80.pdbDisableSpecificWarningsZVCPreBuildEventToolrZVCPostBuildEventToolr(UsePrecompiledHeaderruZPrecompiledHeaderThroughForcedIncludeFilesr}r{IgnoreImportLibrarytrueModuleDefinitionFileN)_GetIncludeDirs _GetLibraries_GetLibraryDirs_GetOutputFilePathAndTool _GetDefines_GetDisabledWarningsr/_GetModuleDefinitionrrZValidateMSVSSettingsrwr-rAr_AddConfigurationToMSVS)rrrkrr& include_dirsmidl_include_dirsresource_include_dirs libraries library_dirsout_filevc_toolrdefinesdisabled_warningsprebuild postbuilddef_fileprecompiled_headerrrrrsettingsrtr=r=r>r^sp       r^cCs^|dg|dg}|dg|dg}|d|}t|}t|}t|}|||fS)zReturns the list of directories to be used for #include directives. Arguments: config: The dictionary that defines the special processing to be done for this configuration. Returns: The list of directory paths. rZmsvs_system_include_dirsrrr/r])r&rrrr=r=r>rs   rcCs|dg}t|}|S)zReturns the list of directories to be used for library search paths. Arguments: config: The dictionary that defines the special processing to be done for this configuration. Returns: The list of directory paths. rr)r&rr=r=r>rs rcCsr|dg}t}g}t|D]#}tdd|}tj|ds$|d7}||vr2||| |q| |S)zReturns the list of libraries for this configuration. Arguments: spec: The target dictionary containing the properties of the target. Returns: The list of directory paths. rz^\-lrr(r) r/rreversedr5rr-rArrrfr)rrfoundZunique_libraries_listentryZlibraryr=r=r>r s    rc Csd}d}d}dddddd}||d}|rYt|dd rY|\}}}}|d d r-d }|d |}|d} | r?d| }n|rCd}|dd} |dd} t|| | |}|||fS)aNReturns the path and tool to use for this target. Figures out the path of the file this spec will create and the name of the VC tool that will create it. Arguments: spec: The target dictionary containing the properties of the target. Returns: A triple of (file path, name of the vc tool, name of the msbuild tool) r)rLinkr r)rrr r )rrr r)ZVCLibrarianToolLibz $(OutDir)lib\rryrzr{rOr|r}Zmsvs_auto_output_filer(standalone_static_libraryrr product_dirproduct_extensionrz $(TargetExt)product_prefix product_name$(ProjectName))r/rntpathrM) rrrr msbuild_toolZoutput_file_mapZoutput_file_propsZout_dirrrrdrr=r=r>r$s0         rcCs|d}|r d|SdS)aqReturns the extension for this target, including the dot If product_extension is specified, set target_extension to this to avoid MSB8012, returns None otherwise. Ignores any target_extension settings in the input files. Arguments: spec: The target dictionary containing the properties of the target. Returns: A string with the extension, or None rrNr)rZtarget_extensionr=r=r>_GetOutputTargetExtKs rcCsNg}|dgD]}t|tkrddd|D}nt|}||q|S)zReturns the list of preprocessor definitions for this configuration. Arguments: config: The dictionary that defines the special processing to be done for this configuration. Returns: The list of preprocessor definitions. r=cSrr=r~)rWZdpartr=r=r>rZirz_GetDefines..)r/r}rrMr~rf)r&rrfdr=r=r>r]s   rcCsdd|dgDS)NcSrr=rrVr=r=r>rZqrz(_GetDisabledWarnings..Zmsvs_disabled_warningsrr&r=r=r>rpsrcCsdd}|ddvr0dd|dgD}t|dkr!t|d}|S|r0td |d d |f|S) Nrr})rzr{ryrOcSg|] }|dr|qS)z.defrr?r=r=r>rZ|z(_GetModuleDefinition..rkr(rzWMultiple module definition files in one target, target %s lists multiple .def files: %srr)r/rerPrFrM)rrZ def_filesr=r=r>rts   rcCsg}|D]>\}}i}|D]*\}}t|tkr6|dkr"|dks&|dkr.d|||<qd|||<q|||<q|t||q|S)zConvert tools to a form expected by Visual Studio. Arguments: tools: A dictionary of settings; the tool name is the key. Returns: A list of Tool objects. rrAdditionalOptionsrr)rr}rrMrfrir)rr tool_listrrZsettings_fixedrtrur=r=r>_ConvertToolsToExpectedForms  rcCs.t|||}t|}|jt||||ddS)aAdd to the project file the configuration specified by config. Arguments: p: The target project being generated. spec: the target project dict. tools: A dictionary of settings; the tool name is the key. config: The dictionary that defines the special processing to be done for this configuration. config_type: The configuration type, a number as defined by Microsoft. config_name: The name of the configuration. )attrsrrN)_GetMSVSAttributesrZ AddConfigr)rrrrr&rkr attributesrr=r=r>rs rc Csi}|di}|D]}||||<q |dg}t|}|r&d||d<||d<|dd}t|d|d<d |vrHd }t|d|d <|St|d d}t|}||d <|S) NZmsvs_configuration_attributesrrZInheritedPropertySheetsConfigurationTypeOutputDirectoryz"$(SolutionDir)$(ConfigurationName)rGIntermediateDirectoryz'$(ConfigurationName)\obj\$(ProjectName))r/r]rMrPrr) rr&rkZprepared_attrsZ source_attrsaZ vsprops_dirsr intermediater=r=r>rs*   rcCs|dd|DdS)Ncss|]}t|VqdSrprFr?r=r=r>rsz(_AddNormalizedSources..)r)Z sources_setZ sources_arrayr=r=r>_AddNormalizedSourcessrcCst}t||dgt}|ds|||dgD]1}|d}dd|D}t|}|||ds?||t|dd rPt||d gq|d gD] }t||d gqW||fS) a.Prepare list of sources and excluded sources. Besides the sources specified directly in the spec, adds the gyp file so that a change to it will cause a re-compile. Also adds appropriate sources for actions and copies. Assumes later stage will un-exclude files which have custom build steps attached. Arguments: spec: The target dictionary containing the properties of the target. gyp_file: The name of the gyp file. Returns: A pair of (list of sources, list of excluded sources). The sources will be relative to the gyp file. rkZ standaloneactionsrcSrr=rrVr=r=r>rZrz)_PrepareListOfSources..rr;Frcopiesfiles)rrr/rrr)rrVrlrkr7rrcpyr=r=r>r_s$     r_c s<|t|dg||t|}t|}t||}t|fdd|D}dd|D}t||||d}|rxtdd|Drwt dd|Dd krwtd d|Ds\Jd d|D}tdd|Drwt dd|Dd ksQn!t |d krt |d t j r|d j }t |d krt |d t j s|||fS) a&Adjusts the list of sources and excluded sources. Also converts the sets to lists. Arguments: spec: The target dictionary containing the properties of the target. options: Global generator options. gyp_dir: The path to the gyp file being processed. sources: A set of sources to be included for this project. excluded_sources: A set of sources to be excluded for this project. version: A MSVSVersion object. Returns: A trio of (list of sources, list of excluded sources, path of excluded IDL file) Zsources_excludedcr>r=r=rVprecompiled_relatedr=r>rZr{z=_AdjustSourcesAndConvertToFilterHierarchy..cSsg|]}|dqSrG)rrVr=r=r>rZr[r^cSsg|]}t|tjqSr=)rrirjr?r=r=r>rZ*r{cSsh|]}|jqSr=)rr?r=r=r> +sz<_AdjustSourcesAndConvertToFilterHierarchy..r(cSsg|] }t|jdkqS)r()rercr?r=r=r>rZ-rcSsg|]}|jdqSrrbr?r=r=r>rZ.r[r)rrr/r]_IdlFilesHandledNonNatively_GetPrecompileRelatedFilesrhrgallrerrirjrc) rrgyp_dirrkr7r`rrmZfully_excludedr=rr>r`s8     r`cCsXd}|dgD]}|ddkrt|ddrd}nq|r(dd |D}|Sg}|S) NFrrZidlr1rTcSr).idlrrVr=r=r>rZ?rz/_IdlFilesHandledNonNatively..)r/r)rrkZ using_idlrrmr=r=r>r6srcCsDg}|dD]\}}tD]}||}|r|t|qq|S)Nr)r precomp_keysr/rfrP)rrrr&kror=r=r>rEs rc Csbt|||}|D]$\}}|st|t|dkrq |D]\}} ||t|| ddiqq dS)NrExcludedFromBuildr)_GetExcludedFilesFromBuildrrerr) rrr7rmr` exclusions file_nameexcluded_configsrr&r=r=r>rgPs  rgcsi}|D]'}g}|dD]\}fddtD}||vr&||fq|||<q|D]}g}|dD] \}||fq8|||<q.|S)Nrcsg|] }t|dqS)r)rPr/rVrr=r>rZfrz._GetExcludedFilesFromBuild..)rrrf)rr7rmrrorrZ precompedr=rr>r`s  rcCsPt}|dD]\}}|dgD]}||qq |D]}||qdS)Nrmsvs_tool_files)rrr/rr)rrZ tool_filesrr&ror=r=r>rbus  rbc sgdD]8\}}|d}|r@t|}tdddi}j|t||i|gdtj |\}}|dkr=gdqdgqfd d rR|dSdS) Nrr"rrrtr.c.cc.cpp.cxxcs|D]=}t|tjr|jqtj|\}}|vr?dD]\}}tdddd}j t |t ||i|gdq"qdS)Nrr0r)rrr) rrirjrcr-rArrrrrPr)Z source_treerDbasenamerrr&rDisableForSourceTree#extensions_excluded_from_precompilerrr=r>rs(  z7_HandlePreCompiledHeaders..DisableForSourceTree) rr/rPrirrrr-rAr) rrkrrr&rDrrrr=rr>rcs$   rcc Cs|dg}t}|D]2}|dp|g}|d}||v}t||d|d} ||t|||dg|d|d| d q dS) NrrrFrrr action_namer)r/setrrr) r rrjrZhave_setup_envrrZ attached_toZneed_setup_envrr=r=r>rds$   rdc Csd|vr|d}|dg}|dg}|dd}nt|ddr,dd g}g}d}ndSt|||}|d D]\}} |t|| |||q:|dS) Nrun_asr environmentworking_directoryrtestrz $(TargetPath)z--gtest_print_timer)r/rrsrZAddDebugSettingsrr) Z project_pathrrrrrrrrrrr=r=r>rfs     rfcCs0t|}|D]\}}}}t|||||dqdS)Nr) _GetCopiesr)r rrrrrrr=r=r>resrec Csg}|dgD]}}|dgD]t}tj|dtj|}|drb|dd}t|d}t|d}t|}d|d |d } d | t||| } | |gd |g| d |d|fqt|d} d | t|t|} | |g|g| d |d| fqq|S)Nrr destinationrHrIrr(rrGrz2mkdir {} 2>nul & cd "{}" && xcopy /e /f /y "{}" {}Z dummy_copieszCopying z to z7mkdir "{}" 2>nul & set ERRORLEVEL=0 & copy /Y "{}" "{}") r/r-rArMrr posixpathrrPrrf) rrrsrcdstZsrc_barebase_dirZ outer_dirZ fixed_dstZfull_dstrZfix_dstr=r=r>rs@   $ rcCsH|r|tjr |Stj|\}}t||}||vr t||<||Srp)rr-seprAr _GetPathDictr)rootrAparentfolderZ parent_dictr=r=r>rs  rcCsg}|D]8\}}t|tkr9ttj||||}|r"||7}qtjtj||d|d|d}| |q| |q|S)N())rentries) rr}r_DictsToFoldersr-rArMrHZ MSVSFolderrf) base_pathbucketflatchildrenrrcZfolder_childrenr=r=r>rs       rcCslt|tkrt|dkrtt||dkr|tt|St|tkr&|S|D] }t|||||<q(|S)Nr(.vcproj)r}rrenextiter_CollapseSingles)rnodechildr=r=r>r 5s, r c Csi}|D]*}tj|dd\}}|dr|d7}tj|}t||}||||d<qt|dkr[t |t t |t kr[|t t |}t|dkr[t |t t |t ksAt d|}td||S)Nrrz#host_hostrr(r)rrParseQualifiedTargetrr-rArrrer}rrrr r) sln_projectsproject_objectsrrrrltargetrZ path_dictr=r=r>_GatherSolutionFoldersBs   $$  rc Cst|}|d}|s"|d}|ddkr|d7}||j|}tj|}tj tj ||}d}|j rUtj tj |} tj |j |}tj | tj |}||fS)NrRrrPhostr )rDr/rZProjectExtensionrr BuildFiler-rArMrgenerator_outputabspathr\) qualified_targetrrrarKZ proj_filenamer[rJZ fix_prefixZproject_dir_pathr=r=r>_GetPathOfProjectWs"    rcCspi}|dD]-\}}t||}|dt|}dt|t||}|ddkr1tr1|d}|||<q|S)NrZmsvs_target_platformz{}|{}rPrz|x64)rrr/rrr$generator_supports_multiple_toolsets)rconfig_platform_overridesrrZconfig_fullnamer*Zfixed_config_fullnamer=r=r>_GetPlatformOverridesOfProjectls    rc si|D]I}||}t||||\}at||}t|}tj|} |d} |ddkr0| d7} tj|| ||| |td} | rI| t |||| |<q D]} | j dso| j dg} fdd | D} | | qRS) aXCreate a MSVSProject object for the targets found in target list. Arguments: target_list: the list of targets to generate project objects for. target_dicts: the dictionary of specifications. options: global generator options. msvs_version: the MSVSVersion object. Returns: A set of created projects, keyed by target. rrPrr )rrLrr[rrJr dependenciescsg|]}|qSr=r=rZprojectsr=r>rZrz)_CreateProjectObjects..)rrJrMrrrrrHrirgZset_msbuild_toolsetrQvaluesrr/Zset_dependencies) target_list target_dictsrrarrrJrLZ overridesr[robjrUdepsr=rr>_CreateProjectObjects}sB          r"c Cs|D]r}||}|drq|dd}d|d<|dsYtj|\}}}tj|}d} |ddkr9| d 7} |dd krD| d 7} tjtj|d j |t || |d<|d sf|dddg|d <|dst|ddddg|d<qdS)aInitialize targets for the ninja flavor. This sets up the necessary variables in the targets to generate msvs projects that use ninja as an external builder. The variables in the spec are only set if they have not been set. This allows individual specs to override the default values initialized here. Arguments: params: Params provided to the generator. target_list: List of target pairs: 'base/base.gyp:base'. target_dicts: Dict of target properties keyed on target pair. rZmsvs_path_to_ninjaz ninja.exeninjar$(Configuration) target_archx64Z_x64arm64Z_arm64rrz-Cr rrz-tcleanN) r/rrr r-rArrMr\ toplevel_dirninja_generatorComputeOutputDir) paramsrrrrZ path_to_ninjarlrrror=r=r>_InitNinjaFlavorsD       r,cCs|di}t|dd}||d<||d<tjddddks1tjd dddkr6d |d <nd |d <tj |d krHd|d<dSdS)z4Generated variables that require params to be known.rVraautoZ MSVS_VERSIONPROCESSOR_ARCHITECTURErZ64rPROCESSOR_ARCHITEW6432@Z MSVS_OS_BITS r#z $(OutDir)genr N) r/rZSelectVisualStudioVersionZ ShortNamer-r.rrr GetFlavor)default_variablesr+rVrar=r=r>CalculateVariabless     r4c Cs|d}|d}tj|jddd}|D]#\}}tj|\}} | dkr'q||jd} |jr9tj|j| } q|D]} || d| g} td | d | t | q PerformBuilds   r:cCsH|ddkr"|dj}tjtj|t|d}||dadSdS)Nflavorr#rzgypfiles-msvs-ninja)toplevelqualified_out_dir) r/r(r-rArBrMr)r*generator_filelist_paths)r+r<r=r=r=r>CalculateGeneratorInputInfos   r?c Cs|d}|d}|di}t||\}}t||t\}}|ddkr,t|||t}|D]$}||} | dD]\} } t| | } | | | dkrT| dq=q1t |}t ||||} g} | D]}|j a | t||||| qgd a |D]R}|}trd d |D}|d sq|tj|d |jd}|jrtj|j|}tj||}|tj||7}t|| |d}tj|||d|d}| q|| rddt| }|ddrt!|t"d|t#j$dd Sd S)a Generate .sln and .vcproj files. This is the entry point for this generator. Arguments: target_list: List of target pairs: 'base/base.gyp:base'. target_dicts: Dict of target properties keyed on target pair. data: Dictionary containing per .gyp data. rrarVr;r#rz Release|arm64z Release|x64NcSr)r'rrVr=r=r>rZdrz"GenerateOutput..r5rr6)rF)rZvariantsZwebsitePropertiesrzMissing input files: rZmsvs_error_on_missing_sourcesz Warning: r)%r/MSVSUtilZ ShardTargetsZInsertLargePdbShimsgenerator_default_variablesr,rrrrrr"rrJextendrWrrr-rArrrrMrrBuildFileTargetsDeepDependencyTargetsrZ FlatSolutionrHZ MSVSSolutionZWriterrr)r')rrr8r+rrarVconfigsrrrr&rrnrUr[Ztarget_only_configsr9rZ root_entriesZsln error_messager=r=r>GenerateOutput'st           rGc Cstg}g}td||||||||r+dddddg|dg|g}tj||dddd Stj|r8t|d Sd S) aVGenerate the filters file. This file is used by Visual Studio to organize the presentation of source files into folders. Arguments: filters_path: The path of the file to be created. source_files: The hierarchical structure of all the sources. extension_to_rule_name: A dictionary mapping file extensions to rules. rProjectz4.03http://schemas.microsoft.com/developer/msbuild/2003) ToolsVersionxmlns ItemGroupTZprettyr#N)_AppendFiltersForMSBuildeasy_xmlWriteXmlIfChangedr-rAexistsunlink) Z filters_pathZ source_filesrule_dependenciesextension_to_rule_namerhrP filter_group source_groupcontentr=r=r>_GenerateMSBuildFiltersFiles0  rXc Cs|D]Q}t|tjr5|s|j} n|d|j} |dd| idt|jggt| |j||||||qt |||||\} } | d|ig} |rN| d|g|| qdS)aCreates the list of filters and sources to be added in the filter file. Args: parent_filter_name: The name of the filter under which the sources are found. sources: The hierarchy of filters and sources to process. extension_to_rule_name: A dictionary mapping file extensions to rules. filter_group: The list to which filter entries will be appended. source_group: The list to which source entries will be appended. rGrjIncludeZUniqueIdentifierN) rrirjrrfrHrIrNrc_MapFileToMsBuildSourceType) Zparent_filter_namerkrSrTrhrPrUrVrDZ filter_namerelementZ source_entryr=r=r>rNs:    rNc Cstj|\}}|}||vrd}||}||fS|dvr&d}d}||fS|dvr2d}d}||fS|dkr>d }d }||fS|d vrTd }d }d|vrP|dkrPd}||fS|dkr`d}d}||fS||vrld}d}||fSd}d}||fS)aReturns the group and element type of the source file. Arguments: source: The source file name. extension_to_rule_name: A dictionary mapping file extensions to rules. Returns: A pair of (group this file should be part of, the label of element) r)rrrrz.mmr6 ClCompile)z.hz.hxxincludeZ ClIncludez.rcresourceResourceCompile)z.sz.asmmasmZMASMr'rZMARMASMrmidlMidlrule_dependency CustomBuildr}None)r-rArlower) rDrSrTrhrPrextr9r[r=r=r>rZsF  rZc Cs,|dg} dd| D} dd| D} g} | D]&}d|vr%|dgs%qt||}| |||jd|j| |j<q| r|d|j}|d }|d }|d }| || |t j ||}t j ||}t j ||}t || t|| t|| | rt| |||||t| ||d dS) NrcSr/r0r2r3r=r=r>rZ' r4z,_GenerateRulesForMSBuild..cSr5r0r2r3r=r=r>rZ( r4rrrrz.propsz.targetsz.xmlT)r/ MSBuildRulerfrrrrrrrr-rArM_GenerateMSBuildRulePropsFile_GenerateMSBuildRuleTargetsFile_GenerateMSBuildRuleXmlFiler r6)rrrrkr7props_files_of_rulestargets_files_of_rulesr rSrTrr8r9 msbuild_rulesrZ msbuild_rulebaseZ props_nameZ targets_nameZxml_name props_path targets_pathxml_pathr=r=r>_GenerateRulesForMSBuild s:         rsc@seZdZdZddZdS)rha-Used to store information used to generate an MSBuild rule. Attributes: rule_name: The rule name, sanitized to use in XML. target_name: The name of the target. after_targets: The name of the AfterTargets element. before_targets: The name of the BeforeTargets element. depends_on: The name of the DependsOn element. compute_output: The name of the ComputeOutput element. dirs_to_make: The name of the DirsToMake element. inputs: The name of the _inputs element. tlog: The name of the _tlog element. extension: The extension this rule applies to. description: The message displayed when this rule is invoked. additional_dependencies: A string listing additional dependencies. outputs: The outputs of this rule. command: The command used to run the rule. cCs |d|_tdd|j|_d|j|_|jd|_|jd|_|jd|_d|j|_|jd|_ |jd |_ |jd |_ |d |_ |j d sOd |j |_ t|d |j|_t|dg}ddd|D|_t|dg}ddd|D|_t||ddd}t||_dS)Nrz\Wr AfterTargets BeforeTargetsZ DependsOnzCompute%sOutputZ DirsToMakeZ_inputsZ_tlogrrrrrcSrr=rConvertVCMacrosToMSBuildrVr=r=r>rZw sz(MSBuildRule.__init__..rcSrr=rvrVr=r=r>rZ~ r[Tr) display_namer5rrr after_targetsbefore_targets depends_oncompute_output dirs_to_makertlogrrRrrwr/rr]rMrrrr)selfrrZold_additional_dependenciesZ old_outputsZ old_commandr=r=r>__init___ s<              zMSBuildRule.__init__N)__name__ __module__ __qualname____doc__rr=r=r=r>rhK s rhc Csdddig}|D];}|ddd|j|jfi|jdg|jdggd|jdd id |jggd |jd |jgd |jgd|jgd|jggggqt j ||ddddS)zGenerate the .props file.rHrKrI PropertyGroup ConditionzH'$(%s)' == '' and '$(%s)' == '' and '$(ConfigurationType)' != 'Makefile'rbrdz$'$(ConfigurationType)' != 'Makefile'z_SelectedFiles;$(%s)ItemDefinitionGroupCommandLineTemplaterExecutionDescriptionrTrMN) rBrzryr{rrrrrrOrP)rprnrWrr=r=r>ri s<    ricCsdddig}ddddigg}|D]}|dd|jid |jggq|||D]}|d |jd d d ddggq(|D]}|j}d|}d||f}d|}d} dddi|d|ddgg} d|jdd|igg} d|jd|d||fddd|gdd|jggg} dd d!|d"g} d#d$|j|jfd%d&|j|jfd'g}d#d$|j|jfd(d)|jd*|jd+d'g}|d$||fd,d d d-|d.||d/g}|d0|jd1|jd1|jd2|d3|j|j f||d4| | | | |||g d5d6d7d8|j gd9d:d8|j ggd0|j d2|d;d|j d$||fd|d<gd=d|j | dgd>d|j | dgd?d|j | dggd@dAdB|j igggq '%%(Fullpath)', ';')MessageZHighz%%(%s.ExecutionDescription))Z ImportanceTextZWriteLinesToFilez6'@(%s)' != '' and '%%(%s.ExcludedFromBuild)' != 'true'z$$(IntDir)$(ProjectName).write.1.tlogz$^%%(%s.Source);@(%s->'%%(Fullpath)'))rZFileZLinesz#$(IntDir)$(ProjectName).read.1.tlogz^%(z .Source);%(z.Inputs)rz%%(%s.CommandLineTemplate)z%%(%s.AdditionalOptions))rZEchoOffZStandardOutputImportanceZStandardErrorImportancerrrTargetz$(%s)z '@(%s)' != ''z$(%s);%s)NamerurtrZDependsOnTargetsrrrZComputeLinkInputsTargetsz$(ComputeLinkInputsTargets);z%s;ZComputeLibInputsTargetsz$(ComputeLibInputsTargets);)rr)rrYrrZImpLibZMakeDirrxz!@(%s->'%%(RootDir)%%(Directory)')TrMN) rfrrrr~rBrzryr{r|r}rOrP)rqrnrWZ item_grouprrZtarget_outputsZ target_inputsZ rule_inputsZextension_conditionremove_sectionZinputs_sectionZlogging_sectionZmessage_sectionZwrite_tlog_sectionZread_tlog_sectionZcommand_and_input_sectionr=r=r>rj s:               "UrjcCsddddddg}|D]}|d|jd|jd d d d d |jdggddddidddgggdddddddggggdddddddd d |jddgggd d!dd"d"d#gd$|jdd%d"d&d'dd(ggd)dd*ggd+d,d-d.|jd/ggd0d d dd1gggd$|jdd%d"d&d'dd2ggd)dd3ggd+d,d-d.|jd/ggd0d d d4dd5gggdd6d6d"d"d#gd d7d8d"d"d#gdd9d:d"d;d<gd d=d=dd>d?dd@ggdAdd@gggg dB|j|jdCgdDdE|j|jdFgdG|jd4|jdHggq tj||dIdIdJdS)KNZProjectSchemaDefinitionszTclr-namespace:Microsoft.Build.Framework.XamlTypes;assembly=Microsoft.Build.Frameworkz,http://schemas.microsoft.com/winfx/2006/xamlz&clr-namespace:System;assembly=mscorlibz+Microsoft.Cpp.Dev10.ConvertPropertyCallback)rKzxmlns:xz xmlns:syszxmlns:transformCallbackZRulerZ200)rZ PageTemplate DisplayNameZOrderzRule.DataSourceZ DataSourceZ ProjectFile) PersistenceItemTypezRule.CategoriesCategoryrZGeneralzCategory.DisplayNamez sys:Stringz Command Liner)rSubtypeZStringListPropertyrrr)rrZ IsRequiredZSwitchzStringListProperty.DataSourceZItem)rrZ SourceTypeZStringPropertyrFalse)rrVisibleIncludeInCommandLineZDynamicEnumPropertyr)rrZ EnumProviderrzDynamicEnumProperty.DisplayNamezExecute BeforezDynamicEnumProperty.Descriptionz@Specifies the targets for the build customization to run before.z$DynamicEnumProperty.ProviderSettingsZ NameValuePairZExcludez ^%s|^Compute)rValuezDynamicEnumProperty.DataSource)rHasConfigurationConditionz Execute Afterz?Specifies the targets for the build customization to run after.r)rrrrrzExecution DescriptionrzAdditional Dependenciesfalse)rrrrr)rrrzStringProperty.DisplayNamezAdditional OptionszStringProperty.Descriptionr)rrZ FileExtensionr+)r ContentTyper)rrrTrM)rBrrxrzryrrOrP)rrrnrWrr=r=r>rkz sH       *  -   < OrkcCs<|ddd}|dd}|ddkr|dkrd }||fS) Nrr(rrrrPrr'r&)rsplitr/)rrrror*r=r=r>_GetConfigurationAndPlatformZ s  rcCsdt|||S)Nz''$(Configuration)|$(Platform)'=='%s|%s')r)rrrr=r=r>_GetConfigurationConditionb srcCsddddig}t|D]"\}}t|||\}}|d|}|dd|id|gd|ggq |gS) NrLLabelZProjectConfigurationsrZProjectConfigurationrY ConfigurationPlatform)rrrrf)rrr9rrror*Z designationr=r=r> _GetMSBuildProjectConfigurationsh s rc Cstj|d}dddid|gddgd|gd d ggg}tjd d ks+tjd d kr4|dddg|drd|d}|dd|g|dr[|d}|dd|gn |dd|g|dr|dddg|ddd g|dr|d}|dd|gn |dddg|dr|dddgn |dddgd} d} |dD]} | pt| } | pt| |} | r| rnq| r|ddt | gn |j rt d |j |j f| d!kr|dd"d g|S)#NrrrZGlobalsZ ProjectGuidKeywordZ Win32ProjZ RootNamespaceZ#IgnoreWarnCompileDuplicatedFilenamerr.ZAMD64r/ZPreferredToolArchitecturer&rZWindowsTargetPlatformVersionr ZWindowsTargetPlatformMinVersionrZDefaultLanguagezen-USZAppContainerApplicationrZApplicationTypeRevisionz8.1rZApplicationTypez Windows Phonez Windows Storerz6%s requires any SDK of %s version, but none were foundZARMZWindowsSDKDesktopARMSupport) r-rArr.r/rfrrrr~rrr) rrrLZ gyp_file_name namespace propertiesZtarget_platform_versionZtarget_platform_minversionZapp_type_revisionrrror=r=r>_GetMSBuildGlobalPropertiesx sp            rc Csi}|dD]B\}}t|||}t|||}|d}|d}t||d||dkr=t||ddt||dt||rJd|vrJt||d|qt|d |S) Nr CharacterSetrDriverZ DriverTypeZWDMZ TargetVersionrr)r_GetMSBuildAttributesrr/_AddConditionalPropertyr_GetMSBuildPropertyGroup) rr[rrrmsbuild_attributes conditionZ character_setrkr=r=r>_GetMSBuildConfigurationDetails s&      rcCs i}|rdddid|ggg}|S)NrrZLocalsZPlatformToolsetr=)rNrr=r=r>_GetMSBuildLocalProperties src Csd}i}d}t|D]\}}t|||}d|vr%t|d||<d}q d||<q |s_GetMSBuildPropertySheets sF    rcCst||}t|||}i}|D];}|dvr*t||}|ds%|d7}|||<q|dkr7t||||<q|dkrDt||||<qtd|q|S)N)rrrGrrz3Warning: Do not know how to convert MSVS attribute )r]rrrwr_ConvertMSVSCharacterSet_ConvertMSVSConfigurationTyper)rr&r[rkZmsvs_attributesrr directoryr=r=r>_ConvertMSVSBuildAttributes s    rcCs|r dddd|}|S)NZ MultiByteZUnicode)rrtruisdigit)Zchar_setr=r=r>r% srcCs |rdddddd|}|S)NZ ApplicationZDynamicLibraryZ StaticLibraryrZUtility)rtrurvrwrxr)rkr=r=r>r+ srcCsrd|vr t|||}n=t||}t|}|di}|d||dd}t|d|d<d|vrr7 sX           rcCstg}|ddgd}|r,dt|}|||dd}|||r,dd|}i}t|D]\}} t|| |} t|| |} | d } t || d | d t || d | d t || d| dd| vrpt || d| d| dr~t || d| d| drt || d| d|rt || d|| di} t| D]\}}t d||}t || ||qq4t |d|S)Nrrrz"$(MSBuildProjectDirectory)\%s\bin\z cygwin\binZ python_26z$(ExecutablePath);rrZIntDirrZOutDirrrrrZExecutablePathr) r/rPrfrNrMrrrrr_GetValueFormattedForMSBuildr)rrr[Z new_pathsZ cygwin_dirsZcyg_pathZ python_pathrrrorrr tool_settingsruformatted_valuer=r=r>(_GetMSBuildConfigurationGlobalPropertiesn sV                 rcCs>||vri||<||}||vrg||<||}||dS)aAdds a property / conditional value pair to a dictionary. Arguments: properties: The dictionary to be modified. The key is the name of the property. The value is itself a dictionary; its key is the value and the value a list of condition for which this value is true. condition: The condition under which the named property has the value. name: The name of the property. value: The value of the property. Nr)rrrrur conditionsr=r=r>r s rz\$\(([a-zA-Z_][a-zA-Z0-9_]*)\)c sdg}|r |d|it|d}fdd}tj|}t|D].}|}t|D]!\} } t| |krC||| gq1| D] } ||d| i| gqEq1q%|gS)aReturns a PropertyGroup definition for the specified properties. Arguments: spec: The target project dict. label: An optional label for the PropertyGroup. properties: The dictionary to be converted. The key is the name of the property. The value is itself a dictionary; its key is the value and the value a list of condition for which this value is true. rrrcs@t}tD]}|fddt|Dq |S)Ncs h|] }|vr|kr|qSr=r=)rWv)r rr=r>r s z=_GetMSBuildPropertyGroup..GetEdges..)rrrArMSVS_VARIABLE_REFERENCEfindall)r Zedgesrur)r r>GetEdges s z*_GetMSBuildPropertyGroup..GetEdgesr) rfrerrTopologicallySortedrArrr) rlabelrr9Znum_configurationsrZproperties_orderedrrrurrr=rr>r s      rc Csg}t|D]F\}}|d}ddt|||ig}t|D](\}}|rH|rH|g} t|D]\}} t||| } | || gq1|| q ||q|S)Nrrr)rrrrrf) rrgroupsrrorr9rsrrrurr=r=r>_GetMSBuildToolSettingsSections s&  rcCsvd|vrd}|d}t|n d}|di}t|}t|\}}}t|}t|} t|dd\} } } t|} t |}|r_dd|D}dg}|D]}||}|r^t d |t |fqKd d|D}t |}|d }|d }t |}|d }t|dd|t|dd|t|dd|t|dd|t|dd| | rt|| d| dd| rt|| d| ddt|dd|t|dd|t|dd||rtj|d}t|dddt|dd|t|dd|gnt|dddt|dd d!|d"rt|d#d$d!|d%d&krt|d#d$d'|rt|dd(|||d)<|r-t|d*d+||r9t|d,d+|dSdS)-NrFTrrcSsg|]}|dkr|qS)z _HAS_TR1=0r=rr=r=r>rZ r{z,_FinalizeMSBuildSettings..rzXWarning: The automatic conversion to MSBuild does not handle %s. Ignoring setting of %scSrr=)r.rr=r=r>rZ) rrrr!r\rrbr_rrrrrrrrr(PrecompiledHeaderZUseZPrecompiledHeaderFilerZNotUsingr|rrrrr}r{rrrZ PreBuildEventCommandZPostBuildEvent)rZValidateMSBuildSettingsr/ZConvertToMSBuildSettingsrrrrrrrr~rrrwrqr-rAr)rroZ convertedrrrrrrrrrrrrZignored_settingsZignored_settingrurrrrrr=r=r>_FinalizeMSBuildSettings s             rcCsxt|tkr5|dvr|d|dgdgdgd}||vr'|||vr'd}nd}|dd|D}|St|}|S) N)rrrZ DelayLoadDLLsrrz%%(%s)r)r\rrrrcSrr=rvrVr=r=r>rZ r[z0_GetValueFormattedForMSBuild..)r}rrfrMrrw)rsrru exceptionscharrr=r=r>rr s   rcCs^g}|D](}t|tjr|t|j|qd|vr,tj||}tj |s,| |q|S)aVerifies that all source files exist on disk. Checks that all regular source files, i.e. not created at run time, exist on disk. Missing files cause needless recompilation but no otherwise visible errors. Arguments: sources: A recursive list of Filter/file names. root_dir: The root directory for the relative path names. Returns: A list of source files that cannot be found on disk. r@) rrirjrBrarcr-rArMrQrf)rkroot_dirrnrD full_pathr=r=r>ra s    rac Csvgd}i} |D]} g| | <qt|||| ||||g}|D]} | | r.|dg| | q|r9|dg||S)N)r}r`rar]r6r^rrcrL) _AddSources2rf) rrkrrSrT actions_specsources_handled_by_actionr`rgrouped_sourcesgr=r=r>_GetMSBuildSources s,    rc Csg}|D]} t| tjrt|| j||||||q| |vrg} || g} t| t|dkr7| ddgnt| D]\} } t | | }| dd|idgq;|d D]U\} } | dd}|dkr}t |}|s}t j |\}}|dkrzgd}ndg}|| krt | | |}| d d|id gqU|D]}| |r| d dg| d dgqqUt| ||t||d \}}|d krt j | st j | dd}|drtdd|}n |drtdd|}| dd|g|||d| ig| qdS)Nrrrrr"rrrrZCreaterrPr6rz.objz..\z ^(\.\.\\)+z$(z^\$\([^)]+\)\\ZObjectFileNamez $(IntDir)\rY)rrirjrrcr/rerfrrrrPr-rArrrZrZrKrRr5r)rrkrrrSrTrr`rrDZdetailZexcluded_configurationsrrorZprecompiled_sourcerrr9r[rr=r=r>r s          rc Cs0g}|jrdg}t}|jD]}|j}d}|jddkr*|ddkr*|ddkr*d}|jd r2d}|r5q|jd d }|||j}tj |j d } t j |j | } d d| id|gddgg} |jdiD] } | dd r{| ddgn| dd r| ddgnqj|| q|||S)NrLFrPrrr}r|TZrun_r rrZProjectReferencerYrHZReferenceOutputAssemblyrrZ"msvs_use_library_dependency_inputsZUseLibraryDependencyInputsrZ&msvs_2010_disable_uldi_when_referenced)rrrrrRrNrrLr-rArrrr\r/rrf) rUZ referencesr9Zadded_dependency_set dependencyZdependency_specZshould_skip_depZcanonical_namerLriZ relative_pathZ project_refr&r=r=r>_GetMSBuildProjectReferences4sH         rc# CsB|j}|d}|d}tj|j\}}tj|jtj|jd} t||| \} } i} t } t }t }i}| dd}t |}| dsVt |||| | | || || n | dg}t || | dt|||| | ||\} } }| dst| ||jt| |t| | } t|| |}t|| \}}t|jd| ||||t| |}|D]}t||qd d d igg}d d d igg}d d d igg}d d digg}d d digg}d d digg}d d digg} dddigg}!d d|ddg}"|"t||7}"|"t|||j|7}"|"|7}"|"t||j7}"| dr|"td7}"n|"t|j7}"|"|7}"|"|7}"d|vr9|dkr9|"|7}"|"t| 7}"|"t ||7}"|"|!7}"|"t!|||j7}"|"t"||7}"|"t#|| ||||||7}"|"t$|7}"|"|7}"|"|7}"d|vr|dkr|"| 7}"|"t%|7}"| dr|"t&|7}"t'j(|"|jddd|S)NrrPr(rXTrrz.filtersrrHz,$(VCTargetsPath)\Microsoft.Cpp.Default.propsz$$(VCTargetsPath)\Microsoft.Cpp.propsz&$(VCTargetsPath)\Microsoft.Cpp.targetsz/$(VCTargetsPath)\BuildCustomizations\masm.propsz1$(VCTargetsPath)\BuildCustomizations\masm.targetsz2$(VCTargetsPath)\BuildCustomizations\marmasm.propsz4$(VCTargetsPath)\BuildCustomizations\marmasm.targetsrrZ UserMacrosrIBuild)rKrJZDefaultTargetsrZ v120_wp81r'rrM))rr-rArrrrYr[r_rr/rZrsr6r`rdrerBr_GenerateActionsForMSBuildrXrarrZProjectVersionrrrLrrrN_GetMSBuildExtensionsrrrrr_GetMSBuildExtensionTargets!_GetMSBuildExternalBuilderTargetsrOrP)#rUrrrVrrrPriZproject_file_namerlrkr7r rlrmrSrTr`rhrrmrrrrnroZimport_default_sectionZimport_cpp_props_sectionZimport_cpp_targets_sectionZimport_masm_props_sectionZimport_masm_targets_sectionZimport_marmasm_props_sectionZimport_marmasm_targets_sectionZ macro_sectionrWr=r=r>rS]s                         rScCst||ddddd}dddig}|dd|igt||ddddd}ddd ig}|dd|ig||g}|d r\t||d dddd}ddd ig}|dd|ig|||S) anReturn a list of MSBuild targets for external builders. The "Build" and "Clean" targets are always generated. If the spec contains 'msvs_external_builder_clcompile_cmd', then the "ClCompile" target will also be generated, to support building selected C/C++ files. Arguments: spec: The gyp target spec. Returns: List of MSBuild 'Target' specs. rFrrrZExecrrZCleanrr\)rrfr/)rZ build_cmdZ build_targetZ clean_cmdZ clean_targettargetsZ clcompile_cmdZclcompile_targetr=r=r>rs0      rcCs.dddig}|D] }|dd|igq|gS)NrrZExtensionSettingsrrHr)rlrrr=r=r>rs rcCs2dddig}t|D] }|dd|igq |gS)NrrZExtensionTargetsrrH)rrf)rmZ targets_nodeZ targets_filer=r=r>r%s  rc st}g}|D]|\}}tr|dd}t}t}g}g} |D]I} ddtr6fdd| dD| d<|t| d|t| d|| d | d } tr[| dd} | d d red | } | | q!d|} ddd| D} t||||| | ||q ||fS)aYAdd actions accumulated into an actions_to_add, merging as needed. Arguments: spec: the target project dict actions_to_add: dictionary keyed on input name, which maps to a list of dicts describing the actions attached to that input file. Returns: A pair of (action specification, the sources handled by this action). r _host.execSsd|vr |dd}|S)Nr rrrz)rXr=r=r>fixup_host_exeBs z2_GenerateActionsForMSBuild..fixup_host_execsg|]}|qSr=r=rVrr=r>rZHrz._GenerateActionsForMSBuild..rrrrZmsbuild_use_callTzcall rrcSsg|]}|dqS)z, if %errorlevel% neq 0 exit /b %errorlevel%r=rr=r=r>rZ^r) rrrrNrrfr/rM_AddMSBuildAction)rr rrrrrrrrrrrrr=rr>r,sJ        rc st|}tt|} t|} dfdd| D} d| }|ddig} | ddgd|gd |gd |gg| rG| d | g|| dS) Nrcsg|]}|kr|qSr=r=rVrr=r>rZ{r{z%_AddMSBuildAction..rdrYFileTypeZDocumentrrrZAdditionalInputs)rrwrPr]rMrrBrf) rrrrrrrrrZ inputs_arrayZ outputs_arrayZadditional_inputsZ action_specr=rr>rms$     rr)NNTN)F)rr-rr5r0r) collectionsr gyp.commonrZ gyp.easy_xmlrOZgyp.generator.ninja generatorr#r)Z gyp.MSVSNewrHZgyp.MSVSProjectriZgyp.MSVSSettingsrZgyp.MSVSToolFilerZgyp.MSVSUserFilerqZ gyp.MSVSUtilr@Zgyp.MSVSVersionrrrr6rErCrossCompileRequestedrrA"generator_additional_path_sections+generator_additional_non_configuration_keysr>rr,r+r?rJrFrPrLr]rhrwrqrrrrrrrrrrrrrrrr rrrrrr#r&r'r-r.r:r6rBrDrMrQrWrTrZrsr]r^rrrrrrrrrrrrr_r`rrrgrrbrcrdrfrerrrr rrrr"r,r4r:r?rGrXrNrZrsrhrirjrkrrrrrrrrrrrrrrrrrrrarrrrSrrrrrr=r=r=r>s                    J 'Q# ! 'U  1    >"Z''<  0 '  33\.:+5;*KaG0 75 8  g  + ^ )  *  Ao ۤ_c~@s~ddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlmZddlZ ddlmZddl mZddlmZdddddddd d d d d dddZgagagadae jZddZddZddZ ddZ!GdddZ"GdddZ#ddZ$dd Z%d!d"Z&d6d$d%Z'd&d'Z(d(d)Z)d*d+Z*d,d-Z+d.d/Z,d0d1Z-d2d3Z.d4d5Z/dS)7N)StringIO)GetEnvironFallbacklibz.a$!INTERMEDIATE_DIRz$!PRODUCT_DIR/gen $!PRODUCT_DIR$|CONFIGURATION_NAME${root} ${dirname} ${source}${ext}${name})EXECUTABLE_PREFIXEXECUTABLE_SUFFIXSTATIC_LIB_PREFIXSTATIC_LIB_SUFFIXSHARED_LIB_PREFIXINTERMEDIATE_DIRSHARED_INTERMEDIATE_DIR PRODUCT_DIRCONFIGURATION_NAMERULE_INPUT_ROOTRULE_INPUT_DIRNAMERULE_INPUT_PATHRULE_INPUT_EXTRULE_INPUT_NAMEcCs||r |t|dS|SN) startswithlen)argprefixr!ED:\a\_work\1\s\node_modules\node-gyp\gyp\pylib\gyp\generator\ninja.py StripPrefixCs r#cCs8td|r|S|dkrtj|Sd|dddS)zVQuote a string such that it will be interpreted as a single argument by the shell.z^[a-zA-Z0-9_=.\\/-]+$win'z'"'"')rematchgypmsvs_emulationZQuoteForRspFilereplace)rflavorr!r!r"QuoteShellArgumentIs  r,cCs0|dkr|ddtd}ttd||S)z[Takes a preprocessor define and returns a -D parameter that's ninja- and shell-escaped.r$#z\%03oz-D)r*ordr, ninja_syntaxescape)dr+r!r!r"DefineUsr2cCs"tj|\}}|d||S)z&Adds an arch string to an output path..)ospathsplitext)outputarch extensionr!r!r"AddArch_sr:c@s@eZdZdZddZddZddZdd Zd d Zd d Z dS)TargetaTarget represents the paths used within a single gyp target. Conceptually, building a single target A is a series of steps: 1) actions/rules/copies generates source/resources/etc. 2) compiles generates .o files 3) link generates a binary (library/executable) 4) bundle merges the above in a mac bundle (Any of these steps can be optional.) From a build ordering perspective, a dependent target B could just depend on the last output of this series of steps. But some dependent commands sometimes need to reach inside the box. For example, when linking B it needs to get the path to the static library generated by A. This object stores those paths. To keep things simple, member variables only store concrete paths to single files, while methods compute derived values like "the last output of the target". cCs@||_d|_d|_d|_d|_d|_d|_d|_d|_d|_ dS)NF) typepreaction_stampprecompile_stamp actions_stampbinarybundlecomponent_objs compile_deps import_libuses_cpp)selfr<r!r!r"__init__}s zTarget.__init__cCs |jdvS)z;Return true if this is a target that can be linked against.)static_libraryshared_library)r<rFr!r!r"Linkables zTarget.LinkablecCs|dks|jr dS|jdvS)zSReturn true if the target should produce a restat rule based on a TOC file.r$FrIloadable_module)rAr<rFr+r!r!r"UsesTocs zTarget.UsesToccCs$||r |dS|p|jS)zbReturn the path, if any, that should be used as a dependency of any dependent action step..TOC)rO FinalOutputr=rNr!r!r"PreActionInputs  zTarget.PreActionInputcCs |jp|jS)zcReturn the path, if any, that should be used as a dependency of any dependent compile step.)r?r>rJr!r!r"PreCompileInput zTarget.PreCompileInputcCs|jp|jp|jS)zOReturn the last output of the target, which depends on all prior steps.)rAr@r?rJr!r!r"rQszTarget.FinalOutputN) __name__ __module__ __qualname____doc__rGrKrOrRrSrQr!r!r!r"r;es  r;c@sbeZdZ dPddZdPddZddZdPdd ZdQd d ZdPd dZddZ ddZ ddZ ddZ ddZ ddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Z dPd+d,Zd-d.Zd/d0Z dPd1d2Zd3d4Zd5d6ZdPd7d8ZdPd9d:ZdPd;d<Zd=d>Z ?dRd@dAZ!dBdCZ"dDdEZ#dFdGZ$dPdHdIZ%dPdJdKZ&dLdMZ' dPdNdOZ(dS)S NinjaWriterNc Cs||_||_||_||_t||_||_||_||_ d|_ | dur.t j t j | ||_ |dkr4dnd|_|dkrJi|_dD] } d| |j| <q@tj|| } t j | ||_tj|| } t j | ||_dS)a base_dir: path from source root to directory containing this gyp file, by gyp semantics, all input paths are relative to this build_dir: path from source root to build output toplevel_dir: path to the toplevel directory Nr$z.objz.o)x86x64z environment.)hash_for_rulestarget_outputsbase_dir build_dirr/Writerninjatoplevel_buildoutput_file_namer+ abs_build_dirr4r5abspathjoinobj_extwin_envr(commonInvertRelativePath build_to_base base_to_build) rFr\r]r^r_ output_filerbrcr+ toplevel_dirr8Z build_to_topZ base_to_topr!r!r"rGs( zNinjaWriter.__init__cCsd}||vr%|r|||}n||dd}||dd}||d}d}||vr=|d}||tj|p9d|}d}|||j}|S) zExpand specials like $!PRODUCT_DIR in |path|. If |product_dir| is None, assumes the cwd is already the product dir. Otherwise, |product_dir| is the relative path to the product dir. r/r\r3rgenr)r*GypPathToUniqueOutputr4r5rf config_name)rFr5 product_dirrrZint_dirrr!r!r" ExpandSpecials   zNinjaWriter.ExpandSpecialcCsp|jdkr|jj||jd}|td|}|td|}|td|}|td|}|td|}|S)Nr$configrrrrr)r+ msvs_settingsConvertVSMacrosrsr*generator_default_variables)rFr5rootdirnamesourceextnamer!r!r"ExpandRuleVariables"s zNinjaWriter.ExpandRuleVariablescCs|r|jdkrtj||}n |jdkrtj||}|dr2||}|jdkr0tj |}|Sd|vr;||}d|vsCJ|tj tj |j |S)zTranslate a gyp path to a ninja path, optionally expanding environment variable references in |path| with |env|. See the above discourse on path conversions.macr$z$!z$|$) r+r(xcode_emulation ExpandEnvVarsr)Z ExpandMacrosrrur4r5normpathrfrk)rFr5envexpandedr!r!r"GypPathToNinja,s       zNinjaWriter.GypPathToNinjaTcCs||}|drJ|d}|jdkr|d|j7}tj|\}}tj|r0Jd||r9|jd|}tjtj ||j ||S)a5Translate a gyp path to a ninja path for writing output. If qualified is True, qualify the resulting filename with the name of the target. This is necessary when e.g. compiling the same path twice for two separate output targets. See the above discourse on path conversions.robjtargetr3z5'%s' can not be absolute path (see crbug.com/462153).) rurtoolsetr4r5splitisabsrrrfr^)rFr5 qualifiedrZpath_dirZ path_basenamer!r!r"rr@s  z!NinjaWriter.GypPathToUniqueOutputcCsv|dd|Dks J|t|dkr|rJdSt|dks!|r7||d}|jj|d||d}|j|dS) zGiven a list of targets, return a path for a single file representing the result of building all the targets or None. Uses a stamp file if necessary.cSg|]}|r|qSr!r!.0itemr!r!r" lz:NinjaWriter.WriteCollapsedDependencies..rN.stampstamp order_only)rrrrabuildnewline)rFrtargetsrrr!r!r"WriteCollapsedDependenciesfs  z&NinjaWriter.WriteCollapsedDependenciescCs"tj|jd}|d|dS)Nrr3.ninja)r4r5r6rc)rFr8Zoutput_file_baser!r!r"_SubninjaNameForArchvsz NinjaWriter._SubninjaNameForArchc s|_|d_|d_|d|}t|d_t|dd_|dd_t j j |_ d __j d krQt j |_|d d }|rQ|j_j d krt j||_j|}jd j|jdd|jdd|jdd|jdd|jdd|j d krj|_tjdkrfddjD_g}g}d|vr |dD]#} | jvrj| } || j || | j rdj_ qdd|D}dd|D}!d|}!d|}|j_"|j_#g} g} $|| || j_%jj%p |} g}z | |dg}Wnt&yGt'd t(| t'd!t(|dw|rԈj d kritjdkrijD] }j)*|q\d }j d krt j+|j,|j-t j.j|j-j/j0}nt j 1jj-fd"d#}2j|||| ||}fd$d|D}|rӈj d kstjdkr|fd%d|D7}nt'd&|dnj d krtjdkrt34t5}jj%p|}j d krjj6d'kr|j_7|j_8d }| o | }|sjj%s|r)9|||||}j r)| |j r4:|| |}|s9d Sj;sCJ|jS)(zThe main entry point for NinjaWriter: write the build rules for a spec. Returns a Target object, which represents the output paths for this spec. Returns None if there are no outputs (e.g. a settings-only 'none' type target). target_namerconfigurationsr<standalone_static_libraryr target_rpathz\$$ORIGIN/lib/Nrmac_toolchain_dirr$r8ccz$cl_cxxcc_hostcxx_hostasmz$ml_rc s0i|]}|tttjj|dqSw)r/r` OpenOutputr4r5rfrbrrr8rJr!r" s  z)NinjaWriter.WriteSpec.. dependenciesTcSrr!r!rr!r!r"rrz)NinjaWriter.WriteSpec..cSrr!r!rr!r!r"rractions_dependscompile_dependssourceszextra_sources: zspec.get("sources"): cs|d|S)N-)rr)r5langrJr!r"sz'NinjaWriter.WriteSpec..csg|] }|jr|qSr!)endswithrgrfrJr!r"rscsg|]}|qSr!rrorJr!r"rzdWarning: Actions/rules writing object files don't work with multiarch targets, dropping. (target %s)rH)WriteActionsRulesCopiesr? TypeErrorprintstrsubninjarZVerifyMissingSourcesrdrPrecompiledHeaderrrrgZMacPrefixHeader WriteSources collections defaultdictlistr<rBrC WriteTargetWriteMacBundlerQ)rFspecrsgenerator_flagsrwrr8rrdepr extra_sourcesmac_bundle_dependsZcompile_depends_stamp link_depsrZpchZ obj_outputsrCr7Zis_empty_bundler!rJr" WriteSpeczs                        zNinjaWriter.WriteSpeccsjj\}}}d fdd fdd|D}fdd|D}|df|d|f}jj|d |||d ||dS) zlHandle the implicit VS .idl rule for one source file. Fills |outputs| with files that are generated.NcsXtj|}tj\}}tj|\}}|||||}|r*tj||}|Sr)r4r5rfrr6rrelpath)r5relr|basenamer{r~)outdirrFr}r!r"fix_path0sz)NinjaWriter._WinIdlRule..fix_pathcsg|] \}}||fqSr!r!)rrvalue)rrr!r"r9sz+NinjaWriter._WinIdlRule..csg|]}|qSr!r!)rp)rr!r"r:rrZidlflagsidl variablesrr)rxZGetIdlBuildDatarsrrrarextend)rFr}prebuildoutputsr7varsflagsinputr!)rrrFr}r" _WinIdlRule(s   zNinjaWriter._WinIdlRulecCsL|jdksJ|j|rgSg}tdd|dD] }||||q|S)z3Writes rules to match MSVS's implicit idl handling.r$cS |dS)Nz.idlrxr!r!r"rG z.NinjaWriter.WriteWinIdlFiles..r)r+rxZHasExplicitIdlRulesOrActionsfilterr)rFrrrr}r!r!r"WriteWinIdlFilesAs zNinjaWriter.WriteWinIdlFilesc Csg}|jr|dgdd}ng}g}d|vr$|||d|||7}d|vr5|||d||||7}d|vrD|||d||7}d|vrU|jdkrU||||7}|jrd|jrd| |||| d|}|jr| |||} | | |} | | ||S) zoWrite out the Actions, Rules, and Copies steps. Return a path representing the outputs of these steps.mac_bundle_resourcesNactionsrulescopiesrr$Zactions_rules_copies)rr WriteActions WriteRules WriteCopiesr+rrZIsIosFrameworkWriteiOSFrameworkHeadersrWriteMacBundleResourcesWriteMacXCassetsWriteMacInfoPlist) rFrrrrrrextra_mac_bundle_resourcesrxcassetspartial_info_plistr!r!r"rKs>    z#NinjaWriter.WriteActionsRulesCopiescCsF|jdkr |d|j7}|r|d||S|d|jd|S)a Generate and return a description of a build step. |verb| is the short summary, e.g. ACTION or RULE. |message| is a hand-written description, or None if not available. |fallback| is the gyp-level name of the step, usable as a fallback. rz(%s) z: )rrur)rFZverbmessagefallbackr!r!r"GenerateDescriptionws zNinjaWriter.GenerateDescriptionc sDg}|D]}d|dj}d|dd|}jdkr)j|nd} |d} |dd} | r>| j } t |dd rHd nd} j || || | | d \} }fd d |dD}t |ddrr||d7}t |ddr||d7}fdd |dD}j j || ||d||7}j q|S)N{}_{} action_nameZACTIONrr$actiondepfileninja_use_consolerconsole)rcg|]}|qSr!rrirrFr!r"rz,NinjaWriter.WriteActions..inputsprocess_outputs_as_sourcesFr'process_outputs_as_mac_bundle_resourcescr r!rrr r!r"rr r)GetToolchainEnvformatr\rrr+rxGetRuleShellFlagsrurlintWriteNewNinjaRulerarr)rFrrrr all_outputsrr descriptionwin_shell_flagsargsrpool rule_name_rrr!r r"rs:       zNinjaWriter.WriteActionsc sPg}|D]}d|vr|dgsqd|dj}|d} d|dddtd|} jd kr?j|ndt |d d rKd nd}  || | | \} } d } dh}| D]}| D] }d||vrq| |qdq`t |}fdd}fdd|dgD}|dg}t |}|r|d7}|dkrt |dkrj|d||dg}g}|D]tjtj\tj\fdd|dD}t |ddr||7}|v}|st |ddr||7}|r|g}|D]j}|dkr|d|fq|dkr0j}|d||fq|dkrGj}|d||fq|dkrU|dfq|d kre|d |fq|duspJt|qfd!d|D}jd kr|d"t|d fjj|| |||d#||qq|S)$Nr rule_sourcesrrZRULErz%s rr$rrr)r}r{r|r~rr}z${%s}csr jr |ddS|S)Nrpro)cygwinr*)r5)rr!r" cygwin_munges  z,NinjaWriter.WriteRules..cygwin_mungecr r!rr r r!r"rr z*NinjaWriter.WriteRules..rrrc s g|] }|qSr!)rr)rr|r~r{rFr}r!r"rsrrFrr{r|r~rcr r!rrr r!r"r+r Z unique_nameimplicitrr) rrrr\rrzr+rxrrraddsortedrrr4r5rrr6removerrurlreprhashlibmd5 hexdigestrarrr)rFrrrrrrrulerrrrrZspecial_localsZneeded_variablesargumentvarrrrZ num_inputsrZwas_mac_bundle_resourceextra_bindingsZdirname_expandedZsource_expandedr!)rr|rr~r{rFr}rr"rs                      GzNinjaWriter.WriteRulesc Csg}|jr|j}|j|d}n|}|D]F}|dD]?}tj|}tj|d} |||} |tj|d| |} ||j j | d| |d7}|j r\| |j r\|| qq|S)Nadditional_settingsfilesr destinationcopyr)rGetPerTargetSettingsrr4r5rrrrfrarrrZGetBundleContentsFolderPathr) rFrrrr extra_envrZto_copyr5rsrcdstr!r!r"r?s,     zNinjaWriter.WriteCopiesc Csx|}|d}|d}|d}||j_t|jtdd|}d|fdt|j|fg} ||jj |d|| |d d S) zFPrebuild steps to generate hmap files and copy headers to destination.rZmac_framework_headersz headers.hmapcSr)Nz.hrrr!r!r"rgrz6NinjaWriter.WriteiOSFrameworkHeaders.. framework copy_headerscompile_ios_framework_headersrN) ComputeMacBundleOutputrrrZheader_map_pathmaprrrrar) rFrrrr7Z all_sourcesr8r7Z all_headersrr!r!r"r_s( z$NinjaWriter.WriteiOSFrameworkHeadersc Csg}|j}|j|d}||}|j|j}tjt d|jt |j |D]/\}}| |}t j|ddkrR|jj|d|dd|fd|fgd ||q(||q(|S) z.Writes ninja edges for 'mac_bundle_resources'.r.rz .xcassetsmac_tool)Z mactool_cmdzcopy-bundle-resourcerr@r)rr3GetSortedXcodeEnvComputeExportEnvStringIsBinaryOutputFormatrsr(rZGetMacBundleResourcesrzr;rrur4r5r6rarr) rF resourcesbundle_dependsrr4risBinaryr7resr!r!r"rws0      z#NinjaWriter.WriteMacBundleResourcesc Cs|sdSi}ddd}|jj|j}|D]\}}||}|r%|||<qd} |r3|d} | |d<g} | tj|j d| rI| | t t ||j } |j} |j| d} || } ||jj| d |d | fd | fgd | S) aWrites ninja edges for 'mac_bundle_resources' .xcassets files. This add an invocation of 'actool' via the 'mac_tool.py' helper script. It assumes that the assets catalogs define at least one imageset and thus an Assets.car file will be generated in the application resources directory. If this is not the case, then the build will probably be done at each invocation of ninja.Nzapp-iconz launch-image)ZXCASSETS_APP_ICONZXCASSETS_LAUNCH_IMAGEz!assetcatalog_generated_info.plistzoutput-partial-info-plistz Assets.carr.compile_xcassetsrkeysr>)rrsitemsrrrrr4r5rfZGetBundleResourceFolderr,jsondumpsr+r3r?r@rrar)rFrrCZextra_argumentsZsettings_to_argsettingsZ settings_keyZarg_namerrrrGr4rr!r!r"rsJ     zNinjaWriter.WriteMacXCassetsc stjtdjj\}}}}|sdS|}|r=tj |}d fdd|D}j j |d|d|fgd}j|d }|}|rYd }j |d ||g}jj} tt| j} jj} j j |d |d |fd| fd| fgd||dS)z.Write build rules for bundle Info.plist files.rNrcg|]}t|jqSr!r2r+rr1rJr!r"rr z1NinjaWriter.WriteMacInfoPlist..preprocess_infoplistdefinesr>r.zmerged_info.plistmerge_infoplistcopy_infoplistrrGr@)r(rZGetMacInfoPlistrzrrrurrr4r5rrfrarr?r@ZGetExtraPlistItemsrsr,rIrJr+rAr) rFrrCZ info_plistoutrPr4Zintermediate_plistrrGrDr!rJr"rsH       zNinjaWriter.WriteMacInfoPlistc sjdkr6jddjddjddjdd jd d jd d jddjdksBtjdkrNjSfddjDS).Write build rules to compile all of |sources|.hostarz$ar_hostr$cc_hostr $cxx_hostldz$ld_hostldxxz $ldxx_hostnmz$nm_hostreadelfz $readelf_hostrrc s.i|]}|jj||dqSr8)WriteSourcesForArchrrrwrsprecompiled_header predependsrFrrr!r"rs z,NinjaWriter.WriteSources..)rrarr+rrr_)rF ninja_filersrwrrbrarr!r`r"rs*   zNinjaWriter.WriteSourcesc ' sg} jdkr.jj||d} j|} j|} dgj|} dgj|}njdkrj|}j|} j|} j|} j |} j |j }}|sd}j dkrk|dj 7}t jt j|jj}|d }|d }|d |g|d |g|d jgn|dg} |dg} |dg} j dkrt jddt jdd| } t jddt jdd| } n.j dkr t jddt jdd| } t jddt jdd| } |dg| }|dfdd|DjdkrD|dtj ||dfddj|jD|dg}jdkr[j||}|d fd!d|Djdkr|d"g}j||}|d#fd$d|D||}jdkrd%D]\}}|||}|r|||q|d&g}|dtj | |dtj | |dtj | jdkr|d'tj | |d(tj ||d&tj || g}d)}|D]}t j!|\}}|d*d+}j"} |d,vr%d-}!d.j#_$nl|d/ks5|d0kr8jdkr8d1}!nY|d2krFjdkrFd3}!nKjdkr]|d4vr]j%|s]d5}!d6} n4jdkrk|d7krkd8}!n&jdkr}|d9kr}d:}!d.j#_$njdkr|d;krd;}!d<} d.}nq|}"&|| }#|d+urt'|#|}#|(|"g|#g|}$g}%jdkr|)|"|#|$|!| | j \}%}#}$|j*|#|!|"d=d|$D||%d>|+|#q|r|d?|}&|d@fdAd|&D,||| |S)BrTrr^z $cflags_cz $cflags_ccr$rrr3z.c.pdbz.cc.pdbZ pdbname_cZ pdbname_ccZ pchprefixcflagscflags_c cflags_ccCPPFLAGSrCFLAGSZCXXFLAGSrUZ CPPFLAGS_hostZ CFLAGS_hostZ CXXFLAGS_hostrPcrLr!rMrNrJr!r"rkr z3NinjaWriter.WriteSourcesForArch..asmflagsZrcflagscsg|] }t|jqSr!)r,rur+rrJr!r"rts include_dirsincludesc$g|]}td|jqSz-Ir,rr+r r r!r"rmidl_include_dirsZ midl_includescrlrmrnr r r!r"rro))c cflags_pch_c)r cflags_pch_cc)mcflags_pch_objc)mmcflags_pch_objccarflags cflags_objc cflags_objccFrN)rZcpprrTrqSrscc_s)rr{rz_asm.objrtobjcrvobjcxxrcz.rescSsg|]\}}}|qSr!r!)rrgchr!r!r"rrr!resource_include_dirsZresource_includescrlrmrnr r r!r"rro)-r+rZ GetCflagsZ GetCflagsCZ GetCflagsCCZ GetCflagsObjCZGetCflagsObjCCrxZ GetAsmflagsZGetComputedDefinesZGetCompilerPdbNamerurr4r5rrfr^rWriteVariableListrenvironrr;Z GetRcflagsrrZAdjustIncludeDirsZAdjustMidlIncludeDirsZGetPchBuildCommandsZ GetIncluderrr6rgrrEZHasExplicitAsmRulesrrr:ZGetObjDependenciesZGetFlagsModificationsrrWritePchTargets)'rFrcrsrwrrbrarr8Z extra_definesrdrerfryrzriZ pdbpath_cZ pdbpath_ccrZpdbpathrPrjrp pch_commandsr~r,includerxrZ has_rc_sourcer}filenamergcommandrr7r"rrr!r r"r_!sz                                               zNinjaWriter.WriteSourcesForArchc Cs`|sdS|D]'\}}}}ddddd|}ddd d d}||} |j|| |||fgd qdS) z-Writes ninja rules to compile prefix headers.Nrrrsrurw)rqrrtrvrrr~rr>)rr) rFrcrrZ lang_flagrrZvar_namer;cmdr!r!r"rs$ zNinjaWriter.WritePchTargetsc sjdks tjdkrjS}fddjD}g}|} js:|||ddvrZjsZ|d|fjj ||dgd ||d |Sjj | d ||d |S) 0Write out a link step. Fills out target.binary. rrc s.g|]}jj|||dqSr])WriteLinkForArchrrrCrwrsrrFrr!r"r#s z)NinjaWriter.WriteLink..r<rLrrPsolipor>lipo) r+rrrra ComputeOutputrAppendPostbuildVariablerr) rFrrsrwrrCr7rr-Z build_outputr!rr" WriteLinks2     zNinjaWriter.WriteLinkc# sdddd|d}d} t} t} t} |r| |d|vrt} |dD]w}j|}|s2q'|}|rg}jdkrU|jrUjrU|j}|j rT| |j n&jdkrb|j rb|j g}n| jrw| |j | |j d n|j g}|D]}|| vr| || |q}|}|r||j kr| |q'g}jjrjdkr| d ||}|d urĈjsĈ|||||dd k}jd krtjdd}njdkrtjdd}jdkrjtdj|}||}njdkrT|}jjj|||j\}}}||} |d|| !|} |r< |d|gt"j#} j$j}|rS| |n4||dg}|rt%| rd}jd kry|j7}| d|n| dj&| d| |dt'j||dg}jdkrfdd|D}fdd|D}n fdd|D}t(j)*t'j|dg}jdkr؈j+|}n jdkrj+|} |d |||} |d!vr| d"tj,|d#f| d$t(j)-|fjdkr;|}!jrj.}!|r&|!d%|7}!|!d&7}!|!/d'd(}!| d)t(j)-|!fjdkr| d*|fd+|vr~j0s~|d,j_ | d-d.jj fj1j|d/}"|jj g}|"r~| |"n/js||d g}n$|d0}njdkr| d*|fj1j|d/}"|"r||"g}t%| r| d1t(j)2t3| f|j4||| |t3| t5| |d2| S)3rlink solink_modulesolink) executablerMrIr<rrr$rP)rYz$ldxxNrrLDFLAGSrUZ LDFLAGS_hostrrZ manifestsZintermediatemanifestldflagszlib/z-Wl,-rpath=\$$ORIGIN/%sz -Wl,-rpath=%sz-Wl,-rpath-link=%s library_dirscsg|] }j|qSr!)rxryrZ library_dirrsrFr!r"rs z0NinjaWriter.WriteLinkForArch..cs"g|] }dt|jqS)z /LIBPATH:rnrrJr!r"rs cs"g|] }td|jqS)z-LrnrrJr!r"rs librariesZlibs)rrZsonamerrr3z.rsprrlink_file_listr@z/NOENTRYz.libZ implibflagz /IMPLIB:%sz.pdbZ_notocsolibsr!)6setr#r]rrKr+rBrxZIsUseLibraryDependencyInputsrCrDrOr@rrQrrErrrrr4rrrZ GetLdflagsrurzrrrComputeOutputFileNamerbrunion_GetWinLinkRuleNameSuffixZIsEmbedManifestZ GetDefFilerrr;r(riuniquerZAdjustLibrariesr5EncodePOSIXShellArgumentGetWrapperNamer*ZGetNoImportLibraryZ GetPDBNameEncodePOSIXShellListr$rr)#rFrcrrsrwrrCr8rZcommand_suffixZ implicit_depsrZ order_depsextra_link_depsrrZlinkableZnew_depsZnew_depZ final_outputr-r7Z is_executableZ env_ldflagsrZmanifest_base_nameZintermediate_manifestZmanifest_filesdef_fileZrpathrrZ linked_binaryrZpdbnamer!rr"rEsf                                                    zNinjaWriter.WriteLinkForArchc stfdd|dgD}|ddks|s%|s%|j_dj_jjS|ddkr׈|j_jdvrJjsJjj jjd||d jjSg}j r^j |}|r^| d |fj rpj |j} | d | fjd ks|tjd kr||jjjjjj jjd|||djjSg} jD]} || } j| j | d|| ||d| | q||jjjjjj jjd| |djjS|||||j_jjS)Nc3s*|]}|jvrj|VqdSr)r]rrK)rrrJr!r" %s z*NinjaWriter.WriteTarget..rr<nonerH)ropenbsdnetbsdr$ alink_thinr libtool_flagslibflagsrralink)rrr>)anyrrr@r<rr+rrarrZGetLibtoolflagsrrxZ GetLibFlagsrrrrrr) rFrrsrwrrCrrrrrr8r7r!rJr"r$s~  ?   8 %      zNinjaWriter.WriteTargetcCs|jsJ|ddv}|}|r|d7}g}|j||||jj| d|rR|sR|ddkr=|jjr=|jj|d||dn| d|j f|jj|d ||dn |jj|d ||d||j_ |S) Nr<rLr)is_command_startrIpackage_ios_frameworkr>versionpackage_frameworkr) rr:rrr@rZisIOSrarrZGetFrameworkVersionrA)rFrrZis_emptyrr7rr!r!r"ros8  zNinjaWriter.WriteMacBundlecCs&|j|d}|jdkr|j|d}|S)z:Returns the variables toolchain would set for build steps.r.r$)r?r+GetMsvsToolchainEnv)rFr/rr!r!r"rs   zNinjaWriter.GetToolchainEnvcCs|jjd|jdS)z>Returns the variables Visual Studio would set for build steps.rrv)rxZ GetVSMacroEnvrs)rFr/r!r!r"rszNinjaWriter.GetMsvsToolchainEnvcCs4|jsJ|j}tj|j|tj||j|j |S)z6Returns the variables Xcode would set for build steps.) rdr(rr?rr4r5rfrkrs)rFr/rdr!r!r"r?s zNinjaWriter.GetSortedXcodeEnvcCs(i}|jd}|r||d<|j|dS)z:Returns the variables Xcode would set for postbuild steps.ZCHROMIUM_STRIP_SAVE_FILEr.)rZGetPerTargetSettingr?)rFZpostbuild_settingsZstrip_save_filer!r!r"GetSortedXcodePostbuildEnvs z&NinjaWriter.GetSortedXcodePostbuildEnvFcCs*|||||}|r|d|fdSdS)zAAdds a 'postbuild' variable if there is a postbuild for |output|. postbuildsN)GetPostbuildCommandr)rFrrr7r@r postbuildr!r!r"rsz#NinjaWriter.AppendPostbuildVariablec Cs|jr |ddks |s dSt||j}tjj|dd}|durC|jj|jtj tj |j |ttj tj |j ||j|dd}|sGdS| dtjd|jg||}|d d d d |D}|d |d}|ryd|d Sd|S)zReturns a shell command that runs all the postbuilds, and removes |output| if any of them fails. If |is_command_start| is False, then the returned string will start with ' && '.r<rrT)quietNrcdz (z && cSsg|]}t|qSr!)r/r0)rrr!r!r"rrz3NinjaWriter.GetPostbuildCommand..z$); G=$$?; ((exit $$G) || rm -rf %s) z && exit $$G)(z$ && ()rr,r+r(rZGetSpecPostbuildCommandsZAddImplicitPostbuildsrsr4r5rrfrlinsertrirrkr@r) rFrr7Z output_binaryrrrcommandscommand_stringr!r!r"rsL   zNinjaWriter.GetPostbuildCommandc Cs<g}|D]\}}|d|ttj|fqd|S)zGiven an environment, returns a string looking like 'export FOO=foo; export BAR="${FOO} bar;' that exports |env| to the shell.z export %s=%s;r)rr/r0r(rirrf)rFrZ export_strkvr!r!r"r@s  z"NinjaWriter.ComputeExportEnvStringcCs,|jsJtd}|tj||jS)zDReturn the 'output' (full output path) to a bundle output directory.r)rrzrur4r5rfrr)rFr5r!r!r"r:s z"NinjaWriter.ComputeMacBundleOutputc Cs|s|d}tt}t|d|ji|d|d|d|dd}|d||d}|d |d |d |d d}|d }|rGd |}n||d}d|vrV|d}n |d}|dkrct|d}|dvro|||S|dkrwd|Std|)z@Compute the filename of the final output for the current target.r<r+rrr)rMrIrHrproduct_prefixrSHARED_LIB_SUFFIXrrproduct_extensionr3 product_namerr)rHrMrIrrz%s.stampzUnhandled output type %s)r2rzCalculateVariablesr+rr# Exception) rFrr<default_variablesZDEFAULT_PREFIXr ZDEFAULT_EXTENSIONr9rr!r!r"rs:       z!NinjaWriter.ComputeOutputFileNamec Csh|d}|jdkr|j|j|j}|r|S|dur)|jdkr)|dvr)|j}n|||}|durEd|vrEtj |d|}||Sddg}|jdkrZ|j d krZ|d d g7}n|jdkri|j d kri|d g7}|durd }|j d kr~tj d d |j }tj |t ||S||vs|j r|S|d krd} |j d krtj dd |j } tj | |S|j|ddS)z2Compute the path for the final output of the spec.r<r$Nr)rHrrIrMrtrrMrrIrHr8z%srF)r)r+rxZ GetOutputNamersrurZGetExecutablePathrr4r5rfrr:rrr) rFrr8r<overriderr5Ztype_in_output_rootZarchdirlibdirr!r!r"r5sF        zNinjaWriter.ComputeOutputcCs0t|trJ|dur g}||d|dS)Nr) isinstancerrrf)rFrcr,valuesr!r!r"rgszNinjaWriter.WriteVariableListc sjdkrfdd|D}jj|jd}njdkr-fdd|D}tj|}j}jdkr<|dj7}|d|7}t d d |}gd } d d t t j | d} t | dd |}d} d} fdd|D}jdkr|d} |jr~dndj} |jrj|j} ntj||j} dtj| | } ntj|} dj| } jj|| ||d|| | dj||fS)zWrite out a new ninja "rule" statement for a given command. Returns the name of the new rule, and a copy of |args| with variables expanded.r$cs"g|] }jj|jjdqS)rv)rxryrlrsrrrJr!r"rvs  z1NinjaWriter.WriteNewNinjaRule..rvrcsg|] }tj|qSr!)r(rrr)rr!r"rrr3z [^a-zA-Z0-9_]r)r r r r r z(?!|)z\$Ncsg|] }|jqSr!)rurlrrJr!r"rrz.$unique_name.rsprrz%%s gyp-win-tool action-wrapper $arch zcd %s; T)rrestatrrspfilerspfile_content)r+rxryrsr(rrrrr&subrfr;r0rrkZBuildCygwinBashCommandLiner)ZEncodeRspFileListquotesysrr@rirrar*r)rFrrrrrrrrZprotectrrZrun_inrr!r r"rmsh         zNinjaWriter.WriteNewNinjaRuler)T)F))rUrVrWrGrurrrrrrrrrrrrrrrrrrrr_rrrrrrrr?rrrr@r:rrrrr!r!r!r"rYs` -  &/ ,) 3+6 e+ `K    /  62rYcCsvtj|}|dkrC|dd|dd|dtd|dtddd lmm}t|d ga t|d ga t|d ga d S|d krtj j }|dd d|d|d<d|d<d|d|d<d|d<d|d|d<dd lmm}t|d ga t|d ga tj||d S|}|dkrd}|d||dd|dtjdd|dtjddd S)zDCalculate additional variables for use in the build (called by gyp).rOSrz.dylibZSHARED_LIB_DIRrLIB_DIRrN+generator_additional_non_configuration_keys"generator_additional_path_sections!generator_extra_sources_for_rulesr$r3rrrrrHrrrIZandroidlinuxz.sorrr)r(ri GetFlavor setdefaultrzZgyp.generator.xcode generatorxcodegetattrrrrMSVSUtilZTARGET_TYPE_EXTZgyp.generator.msvsmsvsr)ZCalculateCommonVariablesr4r5rf)rparamsr+Zxcode_generatorZextsZmsvs_generatorZoperating_systemr!r!r"rsZ      rcCs@tj|djp d}|didd}tjtj||S)zEReturns the path from the toplevel_dir to the build output directory.optionsr3r output_dirrS)r4r5rgenerator_outputrrrf)rZ generator_dirrr!r!r"ComputeOutputDirsrcCs4|dj}tjtj|t|d}||dadS)zBCalled by __init__ to initialize generator values based on params.rZgypfiles)toplevelqualified_out_dirN)rnr4r5rrfrgenerator_filelist_paths)rrrr!r!r"CalculateGeneratorInputInfo s  rrcCstj|t||S)z;Open |path| for writing, creating directories if necessary.)r(riEnsureDirExistsopen)r5moder!r!r"rs  rcCs ||d}|r|d|S|S)Nrr)r)rwrappersprogwrapperr!r!r"CommandWithWrapper!s  rc stttjdd}|r |StjdvrMddlGfdddj}|}||_ j j |td|jd}tdttjd d }t||Stjd rtjd rtd /}td }|D]}||}|soqetdt|ddWdSWddS1swYdStjdkrzttgd} td| d WStjyYdSwdS)z6Returns a best-guess for a number of concurrent links.ZGYP_LINK_CONCURRENCYr)win32rNc sXeZdZdjfdjfdjfdjfdjfdjfdjfdjfd jfg Zd S) z1GetDefaultConcurrentLinks..MEMORYSTATUSEXdwLengthZ dwMemoryLoad ullTotalPhysZ ullAvailPhysZullTotalPageFileZullAvailPageFileZullTotalVirtualZullAvailVirtualZsullAvailExtendedVirtualN)rUrVrWc_ulong c_ulonglong_fields_r!ctypesr!r"MEMORYSTATUSEX1srrlZGYP_LINK_CONCURRENCY_MAXlrz /proc/meminfoz^MemTotal:\s*(\d*)\s*kBidarwin)Zsysctlz-nz hw.memsize)rr4rrrplatformr Structuresizeofrwindllkernel32ZGlobalMemoryStatusExbyrefmaxrminrr5existsrr&compiler'group subprocess check_outputCalledProcessError) Z pool_sizerstatZ mem_limitZhard_capZmeminfoZ memtotal_reliner'Z avail_bytesr!rr"GetDefaultConcurrentLinks(sF          rcCs |rdSdS)zyReturns the suffix used to select an appropriate linking rule depending on whether the manifest embedding is enabled.Z_embedrr!embed_manifestr!r!r"r_rTrc sfdd}t}ttjdddk}d|}dtj|f}||dd }|jd |||d d d dd|jd|||d d d dddtj|f}||dd}|jd|d||d ddddS)z7Adds link rules for Windows platform to |master_ninja|.cs$ddd|}dtj|||dS)N12)exedllz%(python)s gyp-win-tool link-with-manifests $arch %(embed)s %(out)s "%(ldcmd)s" %(resname)s $mt $rc "$intermediatemanifest" $manifests)pythonrSldcmdresnameZembed)rr)rrSZ binary_type resource_namerr!r"FullLinkCommandhsz)_AddWinLinkRules..FullLinkCommandZGYP_USE_SEPARATE_MSPDBSRV0rzLINK%s(DLL) $binaryz\%s gyp-win-tool link-wrapper $arch %s $ld /nologo $implibflag /DLL /OUT:$binary @$binary.rspz$binaryrrz $binary.rspz$libs $in_newline $ldflagsT link_pool)rrrrrrrzK%s gyp-win-tool link-wrapper $arch %s $ld /nologo /OUT:$binary @$binary.rsprrzLINK%s $binaryz$in_newline $libs $ldflags)rrrrrN) rrr4rrupperrrr*) master_ninjarrZrule_name_suffixZuse_separate_mspdbsrvZdlldescZdllcmdZexe_cmdr!rr"_AddWinLinkRulesesP        rcG s |d}tj|}|di}tjtjt|}tj|j |} t tj| d} t j | dd} tj || ||dkrLd} d} d}d }d }nd } d } d }d}d}d}d}| }d}d}d}d}d}d}d}d}d}tj|d\}}}||dg}tj||j } i}!|D]\}"}#|"dkrtj| |#} |"dkrtj| |#}|"dkrtj| |#} | dr| }|"dkrtj| |#}|"dkrtj| |#}|#}|"dkrtj| |#}|#}|"dkrtj| |#}|"dkrtj| |#}|"dkrtj| |#}|"d kr tj| |#}|"d!krtj| |#}|"d"kr#tj| |#}|"d#kr/tj| |#}|"d$kr;tj| |#}|"d%rQtj| |#|!|"dtd% <qtjD]&\}"}#|"d%r||"dtd% }$td&d'|$}$tj| |#|!|$<qW|d(d}%|%rd)|%|!d*<|dkrfd+d,|D}&d}'|d-dstj|&|}'tj| ||'t }(t|(D])\})}*|r|}*td|!t|*d}+|r|+|)d.krd/nd07}+| d1|)|+qtd2dg| } | d td|!| td3dg|}| d4td|!||dkr7| d5|| d6d7| d | | d8d9| d:d;| dd?n:| d5td*|!|| d@td*|!|| d tdAdg| |dBkrq| dtdCd!g|| dtdDd#g|tr|sy| }|s~|}| dEtdFg|| dGtdHg|| dItdJg|tdKg|}tdLg|}dM|vr|r| dM| }dN|vr|r| dN|}| dOtd|!|| dPtd|!||dkr| dQ|n| dQtd*|!|| dRtd*|!|| !| j"dSt#dT| !|dkrdUndV},|dkr3| j$d dWdXdY|,dZ| j$d[dWd\d]| j$d4d^d_dY|,dZn;d`}-da}.| j$d dW|-dbdc|,dd| j$d4d^|.dbde|,dd| j$d6dfdgt%j&d]| j$d8dhdit%j&d]| j$djdkdlt%j&d]|dBkr|dkr| j$dmdndod]| j$dpdndqd]drdsdtdu}/| j$dvdwdx|/dydzid{d|dSd}| j$d~ddx|/dydzid{ddSd}| j$ddddSdn|dkr| j$dmddt%j&dbddt'| dxdt'| ddn| j$ddddY|,dZ| j$ddddY|,dZ| j$dmddd]| j$dddd]| j$dddddid]d}0d|0ddu}/d}1| j$dvddx|/|1ddd{ddSd}| j$dddx|0|1ddd{ddSd}| j$d~ddx|/|1ddd{ddSd}| j$dddx|0|1ddd{ddSd}| j$ddddSd| j$dddd]| j$dddd]| j$dddd]| j$dddd]| j$dddd]| j$dddd]| j$dddd]| j$dddd]|dkr| j$dddt%j&d]n| j$dddd]|dkr| j$dddt%j&d]n|dkr| j$dddd]n| j$dddd]| !t(}2|dD]}tj)|tj|D]}3|2*|3qqt(}4i}5i}6t(}7t(}8|D]}9tj|9\}}:};||dg}<|||>/d͡}>t01|>2}?tj3|}@d}A|;dkrw|Ad|;7}Atj|A|@|:d}Bt4}Ct5|?|5|@||C| |B||j dҍ }D|D6|=|}3|C7dkrt tj| |B}E|E8|C9Wdn 1swY|C:| ;|B|3r|:|3<kr|=ddkr|6=|:g>|3|3|5|9<|9|2vr|4*|3<|8*|:q|7*|:q|6r$| !| ?dԡt|6D]}F| @|Fddd,|6|FDq|7|8}7|7rB| !| ?dסt|7D] }:| @|:dաq8|4r[| !| @ddt|4| A|ddء| :dS)Nrrz build.ninjax)widthr$zlib.exeZUNSETzlink.exez$ldrVrzc++z$ccz$cxxrWrXr[r\rmake_global_settingsZARzAR.hostZCCzclang-clZCXXzCC.hostzCXX.hostZLDzLD.hostZLDXXz LDXX.hostZNMzNM.hostZREADELFz READELF.host_wrapperz\.HOST$z.hostrzexport DEVELOPER_DIR='%s' &&ZLINKcsg|] }|dqS)rr!)rqualified_targetrs target_dictsr!r"r sz+GenerateOutputForConfig..Z"ninja_use_custom_environment_filesrZz -m32z -m64Zcl_ CC_target CXX_targetrrYrzmidl.exerzrc.exeZml_x86zml.exeZml_x64zml64.exemtzmt.exerZ AR_targetrZ NM_targetZREADELF_targetar_hostAR_hostnm_hostZNM_host readelf_hostZ READELF_hostCC_hostCXX_hostz$(CC)z$(CXX)rrld_host ldxx_hostr)depthmsvcZgcczCC $outzU$cc -MMD -MF $out.d $defines $includes $cflags $cflags_c $cflags_pch_c -c $in -o $outz$out.d)rrrdepsr}zE$cc $defines $includes $cflags $cflags_c $cflags_pch_c -c $in -o $out)rrzCXX $outzX$cxx -MMD -MF $out.d $defines $includes $cflags $cflags_cc $cflags_pch_cc -c $in -o $outz_ninja -t msvc -e $arch -- $cc /nologo /showIncludes /FC @$out.rsp /c $in /Fo$out /Fd$pdbname_c zaninja -t msvc -e $arch -- $cxx /nologo /showIncludes /FC @$out.rsp /c $in /Fo$out /Fd$pdbname_cc z$out.rspz$$defines $includes $cflags $cflags_c)rrrrr5z%$defines $includes $cflags $cflags_cczIDL $inzd%s gyp-win-tool midl-wrapper $arch $outdir $tlb $h $dlldata $iid $proxy $in $midl_includes $idlflagszRC $inzU%s gyp-win-tool rc-wrapper $arch $rc $defines $resource_includes $rcflags /fo$out $inrzASM $outzS%s gyp-win-tool asm-wrapper $arch $asm $defines $includes $asmflags /c /Fo $out $inrzAR $outz'rm -f $out && $ar rcs $arflags $out $inrz(rm -f $out && $ar rcsT $arflags $out $inzif [ ! -e $lib -o ! -e $lib.TOC ]; then %(solink)s && %(extract_toc)s > $lib.TOC; else %(solink)s && %(extract_toc)s > $lib.tmp && if ! cmp -s $lib.tmp $lib.TOC; then mv $lib.tmp $lib.TOC ; fi; fiz;$ld -shared $ldflags -o $lib -Wl,-soname=$soname %(suffix)szI{ $readelf -d $lib | grep SONAME ; $nm -gD -f p $lib | cut -f1-2 -d' '; })r extract_tocrz SOLINK $libTsuffixz@$link_file_listz$link_file_listz<-Wl,--whole-archive $in $solibs -Wl,--no-whole-archive $libs)rrrrrrrzSOLINK(module) $libz3-Wl,--start-group $in $solibs $libs -Wl,--end-grouprz LINK $outzH$ld $ldflags -o $out -Wl,--start-group $in $solibs $libs -Wl,--end-group)rrrzLIB $outzU%s gyp-win-tool link-wrapper $arch False $ar /nologo /ignore:4221 /OUT:$out @$out.rspz$in_newline $libflags)rrrrrFr~z OBJC $outz[$cc -MMD -MF $out.d $defines $includes $cflags $cflags_objc $cflags_pch_objc -c $in -o $outrz OBJCXX $outz^$cxx -MMD -MF $out.d $defines $includes $cflags $cflags_objcc $cflags_pch_objcc -c $in -o $outzLIBTOOL-STATIC $out, POSTBUILDSzarm -f $out && ./gyp-mac-tool filter-libtool libtool $libtool_flags -static -o $out $in$postbuildsrzLIPO $out, POSTBUILDSz6rm -f $out && lipo -create $in -output $out$postbuildsrzSOLIPO $out, POSTBUILDSz\rm -f $lib $lib.TOC && lipo -create $in -output $lib$postbuilds &&%(extract_toc)s > $lib.TOCr6z]{ otool -l $lib | grep LC_ID_DYLIB -A 5; nm -gP $lib | cut -f1-2 -d' ' | grep -v U$$; true; }z($ld %(type)s $ldflags -o $lib %(suffix)szif [ ! -e $lib -o ! -e $lib.TOC ] || otool -l $lib | grep -q LC_REEXPORT_DYLIB ; then %(solink)s && %(extract_toc)s > $lib.TOC; else %(solink)s && %(extract_toc)s > $lib.tmp && if ! cmp -s $lib.tmp $lib.TOC; then mv $lib.tmp $lib.TOC ; fi; fiz@$link_file_list$postbuildszSOLINK $lib, POSTBUILDSz-shared)r7r<z$in $solibs $libsZ solink_notoczSOLINK(module) $lib, POSTBUILDSz-bundleZsolink_module_notoczLINK $out, POSTBUILDSz1$ld $ldflags -o $out $in $solibs $libs$postbuildsrOzPREPROCESS INFOPLIST $outzT$cc -E -P -Wno-trigraphs -x c $defines $in -o $out && plutil -convert xml1 $out $outrRzCOPY INFOPLIST $inz:$env ./gyp-mac-tool copy-info-plist $in $out $binary $keysrQzMERGE INFOPLISTS $inz-$env ./gyp-mac-tool merge-info-plist $out $inrFzCOMPILE XCASSETS $inz.$env ./gyp-mac-tool compile-xcassets $keys $inr9z2COMPILE HEADER MAPS AND COPY FRAMEWORK HEADERS $inz$env ./gyp-mac-tool compile-ios-framework-header-map $out $framework $in && $env ./gyp-mac-tool copy-ios-framework-headers $framework $copy_headersr=zMACTOOL $mactool_cmd $inz1$env ./gyp-mac-tool $mactool_cmd $in $out $binaryrz"PACKAGE FRAMEWORK $out, POSTBUILDSzG./gyp-mac-tool package-framework $out $version$postbuilds && touch $outrz&PACKAGE IOS FRAMEWORK $out, POSTBUILDSzC./gyp-mac-tool package-ios-framework $out $postbuilds && touch $outrz STAMP $outz%s gyp-win-tool stamp $outz${postbuilds}touch $outr2z COPY $in $outz)%s gyp-win-tool recursive-mirror $in $outzoszrm -rf $out && cp -fRP $in $outz>ln -f $in $out 2>/dev/null || (rm -rf $out && cp -af $in $out) build_filesz;make_global_settings needs to be the same for all targets. z vs. zutf-8rrr3r)rnrzShort names for targets.ZphonycSsg|]}|qSr!)rQ)rrr!r!r"r0 rz(Empty targets (output for completeness).allZdefault_target)Br(rirrr4r5rrfrrnrr/r`CopyToolParseQualifiedTargetrjrrrrHlowerr&rr)ZExtractSharedMSVSSystemIncludesZGenerateEnvironmentFilesr$rr,rr$generator_supports_multiple_toolsetsr*rrrr*rrrr AllTargetsr#rZMergeGlobalXcodeSettingsToSpec RelativePathQualifiedTargetencoder'r(r)r|rrYrtellwritegetvaluecloserrQrrcommentrdefault)G target_listr&datarrsrr+rr_rbZmaster_ninja_filerrVrrrYr1rZr2r+rrZcc_host_global_settingZcxx_host_global_settingZclang_clr[r-r\r. build_filerr"Z build_to_rootrkeyrZ key_prefixrconfigsZshared_system_includesZcl_pathsr8r5rr5Z cc_commandZ cxx_commandZmtime_preserving_solink_baseZ solink_baseZ solink_suffixZ all_targetsrrr]Ztarget_short_namesZempty_target_namesZnon_empty_target_namesr$rrZthis_make_global_settingsrZqualified_target_for_hashr\ base_pathrrmZ ninja_outputwriterrcZ short_namer!r%r"GenerateOutputForConfigs                                                                          rPcCsP|d}|D]}tj|jd|}dd|g}td|d|t|qdS)NrrSraz-Cz Building [z]: )r4r5rfrnrr  check_call)rJrrrrwZbuilddir argumentsr!r!r" PerformBuildE s  rScCs2ttjtj|\}}}}}t|||||dSr)signalSIGINTSIG_IGNrP)ZarglistrIr&rJrrsr!r!r"CallGenerateOutputForConfigN srWc Cstj|}|didd}tj|dkr)t||\}}t||t \}}|r5t |||||dS||dd}|druz!t t |}g}|D] }||||||fqM|t|WdStyt} z|| d} ~ ww|D] }t |||||qwdS)Nrrwr$rrparallel)r(rZ&CloneConfigurationForDeviceAndEmulatorrrirr ShardTargetsInsertLargePdbShimsrzrPmultiprocessingPoolrrr;rWKeyboardInterrupt terminate) rIr&rJrZ user_configZ config_namesrZarglistsrser!r!r"GenerateOutputW s>  r`r)0rr2r'rIr[os.pathr4r&rTr rr( gyp.commonZgyp.msvs_emulation gyp.MSVSUtilrZgyp.xcode_emulationiorrZgyp.ninja_syntaxr/rzrrrrriCrossCompileRequestedr>r#r,r2r:r;rYrrrrrrrrrPrSrWr`r!r!r!r"s         py> 7?& o ۤ_c@sdS)NrrrHD:\a\_work\1\s\node_modules\node-gyp\gyp\pylib\gyp\generator\__init__.pys'use strict'; var parseUrl = require('url').parse; var DEFAULT_PORTS = { ftp: 21, gopher: 70, http: 80, https: 443, ws: 80, wss: 443, }; var stringEndsWith = String.prototype.endsWith || function(s) { return s.length <= this.length && this.indexOf(s, this.length - s.length) !== -1; }; /** * @param {string|object} url - The URL, or the result from url.parse. * @return {string} The URL of the proxy that should handle the request to the * given URL. If no proxy is set, this will be an empty string. */ function getProxyForUrl(url) { var parsedUrl = typeof url === 'string' ? parseUrl(url) : url || {}; var proto = parsedUrl.protocol; var hostname = parsedUrl.host; var port = parsedUrl.port; if (typeof hostname !== 'string' || !hostname || typeof proto !== 'string') { return ''; // Don't proxy URLs without a valid scheme or host. } proto = proto.split(':', 1)[0]; // Stripping ports in this way instead of using parsedUrl.hostname to make // sure that the brackets around IPv6 addresses are kept. hostname = hostname.replace(/:\d*$/, ''); port = parseInt(port) || DEFAULT_PORTS[proto] || 0; if (!shouldProxy(hostname, port)) { return ''; // Don't proxy URLs that match NO_PROXY. } var proxy = getEnv('npm_config_' + proto + '_proxy') || getEnv(proto + '_proxy') || getEnv('npm_config_proxy') || getEnv('all_proxy'); if (proxy && proxy.indexOf('://') === -1) { // Missing scheme in proxy, default to the requested URL's scheme. proxy = proto + '://' + proxy; } return proxy; } /** * Determines whether a given URL should be proxied. * * @param {string} hostname - The host name of the URL. * @param {number} port - The effective port of the URL. * @returns {boolean} Whether the given URL should be proxied. * @private */ function shouldProxy(hostname, port) { var NO_PROXY = (getEnv('npm_config_no_proxy') || getEnv('no_proxy')).toLowerCase(); if (!NO_PROXY) { return true; // Always proxy if NO_PROXY is not set. } if (NO_PROXY === '*') { return false; // Never proxy if wildcard is set. } return NO_PROXY.split(/[,\s]/).every(function(proxy) { if (!proxy) { return true; // Skip zero-length hosts. } var parsedProxy = proxy.match(/^(.+):(\d+)$/); var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy; var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0; if (parsedProxyPort && parsedProxyPort !== port) { return true; // Skip if ports don't match. } if (!/^[.*]/.test(parsedProxyHostname)) { // No wildcards, so stop proxying if there is an exact match. return hostname !== parsedProxyHostname; } if (parsedProxyHostname.charAt(0) === '*') { // Remove leading wildcard. parsedProxyHostname = parsedProxyHostname.slice(1); } // Stop proxying if the hostname ends with the no_proxy host. return !stringEndsWith.call(hostname, parsedProxyHostname); }); } /** * Get the value for an environment variable. * * @param {string} key - The name of the environment variable. * @return {string} The value of the environment variable. * @private */ function getEnv(key) { return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || ''; } exports.getProxyForUrl = getProxyForUrl; The MIT License Copyright (C) 2016-2018 Rob Wu Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "proxy-from-env", "version": "1.1.0", "description": "Offers getProxyForUrl to get the proxy URL for a URL, respecting the *_PROXY (e.g. HTTP_PROXY) and NO_PROXY environment variables.", "main": "index.js", "scripts": { "lint": "eslint *.js", "test": "mocha ./test.js --reporter spec", "test-coverage": "istanbul cover ./node_modules/.bin/_mocha -- --reporter spec" }, "repository": { "type": "git", "url": "https://github.com/Rob--W/proxy-from-env.git" }, "keywords": [ "proxy", "http_proxy", "https_proxy", "no_proxy", "environment" ], "author": "Rob Wu (https://robwu.nl/)", "license": "MIT", "bugs": { "url": "https://github.com/Rob--W/proxy-from-env/issues" }, "homepage": "https://github.com/Rob--W/proxy-from-env#readme", "devDependencies": { "coveralls": "^3.0.9", "eslint": "^6.8.0", "istanbul": "^0.4.5", "mocha": "^7.1.0" } } /* eslint max-statements:0 */ 'use strict'; var assert = require('assert'); var parseUrl = require('url').parse; var getProxyForUrl = require('./').getProxyForUrl; // Runs the callback with process.env temporarily set to env. function runWithEnv(env, callback) { var originalEnv = process.env; process.env = env; try { callback(); } finally { process.env = originalEnv; } } // Defines a test case that checks whether getProxyForUrl(input) === expected. function testProxyUrl(env, expected, input) { assert(typeof env === 'object' && env !== null); // Copy object to make sure that the in param does not get modified between // the call of this function and the use of it below. env = JSON.parse(JSON.stringify(env)); var title = 'getProxyForUrl(' + JSON.stringify(input) + ')' + ' === ' + JSON.stringify(expected); // Save call stack for later use. var stack = {}; Error.captureStackTrace(stack, testProxyUrl); // Only use the last stack frame because that shows where this function is // called, and that is sufficient for our purpose. No need to flood the logs // with an uninteresting stack trace. stack = stack.stack.split('\n', 2)[1]; it(title, function() { var actual; runWithEnv(env, function() { actual = getProxyForUrl(input); }); if (expected === actual) { return; // Good! } try { assert.strictEqual(expected, actual); // Create a formatted error message. // Should not happen because previously we determined expected !== actual. throw new Error('assert.strictEqual passed. This is impossible!'); } catch (e) { // Use the original stack trace, so we can see a helpful line number. e.stack = e.message + stack; throw e; } }); } describe('getProxyForUrl', function() { describe('No proxy variables', function() { var env = {}; testProxyUrl(env, '', 'http://example.com'); testProxyUrl(env, '', 'https://example.com'); testProxyUrl(env, '', 'ftp://example.com'); }); describe('Invalid URLs', function() { var env = {}; env.ALL_PROXY = 'http://unexpected.proxy'; testProxyUrl(env, '', 'bogus'); testProxyUrl(env, '', '//example.com'); testProxyUrl(env, '', '://example.com'); testProxyUrl(env, '', '://'); testProxyUrl(env, '', '/path'); testProxyUrl(env, '', ''); testProxyUrl(env, '', 'http:'); testProxyUrl(env, '', 'http:/'); testProxyUrl(env, '', 'http://'); testProxyUrl(env, '', 'prototype://'); testProxyUrl(env, '', 'hasOwnProperty://'); testProxyUrl(env, '', '__proto__://'); testProxyUrl(env, '', undefined); testProxyUrl(env, '', null); testProxyUrl(env, '', {}); testProxyUrl(env, '', {host: 'x', protocol: 1}); testProxyUrl(env, '', {host: 1, protocol: 'x'}); }); describe('http_proxy and HTTP_PROXY', function() { var env = {}; env.HTTP_PROXY = 'http://http-proxy'; testProxyUrl(env, '', 'https://example'); testProxyUrl(env, 'http://http-proxy', 'http://example'); testProxyUrl(env, 'http://http-proxy', parseUrl('http://example')); // eslint-disable-next-line camelcase env.http_proxy = 'http://priority'; testProxyUrl(env, 'http://priority', 'http://example'); }); describe('http_proxy with non-sensical value', function() { var env = {}; // Crazy values should be passed as-is. It is the responsibility of the // one who launches the application that the value makes sense. // TODO: Should we be stricter and perform validation? env.HTTP_PROXY = 'Crazy \n!() { ::// }'; testProxyUrl(env, 'Crazy \n!() { ::// }', 'http://wow'); // The implementation assumes that the HTTP_PROXY environment variable is // somewhat reasonable, and if the scheme is missing, it is added. // Garbage in, garbage out some would say... env.HTTP_PROXY = 'crazy without colon slash slash'; testProxyUrl(env, 'http://crazy without colon slash slash', 'http://wow'); }); describe('https_proxy and HTTPS_PROXY', function() { var env = {}; // Assert that there is no fall back to http_proxy env.HTTP_PROXY = 'http://unexpected.proxy'; testProxyUrl(env, '', 'https://example'); env.HTTPS_PROXY = 'http://https-proxy'; testProxyUrl(env, 'http://https-proxy', 'https://example'); // eslint-disable-next-line camelcase env.https_proxy = 'http://priority'; testProxyUrl(env, 'http://priority', 'https://example'); }); describe('ftp_proxy', function() { var env = {}; // Something else than http_proxy / https, as a sanity check. env.FTP_PROXY = 'http://ftp-proxy'; testProxyUrl(env, 'http://ftp-proxy', 'ftp://example'); testProxyUrl(env, '', 'ftps://example'); }); describe('all_proxy', function() { var env = {}; env.ALL_PROXY = 'http://catch-all'; testProxyUrl(env, 'http://catch-all', 'https://example'); // eslint-disable-next-line camelcase env.all_proxy = 'http://priority'; testProxyUrl(env, 'http://priority', 'https://example'); }); describe('all_proxy without scheme', function() { var env = {}; env.ALL_PROXY = 'noscheme'; testProxyUrl(env, 'http://noscheme', 'http://example'); testProxyUrl(env, 'https://noscheme', 'https://example'); // The module does not impose restrictions on the scheme. testProxyUrl(env, 'bogus-scheme://noscheme', 'bogus-scheme://example'); // But the URL should still be valid. testProxyUrl(env, '', 'bogus'); }); describe('no_proxy empty', function() { var env = {}; env.HTTPS_PROXY = 'http://proxy'; // NO_PROXY set but empty. env.NO_PROXY = ''; testProxyUrl(env, 'http://proxy', 'https://example'); // No entries in NO_PROXY (comma). env.NO_PROXY = ','; testProxyUrl(env, 'http://proxy', 'https://example'); // No entries in NO_PROXY (whitespace). env.NO_PROXY = ' '; testProxyUrl(env, 'http://proxy', 'https://example'); // No entries in NO_PROXY (multiple whitespace / commas). env.NO_PROXY = ',\t,,,\n, ,\r'; testProxyUrl(env, 'http://proxy', 'https://example'); }); describe('no_proxy=example (single host)', function() { var env = {}; env.HTTP_PROXY = 'http://proxy'; env.NO_PROXY = 'example'; testProxyUrl(env, '', 'http://example'); testProxyUrl(env, '', 'http://example:80'); testProxyUrl(env, '', 'http://example:0'); testProxyUrl(env, '', 'http://example:1337'); testProxyUrl(env, 'http://proxy', 'http://sub.example'); testProxyUrl(env, 'http://proxy', 'http://prefexample'); testProxyUrl(env, 'http://proxy', 'http://example.no'); testProxyUrl(env, 'http://proxy', 'http://a.b.example'); testProxyUrl(env, 'http://proxy', 'http://host/example'); }); describe('no_proxy=sub.example (subdomain)', function() { var env = {}; env.HTTP_PROXY = 'http://proxy'; env.NO_PROXY = 'sub.example'; testProxyUrl(env, 'http://proxy', 'http://example'); testProxyUrl(env, 'http://proxy', 'http://example:80'); testProxyUrl(env, 'http://proxy', 'http://example:0'); testProxyUrl(env, 'http://proxy', 'http://example:1337'); testProxyUrl(env, '', 'http://sub.example'); testProxyUrl(env, 'http://proxy', 'http://no.sub.example'); testProxyUrl(env, 'http://proxy', 'http://sub-example'); testProxyUrl(env, 'http://proxy', 'http://example.sub'); }); describe('no_proxy=example:80 (host + port)', function() { var env = {}; env.HTTP_PROXY = 'http://proxy'; env.NO_PROXY = 'example:80'; testProxyUrl(env, '', 'http://example'); testProxyUrl(env, '', 'http://example:80'); testProxyUrl(env, '', 'http://example:0'); testProxyUrl(env, 'http://proxy', 'http://example:1337'); testProxyUrl(env, 'http://proxy', 'http://sub.example'); testProxyUrl(env, 'http://proxy', 'http://prefexample'); testProxyUrl(env, 'http://proxy', 'http://example.no'); testProxyUrl(env, 'http://proxy', 'http://a.b.example'); }); describe('no_proxy=.example (host suffix)', function() { var env = {}; env.HTTP_PROXY = 'http://proxy'; env.NO_PROXY = '.example'; testProxyUrl(env, 'http://proxy', 'http://example'); testProxyUrl(env, 'http://proxy', 'http://example:80'); testProxyUrl(env, 'http://proxy', 'http://example:1337'); testProxyUrl(env, '', 'http://sub.example'); testProxyUrl(env, '', 'http://sub.example:80'); testProxyUrl(env, '', 'http://sub.example:1337'); testProxyUrl(env, 'http://proxy', 'http://prefexample'); testProxyUrl(env, 'http://proxy', 'http://example.no'); testProxyUrl(env, '', 'http://a.b.example'); }); describe('no_proxy=*', function() { var env = {}; env.HTTP_PROXY = 'http://proxy'; env.NO_PROXY = '*'; testProxyUrl(env, '', 'http://example.com'); }); describe('no_proxy=*.example (host suffix with *.)', function() { var env = {}; env.HTTP_PROXY = 'http://proxy'; env.NO_PROXY = '*.example'; testProxyUrl(env, 'http://proxy', 'http://example'); testProxyUrl(env, 'http://proxy', 'http://example:80'); testProxyUrl(env, 'http://proxy', 'http://example:1337'); testProxyUrl(env, '', 'http://sub.example'); testProxyUrl(env, '', 'http://sub.example:80'); testProxyUrl(env, '', 'http://sub.example:1337'); testProxyUrl(env, 'http://proxy', 'http://prefexample'); testProxyUrl(env, 'http://proxy', 'http://example.no'); testProxyUrl(env, '', 'http://a.b.example'); }); describe('no_proxy=*example (substring suffix)', function() { var env = {}; env.HTTP_PROXY = 'http://proxy'; env.NO_PROXY = '*example'; testProxyUrl(env, '', 'http://example'); testProxyUrl(env, '', 'http://example:80'); testProxyUrl(env, '', 'http://example:1337'); testProxyUrl(env, '', 'http://sub.example'); testProxyUrl(env, '', 'http://sub.example:80'); testProxyUrl(env, '', 'http://sub.example:1337'); testProxyUrl(env, '', 'http://prefexample'); testProxyUrl(env, '', 'http://a.b.example'); testProxyUrl(env, 'http://proxy', 'http://example.no'); testProxyUrl(env, 'http://proxy', 'http://host/example'); }); describe('no_proxy=.*example (arbitrary wildcards are NOT supported)', function() { var env = {}; env.HTTP_PROXY = 'http://proxy'; env.NO_PROXY = '.*example'; testProxyUrl(env, 'http://proxy', 'http://example'); testProxyUrl(env, 'http://proxy', 'http://sub.example'); testProxyUrl(env, 'http://proxy', 'http://sub.example'); testProxyUrl(env, 'http://proxy', 'http://prefexample'); testProxyUrl(env, 'http://proxy', 'http://x.prefexample'); testProxyUrl(env, 'http://proxy', 'http://a.b.example'); }); describe('no_proxy=[::1],[::2]:80,10.0.0.1,10.0.0.2:80 (IP addresses)', function() { var env = {}; env.HTTP_PROXY = 'http://proxy'; env.NO_PROXY = '[::1],[::2]:80,10.0.0.1,10.0.0.2:80'; testProxyUrl(env, '', 'http://[::1]/'); testProxyUrl(env, '', 'http://[::1]:80/'); testProxyUrl(env, '', 'http://[::1]:1337/'); testProxyUrl(env, '', 'http://[::2]/'); testProxyUrl(env, '', 'http://[::2]:80/'); testProxyUrl(env, 'http://proxy', 'http://[::2]:1337/'); testProxyUrl(env, '', 'http://10.0.0.1/'); testProxyUrl(env, '', 'http://10.0.0.1:80/'); testProxyUrl(env, '', 'http://10.0.0.1:1337/'); testProxyUrl(env, '', 'http://10.0.0.2/'); testProxyUrl(env, '', 'http://10.0.0.2:80/'); testProxyUrl(env, 'http://proxy', 'http://10.0.0.2:1337/'); }); describe('no_proxy=127.0.0.1/32 (CIDR is NOT supported)', function() { var env = {}; env.HTTP_PROXY = 'http://proxy'; env.NO_PROXY = '127.0.0.1/32'; testProxyUrl(env, 'http://proxy', 'http://127.0.0.1'); testProxyUrl(env, 'http://proxy', 'http://127.0.0.1/32'); }); describe('no_proxy=127.0.0.1 does NOT match localhost', function() { var env = {}; env.HTTP_PROXY = 'http://proxy'; env.NO_PROXY = '127.0.0.1'; testProxyUrl(env, '', 'http://127.0.0.1'); // We're not performing DNS queries, so this shouldn't match. testProxyUrl(env, 'http://proxy', 'http://localhost'); }); describe('no_proxy with protocols that have a default port', function() { var env = {}; env.WS_PROXY = 'http://ws'; env.WSS_PROXY = 'http://wss'; env.HTTP_PROXY = 'http://http'; env.HTTPS_PROXY = 'http://https'; env.GOPHER_PROXY = 'http://gopher'; env.FTP_PROXY = 'http://ftp'; env.ALL_PROXY = 'http://all'; env.NO_PROXY = 'xxx:21,xxx:70,xxx:80,xxx:443'; testProxyUrl(env, '', 'http://xxx'); testProxyUrl(env, '', 'http://xxx:80'); testProxyUrl(env, 'http://http', 'http://xxx:1337'); testProxyUrl(env, '', 'ws://xxx'); testProxyUrl(env, '', 'ws://xxx:80'); testProxyUrl(env, 'http://ws', 'ws://xxx:1337'); testProxyUrl(env, '', 'https://xxx'); testProxyUrl(env, '', 'https://xxx:443'); testProxyUrl(env, 'http://https', 'https://xxx:1337'); testProxyUrl(env, '', 'wss://xxx'); testProxyUrl(env, '', 'wss://xxx:443'); testProxyUrl(env, 'http://wss', 'wss://xxx:1337'); testProxyUrl(env, '', 'gopher://xxx'); testProxyUrl(env, '', 'gopher://xxx:70'); testProxyUrl(env, 'http://gopher', 'gopher://xxx:1337'); testProxyUrl(env, '', 'ftp://xxx'); testProxyUrl(env, '', 'ftp://xxx:21'); testProxyUrl(env, 'http://ftp', 'ftp://xxx:1337'); }); describe('no_proxy should not be case-sensitive', function() { var env = {}; env.HTTP_PROXY = 'http://proxy'; env.NO_PROXY = 'XXX,YYY,ZzZ'; testProxyUrl(env, '', 'http://xxx'); testProxyUrl(env, '', 'http://XXX'); testProxyUrl(env, '', 'http://yyy'); testProxyUrl(env, '', 'http://YYY'); testProxyUrl(env, '', 'http://ZzZ'); testProxyUrl(env, '', 'http://zZz'); }); describe('NPM proxy configuration', function() { describe('npm_config_http_proxy should work', function() { var env = {}; // eslint-disable-next-line camelcase env.npm_config_http_proxy = 'http://http-proxy'; testProxyUrl(env, '', 'https://example'); testProxyUrl(env, 'http://http-proxy', 'http://example'); // eslint-disable-next-line camelcase env.npm_config_http_proxy = 'http://priority'; testProxyUrl(env, 'http://priority', 'http://example'); }); // eslint-disable-next-line max-len describe('npm_config_http_proxy should take precedence over HTTP_PROXY and npm_config_proxy', function() { var env = {}; // eslint-disable-next-line camelcase env.npm_config_http_proxy = 'http://http-proxy'; // eslint-disable-next-line camelcase env.npm_config_proxy = 'http://unexpected-proxy'; env.HTTP_PROXY = 'http://unexpected-proxy'; testProxyUrl(env, 'http://http-proxy', 'http://example'); }); describe('npm_config_https_proxy should work', function() { var env = {}; // eslint-disable-next-line camelcase env.npm_config_http_proxy = 'http://unexpected.proxy'; testProxyUrl(env, '', 'https://example'); // eslint-disable-next-line camelcase env.npm_config_https_proxy = 'http://https-proxy'; testProxyUrl(env, 'http://https-proxy', 'https://example'); // eslint-disable-next-line camelcase env.npm_config_https_proxy = 'http://priority'; testProxyUrl(env, 'http://priority', 'https://example'); }); // eslint-disable-next-line max-len describe('npm_config_https_proxy should take precedence over HTTPS_PROXY and npm_config_proxy', function() { var env = {}; // eslint-disable-next-line camelcase env.npm_config_https_proxy = 'http://https-proxy'; // eslint-disable-next-line camelcase env.npm_config_proxy = 'http://unexpected-proxy'; env.HTTPS_PROXY = 'http://unexpected-proxy'; testProxyUrl(env, 'http://https-proxy', 'https://example'); }); describe('npm_config_proxy should work', function() { var env = {}; // eslint-disable-next-line camelcase env.npm_config_proxy = 'http://http-proxy'; testProxyUrl(env, 'http://http-proxy', 'http://example'); testProxyUrl(env, 'http://http-proxy', 'https://example'); // eslint-disable-next-line camelcase env.npm_config_proxy = 'http://priority'; testProxyUrl(env, 'http://priority', 'http://example'); testProxyUrl(env, 'http://priority', 'https://example'); }); // eslint-disable-next-line max-len describe('HTTP_PROXY and HTTPS_PROXY should take precedence over npm_config_proxy', function() { var env = {}; env.HTTP_PROXY = 'http://http-proxy'; env.HTTPS_PROXY = 'http://https-proxy'; // eslint-disable-next-line camelcase env.npm_config_proxy = 'http://unexpected-proxy'; testProxyUrl(env, 'http://http-proxy', 'http://example'); testProxyUrl(env, 'http://https-proxy', 'https://example'); }); describe('npm_config_no_proxy should work', function() { var env = {}; env.HTTP_PROXY = 'http://proxy'; // eslint-disable-next-line camelcase env.npm_config_no_proxy = 'example'; testProxyUrl(env, '', 'http://example'); testProxyUrl(env, 'http://proxy', 'http://otherwebsite'); }); // eslint-disable-next-line max-len describe('npm_config_no_proxy should take precedence over NO_PROXY', function() { var env = {}; env.HTTP_PROXY = 'http://proxy'; env.NO_PROXY = 'otherwebsite'; // eslint-disable-next-line camelcase env.npm_config_no_proxy = 'example'; testProxyUrl(env, '', 'http://example'); testProxyUrl(env, 'http://proxy', 'http://otherwebsite'); }); }); }); { "name": "socks-proxy-agent", "version": "5.0.0", "description": "A SOCKS proxy `http.Agent` implementation for HTTP and HTTPS", "main": "dist/index", "typings": "dist/index", "files": [ "dist" ], "scripts": { "prebuild": "rimraf dist", "build": "tsc", "test": "mocha --reporter spec", "test-lint": "eslint src --ext .js,.ts", "prepublishOnly": "npm run build" }, "repository": { "type": "git", "url": "git://github.com/TooTallNate/node-socks-proxy-agent.git" }, "keywords": [ "socks", "socks4", "socks4a", "socks5", "socks5h", "proxy", "http", "https", "agent" ], "author": "Nathan Rajlich (http://n8.io/)", "license": "MIT", "bugs": { "url": "https://github.com/TooTallNate/node-socks-proxy-agent/issues" }, "dependencies": { "agent-base": "6", "debug": "4", "socks": "^2.3.3" }, "devDependencies": { "@types/debug": "4", "@types/node": "^12.12.11", "@typescript-eslint/eslint-plugin": "1.6.0", "@typescript-eslint/parser": "1.1.0", "eslint": "5.16.0", "eslint-config-airbnb": "17.1.0", "eslint-config-prettier": "4.1.0", "eslint-import-resolver-typescript": "1.1.1", "eslint-plugin-import": "2.16.0", "eslint-plugin-jsx-a11y": "6.2.1", "eslint-plugin-react": "7.12.4", "mocha": "^6.2.2", "proxy": "1", "raw-body": "^2.3.2", "rimraf": "^3.0.0", "socksv5": "TooTallNate/socksv5#fix/dstSock-close-event", "typescript": "^3.5.3" }, "engines": { "node": ">= 6" } } "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const dns_1 = __importDefault(require("dns")); const tls_1 = __importDefault(require("tls")); const url_1 = __importDefault(require("url")); const debug_1 = __importDefault(require("debug")); const agent_base_1 = require("agent-base"); const socks_1 = require("socks"); const debug = debug_1.default('socks-proxy-agent'); function dnsLookup(host) { return new Promise((resolve, reject) => { dns_1.default.lookup(host, (err, res) => { if (err) { reject(err); } else { resolve(res); } }); }); } function parseSocksProxy(opts) { let port = 0; let lookup = false; let type = 5; // Prefer `hostname` over `host`, because of `url.parse()` const host = opts.hostname || opts.host; if (!host) { throw new TypeError('No "host"'); } if (typeof opts.port === 'number') { port = opts.port; } else if (typeof opts.port === 'string') { port = parseInt(opts.port, 10); } // From RFC 1928, Section 3: https://tools.ietf.org/html/rfc1928#section-3 // "The SOCKS service is conventionally located on TCP port 1080" if (!port) { port = 1080; } // figure out if we want socks v4 or v5, based on the "protocol" used. // Defaults to 5. if (opts.protocol) { switch (opts.protocol) { case 'socks4:': lookup = true; // pass through case 'socks4a:': type = 4; break; case 'socks5:': lookup = true; // pass through case 'socks:': // no version specified, default to 5h case 'socks5h:': type = 5; break; default: throw new TypeError(`A "socks" protocol must be specified! Got: ${opts.protocol}`); } } if (typeof opts.type !== 'undefined') { if (opts.type === 4 || opts.type === 5) { type = opts.type; } else { throw new TypeError(`"type" must be 4 or 5, got: ${opts.type}`); } } const proxy = { host, port, type }; let userId = opts.userId; let password = opts.password; if (opts.auth) { const auth = opts.auth.split(':'); userId = auth[0]; password = auth[1]; } if (userId) { Object.defineProperty(proxy, 'userId', { value: userId, enumerable: false }); } if (password) { Object.defineProperty(proxy, 'password', { value: password, enumerable: false }); } return { lookup, proxy }; } /** * The `SocksProxyAgent`. * * @api public */ class SocksProxyAgent extends agent_base_1.Agent { constructor(_opts) { let opts; if (typeof _opts === 'string') { opts = url_1.default.parse(_opts); } else { opts = _opts; } if (!opts) { throw new TypeError('a SOCKS proxy server `host` and `port` must be specified!'); } super(opts); const parsedProxy = parseSocksProxy(opts); this.lookup = parsedProxy.lookup; this.proxy = parsedProxy.proxy; } /** * Initiates a SOCKS connection to the specified SOCKS proxy server, * which in turn connects to the specified remote host and port. * * @api protected */ callback(req, opts) { return __awaiter(this, void 0, void 0, function* () { const { lookup, proxy } = this; let { host, port } = opts; if (!host) { throw new Error('No `host` defined!'); } if (lookup) { // Client-side DNS resolution for "4" and "5" socks proxy versions. host = yield dnsLookup(host); } const socksOpts = { proxy, destination: { host, port }, command: 'connect' }; debug('Creating socks proxy connection: %o', socksOpts); const { socket } = yield socks_1.SocksClient.createConnection(socksOpts); debug('Successfully created socks proxy connection'); if (opts.secureEndpoint) { const servername = opts.servername || opts.host; if (!servername) { throw new Error('Could not determine "servername"'); } // The proxy is connecting to a TLS server, so upgrade // this socket connection to a TLS connection. debug('Upgrading socket connection to TLS'); return tls_1.default.connect(Object.assign(Object.assign({}, omit(opts, 'host', 'hostname', 'path', 'port')), { socket, servername })); } return socket; }); } } exports.default = SocksProxyAgent; function omit(obj, ...keys) { const ret = {}; let key; for (key in obj) { if (!keys.includes(key)) { ret[key] = obj[key]; } } return ret; }//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/socks-proxy-agent/dist/agent.js.map"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; const agent_1 = __importDefault(require("./agent")); function createSocksProxyAgent(opts) { return new agent_1.default(opts); } (function (createSocksProxyAgent) { createSocksProxyAgent.SocksProxyAgent = agent_1.default; createSocksProxyAgent.prototype = agent_1.default.prototype; })(createSocksProxyAgent || (createSocksProxyAgent = {})); module.exports = createSocksProxyAgent;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/socks-proxy-agent/dist/index.js.map(The MIT License) Copyright (c) 2014 TJ Holowaychuk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "debug", "version": "4.1.1", "repository": { "type": "git", "url": "git://github.com/visionmedia/debug.git" }, "description": "small debugging utility", "keywords": [ "debug", "log", "debugger" ], "files": [ "src", "dist/debug.js", "LICENSE", "README.md" ], "author": "TJ Holowaychuk ", "contributors": [ "Nathan Rajlich (http://n8.io)", "Andrew Rhyne " ], "license": "MIT", "scripts": { "lint": "xo", "test": "npm run test:node && npm run test:browser", "test:node": "istanbul cover _mocha -- test.js", "pretest:browser": "npm run build", "test:browser": "karma start --single-run", "prebuild:debug": "mkdir -p dist && browserify --standalone debug -o dist/debug.es6.js .", "build:debug": "babel -o dist/debug.js dist/debug.es6.js > dist/debug.js", "build:test": "babel -d dist test.js", "build": "npm run build:debug && npm run build:test", "clean": "rimraf dist coverage", "test:coverage": "cat ./coverage/lcov.info | coveralls" }, "dependencies": { "ms": "^2.1.1" }, "devDependencies": { "@babel/cli": "^7.0.0", "@babel/core": "^7.0.0", "@babel/preset-env": "^7.0.0", "browserify": "14.4.0", "chai": "^3.5.0", "concurrently": "^3.1.0", "coveralls": "^3.0.2", "istanbul": "^0.4.5", "karma": "^3.0.0", "karma-chai": "^0.1.0", "karma-mocha": "^1.3.0", "karma-phantomjs-launcher": "^1.0.2", "mocha": "^5.2.0", "mocha-lcov-reporter": "^1.2.0", "rimraf": "^2.5.4", "xo": "^0.23.0" }, "main": "./src/index.js", "browser": "./src/browser.js", "unpkg": "./dist/debug.js" } "use strict"; function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } (function (f) { if ((typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined") { module.exports = f(); } else if (typeof define === "function" && define.amd) { define([], f); } else { var g; if (typeof window !== "undefined") { g = window; } else if (typeof global !== "undefined") { g = global; } else if (typeof self !== "undefined") { g = self; } else { g = this; } g.debug = f(); } })(function () { var define, module, exports; return function () { function r(e, n, t) { function o(i, f) { if (!n[i]) { if (!e[i]) { var c = "function" == typeof require && require; if (!f && c) return c(i, !0); if (u) return u(i, !0); var a = new Error("Cannot find module '" + i + "'"); throw a.code = "MODULE_NOT_FOUND", a; } var p = n[i] = { exports: {} }; e[i][0].call(p.exports, function (r) { var n = e[i][1][r]; return o(n || r); }, p, p.exports, r, e, n, t); } return n[i].exports; } for (var u = "function" == typeof require && require, i = 0; i < t.length; i++) { o(t[i]); } return o; } return r; }()({ 1: [function (require, module, exports) { /** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; var w = d * 7; var y = d * 365.25; /** * Parse or format the given `val`. * * Options: * * - `long` verbose formatting [false] * * @param {String|Number} val * @param {Object} [options] * @throws {Error} throw an error if val is not a non-empty string or a number * @return {String|Number} * @api public */ module.exports = function (val, options) { options = options || {}; var type = _typeof(val); if (type === 'string' && val.length > 0) { return parse(val); } else if (type === 'number' && isNaN(val) === false) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val)); }; /** * Parse the given `str` and return milliseconds. * * @param {String} str * @return {Number} * @api private */ function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'yrs': case 'yr': case 'y': return n * y; case 'weeks': case 'week': case 'w': return n * w; case 'days': case 'day': case 'd': return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': return n * m; case 'seconds': case 'second': case 'secs': case 'sec': case 's': return n * s; case 'milliseconds': case 'millisecond': case 'msecs': case 'msec': case 'ms': return n; default: return undefined; } } /** * Short format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtShort(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return Math.round(ms / d) + 'd'; } if (msAbs >= h) { return Math.round(ms / h) + 'h'; } if (msAbs >= m) { return Math.round(ms / m) + 'm'; } if (msAbs >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtLong(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return plural(ms, msAbs, d, 'day'); } if (msAbs >= h) { return plural(ms, msAbs, h, 'hour'); } if (msAbs >= m) { return plural(ms, msAbs, m, 'minute'); } if (msAbs >= s) { return plural(ms, msAbs, s, 'second'); } return ms + ' ms'; } /** * Pluralization helper. */ function plural(ms, msAbs, n, name) { var isPlural = msAbs >= n * 1.5; return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); } }, {}], 2: [function (require, module, exports) { // shim for using process in browser var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it // don't break things. But we need to wrap it in a try catch in case it is // wrapped in strict mode code which doesn't define any globals. It's inside a // function because try/catches deoptimize in certain engines. var cachedSetTimeout; var cachedClearTimeout; function defaultSetTimout() { throw new Error('setTimeout has not been defined'); } function defaultClearTimeout() { throw new Error('clearTimeout has not been defined'); } (function () { try { if (typeof setTimeout === 'function') { cachedSetTimeout = setTimeout; } else { cachedSetTimeout = defaultSetTimout; } } catch (e) { cachedSetTimeout = defaultSetTimout; } try { if (typeof clearTimeout === 'function') { cachedClearTimeout = clearTimeout; } else { cachedClearTimeout = defaultClearTimeout; } } catch (e) { cachedClearTimeout = defaultClearTimeout; } })(); function runTimeout(fun) { if (cachedSetTimeout === setTimeout) { //normal enviroments in sane situations return setTimeout(fun, 0); } // if setTimeout wasn't available but was latter defined if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout; return setTimeout(fun, 0); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedSetTimeout(fun, 0); } catch (e) { try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedSetTimeout.call(null, fun, 0); } catch (e) { // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { //normal enviroments in sane situations return clearTimeout(marker); } // if clearTimeout wasn't available but was latter defined if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout; return clearTimeout(marker); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedClearTimeout(marker); } catch (e) { try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedClearTimeout.call(null, marker); } catch (e) { // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. // Some versions of I.E. have different rules for clearTimeout vs setTimeout return cachedClearTimeout.call(this, marker); } } } var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; while (len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; runClearTimeout(timeout); } process.nextTick = function (fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { runTimeout(drainQueue); } }; // v8 likes predictible objects function Item(fun, array) { this.fun = fun; this.array = array; } Item.prototype.run = function () { this.fun.apply(null, this.array); }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues process.versions = {}; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.prependListener = noop; process.prependOnceListener = noop; process.listeners = function (name) { return []; }; process.binding = function (name) { throw new Error('process.binding is not supported'); }; process.cwd = function () { return '/'; }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; process.umask = function () { return 0; }; }, {}], 3: [function (require, module, exports) { /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. */ function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = require('ms'); Object.keys(env).forEach(function (key) { createDebug[key] = env[key]; }); /** * Active `debug` instances. */ createDebug.instances = []; /** * The currently active debug mode names, and names to skip. */ createDebug.names = []; createDebug.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ createDebug.formatters = {}; /** * Selects a color for a debug namespace * @param {String} namespace The namespace string for the for the debug instance to be colored * @return {Number|String} An ANSI color code for the given namespace * @api private */ function selectColor(namespace) { var hash = 0; for (var i = 0; i < namespace.length; i++) { hash = (hash << 5) - hash + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { var prevTime; function debug() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } // Disabled? if (!debug.enabled) { return; } var self = debug; // Set `diff` timestamp var curr = Number(new Date()); var ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== 'string') { // Anything else let's inspect with %O args.unshift('%O'); } // Apply any `formatters` transformations var index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) { // If we encounter an escaped % then don't increase the array index if (match === '%%') { return match; } index++; var formatter = createDebug.formatters[format]; if (typeof formatter === 'function') { var val = args[index]; match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // Apply env-specific formatting (colors, etc.) createDebug.formatArgs.call(self, args); var logFn = self.log || createDebug.log; logFn.apply(self, args); } debug.namespace = namespace; debug.enabled = createDebug.enabled(namespace); debug.useColors = createDebug.useColors(); debug.color = selectColor(namespace); debug.destroy = destroy; debug.extend = extend; // Debug.formatArgs = formatArgs; // debug.rawLog = rawLog; // env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } createDebug.instances.push(debug); return debug; } function destroy() { var index = createDebug.instances.indexOf(this); if (index !== -1) { createDebug.instances.splice(index, 1); return true; } return false; } function extend(namespace, delimiter) { var newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); newDebug.log = this.log; return newDebug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { createDebug.save(namespaces); createDebug.names = []; createDebug.skips = []; var i; var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); var len = split.length; for (i = 0; i < len; i++) { if (!split[i]) { // ignore empty strings continue; } namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else { createDebug.names.push(new RegExp('^' + namespaces + '$')); } } for (i = 0; i < createDebug.instances.length; i++) { var instance = createDebug.instances[i]; instance.enabled = createDebug.enabled(instance.namespace); } } /** * Disable debug output. * * @return {String} namespaces * @api public */ function disable() { var namespaces = [].concat(_toConsumableArray(createDebug.names.map(toNamespace)), _toConsumableArray(createDebug.skips.map(toNamespace).map(function (namespace) { return '-' + namespace; }))).join(','); createDebug.enable(''); return namespaces; } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { if (name[name.length - 1] === '*') { return true; } var i; var len; for (i = 0, len = createDebug.skips.length; i < len; i++) { if (createDebug.skips[i].test(name)) { return false; } } for (i = 0, len = createDebug.names.length; i < len; i++) { if (createDebug.names[i].test(name)) { return true; } } return false; } /** * Convert regexp to namespace * * @param {RegExp} regxep * @return {String} namespace * @api private */ function toNamespace(regexp) { return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, '*'); } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } createDebug.enable(createDebug.load()); return createDebug; } module.exports = setup; }, { "ms": 1 }], 4: [function (require, module, exports) { (function (process) { /* eslint-env browser */ /** * This is the web browser implementation of `debug()`. */ exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); /** * Colors. */ exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33']; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ // eslint-disable-next-line complexity function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { return true; } // Internet Explorer and Edge do not support colors. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); } /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); if (!this.useColors) { return; } var c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into var index = 0; var lastC = 0; args[0].replace(/%[a-zA-Z%]/g, function (match) { if (match === '%%') { return; } index++; if (match === '%c') { // We only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.log()` when available. * No-op when `console.log` is not a "function". * * @api public */ function log() { var _console; // This hackery is required for IE8/9, where // the `console.log` function doesn't have 'apply' return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (namespaces) { exports.storage.setItem('debug', namespaces); } else { exports.storage.removeItem('debug'); } } catch (error) {// Swallow // XXX (@Qix-) should we be logging these? } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { var r; try { r = exports.storage.getItem('debug'); } catch (error) {} // Swallow // XXX (@Qix-) should we be logging these? // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context // The Browser also has localStorage in the global context. return localStorage; } catch (error) {// Swallow // XXX (@Qix-) should we be logging these? } } module.exports = require('./common')(exports); var formatters = module.exports.formatters; /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ formatters.j = function (v) { try { return JSON.stringify(v); } catch (error) { return '[UnexpectedJSONParseError]: ' + error.message; } }; }).call(this, require('_process')); }, { "./common": 3, "_process": 2 }] }, {}, [4])(4); }); /* eslint-env browser */ /** * This is the web browser implementation of `debug()`. */ exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); /** * Colors. */ exports.colors = [ '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33' ]; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ // eslint-disable-next-line complexity function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { return true; } // Internet Explorer and Edge do not support colors. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || // Is firebug? http://stackoverflow.com/a/398120/376773 (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || // Double check webkit in userAgent just in case we are in a worker (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); } /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); if (!this.useColors) { return; } const c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into let index = 0; let lastC = 0; args[0].replace(/%[a-zA-Z%]/g, match => { if (match === '%%') { return; } index++; if (match === '%c') { // We only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.log()` when available. * No-op when `console.log` is not a "function". * * @api public */ function log(...args) { // This hackery is required for IE8/9, where // the `console.log` function doesn't have 'apply' return typeof console === 'object' && console.log && console.log(...args); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (namespaces) { exports.storage.setItem('debug', namespaces); } else { exports.storage.removeItem('debug'); } } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { let r; try { r = exports.storage.getItem('debug'); } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context // The Browser also has localStorage in the global context. return localStorage; } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } module.exports = require('./common')(exports); const {formatters} = module.exports; /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ formatters.j = function (v) { try { return JSON.stringify(v); } catch (error) { return '[UnexpectedJSONParseError]: ' + error.message; } }; /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. */ function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = require('ms'); Object.keys(env).forEach(key => { createDebug[key] = env[key]; }); /** * Active `debug` instances. */ createDebug.instances = []; /** * The currently active debug mode names, and names to skip. */ createDebug.names = []; createDebug.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ createDebug.formatters = {}; /** * Selects a color for a debug namespace * @param {String} namespace The namespace string for the for the debug instance to be colored * @return {Number|String} An ANSI color code for the given namespace * @api private */ function selectColor(namespace) { let hash = 0; for (let i = 0; i < namespace.length; i++) { hash = ((hash << 5) - hash) + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { let prevTime; function debug(...args) { // Disabled? if (!debug.enabled) { return; } const self = debug; // Set `diff` timestamp const curr = Number(new Date()); const ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== 'string') { // Anything else let's inspect with %O args.unshift('%O'); } // Apply any `formatters` transformations let index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { // If we encounter an escaped % then don't increase the array index if (match === '%%') { return match; } index++; const formatter = createDebug.formatters[format]; if (typeof formatter === 'function') { const val = args[index]; match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // Apply env-specific formatting (colors, etc.) createDebug.formatArgs.call(self, args); const logFn = self.log || createDebug.log; logFn.apply(self, args); } debug.namespace = namespace; debug.enabled = createDebug.enabled(namespace); debug.useColors = createDebug.useColors(); debug.color = selectColor(namespace); debug.destroy = destroy; debug.extend = extend; // Debug.formatArgs = formatArgs; // debug.rawLog = rawLog; // env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } createDebug.instances.push(debug); return debug; } function destroy() { const index = createDebug.instances.indexOf(this); if (index !== -1) { createDebug.instances.splice(index, 1); return true; } return false; } function extend(namespace, delimiter) { const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); newDebug.log = this.log; return newDebug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { createDebug.save(namespaces); createDebug.names = []; createDebug.skips = []; let i; const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); const len = split.length; for (i = 0; i < len; i++) { if (!split[i]) { // ignore empty strings continue; } namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else { createDebug.names.push(new RegExp('^' + namespaces + '$')); } } for (i = 0; i < createDebug.instances.length; i++) { const instance = createDebug.instances[i]; instance.enabled = createDebug.enabled(instance.namespace); } } /** * Disable debug output. * * @return {String} namespaces * @api public */ function disable() { const namespaces = [ ...createDebug.names.map(toNamespace), ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) ].join(','); createDebug.enable(''); return namespaces; } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { if (name[name.length - 1] === '*') { return true; } let i; let len; for (i = 0, len = createDebug.skips.length; i < len; i++) { if (createDebug.skips[i].test(name)) { return false; } } for (i = 0, len = createDebug.names.length; i < len; i++) { if (createDebug.names[i].test(name)) { return true; } } return false; } /** * Convert regexp to namespace * * @param {RegExp} regxep * @return {String} namespace * @api private */ function toNamespace(regexp) { return regexp.toString() .substring(2, regexp.toString().length - 2) .replace(/\.\*\?$/, '*'); } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } createDebug.enable(createDebug.load()); return createDebug; } module.exports = setup; /** * Detect Electron renderer / nwjs process, which is node, but we should * treat as a browser. */ if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { module.exports = require('./browser.js'); } else { module.exports = require('./node.js'); } /** * Module dependencies. */ const tty = require('tty'); const util = require('util'); /** * This is the Node.js implementation of `debug()`. */ exports.init = init; exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; /** * Colors. */ exports.colors = [6, 2, 3, 4, 5, 1]; try { // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) // eslint-disable-next-line import/no-extraneous-dependencies const supportsColor = require('supports-color'); if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { exports.colors = [ 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221 ]; } } catch (error) { // Swallow - we only care if `supports-color` is available; it doesn't have to be. } /** * Build up the default `inspectOpts` object from the environment variables. * * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js */ exports.inspectOpts = Object.keys(process.env).filter(key => { return /^debug_/i.test(key); }).reduce((obj, key) => { // Camel-case const prop = key .substring(6) .toLowerCase() .replace(/_([a-z])/g, (_, k) => { return k.toUpperCase(); }); // Coerce string value into JS value let val = process.env[key]; if (/^(yes|on|true|enabled)$/i.test(val)) { val = true; } else if (/^(no|off|false|disabled)$/i.test(val)) { val = false; } else if (val === 'null') { val = null; } else { val = Number(val); } obj[prop] = val; return obj; }, {}); /** * Is stdout a TTY? Colored output is enabled when `true`. */ function useColors() { return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd); } /** * Adds ANSI color escape codes if enabled. * * @api public */ function formatArgs(args) { const {namespace: name, useColors} = this; if (useColors) { const c = this.color; const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); const prefix = ` ${colorCode};1m${name} \u001B[0m`; args[0] = prefix + args[0].split('\n').join('\n' + prefix); args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); } else { args[0] = getDate() + name + ' ' + args[0]; } } function getDate() { if (exports.inspectOpts.hideDate) { return ''; } return new Date().toISOString() + ' '; } /** * Invokes `util.format()` with the specified arguments and writes to stderr. */ function log(...args) { return process.stderr.write(util.format(...args) + '\n'); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { if (namespaces) { process.env.DEBUG = namespaces; } else { // If you set a process.env field to null or undefined, it gets cast to the // string 'null' or 'undefined'. Just delete instead. delete process.env.DEBUG; } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { return process.env.DEBUG; } /** * Init logic for `debug` instances. * * Create a new `inspectOpts` object in case `useColors` is set * differently for a particular `debug` instance. */ function init(debug) { debug.inspectOpts = {}; const keys = Object.keys(exports.inspectOpts); for (let i = 0; i < keys.length; i++) { debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; } } module.exports = require('./common')(exports); const {formatters} = module.exports; /** * Map %o to `util.inspect()`, all on a single line. */ formatters.o = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts) .replace(/\s*\n\s*/g, ' '); }; /** * Map %O to `util.inspect()`, allowing multiple lines if needed. */ formatters.O = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts); }; Node.js is licensed for use as follows: """ Copyright Node.js contributors. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ This license applies to parts of Node.js originating from the https://github.com/joyent/node repository: """ Copyright Joyent, Inc. and other Node contributors. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ { "name": "string_decoder", "version": "1.3.0", "description": "The string_decoder module from Node core", "main": "lib/string_decoder.js", "files": [ "lib" ], "dependencies": { "safe-buffer": "~5.2.0" }, "devDependencies": { "babel-polyfill": "^6.23.0", "core-util-is": "^1.0.2", "inherits": "^2.0.3", "tap": "~0.4.8" }, "scripts": { "test": "tap test/parallel/*.js && node test/verify-dependencies", "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js" }, "repository": { "type": "git", "url": "git://github.com/nodejs/string_decoder.git" }, "homepage": "https://github.com/nodejs/string_decoder", "keywords": [ "string", "decoder", "browser", "browserify" ], "license": "MIT" } // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; /**/ var Buffer = require('safe-buffer').Buffer; /**/ var isEncoding = Buffer.isEncoding || function (encoding) { encoding = '' + encoding; switch (encoding && encoding.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 true; default: return false; } }; function _normalizeEncoding(enc) { if (!enc) return 'utf8'; var retried; while (true) { switch (enc) { 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 enc; default: if (retried) return; // undefined enc = ('' + enc).toLowerCase(); retried = true; } } }; // Do not cache `Buffer.isEncoding` when checking encoding names as some // modules monkey-patch it to support additional encodings function normalizeEncoding(enc) { var nenc = _normalizeEncoding(enc); if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); return nenc || enc; } // StringDecoder provides an interface for efficiently splitting a series of // buffers into a series of JS strings without breaking apart multi-byte // characters. exports.StringDecoder = StringDecoder; function StringDecoder(encoding) { this.encoding = normalizeEncoding(encoding); var nb; switch (this.encoding) { case 'utf16le': this.text = utf16Text; this.end = utf16End; nb = 4; break; case 'utf8': this.fillLast = utf8FillLast; nb = 4; break; case 'base64': this.text = base64Text; this.end = base64End; nb = 3; break; default: this.write = simpleWrite; this.end = simpleEnd; return; } this.lastNeed = 0; this.lastTotal = 0; this.lastChar = Buffer.allocUnsafe(nb); } StringDecoder.prototype.write = function (buf) { if (buf.length === 0) return ''; var r; var i; if (this.lastNeed) { r = this.fillLast(buf); if (r === undefined) return ''; i = this.lastNeed; this.lastNeed = 0; } else { i = 0; } if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); return r || ''; }; StringDecoder.prototype.end = utf8End; // Returns only complete characters in a Buffer StringDecoder.prototype.text = utf8Text; // Attempts to complete a partial non-UTF-8 character using bytes from a Buffer StringDecoder.prototype.fillLast = function (buf) { if (this.lastNeed <= buf.length) { buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); return this.lastChar.toString(this.encoding, 0, this.lastTotal); } buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); this.lastNeed -= buf.length; }; // Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a // continuation byte. If an invalid byte is detected, -2 is returned. function utf8CheckByte(byte) { if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; return byte >> 6 === 0x02 ? -1 : -2; } // Checks at most 3 bytes at the end of a Buffer in order to detect an // incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) // needed to complete the UTF-8 character (if applicable) are returned. function utf8CheckIncomplete(self, buf, i) { var j = buf.length - 1; if (j < i) return 0; var nb = utf8CheckByte(buf[j]); if (nb >= 0) { if (nb > 0) self.lastNeed = nb - 1; return nb; } if (--j < i || nb === -2) return 0; nb = utf8CheckByte(buf[j]); if (nb >= 0) { if (nb > 0) self.lastNeed = nb - 2; return nb; } if (--j < i || nb === -2) return 0; nb = utf8CheckByte(buf[j]); if (nb >= 0) { if (nb > 0) { if (nb === 2) nb = 0;else self.lastNeed = nb - 3; } return nb; } return 0; } // Validates as many continuation bytes for a multi-byte UTF-8 character as // needed or are available. If we see a non-continuation byte where we expect // one, we "replace" the validated continuation bytes we've seen so far with // a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding // behavior. The continuation byte check is included three times in the case // where all of the continuation bytes for a character exist in the same buffer. // It is also done this way as a slight performance increase instead of using a // loop. function utf8CheckExtraBytes(self, buf, p) { if ((buf[0] & 0xC0) !== 0x80) { self.lastNeed = 0; return '\ufffd'; } if (self.lastNeed > 1 && buf.length > 1) { if ((buf[1] & 0xC0) !== 0x80) { self.lastNeed = 1; return '\ufffd'; } if (self.lastNeed > 2 && buf.length > 2) { if ((buf[2] & 0xC0) !== 0x80) { self.lastNeed = 2; return '\ufffd'; } } } } // Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. function utf8FillLast(buf) { var p = this.lastTotal - this.lastNeed; var r = utf8CheckExtraBytes(this, buf, p); if (r !== undefined) return r; if (this.lastNeed <= buf.length) { buf.copy(this.lastChar, p, 0, this.lastNeed); return this.lastChar.toString(this.encoding, 0, this.lastTotal); } buf.copy(this.lastChar, p, 0, buf.length); this.lastNeed -= buf.length; } // Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a // partial character, the character's bytes are buffered until the required // number of bytes are available. function utf8Text(buf, i) { var total = utf8CheckIncomplete(this, buf, i); if (!this.lastNeed) return buf.toString('utf8', i); this.lastTotal = total; var end = buf.length - (total - this.lastNeed); buf.copy(this.lastChar, 0, end); return buf.toString('utf8', i, end); } // For UTF-8, a replacement character is added when ending on a partial // character. function utf8End(buf) { var r = buf && buf.length ? this.write(buf) : ''; if (this.lastNeed) return r + '\ufffd'; return r; } // UTF-16LE typically needs two bytes per character, but even if we have an even // number of bytes available, we need to check if we end on a leading/high // surrogate. In that case, we need to wait for the next two bytes in order to // decode the last character properly. function utf16Text(buf, i) { if ((buf.length - i) % 2 === 0) { var r = buf.toString('utf16le', i); if (r) { var c = r.charCodeAt(r.length - 1); if (c >= 0xD800 && c <= 0xDBFF) { this.lastNeed = 2; this.lastTotal = 4; this.lastChar[0] = buf[buf.length - 2]; this.lastChar[1] = buf[buf.length - 1]; return r.slice(0, -1); } } return r; } this.lastNeed = 1; this.lastTotal = 2; this.lastChar[0] = buf[buf.length - 1]; return buf.toString('utf16le', i, buf.length - 1); } // For UTF-16LE we do not explicitly append special replacement characters if we // end on a partial character, we simply let v8 handle that. function utf16End(buf) { var r = buf && buf.length ? this.write(buf) : ''; if (this.lastNeed) { var end = this.lastTotal - this.lastNeed; return r + this.lastChar.toString('utf16le', 0, end); } return r; } function base64Text(buf, i) { var n = (buf.length - i) % 3; if (n === 0) return buf.toString('base64', i); this.lastNeed = 3 - n; this.lastTotal = 3; if (n === 1) { this.lastChar[0] = buf[buf.length - 1]; } else { this.lastChar[0] = buf[buf.length - 2]; this.lastChar[1] = buf[buf.length - 1]; } return buf.toString('base64', i, buf.length - n); } function base64End(buf) { var r = buf && buf.length ? this.write(buf) : ''; if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); return r; } // Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) function simpleWrite(buf) { return buf.toString(this.encoding); } function simpleEnd(buf) { return buf && buf.length ? this.write(buf) : ''; } /** * Module exports. */ module.exports = deprecate; /** * Mark that a method should not be used. * Returns a modified function which warns once by default. * * If `localStorage.noDeprecation = true` is set, then it is a no-op. * * If `localStorage.throwDeprecation = true` is set, then deprecated functions * will throw an Error when invoked. * * If `localStorage.traceDeprecation = true` is set, then deprecated functions * will invoke `console.trace()` instead of `console.error()`. * * @param {Function} fn - the function to deprecate * @param {String} msg - the string to print to the console when `fn` is invoked * @returns {Function} a new "deprecated" version of `fn` * @api public */ function deprecate (fn, msg) { if (config('noDeprecation')) { return fn; } var warned = false; function deprecated() { if (!warned) { if (config('throwDeprecation')) { throw new Error(msg); } else if (config('traceDeprecation')) { console.trace(msg); } else { console.warn(msg); } warned = true; } return fn.apply(this, arguments); } return deprecated; } /** * Checks `localStorage` for boolean values for the given `name`. * * @param {String} name * @returns {Boolean} * @api private */ function config (name) { // accessing global.localStorage can trigger a DOMException in sandboxed iframes try { if (!global.localStorage) return false; } catch (_) { return false; } var val = global.localStorage[name]; if (null == val) return false; return String(val).toLowerCase() === 'true'; } (The MIT License) Copyright (c) 2014 Nathan Rajlich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. /** * For Node.js, simply re-export the core `util.deprecate` function. */ module.exports = require('util').deprecate; { "name": "util-deprecate", "version": "1.0.2", "description": "The Node.js `util.deprecate()` function with browser support", "main": "node.js", "browser": "browser.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { "type": "git", "url": "git://github.com/TooTallNate/util-deprecate.git" }, "keywords": [ "util", "deprecate", "browserify", "browser", "node" ], "author": "Nathan Rajlich (http://n8.io/)", "license": "MIT", "bugs": { "url": "https://github.com/TooTallNate/util-deprecate/issues" }, "homepage": "https://github.com/TooTallNate/util-deprecate" } { "name": "vscode-windows-ca-certs", "version": "0.3.0", "description": "Get Windows System Root certificates", "os": [ "win32" ], "gypfile": true, "main": "build/Release/crypt32", "files": [ "binding.gyp", "crypt32.cc" ], "scripts": { "test": "node test" }, "repository": { "type": "git", "url": "git+https://github.com/Microsoft/vscode-windows-ca-certs.git" }, "keywords": [ "ssl", "tls", "ca", "root", "windows" ], "contributors": [ { "name": "Stas Ukolov", "email": "ukoloff@gmail.com" }, { "name": "Microsoft Corporation" } ], "license": "ISC", "bugs": { "url": "https://github.com/Microsoft/vscode-windows-ca-certs/issues" }, "homepage": "https://github.com/Microsoft/vscode-windows-ca-certs", "dependencies": { "node-addon-api": "^3.0.2" }, "devDependencies": { "bindings": "1.5.0", "node-forge": "0.8.2" } } 'use strict' module.exports = function (Yallist) { Yallist.prototype[Symbol.iterator] = function* () { for (let walker = this.head; walker; walker = walker.next) { yield walker.value } } } The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "yallist", "version": "4.0.0", "description": "Yet Another Linked List", "main": "yallist.js", "directories": { "test": "test" }, "files": [ "yallist.js", "iterator.js" ], "dependencies": {}, "devDependencies": { "tap": "^12.1.0" }, "scripts": { "test": "tap test/*.js --100", "preversion": "npm test", "postversion": "npm publish", "postpublish": "git push origin --all; git push origin --tags" }, "repository": { "type": "git", "url": "git+https://github.com/isaacs/yallist.git" }, "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "license": "ISC" } 'use strict' module.exports = Yallist Yallist.Node = Node Yallist.create = Yallist function Yallist (list) { var self = this if (!(self instanceof Yallist)) { self = new Yallist() } self.tail = null self.head = null self.length = 0 if (list && typeof list.forEach === 'function') { list.forEach(function (item) { self.push(item) }) } else if (arguments.length > 0) { for (var i = 0, l = arguments.length; i < l; i++) { self.push(arguments[i]) } } return self } Yallist.prototype.removeNode = function (node) { if (node.list !== this) { throw new Error('removing node which does not belong to this list') } var next = node.next var prev = node.prev if (next) { next.prev = prev } if (prev) { prev.next = next } if (node === this.head) { this.head = next } if (node === this.tail) { this.tail = prev } node.list.length-- node.next = null node.prev = null node.list = null return next } Yallist.prototype.unshiftNode = function (node) { if (node === this.head) { return } if (node.list) { node.list.removeNode(node) } var head = this.head node.list = this node.next = head if (head) { head.prev = node } this.head = node if (!this.tail) { this.tail = node } this.length++ } Yallist.prototype.pushNode = function (node) { if (node === this.tail) { return } if (node.list) { node.list.removeNode(node) } var tail = this.tail node.list = this node.prev = tail if (tail) { tail.next = node } this.tail = node if (!this.head) { this.head = node } this.length++ } Yallist.prototype.push = function () { for (var i = 0, l = arguments.length; i < l; i++) { push(this, arguments[i]) } return this.length } Yallist.prototype.unshift = function () { for (var i = 0, l = arguments.length; i < l; i++) { unshift(this, arguments[i]) } return this.length } Yallist.prototype.pop = function () { if (!this.tail) { return undefined } var res = this.tail.value this.tail = this.tail.prev if (this.tail) { this.tail.next = null } else { this.head = null } this.length-- return res } Yallist.prototype.shift = function () { if (!this.head) { return undefined } var res = this.head.value this.head = this.head.next if (this.head) { this.head.prev = null } else { this.tail = null } this.length-- return res } Yallist.prototype.forEach = function (fn, thisp) { thisp = thisp || this for (var walker = this.head, i = 0; walker !== null; i++) { fn.call(thisp, walker.value, i, this) walker = walker.next } } Yallist.prototype.forEachReverse = function (fn, thisp) { thisp = thisp || this for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { fn.call(thisp, walker.value, i, this) walker = walker.prev } } Yallist.prototype.get = function (n) { for (var i = 0, walker = this.head; walker !== null && i < n; i++) { // abort out of the list early if we hit a cycle walker = walker.next } if (i === n && walker !== null) { return walker.value } } Yallist.prototype.getReverse = function (n) { for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { // abort out of the list early if we hit a cycle walker = walker.prev } if (i === n && walker !== null) { return walker.value } } Yallist.prototype.map = function (fn, thisp) { thisp = thisp || this var res = new Yallist() for (var walker = this.head; walker !== null;) { res.push(fn.call(thisp, walker.value, this)) walker = walker.next } return res } Yallist.prototype.mapReverse = function (fn, thisp) { thisp = thisp || this var res = new Yallist() for (var walker = this.tail; walker !== null;) { res.push(fn.call(thisp, walker.value, this)) walker = walker.prev } return res } Yallist.prototype.reduce = function (fn, initial) { var acc var walker = this.head if (arguments.length > 1) { acc = initial } else if (this.head) { walker = this.head.next acc = this.head.value } else { throw new TypeError('Reduce of empty list with no initial value') } for (var i = 0; walker !== null; i++) { acc = fn(acc, walker.value, i) walker = walker.next } return acc } Yallist.prototype.reduceReverse = function (fn, initial) { var acc var walker = this.tail if (arguments.length > 1) { acc = initial } else if (this.tail) { walker = this.tail.prev acc = this.tail.value } else { throw new TypeError('Reduce of empty list with no initial value') } for (var i = this.length - 1; walker !== null; i--) { acc = fn(acc, walker.value, i) walker = walker.prev } return acc } Yallist.prototype.toArray = function () { var arr = new Array(this.length) for (var i = 0, walker = this.head; walker !== null; i++) { arr[i] = walker.value walker = walker.next } return arr } Yallist.prototype.toArrayReverse = function () { var arr = new Array(this.length) for (var i = 0, walker = this.tail; walker !== null; i++) { arr[i] = walker.value walker = walker.prev } return arr } Yallist.prototype.slice = function (from, to) { to = to || this.length if (to < 0) { to += this.length } from = from || 0 if (from < 0) { from += this.length } var ret = new Yallist() if (to < from || to < 0) { return ret } if (from < 0) { from = 0 } if (to > this.length) { to = this.length } for (var i = 0, walker = this.head; walker !== null && i < from; i++) { walker = walker.next } for (; walker !== null && i < to; i++, walker = walker.next) { ret.push(walker.value) } return ret } Yallist.prototype.sliceReverse = function (from, to) { to = to || this.length if (to < 0) { to += this.length } from = from || 0 if (from < 0) { from += this.length } var ret = new Yallist() if (to < from || to < 0) { return ret } if (from < 0) { from = 0 } if (to > this.length) { to = this.length } for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { walker = walker.prev } for (; walker !== null && i > from; i--, walker = walker.prev) { ret.push(walker.value) } return ret } Yallist.prototype.splice = function (start, deleteCount, ...nodes) { if (start > this.length) { start = this.length - 1 } if (start < 0) { start = this.length + start; } for (var i = 0, walker = this.head; walker !== null && i < start; i++) { walker = walker.next } var ret = [] for (var i = 0; walker && i < deleteCount; i++) { ret.push(walker.value) walker = this.removeNode(walker) } if (walker === null) { walker = this.tail } if (walker !== this.head && walker !== this.tail) { walker = walker.prev } for (var i = 0; i < nodes.length; i++) { walker = insert(this, walker, nodes[i]) } return ret; } Yallist.prototype.reverse = function () { var head = this.head var tail = this.tail for (var walker = head; walker !== null; walker = walker.prev) { var p = walker.prev walker.prev = walker.next walker.next = p } this.head = tail this.tail = head return this } function insert (self, node, value) { var inserted = node === self.head ? new Node(value, null, node, self) : new Node(value, node, node.next, self) if (inserted.next === null) { self.tail = inserted } if (inserted.prev === null) { self.head = inserted } self.length++ return inserted } function push (self, item) { self.tail = new Node(item, self.tail, null, self) if (!self.head) { self.head = self.tail } self.length++ } function unshift (self, item) { self.head = new Node(item, null, self.head, self) if (!self.tail) { self.tail = self.head } self.length++ } function Node (value, prev, next, list) { if (!(this instanceof Node)) { return new Node(value, prev, next, list) } this.list = list this.value = value if (prev) { prev.next = this this.prev = prev } else { this.prev = null } if (next) { next.prev = this this.next = next } else { this.next = null } } try { // add if support for Symbol.iterator is present require('./iterator.js')(Yallist) } catch (er) {} /** * Module dependencies. */ var EventEmitter = require('events').EventEmitter; var spawn = require('child_process').spawn; var path = require('path'); var dirname = path.dirname; var basename = path.basename; var fs = require('fs'); /** * Inherit `Command` from `EventEmitter.prototype`. */ require('util').inherits(Command, EventEmitter); /** * Expose the root command. */ exports = module.exports = new Command(); /** * Expose `Command`. */ exports.Command = Command; /** * Expose `Option`. */ exports.Option = Option; /** * Initialize a new `Option` with the given `flags` and `description`. * * @param {String} flags * @param {String} description * @api public */ function Option(flags, description) { this.flags = flags; this.required = flags.indexOf('<') >= 0; this.optional = flags.indexOf('[') >= 0; this.bool = flags.indexOf('-no-') === -1; flags = flags.split(/[ ,|]+/); if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift(); this.long = flags.shift(); this.description = description || ''; } /** * Return option name. * * @return {String} * @api private */ Option.prototype.name = function() { return this.long .replace('--', '') .replace('no-', ''); }; /** * Return option name, in a camelcase format that can be used * as a object attribute key. * * @return {String} * @api private */ Option.prototype.attributeName = function() { return camelcase(this.name()); }; /** * Check if `arg` matches the short or long flag. * * @param {String} arg * @return {Boolean} * @api private */ Option.prototype.is = function(arg) { return this.short === arg || this.long === arg; }; /** * Initialize a new `Command`. * * @param {String} name * @api public */ function Command(name) { this.commands = []; this.options = []; this._execs = {}; this._allowUnknownOption = false; this._args = []; this._name = name || ''; } /** * Add command `name`. * * The `.action()` callback is invoked when the * command `name` is specified via __ARGV__, * and the remaining arguments are applied to the * function for access. * * When the `name` is "*" an un-matched command * will be passed as the first arg, followed by * the rest of __ARGV__ remaining. * * Examples: * * program * .version('0.0.1') * .option('-C, --chdir ', 'change the working directory') * .option('-c, --config ', 'set config path. defaults to ./deploy.conf') * .option('-T, --no-tests', 'ignore test hook') * * program * .command('setup') * .description('run remote setup commands') * .action(function() { * console.log('setup'); * }); * * program * .command('exec ') * .description('run the given remote command') * .action(function(cmd) { * console.log('exec "%s"', cmd); * }); * * program * .command('teardown
[otherDirs...]') * .description('run teardown commands') * .action(function(dir, otherDirs) { * console.log('dir "%s"', dir); * if (otherDirs) { * otherDirs.forEach(function (oDir) { * console.log('dir "%s"', oDir); * }); * } * }); * * program * .command('*') * .description('deploy the given env') * .action(function(env) { * console.log('deploying "%s"', env); * }); * * program.parse(process.argv); * * @param {String} name * @param {String} [desc] for git-style sub-commands * @return {Command} the new command * @api public */ Command.prototype.command = function(name, desc, opts) { if (typeof desc === 'object' && desc !== null) { opts = desc; desc = null; } opts = opts || {}; var args = name.split(/ +/); var cmd = new Command(args.shift()); if (desc) { cmd.description(desc); this.executables = true; this._execs[cmd._name] = true; if (opts.isDefault) this.defaultExecutable = cmd._name; } cmd._noHelp = !!opts.noHelp; this.commands.push(cmd); cmd.parseExpectedArgs(args); cmd.parent = this; if (desc) return this; return cmd; }; /** * Define argument syntax for the top-level command. * * @api public */ Command.prototype.arguments = function(desc) { return this.parseExpectedArgs(desc.split(/ +/)); }; /** * Add an implicit `help [cmd]` subcommand * which invokes `--help` for the given command. * * @api private */ Command.prototype.addImplicitHelpCommand = function() { this.command('help [cmd]', 'display help for [cmd]'); }; /** * Parse expected `args`. * * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`. * * @param {Array} args * @return {Command} for chaining * @api public */ Command.prototype.parseExpectedArgs = function(args) { if (!args.length) return; var self = this; args.forEach(function(arg) { var argDetails = { required: false, name: '', variadic: false }; switch (arg[0]) { case '<': argDetails.required = true; argDetails.name = arg.slice(1, -1); break; case '[': argDetails.name = arg.slice(1, -1); break; } if (argDetails.name.length > 3 && argDetails.name.slice(-3) === '...') { argDetails.variadic = true; argDetails.name = argDetails.name.slice(0, -3); } if (argDetails.name) { self._args.push(argDetails); } }); return this; }; /** * Register callback `fn` for the command. * * Examples: * * program * .command('help') * .description('display verbose help') * .action(function() { * // output help here * }); * * @param {Function} fn * @return {Command} for chaining * @api public */ Command.prototype.action = function(fn) { var self = this; var listener = function(args, unknown) { // Parse any so-far unknown options args = args || []; unknown = unknown || []; var parsed = self.parseOptions(unknown); // Output help if necessary outputHelpIfNecessary(self, parsed.unknown); // If there are still any unknown options, then we simply // die, unless someone asked for help, in which case we give it // to them, and then we die. if (parsed.unknown.length > 0) { self.unknownOption(parsed.unknown[0]); } // Leftover arguments need to be pushed back. Fixes issue #56 if (parsed.args.length) args = parsed.args.concat(args); self._args.forEach(function(arg, i) { if (arg.required && args[i] == null) { self.missingArgument(arg.name); } else if (arg.variadic) { if (i !== self._args.length - 1) { self.variadicArgNotLast(arg.name); } args[i] = args.splice(i); } }); // Always append ourselves to the end of the arguments, // to make sure we match the number of arguments the user // expects if (self._args.length) { args[self._args.length] = self; } else { args.push(self); } fn.apply(self, args); }; var parent = this.parent || this; var name = parent === this ? '*' : this._name; parent.on('command:' + name, listener); if (this._alias) parent.on('command:' + this._alias, listener); return this; }; /** * Define option with `flags`, `description` and optional * coercion `fn`. * * The `flags` string should contain both the short and long flags, * separated by comma, a pipe or space. The following are all valid * all will output this way when `--help` is used. * * "-p, --pepper" * "-p|--pepper" * "-p --pepper" * * Examples: * * // simple boolean defaulting to false * program.option('-p, --pepper', 'add pepper'); * * --pepper * program.pepper * // => Boolean * * // simple boolean defaulting to true * program.option('-C, --no-cheese', 'remove cheese'); * * program.cheese * // => true * * --no-cheese * program.cheese * // => false * * // required argument * program.option('-C, --chdir ', 'change the working directory'); * * --chdir /tmp * program.chdir * // => "/tmp" * * // optional argument * program.option('-c, --cheese [type]', 'add cheese [marble]'); * * @param {String} flags * @param {String} description * @param {Function|*} [fn] or default * @param {*} [defaultValue] * @return {Command} for chaining * @api public */ Command.prototype.option = function(flags, description, fn, defaultValue) { var self = this, option = new Option(flags, description), oname = option.name(), name = option.attributeName(); // default as 3rd arg if (typeof fn !== 'function') { if (fn instanceof RegExp) { var regex = fn; fn = function(val, def) { var m = regex.exec(val); return m ? m[0] : def; }; } else { defaultValue = fn; fn = null; } } // preassign default value only for --no-*, [optional], or if (!option.bool || option.optional || option.required) { // when --no-* we make sure default is true if (!option.bool) defaultValue = true; // preassign only if we have a default if (defaultValue !== undefined) { self[name] = defaultValue; option.defaultValue = defaultValue; } } // register the option this.options.push(option); // when it's passed assign the value // and conditionally invoke the callback this.on('option:' + oname, function(val) { // coercion if (val !== null && fn) { val = fn(val, self[name] === undefined ? defaultValue : self[name]); } // unassigned or bool if (typeof self[name] === 'boolean' || typeof self[name] === 'undefined') { // if no value, bool true, and we have a default, then use it! if (val == null) { self[name] = option.bool ? defaultValue || true : false; } else { self[name] = val; } } else if (val !== null) { // reassign self[name] = val; } }); return this; }; /** * Allow unknown options on the command line. * * @param {Boolean} arg if `true` or omitted, no error will be thrown * for unknown options. * @api public */ Command.prototype.allowUnknownOption = function(arg) { this._allowUnknownOption = arguments.length === 0 || arg; return this; }; /** * Parse `argv`, settings options and invoking commands when defined. * * @param {Array} argv * @return {Command} for chaining * @api public */ Command.prototype.parse = function(argv) { // implicit help if (this.executables) this.addImplicitHelpCommand(); // store raw args this.rawArgs = argv; // guess name this._name = this._name || basename(argv[1], '.js'); // github-style sub-commands with no sub-command if (this.executables && argv.length < 3 && !this.defaultExecutable) { // this user needs help argv.push('--help'); } // process argv var parsed = this.parseOptions(this.normalize(argv.slice(2))); var args = this.args = parsed.args; var result = this.parseArgs(this.args, parsed.unknown); // executable sub-commands var name = result.args[0]; var aliasCommand = null; // check alias of sub commands if (name) { aliasCommand = this.commands.filter(function(command) { return command.alias() === name; })[0]; } if (this._execs[name] === true) { return this.executeSubCommand(argv, args, parsed.unknown); } else if (aliasCommand) { // is alias of a subCommand args[0] = aliasCommand._name; return this.executeSubCommand(argv, args, parsed.unknown); } else if (this.defaultExecutable) { // use the default subcommand args.unshift(this.defaultExecutable); return this.executeSubCommand(argv, args, parsed.unknown); } return result; }; /** * Execute a sub-command executable. * * @param {Array} argv * @param {Array} args * @param {Array} unknown * @api private */ Command.prototype.executeSubCommand = function(argv, args, unknown) { args = args.concat(unknown); if (!args.length) this.help(); if (args[0] === 'help' && args.length === 1) this.help(); // --help if (args[0] === 'help') { args[0] = args[1]; args[1] = '--help'; } // executable var f = argv[1]; // name of the subcommand, link `pm-install` var bin = basename(f, path.extname(f)) + '-' + args[0]; // In case of globally installed, get the base dir where executable // subcommand file should be located at var baseDir; var resolvedLink = fs.realpathSync(f); baseDir = dirname(resolvedLink); // prefer local `./` to bin in the $PATH var localBin = path.join(baseDir, bin); // whether bin file is a js script with explicit `.js` or `.ts` extension var isExplicitJS = false; if (exists(localBin + '.js')) { bin = localBin + '.js'; isExplicitJS = true; } else if (exists(localBin + '.ts')) { bin = localBin + '.ts'; isExplicitJS = true; } else if (exists(localBin)) { bin = localBin; } args = args.slice(1); var proc; if (process.platform !== 'win32') { if (isExplicitJS) { args.unshift(bin); // add executable arguments to spawn args = (process.execArgv || []).concat(args); proc = spawn(process.argv[0], args, { stdio: 'inherit', customFds: [0, 1, 2] }); } else { proc = spawn(bin, args, { stdio: 'inherit', customFds: [0, 1, 2] }); } } else { args.unshift(bin); proc = spawn(process.execPath, args, { stdio: 'inherit' }); } var signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP']; signals.forEach(function(signal) { process.on(signal, function() { if (proc.killed === false && proc.exitCode === null) { proc.kill(signal); } }); }); proc.on('close', process.exit.bind(process)); proc.on('error', function(err) { if (err.code === 'ENOENT') { console.error('error: %s(1) does not exist, try --help', bin); } else if (err.code === 'EACCES') { console.error('error: %s(1) not executable. try chmod or run with root', bin); } process.exit(1); }); // Store the reference to the child process this.runningCommand = proc; }; /** * Normalize `args`, splitting joined short flags. For example * the arg "-abc" is equivalent to "-a -b -c". * This also normalizes equal sign and splits "--abc=def" into "--abc def". * * @param {Array} args * @return {Array} * @api private */ Command.prototype.normalize = function(args) { var ret = [], arg, lastOpt, index; for (var i = 0, len = args.length; i < len; ++i) { arg = args[i]; if (i > 0) { lastOpt = this.optionFor(args[i - 1]); } if (arg === '--') { // Honor option terminator ret = ret.concat(args.slice(i)); break; } else if (lastOpt && lastOpt.required) { ret.push(arg); } else if (arg.length > 1 && arg[0] === '-' && arg[1] !== '-') { arg.slice(1).split('').forEach(function(c) { ret.push('-' + c); }); } else if (/^--/.test(arg) && ~(index = arg.indexOf('='))) { ret.push(arg.slice(0, index), arg.slice(index + 1)); } else { ret.push(arg); } } return ret; }; /** * Parse command `args`. * * When listener(s) are available those * callbacks are invoked, otherwise the "*" * event is emitted and those actions are invoked. * * @param {Array} args * @return {Command} for chaining * @api private */ Command.prototype.parseArgs = function(args, unknown) { var name; if (args.length) { name = args[0]; if (this.listeners('command:' + name).length) { this.emit('command:' + args.shift(), args, unknown); } else { this.emit('command:*', args); } } else { outputHelpIfNecessary(this, unknown); // If there were no args and we have unknown options, // then they are extraneous and we need to error. if (unknown.length > 0) { this.unknownOption(unknown[0]); } if (this.commands.length === 0 && this._args.filter(function(a) { return a.required; }).length === 0) { this.emit('command:*'); } } return this; }; /** * Return an option matching `arg` if any. * * @param {String} arg * @return {Option} * @api private */ Command.prototype.optionFor = function(arg) { for (var i = 0, len = this.options.length; i < len; ++i) { if (this.options[i].is(arg)) { return this.options[i]; } } }; /** * Parse options from `argv` returning `argv` * void of these options. * * @param {Array} argv * @return {Array} * @api public */ Command.prototype.parseOptions = function(argv) { var args = [], len = argv.length, literal, option, arg; var unknownOptions = []; // parse options for (var i = 0; i < len; ++i) { arg = argv[i]; // literal args after -- if (literal) { args.push(arg); continue; } if (arg === '--') { literal = true; continue; } // find matching Option option = this.optionFor(arg); // option is defined if (option) { // requires arg if (option.required) { arg = argv[++i]; if (arg == null) return this.optionMissingArgument(option); this.emit('option:' + option.name(), arg); // optional arg } else if (option.optional) { arg = argv[i + 1]; if (arg == null || (arg[0] === '-' && arg !== '-')) { arg = null; } else { ++i; } this.emit('option:' + option.name(), arg); // bool } else { this.emit('option:' + option.name()); } continue; } // looks like an option if (arg.length > 1 && arg[0] === '-') { unknownOptions.push(arg); // If the next argument looks like it might be // an argument for this option, we pass it on. // If it isn't, then it'll simply be ignored if ((i + 1) < argv.length && argv[i + 1][0] !== '-') { unknownOptions.push(argv[++i]); } continue; } // arg args.push(arg); } return { args: args, unknown: unknownOptions }; }; /** * Return an object containing options as key-value pairs * * @return {Object} * @api public */ Command.prototype.opts = function() { var result = {}, len = this.options.length; for (var i = 0; i < len; i++) { var key = this.options[i].attributeName(); result[key] = key === this._versionOptionName ? this._version : this[key]; } return result; }; /** * Argument `name` is missing. * * @param {String} name * @api private */ Command.prototype.missingArgument = function(name) { console.error("error: missing required argument `%s'", name); process.exit(1); }; /** * `Option` is missing an argument, but received `flag` or nothing. * * @param {String} option * @param {String} flag * @api private */ Command.prototype.optionMissingArgument = function(option, flag) { if (flag) { console.error("error: option `%s' argument missing, got `%s'", option.flags, flag); } else { console.error("error: option `%s' argument missing", option.flags); } process.exit(1); }; /** * Unknown option `flag`. * * @param {String} flag * @api private */ Command.prototype.unknownOption = function(flag) { if (this._allowUnknownOption) return; console.error("error: unknown option `%s'", flag); process.exit(1); }; /** * Variadic argument with `name` is not the last argument as required. * * @param {String} name * @api private */ Command.prototype.variadicArgNotLast = function(name) { console.error("error: variadic arguments must be last `%s'", name); process.exit(1); }; /** * Set the program version to `str`. * * This method auto-registers the "-V, --version" flag * which will print the version number when passed. * * @param {String} str * @param {String} [flags] * @return {Command} for chaining * @api public */ Command.prototype.version = function(str, flags) { if (arguments.length === 0) return this._version; this._version = str; flags = flags || '-V, --version'; var versionOption = new Option(flags, 'output the version number'); this._versionOptionName = versionOption.long.substr(2) || 'version'; this.options.push(versionOption); this.on('option:' + this._versionOptionName, function() { process.stdout.write(str + '\n'); process.exit(0); }); return this; }; /** * Set the description to `str`. * * @param {String} str * @param {Object} argsDescription * @return {String|Command} * @api public */ Command.prototype.description = function(str, argsDescription) { if (arguments.length === 0) return this._description; this._description = str; this._argsDescription = argsDescription; return this; }; /** * Set an alias for the command * * @param {String} alias * @return {String|Command} * @api public */ Command.prototype.alias = function(alias) { var command = this; if (this.commands.length !== 0) { command = this.commands[this.commands.length - 1]; } if (arguments.length === 0) return command._alias; if (alias === command._name) throw new Error('Command alias can\'t be the same as its name'); command._alias = alias; return this; }; /** * Set / get the command usage `str`. * * @param {String} str * @return {String|Command} * @api public */ Command.prototype.usage = function(str) { var args = this._args.map(function(arg) { return humanReadableArgName(arg); }); var usage = '[options]' + (this.commands.length ? ' [command]' : '') + (this._args.length ? ' ' + args.join(' ') : ''); if (arguments.length === 0) return this._usage || usage; this._usage = str; return this; }; /** * Get or set the name of the command * * @param {String} str * @return {String|Command} * @api public */ Command.prototype.name = function(str) { if (arguments.length === 0) return this._name; this._name = str; return this; }; /** * Return prepared commands. * * @return {Array} * @api private */ Command.prototype.prepareCommands = function() { return this.commands.filter(function(cmd) { return !cmd._noHelp; }).map(function(cmd) { var args = cmd._args.map(function(arg) { return humanReadableArgName(arg); }).join(' '); return [ cmd._name + (cmd._alias ? '|' + cmd._alias : '') + (cmd.options.length ? ' [options]' : '') + (args ? ' ' + args : ''), cmd._description ]; }); }; /** * Return the largest command length. * * @return {Number} * @api private */ Command.prototype.largestCommandLength = function() { var commands = this.prepareCommands(); return commands.reduce(function(max, command) { return Math.max(max, command[0].length); }, 0); }; /** * Return the largest option length. * * @return {Number} * @api private */ Command.prototype.largestOptionLength = function() { var options = [].slice.call(this.options); options.push({ flags: '-h, --help' }); return options.reduce(function(max, option) { return Math.max(max, option.flags.length); }, 0); }; /** * Return the largest arg length. * * @return {Number} * @api private */ Command.prototype.largestArgLength = function() { return this._args.reduce(function(max, arg) { return Math.max(max, arg.name.length); }, 0); }; /** * Return the pad width. * * @return {Number} * @api private */ Command.prototype.padWidth = function() { var width = this.largestOptionLength(); if (this._argsDescription && this._args.length) { if (this.largestArgLength() > width) { width = this.largestArgLength(); } } if (this.commands && this.commands.length) { if (this.largestCommandLength() > width) { width = this.largestCommandLength(); } } return width; }; /** * Return help for options. * * @return {String} * @api private */ Command.prototype.optionHelp = function() { var width = this.padWidth(); // Append the help information return this.options.map(function(option) { return pad(option.flags, width) + ' ' + option.description + ((option.bool && option.defaultValue !== undefined) ? ' (default: ' + JSON.stringify(option.defaultValue) + ')' : ''); }).concat([pad('-h, --help', width) + ' ' + 'output usage information']) .join('\n'); }; /** * Return command help documentation. * * @return {String} * @api private */ Command.prototype.commandHelp = function() { if (!this.commands.length) return ''; var commands = this.prepareCommands(); var width = this.padWidth(); return [ 'Commands:', commands.map(function(cmd) { var desc = cmd[1] ? ' ' + cmd[1] : ''; return (desc ? pad(cmd[0], width) : cmd[0]) + desc; }).join('\n').replace(/^/gm, ' '), '' ].join('\n'); }; /** * Return program help documentation. * * @return {String} * @api private */ Command.prototype.helpInformation = function() { var desc = []; if (this._description) { desc = [ this._description, '' ]; var argsDescription = this._argsDescription; if (argsDescription && this._args.length) { var width = this.padWidth(); desc.push('Arguments:'); desc.push(''); this._args.forEach(function(arg) { desc.push(' ' + pad(arg.name, width) + ' ' + argsDescription[arg.name]); }); desc.push(''); } } var cmdName = this._name; if (this._alias) { cmdName = cmdName + '|' + this._alias; } var usage = [ 'Usage: ' + cmdName + ' ' + this.usage(), '' ]; var cmds = []; var commandHelp = this.commandHelp(); if (commandHelp) cmds = [commandHelp]; var options = [ 'Options:', '' + this.optionHelp().replace(/^/gm, ' '), '' ]; return usage .concat(desc) .concat(options) .concat(cmds) .join('\n'); }; /** * Output help information for this command * * @api public */ Command.prototype.outputHelp = function(cb) { if (!cb) { cb = function(passthru) { return passthru; }; } process.stdout.write(cb(this.helpInformation())); this.emit('--help'); }; /** * Output help information and exit. * * @api public */ Command.prototype.help = function(cb) { this.outputHelp(cb); process.exit(); }; /** * Camel-case the given `flag` * * @param {String} flag * @return {String} * @api private */ function camelcase(flag) { return flag.split('-').reduce(function(str, word) { return str + word[0].toUpperCase() + word.slice(1); }); } /** * Pad `str` to `width`. * * @param {String} str * @param {Number} width * @return {String} * @api private */ function pad(str, width) { var len = Math.max(0, width - str.length); return str + Array(len + 1).join(' '); } /** * Output help information if necessary * * @param {Command} command to output help for * @param {Array} array of options to search for -h or --help * @api private */ function outputHelpIfNecessary(cmd, options) { options = options || []; for (var i = 0; i < options.length; i++) { if (options[i] === '--help' || options[i] === '-h') { cmd.outputHelp(); process.exit(0); } } } /** * Takes an argument an returns its human readable equivalent for help usage. * * @param {Object} arg * @return {String} * @api private */ function humanReadableArgName(arg) { var nameOutput = arg.name + (arg.variadic === true ? '...' : ''); return arg.required ? '<' + nameOutput + '>' : '[' + nameOutput + ']'; } // for versions before node v0.8 when there weren't `fs.existsSync` function exists(file) { try { if (fs.statSync(file).isFile()) { return true; } } catch (e) { return false; } } (The MIT License) Copyright (c) 2011 TJ Holowaychuk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "commander", "version": "2.20.3", "description": "the complete solution for node.js command-line programs", "keywords": [ "commander", "command", "option", "parser" ], "author": "TJ Holowaychuk ", "license": "MIT", "repository": { "type": "git", "url": "https://github.com/tj/commander.js.git" }, "scripts": { "lint": "eslint index.js", "test": "node test/run.js && npm run test-typings", "test-typings": "tsc -p tsconfig.json" }, "main": "index", "files": [ "index.js", "typings/index.d.ts" ], "dependencies": {}, "devDependencies": { "@types/node": "^12.7.8", "eslint": "^6.4.0", "should": "^13.2.3", "sinon": "^7.5.0", "standard": "^14.3.1", "ts-node": "^8.4.1", "typescript": "^3.6.3" }, "typings": "typings/index.d.ts" } # Commander.js [![Build Status](https://api.travis-ci.org/tj/commander.js.svg?branch=master)](http://travis-ci.org/tj/commander.js) [![NPM Version](http://img.shields.io/npm/v/commander.svg?style=flat)](https://www.npmjs.org/package/commander) [![NPM Downloads](https://img.shields.io/npm/dm/commander.svg?style=flat)](https://npmcharts.com/compare/commander?minimal=true) [![Install Size](https://packagephobia.now.sh/badge?p=commander)](https://packagephobia.now.sh/result?p=commander) [![Join the chat at https://gitter.im/tj/commander.js](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/tj/commander.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/commander-rb/commander). [API documentation](http://tj.github.com/commander.js/) ## Installation $ npm install commander ## Option parsing Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options. ```js #!/usr/bin/env node /** * Module dependencies. */ var program = require('commander'); program .version('0.1.0') .option('-p, --peppers', 'Add peppers') .option('-P, --pineapple', 'Add pineapple') .option('-b, --bbq-sauce', 'Add bbq sauce') .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble') .parse(process.argv); console.log('you ordered a pizza with:'); if (program.peppers) console.log(' - peppers'); if (program.pineapple) console.log(' - pineapple'); if (program.bbqSauce) console.log(' - bbq'); console.log(' - %s cheese', program.cheese); ``` Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc. Note that multi-word options starting with `--no` prefix negate the boolean value of the following word. For example, `--no-sauce` sets the value of `program.sauce` to false. ```js #!/usr/bin/env node /** * Module dependencies. */ var program = require('commander'); program .option('--no-sauce', 'Remove sauce') .parse(process.argv); console.log('you ordered a pizza'); if (program.sauce) console.log(' with sauce'); else console.log(' without sauce'); ``` To get string arguments from options you will need to use angle brackets <> for required inputs or square brackets [] for optional inputs. e.g. ```.option('-m --myarg [myVar]', 'my super cool description')``` Then to access the input if it was passed in. e.g. ```var myInput = program.myarg``` **NOTE**: If you pass a argument without using brackets the example above will return true and not the value passed in. ## Version option Calling the `version` implicitly adds the `-V` and `--version` options to the command. When either of these options is present, the command prints the version number and exits. $ ./examples/pizza -V 0.0.1 If you want your program to respond to the `-v` option instead of the `-V` option, simply pass custom flags to the `version` method using the same syntax as the `option` method. ```js program .version('0.0.1', '-v, --version') ``` The version flags can be named anything, but the long option is required. ## Command-specific options You can attach options to a command. ```js #!/usr/bin/env node var program = require('commander'); program .command('rm ') .option('-r, --recursive', 'Remove recursively') .action(function (dir, cmd) { console.log('remove ' + dir + (cmd.recursive ? ' recursively' : '')) }) program.parse(process.argv) ``` A command's options are validated when the command is used. Any unknown options will be reported as an error. However, if an action-based command does not define an action, then the options are not validated. ## Coercion ```js function range(val) { return val.split('..').map(Number); } function list(val) { return val.split(','); } function collect(val, memo) { memo.push(val); return memo; } function increaseVerbosity(v, total) { return total + 1; } program .version('0.1.0') .usage('[options] ') .option('-i, --integer ', 'An integer argument', parseInt) .option('-f, --float ', 'A float argument', parseFloat) .option('-r, --range ..', 'A range', range) .option('-l, --list ', 'A list', list) .option('-o, --optional [value]', 'An optional value') .option('-c, --collect [value]', 'A repeatable value', collect, []) .option('-v, --verbose', 'A value that can be increased', increaseVerbosity, 0) .parse(process.argv); console.log(' int: %j', program.integer); console.log(' float: %j', program.float); console.log(' optional: %j', program.optional); program.range = program.range || []; console.log(' range: %j..%j', program.range[0], program.range[1]); console.log(' list: %j', program.list); console.log(' collect: %j', program.collect); console.log(' verbosity: %j', program.verbose); console.log(' args: %j', program.args); ``` ## Regular Expression ```js program .version('0.1.0') .option('-s --size ', 'Pizza size', /^(large|medium|small)$/i, 'medium') .option('-d --drink [drink]', 'Drink', /^(coke|pepsi|izze)$/i) .parse(process.argv); console.log(' size: %j', program.size); console.log(' drink: %j', program.drink); ``` ## Variadic arguments The last argument of a command can be variadic, and only the last argument. To make an argument variadic you have to append `...` to the argument name. Here is an example: ```js #!/usr/bin/env node /** * Module dependencies. */ var program = require('commander'); program .version('0.1.0') .command('rmdir [otherDirs...]') .action(function (dir, otherDirs) { console.log('rmdir %s', dir); if (otherDirs) { otherDirs.forEach(function (oDir) { console.log('rmdir %s', oDir); }); } }); program.parse(process.argv); ``` An `Array` is used for the value of a variadic argument. This applies to `program.args` as well as the argument passed to your action as demonstrated above. ## Specify the argument syntax ```js #!/usr/bin/env node var program = require('commander'); program .version('0.1.0') .arguments(' [env]') .action(function (cmd, env) { cmdValue = cmd; envValue = env; }); program.parse(process.argv); if (typeof cmdValue === 'undefined') { console.error('no command given!'); process.exit(1); } console.log('command:', cmdValue); console.log('environment:', envValue || "no environment given"); ``` Angled brackets (e.g. ``) indicate required input. Square brackets (e.g. `[env]`) indicate optional input. ## Git-style sub-commands ```js // file: ./examples/pm var program = require('commander'); program .version('0.1.0') .command('install [name]', 'install one or more packages') .command('search [query]', 'search with optional query') .command('list', 'list packages installed', {isDefault: true}) .parse(process.argv); ``` When `.command()` is invoked with a description argument, no `.action(callback)` should be called to handle sub-commands, otherwise there will be an error. This tells commander that you're going to use separate executables for sub-commands, much like `git(1)` and other popular tools. The commander will try to search the executables in the directory of the entry script (like `./examples/pm`) with the name `program-command`, like `pm-install`, `pm-search`. Options can be passed with the call to `.command()`. Specifying `true` for `opts.noHelp` will remove the subcommand from the generated help output. Specifying `true` for `opts.isDefault` will run the subcommand if no other subcommand is specified. If the program is designed to be installed globally, make sure the executables have proper modes, like `755`. ### `--harmony` You can enable `--harmony` option in two ways: * Use `#! /usr/bin/env node --harmony` in the sub-commands scripts. Note some os version don’t support this pattern. * Use the `--harmony` option when call the command, like `node --harmony examples/pm publish`. The `--harmony` option will be preserved when spawning sub-command process. ## Automated --help The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free: ``` $ ./examples/pizza --help Usage: pizza [options] An application for pizzas ordering Options: -h, --help output usage information -V, --version output the version number -p, --peppers Add peppers -P, --pineapple Add pineapple -b, --bbq Add bbq sauce -c, --cheese Add the specified type of cheese [marble] -C, --no-cheese You do not want any cheese ``` ## Custom help You can display arbitrary `-h, --help` information by listening for "--help". Commander will automatically exit once you are done so that the remainder of your program does not execute causing undesired behaviors, for example in the following executable "stuff" will not output when `--help` is used. ```js #!/usr/bin/env node /** * Module dependencies. */ var program = require('commander'); program .version('0.1.0') .option('-f, --foo', 'enable some foo') .option('-b, --bar', 'enable some bar') .option('-B, --baz', 'enable some baz'); // must be before .parse() since // node's emit() is immediate program.on('--help', function(){ console.log('') console.log('Examples:'); console.log(' $ custom-help --help'); console.log(' $ custom-help -h'); }); program.parse(process.argv); console.log('stuff'); ``` Yields the following help output when `node script-name.js -h` or `node script-name.js --help` are run: ``` Usage: custom-help [options] Options: -h, --help output usage information -V, --version output the version number -f, --foo enable some foo -b, --bar enable some bar -B, --baz enable some baz Examples: $ custom-help --help $ custom-help -h ``` ## .outputHelp(cb) Output help information without exiting. Optional callback cb allows post-processing of help text before it is displayed. If you want to display help by default (e.g. if no command was provided), you can use something like: ```js var program = require('commander'); var colors = require('colors'); program .version('0.1.0') .command('getstream [url]', 'get stream URL') .parse(process.argv); if (!process.argv.slice(2).length) { program.outputHelp(make_red); } function make_red(txt) { return colors.red(txt); //display the help text in red on the console } ``` ## .help(cb) Output help information and exit immediately. Optional callback cb allows post-processing of help text before it is displayed. ## Custom event listeners You can execute custom actions by listening to command and option events. ```js program.on('option:verbose', function () { process.env.VERBOSE = this.verbose; }); // error on unknown commands program.on('command:*', function () { console.error('Invalid command: %s\nSee --help for a list of available commands.', program.args.join(' ')); process.exit(1); }); ``` ## Examples ```js var program = require('commander'); program .version('0.1.0') .option('-C, --chdir ', 'change the working directory') .option('-c, --config ', 'set config path. defaults to ./deploy.conf') .option('-T, --no-tests', 'ignore test hook'); program .command('setup [env]') .description('run setup commands for all envs') .option("-s, --setup_mode [mode]", "Which setup mode to use") .action(function(env, options){ var mode = options.setup_mode || "normal"; env = env || 'all'; console.log('setup for %s env(s) with %s mode', env, mode); }); program .command('exec ') .alias('ex') .description('execute the given remote cmd') .option("-e, --exec_mode ", "Which exec mode to use") .action(function(cmd, options){ console.log('exec "%s" using %s mode', cmd, options.exec_mode); }).on('--help', function() { console.log(''); console.log('Examples:'); console.log(''); console.log(' $ deploy exec sequential'); console.log(' $ deploy exec async'); }); program .command('*') .action(function(env){ console.log('deploying "%s"', env); }); program.parse(process.argv); ``` More Demos can be found in the [examples](https://github.com/tj/commander.js/tree/master/examples) directory. ## License [MIT](https://github.com/tj/commander.js/blob/master/LICENSE) Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright {yyyy} {name of copyright owner} Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. { "name": "detect-libc", "version": "2.0.1", "description": "Node.js module to detect the C standard library (libc) implementation family and version", "main": "lib/detect-libc.js", "files": [ "lib/", "index.d.ts" ], "scripts": { "test": "semistandard && nyc --reporter=lcov --check-coverage --branches=100 ava test/unit.js" }, "repository": { "type": "git", "url": "git://github.com/lovell/detect-libc" }, "keywords": [ "libc", "glibc", "musl" ], "author": "Lovell Fuller ", "contributors": [ "Niklas Salmoukas " ], "license": "Apache-2.0", "devDependencies": { "ava": "^2.4.0", "nyc": "^15.1.0", "proxyquire": "^2.1.3", "semistandard": "^14.2.3" }, "engines": { "node": ">=8" } } 'use strict'; const childProcess = require('child_process'); const { isLinux, getReport } = require('./process'); const command = 'getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true'; let commandOut = ''; const safeCommand = () => { if (!commandOut) { return new Promise((resolve) => { childProcess.exec(command, (err, out) => { commandOut = err ? ' ' : out; resolve(commandOut); }); }); } return commandOut; }; const safeCommandSync = () => { if (!commandOut) { try { commandOut = childProcess.execSync(command, { encoding: 'utf8' }); } catch (_err) { commandOut = ' '; } } return commandOut; }; /** * A String constant containing the value `glibc`. * @type {string} * @public */ const GLIBC = 'glibc'; /** * A String constant containing the value `musl`. * @type {string} * @public */ const MUSL = 'musl'; const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-'); const familyFromReport = () => { const report = getReport(); if (report.header && report.header.glibcVersionRuntime) { return GLIBC; } if (Array.isArray(report.sharedObjects)) { if (report.sharedObjects.some(isFileMusl)) { return MUSL; } } return null; }; const familyFromCommand = (out) => { const [getconf, ldd1] = out.split(/[\r\n]+/); if (getconf && getconf.includes(GLIBC)) { return GLIBC; } if (ldd1 && ldd1.includes(MUSL)) { return MUSL; } return null; }; /** * Resolves with the libc family when it can be determined, `null` otherwise. * @returns {Promise} */ const family = async () => { let family = null; if (isLinux()) { family = familyFromReport(); if (!family) { const out = await safeCommand(); family = familyFromCommand(out); } } return family; }; /** * Returns the libc family when it can be determined, `null` otherwise. * @returns {?string} */ const familySync = () => { let family = null; if (isLinux()) { family = familyFromReport(); if (!family) { const out = safeCommandSync(); family = familyFromCommand(out); } } return family; }; /** * Resolves `true` only when the platform is Linux and the libc family is not `glibc`. * @returns {Promise} */ const isNonGlibcLinux = async () => isLinux() && await family() !== GLIBC; /** * Returns `true` only when the platform is Linux and the libc family is not `glibc`. * @returns {boolean} */ const isNonGlibcLinuxSync = () => isLinux() && familySync() !== GLIBC; const versionFromReport = () => { const report = getReport(); if (report.header && report.header.glibcVersionRuntime) { return report.header.glibcVersionRuntime; } return null; }; const versionSuffix = (s) => s.trim().split(/\s+/)[1]; const versionFromCommand = (out) => { const [getconf, ldd1, ldd2] = out.split(/[\r\n]+/); if (getconf && getconf.includes(GLIBC)) { return versionSuffix(getconf); } if (ldd1 && ldd2 && ldd1.includes(MUSL)) { return versionSuffix(ldd2); } return null; }; /** * Resolves with the libc version when it can be determined, `null` otherwise. * @returns {Promise} */ const version = async () => { let version = null; if (isLinux()) { version = versionFromReport(); if (!version) { const out = await safeCommand(); version = versionFromCommand(out); } } return version; }; /** * Returns the libc version when it can be determined, `null` otherwise. * @returns {?string} */ const versionSync = () => { let version = null; if (isLinux()) { version = versionFromReport(); if (!version) { const out = safeCommandSync(); version = versionFromCommand(out); } } return version; }; module.exports = { GLIBC, MUSL, family, familySync, isNonGlibcLinux, isNonGlibcLinuxSync, version, versionSync }; 'use strict'; const isLinux = () => process.platform === 'linux'; let report = null; const getReport = () => { if (!report) { /* istanbul ignore next */ report = isLinux() && process.report ? process.report.getReport() : {}; } return report; }; module.exports = { isLinux, getReport }; 'use strict'; const path = require('path'); const os = require('os'); const homedir = os.homedir(); const tmpdir = os.tmpdir(); const {env} = process; const macos = name => { const library = path.join(homedir, 'Library'); return { data: path.join(library, 'Application Support', name), config: path.join(library, 'Preferences', name), cache: path.join(library, 'Caches', name), log: path.join(library, 'Logs', name), temp: path.join(tmpdir, name) }; }; const windows = name => { const appData = env.APPDATA || path.join(homedir, 'AppData', 'Roaming'); const localAppData = env.LOCALAPPDATA || path.join(homedir, 'AppData', 'Local'); return { // Data/config/cache/log are invented by me as Windows isn't opinionated about this data: path.join(localAppData, name, 'Data'), config: path.join(appData, name, 'Config'), cache: path.join(localAppData, name, 'Cache'), log: path.join(localAppData, name, 'Log'), temp: path.join(tmpdir, name) }; }; // https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html const linux = name => { const username = path.basename(homedir); return { data: path.join(env.XDG_DATA_HOME || path.join(homedir, '.local', 'share'), name), config: path.join(env.XDG_CONFIG_HOME || path.join(homedir, '.config'), name), cache: path.join(env.XDG_CACHE_HOME || path.join(homedir, '.cache'), name), // https://wiki.debian.org/XDGBaseDirectorySpecification#state log: path.join(env.XDG_STATE_HOME || path.join(homedir, '.local', 'state'), name), temp: path.join(tmpdir, username, name) }; }; const envPaths = (name, options) => { if (typeof name !== 'string') { throw new TypeError(`Expected string, got ${typeof name}`); } options = Object.assign({suffix: 'nodejs'}, options); if (options.suffix) { // Add suffix to prevent possible conflict with native apps name += `-${options.suffix}`; } if (process.platform === 'darwin') { return macos(name); } if (process.platform === 'win32') { return windows(name); } return linux(name); }; module.exports = envPaths; // TODO: Remove this for the next major release module.exports.default = envPaths; MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "env-paths", "version": "2.2.0", "description": "Get paths for storing things like data, config, cache, etc", "license": "MIT", "repository": "sindresorhus/env-paths", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=6" }, "scripts": { "test": "xo && ava && tsd" }, "files": [ "index.js", "index.d.ts" ], "keywords": [ "common", "user", "paths", "env", "environment", "directory", "dir", "appdir", "path", "data", "config", "cache", "logs", "temp", "linux", "unix" ], "devDependencies": { "ava": "^1.4.1", "tsd": "^0.7.1", "xo": "^0.24.0" } } { "name": "es6-promisify", "version": "5.0.0", "description": "Converts callback-based functions to ES6 Promises", "main": "dist/promisify.js", "author": "Mike Hall ", "keywords": [ "promises", "es6", "promisify" ], "license": "MIT", "dependencies": { "es6-promise": "^4.0.3" }, "scripts": { "pretest": "./node_modules/eslint/bin/eslint.js ./lib/*.js ./tests/*.js", "test": "gulp && nodeunit tests" }, "bugs": "http://github.com/digitaldesignlabs/es6-promisify/issues", "files": [ "dist/promisify.js", "dist/promise.js" ], "repository": { "type": "git", "url": "https://github.com/digitaldesignlabs/es6-promisify.git" }, "devDependencies": { "babel-preset-es2015": "^6.9.0", "eslint": "^2.13.1", "gulp": "^3.9.1", "gulp-babel": "^6.1.2", "nodeunit": "^0.10.0" }, "greenkeeper": { "ignore": [ "eslint" ] } } "use strict"; /* global self, window, module, global, require */ module.exports = function () { "use strict"; var globalObject = void 0; function isFunction(x) { return typeof x === "function"; } // Seek the global object if (global !== undefined) { globalObject = global; } else if (window !== undefined && window.document) { globalObject = window; } else { globalObject = self; } // Test for any native promise implementation, and if that // implementation appears to conform to the specificaton. // This code mostly nicked from the es6-promise module polyfill // and then fooled with. var hasPromiseSupport = function () { // No promise object at all, and it's a non-starter if (!globalObject.hasOwnProperty("Promise")) { return false; } // There is a Promise object. Does it conform to the spec? var P = globalObject.Promise; // Some of these methods are missing from // Firefox/Chrome experimental implementations if (!P.hasOwnProperty("resolve") || !P.hasOwnProperty("reject")) { return false; } if (!P.hasOwnProperty("all") || !P.hasOwnProperty("race")) { return false; } // Older version of the spec had a resolver object // as the arg rather than a function return function () { var resolve = void 0; var p = new globalObject.Promise(function (r) { resolve = r; }); if (p) { return isFunction(resolve); } return false; }(); }(); // Export the native Promise implementation if it // looks like it matches the spec if (hasPromiseSupport) { return globalObject.Promise; } // Otherwise, return the es6-promise polyfill by @jaffathecake. return require("es6-promise").Promise; }();"use strict"; /* global module, require */ module.exports = function () { "use strict"; // Get a promise object. This may be native, or it may be polyfilled var ES6Promise = require("./promise.js"); /** * thatLooksLikeAPromiseToMe() * * Duck-types a promise. * * @param {object} o * @return {bool} True if this resembles a promise */ function thatLooksLikeAPromiseToMe(o) { return o && typeof o.then === "function" && typeof o.catch === "function"; } /** * promisify() * * Transforms callback-based function -- func(arg1, arg2 .. argN, callback) -- into * an ES6-compatible Promise. Promisify provides a default callback of the form (error, result) * and rejects when `error` is truthy. You can also supply settings object as the second argument. * * @param {function} original - The function to promisify * @param {object} settings - Settings object * @param {object} settings.thisArg - A `this` context to use. If not set, assume `settings` _is_ `thisArg` * @param {bool} settings.multiArgs - Should multiple arguments be returned as an array? * @return {function} A promisified version of `original` */ return function promisify(original, settings) { return function () { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } var returnMultipleArguments = settings && settings.multiArgs; var target = void 0; if (settings && settings.thisArg) { target = settings.thisArg; } else if (settings) { target = settings; } // Return the promisified function return new ES6Promise(function (resolve, reject) { // Append the callback bound to the context args.push(function callback(err) { if (err) { return reject(err); } for (var _len2 = arguments.length, values = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { values[_key2 - 1] = arguments[_key2]; } if (false === !!returnMultipleArguments) { return resolve(values[0]); } resolve(values); }); // Call the function var response = original.apply(target, args); // If it looks like original already returns a promise, // then just resolve with that promise. Hopefully, the callback function we added will just be ignored. if (thatLooksLikeAPromiseToMe(response)) { resolve(response); } }); }; }; }();module.exports = function (opts) { var sep = opts ? opts.sep : '{}' var len = sep.length var whitespace = '\\s*' var left = escape(sep.substring(0, len / 2)) + whitespace var right = whitespace + escape(sep.substring(len / 2, len)) return function (template, values) { Object.keys(values).forEach(function (key) { var value = String(values[key]).replace(/\$/g, '$$$$') template = template.replace(regExp(key), value) }) return template } function escape (s) { return [].map.call(s, function (char) { return '\\' + char }).join('') } function regExp (key) { return new RegExp(left + key + right, 'g') } } The MIT License (MIT) Copyright (c) 2018 Lars-Magnus Skog Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.{ "name": "expand-template", "version": "2.0.3", "description": "Expand placeholders in a template string", "main": "index.js", "repository": { "type": "git", "url": "https://github.com/ralphtheninja/expand-template.git" }, "homepage": "https://github.com/ralphtheninja/expand-template", "scripts": { "test": "tape test.js && standard" }, "keywords": [ "template", "expand", "replace" ], "author": "LM ", "license": "(MIT OR WTFPL)", "dependencies": {}, "devDependencies": { "standard": "^12.0.0", "tape": "^4.2.2" }, "engines": { "node": ">=6" } } var test = require('tape') var Expand = require('./') test('default expands {} placeholders', function (t) { var expand = Expand() t.equal(typeof expand, 'function', 'is a function') t.equal(expand('{foo}/{bar}', { foo: 'BAR', bar: 'FOO' }), 'BAR/FOO') t.equal(expand('{foo}{foo}{foo}', { foo: 'FOO' }), 'FOOFOOFOO', 'expands one placeholder many times') t.end() }) test('support for custom separators', function (t) { var expand = Expand({ sep: '[]' }) t.equal(expand('[foo]/[bar]', { foo: 'BAR', bar: 'FOO' }), 'BAR/FOO') t.equal(expand('[foo][foo][foo]', { foo: 'FOO' }), 'FOOFOOFOO', 'expands one placeholder many times') t.end() }) test('support for longer custom separators', function (t) { var expand = Expand({ sep: '[[]]' }) t.equal(expand('[[foo]]/[[bar]]', { foo: 'BAR', bar: 'FOO' }), 'BAR/FOO') t.equal(expand('[[foo]][[foo]][[foo]]', { foo: 'FOO' }), 'FOOFOOFOO', 'expands one placeholder many times') t.end() }) test('whitespace-insensitive', function (t) { var expand = Expand({ sep: '[]' }) t.equal(expand('[ foo ]/[ bar ]', { foo: 'BAR', bar: 'FOO' }), 'BAR/FOO') t.equal(expand('[ foo ][ foo ][ foo]', { foo: 'FOO' }), 'FOOFOOFOO', 'expands one placeholder many times') t.end() }) test('dollar escape', function (t) { var expand = Expand() t.equal(expand('before {foo} after', { foo: '$' }), 'before $ after') t.equal(expand('before {foo} after', { foo: '$&' }), 'before $& after') t.equal(expand('before {foo} after', { foo: '$`' }), 'before $` after') t.equal(expand('before {foo} after', { foo: '$\'' }), 'before $\' after') t.equal(expand('before {foo} after', { foo: '$0' }), 'before $0 after') t.end() }) module.exports = function (pkg) { var m; if (m = match(JSON.stringify(pkg.repository))) { return m; } else if (m = match(JSON.stringify(pkg))) { return m; } return undefined; }; function match (str) { var m = /\bgithub.com[:\/]([^\/"]+)\/([^\/"]+)/.exec(str); if (m) { return 'https://github.com/' + m[1] + '/' + m[2].replace(/\.git$/, ''); } } This software is released under the MIT license: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name" : "github-from-package", "version" : "0.0.0", "description" : "return the github url from a package.json file", "main" : "index.js", "devDependencies" : { "tap" : "~0.3.0", "tape" : "~0.1.5" }, "scripts" : { "test" : "tap test/*.js" }, "repository" : { "type" : "git", "url" : "git://github.com/substack/github-from-package.git" }, "homepage" : "https://github.com/substack/github-from-package", "keywords" : [ "github", "package.json", "npm", "repository" ], "author" : { "name" : "James Halliday", "email" : "mail@substack.net", "url" : "http://substack.net" }, "license" : "MIT" } exports.alphasort = alphasort exports.alphasorti = alphasorti exports.setopts = setopts exports.ownProp = ownProp exports.makeAbs = makeAbs exports.finish = finish exports.mark = mark exports.isIgnored = isIgnored exports.childrenIgnored = childrenIgnored function ownProp (obj, field) { return Object.prototype.hasOwnProperty.call(obj, field) } var path = require("path") var minimatch = require("minimatch") var isAbsolute = require("path-is-absolute") var Minimatch = minimatch.Minimatch function alphasorti (a, b) { return a.toLowerCase().localeCompare(b.toLowerCase()) } function alphasort (a, b) { return a.localeCompare(b) } function setupIgnores (self, options) { self.ignore = options.ignore || [] if (!Array.isArray(self.ignore)) self.ignore = [self.ignore] if (self.ignore.length) { self.ignore = self.ignore.map(ignoreMap) } } function ignoreMap (pattern) { var gmatcher = null if (pattern.slice(-3) === '/**') { var gpattern = pattern.replace(/(\/\*\*)+$/, '') gmatcher = new Minimatch(gpattern) } return { matcher: new Minimatch(pattern), gmatcher: gmatcher } } function setopts (self, pattern, options) { if (!options) options = {} // base-matching: just use globstar for that. if (options.matchBase && -1 === pattern.indexOf("/")) { if (options.noglobstar) { throw new Error("base matching requires globstar") } pattern = "**/" + pattern } self.silent = !!options.silent self.pattern = pattern self.strict = options.strict !== false self.realpath = !!options.realpath self.realpathCache = options.realpathCache || Object.create(null) self.follow = !!options.follow self.dot = !!options.dot self.mark = !!options.mark self.nodir = !!options.nodir if (self.nodir) self.mark = true self.sync = !!options.sync self.nounique = !!options.nounique self.nonull = !!options.nonull self.nosort = !!options.nosort self.nocase = !!options.nocase self.stat = !!options.stat self.noprocess = !!options.noprocess self.maxLength = options.maxLength || Infinity self.cache = options.cache || Object.create(null) self.statCache = options.statCache || Object.create(null) self.symlinks = options.symlinks || Object.create(null) setupIgnores(self, options) self.changedCwd = false var cwd = process.cwd() if (!ownProp(options, "cwd")) self.cwd = cwd else { self.cwd = options.cwd self.changedCwd = path.resolve(options.cwd) !== cwd } self.root = options.root || path.resolve(self.cwd, "/") self.root = path.resolve(self.root) if (process.platform === "win32") self.root = self.root.replace(/\\/g, "/") self.nomount = !!options.nomount // disable comments and negation unless the user explicitly // passes in false as the option. options.nonegate = options.nonegate === false ? false : true options.nocomment = options.nocomment === false ? false : true deprecationWarning(options) self.minimatch = new Minimatch(pattern, options) self.options = self.minimatch.options } // TODO(isaacs): remove entirely in v6 // exported to reset in tests exports.deprecationWarned function deprecationWarning(options) { if (!options.nonegate || !options.nocomment) { if (process.noDeprecation !== true && !exports.deprecationWarned) { var msg = 'glob WARNING: comments and negation will be disabled in v6' if (process.throwDeprecation) throw new Error(msg) else if (process.traceDeprecation) console.trace(msg) else console.error(msg) exports.deprecationWarned = true } } } function finish (self) { var nou = self.nounique var all = nou ? [] : Object.create(null) for (var i = 0, l = self.matches.length; i < l; i ++) { var matches = self.matches[i] if (!matches || Object.keys(matches).length === 0) { if (self.nonull) { // do like the shell, and spit out the literal glob var literal = self.minimatch.globSet[i] if (nou) all.push(literal) else all[literal] = true } } else { // had matches var m = Object.keys(matches) if (nou) all.push.apply(all, m) else m.forEach(function (m) { all[m] = true }) } } if (!nou) all = Object.keys(all) if (!self.nosort) all = all.sort(self.nocase ? alphasorti : alphasort) // at *some* point we statted all of these if (self.mark) { for (var i = 0; i < all.length; i++) { all[i] = self._mark(all[i]) } if (self.nodir) { all = all.filter(function (e) { return !(/\/$/.test(e)) }) } } if (self.ignore.length) all = all.filter(function(m) { return !isIgnored(self, m) }) self.found = all } function mark (self, p) { var abs = makeAbs(self, p) var c = self.cache[abs] var m = p if (c) { var isDir = c === 'DIR' || Array.isArray(c) var slash = p.slice(-1) === '/' if (isDir && !slash) m += '/' else if (!isDir && slash) m = m.slice(0, -1) if (m !== p) { var mabs = makeAbs(self, m) self.statCache[mabs] = self.statCache[abs] self.cache[mabs] = self.cache[abs] } } return m } // lotta situps... function makeAbs (self, f) { var abs = f if (f.charAt(0) === '/') { abs = path.join(self.root, f) } else if (isAbsolute(f) || f === '') { abs = f } else if (self.changedCwd) { abs = path.resolve(self.cwd, f) } else { abs = path.resolve(f) } return abs } // Return true, if pattern ends with globstar '**', for the accompanying parent directory. // Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents function isIgnored (self, path) { if (!self.ignore.length) return false return self.ignore.some(function(item) { return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) }) } function childrenIgnored (self, path) { if (!self.ignore.length) return false return self.ignore.some(function(item) { return !!(item.gmatcher && item.gmatcher.match(path)) }) } // Approach: // // 1. Get the minimatch set // 2. For each pattern in the set, PROCESS(pattern, false) // 3. Store matches per-set, then uniq them // // PROCESS(pattern, inGlobStar) // Get the first [n] items from pattern that are all strings // Join these together. This is PREFIX. // If there is no more remaining, then stat(PREFIX) and // add to matches if it succeeds. END. // // If inGlobStar and PREFIX is symlink and points to dir // set ENTRIES = [] // else readdir(PREFIX) as ENTRIES // If fail, END // // with ENTRIES // If pattern[n] is GLOBSTAR // // handle the case where the globstar match is empty // // by pruning it out, and testing the resulting pattern // PROCESS(pattern[0..n] + pattern[n+1 .. $], false) // // handle other cases. // for ENTRY in ENTRIES (not dotfiles) // // attach globstar + tail onto the entry // // Mark that this entry is a globstar match // PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) // // else // not globstar // for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) // Test ENTRY against pattern[n] // If fails, continue // If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) // // Caveat: // Cache all stats and readdirs results to minimize syscall. Since all // we ever care about is existence and directory-ness, we can just keep // `true` for files, and [children,...] for directories, or `false` for // things that don't exist. module.exports = glob var fs = require('fs') var minimatch = require('minimatch') var Minimatch = minimatch.Minimatch var inherits = require('inherits') var EE = require('events').EventEmitter var path = require('path') var assert = require('assert') var isAbsolute = require('path-is-absolute') var globSync = require('./sync.js') var common = require('./common.js') var alphasort = common.alphasort var alphasorti = common.alphasorti var setopts = common.setopts var ownProp = common.ownProp var inflight = require('inflight') var util = require('util') var childrenIgnored = common.childrenIgnored var isIgnored = common.isIgnored var once = require('once') function glob (pattern, options, cb) { if (typeof options === 'function') cb = options, options = {} if (!options) options = {} if (options.sync) { if (cb) throw new TypeError('callback provided to sync glob') return globSync(pattern, options) } return new Glob(pattern, options, cb) } glob.sync = globSync var GlobSync = glob.GlobSync = globSync.GlobSync // old api surface glob.glob = glob glob.hasMagic = function (pattern, options_) { var options = util._extend({}, options_) options.noprocess = true var g = new Glob(pattern, options) var set = g.minimatch.set if (set.length > 1) return true for (var j = 0; j < set[0].length; j++) { if (typeof set[0][j] !== 'string') return true } return false } glob.Glob = Glob inherits(Glob, EE) function Glob (pattern, options, cb) { if (typeof options === 'function') { cb = options options = null } if (options && options.sync) { if (cb) throw new TypeError('callback provided to sync glob') return new GlobSync(pattern, options) } if (!(this instanceof Glob)) return new Glob(pattern, options, cb) setopts(this, pattern, options) this._didRealPath = false // process each pattern in the minimatch set var n = this.minimatch.set.length // The matches are stored as {: true,...} so that // duplicates are automagically pruned. // Later, we do an Object.keys() on these. // Keep them as a list so we can fill in when nonull is set. this.matches = new Array(n) if (typeof cb === 'function') { cb = once(cb) this.on('error', cb) this.on('end', function (matches) { cb(null, matches) }) } var self = this var n = this.minimatch.set.length this._processing = 0 this.matches = new Array(n) this._emitQueue = [] this._processQueue = [] this.paused = false if (this.noprocess) return this if (n === 0) return done() for (var i = 0; i < n; i ++) { this._process(this.minimatch.set[i], i, false, done) } function done () { --self._processing if (self._processing <= 0) self._finish() } } Glob.prototype._finish = function () { assert(this instanceof Glob) if (this.aborted) return if (this.realpath && !this._didRealpath) return this._realpath() common.finish(this) this.emit('end', this.found) } Glob.prototype._realpath = function () { if (this._didRealpath) return this._didRealpath = true var n = this.matches.length if (n === 0) return this._finish() var self = this for (var i = 0; i < this.matches.length; i++) this._realpathSet(i, next) function next () { if (--n === 0) self._finish() } } Glob.prototype._realpathSet = function (index, cb) { var matchset = this.matches[index] if (!matchset) return cb() var found = Object.keys(matchset) var self = this var n = found.length if (n === 0) return cb() var set = this.matches[index] = Object.create(null) found.forEach(function (p, i) { // If there's a problem with the stat, then it means that // one or more of the links in the realpath couldn't be // resolved. just return the abs value in that case. p = self._makeAbs(p) fs.realpath(p, self.realpathCache, function (er, real) { if (!er) set[real] = true else if (er.syscall === 'stat') set[p] = true else self.emit('error', er) // srsly wtf right here if (--n === 0) { self.matches[index] = set cb() } }) }) } Glob.prototype._mark = function (p) { return common.mark(this, p) } Glob.prototype._makeAbs = function (f) { return common.makeAbs(this, f) } Glob.prototype.abort = function () { this.aborted = true this.emit('abort') } Glob.prototype.pause = function () { if (!this.paused) { this.paused = true this.emit('pause') } } Glob.prototype.resume = function () { if (this.paused) { this.emit('resume') this.paused = false if (this._emitQueue.length) { var eq = this._emitQueue.slice(0) this._emitQueue.length = 0 for (var i = 0; i < eq.length; i ++) { var e = eq[i] this._emitMatch(e[0], e[1]) } } if (this._processQueue.length) { var pq = this._processQueue.slice(0) this._processQueue.length = 0 for (var i = 0; i < pq.length; i ++) { var p = pq[i] this._processing-- this._process(p[0], p[1], p[2], p[3]) } } } } Glob.prototype._process = function (pattern, index, inGlobStar, cb) { assert(this instanceof Glob) assert(typeof cb === 'function') if (this.aborted) return this._processing++ if (this.paused) { this._processQueue.push([pattern, index, inGlobStar, cb]) return } //console.error('PROCESS %d', this._processing, pattern) // Get the first [n] parts of pattern that are all strings. var n = 0 while (typeof pattern[n] === 'string') { n ++ } // now n is the index of the first one that is *not* a string. // see if there's anything else var prefix switch (n) { // if not, then this is rather simple case pattern.length: this._processSimple(pattern.join('/'), index, cb) return case 0: // pattern *starts* with some non-trivial item. // going to readdir(cwd), but not include the prefix in matches. prefix = null break default: // pattern has some string bits in the front. // whatever it starts with, whether that's 'absolute' like /foo/bar, // or 'relative' like '../baz' prefix = pattern.slice(0, n).join('/') break } var remain = pattern.slice(n) // get the list of entries. var read if (prefix === null) read = '.' else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { if (!prefix || !isAbsolute(prefix)) prefix = '/' + prefix read = prefix } else read = prefix var abs = this._makeAbs(read) //if ignored, skip _processing if (childrenIgnored(this, read)) return cb() var isGlobStar = remain[0] === minimatch.GLOBSTAR if (isGlobStar) this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) else this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) } Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { var self = this this._readdir(abs, inGlobStar, function (er, entries) { return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) }) } Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { // if the abs isn't a dir, then nothing can match! if (!entries) return cb() // It will only match dot entries if it starts with a dot, or if // dot is set. Stuff like @(.foo|.bar) isn't allowed. var pn = remain[0] var negate = !!this.minimatch.negate var rawGlob = pn._glob var dotOk = this.dot || rawGlob.charAt(0) === '.' var matchedEntries = [] for (var i = 0; i < entries.length; i++) { var e = entries[i] if (e.charAt(0) !== '.' || dotOk) { var m if (negate && !prefix) { m = !e.match(pn) } else { m = e.match(pn) } if (m) matchedEntries.push(e) } } //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) var len = matchedEntries.length // If there are no matched entries, then nothing matches. if (len === 0) return cb() // if this is the last remaining pattern bit, then no need for // an additional stat *unless* the user has specified mark or // stat explicitly. We know they exist, since readdir returned // them. if (remain.length === 1 && !this.mark && !this.stat) { if (!this.matches[index]) this.matches[index] = Object.create(null) for (var i = 0; i < len; i ++) { var e = matchedEntries[i] if (prefix) { if (prefix !== '/') e = prefix + '/' + e else e = prefix + e } if (e.charAt(0) === '/' && !this.nomount) { e = path.join(this.root, e) } this._emitMatch(index, e) } // This was the last one, and no stats were needed return cb() } // now test all matched entries as stand-ins for that part // of the pattern. remain.shift() for (var i = 0; i < len; i ++) { var e = matchedEntries[i] var newPattern if (prefix) { if (prefix !== '/') e = prefix + '/' + e else e = prefix + e } this._process([e].concat(remain), index, inGlobStar, cb) } cb() } Glob.prototype._emitMatch = function (index, e) { if (this.aborted) return if (this.matches[index][e]) return if (isIgnored(this, e)) return if (this.paused) { this._emitQueue.push([index, e]) return } var abs = this._makeAbs(e) if (this.nodir) { var c = this.cache[abs] if (c === 'DIR' || Array.isArray(c)) return } if (this.mark) e = this._mark(e) this.matches[index][e] = true var st = this.statCache[abs] if (st) this.emit('stat', e, st) this.emit('match', e) } Glob.prototype._readdirInGlobStar = function (abs, cb) { if (this.aborted) return // follow all symlinked directories forever // just proceed as if this is a non-globstar situation if (this.follow) return this._readdir(abs, false, cb) var lstatkey = 'lstat\0' + abs var self = this var lstatcb = inflight(lstatkey, lstatcb_) if (lstatcb) fs.lstat(abs, lstatcb) function lstatcb_ (er, lstat) { if (er) return cb() var isSym = lstat.isSymbolicLink() self.symlinks[abs] = isSym // If it's not a symlink or a dir, then it's definitely a regular file. // don't bother doing a readdir in that case. if (!isSym && !lstat.isDirectory()) { self.cache[abs] = 'FILE' cb() } else self._readdir(abs, false, cb) } } Glob.prototype._readdir = function (abs, inGlobStar, cb) { if (this.aborted) return cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) if (!cb) return //console.error('RD %j %j', +inGlobStar, abs) if (inGlobStar && !ownProp(this.symlinks, abs)) return this._readdirInGlobStar(abs, cb) if (ownProp(this.cache, abs)) { var c = this.cache[abs] if (!c || c === 'FILE') return cb() if (Array.isArray(c)) return cb(null, c) } var self = this fs.readdir(abs, readdirCb(this, abs, cb)) } function readdirCb (self, abs, cb) { return function (er, entries) { if (er) self._readdirError(abs, er, cb) else self._readdirEntries(abs, entries, cb) } } Glob.prototype._readdirEntries = function (abs, entries, cb) { if (this.aborted) return // if we haven't asked to stat everything, then just // assume that everything in there exists, so we can avoid // having to stat it a second time. if (!this.mark && !this.stat) { for (var i = 0; i < entries.length; i ++) { var e = entries[i] if (abs === '/') e = abs + e else e = abs + '/' + e this.cache[e] = true } } this.cache[abs] = entries return cb(null, entries) } Glob.prototype._readdirError = function (f, er, cb) { if (this.aborted) return // handle errors, and cache the information switch (er.code) { case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 case 'ENOTDIR': // totally normal. means it *does* exist. this.cache[this._makeAbs(f)] = 'FILE' break case 'ENOENT': // not terribly unusual case 'ELOOP': case 'ENAMETOOLONG': case 'UNKNOWN': this.cache[this._makeAbs(f)] = false break default: // some unusual error. Treat as failure. this.cache[this._makeAbs(f)] = false if (this.strict) { this.emit('error', er) // If the error is handled, then we abort // if not, we threw out of here this.abort() } if (!this.silent) console.error('glob error', er) break } return cb() } Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { var self = this this._readdir(abs, inGlobStar, function (er, entries) { self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) }) } Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { //console.error('pgs2', prefix, remain[0], entries) // no entries means not a dir, so it can never have matches // foo.txt/** doesn't match foo.txt if (!entries) return cb() // test without the globstar, and with every child both below // and replacing the globstar. var remainWithoutGlobStar = remain.slice(1) var gspref = prefix ? [ prefix ] : [] var noGlobStar = gspref.concat(remainWithoutGlobStar) // the noGlobStar pattern exits the inGlobStar state this._process(noGlobStar, index, false, cb) var isSym = this.symlinks[abs] var len = entries.length // If it's a symlink, and we're in a globstar, then stop if (isSym && inGlobStar) return cb() for (var i = 0; i < len; i++) { var e = entries[i] if (e.charAt(0) === '.' && !this.dot) continue // these two cases enter the inGlobStar state var instead = gspref.concat(entries[i], remainWithoutGlobStar) this._process(instead, index, true, cb) var below = gspref.concat(entries[i], remain) this._process(below, index, true, cb) } cb() } Glob.prototype._processSimple = function (prefix, index, cb) { // XXX review this. Shouldn't it be doing the mounting etc // before doing stat? kinda weird? var self = this this._stat(prefix, function (er, exists) { self._processSimple2(prefix, index, er, exists, cb) }) } Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { //console.error('ps2', prefix, exists) if (!this.matches[index]) this.matches[index] = Object.create(null) // If it doesn't exist, then just mark the lack of results if (!exists) return cb() if (prefix && isAbsolute(prefix) && !this.nomount) { var trail = /[\/\\]$/.test(prefix) if (prefix.charAt(0) === '/') { prefix = path.join(this.root, prefix) } else { prefix = path.resolve(this.root, prefix) if (trail) prefix += '/' } } if (process.platform === 'win32') prefix = prefix.replace(/\\/g, '/') // Mark this as a match this._emitMatch(index, prefix) cb() } // Returns either 'DIR', 'FILE', or false Glob.prototype._stat = function (f, cb) { var abs = this._makeAbs(f) var needDir = f.slice(-1) === '/' if (f.length > this.maxLength) return cb() if (!this.stat && ownProp(this.cache, abs)) { var c = this.cache[abs] if (Array.isArray(c)) c = 'DIR' // It exists, but maybe not how we need it if (!needDir || c === 'DIR') return cb(null, c) if (needDir && c === 'FILE') return cb() // otherwise we have to stat, because maybe c=true // if we know it exists, but not what it is. } var exists var stat = this.statCache[abs] if (stat !== undefined) { if (stat === false) return cb(null, stat) else { var type = stat.isDirectory() ? 'DIR' : 'FILE' if (needDir && type === 'FILE') return cb() else return cb(null, type, stat) } } var self = this var statcb = inflight('stat\0' + abs, lstatcb_) if (statcb) fs.lstat(abs, statcb) function lstatcb_ (er, lstat) { if (lstat && lstat.isSymbolicLink()) { // If it's a symlink, then treat it as the target, unless // the target does not exist, then treat it as a file. return fs.stat(abs, function (er, stat) { if (er) self._stat2(f, abs, null, lstat, cb) else self._stat2(f, abs, er, stat, cb) }) } else { self._stat2(f, abs, er, lstat, cb) } } } Glob.prototype._stat2 = function (f, abs, er, stat, cb) { if (er) { this.statCache[abs] = false return cb() } var needDir = f.slice(-1) === '/' this.statCache[abs] = stat if (abs.slice(-1) === '/' && !stat.isDirectory()) return cb(null, false, stat) var c = stat.isDirectory() ? 'DIR' : 'FILE' this.cache[abs] = this.cache[abs] || c if (needDir && c !== 'DIR') return cb() return cb(null, c, stat) } The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "name": "glob", "description": "a little globber", "version": "5.0.15", "repository": { "type": "git", "url": "git://github.com/isaacs/node-glob.git" }, "main": "glob.js", "files": [ "glob.js", "sync.js", "common.js" ], "engines": { "node": "*" }, "dependencies": { "inflight": "^1.0.4", "inherits": "2", "minimatch": "2 || 3", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, "devDependencies": { "mkdirp": "0", "rimraf": "^2.2.8", "tap": "^1.1.4", "tick": "0.0.6" }, "scripts": { "prepublish": "npm run benchclean", "profclean": "rm -f v8.log profile.txt", "test": "tap test/*.js --cov", "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js", "bench": "bash benchmark.sh", "prof": "bash prof.sh && cat profile.txt", "benchclean": "node benchclean.js" }, "license": "ISC" } module.exports = globSync globSync.GlobSync = GlobSync var fs = require('fs') var minimatch = require('minimatch') var Minimatch = minimatch.Minimatch var Glob = require('./glob.js').Glob var util = require('util') var path = require('path') var assert = require('assert') var isAbsolute = require('path-is-absolute') var common = require('./common.js') var alphasort = common.alphasort var alphasorti = common.alphasorti var setopts = common.setopts var ownProp = common.ownProp var childrenIgnored = common.childrenIgnored function globSync (pattern, options) { if (typeof options === 'function' || arguments.length === 3) throw new TypeError('callback provided to sync glob\n'+ 'See: https://github.com/isaacs/node-glob/issues/167') return new GlobSync(pattern, options).found } function GlobSync (pattern, options) { if (!pattern) throw new Error('must provide pattern') if (typeof options === 'function' || arguments.length === 3) throw new TypeError('callback provided to sync glob\n'+ 'See: https://github.com/isaacs/node-glob/issues/167') if (!(this instanceof GlobSync)) return new GlobSync(pattern, options) setopts(this, pattern, options) if (this.noprocess) return this var n = this.minimatch.set.length this.matches = new Array(n) for (var i = 0; i < n; i ++) { this._process(this.minimatch.set[i], i, false) } this._finish() } GlobSync.prototype._finish = function () { assert(this instanceof GlobSync) if (this.realpath) { var self = this this.matches.forEach(function (matchset, index) { var set = self.matches[index] = Object.create(null) for (var p in matchset) { try { p = self._makeAbs(p) var real = fs.realpathSync(p, self.realpathCache) set[real] = true } catch (er) { if (er.syscall === 'stat') set[self._makeAbs(p)] = true else throw er } } }) } common.finish(this) } GlobSync.prototype._process = function (pattern, index, inGlobStar) { assert(this instanceof GlobSync) // Get the first [n] parts of pattern that are all strings. var n = 0 while (typeof pattern[n] === 'string') { n ++ } // now n is the index of the first one that is *not* a string. // See if there's anything else var prefix switch (n) { // if not, then this is rather simple case pattern.length: this._processSimple(pattern.join('/'), index) return case 0: // pattern *starts* with some non-trivial item. // going to readdir(cwd), but not include the prefix in matches. prefix = null break default: // pattern has some string bits in the front. // whatever it starts with, whether that's 'absolute' like /foo/bar, // or 'relative' like '../baz' prefix = pattern.slice(0, n).join('/') break } var remain = pattern.slice(n) // get the list of entries. var read if (prefix === null) read = '.' else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { if (!prefix || !isAbsolute(prefix)) prefix = '/' + prefix read = prefix } else read = prefix var abs = this._makeAbs(read) //if ignored, skip processing if (childrenIgnored(this, read)) return var isGlobStar = remain[0] === minimatch.GLOBSTAR if (isGlobStar) this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) else this._processReaddir(prefix, read, abs, remain, index, inGlobStar) } GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { var entries = this._readdir(abs, inGlobStar) // if the abs isn't a dir, then nothing can match! if (!entries) return // It will only match dot entries if it starts with a dot, or if // dot is set. Stuff like @(.foo|.bar) isn't allowed. var pn = remain[0] var negate = !!this.minimatch.negate var rawGlob = pn._glob var dotOk = this.dot || rawGlob.charAt(0) === '.' var matchedEntries = [] for (var i = 0; i < entries.length; i++) { var e = entries[i] if (e.charAt(0) !== '.' || dotOk) { var m if (negate && !prefix) { m = !e.match(pn) } else { m = e.match(pn) } if (m) matchedEntries.push(e) } } var len = matchedEntries.length // If there are no matched entries, then nothing matches. if (len === 0) return // if this is the last remaining pattern bit, then no need for // an additional stat *unless* the user has specified mark or // stat explicitly. We know they exist, since readdir returned // them. if (remain.length === 1 && !this.mark && !this.stat) { if (!this.matches[index]) this.matches[index] = Object.create(null) for (var i = 0; i < len; i ++) { var e = matchedEntries[i] if (prefix) { if (prefix.slice(-1) !== '/') e = prefix + '/' + e else e = prefix + e } if (e.charAt(0) === '/' && !this.nomount) { e = path.join(this.root, e) } this.matches[index][e] = true } // This was the last one, and no stats were needed return } // now test all matched entries as stand-ins for that part // of the pattern. remain.shift() for (var i = 0; i < len; i ++) { var e = matchedEntries[i] var newPattern if (prefix) newPattern = [prefix, e] else newPattern = [e] this._process(newPattern.concat(remain), index, inGlobStar) } } GlobSync.prototype._emitMatch = function (index, e) { var abs = this._makeAbs(e) if (this.mark) e = this._mark(e) if (this.matches[index][e]) return if (this.nodir) { var c = this.cache[this._makeAbs(e)] if (c === 'DIR' || Array.isArray(c)) return } this.matches[index][e] = true if (this.stat) this._stat(e) } GlobSync.prototype._readdirInGlobStar = function (abs) { // follow all symlinked directories forever // just proceed as if this is a non-globstar situation if (this.follow) return this._readdir(abs, false) var entries var lstat var stat try { lstat = fs.lstatSync(abs) } catch (er) { // lstat failed, doesn't exist return null } var isSym = lstat.isSymbolicLink() this.symlinks[abs] = isSym // If it's not a symlink or a dir, then it's definitely a regular file. // don't bother doing a readdir in that case. if (!isSym && !lstat.isDirectory()) this.cache[abs] = 'FILE' else entries = this._readdir(abs, false) return entries } GlobSync.prototype._readdir = function (abs, inGlobStar) { var entries if (inGlobStar && !ownProp(this.symlinks, abs)) return this._readdirInGlobStar(abs) if (ownProp(this.cache, abs)) { var c = this.cache[abs] if (!c || c === 'FILE') return null if (Array.isArray(c)) return c } try { return this._readdirEntries(abs, fs.readdirSync(abs)) } catch (er) { this._readdirError(abs, er) return null } } GlobSync.prototype._readdirEntries = function (abs, entries) { // if we haven't asked to stat everything, then just // assume that everything in there exists, so we can avoid // having to stat it a second time. if (!this.mark && !this.stat) { for (var i = 0; i < entries.length; i ++) { var e = entries[i] if (abs === '/') e = abs + e else e = abs + '/' + e this.cache[e] = true } } this.cache[abs] = entries // mark and cache dir-ness return entries } GlobSync.prototype._readdirError = function (f, er) { // handle errors, and cache the information switch (er.code) { case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 case 'ENOTDIR': // totally normal. means it *does* exist. this.cache[this._makeAbs(f)] = 'FILE' break case 'ENOENT': // not terribly unusual case 'ELOOP': case 'ENAMETOOLONG': case 'UNKNOWN': this.cache[this._makeAbs(f)] = false break default: // some unusual error. Treat as failure. this.cache[this._makeAbs(f)] = false if (this.strict) throw er if (!this.silent) console.error('glob error', er) break } } GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { var entries = this._readdir(abs, inGlobStar) // no entries means not a dir, so it can never have matches // foo.txt/** doesn't match foo.txt if (!entries) return // test without the globstar, and with every child both below // and replacing the globstar. var remainWithoutGlobStar = remain.slice(1) var gspref = prefix ? [ prefix ] : [] var noGlobStar = gspref.concat(remainWithoutGlobStar) // the noGlobStar pattern exits the inGlobStar state this._process(noGlobStar, index, false) var len = entries.length var isSym = this.symlinks[abs] // If it's a symlink, and we're in a globstar, then stop if (isSym && inGlobStar) return for (var i = 0; i < len; i++) { var e = entries[i] if (e.charAt(0) === '.' && !this.dot) continue // these two cases enter the inGlobStar state var instead = gspref.concat(entries[i], remainWithoutGlobStar) this._process(instead, index, true) var below = gspref.concat(entries[i], remain) this._process(below, index, true) } } GlobSync.prototype._processSimple = function (prefix, index) { // XXX review this. Shouldn't it be doing the mounting etc // before doing stat? kinda weird? var exists = this._stat(prefix) if (!this.matches[index]) this.matches[index] = Object.create(null) // If it doesn't exist, then just mark the lack of results if (!exists) return if (prefix && isAbsolute(prefix) && !this.nomount) { var trail = /[\/\\]$/.test(prefix) if (prefix.charAt(0) === '/') { prefix = path.join(this.root, prefix) } else { prefix = path.resolve(this.root, prefix) if (trail) prefix += '/' } } if (process.platform === 'win32') prefix = prefix.replace(/\\/g, '/') // Mark this as a match this.matches[index][prefix] = true } // Returns either 'DIR', 'FILE', or false GlobSync.prototype._stat = function (f) { var abs = this._makeAbs(f) var needDir = f.slice(-1) === '/' if (f.length > this.maxLength) return false if (!this.stat && ownProp(this.cache, abs)) { var c = this.cache[abs] if (Array.isArray(c)) c = 'DIR' // It exists, but maybe not how we need it if (!needDir || c === 'DIR') return c if (needDir && c === 'FILE') return false // otherwise we have to stat, because maybe c=true // if we know it exists, but not what it is. } var exists var stat = this.statCache[abs] if (!stat) { var lstat try { lstat = fs.lstatSync(abs) } catch (er) { return false } if (lstat.isSymbolicLink()) { try { stat = fs.statSync(abs) } catch (er) { stat = lstat } } else { stat = lstat } } this.statCache[abs] = stat var c = stat.isDirectory() ? 'DIR' : 'FILE' this.cache[abs] = this.cache[abs] || c if (needDir && c !== 'DIR') return false return c } GlobSync.prototype._mark = function (p) { return common.mark(this, p) } GlobSync.prototype._makeAbs = function (f) { return common.makeAbs(this, f) } ISC License Copyright 2017-2022 (c) npm, Inc. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "make-fetch-happen", "version": "10.0.6", "description": "Opinionated, caching, retrying fetch client", "main": "lib/index.js", "files": [ "bin", "lib" ], "scripts": { "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", "test": "tap", "posttest": "npm run lint", "eslint": "eslint", "lint": "eslint '**/*.js'", "lintfix": "npm run lint -- --fix", "postlint": "npm-template-check", "snap": "tap", "template-copy": "npm-template-copy --force" }, "repository": "https://github.com/npm/make-fetch-happen", "keywords": [ "http", "request", "fetch", "mean girls", "caching", "cache", "subresource integrity" ], "author": "GitHub Inc.", "license": "ISC", "dependencies": { "agentkeepalive": "^4.2.1", "cacache": "^16.0.0", "http-cache-semantics": "^4.1.0", "http-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.0", "is-lambda": "^1.0.1", "lru-cache": "^7.5.1", "minipass": "^3.1.6", "minipass-collect": "^1.0.2", "minipass-fetch": "^2.0.3", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", "negotiator": "^0.6.3", "promise-retry": "^2.0.1", "socks-proxy-agent": "^6.1.1", "ssri": "^8.0.1" }, "devDependencies": { "@npmcli/template-oss": "^2.9.2", "eslint": "^8.11.0", "mkdirp": "^1.0.4", "nock": "^13.2.4", "rimraf": "^3.0.2", "safe-buffer": "^5.2.1", "standard-version": "^9.3.2", "tap": "^15.1.6" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16" }, "tap": { "color": 1, "files": "test/*.js", "check-coverage": true }, "templateOSS": { "version": "2.9.2" } } 'use strict' const LRU = require('lru-cache') const url = require('url') const isLambda = require('is-lambda') const AGENT_CACHE = new LRU({ max: 50 }) const HttpAgent = require('agentkeepalive') const HttpsAgent = HttpAgent.HttpsAgent module.exports = getAgent const getAgentTimeout = timeout => typeof timeout !== 'number' || !timeout ? 0 : timeout + 1 const getMaxSockets = maxSockets => maxSockets || 15 function getAgent (uri, opts) { const parsedUri = new url.URL(typeof uri === 'string' ? uri : uri.url) const isHttps = parsedUri.protocol === 'https:' const pxuri = getProxyUri(parsedUri.href, opts) // If opts.timeout is zero, set the agentTimeout to zero as well. A timeout // of zero disables the timeout behavior (OS limits still apply). Else, if // opts.timeout is a non-zero value, set it to timeout + 1, to ensure that // the node-fetch-npm timeout will always fire first, giving us more // consistent errors. const agentTimeout = getAgentTimeout(opts.timeout) const agentMaxSockets = getMaxSockets(opts.maxSockets) const key = [ `https:${isHttps}`, pxuri ? `proxy:${pxuri.protocol}//${pxuri.host}:${pxuri.port}` : '>no-proxy<', `local-address:${opts.localAddress || '>no-local-address<'}`, `strict-ssl:${isHttps ? opts.rejectUnauthorized : '>no-strict-ssl<'}`, `ca:${(isHttps && opts.ca) || '>no-ca<'}`, `cert:${(isHttps && opts.cert) || '>no-cert<'}`, `key:${(isHttps && opts.key) || '>no-key<'}`, `timeout:${agentTimeout}`, `maxSockets:${agentMaxSockets}`, ].join(':') if (opts.agent != null) { // `agent: false` has special behavior! return opts.agent } // keep alive in AWS lambda makes no sense const lambdaAgent = !isLambda ? null : isHttps ? require('https').globalAgent : require('http').globalAgent if (isLambda && !pxuri) { return lambdaAgent } if (AGENT_CACHE.peek(key)) { return AGENT_CACHE.get(key) } if (pxuri) { const pxopts = isLambda ? { ...opts, agent: lambdaAgent, } : opts const proxy = getProxy(pxuri, pxopts, isHttps) AGENT_CACHE.set(key, proxy) return proxy } const agent = isHttps ? new HttpsAgent({ maxSockets: agentMaxSockets, ca: opts.ca, cert: opts.cert, key: opts.key, localAddress: opts.localAddress, rejectUnauthorized: opts.rejectUnauthorized, timeout: agentTimeout, freeSocketTimeout: 15000, }) : new HttpAgent({ maxSockets: agentMaxSockets, localAddress: opts.localAddress, timeout: agentTimeout, freeSocketTimeout: 15000, }) AGENT_CACHE.set(key, agent) return agent } function checkNoProxy (uri, opts) { const host = new url.URL(uri).hostname.split('.').reverse() let noproxy = (opts.noProxy || getProcessEnv('no_proxy')) if (typeof noproxy === 'string') { noproxy = noproxy.split(',').map(n => n.trim()) } return noproxy && noproxy.some(no => { const noParts = no.split('.').filter(x => x).reverse() if (!noParts.length) { return false } for (let i = 0; i < noParts.length; i++) { if (host[i] !== noParts[i]) { return false } } return true }) } module.exports.getProcessEnv = getProcessEnv function getProcessEnv (env) { if (!env) { return } let value if (Array.isArray(env)) { for (const e of env) { value = process.env[e] || process.env[e.toUpperCase()] || process.env[e.toLowerCase()] if (typeof value !== 'undefined') { break } } } if (typeof env === 'string') { value = process.env[env] || process.env[env.toUpperCase()] || process.env[env.toLowerCase()] } return value } module.exports.getProxyUri = getProxyUri function getProxyUri (uri, opts) { const protocol = new url.URL(uri).protocol const proxy = opts.proxy || ( protocol === 'https:' && getProcessEnv('https_proxy') ) || ( protocol === 'http:' && getProcessEnv(['https_proxy', 'http_proxy', 'proxy']) ) if (!proxy) { return null } const parsedProxy = (typeof proxy === 'string') ? new url.URL(proxy) : proxy return !checkNoProxy(uri, opts) && parsedProxy } const getAuth = u => u.username && u.password ? decodeURIComponent(`${u.username}:${u.password}`) : u.username ? decodeURIComponent(u.username) : null const getPath = u => u.pathname + u.search + u.hash const HttpProxyAgent = require('http-proxy-agent') const HttpsProxyAgent = require('https-proxy-agent') const SocksProxyAgent = require('socks-proxy-agent') module.exports.getProxy = getProxy function getProxy (proxyUrl, opts, isHttps) { const popts = { host: proxyUrl.hostname, port: proxyUrl.port, protocol: proxyUrl.protocol, path: getPath(proxyUrl), auth: getAuth(proxyUrl), ca: opts.ca, cert: opts.cert, key: opts.key, timeout: getAgentTimeout(opts.timeout), localAddress: opts.localAddress, maxSockets: getMaxSockets(opts.maxSockets), rejectUnauthorized: opts.rejectUnauthorized, } if (proxyUrl.protocol === 'http:' || proxyUrl.protocol === 'https:') { if (!isHttps) { return new HttpProxyAgent(popts) } else { return new HttpsProxyAgent(popts) } } else if (proxyUrl.protocol.startsWith('socks')) { return new SocksProxyAgent(popts) } else { throw Object.assign( new Error(`unsupported proxy protocol: '${proxyUrl.protocol}'`), { code: 'EUNSUPPORTEDPROXY', url: proxyUrl.href, } ) } } 'use strict' const { FetchError, Request, isRedirect } = require('minipass-fetch') const url = require('url') const CachePolicy = require('./cache/policy.js') const cache = require('./cache/index.js') const remote = require('./remote.js') // given a Request, a Response and user options // return true if the response is a redirect that // can be followed. we throw errors that will result // in the fetch being rejected if the redirect is // possible but invalid for some reason const canFollowRedirect = (request, response, options) => { if (!isRedirect(response.status)) { return false } if (options.redirect === 'manual') { return false } if (options.redirect === 'error') { throw new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect', { code: 'ENOREDIRECT' }) } if (!response.headers.has('location')) { throw new FetchError(`redirect location header missing for: ${request.url}`, 'no-location', { code: 'EINVALIDREDIRECT' }) } if (request.counter >= request.follow) { throw new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect', { code: 'EMAXREDIRECT' }) } return true } // given a Request, a Response, and the user's options return an object // with a new Request and a new options object that will be used for // following the redirect const getRedirect = (request, response, options) => { const _opts = { ...options } const location = response.headers.get('location') const redirectUrl = new url.URL(location, /^https?:/.test(location) ? undefined : request.url) // Comment below is used under the following license: /** * @license * Copyright (c) 2010-2012 Mikeal Rogers * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an "AS * IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language * governing permissions and limitations under the License. */ // Remove authorization if changing hostnames (but not if just // changing ports or protocols). This matches the behavior of request: // https://github.com/request/request/blob/b12a6245/lib/redirect.js#L134-L138 if (new url.URL(request.url).hostname !== redirectUrl.hostname) { request.headers.delete('authorization') request.headers.delete('cookie') } // for POST request with 301/302 response, or any request with 303 response, // use GET when following redirect if ( response.status === 303 || (request.method === 'POST' && [301, 302].includes(response.status)) ) { _opts.method = 'GET' _opts.body = null request.headers.delete('content-length') } _opts.headers = {} request.headers.forEach((value, key) => { _opts.headers[key] = value }) _opts.counter = ++request.counter const redirectReq = new Request(url.format(redirectUrl), _opts) return { request: redirectReq, options: _opts, } } const fetch = async (request, options) => { const response = CachePolicy.storable(request, options) ? await cache(request, options) : await remote(request, options) // if the request wasn't a GET or HEAD, and the response // status is between 200 and 399 inclusive, invalidate the // request url if (!['GET', 'HEAD'].includes(request.method) && response.status >= 200 && response.status <= 399) { await cache.invalidate(request, options) } if (!canFollowRedirect(request, response, options)) { return response } const redirect = getRedirect(request, response, options) return fetch(redirect.request, redirect.options) } module.exports = fetch const { FetchError, Headers, Request, Response } = require('minipass-fetch') const configureOptions = require('./options.js') const fetch = require('./fetch.js') const makeFetchHappen = (url, opts) => { const options = configureOptions(opts) const request = new Request(url, options) return fetch(request, options) } makeFetchHappen.defaults = (defaultUrl, defaultOptions = {}) => { if (typeof defaultUrl === 'object') { defaultOptions = defaultUrl defaultUrl = null } const defaultedFetch = (url, options = {}) => { const finalUrl = url || defaultUrl const finalOptions = { ...defaultOptions, ...options, headers: { ...defaultOptions.headers, ...options.headers, }, } return makeFetchHappen(finalUrl, finalOptions) } defaultedFetch.defaults = makeFetchHappen.defaults return defaultedFetch } module.exports = makeFetchHappen module.exports.FetchError = FetchError module.exports.Headers = Headers module.exports.Request = Request module.exports.Response = Response const conditionalHeaders = [ 'if-modified-since', 'if-none-match', 'if-unmodified-since', 'if-match', 'if-range', ] const configureOptions = (opts) => { const { strictSSL, ...options } = { ...opts } options.method = options.method ? options.method.toUpperCase() : 'GET' options.rejectUnauthorized = strictSSL !== false if (!options.retry) { options.retry = { retries: 0 } } else if (typeof options.retry === 'string') { const retries = parseInt(options.retry, 10) if (isFinite(retries)) { options.retry = { retries } } else { options.retry = { retries: 0 } } } else if (typeof options.retry === 'number') { options.retry = { retries: options.retry } } else { options.retry = { retries: 0, ...options.retry } } options.cache = options.cache || 'default' if (options.cache === 'default') { const hasConditionalHeader = Object.keys(options.headers || {}).some((name) => { return conditionalHeaders.includes(name.toLowerCase()) }) if (hasConditionalHeader) { options.cache = 'no-store' } } // cacheManager is deprecated, but if it's set and // cachePath is not we should copy it to the new field if (options.cacheManager && !options.cachePath) { options.cachePath = options.cacheManager } return options } module.exports = configureOptions const Minipass = require('minipass') const MinipassPipeline = require('minipass-pipeline') const fetch = require('minipass-fetch') const promiseRetry = require('promise-retry') const ssri = require('ssri') const getAgent = require('./agent.js') const pkg = require('../package.json') const USER_AGENT = `${pkg.name}/${pkg.version} (+https://npm.im/${pkg.name})` const RETRY_ERRORS = [ 'ECONNRESET', // remote socket closed on us 'ECONNREFUSED', // remote host refused to open connection 'EADDRINUSE', // failed to bind to a local port (proxy?) 'ETIMEDOUT', // someone in the transaction is WAY TOO SLOW 'ERR_SOCKET_TIMEOUT', // same as above, but this one comes from agentkeepalive // Known codes we do NOT retry on: // ENOTFOUND (getaddrinfo failure. Either bad hostname, or offline) ] const RETRY_TYPES = [ 'request-timeout', ] // make a request directly to the remote source, // retrying certain classes of errors as well as // following redirects (through the cache if necessary) // and verifying response integrity const remoteFetch = (request, options) => { const agent = getAgent(request.url, options) if (!request.headers.has('connection')) { request.headers.set('connection', agent ? 'keep-alive' : 'close') } if (!request.headers.has('user-agent')) { request.headers.set('user-agent', USER_AGENT) } // keep our own options since we're overriding the agent // and the redirect mode const _opts = { ...options, agent, redirect: 'manual', } return promiseRetry(async (retryHandler, attemptNum) => { const req = new fetch.Request(request, _opts) try { let res = await fetch(req, _opts) if (_opts.integrity && res.status === 200) { // we got a 200 response and the user has specified an expected // integrity value, so wrap the response in an ssri stream to verify it const integrityStream = ssri.integrityStream({ integrity: _opts.integrity }) res = new fetch.Response(new MinipassPipeline(res.body, integrityStream), res) } res.headers.set('x-fetch-attempts', attemptNum) // do not retry POST requests, or requests with a streaming body // do retry requests with a 408, 420, 429 or 500+ status in the response const isStream = Minipass.isStream(req.body) const isRetriable = req.method !== 'POST' && !isStream && ([408, 420, 429].includes(res.status) || res.status >= 500) if (isRetriable) { if (typeof options.onRetry === 'function') { options.onRetry(res) } return retryHandler(res) } return res } catch (err) { const code = (err.code === 'EPROMISERETRY') ? err.retried.code : err.code // err.retried will be the thing that was thrown from above // if it's a response, we just got a bad status code and we // can re-throw to allow the retry const isRetryError = err.retried instanceof fetch.Response || (RETRY_ERRORS.includes(code) && RETRY_TYPES.includes(err.type)) if (req.method === 'POST' || isRetryError) { throw err } if (typeof options.onRetry === 'function') { options.onRetry(err) } return retryHandler(err) } }, options.retry).catch((err) => { // don't reject for http errors, just return them if (err.status >= 400 && err.type !== 'system') { return err } throw err }) } module.exports = remoteFetch const { Request, Response } = require('minipass-fetch') const Minipass = require('minipass') const MinipassCollect = require('minipass-collect') const MinipassFlush = require('minipass-flush') const MinipassPipeline = require('minipass-pipeline') const cacache = require('cacache') const url = require('url') const CachePolicy = require('./policy.js') const cacheKey = require('./key.js') const remote = require('../remote.js') const hasOwnProperty = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) // maximum amount of data we will buffer into memory // if we'll exceed this, we switch to streaming const MAX_MEM_SIZE = 5 * 1024 * 1024 // 5MB // allow list for request headers that will be written to the cache index // note: we will also store any request headers // that are named in a response's vary header const KEEP_REQUEST_HEADERS = [ 'accept-charset', 'accept-encoding', 'accept-language', 'accept', 'cache-control', ] // allow list for response headers that will be written to the cache index // note: we must not store the real response's age header, or when we load // a cache policy based on the metadata it will think the cached response // is always stale const KEEP_RESPONSE_HEADERS = [ 'cache-control', 'content-encoding', 'content-language', 'content-type', 'date', 'etag', 'expires', 'last-modified', 'location', 'pragma', 'vary', ] // return an object containing all metadata to be written to the index const getMetadata = (request, response, options) => { const metadata = { time: Date.now(), url: request.url, reqHeaders: {}, resHeaders: {}, // options on which we must match the request and vary the response options: { compress: options.compress != null ? options.compress : request.compress, }, } // only save the status if it's not a 200 or 304 if (response.status !== 200 && response.status !== 304) { metadata.status = response.status } for (const name of KEEP_REQUEST_HEADERS) { if (request.headers.has(name)) { metadata.reqHeaders[name] = request.headers.get(name) } } // if the request's host header differs from the host in the url // we need to keep it, otherwise it's just noise and we ignore it const host = request.headers.get('host') const parsedUrl = new url.URL(request.url) if (host && parsedUrl.host !== host) { metadata.reqHeaders.host = host } // if the response has a vary header, make sure // we store the relevant request headers too if (response.headers.has('vary')) { const vary = response.headers.get('vary') // a vary of "*" means every header causes a different response. // in that scenario, we do not include any additional headers // as the freshness check will always fail anyway and we don't // want to bloat the cache indexes if (vary !== '*') { // copy any other request headers that will vary the response const varyHeaders = vary.trim().toLowerCase().split(/\s*,\s*/) for (const name of varyHeaders) { if (request.headers.has(name)) { metadata.reqHeaders[name] = request.headers.get(name) } } } } for (const name of KEEP_RESPONSE_HEADERS) { if (response.headers.has(name)) { metadata.resHeaders[name] = response.headers.get(name) } } return metadata } // symbols used to hide objects that may be lazily evaluated in a getter const _request = Symbol('request') const _response = Symbol('response') const _policy = Symbol('policy') class CacheEntry { constructor ({ entry, request, response, options }) { if (entry) { this.key = entry.key this.entry = entry // previous versions of this module didn't write an explicit timestamp in // the metadata, so fall back to the entry's timestamp. we can't use the // entry timestamp to determine staleness because cacache will update it // when it verifies its data this.entry.metadata.time = this.entry.metadata.time || this.entry.time } else { this.key = cacheKey(request) } this.options = options // these properties are behind getters that lazily evaluate this[_request] = request this[_response] = response this[_policy] = null } // returns a CacheEntry instance that satisfies the given request // or undefined if no existing entry satisfies static async find (request, options) { try { // compacts the index and returns an array of unique entries var matches = await cacache.index.compact(options.cachePath, cacheKey(request), (A, B) => { const entryA = new CacheEntry({ entry: A, options }) const entryB = new CacheEntry({ entry: B, options }) return entryA.policy.satisfies(entryB.request) }, { validateEntry: (entry) => { // clean out entries with a buggy content-encoding value if (entry.metadata && entry.metadata.resHeaders && entry.metadata.resHeaders['content-encoding'] === null) { return false } // if an integrity is null, it needs to have a status specified if (entry.integrity === null) { return !!(entry.metadata && entry.metadata.status) } return true }, }) } catch (err) { // if the compact request fails, ignore the error and return return } // a cache mode of 'reload' means to behave as though we have no cache // on the way to the network. return undefined to allow cacheFetch to // create a brand new request no matter what. if (options.cache === 'reload') { return } // find the specific entry that satisfies the request let match for (const entry of matches) { const _entry = new CacheEntry({ entry, options, }) if (_entry.policy.satisfies(request)) { match = _entry break } } return match } // if the user made a PUT/POST/PATCH then we invalidate our // cache for the same url by deleting the index entirely static async invalidate (request, options) { const key = cacheKey(request) try { await cacache.rm.entry(options.cachePath, key, { removeFully: true }) } catch (err) { // ignore errors } } get request () { if (!this[_request]) { this[_request] = new Request(this.entry.metadata.url, { method: 'GET', headers: this.entry.metadata.reqHeaders, ...this.entry.metadata.options, }) } return this[_request] } get response () { if (!this[_response]) { this[_response] = new Response(null, { url: this.entry.metadata.url, counter: this.options.counter, status: this.entry.metadata.status || 200, headers: { ...this.entry.metadata.resHeaders, 'content-length': this.entry.size, }, }) } return this[_response] } get policy () { if (!this[_policy]) { this[_policy] = new CachePolicy({ entry: this.entry, request: this.request, response: this.response, options: this.options, }) } return this[_policy] } // wraps the response in a pipeline that stores the data // in the cache while the user consumes it async store (status) { // if we got a status other than 200, 301, or 308, // or the CachePolicy forbid storage, append the // cache status header and return it untouched if ( this.request.method !== 'GET' || ![200, 301, 308].includes(this.response.status) || !this.policy.storable() ) { this.response.headers.set('x-local-cache-status', 'skip') return this.response } const size = this.response.headers.get('content-length') const fitsInMemory = !!size && Number(size) < MAX_MEM_SIZE const shouldBuffer = this.options.memoize !== false && fitsInMemory const cacheOpts = { algorithms: this.options.algorithms, metadata: getMetadata(this.request, this.response, this.options), size, memoize: fitsInMemory && this.options.memoize, } let body = null // we only set a body if the status is a 200, redirects are // stored as metadata only if (this.response.status === 200) { let cacheWriteResolve, cacheWriteReject const cacheWritePromise = new Promise((resolve, reject) => { cacheWriteResolve = resolve cacheWriteReject = reject }) body = new MinipassPipeline(new MinipassFlush({ flush () { return cacheWritePromise }, })) let abortStream, onResume if (shouldBuffer) { // if the result fits in memory, use a collect stream to gather // the response and write it to cacache while also passing it through // to the user onResume = () => { const collector = new MinipassCollect.PassThrough() abortStream = collector collector.on('collect', (data) => { // TODO if the cache write fails, log a warning but return the response anyway cacache.put(this.options.cachePath, this.key, data, cacheOpts) .then(cacheWriteResolve, cacheWriteReject) }) body.unshift(collector) body.unshift(this.response.body) } } else { // if it does not fit in memory, create a tee stream and use // that to pipe to both the cache and the user simultaneously onResume = () => { const tee = new Minipass() const cacheStream = cacache.put.stream(this.options.cachePath, this.key, cacheOpts) abortStream = cacheStream tee.pipe(cacheStream) // TODO if the cache write fails, log a warning but return the response anyway cacheStream.promise().then(cacheWriteResolve, cacheWriteReject) body.unshift(tee) body.unshift(this.response.body) } } body.once('resume', onResume) body.once('end', () => body.removeListener('resume', onResume)) this.response.body.on('error', (err) => { // the abortStream will either be a MinipassCollect if we buffer // or a cacache write stream, either way be sure to listen for // errors from the actual response and avoid writing data that we // know to be invalid to the cache abortStream.destroy(err) }) } else { await cacache.index.insert(this.options.cachePath, this.key, null, cacheOpts) } // note: we do not set the x-local-cache-hash header because we do not know // the hash value until after the write to the cache completes, which doesn't // happen until after the response has been sent and it's too late to write // the header anyway this.response.headers.set('x-local-cache', encodeURIComponent(this.options.cachePath)) this.response.headers.set('x-local-cache-key', encodeURIComponent(this.key)) this.response.headers.set('x-local-cache-mode', shouldBuffer ? 'buffer' : 'stream') this.response.headers.set('x-local-cache-status', status) this.response.headers.set('x-local-cache-time', new Date().toISOString()) const newResponse = new Response(body, { url: this.response.url, status: this.response.status, headers: this.response.headers, counter: this.options.counter, }) return newResponse } // use the cached data to create a response and return it async respond (method, options, status) { let response const size = Number(this.response.headers.get('content-length')) const fitsInMemory = !!size && size < MAX_MEM_SIZE const shouldBuffer = this.options.memoize !== false && fitsInMemory if (method === 'HEAD' || [301, 308].includes(this.response.status)) { // if the request is a HEAD, or the response is a redirect, // then the metadata in the entry already includes everything // we need to build a response response = this.response } else { // we're responding with a full cached response, so create a body // that reads from cacache and attach it to a new Response const body = new Minipass() const removeOnResume = () => body.removeListener('resume', onResume) let onResume if (shouldBuffer) { onResume = async () => { removeOnResume() try { const content = await cacache.get.byDigest( this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize } ) body.end(content) } catch (err) { if (err.code === 'EINTEGRITY') { await cacache.rm.content( this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize } ) } if (err.code === 'ENOENT' || err.code === 'EINTEGRITY') { await CacheEntry.invalidate(this.request, this.options) } body.emit('error', err) } } } else { onResume = () => { const cacheStream = cacache.get.stream.byDigest( this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize } ) cacheStream.on('error', async (err) => { cacheStream.pause() if (err.code === 'EINTEGRITY') { await cacache.rm.content( this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize } ) } if (err.code === 'ENOENT' || err.code === 'EINTEGRITY') { await CacheEntry.invalidate(this.request, this.options) } body.emit('error', err) cacheStream.resume() }) cacheStream.pipe(body) } } body.once('resume', onResume) body.once('end', removeOnResume) response = new Response(body, { url: this.entry.metadata.url, counter: options.counter, status: 200, headers: { ...this.policy.responseHeaders(), }, }) } response.headers.set('x-local-cache', encodeURIComponent(this.options.cachePath)) response.headers.set('x-local-cache-hash', encodeURIComponent(this.entry.integrity)) response.headers.set('x-local-cache-key', encodeURIComponent(this.key)) response.headers.set('x-local-cache-mode', shouldBuffer ? 'buffer' : 'stream') response.headers.set('x-local-cache-status', status) response.headers.set('x-local-cache-time', new Date(this.entry.metadata.time).toUTCString()) return response } // use the provided request along with this cache entry to // revalidate the stored response. returns a response, either // from the cache or from the update async revalidate (request, options) { const revalidateRequest = new Request(request, { headers: this.policy.revalidationHeaders(request), }) try { // NOTE: be sure to remove the headers property from the // user supplied options, since we have already defined // them on the new request object. if they're still in the // options then those will overwrite the ones from the policy var response = await remote(revalidateRequest, { ...options, headers: undefined, }) } catch (err) { // if the network fetch fails, return the stale // cached response unless it has a cache-control // of 'must-revalidate' if (!this.policy.mustRevalidate) { return this.respond(request.method, options, 'stale') } throw err } if (this.policy.revalidated(revalidateRequest, response)) { // we got a 304, write a new index to the cache and respond from cache const metadata = getMetadata(request, response, options) // 304 responses do not include headers that are specific to the response data // since they do not include a body, so we copy values for headers that were // in the old cache entry to the new one, if the new metadata does not already // include that header for (const name of KEEP_RESPONSE_HEADERS) { if ( !hasOwnProperty(metadata.resHeaders, name) && hasOwnProperty(this.entry.metadata.resHeaders, name) ) { metadata.resHeaders[name] = this.entry.metadata.resHeaders[name] } } try { await cacache.index.insert(options.cachePath, this.key, this.entry.integrity, { size: this.entry.size, metadata, }) } catch (err) { // if updating the cache index fails, we ignore it and // respond anyway } return this.respond(request.method, options, 'revalidated') } // if we got a modified response, create a new entry based on it const newEntry = new CacheEntry({ request, response, options, }) // respond with the new entry while writing it to the cache return newEntry.store('updated') } } module.exports = CacheEntry class NotCachedError extends Error { constructor (url) { /* eslint-disable-next-line max-len */ super(`request to ${url} failed: cache mode is 'only-if-cached' but no cached response is available.`) this.code = 'ENOTCACHED' } } module.exports = { NotCachedError, } const { NotCachedError } = require('./errors.js') const CacheEntry = require('./entry.js') const remote = require('../remote.js') // do whatever is necessary to get a Response and return it const cacheFetch = async (request, options) => { // try to find a cached entry that satisfies this request const entry = await CacheEntry.find(request, options) if (!entry) { // no cached result, if the cache mode is 'only-if-cached' that's a failure if (options.cache === 'only-if-cached') { throw new NotCachedError(request.url) } // otherwise, we make a request, store it and return it const response = await remote(request, options) const entry = new CacheEntry({ request, response, options }) return entry.store('miss') } // we have a cached response that satisfies this request, however if the cache // mode is 'no-cache' then we send the revalidation request no matter what if (options.cache === 'no-cache') { return entry.revalidate(request, options) } // if the cached entry is not stale, or if the cache mode is 'force-cache' or // 'only-if-cached' we can respond with the cached entry. set the status // based on the result of needsRevalidation and respond const _needsRevalidation = entry.policy.needsRevalidation(request) if (options.cache === 'force-cache' || options.cache === 'only-if-cached' || !_needsRevalidation) { return entry.respond(request.method, options, _needsRevalidation ? 'stale' : 'hit') } // if we got here, the cache entry is stale so revalidate it return entry.revalidate(request, options) } cacheFetch.invalidate = async (request, options) => { if (!options.cachePath) { return } return CacheEntry.invalidate(request, options) } module.exports = cacheFetch const { URL, format } = require('url') // options passed to url.format() when generating a key const formatOptions = { auth: false, fragment: false, search: true, unicode: false, } // returns a string to be used as the cache key for the Request const cacheKey = (request) => { const parsed = new URL(request.url) return `make-fetch-happen:request-cache:${format(parsed, formatOptions)}` } module.exports = cacheKey const CacheSemantics = require('http-cache-semantics') const Negotiator = require('negotiator') const ssri = require('ssri') // options passed to http-cache-semantics constructor const policyOptions = { shared: false, ignoreCargoCult: true, } // a fake empty response, used when only testing the // request for storability const emptyResponse = { status: 200, headers: {} } // returns a plain object representation of the Request const requestObject = (request) => { const _obj = { method: request.method, url: request.url, headers: {}, compress: request.compress, } request.headers.forEach((value, key) => { _obj.headers[key] = value }) return _obj } // returns a plain object representation of the Response const responseObject = (response) => { const _obj = { status: response.status, headers: {}, } response.headers.forEach((value, key) => { _obj.headers[key] = value }) return _obj } class CachePolicy { constructor ({ entry, request, response, options }) { this.entry = entry this.request = requestObject(request) this.response = responseObject(response) this.options = options this.policy = new CacheSemantics(this.request, this.response, policyOptions) if (this.entry) { // if we have an entry, copy the timestamp to the _responseTime // this is necessary because the CacheSemantics constructor forces // the value to Date.now() which means a policy created from a // cache entry is likely to always identify itself as stale this.policy._responseTime = this.entry.metadata.time } } // static method to quickly determine if a request alone is storable static storable (request, options) { // no cachePath means no caching if (!options.cachePath) { return false } // user explicitly asked not to cache if (options.cache === 'no-store') { return false } // we only cache GET and HEAD requests if (!['GET', 'HEAD'].includes(request.method)) { return false } // otherwise, let http-cache-semantics make the decision // based on the request's headers const policy = new CacheSemantics(requestObject(request), emptyResponse, policyOptions) return policy.storable() } // returns true if the policy satisfies the request satisfies (request) { const _req = requestObject(request) if (this.request.headers.host !== _req.headers.host) { return false } if (this.request.compress !== _req.compress) { return false } const negotiatorA = new Negotiator(this.request) const negotiatorB = new Negotiator(_req) if (JSON.stringify(negotiatorA.mediaTypes()) !== JSON.stringify(negotiatorB.mediaTypes())) { return false } if (JSON.stringify(negotiatorA.languages()) !== JSON.stringify(negotiatorB.languages())) { return false } if (JSON.stringify(negotiatorA.encodings()) !== JSON.stringify(negotiatorB.encodings())) { return false } if (this.options.integrity) { return ssri.parse(this.options.integrity).match(this.entry.integrity) } return true } // returns true if the request and response allow caching storable () { return this.policy.storable() } // NOTE: this is a hack to avoid parsing the cache-control // header ourselves, it returns true if the response's // cache-control contains must-revalidate get mustRevalidate () { return !!this.policy._rescc['must-revalidate'] } // returns true if the cached response requires revalidation // for the given request needsRevalidation (request) { const _req = requestObject(request) // force method to GET because we only cache GETs // but can serve a HEAD from a cached GET _req.method = 'GET' return !this.policy.satisfiesWithoutRevalidation(_req) } responseHeaders () { return this.policy.responseHeaders() } // returns a new object containing the appropriate headers // to send a revalidation request revalidationHeaders (request) { const _req = requestObject(request) return this.policy.revalidationHeaders(_req) } // returns true if the request/response was revalidated // successfully. returns false if a new response was received revalidated (request, response) { const _req = requestObject(request) const _res = responseObject(response) const policy = this.policy.revalidatedPolicy(_req, _res) return !policy.modified } } module.exports = CachePolicy ISC License Copyright (c) npm, Inc. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "cacache", "version": "16.0.2", "cache-version": { "content": "2", "index": "5" }, "description": "Fast, fault-tolerant, cross-platform, disk-based, data-agnostic, content-addressable cache.", "main": "lib/index.js", "files": [ "bin", "lib" ], "scripts": { "benchmarks": "node test/benchmarks", "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", "test": "tap", "snap": "tap", "coverage": "tap", "test-docker": "docker run -it --rm --name pacotest -v \"$PWD\":/tmp -w /tmp node:latest npm test", "lint": "eslint '**/*.js'", "npmclilint": "npmcli-lint", "lintfix": "npm run lint -- --fix", "postsnap": "npm run lintfix --", "postlint": "npm-template-check", "template-copy": "npm-template-copy --force", "posttest": "npm run lint" }, "repository": "https://github.com/npm/cacache", "keywords": [ "cache", "caching", "content-addressable", "sri", "sri hash", "subresource integrity", "cache", "storage", "store", "file store", "filesystem", "disk cache", "disk storage" ], "license": "ISC", "dependencies": { "@npmcli/fs": "^1.0.0", "@npmcli/move-file": "^1.1.2", "chownr": "^2.0.0", "fs-minipass": "^2.1.0", "glob": "^7.2.0", "infer-owner": "^1.0.4", "lru-cache": "^7.5.1", "minipass": "^3.1.6", "minipass-collect": "^1.0.2", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", "mkdirp": "^1.0.4", "p-map": "^4.0.0", "promise-inflight": "^1.0.1", "rimraf": "^3.0.2", "ssri": "^8.0.1", "tar": "^6.1.11", "unique-filename": "^1.1.1" }, "devDependencies": { "@npmcli/template-oss": "^2.9.2", "benchmark": "^2.1.4", "chalk": "^4.1.2", "require-inject": "^1.4.4", "tacks": "^1.3.0", "tap": "^15.0.9" }, "tap": { "100": true, "test-regex": "test/[^/]*.js" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16" }, "templateOSS": { "windowsCI": false, "version": "2.9.2" }, "author": "GitHub Inc." } (The MIT License) Copyright (c) 2014 TJ Holowaychuk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "debug", "version": "4.1.1", "repository": { "type": "git", "url": "git://github.com/visionmedia/debug.git" }, "description": "small debugging utility", "keywords": [ "debug", "log", "debugger" ], "files": [ "src", "dist/debug.js", "LICENSE", "README.md" ], "author": "TJ Holowaychuk ", "contributors": [ "Nathan Rajlich (http://n8.io)", "Andrew Rhyne " ], "license": "MIT", "scripts": { "lint": "xo", "test": "npm run test:node && npm run test:browser", "test:node": "istanbul cover _mocha -- test.js", "pretest:browser": "npm run build", "test:browser": "karma start --single-run", "prebuild:debug": "mkdir -p dist && browserify --standalone debug -o dist/debug.es6.js .", "build:debug": "babel -o dist/debug.js dist/debug.es6.js > dist/debug.js", "build:test": "babel -d dist test.js", "build": "npm run build:debug && npm run build:test", "clean": "rimraf dist coverage", "test:coverage": "cat ./coverage/lcov.info | coveralls" }, "dependencies": { "ms": "^2.1.1" }, "devDependencies": { "@babel/cli": "^7.0.0", "@babel/core": "^7.0.0", "@babel/preset-env": "^7.0.0", "browserify": "14.4.0", "chai": "^3.5.0", "concurrently": "^3.1.0", "coveralls": "^3.0.2", "istanbul": "^0.4.5", "karma": "^3.0.0", "karma-chai": "^0.1.0", "karma-mocha": "^1.3.0", "karma-phantomjs-launcher": "^1.0.2", "mocha": "^5.2.0", "mocha-lcov-reporter": "^1.2.0", "rimraf": "^2.5.4", "xo": "^0.23.0" }, "main": "./src/index.js", "browser": "./src/browser.js", "unpkg": "./dist/debug.js" } exports.setopts = setopts exports.ownProp = ownProp exports.makeAbs = makeAbs exports.finish = finish exports.mark = mark exports.isIgnored = isIgnored exports.childrenIgnored = childrenIgnored function ownProp (obj, field) { return Object.prototype.hasOwnProperty.call(obj, field) } var fs = require("fs") var path = require("path") var minimatch = require("minimatch") var isAbsolute = require("path-is-absolute") var Minimatch = minimatch.Minimatch function alphasort (a, b) { return a.localeCompare(b, 'en') } function setupIgnores (self, options) { self.ignore = options.ignore || [] if (!Array.isArray(self.ignore)) self.ignore = [self.ignore] if (self.ignore.length) { self.ignore = self.ignore.map(ignoreMap) } } // ignore patterns are always in dot:true mode. function ignoreMap (pattern) { var gmatcher = null if (pattern.slice(-3) === '/**') { var gpattern = pattern.replace(/(\/\*\*)+$/, '') gmatcher = new Minimatch(gpattern, { dot: true }) } return { matcher: new Minimatch(pattern, { dot: true }), gmatcher: gmatcher } } function setopts (self, pattern, options) { if (!options) options = {} // base-matching: just use globstar for that. if (options.matchBase && -1 === pattern.indexOf("/")) { if (options.noglobstar) { throw new Error("base matching requires globstar") } pattern = "**/" + pattern } self.silent = !!options.silent self.pattern = pattern self.strict = options.strict !== false self.realpath = !!options.realpath self.realpathCache = options.realpathCache || Object.create(null) self.follow = !!options.follow self.dot = !!options.dot self.mark = !!options.mark self.nodir = !!options.nodir if (self.nodir) self.mark = true self.sync = !!options.sync self.nounique = !!options.nounique self.nonull = !!options.nonull self.nosort = !!options.nosort self.nocase = !!options.nocase self.stat = !!options.stat self.noprocess = !!options.noprocess self.absolute = !!options.absolute self.fs = options.fs || fs self.maxLength = options.maxLength || Infinity self.cache = options.cache || Object.create(null) self.statCache = options.statCache || Object.create(null) self.symlinks = options.symlinks || Object.create(null) setupIgnores(self, options) self.changedCwd = false var cwd = process.cwd() if (!ownProp(options, "cwd")) self.cwd = cwd else { self.cwd = path.resolve(options.cwd) self.changedCwd = self.cwd !== cwd } self.root = options.root || path.resolve(self.cwd, "/") self.root = path.resolve(self.root) if (process.platform === "win32") self.root = self.root.replace(/\\/g, "/") // TODO: is an absolute `cwd` supposed to be resolved against `root`? // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) if (process.platform === "win32") self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") self.nomount = !!options.nomount // disable comments and negation in Minimatch. // Note that they are not supported in Glob itself anyway. options.nonegate = true options.nocomment = true self.minimatch = new Minimatch(pattern, options) self.options = self.minimatch.options } function finish (self) { var nou = self.nounique var all = nou ? [] : Object.create(null) for (var i = 0, l = self.matches.length; i < l; i ++) { var matches = self.matches[i] if (!matches || Object.keys(matches).length === 0) { if (self.nonull) { // do like the shell, and spit out the literal glob var literal = self.minimatch.globSet[i] if (nou) all.push(literal) else all[literal] = true } } else { // had matches var m = Object.keys(matches) if (nou) all.push.apply(all, m) else m.forEach(function (m) { all[m] = true }) } } if (!nou) all = Object.keys(all) if (!self.nosort) all = all.sort(alphasort) // at *some* point we statted all of these if (self.mark) { for (var i = 0; i < all.length; i++) { all[i] = self._mark(all[i]) } if (self.nodir) { all = all.filter(function (e) { var notDir = !(/\/$/.test(e)) var c = self.cache[e] || self.cache[makeAbs(self, e)] if (notDir && c) notDir = c !== 'DIR' && !Array.isArray(c) return notDir }) } } if (self.ignore.length) all = all.filter(function(m) { return !isIgnored(self, m) }) self.found = all } function mark (self, p) { var abs = makeAbs(self, p) var c = self.cache[abs] var m = p if (c) { var isDir = c === 'DIR' || Array.isArray(c) var slash = p.slice(-1) === '/' if (isDir && !slash) m += '/' else if (!isDir && slash) m = m.slice(0, -1) if (m !== p) { var mabs = makeAbs(self, m) self.statCache[mabs] = self.statCache[abs] self.cache[mabs] = self.cache[abs] } } return m } // lotta situps... function makeAbs (self, f) { var abs = f if (f.charAt(0) === '/') { abs = path.join(self.root, f) } else if (isAbsolute(f) || f === '') { abs = f } else if (self.changedCwd) { abs = path.resolve(self.cwd, f) } else { abs = path.resolve(f) } if (process.platform === 'win32') abs = abs.replace(/\\/g, '/') return abs } // Return true, if pattern ends with globstar '**', for the accompanying parent directory. // Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents function isIgnored (self, path) { if (!self.ignore.length) return false return self.ignore.some(function(item) { return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) }) } function childrenIgnored (self, path) { if (!self.ignore.length) return false return self.ignore.some(function(item) { return !!(item.gmatcher && item.gmatcher.match(path)) }) } // Approach: // // 1. Get the minimatch set // 2. For each pattern in the set, PROCESS(pattern, false) // 3. Store matches per-set, then uniq them // // PROCESS(pattern, inGlobStar) // Get the first [n] items from pattern that are all strings // Join these together. This is PREFIX. // If there is no more remaining, then stat(PREFIX) and // add to matches if it succeeds. END. // // If inGlobStar and PREFIX is symlink and points to dir // set ENTRIES = [] // else readdir(PREFIX) as ENTRIES // If fail, END // // with ENTRIES // If pattern[n] is GLOBSTAR // // handle the case where the globstar match is empty // // by pruning it out, and testing the resulting pattern // PROCESS(pattern[0..n] + pattern[n+1 .. $], false) // // handle other cases. // for ENTRY in ENTRIES (not dotfiles) // // attach globstar + tail onto the entry // // Mark that this entry is a globstar match // PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) // // else // not globstar // for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) // Test ENTRY against pattern[n] // If fails, continue // If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) // // Caveat: // Cache all stats and readdirs results to minimize syscall. Since all // we ever care about is existence and directory-ness, we can just keep // `true` for files, and [children,...] for directories, or `false` for // things that don't exist. module.exports = glob var rp = require('fs.realpath') var minimatch = require('minimatch') var Minimatch = minimatch.Minimatch var inherits = require('inherits') var EE = require('events').EventEmitter var path = require('path') var assert = require('assert') var isAbsolute = require('path-is-absolute') var globSync = require('./sync.js') var common = require('./common.js') var setopts = common.setopts var ownProp = common.ownProp var inflight = require('inflight') var util = require('util') var childrenIgnored = common.childrenIgnored var isIgnored = common.isIgnored var once = require('once') function glob (pattern, options, cb) { if (typeof options === 'function') cb = options, options = {} if (!options) options = {} if (options.sync) { if (cb) throw new TypeError('callback provided to sync glob') return globSync(pattern, options) } return new Glob(pattern, options, cb) } glob.sync = globSync var GlobSync = glob.GlobSync = globSync.GlobSync // old api surface glob.glob = glob function extend (origin, add) { if (add === null || typeof add !== 'object') { return origin } var keys = Object.keys(add) var i = keys.length while (i--) { origin[keys[i]] = add[keys[i]] } return origin } glob.hasMagic = function (pattern, options_) { var options = extend({}, options_) options.noprocess = true var g = new Glob(pattern, options) var set = g.minimatch.set if (!pattern) return false if (set.length > 1) return true for (var j = 0; j < set[0].length; j++) { if (typeof set[0][j] !== 'string') return true } return false } glob.Glob = Glob inherits(Glob, EE) function Glob (pattern, options, cb) { if (typeof options === 'function') { cb = options options = null } if (options && options.sync) { if (cb) throw new TypeError('callback provided to sync glob') return new GlobSync(pattern, options) } if (!(this instanceof Glob)) return new Glob(pattern, options, cb) setopts(this, pattern, options) this._didRealPath = false // process each pattern in the minimatch set var n = this.minimatch.set.length // The matches are stored as {: true,...} so that // duplicates are automagically pruned. // Later, we do an Object.keys() on these. // Keep them as a list so we can fill in when nonull is set. this.matches = new Array(n) if (typeof cb === 'function') { cb = once(cb) this.on('error', cb) this.on('end', function (matches) { cb(null, matches) }) } var self = this this._processing = 0 this._emitQueue = [] this._processQueue = [] this.paused = false if (this.noprocess) return this if (n === 0) return done() var sync = true for (var i = 0; i < n; i ++) { this._process(this.minimatch.set[i], i, false, done) } sync = false function done () { --self._processing if (self._processing <= 0) { if (sync) { process.nextTick(function () { self._finish() }) } else { self._finish() } } } } Glob.prototype._finish = function () { assert(this instanceof Glob) if (this.aborted) return if (this.realpath && !this._didRealpath) return this._realpath() common.finish(this) this.emit('end', this.found) } Glob.prototype._realpath = function () { if (this._didRealpath) return this._didRealpath = true var n = this.matches.length if (n === 0) return this._finish() var self = this for (var i = 0; i < this.matches.length; i++) this._realpathSet(i, next) function next () { if (--n === 0) self._finish() } } Glob.prototype._realpathSet = function (index, cb) { var matchset = this.matches[index] if (!matchset) return cb() var found = Object.keys(matchset) var self = this var n = found.length if (n === 0) return cb() var set = this.matches[index] = Object.create(null) found.forEach(function (p, i) { // If there's a problem with the stat, then it means that // one or more of the links in the realpath couldn't be // resolved. just return the abs value in that case. p = self._makeAbs(p) rp.realpath(p, self.realpathCache, function (er, real) { if (!er) set[real] = true else if (er.syscall === 'stat') set[p] = true else self.emit('error', er) // srsly wtf right here if (--n === 0) { self.matches[index] = set cb() } }) }) } Glob.prototype._mark = function (p) { return common.mark(this, p) } Glob.prototype._makeAbs = function (f) { return common.makeAbs(this, f) } Glob.prototype.abort = function () { this.aborted = true this.emit('abort') } Glob.prototype.pause = function () { if (!this.paused) { this.paused = true this.emit('pause') } } Glob.prototype.resume = function () { if (this.paused) { this.emit('resume') this.paused = false if (this._emitQueue.length) { var eq = this._emitQueue.slice(0) this._emitQueue.length = 0 for (var i = 0; i < eq.length; i ++) { var e = eq[i] this._emitMatch(e[0], e[1]) } } if (this._processQueue.length) { var pq = this._processQueue.slice(0) this._processQueue.length = 0 for (var i = 0; i < pq.length; i ++) { var p = pq[i] this._processing-- this._process(p[0], p[1], p[2], p[3]) } } } } Glob.prototype._process = function (pattern, index, inGlobStar, cb) { assert(this instanceof Glob) assert(typeof cb === 'function') if (this.aborted) return this._processing++ if (this.paused) { this._processQueue.push([pattern, index, inGlobStar, cb]) return } //console.error('PROCESS %d', this._processing, pattern) // Get the first [n] parts of pattern that are all strings. var n = 0 while (typeof pattern[n] === 'string') { n ++ } // now n is the index of the first one that is *not* a string. // see if there's anything else var prefix switch (n) { // if not, then this is rather simple case pattern.length: this._processSimple(pattern.join('/'), index, cb) return case 0: // pattern *starts* with some non-trivial item. // going to readdir(cwd), but not include the prefix in matches. prefix = null break default: // pattern has some string bits in the front. // whatever it starts with, whether that's 'absolute' like /foo/bar, // or 'relative' like '../baz' prefix = pattern.slice(0, n).join('/') break } var remain = pattern.slice(n) // get the list of entries. var read if (prefix === null) read = '.' else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { if (!prefix || !isAbsolute(prefix)) prefix = '/' + prefix read = prefix } else read = prefix var abs = this._makeAbs(read) //if ignored, skip _processing if (childrenIgnored(this, read)) return cb() var isGlobStar = remain[0] === minimatch.GLOBSTAR if (isGlobStar) this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) else this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) } Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { var self = this this._readdir(abs, inGlobStar, function (er, entries) { return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) }) } Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { // if the abs isn't a dir, then nothing can match! if (!entries) return cb() // It will only match dot entries if it starts with a dot, or if // dot is set. Stuff like @(.foo|.bar) isn't allowed. var pn = remain[0] var negate = !!this.minimatch.negate var rawGlob = pn._glob var dotOk = this.dot || rawGlob.charAt(0) === '.' var matchedEntries = [] for (var i = 0; i < entries.length; i++) { var e = entries[i] if (e.charAt(0) !== '.' || dotOk) { var m if (negate && !prefix) { m = !e.match(pn) } else { m = e.match(pn) } if (m) matchedEntries.push(e) } } //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) var len = matchedEntries.length // If there are no matched entries, then nothing matches. if (len === 0) return cb() // if this is the last remaining pattern bit, then no need for // an additional stat *unless* the user has specified mark or // stat explicitly. We know they exist, since readdir returned // them. if (remain.length === 1 && !this.mark && !this.stat) { if (!this.matches[index]) this.matches[index] = Object.create(null) for (var i = 0; i < len; i ++) { var e = matchedEntries[i] if (prefix) { if (prefix !== '/') e = prefix + '/' + e else e = prefix + e } if (e.charAt(0) === '/' && !this.nomount) { e = path.join(this.root, e) } this._emitMatch(index, e) } // This was the last one, and no stats were needed return cb() } // now test all matched entries as stand-ins for that part // of the pattern. remain.shift() for (var i = 0; i < len; i ++) { var e = matchedEntries[i] var newPattern if (prefix) { if (prefix !== '/') e = prefix + '/' + e else e = prefix + e } this._process([e].concat(remain), index, inGlobStar, cb) } cb() } Glob.prototype._emitMatch = function (index, e) { if (this.aborted) return if (isIgnored(this, e)) return if (this.paused) { this._emitQueue.push([index, e]) return } var abs = isAbsolute(e) ? e : this._makeAbs(e) if (this.mark) e = this._mark(e) if (this.absolute) e = abs if (this.matches[index][e]) return if (this.nodir) { var c = this.cache[abs] if (c === 'DIR' || Array.isArray(c)) return } this.matches[index][e] = true var st = this.statCache[abs] if (st) this.emit('stat', e, st) this.emit('match', e) } Glob.prototype._readdirInGlobStar = function (abs, cb) { if (this.aborted) return // follow all symlinked directories forever // just proceed as if this is a non-globstar situation if (this.follow) return this._readdir(abs, false, cb) var lstatkey = 'lstat\0' + abs var self = this var lstatcb = inflight(lstatkey, lstatcb_) if (lstatcb) self.fs.lstat(abs, lstatcb) function lstatcb_ (er, lstat) { if (er && er.code === 'ENOENT') return cb() var isSym = lstat && lstat.isSymbolicLink() self.symlinks[abs] = isSym // If it's not a symlink or a dir, then it's definitely a regular file. // don't bother doing a readdir in that case. if (!isSym && lstat && !lstat.isDirectory()) { self.cache[abs] = 'FILE' cb() } else self._readdir(abs, false, cb) } } Glob.prototype._readdir = function (abs, inGlobStar, cb) { if (this.aborted) return cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) if (!cb) return //console.error('RD %j %j', +inGlobStar, abs) if (inGlobStar && !ownProp(this.symlinks, abs)) return this._readdirInGlobStar(abs, cb) if (ownProp(this.cache, abs)) { var c = this.cache[abs] if (!c || c === 'FILE') return cb() if (Array.isArray(c)) return cb(null, c) } var self = this self.fs.readdir(abs, readdirCb(this, abs, cb)) } function readdirCb (self, abs, cb) { return function (er, entries) { if (er) self._readdirError(abs, er, cb) else self._readdirEntries(abs, entries, cb) } } Glob.prototype._readdirEntries = function (abs, entries, cb) { if (this.aborted) return // if we haven't asked to stat everything, then just // assume that everything in there exists, so we can avoid // having to stat it a second time. if (!this.mark && !this.stat) { for (var i = 0; i < entries.length; i ++) { var e = entries[i] if (abs === '/') e = abs + e else e = abs + '/' + e this.cache[e] = true } } this.cache[abs] = entries return cb(null, entries) } Glob.prototype._readdirError = function (f, er, cb) { if (this.aborted) return // handle errors, and cache the information switch (er.code) { case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 case 'ENOTDIR': // totally normal. means it *does* exist. var abs = this._makeAbs(f) this.cache[abs] = 'FILE' if (abs === this.cwdAbs) { var error = new Error(er.code + ' invalid cwd ' + this.cwd) error.path = this.cwd error.code = er.code this.emit('error', error) this.abort() } break case 'ENOENT': // not terribly unusual case 'ELOOP': case 'ENAMETOOLONG': case 'UNKNOWN': this.cache[this._makeAbs(f)] = false break default: // some unusual error. Treat as failure. this.cache[this._makeAbs(f)] = false if (this.strict) { this.emit('error', er) // If the error is handled, then we abort // if not, we threw out of here this.abort() } if (!this.silent) console.error('glob error', er) break } return cb() } Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { var self = this this._readdir(abs, inGlobStar, function (er, entries) { self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) }) } Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { //console.error('pgs2', prefix, remain[0], entries) // no entries means not a dir, so it can never have matches // foo.txt/** doesn't match foo.txt if (!entries) return cb() // test without the globstar, and with every child both below // and replacing the globstar. var remainWithoutGlobStar = remain.slice(1) var gspref = prefix ? [ prefix ] : [] var noGlobStar = gspref.concat(remainWithoutGlobStar) // the noGlobStar pattern exits the inGlobStar state this._process(noGlobStar, index, false, cb) var isSym = this.symlinks[abs] var len = entries.length // If it's a symlink, and we're in a globstar, then stop if (isSym && inGlobStar) return cb() for (var i = 0; i < len; i++) { var e = entries[i] if (e.charAt(0) === '.' && !this.dot) continue // these two cases enter the inGlobStar state var instead = gspref.concat(entries[i], remainWithoutGlobStar) this._process(instead, index, true, cb) var below = gspref.concat(entries[i], remain) this._process(below, index, true, cb) } cb() } Glob.prototype._processSimple = function (prefix, index, cb) { // XXX review this. Shouldn't it be doing the mounting etc // before doing stat? kinda weird? var self = this this._stat(prefix, function (er, exists) { self._processSimple2(prefix, index, er, exists, cb) }) } Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { //console.error('ps2', prefix, exists) if (!this.matches[index]) this.matches[index] = Object.create(null) // If it doesn't exist, then just mark the lack of results if (!exists) return cb() if (prefix && isAbsolute(prefix) && !this.nomount) { var trail = /[\/\\]$/.test(prefix) if (prefix.charAt(0) === '/') { prefix = path.join(this.root, prefix) } else { prefix = path.resolve(this.root, prefix) if (trail) prefix += '/' } } if (process.platform === 'win32') prefix = prefix.replace(/\\/g, '/') // Mark this as a match this._emitMatch(index, prefix) cb() } // Returns either 'DIR', 'FILE', or false Glob.prototype._stat = function (f, cb) { var abs = this._makeAbs(f) var needDir = f.slice(-1) === '/' if (f.length > this.maxLength) return cb() if (!this.stat && ownProp(this.cache, abs)) { var c = this.cache[abs] if (Array.isArray(c)) c = 'DIR' // It exists, but maybe not how we need it if (!needDir || c === 'DIR') return cb(null, c) if (needDir && c === 'FILE') return cb() // otherwise we have to stat, because maybe c=true // if we know it exists, but not what it is. } var exists var stat = this.statCache[abs] if (stat !== undefined) { if (stat === false) return cb(null, stat) else { var type = stat.isDirectory() ? 'DIR' : 'FILE' if (needDir && type === 'FILE') return cb() else return cb(null, type, stat) } } var self = this var statcb = inflight('stat\0' + abs, lstatcb_) if (statcb) self.fs.lstat(abs, statcb) function lstatcb_ (er, lstat) { if (lstat && lstat.isSymbolicLink()) { // If it's a symlink, then treat it as the target, unless // the target does not exist, then treat it as a file. return self.fs.stat(abs, function (er, stat) { if (er) self._stat2(f, abs, null, lstat, cb) else self._stat2(f, abs, er, stat, cb) }) } else { self._stat2(f, abs, er, lstat, cb) } } } Glob.prototype._stat2 = function (f, abs, er, stat, cb) { if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { this.statCache[abs] = false return cb() } var needDir = f.slice(-1) === '/' this.statCache[abs] = stat if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) return cb(null, false, stat) var c = true if (stat) c = stat.isDirectory() ? 'DIR' : 'FILE' this.cache[abs] = this.cache[abs] || c if (needDir && c === 'FILE') return cb() return cb(null, c, stat) } The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ## Glob Logo Glob's logo created by Tanya Brassie , licensed under a Creative Commons Attribution-ShareAlike 4.0 International License https://creativecommons.org/licenses/by-sa/4.0/ { "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "name": "glob", "description": "a little globber", "version": "7.2.0", "repository": { "type": "git", "url": "git://github.com/isaacs/node-glob.git" }, "main": "glob.js", "files": [ "glob.js", "sync.js", "common.js" ], "engines": { "node": "*" }, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, "devDependencies": { "memfs": "^3.2.0", "mkdirp": "0", "rimraf": "^2.2.8", "tap": "^15.0.6", "tick": "0.0.6" }, "tap": { "before": "test/00-setup.js", "after": "test/zz-cleanup.js", "jobs": 1 }, "scripts": { "prepublish": "npm run benchclean", "profclean": "rm -f v8.log profile.txt", "test": "tap", "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js", "bench": "bash benchmark.sh", "prof": "bash prof.sh && cat profile.txt", "benchclean": "node benchclean.js" }, "license": "ISC", "funding": { "url": "https://github.com/sponsors/isaacs" } } module.exports = globSync globSync.GlobSync = GlobSync var rp = require('fs.realpath') var minimatch = require('minimatch') var Minimatch = minimatch.Minimatch var Glob = require('./glob.js').Glob var util = require('util') var path = require('path') var assert = require('assert') var isAbsolute = require('path-is-absolute') var common = require('./common.js') var setopts = common.setopts var ownProp = common.ownProp var childrenIgnored = common.childrenIgnored var isIgnored = common.isIgnored function globSync (pattern, options) { if (typeof options === 'function' || arguments.length === 3) throw new TypeError('callback provided to sync glob\n'+ 'See: https://github.com/isaacs/node-glob/issues/167') return new GlobSync(pattern, options).found } function GlobSync (pattern, options) { if (!pattern) throw new Error('must provide pattern') if (typeof options === 'function' || arguments.length === 3) throw new TypeError('callback provided to sync glob\n'+ 'See: https://github.com/isaacs/node-glob/issues/167') if (!(this instanceof GlobSync)) return new GlobSync(pattern, options) setopts(this, pattern, options) if (this.noprocess) return this var n = this.minimatch.set.length this.matches = new Array(n) for (var i = 0; i < n; i ++) { this._process(this.minimatch.set[i], i, false) } this._finish() } GlobSync.prototype._finish = function () { assert(this instanceof GlobSync) if (this.realpath) { var self = this this.matches.forEach(function (matchset, index) { var set = self.matches[index] = Object.create(null) for (var p in matchset) { try { p = self._makeAbs(p) var real = rp.realpathSync(p, self.realpathCache) set[real] = true } catch (er) { if (er.syscall === 'stat') set[self._makeAbs(p)] = true else throw er } } }) } common.finish(this) } GlobSync.prototype._process = function (pattern, index, inGlobStar) { assert(this instanceof GlobSync) // Get the first [n] parts of pattern that are all strings. var n = 0 while (typeof pattern[n] === 'string') { n ++ } // now n is the index of the first one that is *not* a string. // See if there's anything else var prefix switch (n) { // if not, then this is rather simple case pattern.length: this._processSimple(pattern.join('/'), index) return case 0: // pattern *starts* with some non-trivial item. // going to readdir(cwd), but not include the prefix in matches. prefix = null break default: // pattern has some string bits in the front. // whatever it starts with, whether that's 'absolute' like /foo/bar, // or 'relative' like '../baz' prefix = pattern.slice(0, n).join('/') break } var remain = pattern.slice(n) // get the list of entries. var read if (prefix === null) read = '.' else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { if (!prefix || !isAbsolute(prefix)) prefix = '/' + prefix read = prefix } else read = prefix var abs = this._makeAbs(read) //if ignored, skip processing if (childrenIgnored(this, read)) return var isGlobStar = remain[0] === minimatch.GLOBSTAR if (isGlobStar) this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) else this._processReaddir(prefix, read, abs, remain, index, inGlobStar) } GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { var entries = this._readdir(abs, inGlobStar) // if the abs isn't a dir, then nothing can match! if (!entries) return // It will only match dot entries if it starts with a dot, or if // dot is set. Stuff like @(.foo|.bar) isn't allowed. var pn = remain[0] var negate = !!this.minimatch.negate var rawGlob = pn._glob var dotOk = this.dot || rawGlob.charAt(0) === '.' var matchedEntries = [] for (var i = 0; i < entries.length; i++) { var e = entries[i] if (e.charAt(0) !== '.' || dotOk) { var m if (negate && !prefix) { m = !e.match(pn) } else { m = e.match(pn) } if (m) matchedEntries.push(e) } } var len = matchedEntries.length // If there are no matched entries, then nothing matches. if (len === 0) return // if this is the last remaining pattern bit, then no need for // an additional stat *unless* the user has specified mark or // stat explicitly. We know they exist, since readdir returned // them. if (remain.length === 1 && !this.mark && !this.stat) { if (!this.matches[index]) this.matches[index] = Object.create(null) for (var i = 0; i < len; i ++) { var e = matchedEntries[i] if (prefix) { if (prefix.slice(-1) !== '/') e = prefix + '/' + e else e = prefix + e } if (e.charAt(0) === '/' && !this.nomount) { e = path.join(this.root, e) } this._emitMatch(index, e) } // This was the last one, and no stats were needed return } // now test all matched entries as stand-ins for that part // of the pattern. remain.shift() for (var i = 0; i < len; i ++) { var e = matchedEntries[i] var newPattern if (prefix) newPattern = [prefix, e] else newPattern = [e] this._process(newPattern.concat(remain), index, inGlobStar) } } GlobSync.prototype._emitMatch = function (index, e) { if (isIgnored(this, e)) return var abs = this._makeAbs(e) if (this.mark) e = this._mark(e) if (this.absolute) { e = abs } if (this.matches[index][e]) return if (this.nodir) { var c = this.cache[abs] if (c === 'DIR' || Array.isArray(c)) return } this.matches[index][e] = true if (this.stat) this._stat(e) } GlobSync.prototype._readdirInGlobStar = function (abs) { // follow all symlinked directories forever // just proceed as if this is a non-globstar situation if (this.follow) return this._readdir(abs, false) var entries var lstat var stat try { lstat = this.fs.lstatSync(abs) } catch (er) { if (er.code === 'ENOENT') { // lstat failed, doesn't exist return null } } var isSym = lstat && lstat.isSymbolicLink() this.symlinks[abs] = isSym // If it's not a symlink or a dir, then it's definitely a regular file. // don't bother doing a readdir in that case. if (!isSym && lstat && !lstat.isDirectory()) this.cache[abs] = 'FILE' else entries = this._readdir(abs, false) return entries } GlobSync.prototype._readdir = function (abs, inGlobStar) { var entries if (inGlobStar && !ownProp(this.symlinks, abs)) return this._readdirInGlobStar(abs) if (ownProp(this.cache, abs)) { var c = this.cache[abs] if (!c || c === 'FILE') return null if (Array.isArray(c)) return c } try { return this._readdirEntries(abs, this.fs.readdirSync(abs)) } catch (er) { this._readdirError(abs, er) return null } } GlobSync.prototype._readdirEntries = function (abs, entries) { // if we haven't asked to stat everything, then just // assume that everything in there exists, so we can avoid // having to stat it a second time. if (!this.mark && !this.stat) { for (var i = 0; i < entries.length; i ++) { var e = entries[i] if (abs === '/') e = abs + e else e = abs + '/' + e this.cache[e] = true } } this.cache[abs] = entries // mark and cache dir-ness return entries } GlobSync.prototype._readdirError = function (f, er) { // handle errors, and cache the information switch (er.code) { case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 case 'ENOTDIR': // totally normal. means it *does* exist. var abs = this._makeAbs(f) this.cache[abs] = 'FILE' if (abs === this.cwdAbs) { var error = new Error(er.code + ' invalid cwd ' + this.cwd) error.path = this.cwd error.code = er.code throw error } break case 'ENOENT': // not terribly unusual case 'ELOOP': case 'ENAMETOOLONG': case 'UNKNOWN': this.cache[this._makeAbs(f)] = false break default: // some unusual error. Treat as failure. this.cache[this._makeAbs(f)] = false if (this.strict) throw er if (!this.silent) console.error('glob error', er) break } } GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { var entries = this._readdir(abs, inGlobStar) // no entries means not a dir, so it can never have matches // foo.txt/** doesn't match foo.txt if (!entries) return // test without the globstar, and with every child both below // and replacing the globstar. var remainWithoutGlobStar = remain.slice(1) var gspref = prefix ? [ prefix ] : [] var noGlobStar = gspref.concat(remainWithoutGlobStar) // the noGlobStar pattern exits the inGlobStar state this._process(noGlobStar, index, false) var len = entries.length var isSym = this.symlinks[abs] // If it's a symlink, and we're in a globstar, then stop if (isSym && inGlobStar) return for (var i = 0; i < len; i++) { var e = entries[i] if (e.charAt(0) === '.' && !this.dot) continue // these two cases enter the inGlobStar state var instead = gspref.concat(entries[i], remainWithoutGlobStar) this._process(instead, index, true) var below = gspref.concat(entries[i], remain) this._process(below, index, true) } } GlobSync.prototype._processSimple = function (prefix, index) { // XXX review this. Shouldn't it be doing the mounting etc // before doing stat? kinda weird? var exists = this._stat(prefix) if (!this.matches[index]) this.matches[index] = Object.create(null) // If it doesn't exist, then just mark the lack of results if (!exists) return if (prefix && isAbsolute(prefix) && !this.nomount) { var trail = /[\/\\]$/.test(prefix) if (prefix.charAt(0) === '/') { prefix = path.join(this.root, prefix) } else { prefix = path.resolve(this.root, prefix) if (trail) prefix += '/' } } if (process.platform === 'win32') prefix = prefix.replace(/\\/g, '/') // Mark this as a match this._emitMatch(index, prefix) } // Returns either 'DIR', 'FILE', or false GlobSync.prototype._stat = function (f) { var abs = this._makeAbs(f) var needDir = f.slice(-1) === '/' if (f.length > this.maxLength) return false if (!this.stat && ownProp(this.cache, abs)) { var c = this.cache[abs] if (Array.isArray(c)) c = 'DIR' // It exists, but maybe not how we need it if (!needDir || c === 'DIR') return c if (needDir && c === 'FILE') return false // otherwise we have to stat, because maybe c=true // if we know it exists, but not what it is. } var exists var stat = this.statCache[abs] if (!stat) { var lstat try { lstat = this.fs.lstatSync(abs) } catch (er) { if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { this.statCache[abs] = false return false } } if (lstat && lstat.isSymbolicLink()) { try { stat = this.fs.statSync(abs) } catch (er) { stat = lstat } } else { stat = lstat } } this.statCache[abs] = stat var c = true if (stat) c = stat.isDirectory() ? 'DIR' : 'FILE' this.cache[abs] = this.cache[abs] || c if (needDir && c === 'FILE') return false return c } GlobSync.prototype._mark = function (p) { return common.mark(this, p) } GlobSync.prototype._makeAbs = function (f) { return common.makeAbs(this, f) } { "name": "http-proxy-agent", "version": "5.0.0", "description": "An HTTP(s) proxy `http.Agent` implementation for HTTP", "main": "./dist/index.js", "types": "./dist/index.d.ts", "files": [ "dist" ], "scripts": { "prebuild": "rimraf dist", "build": "tsc", "test": "mocha", "test-lint": "eslint src --ext .js,.ts", "prepublishOnly": "npm run build" }, "repository": { "type": "git", "url": "git://github.com/TooTallNate/node-http-proxy-agent.git" }, "keywords": [ "http", "proxy", "endpoint", "agent" ], "author": "Nathan Rajlich (http://n8.io/)", "license": "MIT", "bugs": { "url": "https://github.com/TooTallNate/node-http-proxy-agent/issues" }, "dependencies": { "@tootallnate/once": "2", "agent-base": "6", "debug": "4" }, "devDependencies": { "@types/debug": "4", "@types/node": "^12.19.2", "@typescript-eslint/eslint-plugin": "1.6.0", "@typescript-eslint/parser": "1.1.0", "eslint": "5.16.0", "eslint-config-airbnb": "17.1.0", "eslint-config-prettier": "4.1.0", "eslint-import-resolver-typescript": "1.1.1", "eslint-plugin-import": "2.16.0", "eslint-plugin-jsx-a11y": "6.2.1", "eslint-plugin-react": "7.12.4", "mocha": "^6.2.2", "proxy": "1", "rimraf": "^3.0.0", "typescript": "^4.4.3" }, "engines": { "node": ">= 6" } } { "name": "https-proxy-agent", "version": "5.0.0", "description": "An HTTP(s) proxy `http.Agent` implementation for HTTPS", "main": "dist/index", "types": "dist/index", "files": [ "dist" ], "scripts": { "prebuild": "rimraf dist", "build": "tsc", "test": "mocha --reporter spec", "test-lint": "eslint src --ext .js,.ts", "prepublishOnly": "npm run build" }, "repository": { "type": "git", "url": "git://github.com/TooTallNate/node-https-proxy-agent.git" }, "keywords": [ "https", "proxy", "endpoint", "agent" ], "author": "Nathan Rajlich (http://n8.io/)", "license": "MIT", "bugs": { "url": "https://github.com/TooTallNate/node-https-proxy-agent/issues" }, "dependencies": { "agent-base": "6", "debug": "4" }, "devDependencies": { "@types/debug": "4", "@types/node": "^12.12.11", "@typescript-eslint/eslint-plugin": "1.6.0", "@typescript-eslint/parser": "1.1.0", "eslint": "5.16.0", "eslint-config-airbnb": "17.1.0", "eslint-config-prettier": "4.1.0", "eslint-import-resolver-typescript": "1.1.1", "eslint-plugin-import": "2.16.0", "eslint-plugin-jsx-a11y": "6.2.1", "eslint-plugin-react": "7.12.4", "mocha": "^6.2.2", "proxy": "1", "rimraf": "^3.0.0", "typescript": "^3.5.3" }, "engines": { "node": ">= 6" } } { "name": "ip", "version": "2.0.0", "author": "Fedor Indutny ", "homepage": "https://github.com/indutny/node-ip", "repository": { "type": "git", "url": "http://github.com/indutny/node-ip.git" }, "files": [ "lib", "README.md" ], "main": "lib/ip", "devDependencies": { "eslint": "^8.15.0", "mocha": "^10.0.0" }, "scripts": { "lint": "eslint lib/*.js test/*.js", "test": "npm run lint && mocha --reporter spec test/*-test.js", "fix": "npm run lint -- --fix" }, "license": "MIT" } const perf = typeof performance === 'object' && performance && typeof performance.now === 'function' ? performance : Date const hasAbortController = typeof AbortController !== 'undefined' /* istanbul ignore next - minimal backwards compatibility polyfill */ const AC = hasAbortController ? AbortController : Object.assign( class AbortController { constructor () { this.signal = new AC.AbortSignal } abort () { this.signal.aborted = true } }, { AbortSignal: class AbortSignal { constructor () { this.aborted = false }}} ) const warned = new Set() const deprecatedOption = (opt, instead) => { const code = `LRU_CACHE_OPTION_${opt}` if (shouldWarn(code)) { warn(code, `${opt} option`, `options.${instead}`, LRUCache) } } const deprecatedMethod = (method, instead) => { const code = `LRU_CACHE_METHOD_${method}` if (shouldWarn(code)) { const { prototype } = LRUCache const { get } = Object.getOwnPropertyDescriptor(prototype, method) warn(code, `${method} method`, `cache.${instead}()`, get) } } const deprecatedProperty = (field, instead) => { const code = `LRU_CACHE_PROPERTY_${field}` if (shouldWarn(code)) { const { prototype } = LRUCache const { get } = Object.getOwnPropertyDescriptor(prototype, field) warn(code, `${field} property`, `cache.${instead}`, get) } } const shouldWarn = code => typeof process === 'object' && process && !warned.has(code) const warn = (code, what, instead, fn) => { warned.add(code) const msg = `The ${what} is deprecated. Please use ${instead} instead.` process.emitWarning(msg, 'DeprecationWarning', code, fn) } const isPosInt = n => n && n === Math.floor(n) && n > 0 && isFinite(n) /* istanbul ignore next - This is a little bit ridiculous, tbh. * The maximum array length is 2^32-1 or thereabouts on most JS impls. * And well before that point, you're caching the entire world, I mean, * that's ~32GB of just integers for the next/prev links, plus whatever * else to hold that many keys and values. Just filling the memory with * zeroes at init time is brutal when you get that big. * But why not be complete? * Maybe in the future, these limits will have expanded. */ const getUintArray = max => !isPosInt(max) ? null : max <= Math.pow(2, 8) ? Uint8Array : max <= Math.pow(2, 16) ? Uint16Array : max <= Math.pow(2, 32) ? Uint32Array : max <= Number.MAX_SAFE_INTEGER ? ZeroArray : null class ZeroArray extends Array { constructor (size) { super(size) this.fill(0) } } class Stack { constructor (max) { const UintArray = max ? getUintArray(max) : Array this.heap = new UintArray(max) this.length = 0 } push (n) { this.heap[this.length++] = n } pop () { return this.heap[--this.length] } } class LRUCache { constructor (options = {}) { const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, sizeCalculation, fetchMethod, } = options // deprecated options, don't trigger a warning for getting them if // the thing being passed in is another LRUCache we're copying. const { length, maxAge, stale, } = options instanceof LRUCache ? {} : options if (max !== 0 && !isPosInt(max)) { throw new TypeError('max option must be a nonnegative integer') } const UintArray = max ? getUintArray(max) : Array if (!UintArray) { throw new Error('invalid max value: ' + max) } this.max = max this.maxSize = maxSize this.sizeCalculation = sizeCalculation || length if (this.sizeCalculation) { if (!this.maxSize) { throw new TypeError('cannot set sizeCalculation without setting maxSize') } if (typeof this.sizeCalculation !== 'function') { throw new TypeError('sizeCalculating set to non-function') } } this.fetchMethod = fetchMethod || null if (this.fetchMethod && typeof this.fetchMethod !== 'function') { throw new TypeError('fetchMethod must be a function if specified') } this.keyMap = new Map() this.keyList = new Array(max).fill(null) this.valList = new Array(max).fill(null) this.next = new UintArray(max) this.prev = new UintArray(max) this.head = 0 this.tail = 0 this.free = new Stack(max) this.initialFill = 1 this.size = 0 if (typeof dispose === 'function') { this.dispose = dispose } if (typeof disposeAfter === 'function') { this.disposeAfter = disposeAfter this.disposed = [] } else { this.disposeAfter = null this.disposed = null } this.noDisposeOnSet = !!noDisposeOnSet this.noUpdateTTL = !!noUpdateTTL if (this.maxSize !== 0) { if (!isPosInt(this.maxSize)) { throw new TypeError('maxSize must be a positive integer if specified') } this.initializeSizeTracking() } this.allowStale = !!allowStale || !!stale this.updateAgeOnGet = !!updateAgeOnGet this.ttlResolution = isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1 this.ttlAutopurge = !!ttlAutopurge this.ttl = ttl || maxAge || 0 if (this.ttl) { if (!isPosInt(this.ttl)) { throw new TypeError('ttl must be a positive integer if specified') } this.initializeTTLTracking() } // do not allow completely unbounded caches if (this.max === 0 && this.ttl === 0 && this.maxSize === 0) { throw new TypeError('At least one of max, maxSize, or ttl is required') } if (!this.ttlAutopurge && !this.max && !this.maxSize) { const code = 'LRU_CACHE_UNBOUNDED' if (shouldWarn(code)) { warned.add(code) const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' + 'result in unbounded memory consumption.' process.emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache) } } if (stale) { deprecatedOption('stale', 'allowStale') } if (maxAge) { deprecatedOption('maxAge', 'ttl') } if (length) { deprecatedOption('length', 'sizeCalculation') } } getRemainingTTL (key) { return this.has(key) ? Infinity : 0 } initializeTTLTracking () { this.ttls = new ZeroArray(this.max) this.starts = new ZeroArray(this.max) this.setItemTTL = (index, ttl) => { this.starts[index] = ttl !== 0 ? perf.now() : 0 this.ttls[index] = ttl if (ttl !== 0 && this.ttlAutopurge) { const t = setTimeout(() => { if (this.isStale(index)) { this.delete(this.keyList[index]) } }, ttl + 1) /* istanbul ignore else - unref() not supported on all platforms */ if (t.unref) { t.unref() } } } this.updateItemAge = (index) => { this.starts[index] = this.ttls[index] !== 0 ? perf.now() : 0 } // debounce calls to perf.now() to 1s so we're not hitting // that costly call repeatedly. let cachedNow = 0 const getNow = () => { const n = perf.now() if (this.ttlResolution > 0) { cachedNow = n const t = setTimeout(() => cachedNow = 0, this.ttlResolution) /* istanbul ignore else - not available on all platforms */ if (t.unref) { t.unref() } } return n } this.getRemainingTTL = (key) => { const index = this.keyMap.get(key) if (index === undefined) { return 0 } return this.ttls[index] === 0 || this.starts[index] === 0 ? Infinity : ((this.starts[index] + this.ttls[index]) - (cachedNow || getNow())) } this.isStale = (index) => { return this.ttls[index] !== 0 && this.starts[index] !== 0 && ((cachedNow || getNow()) - this.starts[index] > this.ttls[index]) } } updateItemAge (index) {} setItemTTL (index, ttl) {} isStale (index) { return false } initializeSizeTracking () { this.calculatedSize = 0 this.sizes = new ZeroArray(this.max) this.removeItemSize = index => this.calculatedSize -= this.sizes[index] this.requireSize = (k, v, size, sizeCalculation) => { if (sizeCalculation && !size) { size = sizeCalculation(v, k) } if (!isPosInt(size)) { throw new TypeError('size must be positive integer') } return size } this.addItemSize = (index, v, k, size) => { this.sizes[index] = size const maxSize = this.maxSize - this.sizes[index] while (this.calculatedSize > maxSize) { this.evict() } this.calculatedSize += this.sizes[index] } this.delete = k => { if (this.size !== 0) { const index = this.keyMap.get(k) if (index !== undefined) { this.calculatedSize -= this.sizes[index] } } return LRUCache.prototype.delete.call(this, k) } } removeItemSize (index) {} addItemSize (index, v, k, size) {} requireSize (k, v, size, sizeCalculation) { if (size || sizeCalculation) { throw new TypeError('cannot set size without setting maxSize on cache') } } *indexes ({ allowStale = this.allowStale } = {}) { if (this.size) { for (let i = this.tail; true; ) { if (!this.isValidIndex(i)) { break } if (allowStale || !this.isStale(i)) { yield i } if (i === this.head) { break } else { i = this.prev[i] } } } } *rindexes ({ allowStale = this.allowStale } = {}) { if (this.size) { for (let i = this.head; true; ) { if (!this.isValidIndex(i)) { break } if (allowStale || !this.isStale(i)) { yield i } if (i === this.tail) { break } else { i = this.next[i] } } } } isValidIndex (index) { return this.keyMap.get(this.keyList[index]) === index } *entries () { for (const i of this.indexes()) { yield [this.keyList[i], this.valList[i]] } } *rentries () { for (const i of this.rindexes()) { yield [this.keyList[i], this.valList[i]] } } *keys () { for (const i of this.indexes()) { yield this.keyList[i] } } *rkeys () { for (const i of this.rindexes()) { yield this.keyList[i] } } *values () { for (const i of this.indexes()) { yield this.valList[i] } } *rvalues () { for (const i of this.rindexes()) { yield this.valList[i] } } [Symbol.iterator] () { return this.entries() } find (fn, getOptions = {}) { for (const i of this.indexes()) { if (fn(this.valList[i], this.keyList[i], this)) { return this.get(this.keyList[i], getOptions) } } } forEach (fn, thisp = this) { for (const i of this.indexes()) { fn.call(thisp, this.valList[i], this.keyList[i], this) } } rforEach (fn, thisp = this) { for (const i of this.rindexes()) { fn.call(thisp, this.valList[i], this.keyList[i], this) } } get prune () { deprecatedMethod('prune', 'purgeStale') return this.purgeStale } purgeStale () { let deleted = false for (const i of this.rindexes({ allowStale: true })) { if (this.isStale(i)) { this.delete(this.keyList[i]) deleted = true } } return deleted } dump () { const arr = [] for (const i of this.indexes()) { const key = this.keyList[i] const value = this.valList[i] const entry = { value } if (this.ttls) { entry.ttl = this.ttls[i] } if (this.sizes) { entry.size = this.sizes[i] } arr.unshift([key, entry]) } return arr } load (arr) { this.clear() for (const [key, entry] of arr) { this.set(key, entry.value, entry) } } dispose (v, k, reason) {} set (k, v, { ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, } = {}) { size = this.requireSize(k, v, size, sizeCalculation) let index = this.size === 0 ? undefined : this.keyMap.get(k) if (index === undefined) { // addition index = this.newIndex() this.keyList[index] = k this.valList[index] = v this.keyMap.set(k, index) this.next[this.tail] = index this.prev[index] = this.tail this.tail = index this.size ++ this.addItemSize(index, v, k, size) noUpdateTTL = false } else { // update const oldVal = this.valList[index] if (v !== oldVal) { if (this.isBackgroundFetch(oldVal)) { oldVal.__abortController.abort() } else { if (!noDisposeOnSet) { this.dispose(oldVal, k, 'set') if (this.disposeAfter) { this.disposed.push([oldVal, k, 'set']) } } } this.removeItemSize(index) this.valList[index] = v this.addItemSize(index, v, k, size) } this.moveToTail(index) } if (ttl !== 0 && this.ttl === 0 && !this.ttls) { this.initializeTTLTracking() } if (!noUpdateTTL) { this.setItemTTL(index, ttl) } if (this.disposeAfter) { while (this.disposed.length) { this.disposeAfter(...this.disposed.shift()) } } return this } newIndex () { if (this.size === 0) { return this.tail } if (this.size === this.max) { return this.evict() } if (this.free.length !== 0) { return this.free.pop() } // initial fill, just keep writing down the list return this.initialFill++ } pop () { if (this.size) { const val = this.valList[this.head] this.evict() return val } } evict () { const head = this.head const k = this.keyList[head] const v = this.valList[head] if (this.isBackgroundFetch(v)) { v.__abortController.abort() } else { this.dispose(v, k, 'evict') if (this.disposeAfter) { this.disposed.push([v, k, 'evict']) } } this.removeItemSize(head) this.head = this.next[head] this.keyMap.delete(k) this.size -- return head } has (k) { return this.keyMap.has(k) && !this.isStale(this.keyMap.get(k)) } // like get(), but without any LRU updating or TTL expiration peek (k, { allowStale = this.allowStale } = {}) { const index = this.keyMap.get(k) if (index !== undefined && (allowStale || !this.isStale(index))) { return this.valList[index] } } backgroundFetch (k, index, options) { const v = index === undefined ? undefined : this.valList[index] if (this.isBackgroundFetch(v)) { return v } const ac = new AbortController() const fetchOpts = { signal: ac.signal, options, } const p = Promise.resolve(this.fetchMethod(k, v, fetchOpts)).then(v => { if (!ac.signal.aborted) { this.set(k, v, fetchOpts.options) } return v }) p.__abortController = ac p.__staleWhileFetching = v if (index === undefined) { this.set(k, p, fetchOpts.options) index = this.keyMap.get(k) } else { this.valList[index] = p } return p } isBackgroundFetch (p) { return p && typeof p === 'object' && typeof p.then === 'function' && Object.prototype.hasOwnProperty.call(p, '__staleWhileFetching') } // this takes the union of get() and set() opts, because it does both async fetch (k, { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, } = {}) { if (!this.fetchMethod) { return this.get(k, {allowStale, updateAgeOnGet}) } const options = { allowStale, updateAgeOnGet, ttl, noDisposeOnSet, size, sizeCalculation, noUpdateTTL, } let index = this.keyMap.get(k) if (index === undefined) { return this.backgroundFetch(k, index, options) } else { // in cache, maybe already fetching const v = this.valList[index] if (this.isBackgroundFetch(v)) { return allowStale && v.__staleWhileFetching !== undefined ? v.__staleWhileFetching : v } if (!this.isStale(index)) { this.moveToTail(index) if (updateAgeOnGet) { this.updateItemAge(index) } return v } // ok, it is stale, and not already fetching // refresh the cache. const p = this.backgroundFetch(k, index, options) return allowStale && p.__staleWhileFetching !== undefined ? p.__staleWhileFetching : p } } get (k, { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, } = {}) { const index = this.keyMap.get(k) if (index !== undefined) { const value = this.valList[index] const fetching = this.isBackgroundFetch(value) if (this.isStale(index)) { // delete only if not an in-flight background fetch if (!fetching) { this.delete(k) return allowStale ? value : undefined } else { return allowStale ? value.__staleWhileFetching : undefined } } else { // if we're currently fetching it, we don't actually have it yet // it's not stale, which means this isn't a staleWhileRefetching, // so we just return undefined if (fetching) { return undefined } this.moveToTail(index) if (updateAgeOnGet) { this.updateItemAge(index) } return value } } } connect (p, n) { this.prev[n] = p this.next[p] = n } moveToTail (index) { // if tail already, nothing to do // if head, move head to next[index] // else // move next[prev[index]] to next[index] (head has no prev) // move prev[next[index]] to prev[index] // prev[index] = tail // next[tail] = index // tail = index if (index !== this.tail) { if (index === this.head) { this.head = this.next[index] } else { this.connect(this.prev[index], this.next[index]) } this.connect(this.tail, index) this.tail = index } } get del () { deprecatedMethod('del', 'delete') return this.delete } delete (k) { let deleted = false if (this.size !== 0) { const index = this.keyMap.get(k) if (index !== undefined) { deleted = true if (this.size === 1) { this.clear() } else { this.removeItemSize(index) const v = this.valList[index] if (this.isBackgroundFetch(v)) { v.__abortController.abort() } else { this.dispose(v, k, 'delete') if (this.disposeAfter) { this.disposed.push([v, k, 'delete']) } } this.keyMap.delete(k) this.keyList[index] = null this.valList[index] = null if (index === this.tail) { this.tail = this.prev[index] } else if (index === this.head) { this.head = this.next[index] } else { this.next[this.prev[index]] = this.next[index] this.prev[this.next[index]] = this.prev[index] } this.size -- this.free.push(index) } } } if (this.disposed) { while (this.disposed.length) { this.disposeAfter(...this.disposed.shift()) } } return deleted } clear () { for (const index of this.rindexes({ allowStale: true })) { const v = this.valList[index] if (this.isBackgroundFetch(v)) { v.__abortController.abort() } else { const k = this.keyList[index] this.dispose(v, k, 'delete') if (this.disposeAfter) { this.disposed.push([v, k, 'delete']) } } } this.keyMap.clear() this.valList.fill(null) this.keyList.fill(null) if (this.ttls) { this.ttls.fill(0) this.starts.fill(0) } if (this.sizes) { this.sizes.fill(0) } this.head = 0 this.tail = 0 this.initialFill = 1 this.free.length = 0 this.calculatedSize = 0 this.size = 0 if (this.disposed) { while (this.disposed.length) { this.disposeAfter(...this.disposed.shift()) } } } get reset () { deprecatedMethod('reset', 'clear') return this.clear } get length () { deprecatedProperty('length', 'size') return this.size } } module.exports = LRUCache The ISC License Copyright (c) 2010-2022 Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "lru-cache", "description": "A cache object that deletes the least-recently-used items.", "version": "7.7.1", "author": "Isaac Z. Schlueter ", "keywords": [ "mru", "lru", "cache" ], "scripts": { "build": "", "test": "tap", "snap": "tap", "size": "size-limit", "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags" }, "main": "index.js", "repository": "git://github.com/isaacs/node-lru-cache.git", "devDependencies": { "@size-limit/preset-small-lib": "^7.0.8", "benchmark": "^2.1.4", "clock-mock": "^1.0.3", "size-limit": "^7.0.8", "tap": "^15.1.6" }, "license": "ISC", "files": [ "index.js" ], "engines": { "node": ">=12" }, "tap": { "coverage-map": "map.js" }, "size-limit": [ { "path": "./index.js" } ] } 'use strict' const proc = typeof process === 'object' && process ? process : { stdout: null, stderr: null, } const EE = require('events') const Stream = require('stream') const Yallist = require('yallist') const SD = require('string_decoder').StringDecoder const EOF = Symbol('EOF') const MAYBE_EMIT_END = Symbol('maybeEmitEnd') const EMITTED_END = Symbol('emittedEnd') const EMITTING_END = Symbol('emittingEnd') const EMITTED_ERROR = Symbol('emittedError') const CLOSED = Symbol('closed') const READ = Symbol('read') const FLUSH = Symbol('flush') const FLUSHCHUNK = Symbol('flushChunk') const ENCODING = Symbol('encoding') const DECODER = Symbol('decoder') const FLOWING = Symbol('flowing') const PAUSED = Symbol('paused') const RESUME = Symbol('resume') const BUFFERLENGTH = Symbol('bufferLength') const BUFFERPUSH = Symbol('bufferPush') const BUFFERSHIFT = Symbol('bufferShift') const OBJECTMODE = Symbol('objectMode') const DESTROYED = Symbol('destroyed') // TODO remove when Node v8 support drops const doIter = global._MP_NO_ITERATOR_SYMBOLS_ !== '1' const ASYNCITERATOR = doIter && Symbol.asyncIterator || Symbol('asyncIterator not implemented') const ITERATOR = doIter && Symbol.iterator || Symbol('iterator not implemented') // events that mean 'the stream is over' // these are treated specially, and re-emitted // if they are listened for after emitting. const isEndish = ev => ev === 'end' || ev === 'finish' || ev === 'prefinish' const isArrayBuffer = b => b instanceof ArrayBuffer || typeof b === 'object' && b.constructor && b.constructor.name === 'ArrayBuffer' && b.byteLength >= 0 const isArrayBufferView = b => !Buffer.isBuffer(b) && ArrayBuffer.isView(b) module.exports = class Minipass extends Stream { constructor (options) { super() this[FLOWING] = false // whether we're explicitly paused this[PAUSED] = false this.pipes = new Yallist() this.buffer = new Yallist() this[OBJECTMODE] = options && options.objectMode || false if (this[OBJECTMODE]) this[ENCODING] = null else this[ENCODING] = options && options.encoding || null if (this[ENCODING] === 'buffer') this[ENCODING] = null this[DECODER] = this[ENCODING] ? new SD(this[ENCODING]) : null this[EOF] = false this[EMITTED_END] = false this[EMITTING_END] = false this[CLOSED] = false this[EMITTED_ERROR] = null this.writable = true this.readable = true this[BUFFERLENGTH] = 0 this[DESTROYED] = false } get bufferLength () { return this[BUFFERLENGTH] } get encoding () { return this[ENCODING] } set encoding (enc) { if (this[OBJECTMODE]) throw new Error('cannot set encoding in objectMode') if (this[ENCODING] && enc !== this[ENCODING] && (this[DECODER] && this[DECODER].lastNeed || this[BUFFERLENGTH])) throw new Error('cannot change encoding') if (this[ENCODING] !== enc) { this[DECODER] = enc ? new SD(enc) : null if (this.buffer.length) this.buffer = this.buffer.map(chunk => this[DECODER].write(chunk)) } this[ENCODING] = enc } setEncoding (enc) { this.encoding = enc } get objectMode () { return this[OBJECTMODE] } set objectMode (om) { this[OBJECTMODE] = this[OBJECTMODE] || !!om } write (chunk, encoding, cb) { if (this[EOF]) throw new Error('write after end') if (this[DESTROYED]) { this.emit('error', Object.assign( new Error('Cannot call write after a stream was destroyed'), { code: 'ERR_STREAM_DESTROYED' } )) return true } if (typeof encoding === 'function') cb = encoding, encoding = 'utf8' if (!encoding) encoding = 'utf8' // convert array buffers and typed array views into buffers // at some point in the future, we may want to do the opposite! // leave strings and buffers as-is // anything else switches us into object mode if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) { if (isArrayBufferView(chunk)) chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength) else if (isArrayBuffer(chunk)) chunk = Buffer.from(chunk) else if (typeof chunk !== 'string') // use the setter so we throw if we have encoding set this.objectMode = true } // this ensures at this point that the chunk is a buffer or string // don't buffer it up or send it to the decoder if (!this.objectMode && !chunk.length) { if (this[BUFFERLENGTH] !== 0) this.emit('readable') if (cb) cb() return this.flowing } // fast-path writing strings of same encoding to a stream with // an empty buffer, skipping the buffer/decoder dance if (typeof chunk === 'string' && !this[OBJECTMODE] && // unless it is a string already ready for us to use !(encoding === this[ENCODING] && !this[DECODER].lastNeed)) { chunk = Buffer.from(chunk, encoding) } if (Buffer.isBuffer(chunk) && this[ENCODING]) chunk = this[DECODER].write(chunk) if (this.flowing) { // if we somehow have something in the buffer, but we think we're // flowing, then we need to flush all that out first, or we get // chunks coming in out of order. Can't emit 'drain' here though, // because we're mid-write, so that'd be bad. if (this[BUFFERLENGTH] !== 0) this[FLUSH](true) // if we are still flowing after flushing the buffer we can emit the // chunk otherwise we have to buffer it. this.flowing ? this.emit('data', chunk) : this[BUFFERPUSH](chunk) } else this[BUFFERPUSH](chunk) if (this[BUFFERLENGTH] !== 0) this.emit('readable') if (cb) cb() return this.flowing } read (n) { if (this[DESTROYED]) return null try { if (this[BUFFERLENGTH] === 0 || n === 0 || n > this[BUFFERLENGTH]) return null if (this[OBJECTMODE]) n = null if (this.buffer.length > 1 && !this[OBJECTMODE]) { if (this.encoding) this.buffer = new Yallist([ Array.from(this.buffer).join('') ]) else this.buffer = new Yallist([ Buffer.concat(Array.from(this.buffer), this[BUFFERLENGTH]) ]) } return this[READ](n || null, this.buffer.head.value) } finally { this[MAYBE_EMIT_END]() } } [READ] (n, chunk) { if (n === chunk.length || n === null) this[BUFFERSHIFT]() else { this.buffer.head.value = chunk.slice(n) chunk = chunk.slice(0, n) this[BUFFERLENGTH] -= n } this.emit('data', chunk) if (!this.buffer.length && !this[EOF]) this.emit('drain') return chunk } end (chunk, encoding, cb) { if (typeof chunk === 'function') cb = chunk, chunk = null if (typeof encoding === 'function') cb = encoding, encoding = 'utf8' if (chunk) this.write(chunk, encoding) if (cb) this.once('end', cb) this[EOF] = true this.writable = false // if we haven't written anything, then go ahead and emit, // even if we're not reading. // we'll re-emit if a new 'end' listener is added anyway. // This makes MP more suitable to write-only use cases. if (this.flowing || !this[PAUSED]) this[MAYBE_EMIT_END]() return this } // don't let the internal resume be overwritten [RESUME] () { if (this[DESTROYED]) return this[PAUSED] = false this[FLOWING] = true this.emit('resume') if (this.buffer.length) this[FLUSH]() else if (this[EOF]) this[MAYBE_EMIT_END]() else this.emit('drain') } resume () { return this[RESUME]() } pause () { this[FLOWING] = false this[PAUSED] = true } get destroyed () { return this[DESTROYED] } get flowing () { return this[FLOWING] } get paused () { return this[PAUSED] } [BUFFERPUSH] (chunk) { if (this[OBJECTMODE]) this[BUFFERLENGTH] += 1 else this[BUFFERLENGTH] += chunk.length return this.buffer.push(chunk) } [BUFFERSHIFT] () { if (this.buffer.length) { if (this[OBJECTMODE]) this[BUFFERLENGTH] -= 1 else this[BUFFERLENGTH] -= this.buffer.head.value.length } return this.buffer.shift() } [FLUSH] (noDrain) { do {} while (this[FLUSHCHUNK](this[BUFFERSHIFT]())) if (!noDrain && !this.buffer.length && !this[EOF]) this.emit('drain') } [FLUSHCHUNK] (chunk) { return chunk ? (this.emit('data', chunk), this.flowing) : false } pipe (dest, opts) { if (this[DESTROYED]) return const ended = this[EMITTED_END] opts = opts || {} if (dest === proc.stdout || dest === proc.stderr) opts.end = false else opts.end = opts.end !== false const p = { dest: dest, opts: opts, ondrain: _ => this[RESUME]() } this.pipes.push(p) dest.on('drain', p.ondrain) this[RESUME]() // piping an ended stream ends immediately if (ended && p.opts.end) p.dest.end() return dest } addListener (ev, fn) { return this.on(ev, fn) } on (ev, fn) { try { return super.on(ev, fn) } finally { if (ev === 'data' && !this.pipes.length && !this.flowing) this[RESUME]() else if (isEndish(ev) && this[EMITTED_END]) { super.emit(ev) this.removeAllListeners(ev) } else if (ev === 'error' && this[EMITTED_ERROR]) { fn.call(this, this[EMITTED_ERROR]) } } } get emittedEnd () { return this[EMITTED_END] } [MAYBE_EMIT_END] () { if (!this[EMITTING_END] && !this[EMITTED_END] && !this[DESTROYED] && this.buffer.length === 0 && this[EOF]) { this[EMITTING_END] = true this.emit('end') this.emit('prefinish') this.emit('finish') if (this[CLOSED]) this.emit('close') this[EMITTING_END] = false } } emit (ev, data) { // error and close are only events allowed after calling destroy() if (ev !== 'error' && ev !== 'close' && ev !== DESTROYED && this[DESTROYED]) return else if (ev === 'data') { if (!data) return if (this.pipes.length) this.pipes.forEach(p => p.dest.write(data) === false && this.pause()) } else if (ev === 'end') { // only actual end gets this treatment if (this[EMITTED_END] === true) return this[EMITTED_END] = true this.readable = false if (this[DECODER]) { data = this[DECODER].end() if (data) { this.pipes.forEach(p => p.dest.write(data)) super.emit('data', data) } } this.pipes.forEach(p => { p.dest.removeListener('drain', p.ondrain) if (p.opts.end) p.dest.end() }) } else if (ev === 'close') { this[CLOSED] = true // don't emit close before 'end' and 'finish' if (!this[EMITTED_END] && !this[DESTROYED]) return } else if (ev === 'error') { this[EMITTED_ERROR] = data } // TODO: replace with a spread operator when Node v4 support drops const args = new Array(arguments.length) args[0] = ev args[1] = data if (arguments.length > 2) { for (let i = 2; i < arguments.length; i++) { args[i] = arguments[i] } } try { return super.emit.apply(this, args) } finally { if (!isEndish(ev)) this[MAYBE_EMIT_END]() else this.removeAllListeners(ev) } } // const all = await stream.collect() collect () { const buf = [] if (!this[OBJECTMODE]) buf.dataLength = 0 // set the promise first, in case an error is raised // by triggering the flow here. const p = this.promise() this.on('data', c => { buf.push(c) if (!this[OBJECTMODE]) buf.dataLength += c.length }) return p.then(() => buf) } // const data = await stream.concat() concat () { return this[OBJECTMODE] ? Promise.reject(new Error('cannot concat in objectMode')) : this.collect().then(buf => this[OBJECTMODE] ? Promise.reject(new Error('cannot concat in objectMode')) : this[ENCODING] ? buf.join('') : Buffer.concat(buf, buf.dataLength)) } // stream.promise().then(() => done, er => emitted error) promise () { return new Promise((resolve, reject) => { this.on(DESTROYED, () => reject(new Error('stream destroyed'))) this.on('error', er => reject(er)) this.on('end', () => resolve()) }) } // for await (let chunk of stream) [ASYNCITERATOR] () { const next = () => { const res = this.read() if (res !== null) return Promise.resolve({ done: false, value: res }) if (this[EOF]) return Promise.resolve({ done: true }) let resolve = null let reject = null const onerr = er => { this.removeListener('data', ondata) this.removeListener('end', onend) reject(er) } const ondata = value => { this.removeListener('error', onerr) this.removeListener('end', onend) this.pause() resolve({ value: value, done: !!this[EOF] }) } const onend = () => { this.removeListener('error', onerr) this.removeListener('data', ondata) resolve({ done: true }) } const ondestroy = () => onerr(new Error('stream destroyed')) return new Promise((res, rej) => { reject = rej resolve = res this.once(DESTROYED, ondestroy) this.once('error', onerr) this.once('end', onend) this.once('data', ondata) }) } return { next } } // for (let chunk of stream) [ITERATOR] () { const next = () => { const value = this.read() const done = value === null return { value, done } } return { next } } destroy (er) { if (this[DESTROYED]) { if (er) this.emit('error', er) else this.emit(DESTROYED) return this } this[DESTROYED] = true // throw away all buffered data, it's never coming out this.buffer = new Yallist() this[BUFFERLENGTH] = 0 if (typeof this.close === 'function' && !this[CLOSED]) this.close() if (er) this.emit('error', er) else // if no error to emit, still reject pending promises this.emit(DESTROYED) return this } static isStream (s) { return !!s && (s instanceof Minipass || s instanceof Stream || s instanceof EE && ( typeof s.pipe === 'function' || // readable (typeof s.write === 'function' && typeof s.end === 'function') // writable )) } } The ISC License Copyright (c) npm, Inc. and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "minipass", "version": "3.1.6", "description": "minimal implementation of a PassThrough stream", "main": "index.js", "dependencies": { "yallist": "^4.0.0" }, "devDependencies": { "end-of-stream": "^1.4.0", "tap": "^15.0.9", "through2": "^2.0.3" }, "scripts": { "test": "tap", "preversion": "npm test", "postversion": "npm publish --tag=next", "postpublish": "git push origin --follow-tags" }, "repository": { "type": "git", "url": "git+https://github.com/isaacs/minipass.git" }, "keywords": [ "passthrough", "stream" ], "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "license": "ISC", "files": [ "index.js" ], "tap": { "check-coverage": true }, "engines": { "node": ">=8" } } /** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; var w = d * 7; var y = d * 365.25; /** * Parse or format the given `val`. * * Options: * * - `long` verbose formatting [false] * * @param {String|Number} val * @param {Object} [options] * @throws {Error} throw an error if val is not a non-empty string or a number * @return {String|Number} * @api public */ module.exports = function(val, options) { options = options || {}; var type = typeof val; if (type === 'string' && val.length > 0) { return parse(val); } else if (type === 'number' && isFinite(val)) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error( 'val is not a non-empty string or a valid number. val=' + JSON.stringify(val) ); }; /** * Parse the given `str` and return milliseconds. * * @param {String} str * @return {Number} * @api private */ function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( str ); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'yrs': case 'yr': case 'y': return n * y; case 'weeks': case 'week': case 'w': return n * w; case 'days': case 'day': case 'd': return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': return n * m; case 'seconds': case 'second': case 'secs': case 'sec': case 's': return n * s; case 'milliseconds': case 'millisecond': case 'msecs': case 'msec': case 'ms': return n; default: return undefined; } } /** * Short format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtShort(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return Math.round(ms / d) + 'd'; } if (msAbs >= h) { return Math.round(ms / h) + 'h'; } if (msAbs >= m) { return Math.round(ms / m) + 'm'; } if (msAbs >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtLong(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return plural(ms, msAbs, d, 'day'); } if (msAbs >= h) { return plural(ms, msAbs, h, 'hour'); } if (msAbs >= m) { return plural(ms, msAbs, m, 'minute'); } if (msAbs >= s) { return plural(ms, msAbs, s, 'second'); } return ms + ' ms'; } /** * Pluralization helper. */ function plural(ms, msAbs, n, name) { var isPlural = msAbs >= n * 1.5; return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); } The MIT License (MIT) Copyright (c) 2016 Zeit, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "ms", "version": "2.1.2", "description": "Tiny millisecond conversion utility", "repository": "zeit/ms", "main": "./index", "files": [ "index.js" ], "scripts": { "precommit": "lint-staged", "lint": "eslint lib/* bin/*", "test": "mocha tests.js" }, "eslintConfig": { "extends": "eslint:recommended", "env": { "node": true, "es6": true } }, "lint-staged": { "*.js": [ "npm run lint", "prettier --single-quote --write", "git add" ] }, "license": "MIT", "devDependencies": { "eslint": "4.12.1", "expect.js": "0.3.1", "husky": "0.14.3", "lint-staged": "5.0.0", "mocha": "4.0.1" } } 0.6.3 / 2022-01-22 ================== * Revert "Lazy-load modules from main entry point" 0.6.2 / 2019-04-29 ================== * Fix sorting charset, encoding, and language with extra parameters 0.6.1 / 2016-05-02 ================== * perf: improve `Accept` parsing speed * perf: improve `Accept-Charset` parsing speed * perf: improve `Accept-Encoding` parsing speed * perf: improve `Accept-Language` parsing speed 0.6.0 / 2015-09-29 ================== * Fix including type extensions in parameters in `Accept` parsing * Fix parsing `Accept` parameters with quoted equals * Fix parsing `Accept` parameters with quoted semicolons * Lazy-load modules from main entry point * perf: delay type concatenation until needed * perf: enable strict mode * perf: hoist regular expressions * perf: remove closures getting spec properties * perf: remove a closure from media type parsing * perf: remove property delete from media type parsing 0.5.3 / 2015-05-10 ================== * Fix media type parameter matching to be case-insensitive 0.5.2 / 2015-05-06 ================== * Fix comparing media types with quoted values * Fix splitting media types with quoted commas 0.5.1 / 2015-02-14 ================== * Fix preference sorting to be stable for long acceptable lists 0.5.0 / 2014-12-18 ================== * Fix list return order when large accepted list * Fix missing identity encoding when q=0 exists * Remove dynamic building of Negotiator class 0.4.9 / 2014-10-14 ================== * Fix error when media type has invalid parameter 0.4.8 / 2014-09-28 ================== * Fix all negotiations to be case-insensitive * Stable sort preferences of same quality according to client order * Support Node.js 0.6 0.4.7 / 2014-06-24 ================== * Handle invalid provided languages * Handle invalid provided media types 0.4.6 / 2014-06-11 ================== * Order by specificity when quality is the same 0.4.5 / 2014-05-29 ================== * Fix regression in empty header handling 0.4.4 / 2014-05-29 ================== * Fix behaviors when headers are not present 0.4.3 / 2014-04-16 ================== * Handle slashes on media params correctly 0.4.2 / 2014-02-28 ================== * Fix media type sorting * Handle media types params strictly 0.4.1 / 2014-01-16 ================== * Use most specific matches 0.4.0 / 2014-01-09 ================== * Remove preferred prefix from methods /*! * negotiator * Copyright(c) 2012 Federico Romero * Copyright(c) 2012-2014 Isaac Z. Schlueter * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ 'use strict'; var preferredCharsets = require('./lib/charset') var preferredEncodings = require('./lib/encoding') var preferredLanguages = require('./lib/language') var preferredMediaTypes = require('./lib/mediaType') /** * Module exports. * @public */ module.exports = Negotiator; module.exports.Negotiator = Negotiator; /** * Create a Negotiator instance from a request. * @param {object} request * @public */ function Negotiator(request) { if (!(this instanceof Negotiator)) { return new Negotiator(request); } this.request = request; } Negotiator.prototype.charset = function charset(available) { var set = this.charsets(available); return set && set[0]; }; Negotiator.prototype.charsets = function charsets(available) { return preferredCharsets(this.request.headers['accept-charset'], available); }; Negotiator.prototype.encoding = function encoding(available) { var set = this.encodings(available); return set && set[0]; }; Negotiator.prototype.encodings = function encodings(available) { return preferredEncodings(this.request.headers['accept-encoding'], available); }; Negotiator.prototype.language = function language(available) { var set = this.languages(available); return set && set[0]; }; Negotiator.prototype.languages = function languages(available) { return preferredLanguages(this.request.headers['accept-language'], available); }; Negotiator.prototype.mediaType = function mediaType(available) { var set = this.mediaTypes(available); return set && set[0]; }; Negotiator.prototype.mediaTypes = function mediaTypes(available) { return preferredMediaTypes(this.request.headers.accept, available); }; // Backwards compatibility Negotiator.prototype.preferredCharset = Negotiator.prototype.charset; Negotiator.prototype.preferredCharsets = Negotiator.prototype.charsets; Negotiator.prototype.preferredEncoding = Negotiator.prototype.encoding; Negotiator.prototype.preferredEncodings = Negotiator.prototype.encodings; Negotiator.prototype.preferredLanguage = Negotiator.prototype.language; Negotiator.prototype.preferredLanguages = Negotiator.prototype.languages; Negotiator.prototype.preferredMediaType = Negotiator.prototype.mediaType; Negotiator.prototype.preferredMediaTypes = Negotiator.prototype.mediaTypes; (The MIT License) Copyright (c) 2012-2014 Federico Romero Copyright (c) 2012-2014 Isaac Z. Schlueter Copyright (c) 2014-2015 Douglas Christopher Wilson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "negotiator", "description": "HTTP content negotiation", "version": "0.6.3", "contributors": [ "Douglas Christopher Wilson ", "Federico Romero ", "Isaac Z. Schlueter (http://blog.izs.me/)" ], "license": "MIT", "keywords": [ "http", "content negotiation", "accept", "accept-language", "accept-encoding", "accept-charset" ], "repository": "jshttp/negotiator", "devDependencies": { "eslint": "7.32.0", "eslint-plugin-markdown": "2.2.1", "mocha": "9.1.3", "nyc": "15.1.0" }, "files": [ "lib/", "HISTORY.md", "LICENSE", "index.js", "README.md" ], "engines": { "node": ">= 0.6" }, "scripts": { "lint": "eslint .", "test": "mocha --reporter spec --check-leaks --bail test/", "test-ci": "nyc --reporter=lcov --reporter=text npm test", "test-cov": "nyc --reporter=html --reporter=text npm test" } } #!/usr/bin/env node const rimraf = require('./') const path = require('path') const isRoot = arg => /^(\/|[a-zA-Z]:\\)$/.test(path.resolve(arg)) const filterOutRoot = arg => { const ok = preserveRoot === false || !isRoot(arg) if (!ok) { console.error(`refusing to remove ${arg}`) console.error('Set --no-preserve-root to allow this') } return ok } let help = false let dashdash = false let noglob = false let preserveRoot = true const args = process.argv.slice(2).filter(arg => { if (dashdash) return !!arg else if (arg === '--') dashdash = true else if (arg === '--no-glob' || arg === '-G') noglob = true else if (arg === '--glob' || arg === '-g') noglob = false else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) help = true else if (arg === '--preserve-root') preserveRoot = true else if (arg === '--no-preserve-root') preserveRoot = false else return !!arg }).filter(arg => !preserveRoot || filterOutRoot(arg)) const go = n => { if (n >= args.length) return const options = noglob ? { glob: false } : {} rimraf(args[n], options, er => { if (er) throw er go(n+1) }) } if (help || args.length === 0) { // If they didn't ask for help, then this is not a "success" const log = help ? console.log : console.error log('Usage: rimraf [ ...]') log('') log(' Deletes all files and folders at "path" recursively.') log('') log('Options:') log('') log(' -h, --help Display this usage info') log(' -G, --no-glob Do not expand glob patterns in arguments') log(' -g, --glob Expand glob patterns in arguments (default)') log(' --preserve-root Do not remove \'/\' (default)') log(' --no-preserve-root Do not treat \'/\' specially') log(' -- Stop parsing flags') process.exit(help ? 0 : 1) } else go(0) The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "rimraf", "version": "3.0.2", "main": "rimraf.js", "description": "A deep deletion module for node (like `rm -rf`)", "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "license": "ISC", "repository": "git://github.com/isaacs/rimraf.git", "scripts": { "preversion": "npm test", "postversion": "npm publish", "postpublish": "git push origin --follow-tags", "test": "tap test/*.js" }, "bin": "./bin.js", "dependencies": { "glob": "^7.1.3" }, "files": [ "LICENSE", "README.md", "bin.js", "rimraf.js" ], "devDependencies": { "mkdirp": "^0.5.1", "tap": "^12.1.1" }, "funding": { "url": "https://github.com/sponsors/isaacs" } } const assert = require("assert") const path = require("path") const fs = require("fs") let glob = undefined try { glob = require("glob") } catch (_err) { // treat glob as optional. } const defaultGlobOpts = { nosort: true, silent: true } // for EMFILE handling let timeout = 0 const isWindows = (process.platform === "win32") const defaults = options => { const methods = [ 'unlink', 'chmod', 'stat', 'lstat', 'rmdir', 'readdir' ] methods.forEach(m => { options[m] = options[m] || fs[m] m = m + 'Sync' options[m] = options[m] || fs[m] }) options.maxBusyTries = options.maxBusyTries || 3 options.emfileWait = options.emfileWait || 1000 if (options.glob === false) { options.disableGlob = true } if (options.disableGlob !== true && glob === undefined) { throw Error('glob dependency not found, set `options.disableGlob = true` if intentional') } options.disableGlob = options.disableGlob || false options.glob = options.glob || defaultGlobOpts } const rimraf = (p, options, cb) => { if (typeof options === 'function') { cb = options options = {} } assert(p, 'rimraf: missing path') assert.equal(typeof p, 'string', 'rimraf: path should be a string') assert.equal(typeof cb, 'function', 'rimraf: callback function required') assert(options, 'rimraf: invalid options argument provided') assert.equal(typeof options, 'object', 'rimraf: options should be object') defaults(options) let busyTries = 0 let errState = null let n = 0 const next = (er) => { errState = errState || er if (--n === 0) cb(errState) } const afterGlob = (er, results) => { if (er) return cb(er) n = results.length if (n === 0) return cb() results.forEach(p => { const CB = (er) => { if (er) { if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") && busyTries < options.maxBusyTries) { busyTries ++ // try again, with the same exact callback as this one. return setTimeout(() => rimraf_(p, options, CB), busyTries * 100) } // this one won't happen if graceful-fs is used. if (er.code === "EMFILE" && timeout < options.emfileWait) { return setTimeout(() => rimraf_(p, options, CB), timeout ++) } // already gone if (er.code === "ENOENT") er = null } timeout = 0 next(er) } rimraf_(p, options, CB) }) } if (options.disableGlob || !glob.hasMagic(p)) return afterGlob(null, [p]) options.lstat(p, (er, stat) => { if (!er) return afterGlob(null, [p]) glob(p, options.glob, afterGlob) }) } // Two possible strategies. // 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR // 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR // // Both result in an extra syscall when you guess wrong. However, there // are likely far more normal files in the world than directories. This // is based on the assumption that a the average number of files per // directory is >= 1. // // If anyone ever complains about this, then I guess the strategy could // be made configurable somehow. But until then, YAGNI. const rimraf_ = (p, options, cb) => { assert(p) assert(options) assert(typeof cb === 'function') // sunos lets the root user unlink directories, which is... weird. // so we have to lstat here and make sure it's not a dir. options.lstat(p, (er, st) => { if (er && er.code === "ENOENT") return cb(null) // Windows can EPERM on stat. Life is suffering. if (er && er.code === "EPERM" && isWindows) fixWinEPERM(p, options, er, cb) if (st && st.isDirectory()) return rmdir(p, options, er, cb) options.unlink(p, er => { if (er) { if (er.code === "ENOENT") return cb(null) if (er.code === "EPERM") return (isWindows) ? fixWinEPERM(p, options, er, cb) : rmdir(p, options, er, cb) if (er.code === "EISDIR") return rmdir(p, options, er, cb) } return cb(er) }) }) } const fixWinEPERM = (p, options, er, cb) => { assert(p) assert(options) assert(typeof cb === 'function') options.chmod(p, 0o666, er2 => { if (er2) cb(er2.code === "ENOENT" ? null : er) else options.stat(p, (er3, stats) => { if (er3) cb(er3.code === "ENOENT" ? null : er) else if (stats.isDirectory()) rmdir(p, options, er, cb) else options.unlink(p, cb) }) }) } const fixWinEPERMSync = (p, options, er) => { assert(p) assert(options) try { options.chmodSync(p, 0o666) } catch (er2) { if (er2.code === "ENOENT") return else throw er } let stats try { stats = options.statSync(p) } catch (er3) { if (er3.code === "ENOENT") return else throw er } if (stats.isDirectory()) rmdirSync(p, options, er) else options.unlinkSync(p) } const rmdir = (p, options, originalEr, cb) => { assert(p) assert(options) assert(typeof cb === 'function') // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) // if we guessed wrong, and it's not a directory, then // raise the original error. options.rmdir(p, er => { if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) rmkids(p, options, cb) else if (er && er.code === "ENOTDIR") cb(originalEr) else cb(er) }) } const rmkids = (p, options, cb) => { assert(p) assert(options) assert(typeof cb === 'function') options.readdir(p, (er, files) => { if (er) return cb(er) let n = files.length if (n === 0) return options.rmdir(p, cb) let errState files.forEach(f => { rimraf(path.join(p, f), options, er => { if (errState) return if (er) return cb(errState = er) if (--n === 0) options.rmdir(p, cb) }) }) }) } // this looks simpler, and is strictly *faster*, but will // tie up the JavaScript thread and fail on excessively // deep directory trees. const rimrafSync = (p, options) => { options = options || {} defaults(options) assert(p, 'rimraf: missing path') assert.equal(typeof p, 'string', 'rimraf: path should be a string') assert(options, 'rimraf: missing options') assert.equal(typeof options, 'object', 'rimraf: options should be object') let results if (options.disableGlob || !glob.hasMagic(p)) { results = [p] } else { try { options.lstatSync(p) results = [p] } catch (er) { results = glob.sync(p, options.glob) } } if (!results.length) return for (let i = 0; i < results.length; i++) { const p = results[i] let st try { st = options.lstatSync(p) } catch (er) { if (er.code === "ENOENT") return // Windows can EPERM on stat. Life is suffering. if (er.code === "EPERM" && isWindows) fixWinEPERMSync(p, options, er) } try { // sunos lets the root user unlink directories, which is... weird. if (st && st.isDirectory()) rmdirSync(p, options, null) else options.unlinkSync(p) } catch (er) { if (er.code === "ENOENT") return if (er.code === "EPERM") return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) if (er.code !== "EISDIR") throw er rmdirSync(p, options, er) } } } const rmdirSync = (p, options, originalEr) => { assert(p) assert(options) try { options.rmdirSync(p) } catch (er) { if (er.code === "ENOENT") return if (er.code === "ENOTDIR") throw originalEr if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") rmkidsSync(p, options) } } const rmkidsSync = (p, options) => { assert(p) assert(options) options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)) // We only end up here once we got ENOTEMPTY at least once, and // at this point, we are guaranteed to have removed all the kids. // So, we know that it won't be ENOENT or ENOTDIR or anything else. // try really hard to delete stuff on windows, because it has a // PROFOUNDLY annoying habit of not closing handles promptly when // files are deleted, resulting in spurious ENOTEMPTY errors. const retries = isWindows ? 100 : 1 let i = 0 do { let threw = true try { const ret = options.rmdirSync(p, options) threw = false return ret } finally { if (++i < retries && threw) continue } } while (true) } module.exports = rimraf rimraf.sync = rimrafSync The MIT License (MIT) Copyright (c) 2013-2017 Josh Glazebrook Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "smart-buffer", "version": "4.2.0", "description": "smart-buffer is a Buffer wrapper that adds automatic read & write offset tracking, string operations, data insertions, and more.", "main": "build/smartbuffer.js", "contributors": ["syvita"], "homepage": "https://github.com/JoshGlazebrook/smart-buffer/", "repository": { "type": "git", "url": "https://github.com/JoshGlazebrook/smart-buffer.git" }, "bugs": { "url": "https://github.com/JoshGlazebrook/smart-buffer/issues" }, "keywords": [ "buffer", "smart", "packet", "serialize", "network", "cursor", "simple" ], "engines": { "node": ">= 6.0.0", "npm": ">= 3.0.0" }, "author": "Josh Glazebrook", "license": "MIT", "readmeFilename": "README.md", "devDependencies": { "@types/chai": "4.1.7", "@types/mocha": "5.2.7", "@types/node": "^12.0.0", "chai": "4.2.0", "coveralls": "3.0.5", "istanbul": "^0.4.5", "mocha": "6.2.0", "mocha-lcov-reporter": "^1.3.0", "nyc": "14.1.1", "source-map-support": "0.5.12", "ts-node": "8.3.0", "tslint": "5.18.0", "typescript": "^3.2.1" }, "typings": "typings/smartbuffer.d.ts", "dependencies": {}, "scripts": { "prepublish": "npm install -g typescript && npm run build", "test": "NODE_ENV=test mocha --recursive --require ts-node/register test/**/*.ts", "coverage": "NODE_ENV=test nyc npm test", "coveralls": "NODE_ENV=test nyc npm test && nyc report --reporter=text-lcov | coveralls", "lint": "tslint --type-check --project tsconfig.json 'src/**/*.ts'", "build": "tsc -p ./" }, "nyc": { "extension": [ ".ts", ".tsx" ], "include": [ "src/*.ts", "src/**/*.ts" ], "exclude": [ "**.*.d.ts", "node_modules", "typings" ], "require": [ "ts-node/register" ], "reporter": [ "json", "html" ], "all": true } } { "name": "socks-proxy-agent", "description": "A SOCKS proxy `http.Agent` implementation for HTTP and HTTPS", "homepage": "https://github.com/TooTallNate/node-socks-proxy-agent#readme", "version": "6.2.1", "main": "dist/index.js", "author": { "email": "nathan@tootallnate.net", "name": "Nathan Rajlich", "url": "http://n8.io/" }, "contributors": [ { "name": "Kiko Beats", "email": "josefrancisco.verdu@gmail.com" }, { "name": "Josh Glazebrook", "email": "josh@joshglazebrook.com" }, { "name": "talmobi", "email": "talmobi@users.noreply.github.com" }, { "name": "Indospace.io", "email": "justin@indospace.io" }, { "name": "Kilian von Pflugk", "email": "github@jumoog.io" }, { "name": "Kyle", "email": "admin@hk1229.cn" }, { "name": "Matheus Fernandes", "email": "matheus.frndes@gmail.com" }, { "name": "Ricky Miller", "email": "richardkazuomiller@gmail.com" }, { "name": "Shantanu Sharma", "email": "shantanu34@outlook.com" }, { "name": "Tim Perry", "email": "pimterry@gmail.com" }, { "name": "Vadim Baryshev", "email": "vadimbaryshev@gmail.com" }, { "name": "jigu", "email": "luo1257857309@gmail.com" }, { "name": "Alba Mendez", "email": "me@jmendeth.com" }, { "name": "Дмитрий Гуденков", "email": "Dimangud@rambler.ru" }, { "name": "Andrei Bitca", "email": "63638922+andrei-bitca-dc@users.noreply.github.com" }, { "name": "Andrew Casey", "email": "amcasey@users.noreply.github.com" }, { "name": "Brandon Ros", "email": "brandonros1@gmail.com" }, { "name": "Dang Duy Thanh", "email": "thanhdd.it@gmail.com" }, { "name": "Dimitar Nestorov", "email": "8790386+dimitarnestorov@users.noreply.github.com" } ], "repository": { "type": "git", "url": "git://github.com/TooTallNate/node-socks-proxy-agent.git" }, "bugs": { "url": "https://github.com/TooTallNate/node-socks-proxy-agent/issues" }, "keywords": [ "agent", "http", "https", "proxy", "socks", "socks4", "socks4a", "socks5", "socks5h" ], "dependencies": { "agent-base": "^6.0.2", "debug": "^4.3.3", "socks": "^2.6.2" }, "devDependencies": { "@commitlint/cli": "latest", "@commitlint/config-conventional": "latest", "@types/debug": "latest", "@types/node": "latest", "cacheable-lookup": "^6.0.4", "conventional-github-releaser": "latest", "dns2": "latest", "finepack": "latest", "git-authors-cli": "latest", "mocha": "9", "nano-staged": "latest", "npm-check-updates": "latest", "prettier-standard": "latest", "raw-body": "latest", "rimraf": "latest", "simple-git-hooks": "latest", "socksv5": "github:TooTallNate/socksv5#fix/dstSock-close-event", "standard": "latest", "standard-markdown": "latest", "standard-version": "latest", "ts-standard": "latest", "typescript": "latest" }, "engines": { "node": ">= 10" }, "files": [ "dist" ], "scripts": { "build": "tsc", "clean": "rimraf node_modules", "contributors": "(git-authors-cli && finepack && git add package.json && git commit -m 'build: contributors' --no-verify) || true", "lint": "ts-standard", "postrelease": "npm run release:tags && npm run release:github && (ci-publish || npm publish --access=public)", "prebuild": "rimraf dist", "prepublishOnly": "npm run build", "prerelease": "npm run update:check && npm run contributors", "release": "standard-version -a", "release:github": "conventional-github-releaser -p angular", "release:tags": "git push --follow-tags origin HEAD:master", "test": "mocha --reporter spec", "update": "ncu -u", "update:check": "ncu -- --error-level 2" }, "license": "MIT", "commitlint": { "extends": [ "@commitlint/config-conventional" ] }, "nano-staged": { "*.js": [ "prettier-standard" ], "*.md": [ "standard-markdown" ], "package.json": [ "finepack" ] }, "simple-git-hooks": { "commit-msg": "npx commitlint --edit", "pre-commit": "npx nano-staged" }, "typings": "dist/index.d.ts" } The MIT License (MIT) Copyright (c) 2013 Josh Glazebrook Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "socks", "private": false, "version": "2.7.0", "description": "Fully featured SOCKS proxy client supporting SOCKSv4, SOCKSv4a, and SOCKSv5. Includes Bind and Associate functionality.", "main": "build/index.js", "typings": "typings/index.d.ts", "homepage": "https://github.com/JoshGlazebrook/socks/", "repository": { "type": "git", "url": "https://github.com/JoshGlazebrook/socks.git" }, "bugs": { "url": "https://github.com/JoshGlazebrook/socks/issues" }, "keywords": [ "socks", "proxy", "tor", "socks 4", "socks 5", "socks4", "socks5" ], "engines": { "node": ">= 10.13.0", "npm": ">= 3.0.0" }, "author": "Josh Glazebrook", "contributors": [ "castorw" ], "license": "MIT", "readmeFilename": "README.md", "devDependencies": { "@types/ip": "1.1.0", "@types/mocha": "^9.1.1", "@types/node": "^18.0.6", "@typescript-eslint/eslint-plugin": "^5.30.6", "@typescript-eslint/parser": "^5.30.6", "eslint": "^8.20.0", "mocha": "^10.0.0", "prettier": "^2.7.1", "ts-node": "^10.9.1", "typescript": "^4.7.4" }, "dependencies": { "ip": "^2.0.0", "smart-buffer": "^4.2.0" }, "scripts": { "prepublish": "npm install -g typescript && npm run build", "test": "NODE_ENV=test mocha --recursive --require ts-node/register test/**/*.ts", "prettier": "prettier --write ./src/**/*.ts --config .prettierrc.yaml", "lint": "eslint 'src/**/*.ts'", "build": "rm -rf build typings && prettier --write ./src/**/*.ts --config .prettierrc.yaml && tsc -p ." } } const { dirname, join, resolve, relative, isAbsolute } = require('path') const rimraf_ = require('rimraf') const { promisify } = require('util') const { access: access_, accessSync, copyFile: copyFile_, copyFileSync, unlink: unlink_, unlinkSync, readdir: readdir_, readdirSync, rename: rename_, renameSync, stat: stat_, statSync, lstat: lstat_, lstatSync, symlink: symlink_, symlinkSync, readlink: readlink_, readlinkSync } = require('fs') const access = promisify(access_) const copyFile = promisify(copyFile_) const unlink = promisify(unlink_) const readdir = promisify(readdir_) const rename = promisify(rename_) const stat = promisify(stat_) const lstat = promisify(lstat_) const symlink = promisify(symlink_) const readlink = promisify(readlink_) const rimraf = promisify(rimraf_) const rimrafSync = rimraf_.sync const mkdirp = require('mkdirp') const pathExists = async path => { try { await access(path) return true } catch (er) { return er.code !== 'ENOENT' } } const pathExistsSync = path => { try { accessSync(path) return true } catch (er) { return er.code !== 'ENOENT' } } const moveFile = async (source, destination, options = {}, root = true, symlinks = []) => { if (!source || !destination) { throw new TypeError('`source` and `destination` file required') } options = { overwrite: true, ...options } if (!options.overwrite && await pathExists(destination)) { throw new Error(`The destination file exists: ${destination}`) } await mkdirp(dirname(destination)) try { await rename(source, destination) } catch (error) { if (error.code === 'EXDEV' || error.code === 'EPERM') { const sourceStat = await lstat(source) if (sourceStat.isDirectory()) { const files = await readdir(source) await Promise.all(files.map((file) => moveFile(join(source, file), join(destination, file), options, false, symlinks))) } else if (sourceStat.isSymbolicLink()) { symlinks.push({ source, destination }) } else { await copyFile(source, destination) } } else { throw error } } if (root) { await Promise.all(symlinks.map(async ({ source, destination }) => { let target = await readlink(source) // junction symlinks in windows will be absolute paths, so we need to make sure they point to the destination if (isAbsolute(target)) target = resolve(destination, relative(source, target)) // try to determine what the actual file is so we can create the correct type of symlink in windows let targetStat try { targetStat = await stat(resolve(dirname(source), target)) } catch (err) {} await symlink(target, destination, targetStat && targetStat.isDirectory() ? 'junction' : 'file') })) await rimraf(source) } } const moveFileSync = (source, destination, options = {}, root = true, symlinks = []) => { if (!source || !destination) { throw new TypeError('`source` and `destination` file required') } options = { overwrite: true, ...options } if (!options.overwrite && pathExistsSync(destination)) { throw new Error(`The destination file exists: ${destination}`) } mkdirp.sync(dirname(destination)) try { renameSync(source, destination) } catch (error) { if (error.code === 'EXDEV' || error.code === 'EPERM') { const sourceStat = lstatSync(source) if (sourceStat.isDirectory()) { const files = readdirSync(source) for (const file of files) { moveFileSync(join(source, file), join(destination, file), options, false, symlinks) } } else if (sourceStat.isSymbolicLink()) { symlinks.push({ source, destination }) } else { copyFileSync(source, destination) } } else { throw error } } if (root) { for (const { source, destination } of symlinks) { let target = readlinkSync(source) // junction symlinks in windows will be absolute paths, so we need to make sure they point to the destination if (isAbsolute(target)) target = resolve(destination, relative(source, target)) // try to determine what the actual file is so we can create the correct type of symlink in windows let targetStat try { targetStat = statSync(resolve(dirname(source), target)) } catch (err) {} symlinkSync(target, destination, targetStat && targetStat.isDirectory() ? 'junction' : 'file') } rimrafSync(source) } } module.exports = moveFile module.exports.sync = moveFileSync MIT License Copyright (c) Sindre Sorhus (https://sindresorhus.com) Copyright (c) npm, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "@npmcli/move-file", "version": "1.1.2", "files": [ "index.js" ], "description": "move a file (fork of move-file)", "dependencies": { "mkdirp": "^1.0.4", "rimraf": "^3.0.2" }, "devDependencies": { "require-inject": "^1.4.4", "tap": "^14.10.7" }, "scripts": { "test": "tap", "snap": "tap", "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags" }, "repository": { "type": "git", "url": "git+https://github.com/npm/move-file" }, "tap": { "check-coverage": true }, "license": "MIT", "engines": { "node": ">=10" } } MIT License Copyright (c) 2020 Nathan Rajlich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "@tootallnate/once", "version": "2.0.0", "description": "Creates a Promise that waits for a single event", "main": "./dist/index.js", "types": "./dist/index.d.ts", "files": [ "dist" ], "scripts": { "prebuild": "rimraf dist", "build": "tsc", "test": "jest", "prepublishOnly": "npm run build" }, "repository": { "type": "git", "url": "git://github.com/TooTallNate/once.git" }, "keywords": [], "author": "Nathan Rajlich (http://n8.io/)", "license": "MIT", "bugs": { "url": "https://github.com/TooTallNate/once/issues" }, "devDependencies": { "@types/jest": "^27.0.2", "@types/node": "^12.12.11", "abort-controller": "^3.0.0", "jest": "^27.2.1", "rimraf": "^3.0.0", "ts-jest": "^27.0.5", "typescript": "^4.4.3" }, "engines": { "node": ">= 10" }, "jest": { "preset": "ts-jest", "globals": { "ts-jest": { "diagnostics": false, "isolatedModules": true } }, "verbose": false, "testEnvironment": "node", "testMatch": [ "/test/**/*.test.ts" ] } } 'use strict' const util = require('util') const crypto = require('crypto') const fs = require('fs') const Minipass = require('minipass') const path = require('path') const ssri = require('ssri') const uniqueFilename = require('unique-filename') const { disposer } = require('./util/disposer') const contentPath = require('./content/path') const fixOwner = require('./util/fix-owner') const hashToSegments = require('./util/hash-to-segments') const indexV = require('../package.json')['cache-version'].index const moveFile = require('@npmcli/move-file') const _rimraf = require('rimraf') const rimraf = util.promisify(_rimraf) rimraf.sync = _rimraf.sync const appendFile = util.promisify(fs.appendFile) const readFile = util.promisify(fs.readFile) const readdir = util.promisify(fs.readdir) const writeFile = util.promisify(fs.writeFile) module.exports.NotFoundError = class NotFoundError extends Error { constructor (cache, key) { super(`No cache entry for ${key} found in ${cache}`) this.code = 'ENOENT' this.cache = cache this.key = key } } module.exports.compact = compact async function compact (cache, key, matchFn, opts = {}) { const bucket = bucketPath(cache, key) const entries = await bucketEntries(bucket) const newEntries = [] // we loop backwards because the bottom-most result is the newest // since we add new entries with appendFile for (let i = entries.length - 1; i >= 0; --i) { const entry = entries[i] // a null integrity could mean either a delete was appended // or the user has simply stored an index that does not map // to any content. we determine if the user wants to keep the // null integrity based on the validateEntry function passed in options. // if the integrity is null and no validateEntry is provided, we break // as we consider the null integrity to be a deletion of everything // that came before it. if (entry.integrity === null && !opts.validateEntry) { break } // if this entry is valid, and it is either the first entry or // the newEntries array doesn't already include an entry that // matches this one based on the provided matchFn, then we add // it to the beginning of our list if ((!opts.validateEntry || opts.validateEntry(entry) === true) && (newEntries.length === 0 || !newEntries.find((oldEntry) => matchFn(oldEntry, entry)))) { newEntries.unshift(entry) } } const newIndex = '\n' + newEntries.map((entry) => { const stringified = JSON.stringify(entry) const hash = hashEntry(stringified) return `${hash}\t${stringified}` }).join('\n') const setup = async () => { const target = uniqueFilename(path.join(cache, 'tmp'), opts.tmpPrefix) await fixOwner.mkdirfix(cache, path.dirname(target)) return { target, moved: false, } } const teardown = async (tmp) => { if (!tmp.moved) { return rimraf(tmp.target) } } const write = async (tmp) => { await writeFile(tmp.target, newIndex, { flag: 'wx' }) await fixOwner.mkdirfix(cache, path.dirname(bucket)) // we use @npmcli/move-file directly here because we // want to overwrite the existing file await moveFile(tmp.target, bucket) tmp.moved = true try { await fixOwner.chownr(cache, bucket) } catch (err) { if (err.code !== 'ENOENT') { throw err } } } // write the file atomically await disposer(setup(), teardown, write) // we reverse the list we generated such that the newest // entries come first in order to make looping through them easier // the true passed to formatEntry tells it to keep null // integrity values, if they made it this far it's because // validateEntry returned true, and as such we should return it return newEntries.reverse().map((entry) => formatEntry(cache, entry, true)) } module.exports.insert = insert function insert (cache, key, integrity, opts = {}) { const { metadata, size } = opts const bucket = bucketPath(cache, key) const entry = { key, integrity: integrity && ssri.stringify(integrity), time: Date.now(), size, metadata, } return fixOwner .mkdirfix(cache, path.dirname(bucket)) .then(() => { const stringified = JSON.stringify(entry) // NOTE - Cleverness ahoy! // // This works because it's tremendously unlikely for an entry to corrupt // another while still preserving the string length of the JSON in // question. So, we just slap the length in there and verify it on read. // // Thanks to @isaacs for the whiteboarding session that ended up with // this. return appendFile(bucket, `\n${hashEntry(stringified)}\t${stringified}`) }) .then(() => fixOwner.chownr(cache, bucket)) .catch((err) => { if (err.code === 'ENOENT') { return undefined } throw err // There's a class of race conditions that happen when things get deleted // during fixOwner, or between the two mkdirfix/chownr calls. // // It's perfectly fine to just not bother in those cases and lie // that the index entry was written. Because it's a cache. }) .then(() => { return formatEntry(cache, entry) }) } module.exports.insert.sync = insertSync function insertSync (cache, key, integrity, opts = {}) { const { metadata, size } = opts const bucket = bucketPath(cache, key) const entry = { key, integrity: integrity && ssri.stringify(integrity), time: Date.now(), size, metadata, } fixOwner.mkdirfix.sync(cache, path.dirname(bucket)) const stringified = JSON.stringify(entry) fs.appendFileSync(bucket, `\n${hashEntry(stringified)}\t${stringified}`) try { fixOwner.chownr.sync(cache, bucket) } catch (err) { if (err.code !== 'ENOENT') { throw err } } return formatEntry(cache, entry) } module.exports.find = find function find (cache, key) { const bucket = bucketPath(cache, key) return bucketEntries(bucket) .then((entries) => { return entries.reduce((latest, next) => { if (next && next.key === key) { return formatEntry(cache, next) } else { return latest } }, null) }) .catch((err) => { if (err.code === 'ENOENT') { return null } else { throw err } }) } module.exports.find.sync = findSync function findSync (cache, key) { const bucket = bucketPath(cache, key) try { return bucketEntriesSync(bucket).reduce((latest, next) => { if (next && next.key === key) { return formatEntry(cache, next) } else { return latest } }, null) } catch (err) { if (err.code === 'ENOENT') { return null } else { throw err } } } module.exports.delete = del function del (cache, key, opts = {}) { if (!opts.removeFully) { return insert(cache, key, null, opts) } const bucket = bucketPath(cache, key) return rimraf(bucket) } module.exports.delete.sync = delSync function delSync (cache, key, opts = {}) { if (!opts.removeFully) { return insertSync(cache, key, null, opts) } const bucket = bucketPath(cache, key) return rimraf.sync(bucket) } module.exports.lsStream = lsStream function lsStream (cache) { const indexDir = bucketDir(cache) const stream = new Minipass({ objectMode: true }) readdirOrEmpty(indexDir).then(buckets => Promise.all( buckets.map(bucket => { const bucketPath = path.join(indexDir, bucket) return readdirOrEmpty(bucketPath).then(subbuckets => Promise.all( subbuckets.map(subbucket => { const subbucketPath = path.join(bucketPath, subbucket) // "/cachename//./*" return readdirOrEmpty(subbucketPath).then(entries => Promise.all( entries.map(entry => { const entryPath = path.join(subbucketPath, entry) return bucketEntries(entryPath).then(entries => // using a Map here prevents duplicate keys from // showing up twice, I guess? entries.reduce((acc, entry) => { acc.set(entry.key, entry) return acc }, new Map()) ).then(reduced => { // reduced is a map of key => entry for (const entry of reduced.values()) { const formatted = formatEntry(cache, entry) if (formatted) { stream.write(formatted) } } }).catch(err => { if (err.code === 'ENOENT') { return undefined } throw err }) }) )) }) )) }) )) .then( () => stream.end(), err => stream.emit('error', err) ) return stream } module.exports.ls = ls function ls (cache) { return lsStream(cache).collect().then(entries => entries.reduce((acc, xs) => { acc[xs.key] = xs return acc }, {}) ) } module.exports.bucketEntries = bucketEntries function bucketEntries (bucket, filter) { return readFile(bucket, 'utf8').then((data) => _bucketEntries(data, filter)) } module.exports.bucketEntries.sync = bucketEntriesSync function bucketEntriesSync (bucket, filter) { const data = fs.readFileSync(bucket, 'utf8') return _bucketEntries(data, filter) } function _bucketEntries (data, filter) { const entries = [] data.split('\n').forEach((entry) => { if (!entry) { return } const pieces = entry.split('\t') if (!pieces[1] || hashEntry(pieces[1]) !== pieces[0]) { // Hash is no good! Corruption or malice? Doesn't matter! // EJECT EJECT return } let obj try { obj = JSON.parse(pieces[1]) } catch (e) { // Entry is corrupted! return } if (obj) { entries.push(obj) } }) return entries } module.exports.bucketDir = bucketDir function bucketDir (cache) { return path.join(cache, `index-v${indexV}`) } module.exports.bucketPath = bucketPath function bucketPath (cache, key) { const hashed = hashKey(key) return path.join.apply( path, [bucketDir(cache)].concat(hashToSegments(hashed)) ) } module.exports.hashKey = hashKey function hashKey (key) { return hash(key, 'sha256') } module.exports.hashEntry = hashEntry function hashEntry (str) { return hash(str, 'sha1') } function hash (str, digest) { return crypto .createHash(digest) .update(str) .digest('hex') } function formatEntry (cache, entry, keepAll) { // Treat null digests as deletions. They'll shadow any previous entries. if (!entry.integrity && !keepAll) { return null } return { key: entry.key, integrity: entry.integrity, path: entry.integrity ? contentPath(cache, entry.integrity) : undefined, size: entry.size, time: entry.time, metadata: entry.metadata, } } function readdirOrEmpty (dir) { return readdir(dir).catch((err) => { if (err.code === 'ENOENT' || err.code === 'ENOTDIR') { return [] } throw err }) } 'use strict' const Collect = require('minipass-collect') const Minipass = require('minipass') const Pipeline = require('minipass-pipeline') const fs = require('fs') const util = require('util') const index = require('./entry-index') const memo = require('./memoization') const read = require('./content/read') const writeFile = util.promisify(fs.writeFile) function getData (cache, key, opts = {}) { const { integrity, memoize, size } = opts const memoized = memo.get(cache, key, opts) if (memoized && memoize !== false) { return Promise.resolve({ metadata: memoized.entry.metadata, data: memoized.data, integrity: memoized.entry.integrity, size: memoized.entry.size, }) } return index.find(cache, key, opts).then((entry) => { if (!entry) { throw new index.NotFoundError(cache, key) } return read(cache, entry.integrity, { integrity, size }).then((data) => { if (memoize) { memo.put(cache, entry, data, opts) } return { data, metadata: entry.metadata, size: entry.size, integrity: entry.integrity, } }) }) } module.exports = getData function getDataByDigest (cache, key, opts = {}) { const { integrity, memoize, size } = opts const memoized = memo.get.byDigest(cache, key, opts) if (memoized && memoize !== false) { return Promise.resolve(memoized) } return read(cache, key, { integrity, size }).then((res) => { if (memoize) { memo.put.byDigest(cache, key, res, opts) } return res }) } module.exports.byDigest = getDataByDigest function getDataSync (cache, key, opts = {}) { const { integrity, memoize, size } = opts const memoized = memo.get(cache, key, opts) if (memoized && memoize !== false) { return { metadata: memoized.entry.metadata, data: memoized.data, integrity: memoized.entry.integrity, size: memoized.entry.size, } } const entry = index.find.sync(cache, key, opts) if (!entry) { throw new index.NotFoundError(cache, key) } const data = read.sync(cache, entry.integrity, { integrity: integrity, size: size, }) const res = { metadata: entry.metadata, data: data, size: entry.size, integrity: entry.integrity, } if (memoize) { memo.put(cache, entry, res.data, opts) } return res } module.exports.sync = getDataSync function getDataByDigestSync (cache, digest, opts = {}) { const { integrity, memoize, size } = opts const memoized = memo.get.byDigest(cache, digest, opts) if (memoized && memoize !== false) { return memoized } const res = read.sync(cache, digest, { integrity: integrity, size: size, }) if (memoize) { memo.put.byDigest(cache, digest, res, opts) } return res } module.exports.sync.byDigest = getDataByDigestSync const getMemoizedStream = (memoized) => { const stream = new Minipass() stream.on('newListener', function (ev, cb) { ev === 'metadata' && cb(memoized.entry.metadata) ev === 'integrity' && cb(memoized.entry.integrity) ev === 'size' && cb(memoized.entry.size) }) stream.end(memoized.data) return stream } function getStream (cache, key, opts = {}) { const { memoize, size } = opts const memoized = memo.get(cache, key, opts) if (memoized && memoize !== false) { return getMemoizedStream(memoized) } const stream = new Pipeline() index .find(cache, key) .then((entry) => { if (!entry) { throw new index.NotFoundError(cache, key) } stream.emit('metadata', entry.metadata) stream.emit('integrity', entry.integrity) stream.emit('size', entry.size) stream.on('newListener', function (ev, cb) { ev === 'metadata' && cb(entry.metadata) ev === 'integrity' && cb(entry.integrity) ev === 'size' && cb(entry.size) }) const src = read.readStream( cache, entry.integrity, { ...opts, size: typeof size !== 'number' ? entry.size : size } ) if (memoize) { const memoStream = new Collect.PassThrough() memoStream.on('collect', data => memo.put(cache, entry, data, opts)) stream.unshift(memoStream) } stream.unshift(src) }) .catch((err) => stream.emit('error', err)) return stream } module.exports.stream = getStream function getStreamDigest (cache, integrity, opts = {}) { const { memoize } = opts const memoized = memo.get.byDigest(cache, integrity, opts) if (memoized && memoize !== false) { const stream = new Minipass() stream.end(memoized) return stream } else { const stream = read.readStream(cache, integrity, opts) if (!memoize) { return stream } const memoStream = new Collect.PassThrough() memoStream.on('collect', data => memo.put.byDigest( cache, integrity, data, opts )) return new Pipeline(stream, memoStream) } } module.exports.stream.byDigest = getStreamDigest function info (cache, key, opts = {}) { const { memoize } = opts const memoized = memo.get(cache, key, opts) if (memoized && memoize !== false) { return Promise.resolve(memoized.entry) } else { return index.find(cache, key) } } module.exports.info = info function copy (cache, key, dest, opts = {}) { if (read.copy) { return index.find(cache, key, opts).then((entry) => { if (!entry) { throw new index.NotFoundError(cache, key) } return read.copy(cache, entry.integrity, dest, opts) .then(() => { return { metadata: entry.metadata, size: entry.size, integrity: entry.integrity, } }) }) } return getData(cache, key, opts).then((res) => { return writeFile(dest, res.data).then(() => { return { metadata: res.metadata, size: res.size, integrity: res.integrity, } }) }) } module.exports.copy = copy function copyByDigest (cache, key, dest, opts = {}) { if (read.copy) { return read.copy(cache, key, dest, opts).then(() => key) } return getDataByDigest(cache, key, opts).then((res) => { return writeFile(dest, res).then(() => key) }) } module.exports.copy.byDigest = copyByDigest module.exports.hasContent = read.hasContent 'use strict' const get = require('./get.js') const put = require('./put.js') const rm = require('./rm.js') const verify = require('./verify.js') const { clearMemoized } = require('./memoization.js') const tmp = require('./util/tmp.js') const index = require('./entry-index.js') module.exports.index = {} module.exports.index.compact = index.compact module.exports.index.insert = index.insert module.exports.ls = index.ls module.exports.ls.stream = index.lsStream module.exports.get = get module.exports.get.byDigest = get.byDigest module.exports.get.sync = get.sync module.exports.get.sync.byDigest = get.sync.byDigest module.exports.get.stream = get.stream module.exports.get.stream.byDigest = get.stream.byDigest module.exports.get.copy = get.copy module.exports.get.copy.byDigest = get.copy.byDigest module.exports.get.info = get.info module.exports.get.hasContent = get.hasContent module.exports.get.hasContent.sync = get.hasContent.sync module.exports.put = put module.exports.put.stream = put.stream module.exports.rm = rm.entry module.exports.rm.all = rm.all module.exports.rm.entry = module.exports.rm module.exports.rm.content = rm.content module.exports.clearMemoized = clearMemoized module.exports.tmp = {} module.exports.tmp.mkdir = tmp.mkdir module.exports.tmp.withTmp = tmp.withTmp module.exports.verify = verify module.exports.verify.lastRun = verify.lastRun 'use strict' const LRU = require('lru-cache') const MEMOIZED = new LRU({ max: 500, maxSize: 50 * 1024 * 1024, // 50MB ttl: 3 * 60 * 1000, // 3 minutes sizeCalculation: (entry, key) => key.startsWith('key:') ? entry.data.length : entry.length, }) module.exports.clearMemoized = clearMemoized function clearMemoized () { const old = {} MEMOIZED.forEach((v, k) => { old[k] = v }) MEMOIZED.clear() return old } module.exports.put = put function put (cache, entry, data, opts) { pickMem(opts).set(`key:${cache}:${entry.key}`, { entry, data }) putDigest(cache, entry.integrity, data, opts) } module.exports.put.byDigest = putDigest function putDigest (cache, integrity, data, opts) { pickMem(opts).set(`digest:${cache}:${integrity}`, data) } module.exports.get = get function get (cache, key, opts) { return pickMem(opts).get(`key:${cache}:${key}`) } module.exports.get.byDigest = getDigest function getDigest (cache, integrity, opts) { return pickMem(opts).get(`digest:${cache}:${integrity}`) } class ObjProxy { constructor (obj) { this.obj = obj } get (key) { return this.obj[key] } set (key, val) { this.obj[key] = val } } function pickMem (opts) { if (!opts || !opts.memoize) { return MEMOIZED } else if (opts.memoize.get && opts.memoize.set) { return opts.memoize } else if (typeof opts.memoize === 'object') { return new ObjProxy(opts.memoize) } else { return MEMOIZED } } 'use strict' const index = require('./entry-index') const memo = require('./memoization') const write = require('./content/write') const Flush = require('minipass-flush') const { PassThrough } = require('minipass-collect') const Pipeline = require('minipass-pipeline') const putOpts = (opts) => ({ algorithms: ['sha512'], ...opts, }) module.exports = putData function putData (cache, key, data, opts = {}) { const { memoize } = opts opts = putOpts(opts) return write(cache, data, opts).then((res) => { return index .insert(cache, key, res.integrity, { ...opts, size: res.size }) .then((entry) => { if (memoize) { memo.put(cache, entry, data, opts) } return res.integrity }) }) } module.exports.stream = putStream function putStream (cache, key, opts = {}) { const { memoize } = opts opts = putOpts(opts) let integrity let size let memoData const pipeline = new Pipeline() // first item in the pipeline is the memoizer, because we need // that to end first and get the collected data. if (memoize) { const memoizer = new PassThrough().on('collect', data => { memoData = data }) pipeline.push(memoizer) } // contentStream is a write-only, not a passthrough // no data comes out of it. const contentStream = write.stream(cache, opts) .on('integrity', (int) => { integrity = int }) .on('size', (s) => { size = s }) pipeline.push(contentStream) // last but not least, we write the index and emit hash and size, // and memoize if we're doing that pipeline.push(new Flush({ flush () { return index .insert(cache, key, integrity, { ...opts, size }) .then((entry) => { if (memoize && memoData) { memo.put(cache, entry, memoData, opts) } if (integrity) { pipeline.emit('integrity', integrity) } if (size) { pipeline.emit('size', size) } }) }, })) return pipeline } 'use strict' const util = require('util') const index = require('./entry-index') const memo = require('./memoization') const path = require('path') const rimraf = util.promisify(require('rimraf')) const rmContent = require('./content/rm') module.exports = entry module.exports.entry = entry function entry (cache, key, opts) { memo.clearMemoized() return index.delete(cache, key, opts) } module.exports.content = content function content (cache, integrity) { memo.clearMemoized() return rmContent(cache, integrity) } module.exports.all = all function all (cache) { memo.clearMemoized() return rimraf(path.join(cache, '*(content-*|index-*)')) } 'use strict' const util = require('util') const pMap = require('p-map') const contentPath = require('./content/path') const fixOwner = require('./util/fix-owner') const fs = require('fs') const fsm = require('fs-minipass') const glob = util.promisify(require('glob')) const index = require('./entry-index') const path = require('path') const rimraf = util.promisify(require('rimraf')) const ssri = require('ssri') const hasOwnProperty = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key) const stat = util.promisify(fs.stat) const truncate = util.promisify(fs.truncate) const writeFile = util.promisify(fs.writeFile) const readFile = util.promisify(fs.readFile) const verifyOpts = (opts) => ({ concurrency: 20, log: { silly () {} }, ...opts, }) module.exports = verify function verify (cache, opts) { opts = verifyOpts(opts) opts.log.silly('verify', 'verifying cache at', cache) const steps = [ markStartTime, fixPerms, garbageCollect, rebuildIndex, cleanTmp, writeVerifile, markEndTime, ] return steps .reduce((promise, step, i) => { const label = step.name const start = new Date() return promise.then((stats) => { return step(cache, opts).then((s) => { s && Object.keys(s).forEach((k) => { stats[k] = s[k] }) const end = new Date() if (!stats.runTime) { stats.runTime = {} } stats.runTime[label] = end - start return Promise.resolve(stats) }) }) }, Promise.resolve({})) .then((stats) => { stats.runTime.total = stats.endTime - stats.startTime opts.log.silly( 'verify', 'verification finished for', cache, 'in', `${stats.runTime.total}ms` ) return stats }) } function markStartTime (cache, opts) { return Promise.resolve({ startTime: new Date() }) } function markEndTime (cache, opts) { return Promise.resolve({ endTime: new Date() }) } function fixPerms (cache, opts) { opts.log.silly('verify', 'fixing cache permissions') return fixOwner .mkdirfix(cache, cache) .then(() => { // TODO - fix file permissions too return fixOwner.chownr(cache, cache) }) .then(() => null) } // Implements a naive mark-and-sweep tracing garbage collector. // // The algorithm is basically as follows: // 1. Read (and filter) all index entries ("pointers") // 2. Mark each integrity value as "live" // 3. Read entire filesystem tree in `content-vX/` dir // 4. If content is live, verify its checksum and delete it if it fails // 5. If content is not marked as live, rimraf it. // function garbageCollect (cache, opts) { opts.log.silly('verify', 'garbage collecting content') const indexStream = index.lsStream(cache) const liveContent = new Set() indexStream.on('data', (entry) => { if (opts.filter && !opts.filter(entry)) { return } liveContent.add(entry.integrity.toString()) }) return new Promise((resolve, reject) => { indexStream.on('end', resolve).on('error', reject) }).then(() => { const contentDir = contentPath.contentDir(cache) return glob(path.join(contentDir, '**'), { follow: false, nodir: true, nosort: true, }).then((files) => { return Promise.resolve({ verifiedContent: 0, reclaimedCount: 0, reclaimedSize: 0, badContentCount: 0, keptSize: 0, }).then((stats) => pMap( files, (f) => { const split = f.split(/[/\\]/) const digest = split.slice(split.length - 3).join('') const algo = split[split.length - 4] const integrity = ssri.fromHex(digest, algo) if (liveContent.has(integrity.toString())) { return verifyContent(f, integrity).then((info) => { if (!info.valid) { stats.reclaimedCount++ stats.badContentCount++ stats.reclaimedSize += info.size } else { stats.verifiedContent++ stats.keptSize += info.size } return stats }) } else { // No entries refer to this content. We can delete. stats.reclaimedCount++ return stat(f).then((s) => { return rimraf(f).then(() => { stats.reclaimedSize += s.size return stats }) }) } }, { concurrency: opts.concurrency } ).then(() => stats) ) }) }) } function verifyContent (filepath, sri) { return stat(filepath) .then((s) => { const contentInfo = { size: s.size, valid: true, } return ssri .checkStream(new fsm.ReadStream(filepath), sri) .catch((err) => { if (err.code !== 'EINTEGRITY') { throw err } return rimraf(filepath).then(() => { contentInfo.valid = false }) }) .then(() => contentInfo) }) .catch((err) => { if (err.code === 'ENOENT') { return { size: 0, valid: false } } throw err }) } function rebuildIndex (cache, opts) { opts.log.silly('verify', 'rebuilding index') return index.ls(cache).then((entries) => { const stats = { missingContent: 0, rejectedEntries: 0, totalEntries: 0, } const buckets = {} for (const k in entries) { /* istanbul ignore else */ if (hasOwnProperty(entries, k)) { const hashed = index.hashKey(k) const entry = entries[k] const excluded = opts.filter && !opts.filter(entry) excluded && stats.rejectedEntries++ if (buckets[hashed] && !excluded) { buckets[hashed].push(entry) } else if (buckets[hashed] && excluded) { // skip } else if (excluded) { buckets[hashed] = [] buckets[hashed]._path = index.bucketPath(cache, k) } else { buckets[hashed] = [entry] buckets[hashed]._path = index.bucketPath(cache, k) } } } return pMap( Object.keys(buckets), (key) => { return rebuildBucket(cache, buckets[key], stats, opts) }, { concurrency: opts.concurrency } ).then(() => stats) }) } function rebuildBucket (cache, bucket, stats, opts) { return truncate(bucket._path).then(() => { // This needs to be serialized because cacache explicitly // lets very racy bucket conflicts clobber each other. return bucket.reduce((promise, entry) => { return promise.then(() => { const content = contentPath(cache, entry.integrity) return stat(content) .then(() => { return index .insert(cache, entry.key, entry.integrity, { metadata: entry.metadata, size: entry.size, }) .then(() => { stats.totalEntries++ }) }) .catch((err) => { if (err.code === 'ENOENT') { stats.rejectedEntries++ stats.missingContent++ return } throw err }) }) }, Promise.resolve()) }) } function cleanTmp (cache, opts) { opts.log.silly('verify', 'cleaning tmp directory') return rimraf(path.join(cache, 'tmp')) } function writeVerifile (cache, opts) { const verifile = path.join(cache, '_lastverified') opts.log.silly('verify', 'writing verifile to ' + verifile) try { return writeFile(verifile, '' + +new Date()) } finally { fixOwner.chownr.sync(cache, verifile) } } module.exports.lastRun = lastRun function lastRun (cache) { return readFile(path.join(cache, '_lastverified'), 'utf8').then( (data) => new Date(+data) ) } "use strict"; function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } (function (f) { if ((typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined") { module.exports = f(); } else if (typeof define === "function" && define.amd) { define([], f); } else { var g; if (typeof window !== "undefined") { g = window; } else if (typeof global !== "undefined") { g = global; } else if (typeof self !== "undefined") { g = self; } else { g = this; } g.debug = f(); } })(function () { var define, module, exports; return function () { function r(e, n, t) { function o(i, f) { if (!n[i]) { if (!e[i]) { var c = "function" == typeof require && require; if (!f && c) return c(i, !0); if (u) return u(i, !0); var a = new Error("Cannot find module '" + i + "'"); throw a.code = "MODULE_NOT_FOUND", a; } var p = n[i] = { exports: {} }; e[i][0].call(p.exports, function (r) { var n = e[i][1][r]; return o(n || r); }, p, p.exports, r, e, n, t); } return n[i].exports; } for (var u = "function" == typeof require && require, i = 0; i < t.length; i++) { o(t[i]); } return o; } return r; }()({ 1: [function (require, module, exports) { /** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; var w = d * 7; var y = d * 365.25; /** * Parse or format the given `val`. * * Options: * * - `long` verbose formatting [false] * * @param {String|Number} val * @param {Object} [options] * @throws {Error} throw an error if val is not a non-empty string or a number * @return {String|Number} * @api public */ module.exports = function (val, options) { options = options || {}; var type = _typeof(val); if (type === 'string' && val.length > 0) { return parse(val); } else if (type === 'number' && isNaN(val) === false) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val)); }; /** * Parse the given `str` and return milliseconds. * * @param {String} str * @return {Number} * @api private */ function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'yrs': case 'yr': case 'y': return n * y; case 'weeks': case 'week': case 'w': return n * w; case 'days': case 'day': case 'd': return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': return n * m; case 'seconds': case 'second': case 'secs': case 'sec': case 's': return n * s; case 'milliseconds': case 'millisecond': case 'msecs': case 'msec': case 'ms': return n; default: return undefined; } } /** * Short format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtShort(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return Math.round(ms / d) + 'd'; } if (msAbs >= h) { return Math.round(ms / h) + 'h'; } if (msAbs >= m) { return Math.round(ms / m) + 'm'; } if (msAbs >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtLong(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return plural(ms, msAbs, d, 'day'); } if (msAbs >= h) { return plural(ms, msAbs, h, 'hour'); } if (msAbs >= m) { return plural(ms, msAbs, m, 'minute'); } if (msAbs >= s) { return plural(ms, msAbs, s, 'second'); } return ms + ' ms'; } /** * Pluralization helper. */ function plural(ms, msAbs, n, name) { var isPlural = msAbs >= n * 1.5; return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); } }, {}], 2: [function (require, module, exports) { // shim for using process in browser var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it // don't break things. But we need to wrap it in a try catch in case it is // wrapped in strict mode code which doesn't define any globals. It's inside a // function because try/catches deoptimize in certain engines. var cachedSetTimeout; var cachedClearTimeout; function defaultSetTimout() { throw new Error('setTimeout has not been defined'); } function defaultClearTimeout() { throw new Error('clearTimeout has not been defined'); } (function () { try { if (typeof setTimeout === 'function') { cachedSetTimeout = setTimeout; } else { cachedSetTimeout = defaultSetTimout; } } catch (e) { cachedSetTimeout = defaultSetTimout; } try { if (typeof clearTimeout === 'function') { cachedClearTimeout = clearTimeout; } else { cachedClearTimeout = defaultClearTimeout; } } catch (e) { cachedClearTimeout = defaultClearTimeout; } })(); function runTimeout(fun) { if (cachedSetTimeout === setTimeout) { //normal enviroments in sane situations return setTimeout(fun, 0); } // if setTimeout wasn't available but was latter defined if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout; return setTimeout(fun, 0); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedSetTimeout(fun, 0); } catch (e) { try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedSetTimeout.call(null, fun, 0); } catch (e) { // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { //normal enviroments in sane situations return clearTimeout(marker); } // if clearTimeout wasn't available but was latter defined if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout; return clearTimeout(marker); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedClearTimeout(marker); } catch (e) { try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedClearTimeout.call(null, marker); } catch (e) { // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. // Some versions of I.E. have different rules for clearTimeout vs setTimeout return cachedClearTimeout.call(this, marker); } } } var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; while (len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; runClearTimeout(timeout); } process.nextTick = function (fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { runTimeout(drainQueue); } }; // v8 likes predictible objects function Item(fun, array) { this.fun = fun; this.array = array; } Item.prototype.run = function () { this.fun.apply(null, this.array); }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues process.versions = {}; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.prependListener = noop; process.prependOnceListener = noop; process.listeners = function (name) { return []; }; process.binding = function (name) { throw new Error('process.binding is not supported'); }; process.cwd = function () { return '/'; }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; process.umask = function () { return 0; }; }, {}], 3: [function (require, module, exports) { /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. */ function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = require('ms'); Object.keys(env).forEach(function (key) { createDebug[key] = env[key]; }); /** * Active `debug` instances. */ createDebug.instances = []; /** * The currently active debug mode names, and names to skip. */ createDebug.names = []; createDebug.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ createDebug.formatters = {}; /** * Selects a color for a debug namespace * @param {String} namespace The namespace string for the for the debug instance to be colored * @return {Number|String} An ANSI color code for the given namespace * @api private */ function selectColor(namespace) { var hash = 0; for (var i = 0; i < namespace.length; i++) { hash = (hash << 5) - hash + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { var prevTime; function debug() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } // Disabled? if (!debug.enabled) { return; } var self = debug; // Set `diff` timestamp var curr = Number(new Date()); var ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== 'string') { // Anything else let's inspect with %O args.unshift('%O'); } // Apply any `formatters` transformations var index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) { // If we encounter an escaped % then don't increase the array index if (match === '%%') { return match; } index++; var formatter = createDebug.formatters[format]; if (typeof formatter === 'function') { var val = args[index]; match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // Apply env-specific formatting (colors, etc.) createDebug.formatArgs.call(self, args); var logFn = self.log || createDebug.log; logFn.apply(self, args); } debug.namespace = namespace; debug.enabled = createDebug.enabled(namespace); debug.useColors = createDebug.useColors(); debug.color = selectColor(namespace); debug.destroy = destroy; debug.extend = extend; // Debug.formatArgs = formatArgs; // debug.rawLog = rawLog; // env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } createDebug.instances.push(debug); return debug; } function destroy() { var index = createDebug.instances.indexOf(this); if (index !== -1) { createDebug.instances.splice(index, 1); return true; } return false; } function extend(namespace, delimiter) { var newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); newDebug.log = this.log; return newDebug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { createDebug.save(namespaces); createDebug.names = []; createDebug.skips = []; var i; var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); var len = split.length; for (i = 0; i < len; i++) { if (!split[i]) { // ignore empty strings continue; } namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else { createDebug.names.push(new RegExp('^' + namespaces + '$')); } } for (i = 0; i < createDebug.instances.length; i++) { var instance = createDebug.instances[i]; instance.enabled = createDebug.enabled(instance.namespace); } } /** * Disable debug output. * * @return {String} namespaces * @api public */ function disable() { var namespaces = [].concat(_toConsumableArray(createDebug.names.map(toNamespace)), _toConsumableArray(createDebug.skips.map(toNamespace).map(function (namespace) { return '-' + namespace; }))).join(','); createDebug.enable(''); return namespaces; } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { if (name[name.length - 1] === '*') { return true; } var i; var len; for (i = 0, len = createDebug.skips.length; i < len; i++) { if (createDebug.skips[i].test(name)) { return false; } } for (i = 0, len = createDebug.names.length; i < len; i++) { if (createDebug.names[i].test(name)) { return true; } } return false; } /** * Convert regexp to namespace * * @param {RegExp} regxep * @return {String} namespace * @api private */ function toNamespace(regexp) { return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, '*'); } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } createDebug.enable(createDebug.load()); return createDebug; } module.exports = setup; }, { "ms": 1 }], 4: [function (require, module, exports) { (function (process) { /* eslint-env browser */ /** * This is the web browser implementation of `debug()`. */ exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); /** * Colors. */ exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33']; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ // eslint-disable-next-line complexity function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { return true; } // Internet Explorer and Edge do not support colors. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); } /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); if (!this.useColors) { return; } var c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into var index = 0; var lastC = 0; args[0].replace(/%[a-zA-Z%]/g, function (match) { if (match === '%%') { return; } index++; if (match === '%c') { // We only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.log()` when available. * No-op when `console.log` is not a "function". * * @api public */ function log() { var _console; // This hackery is required for IE8/9, where // the `console.log` function doesn't have 'apply' return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (namespaces) { exports.storage.setItem('debug', namespaces); } else { exports.storage.removeItem('debug'); } } catch (error) {// Swallow // XXX (@Qix-) should we be logging these? } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { var r; try { r = exports.storage.getItem('debug'); } catch (error) {} // Swallow // XXX (@Qix-) should we be logging these? // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context // The Browser also has localStorage in the global context. return localStorage; } catch (error) {// Swallow // XXX (@Qix-) should we be logging these? } } module.exports = require('./common')(exports); var formatters = module.exports.formatters; /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ formatters.j = function (v) { try { return JSON.stringify(v); } catch (error) { return '[UnexpectedJSONParseError]: ' + error.message; } }; }).call(this, require('_process')); }, { "./common": 3, "_process": 2 }] }, {}, [4])(4); }); /* eslint-env browser */ /** * This is the web browser implementation of `debug()`. */ exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); /** * Colors. */ exports.colors = [ '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33' ]; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ // eslint-disable-next-line complexity function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { return true; } // Internet Explorer and Edge do not support colors. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || // Is firebug? http://stackoverflow.com/a/398120/376773 (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || // Double check webkit in userAgent just in case we are in a worker (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); } /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); if (!this.useColors) { return; } const c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into let index = 0; let lastC = 0; args[0].replace(/%[a-zA-Z%]/g, match => { if (match === '%%') { return; } index++; if (match === '%c') { // We only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.log()` when available. * No-op when `console.log` is not a "function". * * @api public */ function log(...args) { // This hackery is required for IE8/9, where // the `console.log` function doesn't have 'apply' return typeof console === 'object' && console.log && console.log(...args); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (namespaces) { exports.storage.setItem('debug', namespaces); } else { exports.storage.removeItem('debug'); } } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { let r; try { r = exports.storage.getItem('debug'); } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context // The Browser also has localStorage in the global context. return localStorage; } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } module.exports = require('./common')(exports); const {formatters} = module.exports; /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ formatters.j = function (v) { try { return JSON.stringify(v); } catch (error) { return '[UnexpectedJSONParseError]: ' + error.message; } }; /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. */ function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = require('ms'); Object.keys(env).forEach(key => { createDebug[key] = env[key]; }); /** * Active `debug` instances. */ createDebug.instances = []; /** * The currently active debug mode names, and names to skip. */ createDebug.names = []; createDebug.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ createDebug.formatters = {}; /** * Selects a color for a debug namespace * @param {String} namespace The namespace string for the for the debug instance to be colored * @return {Number|String} An ANSI color code for the given namespace * @api private */ function selectColor(namespace) { let hash = 0; for (let i = 0; i < namespace.length; i++) { hash = ((hash << 5) - hash) + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { let prevTime; function debug(...args) { // Disabled? if (!debug.enabled) { return; } const self = debug; // Set `diff` timestamp const curr = Number(new Date()); const ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== 'string') { // Anything else let's inspect with %O args.unshift('%O'); } // Apply any `formatters` transformations let index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { // If we encounter an escaped % then don't increase the array index if (match === '%%') { return match; } index++; const formatter = createDebug.formatters[format]; if (typeof formatter === 'function') { const val = args[index]; match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // Apply env-specific formatting (colors, etc.) createDebug.formatArgs.call(self, args); const logFn = self.log || createDebug.log; logFn.apply(self, args); } debug.namespace = namespace; debug.enabled = createDebug.enabled(namespace); debug.useColors = createDebug.useColors(); debug.color = selectColor(namespace); debug.destroy = destroy; debug.extend = extend; // Debug.formatArgs = formatArgs; // debug.rawLog = rawLog; // env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } createDebug.instances.push(debug); return debug; } function destroy() { const index = createDebug.instances.indexOf(this); if (index !== -1) { createDebug.instances.splice(index, 1); return true; } return false; } function extend(namespace, delimiter) { const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); newDebug.log = this.log; return newDebug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { createDebug.save(namespaces); createDebug.names = []; createDebug.skips = []; let i; const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); const len = split.length; for (i = 0; i < len; i++) { if (!split[i]) { // ignore empty strings continue; } namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else { createDebug.names.push(new RegExp('^' + namespaces + '$')); } } for (i = 0; i < createDebug.instances.length; i++) { const instance = createDebug.instances[i]; instance.enabled = createDebug.enabled(instance.namespace); } } /** * Disable debug output. * * @return {String} namespaces * @api public */ function disable() { const namespaces = [ ...createDebug.names.map(toNamespace), ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) ].join(','); createDebug.enable(''); return namespaces; } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { if (name[name.length - 1] === '*') { return true; } let i; let len; for (i = 0, len = createDebug.skips.length; i < len; i++) { if (createDebug.skips[i].test(name)) { return false; } } for (i = 0, len = createDebug.names.length; i < len; i++) { if (createDebug.names[i].test(name)) { return true; } } return false; } /** * Convert regexp to namespace * * @param {RegExp} regxep * @return {String} namespace * @api private */ function toNamespace(regexp) { return regexp.toString() .substring(2, regexp.toString().length - 2) .replace(/\.\*\?$/, '*'); } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } createDebug.enable(createDebug.load()); return createDebug; } module.exports = setup; /** * Detect Electron renderer / nwjs process, which is node, but we should * treat as a browser. */ if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { module.exports = require('./browser.js'); } else { module.exports = require('./node.js'); } /** * Module dependencies. */ const tty = require('tty'); const util = require('util'); /** * This is the Node.js implementation of `debug()`. */ exports.init = init; exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; /** * Colors. */ exports.colors = [6, 2, 3, 4, 5, 1]; try { // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) // eslint-disable-next-line import/no-extraneous-dependencies const supportsColor = require('supports-color'); if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { exports.colors = [ 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221 ]; } } catch (error) { // Swallow - we only care if `supports-color` is available; it doesn't have to be. } /** * Build up the default `inspectOpts` object from the environment variables. * * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js */ exports.inspectOpts = Object.keys(process.env).filter(key => { return /^debug_/i.test(key); }).reduce((obj, key) => { // Camel-case const prop = key .substring(6) .toLowerCase() .replace(/_([a-z])/g, (_, k) => { return k.toUpperCase(); }); // Coerce string value into JS value let val = process.env[key]; if (/^(yes|on|true|enabled)$/i.test(val)) { val = true; } else if (/^(no|off|false|disabled)$/i.test(val)) { val = false; } else if (val === 'null') { val = null; } else { val = Number(val); } obj[prop] = val; return obj; }, {}); /** * Is stdout a TTY? Colored output is enabled when `true`. */ function useColors() { return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd); } /** * Adds ANSI color escape codes if enabled. * * @api public */ function formatArgs(args) { const {namespace: name, useColors} = this; if (useColors) { const c = this.color; const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); const prefix = ` ${colorCode};1m${name} \u001B[0m`; args[0] = prefix + args[0].split('\n').join('\n' + prefix); args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); } else { args[0] = getDate() + name + ' ' + args[0]; } } function getDate() { if (exports.inspectOpts.hideDate) { return ''; } return new Date().toISOString() + ' '; } /** * Invokes `util.format()` with the specified arguments and writes to stderr. */ function log(...args) { return process.stderr.write(util.format(...args) + '\n'); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { if (namespaces) { process.env.DEBUG = namespaces; } else { // If you set a process.env field to null or undefined, it gets cast to the // string 'null' or 'undefined'. Just delete instead. delete process.env.DEBUG; } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { return process.env.DEBUG; } /** * Init logic for `debug` instances. * * Create a new `inspectOpts` object in case `useColors` is set * differently for a particular `debug` instance. */ function init(debug) { debug.inspectOpts = {}; const keys = Object.keys(exports.inspectOpts); for (let i = 0; i < keys.length; i++) { debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; } } module.exports = require('./common')(exports); const {formatters} = module.exports; /** * Map %o to `util.inspect()`, all on a single line. */ formatters.o = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts) .replace(/\s*\n\s*/g, ' '); }; /** * Map %O to `util.inspect()`, allowing multiple lines if needed. */ formatters.O = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts); }; "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const net_1 = __importDefault(require("net")); const tls_1 = __importDefault(require("tls")); const url_1 = __importDefault(require("url")); const debug_1 = __importDefault(require("debug")); const once_1 = __importDefault(require("@tootallnate/once")); const agent_base_1 = require("agent-base"); const debug = (0, debug_1.default)('http-proxy-agent'); function isHTTPS(protocol) { return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false; } /** * The `HttpProxyAgent` implements an HTTP Agent subclass that connects * to the specified "HTTP proxy server" in order to proxy HTTP requests. * * @api public */ class HttpProxyAgent extends agent_base_1.Agent { constructor(_opts) { let opts; if (typeof _opts === 'string') { opts = url_1.default.parse(_opts); } else { opts = _opts; } if (!opts) { throw new Error('an HTTP(S) proxy server `host` and `port` must be specified!'); } debug('Creating new HttpProxyAgent instance: %o', opts); super(opts); const proxy = Object.assign({}, opts); // If `true`, then connect to the proxy server over TLS. // Defaults to `false`. this.secureProxy = opts.secureProxy || isHTTPS(proxy.protocol); // Prefer `hostname` over `host`, and set the `port` if needed. proxy.host = proxy.hostname || proxy.host; if (typeof proxy.port === 'string') { proxy.port = parseInt(proxy.port, 10); } if (!proxy.port && proxy.host) { proxy.port = this.secureProxy ? 443 : 80; } if (proxy.host && proxy.path) { // If both a `host` and `path` are specified then it's most likely // the result of a `url.parse()` call... we need to remove the // `path` portion so that `net.connect()` doesn't attempt to open // that as a Unix socket file. delete proxy.path; delete proxy.pathname; } this.proxy = proxy; } /** * Called when the node-core HTTP client library is creating a * new HTTP request. * * @api protected */ callback(req, opts) { return __awaiter(this, void 0, void 0, function* () { const { proxy, secureProxy } = this; const parsed = url_1.default.parse(req.path); if (!parsed.protocol) { parsed.protocol = 'http:'; } if (!parsed.hostname) { parsed.hostname = opts.hostname || opts.host || null; } if (parsed.port == null && typeof opts.port) { parsed.port = String(opts.port); } if (parsed.port === '80') { // if port is 80, then we can remove the port so that the // ":80" portion is not on the produced URL parsed.port = ''; } // Change the `http.ClientRequest` instance's "path" field // to the absolute path of the URL that will be requested. req.path = url_1.default.format(parsed); // Inject the `Proxy-Authorization` header if necessary. if (proxy.auth) { req.setHeader('Proxy-Authorization', `Basic ${Buffer.from(proxy.auth).toString('base64')}`); } // Create a socket connection to the proxy server. let socket; if (secureProxy) { debug('Creating `tls.Socket`: %o', proxy); socket = tls_1.default.connect(proxy); } else { debug('Creating `net.Socket`: %o', proxy); socket = net_1.default.connect(proxy); } // At this point, the http ClientRequest's internal `_header` field // might have already been set. If this is the case then we'll need // to re-generate the string since we just changed the `req.path`. if (req._header) { let first; let endOfHeaders; debug('Regenerating stored HTTP header string for request'); req._header = null; req._implicitHeader(); if (req.output && req.output.length > 0) { // Node < 12 debug('Patching connection write() output buffer with updated header'); first = req.output[0]; endOfHeaders = first.indexOf('\r\n\r\n') + 4; req.output[0] = req._header + first.substring(endOfHeaders); debug('Output buffer: %o', req.output); } else if (req.outputData && req.outputData.length > 0) { // Node >= 12 debug('Patching connection write() output buffer with updated header'); first = req.outputData[0].data; endOfHeaders = first.indexOf('\r\n\r\n') + 4; req.outputData[0].data = req._header + first.substring(endOfHeaders); debug('Output buffer: %o', req.outputData[0].data); } } // Wait for the socket's `connect` event, so that this `callback()` // function throws instead of the `http` request machinery. This is // important for i.e. `PacProxyAgent` which determines a failed proxy // connection via the `callback()` function throwing. yield (0, once_1.default)(socket, 'connect'); return socket; }); } } exports.default = HttpProxyAgent;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/make-fetch-happen/node_modules/http-proxy-agent/dist/agent.js.map"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; const agent_1 = __importDefault(require("./agent")); function createHttpProxyAgent(opts) { return new agent_1.default(opts); } (function (createHttpProxyAgent) { createHttpProxyAgent.HttpProxyAgent = agent_1.default; createHttpProxyAgent.prototype = agent_1.default.prototype; })(createHttpProxyAgent || (createHttpProxyAgent = {})); module.exports = createHttpProxyAgent;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/make-fetch-happen/node_modules/http-proxy-agent/dist/index.js.map"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const net_1 = __importDefault(require("net")); const tls_1 = __importDefault(require("tls")); const url_1 = __importDefault(require("url")); const assert_1 = __importDefault(require("assert")); const debug_1 = __importDefault(require("debug")); const agent_base_1 = require("agent-base"); const parse_proxy_response_1 = __importDefault(require("./parse-proxy-response")); const debug = debug_1.default('https-proxy-agent:agent'); /** * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to * the specified "HTTP(s) proxy server" in order to proxy HTTPS requests. * * Outgoing HTTP requests are first tunneled through the proxy server using the * `CONNECT` HTTP request method to establish a connection to the proxy server, * and then the proxy server connects to the destination target and issues the * HTTP request from the proxy server. * * `https:` requests have their socket connection upgraded to TLS once * the connection to the proxy server has been established. * * @api public */ class HttpsProxyAgent extends agent_base_1.Agent { constructor(_opts) { let opts; if (typeof _opts === 'string') { opts = url_1.default.parse(_opts); } else { opts = _opts; } if (!opts) { throw new Error('an HTTP(S) proxy server `host` and `port` must be specified!'); } debug('creating new HttpsProxyAgent instance: %o', opts); super(opts); const proxy = Object.assign({}, opts); // If `true`, then connect to the proxy server over TLS. // Defaults to `false`. this.secureProxy = opts.secureProxy || isHTTPS(proxy.protocol); // Prefer `hostname` over `host`, and set the `port` if needed. proxy.host = proxy.hostname || proxy.host; if (typeof proxy.port === 'string') { proxy.port = parseInt(proxy.port, 10); } if (!proxy.port && proxy.host) { proxy.port = this.secureProxy ? 443 : 80; } // ALPN is supported by Node.js >= v5. // attempt to negotiate http/1.1 for proxy servers that support http/2 if (this.secureProxy && !('ALPNProtocols' in proxy)) { proxy.ALPNProtocols = ['http 1.1']; } if (proxy.host && proxy.path) { // If both a `host` and `path` are specified then it's most likely // the result of a `url.parse()` call... we need to remove the // `path` portion so that `net.connect()` doesn't attempt to open // that as a Unix socket file. delete proxy.path; delete proxy.pathname; } this.proxy = proxy; } /** * Called when the node-core HTTP client library is creating a * new HTTP request. * * @api protected */ callback(req, opts) { return __awaiter(this, void 0, void 0, function* () { const { proxy, secureProxy } = this; // Create a socket connection to the proxy server. let socket; if (secureProxy) { debug('Creating `tls.Socket`: %o', proxy); socket = tls_1.default.connect(proxy); } else { debug('Creating `net.Socket`: %o', proxy); socket = net_1.default.connect(proxy); } const headers = Object.assign({}, proxy.headers); const hostname = `${opts.host}:${opts.port}`; let payload = `CONNECT ${hostname} HTTP/1.1\r\n`; // Inject the `Proxy-Authorization` header if necessary. if (proxy.auth) { headers['Proxy-Authorization'] = `Basic ${Buffer.from(proxy.auth).toString('base64')}`; } // The `Host` header should only include the port // number when it is not the default port. let { host, port, secureEndpoint } = opts; if (!isDefaultPort(port, secureEndpoint)) { host += `:${port}`; } headers.Host = host; headers.Connection = 'close'; for (const name of Object.keys(headers)) { payload += `${name}: ${headers[name]}\r\n`; } const proxyResponsePromise = parse_proxy_response_1.default(socket); socket.write(`${payload}\r\n`); const { statusCode, buffered } = yield proxyResponsePromise; if (statusCode === 200) { req.once('socket', resume); if (opts.secureEndpoint) { const servername = opts.servername || opts.host; if (!servername) { throw new Error('Could not determine "servername"'); } // The proxy is connecting to a TLS server, so upgrade // this socket connection to a TLS connection. debug('Upgrading socket connection to TLS'); return tls_1.default.connect(Object.assign(Object.assign({}, omit(opts, 'host', 'hostname', 'path', 'port')), { socket, servername })); } return socket; } // Some other status code that's not 200... need to re-play the HTTP // header "data" events onto the socket once the HTTP machinery is // attached so that the node core `http` can parse and handle the // error status code. // Close the original socket, and a new "fake" socket is returned // instead, so that the proxy doesn't get the HTTP request // written to it (which may contain `Authorization` headers or other // sensitive data). // // See: https://hackerone.com/reports/541502 socket.destroy(); const fakeSocket = new net_1.default.Socket(); fakeSocket.readable = true; // Need to wait for the "socket" event to re-play the "data" events. req.once('socket', (s) => { debug('replaying proxy buffer for failed request'); assert_1.default(s.listenerCount('data') > 0); // Replay the "buffered" Buffer onto the fake `socket`, since at // this point the HTTP module machinery has been hooked up for // the user. s.push(buffered); s.push(null); }); return fakeSocket; }); } } exports.default = HttpsProxyAgent; function resume(socket) { socket.resume(); } function isDefaultPort(port, secure) { return Boolean((!secure && port === 80) || (secure && port === 443)); } function isHTTPS(protocol) { return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false; } function omit(obj, ...keys) { const ret = {}; let key; for (key in obj) { if (!keys.includes(key)) { ret[key] = obj[key]; } } return ret; }//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/make-fetch-happen/node_modules/https-proxy-agent/dist/agent.js.map"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; const agent_1 = __importDefault(require("./agent")); function createHttpsProxyAgent(opts) { return new agent_1.default(opts); } (function (createHttpsProxyAgent) { createHttpsProxyAgent.HttpsProxyAgent = agent_1.default; createHttpsProxyAgent.prototype = agent_1.default.prototype; })(createHttpsProxyAgent || (createHttpsProxyAgent = {})); module.exports = createHttpsProxyAgent;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/make-fetch-happen/node_modules/https-proxy-agent/dist/index.js.map"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const debug_1 = __importDefault(require("debug")); const debug = debug_1.default('https-proxy-agent:parse-proxy-response'); function parseProxyResponse(socket) { return new Promise((resolve, reject) => { // we need to buffer any HTTP traffic that happens with the proxy before we get // the CONNECT response, so that if the response is anything other than an "200" // response code, then we can re-play the "data" events on the socket once the // HTTP parser is hooked up... let buffersLength = 0; const buffers = []; function read() { const b = socket.read(); if (b) ondata(b); else socket.once('readable', read); } function cleanup() { socket.removeListener('end', onend); socket.removeListener('error', onerror); socket.removeListener('close', onclose); socket.removeListener('readable', read); } function onclose(err) { debug('onclose had error %o', err); } function onend() { debug('onend'); } function onerror(err) { cleanup(); debug('onerror %o', err); reject(err); } function ondata(b) { buffers.push(b); buffersLength += b.length; const buffered = Buffer.concat(buffers, buffersLength); const endOfHeaders = buffered.indexOf('\r\n\r\n'); if (endOfHeaders === -1) { // keep buffering debug('have not received end of HTTP headers yet...'); read(); return; } const firstLine = buffered.toString('ascii', 0, buffered.indexOf('\r\n')); const statusCode = +firstLine.split(' ')[1]; debug('got proxy server response: %o', firstLine); resolve({ statusCode, buffered }); } socket.on('error', onerror); socket.on('close', onclose); socket.on('end', onend); read(); }); } exports.default = parseProxyResponse;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/make-fetch-happen/node_modules/https-proxy-agent/dist/parse-proxy-response.js.mapconst ip = exports; const { Buffer } = require('buffer'); const os = require('os'); ip.toBuffer = function (ip, buff, offset) { offset = ~~offset; let result; if (this.isV4Format(ip)) { result = buff || Buffer.alloc(offset + 4); ip.split(/\./g).map((byte) => { result[offset++] = parseInt(byte, 10) & 0xff; }); } else if (this.isV6Format(ip)) { const sections = ip.split(':', 8); let i; for (i = 0; i < sections.length; i++) { const isv4 = this.isV4Format(sections[i]); let v4Buffer; if (isv4) { v4Buffer = this.toBuffer(sections[i]); sections[i] = v4Buffer.slice(0, 2).toString('hex'); } if (v4Buffer && ++i < 8) { sections.splice(i, 0, v4Buffer.slice(2, 4).toString('hex')); } } if (sections[0] === '') { while (sections.length < 8) sections.unshift('0'); } else if (sections[sections.length - 1] === '') { while (sections.length < 8) sections.push('0'); } else if (sections.length < 8) { for (i = 0; i < sections.length && sections[i] !== ''; i++); const argv = [i, 1]; for (i = 9 - sections.length; i > 0; i--) { argv.push('0'); } sections.splice(...argv); } result = buff || Buffer.alloc(offset + 16); for (i = 0; i < sections.length; i++) { const word = parseInt(sections[i], 16); result[offset++] = (word >> 8) & 0xff; result[offset++] = word & 0xff; } } if (!result) { throw Error(`Invalid ip address: ${ip}`); } return result; }; ip.toString = function (buff, offset, length) { offset = ~~offset; length = length || (buff.length - offset); let result = []; if (length === 4) { // IPv4 for (let i = 0; i < length; i++) { result.push(buff[offset + i]); } result = result.join('.'); } else if (length === 16) { // IPv6 for (let i = 0; i < length; i += 2) { result.push(buff.readUInt16BE(offset + i).toString(16)); } result = result.join(':'); result = result.replace(/(^|:)0(:0)*:0(:|$)/, '$1::$3'); result = result.replace(/:{3,4}/, '::'); } return result; }; const ipv4Regex = /^(\d{1,3}\.){3,3}\d{1,3}$/; const ipv6Regex = /^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i; ip.isV4Format = function (ip) { return ipv4Regex.test(ip); }; ip.isV6Format = function (ip) { return ipv6Regex.test(ip); }; function _normalizeFamily(family) { if (family === 4) { return 'ipv4'; } if (family === 6) { return 'ipv6'; } return family ? family.toLowerCase() : 'ipv4'; } ip.fromPrefixLen = function (prefixlen, family) { if (prefixlen > 32) { family = 'ipv6'; } else { family = _normalizeFamily(family); } let len = 4; if (family === 'ipv6') { len = 16; } const buff = Buffer.alloc(len); for (let i = 0, n = buff.length; i < n; ++i) { let bits = 8; if (prefixlen < 8) { bits = prefixlen; } prefixlen -= bits; buff[i] = ~(0xff >> bits) & 0xff; } return ip.toString(buff); }; ip.mask = function (addr, mask) { addr = ip.toBuffer(addr); mask = ip.toBuffer(mask); const result = Buffer.alloc(Math.max(addr.length, mask.length)); // Same protocol - do bitwise and let i; if (addr.length === mask.length) { for (i = 0; i < addr.length; i++) { result[i] = addr[i] & mask[i]; } } else if (mask.length === 4) { // IPv6 address and IPv4 mask // (Mask low bits) for (i = 0; i < mask.length; i++) { result[i] = addr[addr.length - 4 + i] & mask[i]; } } else { // IPv6 mask and IPv4 addr for (i = 0; i < result.length - 6; i++) { result[i] = 0; } // ::ffff:ipv4 result[10] = 0xff; result[11] = 0xff; for (i = 0; i < addr.length; i++) { result[i + 12] = addr[i] & mask[i + 12]; } i += 12; } for (; i < result.length; i++) { result[i] = 0; } return ip.toString(result); }; ip.cidr = function (cidrString) { const cidrParts = cidrString.split('/'); const addr = cidrParts[0]; if (cidrParts.length !== 2) { throw new Error(`invalid CIDR subnet: ${addr}`); } const mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10)); return ip.mask(addr, mask); }; ip.subnet = function (addr, mask) { const networkAddress = ip.toLong(ip.mask(addr, mask)); // Calculate the mask's length. const maskBuffer = ip.toBuffer(mask); let maskLength = 0; for (let i = 0; i < maskBuffer.length; i++) { if (maskBuffer[i] === 0xff) { maskLength += 8; } else { let octet = maskBuffer[i] & 0xff; while (octet) { octet = (octet << 1) & 0xff; maskLength++; } } } const numberOfAddresses = 2 ** (32 - maskLength); return { networkAddress: ip.fromLong(networkAddress), firstAddress: numberOfAddresses <= 2 ? ip.fromLong(networkAddress) : ip.fromLong(networkAddress + 1), lastAddress: numberOfAddresses <= 2 ? ip.fromLong(networkAddress + numberOfAddresses - 1) : ip.fromLong(networkAddress + numberOfAddresses - 2), broadcastAddress: ip.fromLong(networkAddress + numberOfAddresses - 1), subnetMask: mask, subnetMaskLength: maskLength, numHosts: numberOfAddresses <= 2 ? numberOfAddresses : numberOfAddresses - 2, length: numberOfAddresses, contains(other) { return networkAddress === ip.toLong(ip.mask(other, mask)); }, }; }; ip.cidrSubnet = function (cidrString) { const cidrParts = cidrString.split('/'); const addr = cidrParts[0]; if (cidrParts.length !== 2) { throw new Error(`invalid CIDR subnet: ${addr}`); } const mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10)); return ip.subnet(addr, mask); }; ip.not = function (addr) { const buff = ip.toBuffer(addr); for (let i = 0; i < buff.length; i++) { buff[i] = 0xff ^ buff[i]; } return ip.toString(buff); }; ip.or = function (a, b) { a = ip.toBuffer(a); b = ip.toBuffer(b); // same protocol if (a.length === b.length) { for (let i = 0; i < a.length; ++i) { a[i] |= b[i]; } return ip.toString(a); // mixed protocols } let buff = a; let other = b; if (b.length > a.length) { buff = b; other = a; } const offset = buff.length - other.length; for (let i = offset; i < buff.length; ++i) { buff[i] |= other[i - offset]; } return ip.toString(buff); }; ip.isEqual = function (a, b) { a = ip.toBuffer(a); b = ip.toBuffer(b); // Same protocol if (a.length === b.length) { for (let i = 0; i < a.length; i++) { if (a[i] !== b[i]) return false; } return true; } // Swap if (b.length === 4) { const t = b; b = a; a = t; } // a - IPv4, b - IPv6 for (let i = 0; i < 10; i++) { if (b[i] !== 0) return false; } const word = b.readUInt16BE(10); if (word !== 0 && word !== 0xffff) return false; for (let i = 0; i < 4; i++) { if (a[i] !== b[i + 12]) return false; } return true; }; ip.isPrivate = function (addr) { return /^(::f{4}:)?10\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i .test(addr) || /^(::f{4}:)?192\.168\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || /^(::f{4}:)?172\.(1[6-9]|2\d|30|31)\.([0-9]{1,3})\.([0-9]{1,3})$/i .test(addr) || /^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || /^(::f{4}:)?169\.254\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || /^f[cd][0-9a-f]{2}:/i.test(addr) || /^fe80:/i.test(addr) || /^::1$/.test(addr) || /^::$/.test(addr); }; ip.isPublic = function (addr) { return !ip.isPrivate(addr); }; ip.isLoopback = function (addr) { return /^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/ .test(addr) || /^fe80::1$/.test(addr) || /^::1$/.test(addr) || /^::$/.test(addr); }; ip.loopback = function (family) { // // Default to `ipv4` // family = _normalizeFamily(family); if (family !== 'ipv4' && family !== 'ipv6') { throw new Error('family must be ipv4 or ipv6'); } return family === 'ipv4' ? '127.0.0.1' : 'fe80::1'; }; // // ### function address (name, family) // #### @name {string|'public'|'private'} **Optional** Name or security // of the network interface. // #### @family {ipv4|ipv6} **Optional** IP family of the address (defaults // to ipv4). // // Returns the address for the network interface on the current system with // the specified `name`: // * String: First `family` address of the interface. // If not found see `undefined`. // * 'public': the first public ip address of family. // * 'private': the first private ip address of family. // * undefined: First address with `ipv4` or loopback address `127.0.0.1`. // ip.address = function (name, family) { const interfaces = os.networkInterfaces(); // // Default to `ipv4` // family = _normalizeFamily(family); // // If a specific network interface has been named, // return the address. // if (name && name !== 'private' && name !== 'public') { const res = interfaces[name].filter((details) => { const itemFamily = _normalizeFamily(details.family); return itemFamily === family; }); if (res.length === 0) { return undefined; } return res[0].address; } const all = Object.keys(interfaces).map((nic) => { // // Note: name will only be `public` or `private` // when this is called. // const addresses = interfaces[nic].filter((details) => { details.family = _normalizeFamily(details.family); if (details.family !== family || ip.isLoopback(details.address)) { return false; } if (!name) { return true; } return name === 'public' ? ip.isPrivate(details.address) : ip.isPublic(details.address); }); return addresses.length ? addresses[0].address : undefined; }).filter(Boolean); return !all.length ? ip.loopback(family) : all[0]; }; ip.toLong = function (ip) { let ipl = 0; ip.split('.').forEach((octet) => { ipl <<= 8; ipl += parseInt(octet); }); return (ipl >>> 0); }; ip.fromLong = function (ipl) { return (`${ipl >>> 24}.${ ipl >> 16 & 255}.${ ipl >> 8 & 255}.${ ipl & 255}`); }; /** * negotiator * Copyright(c) 2012 Isaac Z. Schlueter * Copyright(c) 2014 Federico Romero * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ 'use strict'; /** * Module exports. * @public */ module.exports = preferredCharsets; module.exports.preferredCharsets = preferredCharsets; /** * Module variables. * @private */ var simpleCharsetRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/; /** * Parse the Accept-Charset header. * @private */ function parseAcceptCharset(accept) { var accepts = accept.split(','); for (var i = 0, j = 0; i < accepts.length; i++) { var charset = parseCharset(accepts[i].trim(), i); if (charset) { accepts[j++] = charset; } } // trim accepts accepts.length = j; return accepts; } /** * Parse a charset from the Accept-Charset header. * @private */ function parseCharset(str, i) { var match = simpleCharsetRegExp.exec(str); if (!match) return null; var charset = match[1]; var q = 1; if (match[2]) { var params = match[2].split(';') for (var j = 0; j < params.length; j++) { var p = params[j].trim().split('='); if (p[0] === 'q') { q = parseFloat(p[1]); break; } } } return { charset: charset, q: q, i: i }; } /** * Get the priority of a charset. * @private */ function getCharsetPriority(charset, accepted, index) { var priority = {o: -1, q: 0, s: 0}; for (var i = 0; i < accepted.length; i++) { var spec = specify(charset, accepted[i], index); if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { priority = spec; } } return priority; } /** * Get the specificity of the charset. * @private */ function specify(charset, spec, index) { var s = 0; if(spec.charset.toLowerCase() === charset.toLowerCase()){ s |= 1; } else if (spec.charset !== '*' ) { return null } return { i: index, o: spec.i, q: spec.q, s: s } } /** * Get the preferred charsets from an Accept-Charset header. * @public */ function preferredCharsets(accept, provided) { // RFC 2616 sec 14.2: no header = * var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || ''); if (!provided) { // sorted list of all charsets return accepts .filter(isQuality) .sort(compareSpecs) .map(getFullCharset); } var priorities = provided.map(function getPriority(type, index) { return getCharsetPriority(type, accepts, index); }); // sorted list of accepted charsets return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) { return provided[priorities.indexOf(priority)]; }); } /** * Compare two specs. * @private */ function compareSpecs(a, b) { return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; } /** * Get full charset string. * @private */ function getFullCharset(spec) { return spec.charset; } /** * Check if a spec has any quality. * @private */ function isQuality(spec) { return spec.q > 0; } /** * negotiator * Copyright(c) 2012 Isaac Z. Schlueter * Copyright(c) 2014 Federico Romero * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ 'use strict'; /** * Module exports. * @public */ module.exports = preferredEncodings; module.exports.preferredEncodings = preferredEncodings; /** * Module variables. * @private */ var simpleEncodingRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/; /** * Parse the Accept-Encoding header. * @private */ function parseAcceptEncoding(accept) { var accepts = accept.split(','); var hasIdentity = false; var minQuality = 1; for (var i = 0, j = 0; i < accepts.length; i++) { var encoding = parseEncoding(accepts[i].trim(), i); if (encoding) { accepts[j++] = encoding; hasIdentity = hasIdentity || specify('identity', encoding); minQuality = Math.min(minQuality, encoding.q || 1); } } if (!hasIdentity) { /* * If identity doesn't explicitly appear in the accept-encoding header, * it's added to the list of acceptable encoding with the lowest q */ accepts[j++] = { encoding: 'identity', q: minQuality, i: i }; } // trim accepts accepts.length = j; return accepts; } /** * Parse an encoding from the Accept-Encoding header. * @private */ function parseEncoding(str, i) { var match = simpleEncodingRegExp.exec(str); if (!match) return null; var encoding = match[1]; var q = 1; if (match[2]) { var params = match[2].split(';'); for (var j = 0; j < params.length; j++) { var p = params[j].trim().split('='); if (p[0] === 'q') { q = parseFloat(p[1]); break; } } } return { encoding: encoding, q: q, i: i }; } /** * Get the priority of an encoding. * @private */ function getEncodingPriority(encoding, accepted, index) { var priority = {o: -1, q: 0, s: 0}; for (var i = 0; i < accepted.length; i++) { var spec = specify(encoding, accepted[i], index); if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { priority = spec; } } return priority; } /** * Get the specificity of the encoding. * @private */ function specify(encoding, spec, index) { var s = 0; if(spec.encoding.toLowerCase() === encoding.toLowerCase()){ s |= 1; } else if (spec.encoding !== '*' ) { return null } return { i: index, o: spec.i, q: spec.q, s: s } }; /** * Get the preferred encodings from an Accept-Encoding header. * @public */ function preferredEncodings(accept, provided) { var accepts = parseAcceptEncoding(accept || ''); if (!provided) { // sorted list of all encodings return accepts .filter(isQuality) .sort(compareSpecs) .map(getFullEncoding); } var priorities = provided.map(function getPriority(type, index) { return getEncodingPriority(type, accepts, index); }); // sorted list of accepted encodings return priorities.filter(isQuality).sort(compareSpecs).map(function getEncoding(priority) { return provided[priorities.indexOf(priority)]; }); } /** * Compare two specs. * @private */ function compareSpecs(a, b) { return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; } /** * Get full encoding string. * @private */ function getFullEncoding(spec) { return spec.encoding; } /** * Check if a spec has any quality. * @private */ function isQuality(spec) { return spec.q > 0; } /** * negotiator * Copyright(c) 2012 Isaac Z. Schlueter * Copyright(c) 2014 Federico Romero * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ 'use strict'; /** * Module exports. * @public */ module.exports = preferredLanguages; module.exports.preferredLanguages = preferredLanguages; /** * Module variables. * @private */ var simpleLanguageRegExp = /^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/; /** * Parse the Accept-Language header. * @private */ function parseAcceptLanguage(accept) { var accepts = accept.split(','); for (var i = 0, j = 0; i < accepts.length; i++) { var language = parseLanguage(accepts[i].trim(), i); if (language) { accepts[j++] = language; } } // trim accepts accepts.length = j; return accepts; } /** * Parse a language from the Accept-Language header. * @private */ function parseLanguage(str, i) { var match = simpleLanguageRegExp.exec(str); if (!match) return null; var prefix = match[1] var suffix = match[2] var full = prefix if (suffix) full += "-" + suffix; var q = 1; if (match[3]) { var params = match[3].split(';') for (var j = 0; j < params.length; j++) { var p = params[j].split('='); if (p[0] === 'q') q = parseFloat(p[1]); } } return { prefix: prefix, suffix: suffix, q: q, i: i, full: full }; } /** * Get the priority of a language. * @private */ function getLanguagePriority(language, accepted, index) { var priority = {o: -1, q: 0, s: 0}; for (var i = 0; i < accepted.length; i++) { var spec = specify(language, accepted[i], index); if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { priority = spec; } } return priority; } /** * Get the specificity of the language. * @private */ function specify(language, spec, index) { var p = parseLanguage(language) if (!p) return null; var s = 0; if(spec.full.toLowerCase() === p.full.toLowerCase()){ s |= 4; } else if (spec.prefix.toLowerCase() === p.full.toLowerCase()) { s |= 2; } else if (spec.full.toLowerCase() === p.prefix.toLowerCase()) { s |= 1; } else if (spec.full !== '*' ) { return null } return { i: index, o: spec.i, q: spec.q, s: s } }; /** * Get the preferred languages from an Accept-Language header. * @public */ function preferredLanguages(accept, provided) { // RFC 2616 sec 14.4: no header = * var accepts = parseAcceptLanguage(accept === undefined ? '*' : accept || ''); if (!provided) { // sorted list of all languages return accepts .filter(isQuality) .sort(compareSpecs) .map(getFullLanguage); } var priorities = provided.map(function getPriority(type, index) { return getLanguagePriority(type, accepts, index); }); // sorted list of accepted languages return priorities.filter(isQuality).sort(compareSpecs).map(function getLanguage(priority) { return provided[priorities.indexOf(priority)]; }); } /** * Compare two specs. * @private */ function compareSpecs(a, b) { return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; } /** * Get full language string. * @private */ function getFullLanguage(spec) { return spec.full; } /** * Check if a spec has any quality. * @private */ function isQuality(spec) { return spec.q > 0; } /** * negotiator * Copyright(c) 2012 Isaac Z. Schlueter * Copyright(c) 2014 Federico Romero * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ 'use strict'; /** * Module exports. * @public */ module.exports = preferredMediaTypes; module.exports.preferredMediaTypes = preferredMediaTypes; /** * Module variables. * @private */ var simpleMediaTypeRegExp = /^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/; /** * Parse the Accept header. * @private */ function parseAccept(accept) { var accepts = splitMediaTypes(accept); for (var i = 0, j = 0; i < accepts.length; i++) { var mediaType = parseMediaType(accepts[i].trim(), i); if (mediaType) { accepts[j++] = mediaType; } } // trim accepts accepts.length = j; return accepts; } /** * Parse a media type from the Accept header. * @private */ function parseMediaType(str, i) { var match = simpleMediaTypeRegExp.exec(str); if (!match) return null; var params = Object.create(null); var q = 1; var subtype = match[2]; var type = match[1]; if (match[3]) { var kvps = splitParameters(match[3]).map(splitKeyValuePair); for (var j = 0; j < kvps.length; j++) { var pair = kvps[j]; var key = pair[0].toLowerCase(); var val = pair[1]; // get the value, unwrapping quotes var value = val && val[0] === '"' && val[val.length - 1] === '"' ? val.substr(1, val.length - 2) : val; if (key === 'q') { q = parseFloat(value); break; } // store parameter params[key] = value; } } return { type: type, subtype: subtype, params: params, q: q, i: i }; } /** * Get the priority of a media type. * @private */ function getMediaTypePriority(type, accepted, index) { var priority = {o: -1, q: 0, s: 0}; for (var i = 0; i < accepted.length; i++) { var spec = specify(type, accepted[i], index); if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { priority = spec; } } return priority; } /** * Get the specificity of the media type. * @private */ function specify(type, spec, index) { var p = parseMediaType(type); var s = 0; if (!p) { return null; } if(spec.type.toLowerCase() == p.type.toLowerCase()) { s |= 4 } else if(spec.type != '*') { return null; } if(spec.subtype.toLowerCase() == p.subtype.toLowerCase()) { s |= 2 } else if(spec.subtype != '*') { return null; } var keys = Object.keys(spec.params); if (keys.length > 0) { if (keys.every(function (k) { return spec.params[k] == '*' || (spec.params[k] || '').toLowerCase() == (p.params[k] || '').toLowerCase(); })) { s |= 1 } else { return null } } return { i: index, o: spec.i, q: spec.q, s: s, } } /** * Get the preferred media types from an Accept header. * @public */ function preferredMediaTypes(accept, provided) { // RFC 2616 sec 14.2: no header = */* var accepts = parseAccept(accept === undefined ? '*/*' : accept || ''); if (!provided) { // sorted list of all types return accepts .filter(isQuality) .sort(compareSpecs) .map(getFullType); } var priorities = provided.map(function getPriority(type, index) { return getMediaTypePriority(type, accepts, index); }); // sorted list of accepted types return priorities.filter(isQuality).sort(compareSpecs).map(function getType(priority) { return provided[priorities.indexOf(priority)]; }); } /** * Compare two specs. * @private */ function compareSpecs(a, b) { return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; } /** * Get full type string. * @private */ function getFullType(spec) { return spec.type + '/' + spec.subtype; } /** * Check if a spec has any quality. * @private */ function isQuality(spec) { return spec.q > 0; } /** * Count the number of quotes in a string. * @private */ function quoteCount(string) { var count = 0; var index = 0; while ((index = string.indexOf('"', index)) !== -1) { count++; index++; } return count; } /** * Split a key value pair. * @private */ function splitKeyValuePair(str) { var index = str.indexOf('='); var key; var val; if (index === -1) { key = str; } else { key = str.substr(0, index); val = str.substr(index + 1); } return [key, val]; } /** * Split an Accept header into media types. * @private */ function splitMediaTypes(accept) { var accepts = accept.split(','); for (var i = 1, j = 0; i < accepts.length; i++) { if (quoteCount(accepts[j]) % 2 == 0) { accepts[++j] = accepts[i]; } else { accepts[j] += ',' + accepts[i]; } } // trim accepts accepts.length = j + 1; return accepts; } /** * Split a string of parameters. * @private */ function splitParameters(str) { var parameters = str.split(';'); for (var i = 1, j = 0; i < parameters.length; i++) { if (quoteCount(parameters[j]) % 2 == 0) { parameters[++j] = parameters[i]; } else { parameters[j] += ';' + parameters[i]; } } // trim parameters parameters.length = j + 1; for (var i = 0; i < parameters.length; i++) { parameters[i] = parameters[i].trim(); } return parameters; } "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const utils_1 = require("./utils"); // The default Buffer size if one is not provided. const DEFAULT_SMARTBUFFER_SIZE = 4096; // The default string encoding to use for reading/writing strings. const DEFAULT_SMARTBUFFER_ENCODING = 'utf8'; class SmartBuffer { /** * Creates a new SmartBuffer instance. * * @param options { SmartBufferOptions } The SmartBufferOptions to apply to this instance. */ constructor(options) { this.length = 0; this._encoding = DEFAULT_SMARTBUFFER_ENCODING; this._writeOffset = 0; this._readOffset = 0; if (SmartBuffer.isSmartBufferOptions(options)) { // Checks for encoding if (options.encoding) { utils_1.checkEncoding(options.encoding); this._encoding = options.encoding; } // Checks for initial size length if (options.size) { if (utils_1.isFiniteInteger(options.size) && options.size > 0) { this._buff = Buffer.allocUnsafe(options.size); } else { throw new Error(utils_1.ERRORS.INVALID_SMARTBUFFER_SIZE); } // Check for initial Buffer } else if (options.buff) { if (Buffer.isBuffer(options.buff)) { this._buff = options.buff; this.length = options.buff.length; } else { throw new Error(utils_1.ERRORS.INVALID_SMARTBUFFER_BUFFER); } } else { this._buff = Buffer.allocUnsafe(DEFAULT_SMARTBUFFER_SIZE); } } else { // If something was passed but it's not a SmartBufferOptions object if (typeof options !== 'undefined') { throw new Error(utils_1.ERRORS.INVALID_SMARTBUFFER_OBJECT); } // Otherwise default to sane options this._buff = Buffer.allocUnsafe(DEFAULT_SMARTBUFFER_SIZE); } } /** * Creates a new SmartBuffer instance with the provided internal Buffer size and optional encoding. * * @param size { Number } The size of the internal Buffer. * @param encoding { String } The BufferEncoding to use for strings. * * @return { SmartBuffer } */ static fromSize(size, encoding) { return new this({ size: size, encoding: encoding }); } /** * Creates a new SmartBuffer instance with the provided Buffer and optional encoding. * * @param buffer { Buffer } The Buffer to use as the internal Buffer value. * @param encoding { String } The BufferEncoding to use for strings. * * @return { SmartBuffer } */ static fromBuffer(buff, encoding) { return new this({ buff: buff, encoding: encoding }); } /** * Creates a new SmartBuffer instance with the provided SmartBufferOptions options. * * @param options { SmartBufferOptions } The options to use when creating the SmartBuffer instance. */ static fromOptions(options) { return new this(options); } /** * Type checking function that determines if an object is a SmartBufferOptions object. */ static isSmartBufferOptions(options) { const castOptions = options; return (castOptions && (castOptions.encoding !== undefined || castOptions.size !== undefined || castOptions.buff !== undefined)); } // Signed integers /** * Reads an Int8 value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readInt8(offset) { return this._readNumberValue(Buffer.prototype.readInt8, 1, offset); } /** * Reads an Int16BE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readInt16BE(offset) { return this._readNumberValue(Buffer.prototype.readInt16BE, 2, offset); } /** * Reads an Int16LE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readInt16LE(offset) { return this._readNumberValue(Buffer.prototype.readInt16LE, 2, offset); } /** * Reads an Int32BE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readInt32BE(offset) { return this._readNumberValue(Buffer.prototype.readInt32BE, 4, offset); } /** * Reads an Int32LE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readInt32LE(offset) { return this._readNumberValue(Buffer.prototype.readInt32LE, 4, offset); } /** * Reads a BigInt64BE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { BigInt } */ readBigInt64BE(offset) { utils_1.bigIntAndBufferInt64Check('readBigInt64BE'); return this._readNumberValue(Buffer.prototype.readBigInt64BE, 8, offset); } /** * Reads a BigInt64LE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { BigInt } */ readBigInt64LE(offset) { utils_1.bigIntAndBufferInt64Check('readBigInt64LE'); return this._readNumberValue(Buffer.prototype.readBigInt64LE, 8, offset); } /** * Writes an Int8 value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeInt8(value, offset) { this._writeNumberValue(Buffer.prototype.writeInt8, 1, value, offset); return this; } /** * Inserts an Int8 value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertInt8(value, offset) { return this._insertNumberValue(Buffer.prototype.writeInt8, 1, value, offset); } /** * Writes an Int16BE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeInt16BE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeInt16BE, 2, value, offset); } /** * Inserts an Int16BE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertInt16BE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeInt16BE, 2, value, offset); } /** * Writes an Int16LE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeInt16LE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeInt16LE, 2, value, offset); } /** * Inserts an Int16LE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertInt16LE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeInt16LE, 2, value, offset); } /** * Writes an Int32BE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeInt32BE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeInt32BE, 4, value, offset); } /** * Inserts an Int32BE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertInt32BE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeInt32BE, 4, value, offset); } /** * Writes an Int32LE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeInt32LE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeInt32LE, 4, value, offset); } /** * Inserts an Int32LE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertInt32LE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeInt32LE, 4, value, offset); } /** * Writes a BigInt64BE value to the current write position (or at optional offset). * * @param value { BigInt } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeBigInt64BE(value, offset) { utils_1.bigIntAndBufferInt64Check('writeBigInt64BE'); return this._writeNumberValue(Buffer.prototype.writeBigInt64BE, 8, value, offset); } /** * Inserts a BigInt64BE value at the given offset value. * * @param value { BigInt } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertBigInt64BE(value, offset) { utils_1.bigIntAndBufferInt64Check('writeBigInt64BE'); return this._insertNumberValue(Buffer.prototype.writeBigInt64BE, 8, value, offset); } /** * Writes a BigInt64LE value to the current write position (or at optional offset). * * @param value { BigInt } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeBigInt64LE(value, offset) { utils_1.bigIntAndBufferInt64Check('writeBigInt64LE'); return this._writeNumberValue(Buffer.prototype.writeBigInt64LE, 8, value, offset); } /** * Inserts a Int64LE value at the given offset value. * * @param value { BigInt } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertBigInt64LE(value, offset) { utils_1.bigIntAndBufferInt64Check('writeBigInt64LE'); return this._insertNumberValue(Buffer.prototype.writeBigInt64LE, 8, value, offset); } // Unsigned Integers /** * Reads an UInt8 value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readUInt8(offset) { return this._readNumberValue(Buffer.prototype.readUInt8, 1, offset); } /** * Reads an UInt16BE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readUInt16BE(offset) { return this._readNumberValue(Buffer.prototype.readUInt16BE, 2, offset); } /** * Reads an UInt16LE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readUInt16LE(offset) { return this._readNumberValue(Buffer.prototype.readUInt16LE, 2, offset); } /** * Reads an UInt32BE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readUInt32BE(offset) { return this._readNumberValue(Buffer.prototype.readUInt32BE, 4, offset); } /** * Reads an UInt32LE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readUInt32LE(offset) { return this._readNumberValue(Buffer.prototype.readUInt32LE, 4, offset); } /** * Reads a BigUInt64BE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { BigInt } */ readBigUInt64BE(offset) { utils_1.bigIntAndBufferInt64Check('readBigUInt64BE'); return this._readNumberValue(Buffer.prototype.readBigUInt64BE, 8, offset); } /** * Reads a BigUInt64LE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { BigInt } */ readBigUInt64LE(offset) { utils_1.bigIntAndBufferInt64Check('readBigUInt64LE'); return this._readNumberValue(Buffer.prototype.readBigUInt64LE, 8, offset); } /** * Writes an UInt8 value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeUInt8(value, offset) { return this._writeNumberValue(Buffer.prototype.writeUInt8, 1, value, offset); } /** * Inserts an UInt8 value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertUInt8(value, offset) { return this._insertNumberValue(Buffer.prototype.writeUInt8, 1, value, offset); } /** * Writes an UInt16BE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeUInt16BE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeUInt16BE, 2, value, offset); } /** * Inserts an UInt16BE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertUInt16BE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeUInt16BE, 2, value, offset); } /** * Writes an UInt16LE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeUInt16LE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeUInt16LE, 2, value, offset); } /** * Inserts an UInt16LE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertUInt16LE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeUInt16LE, 2, value, offset); } /** * Writes an UInt32BE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeUInt32BE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeUInt32BE, 4, value, offset); } /** * Inserts an UInt32BE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertUInt32BE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeUInt32BE, 4, value, offset); } /** * Writes an UInt32LE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeUInt32LE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeUInt32LE, 4, value, offset); } /** * Inserts an UInt32LE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertUInt32LE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeUInt32LE, 4, value, offset); } /** * Writes a BigUInt64BE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeBigUInt64BE(value, offset) { utils_1.bigIntAndBufferInt64Check('writeBigUInt64BE'); return this._writeNumberValue(Buffer.prototype.writeBigUInt64BE, 8, value, offset); } /** * Inserts a BigUInt64BE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertBigUInt64BE(value, offset) { utils_1.bigIntAndBufferInt64Check('writeBigUInt64BE'); return this._insertNumberValue(Buffer.prototype.writeBigUInt64BE, 8, value, offset); } /** * Writes a BigUInt64LE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeBigUInt64LE(value, offset) { utils_1.bigIntAndBufferInt64Check('writeBigUInt64LE'); return this._writeNumberValue(Buffer.prototype.writeBigUInt64LE, 8, value, offset); } /** * Inserts a BigUInt64LE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertBigUInt64LE(value, offset) { utils_1.bigIntAndBufferInt64Check('writeBigUInt64LE'); return this._insertNumberValue(Buffer.prototype.writeBigUInt64LE, 8, value, offset); } // Floating Point /** * Reads an FloatBE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readFloatBE(offset) { return this._readNumberValue(Buffer.prototype.readFloatBE, 4, offset); } /** * Reads an FloatLE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readFloatLE(offset) { return this._readNumberValue(Buffer.prototype.readFloatLE, 4, offset); } /** * Writes a FloatBE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeFloatBE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeFloatBE, 4, value, offset); } /** * Inserts a FloatBE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertFloatBE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeFloatBE, 4, value, offset); } /** * Writes a FloatLE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeFloatLE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeFloatLE, 4, value, offset); } /** * Inserts a FloatLE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertFloatLE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeFloatLE, 4, value, offset); } // Double Floating Point /** * Reads an DoublEBE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readDoubleBE(offset) { return this._readNumberValue(Buffer.prototype.readDoubleBE, 8, offset); } /** * Reads an DoubleLE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readDoubleLE(offset) { return this._readNumberValue(Buffer.prototype.readDoubleLE, 8, offset); } /** * Writes a DoubleBE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeDoubleBE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeDoubleBE, 8, value, offset); } /** * Inserts a DoubleBE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertDoubleBE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeDoubleBE, 8, value, offset); } /** * Writes a DoubleLE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeDoubleLE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeDoubleLE, 8, value, offset); } /** * Inserts a DoubleLE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertDoubleLE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeDoubleLE, 8, value, offset); } // Strings /** * Reads a String from the current read position. * * @param arg1 { Number | String } The number of bytes to read as a String, or the BufferEncoding to use for * the string (Defaults to instance level encoding). * @param encoding { String } The BufferEncoding to use for the string (Defaults to instance level encoding). * * @return { String } */ readString(arg1, encoding) { let lengthVal; // Length provided if (typeof arg1 === 'number') { utils_1.checkLengthValue(arg1); lengthVal = Math.min(arg1, this.length - this._readOffset); } else { encoding = arg1; lengthVal = this.length - this._readOffset; } // Check encoding if (typeof encoding !== 'undefined') { utils_1.checkEncoding(encoding); } const value = this._buff.slice(this._readOffset, this._readOffset + lengthVal).toString(encoding || this._encoding); this._readOffset += lengthVal; return value; } /** * Inserts a String * * @param value { String } The String value to insert. * @param offset { Number } The offset to insert the string at. * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). * * @return this */ insertString(value, offset, encoding) { utils_1.checkOffsetValue(offset); return this._handleString(value, true, offset, encoding); } /** * Writes a String * * @param value { String } The String value to write. * @param arg2 { Number | String } The offset to write the string at, or the BufferEncoding to use. * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). * * @return this */ writeString(value, arg2, encoding) { return this._handleString(value, false, arg2, encoding); } /** * Reads a null-terminated String from the current read position. * * @param encoding { String } The BufferEncoding to use for the string (Defaults to instance level encoding). * * @return { String } */ readStringNT(encoding) { if (typeof encoding !== 'undefined') { utils_1.checkEncoding(encoding); } // Set null character position to the end SmartBuffer instance. let nullPos = this.length; // Find next null character (if one is not found, default from above is used) for (let i = this._readOffset; i < this.length; i++) { if (this._buff[i] === 0x00) { nullPos = i; break; } } // Read string value const value = this._buff.slice(this._readOffset, nullPos); // Increment internal Buffer read offset this._readOffset = nullPos + 1; return value.toString(encoding || this._encoding); } /** * Inserts a null-terminated String. * * @param value { String } The String value to write. * @param arg2 { Number | String } The offset to write the string to, or the BufferEncoding to use. * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). * * @return this */ insertStringNT(value, offset, encoding) { utils_1.checkOffsetValue(offset); // Write Values this.insertString(value, offset, encoding); this.insertUInt8(0x00, offset + value.length); return this; } /** * Writes a null-terminated String. * * @param value { String } The String value to write. * @param arg2 { Number | String } The offset to write the string to, or the BufferEncoding to use. * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). * * @return this */ writeStringNT(value, arg2, encoding) { // Write Values this.writeString(value, arg2, encoding); this.writeUInt8(0x00, typeof arg2 === 'number' ? arg2 + value.length : this.writeOffset); return this; } // Buffers /** * Reads a Buffer from the internal read position. * * @param length { Number } The length of data to read as a Buffer. * * @return { Buffer } */ readBuffer(length) { if (typeof length !== 'undefined') { utils_1.checkLengthValue(length); } const lengthVal = typeof length === 'number' ? length : this.length; const endPoint = Math.min(this.length, this._readOffset + lengthVal); // Read buffer value const value = this._buff.slice(this._readOffset, endPoint); // Increment internal Buffer read offset this._readOffset = endPoint; return value; } /** * Writes a Buffer to the current write position. * * @param value { Buffer } The Buffer to write. * @param offset { Number } The offset to write the Buffer to. * * @return this */ insertBuffer(value, offset) { utils_1.checkOffsetValue(offset); return this._handleBuffer(value, true, offset); } /** * Writes a Buffer to the current write position. * * @param value { Buffer } The Buffer to write. * @param offset { Number } The offset to write the Buffer to. * * @return this */ writeBuffer(value, offset) { return this._handleBuffer(value, false, offset); } /** * Reads a null-terminated Buffer from the current read poisiton. * * @return { Buffer } */ readBufferNT() { // Set null character position to the end SmartBuffer instance. let nullPos = this.length; // Find next null character (if one is not found, default from above is used) for (let i = this._readOffset; i < this.length; i++) { if (this._buff[i] === 0x00) { nullPos = i; break; } } // Read value const value = this._buff.slice(this._readOffset, nullPos); // Increment internal Buffer read offset this._readOffset = nullPos + 1; return value; } /** * Inserts a null-terminated Buffer. * * @param value { Buffer } The Buffer to write. * @param offset { Number } The offset to write the Buffer to. * * @return this */ insertBufferNT(value, offset) { utils_1.checkOffsetValue(offset); // Write Values this.insertBuffer(value, offset); this.insertUInt8(0x00, offset + value.length); return this; } /** * Writes a null-terminated Buffer. * * @param value { Buffer } The Buffer to write. * @param offset { Number } The offset to write the Buffer to. * * @return this */ writeBufferNT(value, offset) { // Checks for valid numberic value; if (typeof offset !== 'undefined') { utils_1.checkOffsetValue(offset); } // Write Values this.writeBuffer(value, offset); this.writeUInt8(0x00, typeof offset === 'number' ? offset + value.length : this._writeOffset); return this; } /** * Clears the SmartBuffer instance to its original empty state. */ clear() { this._writeOffset = 0; this._readOffset = 0; this.length = 0; return this; } /** * Gets the remaining data left to be read from the SmartBuffer instance. * * @return { Number } */ remaining() { return this.length - this._readOffset; } /** * Gets the current read offset value of the SmartBuffer instance. * * @return { Number } */ get readOffset() { return this._readOffset; } /** * Sets the read offset value of the SmartBuffer instance. * * @param offset { Number } - The offset value to set. */ set readOffset(offset) { utils_1.checkOffsetValue(offset); // Check for bounds. utils_1.checkTargetOffset(offset, this); this._readOffset = offset; } /** * Gets the current write offset value of the SmartBuffer instance. * * @return { Number } */ get writeOffset() { return this._writeOffset; } /** * Sets the write offset value of the SmartBuffer instance. * * @param offset { Number } - The offset value to set. */ set writeOffset(offset) { utils_1.checkOffsetValue(offset); // Check for bounds. utils_1.checkTargetOffset(offset, this); this._writeOffset = offset; } /** * Gets the currently set string encoding of the SmartBuffer instance. * * @return { BufferEncoding } The string Buffer encoding currently set. */ get encoding() { return this._encoding; } /** * Sets the string encoding of the SmartBuffer instance. * * @param encoding { BufferEncoding } The string Buffer encoding to set. */ set encoding(encoding) { utils_1.checkEncoding(encoding); this._encoding = encoding; } /** * Gets the underlying internal Buffer. (This includes unmanaged data in the Buffer) * * @return { Buffer } The Buffer value. */ get internalBuffer() { return this._buff; } /** * Gets the value of the internal managed Buffer (Includes managed data only) * * @param { Buffer } */ toBuffer() { return this._buff.slice(0, this.length); } /** * Gets the String value of the internal managed Buffer * * @param encoding { String } The BufferEncoding to display the Buffer as (defaults to instance level encoding). */ toString(encoding) { const encodingVal = typeof encoding === 'string' ? encoding : this._encoding; // Check for invalid encoding. utils_1.checkEncoding(encodingVal); return this._buff.toString(encodingVal, 0, this.length); } /** * Destroys the SmartBuffer instance. */ destroy() { this.clear(); return this; } /** * Handles inserting and writing strings. * * @param value { String } The String value to insert. * @param isInsert { Boolean } True if inserting a string, false if writing. * @param arg2 { Number | String } The offset to insert the string at, or the BufferEncoding to use. * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). */ _handleString(value, isInsert, arg3, encoding) { let offsetVal = this._writeOffset; let encodingVal = this._encoding; // Check for offset if (typeof arg3 === 'number') { offsetVal = arg3; // Check for encoding } else if (typeof arg3 === 'string') { utils_1.checkEncoding(arg3); encodingVal = arg3; } // Check for encoding (third param) if (typeof encoding === 'string') { utils_1.checkEncoding(encoding); encodingVal = encoding; } // Calculate bytelength of string. const byteLength = Buffer.byteLength(value, encodingVal); // Ensure there is enough internal Buffer capacity. if (isInsert) { this.ensureInsertable(byteLength, offsetVal); } else { this._ensureWriteable(byteLength, offsetVal); } // Write value this._buff.write(value, offsetVal, byteLength, encodingVal); // Increment internal Buffer write offset; if (isInsert) { this._writeOffset += byteLength; } else { // If an offset was given, check to see if we wrote beyond the current writeOffset. if (typeof arg3 === 'number') { this._writeOffset = Math.max(this._writeOffset, offsetVal + byteLength); } else { // If no offset was given, we wrote to the end of the SmartBuffer so increment writeOffset. this._writeOffset += byteLength; } } return this; } /** * Handles writing or insert of a Buffer. * * @param value { Buffer } The Buffer to write. * @param offset { Number } The offset to write the Buffer to. */ _handleBuffer(value, isInsert, offset) { const offsetVal = typeof offset === 'number' ? offset : this._writeOffset; // Ensure there is enough internal Buffer capacity. if (isInsert) { this.ensureInsertable(value.length, offsetVal); } else { this._ensureWriteable(value.length, offsetVal); } // Write buffer value value.copy(this._buff, offsetVal); // Increment internal Buffer write offset; if (isInsert) { this._writeOffset += value.length; } else { // If an offset was given, check to see if we wrote beyond the current writeOffset. if (typeof offset === 'number') { this._writeOffset = Math.max(this._writeOffset, offsetVal + value.length); } else { // If no offset was given, we wrote to the end of the SmartBuffer so increment writeOffset. this._writeOffset += value.length; } } return this; } /** * Ensures that the internal Buffer is large enough to read data. * * @param length { Number } The length of the data that needs to be read. * @param offset { Number } The offset of the data that needs to be read. */ ensureReadable(length, offset) { // Offset value defaults to managed read offset. let offsetVal = this._readOffset; // If an offset was provided, use it. if (typeof offset !== 'undefined') { // Checks for valid numberic value; utils_1.checkOffsetValue(offset); // Overide with custom offset. offsetVal = offset; } // Checks if offset is below zero, or the offset+length offset is beyond the total length of the managed data. if (offsetVal < 0 || offsetVal + length > this.length) { throw new Error(utils_1.ERRORS.INVALID_READ_BEYOND_BOUNDS); } } /** * Ensures that the internal Buffer is large enough to insert data. * * @param dataLength { Number } The length of the data that needs to be written. * @param offset { Number } The offset of the data to be written. */ ensureInsertable(dataLength, offset) { // Checks for valid numberic value; utils_1.checkOffsetValue(offset); // Ensure there is enough internal Buffer capacity. this._ensureCapacity(this.length + dataLength); // If an offset was provided and its not the very end of the buffer, copy data into appropriate location in regards to the offset. if (offset < this.length) { this._buff.copy(this._buff, offset + dataLength, offset, this._buff.length); } // Adjust tracked smart buffer length if (offset + dataLength > this.length) { this.length = offset + dataLength; } else { this.length += dataLength; } } /** * Ensures that the internal Buffer is large enough to write data. * * @param dataLength { Number } The length of the data that needs to be written. * @param offset { Number } The offset of the data to be written (defaults to writeOffset). */ _ensureWriteable(dataLength, offset) { const offsetVal = typeof offset === 'number' ? offset : this._writeOffset; // Ensure enough capacity to write data. this._ensureCapacity(offsetVal + dataLength); // Adjust SmartBuffer length (if offset + length is larger than managed length, adjust length) if (offsetVal + dataLength > this.length) { this.length = offsetVal + dataLength; } } /** * Ensures that the internal Buffer is large enough to write at least the given amount of data. * * @param minLength { Number } The minimum length of the data needs to be written. */ _ensureCapacity(minLength) { const oldLength = this._buff.length; if (minLength > oldLength) { let data = this._buff; let newLength = (oldLength * 3) / 2 + 1; if (newLength < minLength) { newLength = minLength; } this._buff = Buffer.allocUnsafe(newLength); data.copy(this._buff, 0, 0, oldLength); } } /** * Reads a numeric number value using the provided function. * * @typeparam T { number | bigint } The type of the value to be read * * @param func { Function(offset: number) => number } The function to read data on the internal Buffer with. * @param byteSize { Number } The number of bytes read. * @param offset { Number } The offset to read from (optional). When this is not provided, the managed readOffset is used instead. * * @returns { T } the number value */ _readNumberValue(func, byteSize, offset) { this.ensureReadable(byteSize, offset); // Call Buffer.readXXXX(); const value = func.call(this._buff, typeof offset === 'number' ? offset : this._readOffset); // Adjust internal read offset if an optional read offset was not provided. if (typeof offset === 'undefined') { this._readOffset += byteSize; } return value; } /** * Inserts a numeric number value based on the given offset and value. * * @typeparam T { number | bigint } The type of the value to be written * * @param func { Function(offset: T, offset?) => number} The function to write data on the internal Buffer with. * @param byteSize { Number } The number of bytes written. * @param value { T } The number value to write. * @param offset { Number } the offset to write the number at (REQUIRED). * * @returns SmartBuffer this buffer */ _insertNumberValue(func, byteSize, value, offset) { // Check for invalid offset values. utils_1.checkOffsetValue(offset); // Ensure there is enough internal Buffer capacity. (raw offset is passed) this.ensureInsertable(byteSize, offset); // Call buffer.writeXXXX(); func.call(this._buff, value, offset); // Adjusts internally managed write offset. this._writeOffset += byteSize; return this; } /** * Writes a numeric number value based on the given offset and value. * * @typeparam T { number | bigint } The type of the value to be written * * @param func { Function(offset: T, offset?) => number} The function to write data on the internal Buffer with. * @param byteSize { Number } The number of bytes written. * @param value { T } The number value to write. * @param offset { Number } the offset to write the number at (REQUIRED). * * @returns SmartBuffer this buffer */ _writeNumberValue(func, byteSize, value, offset) { // If an offset was provided, validate it. if (typeof offset === 'number') { // Check if we're writing beyond the bounds of the managed data. if (offset < 0) { throw new Error(utils_1.ERRORS.INVALID_WRITE_BEYOND_BOUNDS); } utils_1.checkOffsetValue(offset); } // Default to writeOffset if no offset value was given. const offsetVal = typeof offset === 'number' ? offset : this._writeOffset; // Ensure there is enough internal Buffer capacity. (raw offset is passed) this._ensureWriteable(byteSize, offsetVal); func.call(this._buff, value, offsetVal); // If an offset was given, check to see if we wrote beyond the current writeOffset. if (typeof offset === 'number') { this._writeOffset = Math.max(this._writeOffset, offsetVal + byteSize); } else { // If no numeric offset was given, we wrote to the end of the SmartBuffer so increment writeOffset. this._writeOffset += byteSize; } return this; } } exports.SmartBuffer = SmartBuffer;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/make-fetch-happen/node_modules/smart-buffer/build/smartbuffer.js.map"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const buffer_1 = require("buffer"); /** * Error strings */ const ERRORS = { INVALID_ENCODING: 'Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.', INVALID_SMARTBUFFER_SIZE: 'Invalid size provided. Size must be a valid integer greater than zero.', INVALID_SMARTBUFFER_BUFFER: 'Invalid Buffer provided in SmartBufferOptions.', INVALID_SMARTBUFFER_OBJECT: 'Invalid SmartBufferOptions object supplied to SmartBuffer constructor or factory methods.', INVALID_OFFSET: 'An invalid offset value was provided.', INVALID_OFFSET_NON_NUMBER: 'An invalid offset value was provided. A numeric value is required.', INVALID_LENGTH: 'An invalid length value was provided.', INVALID_LENGTH_NON_NUMBER: 'An invalid length value was provived. A numeric value is required.', INVALID_TARGET_OFFSET: 'Target offset is beyond the bounds of the internal SmartBuffer data.', INVALID_TARGET_LENGTH: 'Specified length value moves cursor beyong the bounds of the internal SmartBuffer data.', INVALID_READ_BEYOND_BOUNDS: 'Attempted to read beyond the bounds of the managed data.', INVALID_WRITE_BEYOND_BOUNDS: 'Attempted to write beyond the bounds of the managed data.' }; exports.ERRORS = ERRORS; /** * Checks if a given encoding is a valid Buffer encoding. (Throws an exception if check fails) * * @param { String } encoding The encoding string to check. */ function checkEncoding(encoding) { if (!buffer_1.Buffer.isEncoding(encoding)) { throw new Error(ERRORS.INVALID_ENCODING); } } exports.checkEncoding = checkEncoding; /** * Checks if a given number is a finite integer. (Throws an exception if check fails) * * @param { Number } value The number value to check. */ function isFiniteInteger(value) { return typeof value === 'number' && isFinite(value) && isInteger(value); } exports.isFiniteInteger = isFiniteInteger; /** * Checks if an offset/length value is valid. (Throws an exception if check fails) * * @param value The value to check. * @param offset True if checking an offset, false if checking a length. */ function checkOffsetOrLengthValue(value, offset) { if (typeof value === 'number') { // Check for non finite/non integers if (!isFiniteInteger(value) || value < 0) { throw new Error(offset ? ERRORS.INVALID_OFFSET : ERRORS.INVALID_LENGTH); } } else { throw new Error(offset ? ERRORS.INVALID_OFFSET_NON_NUMBER : ERRORS.INVALID_LENGTH_NON_NUMBER); } } /** * Checks if a length value is valid. (Throws an exception if check fails) * * @param { Number } length The value to check. */ function checkLengthValue(length) { checkOffsetOrLengthValue(length, false); } exports.checkLengthValue = checkLengthValue; /** * Checks if a offset value is valid. (Throws an exception if check fails) * * @param { Number } offset The value to check. */ function checkOffsetValue(offset) { checkOffsetOrLengthValue(offset, true); } exports.checkOffsetValue = checkOffsetValue; /** * Checks if a target offset value is out of bounds. (Throws an exception if check fails) * * @param { Number } offset The offset value to check. * @param { SmartBuffer } buff The SmartBuffer instance to check against. */ function checkTargetOffset(offset, buff) { if (offset < 0 || offset > buff.length) { throw new Error(ERRORS.INVALID_TARGET_OFFSET); } } exports.checkTargetOffset = checkTargetOffset; /** * Determines whether a given number is a integer. * @param value The number to check. */ function isInteger(value) { return typeof value === 'number' && isFinite(value) && Math.floor(value) === value; } /** * Throws if Node.js version is too low to support bigint */ function bigIntAndBufferInt64Check(bufferMethod) { if (typeof BigInt === 'undefined') { throw new Error('Platform does not support JS BigInt type.'); } if (typeof buffer_1.Buffer.prototype[bufferMethod] === 'undefined') { throw new Error(`Platform does not support Buffer.prototype.${bufferMethod}.`); } } exports.bigIntAndBufferInt64Check = bigIntAndBufferInt64Check;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/make-fetch-happen/node_modules/smart-buffer/build/utils.js.map"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.SocksProxyAgent = void 0; const socks_1 = require("socks"); const agent_base_1 = require("agent-base"); const debug_1 = __importDefault(require("debug")); const dns_1 = __importDefault(require("dns")); const tls_1 = __importDefault(require("tls")); const debug = (0, debug_1.default)('socks-proxy-agent'); function parseSocksProxy(opts) { var _a; let port = 0; let lookup = false; let type = 5; const host = opts.hostname || opts.host; if (host == null) { throw new TypeError('No "hostname"'); } if (typeof opts.port === 'number') { port = opts.port; } else if (typeof opts.port === 'string') { port = parseInt(opts.port, 10); } // From RFC 1928, Section 3: https://tools.ietf.org/html/rfc1928#section-3 // "The SOCKS service is conventionally located on TCP port 1080" if (port == null) { port = 1080; } // figure out if we want socks v4 or v5, based on the "protocol" used. // Defaults to 5. if (opts.protocol != null) { switch (opts.protocol.replace(':', '')) { case 'socks4': lookup = true; // pass through case 'socks4a': type = 4; break; case 'socks5': lookup = true; // pass through case 'socks': // no version specified, default to 5h case 'socks5h': type = 5; break; default: throw new TypeError(`A "socks" protocol must be specified! Got: ${String(opts.protocol)}`); } } if (typeof opts.type !== 'undefined') { if (opts.type === 4 || opts.type === 5) { type = opts.type; } else { throw new TypeError(`"type" must be 4 or 5, got: ${String(opts.type)}`); } } const proxy = { host, port, type }; let userId = (_a = opts.userId) !== null && _a !== void 0 ? _a : opts.username; let password = opts.password; if (opts.auth != null) { const auth = opts.auth.split(':'); userId = auth[0]; password = auth[1]; } if (userId != null) { Object.defineProperty(proxy, 'userId', { value: userId, enumerable: false }); } if (password != null) { Object.defineProperty(proxy, 'password', { value: password, enumerable: false }); } return { lookup, proxy }; } const normalizeProxyOptions = (input) => { let proxyOptions; if (typeof input === 'string') { proxyOptions = new URL(input); } else { proxyOptions = input; } if (proxyOptions == null) { throw new TypeError('a SOCKS proxy server `hostname` and `port` must be specified!'); } return proxyOptions; }; class SocksProxyAgent extends agent_base_1.Agent { constructor(input, options) { var _a; const proxyOptions = normalizeProxyOptions(input); super(proxyOptions); const parsedProxy = parseSocksProxy(proxyOptions); this.shouldLookup = parsedProxy.lookup; this.proxy = parsedProxy.proxy; this.tlsConnectionOptions = proxyOptions.tls != null ? proxyOptions.tls : {}; this.timeout = (_a = options === null || options === void 0 ? void 0 : options.timeout) !== null && _a !== void 0 ? _a : null; } /** * Initiates a SOCKS connection to the specified SOCKS proxy server, * which in turn connects to the specified remote host and port. * * @api protected */ callback(req, opts) { var _a; return __awaiter(this, void 0, void 0, function* () { const { shouldLookup, proxy, timeout } = this; let { host, port, lookup: lookupCallback } = opts; if (host == null) { throw new Error('No `host` defined!'); } if (shouldLookup) { // Client-side DNS resolution for "4" and "5" socks proxy versions. host = yield new Promise((resolve, reject) => { // Use the request's custom lookup, if one was configured: const lookupFn = lookupCallback !== null && lookupCallback !== void 0 ? lookupCallback : dns_1.default.lookup; lookupFn(host, {}, (err, res) => { if (err) { reject(err); } else { resolve(res); } }); }); } const socksOpts = { proxy, destination: { host, port }, command: 'connect', timeout: timeout !== null && timeout !== void 0 ? timeout : undefined }; const cleanup = (tlsSocket) => { req.destroy(); socket.destroy(); if (tlsSocket) tlsSocket.destroy(); }; debug('Creating socks proxy connection: %o', socksOpts); const { socket } = yield socks_1.SocksClient.createConnection(socksOpts); debug('Successfully created socks proxy connection'); if (timeout !== null) { socket.setTimeout(timeout); socket.on('timeout', () => cleanup()); } if (opts.secureEndpoint) { // The proxy is connecting to a TLS server, so upgrade // this socket connection to a TLS connection. debug('Upgrading socket connection to TLS'); const servername = (_a = opts.servername) !== null && _a !== void 0 ? _a : opts.host; const tlsSocket = tls_1.default.connect(Object.assign(Object.assign(Object.assign({}, omit(opts, 'host', 'hostname', 'path', 'port')), { socket, servername }), this.tlsConnectionOptions)); tlsSocket.once('error', (error) => { debug('socket TLS error', error.message); cleanup(tlsSocket); }); return tlsSocket; } return socket; }); } } exports.SocksProxyAgent = SocksProxyAgent; function omit(obj, ...keys) { const ret = {}; let key; for (key in obj) { if (!keys.includes(key)) { ret[key] = obj[key]; } } return ret; }//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/dist/index.js.map"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./client/socksclient"), exports);//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/make-fetch-happen/node_modules/socks/build/index.js.map"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function once(emitter, name, { signal } = {}) { return new Promise((resolve, reject) => { function cleanup() { signal === null || signal === void 0 ? void 0 : signal.removeEventListener('abort', cleanup); emitter.removeListener(name, onEvent); emitter.removeListener('error', onError); } function onEvent(...args) { cleanup(); resolve(args); } function onError(err) { cleanup(); reject(err); } signal === null || signal === void 0 ? void 0 : signal.addEventListener('abort', cleanup); emitter.on(name, onEvent); emitter.on('error', onError); }); } exports.default = once;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/make-fetch-happen/node_modules/@tootallnate/once/dist/index.js.map"use strict"; Object.defineProperty(exports, "__esModule", { value: true });//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/make-fetch-happen/node_modules/@tootallnate/once/dist/overloaded-parameters.js.map"use strict"; Object.defineProperty(exports, "__esModule", { value: true });//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/make-fetch-happen/node_modules/@tootallnate/once/dist/types.js.map'use strict' const contentVer = require('../../package.json')['cache-version'].content const hashToSegments = require('../util/hash-to-segments') const path = require('path') const ssri = require('ssri') // Current format of content file path: // // sha512-BaSE64Hex= -> // ~/.my-cache/content-v2/sha512/ba/da/55deadbeefc0ffee // module.exports = contentPath function contentPath (cache, integrity) { const sri = ssri.parse(integrity, { single: true }) // contentPath is the *strongest* algo given return path.join( contentDir(cache), sri.algorithm, ...hashToSegments(sri.hexDigest()) ) } module.exports.contentDir = contentDir function contentDir (cache) { return path.join(cache, `content-v${contentVer}`) } 'use strict' const util = require('util') const fs = require('fs') const fsm = require('fs-minipass') const ssri = require('ssri') const contentPath = require('./path') const Pipeline = require('minipass-pipeline') const lstat = util.promisify(fs.lstat) const readFile = util.promisify(fs.readFile) module.exports = read const MAX_SINGLE_READ_SIZE = 64 * 1024 * 1024 function read (cache, integrity, opts = {}) { const { size } = opts return withContentSri(cache, integrity, (cpath, sri) => { // get size return lstat(cpath).then(stat => ({ stat, cpath, sri })) }).then(({ stat, cpath, sri }) => { if (typeof size === 'number' && stat.size !== size) { throw sizeError(size, stat.size) } if (stat.size > MAX_SINGLE_READ_SIZE) { return readPipeline(cpath, stat.size, sri, new Pipeline()).concat() } return readFile(cpath, null).then((data) => { if (!ssri.checkData(data, sri)) { throw integrityError(sri, cpath) } return data }) }) } const readPipeline = (cpath, size, sri, stream) => { stream.push( new fsm.ReadStream(cpath, { size, readSize: MAX_SINGLE_READ_SIZE, }), ssri.integrityStream({ integrity: sri, size, }) ) return stream } module.exports.sync = readSync function readSync (cache, integrity, opts = {}) { const { size } = opts return withContentSriSync(cache, integrity, (cpath, sri) => { const data = fs.readFileSync(cpath) if (typeof size === 'number' && size !== data.length) { throw sizeError(size, data.length) } if (ssri.checkData(data, sri)) { return data } throw integrityError(sri, cpath) }) } module.exports.stream = readStream module.exports.readStream = readStream function readStream (cache, integrity, opts = {}) { const { size } = opts const stream = new Pipeline() withContentSri(cache, integrity, (cpath, sri) => { // just lstat to ensure it exists return lstat(cpath).then((stat) => ({ stat, cpath, sri })) }).then(({ stat, cpath, sri }) => { if (typeof size === 'number' && size !== stat.size) { return stream.emit('error', sizeError(size, stat.size)) } readPipeline(cpath, stat.size, sri, stream) }, er => stream.emit('error', er)) return stream } let copyFile if (fs.copyFile) { module.exports.copy = copy module.exports.copy.sync = copySync copyFile = util.promisify(fs.copyFile) } function copy (cache, integrity, dest) { return withContentSri(cache, integrity, (cpath, sri) => { return copyFile(cpath, dest) }) } function copySync (cache, integrity, dest) { return withContentSriSync(cache, integrity, (cpath, sri) => { return fs.copyFileSync(cpath, dest) }) } module.exports.hasContent = hasContent function hasContent (cache, integrity) { if (!integrity) { return Promise.resolve(false) } return withContentSri(cache, integrity, (cpath, sri) => { return lstat(cpath).then((stat) => ({ size: stat.size, sri, stat })) }).catch((err) => { if (err.code === 'ENOENT') { return false } if (err.code === 'EPERM') { /* istanbul ignore else */ if (process.platform !== 'win32') { throw err } else { return false } } }) } module.exports.hasContent.sync = hasContentSync function hasContentSync (cache, integrity) { if (!integrity) { return false } return withContentSriSync(cache, integrity, (cpath, sri) => { try { const stat = fs.lstatSync(cpath) return { size: stat.size, sri, stat } } catch (err) { if (err.code === 'ENOENT') { return false } if (err.code === 'EPERM') { /* istanbul ignore else */ if (process.platform !== 'win32') { throw err } else { return false } } } }) } function withContentSri (cache, integrity, fn) { const tryFn = () => { const sri = ssri.parse(integrity) // If `integrity` has multiple entries, pick the first digest // with available local data. const algo = sri.pickAlgorithm() const digests = sri[algo] if (digests.length <= 1) { const cpath = contentPath(cache, digests[0]) return fn(cpath, digests[0]) } else { // Can't use race here because a generic error can happen before // a ENOENT error, and can happen before a valid result return Promise .all(digests.map((meta) => { return withContentSri(cache, meta, fn) .catch((err) => { if (err.code === 'ENOENT') { return Object.assign( new Error('No matching content found for ' + sri.toString()), { code: 'ENOENT' } ) } return err }) })) .then((results) => { // Return the first non error if it is found const result = results.find((r) => !(r instanceof Error)) if (result) { return result } // Throw the No matching content found error const enoentError = results.find((r) => r.code === 'ENOENT') if (enoentError) { throw enoentError } // Throw generic error throw results.find((r) => r instanceof Error) }) } } return new Promise((resolve, reject) => { try { tryFn() .then(resolve) .catch(reject) } catch (err) { reject(err) } }) } function withContentSriSync (cache, integrity, fn) { const sri = ssri.parse(integrity) // If `integrity` has multiple entries, pick the first digest // with available local data. const algo = sri.pickAlgorithm() const digests = sri[algo] if (digests.length <= 1) { const cpath = contentPath(cache, digests[0]) return fn(cpath, digests[0]) } else { let lastErr = null for (const meta of digests) { try { return withContentSriSync(cache, meta, fn) } catch (err) { lastErr = err } } throw lastErr } } function sizeError (expected, found) { /* eslint-disable-next-line max-len */ const err = new Error(`Bad data size: expected inserted data to be ${expected} bytes, but got ${found} instead`) err.expected = expected err.found = found err.code = 'EBADSIZE' return err } function integrityError (sri, path) { const err = new Error(`Integrity verification failed for ${sri} (${path})`) err.code = 'EINTEGRITY' err.sri = sri err.path = path return err } 'use strict' const util = require('util') const contentPath = require('./path') const { hasContent } = require('./read') const rimraf = util.promisify(require('rimraf')) module.exports = rm function rm (cache, integrity) { return hasContent(cache, integrity).then((content) => { // ~pretty~ sure we can't end up with a content lacking sri, but be safe if (content && content.sri) { return rimraf(contentPath(cache, content.sri)).then(() => true) } else { return false } }) } 'use strict' const util = require('util') const contentPath = require('./path') const fixOwner = require('../util/fix-owner') const fs = require('fs') const moveFile = require('../util/move-file') const Minipass = require('minipass') const Pipeline = require('minipass-pipeline') const Flush = require('minipass-flush') const path = require('path') const rimraf = util.promisify(require('rimraf')) const ssri = require('ssri') const uniqueFilename = require('unique-filename') const { disposer } = require('./../util/disposer') const fsm = require('fs-minipass') const writeFile = util.promisify(fs.writeFile) module.exports = write function write (cache, data, opts = {}) { const { algorithms, size, integrity } = opts if (algorithms && algorithms.length > 1) { throw new Error('opts.algorithms only supports a single algorithm for now') } if (typeof size === 'number' && data.length !== size) { return Promise.reject(sizeError(size, data.length)) } const sri = ssri.fromData(data, algorithms ? { algorithms } : {}) if (integrity && !ssri.checkData(data, integrity, opts)) { return Promise.reject(checksumError(integrity, sri)) } return disposer(makeTmp(cache, opts), makeTmpDisposer, (tmp) => { return writeFile(tmp.target, data, { flag: 'wx' }) .then(() => moveToDestination(tmp, cache, sri, opts)) }) .then(() => ({ integrity: sri, size: data.length })) } module.exports.stream = writeStream // writes proxied to the 'inputStream' that is passed to the Promise // 'end' is deferred until content is handled. class CacacheWriteStream extends Flush { constructor (cache, opts) { super() this.opts = opts this.cache = cache this.inputStream = new Minipass() this.inputStream.on('error', er => this.emit('error', er)) this.inputStream.on('drain', () => this.emit('drain')) this.handleContentP = null } write (chunk, encoding, cb) { if (!this.handleContentP) { this.handleContentP = handleContent( this.inputStream, this.cache, this.opts ) } return this.inputStream.write(chunk, encoding, cb) } flush (cb) { this.inputStream.end(() => { if (!this.handleContentP) { const e = new Error('Cache input stream was empty') e.code = 'ENODATA' // empty streams are probably emitting end right away. // defer this one tick by rejecting a promise on it. return Promise.reject(e).catch(cb) } this.handleContentP.then( (res) => { res.integrity && this.emit('integrity', res.integrity) res.size !== null && this.emit('size', res.size) cb() }, (er) => cb(er) ) }) } } function writeStream (cache, opts = {}) { return new CacacheWriteStream(cache, opts) } function handleContent (inputStream, cache, opts) { return disposer(makeTmp(cache, opts), makeTmpDisposer, (tmp) => { return pipeToTmp(inputStream, cache, tmp.target, opts) .then((res) => { return moveToDestination( tmp, cache, res.integrity, opts ).then(() => res) }) }) } function pipeToTmp (inputStream, cache, tmpTarget, opts) { let integrity let size const hashStream = ssri.integrityStream({ integrity: opts.integrity, algorithms: opts.algorithms, size: opts.size, }) hashStream.on('integrity', i => { integrity = i }) hashStream.on('size', s => { size = s }) const outStream = new fsm.WriteStream(tmpTarget, { flags: 'wx', }) // NB: this can throw if the hashStream has a problem with // it, and the data is fully written. but pipeToTmp is only // called in promisory contexts where that is handled. const pipeline = new Pipeline( inputStream, hashStream, outStream ) return pipeline.promise() .then(() => ({ integrity, size })) .catch(er => rimraf(tmpTarget).then(() => { throw er })) } function makeTmp (cache, opts) { const tmpTarget = uniqueFilename(path.join(cache, 'tmp'), opts.tmpPrefix) return fixOwner.mkdirfix(cache, path.dirname(tmpTarget)).then(() => ({ target: tmpTarget, moved: false, })) } function makeTmpDisposer (tmp) { if (tmp.moved) { return Promise.resolve() } return rimraf(tmp.target) } function moveToDestination (tmp, cache, sri, opts) { const destination = contentPath(cache, sri) const destDir = path.dirname(destination) return fixOwner .mkdirfix(cache, destDir) .then(() => { return moveFile(tmp.target, destination) }) .then(() => { tmp.moved = true return fixOwner.chownr(cache, destination) }) } function sizeError (expected, found) { /* eslint-disable-next-line max-len */ const err = new Error(`Bad data size: expected inserted data to be ${expected} bytes, but got ${found} instead`) err.expected = expected err.found = found err.code = 'EBADSIZE' return err } function checksumError (expected, found) { const err = new Error(`Integrity check failed: Wanted: ${expected} Found: ${found}`) err.code = 'EINTEGRITY' err.expected = expected err.found = found return err } 'use strict' module.exports.disposer = disposer function disposer (creatorFn, disposerFn, fn) { const runDisposer = (resource, result, shouldThrow = false) => { return disposerFn(resource) .then( // disposer resolved, do something with original fn's promise () => { if (shouldThrow) { throw result } return result }, // Disposer fn failed, crash process (err) => { throw err // Or process.exit? }) } return creatorFn .then((resource) => { // fn(resource) can throw, so wrap in a promise here return Promise.resolve().then(() => fn(resource)) .then((result) => runDisposer(resource, result)) .catch((err) => runDisposer(resource, err, true)) }) } 'use strict' const util = require('util') const chownr = util.promisify(require('chownr')) const mkdirp = require('mkdirp') const inflight = require('promise-inflight') const inferOwner = require('infer-owner') // Memoize getuid()/getgid() calls. // patch process.setuid/setgid to invalidate cached value on change const self = { uid: null, gid: null } const getSelf = () => { if (typeof self.uid !== 'number') { self.uid = process.getuid() const setuid = process.setuid process.setuid = (uid) => { self.uid = null process.setuid = setuid return process.setuid(uid) } } if (typeof self.gid !== 'number') { self.gid = process.getgid() const setgid = process.setgid process.setgid = (gid) => { self.gid = null process.setgid = setgid return process.setgid(gid) } } } module.exports.chownr = fixOwner function fixOwner (cache, filepath) { if (!process.getuid) { // This platform doesn't need ownership fixing return Promise.resolve() } getSelf() if (self.uid !== 0) { // almost certainly can't chown anyway return Promise.resolve() } return Promise.resolve(inferOwner(cache)).then((owner) => { const { uid, gid } = owner // No need to override if it's already what we used. if (self.uid === uid && self.gid === gid) { return } return inflight('fixOwner: fixing ownership on ' + filepath, () => chownr( filepath, typeof uid === 'number' ? uid : self.uid, typeof gid === 'number' ? gid : self.gid ).catch((err) => { if (err.code === 'ENOENT') { return null } throw err }) ) }) } module.exports.chownr.sync = fixOwnerSync function fixOwnerSync (cache, filepath) { if (!process.getuid) { // This platform doesn't need ownership fixing return } const { uid, gid } = inferOwner.sync(cache) getSelf() if (self.uid !== 0) { // almost certainly can't chown anyway return } if (self.uid === uid && self.gid === gid) { // No need to override if it's already what we used. return } try { chownr.sync( filepath, typeof uid === 'number' ? uid : self.uid, typeof gid === 'number' ? gid : self.gid ) } catch (err) { // only catch ENOENT, any other error is a problem. if (err.code === 'ENOENT') { return null } throw err } } module.exports.mkdirfix = mkdirfix function mkdirfix (cache, p, cb) { // we have to infer the owner _before_ making the directory, even though // we aren't going to use the results, since the cache itself might not // exist yet. If we mkdirp it, then our current uid/gid will be assumed // to be correct if it creates the cache folder in the process. return Promise.resolve(inferOwner(cache)).then(() => { return mkdirp(p) .then((made) => { if (made) { return fixOwner(cache, made).then(() => made) } }) .catch((err) => { if (err.code === 'EEXIST') { return fixOwner(cache, p).then(() => null) } throw err }) }) } module.exports.mkdirfix.sync = mkdirfixSync function mkdirfixSync (cache, p) { try { inferOwner.sync(cache) const made = mkdirp.sync(p) if (made) { fixOwnerSync(cache, made) return made } } catch (err) { if (err.code === 'EEXIST') { fixOwnerSync(cache, p) return null } else { throw err } } } 'use strict' module.exports = hashToSegments function hashToSegments (hash) { return [hash.slice(0, 2), hash.slice(2, 4), hash.slice(4)] } 'use strict' const fs = require('fs') const util = require('util') const chmod = util.promisify(fs.chmod) const unlink = util.promisify(fs.unlink) const stat = util.promisify(fs.stat) const move = require('@npmcli/move-file') const pinflight = require('promise-inflight') module.exports = moveFile function moveFile (src, dest) { const isWindows = global.__CACACHE_TEST_FAKE_WINDOWS__ || process.platform === 'win32' // This isn't quite an fs.rename -- the assumption is that // if `dest` already exists, and we get certain errors while // trying to move it, we should just not bother. // // In the case of cache corruption, users will receive an // EINTEGRITY error elsewhere, and can remove the offending // content their own way. // // Note that, as the name suggests, this strictly only supports file moves. return new Promise((resolve, reject) => { fs.link(src, dest, (err) => { if (err) { if (isWindows && err.code === 'EPERM') { // XXX This is a really weird way to handle this situation, as it // results in the src file being deleted even though the dest // might not exist. Since we pretty much always write files to // deterministic locations based on content hash, this is likely // ok (or at worst, just ends in a future cache miss). But it would // be worth investigating at some time in the future if this is // really what we want to do here. return resolve() } else if (err.code === 'EEXIST' || err.code === 'EBUSY') { // file already exists, so whatever return resolve() } else { return reject(err) } } else { return resolve() } }) }) .then(() => { // content should never change for any reason, so make it read-only return Promise.all([ unlink(src), !isWindows && chmod(dest, '0444'), ]) }) .catch(() => { return pinflight('cacache-move-file:' + dest, () => { return stat(dest).catch((err) => { if (err.code !== 'ENOENT') { // Something else is wrong here. Bail bail bail throw err } // file doesn't already exist! let's try a rename -> copy fallback // only delete if it successfully copies return move(src, dest) }) }) }) } 'use strict' const fs = require('@npmcli/fs') const fixOwner = require('./fix-owner') const path = require('path') module.exports.mkdir = mktmpdir function mktmpdir (cache, opts = {}) { const { tmpPrefix } = opts const tmpDir = path.join(cache, 'tmp') return fs.mkdir(tmpDir, { recursive: true, owner: 'inherit' }) .then(() => { // do not use path.join(), it drops the trailing / if tmpPrefix is unset const target = `${tmpDir}${path.sep}${tmpPrefix || ''}` return fs.mkdtemp(target, { owner: 'inherit' }) }) } module.exports.withTmp = withTmp function withTmp (cache, opts, cb) { if (!cb) { cb = opts opts = {} } return fs.withTempDir(path.join(cache, 'tmp'), cb, opts) } module.exports.fix = fixtmpdir function fixtmpdir (cache) { return fixOwner(cache, path.join(cache, 'tmp')) } /** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; var w = d * 7; var y = d * 365.25; /** * Parse or format the given `val`. * * Options: * * - `long` verbose formatting [false] * * @param {String|Number} val * @param {Object} [options] * @throws {Error} throw an error if val is not a non-empty string or a number * @return {String|Number} * @api public */ module.exports = function (val, options) { options = options || {}; var type = typeof val; if (type === 'string' && val.length > 0) { return parse(val); } else if (type === 'number' && isFinite(val)) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error( 'val is not a non-empty string or a valid number. val=' + JSON.stringify(val) ); }; /** * Parse the given `str` and return milliseconds. * * @param {String} str * @return {Number} * @api private */ function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( str ); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'yrs': case 'yr': case 'y': return n * y; case 'weeks': case 'week': case 'w': return n * w; case 'days': case 'day': case 'd': return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': return n * m; case 'seconds': case 'second': case 'secs': case 'sec': case 's': return n * s; case 'milliseconds': case 'millisecond': case 'msecs': case 'msec': case 'ms': return n; default: return undefined; } } /** * Short format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtShort(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return Math.round(ms / d) + 'd'; } if (msAbs >= h) { return Math.round(ms / h) + 'h'; } if (msAbs >= m) { return Math.round(ms / m) + 'm'; } if (msAbs >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtLong(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return plural(ms, msAbs, d, 'day'); } if (msAbs >= h) { return plural(ms, msAbs, h, 'hour'); } if (msAbs >= m) { return plural(ms, msAbs, m, 'minute'); } if (msAbs >= s) { return plural(ms, msAbs, s, 'second'); } return ms + ' ms'; } /** * Pluralization helper. */ function plural(ms, msAbs, n, name) { var isPlural = msAbs >= n * 1.5; return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); } The MIT License (MIT) Copyright (c) 2020 Vercel, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "ms", "version": "2.1.3", "description": "Tiny millisecond conversion utility", "repository": "vercel/ms", "main": "./index", "files": [ "index.js" ], "scripts": { "precommit": "lint-staged", "lint": "eslint lib/* bin/*", "test": "mocha tests.js" }, "eslintConfig": { "extends": "eslint:recommended", "env": { "node": true, "es6": true } }, "lint-staged": { "*.js": [ "npm run lint", "prettier --single-quote --write", "git add" ] }, "license": "MIT", "devDependencies": { "eslint": "4.18.2", "expect.js": "0.3.1", "husky": "0.14.3", "lint-staged": "5.0.0", "mocha": "4.0.1", "prettier": "2.0.5" } } ## 7.0 - Raise error if `options.cwd` is specified, and not a directory ## 6.0 - Remove comment and negation pattern support - Ignore patterns are always in `dot:true` mode ## 5.0 - Deprecate comment and negation patterns - Fix regression in `mark` and `nodir` options from making all cache keys absolute path. - Abort if `fs.readdir` returns an error that's unexpected - Don't emit `match` events for ignored items - Treat ENOTSUP like ENOTDIR in readdir ## 4.5 - Add `options.follow` to always follow directory symlinks in globstar - Add `options.realpath` to call `fs.realpath` on all results - Always cache based on absolute path ## 4.4 - Add `options.ignore` - Fix handling of broken symlinks ## 4.3 - Bump minimatch to 2.x - Pass all tests on Windows ## 4.2 - Add `glob.hasMagic` function - Add `options.nodir` flag ## 4.1 - Refactor sync and async implementations for performance - Throw if callback provided to sync glob function - Treat symbolic links in globstar results the same as Bash 4.3 ## 4.0 - Use `^` for dependency versions (bumped major because this breaks older npm versions) - Ensure callbacks are only ever called once - switch to ISC license ## 3.x - Rewrite in JavaScript - Add support for setting root, cwd, and windows support - Cache many fs calls - Add globstar support - emit match events ## 2.x - Use `glob.h` and `fnmatch.h` from NetBSD ## 1.x - `glob.h` static binding. exports.setopts = setopts exports.ownProp = ownProp exports.makeAbs = makeAbs exports.finish = finish exports.mark = mark exports.isIgnored = isIgnored exports.childrenIgnored = childrenIgnored function ownProp (obj, field) { return Object.prototype.hasOwnProperty.call(obj, field) } var path = require("path") var minimatch = require("minimatch") var isAbsolute = require("path-is-absolute") var Minimatch = minimatch.Minimatch function alphasort (a, b) { return a.localeCompare(b, 'en') } function setupIgnores (self, options) { self.ignore = options.ignore || [] if (!Array.isArray(self.ignore)) self.ignore = [self.ignore] if (self.ignore.length) { self.ignore = self.ignore.map(ignoreMap) } } // ignore patterns are always in dot:true mode. function ignoreMap (pattern) { var gmatcher = null if (pattern.slice(-3) === '/**') { var gpattern = pattern.replace(/(\/\*\*)+$/, '') gmatcher = new Minimatch(gpattern, { dot: true }) } return { matcher: new Minimatch(pattern, { dot: true }), gmatcher: gmatcher } } function setopts (self, pattern, options) { if (!options) options = {} // base-matching: just use globstar for that. if (options.matchBase && -1 === pattern.indexOf("/")) { if (options.noglobstar) { throw new Error("base matching requires globstar") } pattern = "**/" + pattern } self.silent = !!options.silent self.pattern = pattern self.strict = options.strict !== false self.realpath = !!options.realpath self.realpathCache = options.realpathCache || Object.create(null) self.follow = !!options.follow self.dot = !!options.dot self.mark = !!options.mark self.nodir = !!options.nodir if (self.nodir) self.mark = true self.sync = !!options.sync self.nounique = !!options.nounique self.nonull = !!options.nonull self.nosort = !!options.nosort self.nocase = !!options.nocase self.stat = !!options.stat self.noprocess = !!options.noprocess self.absolute = !!options.absolute self.maxLength = options.maxLength || Infinity self.cache = options.cache || Object.create(null) self.statCache = options.statCache || Object.create(null) self.symlinks = options.symlinks || Object.create(null) setupIgnores(self, options) self.changedCwd = false var cwd = process.cwd() if (!ownProp(options, "cwd")) self.cwd = cwd else { self.cwd = path.resolve(options.cwd) self.changedCwd = self.cwd !== cwd } self.root = options.root || path.resolve(self.cwd, "/") self.root = path.resolve(self.root) if (process.platform === "win32") self.root = self.root.replace(/\\/g, "/") // TODO: is an absolute `cwd` supposed to be resolved against `root`? // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) if (process.platform === "win32") self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") self.nomount = !!options.nomount // disable comments and negation in Minimatch. // Note that they are not supported in Glob itself anyway. options.nonegate = true options.nocomment = true self.minimatch = new Minimatch(pattern, options) self.options = self.minimatch.options } function finish (self) { var nou = self.nounique var all = nou ? [] : Object.create(null) for (var i = 0, l = self.matches.length; i < l; i ++) { var matches = self.matches[i] if (!matches || Object.keys(matches).length === 0) { if (self.nonull) { // do like the shell, and spit out the literal glob var literal = self.minimatch.globSet[i] if (nou) all.push(literal) else all[literal] = true } } else { // had matches var m = Object.keys(matches) if (nou) all.push.apply(all, m) else m.forEach(function (m) { all[m] = true }) } } if (!nou) all = Object.keys(all) if (!self.nosort) all = all.sort(alphasort) // at *some* point we statted all of these if (self.mark) { for (var i = 0; i < all.length; i++) { all[i] = self._mark(all[i]) } if (self.nodir) { all = all.filter(function (e) { var notDir = !(/\/$/.test(e)) var c = self.cache[e] || self.cache[makeAbs(self, e)] if (notDir && c) notDir = c !== 'DIR' && !Array.isArray(c) return notDir }) } } if (self.ignore.length) all = all.filter(function(m) { return !isIgnored(self, m) }) self.found = all } function mark (self, p) { var abs = makeAbs(self, p) var c = self.cache[abs] var m = p if (c) { var isDir = c === 'DIR' || Array.isArray(c) var slash = p.slice(-1) === '/' if (isDir && !slash) m += '/' else if (!isDir && slash) m = m.slice(0, -1) if (m !== p) { var mabs = makeAbs(self, m) self.statCache[mabs] = self.statCache[abs] self.cache[mabs] = self.cache[abs] } } return m } // lotta situps... function makeAbs (self, f) { var abs = f if (f.charAt(0) === '/') { abs = path.join(self.root, f) } else if (isAbsolute(f) || f === '') { abs = f } else if (self.changedCwd) { abs = path.resolve(self.cwd, f) } else { abs = path.resolve(f) } if (process.platform === 'win32') abs = abs.replace(/\\/g, '/') return abs } // Return true, if pattern ends with globstar '**', for the accompanying parent directory. // Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents function isIgnored (self, path) { if (!self.ignore.length) return false return self.ignore.some(function(item) { return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) }) } function childrenIgnored (self, path) { if (!self.ignore.length) return false return self.ignore.some(function(item) { return !!(item.gmatcher && item.gmatcher.match(path)) }) } // Approach: // // 1. Get the minimatch set // 2. For each pattern in the set, PROCESS(pattern, false) // 3. Store matches per-set, then uniq them // // PROCESS(pattern, inGlobStar) // Get the first [n] items from pattern that are all strings // Join these together. This is PREFIX. // If there is no more remaining, then stat(PREFIX) and // add to matches if it succeeds. END. // // If inGlobStar and PREFIX is symlink and points to dir // set ENTRIES = [] // else readdir(PREFIX) as ENTRIES // If fail, END // // with ENTRIES // If pattern[n] is GLOBSTAR // // handle the case where the globstar match is empty // // by pruning it out, and testing the resulting pattern // PROCESS(pattern[0..n] + pattern[n+1 .. $], false) // // handle other cases. // for ENTRY in ENTRIES (not dotfiles) // // attach globstar + tail onto the entry // // Mark that this entry is a globstar match // PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) // // else // not globstar // for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) // Test ENTRY against pattern[n] // If fails, continue // If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) // // Caveat: // Cache all stats and readdirs results to minimize syscall. Since all // we ever care about is existence and directory-ness, we can just keep // `true` for files, and [children,...] for directories, or `false` for // things that don't exist. module.exports = glob var fs = require('fs') var rp = require('fs.realpath') var minimatch = require('minimatch') var Minimatch = minimatch.Minimatch var inherits = require('inherits') var EE = require('events').EventEmitter var path = require('path') var assert = require('assert') var isAbsolute = require('path-is-absolute') var globSync = require('./sync.js') var common = require('./common.js') var setopts = common.setopts var ownProp = common.ownProp var inflight = require('inflight') var util = require('util') var childrenIgnored = common.childrenIgnored var isIgnored = common.isIgnored var once = require('once') function glob (pattern, options, cb) { if (typeof options === 'function') cb = options, options = {} if (!options) options = {} if (options.sync) { if (cb) throw new TypeError('callback provided to sync glob') return globSync(pattern, options) } return new Glob(pattern, options, cb) } glob.sync = globSync var GlobSync = glob.GlobSync = globSync.GlobSync // old api surface glob.glob = glob function extend (origin, add) { if (add === null || typeof add !== 'object') { return origin } var keys = Object.keys(add) var i = keys.length while (i--) { origin[keys[i]] = add[keys[i]] } return origin } glob.hasMagic = function (pattern, options_) { var options = extend({}, options_) options.noprocess = true var g = new Glob(pattern, options) var set = g.minimatch.set if (!pattern) return false if (set.length > 1) return true for (var j = 0; j < set[0].length; j++) { if (typeof set[0][j] !== 'string') return true } return false } glob.Glob = Glob inherits(Glob, EE) function Glob (pattern, options, cb) { if (typeof options === 'function') { cb = options options = null } if (options && options.sync) { if (cb) throw new TypeError('callback provided to sync glob') return new GlobSync(pattern, options) } if (!(this instanceof Glob)) return new Glob(pattern, options, cb) setopts(this, pattern, options) this._didRealPath = false // process each pattern in the minimatch set var n = this.minimatch.set.length // The matches are stored as {: true,...} so that // duplicates are automagically pruned. // Later, we do an Object.keys() on these. // Keep them as a list so we can fill in when nonull is set. this.matches = new Array(n) if (typeof cb === 'function') { cb = once(cb) this.on('error', cb) this.on('end', function (matches) { cb(null, matches) }) } var self = this this._processing = 0 this._emitQueue = [] this._processQueue = [] this.paused = false if (this.noprocess) return this if (n === 0) return done() var sync = true for (var i = 0; i < n; i ++) { this._process(this.minimatch.set[i], i, false, done) } sync = false function done () { --self._processing if (self._processing <= 0) { if (sync) { process.nextTick(function () { self._finish() }) } else { self._finish() } } } } Glob.prototype._finish = function () { assert(this instanceof Glob) if (this.aborted) return if (this.realpath && !this._didRealpath) return this._realpath() common.finish(this) this.emit('end', this.found) } Glob.prototype._realpath = function () { if (this._didRealpath) return this._didRealpath = true var n = this.matches.length if (n === 0) return this._finish() var self = this for (var i = 0; i < this.matches.length; i++) this._realpathSet(i, next) function next () { if (--n === 0) self._finish() } } Glob.prototype._realpathSet = function (index, cb) { var matchset = this.matches[index] if (!matchset) return cb() var found = Object.keys(matchset) var self = this var n = found.length if (n === 0) return cb() var set = this.matches[index] = Object.create(null) found.forEach(function (p, i) { // If there's a problem with the stat, then it means that // one or more of the links in the realpath couldn't be // resolved. just return the abs value in that case. p = self._makeAbs(p) rp.realpath(p, self.realpathCache, function (er, real) { if (!er) set[real] = true else if (er.syscall === 'stat') set[p] = true else self.emit('error', er) // srsly wtf right here if (--n === 0) { self.matches[index] = set cb() } }) }) } Glob.prototype._mark = function (p) { return common.mark(this, p) } Glob.prototype._makeAbs = function (f) { return common.makeAbs(this, f) } Glob.prototype.abort = function () { this.aborted = true this.emit('abort') } Glob.prototype.pause = function () { if (!this.paused) { this.paused = true this.emit('pause') } } Glob.prototype.resume = function () { if (this.paused) { this.emit('resume') this.paused = false if (this._emitQueue.length) { var eq = this._emitQueue.slice(0) this._emitQueue.length = 0 for (var i = 0; i < eq.length; i ++) { var e = eq[i] this._emitMatch(e[0], e[1]) } } if (this._processQueue.length) { var pq = this._processQueue.slice(0) this._processQueue.length = 0 for (var i = 0; i < pq.length; i ++) { var p = pq[i] this._processing-- this._process(p[0], p[1], p[2], p[3]) } } } } Glob.prototype._process = function (pattern, index, inGlobStar, cb) { assert(this instanceof Glob) assert(typeof cb === 'function') if (this.aborted) return this._processing++ if (this.paused) { this._processQueue.push([pattern, index, inGlobStar, cb]) return } //console.error('PROCESS %d', this._processing, pattern) // Get the first [n] parts of pattern that are all strings. var n = 0 while (typeof pattern[n] === 'string') { n ++ } // now n is the index of the first one that is *not* a string. // see if there's anything else var prefix switch (n) { // if not, then this is rather simple case pattern.length: this._processSimple(pattern.join('/'), index, cb) return case 0: // pattern *starts* with some non-trivial item. // going to readdir(cwd), but not include the prefix in matches. prefix = null break default: // pattern has some string bits in the front. // whatever it starts with, whether that's 'absolute' like /foo/bar, // or 'relative' like '../baz' prefix = pattern.slice(0, n).join('/') break } var remain = pattern.slice(n) // get the list of entries. var read if (prefix === null) read = '.' else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { if (!prefix || !isAbsolute(prefix)) prefix = '/' + prefix read = prefix } else read = prefix var abs = this._makeAbs(read) //if ignored, skip _processing if (childrenIgnored(this, read)) return cb() var isGlobStar = remain[0] === minimatch.GLOBSTAR if (isGlobStar) this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) else this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) } Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { var self = this this._readdir(abs, inGlobStar, function (er, entries) { return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) }) } Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { // if the abs isn't a dir, then nothing can match! if (!entries) return cb() // It will only match dot entries if it starts with a dot, or if // dot is set. Stuff like @(.foo|.bar) isn't allowed. var pn = remain[0] var negate = !!this.minimatch.negate var rawGlob = pn._glob var dotOk = this.dot || rawGlob.charAt(0) === '.' var matchedEntries = [] for (var i = 0; i < entries.length; i++) { var e = entries[i] if (e.charAt(0) !== '.' || dotOk) { var m if (negate && !prefix) { m = !e.match(pn) } else { m = e.match(pn) } if (m) matchedEntries.push(e) } } //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) var len = matchedEntries.length // If there are no matched entries, then nothing matches. if (len === 0) return cb() // if this is the last remaining pattern bit, then no need for // an additional stat *unless* the user has specified mark or // stat explicitly. We know they exist, since readdir returned // them. if (remain.length === 1 && !this.mark && !this.stat) { if (!this.matches[index]) this.matches[index] = Object.create(null) for (var i = 0; i < len; i ++) { var e = matchedEntries[i] if (prefix) { if (prefix !== '/') e = prefix + '/' + e else e = prefix + e } if (e.charAt(0) === '/' && !this.nomount) { e = path.join(this.root, e) } this._emitMatch(index, e) } // This was the last one, and no stats were needed return cb() } // now test all matched entries as stand-ins for that part // of the pattern. remain.shift() for (var i = 0; i < len; i ++) { var e = matchedEntries[i] var newPattern if (prefix) { if (prefix !== '/') e = prefix + '/' + e else e = prefix + e } this._process([e].concat(remain), index, inGlobStar, cb) } cb() } Glob.prototype._emitMatch = function (index, e) { if (this.aborted) return if (isIgnored(this, e)) return if (this.paused) { this._emitQueue.push([index, e]) return } var abs = isAbsolute(e) ? e : this._makeAbs(e) if (this.mark) e = this._mark(e) if (this.absolute) e = abs if (this.matches[index][e]) return if (this.nodir) { var c = this.cache[abs] if (c === 'DIR' || Array.isArray(c)) return } this.matches[index][e] = true var st = this.statCache[abs] if (st) this.emit('stat', e, st) this.emit('match', e) } Glob.prototype._readdirInGlobStar = function (abs, cb) { if (this.aborted) return // follow all symlinked directories forever // just proceed as if this is a non-globstar situation if (this.follow) return this._readdir(abs, false, cb) var lstatkey = 'lstat\0' + abs var self = this var lstatcb = inflight(lstatkey, lstatcb_) if (lstatcb) fs.lstat(abs, lstatcb) function lstatcb_ (er, lstat) { if (er && er.code === 'ENOENT') return cb() var isSym = lstat && lstat.isSymbolicLink() self.symlinks[abs] = isSym // If it's not a symlink or a dir, then it's definitely a regular file. // don't bother doing a readdir in that case. if (!isSym && lstat && !lstat.isDirectory()) { self.cache[abs] = 'FILE' cb() } else self._readdir(abs, false, cb) } } Glob.prototype._readdir = function (abs, inGlobStar, cb) { if (this.aborted) return cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) if (!cb) return //console.error('RD %j %j', +inGlobStar, abs) if (inGlobStar && !ownProp(this.symlinks, abs)) return this._readdirInGlobStar(abs, cb) if (ownProp(this.cache, abs)) { var c = this.cache[abs] if (!c || c === 'FILE') return cb() if (Array.isArray(c)) return cb(null, c) } var self = this fs.readdir(abs, readdirCb(this, abs, cb)) } function readdirCb (self, abs, cb) { return function (er, entries) { if (er) self._readdirError(abs, er, cb) else self._readdirEntries(abs, entries, cb) } } Glob.prototype._readdirEntries = function (abs, entries, cb) { if (this.aborted) return // if we haven't asked to stat everything, then just // assume that everything in there exists, so we can avoid // having to stat it a second time. if (!this.mark && !this.stat) { for (var i = 0; i < entries.length; i ++) { var e = entries[i] if (abs === '/') e = abs + e else e = abs + '/' + e this.cache[e] = true } } this.cache[abs] = entries return cb(null, entries) } Glob.prototype._readdirError = function (f, er, cb) { if (this.aborted) return // handle errors, and cache the information switch (er.code) { case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 case 'ENOTDIR': // totally normal. means it *does* exist. var abs = this._makeAbs(f) this.cache[abs] = 'FILE' if (abs === this.cwdAbs) { var error = new Error(er.code + ' invalid cwd ' + this.cwd) error.path = this.cwd error.code = er.code this.emit('error', error) this.abort() } break case 'ENOENT': // not terribly unusual case 'ELOOP': case 'ENAMETOOLONG': case 'UNKNOWN': this.cache[this._makeAbs(f)] = false break default: // some unusual error. Treat as failure. this.cache[this._makeAbs(f)] = false if (this.strict) { this.emit('error', er) // If the error is handled, then we abort // if not, we threw out of here this.abort() } if (!this.silent) console.error('glob error', er) break } return cb() } Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { var self = this this._readdir(abs, inGlobStar, function (er, entries) { self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) }) } Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { //console.error('pgs2', prefix, remain[0], entries) // no entries means not a dir, so it can never have matches // foo.txt/** doesn't match foo.txt if (!entries) return cb() // test without the globstar, and with every child both below // and replacing the globstar. var remainWithoutGlobStar = remain.slice(1) var gspref = prefix ? [ prefix ] : [] var noGlobStar = gspref.concat(remainWithoutGlobStar) // the noGlobStar pattern exits the inGlobStar state this._process(noGlobStar, index, false, cb) var isSym = this.symlinks[abs] var len = entries.length // If it's a symlink, and we're in a globstar, then stop if (isSym && inGlobStar) return cb() for (var i = 0; i < len; i++) { var e = entries[i] if (e.charAt(0) === '.' && !this.dot) continue // these two cases enter the inGlobStar state var instead = gspref.concat(entries[i], remainWithoutGlobStar) this._process(instead, index, true, cb) var below = gspref.concat(entries[i], remain) this._process(below, index, true, cb) } cb() } Glob.prototype._processSimple = function (prefix, index, cb) { // XXX review this. Shouldn't it be doing the mounting etc // before doing stat? kinda weird? var self = this this._stat(prefix, function (er, exists) { self._processSimple2(prefix, index, er, exists, cb) }) } Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { //console.error('ps2', prefix, exists) if (!this.matches[index]) this.matches[index] = Object.create(null) // If it doesn't exist, then just mark the lack of results if (!exists) return cb() if (prefix && isAbsolute(prefix) && !this.nomount) { var trail = /[\/\\]$/.test(prefix) if (prefix.charAt(0) === '/') { prefix = path.join(this.root, prefix) } else { prefix = path.resolve(this.root, prefix) if (trail) prefix += '/' } } if (process.platform === 'win32') prefix = prefix.replace(/\\/g, '/') // Mark this as a match this._emitMatch(index, prefix) cb() } // Returns either 'DIR', 'FILE', or false Glob.prototype._stat = function (f, cb) { var abs = this._makeAbs(f) var needDir = f.slice(-1) === '/' if (f.length > this.maxLength) return cb() if (!this.stat && ownProp(this.cache, abs)) { var c = this.cache[abs] if (Array.isArray(c)) c = 'DIR' // It exists, but maybe not how we need it if (!needDir || c === 'DIR') return cb(null, c) if (needDir && c === 'FILE') return cb() // otherwise we have to stat, because maybe c=true // if we know it exists, but not what it is. } var exists var stat = this.statCache[abs] if (stat !== undefined) { if (stat === false) return cb(null, stat) else { var type = stat.isDirectory() ? 'DIR' : 'FILE' if (needDir && type === 'FILE') return cb() else return cb(null, type, stat) } } var self = this var statcb = inflight('stat\0' + abs, lstatcb_) if (statcb) fs.lstat(abs, statcb) function lstatcb_ (er, lstat) { if (lstat && lstat.isSymbolicLink()) { // If it's a symlink, then treat it as the target, unless // the target does not exist, then treat it as a file. return fs.stat(abs, function (er, stat) { if (er) self._stat2(f, abs, null, lstat, cb) else self._stat2(f, abs, er, stat, cb) }) } else { self._stat2(f, abs, er, lstat, cb) } } } Glob.prototype._stat2 = function (f, abs, er, stat, cb) { if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { this.statCache[abs] = false return cb() } var needDir = f.slice(-1) === '/' this.statCache[abs] = stat if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) return cb(null, false, stat) var c = true if (stat) c = stat.isDirectory() ? 'DIR' : 'FILE' this.cache[abs] = this.cache[abs] || c if (needDir && c === 'FILE') return cb() return cb(null, c, stat) } The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ## Glob Logo Glob's logo created by Tanya Brassie , licensed under a Creative Commons Attribution-ShareAlike 4.0 International License https://creativecommons.org/licenses/by-sa/4.0/ { "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "name": "glob", "description": "a little globber", "version": "7.1.7", "repository": { "type": "git", "url": "git://github.com/isaacs/node-glob.git" }, "main": "glob.js", "files": [ "glob.js", "sync.js", "common.js" ], "engines": { "node": "*" }, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, "devDependencies": { "mkdirp": "0", "rimraf": "^2.2.8", "tap": "^15.0.6", "tick": "0.0.6" }, "tap": { "before": "test/00-setup.js", "after": "test/zz-cleanup.js", "jobs": 1 }, "scripts": { "prepublish": "npm run benchclean", "profclean": "rm -f v8.log profile.txt", "test": "tap", "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js", "bench": "bash benchmark.sh", "prof": "bash prof.sh && cat profile.txt", "benchclean": "node benchclean.js" }, "license": "ISC", "funding": { "url": "https://github.com/sponsors/isaacs" } } module.exports = globSync globSync.GlobSync = GlobSync var fs = require('fs') var rp = require('fs.realpath') var minimatch = require('minimatch') var Minimatch = minimatch.Minimatch var Glob = require('./glob.js').Glob var util = require('util') var path = require('path') var assert = require('assert') var isAbsolute = require('path-is-absolute') var common = require('./common.js') var setopts = common.setopts var ownProp = common.ownProp var childrenIgnored = common.childrenIgnored var isIgnored = common.isIgnored function globSync (pattern, options) { if (typeof options === 'function' || arguments.length === 3) throw new TypeError('callback provided to sync glob\n'+ 'See: https://github.com/isaacs/node-glob/issues/167') return new GlobSync(pattern, options).found } function GlobSync (pattern, options) { if (!pattern) throw new Error('must provide pattern') if (typeof options === 'function' || arguments.length === 3) throw new TypeError('callback provided to sync glob\n'+ 'See: https://github.com/isaacs/node-glob/issues/167') if (!(this instanceof GlobSync)) return new GlobSync(pattern, options) setopts(this, pattern, options) if (this.noprocess) return this var n = this.minimatch.set.length this.matches = new Array(n) for (var i = 0; i < n; i ++) { this._process(this.minimatch.set[i], i, false) } this._finish() } GlobSync.prototype._finish = function () { assert(this instanceof GlobSync) if (this.realpath) { var self = this this.matches.forEach(function (matchset, index) { var set = self.matches[index] = Object.create(null) for (var p in matchset) { try { p = self._makeAbs(p) var real = rp.realpathSync(p, self.realpathCache) set[real] = true } catch (er) { if (er.syscall === 'stat') set[self._makeAbs(p)] = true else throw er } } }) } common.finish(this) } GlobSync.prototype._process = function (pattern, index, inGlobStar) { assert(this instanceof GlobSync) // Get the first [n] parts of pattern that are all strings. var n = 0 while (typeof pattern[n] === 'string') { n ++ } // now n is the index of the first one that is *not* a string. // See if there's anything else var prefix switch (n) { // if not, then this is rather simple case pattern.length: this._processSimple(pattern.join('/'), index) return case 0: // pattern *starts* with some non-trivial item. // going to readdir(cwd), but not include the prefix in matches. prefix = null break default: // pattern has some string bits in the front. // whatever it starts with, whether that's 'absolute' like /foo/bar, // or 'relative' like '../baz' prefix = pattern.slice(0, n).join('/') break } var remain = pattern.slice(n) // get the list of entries. var read if (prefix === null) read = '.' else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { if (!prefix || !isAbsolute(prefix)) prefix = '/' + prefix read = prefix } else read = prefix var abs = this._makeAbs(read) //if ignored, skip processing if (childrenIgnored(this, read)) return var isGlobStar = remain[0] === minimatch.GLOBSTAR if (isGlobStar) this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) else this._processReaddir(prefix, read, abs, remain, index, inGlobStar) } GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { var entries = this._readdir(abs, inGlobStar) // if the abs isn't a dir, then nothing can match! if (!entries) return // It will only match dot entries if it starts with a dot, or if // dot is set. Stuff like @(.foo|.bar) isn't allowed. var pn = remain[0] var negate = !!this.minimatch.negate var rawGlob = pn._glob var dotOk = this.dot || rawGlob.charAt(0) === '.' var matchedEntries = [] for (var i = 0; i < entries.length; i++) { var e = entries[i] if (e.charAt(0) !== '.' || dotOk) { var m if (negate && !prefix) { m = !e.match(pn) } else { m = e.match(pn) } if (m) matchedEntries.push(e) } } var len = matchedEntries.length // If there are no matched entries, then nothing matches. if (len === 0) return // if this is the last remaining pattern bit, then no need for // an additional stat *unless* the user has specified mark or // stat explicitly. We know they exist, since readdir returned // them. if (remain.length === 1 && !this.mark && !this.stat) { if (!this.matches[index]) this.matches[index] = Object.create(null) for (var i = 0; i < len; i ++) { var e = matchedEntries[i] if (prefix) { if (prefix.slice(-1) !== '/') e = prefix + '/' + e else e = prefix + e } if (e.charAt(0) === '/' && !this.nomount) { e = path.join(this.root, e) } this._emitMatch(index, e) } // This was the last one, and no stats were needed return } // now test all matched entries as stand-ins for that part // of the pattern. remain.shift() for (var i = 0; i < len; i ++) { var e = matchedEntries[i] var newPattern if (prefix) newPattern = [prefix, e] else newPattern = [e] this._process(newPattern.concat(remain), index, inGlobStar) } } GlobSync.prototype._emitMatch = function (index, e) { if (isIgnored(this, e)) return var abs = this._makeAbs(e) if (this.mark) e = this._mark(e) if (this.absolute) { e = abs } if (this.matches[index][e]) return if (this.nodir) { var c = this.cache[abs] if (c === 'DIR' || Array.isArray(c)) return } this.matches[index][e] = true if (this.stat) this._stat(e) } GlobSync.prototype._readdirInGlobStar = function (abs) { // follow all symlinked directories forever // just proceed as if this is a non-globstar situation if (this.follow) return this._readdir(abs, false) var entries var lstat var stat try { lstat = fs.lstatSync(abs) } catch (er) { if (er.code === 'ENOENT') { // lstat failed, doesn't exist return null } } var isSym = lstat && lstat.isSymbolicLink() this.symlinks[abs] = isSym // If it's not a symlink or a dir, then it's definitely a regular file. // don't bother doing a readdir in that case. if (!isSym && lstat && !lstat.isDirectory()) this.cache[abs] = 'FILE' else entries = this._readdir(abs, false) return entries } GlobSync.prototype._readdir = function (abs, inGlobStar) { var entries if (inGlobStar && !ownProp(this.symlinks, abs)) return this._readdirInGlobStar(abs) if (ownProp(this.cache, abs)) { var c = this.cache[abs] if (!c || c === 'FILE') return null if (Array.isArray(c)) return c } try { return this._readdirEntries(abs, fs.readdirSync(abs)) } catch (er) { this._readdirError(abs, er) return null } } GlobSync.prototype._readdirEntries = function (abs, entries) { // if we haven't asked to stat everything, then just // assume that everything in there exists, so we can avoid // having to stat it a second time. if (!this.mark && !this.stat) { for (var i = 0; i < entries.length; i ++) { var e = entries[i] if (abs === '/') e = abs + e else e = abs + '/' + e this.cache[e] = true } } this.cache[abs] = entries // mark and cache dir-ness return entries } GlobSync.prototype._readdirError = function (f, er) { // handle errors, and cache the information switch (er.code) { case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 case 'ENOTDIR': // totally normal. means it *does* exist. var abs = this._makeAbs(f) this.cache[abs] = 'FILE' if (abs === this.cwdAbs) { var error = new Error(er.code + ' invalid cwd ' + this.cwd) error.path = this.cwd error.code = er.code throw error } break case 'ENOENT': // not terribly unusual case 'ELOOP': case 'ENAMETOOLONG': case 'UNKNOWN': this.cache[this._makeAbs(f)] = false break default: // some unusual error. Treat as failure. this.cache[this._makeAbs(f)] = false if (this.strict) throw er if (!this.silent) console.error('glob error', er) break } } GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { var entries = this._readdir(abs, inGlobStar) // no entries means not a dir, so it can never have matches // foo.txt/** doesn't match foo.txt if (!entries) return // test without the globstar, and with every child both below // and replacing the globstar. var remainWithoutGlobStar = remain.slice(1) var gspref = prefix ? [ prefix ] : [] var noGlobStar = gspref.concat(remainWithoutGlobStar) // the noGlobStar pattern exits the inGlobStar state this._process(noGlobStar, index, false) var len = entries.length var isSym = this.symlinks[abs] // If it's a symlink, and we're in a globstar, then stop if (isSym && inGlobStar) return for (var i = 0; i < len; i++) { var e = entries[i] if (e.charAt(0) === '.' && !this.dot) continue // these two cases enter the inGlobStar state var instead = gspref.concat(entries[i], remainWithoutGlobStar) this._process(instead, index, true) var below = gspref.concat(entries[i], remain) this._process(below, index, true) } } GlobSync.prototype._processSimple = function (prefix, index) { // XXX review this. Shouldn't it be doing the mounting etc // before doing stat? kinda weird? var exists = this._stat(prefix) if (!this.matches[index]) this.matches[index] = Object.create(null) // If it doesn't exist, then just mark the lack of results if (!exists) return if (prefix && isAbsolute(prefix) && !this.nomount) { var trail = /[\/\\]$/.test(prefix) if (prefix.charAt(0) === '/') { prefix = path.join(this.root, prefix) } else { prefix = path.resolve(this.root, prefix) if (trail) prefix += '/' } } if (process.platform === 'win32') prefix = prefix.replace(/\\/g, '/') // Mark this as a match this._emitMatch(index, prefix) } // Returns either 'DIR', 'FILE', or false GlobSync.prototype._stat = function (f) { var abs = this._makeAbs(f) var needDir = f.slice(-1) === '/' if (f.length > this.maxLength) return false if (!this.stat && ownProp(this.cache, abs)) { var c = this.cache[abs] if (Array.isArray(c)) c = 'DIR' // It exists, but maybe not how we need it if (!needDir || c === 'DIR') return c if (needDir && c === 'FILE') return false // otherwise we have to stat, because maybe c=true // if we know it exists, but not what it is. } var exists var stat = this.statCache[abs] if (!stat) { var lstat try { lstat = fs.lstatSync(abs) } catch (er) { if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { this.statCache[abs] = false return false } } if (lstat && lstat.isSymbolicLink()) { try { stat = fs.statSync(abs) } catch (er) { stat = lstat } } else { stat = lstat } } this.statCache[abs] = stat var c = true if (stat) c = stat.isDirectory() ? 'DIR' : 'FILE' this.cache[abs] = this.cache[abs] || c if (needDir && c === 'FILE') return false return c } GlobSync.prototype._mark = function (p) { return common.mark(this, p) } GlobSync.prototype._makeAbs = function (f) { return common.makeAbs(this, f) } { "name": "agent-base", "version": "6.0.2", "description": "Turn a function into an `http.Agent` instance", "main": "dist/src/index", "typings": "dist/src/index", "files": [ "dist/src", "src" ], "scripts": { "prebuild": "rimraf dist", "build": "tsc", "postbuild": "cpy --parents src test '!**/*.ts' dist", "test": "mocha --reporter spec dist/test/*.js", "test-lint": "eslint src --ext .js,.ts", "prepublishOnly": "npm run build" }, "repository": { "type": "git", "url": "git://github.com/TooTallNate/node-agent-base.git" }, "keywords": [ "http", "agent", "base", "barebones", "https" ], "author": "Nathan Rajlich (http://n8.io/)", "license": "MIT", "bugs": { "url": "https://github.com/TooTallNate/node-agent-base/issues" }, "dependencies": { "debug": "4" }, "devDependencies": { "@types/debug": "4", "@types/mocha": "^5.2.7", "@types/node": "^14.0.20", "@types/semver": "^7.1.0", "@types/ws": "^6.0.3", "@typescript-eslint/eslint-plugin": "1.6.0", "@typescript-eslint/parser": "1.1.0", "async-listen": "^1.2.0", "cpy-cli": "^2.0.0", "eslint": "5.16.0", "eslint-config-airbnb": "17.1.0", "eslint-config-prettier": "4.1.0", "eslint-import-resolver-typescript": "1.1.1", "eslint-plugin-import": "2.16.0", "eslint-plugin-jsx-a11y": "6.2.1", "eslint-plugin-react": "7.12.4", "mocha": "^6.2.0", "rimraf": "^3.0.0", "semver": "^7.1.2", "typescript": "^3.5.3", "ws": "^3.0.0" }, "engines": { "node": ">= 6.0.0" } } (The MIT License) Copyright (c) 2014-2017 TJ Holowaychuk Copyright (c) 2018-2021 Josh Junon Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "debug", "version": "4.3.4", "repository": { "type": "git", "url": "git://github.com/debug-js/debug.git" }, "description": "Lightweight debugging utility for Node.js and the browser", "keywords": [ "debug", "log", "debugger" ], "files": [ "src", "LICENSE", "README.md" ], "author": "Josh Junon ", "contributors": [ "TJ Holowaychuk ", "Nathan Rajlich (http://n8.io)", "Andrew Rhyne " ], "license": "MIT", "scripts": { "lint": "xo", "test": "npm run test:node && npm run test:browser && npm run lint", "test:node": "istanbul cover _mocha -- test.js", "test:browser": "karma start --single-run", "test:coverage": "cat ./coverage/lcov.info | coveralls" }, "dependencies": { "ms": "2.1.2" }, "devDependencies": { "brfs": "^2.0.1", "browserify": "^16.2.3", "coveralls": "^3.0.2", "istanbul": "^0.4.5", "karma": "^3.1.4", "karma-browserify": "^6.0.0", "karma-chrome-launcher": "^2.2.0", "karma-mocha": "^1.3.0", "mocha": "^5.2.0", "mocha-lcov-reporter": "^1.2.0", "xo": "^0.23.0" }, "peerDependenciesMeta": { "supports-color": { "optional": true } }, "main": "./src/index.js", "browser": "./src/browser.js", "engines": { "node": ">=6.0" } } "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.SocksClientError = exports.SocksClient = void 0; const events_1 = require("events"); const net = require("net"); const ip = require("ip"); const smart_buffer_1 = require("smart-buffer"); const constants_1 = require("../common/constants"); const helpers_1 = require("../common/helpers"); const receivebuffer_1 = require("../common/receivebuffer"); const util_1 = require("../common/util"); Object.defineProperty(exports, "SocksClientError", { enumerable: true, get: function () { return util_1.SocksClientError; } }); class SocksClient extends events_1.EventEmitter { constructor(options) { super(); this.options = Object.assign({}, options); // Validate SocksClientOptions (0, helpers_1.validateSocksClientOptions)(options); // Default state this.setState(constants_1.SocksClientState.Created); } /** * Creates a new SOCKS connection. * * Note: Supports callbacks and promises. Only supports the connect command. * @param options { SocksClientOptions } Options. * @param callback { Function } An optional callback function. * @returns { Promise } */ static createConnection(options, callback) { return new Promise((resolve, reject) => { // Validate SocksClientOptions try { (0, helpers_1.validateSocksClientOptions)(options, ['connect']); } catch (err) { if (typeof callback === 'function') { callback(err); // eslint-disable-next-line @typescript-eslint/no-explicit-any return resolve(err); // Resolves pending promise (prevents memory leaks). } else { return reject(err); } } const client = new SocksClient(options); client.connect(options.existing_socket); client.once('established', (info) => { client.removeAllListeners(); if (typeof callback === 'function') { callback(null, info); resolve(info); // Resolves pending promise (prevents memory leaks). } else { resolve(info); } }); // Error occurred, failed to establish connection. client.once('error', (err) => { client.removeAllListeners(); if (typeof callback === 'function') { callback(err); // eslint-disable-next-line @typescript-eslint/no-explicit-any resolve(err); // Resolves pending promise (prevents memory leaks). } else { reject(err); } }); }); } /** * Creates a new SOCKS connection chain to a destination host through 2 or more SOCKS proxies. * * Note: Supports callbacks and promises. Only supports the connect method. * Note: Implemented via createConnection() factory function. * @param options { SocksClientChainOptions } Options * @param callback { Function } An optional callback function. * @returns { Promise } */ static createConnectionChain(options, callback) { // eslint-disable-next-line no-async-promise-executor return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { // Validate SocksClientChainOptions try { (0, helpers_1.validateSocksClientChainOptions)(options); } catch (err) { if (typeof callback === 'function') { callback(err); // eslint-disable-next-line @typescript-eslint/no-explicit-any return resolve(err); // Resolves pending promise (prevents memory leaks). } else { return reject(err); } } let sock; // Shuffle proxies if (options.randomizeChain) { (0, util_1.shuffleArray)(options.proxies); } try { for (let i = 0; i < options.proxies.length; i++) { const nextProxy = options.proxies[i]; // If we've reached the last proxy in the chain, the destination is the actual destination, otherwise it's the next proxy. const nextDestination = i === options.proxies.length - 1 ? options.destination : { host: options.proxies[i + 1].host || options.proxies[i + 1].ipaddress, port: options.proxies[i + 1].port, }; // Creates the next connection in the chain. const result = yield SocksClient.createConnection({ command: 'connect', proxy: nextProxy, destination: nextDestination, // Initial connection ignores this as sock is undefined. Subsequent connections re-use the first proxy socket to form a chain. }); // If sock is undefined, assign it here. if (!sock) { sock = result.socket; } } if (typeof callback === 'function') { callback(null, { socket: sock }); resolve({ socket: sock }); // Resolves pending promise (prevents memory leaks). } else { resolve({ socket: sock }); } } catch (err) { if (typeof callback === 'function') { callback(err); // eslint-disable-next-line @typescript-eslint/no-explicit-any resolve(err); // Resolves pending promise (prevents memory leaks). } else { reject(err); } } })); } /** * Creates a SOCKS UDP Frame. * @param options */ static createUDPFrame(options) { const buff = new smart_buffer_1.SmartBuffer(); buff.writeUInt16BE(0); buff.writeUInt8(options.frameNumber || 0); // IPv4/IPv6/Hostname if (net.isIPv4(options.remoteHost.host)) { buff.writeUInt8(constants_1.Socks5HostType.IPv4); buff.writeUInt32BE(ip.toLong(options.remoteHost.host)); } else if (net.isIPv6(options.remoteHost.host)) { buff.writeUInt8(constants_1.Socks5HostType.IPv6); buff.writeBuffer(ip.toBuffer(options.remoteHost.host)); } else { buff.writeUInt8(constants_1.Socks5HostType.Hostname); buff.writeUInt8(Buffer.byteLength(options.remoteHost.host)); buff.writeString(options.remoteHost.host); } // Port buff.writeUInt16BE(options.remoteHost.port); // Data buff.writeBuffer(options.data); return buff.toBuffer(); } /** * Parses a SOCKS UDP frame. * @param data */ static parseUDPFrame(data) { const buff = smart_buffer_1.SmartBuffer.fromBuffer(data); buff.readOffset = 2; const frameNumber = buff.readUInt8(); const hostType = buff.readUInt8(); let remoteHost; if (hostType === constants_1.Socks5HostType.IPv4) { remoteHost = ip.fromLong(buff.readUInt32BE()); } else if (hostType === constants_1.Socks5HostType.IPv6) { remoteHost = ip.toString(buff.readBuffer(16)); } else { remoteHost = buff.readString(buff.readUInt8()); } const remotePort = buff.readUInt16BE(); return { frameNumber, remoteHost: { host: remoteHost, port: remotePort, }, data: buff.readBuffer(), }; } /** * Internal state setter. If the SocksClient is in an error state, it cannot be changed to a non error state. */ setState(newState) { if (this.state !== constants_1.SocksClientState.Error) { this.state = newState; } } /** * Starts the connection establishment to the proxy and destination. * @param existingSocket Connected socket to use instead of creating a new one (internal use). */ connect(existingSocket) { this.onDataReceived = (data) => this.onDataReceivedHandler(data); this.onClose = () => this.onCloseHandler(); this.onError = (err) => this.onErrorHandler(err); this.onConnect = () => this.onConnectHandler(); // Start timeout timer (defaults to 30 seconds) const timer = setTimeout(() => this.onEstablishedTimeout(), this.options.timeout || constants_1.DEFAULT_TIMEOUT); // check whether unref is available as it differs from browser to NodeJS (#33) if (timer.unref && typeof timer.unref === 'function') { timer.unref(); } // If an existing socket is provided, use it to negotiate SOCKS handshake. Otherwise create a new Socket. if (existingSocket) { this.socket = existingSocket; } else { this.socket = new net.Socket(); } // Attach Socket error handlers. this.socket.once('close', this.onClose); this.socket.once('error', this.onError); this.socket.once('connect', this.onConnect); this.socket.on('data', this.onDataReceived); this.setState(constants_1.SocksClientState.Connecting); this.receiveBuffer = new receivebuffer_1.ReceiveBuffer(); if (existingSocket) { this.socket.emit('connect'); } else { this.socket.connect(this.getSocketOptions()); if (this.options.set_tcp_nodelay !== undefined && this.options.set_tcp_nodelay !== null) { this.socket.setNoDelay(!!this.options.set_tcp_nodelay); } } // Listen for established event so we can re-emit any excess data received during handshakes. this.prependOnceListener('established', (info) => { setImmediate(() => { if (this.receiveBuffer.length > 0) { const excessData = this.receiveBuffer.get(this.receiveBuffer.length); info.socket.emit('data', excessData); } info.socket.resume(); }); }); } // Socket options (defaults host/port to options.proxy.host/options.proxy.port) getSocketOptions() { return Object.assign(Object.assign({}, this.options.socket_options), { host: this.options.proxy.host || this.options.proxy.ipaddress, port: this.options.proxy.port }); } /** * Handles internal Socks timeout callback. * Note: If the Socks client is not BoundWaitingForConnection or Established, the connection will be closed. */ onEstablishedTimeout() { if (this.state !== constants_1.SocksClientState.Established && this.state !== constants_1.SocksClientState.BoundWaitingForConnection) { this.closeSocket(constants_1.ERRORS.ProxyConnectionTimedOut); } } /** * Handles Socket connect event. */ onConnectHandler() { this.setState(constants_1.SocksClientState.Connected); // Send initial handshake. if (this.options.proxy.type === 4) { this.sendSocks4InitialHandshake(); } else { this.sendSocks5InitialHandshake(); } this.setState(constants_1.SocksClientState.SentInitialHandshake); } /** * Handles Socket data event. * @param data */ onDataReceivedHandler(data) { /* All received data is appended to a ReceiveBuffer. This makes sure that all the data we need is received before we attempt to process it. */ this.receiveBuffer.append(data); // Process data that we have. this.processData(); } /** * Handles processing of the data we have received. */ processData() { // If we have enough data to process the next step in the SOCKS handshake, proceed. while (this.state !== constants_1.SocksClientState.Established && this.state !== constants_1.SocksClientState.Error && this.receiveBuffer.length >= this.nextRequiredPacketBufferSize) { // Sent initial handshake, waiting for response. if (this.state === constants_1.SocksClientState.SentInitialHandshake) { if (this.options.proxy.type === 4) { // Socks v4 only has one handshake response. this.handleSocks4FinalHandshakeResponse(); } else { // Socks v5 has two handshakes, handle initial one here. this.handleInitialSocks5HandshakeResponse(); } // Sent auth request for Socks v5, waiting for response. } else if (this.state === constants_1.SocksClientState.SentAuthentication) { this.handleInitialSocks5AuthenticationHandshakeResponse(); // Sent final Socks v5 handshake, waiting for final response. } else if (this.state === constants_1.SocksClientState.SentFinalHandshake) { this.handleSocks5FinalHandshakeResponse(); // Socks BIND established. Waiting for remote connection via proxy. } else if (this.state === constants_1.SocksClientState.BoundWaitingForConnection) { if (this.options.proxy.type === 4) { this.handleSocks4IncomingConnectionResponse(); } else { this.handleSocks5IncomingConnectionResponse(); } } else { this.closeSocket(constants_1.ERRORS.InternalError); break; } } } /** * Handles Socket close event. * @param had_error */ onCloseHandler() { this.closeSocket(constants_1.ERRORS.SocketClosed); } /** * Handles Socket error event. * @param err */ onErrorHandler(err) { this.closeSocket(err.message); } /** * Removes internal event listeners on the underlying Socket. */ removeInternalSocketHandlers() { // Pauses data flow of the socket (this is internally resumed after 'established' is emitted) this.socket.pause(); this.socket.removeListener('data', this.onDataReceived); this.socket.removeListener('close', this.onClose); this.socket.removeListener('error', this.onError); this.socket.removeListener('connect', this.onConnect); } /** * Closes and destroys the underlying Socket. Emits an error event. * @param err { String } An error string to include in error event. */ closeSocket(err) { // Make sure only one 'error' event is fired for the lifetime of this SocksClient instance. if (this.state !== constants_1.SocksClientState.Error) { // Set internal state to Error. this.setState(constants_1.SocksClientState.Error); // Destroy Socket this.socket.destroy(); // Remove internal listeners this.removeInternalSocketHandlers(); // Fire 'error' event. this.emit('error', new util_1.SocksClientError(err, this.options)); } } /** * Sends initial Socks v4 handshake request. */ sendSocks4InitialHandshake() { const userId = this.options.proxy.userId || ''; const buff = new smart_buffer_1.SmartBuffer(); buff.writeUInt8(0x04); buff.writeUInt8(constants_1.SocksCommand[this.options.command]); buff.writeUInt16BE(this.options.destination.port); // Socks 4 (IPv4) if (net.isIPv4(this.options.destination.host)) { buff.writeBuffer(ip.toBuffer(this.options.destination.host)); buff.writeStringNT(userId); // Socks 4a (hostname) } else { buff.writeUInt8(0x00); buff.writeUInt8(0x00); buff.writeUInt8(0x00); buff.writeUInt8(0x01); buff.writeStringNT(userId); buff.writeStringNT(this.options.destination.host); } this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks4Response; this.socket.write(buff.toBuffer()); } /** * Handles Socks v4 handshake response. * @param data */ handleSocks4FinalHandshakeResponse() { const data = this.receiveBuffer.get(8); if (data[1] !== constants_1.Socks4Response.Granted) { this.closeSocket(`${constants_1.ERRORS.Socks4ProxyRejectedConnection} - (${constants_1.Socks4Response[data[1]]})`); } else { // Bind response if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.bind) { const buff = smart_buffer_1.SmartBuffer.fromBuffer(data); buff.readOffset = 2; const remoteHost = { port: buff.readUInt16BE(), host: ip.fromLong(buff.readUInt32BE()), }; // If host is 0.0.0.0, set to proxy host. if (remoteHost.host === '0.0.0.0') { remoteHost.host = this.options.proxy.ipaddress; } this.setState(constants_1.SocksClientState.BoundWaitingForConnection); this.emit('bound', { remoteHost, socket: this.socket }); // Connect response } else { this.setState(constants_1.SocksClientState.Established); this.removeInternalSocketHandlers(); this.emit('established', { socket: this.socket }); } } } /** * Handles Socks v4 incoming connection request (BIND) * @param data */ handleSocks4IncomingConnectionResponse() { const data = this.receiveBuffer.get(8); if (data[1] !== constants_1.Socks4Response.Granted) { this.closeSocket(`${constants_1.ERRORS.Socks4ProxyRejectedIncomingBoundConnection} - (${constants_1.Socks4Response[data[1]]})`); } else { const buff = smart_buffer_1.SmartBuffer.fromBuffer(data); buff.readOffset = 2; const remoteHost = { port: buff.readUInt16BE(), host: ip.fromLong(buff.readUInt32BE()), }; this.setState(constants_1.SocksClientState.Established); this.removeInternalSocketHandlers(); this.emit('established', { remoteHost, socket: this.socket }); } } /** * Sends initial Socks v5 handshake request. */ sendSocks5InitialHandshake() { const buff = new smart_buffer_1.SmartBuffer(); // By default we always support no auth. const supportedAuthMethods = [constants_1.Socks5Auth.NoAuth]; // We should only tell the proxy we support user/pass auth if auth info is actually provided. // Note: As of Tor v0.3.5.7+, if user/pass auth is an option from the client, by default it will always take priority. if (this.options.proxy.userId || this.options.proxy.password) { supportedAuthMethods.push(constants_1.Socks5Auth.UserPass); } // Custom auth method? if (this.options.proxy.custom_auth_method !== undefined) { supportedAuthMethods.push(this.options.proxy.custom_auth_method); } // Build handshake packet buff.writeUInt8(0x05); buff.writeUInt8(supportedAuthMethods.length); for (const authMethod of supportedAuthMethods) { buff.writeUInt8(authMethod); } this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5InitialHandshakeResponse; this.socket.write(buff.toBuffer()); this.setState(constants_1.SocksClientState.SentInitialHandshake); } /** * Handles initial Socks v5 handshake response. * @param data */ handleInitialSocks5HandshakeResponse() { const data = this.receiveBuffer.get(2); if (data[0] !== 0x05) { this.closeSocket(constants_1.ERRORS.InvalidSocks5IntiailHandshakeSocksVersion); } else if (data[1] === constants_1.SOCKS5_NO_ACCEPTABLE_AUTH) { this.closeSocket(constants_1.ERRORS.InvalidSocks5InitialHandshakeNoAcceptedAuthType); } else { // If selected Socks v5 auth method is no auth, send final handshake request. if (data[1] === constants_1.Socks5Auth.NoAuth) { this.socks5ChosenAuthType = constants_1.Socks5Auth.NoAuth; this.sendSocks5CommandRequest(); // If selected Socks v5 auth method is user/password, send auth handshake. } else if (data[1] === constants_1.Socks5Auth.UserPass) { this.socks5ChosenAuthType = constants_1.Socks5Auth.UserPass; this.sendSocks5UserPassAuthentication(); // If selected Socks v5 auth method is the custom_auth_method, send custom handshake. } else if (data[1] === this.options.proxy.custom_auth_method) { this.socks5ChosenAuthType = this.options.proxy.custom_auth_method; this.sendSocks5CustomAuthentication(); } else { this.closeSocket(constants_1.ERRORS.InvalidSocks5InitialHandshakeUnknownAuthType); } } } /** * Sends Socks v5 user & password auth handshake. * * Note: No auth and user/pass are currently supported. */ sendSocks5UserPassAuthentication() { const userId = this.options.proxy.userId || ''; const password = this.options.proxy.password || ''; const buff = new smart_buffer_1.SmartBuffer(); buff.writeUInt8(0x01); buff.writeUInt8(Buffer.byteLength(userId)); buff.writeString(userId); buff.writeUInt8(Buffer.byteLength(password)); buff.writeString(password); this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5UserPassAuthenticationResponse; this.socket.write(buff.toBuffer()); this.setState(constants_1.SocksClientState.SentAuthentication); } sendSocks5CustomAuthentication() { return __awaiter(this, void 0, void 0, function* () { this.nextRequiredPacketBufferSize = this.options.proxy.custom_auth_response_size; this.socket.write(yield this.options.proxy.custom_auth_request_handler()); this.setState(constants_1.SocksClientState.SentAuthentication); }); } handleSocks5CustomAuthHandshakeResponse(data) { return __awaiter(this, void 0, void 0, function* () { return yield this.options.proxy.custom_auth_response_handler(data); }); } handleSocks5AuthenticationNoAuthHandshakeResponse(data) { return __awaiter(this, void 0, void 0, function* () { return data[1] === 0x00; }); } handleSocks5AuthenticationUserPassHandshakeResponse(data) { return __awaiter(this, void 0, void 0, function* () { return data[1] === 0x00; }); } /** * Handles Socks v5 auth handshake response. * @param data */ handleInitialSocks5AuthenticationHandshakeResponse() { return __awaiter(this, void 0, void 0, function* () { this.setState(constants_1.SocksClientState.ReceivedAuthenticationResponse); let authResult = false; if (this.socks5ChosenAuthType === constants_1.Socks5Auth.NoAuth) { authResult = yield this.handleSocks5AuthenticationNoAuthHandshakeResponse(this.receiveBuffer.get(2)); } else if (this.socks5ChosenAuthType === constants_1.Socks5Auth.UserPass) { authResult = yield this.handleSocks5AuthenticationUserPassHandshakeResponse(this.receiveBuffer.get(2)); } else if (this.socks5ChosenAuthType === this.options.proxy.custom_auth_method) { authResult = yield this.handleSocks5CustomAuthHandshakeResponse(this.receiveBuffer.get(this.options.proxy.custom_auth_response_size)); } if (!authResult) { this.closeSocket(constants_1.ERRORS.Socks5AuthenticationFailed); } else { this.sendSocks5CommandRequest(); } }); } /** * Sends Socks v5 final handshake request. */ sendSocks5CommandRequest() { const buff = new smart_buffer_1.SmartBuffer(); buff.writeUInt8(0x05); buff.writeUInt8(constants_1.SocksCommand[this.options.command]); buff.writeUInt8(0x00); // ipv4, ipv6, domain? if (net.isIPv4(this.options.destination.host)) { buff.writeUInt8(constants_1.Socks5HostType.IPv4); buff.writeBuffer(ip.toBuffer(this.options.destination.host)); } else if (net.isIPv6(this.options.destination.host)) { buff.writeUInt8(constants_1.Socks5HostType.IPv6); buff.writeBuffer(ip.toBuffer(this.options.destination.host)); } else { buff.writeUInt8(constants_1.Socks5HostType.Hostname); buff.writeUInt8(this.options.destination.host.length); buff.writeString(this.options.destination.host); } buff.writeUInt16BE(this.options.destination.port); this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader; this.socket.write(buff.toBuffer()); this.setState(constants_1.SocksClientState.SentFinalHandshake); } /** * Handles Socks v5 final handshake response. * @param data */ handleSocks5FinalHandshakeResponse() { // Peek at available data (we need at least 5 bytes to get the hostname length) const header = this.receiveBuffer.peek(5); if (header[0] !== 0x05 || header[1] !== constants_1.Socks5Response.Granted) { this.closeSocket(`${constants_1.ERRORS.InvalidSocks5FinalHandshakeRejected} - ${constants_1.Socks5Response[header[1]]}`); } else { // Read address type const addressType = header[3]; let remoteHost; let buff; // IPv4 if (addressType === constants_1.Socks5HostType.IPv4) { // Check if data is available. const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4; if (this.receiveBuffer.length < dataNeeded) { this.nextRequiredPacketBufferSize = dataNeeded; return; } buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4)); remoteHost = { host: ip.fromLong(buff.readUInt32BE()), port: buff.readUInt16BE(), }; // If given host is 0.0.0.0, assume remote proxy ip instead. if (remoteHost.host === '0.0.0.0') { remoteHost.host = this.options.proxy.ipaddress; } // Hostname } else if (addressType === constants_1.Socks5HostType.Hostname) { const hostLength = header[4]; const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(hostLength); // header + host length + host + port // Check if data is available. if (this.receiveBuffer.length < dataNeeded) { this.nextRequiredPacketBufferSize = dataNeeded; return; } buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(5)); remoteHost = { host: buff.readString(hostLength), port: buff.readUInt16BE(), }; // IPv6 } else if (addressType === constants_1.Socks5HostType.IPv6) { // Check if data is available. const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6; if (this.receiveBuffer.length < dataNeeded) { this.nextRequiredPacketBufferSize = dataNeeded; return; } buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4)); remoteHost = { host: ip.toString(buff.readBuffer(16)), port: buff.readUInt16BE(), }; } // We have everything we need this.setState(constants_1.SocksClientState.ReceivedFinalResponse); // If using CONNECT, the client is now in the established state. if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.connect) { this.setState(constants_1.SocksClientState.Established); this.removeInternalSocketHandlers(); this.emit('established', { remoteHost, socket: this.socket }); } else if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.bind) { /* If using BIND, the Socks client is now in BoundWaitingForConnection state. This means that the remote proxy server is waiting for a remote connection to the bound port. */ this.setState(constants_1.SocksClientState.BoundWaitingForConnection); this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader; this.emit('bound', { remoteHost, socket: this.socket }); /* If using Associate, the Socks client is now Established. And the proxy server is now accepting UDP packets at the given bound port. This initial Socks TCP connection must remain open for the UDP relay to continue to work. */ } else if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.associate) { this.setState(constants_1.SocksClientState.Established); this.removeInternalSocketHandlers(); this.emit('established', { remoteHost, socket: this.socket, }); } } } /** * Handles Socks v5 incoming connection request (BIND). */ handleSocks5IncomingConnectionResponse() { // Peek at available data (we need at least 5 bytes to get the hostname length) const header = this.receiveBuffer.peek(5); if (header[0] !== 0x05 || header[1] !== constants_1.Socks5Response.Granted) { this.closeSocket(`${constants_1.ERRORS.Socks5ProxyRejectedIncomingBoundConnection} - ${constants_1.Socks5Response[header[1]]}`); } else { // Read address type const addressType = header[3]; let remoteHost; let buff; // IPv4 if (addressType === constants_1.Socks5HostType.IPv4) { // Check if data is available. const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4; if (this.receiveBuffer.length < dataNeeded) { this.nextRequiredPacketBufferSize = dataNeeded; return; } buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4)); remoteHost = { host: ip.fromLong(buff.readUInt32BE()), port: buff.readUInt16BE(), }; // If given host is 0.0.0.0, assume remote proxy ip instead. if (remoteHost.host === '0.0.0.0') { remoteHost.host = this.options.proxy.ipaddress; } // Hostname } else if (addressType === constants_1.Socks5HostType.Hostname) { const hostLength = header[4]; const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(hostLength); // header + host length + port // Check if data is available. if (this.receiveBuffer.length < dataNeeded) { this.nextRequiredPacketBufferSize = dataNeeded; return; } buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(5)); remoteHost = { host: buff.readString(hostLength), port: buff.readUInt16BE(), }; // IPv6 } else if (addressType === constants_1.Socks5HostType.IPv6) { // Check if data is available. const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6; if (this.receiveBuffer.length < dataNeeded) { this.nextRequiredPacketBufferSize = dataNeeded; return; } buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4)); remoteHost = { host: ip.toString(buff.readBuffer(16)), port: buff.readUInt16BE(), }; } this.setState(constants_1.SocksClientState.Established); this.removeInternalSocketHandlers(); this.emit('established', { remoteHost, socket: this.socket }); } } get socksClientOptions() { return Object.assign({}, this.options); } } exports.SocksClient = SocksClient;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/make-fetch-happen/node_modules/socks/build/client/socksclient.js.map"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SOCKS5_NO_ACCEPTABLE_AUTH = exports.SOCKS5_CUSTOM_AUTH_END = exports.SOCKS5_CUSTOM_AUTH_START = exports.SOCKS_INCOMING_PACKET_SIZES = exports.SocksClientState = exports.Socks5Response = exports.Socks5HostType = exports.Socks5Auth = exports.Socks4Response = exports.SocksCommand = exports.ERRORS = exports.DEFAULT_TIMEOUT = void 0; const DEFAULT_TIMEOUT = 30000; exports.DEFAULT_TIMEOUT = DEFAULT_TIMEOUT; // prettier-ignore const ERRORS = { InvalidSocksCommand: 'An invalid SOCKS command was provided. Valid options are connect, bind, and associate.', InvalidSocksCommandForOperation: 'An invalid SOCKS command was provided. Only a subset of commands are supported for this operation.', InvalidSocksCommandChain: 'An invalid SOCKS command was provided. Chaining currently only supports the connect command.', InvalidSocksClientOptionsDestination: 'An invalid destination host was provided.', InvalidSocksClientOptionsExistingSocket: 'An invalid existing socket was provided. This should be an instance of stream.Duplex.', InvalidSocksClientOptionsProxy: 'Invalid SOCKS proxy details were provided.', InvalidSocksClientOptionsTimeout: 'An invalid timeout value was provided. Please enter a value above 0 (in ms).', InvalidSocksClientOptionsProxiesLength: 'At least two socks proxies must be provided for chaining.', InvalidSocksClientOptionsCustomAuthRange: 'Custom auth must be a value between 0x80 and 0xFE.', InvalidSocksClientOptionsCustomAuthOptions: 'When a custom_auth_method is provided, custom_auth_request_handler, custom_auth_response_size, and custom_auth_response_handler must also be provided and valid.', NegotiationError: 'Negotiation error', SocketClosed: 'Socket closed', ProxyConnectionTimedOut: 'Proxy connection timed out', InternalError: 'SocksClient internal error (this should not happen)', InvalidSocks4HandshakeResponse: 'Received invalid Socks4 handshake response', Socks4ProxyRejectedConnection: 'Socks4 Proxy rejected connection', InvalidSocks4IncomingConnectionResponse: 'Socks4 invalid incoming connection response', Socks4ProxyRejectedIncomingBoundConnection: 'Socks4 Proxy rejected incoming bound connection', InvalidSocks5InitialHandshakeResponse: 'Received invalid Socks5 initial handshake response', InvalidSocks5IntiailHandshakeSocksVersion: 'Received invalid Socks5 initial handshake (invalid socks version)', InvalidSocks5InitialHandshakeNoAcceptedAuthType: 'Received invalid Socks5 initial handshake (no accepted authentication type)', InvalidSocks5InitialHandshakeUnknownAuthType: 'Received invalid Socks5 initial handshake (unknown authentication type)', Socks5AuthenticationFailed: 'Socks5 Authentication failed', InvalidSocks5FinalHandshake: 'Received invalid Socks5 final handshake response', InvalidSocks5FinalHandshakeRejected: 'Socks5 proxy rejected connection', InvalidSocks5IncomingConnectionResponse: 'Received invalid Socks5 incoming connection response', Socks5ProxyRejectedIncomingBoundConnection: 'Socks5 Proxy rejected incoming bound connection', }; exports.ERRORS = ERRORS; const SOCKS_INCOMING_PACKET_SIZES = { Socks5InitialHandshakeResponse: 2, Socks5UserPassAuthenticationResponse: 2, // Command response + incoming connection (bind) Socks5ResponseHeader: 5, Socks5ResponseIPv4: 10, Socks5ResponseIPv6: 22, Socks5ResponseHostname: (hostNameLength) => hostNameLength + 7, // Command response + incoming connection (bind) Socks4Response: 8, // 2 header + 2 port + 4 ip }; exports.SOCKS_INCOMING_PACKET_SIZES = SOCKS_INCOMING_PACKET_SIZES; var SocksCommand; (function (SocksCommand) { SocksCommand[SocksCommand["connect"] = 1] = "connect"; SocksCommand[SocksCommand["bind"] = 2] = "bind"; SocksCommand[SocksCommand["associate"] = 3] = "associate"; })(SocksCommand || (SocksCommand = {})); exports.SocksCommand = SocksCommand; var Socks4Response; (function (Socks4Response) { Socks4Response[Socks4Response["Granted"] = 90] = "Granted"; Socks4Response[Socks4Response["Failed"] = 91] = "Failed"; Socks4Response[Socks4Response["Rejected"] = 92] = "Rejected"; Socks4Response[Socks4Response["RejectedIdent"] = 93] = "RejectedIdent"; })(Socks4Response || (Socks4Response = {})); exports.Socks4Response = Socks4Response; var Socks5Auth; (function (Socks5Auth) { Socks5Auth[Socks5Auth["NoAuth"] = 0] = "NoAuth"; Socks5Auth[Socks5Auth["GSSApi"] = 1] = "GSSApi"; Socks5Auth[Socks5Auth["UserPass"] = 2] = "UserPass"; })(Socks5Auth || (Socks5Auth = {})); exports.Socks5Auth = Socks5Auth; const SOCKS5_CUSTOM_AUTH_START = 0x80; exports.SOCKS5_CUSTOM_AUTH_START = SOCKS5_CUSTOM_AUTH_START; const SOCKS5_CUSTOM_AUTH_END = 0xfe; exports.SOCKS5_CUSTOM_AUTH_END = SOCKS5_CUSTOM_AUTH_END; const SOCKS5_NO_ACCEPTABLE_AUTH = 0xff; exports.SOCKS5_NO_ACCEPTABLE_AUTH = SOCKS5_NO_ACCEPTABLE_AUTH; var Socks5Response; (function (Socks5Response) { Socks5Response[Socks5Response["Granted"] = 0] = "Granted"; Socks5Response[Socks5Response["Failure"] = 1] = "Failure"; Socks5Response[Socks5Response["NotAllowed"] = 2] = "NotAllowed"; Socks5Response[Socks5Response["NetworkUnreachable"] = 3] = "NetworkUnreachable"; Socks5Response[Socks5Response["HostUnreachable"] = 4] = "HostUnreachable"; Socks5Response[Socks5Response["ConnectionRefused"] = 5] = "ConnectionRefused"; Socks5Response[Socks5Response["TTLExpired"] = 6] = "TTLExpired"; Socks5Response[Socks5Response["CommandNotSupported"] = 7] = "CommandNotSupported"; Socks5Response[Socks5Response["AddressNotSupported"] = 8] = "AddressNotSupported"; })(Socks5Response || (Socks5Response = {})); exports.Socks5Response = Socks5Response; var Socks5HostType; (function (Socks5HostType) { Socks5HostType[Socks5HostType["IPv4"] = 1] = "IPv4"; Socks5HostType[Socks5HostType["Hostname"] = 3] = "Hostname"; Socks5HostType[Socks5HostType["IPv6"] = 4] = "IPv6"; })(Socks5HostType || (Socks5HostType = {})); exports.Socks5HostType = Socks5HostType; var SocksClientState; (function (SocksClientState) { SocksClientState[SocksClientState["Created"] = 0] = "Created"; SocksClientState[SocksClientState["Connecting"] = 1] = "Connecting"; SocksClientState[SocksClientState["Connected"] = 2] = "Connected"; SocksClientState[SocksClientState["SentInitialHandshake"] = 3] = "SentInitialHandshake"; SocksClientState[SocksClientState["ReceivedInitialHandshakeResponse"] = 4] = "ReceivedInitialHandshakeResponse"; SocksClientState[SocksClientState["SentAuthentication"] = 5] = "SentAuthentication"; SocksClientState[SocksClientState["ReceivedAuthenticationResponse"] = 6] = "ReceivedAuthenticationResponse"; SocksClientState[SocksClientState["SentFinalHandshake"] = 7] = "SentFinalHandshake"; SocksClientState[SocksClientState["ReceivedFinalResponse"] = 8] = "ReceivedFinalResponse"; SocksClientState[SocksClientState["BoundWaitingForConnection"] = 9] = "BoundWaitingForConnection"; SocksClientState[SocksClientState["Established"] = 10] = "Established"; SocksClientState[SocksClientState["Disconnected"] = 11] = "Disconnected"; SocksClientState[SocksClientState["Error"] = 99] = "Error"; })(SocksClientState || (SocksClientState = {})); exports.SocksClientState = SocksClientState;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/make-fetch-happen/node_modules/socks/build/common/constants.js.map"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.validateSocksClientChainOptions = exports.validateSocksClientOptions = void 0; const util_1 = require("./util"); const constants_1 = require("./constants"); const stream = require("stream"); /** * Validates the provided SocksClientOptions * @param options { SocksClientOptions } * @param acceptedCommands { string[] } A list of accepted SocksProxy commands. */ function validateSocksClientOptions(options, acceptedCommands = ['connect', 'bind', 'associate']) { // Check SOCKs command option. if (!constants_1.SocksCommand[options.command]) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksCommand, options); } // Check SocksCommand for acceptable command. if (acceptedCommands.indexOf(options.command) === -1) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksCommandForOperation, options); } // Check destination if (!isValidSocksRemoteHost(options.destination)) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsDestination, options); } // Check SOCKS proxy to use if (!isValidSocksProxy(options.proxy)) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsProxy, options); } // Validate custom auth (if set) validateCustomProxyAuth(options.proxy, options); // Check timeout if (options.timeout && !isValidTimeoutValue(options.timeout)) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsTimeout, options); } // Check existing_socket (if provided) if (options.existing_socket && !(options.existing_socket instanceof stream.Duplex)) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsExistingSocket, options); } } exports.validateSocksClientOptions = validateSocksClientOptions; /** * Validates the SocksClientChainOptions * @param options { SocksClientChainOptions } */ function validateSocksClientChainOptions(options) { // Only connect is supported when chaining. if (options.command !== 'connect') { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksCommandChain, options); } // Check destination if (!isValidSocksRemoteHost(options.destination)) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsDestination, options); } // Validate proxies (length) if (!(options.proxies && Array.isArray(options.proxies) && options.proxies.length >= 2)) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsProxiesLength, options); } // Validate proxies options.proxies.forEach((proxy) => { if (!isValidSocksProxy(proxy)) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsProxy, options); } // Validate custom auth (if set) validateCustomProxyAuth(proxy, options); }); // Check timeout if (options.timeout && !isValidTimeoutValue(options.timeout)) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsTimeout, options); } } exports.validateSocksClientChainOptions = validateSocksClientChainOptions; function validateCustomProxyAuth(proxy, options) { if (proxy.custom_auth_method !== undefined) { // Invalid auth method range if (proxy.custom_auth_method < constants_1.SOCKS5_CUSTOM_AUTH_START || proxy.custom_auth_method > constants_1.SOCKS5_CUSTOM_AUTH_END) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsCustomAuthRange, options); } // Missing custom_auth_request_handler if (proxy.custom_auth_request_handler === undefined || typeof proxy.custom_auth_request_handler !== 'function') { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsCustomAuthOptions, options); } // Missing custom_auth_response_size if (proxy.custom_auth_response_size === undefined) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsCustomAuthOptions, options); } // Missing/invalid custom_auth_response_handler if (proxy.custom_auth_response_handler === undefined || typeof proxy.custom_auth_response_handler !== 'function') { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsCustomAuthOptions, options); } } } /** * Validates a SocksRemoteHost * @param remoteHost { SocksRemoteHost } */ function isValidSocksRemoteHost(remoteHost) { return (remoteHost && typeof remoteHost.host === 'string' && typeof remoteHost.port === 'number' && remoteHost.port >= 0 && remoteHost.port <= 65535); } /** * Validates a SocksProxy * @param proxy { SocksProxy } */ function isValidSocksProxy(proxy) { return (proxy && (typeof proxy.host === 'string' || typeof proxy.ipaddress === 'string') && typeof proxy.port === 'number' && proxy.port >= 0 && proxy.port <= 65535 && (proxy.type === 4 || proxy.type === 5)); } /** * Validates a timeout value. * @param value { Number } */ function isValidTimeoutValue(value) { return typeof value === 'number' && value > 0; }//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/make-fetch-happen/node_modules/socks/build/common/helpers.js.map"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ReceiveBuffer = void 0; class ReceiveBuffer { constructor(size = 4096) { this.buffer = Buffer.allocUnsafe(size); this.offset = 0; this.originalSize = size; } get length() { return this.offset; } append(data) { if (!Buffer.isBuffer(data)) { throw new Error('Attempted to append a non-buffer instance to ReceiveBuffer.'); } if (this.offset + data.length >= this.buffer.length) { const tmp = this.buffer; this.buffer = Buffer.allocUnsafe(Math.max(this.buffer.length + this.originalSize, this.buffer.length + data.length)); tmp.copy(this.buffer); } data.copy(this.buffer, this.offset); return (this.offset += data.length); } peek(length) { if (length > this.offset) { throw new Error('Attempted to read beyond the bounds of the managed internal data.'); } return this.buffer.slice(0, length); } get(length) { if (length > this.offset) { throw new Error('Attempted to read beyond the bounds of the managed internal data.'); } const value = Buffer.allocUnsafe(length); this.buffer.slice(0, length).copy(value); this.buffer.copyWithin(0, length, length + this.offset - length); this.offset -= length; return value; } } exports.ReceiveBuffer = ReceiveBuffer;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/make-fetch-happen/node_modules/socks/build/common/receivebuffer.js.map"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.shuffleArray = exports.SocksClientError = void 0; /** * Error wrapper for SocksClient */ class SocksClientError extends Error { constructor(message, options) { super(message); this.options = options; } } exports.SocksClientError = SocksClientError; /** * Shuffles a given array. * @param array The array to shuffle. */ function shuffleArray(array) { for (let i = array.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); [array[i], array[j]] = [array[j], array[i]]; } } exports.shuffleArray = shuffleArray;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/make-fetch-happen/node_modules/socks/build/common/util.js.map/* eslint-env browser */ /** * This is the web browser implementation of `debug()`. */ exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); exports.destroy = (() => { let warned = false; return () => { if (!warned) { warned = true; console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); } }; })(); /** * Colors. */ exports.colors = [ '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33' ]; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ // eslint-disable-next-line complexity function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { return true; } // Internet Explorer and Edge do not support colors. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || // Is firebug? http://stackoverflow.com/a/398120/376773 (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || // Double check webkit in userAgent just in case we are in a worker (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); } /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); if (!this.useColors) { return; } const c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into let index = 0; let lastC = 0; args[0].replace(/%[a-zA-Z%]/g, match => { if (match === '%%') { return; } index++; if (match === '%c') { // We only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.debug()` when available. * No-op when `console.debug` is not a "function". * If `console.debug` is not available, falls back * to `console.log`. * * @api public */ exports.log = console.debug || console.log || (() => {}); /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (namespaces) { exports.storage.setItem('debug', namespaces); } else { exports.storage.removeItem('debug'); } } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { let r; try { r = exports.storage.getItem('debug'); } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context // The Browser also has localStorage in the global context. return localStorage; } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } module.exports = require('./common')(exports); const {formatters} = module.exports; /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ formatters.j = function (v) { try { return JSON.stringify(v); } catch (error) { return '[UnexpectedJSONParseError]: ' + error.message; } }; /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. */ function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = require('ms'); createDebug.destroy = destroy; Object.keys(env).forEach(key => { createDebug[key] = env[key]; }); /** * The currently active debug mode names, and names to skip. */ createDebug.names = []; createDebug.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ createDebug.formatters = {}; /** * Selects a color for a debug namespace * @param {String} namespace The namespace string for the debug instance to be colored * @return {Number|String} An ANSI color code for the given namespace * @api private */ function selectColor(namespace) { let hash = 0; for (let i = 0; i < namespace.length; i++) { hash = ((hash << 5) - hash) + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { let prevTime; let enableOverride = null; let namespacesCache; let enabledCache; function debug(...args) { // Disabled? if (!debug.enabled) { return; } const self = debug; // Set `diff` timestamp const curr = Number(new Date()); const ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== 'string') { // Anything else let's inspect with %O args.unshift('%O'); } // Apply any `formatters` transformations let index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { // If we encounter an escaped % then don't increase the array index if (match === '%%') { return '%'; } index++; const formatter = createDebug.formatters[format]; if (typeof formatter === 'function') { const val = args[index]; match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // Apply env-specific formatting (colors, etc.) createDebug.formatArgs.call(self, args); const logFn = self.log || createDebug.log; logFn.apply(self, args); } debug.namespace = namespace; debug.useColors = createDebug.useColors(); debug.color = createDebug.selectColor(namespace); debug.extend = extend; debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. Object.defineProperty(debug, 'enabled', { enumerable: true, configurable: false, get: () => { if (enableOverride !== null) { return enableOverride; } if (namespacesCache !== createDebug.namespaces) { namespacesCache = createDebug.namespaces; enabledCache = createDebug.enabled(namespace); } return enabledCache; }, set: v => { enableOverride = v; } }); // Env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } return debug; } function extend(namespace, delimiter) { const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); newDebug.log = this.log; return newDebug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { createDebug.save(namespaces); createDebug.namespaces = namespaces; createDebug.names = []; createDebug.skips = []; let i; const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); const len = split.length; for (i = 0; i < len; i++) { if (!split[i]) { // ignore empty strings continue; } namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$')); } else { createDebug.names.push(new RegExp('^' + namespaces + '$')); } } } /** * Disable debug output. * * @return {String} namespaces * @api public */ function disable() { const namespaces = [ ...createDebug.names.map(toNamespace), ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) ].join(','); createDebug.enable(''); return namespaces; } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { if (name[name.length - 1] === '*') { return true; } let i; let len; for (i = 0, len = createDebug.skips.length; i < len; i++) { if (createDebug.skips[i].test(name)) { return false; } } for (i = 0, len = createDebug.names.length; i < len; i++) { if (createDebug.names[i].test(name)) { return true; } } return false; } /** * Convert regexp to namespace * * @param {RegExp} regxep * @return {String} namespace * @api private */ function toNamespace(regexp) { return regexp.toString() .substring(2, regexp.toString().length - 2) .replace(/\.\*\?$/, '*'); } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } /** * XXX DO NOT USE. This is a temporary stub function. * XXX It WILL be removed in the next major release. */ function destroy() { console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); } createDebug.enable(createDebug.load()); return createDebug; } module.exports = setup; /** * Detect Electron renderer / nwjs process, which is node, but we should * treat as a browser. */ if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { module.exports = require('./browser.js'); } else { module.exports = require('./node.js'); } /** * Module dependencies. */ const tty = require('tty'); const util = require('util'); /** * This is the Node.js implementation of `debug()`. */ exports.init = init; exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.destroy = util.deprecate( () => {}, 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' ); /** * Colors. */ exports.colors = [6, 2, 3, 4, 5, 1]; try { // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) // eslint-disable-next-line import/no-extraneous-dependencies const supportsColor = require('supports-color'); if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { exports.colors = [ 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221 ]; } } catch (error) { // Swallow - we only care if `supports-color` is available; it doesn't have to be. } /** * Build up the default `inspectOpts` object from the environment variables. * * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js */ exports.inspectOpts = Object.keys(process.env).filter(key => { return /^debug_/i.test(key); }).reduce((obj, key) => { // Camel-case const prop = key .substring(6) .toLowerCase() .replace(/_([a-z])/g, (_, k) => { return k.toUpperCase(); }); // Coerce string value into JS value let val = process.env[key]; if (/^(yes|on|true|enabled)$/i.test(val)) { val = true; } else if (/^(no|off|false|disabled)$/i.test(val)) { val = false; } else if (val === 'null') { val = null; } else { val = Number(val); } obj[prop] = val; return obj; }, {}); /** * Is stdout a TTY? Colored output is enabled when `true`. */ function useColors() { return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd); } /** * Adds ANSI color escape codes if enabled. * * @api public */ function formatArgs(args) { const {namespace: name, useColors} = this; if (useColors) { const c = this.color; const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); const prefix = ` ${colorCode};1m${name} \u001B[0m`; args[0] = prefix + args[0].split('\n').join('\n' + prefix); args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); } else { args[0] = getDate() + name + ' ' + args[0]; } } function getDate() { if (exports.inspectOpts.hideDate) { return ''; } return new Date().toISOString() + ' '; } /** * Invokes `util.format()` with the specified arguments and writes to stderr. */ function log(...args) { return process.stderr.write(util.format(...args) + '\n'); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { if (namespaces) { process.env.DEBUG = namespaces; } else { // If you set a process.env field to null or undefined, it gets cast to the // string 'null' or 'undefined'. Just delete instead. delete process.env.DEBUG; } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { return process.env.DEBUG; } /** * Init logic for `debug` instances. * * Create a new `inspectOpts` object in case `useColors` is set * differently for a particular `debug` instance. */ function init(debug) { debug.inspectOpts = {}; const keys = Object.keys(exports.inspectOpts); for (let i = 0; i < keys.length; i++) { debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; } } module.exports = require('./common')(exports); const {formatters} = module.exports; /** * Map %o to `util.inspect()`, all on a single line. */ formatters.o = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts) .split('\n') .map(str => str.trim()) .join(' '); }; /** * Map %O to `util.inspect()`, allowing multiple lines if needed. */ formatters.O = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts); }; "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; const events_1 = require("events"); const debug_1 = __importDefault(require("debug")); const promisify_1 = __importDefault(require("./promisify")); const debug = debug_1.default('agent-base'); function isAgent(v) { return Boolean(v) && typeof v.addRequest === 'function'; } function isSecureEndpoint() { const { stack } = new Error(); if (typeof stack !== 'string') return false; return stack.split('\n').some(l => l.indexOf('(https.js:') !== -1 || l.indexOf('node:https:') !== -1); } function createAgent(callback, opts) { return new createAgent.Agent(callback, opts); } (function (createAgent) { /** * Base `http.Agent` implementation. * No pooling/keep-alive is implemented by default. * * @param {Function} callback * @api public */ class Agent extends events_1.EventEmitter { constructor(callback, _opts) { super(); let opts = _opts; if (typeof callback === 'function') { this.callback = callback; } else if (callback) { opts = callback; } // Timeout for the socket to be returned from the callback this.timeout = null; if (opts && typeof opts.timeout === 'number') { this.timeout = opts.timeout; } // These aren't actually used by `agent-base`, but are required // for the TypeScript definition files in `@types/node` :/ this.maxFreeSockets = 1; this.maxSockets = 1; this.maxTotalSockets = Infinity; this.sockets = {}; this.freeSockets = {}; this.requests = {}; this.options = {}; } get defaultPort() { if (typeof this.explicitDefaultPort === 'number') { return this.explicitDefaultPort; } return isSecureEndpoint() ? 443 : 80; } set defaultPort(v) { this.explicitDefaultPort = v; } get protocol() { if (typeof this.explicitProtocol === 'string') { return this.explicitProtocol; } return isSecureEndpoint() ? 'https:' : 'http:'; } set protocol(v) { this.explicitProtocol = v; } callback(req, opts, fn) { throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`'); } /** * Called by node-core's "_http_client.js" module when creating * a new HTTP request with this Agent instance. * * @api public */ addRequest(req, _opts) { const opts = Object.assign({}, _opts); if (typeof opts.secureEndpoint !== 'boolean') { opts.secureEndpoint = isSecureEndpoint(); } if (opts.host == null) { opts.host = 'localhost'; } if (opts.port == null) { opts.port = opts.secureEndpoint ? 443 : 80; } if (opts.protocol == null) { opts.protocol = opts.secureEndpoint ? 'https:' : 'http:'; } if (opts.host && opts.path) { // If both a `host` and `path` are specified then it's most // likely the result of a `url.parse()` call... we need to // remove the `path` portion so that `net.connect()` doesn't // attempt to open that as a unix socket file. delete opts.path; } delete opts.agent; delete opts.hostname; delete opts._defaultAgent; delete opts.defaultPort; delete opts.createConnection; // Hint to use "Connection: close" // XXX: non-documented `http` module API :( req._last = true; req.shouldKeepAlive = false; let timedOut = false; let timeoutId = null; const timeoutMs = opts.timeout || this.timeout; const onerror = (err) => { if (req._hadError) return; req.emit('error', err); // For Safety. Some additional errors might fire later on // and we need to make sure we don't double-fire the error event. req._hadError = true; }; const ontimeout = () => { timeoutId = null; timedOut = true; const err = new Error(`A "socket" was not created for HTTP request before ${timeoutMs}ms`); err.code = 'ETIMEOUT'; onerror(err); }; const callbackError = (err) => { if (timedOut) return; if (timeoutId !== null) { clearTimeout(timeoutId); timeoutId = null; } onerror(err); }; const onsocket = (socket) => { if (timedOut) return; if (timeoutId != null) { clearTimeout(timeoutId); timeoutId = null; } if (isAgent(socket)) { // `socket` is actually an `http.Agent` instance, so // relinquish responsibility for this `req` to the Agent // from here on debug('Callback returned another Agent instance %o', socket.constructor.name); socket.addRequest(req, opts); return; } if (socket) { socket.once('free', () => { this.freeSocket(socket, opts); }); req.onSocket(socket); return; } const err = new Error(`no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\``); onerror(err); }; if (typeof this.callback !== 'function') { onerror(new Error('`callback` is not defined')); return; } if (!this.promisifiedCallback) { if (this.callback.length >= 3) { debug('Converting legacy callback function to promise'); this.promisifiedCallback = promisify_1.default(this.callback); } else { this.promisifiedCallback = this.callback; } } if (typeof timeoutMs === 'number' && timeoutMs > 0) { timeoutId = setTimeout(ontimeout, timeoutMs); } if ('port' in opts && typeof opts.port !== 'number') { opts.port = Number(opts.port); } try { debug('Resolving socket for %o request: %o', opts.protocol, `${req.method} ${req.path}`); Promise.resolve(this.promisifiedCallback(req, opts)).then(onsocket, callbackError); } catch (err) { Promise.reject(err).catch(callbackError); } } freeSocket(socket, opts) { debug('Freeing socket %o %o', socket.constructor.name, opts); socket.destroy(); } destroy() { debug('Destroying agent %o', this.constructor.name); } } createAgent.Agent = Agent; // So that `instanceof` works correctly createAgent.prototype = createAgent.Agent.prototype; })(createAgent || (createAgent = {})); module.exports = createAgent;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/dist/src/index.js.map"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function promisify(fn) { return function (req, opts) { return new Promise((resolve, reject) => { fn.call(this, req, opts, (err, rtn) => { if (err) { reject(err); } else { resolve(rtn); } }); }); }; } exports.default = promisify;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/dist/src/promisify.js.map/** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; var w = d * 7; var y = d * 365.25; /** * Parse or format the given `val`. * * Options: * * - `long` verbose formatting [false] * * @param {String|Number} val * @param {Object} [options] * @throws {Error} throw an error if val is not a non-empty string or a number * @return {String|Number} * @api public */ module.exports = function (val, options) { options = options || {}; var type = typeof val; if (type === 'string' && val.length > 0) { return parse(val); } else if (type === 'number' && isFinite(val)) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error( 'val is not a non-empty string or a valid number. val=' + JSON.stringify(val) ); }; /** * Parse the given `str` and return milliseconds. * * @param {String} str * @return {Number} * @api private */ function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( str ); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'yrs': case 'yr': case 'y': return n * y; case 'weeks': case 'week': case 'w': return n * w; case 'days': case 'day': case 'd': return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': return n * m; case 'seconds': case 'second': case 'secs': case 'sec': case 's': return n * s; case 'milliseconds': case 'millisecond': case 'msecs': case 'msec': case 'ms': return n; default: return undefined; } } /** * Short format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtShort(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return Math.round(ms / d) + 'd'; } if (msAbs >= h) { return Math.round(ms / h) + 'h'; } if (msAbs >= m) { return Math.round(ms / m) + 'm'; } if (msAbs >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtLong(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return plural(ms, msAbs, d, 'day'); } if (msAbs >= h) { return plural(ms, msAbs, h, 'hour'); } if (msAbs >= m) { return plural(ms, msAbs, m, 'minute'); } if (msAbs >= s) { return plural(ms, msAbs, s, 'second'); } return ms + ' ms'; } /** * Pluralization helper. */ function plural(ms, msAbs, n, name) { var isPlural = msAbs >= n * 1.5; return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); } The MIT License (MIT) Copyright (c) 2020 Vercel, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "ms", "version": "2.1.3", "description": "Tiny millisecond conversion utility", "repository": "vercel/ms", "main": "./index", "files": [ "index.js" ], "scripts": { "precommit": "lint-staged", "lint": "eslint lib/* bin/*", "test": "mocha tests.js" }, "eslintConfig": { "extends": "eslint:recommended", "env": { "node": true, "es6": true } }, "lint-staged": { "*.js": [ "npm run lint", "prettier --single-quote --write", "git add" ] }, "license": "MIT", "devDependencies": { "eslint": "4.18.2", "expect.js": "0.3.1", "husky": "0.14.3", "lint-staged": "5.0.0", "mocha": "4.0.1", "prettier": "2.0.5" } } (The MIT License) Copyright (c) 2014 TJ Holowaychuk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "debug", "version": "4.1.1", "repository": { "type": "git", "url": "git://github.com/visionmedia/debug.git" }, "description": "small debugging utility", "keywords": [ "debug", "log", "debugger" ], "files": [ "src", "dist/debug.js", "LICENSE", "README.md" ], "author": "TJ Holowaychuk ", "contributors": [ "Nathan Rajlich (http://n8.io)", "Andrew Rhyne " ], "license": "MIT", "scripts": { "lint": "xo", "test": "npm run test:node && npm run test:browser", "test:node": "istanbul cover _mocha -- test.js", "pretest:browser": "npm run build", "test:browser": "karma start --single-run", "prebuild:debug": "mkdir -p dist && browserify --standalone debug -o dist/debug.es6.js .", "build:debug": "babel -o dist/debug.js dist/debug.es6.js > dist/debug.js", "build:test": "babel -d dist test.js", "build": "npm run build:debug && npm run build:test", "clean": "rimraf dist coverage", "test:coverage": "cat ./coverage/lcov.info | coveralls" }, "dependencies": { "ms": "^2.1.1" }, "devDependencies": { "@babel/cli": "^7.0.0", "@babel/core": "^7.0.0", "@babel/preset-env": "^7.0.0", "browserify": "14.4.0", "chai": "^3.5.0", "concurrently": "^3.1.0", "coveralls": "^3.0.2", "istanbul": "^0.4.5", "karma": "^3.0.0", "karma-chai": "^0.1.0", "karma-mocha": "^1.3.0", "karma-phantomjs-launcher": "^1.0.2", "mocha": "^5.2.0", "mocha-lcov-reporter": "^1.2.0", "rimraf": "^2.5.4", "xo": "^0.23.0" }, "main": "./src/index.js", "browser": "./src/browser.js", "unpkg": "./dist/debug.js" } /* eslint-env browser */ /** * This is the web browser implementation of `debug()`. */ exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); /** * Colors. */ exports.colors = [ '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33' ]; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ // eslint-disable-next-line complexity function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { return true; } // Internet Explorer and Edge do not support colors. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || // Is firebug? http://stackoverflow.com/a/398120/376773 (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || // Double check webkit in userAgent just in case we are in a worker (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); } /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); if (!this.useColors) { return; } const c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into let index = 0; let lastC = 0; args[0].replace(/%[a-zA-Z%]/g, match => { if (match === '%%') { return; } index++; if (match === '%c') { // We only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.log()` when available. * No-op when `console.log` is not a "function". * * @api public */ function log(...args) { // This hackery is required for IE8/9, where // the `console.log` function doesn't have 'apply' return typeof console === 'object' && console.log && console.log(...args); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (namespaces) { exports.storage.setItem('debug', namespaces); } else { exports.storage.removeItem('debug'); } } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { let r; try { r = exports.storage.getItem('debug'); } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context // The Browser also has localStorage in the global context. return localStorage; } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } module.exports = require('./common')(exports); const {formatters} = module.exports; /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ formatters.j = function (v) { try { return JSON.stringify(v); } catch (error) { return '[UnexpectedJSONParseError]: ' + error.message; } }; /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. */ function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = require('ms'); Object.keys(env).forEach(key => { createDebug[key] = env[key]; }); /** * Active `debug` instances. */ createDebug.instances = []; /** * The currently active debug mode names, and names to skip. */ createDebug.names = []; createDebug.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ createDebug.formatters = {}; /** * Selects a color for a debug namespace * @param {String} namespace The namespace string for the for the debug instance to be colored * @return {Number|String} An ANSI color code for the given namespace * @api private */ function selectColor(namespace) { let hash = 0; for (let i = 0; i < namespace.length; i++) { hash = ((hash << 5) - hash) + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { let prevTime; function debug(...args) { // Disabled? if (!debug.enabled) { return; } const self = debug; // Set `diff` timestamp const curr = Number(new Date()); const ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== 'string') { // Anything else let's inspect with %O args.unshift('%O'); } // Apply any `formatters` transformations let index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { // If we encounter an escaped % then don't increase the array index if (match === '%%') { return match; } index++; const formatter = createDebug.formatters[format]; if (typeof formatter === 'function') { const val = args[index]; match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // Apply env-specific formatting (colors, etc.) createDebug.formatArgs.call(self, args); const logFn = self.log || createDebug.log; logFn.apply(self, args); } debug.namespace = namespace; debug.enabled = createDebug.enabled(namespace); debug.useColors = createDebug.useColors(); debug.color = selectColor(namespace); debug.destroy = destroy; debug.extend = extend; // Debug.formatArgs = formatArgs; // debug.rawLog = rawLog; // env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } createDebug.instances.push(debug); return debug; } function destroy() { const index = createDebug.instances.indexOf(this); if (index !== -1) { createDebug.instances.splice(index, 1); return true; } return false; } function extend(namespace, delimiter) { const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); newDebug.log = this.log; return newDebug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { createDebug.save(namespaces); createDebug.names = []; createDebug.skips = []; let i; const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); const len = split.length; for (i = 0; i < len; i++) { if (!split[i]) { // ignore empty strings continue; } namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else { createDebug.names.push(new RegExp('^' + namespaces + '$')); } } for (i = 0; i < createDebug.instances.length; i++) { const instance = createDebug.instances[i]; instance.enabled = createDebug.enabled(instance.namespace); } } /** * Disable debug output. * * @return {String} namespaces * @api public */ function disable() { const namespaces = [ ...createDebug.names.map(toNamespace), ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) ].join(','); createDebug.enable(''); return namespaces; } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { if (name[name.length - 1] === '*') { return true; } let i; let len; for (i = 0, len = createDebug.skips.length; i < len; i++) { if (createDebug.skips[i].test(name)) { return false; } } for (i = 0, len = createDebug.names.length; i < len; i++) { if (createDebug.names[i].test(name)) { return true; } } return false; } /** * Convert regexp to namespace * * @param {RegExp} regxep * @return {String} namespace * @api private */ function toNamespace(regexp) { return regexp.toString() .substring(2, regexp.toString().length - 2) .replace(/\.\*\?$/, '*'); } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } createDebug.enable(createDebug.load()); return createDebug; } module.exports = setup; /** * Detect Electron renderer / nwjs process, which is node, but we should * treat as a browser. */ if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { module.exports = require('./browser.js'); } else { module.exports = require('./node.js'); } /** * Module dependencies. */ const tty = require('tty'); const util = require('util'); /** * This is the Node.js implementation of `debug()`. */ exports.init = init; exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; /** * Colors. */ exports.colors = [6, 2, 3, 4, 5, 1]; try { // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) // eslint-disable-next-line import/no-extraneous-dependencies const supportsColor = require('supports-color'); if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { exports.colors = [ 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221 ]; } } catch (error) { // Swallow - we only care if `supports-color` is available; it doesn't have to be. } /** * Build up the default `inspectOpts` object from the environment variables. * * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js */ exports.inspectOpts = Object.keys(process.env).filter(key => { return /^debug_/i.test(key); }).reduce((obj, key) => { // Camel-case const prop = key .substring(6) .toLowerCase() .replace(/_([a-z])/g, (_, k) => { return k.toUpperCase(); }); // Coerce string value into JS value let val = process.env[key]; if (/^(yes|on|true|enabled)$/i.test(val)) { val = true; } else if (/^(no|off|false|disabled)$/i.test(val)) { val = false; } else if (val === 'null') { val = null; } else { val = Number(val); } obj[prop] = val; return obj; }, {}); /** * Is stdout a TTY? Colored output is enabled when `true`. */ function useColors() { return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd); } /** * Adds ANSI color escape codes if enabled. * * @api public */ function formatArgs(args) { const {namespace: name, useColors} = this; if (useColors) { const c = this.color; const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); const prefix = ` ${colorCode};1m${name} \u001B[0m`; args[0] = prefix + args[0].split('\n').join('\n' + prefix); args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); } else { args[0] = getDate() + name + ' ' + args[0]; } } function getDate() { if (exports.inspectOpts.hideDate) { return ''; } return new Date().toISOString() + ' '; } /** * Invokes `util.format()` with the specified arguments and writes to stderr. */ function log(...args) { return process.stderr.write(util.format(...args) + '\n'); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { if (namespaces) { process.env.DEBUG = namespaces; } else { // If you set a process.env field to null or undefined, it gets cast to the // string 'null' or 'undefined'. Just delete instead. delete process.env.DEBUG; } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { return process.env.DEBUG; } /** * Init logic for `debug` instances. * * Create a new `inspectOpts` object in case `useColors` is set * differently for a particular `debug` instance. */ function init(debug) { debug.inspectOpts = {}; const keys = Object.keys(exports.inspectOpts); for (let i = 0; i < keys.length; i++) { debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; } } module.exports = require('./common')(exports); const {formatters} = module.exports; /** * Map %o to `util.inspect()`, all on a single line. */ formatters.o = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts) .replace(/\s*\n\s*/g, ' '); }; /** * Map %O to `util.inspect()`, allowing multiple lines if needed. */ formatters.O = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts); }; "use strict"; function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } (function (f) { if ((typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined") { module.exports = f(); } else if (typeof define === "function" && define.amd) { define([], f); } else { var g; if (typeof window !== "undefined") { g = window; } else if (typeof global !== "undefined") { g = global; } else if (typeof self !== "undefined") { g = self; } else { g = this; } g.debug = f(); } })(function () { var define, module, exports; return function () { function r(e, n, t) { function o(i, f) { if (!n[i]) { if (!e[i]) { var c = "function" == typeof require && require; if (!f && c) return c(i, !0); if (u) return u(i, !0); var a = new Error("Cannot find module '" + i + "'"); throw a.code = "MODULE_NOT_FOUND", a; } var p = n[i] = { exports: {} }; e[i][0].call(p.exports, function (r) { var n = e[i][1][r]; return o(n || r); }, p, p.exports, r, e, n, t); } return n[i].exports; } for (var u = "function" == typeof require && require, i = 0; i < t.length; i++) { o(t[i]); } return o; } return r; }()({ 1: [function (require, module, exports) { /** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; var w = d * 7; var y = d * 365.25; /** * Parse or format the given `val`. * * Options: * * - `long` verbose formatting [false] * * @param {String|Number} val * @param {Object} [options] * @throws {Error} throw an error if val is not a non-empty string or a number * @return {String|Number} * @api public */ module.exports = function (val, options) { options = options || {}; var type = _typeof(val); if (type === 'string' && val.length > 0) { return parse(val); } else if (type === 'number' && isNaN(val) === false) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val)); }; /** * Parse the given `str` and return milliseconds. * * @param {String} str * @return {Number} * @api private */ function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'yrs': case 'yr': case 'y': return n * y; case 'weeks': case 'week': case 'w': return n * w; case 'days': case 'day': case 'd': return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': return n * m; case 'seconds': case 'second': case 'secs': case 'sec': case 's': return n * s; case 'milliseconds': case 'millisecond': case 'msecs': case 'msec': case 'ms': return n; default: return undefined; } } /** * Short format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtShort(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return Math.round(ms / d) + 'd'; } if (msAbs >= h) { return Math.round(ms / h) + 'h'; } if (msAbs >= m) { return Math.round(ms / m) + 'm'; } if (msAbs >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtLong(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return plural(ms, msAbs, d, 'day'); } if (msAbs >= h) { return plural(ms, msAbs, h, 'hour'); } if (msAbs >= m) { return plural(ms, msAbs, m, 'minute'); } if (msAbs >= s) { return plural(ms, msAbs, s, 'second'); } return ms + ' ms'; } /** * Pluralization helper. */ function plural(ms, msAbs, n, name) { var isPlural = msAbs >= n * 1.5; return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); } }, {}], 2: [function (require, module, exports) { // shim for using process in browser var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it // don't break things. But we need to wrap it in a try catch in case it is // wrapped in strict mode code which doesn't define any globals. It's inside a // function because try/catches deoptimize in certain engines. var cachedSetTimeout; var cachedClearTimeout; function defaultSetTimout() { throw new Error('setTimeout has not been defined'); } function defaultClearTimeout() { throw new Error('clearTimeout has not been defined'); } (function () { try { if (typeof setTimeout === 'function') { cachedSetTimeout = setTimeout; } else { cachedSetTimeout = defaultSetTimout; } } catch (e) { cachedSetTimeout = defaultSetTimout; } try { if (typeof clearTimeout === 'function') { cachedClearTimeout = clearTimeout; } else { cachedClearTimeout = defaultClearTimeout; } } catch (e) { cachedClearTimeout = defaultClearTimeout; } })(); function runTimeout(fun) { if (cachedSetTimeout === setTimeout) { //normal enviroments in sane situations return setTimeout(fun, 0); } // if setTimeout wasn't available but was latter defined if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout; return setTimeout(fun, 0); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedSetTimeout(fun, 0); } catch (e) { try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedSetTimeout.call(null, fun, 0); } catch (e) { // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { //normal enviroments in sane situations return clearTimeout(marker); } // if clearTimeout wasn't available but was latter defined if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout; return clearTimeout(marker); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedClearTimeout(marker); } catch (e) { try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedClearTimeout.call(null, marker); } catch (e) { // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. // Some versions of I.E. have different rules for clearTimeout vs setTimeout return cachedClearTimeout.call(this, marker); } } } var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; while (len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; runClearTimeout(timeout); } process.nextTick = function (fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { runTimeout(drainQueue); } }; // v8 likes predictible objects function Item(fun, array) { this.fun = fun; this.array = array; } Item.prototype.run = function () { this.fun.apply(null, this.array); }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues process.versions = {}; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.prependListener = noop; process.prependOnceListener = noop; process.listeners = function (name) { return []; }; process.binding = function (name) { throw new Error('process.binding is not supported'); }; process.cwd = function () { return '/'; }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; process.umask = function () { return 0; }; }, {}], 3: [function (require, module, exports) { /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. */ function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = require('ms'); Object.keys(env).forEach(function (key) { createDebug[key] = env[key]; }); /** * Active `debug` instances. */ createDebug.instances = []; /** * The currently active debug mode names, and names to skip. */ createDebug.names = []; createDebug.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ createDebug.formatters = {}; /** * Selects a color for a debug namespace * @param {String} namespace The namespace string for the for the debug instance to be colored * @return {Number|String} An ANSI color code for the given namespace * @api private */ function selectColor(namespace) { var hash = 0; for (var i = 0; i < namespace.length; i++) { hash = (hash << 5) - hash + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { var prevTime; function debug() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } // Disabled? if (!debug.enabled) { return; } var self = debug; // Set `diff` timestamp var curr = Number(new Date()); var ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== 'string') { // Anything else let's inspect with %O args.unshift('%O'); } // Apply any `formatters` transformations var index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) { // If we encounter an escaped % then don't increase the array index if (match === '%%') { return match; } index++; var formatter = createDebug.formatters[format]; if (typeof formatter === 'function') { var val = args[index]; match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // Apply env-specific formatting (colors, etc.) createDebug.formatArgs.call(self, args); var logFn = self.log || createDebug.log; logFn.apply(self, args); } debug.namespace = namespace; debug.enabled = createDebug.enabled(namespace); debug.useColors = createDebug.useColors(); debug.color = selectColor(namespace); debug.destroy = destroy; debug.extend = extend; // Debug.formatArgs = formatArgs; // debug.rawLog = rawLog; // env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } createDebug.instances.push(debug); return debug; } function destroy() { var index = createDebug.instances.indexOf(this); if (index !== -1) { createDebug.instances.splice(index, 1); return true; } return false; } function extend(namespace, delimiter) { var newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); newDebug.log = this.log; return newDebug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { createDebug.save(namespaces); createDebug.names = []; createDebug.skips = []; var i; var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); var len = split.length; for (i = 0; i < len; i++) { if (!split[i]) { // ignore empty strings continue; } namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else { createDebug.names.push(new RegExp('^' + namespaces + '$')); } } for (i = 0; i < createDebug.instances.length; i++) { var instance = createDebug.instances[i]; instance.enabled = createDebug.enabled(instance.namespace); } } /** * Disable debug output. * * @return {String} namespaces * @api public */ function disable() { var namespaces = [].concat(_toConsumableArray(createDebug.names.map(toNamespace)), _toConsumableArray(createDebug.skips.map(toNamespace).map(function (namespace) { return '-' + namespace; }))).join(','); createDebug.enable(''); return namespaces; } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { if (name[name.length - 1] === '*') { return true; } var i; var len; for (i = 0, len = createDebug.skips.length; i < len; i++) { if (createDebug.skips[i].test(name)) { return false; } } for (i = 0, len = createDebug.names.length; i < len; i++) { if (createDebug.names[i].test(name)) { return true; } } return false; } /** * Convert regexp to namespace * * @param {RegExp} regxep * @return {String} namespace * @api private */ function toNamespace(regexp) { return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, '*'); } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } createDebug.enable(createDebug.load()); return createDebug; } module.exports = setup; }, { "ms": 1 }], 4: [function (require, module, exports) { (function (process) { /* eslint-env browser */ /** * This is the web browser implementation of `debug()`. */ exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); /** * Colors. */ exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33']; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ // eslint-disable-next-line complexity function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { return true; } // Internet Explorer and Edge do not support colors. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); } /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); if (!this.useColors) { return; } var c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into var index = 0; var lastC = 0; args[0].replace(/%[a-zA-Z%]/g, function (match) { if (match === '%%') { return; } index++; if (match === '%c') { // We only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.log()` when available. * No-op when `console.log` is not a "function". * * @api public */ function log() { var _console; // This hackery is required for IE8/9, where // the `console.log` function doesn't have 'apply' return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (namespaces) { exports.storage.setItem('debug', namespaces); } else { exports.storage.removeItem('debug'); } } catch (error) {// Swallow // XXX (@Qix-) should we be logging these? } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { var r; try { r = exports.storage.getItem('debug'); } catch (error) {} // Swallow // XXX (@Qix-) should we be logging these? // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context // The Browser also has localStorage in the global context. return localStorage; } catch (error) {// Swallow // XXX (@Qix-) should we be logging these? } } module.exports = require('./common')(exports); var formatters = module.exports.formatters; /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ formatters.j = function (v) { try { return JSON.stringify(v); } catch (error) { return '[UnexpectedJSONParseError]: ' + error.message; } }; }).call(this, require('_process')); }, { "./common": 3, "_process": 2 }] }, {}, [4])(4); }); var path = require('path'); var fs = require('fs'); var _0777 = parseInt('0777', 8); module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; function mkdirP (p, opts, f, made) { if (typeof opts === 'function') { f = opts; opts = {}; } else if (!opts || typeof opts !== 'object') { opts = { mode: opts }; } var mode = opts.mode; var xfs = opts.fs || fs; if (mode === undefined) { mode = _0777 & (~process.umask()); } if (!made) made = null; var cb = f || function () {}; p = path.resolve(p); xfs.mkdir(p, mode, function (er) { if (!er) { made = made || p; return cb(null, made); } switch (er.code) { case 'ENOENT': mkdirP(path.dirname(p), opts, function (er, made) { if (er) cb(er, made); else mkdirP(p, opts, cb, made); }); break; // In the case of any other error, just see if there's a dir // there already. If so, then hooray! If not, then something // is borked. default: xfs.stat(p, function (er2, stat) { // if the stat fails, then that's super weird. // let the original error be the failure reason. if (er2 || !stat.isDirectory()) cb(er, made) else cb(null, made); }); break; } }); } mkdirP.sync = function sync (p, opts, made) { if (!opts || typeof opts !== 'object') { opts = { mode: opts }; } var mode = opts.mode; var xfs = opts.fs || fs; if (mode === undefined) { mode = _0777 & (~process.umask()); } if (!made) made = null; p = path.resolve(p); try { xfs.mkdirSync(p, mode); made = made || p; } catch (err0) { switch (err0.code) { case 'ENOENT' : made = sync(path.dirname(p), opts, made); sync(p, opts, made); break; // In the case of any other error, just see if there's a dir // there already. If so, then hooray! If not, then something // is borked. default: var stat; try { stat = xfs.statSync(p); } catch (err1) { throw err0; } if (!stat.isDirectory()) throw err0; break; } } return made; }; The MIT License (MIT) Copyright (c) 2020 James Halliday (mail@substack.net) and Mathias Buus Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "mkdirp-classic", "version": "0.5.3", "description": "Mirror of mkdirp 0.5.2", "main": "index.js", "dependencies": {}, "devDependencies": {}, "repository": { "type": "git", "url": "https://github.com/mafintosh/mkdirp-classic.git" }, "author": "Mathias Buus (@mafintosh)", "license": "MIT", "bugs": { "url": "https://github.com/mafintosh/mkdirp-classic/issues" }, "homepage": "https://github.com/mafintosh/mkdirp-classic" } 'use strict' // Copyright (c) 2018 inspiredware var path = require('path') var pkg = require(path.resolve('package.json')) var versionArray = process.version .substr(1) .replace(/-.*$/, '') .split('.') .map(function (item) { return +item }) /** * * A set of utilities to assist developers of tools that build * [N-API](https://nodejs.org/api/n-api.html#n_api_n_api) native add-ons. * * The main repository can be found * [here](https://github.com/inspiredware/napi-build-utils#napi-build-utils). * * @module napi-build-utils */ /** * Implements a consistent name of `napi` for N-API runtimes. * * @param {string} runtime The runtime string. * @returns {boolean} */ exports.isNapiRuntime = function (runtime) { return runtime === 'napi' } /** * Determines whether the specified N-API version is supported * by both the currently running Node instance and the package. * * @param {string} napiVersion The N-API version to check. * @returns {boolean} */ exports.isSupportedVersion = function (napiVersion) { var version = parseInt(napiVersion, 10) return version <= exports.getNapiVersion() && exports.packageSupportsVersion(version) } /** * Determines whether the specified N-API version is supported by the package. * The N-API version must be preseent in the `package.json` * `binary.napi_versions` array. * * @param {number} napiVersion The N-API version to check. * @returns {boolean} * @private */ exports.packageSupportsVersion = function (napiVersion) { if (pkg.binary && pkg.binary.napi_versions && pkg.binary.napi_versions instanceof Array) { for (var i = 0; i < pkg.binary.napi_versions.length; i++) { if (pkg.binary.napi_versions[i] === napiVersion) return true }; }; return false } /** * Issues a warning to the supplied log if the N-API version is not supported * by the current Node instance or if the N-API version is not supported * by the package. * * @param {string} napiVersion The N-API version to check. * @param {Object} log The log object to which the warnings are to be issued. * Must implement the `warn` method. */ exports.logUnsupportedVersion = function (napiVersion, log) { if (!exports.isSupportedVersion(napiVersion)) { if (exports.packageSupportsVersion(napiVersion)) { log.warn('This Node instance does not support N-API version ' + napiVersion) } else { log.warn('This package does not support N-API version ' + napiVersion) } } } /** * Issues warnings to the supplied log for those N-API versions not supported * by the N-API runtime or the package. * * Note that this function is specific to the * [`prebuild`](https://github.com/prebuild/prebuild#prebuild) package. * * `target` is the list of targets to be built and is determined in one of * three ways from the command line arguments: * (1) `--target` specifies a specific target to build. * (2) `--all` specifies all N-API versions supported by the package. * (3) Neither of these specifies to build the single "best version available." * * `prebuild` is an array of objects in the form `{runtime: 'napi', target: '2'}`. * The array contains the list of N-API versions that are supported by both the * package being built and the currently running Node instance. * * The objective of this function is to issue a warning for those items that appear * in the `target` argument but not in the `prebuild` argument. * If a specific target is supported by the package (`packageSupportsVersion`) but * but note in `prebuild`, the assumption is that the target is not supported by * Node. * * @param {(Array|string)} target The N-API version(s) to check. Target is * @param {Array} prebuild A config object created by the `prebuild` package. * @param {Object} log The log object to which the warnings are to be issued. * Must implement the `warn` method. * @private */ exports.logMissingNapiVersions = function (target, prebuild, log) { if (exports.getNapiBuildVersions()) { var targets = [].concat(target) targets.forEach(function (napiVersion) { if (!prebuildExists(prebuild, napiVersion)) { if (exports.packageSupportsVersion(parseInt(napiVersion, 10))) { log.warn('This Node instance does not support N-API version ' + napiVersion) } else { log.warn('This package does not support N-API version ' + napiVersion) } } }) } else { log.error('Builds with runtime \'napi\' require a binary.napi_versions ' + 'property on the package.json file') } } /** * Determines whether the specified N-API version exists in the prebuild * configuration object. * * Note that this function is speicifc to the `prebuild` and `prebuild-install` * packages. * * @param {Object} prebuild A config object created by the `prebuild` package. * @param {string} napiVersion The N-APi version to be checked. * @return {boolean} * @private */ var prebuildExists = function (prebuild, napiVersion) { if (prebuild) { for (var i = 0; i < prebuild.length; i++) { if (prebuild[i].target === napiVersion) return true } } return false } /** * Returns the best N-API version to build given the highest N-API * version supported by the current Node instance and the N-API versions * supported by the package, or undefined if a suitable N-API version * cannot be determined. * * The best build version is the greatest N-API version supported by * the package that is less than or equal to the highest N-API version * supported by the current Node instance. * * @returns {number|undefined} */ exports.getBestNapiBuildVersion = function () { var bestNapiBuildVersion = 0 var napiBuildVersions = exports.getNapiBuildVersions(pkg) if (napiBuildVersions) { var ourNapiVersion = exports.getNapiVersion() napiBuildVersions.forEach(function (napiBuildVersion) { if (napiBuildVersion > bestNapiBuildVersion && napiBuildVersion <= ourNapiVersion) { bestNapiBuildVersion = napiBuildVersion } }) } return bestNapiBuildVersion === 0 ? undefined : bestNapiBuildVersion } /** * Returns an array of N-API versions supported by the package. * * @returns {Array} */ exports.getNapiBuildVersions = function () { var napiBuildVersions = [] // remove duplicates, convert to text if (pkg.binary && pkg.binary.napi_versions) { pkg.binary.napi_versions.forEach(function (napiVersion) { var duplicated = napiBuildVersions.indexOf('' + napiVersion) !== -1 if (!duplicated) { napiBuildVersions.push('' + napiVersion) } }) } return napiBuildVersions.length ? napiBuildVersions : undefined } /** * Returns the highest N-API version supported by the current node instance * or undefined if N-API is not supported. * * @returns {string|undefined} */ exports.getNapiVersion = function () { var version = process.versions.napi // string, can be undefined if (!version) { // this code should never need to be updated if (versionArray[0] === 9 && versionArray[1] >= 3) version = '2' // 9.3.0+ else if (versionArray[0] === 8) version = '1' // 8.0.0+ } return version } ## napi-build-utils A set of utilities to assist developers of tools that build [N-API](https://nodejs.org/api/n-api.html#n_api_n_api) native add-ons. The main repository can be found [here](https://github.com/inspiredware/napi-build-utils#napi-build-utils). * [napi-build-utils](#module_napi-build-utils) * [.isNapiRuntime(runtime)](#module_napi-build-utils.isNapiRuntime) ⇒ boolean * [.isSupportedVersion(napiVersion)](#module_napi-build-utils.isSupportedVersion) ⇒ boolean * [.logUnsupportedVersion(napiVersion, log)](#module_napi-build-utils.logUnsupportedVersion) * [.getBestNapiBuildVersion()](#module_napi-build-utils.getBestNapiBuildVersion) ⇒ number \| undefined * [.getNapiBuildVersions()](#module_napi-build-utils.getNapiBuildVersions) ⇒ Array.<string> * [.getNapiVersion()](#module_napi-build-utils.getNapiVersion) ⇒ string \| undefined ### napi-build-utils.isNapiRuntime(runtime) ⇒ boolean Implements a consistent name of `napi` for N-API runtimes. **Kind**: static method of [napi-build-utils](#module_napi-build-utils) | Param | Type | Description | | --- | --- | --- | | runtime | string | The runtime string. | ### napi-build-utils.isSupportedVersion(napiVersion) ⇒ boolean Determines whether the specified N-API version is supported by both the currently running Node instance and the package. **Kind**: static method of [napi-build-utils](#module_napi-build-utils) | Param | Type | Description | | --- | --- | --- | | napiVersion | string | The N-API version to check. | ### napi-build-utils.logUnsupportedVersion(napiVersion, log) Issues a warning to the supplied log if the N-API version is not supported by the current Node instance or if the N-API version is not supported by the package. **Kind**: static method of [napi-build-utils](#module_napi-build-utils) | Param | Type | Description | | --- | --- | --- | | napiVersion | string | The N-API version to check. | | log | Object | The log object to which the warnings are to be issued. Must implement the `warn` method. | ### napi-build-utils.getBestNapiBuildVersion() ⇒ number \| undefined Returns the best N-API version to build given the highest N-API version supported by the current Node instance and the N-API versions supported by the package, or undefined if a suitable N-API version cannot be determined. The best build version is the greatest N-API version supported by the package that is less than or equal to the highest N-API version supported by the current Node instance. **Kind**: static method of [napi-build-utils](#module_napi-build-utils) ### napi-build-utils.getNapiBuildVersions() ⇒ Array.<string> Returns an array of N-API versions supported by the package. **Kind**: static method of [napi-build-utils](#module_napi-build-utils) ### napi-build-utils.getNapiVersion() ⇒ string \| undefined Returns the highest N-API version supported by the current node instance or undefined if N-API is not supported. **Kind**: static method of [napi-build-utils](#module_napi-build-utils) MIT License Copyright (c) 2018 inspiredware Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "napi-build-utils", "version": "1.0.2", "description": "A set of utilities to assist developers of tools that build N-API native add-ons", "main": "index.js", "scripts": { "doc": "jsdoc2md index.js >index.md", "test": "mocha test/ && npm run lint", "lint": "standard", "prepublishOnly": "npm run test && npm run doc" }, "keywords": [ "n-api", "prebuild", "prebuild-install" ], "author": "Jim Schlight", "license": "MIT", "homepage": "https://github.com/inspiredware/napi-build-utils#readme", "repository": { "type": "git", "url": "git+https://github.com/inspiredware/napi-build-utils.git" }, "bugs": { "url": "https://github.com/inspiredware/napi-build-utils/issues" }, "devDependencies": { "chai": "^4.1.2", "jsdoc-to-markdown": "^4.0.1", "mocha": "^5.2.0", "standard": "^12.0.1" }, "binary": { "note": "napi-build-tools is not an N-API module. This entry is for unit testing.", "napi_versions": [ 2, 2, 3 ] } } [ { "runtime": "node", "target": "11.0.0", "lts": false, "future": false, "abi": "67" }, { "runtime": "node", "target": "12.0.0", "lts": [ "2019-10-21", "2020-11-30" ], "future": false, "abi": "72" }, { "runtime": "node", "target": "13.0.0", "lts": false, "future": false, "abi": "79" }, { "runtime": "node", "target": "14.0.0", "lts": [ "2020-10-27", "2021-10-19" ], "future": false, "abi": "83" }, { "runtime": "node", "target": "15.0.0", "lts": false, "future": false, "abi": "88" }, { "runtime": "node", "target": "16.0.0", "lts": [ "2021-10-26", "2022-10-18" ], "future": false, "abi": "93" }, { "runtime": "node", "target": "17.0.0", "lts": false, "future": false, "abi": "102" }, { "abi": "70", "future": false, "lts": false, "runtime": "electron", "target": "5.0.0-beta.9" }, { "abi": "73", "future": false, "lts": false, "runtime": "electron", "target": "6.0.0-beta.1" }, { "abi": "75", "future": false, "lts": false, "runtime": "electron", "target": "7.0.0-beta.1" }, { "abi": "76", "future": false, "lts": false, "runtime": "electron", "target": "8.0.0-beta.1" }, { "abi": "76", "future": false, "lts": false, "runtime": "electron", "target": "9.0.0-beta.1" }, { "abi": "80", "future": false, "lts": false, "runtime": "electron", "target": "9.0.0-beta.2" }, { "abi": "82", "future": false, "lts": false, "runtime": "electron", "target": "10.0.0-beta.1" }, { "abi": "82", "future": false, "lts": false, "runtime": "electron", "target": "11.0.0-beta.1" }, { "abi": "85", "future": false, "lts": false, "runtime": "electron", "target": "11.0.0-beta.11" }, { "abi": "87", "future": false, "lts": false, "runtime": "electron", "target": "12.0.0-beta.1" }, { "abi": "89", "future": false, "lts": false, "runtime": "electron", "target": "13.0.0-beta.2" }, { "abi": "89", "future": false, "lts": false, "runtime": "electron", "target": "15.0.0-alpha.1" }, { "abi": "89", "future": false, "lts": false, "runtime": "electron", "target": "14.0.0-beta.1" }, { "abi": "97", "future": false, "lts": false, "runtime": "electron", "target": "14.0.2" }, { "abi": "98", "future": false, "lts": false, "runtime": "electron", "target": "15.0.0-beta.7" }, { "abi": "99", "future": false, "lts": false, "runtime": "electron", "target": "16.0.0-alpha.1" }, { "abi": "101", "future": false, "lts": false, "runtime": "electron", "target": "17.0.0-alpha.1" }, { "abi": "103", "future": true, "lts": false, "runtime": "electron", "target": "18.0.0-alpha.1" } ]var semver = require('semver') function getNextTarget (runtime, targets) { if (targets == null) targets = allTargets var latest = targets.filter(function (t) { return t.runtime === runtime }).slice(-1)[0] var increment = runtime === 'electron' ? 'minor' : 'major' var next = semver.inc(latest.target, increment) // Electron releases appear in the registry in their beta form, sometimes there is // no active beta line. During this time we need to double bump if (runtime === 'electron' && semver.parse(latest.target).prerelease.length) { next = semver.inc(next, 'major') } return next } function getAbi (target, runtime) { if (target === String(Number(target))) return target if (target) target = target.replace(/^v/, '') if (!runtime) runtime = 'node' if (runtime === 'node') { if (!target) return process.versions.modules if (target === process.versions.node) return process.versions.modules } var abi var lastTarget for (var i = 0; i < allTargets.length; i++) { var t = allTargets[i] if (t.runtime !== runtime) continue if (semver.lte(t.target, target) && (!lastTarget || semver.gte(t.target, lastTarget))) { abi = t.abi lastTarget = t.target } } if (abi && semver.lt(target, getNextTarget(runtime))) return abi throw new Error('Could not detect abi for version ' + target + ' and runtime ' + runtime + '. Updating "node-abi" might help solve this issue if it is a new release of ' + runtime) } function getTarget (abi, runtime) { if (abi && abi !== String(Number(abi))) return abi if (!runtime) runtime = 'node' if (runtime === 'node' && !abi) return process.versions.node var match = allTargets .filter(function (t) { return t.abi === abi && t.runtime === runtime }) .map(function (t) { return t.target }) if (match.length) { var betaSeparatorIndex = match[0].indexOf("-") return betaSeparatorIndex > -1 ? match[0].substring(0, betaSeparatorIndex) : match[0] } throw new Error('Could not detect target for abi ' + abi + ' and runtime ' + runtime) } function sortByTargetFn (a, b) { var abiComp = Number(a.abi) - Number(b.abi) if (abiComp !== 0) return abiComp if (a.target < b.target) return -1 if (a.target > b.target) return 1 return 0 } function loadGeneratedTargets () { var registry = require('./abi_registry.json') var targets = { supported: [], additional: [], future: [] } registry.forEach(function (item) { var target = { runtime: item.runtime, target: item.target, abi: item.abi } if (item.lts) { var startDate = new Date(Date.parse(item.lts[0])) var endDate = new Date(Date.parse(item.lts[1])) var currentDate = new Date() target.lts = startDate < currentDate && currentDate < endDate } else { target.lts = false } if (target.runtime === 'node-webkit') { targets.additional.push(target) } else if (item.future) { targets.future.push(target) } else { targets.supported.push(target) } }) targets.supported.sort(sortByTargetFn) targets.additional.sort(sortByTargetFn) targets.future.sort(sortByTargetFn) return targets } var generatedTargets = loadGeneratedTargets() var supportedTargets = [ {runtime: 'node', target: '5.0.0', abi: '47', lts: false}, {runtime: 'node', target: '6.0.0', abi: '48', lts: false}, {runtime: 'node', target: '7.0.0', abi: '51', lts: false}, {runtime: 'node', target: '8.0.0', abi: '57', lts: false}, {runtime: 'node', target: '9.0.0', abi: '59', lts: false}, {runtime: 'node', target: '10.0.0', abi: '64', lts: new Date(2018, 10, 1) < new Date() && new Date() < new Date(2020, 4, 31)}, {runtime: 'electron', target: '0.36.0', abi: '47', lts: false}, {runtime: 'electron', target: '1.1.0', abi: '48', lts: false}, {runtime: 'electron', target: '1.3.0', abi: '49', lts: false}, {runtime: 'electron', target: '1.4.0', abi: '50', lts: false}, {runtime: 'electron', target: '1.5.0', abi: '51', lts: false}, {runtime: 'electron', target: '1.6.0', abi: '53', lts: false}, {runtime: 'electron', target: '1.7.0', abi: '54', lts: false}, {runtime: 'electron', target: '1.8.0', abi: '57', lts: false}, {runtime: 'electron', target: '2.0.0', abi: '57', lts: false}, {runtime: 'electron', target: '3.0.0', abi: '64', lts: false}, {runtime: 'electron', target: '4.0.0', abi: '64', lts: false}, {runtime: 'electron', target: '4.0.4', abi: '69', lts: false} ] supportedTargets.push.apply(supportedTargets, generatedTargets.supported) var additionalTargets = [ {runtime: 'node-webkit', target: '0.13.0', abi: '47', lts: false}, {runtime: 'node-webkit', target: '0.15.0', abi: '48', lts: false}, {runtime: 'node-webkit', target: '0.18.3', abi: '51', lts: false}, {runtime: 'node-webkit', target: '0.23.0', abi: '57', lts: false}, {runtime: 'node-webkit', target: '0.26.5', abi: '59', lts: false} ] additionalTargets.push.apply(additionalTargets, generatedTargets.additional) var deprecatedTargets = [ {runtime: 'node', target: '0.2.0', abi: '1', lts: false}, {runtime: 'node', target: '0.9.1', abi: '0x000A', lts: false}, {runtime: 'node', target: '0.9.9', abi: '0x000B', lts: false}, {runtime: 'node', target: '0.10.4', abi: '11', lts: false}, {runtime: 'node', target: '0.11.0', abi: '0x000C', lts: false}, {runtime: 'node', target: '0.11.8', abi: '13', lts: false}, {runtime: 'node', target: '0.11.11', abi: '14', lts: false}, {runtime: 'node', target: '1.0.0', abi: '42', lts: false}, {runtime: 'node', target: '1.1.0', abi: '43', lts: false}, {runtime: 'node', target: '2.0.0', abi: '44', lts: false}, {runtime: 'node', target: '3.0.0', abi: '45', lts: false}, {runtime: 'node', target: '4.0.0', abi: '46', lts: false}, {runtime: 'electron', target: '0.30.0', abi: '44', lts: false}, {runtime: 'electron', target: '0.31.0', abi: '45', lts: false}, {runtime: 'electron', target: '0.33.0', abi: '46', lts: false} ] var futureTargets = generatedTargets.future var allTargets = deprecatedTargets .concat(supportedTargets) .concat(additionalTargets) .concat(futureTargets) exports.getAbi = getAbi exports.getTarget = getTarget exports.deprecatedTargets = deprecatedTargets exports.supportedTargets = supportedTargets exports.additionalTargets = additionalTargets exports.futureTargets = futureTargets exports.allTargets = allTargets exports._getNextTarget = getNextTarget MIT License Copyright (c) 2016 Lukas Geiger Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "node-abi", "version": "3.8.0", "description": "Get the Node ABI for a given target and runtime, and vice versa.", "main": "index.js", "scripts": { "semantic-release": "semantic-release", "test": "tape test/index.js", "update-abi-registry": "node --unhandled-rejections=strict scripts/update-abi-registry.js" }, "repository": { "type": "git", "url": "https://github.com/lgeiger/node-abi.git" }, "keywords": [ "node", "electron", "node_module_version", "abi", "v8" ], "author": "Lukas Geiger", "license": "MIT", "bugs": { "url": "https://github.com/lgeiger/node-abi/issues" }, "homepage": "https://github.com/lgeiger/node-abi#readme", "devDependencies": { "@continuous-auth/semantic-release-npm": "^2.0.0", "got": "^11.8.2", "tape": "^5.3.1" }, "dependencies": { "semver": "^7.3.5" }, "engines": { "node": ">=10" } } const got = require('got') const path = require('path') const semver = require('semver') const { writeFile } = require('fs').promises async function getJSONFromCDN (urlPath) { const response = await got(`https://cdn.jsdelivr.net/gh/${urlPath}`) return JSON.parse(response.body) } async function fetchElectronReleases () { const response = await got(`https://electronjs.org/headers/index.json`) return JSON.parse(response.body) } async function fetchNodeVersions () { const schedule = await getJSONFromCDN('nodejs/Release/schedule.json') const versions = {} for (const [majorVersion, metadata] of Object.entries(schedule)) { if (majorVersion.startsWith('v0')) { continue } const version = `${majorVersion.slice(1)}.0.0` const lts = metadata.hasOwnProperty('lts') ? [metadata.lts, metadata.maintenance] : false versions[version] = { runtime: 'node', target: version, lts: lts, future: new Date(Date.parse(metadata.start)) > new Date() } } return versions } async function fetchAbiVersions () { return (await getJSONFromCDN('nodejs/node/doc/abi_version_registry.json')) .NODE_MODULE_VERSION .filter(({ modules }) => modules > 66) } function electronReleasesToTargets (releases) { const versions = releases.map(({ version }) => version) const versionsByModules = releases .filter(release => Number(release.modules) >= 70) .map(({ version, modules }) => ({ version, modules, })) .filter(({ version }) => !version.includes('nightly')) .sort((a, b) => Number(a.modules) - Number(b.modules)) .reduce( (acc, { modules, version }) => ({ ...acc, [`${version.split('.')[0]}-${modules}`]: { version, modules, } }), {} ) return Object.entries(versionsByModules) .map( ([major, {version, modules}]) => ({ abi: modules, future: !versions.find( v => { const major = version.split(".")[0] return semver.satisfies( v, /^[0-9]/.test(major) ? `>= ${major}` : major ) } ), lts: false, runtime: 'electron', target: version }) ) } function nodeVersionsToTargets (abiVersions, nodeVersions) { return Object.values( abiVersions .filter(({ runtime }) => runtime === 'node') .reduce( (acc, abiVersion) => { const { version: nodeVersion } = semver.coerce(abiVersion.versions) return { [nodeVersion]: { ...nodeVersions[nodeVersion], abi: abiVersion.modules.toString(), }, ...acc, }; }, {} ) ) } async function main () { const nodeVersions = await fetchNodeVersions() const abiVersions = await fetchAbiVersions() const electronReleases = await fetchElectronReleases() const electronTargets = electronReleasesToTargets(electronReleases) const nodeTargets = nodeVersionsToTargets(abiVersions, nodeVersions) const supportedTargets = [ ...nodeTargets, ...electronTargets, ] await writeFile(path.resolve(__dirname, '..', 'abi_registry.json'), JSON.stringify(supportedTargets, null, 2)) } main() // just pre-load all the stuff that index.js lazily exports const internalRe = require('./internal/re') module.exports = { re: internalRe.re, src: internalRe.src, tokens: internalRe.t, SEMVER_SPEC_VERSION: require('./internal/constants').SEMVER_SPEC_VERSION, SemVer: require('./classes/semver'), compareIdentifiers: require('./internal/identifiers').compareIdentifiers, rcompareIdentifiers: require('./internal/identifiers').rcompareIdentifiers, parse: require('./functions/parse'), valid: require('./functions/valid'), clean: require('./functions/clean'), inc: require('./functions/inc'), diff: require('./functions/diff'), major: require('./functions/major'), minor: require('./functions/minor'), patch: require('./functions/patch'), prerelease: require('./functions/prerelease'), compare: require('./functions/compare'), rcompare: require('./functions/rcompare'), compareLoose: require('./functions/compare-loose'), compareBuild: require('./functions/compare-build'), sort: require('./functions/sort'), rsort: require('./functions/rsort'), gt: require('./functions/gt'), lt: require('./functions/lt'), eq: require('./functions/eq'), neq: require('./functions/neq'), gte: require('./functions/gte'), lte: require('./functions/lte'), cmp: require('./functions/cmp'), coerce: require('./functions/coerce'), Comparator: require('./classes/comparator'), Range: require('./classes/range'), satisfies: require('./functions/satisfies'), toComparators: require('./ranges/to-comparators'), maxSatisfying: require('./ranges/max-satisfying'), minSatisfying: require('./ranges/min-satisfying'), minVersion: require('./ranges/min-version'), validRange: require('./ranges/valid'), outside: require('./ranges/outside'), gtr: require('./ranges/gtr'), ltr: require('./ranges/ltr'), intersects: require('./ranges/intersects'), simplifyRange: require('./ranges/simplify'), subset: require('./ranges/subset'), } The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "semver", "version": "7.3.5", "description": "The semantic version parser used by npm.", "main": "index.js", "scripts": { "test": "tap", "snap": "tap", "preversion": "npm test", "postversion": "npm publish", "postpublish": "git push origin --follow-tags" }, "devDependencies": { "tap": "^14.10.7" }, "license": "ISC", "repository": "https://github.com/npm/node-semver", "bin": { "semver": "bin/semver.js" }, "files": [ "bin/**/*.js", "range.bnf", "classes/**/*.js", "functions/**/*.js", "internal/**/*.js", "ranges/**/*.js", "index.js", "preload.js" ], "tap": { "check-coverage": true, "coverage-map": "map.js" }, "engines": { "node": ">=10" }, "dependencies": { "lru-cache": "^6.0.0" } } // XXX remove in v8 or beyond module.exports = require('./index.js') range-set ::= range ( logical-or range ) * logical-or ::= ( ' ' ) * '||' ( ' ' ) * range ::= hyphen | simple ( ' ' simple ) * | '' hyphen ::= partial ' - ' partial simple ::= primitive | partial | tilde | caret primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? xr ::= 'x' | 'X' | '*' | nr nr ::= '0' | [1-9] ( [0-9] ) * tilde ::= '~' partial caret ::= '^' partial qualifier ::= ( '-' pre )? ( '+' build )? pre ::= parts build ::= parts parts ::= part ( '.' part ) * part ::= nr | [-0-9A-Za-z]+ #!/usr/bin/env node // Standalone semver comparison program. // Exits successfully and prints matching version(s) if // any supplied version is valid and passes all tests. const argv = process.argv.slice(2) let versions = [] const range = [] let inc = null const version = require('../package.json').version let loose = false let includePrerelease = false let coerce = false let rtl = false let identifier const semver = require('../') let reverse = false const options = {} const main = () => { if (!argv.length) return help() while (argv.length) { let a = argv.shift() const indexOfEqualSign = a.indexOf('=') if (indexOfEqualSign !== -1) { a = a.slice(0, indexOfEqualSign) argv.unshift(a.slice(indexOfEqualSign + 1)) } switch (a) { case '-rv': case '-rev': case '--rev': case '--reverse': reverse = true break case '-l': case '--loose': loose = true break case '-p': case '--include-prerelease': includePrerelease = true break case '-v': case '--version': versions.push(argv.shift()) break case '-i': case '--inc': case '--increment': switch (argv[0]) { case 'major': case 'minor': case 'patch': case 'prerelease': case 'premajor': case 'preminor': case 'prepatch': inc = argv.shift() break default: inc = 'patch' break } break case '--preid': identifier = argv.shift() break case '-r': case '--range': range.push(argv.shift()) break case '-c': case '--coerce': coerce = true break case '--rtl': rtl = true break case '--ltr': rtl = false break case '-h': case '--help': case '-?': return help() default: versions.push(a) break } } const options = { loose: loose, includePrerelease: includePrerelease, rtl: rtl } versions = versions.map((v) => { return coerce ? (semver.coerce(v, options) || { version: v }).version : v }).filter((v) => { return semver.valid(v) }) if (!versions.length) return fail() if (inc && (versions.length !== 1 || range.length)) { return failInc() } for (let i = 0, l = range.length; i < l; i++) { versions = versions.filter((v) => { return semver.satisfies(v, range[i], options) }) if (!versions.length) return fail() } return success(versions) } const failInc = () => { console.error('--inc can only be used on a single version with no range') fail() } const fail = () => process.exit(1) const success = () => { const compare = reverse ? 'rcompare' : 'compare' versions.sort((a, b) => { return semver[compare](a, b, options) }).map((v) => { return semver.clean(v, options) }).map((v) => { return inc ? semver.inc(v, inc, options, identifier) : v }).forEach((v, i, _) => { console.log(v) }) } const help = () => console.log( `SemVer ${version} A JavaScript implementation of the https://semver.org/ specification Copyright Isaac Z. Schlueter Usage: semver [options] [ [...]] Prints valid versions sorted by SemVer precedence Options: -r --range Print versions that match the specified range. -i --increment [] Increment a version by the specified level. Level can be one of: major, minor, patch, premajor, preminor, prepatch, or prerelease. Default level is 'patch'. Only one version may be specified. --preid Identifier to be used to prefix premajor, preminor, prepatch or prerelease version increments. -l --loose Interpret versions and ranges loosely -p --include-prerelease Always include prerelease versions in range matching -c --coerce Coerce a string into SemVer if possible (does not imply --loose) --rtl Coerce version strings right to left --ltr Coerce version strings left to right (default) Program exits successfully if any valid version satisfies all supplied ranges, and prints all satisfying versions. If no satisfying versions are found, then exits failure. Versions are printed in ascending order, so supplying multiple versions to the utility will just sort them.`) main() const ANY = Symbol('SemVer ANY') // hoisted class for cyclic dependency class Comparator { static get ANY () { return ANY } constructor (comp, options) { options = parseOptions(options) if (comp instanceof Comparator) { if (comp.loose === !!options.loose) { return comp } else { comp = comp.value } } debug('comparator', comp, options) this.options = options this.loose = !!options.loose this.parse(comp) if (this.semver === ANY) { this.value = '' } else { this.value = this.operator + this.semver.version } debug('comp', this) } parse (comp) { const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] const m = comp.match(r) if (!m) { throw new TypeError(`Invalid comparator: ${comp}`) } this.operator = m[1] !== undefined ? m[1] : '' if (this.operator === '=') { this.operator = '' } // if it literally is just '>' or '' then allow anything. if (!m[2]) { this.semver = ANY } else { this.semver = new SemVer(m[2], this.options.loose) } } toString () { return this.value } test (version) { debug('Comparator.test', version, this.options.loose) if (this.semver === ANY || version === ANY) { return true } if (typeof version === 'string') { try { version = new SemVer(version, this.options) } catch (er) { return false } } return cmp(version, this.operator, this.semver, this.options) } intersects (comp, options) { if (!(comp instanceof Comparator)) { throw new TypeError('a Comparator is required') } if (!options || typeof options !== 'object') { options = { loose: !!options, includePrerelease: false } } if (this.operator === '') { if (this.value === '') { return true } return new Range(comp.value, options).test(this.value) } else if (comp.operator === '') { if (comp.value === '') { return true } return new Range(this.value, options).test(comp.semver) } const sameDirectionIncreasing = (this.operator === '>=' || this.operator === '>') && (comp.operator === '>=' || comp.operator === '>') const sameDirectionDecreasing = (this.operator === '<=' || this.operator === '<') && (comp.operator === '<=' || comp.operator === '<') const sameSemVer = this.semver.version === comp.semver.version const differentDirectionsInclusive = (this.operator === '>=' || this.operator === '<=') && (comp.operator === '>=' || comp.operator === '<=') const oppositeDirectionsLessThan = cmp(this.semver, '<', comp.semver, options) && (this.operator === '>=' || this.operator === '>') && (comp.operator === '<=' || comp.operator === '<') const oppositeDirectionsGreaterThan = cmp(this.semver, '>', comp.semver, options) && (this.operator === '<=' || this.operator === '<') && (comp.operator === '>=' || comp.operator === '>') return ( sameDirectionIncreasing || sameDirectionDecreasing || (sameSemVer && differentDirectionsInclusive) || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan ) } } module.exports = Comparator const parseOptions = require('../internal/parse-options') const {re, t} = require('../internal/re') const cmp = require('../functions/cmp') const debug = require('../internal/debug') const SemVer = require('./semver') const Range = require('./range') module.exports = { SemVer: require('./semver.js'), Range: require('./range.js'), Comparator: require('./comparator.js') } // hoisted class for cyclic dependency class Range { constructor (range, options) { options = parseOptions(options) if (range instanceof Range) { if ( range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease ) { return range } else { return new Range(range.raw, options) } } if (range instanceof Comparator) { // just put it in the set and return this.raw = range.value this.set = [[range]] this.format() return this } this.options = options this.loose = !!options.loose this.includePrerelease = !!options.includePrerelease // First, split based on boolean or || this.raw = range this.set = range .split(/\s*\|\|\s*/) // map the range to a 2d array of comparators .map(range => this.parseRange(range.trim())) // throw out any comparator lists that are empty // this generally means that it was not a valid range, which is allowed // in loose mode, but will still throw if the WHOLE range is invalid. .filter(c => c.length) if (!this.set.length) { throw new TypeError(`Invalid SemVer Range: ${range}`) } // if we have any that are not the null set, throw out null sets. if (this.set.length > 1) { // keep the first one, in case they're all null sets const first = this.set[0] this.set = this.set.filter(c => !isNullSet(c[0])) if (this.set.length === 0) this.set = [first] else if (this.set.length > 1) { // if we have any that are *, then the range is just * for (const c of this.set) { if (c.length === 1 && isAny(c[0])) { this.set = [c] break } } } } this.format() } format () { this.range = this.set .map((comps) => { return comps.join(' ').trim() }) .join('||') .trim() return this.range } toString () { return this.range } parseRange (range) { range = range.trim() // memoize range parsing for performance. // this is a very hot path, and fully deterministic. const memoOpts = Object.keys(this.options).join(',') const memoKey = `parseRange:${memoOpts}:${range}` const cached = cache.get(memoKey) if (cached) return cached const loose = this.options.loose // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) debug('hyphen replace', range) // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) debug('comparator trim', range, re[t.COMPARATORTRIM]) // `~ 1.2.3` => `~1.2.3` range = range.replace(re[t.TILDETRIM], tildeTrimReplace) // `^ 1.2.3` => `^1.2.3` range = range.replace(re[t.CARETTRIM], caretTrimReplace) // normalize spaces range = range.split(/\s+/).join(' ') // At this point, the range is completely trimmed and // ready to be split into comparators. const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] const rangeList = range .split(' ') .map(comp => parseComparator(comp, this.options)) .join(' ') .split(/\s+/) // >=0.0.0 is equivalent to * .map(comp => replaceGTE0(comp, this.options)) // in loose mode, throw out any that are not valid comparators .filter(this.options.loose ? comp => !!comp.match(compRe) : () => true) .map(comp => new Comparator(comp, this.options)) // if any comparators are the null set, then replace with JUST null set // if more than one comparator, remove any * comparators // also, don't include the same comparator more than once const l = rangeList.length const rangeMap = new Map() for (const comp of rangeList) { if (isNullSet(comp)) return [comp] rangeMap.set(comp.value, comp) } if (rangeMap.size > 1 && rangeMap.has('')) rangeMap.delete('') const result = [...rangeMap.values()] cache.set(memoKey, result) return result } intersects (range, options) { if (!(range instanceof Range)) { throw new TypeError('a Range is required') } return this.set.some((thisComparators) => { return ( isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => { return ( isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => { return rangeComparators.every((rangeComparator) => { return thisComparator.intersects(rangeComparator, options) }) }) ) }) ) }) } // if ANY of the sets match ALL of its comparators, then pass test (version) { if (!version) { return false } if (typeof version === 'string') { try { version = new SemVer(version, this.options) } catch (er) { return false } } for (let i = 0; i < this.set.length; i++) { if (testSet(this.set[i], version, this.options)) { return true } } return false } } module.exports = Range const LRU = require('lru-cache') const cache = new LRU({ max: 1000 }) const parseOptions = require('../internal/parse-options') const Comparator = require('./comparator') const debug = require('../internal/debug') const SemVer = require('./semver') const { re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require('../internal/re') const isNullSet = c => c.value === '<0.0.0-0' const isAny = c => c.value === '' // take a set of comparators and determine whether there // exists a version which can satisfy it const isSatisfiable = (comparators, options) => { let result = true const remainingComparators = comparators.slice() let testComparator = remainingComparators.pop() while (result && remainingComparators.length) { result = remainingComparators.every((otherComparator) => { return testComparator.intersects(otherComparator, options) }) testComparator = remainingComparators.pop() } return result } // comprised of xranges, tildes, stars, and gtlt's at this point. // already replaced the hyphen ranges // turn into a set of JUST comparators. const parseComparator = (comp, options) => { debug('comp', comp, options) comp = replaceCarets(comp, options) debug('caret', comp) comp = replaceTildes(comp, options) debug('tildes', comp) comp = replaceXRanges(comp, options) debug('xrange', comp) comp = replaceStars(comp, options) debug('stars', comp) return comp } const isX = id => !id || id.toLowerCase() === 'x' || id === '*' // ~, ~> --> * (any, kinda silly) // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 const replaceTildes = (comp, options) => comp.trim().split(/\s+/).map((comp) => { return replaceTilde(comp, options) }).join(' ') const replaceTilde = (comp, options) => { const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] return comp.replace(r, (_, M, m, p, pr) => { debug('tilde', comp, _, M, m, p, pr) let ret if (isX(M)) { ret = '' } else if (isX(m)) { ret = `>=${M}.0.0 <${+M + 1}.0.0-0` } else if (isX(p)) { // ~1.2 == >=1.2.0 <1.3.0-0 ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0` } else if (pr) { debug('replaceTilde pr', pr) ret = `>=${M}.${m}.${p}-${pr } <${M}.${+m + 1}.0-0` } else { // ~1.2.3 == >=1.2.3 <1.3.0-0 ret = `>=${M}.${m}.${p } <${M}.${+m + 1}.0-0` } debug('tilde return', ret) return ret }) } // ^ --> * (any, kinda silly) // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 // ^1.2.3 --> >=1.2.3 <2.0.0-0 // ^1.2.0 --> >=1.2.0 <2.0.0-0 const replaceCarets = (comp, options) => comp.trim().split(/\s+/).map((comp) => { return replaceCaret(comp, options) }).join(' ') const replaceCaret = (comp, options) => { debug('caret', comp, options) const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] const z = options.includePrerelease ? '-0' : '' return comp.replace(r, (_, M, m, p, pr) => { debug('caret', comp, _, M, m, p, pr) let ret if (isX(M)) { ret = '' } else if (isX(m)) { ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0` } else if (isX(p)) { if (M === '0') { ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` } else { ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0` } } else if (pr) { debug('replaceCaret pr', pr) if (M === '0') { if (m === '0') { ret = `>=${M}.${m}.${p}-${pr } <${M}.${m}.${+p + 1}-0` } else { ret = `>=${M}.${m}.${p}-${pr } <${M}.${+m + 1}.0-0` } } else { ret = `>=${M}.${m}.${p}-${pr } <${+M + 1}.0.0-0` } } else { debug('no pr') if (M === '0') { if (m === '0') { ret = `>=${M}.${m}.${p }${z} <${M}.${m}.${+p + 1}-0` } else { ret = `>=${M}.${m}.${p }${z} <${M}.${+m + 1}.0-0` } } else { ret = `>=${M}.${m}.${p } <${+M + 1}.0.0-0` } } debug('caret return', ret) return ret }) } const replaceXRanges = (comp, options) => { debug('replaceXRanges', comp, options) return comp.split(/\s+/).map((comp) => { return replaceXRange(comp, options) }).join(' ') } const replaceXRange = (comp, options) => { comp = comp.trim() const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] return comp.replace(r, (ret, gtlt, M, m, p, pr) => { debug('xRange', comp, ret, gtlt, M, m, p, pr) const xM = isX(M) const xm = xM || isX(m) const xp = xm || isX(p) const anyX = xp if (gtlt === '=' && anyX) { gtlt = '' } // if we're including prereleases in the match, then we need // to fix this to -0, the lowest possible prerelease value pr = options.includePrerelease ? '-0' : '' if (xM) { if (gtlt === '>' || gtlt === '<') { // nothing is allowed ret = '<0.0.0-0' } else { // nothing is forbidden ret = '*' } } else if (gtlt && anyX) { // we know patch is an x, because we have any x at all. // replace X with 0 if (xm) { m = 0 } p = 0 if (gtlt === '>') { // >1 => >=2.0.0 // >1.2 => >=1.3.0 gtlt = '>=' if (xm) { M = +M + 1 m = 0 p = 0 } else { m = +m + 1 p = 0 } } else if (gtlt === '<=') { // <=0.7.x is actually <0.8.0, since any 0.7.x should // pass. Similarly, <=7.x is actually <8.0.0, etc. gtlt = '<' if (xm) { M = +M + 1 } else { m = +m + 1 } } if (gtlt === '<') pr = '-0' ret = `${gtlt + M}.${m}.${p}${pr}` } else if (xm) { ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0` } else if (xp) { ret = `>=${M}.${m}.0${pr } <${M}.${+m + 1}.0-0` } debug('xRange return', ret) return ret }) } // Because * is AND-ed with everything else in the comparator, // and '' means "any version", just remove the *s entirely. const replaceStars = (comp, options) => { debug('replaceStars', comp, options) // Looseness is ignored here. star is always as loose as it gets! return comp.trim().replace(re[t.STAR], '') } const replaceGTE0 = (comp, options) => { debug('replaceGTE0', comp, options) return comp.trim() .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '') } // This function is passed to string.replace(re[t.HYPHENRANGE]) // M, m, patch, prerelease, build // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 // 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do // 1.2 - 3.4 => >=1.2.0 <3.5.0-0 const hyphenReplace = incPr => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) => { if (isX(fM)) { from = '' } else if (isX(fm)) { from = `>=${fM}.0.0${incPr ? '-0' : ''}` } else if (isX(fp)) { from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}` } else if (fpr) { from = `>=${from}` } else { from = `>=${from}${incPr ? '-0' : ''}` } if (isX(tM)) { to = '' } else if (isX(tm)) { to = `<${+tM + 1}.0.0-0` } else if (isX(tp)) { to = `<${tM}.${+tm + 1}.0-0` } else if (tpr) { to = `<=${tM}.${tm}.${tp}-${tpr}` } else if (incPr) { to = `<${tM}.${tm}.${+tp + 1}-0` } else { to = `<=${to}` } return (`${from} ${to}`).trim() } const testSet = (set, version, options) => { for (let i = 0; i < set.length; i++) { if (!set[i].test(version)) { return false } } if (version.prerelease.length && !options.includePrerelease) { // Find the set of versions that are allowed to have prereleases // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 // That should allow `1.2.3-pr.2` to pass. // However, `1.2.4-alpha.notready` should NOT be allowed, // even though it's within the range set by the comparators. for (let i = 0; i < set.length; i++) { debug(set[i].semver) if (set[i].semver === Comparator.ANY) { continue } if (set[i].semver.prerelease.length > 0) { const allowed = set[i].semver if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { return true } } } // Version has a -pre, but it's not one of the ones we like. return false } return true } const debug = require('../internal/debug') const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants') const { re, t } = require('../internal/re') const parseOptions = require('../internal/parse-options') const { compareIdentifiers } = require('../internal/identifiers') class SemVer { constructor (version, options) { options = parseOptions(options) if (version instanceof SemVer) { if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) { return version } else { version = version.version } } else if (typeof version !== 'string') { throw new TypeError(`Invalid Version: ${version}`) } if (version.length > MAX_LENGTH) { throw new TypeError( `version is longer than ${MAX_LENGTH} characters` ) } debug('SemVer', version, options) this.options = options this.loose = !!options.loose // this isn't actually relevant for versions, but keep it so that we // don't run into trouble passing this.options around. this.includePrerelease = !!options.includePrerelease const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) if (!m) { throw new TypeError(`Invalid Version: ${version}`) } this.raw = version // these are actually numbers this.major = +m[1] this.minor = +m[2] this.patch = +m[3] if (this.major > MAX_SAFE_INTEGER || this.major < 0) { throw new TypeError('Invalid major version') } if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { throw new TypeError('Invalid minor version') } if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { throw new TypeError('Invalid patch version') } // numberify any prerelease numeric ids if (!m[4]) { this.prerelease = [] } else { this.prerelease = m[4].split('.').map((id) => { if (/^[0-9]+$/.test(id)) { const num = +id if (num >= 0 && num < MAX_SAFE_INTEGER) { return num } } return id }) } this.build = m[5] ? m[5].split('.') : [] this.format() } format () { this.version = `${this.major}.${this.minor}.${this.patch}` if (this.prerelease.length) { this.version += `-${this.prerelease.join('.')}` } return this.version } toString () { return this.version } compare (other) { debug('SemVer.compare', this.version, this.options, other) if (!(other instanceof SemVer)) { if (typeof other === 'string' && other === this.version) { return 0 } other = new SemVer(other, this.options) } if (other.version === this.version) { return 0 } return this.compareMain(other) || this.comparePre(other) } compareMain (other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } return ( compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch) ) } comparePre (other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } // NOT having a prerelease is > having one if (this.prerelease.length && !other.prerelease.length) { return -1 } else if (!this.prerelease.length && other.prerelease.length) { return 1 } else if (!this.prerelease.length && !other.prerelease.length) { return 0 } let i = 0 do { const a = this.prerelease[i] const b = other.prerelease[i] debug('prerelease compare', i, a, b) if (a === undefined && b === undefined) { return 0 } else if (b === undefined) { return 1 } else if (a === undefined) { return -1 } else if (a === b) { continue } else { return compareIdentifiers(a, b) } } while (++i) } compareBuild (other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } let i = 0 do { const a = this.build[i] const b = other.build[i] debug('prerelease compare', i, a, b) if (a === undefined && b === undefined) { return 0 } else if (b === undefined) { return 1 } else if (a === undefined) { return -1 } else if (a === b) { continue } else { return compareIdentifiers(a, b) } } while (++i) } // preminor will bump the version up to the next minor release, and immediately // down to pre-release. premajor and prepatch work the same way. inc (release, identifier) { switch (release) { case 'premajor': this.prerelease.length = 0 this.patch = 0 this.minor = 0 this.major++ this.inc('pre', identifier) break case 'preminor': this.prerelease.length = 0 this.patch = 0 this.minor++ this.inc('pre', identifier) break case 'prepatch': // If this is already a prerelease, it will bump to the next version // drop any prereleases that might already exist, since they are not // relevant at this point. this.prerelease.length = 0 this.inc('patch', identifier) this.inc('pre', identifier) break // If the input is a non-prerelease version, this acts the same as // prepatch. case 'prerelease': if (this.prerelease.length === 0) { this.inc('patch', identifier) } this.inc('pre', identifier) break case 'major': // If this is a pre-major version, bump up to the same major version. // Otherwise increment major. // 1.0.0-5 bumps to 1.0.0 // 1.1.0 bumps to 2.0.0 if ( this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0 ) { this.major++ } this.minor = 0 this.patch = 0 this.prerelease = [] break case 'minor': // If this is a pre-minor version, bump up to the same minor version. // Otherwise increment minor. // 1.2.0-5 bumps to 1.2.0 // 1.2.1 bumps to 1.3.0 if (this.patch !== 0 || this.prerelease.length === 0) { this.minor++ } this.patch = 0 this.prerelease = [] break case 'patch': // If this is not a pre-release version, it will increment the patch. // If it is a pre-release it will bump up to the same patch version. // 1.2.0-5 patches to 1.2.0 // 1.2.0 patches to 1.2.1 if (this.prerelease.length === 0) { this.patch++ } this.prerelease = [] break // This probably shouldn't be used publicly. // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. case 'pre': if (this.prerelease.length === 0) { this.prerelease = [0] } else { let i = this.prerelease.length while (--i >= 0) { if (typeof this.prerelease[i] === 'number') { this.prerelease[i]++ i = -2 } } if (i === -1) { // didn't increment anything this.prerelease.push(0) } } if (identifier) { // 1.2.0-beta.1 bumps to 1.2.0-beta.2, // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 if (this.prerelease[0] === identifier) { if (isNaN(this.prerelease[1])) { this.prerelease = [identifier, 0] } } else { this.prerelease = [identifier, 0] } } break default: throw new Error(`invalid increment argument: ${release}`) } this.format() this.raw = this.version return this } } module.exports = SemVer const parse = require('./parse') const clean = (version, options) => { const s = parse(version.trim().replace(/^[=v]+/, ''), options) return s ? s.version : null } module.exports = clean const eq = require('./eq') const neq = require('./neq') const gt = require('./gt') const gte = require('./gte') const lt = require('./lt') const lte = require('./lte') const cmp = (a, op, b, loose) => { switch (op) { case '===': if (typeof a === 'object') a = a.version if (typeof b === 'object') b = b.version return a === b case '!==': if (typeof a === 'object') a = a.version if (typeof b === 'object') b = b.version return a !== b case '': case '=': case '==': return eq(a, b, loose) case '!=': return neq(a, b, loose) case '>': return gt(a, b, loose) case '>=': return gte(a, b, loose) case '<': return lt(a, b, loose) case '<=': return lte(a, b, loose) default: throw new TypeError(`Invalid operator: ${op}`) } } module.exports = cmp const SemVer = require('../classes/semver') const parse = require('./parse') const {re, t} = require('../internal/re') const coerce = (version, options) => { if (version instanceof SemVer) { return version } if (typeof version === 'number') { version = String(version) } if (typeof version !== 'string') { return null } options = options || {} let match = null if (!options.rtl) { match = version.match(re[t.COERCE]) } else { // Find the right-most coercible string that does not share // a terminus with a more left-ward coercible string. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' // // Walk through the string checking with a /g regexp // Manually set the index so as to pick up overlapping matches. // Stop when we get a match that ends at the string end, since no // coercible string can be more right-ward without the same terminus. let next while ((next = re[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length) ) { if (!match || next.index + next[0].length !== match.index + match[0].length) { match = next } re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length } // leave it in a clean state re[t.COERCERTL].lastIndex = -1 } if (match === null) return null return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options) } module.exports = coerce const SemVer = require('../classes/semver') const compareBuild = (a, b, loose) => { const versionA = new SemVer(a, loose) const versionB = new SemVer(b, loose) return versionA.compare(versionB) || versionA.compareBuild(versionB) } module.exports = compareBuild const compare = require('./compare') const compareLoose = (a, b) => compare(a, b, true) module.exports = compareLoose const SemVer = require('../classes/semver') const compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose)) module.exports = compare const parse = require('./parse') const eq = require('./eq') const diff = (version1, version2) => { if (eq(version1, version2)) { return null } else { const v1 = parse(version1) const v2 = parse(version2) const hasPre = v1.prerelease.length || v2.prerelease.length const prefix = hasPre ? 'pre' : '' const defaultResult = hasPre ? 'prerelease' : '' for (const key in v1) { if (key === 'major' || key === 'minor' || key === 'patch') { if (v1[key] !== v2[key]) { return prefix + key } } } return defaultResult // may be undefined } } module.exports = diff const compare = require('./compare') const eq = (a, b, loose) => compare(a, b, loose) === 0 module.exports = eq const compare = require('./compare') const gt = (a, b, loose) => compare(a, b, loose) > 0 module.exports = gt const compare = require('./compare') const gte = (a, b, loose) => compare(a, b, loose) >= 0 module.exports = gte const SemVer = require('../classes/semver') const inc = (version, release, options, identifier) => { if (typeof (options) === 'string') { identifier = options options = undefined } try { return new SemVer(version, options).inc(release, identifier).version } catch (er) { return null } } module.exports = inc const compare = require('./compare') const lt = (a, b, loose) => compare(a, b, loose) < 0 module.exports = lt const compare = require('./compare') const lte = (a, b, loose) => compare(a, b, loose) <= 0 module.exports = lte const SemVer = require('../classes/semver') const major = (a, loose) => new SemVer(a, loose).major module.exports = major const SemVer = require('../classes/semver') const minor = (a, loose) => new SemVer(a, loose).minor module.exports = minor const compare = require('./compare') const neq = (a, b, loose) => compare(a, b, loose) !== 0 module.exports = neq const {MAX_LENGTH} = require('../internal/constants') const { re, t } = require('../internal/re') const SemVer = require('../classes/semver') const parseOptions = require('../internal/parse-options') const parse = (version, options) => { options = parseOptions(options) if (version instanceof SemVer) { return version } if (typeof version !== 'string') { return null } if (version.length > MAX_LENGTH) { return null } const r = options.loose ? re[t.LOOSE] : re[t.FULL] if (!r.test(version)) { return null } try { return new SemVer(version, options) } catch (er) { return null } } module.exports = parse const SemVer = require('../classes/semver') const patch = (a, loose) => new SemVer(a, loose).patch module.exports = patch const parse = require('./parse') const prerelease = (version, options) => { const parsed = parse(version, options) return (parsed && parsed.prerelease.length) ? parsed.prerelease : null } module.exports = prerelease const compare = require('./compare') const rcompare = (a, b, loose) => compare(b, a, loose) module.exports = rcompare const compareBuild = require('./compare-build') const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)) module.exports = rsort const Range = require('../classes/range') const satisfies = (version, range, options) => { try { range = new Range(range, options) } catch (er) { return false } return range.test(version) } module.exports = satisfies const compareBuild = require('./compare-build') const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)) module.exports = sort const parse = require('./parse') const valid = (version, options) => { const v = parse(version, options) return v ? v.version : null } module.exports = valid // Note: this is the semver.org version of the spec that it implements // Not necessarily the package version of this code. const SEMVER_SPEC_VERSION = '2.0.0' const MAX_LENGTH = 256 const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ 9007199254740991 // Max safe segment length for coercion. const MAX_SAFE_COMPONENT_LENGTH = 16 module.exports = { SEMVER_SPEC_VERSION, MAX_LENGTH, MAX_SAFE_INTEGER, MAX_SAFE_COMPONENT_LENGTH } const debug = ( typeof process === 'object' && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ) ? (...args) => console.error('SEMVER', ...args) : () => {} module.exports = debug const numeric = /^[0-9]+$/ const compareIdentifiers = (a, b) => { const anum = numeric.test(a) const bnum = numeric.test(b) if (anum && bnum) { a = +a b = +b } return a === b ? 0 : (anum && !bnum) ? -1 : (bnum && !anum) ? 1 : a < b ? -1 : 1 } const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a) module.exports = { compareIdentifiers, rcompareIdentifiers } // parse out just the options we care about so we always get a consistent // obj with keys in a consistent order. const opts = ['includePrerelease', 'loose', 'rtl'] const parseOptions = options => !options ? {} : typeof options !== 'object' ? { loose: true } : opts.filter(k => options[k]).reduce((options, k) => { options[k] = true return options }, {}) module.exports = parseOptions const { MAX_SAFE_COMPONENT_LENGTH } = require('./constants') const debug = require('./debug') exports = module.exports = {} // The actual regexps go on exports.re const re = exports.re = [] const src = exports.src = [] const t = exports.t = {} let R = 0 const createToken = (name, value, isGlobal) => { const index = R++ debug(index, value) t[name] = index src[index] = value re[index] = new RegExp(value, isGlobal ? 'g' : undefined) } // The following Regular Expressions can be used for tokenizing, // validating, and parsing SemVer version strings. // ## Numeric Identifier // A single `0`, or a non-zero digit followed by zero or more digits. createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*') createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+') // ## Non-numeric Identifier // Zero or more digits, followed by a letter or hyphen, and then zero or // more letters, digits, or hyphens. createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*') // ## Main Version // Three dot-separated numeric identifiers. createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` + `(${src[t.NUMERICIDENTIFIER]})\\.` + `(${src[t.NUMERICIDENTIFIER]})`) createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + `(${src[t.NUMERICIDENTIFIERLOOSE]})`) // ## Pre-release Version Identifier // A numeric identifier, or a non-numeric identifier. createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER] }|${src[t.NONNUMERICIDENTIFIER]})`) createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE] }|${src[t.NONNUMERICIDENTIFIER]})`) // ## Pre-release Version // Hyphen, followed by one or more dot-separated pre-release version // identifiers. createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER] }(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`) createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE] }(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`) // ## Build Metadata Identifier // Any combination of digits, letters, or hyphens. createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+') // ## Build Metadata // Plus sign, followed by one or more period-separated build metadata // identifiers. createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER] }(?:\\.${src[t.BUILDIDENTIFIER]})*))`) // ## Full Version String // A main version, followed optionally by a pre-release version and // build metadata. // Note that the only major, minor, patch, and pre-release sections of // the version string are capturing groups. The build metadata is not a // capturing group, because it should not ever be used in version // comparison. createToken('FULLPLAIN', `v?${src[t.MAINVERSION] }${src[t.PRERELEASE]}?${ src[t.BUILD]}?`) createToken('FULL', `^${src[t.FULLPLAIN]}$`) // like full, but allows v1.2.3 and =1.2.3, which people do sometimes. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty // common in the npm registry. createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE] }${src[t.PRERELEASELOOSE]}?${ src[t.BUILD]}?`) createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`) createToken('GTLT', '((?:<|>)?=?)') // Something like "2.*" or "1.2.x". // Note that "x.x" is a valid xRange identifer, meaning "any version" // Only the first item is strictly required. createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`) createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`) createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + `(?:${src[t.PRERELEASE]})?${ src[t.BUILD]}?` + `)?)?`) createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:${src[t.PRERELEASELOOSE]})?${ src[t.BUILD]}?` + `)?)?`) createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`) createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`) // Coercion. // Extract anything that could conceivably be a part of a valid semver createToken('COERCE', `${'(^|[^\\d])' + '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + `(?:$|[^\\d])`) createToken('COERCERTL', src[t.COERCE], true) // Tilde ranges. // Meaning is "reasonably at or greater than" createToken('LONETILDE', '(?:~>?)') createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true) exports.tildeTrimReplace = '$1~' createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`) createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`) // Caret ranges. // Meaning is "at least and backwards compatible with" createToken('LONECARET', '(?:\\^)') createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true) exports.caretTrimReplace = '$1^' createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`) createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`) // A simple gt/lt/eq thing, or just "" to indicate "any version" createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`) createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`) // An expression to strip any whitespace between the gtlt and the thing // it modifies, so that `> 1.2.3` ==> `>1.2.3` createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT] }\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true) exports.comparatorTrimReplace = '$1$2$3' // Something like `1.2.3 - 1.2.4` // Note that these all use the loose form, because they'll be // checked against either the strict or loose comparator form // later. createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` + `\\s+-\\s+` + `(${src[t.XRANGEPLAIN]})` + `\\s*$`) createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + `\\s+-\\s+` + `(${src[t.XRANGEPLAINLOOSE]})` + `\\s*$`) // Star ranges basically just allow anything at all. createToken('STAR', '(<|>)?=?\\s*\\*') // >=0.0.0 is like a star createToken('GTE0', '^\\s*>=\\s*0\.0\.0\\s*$') createToken('GTE0PRE', '^\\s*>=\\s*0\.0\.0-0\\s*$') // Determine if version is greater than all the versions possible in the range. const outside = require('./outside') const gtr = (version, range, options) => outside(version, range, '>', options) module.exports = gtr const Range = require('../classes/range') const intersects = (r1, r2, options) => { r1 = new Range(r1, options) r2 = new Range(r2, options) return r1.intersects(r2) } module.exports = intersects const outside = require('./outside') // Determine if version is less than all the versions possible in the range const ltr = (version, range, options) => outside(version, range, '<', options) module.exports = ltr const SemVer = require('../classes/semver') const Range = require('../classes/range') const maxSatisfying = (versions, range, options) => { let max = null let maxSV = null let rangeObj = null try { rangeObj = new Range(range, options) } catch (er) { return null } versions.forEach((v) => { if (rangeObj.test(v)) { // satisfies(v, range, options) if (!max || maxSV.compare(v) === -1) { // compare(max, v, true) max = v maxSV = new SemVer(max, options) } } }) return max } module.exports = maxSatisfying const SemVer = require('../classes/semver') const Range = require('../classes/range') const minSatisfying = (versions, range, options) => { let min = null let minSV = null let rangeObj = null try { rangeObj = new Range(range, options) } catch (er) { return null } versions.forEach((v) => { if (rangeObj.test(v)) { // satisfies(v, range, options) if (!min || minSV.compare(v) === 1) { // compare(min, v, true) min = v minSV = new SemVer(min, options) } } }) return min } module.exports = minSatisfying const SemVer = require('../classes/semver') const Range = require('../classes/range') const gt = require('../functions/gt') const minVersion = (range, loose) => { range = new Range(range, loose) let minver = new SemVer('0.0.0') if (range.test(minver)) { return minver } minver = new SemVer('0.0.0-0') if (range.test(minver)) { return minver } minver = null for (let i = 0; i < range.set.length; ++i) { const comparators = range.set[i] let setMin = null comparators.forEach((comparator) => { // Clone to avoid manipulating the comparator's semver object. const compver = new SemVer(comparator.semver.version) switch (comparator.operator) { case '>': if (compver.prerelease.length === 0) { compver.patch++ } else { compver.prerelease.push(0) } compver.raw = compver.format() /* fallthrough */ case '': case '>=': if (!setMin || gt(compver, setMin)) { setMin = compver } break case '<': case '<=': /* Ignore maximum versions */ break /* istanbul ignore next */ default: throw new Error(`Unexpected operation: ${comparator.operator}`) } }) if (setMin && (!minver || gt(minver, setMin))) minver = setMin } if (minver && range.test(minver)) { return minver } return null } module.exports = minVersion const SemVer = require('../classes/semver') const Comparator = require('../classes/comparator') const {ANY} = Comparator const Range = require('../classes/range') const satisfies = require('../functions/satisfies') const gt = require('../functions/gt') const lt = require('../functions/lt') const lte = require('../functions/lte') const gte = require('../functions/gte') const outside = (version, range, hilo, options) => { version = new SemVer(version, options) range = new Range(range, options) let gtfn, ltefn, ltfn, comp, ecomp switch (hilo) { case '>': gtfn = gt ltefn = lte ltfn = lt comp = '>' ecomp = '>=' break case '<': gtfn = lt ltefn = gte ltfn = gt comp = '<' ecomp = '<=' break default: throw new TypeError('Must provide a hilo val of "<" or ">"') } // If it satisfies the range it is not outside if (satisfies(version, range, options)) { return false } // From now on, variable terms are as if we're in "gtr" mode. // but note that everything is flipped for the "ltr" function. for (let i = 0; i < range.set.length; ++i) { const comparators = range.set[i] let high = null let low = null comparators.forEach((comparator) => { if (comparator.semver === ANY) { comparator = new Comparator('>=0.0.0') } high = high || comparator low = low || comparator if (gtfn(comparator.semver, high.semver, options)) { high = comparator } else if (ltfn(comparator.semver, low.semver, options)) { low = comparator } }) // If the edge version comparator has a operator then our version // isn't outside it if (high.operator === comp || high.operator === ecomp) { return false } // If the lowest version comparator has an operator and our version // is less than it then it isn't higher than the range if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { return false } else if (low.operator === ecomp && ltfn(version, low.semver)) { return false } } return true } module.exports = outside // given a set of versions and a range, create a "simplified" range // that includes the same versions that the original range does // If the original range is shorter than the simplified one, return that. const satisfies = require('../functions/satisfies.js') const compare = require('../functions/compare.js') module.exports = (versions, range, options) => { const set = [] let min = null let prev = null const v = versions.sort((a, b) => compare(a, b, options)) for (const version of v) { const included = satisfies(version, range, options) if (included) { prev = version if (!min) min = version } else { if (prev) { set.push([min, prev]) } prev = null min = null } } if (min) set.push([min, null]) const ranges = [] for (const [min, max] of set) { if (min === max) ranges.push(min) else if (!max && min === v[0]) ranges.push('*') else if (!max) ranges.push(`>=${min}`) else if (min === v[0]) ranges.push(`<=${max}`) else ranges.push(`${min} - ${max}`) } const simplified = ranges.join(' || ') const original = typeof range.raw === 'string' ? range.raw : String(range) return simplified.length < original.length ? simplified : range } const Range = require('../classes/range.js') const Comparator = require('../classes/comparator.js') const { ANY } = Comparator const satisfies = require('../functions/satisfies.js') const compare = require('../functions/compare.js') // Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff: // - Every simple range `r1, r2, ...` is a null set, OR // - Every simple range `r1, r2, ...` which is not a null set is a subset of // some `R1, R2, ...` // // Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff: // - If c is only the ANY comparator // - If C is only the ANY comparator, return true // - Else if in prerelease mode, return false // - else replace c with `[>=0.0.0]` // - If C is only the ANY comparator // - if in prerelease mode, return true // - else replace C with `[>=0.0.0]` // - Let EQ be the set of = comparators in c // - If EQ is more than one, return true (null set) // - Let GT be the highest > or >= comparator in c // - Let LT be the lowest < or <= comparator in c // - If GT and LT, and GT.semver > LT.semver, return true (null set) // - If any C is a = range, and GT or LT are set, return false // - If EQ // - If GT, and EQ does not satisfy GT, return true (null set) // - If LT, and EQ does not satisfy LT, return true (null set) // - If EQ satisfies every C, return true // - Else return false // - If GT // - If GT.semver is lower than any > or >= comp in C, return false // - If GT is >=, and GT.semver does not satisfy every C, return false // - If GT.semver has a prerelease, and not in prerelease mode // - If no C has a prerelease and the GT.semver tuple, return false // - If LT // - If LT.semver is greater than any < or <= comp in C, return false // - If LT is <=, and LT.semver does not satisfy every C, return false // - If GT.semver has a prerelease, and not in prerelease mode // - If no C has a prerelease and the LT.semver tuple, return false // - Else return true const subset = (sub, dom, options = {}) => { if (sub === dom) return true sub = new Range(sub, options) dom = new Range(dom, options) let sawNonNull = false OUTER: for (const simpleSub of sub.set) { for (const simpleDom of dom.set) { const isSub = simpleSubset(simpleSub, simpleDom, options) sawNonNull = sawNonNull || isSub !== null if (isSub) continue OUTER } // the null set is a subset of everything, but null simple ranges in // a complex range should be ignored. so if we saw a non-null range, // then we know this isn't a subset, but if EVERY simple range was null, // then it is a subset. if (sawNonNull) return false } return true } const simpleSubset = (sub, dom, options) => { if (sub === dom) return true if (sub.length === 1 && sub[0].semver === ANY) { if (dom.length === 1 && dom[0].semver === ANY) return true else if (options.includePrerelease) sub = [ new Comparator('>=0.0.0-0') ] else sub = [ new Comparator('>=0.0.0') ] } if (dom.length === 1 && dom[0].semver === ANY) { if (options.includePrerelease) return true else dom = [ new Comparator('>=0.0.0') ] } const eqSet = new Set() let gt, lt for (const c of sub) { if (c.operator === '>' || c.operator === '>=') gt = higherGT(gt, c, options) else if (c.operator === '<' || c.operator === '<=') lt = lowerLT(lt, c, options) else eqSet.add(c.semver) } if (eqSet.size > 1) return null let gtltComp if (gt && lt) { gtltComp = compare(gt.semver, lt.semver, options) if (gtltComp > 0) return null else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) return null } // will iterate one or zero times for (const eq of eqSet) { if (gt && !satisfies(eq, String(gt), options)) return null if (lt && !satisfies(eq, String(lt), options)) return null for (const c of dom) { if (!satisfies(eq, String(c), options)) return false } return true } let higher, lower let hasDomLT, hasDomGT // if the subset has a prerelease, we need a comparator in the superset // with the same tuple and a prerelease, or it's not a subset let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false // exception: <1.2.3-0 is the same as <1.2.3 if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === '<' && needDomLTPre.prerelease[0] === 0) { needDomLTPre = false } for (const c of dom) { hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=' hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=' if (gt) { if (needDomGTPre) { if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) { needDomGTPre = false } } if (c.operator === '>' || c.operator === '>=') { higher = higherGT(gt, c, options) if (higher === c && higher !== gt) return false } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) return false } if (lt) { if (needDomLTPre) { if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) { needDomLTPre = false } } if (c.operator === '<' || c.operator === '<=') { lower = lowerLT(lt, c, options) if (lower === c && lower !== lt) return false } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) return false } if (!c.operator && (lt || gt) && gtltComp !== 0) return false } // if there was a < or >, and nothing in the dom, then must be false // UNLESS it was limited by another range in the other direction. // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 if (gt && hasDomLT && !lt && gtltComp !== 0) return false if (lt && hasDomGT && !gt && gtltComp !== 0) return false // we needed a prerelease range in a specific tuple, but didn't get one // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0, // because it includes prereleases in the 1.2.3 tuple if (needDomGTPre || needDomLTPre) return false return true } // >=1.2.3 is lower than >1.2.3 const higherGT = (a, b, options) => { if (!a) return b const comp = compare(a.semver, b.semver, options) return comp > 0 ? a : comp < 0 ? b : b.operator === '>' && a.operator === '>=' ? b : a } // <=1.2.3 is higher than <1.2.3 const lowerLT = (a, b, options) => { if (!a) return b const comp = compare(a.semver, b.semver, options) return comp < 0 ? a : comp > 0 ? b : b.operator === '<' && a.operator === '<=' ? b : a } module.exports = subset const Range = require('../classes/range') // Mostly just for testing and legacy API reasons const toComparators = (range, options) => new Range(range, options).set .map(comp => comp.map(c => c.value).join(' ').trim().split(' ')) module.exports = toComparators const Range = require('../classes/range') const validRange = (range, options) => { try { // Return '*' instead of '' so that truthiness works. // This will throw if it's invalid anyway return new Range(range, options).range || '*' } catch (er) { return null } } module.exports = validRange The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "nopt", "version": "5.0.0", "description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.", "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "main": "lib/nopt.js", "scripts": { "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", "test": "tap test/*.js" }, "repository": { "type": "git", "url": "https://github.com/npm/nopt.git" }, "bin": { "nopt": "bin/nopt.js" }, "license": "ISC", "dependencies": { "abbrev": "1" }, "devDependencies": { "tap": "^14.10.6" }, "files": [ "bin", "lib" ], "engines": { "node": ">=6" } } #!/usr/bin/env node var nopt = require("../lib/nopt") , path = require("path") , types = { num: Number , bool: Boolean , help: Boolean , list: Array , "num-list": [Number, Array] , "str-list": [String, Array] , "bool-list": [Boolean, Array] , str: String , clear: Boolean , config: Boolean , length: Number , file: path } , shorthands = { s: [ "--str", "astring" ] , b: [ "--bool" ] , nb: [ "--no-bool" ] , tft: [ "--bool-list", "--no-bool-list", "--bool-list", "true" ] , "?": ["--help"] , h: ["--help"] , H: ["--help"] , n: [ "--num", "125" ] , c: ["--config"] , l: ["--length"] , f: ["--file"] } , parsed = nopt( types , shorthands , process.argv , 2 ) console.log("parsed", parsed) if (parsed.help) { console.log("") console.log("nopt cli tester") console.log("") console.log("types") console.log(Object.keys(types).map(function M (t) { var type = types[t] if (Array.isArray(type)) { return [t, type.map(function (type) { return type.name })] } return [t, type && type.name] }).reduce(function (s, i) { s[i[0]] = i[1] return s }, {})) console.log("") console.log("shorthands") console.log(shorthands) } // info about each config option. var debug = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG ? function () { console.error.apply(console, arguments) } : function () {} var url = require("url") , path = require("path") , Stream = require("stream").Stream , abbrev = require("abbrev") , os = require("os") module.exports = exports = nopt exports.clean = clean exports.typeDefs = { String : { type: String, validate: validateString } , Boolean : { type: Boolean, validate: validateBoolean } , url : { type: url, validate: validateUrl } , Number : { type: Number, validate: validateNumber } , path : { type: path, validate: validatePath } , Stream : { type: Stream, validate: validateStream } , Date : { type: Date, validate: validateDate } } function nopt (types, shorthands, args, slice) { args = args || process.argv types = types || {} shorthands = shorthands || {} if (typeof slice !== "number") slice = 2 debug(types, shorthands, args, slice) args = args.slice(slice) var data = {} , key , argv = { remain: [], cooked: args, original: args.slice(0) } parse(args, data, argv.remain, types, shorthands) // now data is full clean(data, types, exports.typeDefs) data.argv = argv Object.defineProperty(data.argv, 'toString', { value: function () { return this.original.map(JSON.stringify).join(" ") }, enumerable: false }) return data } function clean (data, types, typeDefs) { typeDefs = typeDefs || exports.typeDefs var remove = {} , typeDefault = [false, true, null, String, Array] Object.keys(data).forEach(function (k) { if (k === "argv") return var val = data[k] , isArray = Array.isArray(val) , type = types[k] if (!isArray) val = [val] if (!type) type = typeDefault if (type === Array) type = typeDefault.concat(Array) if (!Array.isArray(type)) type = [type] debug("val=%j", val) debug("types=", type) val = val.map(function (val) { // if it's an unknown value, then parse false/true/null/numbers/dates if (typeof val === "string") { debug("string %j", val) val = val.trim() if ((val === "null" && ~type.indexOf(null)) || (val === "true" && (~type.indexOf(true) || ~type.indexOf(Boolean))) || (val === "false" && (~type.indexOf(false) || ~type.indexOf(Boolean)))) { val = JSON.parse(val) debug("jsonable %j", val) } else if (~type.indexOf(Number) && !isNaN(val)) { debug("convert to number", val) val = +val } else if (~type.indexOf(Date) && !isNaN(Date.parse(val))) { debug("convert to date", val) val = new Date(val) } } if (!types.hasOwnProperty(k)) { return val } // allow `--no-blah` to set 'blah' to null if null is allowed if (val === false && ~type.indexOf(null) && !(~type.indexOf(false) || ~type.indexOf(Boolean))) { val = null } var d = {} d[k] = val debug("prevalidated val", d, val, types[k]) if (!validate(d, k, val, types[k], typeDefs)) { if (exports.invalidHandler) { exports.invalidHandler(k, val, types[k], data) } else if (exports.invalidHandler !== false) { debug("invalid: "+k+"="+val, types[k]) } return remove } debug("validated val", d, val, types[k]) return d[k] }).filter(function (val) { return val !== remove }) // if we allow Array specifically, then an empty array is how we // express 'no value here', not null. Allow it. if (!val.length && type.indexOf(Array) === -1) { debug('VAL HAS NO LENGTH, DELETE IT', val, k, type.indexOf(Array)) delete data[k] } else if (isArray) { debug(isArray, data[k], val) data[k] = val } else data[k] = val[0] debug("k=%s val=%j", k, val, data[k]) }) } function validateString (data, k, val) { data[k] = String(val) } function validatePath (data, k, val) { if (val === true) return false if (val === null) return true val = String(val) var isWin = process.platform === 'win32' , homePattern = isWin ? /^~(\/|\\)/ : /^~\// , home = os.homedir() if (home && val.match(homePattern)) { data[k] = path.resolve(home, val.substr(2)) } else { data[k] = path.resolve(val) } return true } function validateNumber (data, k, val) { debug("validate Number %j %j %j", k, val, isNaN(val)) if (isNaN(val)) return false data[k] = +val } function validateDate (data, k, val) { var s = Date.parse(val) debug("validate Date %j %j %j", k, val, s) if (isNaN(s)) return false data[k] = new Date(val) } function validateBoolean (data, k, val) { if (val instanceof Boolean) val = val.valueOf() else if (typeof val === "string") { if (!isNaN(val)) val = !!(+val) else if (val === "null" || val === "false") val = false else val = true } else val = !!val data[k] = val } function validateUrl (data, k, val) { val = url.parse(String(val)) if (!val.host) return false data[k] = val.href } function validateStream (data, k, val) { if (!(val instanceof Stream)) return false data[k] = val } function validate (data, k, val, type, typeDefs) { // arrays are lists of types. if (Array.isArray(type)) { for (var i = 0, l = type.length; i < l; i ++) { if (type[i] === Array) continue if (validate(data, k, val, type[i], typeDefs)) return true } delete data[k] return false } // an array of anything? if (type === Array) return true // NaN is poisonous. Means that something is not allowed. if (type !== type) { debug("Poison NaN", k, val, type) delete data[k] return false } // explicit list of values if (val === type) { debug("Explicitly allowed %j", val) // if (isArray) (data[k] = data[k] || []).push(val) // else data[k] = val data[k] = val return true } // now go through the list of typeDefs, validate against each one. var ok = false , types = Object.keys(typeDefs) for (var i = 0, l = types.length; i < l; i ++) { debug("test type %j %j %j", k, val, types[i]) var t = typeDefs[types[i]] if (t && ((type && type.name && t.type && t.type.name) ? (type.name === t.type.name) : (type === t.type))) { var d = {} ok = false !== t.validate(d, k, val) val = d[k] if (ok) { // if (isArray) (data[k] = data[k] || []).push(val) // else data[k] = val data[k] = val break } } } debug("OK? %j (%j %j %j)", ok, k, val, types[i]) if (!ok) delete data[k] return ok } function parse (args, data, remain, types, shorthands) { debug("parse", args, data, remain) var key = null , abbrevs = abbrev(Object.keys(types)) , shortAbbr = abbrev(Object.keys(shorthands)) for (var i = 0; i < args.length; i ++) { var arg = args[i] debug("arg", arg) if (arg.match(/^-{2,}$/)) { // done with keys. // the rest are args. remain.push.apply(remain, args.slice(i + 1)) args[i] = "--" break } var hadEq = false if (arg.charAt(0) === "-" && arg.length > 1) { var at = arg.indexOf('=') if (at > -1) { hadEq = true var v = arg.substr(at + 1) arg = arg.substr(0, at) args.splice(i, 1, arg, v) } // see if it's a shorthand // if so, splice and back up to re-parse it. var shRes = resolveShort(arg, shorthands, shortAbbr, abbrevs) debug("arg=%j shRes=%j", arg, shRes) if (shRes) { debug(arg, shRes) args.splice.apply(args, [i, 1].concat(shRes)) if (arg !== shRes[0]) { i -- continue } } arg = arg.replace(/^-+/, "") var no = null while (arg.toLowerCase().indexOf("no-") === 0) { no = !no arg = arg.substr(3) } if (abbrevs[arg]) arg = abbrevs[arg] var argType = types[arg] var isTypeArray = Array.isArray(argType) if (isTypeArray && argType.length === 1) { isTypeArray = false argType = argType[0] } var isArray = argType === Array || isTypeArray && argType.indexOf(Array) !== -1 // allow unknown things to be arrays if specified multiple times. if (!types.hasOwnProperty(arg) && data.hasOwnProperty(arg)) { if (!Array.isArray(data[arg])) data[arg] = [data[arg]] isArray = true } var val , la = args[i + 1] var isBool = typeof no === 'boolean' || argType === Boolean || isTypeArray && argType.indexOf(Boolean) !== -1 || (typeof argType === 'undefined' && !hadEq) || (la === "false" && (argType === null || isTypeArray && ~argType.indexOf(null))) if (isBool) { // just set and move along val = !no // however, also support --bool true or --bool false if (la === "true" || la === "false") { val = JSON.parse(la) la = null if (no) val = !val i ++ } // also support "foo":[Boolean, "bar"] and "--foo bar" if (isTypeArray && la) { if (~argType.indexOf(la)) { // an explicit type val = la i ++ } else if ( la === "null" && ~argType.indexOf(null) ) { // null allowed val = null i ++ } else if ( !la.match(/^-{2,}[^-]/) && !isNaN(la) && ~argType.indexOf(Number) ) { // number val = +la i ++ } else if ( !la.match(/^-[^-]/) && ~argType.indexOf(String) ) { // string val = la i ++ } } if (isArray) (data[arg] = data[arg] || []).push(val) else data[arg] = val continue } if (argType === String) { if (la === undefined) { la = "" } else if (la.match(/^-{1,2}[^-]+/)) { la = "" i -- } } if (la && la.match(/^-{2,}$/)) { la = undefined i -- } val = la === undefined ? true : la if (isArray) (data[arg] = data[arg] || []).push(val) else data[arg] = val i ++ continue } remain.push(arg) } } function resolveShort (arg, shorthands, shortAbbr, abbrevs) { // handle single-char shorthands glommed together, like // npm ls -glp, but only if there is one dash, and only if // all of the chars are single-char shorthands, and it's // not a match to some other abbrev. arg = arg.replace(/^-+/, '') // if it's an exact known option, then don't go any further if (abbrevs[arg] === arg) return null // if it's an exact known shortopt, same deal if (shorthands[arg]) { // make it an array, if it's a list of words if (shorthands[arg] && !Array.isArray(shorthands[arg])) shorthands[arg] = shorthands[arg].split(/\s+/) return shorthands[arg] } // first check to see if this arg is a set of single-char shorthands var singles = shorthands.___singles if (!singles) { singles = Object.keys(shorthands).filter(function (s) { return s.length === 1 }).reduce(function (l,r) { l[r] = true return l }, {}) shorthands.___singles = singles debug('shorthand singles', singles) } var chrs = arg.split("").filter(function (c) { return singles[c] }) if (chrs.join("") === arg) return chrs.map(function (c) { return shorthands[c] }).reduce(function (l, r) { return l.concat(r) }, []) // if it's an arg abbrev, and not a literal shorthand, then prefer the arg if (abbrevs[arg] && !shorthands[arg]) return null // if it's an abbr for a shorthand, then use that if (shortAbbr[arg]) arg = shortAbbr[arg] // make it an array, if it's a list of words if (shorthands[arg] && !Array.isArray(shorthands[arg])) shorthands[arg] = shorthands[arg].split(/\s+/) return shorthands[arg] } The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 'use strict' var Progress = require('are-we-there-yet') var Gauge = require('gauge') var EE = require('events').EventEmitter var log = exports = module.exports = new EE() var util = require('util') var setBlocking = require('set-blocking') var consoleControl = require('console-control-strings') setBlocking(true) var stream = process.stderr Object.defineProperty(log, 'stream', { set: function (newStream) { stream = newStream if (this.gauge) this.gauge.setWriteTo(stream, stream) }, get: function () { return stream } }) // by default, decide based on tty-ness. var colorEnabled log.useColor = function () { return colorEnabled != null ? colorEnabled : stream.isTTY } log.enableColor = function () { colorEnabled = true this.gauge.setTheme({hasColor: colorEnabled, hasUnicode: unicodeEnabled}) } log.disableColor = function () { colorEnabled = false this.gauge.setTheme({hasColor: colorEnabled, hasUnicode: unicodeEnabled}) } // default level log.level = 'info' log.gauge = new Gauge(stream, { enabled: false, // no progress bars unless asked theme: {hasColor: log.useColor()}, template: [ {type: 'progressbar', length: 20}, {type: 'activityIndicator', kerning: 1, length: 1}, {type: 'section', default: ''}, ':', {type: 'logline', kerning: 1, default: ''} ] }) log.tracker = new Progress.TrackerGroup() // we track this separately as we may need to temporarily disable the // display of the status bar for our own loggy purposes. log.progressEnabled = log.gauge.isEnabled() var unicodeEnabled log.enableUnicode = function () { unicodeEnabled = true this.gauge.setTheme({hasColor: this.useColor(), hasUnicode: unicodeEnabled}) } log.disableUnicode = function () { unicodeEnabled = false this.gauge.setTheme({hasColor: this.useColor(), hasUnicode: unicodeEnabled}) } log.setGaugeThemeset = function (themes) { this.gauge.setThemeset(themes) } log.setGaugeTemplate = function (template) { this.gauge.setTemplate(template) } log.enableProgress = function () { if (this.progressEnabled) return this.progressEnabled = true this.tracker.on('change', this.showProgress) if (this._pause) return this.gauge.enable() } log.disableProgress = function () { if (!this.progressEnabled) return this.progressEnabled = false this.tracker.removeListener('change', this.showProgress) this.gauge.disable() } var trackerConstructors = ['newGroup', 'newItem', 'newStream'] var mixinLog = function (tracker) { // mixin the public methods from log into the tracker // (except: conflicts and one's we handle specially) Object.keys(log).forEach(function (P) { if (P[0] === '_') return if (trackerConstructors.filter(function (C) { return C === P }).length) return if (tracker[P]) return if (typeof log[P] !== 'function') return var func = log[P] tracker[P] = function () { return func.apply(log, arguments) } }) // if the new tracker is a group, make sure any subtrackers get // mixed in too if (tracker instanceof Progress.TrackerGroup) { trackerConstructors.forEach(function (C) { var func = tracker[C] tracker[C] = function () { return mixinLog(func.apply(tracker, arguments)) } }) } return tracker } // Add tracker constructors to the top level log object trackerConstructors.forEach(function (C) { log[C] = function () { return mixinLog(this.tracker[C].apply(this.tracker, arguments)) } }) log.clearProgress = function (cb) { if (!this.progressEnabled) return cb && process.nextTick(cb) this.gauge.hide(cb) } log.showProgress = function (name, completed) { if (!this.progressEnabled) return var values = {} if (name) values.section = name var last = log.record[log.record.length - 1] if (last) { values.subsection = last.prefix var disp = log.disp[last.level] || last.level var logline = this._format(disp, log.style[last.level]) if (last.prefix) logline += ' ' + this._format(last.prefix, this.prefixStyle) logline += ' ' + last.message.split(/\r?\n/)[0] values.logline = logline } values.completed = completed || this.tracker.completed() this.gauge.show(values) }.bind(log) // bind for use in tracker's on-change listener // temporarily stop emitting, but don't drop log.pause = function () { this._paused = true if (this.progressEnabled) this.gauge.disable() } log.resume = function () { if (!this._paused) return this._paused = false var b = this._buffer this._buffer = [] b.forEach(function (m) { this.emitLog(m) }, this) if (this.progressEnabled) this.gauge.enable() } log._buffer = [] var id = 0 log.record = [] log.maxRecordSize = 10000 log.log = function (lvl, prefix, message) { var l = this.levels[lvl] if (l === undefined) { return this.emit('error', new Error(util.format( 'Undefined log level: %j', lvl))) } var a = new Array(arguments.length - 2) var stack = null for (var i = 2; i < arguments.length; i++) { var arg = a[i - 2] = arguments[i] // resolve stack traces to a plain string. if (typeof arg === 'object' && arg && (arg instanceof Error) && arg.stack) { Object.defineProperty(arg, 'stack', { value: stack = arg.stack + '', enumerable: true, writable: true }) } } if (stack) a.unshift(stack + '\n') message = util.format.apply(util, a) var m = { id: id++, level: lvl, prefix: String(prefix || ''), message: message, messageRaw: a } this.emit('log', m) this.emit('log.' + lvl, m) if (m.prefix) this.emit(m.prefix, m) this.record.push(m) var mrs = this.maxRecordSize var n = this.record.length - mrs if (n > mrs / 10) { var newSize = Math.floor(mrs * 0.9) this.record = this.record.slice(-1 * newSize) } this.emitLog(m) }.bind(log) log.emitLog = function (m) { if (this._paused) { this._buffer.push(m) return } if (this.progressEnabled) this.gauge.pulse(m.prefix) var l = this.levels[m.level] if (l === undefined) return if (l < this.levels[this.level]) return if (l > 0 && !isFinite(l)) return // If 'disp' is null or undefined, use the lvl as a default // Allows: '', 0 as valid disp var disp = log.disp[m.level] != null ? log.disp[m.level] : m.level this.clearProgress() m.message.split(/\r?\n/).forEach(function (line) { if (this.heading) { this.write(this.heading, this.headingStyle) this.write(' ') } this.write(disp, log.style[m.level]) var p = m.prefix || '' if (p) this.write(' ') this.write(p, this.prefixStyle) this.write(' ' + line + '\n') }, this) this.showProgress() } log._format = function (msg, style) { if (!stream) return var output = '' if (this.useColor()) { style = style || {} var settings = [] if (style.fg) settings.push(style.fg) if (style.bg) settings.push('bg' + style.bg[0].toUpperCase() + style.bg.slice(1)) if (style.bold) settings.push('bold') if (style.underline) settings.push('underline') if (style.inverse) settings.push('inverse') if (settings.length) output += consoleControl.color(settings) if (style.beep) output += consoleControl.beep() } output += msg if (this.useColor()) { output += consoleControl.color('reset') } return output } log.write = function (msg, style) { if (!stream) return stream.write(this._format(msg, style)) } log.addLevel = function (lvl, n, style, disp) { // If 'disp' is null or undefined, use the lvl as a default if (disp == null) disp = lvl this.levels[lvl] = n this.style[lvl] = style if (!this[lvl]) { this[lvl] = function () { var a = new Array(arguments.length + 1) a[0] = lvl for (var i = 0; i < arguments.length; i++) { a[i + 1] = arguments[i] } return this.log.apply(this, a) }.bind(this) } this.disp[lvl] = disp } log.prefixStyle = { fg: 'magenta' } log.headingStyle = { fg: 'white', bg: 'black' } log.style = {} log.levels = {} log.disp = {} log.addLevel('silly', -Infinity, { inverse: true }, 'sill') log.addLevel('verbose', 1000, { fg: 'blue', bg: 'black' }, 'verb') log.addLevel('info', 2000, { fg: 'green' }) log.addLevel('timing', 2500, { fg: 'green', bg: 'black' }) log.addLevel('http', 3000, { fg: 'green', bg: 'black' }) log.addLevel('notice', 3500, { fg: 'blue', bg: 'black' }) log.addLevel('warn', 4000, { fg: 'black', bg: 'yellow' }, 'WARN') log.addLevel('error', 5000, { fg: 'red', bg: 'black' }, 'ERR!') log.addLevel('silent', Infinity) // allow 'error' prefix log.on('error', function () {}) { "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "name": "npmlog", "description": "logger for npm", "version": "4.1.2", "repository": { "type": "git", "url": "https://github.com/npm/npmlog.git" }, "main": "log.js", "files": [ "log.js" ], "scripts": { "test": "standard && tap test/*.js" }, "dependencies": { "are-we-there-yet": "~1.1.2", "console-control-strings": "~1.1.0", "gauge": "~2.7.3", "set-blocking": "~2.0.0" }, "devDependencies": { "standard": "~7.1.2", "tap": "~5.7.3" }, "license": "ISC" } Hi, figured we could actually use a changelog now: ## 1.1.5 2018-05-24 * [#92](https://github.com/iarna/are-we-there-yet/pull/92) Fix bug where `finish` would throw errors when including `TrackerStream` objects in `TrackerGroup` collections. (@brianloveswords) ## 1.1.4 2017-04-21 * Fix typo in package.json ## 1.1.3 2017-04-21 * Improve documentation and limit files included in the distribution. ## 1.1.2 2016-03-15 * Add tracker group cycle detection and tests for it ## 1.1.1 2016-01-29 * Fix a typo in stream completion tracker ## 1.1.0 2016-01-29 * Rewrote completion percent computation to be low impact– no more walking a tree of completion groups every time we need this info. Previously, with medium sized tree of completion groups, even a relatively modest number of calls to the top level `completed()` method would result in absurd numbers of calls overall as it walked down the tree. We now, instead, keep track as we bubble up changes, so the computation is limited to when data changes and to the depth of that one branch, instead of _every_ node. (Plus, we were already incurring _this_ cost, since we already bubbled out changes.) * Moved different tracker types out to their own files. * Made tests test for TOO MANY events too. * Standarized the source code formatting 'use strict' exports.TrackerGroup = require('./tracker-group.js') exports.Tracker = require('./tracker.js') exports.TrackerStream = require('./tracker-stream.js') Copyright (c) 2015, Rebecca Turner Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "are-we-there-yet", "version": "1.1.5", "description": "Keep track of the overall completion of many disparate processes", "main": "index.js", "scripts": { "test": "standard && tap test/*.js" }, "repository": { "type": "git", "url": "https://github.com/iarna/are-we-there-yet.git" }, "author": "Rebecca Turner (http://re-becca.org)", "license": "ISC", "bugs": { "url": "https://github.com/iarna/are-we-there-yet/issues" }, "homepage": "https://github.com/iarna/are-we-there-yet", "devDependencies": { "standard": "^11.0.1", "tap": "^12.0.1" }, "dependencies": { "delegates": "^1.0.0", "readable-stream": "^2.0.6" }, "files": [ "index.js", "tracker-base.js", "tracker-group.js", "tracker-stream.js", "tracker.js", "CHANGES.md" ] } 'use strict' var EventEmitter = require('events').EventEmitter var util = require('util') var trackerId = 0 var TrackerBase = module.exports = function (name) { EventEmitter.call(this) this.id = ++trackerId this.name = name } util.inherits(TrackerBase, EventEmitter) 'use strict' var util = require('util') var TrackerBase = require('./tracker-base.js') var Tracker = require('./tracker.js') var TrackerStream = require('./tracker-stream.js') var TrackerGroup = module.exports = function (name) { TrackerBase.call(this, name) this.parentGroup = null this.trackers = [] this.completion = {} this.weight = {} this.totalWeight = 0 this.finished = false this.bubbleChange = bubbleChange(this) } util.inherits(TrackerGroup, TrackerBase) function bubbleChange (trackerGroup) { return function (name, completed, tracker) { trackerGroup.completion[tracker.id] = completed if (trackerGroup.finished) return trackerGroup.emit('change', name || trackerGroup.name, trackerGroup.completed(), trackerGroup) } } TrackerGroup.prototype.nameInTree = function () { var names = [] var from = this while (from) { names.unshift(from.name) from = from.parentGroup } return names.join('/') } TrackerGroup.prototype.addUnit = function (unit, weight) { if (unit.addUnit) { var toTest = this while (toTest) { if (unit === toTest) { throw new Error( 'Attempted to add tracker group ' + unit.name + ' to tree that already includes it ' + this.nameInTree(this)) } toTest = toTest.parentGroup } unit.parentGroup = this } this.weight[unit.id] = weight || 1 this.totalWeight += this.weight[unit.id] this.trackers.push(unit) this.completion[unit.id] = unit.completed() unit.on('change', this.bubbleChange) if (!this.finished) this.emit('change', unit.name, this.completion[unit.id], unit) return unit } TrackerGroup.prototype.completed = function () { if (this.trackers.length === 0) return 0 var valPerWeight = 1 / this.totalWeight var completed = 0 for (var ii = 0; ii < this.trackers.length; ii++) { var trackerId = this.trackers[ii].id completed += valPerWeight * this.weight[trackerId] * this.completion[trackerId] } return completed } TrackerGroup.prototype.newGroup = function (name, weight) { return this.addUnit(new TrackerGroup(name), weight) } TrackerGroup.prototype.newItem = function (name, todo, weight) { return this.addUnit(new Tracker(name, todo), weight) } TrackerGroup.prototype.newStream = function (name, todo, weight) { return this.addUnit(new TrackerStream(name, todo), weight) } TrackerGroup.prototype.finish = function () { this.finished = true if (!this.trackers.length) this.addUnit(new Tracker(), 1, true) for (var ii = 0; ii < this.trackers.length; ii++) { var tracker = this.trackers[ii] tracker.finish() tracker.removeListener('change', this.bubbleChange) } this.emit('change', this.name, 1, this) } var buffer = ' ' TrackerGroup.prototype.debug = function (depth) { depth = depth || 0 var indent = depth ? buffer.substr(0, depth) : '' var output = indent + (this.name || 'top') + ': ' + this.completed() + '\n' this.trackers.forEach(function (tracker) { if (tracker instanceof TrackerGroup) { output += tracker.debug(depth + 1) } else { output += indent + ' ' + tracker.name + ': ' + tracker.completed() + '\n' } }) return output } 'use strict' var util = require('util') var stream = require('readable-stream') var delegate = require('delegates') var Tracker = require('./tracker.js') var TrackerStream = module.exports = function (name, size, options) { stream.Transform.call(this, options) this.tracker = new Tracker(name, size) this.name = name this.id = this.tracker.id this.tracker.on('change', delegateChange(this)) } util.inherits(TrackerStream, stream.Transform) function delegateChange (trackerStream) { return function (name, completion, tracker) { trackerStream.emit('change', name, completion, trackerStream) } } TrackerStream.prototype._transform = function (data, encoding, cb) { this.tracker.completeWork(data.length ? data.length : 1) this.push(data) cb() } TrackerStream.prototype._flush = function (cb) { this.tracker.finish() cb() } delegate(TrackerStream.prototype, 'tracker') .method('completed') .method('addWork') .method('finish') 'use strict' var util = require('util') var TrackerBase = require('./tracker-base.js') var Tracker = module.exports = function (name, todo) { TrackerBase.call(this, name) this.workDone = 0 this.workTodo = todo || 0 } util.inherits(Tracker, TrackerBase) Tracker.prototype.completed = function () { return this.workTodo === 0 ? 0 : this.workDone / this.workTodo } Tracker.prototype.addWork = function (work) { this.workTodo += work this.emit('change', this.name, this.completed(), this) } Tracker.prototype.completeWork = function (work) { this.workDone += work if (this.workDone > this.workTodo) this.workDone = this.workTodo this.emit('change', this.name, this.completed(), this) } Tracker.prototype.finish = function () { this.workTodo = this.workDone = 1 this.emit('change', this.name, 1, this) } 'use strict'; var numberIsNan = require('number-is-nan'); module.exports = function (x) { if (numberIsNan(x)) { return false; } // https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1369 // code points are derived from: // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt if (x >= 0x1100 && ( x <= 0x115f || // Hangul Jamo 0x2329 === x || // LEFT-POINTING ANGLE BRACKET 0x232a === x || // RIGHT-POINTING ANGLE BRACKET // CJK Radicals Supplement .. Enclosed CJK Letters and Months (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) || // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A 0x3250 <= x && x <= 0x4dbf || // CJK Unified Ideographs .. Yi Radicals 0x4e00 <= x && x <= 0xa4c6 || // Hangul Jamo Extended-A 0xa960 <= x && x <= 0xa97c || // Hangul Syllables 0xac00 <= x && x <= 0xd7a3 || // CJK Compatibility Ideographs 0xf900 <= x && x <= 0xfaff || // Vertical Forms 0xfe10 <= x && x <= 0xfe19 || // CJK Compatibility Forms .. Small Form Variants 0xfe30 <= x && x <= 0xfe6b || // Halfwidth and Fullwidth Forms 0xff01 <= x && x <= 0xff60 || 0xffe0 <= x && x <= 0xffe6 || // Kana Supplement 0x1b000 <= x && x <= 0x1b001 || // Enclosed Ideographic Supplement 0x1f200 <= x && x <= 0x1f251 || // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane 0x20000 <= x && x <= 0x3fffd)) { return true; } return false; } The MIT License (MIT) Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "is-fullwidth-code-point", "version": "1.0.0", "description": "Check if the character represented by a given Unicode code point is fullwidth", "license": "MIT", "repository": "sindresorhus/is-fullwidth-code-point", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=0.10.0" }, "scripts": { "test": "node test.js" }, "files": [ "index.js" ], "keywords": [ "fullwidth", "full-width", "full", "width", "unicode", "character", "char", "string", "str", "codepoint", "code", "point", "is", "detect", "check" ], "dependencies": { "number-is-nan": "^1.0.0" }, "devDependencies": { "ava": "0.0.4", "code-point-at": "^1.0.0" } } 'use strict' var spin = require('./spin.js') var progressBar = require('./progress-bar.js') module.exports = { activityIndicator: function (values, theme, width) { if (values.spun == null) return return spin(theme, values.spun) }, progressbar: function (values, theme, width) { if (values.completed == null) return return progressBar(theme, width, values.completed) } } 'use strict' var util = require('util') var User = exports.User = function User (msg) { var err = new Error(msg) Error.captureStackTrace(err, User) err.code = 'EGAUGE' return err } exports.MissingTemplateValue = function MissingTemplateValue (item, values) { var err = new User(util.format('Missing template value "%s"', item.type)) Error.captureStackTrace(err, MissingTemplateValue) err.template = item err.values = values return err } exports.Internal = function Internal (msg) { var err = new Error(msg) Error.captureStackTrace(err, Internal) err.code = 'EGAUGEINTERNAL' return err } 'use strict' module.exports = isWin32() || isColorTerm() function isWin32 () { return process.platform === 'win32' } function isColorTerm () { var termHasColor = /^screen|^xterm|^vt100|color|ansi|cygwin|linux/i return !!process.env.COLORTERM || termHasColor.test(process.env.TERM) } 'use strict' var Plumbing = require('./plumbing.js') var hasUnicode = require('has-unicode') var hasColor = require('./has-color.js') var onExit = require('signal-exit') var defaultThemes = require('./themes') var setInterval = require('./set-interval.js') var process = require('./process.js') var setImmediate = require('./set-immediate') module.exports = Gauge function callWith (obj, method) { return function () { return method.call(obj) } } function Gauge (arg1, arg2) { var options, writeTo if (arg1 && arg1.write) { writeTo = arg1 options = arg2 || {} } else if (arg2 && arg2.write) { writeTo = arg2 options = arg1 || {} } else { writeTo = process.stderr options = arg1 || arg2 || {} } this._status = { spun: 0, section: '', subsection: '' } this._paused = false // are we paused for back pressure? this._disabled = true // are all progress bar updates disabled? this._showing = false // do we WANT the progress bar on screen this._onScreen = false // IS the progress bar on screen this._needsRedraw = false // should we print something at next tick? this._hideCursor = options.hideCursor == null ? true : options.hideCursor this._fixedFramerate = options.fixedFramerate == null ? !(/^v0\.8\./.test(process.version)) : options.fixedFramerate this._lastUpdateAt = null this._updateInterval = options.updateInterval == null ? 50 : options.updateInterval this._themes = options.themes || defaultThemes this._theme = options.theme var theme = this._computeTheme(options.theme) var template = options.template || [ {type: 'progressbar', length: 20}, {type: 'activityIndicator', kerning: 1, length: 1}, {type: 'section', kerning: 1, default: ''}, {type: 'subsection', kerning: 1, default: ''} ] this.setWriteTo(writeTo, options.tty) var PlumbingClass = options.Plumbing || Plumbing this._gauge = new PlumbingClass(theme, template, this.getWidth()) this._$$doRedraw = callWith(this, this._doRedraw) this._$$handleSizeChange = callWith(this, this._handleSizeChange) this._cleanupOnExit = options.cleanupOnExit == null || options.cleanupOnExit this._removeOnExit = null if (options.enabled || (options.enabled == null && this._tty && this._tty.isTTY)) { this.enable() } else { this.disable() } } Gauge.prototype = {} Gauge.prototype.isEnabled = function () { return !this._disabled } Gauge.prototype.setTemplate = function (template) { this._gauge.setTemplate(template) if (this._showing) this._requestRedraw() } Gauge.prototype._computeTheme = function (theme) { if (!theme) theme = {} if (typeof theme === 'string') { theme = this._themes.getTheme(theme) } else if (theme && (Object.keys(theme).length === 0 || theme.hasUnicode != null || theme.hasColor != null)) { var useUnicode = theme.hasUnicode == null ? hasUnicode() : theme.hasUnicode var useColor = theme.hasColor == null ? hasColor : theme.hasColor theme = this._themes.getDefault({hasUnicode: useUnicode, hasColor: useColor, platform: theme.platform}) } return theme } Gauge.prototype.setThemeset = function (themes) { this._themes = themes this.setTheme(this._theme) } Gauge.prototype.setTheme = function (theme) { this._gauge.setTheme(this._computeTheme(theme)) if (this._showing) this._requestRedraw() this._theme = theme } Gauge.prototype._requestRedraw = function () { this._needsRedraw = true if (!this._fixedFramerate) this._doRedraw() } Gauge.prototype.getWidth = function () { return ((this._tty && this._tty.columns) || 80) - 1 } Gauge.prototype.setWriteTo = function (writeTo, tty) { var enabled = !this._disabled if (enabled) this.disable() this._writeTo = writeTo this._tty = tty || (writeTo === process.stderr && process.stdout.isTTY && process.stdout) || (writeTo.isTTY && writeTo) || this._tty if (this._gauge) this._gauge.setWidth(this.getWidth()) if (enabled) this.enable() } Gauge.prototype.enable = function () { if (!this._disabled) return this._disabled = false if (this._tty) this._enableEvents() if (this._showing) this.show() } Gauge.prototype.disable = function () { if (this._disabled) return if (this._showing) { this._lastUpdateAt = null this._showing = false this._doRedraw() this._showing = true } this._disabled = true if (this._tty) this._disableEvents() } Gauge.prototype._enableEvents = function () { if (this._cleanupOnExit) { this._removeOnExit = onExit(callWith(this, this.disable)) } this._tty.on('resize', this._$$handleSizeChange) if (this._fixedFramerate) { this.redrawTracker = setInterval(this._$$doRedraw, this._updateInterval) if (this.redrawTracker.unref) this.redrawTracker.unref() } } Gauge.prototype._disableEvents = function () { this._tty.removeListener('resize', this._$$handleSizeChange) if (this._fixedFramerate) clearInterval(this.redrawTracker) if (this._removeOnExit) this._removeOnExit() } Gauge.prototype.hide = function (cb) { if (this._disabled) return cb && process.nextTick(cb) if (!this._showing) return cb && process.nextTick(cb) this._showing = false this._doRedraw() cb && setImmediate(cb) } Gauge.prototype.show = function (section, completed) { this._showing = true if (typeof section === 'string') { this._status.section = section } else if (typeof section === 'object') { var sectionKeys = Object.keys(section) for (var ii = 0; ii < sectionKeys.length; ++ii) { var key = sectionKeys[ii] this._status[key] = section[key] } } if (completed != null) this._status.completed = completed if (this._disabled) return this._requestRedraw() } Gauge.prototype.pulse = function (subsection) { this._status.subsection = subsection || '' this._status.spun ++ if (this._disabled) return if (!this._showing) return this._requestRedraw() } Gauge.prototype._handleSizeChange = function () { this._gauge.setWidth(this._tty.columns - 1) this._requestRedraw() } Gauge.prototype._doRedraw = function () { if (this._disabled || this._paused) return if (!this._fixedFramerate) { var now = Date.now() if (this._lastUpdateAt && now - this._lastUpdateAt < this._updateInterval) return this._lastUpdateAt = now } if (!this._showing && this._onScreen) { this._onScreen = false var result = this._gauge.hide() if (this._hideCursor) { result += this._gauge.showCursor() } return this._writeTo.write(result) } if (!this._showing && !this._onScreen) return if (this._showing && !this._onScreen) { this._onScreen = true this._needsRedraw = true if (this._hideCursor) { this._writeTo.write(this._gauge.hideCursor()) } } if (!this._needsRedraw) return if (!this._writeTo.write(this._gauge.show(this._status))) { this._paused = true this._writeTo.on('drain', callWith(this, function () { this._paused = false this._doRedraw() })) } } Copyright (c) 2014, Rebecca Turner Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "gauge", "version": "2.7.4", "description": "A terminal based horizontal guage", "main": "index.js", "scripts": { "test": "standard && tap test/*.js --coverage", "prepublish": "rm -f *~" }, "repository": { "type": "git", "url": "https://github.com/iarna/gauge" }, "keywords": [ "progressbar", "progress", "gauge" ], "author": "Rebecca Turner ", "license": "ISC", "bugs": { "url": "https://github.com/iarna/gauge/issues" }, "homepage": "https://github.com/iarna/gauge", "dependencies": { "aproba": "^1.0.3", "console-control-strings": "^1.0.0", "has-unicode": "^2.0.0", "object-assign": "^4.1.0", "signal-exit": "^3.0.0", "string-width": "^1.0.1", "strip-ansi": "^3.0.1", "wide-align": "^1.1.0" }, "devDependencies": { "readable-stream": "^2.0.6", "require-inject": "^1.4.0", "standard": "^7.1.2", "tap": "^5.7.2", "through2": "^2.0.0" }, "files": [ "base-theme.js", "CHANGELOG.md", "error.js", "has-color.js", "index.js", "LICENSE", "package.json", "plumbing.js", "process.js", "progress-bar.js", "README.md", "render-template.js", "set-immediate.js", "set-interval.js", "spin.js", "template-item.js", "theme-set.js", "themes.js", "wide-truncate.js" ] } 'use strict' var consoleControl = require('console-control-strings') var renderTemplate = require('./render-template.js') var validate = require('aproba') var Plumbing = module.exports = function (theme, template, width) { if (!width) width = 80 validate('OAN', [theme, template, width]) this.showing = false this.theme = theme this.width = width this.template = template } Plumbing.prototype = {} Plumbing.prototype.setTheme = function (theme) { validate('O', [theme]) this.theme = theme } Plumbing.prototype.setTemplate = function (template) { validate('A', [template]) this.template = template } Plumbing.prototype.setWidth = function (width) { validate('N', [width]) this.width = width } Plumbing.prototype.hide = function () { return consoleControl.gotoSOL() + consoleControl.eraseLine() } Plumbing.prototype.hideCursor = consoleControl.hideCursor Plumbing.prototype.showCursor = consoleControl.showCursor Plumbing.prototype.show = function (status) { var values = Object.create(this.theme) for (var key in status) { values[key] = status[key] } return renderTemplate(this.width, this.template, values).trim() + consoleControl.color('reset') + consoleControl.eraseLine() + consoleControl.gotoSOL() } 'use strict' // this exists so we can replace it during testing module.exports = process 'use strict' var validate = require('aproba') var renderTemplate = require('./render-template.js') var wideTruncate = require('./wide-truncate') var stringWidth = require('string-width') module.exports = function (theme, width, completed) { validate('ONN', [theme, width, completed]) if (completed < 0) completed = 0 if (completed > 1) completed = 1 if (width <= 0) return '' var sofar = Math.round(width * completed) var rest = width - sofar var template = [ {type: 'complete', value: repeat(theme.complete, sofar), length: sofar}, {type: 'remaining', value: repeat(theme.remaining, rest), length: rest} ] return renderTemplate(width, template, theme) } // lodash's way of repeating function repeat (string, width) { var result = '' var n = width do { if (n % 2) { result += string } n = Math.floor(n / 2) /*eslint no-self-assign: 0*/ string += string } while (n && stringWidth(result) < width) return wideTruncate(result, width) } 'use strict' var align = require('wide-align') var validate = require('aproba') var objectAssign = require('object-assign') var wideTruncate = require('./wide-truncate') var error = require('./error') var TemplateItem = require('./template-item') function renderValueWithValues (values) { return function (item) { return renderValue(item, values) } } var renderTemplate = module.exports = function (width, template, values) { var items = prepareItems(width, template, values) var rendered = items.map(renderValueWithValues(values)).join('') return align.left(wideTruncate(rendered, width), width) } function preType (item) { var cappedTypeName = item.type[0].toUpperCase() + item.type.slice(1) return 'pre' + cappedTypeName } function postType (item) { var cappedTypeName = item.type[0].toUpperCase() + item.type.slice(1) return 'post' + cappedTypeName } function hasPreOrPost (item, values) { if (!item.type) return return values[preType(item)] || values[postType(item)] } function generatePreAndPost (baseItem, parentValues) { var item = objectAssign({}, baseItem) var values = Object.create(parentValues) var template = [] var pre = preType(item) var post = postType(item) if (values[pre]) { template.push({value: values[pre]}) values[pre] = null } item.minLength = null item.length = null item.maxLength = null template.push(item) values[item.type] = values[item.type] if (values[post]) { template.push({value: values[post]}) values[post] = null } return function ($1, $2, length) { return renderTemplate(length, template, values) } } function prepareItems (width, template, values) { function cloneAndObjectify (item, index, arr) { var cloned = new TemplateItem(item, width) var type = cloned.type if (cloned.value == null) { if (!(type in values)) { if (cloned.default == null) { throw new error.MissingTemplateValue(cloned, values) } else { cloned.value = cloned.default } } else { cloned.value = values[type] } } if (cloned.value == null || cloned.value === '') return null cloned.index = index cloned.first = index === 0 cloned.last = index === arr.length - 1 if (hasPreOrPost(cloned, values)) cloned.value = generatePreAndPost(cloned, values) return cloned } var output = template.map(cloneAndObjectify).filter(function (item) { return item != null }) var outputLength = 0 var remainingSpace = width var variableCount = output.length function consumeSpace (length) { if (length > remainingSpace) length = remainingSpace outputLength += length remainingSpace -= length } function finishSizing (item, length) { if (item.finished) throw new error.Internal('Tried to finish template item that was already finished') if (length === Infinity) throw new error.Internal('Length of template item cannot be infinity') if (length != null) item.length = length item.minLength = null item.maxLength = null --variableCount item.finished = true if (item.length == null) item.length = item.getBaseLength() if (item.length == null) throw new error.Internal('Finished template items must have a length') consumeSpace(item.getLength()) } output.forEach(function (item) { if (!item.kerning) return var prevPadRight = item.first ? 0 : output[item.index - 1].padRight if (!item.first && prevPadRight < item.kerning) item.padLeft = item.kerning - prevPadRight if (!item.last) item.padRight = item.kerning }) // Finish any that have a fixed (literal or intuited) length output.forEach(function (item) { if (item.getBaseLength() == null) return finishSizing(item) }) var resized = 0 var resizing var hunkSize do { resizing = false hunkSize = Math.round(remainingSpace / variableCount) output.forEach(function (item) { if (item.finished) return if (!item.maxLength) return if (item.getMaxLength() < hunkSize) { finishSizing(item, item.maxLength) resizing = true } }) } while (resizing && resized++ < output.length) if (resizing) throw new error.Internal('Resize loop iterated too many times while determining maxLength') resized = 0 do { resizing = false hunkSize = Math.round(remainingSpace / variableCount) output.forEach(function (item) { if (item.finished) return if (!item.minLength) return if (item.getMinLength() >= hunkSize) { finishSizing(item, item.minLength) resizing = true } }) } while (resizing && resized++ < output.length) if (resizing) throw new error.Internal('Resize loop iterated too many times while determining minLength') hunkSize = Math.round(remainingSpace / variableCount) output.forEach(function (item) { if (item.finished) return finishSizing(item, hunkSize) }) return output } function renderFunction (item, values, length) { validate('OON', arguments) if (item.type) { return item.value(values, values[item.type + 'Theme'] || {}, length) } else { return item.value(values, {}, length) } } function renderValue (item, values) { var length = item.getBaseLength() var value = typeof item.value === 'function' ? renderFunction(item, values, length) : item.value if (value == null || value === '') return '' var alignWith = align[item.align] || align.left var leftPadding = item.padLeft ? align.left('', item.padLeft) : '' var rightPadding = item.padRight ? align.right('', item.padRight) : '' var truncated = wideTruncate(String(value), length) var aligned = alignWith(truncated, length) return leftPadding + aligned + rightPadding } 'use strict' var process = require('./process') try { module.exports = setImmediate } catch (ex) { module.exports = process.nextTick } 'use strict' // this exists so we can replace it during testing module.exports = setInterval 'use strict' module.exports = function spin (spinstr, spun) { return spinstr[spun % spinstr.length] } 'use strict' var stringWidth = require('string-width') module.exports = TemplateItem function isPercent (num) { if (typeof num !== 'string') return false return num.slice(-1) === '%' } function percent (num) { return Number(num.slice(0, -1)) / 100 } function TemplateItem (values, outputLength) { this.overallOutputLength = outputLength this.finished = false this.type = null this.value = null this.length = null this.maxLength = null this.minLength = null this.kerning = null this.align = 'left' this.padLeft = 0 this.padRight = 0 this.index = null this.first = null this.last = null if (typeof values === 'string') { this.value = values } else { for (var prop in values) this[prop] = values[prop] } // Realize percents if (isPercent(this.length)) { this.length = Math.round(this.overallOutputLength * percent(this.length)) } if (isPercent(this.minLength)) { this.minLength = Math.round(this.overallOutputLength * percent(this.minLength)) } if (isPercent(this.maxLength)) { this.maxLength = Math.round(this.overallOutputLength * percent(this.maxLength)) } return this } TemplateItem.prototype = {} TemplateItem.prototype.getBaseLength = function () { var length = this.length if (length == null && typeof this.value === 'string' && this.maxLength == null && this.minLength == null) { length = stringWidth(this.value) } return length } TemplateItem.prototype.getLength = function () { var length = this.getBaseLength() if (length == null) return null return length + this.padLeft + this.padRight } TemplateItem.prototype.getMaxLength = function () { if (this.maxLength == null) return null return this.maxLength + this.padLeft + this.padRight } TemplateItem.prototype.getMinLength = function () { if (this.minLength == null) return null return this.minLength + this.padLeft + this.padRight } 'use strict' var objectAssign = require('object-assign') module.exports = function () { return ThemeSetProto.newThemeSet() } var ThemeSetProto = {} ThemeSetProto.baseTheme = require('./base-theme.js') ThemeSetProto.newTheme = function (parent, theme) { if (!theme) { theme = parent parent = this.baseTheme } return objectAssign({}, parent, theme) } ThemeSetProto.getThemeNames = function () { return Object.keys(this.themes) } ThemeSetProto.addTheme = function (name, parent, theme) { this.themes[name] = this.newTheme(parent, theme) } ThemeSetProto.addToAllThemes = function (theme) { var themes = this.themes Object.keys(themes).forEach(function (name) { objectAssign(themes[name], theme) }) objectAssign(this.baseTheme, theme) } ThemeSetProto.getTheme = function (name) { if (!this.themes[name]) throw this.newMissingThemeError(name) return this.themes[name] } ThemeSetProto.setDefault = function (opts, name) { if (name == null) { name = opts opts = {} } var platform = opts.platform == null ? 'fallback' : opts.platform var hasUnicode = !!opts.hasUnicode var hasColor = !!opts.hasColor if (!this.defaults[platform]) this.defaults[platform] = {true: {}, false: {}} this.defaults[platform][hasUnicode][hasColor] = name } ThemeSetProto.getDefault = function (opts) { if (!opts) opts = {} var platformName = opts.platform || process.platform var platform = this.defaults[platformName] || this.defaults.fallback var hasUnicode = !!opts.hasUnicode var hasColor = !!opts.hasColor if (!platform) throw this.newMissingDefaultThemeError(platformName, hasUnicode, hasColor) if (!platform[hasUnicode][hasColor]) { if (hasUnicode && hasColor && platform[!hasUnicode][hasColor]) { hasUnicode = false } else if (hasUnicode && hasColor && platform[hasUnicode][!hasColor]) { hasColor = false } else if (hasUnicode && hasColor && platform[!hasUnicode][!hasColor]) { hasUnicode = false hasColor = false } else if (hasUnicode && !hasColor && platform[!hasUnicode][hasColor]) { hasUnicode = false } else if (!hasUnicode && hasColor && platform[hasUnicode][!hasColor]) { hasColor = false } else if (platform === this.defaults.fallback) { throw this.newMissingDefaultThemeError(platformName, hasUnicode, hasColor) } } if (platform[hasUnicode][hasColor]) { return this.getTheme(platform[hasUnicode][hasColor]) } else { return this.getDefault(objectAssign({}, opts, {platform: 'fallback'})) } } ThemeSetProto.newMissingThemeError = function newMissingThemeError (name) { var err = new Error('Could not find a gauge theme named "' + name + '"') Error.captureStackTrace.call(err, newMissingThemeError) err.theme = name err.code = 'EMISSINGTHEME' return err } ThemeSetProto.newMissingDefaultThemeError = function newMissingDefaultThemeError (platformName, hasUnicode, hasColor) { var err = new Error( 'Could not find a gauge theme for your platform/unicode/color use combo:\n' + ' platform = ' + platformName + '\n' + ' hasUnicode = ' + hasUnicode + '\n' + ' hasColor = ' + hasColor) Error.captureStackTrace.call(err, newMissingDefaultThemeError) err.platform = platformName err.hasUnicode = hasUnicode err.hasColor = hasColor err.code = 'EMISSINGTHEME' return err } ThemeSetProto.newThemeSet = function () { var themeset = function (opts) { return themeset.getDefault(opts) } return objectAssign(themeset, ThemeSetProto, { themes: objectAssign({}, this.themes), baseTheme: objectAssign({}, this.baseTheme), defaults: JSON.parse(JSON.stringify(this.defaults || {})) }) } 'use strict' var consoleControl = require('console-control-strings') var ThemeSet = require('./theme-set.js') var themes = module.exports = new ThemeSet() themes.addTheme('ASCII', { preProgressbar: '[', postProgressbar: ']', progressbarTheme: { complete: '#', remaining: '.' }, activityIndicatorTheme: '-\\|/', preSubsection: '>' }) themes.addTheme('colorASCII', themes.getTheme('ASCII'), { progressbarTheme: { preComplete: consoleControl.color('inverse'), complete: ' ', postComplete: consoleControl.color('stopInverse'), preRemaining: consoleControl.color('brightBlack'), remaining: '.', postRemaining: consoleControl.color('reset') } }) themes.addTheme('brailleSpinner', { preProgressbar: '⸨', postProgressbar: '⸩', progressbarTheme: { complete: '░', remaining: '⠂' }, activityIndicatorTheme: '⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏', preSubsection: '>' }) themes.addTheme('colorBrailleSpinner', themes.getTheme('brailleSpinner'), { progressbarTheme: { preComplete: consoleControl.color('inverse'), complete: ' ', postComplete: consoleControl.color('stopInverse'), preRemaining: consoleControl.color('brightBlack'), remaining: '░', postRemaining: consoleControl.color('reset') } }) themes.setDefault({}, 'ASCII') themes.setDefault({hasColor: true}, 'colorASCII') themes.setDefault({platform: 'darwin', hasUnicode: true}, 'brailleSpinner') themes.setDefault({platform: 'darwin', hasUnicode: true, hasColor: true}, 'colorBrailleSpinner') 'use strict' var stringWidth = require('string-width') var stripAnsi = require('strip-ansi') module.exports = wideTruncate function wideTruncate (str, target) { if (stringWidth(str) === 0) return str if (target <= 0) return '' if (stringWidth(str) <= target) return str // We compute the number of bytes of ansi sequences here and add // that to our initial truncation to ensure that we don't slice one // that we want to keep in half. var noAnsi = stripAnsi(str) var ansiSize = str.length + noAnsi.length var truncated = str.slice(0, target + ansiSize) // we have to shrink the result to account for our ansi sequence buffer // (if an ansi sequence was truncated) and double width characters. while (stringWidth(truncated) > target) { truncated = truncated.slice(0, -1) } return truncated } 'use strict'; var stripAnsi = require('strip-ansi'); var codePointAt = require('code-point-at'); var isFullwidthCodePoint = require('is-fullwidth-code-point'); // https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1345 module.exports = function (str) { if (typeof str !== 'string' || str.length === 0) { return 0; } var width = 0; str = stripAnsi(str); for (var i = 0; i < str.length; i++) { var code = codePointAt(str, i); // ignore control characters if (code <= 0x1f || (code >= 0x7f && code <= 0x9f)) { continue; } // surrogates if (code >= 0x10000) { i++; } if (isFullwidthCodePoint(code)) { width += 2; } else { width++; } } return width; }; The MIT License (MIT) Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "string-width", "version": "1.0.2", "description": "Get the visual width of a string - the number of columns required to display it", "license": "MIT", "repository": "sindresorhus/string-width", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=0.10.0" }, "scripts": { "test": "xo && ava" }, "files": [ "index.js" ], "keywords": [ "string", "str", "character", "char", "unicode", "width", "visual", "column", "columns", "fullwidth", "full-width", "full", "ansi", "escape", "codes", "cli", "command-line", "terminal", "console", "cjk", "chinese", "japanese", "korean", "fixed-width" ], "dependencies": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", "strip-ansi": "^3.0.0" }, "devDependencies": { "ava": "*", "xo": "*" } } module.exports = Pend; function Pend() { this.pending = 0; this.max = Infinity; this.listeners = []; this.waiting = []; this.error = null; } Pend.prototype.go = function(fn) { if (this.pending < this.max) { pendGo(this, fn); } else { this.waiting.push(fn); } }; Pend.prototype.wait = function(cb) { if (this.pending === 0) { cb(this.error); } else { this.listeners.push(cb); } }; Pend.prototype.hold = function() { return pendHold(this); }; function pendHold(self) { self.pending += 1; var called = false; return onCb; function onCb(err) { if (called) throw new Error("callback called twice"); called = true; self.error = self.error || err; self.pending -= 1; if (self.waiting.length > 0 && self.pending < self.max) { pendGo(self, self.waiting.shift()); } else if (self.pending === 0) { var listeners = self.listeners; self.listeners = []; listeners.forEach(cbListener); } } function cbListener(listener) { listener(self.error); } } function pendGo(self, fn) { fn(pendHold(self)); } The MIT License (Expat) Copyright (c) 2014 Andrew Kelley Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "pend", "version": "1.2.0", "description": "dead-simple optimistic async helper", "main": "index.js", "scripts": { "test": "node test.js" }, "author": "Andrew Kelley ", "license": "MIT", "repository": { "type": "git", "url": "git://github.com/andrewrk/node-pend.git" }, "bugs": { "url": "https://github.com/andrewrk/node-pend/issues" } } var assert = require('assert'); var Pend = require('./'); var tests = [ { name: "basic", fn: testBasic, }, { name: "max", fn: testWithMax, }, { name: "callback twice", fn: testCallbackTwice, }, { name: "calling wait twice", fn: testCallingWaitTwice, }, { name: "hold()", fn: testHoldFn, }, ]; var testCount = tests.length; doOneTest(); function doOneTest() { var test = tests.shift(); if (!test) { console.log(testCount + " tests passed."); return; } process.stdout.write(test.name + "..."); test.fn(function() { process.stdout.write("OK\n"); doOneTest(); }); } function testBasic(cb) { var pend = new Pend(); var results = []; pend.go(function(cb) { results.push(1); setTimeout(function() { results.push(3); cb(); }, 500); }); pend.go(function(cb) { results.push(2); setTimeout(function() { results.push(4); cb(); }, 1000); }); pend.wait(function(err) { assert.deepEqual(results, [1,2,3,4]); cb(); }); assert.deepEqual(results, [1, 2]); } function testWithMax(cb) { var pend = new Pend(); var results = []; pend.max = 2; pend.go(function(cb) { results.push('a'); setTimeout(function() { results.push(1); cb(); }, 500); }); pend.go(function(cb) { results.push('b'); setTimeout(function() { results.push(1); cb(); }, 500); }); pend.go(function(cb) { results.push('c'); setTimeout(function() { results.push(2); cb(); }, 100); }); pend.wait(function(err) { assert.deepEqual(results, ['a', 'b', 1, 'c', 1, 2]); cb(); }); assert.deepEqual(results, ['a', 'b']); } function testCallbackTwice(cb) { var pend = new Pend(); pend.go(function(cb) { setTimeout(cb, 100); }); pend.go(function(cb) { cb(); assert.throws(cb, /callback called twice/); }); pend.wait(cb); } function testCallingWaitTwice(cb) { var pend = new Pend(); pend.go(function(cb) { setTimeout(cb, 100); }); pend.wait(function() { pend.go(function(cb) { setTimeout(cb, 50); }); pend.go(function(cb) { setTimeout(cb, 10); }); pend.go(function(cb) { setTimeout(cb, 20); }); pend.wait(cb); }); } function testHoldFn(cb) { var pend = new Pend(); setTimeout(pend.hold(), 100); pend.go(function(cb) { cb(); }); pend.wait(cb); } var once = require('once') var eos = require('end-of-stream') var fs = require('fs') // we only need fs to get the ReadStream and WriteStream prototypes var noop = function () {} var isFn = function (fn) { return typeof fn === 'function' } var isFS = function (stream) { if (!fs) return false // browser return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close) } var isRequest = function (stream) { return stream.setHeader && isFn(stream.abort) } var destroyer = function (stream, reading, writing, callback) { callback = once(callback) var closed = false stream.on('close', function () { closed = true }) eos(stream, {readable: reading, writable: writing}, function (err) { if (err) return callback(err) closed = true callback() }) var destroyed = false return function (err) { if (closed) return if (destroyed) return destroyed = true if (isFS(stream)) return stream.close() // use close for fs streams to avoid fd leaks if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want if (isFn(stream.destroy)) return stream.destroy() callback(err || new Error('stream was destroyed')) } } var call = function (fn) { fn() } var pipe = function (from, to) { return from.pipe(to) } var pump = function () { var streams = Array.prototype.slice.call(arguments) var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop if (Array.isArray(streams[0])) streams = streams[0] if (streams.length < 2) throw new Error('pump requires two streams per minimum') var error var destroys = streams.map(function (stream, i) { var reading = i < streams.length - 1 var writing = i > 0 return destroyer(stream, reading, writing, function (err) { if (!error) error = err if (err) destroys.forEach(call) if (reading) return destroys.forEach(call) callback(error) }) }) return streams.reduce(pipe) } module.exports = pump The MIT License (MIT) Copyright (c) 2014 Mathias Buus Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.{ "name": "pump", "version": "1.0.2", "repository": "git://github.com/mafintosh/pump.git", "license": "MIT", "description": "pipe streams together and close all of them if one of them closes", "browser": { "fs": false }, "keywords": [ "streams", "pipe", "destroy", "callback" ], "author": "Mathias Buus Madsen ", "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" }, "scripts": { "test": "node test.js" } } var stream = require('stream') var pump = require('./index') var rs = new stream.Readable() var ws = new stream.Writable() rs._read = function (size) { this.push(Buffer(size).fill('abc')) } ws._write = function (chunk, encoding, cb) { setTimeout(function () { cb() }, 100) } var toHex = function () { var reverse = new (require('stream').Transform)() reverse._transform = function (chunk, enc, callback) { reverse.push(chunk.toString('hex')) callback() } return reverse } var wsClosed = false var rsClosed = false var callbackCalled = false var check = function () { if (wsClosed && rsClosed && callbackCalled) console.log('done') } ws.on('finish', function () { wsClosed = true check() }) rs.on('end', function () { rsClosed = true check() }) pump(rs, toHex(), toHex(), toHex(), ws, function () { callbackCalled = true check() }) setTimeout(function () { rs.push(null) rs.emit('close') }, 1000) setTimeout(function () { if (!check()) throw new Error('timeout') }, 5000) var pump = require('./index') var rs = require('fs').createReadStream('/dev/random') var ws = require('fs').createWriteStream('/dev/null') var toHex = function () { var reverse = new (require('stream').Transform)() reverse._transform = function (chunk, enc, callback) { reverse.push(chunk.toString('hex')) callback() } return reverse } var wsClosed = false var rsClosed = false var callbackCalled = false var check = function () { if (wsClosed && rsClosed && callbackCalled) process.exit(0) } ws.on('close', function () { wsClosed = true check() }) rs.on('close', function () { rsClosed = true check() }) pump(rs, toHex(), toHex(), toHex(), ws, function () { callbackCalled = true check() }) setTimeout(function () { rs.destroy() }, 1000) setTimeout(function () { throw new Error('timeout') }, 5000) // when this is loaded into the browser, // just use the defaults... module.exports = function (name, defaults) { return defaults } #! /usr/bin/env node var rc = require('./index') console.log(JSON.stringify(rc(process.argv[2]), false, 2)) var cc = require('./lib/utils') var join = require('path').join var deepExtend = require('deep-extend') var etc = '/etc' var win = process.platform === "win32" var home = win ? process.env.USERPROFILE : process.env.HOME module.exports = function (name, defaults, argv, parse) { if('string' !== typeof name) throw new Error('rc(name): name *must* be string') if(!argv) argv = require('minimist')(process.argv.slice(2)) defaults = ( 'string' === typeof defaults ? cc.json(defaults) : defaults ) || {} parse = parse || cc.parse var env = cc.env(name + '_') var configs = [defaults] var configFiles = [] function addConfigFile (file) { if (configFiles.indexOf(file) >= 0) return var fileConfig = cc.file(file) if (fileConfig) { configs.push(parse(fileConfig)) configFiles.push(file) } } // which files do we look at? if (!win) [join(etc, name, 'config'), join(etc, name + 'rc')].forEach(addConfigFile) if (home) [join(home, '.config', name, 'config'), join(home, '.config', name), join(home, '.' + name, 'config'), join(home, '.' + name + 'rc')].forEach(addConfigFile) addConfigFile(cc.find('.'+name+'rc')) if (env.config) addConfigFile(env.config) if (argv.config) addConfigFile(argv.config) return deepExtend.apply(null, configs.concat([ env, argv, configFiles.length ? {configs: configFiles, config: configFiles[configFiles.length - 1]} : undefined, ])) } Apache License, Version 2.0 Copyright (c) 2011 Dominic Tarr Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Copyright (c) 2013, Dominic Tarr All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project. The MIT License Copyright (c) 2011 Dominic Tarr Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "rc", "version": "1.2.8", "description": "hardwired configuration loader", "main": "index.js", "browser": "browser.js", "scripts": { "test": "set -e; node test/test.js; node test/ini.js; node test/nested-env-vars.js" }, "repository": { "type": "git", "url": "https://github.com/dominictarr/rc.git" }, "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", "keywords": [ "config", "rc", "unix", "defaults" ], "bin": "./cli.js", "author": "Dominic Tarr (dominictarr.com)", "dependencies": { "deep-extend": "^0.6.0", "ini": "~1.3.0", "minimist": "^1.2.0", "strip-json-comments": "~2.0.1" } } 'use strict'; var fs = require('fs') var ini = require('ini') var path = require('path') var stripJsonComments = require('strip-json-comments') var parse = exports.parse = function (content) { //if it ends in .json or starts with { then it must be json. //must be done this way, because ini accepts everything. //can't just try and parse it and let it throw if it's not ini. //everything is ini. even json with a syntax error. if(/^\s*{/.test(content)) return JSON.parse(stripJsonComments(content)) return ini.parse(content) } var file = exports.file = function () { var args = [].slice.call(arguments).filter(function (arg) { return arg != null }) //path.join breaks if it's a not a string, so just skip this. for(var i in args) if('string' !== typeof args[i]) return var file = path.join.apply(null, args) var content try { return fs.readFileSync(file,'utf-8') } catch (err) { return } } var json = exports.json = function () { var content = file.apply(null, arguments) return content ? parse(content) : null } var env = exports.env = function (prefix, env) { env = env || process.env var obj = {} var l = prefix.length for(var k in env) { if(k.toLowerCase().indexOf(prefix.toLowerCase()) === 0) { var keypath = k.substring(l).split('__') // Trim empty strings from keypath array var _emptyStringIndex while ((_emptyStringIndex=keypath.indexOf('')) > -1) { keypath.splice(_emptyStringIndex, 1) } var cursor = obj keypath.forEach(function _buildSubObj(_subkey,i){ // (check for _subkey first so we ignore empty strings) // (check for cursor to avoid assignment to primitive objects) if (!_subkey || typeof cursor !== 'object') return // If this is the last key, just stuff the value in there // Assigns actual value from env variable to final key // (unless it's just an empty string- in that case use the last valid key) if (i === keypath.length-1) cursor[_subkey] = env[k] // Build sub-object if nothing already exists at the keypath if (cursor[_subkey] === undefined) cursor[_subkey] = {} // Increment cursor used to track the object at the current depth cursor = cursor[_subkey] }) } } return obj } var find = exports.find = function () { var rel = path.join.apply(null, [].slice.call(arguments)) function find(start, rel) { var file = path.join(start, rel) try { fs.statSync(file) return file } catch (err) { if(path.dirname(start) !== start) // root return find(path.dirname(start), rel) } } return find(process.cwd(), rel) } 'use strict'; var singleComment = 1; var multiComment = 2; function stripWithoutWhitespace() { return ''; } function stripWithWhitespace(str, start, end) { return str.slice(start, end).replace(/\S/g, ' '); } module.exports = function (str, opts) { opts = opts || {}; var currentChar; var nextChar; var insideString = false; var insideComment = false; var offset = 0; var ret = ''; var strip = opts.whitespace === false ? stripWithoutWhitespace : stripWithWhitespace; for (var i = 0; i < str.length; i++) { currentChar = str[i]; nextChar = str[i + 1]; if (!insideComment && currentChar === '"') { var escaped = str[i - 1] === '\\' && str[i - 2] !== '\\'; if (!escaped) { insideString = !insideString; } } if (insideString) { continue; } if (!insideComment && currentChar + nextChar === '//') { ret += str.slice(offset, i); offset = i; insideComment = singleComment; i++; } else if (insideComment === singleComment && currentChar + nextChar === '\r\n') { i++; insideComment = false; ret += strip(str, offset, i); offset = i; continue; } else if (insideComment === singleComment && currentChar === '\n') { insideComment = false; ret += strip(str, offset, i); offset = i; } else if (!insideComment && currentChar + nextChar === '/*') { ret += str.slice(offset, i); offset = i; insideComment = multiComment; i++; continue; } else if (insideComment === multiComment && currentChar + nextChar === '*/') { i++; insideComment = false; ret += strip(str, offset, i + 1); offset = i + 1; continue; } } return ret + (insideComment ? strip(str.substr(offset)) : str.substr(offset)); }; The MIT License (MIT) Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "strip-json-comments", "version": "2.0.1", "description": "Strip comments from JSON. Lets you use comments in your JSON files!", "license": "MIT", "repository": "sindresorhus/strip-json-comments", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=0.10.0" }, "scripts": { "test": "xo && ava" }, "files": [ "index.js" ], "keywords": [ "json", "strip", "remove", "delete", "trim", "comments", "multiline", "parse", "config", "configuration", "conf", "settings", "util", "env", "environment" ], "devDependencies": { "ava": "*", "xo": "*" } } #!/usr/bin/env node var rimraf = require('./') var help = false var dashdash = false var noglob = false var args = process.argv.slice(2).filter(function(arg) { if (dashdash) return !!arg else if (arg === '--') dashdash = true else if (arg === '--no-glob' || arg === '-G') noglob = true else if (arg === '--glob' || arg === '-g') noglob = false else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) help = true else return !!arg }) if (help || args.length === 0) { // If they didn't ask for help, then this is not a "success" var log = help ? console.log : console.error log('Usage: rimraf [ ...]') log('') log(' Deletes all files and folders at "path" recursively.') log('') log('Options:') log('') log(' -h, --help Display this usage info') log(' -G, --no-glob Do not expand glob patterns in arguments') log(' -g, --glob Expand glob patterns in arguments (default)') process.exit(help ? 0 : 1) } else go(0) function go (n) { if (n >= args.length) return var options = {} if (noglob) options = { glob: false } rimraf(args[n], options, function (er) { if (er) throw er go(n+1) }) } The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "rimraf", "version": "2.7.1", "main": "rimraf.js", "description": "A deep deletion module for node (like `rm -rf`)", "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "license": "ISC", "repository": "git://github.com/isaacs/rimraf.git", "scripts": { "preversion": "npm test", "postversion": "npm publish", "postpublish": "git push origin --all; git push origin --tags", "test": "tap test/*.js" }, "bin": "./bin.js", "dependencies": { "glob": "^7.1.3" }, "files": [ "LICENSE", "README.md", "bin.js", "rimraf.js" ], "devDependencies": { "mkdirp": "^0.5.1", "tap": "^12.1.1" } } module.exports = rimraf rimraf.sync = rimrafSync var assert = require("assert") var path = require("path") var fs = require("fs") var glob = undefined try { glob = require("glob") } catch (_err) { // treat glob as optional. } var _0666 = parseInt('666', 8) var defaultGlobOpts = { nosort: true, silent: true } // for EMFILE handling var timeout = 0 var isWindows = (process.platform === "win32") function defaults (options) { var methods = [ 'unlink', 'chmod', 'stat', 'lstat', 'rmdir', 'readdir' ] methods.forEach(function(m) { options[m] = options[m] || fs[m] m = m + 'Sync' options[m] = options[m] || fs[m] }) options.maxBusyTries = options.maxBusyTries || 3 options.emfileWait = options.emfileWait || 1000 if (options.glob === false) { options.disableGlob = true } if (options.disableGlob !== true && glob === undefined) { throw Error('glob dependency not found, set `options.disableGlob = true` if intentional') } options.disableGlob = options.disableGlob || false options.glob = options.glob || defaultGlobOpts } function rimraf (p, options, cb) { if (typeof options === 'function') { cb = options options = {} } assert(p, 'rimraf: missing path') assert.equal(typeof p, 'string', 'rimraf: path should be a string') assert.equal(typeof cb, 'function', 'rimraf: callback function required') assert(options, 'rimraf: invalid options argument provided') assert.equal(typeof options, 'object', 'rimraf: options should be object') defaults(options) var busyTries = 0 var errState = null var n = 0 if (options.disableGlob || !glob.hasMagic(p)) return afterGlob(null, [p]) options.lstat(p, function (er, stat) { if (!er) return afterGlob(null, [p]) glob(p, options.glob, afterGlob) }) function next (er) { errState = errState || er if (--n === 0) cb(errState) } function afterGlob (er, results) { if (er) return cb(er) n = results.length if (n === 0) return cb() results.forEach(function (p) { rimraf_(p, options, function CB (er) { if (er) { if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") && busyTries < options.maxBusyTries) { busyTries ++ var time = busyTries * 100 // try again, with the same exact callback as this one. return setTimeout(function () { rimraf_(p, options, CB) }, time) } // this one won't happen if graceful-fs is used. if (er.code === "EMFILE" && timeout < options.emfileWait) { return setTimeout(function () { rimraf_(p, options, CB) }, timeout ++) } // already gone if (er.code === "ENOENT") er = null } timeout = 0 next(er) }) }) } } // Two possible strategies. // 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR // 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR // // Both result in an extra syscall when you guess wrong. However, there // are likely far more normal files in the world than directories. This // is based on the assumption that a the average number of files per // directory is >= 1. // // If anyone ever complains about this, then I guess the strategy could // be made configurable somehow. But until then, YAGNI. function rimraf_ (p, options, cb) { assert(p) assert(options) assert(typeof cb === 'function') // sunos lets the root user unlink directories, which is... weird. // so we have to lstat here and make sure it's not a dir. options.lstat(p, function (er, st) { if (er && er.code === "ENOENT") return cb(null) // Windows can EPERM on stat. Life is suffering. if (er && er.code === "EPERM" && isWindows) fixWinEPERM(p, options, er, cb) if (st && st.isDirectory()) return rmdir(p, options, er, cb) options.unlink(p, function (er) { if (er) { if (er.code === "ENOENT") return cb(null) if (er.code === "EPERM") return (isWindows) ? fixWinEPERM(p, options, er, cb) : rmdir(p, options, er, cb) if (er.code === "EISDIR") return rmdir(p, options, er, cb) } return cb(er) }) }) } function fixWinEPERM (p, options, er, cb) { assert(p) assert(options) assert(typeof cb === 'function') if (er) assert(er instanceof Error) options.chmod(p, _0666, function (er2) { if (er2) cb(er2.code === "ENOENT" ? null : er) else options.stat(p, function(er3, stats) { if (er3) cb(er3.code === "ENOENT" ? null : er) else if (stats.isDirectory()) rmdir(p, options, er, cb) else options.unlink(p, cb) }) }) } function fixWinEPERMSync (p, options, er) { assert(p) assert(options) if (er) assert(er instanceof Error) try { options.chmodSync(p, _0666) } catch (er2) { if (er2.code === "ENOENT") return else throw er } try { var stats = options.statSync(p) } catch (er3) { if (er3.code === "ENOENT") return else throw er } if (stats.isDirectory()) rmdirSync(p, options, er) else options.unlinkSync(p) } function rmdir (p, options, originalEr, cb) { assert(p) assert(options) if (originalEr) assert(originalEr instanceof Error) assert(typeof cb === 'function') // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) // if we guessed wrong, and it's not a directory, then // raise the original error. options.rmdir(p, function (er) { if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) rmkids(p, options, cb) else if (er && er.code === "ENOTDIR") cb(originalEr) else cb(er) }) } function rmkids(p, options, cb) { assert(p) assert(options) assert(typeof cb === 'function') options.readdir(p, function (er, files) { if (er) return cb(er) var n = files.length if (n === 0) return options.rmdir(p, cb) var errState files.forEach(function (f) { rimraf(path.join(p, f), options, function (er) { if (errState) return if (er) return cb(errState = er) if (--n === 0) options.rmdir(p, cb) }) }) }) } // this looks simpler, and is strictly *faster*, but will // tie up the JavaScript thread and fail on excessively // deep directory trees. function rimrafSync (p, options) { options = options || {} defaults(options) assert(p, 'rimraf: missing path') assert.equal(typeof p, 'string', 'rimraf: path should be a string') assert(options, 'rimraf: missing options') assert.equal(typeof options, 'object', 'rimraf: options should be object') var results if (options.disableGlob || !glob.hasMagic(p)) { results = [p] } else { try { options.lstatSync(p) results = [p] } catch (er) { results = glob.sync(p, options.glob) } } if (!results.length) return for (var i = 0; i < results.length; i++) { var p = results[i] try { var st = options.lstatSync(p) } catch (er) { if (er.code === "ENOENT") return // Windows can EPERM on stat. Life is suffering. if (er.code === "EPERM" && isWindows) fixWinEPERMSync(p, options, er) } try { // sunos lets the root user unlink directories, which is... weird. if (st && st.isDirectory()) rmdirSync(p, options, null) else options.unlinkSync(p) } catch (er) { if (er.code === "ENOENT") return if (er.code === "EPERM") return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) if (er.code !== "EISDIR") throw er rmdirSync(p, options, er) } } } function rmdirSync (p, options, originalEr) { assert(p) assert(options) if (originalEr) assert(originalEr instanceof Error) try { options.rmdirSync(p) } catch (er) { if (er.code === "ENOENT") return if (er.code === "ENOTDIR") throw originalEr if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") rmkidsSync(p, options) } } function rmkidsSync (p, options) { assert(p) assert(options) options.readdirSync(p).forEach(function (f) { rimrafSync(path.join(p, f), options) }) // We only end up here once we got ENOTEMPTY at least once, and // at this point, we are guaranteed to have removed all the kids. // So, we know that it won't be ENOENT or ENOTDIR or anything else. // try really hard to delete stuff on windows, because it has a // PROFOUNDLY annoying habit of not closing handles promptly when // files are deleted, resulting in spurious ENOTEMPTY errors. var retries = isWindows ? 100 : 1 var i = 0 do { var threw = true try { var ret = options.rmdirSync(p, options) threw = false return ret } finally { if (++i < retries && threw) continue } } while (true) } ## 7.0 - Raise error if `options.cwd` is specified, and not a directory ## 6.0 - Remove comment and negation pattern support - Ignore patterns are always in `dot:true` mode ## 5.0 - Deprecate comment and negation patterns - Fix regression in `mark` and `nodir` options from making all cache keys absolute path. - Abort if `fs.readdir` returns an error that's unexpected - Don't emit `match` events for ignored items - Treat ENOTSUP like ENOTDIR in readdir ## 4.5 - Add `options.follow` to always follow directory symlinks in globstar - Add `options.realpath` to call `fs.realpath` on all results - Always cache based on absolute path ## 4.4 - Add `options.ignore` - Fix handling of broken symlinks ## 4.3 - Bump minimatch to 2.x - Pass all tests on Windows ## 4.2 - Add `glob.hasMagic` function - Add `options.nodir` flag ## 4.1 - Refactor sync and async implementations for performance - Throw if callback provided to sync glob function - Treat symbolic links in globstar results the same as Bash 4.3 ## 4.0 - Use `^` for dependency versions (bumped major because this breaks older npm versions) - Ensure callbacks are only ever called once - switch to ISC license ## 3.x - Rewrite in JavaScript - Add support for setting root, cwd, and windows support - Cache many fs calls - Add globstar support - emit match events ## 2.x - Use `glob.h` and `fnmatch.h` from NetBSD ## 1.x - `glob.h` static binding. exports.setopts = setopts exports.ownProp = ownProp exports.makeAbs = makeAbs exports.finish = finish exports.mark = mark exports.isIgnored = isIgnored exports.childrenIgnored = childrenIgnored function ownProp (obj, field) { return Object.prototype.hasOwnProperty.call(obj, field) } var path = require("path") var minimatch = require("minimatch") var isAbsolute = require("path-is-absolute") var Minimatch = minimatch.Minimatch function alphasort (a, b) { return a.localeCompare(b, 'en') } function setupIgnores (self, options) { self.ignore = options.ignore || [] if (!Array.isArray(self.ignore)) self.ignore = [self.ignore] if (self.ignore.length) { self.ignore = self.ignore.map(ignoreMap) } } // ignore patterns are always in dot:true mode. function ignoreMap (pattern) { var gmatcher = null if (pattern.slice(-3) === '/**') { var gpattern = pattern.replace(/(\/\*\*)+$/, '') gmatcher = new Minimatch(gpattern, { dot: true }) } return { matcher: new Minimatch(pattern, { dot: true }), gmatcher: gmatcher } } function setopts (self, pattern, options) { if (!options) options = {} // base-matching: just use globstar for that. if (options.matchBase && -1 === pattern.indexOf("/")) { if (options.noglobstar) { throw new Error("base matching requires globstar") } pattern = "**/" + pattern } self.silent = !!options.silent self.pattern = pattern self.strict = options.strict !== false self.realpath = !!options.realpath self.realpathCache = options.realpathCache || Object.create(null) self.follow = !!options.follow self.dot = !!options.dot self.mark = !!options.mark self.nodir = !!options.nodir if (self.nodir) self.mark = true self.sync = !!options.sync self.nounique = !!options.nounique self.nonull = !!options.nonull self.nosort = !!options.nosort self.nocase = !!options.nocase self.stat = !!options.stat self.noprocess = !!options.noprocess self.absolute = !!options.absolute self.maxLength = options.maxLength || Infinity self.cache = options.cache || Object.create(null) self.statCache = options.statCache || Object.create(null) self.symlinks = options.symlinks || Object.create(null) setupIgnores(self, options) self.changedCwd = false var cwd = process.cwd() if (!ownProp(options, "cwd")) self.cwd = cwd else { self.cwd = path.resolve(options.cwd) self.changedCwd = self.cwd !== cwd } self.root = options.root || path.resolve(self.cwd, "/") self.root = path.resolve(self.root) if (process.platform === "win32") self.root = self.root.replace(/\\/g, "/") // TODO: is an absolute `cwd` supposed to be resolved against `root`? // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) if (process.platform === "win32") self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") self.nomount = !!options.nomount // disable comments and negation in Minimatch. // Note that they are not supported in Glob itself anyway. options.nonegate = true options.nocomment = true self.minimatch = new Minimatch(pattern, options) self.options = self.minimatch.options } function finish (self) { var nou = self.nounique var all = nou ? [] : Object.create(null) for (var i = 0, l = self.matches.length; i < l; i ++) { var matches = self.matches[i] if (!matches || Object.keys(matches).length === 0) { if (self.nonull) { // do like the shell, and spit out the literal glob var literal = self.minimatch.globSet[i] if (nou) all.push(literal) else all[literal] = true } } else { // had matches var m = Object.keys(matches) if (nou) all.push.apply(all, m) else m.forEach(function (m) { all[m] = true }) } } if (!nou) all = Object.keys(all) if (!self.nosort) all = all.sort(alphasort) // at *some* point we statted all of these if (self.mark) { for (var i = 0; i < all.length; i++) { all[i] = self._mark(all[i]) } if (self.nodir) { all = all.filter(function (e) { var notDir = !(/\/$/.test(e)) var c = self.cache[e] || self.cache[makeAbs(self, e)] if (notDir && c) notDir = c !== 'DIR' && !Array.isArray(c) return notDir }) } } if (self.ignore.length) all = all.filter(function(m) { return !isIgnored(self, m) }) self.found = all } function mark (self, p) { var abs = makeAbs(self, p) var c = self.cache[abs] var m = p if (c) { var isDir = c === 'DIR' || Array.isArray(c) var slash = p.slice(-1) === '/' if (isDir && !slash) m += '/' else if (!isDir && slash) m = m.slice(0, -1) if (m !== p) { var mabs = makeAbs(self, m) self.statCache[mabs] = self.statCache[abs] self.cache[mabs] = self.cache[abs] } } return m } // lotta situps... function makeAbs (self, f) { var abs = f if (f.charAt(0) === '/') { abs = path.join(self.root, f) } else if (isAbsolute(f) || f === '') { abs = f } else if (self.changedCwd) { abs = path.resolve(self.cwd, f) } else { abs = path.resolve(f) } if (process.platform === 'win32') abs = abs.replace(/\\/g, '/') return abs } // Return true, if pattern ends with globstar '**', for the accompanying parent directory. // Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents function isIgnored (self, path) { if (!self.ignore.length) return false return self.ignore.some(function(item) { return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) }) } function childrenIgnored (self, path) { if (!self.ignore.length) return false return self.ignore.some(function(item) { return !!(item.gmatcher && item.gmatcher.match(path)) }) } // Approach: // // 1. Get the minimatch set // 2. For each pattern in the set, PROCESS(pattern, false) // 3. Store matches per-set, then uniq them // // PROCESS(pattern, inGlobStar) // Get the first [n] items from pattern that are all strings // Join these together. This is PREFIX. // If there is no more remaining, then stat(PREFIX) and // add to matches if it succeeds. END. // // If inGlobStar and PREFIX is symlink and points to dir // set ENTRIES = [] // else readdir(PREFIX) as ENTRIES // If fail, END // // with ENTRIES // If pattern[n] is GLOBSTAR // // handle the case where the globstar match is empty // // by pruning it out, and testing the resulting pattern // PROCESS(pattern[0..n] + pattern[n+1 .. $], false) // // handle other cases. // for ENTRY in ENTRIES (not dotfiles) // // attach globstar + tail onto the entry // // Mark that this entry is a globstar match // PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) // // else // not globstar // for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) // Test ENTRY against pattern[n] // If fails, continue // If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) // // Caveat: // Cache all stats and readdirs results to minimize syscall. Since all // we ever care about is existence and directory-ness, we can just keep // `true` for files, and [children,...] for directories, or `false` for // things that don't exist. module.exports = glob var fs = require('fs') var rp = require('fs.realpath') var minimatch = require('minimatch') var Minimatch = minimatch.Minimatch var inherits = require('inherits') var EE = require('events').EventEmitter var path = require('path') var assert = require('assert') var isAbsolute = require('path-is-absolute') var globSync = require('./sync.js') var common = require('./common.js') var setopts = common.setopts var ownProp = common.ownProp var inflight = require('inflight') var util = require('util') var childrenIgnored = common.childrenIgnored var isIgnored = common.isIgnored var once = require('once') function glob (pattern, options, cb) { if (typeof options === 'function') cb = options, options = {} if (!options) options = {} if (options.sync) { if (cb) throw new TypeError('callback provided to sync glob') return globSync(pattern, options) } return new Glob(pattern, options, cb) } glob.sync = globSync var GlobSync = glob.GlobSync = globSync.GlobSync // old api surface glob.glob = glob function extend (origin, add) { if (add === null || typeof add !== 'object') { return origin } var keys = Object.keys(add) var i = keys.length while (i--) { origin[keys[i]] = add[keys[i]] } return origin } glob.hasMagic = function (pattern, options_) { var options = extend({}, options_) options.noprocess = true var g = new Glob(pattern, options) var set = g.minimatch.set if (!pattern) return false if (set.length > 1) return true for (var j = 0; j < set[0].length; j++) { if (typeof set[0][j] !== 'string') return true } return false } glob.Glob = Glob inherits(Glob, EE) function Glob (pattern, options, cb) { if (typeof options === 'function') { cb = options options = null } if (options && options.sync) { if (cb) throw new TypeError('callback provided to sync glob') return new GlobSync(pattern, options) } if (!(this instanceof Glob)) return new Glob(pattern, options, cb) setopts(this, pattern, options) this._didRealPath = false // process each pattern in the minimatch set var n = this.minimatch.set.length // The matches are stored as {: true,...} so that // duplicates are automagically pruned. // Later, we do an Object.keys() on these. // Keep them as a list so we can fill in when nonull is set. this.matches = new Array(n) if (typeof cb === 'function') { cb = once(cb) this.on('error', cb) this.on('end', function (matches) { cb(null, matches) }) } var self = this this._processing = 0 this._emitQueue = [] this._processQueue = [] this.paused = false if (this.noprocess) return this if (n === 0) return done() var sync = true for (var i = 0; i < n; i ++) { this._process(this.minimatch.set[i], i, false, done) } sync = false function done () { --self._processing if (self._processing <= 0) { if (sync) { process.nextTick(function () { self._finish() }) } else { self._finish() } } } } Glob.prototype._finish = function () { assert(this instanceof Glob) if (this.aborted) return if (this.realpath && !this._didRealpath) return this._realpath() common.finish(this) this.emit('end', this.found) } Glob.prototype._realpath = function () { if (this._didRealpath) return this._didRealpath = true var n = this.matches.length if (n === 0) return this._finish() var self = this for (var i = 0; i < this.matches.length; i++) this._realpathSet(i, next) function next () { if (--n === 0) self._finish() } } Glob.prototype._realpathSet = function (index, cb) { var matchset = this.matches[index] if (!matchset) return cb() var found = Object.keys(matchset) var self = this var n = found.length if (n === 0) return cb() var set = this.matches[index] = Object.create(null) found.forEach(function (p, i) { // If there's a problem with the stat, then it means that // one or more of the links in the realpath couldn't be // resolved. just return the abs value in that case. p = self._makeAbs(p) rp.realpath(p, self.realpathCache, function (er, real) { if (!er) set[real] = true else if (er.syscall === 'stat') set[p] = true else self.emit('error', er) // srsly wtf right here if (--n === 0) { self.matches[index] = set cb() } }) }) } Glob.prototype._mark = function (p) { return common.mark(this, p) } Glob.prototype._makeAbs = function (f) { return common.makeAbs(this, f) } Glob.prototype.abort = function () { this.aborted = true this.emit('abort') } Glob.prototype.pause = function () { if (!this.paused) { this.paused = true this.emit('pause') } } Glob.prototype.resume = function () { if (this.paused) { this.emit('resume') this.paused = false if (this._emitQueue.length) { var eq = this._emitQueue.slice(0) this._emitQueue.length = 0 for (var i = 0; i < eq.length; i ++) { var e = eq[i] this._emitMatch(e[0], e[1]) } } if (this._processQueue.length) { var pq = this._processQueue.slice(0) this._processQueue.length = 0 for (var i = 0; i < pq.length; i ++) { var p = pq[i] this._processing-- this._process(p[0], p[1], p[2], p[3]) } } } } Glob.prototype._process = function (pattern, index, inGlobStar, cb) { assert(this instanceof Glob) assert(typeof cb === 'function') if (this.aborted) return this._processing++ if (this.paused) { this._processQueue.push([pattern, index, inGlobStar, cb]) return } //console.error('PROCESS %d', this._processing, pattern) // Get the first [n] parts of pattern that are all strings. var n = 0 while (typeof pattern[n] === 'string') { n ++ } // now n is the index of the first one that is *not* a string. // see if there's anything else var prefix switch (n) { // if not, then this is rather simple case pattern.length: this._processSimple(pattern.join('/'), index, cb) return case 0: // pattern *starts* with some non-trivial item. // going to readdir(cwd), but not include the prefix in matches. prefix = null break default: // pattern has some string bits in the front. // whatever it starts with, whether that's 'absolute' like /foo/bar, // or 'relative' like '../baz' prefix = pattern.slice(0, n).join('/') break } var remain = pattern.slice(n) // get the list of entries. var read if (prefix === null) read = '.' else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { if (!prefix || !isAbsolute(prefix)) prefix = '/' + prefix read = prefix } else read = prefix var abs = this._makeAbs(read) //if ignored, skip _processing if (childrenIgnored(this, read)) return cb() var isGlobStar = remain[0] === minimatch.GLOBSTAR if (isGlobStar) this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) else this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) } Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { var self = this this._readdir(abs, inGlobStar, function (er, entries) { return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) }) } Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { // if the abs isn't a dir, then nothing can match! if (!entries) return cb() // It will only match dot entries if it starts with a dot, or if // dot is set. Stuff like @(.foo|.bar) isn't allowed. var pn = remain[0] var negate = !!this.minimatch.negate var rawGlob = pn._glob var dotOk = this.dot || rawGlob.charAt(0) === '.' var matchedEntries = [] for (var i = 0; i < entries.length; i++) { var e = entries[i] if (e.charAt(0) !== '.' || dotOk) { var m if (negate && !prefix) { m = !e.match(pn) } else { m = e.match(pn) } if (m) matchedEntries.push(e) } } //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) var len = matchedEntries.length // If there are no matched entries, then nothing matches. if (len === 0) return cb() // if this is the last remaining pattern bit, then no need for // an additional stat *unless* the user has specified mark or // stat explicitly. We know they exist, since readdir returned // them. if (remain.length === 1 && !this.mark && !this.stat) { if (!this.matches[index]) this.matches[index] = Object.create(null) for (var i = 0; i < len; i ++) { var e = matchedEntries[i] if (prefix) { if (prefix !== '/') e = prefix + '/' + e else e = prefix + e } if (e.charAt(0) === '/' && !this.nomount) { e = path.join(this.root, e) } this._emitMatch(index, e) } // This was the last one, and no stats were needed return cb() } // now test all matched entries as stand-ins for that part // of the pattern. remain.shift() for (var i = 0; i < len; i ++) { var e = matchedEntries[i] var newPattern if (prefix) { if (prefix !== '/') e = prefix + '/' + e else e = prefix + e } this._process([e].concat(remain), index, inGlobStar, cb) } cb() } Glob.prototype._emitMatch = function (index, e) { if (this.aborted) return if (isIgnored(this, e)) return if (this.paused) { this._emitQueue.push([index, e]) return } var abs = isAbsolute(e) ? e : this._makeAbs(e) if (this.mark) e = this._mark(e) if (this.absolute) e = abs if (this.matches[index][e]) return if (this.nodir) { var c = this.cache[abs] if (c === 'DIR' || Array.isArray(c)) return } this.matches[index][e] = true var st = this.statCache[abs] if (st) this.emit('stat', e, st) this.emit('match', e) } Glob.prototype._readdirInGlobStar = function (abs, cb) { if (this.aborted) return // follow all symlinked directories forever // just proceed as if this is a non-globstar situation if (this.follow) return this._readdir(abs, false, cb) var lstatkey = 'lstat\0' + abs var self = this var lstatcb = inflight(lstatkey, lstatcb_) if (lstatcb) fs.lstat(abs, lstatcb) function lstatcb_ (er, lstat) { if (er && er.code === 'ENOENT') return cb() var isSym = lstat && lstat.isSymbolicLink() self.symlinks[abs] = isSym // If it's not a symlink or a dir, then it's definitely a regular file. // don't bother doing a readdir in that case. if (!isSym && lstat && !lstat.isDirectory()) { self.cache[abs] = 'FILE' cb() } else self._readdir(abs, false, cb) } } Glob.prototype._readdir = function (abs, inGlobStar, cb) { if (this.aborted) return cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) if (!cb) return //console.error('RD %j %j', +inGlobStar, abs) if (inGlobStar && !ownProp(this.symlinks, abs)) return this._readdirInGlobStar(abs, cb) if (ownProp(this.cache, abs)) { var c = this.cache[abs] if (!c || c === 'FILE') return cb() if (Array.isArray(c)) return cb(null, c) } var self = this fs.readdir(abs, readdirCb(this, abs, cb)) } function readdirCb (self, abs, cb) { return function (er, entries) { if (er) self._readdirError(abs, er, cb) else self._readdirEntries(abs, entries, cb) } } Glob.prototype._readdirEntries = function (abs, entries, cb) { if (this.aborted) return // if we haven't asked to stat everything, then just // assume that everything in there exists, so we can avoid // having to stat it a second time. if (!this.mark && !this.stat) { for (var i = 0; i < entries.length; i ++) { var e = entries[i] if (abs === '/') e = abs + e else e = abs + '/' + e this.cache[e] = true } } this.cache[abs] = entries return cb(null, entries) } Glob.prototype._readdirError = function (f, er, cb) { if (this.aborted) return // handle errors, and cache the information switch (er.code) { case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 case 'ENOTDIR': // totally normal. means it *does* exist. var abs = this._makeAbs(f) this.cache[abs] = 'FILE' if (abs === this.cwdAbs) { var error = new Error(er.code + ' invalid cwd ' + this.cwd) error.path = this.cwd error.code = er.code this.emit('error', error) this.abort() } break case 'ENOENT': // not terribly unusual case 'ELOOP': case 'ENAMETOOLONG': case 'UNKNOWN': this.cache[this._makeAbs(f)] = false break default: // some unusual error. Treat as failure. this.cache[this._makeAbs(f)] = false if (this.strict) { this.emit('error', er) // If the error is handled, then we abort // if not, we threw out of here this.abort() } if (!this.silent) console.error('glob error', er) break } return cb() } Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { var self = this this._readdir(abs, inGlobStar, function (er, entries) { self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) }) } Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { //console.error('pgs2', prefix, remain[0], entries) // no entries means not a dir, so it can never have matches // foo.txt/** doesn't match foo.txt if (!entries) return cb() // test without the globstar, and with every child both below // and replacing the globstar. var remainWithoutGlobStar = remain.slice(1) var gspref = prefix ? [ prefix ] : [] var noGlobStar = gspref.concat(remainWithoutGlobStar) // the noGlobStar pattern exits the inGlobStar state this._process(noGlobStar, index, false, cb) var isSym = this.symlinks[abs] var len = entries.length // If it's a symlink, and we're in a globstar, then stop if (isSym && inGlobStar) return cb() for (var i = 0; i < len; i++) { var e = entries[i] if (e.charAt(0) === '.' && !this.dot) continue // these two cases enter the inGlobStar state var instead = gspref.concat(entries[i], remainWithoutGlobStar) this._process(instead, index, true, cb) var below = gspref.concat(entries[i], remain) this._process(below, index, true, cb) } cb() } Glob.prototype._processSimple = function (prefix, index, cb) { // XXX review this. Shouldn't it be doing the mounting etc // before doing stat? kinda weird? var self = this this._stat(prefix, function (er, exists) { self._processSimple2(prefix, index, er, exists, cb) }) } Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { //console.error('ps2', prefix, exists) if (!this.matches[index]) this.matches[index] = Object.create(null) // If it doesn't exist, then just mark the lack of results if (!exists) return cb() if (prefix && isAbsolute(prefix) && !this.nomount) { var trail = /[\/\\]$/.test(prefix) if (prefix.charAt(0) === '/') { prefix = path.join(this.root, prefix) } else { prefix = path.resolve(this.root, prefix) if (trail) prefix += '/' } } if (process.platform === 'win32') prefix = prefix.replace(/\\/g, '/') // Mark this as a match this._emitMatch(index, prefix) cb() } // Returns either 'DIR', 'FILE', or false Glob.prototype._stat = function (f, cb) { var abs = this._makeAbs(f) var needDir = f.slice(-1) === '/' if (f.length > this.maxLength) return cb() if (!this.stat && ownProp(this.cache, abs)) { var c = this.cache[abs] if (Array.isArray(c)) c = 'DIR' // It exists, but maybe not how we need it if (!needDir || c === 'DIR') return cb(null, c) if (needDir && c === 'FILE') return cb() // otherwise we have to stat, because maybe c=true // if we know it exists, but not what it is. } var exists var stat = this.statCache[abs] if (stat !== undefined) { if (stat === false) return cb(null, stat) else { var type = stat.isDirectory() ? 'DIR' : 'FILE' if (needDir && type === 'FILE') return cb() else return cb(null, type, stat) } } var self = this var statcb = inflight('stat\0' + abs, lstatcb_) if (statcb) fs.lstat(abs, statcb) function lstatcb_ (er, lstat) { if (lstat && lstat.isSymbolicLink()) { // If it's a symlink, then treat it as the target, unless // the target does not exist, then treat it as a file. return fs.stat(abs, function (er, stat) { if (er) self._stat2(f, abs, null, lstat, cb) else self._stat2(f, abs, er, stat, cb) }) } else { self._stat2(f, abs, er, lstat, cb) } } } Glob.prototype._stat2 = function (f, abs, er, stat, cb) { if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { this.statCache[abs] = false return cb() } var needDir = f.slice(-1) === '/' this.statCache[abs] = stat if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) return cb(null, false, stat) var c = true if (stat) c = stat.isDirectory() ? 'DIR' : 'FILE' this.cache[abs] = this.cache[abs] || c if (needDir && c === 'FILE') return cb() return cb(null, c, stat) } The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ## Glob Logo Glob's logo created by Tanya Brassie , licensed under a Creative Commons Attribution-ShareAlike 4.0 International License https://creativecommons.org/licenses/by-sa/4.0/ { "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "name": "glob", "description": "a little globber", "version": "7.1.7", "repository": { "type": "git", "url": "git://github.com/isaacs/node-glob.git" }, "main": "glob.js", "files": [ "glob.js", "sync.js", "common.js" ], "engines": { "node": "*" }, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, "devDependencies": { "mkdirp": "0", "rimraf": "^2.2.8", "tap": "^15.0.6", "tick": "0.0.6" }, "tap": { "before": "test/00-setup.js", "after": "test/zz-cleanup.js", "jobs": 1 }, "scripts": { "prepublish": "npm run benchclean", "profclean": "rm -f v8.log profile.txt", "test": "tap", "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js", "bench": "bash benchmark.sh", "prof": "bash prof.sh && cat profile.txt", "benchclean": "node benchclean.js" }, "license": "ISC", "funding": { "url": "https://github.com/sponsors/isaacs" } } module.exports = globSync globSync.GlobSync = GlobSync var fs = require('fs') var rp = require('fs.realpath') var minimatch = require('minimatch') var Minimatch = minimatch.Minimatch var Glob = require('./glob.js').Glob var util = require('util') var path = require('path') var assert = require('assert') var isAbsolute = require('path-is-absolute') var common = require('./common.js') var setopts = common.setopts var ownProp = common.ownProp var childrenIgnored = common.childrenIgnored var isIgnored = common.isIgnored function globSync (pattern, options) { if (typeof options === 'function' || arguments.length === 3) throw new TypeError('callback provided to sync glob\n'+ 'See: https://github.com/isaacs/node-glob/issues/167') return new GlobSync(pattern, options).found } function GlobSync (pattern, options) { if (!pattern) throw new Error('must provide pattern') if (typeof options === 'function' || arguments.length === 3) throw new TypeError('callback provided to sync glob\n'+ 'See: https://github.com/isaacs/node-glob/issues/167') if (!(this instanceof GlobSync)) return new GlobSync(pattern, options) setopts(this, pattern, options) if (this.noprocess) return this var n = this.minimatch.set.length this.matches = new Array(n) for (var i = 0; i < n; i ++) { this._process(this.minimatch.set[i], i, false) } this._finish() } GlobSync.prototype._finish = function () { assert(this instanceof GlobSync) if (this.realpath) { var self = this this.matches.forEach(function (matchset, index) { var set = self.matches[index] = Object.create(null) for (var p in matchset) { try { p = self._makeAbs(p) var real = rp.realpathSync(p, self.realpathCache) set[real] = true } catch (er) { if (er.syscall === 'stat') set[self._makeAbs(p)] = true else throw er } } }) } common.finish(this) } GlobSync.prototype._process = function (pattern, index, inGlobStar) { assert(this instanceof GlobSync) // Get the first [n] parts of pattern that are all strings. var n = 0 while (typeof pattern[n] === 'string') { n ++ } // now n is the index of the first one that is *not* a string. // See if there's anything else var prefix switch (n) { // if not, then this is rather simple case pattern.length: this._processSimple(pattern.join('/'), index) return case 0: // pattern *starts* with some non-trivial item. // going to readdir(cwd), but not include the prefix in matches. prefix = null break default: // pattern has some string bits in the front. // whatever it starts with, whether that's 'absolute' like /foo/bar, // or 'relative' like '../baz' prefix = pattern.slice(0, n).join('/') break } var remain = pattern.slice(n) // get the list of entries. var read if (prefix === null) read = '.' else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { if (!prefix || !isAbsolute(prefix)) prefix = '/' + prefix read = prefix } else read = prefix var abs = this._makeAbs(read) //if ignored, skip processing if (childrenIgnored(this, read)) return var isGlobStar = remain[0] === minimatch.GLOBSTAR if (isGlobStar) this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) else this._processReaddir(prefix, read, abs, remain, index, inGlobStar) } GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { var entries = this._readdir(abs, inGlobStar) // if the abs isn't a dir, then nothing can match! if (!entries) return // It will only match dot entries if it starts with a dot, or if // dot is set. Stuff like @(.foo|.bar) isn't allowed. var pn = remain[0] var negate = !!this.minimatch.negate var rawGlob = pn._glob var dotOk = this.dot || rawGlob.charAt(0) === '.' var matchedEntries = [] for (var i = 0; i < entries.length; i++) { var e = entries[i] if (e.charAt(0) !== '.' || dotOk) { var m if (negate && !prefix) { m = !e.match(pn) } else { m = e.match(pn) } if (m) matchedEntries.push(e) } } var len = matchedEntries.length // If there are no matched entries, then nothing matches. if (len === 0) return // if this is the last remaining pattern bit, then no need for // an additional stat *unless* the user has specified mark or // stat explicitly. We know they exist, since readdir returned // them. if (remain.length === 1 && !this.mark && !this.stat) { if (!this.matches[index]) this.matches[index] = Object.create(null) for (var i = 0; i < len; i ++) { var e = matchedEntries[i] if (prefix) { if (prefix.slice(-1) !== '/') e = prefix + '/' + e else e = prefix + e } if (e.charAt(0) === '/' && !this.nomount) { e = path.join(this.root, e) } this._emitMatch(index, e) } // This was the last one, and no stats were needed return } // now test all matched entries as stand-ins for that part // of the pattern. remain.shift() for (var i = 0; i < len; i ++) { var e = matchedEntries[i] var newPattern if (prefix) newPattern = [prefix, e] else newPattern = [e] this._process(newPattern.concat(remain), index, inGlobStar) } } GlobSync.prototype._emitMatch = function (index, e) { if (isIgnored(this, e)) return var abs = this._makeAbs(e) if (this.mark) e = this._mark(e) if (this.absolute) { e = abs } if (this.matches[index][e]) return if (this.nodir) { var c = this.cache[abs] if (c === 'DIR' || Array.isArray(c)) return } this.matches[index][e] = true if (this.stat) this._stat(e) } GlobSync.prototype._readdirInGlobStar = function (abs) { // follow all symlinked directories forever // just proceed as if this is a non-globstar situation if (this.follow) return this._readdir(abs, false) var entries var lstat var stat try { lstat = fs.lstatSync(abs) } catch (er) { if (er.code === 'ENOENT') { // lstat failed, doesn't exist return null } } var isSym = lstat && lstat.isSymbolicLink() this.symlinks[abs] = isSym // If it's not a symlink or a dir, then it's definitely a regular file. // don't bother doing a readdir in that case. if (!isSym && lstat && !lstat.isDirectory()) this.cache[abs] = 'FILE' else entries = this._readdir(abs, false) return entries } GlobSync.prototype._readdir = function (abs, inGlobStar) { var entries if (inGlobStar && !ownProp(this.symlinks, abs)) return this._readdirInGlobStar(abs) if (ownProp(this.cache, abs)) { var c = this.cache[abs] if (!c || c === 'FILE') return null if (Array.isArray(c)) return c } try { return this._readdirEntries(abs, fs.readdirSync(abs)) } catch (er) { this._readdirError(abs, er) return null } } GlobSync.prototype._readdirEntries = function (abs, entries) { // if we haven't asked to stat everything, then just // assume that everything in there exists, so we can avoid // having to stat it a second time. if (!this.mark && !this.stat) { for (var i = 0; i < entries.length; i ++) { var e = entries[i] if (abs === '/') e = abs + e else e = abs + '/' + e this.cache[e] = true } } this.cache[abs] = entries // mark and cache dir-ness return entries } GlobSync.prototype._readdirError = function (f, er) { // handle errors, and cache the information switch (er.code) { case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 case 'ENOTDIR': // totally normal. means it *does* exist. var abs = this._makeAbs(f) this.cache[abs] = 'FILE' if (abs === this.cwdAbs) { var error = new Error(er.code + ' invalid cwd ' + this.cwd) error.path = this.cwd error.code = er.code throw error } break case 'ENOENT': // not terribly unusual case 'ELOOP': case 'ENAMETOOLONG': case 'UNKNOWN': this.cache[this._makeAbs(f)] = false break default: // some unusual error. Treat as failure. this.cache[this._makeAbs(f)] = false if (this.strict) throw er if (!this.silent) console.error('glob error', er) break } } GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { var entries = this._readdir(abs, inGlobStar) // no entries means not a dir, so it can never have matches // foo.txt/** doesn't match foo.txt if (!entries) return // test without the globstar, and with every child both below // and replacing the globstar. var remainWithoutGlobStar = remain.slice(1) var gspref = prefix ? [ prefix ] : [] var noGlobStar = gspref.concat(remainWithoutGlobStar) // the noGlobStar pattern exits the inGlobStar state this._process(noGlobStar, index, false) var len = entries.length var isSym = this.symlinks[abs] // If it's a symlink, and we're in a globstar, then stop if (isSym && inGlobStar) return for (var i = 0; i < len; i++) { var e = entries[i] if (e.charAt(0) === '.' && !this.dot) continue // these two cases enter the inGlobStar state var instead = gspref.concat(entries[i], remainWithoutGlobStar) this._process(instead, index, true) var below = gspref.concat(entries[i], remain) this._process(below, index, true) } } GlobSync.prototype._processSimple = function (prefix, index) { // XXX review this. Shouldn't it be doing the mounting etc // before doing stat? kinda weird? var exists = this._stat(prefix) if (!this.matches[index]) this.matches[index] = Object.create(null) // If it doesn't exist, then just mark the lack of results if (!exists) return if (prefix && isAbsolute(prefix) && !this.nomount) { var trail = /[\/\\]$/.test(prefix) if (prefix.charAt(0) === '/') { prefix = path.join(this.root, prefix) } else { prefix = path.resolve(this.root, prefix) if (trail) prefix += '/' } } if (process.platform === 'win32') prefix = prefix.replace(/\\/g, '/') // Mark this as a match this._emitMatch(index, prefix) } // Returns either 'DIR', 'FILE', or false GlobSync.prototype._stat = function (f) { var abs = this._makeAbs(f) var needDir = f.slice(-1) === '/' if (f.length > this.maxLength) return false if (!this.stat && ownProp(this.cache, abs)) { var c = this.cache[abs] if (Array.isArray(c)) c = 'DIR' // It exists, but maybe not how we need it if (!needDir || c === 'DIR') return c if (needDir && c === 'FILE') return false // otherwise we have to stat, because maybe c=true // if we know it exists, but not what it is. } var exists var stat = this.statCache[abs] if (!stat) { var lstat try { lstat = fs.lstatSync(abs) } catch (er) { if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { this.statCache[abs] = false return false } } if (lstat && lstat.isSymbolicLink()) { try { stat = fs.statSync(abs) } catch (er) { stat = lstat } } else { stat = lstat } } this.statCache[abs] = stat var c = true if (stat) c = stat.isDirectory() ? 'DIR' : 'FILE' this.cache[abs] = this.cache[abs] || c if (needDir && c === 'FILE') return false return c } GlobSync.prototype._mark = function (p) { return common.mark(this, p) } GlobSync.prototype._makeAbs = function (f) { return common.makeAbs(this, f) } The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "semver", "version": "5.7.1", "description": "The semantic version parser used by npm.", "main": "semver.js", "scripts": { "test": "tap", "preversion": "npm test", "postversion": "npm publish", "postpublish": "git push origin --all; git push origin --tags" }, "devDependencies": { "tap": "^13.0.0-rc.18" }, "license": "ISC", "repository": "https://github.com/npm/node-semver", "bin": { "semver": "./bin/semver" }, "files": [ "bin", "range.bnf", "semver.js" ], "tap": { "check-coverage": true } } range-set ::= range ( logical-or range ) * logical-or ::= ( ' ' ) * '||' ( ' ' ) * range ::= hyphen | simple ( ' ' simple ) * | '' hyphen ::= partial ' - ' partial simple ::= primitive | partial | tilde | caret primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? xr ::= 'x' | 'X' | '*' | nr nr ::= '0' | [1-9] ( [0-9] ) * tilde ::= '~' partial caret ::= '^' partial qualifier ::= ( '-' pre )? ( '+' build )? pre ::= parts build ::= parts parts ::= part ( '.' part ) * part ::= nr | [-0-9A-Za-z]+ exports = module.exports = SemVer var debug /* istanbul ignore next */ if (typeof process === 'object' && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { debug = function () { var args = Array.prototype.slice.call(arguments, 0) args.unshift('SEMVER') console.log.apply(console, args) } } else { debug = function () {} } // Note: this is the semver.org version of the spec that it implements // Not necessarily the package version of this code. exports.SEMVER_SPEC_VERSION = '2.0.0' var MAX_LENGTH = 256 var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ 9007199254740991 // Max safe segment length for coercion. var MAX_SAFE_COMPONENT_LENGTH = 16 // The actual regexps go on exports.re var re = exports.re = [] var src = exports.src = [] var R = 0 // The following Regular Expressions can be used for tokenizing, // validating, and parsing SemVer version strings. // ## Numeric Identifier // A single `0`, or a non-zero digit followed by zero or more digits. var NUMERICIDENTIFIER = R++ src[NUMERICIDENTIFIER] = '0|[1-9]\\d*' var NUMERICIDENTIFIERLOOSE = R++ src[NUMERICIDENTIFIERLOOSE] = '[0-9]+' // ## Non-numeric Identifier // Zero or more digits, followed by a letter or hyphen, and then zero or // more letters, digits, or hyphens. var NONNUMERICIDENTIFIER = R++ src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*' // ## Main Version // Three dot-separated numeric identifiers. var MAINVERSION = R++ src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + '(' + src[NUMERICIDENTIFIER] + ')\\.' + '(' + src[NUMERICIDENTIFIER] + ')' var MAINVERSIONLOOSE = R++ src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + '(' + src[NUMERICIDENTIFIERLOOSE] + ')' // ## Pre-release Version Identifier // A numeric identifier, or a non-numeric identifier. var PRERELEASEIDENTIFIER = R++ src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + '|' + src[NONNUMERICIDENTIFIER] + ')' var PRERELEASEIDENTIFIERLOOSE = R++ src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + '|' + src[NONNUMERICIDENTIFIER] + ')' // ## Pre-release Version // Hyphen, followed by one or more dot-separated pre-release version // identifiers. var PRERELEASE = R++ src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))' var PRERELEASELOOSE = R++ src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))' // ## Build Metadata Identifier // Any combination of digits, letters, or hyphens. var BUILDIDENTIFIER = R++ src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+' // ## Build Metadata // Plus sign, followed by one or more period-separated build metadata // identifiers. var BUILD = R++ src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + '(?:\\.' + src[BUILDIDENTIFIER] + ')*))' // ## Full Version String // A main version, followed optionally by a pre-release version and // build metadata. // Note that the only major, minor, patch, and pre-release sections of // the version string are capturing groups. The build metadata is not a // capturing group, because it should not ever be used in version // comparison. var FULL = R++ var FULLPLAIN = 'v?' + src[MAINVERSION] + src[PRERELEASE] + '?' + src[BUILD] + '?' src[FULL] = '^' + FULLPLAIN + '$' // like full, but allows v1.2.3 and =1.2.3, which people do sometimes. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty // common in the npm registry. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + src[PRERELEASELOOSE] + '?' + src[BUILD] + '?' var LOOSE = R++ src[LOOSE] = '^' + LOOSEPLAIN + '$' var GTLT = R++ src[GTLT] = '((?:<|>)?=?)' // Something like "2.*" or "1.2.x". // Note that "x.x" is a valid xRange identifer, meaning "any version" // Only the first item is strictly required. var XRANGEIDENTIFIERLOOSE = R++ src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*' var XRANGEIDENTIFIER = R++ src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*' var XRANGEPLAIN = R++ src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + '(?:' + src[PRERELEASE] + ')?' + src[BUILD] + '?' + ')?)?' var XRANGEPLAINLOOSE = R++ src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + '(?:' + src[PRERELEASELOOSE] + ')?' + src[BUILD] + '?' + ')?)?' var XRANGE = R++ src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$' var XRANGELOOSE = R++ src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$' // Coercion. // Extract anything that could conceivably be a part of a valid semver var COERCE = R++ src[COERCE] = '(?:^|[^\\d])' + '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + '(?:$|[^\\d])' // Tilde ranges. // Meaning is "reasonably at or greater than" var LONETILDE = R++ src[LONETILDE] = '(?:~>?)' var TILDETRIM = R++ src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+' re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g') var tildeTrimReplace = '$1~' var TILDE = R++ src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$' var TILDELOOSE = R++ src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$' // Caret ranges. // Meaning is "at least and backwards compatible with" var LONECARET = R++ src[LONECARET] = '(?:\\^)' var CARETTRIM = R++ src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+' re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g') var caretTrimReplace = '$1^' var CARET = R++ src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$' var CARETLOOSE = R++ src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$' // A simple gt/lt/eq thing, or just "" to indicate "any version" var COMPARATORLOOSE = R++ src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$' var COMPARATOR = R++ src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$' // An expression to strip any whitespace between the gtlt and the thing // it modifies, so that `> 1.2.3` ==> `>1.2.3` var COMPARATORTRIM = R++ src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')' // this one has to use the /g flag re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g') var comparatorTrimReplace = '$1$2$3' // Something like `1.2.3 - 1.2.4` // Note that these all use the loose form, because they'll be // checked against either the strict or loose comparator form // later. var HYPHENRANGE = R++ src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + '\\s+-\\s+' + '(' + src[XRANGEPLAIN] + ')' + '\\s*$' var HYPHENRANGELOOSE = R++ src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + '\\s+-\\s+' + '(' + src[XRANGEPLAINLOOSE] + ')' + '\\s*$' // Star ranges basically just allow anything at all. var STAR = R++ src[STAR] = '(<|>)?=?\\s*\\*' // Compile to actual regexp objects. // All are flag-free, unless they were created above with a flag. for (var i = 0; i < R; i++) { debug(i, src[i]) if (!re[i]) { re[i] = new RegExp(src[i]) } } exports.parse = parse function parse (version, options) { if (!options || typeof options !== 'object') { options = { loose: !!options, includePrerelease: false } } if (version instanceof SemVer) { return version } if (typeof version !== 'string') { return null } if (version.length > MAX_LENGTH) { return null } var r = options.loose ? re[LOOSE] : re[FULL] if (!r.test(version)) { return null } try { return new SemVer(version, options) } catch (er) { return null } } exports.valid = valid function valid (version, options) { var v = parse(version, options) return v ? v.version : null } exports.clean = clean function clean (version, options) { var s = parse(version.trim().replace(/^[=v]+/, ''), options) return s ? s.version : null } exports.SemVer = SemVer function SemVer (version, options) { if (!options || typeof options !== 'object') { options = { loose: !!options, includePrerelease: false } } if (version instanceof SemVer) { if (version.loose === options.loose) { return version } else { version = version.version } } else if (typeof version !== 'string') { throw new TypeError('Invalid Version: ' + version) } if (version.length > MAX_LENGTH) { throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') } if (!(this instanceof SemVer)) { return new SemVer(version, options) } debug('SemVer', version, options) this.options = options this.loose = !!options.loose var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL]) if (!m) { throw new TypeError('Invalid Version: ' + version) } this.raw = version // these are actually numbers this.major = +m[1] this.minor = +m[2] this.patch = +m[3] if (this.major > MAX_SAFE_INTEGER || this.major < 0) { throw new TypeError('Invalid major version') } if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { throw new TypeError('Invalid minor version') } if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { throw new TypeError('Invalid patch version') } // numberify any prerelease numeric ids if (!m[4]) { this.prerelease = [] } else { this.prerelease = m[4].split('.').map(function (id) { if (/^[0-9]+$/.test(id)) { var num = +id if (num >= 0 && num < MAX_SAFE_INTEGER) { return num } } return id }) } this.build = m[5] ? m[5].split('.') : [] this.format() } SemVer.prototype.format = function () { this.version = this.major + '.' + this.minor + '.' + this.patch if (this.prerelease.length) { this.version += '-' + this.prerelease.join('.') } return this.version } SemVer.prototype.toString = function () { return this.version } SemVer.prototype.compare = function (other) { debug('SemVer.compare', this.version, this.options, other) if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } return this.compareMain(other) || this.comparePre(other) } SemVer.prototype.compareMain = function (other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch) } SemVer.prototype.comparePre = function (other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } // NOT having a prerelease is > having one if (this.prerelease.length && !other.prerelease.length) { return -1 } else if (!this.prerelease.length && other.prerelease.length) { return 1 } else if (!this.prerelease.length && !other.prerelease.length) { return 0 } var i = 0 do { var a = this.prerelease[i] var b = other.prerelease[i] debug('prerelease compare', i, a, b) if (a === undefined && b === undefined) { return 0 } else if (b === undefined) { return 1 } else if (a === undefined) { return -1 } else if (a === b) { continue } else { return compareIdentifiers(a, b) } } while (++i) } // preminor will bump the version up to the next minor release, and immediately // down to pre-release. premajor and prepatch work the same way. SemVer.prototype.inc = function (release, identifier) { switch (release) { case 'premajor': this.prerelease.length = 0 this.patch = 0 this.minor = 0 this.major++ this.inc('pre', identifier) break case 'preminor': this.prerelease.length = 0 this.patch = 0 this.minor++ this.inc('pre', identifier) break case 'prepatch': // If this is already a prerelease, it will bump to the next version // drop any prereleases that might already exist, since they are not // relevant at this point. this.prerelease.length = 0 this.inc('patch', identifier) this.inc('pre', identifier) break // If the input is a non-prerelease version, this acts the same as // prepatch. case 'prerelease': if (this.prerelease.length === 0) { this.inc('patch', identifier) } this.inc('pre', identifier) break case 'major': // If this is a pre-major version, bump up to the same major version. // Otherwise increment major. // 1.0.0-5 bumps to 1.0.0 // 1.1.0 bumps to 2.0.0 if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { this.major++ } this.minor = 0 this.patch = 0 this.prerelease = [] break case 'minor': // If this is a pre-minor version, bump up to the same minor version. // Otherwise increment minor. // 1.2.0-5 bumps to 1.2.0 // 1.2.1 bumps to 1.3.0 if (this.patch !== 0 || this.prerelease.length === 0) { this.minor++ } this.patch = 0 this.prerelease = [] break case 'patch': // If this is not a pre-release version, it will increment the patch. // If it is a pre-release it will bump up to the same patch version. // 1.2.0-5 patches to 1.2.0 // 1.2.0 patches to 1.2.1 if (this.prerelease.length === 0) { this.patch++ } this.prerelease = [] break // This probably shouldn't be used publicly. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. case 'pre': if (this.prerelease.length === 0) { this.prerelease = [0] } else { var i = this.prerelease.length while (--i >= 0) { if (typeof this.prerelease[i] === 'number') { this.prerelease[i]++ i = -2 } } if (i === -1) { // didn't increment anything this.prerelease.push(0) } } if (identifier) { // 1.2.0-beta.1 bumps to 1.2.0-beta.2, // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 if (this.prerelease[0] === identifier) { if (isNaN(this.prerelease[1])) { this.prerelease = [identifier, 0] } } else { this.prerelease = [identifier, 0] } } break default: throw new Error('invalid increment argument: ' + release) } this.format() this.raw = this.version return this } exports.inc = inc function inc (version, release, loose, identifier) { if (typeof (loose) === 'string') { identifier = loose loose = undefined } try { return new SemVer(version, loose).inc(release, identifier).version } catch (er) { return null } } exports.diff = diff function diff (version1, version2) { if (eq(version1, version2)) { return null } else { var v1 = parse(version1) var v2 = parse(version2) var prefix = '' if (v1.prerelease.length || v2.prerelease.length) { prefix = 'pre' var defaultResult = 'prerelease' } for (var key in v1) { if (key === 'major' || key === 'minor' || key === 'patch') { if (v1[key] !== v2[key]) { return prefix + key } } } return defaultResult // may be undefined } } exports.compareIdentifiers = compareIdentifiers var numeric = /^[0-9]+$/ function compareIdentifiers (a, b) { var anum = numeric.test(a) var bnum = numeric.test(b) if (anum && bnum) { a = +a b = +b } return a === b ? 0 : (anum && !bnum) ? -1 : (bnum && !anum) ? 1 : a < b ? -1 : 1 } exports.rcompareIdentifiers = rcompareIdentifiers function rcompareIdentifiers (a, b) { return compareIdentifiers(b, a) } exports.major = major function major (a, loose) { return new SemVer(a, loose).major } exports.minor = minor function minor (a, loose) { return new SemVer(a, loose).minor } exports.patch = patch function patch (a, loose) { return new SemVer(a, loose).patch } exports.compare = compare function compare (a, b, loose) { return new SemVer(a, loose).compare(new SemVer(b, loose)) } exports.compareLoose = compareLoose function compareLoose (a, b) { return compare(a, b, true) } exports.rcompare = rcompare function rcompare (a, b, loose) { return compare(b, a, loose) } exports.sort = sort function sort (list, loose) { return list.sort(function (a, b) { return exports.compare(a, b, loose) }) } exports.rsort = rsort function rsort (list, loose) { return list.sort(function (a, b) { return exports.rcompare(a, b, loose) }) } exports.gt = gt function gt (a, b, loose) { return compare(a, b, loose) > 0 } exports.lt = lt function lt (a, b, loose) { return compare(a, b, loose) < 0 } exports.eq = eq function eq (a, b, loose) { return compare(a, b, loose) === 0 } exports.neq = neq function neq (a, b, loose) { return compare(a, b, loose) !== 0 } exports.gte = gte function gte (a, b, loose) { return compare(a, b, loose) >= 0 } exports.lte = lte function lte (a, b, loose) { return compare(a, b, loose) <= 0 } exports.cmp = cmp function cmp (a, op, b, loose) { switch (op) { case '===': if (typeof a === 'object') a = a.version if (typeof b === 'object') b = b.version return a === b case '!==': if (typeof a === 'object') a = a.version if (typeof b === 'object') b = b.version return a !== b case '': case '=': case '==': return eq(a, b, loose) case '!=': return neq(a, b, loose) case '>': return gt(a, b, loose) case '>=': return gte(a, b, loose) case '<': return lt(a, b, loose) case '<=': return lte(a, b, loose) default: throw new TypeError('Invalid operator: ' + op) } } exports.Comparator = Comparator function Comparator (comp, options) { if (!options || typeof options !== 'object') { options = { loose: !!options, includePrerelease: false } } if (comp instanceof Comparator) { if (comp.loose === !!options.loose) { return comp } else { comp = comp.value } } if (!(this instanceof Comparator)) { return new Comparator(comp, options) } debug('comparator', comp, options) this.options = options this.loose = !!options.loose this.parse(comp) if (this.semver === ANY) { this.value = '' } else { this.value = this.operator + this.semver.version } debug('comp', this) } var ANY = {} Comparator.prototype.parse = function (comp) { var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR] var m = comp.match(r) if (!m) { throw new TypeError('Invalid comparator: ' + comp) } this.operator = m[1] if (this.operator === '=') { this.operator = '' } // if it literally is just '>' or '' then allow anything. if (!m[2]) { this.semver = ANY } else { this.semver = new SemVer(m[2], this.options.loose) } } Comparator.prototype.toString = function () { return this.value } Comparator.prototype.test = function (version) { debug('Comparator.test', version, this.options.loose) if (this.semver === ANY) { return true } if (typeof version === 'string') { version = new SemVer(version, this.options) } return cmp(version, this.operator, this.semver, this.options) } Comparator.prototype.intersects = function (comp, options) { if (!(comp instanceof Comparator)) { throw new TypeError('a Comparator is required') } if (!options || typeof options !== 'object') { options = { loose: !!options, includePrerelease: false } } var rangeTmp if (this.operator === '') { rangeTmp = new Range(comp.value, options) return satisfies(this.value, rangeTmp, options) } else if (comp.operator === '') { rangeTmp = new Range(this.value, options) return satisfies(comp.semver, rangeTmp, options) } var sameDirectionIncreasing = (this.operator === '>=' || this.operator === '>') && (comp.operator === '>=' || comp.operator === '>') var sameDirectionDecreasing = (this.operator === '<=' || this.operator === '<') && (comp.operator === '<=' || comp.operator === '<') var sameSemVer = this.semver.version === comp.semver.version var differentDirectionsInclusive = (this.operator === '>=' || this.operator === '<=') && (comp.operator === '>=' || comp.operator === '<=') var oppositeDirectionsLessThan = cmp(this.semver, '<', comp.semver, options) && ((this.operator === '>=' || this.operator === '>') && (comp.operator === '<=' || comp.operator === '<')) var oppositeDirectionsGreaterThan = cmp(this.semver, '>', comp.semver, options) && ((this.operator === '<=' || this.operator === '<') && (comp.operator === '>=' || comp.operator === '>')) return sameDirectionIncreasing || sameDirectionDecreasing || (sameSemVer && differentDirectionsInclusive) || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan } exports.Range = Range function Range (range, options) { if (!options || typeof options !== 'object') { options = { loose: !!options, includePrerelease: false } } if (range instanceof Range) { if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { return range } else { return new Range(range.raw, options) } } if (range instanceof Comparator) { return new Range(range.value, options) } if (!(this instanceof Range)) { return new Range(range, options) } this.options = options this.loose = !!options.loose this.includePrerelease = !!options.includePrerelease // First, split based on boolean or || this.raw = range this.set = range.split(/\s*\|\|\s*/).map(function (range) { return this.parseRange(range.trim()) }, this).filter(function (c) { // throw out any that are not relevant for whatever reason return c.length }) if (!this.set.length) { throw new TypeError('Invalid SemVer Range: ' + range) } this.format() } Range.prototype.format = function () { this.range = this.set.map(function (comps) { return comps.join(' ').trim() }).join('||').trim() return this.range } Range.prototype.toString = function () { return this.range } Range.prototype.parseRange = function (range) { var loose = this.options.loose range = range.trim() // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE] range = range.replace(hr, hyphenReplace) debug('hyphen replace', range) // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace) debug('comparator trim', range, re[COMPARATORTRIM]) // `~ 1.2.3` => `~1.2.3` range = range.replace(re[TILDETRIM], tildeTrimReplace) // `^ 1.2.3` => `^1.2.3` range = range.replace(re[CARETTRIM], caretTrimReplace) // normalize spaces range = range.split(/\s+/).join(' ') // At this point, the range is completely trimmed and // ready to be split into comparators. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR] var set = range.split(' ').map(function (comp) { return parseComparator(comp, this.options) }, this).join(' ').split(/\s+/) if (this.options.loose) { // in loose mode, throw out any that are not valid comparators set = set.filter(function (comp) { return !!comp.match(compRe) }) } set = set.map(function (comp) { return new Comparator(comp, this.options) }, this) return set } Range.prototype.intersects = function (range, options) { if (!(range instanceof Range)) { throw new TypeError('a Range is required') } return this.set.some(function (thisComparators) { return thisComparators.every(function (thisComparator) { return range.set.some(function (rangeComparators) { return rangeComparators.every(function (rangeComparator) { return thisComparator.intersects(rangeComparator, options) }) }) }) }) } // Mostly just for testing and legacy API reasons exports.toComparators = toComparators function toComparators (range, options) { return new Range(range, options).set.map(function (comp) { return comp.map(function (c) { return c.value }).join(' ').trim().split(' ') }) } // comprised of xranges, tildes, stars, and gtlt's at this point. // already replaced the hyphen ranges // turn into a set of JUST comparators. function parseComparator (comp, options) { debug('comp', comp, options) comp = replaceCarets(comp, options) debug('caret', comp) comp = replaceTildes(comp, options) debug('tildes', comp) comp = replaceXRanges(comp, options) debug('xrange', comp) comp = replaceStars(comp, options) debug('stars', comp) return comp } function isX (id) { return !id || id.toLowerCase() === 'x' || id === '*' } // ~, ~> --> * (any, kinda silly) // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 function replaceTildes (comp, options) { return comp.trim().split(/\s+/).map(function (comp) { return replaceTilde(comp, options) }).join(' ') } function replaceTilde (comp, options) { var r = options.loose ? re[TILDELOOSE] : re[TILDE] return comp.replace(r, function (_, M, m, p, pr) { debug('tilde', comp, _, M, m, p, pr) var ret if (isX(M)) { ret = '' } else if (isX(m)) { ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' } else if (isX(p)) { // ~1.2 == >=1.2.0 <1.3.0 ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' } else if (pr) { debug('replaceTilde pr', pr) ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + M + '.' + (+m + 1) + '.0' } else { // ~1.2.3 == >=1.2.3 <1.3.0 ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + (+m + 1) + '.0' } debug('tilde return', ret) return ret }) } // ^ --> * (any, kinda silly) // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 // ^1.2.3 --> >=1.2.3 <2.0.0 // ^1.2.0 --> >=1.2.0 <2.0.0 function replaceCarets (comp, options) { return comp.trim().split(/\s+/).map(function (comp) { return replaceCaret(comp, options) }).join(' ') } function replaceCaret (comp, options) { debug('caret', comp, options) var r = options.loose ? re[CARETLOOSE] : re[CARET] return comp.replace(r, function (_, M, m, p, pr) { debug('caret', comp, _, M, m, p, pr) var ret if (isX(M)) { ret = '' } else if (isX(m)) { ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' } else if (isX(p)) { if (M === '0') { ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' } else { ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0' } } else if (pr) { debug('replaceCaret pr', pr) if (M === '0') { if (m === '0') { ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + M + '.' + m + '.' + (+p + 1) } else { ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + M + '.' + (+m + 1) + '.0' } } else { ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + (+M + 1) + '.0.0' } } else { debug('no pr') if (M === '0') { if (m === '0') { ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + m + '.' + (+p + 1) } else { ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + (+m + 1) + '.0' } } else { ret = '>=' + M + '.' + m + '.' + p + ' <' + (+M + 1) + '.0.0' } } debug('caret return', ret) return ret }) } function replaceXRanges (comp, options) { debug('replaceXRanges', comp, options) return comp.split(/\s+/).map(function (comp) { return replaceXRange(comp, options) }).join(' ') } function replaceXRange (comp, options) { comp = comp.trim() var r = options.loose ? re[XRANGELOOSE] : re[XRANGE] return comp.replace(r, function (ret, gtlt, M, m, p, pr) { debug('xRange', comp, ret, gtlt, M, m, p, pr) var xM = isX(M) var xm = xM || isX(m) var xp = xm || isX(p) var anyX = xp if (gtlt === '=' && anyX) { gtlt = '' } if (xM) { if (gtlt === '>' || gtlt === '<') { // nothing is allowed ret = '<0.0.0' } else { // nothing is forbidden ret = '*' } } else if (gtlt && anyX) { // we know patch is an x, because we have any x at all. // replace X with 0 if (xm) { m = 0 } p = 0 if (gtlt === '>') { // >1 => >=2.0.0 // >1.2 => >=1.3.0 // >1.2.3 => >= 1.2.4 gtlt = '>=' if (xm) { M = +M + 1 m = 0 p = 0 } else { m = +m + 1 p = 0 } } else if (gtlt === '<=') { // <=0.7.x is actually <0.8.0, since any 0.7.x should // pass. Similarly, <=7.x is actually <8.0.0, etc. gtlt = '<' if (xm) { M = +M + 1 } else { m = +m + 1 } } ret = gtlt + M + '.' + m + '.' + p } else if (xm) { ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' } else if (xp) { ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' } debug('xRange return', ret) return ret }) } // Because * is AND-ed with everything else in the comparator, // and '' means "any version", just remove the *s entirely. function replaceStars (comp, options) { debug('replaceStars', comp, options) // Looseness is ignored here. star is always as loose as it gets! return comp.trim().replace(re[STAR], '') } // This function is passed to string.replace(re[HYPHENRANGE]) // M, m, patch, prerelease, build // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do // 1.2 - 3.4 => >=1.2.0 <3.5.0 function hyphenReplace ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) { if (isX(fM)) { from = '' } else if (isX(fm)) { from = '>=' + fM + '.0.0' } else if (isX(fp)) { from = '>=' + fM + '.' + fm + '.0' } else { from = '>=' + from } if (isX(tM)) { to = '' } else if (isX(tm)) { to = '<' + (+tM + 1) + '.0.0' } else if (isX(tp)) { to = '<' + tM + '.' + (+tm + 1) + '.0' } else if (tpr) { to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr } else { to = '<=' + to } return (from + ' ' + to).trim() } // if ANY of the sets match ALL of its comparators, then pass Range.prototype.test = function (version) { if (!version) { return false } if (typeof version === 'string') { version = new SemVer(version, this.options) } for (var i = 0; i < this.set.length; i++) { if (testSet(this.set[i], version, this.options)) { return true } } return false } function testSet (set, version, options) { for (var i = 0; i < set.length; i++) { if (!set[i].test(version)) { return false } } if (version.prerelease.length && !options.includePrerelease) { // Find the set of versions that are allowed to have prereleases // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 // That should allow `1.2.3-pr.2` to pass. // However, `1.2.4-alpha.notready` should NOT be allowed, // even though it's within the range set by the comparators. for (i = 0; i < set.length; i++) { debug(set[i].semver) if (set[i].semver === ANY) { continue } if (set[i].semver.prerelease.length > 0) { var allowed = set[i].semver if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { return true } } } // Version has a -pre, but it's not one of the ones we like. return false } return true } exports.satisfies = satisfies function satisfies (version, range, options) { try { range = new Range(range, options) } catch (er) { return false } return range.test(version) } exports.maxSatisfying = maxSatisfying function maxSatisfying (versions, range, options) { var max = null var maxSV = null try { var rangeObj = new Range(range, options) } catch (er) { return null } versions.forEach(function (v) { if (rangeObj.test(v)) { // satisfies(v, range, options) if (!max || maxSV.compare(v) === -1) { // compare(max, v, true) max = v maxSV = new SemVer(max, options) } } }) return max } exports.minSatisfying = minSatisfying function minSatisfying (versions, range, options) { var min = null var minSV = null try { var rangeObj = new Range(range, options) } catch (er) { return null } versions.forEach(function (v) { if (rangeObj.test(v)) { // satisfies(v, range, options) if (!min || minSV.compare(v) === 1) { // compare(min, v, true) min = v minSV = new SemVer(min, options) } } }) return min } exports.minVersion = minVersion function minVersion (range, loose) { range = new Range(range, loose) var minver = new SemVer('0.0.0') if (range.test(minver)) { return minver } minver = new SemVer('0.0.0-0') if (range.test(minver)) { return minver } minver = null for (var i = 0; i < range.set.length; ++i) { var comparators = range.set[i] comparators.forEach(function (comparator) { // Clone to avoid manipulating the comparator's semver object. var compver = new SemVer(comparator.semver.version) switch (comparator.operator) { case '>': if (compver.prerelease.length === 0) { compver.patch++ } else { compver.prerelease.push(0) } compver.raw = compver.format() /* fallthrough */ case '': case '>=': if (!minver || gt(minver, compver)) { minver = compver } break case '<': case '<=': /* Ignore maximum versions */ break /* istanbul ignore next */ default: throw new Error('Unexpected operation: ' + comparator.operator) } }) } if (minver && range.test(minver)) { return minver } return null } exports.validRange = validRange function validRange (range, options) { try { // Return '*' instead of '' so that truthiness works. // This will throw if it's invalid anyway return new Range(range, options).range || '*' } catch (er) { return null } } // Determine if version is less than all the versions possible in the range exports.ltr = ltr function ltr (version, range, options) { return outside(version, range, '<', options) } // Determine if version is greater than all the versions possible in the range. exports.gtr = gtr function gtr (version, range, options) { return outside(version, range, '>', options) } exports.outside = outside function outside (version, range, hilo, options) { version = new SemVer(version, options) range = new Range(range, options) var gtfn, ltefn, ltfn, comp, ecomp switch (hilo) { case '>': gtfn = gt ltefn = lte ltfn = lt comp = '>' ecomp = '>=' break case '<': gtfn = lt ltefn = gte ltfn = gt comp = '<' ecomp = '<=' break default: throw new TypeError('Must provide a hilo val of "<" or ">"') } // If it satisifes the range it is not outside if (satisfies(version, range, options)) { return false } // From now on, variable terms are as if we're in "gtr" mode. // but note that everything is flipped for the "ltr" function. for (var i = 0; i < range.set.length; ++i) { var comparators = range.set[i] var high = null var low = null comparators.forEach(function (comparator) { if (comparator.semver === ANY) { comparator = new Comparator('>=0.0.0') } high = high || comparator low = low || comparator if (gtfn(comparator.semver, high.semver, options)) { high = comparator } else if (ltfn(comparator.semver, low.semver, options)) { low = comparator } }) // If the edge version comparator has a operator then our version // isn't outside it if (high.operator === comp || high.operator === ecomp) { return false } // If the lowest version comparator has an operator and our version // is less than it then it isn't higher than the range if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { return false } else if (low.operator === ecomp && ltfn(version, low.semver)) { return false } } return true } exports.prerelease = prerelease function prerelease (version, options) { var parsed = parse(version, options) return (parsed && parsed.prerelease.length) ? parsed.prerelease : null } exports.intersects = intersects function intersects (r1, r2, options) { r1 = new Range(r1, options) r2 = new Range(r2, options) return r1.intersects(r2) } exports.coerce = coerce function coerce (version) { if (version instanceof SemVer) { return version } if (typeof version !== 'string') { return null } var match = version.match(re[COERCE]) if (match == null) { return null } return parse(match[1] + '.' + (match[2] || '0') + '.' + (match[3] || '0')) } #!/usr/bin/env node // Standalone semver comparison program. // Exits successfully and prints matching version(s) if // any supplied version is valid and passes all tests. var argv = process.argv.slice(2) var versions = [] var range = [] var inc = null var version = require('../package.json').version var loose = false var includePrerelease = false var coerce = false var identifier var semver = require('../semver') var reverse = false var options = {} main() function main () { if (!argv.length) return help() while (argv.length) { var a = argv.shift() var indexOfEqualSign = a.indexOf('=') if (indexOfEqualSign !== -1) { a = a.slice(0, indexOfEqualSign) argv.unshift(a.slice(indexOfEqualSign + 1)) } switch (a) { case '-rv': case '-rev': case '--rev': case '--reverse': reverse = true break case '-l': case '--loose': loose = true break case '-p': case '--include-prerelease': includePrerelease = true break case '-v': case '--version': versions.push(argv.shift()) break case '-i': case '--inc': case '--increment': switch (argv[0]) { case 'major': case 'minor': case 'patch': case 'prerelease': case 'premajor': case 'preminor': case 'prepatch': inc = argv.shift() break default: inc = 'patch' break } break case '--preid': identifier = argv.shift() break case '-r': case '--range': range.push(argv.shift()) break case '-c': case '--coerce': coerce = true break case '-h': case '--help': case '-?': return help() default: versions.push(a) break } } var options = { loose: loose, includePrerelease: includePrerelease } versions = versions.map(function (v) { return coerce ? (semver.coerce(v) || { version: v }).version : v }).filter(function (v) { return semver.valid(v) }) if (!versions.length) return fail() if (inc && (versions.length !== 1 || range.length)) { return failInc() } for (var i = 0, l = range.length; i < l; i++) { versions = versions.filter(function (v) { return semver.satisfies(v, range[i], options) }) if (!versions.length) return fail() } return success(versions) } function failInc () { console.error('--inc can only be used on a single version with no range') fail() } function fail () { process.exit(1) } function success () { var compare = reverse ? 'rcompare' : 'compare' versions.sort(function (a, b) { return semver[compare](a, b, options) }).map(function (v) { return semver.clean(v, options) }).map(function (v) { return inc ? semver.inc(v, inc, options, identifier) : v }).forEach(function (v, i, _) { console.log(v) }) } function help () { console.log(['SemVer ' + version, '', 'A JavaScript implementation of the https://semver.org/ specification', 'Copyright Isaac Z. Schlueter', '', 'Usage: semver [options] [ [...]]', 'Prints valid versions sorted by SemVer precedence', '', 'Options:', '-r --range ', ' Print versions that match the specified range.', '', '-i --increment []', ' Increment a version by the specified level. Level can', ' be one of: major, minor, patch, premajor, preminor,', " prepatch, or prerelease. Default level is 'patch'.", ' Only one version may be specified.', '', '--preid ', ' Identifier to be used to prefix premajor, preminor,', ' prepatch or prerelease version increments.', '', '-l --loose', ' Interpret versions and ranges loosely', '', '-p --include-prerelease', ' Always include prerelease versions in range matching', '', '-c --coerce', ' Coerce a string into SemVer if possible', ' (does not imply --loose)', '', 'Program exits successfully if any valid version satisfies', 'all supplied ranges, and prints all satisfying versions.', '', 'If no satisfying versions are found, then exits failure.', '', 'Versions are printed in ascending order, so supplying', 'multiple versions to the utility will just sort them.' ].join('\n')) } /*! simple-get. MIT License. Feross Aboukhadijeh */ module.exports = simpleGet const concat = require('simple-concat') const decompressResponse = require('decompress-response') // excluded from browser build const http = require('http') const https = require('https') const once = require('once') const querystring = require('querystring') const url = require('url') const isStream = o => o !== null && typeof o === 'object' && typeof o.pipe === 'function' function simpleGet (opts, cb) { opts = Object.assign({ maxRedirects: 10 }, typeof opts === 'string' ? { url: opts } : opts) cb = once(cb) if (opts.url) { const { hostname, port, protocol, auth, path } = url.parse(opts.url) // eslint-disable-line node/no-deprecated-api delete opts.url if (!hostname && !port && !protocol && !auth) opts.path = path // Relative redirect else Object.assign(opts, { hostname, port, protocol, auth, path }) // Absolute redirect } const headers = { 'accept-encoding': 'gzip, deflate' } if (opts.headers) Object.keys(opts.headers).forEach(k => (headers[k.toLowerCase()] = opts.headers[k])) opts.headers = headers let body if (opts.body) { body = opts.json && !isStream(opts.body) ? JSON.stringify(opts.body) : opts.body } else if (opts.form) { body = typeof opts.form === 'string' ? opts.form : querystring.stringify(opts.form) opts.headers['content-type'] = 'application/x-www-form-urlencoded' } if (body) { if (!opts.method) opts.method = 'POST' if (!isStream(body)) opts.headers['content-length'] = Buffer.byteLength(body) if (opts.json && !opts.form) opts.headers['content-type'] = 'application/json' } delete opts.body; delete opts.form if (opts.json) opts.headers.accept = 'application/json' if (opts.method) opts.method = opts.method.toUpperCase() const originalHost = opts.hostname // hostname before potential redirect const protocol = opts.protocol === 'https:' ? https : http // Support http/https urls const req = protocol.request(opts, res => { if (opts.followRedirects !== false && res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) { opts.url = res.headers.location // Follow 3xx redirects delete opts.headers.host // Discard `host` header on redirect (see #32) res.resume() // Discard response const redirectHost = url.parse(opts.url).hostname // eslint-disable-line node/no-deprecated-api // If redirected host is different than original host, drop headers to prevent cookie leak (#73) if (redirectHost !== null && redirectHost !== originalHost) { delete opts.headers.cookie delete opts.headers.authorization } if (opts.method === 'POST' && [301, 302].includes(res.statusCode)) { opts.method = 'GET' // On 301/302 redirect, change POST to GET (see #35) delete opts.headers['content-length']; delete opts.headers['content-type'] } if (opts.maxRedirects-- === 0) return cb(new Error('too many redirects')) else return simpleGet(opts, cb) } const tryUnzip = typeof decompressResponse === 'function' && opts.method !== 'HEAD' cb(null, tryUnzip ? decompressResponse(res) : res) }) req.on('timeout', () => { req.abort() cb(new Error('Request timed out')) }) req.on('error', cb) if (isStream(body)) body.on('error', cb).pipe(req) else req.end(body) return req } simpleGet.concat = (opts, cb) => { return simpleGet(opts, (err, res) => { if (err) return cb(err) concat(res, (err, data) => { if (err) return cb(err) if (opts.json) { try { data = JSON.parse(data.toString()) } catch (err) { return cb(err, res, data) } } cb(null, res, data) }) }) } ;['get', 'post', 'put', 'patch', 'head', 'delete'].forEach(method => { simpleGet[method] = (opts, cb) => { if (typeof opts === 'string') opts = { url: opts } return simpleGet(Object.assign({ method: method.toUpperCase() }, opts), cb) } }) The MIT License (MIT) Copyright (c) Feross Aboukhadijeh Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "simple-get", "description": "Simplest way to make http get requests. Supports HTTPS, redirects, gzip/deflate, streams in < 100 lines.", "version": "4.0.1", "author": { "name": "Feross Aboukhadijeh", "email": "feross@feross.org", "url": "https://feross.org" }, "browser": { "decompress-response": false }, "bugs": { "url": "https://github.com/feross/simple-get/issues" }, "dependencies": { "decompress-response": "^6.0.0", "once": "^1.3.1", "simple-concat": "^1.0.0" }, "devDependencies": { "self-signed-https": "^1.0.5", "standard": "*", "string-to-stream": "^3.0.0", "tape": "^5.0.0" }, "homepage": "https://github.com/feross/simple-get", "keywords": [ "request", "http", "GET", "get request", "http.get", "redirects", "follow redirects", "gzip", "deflate", "https", "http-https", "stream", "simple request", "simple get" ], "license": "MIT", "main": "index.js", "repository": { "type": "git", "url": "git://github.com/feross/simple-get.git" }, "scripts": { "test": "standard && tape test/*.js" }, "funding": [ { "type": "github", "url": "https://github.com/sponsors/feross" }, { "type": "patreon", "url": "https://www.patreon.com/feross" }, { "type": "consulting", "url": "https://feross.org/support" } ] } 'use strict'; const {Transform, PassThrough} = require('stream'); const zlib = require('zlib'); const mimicResponse = require('mimic-response'); module.exports = response => { const contentEncoding = (response.headers['content-encoding'] || '').toLowerCase(); if (!['gzip', 'deflate', 'br'].includes(contentEncoding)) { return response; } // TODO: Remove this when targeting Node.js 12. const isBrotli = contentEncoding === 'br'; if (isBrotli && typeof zlib.createBrotliDecompress !== 'function') { response.destroy(new Error('Brotli is not supported on Node.js < 12')); return response; } let isEmpty = true; const checker = new Transform({ transform(data, _encoding, callback) { isEmpty = false; callback(null, data); }, flush(callback) { callback(); } }); const finalStream = new PassThrough({ autoDestroy: false, destroy(error, callback) { response.destroy(); callback(error); } }); const decompressStream = isBrotli ? zlib.createBrotliDecompress() : zlib.createUnzip(); decompressStream.once('error', error => { if (isEmpty && !response.readable) { finalStream.end(); return; } finalStream.destroy(error); }); mimicResponse(response, finalStream); response.pipe(checker).pipe(decompressStream).pipe(finalStream); return finalStream; }; MIT License Copyright (c) Sindre Sorhus (https://sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "decompress-response", "version": "6.0.0", "description": "Decompress a HTTP response if needed", "license": "MIT", "repository": "sindresorhus/decompress-response", "funding": "https://github.com/sponsors/sindresorhus", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "https://sindresorhus.com" }, "engines": { "node": ">=10" }, "scripts": { "test": "xo && ava && tsd" }, "files": [ "index.js", "index.d.ts" ], "keywords": [ "decompress", "response", "http", "https", "zlib", "gzip", "zip", "deflate", "unzip", "ungzip", "incoming", "message", "stream", "compressed", "brotli" ], "dependencies": { "mimic-response": "^3.1.0" }, "devDependencies": { "@types/node": "^14.0.1", "ava": "^2.2.0", "get-stream": "^5.0.0", "pify": "^5.0.0", "tsd": "^0.11.0", "xo": "^0.30.0" }, "xo": { "rules": { "@typescript-eslint/prefer-readonly-parameter-types": "off" } } } 'use strict'; // We define these manually to ensure they're always copied // even if they would move up the prototype chain // https://nodejs.org/api/http.html#http_class_http_incomingmessage const knownProperties = [ 'aborted', 'complete', 'headers', 'httpVersion', 'httpVersionMinor', 'httpVersionMajor', 'method', 'rawHeaders', 'rawTrailers', 'setTimeout', 'socket', 'statusCode', 'statusMessage', 'trailers', 'url' ]; module.exports = (fromStream, toStream) => { if (toStream._readableState.autoDestroy) { throw new Error('The second stream must have the `autoDestroy` option set to `false`'); } const fromProperties = new Set(Object.keys(fromStream).concat(knownProperties)); const properties = {}; for (const property of fromProperties) { // Don't overwrite existing properties. if (property in toStream) { continue; } properties[property] = { get() { const value = fromStream[property]; const isFunction = typeof value === 'function'; return isFunction ? value.bind(fromStream) : value; }, set(value) { fromStream[property] = value; }, enumerable: true, configurable: false }; } Object.defineProperties(toStream, properties); fromStream.once('aborted', () => { toStream.destroy(); toStream.emit('aborted'); }); fromStream.once('close', () => { if (fromStream.complete) { if (toStream.readable) { toStream.once('end', () => { toStream.emit('close'); }); } else { toStream.emit('close'); } } else { toStream.emit('close'); } }); return toStream; }; MIT License Copyright (c) Sindre Sorhus (https://sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "mimic-response", "version": "3.1.0", "description": "Mimic a Node.js HTTP response stream", "license": "MIT", "repository": "sindresorhus/mimic-response", "funding": "https://github.com/sponsors/sindresorhus", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "https://sindresorhus.com" }, "engines": { "node": ">=10" }, "scripts": { "test": "xo && ava && tsd" }, "files": [ "index.d.ts", "index.js" ], "keywords": [ "mimic", "response", "stream", "http", "https", "request", "get", "core" ], "devDependencies": { "@types/node": "^14.0.1", "ava": "^2.4.0", "create-test-server": "^2.4.0", "p-event": "^4.1.0", "pify": "^5.0.0", "tsd": "^0.11.0", "xo": "^0.30.0" } } The MIT License (MIT) Copyright (c) 2013 Josh Glazebrook Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "socks", "private": false, "version": "2.6.1", "description": "Fully featured SOCKS proxy client supporting SOCKSv4, SOCKSv4a, and SOCKSv5. Includes Bind and Associate functionality.", "main": "build/index.js", "typings": "typings/index.d.ts", "homepage": "https://github.com/JoshGlazebrook/socks/", "repository": { "type": "git", "url": "https://github.com/JoshGlazebrook/socks.git" }, "bugs": { "url": "https://github.com/JoshGlazebrook/socks/issues" }, "keywords": [ "socks", "proxy", "tor", "socks 4", "socks 5", "socks4", "socks5" ], "engines": { "node": ">= 10.13.0", "npm": ">= 3.0.0" }, "author": "Josh Glazebrook", "contributors": [ "castorw" ], "license": "MIT", "readmeFilename": "README.md", "devDependencies": { "@types/ip": "1.1.0", "@types/mocha": "^8.2.2", "@types/node": "^14.14.41", "coveralls": "3.1.0", "mocha": "^8.3.2", "nyc": "15.1.0", "prettier": "^2.2.1", "socks5-server": "^0.1.1", "ts-node": "^9.1.1", "tslint": "^6.1.3", "tslint-config-airbnb": "^5.11.2", "typescript": "^4.2.4" }, "dependencies": { "ip": "^1.1.5", "smart-buffer": "^4.1.0" }, "scripts": { "prepublish": "npm install -g typescript && npm run build", "test": "NODE_ENV=test mocha --recursive --require ts-node/register test/**/*.ts", "prettier": "prettier --write ./src/**/*.ts --config .prettierrc.yaml", "coverage": "NODE_ENV=test nyc npm test", "coveralls": "NODE_ENV=test nyc npm test && nyc report --reporter=text-lcov | coveralls", "lint": "tslint --project tsconfig.json 'src/**/*.ts'", "build": "rm -rf build typings && prettier --write ./src/**/*.ts --config .prettierrc.yaml && tsc -p ." }, "nyc": { "extension": [ ".ts", ".tsx" ], "include": [ "src/*.ts", "src/**/*.ts" ], "exclude": [ "**.*.d.ts", "node_modules", "typings" ], "require": [ "ts-node/register" ], "reporter": [ "json", "html" ], "all": true } } "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./client/socksclient"), exports);//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/socks/build/index.js.map"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.SocksClientError = exports.SocksClient = void 0; const events_1 = require("events"); const net = require("net"); const ip = require("ip"); const smart_buffer_1 = require("smart-buffer"); const constants_1 = require("../common/constants"); const helpers_1 = require("../common/helpers"); const receivebuffer_1 = require("../common/receivebuffer"); const util_1 = require("../common/util"); Object.defineProperty(exports, "SocksClientError", { enumerable: true, get: function () { return util_1.SocksClientError; } }); class SocksClient extends events_1.EventEmitter { constructor(options) { super(); this.options = Object.assign({}, options); // Validate SocksClientOptions helpers_1.validateSocksClientOptions(options); // Default state this.setState(constants_1.SocksClientState.Created); } /** * Creates a new SOCKS connection. * * Note: Supports callbacks and promises. Only supports the connect command. * @param options { SocksClientOptions } Options. * @param callback { Function } An optional callback function. * @returns { Promise } */ static createConnection(options, callback) { return new Promise((resolve, reject) => { // Validate SocksClientOptions try { helpers_1.validateSocksClientOptions(options, ['connect']); } catch (err) { if (typeof callback === 'function') { callback(err); return resolve(err); // Resolves pending promise (prevents memory leaks). } else { return reject(err); } } const client = new SocksClient(options); client.connect(options.existing_socket); client.once('established', (info) => { client.removeAllListeners(); if (typeof callback === 'function') { callback(null, info); resolve(info); // Resolves pending promise (prevents memory leaks). } else { resolve(info); } }); // Error occurred, failed to establish connection. client.once('error', (err) => { client.removeAllListeners(); if (typeof callback === 'function') { callback(err); resolve(err); // Resolves pending promise (prevents memory leaks). } else { reject(err); } }); }); } /** * Creates a new SOCKS connection chain to a destination host through 2 or more SOCKS proxies. * * Note: Supports callbacks and promises. Only supports the connect method. * Note: Implemented via createConnection() factory function. * @param options { SocksClientChainOptions } Options * @param callback { Function } An optional callback function. * @returns { Promise } */ static createConnectionChain(options, callback) { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { // Validate SocksClientChainOptions try { helpers_1.validateSocksClientChainOptions(options); } catch (err) { if (typeof callback === 'function') { callback(err); return resolve(err); // Resolves pending promise (prevents memory leaks). } else { return reject(err); } } let sock; // Shuffle proxies if (options.randomizeChain) { util_1.shuffleArray(options.proxies); } try { // tslint:disable-next-line:no-increment-decrement for (let i = 0; i < options.proxies.length; i++) { const nextProxy = options.proxies[i]; // If we've reached the last proxy in the chain, the destination is the actual destination, otherwise it's the next proxy. const nextDestination = i === options.proxies.length - 1 ? options.destination : { host: options.proxies[i + 1].ipaddress, port: options.proxies[i + 1].port, }; // Creates the next connection in the chain. const result = yield SocksClient.createConnection({ command: 'connect', proxy: nextProxy, destination: nextDestination, // Initial connection ignores this as sock is undefined. Subsequent connections re-use the first proxy socket to form a chain. }); // If sock is undefined, assign it here. if (!sock) { sock = result.socket; } } if (typeof callback === 'function') { callback(null, { socket: sock }); resolve({ socket: sock }); // Resolves pending promise (prevents memory leaks). } else { resolve({ socket: sock }); } } catch (err) { if (typeof callback === 'function') { callback(err); resolve(err); // Resolves pending promise (prevents memory leaks). } else { reject(err); } } })); } /** * Creates a SOCKS UDP Frame. * @param options */ static createUDPFrame(options) { const buff = new smart_buffer_1.SmartBuffer(); buff.writeUInt16BE(0); buff.writeUInt8(options.frameNumber || 0); // IPv4/IPv6/Hostname if (net.isIPv4(options.remoteHost.host)) { buff.writeUInt8(constants_1.Socks5HostType.IPv4); buff.writeUInt32BE(ip.toLong(options.remoteHost.host)); } else if (net.isIPv6(options.remoteHost.host)) { buff.writeUInt8(constants_1.Socks5HostType.IPv6); buff.writeBuffer(ip.toBuffer(options.remoteHost.host)); } else { buff.writeUInt8(constants_1.Socks5HostType.Hostname); buff.writeUInt8(Buffer.byteLength(options.remoteHost.host)); buff.writeString(options.remoteHost.host); } // Port buff.writeUInt16BE(options.remoteHost.port); // Data buff.writeBuffer(options.data); return buff.toBuffer(); } /** * Parses a SOCKS UDP frame. * @param data */ static parseUDPFrame(data) { const buff = smart_buffer_1.SmartBuffer.fromBuffer(data); buff.readOffset = 2; const frameNumber = buff.readUInt8(); const hostType = buff.readUInt8(); let remoteHost; if (hostType === constants_1.Socks5HostType.IPv4) { remoteHost = ip.fromLong(buff.readUInt32BE()); } else if (hostType === constants_1.Socks5HostType.IPv6) { remoteHost = ip.toString(buff.readBuffer(16)); } else { remoteHost = buff.readString(buff.readUInt8()); } const remotePort = buff.readUInt16BE(); return { frameNumber, remoteHost: { host: remoteHost, port: remotePort, }, data: buff.readBuffer(), }; } /** * Internal state setter. If the SocksClient is in an error state, it cannot be changed to a non error state. */ setState(newState) { if (this.state !== constants_1.SocksClientState.Error) { this.state = newState; } } /** * Starts the connection establishment to the proxy and destination. * @param existingSocket Connected socket to use instead of creating a new one (internal use). */ connect(existingSocket) { this.onDataReceived = (data) => this.onDataReceivedHandler(data); this.onClose = () => this.onCloseHandler(); this.onError = (err) => this.onErrorHandler(err); this.onConnect = () => this.onConnectHandler(); // Start timeout timer (defaults to 30 seconds) const timer = setTimeout(() => this.onEstablishedTimeout(), this.options.timeout || constants_1.DEFAULT_TIMEOUT); // check whether unref is available as it differs from browser to NodeJS (#33) if (timer.unref && typeof timer.unref === 'function') { timer.unref(); } // If an existing socket is provided, use it to negotiate SOCKS handshake. Otherwise create a new Socket. if (existingSocket) { this.socket = existingSocket; } else { this.socket = new net.Socket(); } // Attach Socket error handlers. this.socket.once('close', this.onClose); this.socket.once('error', this.onError); this.socket.once('connect', this.onConnect); this.socket.on('data', this.onDataReceived); this.setState(constants_1.SocksClientState.Connecting); this.receiveBuffer = new receivebuffer_1.ReceiveBuffer(); if (existingSocket) { this.socket.emit('connect'); } else { this.socket.connect(this.getSocketOptions()); if (this.options.set_tcp_nodelay !== undefined && this.options.set_tcp_nodelay !== null) { this.socket.setNoDelay(!!this.options.set_tcp_nodelay); } } // Listen for established event so we can re-emit any excess data received during handshakes. this.prependOnceListener('established', (info) => { setImmediate(() => { if (this.receiveBuffer.length > 0) { const excessData = this.receiveBuffer.get(this.receiveBuffer.length); info.socket.emit('data', excessData); } info.socket.resume(); }); }); } // Socket options (defaults host/port to options.proxy.host/options.proxy.port) getSocketOptions() { return Object.assign(Object.assign({}, this.options.socket_options), { host: this.options.proxy.host || this.options.proxy.ipaddress, port: this.options.proxy.port }); } /** * Handles internal Socks timeout callback. * Note: If the Socks client is not BoundWaitingForConnection or Established, the connection will be closed. */ onEstablishedTimeout() { if (this.state !== constants_1.SocksClientState.Established && this.state !== constants_1.SocksClientState.BoundWaitingForConnection) { this.closeSocket(constants_1.ERRORS.ProxyConnectionTimedOut); } } /** * Handles Socket connect event. */ onConnectHandler() { this.setState(constants_1.SocksClientState.Connected); // Send initial handshake. if (this.options.proxy.type === 4) { this.sendSocks4InitialHandshake(); } else { this.sendSocks5InitialHandshake(); } this.setState(constants_1.SocksClientState.SentInitialHandshake); } /** * Handles Socket data event. * @param data */ onDataReceivedHandler(data) { /* All received data is appended to a ReceiveBuffer. This makes sure that all the data we need is received before we attempt to process it. */ this.receiveBuffer.append(data); // Process data that we have. this.processData(); } /** * Handles processing of the data we have received. */ processData() { // If we have enough data to process the next step in the SOCKS handshake, proceed. while (this.state !== constants_1.SocksClientState.Established && this.state !== constants_1.SocksClientState.Error && this.receiveBuffer.length >= this.nextRequiredPacketBufferSize) { // Sent initial handshake, waiting for response. if (this.state === constants_1.SocksClientState.SentInitialHandshake) { if (this.options.proxy.type === 4) { // Socks v4 only has one handshake response. this.handleSocks4FinalHandshakeResponse(); } else { // Socks v5 has two handshakes, handle initial one here. this.handleInitialSocks5HandshakeResponse(); } // Sent auth request for Socks v5, waiting for response. } else if (this.state === constants_1.SocksClientState.SentAuthentication) { this.handleInitialSocks5AuthenticationHandshakeResponse(); // Sent final Socks v5 handshake, waiting for final response. } else if (this.state === constants_1.SocksClientState.SentFinalHandshake) { this.handleSocks5FinalHandshakeResponse(); // Socks BIND established. Waiting for remote connection via proxy. } else if (this.state === constants_1.SocksClientState.BoundWaitingForConnection) { if (this.options.proxy.type === 4) { this.handleSocks4IncomingConnectionResponse(); } else { this.handleSocks5IncomingConnectionResponse(); } } else { this.closeSocket(constants_1.ERRORS.InternalError); break; } } } /** * Handles Socket close event. * @param had_error */ onCloseHandler() { this.closeSocket(constants_1.ERRORS.SocketClosed); } /** * Handles Socket error event. * @param err */ onErrorHandler(err) { this.closeSocket(err.message); } /** * Removes internal event listeners on the underlying Socket. */ removeInternalSocketHandlers() { // Pauses data flow of the socket (this is internally resumed after 'established' is emitted) this.socket.pause(); this.socket.removeListener('data', this.onDataReceived); this.socket.removeListener('close', this.onClose); this.socket.removeListener('error', this.onError); this.socket.removeListener('connect', this.onConnect); } /** * Closes and destroys the underlying Socket. Emits an error event. * @param err { String } An error string to include in error event. */ closeSocket(err) { // Make sure only one 'error' event is fired for the lifetime of this SocksClient instance. if (this.state !== constants_1.SocksClientState.Error) { // Set internal state to Error. this.setState(constants_1.SocksClientState.Error); // Destroy Socket this.socket.destroy(); // Remove internal listeners this.removeInternalSocketHandlers(); // Fire 'error' event. this.emit('error', new util_1.SocksClientError(err, this.options)); } } /** * Sends initial Socks v4 handshake request. */ sendSocks4InitialHandshake() { const userId = this.options.proxy.userId || ''; const buff = new smart_buffer_1.SmartBuffer(); buff.writeUInt8(0x04); buff.writeUInt8(constants_1.SocksCommand[this.options.command]); buff.writeUInt16BE(this.options.destination.port); // Socks 4 (IPv4) if (net.isIPv4(this.options.destination.host)) { buff.writeBuffer(ip.toBuffer(this.options.destination.host)); buff.writeStringNT(userId); // Socks 4a (hostname) } else { buff.writeUInt8(0x00); buff.writeUInt8(0x00); buff.writeUInt8(0x00); buff.writeUInt8(0x01); buff.writeStringNT(userId); buff.writeStringNT(this.options.destination.host); } this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks4Response; this.socket.write(buff.toBuffer()); } /** * Handles Socks v4 handshake response. * @param data */ handleSocks4FinalHandshakeResponse() { const data = this.receiveBuffer.get(8); if (data[1] !== constants_1.Socks4Response.Granted) { this.closeSocket(`${constants_1.ERRORS.Socks4ProxyRejectedConnection} - (${constants_1.Socks4Response[data[1]]})`); } else { // Bind response if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.bind) { const buff = smart_buffer_1.SmartBuffer.fromBuffer(data); buff.readOffset = 2; const remoteHost = { port: buff.readUInt16BE(), host: ip.fromLong(buff.readUInt32BE()), }; // If host is 0.0.0.0, set to proxy host. if (remoteHost.host === '0.0.0.0') { remoteHost.host = this.options.proxy.ipaddress; } this.setState(constants_1.SocksClientState.BoundWaitingForConnection); this.emit('bound', { remoteHost, socket: this.socket }); // Connect response } else { this.setState(constants_1.SocksClientState.Established); this.removeInternalSocketHandlers(); this.emit('established', { socket: this.socket }); } } } /** * Handles Socks v4 incoming connection request (BIND) * @param data */ handleSocks4IncomingConnectionResponse() { const data = this.receiveBuffer.get(8); if (data[1] !== constants_1.Socks4Response.Granted) { this.closeSocket(`${constants_1.ERRORS.Socks4ProxyRejectedIncomingBoundConnection} - (${constants_1.Socks4Response[data[1]]})`); } else { const buff = smart_buffer_1.SmartBuffer.fromBuffer(data); buff.readOffset = 2; const remoteHost = { port: buff.readUInt16BE(), host: ip.fromLong(buff.readUInt32BE()), }; this.setState(constants_1.SocksClientState.Established); this.removeInternalSocketHandlers(); this.emit('established', { remoteHost, socket: this.socket }); } } /** * Sends initial Socks v5 handshake request. */ sendSocks5InitialHandshake() { const buff = new smart_buffer_1.SmartBuffer(); // By default we always support no auth. const supportedAuthMethods = [constants_1.Socks5Auth.NoAuth]; // We should only tell the proxy we support user/pass auth if auth info is actually provided. // Note: As of Tor v0.3.5.7+, if user/pass auth is an option from the client, by default it will always take priority. if (this.options.proxy.userId || this.options.proxy.password) { supportedAuthMethods.push(constants_1.Socks5Auth.UserPass); } // Custom auth method? if (this.options.proxy.custom_auth_method !== undefined) { supportedAuthMethods.push(this.options.proxy.custom_auth_method); } // Build handshake packet buff.writeUInt8(0x05); buff.writeUInt8(supportedAuthMethods.length); for (const authMethod of supportedAuthMethods) { buff.writeUInt8(authMethod); } this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5InitialHandshakeResponse; this.socket.write(buff.toBuffer()); this.setState(constants_1.SocksClientState.SentInitialHandshake); } /** * Handles initial Socks v5 handshake response. * @param data */ handleInitialSocks5HandshakeResponse() { const data = this.receiveBuffer.get(2); if (data[0] !== 0x05) { this.closeSocket(constants_1.ERRORS.InvalidSocks5IntiailHandshakeSocksVersion); } else if (data[1] === constants_1.SOCKS5_NO_ACCEPTABLE_AUTH) { this.closeSocket(constants_1.ERRORS.InvalidSocks5InitialHandshakeNoAcceptedAuthType); } else { // If selected Socks v5 auth method is no auth, send final handshake request. if (data[1] === constants_1.Socks5Auth.NoAuth) { this.socks5ChosenAuthType = constants_1.Socks5Auth.NoAuth; this.sendSocks5CommandRequest(); // If selected Socks v5 auth method is user/password, send auth handshake. } else if (data[1] === constants_1.Socks5Auth.UserPass) { this.socks5ChosenAuthType = constants_1.Socks5Auth.UserPass; this.sendSocks5UserPassAuthentication(); // If selected Socks v5 auth method is the custom_auth_method, send custom handshake. } else if (data[1] === this.options.proxy.custom_auth_method) { this.socks5ChosenAuthType = this.options.proxy.custom_auth_method; this.sendSocks5CustomAuthentication(); } else { this.closeSocket(constants_1.ERRORS.InvalidSocks5InitialHandshakeUnknownAuthType); } } } /** * Sends Socks v5 user & password auth handshake. * * Note: No auth and user/pass are currently supported. */ sendSocks5UserPassAuthentication() { const userId = this.options.proxy.userId || ''; const password = this.options.proxy.password || ''; const buff = new smart_buffer_1.SmartBuffer(); buff.writeUInt8(0x01); buff.writeUInt8(Buffer.byteLength(userId)); buff.writeString(userId); buff.writeUInt8(Buffer.byteLength(password)); buff.writeString(password); this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5UserPassAuthenticationResponse; this.socket.write(buff.toBuffer()); this.setState(constants_1.SocksClientState.SentAuthentication); } sendSocks5CustomAuthentication() { return __awaiter(this, void 0, void 0, function* () { this.nextRequiredPacketBufferSize = this.options.proxy.custom_auth_response_size; this.socket.write(yield this.options.proxy.custom_auth_request_handler()); this.setState(constants_1.SocksClientState.SentAuthentication); }); } handleSocks5CustomAuthHandshakeResponse(data) { return __awaiter(this, void 0, void 0, function* () { return yield this.options.proxy.custom_auth_response_handler(data); }); } handleSocks5AuthenticationNoAuthHandshakeResponse(data) { return __awaiter(this, void 0, void 0, function* () { return data[1] === 0x00; }); } handleSocks5AuthenticationUserPassHandshakeResponse(data) { return __awaiter(this, void 0, void 0, function* () { return data[1] === 0x00; }); } /** * Handles Socks v5 auth handshake response. * @param data */ handleInitialSocks5AuthenticationHandshakeResponse() { return __awaiter(this, void 0, void 0, function* () { this.setState(constants_1.SocksClientState.ReceivedAuthenticationResponse); let authResult = false; if (this.socks5ChosenAuthType === constants_1.Socks5Auth.NoAuth) { authResult = yield this.handleSocks5AuthenticationNoAuthHandshakeResponse(this.receiveBuffer.get(2)); } else if (this.socks5ChosenAuthType === constants_1.Socks5Auth.UserPass) { authResult = yield this.handleSocks5AuthenticationUserPassHandshakeResponse(this.receiveBuffer.get(2)); } else if (this.socks5ChosenAuthType === this.options.proxy.custom_auth_method) { authResult = yield this.handleSocks5CustomAuthHandshakeResponse(this.receiveBuffer.get(this.options.proxy.custom_auth_response_size)); } if (!authResult) { this.closeSocket(constants_1.ERRORS.Socks5AuthenticationFailed); } else { this.sendSocks5CommandRequest(); } }); } /** * Sends Socks v5 final handshake request. */ sendSocks5CommandRequest() { const buff = new smart_buffer_1.SmartBuffer(); buff.writeUInt8(0x05); buff.writeUInt8(constants_1.SocksCommand[this.options.command]); buff.writeUInt8(0x00); // ipv4, ipv6, domain? if (net.isIPv4(this.options.destination.host)) { buff.writeUInt8(constants_1.Socks5HostType.IPv4); buff.writeBuffer(ip.toBuffer(this.options.destination.host)); } else if (net.isIPv6(this.options.destination.host)) { buff.writeUInt8(constants_1.Socks5HostType.IPv6); buff.writeBuffer(ip.toBuffer(this.options.destination.host)); } else { buff.writeUInt8(constants_1.Socks5HostType.Hostname); buff.writeUInt8(this.options.destination.host.length); buff.writeString(this.options.destination.host); } buff.writeUInt16BE(this.options.destination.port); this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader; this.socket.write(buff.toBuffer()); this.setState(constants_1.SocksClientState.SentFinalHandshake); } /** * Handles Socks v5 final handshake response. * @param data */ handleSocks5FinalHandshakeResponse() { // Peek at available data (we need at least 5 bytes to get the hostname length) const header = this.receiveBuffer.peek(5); if (header[0] !== 0x05 || header[1] !== constants_1.Socks5Response.Granted) { this.closeSocket(`${constants_1.ERRORS.InvalidSocks5FinalHandshakeRejected} - ${constants_1.Socks5Response[header[1]]}`); } else { // Read address type const addressType = header[3]; let remoteHost; let buff; // IPv4 if (addressType === constants_1.Socks5HostType.IPv4) { // Check if data is available. const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4; if (this.receiveBuffer.length < dataNeeded) { this.nextRequiredPacketBufferSize = dataNeeded; return; } buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4)); remoteHost = { host: ip.fromLong(buff.readUInt32BE()), port: buff.readUInt16BE(), }; // If given host is 0.0.0.0, assume remote proxy ip instead. if (remoteHost.host === '0.0.0.0') { remoteHost.host = this.options.proxy.ipaddress; } // Hostname } else if (addressType === constants_1.Socks5HostType.Hostname) { const hostLength = header[4]; const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(hostLength); // header + host length + host + port // Check if data is available. if (this.receiveBuffer.length < dataNeeded) { this.nextRequiredPacketBufferSize = dataNeeded; return; } buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(5)); remoteHost = { host: buff.readString(hostLength), port: buff.readUInt16BE(), }; // IPv6 } else if (addressType === constants_1.Socks5HostType.IPv6) { // Check if data is available. const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6; if (this.receiveBuffer.length < dataNeeded) { this.nextRequiredPacketBufferSize = dataNeeded; return; } buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4)); remoteHost = { host: ip.toString(buff.readBuffer(16)), port: buff.readUInt16BE(), }; } // We have everything we need this.setState(constants_1.SocksClientState.ReceivedFinalResponse); // If using CONNECT, the client is now in the established state. if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.connect) { this.setState(constants_1.SocksClientState.Established); this.removeInternalSocketHandlers(); this.emit('established', { remoteHost, socket: this.socket }); } else if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.bind) { /* If using BIND, the Socks client is now in BoundWaitingForConnection state. This means that the remote proxy server is waiting for a remote connection to the bound port. */ this.setState(constants_1.SocksClientState.BoundWaitingForConnection); this.nextRequiredPacketBufferSize = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader; this.emit('bound', { remoteHost, socket: this.socket }); /* If using Associate, the Socks client is now Established. And the proxy server is now accepting UDP packets at the given bound port. This initial Socks TCP connection must remain open for the UDP relay to continue to work. */ } else if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.associate) { this.setState(constants_1.SocksClientState.Established); this.removeInternalSocketHandlers(); this.emit('established', { remoteHost, socket: this.socket, }); } } } /** * Handles Socks v5 incoming connection request (BIND). */ handleSocks5IncomingConnectionResponse() { // Peek at available data (we need at least 5 bytes to get the hostname length) const header = this.receiveBuffer.peek(5); if (header[0] !== 0x05 || header[1] !== constants_1.Socks5Response.Granted) { this.closeSocket(`${constants_1.ERRORS.Socks5ProxyRejectedIncomingBoundConnection} - ${constants_1.Socks5Response[header[1]]}`); } else { // Read address type const addressType = header[3]; let remoteHost; let buff; // IPv4 if (addressType === constants_1.Socks5HostType.IPv4) { // Check if data is available. const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4; if (this.receiveBuffer.length < dataNeeded) { this.nextRequiredPacketBufferSize = dataNeeded; return; } buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4)); remoteHost = { host: ip.fromLong(buff.readUInt32BE()), port: buff.readUInt16BE(), }; // If given host is 0.0.0.0, assume remote proxy ip instead. if (remoteHost.host === '0.0.0.0') { remoteHost.host = this.options.proxy.ipaddress; } // Hostname } else if (addressType === constants_1.Socks5HostType.Hostname) { const hostLength = header[4]; const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(hostLength); // header + host length + port // Check if data is available. if (this.receiveBuffer.length < dataNeeded) { this.nextRequiredPacketBufferSize = dataNeeded; return; } buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(5)); remoteHost = { host: buff.readString(hostLength), port: buff.readUInt16BE(), }; // IPv6 } else if (addressType === constants_1.Socks5HostType.IPv6) { // Check if data is available. const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6; if (this.receiveBuffer.length < dataNeeded) { this.nextRequiredPacketBufferSize = dataNeeded; return; } buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4)); remoteHost = { host: ip.toString(buff.readBuffer(16)), port: buff.readUInt16BE(), }; } this.setState(constants_1.SocksClientState.Established); this.removeInternalSocketHandlers(); this.emit('established', { remoteHost, socket: this.socket }); } } get socksClientOptions() { return Object.assign({}, this.options); } } exports.SocksClient = SocksClient;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/socks/build/client/socksclient.js.map"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SOCKS5_NO_ACCEPTABLE_AUTH = exports.SOCKS5_CUSTOM_AUTH_END = exports.SOCKS5_CUSTOM_AUTH_START = exports.SOCKS_INCOMING_PACKET_SIZES = exports.SocksClientState = exports.Socks5Response = exports.Socks5HostType = exports.Socks5Auth = exports.Socks4Response = exports.SocksCommand = exports.ERRORS = exports.DEFAULT_TIMEOUT = void 0; const DEFAULT_TIMEOUT = 30000; exports.DEFAULT_TIMEOUT = DEFAULT_TIMEOUT; // prettier-ignore const ERRORS = { InvalidSocksCommand: 'An invalid SOCKS command was provided. Valid options are connect, bind, and associate.', InvalidSocksCommandForOperation: 'An invalid SOCKS command was provided. Only a subset of commands are supported for this operation.', InvalidSocksCommandChain: 'An invalid SOCKS command was provided. Chaining currently only supports the connect command.', InvalidSocksClientOptionsDestination: 'An invalid destination host was provided.', InvalidSocksClientOptionsExistingSocket: 'An invalid existing socket was provided. This should be an instance of stream.Duplex.', InvalidSocksClientOptionsProxy: 'Invalid SOCKS proxy details were provided.', InvalidSocksClientOptionsTimeout: 'An invalid timeout value was provided. Please enter a value above 0 (in ms).', InvalidSocksClientOptionsProxiesLength: 'At least two socks proxies must be provided for chaining.', InvalidSocksClientOptionsCustomAuthRange: 'Custom auth must be a value between 0x80 and 0xFE.', InvalidSocksClientOptionsCustomAuthOptions: 'When a custom_auth_method is provided, custom_auth_request_handler, custom_auth_response_size, and custom_auth_response_handler must also be provided and valid.', NegotiationError: 'Negotiation error', SocketClosed: 'Socket closed', ProxyConnectionTimedOut: 'Proxy connection timed out', InternalError: 'SocksClient internal error (this should not happen)', InvalidSocks4HandshakeResponse: 'Received invalid Socks4 handshake response', Socks4ProxyRejectedConnection: 'Socks4 Proxy rejected connection', InvalidSocks4IncomingConnectionResponse: 'Socks4 invalid incoming connection response', Socks4ProxyRejectedIncomingBoundConnection: 'Socks4 Proxy rejected incoming bound connection', InvalidSocks5InitialHandshakeResponse: 'Received invalid Socks5 initial handshake response', InvalidSocks5IntiailHandshakeSocksVersion: 'Received invalid Socks5 initial handshake (invalid socks version)', InvalidSocks5InitialHandshakeNoAcceptedAuthType: 'Received invalid Socks5 initial handshake (no accepted authentication type)', InvalidSocks5InitialHandshakeUnknownAuthType: 'Received invalid Socks5 initial handshake (unknown authentication type)', Socks5AuthenticationFailed: 'Socks5 Authentication failed', InvalidSocks5FinalHandshake: 'Received invalid Socks5 final handshake response', InvalidSocks5FinalHandshakeRejected: 'Socks5 proxy rejected connection', InvalidSocks5IncomingConnectionResponse: 'Received invalid Socks5 incoming connection response', Socks5ProxyRejectedIncomingBoundConnection: 'Socks5 Proxy rejected incoming bound connection', }; exports.ERRORS = ERRORS; const SOCKS_INCOMING_PACKET_SIZES = { Socks5InitialHandshakeResponse: 2, Socks5UserPassAuthenticationResponse: 2, // Command response + incoming connection (bind) Socks5ResponseHeader: 5, Socks5ResponseIPv4: 10, Socks5ResponseIPv6: 22, Socks5ResponseHostname: (hostNameLength) => hostNameLength + 7, // Command response + incoming connection (bind) Socks4Response: 8, // 2 header + 2 port + 4 ip }; exports.SOCKS_INCOMING_PACKET_SIZES = SOCKS_INCOMING_PACKET_SIZES; var SocksCommand; (function (SocksCommand) { SocksCommand[SocksCommand["connect"] = 1] = "connect"; SocksCommand[SocksCommand["bind"] = 2] = "bind"; SocksCommand[SocksCommand["associate"] = 3] = "associate"; })(SocksCommand || (SocksCommand = {})); exports.SocksCommand = SocksCommand; var Socks4Response; (function (Socks4Response) { Socks4Response[Socks4Response["Granted"] = 90] = "Granted"; Socks4Response[Socks4Response["Failed"] = 91] = "Failed"; Socks4Response[Socks4Response["Rejected"] = 92] = "Rejected"; Socks4Response[Socks4Response["RejectedIdent"] = 93] = "RejectedIdent"; })(Socks4Response || (Socks4Response = {})); exports.Socks4Response = Socks4Response; var Socks5Auth; (function (Socks5Auth) { Socks5Auth[Socks5Auth["NoAuth"] = 0] = "NoAuth"; Socks5Auth[Socks5Auth["GSSApi"] = 1] = "GSSApi"; Socks5Auth[Socks5Auth["UserPass"] = 2] = "UserPass"; })(Socks5Auth || (Socks5Auth = {})); exports.Socks5Auth = Socks5Auth; const SOCKS5_CUSTOM_AUTH_START = 0x80; exports.SOCKS5_CUSTOM_AUTH_START = SOCKS5_CUSTOM_AUTH_START; const SOCKS5_CUSTOM_AUTH_END = 0xfe; exports.SOCKS5_CUSTOM_AUTH_END = SOCKS5_CUSTOM_AUTH_END; const SOCKS5_NO_ACCEPTABLE_AUTH = 0xff; exports.SOCKS5_NO_ACCEPTABLE_AUTH = SOCKS5_NO_ACCEPTABLE_AUTH; var Socks5Response; (function (Socks5Response) { Socks5Response[Socks5Response["Granted"] = 0] = "Granted"; Socks5Response[Socks5Response["Failure"] = 1] = "Failure"; Socks5Response[Socks5Response["NotAllowed"] = 2] = "NotAllowed"; Socks5Response[Socks5Response["NetworkUnreachable"] = 3] = "NetworkUnreachable"; Socks5Response[Socks5Response["HostUnreachable"] = 4] = "HostUnreachable"; Socks5Response[Socks5Response["ConnectionRefused"] = 5] = "ConnectionRefused"; Socks5Response[Socks5Response["TTLExpired"] = 6] = "TTLExpired"; Socks5Response[Socks5Response["CommandNotSupported"] = 7] = "CommandNotSupported"; Socks5Response[Socks5Response["AddressNotSupported"] = 8] = "AddressNotSupported"; })(Socks5Response || (Socks5Response = {})); exports.Socks5Response = Socks5Response; var Socks5HostType; (function (Socks5HostType) { Socks5HostType[Socks5HostType["IPv4"] = 1] = "IPv4"; Socks5HostType[Socks5HostType["Hostname"] = 3] = "Hostname"; Socks5HostType[Socks5HostType["IPv6"] = 4] = "IPv6"; })(Socks5HostType || (Socks5HostType = {})); exports.Socks5HostType = Socks5HostType; var SocksClientState; (function (SocksClientState) { SocksClientState[SocksClientState["Created"] = 0] = "Created"; SocksClientState[SocksClientState["Connecting"] = 1] = "Connecting"; SocksClientState[SocksClientState["Connected"] = 2] = "Connected"; SocksClientState[SocksClientState["SentInitialHandshake"] = 3] = "SentInitialHandshake"; SocksClientState[SocksClientState["ReceivedInitialHandshakeResponse"] = 4] = "ReceivedInitialHandshakeResponse"; SocksClientState[SocksClientState["SentAuthentication"] = 5] = "SentAuthentication"; SocksClientState[SocksClientState["ReceivedAuthenticationResponse"] = 6] = "ReceivedAuthenticationResponse"; SocksClientState[SocksClientState["SentFinalHandshake"] = 7] = "SentFinalHandshake"; SocksClientState[SocksClientState["ReceivedFinalResponse"] = 8] = "ReceivedFinalResponse"; SocksClientState[SocksClientState["BoundWaitingForConnection"] = 9] = "BoundWaitingForConnection"; SocksClientState[SocksClientState["Established"] = 10] = "Established"; SocksClientState[SocksClientState["Disconnected"] = 11] = "Disconnected"; SocksClientState[SocksClientState["Error"] = 99] = "Error"; })(SocksClientState || (SocksClientState = {})); exports.SocksClientState = SocksClientState;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/socks/build/common/constants.js.map"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.validateSocksClientChainOptions = exports.validateSocksClientOptions = void 0; const util_1 = require("./util"); const constants_1 = require("./constants"); const stream = require("stream"); /** * Validates the provided SocksClientOptions * @param options { SocksClientOptions } * @param acceptedCommands { string[] } A list of accepted SocksProxy commands. */ function validateSocksClientOptions(options, acceptedCommands = ['connect', 'bind', 'associate']) { // Check SOCKs command option. if (!constants_1.SocksCommand[options.command]) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksCommand, options); } // Check SocksCommand for acceptable command. if (acceptedCommands.indexOf(options.command) === -1) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksCommandForOperation, options); } // Check destination if (!isValidSocksRemoteHost(options.destination)) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsDestination, options); } // Check SOCKS proxy to use if (!isValidSocksProxy(options.proxy)) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsProxy, options); } // Validate custom auth (if set) validateCustomProxyAuth(options.proxy, options); // Check timeout if (options.timeout && !isValidTimeoutValue(options.timeout)) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsTimeout, options); } // Check existing_socket (if provided) if (options.existing_socket && !(options.existing_socket instanceof stream.Duplex)) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsExistingSocket, options); } } exports.validateSocksClientOptions = validateSocksClientOptions; /** * Validates the SocksClientChainOptions * @param options { SocksClientChainOptions } */ function validateSocksClientChainOptions(options) { // Only connect is supported when chaining. if (options.command !== 'connect') { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksCommandChain, options); } // Check destination if (!isValidSocksRemoteHost(options.destination)) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsDestination, options); } // Validate proxies (length) if (!(options.proxies && Array.isArray(options.proxies) && options.proxies.length >= 2)) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsProxiesLength, options); } // Validate proxies options.proxies.forEach((proxy) => { if (!isValidSocksProxy(proxy)) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsProxy, options); } // Validate custom auth (if set) validateCustomProxyAuth(proxy, options); }); // Check timeout if (options.timeout && !isValidTimeoutValue(options.timeout)) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsTimeout, options); } } exports.validateSocksClientChainOptions = validateSocksClientChainOptions; function validateCustomProxyAuth(proxy, options) { if (proxy.custom_auth_method !== undefined) { // Invalid auth method range if (proxy.custom_auth_method < constants_1.SOCKS5_CUSTOM_AUTH_START || proxy.custom_auth_method > constants_1.SOCKS5_CUSTOM_AUTH_END) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsCustomAuthRange, options); } // Missing custom_auth_request_handler if (proxy.custom_auth_request_handler === undefined || typeof proxy.custom_auth_request_handler !== 'function') { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsCustomAuthOptions, options); } // Missing custom_auth_response_size if (proxy.custom_auth_response_size === undefined) { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsCustomAuthOptions, options); } // Missing/invalid custom_auth_response_handler if (proxy.custom_auth_response_handler === undefined || typeof proxy.custom_auth_response_handler !== 'function') { throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsCustomAuthOptions, options); } } } /** * Validates a SocksRemoteHost * @param remoteHost { SocksRemoteHost } */ function isValidSocksRemoteHost(remoteHost) { return (remoteHost && typeof remoteHost.host === 'string' && typeof remoteHost.port === 'number' && remoteHost.port >= 0 && remoteHost.port <= 65535); } /** * Validates a SocksProxy * @param proxy { SocksProxy } */ function isValidSocksProxy(proxy) { return (proxy && (typeof proxy.host === 'string' || typeof proxy.ipaddress === 'string') && typeof proxy.port === 'number' && proxy.port >= 0 && proxy.port <= 65535 && (proxy.type === 4 || proxy.type === 5)); } /** * Validates a timeout value. * @param value { Number } */ function isValidTimeoutValue(value) { return typeof value === 'number' && value > 0; }//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/socks/build/common/helpers.js.map"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ReceiveBuffer = void 0; class ReceiveBuffer { constructor(size = 4096) { this.buffer = Buffer.allocUnsafe(size); this.offset = 0; this.originalSize = size; } get length() { return this.offset; } append(data) { if (!Buffer.isBuffer(data)) { throw new Error('Attempted to append a non-buffer instance to ReceiveBuffer.'); } if (this.offset + data.length >= this.buffer.length) { const tmp = this.buffer; this.buffer = Buffer.allocUnsafe(Math.max(this.buffer.length + this.originalSize, this.buffer.length + data.length)); tmp.copy(this.buffer); } data.copy(this.buffer, this.offset); return (this.offset += data.length); } peek(length) { if (length > this.offset) { throw new Error('Attempted to read beyond the bounds of the managed internal data.'); } return this.buffer.slice(0, length); } get(length) { if (length > this.offset) { throw new Error('Attempted to read beyond the bounds of the managed internal data.'); } const value = Buffer.allocUnsafe(length); this.buffer.slice(0, length).copy(value); this.buffer.copyWithin(0, length, length + this.offset - length); this.offset -= length; return value; } } exports.ReceiveBuffer = ReceiveBuffer;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/socks/build/common/receivebuffer.js.map"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.shuffleArray = exports.SocksClientError = void 0; /** * Error wrapper for SocksClient */ class SocksClientError extends Error { constructor(message, options) { super(message); this.options = options; } } exports.SocksClientError = SocksClientError; /** * Shuffles a given array. * @param array The array to shuffle. */ function shuffleArray(array) { // tslint:disable-next-line:no-increment-decrement for (let i = array.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); [array[i], array[j]] = [array[j], array[i]]; } } exports.shuffleArray = shuffleArray;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/socks/build/common/util.js.mapvar chownr = require('chownr') var tar = require('tar-stream') var pump = require('pump') var mkdirp = require('mkdirp-classic') var fs = require('fs') var path = require('path') var os = require('os') var win32 = os.platform() === 'win32' var noop = function () {} var echo = function (name) { return name } var normalize = !win32 ? echo : function (name) { return name.replace(/\\/g, '/').replace(/[:?<>|]/g, '_') } var statAll = function (fs, stat, cwd, ignore, entries, sort) { var queue = entries || ['.'] return function loop (callback) { if (!queue.length) return callback() var next = queue.shift() var nextAbs = path.join(cwd, next) stat.call(fs, nextAbs, function (err, stat) { if (err) return callback(err) if (!stat.isDirectory()) return callback(null, next, stat) fs.readdir(nextAbs, function (err, files) { if (err) return callback(err) if (sort) files.sort() for (var i = 0; i < files.length; i++) { if (!ignore(path.join(cwd, next, files[i]))) queue.push(path.join(next, files[i])) } callback(null, next, stat) }) }) } } var strip = function (map, level) { return function (header) { header.name = header.name.split('/').slice(level).join('/') var linkname = header.linkname if (linkname && (header.type === 'link' || path.isAbsolute(linkname))) { header.linkname = linkname.split('/').slice(level).join('/') } return map(header) } } exports.pack = function (cwd, opts) { if (!cwd) cwd = '.' if (!opts) opts = {} var xfs = opts.fs || fs var ignore = opts.ignore || opts.filter || noop var map = opts.map || noop var mapStream = opts.mapStream || echo var statNext = statAll(xfs, opts.dereference ? xfs.stat : xfs.lstat, cwd, ignore, opts.entries, opts.sort) var strict = opts.strict !== false var umask = typeof opts.umask === 'number' ? ~opts.umask : ~processUmask() var dmode = typeof opts.dmode === 'number' ? opts.dmode : 0 var fmode = typeof opts.fmode === 'number' ? opts.fmode : 0 var pack = opts.pack || tar.pack() var finish = opts.finish || noop if (opts.strip) map = strip(map, opts.strip) if (opts.readable) { dmode |= parseInt(555, 8) fmode |= parseInt(444, 8) } if (opts.writable) { dmode |= parseInt(333, 8) fmode |= parseInt(222, 8) } var onsymlink = function (filename, header) { xfs.readlink(path.join(cwd, filename), function (err, linkname) { if (err) return pack.destroy(err) header.linkname = normalize(linkname) pack.entry(header, onnextentry) }) } var onstat = function (err, filename, stat) { if (err) return pack.destroy(err) if (!filename) { if (opts.finalize !== false) pack.finalize() return finish(pack) } if (stat.isSocket()) return onnextentry() // tar does not support sockets... var header = { name: normalize(filename), mode: (stat.mode | (stat.isDirectory() ? dmode : fmode)) & umask, mtime: stat.mtime, size: stat.size, type: 'file', uid: stat.uid, gid: stat.gid } if (stat.isDirectory()) { header.size = 0 header.type = 'directory' header = map(header) || header return pack.entry(header, onnextentry) } if (stat.isSymbolicLink()) { header.size = 0 header.type = 'symlink' header = map(header) || header return onsymlink(filename, header) } // TODO: add fifo etc... header = map(header) || header if (!stat.isFile()) { if (strict) return pack.destroy(new Error('unsupported type for ' + filename)) return onnextentry() } var entry = pack.entry(header, onnextentry) if (!entry) return var rs = mapStream(xfs.createReadStream(path.join(cwd, filename), { start: 0, end: header.size > 0 ? header.size - 1 : header.size }), header) rs.on('error', function (err) { // always forward errors on destroy entry.destroy(err) }) pump(rs, entry) } var onnextentry = function (err) { if (err) return pack.destroy(err) statNext(onstat) } onnextentry() return pack } var head = function (list) { return list.length ? list[list.length - 1] : null } var processGetuid = function () { return process.getuid ? process.getuid() : -1 } var processUmask = function () { return process.umask ? process.umask() : 0 } exports.extract = function (cwd, opts) { if (!cwd) cwd = '.' if (!opts) opts = {} var xfs = opts.fs || fs var ignore = opts.ignore || opts.filter || noop var map = opts.map || noop var mapStream = opts.mapStream || echo var own = opts.chown !== false && !win32 && processGetuid() === 0 var extract = opts.extract || tar.extract() var stack = [] var now = new Date() var umask = typeof opts.umask === 'number' ? ~opts.umask : ~processUmask() var dmode = typeof opts.dmode === 'number' ? opts.dmode : 0 var fmode = typeof opts.fmode === 'number' ? opts.fmode : 0 var strict = opts.strict !== false if (opts.strip) map = strip(map, opts.strip) if (opts.readable) { dmode |= parseInt(555, 8) fmode |= parseInt(444, 8) } if (opts.writable) { dmode |= parseInt(333, 8) fmode |= parseInt(222, 8) } var utimesParent = function (name, cb) { // we just set the mtime on the parent dir again everytime we write an entry var top while ((top = head(stack)) && name.slice(0, top[0].length) !== top[0]) stack.pop() if (!top) return cb() xfs.utimes(top[0], now, top[1], cb) } var utimes = function (name, header, cb) { if (opts.utimes === false) return cb() if (header.type === 'directory') return xfs.utimes(name, now, header.mtime, cb) if (header.type === 'symlink') return utimesParent(name, cb) // TODO: how to set mtime on link? xfs.utimes(name, now, header.mtime, function (err) { if (err) return cb(err) utimesParent(name, cb) }) } var chperm = function (name, header, cb) { var link = header.type === 'symlink' /* eslint-disable node/no-deprecated-api */ var chmod = link ? xfs.lchmod : xfs.chmod var chown = link ? xfs.lchown : xfs.chown /* eslint-enable node/no-deprecated-api */ if (!chmod) return cb() var mode = (header.mode | (header.type === 'directory' ? dmode : fmode)) & umask if (chown && own) chown.call(xfs, name, header.uid, header.gid, onchown) else onchown(null) function onchown (err) { if (err) return cb(err) if (!chmod) return cb() chmod.call(xfs, name, mode, cb) } } extract.on('entry', function (header, stream, next) { header = map(header) || header header.name = normalize(header.name) var name = path.join(cwd, path.join('/', header.name)) if (ignore(name, header)) { stream.resume() return next() } var stat = function (err) { if (err) return next(err) utimes(name, header, function (err) { if (err) return next(err) if (win32) return next() chperm(name, header, next) }) } var onsymlink = function () { if (win32) return next() // skip symlinks on win for now before it can be tested xfs.unlink(name, function () { xfs.symlink(header.linkname, name, stat) }) } var onlink = function () { if (win32) return next() // skip links on win for now before it can be tested xfs.unlink(name, function () { var srcpath = path.join(cwd, path.join('/', header.linkname)) xfs.link(srcpath, name, function (err) { if (err && err.code === 'EPERM' && opts.hardlinkAsFilesFallback) { stream = xfs.createReadStream(srcpath) return onfile() } stat(err) }) }) } var onfile = function () { var ws = xfs.createWriteStream(name) var rs = mapStream(stream, header) ws.on('error', function (err) { // always forward errors on destroy rs.destroy(err) }) pump(rs, ws, function (err) { if (err) return next(err) ws.on('close', stat) }) } if (header.type === 'directory') { stack.push([name, header.mtime]) return mkdirfix(name, { fs: xfs, own: own, uid: header.uid, gid: header.gid }, stat) } var dir = path.dirname(name) validate(xfs, dir, path.join(cwd, '.'), function (err, valid) { if (err) return next(err) if (!valid) return next(new Error(dir + ' is not a valid path')) mkdirfix(dir, { fs: xfs, own: own, uid: header.uid, gid: header.gid }, function (err) { if (err) return next(err) switch (header.type) { case 'file': return onfile() case 'link': return onlink() case 'symlink': return onsymlink() } if (strict) return next(new Error('unsupported type for ' + name + ' (' + header.type + ')')) stream.resume() next() }) }) }) if (opts.finish) extract.on('finish', opts.finish) return extract } function validate (fs, name, root, cb) { if (name === root) return cb(null, true) fs.lstat(name, function (err, st) { if (err && err.code !== 'ENOENT') return cb(err) if (err || st.isDirectory()) return validate(fs, path.join(name, '..'), root, cb) cb(null, false) }) } function mkdirfix (name, opts, cb) { mkdirp(name, { fs: opts.fs }, function (err, made) { if (!err && made && opts.own) { chownr(made, opts.uid, opts.gid, cb) } else { cb(err) } }) } The MIT License (MIT) Copyright (c) 2014 Mathias Buus Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.{ "name": "tar-fs", "version": "2.1.1", "description": "filesystem bindings for tar-stream", "dependencies": { "chownr": "^1.1.1", "mkdirp-classic": "^0.5.2", "pump": "^3.0.0", "tar-stream": "^2.1.4" }, "keywords": [ "tar", "fs", "file", "tarball", "directory", "stream" ], "devDependencies": { "rimraf": "^2.6.3", "standard": "^13.0.1", "tape": "^4.9.2" }, "scripts": { "test": "standard && tape test/index.js" }, "bugs": { "url": "https://github.com/mafintosh/tar-fs/issues" }, "homepage": "https://github.com/mafintosh/tar-fs", "main": "index.js", "directories": { "test": "test" }, "author": "Mathias Buus", "license": "MIT", "repository": { "type": "git", "url": "https://github.com/mafintosh/tar-fs.git" } } 'use strict' const fs = require('fs') const path = require('path') /* istanbul ignore next */ const LCHOWN = fs.lchown ? 'lchown' : 'chown' /* istanbul ignore next */ const LCHOWNSYNC = fs.lchownSync ? 'lchownSync' : 'chownSync' /* istanbul ignore next */ const needEISDIRHandled = fs.lchown && !process.version.match(/v1[1-9]+\./) && !process.version.match(/v10\.[6-9]/) const lchownSync = (path, uid, gid) => { try { return fs[LCHOWNSYNC](path, uid, gid) } catch (er) { if (er.code !== 'ENOENT') throw er } } /* istanbul ignore next */ const chownSync = (path, uid, gid) => { try { return fs.chownSync(path, uid, gid) } catch (er) { if (er.code !== 'ENOENT') throw er } } /* istanbul ignore next */ const handleEISDIR = needEISDIRHandled ? (path, uid, gid, cb) => er => { // Node prior to v10 had a very questionable implementation of // fs.lchown, which would always try to call fs.open on a directory // Fall back to fs.chown in those cases. if (!er || er.code !== 'EISDIR') cb(er) else fs.chown(path, uid, gid, cb) } : (_, __, ___, cb) => cb /* istanbul ignore next */ const handleEISDirSync = needEISDIRHandled ? (path, uid, gid) => { try { return lchownSync(path, uid, gid) } catch (er) { if (er.code !== 'EISDIR') throw er chownSync(path, uid, gid) } } : (path, uid, gid) => lchownSync(path, uid, gid) // fs.readdir could only accept an options object as of node v6 const nodeVersion = process.version let readdir = (path, options, cb) => fs.readdir(path, options, cb) let readdirSync = (path, options) => fs.readdirSync(path, options) /* istanbul ignore next */ if (/^v4\./.test(nodeVersion)) readdir = (path, options, cb) => fs.readdir(path, cb) const chown = (cpath, uid, gid, cb) => { fs[LCHOWN](cpath, uid, gid, handleEISDIR(cpath, uid, gid, er => { // Skip ENOENT error cb(er && er.code !== 'ENOENT' ? er : null) })) } const chownrKid = (p, child, uid, gid, cb) => { if (typeof child === 'string') return fs.lstat(path.resolve(p, child), (er, stats) => { // Skip ENOENT error if (er) return cb(er.code !== 'ENOENT' ? er : null) stats.name = child chownrKid(p, stats, uid, gid, cb) }) if (child.isDirectory()) { chownr(path.resolve(p, child.name), uid, gid, er => { if (er) return cb(er) const cpath = path.resolve(p, child.name) chown(cpath, uid, gid, cb) }) } else { const cpath = path.resolve(p, child.name) chown(cpath, uid, gid, cb) } } const chownr = (p, uid, gid, cb) => { readdir(p, { withFileTypes: true }, (er, children) => { // any error other than ENOTDIR or ENOTSUP means it's not readable, // or doesn't exist. give up. if (er) { if (er.code === 'ENOENT') return cb() else if (er.code !== 'ENOTDIR' && er.code !== 'ENOTSUP') return cb(er) } if (er || !children.length) return chown(p, uid, gid, cb) let len = children.length let errState = null const then = er => { if (errState) return if (er) return cb(errState = er) if (-- len === 0) return chown(p, uid, gid, cb) } children.forEach(child => chownrKid(p, child, uid, gid, then)) }) } const chownrKidSync = (p, child, uid, gid) => { if (typeof child === 'string') { try { const stats = fs.lstatSync(path.resolve(p, child)) stats.name = child child = stats } catch (er) { if (er.code === 'ENOENT') return else throw er } } if (child.isDirectory()) chownrSync(path.resolve(p, child.name), uid, gid) handleEISDirSync(path.resolve(p, child.name), uid, gid) } const chownrSync = (p, uid, gid) => { let children try { children = readdirSync(p, { withFileTypes: true }) } catch (er) { if (er.code === 'ENOENT') return else if (er.code === 'ENOTDIR' || er.code === 'ENOTSUP') return handleEISDirSync(p, uid, gid) else throw er } if (children && children.length) children.forEach(child => chownrKidSync(p, child, uid, gid)) return handleEISDirSync(p, uid, gid) } module.exports = chownr chownr.sync = chownrSync The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "name": "chownr", "description": "like `chown -R`", "version": "1.1.4", "repository": { "type": "git", "url": "git://github.com/isaacs/chownr.git" }, "main": "chownr.js", "files": [ "chownr.js" ], "devDependencies": { "mkdirp": "0.3", "rimraf": "^2.7.1", "tap": "^14.10.6" }, "tap": { "check-coverage": true }, "scripts": { "test": "tap", "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags" }, "license": "ISC" } var once = require('once') var eos = require('end-of-stream') var fs = require('fs') // we only need fs to get the ReadStream and WriteStream prototypes var noop = function () {} var ancient = /^v?\.0/.test(process.version) var isFn = function (fn) { return typeof fn === 'function' } var isFS = function (stream) { if (!ancient) return false // newer node version do not need to care about fs is a special way if (!fs) return false // browser return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close) } var isRequest = function (stream) { return stream.setHeader && isFn(stream.abort) } var destroyer = function (stream, reading, writing, callback) { callback = once(callback) var closed = false stream.on('close', function () { closed = true }) eos(stream, {readable: reading, writable: writing}, function (err) { if (err) return callback(err) closed = true callback() }) var destroyed = false return function (err) { if (closed) return if (destroyed) return destroyed = true if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want if (isFn(stream.destroy)) return stream.destroy() callback(err || new Error('stream was destroyed')) } } var call = function (fn) { fn() } var pipe = function (from, to) { return from.pipe(to) } var pump = function () { var streams = Array.prototype.slice.call(arguments) var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop if (Array.isArray(streams[0])) streams = streams[0] if (streams.length < 2) throw new Error('pump requires two streams per minimum') var error var destroys = streams.map(function (stream, i) { var reading = i < streams.length - 1 var writing = i > 0 return destroyer(stream, reading, writing, function (err) { if (!error) error = err if (err) destroys.forEach(call) if (reading) return destroys.forEach(call) callback(error) }) }) return streams.reduce(pipe) } module.exports = pump The MIT License (MIT) Copyright (c) 2014 Mathias Buus Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.{ "name": "pump", "version": "3.0.0", "repository": "git://github.com/mafintosh/pump.git", "license": "MIT", "description": "pipe streams together and close all of them if one of them closes", "browser": { "fs": false }, "keywords": [ "streams", "pipe", "destroy", "callback" ], "author": "Mathias Buus Madsen ", "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" }, "scripts": { "test": "node test-browser.js && node test-node.js" } } var stream = require('stream') var pump = require('./index') var rs = new stream.Readable() var ws = new stream.Writable() rs._read = function (size) { this.push(Buffer(size).fill('abc')) } ws._write = function (chunk, encoding, cb) { setTimeout(function () { cb() }, 100) } var toHex = function () { var reverse = new (require('stream').Transform)() reverse._transform = function (chunk, enc, callback) { reverse.push(chunk.toString('hex')) callback() } return reverse } var wsClosed = false var rsClosed = false var callbackCalled = false var check = function () { if (wsClosed && rsClosed && callbackCalled) { console.log('test-browser.js passes') clearTimeout(timeout) } } ws.on('finish', function () { wsClosed = true check() }) rs.on('end', function () { rsClosed = true check() }) var res = pump(rs, toHex(), toHex(), toHex(), ws, function () { callbackCalled = true check() }) if (res !== ws) { throw new Error('should return last stream') } setTimeout(function () { rs.push(null) rs.emit('close') }, 1000) var timeout = setTimeout(function () { check() throw new Error('timeout') }, 5000) var pump = require('./index') var rs = require('fs').createReadStream('/dev/random') var ws = require('fs').createWriteStream('/dev/null') var toHex = function () { var reverse = new (require('stream').Transform)() reverse._transform = function (chunk, enc, callback) { reverse.push(chunk.toString('hex')) callback() } return reverse } var wsClosed = false var rsClosed = false var callbackCalled = false var check = function () { if (wsClosed && rsClosed && callbackCalled) { console.log('test-node.js passes') clearTimeout(timeout) } } ws.on('close', function () { wsClosed = true check() }) rs.on('close', function () { rsClosed = true check() }) var res = pump(rs, toHex(), toHex(), toHex(), ws, function () { callbackCalled = true check() }) if (res !== ws) { throw new Error('should return last stream') } setTimeout(function () { rs.destroy() }, 1000) var timeout = setTimeout(function () { throw new Error('timeout') }, 5000) 'use strict'; function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } var codes = {}; function createErrorType(code, message, Base) { if (!Base) { Base = Error; } function getMessage(arg1, arg2, arg3) { if (typeof message === 'string') { return message; } else { return message(arg1, arg2, arg3); } } var NodeError = /*#__PURE__*/ function (_Base) { _inheritsLoose(NodeError, _Base); function NodeError(arg1, arg2, arg3) { return _Base.call(this, getMessage(arg1, arg2, arg3)) || this; } return NodeError; }(Base); NodeError.prototype.name = Base.name; NodeError.prototype.code = code; codes[code] = NodeError; } // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js function oneOf(expected, thing) { if (Array.isArray(expected)) { var len = expected.length; expected = expected.map(function (i) { return String(i); }); if (len > 2) { return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(', '), ", or ") + expected[len - 1]; } else if (len === 2) { return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]); } else { return "of ".concat(thing, " ").concat(expected[0]); } } else { return "of ".concat(thing, " ").concat(String(expected)); } } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith function startsWith(str, search, pos) { return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith function endsWith(str, search, this_len) { if (this_len === undefined || this_len > str.length) { this_len = str.length; } return str.substring(this_len - search.length, this_len) === search; } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes function includes(str, search, start) { if (typeof start !== 'number') { start = 0; } if (start + search.length > str.length) { return false; } else { return str.indexOf(search, start) !== -1; } } createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) { return 'The value "' + value + '" is invalid for option "' + name + '"'; }, TypeError); createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { // determiner: 'must be' or 'must not be' var determiner; if (typeof expected === 'string' && startsWith(expected, 'not ')) { determiner = 'must not be'; expected = expected.replace(/^not /, ''); } else { determiner = 'must be'; } var msg; if (endsWith(name, ' argument')) { // For cases like 'first argument' msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, 'type')); } else { var type = includes(name, '.') ? 'property' : 'argument'; msg = "The \"".concat(name, "\" ").concat(type, " ").concat(determiner, " ").concat(oneOf(expected, 'type')); } msg += ". Received type ".concat(typeof actual); return msg; }, TypeError); createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF'); createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) { return 'The ' + name + ' method is not implemented'; }); createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close'); createErrorType('ERR_STREAM_DESTROYED', function (name) { return 'Cannot call ' + name + ' after a stream was destroyed'; }); createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times'); createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable'); createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end'); createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError); createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { return 'Unknown encoding: ' + arg; }, TypeError); createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); module.exports.codes = codes; 'use strict'; const codes = {}; function createErrorType(code, message, Base) { if (!Base) { Base = Error } function getMessage (arg1, arg2, arg3) { if (typeof message === 'string') { return message } else { return message(arg1, arg2, arg3) } } class NodeError extends Base { constructor (arg1, arg2, arg3) { super(getMessage(arg1, arg2, arg3)); } } NodeError.prototype.name = Base.name; NodeError.prototype.code = code; codes[code] = NodeError; } // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js function oneOf(expected, thing) { if (Array.isArray(expected)) { const len = expected.length; expected = expected.map((i) => String(i)); if (len > 2) { return `one of ${thing} ${expected.slice(0, len - 1).join(', ')}, or ` + expected[len - 1]; } else if (len === 2) { return `one of ${thing} ${expected[0]} or ${expected[1]}`; } else { return `of ${thing} ${expected[0]}`; } } else { return `of ${thing} ${String(expected)}`; } } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith function startsWith(str, search, pos) { return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith function endsWith(str, search, this_len) { if (this_len === undefined || this_len > str.length) { this_len = str.length; } return str.substring(this_len - search.length, this_len) === search; } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes function includes(str, search, start) { if (typeof start !== 'number') { start = 0; } if (start + search.length > str.length) { return false; } else { return str.indexOf(search, start) !== -1; } } createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) { return 'The value "' + value + '" is invalid for option "' + name + '"' }, TypeError); createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { // determiner: 'must be' or 'must not be' let determiner; if (typeof expected === 'string' && startsWith(expected, 'not ')) { determiner = 'must not be'; expected = expected.replace(/^not /, ''); } else { determiner = 'must be'; } let msg; if (endsWith(name, ' argument')) { // For cases like 'first argument' msg = `The ${name} ${determiner} ${oneOf(expected, 'type')}`; } else { const type = includes(name, '.') ? 'property' : 'argument'; msg = `The "${name}" ${type} ${determiner} ${oneOf(expected, 'type')}`; } msg += `. Received type ${typeof actual}`; return msg; }, TypeError); createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF'); createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) { return 'The ' + name + ' method is not implemented' }); createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close'); createErrorType('ERR_STREAM_DESTROYED', function (name) { return 'Cannot call ' + name + ' after a stream was destroyed'; }); createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times'); createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable'); createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end'); createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError); createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { return 'Unknown encoding: ' + arg }, TypeError); createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); module.exports.codes = codes; 'use strict' var experimentalWarnings = new Set(); function emitExperimentalWarning(feature) { if (experimentalWarnings.has(feature)) return; var msg = feature + ' is an experimental feature. This feature could ' + 'change at any time'; experimentalWarnings.add(feature); process.emitWarning(msg, 'ExperimentalWarning'); } function noop() {} module.exports.emitExperimentalWarning = process.emitWarning ? emitExperimentalWarning : noop; ### Streams Working Group The Node.js Streams is jointly governed by a Working Group (WG) that is responsible for high-level guidance of the project. The WG has final authority over this project including: * Technical direction * Project governance and process (including this policy) * Contribution policy * GitHub repository hosting * Conduct guidelines * Maintaining the list of additional Collaborators For the current list of WG members, see the project [README.md](./README.md#current-project-team-members). ### Collaborators The readable-stream GitHub repository is maintained by the WG and additional Collaborators who are added by the WG on an ongoing basis. Individuals making significant and valuable contributions are made Collaborators and given commit-access to the project. These individuals are identified by the WG and their addition as Collaborators is discussed during the WG meeting. _Note:_ If you make a significant contribution and are not considered for commit-access log an issue or contact a WG member directly and it will be brought up in the next WG meeting. Modifications of the contents of the readable-stream repository are made on a collaborative basis. Anybody with a GitHub account may propose a modification via pull request and it will be considered by the project Collaborators. All pull requests must be reviewed and accepted by a Collaborator with sufficient expertise who is able to take full responsibility for the change. In the case of pull requests proposed by an existing Collaborator, an additional Collaborator is required for sign-off. Consensus should be sought if additional Collaborators participate and there is disagreement around a particular modification. See _Consensus Seeking Process_ below for further detail on the consensus model used for governance. Collaborators may opt to elevate significant or controversial modifications, or modifications that have not found consensus to the WG for discussion by assigning the ***WG-agenda*** tag to a pull request or issue. The WG should serve as the final arbiter where required. For the current list of Collaborators, see the project [README.md](./README.md#members). ### WG Membership WG seats are not time-limited. There is no fixed size of the WG. However, the expected target is between 6 and 12, to ensure adequate coverage of important areas of expertise, balanced with the ability to make decisions efficiently. There is no specific set of requirements or qualifications for WG membership beyond these rules. The WG may add additional members to the WG by unanimous consensus. A WG member may be removed from the WG by voluntary resignation, or by unanimous consensus of all other WG members. Changes to WG membership should be posted in the agenda, and may be suggested as any other agenda item (see "WG Meetings" below). If an addition or removal is proposed during a meeting, and the full WG is not in attendance to participate, then the addition or removal is added to the agenda for the subsequent meeting. This is to ensure that all members are given the opportunity to participate in all membership decisions. If a WG member is unable to attend a meeting where a planned membership decision is being made, then their consent is assumed. No more than 1/3 of the WG members may be affiliated with the same employer. If removal or resignation of a WG member, or a change of employment by a WG member, creates a situation where more than 1/3 of the WG membership shares an employer, then the situation must be immediately remedied by the resignation or removal of one or more WG members affiliated with the over-represented employer(s). ### WG Meetings The WG meets occasionally on a Google Hangout On Air. A designated moderator approved by the WG runs the meeting. Each meeting should be published to YouTube. Items are added to the WG agenda that are considered contentious or are modifications of governance, contribution policy, WG membership, or release process. The intention of the agenda is not to approve or review all patches; that should happen continuously on GitHub and be handled by the larger group of Collaborators. Any community member or contributor can ask that something be added to the next meeting's agenda by logging a GitHub Issue. Any Collaborator, WG member or the moderator can add the item to the agenda by adding the ***WG-agenda*** tag to the issue. Prior to each WG meeting the moderator will share the Agenda with members of the WG. WG members can add any items they like to the agenda at the beginning of each meeting. The moderator and the WG cannot veto or remove items. The WG may invite persons or representatives from certain projects to participate in a non-voting capacity. The moderator is responsible for summarizing the discussion of each agenda item and sends it as a pull request after the meeting. ### Consensus Seeking Process The WG follows a [Consensus Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making) decision-making model. When an agenda item has appeared to reach a consensus the moderator will ask "Does anyone object?" as a final call for dissent from the consensus. If an agenda item cannot reach a consensus a WG member can call for either a closing vote or a vote to table the issue to the next meeting. The call for a vote must be seconded by a majority of the WG or else the discussion will continue. Simple majority wins. Note that changes to WG membership require a majority consensus. See "WG Membership" above. Node.js is licensed for use as follows: """ Copyright Node.js contributors. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ This license applies to parts of Node.js originating from the https://github.com/joyent/node repository: """ Copyright Joyent, Inc. and other Node contributors. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ { "name": "readable-stream", "version": "3.6.0", "description": "Streams3, a user-land copy of the stream library from Node.js", "main": "readable.js", "engines": { "node": ">= 6" }, "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" }, "devDependencies": { "@babel/cli": "^7.2.0", "@babel/core": "^7.2.0", "@babel/polyfill": "^7.0.0", "@babel/preset-env": "^7.2.0", "airtap": "0.0.9", "assert": "^1.4.0", "bl": "^2.0.0", "deep-strict-equal": "^0.2.0", "events.once": "^2.0.2", "glob": "^7.1.2", "gunzip-maybe": "^1.4.1", "hyperquest": "^2.1.3", "lolex": "^2.6.0", "nyc": "^11.0.0", "pump": "^3.0.0", "rimraf": "^2.6.2", "tap": "^12.0.0", "tape": "^4.9.0", "tar-fs": "^1.16.2", "util-promisify": "^2.1.0" }, "scripts": { "test": "tap -J --no-esm test/parallel/*.js test/ours/*.js", "ci": "TAP=1 tap --no-esm test/parallel/*.js test/ours/*.js | tee test.tap", "test-browsers": "airtap --sauce-connect --loopback airtap.local -- test/browser.js", "test-browser-local": "airtap --open --local -- test/browser.js", "cover": "nyc npm test", "report": "nyc report --reporter=lcov", "update-browser-errors": "babel -o errors-browser.js errors.js" }, "repository": { "type": "git", "url": "git://github.com/nodejs/readable-stream" }, "keywords": [ "readable", "stream", "pipe" ], "browser": { "util": false, "worker_threads": false, "./errors": "./errors-browser.js", "./readable.js": "./readable-browser.js", "./lib/internal/streams/from.js": "./lib/internal/streams/from-browser.js", "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js" }, "nyc": { "include": [ "lib/**.js" ] }, "license": "MIT" } exports = module.exports = require('./lib/_stream_readable.js'); exports.Stream = exports; exports.Readable = exports; exports.Writable = require('./lib/_stream_writable.js'); exports.Duplex = require('./lib/_stream_duplex.js'); exports.Transform = require('./lib/_stream_transform.js'); exports.PassThrough = require('./lib/_stream_passthrough.js'); exports.finished = require('./lib/internal/streams/end-of-stream.js'); exports.pipeline = require('./lib/internal/streams/pipeline.js'); var Stream = require('stream'); if (process.env.READABLE_STREAM === 'disable' && Stream) { module.exports = Stream.Readable; Object.assign(module.exports, Stream); module.exports.Stream = Stream; } else { exports = module.exports = require('./lib/_stream_readable.js'); exports.Stream = Stream || exports; exports.Readable = exports; exports.Writable = require('./lib/_stream_writable.js'); exports.Duplex = require('./lib/_stream_duplex.js'); exports.Transform = require('./lib/_stream_transform.js'); exports.PassThrough = require('./lib/_stream_passthrough.js'); exports.finished = require('./lib/internal/streams/end-of-stream.js'); exports.pipeline = require('./lib/internal/streams/pipeline.js'); } var util = require('util') var bl = require('bl') var headers = require('./headers') var Writable = require('readable-stream').Writable var PassThrough = require('readable-stream').PassThrough var noop = function () {} var overflow = function (size) { size &= 511 return size && 512 - size } var emptyStream = function (self, offset) { var s = new Source(self, offset) s.end() return s } var mixinPax = function (header, pax) { if (pax.path) header.name = pax.path if (pax.linkpath) header.linkname = pax.linkpath if (pax.size) header.size = parseInt(pax.size, 10) header.pax = pax return header } var Source = function (self, offset) { this._parent = self this.offset = offset PassThrough.call(this, { autoDestroy: false }) } util.inherits(Source, PassThrough) Source.prototype.destroy = function (err) { this._parent.destroy(err) } var Extract = function (opts) { if (!(this instanceof Extract)) return new Extract(opts) Writable.call(this, opts) opts = opts || {} this._offset = 0 this._buffer = bl() this._missing = 0 this._partial = false this._onparse = noop this._header = null this._stream = null this._overflow = null this._cb = null this._locked = false this._destroyed = false this._pax = null this._paxGlobal = null this._gnuLongPath = null this._gnuLongLinkPath = null var self = this var b = self._buffer var oncontinue = function () { self._continue() } var onunlock = function (err) { self._locked = false if (err) return self.destroy(err) if (!self._stream) oncontinue() } var onstreamend = function () { self._stream = null var drain = overflow(self._header.size) if (drain) self._parse(drain, ondrain) else self._parse(512, onheader) if (!self._locked) oncontinue() } var ondrain = function () { self._buffer.consume(overflow(self._header.size)) self._parse(512, onheader) oncontinue() } var onpaxglobalheader = function () { var size = self._header.size self._paxGlobal = headers.decodePax(b.slice(0, size)) b.consume(size) onstreamend() } var onpaxheader = function () { var size = self._header.size self._pax = headers.decodePax(b.slice(0, size)) if (self._paxGlobal) self._pax = Object.assign({}, self._paxGlobal, self._pax) b.consume(size) onstreamend() } var ongnulongpath = function () { var size = self._header.size this._gnuLongPath = headers.decodeLongPath(b.slice(0, size), opts.filenameEncoding) b.consume(size) onstreamend() } var ongnulonglinkpath = function () { var size = self._header.size this._gnuLongLinkPath = headers.decodeLongPath(b.slice(0, size), opts.filenameEncoding) b.consume(size) onstreamend() } var onheader = function () { var offset = self._offset var header try { header = self._header = headers.decode(b.slice(0, 512), opts.filenameEncoding, opts.allowUnknownFormat) } catch (err) { self.emit('error', err) } b.consume(512) if (!header) { self._parse(512, onheader) oncontinue() return } if (header.type === 'gnu-long-path') { self._parse(header.size, ongnulongpath) oncontinue() return } if (header.type === 'gnu-long-link-path') { self._parse(header.size, ongnulonglinkpath) oncontinue() return } if (header.type === 'pax-global-header') { self._parse(header.size, onpaxglobalheader) oncontinue() return } if (header.type === 'pax-header') { self._parse(header.size, onpaxheader) oncontinue() return } if (self._gnuLongPath) { header.name = self._gnuLongPath self._gnuLongPath = null } if (self._gnuLongLinkPath) { header.linkname = self._gnuLongLinkPath self._gnuLongLinkPath = null } if (self._pax) { self._header = header = mixinPax(header, self._pax) self._pax = null } self._locked = true if (!header.size || header.type === 'directory') { self._parse(512, onheader) self.emit('entry', header, emptyStream(self, offset), onunlock) return } self._stream = new Source(self, offset) self.emit('entry', header, self._stream, onunlock) self._parse(header.size, onstreamend) oncontinue() } this._onheader = onheader this._parse(512, onheader) } util.inherits(Extract, Writable) Extract.prototype.destroy = function (err) { if (this._destroyed) return this._destroyed = true if (err) this.emit('error', err) this.emit('close') if (this._stream) this._stream.emit('close') } Extract.prototype._parse = function (size, onparse) { if (this._destroyed) return this._offset += size this._missing = size if (onparse === this._onheader) this._partial = false this._onparse = onparse } Extract.prototype._continue = function () { if (this._destroyed) return var cb = this._cb this._cb = noop if (this._overflow) this._write(this._overflow, undefined, cb) else cb() } Extract.prototype._write = function (data, enc, cb) { if (this._destroyed) return var s = this._stream var b = this._buffer var missing = this._missing if (data.length) this._partial = true // we do not reach end-of-chunk now. just forward it if (data.length < missing) { this._missing -= data.length this._overflow = null if (s) return s.write(data, cb) b.append(data) return cb() } // end-of-chunk. the parser should call cb. this._cb = cb this._missing = 0 var overflow = null if (data.length > missing) { overflow = data.slice(missing) data = data.slice(0, missing) } if (s) s.end(data) else b.append(data) this._overflow = overflow this._onparse() } Extract.prototype._final = function (cb) { if (this._partial) return this.destroy(new Error('Unexpected end of data')) cb() } module.exports = Extract var alloc = Buffer.alloc var ZEROS = '0000000000000000000' var SEVENS = '7777777777777777777' var ZERO_OFFSET = '0'.charCodeAt(0) var USTAR_MAGIC = Buffer.from('ustar\x00', 'binary') var USTAR_VER = Buffer.from('00', 'binary') var GNU_MAGIC = Buffer.from('ustar\x20', 'binary') var GNU_VER = Buffer.from('\x20\x00', 'binary') var MASK = parseInt('7777', 8) var MAGIC_OFFSET = 257 var VERSION_OFFSET = 263 var clamp = function (index, len, defaultValue) { if (typeof index !== 'number') return defaultValue index = ~~index // Coerce to integer. if (index >= len) return len if (index >= 0) return index index += len if (index >= 0) return index return 0 } var toType = function (flag) { switch (flag) { case 0: return 'file' case 1: return 'link' case 2: return 'symlink' case 3: return 'character-device' case 4: return 'block-device' case 5: return 'directory' case 6: return 'fifo' case 7: return 'contiguous-file' case 72: return 'pax-header' case 55: return 'pax-global-header' case 27: return 'gnu-long-link-path' case 28: case 30: return 'gnu-long-path' } return null } var toTypeflag = function (flag) { switch (flag) { case 'file': return 0 case 'link': return 1 case 'symlink': return 2 case 'character-device': return 3 case 'block-device': return 4 case 'directory': return 5 case 'fifo': return 6 case 'contiguous-file': return 7 case 'pax-header': return 72 } return 0 } var indexOf = function (block, num, offset, end) { for (; offset < end; offset++) { if (block[offset] === num) return offset } return end } var cksum = function (block) { var sum = 8 * 32 for (var i = 0; i < 148; i++) sum += block[i] for (var j = 156; j < 512; j++) sum += block[j] return sum } var encodeOct = function (val, n) { val = val.toString(8) if (val.length > n) return SEVENS.slice(0, n) + ' ' else return ZEROS.slice(0, n - val.length) + val + ' ' } /* Copied from the node-tar repo and modified to meet * tar-stream coding standard. * * Source: https://github.com/npm/node-tar/blob/51b6627a1f357d2eb433e7378e5f05e83b7aa6cd/lib/header.js#L349 */ function parse256 (buf) { // first byte MUST be either 80 or FF // 80 for positive, FF for 2's comp var positive if (buf[0] === 0x80) positive = true else if (buf[0] === 0xFF) positive = false else return null // build up a base-256 tuple from the least sig to the highest var tuple = [] for (var i = buf.length - 1; i > 0; i--) { var byte = buf[i] if (positive) tuple.push(byte) else tuple.push(0xFF - byte) } var sum = 0 var l = tuple.length for (i = 0; i < l; i++) { sum += tuple[i] * Math.pow(256, i) } return positive ? sum : -1 * sum } var decodeOct = function (val, offset, length) { val = val.slice(offset, offset + length) offset = 0 // If prefixed with 0x80 then parse as a base-256 integer if (val[offset] & 0x80) { return parse256(val) } else { // Older versions of tar can prefix with spaces while (offset < val.length && val[offset] === 32) offset++ var end = clamp(indexOf(val, 32, offset, val.length), val.length, val.length) while (offset < end && val[offset] === 0) offset++ if (end === offset) return 0 return parseInt(val.slice(offset, end).toString(), 8) } } var decodeStr = function (val, offset, length, encoding) { return val.slice(offset, indexOf(val, 0, offset, offset + length)).toString(encoding) } var addLength = function (str) { var len = Buffer.byteLength(str) var digits = Math.floor(Math.log(len) / Math.log(10)) + 1 if (len + digits >= Math.pow(10, digits)) digits++ return (len + digits) + str } exports.decodeLongPath = function (buf, encoding) { return decodeStr(buf, 0, buf.length, encoding) } exports.encodePax = function (opts) { // TODO: encode more stuff in pax var result = '' if (opts.name) result += addLength(' path=' + opts.name + '\n') if (opts.linkname) result += addLength(' linkpath=' + opts.linkname + '\n') var pax = opts.pax if (pax) { for (var key in pax) { result += addLength(' ' + key + '=' + pax[key] + '\n') } } return Buffer.from(result) } exports.decodePax = function (buf) { var result = {} while (buf.length) { var i = 0 while (i < buf.length && buf[i] !== 32) i++ var len = parseInt(buf.slice(0, i).toString(), 10) if (!len) return result var b = buf.slice(i + 1, len - 1).toString() var keyIndex = b.indexOf('=') if (keyIndex === -1) return result result[b.slice(0, keyIndex)] = b.slice(keyIndex + 1) buf = buf.slice(len) } return result } exports.encode = function (opts) { var buf = alloc(512) var name = opts.name var prefix = '' if (opts.typeflag === 5 && name[name.length - 1] !== '/') name += '/' if (Buffer.byteLength(name) !== name.length) return null // utf-8 while (Buffer.byteLength(name) > 100) { var i = name.indexOf('/') if (i === -1) return null prefix += prefix ? '/' + name.slice(0, i) : name.slice(0, i) name = name.slice(i + 1) } if (Buffer.byteLength(name) > 100 || Buffer.byteLength(prefix) > 155) return null if (opts.linkname && Buffer.byteLength(opts.linkname) > 100) return null buf.write(name) buf.write(encodeOct(opts.mode & MASK, 6), 100) buf.write(encodeOct(opts.uid, 6), 108) buf.write(encodeOct(opts.gid, 6), 116) buf.write(encodeOct(opts.size, 11), 124) buf.write(encodeOct((opts.mtime.getTime() / 1000) | 0, 11), 136) buf[156] = ZERO_OFFSET + toTypeflag(opts.type) if (opts.linkname) buf.write(opts.linkname, 157) USTAR_MAGIC.copy(buf, MAGIC_OFFSET) USTAR_VER.copy(buf, VERSION_OFFSET) if (opts.uname) buf.write(opts.uname, 265) if (opts.gname) buf.write(opts.gname, 297) buf.write(encodeOct(opts.devmajor || 0, 6), 329) buf.write(encodeOct(opts.devminor || 0, 6), 337) if (prefix) buf.write(prefix, 345) buf.write(encodeOct(cksum(buf), 6), 148) return buf } exports.decode = function (buf, filenameEncoding, allowUnknownFormat) { var typeflag = buf[156] === 0 ? 0 : buf[156] - ZERO_OFFSET var name = decodeStr(buf, 0, 100, filenameEncoding) var mode = decodeOct(buf, 100, 8) var uid = decodeOct(buf, 108, 8) var gid = decodeOct(buf, 116, 8) var size = decodeOct(buf, 124, 12) var mtime = decodeOct(buf, 136, 12) var type = toType(typeflag) var linkname = buf[157] === 0 ? null : decodeStr(buf, 157, 100, filenameEncoding) var uname = decodeStr(buf, 265, 32) var gname = decodeStr(buf, 297, 32) var devmajor = decodeOct(buf, 329, 8) var devminor = decodeOct(buf, 337, 8) var c = cksum(buf) // checksum is still initial value if header was null. if (c === 8 * 32) return null // valid checksum if (c !== decodeOct(buf, 148, 8)) throw new Error('Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?') if (USTAR_MAGIC.compare(buf, MAGIC_OFFSET, MAGIC_OFFSET + 6) === 0) { // ustar (posix) format. // prepend prefix, if present. if (buf[345]) name = decodeStr(buf, 345, 155, filenameEncoding) + '/' + name } else if (GNU_MAGIC.compare(buf, MAGIC_OFFSET, MAGIC_OFFSET + 6) === 0 && GNU_VER.compare(buf, VERSION_OFFSET, VERSION_OFFSET + 2) === 0) { // 'gnu'/'oldgnu' format. Similar to ustar, but has support for incremental and // multi-volume tarballs. } else { if (!allowUnknownFormat) { throw new Error('Invalid tar header: unknown format.') } } // to support old tar versions that use trailing / to indicate dirs if (typeflag === 0 && name && name[name.length - 1] === '/') typeflag = 5 return { name, mode, uid, gid, size, mtime: new Date(1000 * mtime), type, linkname, uname, gname, devmajor, devminor } } exports.extract = require('./extract') exports.pack = require('./pack') The MIT License (MIT) Copyright (c) 2014 Mathias Buus Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.var constants = require('fs-constants') var eos = require('end-of-stream') var inherits = require('inherits') var alloc = Buffer.alloc var Readable = require('readable-stream').Readable var Writable = require('readable-stream').Writable var StringDecoder = require('string_decoder').StringDecoder var headers = require('./headers') var DMODE = parseInt('755', 8) var FMODE = parseInt('644', 8) var END_OF_TAR = alloc(1024) var noop = function () {} var overflow = function (self, size) { size &= 511 if (size) self.push(END_OF_TAR.slice(0, 512 - size)) } function modeToType (mode) { switch (mode & constants.S_IFMT) { case constants.S_IFBLK: return 'block-device' case constants.S_IFCHR: return 'character-device' case constants.S_IFDIR: return 'directory' case constants.S_IFIFO: return 'fifo' case constants.S_IFLNK: return 'symlink' } return 'file' } var Sink = function (to) { Writable.call(this) this.written = 0 this._to = to this._destroyed = false } inherits(Sink, Writable) Sink.prototype._write = function (data, enc, cb) { this.written += data.length if (this._to.push(data)) return cb() this._to._drain = cb } Sink.prototype.destroy = function () { if (this._destroyed) return this._destroyed = true this.emit('close') } var LinkSink = function () { Writable.call(this) this.linkname = '' this._decoder = new StringDecoder('utf-8') this._destroyed = false } inherits(LinkSink, Writable) LinkSink.prototype._write = function (data, enc, cb) { this.linkname += this._decoder.write(data) cb() } LinkSink.prototype.destroy = function () { if (this._destroyed) return this._destroyed = true this.emit('close') } var Void = function () { Writable.call(this) this._destroyed = false } inherits(Void, Writable) Void.prototype._write = function (data, enc, cb) { cb(new Error('No body allowed for this entry')) } Void.prototype.destroy = function () { if (this._destroyed) return this._destroyed = true this.emit('close') } var Pack = function (opts) { if (!(this instanceof Pack)) return new Pack(opts) Readable.call(this, opts) this._drain = noop this._finalized = false this._finalizing = false this._destroyed = false this._stream = null } inherits(Pack, Readable) Pack.prototype.entry = function (header, buffer, callback) { if (this._stream) throw new Error('already piping an entry') if (this._finalized || this._destroyed) return if (typeof buffer === 'function') { callback = buffer buffer = null } if (!callback) callback = noop var self = this if (!header.size || header.type === 'symlink') header.size = 0 if (!header.type) header.type = modeToType(header.mode) if (!header.mode) header.mode = header.type === 'directory' ? DMODE : FMODE if (!header.uid) header.uid = 0 if (!header.gid) header.gid = 0 if (!header.mtime) header.mtime = new Date() if (typeof buffer === 'string') buffer = Buffer.from(buffer) if (Buffer.isBuffer(buffer)) { header.size = buffer.length this._encode(header) var ok = this.push(buffer) overflow(self, header.size) if (ok) process.nextTick(callback) else this._drain = callback return new Void() } if (header.type === 'symlink' && !header.linkname) { var linkSink = new LinkSink() eos(linkSink, function (err) { if (err) { // stream was closed self.destroy() return callback(err) } header.linkname = linkSink.linkname self._encode(header) callback() }) return linkSink } this._encode(header) if (header.type !== 'file' && header.type !== 'contiguous-file') { process.nextTick(callback) return new Void() } var sink = new Sink(this) this._stream = sink eos(sink, function (err) { self._stream = null if (err) { // stream was closed self.destroy() return callback(err) } if (sink.written !== header.size) { // corrupting tar self.destroy() return callback(new Error('size mismatch')) } overflow(self, header.size) if (self._finalizing) self.finalize() callback() }) return sink } Pack.prototype.finalize = function () { if (this._stream) { this._finalizing = true return } if (this._finalized) return this._finalized = true this.push(END_OF_TAR) this.push(null) } Pack.prototype.destroy = function (err) { if (this._destroyed) return this._destroyed = true if (err) this.emit('error', err) this.emit('close') if (this._stream && this._stream.destroy) this._stream.destroy() } Pack.prototype._encode = function (header) { if (!header.pax) { var buf = headers.encode(header) if (buf) { this.push(buf) return } } this._encodePax(header) } Pack.prototype._encodePax = function (header) { var paxHeader = headers.encodePax({ name: header.name, linkname: header.linkname, pax: header.pax }) var newHeader = { name: 'PaxHeader', mode: header.mode, uid: header.uid, gid: header.gid, size: paxHeader.length, mtime: header.mtime, type: 'pax-header', linkname: header.linkname && 'PaxHeader', uname: header.uname, gname: header.gname, devmajor: header.devmajor, devminor: header.devminor } this.push(headers.encode(newHeader)) this.push(paxHeader) overflow(this, paxHeader.length) newHeader.size = header.size newHeader.type = header.type this.push(headers.encode(newHeader)) } Pack.prototype._read = function (n) { var drain = this._drain this._drain = noop drain() } module.exports = Pack { "name": "tar-stream", "version": "2.2.0", "description": "tar-stream is a streaming tar parser and generator and nothing else. It is streams2 and operates purely using streams which means you can easily extract/parse tarballs without ever hitting the file system.", "author": "Mathias Buus ", "dependencies": { "bl": "^4.0.3", "end-of-stream": "^1.4.1", "fs-constants": "^1.0.0", "inherits": "^2.0.3", "readable-stream": "^3.1.1" }, "devDependencies": { "concat-stream": "^2.0.0", "standard": "^12.0.1", "tape": "^4.9.2" }, "scripts": { "test": "standard && tape test/extract.js test/pack.js", "test-all": "standard && tape test/*.js" }, "keywords": [ "tar", "tarball", "parse", "parser", "generate", "generator", "stream", "stream2", "streams", "streams2", "streaming", "pack", "extract", "modify" ], "bugs": { "url": "https://github.com/mafintosh/tar-stream/issues" }, "homepage": "https://github.com/mafintosh/tar-stream", "main": "index.js", "files": [ "*.js", "LICENSE" ], "directories": { "test": "test" }, "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/mafintosh/tar-stream.git" }, "engines": { "node": ">=6" } } const tar = require('tar-stream') const fs = require('fs') const path = require('path') const pipeline = require('pump') // eequire('stream').pipeline fs.createReadStream('test.tar') .pipe(tar.extract()) .on('entry', function (header, stream, done) { console.log(header.name) pipeline(stream, fs.createWriteStream(path.join('/tmp', header.name)), done) }) // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // a duplex stream is just a stream that is both readable and writable. // Since JS doesn't have multiple prototypal inheritance, this class // prototypally inherits from Readable, and then parasitically from // Writable. 'use strict'; /**/ var objectKeys = Object.keys || function (obj) { var keys = []; for (var key in obj) { keys.push(key); } return keys; }; /**/ module.exports = Duplex; var Readable = require('./_stream_readable'); var Writable = require('./_stream_writable'); require('inherits')(Duplex, Readable); { // Allow the keys array to be GC'ed. var keys = objectKeys(Writable.prototype); for (var v = 0; v < keys.length; v++) { var method = keys[v]; if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; } } function Duplex(options) { if (!(this instanceof Duplex)) return new Duplex(options); Readable.call(this, options); Writable.call(this, options); this.allowHalfOpen = true; if (options) { if (options.readable === false) this.readable = false; if (options.writable === false) this.writable = false; if (options.allowHalfOpen === false) { this.allowHalfOpen = false; this.once('end', onend); } } } Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState.highWaterMark; } }); Object.defineProperty(Duplex.prototype, 'writableBuffer', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState && this._writableState.getBuffer(); } }); Object.defineProperty(Duplex.prototype, 'writableLength', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState.length; } }); // the no-half-open enforcer function onend() { // If the writable side ended, then we're ok. if (this._writableState.ended) return; // no more data can be written. // But allow more writes to happen in this tick. process.nextTick(onEndNT, this); } function onEndNT(self) { self.end(); } Object.defineProperty(Duplex.prototype, 'destroyed', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { if (this._readableState === undefined || this._writableState === undefined) { return false; } return this._readableState.destroyed && this._writableState.destroyed; }, set: function set(value) { // we ignore the value if the stream // has not been initialized yet if (this._readableState === undefined || this._writableState === undefined) { return; } // backward compatibility, the user is explicitly // managing destroyed this._readableState.destroyed = value; this._writableState.destroyed = value; } });// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // a passthrough stream. // basically just the most minimal sort of Transform stream. // Every written chunk gets output as-is. 'use strict'; module.exports = PassThrough; var Transform = require('./_stream_transform'); require('inherits')(PassThrough, Transform); function PassThrough(options) { if (!(this instanceof PassThrough)) return new PassThrough(options); Transform.call(this, options); } PassThrough.prototype._transform = function (chunk, encoding, cb) { cb(null, chunk); };// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; module.exports = Readable; /**/ var Duplex; /**/ Readable.ReadableState = ReadableState; /**/ var EE = require('events').EventEmitter; var EElistenerCount = function EElistenerCount(emitter, type) { return emitter.listeners(type).length; }; /**/ /**/ var Stream = require('./internal/streams/stream'); /**/ var Buffer = require('buffer').Buffer; var OurUint8Array = global.Uint8Array || function () {}; function _uint8ArrayToBuffer(chunk) { return Buffer.from(chunk); } function _isUint8Array(obj) { return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; } /**/ var debugUtil = require('util'); var debug; if (debugUtil && debugUtil.debuglog) { debug = debugUtil.debuglog('stream'); } else { debug = function debug() {}; } /**/ var BufferList = require('./internal/streams/buffer_list'); var destroyImpl = require('./internal/streams/destroy'); var _require = require('./internal/streams/state'), getHighWaterMark = _require.getHighWaterMark; var _require$codes = require('../errors').codes, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; // Lazy loaded to improve the startup performance. var StringDecoder; var createReadableStreamAsyncIterator; var from; require('inherits')(Readable, Stream); var errorOrDestroy = destroyImpl.errorOrDestroy; var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; function prependListener(emitter, event, fn) { // Sadly this is not cacheable as some libraries bundle their own // event emitter implementation with them. if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); // This is a hack to make sure that our error handler is attached before any // userland ones. NEVER DO THIS. This is here only because this code needs // to continue to work with older versions of Node.js that do not include // the prependListener() method. The goal is to eventually remove this hack. if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; } function ReadableState(options, stream, isDuplex) { Duplex = Duplex || require('./_stream_duplex'); options = options || {}; // Duplex streams are both readable and writable, but share // the same options object. // However, some cases require setting options to different // values for the readable and the writable sides of the duplex stream. // These options can be provided separately as readableXXX and writableXXX. if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag. Used to make read(n) ignore n and to // make all the buffer merging and length checks go away this.objectMode = !!options.objectMode; if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer // Note: 0 is a valid value, means "don't call _read preemptively ever" this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); // A linked list is used to store data chunks instead of an array because the // linked list can remove elements from the beginning faster than // array.shift() this.buffer = new BufferList(); this.length = 0; this.pipes = null; this.pipesCount = 0; this.flowing = null; this.ended = false; this.endEmitted = false; this.reading = false; // a flag to be able to tell if the event 'readable'/'data' is emitted // immediately, or on a later tick. We set this to true at first, because // any actions that shouldn't happen until "later" should generally also // not happen before the first read call. this.sync = true; // whenever we return null, then we set a flag to say // that we're awaiting a 'readable' event emission. this.needReadable = false; this.emittedReadable = false; this.readableListening = false; this.resumeScheduled = false; this.paused = true; // Should close be emitted on destroy. Defaults to true. this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'end' (and potentially 'finish') this.autoDestroy = !!options.autoDestroy; // has it been destroyed this.destroyed = false; // Crypto is kind of old and crusty. Historically, its default string // encoding is 'binary' so we have to make this configurable. // Everything else in the universe uses 'utf8', though. this.defaultEncoding = options.defaultEncoding || 'utf8'; // the number of writers that are awaiting a drain event in .pipe()s this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled this.readingMore = false; this.decoder = null; this.encoding = null; if (options.encoding) { if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; this.decoder = new StringDecoder(options.encoding); this.encoding = options.encoding; } } function Readable(options) { Duplex = Duplex || require('./_stream_duplex'); if (!(this instanceof Readable)) return new Readable(options); // Checking for a Stream.Duplex instance is faster here instead of inside // the ReadableState constructor, at least with V8 6.5 var isDuplex = this instanceof Duplex; this._readableState = new ReadableState(options, this, isDuplex); // legacy this.readable = true; if (options) { if (typeof options.read === 'function') this._read = options.read; if (typeof options.destroy === 'function') this._destroy = options.destroy; } Stream.call(this); } Object.defineProperty(Readable.prototype, 'destroyed', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { if (this._readableState === undefined) { return false; } return this._readableState.destroyed; }, set: function set(value) { // we ignore the value if the stream // has not been initialized yet if (!this._readableState) { return; } // backward compatibility, the user is explicitly // managing destroyed this._readableState.destroyed = value; } }); Readable.prototype.destroy = destroyImpl.destroy; Readable.prototype._undestroy = destroyImpl.undestroy; Readable.prototype._destroy = function (err, cb) { cb(err); }; // Manually shove something into the read() buffer. // This returns true if the highWaterMark has not been hit yet, // similar to how Writable.write() returns true if you should // write() some more. Readable.prototype.push = function (chunk, encoding) { var state = this._readableState; var skipChunkCheck; if (!state.objectMode) { if (typeof chunk === 'string') { encoding = encoding || state.defaultEncoding; if (encoding !== state.encoding) { chunk = Buffer.from(chunk, encoding); encoding = ''; } skipChunkCheck = true; } } else { skipChunkCheck = true; } return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); }; // Unshift should *always* be something directly out of read() Readable.prototype.unshift = function (chunk) { return readableAddChunk(this, chunk, null, true, false); }; function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { debug('readableAddChunk', chunk); var state = stream._readableState; if (chunk === null) { state.reading = false; onEofChunk(stream, state); } else { var er; if (!skipChunkCheck) er = chunkInvalid(state, chunk); if (er) { errorOrDestroy(stream, er); } else if (state.objectMode || chunk && chunk.length > 0) { if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { chunk = _uint8ArrayToBuffer(chunk); } if (addToFront) { if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true); } else if (state.ended) { errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF()); } else if (state.destroyed) { return false; } else { state.reading = false; if (state.decoder && !encoding) { chunk = state.decoder.write(chunk); if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); } else { addChunk(stream, state, chunk, false); } } } else if (!addToFront) { state.reading = false; maybeReadMore(stream, state); } } // We can push more data if we are below the highWaterMark. // Also, if we have no data yet, we can stand some more bytes. // This is to work around cases where hwm=0, such as the repl. return !state.ended && (state.length < state.highWaterMark || state.length === 0); } function addChunk(stream, state, chunk, addToFront) { if (state.flowing && state.length === 0 && !state.sync) { state.awaitDrain = 0; stream.emit('data', chunk); } else { // update the buffer info. state.length += state.objectMode ? 1 : chunk.length; if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); if (state.needReadable) emitReadable(stream); } maybeReadMore(stream, state); } function chunkInvalid(state, chunk) { var er; if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk); } return er; } Readable.prototype.isPaused = function () { return this._readableState.flowing === false; }; // backwards compatibility. Readable.prototype.setEncoding = function (enc) { if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; var decoder = new StringDecoder(enc); this._readableState.decoder = decoder; // If setEncoding(null), decoder.encoding equals utf8 this._readableState.encoding = this._readableState.decoder.encoding; // Iterate over current buffer to convert already stored Buffers: var p = this._readableState.buffer.head; var content = ''; while (p !== null) { content += decoder.write(p.data); p = p.next; } this._readableState.buffer.clear(); if (content !== '') this._readableState.buffer.push(content); this._readableState.length = content.length; return this; }; // Don't raise the hwm > 1GB var MAX_HWM = 0x40000000; function computeNewHighWaterMark(n) { if (n >= MAX_HWM) { // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE. n = MAX_HWM; } else { // Get the next highest power of 2 to prevent increasing hwm excessively in // tiny amounts n--; n |= n >>> 1; n |= n >>> 2; n |= n >>> 4; n |= n >>> 8; n |= n >>> 16; n++; } return n; } // This function is designed to be inlinable, so please take care when making // changes to the function body. function howMuchToRead(n, state) { if (n <= 0 || state.length === 0 && state.ended) return 0; if (state.objectMode) return 1; if (n !== n) { // Only flow one buffer at a time if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; } // If we're asking for more than the current hwm, then raise the hwm. if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); if (n <= state.length) return n; // Don't have enough if (!state.ended) { state.needReadable = true; return 0; } return state.length; } // you can override either this method, or the async _read(n) below. Readable.prototype.read = function (n) { debug('read', n); n = parseInt(n, 10); var state = this._readableState; var nOrig = n; if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we // already have a bunch of data in the buffer, then just trigger // the 'readable' event and move on. if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { debug('read: emitReadable', state.length, state.ended); if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); return null; } n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up. if (n === 0 && state.ended) { if (state.length === 0) endReadable(this); return null; } // All the actual chunk generation logic needs to be // *below* the call to _read. The reason is that in certain // synthetic stream cases, such as passthrough streams, _read // may be a completely synchronous operation which may change // the state of the read buffer, providing enough data when // before there was *not* enough. // // So, the steps are: // 1. Figure out what the state of things will be after we do // a read from the buffer. // // 2. If that resulting state will trigger a _read, then call _read. // Note that this may be asynchronous, or synchronous. Yes, it is // deeply ugly to write APIs this way, but that still doesn't mean // that the Readable class should behave improperly, as streams are // designed to be sync/async agnostic. // Take note if the _read call is sync or async (ie, if the read call // has returned yet), so that we know whether or not it's safe to emit // 'readable' etc. // // 3. Actually pull the requested chunks out of the buffer and return. // if we need a readable event, then we need to do some reading. var doRead = state.needReadable; debug('need readable', doRead); // if we currently have less than the highWaterMark, then also read some if (state.length === 0 || state.length - n < state.highWaterMark) { doRead = true; debug('length less than watermark', doRead); } // however, if we've ended, then there's no point, and if we're already // reading, then it's unnecessary. if (state.ended || state.reading) { doRead = false; debug('reading or ended', doRead); } else if (doRead) { debug('do read'); state.reading = true; state.sync = true; // if the length is currently zero, then we *need* a readable event. if (state.length === 0) state.needReadable = true; // call internal read method this._read(state.highWaterMark); state.sync = false; // If _read pushed data synchronously, then `reading` will be false, // and we need to re-evaluate how much data we can return to the user. if (!state.reading) n = howMuchToRead(nOrig, state); } var ret; if (n > 0) ret = fromList(n, state);else ret = null; if (ret === null) { state.needReadable = state.length <= state.highWaterMark; n = 0; } else { state.length -= n; state.awaitDrain = 0; } if (state.length === 0) { // If we have nothing in the buffer, then we want to know // as soon as we *do* get something into the buffer. if (!state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick. if (nOrig !== n && state.ended) endReadable(this); } if (ret !== null) this.emit('data', ret); return ret; }; function onEofChunk(stream, state) { debug('onEofChunk'); if (state.ended) return; if (state.decoder) { var chunk = state.decoder.end(); if (chunk && chunk.length) { state.buffer.push(chunk); state.length += state.objectMode ? 1 : chunk.length; } } state.ended = true; if (state.sync) { // if we are sync, wait until next tick to emit the data. // Otherwise we risk emitting data in the flow() // the readable code triggers during a read() call emitReadable(stream); } else { // emit 'readable' now to make sure it gets picked up. state.needReadable = false; if (!state.emittedReadable) { state.emittedReadable = true; emitReadable_(stream); } } } // Don't emit readable right away in sync mode, because this can trigger // another read() call => stack overflow. This way, it might trigger // a nextTick recursion warning, but that's not so bad. function emitReadable(stream) { var state = stream._readableState; debug('emitReadable', state.needReadable, state.emittedReadable); state.needReadable = false; if (!state.emittedReadable) { debug('emitReadable', state.flowing); state.emittedReadable = true; process.nextTick(emitReadable_, stream); } } function emitReadable_(stream) { var state = stream._readableState; debug('emitReadable_', state.destroyed, state.length, state.ended); if (!state.destroyed && (state.length || state.ended)) { stream.emit('readable'); state.emittedReadable = false; } // The stream needs another readable event if // 1. It is not flowing, as the flow mechanism will take // care of it. // 2. It is not ended. // 3. It is below the highWaterMark, so we can schedule // another readable later. state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; flow(stream); } // at this point, the user has presumably seen the 'readable' event, // and called read() to consume some data. that may have triggered // in turn another _read(n) call, in which case reading = true if // it's in progress. // However, if we're not ended, or reading, and the length < hwm, // then go ahead and try to read some more preemptively. function maybeReadMore(stream, state) { if (!state.readingMore) { state.readingMore = true; process.nextTick(maybeReadMore_, stream, state); } } function maybeReadMore_(stream, state) { // Attempt to read more data if we should. // // The conditions for reading more data are (one of): // - Not enough data buffered (state.length < state.highWaterMark). The loop // is responsible for filling the buffer with enough data if such data // is available. If highWaterMark is 0 and we are not in the flowing mode // we should _not_ attempt to buffer any extra data. We'll get more data // when the stream consumer calls read() instead. // - No data in the buffer, and the stream is in flowing mode. In this mode // the loop below is responsible for ensuring read() is called. Failing to // call read here would abort the flow and there's no other mechanism for // continuing the flow if the stream consumer has just subscribed to the // 'data' event. // // In addition to the above conditions to keep reading data, the following // conditions prevent the data from being read: // - The stream has ended (state.ended). // - There is already a pending 'read' operation (state.reading). This is a // case where the the stream has called the implementation defined _read() // method, but they are processing the call asynchronously and have _not_ // called push() with new data. In this case we skip performing more // read()s. The execution ends in this method again after the _read() ends // up calling push() with more data. while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { var len = state.length; debug('maybeReadMore read 0'); stream.read(0); if (len === state.length) // didn't get any data, stop spinning. break; } state.readingMore = false; } // abstract method. to be overridden in specific implementation classes. // call cb(er, data) where data is <= n in length. // for virtual (non-string, non-buffer) streams, "length" is somewhat // arbitrary, and perhaps not very meaningful. Readable.prototype._read = function (n) { errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()')); }; Readable.prototype.pipe = function (dest, pipeOpts) { var src = this; var state = this._readableState; switch (state.pipesCount) { case 0: state.pipes = dest; break; case 1: state.pipes = [state.pipes, dest]; break; default: state.pipes.push(dest); break; } state.pipesCount += 1; debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; var endFn = doEnd ? onend : unpipe; if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn); dest.on('unpipe', onunpipe); function onunpipe(readable, unpipeInfo) { debug('onunpipe'); if (readable === src) { if (unpipeInfo && unpipeInfo.hasUnpiped === false) { unpipeInfo.hasUnpiped = true; cleanup(); } } } function onend() { debug('onend'); dest.end(); } // when the dest drains, it reduces the awaitDrain counter // on the source. This would be more elegant with a .once() // handler in flow(), but adding and removing repeatedly is // too slow. var ondrain = pipeOnDrain(src); dest.on('drain', ondrain); var cleanedUp = false; function cleanup() { debug('cleanup'); // cleanup event handlers once the pipe is broken dest.removeListener('close', onclose); dest.removeListener('finish', onfinish); dest.removeListener('drain', ondrain); dest.removeListener('error', onerror); dest.removeListener('unpipe', onunpipe); src.removeListener('end', onend); src.removeListener('end', unpipe); src.removeListener('data', ondata); cleanedUp = true; // if the reader is waiting for a drain event from this // specific writer, then it would cause it to never start // flowing again. // So, if this is awaiting a drain, then we just call it now. // If we don't know, then assume that we are waiting for one. if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); } src.on('data', ondata); function ondata(chunk) { debug('ondata'); var ret = dest.write(chunk); debug('dest.write', ret); if (ret === false) { // If the user unpiped during `dest.write()`, it is possible // to get stuck in a permanently paused state if that write // also returned false. // => Check whether `dest` is still a piping destination. if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { debug('false write response, pause', state.awaitDrain); state.awaitDrain++; } src.pause(); } } // if the dest has an error, then stop piping into it. // however, don't suppress the throwing behavior for this. function onerror(er) { debug('onerror', er); unpipe(); dest.removeListener('error', onerror); if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er); } // Make sure our error handler is attached before userland ones. prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once. function onclose() { dest.removeListener('finish', onfinish); unpipe(); } dest.once('close', onclose); function onfinish() { debug('onfinish'); dest.removeListener('close', onclose); unpipe(); } dest.once('finish', onfinish); function unpipe() { debug('unpipe'); src.unpipe(dest); } // tell the dest that it's being piped to dest.emit('pipe', src); // start the flow if it hasn't been started already. if (!state.flowing) { debug('pipe resume'); src.resume(); } return dest; }; function pipeOnDrain(src) { return function pipeOnDrainFunctionResult() { var state = src._readableState; debug('pipeOnDrain', state.awaitDrain); if (state.awaitDrain) state.awaitDrain--; if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { state.flowing = true; flow(src); } }; } Readable.prototype.unpipe = function (dest) { var state = this._readableState; var unpipeInfo = { hasUnpiped: false }; // if we're not piping anywhere, then do nothing. if (state.pipesCount === 0) return this; // just one destination. most common case. if (state.pipesCount === 1) { // passed in one, but it's not the right one. if (dest && dest !== state.pipes) return this; if (!dest) dest = state.pipes; // got a match. state.pipes = null; state.pipesCount = 0; state.flowing = false; if (dest) dest.emit('unpipe', this, unpipeInfo); return this; } // slow case. multiple pipe destinations. if (!dest) { // remove all. var dests = state.pipes; var len = state.pipesCount; state.pipes = null; state.pipesCount = 0; state.flowing = false; for (var i = 0; i < len; i++) { dests[i].emit('unpipe', this, { hasUnpiped: false }); } return this; } // try to find the right one. var index = indexOf(state.pipes, dest); if (index === -1) return this; state.pipes.splice(index, 1); state.pipesCount -= 1; if (state.pipesCount === 1) state.pipes = state.pipes[0]; dest.emit('unpipe', this, unpipeInfo); return this; }; // set up data events if they are asked for // Ensure readable listeners eventually get something Readable.prototype.on = function (ev, fn) { var res = Stream.prototype.on.call(this, ev, fn); var state = this._readableState; if (ev === 'data') { // update readableListening so that resume() may be a no-op // a few lines down. This is needed to support once('readable'). state.readableListening = this.listenerCount('readable') > 0; // Try start flowing on next tick if stream isn't explicitly paused if (state.flowing !== false) this.resume(); } else if (ev === 'readable') { if (!state.endEmitted && !state.readableListening) { state.readableListening = state.needReadable = true; state.flowing = false; state.emittedReadable = false; debug('on readable', state.length, state.reading); if (state.length) { emitReadable(this); } else if (!state.reading) { process.nextTick(nReadingNextTick, this); } } } return res; }; Readable.prototype.addListener = Readable.prototype.on; Readable.prototype.removeListener = function (ev, fn) { var res = Stream.prototype.removeListener.call(this, ev, fn); if (ev === 'readable') { // We need to check if there is someone still listening to // readable and reset the state. However this needs to happen // after readable has been emitted but before I/O (nextTick) to // support once('readable', fn) cycles. This means that calling // resume within the same tick will have no // effect. process.nextTick(updateReadableListening, this); } return res; }; Readable.prototype.removeAllListeners = function (ev) { var res = Stream.prototype.removeAllListeners.apply(this, arguments); if (ev === 'readable' || ev === undefined) { // We need to check if there is someone still listening to // readable and reset the state. However this needs to happen // after readable has been emitted but before I/O (nextTick) to // support once('readable', fn) cycles. This means that calling // resume within the same tick will have no // effect. process.nextTick(updateReadableListening, this); } return res; }; function updateReadableListening(self) { var state = self._readableState; state.readableListening = self.listenerCount('readable') > 0; if (state.resumeScheduled && !state.paused) { // flowing needs to be set to true now, otherwise // the upcoming resume will not flow. state.flowing = true; // crude way to check if we should resume } else if (self.listenerCount('data') > 0) { self.resume(); } } function nReadingNextTick(self) { debug('readable nexttick read 0'); self.read(0); } // pause() and resume() are remnants of the legacy readable stream API // If the user uses them, then switch into old mode. Readable.prototype.resume = function () { var state = this._readableState; if (!state.flowing) { debug('resume'); // we flow only if there is no one listening // for readable, but we still have to call // resume() state.flowing = !state.readableListening; resume(this, state); } state.paused = false; return this; }; function resume(stream, state) { if (!state.resumeScheduled) { state.resumeScheduled = true; process.nextTick(resume_, stream, state); } } function resume_(stream, state) { debug('resume', state.reading); if (!state.reading) { stream.read(0); } state.resumeScheduled = false; stream.emit('resume'); flow(stream); if (state.flowing && !state.reading) stream.read(0); } Readable.prototype.pause = function () { debug('call pause flowing=%j', this._readableState.flowing); if (this._readableState.flowing !== false) { debug('pause'); this._readableState.flowing = false; this.emit('pause'); } this._readableState.paused = true; return this; }; function flow(stream) { var state = stream._readableState; debug('flow', state.flowing); while (state.flowing && stream.read() !== null) { ; } } // wrap an old-style stream as the async data source. // This is *not* part of the readable stream interface. // It is an ugly unfortunate mess of history. Readable.prototype.wrap = function (stream) { var _this = this; var state = this._readableState; var paused = false; stream.on('end', function () { debug('wrapped end'); if (state.decoder && !state.ended) { var chunk = state.decoder.end(); if (chunk && chunk.length) _this.push(chunk); } _this.push(null); }); stream.on('data', function (chunk) { debug('wrapped data'); if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; var ret = _this.push(chunk); if (!ret) { paused = true; stream.pause(); } }); // proxy all the other methods. // important when wrapping filters and duplexes. for (var i in stream) { if (this[i] === undefined && typeof stream[i] === 'function') { this[i] = function methodWrap(method) { return function methodWrapReturnFunction() { return stream[method].apply(stream, arguments); }; }(i); } } // proxy certain important events. for (var n = 0; n < kProxyEvents.length; n++) { stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); } // when we try to consume some more bytes, simply unpause the // underlying stream. this._read = function (n) { debug('wrapped _read', n); if (paused) { paused = false; stream.resume(); } }; return this; }; if (typeof Symbol === 'function') { Readable.prototype[Symbol.asyncIterator] = function () { if (createReadableStreamAsyncIterator === undefined) { createReadableStreamAsyncIterator = require('./internal/streams/async_iterator'); } return createReadableStreamAsyncIterator(this); }; } Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._readableState.highWaterMark; } }); Object.defineProperty(Readable.prototype, 'readableBuffer', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._readableState && this._readableState.buffer; } }); Object.defineProperty(Readable.prototype, 'readableFlowing', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._readableState.flowing; }, set: function set(state) { if (this._readableState) { this._readableState.flowing = state; } } }); // exposed for testing purposes only. Readable._fromList = fromList; Object.defineProperty(Readable.prototype, 'readableLength', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._readableState.length; } }); // Pluck off n bytes from an array of buffers. // Length is the combined lengths of all the buffers in the list. // This function is designed to be inlinable, so please take care when making // changes to the function body. function fromList(n, state) { // nothing buffered if (state.length === 0) return null; var ret; if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { // read it all, truncate the list if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length); state.buffer.clear(); } else { // read part of list ret = state.buffer.consume(n, state.decoder); } return ret; } function endReadable(stream) { var state = stream._readableState; debug('endReadable', state.endEmitted); if (!state.endEmitted) { state.ended = true; process.nextTick(endReadableNT, state, stream); } } function endReadableNT(state, stream) { debug('endReadableNT', state.endEmitted, state.length); // Check that we didn't get one last unshift. if (!state.endEmitted && state.length === 0) { state.endEmitted = true; stream.readable = false; stream.emit('end'); if (state.autoDestroy) { // In case of duplex streams we need a way to detect // if the writable side is ready for autoDestroy as well var wState = stream._writableState; if (!wState || wState.autoDestroy && wState.finished) { stream.destroy(); } } } } if (typeof Symbol === 'function') { Readable.from = function (iterable, opts) { if (from === undefined) { from = require('./internal/streams/from'); } return from(Readable, iterable, opts); }; } function indexOf(xs, x) { for (var i = 0, l = xs.length; i < l; i++) { if (xs[i] === x) return i; } return -1; }// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // a transform stream is a readable/writable stream where you do // something with the data. Sometimes it's called a "filter", // but that's not a great name for it, since that implies a thing where // some bits pass through, and others are simply ignored. (That would // be a valid example of a transform, of course.) // // While the output is causally related to the input, it's not a // necessarily symmetric or synchronous transformation. For example, // a zlib stream might take multiple plain-text writes(), and then // emit a single compressed chunk some time in the future. // // Here's how this works: // // The Transform stream has all the aspects of the readable and writable // stream classes. When you write(chunk), that calls _write(chunk,cb) // internally, and returns false if there's a lot of pending writes // buffered up. When you call read(), that calls _read(n) until // there's enough pending readable data buffered up. // // In a transform stream, the written data is placed in a buffer. When // _read(n) is called, it transforms the queued up data, calling the // buffered _write cb's as it consumes chunks. If consuming a single // written chunk would result in multiple output chunks, then the first // outputted bit calls the readcb, and subsequent chunks just go into // the read buffer, and will cause it to emit 'readable' if necessary. // // This way, back-pressure is actually determined by the reading side, // since _read has to be called to start processing a new chunk. However, // a pathological inflate type of transform can cause excessive buffering // here. For example, imagine a stream where every byte of input is // interpreted as an integer from 0-255, and then results in that many // bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in // 1kb of data being output. In this case, you could write a very small // amount of input, and end up with a very large amount of output. In // such a pathological inflating mechanism, there'd be no way to tell // the system to stop doing the transform. A single 4MB write could // cause the system to run out of memory. // // However, even in such a pathological case, only a single written chunk // would be consumed, and then the rest would wait (un-transformed) until // the results of the previous transformed chunk were consumed. 'use strict'; module.exports = Transform; var _require$codes = require('../errors').codes, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; var Duplex = require('./_stream_duplex'); require('inherits')(Transform, Duplex); function afterTransform(er, data) { var ts = this._transformState; ts.transforming = false; var cb = ts.writecb; if (cb === null) { return this.emit('error', new ERR_MULTIPLE_CALLBACK()); } ts.writechunk = null; ts.writecb = null; if (data != null) // single equals check for both `null` and `undefined` this.push(data); cb(er); var rs = this._readableState; rs.reading = false; if (rs.needReadable || rs.length < rs.highWaterMark) { this._read(rs.highWaterMark); } } function Transform(options) { if (!(this instanceof Transform)) return new Transform(options); Duplex.call(this, options); this._transformState = { afterTransform: afterTransform.bind(this), needTransform: false, transforming: false, writecb: null, writechunk: null, writeencoding: null }; // start out asking for a readable event once data is transformed. this._readableState.needReadable = true; // we have implemented the _read method, and done the other things // that Readable wants before the first _read call, so unset the // sync guard flag. this._readableState.sync = false; if (options) { if (typeof options.transform === 'function') this._transform = options.transform; if (typeof options.flush === 'function') this._flush = options.flush; } // When the writable side finishes, then flush out anything remaining. this.on('prefinish', prefinish); } function prefinish() { var _this = this; if (typeof this._flush === 'function' && !this._readableState.destroyed) { this._flush(function (er, data) { done(_this, er, data); }); } else { done(this, null, null); } } Transform.prototype.push = function (chunk, encoding) { this._transformState.needTransform = false; return Duplex.prototype.push.call(this, chunk, encoding); }; // This is the part where you do stuff! // override this function in implementation classes. // 'chunk' is an input chunk. // // Call `push(newChunk)` to pass along transformed output // to the readable side. You may call 'push' zero or more times. // // Call `cb(err)` when you are done with this chunk. If you pass // an error, then that'll put the hurt on the whole operation. If you // never call cb(), then you'll never get another chunk. Transform.prototype._transform = function (chunk, encoding, cb) { cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()')); }; Transform.prototype._write = function (chunk, encoding, cb) { var ts = this._transformState; ts.writecb = cb; ts.writechunk = chunk; ts.writeencoding = encoding; if (!ts.transforming) { var rs = this._readableState; if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); } }; // Doesn't matter what the args are here. // _transform does all the work. // That we got here means that the readable side wants more data. Transform.prototype._read = function (n) { var ts = this._transformState; if (ts.writechunk !== null && !ts.transforming) { ts.transforming = true; this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); } else { // mark that we need a transform, so that any data that comes in // will get processed, now that we've asked for it. ts.needTransform = true; } }; Transform.prototype._destroy = function (err, cb) { Duplex.prototype._destroy.call(this, err, function (err2) { cb(err2); }); }; function done(stream, er, data) { if (er) return stream.emit('error', er); if (data != null) // single equals check for both `null` and `undefined` stream.push(data); // TODO(BridgeAR): Write a test for these two error cases // if there's nothing in the write buffer, then that means // that nothing more will ever be provided if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0(); if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); return stream.push(null); }// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // A bit simpler than readable streams. // Implement an async ._write(chunk, encoding, cb), and it'll handle all // the drain event emission and buffering. 'use strict'; module.exports = Writable; /* */ function WriteReq(chunk, encoding, cb) { this.chunk = chunk; this.encoding = encoding; this.callback = cb; this.next = null; } // It seems a linked list but it is not // there will be only 2 of these for each stream function CorkedRequest(state) { var _this = this; this.next = null; this.entry = null; this.finish = function () { onCorkedFinish(_this, state); }; } /* */ /**/ var Duplex; /**/ Writable.WritableState = WritableState; /**/ var internalUtil = { deprecate: require('util-deprecate') }; /**/ /**/ var Stream = require('./internal/streams/stream'); /**/ var Buffer = require('buffer').Buffer; var OurUint8Array = global.Uint8Array || function () {}; function _uint8ArrayToBuffer(chunk) { return Buffer.from(chunk); } function _isUint8Array(obj) { return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; } var destroyImpl = require('./internal/streams/destroy'); var _require = require('./internal/streams/state'), getHighWaterMark = _require.getHighWaterMark; var _require$codes = require('../errors').codes, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; var errorOrDestroy = destroyImpl.errorOrDestroy; require('inherits')(Writable, Stream); function nop() {} function WritableState(options, stream, isDuplex) { Duplex = Duplex || require('./_stream_duplex'); options = options || {}; // Duplex streams are both readable and writable, but share // the same options object. // However, some cases require setting options to different // values for the readable and the writable sides of the duplex stream, // e.g. options.readableObjectMode vs. options.writableObjectMode, etc. if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag to indicate whether or not this stream // contains buffers or objects. this.objectMode = !!options.objectMode; if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; // the point at which write() starts returning false // Note: 0 is a valid value, means that we always return false if // the entire buffer is not flushed immediately on write() this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex); // if _final has been called this.finalCalled = false; // drain event flag. this.needDrain = false; // at the start of calling end() this.ending = false; // when end() has been called, and returned this.ended = false; // when 'finish' is emitted this.finished = false; // has it been destroyed this.destroyed = false; // should we decode strings into buffers before passing to _write? // this is here so that some node-core streams can optimize string // handling at a lower level. var noDecode = options.decodeStrings === false; this.decodeStrings = !noDecode; // Crypto is kind of old and crusty. Historically, its default string // encoding is 'binary' so we have to make this configurable. // Everything else in the universe uses 'utf8', though. this.defaultEncoding = options.defaultEncoding || 'utf8'; // not an actual buffer we keep track of, but a measurement // of how much we're waiting to get pushed to some underlying // socket or file. this.length = 0; // a flag to see when we're in the middle of a write. this.writing = false; // when true all writes will be buffered until .uncork() call this.corked = 0; // a flag to be able to tell if the onwrite cb is called immediately, // or on a later tick. We set this to true at first, because any // actions that shouldn't happen until "later" should generally also // not happen before the first write call. this.sync = true; // a flag to know if we're processing previously buffered items, which // may call the _write() callback in the same tick, so that we don't // end up in an overlapped onwrite situation. this.bufferProcessing = false; // the callback that's passed to _write(chunk,cb) this.onwrite = function (er) { onwrite(stream, er); }; // the callback that the user supplies to write(chunk,encoding,cb) this.writecb = null; // the amount that is being written when _write is called. this.writelen = 0; this.bufferedRequest = null; this.lastBufferedRequest = null; // number of pending user-supplied write callbacks // this must be 0 before 'finish' can be emitted this.pendingcb = 0; // emit prefinish if the only thing we're waiting for is _write cbs // This is relevant for synchronous Transform streams this.prefinished = false; // True if the error was already emitted and should not be thrown again this.errorEmitted = false; // Should close be emitted on destroy. Defaults to true. this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'finish' (and potentially 'end') this.autoDestroy = !!options.autoDestroy; // count buffered requests this.bufferedRequestCount = 0; // allocate the first CorkedRequest, there is always // one allocated and free to use, and we maintain at most two this.corkedRequestsFree = new CorkedRequest(this); } WritableState.prototype.getBuffer = function getBuffer() { var current = this.bufferedRequest; var out = []; while (current) { out.push(current); current = current.next; } return out; }; (function () { try { Object.defineProperty(WritableState.prototype, 'buffer', { get: internalUtil.deprecate(function writableStateBufferGetter() { return this.getBuffer(); }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') }); } catch (_) {} })(); // Test _writableState for inheritance to account for Duplex streams, // whose prototype chain only points to Readable. var realHasInstance; if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { realHasInstance = Function.prototype[Symbol.hasInstance]; Object.defineProperty(Writable, Symbol.hasInstance, { value: function value(object) { if (realHasInstance.call(this, object)) return true; if (this !== Writable) return false; return object && object._writableState instanceof WritableState; } }); } else { realHasInstance = function realHasInstance(object) { return object instanceof this; }; } function Writable(options) { Duplex = Duplex || require('./_stream_duplex'); // Writable ctor is applied to Duplexes, too. // `realHasInstance` is necessary because using plain `instanceof` // would return false, as no `_writableState` property is attached. // Trying to use the custom `instanceof` for Writable here will also break the // Node.js LazyTransform implementation, which has a non-trivial getter for // `_writableState` that would lead to infinite recursion. // Checking for a Stream.Duplex instance is faster here instead of inside // the WritableState constructor, at least with V8 6.5 var isDuplex = this instanceof Duplex; if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options); this._writableState = new WritableState(options, this, isDuplex); // legacy. this.writable = true; if (options) { if (typeof options.write === 'function') this._write = options.write; if (typeof options.writev === 'function') this._writev = options.writev; if (typeof options.destroy === 'function') this._destroy = options.destroy; if (typeof options.final === 'function') this._final = options.final; } Stream.call(this); } // Otherwise people can pipe Writable streams, which is just wrong. Writable.prototype.pipe = function () { errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); }; function writeAfterEnd(stream, cb) { var er = new ERR_STREAM_WRITE_AFTER_END(); // TODO: defer error events consistently everywhere, not just the cb errorOrDestroy(stream, er); process.nextTick(cb, er); } // Checks that a user-supplied chunk is valid, especially for the particular // mode the stream is in. Currently this means that `null` is never accepted // and undefined/non-string values are only allowed in object mode. function validChunk(stream, state, chunk, cb) { var er; if (chunk === null) { er = new ERR_STREAM_NULL_VALUES(); } else if (typeof chunk !== 'string' && !state.objectMode) { er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk); } if (er) { errorOrDestroy(stream, er); process.nextTick(cb, er); return false; } return true; } Writable.prototype.write = function (chunk, encoding, cb) { var state = this._writableState; var ret = false; var isBuf = !state.objectMode && _isUint8Array(chunk); if (isBuf && !Buffer.isBuffer(chunk)) { chunk = _uint8ArrayToBuffer(chunk); } if (typeof encoding === 'function') { cb = encoding; encoding = null; } if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; if (typeof cb !== 'function') cb = nop; if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { state.pendingcb++; ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); } return ret; }; Writable.prototype.cork = function () { this._writableState.corked++; }; Writable.prototype.uncork = function () { var state = this._writableState; if (state.corked) { state.corked--; if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); } }; Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { // node::ParseEncoding() requires lower case. if (typeof encoding === 'string') encoding = encoding.toLowerCase(); if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding); this._writableState.defaultEncoding = encoding; return this; }; Object.defineProperty(Writable.prototype, 'writableBuffer', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState && this._writableState.getBuffer(); } }); function decodeChunk(state, chunk, encoding) { if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { chunk = Buffer.from(chunk, encoding); } return chunk; } Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState.highWaterMark; } }); // if we're already writing something, then just put this // in the queue, and wait our turn. Otherwise, call _write // If we return false, then we need a drain event, so set that flag. function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { if (!isBuf) { var newChunk = decodeChunk(state, chunk, encoding); if (chunk !== newChunk) { isBuf = true; encoding = 'buffer'; chunk = newChunk; } } var len = state.objectMode ? 1 : chunk.length; state.length += len; var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false. if (!ret) state.needDrain = true; if (state.writing || state.corked) { var last = state.lastBufferedRequest; state.lastBufferedRequest = { chunk: chunk, encoding: encoding, isBuf: isBuf, callback: cb, next: null }; if (last) { last.next = state.lastBufferedRequest; } else { state.bufferedRequest = state.lastBufferedRequest; } state.bufferedRequestCount += 1; } else { doWrite(stream, state, false, len, chunk, encoding, cb); } return ret; } function doWrite(stream, state, writev, len, chunk, encoding, cb) { state.writelen = len; state.writecb = cb; state.writing = true; state.sync = true; if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); state.sync = false; } function onwriteError(stream, state, sync, er, cb) { --state.pendingcb; if (sync) { // defer the callback if we are being called synchronously // to avoid piling up things on the stack process.nextTick(cb, er); // this can emit finish, and it will always happen // after error process.nextTick(finishMaybe, stream, state); stream._writableState.errorEmitted = true; errorOrDestroy(stream, er); } else { // the caller expect this to happen before if // it is async cb(er); stream._writableState.errorEmitted = true; errorOrDestroy(stream, er); // this can emit finish, but finish must // always follow error finishMaybe(stream, state); } } function onwriteStateUpdate(state) { state.writing = false; state.writecb = null; state.length -= state.writelen; state.writelen = 0; } function onwrite(stream, er) { var state = stream._writableState; var sync = state.sync; var cb = state.writecb; if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK(); onwriteStateUpdate(state); if (er) onwriteError(stream, state, sync, er, cb);else { // Check if we're actually ready to finish, but don't emit yet var finished = needFinish(state) || stream.destroyed; if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { clearBuffer(stream, state); } if (sync) { process.nextTick(afterWrite, stream, state, finished, cb); } else { afterWrite(stream, state, finished, cb); } } } function afterWrite(stream, state, finished, cb) { if (!finished) onwriteDrain(stream, state); state.pendingcb--; cb(); finishMaybe(stream, state); } // Must force callback to be called on nextTick, so that we don't // emit 'drain' before the write() consumer gets the 'false' return // value, and has a chance to attach a 'drain' listener. function onwriteDrain(stream, state) { if (state.length === 0 && state.needDrain) { state.needDrain = false; stream.emit('drain'); } } // if there's something in the buffer waiting, then process it function clearBuffer(stream, state) { state.bufferProcessing = true; var entry = state.bufferedRequest; if (stream._writev && entry && entry.next) { // Fast case, write everything using _writev() var l = state.bufferedRequestCount; var buffer = new Array(l); var holder = state.corkedRequestsFree; holder.entry = entry; var count = 0; var allBuffers = true; while (entry) { buffer[count] = entry; if (!entry.isBuf) allBuffers = false; entry = entry.next; count += 1; } buffer.allBuffers = allBuffers; doWrite(stream, state, true, state.length, buffer, '', holder.finish); // doWrite is almost always async, defer these to save a bit of time // as the hot path ends with doWrite state.pendingcb++; state.lastBufferedRequest = null; if (holder.next) { state.corkedRequestsFree = holder.next; holder.next = null; } else { state.corkedRequestsFree = new CorkedRequest(state); } state.bufferedRequestCount = 0; } else { // Slow case, write chunks one-by-one while (entry) { var chunk = entry.chunk; var encoding = entry.encoding; var cb = entry.callback; var len = state.objectMode ? 1 : chunk.length; doWrite(stream, state, false, len, chunk, encoding, cb); entry = entry.next; state.bufferedRequestCount--; // if we didn't call the onwrite immediately, then // it means that we need to wait until it does. // also, that means that the chunk and cb are currently // being processed, so move the buffer counter past them. if (state.writing) { break; } } if (entry === null) state.lastBufferedRequest = null; } state.bufferedRequest = entry; state.bufferProcessing = false; } Writable.prototype._write = function (chunk, encoding, cb) { cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()')); }; Writable.prototype._writev = null; Writable.prototype.end = function (chunk, encoding, cb) { var state = this._writableState; if (typeof chunk === 'function') { cb = chunk; chunk = null; encoding = null; } else if (typeof encoding === 'function') { cb = encoding; encoding = null; } if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); // .end() fully uncorks if (state.corked) { state.corked = 1; this.uncork(); } // ignore unnecessary end() calls. if (!state.ending) endWritable(this, state, cb); return this; }; Object.defineProperty(Writable.prototype, 'writableLength', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState.length; } }); function needFinish(state) { return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; } function callFinal(stream, state) { stream._final(function (err) { state.pendingcb--; if (err) { errorOrDestroy(stream, err); } state.prefinished = true; stream.emit('prefinish'); finishMaybe(stream, state); }); } function prefinish(stream, state) { if (!state.prefinished && !state.finalCalled) { if (typeof stream._final === 'function' && !state.destroyed) { state.pendingcb++; state.finalCalled = true; process.nextTick(callFinal, stream, state); } else { state.prefinished = true; stream.emit('prefinish'); } } } function finishMaybe(stream, state) { var need = needFinish(state); if (need) { prefinish(stream, state); if (state.pendingcb === 0) { state.finished = true; stream.emit('finish'); if (state.autoDestroy) { // In case of duplex streams we need a way to detect // if the readable side is ready for autoDestroy as well var rState = stream._readableState; if (!rState || rState.autoDestroy && rState.endEmitted) { stream.destroy(); } } } } return need; } function endWritable(stream, state, cb) { state.ending = true; finishMaybe(stream, state); if (cb) { if (state.finished) process.nextTick(cb);else stream.once('finish', cb); } state.ended = true; stream.writable = false; } function onCorkedFinish(corkReq, state, err) { var entry = corkReq.entry; corkReq.entry = null; while (entry) { var cb = entry.callback; state.pendingcb--; cb(err); entry = entry.next; } // reuse the free corkReq. state.corkedRequestsFree.next = corkReq; } Object.defineProperty(Writable.prototype, 'destroyed', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { if (this._writableState === undefined) { return false; } return this._writableState.destroyed; }, set: function set(value) { // we ignore the value if the stream // has not been initialized yet if (!this._writableState) { return; } // backward compatibility, the user is explicitly // managing destroyed this._writableState.destroyed = value; } }); Writable.prototype.destroy = destroyImpl.destroy; Writable.prototype._undestroy = destroyImpl.undestroy; Writable.prototype._destroy = function (err, cb) { cb(err); };'use strict'; var _Object$setPrototypeO; function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var finished = require('./end-of-stream'); var kLastResolve = Symbol('lastResolve'); var kLastReject = Symbol('lastReject'); var kError = Symbol('error'); var kEnded = Symbol('ended'); var kLastPromise = Symbol('lastPromise'); var kHandlePromise = Symbol('handlePromise'); var kStream = Symbol('stream'); function createIterResult(value, done) { return { value: value, done: done }; } function readAndResolve(iter) { var resolve = iter[kLastResolve]; if (resolve !== null) { var data = iter[kStream].read(); // we defer if data is null // we can be expecting either 'end' or // 'error' if (data !== null) { iter[kLastPromise] = null; iter[kLastResolve] = null; iter[kLastReject] = null; resolve(createIterResult(data, false)); } } } function onReadable(iter) { // we wait for the next tick, because it might // emit an error with process.nextTick process.nextTick(readAndResolve, iter); } function wrapForNext(lastPromise, iter) { return function (resolve, reject) { lastPromise.then(function () { if (iter[kEnded]) { resolve(createIterResult(undefined, true)); return; } iter[kHandlePromise](resolve, reject); }, reject); }; } var AsyncIteratorPrototype = Object.getPrototypeOf(function () {}); var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { get stream() { return this[kStream]; }, next: function next() { var _this = this; // if we have detected an error in the meanwhile // reject straight away var error = this[kError]; if (error !== null) { return Promise.reject(error); } if (this[kEnded]) { return Promise.resolve(createIterResult(undefined, true)); } if (this[kStream].destroyed) { // We need to defer via nextTick because if .destroy(err) is // called, the error will be emitted via nextTick, and // we cannot guarantee that there is no error lingering around // waiting to be emitted. return new Promise(function (resolve, reject) { process.nextTick(function () { if (_this[kError]) { reject(_this[kError]); } else { resolve(createIterResult(undefined, true)); } }); }); } // if we have multiple next() calls // we will wait for the previous Promise to finish // this logic is optimized to support for await loops, // where next() is only called once at a time var lastPromise = this[kLastPromise]; var promise; if (lastPromise) { promise = new Promise(wrapForNext(lastPromise, this)); } else { // fast path needed to support multiple this.push() // without triggering the next() queue var data = this[kStream].read(); if (data !== null) { return Promise.resolve(createIterResult(data, false)); } promise = new Promise(this[kHandlePromise]); } this[kLastPromise] = promise; return promise; } }, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () { return this; }), _defineProperty(_Object$setPrototypeO, "return", function _return() { var _this2 = this; // destroy(err, cb) is a private API // we can guarantee we have that here, because we control the // Readable class this is attached to return new Promise(function (resolve, reject) { _this2[kStream].destroy(null, function (err) { if (err) { reject(err); return; } resolve(createIterResult(undefined, true)); }); }); }), _Object$setPrototypeO), AsyncIteratorPrototype); var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) { var _Object$create; var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { value: stream, writable: true }), _defineProperty(_Object$create, kLastResolve, { value: null, writable: true }), _defineProperty(_Object$create, kLastReject, { value: null, writable: true }), _defineProperty(_Object$create, kError, { value: null, writable: true }), _defineProperty(_Object$create, kEnded, { value: stream._readableState.endEmitted, writable: true }), _defineProperty(_Object$create, kHandlePromise, { value: function value(resolve, reject) { var data = iterator[kStream].read(); if (data) { iterator[kLastPromise] = null; iterator[kLastResolve] = null; iterator[kLastReject] = null; resolve(createIterResult(data, false)); } else { iterator[kLastResolve] = resolve; iterator[kLastReject] = reject; } }, writable: true }), _Object$create)); iterator[kLastPromise] = null; finished(stream, function (err) { if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') { var reject = iterator[kLastReject]; // reject if we are waiting for data in the Promise // returned by next() and store the error if (reject !== null) { iterator[kLastPromise] = null; iterator[kLastResolve] = null; iterator[kLastReject] = null; reject(err); } iterator[kError] = err; return; } var resolve = iterator[kLastResolve]; if (resolve !== null) { iterator[kLastPromise] = null; iterator[kLastResolve] = null; iterator[kLastReject] = null; resolve(createIterResult(undefined, true)); } iterator[kEnded] = true; }); stream.on('readable', onReadable.bind(null, iterator)); return iterator; }; module.exports = createReadableStreamAsyncIterator;'use strict'; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } var _require = require('buffer'), Buffer = _require.Buffer; var _require2 = require('util'), inspect = _require2.inspect; var custom = inspect && inspect.custom || 'inspect'; function copyBuffer(src, target, offset) { Buffer.prototype.copy.call(src, target, offset); } module.exports = /*#__PURE__*/ function () { function BufferList() { _classCallCheck(this, BufferList); this.head = null; this.tail = null; this.length = 0; } _createClass(BufferList, [{ key: "push", value: function push(v) { var entry = { data: v, next: null }; if (this.length > 0) this.tail.next = entry;else this.head = entry; this.tail = entry; ++this.length; } }, { key: "unshift", value: function unshift(v) { var entry = { data: v, next: this.head }; if (this.length === 0) this.tail = entry; this.head = entry; ++this.length; } }, { key: "shift", value: function shift() { if (this.length === 0) return; var ret = this.head.data; if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; --this.length; return ret; } }, { key: "clear", value: function clear() { this.head = this.tail = null; this.length = 0; } }, { key: "join", value: function join(s) { if (this.length === 0) return ''; var p = this.head; var ret = '' + p.data; while (p = p.next) { ret += s + p.data; } return ret; } }, { key: "concat", value: function concat(n) { if (this.length === 0) return Buffer.alloc(0); var ret = Buffer.allocUnsafe(n >>> 0); var p = this.head; var i = 0; while (p) { copyBuffer(p.data, ret, i); i += p.data.length; p = p.next; } return ret; } // Consumes a specified amount of bytes or characters from the buffered data. }, { key: "consume", value: function consume(n, hasStrings) { var ret; if (n < this.head.data.length) { // `slice` is the same for buffers and strings. ret = this.head.data.slice(0, n); this.head.data = this.head.data.slice(n); } else if (n === this.head.data.length) { // First chunk is a perfect match. ret = this.shift(); } else { // Result spans more than one buffer. ret = hasStrings ? this._getString(n) : this._getBuffer(n); } return ret; } }, { key: "first", value: function first() { return this.head.data; } // Consumes a specified amount of characters from the buffered data. }, { key: "_getString", value: function _getString(n) { var p = this.head; var c = 1; var ret = p.data; n -= ret.length; while (p = p.next) { var str = p.data; var nb = n > str.length ? str.length : n; if (nb === str.length) ret += str;else ret += str.slice(0, n); n -= nb; if (n === 0) { if (nb === str.length) { ++c; if (p.next) this.head = p.next;else this.head = this.tail = null; } else { this.head = p; p.data = str.slice(nb); } break; } ++c; } this.length -= c; return ret; } // Consumes a specified amount of bytes from the buffered data. }, { key: "_getBuffer", value: function _getBuffer(n) { var ret = Buffer.allocUnsafe(n); var p = this.head; var c = 1; p.data.copy(ret); n -= p.data.length; while (p = p.next) { var buf = p.data; var nb = n > buf.length ? buf.length : n; buf.copy(ret, ret.length - n, 0, nb); n -= nb; if (n === 0) { if (nb === buf.length) { ++c; if (p.next) this.head = p.next;else this.head = this.tail = null; } else { this.head = p; p.data = buf.slice(nb); } break; } ++c; } this.length -= c; return ret; } // Make sure the linked list only shows the minimal necessary information. }, { key: custom, value: function value(_, options) { return inspect(this, _objectSpread({}, options, { // Only inspect one level. depth: 0, // It should not recurse. customInspect: false })); } }]); return BufferList; }();'use strict'; // undocumented cb() API, needed for core, not for public API function destroy(err, cb) { var _this = this; var readableDestroyed = this._readableState && this._readableState.destroyed; var writableDestroyed = this._writableState && this._writableState.destroyed; if (readableDestroyed || writableDestroyed) { if (cb) { cb(err); } else if (err) { if (!this._writableState) { process.nextTick(emitErrorNT, this, err); } else if (!this._writableState.errorEmitted) { this._writableState.errorEmitted = true; process.nextTick(emitErrorNT, this, err); } } return this; } // we set destroyed to true before firing error callbacks in order // to make it re-entrance safe in case destroy() is called within callbacks if (this._readableState) { this._readableState.destroyed = true; } // if this is a duplex stream mark the writable part as destroyed as well if (this._writableState) { this._writableState.destroyed = true; } this._destroy(err || null, function (err) { if (!cb && err) { if (!_this._writableState) { process.nextTick(emitErrorAndCloseNT, _this, err); } else if (!_this._writableState.errorEmitted) { _this._writableState.errorEmitted = true; process.nextTick(emitErrorAndCloseNT, _this, err); } else { process.nextTick(emitCloseNT, _this); } } else if (cb) { process.nextTick(emitCloseNT, _this); cb(err); } else { process.nextTick(emitCloseNT, _this); } }); return this; } function emitErrorAndCloseNT(self, err) { emitErrorNT(self, err); emitCloseNT(self); } function emitCloseNT(self) { if (self._writableState && !self._writableState.emitClose) return; if (self._readableState && !self._readableState.emitClose) return; self.emit('close'); } function undestroy() { if (this._readableState) { this._readableState.destroyed = false; this._readableState.reading = false; this._readableState.ended = false; this._readableState.endEmitted = false; } if (this._writableState) { this._writableState.destroyed = false; this._writableState.ended = false; this._writableState.ending = false; this._writableState.finalCalled = false; this._writableState.prefinished = false; this._writableState.finished = false; this._writableState.errorEmitted = false; } } function emitErrorNT(self, err) { self.emit('error', err); } function errorOrDestroy(stream, err) { // We have tests that rely on errors being emitted // in the same tick, so changing this is semver major. // For now when you opt-in to autoDestroy we allow // the error to be emitted nextTick. In a future // semver major update we should change the default to this. var rState = stream._readableState; var wState = stream._writableState; if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err); } module.exports = { destroy: destroy, undestroy: undestroy, errorOrDestroy: errorOrDestroy };// Ported from https://github.com/mafintosh/end-of-stream with // permission from the author, Mathias Buus (@mafintosh). 'use strict'; var ERR_STREAM_PREMATURE_CLOSE = require('../../../errors').codes.ERR_STREAM_PREMATURE_CLOSE; function once(callback) { var called = false; return function () { if (called) return; called = true; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } callback.apply(this, args); }; } function noop() {} function isRequest(stream) { return stream.setHeader && typeof stream.abort === 'function'; } function eos(stream, opts, callback) { if (typeof opts === 'function') return eos(stream, null, opts); if (!opts) opts = {}; callback = once(callback || noop); var readable = opts.readable || opts.readable !== false && stream.readable; var writable = opts.writable || opts.writable !== false && stream.writable; var onlegacyfinish = function onlegacyfinish() { if (!stream.writable) onfinish(); }; var writableEnded = stream._writableState && stream._writableState.finished; var onfinish = function onfinish() { writable = false; writableEnded = true; if (!readable) callback.call(stream); }; var readableEnded = stream._readableState && stream._readableState.endEmitted; var onend = function onend() { readable = false; readableEnded = true; if (!writable) callback.call(stream); }; var onerror = function onerror(err) { callback.call(stream, err); }; var onclose = function onclose() { var err; if (readable && !readableEnded) { if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); return callback.call(stream, err); } if (writable && !writableEnded) { if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); return callback.call(stream, err); } }; var onrequest = function onrequest() { stream.req.on('finish', onfinish); }; if (isRequest(stream)) { stream.on('complete', onfinish); stream.on('abort', onclose); if (stream.req) onrequest();else stream.on('request', onrequest); } else if (writable && !stream._writableState) { // legacy streams stream.on('end', onlegacyfinish); stream.on('close', onlegacyfinish); } stream.on('end', onend); stream.on('finish', onfinish); if (opts.error !== false) stream.on('error', onerror); stream.on('close', onclose); return function () { stream.removeListener('complete', onfinish); stream.removeListener('abort', onclose); stream.removeListener('request', onrequest); if (stream.req) stream.req.removeListener('finish', onfinish); stream.removeListener('end', onlegacyfinish); stream.removeListener('close', onlegacyfinish); stream.removeListener('finish', onfinish); stream.removeListener('end', onend); stream.removeListener('error', onerror); stream.removeListener('close', onclose); }; } module.exports = eos;module.exports = function () { throw new Error('Readable.from is not available in the browser') }; 'use strict'; function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var ERR_INVALID_ARG_TYPE = require('../../../errors').codes.ERR_INVALID_ARG_TYPE; function from(Readable, iterable, opts) { var iterator; if (iterable && typeof iterable.next === 'function') { iterator = iterable; } else if (iterable && iterable[Symbol.asyncIterator]) iterator = iterable[Symbol.asyncIterator]();else if (iterable && iterable[Symbol.iterator]) iterator = iterable[Symbol.iterator]();else throw new ERR_INVALID_ARG_TYPE('iterable', ['Iterable'], iterable); var readable = new Readable(_objectSpread({ objectMode: true }, opts)); // Reading boolean to protect against _read // being called before last iteration completion. var reading = false; readable._read = function () { if (!reading) { reading = true; next(); } }; function next() { return _next2.apply(this, arguments); } function _next2() { _next2 = _asyncToGenerator(function* () { try { var _ref = yield iterator.next(), value = _ref.value, done = _ref.done; if (done) { readable.push(null); } else if (readable.push((yield value))) { next(); } else { reading = false; } } catch (err) { readable.destroy(err); } }); return _next2.apply(this, arguments); } return readable; } module.exports = from;// Ported from https://github.com/mafintosh/pump with // permission from the author, Mathias Buus (@mafintosh). 'use strict'; var eos; function once(callback) { var called = false; return function () { if (called) return; called = true; callback.apply(void 0, arguments); }; } var _require$codes = require('../../../errors').codes, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; function noop(err) { // Rethrow the error if it exists to avoid swallowing it if (err) throw err; } function isRequest(stream) { return stream.setHeader && typeof stream.abort === 'function'; } function destroyer(stream, reading, writing, callback) { callback = once(callback); var closed = false; stream.on('close', function () { closed = true; }); if (eos === undefined) eos = require('./end-of-stream'); eos(stream, { readable: reading, writable: writing }, function (err) { if (err) return callback(err); closed = true; callback(); }); var destroyed = false; return function (err) { if (closed) return; if (destroyed) return; destroyed = true; // request.destroy just do .end - .abort is what we want if (isRequest(stream)) return stream.abort(); if (typeof stream.destroy === 'function') return stream.destroy(); callback(err || new ERR_STREAM_DESTROYED('pipe')); }; } function call(fn) { fn(); } function pipe(from, to) { return from.pipe(to); } function popCallback(streams) { if (!streams.length) return noop; if (typeof streams[streams.length - 1] !== 'function') return noop; return streams.pop(); } function pipeline() { for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { streams[_key] = arguments[_key]; } var callback = popCallback(streams); if (Array.isArray(streams[0])) streams = streams[0]; if (streams.length < 2) { throw new ERR_MISSING_ARGS('streams'); } var error; var destroys = streams.map(function (stream, i) { var reading = i < streams.length - 1; var writing = i > 0; return destroyer(stream, reading, writing, function (err) { if (!error) error = err; if (err) destroys.forEach(call); if (reading) return; destroys.forEach(call); callback(error); }); }); return streams.reduce(pipe); } module.exports = pipeline;'use strict'; var ERR_INVALID_OPT_VALUE = require('../../../errors').codes.ERR_INVALID_OPT_VALUE; function highWaterMarkFrom(options, isDuplex, duplexKey) { return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; } function getHighWaterMark(state, options, duplexKey, isDuplex) { var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); if (hwm != null) { if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { var name = isDuplex ? duplexKey : 'highWaterMark'; throw new ERR_INVALID_OPT_VALUE(name, hwm); } return Math.floor(hwm); } // Default value return state.objectMode ? 16 : 16 * 1024; } module.exports = { getHighWaterMark: getHighWaterMark };module.exports = require('events').EventEmitter; module.exports = require('stream'); 'use strict' // high-level commands exports.c = exports.create = require('./lib/create.js') exports.r = exports.replace = require('./lib/replace.js') exports.t = exports.list = require('./lib/list.js') exports.u = exports.update = require('./lib/update.js') exports.x = exports.extract = require('./lib/extract.js') // classes exports.Pack = require('./lib/pack.js') exports.Unpack = require('./lib/unpack.js') exports.Parse = require('./lib/parse.js') exports.ReadEntry = require('./lib/read-entry.js') exports.WriteEntry = require('./lib/write-entry.js') exports.Header = require('./lib/header.js') exports.Pax = require('./lib/pax.js') exports.types = require('./lib/types.js') The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "name": "tar", "description": "tar for node", "version": "6.1.11", "repository": { "type": "git", "url": "https://github.com/npm/node-tar.git" }, "scripts": { "test:posix": "tap", "test:win32": "tap --lines=98 --branches=98 --statements=98 --functions=98", "test": "node test/fixtures/test.js", "posttest": "npm run lint", "eslint": "eslint", "lint": "npm run eslint -- test lib", "lintfix": "npm run lint -- --fix", "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", "genparse": "node scripts/generate-parse-fixtures.js", "bench": "for i in benchmarks/*/*.js; do echo $i; for j in {1..5}; do node $i || break; done; done" }, "dependencies": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", "minipass": "^3.0.0", "minizlib": "^2.1.1", "mkdirp": "^1.0.3", "yallist": "^4.0.0" }, "devDependencies": { "chmodr": "^1.2.0", "end-of-stream": "^1.4.3", "eslint": "^7.17.0", "eslint-plugin-import": "^2.22.1", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.2.1", "eslint-plugin-standard": "^5.0.0", "events-to-array": "^1.1.2", "mutate-fs": "^2.1.1", "rimraf": "^2.7.1", "tap": "^15.0.9", "tar-fs": "^1.16.3", "tar-stream": "^1.6.2" }, "license": "ISC", "engines": { "node": ">= 10" }, "files": [ "index.js", "lib/*.js" ], "tap": { "coverage-map": "map.js", "check-coverage": true } } 'use strict' // tar -c const hlo = require('./high-level-opt.js') const Pack = require('./pack.js') const fsm = require('fs-minipass') const t = require('./list.js') const path = require('path') module.exports = (opt_, files, cb) => { if (typeof files === 'function') cb = files if (Array.isArray(opt_)) files = opt_, opt_ = {} if (!files || !Array.isArray(files) || !files.length) throw new TypeError('no files or directories specified') files = Array.from(files) const opt = hlo(opt_) if (opt.sync && typeof cb === 'function') throw new TypeError('callback not supported for sync tar functions') if (!opt.file && typeof cb === 'function') throw new TypeError('callback only supported with file option') return opt.file && opt.sync ? createFileSync(opt, files) : opt.file ? createFile(opt, files, cb) : opt.sync ? createSync(opt, files) : create(opt, files) } const createFileSync = (opt, files) => { const p = new Pack.Sync(opt) const stream = new fsm.WriteStreamSync(opt.file, { mode: opt.mode || 0o666, }) p.pipe(stream) addFilesSync(p, files) } const createFile = (opt, files, cb) => { const p = new Pack(opt) const stream = new fsm.WriteStream(opt.file, { mode: opt.mode || 0o666, }) p.pipe(stream) const promise = new Promise((res, rej) => { stream.on('error', rej) stream.on('close', res) p.on('error', rej) }) addFilesAsync(p, files) return cb ? promise.then(cb, cb) : promise } const addFilesSync = (p, files) => { files.forEach(file => { if (file.charAt(0) === '@') { t({ file: path.resolve(p.cwd, file.substr(1)), sync: true, noResume: true, onentry: entry => p.add(entry), }) } else p.add(file) }) p.end() } const addFilesAsync = (p, files) => { while (files.length) { const file = files.shift() if (file.charAt(0) === '@') { return t({ file: path.resolve(p.cwd, file.substr(1)), noResume: true, onentry: entry => p.add(entry), }).then(_ => addFilesAsync(p, files)) } else p.add(file) } p.end() } const createSync = (opt, files) => { const p = new Pack.Sync(opt) addFilesSync(p, files) return p } const create = (opt, files) => { const p = new Pack(opt) addFilesAsync(p, files) return p } 'use strict' // tar -x const hlo = require('./high-level-opt.js') const Unpack = require('./unpack.js') const fs = require('fs') const fsm = require('fs-minipass') const path = require('path') const stripSlash = require('./strip-trailing-slashes.js') module.exports = (opt_, files, cb) => { if (typeof opt_ === 'function') cb = opt_, files = null, opt_ = {} else if (Array.isArray(opt_)) files = opt_, opt_ = {} if (typeof files === 'function') cb = files, files = null if (!files) files = [] else files = Array.from(files) const opt = hlo(opt_) if (opt.sync && typeof cb === 'function') throw new TypeError('callback not supported for sync tar functions') if (!opt.file && typeof cb === 'function') throw new TypeError('callback only supported with file option') if (files.length) filesFilter(opt, files) return opt.file && opt.sync ? extractFileSync(opt) : opt.file ? extractFile(opt, cb) : opt.sync ? extractSync(opt) : extract(opt) } // construct a filter that limits the file entries listed // include child entries if a dir is included const filesFilter = (opt, files) => { const map = new Map(files.map(f => [stripSlash(f), true])) const filter = opt.filter const mapHas = (file, r) => { const root = r || path.parse(file).root || '.' const ret = file === root ? false : map.has(file) ? map.get(file) : mapHas(path.dirname(file), root) map.set(file, ret) return ret } opt.filter = filter ? (file, entry) => filter(file, entry) && mapHas(stripSlash(file)) : file => mapHas(stripSlash(file)) } const extractFileSync = opt => { const u = new Unpack.Sync(opt) const file = opt.file const stat = fs.statSync(file) // This trades a zero-byte read() syscall for a stat // However, it will usually result in less memory allocation const readSize = opt.maxReadSize || 16 * 1024 * 1024 const stream = new fsm.ReadStreamSync(file, { readSize: readSize, size: stat.size, }) stream.pipe(u) } const extractFile = (opt, cb) => { const u = new Unpack(opt) const readSize = opt.maxReadSize || 16 * 1024 * 1024 const file = opt.file const p = new Promise((resolve, reject) => { u.on('error', reject) u.on('close', resolve) // This trades a zero-byte read() syscall for a stat // However, it will usually result in less memory allocation fs.stat(file, (er, stat) => { if (er) reject(er) else { const stream = new fsm.ReadStream(file, { readSize: readSize, size: stat.size, }) stream.on('error', reject) stream.pipe(u) } }) }) return cb ? p.then(cb, cb) : p } const extractSync = opt => new Unpack.Sync(opt) const extract = opt => new Unpack(opt) // Get the appropriate flag to use for creating files // We use fmap on Windows platforms for files less than // 512kb. This is a fairly low limit, but avoids making // things slower in some cases. Since most of what this // library is used for is extracting tarballs of many // relatively small files in npm packages and the like, // it can be a big boost on Windows platforms. // Only supported in Node v12.9.0 and above. const platform = process.env.__FAKE_PLATFORM__ || process.platform const isWindows = platform === 'win32' const fs = global.__FAKE_TESTING_FS__ || require('fs') /* istanbul ignore next */ const { O_CREAT, O_TRUNC, O_WRONLY, UV_FS_O_FILEMAP = 0 } = fs.constants const fMapEnabled = isWindows && !!UV_FS_O_FILEMAP const fMapLimit = 512 * 1024 const fMapFlag = UV_FS_O_FILEMAP | O_TRUNC | O_CREAT | O_WRONLY module.exports = !fMapEnabled ? () => 'w' : size => size < fMapLimit ? fMapFlag : 'w' 'use strict' // parse a 512-byte header block to a data object, or vice-versa // encode returns `true` if a pax extended header is needed, because // the data could not be faithfully encoded in a simple header. // (Also, check header.needPax to see if it needs a pax header.) const types = require('./types.js') const pathModule = require('path').posix const large = require('./large-numbers.js') const SLURP = Symbol('slurp') const TYPE = Symbol('type') class Header { constructor (data, off, ex, gex) { this.cksumValid = false this.needPax = false this.nullBlock = false this.block = null this.path = null this.mode = null this.uid = null this.gid = null this.size = null this.mtime = null this.cksum = null this[TYPE] = '0' this.linkpath = null this.uname = null this.gname = null this.devmaj = 0 this.devmin = 0 this.atime = null this.ctime = null if (Buffer.isBuffer(data)) this.decode(data, off || 0, ex, gex) else if (data) this.set(data) } decode (buf, off, ex, gex) { if (!off) off = 0 if (!buf || !(buf.length >= off + 512)) throw new Error('need 512 bytes for header') this.path = decString(buf, off, 100) this.mode = decNumber(buf, off + 100, 8) this.uid = decNumber(buf, off + 108, 8) this.gid = decNumber(buf, off + 116, 8) this.size = decNumber(buf, off + 124, 12) this.mtime = decDate(buf, off + 136, 12) this.cksum = decNumber(buf, off + 148, 12) // if we have extended or global extended headers, apply them now // See https://github.com/npm/node-tar/pull/187 this[SLURP](ex) this[SLURP](gex, true) // old tar versions marked dirs as a file with a trailing / this[TYPE] = decString(buf, off + 156, 1) if (this[TYPE] === '') this[TYPE] = '0' if (this[TYPE] === '0' && this.path.substr(-1) === '/') this[TYPE] = '5' // tar implementations sometimes incorrectly put the stat(dir).size // as the size in the tarball, even though Directory entries are // not able to have any body at all. In the very rare chance that // it actually DOES have a body, we weren't going to do anything with // it anyway, and it'll just be a warning about an invalid header. if (this[TYPE] === '5') this.size = 0 this.linkpath = decString(buf, off + 157, 100) if (buf.slice(off + 257, off + 265).toString() === 'ustar\u000000') { this.uname = decString(buf, off + 265, 32) this.gname = decString(buf, off + 297, 32) this.devmaj = decNumber(buf, off + 329, 8) this.devmin = decNumber(buf, off + 337, 8) if (buf[off + 475] !== 0) { // definitely a prefix, definitely >130 chars. const prefix = decString(buf, off + 345, 155) this.path = prefix + '/' + this.path } else { const prefix = decString(buf, off + 345, 130) if (prefix) this.path = prefix + '/' + this.path this.atime = decDate(buf, off + 476, 12) this.ctime = decDate(buf, off + 488, 12) } } let sum = 8 * 0x20 for (let i = off; i < off + 148; i++) sum += buf[i] for (let i = off + 156; i < off + 512; i++) sum += buf[i] this.cksumValid = sum === this.cksum if (this.cksum === null && sum === 8 * 0x20) this.nullBlock = true } [SLURP] (ex, global) { for (const k in ex) { // we slurp in everything except for the path attribute in // a global extended header, because that's weird. if (ex[k] !== null && ex[k] !== undefined && !(global && k === 'path')) this[k] = ex[k] } } encode (buf, off) { if (!buf) { buf = this.block = Buffer.alloc(512) off = 0 } if (!off) off = 0 if (!(buf.length >= off + 512)) throw new Error('need 512 bytes for header') const prefixSize = this.ctime || this.atime ? 130 : 155 const split = splitPrefix(this.path || '', prefixSize) const path = split[0] const prefix = split[1] this.needPax = split[2] this.needPax = encString(buf, off, 100, path) || this.needPax this.needPax = encNumber(buf, off + 100, 8, this.mode) || this.needPax this.needPax = encNumber(buf, off + 108, 8, this.uid) || this.needPax this.needPax = encNumber(buf, off + 116, 8, this.gid) || this.needPax this.needPax = encNumber(buf, off + 124, 12, this.size) || this.needPax this.needPax = encDate(buf, off + 136, 12, this.mtime) || this.needPax buf[off + 156] = this[TYPE].charCodeAt(0) this.needPax = encString(buf, off + 157, 100, this.linkpath) || this.needPax buf.write('ustar\u000000', off + 257, 8) this.needPax = encString(buf, off + 265, 32, this.uname) || this.needPax this.needPax = encString(buf, off + 297, 32, this.gname) || this.needPax this.needPax = encNumber(buf, off + 329, 8, this.devmaj) || this.needPax this.needPax = encNumber(buf, off + 337, 8, this.devmin) || this.needPax this.needPax = encString(buf, off + 345, prefixSize, prefix) || this.needPax if (buf[off + 475] !== 0) this.needPax = encString(buf, off + 345, 155, prefix) || this.needPax else { this.needPax = encString(buf, off + 345, 130, prefix) || this.needPax this.needPax = encDate(buf, off + 476, 12, this.atime) || this.needPax this.needPax = encDate(buf, off + 488, 12, this.ctime) || this.needPax } let sum = 8 * 0x20 for (let i = off; i < off + 148; i++) sum += buf[i] for (let i = off + 156; i < off + 512; i++) sum += buf[i] this.cksum = sum encNumber(buf, off + 148, 8, this.cksum) this.cksumValid = true return this.needPax } set (data) { for (const i in data) { if (data[i] !== null && data[i] !== undefined) this[i] = data[i] } } get type () { return types.name.get(this[TYPE]) || this[TYPE] } get typeKey () { return this[TYPE] } set type (type) { if (types.code.has(type)) this[TYPE] = types.code.get(type) else this[TYPE] = type } } const splitPrefix = (p, prefixSize) => { const pathSize = 100 let pp = p let prefix = '' let ret const root = pathModule.parse(p).root || '.' if (Buffer.byteLength(pp) < pathSize) ret = [pp, prefix, false] else { // first set prefix to the dir, and path to the base prefix = pathModule.dirname(pp) pp = pathModule.basename(pp) do { // both fit! if (Buffer.byteLength(pp) <= pathSize && Buffer.byteLength(prefix) <= prefixSize) ret = [pp, prefix, false] // prefix fits in prefix, but path doesn't fit in path else if (Buffer.byteLength(pp) > pathSize && Buffer.byteLength(prefix) <= prefixSize) ret = [pp.substr(0, pathSize - 1), prefix, true] else { // make path take a bit from prefix pp = pathModule.join(pathModule.basename(prefix), pp) prefix = pathModule.dirname(prefix) } } while (prefix !== root && !ret) // at this point, found no resolution, just truncate if (!ret) ret = [p.substr(0, pathSize - 1), '', true] } return ret } const decString = (buf, off, size) => buf.slice(off, off + size).toString('utf8').replace(/\0.*/, '') const decDate = (buf, off, size) => numToDate(decNumber(buf, off, size)) const numToDate = num => num === null ? null : new Date(num * 1000) const decNumber = (buf, off, size) => buf[off] & 0x80 ? large.parse(buf.slice(off, off + size)) : decSmallNumber(buf, off, size) const nanNull = value => isNaN(value) ? null : value const decSmallNumber = (buf, off, size) => nanNull(parseInt( buf.slice(off, off + size) .toString('utf8').replace(/\0.*$/, '').trim(), 8)) // the maximum encodable as a null-terminated octal, by field size const MAXNUM = { 12: 0o77777777777, 8: 0o7777777, } const encNumber = (buf, off, size, number) => number === null ? false : number > MAXNUM[size] || number < 0 ? (large.encode(number, buf.slice(off, off + size)), true) : (encSmallNumber(buf, off, size, number), false) const encSmallNumber = (buf, off, size, number) => buf.write(octalString(number, size), off, size, 'ascii') const octalString = (number, size) => padOctal(Math.floor(number).toString(8), size) const padOctal = (string, size) => (string.length === size - 1 ? string : new Array(size - string.length - 1).join('0') + string + ' ') + '\0' const encDate = (buf, off, size, date) => date === null ? false : encNumber(buf, off, size, date.getTime() / 1000) // enough to fill the longest string we've got const NULLS = new Array(156).join('\0') // pad with nulls, return true if it's longer or non-ascii const encString = (buf, off, size, string) => string === null ? false : (buf.write(string + NULLS, off, size, 'utf8'), string.length !== Buffer.byteLength(string) || string.length > size) module.exports = Header 'use strict' // turn tar(1) style args like `C` into the more verbose things like `cwd` const argmap = new Map([ ['C', 'cwd'], ['f', 'file'], ['z', 'gzip'], ['P', 'preservePaths'], ['U', 'unlink'], ['strip-components', 'strip'], ['stripComponents', 'strip'], ['keep-newer', 'newer'], ['keepNewer', 'newer'], ['keep-newer-files', 'newer'], ['keepNewerFiles', 'newer'], ['k', 'keep'], ['keep-existing', 'keep'], ['keepExisting', 'keep'], ['m', 'noMtime'], ['no-mtime', 'noMtime'], ['p', 'preserveOwner'], ['L', 'follow'], ['h', 'follow'], ]) module.exports = opt => opt ? Object.keys(opt).map(k => [ argmap.has(k) ? argmap.get(k) : k, opt[k], ]).reduce((set, kv) => (set[kv[0]] = kv[1], set), Object.create(null)) : {} 'use strict' // Tar can encode large and negative numbers using a leading byte of // 0xff for negative, and 0x80 for positive. const encode = (num, buf) => { if (!Number.isSafeInteger(num)) // The number is so large that javascript cannot represent it with integer // precision. throw Error('cannot encode number outside of javascript safe integer range') else if (num < 0) encodeNegative(num, buf) else encodePositive(num, buf) return buf } const encodePositive = (num, buf) => { buf[0] = 0x80 for (var i = buf.length; i > 1; i--) { buf[i - 1] = num & 0xff num = Math.floor(num / 0x100) } } const encodeNegative = (num, buf) => { buf[0] = 0xff var flipped = false num = num * -1 for (var i = buf.length; i > 1; i--) { var byte = num & 0xff num = Math.floor(num / 0x100) if (flipped) buf[i - 1] = onesComp(byte) else if (byte === 0) buf[i - 1] = 0 else { flipped = true buf[i - 1] = twosComp(byte) } } } const parse = (buf) => { const pre = buf[0] const value = pre === 0x80 ? pos(buf.slice(1, buf.length)) : pre === 0xff ? twos(buf) : null if (value === null) throw Error('invalid base256 encoding') if (!Number.isSafeInteger(value)) // The number is so large that javascript cannot represent it with integer // precision. throw Error('parsed number outside of javascript safe integer range') return value } const twos = (buf) => { var len = buf.length var sum = 0 var flipped = false for (var i = len - 1; i > -1; i--) { var byte = buf[i] var f if (flipped) f = onesComp(byte) else if (byte === 0) f = byte else { flipped = true f = twosComp(byte) } if (f !== 0) sum -= f * Math.pow(256, len - i - 1) } return sum } const pos = (buf) => { var len = buf.length var sum = 0 for (var i = len - 1; i > -1; i--) { var byte = buf[i] if (byte !== 0) sum += byte * Math.pow(256, len - i - 1) } return sum } const onesComp = byte => (0xff ^ byte) & 0xff const twosComp = byte => ((0xff ^ byte) + 1) & 0xff module.exports = { encode, parse, } 'use strict' // XXX: This shares a lot in common with extract.js // maybe some DRY opportunity here? // tar -t const hlo = require('./high-level-opt.js') const Parser = require('./parse.js') const fs = require('fs') const fsm = require('fs-minipass') const path = require('path') const stripSlash = require('./strip-trailing-slashes.js') module.exports = (opt_, files, cb) => { if (typeof opt_ === 'function') cb = opt_, files = null, opt_ = {} else if (Array.isArray(opt_)) files = opt_, opt_ = {} if (typeof files === 'function') cb = files, files = null if (!files) files = [] else files = Array.from(files) const opt = hlo(opt_) if (opt.sync && typeof cb === 'function') throw new TypeError('callback not supported for sync tar functions') if (!opt.file && typeof cb === 'function') throw new TypeError('callback only supported with file option') if (files.length) filesFilter(opt, files) if (!opt.noResume) onentryFunction(opt) return opt.file && opt.sync ? listFileSync(opt) : opt.file ? listFile(opt, cb) : list(opt) } const onentryFunction = opt => { const onentry = opt.onentry opt.onentry = onentry ? e => { onentry(e) e.resume() } : e => e.resume() } // construct a filter that limits the file entries listed // include child entries if a dir is included const filesFilter = (opt, files) => { const map = new Map(files.map(f => [stripSlash(f), true])) const filter = opt.filter const mapHas = (file, r) => { const root = r || path.parse(file).root || '.' const ret = file === root ? false : map.has(file) ? map.get(file) : mapHas(path.dirname(file), root) map.set(file, ret) return ret } opt.filter = filter ? (file, entry) => filter(file, entry) && mapHas(stripSlash(file)) : file => mapHas(stripSlash(file)) } const listFileSync = opt => { const p = list(opt) const file = opt.file let threw = true let fd try { const stat = fs.statSync(file) const readSize = opt.maxReadSize || 16 * 1024 * 1024 if (stat.size < readSize) p.end(fs.readFileSync(file)) else { let pos = 0 const buf = Buffer.allocUnsafe(readSize) fd = fs.openSync(file, 'r') while (pos < stat.size) { const bytesRead = fs.readSync(fd, buf, 0, readSize, pos) pos += bytesRead p.write(buf.slice(0, bytesRead)) } p.end() } threw = false } finally { if (threw && fd) { try { fs.closeSync(fd) } catch (er) {} } } } const listFile = (opt, cb) => { const parse = new Parser(opt) const readSize = opt.maxReadSize || 16 * 1024 * 1024 const file = opt.file const p = new Promise((resolve, reject) => { parse.on('error', reject) parse.on('end', resolve) fs.stat(file, (er, stat) => { if (er) reject(er) else { const stream = new fsm.ReadStream(file, { readSize: readSize, size: stat.size, }) stream.on('error', reject) stream.pipe(parse) } }) }) return cb ? p.then(cb, cb) : p } const list = opt => new Parser(opt) 'use strict' // wrapper around mkdirp for tar's needs. // TODO: This should probably be a class, not functionally // passing around state in a gazillion args. const mkdirp = require('mkdirp') const fs = require('fs') const path = require('path') const chownr = require('chownr') const normPath = require('./normalize-windows-path.js') class SymlinkError extends Error { constructor (symlink, path) { super('Cannot extract through symbolic link') this.path = path this.symlink = symlink } get name () { return 'SylinkError' } } class CwdError extends Error { constructor (path, code) { super(code + ': Cannot cd into \'' + path + '\'') this.path = path this.code = code } get name () { return 'CwdError' } } const cGet = (cache, key) => cache.get(normPath(key)) const cSet = (cache, key, val) => cache.set(normPath(key), val) const checkCwd = (dir, cb) => { fs.stat(dir, (er, st) => { if (er || !st.isDirectory()) er = new CwdError(dir, er && er.code || 'ENOTDIR') cb(er) }) } module.exports = (dir, opt, cb) => { dir = normPath(dir) // if there's any overlap between mask and mode, // then we'll need an explicit chmod const umask = opt.umask const mode = opt.mode | 0o0700 const needChmod = (mode & umask) !== 0 const uid = opt.uid const gid = opt.gid const doChown = typeof uid === 'number' && typeof gid === 'number' && (uid !== opt.processUid || gid !== opt.processGid) const preserve = opt.preserve const unlink = opt.unlink const cache = opt.cache const cwd = normPath(opt.cwd) const done = (er, created) => { if (er) cb(er) else { cSet(cache, dir, true) if (created && doChown) chownr(created, uid, gid, er => done(er)) else if (needChmod) fs.chmod(dir, mode, cb) else cb() } } if (cache && cGet(cache, dir) === true) return done() if (dir === cwd) return checkCwd(dir, done) if (preserve) return mkdirp(dir, {mode}).then(made => done(null, made), done) const sub = normPath(path.relative(cwd, dir)) const parts = sub.split('/') mkdir_(cwd, parts, mode, cache, unlink, cwd, null, done) } const mkdir_ = (base, parts, mode, cache, unlink, cwd, created, cb) => { if (!parts.length) return cb(null, created) const p = parts.shift() const part = normPath(path.resolve(base + '/' + p)) if (cGet(cache, part)) return mkdir_(part, parts, mode, cache, unlink, cwd, created, cb) fs.mkdir(part, mode, onmkdir(part, parts, mode, cache, unlink, cwd, created, cb)) } const onmkdir = (part, parts, mode, cache, unlink, cwd, created, cb) => er => { if (er) { fs.lstat(part, (statEr, st) => { if (statEr) { statEr.path = statEr.path && normPath(statEr.path) cb(statEr) } else if (st.isDirectory()) mkdir_(part, parts, mode, cache, unlink, cwd, created, cb) else if (unlink) { fs.unlink(part, er => { if (er) return cb(er) fs.mkdir(part, mode, onmkdir(part, parts, mode, cache, unlink, cwd, created, cb)) }) } else if (st.isSymbolicLink()) return cb(new SymlinkError(part, part + '/' + parts.join('/'))) else cb(er) }) } else { created = created || part mkdir_(part, parts, mode, cache, unlink, cwd, created, cb) } } const checkCwdSync = dir => { let ok = false let code = 'ENOTDIR' try { ok = fs.statSync(dir).isDirectory() } catch (er) { code = er.code } finally { if (!ok) throw new CwdError(dir, code) } } module.exports.sync = (dir, opt) => { dir = normPath(dir) // if there's any overlap between mask and mode, // then we'll need an explicit chmod const umask = opt.umask const mode = opt.mode | 0o0700 const needChmod = (mode & umask) !== 0 const uid = opt.uid const gid = opt.gid const doChown = typeof uid === 'number' && typeof gid === 'number' && (uid !== opt.processUid || gid !== opt.processGid) const preserve = opt.preserve const unlink = opt.unlink const cache = opt.cache const cwd = normPath(opt.cwd) const done = (created) => { cSet(cache, dir, true) if (created && doChown) chownr.sync(created, uid, gid) if (needChmod) fs.chmodSync(dir, mode) } if (cache && cGet(cache, dir) === true) return done() if (dir === cwd) { checkCwdSync(cwd) return done() } if (preserve) return done(mkdirp.sync(dir, mode)) const sub = normPath(path.relative(cwd, dir)) const parts = sub.split('/') let created = null for (let p = parts.shift(), part = cwd; p && (part += '/' + p); p = parts.shift()) { part = normPath(path.resolve(part)) if (cGet(cache, part)) continue try { fs.mkdirSync(part, mode) created = created || part cSet(cache, part, true) } catch (er) { const st = fs.lstatSync(part) if (st.isDirectory()) { cSet(cache, part, true) continue } else if (unlink) { fs.unlinkSync(part) fs.mkdirSync(part, mode) created = created || part cSet(cache, part, true) continue } else if (st.isSymbolicLink()) return new SymlinkError(part, part + '/' + parts.join('/')) } } return done(created) } 'use strict' module.exports = (mode, isDir, portable) => { mode &= 0o7777 // in portable mode, use the minimum reasonable umask // if this system creates files with 0o664 by default // (as some linux distros do), then we'll write the // archive with 0o644 instead. Also, don't ever create // a file that is not readable/writable by the owner. if (portable) mode = (mode | 0o600) & ~0o22 // if dirs are readable, then they should be listable if (isDir) { if (mode & 0o400) mode |= 0o100 if (mode & 0o40) mode |= 0o10 if (mode & 0o4) mode |= 0o1 } return mode } // warning: extremely hot code path. // This has been meticulously optimized for use // within npm install on large package trees. // Do not edit without careful benchmarking. const normalizeCache = Object.create(null) const {hasOwnProperty} = Object.prototype module.exports = s => { if (!hasOwnProperty.call(normalizeCache, s)) normalizeCache[s] = s.normalize('NFKD') return normalizeCache[s] } // on windows, either \ or / are valid directory separators. // on unix, \ is a valid character in filenames. // so, on windows, and only on windows, we replace all \ chars with /, // so that we can use / as our one and only directory separator char. const platform = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform module.exports = platform !== 'win32' ? p => p : p => p && p.replace(/\\/g, '/') 'use strict' // A readable tar stream creator // Technically, this is a transform stream that you write paths into, // and tar format comes out of. // The `add()` method is like `write()` but returns this, // and end() return `this` as well, so you can // do `new Pack(opt).add('files').add('dir').end().pipe(output) // You could also do something like: // streamOfPaths().pipe(new Pack()).pipe(new fs.WriteStream('out.tar')) class PackJob { constructor (path, absolute) { this.path = path || './' this.absolute = absolute this.entry = null this.stat = null this.readdir = null this.pending = false this.ignore = false this.piped = false } } const MiniPass = require('minipass') const zlib = require('minizlib') const ReadEntry = require('./read-entry.js') const WriteEntry = require('./write-entry.js') const WriteEntrySync = WriteEntry.Sync const WriteEntryTar = WriteEntry.Tar const Yallist = require('yallist') const EOF = Buffer.alloc(1024) const ONSTAT = Symbol('onStat') const ENDED = Symbol('ended') const QUEUE = Symbol('queue') const CURRENT = Symbol('current') const PROCESS = Symbol('process') const PROCESSING = Symbol('processing') const PROCESSJOB = Symbol('processJob') const JOBS = Symbol('jobs') const JOBDONE = Symbol('jobDone') const ADDFSENTRY = Symbol('addFSEntry') const ADDTARENTRY = Symbol('addTarEntry') const STAT = Symbol('stat') const READDIR = Symbol('readdir') const ONREADDIR = Symbol('onreaddir') const PIPE = Symbol('pipe') const ENTRY = Symbol('entry') const ENTRYOPT = Symbol('entryOpt') const WRITEENTRYCLASS = Symbol('writeEntryClass') const WRITE = Symbol('write') const ONDRAIN = Symbol('ondrain') const fs = require('fs') const path = require('path') const warner = require('./warn-mixin.js') const normPath = require('./normalize-windows-path.js') const Pack = warner(class Pack extends MiniPass { constructor (opt) { super(opt) opt = opt || Object.create(null) this.opt = opt this.file = opt.file || '' this.cwd = opt.cwd || process.cwd() this.maxReadSize = opt.maxReadSize this.preservePaths = !!opt.preservePaths this.strict = !!opt.strict this.noPax = !!opt.noPax this.prefix = normPath(opt.prefix || '') this.linkCache = opt.linkCache || new Map() this.statCache = opt.statCache || new Map() this.readdirCache = opt.readdirCache || new Map() this[WRITEENTRYCLASS] = WriteEntry if (typeof opt.onwarn === 'function') this.on('warn', opt.onwarn) this.portable = !!opt.portable this.zip = null if (opt.gzip) { if (typeof opt.gzip !== 'object') opt.gzip = {} if (this.portable) opt.gzip.portable = true this.zip = new zlib.Gzip(opt.gzip) this.zip.on('data', chunk => super.write(chunk)) this.zip.on('end', _ => super.end()) this.zip.on('drain', _ => this[ONDRAIN]()) this.on('resume', _ => this.zip.resume()) } else this.on('drain', this[ONDRAIN]) this.noDirRecurse = !!opt.noDirRecurse this.follow = !!opt.follow this.noMtime = !!opt.noMtime this.mtime = opt.mtime || null this.filter = typeof opt.filter === 'function' ? opt.filter : _ => true this[QUEUE] = new Yallist() this[JOBS] = 0 this.jobs = +opt.jobs || 4 this[PROCESSING] = false this[ENDED] = false } [WRITE] (chunk) { return super.write(chunk) } add (path) { this.write(path) return this } end (path) { if (path) this.write(path) this[ENDED] = true this[PROCESS]() return this } write (path) { if (this[ENDED]) throw new Error('write after end') if (path instanceof ReadEntry) this[ADDTARENTRY](path) else this[ADDFSENTRY](path) return this.flowing } [ADDTARENTRY] (p) { const absolute = normPath(path.resolve(this.cwd, p.path)) // in this case, we don't have to wait for the stat if (!this.filter(p.path, p)) p.resume() else { const job = new PackJob(p.path, absolute, false) job.entry = new WriteEntryTar(p, this[ENTRYOPT](job)) job.entry.on('end', _ => this[JOBDONE](job)) this[JOBS] += 1 this[QUEUE].push(job) } this[PROCESS]() } [ADDFSENTRY] (p) { const absolute = normPath(path.resolve(this.cwd, p)) this[QUEUE].push(new PackJob(p, absolute)) this[PROCESS]() } [STAT] (job) { job.pending = true this[JOBS] += 1 const stat = this.follow ? 'stat' : 'lstat' fs[stat](job.absolute, (er, stat) => { job.pending = false this[JOBS] -= 1 if (er) this.emit('error', er) else this[ONSTAT](job, stat) }) } [ONSTAT] (job, stat) { this.statCache.set(job.absolute, stat) job.stat = stat // now we have the stat, we can filter it. if (!this.filter(job.path, stat)) job.ignore = true this[PROCESS]() } [READDIR] (job) { job.pending = true this[JOBS] += 1 fs.readdir(job.absolute, (er, entries) => { job.pending = false this[JOBS] -= 1 if (er) return this.emit('error', er) this[ONREADDIR](job, entries) }) } [ONREADDIR] (job, entries) { this.readdirCache.set(job.absolute, entries) job.readdir = entries this[PROCESS]() } [PROCESS] () { if (this[PROCESSING]) return this[PROCESSING] = true for (let w = this[QUEUE].head; w !== null && this[JOBS] < this.jobs; w = w.next) { this[PROCESSJOB](w.value) if (w.value.ignore) { const p = w.next this[QUEUE].removeNode(w) w.next = p } } this[PROCESSING] = false if (this[ENDED] && !this[QUEUE].length && this[JOBS] === 0) { if (this.zip) this.zip.end(EOF) else { super.write(EOF) super.end() } } } get [CURRENT] () { return this[QUEUE] && this[QUEUE].head && this[QUEUE].head.value } [JOBDONE] (job) { this[QUEUE].shift() this[JOBS] -= 1 this[PROCESS]() } [PROCESSJOB] (job) { if (job.pending) return if (job.entry) { if (job === this[CURRENT] && !job.piped) this[PIPE](job) return } if (!job.stat) { if (this.statCache.has(job.absolute)) this[ONSTAT](job, this.statCache.get(job.absolute)) else this[STAT](job) } if (!job.stat) return // filtered out! if (job.ignore) return if (!this.noDirRecurse && job.stat.isDirectory() && !job.readdir) { if (this.readdirCache.has(job.absolute)) this[ONREADDIR](job, this.readdirCache.get(job.absolute)) else this[READDIR](job) if (!job.readdir) return } // we know it doesn't have an entry, because that got checked above job.entry = this[ENTRY](job) if (!job.entry) { job.ignore = true return } if (job === this[CURRENT] && !job.piped) this[PIPE](job) } [ENTRYOPT] (job) { return { onwarn: (code, msg, data) => this.warn(code, msg, data), noPax: this.noPax, cwd: this.cwd, absolute: job.absolute, preservePaths: this.preservePaths, maxReadSize: this.maxReadSize, strict: this.strict, portable: this.portable, linkCache: this.linkCache, statCache: this.statCache, noMtime: this.noMtime, mtime: this.mtime, prefix: this.prefix, } } [ENTRY] (job) { this[JOBS] += 1 try { return new this[WRITEENTRYCLASS](job.path, this[ENTRYOPT](job)) .on('end', () => this[JOBDONE](job)) .on('error', er => this.emit('error', er)) } catch (er) { this.emit('error', er) } } [ONDRAIN] () { if (this[CURRENT] && this[CURRENT].entry) this[CURRENT].entry.resume() } // like .pipe() but using super, because our write() is special [PIPE] (job) { job.piped = true if (job.readdir) { job.readdir.forEach(entry => { const p = job.path const base = p === './' ? '' : p.replace(/\/*$/, '/') this[ADDFSENTRY](base + entry) }) } const source = job.entry const zip = this.zip if (zip) { source.on('data', chunk => { if (!zip.write(chunk)) source.pause() }) } else { source.on('data', chunk => { if (!super.write(chunk)) source.pause() }) } } pause () { if (this.zip) this.zip.pause() return super.pause() } }) class PackSync extends Pack { constructor (opt) { super(opt) this[WRITEENTRYCLASS] = WriteEntrySync } // pause/resume are no-ops in sync streams. pause () {} resume () {} [STAT] (job) { const stat = this.follow ? 'statSync' : 'lstatSync' this[ONSTAT](job, fs[stat](job.absolute)) } [READDIR] (job, stat) { this[ONREADDIR](job, fs.readdirSync(job.absolute)) } // gotta get it all in this tick [PIPE] (job) { const source = job.entry const zip = this.zip if (job.readdir) { job.readdir.forEach(entry => { const p = job.path const base = p === './' ? '' : p.replace(/\/*$/, '/') this[ADDFSENTRY](base + entry) }) } if (zip) { source.on('data', chunk => { zip.write(chunk) }) } else { source.on('data', chunk => { super[WRITE](chunk) }) } } } Pack.Sync = PackSync module.exports = Pack 'use strict' // this[BUFFER] is the remainder of a chunk if we're waiting for // the full 512 bytes of a header to come in. We will Buffer.concat() // it to the next write(), which is a mem copy, but a small one. // // this[QUEUE] is a Yallist of entries that haven't been emitted // yet this can only get filled up if the user keeps write()ing after // a write() returns false, or does a write() with more than one entry // // We don't buffer chunks, we always parse them and either create an // entry, or push it into the active entry. The ReadEntry class knows // to throw data away if .ignore=true // // Shift entry off the buffer when it emits 'end', and emit 'entry' for // the next one in the list. // // At any time, we're pushing body chunks into the entry at WRITEENTRY, // and waiting for 'end' on the entry at READENTRY // // ignored entries get .resume() called on them straight away const warner = require('./warn-mixin.js') const Header = require('./header.js') const EE = require('events') const Yallist = require('yallist') const maxMetaEntrySize = 1024 * 1024 const Entry = require('./read-entry.js') const Pax = require('./pax.js') const zlib = require('minizlib') const gzipHeader = Buffer.from([0x1f, 0x8b]) const STATE = Symbol('state') const WRITEENTRY = Symbol('writeEntry') const READENTRY = Symbol('readEntry') const NEXTENTRY = Symbol('nextEntry') const PROCESSENTRY = Symbol('processEntry') const EX = Symbol('extendedHeader') const GEX = Symbol('globalExtendedHeader') const META = Symbol('meta') const EMITMETA = Symbol('emitMeta') const BUFFER = Symbol('buffer') const QUEUE = Symbol('queue') const ENDED = Symbol('ended') const EMITTEDEND = Symbol('emittedEnd') const EMIT = Symbol('emit') const UNZIP = Symbol('unzip') const CONSUMECHUNK = Symbol('consumeChunk') const CONSUMECHUNKSUB = Symbol('consumeChunkSub') const CONSUMEBODY = Symbol('consumeBody') const CONSUMEMETA = Symbol('consumeMeta') const CONSUMEHEADER = Symbol('consumeHeader') const CONSUMING = Symbol('consuming') const BUFFERCONCAT = Symbol('bufferConcat') const MAYBEEND = Symbol('maybeEnd') const WRITING = Symbol('writing') const ABORTED = Symbol('aborted') const DONE = Symbol('onDone') const SAW_VALID_ENTRY = Symbol('sawValidEntry') const SAW_NULL_BLOCK = Symbol('sawNullBlock') const SAW_EOF = Symbol('sawEOF') const noop = _ => true module.exports = warner(class Parser extends EE { constructor (opt) { opt = opt || {} super(opt) this.file = opt.file || '' // set to boolean false when an entry starts. 1024 bytes of \0 // is technically a valid tarball, albeit a boring one. this[SAW_VALID_ENTRY] = null // these BADARCHIVE errors can't be detected early. listen on DONE. this.on(DONE, _ => { if (this[STATE] === 'begin' || this[SAW_VALID_ENTRY] === false) { // either less than 1 block of data, or all entries were invalid. // Either way, probably not even a tarball. this.warn('TAR_BAD_ARCHIVE', 'Unrecognized archive format') } }) if (opt.ondone) this.on(DONE, opt.ondone) else { this.on(DONE, _ => { this.emit('prefinish') this.emit('finish') this.emit('end') this.emit('close') }) } this.strict = !!opt.strict this.maxMetaEntrySize = opt.maxMetaEntrySize || maxMetaEntrySize this.filter = typeof opt.filter === 'function' ? opt.filter : noop // have to set this so that streams are ok piping into it this.writable = true this.readable = false this[QUEUE] = new Yallist() this[BUFFER] = null this[READENTRY] = null this[WRITEENTRY] = null this[STATE] = 'begin' this[META] = '' this[EX] = null this[GEX] = null this[ENDED] = false this[UNZIP] = null this[ABORTED] = false this[SAW_NULL_BLOCK] = false this[SAW_EOF] = false if (typeof opt.onwarn === 'function') this.on('warn', opt.onwarn) if (typeof opt.onentry === 'function') this.on('entry', opt.onentry) } [CONSUMEHEADER] (chunk, position) { if (this[SAW_VALID_ENTRY] === null) this[SAW_VALID_ENTRY] = false let header try { header = new Header(chunk, position, this[EX], this[GEX]) } catch (er) { return this.warn('TAR_ENTRY_INVALID', er) } if (header.nullBlock) { if (this[SAW_NULL_BLOCK]) { this[SAW_EOF] = true // ending an archive with no entries. pointless, but legal. if (this[STATE] === 'begin') this[STATE] = 'header' this[EMIT]('eof') } else { this[SAW_NULL_BLOCK] = true this[EMIT]('nullBlock') } } else { this[SAW_NULL_BLOCK] = false if (!header.cksumValid) this.warn('TAR_ENTRY_INVALID', 'checksum failure', {header}) else if (!header.path) this.warn('TAR_ENTRY_INVALID', 'path is required', {header}) else { const type = header.type if (/^(Symbolic)?Link$/.test(type) && !header.linkpath) this.warn('TAR_ENTRY_INVALID', 'linkpath required', {header}) else if (!/^(Symbolic)?Link$/.test(type) && header.linkpath) this.warn('TAR_ENTRY_INVALID', 'linkpath forbidden', {header}) else { const entry = this[WRITEENTRY] = new Entry(header, this[EX], this[GEX]) // we do this for meta & ignored entries as well, because they // are still valid tar, or else we wouldn't know to ignore them if (!this[SAW_VALID_ENTRY]) { if (entry.remain) { // this might be the one! const onend = () => { if (!entry.invalid) this[SAW_VALID_ENTRY] = true } entry.on('end', onend) } else this[SAW_VALID_ENTRY] = true } if (entry.meta) { if (entry.size > this.maxMetaEntrySize) { entry.ignore = true this[EMIT]('ignoredEntry', entry) this[STATE] = 'ignore' entry.resume() } else if (entry.size > 0) { this[META] = '' entry.on('data', c => this[META] += c) this[STATE] = 'meta' } } else { this[EX] = null entry.ignore = entry.ignore || !this.filter(entry.path, entry) if (entry.ignore) { // probably valid, just not something we care about this[EMIT]('ignoredEntry', entry) this[STATE] = entry.remain ? 'ignore' : 'header' entry.resume() } else { if (entry.remain) this[STATE] = 'body' else { this[STATE] = 'header' entry.end() } if (!this[READENTRY]) { this[QUEUE].push(entry) this[NEXTENTRY]() } else this[QUEUE].push(entry) } } } } } } [PROCESSENTRY] (entry) { let go = true if (!entry) { this[READENTRY] = null go = false } else if (Array.isArray(entry)) this.emit.apply(this, entry) else { this[READENTRY] = entry this.emit('entry', entry) if (!entry.emittedEnd) { entry.on('end', _ => this[NEXTENTRY]()) go = false } } return go } [NEXTENTRY] () { do {} while (this[PROCESSENTRY](this[QUEUE].shift())) if (!this[QUEUE].length) { // At this point, there's nothing in the queue, but we may have an // entry which is being consumed (readEntry). // If we don't, then we definitely can handle more data. // If we do, and either it's flowing, or it has never had any data // written to it, then it needs more. // The only other possibility is that it has returned false from a // write() call, so we wait for the next drain to continue. const re = this[READENTRY] const drainNow = !re || re.flowing || re.size === re.remain if (drainNow) { if (!this[WRITING]) this.emit('drain') } else re.once('drain', _ => this.emit('drain')) } } [CONSUMEBODY] (chunk, position) { // write up to but no more than writeEntry.blockRemain const entry = this[WRITEENTRY] const br = entry.blockRemain const c = (br >= chunk.length && position === 0) ? chunk : chunk.slice(position, position + br) entry.write(c) if (!entry.blockRemain) { this[STATE] = 'header' this[WRITEENTRY] = null entry.end() } return c.length } [CONSUMEMETA] (chunk, position) { const entry = this[WRITEENTRY] const ret = this[CONSUMEBODY](chunk, position) // if we finished, then the entry is reset if (!this[WRITEENTRY]) this[EMITMETA](entry) return ret } [EMIT] (ev, data, extra) { if (!this[QUEUE].length && !this[READENTRY]) this.emit(ev, data, extra) else this[QUEUE].push([ev, data, extra]) } [EMITMETA] (entry) { this[EMIT]('meta', this[META]) switch (entry.type) { case 'ExtendedHeader': case 'OldExtendedHeader': this[EX] = Pax.parse(this[META], this[EX], false) break case 'GlobalExtendedHeader': this[GEX] = Pax.parse(this[META], this[GEX], true) break case 'NextFileHasLongPath': case 'OldGnuLongPath': this[EX] = this[EX] || Object.create(null) this[EX].path = this[META].replace(/\0.*/, '') break case 'NextFileHasLongLinkpath': this[EX] = this[EX] || Object.create(null) this[EX].linkpath = this[META].replace(/\0.*/, '') break /* istanbul ignore next */ default: throw new Error('unknown meta: ' + entry.type) } } abort (error) { this[ABORTED] = true this.emit('abort', error) // always throws, even in non-strict mode this.warn('TAR_ABORT', error, { recoverable: false }) } write (chunk) { if (this[ABORTED]) return // first write, might be gzipped if (this[UNZIP] === null && chunk) { if (this[BUFFER]) { chunk = Buffer.concat([this[BUFFER], chunk]) this[BUFFER] = null } if (chunk.length < gzipHeader.length) { this[BUFFER] = chunk return true } for (let i = 0; this[UNZIP] === null && i < gzipHeader.length; i++) { if (chunk[i] !== gzipHeader[i]) this[UNZIP] = false } if (this[UNZIP] === null) { const ended = this[ENDED] this[ENDED] = false this[UNZIP] = new zlib.Unzip() this[UNZIP].on('data', chunk => this[CONSUMECHUNK](chunk)) this[UNZIP].on('error', er => this.abort(er)) this[UNZIP].on('end', _ => { this[ENDED] = true this[CONSUMECHUNK]() }) this[WRITING] = true const ret = this[UNZIP][ended ? 'end' : 'write'](chunk) this[WRITING] = false return ret } } this[WRITING] = true if (this[UNZIP]) this[UNZIP].write(chunk) else this[CONSUMECHUNK](chunk) this[WRITING] = false // return false if there's a queue, or if the current entry isn't flowing const ret = this[QUEUE].length ? false : this[READENTRY] ? this[READENTRY].flowing : true // if we have no queue, then that means a clogged READENTRY if (!ret && !this[QUEUE].length) this[READENTRY].once('drain', _ => this.emit('drain')) return ret } [BUFFERCONCAT] (c) { if (c && !this[ABORTED]) this[BUFFER] = this[BUFFER] ? Buffer.concat([this[BUFFER], c]) : c } [MAYBEEND] () { if (this[ENDED] && !this[EMITTEDEND] && !this[ABORTED] && !this[CONSUMING]) { this[EMITTEDEND] = true const entry = this[WRITEENTRY] if (entry && entry.blockRemain) { // truncated, likely a damaged file const have = this[BUFFER] ? this[BUFFER].length : 0 this.warn('TAR_BAD_ARCHIVE', `Truncated input (needed ${ entry.blockRemain} more bytes, only ${have} available)`, {entry}) if (this[BUFFER]) entry.write(this[BUFFER]) entry.end() } this[EMIT](DONE) } } [CONSUMECHUNK] (chunk) { if (this[CONSUMING]) this[BUFFERCONCAT](chunk) else if (!chunk && !this[BUFFER]) this[MAYBEEND]() else { this[CONSUMING] = true if (this[BUFFER]) { this[BUFFERCONCAT](chunk) const c = this[BUFFER] this[BUFFER] = null this[CONSUMECHUNKSUB](c) } else this[CONSUMECHUNKSUB](chunk) while (this[BUFFER] && this[BUFFER].length >= 512 && !this[ABORTED] && !this[SAW_EOF]) { const c = this[BUFFER] this[BUFFER] = null this[CONSUMECHUNKSUB](c) } this[CONSUMING] = false } if (!this[BUFFER] || this[ENDED]) this[MAYBEEND]() } [CONSUMECHUNKSUB] (chunk) { // we know that we are in CONSUMING mode, so anything written goes into // the buffer. Advance the position and put any remainder in the buffer. let position = 0 const length = chunk.length while (position + 512 <= length && !this[ABORTED] && !this[SAW_EOF]) { switch (this[STATE]) { case 'begin': case 'header': this[CONSUMEHEADER](chunk, position) position += 512 break case 'ignore': case 'body': position += this[CONSUMEBODY](chunk, position) break case 'meta': position += this[CONSUMEMETA](chunk, position) break /* istanbul ignore next */ default: throw new Error('invalid state: ' + this[STATE]) } } if (position < length) { if (this[BUFFER]) this[BUFFER] = Buffer.concat([chunk.slice(position), this[BUFFER]]) else this[BUFFER] = chunk.slice(position) } } end (chunk) { if (!this[ABORTED]) { if (this[UNZIP]) this[UNZIP].end(chunk) else { this[ENDED] = true this.write(chunk) } } } }) // A path exclusive reservation system // reserve([list, of, paths], fn) // When the fn is first in line for all its paths, it // is called with a cb that clears the reservation. // // Used by async unpack to avoid clobbering paths in use, // while still allowing maximal safe parallelization. const assert = require('assert') const normalize = require('./normalize-unicode.js') const stripSlashes = require('./strip-trailing-slashes.js') const { join } = require('path') const platform = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform const isWindows = platform === 'win32' module.exports = () => { // path => [function or Set] // A Set object means a directory reservation // A fn is a direct reservation on that path const queues = new Map() // fn => {paths:[path,...], dirs:[path, ...]} const reservations = new Map() // return a set of parent dirs for a given path // '/a/b/c/d' -> ['/', '/a', '/a/b', '/a/b/c', '/a/b/c/d'] const getDirs = path => { const dirs = path.split('/').slice(0, -1).reduce((set, path) => { if (set.length) path = join(set[set.length - 1], path) set.push(path || '/') return set }, []) return dirs } // functions currently running const running = new Set() // return the queues for each path the function cares about // fn => {paths, dirs} const getQueues = fn => { const res = reservations.get(fn) /* istanbul ignore if - unpossible */ if (!res) throw new Error('function does not have any path reservations') return { paths: res.paths.map(path => queues.get(path)), dirs: [...res.dirs].map(path => queues.get(path)), } } // check if fn is first in line for all its paths, and is // included in the first set for all its dir queues const check = fn => { const {paths, dirs} = getQueues(fn) return paths.every(q => q[0] === fn) && dirs.every(q => q[0] instanceof Set && q[0].has(fn)) } // run the function if it's first in line and not already running const run = fn => { if (running.has(fn) || !check(fn)) return false running.add(fn) fn(() => clear(fn)) return true } const clear = fn => { if (!running.has(fn)) return false const { paths, dirs } = reservations.get(fn) const next = new Set() paths.forEach(path => { const q = queues.get(path) assert.equal(q[0], fn) if (q.length === 1) queues.delete(path) else { q.shift() if (typeof q[0] === 'function') next.add(q[0]) else q[0].forEach(fn => next.add(fn)) } }) dirs.forEach(dir => { const q = queues.get(dir) assert(q[0] instanceof Set) if (q[0].size === 1 && q.length === 1) queues.delete(dir) else if (q[0].size === 1) { q.shift() // must be a function or else the Set would've been reused next.add(q[0]) } else q[0].delete(fn) }) running.delete(fn) next.forEach(fn => run(fn)) return true } const reserve = (paths, fn) => { // collide on matches across case and unicode normalization // On windows, thanks to the magic of 8.3 shortnames, it is fundamentally // impossible to determine whether two paths refer to the same thing on // disk, without asking the kernel for a shortname. // So, we just pretend that every path matches every other path here, // effectively removing all parallelization on windows. paths = isWindows ? ['win32 parallelization disabled'] : paths.map(p => { // don't need normPath, because we skip this entirely for windows return normalize(stripSlashes(join(p))).toLowerCase() }) const dirs = new Set( paths.map(path => getDirs(path)).reduce((a, b) => a.concat(b)) ) reservations.set(fn, {dirs, paths}) paths.forEach(path => { const q = queues.get(path) if (!q) queues.set(path, [fn]) else q.push(fn) }) dirs.forEach(dir => { const q = queues.get(dir) if (!q) queues.set(dir, [new Set([fn])]) else if (q[q.length - 1] instanceof Set) q[q.length - 1].add(fn) else q.push(new Set([fn])) }) return run(fn) } return { check, reserve } } 'use strict' const Header = require('./header.js') const path = require('path') class Pax { constructor (obj, global) { this.atime = obj.atime || null this.charset = obj.charset || null this.comment = obj.comment || null this.ctime = obj.ctime || null this.gid = obj.gid || null this.gname = obj.gname || null this.linkpath = obj.linkpath || null this.mtime = obj.mtime || null this.path = obj.path || null this.size = obj.size || null this.uid = obj.uid || null this.uname = obj.uname || null this.dev = obj.dev || null this.ino = obj.ino || null this.nlink = obj.nlink || null this.global = global || false } encode () { const body = this.encodeBody() if (body === '') return null const bodyLen = Buffer.byteLength(body) // round up to 512 bytes // add 512 for header const bufLen = 512 * Math.ceil(1 + bodyLen / 512) const buf = Buffer.allocUnsafe(bufLen) // 0-fill the header section, it might not hit every field for (let i = 0; i < 512; i++) buf[i] = 0 new Header({ // XXX split the path // then the path should be PaxHeader + basename, but less than 99, // prepend with the dirname path: ('PaxHeader/' + path.basename(this.path)).slice(0, 99), mode: this.mode || 0o644, uid: this.uid || null, gid: this.gid || null, size: bodyLen, mtime: this.mtime || null, type: this.global ? 'GlobalExtendedHeader' : 'ExtendedHeader', linkpath: '', uname: this.uname || '', gname: this.gname || '', devmaj: 0, devmin: 0, atime: this.atime || null, ctime: this.ctime || null, }).encode(buf) buf.write(body, 512, bodyLen, 'utf8') // null pad after the body for (let i = bodyLen + 512; i < buf.length; i++) buf[i] = 0 return buf } encodeBody () { return ( this.encodeField('path') + this.encodeField('ctime') + this.encodeField('atime') + this.encodeField('dev') + this.encodeField('ino') + this.encodeField('nlink') + this.encodeField('charset') + this.encodeField('comment') + this.encodeField('gid') + this.encodeField('gname') + this.encodeField('linkpath') + this.encodeField('mtime') + this.encodeField('size') + this.encodeField('uid') + this.encodeField('uname') ) } encodeField (field) { if (this[field] === null || this[field] === undefined) return '' const v = this[field] instanceof Date ? this[field].getTime() / 1000 : this[field] const s = ' ' + (field === 'dev' || field === 'ino' || field === 'nlink' ? 'SCHILY.' : '') + field + '=' + v + '\n' const byteLen = Buffer.byteLength(s) // the digits includes the length of the digits in ascii base-10 // so if it's 9 characters, then adding 1 for the 9 makes it 10 // which makes it 11 chars. let digits = Math.floor(Math.log(byteLen) / Math.log(10)) + 1 if (byteLen + digits >= Math.pow(10, digits)) digits += 1 const len = digits + byteLen return len + s } } Pax.parse = (string, ex, g) => new Pax(merge(parseKV(string), ex), g) const merge = (a, b) => b ? Object.keys(a).reduce((s, k) => (s[k] = a[k], s), b) : a const parseKV = string => string .replace(/\n$/, '') .split('\n') .reduce(parseKVLine, Object.create(null)) const parseKVLine = (set, line) => { const n = parseInt(line, 10) // XXX Values with \n in them will fail this. // Refactor to not be a naive line-by-line parse. if (n !== Buffer.byteLength(line) + 1) return set line = line.substr((n + ' ').length) const kv = line.split('=') const k = kv.shift().replace(/^SCHILY\.(dev|ino|nlink)/, '$1') if (!k) return set const v = kv.join('=') set[k] = /^([A-Z]+\.)?([mac]|birth|creation)time$/.test(k) ? new Date(v * 1000) : /^[0-9]+$/.test(v) ? +v : v return set } module.exports = Pax 'use strict' const MiniPass = require('minipass') const normPath = require('./normalize-windows-path.js') const SLURP = Symbol('slurp') module.exports = class ReadEntry extends MiniPass { constructor (header, ex, gex) { super() // read entries always start life paused. this is to avoid the // situation where Minipass's auto-ending empty streams results // in an entry ending before we're ready for it. this.pause() this.extended = ex this.globalExtended = gex this.header = header this.startBlockSize = 512 * Math.ceil(header.size / 512) this.blockRemain = this.startBlockSize this.remain = header.size this.type = header.type this.meta = false this.ignore = false switch (this.type) { case 'File': case 'OldFile': case 'Link': case 'SymbolicLink': case 'CharacterDevice': case 'BlockDevice': case 'Directory': case 'FIFO': case 'ContiguousFile': case 'GNUDumpDir': break case 'NextFileHasLongLinkpath': case 'NextFileHasLongPath': case 'OldGnuLongPath': case 'GlobalExtendedHeader': case 'ExtendedHeader': case 'OldExtendedHeader': this.meta = true break // NOTE: gnutar and bsdtar treat unrecognized types as 'File' // it may be worth doing the same, but with a warning. default: this.ignore = true } this.path = normPath(header.path) this.mode = header.mode if (this.mode) this.mode = this.mode & 0o7777 this.uid = header.uid this.gid = header.gid this.uname = header.uname this.gname = header.gname this.size = header.size this.mtime = header.mtime this.atime = header.atime this.ctime = header.ctime this.linkpath = normPath(header.linkpath) this.uname = header.uname this.gname = header.gname if (ex) this[SLURP](ex) if (gex) this[SLURP](gex, true) } write (data) { const writeLen = data.length if (writeLen > this.blockRemain) throw new Error('writing more to entry than is appropriate') const r = this.remain const br = this.blockRemain this.remain = Math.max(0, r - writeLen) this.blockRemain = Math.max(0, br - writeLen) if (this.ignore) return true if (r >= writeLen) return super.write(data) // r < writeLen return super.write(data.slice(0, r)) } [SLURP] (ex, global) { for (const k in ex) { // we slurp in everything except for the path attribute in // a global extended header, because that's weird. if (ex[k] !== null && ex[k] !== undefined && !(global && k === 'path')) this[k] = k === 'path' || k === 'linkpath' ? normPath(ex[k]) : ex[k] } } } 'use strict' // tar -r const hlo = require('./high-level-opt.js') const Pack = require('./pack.js') const fs = require('fs') const fsm = require('fs-minipass') const t = require('./list.js') const path = require('path') // starting at the head of the file, read a Header // If the checksum is invalid, that's our position to start writing // If it is, jump forward by the specified size (round up to 512) // and try again. // Write the new Pack stream starting there. const Header = require('./header.js') module.exports = (opt_, files, cb) => { const opt = hlo(opt_) if (!opt.file) throw new TypeError('file is required') if (opt.gzip) throw new TypeError('cannot append to compressed archives') if (!files || !Array.isArray(files) || !files.length) throw new TypeError('no files or directories specified') files = Array.from(files) return opt.sync ? replaceSync(opt, files) : replace(opt, files, cb) } const replaceSync = (opt, files) => { const p = new Pack.Sync(opt) let threw = true let fd let position try { try { fd = fs.openSync(opt.file, 'r+') } catch (er) { if (er.code === 'ENOENT') fd = fs.openSync(opt.file, 'w+') else throw er } const st = fs.fstatSync(fd) const headBuf = Buffer.alloc(512) POSITION: for (position = 0; position < st.size; position += 512) { for (let bufPos = 0, bytes = 0; bufPos < 512; bufPos += bytes) { bytes = fs.readSync( fd, headBuf, bufPos, headBuf.length - bufPos, position + bufPos ) if (position === 0 && headBuf[0] === 0x1f && headBuf[1] === 0x8b) throw new Error('cannot append to compressed archives') if (!bytes) break POSITION } const h = new Header(headBuf) if (!h.cksumValid) break const entryBlockSize = 512 * Math.ceil(h.size / 512) if (position + entryBlockSize + 512 > st.size) break // the 512 for the header we just parsed will be added as well // also jump ahead all the blocks for the body position += entryBlockSize if (opt.mtimeCache) opt.mtimeCache.set(h.path, h.mtime) } threw = false streamSync(opt, p, position, fd, files) } finally { if (threw) { try { fs.closeSync(fd) } catch (er) {} } } } const streamSync = (opt, p, position, fd, files) => { const stream = new fsm.WriteStreamSync(opt.file, { fd: fd, start: position, }) p.pipe(stream) addFilesSync(p, files) } const replace = (opt, files, cb) => { files = Array.from(files) const p = new Pack(opt) const getPos = (fd, size, cb_) => { const cb = (er, pos) => { if (er) fs.close(fd, _ => cb_(er)) else cb_(null, pos) } let position = 0 if (size === 0) return cb(null, 0) let bufPos = 0 const headBuf = Buffer.alloc(512) const onread = (er, bytes) => { if (er) return cb(er) bufPos += bytes if (bufPos < 512 && bytes) { return fs.read( fd, headBuf, bufPos, headBuf.length - bufPos, position + bufPos, onread ) } if (position === 0 && headBuf[0] === 0x1f && headBuf[1] === 0x8b) return cb(new Error('cannot append to compressed archives')) // truncated header if (bufPos < 512) return cb(null, position) const h = new Header(headBuf) if (!h.cksumValid) return cb(null, position) const entryBlockSize = 512 * Math.ceil(h.size / 512) if (position + entryBlockSize + 512 > size) return cb(null, position) position += entryBlockSize + 512 if (position >= size) return cb(null, position) if (opt.mtimeCache) opt.mtimeCache.set(h.path, h.mtime) bufPos = 0 fs.read(fd, headBuf, 0, 512, position, onread) } fs.read(fd, headBuf, 0, 512, position, onread) } const promise = new Promise((resolve, reject) => { p.on('error', reject) let flag = 'r+' const onopen = (er, fd) => { if (er && er.code === 'ENOENT' && flag === 'r+') { flag = 'w+' return fs.open(opt.file, flag, onopen) } if (er) return reject(er) fs.fstat(fd, (er, st) => { if (er) return fs.close(fd, () => reject(er)) getPos(fd, st.size, (er, position) => { if (er) return reject(er) const stream = new fsm.WriteStream(opt.file, { fd: fd, start: position, }) p.pipe(stream) stream.on('error', reject) stream.on('close', resolve) addFilesAsync(p, files) }) }) } fs.open(opt.file, flag, onopen) }) return cb ? promise.then(cb, cb) : promise } const addFilesSync = (p, files) => { files.forEach(file => { if (file.charAt(0) === '@') { t({ file: path.resolve(p.cwd, file.substr(1)), sync: true, noResume: true, onentry: entry => p.add(entry), }) } else p.add(file) }) p.end() } const addFilesAsync = (p, files) => { while (files.length) { const file = files.shift() if (file.charAt(0) === '@') { return t({ file: path.resolve(p.cwd, file.substr(1)), noResume: true, onentry: entry => p.add(entry), }).then(_ => addFilesAsync(p, files)) } else p.add(file) } p.end() } // unix absolute paths are also absolute on win32, so we use this for both const { isAbsolute, parse } = require('path').win32 // returns [root, stripped] // Note that windows will think that //x/y/z/a has a "root" of //x/y, and in // those cases, we want to sanitize it to x/y/z/a, not z/a, so we strip / // explicitly if it's the first character. // drive-specific relative paths on Windows get their root stripped off even // though they are not absolute, so `c:../foo` becomes ['c:', '../foo'] module.exports = path => { let r = '' let parsed = parse(path) while (isAbsolute(path) || parsed.root) { // windows will think that //x/y/z has a "root" of //x/y/ // but strip the //?/C:/ off of //?/C:/path const root = path.charAt(0) === '/' && path.slice(0, 4) !== '//?/' ? '/' : parsed.root path = path.substr(root.length) r += root parsed = parse(path) } return [r, path] } // warning: extremely hot code path. // This has been meticulously optimized for use // within npm install on large package trees. // Do not edit without careful benchmarking. module.exports = str => { let i = str.length - 1 let slashesStart = -1 while (i > -1 && str.charAt(i) === '/') { slashesStart = i i-- } return slashesStart === -1 ? str : str.slice(0, slashesStart) } 'use strict' // map types from key to human-friendly name exports.name = new Map([ ['0', 'File'], // same as File ['', 'OldFile'], ['1', 'Link'], ['2', 'SymbolicLink'], // Devices and FIFOs aren't fully supported // they are parsed, but skipped when unpacking ['3', 'CharacterDevice'], ['4', 'BlockDevice'], ['5', 'Directory'], ['6', 'FIFO'], // same as File ['7', 'ContiguousFile'], // pax headers ['g', 'GlobalExtendedHeader'], ['x', 'ExtendedHeader'], // vendor-specific stuff // skip ['A', 'SolarisACL'], // like 5, but with data, which should be skipped ['D', 'GNUDumpDir'], // metadata only, skip ['I', 'Inode'], // data = link path of next file ['K', 'NextFileHasLongLinkpath'], // data = path of next file ['L', 'NextFileHasLongPath'], // skip ['M', 'ContinuationFile'], // like L ['N', 'OldGnuLongPath'], // skip ['S', 'SparseFile'], // skip ['V', 'TapeVolumeHeader'], // like x ['X', 'OldExtendedHeader'], ]) // map the other direction exports.code = new Map(Array.from(exports.name).map(kv => [kv[1], kv[0]])) 'use strict' // the PEND/UNPEND stuff tracks whether we're ready to emit end/close yet. // but the path reservations are required to avoid race conditions where // parallelized unpack ops may mess with one another, due to dependencies // (like a Link depending on its target) or destructive operations (like // clobbering an fs object to create one of a different type.) const assert = require('assert') const Parser = require('./parse.js') const fs = require('fs') const fsm = require('fs-minipass') const path = require('path') const mkdir = require('./mkdir.js') const wc = require('./winchars.js') const pathReservations = require('./path-reservations.js') const stripAbsolutePath = require('./strip-absolute-path.js') const normPath = require('./normalize-windows-path.js') const stripSlash = require('./strip-trailing-slashes.js') const normalize = require('./normalize-unicode.js') const ONENTRY = Symbol('onEntry') const CHECKFS = Symbol('checkFs') const CHECKFS2 = Symbol('checkFs2') const PRUNECACHE = Symbol('pruneCache') const ISREUSABLE = Symbol('isReusable') const MAKEFS = Symbol('makeFs') const FILE = Symbol('file') const DIRECTORY = Symbol('directory') const LINK = Symbol('link') const SYMLINK = Symbol('symlink') const HARDLINK = Symbol('hardlink') const UNSUPPORTED = Symbol('unsupported') const CHECKPATH = Symbol('checkPath') const MKDIR = Symbol('mkdir') const ONERROR = Symbol('onError') const PENDING = Symbol('pending') const PEND = Symbol('pend') const UNPEND = Symbol('unpend') const ENDED = Symbol('ended') const MAYBECLOSE = Symbol('maybeClose') const SKIP = Symbol('skip') const DOCHOWN = Symbol('doChown') const UID = Symbol('uid') const GID = Symbol('gid') const CHECKED_CWD = Symbol('checkedCwd') const crypto = require('crypto') const getFlag = require('./get-write-flag.js') const platform = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform const isWindows = platform === 'win32' // Unlinks on Windows are not atomic. // // This means that if you have a file entry, followed by another // file entry with an identical name, and you cannot re-use the file // (because it's a hardlink, or because unlink:true is set, or it's // Windows, which does not have useful nlink values), then the unlink // will be committed to the disk AFTER the new file has been written // over the old one, deleting the new file. // // To work around this, on Windows systems, we rename the file and then // delete the renamed file. It's a sloppy kludge, but frankly, I do not // know of a better way to do this, given windows' non-atomic unlink // semantics. // // See: https://github.com/npm/node-tar/issues/183 /* istanbul ignore next */ const unlinkFile = (path, cb) => { if (!isWindows) return fs.unlink(path, cb) const name = path + '.DELETE.' + crypto.randomBytes(16).toString('hex') fs.rename(path, name, er => { if (er) return cb(er) fs.unlink(name, cb) }) } /* istanbul ignore next */ const unlinkFileSync = path => { if (!isWindows) return fs.unlinkSync(path) const name = path + '.DELETE.' + crypto.randomBytes(16).toString('hex') fs.renameSync(path, name) fs.unlinkSync(name) } // this.gid, entry.gid, this.processUid const uint32 = (a, b, c) => a === a >>> 0 ? a : b === b >>> 0 ? b : c // clear the cache if it's a case-insensitive unicode-squashing match. // we can't know if the current file system is case-sensitive or supports // unicode fully, so we check for similarity on the maximally compatible // representation. Err on the side of pruning, since all it's doing is // preventing lstats, and it's not the end of the world if we get a false // positive. // Note that on windows, we always drop the entire cache whenever a // symbolic link is encountered, because 8.3 filenames are impossible // to reason about, and collisions are hazards rather than just failures. const cacheKeyNormalize = path => normalize(stripSlash(normPath(path))) .toLowerCase() const pruneCache = (cache, abs) => { abs = cacheKeyNormalize(abs) for (const path of cache.keys()) { const pnorm = cacheKeyNormalize(path) if (pnorm === abs || pnorm.indexOf(abs + '/') === 0) cache.delete(path) } } const dropCache = cache => { for (const key of cache.keys()) cache.delete(key) } class Unpack extends Parser { constructor (opt) { if (!opt) opt = {} opt.ondone = _ => { this[ENDED] = true this[MAYBECLOSE]() } super(opt) this[CHECKED_CWD] = false this.reservations = pathReservations() this.transform = typeof opt.transform === 'function' ? opt.transform : null this.writable = true this.readable = false this[PENDING] = 0 this[ENDED] = false this.dirCache = opt.dirCache || new Map() if (typeof opt.uid === 'number' || typeof opt.gid === 'number') { // need both or neither if (typeof opt.uid !== 'number' || typeof opt.gid !== 'number') throw new TypeError('cannot set owner without number uid and gid') if (opt.preserveOwner) { throw new TypeError( 'cannot preserve owner in archive and also set owner explicitly') } this.uid = opt.uid this.gid = opt.gid this.setOwner = true } else { this.uid = null this.gid = null this.setOwner = false } // default true for root if (opt.preserveOwner === undefined && typeof opt.uid !== 'number') this.preserveOwner = process.getuid && process.getuid() === 0 else this.preserveOwner = !!opt.preserveOwner this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ? process.getuid() : null this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ? process.getgid() : null // mostly just for testing, but useful in some cases. // Forcibly trigger a chown on every entry, no matter what this.forceChown = opt.forceChown === true // turn > this[ONENTRY](entry)) } // a bad or damaged archive is a warning for Parser, but an error // when extracting. Mark those errors as unrecoverable, because // the Unpack contract cannot be met. warn (code, msg, data = {}) { if (code === 'TAR_BAD_ARCHIVE' || code === 'TAR_ABORT') data.recoverable = false return super.warn(code, msg, data) } [MAYBECLOSE] () { if (this[ENDED] && this[PENDING] === 0) { this.emit('prefinish') this.emit('finish') this.emit('end') this.emit('close') } } [CHECKPATH] (entry) { if (this.strip) { const parts = normPath(entry.path).split('/') if (parts.length < this.strip) return false entry.path = parts.slice(this.strip).join('/') if (entry.type === 'Link') { const linkparts = normPath(entry.linkpath).split('/') if (linkparts.length >= this.strip) entry.linkpath = linkparts.slice(this.strip).join('/') else return false } } if (!this.preservePaths) { const p = normPath(entry.path) const parts = p.split('/') if (parts.includes('..') || isWindows && /^[a-z]:\.\.$/i.test(parts[0])) { this.warn('TAR_ENTRY_ERROR', `path contains '..'`, { entry, path: p, }) return false } // strip off the root const [root, stripped] = stripAbsolutePath(p) if (root) { entry.path = stripped this.warn('TAR_ENTRY_INFO', `stripping ${root} from absolute path`, { entry, path: p, }) } } if (path.isAbsolute(entry.path)) entry.absolute = normPath(path.resolve(entry.path)) else entry.absolute = normPath(path.resolve(this.cwd, entry.path)) // if we somehow ended up with a path that escapes the cwd, and we are // not in preservePaths mode, then something is fishy! This should have // been prevented above, so ignore this for coverage. /* istanbul ignore if - defense in depth */ if (!this.preservePaths && entry.absolute.indexOf(this.cwd + '/') !== 0 && entry.absolute !== this.cwd) { this.warn('TAR_ENTRY_ERROR', 'path escaped extraction target', { entry, path: normPath(entry.path), resolvedPath: entry.absolute, cwd: this.cwd, }) return false } // an archive can set properties on the extraction directory, but it // may not replace the cwd with a different kind of thing entirely. if (entry.absolute === this.cwd && entry.type !== 'Directory' && entry.type !== 'GNUDumpDir') return false // only encode : chars that aren't drive letter indicators if (this.win32) { const { root: aRoot } = path.win32.parse(entry.absolute) entry.absolute = aRoot + wc.encode(entry.absolute.substr(aRoot.length)) const { root: pRoot } = path.win32.parse(entry.path) entry.path = pRoot + wc.encode(entry.path.substr(pRoot.length)) } return true } [ONENTRY] (entry) { if (!this[CHECKPATH](entry)) return entry.resume() assert.equal(typeof entry.absolute, 'string') switch (entry.type) { case 'Directory': case 'GNUDumpDir': if (entry.mode) entry.mode = entry.mode | 0o700 case 'File': case 'OldFile': case 'ContiguousFile': case 'Link': case 'SymbolicLink': return this[CHECKFS](entry) case 'CharacterDevice': case 'BlockDevice': case 'FIFO': default: return this[UNSUPPORTED](entry) } } [ONERROR] (er, entry) { // Cwd has to exist, or else nothing works. That's serious. // Other errors are warnings, which raise the error in strict // mode, but otherwise continue on. if (er.name === 'CwdError') this.emit('error', er) else { this.warn('TAR_ENTRY_ERROR', er, {entry}) this[UNPEND]() entry.resume() } } [MKDIR] (dir, mode, cb) { mkdir(normPath(dir), { uid: this.uid, gid: this.gid, processUid: this.processUid, processGid: this.processGid, umask: this.processUmask, preserve: this.preservePaths, unlink: this.unlink, cache: this.dirCache, cwd: this.cwd, mode: mode, noChmod: this.noChmod, }, cb) } [DOCHOWN] (entry) { // in preserve owner mode, chown if the entry doesn't match process // in set owner mode, chown if setting doesn't match process return this.forceChown || this.preserveOwner && (typeof entry.uid === 'number' && entry.uid !== this.processUid || typeof entry.gid === 'number' && entry.gid !== this.processGid) || (typeof this.uid === 'number' && this.uid !== this.processUid || typeof this.gid === 'number' && this.gid !== this.processGid) } [UID] (entry) { return uint32(this.uid, entry.uid, this.processUid) } [GID] (entry) { return uint32(this.gid, entry.gid, this.processGid) } [FILE] (entry, fullyDone) { const mode = entry.mode & 0o7777 || this.fmode const stream = new fsm.WriteStream(entry.absolute, { flags: getFlag(entry.size), mode: mode, autoClose: false, }) stream.on('error', er => { if (stream.fd) fs.close(stream.fd, () => {}) // flush all the data out so that we aren't left hanging // if the error wasn't actually fatal. otherwise the parse // is blocked, and we never proceed. stream.write = () => true this[ONERROR](er, entry) fullyDone() }) let actions = 1 const done = er => { if (er) { /* istanbul ignore else - we should always have a fd by now */ if (stream.fd) fs.close(stream.fd, () => {}) this[ONERROR](er, entry) fullyDone() return } if (--actions === 0) { fs.close(stream.fd, er => { if (er) this[ONERROR](er, entry) else this[UNPEND]() fullyDone() }) } } stream.on('finish', _ => { // if futimes fails, try utimes // if utimes fails, fail with the original error // same for fchown/chown const abs = entry.absolute const fd = stream.fd if (entry.mtime && !this.noMtime) { actions++ const atime = entry.atime || new Date() const mtime = entry.mtime fs.futimes(fd, atime, mtime, er => er ? fs.utimes(abs, atime, mtime, er2 => done(er2 && er)) : done()) } if (this[DOCHOWN](entry)) { actions++ const uid = this[UID](entry) const gid = this[GID](entry) fs.fchown(fd, uid, gid, er => er ? fs.chown(abs, uid, gid, er2 => done(er2 && er)) : done()) } done() }) const tx = this.transform ? this.transform(entry) || entry : entry if (tx !== entry) { tx.on('error', er => { this[ONERROR](er, entry) fullyDone() }) entry.pipe(tx) } tx.pipe(stream) } [DIRECTORY] (entry, fullyDone) { const mode = entry.mode & 0o7777 || this.dmode this[MKDIR](entry.absolute, mode, er => { if (er) { this[ONERROR](er, entry) fullyDone() return } let actions = 1 const done = _ => { if (--actions === 0) { fullyDone() this[UNPEND]() entry.resume() } } if (entry.mtime && !this.noMtime) { actions++ fs.utimes(entry.absolute, entry.atime || new Date(), entry.mtime, done) } if (this[DOCHOWN](entry)) { actions++ fs.chown(entry.absolute, this[UID](entry), this[GID](entry), done) } done() }) } [UNSUPPORTED] (entry) { entry.unsupported = true this.warn('TAR_ENTRY_UNSUPPORTED', `unsupported entry type: ${entry.type}`, {entry}) entry.resume() } [SYMLINK] (entry, done) { this[LINK](entry, entry.linkpath, 'symlink', done) } [HARDLINK] (entry, done) { const linkpath = normPath(path.resolve(this.cwd, entry.linkpath)) this[LINK](entry, linkpath, 'link', done) } [PEND] () { this[PENDING]++ } [UNPEND] () { this[PENDING]-- this[MAYBECLOSE]() } [SKIP] (entry) { this[UNPEND]() entry.resume() } // Check if we can reuse an existing filesystem entry safely and // overwrite it, rather than unlinking and recreating // Windows doesn't report a useful nlink, so we just never reuse entries [ISREUSABLE] (entry, st) { return entry.type === 'File' && !this.unlink && st.isFile() && st.nlink <= 1 && !isWindows } // check if a thing is there, and if so, try to clobber it [CHECKFS] (entry) { this[PEND]() const paths = [entry.path] if (entry.linkpath) paths.push(entry.linkpath) this.reservations.reserve(paths, done => this[CHECKFS2](entry, done)) } [PRUNECACHE] (entry) { // if we are not creating a directory, and the path is in the dirCache, // then that means we are about to delete the directory we created // previously, and it is no longer going to be a directory, and neither // is any of its children. // If a symbolic link is encountered, all bets are off. There is no // reasonable way to sanitize the cache in such a way we will be able to // avoid having filesystem collisions. If this happens with a non-symlink // entry, it'll just fail to unpack, but a symlink to a directory, using an // 8.3 shortname or certain unicode attacks, can evade detection and lead // to arbitrary writes to anywhere on the system. if (entry.type === 'SymbolicLink') dropCache(this.dirCache) else if (entry.type !== 'Directory') pruneCache(this.dirCache, entry.absolute) } [CHECKFS2] (entry, fullyDone) { this[PRUNECACHE](entry) const done = er => { this[PRUNECACHE](entry) fullyDone(er) } const checkCwd = () => { this[MKDIR](this.cwd, this.dmode, er => { if (er) { this[ONERROR](er, entry) done() return } this[CHECKED_CWD] = true start() }) } const start = () => { if (entry.absolute !== this.cwd) { const parent = normPath(path.dirname(entry.absolute)) if (parent !== this.cwd) { return this[MKDIR](parent, this.dmode, er => { if (er) { this[ONERROR](er, entry) done() return } afterMakeParent() }) } } afterMakeParent() } const afterMakeParent = () => { fs.lstat(entry.absolute, (lstatEr, st) => { if (st && (this.keep || this.newer && st.mtime > entry.mtime)) { this[SKIP](entry) done() return } if (lstatEr || this[ISREUSABLE](entry, st)) return this[MAKEFS](null, entry, done) if (st.isDirectory()) { if (entry.type === 'Directory') { const needChmod = !this.noChmod && entry.mode && (st.mode & 0o7777) !== entry.mode const afterChmod = er => this[MAKEFS](er, entry, done) if (!needChmod) return afterChmod() return fs.chmod(entry.absolute, entry.mode, afterChmod) } // Not a dir entry, have to remove it. // NB: the only way to end up with an entry that is the cwd // itself, in such a way that == does not detect, is a // tricky windows absolute path with UNC or 8.3 parts (and // preservePaths:true, or else it will have been stripped). // In that case, the user has opted out of path protections // explicitly, so if they blow away the cwd, c'est la vie. if (entry.absolute !== this.cwd) { return fs.rmdir(entry.absolute, er => this[MAKEFS](er, entry, done)) } } // not a dir, and not reusable // don't remove if the cwd, we want that error if (entry.absolute === this.cwd) return this[MAKEFS](null, entry, done) unlinkFile(entry.absolute, er => this[MAKEFS](er, entry, done)) }) } if (this[CHECKED_CWD]) start() else checkCwd() } [MAKEFS] (er, entry, done) { if (er) { this[ONERROR](er, entry) done() return } switch (entry.type) { case 'File': case 'OldFile': case 'ContiguousFile': return this[FILE](entry, done) case 'Link': return this[HARDLINK](entry, done) case 'SymbolicLink': return this[SYMLINK](entry, done) case 'Directory': case 'GNUDumpDir': return this[DIRECTORY](entry, done) } } [LINK] (entry, linkpath, link, done) { // XXX: get the type ('symlink' or 'junction') for windows fs[link](linkpath, entry.absolute, er => { if (er) this[ONERROR](er, entry) else { this[UNPEND]() entry.resume() } done() }) } } const callSync = fn => { try { return [null, fn()] } catch (er) { return [er, null] } } class UnpackSync extends Unpack { [MAKEFS] (er, entry) { return super[MAKEFS](er, entry, () => {}) } [CHECKFS] (entry) { this[PRUNECACHE](entry) if (!this[CHECKED_CWD]) { const er = this[MKDIR](this.cwd, this.dmode) if (er) return this[ONERROR](er, entry) this[CHECKED_CWD] = true } // don't bother to make the parent if the current entry is the cwd, // we've already checked it. if (entry.absolute !== this.cwd) { const parent = normPath(path.dirname(entry.absolute)) if (parent !== this.cwd) { const mkParent = this[MKDIR](parent, this.dmode) if (mkParent) return this[ONERROR](mkParent, entry) } } const [lstatEr, st] = callSync(() => fs.lstatSync(entry.absolute)) if (st && (this.keep || this.newer && st.mtime > entry.mtime)) return this[SKIP](entry) if (lstatEr || this[ISREUSABLE](entry, st)) return this[MAKEFS](null, entry) if (st.isDirectory()) { if (entry.type === 'Directory') { const needChmod = !this.noChmod && entry.mode && (st.mode & 0o7777) !== entry.mode const [er] = needChmod ? callSync(() => { fs.chmodSync(entry.absolute, entry.mode) }) : [] return this[MAKEFS](er, entry) } // not a dir entry, have to remove it const [er] = callSync(() => fs.rmdirSync(entry.absolute)) this[MAKEFS](er, entry) } // not a dir, and not reusable. // don't remove if it's the cwd, since we want that error. const [er] = entry.absolute === this.cwd ? [] : callSync(() => unlinkFileSync(entry.absolute)) this[MAKEFS](er, entry) } [FILE] (entry, done) { const mode = entry.mode & 0o7777 || this.fmode const oner = er => { let closeError try { fs.closeSync(fd) } catch (e) { closeError = e } if (er || closeError) this[ONERROR](er || closeError, entry) done() } let fd try { fd = fs.openSync(entry.absolute, getFlag(entry.size), mode) } catch (er) { return oner(er) } const tx = this.transform ? this.transform(entry) || entry : entry if (tx !== entry) { tx.on('error', er => this[ONERROR](er, entry)) entry.pipe(tx) } tx.on('data', chunk => { try { fs.writeSync(fd, chunk, 0, chunk.length) } catch (er) { oner(er) } }) tx.on('end', _ => { let er = null // try both, falling futimes back to utimes // if either fails, handle the first error if (entry.mtime && !this.noMtime) { const atime = entry.atime || new Date() const mtime = entry.mtime try { fs.futimesSync(fd, atime, mtime) } catch (futimeser) { try { fs.utimesSync(entry.absolute, atime, mtime) } catch (utimeser) { er = futimeser } } } if (this[DOCHOWN](entry)) { const uid = this[UID](entry) const gid = this[GID](entry) try { fs.fchownSync(fd, uid, gid) } catch (fchowner) { try { fs.chownSync(entry.absolute, uid, gid) } catch (chowner) { er = er || fchowner } } } oner(er) }) } [DIRECTORY] (entry, done) { const mode = entry.mode & 0o7777 || this.dmode const er = this[MKDIR](entry.absolute, mode) if (er) { this[ONERROR](er, entry) done() return } if (entry.mtime && !this.noMtime) { try { fs.utimesSync(entry.absolute, entry.atime || new Date(), entry.mtime) } catch (er) {} } if (this[DOCHOWN](entry)) { try { fs.chownSync(entry.absolute, this[UID](entry), this[GID](entry)) } catch (er) {} } done() entry.resume() } [MKDIR] (dir, mode) { try { return mkdir.sync(normPath(dir), { uid: this.uid, gid: this.gid, processUid: this.processUid, processGid: this.processGid, umask: this.processUmask, preserve: this.preservePaths, unlink: this.unlink, cache: this.dirCache, cwd: this.cwd, mode: mode, }) } catch (er) { return er } } [LINK] (entry, linkpath, link, done) { try { fs[link + 'Sync'](linkpath, entry.absolute) done() entry.resume() } catch (er) { return this[ONERROR](er, entry) } } } Unpack.Sync = UnpackSync module.exports = Unpack 'use strict' // tar -u const hlo = require('./high-level-opt.js') const r = require('./replace.js') // just call tar.r with the filter and mtimeCache module.exports = (opt_, files, cb) => { const opt = hlo(opt_) if (!opt.file) throw new TypeError('file is required') if (opt.gzip) throw new TypeError('cannot append to compressed archives') if (!files || !Array.isArray(files) || !files.length) throw new TypeError('no files or directories specified') files = Array.from(files) mtimeFilter(opt) return r(opt, files, cb) } const mtimeFilter = opt => { const filter = opt.filter if (!opt.mtimeCache) opt.mtimeCache = new Map() opt.filter = filter ? (path, stat) => filter(path, stat) && !(opt.mtimeCache.get(path) > stat.mtime) : (path, stat) => !(opt.mtimeCache.get(path) > stat.mtime) } 'use strict' module.exports = Base => class extends Base { warn (code, message, data = {}) { if (this.file) data.file = this.file if (this.cwd) data.cwd = this.cwd data.code = message instanceof Error && message.code || code data.tarCode = code if (!this.strict && data.recoverable !== false) { if (message instanceof Error) { data = Object.assign(message, data) message = message.message } this.emit('warn', data.tarCode, message, data) } else if (message instanceof Error) this.emit('error', Object.assign(message, data)) else this.emit('error', Object.assign(new Error(`${code}: ${message}`), data)) } } 'use strict' // When writing files on Windows, translate the characters to their // 0xf000 higher-encoded versions. const raw = [ '|', '<', '>', '?', ':', ] const win = raw.map(char => String.fromCharCode(0xf000 + char.charCodeAt(0))) const toWin = new Map(raw.map((char, i) => [char, win[i]])) const toRaw = new Map(win.map((char, i) => [char, raw[i]])) module.exports = { encode: s => raw.reduce((s, c) => s.split(c).join(toWin.get(c)), s), decode: s => win.reduce((s, c) => s.split(c).join(toRaw.get(c)), s), } 'use strict' const MiniPass = require('minipass') const Pax = require('./pax.js') const Header = require('./header.js') const fs = require('fs') const path = require('path') const normPath = require('./normalize-windows-path.js') const stripSlash = require('./strip-trailing-slashes.js') const prefixPath = (path, prefix) => { if (!prefix) return normPath(path) path = normPath(path).replace(/^\.(\/|$)/, '') return stripSlash(prefix) + '/' + path } const maxReadSize = 16 * 1024 * 1024 const PROCESS = Symbol('process') const FILE = Symbol('file') const DIRECTORY = Symbol('directory') const SYMLINK = Symbol('symlink') const HARDLINK = Symbol('hardlink') const HEADER = Symbol('header') const READ = Symbol('read') const LSTAT = Symbol('lstat') const ONLSTAT = Symbol('onlstat') const ONREAD = Symbol('onread') const ONREADLINK = Symbol('onreadlink') const OPENFILE = Symbol('openfile') const ONOPENFILE = Symbol('onopenfile') const CLOSE = Symbol('close') const MODE = Symbol('mode') const AWAITDRAIN = Symbol('awaitDrain') const ONDRAIN = Symbol('ondrain') const PREFIX = Symbol('prefix') const HAD_ERROR = Symbol('hadError') const warner = require('./warn-mixin.js') const winchars = require('./winchars.js') const stripAbsolutePath = require('./strip-absolute-path.js') const modeFix = require('./mode-fix.js') const WriteEntry = warner(class WriteEntry extends MiniPass { constructor (p, opt) { opt = opt || {} super(opt) if (typeof p !== 'string') throw new TypeError('path is required') this.path = normPath(p) // suppress atime, ctime, uid, gid, uname, gname this.portable = !!opt.portable // until node has builtin pwnam functions, this'll have to do this.myuid = process.getuid && process.getuid() || 0 this.myuser = process.env.USER || '' this.maxReadSize = opt.maxReadSize || maxReadSize this.linkCache = opt.linkCache || new Map() this.statCache = opt.statCache || new Map() this.preservePaths = !!opt.preservePaths this.cwd = normPath(opt.cwd || process.cwd()) this.strict = !!opt.strict this.noPax = !!opt.noPax this.noMtime = !!opt.noMtime this.mtime = opt.mtime || null this.prefix = opt.prefix ? normPath(opt.prefix) : null this.fd = null this.blockLen = null this.blockRemain = null this.buf = null this.offset = null this.length = null this.pos = null this.remain = null if (typeof opt.onwarn === 'function') this.on('warn', opt.onwarn) let pathWarn = false if (!this.preservePaths) { const [root, stripped] = stripAbsolutePath(this.path) if (root) { this.path = stripped pathWarn = root } } this.win32 = !!opt.win32 || process.platform === 'win32' if (this.win32) { // force the \ to / normalization, since we might not *actually* // be on windows, but want \ to be considered a path separator. this.path = winchars.decode(this.path.replace(/\\/g, '/')) p = p.replace(/\\/g, '/') } this.absolute = normPath(opt.absolute || path.resolve(this.cwd, p)) if (this.path === '') this.path = './' if (pathWarn) { this.warn('TAR_ENTRY_INFO', `stripping ${pathWarn} from absolute path`, { entry: this, path: pathWarn + this.path, }) } if (this.statCache.has(this.absolute)) this[ONLSTAT](this.statCache.get(this.absolute)) else this[LSTAT]() } emit (ev, ...data) { if (ev === 'error') this[HAD_ERROR] = true return super.emit(ev, ...data) } [LSTAT] () { fs.lstat(this.absolute, (er, stat) => { if (er) return this.emit('error', er) this[ONLSTAT](stat) }) } [ONLSTAT] (stat) { this.statCache.set(this.absolute, stat) this.stat = stat if (!stat.isFile()) stat.size = 0 this.type = getType(stat) this.emit('stat', stat) this[PROCESS]() } [PROCESS] () { switch (this.type) { case 'File': return this[FILE]() case 'Directory': return this[DIRECTORY]() case 'SymbolicLink': return this[SYMLINK]() // unsupported types are ignored. default: return this.end() } } [MODE] (mode) { return modeFix(mode, this.type === 'Directory', this.portable) } [PREFIX] (path) { return prefixPath(path, this.prefix) } [HEADER] () { if (this.type === 'Directory' && this.portable) this.noMtime = true this.header = new Header({ path: this[PREFIX](this.path), // only apply the prefix to hard links. linkpath: this.type === 'Link' ? this[PREFIX](this.linkpath) : this.linkpath, // only the permissions and setuid/setgid/sticky bitflags // not the higher-order bits that specify file type mode: this[MODE](this.stat.mode), uid: this.portable ? null : this.stat.uid, gid: this.portable ? null : this.stat.gid, size: this.stat.size, mtime: this.noMtime ? null : this.mtime || this.stat.mtime, type: this.type, uname: this.portable ? null : this.stat.uid === this.myuid ? this.myuser : '', atime: this.portable ? null : this.stat.atime, ctime: this.portable ? null : this.stat.ctime, }) if (this.header.encode() && !this.noPax) { super.write(new Pax({ atime: this.portable ? null : this.header.atime, ctime: this.portable ? null : this.header.ctime, gid: this.portable ? null : this.header.gid, mtime: this.noMtime ? null : this.mtime || this.header.mtime, path: this[PREFIX](this.path), linkpath: this.type === 'Link' ? this[PREFIX](this.linkpath) : this.linkpath, size: this.header.size, uid: this.portable ? null : this.header.uid, uname: this.portable ? null : this.header.uname, dev: this.portable ? null : this.stat.dev, ino: this.portable ? null : this.stat.ino, nlink: this.portable ? null : this.stat.nlink, }).encode()) } super.write(this.header.block) } [DIRECTORY] () { if (this.path.substr(-1) !== '/') this.path += '/' this.stat.size = 0 this[HEADER]() this.end() } [SYMLINK] () { fs.readlink(this.absolute, (er, linkpath) => { if (er) return this.emit('error', er) this[ONREADLINK](linkpath) }) } [ONREADLINK] (linkpath) { this.linkpath = normPath(linkpath) this[HEADER]() this.end() } [HARDLINK] (linkpath) { this.type = 'Link' this.linkpath = normPath(path.relative(this.cwd, linkpath)) this.stat.size = 0 this[HEADER]() this.end() } [FILE] () { if (this.stat.nlink > 1) { const linkKey = this.stat.dev + ':' + this.stat.ino if (this.linkCache.has(linkKey)) { const linkpath = this.linkCache.get(linkKey) if (linkpath.indexOf(this.cwd) === 0) return this[HARDLINK](linkpath) } this.linkCache.set(linkKey, this.absolute) } this[HEADER]() if (this.stat.size === 0) return this.end() this[OPENFILE]() } [OPENFILE] () { fs.open(this.absolute, 'r', (er, fd) => { if (er) return this.emit('error', er) this[ONOPENFILE](fd) }) } [ONOPENFILE] (fd) { this.fd = fd if (this[HAD_ERROR]) return this[CLOSE]() this.blockLen = 512 * Math.ceil(this.stat.size / 512) this.blockRemain = this.blockLen const bufLen = Math.min(this.blockLen, this.maxReadSize) this.buf = Buffer.allocUnsafe(bufLen) this.offset = 0 this.pos = 0 this.remain = this.stat.size this.length = this.buf.length this[READ]() } [READ] () { const { fd, buf, offset, length, pos } = this fs.read(fd, buf, offset, length, pos, (er, bytesRead) => { if (er) { // ignoring the error from close(2) is a bad practice, but at // this point we already have an error, don't need another one return this[CLOSE](() => this.emit('error', er)) } this[ONREAD](bytesRead) }) } [CLOSE] (cb) { fs.close(this.fd, cb) } [ONREAD] (bytesRead) { if (bytesRead <= 0 && this.remain > 0) { const er = new Error('encountered unexpected EOF') er.path = this.absolute er.syscall = 'read' er.code = 'EOF' return this[CLOSE](() => this.emit('error', er)) } if (bytesRead > this.remain) { const er = new Error('did not encounter expected EOF') er.path = this.absolute er.syscall = 'read' er.code = 'EOF' return this[CLOSE](() => this.emit('error', er)) } // null out the rest of the buffer, if we could fit the block padding // at the end of this loop, we've incremented bytesRead and this.remain // to be incremented up to the blockRemain level, as if we had expected // to get a null-padded file, and read it until the end. then we will // decrement both remain and blockRemain by bytesRead, and know that we // reached the expected EOF, without any null buffer to append. if (bytesRead === this.remain) { for (let i = bytesRead; i < this.length && bytesRead < this.blockRemain; i++) { this.buf[i + this.offset] = 0 bytesRead++ this.remain++ } } const writeBuf = this.offset === 0 && bytesRead === this.buf.length ? this.buf : this.buf.slice(this.offset, this.offset + bytesRead) const flushed = this.write(writeBuf) if (!flushed) this[AWAITDRAIN](() => this[ONDRAIN]()) else this[ONDRAIN]() } [AWAITDRAIN] (cb) { this.once('drain', cb) } write (writeBuf) { if (this.blockRemain < writeBuf.length) { const er = new Error('writing more data than expected') er.path = this.absolute return this.emit('error', er) } this.remain -= writeBuf.length this.blockRemain -= writeBuf.length this.pos += writeBuf.length this.offset += writeBuf.length return super.write(writeBuf) } [ONDRAIN] () { if (!this.remain) { if (this.blockRemain) super.write(Buffer.alloc(this.blockRemain)) return this[CLOSE](er => er ? this.emit('error', er) : this.end()) } if (this.offset >= this.length) { // if we only have a smaller bit left to read, alloc a smaller buffer // otherwise, keep it the same length it was before. this.buf = Buffer.allocUnsafe(Math.min(this.blockRemain, this.buf.length)) this.offset = 0 } this.length = this.buf.length - this.offset this[READ]() } }) class WriteEntrySync extends WriteEntry { [LSTAT] () { this[ONLSTAT](fs.lstatSync(this.absolute)) } [SYMLINK] () { this[ONREADLINK](fs.readlinkSync(this.absolute)) } [OPENFILE] () { this[ONOPENFILE](fs.openSync(this.absolute, 'r')) } [READ] () { let threw = true try { const { fd, buf, offset, length, pos } = this const bytesRead = fs.readSync(fd, buf, offset, length, pos) this[ONREAD](bytesRead) threw = false } finally { // ignoring the error from close(2) is a bad practice, but at // this point we already have an error, don't need another one if (threw) { try { this[CLOSE](() => {}) } catch (er) {} } } } [AWAITDRAIN] (cb) { cb() } [CLOSE] (cb) { fs.closeSync(this.fd) cb() } } const WriteEntryTar = warner(class WriteEntryTar extends MiniPass { constructor (readEntry, opt) { opt = opt || {} super(opt) this.preservePaths = !!opt.preservePaths this.portable = !!opt.portable this.strict = !!opt.strict this.noPax = !!opt.noPax this.noMtime = !!opt.noMtime this.readEntry = readEntry this.type = readEntry.type if (this.type === 'Directory' && this.portable) this.noMtime = true this.prefix = opt.prefix || null this.path = normPath(readEntry.path) this.mode = this[MODE](readEntry.mode) this.uid = this.portable ? null : readEntry.uid this.gid = this.portable ? null : readEntry.gid this.uname = this.portable ? null : readEntry.uname this.gname = this.portable ? null : readEntry.gname this.size = readEntry.size this.mtime = this.noMtime ? null : opt.mtime || readEntry.mtime this.atime = this.portable ? null : readEntry.atime this.ctime = this.portable ? null : readEntry.ctime this.linkpath = normPath(readEntry.linkpath) if (typeof opt.onwarn === 'function') this.on('warn', opt.onwarn) let pathWarn = false if (!this.preservePaths) { const [root, stripped] = stripAbsolutePath(this.path) if (root) { this.path = stripped pathWarn = root } } this.remain = readEntry.size this.blockRemain = readEntry.startBlockSize this.header = new Header({ path: this[PREFIX](this.path), linkpath: this.type === 'Link' ? this[PREFIX](this.linkpath) : this.linkpath, // only the permissions and setuid/setgid/sticky bitflags // not the higher-order bits that specify file type mode: this.mode, uid: this.portable ? null : this.uid, gid: this.portable ? null : this.gid, size: this.size, mtime: this.noMtime ? null : this.mtime, type: this.type, uname: this.portable ? null : this.uname, atime: this.portable ? null : this.atime, ctime: this.portable ? null : this.ctime, }) if (pathWarn) { this.warn('TAR_ENTRY_INFO', `stripping ${pathWarn} from absolute path`, { entry: this, path: pathWarn + this.path, }) } if (this.header.encode() && !this.noPax) { super.write(new Pax({ atime: this.portable ? null : this.atime, ctime: this.portable ? null : this.ctime, gid: this.portable ? null : this.gid, mtime: this.noMtime ? null : this.mtime, path: this[PREFIX](this.path), linkpath: this.type === 'Link' ? this[PREFIX](this.linkpath) : this.linkpath, size: this.size, uid: this.portable ? null : this.uid, uname: this.portable ? null : this.uname, dev: this.portable ? null : this.readEntry.dev, ino: this.portable ? null : this.readEntry.ino, nlink: this.portable ? null : this.readEntry.nlink, }).encode()) } super.write(this.header.block) readEntry.pipe(this) } [PREFIX] (path) { return prefixPath(path, this.prefix) } [MODE] (mode) { return modeFix(mode, this.type === 'Directory', this.portable) } write (data) { const writeLen = data.length if (writeLen > this.blockRemain) throw new Error('writing more to entry than is appropriate') this.blockRemain -= writeLen return super.write(data) } end () { if (this.blockRemain) super.write(Buffer.alloc(this.blockRemain)) return super.end() } }) WriteEntry.Sync = WriteEntrySync WriteEntry.Tar = WriteEntryTar const getType = stat => stat.isFile() ? 'File' : stat.isDirectory() ? 'Directory' : stat.isSymbolicLink() ? 'SymbolicLink' : 'Unsupported' module.exports = WriteEntry 'use strict' var net = require('net') , tls = require('tls') , http = require('http') , https = require('https') , events = require('events') , assert = require('assert') , util = require('util') , Buffer = require('safe-buffer').Buffer ; exports.httpOverHttp = httpOverHttp exports.httpsOverHttp = httpsOverHttp exports.httpOverHttps = httpOverHttps exports.httpsOverHttps = httpsOverHttps function httpOverHttp(options) { var agent = new TunnelingAgent(options) agent.request = http.request return agent } function httpsOverHttp(options) { var agent = new TunnelingAgent(options) agent.request = http.request agent.createSocket = createSecureSocket agent.defaultPort = 443 return agent } function httpOverHttps(options) { var agent = new TunnelingAgent(options) agent.request = https.request return agent } function httpsOverHttps(options) { var agent = new TunnelingAgent(options) agent.request = https.request agent.createSocket = createSecureSocket agent.defaultPort = 443 return agent } function TunnelingAgent(options) { var self = this self.options = options || {} self.proxyOptions = self.options.proxy || {} self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets self.requests = [] self.sockets = [] self.on('free', function onFree(socket, host, port) { for (var i = 0, len = self.requests.length; i < len; ++i) { var pending = self.requests[i] if (pending.host === host && pending.port === port) { // Detect the request to connect same origin server, // reuse the connection. self.requests.splice(i, 1) pending.request.onSocket(socket) return } } socket.destroy() self.removeSocket(socket) }) } util.inherits(TunnelingAgent, events.EventEmitter) TunnelingAgent.prototype.addRequest = function addRequest(req, options) { var self = this // Legacy API: addRequest(req, host, port, path) if (typeof options === 'string') { options = { host: options, port: arguments[2], path: arguments[3] }; } if (self.sockets.length >= this.maxSockets) { // We are over limit so we'll add it to the queue. self.requests.push({host: options.host, port: options.port, request: req}) return } // If we are under maxSockets create a new one. self.createConnection({host: options.host, port: options.port, request: req}) } TunnelingAgent.prototype.createConnection = function createConnection(pending) { var self = this self.createSocket(pending, function(socket) { socket.on('free', onFree) socket.on('close', onCloseOrRemove) socket.on('agentRemove', onCloseOrRemove) pending.request.onSocket(socket) function onFree() { self.emit('free', socket, pending.host, pending.port) } function onCloseOrRemove(err) { self.removeSocket(socket) socket.removeListener('free', onFree) socket.removeListener('close', onCloseOrRemove) socket.removeListener('agentRemove', onCloseOrRemove) } }) } TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { var self = this var placeholder = {} self.sockets.push(placeholder) var connectOptions = mergeOptions({}, self.proxyOptions, { method: 'CONNECT' , path: options.host + ':' + options.port , agent: false } ) if (connectOptions.proxyAuth) { connectOptions.headers = connectOptions.headers || {} connectOptions.headers['Proxy-Authorization'] = 'Basic ' + Buffer.from(connectOptions.proxyAuth).toString('base64') } debug('making CONNECT request') var connectReq = self.request(connectOptions) connectReq.useChunkedEncodingByDefault = false // for v0.6 connectReq.once('response', onResponse) // for v0.6 connectReq.once('upgrade', onUpgrade) // for v0.6 connectReq.once('connect', onConnect) // for v0.7 or later connectReq.once('error', onError) connectReq.end() function onResponse(res) { // Very hacky. This is necessary to avoid http-parser leaks. res.upgrade = true } function onUpgrade(res, socket, head) { // Hacky. process.nextTick(function() { onConnect(res, socket, head) }) } function onConnect(res, socket, head) { connectReq.removeAllListeners() socket.removeAllListeners() if (res.statusCode === 200) { assert.equal(head.length, 0) debug('tunneling connection has established') self.sockets[self.sockets.indexOf(placeholder)] = socket cb(socket) } else { debug('tunneling socket could not be established, statusCode=%d', res.statusCode) var error = new Error('tunneling socket could not be established, ' + 'statusCode=' + res.statusCode) error.code = 'ECONNRESET' options.request.emit('error', error) self.removeSocket(placeholder) } } function onError(cause) { connectReq.removeAllListeners() debug('tunneling socket could not be established, cause=%s\n', cause.message, cause.stack) var error = new Error('tunneling socket could not be established, ' + 'cause=' + cause.message) error.code = 'ECONNRESET' options.request.emit('error', error) self.removeSocket(placeholder) } } TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { var pos = this.sockets.indexOf(socket) if (pos === -1) return this.sockets.splice(pos, 1) var pending = this.requests.shift() if (pending) { // If we have pending requests and a socket gets closed a new one // needs to be created to take over in the pool for the one that closed. this.createConnection(pending) } } function createSecureSocket(options, cb) { var self = this TunnelingAgent.prototype.createSocket.call(self, options, function(socket) { // 0 is dummy port for v0.6 var secureSocket = tls.connect(0, mergeOptions({}, self.options, { servername: options.host , socket: socket } )) self.sockets[self.sockets.indexOf(socket)] = secureSocket cb(secureSocket) }) } function mergeOptions(target) { for (var i = 1, len = arguments.length; i < len; ++i) { var overrides = arguments[i] if (typeof overrides === 'object') { var keys = Object.keys(overrides) for (var j = 0, keyLen = keys.length; j < keyLen; ++j) { var k = keys[j] if (overrides[k] !== undefined) { target[k] = overrides[k] } } } } return target } var debug if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { debug = function() { var args = Array.prototype.slice.call(arguments) if (typeof args[0] === 'string') { args[0] = 'TUNNEL: ' + args[0] } else { args.unshift('TUNNEL:') } console.error.apply(console, args) } } else { debug = function() {} } exports.debug = debug // for test Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: You must give any other recipients of the Work or Derivative Works a copy of this License; and You must cause any modified files to carry prominent notices stating that You changed the files; and You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS{ "author": "Mikeal Rogers (http://www.futurealoof.com)", "name": "tunnel-agent", "license": "Apache-2.0", "description": "HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.", "version": "0.6.0", "repository": { "url": "https://github.com/mikeal/tunnel-agent" }, "main": "index.js", "files": [ "index.js" ], "dependencies": { "safe-buffer": "^5.0.1" }, "devDependencies": {}, "optionalDependencies": {}, "engines": { "node": "*" } } The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "author": "Isaac Z. Schlueter (http://blog.izs.me)", "name": "which", "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.", "version": "2.0.2", "repository": { "type": "git", "url": "git://github.com/isaacs/node-which.git" }, "main": "which.js", "bin": { "node-which": "./bin/node-which" }, "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, "devDependencies": { "mkdirp": "^0.5.0", "rimraf": "^2.6.2", "tap": "^14.6.9" }, "scripts": { "test": "tap", "preversion": "npm test", "postversion": "npm publish", "prepublish": "npm run changelog", "prechangelog": "bash gen-changelog.sh", "changelog": "git add CHANGELOG.md", "postchangelog": "git commit -m 'update changelog - '${npm_package_version}", "postpublish": "git push origin --follow-tags" }, "files": [ "which.js", "bin/node-which" ], "tap": { "check-coverage": true }, "engines": { "node": ">= 8" } } const isWindows = process.platform === 'win32' || process.env.OSTYPE === 'cygwin' || process.env.OSTYPE === 'msys' const path = require('path') const COLON = isWindows ? ';' : ':' const isexe = require('isexe') const getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' }) const getPathInfo = (cmd, opt) => { const colon = opt.colon || COLON // If it has a slash, then we don't bother searching the pathenv. // just check the file itself, and that's it. const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [''] : ( [ // windows always checks the cwd first ...(isWindows ? [process.cwd()] : []), ...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */ '').split(colon), ] ) const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM' : '' const pathExt = isWindows ? pathExtExe.split(colon) : [''] if (isWindows) { if (cmd.indexOf('.') !== -1 && pathExt[0] !== '') pathExt.unshift('') } return { pathEnv, pathExt, pathExtExe, } } const which = (cmd, opt, cb) => { if (typeof opt === 'function') { cb = opt opt = {} } if (!opt) opt = {} const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt) const found = [] const step = i => new Promise((resolve, reject) => { if (i === pathEnv.length) return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd)) const ppRaw = pathEnv[i] const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw const pCmd = path.join(pathPart, cmd) const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd resolve(subStep(p, i, 0)) }) const subStep = (p, i, ii) => new Promise((resolve, reject) => { if (ii === pathExt.length) return resolve(step(i + 1)) const ext = pathExt[ii] isexe(p + ext, { pathExt: pathExtExe }, (er, is) => { if (!er && is) { if (opt.all) found.push(p + ext) else return resolve(p + ext) } return resolve(subStep(p, i, ii + 1)) }) }) return cb ? step(0).then(res => cb(null, res), cb) : step(0) } const whichSync = (cmd, opt) => { opt = opt || {} const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt) const found = [] for (let i = 0; i < pathEnv.length; i ++) { const ppRaw = pathEnv[i] const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw const pCmd = path.join(pathPart, cmd) const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd for (let j = 0; j < pathExt.length; j ++) { const cur = p + pathExt[j] try { const is = isexe.sync(cur, { pathExt: pathExtExe }) if (is) { if (opt.all) found.push(cur) else return cur } } catch (ex) {} } } if (opt.all && found.length) return found if (opt.nothrow) return null throw getNotFoundError(cmd) } module.exports = which which.sync = whichSync #!/usr/bin/env node var which = require("../") if (process.argv.length < 3) usage() function usage () { console.error('usage: which [-as] program ...') process.exit(1) } var all = false var silent = false var dashdash = false var args = process.argv.slice(2).filter(function (arg) { if (dashdash || !/^-/.test(arg)) return true if (arg === '--') { dashdash = true return false } var flags = arg.substr(1).split('') for (var f = 0; f < flags.length; f++) { var flag = flags[f] switch (flag) { case 's': silent = true break case 'a': all = true break default: console.error('which: illegal option -- ' + flag) usage() } } return false }) process.exit(args.reduce(function (pv, current) { try { var f = which.sync(current, { all: all }) if (all) f = f.join('\n') if (!silent) console.log(f) return pv; } catch (e) { return 1; } }, 0)) 'use strict'; module.exports = function () { throw new Error( 'ws does not work in the browser. Browser clients must use the native ' + 'WebSocket object' ); }; 'use strict'; const WebSocket = require('./lib/websocket'); WebSocket.createWebSocketStream = require('./lib/stream'); WebSocket.Server = require('./lib/websocket-server'); WebSocket.Receiver = require('./lib/receiver'); WebSocket.Sender = require('./lib/sender'); module.exports = WebSocket; The MIT License (MIT) Copyright (c) 2011 Einar Otto Stangvik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "ws", "version": "7.4.6", "description": "Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js", "keywords": [ "HyBi", "Push", "RFC-6455", "WebSocket", "WebSockets", "real-time" ], "homepage": "https://github.com/websockets/ws", "bugs": "https://github.com/websockets/ws/issues", "repository": "websockets/ws", "author": "Einar Otto Stangvik (http://2x.io)", "license": "MIT", "main": "index.js", "browser": "browser.js", "engines": { "node": ">=8.3.0" }, "files": [ "browser.js", "index.js", "lib/*.js" ], "scripts": { "test": "nyc --reporter=lcov --reporter=text mocha --throw-deprecation test/*.test.js", "integration": "mocha --throw-deprecation test/*.integration.js", "lint": "eslint --ignore-path .gitignore . && prettier --check --ignore-path .gitignore \"**/*.{json,md,yaml,yml}\"" }, "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": "^5.0.2" }, "peerDependenciesMeta": { "bufferutil": { "optional": true }, "utf-8-validate": { "optional": true } }, "devDependencies": { "benchmark": "^2.1.4", "bufferutil": "^4.0.1", "eslint": "^7.2.0", "eslint-config-prettier": "^8.1.0", "eslint-plugin-prettier": "^3.0.1", "mocha": "^7.0.0", "nyc": "^15.0.0", "prettier": "^2.0.5", "utf-8-validate": "^5.0.2" } } 'use strict'; const { EMPTY_BUFFER } = require('./constants'); /** * Merges an array of buffers into a new buffer. * * @param {Buffer[]} list The array of buffers to concat * @param {Number} totalLength The total length of buffers in the list * @return {Buffer} The resulting buffer * @public */ function concat(list, totalLength) { if (list.length === 0) return EMPTY_BUFFER; if (list.length === 1) return list[0]; const target = Buffer.allocUnsafe(totalLength); let offset = 0; for (let i = 0; i < list.length; i++) { const buf = list[i]; target.set(buf, offset); offset += buf.length; } if (offset < totalLength) return target.slice(0, offset); return target; } /** * Masks a buffer using the given mask. * * @param {Buffer} source The buffer to mask * @param {Buffer} mask The mask to use * @param {Buffer} output The buffer where to store the result * @param {Number} offset The offset at which to start writing * @param {Number} length The number of bytes to mask. * @public */ function _mask(source, mask, output, offset, length) { for (let i = 0; i < length; i++) { output[offset + i] = source[i] ^ mask[i & 3]; } } /** * Unmasks a buffer using the given mask. * * @param {Buffer} buffer The buffer to unmask * @param {Buffer} mask The mask to use * @public */ function _unmask(buffer, mask) { // Required until https://github.com/nodejs/node/issues/9006 is resolved. const length = buffer.length; for (let i = 0; i < length; i++) { buffer[i] ^= mask[i & 3]; } } /** * Converts a buffer to an `ArrayBuffer`. * * @param {Buffer} buf The buffer to convert * @return {ArrayBuffer} Converted buffer * @public */ function toArrayBuffer(buf) { if (buf.byteLength === buf.buffer.byteLength) { return buf.buffer; } return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); } /** * Converts `data` to a `Buffer`. * * @param {*} data The data to convert * @return {Buffer} The buffer * @throws {TypeError} * @public */ function toBuffer(data) { toBuffer.readOnly = true; if (Buffer.isBuffer(data)) return data; let buf; if (data instanceof ArrayBuffer) { buf = Buffer.from(data); } else if (ArrayBuffer.isView(data)) { buf = Buffer.from(data.buffer, data.byteOffset, data.byteLength); } else { buf = Buffer.from(data); toBuffer.readOnly = false; } return buf; } try { const bufferUtil = require('bufferutil'); const bu = bufferUtil.BufferUtil || bufferUtil; module.exports = { concat, mask(source, mask, output, offset, length) { if (length < 48) _mask(source, mask, output, offset, length); else bu.mask(source, mask, output, offset, length); }, toArrayBuffer, toBuffer, unmask(buffer, mask) { if (buffer.length < 32) _unmask(buffer, mask); else bu.unmask(buffer, mask); } }; } catch (e) /* istanbul ignore next */ { module.exports = { concat, mask: _mask, toArrayBuffer, toBuffer, unmask: _unmask }; } 'use strict'; module.exports = { BINARY_TYPES: ['nodebuffer', 'arraybuffer', 'fragments'], GUID: '258EAFA5-E914-47DA-95CA-C5AB0DC85B11', kStatusCode: Symbol('status-code'), kWebSocket: Symbol('websocket'), EMPTY_BUFFER: Buffer.alloc(0), NOOP: () => {} }; 'use strict'; /** * Class representing an event. * * @private */ class Event { /** * Create a new `Event`. * * @param {String} type The name of the event * @param {Object} target A reference to the target to which the event was * dispatched */ constructor(type, target) { this.target = target; this.type = type; } } /** * Class representing a message event. * * @extends Event * @private */ class MessageEvent extends Event { /** * Create a new `MessageEvent`. * * @param {(String|Buffer|ArrayBuffer|Buffer[])} data The received data * @param {WebSocket} target A reference to the target to which the event was * dispatched */ constructor(data, target) { super('message', target); this.data = data; } } /** * Class representing a close event. * * @extends Event * @private */ class CloseEvent extends Event { /** * Create a new `CloseEvent`. * * @param {Number} code The status code explaining why the connection is being * closed * @param {String} reason A human-readable string explaining why the * connection is closing * @param {WebSocket} target A reference to the target to which the event was * dispatched */ constructor(code, reason, target) { super('close', target); this.wasClean = target._closeFrameReceived && target._closeFrameSent; this.reason = reason; this.code = code; } } /** * Class representing an open event. * * @extends Event * @private */ class OpenEvent extends Event { /** * Create a new `OpenEvent`. * * @param {WebSocket} target A reference to the target to which the event was * dispatched */ constructor(target) { super('open', target); } } /** * Class representing an error event. * * @extends Event * @private */ class ErrorEvent extends Event { /** * Create a new `ErrorEvent`. * * @param {Object} error The error that generated this event * @param {WebSocket} target A reference to the target to which the event was * dispatched */ constructor(error, target) { super('error', target); this.message = error.message; this.error = error; } } /** * This provides methods for emulating the `EventTarget` interface. It's not * meant to be used directly. * * @mixin */ const EventTarget = { /** * Register an event listener. * * @param {String} type A string representing the event type to listen for * @param {Function} listener The listener to add * @param {Object} [options] An options object specifies characteristics about * the event listener * @param {Boolean} [options.once=false] A `Boolean`` indicating that the * listener should be invoked at most once after being added. If `true`, * the listener would be automatically removed when invoked. * @public */ addEventListener(type, listener, options) { if (typeof listener !== 'function') return; function onMessage(data) { listener.call(this, new MessageEvent(data, this)); } function onClose(code, message) { listener.call(this, new CloseEvent(code, message, this)); } function onError(error) { listener.call(this, new ErrorEvent(error, this)); } function onOpen() { listener.call(this, new OpenEvent(this)); } const method = options && options.once ? 'once' : 'on'; if (type === 'message') { onMessage._listener = listener; this[method](type, onMessage); } else if (type === 'close') { onClose._listener = listener; this[method](type, onClose); } else if (type === 'error') { onError._listener = listener; this[method](type, onError); } else if (type === 'open') { onOpen._listener = listener; this[method](type, onOpen); } else { this[method](type, listener); } }, /** * Remove an event listener. * * @param {String} type A string representing the event type to remove * @param {Function} listener The listener to remove * @public */ removeEventListener(type, listener) { const listeners = this.listeners(type); for (let i = 0; i < listeners.length; i++) { if (listeners[i] === listener || listeners[i]._listener === listener) { this.removeListener(type, listeners[i]); } } } }; module.exports = EventTarget; 'use strict'; // // Allowed token characters: // // '!', '#', '$', '%', '&', ''', '*', '+', '-', // '.', 0-9, A-Z, '^', '_', '`', a-z, '|', '~' // // tokenChars[32] === 0 // ' ' // tokenChars[33] === 1 // '!' // tokenChars[34] === 0 // '"' // ... // // prettier-ignore const tokenChars = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 15 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 - 31 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, // 32 - 47 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // 48 - 63 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 64 - 79 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, // 80 - 95 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 96 - 111 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0 // 112 - 127 ]; /** * Adds an offer to the map of extension offers or a parameter to the map of * parameters. * * @param {Object} dest The map of extension offers or parameters * @param {String} name The extension or parameter name * @param {(Object|Boolean|String)} elem The extension parameters or the * parameter value * @private */ function push(dest, name, elem) { if (dest[name] === undefined) dest[name] = [elem]; else dest[name].push(elem); } /** * Parses the `Sec-WebSocket-Extensions` header into an object. * * @param {String} header The field value of the header * @return {Object} The parsed object * @public */ function parse(header) { const offers = Object.create(null); if (header === undefined || header === '') return offers; let params = Object.create(null); let mustUnescape = false; let isEscaping = false; let inQuotes = false; let extensionName; let paramName; let start = -1; let end = -1; let i = 0; for (; i < header.length; i++) { const code = header.charCodeAt(i); if (extensionName === undefined) { if (end === -1 && tokenChars[code] === 1) { if (start === -1) start = i; } else if (code === 0x20 /* ' ' */ || code === 0x09 /* '\t' */) { if (end === -1 && start !== -1) end = i; } else if (code === 0x3b /* ';' */ || code === 0x2c /* ',' */) { if (start === -1) { throw new SyntaxError(`Unexpected character at index ${i}`); } if (end === -1) end = i; const name = header.slice(start, end); if (code === 0x2c) { push(offers, name, params); params = Object.create(null); } else { extensionName = name; } start = end = -1; } else { throw new SyntaxError(`Unexpected character at index ${i}`); } } else if (paramName === undefined) { if (end === -1 && tokenChars[code] === 1) { if (start === -1) start = i; } else if (code === 0x20 || code === 0x09) { if (end === -1 && start !== -1) end = i; } else if (code === 0x3b || code === 0x2c) { if (start === -1) { throw new SyntaxError(`Unexpected character at index ${i}`); } if (end === -1) end = i; push(params, header.slice(start, end), true); if (code === 0x2c) { push(offers, extensionName, params); params = Object.create(null); extensionName = undefined; } start = end = -1; } else if (code === 0x3d /* '=' */ && start !== -1 && end === -1) { paramName = header.slice(start, i); start = end = -1; } else { throw new SyntaxError(`Unexpected character at index ${i}`); } } else { // // The value of a quoted-string after unescaping must conform to the // token ABNF, so only token characters are valid. // Ref: https://tools.ietf.org/html/rfc6455#section-9.1 // if (isEscaping) { if (tokenChars[code] !== 1) { throw new SyntaxError(`Unexpected character at index ${i}`); } if (start === -1) start = i; else if (!mustUnescape) mustUnescape = true; isEscaping = false; } else if (inQuotes) { if (tokenChars[code] === 1) { if (start === -1) start = i; } else if (code === 0x22 /* '"' */ && start !== -1) { inQuotes = false; end = i; } else if (code === 0x5c /* '\' */) { isEscaping = true; } else { throw new SyntaxError(`Unexpected character at index ${i}`); } } else if (code === 0x22 && header.charCodeAt(i - 1) === 0x3d) { inQuotes = true; } else if (end === -1 && tokenChars[code] === 1) { if (start === -1) start = i; } else if (start !== -1 && (code === 0x20 || code === 0x09)) { if (end === -1) end = i; } else if (code === 0x3b || code === 0x2c) { if (start === -1) { throw new SyntaxError(`Unexpected character at index ${i}`); } if (end === -1) end = i; let value = header.slice(start, end); if (mustUnescape) { value = value.replace(/\\/g, ''); mustUnescape = false; } push(params, paramName, value); if (code === 0x2c) { push(offers, extensionName, params); params = Object.create(null); extensionName = undefined; } paramName = undefined; start = end = -1; } else { throw new SyntaxError(`Unexpected character at index ${i}`); } } } if (start === -1 || inQuotes) { throw new SyntaxError('Unexpected end of input'); } if (end === -1) end = i; const token = header.slice(start, end); if (extensionName === undefined) { push(offers, token, params); } else { if (paramName === undefined) { push(params, token, true); } else if (mustUnescape) { push(params, paramName, token.replace(/\\/g, '')); } else { push(params, paramName, token); } push(offers, extensionName, params); } return offers; } /** * Builds the `Sec-WebSocket-Extensions` header field value. * * @param {Object} extensions The map of extensions and parameters to format * @return {String} A string representing the given object * @public */ function format(extensions) { return Object.keys(extensions) .map((extension) => { let configurations = extensions[extension]; if (!Array.isArray(configurations)) configurations = [configurations]; return configurations .map((params) => { return [extension] .concat( Object.keys(params).map((k) => { let values = params[k]; if (!Array.isArray(values)) values = [values]; return values .map((v) => (v === true ? k : `${k}=${v}`)) .join('; '); }) ) .join('; '); }) .join(', '); }) .join(', '); } module.exports = { format, parse }; 'use strict'; const kDone = Symbol('kDone'); const kRun = Symbol('kRun'); /** * A very simple job queue with adjustable concurrency. Adapted from * https://github.com/STRML/async-limiter */ class Limiter { /** * Creates a new `Limiter`. * * @param {Number} [concurrency=Infinity] The maximum number of jobs allowed * to run concurrently */ constructor(concurrency) { this[kDone] = () => { this.pending--; this[kRun](); }; this.concurrency = concurrency || Infinity; this.jobs = []; this.pending = 0; } /** * Adds a job to the queue. * * @param {Function} job The job to run * @public */ add(job) { this.jobs.push(job); this[kRun](); } /** * Removes a job from the queue and runs it if possible. * * @private */ [kRun]() { if (this.pending === this.concurrency) return; if (this.jobs.length) { const job = this.jobs.shift(); this.pending++; job(this[kDone]); } } } module.exports = Limiter; 'use strict'; const zlib = require('zlib'); const bufferUtil = require('./buffer-util'); const Limiter = require('./limiter'); const { kStatusCode, NOOP } = require('./constants'); const TRAILER = Buffer.from([0x00, 0x00, 0xff, 0xff]); const kPerMessageDeflate = Symbol('permessage-deflate'); const kTotalLength = Symbol('total-length'); const kCallback = Symbol('callback'); const kBuffers = Symbol('buffers'); const kError = Symbol('error'); // // We limit zlib concurrency, which prevents severe memory fragmentation // as documented in https://github.com/nodejs/node/issues/8871#issuecomment-250915913 // and https://github.com/websockets/ws/issues/1202 // // Intentionally global; it's the global thread pool that's an issue. // let zlibLimiter; /** * permessage-deflate implementation. */ class PerMessageDeflate { /** * Creates a PerMessageDeflate instance. * * @param {Object} [options] Configuration options * @param {Boolean} [options.serverNoContextTakeover=false] Request/accept * disabling of server context takeover * @param {Boolean} [options.clientNoContextTakeover=false] Advertise/ * acknowledge disabling of client context takeover * @param {(Boolean|Number)} [options.serverMaxWindowBits] Request/confirm the * use of a custom server window size * @param {(Boolean|Number)} [options.clientMaxWindowBits] Advertise support * for, or request, a custom client window size * @param {Object} [options.zlibDeflateOptions] Options to pass to zlib on * deflate * @param {Object} [options.zlibInflateOptions] Options to pass to zlib on * inflate * @param {Number} [options.threshold=1024] Size (in bytes) below which * messages should not be compressed * @param {Number} [options.concurrencyLimit=10] The number of concurrent * calls to zlib * @param {Boolean} [isServer=false] Create the instance in either server or * client mode * @param {Number} [maxPayload=0] The maximum allowed message length */ constructor(options, isServer, maxPayload) { this._maxPayload = maxPayload | 0; this._options = options || {}; this._threshold = this._options.threshold !== undefined ? this._options.threshold : 1024; this._isServer = !!isServer; this._deflate = null; this._inflate = null; this.params = null; if (!zlibLimiter) { const concurrency = this._options.concurrencyLimit !== undefined ? this._options.concurrencyLimit : 10; zlibLimiter = new Limiter(concurrency); } } /** * @type {String} */ static get extensionName() { return 'permessage-deflate'; } /** * Create an extension negotiation offer. * * @return {Object} Extension parameters * @public */ offer() { const params = {}; if (this._options.serverNoContextTakeover) { params.server_no_context_takeover = true; } if (this._options.clientNoContextTakeover) { params.client_no_context_takeover = true; } if (this._options.serverMaxWindowBits) { params.server_max_window_bits = this._options.serverMaxWindowBits; } if (this._options.clientMaxWindowBits) { params.client_max_window_bits = this._options.clientMaxWindowBits; } else if (this._options.clientMaxWindowBits == null) { params.client_max_window_bits = true; } return params; } /** * Accept an extension negotiation offer/response. * * @param {Array} configurations The extension negotiation offers/reponse * @return {Object} Accepted configuration * @public */ accept(configurations) { configurations = this.normalizeParams(configurations); this.params = this._isServer ? this.acceptAsServer(configurations) : this.acceptAsClient(configurations); return this.params; } /** * Releases all resources used by the extension. * * @public */ cleanup() { if (this._inflate) { this._inflate.close(); this._inflate = null; } if (this._deflate) { const callback = this._deflate[kCallback]; this._deflate.close(); this._deflate = null; if (callback) { callback( new Error( 'The deflate stream was closed while data was being processed' ) ); } } } /** * Accept an extension negotiation offer. * * @param {Array} offers The extension negotiation offers * @return {Object} Accepted configuration * @private */ acceptAsServer(offers) { const opts = this._options; const accepted = offers.find((params) => { if ( (opts.serverNoContextTakeover === false && params.server_no_context_takeover) || (params.server_max_window_bits && (opts.serverMaxWindowBits === false || (typeof opts.serverMaxWindowBits === 'number' && opts.serverMaxWindowBits > params.server_max_window_bits))) || (typeof opts.clientMaxWindowBits === 'number' && !params.client_max_window_bits) ) { return false; } return true; }); if (!accepted) { throw new Error('None of the extension offers can be accepted'); } if (opts.serverNoContextTakeover) { accepted.server_no_context_takeover = true; } if (opts.clientNoContextTakeover) { accepted.client_no_context_takeover = true; } if (typeof opts.serverMaxWindowBits === 'number') { accepted.server_max_window_bits = opts.serverMaxWindowBits; } if (typeof opts.clientMaxWindowBits === 'number') { accepted.client_max_window_bits = opts.clientMaxWindowBits; } else if ( accepted.client_max_window_bits === true || opts.clientMaxWindowBits === false ) { delete accepted.client_max_window_bits; } return accepted; } /** * Accept the extension negotiation response. * * @param {Array} response The extension negotiation response * @return {Object} Accepted configuration * @private */ acceptAsClient(response) { const params = response[0]; if ( this._options.clientNoContextTakeover === false && params.client_no_context_takeover ) { throw new Error('Unexpected parameter "client_no_context_takeover"'); } if (!params.client_max_window_bits) { if (typeof this._options.clientMaxWindowBits === 'number') { params.client_max_window_bits = this._options.clientMaxWindowBits; } } else if ( this._options.clientMaxWindowBits === false || (typeof this._options.clientMaxWindowBits === 'number' && params.client_max_window_bits > this._options.clientMaxWindowBits) ) { throw new Error( 'Unexpected or invalid parameter "client_max_window_bits"' ); } return params; } /** * Normalize parameters. * * @param {Array} configurations The extension negotiation offers/reponse * @return {Array} The offers/response with normalized parameters * @private */ normalizeParams(configurations) { configurations.forEach((params) => { Object.keys(params).forEach((key) => { let value = params[key]; if (value.length > 1) { throw new Error(`Parameter "${key}" must have only a single value`); } value = value[0]; if (key === 'client_max_window_bits') { if (value !== true) { const num = +value; if (!Number.isInteger(num) || num < 8 || num > 15) { throw new TypeError( `Invalid value for parameter "${key}": ${value}` ); } value = num; } else if (!this._isServer) { throw new TypeError( `Invalid value for parameter "${key}": ${value}` ); } } else if (key === 'server_max_window_bits') { const num = +value; if (!Number.isInteger(num) || num < 8 || num > 15) { throw new TypeError( `Invalid value for parameter "${key}": ${value}` ); } value = num; } else if ( key === 'client_no_context_takeover' || key === 'server_no_context_takeover' ) { if (value !== true) { throw new TypeError( `Invalid value for parameter "${key}": ${value}` ); } } else { throw new Error(`Unknown parameter "${key}"`); } params[key] = value; }); }); return configurations; } /** * Decompress data. Concurrency limited. * * @param {Buffer} data Compressed data * @param {Boolean} fin Specifies whether or not this is the last fragment * @param {Function} callback Callback * @public */ decompress(data, fin, callback) { zlibLimiter.add((done) => { this._decompress(data, fin, (err, result) => { done(); callback(err, result); }); }); } /** * Compress data. Concurrency limited. * * @param {Buffer} data Data to compress * @param {Boolean} fin Specifies whether or not this is the last fragment * @param {Function} callback Callback * @public */ compress(data, fin, callback) { zlibLimiter.add((done) => { this._compress(data, fin, (err, result) => { done(); callback(err, result); }); }); } /** * Decompress data. * * @param {Buffer} data Compressed data * @param {Boolean} fin Specifies whether or not this is the last fragment * @param {Function} callback Callback * @private */ _decompress(data, fin, callback) { const endpoint = this._isServer ? 'client' : 'server'; if (!this._inflate) { const key = `${endpoint}_max_window_bits`; const windowBits = typeof this.params[key] !== 'number' ? zlib.Z_DEFAULT_WINDOWBITS : this.params[key]; this._inflate = zlib.createInflateRaw({ ...this._options.zlibInflateOptions, windowBits }); this._inflate[kPerMessageDeflate] = this; this._inflate[kTotalLength] = 0; this._inflate[kBuffers] = []; this._inflate.on('error', inflateOnError); this._inflate.on('data', inflateOnData); } this._inflate[kCallback] = callback; this._inflate.write(data); if (fin) this._inflate.write(TRAILER); this._inflate.flush(() => { const err = this._inflate[kError]; if (err) { this._inflate.close(); this._inflate = null; callback(err); return; } const data = bufferUtil.concat( this._inflate[kBuffers], this._inflate[kTotalLength] ); if (this._inflate._readableState.endEmitted) { this._inflate.close(); this._inflate = null; } else { this._inflate[kTotalLength] = 0; this._inflate[kBuffers] = []; if (fin && this.params[`${endpoint}_no_context_takeover`]) { this._inflate.reset(); } } callback(null, data); }); } /** * Compress data. * * @param {Buffer} data Data to compress * @param {Boolean} fin Specifies whether or not this is the last fragment * @param {Function} callback Callback * @private */ _compress(data, fin, callback) { const endpoint = this._isServer ? 'server' : 'client'; if (!this._deflate) { const key = `${endpoint}_max_window_bits`; const windowBits = typeof this.params[key] !== 'number' ? zlib.Z_DEFAULT_WINDOWBITS : this.params[key]; this._deflate = zlib.createDeflateRaw({ ...this._options.zlibDeflateOptions, windowBits }); this._deflate[kTotalLength] = 0; this._deflate[kBuffers] = []; // // An `'error'` event is emitted, only on Node.js < 10.0.0, if the // `zlib.DeflateRaw` instance is closed while data is being processed. // This can happen if `PerMessageDeflate#cleanup()` is called at the wrong // time due to an abnormal WebSocket closure. // this._deflate.on('error', NOOP); this._deflate.on('data', deflateOnData); } this._deflate[kCallback] = callback; this._deflate.write(data); this._deflate.flush(zlib.Z_SYNC_FLUSH, () => { if (!this._deflate) { // // The deflate stream was closed while data was being processed. // return; } let data = bufferUtil.concat( this._deflate[kBuffers], this._deflate[kTotalLength] ); if (fin) data = data.slice(0, data.length - 4); // // Ensure that the callback will not be called again in // `PerMessageDeflate#cleanup()`. // this._deflate[kCallback] = null; this._deflate[kTotalLength] = 0; this._deflate[kBuffers] = []; if (fin && this.params[`${endpoint}_no_context_takeover`]) { this._deflate.reset(); } callback(null, data); }); } } module.exports = PerMessageDeflate; /** * The listener of the `zlib.DeflateRaw` stream `'data'` event. * * @param {Buffer} chunk A chunk of data * @private */ function deflateOnData(chunk) { this[kBuffers].push(chunk); this[kTotalLength] += chunk.length; } /** * The listener of the `zlib.InflateRaw` stream `'data'` event. * * @param {Buffer} chunk A chunk of data * @private */ function inflateOnData(chunk) { this[kTotalLength] += chunk.length; if ( this[kPerMessageDeflate]._maxPayload < 1 || this[kTotalLength] <= this[kPerMessageDeflate]._maxPayload ) { this[kBuffers].push(chunk); return; } this[kError] = new RangeError('Max payload size exceeded'); this[kError][kStatusCode] = 1009; this.removeListener('data', inflateOnData); this.reset(); } /** * The listener of the `zlib.InflateRaw` stream `'error'` event. * * @param {Error} err The emitted error * @private */ function inflateOnError(err) { // // There is no need to call `Zlib#close()` as the handle is automatically // closed when an error is emitted. // this[kPerMessageDeflate]._inflate = null; err[kStatusCode] = 1007; this[kCallback](err); } 'use strict'; const { Writable } = require('stream'); const PerMessageDeflate = require('./permessage-deflate'); const { BINARY_TYPES, EMPTY_BUFFER, kStatusCode, kWebSocket } = require('./constants'); const { concat, toArrayBuffer, unmask } = require('./buffer-util'); const { isValidStatusCode, isValidUTF8 } = require('./validation'); const GET_INFO = 0; const GET_PAYLOAD_LENGTH_16 = 1; const GET_PAYLOAD_LENGTH_64 = 2; const GET_MASK = 3; const GET_DATA = 4; const INFLATING = 5; /** * HyBi Receiver implementation. * * @extends stream.Writable */ class Receiver extends Writable { /** * Creates a Receiver instance. * * @param {String} [binaryType=nodebuffer] The type for binary data * @param {Object} [extensions] An object containing the negotiated extensions * @param {Boolean} [isServer=false] Specifies whether to operate in client or * server mode * @param {Number} [maxPayload=0] The maximum allowed message length */ constructor(binaryType, extensions, isServer, maxPayload) { super(); this._binaryType = binaryType || BINARY_TYPES[0]; this[kWebSocket] = undefined; this._extensions = extensions || {}; this._isServer = !!isServer; this._maxPayload = maxPayload | 0; this._bufferedBytes = 0; this._buffers = []; this._compressed = false; this._payloadLength = 0; this._mask = undefined; this._fragmented = 0; this._masked = false; this._fin = false; this._opcode = 0; this._totalPayloadLength = 0; this._messageLength = 0; this._fragments = []; this._state = GET_INFO; this._loop = false; } /** * Implements `Writable.prototype._write()`. * * @param {Buffer} chunk The chunk of data to write * @param {String} encoding The character encoding of `chunk` * @param {Function} cb Callback * @private */ _write(chunk, encoding, cb) { if (this._opcode === 0x08 && this._state == GET_INFO) return cb(); this._bufferedBytes += chunk.length; this._buffers.push(chunk); this.startLoop(cb); } /** * Consumes `n` bytes from the buffered data. * * @param {Number} n The number of bytes to consume * @return {Buffer} The consumed bytes * @private */ consume(n) { this._bufferedBytes -= n; if (n === this._buffers[0].length) return this._buffers.shift(); if (n < this._buffers[0].length) { const buf = this._buffers[0]; this._buffers[0] = buf.slice(n); return buf.slice(0, n); } const dst = Buffer.allocUnsafe(n); do { const buf = this._buffers[0]; const offset = dst.length - n; if (n >= buf.length) { dst.set(this._buffers.shift(), offset); } else { dst.set(new Uint8Array(buf.buffer, buf.byteOffset, n), offset); this._buffers[0] = buf.slice(n); } n -= buf.length; } while (n > 0); return dst; } /** * Starts the parsing loop. * * @param {Function} cb Callback * @private */ startLoop(cb) { let err; this._loop = true; do { switch (this._state) { case GET_INFO: err = this.getInfo(); break; case GET_PAYLOAD_LENGTH_16: err = this.getPayloadLength16(); break; case GET_PAYLOAD_LENGTH_64: err = this.getPayloadLength64(); break; case GET_MASK: this.getMask(); break; case GET_DATA: err = this.getData(cb); break; default: // `INFLATING` this._loop = false; return; } } while (this._loop); cb(err); } /** * Reads the first two bytes of a frame. * * @return {(RangeError|undefined)} A possible error * @private */ getInfo() { if (this._bufferedBytes < 2) { this._loop = false; return; } const buf = this.consume(2); if ((buf[0] & 0x30) !== 0x00) { this._loop = false; return error(RangeError, 'RSV2 and RSV3 must be clear', true, 1002); } const compressed = (buf[0] & 0x40) === 0x40; if (compressed && !this._extensions[PerMessageDeflate.extensionName]) { this._loop = false; return error(RangeError, 'RSV1 must be clear', true, 1002); } this._fin = (buf[0] & 0x80) === 0x80; this._opcode = buf[0] & 0x0f; this._payloadLength = buf[1] & 0x7f; if (this._opcode === 0x00) { if (compressed) { this._loop = false; return error(RangeError, 'RSV1 must be clear', true, 1002); } if (!this._fragmented) { this._loop = false; return error(RangeError, 'invalid opcode 0', true, 1002); } this._opcode = this._fragmented; } else if (this._opcode === 0x01 || this._opcode === 0x02) { if (this._fragmented) { this._loop = false; return error(RangeError, `invalid opcode ${this._opcode}`, true, 1002); } this._compressed = compressed; } else if (this._opcode > 0x07 && this._opcode < 0x0b) { if (!this._fin) { this._loop = false; return error(RangeError, 'FIN must be set', true, 1002); } if (compressed) { this._loop = false; return error(RangeError, 'RSV1 must be clear', true, 1002); } if (this._payloadLength > 0x7d) { this._loop = false; return error( RangeError, `invalid payload length ${this._payloadLength}`, true, 1002 ); } } else { this._loop = false; return error(RangeError, `invalid opcode ${this._opcode}`, true, 1002); } if (!this._fin && !this._fragmented) this._fragmented = this._opcode; this._masked = (buf[1] & 0x80) === 0x80; if (this._isServer) { if (!this._masked) { this._loop = false; return error(RangeError, 'MASK must be set', true, 1002); } } else if (this._masked) { this._loop = false; return error(RangeError, 'MASK must be clear', true, 1002); } if (this._payloadLength === 126) this._state = GET_PAYLOAD_LENGTH_16; else if (this._payloadLength === 127) this._state = GET_PAYLOAD_LENGTH_64; else return this.haveLength(); } /** * Gets extended payload length (7+16). * * @return {(RangeError|undefined)} A possible error * @private */ getPayloadLength16() { if (this._bufferedBytes < 2) { this._loop = false; return; } this._payloadLength = this.consume(2).readUInt16BE(0); return this.haveLength(); } /** * Gets extended payload length (7+64). * * @return {(RangeError|undefined)} A possible error * @private */ getPayloadLength64() { if (this._bufferedBytes < 8) { this._loop = false; return; } const buf = this.consume(8); const num = buf.readUInt32BE(0); // // The maximum safe integer in JavaScript is 2^53 - 1. An error is returned // if payload length is greater than this number. // if (num > Math.pow(2, 53 - 32) - 1) { this._loop = false; return error( RangeError, 'Unsupported WebSocket frame: payload length > 2^53 - 1', false, 1009 ); } this._payloadLength = num * Math.pow(2, 32) + buf.readUInt32BE(4); return this.haveLength(); } /** * Payload length has been read. * * @return {(RangeError|undefined)} A possible error * @private */ haveLength() { if (this._payloadLength && this._opcode < 0x08) { this._totalPayloadLength += this._payloadLength; if (this._totalPayloadLength > this._maxPayload && this._maxPayload > 0) { this._loop = false; return error(RangeError, 'Max payload size exceeded', false, 1009); } } if (this._masked) this._state = GET_MASK; else this._state = GET_DATA; } /** * Reads mask bytes. * * @private */ getMask() { if (this._bufferedBytes < 4) { this._loop = false; return; } this._mask = this.consume(4); this._state = GET_DATA; } /** * Reads data bytes. * * @param {Function} cb Callback * @return {(Error|RangeError|undefined)} A possible error * @private */ getData(cb) { let data = EMPTY_BUFFER; if (this._payloadLength) { if (this._bufferedBytes < this._payloadLength) { this._loop = false; return; } data = this.consume(this._payloadLength); if (this._masked) unmask(data, this._mask); } if (this._opcode > 0x07) return this.controlMessage(data); if (this._compressed) { this._state = INFLATING; this.decompress(data, cb); return; } if (data.length) { // // This message is not compressed so its lenght is the sum of the payload // length of all fragments. // this._messageLength = this._totalPayloadLength; this._fragments.push(data); } return this.dataMessage(); } /** * Decompresses data. * * @param {Buffer} data Compressed data * @param {Function} cb Callback * @private */ decompress(data, cb) { const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName]; perMessageDeflate.decompress(data, this._fin, (err, buf) => { if (err) return cb(err); if (buf.length) { this._messageLength += buf.length; if (this._messageLength > this._maxPayload && this._maxPayload > 0) { return cb( error(RangeError, 'Max payload size exceeded', false, 1009) ); } this._fragments.push(buf); } const er = this.dataMessage(); if (er) return cb(er); this.startLoop(cb); }); } /** * Handles a data message. * * @return {(Error|undefined)} A possible error * @private */ dataMessage() { if (this._fin) { const messageLength = this._messageLength; const fragments = this._fragments; this._totalPayloadLength = 0; this._messageLength = 0; this._fragmented = 0; this._fragments = []; if (this._opcode === 2) { let data; if (this._binaryType === 'nodebuffer') { data = concat(fragments, messageLength); } else if (this._binaryType === 'arraybuffer') { data = toArrayBuffer(concat(fragments, messageLength)); } else { data = fragments; } this.emit('message', data); } else { const buf = concat(fragments, messageLength); if (!isValidUTF8(buf)) { this._loop = false; return error(Error, 'invalid UTF-8 sequence', true, 1007); } this.emit('message', buf.toString()); } } this._state = GET_INFO; } /** * Handles a control message. * * @param {Buffer} data Data to handle * @return {(Error|RangeError|undefined)} A possible error * @private */ controlMessage(data) { if (this._opcode === 0x08) { this._loop = false; if (data.length === 0) { this.emit('conclude', 1005, ''); this.end(); } else if (data.length === 1) { return error(RangeError, 'invalid payload length 1', true, 1002); } else { const code = data.readUInt16BE(0); if (!isValidStatusCode(code)) { return error(RangeError, `invalid status code ${code}`, true, 1002); } const buf = data.slice(2); if (!isValidUTF8(buf)) { return error(Error, 'invalid UTF-8 sequence', true, 1007); } this.emit('conclude', code, buf.toString()); this.end(); } } else if (this._opcode === 0x09) { this.emit('ping', data); } else { this.emit('pong', data); } this._state = GET_INFO; } } module.exports = Receiver; /** * Builds an error object. * * @param {(Error|RangeError)} ErrorCtor The error constructor * @param {String} message The error message * @param {Boolean} prefix Specifies whether or not to add a default prefix to * `message` * @param {Number} statusCode The status code * @return {(Error|RangeError)} The error * @private */ function error(ErrorCtor, message, prefix, statusCode) { const err = new ErrorCtor( prefix ? `Invalid WebSocket frame: ${message}` : message ); Error.captureStackTrace(err, error); err[kStatusCode] = statusCode; return err; } 'use strict'; const { randomFillSync } = require('crypto'); const PerMessageDeflate = require('./permessage-deflate'); const { EMPTY_BUFFER } = require('./constants'); const { isValidStatusCode } = require('./validation'); const { mask: applyMask, toBuffer } = require('./buffer-util'); const mask = Buffer.alloc(4); /** * HyBi Sender implementation. */ class Sender { /** * Creates a Sender instance. * * @param {net.Socket} socket The connection socket * @param {Object} [extensions] An object containing the negotiated extensions */ constructor(socket, extensions) { this._extensions = extensions || {}; this._socket = socket; this._firstFragment = true; this._compress = false; this._bufferedBytes = 0; this._deflating = false; this._queue = []; } /** * Frames a piece of data according to the HyBi WebSocket protocol. * * @param {Buffer} data The data to frame * @param {Object} options Options object * @param {Number} options.opcode The opcode * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be * modified * @param {Boolean} [options.fin=false] Specifies whether or not to set the * FIN bit * @param {Boolean} [options.mask=false] Specifies whether or not to mask * `data` * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the * RSV1 bit * @return {Buffer[]} The framed data as a list of `Buffer` instances * @public */ static frame(data, options) { const merge = options.mask && options.readOnly; let offset = options.mask ? 6 : 2; let payloadLength = data.length; if (data.length >= 65536) { offset += 8; payloadLength = 127; } else if (data.length > 125) { offset += 2; payloadLength = 126; } const target = Buffer.allocUnsafe(merge ? data.length + offset : offset); target[0] = options.fin ? options.opcode | 0x80 : options.opcode; if (options.rsv1) target[0] |= 0x40; target[1] = payloadLength; if (payloadLength === 126) { target.writeUInt16BE(data.length, 2); } else if (payloadLength === 127) { target.writeUInt32BE(0, 2); target.writeUInt32BE(data.length, 6); } if (!options.mask) return [target, data]; randomFillSync(mask, 0, 4); target[1] |= 0x80; target[offset - 4] = mask[0]; target[offset - 3] = mask[1]; target[offset - 2] = mask[2]; target[offset - 1] = mask[3]; if (merge) { applyMask(data, mask, target, offset, data.length); return [target]; } applyMask(data, mask, data, 0, data.length); return [target, data]; } /** * Sends a close message to the other peer. * * @param {Number} [code] The status code component of the body * @param {String} [data] The message component of the body * @param {Boolean} [mask=false] Specifies whether or not to mask the message * @param {Function} [cb] Callback * @public */ close(code, data, mask, cb) { let buf; if (code === undefined) { buf = EMPTY_BUFFER; } else if (typeof code !== 'number' || !isValidStatusCode(code)) { throw new TypeError('First argument must be a valid error code number'); } else if (data === undefined || data === '') { buf = Buffer.allocUnsafe(2); buf.writeUInt16BE(code, 0); } else { const length = Buffer.byteLength(data); if (length > 123) { throw new RangeError('The message must not be greater than 123 bytes'); } buf = Buffer.allocUnsafe(2 + length); buf.writeUInt16BE(code, 0); buf.write(data, 2); } if (this._deflating) { this.enqueue([this.doClose, buf, mask, cb]); } else { this.doClose(buf, mask, cb); } } /** * Frames and sends a close message. * * @param {Buffer} data The message to send * @param {Boolean} [mask=false] Specifies whether or not to mask `data` * @param {Function} [cb] Callback * @private */ doClose(data, mask, cb) { this.sendFrame( Sender.frame(data, { fin: true, rsv1: false, opcode: 0x08, mask, readOnly: false }), cb ); } /** * Sends a ping message to the other peer. * * @param {*} data The message to send * @param {Boolean} [mask=false] Specifies whether or not to mask `data` * @param {Function} [cb] Callback * @public */ ping(data, mask, cb) { const buf = toBuffer(data); if (buf.length > 125) { throw new RangeError('The data size must not be greater than 125 bytes'); } if (this._deflating) { this.enqueue([this.doPing, buf, mask, toBuffer.readOnly, cb]); } else { this.doPing(buf, mask, toBuffer.readOnly, cb); } } /** * Frames and sends a ping message. * * @param {Buffer} data The message to send * @param {Boolean} [mask=false] Specifies whether or not to mask `data` * @param {Boolean} [readOnly=false] Specifies whether `data` can be modified * @param {Function} [cb] Callback * @private */ doPing(data, mask, readOnly, cb) { this.sendFrame( Sender.frame(data, { fin: true, rsv1: false, opcode: 0x09, mask, readOnly }), cb ); } /** * Sends a pong message to the other peer. * * @param {*} data The message to send * @param {Boolean} [mask=false] Specifies whether or not to mask `data` * @param {Function} [cb] Callback * @public */ pong(data, mask, cb) { const buf = toBuffer(data); if (buf.length > 125) { throw new RangeError('The data size must not be greater than 125 bytes'); } if (this._deflating) { this.enqueue([this.doPong, buf, mask, toBuffer.readOnly, cb]); } else { this.doPong(buf, mask, toBuffer.readOnly, cb); } } /** * Frames and sends a pong message. * * @param {Buffer} data The message to send * @param {Boolean} [mask=false] Specifies whether or not to mask `data` * @param {Boolean} [readOnly=false] Specifies whether `data` can be modified * @param {Function} [cb] Callback * @private */ doPong(data, mask, readOnly, cb) { this.sendFrame( Sender.frame(data, { fin: true, rsv1: false, opcode: 0x0a, mask, readOnly }), cb ); } /** * Sends a data message to the other peer. * * @param {*} data The message to send * @param {Object} options Options object * @param {Boolean} [options.compress=false] Specifies whether or not to * compress `data` * @param {Boolean} [options.binary=false] Specifies whether `data` is binary * or text * @param {Boolean} [options.fin=false] Specifies whether the fragment is the * last one * @param {Boolean} [options.mask=false] Specifies whether or not to mask * `data` * @param {Function} [cb] Callback * @public */ send(data, options, cb) { const buf = toBuffer(data); const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName]; let opcode = options.binary ? 2 : 1; let rsv1 = options.compress; if (this._firstFragment) { this._firstFragment = false; if (rsv1 && perMessageDeflate) { rsv1 = buf.length >= perMessageDeflate._threshold; } this._compress = rsv1; } else { rsv1 = false; opcode = 0; } if (options.fin) this._firstFragment = true; if (perMessageDeflate) { const opts = { fin: options.fin, rsv1, opcode, mask: options.mask, readOnly: toBuffer.readOnly }; if (this._deflating) { this.enqueue([this.dispatch, buf, this._compress, opts, cb]); } else { this.dispatch(buf, this._compress, opts, cb); } } else { this.sendFrame( Sender.frame(buf, { fin: options.fin, rsv1: false, opcode, mask: options.mask, readOnly: toBuffer.readOnly }), cb ); } } /** * Dispatches a data message. * * @param {Buffer} data The message to send * @param {Boolean} [compress=false] Specifies whether or not to compress * `data` * @param {Object} options Options object * @param {Number} options.opcode The opcode * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be * modified * @param {Boolean} [options.fin=false] Specifies whether or not to set the * FIN bit * @param {Boolean} [options.mask=false] Specifies whether or not to mask * `data` * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the * RSV1 bit * @param {Function} [cb] Callback * @private */ dispatch(data, compress, options, cb) { if (!compress) { this.sendFrame(Sender.frame(data, options), cb); return; } const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName]; this._bufferedBytes += data.length; this._deflating = true; perMessageDeflate.compress(data, options.fin, (_, buf) => { if (this._socket.destroyed) { const err = new Error( 'The socket was closed while data was being compressed' ); if (typeof cb === 'function') cb(err); for (let i = 0; i < this._queue.length; i++) { const callback = this._queue[i][4]; if (typeof callback === 'function') callback(err); } return; } this._bufferedBytes -= data.length; this._deflating = false; options.readOnly = false; this.sendFrame(Sender.frame(buf, options), cb); this.dequeue(); }); } /** * Executes queued send operations. * * @private */ dequeue() { while (!this._deflating && this._queue.length) { const params = this._queue.shift(); this._bufferedBytes -= params[1].length; Reflect.apply(params[0], this, params.slice(1)); } } /** * Enqueues a send operation. * * @param {Array} params Send operation parameters. * @private */ enqueue(params) { this._bufferedBytes += params[1].length; this._queue.push(params); } /** * Sends a frame. * * @param {Buffer[]} list The frame to send * @param {Function} [cb] Callback * @private */ sendFrame(list, cb) { if (list.length === 2) { this._socket.cork(); this._socket.write(list[0]); this._socket.write(list[1], cb); this._socket.uncork(); } else { this._socket.write(list[0], cb); } } } module.exports = Sender; 'use strict'; const { Duplex } = require('stream'); /** * Emits the `'close'` event on a stream. * * @param {stream.Duplex} The stream. * @private */ function emitClose(stream) { stream.emit('close'); } /** * The listener of the `'end'` event. * * @private */ function duplexOnEnd() { if (!this.destroyed && this._writableState.finished) { this.destroy(); } } /** * The listener of the `'error'` event. * * @param {Error} err The error * @private */ function duplexOnError(err) { this.removeListener('error', duplexOnError); this.destroy(); if (this.listenerCount('error') === 0) { // Do not suppress the throwing behavior. this.emit('error', err); } } /** * Wraps a `WebSocket` in a duplex stream. * * @param {WebSocket} ws The `WebSocket` to wrap * @param {Object} [options] The options for the `Duplex` constructor * @return {stream.Duplex} The duplex stream * @public */ function createWebSocketStream(ws, options) { let resumeOnReceiverDrain = true; function receiverOnDrain() { if (resumeOnReceiverDrain) ws._socket.resume(); } if (ws.readyState === ws.CONNECTING) { ws.once('open', function open() { ws._receiver.removeAllListeners('drain'); ws._receiver.on('drain', receiverOnDrain); }); } else { ws._receiver.removeAllListeners('drain'); ws._receiver.on('drain', receiverOnDrain); } const duplex = new Duplex({ ...options, autoDestroy: false, emitClose: false, objectMode: false, writableObjectMode: false }); ws.on('message', function message(msg) { if (!duplex.push(msg)) { resumeOnReceiverDrain = false; ws._socket.pause(); } }); ws.once('error', function error(err) { if (duplex.destroyed) return; duplex.destroy(err); }); ws.once('close', function close() { if (duplex.destroyed) return; duplex.push(null); }); duplex._destroy = function (err, callback) { if (ws.readyState === ws.CLOSED) { callback(err); process.nextTick(emitClose, duplex); return; } let called = false; ws.once('error', function error(err) { called = true; callback(err); }); ws.once('close', function close() { if (!called) callback(err); process.nextTick(emitClose, duplex); }); ws.terminate(); }; duplex._final = function (callback) { if (ws.readyState === ws.CONNECTING) { ws.once('open', function open() { duplex._final(callback); }); return; } // If the value of the `_socket` property is `null` it means that `ws` is a // client websocket and the handshake failed. In fact, when this happens, a // socket is never assigned to the websocket. Wait for the `'error'` event // that will be emitted by the websocket. if (ws._socket === null) return; if (ws._socket._writableState.finished) { callback(); if (duplex._readableState.endEmitted) duplex.destroy(); } else { ws._socket.once('finish', function finish() { // `duplex` is not destroyed here because the `'end'` event will be // emitted on `duplex` after this `'finish'` event. The EOF signaling // `null` chunk is, in fact, pushed when the websocket emits `'close'`. callback(); }); ws.close(); } }; duplex._read = function () { if (ws.readyState === ws.OPEN && !resumeOnReceiverDrain) { resumeOnReceiverDrain = true; if (!ws._receiver._writableState.needDrain) ws._socket.resume(); } }; duplex._write = function (chunk, encoding, callback) { if (ws.readyState === ws.CONNECTING) { ws.once('open', function open() { duplex._write(chunk, encoding, callback); }); return; } ws.send(chunk, callback); }; duplex.on('end', duplexOnEnd); duplex.on('error', duplexOnError); return duplex; } module.exports = createWebSocketStream; 'use strict'; /** * Checks if a status code is allowed in a close frame. * * @param {Number} code The status code * @return {Boolean} `true` if the status code is valid, else `false` * @public */ function isValidStatusCode(code) { return ( (code >= 1000 && code <= 1014 && code !== 1004 && code !== 1005 && code !== 1006) || (code >= 3000 && code <= 4999) ); } /** * Checks if a given buffer contains only correct UTF-8. * Ported from https://www.cl.cam.ac.uk/%7Emgk25/ucs/utf8_check.c by * Markus Kuhn. * * @param {Buffer} buf The buffer to check * @return {Boolean} `true` if `buf` contains only correct UTF-8, else `false` * @public */ function _isValidUTF8(buf) { const len = buf.length; let i = 0; while (i < len) { if ((buf[i] & 0x80) === 0) { // 0xxxxxxx i++; } else if ((buf[i] & 0xe0) === 0xc0) { // 110xxxxx 10xxxxxx if ( i + 1 === len || (buf[i + 1] & 0xc0) !== 0x80 || (buf[i] & 0xfe) === 0xc0 // Overlong ) { return false; } i += 2; } else if ((buf[i] & 0xf0) === 0xe0) { // 1110xxxx 10xxxxxx 10xxxxxx if ( i + 2 >= len || (buf[i + 1] & 0xc0) !== 0x80 || (buf[i + 2] & 0xc0) !== 0x80 || (buf[i] === 0xe0 && (buf[i + 1] & 0xe0) === 0x80) || // Overlong (buf[i] === 0xed && (buf[i + 1] & 0xe0) === 0xa0) // Surrogate (U+D800 - U+DFFF) ) { return false; } i += 3; } else if ((buf[i] & 0xf8) === 0xf0) { // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx if ( i + 3 >= len || (buf[i + 1] & 0xc0) !== 0x80 || (buf[i + 2] & 0xc0) !== 0x80 || (buf[i + 3] & 0xc0) !== 0x80 || (buf[i] === 0xf0 && (buf[i + 1] & 0xf0) === 0x80) || // Overlong (buf[i] === 0xf4 && buf[i + 1] > 0x8f) || buf[i] > 0xf4 // > U+10FFFF ) { return false; } i += 4; } else { return false; } } return true; } try { let isValidUTF8 = require('utf-8-validate'); /* istanbul ignore if */ if (typeof isValidUTF8 === 'object') { isValidUTF8 = isValidUTF8.Validation.isValidUTF8; // utf-8-validate@<3.0.0 } module.exports = { isValidStatusCode, isValidUTF8(buf) { return buf.length < 150 ? _isValidUTF8(buf) : isValidUTF8(buf); } }; } catch (e) /* istanbul ignore next */ { module.exports = { isValidStatusCode, isValidUTF8: _isValidUTF8 }; } 'use strict'; const EventEmitter = require('events'); const { createHash } = require('crypto'); const { createServer, STATUS_CODES } = require('http'); const PerMessageDeflate = require('./permessage-deflate'); const WebSocket = require('./websocket'); const { format, parse } = require('./extension'); const { GUID, kWebSocket } = require('./constants'); const keyRegex = /^[+/0-9A-Za-z]{22}==$/; /** * Class representing a WebSocket server. * * @extends EventEmitter */ class WebSocketServer extends EventEmitter { /** * Create a `WebSocketServer` instance. * * @param {Object} options Configuration options * @param {Number} [options.backlog=511] The maximum length of the queue of * pending connections * @param {Boolean} [options.clientTracking=true] Specifies whether or not to * track clients * @param {Function} [options.handleProtocols] A hook to handle protocols * @param {String} [options.host] The hostname where to bind the server * @param {Number} [options.maxPayload=104857600] The maximum allowed message * size * @param {Boolean} [options.noServer=false] Enable no server mode * @param {String} [options.path] Accept only connections matching this path * @param {(Boolean|Object)} [options.perMessageDeflate=false] Enable/disable * permessage-deflate * @param {Number} [options.port] The port where to bind the server * @param {http.Server} [options.server] A pre-created HTTP/S server to use * @param {Function} [options.verifyClient] A hook to reject connections * @param {Function} [callback] A listener for the `listening` event */ constructor(options, callback) { super(); options = { maxPayload: 100 * 1024 * 1024, perMessageDeflate: false, handleProtocols: null, clientTracking: true, verifyClient: null, noServer: false, backlog: null, // use default (511 as implemented in net.js) server: null, host: null, path: null, port: null, ...options }; if (options.port == null && !options.server && !options.noServer) { throw new TypeError( 'One of the "port", "server", or "noServer" options must be specified' ); } if (options.port != null) { this._server = createServer((req, res) => { const body = STATUS_CODES[426]; res.writeHead(426, { 'Content-Length': body.length, 'Content-Type': 'text/plain' }); res.end(body); }); this._server.listen( options.port, options.host, options.backlog, callback ); } else if (options.server) { this._server = options.server; } if (this._server) { const emitConnection = this.emit.bind(this, 'connection'); this._removeListeners = addListeners(this._server, { listening: this.emit.bind(this, 'listening'), error: this.emit.bind(this, 'error'), upgrade: (req, socket, head) => { this.handleUpgrade(req, socket, head, emitConnection); } }); } if (options.perMessageDeflate === true) options.perMessageDeflate = {}; if (options.clientTracking) this.clients = new Set(); this.options = options; } /** * Returns the bound address, the address family name, and port of the server * as reported by the operating system if listening on an IP socket. * If the server is listening on a pipe or UNIX domain socket, the name is * returned as a string. * * @return {(Object|String|null)} The address of the server * @public */ address() { if (this.options.noServer) { throw new Error('The server is operating in "noServer" mode'); } if (!this._server) return null; return this._server.address(); } /** * Close the server. * * @param {Function} [cb] Callback * @public */ close(cb) { if (cb) this.once('close', cb); // // Terminate all associated clients. // if (this.clients) { for (const client of this.clients) client.terminate(); } const server = this._server; if (server) { this._removeListeners(); this._removeListeners = this._server = null; // // Close the http server if it was internally created. // if (this.options.port != null) { server.close(() => this.emit('close')); return; } } process.nextTick(emitClose, this); } /** * See if a given request should be handled by this server instance. * * @param {http.IncomingMessage} req Request object to inspect * @return {Boolean} `true` if the request is valid, else `false` * @public */ shouldHandle(req) { if (this.options.path) { const index = req.url.indexOf('?'); const pathname = index !== -1 ? req.url.slice(0, index) : req.url; if (pathname !== this.options.path) return false; } return true; } /** * Handle a HTTP Upgrade request. * * @param {http.IncomingMessage} req The request object * @param {net.Socket} socket The network socket between the server and client * @param {Buffer} head The first packet of the upgraded stream * @param {Function} cb Callback * @public */ handleUpgrade(req, socket, head, cb) { socket.on('error', socketOnError); const key = req.headers['sec-websocket-key'] !== undefined ? req.headers['sec-websocket-key'].trim() : false; const version = +req.headers['sec-websocket-version']; const extensions = {}; if ( req.method !== 'GET' || req.headers.upgrade.toLowerCase() !== 'websocket' || !key || !keyRegex.test(key) || (version !== 8 && version !== 13) || !this.shouldHandle(req) ) { return abortHandshake(socket, 400); } if (this.options.perMessageDeflate) { const perMessageDeflate = new PerMessageDeflate( this.options.perMessageDeflate, true, this.options.maxPayload ); try { const offers = parse(req.headers['sec-websocket-extensions']); if (offers[PerMessageDeflate.extensionName]) { perMessageDeflate.accept(offers[PerMessageDeflate.extensionName]); extensions[PerMessageDeflate.extensionName] = perMessageDeflate; } } catch (err) { return abortHandshake(socket, 400); } } // // Optionally call external client verification handler. // if (this.options.verifyClient) { const info = { origin: req.headers[`${version === 8 ? 'sec-websocket-origin' : 'origin'}`], secure: !!(req.socket.authorized || req.socket.encrypted), req }; if (this.options.verifyClient.length === 2) { this.options.verifyClient(info, (verified, code, message, headers) => { if (!verified) { return abortHandshake(socket, code || 401, message, headers); } this.completeUpgrade(key, extensions, req, socket, head, cb); }); return; } if (!this.options.verifyClient(info)) return abortHandshake(socket, 401); } this.completeUpgrade(key, extensions, req, socket, head, cb); } /** * Upgrade the connection to WebSocket. * * @param {String} key The value of the `Sec-WebSocket-Key` header * @param {Object} extensions The accepted extensions * @param {http.IncomingMessage} req The request object * @param {net.Socket} socket The network socket between the server and client * @param {Buffer} head The first packet of the upgraded stream * @param {Function} cb Callback * @throws {Error} If called more than once with the same socket * @private */ completeUpgrade(key, extensions, req, socket, head, cb) { // // Destroy the socket if the client has already sent a FIN packet. // if (!socket.readable || !socket.writable) return socket.destroy(); if (socket[kWebSocket]) { throw new Error( 'server.handleUpgrade() was called more than once with the same ' + 'socket, possibly due to a misconfiguration' ); } const digest = createHash('sha1') .update(key + GUID) .digest('base64'); const headers = [ 'HTTP/1.1 101 Switching Protocols', 'Upgrade: websocket', 'Connection: Upgrade', `Sec-WebSocket-Accept: ${digest}` ]; const ws = new WebSocket(null); let protocol = req.headers['sec-websocket-protocol']; if (protocol) { protocol = protocol.split(',').map(trim); // // Optionally call external protocol selection handler. // if (this.options.handleProtocols) { protocol = this.options.handleProtocols(protocol, req); } else { protocol = protocol[0]; } if (protocol) { headers.push(`Sec-WebSocket-Protocol: ${protocol}`); ws._protocol = protocol; } } if (extensions[PerMessageDeflate.extensionName]) { const params = extensions[PerMessageDeflate.extensionName].params; const value = format({ [PerMessageDeflate.extensionName]: [params] }); headers.push(`Sec-WebSocket-Extensions: ${value}`); ws._extensions = extensions; } // // Allow external modification/inspection of handshake headers. // this.emit('headers', headers, req); socket.write(headers.concat('\r\n').join('\r\n')); socket.removeListener('error', socketOnError); ws.setSocket(socket, head, this.options.maxPayload); if (this.clients) { this.clients.add(ws); ws.on('close', () => this.clients.delete(ws)); } cb(ws, req); } } module.exports = WebSocketServer; /** * Add event listeners on an `EventEmitter` using a map of * pairs. * * @param {EventEmitter} server The event emitter * @param {Object.} map The listeners to add * @return {Function} A function that will remove the added listeners when * called * @private */ function addListeners(server, map) { for (const event of Object.keys(map)) server.on(event, map[event]); return function removeListeners() { for (const event of Object.keys(map)) { server.removeListener(event, map[event]); } }; } /** * Emit a `'close'` event on an `EventEmitter`. * * @param {EventEmitter} server The event emitter * @private */ function emitClose(server) { server.emit('close'); } /** * Handle premature socket errors. * * @private */ function socketOnError() { this.destroy(); } /** * Close the connection when preconditions are not fulfilled. * * @param {net.Socket} socket The socket of the upgrade request * @param {Number} code The HTTP response status code * @param {String} [message] The HTTP response body * @param {Object} [headers] Additional HTTP response headers * @private */ function abortHandshake(socket, code, message, headers) { if (socket.writable) { message = message || STATUS_CODES[code]; headers = { Connection: 'close', 'Content-Type': 'text/html', 'Content-Length': Buffer.byteLength(message), ...headers }; socket.write( `HTTP/1.1 ${code} ${STATUS_CODES[code]}\r\n` + Object.keys(headers) .map((h) => `${h}: ${headers[h]}`) .join('\r\n') + '\r\n\r\n' + message ); } socket.removeListener('error', socketOnError); socket.destroy(); } /** * Remove whitespace characters from both ends of a string. * * @param {String} str The string * @return {String} A new string representing `str` stripped of whitespace * characters from both its beginning and end * @private */ function trim(str) { return str.trim(); } 'use strict'; const EventEmitter = require('events'); const https = require('https'); const http = require('http'); const net = require('net'); const tls = require('tls'); const { randomBytes, createHash } = require('crypto'); const { URL } = require('url'); const PerMessageDeflate = require('./permessage-deflate'); const Receiver = require('./receiver'); const Sender = require('./sender'); const { BINARY_TYPES, EMPTY_BUFFER, GUID, kStatusCode, kWebSocket, NOOP } = require('./constants'); const { addEventListener, removeEventListener } = require('./event-target'); const { format, parse } = require('./extension'); const { toBuffer } = require('./buffer-util'); const readyStates = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED']; const protocolVersions = [8, 13]; const closeTimeout = 30 * 1000; /** * Class representing a WebSocket. * * @extends EventEmitter */ class WebSocket extends EventEmitter { /** * Create a new `WebSocket`. * * @param {(String|url.URL)} address The URL to which to connect * @param {(String|String[])} [protocols] The subprotocols * @param {Object} [options] Connection options */ constructor(address, protocols, options) { super(); this._binaryType = BINARY_TYPES[0]; this._closeCode = 1006; this._closeFrameReceived = false; this._closeFrameSent = false; this._closeMessage = ''; this._closeTimer = null; this._extensions = {}; this._protocol = ''; this._readyState = WebSocket.CONNECTING; this._receiver = null; this._sender = null; this._socket = null; if (address !== null) { this._bufferedAmount = 0; this._isServer = false; this._redirects = 0; if (Array.isArray(protocols)) { protocols = protocols.join(', '); } else if (typeof protocols === 'object' && protocols !== null) { options = protocols; protocols = undefined; } initAsClient(this, address, protocols, options); } else { this._isServer = true; } } /** * This deviates from the WHATWG interface since ws doesn't support the * required default "blob" type (instead we define a custom "nodebuffer" * type). * * @type {String} */ get binaryType() { return this._binaryType; } set binaryType(type) { if (!BINARY_TYPES.includes(type)) return; this._binaryType = type; // // Allow to change `binaryType` on the fly. // if (this._receiver) this._receiver._binaryType = type; } /** * @type {Number} */ get bufferedAmount() { if (!this._socket) return this._bufferedAmount; return this._socket._writableState.length + this._sender._bufferedBytes; } /** * @type {String} */ get extensions() { return Object.keys(this._extensions).join(); } /** * @type {String} */ get protocol() { return this._protocol; } /** * @type {Number} */ get readyState() { return this._readyState; } /** * @type {String} */ get url() { return this._url; } /** * Set up the socket and the internal resources. * * @param {net.Socket} socket The network socket between the server and client * @param {Buffer} head The first packet of the upgraded stream * @param {Number} [maxPayload=0] The maximum allowed message size * @private */ setSocket(socket, head, maxPayload) { const receiver = new Receiver( this.binaryType, this._extensions, this._isServer, maxPayload ); this._sender = new Sender(socket, this._extensions); this._receiver = receiver; this._socket = socket; receiver[kWebSocket] = this; socket[kWebSocket] = this; receiver.on('conclude', receiverOnConclude); receiver.on('drain', receiverOnDrain); receiver.on('error', receiverOnError); receiver.on('message', receiverOnMessage); receiver.on('ping', receiverOnPing); receiver.on('pong', receiverOnPong); socket.setTimeout(0); socket.setNoDelay(); if (head.length > 0) socket.unshift(head); socket.on('close', socketOnClose); socket.on('data', socketOnData); socket.on('end', socketOnEnd); socket.on('error', socketOnError); this._readyState = WebSocket.OPEN; this.emit('open'); } /** * Emit the `'close'` event. * * @private */ emitClose() { if (!this._socket) { this._readyState = WebSocket.CLOSED; this.emit('close', this._closeCode, this._closeMessage); return; } if (this._extensions[PerMessageDeflate.extensionName]) { this._extensions[PerMessageDeflate.extensionName].cleanup(); } this._receiver.removeAllListeners(); this._readyState = WebSocket.CLOSED; this.emit('close', this._closeCode, this._closeMessage); } /** * Start a closing handshake. * * +----------+ +-----------+ +----------+ * - - -|ws.close()|-->|close frame|-->|ws.close()|- - - * | +----------+ +-----------+ +----------+ | * +----------+ +-----------+ | * CLOSING |ws.close()|<--|close frame|<--+-----+ CLOSING * +----------+ +-----------+ | * | | | +---+ | * +------------------------+-->|fin| - - - - * | +---+ | +---+ * - - - - -|fin|<---------------------+ * +---+ * * @param {Number} [code] Status code explaining why the connection is closing * @param {String} [data] A string explaining why the connection is closing * @public */ close(code, data) { if (this.readyState === WebSocket.CLOSED) return; if (this.readyState === WebSocket.CONNECTING) { const msg = 'WebSocket was closed before the connection was established'; return abortHandshake(this, this._req, msg); } if (this.readyState === WebSocket.CLOSING) { if (this._closeFrameSent && this._closeFrameReceived) this._socket.end(); return; } this._readyState = WebSocket.CLOSING; this._sender.close(code, data, !this._isServer, (err) => { // // This error is handled by the `'error'` listener on the socket. We only // want to know if the close frame has been sent here. // if (err) return; this._closeFrameSent = true; if (this._closeFrameReceived) this._socket.end(); }); // // Specify a timeout for the closing handshake to complete. // this._closeTimer = setTimeout( this._socket.destroy.bind(this._socket), closeTimeout ); } /** * Send a ping. * * @param {*} [data] The data to send * @param {Boolean} [mask] Indicates whether or not to mask `data` * @param {Function} [cb] Callback which is executed when the ping is sent * @public */ ping(data, mask, cb) { if (this.readyState === WebSocket.CONNECTING) { throw new Error('WebSocket is not open: readyState 0 (CONNECTING)'); } if (typeof data === 'function') { cb = data; data = mask = undefined; } else if (typeof mask === 'function') { cb = mask; mask = undefined; } if (typeof data === 'number') data = data.toString(); if (this.readyState !== WebSocket.OPEN) { sendAfterClose(this, data, cb); return; } if (mask === undefined) mask = !this._isServer; this._sender.ping(data || EMPTY_BUFFER, mask, cb); } /** * Send a pong. * * @param {*} [data] The data to send * @param {Boolean} [mask] Indicates whether or not to mask `data` * @param {Function} [cb] Callback which is executed when the pong is sent * @public */ pong(data, mask, cb) { if (this.readyState === WebSocket.CONNECTING) { throw new Error('WebSocket is not open: readyState 0 (CONNECTING)'); } if (typeof data === 'function') { cb = data; data = mask = undefined; } else if (typeof mask === 'function') { cb = mask; mask = undefined; } if (typeof data === 'number') data = data.toString(); if (this.readyState !== WebSocket.OPEN) { sendAfterClose(this, data, cb); return; } if (mask === undefined) mask = !this._isServer; this._sender.pong(data || EMPTY_BUFFER, mask, cb); } /** * Send a data message. * * @param {*} data The message to send * @param {Object} [options] Options object * @param {Boolean} [options.compress] Specifies whether or not to compress * `data` * @param {Boolean} [options.binary] Specifies whether `data` is binary or * text * @param {Boolean} [options.fin=true] Specifies whether the fragment is the * last one * @param {Boolean} [options.mask] Specifies whether or not to mask `data` * @param {Function} [cb] Callback which is executed when data is written out * @public */ send(data, options, cb) { if (this.readyState === WebSocket.CONNECTING) { throw new Error('WebSocket is not open: readyState 0 (CONNECTING)'); } if (typeof options === 'function') { cb = options; options = {}; } if (typeof data === 'number') data = data.toString(); if (this.readyState !== WebSocket.OPEN) { sendAfterClose(this, data, cb); return; } const opts = { binary: typeof data !== 'string', mask: !this._isServer, compress: true, fin: true, ...options }; if (!this._extensions[PerMessageDeflate.extensionName]) { opts.compress = false; } this._sender.send(data || EMPTY_BUFFER, opts, cb); } /** * Forcibly close the connection. * * @public */ terminate() { if (this.readyState === WebSocket.CLOSED) return; if (this.readyState === WebSocket.CONNECTING) { const msg = 'WebSocket was closed before the connection was established'; return abortHandshake(this, this._req, msg); } if (this._socket) { this._readyState = WebSocket.CLOSING; this._socket.destroy(); } } } readyStates.forEach((readyState, i) => { const descriptor = { enumerable: true, value: i }; Object.defineProperty(WebSocket.prototype, readyState, descriptor); Object.defineProperty(WebSocket, readyState, descriptor); }); [ 'binaryType', 'bufferedAmount', 'extensions', 'protocol', 'readyState', 'url' ].forEach((property) => { Object.defineProperty(WebSocket.prototype, property, { enumerable: true }); }); // // Add the `onopen`, `onerror`, `onclose`, and `onmessage` attributes. // See https://html.spec.whatwg.org/multipage/comms.html#the-websocket-interface // ['open', 'error', 'close', 'message'].forEach((method) => { Object.defineProperty(WebSocket.prototype, `on${method}`, { configurable: true, enumerable: true, /** * Return the listener of the event. * * @return {(Function|undefined)} The event listener or `undefined` * @public */ get() { const listeners = this.listeners(method); for (let i = 0; i < listeners.length; i++) { if (listeners[i]._listener) return listeners[i]._listener; } return undefined; }, /** * Add a listener for the event. * * @param {Function} listener The listener to add * @public */ set(listener) { const listeners = this.listeners(method); for (let i = 0; i < listeners.length; i++) { // // Remove only the listeners added via `addEventListener`. // if (listeners[i]._listener) this.removeListener(method, listeners[i]); } this.addEventListener(method, listener); } }); }); WebSocket.prototype.addEventListener = addEventListener; WebSocket.prototype.removeEventListener = removeEventListener; module.exports = WebSocket; /** * Initialize a WebSocket client. * * @param {WebSocket} websocket The client to initialize * @param {(String|url.URL)} address The URL to which to connect * @param {String} [protocols] The subprotocols * @param {Object} [options] Connection options * @param {(Boolean|Object)} [options.perMessageDeflate=true] Enable/disable * permessage-deflate * @param {Number} [options.handshakeTimeout] Timeout in milliseconds for the * handshake request * @param {Number} [options.protocolVersion=13] Value of the * `Sec-WebSocket-Version` header * @param {String} [options.origin] Value of the `Origin` or * `Sec-WebSocket-Origin` header * @param {Number} [options.maxPayload=104857600] The maximum allowed message * size * @param {Boolean} [options.followRedirects=false] Whether or not to follow * redirects * @param {Number} [options.maxRedirects=10] The maximum number of redirects * allowed * @private */ function initAsClient(websocket, address, protocols, options) { const opts = { protocolVersion: protocolVersions[1], maxPayload: 100 * 1024 * 1024, perMessageDeflate: true, followRedirects: false, maxRedirects: 10, ...options, createConnection: undefined, socketPath: undefined, hostname: undefined, protocol: undefined, timeout: undefined, method: undefined, host: undefined, path: undefined, port: undefined }; if (!protocolVersions.includes(opts.protocolVersion)) { throw new RangeError( `Unsupported protocol version: ${opts.protocolVersion} ` + `(supported versions: ${protocolVersions.join(', ')})` ); } let parsedUrl; if (address instanceof URL) { parsedUrl = address; websocket._url = address.href; } else { parsedUrl = new URL(address); websocket._url = address; } const isUnixSocket = parsedUrl.protocol === 'ws+unix:'; if (!parsedUrl.host && (!isUnixSocket || !parsedUrl.pathname)) { throw new Error(`Invalid URL: ${websocket.url}`); } const isSecure = parsedUrl.protocol === 'wss:' || parsedUrl.protocol === 'https:'; const defaultPort = isSecure ? 443 : 80; const key = randomBytes(16).toString('base64'); const get = isSecure ? https.get : http.get; let perMessageDeflate; opts.createConnection = isSecure ? tlsConnect : netConnect; opts.defaultPort = opts.defaultPort || defaultPort; opts.port = parsedUrl.port || defaultPort; opts.host = parsedUrl.hostname.startsWith('[') ? parsedUrl.hostname.slice(1, -1) : parsedUrl.hostname; opts.headers = { 'Sec-WebSocket-Version': opts.protocolVersion, 'Sec-WebSocket-Key': key, Connection: 'Upgrade', Upgrade: 'websocket', ...opts.headers }; opts.path = parsedUrl.pathname + parsedUrl.search; opts.timeout = opts.handshakeTimeout; if (opts.perMessageDeflate) { perMessageDeflate = new PerMessageDeflate( opts.perMessageDeflate !== true ? opts.perMessageDeflate : {}, false, opts.maxPayload ); opts.headers['Sec-WebSocket-Extensions'] = format({ [PerMessageDeflate.extensionName]: perMessageDeflate.offer() }); } if (protocols) { opts.headers['Sec-WebSocket-Protocol'] = protocols; } if (opts.origin) { if (opts.protocolVersion < 13) { opts.headers['Sec-WebSocket-Origin'] = opts.origin; } else { opts.headers.Origin = opts.origin; } } if (parsedUrl.username || parsedUrl.password) { opts.auth = `${parsedUrl.username}:${parsedUrl.password}`; } if (isUnixSocket) { const parts = opts.path.split(':'); opts.socketPath = parts[0]; opts.path = parts[1]; } let req = (websocket._req = get(opts)); if (opts.timeout) { req.on('timeout', () => { abortHandshake(websocket, req, 'Opening handshake has timed out'); }); } req.on('error', (err) => { if (req === null || req.aborted) return; req = websocket._req = null; websocket._readyState = WebSocket.CLOSING; websocket.emit('error', err); websocket.emitClose(); }); req.on('response', (res) => { const location = res.headers.location; const statusCode = res.statusCode; if ( location && opts.followRedirects && statusCode >= 300 && statusCode < 400 ) { if (++websocket._redirects > opts.maxRedirects) { abortHandshake(websocket, req, 'Maximum redirects exceeded'); return; } req.abort(); const addr = new URL(location, address); initAsClient(websocket, addr, protocols, options); } else if (!websocket.emit('unexpected-response', req, res)) { abortHandshake( websocket, req, `Unexpected server response: ${res.statusCode}` ); } }); req.on('upgrade', (res, socket, head) => { websocket.emit('upgrade', res); // // The user may have closed the connection from a listener of the `upgrade` // event. // if (websocket.readyState !== WebSocket.CONNECTING) return; req = websocket._req = null; const digest = createHash('sha1') .update(key + GUID) .digest('base64'); if (res.headers['sec-websocket-accept'] !== digest) { abortHandshake(websocket, socket, 'Invalid Sec-WebSocket-Accept header'); return; } const serverProt = res.headers['sec-websocket-protocol']; const protList = (protocols || '').split(/, */); let protError; if (!protocols && serverProt) { protError = 'Server sent a subprotocol but none was requested'; } else if (protocols && !serverProt) { protError = 'Server sent no subprotocol'; } else if (serverProt && !protList.includes(serverProt)) { protError = 'Server sent an invalid subprotocol'; } if (protError) { abortHandshake(websocket, socket, protError); return; } if (serverProt) websocket._protocol = serverProt; if (perMessageDeflate) { try { const extensions = parse(res.headers['sec-websocket-extensions']); if (extensions[PerMessageDeflate.extensionName]) { perMessageDeflate.accept(extensions[PerMessageDeflate.extensionName]); websocket._extensions[PerMessageDeflate.extensionName] = perMessageDeflate; } } catch (err) { abortHandshake( websocket, socket, 'Invalid Sec-WebSocket-Extensions header' ); return; } } websocket.setSocket(socket, head, opts.maxPayload); }); } /** * Create a `net.Socket` and initiate a connection. * * @param {Object} options Connection options * @return {net.Socket} The newly created socket used to start the connection * @private */ function netConnect(options) { options.path = options.socketPath; return net.connect(options); } /** * Create a `tls.TLSSocket` and initiate a connection. * * @param {Object} options Connection options * @return {tls.TLSSocket} The newly created socket used to start the connection * @private */ function tlsConnect(options) { options.path = undefined; if (!options.servername && options.servername !== '') { options.servername = net.isIP(options.host) ? '' : options.host; } return tls.connect(options); } /** * Abort the handshake and emit an error. * * @param {WebSocket} websocket The WebSocket instance * @param {(http.ClientRequest|net.Socket)} stream The request to abort or the * socket to destroy * @param {String} message The error message * @private */ function abortHandshake(websocket, stream, message) { websocket._readyState = WebSocket.CLOSING; const err = new Error(message); Error.captureStackTrace(err, abortHandshake); if (stream.setHeader) { stream.abort(); if (stream.socket && !stream.socket.destroyed) { // // On Node.js >= 14.3.0 `request.abort()` does not destroy the socket if // called after the request completed. See // https://github.com/websockets/ws/issues/1869. // stream.socket.destroy(); } stream.once('abort', websocket.emitClose.bind(websocket)); websocket.emit('error', err); } else { stream.destroy(err); stream.once('error', websocket.emit.bind(websocket, 'error')); stream.once('close', websocket.emitClose.bind(websocket)); } } /** * Handle cases where the `ping()`, `pong()`, or `send()` methods are called * when the `readyState` attribute is `CLOSING` or `CLOSED`. * * @param {WebSocket} websocket The WebSocket instance * @param {*} [data] The data to send * @param {Function} [cb] Callback * @private */ function sendAfterClose(websocket, data, cb) { if (data) { const length = toBuffer(data).length; // // The `_bufferedAmount` property is used only when the peer is a client and // the opening handshake fails. Under these circumstances, in fact, the // `setSocket()` method is not called, so the `_socket` and `_sender` // properties are set to `null`. // if (websocket._socket) websocket._sender._bufferedBytes += length; else websocket._bufferedAmount += length; } if (cb) { const err = new Error( `WebSocket is not open: readyState ${websocket.readyState} ` + `(${readyStates[websocket.readyState]})` ); cb(err); } } /** * The listener of the `Receiver` `'conclude'` event. * * @param {Number} code The status code * @param {String} reason The reason for closing * @private */ function receiverOnConclude(code, reason) { const websocket = this[kWebSocket]; websocket._socket.removeListener('data', socketOnData); websocket._socket.resume(); websocket._closeFrameReceived = true; websocket._closeMessage = reason; websocket._closeCode = code; if (code === 1005) websocket.close(); else websocket.close(code, reason); } /** * The listener of the `Receiver` `'drain'` event. * * @private */ function receiverOnDrain() { this[kWebSocket]._socket.resume(); } /** * The listener of the `Receiver` `'error'` event. * * @param {(RangeError|Error)} err The emitted error * @private */ function receiverOnError(err) { const websocket = this[kWebSocket]; websocket._socket.removeListener('data', socketOnData); websocket._readyState = WebSocket.CLOSING; websocket._closeCode = err[kStatusCode]; websocket.emit('error', err); websocket._socket.destroy(); } /** * The listener of the `Receiver` `'finish'` event. * * @private */ function receiverOnFinish() { this[kWebSocket].emitClose(); } /** * The listener of the `Receiver` `'message'` event. * * @param {(String|Buffer|ArrayBuffer|Buffer[])} data The message * @private */ function receiverOnMessage(data) { this[kWebSocket].emit('message', data); } /** * The listener of the `Receiver` `'ping'` event. * * @param {Buffer} data The data included in the ping frame * @private */ function receiverOnPing(data) { const websocket = this[kWebSocket]; websocket.pong(data, !websocket._isServer, NOOP); websocket.emit('ping', data); } /** * The listener of the `Receiver` `'pong'` event. * * @param {Buffer} data The data included in the pong frame * @private */ function receiverOnPong(data) { this[kWebSocket].emit('pong', data); } /** * The listener of the `net.Socket` `'close'` event. * * @private */ function socketOnClose() { const websocket = this[kWebSocket]; this.removeListener('close', socketOnClose); this.removeListener('end', socketOnEnd); websocket._readyState = WebSocket.CLOSING; // // The close frame might not have been received or the `'end'` event emitted, // for example, if the socket was destroyed due to an error. Ensure that the // `receiver` stream is closed after writing any remaining buffered data to // it. If the readable side of the socket is in flowing mode then there is no // buffered data as everything has been already written and `readable.read()` // will return `null`. If instead, the socket is paused, any possible buffered // data will be read as a single chunk and emitted synchronously in a single // `'data'` event. // websocket._socket.read(); websocket._receiver.end(); this.removeListener('data', socketOnData); this[kWebSocket] = undefined; clearTimeout(websocket._closeTimer); if ( websocket._receiver._writableState.finished || websocket._receiver._writableState.errorEmitted ) { websocket.emitClose(); } else { websocket._receiver.on('error', receiverOnFinish); websocket._receiver.on('finish', receiverOnFinish); } } /** * The listener of the `net.Socket` `'data'` event. * * @param {Buffer} chunk A chunk of data * @private */ function socketOnData(chunk) { if (!this[kWebSocket]._receiver.write(chunk)) { this.pause(); } } /** * The listener of the `net.Socket` `'end'` event. * * @private */ function socketOnEnd() { const websocket = this[kWebSocket]; websocket._readyState = WebSocket.CLOSING; websocket._receiver.end(); this.end(); } /** * The listener of the `net.Socket` `'error'` event. * * @private */ function socketOnError() { const websocket = this[kWebSocket]; this.removeListener('error', socketOnError); this.on('error', NOOP); if (websocket) { websocket._readyState = WebSocket.CLOSING; this.destroy(); } } module.exports = exports = abbrev.abbrev = abbrev abbrev.monkeyPatch = monkeyPatch function monkeyPatch () { Object.defineProperty(Array.prototype, 'abbrev', { value: function () { return abbrev(this) }, enumerable: false, configurable: true, writable: true }) Object.defineProperty(Object.prototype, 'abbrev', { value: function () { return abbrev(Object.keys(this)) }, enumerable: false, configurable: true, writable: true }) } function abbrev (list) { if (arguments.length !== 1 || !Array.isArray(list)) { list = Array.prototype.slice.call(arguments, 0) } for (var i = 0, l = list.length, args = [] ; i < l ; i ++) { args[i] = typeof list[i] === "string" ? list[i] : String(list[i]) } // sort them lexicographically, so that they're next to their nearest kin args = args.sort(lexSort) // walk through each, seeing how much it has in common with the next and previous var abbrevs = {} , prev = "" for (var i = 0, l = args.length ; i < l ; i ++) { var current = args[i] , next = args[i + 1] || "" , nextMatches = true , prevMatches = true if (current === next) continue for (var j = 0, cl = current.length ; j < cl ; j ++) { var curChar = current.charAt(j) nextMatches = nextMatches && curChar === next.charAt(j) prevMatches = prevMatches && curChar === prev.charAt(j) if (!nextMatches && !prevMatches) { j ++ break } } prev = current if (j === cl) { abbrevs[current] = current continue } for (var a = current.substr(0, j) ; j <= cl ; j ++) { abbrevs[a] = current a += current.charAt(j) } } return abbrevs } function lexSort (a, b) { return a === b ? 0 : a > b ? 1 : -1 } This software is dual-licensed under the ISC and MIT licenses. You may use this software under EITHER of the following licenses. ---------- The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ---------- Copyright Isaac Z. Schlueter and Contributors All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "abbrev", "version": "1.1.1", "description": "Like ruby's abbrev module, but in js", "author": "Isaac Z. Schlueter ", "main": "abbrev.js", "scripts": { "test": "tap test.js --100", "preversion": "npm test", "postversion": "npm publish", "postpublish": "git push origin --all; git push origin --tags" }, "repository": "http://github.com/isaacs/abbrev-js", "license": "ISC", "devDependencies": { "tap": "^10.1" }, "files": [ "abbrev.js" ] } module.exports = noop; module.exports.HttpsAgent = noop; // Noop function for browser since native api's don't use agents. function noop () {} 'use strict'; module.exports = require('./lib/agent'); module.exports.HttpsAgent = require('./lib/https_agent'); module.exports.constants = require('./lib/constants'); The MIT License Copyright(c) node-modules and other contributors. Copyright(c) 2012 - 2015 fengmk2 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "agentkeepalive", "version": "4.2.1", "description": "Missing keepalive http.Agent", "main": "index.js", "browser": "browser.js", "files": [ "index.js", "index.d.ts", "browser.js", "lib" ], "scripts": { "test": "npm run lint && egg-bin test --full-trace", "test-local": "egg-bin test --full-trace", "cov": "cross-env DEBUG=agentkeepalive egg-bin cov --full-trace", "ci": "npm run lint && npm run cov", "lint": "eslint lib test index.js", "autod": "autod" }, "repository": { "type": "git", "url": "git://github.com/node-modules/agentkeepalive.git" }, "bugs": { "url": "https://github.com/node-modules/agentkeepalive/issues" }, "keywords": [ "http", "https", "agent", "keepalive", "agentkeepalive", "HttpAgent", "HttpsAgent" ], "dependencies": { "debug": "^4.1.0", "depd": "^1.1.2", "humanize-ms": "^1.2.1" }, "devDependencies": { "autod": "^3.0.1", "coffee": "^5.3.0", "cross-env": "^6.0.3", "egg-bin": "^4.9.0", "egg-ci": "^1.10.0", "eslint": "^5.7.0", "eslint-config-egg": "^7.1.0", "mm": "^2.4.1", "pedding": "^1.1.0", "typescript": "^3.8.3" }, "engines": { "node": ">= 8.0.0" }, "ci": { "type": "github", "os": { "github": "linux" }, "version": "8, 10, 12, 14, 16" }, "author": "fengmk2 (https://fengmk2.com)", "license": "MIT" } 'use strict'; const OriginalAgent = require('http').Agent; const ms = require('humanize-ms'); const debug = require('debug')('agentkeepalive'); const deprecate = require('depd')('agentkeepalive'); const { INIT_SOCKET, CURRENT_ID, CREATE_ID, SOCKET_CREATED_TIME, SOCKET_NAME, SOCKET_REQUEST_COUNT, SOCKET_REQUEST_FINISHED_COUNT, } = require('./constants'); // OriginalAgent come from // - https://github.com/nodejs/node/blob/v8.12.0/lib/_http_agent.js // - https://github.com/nodejs/node/blob/v10.12.0/lib/_http_agent.js // node <= 10 let defaultTimeoutListenerCount = 1; const majorVersion = parseInt(process.version.split('.', 1)[0].substring(1)); if (majorVersion >= 11 && majorVersion <= 12) { defaultTimeoutListenerCount = 2; } else if (majorVersion >= 13) { defaultTimeoutListenerCount = 3; } class Agent extends OriginalAgent { constructor(options) { options = options || {}; options.keepAlive = options.keepAlive !== false; // default is keep-alive and 4s free socket timeout // see https://medium.com/ssense-tech/reduce-networking-errors-in-nodejs-23b4eb9f2d83 if (options.freeSocketTimeout === undefined) { options.freeSocketTimeout = 4000; } // Legacy API: keepAliveTimeout should be rename to `freeSocketTimeout` if (options.keepAliveTimeout) { deprecate('options.keepAliveTimeout is deprecated, please use options.freeSocketTimeout instead'); options.freeSocketTimeout = options.keepAliveTimeout; delete options.keepAliveTimeout; } // Legacy API: freeSocketKeepAliveTimeout should be rename to `freeSocketTimeout` if (options.freeSocketKeepAliveTimeout) { deprecate('options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead'); options.freeSocketTimeout = options.freeSocketKeepAliveTimeout; delete options.freeSocketKeepAliveTimeout; } // Sets the socket to timeout after timeout milliseconds of inactivity on the socket. // By default is double free socket timeout. if (options.timeout === undefined) { // make sure socket default inactivity timeout >= 8s options.timeout = Math.max(options.freeSocketTimeout * 2, 8000); } // support humanize format options.timeout = ms(options.timeout); options.freeSocketTimeout = ms(options.freeSocketTimeout); options.socketActiveTTL = options.socketActiveTTL ? ms(options.socketActiveTTL) : 0; super(options); this[CURRENT_ID] = 0; // create socket success counter this.createSocketCount = 0; this.createSocketCountLastCheck = 0; this.createSocketErrorCount = 0; this.createSocketErrorCountLastCheck = 0; this.closeSocketCount = 0; this.closeSocketCountLastCheck = 0; // socket error event count this.errorSocketCount = 0; this.errorSocketCountLastCheck = 0; // request finished counter this.requestCount = 0; this.requestCountLastCheck = 0; // including free socket timeout counter this.timeoutSocketCount = 0; this.timeoutSocketCountLastCheck = 0; this.on('free', socket => { // https://github.com/nodejs/node/pull/32000 // Node.js native agent will check socket timeout eqs agent.options.timeout. // Use the ttl or freeSocketTimeout to overwrite. const timeout = this.calcSocketTimeout(socket); if (timeout > 0 && socket.timeout !== timeout) { socket.setTimeout(timeout); } }); } get freeSocketKeepAliveTimeout() { deprecate('agent.freeSocketKeepAliveTimeout is deprecated, please use agent.options.freeSocketTimeout instead'); return this.options.freeSocketTimeout; } get timeout() { deprecate('agent.timeout is deprecated, please use agent.options.timeout instead'); return this.options.timeout; } get socketActiveTTL() { deprecate('agent.socketActiveTTL is deprecated, please use agent.options.socketActiveTTL instead'); return this.options.socketActiveTTL; } calcSocketTimeout(socket) { /** * return <= 0: should free socket * return > 0: should update socket timeout * return undefined: not find custom timeout */ let freeSocketTimeout = this.options.freeSocketTimeout; const socketActiveTTL = this.options.socketActiveTTL; if (socketActiveTTL) { // check socketActiveTTL const aliveTime = Date.now() - socket[SOCKET_CREATED_TIME]; const diff = socketActiveTTL - aliveTime; if (diff <= 0) { return diff; } if (freeSocketTimeout && diff < freeSocketTimeout) { freeSocketTimeout = diff; } } // set freeSocketTimeout if (freeSocketTimeout) { // set free keepalive timer // try to use socket custom freeSocketTimeout first, support headers['keep-alive'] // https://github.com/node-modules/urllib/blob/b76053020923f4d99a1c93cf2e16e0c5ba10bacf/lib/urllib.js#L498 const customFreeSocketTimeout = socket.freeSocketTimeout || socket.freeSocketKeepAliveTimeout; return customFreeSocketTimeout || freeSocketTimeout; } } keepSocketAlive(socket) { const result = super.keepSocketAlive(socket); // should not keepAlive, do nothing if (!result) return result; const customTimeout = this.calcSocketTimeout(socket); if (typeof customTimeout === 'undefined') { return true; } if (customTimeout <= 0) { debug('%s(requests: %s, finished: %s) free but need to destroy by TTL, request count %s, diff is %s', socket[SOCKET_NAME], socket[SOCKET_REQUEST_COUNT], socket[SOCKET_REQUEST_FINISHED_COUNT], customTimeout); return false; } if (socket.timeout !== customTimeout) { socket.setTimeout(customTimeout); } return true; } // only call on addRequest reuseSocket(...args) { // reuseSocket(socket, req) super.reuseSocket(...args); const socket = args[0]; const req = args[1]; req.reusedSocket = true; const agentTimeout = this.options.timeout; if (getSocketTimeout(socket) !== agentTimeout) { // reset timeout before use socket.setTimeout(agentTimeout); debug('%s reset timeout to %sms', socket[SOCKET_NAME], agentTimeout); } socket[SOCKET_REQUEST_COUNT]++; debug('%s(requests: %s, finished: %s) reuse on addRequest, timeout %sms', socket[SOCKET_NAME], socket[SOCKET_REQUEST_COUNT], socket[SOCKET_REQUEST_FINISHED_COUNT], getSocketTimeout(socket)); } [CREATE_ID]() { const id = this[CURRENT_ID]++; if (this[CURRENT_ID] === Number.MAX_SAFE_INTEGER) this[CURRENT_ID] = 0; return id; } [INIT_SOCKET](socket, options) { // bugfix here. // https on node 8, 10 won't set agent.options.timeout by default // TODO: need to fix on node itself if (options.timeout) { const timeout = getSocketTimeout(socket); if (!timeout) { socket.setTimeout(options.timeout); } } if (this.options.keepAlive) { // Disable Nagle's algorithm: http://blog.caustik.com/2012/04/08/scaling-node-js-to-100k-concurrent-connections/ // https://fengmk2.com/benchmark/nagle-algorithm-delayed-ack-mock.html socket.setNoDelay(true); } this.createSocketCount++; if (this.options.socketActiveTTL) { socket[SOCKET_CREATED_TIME] = Date.now(); } // don't show the hole '-----BEGIN CERTIFICATE----' key string socket[SOCKET_NAME] = `sock[${this[CREATE_ID]()}#${options._agentKey}]`.split('-----BEGIN', 1)[0]; socket[SOCKET_REQUEST_COUNT] = 1; socket[SOCKET_REQUEST_FINISHED_COUNT] = 0; installListeners(this, socket, options); } createConnection(options, oncreate) { let called = false; const onNewCreate = (err, socket) => { if (called) return; called = true; if (err) { this.createSocketErrorCount++; return oncreate(err); } this[INIT_SOCKET](socket, options); oncreate(err, socket); }; const newSocket = super.createConnection(options, onNewCreate); if (newSocket) onNewCreate(null, newSocket); } get statusChanged() { const changed = this.createSocketCount !== this.createSocketCountLastCheck || this.createSocketErrorCount !== this.createSocketErrorCountLastCheck || this.closeSocketCount !== this.closeSocketCountLastCheck || this.errorSocketCount !== this.errorSocketCountLastCheck || this.timeoutSocketCount !== this.timeoutSocketCountLastCheck || this.requestCount !== this.requestCountLastCheck; if (changed) { this.createSocketCountLastCheck = this.createSocketCount; this.createSocketErrorCountLastCheck = this.createSocketErrorCount; this.closeSocketCountLastCheck = this.closeSocketCount; this.errorSocketCountLastCheck = this.errorSocketCount; this.timeoutSocketCountLastCheck = this.timeoutSocketCount; this.requestCountLastCheck = this.requestCount; } return changed; } getCurrentStatus() { return { createSocketCount: this.createSocketCount, createSocketErrorCount: this.createSocketErrorCount, closeSocketCount: this.closeSocketCount, errorSocketCount: this.errorSocketCount, timeoutSocketCount: this.timeoutSocketCount, requestCount: this.requestCount, freeSockets: inspect(this.freeSockets), sockets: inspect(this.sockets), requests: inspect(this.requests), }; } } // node 8 don't has timeout attribute on socket // https://github.com/nodejs/node/pull/21204/files#diff-e6ef024c3775d787c38487a6309e491dR408 function getSocketTimeout(socket) { return socket.timeout || socket._idleTimeout; } function installListeners(agent, socket, options) { debug('%s create, timeout %sms', socket[SOCKET_NAME], getSocketTimeout(socket)); // listener socket events: close, timeout, error, free function onFree() { // create and socket.emit('free') logic // https://github.com/nodejs/node/blob/master/lib/_http_agent.js#L311 // no req on the socket, it should be the new socket if (!socket._httpMessage && socket[SOCKET_REQUEST_COUNT] === 1) return; socket[SOCKET_REQUEST_FINISHED_COUNT]++; agent.requestCount++; debug('%s(requests: %s, finished: %s) free', socket[SOCKET_NAME], socket[SOCKET_REQUEST_COUNT], socket[SOCKET_REQUEST_FINISHED_COUNT]); // should reuse on pedding requests? const name = agent.getName(options); if (socket.writable && agent.requests[name] && agent.requests[name].length) { // will be reuse on agent free listener socket[SOCKET_REQUEST_COUNT]++; debug('%s(requests: %s, finished: %s) will be reuse on agent free event', socket[SOCKET_NAME], socket[SOCKET_REQUEST_COUNT], socket[SOCKET_REQUEST_FINISHED_COUNT]); } } socket.on('free', onFree); function onClose(isError) { debug('%s(requests: %s, finished: %s) close, isError: %s', socket[SOCKET_NAME], socket[SOCKET_REQUEST_COUNT], socket[SOCKET_REQUEST_FINISHED_COUNT], isError); agent.closeSocketCount++; } socket.on('close', onClose); // start socket timeout handler function onTimeout() { // onTimeout and emitRequestTimeout(_http_client.js) // https://github.com/nodejs/node/blob/v12.x/lib/_http_client.js#L711 const listenerCount = socket.listeners('timeout').length; // node <= 10, default listenerCount is 1, onTimeout // 11 < node <= 12, default listenerCount is 2, onTimeout and emitRequestTimeout // node >= 13, default listenerCount is 3, onTimeout, // onTimeout(https://github.com/nodejs/node/pull/32000/files#diff-5f7fb0850412c6be189faeddea6c5359R333) // and emitRequestTimeout const timeout = getSocketTimeout(socket); const req = socket._httpMessage; const reqTimeoutListenerCount = req && req.listeners('timeout').length || 0; debug('%s(requests: %s, finished: %s) timeout after %sms, listeners %s, defaultTimeoutListenerCount %s, hasHttpRequest %s, HttpRequest timeoutListenerCount %s', socket[SOCKET_NAME], socket[SOCKET_REQUEST_COUNT], socket[SOCKET_REQUEST_FINISHED_COUNT], timeout, listenerCount, defaultTimeoutListenerCount, !!req, reqTimeoutListenerCount); if (debug.enabled) { debug('timeout listeners: %s', socket.listeners('timeout').map(f => f.name).join(', ')); } agent.timeoutSocketCount++; const name = agent.getName(options); if (agent.freeSockets[name] && agent.freeSockets[name].indexOf(socket) !== -1) { // free socket timeout, destroy quietly socket.destroy(); // Remove it from freeSockets list immediately to prevent new requests // from being sent through this socket. agent.removeSocket(socket, options); debug('%s is free, destroy quietly', socket[SOCKET_NAME]); } else { // if there is no any request socket timeout handler, // agent need to handle socket timeout itself. // // custom request socket timeout handle logic must follow these rules: // 1. Destroy socket first // 2. Must emit socket 'agentRemove' event tell agent remove socket // from freeSockets list immediately. // Otherise you may be get 'socket hang up' error when reuse // free socket and timeout happen in the same time. if (reqTimeoutListenerCount === 0) { const error = new Error('Socket timeout'); error.code = 'ERR_SOCKET_TIMEOUT'; error.timeout = timeout; // must manually call socket.end() or socket.destroy() to end the connection. // https://nodejs.org/dist/latest-v10.x/docs/api/net.html#net_socket_settimeout_timeout_callback socket.destroy(error); agent.removeSocket(socket, options); debug('%s destroy with timeout error', socket[SOCKET_NAME]); } } } socket.on('timeout', onTimeout); function onError(err) { const listenerCount = socket.listeners('error').length; debug('%s(requests: %s, finished: %s) error: %s, listenerCount: %s', socket[SOCKET_NAME], socket[SOCKET_REQUEST_COUNT], socket[SOCKET_REQUEST_FINISHED_COUNT], err, listenerCount); agent.errorSocketCount++; if (listenerCount === 1) { // if socket don't contain error event handler, don't catch it, emit it again debug('%s emit uncaught error event', socket[SOCKET_NAME]); socket.removeListener('error', onError); socket.emit('error', err); } } socket.on('error', onError); function onRemove() { debug('%s(requests: %s, finished: %s) agentRemove', socket[SOCKET_NAME], socket[SOCKET_REQUEST_COUNT], socket[SOCKET_REQUEST_FINISHED_COUNT]); // We need this function for cases like HTTP 'upgrade' // (defined by WebSockets) where we need to remove a socket from the // pool because it'll be locked up indefinitely socket.removeListener('close', onClose); socket.removeListener('error', onError); socket.removeListener('free', onFree); socket.removeListener('timeout', onTimeout); socket.removeListener('agentRemove', onRemove); } socket.on('agentRemove', onRemove); } module.exports = Agent; function inspect(obj) { const res = {}; for (const key in obj) { res[key] = obj[key].length; } return res; } 'use strict'; module.exports = { // agent CURRENT_ID: Symbol('agentkeepalive#currentId'), CREATE_ID: Symbol('agentkeepalive#createId'), INIT_SOCKET: Symbol('agentkeepalive#initSocket'), CREATE_HTTPS_CONNECTION: Symbol('agentkeepalive#createHttpsConnection'), // socket SOCKET_CREATED_TIME: Symbol('agentkeepalive#socketCreatedTime'), SOCKET_NAME: Symbol('agentkeepalive#socketName'), SOCKET_REQUEST_COUNT: Symbol('agentkeepalive#socketRequestCount'), SOCKET_REQUEST_FINISHED_COUNT: Symbol('agentkeepalive#socketRequestFinishedCount'), }; 'use strict'; const OriginalHttpsAgent = require('https').Agent; const HttpAgent = require('./agent'); const { INIT_SOCKET, CREATE_HTTPS_CONNECTION, } = require('./constants'); class HttpsAgent extends HttpAgent { constructor(options) { super(options); this.defaultPort = 443; this.protocol = 'https:'; this.maxCachedSessions = this.options.maxCachedSessions; /* istanbul ignore next */ if (this.maxCachedSessions === undefined) { this.maxCachedSessions = 100; } this._sessionCache = { map: {}, list: [], }; } createConnection(options) { const socket = this[CREATE_HTTPS_CONNECTION](options); this[INIT_SOCKET](socket, options); return socket; } } // https://github.com/nodejs/node/blob/master/lib/https.js#L89 HttpsAgent.prototype[CREATE_HTTPS_CONNECTION] = OriginalHttpsAgent.prototype.createConnection; [ 'getName', '_getSession', '_cacheSession', // https://github.com/nodejs/node/pull/4982 '_evictSession', ].forEach(function(method) { /* istanbul ignore next */ if (typeof OriginalHttpsAgent.prototype[method] === 'function') { HttpsAgent.prototype[method] = OriginalHttpsAgent.prototype[method]; } }); module.exports = HttpsAgent; /*! * depd * Copyright(c) 2014-2017 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. */ var callSiteToString = require('./lib/compat').callSiteToString var eventListenerCount = require('./lib/compat').eventListenerCount var relative = require('path').relative /** * Module exports. */ module.exports = depd /** * Get the path to base files on. */ var basePath = process.cwd() /** * Determine if namespace is contained in the string. */ function containsNamespace (str, namespace) { var vals = str.split(/[ ,]+/) var ns = String(namespace).toLowerCase() for (var i = 0; i < vals.length; i++) { var val = vals[i] // namespace contained if (val && (val === '*' || val.toLowerCase() === ns)) { return true } } return false } /** * Convert a data descriptor to accessor descriptor. */ function convertDataDescriptorToAccessor (obj, prop, message) { var descriptor = Object.getOwnPropertyDescriptor(obj, prop) var value = descriptor.value descriptor.get = function getter () { return value } if (descriptor.writable) { descriptor.set = function setter (val) { return (value = val) } } delete descriptor.value delete descriptor.writable Object.defineProperty(obj, prop, descriptor) return descriptor } /** * Create arguments string to keep arity. */ function createArgumentsString (arity) { var str = '' for (var i = 0; i < arity; i++) { str += ', arg' + i } return str.substr(2) } /** * Create stack string from stack. */ function createStackString (stack) { var str = this.name + ': ' + this.namespace if (this.message) { str += ' deprecated ' + this.message } for (var i = 0; i < stack.length; i++) { str += '\n at ' + callSiteToString(stack[i]) } return str } /** * Create deprecate for namespace in caller. */ function depd (namespace) { if (!namespace) { throw new TypeError('argument namespace is required') } var stack = getStack() var site = callSiteLocation(stack[1]) var file = site[0] function deprecate (message) { // call to self as log log.call(deprecate, message) } deprecate._file = file deprecate._ignored = isignored(namespace) deprecate._namespace = namespace deprecate._traced = istraced(namespace) deprecate._warned = Object.create(null) deprecate.function = wrapfunction deprecate.property = wrapproperty return deprecate } /** * Determine if namespace is ignored. */ function isignored (namespace) { /* istanbul ignore next: tested in a child processs */ if (process.noDeprecation) { // --no-deprecation support return true } var str = process.env.NO_DEPRECATION || '' // namespace ignored return containsNamespace(str, namespace) } /** * Determine if namespace is traced. */ function istraced (namespace) { /* istanbul ignore next: tested in a child processs */ if (process.traceDeprecation) { // --trace-deprecation support return true } var str = process.env.TRACE_DEPRECATION || '' // namespace traced return containsNamespace(str, namespace) } /** * Display deprecation message. */ function log (message, site) { var haslisteners = eventListenerCount(process, 'deprecation') !== 0 // abort early if no destination if (!haslisteners && this._ignored) { return } var caller var callFile var callSite var depSite var i = 0 var seen = false var stack = getStack() var file = this._file if (site) { // provided site depSite = site callSite = callSiteLocation(stack[1]) callSite.name = depSite.name file = callSite[0] } else { // get call site i = 2 depSite = callSiteLocation(stack[i]) callSite = depSite } // get caller of deprecated thing in relation to file for (; i < stack.length; i++) { caller = callSiteLocation(stack[i]) callFile = caller[0] if (callFile === file) { seen = true } else if (callFile === this._file) { file = this._file } else if (seen) { break } } var key = caller ? depSite.join(':') + '__' + caller.join(':') : undefined if (key !== undefined && key in this._warned) { // already warned return } this._warned[key] = true // generate automatic message from call site var msg = message if (!msg) { msg = callSite === depSite || !callSite.name ? defaultMessage(depSite) : defaultMessage(callSite) } // emit deprecation if listeners exist if (haslisteners) { var err = DeprecationError(this._namespace, msg, stack.slice(i)) process.emit('deprecation', err) return } // format and write message var format = process.stderr.isTTY ? formatColor : formatPlain var output = format.call(this, msg, caller, stack.slice(i)) process.stderr.write(output + '\n', 'utf8') } /** * Get call site location as array. */ function callSiteLocation (callSite) { var file = callSite.getFileName() || '' var line = callSite.getLineNumber() var colm = callSite.getColumnNumber() if (callSite.isEval()) { file = callSite.getEvalOrigin() + ', ' + file } var site = [file, line, colm] site.callSite = callSite site.name = callSite.getFunctionName() return site } /** * Generate a default message from the site. */ function defaultMessage (site) { var callSite = site.callSite var funcName = site.name // make useful anonymous name if (!funcName) { funcName = '' } var context = callSite.getThis() var typeName = context && callSite.getTypeName() // ignore useless type name if (typeName === 'Object') { typeName = undefined } // make useful type name if (typeName === 'Function') { typeName = context.name || typeName } return typeName && callSite.getMethodName() ? typeName + '.' + funcName : funcName } /** * Format deprecation message without color. */ function formatPlain (msg, caller, stack) { var timestamp = new Date().toUTCString() var formatted = timestamp + ' ' + this._namespace + ' deprecated ' + msg // add stack trace if (this._traced) { for (var i = 0; i < stack.length; i++) { formatted += '\n at ' + callSiteToString(stack[i]) } return formatted } if (caller) { formatted += ' at ' + formatLocation(caller) } return formatted } /** * Format deprecation message with color. */ function formatColor (msg, caller, stack) { var formatted = '\x1b[36;1m' + this._namespace + '\x1b[22;39m' + // bold cyan ' \x1b[33;1mdeprecated\x1b[22;39m' + // bold yellow ' \x1b[0m' + msg + '\x1b[39m' // reset // add stack trace if (this._traced) { for (var i = 0; i < stack.length; i++) { formatted += '\n \x1b[36mat ' + callSiteToString(stack[i]) + '\x1b[39m' // cyan } return formatted } if (caller) { formatted += ' \x1b[36m' + formatLocation(caller) + '\x1b[39m' // cyan } return formatted } /** * Format call site location. */ function formatLocation (callSite) { return relative(basePath, callSite[0]) + ':' + callSite[1] + ':' + callSite[2] } /** * Get the stack as array of call sites. */ function getStack () { var limit = Error.stackTraceLimit var obj = {} var prep = Error.prepareStackTrace Error.prepareStackTrace = prepareObjectStackTrace Error.stackTraceLimit = Math.max(10, limit) // capture the stack Error.captureStackTrace(obj) // slice this function off the top var stack = obj.stack.slice(1) Error.prepareStackTrace = prep Error.stackTraceLimit = limit return stack } /** * Capture call site stack from v8. */ function prepareObjectStackTrace (obj, stack) { return stack } /** * Return a wrapped function in a deprecation message. */ function wrapfunction (fn, message) { if (typeof fn !== 'function') { throw new TypeError('argument fn must be a function') } var args = createArgumentsString(fn.length) var deprecate = this // eslint-disable-line no-unused-vars var stack = getStack() var site = callSiteLocation(stack[1]) site.name = fn.name // eslint-disable-next-line no-eval var deprecatedfn = eval('(function (' + args + ') {\n' + '"use strict"\n' + 'log.call(deprecate, message, site)\n' + 'return fn.apply(this, arguments)\n' + '})') return deprecatedfn } /** * Wrap property in a deprecation message. */ function wrapproperty (obj, prop, message) { if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { throw new TypeError('argument obj must be object') } var descriptor = Object.getOwnPropertyDescriptor(obj, prop) if (!descriptor) { throw new TypeError('must call property on owner object') } if (!descriptor.configurable) { throw new TypeError('property must be configurable') } var deprecate = this var stack = getStack() var site = callSiteLocation(stack[1]) // set site name site.name = prop // convert data descriptor if ('value' in descriptor) { descriptor = convertDataDescriptorToAccessor(obj, prop, message) } var get = descriptor.get var set = descriptor.set // wrap getter if (typeof get === 'function') { descriptor.get = function getter () { log.call(deprecate, message, site) return get.apply(this, arguments) } } // wrap setter if (typeof set === 'function') { descriptor.set = function setter () { log.call(deprecate, message, site) return set.apply(this, arguments) } } Object.defineProperty(obj, prop, descriptor) } /** * Create DeprecationError for deprecation */ function DeprecationError (namespace, message, stack) { var error = new Error() var stackString Object.defineProperty(error, 'constructor', { value: DeprecationError }) Object.defineProperty(error, 'message', { configurable: true, enumerable: false, value: message, writable: true }) Object.defineProperty(error, 'name', { enumerable: false, configurable: true, value: 'DeprecationError', writable: true }) Object.defineProperty(error, 'namespace', { configurable: true, enumerable: false, value: namespace, writable: true }) Object.defineProperty(error, 'stack', { configurable: true, enumerable: false, get: function () { if (stackString !== undefined) { return stackString } // prepare stack trace return (stackString = createStackString.call(this, stack)) }, set: function setter (val) { stackString = val } }) return error } (The MIT License) Copyright (c) 2014-2017 Douglas Christopher Wilson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "depd", "description": "Deprecate all the things", "version": "1.1.2", "author": "Douglas Christopher Wilson ", "license": "MIT", "keywords": [ "deprecate", "deprecated" ], "repository": "dougwilson/nodejs-depd", "browser": "lib/browser/index.js", "devDependencies": { "benchmark": "2.1.4", "beautify-benchmark": "0.2.4", "eslint": "3.19.0", "eslint-config-standard": "7.1.0", "eslint-plugin-markdown": "1.0.0-beta.7", "eslint-plugin-promise": "3.6.0", "eslint-plugin-standard": "3.0.1", "istanbul": "0.4.5", "mocha": "~1.21.5" }, "files": [ "lib/", "History.md", "LICENSE", "index.js", "Readme.md" ], "engines": { "node": ">= 0.6" }, "scripts": { "bench": "node benchmark/index.js", "lint": "eslint --plugin markdown --ext js,md .", "test": "mocha --reporter spec --bail test/", "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --no-exit test/", "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/" } } # depd [![NPM Version][npm-version-image]][npm-url] [![NPM Downloads][npm-downloads-image]][npm-url] [![Node.js Version][node-image]][node-url] [![Linux Build][travis-image]][travis-url] [![Windows Build][appveyor-image]][appveyor-url] [![Coverage Status][coveralls-image]][coveralls-url] Deprecate all the things > With great modules comes great responsibility; mark things deprecated! ## Install This module is installed directly using `npm`: ```sh $ npm install depd ``` This module can also be bundled with systems like [Browserify](http://browserify.org/) or [webpack](https://webpack.github.io/), though by default this module will alter it's API to no longer display or track deprecations. ## API ```js var deprecate = require('depd')('my-module') ``` This library allows you to display deprecation messages to your users. This library goes above and beyond with deprecation warnings by introspection of the call stack (but only the bits that it is interested in). Instead of just warning on the first invocation of a deprecated function and never again, this module will warn on the first invocation of a deprecated function per unique call site, making it ideal to alert users of all deprecated uses across the code base, rather than just whatever happens to execute first. The deprecation warnings from this module also include the file and line information for the call into the module that the deprecated function was in. **NOTE** this library has a similar interface to the `debug` module, and this module uses the calling file to get the boundary for the call stacks, so you should always create a new `deprecate` object in each file and not within some central file. ### depd(namespace) Create a new deprecate function that uses the given namespace name in the messages and will display the call site prior to the stack entering the file this function was called from. It is highly suggested you use the name of your module as the namespace. ### deprecate(message) Call this function from deprecated code to display a deprecation message. This message will appear once per unique caller site. Caller site is the first call site in the stack in a different file from the caller of this function. If the message is omitted, a message is generated for you based on the site of the `deprecate()` call and will display the name of the function called, similar to the name displayed in a stack trace. ### deprecate.function(fn, message) Call this function to wrap a given function in a deprecation message on any call to the function. An optional message can be supplied to provide a custom message. ### deprecate.property(obj, prop, message) Call this function to wrap a given property on object in a deprecation message on any accessing or setting of the property. An optional message can be supplied to provide a custom message. The method must be called on the object where the property belongs (not inherited from the prototype). If the property is a data descriptor, it will be converted to an accessor descriptor in order to display the deprecation message. ### process.on('deprecation', fn) This module will allow easy capturing of deprecation errors by emitting the errors as the type "deprecation" on the global `process`. If there are no listeners for this type, the errors are written to STDERR as normal, but if there are any listeners, nothing will be written to STDERR and instead only emitted. From there, you can write the errors in a different format or to a logging source. The error represents the deprecation and is emitted only once with the same rules as writing to STDERR. The error has the following properties: - `message` - This is the message given by the library - `name` - This is always `'DeprecationError'` - `namespace` - This is the namespace the deprecation came from - `stack` - This is the stack of the call to the deprecated thing Example `error.stack` output: ``` DeprecationError: my-cool-module deprecated oldfunction at Object. ([eval]-wrapper:6:22) at Module._compile (module.js:456:26) at evalScript (node.js:532:25) at startup (node.js:80:7) at node.js:902:3 ``` ### process.env.NO_DEPRECATION As a user of modules that are deprecated, the environment variable `NO_DEPRECATION` is provided as a quick solution to silencing deprecation warnings from being output. The format of this is similar to that of `DEBUG`: ```sh $ NO_DEPRECATION=my-module,othermod node app.js ``` This will suppress deprecations from being output for "my-module" and "othermod". The value is a list of comma-separated namespaces. To suppress every warning across all namespaces, use the value `*` for a namespace. Providing the argument `--no-deprecation` to the `node` executable will suppress all deprecations (only available in Node.js 0.8 or higher). **NOTE** This will not suppress the deperecations given to any "deprecation" event listeners, just the output to STDERR. ### process.env.TRACE_DEPRECATION As a user of modules that are deprecated, the environment variable `TRACE_DEPRECATION` is provided as a solution to getting more detailed location information in deprecation warnings by including the entire stack trace. The format of this is the same as `NO_DEPRECATION`: ```sh $ TRACE_DEPRECATION=my-module,othermod node app.js ``` This will include stack traces for deprecations being output for "my-module" and "othermod". The value is a list of comma-separated namespaces. To trace every warning across all namespaces, use the value `*` for a namespace. Providing the argument `--trace-deprecation` to the `node` executable will trace all deprecations (only available in Node.js 0.8 or higher). **NOTE** This will not trace the deperecations silenced by `NO_DEPRECATION`. ## Display ![message](files/message.png) When a user calls a function in your library that you mark deprecated, they will see the following written to STDERR (in the given colors, similar colors and layout to the `debug` module): ``` bright cyan bright yellow | | reset cyan | | | | ▼ ▼ ▼ ▼ my-cool-module deprecated oldfunction [eval]-wrapper:6:22 ▲ ▲ ▲ ▲ | | | | namespace | | location of mycoolmod.oldfunction() call | deprecation message the word "deprecated" ``` If the user redirects their STDERR to a file or somewhere that does not support colors, they see (similar layout to the `debug` module): ``` Sun, 15 Jun 2014 05:21:37 GMT my-cool-module deprecated oldfunction at [eval]-wrapper:6:22 ▲ ▲ ▲ ▲ ▲ | | | | | timestamp of message namespace | | location of mycoolmod.oldfunction() call | deprecation message the word "deprecated" ``` ## Examples ### Deprecating all calls to a function This will display a deprecated message about "oldfunction" being deprecated from "my-module" on STDERR. ```js var deprecate = require('depd')('my-cool-module') // message automatically derived from function name // Object.oldfunction exports.oldfunction = deprecate.function(function oldfunction () { // all calls to function are deprecated }) // specific message exports.oldfunction = deprecate.function(function () { // all calls to function are deprecated }, 'oldfunction') ``` ### Conditionally deprecating a function call This will display a deprecated message about "weirdfunction" being deprecated from "my-module" on STDERR when called with less than 2 arguments. ```js var deprecate = require('depd')('my-cool-module') exports.weirdfunction = function () { if (arguments.length < 2) { // calls with 0 or 1 args are deprecated deprecate('weirdfunction args < 2') } } ``` When calling `deprecate` as a function, the warning is counted per call site within your own module, so you can display different deprecations depending on different situations and the users will still get all the warnings: ```js var deprecate = require('depd')('my-cool-module') exports.weirdfunction = function () { if (arguments.length < 2) { // calls with 0 or 1 args are deprecated deprecate('weirdfunction args < 2') } else if (typeof arguments[0] !== 'string') { // calls with non-string first argument are deprecated deprecate('weirdfunction non-string first arg') } } ``` ### Deprecating property access This will display a deprecated message about "oldprop" being deprecated from "my-module" on STDERR when accessed. A deprecation will be displayed when setting the value and when getting the value. ```js var deprecate = require('depd')('my-cool-module') exports.oldprop = 'something' // message automatically derives from property name deprecate.property(exports, 'oldprop') // explicit message deprecate.property(exports, 'oldprop', 'oldprop >= 0.10') ``` ## License [MIT](LICENSE) [npm-version-image]: https://img.shields.io/npm/v/depd.svg [npm-downloads-image]: https://img.shields.io/npm/dm/depd.svg [npm-url]: https://npmjs.org/package/depd [travis-image]: https://img.shields.io/travis/dougwilson/nodejs-depd/master.svg?label=linux [travis-url]: https://travis-ci.org/dougwilson/nodejs-depd [appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/nodejs-depd/master.svg?label=windows [appveyor-url]: https://ci.appveyor.com/project/dougwilson/nodejs-depd [coveralls-image]: https://img.shields.io/coveralls/dougwilson/nodejs-depd/master.svg [coveralls-url]: https://coveralls.io/r/dougwilson/nodejs-depd?branch=master [node-image]: https://img.shields.io/node/v/depd.svg [node-url]: https://nodejs.org/en/download/ /*! * depd * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ 'use strict' /** * Module exports. * @public */ module.exports = depd /** * Create deprecate for namespace in caller. */ function depd (namespace) { if (!namespace) { throw new TypeError('argument namespace is required') } function deprecate (message) { // no-op in browser } deprecate._file = undefined deprecate._ignored = true deprecate._namespace = namespace deprecate._traced = false deprecate._warned = Object.create(null) deprecate.function = wrapfunction deprecate.property = wrapproperty return deprecate } /** * Return a wrapped function in a deprecation message. * * This is a no-op version of the wrapper, which does nothing but call * validation. */ function wrapfunction (fn, message) { if (typeof fn !== 'function') { throw new TypeError('argument fn must be a function') } return fn } /** * Wrap property in a deprecation message. * * This is a no-op version of the wrapper, which does nothing but call * validation. */ function wrapproperty (obj, prop, message) { if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { throw new TypeError('argument obj must be object') } var descriptor = Object.getOwnPropertyDescriptor(obj, prop) if (!descriptor) { throw new TypeError('must call property on owner object') } if (!descriptor.configurable) { throw new TypeError('property must be configurable') } } /*! * depd * Copyright(c) 2014 Douglas Christopher Wilson * MIT Licensed */ 'use strict' /** * Module exports. */ module.exports = callSiteToString /** * Format a CallSite file location to a string. */ function callSiteFileLocation (callSite) { var fileName var fileLocation = '' if (callSite.isNative()) { fileLocation = 'native' } else if (callSite.isEval()) { fileName = callSite.getScriptNameOrSourceURL() if (!fileName) { fileLocation = callSite.getEvalOrigin() } } else { fileName = callSite.getFileName() } if (fileName) { fileLocation += fileName var lineNumber = callSite.getLineNumber() if (lineNumber != null) { fileLocation += ':' + lineNumber var columnNumber = callSite.getColumnNumber() if (columnNumber) { fileLocation += ':' + columnNumber } } } return fileLocation || 'unknown source' } /** * Format a CallSite to a string. */ function callSiteToString (callSite) { var addSuffix = true var fileLocation = callSiteFileLocation(callSite) var functionName = callSite.getFunctionName() var isConstructor = callSite.isConstructor() var isMethodCall = !(callSite.isToplevel() || isConstructor) var line = '' if (isMethodCall) { var methodName = callSite.getMethodName() var typeName = getConstructorName(callSite) if (functionName) { if (typeName && functionName.indexOf(typeName) !== 0) { line += typeName + '.' } line += functionName if (methodName && functionName.lastIndexOf('.' + methodName) !== functionName.length - methodName.length - 1) { line += ' [as ' + methodName + ']' } } else { line += typeName + '.' + (methodName || '') } } else if (isConstructor) { line += 'new ' + (functionName || '') } else if (functionName) { line += functionName } else { addSuffix = false line += fileLocation } if (addSuffix) { line += ' (' + fileLocation + ')' } return line } /** * Get constructor name of reviver. */ function getConstructorName (obj) { var receiver = obj.receiver return (receiver.constructor && receiver.constructor.name) || null } /*! * depd * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ 'use strict' /** * Module exports. * @public */ module.exports = eventListenerCount /** * Get the count of listeners on an event emitter of a specific type. */ function eventListenerCount (emitter, type) { return emitter.listeners(type).length } /*! * depd * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ 'use strict' /** * Module dependencies. * @private */ var EventEmitter = require('events').EventEmitter /** * Module exports. * @public */ lazyProperty(module.exports, 'callSiteToString', function callSiteToString () { var limit = Error.stackTraceLimit var obj = {} var prep = Error.prepareStackTrace function prepareObjectStackTrace (obj, stack) { return stack } Error.prepareStackTrace = prepareObjectStackTrace Error.stackTraceLimit = 2 // capture the stack Error.captureStackTrace(obj) // slice the stack var stack = obj.stack.slice() Error.prepareStackTrace = prep Error.stackTraceLimit = limit return stack[0].toString ? toString : require('./callsite-tostring') }) lazyProperty(module.exports, 'eventListenerCount', function eventListenerCount () { return EventEmitter.listenerCount || require('./event-listener-count') }) /** * Define a lazy property. */ function lazyProperty (obj, prop, getter) { function get () { var val = getter() Object.defineProperty(obj, prop, { configurable: true, enumerable: true, value: val }) return val } Object.defineProperty(obj, prop, { configurable: true, enumerable: true, get: get }) } /** * Call toString() on the obj */ function toString (obj) { return obj.toString() } ISC License Copyright npm, Inc. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND NPM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NPM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "are-we-there-yet", "version": "3.0.0", "description": "Keep track of the overall completion of many disparate processes", "main": "lib/index.js", "scripts": { "test": "tap", "npmclilint": "npmcli-lint", "lint": "eslint '**/*.js'", "lintfix": "npm run lint -- --fix", "posttest": "npm run lint", "postsnap": "npm run lintfix --", "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", "snap": "tap", "postlint": "npm-template-check", "template-copy": "npm-template-copy --force" }, "repository": { "type": "git", "url": "https://github.com/npm/are-we-there-yet.git" }, "author": "GitHub Inc.", "license": "ISC", "bugs": { "url": "https://github.com/npm/are-we-there-yet/issues" }, "homepage": "https://github.com/npm/are-we-there-yet", "devDependencies": { "@npmcli/eslint-config": "^2.0.0", "@npmcli/template-oss": "^2.7.1", "eslint": "^8.8.0", "eslint-plugin-node": "^11.1.0", "tap": "^15.0.9" }, "dependencies": { "delegates": "^1.0.0", "readable-stream": "^3.6.0" }, "files": [ "bin", "lib" ], "engines": { "node": "^12.13.0 || ^14.15.0 || >=16" }, "tap": { "branches": 68, "statements": 92, "functions": 86, "lines": 92 }, "templateOSS": { "version": "2.7.1" } } 'use strict' exports.TrackerGroup = require('./tracker-group.js') exports.Tracker = require('./tracker.js') exports.TrackerStream = require('./tracker-stream.js') 'use strict' var EventEmitter = require('events').EventEmitter var util = require('util') var trackerId = 0 var TrackerBase = module.exports = function (name) { EventEmitter.call(this) this.id = ++trackerId this.name = name } util.inherits(TrackerBase, EventEmitter) 'use strict' var util = require('util') var TrackerBase = require('./tracker-base.js') var Tracker = require('./tracker.js') var TrackerStream = require('./tracker-stream.js') var TrackerGroup = module.exports = function (name) { TrackerBase.call(this, name) this.parentGroup = null this.trackers = [] this.completion = {} this.weight = {} this.totalWeight = 0 this.finished = false this.bubbleChange = bubbleChange(this) } util.inherits(TrackerGroup, TrackerBase) function bubbleChange (trackerGroup) { return function (name, completed, tracker) { trackerGroup.completion[tracker.id] = completed if (trackerGroup.finished) { return } trackerGroup.emit('change', name || trackerGroup.name, trackerGroup.completed(), trackerGroup) } } TrackerGroup.prototype.nameInTree = function () { var names = [] var from = this while (from) { names.unshift(from.name) from = from.parentGroup } return names.join('/') } TrackerGroup.prototype.addUnit = function (unit, weight) { if (unit.addUnit) { var toTest = this while (toTest) { if (unit === toTest) { throw new Error( 'Attempted to add tracker group ' + unit.name + ' to tree that already includes it ' + this.nameInTree(this)) } toTest = toTest.parentGroup } unit.parentGroup = this } this.weight[unit.id] = weight || 1 this.totalWeight += this.weight[unit.id] this.trackers.push(unit) this.completion[unit.id] = unit.completed() unit.on('change', this.bubbleChange) if (!this.finished) { this.emit('change', unit.name, this.completion[unit.id], unit) } return unit } TrackerGroup.prototype.completed = function () { if (this.trackers.length === 0) { return 0 } var valPerWeight = 1 / this.totalWeight var completed = 0 for (var ii = 0; ii < this.trackers.length; ii++) { var trackerId = this.trackers[ii].id completed += valPerWeight * this.weight[trackerId] * this.completion[trackerId] } return completed } TrackerGroup.prototype.newGroup = function (name, weight) { return this.addUnit(new TrackerGroup(name), weight) } TrackerGroup.prototype.newItem = function (name, todo, weight) { return this.addUnit(new Tracker(name, todo), weight) } TrackerGroup.prototype.newStream = function (name, todo, weight) { return this.addUnit(new TrackerStream(name, todo), weight) } TrackerGroup.prototype.finish = function () { this.finished = true if (!this.trackers.length) { this.addUnit(new Tracker(), 1, true) } for (var ii = 0; ii < this.trackers.length; ii++) { var tracker = this.trackers[ii] tracker.finish() tracker.removeListener('change', this.bubbleChange) } this.emit('change', this.name, 1, this) } var buffer = ' ' TrackerGroup.prototype.debug = function (depth) { depth = depth || 0 var indent = depth ? buffer.substr(0, depth) : '' var output = indent + (this.name || 'top') + ': ' + this.completed() + '\n' this.trackers.forEach(function (tracker) { if (tracker instanceof TrackerGroup) { output += tracker.debug(depth + 1) } else { output += indent + ' ' + tracker.name + ': ' + tracker.completed() + '\n' } }) return output } 'use strict' var util = require('util') var stream = require('readable-stream') var delegate = require('delegates') var Tracker = require('./tracker.js') var TrackerStream = module.exports = function (name, size, options) { stream.Transform.call(this, options) this.tracker = new Tracker(name, size) this.name = name this.id = this.tracker.id this.tracker.on('change', delegateChange(this)) } util.inherits(TrackerStream, stream.Transform) function delegateChange (trackerStream) { return function (name, completion, tracker) { trackerStream.emit('change', name, completion, trackerStream) } } TrackerStream.prototype._transform = function (data, encoding, cb) { this.tracker.completeWork(data.length ? data.length : 1) this.push(data) cb() } TrackerStream.prototype._flush = function (cb) { this.tracker.finish() cb() } delegate(TrackerStream.prototype, 'tracker') .method('completed') .method('addWork') .method('finish') 'use strict' var util = require('util') var TrackerBase = require('./tracker-base.js') var Tracker = module.exports = function (name, todo) { TrackerBase.call(this, name) this.workDone = 0 this.workTodo = todo || 0 } util.inherits(Tracker, TrackerBase) Tracker.prototype.completed = function () { return this.workTodo === 0 ? 0 : this.workDone / this.workTodo } Tracker.prototype.addWork = function (work) { this.workTodo += work this.emit('change', this.name, this.completed(), this) } Tracker.prototype.completeWork = function (work) { this.workDone += work if (this.workDone > this.workTodo) { this.workDone = this.workTodo } this.emit('change', this.name, this.completed(), this) } Tracker.prototype.finish = function () { this.workTodo = this.workDone = 1 this.emit('change', this.name, 1, this) } 'use strict'; function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } var codes = {}; function createErrorType(code, message, Base) { if (!Base) { Base = Error; } function getMessage(arg1, arg2, arg3) { if (typeof message === 'string') { return message; } else { return message(arg1, arg2, arg3); } } var NodeError = /*#__PURE__*/ function (_Base) { _inheritsLoose(NodeError, _Base); function NodeError(arg1, arg2, arg3) { return _Base.call(this, getMessage(arg1, arg2, arg3)) || this; } return NodeError; }(Base); NodeError.prototype.name = Base.name; NodeError.prototype.code = code; codes[code] = NodeError; } // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js function oneOf(expected, thing) { if (Array.isArray(expected)) { var len = expected.length; expected = expected.map(function (i) { return String(i); }); if (len > 2) { return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(', '), ", or ") + expected[len - 1]; } else if (len === 2) { return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]); } else { return "of ".concat(thing, " ").concat(expected[0]); } } else { return "of ".concat(thing, " ").concat(String(expected)); } } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith function startsWith(str, search, pos) { return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith function endsWith(str, search, this_len) { if (this_len === undefined || this_len > str.length) { this_len = str.length; } return str.substring(this_len - search.length, this_len) === search; } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes function includes(str, search, start) { if (typeof start !== 'number') { start = 0; } if (start + search.length > str.length) { return false; } else { return str.indexOf(search, start) !== -1; } } createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) { return 'The value "' + value + '" is invalid for option "' + name + '"'; }, TypeError); createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { // determiner: 'must be' or 'must not be' var determiner; if (typeof expected === 'string' && startsWith(expected, 'not ')) { determiner = 'must not be'; expected = expected.replace(/^not /, ''); } else { determiner = 'must be'; } var msg; if (endsWith(name, ' argument')) { // For cases like 'first argument' msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, 'type')); } else { var type = includes(name, '.') ? 'property' : 'argument'; msg = "The \"".concat(name, "\" ").concat(type, " ").concat(determiner, " ").concat(oneOf(expected, 'type')); } msg += ". Received type ".concat(typeof actual); return msg; }, TypeError); createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF'); createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) { return 'The ' + name + ' method is not implemented'; }); createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close'); createErrorType('ERR_STREAM_DESTROYED', function (name) { return 'Cannot call ' + name + ' after a stream was destroyed'; }); createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times'); createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable'); createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end'); createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError); createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { return 'Unknown encoding: ' + arg; }, TypeError); createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); module.exports.codes = codes; 'use strict'; const codes = {}; function createErrorType(code, message, Base) { if (!Base) { Base = Error } function getMessage (arg1, arg2, arg3) { if (typeof message === 'string') { return message } else { return message(arg1, arg2, arg3) } } class NodeError extends Base { constructor (arg1, arg2, arg3) { super(getMessage(arg1, arg2, arg3)); } } NodeError.prototype.name = Base.name; NodeError.prototype.code = code; codes[code] = NodeError; } // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js function oneOf(expected, thing) { if (Array.isArray(expected)) { const len = expected.length; expected = expected.map((i) => String(i)); if (len > 2) { return `one of ${thing} ${expected.slice(0, len - 1).join(', ')}, or ` + expected[len - 1]; } else if (len === 2) { return `one of ${thing} ${expected[0]} or ${expected[1]}`; } else { return `of ${thing} ${expected[0]}`; } } else { return `of ${thing} ${String(expected)}`; } } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith function startsWith(str, search, pos) { return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith function endsWith(str, search, this_len) { if (this_len === undefined || this_len > str.length) { this_len = str.length; } return str.substring(this_len - search.length, this_len) === search; } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes function includes(str, search, start) { if (typeof start !== 'number') { start = 0; } if (start + search.length > str.length) { return false; } else { return str.indexOf(search, start) !== -1; } } createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) { return 'The value "' + value + '" is invalid for option "' + name + '"' }, TypeError); createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { // determiner: 'must be' or 'must not be' let determiner; if (typeof expected === 'string' && startsWith(expected, 'not ')) { determiner = 'must not be'; expected = expected.replace(/^not /, ''); } else { determiner = 'must be'; } let msg; if (endsWith(name, ' argument')) { // For cases like 'first argument' msg = `The ${name} ${determiner} ${oneOf(expected, 'type')}`; } else { const type = includes(name, '.') ? 'property' : 'argument'; msg = `The "${name}" ${type} ${determiner} ${oneOf(expected, 'type')}`; } msg += `. Received type ${typeof actual}`; return msg; }, TypeError); createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF'); createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) { return 'The ' + name + ' method is not implemented' }); createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close'); createErrorType('ERR_STREAM_DESTROYED', function (name) { return 'Cannot call ' + name + ' after a stream was destroyed'; }); createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times'); createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable'); createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end'); createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError); createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { return 'Unknown encoding: ' + arg }, TypeError); createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); module.exports.codes = codes; 'use strict' var experimentalWarnings = new Set(); function emitExperimentalWarning(feature) { if (experimentalWarnings.has(feature)) return; var msg = feature + ' is an experimental feature. This feature could ' + 'change at any time'; experimentalWarnings.add(feature); process.emitWarning(msg, 'ExperimentalWarning'); } function noop() {} module.exports.emitExperimentalWarning = process.emitWarning ? emitExperimentalWarning : noop; ### Streams Working Group The Node.js Streams is jointly governed by a Working Group (WG) that is responsible for high-level guidance of the project. The WG has final authority over this project including: * Technical direction * Project governance and process (including this policy) * Contribution policy * GitHub repository hosting * Conduct guidelines * Maintaining the list of additional Collaborators For the current list of WG members, see the project [README.md](./README.md#current-project-team-members). ### Collaborators The readable-stream GitHub repository is maintained by the WG and additional Collaborators who are added by the WG on an ongoing basis. Individuals making significant and valuable contributions are made Collaborators and given commit-access to the project. These individuals are identified by the WG and their addition as Collaborators is discussed during the WG meeting. _Note:_ If you make a significant contribution and are not considered for commit-access log an issue or contact a WG member directly and it will be brought up in the next WG meeting. Modifications of the contents of the readable-stream repository are made on a collaborative basis. Anybody with a GitHub account may propose a modification via pull request and it will be considered by the project Collaborators. All pull requests must be reviewed and accepted by a Collaborator with sufficient expertise who is able to take full responsibility for the change. In the case of pull requests proposed by an existing Collaborator, an additional Collaborator is required for sign-off. Consensus should be sought if additional Collaborators participate and there is disagreement around a particular modification. See _Consensus Seeking Process_ below for further detail on the consensus model used for governance. Collaborators may opt to elevate significant or controversial modifications, or modifications that have not found consensus to the WG for discussion by assigning the ***WG-agenda*** tag to a pull request or issue. The WG should serve as the final arbiter where required. For the current list of Collaborators, see the project [README.md](./README.md#members). ### WG Membership WG seats are not time-limited. There is no fixed size of the WG. However, the expected target is between 6 and 12, to ensure adequate coverage of important areas of expertise, balanced with the ability to make decisions efficiently. There is no specific set of requirements or qualifications for WG membership beyond these rules. The WG may add additional members to the WG by unanimous consensus. A WG member may be removed from the WG by voluntary resignation, or by unanimous consensus of all other WG members. Changes to WG membership should be posted in the agenda, and may be suggested as any other agenda item (see "WG Meetings" below). If an addition or removal is proposed during a meeting, and the full WG is not in attendance to participate, then the addition or removal is added to the agenda for the subsequent meeting. This is to ensure that all members are given the opportunity to participate in all membership decisions. If a WG member is unable to attend a meeting where a planned membership decision is being made, then their consent is assumed. No more than 1/3 of the WG members may be affiliated with the same employer. If removal or resignation of a WG member, or a change of employment by a WG member, creates a situation where more than 1/3 of the WG membership shares an employer, then the situation must be immediately remedied by the resignation or removal of one or more WG members affiliated with the over-represented employer(s). ### WG Meetings The WG meets occasionally on a Google Hangout On Air. A designated moderator approved by the WG runs the meeting. Each meeting should be published to YouTube. Items are added to the WG agenda that are considered contentious or are modifications of governance, contribution policy, WG membership, or release process. The intention of the agenda is not to approve or review all patches; that should happen continuously on GitHub and be handled by the larger group of Collaborators. Any community member or contributor can ask that something be added to the next meeting's agenda by logging a GitHub Issue. Any Collaborator, WG member or the moderator can add the item to the agenda by adding the ***WG-agenda*** tag to the issue. Prior to each WG meeting the moderator will share the Agenda with members of the WG. WG members can add any items they like to the agenda at the beginning of each meeting. The moderator and the WG cannot veto or remove items. The WG may invite persons or representatives from certain projects to participate in a non-voting capacity. The moderator is responsible for summarizing the discussion of each agenda item and sends it as a pull request after the meeting. ### Consensus Seeking Process The WG follows a [Consensus Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making) decision-making model. When an agenda item has appeared to reach a consensus the moderator will ask "Does anyone object?" as a final call for dissent from the consensus. If an agenda item cannot reach a consensus a WG member can call for either a closing vote or a vote to table the issue to the next meeting. The call for a vote must be seconded by a majority of the WG or else the discussion will continue. Simple majority wins. Note that changes to WG membership require a majority consensus. See "WG Membership" above. Node.js is licensed for use as follows: """ Copyright Node.js contributors. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ This license applies to parts of Node.js originating from the https://github.com/joyent/node repository: """ Copyright Joyent, Inc. and other Node contributors. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ { "name": "readable-stream", "version": "3.6.0", "description": "Streams3, a user-land copy of the stream library from Node.js", "main": "readable.js", "engines": { "node": ">= 6" }, "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" }, "devDependencies": { "@babel/cli": "^7.2.0", "@babel/core": "^7.2.0", "@babel/polyfill": "^7.0.0", "@babel/preset-env": "^7.2.0", "airtap": "0.0.9", "assert": "^1.4.0", "bl": "^2.0.0", "deep-strict-equal": "^0.2.0", "events.once": "^2.0.2", "glob": "^7.1.2", "gunzip-maybe": "^1.4.1", "hyperquest": "^2.1.3", "lolex": "^2.6.0", "nyc": "^11.0.0", "pump": "^3.0.0", "rimraf": "^2.6.2", "tap": "^12.0.0", "tape": "^4.9.0", "tar-fs": "^1.16.2", "util-promisify": "^2.1.0" }, "scripts": { "test": "tap -J --no-esm test/parallel/*.js test/ours/*.js", "ci": "TAP=1 tap --no-esm test/parallel/*.js test/ours/*.js | tee test.tap", "test-browsers": "airtap --sauce-connect --loopback airtap.local -- test/browser.js", "test-browser-local": "airtap --open --local -- test/browser.js", "cover": "nyc npm test", "report": "nyc report --reporter=lcov", "update-browser-errors": "babel -o errors-browser.js errors.js" }, "repository": { "type": "git", "url": "git://github.com/nodejs/readable-stream" }, "keywords": [ "readable", "stream", "pipe" ], "browser": { "util": false, "worker_threads": false, "./errors": "./errors-browser.js", "./readable.js": "./readable-browser.js", "./lib/internal/streams/from.js": "./lib/internal/streams/from-browser.js", "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js" }, "nyc": { "include": [ "lib/**.js" ] }, "license": "MIT" } exports = module.exports = require('./lib/_stream_readable.js'); exports.Stream = exports; exports.Readable = exports; exports.Writable = require('./lib/_stream_writable.js'); exports.Duplex = require('./lib/_stream_duplex.js'); exports.Transform = require('./lib/_stream_transform.js'); exports.PassThrough = require('./lib/_stream_passthrough.js'); exports.finished = require('./lib/internal/streams/end-of-stream.js'); exports.pipeline = require('./lib/internal/streams/pipeline.js'); var Stream = require('stream'); if (process.env.READABLE_STREAM === 'disable' && Stream) { module.exports = Stream.Readable; Object.assign(module.exports, Stream); module.exports.Stream = Stream; } else { exports = module.exports = require('./lib/_stream_readable.js'); exports.Stream = Stream || exports; exports.Readable = exports; exports.Writable = require('./lib/_stream_writable.js'); exports.Duplex = require('./lib/_stream_duplex.js'); exports.Transform = require('./lib/_stream_transform.js'); exports.PassThrough = require('./lib/_stream_passthrough.js'); exports.finished = require('./lib/internal/streams/end-of-stream.js'); exports.pipeline = require('./lib/internal/streams/pipeline.js'); } // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // a duplex stream is just a stream that is both readable and writable. // Since JS doesn't have multiple prototypal inheritance, this class // prototypally inherits from Readable, and then parasitically from // Writable. 'use strict'; /**/ var objectKeys = Object.keys || function (obj) { var keys = []; for (var key in obj) { keys.push(key); } return keys; }; /**/ module.exports = Duplex; var Readable = require('./_stream_readable'); var Writable = require('./_stream_writable'); require('inherits')(Duplex, Readable); { // Allow the keys array to be GC'ed. var keys = objectKeys(Writable.prototype); for (var v = 0; v < keys.length; v++) { var method = keys[v]; if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; } } function Duplex(options) { if (!(this instanceof Duplex)) return new Duplex(options); Readable.call(this, options); Writable.call(this, options); this.allowHalfOpen = true; if (options) { if (options.readable === false) this.readable = false; if (options.writable === false) this.writable = false; if (options.allowHalfOpen === false) { this.allowHalfOpen = false; this.once('end', onend); } } } Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState.highWaterMark; } }); Object.defineProperty(Duplex.prototype, 'writableBuffer', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState && this._writableState.getBuffer(); } }); Object.defineProperty(Duplex.prototype, 'writableLength', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState.length; } }); // the no-half-open enforcer function onend() { // If the writable side ended, then we're ok. if (this._writableState.ended) return; // no more data can be written. // But allow more writes to happen in this tick. process.nextTick(onEndNT, this); } function onEndNT(self) { self.end(); } Object.defineProperty(Duplex.prototype, 'destroyed', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { if (this._readableState === undefined || this._writableState === undefined) { return false; } return this._readableState.destroyed && this._writableState.destroyed; }, set: function set(value) { // we ignore the value if the stream // has not been initialized yet if (this._readableState === undefined || this._writableState === undefined) { return; } // backward compatibility, the user is explicitly // managing destroyed this._readableState.destroyed = value; this._writableState.destroyed = value; } });// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // a passthrough stream. // basically just the most minimal sort of Transform stream. // Every written chunk gets output as-is. 'use strict'; module.exports = PassThrough; var Transform = require('./_stream_transform'); require('inherits')(PassThrough, Transform); function PassThrough(options) { if (!(this instanceof PassThrough)) return new PassThrough(options); Transform.call(this, options); } PassThrough.prototype._transform = function (chunk, encoding, cb) { cb(null, chunk); };// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; module.exports = Readable; /**/ var Duplex; /**/ Readable.ReadableState = ReadableState; /**/ var EE = require('events').EventEmitter; var EElistenerCount = function EElistenerCount(emitter, type) { return emitter.listeners(type).length; }; /**/ /**/ var Stream = require('./internal/streams/stream'); /**/ var Buffer = require('buffer').Buffer; var OurUint8Array = global.Uint8Array || function () {}; function _uint8ArrayToBuffer(chunk) { return Buffer.from(chunk); } function _isUint8Array(obj) { return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; } /**/ var debugUtil = require('util'); var debug; if (debugUtil && debugUtil.debuglog) { debug = debugUtil.debuglog('stream'); } else { debug = function debug() {}; } /**/ var BufferList = require('./internal/streams/buffer_list'); var destroyImpl = require('./internal/streams/destroy'); var _require = require('./internal/streams/state'), getHighWaterMark = _require.getHighWaterMark; var _require$codes = require('../errors').codes, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; // Lazy loaded to improve the startup performance. var StringDecoder; var createReadableStreamAsyncIterator; var from; require('inherits')(Readable, Stream); var errorOrDestroy = destroyImpl.errorOrDestroy; var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; function prependListener(emitter, event, fn) { // Sadly this is not cacheable as some libraries bundle their own // event emitter implementation with them. if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); // This is a hack to make sure that our error handler is attached before any // userland ones. NEVER DO THIS. This is here only because this code needs // to continue to work with older versions of Node.js that do not include // the prependListener() method. The goal is to eventually remove this hack. if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; } function ReadableState(options, stream, isDuplex) { Duplex = Duplex || require('./_stream_duplex'); options = options || {}; // Duplex streams are both readable and writable, but share // the same options object. // However, some cases require setting options to different // values for the readable and the writable sides of the duplex stream. // These options can be provided separately as readableXXX and writableXXX. if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag. Used to make read(n) ignore n and to // make all the buffer merging and length checks go away this.objectMode = !!options.objectMode; if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer // Note: 0 is a valid value, means "don't call _read preemptively ever" this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); // A linked list is used to store data chunks instead of an array because the // linked list can remove elements from the beginning faster than // array.shift() this.buffer = new BufferList(); this.length = 0; this.pipes = null; this.pipesCount = 0; this.flowing = null; this.ended = false; this.endEmitted = false; this.reading = false; // a flag to be able to tell if the event 'readable'/'data' is emitted // immediately, or on a later tick. We set this to true at first, because // any actions that shouldn't happen until "later" should generally also // not happen before the first read call. this.sync = true; // whenever we return null, then we set a flag to say // that we're awaiting a 'readable' event emission. this.needReadable = false; this.emittedReadable = false; this.readableListening = false; this.resumeScheduled = false; this.paused = true; // Should close be emitted on destroy. Defaults to true. this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'end' (and potentially 'finish') this.autoDestroy = !!options.autoDestroy; // has it been destroyed this.destroyed = false; // Crypto is kind of old and crusty. Historically, its default string // encoding is 'binary' so we have to make this configurable. // Everything else in the universe uses 'utf8', though. this.defaultEncoding = options.defaultEncoding || 'utf8'; // the number of writers that are awaiting a drain event in .pipe()s this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled this.readingMore = false; this.decoder = null; this.encoding = null; if (options.encoding) { if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; this.decoder = new StringDecoder(options.encoding); this.encoding = options.encoding; } } function Readable(options) { Duplex = Duplex || require('./_stream_duplex'); if (!(this instanceof Readable)) return new Readable(options); // Checking for a Stream.Duplex instance is faster here instead of inside // the ReadableState constructor, at least with V8 6.5 var isDuplex = this instanceof Duplex; this._readableState = new ReadableState(options, this, isDuplex); // legacy this.readable = true; if (options) { if (typeof options.read === 'function') this._read = options.read; if (typeof options.destroy === 'function') this._destroy = options.destroy; } Stream.call(this); } Object.defineProperty(Readable.prototype, 'destroyed', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { if (this._readableState === undefined) { return false; } return this._readableState.destroyed; }, set: function set(value) { // we ignore the value if the stream // has not been initialized yet if (!this._readableState) { return; } // backward compatibility, the user is explicitly // managing destroyed this._readableState.destroyed = value; } }); Readable.prototype.destroy = destroyImpl.destroy; Readable.prototype._undestroy = destroyImpl.undestroy; Readable.prototype._destroy = function (err, cb) { cb(err); }; // Manually shove something into the read() buffer. // This returns true if the highWaterMark has not been hit yet, // similar to how Writable.write() returns true if you should // write() some more. Readable.prototype.push = function (chunk, encoding) { var state = this._readableState; var skipChunkCheck; if (!state.objectMode) { if (typeof chunk === 'string') { encoding = encoding || state.defaultEncoding; if (encoding !== state.encoding) { chunk = Buffer.from(chunk, encoding); encoding = ''; } skipChunkCheck = true; } } else { skipChunkCheck = true; } return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); }; // Unshift should *always* be something directly out of read() Readable.prototype.unshift = function (chunk) { return readableAddChunk(this, chunk, null, true, false); }; function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { debug('readableAddChunk', chunk); var state = stream._readableState; if (chunk === null) { state.reading = false; onEofChunk(stream, state); } else { var er; if (!skipChunkCheck) er = chunkInvalid(state, chunk); if (er) { errorOrDestroy(stream, er); } else if (state.objectMode || chunk && chunk.length > 0) { if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { chunk = _uint8ArrayToBuffer(chunk); } if (addToFront) { if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true); } else if (state.ended) { errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF()); } else if (state.destroyed) { return false; } else { state.reading = false; if (state.decoder && !encoding) { chunk = state.decoder.write(chunk); if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); } else { addChunk(stream, state, chunk, false); } } } else if (!addToFront) { state.reading = false; maybeReadMore(stream, state); } } // We can push more data if we are below the highWaterMark. // Also, if we have no data yet, we can stand some more bytes. // This is to work around cases where hwm=0, such as the repl. return !state.ended && (state.length < state.highWaterMark || state.length === 0); } function addChunk(stream, state, chunk, addToFront) { if (state.flowing && state.length === 0 && !state.sync) { state.awaitDrain = 0; stream.emit('data', chunk); } else { // update the buffer info. state.length += state.objectMode ? 1 : chunk.length; if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); if (state.needReadable) emitReadable(stream); } maybeReadMore(stream, state); } function chunkInvalid(state, chunk) { var er; if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk); } return er; } Readable.prototype.isPaused = function () { return this._readableState.flowing === false; }; // backwards compatibility. Readable.prototype.setEncoding = function (enc) { if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; var decoder = new StringDecoder(enc); this._readableState.decoder = decoder; // If setEncoding(null), decoder.encoding equals utf8 this._readableState.encoding = this._readableState.decoder.encoding; // Iterate over current buffer to convert already stored Buffers: var p = this._readableState.buffer.head; var content = ''; while (p !== null) { content += decoder.write(p.data); p = p.next; } this._readableState.buffer.clear(); if (content !== '') this._readableState.buffer.push(content); this._readableState.length = content.length; return this; }; // Don't raise the hwm > 1GB var MAX_HWM = 0x40000000; function computeNewHighWaterMark(n) { if (n >= MAX_HWM) { // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE. n = MAX_HWM; } else { // Get the next highest power of 2 to prevent increasing hwm excessively in // tiny amounts n--; n |= n >>> 1; n |= n >>> 2; n |= n >>> 4; n |= n >>> 8; n |= n >>> 16; n++; } return n; } // This function is designed to be inlinable, so please take care when making // changes to the function body. function howMuchToRead(n, state) { if (n <= 0 || state.length === 0 && state.ended) return 0; if (state.objectMode) return 1; if (n !== n) { // Only flow one buffer at a time if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; } // If we're asking for more than the current hwm, then raise the hwm. if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); if (n <= state.length) return n; // Don't have enough if (!state.ended) { state.needReadable = true; return 0; } return state.length; } // you can override either this method, or the async _read(n) below. Readable.prototype.read = function (n) { debug('read', n); n = parseInt(n, 10); var state = this._readableState; var nOrig = n; if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we // already have a bunch of data in the buffer, then just trigger // the 'readable' event and move on. if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { debug('read: emitReadable', state.length, state.ended); if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); return null; } n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up. if (n === 0 && state.ended) { if (state.length === 0) endReadable(this); return null; } // All the actual chunk generation logic needs to be // *below* the call to _read. The reason is that in certain // synthetic stream cases, such as passthrough streams, _read // may be a completely synchronous operation which may change // the state of the read buffer, providing enough data when // before there was *not* enough. // // So, the steps are: // 1. Figure out what the state of things will be after we do // a read from the buffer. // // 2. If that resulting state will trigger a _read, then call _read. // Note that this may be asynchronous, or synchronous. Yes, it is // deeply ugly to write APIs this way, but that still doesn't mean // that the Readable class should behave improperly, as streams are // designed to be sync/async agnostic. // Take note if the _read call is sync or async (ie, if the read call // has returned yet), so that we know whether or not it's safe to emit // 'readable' etc. // // 3. Actually pull the requested chunks out of the buffer and return. // if we need a readable event, then we need to do some reading. var doRead = state.needReadable; debug('need readable', doRead); // if we currently have less than the highWaterMark, then also read some if (state.length === 0 || state.length - n < state.highWaterMark) { doRead = true; debug('length less than watermark', doRead); } // however, if we've ended, then there's no point, and if we're already // reading, then it's unnecessary. if (state.ended || state.reading) { doRead = false; debug('reading or ended', doRead); } else if (doRead) { debug('do read'); state.reading = true; state.sync = true; // if the length is currently zero, then we *need* a readable event. if (state.length === 0) state.needReadable = true; // call internal read method this._read(state.highWaterMark); state.sync = false; // If _read pushed data synchronously, then `reading` will be false, // and we need to re-evaluate how much data we can return to the user. if (!state.reading) n = howMuchToRead(nOrig, state); } var ret; if (n > 0) ret = fromList(n, state);else ret = null; if (ret === null) { state.needReadable = state.length <= state.highWaterMark; n = 0; } else { state.length -= n; state.awaitDrain = 0; } if (state.length === 0) { // If we have nothing in the buffer, then we want to know // as soon as we *do* get something into the buffer. if (!state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick. if (nOrig !== n && state.ended) endReadable(this); } if (ret !== null) this.emit('data', ret); return ret; }; function onEofChunk(stream, state) { debug('onEofChunk'); if (state.ended) return; if (state.decoder) { var chunk = state.decoder.end(); if (chunk && chunk.length) { state.buffer.push(chunk); state.length += state.objectMode ? 1 : chunk.length; } } state.ended = true; if (state.sync) { // if we are sync, wait until next tick to emit the data. // Otherwise we risk emitting data in the flow() // the readable code triggers during a read() call emitReadable(stream); } else { // emit 'readable' now to make sure it gets picked up. state.needReadable = false; if (!state.emittedReadable) { state.emittedReadable = true; emitReadable_(stream); } } } // Don't emit readable right away in sync mode, because this can trigger // another read() call => stack overflow. This way, it might trigger // a nextTick recursion warning, but that's not so bad. function emitReadable(stream) { var state = stream._readableState; debug('emitReadable', state.needReadable, state.emittedReadable); state.needReadable = false; if (!state.emittedReadable) { debug('emitReadable', state.flowing); state.emittedReadable = true; process.nextTick(emitReadable_, stream); } } function emitReadable_(stream) { var state = stream._readableState; debug('emitReadable_', state.destroyed, state.length, state.ended); if (!state.destroyed && (state.length || state.ended)) { stream.emit('readable'); state.emittedReadable = false; } // The stream needs another readable event if // 1. It is not flowing, as the flow mechanism will take // care of it. // 2. It is not ended. // 3. It is below the highWaterMark, so we can schedule // another readable later. state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; flow(stream); } // at this point, the user has presumably seen the 'readable' event, // and called read() to consume some data. that may have triggered // in turn another _read(n) call, in which case reading = true if // it's in progress. // However, if we're not ended, or reading, and the length < hwm, // then go ahead and try to read some more preemptively. function maybeReadMore(stream, state) { if (!state.readingMore) { state.readingMore = true; process.nextTick(maybeReadMore_, stream, state); } } function maybeReadMore_(stream, state) { // Attempt to read more data if we should. // // The conditions for reading more data are (one of): // - Not enough data buffered (state.length < state.highWaterMark). The loop // is responsible for filling the buffer with enough data if such data // is available. If highWaterMark is 0 and we are not in the flowing mode // we should _not_ attempt to buffer any extra data. We'll get more data // when the stream consumer calls read() instead. // - No data in the buffer, and the stream is in flowing mode. In this mode // the loop below is responsible for ensuring read() is called. Failing to // call read here would abort the flow and there's no other mechanism for // continuing the flow if the stream consumer has just subscribed to the // 'data' event. // // In addition to the above conditions to keep reading data, the following // conditions prevent the data from being read: // - The stream has ended (state.ended). // - There is already a pending 'read' operation (state.reading). This is a // case where the the stream has called the implementation defined _read() // method, but they are processing the call asynchronously and have _not_ // called push() with new data. In this case we skip performing more // read()s. The execution ends in this method again after the _read() ends // up calling push() with more data. while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { var len = state.length; debug('maybeReadMore read 0'); stream.read(0); if (len === state.length) // didn't get any data, stop spinning. break; } state.readingMore = false; } // abstract method. to be overridden in specific implementation classes. // call cb(er, data) where data is <= n in length. // for virtual (non-string, non-buffer) streams, "length" is somewhat // arbitrary, and perhaps not very meaningful. Readable.prototype._read = function (n) { errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()')); }; Readable.prototype.pipe = function (dest, pipeOpts) { var src = this; var state = this._readableState; switch (state.pipesCount) { case 0: state.pipes = dest; break; case 1: state.pipes = [state.pipes, dest]; break; default: state.pipes.push(dest); break; } state.pipesCount += 1; debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; var endFn = doEnd ? onend : unpipe; if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn); dest.on('unpipe', onunpipe); function onunpipe(readable, unpipeInfo) { debug('onunpipe'); if (readable === src) { if (unpipeInfo && unpipeInfo.hasUnpiped === false) { unpipeInfo.hasUnpiped = true; cleanup(); } } } function onend() { debug('onend'); dest.end(); } // when the dest drains, it reduces the awaitDrain counter // on the source. This would be more elegant with a .once() // handler in flow(), but adding and removing repeatedly is // too slow. var ondrain = pipeOnDrain(src); dest.on('drain', ondrain); var cleanedUp = false; function cleanup() { debug('cleanup'); // cleanup event handlers once the pipe is broken dest.removeListener('close', onclose); dest.removeListener('finish', onfinish); dest.removeListener('drain', ondrain); dest.removeListener('error', onerror); dest.removeListener('unpipe', onunpipe); src.removeListener('end', onend); src.removeListener('end', unpipe); src.removeListener('data', ondata); cleanedUp = true; // if the reader is waiting for a drain event from this // specific writer, then it would cause it to never start // flowing again. // So, if this is awaiting a drain, then we just call it now. // If we don't know, then assume that we are waiting for one. if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); } src.on('data', ondata); function ondata(chunk) { debug('ondata'); var ret = dest.write(chunk); debug('dest.write', ret); if (ret === false) { // If the user unpiped during `dest.write()`, it is possible // to get stuck in a permanently paused state if that write // also returned false. // => Check whether `dest` is still a piping destination. if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { debug('false write response, pause', state.awaitDrain); state.awaitDrain++; } src.pause(); } } // if the dest has an error, then stop piping into it. // however, don't suppress the throwing behavior for this. function onerror(er) { debug('onerror', er); unpipe(); dest.removeListener('error', onerror); if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er); } // Make sure our error handler is attached before userland ones. prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once. function onclose() { dest.removeListener('finish', onfinish); unpipe(); } dest.once('close', onclose); function onfinish() { debug('onfinish'); dest.removeListener('close', onclose); unpipe(); } dest.once('finish', onfinish); function unpipe() { debug('unpipe'); src.unpipe(dest); } // tell the dest that it's being piped to dest.emit('pipe', src); // start the flow if it hasn't been started already. if (!state.flowing) { debug('pipe resume'); src.resume(); } return dest; }; function pipeOnDrain(src) { return function pipeOnDrainFunctionResult() { var state = src._readableState; debug('pipeOnDrain', state.awaitDrain); if (state.awaitDrain) state.awaitDrain--; if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { state.flowing = true; flow(src); } }; } Readable.prototype.unpipe = function (dest) { var state = this._readableState; var unpipeInfo = { hasUnpiped: false }; // if we're not piping anywhere, then do nothing. if (state.pipesCount === 0) return this; // just one destination. most common case. if (state.pipesCount === 1) { // passed in one, but it's not the right one. if (dest && dest !== state.pipes) return this; if (!dest) dest = state.pipes; // got a match. state.pipes = null; state.pipesCount = 0; state.flowing = false; if (dest) dest.emit('unpipe', this, unpipeInfo); return this; } // slow case. multiple pipe destinations. if (!dest) { // remove all. var dests = state.pipes; var len = state.pipesCount; state.pipes = null; state.pipesCount = 0; state.flowing = false; for (var i = 0; i < len; i++) { dests[i].emit('unpipe', this, { hasUnpiped: false }); } return this; } // try to find the right one. var index = indexOf(state.pipes, dest); if (index === -1) return this; state.pipes.splice(index, 1); state.pipesCount -= 1; if (state.pipesCount === 1) state.pipes = state.pipes[0]; dest.emit('unpipe', this, unpipeInfo); return this; }; // set up data events if they are asked for // Ensure readable listeners eventually get something Readable.prototype.on = function (ev, fn) { var res = Stream.prototype.on.call(this, ev, fn); var state = this._readableState; if (ev === 'data') { // update readableListening so that resume() may be a no-op // a few lines down. This is needed to support once('readable'). state.readableListening = this.listenerCount('readable') > 0; // Try start flowing on next tick if stream isn't explicitly paused if (state.flowing !== false) this.resume(); } else if (ev === 'readable') { if (!state.endEmitted && !state.readableListening) { state.readableListening = state.needReadable = true; state.flowing = false; state.emittedReadable = false; debug('on readable', state.length, state.reading); if (state.length) { emitReadable(this); } else if (!state.reading) { process.nextTick(nReadingNextTick, this); } } } return res; }; Readable.prototype.addListener = Readable.prototype.on; Readable.prototype.removeListener = function (ev, fn) { var res = Stream.prototype.removeListener.call(this, ev, fn); if (ev === 'readable') { // We need to check if there is someone still listening to // readable and reset the state. However this needs to happen // after readable has been emitted but before I/O (nextTick) to // support once('readable', fn) cycles. This means that calling // resume within the same tick will have no // effect. process.nextTick(updateReadableListening, this); } return res; }; Readable.prototype.removeAllListeners = function (ev) { var res = Stream.prototype.removeAllListeners.apply(this, arguments); if (ev === 'readable' || ev === undefined) { // We need to check if there is someone still listening to // readable and reset the state. However this needs to happen // after readable has been emitted but before I/O (nextTick) to // support once('readable', fn) cycles. This means that calling // resume within the same tick will have no // effect. process.nextTick(updateReadableListening, this); } return res; }; function updateReadableListening(self) { var state = self._readableState; state.readableListening = self.listenerCount('readable') > 0; if (state.resumeScheduled && !state.paused) { // flowing needs to be set to true now, otherwise // the upcoming resume will not flow. state.flowing = true; // crude way to check if we should resume } else if (self.listenerCount('data') > 0) { self.resume(); } } function nReadingNextTick(self) { debug('readable nexttick read 0'); self.read(0); } // pause() and resume() are remnants of the legacy readable stream API // If the user uses them, then switch into old mode. Readable.prototype.resume = function () { var state = this._readableState; if (!state.flowing) { debug('resume'); // we flow only if there is no one listening // for readable, but we still have to call // resume() state.flowing = !state.readableListening; resume(this, state); } state.paused = false; return this; }; function resume(stream, state) { if (!state.resumeScheduled) { state.resumeScheduled = true; process.nextTick(resume_, stream, state); } } function resume_(stream, state) { debug('resume', state.reading); if (!state.reading) { stream.read(0); } state.resumeScheduled = false; stream.emit('resume'); flow(stream); if (state.flowing && !state.reading) stream.read(0); } Readable.prototype.pause = function () { debug('call pause flowing=%j', this._readableState.flowing); if (this._readableState.flowing !== false) { debug('pause'); this._readableState.flowing = false; this.emit('pause'); } this._readableState.paused = true; return this; }; function flow(stream) { var state = stream._readableState; debug('flow', state.flowing); while (state.flowing && stream.read() !== null) { ; } } // wrap an old-style stream as the async data source. // This is *not* part of the readable stream interface. // It is an ugly unfortunate mess of history. Readable.prototype.wrap = function (stream) { var _this = this; var state = this._readableState; var paused = false; stream.on('end', function () { debug('wrapped end'); if (state.decoder && !state.ended) { var chunk = state.decoder.end(); if (chunk && chunk.length) _this.push(chunk); } _this.push(null); }); stream.on('data', function (chunk) { debug('wrapped data'); if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; var ret = _this.push(chunk); if (!ret) { paused = true; stream.pause(); } }); // proxy all the other methods. // important when wrapping filters and duplexes. for (var i in stream) { if (this[i] === undefined && typeof stream[i] === 'function') { this[i] = function methodWrap(method) { return function methodWrapReturnFunction() { return stream[method].apply(stream, arguments); }; }(i); } } // proxy certain important events. for (var n = 0; n < kProxyEvents.length; n++) { stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); } // when we try to consume some more bytes, simply unpause the // underlying stream. this._read = function (n) { debug('wrapped _read', n); if (paused) { paused = false; stream.resume(); } }; return this; }; if (typeof Symbol === 'function') { Readable.prototype[Symbol.asyncIterator] = function () { if (createReadableStreamAsyncIterator === undefined) { createReadableStreamAsyncIterator = require('./internal/streams/async_iterator'); } return createReadableStreamAsyncIterator(this); }; } Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._readableState.highWaterMark; } }); Object.defineProperty(Readable.prototype, 'readableBuffer', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._readableState && this._readableState.buffer; } }); Object.defineProperty(Readable.prototype, 'readableFlowing', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._readableState.flowing; }, set: function set(state) { if (this._readableState) { this._readableState.flowing = state; } } }); // exposed for testing purposes only. Readable._fromList = fromList; Object.defineProperty(Readable.prototype, 'readableLength', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._readableState.length; } }); // Pluck off n bytes from an array of buffers. // Length is the combined lengths of all the buffers in the list. // This function is designed to be inlinable, so please take care when making // changes to the function body. function fromList(n, state) { // nothing buffered if (state.length === 0) return null; var ret; if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { // read it all, truncate the list if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length); state.buffer.clear(); } else { // read part of list ret = state.buffer.consume(n, state.decoder); } return ret; } function endReadable(stream) { var state = stream._readableState; debug('endReadable', state.endEmitted); if (!state.endEmitted) { state.ended = true; process.nextTick(endReadableNT, state, stream); } } function endReadableNT(state, stream) { debug('endReadableNT', state.endEmitted, state.length); // Check that we didn't get one last unshift. if (!state.endEmitted && state.length === 0) { state.endEmitted = true; stream.readable = false; stream.emit('end'); if (state.autoDestroy) { // In case of duplex streams we need a way to detect // if the writable side is ready for autoDestroy as well var wState = stream._writableState; if (!wState || wState.autoDestroy && wState.finished) { stream.destroy(); } } } } if (typeof Symbol === 'function') { Readable.from = function (iterable, opts) { if (from === undefined) { from = require('./internal/streams/from'); } return from(Readable, iterable, opts); }; } function indexOf(xs, x) { for (var i = 0, l = xs.length; i < l; i++) { if (xs[i] === x) return i; } return -1; }// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // a transform stream is a readable/writable stream where you do // something with the data. Sometimes it's called a "filter", // but that's not a great name for it, since that implies a thing where // some bits pass through, and others are simply ignored. (That would // be a valid example of a transform, of course.) // // While the output is causally related to the input, it's not a // necessarily symmetric or synchronous transformation. For example, // a zlib stream might take multiple plain-text writes(), and then // emit a single compressed chunk some time in the future. // // Here's how this works: // // The Transform stream has all the aspects of the readable and writable // stream classes. When you write(chunk), that calls _write(chunk,cb) // internally, and returns false if there's a lot of pending writes // buffered up. When you call read(), that calls _read(n) until // there's enough pending readable data buffered up. // // In a transform stream, the written data is placed in a buffer. When // _read(n) is called, it transforms the queued up data, calling the // buffered _write cb's as it consumes chunks. If consuming a single // written chunk would result in multiple output chunks, then the first // outputted bit calls the readcb, and subsequent chunks just go into // the read buffer, and will cause it to emit 'readable' if necessary. // // This way, back-pressure is actually determined by the reading side, // since _read has to be called to start processing a new chunk. However, // a pathological inflate type of transform can cause excessive buffering // here. For example, imagine a stream where every byte of input is // interpreted as an integer from 0-255, and then results in that many // bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in // 1kb of data being output. In this case, you could write a very small // amount of input, and end up with a very large amount of output. In // such a pathological inflating mechanism, there'd be no way to tell // the system to stop doing the transform. A single 4MB write could // cause the system to run out of memory. // // However, even in such a pathological case, only a single written chunk // would be consumed, and then the rest would wait (un-transformed) until // the results of the previous transformed chunk were consumed. 'use strict'; module.exports = Transform; var _require$codes = require('../errors').codes, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; var Duplex = require('./_stream_duplex'); require('inherits')(Transform, Duplex); function afterTransform(er, data) { var ts = this._transformState; ts.transforming = false; var cb = ts.writecb; if (cb === null) { return this.emit('error', new ERR_MULTIPLE_CALLBACK()); } ts.writechunk = null; ts.writecb = null; if (data != null) // single equals check for both `null` and `undefined` this.push(data); cb(er); var rs = this._readableState; rs.reading = false; if (rs.needReadable || rs.length < rs.highWaterMark) { this._read(rs.highWaterMark); } } function Transform(options) { if (!(this instanceof Transform)) return new Transform(options); Duplex.call(this, options); this._transformState = { afterTransform: afterTransform.bind(this), needTransform: false, transforming: false, writecb: null, writechunk: null, writeencoding: null }; // start out asking for a readable event once data is transformed. this._readableState.needReadable = true; // we have implemented the _read method, and done the other things // that Readable wants before the first _read call, so unset the // sync guard flag. this._readableState.sync = false; if (options) { if (typeof options.transform === 'function') this._transform = options.transform; if (typeof options.flush === 'function') this._flush = options.flush; } // When the writable side finishes, then flush out anything remaining. this.on('prefinish', prefinish); } function prefinish() { var _this = this; if (typeof this._flush === 'function' && !this._readableState.destroyed) { this._flush(function (er, data) { done(_this, er, data); }); } else { done(this, null, null); } } Transform.prototype.push = function (chunk, encoding) { this._transformState.needTransform = false; return Duplex.prototype.push.call(this, chunk, encoding); }; // This is the part where you do stuff! // override this function in implementation classes. // 'chunk' is an input chunk. // // Call `push(newChunk)` to pass along transformed output // to the readable side. You may call 'push' zero or more times. // // Call `cb(err)` when you are done with this chunk. If you pass // an error, then that'll put the hurt on the whole operation. If you // never call cb(), then you'll never get another chunk. Transform.prototype._transform = function (chunk, encoding, cb) { cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()')); }; Transform.prototype._write = function (chunk, encoding, cb) { var ts = this._transformState; ts.writecb = cb; ts.writechunk = chunk; ts.writeencoding = encoding; if (!ts.transforming) { var rs = this._readableState; if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); } }; // Doesn't matter what the args are here. // _transform does all the work. // That we got here means that the readable side wants more data. Transform.prototype._read = function (n) { var ts = this._transformState; if (ts.writechunk !== null && !ts.transforming) { ts.transforming = true; this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); } else { // mark that we need a transform, so that any data that comes in // will get processed, now that we've asked for it. ts.needTransform = true; } }; Transform.prototype._destroy = function (err, cb) { Duplex.prototype._destroy.call(this, err, function (err2) { cb(err2); }); }; function done(stream, er, data) { if (er) return stream.emit('error', er); if (data != null) // single equals check for both `null` and `undefined` stream.push(data); // TODO(BridgeAR): Write a test for these two error cases // if there's nothing in the write buffer, then that means // that nothing more will ever be provided if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0(); if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); return stream.push(null); }// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // A bit simpler than readable streams. // Implement an async ._write(chunk, encoding, cb), and it'll handle all // the drain event emission and buffering. 'use strict'; module.exports = Writable; /* */ function WriteReq(chunk, encoding, cb) { this.chunk = chunk; this.encoding = encoding; this.callback = cb; this.next = null; } // It seems a linked list but it is not // there will be only 2 of these for each stream function CorkedRequest(state) { var _this = this; this.next = null; this.entry = null; this.finish = function () { onCorkedFinish(_this, state); }; } /* */ /**/ var Duplex; /**/ Writable.WritableState = WritableState; /**/ var internalUtil = { deprecate: require('util-deprecate') }; /**/ /**/ var Stream = require('./internal/streams/stream'); /**/ var Buffer = require('buffer').Buffer; var OurUint8Array = global.Uint8Array || function () {}; function _uint8ArrayToBuffer(chunk) { return Buffer.from(chunk); } function _isUint8Array(obj) { return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; } var destroyImpl = require('./internal/streams/destroy'); var _require = require('./internal/streams/state'), getHighWaterMark = _require.getHighWaterMark; var _require$codes = require('../errors').codes, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; var errorOrDestroy = destroyImpl.errorOrDestroy; require('inherits')(Writable, Stream); function nop() {} function WritableState(options, stream, isDuplex) { Duplex = Duplex || require('./_stream_duplex'); options = options || {}; // Duplex streams are both readable and writable, but share // the same options object. // However, some cases require setting options to different // values for the readable and the writable sides of the duplex stream, // e.g. options.readableObjectMode vs. options.writableObjectMode, etc. if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag to indicate whether or not this stream // contains buffers or objects. this.objectMode = !!options.objectMode; if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; // the point at which write() starts returning false // Note: 0 is a valid value, means that we always return false if // the entire buffer is not flushed immediately on write() this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex); // if _final has been called this.finalCalled = false; // drain event flag. this.needDrain = false; // at the start of calling end() this.ending = false; // when end() has been called, and returned this.ended = false; // when 'finish' is emitted this.finished = false; // has it been destroyed this.destroyed = false; // should we decode strings into buffers before passing to _write? // this is here so that some node-core streams can optimize string // handling at a lower level. var noDecode = options.decodeStrings === false; this.decodeStrings = !noDecode; // Crypto is kind of old and crusty. Historically, its default string // encoding is 'binary' so we have to make this configurable. // Everything else in the universe uses 'utf8', though. this.defaultEncoding = options.defaultEncoding || 'utf8'; // not an actual buffer we keep track of, but a measurement // of how much we're waiting to get pushed to some underlying // socket or file. this.length = 0; // a flag to see when we're in the middle of a write. this.writing = false; // when true all writes will be buffered until .uncork() call this.corked = 0; // a flag to be able to tell if the onwrite cb is called immediately, // or on a later tick. We set this to true at first, because any // actions that shouldn't happen until "later" should generally also // not happen before the first write call. this.sync = true; // a flag to know if we're processing previously buffered items, which // may call the _write() callback in the same tick, so that we don't // end up in an overlapped onwrite situation. this.bufferProcessing = false; // the callback that's passed to _write(chunk,cb) this.onwrite = function (er) { onwrite(stream, er); }; // the callback that the user supplies to write(chunk,encoding,cb) this.writecb = null; // the amount that is being written when _write is called. this.writelen = 0; this.bufferedRequest = null; this.lastBufferedRequest = null; // number of pending user-supplied write callbacks // this must be 0 before 'finish' can be emitted this.pendingcb = 0; // emit prefinish if the only thing we're waiting for is _write cbs // This is relevant for synchronous Transform streams this.prefinished = false; // True if the error was already emitted and should not be thrown again this.errorEmitted = false; // Should close be emitted on destroy. Defaults to true. this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'finish' (and potentially 'end') this.autoDestroy = !!options.autoDestroy; // count buffered requests this.bufferedRequestCount = 0; // allocate the first CorkedRequest, there is always // one allocated and free to use, and we maintain at most two this.corkedRequestsFree = new CorkedRequest(this); } WritableState.prototype.getBuffer = function getBuffer() { var current = this.bufferedRequest; var out = []; while (current) { out.push(current); current = current.next; } return out; }; (function () { try { Object.defineProperty(WritableState.prototype, 'buffer', { get: internalUtil.deprecate(function writableStateBufferGetter() { return this.getBuffer(); }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') }); } catch (_) {} })(); // Test _writableState for inheritance to account for Duplex streams, // whose prototype chain only points to Readable. var realHasInstance; if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { realHasInstance = Function.prototype[Symbol.hasInstance]; Object.defineProperty(Writable, Symbol.hasInstance, { value: function value(object) { if (realHasInstance.call(this, object)) return true; if (this !== Writable) return false; return object && object._writableState instanceof WritableState; } }); } else { realHasInstance = function realHasInstance(object) { return object instanceof this; }; } function Writable(options) { Duplex = Duplex || require('./_stream_duplex'); // Writable ctor is applied to Duplexes, too. // `realHasInstance` is necessary because using plain `instanceof` // would return false, as no `_writableState` property is attached. // Trying to use the custom `instanceof` for Writable here will also break the // Node.js LazyTransform implementation, which has a non-trivial getter for // `_writableState` that would lead to infinite recursion. // Checking for a Stream.Duplex instance is faster here instead of inside // the WritableState constructor, at least with V8 6.5 var isDuplex = this instanceof Duplex; if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options); this._writableState = new WritableState(options, this, isDuplex); // legacy. this.writable = true; if (options) { if (typeof options.write === 'function') this._write = options.write; if (typeof options.writev === 'function') this._writev = options.writev; if (typeof options.destroy === 'function') this._destroy = options.destroy; if (typeof options.final === 'function') this._final = options.final; } Stream.call(this); } // Otherwise people can pipe Writable streams, which is just wrong. Writable.prototype.pipe = function () { errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); }; function writeAfterEnd(stream, cb) { var er = new ERR_STREAM_WRITE_AFTER_END(); // TODO: defer error events consistently everywhere, not just the cb errorOrDestroy(stream, er); process.nextTick(cb, er); } // Checks that a user-supplied chunk is valid, especially for the particular // mode the stream is in. Currently this means that `null` is never accepted // and undefined/non-string values are only allowed in object mode. function validChunk(stream, state, chunk, cb) { var er; if (chunk === null) { er = new ERR_STREAM_NULL_VALUES(); } else if (typeof chunk !== 'string' && !state.objectMode) { er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk); } if (er) { errorOrDestroy(stream, er); process.nextTick(cb, er); return false; } return true; } Writable.prototype.write = function (chunk, encoding, cb) { var state = this._writableState; var ret = false; var isBuf = !state.objectMode && _isUint8Array(chunk); if (isBuf && !Buffer.isBuffer(chunk)) { chunk = _uint8ArrayToBuffer(chunk); } if (typeof encoding === 'function') { cb = encoding; encoding = null; } if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; if (typeof cb !== 'function') cb = nop; if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { state.pendingcb++; ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); } return ret; }; Writable.prototype.cork = function () { this._writableState.corked++; }; Writable.prototype.uncork = function () { var state = this._writableState; if (state.corked) { state.corked--; if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); } }; Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { // node::ParseEncoding() requires lower case. if (typeof encoding === 'string') encoding = encoding.toLowerCase(); if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding); this._writableState.defaultEncoding = encoding; return this; }; Object.defineProperty(Writable.prototype, 'writableBuffer', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState && this._writableState.getBuffer(); } }); function decodeChunk(state, chunk, encoding) { if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { chunk = Buffer.from(chunk, encoding); } return chunk; } Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState.highWaterMark; } }); // if we're already writing something, then just put this // in the queue, and wait our turn. Otherwise, call _write // If we return false, then we need a drain event, so set that flag. function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { if (!isBuf) { var newChunk = decodeChunk(state, chunk, encoding); if (chunk !== newChunk) { isBuf = true; encoding = 'buffer'; chunk = newChunk; } } var len = state.objectMode ? 1 : chunk.length; state.length += len; var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false. if (!ret) state.needDrain = true; if (state.writing || state.corked) { var last = state.lastBufferedRequest; state.lastBufferedRequest = { chunk: chunk, encoding: encoding, isBuf: isBuf, callback: cb, next: null }; if (last) { last.next = state.lastBufferedRequest; } else { state.bufferedRequest = state.lastBufferedRequest; } state.bufferedRequestCount += 1; } else { doWrite(stream, state, false, len, chunk, encoding, cb); } return ret; } function doWrite(stream, state, writev, len, chunk, encoding, cb) { state.writelen = len; state.writecb = cb; state.writing = true; state.sync = true; if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); state.sync = false; } function onwriteError(stream, state, sync, er, cb) { --state.pendingcb; if (sync) { // defer the callback if we are being called synchronously // to avoid piling up things on the stack process.nextTick(cb, er); // this can emit finish, and it will always happen // after error process.nextTick(finishMaybe, stream, state); stream._writableState.errorEmitted = true; errorOrDestroy(stream, er); } else { // the caller expect this to happen before if // it is async cb(er); stream._writableState.errorEmitted = true; errorOrDestroy(stream, er); // this can emit finish, but finish must // always follow error finishMaybe(stream, state); } } function onwriteStateUpdate(state) { state.writing = false; state.writecb = null; state.length -= state.writelen; state.writelen = 0; } function onwrite(stream, er) { var state = stream._writableState; var sync = state.sync; var cb = state.writecb; if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK(); onwriteStateUpdate(state); if (er) onwriteError(stream, state, sync, er, cb);else { // Check if we're actually ready to finish, but don't emit yet var finished = needFinish(state) || stream.destroyed; if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { clearBuffer(stream, state); } if (sync) { process.nextTick(afterWrite, stream, state, finished, cb); } else { afterWrite(stream, state, finished, cb); } } } function afterWrite(stream, state, finished, cb) { if (!finished) onwriteDrain(stream, state); state.pendingcb--; cb(); finishMaybe(stream, state); } // Must force callback to be called on nextTick, so that we don't // emit 'drain' before the write() consumer gets the 'false' return // value, and has a chance to attach a 'drain' listener. function onwriteDrain(stream, state) { if (state.length === 0 && state.needDrain) { state.needDrain = false; stream.emit('drain'); } } // if there's something in the buffer waiting, then process it function clearBuffer(stream, state) { state.bufferProcessing = true; var entry = state.bufferedRequest; if (stream._writev && entry && entry.next) { // Fast case, write everything using _writev() var l = state.bufferedRequestCount; var buffer = new Array(l); var holder = state.corkedRequestsFree; holder.entry = entry; var count = 0; var allBuffers = true; while (entry) { buffer[count] = entry; if (!entry.isBuf) allBuffers = false; entry = entry.next; count += 1; } buffer.allBuffers = allBuffers; doWrite(stream, state, true, state.length, buffer, '', holder.finish); // doWrite is almost always async, defer these to save a bit of time // as the hot path ends with doWrite state.pendingcb++; state.lastBufferedRequest = null; if (holder.next) { state.corkedRequestsFree = holder.next; holder.next = null; } else { state.corkedRequestsFree = new CorkedRequest(state); } state.bufferedRequestCount = 0; } else { // Slow case, write chunks one-by-one while (entry) { var chunk = entry.chunk; var encoding = entry.encoding; var cb = entry.callback; var len = state.objectMode ? 1 : chunk.length; doWrite(stream, state, false, len, chunk, encoding, cb); entry = entry.next; state.bufferedRequestCount--; // if we didn't call the onwrite immediately, then // it means that we need to wait until it does. // also, that means that the chunk and cb are currently // being processed, so move the buffer counter past them. if (state.writing) { break; } } if (entry === null) state.lastBufferedRequest = null; } state.bufferedRequest = entry; state.bufferProcessing = false; } Writable.prototype._write = function (chunk, encoding, cb) { cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()')); }; Writable.prototype._writev = null; Writable.prototype.end = function (chunk, encoding, cb) { var state = this._writableState; if (typeof chunk === 'function') { cb = chunk; chunk = null; encoding = null; } else if (typeof encoding === 'function') { cb = encoding; encoding = null; } if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); // .end() fully uncorks if (state.corked) { state.corked = 1; this.uncork(); } // ignore unnecessary end() calls. if (!state.ending) endWritable(this, state, cb); return this; }; Object.defineProperty(Writable.prototype, 'writableLength', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState.length; } }); function needFinish(state) { return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; } function callFinal(stream, state) { stream._final(function (err) { state.pendingcb--; if (err) { errorOrDestroy(stream, err); } state.prefinished = true; stream.emit('prefinish'); finishMaybe(stream, state); }); } function prefinish(stream, state) { if (!state.prefinished && !state.finalCalled) { if (typeof stream._final === 'function' && !state.destroyed) { state.pendingcb++; state.finalCalled = true; process.nextTick(callFinal, stream, state); } else { state.prefinished = true; stream.emit('prefinish'); } } } function finishMaybe(stream, state) { var need = needFinish(state); if (need) { prefinish(stream, state); if (state.pendingcb === 0) { state.finished = true; stream.emit('finish'); if (state.autoDestroy) { // In case of duplex streams we need a way to detect // if the readable side is ready for autoDestroy as well var rState = stream._readableState; if (!rState || rState.autoDestroy && rState.endEmitted) { stream.destroy(); } } } } return need; } function endWritable(stream, state, cb) { state.ending = true; finishMaybe(stream, state); if (cb) { if (state.finished) process.nextTick(cb);else stream.once('finish', cb); } state.ended = true; stream.writable = false; } function onCorkedFinish(corkReq, state, err) { var entry = corkReq.entry; corkReq.entry = null; while (entry) { var cb = entry.callback; state.pendingcb--; cb(err); entry = entry.next; } // reuse the free corkReq. state.corkedRequestsFree.next = corkReq; } Object.defineProperty(Writable.prototype, 'destroyed', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { if (this._writableState === undefined) { return false; } return this._writableState.destroyed; }, set: function set(value) { // we ignore the value if the stream // has not been initialized yet if (!this._writableState) { return; } // backward compatibility, the user is explicitly // managing destroyed this._writableState.destroyed = value; } }); Writable.prototype.destroy = destroyImpl.destroy; Writable.prototype._undestroy = destroyImpl.undestroy; Writable.prototype._destroy = function (err, cb) { cb(err); };'use strict'; var _Object$setPrototypeO; function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var finished = require('./end-of-stream'); var kLastResolve = Symbol('lastResolve'); var kLastReject = Symbol('lastReject'); var kError = Symbol('error'); var kEnded = Symbol('ended'); var kLastPromise = Symbol('lastPromise'); var kHandlePromise = Symbol('handlePromise'); var kStream = Symbol('stream'); function createIterResult(value, done) { return { value: value, done: done }; } function readAndResolve(iter) { var resolve = iter[kLastResolve]; if (resolve !== null) { var data = iter[kStream].read(); // we defer if data is null // we can be expecting either 'end' or // 'error' if (data !== null) { iter[kLastPromise] = null; iter[kLastResolve] = null; iter[kLastReject] = null; resolve(createIterResult(data, false)); } } } function onReadable(iter) { // we wait for the next tick, because it might // emit an error with process.nextTick process.nextTick(readAndResolve, iter); } function wrapForNext(lastPromise, iter) { return function (resolve, reject) { lastPromise.then(function () { if (iter[kEnded]) { resolve(createIterResult(undefined, true)); return; } iter[kHandlePromise](resolve, reject); }, reject); }; } var AsyncIteratorPrototype = Object.getPrototypeOf(function () {}); var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { get stream() { return this[kStream]; }, next: function next() { var _this = this; // if we have detected an error in the meanwhile // reject straight away var error = this[kError]; if (error !== null) { return Promise.reject(error); } if (this[kEnded]) { return Promise.resolve(createIterResult(undefined, true)); } if (this[kStream].destroyed) { // We need to defer via nextTick because if .destroy(err) is // called, the error will be emitted via nextTick, and // we cannot guarantee that there is no error lingering around // waiting to be emitted. return new Promise(function (resolve, reject) { process.nextTick(function () { if (_this[kError]) { reject(_this[kError]); } else { resolve(createIterResult(undefined, true)); } }); }); } // if we have multiple next() calls // we will wait for the previous Promise to finish // this logic is optimized to support for await loops, // where next() is only called once at a time var lastPromise = this[kLastPromise]; var promise; if (lastPromise) { promise = new Promise(wrapForNext(lastPromise, this)); } else { // fast path needed to support multiple this.push() // without triggering the next() queue var data = this[kStream].read(); if (data !== null) { return Promise.resolve(createIterResult(data, false)); } promise = new Promise(this[kHandlePromise]); } this[kLastPromise] = promise; return promise; } }, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () { return this; }), _defineProperty(_Object$setPrototypeO, "return", function _return() { var _this2 = this; // destroy(err, cb) is a private API // we can guarantee we have that here, because we control the // Readable class this is attached to return new Promise(function (resolve, reject) { _this2[kStream].destroy(null, function (err) { if (err) { reject(err); return; } resolve(createIterResult(undefined, true)); }); }); }), _Object$setPrototypeO), AsyncIteratorPrototype); var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) { var _Object$create; var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { value: stream, writable: true }), _defineProperty(_Object$create, kLastResolve, { value: null, writable: true }), _defineProperty(_Object$create, kLastReject, { value: null, writable: true }), _defineProperty(_Object$create, kError, { value: null, writable: true }), _defineProperty(_Object$create, kEnded, { value: stream._readableState.endEmitted, writable: true }), _defineProperty(_Object$create, kHandlePromise, { value: function value(resolve, reject) { var data = iterator[kStream].read(); if (data) { iterator[kLastPromise] = null; iterator[kLastResolve] = null; iterator[kLastReject] = null; resolve(createIterResult(data, false)); } else { iterator[kLastResolve] = resolve; iterator[kLastReject] = reject; } }, writable: true }), _Object$create)); iterator[kLastPromise] = null; finished(stream, function (err) { if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') { var reject = iterator[kLastReject]; // reject if we are waiting for data in the Promise // returned by next() and store the error if (reject !== null) { iterator[kLastPromise] = null; iterator[kLastResolve] = null; iterator[kLastReject] = null; reject(err); } iterator[kError] = err; return; } var resolve = iterator[kLastResolve]; if (resolve !== null) { iterator[kLastPromise] = null; iterator[kLastResolve] = null; iterator[kLastReject] = null; resolve(createIterResult(undefined, true)); } iterator[kEnded] = true; }); stream.on('readable', onReadable.bind(null, iterator)); return iterator; }; module.exports = createReadableStreamAsyncIterator;'use strict'; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } var _require = require('buffer'), Buffer = _require.Buffer; var _require2 = require('util'), inspect = _require2.inspect; var custom = inspect && inspect.custom || 'inspect'; function copyBuffer(src, target, offset) { Buffer.prototype.copy.call(src, target, offset); } module.exports = /*#__PURE__*/ function () { function BufferList() { _classCallCheck(this, BufferList); this.head = null; this.tail = null; this.length = 0; } _createClass(BufferList, [{ key: "push", value: function push(v) { var entry = { data: v, next: null }; if (this.length > 0) this.tail.next = entry;else this.head = entry; this.tail = entry; ++this.length; } }, { key: "unshift", value: function unshift(v) { var entry = { data: v, next: this.head }; if (this.length === 0) this.tail = entry; this.head = entry; ++this.length; } }, { key: "shift", value: function shift() { if (this.length === 0) return; var ret = this.head.data; if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; --this.length; return ret; } }, { key: "clear", value: function clear() { this.head = this.tail = null; this.length = 0; } }, { key: "join", value: function join(s) { if (this.length === 0) return ''; var p = this.head; var ret = '' + p.data; while (p = p.next) { ret += s + p.data; } return ret; } }, { key: "concat", value: function concat(n) { if (this.length === 0) return Buffer.alloc(0); var ret = Buffer.allocUnsafe(n >>> 0); var p = this.head; var i = 0; while (p) { copyBuffer(p.data, ret, i); i += p.data.length; p = p.next; } return ret; } // Consumes a specified amount of bytes or characters from the buffered data. }, { key: "consume", value: function consume(n, hasStrings) { var ret; if (n < this.head.data.length) { // `slice` is the same for buffers and strings. ret = this.head.data.slice(0, n); this.head.data = this.head.data.slice(n); } else if (n === this.head.data.length) { // First chunk is a perfect match. ret = this.shift(); } else { // Result spans more than one buffer. ret = hasStrings ? this._getString(n) : this._getBuffer(n); } return ret; } }, { key: "first", value: function first() { return this.head.data; } // Consumes a specified amount of characters from the buffered data. }, { key: "_getString", value: function _getString(n) { var p = this.head; var c = 1; var ret = p.data; n -= ret.length; while (p = p.next) { var str = p.data; var nb = n > str.length ? str.length : n; if (nb === str.length) ret += str;else ret += str.slice(0, n); n -= nb; if (n === 0) { if (nb === str.length) { ++c; if (p.next) this.head = p.next;else this.head = this.tail = null; } else { this.head = p; p.data = str.slice(nb); } break; } ++c; } this.length -= c; return ret; } // Consumes a specified amount of bytes from the buffered data. }, { key: "_getBuffer", value: function _getBuffer(n) { var ret = Buffer.allocUnsafe(n); var p = this.head; var c = 1; p.data.copy(ret); n -= p.data.length; while (p = p.next) { var buf = p.data; var nb = n > buf.length ? buf.length : n; buf.copy(ret, ret.length - n, 0, nb); n -= nb; if (n === 0) { if (nb === buf.length) { ++c; if (p.next) this.head = p.next;else this.head = this.tail = null; } else { this.head = p; p.data = buf.slice(nb); } break; } ++c; } this.length -= c; return ret; } // Make sure the linked list only shows the minimal necessary information. }, { key: custom, value: function value(_, options) { return inspect(this, _objectSpread({}, options, { // Only inspect one level. depth: 0, // It should not recurse. customInspect: false })); } }]); return BufferList; }();'use strict'; // undocumented cb() API, needed for core, not for public API function destroy(err, cb) { var _this = this; var readableDestroyed = this._readableState && this._readableState.destroyed; var writableDestroyed = this._writableState && this._writableState.destroyed; if (readableDestroyed || writableDestroyed) { if (cb) { cb(err); } else if (err) { if (!this._writableState) { process.nextTick(emitErrorNT, this, err); } else if (!this._writableState.errorEmitted) { this._writableState.errorEmitted = true; process.nextTick(emitErrorNT, this, err); } } return this; } // we set destroyed to true before firing error callbacks in order // to make it re-entrance safe in case destroy() is called within callbacks if (this._readableState) { this._readableState.destroyed = true; } // if this is a duplex stream mark the writable part as destroyed as well if (this._writableState) { this._writableState.destroyed = true; } this._destroy(err || null, function (err) { if (!cb && err) { if (!_this._writableState) { process.nextTick(emitErrorAndCloseNT, _this, err); } else if (!_this._writableState.errorEmitted) { _this._writableState.errorEmitted = true; process.nextTick(emitErrorAndCloseNT, _this, err); } else { process.nextTick(emitCloseNT, _this); } } else if (cb) { process.nextTick(emitCloseNT, _this); cb(err); } else { process.nextTick(emitCloseNT, _this); } }); return this; } function emitErrorAndCloseNT(self, err) { emitErrorNT(self, err); emitCloseNT(self); } function emitCloseNT(self) { if (self._writableState && !self._writableState.emitClose) return; if (self._readableState && !self._readableState.emitClose) return; self.emit('close'); } function undestroy() { if (this._readableState) { this._readableState.destroyed = false; this._readableState.reading = false; this._readableState.ended = false; this._readableState.endEmitted = false; } if (this._writableState) { this._writableState.destroyed = false; this._writableState.ended = false; this._writableState.ending = false; this._writableState.finalCalled = false; this._writableState.prefinished = false; this._writableState.finished = false; this._writableState.errorEmitted = false; } } function emitErrorNT(self, err) { self.emit('error', err); } function errorOrDestroy(stream, err) { // We have tests that rely on errors being emitted // in the same tick, so changing this is semver major. // For now when you opt-in to autoDestroy we allow // the error to be emitted nextTick. In a future // semver major update we should change the default to this. var rState = stream._readableState; var wState = stream._writableState; if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err); } module.exports = { destroy: destroy, undestroy: undestroy, errorOrDestroy: errorOrDestroy };// Ported from https://github.com/mafintosh/end-of-stream with // permission from the author, Mathias Buus (@mafintosh). 'use strict'; var ERR_STREAM_PREMATURE_CLOSE = require('../../../errors').codes.ERR_STREAM_PREMATURE_CLOSE; function once(callback) { var called = false; return function () { if (called) return; called = true; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } callback.apply(this, args); }; } function noop() {} function isRequest(stream) { return stream.setHeader && typeof stream.abort === 'function'; } function eos(stream, opts, callback) { if (typeof opts === 'function') return eos(stream, null, opts); if (!opts) opts = {}; callback = once(callback || noop); var readable = opts.readable || opts.readable !== false && stream.readable; var writable = opts.writable || opts.writable !== false && stream.writable; var onlegacyfinish = function onlegacyfinish() { if (!stream.writable) onfinish(); }; var writableEnded = stream._writableState && stream._writableState.finished; var onfinish = function onfinish() { writable = false; writableEnded = true; if (!readable) callback.call(stream); }; var readableEnded = stream._readableState && stream._readableState.endEmitted; var onend = function onend() { readable = false; readableEnded = true; if (!writable) callback.call(stream); }; var onerror = function onerror(err) { callback.call(stream, err); }; var onclose = function onclose() { var err; if (readable && !readableEnded) { if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); return callback.call(stream, err); } if (writable && !writableEnded) { if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); return callback.call(stream, err); } }; var onrequest = function onrequest() { stream.req.on('finish', onfinish); }; if (isRequest(stream)) { stream.on('complete', onfinish); stream.on('abort', onclose); if (stream.req) onrequest();else stream.on('request', onrequest); } else if (writable && !stream._writableState) { // legacy streams stream.on('end', onlegacyfinish); stream.on('close', onlegacyfinish); } stream.on('end', onend); stream.on('finish', onfinish); if (opts.error !== false) stream.on('error', onerror); stream.on('close', onclose); return function () { stream.removeListener('complete', onfinish); stream.removeListener('abort', onclose); stream.removeListener('request', onrequest); if (stream.req) stream.req.removeListener('finish', onfinish); stream.removeListener('end', onlegacyfinish); stream.removeListener('close', onlegacyfinish); stream.removeListener('finish', onfinish); stream.removeListener('end', onend); stream.removeListener('error', onerror); stream.removeListener('close', onclose); }; } module.exports = eos;module.exports = function () { throw new Error('Readable.from is not available in the browser') }; 'use strict'; function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var ERR_INVALID_ARG_TYPE = require('../../../errors').codes.ERR_INVALID_ARG_TYPE; function from(Readable, iterable, opts) { var iterator; if (iterable && typeof iterable.next === 'function') { iterator = iterable; } else if (iterable && iterable[Symbol.asyncIterator]) iterator = iterable[Symbol.asyncIterator]();else if (iterable && iterable[Symbol.iterator]) iterator = iterable[Symbol.iterator]();else throw new ERR_INVALID_ARG_TYPE('iterable', ['Iterable'], iterable); var readable = new Readable(_objectSpread({ objectMode: true }, opts)); // Reading boolean to protect against _read // being called before last iteration completion. var reading = false; readable._read = function () { if (!reading) { reading = true; next(); } }; function next() { return _next2.apply(this, arguments); } function _next2() { _next2 = _asyncToGenerator(function* () { try { var _ref = yield iterator.next(), value = _ref.value, done = _ref.done; if (done) { readable.push(null); } else if (readable.push((yield value))) { next(); } else { reading = false; } } catch (err) { readable.destroy(err); } }); return _next2.apply(this, arguments); } return readable; } module.exports = from;// Ported from https://github.com/mafintosh/pump with // permission from the author, Mathias Buus (@mafintosh). 'use strict'; var eos; function once(callback) { var called = false; return function () { if (called) return; called = true; callback.apply(void 0, arguments); }; } var _require$codes = require('../../../errors').codes, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; function noop(err) { // Rethrow the error if it exists to avoid swallowing it if (err) throw err; } function isRequest(stream) { return stream.setHeader && typeof stream.abort === 'function'; } function destroyer(stream, reading, writing, callback) { callback = once(callback); var closed = false; stream.on('close', function () { closed = true; }); if (eos === undefined) eos = require('./end-of-stream'); eos(stream, { readable: reading, writable: writing }, function (err) { if (err) return callback(err); closed = true; callback(); }); var destroyed = false; return function (err) { if (closed) return; if (destroyed) return; destroyed = true; // request.destroy just do .end - .abort is what we want if (isRequest(stream)) return stream.abort(); if (typeof stream.destroy === 'function') return stream.destroy(); callback(err || new ERR_STREAM_DESTROYED('pipe')); }; } function call(fn) { fn(); } function pipe(from, to) { return from.pipe(to); } function popCallback(streams) { if (!streams.length) return noop; if (typeof streams[streams.length - 1] !== 'function') return noop; return streams.pop(); } function pipeline() { for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { streams[_key] = arguments[_key]; } var callback = popCallback(streams); if (Array.isArray(streams[0])) streams = streams[0]; if (streams.length < 2) { throw new ERR_MISSING_ARGS('streams'); } var error; var destroys = streams.map(function (stream, i) { var reading = i < streams.length - 1; var writing = i > 0; return destroyer(stream, reading, writing, function (err) { if (!error) error = err; if (err) destroys.forEach(call); if (reading) return; destroys.forEach(call); callback(error); }); }); return streams.reduce(pipe); } module.exports = pipeline;'use strict'; var ERR_INVALID_OPT_VALUE = require('../../../errors').codes.ERR_INVALID_OPT_VALUE; function highWaterMarkFrom(options, isDuplex, duplexKey) { return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; } function getHighWaterMark(state, options, duplexKey, isDuplex) { var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); if (hwm != null) { if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { var name = isDuplex ? duplexKey : 'highWaterMark'; throw new ERR_INVALID_OPT_VALUE(name, hwm); } return Math.floor(hwm); } // Default value return state.objectMode ? 16 : 16 * 1024; } module.exports = { getHighWaterMark: getHighWaterMark };module.exports = require('events').EventEmitter; module.exports = require('stream'); 'use strict' const util = require('util') const fs = require('fs') const index = require('./lib/entry-index') const memo = require('./lib/memoization') const read = require('./lib/content/read') const Minipass = require('minipass') const Collect = require('minipass-collect') const Pipeline = require('minipass-pipeline') const writeFile = util.promisify(fs.writeFile) module.exports = function get (cache, key, opts) { return getData(false, cache, key, opts) } module.exports.byDigest = function getByDigest (cache, digest, opts) { return getData(true, cache, digest, opts) } function getData (byDigest, cache, key, opts = {}) { const { integrity, memoize, size } = opts const memoized = byDigest ? memo.get.byDigest(cache, key, opts) : memo.get(cache, key, opts) if (memoized && memoize !== false) { return Promise.resolve( byDigest ? memoized : { metadata: memoized.entry.metadata, data: memoized.data, integrity: memoized.entry.integrity, size: memoized.entry.size } ) } return (byDigest ? Promise.resolve(null) : index.find(cache, key, opts)).then( (entry) => { if (!entry && !byDigest) { throw new index.NotFoundError(cache, key) } return read(cache, byDigest ? key : entry.integrity, { integrity, size }) .then((data) => byDigest ? data : { data, metadata: entry.metadata, size: entry.size, integrity: entry.integrity } ) .then((res) => { if (memoize && byDigest) { memo.put.byDigest(cache, key, res, opts) } else if (memoize) { memo.put(cache, entry, res.data, opts) } return res }) } ) } module.exports.sync = function get (cache, key, opts) { return getDataSync(false, cache, key, opts) } module.exports.sync.byDigest = function getByDigest (cache, digest, opts) { return getDataSync(true, cache, digest, opts) } function getDataSync (byDigest, cache, key, opts = {}) { const { integrity, memoize, size } = opts const memoized = byDigest ? memo.get.byDigest(cache, key, opts) : memo.get(cache, key, opts) if (memoized && memoize !== false) { return byDigest ? memoized : { metadata: memoized.entry.metadata, data: memoized.data, integrity: memoized.entry.integrity, size: memoized.entry.size } } const entry = !byDigest && index.find.sync(cache, key, opts) if (!entry && !byDigest) { throw new index.NotFoundError(cache, key) } const data = read.sync(cache, byDigest ? key : entry.integrity, { integrity: integrity, size: size }) const res = byDigest ? data : { metadata: entry.metadata, data: data, size: entry.size, integrity: entry.integrity } if (memoize && byDigest) { memo.put.byDigest(cache, key, res, opts) } else if (memoize) { memo.put(cache, entry, res.data, opts) } return res } module.exports.stream = getStream const getMemoizedStream = (memoized) => { const stream = new Minipass() stream.on('newListener', function (ev, cb) { ev === 'metadata' && cb(memoized.entry.metadata) ev === 'integrity' && cb(memoized.entry.integrity) ev === 'size' && cb(memoized.entry.size) }) stream.end(memoized.data) return stream } function getStream (cache, key, opts = {}) { const { memoize, size } = opts const memoized = memo.get(cache, key, opts) if (memoized && memoize !== false) { return getMemoizedStream(memoized) } const stream = new Pipeline() index .find(cache, key) .then((entry) => { if (!entry) { throw new index.NotFoundError(cache, key) } stream.emit('metadata', entry.metadata) stream.emit('integrity', entry.integrity) stream.emit('size', entry.size) stream.on('newListener', function (ev, cb) { ev === 'metadata' && cb(entry.metadata) ev === 'integrity' && cb(entry.integrity) ev === 'size' && cb(entry.size) }) const src = read.readStream( cache, entry.integrity, { ...opts, size: typeof size !== 'number' ? entry.size : size } ) if (memoize) { const memoStream = new Collect.PassThrough() memoStream.on('collect', data => memo.put(cache, entry, data, opts)) stream.unshift(memoStream) } stream.unshift(src) }) .catch((err) => stream.emit('error', err)) return stream } module.exports.stream.byDigest = getStreamDigest function getStreamDigest (cache, integrity, opts = {}) { const { memoize } = opts const memoized = memo.get.byDigest(cache, integrity, opts) if (memoized && memoize !== false) { const stream = new Minipass() stream.end(memoized) return stream } else { const stream = read.readStream(cache, integrity, opts) if (!memoize) { return stream } const memoStream = new Collect.PassThrough() memoStream.on('collect', data => memo.put.byDigest( cache, integrity, data, opts )) return new Pipeline(stream, memoStream) } } module.exports.info = info function info (cache, key, opts = {}) { const { memoize } = opts const memoized = memo.get(cache, key, opts) if (memoized && memoize !== false) { return Promise.resolve(memoized.entry) } else { return index.find(cache, key) } } module.exports.hasContent = read.hasContent function cp (cache, key, dest, opts) { return copy(false, cache, key, dest, opts) } module.exports.copy = cp function cpDigest (cache, digest, dest, opts) { return copy(true, cache, digest, dest, opts) } module.exports.copy.byDigest = cpDigest function copy (byDigest, cache, key, dest, opts = {}) { if (read.copy) { return (byDigest ? Promise.resolve(null) : index.find(cache, key, opts) ).then((entry) => { if (!entry && !byDigest) { throw new index.NotFoundError(cache, key) } return read .copy(cache, byDigest ? key : entry.integrity, dest, opts) .then(() => { return byDigest ? key : { metadata: entry.metadata, size: entry.size, integrity: entry.integrity } }) }) } return getData(byDigest, cache, key, opts).then((res) => { return writeFile(dest, byDigest ? res : res.data).then(() => { return byDigest ? key : { metadata: res.metadata, size: res.size, integrity: res.integrity } }) }) } 'use strict' const ls = require('./ls.js') const get = require('./get.js') const put = require('./put.js') const rm = require('./rm.js') const verify = require('./verify.js') const { clearMemoized } = require('./lib/memoization.js') const tmp = require('./lib/util/tmp.js') module.exports.ls = ls module.exports.ls.stream = ls.stream module.exports.get = get module.exports.get.byDigest = get.byDigest module.exports.get.sync = get.sync module.exports.get.sync.byDigest = get.sync.byDigest module.exports.get.stream = get.stream module.exports.get.stream.byDigest = get.stream.byDigest module.exports.get.copy = get.copy module.exports.get.copy.byDigest = get.copy.byDigest module.exports.get.info = get.info module.exports.get.hasContent = get.hasContent module.exports.get.hasContent.sync = get.hasContent.sync module.exports.put = put module.exports.put.stream = put.stream module.exports.rm = rm.entry module.exports.rm.all = rm.all module.exports.rm.entry = module.exports.rm module.exports.rm.content = rm.content module.exports.clearMemoized = clearMemoized module.exports.tmp = {} module.exports.tmp.mkdir = tmp.mkdir module.exports.tmp.withTmp = tmp.withTmp module.exports.verify = verify module.exports.verify.lastRun = verify.lastRun ISC License Copyright (c) npm, Inc. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 'use strict' const index = require('./lib/entry-index') module.exports = index.ls module.exports.stream = index.lsStream { "name": "cacache", "version": "15.0.5", "cache-version": { "content": "2", "index": "5" }, "description": "Fast, fault-tolerant, cross-platform, disk-based, data-agnostic, content-addressable cache.", "main": "index.js", "files": [ "*.js", "lib" ], "scripts": { "benchmarks": "node test/benchmarks", "lint": "standard", "postrelease": "npm publish", "posttest": "npm run lint", "prepublishOnly": "git push --follow-tags", "prerelease": "npm t", "release": "standard-version -s", "test": "tap", "coverage": "tap", "test-docker": "docker run -it --rm --name pacotest -v \"$PWD\":/tmp -w /tmp node:latest npm test" }, "repository": "https://github.com/npm/cacache", "keywords": [ "cache", "caching", "content-addressable", "sri", "sri hash", "subresource integrity", "cache", "storage", "store", "file store", "filesystem", "disk cache", "disk storage" ], "author": { "name": "Kat Marchán", "email": "kzm@sykosomatic.org", "twitter": "maybekatz" }, "contributors": [ { "name": "Charlotte Spencer", "email": "charlottelaspencer@gmail.com", "twitter": "charlotteis" }, { "name": "Rebecca Turner", "email": "me@re-becca.org", "twitter": "ReBeccaOrg" } ], "license": "ISC", "dependencies": { "@npmcli/move-file": "^1.0.1", "chownr": "^2.0.0", "fs-minipass": "^2.0.0", "glob": "^7.1.4", "infer-owner": "^1.0.4", "lru-cache": "^6.0.0", "minipass": "^3.1.1", "minipass-collect": "^1.0.2", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.2", "mkdirp": "^1.0.3", "p-map": "^4.0.0", "promise-inflight": "^1.0.1", "rimraf": "^3.0.2", "ssri": "^8.0.0", "tar": "^6.0.2", "unique-filename": "^1.1.1" }, "devDependencies": { "benchmark": "^2.1.4", "chalk": "^4.0.0", "require-inject": "^1.4.4", "standard": "^14.3.1", "standard-version": "^7.1.0", "tacks": "^1.3.0", "tap": "^14.10.6" }, "tap": { "100": true, "test-regex": "test/[^/]*.js" }, "engines": { "node": ">= 10" } } 'use strict' const index = require('./lib/entry-index') const memo = require('./lib/memoization') const write = require('./lib/content/write') const Flush = require('minipass-flush') const { PassThrough } = require('minipass-collect') const Pipeline = require('minipass-pipeline') const putOpts = (opts) => ({ algorithms: ['sha512'], ...opts }) module.exports = putData function putData (cache, key, data, opts = {}) { const { memoize } = opts opts = putOpts(opts) return write(cache, data, opts).then((res) => { return index .insert(cache, key, res.integrity, { ...opts, size: res.size }) .then((entry) => { if (memoize) { memo.put(cache, entry, data, opts) } return res.integrity }) }) } module.exports.stream = putStream function putStream (cache, key, opts = {}) { const { memoize } = opts opts = putOpts(opts) let integrity let size let memoData const pipeline = new Pipeline() // first item in the pipeline is the memoizer, because we need // that to end first and get the collected data. if (memoize) { const memoizer = new PassThrough().on('collect', data => { memoData = data }) pipeline.push(memoizer) } // contentStream is a write-only, not a passthrough // no data comes out of it. const contentStream = write.stream(cache, opts) .on('integrity', (int) => { integrity = int }) .on('size', (s) => { size = s }) pipeline.push(contentStream) // last but not least, we write the index and emit hash and size, // and memoize if we're doing that pipeline.push(new Flush({ flush () { return index .insert(cache, key, integrity, { ...opts, size }) .then((entry) => { if (memoize && memoData) { memo.put(cache, entry, memoData, opts) } if (integrity) { pipeline.emit('integrity', integrity) } if (size) { pipeline.emit('size', size) } }) } })) return pipeline } 'use strict' const util = require('util') const index = require('./lib/entry-index') const memo = require('./lib/memoization') const path = require('path') const rimraf = util.promisify(require('rimraf')) const rmContent = require('./lib/content/rm') module.exports = entry module.exports.entry = entry function entry (cache, key) { memo.clearMemoized() return index.delete(cache, key) } module.exports.content = content function content (cache, integrity) { memo.clearMemoized() return rmContent(cache, integrity) } module.exports.all = all function all (cache) { memo.clearMemoized() return rimraf(path.join(cache, '*(content-*|index-*)')) } 'use strict' module.exports = require('./lib/verify') 'use strict' const util = require('util') const crypto = require('crypto') const fs = require('fs') const Minipass = require('minipass') const path = require('path') const ssri = require('ssri') const contentPath = require('./content/path') const fixOwner = require('./util/fix-owner') const hashToSegments = require('./util/hash-to-segments') const indexV = require('../package.json')['cache-version'].index const appendFile = util.promisify(fs.appendFile) const readFile = util.promisify(fs.readFile) const readdir = util.promisify(fs.readdir) module.exports.NotFoundError = class NotFoundError extends Error { constructor (cache, key) { super(`No cache entry for ${key} found in ${cache}`) this.code = 'ENOENT' this.cache = cache this.key = key } } module.exports.insert = insert function insert (cache, key, integrity, opts = {}) { const { metadata, size } = opts const bucket = bucketPath(cache, key) const entry = { key, integrity: integrity && ssri.stringify(integrity), time: Date.now(), size, metadata } return fixOwner .mkdirfix(cache, path.dirname(bucket)) .then(() => { const stringified = JSON.stringify(entry) // NOTE - Cleverness ahoy! // // This works because it's tremendously unlikely for an entry to corrupt // another while still preserving the string length of the JSON in // question. So, we just slap the length in there and verify it on read. // // Thanks to @isaacs for the whiteboarding session that ended up with this. return appendFile(bucket, `\n${hashEntry(stringified)}\t${stringified}`) }) .then(() => fixOwner.chownr(cache, bucket)) .catch((err) => { if (err.code === 'ENOENT') { return undefined } throw err // There's a class of race conditions that happen when things get deleted // during fixOwner, or between the two mkdirfix/chownr calls. // // It's perfectly fine to just not bother in those cases and lie // that the index entry was written. Because it's a cache. }) .then(() => { return formatEntry(cache, entry) }) } module.exports.insert.sync = insertSync function insertSync (cache, key, integrity, opts = {}) { const { metadata, size } = opts const bucket = bucketPath(cache, key) const entry = { key, integrity: integrity && ssri.stringify(integrity), time: Date.now(), size, metadata } fixOwner.mkdirfix.sync(cache, path.dirname(bucket)) const stringified = JSON.stringify(entry) fs.appendFileSync(bucket, `\n${hashEntry(stringified)}\t${stringified}`) try { fixOwner.chownr.sync(cache, bucket) } catch (err) { if (err.code !== 'ENOENT') { throw err } } return formatEntry(cache, entry) } module.exports.find = find function find (cache, key) { const bucket = bucketPath(cache, key) return bucketEntries(bucket) .then((entries) => { return entries.reduce((latest, next) => { if (next && next.key === key) { return formatEntry(cache, next) } else { return latest } }, null) }) .catch((err) => { if (err.code === 'ENOENT') { return null } else { throw err } }) } module.exports.find.sync = findSync function findSync (cache, key) { const bucket = bucketPath(cache, key) try { return bucketEntriesSync(bucket).reduce((latest, next) => { if (next && next.key === key) { return formatEntry(cache, next) } else { return latest } }, null) } catch (err) { if (err.code === 'ENOENT') { return null } else { throw err } } } module.exports.delete = del function del (cache, key, opts) { return insert(cache, key, null, opts) } module.exports.delete.sync = delSync function delSync (cache, key, opts) { return insertSync(cache, key, null, opts) } module.exports.lsStream = lsStream function lsStream (cache) { const indexDir = bucketDir(cache) const stream = new Minipass({ objectMode: true }) readdirOrEmpty(indexDir).then(buckets => Promise.all( buckets.map(bucket => { const bucketPath = path.join(indexDir, bucket) return readdirOrEmpty(bucketPath).then(subbuckets => Promise.all( subbuckets.map(subbucket => { const subbucketPath = path.join(bucketPath, subbucket) // "/cachename//./*" return readdirOrEmpty(subbucketPath).then(entries => Promise.all( entries.map(entry => { const entryPath = path.join(subbucketPath, entry) return bucketEntries(entryPath).then(entries => // using a Map here prevents duplicate keys from // showing up twice, I guess? entries.reduce((acc, entry) => { acc.set(entry.key, entry) return acc }, new Map()) ).then(reduced => { // reduced is a map of key => entry for (const entry of reduced.values()) { const formatted = formatEntry(cache, entry) if (formatted) { stream.write(formatted) } } }).catch(err => { if (err.code === 'ENOENT') { return undefined } throw err }) }) )) }) )) }) )) .then( () => stream.end(), err => stream.emit('error', err) ) return stream } module.exports.ls = ls function ls (cache) { return lsStream(cache).collect().then(entries => entries.reduce((acc, xs) => { acc[xs.key] = xs return acc }, {}) ) } function bucketEntries (bucket, filter) { return readFile(bucket, 'utf8').then((data) => _bucketEntries(data, filter)) } function bucketEntriesSync (bucket, filter) { const data = fs.readFileSync(bucket, 'utf8') return _bucketEntries(data, filter) } function _bucketEntries (data, filter) { const entries = [] data.split('\n').forEach((entry) => { if (!entry) { return } const pieces = entry.split('\t') if (!pieces[1] || hashEntry(pieces[1]) !== pieces[0]) { // Hash is no good! Corruption or malice? Doesn't matter! // EJECT EJECT return } let obj try { obj = JSON.parse(pieces[1]) } catch (e) { // Entry is corrupted! return } if (obj) { entries.push(obj) } }) return entries } module.exports.bucketDir = bucketDir function bucketDir (cache) { return path.join(cache, `index-v${indexV}`) } module.exports.bucketPath = bucketPath function bucketPath (cache, key) { const hashed = hashKey(key) return path.join.apply( path, [bucketDir(cache)].concat(hashToSegments(hashed)) ) } module.exports.hashKey = hashKey function hashKey (key) { return hash(key, 'sha256') } module.exports.hashEntry = hashEntry function hashEntry (str) { return hash(str, 'sha1') } function hash (str, digest) { return crypto .createHash(digest) .update(str) .digest('hex') } function formatEntry (cache, entry) { // Treat null digests as deletions. They'll shadow any previous entries. if (!entry.integrity) { return null } return { key: entry.key, integrity: entry.integrity, path: contentPath(cache, entry.integrity), size: entry.size, time: entry.time, metadata: entry.metadata } } function readdirOrEmpty (dir) { return readdir(dir).catch((err) => { if (err.code === 'ENOENT' || err.code === 'ENOTDIR') { return [] } throw err }) } 'use strict' const LRU = require('lru-cache') const MAX_SIZE = 50 * 1024 * 1024 // 50MB const MAX_AGE = 3 * 60 * 1000 const MEMOIZED = new LRU({ max: MAX_SIZE, maxAge: MAX_AGE, length: (entry, key) => key.startsWith('key:') ? entry.data.length : entry.length }) module.exports.clearMemoized = clearMemoized function clearMemoized () { const old = {} MEMOIZED.forEach((v, k) => { old[k] = v }) MEMOIZED.reset() return old } module.exports.put = put function put (cache, entry, data, opts) { pickMem(opts).set(`key:${cache}:${entry.key}`, { entry, data }) putDigest(cache, entry.integrity, data, opts) } module.exports.put.byDigest = putDigest function putDigest (cache, integrity, data, opts) { pickMem(opts).set(`digest:${cache}:${integrity}`, data) } module.exports.get = get function get (cache, key, opts) { return pickMem(opts).get(`key:${cache}:${key}`) } module.exports.get.byDigest = getDigest function getDigest (cache, integrity, opts) { return pickMem(opts).get(`digest:${cache}:${integrity}`) } class ObjProxy { constructor (obj) { this.obj = obj } get (key) { return this.obj[key] } set (key, val) { this.obj[key] = val } } function pickMem (opts) { if (!opts || !opts.memoize) { return MEMOIZED } else if (opts.memoize.get && opts.memoize.set) { return opts.memoize } else if (typeof opts.memoize === 'object') { return new ObjProxy(opts.memoize) } else { return MEMOIZED } } 'use strict' const util = require('util') const pMap = require('p-map') const contentPath = require('./content/path') const fixOwner = require('./util/fix-owner') const fs = require('fs') const fsm = require('fs-minipass') const glob = util.promisify(require('glob')) const index = require('./entry-index') const path = require('path') const rimraf = util.promisify(require('rimraf')) const ssri = require('ssri') const hasOwnProperty = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key) const stat = util.promisify(fs.stat) const truncate = util.promisify(fs.truncate) const writeFile = util.promisify(fs.writeFile) const readFile = util.promisify(fs.readFile) const verifyOpts = (opts) => ({ concurrency: 20, log: { silly () {} }, ...opts }) module.exports = verify function verify (cache, opts) { opts = verifyOpts(opts) opts.log.silly('verify', 'verifying cache at', cache) const steps = [ markStartTime, fixPerms, garbageCollect, rebuildIndex, cleanTmp, writeVerifile, markEndTime ] return steps .reduce((promise, step, i) => { const label = step.name const start = new Date() return promise.then((stats) => { return step(cache, opts).then((s) => { s && Object.keys(s).forEach((k) => { stats[k] = s[k] }) const end = new Date() if (!stats.runTime) { stats.runTime = {} } stats.runTime[label] = end - start return Promise.resolve(stats) }) }) }, Promise.resolve({})) .then((stats) => { stats.runTime.total = stats.endTime - stats.startTime opts.log.silly( 'verify', 'verification finished for', cache, 'in', `${stats.runTime.total}ms` ) return stats }) } function markStartTime (cache, opts) { return Promise.resolve({ startTime: new Date() }) } function markEndTime (cache, opts) { return Promise.resolve({ endTime: new Date() }) } function fixPerms (cache, opts) { opts.log.silly('verify', 'fixing cache permissions') return fixOwner .mkdirfix(cache, cache) .then(() => { // TODO - fix file permissions too return fixOwner.chownr(cache, cache) }) .then(() => null) } // Implements a naive mark-and-sweep tracing garbage collector. // // The algorithm is basically as follows: // 1. Read (and filter) all index entries ("pointers") // 2. Mark each integrity value as "live" // 3. Read entire filesystem tree in `content-vX/` dir // 4. If content is live, verify its checksum and delete it if it fails // 5. If content is not marked as live, rimraf it. // function garbageCollect (cache, opts) { opts.log.silly('verify', 'garbage collecting content') const indexStream = index.lsStream(cache) const liveContent = new Set() indexStream.on('data', (entry) => { if (opts.filter && !opts.filter(entry)) { return } liveContent.add(entry.integrity.toString()) }) return new Promise((resolve, reject) => { indexStream.on('end', resolve).on('error', reject) }).then(() => { const contentDir = contentPath.contentDir(cache) return glob(path.join(contentDir, '**'), { follow: false, nodir: true, nosort: true }).then((files) => { return Promise.resolve({ verifiedContent: 0, reclaimedCount: 0, reclaimedSize: 0, badContentCount: 0, keptSize: 0 }).then((stats) => pMap( files, (f) => { const split = f.split(/[/\\]/) const digest = split.slice(split.length - 3).join('') const algo = split[split.length - 4] const integrity = ssri.fromHex(digest, algo) if (liveContent.has(integrity.toString())) { return verifyContent(f, integrity).then((info) => { if (!info.valid) { stats.reclaimedCount++ stats.badContentCount++ stats.reclaimedSize += info.size } else { stats.verifiedContent++ stats.keptSize += info.size } return stats }) } else { // No entries refer to this content. We can delete. stats.reclaimedCount++ return stat(f).then((s) => { return rimraf(f).then(() => { stats.reclaimedSize += s.size return stats }) }) } }, { concurrency: opts.concurrency } ).then(() => stats) ) }) }) } function verifyContent (filepath, sri) { return stat(filepath) .then((s) => { const contentInfo = { size: s.size, valid: true } return ssri .checkStream(new fsm.ReadStream(filepath), sri) .catch((err) => { if (err.code !== 'EINTEGRITY') { throw err } return rimraf(filepath).then(() => { contentInfo.valid = false }) }) .then(() => contentInfo) }) .catch((err) => { if (err.code === 'ENOENT') { return { size: 0, valid: false } } throw err }) } function rebuildIndex (cache, opts) { opts.log.silly('verify', 'rebuilding index') return index.ls(cache).then((entries) => { const stats = { missingContent: 0, rejectedEntries: 0, totalEntries: 0 } const buckets = {} for (const k in entries) { /* istanbul ignore else */ if (hasOwnProperty(entries, k)) { const hashed = index.hashKey(k) const entry = entries[k] const excluded = opts.filter && !opts.filter(entry) excluded && stats.rejectedEntries++ if (buckets[hashed] && !excluded) { buckets[hashed].push(entry) } else if (buckets[hashed] && excluded) { // skip } else if (excluded) { buckets[hashed] = [] buckets[hashed]._path = index.bucketPath(cache, k) } else { buckets[hashed] = [entry] buckets[hashed]._path = index.bucketPath(cache, k) } } } return pMap( Object.keys(buckets), (key) => { return rebuildBucket(cache, buckets[key], stats, opts) }, { concurrency: opts.concurrency } ).then(() => stats) }) } function rebuildBucket (cache, bucket, stats, opts) { return truncate(bucket._path).then(() => { // This needs to be serialized because cacache explicitly // lets very racy bucket conflicts clobber each other. return bucket.reduce((promise, entry) => { return promise.then(() => { const content = contentPath(cache, entry.integrity) return stat(content) .then(() => { return index .insert(cache, entry.key, entry.integrity, { metadata: entry.metadata, size: entry.size }) .then(() => { stats.totalEntries++ }) }) .catch((err) => { if (err.code === 'ENOENT') { stats.rejectedEntries++ stats.missingContent++ return } throw err }) }) }, Promise.resolve()) }) } function cleanTmp (cache, opts) { opts.log.silly('verify', 'cleaning tmp directory') return rimraf(path.join(cache, 'tmp')) } function writeVerifile (cache, opts) { const verifile = path.join(cache, '_lastverified') opts.log.silly('verify', 'writing verifile to ' + verifile) try { return writeFile(verifile, '' + +new Date()) } finally { fixOwner.chownr.sync(cache, verifile) } } module.exports.lastRun = lastRun function lastRun (cache) { return readFile(path.join(cache, '_lastverified'), 'utf8').then( (data) => new Date(+data) ) } 'use strict' const contentVer = require('../../package.json')['cache-version'].content const hashToSegments = require('../util/hash-to-segments') const path = require('path') const ssri = require('ssri') // Current format of content file path: // // sha512-BaSE64Hex= -> // ~/.my-cache/content-v2/sha512/ba/da/55deadbeefc0ffee // module.exports = contentPath function contentPath (cache, integrity) { const sri = ssri.parse(integrity, { single: true }) // contentPath is the *strongest* algo given return path.join( contentDir(cache), sri.algorithm, ...hashToSegments(sri.hexDigest()) ) } module.exports.contentDir = contentDir function contentDir (cache) { return path.join(cache, `content-v${contentVer}`) } 'use strict' const util = require('util') const fs = require('fs') const fsm = require('fs-minipass') const ssri = require('ssri') const contentPath = require('./path') const Pipeline = require('minipass-pipeline') const lstat = util.promisify(fs.lstat) const readFile = util.promisify(fs.readFile) module.exports = read const MAX_SINGLE_READ_SIZE = 64 * 1024 * 1024 function read (cache, integrity, opts = {}) { const { size } = opts return withContentSri(cache, integrity, (cpath, sri) => { // get size return lstat(cpath).then(stat => ({ stat, cpath, sri })) }).then(({ stat, cpath, sri }) => { if (typeof size === 'number' && stat.size !== size) { throw sizeError(size, stat.size) } if (stat.size > MAX_SINGLE_READ_SIZE) { return readPipeline(cpath, stat.size, sri, new Pipeline()).concat() } return readFile(cpath, null).then((data) => { if (!ssri.checkData(data, sri)) { throw integrityError(sri, cpath) } return data }) }) } const readPipeline = (cpath, size, sri, stream) => { stream.push( new fsm.ReadStream(cpath, { size, readSize: MAX_SINGLE_READ_SIZE }), ssri.integrityStream({ integrity: sri, size }) ) return stream } module.exports.sync = readSync function readSync (cache, integrity, opts = {}) { const { size } = opts return withContentSriSync(cache, integrity, (cpath, sri) => { const data = fs.readFileSync(cpath) if (typeof size === 'number' && size !== data.length) { throw sizeError(size, data.length) } if (ssri.checkData(data, sri)) { return data } throw integrityError(sri, cpath) }) } module.exports.stream = readStream module.exports.readStream = readStream function readStream (cache, integrity, opts = {}) { const { size } = opts const stream = new Pipeline() withContentSri(cache, integrity, (cpath, sri) => { // just lstat to ensure it exists return lstat(cpath).then((stat) => ({ stat, cpath, sri })) }).then(({ stat, cpath, sri }) => { if (typeof size === 'number' && size !== stat.size) { return stream.emit('error', sizeError(size, stat.size)) } readPipeline(cpath, stat.size, sri, stream) }, er => stream.emit('error', er)) return stream } let copyFile if (fs.copyFile) { module.exports.copy = copy module.exports.copy.sync = copySync copyFile = util.promisify(fs.copyFile) } function copy (cache, integrity, dest) { return withContentSri(cache, integrity, (cpath, sri) => { return copyFile(cpath, dest) }) } function copySync (cache, integrity, dest) { return withContentSriSync(cache, integrity, (cpath, sri) => { return fs.copyFileSync(cpath, dest) }) } module.exports.hasContent = hasContent function hasContent (cache, integrity) { if (!integrity) { return Promise.resolve(false) } return withContentSri(cache, integrity, (cpath, sri) => { return lstat(cpath).then((stat) => ({ size: stat.size, sri, stat })) }).catch((err) => { if (err.code === 'ENOENT') { return false } if (err.code === 'EPERM') { /* istanbul ignore else */ if (process.platform !== 'win32') { throw err } else { return false } } }) } module.exports.hasContent.sync = hasContentSync function hasContentSync (cache, integrity) { if (!integrity) { return false } return withContentSriSync(cache, integrity, (cpath, sri) => { try { const stat = fs.lstatSync(cpath) return { size: stat.size, sri, stat } } catch (err) { if (err.code === 'ENOENT') { return false } if (err.code === 'EPERM') { /* istanbul ignore else */ if (process.platform !== 'win32') { throw err } else { return false } } } }) } function withContentSri (cache, integrity, fn) { const tryFn = () => { const sri = ssri.parse(integrity) // If `integrity` has multiple entries, pick the first digest // with available local data. const algo = sri.pickAlgorithm() const digests = sri[algo] if (digests.length <= 1) { const cpath = contentPath(cache, digests[0]) return fn(cpath, digests[0]) } else { // Can't use race here because a generic error can happen before a ENOENT error, and can happen before a valid result return Promise .all(digests.map((meta) => { return withContentSri(cache, meta, fn) .catch((err) => { if (err.code === 'ENOENT') { return Object.assign( new Error('No matching content found for ' + sri.toString()), { code: 'ENOENT' } ) } return err }) })) .then((results) => { // Return the first non error if it is found const result = results.find((r) => !(r instanceof Error)) if (result) { return result } // Throw the No matching content found error const enoentError = results.find((r) => r.code === 'ENOENT') if (enoentError) { throw enoentError } // Throw generic error throw results.find((r) => r instanceof Error) }) } } return new Promise((resolve, reject) => { try { tryFn() .then(resolve) .catch(reject) } catch (err) { reject(err) } }) } function withContentSriSync (cache, integrity, fn) { const sri = ssri.parse(integrity) // If `integrity` has multiple entries, pick the first digest // with available local data. const algo = sri.pickAlgorithm() const digests = sri[algo] if (digests.length <= 1) { const cpath = contentPath(cache, digests[0]) return fn(cpath, digests[0]) } else { let lastErr = null for (const meta of digests) { try { return withContentSriSync(cache, meta, fn) } catch (err) { lastErr = err } } throw lastErr } } function sizeError (expected, found) { const err = new Error(`Bad data size: expected inserted data to be ${expected} bytes, but got ${found} instead`) err.expected = expected err.found = found err.code = 'EBADSIZE' return err } function integrityError (sri, path) { const err = new Error(`Integrity verification failed for ${sri} (${path})`) err.code = 'EINTEGRITY' err.sri = sri err.path = path return err } 'use strict' const util = require('util') const contentPath = require('./path') const { hasContent } = require('./read') const rimraf = util.promisify(require('rimraf')) module.exports = rm function rm (cache, integrity) { return hasContent(cache, integrity).then((content) => { // ~pretty~ sure we can't end up with a content lacking sri, but be safe if (content && content.sri) { return rimraf(contentPath(cache, content.sri)).then(() => true) } else { return false } }) } 'use strict' const util = require('util') const contentPath = require('./path') const fixOwner = require('../util/fix-owner') const fs = require('fs') const moveFile = require('../util/move-file') const Minipass = require('minipass') const Pipeline = require('minipass-pipeline') const Flush = require('minipass-flush') const path = require('path') const rimraf = util.promisify(require('rimraf')) const ssri = require('ssri') const uniqueFilename = require('unique-filename') const { disposer } = require('./../util/disposer') const fsm = require('fs-minipass') const writeFile = util.promisify(fs.writeFile) module.exports = write function write (cache, data, opts = {}) { const { algorithms, size, integrity } = opts if (algorithms && algorithms.length > 1) { throw new Error('opts.algorithms only supports a single algorithm for now') } if (typeof size === 'number' && data.length !== size) { return Promise.reject(sizeError(size, data.length)) } const sri = ssri.fromData(data, algorithms ? { algorithms } : {}) if (integrity && !ssri.checkData(data, integrity, opts)) { return Promise.reject(checksumError(integrity, sri)) } return disposer(makeTmp(cache, opts), makeTmpDisposer, (tmp) => { return writeFile(tmp.target, data, { flag: 'wx' }) .then(() => moveToDestination(tmp, cache, sri, opts)) }) .then(() => ({ integrity: sri, size: data.length })) } module.exports.stream = writeStream // writes proxied to the 'inputStream' that is passed to the Promise // 'end' is deferred until content is handled. class CacacheWriteStream extends Flush { constructor (cache, opts) { super() this.opts = opts this.cache = cache this.inputStream = new Minipass() this.inputStream.on('error', er => this.emit('error', er)) this.inputStream.on('drain', () => this.emit('drain')) this.handleContentP = null } write (chunk, encoding, cb) { if (!this.handleContentP) { this.handleContentP = handleContent( this.inputStream, this.cache, this.opts ) } return this.inputStream.write(chunk, encoding, cb) } flush (cb) { this.inputStream.end(() => { if (!this.handleContentP) { const e = new Error('Cache input stream was empty') e.code = 'ENODATA' // empty streams are probably emitting end right away. // defer this one tick by rejecting a promise on it. return Promise.reject(e).catch(cb) } this.handleContentP.then( (res) => { res.integrity && this.emit('integrity', res.integrity) res.size !== null && this.emit('size', res.size) cb() }, (er) => cb(er) ) }) } } function writeStream (cache, opts = {}) { return new CacacheWriteStream(cache, opts) } function handleContent (inputStream, cache, opts) { return disposer(makeTmp(cache, opts), makeTmpDisposer, (tmp) => { return pipeToTmp(inputStream, cache, tmp.target, opts) .then((res) => { return moveToDestination( tmp, cache, res.integrity, opts ).then(() => res) }) }) } function pipeToTmp (inputStream, cache, tmpTarget, opts) { let integrity let size const hashStream = ssri.integrityStream({ integrity: opts.integrity, algorithms: opts.algorithms, size: opts.size }) hashStream.on('integrity', i => { integrity = i }) hashStream.on('size', s => { size = s }) const outStream = new fsm.WriteStream(tmpTarget, { flags: 'wx' }) // NB: this can throw if the hashStream has a problem with // it, and the data is fully written. but pipeToTmp is only // called in promisory contexts where that is handled. const pipeline = new Pipeline( inputStream, hashStream, outStream ) return pipeline.promise() .then(() => ({ integrity, size })) .catch(er => rimraf(tmpTarget).then(() => { throw er })) } function makeTmp (cache, opts) { const tmpTarget = uniqueFilename(path.join(cache, 'tmp'), opts.tmpPrefix) return fixOwner.mkdirfix(cache, path.dirname(tmpTarget)).then(() => ({ target: tmpTarget, moved: false })) } function makeTmpDisposer (tmp) { if (tmp.moved) { return Promise.resolve() } return rimraf(tmp.target) } function moveToDestination (tmp, cache, sri, opts) { const destination = contentPath(cache, sri) const destDir = path.dirname(destination) return fixOwner .mkdirfix(cache, destDir) .then(() => { return moveFile(tmp.target, destination) }) .then(() => { tmp.moved = true return fixOwner.chownr(cache, destination) }) } function sizeError (expected, found) { const err = new Error(`Bad data size: expected inserted data to be ${expected} bytes, but got ${found} instead`) err.expected = expected err.found = found err.code = 'EBADSIZE' return err } function checksumError (expected, found) { const err = new Error(`Integrity check failed: Wanted: ${expected} Found: ${found}`) err.code = 'EINTEGRITY' err.expected = expected err.found = found return err } 'use strict' module.exports.disposer = disposer function disposer (creatorFn, disposerFn, fn) { const runDisposer = (resource, result, shouldThrow = false) => { return disposerFn(resource) .then( // disposer resolved, do something with original fn's promise () => { if (shouldThrow) { throw result } return result }, // Disposer fn failed, crash process (err) => { throw err // Or process.exit? }) } return creatorFn .then((resource) => { // fn(resource) can throw, so wrap in a promise here return Promise.resolve().then(() => fn(resource)) .then((result) => runDisposer(resource, result)) .catch((err) => runDisposer(resource, err, true)) }) } 'use strict' const util = require('util') const chownr = util.promisify(require('chownr')) const mkdirp = require('mkdirp') const inflight = require('promise-inflight') const inferOwner = require('infer-owner') // Memoize getuid()/getgid() calls. // patch process.setuid/setgid to invalidate cached value on change const self = { uid: null, gid: null } const getSelf = () => { if (typeof self.uid !== 'number') { self.uid = process.getuid() const setuid = process.setuid process.setuid = (uid) => { self.uid = null process.setuid = setuid return process.setuid(uid) } } if (typeof self.gid !== 'number') { self.gid = process.getgid() const setgid = process.setgid process.setgid = (gid) => { self.gid = null process.setgid = setgid return process.setgid(gid) } } } module.exports.chownr = fixOwner function fixOwner (cache, filepath) { if (!process.getuid) { // This platform doesn't need ownership fixing return Promise.resolve() } getSelf() if (self.uid !== 0) { // almost certainly can't chown anyway return Promise.resolve() } return Promise.resolve(inferOwner(cache)).then((owner) => { const { uid, gid } = owner // No need to override if it's already what we used. if (self.uid === uid && self.gid === gid) { return } return inflight('fixOwner: fixing ownership on ' + filepath, () => chownr( filepath, typeof uid === 'number' ? uid : self.uid, typeof gid === 'number' ? gid : self.gid ).catch((err) => { if (err.code === 'ENOENT') { return null } throw err }) ) }) } module.exports.chownr.sync = fixOwnerSync function fixOwnerSync (cache, filepath) { if (!process.getuid) { // This platform doesn't need ownership fixing return } const { uid, gid } = inferOwner.sync(cache) getSelf() if (self.uid !== 0) { // almost certainly can't chown anyway return } if (self.uid === uid && self.gid === gid) { // No need to override if it's already what we used. return } try { chownr.sync( filepath, typeof uid === 'number' ? uid : self.uid, typeof gid === 'number' ? gid : self.gid ) } catch (err) { // only catch ENOENT, any other error is a problem. if (err.code === 'ENOENT') { return null } throw err } } module.exports.mkdirfix = mkdirfix function mkdirfix (cache, p, cb) { // we have to infer the owner _before_ making the directory, even though // we aren't going to use the results, since the cache itself might not // exist yet. If we mkdirp it, then our current uid/gid will be assumed // to be correct if it creates the cache folder in the process. return Promise.resolve(inferOwner(cache)).then(() => { return mkdirp(p) .then((made) => { if (made) { return fixOwner(cache, made).then(() => made) } }) .catch((err) => { if (err.code === 'EEXIST') { return fixOwner(cache, p).then(() => null) } throw err }) }) } module.exports.mkdirfix.sync = mkdirfixSync function mkdirfixSync (cache, p) { try { inferOwner.sync(cache) const made = mkdirp.sync(p) if (made) { fixOwnerSync(cache, made) return made } } catch (err) { if (err.code === 'EEXIST') { fixOwnerSync(cache, p) return null } else { throw err } } } 'use strict' module.exports = hashToSegments function hashToSegments (hash) { return [hash.slice(0, 2), hash.slice(2, 4), hash.slice(4)] } 'use strict' const fs = require('fs') const util = require('util') const chmod = util.promisify(fs.chmod) const unlink = util.promisify(fs.unlink) const stat = util.promisify(fs.stat) const move = require('@npmcli/move-file') const pinflight = require('promise-inflight') module.exports = moveFile function moveFile (src, dest) { const isWindows = global.__CACACHE_TEST_FAKE_WINDOWS__ || process.platform === 'win32' // This isn't quite an fs.rename -- the assumption is that // if `dest` already exists, and we get certain errors while // trying to move it, we should just not bother. // // In the case of cache corruption, users will receive an // EINTEGRITY error elsewhere, and can remove the offending // content their own way. // // Note that, as the name suggests, this strictly only supports file moves. return new Promise((resolve, reject) => { fs.link(src, dest, (err) => { if (err) { if (isWindows && err.code === 'EPERM') { // XXX This is a really weird way to handle this situation, as it // results in the src file being deleted even though the dest // might not exist. Since we pretty much always write files to // deterministic locations based on content hash, this is likely // ok (or at worst, just ends in a future cache miss). But it would // be worth investigating at some time in the future if this is // really what we want to do here. return resolve() } else if (err.code === 'EEXIST' || err.code === 'EBUSY') { // file already exists, so whatever return resolve() } else { return reject(err) } } else { return resolve() } }) }) .then(() => { // content should never change for any reason, so make it read-only return Promise.all([ unlink(src), !isWindows && chmod(dest, '0444') ]) }) .catch(() => { return pinflight('cacache-move-file:' + dest, () => { return stat(dest).catch((err) => { if (err.code !== 'ENOENT') { // Something else is wrong here. Bail bail bail throw err } // file doesn't already exist! let's try a rename -> copy fallback // only delete if it successfully copies return move(src, dest) }) }) }) } 'use strict' const util = require('util') const fixOwner = require('./fix-owner') const path = require('path') const rimraf = util.promisify(require('rimraf')) const uniqueFilename = require('unique-filename') const { disposer } = require('./disposer') module.exports.mkdir = mktmpdir function mktmpdir (cache, opts = {}) { const { tmpPrefix } = opts const tmpTarget = uniqueFilename(path.join(cache, 'tmp'), tmpPrefix) return fixOwner.mkdirfix(cache, tmpTarget).then(() => { return tmpTarget }) } module.exports.withTmp = withTmp function withTmp (cache, opts, cb) { if (!cb) { cb = opts opts = {} } return disposer(mktmpdir(cache, opts), rimraf, cb) } module.exports.fix = fixtmpdir function fixtmpdir (cache) { return fixOwner(cache, path.join(cache, 'tmp')) } ## 7.0 - Raise error if `options.cwd` is specified, and not a directory ## 6.0 - Remove comment and negation pattern support - Ignore patterns are always in `dot:true` mode ## 5.0 - Deprecate comment and negation patterns - Fix regression in `mark` and `nodir` options from making all cache keys absolute path. - Abort if `fs.readdir` returns an error that's unexpected - Don't emit `match` events for ignored items - Treat ENOTSUP like ENOTDIR in readdir ## 4.5 - Add `options.follow` to always follow directory symlinks in globstar - Add `options.realpath` to call `fs.realpath` on all results - Always cache based on absolute path ## 4.4 - Add `options.ignore` - Fix handling of broken symlinks ## 4.3 - Bump minimatch to 2.x - Pass all tests on Windows ## 4.2 - Add `glob.hasMagic` function - Add `options.nodir` flag ## 4.1 - Refactor sync and async implementations for performance - Throw if callback provided to sync glob function - Treat symbolic links in globstar results the same as Bash 4.3 ## 4.0 - Use `^` for dependency versions (bumped major because this breaks older npm versions) - Ensure callbacks are only ever called once - switch to ISC license ## 3.x - Rewrite in JavaScript - Add support for setting root, cwd, and windows support - Cache many fs calls - Add globstar support - emit match events ## 2.x - Use `glob.h` and `fnmatch.h` from NetBSD ## 1.x - `glob.h` static binding. exports.alphasort = alphasort exports.alphasorti = alphasorti exports.setopts = setopts exports.ownProp = ownProp exports.makeAbs = makeAbs exports.finish = finish exports.mark = mark exports.isIgnored = isIgnored exports.childrenIgnored = childrenIgnored function ownProp (obj, field) { return Object.prototype.hasOwnProperty.call(obj, field) } var path = require("path") var minimatch = require("minimatch") var isAbsolute = require("path-is-absolute") var Minimatch = minimatch.Minimatch function alphasorti (a, b) { return a.toLowerCase().localeCompare(b.toLowerCase()) } function alphasort (a, b) { return a.localeCompare(b) } function setupIgnores (self, options) { self.ignore = options.ignore || [] if (!Array.isArray(self.ignore)) self.ignore = [self.ignore] if (self.ignore.length) { self.ignore = self.ignore.map(ignoreMap) } } // ignore patterns are always in dot:true mode. function ignoreMap (pattern) { var gmatcher = null if (pattern.slice(-3) === '/**') { var gpattern = pattern.replace(/(\/\*\*)+$/, '') gmatcher = new Minimatch(gpattern, { dot: true }) } return { matcher: new Minimatch(pattern, { dot: true }), gmatcher: gmatcher } } function setopts (self, pattern, options) { if (!options) options = {} // base-matching: just use globstar for that. if (options.matchBase && -1 === pattern.indexOf("/")) { if (options.noglobstar) { throw new Error("base matching requires globstar") } pattern = "**/" + pattern } self.silent = !!options.silent self.pattern = pattern self.strict = options.strict !== false self.realpath = !!options.realpath self.realpathCache = options.realpathCache || Object.create(null) self.follow = !!options.follow self.dot = !!options.dot self.mark = !!options.mark self.nodir = !!options.nodir if (self.nodir) self.mark = true self.sync = !!options.sync self.nounique = !!options.nounique self.nonull = !!options.nonull self.nosort = !!options.nosort self.nocase = !!options.nocase self.stat = !!options.stat self.noprocess = !!options.noprocess self.absolute = !!options.absolute self.maxLength = options.maxLength || Infinity self.cache = options.cache || Object.create(null) self.statCache = options.statCache || Object.create(null) self.symlinks = options.symlinks || Object.create(null) setupIgnores(self, options) self.changedCwd = false var cwd = process.cwd() if (!ownProp(options, "cwd")) self.cwd = cwd else { self.cwd = path.resolve(options.cwd) self.changedCwd = self.cwd !== cwd } self.root = options.root || path.resolve(self.cwd, "/") self.root = path.resolve(self.root) if (process.platform === "win32") self.root = self.root.replace(/\\/g, "/") // TODO: is an absolute `cwd` supposed to be resolved against `root`? // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) if (process.platform === "win32") self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") self.nomount = !!options.nomount // disable comments and negation in Minimatch. // Note that they are not supported in Glob itself anyway. options.nonegate = true options.nocomment = true self.minimatch = new Minimatch(pattern, options) self.options = self.minimatch.options } function finish (self) { var nou = self.nounique var all = nou ? [] : Object.create(null) for (var i = 0, l = self.matches.length; i < l; i ++) { var matches = self.matches[i] if (!matches || Object.keys(matches).length === 0) { if (self.nonull) { // do like the shell, and spit out the literal glob var literal = self.minimatch.globSet[i] if (nou) all.push(literal) else all[literal] = true } } else { // had matches var m = Object.keys(matches) if (nou) all.push.apply(all, m) else m.forEach(function (m) { all[m] = true }) } } if (!nou) all = Object.keys(all) if (!self.nosort) all = all.sort(self.nocase ? alphasorti : alphasort) // at *some* point we statted all of these if (self.mark) { for (var i = 0; i < all.length; i++) { all[i] = self._mark(all[i]) } if (self.nodir) { all = all.filter(function (e) { var notDir = !(/\/$/.test(e)) var c = self.cache[e] || self.cache[makeAbs(self, e)] if (notDir && c) notDir = c !== 'DIR' && !Array.isArray(c) return notDir }) } } if (self.ignore.length) all = all.filter(function(m) { return !isIgnored(self, m) }) self.found = all } function mark (self, p) { var abs = makeAbs(self, p) var c = self.cache[abs] var m = p if (c) { var isDir = c === 'DIR' || Array.isArray(c) var slash = p.slice(-1) === '/' if (isDir && !slash) m += '/' else if (!isDir && slash) m = m.slice(0, -1) if (m !== p) { var mabs = makeAbs(self, m) self.statCache[mabs] = self.statCache[abs] self.cache[mabs] = self.cache[abs] } } return m } // lotta situps... function makeAbs (self, f) { var abs = f if (f.charAt(0) === '/') { abs = path.join(self.root, f) } else if (isAbsolute(f) || f === '') { abs = f } else if (self.changedCwd) { abs = path.resolve(self.cwd, f) } else { abs = path.resolve(f) } if (process.platform === 'win32') abs = abs.replace(/\\/g, '/') return abs } // Return true, if pattern ends with globstar '**', for the accompanying parent directory. // Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents function isIgnored (self, path) { if (!self.ignore.length) return false return self.ignore.some(function(item) { return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) }) } function childrenIgnored (self, path) { if (!self.ignore.length) return false return self.ignore.some(function(item) { return !!(item.gmatcher && item.gmatcher.match(path)) }) } // Approach: // // 1. Get the minimatch set // 2. For each pattern in the set, PROCESS(pattern, false) // 3. Store matches per-set, then uniq them // // PROCESS(pattern, inGlobStar) // Get the first [n] items from pattern that are all strings // Join these together. This is PREFIX. // If there is no more remaining, then stat(PREFIX) and // add to matches if it succeeds. END. // // If inGlobStar and PREFIX is symlink and points to dir // set ENTRIES = [] // else readdir(PREFIX) as ENTRIES // If fail, END // // with ENTRIES // If pattern[n] is GLOBSTAR // // handle the case where the globstar match is empty // // by pruning it out, and testing the resulting pattern // PROCESS(pattern[0..n] + pattern[n+1 .. $], false) // // handle other cases. // for ENTRY in ENTRIES (not dotfiles) // // attach globstar + tail onto the entry // // Mark that this entry is a globstar match // PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) // // else // not globstar // for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) // Test ENTRY against pattern[n] // If fails, continue // If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) // // Caveat: // Cache all stats and readdirs results to minimize syscall. Since all // we ever care about is existence and directory-ness, we can just keep // `true` for files, and [children,...] for directories, or `false` for // things that don't exist. module.exports = glob var fs = require('fs') var rp = require('fs.realpath') var minimatch = require('minimatch') var Minimatch = minimatch.Minimatch var inherits = require('inherits') var EE = require('events').EventEmitter var path = require('path') var assert = require('assert') var isAbsolute = require('path-is-absolute') var globSync = require('./sync.js') var common = require('./common.js') var alphasort = common.alphasort var alphasorti = common.alphasorti var setopts = common.setopts var ownProp = common.ownProp var inflight = require('inflight') var util = require('util') var childrenIgnored = common.childrenIgnored var isIgnored = common.isIgnored var once = require('once') function glob (pattern, options, cb) { if (typeof options === 'function') cb = options, options = {} if (!options) options = {} if (options.sync) { if (cb) throw new TypeError('callback provided to sync glob') return globSync(pattern, options) } return new Glob(pattern, options, cb) } glob.sync = globSync var GlobSync = glob.GlobSync = globSync.GlobSync // old api surface glob.glob = glob function extend (origin, add) { if (add === null || typeof add !== 'object') { return origin } var keys = Object.keys(add) var i = keys.length while (i--) { origin[keys[i]] = add[keys[i]] } return origin } glob.hasMagic = function (pattern, options_) { var options = extend({}, options_) options.noprocess = true var g = new Glob(pattern, options) var set = g.minimatch.set if (!pattern) return false if (set.length > 1) return true for (var j = 0; j < set[0].length; j++) { if (typeof set[0][j] !== 'string') return true } return false } glob.Glob = Glob inherits(Glob, EE) function Glob (pattern, options, cb) { if (typeof options === 'function') { cb = options options = null } if (options && options.sync) { if (cb) throw new TypeError('callback provided to sync glob') return new GlobSync(pattern, options) } if (!(this instanceof Glob)) return new Glob(pattern, options, cb) setopts(this, pattern, options) this._didRealPath = false // process each pattern in the minimatch set var n = this.minimatch.set.length // The matches are stored as {: true,...} so that // duplicates are automagically pruned. // Later, we do an Object.keys() on these. // Keep them as a list so we can fill in when nonull is set. this.matches = new Array(n) if (typeof cb === 'function') { cb = once(cb) this.on('error', cb) this.on('end', function (matches) { cb(null, matches) }) } var self = this this._processing = 0 this._emitQueue = [] this._processQueue = [] this.paused = false if (this.noprocess) return this if (n === 0) return done() var sync = true for (var i = 0; i < n; i ++) { this._process(this.minimatch.set[i], i, false, done) } sync = false function done () { --self._processing if (self._processing <= 0) { if (sync) { process.nextTick(function () { self._finish() }) } else { self._finish() } } } } Glob.prototype._finish = function () { assert(this instanceof Glob) if (this.aborted) return if (this.realpath && !this._didRealpath) return this._realpath() common.finish(this) this.emit('end', this.found) } Glob.prototype._realpath = function () { if (this._didRealpath) return this._didRealpath = true var n = this.matches.length if (n === 0) return this._finish() var self = this for (var i = 0; i < this.matches.length; i++) this._realpathSet(i, next) function next () { if (--n === 0) self._finish() } } Glob.prototype._realpathSet = function (index, cb) { var matchset = this.matches[index] if (!matchset) return cb() var found = Object.keys(matchset) var self = this var n = found.length if (n === 0) return cb() var set = this.matches[index] = Object.create(null) found.forEach(function (p, i) { // If there's a problem with the stat, then it means that // one or more of the links in the realpath couldn't be // resolved. just return the abs value in that case. p = self._makeAbs(p) rp.realpath(p, self.realpathCache, function (er, real) { if (!er) set[real] = true else if (er.syscall === 'stat') set[p] = true else self.emit('error', er) // srsly wtf right here if (--n === 0) { self.matches[index] = set cb() } }) }) } Glob.prototype._mark = function (p) { return common.mark(this, p) } Glob.prototype._makeAbs = function (f) { return common.makeAbs(this, f) } Glob.prototype.abort = function () { this.aborted = true this.emit('abort') } Glob.prototype.pause = function () { if (!this.paused) { this.paused = true this.emit('pause') } } Glob.prototype.resume = function () { if (this.paused) { this.emit('resume') this.paused = false if (this._emitQueue.length) { var eq = this._emitQueue.slice(0) this._emitQueue.length = 0 for (var i = 0; i < eq.length; i ++) { var e = eq[i] this._emitMatch(e[0], e[1]) } } if (this._processQueue.length) { var pq = this._processQueue.slice(0) this._processQueue.length = 0 for (var i = 0; i < pq.length; i ++) { var p = pq[i] this._processing-- this._process(p[0], p[1], p[2], p[3]) } } } } Glob.prototype._process = function (pattern, index, inGlobStar, cb) { assert(this instanceof Glob) assert(typeof cb === 'function') if (this.aborted) return this._processing++ if (this.paused) { this._processQueue.push([pattern, index, inGlobStar, cb]) return } //console.error('PROCESS %d', this._processing, pattern) // Get the first [n] parts of pattern that are all strings. var n = 0 while (typeof pattern[n] === 'string') { n ++ } // now n is the index of the first one that is *not* a string. // see if there's anything else var prefix switch (n) { // if not, then this is rather simple case pattern.length: this._processSimple(pattern.join('/'), index, cb) return case 0: // pattern *starts* with some non-trivial item. // going to readdir(cwd), but not include the prefix in matches. prefix = null break default: // pattern has some string bits in the front. // whatever it starts with, whether that's 'absolute' like /foo/bar, // or 'relative' like '../baz' prefix = pattern.slice(0, n).join('/') break } var remain = pattern.slice(n) // get the list of entries. var read if (prefix === null) read = '.' else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { if (!prefix || !isAbsolute(prefix)) prefix = '/' + prefix read = prefix } else read = prefix var abs = this._makeAbs(read) //if ignored, skip _processing if (childrenIgnored(this, read)) return cb() var isGlobStar = remain[0] === minimatch.GLOBSTAR if (isGlobStar) this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) else this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) } Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { var self = this this._readdir(abs, inGlobStar, function (er, entries) { return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) }) } Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { // if the abs isn't a dir, then nothing can match! if (!entries) return cb() // It will only match dot entries if it starts with a dot, or if // dot is set. Stuff like @(.foo|.bar) isn't allowed. var pn = remain[0] var negate = !!this.minimatch.negate var rawGlob = pn._glob var dotOk = this.dot || rawGlob.charAt(0) === '.' var matchedEntries = [] for (var i = 0; i < entries.length; i++) { var e = entries[i] if (e.charAt(0) !== '.' || dotOk) { var m if (negate && !prefix) { m = !e.match(pn) } else { m = e.match(pn) } if (m) matchedEntries.push(e) } } //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) var len = matchedEntries.length // If there are no matched entries, then nothing matches. if (len === 0) return cb() // if this is the last remaining pattern bit, then no need for // an additional stat *unless* the user has specified mark or // stat explicitly. We know they exist, since readdir returned // them. if (remain.length === 1 && !this.mark && !this.stat) { if (!this.matches[index]) this.matches[index] = Object.create(null) for (var i = 0; i < len; i ++) { var e = matchedEntries[i] if (prefix) { if (prefix !== '/') e = prefix + '/' + e else e = prefix + e } if (e.charAt(0) === '/' && !this.nomount) { e = path.join(this.root, e) } this._emitMatch(index, e) } // This was the last one, and no stats were needed return cb() } // now test all matched entries as stand-ins for that part // of the pattern. remain.shift() for (var i = 0; i < len; i ++) { var e = matchedEntries[i] var newPattern if (prefix) { if (prefix !== '/') e = prefix + '/' + e else e = prefix + e } this._process([e].concat(remain), index, inGlobStar, cb) } cb() } Glob.prototype._emitMatch = function (index, e) { if (this.aborted) return if (isIgnored(this, e)) return if (this.paused) { this._emitQueue.push([index, e]) return } var abs = isAbsolute(e) ? e : this._makeAbs(e) if (this.mark) e = this._mark(e) if (this.absolute) e = abs if (this.matches[index][e]) return if (this.nodir) { var c = this.cache[abs] if (c === 'DIR' || Array.isArray(c)) return } this.matches[index][e] = true var st = this.statCache[abs] if (st) this.emit('stat', e, st) this.emit('match', e) } Glob.prototype._readdirInGlobStar = function (abs, cb) { if (this.aborted) return // follow all symlinked directories forever // just proceed as if this is a non-globstar situation if (this.follow) return this._readdir(abs, false, cb) var lstatkey = 'lstat\0' + abs var self = this var lstatcb = inflight(lstatkey, lstatcb_) if (lstatcb) fs.lstat(abs, lstatcb) function lstatcb_ (er, lstat) { if (er && er.code === 'ENOENT') return cb() var isSym = lstat && lstat.isSymbolicLink() self.symlinks[abs] = isSym // If it's not a symlink or a dir, then it's definitely a regular file. // don't bother doing a readdir in that case. if (!isSym && lstat && !lstat.isDirectory()) { self.cache[abs] = 'FILE' cb() } else self._readdir(abs, false, cb) } } Glob.prototype._readdir = function (abs, inGlobStar, cb) { if (this.aborted) return cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) if (!cb) return //console.error('RD %j %j', +inGlobStar, abs) if (inGlobStar && !ownProp(this.symlinks, abs)) return this._readdirInGlobStar(abs, cb) if (ownProp(this.cache, abs)) { var c = this.cache[abs] if (!c || c === 'FILE') return cb() if (Array.isArray(c)) return cb(null, c) } var self = this fs.readdir(abs, readdirCb(this, abs, cb)) } function readdirCb (self, abs, cb) { return function (er, entries) { if (er) self._readdirError(abs, er, cb) else self._readdirEntries(abs, entries, cb) } } Glob.prototype._readdirEntries = function (abs, entries, cb) { if (this.aborted) return // if we haven't asked to stat everything, then just // assume that everything in there exists, so we can avoid // having to stat it a second time. if (!this.mark && !this.stat) { for (var i = 0; i < entries.length; i ++) { var e = entries[i] if (abs === '/') e = abs + e else e = abs + '/' + e this.cache[e] = true } } this.cache[abs] = entries return cb(null, entries) } Glob.prototype._readdirError = function (f, er, cb) { if (this.aborted) return // handle errors, and cache the information switch (er.code) { case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 case 'ENOTDIR': // totally normal. means it *does* exist. var abs = this._makeAbs(f) this.cache[abs] = 'FILE' if (abs === this.cwdAbs) { var error = new Error(er.code + ' invalid cwd ' + this.cwd) error.path = this.cwd error.code = er.code this.emit('error', error) this.abort() } break case 'ENOENT': // not terribly unusual case 'ELOOP': case 'ENAMETOOLONG': case 'UNKNOWN': this.cache[this._makeAbs(f)] = false break default: // some unusual error. Treat as failure. this.cache[this._makeAbs(f)] = false if (this.strict) { this.emit('error', er) // If the error is handled, then we abort // if not, we threw out of here this.abort() } if (!this.silent) console.error('glob error', er) break } return cb() } Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { var self = this this._readdir(abs, inGlobStar, function (er, entries) { self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) }) } Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { //console.error('pgs2', prefix, remain[0], entries) // no entries means not a dir, so it can never have matches // foo.txt/** doesn't match foo.txt if (!entries) return cb() // test without the globstar, and with every child both below // and replacing the globstar. var remainWithoutGlobStar = remain.slice(1) var gspref = prefix ? [ prefix ] : [] var noGlobStar = gspref.concat(remainWithoutGlobStar) // the noGlobStar pattern exits the inGlobStar state this._process(noGlobStar, index, false, cb) var isSym = this.symlinks[abs] var len = entries.length // If it's a symlink, and we're in a globstar, then stop if (isSym && inGlobStar) return cb() for (var i = 0; i < len; i++) { var e = entries[i] if (e.charAt(0) === '.' && !this.dot) continue // these two cases enter the inGlobStar state var instead = gspref.concat(entries[i], remainWithoutGlobStar) this._process(instead, index, true, cb) var below = gspref.concat(entries[i], remain) this._process(below, index, true, cb) } cb() } Glob.prototype._processSimple = function (prefix, index, cb) { // XXX review this. Shouldn't it be doing the mounting etc // before doing stat? kinda weird? var self = this this._stat(prefix, function (er, exists) { self._processSimple2(prefix, index, er, exists, cb) }) } Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { //console.error('ps2', prefix, exists) if (!this.matches[index]) this.matches[index] = Object.create(null) // If it doesn't exist, then just mark the lack of results if (!exists) return cb() if (prefix && isAbsolute(prefix) && !this.nomount) { var trail = /[\/\\]$/.test(prefix) if (prefix.charAt(0) === '/') { prefix = path.join(this.root, prefix) } else { prefix = path.resolve(this.root, prefix) if (trail) prefix += '/' } } if (process.platform === 'win32') prefix = prefix.replace(/\\/g, '/') // Mark this as a match this._emitMatch(index, prefix) cb() } // Returns either 'DIR', 'FILE', or false Glob.prototype._stat = function (f, cb) { var abs = this._makeAbs(f) var needDir = f.slice(-1) === '/' if (f.length > this.maxLength) return cb() if (!this.stat && ownProp(this.cache, abs)) { var c = this.cache[abs] if (Array.isArray(c)) c = 'DIR' // It exists, but maybe not how we need it if (!needDir || c === 'DIR') return cb(null, c) if (needDir && c === 'FILE') return cb() // otherwise we have to stat, because maybe c=true // if we know it exists, but not what it is. } var exists var stat = this.statCache[abs] if (stat !== undefined) { if (stat === false) return cb(null, stat) else { var type = stat.isDirectory() ? 'DIR' : 'FILE' if (needDir && type === 'FILE') return cb() else return cb(null, type, stat) } } var self = this var statcb = inflight('stat\0' + abs, lstatcb_) if (statcb) fs.lstat(abs, statcb) function lstatcb_ (er, lstat) { if (lstat && lstat.isSymbolicLink()) { // If it's a symlink, then treat it as the target, unless // the target does not exist, then treat it as a file. return fs.stat(abs, function (er, stat) { if (er) self._stat2(f, abs, null, lstat, cb) else self._stat2(f, abs, er, stat, cb) }) } else { self._stat2(f, abs, er, lstat, cb) } } } Glob.prototype._stat2 = function (f, abs, er, stat, cb) { if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { this.statCache[abs] = false return cb() } var needDir = f.slice(-1) === '/' this.statCache[abs] = stat if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) return cb(null, false, stat) var c = true if (stat) c = stat.isDirectory() ? 'DIR' : 'FILE' this.cache[abs] = this.cache[abs] || c if (needDir && c === 'FILE') return cb() return cb(null, c, stat) } The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ## Glob Logo Glob's logo created by Tanya Brassie , licensed under a Creative Commons Attribution-ShareAlike 4.0 International License https://creativecommons.org/licenses/by-sa/4.0/ { "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "name": "glob", "description": "a little globber", "version": "7.1.6", "repository": { "type": "git", "url": "git://github.com/isaacs/node-glob.git" }, "main": "glob.js", "files": [ "glob.js", "sync.js", "common.js" ], "engines": { "node": "*" }, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, "devDependencies": { "mkdirp": "0", "rimraf": "^2.2.8", "tap": "^12.0.1", "tick": "0.0.6" }, "scripts": { "prepublish": "npm run benchclean", "profclean": "rm -f v8.log profile.txt", "test": "tap test/*.js --cov", "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js", "bench": "bash benchmark.sh", "prof": "bash prof.sh && cat profile.txt", "benchclean": "node benchclean.js" }, "license": "ISC", "funding": { "url": "https://github.com/sponsors/isaacs" } } module.exports = globSync globSync.GlobSync = GlobSync var fs = require('fs') var rp = require('fs.realpath') var minimatch = require('minimatch') var Minimatch = minimatch.Minimatch var Glob = require('./glob.js').Glob var util = require('util') var path = require('path') var assert = require('assert') var isAbsolute = require('path-is-absolute') var common = require('./common.js') var alphasort = common.alphasort var alphasorti = common.alphasorti var setopts = common.setopts var ownProp = common.ownProp var childrenIgnored = common.childrenIgnored var isIgnored = common.isIgnored function globSync (pattern, options) { if (typeof options === 'function' || arguments.length === 3) throw new TypeError('callback provided to sync glob\n'+ 'See: https://github.com/isaacs/node-glob/issues/167') return new GlobSync(pattern, options).found } function GlobSync (pattern, options) { if (!pattern) throw new Error('must provide pattern') if (typeof options === 'function' || arguments.length === 3) throw new TypeError('callback provided to sync glob\n'+ 'See: https://github.com/isaacs/node-glob/issues/167') if (!(this instanceof GlobSync)) return new GlobSync(pattern, options) setopts(this, pattern, options) if (this.noprocess) return this var n = this.minimatch.set.length this.matches = new Array(n) for (var i = 0; i < n; i ++) { this._process(this.minimatch.set[i], i, false) } this._finish() } GlobSync.prototype._finish = function () { assert(this instanceof GlobSync) if (this.realpath) { var self = this this.matches.forEach(function (matchset, index) { var set = self.matches[index] = Object.create(null) for (var p in matchset) { try { p = self._makeAbs(p) var real = rp.realpathSync(p, self.realpathCache) set[real] = true } catch (er) { if (er.syscall === 'stat') set[self._makeAbs(p)] = true else throw er } } }) } common.finish(this) } GlobSync.prototype._process = function (pattern, index, inGlobStar) { assert(this instanceof GlobSync) // Get the first [n] parts of pattern that are all strings. var n = 0 while (typeof pattern[n] === 'string') { n ++ } // now n is the index of the first one that is *not* a string. // See if there's anything else var prefix switch (n) { // if not, then this is rather simple case pattern.length: this._processSimple(pattern.join('/'), index) return case 0: // pattern *starts* with some non-trivial item. // going to readdir(cwd), but not include the prefix in matches. prefix = null break default: // pattern has some string bits in the front. // whatever it starts with, whether that's 'absolute' like /foo/bar, // or 'relative' like '../baz' prefix = pattern.slice(0, n).join('/') break } var remain = pattern.slice(n) // get the list of entries. var read if (prefix === null) read = '.' else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { if (!prefix || !isAbsolute(prefix)) prefix = '/' + prefix read = prefix } else read = prefix var abs = this._makeAbs(read) //if ignored, skip processing if (childrenIgnored(this, read)) return var isGlobStar = remain[0] === minimatch.GLOBSTAR if (isGlobStar) this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) else this._processReaddir(prefix, read, abs, remain, index, inGlobStar) } GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { var entries = this._readdir(abs, inGlobStar) // if the abs isn't a dir, then nothing can match! if (!entries) return // It will only match dot entries if it starts with a dot, or if // dot is set. Stuff like @(.foo|.bar) isn't allowed. var pn = remain[0] var negate = !!this.minimatch.negate var rawGlob = pn._glob var dotOk = this.dot || rawGlob.charAt(0) === '.' var matchedEntries = [] for (var i = 0; i < entries.length; i++) { var e = entries[i] if (e.charAt(0) !== '.' || dotOk) { var m if (negate && !prefix) { m = !e.match(pn) } else { m = e.match(pn) } if (m) matchedEntries.push(e) } } var len = matchedEntries.length // If there are no matched entries, then nothing matches. if (len === 0) return // if this is the last remaining pattern bit, then no need for // an additional stat *unless* the user has specified mark or // stat explicitly. We know they exist, since readdir returned // them. if (remain.length === 1 && !this.mark && !this.stat) { if (!this.matches[index]) this.matches[index] = Object.create(null) for (var i = 0; i < len; i ++) { var e = matchedEntries[i] if (prefix) { if (prefix.slice(-1) !== '/') e = prefix + '/' + e else e = prefix + e } if (e.charAt(0) === '/' && !this.nomount) { e = path.join(this.root, e) } this._emitMatch(index, e) } // This was the last one, and no stats were needed return } // now test all matched entries as stand-ins for that part // of the pattern. remain.shift() for (var i = 0; i < len; i ++) { var e = matchedEntries[i] var newPattern if (prefix) newPattern = [prefix, e] else newPattern = [e] this._process(newPattern.concat(remain), index, inGlobStar) } } GlobSync.prototype._emitMatch = function (index, e) { if (isIgnored(this, e)) return var abs = this._makeAbs(e) if (this.mark) e = this._mark(e) if (this.absolute) { e = abs } if (this.matches[index][e]) return if (this.nodir) { var c = this.cache[abs] if (c === 'DIR' || Array.isArray(c)) return } this.matches[index][e] = true if (this.stat) this._stat(e) } GlobSync.prototype._readdirInGlobStar = function (abs) { // follow all symlinked directories forever // just proceed as if this is a non-globstar situation if (this.follow) return this._readdir(abs, false) var entries var lstat var stat try { lstat = fs.lstatSync(abs) } catch (er) { if (er.code === 'ENOENT') { // lstat failed, doesn't exist return null } } var isSym = lstat && lstat.isSymbolicLink() this.symlinks[abs] = isSym // If it's not a symlink or a dir, then it's definitely a regular file. // don't bother doing a readdir in that case. if (!isSym && lstat && !lstat.isDirectory()) this.cache[abs] = 'FILE' else entries = this._readdir(abs, false) return entries } GlobSync.prototype._readdir = function (abs, inGlobStar) { var entries if (inGlobStar && !ownProp(this.symlinks, abs)) return this._readdirInGlobStar(abs) if (ownProp(this.cache, abs)) { var c = this.cache[abs] if (!c || c === 'FILE') return null if (Array.isArray(c)) return c } try { return this._readdirEntries(abs, fs.readdirSync(abs)) } catch (er) { this._readdirError(abs, er) return null } } GlobSync.prototype._readdirEntries = function (abs, entries) { // if we haven't asked to stat everything, then just // assume that everything in there exists, so we can avoid // having to stat it a second time. if (!this.mark && !this.stat) { for (var i = 0; i < entries.length; i ++) { var e = entries[i] if (abs === '/') e = abs + e else e = abs + '/' + e this.cache[e] = true } } this.cache[abs] = entries // mark and cache dir-ness return entries } GlobSync.prototype._readdirError = function (f, er) { // handle errors, and cache the information switch (er.code) { case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 case 'ENOTDIR': // totally normal. means it *does* exist. var abs = this._makeAbs(f) this.cache[abs] = 'FILE' if (abs === this.cwdAbs) { var error = new Error(er.code + ' invalid cwd ' + this.cwd) error.path = this.cwd error.code = er.code throw error } break case 'ENOENT': // not terribly unusual case 'ELOOP': case 'ENAMETOOLONG': case 'UNKNOWN': this.cache[this._makeAbs(f)] = false break default: // some unusual error. Treat as failure. this.cache[this._makeAbs(f)] = false if (this.strict) throw er if (!this.silent) console.error('glob error', er) break } } GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { var entries = this._readdir(abs, inGlobStar) // no entries means not a dir, so it can never have matches // foo.txt/** doesn't match foo.txt if (!entries) return // test without the globstar, and with every child both below // and replacing the globstar. var remainWithoutGlobStar = remain.slice(1) var gspref = prefix ? [ prefix ] : [] var noGlobStar = gspref.concat(remainWithoutGlobStar) // the noGlobStar pattern exits the inGlobStar state this._process(noGlobStar, index, false) var len = entries.length var isSym = this.symlinks[abs] // If it's a symlink, and we're in a globstar, then stop if (isSym && inGlobStar) return for (var i = 0; i < len; i++) { var e = entries[i] if (e.charAt(0) === '.' && !this.dot) continue // these two cases enter the inGlobStar state var instead = gspref.concat(entries[i], remainWithoutGlobStar) this._process(instead, index, true) var below = gspref.concat(entries[i], remain) this._process(below, index, true) } } GlobSync.prototype._processSimple = function (prefix, index) { // XXX review this. Shouldn't it be doing the mounting etc // before doing stat? kinda weird? var exists = this._stat(prefix) if (!this.matches[index]) this.matches[index] = Object.create(null) // If it doesn't exist, then just mark the lack of results if (!exists) return if (prefix && isAbsolute(prefix) && !this.nomount) { var trail = /[\/\\]$/.test(prefix) if (prefix.charAt(0) === '/') { prefix = path.join(this.root, prefix) } else { prefix = path.resolve(this.root, prefix) if (trail) prefix += '/' } } if (process.platform === 'win32') prefix = prefix.replace(/\\/g, '/') // Mark this as a match this._emitMatch(index, prefix) } // Returns either 'DIR', 'FILE', or false GlobSync.prototype._stat = function (f) { var abs = this._makeAbs(f) var needDir = f.slice(-1) === '/' if (f.length > this.maxLength) return false if (!this.stat && ownProp(this.cache, abs)) { var c = this.cache[abs] if (Array.isArray(c)) c = 'DIR' // It exists, but maybe not how we need it if (!needDir || c === 'DIR') return c if (needDir && c === 'FILE') return false // otherwise we have to stat, because maybe c=true // if we know it exists, but not what it is. } var exists var stat = this.statCache[abs] if (!stat) { var lstat try { lstat = fs.lstatSync(abs) } catch (er) { if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { this.statCache[abs] = false return false } } if (lstat && lstat.isSymbolicLink()) { try { stat = fs.statSync(abs) } catch (er) { stat = lstat } } else { stat = lstat } } this.statCache[abs] = stat var c = true if (stat) c = stat.isDirectory() ? 'DIR' : 'FILE' this.cache[abs] = this.cache[abs] || c if (needDir && c === 'FILE') return false return c } GlobSync.prototype._mark = function (p) { return common.mark(this, p) } GlobSync.prototype._makeAbs = function (f) { return common.makeAbs(this, f) } 'use strict' // high-level commands exports.c = exports.create = require('./lib/create.js') exports.r = exports.replace = require('./lib/replace.js') exports.t = exports.list = require('./lib/list.js') exports.u = exports.update = require('./lib/update.js') exports.x = exports.extract = require('./lib/extract.js') // classes exports.Pack = require('./lib/pack.js') exports.Unpack = require('./lib/unpack.js') exports.Parse = require('./lib/parse.js') exports.ReadEntry = require('./lib/read-entry.js') exports.WriteEntry = require('./lib/write-entry.js') exports.Header = require('./lib/header.js') exports.Pax = require('./lib/pax.js') exports.types = require('./lib/types.js') The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "name": "tar", "description": "tar for node", "version": "6.0.5", "repository": { "type": "git", "url": "https://github.com/npm/node-tar.git" }, "scripts": { "test": "tap", "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", "genparse": "node scripts/generate-parse-fixtures.js", "bench": "for i in benchmarks/*/*.js; do echo $i; for j in {1..5}; do node $i || break; done; done" }, "dependencies": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", "minipass": "^3.0.0", "minizlib": "^2.1.1", "mkdirp": "^1.0.3", "yallist": "^4.0.0" }, "devDependencies": { "chmodr": "^1.2.0", "end-of-stream": "^1.4.3", "events-to-array": "^1.1.2", "mutate-fs": "^2.1.1", "rimraf": "^2.7.1", "tap": "^14.9.2", "tar-fs": "^1.16.3", "tar-stream": "^1.6.2" }, "license": "ISC", "engines": { "node": ">= 10" }, "files": [ "index.js", "lib/*.js" ], "tap": { "coverage-map": "map.js", "check-coverage": true } } #!/usr/bin/env node const rimraf = require('./') const path = require('path') const isRoot = arg => /^(\/|[a-zA-Z]:\\)$/.test(path.resolve(arg)) const filterOutRoot = arg => { const ok = preserveRoot === false || !isRoot(arg) if (!ok) { console.error(`refusing to remove ${arg}`) console.error('Set --no-preserve-root to allow this') } return ok } let help = false let dashdash = false let noglob = false let preserveRoot = true const args = process.argv.slice(2).filter(arg => { if (dashdash) return !!arg else if (arg === '--') dashdash = true else if (arg === '--no-glob' || arg === '-G') noglob = true else if (arg === '--glob' || arg === '-g') noglob = false else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) help = true else if (arg === '--preserve-root') preserveRoot = true else if (arg === '--no-preserve-root') preserveRoot = false else return !!arg }).filter(arg => !preserveRoot || filterOutRoot(arg)) const go = n => { if (n >= args.length) return const options = noglob ? { glob: false } : {} rimraf(args[n], options, er => { if (er) throw er go(n+1) }) } if (help || args.length === 0) { // If they didn't ask for help, then this is not a "success" const log = help ? console.log : console.error log('Usage: rimraf [ ...]') log('') log(' Deletes all files and folders at "path" recursively.') log('') log('Options:') log('') log(' -h, --help Display this usage info') log(' -G, --no-glob Do not expand glob patterns in arguments') log(' -g, --glob Expand glob patterns in arguments (default)') log(' --preserve-root Do not remove \'/\' (default)') log(' --no-preserve-root Do not treat \'/\' specially') log(' -- Stop parsing flags') process.exit(help ? 0 : 1) } else go(0) The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "rimraf", "version": "3.0.2", "main": "rimraf.js", "description": "A deep deletion module for node (like `rm -rf`)", "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "license": "ISC", "repository": "git://github.com/isaacs/rimraf.git", "scripts": { "preversion": "npm test", "postversion": "npm publish", "postpublish": "git push origin --follow-tags", "test": "tap test/*.js" }, "bin": "./bin.js", "dependencies": { "glob": "^7.1.3" }, "files": [ "LICENSE", "README.md", "bin.js", "rimraf.js" ], "devDependencies": { "mkdirp": "^0.5.1", "tap": "^12.1.1" }, "funding": { "url": "https://github.com/sponsors/isaacs" } } const assert = require("assert") const path = require("path") const fs = require("fs") let glob = undefined try { glob = require("glob") } catch (_err) { // treat glob as optional. } const defaultGlobOpts = { nosort: true, silent: true } // for EMFILE handling let timeout = 0 const isWindows = (process.platform === "win32") const defaults = options => { const methods = [ 'unlink', 'chmod', 'stat', 'lstat', 'rmdir', 'readdir' ] methods.forEach(m => { options[m] = options[m] || fs[m] m = m + 'Sync' options[m] = options[m] || fs[m] }) options.maxBusyTries = options.maxBusyTries || 3 options.emfileWait = options.emfileWait || 1000 if (options.glob === false) { options.disableGlob = true } if (options.disableGlob !== true && glob === undefined) { throw Error('glob dependency not found, set `options.disableGlob = true` if intentional') } options.disableGlob = options.disableGlob || false options.glob = options.glob || defaultGlobOpts } const rimraf = (p, options, cb) => { if (typeof options === 'function') { cb = options options = {} } assert(p, 'rimraf: missing path') assert.equal(typeof p, 'string', 'rimraf: path should be a string') assert.equal(typeof cb, 'function', 'rimraf: callback function required') assert(options, 'rimraf: invalid options argument provided') assert.equal(typeof options, 'object', 'rimraf: options should be object') defaults(options) let busyTries = 0 let errState = null let n = 0 const next = (er) => { errState = errState || er if (--n === 0) cb(errState) } const afterGlob = (er, results) => { if (er) return cb(er) n = results.length if (n === 0) return cb() results.forEach(p => { const CB = (er) => { if (er) { if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") && busyTries < options.maxBusyTries) { busyTries ++ // try again, with the same exact callback as this one. return setTimeout(() => rimraf_(p, options, CB), busyTries * 100) } // this one won't happen if graceful-fs is used. if (er.code === "EMFILE" && timeout < options.emfileWait) { return setTimeout(() => rimraf_(p, options, CB), timeout ++) } // already gone if (er.code === "ENOENT") er = null } timeout = 0 next(er) } rimraf_(p, options, CB) }) } if (options.disableGlob || !glob.hasMagic(p)) return afterGlob(null, [p]) options.lstat(p, (er, stat) => { if (!er) return afterGlob(null, [p]) glob(p, options.glob, afterGlob) }) } // Two possible strategies. // 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR // 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR // // Both result in an extra syscall when you guess wrong. However, there // are likely far more normal files in the world than directories. This // is based on the assumption that a the average number of files per // directory is >= 1. // // If anyone ever complains about this, then I guess the strategy could // be made configurable somehow. But until then, YAGNI. const rimraf_ = (p, options, cb) => { assert(p) assert(options) assert(typeof cb === 'function') // sunos lets the root user unlink directories, which is... weird. // so we have to lstat here and make sure it's not a dir. options.lstat(p, (er, st) => { if (er && er.code === "ENOENT") return cb(null) // Windows can EPERM on stat. Life is suffering. if (er && er.code === "EPERM" && isWindows) fixWinEPERM(p, options, er, cb) if (st && st.isDirectory()) return rmdir(p, options, er, cb) options.unlink(p, er => { if (er) { if (er.code === "ENOENT") return cb(null) if (er.code === "EPERM") return (isWindows) ? fixWinEPERM(p, options, er, cb) : rmdir(p, options, er, cb) if (er.code === "EISDIR") return rmdir(p, options, er, cb) } return cb(er) }) }) } const fixWinEPERM = (p, options, er, cb) => { assert(p) assert(options) assert(typeof cb === 'function') options.chmod(p, 0o666, er2 => { if (er2) cb(er2.code === "ENOENT" ? null : er) else options.stat(p, (er3, stats) => { if (er3) cb(er3.code === "ENOENT" ? null : er) else if (stats.isDirectory()) rmdir(p, options, er, cb) else options.unlink(p, cb) }) }) } const fixWinEPERMSync = (p, options, er) => { assert(p) assert(options) try { options.chmodSync(p, 0o666) } catch (er2) { if (er2.code === "ENOENT") return else throw er } let stats try { stats = options.statSync(p) } catch (er3) { if (er3.code === "ENOENT") return else throw er } if (stats.isDirectory()) rmdirSync(p, options, er) else options.unlinkSync(p) } const rmdir = (p, options, originalEr, cb) => { assert(p) assert(options) assert(typeof cb === 'function') // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) // if we guessed wrong, and it's not a directory, then // raise the original error. options.rmdir(p, er => { if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) rmkids(p, options, cb) else if (er && er.code === "ENOTDIR") cb(originalEr) else cb(er) }) } const rmkids = (p, options, cb) => { assert(p) assert(options) assert(typeof cb === 'function') options.readdir(p, (er, files) => { if (er) return cb(er) let n = files.length if (n === 0) return options.rmdir(p, cb) let errState files.forEach(f => { rimraf(path.join(p, f), options, er => { if (errState) return if (er) return cb(errState = er) if (--n === 0) options.rmdir(p, cb) }) }) }) } // this looks simpler, and is strictly *faster*, but will // tie up the JavaScript thread and fail on excessively // deep directory trees. const rimrafSync = (p, options) => { options = options || {} defaults(options) assert(p, 'rimraf: missing path') assert.equal(typeof p, 'string', 'rimraf: path should be a string') assert(options, 'rimraf: missing options') assert.equal(typeof options, 'object', 'rimraf: options should be object') let results if (options.disableGlob || !glob.hasMagic(p)) { results = [p] } else { try { options.lstatSync(p) results = [p] } catch (er) { results = glob.sync(p, options.glob) } } if (!results.length) return for (let i = 0; i < results.length; i++) { const p = results[i] let st try { st = options.lstatSync(p) } catch (er) { if (er.code === "ENOENT") return // Windows can EPERM on stat. Life is suffering. if (er.code === "EPERM" && isWindows) fixWinEPERMSync(p, options, er) } try { // sunos lets the root user unlink directories, which is... weird. if (st && st.isDirectory()) rmdirSync(p, options, null) else options.unlinkSync(p) } catch (er) { if (er.code === "ENOENT") return if (er.code === "EPERM") return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) if (er.code !== "EISDIR") throw er rmdirSync(p, options, er) } } } const rmdirSync = (p, options, originalEr) => { assert(p) assert(options) try { options.rmdirSync(p) } catch (er) { if (er.code === "ENOENT") return if (er.code === "ENOTDIR") throw originalEr if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") rmkidsSync(p, options) } } const rmkidsSync = (p, options) => { assert(p) assert(options) options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)) // We only end up here once we got ENOTEMPTY at least once, and // at this point, we are guaranteed to have removed all the kids. // So, we know that it won't be ENOENT or ENOTDIR or anything else. // try really hard to delete stuff on windows, because it has a // PROFOUNDLY annoying habit of not closing handles promptly when // files are deleted, resulting in spurious ENOTEMPTY errors. const retries = isWindows ? 100 : 1 let i = 0 do { let threw = true try { const ret = options.rmdirSync(p, options) threw = false return ret } finally { if (++i < retries && threw) continue } } while (true) } module.exports = rimraf rimraf.sync = rimrafSync 'use strict' // tar -c const hlo = require('./high-level-opt.js') const Pack = require('./pack.js') const fs = require('fs') const fsm = require('fs-minipass') const t = require('./list.js') const path = require('path') const c = module.exports = (opt_, files, cb) => { if (typeof files === 'function') cb = files if (Array.isArray(opt_)) files = opt_, opt_ = {} if (!files || !Array.isArray(files) || !files.length) throw new TypeError('no files or directories specified') files = Array.from(files) const opt = hlo(opt_) if (opt.sync && typeof cb === 'function') throw new TypeError('callback not supported for sync tar functions') if (!opt.file && typeof cb === 'function') throw new TypeError('callback only supported with file option') return opt.file && opt.sync ? createFileSync(opt, files) : opt.file ? createFile(opt, files, cb) : opt.sync ? createSync(opt, files) : create(opt, files) } const createFileSync = (opt, files) => { const p = new Pack.Sync(opt) const stream = new fsm.WriteStreamSync(opt.file, { mode: opt.mode || 0o666 }) p.pipe(stream) addFilesSync(p, files) } const createFile = (opt, files, cb) => { const p = new Pack(opt) const stream = new fsm.WriteStream(opt.file, { mode: opt.mode || 0o666 }) p.pipe(stream) const promise = new Promise((res, rej) => { stream.on('error', rej) stream.on('close', res) p.on('error', rej) }) addFilesAsync(p, files) return cb ? promise.then(cb, cb) : promise } const addFilesSync = (p, files) => { files.forEach(file => { if (file.charAt(0) === '@') t({ file: path.resolve(p.cwd, file.substr(1)), sync: true, noResume: true, onentry: entry => p.add(entry) }) else p.add(file) }) p.end() } const addFilesAsync = (p, files) => { while (files.length) { const file = files.shift() if (file.charAt(0) === '@') return t({ file: path.resolve(p.cwd, file.substr(1)), noResume: true, onentry: entry => p.add(entry) }).then(_ => addFilesAsync(p, files)) else p.add(file) } p.end() } const createSync = (opt, files) => { const p = new Pack.Sync(opt) addFilesSync(p, files) return p } const create = (opt, files) => { const p = new Pack(opt) addFilesAsync(p, files) return p } 'use strict' // tar -x const hlo = require('./high-level-opt.js') const Unpack = require('./unpack.js') const fs = require('fs') const fsm = require('fs-minipass') const path = require('path') const x = module.exports = (opt_, files, cb) => { if (typeof opt_ === 'function') cb = opt_, files = null, opt_ = {} else if (Array.isArray(opt_)) files = opt_, opt_ = {} if (typeof files === 'function') cb = files, files = null if (!files) files = [] else files = Array.from(files) const opt = hlo(opt_) if (opt.sync && typeof cb === 'function') throw new TypeError('callback not supported for sync tar functions') if (!opt.file && typeof cb === 'function') throw new TypeError('callback only supported with file option') if (files.length) filesFilter(opt, files) return opt.file && opt.sync ? extractFileSync(opt) : opt.file ? extractFile(opt, cb) : opt.sync ? extractSync(opt) : extract(opt) } // construct a filter that limits the file entries listed // include child entries if a dir is included const filesFilter = (opt, files) => { const map = new Map(files.map(f => [f.replace(/\/+$/, ''), true])) const filter = opt.filter const mapHas = (file, r) => { const root = r || path.parse(file).root || '.' const ret = file === root ? false : map.has(file) ? map.get(file) : mapHas(path.dirname(file), root) map.set(file, ret) return ret } opt.filter = filter ? (file, entry) => filter(file, entry) && mapHas(file.replace(/\/+$/, '')) : file => mapHas(file.replace(/\/+$/, '')) } const extractFileSync = opt => { const u = new Unpack.Sync(opt) const file = opt.file let threw = true let fd const stat = fs.statSync(file) // This trades a zero-byte read() syscall for a stat // However, it will usually result in less memory allocation const readSize = opt.maxReadSize || 16*1024*1024 const stream = new fsm.ReadStreamSync(file, { readSize: readSize, size: stat.size }) stream.pipe(u) } const extractFile = (opt, cb) => { const u = new Unpack(opt) const readSize = opt.maxReadSize || 16*1024*1024 const file = opt.file const p = new Promise((resolve, reject) => { u.on('error', reject) u.on('close', resolve) // This trades a zero-byte read() syscall for a stat // However, it will usually result in less memory allocation fs.stat(file, (er, stat) => { if (er) reject(er) else { const stream = new fsm.ReadStream(file, { readSize: readSize, size: stat.size }) stream.on('error', reject) stream.pipe(u) } }) }) return cb ? p.then(cb, cb) : p } const extractSync = opt => { return new Unpack.Sync(opt) } const extract = opt => { return new Unpack(opt) } // Get the appropriate flag to use for creating files // We use fmap on Windows platforms for files less than // 512kb. This is a fairly low limit, but avoids making // things slower in some cases. Since most of what this // library is used for is extracting tarballs of many // relatively small files in npm packages and the like, // it can be a big boost on Windows platforms. // Only supported in Node v12.9.0 and above. const platform = process.env.__FAKE_PLATFORM__ || process.platform const isWindows = platform === 'win32' const fs = global.__FAKE_TESTING_FS__ || require('fs') /* istanbul ignore next */ const { O_CREAT, O_TRUNC, O_WRONLY, UV_FS_O_FILEMAP = 0 } = fs.constants const fMapEnabled = isWindows && !!UV_FS_O_FILEMAP const fMapLimit = 512 * 1024 const fMapFlag = UV_FS_O_FILEMAP | O_TRUNC | O_CREAT | O_WRONLY module.exports = !fMapEnabled ? () => 'w' : size => size < fMapLimit ? fMapFlag : 'w' 'use strict' // parse a 512-byte header block to a data object, or vice-versa // encode returns `true` if a pax extended header is needed, because // the data could not be faithfully encoded in a simple header. // (Also, check header.needPax to see if it needs a pax header.) const types = require('./types.js') const pathModule = require('path').posix const large = require('./large-numbers.js') const SLURP = Symbol('slurp') const TYPE = Symbol('type') class Header { constructor (data, off, ex, gex) { this.cksumValid = false this.needPax = false this.nullBlock = false this.block = null this.path = null this.mode = null this.uid = null this.gid = null this.size = null this.mtime = null this.cksum = null this[TYPE] = '0' this.linkpath = null this.uname = null this.gname = null this.devmaj = 0 this.devmin = 0 this.atime = null this.ctime = null if (Buffer.isBuffer(data)) this.decode(data, off || 0, ex, gex) else if (data) this.set(data) } decode (buf, off, ex, gex) { if (!off) off = 0 if (!buf || !(buf.length >= off + 512)) throw new Error('need 512 bytes for header') this.path = decString(buf, off, 100) this.mode = decNumber(buf, off + 100, 8) this.uid = decNumber(buf, off + 108, 8) this.gid = decNumber(buf, off + 116, 8) this.size = decNumber(buf, off + 124, 12) this.mtime = decDate(buf, off + 136, 12) this.cksum = decNumber(buf, off + 148, 12) // if we have extended or global extended headers, apply them now // See https://github.com/npm/node-tar/pull/187 this[SLURP](ex) this[SLURP](gex, true) // old tar versions marked dirs as a file with a trailing / this[TYPE] = decString(buf, off + 156, 1) if (this[TYPE] === '') this[TYPE] = '0' if (this[TYPE] === '0' && this.path.substr(-1) === '/') this[TYPE] = '5' // tar implementations sometimes incorrectly put the stat(dir).size // as the size in the tarball, even though Directory entries are // not able to have any body at all. In the very rare chance that // it actually DOES have a body, we weren't going to do anything with // it anyway, and it'll just be a warning about an invalid header. if (this[TYPE] === '5') this.size = 0 this.linkpath = decString(buf, off + 157, 100) if (buf.slice(off + 257, off + 265).toString() === 'ustar\u000000') { this.uname = decString(buf, off + 265, 32) this.gname = decString(buf, off + 297, 32) this.devmaj = decNumber(buf, off + 329, 8) this.devmin = decNumber(buf, off + 337, 8) if (buf[off + 475] !== 0) { // definitely a prefix, definitely >130 chars. const prefix = decString(buf, off + 345, 155) this.path = prefix + '/' + this.path } else { const prefix = decString(buf, off + 345, 130) if (prefix) this.path = prefix + '/' + this.path this.atime = decDate(buf, off + 476, 12) this.ctime = decDate(buf, off + 488, 12) } } let sum = 8 * 0x20 for (let i = off; i < off + 148; i++) { sum += buf[i] } for (let i = off + 156; i < off + 512; i++) { sum += buf[i] } this.cksumValid = sum === this.cksum if (this.cksum === null && sum === 8 * 0x20) this.nullBlock = true } [SLURP] (ex, global) { for (let k in ex) { // we slurp in everything except for the path attribute in // a global extended header, because that's weird. if (ex[k] !== null && ex[k] !== undefined && !(global && k === 'path')) this[k] = ex[k] } } encode (buf, off) { if (!buf) { buf = this.block = Buffer.alloc(512) off = 0 } if (!off) off = 0 if (!(buf.length >= off + 512)) throw new Error('need 512 bytes for header') const prefixSize = this.ctime || this.atime ? 130 : 155 const split = splitPrefix(this.path || '', prefixSize) const path = split[0] const prefix = split[1] this.needPax = split[2] this.needPax = encString(buf, off, 100, path) || this.needPax this.needPax = encNumber(buf, off + 100, 8, this.mode) || this.needPax this.needPax = encNumber(buf, off + 108, 8, this.uid) || this.needPax this.needPax = encNumber(buf, off + 116, 8, this.gid) || this.needPax this.needPax = encNumber(buf, off + 124, 12, this.size) || this.needPax this.needPax = encDate(buf, off + 136, 12, this.mtime) || this.needPax buf[off + 156] = this[TYPE].charCodeAt(0) this.needPax = encString(buf, off + 157, 100, this.linkpath) || this.needPax buf.write('ustar\u000000', off + 257, 8) this.needPax = encString(buf, off + 265, 32, this.uname) || this.needPax this.needPax = encString(buf, off + 297, 32, this.gname) || this.needPax this.needPax = encNumber(buf, off + 329, 8, this.devmaj) || this.needPax this.needPax = encNumber(buf, off + 337, 8, this.devmin) || this.needPax this.needPax = encString(buf, off + 345, prefixSize, prefix) || this.needPax if (buf[off + 475] !== 0) this.needPax = encString(buf, off + 345, 155, prefix) || this.needPax else { this.needPax = encString(buf, off + 345, 130, prefix) || this.needPax this.needPax = encDate(buf, off + 476, 12, this.atime) || this.needPax this.needPax = encDate(buf, off + 488, 12, this.ctime) || this.needPax } let sum = 8 * 0x20 for (let i = off; i < off + 148; i++) { sum += buf[i] } for (let i = off + 156; i < off + 512; i++) { sum += buf[i] } this.cksum = sum encNumber(buf, off + 148, 8, this.cksum) this.cksumValid = true return this.needPax } set (data) { for (let i in data) { if (data[i] !== null && data[i] !== undefined) this[i] = data[i] } } get type () { return types.name.get(this[TYPE]) || this[TYPE] } get typeKey () { return this[TYPE] } set type (type) { if (types.code.has(type)) this[TYPE] = types.code.get(type) else this[TYPE] = type } } const splitPrefix = (p, prefixSize) => { const pathSize = 100 let pp = p let prefix = '' let ret const root = pathModule.parse(p).root || '.' if (Buffer.byteLength(pp) < pathSize) ret = [pp, prefix, false] else { // first set prefix to the dir, and path to the base prefix = pathModule.dirname(pp) pp = pathModule.basename(pp) do { // both fit! if (Buffer.byteLength(pp) <= pathSize && Buffer.byteLength(prefix) <= prefixSize) ret = [pp, prefix, false] // prefix fits in prefix, but path doesn't fit in path else if (Buffer.byteLength(pp) > pathSize && Buffer.byteLength(prefix) <= prefixSize) ret = [pp.substr(0, pathSize - 1), prefix, true] else { // make path take a bit from prefix pp = pathModule.join(pathModule.basename(prefix), pp) prefix = pathModule.dirname(prefix) } } while (prefix !== root && !ret) // at this point, found no resolution, just truncate if (!ret) ret = [p.substr(0, pathSize - 1), '', true] } return ret } const decString = (buf, off, size) => buf.slice(off, off + size).toString('utf8').replace(/\0.*/, '') const decDate = (buf, off, size) => numToDate(decNumber(buf, off, size)) const numToDate = num => num === null ? null : new Date(num * 1000) const decNumber = (buf, off, size) => buf[off] & 0x80 ? large.parse(buf.slice(off, off + size)) : decSmallNumber(buf, off, size) const nanNull = value => isNaN(value) ? null : value const decSmallNumber = (buf, off, size) => nanNull(parseInt( buf.slice(off, off + size) .toString('utf8').replace(/\0.*$/, '').trim(), 8)) // the maximum encodable as a null-terminated octal, by field size const MAXNUM = { 12: 0o77777777777, 8 : 0o7777777 } const encNumber = (buf, off, size, number) => number === null ? false : number > MAXNUM[size] || number < 0 ? (large.encode(number, buf.slice(off, off + size)), true) : (encSmallNumber(buf, off, size, number), false) const encSmallNumber = (buf, off, size, number) => buf.write(octalString(number, size), off, size, 'ascii') const octalString = (number, size) => padOctal(Math.floor(number).toString(8), size) const padOctal = (string, size) => (string.length === size - 1 ? string : new Array(size - string.length - 1).join('0') + string + ' ') + '\0' const encDate = (buf, off, size, date) => date === null ? false : encNumber(buf, off, size, date.getTime() / 1000) // enough to fill the longest string we've got const NULLS = new Array(156).join('\0') // pad with nulls, return true if it's longer or non-ascii const encString = (buf, off, size, string) => string === null ? false : (buf.write(string + NULLS, off, size, 'utf8'), string.length !== Buffer.byteLength(string) || string.length > size) module.exports = Header 'use strict' // turn tar(1) style args like `C` into the more verbose things like `cwd` const argmap = new Map([ ['C', 'cwd'], ['f', 'file'], ['z', 'gzip'], ['P', 'preservePaths'], ['U', 'unlink'], ['strip-components', 'strip'], ['stripComponents', 'strip'], ['keep-newer', 'newer'], ['keepNewer', 'newer'], ['keep-newer-files', 'newer'], ['keepNewerFiles', 'newer'], ['k', 'keep'], ['keep-existing', 'keep'], ['keepExisting', 'keep'], ['m', 'noMtime'], ['no-mtime', 'noMtime'], ['p', 'preserveOwner'], ['L', 'follow'], ['h', 'follow'] ]) const parse = module.exports = opt => opt ? Object.keys(opt).map(k => [ argmap.has(k) ? argmap.get(k) : k, opt[k] ]).reduce((set, kv) => (set[kv[0]] = kv[1], set), Object.create(null)) : {} 'use strict' // Tar can encode large and negative numbers using a leading byte of // 0xff for negative, and 0x80 for positive. const encode = exports.encode = (num, buf) => { if (!Number.isSafeInteger(num)) // The number is so large that javascript cannot represent it with integer // precision. throw Error('cannot encode number outside of javascript safe integer range') else if (num < 0) encodeNegative(num, buf) else encodePositive(num, buf) return buf } const encodePositive = (num, buf) => { buf[0] = 0x80 for (var i = buf.length; i > 1; i--) { buf[i-1] = num & 0xff num = Math.floor(num / 0x100) } } const encodeNegative = (num, buf) => { buf[0] = 0xff var flipped = false num = num * -1 for (var i = buf.length; i > 1; i--) { var byte = num & 0xff num = Math.floor(num / 0x100) if (flipped) buf[i-1] = onesComp(byte) else if (byte === 0) buf[i-1] = 0 else { flipped = true buf[i-1] = twosComp(byte) } } } const parse = exports.parse = (buf) => { var post = buf[buf.length - 1] var pre = buf[0] var value; if (pre === 0x80) value = pos(buf.slice(1, buf.length)) else if (pre === 0xff) value = twos(buf) else throw Error('invalid base256 encoding') if (!Number.isSafeInteger(value)) // The number is so large that javascript cannot represent it with integer // precision. throw Error('parsed number outside of javascript safe integer range') return value } const twos = (buf) => { var len = buf.length var sum = 0 var flipped = false for (var i = len - 1; i > -1; i--) { var byte = buf[i] var f if (flipped) f = onesComp(byte) else if (byte === 0) f = byte else { flipped = true f = twosComp(byte) } if (f !== 0) sum -= f * Math.pow(256, len - i - 1) } return sum } const pos = (buf) => { var len = buf.length var sum = 0 for (var i = len - 1; i > -1; i--) { var byte = buf[i] if (byte !== 0) sum += byte * Math.pow(256, len - i - 1) } return sum } const onesComp = byte => (0xff ^ byte) & 0xff const twosComp = byte => ((0xff ^ byte) + 1) & 0xff 'use strict' // XXX: This shares a lot in common with extract.js // maybe some DRY opportunity here? // tar -t const hlo = require('./high-level-opt.js') const Parser = require('./parse.js') const fs = require('fs') const fsm = require('fs-minipass') const path = require('path') const t = module.exports = (opt_, files, cb) => { if (typeof opt_ === 'function') cb = opt_, files = null, opt_ = {} else if (Array.isArray(opt_)) files = opt_, opt_ = {} if (typeof files === 'function') cb = files, files = null if (!files) files = [] else files = Array.from(files) const opt = hlo(opt_) if (opt.sync && typeof cb === 'function') throw new TypeError('callback not supported for sync tar functions') if (!opt.file && typeof cb === 'function') throw new TypeError('callback only supported with file option') if (files.length) filesFilter(opt, files) if (!opt.noResume) onentryFunction(opt) return opt.file && opt.sync ? listFileSync(opt) : opt.file ? listFile(opt, cb) : list(opt) } const onentryFunction = opt => { const onentry = opt.onentry opt.onentry = onentry ? e => { onentry(e) e.resume() } : e => e.resume() } // construct a filter that limits the file entries listed // include child entries if a dir is included const filesFilter = (opt, files) => { const map = new Map(files.map(f => [f.replace(/\/+$/, ''), true])) const filter = opt.filter const mapHas = (file, r) => { const root = r || path.parse(file).root || '.' const ret = file === root ? false : map.has(file) ? map.get(file) : mapHas(path.dirname(file), root) map.set(file, ret) return ret } opt.filter = filter ? (file, entry) => filter(file, entry) && mapHas(file.replace(/\/+$/, '')) : file => mapHas(file.replace(/\/+$/, '')) } const listFileSync = opt => { const p = list(opt) const file = opt.file let threw = true let fd try { const stat = fs.statSync(file) const readSize = opt.maxReadSize || 16*1024*1024 if (stat.size < readSize) { p.end(fs.readFileSync(file)) } else { let pos = 0 const buf = Buffer.allocUnsafe(readSize) fd = fs.openSync(file, 'r') while (pos < stat.size) { let bytesRead = fs.readSync(fd, buf, 0, readSize, pos) pos += bytesRead p.write(buf.slice(0, bytesRead)) } p.end() } threw = false } finally { if (threw && fd) try { fs.closeSync(fd) } catch (er) {} } } const listFile = (opt, cb) => { const parse = new Parser(opt) const readSize = opt.maxReadSize || 16*1024*1024 const file = opt.file const p = new Promise((resolve, reject) => { parse.on('error', reject) parse.on('end', resolve) fs.stat(file, (er, stat) => { if (er) reject(er) else { const stream = new fsm.ReadStream(file, { readSize: readSize, size: stat.size }) stream.on('error', reject) stream.pipe(parse) } }) }) return cb ? p.then(cb, cb) : p } const list = opt => new Parser(opt) 'use strict' // wrapper around mkdirp for tar's needs. // TODO: This should probably be a class, not functionally // passing around state in a gazillion args. const mkdirp = require('mkdirp') const fs = require('fs') const path = require('path') const chownr = require('chownr') class SymlinkError extends Error { constructor (symlink, path) { super('Cannot extract through symbolic link') this.path = path this.symlink = symlink } get name () { return 'SylinkError' } } class CwdError extends Error { constructor (path, code) { super(code + ': Cannot cd into \'' + path + '\'') this.path = path this.code = code } get name () { return 'CwdError' } } const mkdir = module.exports = (dir, opt, cb) => { // if there's any overlap between mask and mode, // then we'll need an explicit chmod const umask = opt.umask const mode = opt.mode | 0o0700 const needChmod = (mode & umask) !== 0 const uid = opt.uid const gid = opt.gid const doChown = typeof uid === 'number' && typeof gid === 'number' && ( uid !== opt.processUid || gid !== opt.processGid ) const preserve = opt.preserve const unlink = opt.unlink const cache = opt.cache const cwd = opt.cwd const done = (er, created) => { if (er) cb(er) else { cache.set(dir, true) if (created && doChown) chownr(created, uid, gid, er => done(er)) else if (needChmod) fs.chmod(dir, mode, cb) else cb() } } if (cache && cache.get(dir) === true) return done() if (dir === cwd) return fs.stat(dir, (er, st) => { if (er || !st.isDirectory()) er = new CwdError(dir, er && er.code || 'ENOTDIR') done(er) }) if (preserve) return mkdirp(dir, {mode}).then(made => done(null, made), done) const sub = path.relative(cwd, dir) const parts = sub.split(/\/|\\/) mkdir_(cwd, parts, mode, cache, unlink, cwd, null, done) } const mkdir_ = (base, parts, mode, cache, unlink, cwd, created, cb) => { if (!parts.length) return cb(null, created) const p = parts.shift() const part = base + '/' + p if (cache.get(part)) return mkdir_(part, parts, mode, cache, unlink, cwd, created, cb) fs.mkdir(part, mode, onmkdir(part, parts, mode, cache, unlink, cwd, created, cb)) } const onmkdir = (part, parts, mode, cache, unlink, cwd, created, cb) => er => { if (er) { if (er.path && path.dirname(er.path) === cwd && (er.code === 'ENOTDIR' || er.code === 'ENOENT')) return cb(new CwdError(cwd, er.code)) fs.lstat(part, (statEr, st) => { if (statEr) cb(statEr) else if (st.isDirectory()) mkdir_(part, parts, mode, cache, unlink, cwd, created, cb) else if (unlink) fs.unlink(part, er => { if (er) return cb(er) fs.mkdir(part, mode, onmkdir(part, parts, mode, cache, unlink, cwd, created, cb)) }) else if (st.isSymbolicLink()) return cb(new SymlinkError(part, part + '/' + parts.join('/'))) else cb(er) }) } else { created = created || part mkdir_(part, parts, mode, cache, unlink, cwd, created, cb) } } const mkdirSync = module.exports.sync = (dir, opt) => { // if there's any overlap between mask and mode, // then we'll need an explicit chmod const umask = opt.umask const mode = opt.mode | 0o0700 const needChmod = (mode & umask) !== 0 const uid = opt.uid const gid = opt.gid const doChown = typeof uid === 'number' && typeof gid === 'number' && ( uid !== opt.processUid || gid !== opt.processGid ) const preserve = opt.preserve const unlink = opt.unlink const cache = opt.cache const cwd = opt.cwd const done = (created) => { cache.set(dir, true) if (created && doChown) chownr.sync(created, uid, gid) if (needChmod) fs.chmodSync(dir, mode) } if (cache && cache.get(dir) === true) return done() if (dir === cwd) { let ok = false let code = 'ENOTDIR' try { ok = fs.statSync(dir).isDirectory() } catch (er) { code = er.code } finally { if (!ok) throw new CwdError(dir, code) } done() return } if (preserve) return done(mkdirp.sync(dir, mode)) const sub = path.relative(cwd, dir) const parts = sub.split(/\/|\\/) let created = null for (let p = parts.shift(), part = cwd; p && (part += '/' + p); p = parts.shift()) { if (cache.get(part)) continue try { fs.mkdirSync(part, mode) created = created || part cache.set(part, true) } catch (er) { if (er.path && path.dirname(er.path) === cwd && (er.code === 'ENOTDIR' || er.code === 'ENOENT')) return new CwdError(cwd, er.code) const st = fs.lstatSync(part) if (st.isDirectory()) { cache.set(part, true) continue } else if (unlink) { fs.unlinkSync(part) fs.mkdirSync(part, mode) created = created || part cache.set(part, true) continue } else if (st.isSymbolicLink()) return new SymlinkError(part, part + '/' + parts.join('/')) } } return done(created) } 'use strict' module.exports = (mode, isDir, portable) => { mode &= 0o7777 // in portable mode, use the minimum reasonable umask // if this system creates files with 0o664 by default // (as some linux distros do), then we'll write the // archive with 0o644 instead. Also, don't ever create // a file that is not readable/writable by the owner. if (portable) { mode = (mode | 0o600) &~0o22 } // if dirs are readable, then they should be listable if (isDir) { if (mode & 0o400) mode |= 0o100 if (mode & 0o40) mode |= 0o10 if (mode & 0o4) mode |= 0o1 } return mode } 'use strict' // A readable tar stream creator // Technically, this is a transform stream that you write paths into, // and tar format comes out of. // The `add()` method is like `write()` but returns this, // and end() return `this` as well, so you can // do `new Pack(opt).add('files').add('dir').end().pipe(output) // You could also do something like: // streamOfPaths().pipe(new Pack()).pipe(new fs.WriteStream('out.tar')) class PackJob { constructor (path, absolute) { this.path = path || './' this.absolute = absolute this.entry = null this.stat = null this.readdir = null this.pending = false this.ignore = false this.piped = false } } const MiniPass = require('minipass') const zlib = require('minizlib') const ReadEntry = require('./read-entry.js') const WriteEntry = require('./write-entry.js') const WriteEntrySync = WriteEntry.Sync const WriteEntryTar = WriteEntry.Tar const Yallist = require('yallist') const EOF = Buffer.alloc(1024) const ONSTAT = Symbol('onStat') const ENDED = Symbol('ended') const QUEUE = Symbol('queue') const CURRENT = Symbol('current') const PROCESS = Symbol('process') const PROCESSING = Symbol('processing') const PROCESSJOB = Symbol('processJob') const JOBS = Symbol('jobs') const JOBDONE = Symbol('jobDone') const ADDFSENTRY = Symbol('addFSEntry') const ADDTARENTRY = Symbol('addTarEntry') const STAT = Symbol('stat') const READDIR = Symbol('readdir') const ONREADDIR = Symbol('onreaddir') const PIPE = Symbol('pipe') const ENTRY = Symbol('entry') const ENTRYOPT = Symbol('entryOpt') const WRITEENTRYCLASS = Symbol('writeEntryClass') const WRITE = Symbol('write') const ONDRAIN = Symbol('ondrain') const fs = require('fs') const path = require('path') const warner = require('./warn-mixin.js') const Pack = warner(class Pack extends MiniPass { constructor (opt) { super(opt) opt = opt || Object.create(null) this.opt = opt this.file = opt.file || '' this.cwd = opt.cwd || process.cwd() this.maxReadSize = opt.maxReadSize this.preservePaths = !!opt.preservePaths this.strict = !!opt.strict this.noPax = !!opt.noPax this.prefix = (opt.prefix || '').replace(/(\\|\/)+$/, '') this.linkCache = opt.linkCache || new Map() this.statCache = opt.statCache || new Map() this.readdirCache = opt.readdirCache || new Map() this[WRITEENTRYCLASS] = WriteEntry if (typeof opt.onwarn === 'function') this.on('warn', opt.onwarn) this.portable = !!opt.portable this.zip = null if (opt.gzip) { if (typeof opt.gzip !== 'object') opt.gzip = {} if (this.portable) opt.gzip.portable = true this.zip = new zlib.Gzip(opt.gzip) this.zip.on('data', chunk => super.write(chunk)) this.zip.on('end', _ => super.end()) this.zip.on('drain', _ => this[ONDRAIN]()) this.on('resume', _ => this.zip.resume()) } else this.on('drain', this[ONDRAIN]) this.noDirRecurse = !!opt.noDirRecurse this.follow = !!opt.follow this.noMtime = !!opt.noMtime this.mtime = opt.mtime || null this.filter = typeof opt.filter === 'function' ? opt.filter : _ => true this[QUEUE] = new Yallist this[JOBS] = 0 this.jobs = +opt.jobs || 4 this[PROCESSING] = false this[ENDED] = false } [WRITE] (chunk) { return super.write(chunk) } add (path) { this.write(path) return this } end (path) { if (path) this.write(path) this[ENDED] = true this[PROCESS]() return this } write (path) { if (this[ENDED]) throw new Error('write after end') if (path instanceof ReadEntry) this[ADDTARENTRY](path) else this[ADDFSENTRY](path) return this.flowing } [ADDTARENTRY] (p) { const absolute = path.resolve(this.cwd, p.path) if (this.prefix) p.path = this.prefix + '/' + p.path.replace(/^\.(\/+|$)/, '') // in this case, we don't have to wait for the stat if (!this.filter(p.path, p)) p.resume() else { const job = new PackJob(p.path, absolute, false) job.entry = new WriteEntryTar(p, this[ENTRYOPT](job)) job.entry.on('end', _ => this[JOBDONE](job)) this[JOBS] += 1 this[QUEUE].push(job) } this[PROCESS]() } [ADDFSENTRY] (p) { const absolute = path.resolve(this.cwd, p) if (this.prefix) p = this.prefix + '/' + p.replace(/^\.(\/+|$)/, '') this[QUEUE].push(new PackJob(p, absolute)) this[PROCESS]() } [STAT] (job) { job.pending = true this[JOBS] += 1 const stat = this.follow ? 'stat' : 'lstat' fs[stat](job.absolute, (er, stat) => { job.pending = false this[JOBS] -= 1 if (er) this.emit('error', er) else this[ONSTAT](job, stat) }) } [ONSTAT] (job, stat) { this.statCache.set(job.absolute, stat) job.stat = stat // now we have the stat, we can filter it. if (!this.filter(job.path, stat)) job.ignore = true this[PROCESS]() } [READDIR] (job) { job.pending = true this[JOBS] += 1 fs.readdir(job.absolute, (er, entries) => { job.pending = false this[JOBS] -= 1 if (er) return this.emit('error', er) this[ONREADDIR](job, entries) }) } [ONREADDIR] (job, entries) { this.readdirCache.set(job.absolute, entries) job.readdir = entries this[PROCESS]() } [PROCESS] () { if (this[PROCESSING]) return this[PROCESSING] = true for (let w = this[QUEUE].head; w !== null && this[JOBS] < this.jobs; w = w.next) { this[PROCESSJOB](w.value) if (w.value.ignore) { const p = w.next this[QUEUE].removeNode(w) w.next = p } } this[PROCESSING] = false if (this[ENDED] && !this[QUEUE].length && this[JOBS] === 0) { if (this.zip) this.zip.end(EOF) else { super.write(EOF) super.end() } } } get [CURRENT] () { return this[QUEUE] && this[QUEUE].head && this[QUEUE].head.value } [JOBDONE] (job) { this[QUEUE].shift() this[JOBS] -= 1 this[PROCESS]() } [PROCESSJOB] (job) { if (job.pending) return if (job.entry) { if (job === this[CURRENT] && !job.piped) this[PIPE](job) return } if (!job.stat) { if (this.statCache.has(job.absolute)) this[ONSTAT](job, this.statCache.get(job.absolute)) else this[STAT](job) } if (!job.stat) return // filtered out! if (job.ignore) return if (!this.noDirRecurse && job.stat.isDirectory() && !job.readdir) { if (this.readdirCache.has(job.absolute)) this[ONREADDIR](job, this.readdirCache.get(job.absolute)) else this[READDIR](job) if (!job.readdir) return } // we know it doesn't have an entry, because that got checked above job.entry = this[ENTRY](job) if (!job.entry) { job.ignore = true return } if (job === this[CURRENT] && !job.piped) this[PIPE](job) } [ENTRYOPT] (job) { return { onwarn: (code, msg, data) => this.warn(code, msg, data), noPax: this.noPax, cwd: this.cwd, absolute: job.absolute, preservePaths: this.preservePaths, maxReadSize: this.maxReadSize, strict: this.strict, portable: this.portable, linkCache: this.linkCache, statCache: this.statCache, noMtime: this.noMtime, mtime: this.mtime } } [ENTRY] (job) { this[JOBS] += 1 try { return new this[WRITEENTRYCLASS](job.path, this[ENTRYOPT](job)) .on('end', () => this[JOBDONE](job)) .on('error', er => this.emit('error', er)) } catch (er) { this.emit('error', er) } } [ONDRAIN] () { if (this[CURRENT] && this[CURRENT].entry) this[CURRENT].entry.resume() } // like .pipe() but using super, because our write() is special [PIPE] (job) { job.piped = true if (job.readdir) job.readdir.forEach(entry => { const p = this.prefix ? job.path.slice(this.prefix.length + 1) || './' : job.path const base = p === './' ? '' : p.replace(/\/*$/, '/') this[ADDFSENTRY](base + entry) }) const source = job.entry const zip = this.zip if (zip) source.on('data', chunk => { if (!zip.write(chunk)) source.pause() }) else source.on('data', chunk => { if (!super.write(chunk)) source.pause() }) } pause () { if (this.zip) this.zip.pause() return super.pause() } }) class PackSync extends Pack { constructor (opt) { super(opt) this[WRITEENTRYCLASS] = WriteEntrySync } // pause/resume are no-ops in sync streams. pause () {} resume () {} [STAT] (job) { const stat = this.follow ? 'statSync' : 'lstatSync' this[ONSTAT](job, fs[stat](job.absolute)) } [READDIR] (job, stat) { this[ONREADDIR](job, fs.readdirSync(job.absolute)) } // gotta get it all in this tick [PIPE] (job) { const source = job.entry const zip = this.zip if (job.readdir) job.readdir.forEach(entry => { const p = this.prefix ? job.path.slice(this.prefix.length + 1) || './' : job.path const base = p === './' ? '' : p.replace(/\/*$/, '/') this[ADDFSENTRY](base + entry) }) if (zip) source.on('data', chunk => { zip.write(chunk) }) else source.on('data', chunk => { super[WRITE](chunk) }) } } Pack.Sync = PackSync module.exports = Pack 'use strict' // this[BUFFER] is the remainder of a chunk if we're waiting for // the full 512 bytes of a header to come in. We will Buffer.concat() // it to the next write(), which is a mem copy, but a small one. // // this[QUEUE] is a Yallist of entries that haven't been emitted // yet this can only get filled up if the user keeps write()ing after // a write() returns false, or does a write() with more than one entry // // We don't buffer chunks, we always parse them and either create an // entry, or push it into the active entry. The ReadEntry class knows // to throw data away if .ignore=true // // Shift entry off the buffer when it emits 'end', and emit 'entry' for // the next one in the list. // // At any time, we're pushing body chunks into the entry at WRITEENTRY, // and waiting for 'end' on the entry at READENTRY // // ignored entries get .resume() called on them straight away const warner = require('./warn-mixin.js') const path = require('path') const Header = require('./header.js') const EE = require('events') const Yallist = require('yallist') const maxMetaEntrySize = 1024 * 1024 const Entry = require('./read-entry.js') const Pax = require('./pax.js') const zlib = require('minizlib') const gzipHeader = Buffer.from([0x1f, 0x8b]) const STATE = Symbol('state') const WRITEENTRY = Symbol('writeEntry') const READENTRY = Symbol('readEntry') const NEXTENTRY = Symbol('nextEntry') const PROCESSENTRY = Symbol('processEntry') const EX = Symbol('extendedHeader') const GEX = Symbol('globalExtendedHeader') const META = Symbol('meta') const EMITMETA = Symbol('emitMeta') const BUFFER = Symbol('buffer') const QUEUE = Symbol('queue') const ENDED = Symbol('ended') const EMITTEDEND = Symbol('emittedEnd') const EMIT = Symbol('emit') const UNZIP = Symbol('unzip') const CONSUMECHUNK = Symbol('consumeChunk') const CONSUMECHUNKSUB = Symbol('consumeChunkSub') const CONSUMEBODY = Symbol('consumeBody') const CONSUMEMETA = Symbol('consumeMeta') const CONSUMEHEADER = Symbol('consumeHeader') const CONSUMING = Symbol('consuming') const BUFFERCONCAT = Symbol('bufferConcat') const MAYBEEND = Symbol('maybeEnd') const WRITING = Symbol('writing') const ABORTED = Symbol('aborted') const DONE = Symbol('onDone') const SAW_VALID_ENTRY = Symbol('sawValidEntry') const SAW_NULL_BLOCK = Symbol('sawNullBlock') const SAW_EOF = Symbol('sawEOF') const noop = _ => true module.exports = warner(class Parser extends EE { constructor (opt) { opt = opt || {} super(opt) this.file = opt.file || '' // set to boolean false when an entry starts. 1024 bytes of \0 // is technically a valid tarball, albeit a boring one. this[SAW_VALID_ENTRY] = null // these BADARCHIVE errors can't be detected early. listen on DONE. this.on(DONE, _ => { if (this[STATE] === 'begin' || this[SAW_VALID_ENTRY] === false) { // either less than 1 block of data, or all entries were invalid. // Either way, probably not even a tarball. this.warn('TAR_BAD_ARCHIVE', 'Unrecognized archive format') } }) if (opt.ondone) this.on(DONE, opt.ondone) else this.on(DONE, _ => { this.emit('prefinish') this.emit('finish') this.emit('end') this.emit('close') }) this.strict = !!opt.strict this.maxMetaEntrySize = opt.maxMetaEntrySize || maxMetaEntrySize this.filter = typeof opt.filter === 'function' ? opt.filter : noop // have to set this so that streams are ok piping into it this.writable = true this.readable = false this[QUEUE] = new Yallist() this[BUFFER] = null this[READENTRY] = null this[WRITEENTRY] = null this[STATE] = 'begin' this[META] = '' this[EX] = null this[GEX] = null this[ENDED] = false this[UNZIP] = null this[ABORTED] = false this[SAW_NULL_BLOCK] = false this[SAW_EOF] = false if (typeof opt.onwarn === 'function') this.on('warn', opt.onwarn) if (typeof opt.onentry === 'function') this.on('entry', opt.onentry) } [CONSUMEHEADER] (chunk, position) { if (this[SAW_VALID_ENTRY] === null) this[SAW_VALID_ENTRY] = false let header try { header = new Header(chunk, position, this[EX], this[GEX]) } catch (er) { return this.warn('TAR_ENTRY_INVALID', er) } if (header.nullBlock) { if (this[SAW_NULL_BLOCK]) { this[SAW_EOF] = true // ending an archive with no entries. pointless, but legal. if (this[STATE] === 'begin') this[STATE] = 'header' this[EMIT]('eof') } else { this[SAW_NULL_BLOCK] = true this[EMIT]('nullBlock') } } else { this[SAW_NULL_BLOCK] = false if (!header.cksumValid) this.warn('TAR_ENTRY_INVALID', 'checksum failure', {header}) else if (!header.path) this.warn('TAR_ENTRY_INVALID', 'path is required', {header}) else { const type = header.type if (/^(Symbolic)?Link$/.test(type) && !header.linkpath) this.warn('TAR_ENTRY_INVALID', 'linkpath required', {header}) else if (!/^(Symbolic)?Link$/.test(type) && header.linkpath) this.warn('TAR_ENTRY_INVALID', 'linkpath forbidden', {header}) else { const entry = this[WRITEENTRY] = new Entry(header, this[EX], this[GEX]) // we do this for meta & ignored entries as well, because they // are still valid tar, or else we wouldn't know to ignore them if (!this[SAW_VALID_ENTRY]) { if (entry.remain) { // this might be the one! const onend = () => { if (!entry.invalid) this[SAW_VALID_ENTRY] = true } entry.on('end', onend) } else { this[SAW_VALID_ENTRY] = true } } if (entry.meta) { if (entry.size > this.maxMetaEntrySize) { entry.ignore = true this[EMIT]('ignoredEntry', entry) this[STATE] = 'ignore' entry.resume() } else if (entry.size > 0) { this[META] = '' entry.on('data', c => this[META] += c) this[STATE] = 'meta' } } else { this[EX] = null entry.ignore = entry.ignore || !this.filter(entry.path, entry) if (entry.ignore) { // probably valid, just not something we care about this[EMIT]('ignoredEntry', entry) this[STATE] = entry.remain ? 'ignore' : 'header' entry.resume() } else { if (entry.remain) this[STATE] = 'body' else { this[STATE] = 'header' entry.end() } if (!this[READENTRY]) { this[QUEUE].push(entry) this[NEXTENTRY]() } else this[QUEUE].push(entry) } } } } } } [PROCESSENTRY] (entry) { let go = true if (!entry) { this[READENTRY] = null go = false } else if (Array.isArray(entry)) this.emit.apply(this, entry) else { this[READENTRY] = entry this.emit('entry', entry) if (!entry.emittedEnd) { entry.on('end', _ => this[NEXTENTRY]()) go = false } } return go } [NEXTENTRY] () { do {} while (this[PROCESSENTRY](this[QUEUE].shift())) if (!this[QUEUE].length) { // At this point, there's nothing in the queue, but we may have an // entry which is being consumed (readEntry). // If we don't, then we definitely can handle more data. // If we do, and either it's flowing, or it has never had any data // written to it, then it needs more. // The only other possibility is that it has returned false from a // write() call, so we wait for the next drain to continue. const re = this[READENTRY] const drainNow = !re || re.flowing || re.size === re.remain if (drainNow) { if (!this[WRITING]) this.emit('drain') } else re.once('drain', _ => this.emit('drain')) } } [CONSUMEBODY] (chunk, position) { // write up to but no more than writeEntry.blockRemain const entry = this[WRITEENTRY] const br = entry.blockRemain const c = (br >= chunk.length && position === 0) ? chunk : chunk.slice(position, position + br) entry.write(c) if (!entry.blockRemain) { this[STATE] = 'header' this[WRITEENTRY] = null entry.end() } return c.length } [CONSUMEMETA] (chunk, position) { const entry = this[WRITEENTRY] const ret = this[CONSUMEBODY](chunk, position) // if we finished, then the entry is reset if (!this[WRITEENTRY]) this[EMITMETA](entry) return ret } [EMIT] (ev, data, extra) { if (!this[QUEUE].length && !this[READENTRY]) this.emit(ev, data, extra) else this[QUEUE].push([ev, data, extra]) } [EMITMETA] (entry) { this[EMIT]('meta', this[META]) switch (entry.type) { case 'ExtendedHeader': case 'OldExtendedHeader': this[EX] = Pax.parse(this[META], this[EX], false) break case 'GlobalExtendedHeader': this[GEX] = Pax.parse(this[META], this[GEX], true) break case 'NextFileHasLongPath': case 'OldGnuLongPath': this[EX] = this[EX] || Object.create(null) this[EX].path = this[META].replace(/\0.*/, '') break case 'NextFileHasLongLinkpath': this[EX] = this[EX] || Object.create(null) this[EX].linkpath = this[META].replace(/\0.*/, '') break /* istanbul ignore next */ default: throw new Error('unknown meta: ' + entry.type) } } abort (error) { this[ABORTED] = true this.emit('abort', error) // always throws, even in non-strict mode this.warn('TAR_ABORT', error, { recoverable: false }) } write (chunk) { if (this[ABORTED]) return // first write, might be gzipped if (this[UNZIP] === null && chunk) { if (this[BUFFER]) { chunk = Buffer.concat([this[BUFFER], chunk]) this[BUFFER] = null } if (chunk.length < gzipHeader.length) { this[BUFFER] = chunk return true } for (let i = 0; this[UNZIP] === null && i < gzipHeader.length; i++) { if (chunk[i] !== gzipHeader[i]) this[UNZIP] = false } if (this[UNZIP] === null) { const ended = this[ENDED] this[ENDED] = false this[UNZIP] = new zlib.Unzip() this[UNZIP].on('data', chunk => this[CONSUMECHUNK](chunk)) this[UNZIP].on('error', er => this.abort(er)) this[UNZIP].on('end', _ => { this[ENDED] = true this[CONSUMECHUNK]() }) this[WRITING] = true const ret = this[UNZIP][ended ? 'end' : 'write' ](chunk) this[WRITING] = false return ret } } this[WRITING] = true if (this[UNZIP]) this[UNZIP].write(chunk) else this[CONSUMECHUNK](chunk) this[WRITING] = false // return false if there's a queue, or if the current entry isn't flowing const ret = this[QUEUE].length ? false : this[READENTRY] ? this[READENTRY].flowing : true // if we have no queue, then that means a clogged READENTRY if (!ret && !this[QUEUE].length) this[READENTRY].once('drain', _ => this.emit('drain')) return ret } [BUFFERCONCAT] (c) { if (c && !this[ABORTED]) this[BUFFER] = this[BUFFER] ? Buffer.concat([this[BUFFER], c]) : c } [MAYBEEND] () { if (this[ENDED] && !this[EMITTEDEND] && !this[ABORTED] && !this[CONSUMING]) { this[EMITTEDEND] = true const entry = this[WRITEENTRY] if (entry && entry.blockRemain) { // truncated, likely a damaged file const have = this[BUFFER] ? this[BUFFER].length : 0 this.warn('TAR_BAD_ARCHIVE', `Truncated input (needed ${ entry.blockRemain} more bytes, only ${have} available)`, {entry}) if (this[BUFFER]) entry.write(this[BUFFER]) entry.end() } this[EMIT](DONE) } } [CONSUMECHUNK] (chunk) { if (this[CONSUMING]) this[BUFFERCONCAT](chunk) else if (!chunk && !this[BUFFER]) this[MAYBEEND]() else { this[CONSUMING] = true if (this[BUFFER]) { this[BUFFERCONCAT](chunk) const c = this[BUFFER] this[BUFFER] = null this[CONSUMECHUNKSUB](c) } else { this[CONSUMECHUNKSUB](chunk) } while (this[BUFFER] && this[BUFFER].length >= 512 && !this[ABORTED] && !this[SAW_EOF]) { const c = this[BUFFER] this[BUFFER] = null this[CONSUMECHUNKSUB](c) } this[CONSUMING] = false } if (!this[BUFFER] || this[ENDED]) this[MAYBEEND]() } [CONSUMECHUNKSUB] (chunk) { // we know that we are in CONSUMING mode, so anything written goes into // the buffer. Advance the position and put any remainder in the buffer. let position = 0 let length = chunk.length while (position + 512 <= length && !this[ABORTED] && !this[SAW_EOF]) { switch (this[STATE]) { case 'begin': case 'header': this[CONSUMEHEADER](chunk, position) position += 512 break case 'ignore': case 'body': position += this[CONSUMEBODY](chunk, position) break case 'meta': position += this[CONSUMEMETA](chunk, position) break /* istanbul ignore next */ default: throw new Error('invalid state: ' + this[STATE]) } } if (position < length) { if (this[BUFFER]) this[BUFFER] = Buffer.concat([chunk.slice(position), this[BUFFER]]) else this[BUFFER] = chunk.slice(position) } } end (chunk) { if (!this[ABORTED]) { if (this[UNZIP]) this[UNZIP].end(chunk) else { this[ENDED] = true this.write(chunk) } } } }) // A path exclusive reservation system // reserve([list, of, paths], fn) // When the fn is first in line for all its paths, it // is called with a cb that clears the reservation. // // Used by async unpack to avoid clobbering paths in use, // while still allowing maximal safe parallelization. const assert = require('assert') module.exports = () => { // path => [function or Set] // A Set object means a directory reservation // A fn is a direct reservation on that path const queues = new Map() // fn => {paths:[path,...], dirs:[path, ...]} const reservations = new Map() // return a set of parent dirs for a given path const { join } = require('path') const getDirs = path => join(path).split(/[\\\/]/).slice(0, -1).reduce((set, path) => set.length ? set.concat(join(set[set.length-1], path)) : [path], []) // functions currently running const running = new Set() // return the queues for each path the function cares about // fn => {paths, dirs} const getQueues = fn => { const res = reservations.get(fn) /* istanbul ignore if - unpossible */ if (!res) throw new Error('function does not have any path reservations') return { paths: res.paths.map(path => queues.get(path)), dirs: [...res.dirs].map(path => queues.get(path)), } } // check if fn is first in line for all its paths, and is // included in the first set for all its dir queues const check = fn => { const {paths, dirs} = getQueues(fn) return paths.every(q => q[0] === fn) && dirs.every(q => q[0] instanceof Set && q[0].has(fn)) } // run the function if it's first in line and not already running const run = fn => { if (running.has(fn) || !check(fn)) return false running.add(fn) fn(() => clear(fn)) return true } const clear = fn => { if (!running.has(fn)) return false const { paths, dirs } = reservations.get(fn) const next = new Set() paths.forEach(path => { const q = queues.get(path) assert.equal(q[0], fn) if (q.length === 1) queues.delete(path) else { q.shift() if (typeof q[0] === 'function') next.add(q[0]) else q[0].forEach(fn => next.add(fn)) } }) dirs.forEach(dir => { const q = queues.get(dir) assert(q[0] instanceof Set) if (q[0].size === 1 && q.length === 1) { queues.delete(dir) } else if (q[0].size === 1) { q.shift() // must be a function or else the Set would've been reused next.add(q[0]) } else q[0].delete(fn) }) running.delete(fn) next.forEach(fn => run(fn)) return true } const reserve = (paths, fn) => { const dirs = new Set( paths.map(path => getDirs(path)).reduce((a, b) => a.concat(b)) ) reservations.set(fn, {dirs, paths}) paths.forEach(path => { const q = queues.get(path) if (!q) queues.set(path, [fn]) else q.push(fn) }) dirs.forEach(dir => { const q = queues.get(dir) if (!q) queues.set(dir, [new Set([fn])]) else if (q[q.length-1] instanceof Set) q[q.length-1].add(fn) else q.push(new Set([fn])) }) return run(fn) } return { check, reserve } } 'use strict' const Header = require('./header.js') const path = require('path') class Pax { constructor (obj, global) { this.atime = obj.atime || null this.charset = obj.charset || null this.comment = obj.comment || null this.ctime = obj.ctime || null this.gid = obj.gid || null this.gname = obj.gname || null this.linkpath = obj.linkpath || null this.mtime = obj.mtime || null this.path = obj.path || null this.size = obj.size || null this.uid = obj.uid || null this.uname = obj.uname || null this.dev = obj.dev || null this.ino = obj.ino || null this.nlink = obj.nlink || null this.global = global || false } encode () { const body = this.encodeBody() if (body === '') return null const bodyLen = Buffer.byteLength(body) // round up to 512 bytes // add 512 for header const bufLen = 512 * Math.ceil(1 + bodyLen / 512) const buf = Buffer.allocUnsafe(bufLen) // 0-fill the header section, it might not hit every field for (let i = 0; i < 512; i++) { buf[i] = 0 } new Header({ // XXX split the path // then the path should be PaxHeader + basename, but less than 99, // prepend with the dirname path: ('PaxHeader/' + path.basename(this.path)).slice(0, 99), mode: this.mode || 0o644, uid: this.uid || null, gid: this.gid || null, size: bodyLen, mtime: this.mtime || null, type: this.global ? 'GlobalExtendedHeader' : 'ExtendedHeader', linkpath: '', uname: this.uname || '', gname: this.gname || '', devmaj: 0, devmin: 0, atime: this.atime || null, ctime: this.ctime || null }).encode(buf) buf.write(body, 512, bodyLen, 'utf8') // null pad after the body for (let i = bodyLen + 512; i < buf.length; i++) { buf[i] = 0 } return buf } encodeBody () { return ( this.encodeField('path') + this.encodeField('ctime') + this.encodeField('atime') + this.encodeField('dev') + this.encodeField('ino') + this.encodeField('nlink') + this.encodeField('charset') + this.encodeField('comment') + this.encodeField('gid') + this.encodeField('gname') + this.encodeField('linkpath') + this.encodeField('mtime') + this.encodeField('size') + this.encodeField('uid') + this.encodeField('uname') ) } encodeField (field) { if (this[field] === null || this[field] === undefined) return '' const v = this[field] instanceof Date ? this[field].getTime() / 1000 : this[field] const s = ' ' + (field === 'dev' || field === 'ino' || field === 'nlink' ? 'SCHILY.' : '') + field + '=' + v + '\n' const byteLen = Buffer.byteLength(s) // the digits includes the length of the digits in ascii base-10 // so if it's 9 characters, then adding 1 for the 9 makes it 10 // which makes it 11 chars. let digits = Math.floor(Math.log(byteLen) / Math.log(10)) + 1 if (byteLen + digits >= Math.pow(10, digits)) digits += 1 const len = digits + byteLen return len + s } } Pax.parse = (string, ex, g) => new Pax(merge(parseKV(string), ex), g) const merge = (a, b) => b ? Object.keys(a).reduce((s, k) => (s[k] = a[k], s), b) : a const parseKV = string => string .replace(/\n$/, '') .split('\n') .reduce(parseKVLine, Object.create(null)) const parseKVLine = (set, line) => { const n = parseInt(line, 10) // XXX Values with \n in them will fail this. // Refactor to not be a naive line-by-line parse. if (n !== Buffer.byteLength(line) + 1) return set line = line.substr((n + ' ').length) const kv = line.split('=') const k = kv.shift().replace(/^SCHILY\.(dev|ino|nlink)/, '$1') if (!k) return set const v = kv.join('=') set[k] = /^([A-Z]+\.)?([mac]|birth|creation)time$/.test(k) ? new Date(v * 1000) : /^[0-9]+$/.test(v) ? +v : v return set } module.exports = Pax 'use strict' const types = require('./types.js') const MiniPass = require('minipass') const SLURP = Symbol('slurp') module.exports = class ReadEntry extends MiniPass { constructor (header, ex, gex) { super() // read entries always start life paused. this is to avoid the // situation where Minipass's auto-ending empty streams results // in an entry ending before we're ready for it. this.pause() this.extended = ex this.globalExtended = gex this.header = header this.startBlockSize = 512 * Math.ceil(header.size / 512) this.blockRemain = this.startBlockSize this.remain = header.size this.type = header.type this.meta = false this.ignore = false switch (this.type) { case 'File': case 'OldFile': case 'Link': case 'SymbolicLink': case 'CharacterDevice': case 'BlockDevice': case 'Directory': case 'FIFO': case 'ContiguousFile': case 'GNUDumpDir': break case 'NextFileHasLongLinkpath': case 'NextFileHasLongPath': case 'OldGnuLongPath': case 'GlobalExtendedHeader': case 'ExtendedHeader': case 'OldExtendedHeader': this.meta = true break // NOTE: gnutar and bsdtar treat unrecognized types as 'File' // it may be worth doing the same, but with a warning. default: this.ignore = true } this.path = header.path this.mode = header.mode if (this.mode) this.mode = this.mode & 0o7777 this.uid = header.uid this.gid = header.gid this.uname = header.uname this.gname = header.gname this.size = header.size this.mtime = header.mtime this.atime = header.atime this.ctime = header.ctime this.linkpath = header.linkpath this.uname = header.uname this.gname = header.gname if (ex) this[SLURP](ex) if (gex) this[SLURP](gex, true) } write (data) { const writeLen = data.length if (writeLen > this.blockRemain) throw new Error('writing more to entry than is appropriate') const r = this.remain const br = this.blockRemain this.remain = Math.max(0, r - writeLen) this.blockRemain = Math.max(0, br - writeLen) if (this.ignore) return true if (r >= writeLen) return super.write(data) // r < writeLen return super.write(data.slice(0, r)) } [SLURP] (ex, global) { for (let k in ex) { // we slurp in everything except for the path attribute in // a global extended header, because that's weird. if (ex[k] !== null && ex[k] !== undefined && !(global && k === 'path')) this[k] = ex[k] } } } 'use strict' // tar -r const hlo = require('./high-level-opt.js') const Pack = require('./pack.js') const Parse = require('./parse.js') const fs = require('fs') const fsm = require('fs-minipass') const t = require('./list.js') const path = require('path') // starting at the head of the file, read a Header // If the checksum is invalid, that's our position to start writing // If it is, jump forward by the specified size (round up to 512) // and try again. // Write the new Pack stream starting there. const Header = require('./header.js') const r = module.exports = (opt_, files, cb) => { const opt = hlo(opt_) if (!opt.file) throw new TypeError('file is required') if (opt.gzip) throw new TypeError('cannot append to compressed archives') if (!files || !Array.isArray(files) || !files.length) throw new TypeError('no files or directories specified') files = Array.from(files) return opt.sync ? replaceSync(opt, files) : replace(opt, files, cb) } const replaceSync = (opt, files) => { const p = new Pack.Sync(opt) let threw = true let fd let position try { try { fd = fs.openSync(opt.file, 'r+') } catch (er) { if (er.code === 'ENOENT') fd = fs.openSync(opt.file, 'w+') else throw er } const st = fs.fstatSync(fd) const headBuf = Buffer.alloc(512) POSITION: for (position = 0; position < st.size; position += 512) { for (let bufPos = 0, bytes = 0; bufPos < 512; bufPos += bytes) { bytes = fs.readSync( fd, headBuf, bufPos, headBuf.length - bufPos, position + bufPos ) if (position === 0 && headBuf[0] === 0x1f && headBuf[1] === 0x8b) throw new Error('cannot append to compressed archives') if (!bytes) break POSITION } let h = new Header(headBuf) if (!h.cksumValid) break let entryBlockSize = 512 * Math.ceil(h.size / 512) if (position + entryBlockSize + 512 > st.size) break // the 512 for the header we just parsed will be added as well // also jump ahead all the blocks for the body position += entryBlockSize if (opt.mtimeCache) opt.mtimeCache.set(h.path, h.mtime) } threw = false streamSync(opt, p, position, fd, files) } finally { if (threw) try { fs.closeSync(fd) } catch (er) {} } } const streamSync = (opt, p, position, fd, files) => { const stream = new fsm.WriteStreamSync(opt.file, { fd: fd, start: position }) p.pipe(stream) addFilesSync(p, files) } const replace = (opt, files, cb) => { files = Array.from(files) const p = new Pack(opt) const getPos = (fd, size, cb_) => { const cb = (er, pos) => { if (er) fs.close(fd, _ => cb_(er)) else cb_(null, pos) } let position = 0 if (size === 0) return cb(null, 0) let bufPos = 0 const headBuf = Buffer.alloc(512) const onread = (er, bytes) => { if (er) return cb(er) bufPos += bytes if (bufPos < 512 && bytes) return fs.read( fd, headBuf, bufPos, headBuf.length - bufPos, position + bufPos, onread ) if (position === 0 && headBuf[0] === 0x1f && headBuf[1] === 0x8b) return cb(new Error('cannot append to compressed archives')) // truncated header if (bufPos < 512) return cb(null, position) const h = new Header(headBuf) if (!h.cksumValid) return cb(null, position) const entryBlockSize = 512 * Math.ceil(h.size / 512) if (position + entryBlockSize + 512 > size) return cb(null, position) position += entryBlockSize + 512 if (position >= size) return cb(null, position) if (opt.mtimeCache) opt.mtimeCache.set(h.path, h.mtime) bufPos = 0 fs.read(fd, headBuf, 0, 512, position, onread) } fs.read(fd, headBuf, 0, 512, position, onread) } const promise = new Promise((resolve, reject) => { p.on('error', reject) let flag = 'r+' const onopen = (er, fd) => { if (er && er.code === 'ENOENT' && flag === 'r+') { flag = 'w+' return fs.open(opt.file, flag, onopen) } if (er) return reject(er) fs.fstat(fd, (er, st) => { if (er) return reject(er) getPos(fd, st.size, (er, position) => { if (er) return reject(er) const stream = new fsm.WriteStream(opt.file, { fd: fd, start: position }) p.pipe(stream) stream.on('error', reject) stream.on('close', resolve) addFilesAsync(p, files) }) }) } fs.open(opt.file, flag, onopen) }) return cb ? promise.then(cb, cb) : promise } const addFilesSync = (p, files) => { files.forEach(file => { if (file.charAt(0) === '@') t({ file: path.resolve(p.cwd, file.substr(1)), sync: true, noResume: true, onentry: entry => p.add(entry) }) else p.add(file) }) p.end() } const addFilesAsync = (p, files) => { while (files.length) { const file = files.shift() if (file.charAt(0) === '@') return t({ file: path.resolve(p.cwd, file.substr(1)), noResume: true, onentry: entry => p.add(entry) }).then(_ => addFilesAsync(p, files)) else p.add(file) } p.end() } 'use strict' // map types from key to human-friendly name exports.name = new Map([ ['0', 'File'], // same as File ['', 'OldFile'], ['1', 'Link'], ['2', 'SymbolicLink'], // Devices and FIFOs aren't fully supported // they are parsed, but skipped when unpacking ['3', 'CharacterDevice'], ['4', 'BlockDevice'], ['5', 'Directory'], ['6', 'FIFO'], // same as File ['7', 'ContiguousFile'], // pax headers ['g', 'GlobalExtendedHeader'], ['x', 'ExtendedHeader'], // vendor-specific stuff // skip ['A', 'SolarisACL'], // like 5, but with data, which should be skipped ['D', 'GNUDumpDir'], // metadata only, skip ['I', 'Inode'], // data = link path of next file ['K', 'NextFileHasLongLinkpath'], // data = path of next file ['L', 'NextFileHasLongPath'], // skip ['M', 'ContinuationFile'], // like L ['N', 'OldGnuLongPath'], // skip ['S', 'SparseFile'], // skip ['V', 'TapeVolumeHeader'], // like x ['X', 'OldExtendedHeader'] ]) // map the other direction exports.code = new Map(Array.from(exports.name).map(kv => [kv[1], kv[0]])) 'use strict' // the PEND/UNPEND stuff tracks whether we're ready to emit end/close yet. // but the path reservations are required to avoid race conditions where // parallelized unpack ops may mess with one another, due to dependencies // (like a Link depending on its target) or destructive operations (like // clobbering an fs object to create one of a different type.) const assert = require('assert') const EE = require('events').EventEmitter const Parser = require('./parse.js') const fs = require('fs') const fsm = require('fs-minipass') const path = require('path') const mkdir = require('./mkdir.js') const mkdirSync = mkdir.sync const wc = require('./winchars.js') const pathReservations = require('./path-reservations.js') const ONENTRY = Symbol('onEntry') const CHECKFS = Symbol('checkFs') const CHECKFS2 = Symbol('checkFs2') const ISREUSABLE = Symbol('isReusable') const MAKEFS = Symbol('makeFs') const FILE = Symbol('file') const DIRECTORY = Symbol('directory') const LINK = Symbol('link') const SYMLINK = Symbol('symlink') const HARDLINK = Symbol('hardlink') const UNSUPPORTED = Symbol('unsupported') const UNKNOWN = Symbol('unknown') const CHECKPATH = Symbol('checkPath') const MKDIR = Symbol('mkdir') const ONERROR = Symbol('onError') const PENDING = Symbol('pending') const PEND = Symbol('pend') const UNPEND = Symbol('unpend') const ENDED = Symbol('ended') const MAYBECLOSE = Symbol('maybeClose') const SKIP = Symbol('skip') const DOCHOWN = Symbol('doChown') const UID = Symbol('uid') const GID = Symbol('gid') const crypto = require('crypto') const getFlag = require('./get-write-flag.js') /* istanbul ignore next */ const neverCalled = () => { throw new Error('sync function called cb somehow?!?') } // Unlinks on Windows are not atomic. // // This means that if you have a file entry, followed by another // file entry with an identical name, and you cannot re-use the file // (because it's a hardlink, or because unlink:true is set, or it's // Windows, which does not have useful nlink values), then the unlink // will be committed to the disk AFTER the new file has been written // over the old one, deleting the new file. // // To work around this, on Windows systems, we rename the file and then // delete the renamed file. It's a sloppy kludge, but frankly, I do not // know of a better way to do this, given windows' non-atomic unlink // semantics. // // See: https://github.com/npm/node-tar/issues/183 /* istanbul ignore next */ const unlinkFile = (path, cb) => { if (process.platform !== 'win32') return fs.unlink(path, cb) const name = path + '.DELETE.' + crypto.randomBytes(16).toString('hex') fs.rename(path, name, er => { if (er) return cb(er) fs.unlink(name, cb) }) } /* istanbul ignore next */ const unlinkFileSync = path => { if (process.platform !== 'win32') return fs.unlinkSync(path) const name = path + '.DELETE.' + crypto.randomBytes(16).toString('hex') fs.renameSync(path, name) fs.unlinkSync(name) } // this.gid, entry.gid, this.processUid const uint32 = (a, b, c) => a === a >>> 0 ? a : b === b >>> 0 ? b : c class Unpack extends Parser { constructor (opt) { if (!opt) opt = {} opt.ondone = _ => { this[ENDED] = true this[MAYBECLOSE]() } super(opt) this.reservations = pathReservations() this.transform = typeof opt.transform === 'function' ? opt.transform : null this.writable = true this.readable = false this[PENDING] = 0 this[ENDED] = false this.dirCache = opt.dirCache || new Map() if (typeof opt.uid === 'number' || typeof opt.gid === 'number') { // need both or neither if (typeof opt.uid !== 'number' || typeof opt.gid !== 'number') throw new TypeError('cannot set owner without number uid and gid') if (opt.preserveOwner) throw new TypeError( 'cannot preserve owner in archive and also set owner explicitly') this.uid = opt.uid this.gid = opt.gid this.setOwner = true } else { this.uid = null this.gid = null this.setOwner = false } // default true for root if (opt.preserveOwner === undefined && typeof opt.uid !== 'number') this.preserveOwner = process.getuid && process.getuid() === 0 else this.preserveOwner = !!opt.preserveOwner this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ? process.getuid() : null this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ? process.getgid() : null // mostly just for testing, but useful in some cases. // Forcibly trigger a chown on every entry, no matter what this.forceChown = opt.forceChown === true // turn > this[ONENTRY](entry)) } // a bad or damaged archive is a warning for Parser, but an error // when extracting. Mark those errors as unrecoverable, because // the Unpack contract cannot be met. warn (code, msg, data = {}) { if (code === 'TAR_BAD_ARCHIVE' || code === 'TAR_ABORT') data.recoverable = false return super.warn(code, msg, data) } [MAYBECLOSE] () { if (this[ENDED] && this[PENDING] === 0) { this.emit('prefinish') this.emit('finish') this.emit('end') this.emit('close') } } [CHECKPATH] (entry) { if (this.strip) { const parts = entry.path.split(/\/|\\/) if (parts.length < this.strip) return false entry.path = parts.slice(this.strip).join('/') if (entry.type === 'Link') { const linkparts = entry.linkpath.split(/\/|\\/) if (linkparts.length >= this.strip) entry.linkpath = linkparts.slice(this.strip).join('/') } } if (!this.preservePaths) { const p = entry.path if (p.match(/(^|\/|\\)\.\.(\\|\/|$)/)) { this.warn('TAR_ENTRY_ERROR', `path contains '..'`, { entry, path: p, }) return false } // absolutes on posix are also absolutes on win32 // so we only need to test this one to get both if (path.win32.isAbsolute(p)) { const parsed = path.win32.parse(p) entry.path = p.substr(parsed.root.length) const r = parsed.root this.warn('TAR_ENTRY_INFO', `stripping ${r} from absolute path`, { entry, path: p, }) } } // only encode : chars that aren't drive letter indicators if (this.win32) { const parsed = path.win32.parse(entry.path) entry.path = parsed.root === '' ? wc.encode(entry.path) : parsed.root + wc.encode(entry.path.substr(parsed.root.length)) } if (path.isAbsolute(entry.path)) entry.absolute = entry.path else entry.absolute = path.resolve(this.cwd, entry.path) return true } [ONENTRY] (entry) { if (!this[CHECKPATH](entry)) return entry.resume() assert.equal(typeof entry.absolute, 'string') switch (entry.type) { case 'Directory': case 'GNUDumpDir': if (entry.mode) entry.mode = entry.mode | 0o700 case 'File': case 'OldFile': case 'ContiguousFile': case 'Link': case 'SymbolicLink': return this[CHECKFS](entry) case 'CharacterDevice': case 'BlockDevice': case 'FIFO': return this[UNSUPPORTED](entry) } } [ONERROR] (er, entry) { // Cwd has to exist, or else nothing works. That's serious. // Other errors are warnings, which raise the error in strict // mode, but otherwise continue on. if (er.name === 'CwdError') this.emit('error', er) else { this.warn('TAR_ENTRY_ERROR', er, {entry}) this[UNPEND]() entry.resume() } } [MKDIR] (dir, mode, cb) { mkdir(dir, { uid: this.uid, gid: this.gid, processUid: this.processUid, processGid: this.processGid, umask: this.processUmask, preserve: this.preservePaths, unlink: this.unlink, cache: this.dirCache, cwd: this.cwd, mode: mode }, cb) } [DOCHOWN] (entry) { // in preserve owner mode, chown if the entry doesn't match process // in set owner mode, chown if setting doesn't match process return this.forceChown || this.preserveOwner && ( typeof entry.uid === 'number' && entry.uid !== this.processUid || typeof entry.gid === 'number' && entry.gid !== this.processGid ) || ( typeof this.uid === 'number' && this.uid !== this.processUid || typeof this.gid === 'number' && this.gid !== this.processGid ) } [UID] (entry) { return uint32(this.uid, entry.uid, this.processUid) } [GID] (entry) { return uint32(this.gid, entry.gid, this.processGid) } [FILE] (entry, fullyDone) { const mode = entry.mode & 0o7777 || this.fmode const stream = new fsm.WriteStream(entry.absolute, { flags: getFlag(entry.size), mode: mode, autoClose: false }) stream.on('error', er => this[ONERROR](er, entry)) let actions = 1 const done = er => { if (er) return this[ONERROR](er, entry) if (--actions === 0) { fs.close(stream.fd, er => { fullyDone() er ? this[ONERROR](er, entry) : this[UNPEND]() }) } } stream.on('finish', _ => { // if futimes fails, try utimes // if utimes fails, fail with the original error // same for fchown/chown const abs = entry.absolute const fd = stream.fd if (entry.mtime && !this.noMtime) { actions++ const atime = entry.atime || new Date() const mtime = entry.mtime fs.futimes(fd, atime, mtime, er => er ? fs.utimes(abs, atime, mtime, er2 => done(er2 && er)) : done()) } if (this[DOCHOWN](entry)) { actions++ const uid = this[UID](entry) const gid = this[GID](entry) fs.fchown(fd, uid, gid, er => er ? fs.chown(abs, uid, gid, er2 => done(er2 && er)) : done()) } done() }) const tx = this.transform ? this.transform(entry) || entry : entry if (tx !== entry) { tx.on('error', er => this[ONERROR](er, entry)) entry.pipe(tx) } tx.pipe(stream) } [DIRECTORY] (entry, fullyDone) { const mode = entry.mode & 0o7777 || this.dmode this[MKDIR](entry.absolute, mode, er => { if (er) { fullyDone() return this[ONERROR](er, entry) } let actions = 1 const done = _ => { if (--actions === 0) { fullyDone() this[UNPEND]() entry.resume() } } if (entry.mtime && !this.noMtime) { actions++ fs.utimes(entry.absolute, entry.atime || new Date(), entry.mtime, done) } if (this[DOCHOWN](entry)) { actions++ fs.chown(entry.absolute, this[UID](entry), this[GID](entry), done) } done() }) } [UNSUPPORTED] (entry) { entry.unsupported = true this.warn('TAR_ENTRY_UNSUPPORTED', `unsupported entry type: ${entry.type}`, {entry}) entry.resume() } [SYMLINK] (entry, done) { this[LINK](entry, entry.linkpath, 'symlink', done) } [HARDLINK] (entry, done) { this[LINK](entry, path.resolve(this.cwd, entry.linkpath), 'link', done) } [PEND] () { this[PENDING]++ } [UNPEND] () { this[PENDING]-- this[MAYBECLOSE]() } [SKIP] (entry) { this[UNPEND]() entry.resume() } // Check if we can reuse an existing filesystem entry safely and // overwrite it, rather than unlinking and recreating // Windows doesn't report a useful nlink, so we just never reuse entries [ISREUSABLE] (entry, st) { return entry.type === 'File' && !this.unlink && st.isFile() && st.nlink <= 1 && process.platform !== 'win32' } // check if a thing is there, and if so, try to clobber it [CHECKFS] (entry) { this[PEND]() const paths = [entry.path] if (entry.linkpath) paths.push(entry.linkpath) this.reservations.reserve(paths, done => this[CHECKFS2](entry, done)) } [CHECKFS2] (entry, done) { this[MKDIR](path.dirname(entry.absolute), this.dmode, er => { if (er) { done() return this[ONERROR](er, entry) } fs.lstat(entry.absolute, (er, st) => { if (st && (this.keep || this.newer && st.mtime > entry.mtime)) { this[SKIP](entry) done() } else if (er || this[ISREUSABLE](entry, st)) { this[MAKEFS](null, entry, done) } else if (st.isDirectory()) { if (entry.type === 'Directory') { if (!entry.mode || (st.mode & 0o7777) === entry.mode) this[MAKEFS](null, entry, done) else fs.chmod(entry.absolute, entry.mode, er => this[MAKEFS](er, entry, done)) } else fs.rmdir(entry.absolute, er => this[MAKEFS](er, entry, done)) } else unlinkFile(entry.absolute, er => this[MAKEFS](er, entry, done)) }) }) } [MAKEFS] (er, entry, done) { if (er) return this[ONERROR](er, entry) switch (entry.type) { case 'File': case 'OldFile': case 'ContiguousFile': return this[FILE](entry, done) case 'Link': return this[HARDLINK](entry, done) case 'SymbolicLink': return this[SYMLINK](entry, done) case 'Directory': case 'GNUDumpDir': return this[DIRECTORY](entry, done) } } [LINK] (entry, linkpath, link, done) { // XXX: get the type ('file' or 'dir') for windows fs[link](linkpath, entry.absolute, er => { if (er) return this[ONERROR](er, entry) done() this[UNPEND]() entry.resume() }) } } class UnpackSync extends Unpack { constructor (opt) { super(opt) } [CHECKFS] (entry) { const er = this[MKDIR](path.dirname(entry.absolute), this.dmode, neverCalled) if (er) return this[ONERROR](er, entry) try { const st = fs.lstatSync(entry.absolute) if (this.keep || this.newer && st.mtime > entry.mtime) return this[SKIP](entry) else if (this[ISREUSABLE](entry, st)) return this[MAKEFS](null, entry, neverCalled) else { try { if (st.isDirectory()) { if (entry.type === 'Directory') { if (entry.mode && (st.mode & 0o7777) !== entry.mode) fs.chmodSync(entry.absolute, entry.mode) } else fs.rmdirSync(entry.absolute) } else unlinkFileSync(entry.absolute) return this[MAKEFS](null, entry, neverCalled) } catch (er) { return this[ONERROR](er, entry) } } } catch (er) { return this[MAKEFS](null, entry, neverCalled) } } [FILE] (entry, _) { const mode = entry.mode & 0o7777 || this.fmode const oner = er => { let closeError try { fs.closeSync(fd) } catch (e) { closeError = e } if (er || closeError) this[ONERROR](er || closeError, entry) } let stream let fd try { fd = fs.openSync(entry.absolute, getFlag(entry.size), mode) } catch (er) { return oner(er) } const tx = this.transform ? this.transform(entry) || entry : entry if (tx !== entry) { tx.on('error', er => this[ONERROR](er, entry)) entry.pipe(tx) } tx.on('data', chunk => { try { fs.writeSync(fd, chunk, 0, chunk.length) } catch (er) { oner(er) } }) tx.on('end', _ => { let er = null // try both, falling futimes back to utimes // if either fails, handle the first error if (entry.mtime && !this.noMtime) { const atime = entry.atime || new Date() const mtime = entry.mtime try { fs.futimesSync(fd, atime, mtime) } catch (futimeser) { try { fs.utimesSync(entry.absolute, atime, mtime) } catch (utimeser) { er = futimeser } } } if (this[DOCHOWN](entry)) { const uid = this[UID](entry) const gid = this[GID](entry) try { fs.fchownSync(fd, uid, gid) } catch (fchowner) { try { fs.chownSync(entry.absolute, uid, gid) } catch (chowner) { er = er || fchowner } } } oner(er) }) } [DIRECTORY] (entry, _) { const mode = entry.mode & 0o7777 || this.dmode const er = this[MKDIR](entry.absolute, mode) if (er) return this[ONERROR](er, entry) if (entry.mtime && !this.noMtime) { try { fs.utimesSync(entry.absolute, entry.atime || new Date(), entry.mtime) } catch (er) {} } if (this[DOCHOWN](entry)) { try { fs.chownSync(entry.absolute, this[UID](entry), this[GID](entry)) } catch (er) {} } entry.resume() } [MKDIR] (dir, mode) { try { return mkdir.sync(dir, { uid: this.uid, gid: this.gid, processUid: this.processUid, processGid: this.processGid, umask: this.processUmask, preserve: this.preservePaths, unlink: this.unlink, cache: this.dirCache, cwd: this.cwd, mode: mode }) } catch (er) { return er } } [LINK] (entry, linkpath, link, _) { try { fs[link + 'Sync'](linkpath, entry.absolute) entry.resume() } catch (er) { return this[ONERROR](er, entry) } } } Unpack.Sync = UnpackSync module.exports = Unpack 'use strict' // tar -u const hlo = require('./high-level-opt.js') const r = require('./replace.js') // just call tar.r with the filter and mtimeCache const u = module.exports = (opt_, files, cb) => { const opt = hlo(opt_) if (!opt.file) throw new TypeError('file is required') if (opt.gzip) throw new TypeError('cannot append to compressed archives') if (!files || !Array.isArray(files) || !files.length) throw new TypeError('no files or directories specified') files = Array.from(files) mtimeFilter(opt) return r(opt, files, cb) } const mtimeFilter = opt => { const filter = opt.filter if (!opt.mtimeCache) opt.mtimeCache = new Map() opt.filter = filter ? (path, stat) => filter(path, stat) && !(opt.mtimeCache.get(path) > stat.mtime) : (path, stat) => !(opt.mtimeCache.get(path) > stat.mtime) } 'use strict' module.exports = Base => class extends Base { warn (code, message, data = {}) { if (this.file) data.file = this.file if (this.cwd) data.cwd = this.cwd data.code = message instanceof Error && message.code || code data.tarCode = code if (!this.strict && data.recoverable !== false) { if (message instanceof Error) { data = Object.assign(message, data) message = message.message } this.emit('warn', data.tarCode, message, data) } else if (message instanceof Error) { this.emit('error', Object.assign(message, data)) } else this.emit('error', Object.assign(new Error(`${code}: ${message}`), data)) } } 'use strict' // When writing files on Windows, translate the characters to their // 0xf000 higher-encoded versions. const raw = [ '|', '<', '>', '?', ':' ] const win = raw.map(char => String.fromCharCode(0xf000 + char.charCodeAt(0))) const toWin = new Map(raw.map((char, i) => [char, win[i]])) const toRaw = new Map(win.map((char, i) => [char, raw[i]])) module.exports = { encode: s => raw.reduce((s, c) => s.split(c).join(toWin.get(c)), s), decode: s => win.reduce((s, c) => s.split(c).join(toRaw.get(c)), s) } 'use strict' const MiniPass = require('minipass') const Pax = require('./pax.js') const Header = require('./header.js') const ReadEntry = require('./read-entry.js') const fs = require('fs') const path = require('path') const types = require('./types.js') const maxReadSize = 16 * 1024 * 1024 const PROCESS = Symbol('process') const FILE = Symbol('file') const DIRECTORY = Symbol('directory') const SYMLINK = Symbol('symlink') const HARDLINK = Symbol('hardlink') const HEADER = Symbol('header') const READ = Symbol('read') const LSTAT = Symbol('lstat') const ONLSTAT = Symbol('onlstat') const ONREAD = Symbol('onread') const ONREADLINK = Symbol('onreadlink') const OPENFILE = Symbol('openfile') const ONOPENFILE = Symbol('onopenfile') const CLOSE = Symbol('close') const MODE = Symbol('mode') const warner = require('./warn-mixin.js') const winchars = require('./winchars.js') const modeFix = require('./mode-fix.js') const WriteEntry = warner(class WriteEntry extends MiniPass { constructor (p, opt) { opt = opt || {} super(opt) if (typeof p !== 'string') throw new TypeError('path is required') this.path = p // suppress atime, ctime, uid, gid, uname, gname this.portable = !!opt.portable // until node has builtin pwnam functions, this'll have to do this.myuid = process.getuid && process.getuid() this.myuser = process.env.USER || '' this.maxReadSize = opt.maxReadSize || maxReadSize this.linkCache = opt.linkCache || new Map() this.statCache = opt.statCache || new Map() this.preservePaths = !!opt.preservePaths this.cwd = opt.cwd || process.cwd() this.strict = !!opt.strict this.noPax = !!opt.noPax this.noMtime = !!opt.noMtime this.mtime = opt.mtime || null if (typeof opt.onwarn === 'function') this.on('warn', opt.onwarn) let pathWarn = false if (!this.preservePaths && path.win32.isAbsolute(p)) { // absolutes on posix are also absolutes on win32 // so we only need to test this one to get both const parsed = path.win32.parse(p) this.path = p.substr(parsed.root.length) pathWarn = parsed.root } this.win32 = !!opt.win32 || process.platform === 'win32' if (this.win32) { this.path = winchars.decode(this.path.replace(/\\/g, '/')) p = p.replace(/\\/g, '/') } this.absolute = opt.absolute || path.resolve(this.cwd, p) if (this.path === '') this.path = './' if (pathWarn) { this.warn('TAR_ENTRY_INFO', `stripping ${pathWarn} from absolute path`, { entry: this, path: pathWarn + this.path, }) } if (this.statCache.has(this.absolute)) this[ONLSTAT](this.statCache.get(this.absolute)) else this[LSTAT]() } [LSTAT] () { fs.lstat(this.absolute, (er, stat) => { if (er) return this.emit('error', er) this[ONLSTAT](stat) }) } [ONLSTAT] (stat) { this.statCache.set(this.absolute, stat) this.stat = stat if (!stat.isFile()) stat.size = 0 this.type = getType(stat) this.emit('stat', stat) this[PROCESS]() } [PROCESS] () { switch (this.type) { case 'File': return this[FILE]() case 'Directory': return this[DIRECTORY]() case 'SymbolicLink': return this[SYMLINK]() // unsupported types are ignored. default: return this.end() } } [MODE] (mode) { return modeFix(mode, this.type === 'Directory', this.portable) } [HEADER] () { if (this.type === 'Directory' && this.portable) this.noMtime = true this.header = new Header({ path: this.path, linkpath: this.linkpath, // only the permissions and setuid/setgid/sticky bitflags // not the higher-order bits that specify file type mode: this[MODE](this.stat.mode), uid: this.portable ? null : this.stat.uid, gid: this.portable ? null : this.stat.gid, size: this.stat.size, mtime: this.noMtime ? null : this.mtime || this.stat.mtime, type: this.type, uname: this.portable ? null : this.stat.uid === this.myuid ? this.myuser : '', atime: this.portable ? null : this.stat.atime, ctime: this.portable ? null : this.stat.ctime }) if (this.header.encode() && !this.noPax) this.write(new Pax({ atime: this.portable ? null : this.header.atime, ctime: this.portable ? null : this.header.ctime, gid: this.portable ? null : this.header.gid, mtime: this.noMtime ? null : this.mtime || this.header.mtime, path: this.path, linkpath: this.linkpath, size: this.header.size, uid: this.portable ? null : this.header.uid, uname: this.portable ? null : this.header.uname, dev: this.portable ? null : this.stat.dev, ino: this.portable ? null : this.stat.ino, nlink: this.portable ? null : this.stat.nlink }).encode()) this.write(this.header.block) } [DIRECTORY] () { if (this.path.substr(-1) !== '/') this.path += '/' this.stat.size = 0 this[HEADER]() this.end() } [SYMLINK] () { fs.readlink(this.absolute, (er, linkpath) => { if (er) return this.emit('error', er) this[ONREADLINK](linkpath) }) } [ONREADLINK] (linkpath) { this.linkpath = linkpath.replace(/\\/g, '/') this[HEADER]() this.end() } [HARDLINK] (linkpath) { this.type = 'Link' this.linkpath = path.relative(this.cwd, linkpath).replace(/\\/g, '/') this.stat.size = 0 this[HEADER]() this.end() } [FILE] () { if (this.stat.nlink > 1) { const linkKey = this.stat.dev + ':' + this.stat.ino if (this.linkCache.has(linkKey)) { const linkpath = this.linkCache.get(linkKey) if (linkpath.indexOf(this.cwd) === 0) return this[HARDLINK](linkpath) } this.linkCache.set(linkKey, this.absolute) } this[HEADER]() if (this.stat.size === 0) return this.end() this[OPENFILE]() } [OPENFILE] () { fs.open(this.absolute, 'r', (er, fd) => { if (er) return this.emit('error', er) this[ONOPENFILE](fd) }) } [ONOPENFILE] (fd) { const blockLen = 512 * Math.ceil(this.stat.size / 512) const bufLen = Math.min(blockLen, this.maxReadSize) const buf = Buffer.allocUnsafe(bufLen) this[READ](fd, buf, 0, buf.length, 0, this.stat.size, blockLen) } [READ] (fd, buf, offset, length, pos, remain, blockRemain) { fs.read(fd, buf, offset, length, pos, (er, bytesRead) => { if (er) { // ignoring the error from close(2) is a bad practice, but at // this point we already have an error, don't need another one return this[CLOSE](fd, () => this.emit('error', er)) } this[ONREAD](fd, buf, offset, length, pos, remain, blockRemain, bytesRead) }) } [CLOSE] (fd, cb) { fs.close(fd, cb) } [ONREAD] (fd, buf, offset, length, pos, remain, blockRemain, bytesRead) { if (bytesRead <= 0 && remain > 0) { const er = new Error('encountered unexpected EOF') er.path = this.absolute er.syscall = 'read' er.code = 'EOF' return this[CLOSE](fd, () => this.emit('error', er)) } if (bytesRead > remain) { const er = new Error('did not encounter expected EOF') er.path = this.absolute er.syscall = 'read' er.code = 'EOF' return this[CLOSE](fd, () => this.emit('error', er)) } // null out the rest of the buffer, if we could fit the block padding if (bytesRead === remain) { for (let i = bytesRead; i < length && bytesRead < blockRemain; i++) { buf[i + offset] = 0 bytesRead ++ remain ++ } } const writeBuf = offset === 0 && bytesRead === buf.length ? buf : buf.slice(offset, offset + bytesRead) remain -= bytesRead blockRemain -= bytesRead pos += bytesRead offset += bytesRead this.write(writeBuf) if (!remain) { if (blockRemain) this.write(Buffer.alloc(blockRemain)) return this[CLOSE](fd, er => er ? this.emit('error', er) : this.end()) } if (offset >= length) { buf = Buffer.allocUnsafe(length) offset = 0 } length = buf.length - offset this[READ](fd, buf, offset, length, pos, remain, blockRemain) } }) class WriteEntrySync extends WriteEntry { constructor (path, opt) { super(path, opt) } [LSTAT] () { this[ONLSTAT](fs.lstatSync(this.absolute)) } [SYMLINK] () { this[ONREADLINK](fs.readlinkSync(this.absolute)) } [OPENFILE] () { this[ONOPENFILE](fs.openSync(this.absolute, 'r')) } [READ] (fd, buf, offset, length, pos, remain, blockRemain) { let threw = true try { const bytesRead = fs.readSync(fd, buf, offset, length, pos) this[ONREAD](fd, buf, offset, length, pos, remain, blockRemain, bytesRead) threw = false } finally { // ignoring the error from close(2) is a bad practice, but at // this point we already have an error, don't need another one if (threw) try { this[CLOSE](fd, () => {}) } catch (er) {} } } [CLOSE] (fd, cb) { fs.closeSync(fd) cb() } } const WriteEntryTar = warner(class WriteEntryTar extends MiniPass { constructor (readEntry, opt) { opt = opt || {} super(opt) this.preservePaths = !!opt.preservePaths this.portable = !!opt.portable this.strict = !!opt.strict this.noPax = !!opt.noPax this.noMtime = !!opt.noMtime this.readEntry = readEntry this.type = readEntry.type if (this.type === 'Directory' && this.portable) this.noMtime = true this.path = readEntry.path this.mode = this[MODE](readEntry.mode) this.uid = this.portable ? null : readEntry.uid this.gid = this.portable ? null : readEntry.gid this.uname = this.portable ? null : readEntry.uname this.gname = this.portable ? null : readEntry.gname this.size = readEntry.size this.mtime = this.noMtime ? null : opt.mtime || readEntry.mtime this.atime = this.portable ? null : readEntry.atime this.ctime = this.portable ? null : readEntry.ctime this.linkpath = readEntry.linkpath if (typeof opt.onwarn === 'function') this.on('warn', opt.onwarn) let pathWarn = false if (path.isAbsolute(this.path) && !this.preservePaths) { const parsed = path.parse(this.path) pathWarn = parsed.root this.path = this.path.substr(parsed.root.length) } this.remain = readEntry.size this.blockRemain = readEntry.startBlockSize this.header = new Header({ path: this.path, linkpath: this.linkpath, // only the permissions and setuid/setgid/sticky bitflags // not the higher-order bits that specify file type mode: this.mode, uid: this.portable ? null : this.uid, gid: this.portable ? null : this.gid, size: this.size, mtime: this.noMtime ? null : this.mtime, type: this.type, uname: this.portable ? null : this.uname, atime: this.portable ? null : this.atime, ctime: this.portable ? null : this.ctime }) if (pathWarn) { this.warn('TAR_ENTRY_INFO', `stripping ${pathWarn} from absolute path`, { entry: this, path: pathWarn + this.path, }) } if (this.header.encode() && !this.noPax) super.write(new Pax({ atime: this.portable ? null : this.atime, ctime: this.portable ? null : this.ctime, gid: this.portable ? null : this.gid, mtime: this.noMtime ? null : this.mtime, path: this.path, linkpath: this.linkpath, size: this.size, uid: this.portable ? null : this.uid, uname: this.portable ? null : this.uname, dev: this.portable ? null : this.readEntry.dev, ino: this.portable ? null : this.readEntry.ino, nlink: this.portable ? null : this.readEntry.nlink }).encode()) super.write(this.header.block) readEntry.pipe(this) } [MODE] (mode) { return modeFix(mode, this.type === 'Directory', this.portable) } write (data) { const writeLen = data.length if (writeLen > this.blockRemain) throw new Error('writing more to entry than is appropriate') this.blockRemain -= writeLen return super.write(data) } end () { if (this.blockRemain) this.write(Buffer.alloc(this.blockRemain)) return super.end() } }) WriteEntry.Sync = WriteEntrySync WriteEntry.Tar = WriteEntryTar const getType = stat => stat.isFile() ? 'File' : stat.isDirectory() ? 'Directory' : stat.isSymbolicLink() ? 'SymbolicLink' : 'Unsupported' module.exports = WriteEntry ## 7.0 - Raise error if `options.cwd` is specified, and not a directory ## 6.0 - Remove comment and negation pattern support - Ignore patterns are always in `dot:true` mode ## 5.0 - Deprecate comment and negation patterns - Fix regression in `mark` and `nodir` options from making all cache keys absolute path. - Abort if `fs.readdir` returns an error that's unexpected - Don't emit `match` events for ignored items - Treat ENOTSUP like ENOTDIR in readdir ## 4.5 - Add `options.follow` to always follow directory symlinks in globstar - Add `options.realpath` to call `fs.realpath` on all results - Always cache based on absolute path ## 4.4 - Add `options.ignore` - Fix handling of broken symlinks ## 4.3 - Bump minimatch to 2.x - Pass all tests on Windows ## 4.2 - Add `glob.hasMagic` function - Add `options.nodir` flag ## 4.1 - Refactor sync and async implementations for performance - Throw if callback provided to sync glob function - Treat symbolic links in globstar results the same as Bash 4.3 ## 4.0 - Use `^` for dependency versions (bumped major because this breaks older npm versions) - Ensure callbacks are only ever called once - switch to ISC license ## 3.x - Rewrite in JavaScript - Add support for setting root, cwd, and windows support - Cache many fs calls - Add globstar support - emit match events ## 2.x - Use `glob.h` and `fnmatch.h` from NetBSD ## 1.x - `glob.h` static binding. exports.setopts = setopts exports.ownProp = ownProp exports.makeAbs = makeAbs exports.finish = finish exports.mark = mark exports.isIgnored = isIgnored exports.childrenIgnored = childrenIgnored function ownProp (obj, field) { return Object.prototype.hasOwnProperty.call(obj, field) } var path = require("path") var minimatch = require("minimatch") var isAbsolute = require("path-is-absolute") var Minimatch = minimatch.Minimatch function alphasort (a, b) { return a.localeCompare(b, 'en') } function setupIgnores (self, options) { self.ignore = options.ignore || [] if (!Array.isArray(self.ignore)) self.ignore = [self.ignore] if (self.ignore.length) { self.ignore = self.ignore.map(ignoreMap) } } // ignore patterns are always in dot:true mode. function ignoreMap (pattern) { var gmatcher = null if (pattern.slice(-3) === '/**') { var gpattern = pattern.replace(/(\/\*\*)+$/, '') gmatcher = new Minimatch(gpattern, { dot: true }) } return { matcher: new Minimatch(pattern, { dot: true }), gmatcher: gmatcher } } function setopts (self, pattern, options) { if (!options) options = {} // base-matching: just use globstar for that. if (options.matchBase && -1 === pattern.indexOf("/")) { if (options.noglobstar) { throw new Error("base matching requires globstar") } pattern = "**/" + pattern } self.silent = !!options.silent self.pattern = pattern self.strict = options.strict !== false self.realpath = !!options.realpath self.realpathCache = options.realpathCache || Object.create(null) self.follow = !!options.follow self.dot = !!options.dot self.mark = !!options.mark self.nodir = !!options.nodir if (self.nodir) self.mark = true self.sync = !!options.sync self.nounique = !!options.nounique self.nonull = !!options.nonull self.nosort = !!options.nosort self.nocase = !!options.nocase self.stat = !!options.stat self.noprocess = !!options.noprocess self.absolute = !!options.absolute self.maxLength = options.maxLength || Infinity self.cache = options.cache || Object.create(null) self.statCache = options.statCache || Object.create(null) self.symlinks = options.symlinks || Object.create(null) setupIgnores(self, options) self.changedCwd = false var cwd = process.cwd() if (!ownProp(options, "cwd")) self.cwd = cwd else { self.cwd = path.resolve(options.cwd) self.changedCwd = self.cwd !== cwd } self.root = options.root || path.resolve(self.cwd, "/") self.root = path.resolve(self.root) if (process.platform === "win32") self.root = self.root.replace(/\\/g, "/") // TODO: is an absolute `cwd` supposed to be resolved against `root`? // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) if (process.platform === "win32") self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") self.nomount = !!options.nomount // disable comments and negation in Minimatch. // Note that they are not supported in Glob itself anyway. options.nonegate = true options.nocomment = true self.minimatch = new Minimatch(pattern, options) self.options = self.minimatch.options } function finish (self) { var nou = self.nounique var all = nou ? [] : Object.create(null) for (var i = 0, l = self.matches.length; i < l; i ++) { var matches = self.matches[i] if (!matches || Object.keys(matches).length === 0) { if (self.nonull) { // do like the shell, and spit out the literal glob var literal = self.minimatch.globSet[i] if (nou) all.push(literal) else all[literal] = true } } else { // had matches var m = Object.keys(matches) if (nou) all.push.apply(all, m) else m.forEach(function (m) { all[m] = true }) } } if (!nou) all = Object.keys(all) if (!self.nosort) all = all.sort(alphasort) // at *some* point we statted all of these if (self.mark) { for (var i = 0; i < all.length; i++) { all[i] = self._mark(all[i]) } if (self.nodir) { all = all.filter(function (e) { var notDir = !(/\/$/.test(e)) var c = self.cache[e] || self.cache[makeAbs(self, e)] if (notDir && c) notDir = c !== 'DIR' && !Array.isArray(c) return notDir }) } } if (self.ignore.length) all = all.filter(function(m) { return !isIgnored(self, m) }) self.found = all } function mark (self, p) { var abs = makeAbs(self, p) var c = self.cache[abs] var m = p if (c) { var isDir = c === 'DIR' || Array.isArray(c) var slash = p.slice(-1) === '/' if (isDir && !slash) m += '/' else if (!isDir && slash) m = m.slice(0, -1) if (m !== p) { var mabs = makeAbs(self, m) self.statCache[mabs] = self.statCache[abs] self.cache[mabs] = self.cache[abs] } } return m } // lotta situps... function makeAbs (self, f) { var abs = f if (f.charAt(0) === '/') { abs = path.join(self.root, f) } else if (isAbsolute(f) || f === '') { abs = f } else if (self.changedCwd) { abs = path.resolve(self.cwd, f) } else { abs = path.resolve(f) } if (process.platform === 'win32') abs = abs.replace(/\\/g, '/') return abs } // Return true, if pattern ends with globstar '**', for the accompanying parent directory. // Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents function isIgnored (self, path) { if (!self.ignore.length) return false return self.ignore.some(function(item) { return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) }) } function childrenIgnored (self, path) { if (!self.ignore.length) return false return self.ignore.some(function(item) { return !!(item.gmatcher && item.gmatcher.match(path)) }) } // Approach: // // 1. Get the minimatch set // 2. For each pattern in the set, PROCESS(pattern, false) // 3. Store matches per-set, then uniq them // // PROCESS(pattern, inGlobStar) // Get the first [n] items from pattern that are all strings // Join these together. This is PREFIX. // If there is no more remaining, then stat(PREFIX) and // add to matches if it succeeds. END. // // If inGlobStar and PREFIX is symlink and points to dir // set ENTRIES = [] // else readdir(PREFIX) as ENTRIES // If fail, END // // with ENTRIES // If pattern[n] is GLOBSTAR // // handle the case where the globstar match is empty // // by pruning it out, and testing the resulting pattern // PROCESS(pattern[0..n] + pattern[n+1 .. $], false) // // handle other cases. // for ENTRY in ENTRIES (not dotfiles) // // attach globstar + tail onto the entry // // Mark that this entry is a globstar match // PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) // // else // not globstar // for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) // Test ENTRY against pattern[n] // If fails, continue // If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) // // Caveat: // Cache all stats and readdirs results to minimize syscall. Since all // we ever care about is existence and directory-ness, we can just keep // `true` for files, and [children,...] for directories, or `false` for // things that don't exist. module.exports = glob var fs = require('fs') var rp = require('fs.realpath') var minimatch = require('minimatch') var Minimatch = minimatch.Minimatch var inherits = require('inherits') var EE = require('events').EventEmitter var path = require('path') var assert = require('assert') var isAbsolute = require('path-is-absolute') var globSync = require('./sync.js') var common = require('./common.js') var setopts = common.setopts var ownProp = common.ownProp var inflight = require('inflight') var util = require('util') var childrenIgnored = common.childrenIgnored var isIgnored = common.isIgnored var once = require('once') function glob (pattern, options, cb) { if (typeof options === 'function') cb = options, options = {} if (!options) options = {} if (options.sync) { if (cb) throw new TypeError('callback provided to sync glob') return globSync(pattern, options) } return new Glob(pattern, options, cb) } glob.sync = globSync var GlobSync = glob.GlobSync = globSync.GlobSync // old api surface glob.glob = glob function extend (origin, add) { if (add === null || typeof add !== 'object') { return origin } var keys = Object.keys(add) var i = keys.length while (i--) { origin[keys[i]] = add[keys[i]] } return origin } glob.hasMagic = function (pattern, options_) { var options = extend({}, options_) options.noprocess = true var g = new Glob(pattern, options) var set = g.minimatch.set if (!pattern) return false if (set.length > 1) return true for (var j = 0; j < set[0].length; j++) { if (typeof set[0][j] !== 'string') return true } return false } glob.Glob = Glob inherits(Glob, EE) function Glob (pattern, options, cb) { if (typeof options === 'function') { cb = options options = null } if (options && options.sync) { if (cb) throw new TypeError('callback provided to sync glob') return new GlobSync(pattern, options) } if (!(this instanceof Glob)) return new Glob(pattern, options, cb) setopts(this, pattern, options) this._didRealPath = false // process each pattern in the minimatch set var n = this.minimatch.set.length // The matches are stored as {: true,...} so that // duplicates are automagically pruned. // Later, we do an Object.keys() on these. // Keep them as a list so we can fill in when nonull is set. this.matches = new Array(n) if (typeof cb === 'function') { cb = once(cb) this.on('error', cb) this.on('end', function (matches) { cb(null, matches) }) } var self = this this._processing = 0 this._emitQueue = [] this._processQueue = [] this.paused = false if (this.noprocess) return this if (n === 0) return done() var sync = true for (var i = 0; i < n; i ++) { this._process(this.minimatch.set[i], i, false, done) } sync = false function done () { --self._processing if (self._processing <= 0) { if (sync) { process.nextTick(function () { self._finish() }) } else { self._finish() } } } } Glob.prototype._finish = function () { assert(this instanceof Glob) if (this.aborted) return if (this.realpath && !this._didRealpath) return this._realpath() common.finish(this) this.emit('end', this.found) } Glob.prototype._realpath = function () { if (this._didRealpath) return this._didRealpath = true var n = this.matches.length if (n === 0) return this._finish() var self = this for (var i = 0; i < this.matches.length; i++) this._realpathSet(i, next) function next () { if (--n === 0) self._finish() } } Glob.prototype._realpathSet = function (index, cb) { var matchset = this.matches[index] if (!matchset) return cb() var found = Object.keys(matchset) var self = this var n = found.length if (n === 0) return cb() var set = this.matches[index] = Object.create(null) found.forEach(function (p, i) { // If there's a problem with the stat, then it means that // one or more of the links in the realpath couldn't be // resolved. just return the abs value in that case. p = self._makeAbs(p) rp.realpath(p, self.realpathCache, function (er, real) { if (!er) set[real] = true else if (er.syscall === 'stat') set[p] = true else self.emit('error', er) // srsly wtf right here if (--n === 0) { self.matches[index] = set cb() } }) }) } Glob.prototype._mark = function (p) { return common.mark(this, p) } Glob.prototype._makeAbs = function (f) { return common.makeAbs(this, f) } Glob.prototype.abort = function () { this.aborted = true this.emit('abort') } Glob.prototype.pause = function () { if (!this.paused) { this.paused = true this.emit('pause') } } Glob.prototype.resume = function () { if (this.paused) { this.emit('resume') this.paused = false if (this._emitQueue.length) { var eq = this._emitQueue.slice(0) this._emitQueue.length = 0 for (var i = 0; i < eq.length; i ++) { var e = eq[i] this._emitMatch(e[0], e[1]) } } if (this._processQueue.length) { var pq = this._processQueue.slice(0) this._processQueue.length = 0 for (var i = 0; i < pq.length; i ++) { var p = pq[i] this._processing-- this._process(p[0], p[1], p[2], p[3]) } } } } Glob.prototype._process = function (pattern, index, inGlobStar, cb) { assert(this instanceof Glob) assert(typeof cb === 'function') if (this.aborted) return this._processing++ if (this.paused) { this._processQueue.push([pattern, index, inGlobStar, cb]) return } //console.error('PROCESS %d', this._processing, pattern) // Get the first [n] parts of pattern that are all strings. var n = 0 while (typeof pattern[n] === 'string') { n ++ } // now n is the index of the first one that is *not* a string. // see if there's anything else var prefix switch (n) { // if not, then this is rather simple case pattern.length: this._processSimple(pattern.join('/'), index, cb) return case 0: // pattern *starts* with some non-trivial item. // going to readdir(cwd), but not include the prefix in matches. prefix = null break default: // pattern has some string bits in the front. // whatever it starts with, whether that's 'absolute' like /foo/bar, // or 'relative' like '../baz' prefix = pattern.slice(0, n).join('/') break } var remain = pattern.slice(n) // get the list of entries. var read if (prefix === null) read = '.' else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { if (!prefix || !isAbsolute(prefix)) prefix = '/' + prefix read = prefix } else read = prefix var abs = this._makeAbs(read) //if ignored, skip _processing if (childrenIgnored(this, read)) return cb() var isGlobStar = remain[0] === minimatch.GLOBSTAR if (isGlobStar) this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) else this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) } Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { var self = this this._readdir(abs, inGlobStar, function (er, entries) { return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) }) } Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { // if the abs isn't a dir, then nothing can match! if (!entries) return cb() // It will only match dot entries if it starts with a dot, or if // dot is set. Stuff like @(.foo|.bar) isn't allowed. var pn = remain[0] var negate = !!this.minimatch.negate var rawGlob = pn._glob var dotOk = this.dot || rawGlob.charAt(0) === '.' var matchedEntries = [] for (var i = 0; i < entries.length; i++) { var e = entries[i] if (e.charAt(0) !== '.' || dotOk) { var m if (negate && !prefix) { m = !e.match(pn) } else { m = e.match(pn) } if (m) matchedEntries.push(e) } } //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) var len = matchedEntries.length // If there are no matched entries, then nothing matches. if (len === 0) return cb() // if this is the last remaining pattern bit, then no need for // an additional stat *unless* the user has specified mark or // stat explicitly. We know they exist, since readdir returned // them. if (remain.length === 1 && !this.mark && !this.stat) { if (!this.matches[index]) this.matches[index] = Object.create(null) for (var i = 0; i < len; i ++) { var e = matchedEntries[i] if (prefix) { if (prefix !== '/') e = prefix + '/' + e else e = prefix + e } if (e.charAt(0) === '/' && !this.nomount) { e = path.join(this.root, e) } this._emitMatch(index, e) } // This was the last one, and no stats were needed return cb() } // now test all matched entries as stand-ins for that part // of the pattern. remain.shift() for (var i = 0; i < len; i ++) { var e = matchedEntries[i] var newPattern if (prefix) { if (prefix !== '/') e = prefix + '/' + e else e = prefix + e } this._process([e].concat(remain), index, inGlobStar, cb) } cb() } Glob.prototype._emitMatch = function (index, e) { if (this.aborted) return if (isIgnored(this, e)) return if (this.paused) { this._emitQueue.push([index, e]) return } var abs = isAbsolute(e) ? e : this._makeAbs(e) if (this.mark) e = this._mark(e) if (this.absolute) e = abs if (this.matches[index][e]) return if (this.nodir) { var c = this.cache[abs] if (c === 'DIR' || Array.isArray(c)) return } this.matches[index][e] = true var st = this.statCache[abs] if (st) this.emit('stat', e, st) this.emit('match', e) } Glob.prototype._readdirInGlobStar = function (abs, cb) { if (this.aborted) return // follow all symlinked directories forever // just proceed as if this is a non-globstar situation if (this.follow) return this._readdir(abs, false, cb) var lstatkey = 'lstat\0' + abs var self = this var lstatcb = inflight(lstatkey, lstatcb_) if (lstatcb) fs.lstat(abs, lstatcb) function lstatcb_ (er, lstat) { if (er && er.code === 'ENOENT') return cb() var isSym = lstat && lstat.isSymbolicLink() self.symlinks[abs] = isSym // If it's not a symlink or a dir, then it's definitely a regular file. // don't bother doing a readdir in that case. if (!isSym && lstat && !lstat.isDirectory()) { self.cache[abs] = 'FILE' cb() } else self._readdir(abs, false, cb) } } Glob.prototype._readdir = function (abs, inGlobStar, cb) { if (this.aborted) return cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) if (!cb) return //console.error('RD %j %j', +inGlobStar, abs) if (inGlobStar && !ownProp(this.symlinks, abs)) return this._readdirInGlobStar(abs, cb) if (ownProp(this.cache, abs)) { var c = this.cache[abs] if (!c || c === 'FILE') return cb() if (Array.isArray(c)) return cb(null, c) } var self = this fs.readdir(abs, readdirCb(this, abs, cb)) } function readdirCb (self, abs, cb) { return function (er, entries) { if (er) self._readdirError(abs, er, cb) else self._readdirEntries(abs, entries, cb) } } Glob.prototype._readdirEntries = function (abs, entries, cb) { if (this.aborted) return // if we haven't asked to stat everything, then just // assume that everything in there exists, so we can avoid // having to stat it a second time. if (!this.mark && !this.stat) { for (var i = 0; i < entries.length; i ++) { var e = entries[i] if (abs === '/') e = abs + e else e = abs + '/' + e this.cache[e] = true } } this.cache[abs] = entries return cb(null, entries) } Glob.prototype._readdirError = function (f, er, cb) { if (this.aborted) return // handle errors, and cache the information switch (er.code) { case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 case 'ENOTDIR': // totally normal. means it *does* exist. var abs = this._makeAbs(f) this.cache[abs] = 'FILE' if (abs === this.cwdAbs) { var error = new Error(er.code + ' invalid cwd ' + this.cwd) error.path = this.cwd error.code = er.code this.emit('error', error) this.abort() } break case 'ENOENT': // not terribly unusual case 'ELOOP': case 'ENAMETOOLONG': case 'UNKNOWN': this.cache[this._makeAbs(f)] = false break default: // some unusual error. Treat as failure. this.cache[this._makeAbs(f)] = false if (this.strict) { this.emit('error', er) // If the error is handled, then we abort // if not, we threw out of here this.abort() } if (!this.silent) console.error('glob error', er) break } return cb() } Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { var self = this this._readdir(abs, inGlobStar, function (er, entries) { self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) }) } Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { //console.error('pgs2', prefix, remain[0], entries) // no entries means not a dir, so it can never have matches // foo.txt/** doesn't match foo.txt if (!entries) return cb() // test without the globstar, and with every child both below // and replacing the globstar. var remainWithoutGlobStar = remain.slice(1) var gspref = prefix ? [ prefix ] : [] var noGlobStar = gspref.concat(remainWithoutGlobStar) // the noGlobStar pattern exits the inGlobStar state this._process(noGlobStar, index, false, cb) var isSym = this.symlinks[abs] var len = entries.length // If it's a symlink, and we're in a globstar, then stop if (isSym && inGlobStar) return cb() for (var i = 0; i < len; i++) { var e = entries[i] if (e.charAt(0) === '.' && !this.dot) continue // these two cases enter the inGlobStar state var instead = gspref.concat(entries[i], remainWithoutGlobStar) this._process(instead, index, true, cb) var below = gspref.concat(entries[i], remain) this._process(below, index, true, cb) } cb() } Glob.prototype._processSimple = function (prefix, index, cb) { // XXX review this. Shouldn't it be doing the mounting etc // before doing stat? kinda weird? var self = this this._stat(prefix, function (er, exists) { self._processSimple2(prefix, index, er, exists, cb) }) } Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { //console.error('ps2', prefix, exists) if (!this.matches[index]) this.matches[index] = Object.create(null) // If it doesn't exist, then just mark the lack of results if (!exists) return cb() if (prefix && isAbsolute(prefix) && !this.nomount) { var trail = /[\/\\]$/.test(prefix) if (prefix.charAt(0) === '/') { prefix = path.join(this.root, prefix) } else { prefix = path.resolve(this.root, prefix) if (trail) prefix += '/' } } if (process.platform === 'win32') prefix = prefix.replace(/\\/g, '/') // Mark this as a match this._emitMatch(index, prefix) cb() } // Returns either 'DIR', 'FILE', or false Glob.prototype._stat = function (f, cb) { var abs = this._makeAbs(f) var needDir = f.slice(-1) === '/' if (f.length > this.maxLength) return cb() if (!this.stat && ownProp(this.cache, abs)) { var c = this.cache[abs] if (Array.isArray(c)) c = 'DIR' // It exists, but maybe not how we need it if (!needDir || c === 'DIR') return cb(null, c) if (needDir && c === 'FILE') return cb() // otherwise we have to stat, because maybe c=true // if we know it exists, but not what it is. } var exists var stat = this.statCache[abs] if (stat !== undefined) { if (stat === false) return cb(null, stat) else { var type = stat.isDirectory() ? 'DIR' : 'FILE' if (needDir && type === 'FILE') return cb() else return cb(null, type, stat) } } var self = this var statcb = inflight('stat\0' + abs, lstatcb_) if (statcb) fs.lstat(abs, statcb) function lstatcb_ (er, lstat) { if (lstat && lstat.isSymbolicLink()) { // If it's a symlink, then treat it as the target, unless // the target does not exist, then treat it as a file. return fs.stat(abs, function (er, stat) { if (er) self._stat2(f, abs, null, lstat, cb) else self._stat2(f, abs, er, stat, cb) }) } else { self._stat2(f, abs, er, lstat, cb) } } } Glob.prototype._stat2 = function (f, abs, er, stat, cb) { if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { this.statCache[abs] = false return cb() } var needDir = f.slice(-1) === '/' this.statCache[abs] = stat if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) return cb(null, false, stat) var c = true if (stat) c = stat.isDirectory() ? 'DIR' : 'FILE' this.cache[abs] = this.cache[abs] || c if (needDir && c === 'FILE') return cb() return cb(null, c, stat) } The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ## Glob Logo Glob's logo created by Tanya Brassie , licensed under a Creative Commons Attribution-ShareAlike 4.0 International License https://creativecommons.org/licenses/by-sa/4.0/ { "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "name": "glob", "description": "a little globber", "version": "7.1.7", "repository": { "type": "git", "url": "git://github.com/isaacs/node-glob.git" }, "main": "glob.js", "files": [ "glob.js", "sync.js", "common.js" ], "engines": { "node": "*" }, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, "devDependencies": { "mkdirp": "0", "rimraf": "^2.2.8", "tap": "^15.0.6", "tick": "0.0.6" }, "tap": { "before": "test/00-setup.js", "after": "test/zz-cleanup.js", "jobs": 1 }, "scripts": { "prepublish": "npm run benchclean", "profclean": "rm -f v8.log profile.txt", "test": "tap", "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js", "bench": "bash benchmark.sh", "prof": "bash prof.sh && cat profile.txt", "benchclean": "node benchclean.js" }, "license": "ISC", "funding": { "url": "https://github.com/sponsors/isaacs" } } module.exports = globSync globSync.GlobSync = GlobSync var fs = require('fs') var rp = require('fs.realpath') var minimatch = require('minimatch') var Minimatch = minimatch.Minimatch var Glob = require('./glob.js').Glob var util = require('util') var path = require('path') var assert = require('assert') var isAbsolute = require('path-is-absolute') var common = require('./common.js') var setopts = common.setopts var ownProp = common.ownProp var childrenIgnored = common.childrenIgnored var isIgnored = common.isIgnored function globSync (pattern, options) { if (typeof options === 'function' || arguments.length === 3) throw new TypeError('callback provided to sync glob\n'+ 'See: https://github.com/isaacs/node-glob/issues/167') return new GlobSync(pattern, options).found } function GlobSync (pattern, options) { if (!pattern) throw new Error('must provide pattern') if (typeof options === 'function' || arguments.length === 3) throw new TypeError('callback provided to sync glob\n'+ 'See: https://github.com/isaacs/node-glob/issues/167') if (!(this instanceof GlobSync)) return new GlobSync(pattern, options) setopts(this, pattern, options) if (this.noprocess) return this var n = this.minimatch.set.length this.matches = new Array(n) for (var i = 0; i < n; i ++) { this._process(this.minimatch.set[i], i, false) } this._finish() } GlobSync.prototype._finish = function () { assert(this instanceof GlobSync) if (this.realpath) { var self = this this.matches.forEach(function (matchset, index) { var set = self.matches[index] = Object.create(null) for (var p in matchset) { try { p = self._makeAbs(p) var real = rp.realpathSync(p, self.realpathCache) set[real] = true } catch (er) { if (er.syscall === 'stat') set[self._makeAbs(p)] = true else throw er } } }) } common.finish(this) } GlobSync.prototype._process = function (pattern, index, inGlobStar) { assert(this instanceof GlobSync) // Get the first [n] parts of pattern that are all strings. var n = 0 while (typeof pattern[n] === 'string') { n ++ } // now n is the index of the first one that is *not* a string. // See if there's anything else var prefix switch (n) { // if not, then this is rather simple case pattern.length: this._processSimple(pattern.join('/'), index) return case 0: // pattern *starts* with some non-trivial item. // going to readdir(cwd), but not include the prefix in matches. prefix = null break default: // pattern has some string bits in the front. // whatever it starts with, whether that's 'absolute' like /foo/bar, // or 'relative' like '../baz' prefix = pattern.slice(0, n).join('/') break } var remain = pattern.slice(n) // get the list of entries. var read if (prefix === null) read = '.' else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { if (!prefix || !isAbsolute(prefix)) prefix = '/' + prefix read = prefix } else read = prefix var abs = this._makeAbs(read) //if ignored, skip processing if (childrenIgnored(this, read)) return var isGlobStar = remain[0] === minimatch.GLOBSTAR if (isGlobStar) this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) else this._processReaddir(prefix, read, abs, remain, index, inGlobStar) } GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { var entries = this._readdir(abs, inGlobStar) // if the abs isn't a dir, then nothing can match! if (!entries) return // It will only match dot entries if it starts with a dot, or if // dot is set. Stuff like @(.foo|.bar) isn't allowed. var pn = remain[0] var negate = !!this.minimatch.negate var rawGlob = pn._glob var dotOk = this.dot || rawGlob.charAt(0) === '.' var matchedEntries = [] for (var i = 0; i < entries.length; i++) { var e = entries[i] if (e.charAt(0) !== '.' || dotOk) { var m if (negate && !prefix) { m = !e.match(pn) } else { m = e.match(pn) } if (m) matchedEntries.push(e) } } var len = matchedEntries.length // If there are no matched entries, then nothing matches. if (len === 0) return // if this is the last remaining pattern bit, then no need for // an additional stat *unless* the user has specified mark or // stat explicitly. We know they exist, since readdir returned // them. if (remain.length === 1 && !this.mark && !this.stat) { if (!this.matches[index]) this.matches[index] = Object.create(null) for (var i = 0; i < len; i ++) { var e = matchedEntries[i] if (prefix) { if (prefix.slice(-1) !== '/') e = prefix + '/' + e else e = prefix + e } if (e.charAt(0) === '/' && !this.nomount) { e = path.join(this.root, e) } this._emitMatch(index, e) } // This was the last one, and no stats were needed return } // now test all matched entries as stand-ins for that part // of the pattern. remain.shift() for (var i = 0; i < len; i ++) { var e = matchedEntries[i] var newPattern if (prefix) newPattern = [prefix, e] else newPattern = [e] this._process(newPattern.concat(remain), index, inGlobStar) } } GlobSync.prototype._emitMatch = function (index, e) { if (isIgnored(this, e)) return var abs = this._makeAbs(e) if (this.mark) e = this._mark(e) if (this.absolute) { e = abs } if (this.matches[index][e]) return if (this.nodir) { var c = this.cache[abs] if (c === 'DIR' || Array.isArray(c)) return } this.matches[index][e] = true if (this.stat) this._stat(e) } GlobSync.prototype._readdirInGlobStar = function (abs) { // follow all symlinked directories forever // just proceed as if this is a non-globstar situation if (this.follow) return this._readdir(abs, false) var entries var lstat var stat try { lstat = fs.lstatSync(abs) } catch (er) { if (er.code === 'ENOENT') { // lstat failed, doesn't exist return null } } var isSym = lstat && lstat.isSymbolicLink() this.symlinks[abs] = isSym // If it's not a symlink or a dir, then it's definitely a regular file. // don't bother doing a readdir in that case. if (!isSym && lstat && !lstat.isDirectory()) this.cache[abs] = 'FILE' else entries = this._readdir(abs, false) return entries } GlobSync.prototype._readdir = function (abs, inGlobStar) { var entries if (inGlobStar && !ownProp(this.symlinks, abs)) return this._readdirInGlobStar(abs) if (ownProp(this.cache, abs)) { var c = this.cache[abs] if (!c || c === 'FILE') return null if (Array.isArray(c)) return c } try { return this._readdirEntries(abs, fs.readdirSync(abs)) } catch (er) { this._readdirError(abs, er) return null } } GlobSync.prototype._readdirEntries = function (abs, entries) { // if we haven't asked to stat everything, then just // assume that everything in there exists, so we can avoid // having to stat it a second time. if (!this.mark && !this.stat) { for (var i = 0; i < entries.length; i ++) { var e = entries[i] if (abs === '/') e = abs + e else e = abs + '/' + e this.cache[e] = true } } this.cache[abs] = entries // mark and cache dir-ness return entries } GlobSync.prototype._readdirError = function (f, er) { // handle errors, and cache the information switch (er.code) { case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 case 'ENOTDIR': // totally normal. means it *does* exist. var abs = this._makeAbs(f) this.cache[abs] = 'FILE' if (abs === this.cwdAbs) { var error = new Error(er.code + ' invalid cwd ' + this.cwd) error.path = this.cwd error.code = er.code throw error } break case 'ENOENT': // not terribly unusual case 'ELOOP': case 'ENAMETOOLONG': case 'UNKNOWN': this.cache[this._makeAbs(f)] = false break default: // some unusual error. Treat as failure. this.cache[this._makeAbs(f)] = false if (this.strict) throw er if (!this.silent) console.error('glob error', er) break } } GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { var entries = this._readdir(abs, inGlobStar) // no entries means not a dir, so it can never have matches // foo.txt/** doesn't match foo.txt if (!entries) return // test without the globstar, and with every child both below // and replacing the globstar. var remainWithoutGlobStar = remain.slice(1) var gspref = prefix ? [ prefix ] : [] var noGlobStar = gspref.concat(remainWithoutGlobStar) // the noGlobStar pattern exits the inGlobStar state this._process(noGlobStar, index, false) var len = entries.length var isSym = this.symlinks[abs] // If it's a symlink, and we're in a globstar, then stop if (isSym && inGlobStar) return for (var i = 0; i < len; i++) { var e = entries[i] if (e.charAt(0) === '.' && !this.dot) continue // these two cases enter the inGlobStar state var instead = gspref.concat(entries[i], remainWithoutGlobStar) this._process(instead, index, true) var below = gspref.concat(entries[i], remain) this._process(below, index, true) } } GlobSync.prototype._processSimple = function (prefix, index) { // XXX review this. Shouldn't it be doing the mounting etc // before doing stat? kinda weird? var exists = this._stat(prefix) if (!this.matches[index]) this.matches[index] = Object.create(null) // If it doesn't exist, then just mark the lack of results if (!exists) return if (prefix && isAbsolute(prefix) && !this.nomount) { var trail = /[\/\\]$/.test(prefix) if (prefix.charAt(0) === '/') { prefix = path.join(this.root, prefix) } else { prefix = path.resolve(this.root, prefix) if (trail) prefix += '/' } } if (process.platform === 'win32') prefix = prefix.replace(/\\/g, '/') // Mark this as a match this._emitMatch(index, prefix) } // Returns either 'DIR', 'FILE', or false GlobSync.prototype._stat = function (f) { var abs = this._makeAbs(f) var needDir = f.slice(-1) === '/' if (f.length > this.maxLength) return false if (!this.stat && ownProp(this.cache, abs)) { var c = this.cache[abs] if (Array.isArray(c)) c = 'DIR' // It exists, but maybe not how we need it if (!needDir || c === 'DIR') return c if (needDir && c === 'FILE') return false // otherwise we have to stat, because maybe c=true // if we know it exists, but not what it is. } var exists var stat = this.statCache[abs] if (!stat) { var lstat try { lstat = fs.lstatSync(abs) } catch (er) { if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { this.statCache[abs] = false return false } } if (lstat && lstat.isSymbolicLink()) { try { stat = fs.statSync(abs) } catch (er) { stat = lstat } } else { stat = lstat } } this.statCache[abs] = stat var c = true if (stat) c = stat.isDirectory() ? 'DIR' : 'FILE' this.cache[abs] = this.cache[abs] || c if (needDir && c === 'FILE') return false return c } GlobSync.prototype._mark = function (p) { return common.mark(this, p) } GlobSync.prototype._makeAbs = function (f) { return common.makeAbs(this, f) } 'use strict' // These tables borrowed from `ansi` var prefix = '\x1b[' exports.up = function up (num) { return prefix + (num || '') + 'A' } exports.down = function down (num) { return prefix + (num || '') + 'B' } exports.forward = function forward (num) { return prefix + (num || '') + 'C' } exports.back = function back (num) { return prefix + (num || '') + 'D' } exports.nextLine = function nextLine (num) { return prefix + (num || '') + 'E' } exports.previousLine = function previousLine (num) { return prefix + (num || '') + 'F' } exports.horizontalAbsolute = function horizontalAbsolute (num) { if (num == null) throw new Error('horizontalAboslute requires a column to position to') return prefix + num + 'G' } exports.eraseData = function eraseData () { return prefix + 'J' } exports.eraseLine = function eraseLine () { return prefix + 'K' } exports.goto = function (x, y) { return prefix + y + ';' + x + 'H' } exports.gotoSOL = function () { return '\r' } exports.beep = function () { return '\x07' } exports.hideCursor = function hideCursor () { return prefix + '?25l' } exports.showCursor = function showCursor () { return prefix + '?25h' } var colors = { reset: 0, // styles bold: 1, italic: 3, underline: 4, inverse: 7, // resets stopBold: 22, stopItalic: 23, stopUnderline: 24, stopInverse: 27, // colors white: 37, black: 30, blue: 34, cyan: 36, green: 32, magenta: 35, red: 31, yellow: 33, bgWhite: 47, bgBlack: 40, bgBlue: 44, bgCyan: 46, bgGreen: 42, bgMagenta: 45, bgRed: 41, bgYellow: 43, grey: 90, brightBlack: 90, brightRed: 91, brightGreen: 92, brightYellow: 93, brightBlue: 94, brightMagenta: 95, brightCyan: 96, brightWhite: 97, bgGrey: 100, bgBrightBlack: 100, bgBrightRed: 101, bgBrightGreen: 102, bgBrightYellow: 103, bgBrightBlue: 104, bgBrightMagenta: 105, bgBrightCyan: 106, bgBrightWhite: 107 } exports.color = function color (colorWith) { if (arguments.length !== 1 || !Array.isArray(colorWith)) { colorWith = Array.prototype.slice.call(arguments) } return prefix + colorWith.map(colorNameToCode).join(';') + 'm' } function colorNameToCode (color) { if (colors[color] != null) return colors[color] throw new Error('Unknown color or style name: ' + color) } Copyright (c) 2014, Rebecca Turner Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "console-control-strings", "version": "1.1.0", "description": "A library of cross-platform tested terminal/console command strings for doing things like color and cursor positioning. This is a subset of both ansi and vt100. All control codes included work on both Windows & Unix-like OSes, except where noted.", "main": "index.js", "directories": { "test": "test" }, "scripts": { "test": "standard && tap test/*.js" }, "repository": { "type": "git", "url": "https://github.com/iarna/console-control-strings" }, "keywords": [], "author": "Rebecca Turner (http://re-becca.org/)", "license": "ISC", "files": [ "LICENSE", "index.js" ], "devDependencies": { "standard": "^7.1.2", "tap": "^5.7.2" } } # Console Control Strings A library of cross-platform tested terminal/console command strings for doing things like color and cursor positioning. This is a subset of both ansi and vt100. All control codes included work on both Windows & Unix-like OSes, except where noted. ## Usage ```js var consoleControl = require('console-control-strings') console.log(consoleControl.color('blue','bgRed', 'bold') + 'hi there' + consoleControl.color('reset')) process.stdout.write(consoleControl.goto(75, 10)) ``` ## Why Another? There are tons of libraries similar to this one. I wanted one that was: 1. Very clear about compatibility goals. 2. Could emit, for instance, a start color code without an end one. 3. Returned strings w/o writing to streams. 4. Was not weighed down with other unrelated baggage. ## Functions ### var code = consoleControl.up(_num = 1_) Returns the escape sequence to move _num_ lines up. ### var code = consoleControl.down(_num = 1_) Returns the escape sequence to move _num_ lines down. ### var code = consoleControl.forward(_num = 1_) Returns the escape sequence to move _num_ lines righ. ### var code = consoleControl.back(_num = 1_) Returns the escape sequence to move _num_ lines left. ### var code = consoleControl.nextLine(_num = 1_) Returns the escape sequence to move _num_ lines down and to the beginning of the line. ### var code = consoleControl.previousLine(_num = 1_) Returns the escape sequence to move _num_ lines up and to the beginning of the line. ### var code = consoleControl.eraseData() Returns the escape sequence to erase everything from the current cursor position to the bottom right of the screen. This is line based, so it erases the remainder of the current line and all following lines. ### var code = consoleControl.eraseLine() Returns the escape sequence to erase to the end of the current line. ### var code = consoleControl.goto(_x_, _y_) Returns the escape sequence to move the cursor to the designated position. Note that the origin is _1, 1_ not _0, 0_. ### var code = consoleControl.gotoSOL() Returns the escape sequence to move the cursor to the beginning of the current line. (That is, it returns a carriage return, `\r`.) ### var code = consoleControl.hideCursor() Returns the escape sequence to hide the cursor. ### var code = consoleControl.showCursor() Returns the escape sequence to show the cursor. ### var code = consoleControl.color(_colors = []_) ### var code = consoleControl.color(_color1_, _color2_, _…_, _colorn_) Returns the escape sequence to set the current terminal display attributes (mostly colors). Arguments can either be a list of attributes or an array of attributes. The difference between passing in an array or list of colors and calling `.color` separately for each one, is that in the former case a single escape sequence will be produced where as in the latter each change will have its own distinct escape sequence. Each attribute can be one of: * Reset: * **reset** – Reset all attributes to the terminal default. * Styles: * **bold** – Display text as bold. In some terminals this means using a bold font, in others this means changing the color. In some it means both. * **italic** – Display text as italic. This is not available in most Windows terminals. * **underline** – Underline text. This is not available in most Windows Terminals. * **inverse** – Invert the foreground and background colors. * **stopBold** – Do not display text as bold. * **stopItalic** – Do not display text as italic. * **stopUnderline** – Do not underline text. * **stopInverse** – Do not invert foreground and background. * Colors: * **white** * **black** * **blue** * **cyan** * **green** * **magenta** * **red** * **yellow** * **grey** / **brightBlack** * **brightRed** * **brightGreen** * **brightYellow** * **brightBlue** * **brightMagenta** * **brightCyan** * **brightWhite** * Background Colors: * **bgWhite** * **bgBlack** * **bgBlue** * **bgCyan** * **bgGreen** * **bgMagenta** * **bgRed** * **bgYellow** * **bgGrey** / **bgBrightBlack** * **bgBrightRed** * **bgBrightGreen** * **bgBrightYellow** * **bgBrightBlue** * **bgBrightMagenta** * **bgBrightCyan** * **bgBrightWhite** 'use strict'; const PassThrough = require('stream').PassThrough; const zlib = require('zlib'); const mimicResponse = require('mimic-response'); module.exports = response => { // TODO: Use Array#includes when targeting Node.js 6 if (['gzip', 'deflate'].indexOf(response.headers['content-encoding']) === -1) { return response; } const unzip = zlib.createUnzip(); const stream = new PassThrough(); mimicResponse(response, stream); unzip.on('error', err => { if (err.code === 'Z_BUF_ERROR') { stream.end(); return; } stream.emit('error', err); }); response.pipe(unzip).pipe(stream); return stream; }; `The MIT License (MIT) Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "decompress-response", "version": "3.3.0", "description": "Decompress a HTTP response if needed", "license": "MIT", "repository": "sindresorhus/decompress-response", "maintainers": [ { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, { "name": "Vsevolod Strukchinsky", "email": "floatdrop@gmail.com", "url": "github.com/floatdrop" } ], "engines": { "node": ">=4" }, "scripts": { "test": "xo && ava" }, "files": [ "index.js" ], "keywords": [ "decompress", "response", "http", "https", "zlib", "gzip", "zip", "deflate", "unzip", "ungzip", "incoming", "message", "stream", "compressed" ], "dependencies": { "mimic-response": "^1.0.0" }, "devDependencies": { "ava": "*", "get-stream": "^3.0.0", "pify": "^3.0.0", "xo": "*" } } module.exports = require('./lib/deep-extend'); The MIT License (MIT) Copyright (c) 2013-2018, Viacheslav Lotsmanov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "deep-extend", "description": "Recursive object extending", "license": "MIT", "version": "0.6.0", "homepage": "https://github.com/unclechu/node-deep-extend", "keywords": [ "deep-extend", "extend", "deep", "recursive", "xtend", "clone", "merge", "json" ], "licenses": [ { "type": "MIT", "url": "https://raw.githubusercontent.com/unclechu/node-deep-extend/master/LICENSE" } ], "repository": { "type": "git", "url": "git://github.com/unclechu/node-deep-extend.git" }, "author": "Viacheslav Lotsmanov ", "bugs": "https://github.com/unclechu/node-deep-extend/issues", "contributors": [ { "name": "Romain Prieto", "url": "https://github.com/rprieto" }, { "name": "Max Maximov", "url": "https://github.com/maxmaximov" }, { "name": "Marshall Bowers", "url": "https://github.com/maxdeviant" }, { "name": "Misha Wakerman", "url": "https://github.com/mwakerman" } ], "main": "lib/deep-extend.js", "engines": { "node": ">=4.0.0" }, "scripts": { "test": "./node_modules/.bin/mocha" }, "devDependencies": { "mocha": "5.2.0", "should": "13.2.1" }, "files": [ "index.js", "lib/" ] } /*! * @description Recursive object extending * @author Viacheslav Lotsmanov * @license MIT * * The MIT License (MIT) * * Copyright (c) 2013-2018 Viacheslav Lotsmanov * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * the Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 'use strict'; function isSpecificValue(val) { return ( val instanceof Buffer || val instanceof Date || val instanceof RegExp ) ? true : false; } function cloneSpecificValue(val) { if (val instanceof Buffer) { var x = Buffer.alloc ? Buffer.alloc(val.length) : new Buffer(val.length); val.copy(x); return x; } else if (val instanceof Date) { return new Date(val.getTime()); } else if (val instanceof RegExp) { return new RegExp(val); } else { throw new Error('Unexpected situation'); } } /** * Recursive cloning array. */ function deepCloneArray(arr) { var clone = []; arr.forEach(function (item, index) { if (typeof item === 'object' && item !== null) { if (Array.isArray(item)) { clone[index] = deepCloneArray(item); } else if (isSpecificValue(item)) { clone[index] = cloneSpecificValue(item); } else { clone[index] = deepExtend({}, item); } } else { clone[index] = item; } }); return clone; } function safeGetProperty(object, property) { return property === '__proto__' ? undefined : object[property]; } /** * Extening object that entered in first argument. * * Returns extended object or false if have no target object or incorrect type. * * If you wish to clone source object (without modify it), just use empty new * object as first argument, like this: * deepExtend({}, yourObj_1, [yourObj_N]); */ var deepExtend = module.exports = function (/*obj_1, [obj_2], [obj_N]*/) { if (arguments.length < 1 || typeof arguments[0] !== 'object') { return false; } if (arguments.length < 2) { return arguments[0]; } var target = arguments[0]; // convert arguments to array and cut off target object var args = Array.prototype.slice.call(arguments, 1); var val, src, clone; args.forEach(function (obj) { // skip argument if isn't an object, is null, or is an array if (typeof obj !== 'object' || obj === null || Array.isArray(obj)) { return; } Object.keys(obj).forEach(function (key) { src = safeGetProperty(target, key); // source value val = safeGetProperty(obj, key); // new value // recursion prevention if (val === target) { return; /** * if new value isn't object then just overwrite by new value * instead of extending. */ } else if (typeof val !== 'object' || val === null) { target[key] = val; return; // just clone arrays (and recursive clone objects inside) } else if (Array.isArray(val)) { target[key] = deepCloneArray(val); return; // custom cloning and overwrite for specific objects } else if (isSpecificValue(val)) { target[key] = cloneSpecificValue(val); return; // overwrite by new value if source isn't object or array } else if (typeof src !== 'object' || src === null || Array.isArray(src)) { target[key] = deepExtend({}, val); return; // source value and new value is objects both, extending... } else { target[key] = deepExtend(src, val); return; } }); }); return target; }; var once = require('once'); var noop = function() {}; var isRequest = function(stream) { return stream.setHeader && typeof stream.abort === 'function'; }; var isChildProcess = function(stream) { return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3 }; var eos = function(stream, opts, callback) { if (typeof opts === 'function') return eos(stream, null, opts); if (!opts) opts = {}; callback = once(callback || noop); var ws = stream._writableState; var rs = stream._readableState; var readable = opts.readable || (opts.readable !== false && stream.readable); var writable = opts.writable || (opts.writable !== false && stream.writable); var cancelled = false; var onlegacyfinish = function() { if (!stream.writable) onfinish(); }; var onfinish = function() { writable = false; if (!readable) callback.call(stream); }; var onend = function() { readable = false; if (!writable) callback.call(stream); }; var onexit = function(exitCode) { callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null); }; var onerror = function(err) { callback.call(stream, err); }; var onclose = function() { process.nextTick(onclosenexttick); }; var onclosenexttick = function() { if (cancelled) return; if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close')); if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close')); }; var onrequest = function() { stream.req.on('finish', onfinish); }; if (isRequest(stream)) { stream.on('complete', onfinish); stream.on('abort', onclose); if (stream.req) onrequest(); else stream.on('request', onrequest); } else if (writable && !ws) { // legacy streams stream.on('end', onlegacyfinish); stream.on('close', onlegacyfinish); } if (isChildProcess(stream)) stream.on('exit', onexit); stream.on('end', onend); stream.on('finish', onfinish); if (opts.error !== false) stream.on('error', onerror); stream.on('close', onclose); return function() { cancelled = true; stream.removeListener('complete', onfinish); stream.removeListener('abort', onclose); stream.removeListener('request', onrequest); if (stream.req) stream.req.removeListener('finish', onfinish); stream.removeListener('end', onlegacyfinish); stream.removeListener('close', onlegacyfinish); stream.removeListener('finish', onfinish); stream.removeListener('exit', onexit); stream.removeListener('end', onend); stream.removeListener('error', onerror); stream.removeListener('close', onclose); }; }; module.exports = eos; The MIT License (MIT) Copyright (c) 2014 Mathias Buus Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.{ "name": "end-of-stream", "version": "1.4.4", "description": "Call a callback when a readable/writable/duplex stream has completed or failed.", "repository": { "type": "git", "url": "git://github.com/mafintosh/end-of-stream.git" }, "dependencies": { "once": "^1.4.0" }, "scripts": { "test": "node test.js" }, "files": [ "index.js" ], "keywords": [ "stream", "streams", "callback", "finish", "close", "end", "wait" ], "bugs": { "url": "https://github.com/mafintosh/end-of-stream/issues" }, "homepage": "https://github.com/mafintosh/end-of-stream", "main": "index.js", "author": "Mathias Buus ", "license": "MIT", "devDependencies": { "tape": "^4.11.0" } } // This file can be required in Browserify and Node.js for automatic polyfill // To use it: require('es6-promise/auto'); 'use strict'; module.exports = require('./').polyfill(); Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "es6-promise", "namespace": "es6-promise", "version": "4.2.4", "description": "A lightweight library that provides tools for organizing asynchronous code", "main": "dist/es6-promise.js", "typings": "es6-promise.d.ts", "directories": { "lib": "lib" }, "files": [ "dist", "lib", "es6-promise.d.ts", "auto.js", "!dist/test" ], "devDependencies": { "babel-plugin-transform-es2015-arrow-functions": "^6.22.0", "babel-plugin-transform-es2015-block-scoping": "^6.24.1", "babel-plugin-transform-es2015-classes": "^6.24.1", "babel-plugin-transform-es2015-computed-properties": "^6.24.1", "babel-plugin-transform-es2015-constants": "^6.1.4", "babel-plugin-transform-es2015-destructuring": "^6.23.0", "babel-plugin-transform-es2015-parameters": "^6.24.1", "babel-plugin-transform-es2015-shorthand-properties": "^6.24.1", "babel-plugin-transform-es2015-spread": "^6.22.0", "babel-plugin-transform-es2015-template-literals": "^6.22.0", "babel6-plugin-strip-class-callcheck": "^6.0.0", "broccoli-babel-transpiler": "^6.0.0", "broccoli-concat": "^3.1.0", "broccoli-merge-trees": "^2.0.0", "broccoli-rollup": "^2.0.0", "broccoli-stew": "^1.5.0", "broccoli-uglify-js": "^0.2.0", "broccoli-watchify": "^1.0.1", "ember-cli": "2.18.0-beta.2", "ember-cli-dependency-checker": "^2.1.0", "git-repo-version": "1.0.1", "json3": "^3.3.2", "mocha": "^4.0.1", "promises-aplus-tests-phantom": "^2.1.0-revise" }, "scripts": { "build": "ember build --environment production", "start": "ember s", "test": "ember test", "test:server": "ember test --server", "test:node": "ember test --launch Mocha", "test:browser": "ember test --launch PhantomJS", "prepublishOnly": "ember build --environment production" }, "repository": { "type": "git", "url": "git://github.com/stefanpenner/es6-promise.git" }, "bugs": { "url": "https://github.com/stefanpenner/es6-promise/issues" }, "browser": { "vertx": false }, "keywords": [ "promises", "promise", "polyfill", "futures" ], "author": "Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)", "license": "MIT", "spm": { "main": "dist/es6-promise.js" }, "dependencies": {} } /*! * @overview es6-promise - a tiny implementation of Promises/A+. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) * @license Licensed under MIT license * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE * @version v4.2.4+314e4831 */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global.ES6Promise = factory()); }(this, (function () { 'use strict'; function objectOrFunction(x) { var type = typeof x; return x !== null && (type === 'object' || type === 'function'); } function isFunction(x) { return typeof x === 'function'; } var _isArray = void 0; if (Array.isArray) { _isArray = Array.isArray; } else { _isArray = function (x) { return Object.prototype.toString.call(x) === '[object Array]'; }; } var isArray = _isArray; var len = 0; var vertxNext = void 0; var customSchedulerFn = void 0; var asap = function asap(callback, arg) { queue[len] = callback; queue[len + 1] = arg; len += 2; if (len === 2) { // If len is 2, that means that we need to schedule an async flush. // If additional callbacks are queued before the queue is flushed, they // will be processed by this flush that we are scheduling. if (customSchedulerFn) { customSchedulerFn(flush); } else { scheduleFlush(); } } }; function setScheduler(scheduleFn) { customSchedulerFn = scheduleFn; } function setAsap(asapFn) { asap = asapFn; } var browserWindow = typeof window !== 'undefined' ? window : undefined; var browserGlobal = browserWindow || {}; var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; var isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]'; // test for web worker but not in IE10 var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined'; // node function useNextTick() { // node version 0.10.x displays a deprecation warning when nextTick is used recursively // see https://github.com/cujojs/when/issues/410 for details return function () { return process.nextTick(flush); }; } // vertx function useVertxTimer() { if (typeof vertxNext !== 'undefined') { return function () { vertxNext(flush); }; } return useSetTimeout(); } function useMutationObserver() { var iterations = 0; var observer = new BrowserMutationObserver(flush); var node = document.createTextNode(''); observer.observe(node, { characterData: true }); return function () { node.data = iterations = ++iterations % 2; }; } // web worker function useMessageChannel() { var channel = new MessageChannel(); channel.port1.onmessage = flush; return function () { return channel.port2.postMessage(0); }; } function useSetTimeout() { // Store setTimeout reference so es6-promise will be unaffected by // other code modifying setTimeout (like sinon.useFakeTimers()) var globalSetTimeout = setTimeout; return function () { return globalSetTimeout(flush, 1); }; } var queue = new Array(1000); function flush() { for (var i = 0; i < len; i += 2) { var callback = queue[i]; var arg = queue[i + 1]; callback(arg); queue[i] = undefined; queue[i + 1] = undefined; } len = 0; } function attemptVertx() { try { var vertx = Function('return this')().require('vertx'); vertxNext = vertx.runOnLoop || vertx.runOnContext; return useVertxTimer(); } catch (e) { return useSetTimeout(); } } var scheduleFlush = void 0; // Decide what async method to use to triggering processing of queued callbacks: if (isNode) { scheduleFlush = useNextTick(); } else if (BrowserMutationObserver) { scheduleFlush = useMutationObserver(); } else if (isWorker) { scheduleFlush = useMessageChannel(); } else if (browserWindow === undefined && typeof require === 'function') { scheduleFlush = attemptVertx(); } else { scheduleFlush = useSetTimeout(); } function then(onFulfillment, onRejection) { var parent = this; var child = new this.constructor(noop); if (child[PROMISE_ID] === undefined) { makePromise(child); } var _state = parent._state; if (_state) { var callback = arguments[_state - 1]; asap(function () { return invokeCallback(_state, child, callback, parent._result); }); } else { subscribe(parent, child, onFulfillment, onRejection); } return child; } /** `Promise.resolve` returns a promise that will become resolved with the passed `value`. It is shorthand for the following: ```javascript let promise = new Promise(function(resolve, reject){ resolve(1); }); promise.then(function(value){ // value === 1 }); ``` Instead of writing the above, your code now simply becomes the following: ```javascript let promise = Promise.resolve(1); promise.then(function(value){ // value === 1 }); ``` @method resolve @static @param {Any} value value that the returned promise will be resolved with Useful for tooling. @return {Promise} a promise that will become fulfilled with the given `value` */ function resolve$1(object) { /*jshint validthis:true */ var Constructor = this; if (object && typeof object === 'object' && object.constructor === Constructor) { return object; } var promise = new Constructor(noop); resolve(promise, object); return promise; } var PROMISE_ID = Math.random().toString(36).substring(2); function noop() {} var PENDING = void 0; var FULFILLED = 1; var REJECTED = 2; var TRY_CATCH_ERROR = { error: null }; function selfFulfillment() { return new TypeError("You cannot resolve a promise with itself"); } function cannotReturnOwn() { return new TypeError('A promises callback cannot return that same promise.'); } function getThen(promise) { try { return promise.then; } catch (error) { TRY_CATCH_ERROR.error = error; return TRY_CATCH_ERROR; } } function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) { try { then$$1.call(value, fulfillmentHandler, rejectionHandler); } catch (e) { return e; } } function handleForeignThenable(promise, thenable, then$$1) { asap(function (promise) { var sealed = false; var error = tryThen(then$$1, thenable, function (value) { if (sealed) { return; } sealed = true; if (thenable !== value) { resolve(promise, value); } else { fulfill(promise, value); } }, function (reason) { if (sealed) { return; } sealed = true; reject(promise, reason); }, 'Settle: ' + (promise._label || ' unknown promise')); if (!sealed && error) { sealed = true; reject(promise, error); } }, promise); } function handleOwnThenable(promise, thenable) { if (thenable._state === FULFILLED) { fulfill(promise, thenable._result); } else if (thenable._state === REJECTED) { reject(promise, thenable._result); } else { subscribe(thenable, undefined, function (value) { return resolve(promise, value); }, function (reason) { return reject(promise, reason); }); } } function handleMaybeThenable(promise, maybeThenable, then$$1) { if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) { handleOwnThenable(promise, maybeThenable); } else { if (then$$1 === TRY_CATCH_ERROR) { reject(promise, TRY_CATCH_ERROR.error); TRY_CATCH_ERROR.error = null; } else if (then$$1 === undefined) { fulfill(promise, maybeThenable); } else if (isFunction(then$$1)) { handleForeignThenable(promise, maybeThenable, then$$1); } else { fulfill(promise, maybeThenable); } } } function resolve(promise, value) { if (promise === value) { reject(promise, selfFulfillment()); } else if (objectOrFunction(value)) { handleMaybeThenable(promise, value, getThen(value)); } else { fulfill(promise, value); } } function publishRejection(promise) { if (promise._onerror) { promise._onerror(promise._result); } publish(promise); } function fulfill(promise, value) { if (promise._state !== PENDING) { return; } promise._result = value; promise._state = FULFILLED; if (promise._subscribers.length !== 0) { asap(publish, promise); } } function reject(promise, reason) { if (promise._state !== PENDING) { return; } promise._state = REJECTED; promise._result = reason; asap(publishRejection, promise); } function subscribe(parent, child, onFulfillment, onRejection) { var _subscribers = parent._subscribers; var length = _subscribers.length; parent._onerror = null; _subscribers[length] = child; _subscribers[length + FULFILLED] = onFulfillment; _subscribers[length + REJECTED] = onRejection; if (length === 0 && parent._state) { asap(publish, parent); } } function publish(promise) { var subscribers = promise._subscribers; var settled = promise._state; if (subscribers.length === 0) { return; } var child = void 0, callback = void 0, detail = promise._result; for (var i = 0; i < subscribers.length; i += 3) { child = subscribers[i]; callback = subscribers[i + settled]; if (child) { invokeCallback(settled, child, callback, detail); } else { callback(detail); } } promise._subscribers.length = 0; } function tryCatch(callback, detail) { try { return callback(detail); } catch (e) { TRY_CATCH_ERROR.error = e; return TRY_CATCH_ERROR; } } function invokeCallback(settled, promise, callback, detail) { var hasCallback = isFunction(callback), value = void 0, error = void 0, succeeded = void 0, failed = void 0; if (hasCallback) { value = tryCatch(callback, detail); if (value === TRY_CATCH_ERROR) { failed = true; error = value.error; value.error = null; } else { succeeded = true; } if (promise === value) { reject(promise, cannotReturnOwn()); return; } } else { value = detail; succeeded = true; } if (promise._state !== PENDING) { // noop } else if (hasCallback && succeeded) { resolve(promise, value); } else if (failed) { reject(promise, error); } else if (settled === FULFILLED) { fulfill(promise, value); } else if (settled === REJECTED) { reject(promise, value); } } function initializePromise(promise, resolver) { try { resolver(function resolvePromise(value) { resolve(promise, value); }, function rejectPromise(reason) { reject(promise, reason); }); } catch (e) { reject(promise, e); } } var id = 0; function nextId() { return id++; } function makePromise(promise) { promise[PROMISE_ID] = id++; promise._state = undefined; promise._result = undefined; promise._subscribers = []; } function validationError() { return new Error('Array Methods must be provided an Array'); } var Enumerator = function () { function Enumerator(Constructor, input) { this._instanceConstructor = Constructor; this.promise = new Constructor(noop); if (!this.promise[PROMISE_ID]) { makePromise(this.promise); } if (isArray(input)) { this.length = input.length; this._remaining = input.length; this._result = new Array(this.length); if (this.length === 0) { fulfill(this.promise, this._result); } else { this.length = this.length || 0; this._enumerate(input); if (this._remaining === 0) { fulfill(this.promise, this._result); } } } else { reject(this.promise, validationError()); } } Enumerator.prototype._enumerate = function _enumerate(input) { for (var i = 0; this._state === PENDING && i < input.length; i++) { this._eachEntry(input[i], i); } }; Enumerator.prototype._eachEntry = function _eachEntry(entry, i) { var c = this._instanceConstructor; var resolve$$1 = c.resolve; if (resolve$$1 === resolve$1) { var _then = getThen(entry); if (_then === then && entry._state !== PENDING) { this._settledAt(entry._state, i, entry._result); } else if (typeof _then !== 'function') { this._remaining--; this._result[i] = entry; } else if (c === Promise$2) { var promise = new c(noop); handleMaybeThenable(promise, entry, _then); this._willSettleAt(promise, i); } else { this._willSettleAt(new c(function (resolve$$1) { return resolve$$1(entry); }), i); } } else { this._willSettleAt(resolve$$1(entry), i); } }; Enumerator.prototype._settledAt = function _settledAt(state, i, value) { var promise = this.promise; if (promise._state === PENDING) { this._remaining--; if (state === REJECTED) { reject(promise, value); } else { this._result[i] = value; } } if (this._remaining === 0) { fulfill(promise, this._result); } }; Enumerator.prototype._willSettleAt = function _willSettleAt(promise, i) { var enumerator = this; subscribe(promise, undefined, function (value) { return enumerator._settledAt(FULFILLED, i, value); }, function (reason) { return enumerator._settledAt(REJECTED, i, reason); }); }; return Enumerator; }(); /** `Promise.all` accepts an array of promises, and returns a new promise which is fulfilled with an array of fulfillment values for the passed promises, or rejected with the reason of the first passed promise to be rejected. It casts all elements of the passed iterable to promises as it runs this algorithm. Example: ```javascript let promise1 = resolve(1); let promise2 = resolve(2); let promise3 = resolve(3); let promises = [ promise1, promise2, promise3 ]; Promise.all(promises).then(function(array){ // The array here would be [ 1, 2, 3 ]; }); ``` If any of the `promises` given to `all` are rejected, the first promise that is rejected will be given as an argument to the returned promises's rejection handler. For example: Example: ```javascript let promise1 = resolve(1); let promise2 = reject(new Error("2")); let promise3 = reject(new Error("3")); let promises = [ promise1, promise2, promise3 ]; Promise.all(promises).then(function(array){ // Code here never runs because there are rejected promises! }, function(error) { // error.message === "2" }); ``` @method all @static @param {Array} entries array of promises @param {String} label optional string for labeling the promise. Useful for tooling. @return {Promise} promise that is fulfilled when all `promises` have been fulfilled, or rejected if any of them become rejected. @static */ function all(entries) { return new Enumerator(this, entries).promise; } /** `Promise.race` returns a new promise which is settled in the same way as the first passed promise to settle. Example: ```javascript let promise1 = new Promise(function(resolve, reject){ setTimeout(function(){ resolve('promise 1'); }, 200); }); let promise2 = new Promise(function(resolve, reject){ setTimeout(function(){ resolve('promise 2'); }, 100); }); Promise.race([promise1, promise2]).then(function(result){ // result === 'promise 2' because it was resolved before promise1 // was resolved. }); ``` `Promise.race` is deterministic in that only the state of the first settled promise matters. For example, even if other promises given to the `promises` array argument are resolved, but the first settled promise has become rejected before the other promises became fulfilled, the returned promise will become rejected: ```javascript let promise1 = new Promise(function(resolve, reject){ setTimeout(function(){ resolve('promise 1'); }, 200); }); let promise2 = new Promise(function(resolve, reject){ setTimeout(function(){ reject(new Error('promise 2')); }, 100); }); Promise.race([promise1, promise2]).then(function(result){ // Code here never runs }, function(reason){ // reason.message === 'promise 2' because promise 2 became rejected before // promise 1 became fulfilled }); ``` An example real-world use case is implementing timeouts: ```javascript Promise.race([ajax('foo.json'), timeout(5000)]) ``` @method race @static @param {Array} promises array of promises to observe Useful for tooling. @return {Promise} a promise which settles in the same way as the first passed promise to settle. */ function race(entries) { /*jshint validthis:true */ var Constructor = this; if (!isArray(entries)) { return new Constructor(function (_, reject) { return reject(new TypeError('You must pass an array to race.')); }); } else { return new Constructor(function (resolve, reject) { var length = entries.length; for (var i = 0; i < length; i++) { Constructor.resolve(entries[i]).then(resolve, reject); } }); } } /** `Promise.reject` returns a promise rejected with the passed `reason`. It is shorthand for the following: ```javascript let promise = new Promise(function(resolve, reject){ reject(new Error('WHOOPS')); }); promise.then(function(value){ // Code here doesn't run because the promise is rejected! }, function(reason){ // reason.message === 'WHOOPS' }); ``` Instead of writing the above, your code now simply becomes the following: ```javascript let promise = Promise.reject(new Error('WHOOPS')); promise.then(function(value){ // Code here doesn't run because the promise is rejected! }, function(reason){ // reason.message === 'WHOOPS' }); ``` @method reject @static @param {Any} reason value that the returned promise will be rejected with. Useful for tooling. @return {Promise} a promise rejected with the given `reason`. */ function reject$1(reason) { /*jshint validthis:true */ var Constructor = this; var promise = new Constructor(noop); reject(promise, reason); return promise; } function needsResolver() { throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); } function needsNew() { throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); } /** Promise objects represent the eventual result of an asynchronous operation. The primary way of interacting with a promise is through its `then` method, which registers callbacks to receive either a promise's eventual value or the reason why the promise cannot be fulfilled. Terminology ----------- - `promise` is an object or function with a `then` method whose behavior conforms to this specification. - `thenable` is an object or function that defines a `then` method. - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). - `exception` is a value that is thrown using the throw statement. - `reason` is a value that indicates why a promise was rejected. - `settled` the final resting state of a promise, fulfilled or rejected. A promise can be in one of three states: pending, fulfilled, or rejected. Promises that are fulfilled have a fulfillment value and are in the fulfilled state. Promises that are rejected have a rejection reason and are in the rejected state. A fulfillment value is never a thenable. Promises can also be said to *resolve* a value. If this value is also a promise, then the original promise's settled state will match the value's settled state. So a promise that *resolves* a promise that rejects will itself reject, and a promise that *resolves* a promise that fulfills will itself fulfill. Basic Usage: ------------ ```js let promise = new Promise(function(resolve, reject) { // on success resolve(value); // on failure reject(reason); }); promise.then(function(value) { // on fulfillment }, function(reason) { // on rejection }); ``` Advanced Usage: --------------- Promises shine when abstracting away asynchronous interactions such as `XMLHttpRequest`s. ```js function getJSON(url) { return new Promise(function(resolve, reject){ let xhr = new XMLHttpRequest(); xhr.open('GET', url); xhr.onreadystatechange = handler; xhr.responseType = 'json'; xhr.setRequestHeader('Accept', 'application/json'); xhr.send(); function handler() { if (this.readyState === this.DONE) { if (this.status === 200) { resolve(this.response); } else { reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); } } }; }); } getJSON('/posts.json').then(function(json) { // on fulfillment }, function(reason) { // on rejection }); ``` Unlike callbacks, promises are great composable primitives. ```js Promise.all([ getJSON('/posts'), getJSON('/comments') ]).then(function(values){ values[0] // => postsJSON values[1] // => commentsJSON return values; }); ``` @class Promise @param {Function} resolver Useful for tooling. @constructor */ var Promise$2 = function () { function Promise(resolver) { this[PROMISE_ID] = nextId(); this._result = this._state = undefined; this._subscribers = []; if (noop !== resolver) { typeof resolver !== 'function' && needsResolver(); this instanceof Promise ? initializePromise(this, resolver) : needsNew(); } } /** The primary way of interacting with a promise is through its `then` method, which registers callbacks to receive either a promise's eventual value or the reason why the promise cannot be fulfilled. ```js findUser().then(function(user){ // user is available }, function(reason){ // user is unavailable, and you are given the reason why }); ``` Chaining -------- The return value of `then` is itself a promise. This second, 'downstream' promise is resolved with the return value of the first promise's fulfillment or rejection handler, or rejected if the handler throws an exception. ```js findUser().then(function (user) { return user.name; }, function (reason) { return 'default name'; }).then(function (userName) { // If `findUser` fulfilled, `userName` will be the user's name, otherwise it // will be `'default name'` }); findUser().then(function (user) { throw new Error('Found user, but still unhappy'); }, function (reason) { throw new Error('`findUser` rejected and we're unhappy'); }).then(function (value) { // never reached }, function (reason) { // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'. }); ``` If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. ```js findUser().then(function (user) { throw new PedagogicalException('Upstream error'); }).then(function (value) { // never reached }).then(function (value) { // never reached }, function (reason) { // The `PedgagocialException` is propagated all the way down to here }); ``` Assimilation ------------ Sometimes the value you want to propagate to a downstream promise can only be retrieved asynchronously. This can be achieved by returning a promise in the fulfillment or rejection handler. The downstream promise will then be pending until the returned promise is settled. This is called *assimilation*. ```js findUser().then(function (user) { return findCommentsByAuthor(user); }).then(function (comments) { // The user's comments are now available }); ``` If the assimliated promise rejects, then the downstream promise will also reject. ```js findUser().then(function (user) { return findCommentsByAuthor(user); }).then(function (comments) { // If `findCommentsByAuthor` fulfills, we'll have the value here }, function (reason) { // If `findCommentsByAuthor` rejects, we'll have the reason here }); ``` Simple Example -------------- Synchronous Example ```javascript let result; try { result = findResult(); // success } catch(reason) { // failure } ``` Errback Example ```js findResult(function(result, err){ if (err) { // failure } else { // success } }); ``` Promise Example; ```javascript findResult().then(function(result){ // success }, function(reason){ // failure }); ``` Advanced Example -------------- Synchronous Example ```javascript let author, books; try { author = findAuthor(); books = findBooksByAuthor(author); // success } catch(reason) { // failure } ``` Errback Example ```js function foundBooks(books) { } function failure(reason) { } findAuthor(function(author, err){ if (err) { failure(err); // failure } else { try { findBoooksByAuthor(author, function(books, err) { if (err) { failure(err); } else { try { foundBooks(books); } catch(reason) { failure(reason); } } }); } catch(error) { failure(err); } // success } }); ``` Promise Example; ```javascript findAuthor(). then(findBooksByAuthor). then(function(books){ // found books }).catch(function(reason){ // something went wrong }); ``` @method then @param {Function} onFulfilled @param {Function} onRejected Useful for tooling. @return {Promise} */ /** `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same as the catch block of a try/catch statement. ```js function findAuthor(){ throw new Error('couldn't find that author'); } // synchronous try { findAuthor(); } catch(reason) { // something went wrong } // async with promises findAuthor().catch(function(reason){ // something went wrong }); ``` @method catch @param {Function} onRejection Useful for tooling. @return {Promise} */ Promise.prototype.catch = function _catch(onRejection) { return this.then(null, onRejection); }; /** `finally` will be invoked regardless of the promise's fate just as native try/catch/finally behaves Synchronous example: ```js findAuthor() { if (Math.random() > 0.5) { throw new Error(); } return new Author(); } try { return findAuthor(); // succeed or fail } catch(error) { return findOtherAuther(); } finally { // always runs // doesn't affect the return value } ``` Asynchronous example: ```js findAuthor().catch(function(reason){ return findOtherAuther(); }).finally(function(){ // author was either found, or not }); ``` @method finally @param {Function} callback @return {Promise} */ Promise.prototype.finally = function _finally(callback) { var promise = this; var constructor = promise.constructor; return promise.then(function (value) { return constructor.resolve(callback()).then(function () { return value; }); }, function (reason) { return constructor.resolve(callback()).then(function () { throw reason; }); }); }; return Promise; }(); Promise$2.prototype.then = then; Promise$2.all = all; Promise$2.race = race; Promise$2.resolve = resolve$1; Promise$2.reject = reject$1; Promise$2._setScheduler = setScheduler; Promise$2._setAsap = setAsap; Promise$2._asap = asap; /*global self*/ function polyfill() { var local = void 0; if (typeof global !== 'undefined') { local = global; } else if (typeof self !== 'undefined') { local = self; } else { try { local = Function('return this')(); } catch (e) { throw new Error('polyfill failed because global object is unavailable in this environment'); } } var P = local.Promise; if (P) { var promiseToString = null; try { promiseToString = Object.prototype.toString.call(P.resolve()); } catch (e) { // silently ignored } if (promiseToString === '[object Promise]' && !P.cast) { return; } } local.Promise = Promise$2; } // Strange compat.. Promise$2.polyfill = polyfill; Promise$2.Promise = Promise$2; Promise$2.polyfill(); return Promise$2; }))); //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/es6-promise/dist/es6-promise.auto.map {"version":3,"sources":["config/versionTemplate.txt","lib/es6-promise/utils.js","lib/es6-promise/asap.js","lib/es6-promise/then.js","lib/es6-promise/promise/resolve.js","lib/es6-promise/-internal.js","lib/es6-promise/enumerator.js","lib/es6-promise/promise/all.js","lib/es6-promise/promise/race.js","lib/es6-promise/promise/reject.js","lib/es6-promise/promise.js","lib/es6-promise/polyfill.js","lib/es6-promise.js","lib/es6-promise.auto.js"],"sourcesContent":["/*!\n * @overview es6-promise - a tiny implementation of Promises/A+.\n * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n * @license Licensed under MIT license\n * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE\n * @version v4.2.4+314e4831\n */\n","export function objectOrFunction(x) {\n var type = typeof x;\n return x !== null && (type === 'object' || type === 'function');\n}\n\nexport function isFunction(x) {\n return typeof x === 'function';\n}\n\nexport function isMaybeThenable(x) {\n return x !== null && typeof x === 'object';\n}\n\nvar _isArray = void 0;\nif (Array.isArray) {\n _isArray = Array.isArray;\n} else {\n _isArray = function (x) {\n return Object.prototype.toString.call(x) === '[object Array]';\n };\n}\n\nexport var isArray = _isArray;","var len = 0;\nvar vertxNext = void 0;\nvar customSchedulerFn = void 0;\n\nexport var asap = function asap(callback, arg) {\n queue[len] = callback;\n queue[len + 1] = arg;\n len += 2;\n if (len === 2) {\n // If len is 2, that means that we need to schedule an async flush.\n // If additional callbacks are queued before the queue is flushed, they\n // will be processed by this flush that we are scheduling.\n if (customSchedulerFn) {\n customSchedulerFn(flush);\n } else {\n scheduleFlush();\n }\n }\n};\n\nexport function setScheduler(scheduleFn) {\n customSchedulerFn = scheduleFn;\n}\n\nexport function setAsap(asapFn) {\n asap = asapFn;\n}\n\nvar browserWindow = typeof window !== 'undefined' ? window : undefined;\nvar browserGlobal = browserWindow || {};\nvar BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;\nvar isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';\n\n// test for web worker but not in IE10\nvar isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';\n\n// node\nfunction useNextTick() {\n // node version 0.10.x displays a deprecation warning when nextTick is used recursively\n // see https://github.com/cujojs/when/issues/410 for details\n return function () {\n return process.nextTick(flush);\n };\n}\n\n// vertx\nfunction useVertxTimer() {\n if (typeof vertxNext !== 'undefined') {\n return function () {\n vertxNext(flush);\n };\n }\n\n return useSetTimeout();\n}\n\nfunction useMutationObserver() {\n var iterations = 0;\n var observer = new BrowserMutationObserver(flush);\n var node = document.createTextNode('');\n observer.observe(node, { characterData: true });\n\n return function () {\n node.data = iterations = ++iterations % 2;\n };\n}\n\n// web worker\nfunction useMessageChannel() {\n var channel = new MessageChannel();\n channel.port1.onmessage = flush;\n return function () {\n return channel.port2.postMessage(0);\n };\n}\n\nfunction useSetTimeout() {\n // Store setTimeout reference so es6-promise will be unaffected by\n // other code modifying setTimeout (like sinon.useFakeTimers())\n var globalSetTimeout = setTimeout;\n return function () {\n return globalSetTimeout(flush, 1);\n };\n}\n\nvar queue = new Array(1000);\nfunction flush() {\n for (var i = 0; i < len; i += 2) {\n var callback = queue[i];\n var arg = queue[i + 1];\n\n callback(arg);\n\n queue[i] = undefined;\n queue[i + 1] = undefined;\n }\n\n len = 0;\n}\n\nfunction attemptVertx() {\n try {\n var vertx = Function('return this')().require('vertx');\n vertxNext = vertx.runOnLoop || vertx.runOnContext;\n return useVertxTimer();\n } catch (e) {\n return useSetTimeout();\n }\n}\n\nvar scheduleFlush = void 0;\n// Decide what async method to use to triggering processing of queued callbacks:\nif (isNode) {\n scheduleFlush = useNextTick();\n} else if (BrowserMutationObserver) {\n scheduleFlush = useMutationObserver();\n} else if (isWorker) {\n scheduleFlush = useMessageChannel();\n} else if (browserWindow === undefined && typeof require === 'function') {\n scheduleFlush = attemptVertx();\n} else {\n scheduleFlush = useSetTimeout();\n}","import { invokeCallback, subscribe, FULFILLED, REJECTED, noop, makePromise, PROMISE_ID } from './-internal';\n\nimport { asap } from './asap';\n\nexport default function then(onFulfillment, onRejection) {\n var parent = this;\n\n var child = new this.constructor(noop);\n\n if (child[PROMISE_ID] === undefined) {\n makePromise(child);\n }\n\n var _state = parent._state;\n\n\n if (_state) {\n var callback = arguments[_state - 1];\n asap(function () {\n return invokeCallback(_state, child, callback, parent._result);\n });\n } else {\n subscribe(parent, child, onFulfillment, onRejection);\n }\n\n return child;\n}","import { noop, resolve as _resolve } from '../-internal';\n\n/**\n `Promise.resolve` returns a promise that will become resolved with the\n passed `value`. It is shorthand for the following:\n\n ```javascript\n let promise = new Promise(function(resolve, reject){\n resolve(1);\n });\n\n promise.then(function(value){\n // value === 1\n });\n ```\n\n Instead of writing the above, your code now simply becomes the following:\n\n ```javascript\n let promise = Promise.resolve(1);\n\n promise.then(function(value){\n // value === 1\n });\n ```\n\n @method resolve\n @static\n @param {Any} value value that the returned promise will be resolved with\n Useful for tooling.\n @return {Promise} a promise that will become fulfilled with the given\n `value`\n*/\nexport default function resolve(object) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (object && typeof object === 'object' && object.constructor === Constructor) {\n return object;\n }\n\n var promise = new Constructor(noop);\n _resolve(promise, object);\n return promise;\n}","import { objectOrFunction, isFunction } from './utils';\n\nimport { asap } from './asap';\n\nimport originalThen from './then';\nimport originalResolve from './promise/resolve';\n\nexport var PROMISE_ID = Math.random().toString(36).substring(2);\n\nfunction noop() {}\n\nvar PENDING = void 0;\nvar FULFILLED = 1;\nvar REJECTED = 2;\n\nvar TRY_CATCH_ERROR = { error: null };\n\nfunction selfFulfillment() {\n return new TypeError(\"You cannot resolve a promise with itself\");\n}\n\nfunction cannotReturnOwn() {\n return new TypeError('A promises callback cannot return that same promise.');\n}\n\nfunction getThen(promise) {\n try {\n return promise.then;\n } catch (error) {\n TRY_CATCH_ERROR.error = error;\n return TRY_CATCH_ERROR;\n }\n}\n\nfunction tryThen(then, value, fulfillmentHandler, rejectionHandler) {\n try {\n then.call(value, fulfillmentHandler, rejectionHandler);\n } catch (e) {\n return e;\n }\n}\n\nfunction handleForeignThenable(promise, thenable, then) {\n asap(function (promise) {\n var sealed = false;\n var error = tryThen(then, thenable, function (value) {\n if (sealed) {\n return;\n }\n sealed = true;\n if (thenable !== value) {\n resolve(promise, value);\n } else {\n fulfill(promise, value);\n }\n }, function (reason) {\n if (sealed) {\n return;\n }\n sealed = true;\n\n reject(promise, reason);\n }, 'Settle: ' + (promise._label || ' unknown promise'));\n\n if (!sealed && error) {\n sealed = true;\n reject(promise, error);\n }\n }, promise);\n}\n\nfunction handleOwnThenable(promise, thenable) {\n if (thenable._state === FULFILLED) {\n fulfill(promise, thenable._result);\n } else if (thenable._state === REJECTED) {\n reject(promise, thenable._result);\n } else {\n subscribe(thenable, undefined, function (value) {\n return resolve(promise, value);\n }, function (reason) {\n return reject(promise, reason);\n });\n }\n}\n\nfunction handleMaybeThenable(promise, maybeThenable, then) {\n if (maybeThenable.constructor === promise.constructor && then === originalThen && maybeThenable.constructor.resolve === originalResolve) {\n handleOwnThenable(promise, maybeThenable);\n } else {\n if (then === TRY_CATCH_ERROR) {\n reject(promise, TRY_CATCH_ERROR.error);\n TRY_CATCH_ERROR.error = null;\n } else if (then === undefined) {\n fulfill(promise, maybeThenable);\n } else if (isFunction(then)) {\n handleForeignThenable(promise, maybeThenable, then);\n } else {\n fulfill(promise, maybeThenable);\n }\n }\n}\n\nfunction resolve(promise, value) {\n if (promise === value) {\n reject(promise, selfFulfillment());\n } else if (objectOrFunction(value)) {\n handleMaybeThenable(promise, value, getThen(value));\n } else {\n fulfill(promise, value);\n }\n}\n\nfunction publishRejection(promise) {\n if (promise._onerror) {\n promise._onerror(promise._result);\n }\n\n publish(promise);\n}\n\nfunction fulfill(promise, value) {\n if (promise._state !== PENDING) {\n return;\n }\n\n promise._result = value;\n promise._state = FULFILLED;\n\n if (promise._subscribers.length !== 0) {\n asap(publish, promise);\n }\n}\n\nfunction reject(promise, reason) {\n if (promise._state !== PENDING) {\n return;\n }\n promise._state = REJECTED;\n promise._result = reason;\n\n asap(publishRejection, promise);\n}\n\nfunction subscribe(parent, child, onFulfillment, onRejection) {\n var _subscribers = parent._subscribers;\n var length = _subscribers.length;\n\n\n parent._onerror = null;\n\n _subscribers[length] = child;\n _subscribers[length + FULFILLED] = onFulfillment;\n _subscribers[length + REJECTED] = onRejection;\n\n if (length === 0 && parent._state) {\n asap(publish, parent);\n }\n}\n\nfunction publish(promise) {\n var subscribers = promise._subscribers;\n var settled = promise._state;\n\n if (subscribers.length === 0) {\n return;\n }\n\n var child = void 0,\n callback = void 0,\n detail = promise._result;\n\n for (var i = 0; i < subscribers.length; i += 3) {\n child = subscribers[i];\n callback = subscribers[i + settled];\n\n if (child) {\n invokeCallback(settled, child, callback, detail);\n } else {\n callback(detail);\n }\n }\n\n promise._subscribers.length = 0;\n}\n\nfunction tryCatch(callback, detail) {\n try {\n return callback(detail);\n } catch (e) {\n TRY_CATCH_ERROR.error = e;\n return TRY_CATCH_ERROR;\n }\n}\n\nfunction invokeCallback(settled, promise, callback, detail) {\n var hasCallback = isFunction(callback),\n value = void 0,\n error = void 0,\n succeeded = void 0,\n failed = void 0;\n\n if (hasCallback) {\n value = tryCatch(callback, detail);\n\n if (value === TRY_CATCH_ERROR) {\n failed = true;\n error = value.error;\n value.error = null;\n } else {\n succeeded = true;\n }\n\n if (promise === value) {\n reject(promise, cannotReturnOwn());\n return;\n }\n } else {\n value = detail;\n succeeded = true;\n }\n\n if (promise._state !== PENDING) {\n // noop\n } else if (hasCallback && succeeded) {\n resolve(promise, value);\n } else if (failed) {\n reject(promise, error);\n } else if (settled === FULFILLED) {\n fulfill(promise, value);\n } else if (settled === REJECTED) {\n reject(promise, value);\n }\n}\n\nfunction initializePromise(promise, resolver) {\n try {\n resolver(function resolvePromise(value) {\n resolve(promise, value);\n }, function rejectPromise(reason) {\n reject(promise, reason);\n });\n } catch (e) {\n reject(promise, e);\n }\n}\n\nvar id = 0;\nfunction nextId() {\n return id++;\n}\n\nfunction makePromise(promise) {\n promise[PROMISE_ID] = id++;\n promise._state = undefined;\n promise._result = undefined;\n promise._subscribers = [];\n}\n\nexport { nextId, makePromise, getThen, noop, resolve, reject, fulfill, subscribe, publish, publishRejection, initializePromise, invokeCallback, FULFILLED, REJECTED, PENDING, handleMaybeThenable };","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nimport { isArray, isMaybeThenable } from './utils';\nimport { noop, reject, fulfill, subscribe, FULFILLED, REJECTED, PENDING, getThen, handleMaybeThenable } from './-internal';\n\nimport then from './then';\nimport Promise from './promise';\nimport originalResolve from './promise/resolve';\nimport originalThen from './then';\nimport { makePromise, PROMISE_ID } from './-internal';\n\nfunction validationError() {\n return new Error('Array Methods must be provided an Array');\n};\n\nvar Enumerator = function () {\n function Enumerator(Constructor, input) {\n this._instanceConstructor = Constructor;\n this.promise = new Constructor(noop);\n\n if (!this.promise[PROMISE_ID]) {\n makePromise(this.promise);\n }\n\n if (isArray(input)) {\n this.length = input.length;\n this._remaining = input.length;\n\n this._result = new Array(this.length);\n\n if (this.length === 0) {\n fulfill(this.promise, this._result);\n } else {\n this.length = this.length || 0;\n this._enumerate(input);\n if (this._remaining === 0) {\n fulfill(this.promise, this._result);\n }\n }\n } else {\n reject(this.promise, validationError());\n }\n }\n\n Enumerator.prototype._enumerate = function _enumerate(input) {\n for (var i = 0; this._state === PENDING && i < input.length; i++) {\n this._eachEntry(input[i], i);\n }\n };\n\n Enumerator.prototype._eachEntry = function _eachEntry(entry, i) {\n var c = this._instanceConstructor;\n var resolve = c.resolve;\n\n\n if (resolve === originalResolve) {\n var _then = getThen(entry);\n\n if (_then === originalThen && entry._state !== PENDING) {\n this._settledAt(entry._state, i, entry._result);\n } else if (typeof _then !== 'function') {\n this._remaining--;\n this._result[i] = entry;\n } else if (c === Promise) {\n var promise = new c(noop);\n handleMaybeThenable(promise, entry, _then);\n this._willSettleAt(promise, i);\n } else {\n this._willSettleAt(new c(function (resolve) {\n return resolve(entry);\n }), i);\n }\n } else {\n this._willSettleAt(resolve(entry), i);\n }\n };\n\n Enumerator.prototype._settledAt = function _settledAt(state, i, value) {\n var promise = this.promise;\n\n\n if (promise._state === PENDING) {\n this._remaining--;\n\n if (state === REJECTED) {\n reject(promise, value);\n } else {\n this._result[i] = value;\n }\n }\n\n if (this._remaining === 0) {\n fulfill(promise, this._result);\n }\n };\n\n Enumerator.prototype._willSettleAt = function _willSettleAt(promise, i) {\n var enumerator = this;\n\n subscribe(promise, undefined, function (value) {\n return enumerator._settledAt(FULFILLED, i, value);\n }, function (reason) {\n return enumerator._settledAt(REJECTED, i, reason);\n });\n };\n\n return Enumerator;\n}();\n\nexport default Enumerator;\n;","import Enumerator from '../enumerator';\n\n/**\n `Promise.all` accepts an array of promises, and returns a new promise which\n is fulfilled with an array of fulfillment values for the passed promises, or\n rejected with the reason of the first passed promise to be rejected. It casts all\n elements of the passed iterable to promises as it runs this algorithm.\n\n Example:\n\n ```javascript\n let promise1 = resolve(1);\n let promise2 = resolve(2);\n let promise3 = resolve(3);\n let promises = [ promise1, promise2, promise3 ];\n\n Promise.all(promises).then(function(array){\n // The array here would be [ 1, 2, 3 ];\n });\n ```\n\n If any of the `promises` given to `all` are rejected, the first promise\n that is rejected will be given as an argument to the returned promises's\n rejection handler. For example:\n\n Example:\n\n ```javascript\n let promise1 = resolve(1);\n let promise2 = reject(new Error(\"2\"));\n let promise3 = reject(new Error(\"3\"));\n let promises = [ promise1, promise2, promise3 ];\n\n Promise.all(promises).then(function(array){\n // Code here never runs because there are rejected promises!\n }, function(error) {\n // error.message === \"2\"\n });\n ```\n\n @method all\n @static\n @param {Array} entries array of promises\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise} promise that is fulfilled when all `promises` have been\n fulfilled, or rejected if any of them become rejected.\n @static\n*/\nexport default function all(entries) {\n return new Enumerator(this, entries).promise;\n}","import { isArray } from \"../utils\";\n\n/**\n `Promise.race` returns a new promise which is settled in the same way as the\n first passed promise to settle.\n\n Example:\n\n ```javascript\n let promise1 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n });\n\n let promise2 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 2');\n }, 100);\n });\n\n Promise.race([promise1, promise2]).then(function(result){\n // result === 'promise 2' because it was resolved before promise1\n // was resolved.\n });\n ```\n\n `Promise.race` is deterministic in that only the state of the first\n settled promise matters. For example, even if other promises given to the\n `promises` array argument are resolved, but the first settled promise has\n become rejected before the other promises became fulfilled, the returned\n promise will become rejected:\n\n ```javascript\n let promise1 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n });\n\n let promise2 = new Promise(function(resolve, reject){\n setTimeout(function(){\n reject(new Error('promise 2'));\n }, 100);\n });\n\n Promise.race([promise1, promise2]).then(function(result){\n // Code here never runs\n }, function(reason){\n // reason.message === 'promise 2' because promise 2 became rejected before\n // promise 1 became fulfilled\n });\n ```\n\n An example real-world use case is implementing timeouts:\n\n ```javascript\n Promise.race([ajax('foo.json'), timeout(5000)])\n ```\n\n @method race\n @static\n @param {Array} promises array of promises to observe\n Useful for tooling.\n @return {Promise} a promise which settles in the same way as the first passed\n promise to settle.\n*/\nexport default function race(entries) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (!isArray(entries)) {\n return new Constructor(function (_, reject) {\n return reject(new TypeError('You must pass an array to race.'));\n });\n } else {\n return new Constructor(function (resolve, reject) {\n var length = entries.length;\n for (var i = 0; i < length; i++) {\n Constructor.resolve(entries[i]).then(resolve, reject);\n }\n });\n }\n}","import { noop, reject as _reject } from '../-internal';\n\n/**\n `Promise.reject` returns a promise rejected with the passed `reason`.\n It is shorthand for the following:\n\n ```javascript\n let promise = new Promise(function(resolve, reject){\n reject(new Error('WHOOPS'));\n });\n\n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n\n Instead of writing the above, your code now simply becomes the following:\n\n ```javascript\n let promise = Promise.reject(new Error('WHOOPS'));\n\n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n\n @method reject\n @static\n @param {Any} reason value that the returned promise will be rejected with.\n Useful for tooling.\n @return {Promise} a promise rejected with the given `reason`.\n*/\nexport default function reject(reason) {\n /*jshint validthis:true */\n var Constructor = this;\n var promise = new Constructor(noop);\n _reject(promise, reason);\n return promise;\n}","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nimport { isFunction } from './utils';\nimport { noop, nextId, PROMISE_ID, initializePromise } from './-internal';\nimport { asap, setAsap, setScheduler } from './asap';\n\nimport all from './promise/all';\nimport race from './promise/race';\nimport Resolve from './promise/resolve';\nimport Reject from './promise/reject';\nimport then from './then';\n\nfunction needsResolver() {\n throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');\n}\n\nfunction needsNew() {\n throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\");\n}\n\n/**\n Promise objects represent the eventual result of an asynchronous operation. The\n primary way of interacting with a promise is through its `then` method, which\n registers callbacks to receive either a promise's eventual value or the reason\n why the promise cannot be fulfilled.\n\n Terminology\n -----------\n\n - `promise` is an object or function with a `then` method whose behavior conforms to this specification.\n - `thenable` is an object or function that defines a `then` method.\n - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).\n - `exception` is a value that is thrown using the throw statement.\n - `reason` is a value that indicates why a promise was rejected.\n - `settled` the final resting state of a promise, fulfilled or rejected.\n\n A promise can be in one of three states: pending, fulfilled, or rejected.\n\n Promises that are fulfilled have a fulfillment value and are in the fulfilled\n state. Promises that are rejected have a rejection reason and are in the\n rejected state. A fulfillment value is never a thenable.\n\n Promises can also be said to *resolve* a value. If this value is also a\n promise, then the original promise's settled state will match the value's\n settled state. So a promise that *resolves* a promise that rejects will\n itself reject, and a promise that *resolves* a promise that fulfills will\n itself fulfill.\n\n\n Basic Usage:\n ------------\n\n ```js\n let promise = new Promise(function(resolve, reject) {\n // on success\n resolve(value);\n\n // on failure\n reject(reason);\n });\n\n promise.then(function(value) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Advanced Usage:\n ---------------\n\n Promises shine when abstracting away asynchronous interactions such as\n `XMLHttpRequest`s.\n\n ```js\n function getJSON(url) {\n return new Promise(function(resolve, reject){\n let xhr = new XMLHttpRequest();\n\n xhr.open('GET', url);\n xhr.onreadystatechange = handler;\n xhr.responseType = 'json';\n xhr.setRequestHeader('Accept', 'application/json');\n xhr.send();\n\n function handler() {\n if (this.readyState === this.DONE) {\n if (this.status === 200) {\n resolve(this.response);\n } else {\n reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n }\n }\n };\n });\n }\n\n getJSON('/posts.json').then(function(json) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Unlike callbacks, promises are great composable primitives.\n\n ```js\n Promise.all([\n getJSON('/posts'),\n getJSON('/comments')\n ]).then(function(values){\n values[0] // => postsJSON\n values[1] // => commentsJSON\n\n return values;\n });\n ```\n\n @class Promise\n @param {Function} resolver\n Useful for tooling.\n @constructor\n*/\n\nvar Promise = function () {\n function Promise(resolver) {\n this[PROMISE_ID] = nextId();\n this._result = this._state = undefined;\n this._subscribers = [];\n\n if (noop !== resolver) {\n typeof resolver !== 'function' && needsResolver();\n this instanceof Promise ? initializePromise(this, resolver) : needsNew();\n }\n }\n\n /**\n The primary way of interacting with a promise is through its `then` method,\n which registers callbacks to receive either a promise's eventual value or the\n reason why the promise cannot be fulfilled.\n ```js\n findUser().then(function(user){\n // user is available\n }, function(reason){\n // user is unavailable, and you are given the reason why\n });\n ```\n Chaining\n --------\n The return value of `then` is itself a promise. This second, 'downstream'\n promise is resolved with the return value of the first promise's fulfillment\n or rejection handler, or rejected if the handler throws an exception.\n ```js\n findUser().then(function (user) {\n return user.name;\n }, function (reason) {\n return 'default name';\n }).then(function (userName) {\n // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n // will be `'default name'`\n });\n findUser().then(function (user) {\n throw new Error('Found user, but still unhappy');\n }, function (reason) {\n throw new Error('`findUser` rejected and we're unhappy');\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.\n });\n ```\n If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.\n ```js\n findUser().then(function (user) {\n throw new PedagogicalException('Upstream error');\n }).then(function (value) {\n // never reached\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // The `PedgagocialException` is propagated all the way down to here\n });\n ```\n Assimilation\n ------------\n Sometimes the value you want to propagate to a downstream promise can only be\n retrieved asynchronously. This can be achieved by returning a promise in the\n fulfillment or rejection handler. The downstream promise will then be pending\n until the returned promise is settled. This is called *assimilation*.\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // The user's comments are now available\n });\n ```\n If the assimliated promise rejects, then the downstream promise will also reject.\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // If `findCommentsByAuthor` fulfills, we'll have the value here\n }, function (reason) {\n // If `findCommentsByAuthor` rejects, we'll have the reason here\n });\n ```\n Simple Example\n --------------\n Synchronous Example\n ```javascript\n let result;\n try {\n result = findResult();\n // success\n } catch(reason) {\n // failure\n }\n ```\n Errback Example\n ```js\n findResult(function(result, err){\n if (err) {\n // failure\n } else {\n // success\n }\n });\n ```\n Promise Example;\n ```javascript\n findResult().then(function(result){\n // success\n }, function(reason){\n // failure\n });\n ```\n Advanced Example\n --------------\n Synchronous Example\n ```javascript\n let author, books;\n try {\n author = findAuthor();\n books = findBooksByAuthor(author);\n // success\n } catch(reason) {\n // failure\n }\n ```\n Errback Example\n ```js\n function foundBooks(books) {\n }\n function failure(reason) {\n }\n findAuthor(function(author, err){\n if (err) {\n failure(err);\n // failure\n } else {\n try {\n findBoooksByAuthor(author, function(books, err) {\n if (err) {\n failure(err);\n } else {\n try {\n foundBooks(books);\n } catch(reason) {\n failure(reason);\n }\n }\n });\n } catch(error) {\n failure(err);\n }\n // success\n }\n });\n ```\n Promise Example;\n ```javascript\n findAuthor().\n then(findBooksByAuthor).\n then(function(books){\n // found books\n }).catch(function(reason){\n // something went wrong\n });\n ```\n @method then\n @param {Function} onFulfilled\n @param {Function} onRejected\n Useful for tooling.\n @return {Promise}\n */\n\n /**\n `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same\n as the catch block of a try/catch statement.\n ```js\n function findAuthor(){\n throw new Error('couldn't find that author');\n }\n // synchronous\n try {\n findAuthor();\n } catch(reason) {\n // something went wrong\n }\n // async with promises\n findAuthor().catch(function(reason){\n // something went wrong\n });\n ```\n @method catch\n @param {Function} onRejection\n Useful for tooling.\n @return {Promise}\n */\n\n\n Promise.prototype.catch = function _catch(onRejection) {\n return this.then(null, onRejection);\n };\n\n /**\n `finally` will be invoked regardless of the promise's fate just as native\n try/catch/finally behaves\n \n Synchronous example:\n \n ```js\n findAuthor() {\n if (Math.random() > 0.5) {\n throw new Error();\n }\n return new Author();\n }\n \n try {\n return findAuthor(); // succeed or fail\n } catch(error) {\n return findOtherAuther();\n } finally {\n // always runs\n // doesn't affect the return value\n }\n ```\n \n Asynchronous example:\n \n ```js\n findAuthor().catch(function(reason){\n return findOtherAuther();\n }).finally(function(){\n // author was either found, or not\n });\n ```\n \n @method finally\n @param {Function} callback\n @return {Promise}\n */\n\n\n Promise.prototype.finally = function _finally(callback) {\n var promise = this;\n var constructor = promise.constructor;\n\n return promise.then(function (value) {\n return constructor.resolve(callback()).then(function () {\n return value;\n });\n }, function (reason) {\n return constructor.resolve(callback()).then(function () {\n throw reason;\n });\n });\n };\n\n return Promise;\n}();\n\nPromise.prototype.then = then;\nexport default Promise;\nPromise.all = all;\nPromise.race = race;\nPromise.resolve = Resolve;\nPromise.reject = Reject;\nPromise._setScheduler = setScheduler;\nPromise._setAsap = setAsap;\nPromise._asap = asap;","/*global self*/\nimport Promise from './promise';\n\nexport default function polyfill() {\n var local = void 0;\n\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n\n var P = local.Promise;\n\n if (P) {\n var promiseToString = null;\n try {\n promiseToString = Object.prototype.toString.call(P.resolve());\n } catch (e) {\n // silently ignored\n }\n\n if (promiseToString === '[object Promise]' && !P.cast) {\n return;\n }\n }\n\n local.Promise = Promise;\n}","import Promise from './es6-promise/promise';\nimport polyfill from './es6-promise/polyfill';\n\n// Strange compat..\nPromise.polyfill = polyfill;\nPromise.Promise = Promise;\nexport default Promise;","import Promise from './es6-promise';\nPromise.polyfill();\nexport default Promise;"],"names":["resolve","_resolve","then","originalThen","originalResolve","Promise","reject","_reject","Resolve","Reject"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACNO,SAAS,gBAAgB,CAAC,CAAC,EAAE;EAClC,IAAI,IAAI,GAAG,OAAO,CAAC,CAAC;EACpB,OAAO,CAAC,KAAK,IAAI,KAAK,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,UAAU,CAAC,CAAC;CACjE;;AAED,AAAO,SAAS,UAAU,CAAC,CAAC,EAAE;EAC5B,OAAO,OAAO,CAAC,KAAK,UAAU,CAAC;CAChC;;AAED,AAEC;;AAED,IAAI,QAAQ,GAAG,KAAK,CAAC,CAAC;AACtB,IAAI,KAAK,CAAC,OAAO,EAAE;EACjB,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC;CAC1B,MAAM;EACL,QAAQ,GAAG,UAAU,CAAC,EAAE;IACtB,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,gBAAgB,CAAC;GAC/D,CAAC;CACH;;AAED,AAAO,IAAI,OAAO,GAAG,QAAQ;;ACtB7B,IAAI,GAAG,GAAG,CAAC,CAAC;AACZ,IAAI,SAAS,GAAG,KAAK,CAAC,CAAC;AACvB,IAAI,iBAAiB,GAAG,KAAK,CAAC,CAAC;;AAE/B,AAAO,IAAI,IAAI,GAAG,SAAS,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE;EAC7C,KAAK,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;EACtB,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;EACrB,GAAG,IAAI,CAAC,CAAC;EACT,IAAI,GAAG,KAAK,CAAC,EAAE;;;;IAIb,IAAI,iBAAiB,EAAE;MACrB,iBAAiB,CAAC,KAAK,CAAC,CAAC;KAC1B,MAAM;MACL,aAAa,EAAE,CAAC;KACjB;GACF;CACF,CAAC;;AAEF,AAAO,SAAS,YAAY,CAAC,UAAU,EAAE;EACvC,iBAAiB,GAAG,UAAU,CAAC;CAChC;;AAED,AAAO,SAAS,OAAO,CAAC,MAAM,EAAE;EAC9B,IAAI,GAAG,MAAM,CAAC;CACf;;AAED,IAAI,aAAa,GAAG,OAAO,MAAM,KAAK,WAAW,GAAG,MAAM,GAAG,SAAS,CAAC;AACvE,IAAI,aAAa,GAAG,aAAa,IAAI,EAAE,CAAC;AACxC,IAAI,uBAAuB,GAAG,aAAa,CAAC,gBAAgB,IAAI,aAAa,CAAC,sBAAsB,CAAC;AACrG,IAAI,MAAM,GAAG,OAAO,IAAI,KAAK,WAAW,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,kBAAkB,CAAC;;;AAG/H,IAAI,QAAQ,GAAG,OAAO,iBAAiB,KAAK,WAAW,IAAI,OAAO,aAAa,KAAK,WAAW,IAAI,OAAO,cAAc,KAAK,WAAW,CAAC;;;AAGzI,SAAS,WAAW,GAAG;;;EAGrB,OAAO,YAAY;IACjB,OAAO,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;GAChC,CAAC;CACH;;;AAGD,SAAS,aAAa,GAAG;EACvB,IAAI,OAAO,SAAS,KAAK,WAAW,EAAE;IACpC,OAAO,YAAY;MACjB,SAAS,CAAC,KAAK,CAAC,CAAC;KAClB,CAAC;GACH;;EAED,OAAO,aAAa,EAAE,CAAC;CACxB;;AAED,SAAS,mBAAmB,GAAG;EAC7B,IAAI,UAAU,GAAG,CAAC,CAAC;EACnB,IAAI,QAAQ,GAAG,IAAI,uBAAuB,CAAC,KAAK,CAAC,CAAC;EAClD,IAAI,IAAI,GAAG,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;EACvC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;;EAEhD,OAAO,YAAY;IACjB,IAAI,CAAC,IAAI,GAAG,UAAU,GAAG,EAAE,UAAU,GAAG,CAAC,CAAC;GAC3C,CAAC;CACH;;;AAGD,SAAS,iBAAiB,GAAG;EAC3B,IAAI,OAAO,GAAG,IAAI,cAAc,EAAE,CAAC;EACnC,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC;EAChC,OAAO,YAAY;IACjB,OAAO,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;GACrC,CAAC;CACH;;AAED,SAAS,aAAa,GAAG;;;EAGvB,IAAI,gBAAgB,GAAG,UAAU,CAAC;EAClC,OAAO,YAAY;IACjB,OAAO,gBAAgB,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;GACnC,CAAC;CACH;;AAED,IAAI,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC;AAC5B,SAAS,KAAK,GAAG;EACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE;IAC/B,IAAI,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACxB,IAAI,GAAG,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;;IAEvB,QAAQ,CAAC,GAAG,CAAC,CAAC;;IAEd,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IACrB,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC;GAC1B;;EAED,GAAG,GAAG,CAAC,CAAC;CACT;;AAED,SAAS,YAAY,GAAG;EACtB,IAAI;IACF,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACvD,SAAS,GAAG,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,YAAY,CAAC;IAClD,OAAO,aAAa,EAAE,CAAC;GACxB,CAAC,OAAO,CAAC,EAAE;IACV,OAAO,aAAa,EAAE,CAAC;GACxB;CACF;;AAED,IAAI,aAAa,GAAG,KAAK,CAAC,CAAC;;AAE3B,IAAI,MAAM,EAAE;EACV,aAAa,GAAG,WAAW,EAAE,CAAC;CAC/B,MAAM,IAAI,uBAAuB,EAAE;EAClC,aAAa,GAAG,mBAAmB,EAAE,CAAC;CACvC,MAAM,IAAI,QAAQ,EAAE;EACnB,aAAa,GAAG,iBAAiB,EAAE,CAAC;CACrC,MAAM,IAAI,aAAa,KAAK,SAAS,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;EACvE,aAAa,GAAG,YAAY,EAAE,CAAC;CAChC,MAAM;EACL,aAAa,GAAG,aAAa,EAAE,CAAC;;;CACjC,DCtHc,SAAS,IAAI,CAAC,aAAa,EAAE,WAAW,EAAE;EACvD,IAAI,MAAM,GAAG,IAAI,CAAC;;EAElB,IAAI,KAAK,GAAG,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;;EAEvC,IAAI,KAAK,CAAC,UAAU,CAAC,KAAK,SAAS,EAAE;IACnC,WAAW,CAAC,KAAK,CAAC,CAAC;GACpB;;EAED,IAAI,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;;;EAG3B,IAAI,MAAM,EAAE;IACV,IAAI,QAAQ,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACrC,IAAI,CAAC,YAAY;MACf,OAAO,cAAc,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;KAChE,CAAC,CAAC;GACJ,MAAM;IACL,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC;GACtD;;EAED,OAAO,KAAK,CAAC;;;CACd,DCxBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,AAAe,SAASA,SAAO,CAAC,MAAM,EAAE;;EAEtC,IAAI,WAAW,GAAG,IAAI,CAAC;;EAEvB,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,WAAW,KAAK,WAAW,EAAE;IAC9E,OAAO,MAAM,CAAC;GACf;;EAED,IAAI,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;EACpCC,OAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;EAC1B,OAAO,OAAO,CAAC;;;CAChB,DCrCM,IAAI,UAAU,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;;AAEhE,SAAS,IAAI,GAAG,EAAE;;AAElB,IAAI,OAAO,GAAG,KAAK,CAAC,CAAC;AACrB,IAAI,SAAS,GAAG,CAAC,CAAC;AAClB,IAAI,QAAQ,GAAG,CAAC,CAAC;;AAEjB,IAAI,eAAe,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;;AAEtC,SAAS,eAAe,GAAG;EACzB,OAAO,IAAI,SAAS,CAAC,0CAA0C,CAAC,CAAC;CAClE;;AAED,SAAS,eAAe,GAAG;EACzB,OAAO,IAAI,SAAS,CAAC,sDAAsD,CAAC,CAAC;CAC9E;;AAED,SAAS,OAAO,CAAC,OAAO,EAAE;EACxB,IAAI;IACF,OAAO,OAAO,CAAC,IAAI,CAAC;GACrB,CAAC,OAAO,KAAK,EAAE;IACd,eAAe,CAAC,KAAK,GAAG,KAAK,CAAC;IAC9B,OAAO,eAAe,CAAC;GACxB;CACF;;AAED,SAAS,OAAO,CAACC,OAAI,EAAE,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE;EAClE,IAAI;IACFA,OAAI,CAAC,IAAI,CAAC,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,CAAC,CAAC;GACxD,CAAC,OAAO,CAAC,EAAE;IACV,OAAO,CAAC,CAAC;GACV;CACF;;AAED,SAAS,qBAAqB,CAAC,OAAO,EAAE,QAAQ,EAAEA,OAAI,EAAE;EACtD,IAAI,CAAC,UAAU,OAAO,EAAE;IACtB,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,IAAI,KAAK,GAAG,OAAO,CAACA,OAAI,EAAE,QAAQ,EAAE,UAAU,KAAK,EAAE;MACnD,IAAI,MAAM,EAAE;QACV,OAAO;OACR;MACD,MAAM,GAAG,IAAI,CAAC;MACd,IAAI,QAAQ,KAAK,KAAK,EAAE;QACtB,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;OACzB,MAAM;QACL,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;OACzB;KACF,EAAE,UAAU,MAAM,EAAE;MACnB,IAAI,MAAM,EAAE;QACV,OAAO;OACR;MACD,MAAM,GAAG,IAAI,CAAC;;MAEd,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KACzB,EAAE,UAAU,IAAI,OAAO,CAAC,MAAM,IAAI,kBAAkB,CAAC,CAAC,CAAC;;IAExD,IAAI,CAAC,MAAM,IAAI,KAAK,EAAE;MACpB,MAAM,GAAG,IAAI,CAAC;MACd,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KACxB;GACF,EAAE,OAAO,CAAC,CAAC;CACb;;AAED,SAAS,iBAAiB,CAAC,OAAO,EAAE,QAAQ,EAAE;EAC5C,IAAI,QAAQ,CAAC,MAAM,KAAK,SAAS,EAAE;IACjC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;GACpC,MAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,QAAQ,EAAE;IACvC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;GACnC,MAAM;IACL,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,KAAK,EAAE;MAC9C,OAAO,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KAChC,EAAE,UAAU,MAAM,EAAE;MACnB,OAAO,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KAChC,CAAC,CAAC;GACJ;CACF;;AAED,SAAS,mBAAmB,CAAC,OAAO,EAAE,aAAa,EAAEA,OAAI,EAAE;EACzD,IAAI,aAAa,CAAC,WAAW,KAAK,OAAO,CAAC,WAAW,IAAIA,OAAI,KAAKC,IAAY,IAAI,aAAa,CAAC,WAAW,CAAC,OAAO,KAAKC,SAAe,EAAE;IACvI,iBAAiB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;GAC3C,MAAM;IACL,IAAIF,OAAI,KAAK,eAAe,EAAE;MAC5B,MAAM,CAAC,OAAO,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC;MACvC,eAAe,CAAC,KAAK,GAAG,IAAI,CAAC;KAC9B,MAAM,IAAIA,OAAI,KAAK,SAAS,EAAE;MAC7B,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;KACjC,MAAM,IAAI,UAAU,CAACA,OAAI,CAAC,EAAE;MAC3B,qBAAqB,CAAC,OAAO,EAAE,aAAa,EAAEA,OAAI,CAAC,CAAC;KACrD,MAAM;MACL,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;KACjC;GACF;CACF;;AAED,SAAS,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE;EAC/B,IAAI,OAAO,KAAK,KAAK,EAAE;IACrB,MAAM,CAAC,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;GACpC,MAAM,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;IAClC,mBAAmB,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;GACrD,MAAM;IACL,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACzB;CACF;;AAED,SAAS,gBAAgB,CAAC,OAAO,EAAE;EACjC,IAAI,OAAO,CAAC,QAAQ,EAAE;IACpB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;GACnC;;EAED,OAAO,CAAC,OAAO,CAAC,CAAC;CAClB;;AAED,SAAS,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE;EAC/B,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;IAC9B,OAAO;GACR;;EAED,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC;EACxB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;;EAE3B,IAAI,OAAO,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE;IACrC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;GACxB;CACF;;AAED,SAAS,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE;EAC/B,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;IAC9B,OAAO;GACR;EACD,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC;EAC1B,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC;;EAEzB,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;CACjC;;AAED,SAAS,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE;EAC5D,IAAI,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;EACvC,IAAI,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC;;;EAGjC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC;;EAEvB,YAAY,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;EAC7B,YAAY,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,aAAa,CAAC;EACjD,YAAY,CAAC,MAAM,GAAG,QAAQ,CAAC,GAAG,WAAW,CAAC;;EAE9C,IAAI,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE;IACjC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;GACvB;CACF;;AAED,SAAS,OAAO,CAAC,OAAO,EAAE;EACxB,IAAI,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC;EACvC,IAAI,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;;EAE7B,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;IAC5B,OAAO;GACR;;EAED,IAAI,KAAK,GAAG,KAAK,CAAC;MACd,QAAQ,GAAG,KAAK,CAAC;MACjB,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;;EAE7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;IAC9C,KAAK,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;IACvB,QAAQ,GAAG,WAAW,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC;;IAEpC,IAAI,KAAK,EAAE;MACT,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;KAClD,MAAM;MACL,QAAQ,CAAC,MAAM,CAAC,CAAC;KAClB;GACF;;EAED,OAAO,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC;CACjC;;AAED,SAAS,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE;EAClC,IAAI;IACF,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC;GACzB,CAAC,OAAO,CAAC,EAAE;IACV,eAAe,CAAC,KAAK,GAAG,CAAC,CAAC;IAC1B,OAAO,eAAe,CAAC;GACxB;CACF;;AAED,SAAS,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE;EAC1D,IAAI,WAAW,GAAG,UAAU,CAAC,QAAQ,CAAC;MAClC,KAAK,GAAG,KAAK,CAAC;MACd,KAAK,GAAG,KAAK,CAAC;MACd,SAAS,GAAG,KAAK,CAAC;MAClB,MAAM,GAAG,KAAK,CAAC,CAAC;;EAEpB,IAAI,WAAW,EAAE;IACf,KAAK,GAAG,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;;IAEnC,IAAI,KAAK,KAAK,eAAe,EAAE;MAC7B,MAAM,GAAG,IAAI,CAAC;MACd,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;MACpB,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC;KACpB,MAAM;MACL,SAAS,GAAG,IAAI,CAAC;KAClB;;IAED,IAAI,OAAO,KAAK,KAAK,EAAE;MACrB,MAAM,CAAC,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;MACnC,OAAO;KACR;GACF,MAAM;IACL,KAAK,GAAG,MAAM,CAAC;IACf,SAAS,GAAG,IAAI,CAAC;GAClB;;EAED,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;;GAE/B,MAAM,IAAI,WAAW,IAAI,SAAS,EAAE;IACnC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACzB,MAAM,IAAI,MAAM,EAAE;IACjB,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACxB,MAAM,IAAI,OAAO,KAAK,SAAS,EAAE;IAChC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACzB,MAAM,IAAI,OAAO,KAAK,QAAQ,EAAE;IAC/B,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACxB;CACF;;AAED,SAAS,iBAAiB,CAAC,OAAO,EAAE,QAAQ,EAAE;EAC5C,IAAI;IACF,QAAQ,CAAC,SAAS,cAAc,CAAC,KAAK,EAAE;MACtC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KACzB,EAAE,SAAS,aAAa,CAAC,MAAM,EAAE;MAChC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KACzB,CAAC,CAAC;GACJ,CAAC,OAAO,CAAC,EAAE;IACV,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;GACpB;CACF;;AAED,IAAI,EAAE,GAAG,CAAC,CAAC;AACX,SAAS,MAAM,GAAG;EAChB,OAAO,EAAE,EAAE,CAAC;CACb;;AAED,SAAS,WAAW,CAAC,OAAO,EAAE;EAC5B,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC;EAC3B,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;EAC3B,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;EAC5B,OAAO,CAAC,YAAY,GAAG,EAAE,CAAC;CAC3B;;ACrPD,SAAS,eAAe,GAAG;EACzB,OAAO,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;CAC7D,AAAC;;AAEF,IAAI,UAAU,GAAG,YAAY;EAC3B,SAAS,UAAU,CAAC,WAAW,EAAE,KAAK,EAAE;IACtC,IAAI,CAAC,oBAAoB,GAAG,WAAW,CAAC;IACxC,IAAI,CAAC,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;;IAErC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;MAC7B,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KAC3B;;IAED,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE;MAClB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;MAC3B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC;;MAE/B,IAAI,CAAC,OAAO,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;;MAEtC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;QACrB,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;OACrC,MAAM;QACL,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC;QAC/B,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACvB,IAAI,IAAI,CAAC,UAAU,KAAK,CAAC,EAAE;UACzB,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;SACrC;OACF;KACF,MAAM;MACL,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;KACzC;GACF;;EAED,UAAU,CAAC,SAAS,CAAC,UAAU,GAAG,SAAS,UAAU,CAAC,KAAK,EAAE;IAC3D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,MAAM,KAAK,OAAO,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;MAChE,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;KAC9B;GACF,CAAC;;EAEF,UAAU,CAAC,SAAS,CAAC,UAAU,GAAG,SAAS,UAAU,CAAC,KAAK,EAAE,CAAC,EAAE;IAC9D,IAAI,CAAC,GAAG,IAAI,CAAC,oBAAoB,CAAC;IAClC,IAAIF,UAAO,GAAG,CAAC,CAAC,OAAO,CAAC;;;IAGxB,IAAIA,UAAO,KAAKI,SAAe,EAAE;MAC/B,IAAI,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;;MAE3B,IAAI,KAAK,KAAKD,IAAY,IAAI,KAAK,CAAC,MAAM,KAAK,OAAO,EAAE;QACtD,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;OACjD,MAAM,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE;QACtC,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;OACzB,MAAM,IAAI,CAAC,KAAKE,SAAO,EAAE;QACxB,IAAI,OAAO,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;QAC1B,mBAAmB,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAC3C,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;OAChC,MAAM;QACL,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,UAAUL,UAAO,EAAE;UAC1C,OAAOA,UAAO,CAAC,KAAK,CAAC,CAAC;SACvB,CAAC,EAAE,CAAC,CAAC,CAAC;OACR;KACF,MAAM;MACL,IAAI,CAAC,aAAa,CAACA,UAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;KACvC;GACF,CAAC;;EAEF,UAAU,CAAC,SAAS,CAAC,UAAU,GAAG,SAAS,UAAU,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE;IACrE,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;;;IAG3B,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;MAC9B,IAAI,CAAC,UAAU,EAAE,CAAC;;MAElB,IAAI,KAAK,KAAK,QAAQ,EAAE;QACtB,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;OACxB,MAAM;QACL,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;OACzB;KACF;;IAED,IAAI,IAAI,CAAC,UAAU,KAAK,CAAC,EAAE;MACzB,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;KAChC;GACF,CAAC;;EAEF,UAAU,CAAC,SAAS,CAAC,aAAa,GAAG,SAAS,aAAa,CAAC,OAAO,EAAE,CAAC,EAAE;IACtE,IAAI,UAAU,GAAG,IAAI,CAAC;;IAEtB,SAAS,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,KAAK,EAAE;MAC7C,OAAO,UAAU,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;KACnD,EAAE,UAAU,MAAM,EAAE;MACnB,OAAO,UAAU,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;KACnD,CAAC,CAAC;GACJ,CAAC;;EAEF,OAAO,UAAU,CAAC;CACnB,EAAE;;ACzGH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,AAAe,SAAS,GAAG,CAAC,OAAO,EAAE;EACnC,OAAO,IAAI,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC;;;CAC9C,DCjDD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,AAAe,SAAS,IAAI,CAAC,OAAO,EAAE;;EAEpC,IAAI,WAAW,GAAG,IAAI,CAAC;;EAEvB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;IACrB,OAAO,IAAI,WAAW,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE;MAC1C,OAAO,MAAM,CAAC,IAAI,SAAS,CAAC,iCAAiC,CAAC,CAAC,CAAC;KACjE,CAAC,CAAC;GACJ,MAAM;IACL,OAAO,IAAI,WAAW,CAAC,UAAU,OAAO,EAAE,MAAM,EAAE;MAChD,IAAI,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;MAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QAC/B,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;OACvD;KACF,CAAC,CAAC;GACJ;;;CACF,DCjFD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,AAAe,SAASM,QAAM,CAAC,MAAM,EAAE;;EAErC,IAAI,WAAW,GAAG,IAAI,CAAC;EACvB,IAAI,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;EACpCC,MAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;EACzB,OAAO,OAAO,CAAC;;;CAChB,DC9BD,SAAS,aAAa,GAAG;EACvB,MAAM,IAAI,SAAS,CAAC,oFAAoF,CAAC,CAAC;CAC3G;;AAED,SAAS,QAAQ,GAAG;EAClB,MAAM,IAAI,SAAS,CAAC,uHAAuH,CAAC,CAAC;CAC9I;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0GD,IAAIF,SAAO,GAAG,YAAY;EACxB,SAAS,OAAO,CAAC,QAAQ,EAAE;IACzB,IAAI,CAAC,UAAU,CAAC,GAAG,MAAM,EAAE,CAAC;IAC5B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;IACvC,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;;IAEvB,IAAI,IAAI,KAAK,QAAQ,EAAE;MACrB,OAAO,QAAQ,KAAK,UAAU,IAAI,aAAa,EAAE,CAAC;MAClD,IAAI,YAAY,OAAO,GAAG,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,GAAG,QAAQ,EAAE,CAAC;KAC1E;GACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4LD,OAAO,CAAC,SAAS,CAAC,KAAK,GAAG,SAAS,MAAM,CAAC,WAAW,EAAE;IACrD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;GACrC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0CF,OAAO,CAAC,SAAS,CAAC,OAAO,GAAG,SAAS,QAAQ,CAAC,QAAQ,EAAE;IACtD,IAAI,OAAO,GAAG,IAAI,CAAC;IACnB,IAAI,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;;IAEtC,OAAO,OAAO,CAAC,IAAI,CAAC,UAAU,KAAK,EAAE;MACnC,OAAO,WAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY;QACtD,OAAO,KAAK,CAAC;OACd,CAAC,CAAC;KACJ,EAAE,UAAU,MAAM,EAAE;MACnB,OAAO,WAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY;QACtD,MAAM,MAAM,CAAC;OACd,CAAC,CAAC;KACJ,CAAC,CAAC;GACJ,CAAC;;EAEF,OAAO,OAAO,CAAC;CAChB,EAAE,CAAC;;AAEJA,SAAO,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC;AAC9B,AACAA,SAAO,CAAC,GAAG,GAAG,GAAG,CAAC;AAClBA,SAAO,CAAC,IAAI,GAAG,IAAI,CAAC;AACpBA,SAAO,CAAC,OAAO,GAAGG,SAAO,CAAC;AAC1BH,SAAO,CAAC,MAAM,GAAGI,QAAM,CAAC;AACxBJ,SAAO,CAAC,aAAa,GAAG,YAAY,CAAC;AACrCA,SAAO,CAAC,QAAQ,GAAG,OAAO,CAAC;AAC3BA,SAAO,CAAC,KAAK,GAAG,IAAI;;ACxYpB;AACA,AAEe,SAAS,QAAQ,GAAG;EACjC,IAAI,KAAK,GAAG,KAAK,CAAC,CAAC;;EAEnB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IACjC,KAAK,GAAG,MAAM,CAAC;GAChB,MAAM,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;IACtC,KAAK,GAAG,IAAI,CAAC;GACd,MAAM;IACL,IAAI;MACF,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;KACnC,CAAC,OAAO,CAAC,EAAE;MACV,MAAM,IAAI,KAAK,CAAC,0EAA0E,CAAC,CAAC;KAC7F;GACF;;EAED,IAAI,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC;;EAEtB,IAAI,CAAC,EAAE;IACL,IAAI,eAAe,GAAG,IAAI,CAAC;IAC3B,IAAI;MACF,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;KAC/D,CAAC,OAAO,CAAC,EAAE;;KAEX;;IAED,IAAI,eAAe,KAAK,kBAAkB,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE;MACrD,OAAO;KACR;GACF;;EAED,KAAK,CAAC,OAAO,GAAGA,SAAO,CAAC;;;CACzB,DC/BD;AACAA,SAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC5BA,SAAO,CAAC,OAAO,GAAGA,SAAO,CAAC;;ACJ1BA,SAAO,CAAC,QAAQ,EAAE,CAAC;;;;;;;;","file":"es6-promise.auto.js"}!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.ES6Promise=e()}(this,function(){"use strict";function t(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}function e(t){return"function"==typeof t}function n(t){B=t}function r(t){G=t}function o(){return function(){return process.nextTick(a)}}function i(){return"undefined"!=typeof z?function(){z(a)}:c()}function s(){var t=0,e=new J(a),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function u(){var t=new MessageChannel;return t.port1.onmessage=a,function(){return t.port2.postMessage(0)}}function c(){var t=setTimeout;return function(){return t(a,1)}}function a(){for(var t=0;t postsJSON\n values[1] // => commentsJSON\n\n return values;\n });\n ```\n\n @class Promise\n @param {Function} resolver\n Useful for tooling.\n @constructor\n*/\n\nvar Promise = function () {\n function Promise(resolver) {\n this[PROMISE_ID] = nextId();\n this._result = this._state = undefined;\n this._subscribers = [];\n\n if (noop !== resolver) {\n typeof resolver !== 'function' && needsResolver();\n this instanceof Promise ? initializePromise(this, resolver) : needsNew();\n }\n }\n\n /**\n The primary way of interacting with a promise is through its `then` method,\n which registers callbacks to receive either a promise's eventual value or the\n reason why the promise cannot be fulfilled.\n ```js\n findUser().then(function(user){\n // user is available\n }, function(reason){\n // user is unavailable, and you are given the reason why\n });\n ```\n Chaining\n --------\n The return value of `then` is itself a promise. This second, 'downstream'\n promise is resolved with the return value of the first promise's fulfillment\n or rejection handler, or rejected if the handler throws an exception.\n ```js\n findUser().then(function (user) {\n return user.name;\n }, function (reason) {\n return 'default name';\n }).then(function (userName) {\n // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n // will be `'default name'`\n });\n findUser().then(function (user) {\n throw new Error('Found user, but still unhappy');\n }, function (reason) {\n throw new Error('`findUser` rejected and we're unhappy');\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.\n });\n ```\n If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.\n ```js\n findUser().then(function (user) {\n throw new PedagogicalException('Upstream error');\n }).then(function (value) {\n // never reached\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // The `PedgagocialException` is propagated all the way down to here\n });\n ```\n Assimilation\n ------------\n Sometimes the value you want to propagate to a downstream promise can only be\n retrieved asynchronously. This can be achieved by returning a promise in the\n fulfillment or rejection handler. The downstream promise will then be pending\n until the returned promise is settled. This is called *assimilation*.\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // The user's comments are now available\n });\n ```\n If the assimliated promise rejects, then the downstream promise will also reject.\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // If `findCommentsByAuthor` fulfills, we'll have the value here\n }, function (reason) {\n // If `findCommentsByAuthor` rejects, we'll have the reason here\n });\n ```\n Simple Example\n --------------\n Synchronous Example\n ```javascript\n let result;\n try {\n result = findResult();\n // success\n } catch(reason) {\n // failure\n }\n ```\n Errback Example\n ```js\n findResult(function(result, err){\n if (err) {\n // failure\n } else {\n // success\n }\n });\n ```\n Promise Example;\n ```javascript\n findResult().then(function(result){\n // success\n }, function(reason){\n // failure\n });\n ```\n Advanced Example\n --------------\n Synchronous Example\n ```javascript\n let author, books;\n try {\n author = findAuthor();\n books = findBooksByAuthor(author);\n // success\n } catch(reason) {\n // failure\n }\n ```\n Errback Example\n ```js\n function foundBooks(books) {\n }\n function failure(reason) {\n }\n findAuthor(function(author, err){\n if (err) {\n failure(err);\n // failure\n } else {\n try {\n findBoooksByAuthor(author, function(books, err) {\n if (err) {\n failure(err);\n } else {\n try {\n foundBooks(books);\n } catch(reason) {\n failure(reason);\n }\n }\n });\n } catch(error) {\n failure(err);\n }\n // success\n }\n });\n ```\n Promise Example;\n ```javascript\n findAuthor().\n then(findBooksByAuthor).\n then(function(books){\n // found books\n }).catch(function(reason){\n // something went wrong\n });\n ```\n @method then\n @param {Function} onFulfilled\n @param {Function} onRejected\n Useful for tooling.\n @return {Promise}\n */\n\n /**\n `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same\n as the catch block of a try/catch statement.\n ```js\n function findAuthor(){\n throw new Error('couldn't find that author');\n }\n // synchronous\n try {\n findAuthor();\n } catch(reason) {\n // something went wrong\n }\n // async with promises\n findAuthor().catch(function(reason){\n // something went wrong\n });\n ```\n @method catch\n @param {Function} onRejection\n Useful for tooling.\n @return {Promise}\n */\n\n\n Promise.prototype.catch = function _catch(onRejection) {\n return this.then(null, onRejection);\n };\n\n /**\n `finally` will be invoked regardless of the promise's fate just as native\n try/catch/finally behaves\n \n Synchronous example:\n \n ```js\n findAuthor() {\n if (Math.random() > 0.5) {\n throw new Error();\n }\n return new Author();\n }\n \n try {\n return findAuthor(); // succeed or fail\n } catch(error) {\n return findOtherAuther();\n } finally {\n // always runs\n // doesn't affect the return value\n }\n ```\n \n Asynchronous example:\n \n ```js\n findAuthor().catch(function(reason){\n return findOtherAuther();\n }).finally(function(){\n // author was either found, or not\n });\n ```\n \n @method finally\n @param {Function} callback\n @return {Promise}\n */\n\n\n Promise.prototype.finally = function _finally(callback) {\n var promise = this;\n var constructor = promise.constructor;\n\n return promise.then(function (value) {\n return constructor.resolve(callback()).then(function () {\n return value;\n });\n }, function (reason) {\n return constructor.resolve(callback()).then(function () {\n throw reason;\n });\n });\n };\n\n return Promise;\n}();\n\nPromise.prototype.then = then;\nexport default Promise;\nPromise.all = all;\nPromise.race = race;\nPromise.resolve = Resolve;\nPromise.reject = Reject;\nPromise._setScheduler = setScheduler;\nPromise._setAsap = setAsap;\nPromise._asap = asap;","/*global self*/\nimport Promise from './promise';\n\nexport default function polyfill() {\n var local = void 0;\n\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n\n var P = local.Promise;\n\n if (P) {\n var promiseToString = null;\n try {\n promiseToString = Object.prototype.toString.call(P.resolve());\n } catch (e) {\n // silently ignored\n }\n\n if (promiseToString === '[object Promise]' && !P.cast) {\n return;\n }\n }\n\n local.Promise = Promise;\n}","import Promise from './es6-promise/promise';\nimport polyfill from './es6-promise/polyfill';\n\n// Strange compat..\nPromise.polyfill = polyfill;\nPromise.Promise = Promise;\nexport default Promise;","import Promise from './es6-promise';\nPromise.polyfill();\nexport default Promise;"],"names":["resolve","_resolve","then","originalThen","originalResolve","Promise","reject","_reject","Resolve","Reject"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACNO,SAAS,gBAAgB,CAAC,CAAC,EAAE;EAClC,IAAI,IAAI,GAAG,OAAO,CAAC,CAAC;EACpB,OAAO,CAAC,KAAK,IAAI,KAAK,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,UAAU,CAAC,CAAC;CACjE;;AAED,AAAO,SAAS,UAAU,CAAC,CAAC,EAAE;EAC5B,OAAO,OAAO,CAAC,KAAK,UAAU,CAAC;CAChC;;AAED,AAEC;;AAED,IAAI,QAAQ,GAAG,KAAK,CAAC,CAAC;AACtB,IAAI,KAAK,CAAC,OAAO,EAAE;EACjB,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC;CAC1B,MAAM;EACL,QAAQ,GAAG,UAAU,CAAC,EAAE;IACtB,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,gBAAgB,CAAC;GAC/D,CAAC;CACH;;AAED,AAAO,IAAI,OAAO,GAAG,QAAQ;;ACtB7B,IAAI,GAAG,GAAG,CAAC,CAAC;AACZ,IAAI,SAAS,GAAG,KAAK,CAAC,CAAC;AACvB,IAAI,iBAAiB,GAAG,KAAK,CAAC,CAAC;;AAE/B,AAAO,IAAI,IAAI,GAAG,SAAS,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE;EAC7C,KAAK,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;EACtB,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;EACrB,GAAG,IAAI,CAAC,CAAC;EACT,IAAI,GAAG,KAAK,CAAC,EAAE;;;;IAIb,IAAI,iBAAiB,EAAE;MACrB,iBAAiB,CAAC,KAAK,CAAC,CAAC;KAC1B,MAAM;MACL,aAAa,EAAE,CAAC;KACjB;GACF;CACF,CAAC;;AAEF,AAAO,SAAS,YAAY,CAAC,UAAU,EAAE;EACvC,iBAAiB,GAAG,UAAU,CAAC;CAChC;;AAED,AAAO,SAAS,OAAO,CAAC,MAAM,EAAE;EAC9B,IAAI,GAAG,MAAM,CAAC;CACf;;AAED,IAAI,aAAa,GAAG,OAAO,MAAM,KAAK,WAAW,GAAG,MAAM,GAAG,SAAS,CAAC;AACvE,IAAI,aAAa,GAAG,aAAa,IAAI,EAAE,CAAC;AACxC,IAAI,uBAAuB,GAAG,aAAa,CAAC,gBAAgB,IAAI,aAAa,CAAC,sBAAsB,CAAC;AACrG,IAAI,MAAM,GAAG,OAAO,IAAI,KAAK,WAAW,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,kBAAkB,CAAC;;;AAG/H,IAAI,QAAQ,GAAG,OAAO,iBAAiB,KAAK,WAAW,IAAI,OAAO,aAAa,KAAK,WAAW,IAAI,OAAO,cAAc,KAAK,WAAW,CAAC;;;AAGzI,SAAS,WAAW,GAAG;;;EAGrB,OAAO,YAAY;IACjB,OAAO,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;GAChC,CAAC;CACH;;;AAGD,SAAS,aAAa,GAAG;EACvB,IAAI,OAAO,SAAS,KAAK,WAAW,EAAE;IACpC,OAAO,YAAY;MACjB,SAAS,CAAC,KAAK,CAAC,CAAC;KAClB,CAAC;GACH;;EAED,OAAO,aAAa,EAAE,CAAC;CACxB;;AAED,SAAS,mBAAmB,GAAG;EAC7B,IAAI,UAAU,GAAG,CAAC,CAAC;EACnB,IAAI,QAAQ,GAAG,IAAI,uBAAuB,CAAC,KAAK,CAAC,CAAC;EAClD,IAAI,IAAI,GAAG,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;EACvC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;;EAEhD,OAAO,YAAY;IACjB,IAAI,CAAC,IAAI,GAAG,UAAU,GAAG,EAAE,UAAU,GAAG,CAAC,CAAC;GAC3C,CAAC;CACH;;;AAGD,SAAS,iBAAiB,GAAG;EAC3B,IAAI,OAAO,GAAG,IAAI,cAAc,EAAE,CAAC;EACnC,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC;EAChC,OAAO,YAAY;IACjB,OAAO,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;GACrC,CAAC;CACH;;AAED,SAAS,aAAa,GAAG;;;EAGvB,IAAI,gBAAgB,GAAG,UAAU,CAAC;EAClC,OAAO,YAAY;IACjB,OAAO,gBAAgB,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;GACnC,CAAC;CACH;;AAED,IAAI,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC;AAC5B,SAAS,KAAK,GAAG;EACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE;IAC/B,IAAI,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACxB,IAAI,GAAG,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;;IAEvB,QAAQ,CAAC,GAAG,CAAC,CAAC;;IAEd,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IACrB,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC;GAC1B;;EAED,GAAG,GAAG,CAAC,CAAC;CACT;;AAED,SAAS,YAAY,GAAG;EACtB,IAAI;IACF,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACvD,SAAS,GAAG,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,YAAY,CAAC;IAClD,OAAO,aAAa,EAAE,CAAC;GACxB,CAAC,OAAO,CAAC,EAAE;IACV,OAAO,aAAa,EAAE,CAAC;GACxB;CACF;;AAED,IAAI,aAAa,GAAG,KAAK,CAAC,CAAC;;AAE3B,IAAI,MAAM,EAAE;EACV,aAAa,GAAG,WAAW,EAAE,CAAC;CAC/B,MAAM,IAAI,uBAAuB,EAAE;EAClC,aAAa,GAAG,mBAAmB,EAAE,CAAC;CACvC,MAAM,IAAI,QAAQ,EAAE;EACnB,aAAa,GAAG,iBAAiB,EAAE,CAAC;CACrC,MAAM,IAAI,aAAa,KAAK,SAAS,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;EACvE,aAAa,GAAG,YAAY,EAAE,CAAC;CAChC,MAAM;EACL,aAAa,GAAG,aAAa,EAAE,CAAC;;;CACjC,DCtHc,SAAS,IAAI,CAAC,aAAa,EAAE,WAAW,EAAE;EACvD,IAAI,MAAM,GAAG,IAAI,CAAC;;EAElB,IAAI,KAAK,GAAG,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;;EAEvC,IAAI,KAAK,CAAC,UAAU,CAAC,KAAK,SAAS,EAAE;IACnC,WAAW,CAAC,KAAK,CAAC,CAAC;GACpB;;EAED,IAAI,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;;;EAG3B,IAAI,MAAM,EAAE;IACV,IAAI,QAAQ,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACrC,IAAI,CAAC,YAAY;MACf,OAAO,cAAc,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;KAChE,CAAC,CAAC;GACJ,MAAM;IACL,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC;GACtD;;EAED,OAAO,KAAK,CAAC;;;CACd,DCxBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,AAAe,SAASA,SAAO,CAAC,MAAM,EAAE;;EAEtC,IAAI,WAAW,GAAG,IAAI,CAAC;;EAEvB,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,WAAW,KAAK,WAAW,EAAE;IAC9E,OAAO,MAAM,CAAC;GACf;;EAED,IAAI,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;EACpCC,OAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;EAC1B,OAAO,OAAO,CAAC;;;CAChB,DCrCM,IAAI,UAAU,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;;AAEhE,SAAS,IAAI,GAAG,EAAE;;AAElB,IAAI,OAAO,GAAG,KAAK,CAAC,CAAC;AACrB,IAAI,SAAS,GAAG,CAAC,CAAC;AAClB,IAAI,QAAQ,GAAG,CAAC,CAAC;;AAEjB,IAAI,eAAe,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;;AAEtC,SAAS,eAAe,GAAG;EACzB,OAAO,IAAI,SAAS,CAAC,0CAA0C,CAAC,CAAC;CAClE;;AAED,SAAS,eAAe,GAAG;EACzB,OAAO,IAAI,SAAS,CAAC,sDAAsD,CAAC,CAAC;CAC9E;;AAED,SAAS,OAAO,CAAC,OAAO,EAAE;EACxB,IAAI;IACF,OAAO,OAAO,CAAC,IAAI,CAAC;GACrB,CAAC,OAAO,KAAK,EAAE;IACd,eAAe,CAAC,KAAK,GAAG,KAAK,CAAC;IAC9B,OAAO,eAAe,CAAC;GACxB;CACF;;AAED,SAAS,OAAO,CAACC,OAAI,EAAE,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE;EAClE,IAAI;IACFA,OAAI,CAAC,IAAI,CAAC,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,CAAC,CAAC;GACxD,CAAC,OAAO,CAAC,EAAE;IACV,OAAO,CAAC,CAAC;GACV;CACF;;AAED,SAAS,qBAAqB,CAAC,OAAO,EAAE,QAAQ,EAAEA,OAAI,EAAE;EACtD,IAAI,CAAC,UAAU,OAAO,EAAE;IACtB,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,IAAI,KAAK,GAAG,OAAO,CAACA,OAAI,EAAE,QAAQ,EAAE,UAAU,KAAK,EAAE;MACnD,IAAI,MAAM,EAAE;QACV,OAAO;OACR;MACD,MAAM,GAAG,IAAI,CAAC;MACd,IAAI,QAAQ,KAAK,KAAK,EAAE;QACtB,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;OACzB,MAAM;QACL,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;OACzB;KACF,EAAE,UAAU,MAAM,EAAE;MACnB,IAAI,MAAM,EAAE;QACV,OAAO;OACR;MACD,MAAM,GAAG,IAAI,CAAC;;MAEd,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KACzB,EAAE,UAAU,IAAI,OAAO,CAAC,MAAM,IAAI,kBAAkB,CAAC,CAAC,CAAC;;IAExD,IAAI,CAAC,MAAM,IAAI,KAAK,EAAE;MACpB,MAAM,GAAG,IAAI,CAAC;MACd,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KACxB;GACF,EAAE,OAAO,CAAC,CAAC;CACb;;AAED,SAAS,iBAAiB,CAAC,OAAO,EAAE,QAAQ,EAAE;EAC5C,IAAI,QAAQ,CAAC,MAAM,KAAK,SAAS,EAAE;IACjC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;GACpC,MAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,QAAQ,EAAE;IACvC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;GACnC,MAAM;IACL,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,KAAK,EAAE;MAC9C,OAAO,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KAChC,EAAE,UAAU,MAAM,EAAE;MACnB,OAAO,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KAChC,CAAC,CAAC;GACJ;CACF;;AAED,SAAS,mBAAmB,CAAC,OAAO,EAAE,aAAa,EAAEA,OAAI,EAAE;EACzD,IAAI,aAAa,CAAC,WAAW,KAAK,OAAO,CAAC,WAAW,IAAIA,OAAI,KAAKC,IAAY,IAAI,aAAa,CAAC,WAAW,CAAC,OAAO,KAAKC,SAAe,EAAE;IACvI,iBAAiB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;GAC3C,MAAM;IACL,IAAIF,OAAI,KAAK,eAAe,EAAE;MAC5B,MAAM,CAAC,OAAO,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC;MACvC,eAAe,CAAC,KAAK,GAAG,IAAI,CAAC;KAC9B,MAAM,IAAIA,OAAI,KAAK,SAAS,EAAE;MAC7B,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;KACjC,MAAM,IAAI,UAAU,CAACA,OAAI,CAAC,EAAE;MAC3B,qBAAqB,CAAC,OAAO,EAAE,aAAa,EAAEA,OAAI,CAAC,CAAC;KACrD,MAAM;MACL,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;KACjC;GACF;CACF;;AAED,SAAS,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE;EAC/B,IAAI,OAAO,KAAK,KAAK,EAAE;IACrB,MAAM,CAAC,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;GACpC,MAAM,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;IAClC,mBAAmB,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;GACrD,MAAM;IACL,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACzB;CACF;;AAED,SAAS,gBAAgB,CAAC,OAAO,EAAE;EACjC,IAAI,OAAO,CAAC,QAAQ,EAAE;IACpB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;GACnC;;EAED,OAAO,CAAC,OAAO,CAAC,CAAC;CAClB;;AAED,SAAS,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE;EAC/B,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;IAC9B,OAAO;GACR;;EAED,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC;EACxB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;;EAE3B,IAAI,OAAO,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE;IACrC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;GACxB;CACF;;AAED,SAAS,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE;EAC/B,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;IAC9B,OAAO;GACR;EACD,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC;EAC1B,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC;;EAEzB,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;CACjC;;AAED,SAAS,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE;EAC5D,IAAI,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;EACvC,IAAI,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC;;;EAGjC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC;;EAEvB,YAAY,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;EAC7B,YAAY,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,aAAa,CAAC;EACjD,YAAY,CAAC,MAAM,GAAG,QAAQ,CAAC,GAAG,WAAW,CAAC;;EAE9C,IAAI,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE;IACjC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;GACvB;CACF;;AAED,SAAS,OAAO,CAAC,OAAO,EAAE;EACxB,IAAI,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC;EACvC,IAAI,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;;EAE7B,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;IAC5B,OAAO;GACR;;EAED,IAAI,KAAK,GAAG,KAAK,CAAC;MACd,QAAQ,GAAG,KAAK,CAAC;MACjB,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;;EAE7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;IAC9C,KAAK,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;IACvB,QAAQ,GAAG,WAAW,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC;;IAEpC,IAAI,KAAK,EAAE;MACT,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;KAClD,MAAM;MACL,QAAQ,CAAC,MAAM,CAAC,CAAC;KAClB;GACF;;EAED,OAAO,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC;CACjC;;AAED,SAAS,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE;EAClC,IAAI;IACF,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC;GACzB,CAAC,OAAO,CAAC,EAAE;IACV,eAAe,CAAC,KAAK,GAAG,CAAC,CAAC;IAC1B,OAAO,eAAe,CAAC;GACxB;CACF;;AAED,SAAS,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE;EAC1D,IAAI,WAAW,GAAG,UAAU,CAAC,QAAQ,CAAC;MAClC,KAAK,GAAG,KAAK,CAAC;MACd,KAAK,GAAG,KAAK,CAAC;MACd,SAAS,GAAG,KAAK,CAAC;MAClB,MAAM,GAAG,KAAK,CAAC,CAAC;;EAEpB,IAAI,WAAW,EAAE;IACf,KAAK,GAAG,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;;IAEnC,IAAI,KAAK,KAAK,eAAe,EAAE;MAC7B,MAAM,GAAG,IAAI,CAAC;MACd,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;MACpB,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC;KACpB,MAAM;MACL,SAAS,GAAG,IAAI,CAAC;KAClB;;IAED,IAAI,OAAO,KAAK,KAAK,EAAE;MACrB,MAAM,CAAC,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;MACnC,OAAO;KACR;GACF,MAAM;IACL,KAAK,GAAG,MAAM,CAAC;IACf,SAAS,GAAG,IAAI,CAAC;GAClB;;EAED,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;;GAE/B,MAAM,IAAI,WAAW,IAAI,SAAS,EAAE;IACnC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACzB,MAAM,IAAI,MAAM,EAAE;IACjB,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACxB,MAAM,IAAI,OAAO,KAAK,SAAS,EAAE;IAChC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACzB,MAAM,IAAI,OAAO,KAAK,QAAQ,EAAE;IAC/B,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACxB;CACF;;AAED,SAAS,iBAAiB,CAAC,OAAO,EAAE,QAAQ,EAAE;EAC5C,IAAI;IACF,QAAQ,CAAC,SAAS,cAAc,CAAC,KAAK,EAAE;MACtC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KACzB,EAAE,SAAS,aAAa,CAAC,MAAM,EAAE;MAChC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KACzB,CAAC,CAAC;GACJ,CAAC,OAAO,CAAC,EAAE;IACV,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;GACpB;CACF;;AAED,IAAI,EAAE,GAAG,CAAC,CAAC;AACX,SAAS,MAAM,GAAG;EAChB,OAAO,EAAE,EAAE,CAAC;CACb;;AAED,SAAS,WAAW,CAAC,OAAO,EAAE;EAC5B,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC;EAC3B,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;EAC3B,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;EAC5B,OAAO,CAAC,YAAY,GAAG,EAAE,CAAC;CAC3B;;ACrPD,SAAS,eAAe,GAAG;EACzB,OAAO,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;CAC7D,AAAC;;AAEF,IAAI,UAAU,GAAG,YAAY;EAC3B,SAAS,UAAU,CAAC,WAAW,EAAE,KAAK,EAAE;IACtC,IAAI,CAAC,oBAAoB,GAAG,WAAW,CAAC;IACxC,IAAI,CAAC,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;;IAErC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;MAC7B,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KAC3B;;IAED,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE;MAClB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;MAC3B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC;;MAE/B,IAAI,CAAC,OAAO,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;;MAEtC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;QACrB,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;OACrC,MAAM;QACL,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC;QAC/B,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACvB,IAAI,IAAI,CAAC,UAAU,KAAK,CAAC,EAAE;UACzB,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;SACrC;OACF;KACF,MAAM;MACL,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;KACzC;GACF;;EAED,UAAU,CAAC,SAAS,CAAC,UAAU,GAAG,SAAS,UAAU,CAAC,KAAK,EAAE;IAC3D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,MAAM,KAAK,OAAO,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;MAChE,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;KAC9B;GACF,CAAC;;EAEF,UAAU,CAAC,SAAS,CAAC,UAAU,GAAG,SAAS,UAAU,CAAC,KAAK,EAAE,CAAC,EAAE;IAC9D,IAAI,CAAC,GAAG,IAAI,CAAC,oBAAoB,CAAC;IAClC,IAAIF,UAAO,GAAG,CAAC,CAAC,OAAO,CAAC;;;IAGxB,IAAIA,UAAO,KAAKI,SAAe,EAAE;MAC/B,IAAI,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;;MAE3B,IAAI,KAAK,KAAKD,IAAY,IAAI,KAAK,CAAC,MAAM,KAAK,OAAO,EAAE;QACtD,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;OACjD,MAAM,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE;QACtC,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;OACzB,MAAM,IAAI,CAAC,KAAKE,SAAO,EAAE;QACxB,IAAI,OAAO,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;QAC1B,mBAAmB,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAC3C,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;OAChC,MAAM;QACL,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,UAAUL,UAAO,EAAE;UAC1C,OAAOA,UAAO,CAAC,KAAK,CAAC,CAAC;SACvB,CAAC,EAAE,CAAC,CAAC,CAAC;OACR;KACF,MAAM;MACL,IAAI,CAAC,aAAa,CAACA,UAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;KACvC;GACF,CAAC;;EAEF,UAAU,CAAC,SAAS,CAAC,UAAU,GAAG,SAAS,UAAU,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE;IACrE,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;;;IAG3B,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;MAC9B,IAAI,CAAC,UAAU,EAAE,CAAC;;MAElB,IAAI,KAAK,KAAK,QAAQ,EAAE;QACtB,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;OACxB,MAAM;QACL,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;OACzB;KACF;;IAED,IAAI,IAAI,CAAC,UAAU,KAAK,CAAC,EAAE;MACzB,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;KAChC;GACF,CAAC;;EAEF,UAAU,CAAC,SAAS,CAAC,aAAa,GAAG,SAAS,aAAa,CAAC,OAAO,EAAE,CAAC,EAAE;IACtE,IAAI,UAAU,GAAG,IAAI,CAAC;;IAEtB,SAAS,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,KAAK,EAAE;MAC7C,OAAO,UAAU,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;KACnD,EAAE,UAAU,MAAM,EAAE;MACnB,OAAO,UAAU,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;KACnD,CAAC,CAAC;GACJ,CAAC;;EAEF,OAAO,UAAU,CAAC;CACnB,EAAE;;ACzGH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,AAAe,SAAS,GAAG,CAAC,OAAO,EAAE;EACnC,OAAO,IAAI,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC;;;CAC9C,DCjDD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,AAAe,SAAS,IAAI,CAAC,OAAO,EAAE;;EAEpC,IAAI,WAAW,GAAG,IAAI,CAAC;;EAEvB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;IACrB,OAAO,IAAI,WAAW,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE;MAC1C,OAAO,MAAM,CAAC,IAAI,SAAS,CAAC,iCAAiC,CAAC,CAAC,CAAC;KACjE,CAAC,CAAC;GACJ,MAAM;IACL,OAAO,IAAI,WAAW,CAAC,UAAU,OAAO,EAAE,MAAM,EAAE;MAChD,IAAI,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;MAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QAC/B,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;OACvD;KACF,CAAC,CAAC;GACJ;;;CACF,DCjFD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,AAAe,SAASM,QAAM,CAAC,MAAM,EAAE;;EAErC,IAAI,WAAW,GAAG,IAAI,CAAC;EACvB,IAAI,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;EACpCC,MAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;EACzB,OAAO,OAAO,CAAC;;;CAChB,DC9BD,SAAS,aAAa,GAAG;EACvB,MAAM,IAAI,SAAS,CAAC,oFAAoF,CAAC,CAAC;CAC3G;;AAED,SAAS,QAAQ,GAAG;EAClB,MAAM,IAAI,SAAS,CAAC,uHAAuH,CAAC,CAAC;CAC9I;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0GD,IAAIF,SAAO,GAAG,YAAY;EACxB,SAAS,OAAO,CAAC,QAAQ,EAAE;IACzB,IAAI,CAAC,UAAU,CAAC,GAAG,MAAM,EAAE,CAAC;IAC5B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;IACvC,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;;IAEvB,IAAI,IAAI,KAAK,QAAQ,EAAE;MACrB,OAAO,QAAQ,KAAK,UAAU,IAAI,aAAa,EAAE,CAAC;MAClD,IAAI,YAAY,OAAO,GAAG,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,GAAG,QAAQ,EAAE,CAAC;KAC1E;GACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4LD,OAAO,CAAC,SAAS,CAAC,KAAK,GAAG,SAAS,MAAM,CAAC,WAAW,EAAE;IACrD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;GACrC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0CF,OAAO,CAAC,SAAS,CAAC,OAAO,GAAG,SAAS,QAAQ,CAAC,QAAQ,EAAE;IACtD,IAAI,OAAO,GAAG,IAAI,CAAC;IACnB,IAAI,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;;IAEtC,OAAO,OAAO,CAAC,IAAI,CAAC,UAAU,KAAK,EAAE;MACnC,OAAO,WAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY;QACtD,OAAO,KAAK,CAAC;OACd,CAAC,CAAC;KACJ,EAAE,UAAU,MAAM,EAAE;MACnB,OAAO,WAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY;QACtD,MAAM,MAAM,CAAC;OACd,CAAC,CAAC;KACJ,CAAC,CAAC;GACJ,CAAC;;EAEF,OAAO,OAAO,CAAC;CAChB,EAAE,CAAC;;AAEJA,SAAO,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC;AAC9B,AACAA,SAAO,CAAC,GAAG,GAAG,GAAG,CAAC;AAClBA,SAAO,CAAC,IAAI,GAAG,IAAI,CAAC;AACpBA,SAAO,CAAC,OAAO,GAAGG,SAAO,CAAC;AAC1BH,SAAO,CAAC,MAAM,GAAGI,QAAM,CAAC;AACxBJ,SAAO,CAAC,aAAa,GAAG,YAAY,CAAC;AACrCA,SAAO,CAAC,QAAQ,GAAG,OAAO,CAAC;AAC3BA,SAAO,CAAC,KAAK,GAAG,IAAI;;ACxYpB;AACA,AAEe,SAAS,QAAQ,GAAG;EACjC,IAAI,KAAK,GAAG,KAAK,CAAC,CAAC;;EAEnB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IACjC,KAAK,GAAG,MAAM,CAAC;GAChB,MAAM,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;IACtC,KAAK,GAAG,IAAI,CAAC;GACd,MAAM;IACL,IAAI;MACF,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;KACnC,CAAC,OAAO,CAAC,EAAE;MACV,MAAM,IAAI,KAAK,CAAC,0EAA0E,CAAC,CAAC;KAC7F;GACF;;EAED,IAAI,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC;;EAEtB,IAAI,CAAC,EAAE;IACL,IAAI,eAAe,GAAG,IAAI,CAAC;IAC3B,IAAI;MACF,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;KAC/D,CAAC,OAAO,CAAC,EAAE;;KAEX;;IAED,IAAI,eAAe,KAAK,kBAAkB,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE;MACrD,OAAO;KACR;GACF;;EAED,KAAK,CAAC,OAAO,GAAGA,SAAO,CAAC;;;CACzB,DC/BD;AACAA,SAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC5BA,SAAO,CAAC,OAAO,GAAGA,SAAO,CAAC;;ACJ1BA,SAAO,CAAC,QAAQ,EAAE,CAAC;;;;;;;;","file":"es6-promise.auto.min.js"}/*! * @overview es6-promise - a tiny implementation of Promises/A+. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) * @license Licensed under MIT license * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE * @version v4.2.4+314e4831 */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global.ES6Promise = factory()); }(this, (function () { 'use strict'; function objectOrFunction(x) { var type = typeof x; return x !== null && (type === 'object' || type === 'function'); } function isFunction(x) { return typeof x === 'function'; } var _isArray = void 0; if (Array.isArray) { _isArray = Array.isArray; } else { _isArray = function (x) { return Object.prototype.toString.call(x) === '[object Array]'; }; } var isArray = _isArray; var len = 0; var vertxNext = void 0; var customSchedulerFn = void 0; var asap = function asap(callback, arg) { queue[len] = callback; queue[len + 1] = arg; len += 2; if (len === 2) { // If len is 2, that means that we need to schedule an async flush. // If additional callbacks are queued before the queue is flushed, they // will be processed by this flush that we are scheduling. if (customSchedulerFn) { customSchedulerFn(flush); } else { scheduleFlush(); } } }; function setScheduler(scheduleFn) { customSchedulerFn = scheduleFn; } function setAsap(asapFn) { asap = asapFn; } var browserWindow = typeof window !== 'undefined' ? window : undefined; var browserGlobal = browserWindow || {}; var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver; var isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]'; // test for web worker but not in IE10 var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined'; // node function useNextTick() { // node version 0.10.x displays a deprecation warning when nextTick is used recursively // see https://github.com/cujojs/when/issues/410 for details return function () { return process.nextTick(flush); }; } // vertx function useVertxTimer() { if (typeof vertxNext !== 'undefined') { return function () { vertxNext(flush); }; } return useSetTimeout(); } function useMutationObserver() { var iterations = 0; var observer = new BrowserMutationObserver(flush); var node = document.createTextNode(''); observer.observe(node, { characterData: true }); return function () { node.data = iterations = ++iterations % 2; }; } // web worker function useMessageChannel() { var channel = new MessageChannel(); channel.port1.onmessage = flush; return function () { return channel.port2.postMessage(0); }; } function useSetTimeout() { // Store setTimeout reference so es6-promise will be unaffected by // other code modifying setTimeout (like sinon.useFakeTimers()) var globalSetTimeout = setTimeout; return function () { return globalSetTimeout(flush, 1); }; } var queue = new Array(1000); function flush() { for (var i = 0; i < len; i += 2) { var callback = queue[i]; var arg = queue[i + 1]; callback(arg); queue[i] = undefined; queue[i + 1] = undefined; } len = 0; } function attemptVertx() { try { var vertx = Function('return this')().require('vertx'); vertxNext = vertx.runOnLoop || vertx.runOnContext; return useVertxTimer(); } catch (e) { return useSetTimeout(); } } var scheduleFlush = void 0; // Decide what async method to use to triggering processing of queued callbacks: if (isNode) { scheduleFlush = useNextTick(); } else if (BrowserMutationObserver) { scheduleFlush = useMutationObserver(); } else if (isWorker) { scheduleFlush = useMessageChannel(); } else if (browserWindow === undefined && typeof require === 'function') { scheduleFlush = attemptVertx(); } else { scheduleFlush = useSetTimeout(); } function then(onFulfillment, onRejection) { var parent = this; var child = new this.constructor(noop); if (child[PROMISE_ID] === undefined) { makePromise(child); } var _state = parent._state; if (_state) { var callback = arguments[_state - 1]; asap(function () { return invokeCallback(_state, child, callback, parent._result); }); } else { subscribe(parent, child, onFulfillment, onRejection); } return child; } /** `Promise.resolve` returns a promise that will become resolved with the passed `value`. It is shorthand for the following: ```javascript let promise = new Promise(function(resolve, reject){ resolve(1); }); promise.then(function(value){ // value === 1 }); ``` Instead of writing the above, your code now simply becomes the following: ```javascript let promise = Promise.resolve(1); promise.then(function(value){ // value === 1 }); ``` @method resolve @static @param {Any} value value that the returned promise will be resolved with Useful for tooling. @return {Promise} a promise that will become fulfilled with the given `value` */ function resolve$1(object) { /*jshint validthis:true */ var Constructor = this; if (object && typeof object === 'object' && object.constructor === Constructor) { return object; } var promise = new Constructor(noop); resolve(promise, object); return promise; } var PROMISE_ID = Math.random().toString(36).substring(2); function noop() {} var PENDING = void 0; var FULFILLED = 1; var REJECTED = 2; var TRY_CATCH_ERROR = { error: null }; function selfFulfillment() { return new TypeError("You cannot resolve a promise with itself"); } function cannotReturnOwn() { return new TypeError('A promises callback cannot return that same promise.'); } function getThen(promise) { try { return promise.then; } catch (error) { TRY_CATCH_ERROR.error = error; return TRY_CATCH_ERROR; } } function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) { try { then$$1.call(value, fulfillmentHandler, rejectionHandler); } catch (e) { return e; } } function handleForeignThenable(promise, thenable, then$$1) { asap(function (promise) { var sealed = false; var error = tryThen(then$$1, thenable, function (value) { if (sealed) { return; } sealed = true; if (thenable !== value) { resolve(promise, value); } else { fulfill(promise, value); } }, function (reason) { if (sealed) { return; } sealed = true; reject(promise, reason); }, 'Settle: ' + (promise._label || ' unknown promise')); if (!sealed && error) { sealed = true; reject(promise, error); } }, promise); } function handleOwnThenable(promise, thenable) { if (thenable._state === FULFILLED) { fulfill(promise, thenable._result); } else if (thenable._state === REJECTED) { reject(promise, thenable._result); } else { subscribe(thenable, undefined, function (value) { return resolve(promise, value); }, function (reason) { return reject(promise, reason); }); } } function handleMaybeThenable(promise, maybeThenable, then$$1) { if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) { handleOwnThenable(promise, maybeThenable); } else { if (then$$1 === TRY_CATCH_ERROR) { reject(promise, TRY_CATCH_ERROR.error); TRY_CATCH_ERROR.error = null; } else if (then$$1 === undefined) { fulfill(promise, maybeThenable); } else if (isFunction(then$$1)) { handleForeignThenable(promise, maybeThenable, then$$1); } else { fulfill(promise, maybeThenable); } } } function resolve(promise, value) { if (promise === value) { reject(promise, selfFulfillment()); } else if (objectOrFunction(value)) { handleMaybeThenable(promise, value, getThen(value)); } else { fulfill(promise, value); } } function publishRejection(promise) { if (promise._onerror) { promise._onerror(promise._result); } publish(promise); } function fulfill(promise, value) { if (promise._state !== PENDING) { return; } promise._result = value; promise._state = FULFILLED; if (promise._subscribers.length !== 0) { asap(publish, promise); } } function reject(promise, reason) { if (promise._state !== PENDING) { return; } promise._state = REJECTED; promise._result = reason; asap(publishRejection, promise); } function subscribe(parent, child, onFulfillment, onRejection) { var _subscribers = parent._subscribers; var length = _subscribers.length; parent._onerror = null; _subscribers[length] = child; _subscribers[length + FULFILLED] = onFulfillment; _subscribers[length + REJECTED] = onRejection; if (length === 0 && parent._state) { asap(publish, parent); } } function publish(promise) { var subscribers = promise._subscribers; var settled = promise._state; if (subscribers.length === 0) { return; } var child = void 0, callback = void 0, detail = promise._result; for (var i = 0; i < subscribers.length; i += 3) { child = subscribers[i]; callback = subscribers[i + settled]; if (child) { invokeCallback(settled, child, callback, detail); } else { callback(detail); } } promise._subscribers.length = 0; } function tryCatch(callback, detail) { try { return callback(detail); } catch (e) { TRY_CATCH_ERROR.error = e; return TRY_CATCH_ERROR; } } function invokeCallback(settled, promise, callback, detail) { var hasCallback = isFunction(callback), value = void 0, error = void 0, succeeded = void 0, failed = void 0; if (hasCallback) { value = tryCatch(callback, detail); if (value === TRY_CATCH_ERROR) { failed = true; error = value.error; value.error = null; } else { succeeded = true; } if (promise === value) { reject(promise, cannotReturnOwn()); return; } } else { value = detail; succeeded = true; } if (promise._state !== PENDING) { // noop } else if (hasCallback && succeeded) { resolve(promise, value); } else if (failed) { reject(promise, error); } else if (settled === FULFILLED) { fulfill(promise, value); } else if (settled === REJECTED) { reject(promise, value); } } function initializePromise(promise, resolver) { try { resolver(function resolvePromise(value) { resolve(promise, value); }, function rejectPromise(reason) { reject(promise, reason); }); } catch (e) { reject(promise, e); } } var id = 0; function nextId() { return id++; } function makePromise(promise) { promise[PROMISE_ID] = id++; promise._state = undefined; promise._result = undefined; promise._subscribers = []; } function validationError() { return new Error('Array Methods must be provided an Array'); } var Enumerator = function () { function Enumerator(Constructor, input) { this._instanceConstructor = Constructor; this.promise = new Constructor(noop); if (!this.promise[PROMISE_ID]) { makePromise(this.promise); } if (isArray(input)) { this.length = input.length; this._remaining = input.length; this._result = new Array(this.length); if (this.length === 0) { fulfill(this.promise, this._result); } else { this.length = this.length || 0; this._enumerate(input); if (this._remaining === 0) { fulfill(this.promise, this._result); } } } else { reject(this.promise, validationError()); } } Enumerator.prototype._enumerate = function _enumerate(input) { for (var i = 0; this._state === PENDING && i < input.length; i++) { this._eachEntry(input[i], i); } }; Enumerator.prototype._eachEntry = function _eachEntry(entry, i) { var c = this._instanceConstructor; var resolve$$1 = c.resolve; if (resolve$$1 === resolve$1) { var _then = getThen(entry); if (_then === then && entry._state !== PENDING) { this._settledAt(entry._state, i, entry._result); } else if (typeof _then !== 'function') { this._remaining--; this._result[i] = entry; } else if (c === Promise$1) { var promise = new c(noop); handleMaybeThenable(promise, entry, _then); this._willSettleAt(promise, i); } else { this._willSettleAt(new c(function (resolve$$1) { return resolve$$1(entry); }), i); } } else { this._willSettleAt(resolve$$1(entry), i); } }; Enumerator.prototype._settledAt = function _settledAt(state, i, value) { var promise = this.promise; if (promise._state === PENDING) { this._remaining--; if (state === REJECTED) { reject(promise, value); } else { this._result[i] = value; } } if (this._remaining === 0) { fulfill(promise, this._result); } }; Enumerator.prototype._willSettleAt = function _willSettleAt(promise, i) { var enumerator = this; subscribe(promise, undefined, function (value) { return enumerator._settledAt(FULFILLED, i, value); }, function (reason) { return enumerator._settledAt(REJECTED, i, reason); }); }; return Enumerator; }(); /** `Promise.all` accepts an array of promises, and returns a new promise which is fulfilled with an array of fulfillment values for the passed promises, or rejected with the reason of the first passed promise to be rejected. It casts all elements of the passed iterable to promises as it runs this algorithm. Example: ```javascript let promise1 = resolve(1); let promise2 = resolve(2); let promise3 = resolve(3); let promises = [ promise1, promise2, promise3 ]; Promise.all(promises).then(function(array){ // The array here would be [ 1, 2, 3 ]; }); ``` If any of the `promises` given to `all` are rejected, the first promise that is rejected will be given as an argument to the returned promises's rejection handler. For example: Example: ```javascript let promise1 = resolve(1); let promise2 = reject(new Error("2")); let promise3 = reject(new Error("3")); let promises = [ promise1, promise2, promise3 ]; Promise.all(promises).then(function(array){ // Code here never runs because there are rejected promises! }, function(error) { // error.message === "2" }); ``` @method all @static @param {Array} entries array of promises @param {String} label optional string for labeling the promise. Useful for tooling. @return {Promise} promise that is fulfilled when all `promises` have been fulfilled, or rejected if any of them become rejected. @static */ function all(entries) { return new Enumerator(this, entries).promise; } /** `Promise.race` returns a new promise which is settled in the same way as the first passed promise to settle. Example: ```javascript let promise1 = new Promise(function(resolve, reject){ setTimeout(function(){ resolve('promise 1'); }, 200); }); let promise2 = new Promise(function(resolve, reject){ setTimeout(function(){ resolve('promise 2'); }, 100); }); Promise.race([promise1, promise2]).then(function(result){ // result === 'promise 2' because it was resolved before promise1 // was resolved. }); ``` `Promise.race` is deterministic in that only the state of the first settled promise matters. For example, even if other promises given to the `promises` array argument are resolved, but the first settled promise has become rejected before the other promises became fulfilled, the returned promise will become rejected: ```javascript let promise1 = new Promise(function(resolve, reject){ setTimeout(function(){ resolve('promise 1'); }, 200); }); let promise2 = new Promise(function(resolve, reject){ setTimeout(function(){ reject(new Error('promise 2')); }, 100); }); Promise.race([promise1, promise2]).then(function(result){ // Code here never runs }, function(reason){ // reason.message === 'promise 2' because promise 2 became rejected before // promise 1 became fulfilled }); ``` An example real-world use case is implementing timeouts: ```javascript Promise.race([ajax('foo.json'), timeout(5000)]) ``` @method race @static @param {Array} promises array of promises to observe Useful for tooling. @return {Promise} a promise which settles in the same way as the first passed promise to settle. */ function race(entries) { /*jshint validthis:true */ var Constructor = this; if (!isArray(entries)) { return new Constructor(function (_, reject) { return reject(new TypeError('You must pass an array to race.')); }); } else { return new Constructor(function (resolve, reject) { var length = entries.length; for (var i = 0; i < length; i++) { Constructor.resolve(entries[i]).then(resolve, reject); } }); } } /** `Promise.reject` returns a promise rejected with the passed `reason`. It is shorthand for the following: ```javascript let promise = new Promise(function(resolve, reject){ reject(new Error('WHOOPS')); }); promise.then(function(value){ // Code here doesn't run because the promise is rejected! }, function(reason){ // reason.message === 'WHOOPS' }); ``` Instead of writing the above, your code now simply becomes the following: ```javascript let promise = Promise.reject(new Error('WHOOPS')); promise.then(function(value){ // Code here doesn't run because the promise is rejected! }, function(reason){ // reason.message === 'WHOOPS' }); ``` @method reject @static @param {Any} reason value that the returned promise will be rejected with. Useful for tooling. @return {Promise} a promise rejected with the given `reason`. */ function reject$1(reason) { /*jshint validthis:true */ var Constructor = this; var promise = new Constructor(noop); reject(promise, reason); return promise; } function needsResolver() { throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); } function needsNew() { throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); } /** Promise objects represent the eventual result of an asynchronous operation. The primary way of interacting with a promise is through its `then` method, which registers callbacks to receive either a promise's eventual value or the reason why the promise cannot be fulfilled. Terminology ----------- - `promise` is an object or function with a `then` method whose behavior conforms to this specification. - `thenable` is an object or function that defines a `then` method. - `value` is any legal JavaScript value (including undefined, a thenable, or a promise). - `exception` is a value that is thrown using the throw statement. - `reason` is a value that indicates why a promise was rejected. - `settled` the final resting state of a promise, fulfilled or rejected. A promise can be in one of three states: pending, fulfilled, or rejected. Promises that are fulfilled have a fulfillment value and are in the fulfilled state. Promises that are rejected have a rejection reason and are in the rejected state. A fulfillment value is never a thenable. Promises can also be said to *resolve* a value. If this value is also a promise, then the original promise's settled state will match the value's settled state. So a promise that *resolves* a promise that rejects will itself reject, and a promise that *resolves* a promise that fulfills will itself fulfill. Basic Usage: ------------ ```js let promise = new Promise(function(resolve, reject) { // on success resolve(value); // on failure reject(reason); }); promise.then(function(value) { // on fulfillment }, function(reason) { // on rejection }); ``` Advanced Usage: --------------- Promises shine when abstracting away asynchronous interactions such as `XMLHttpRequest`s. ```js function getJSON(url) { return new Promise(function(resolve, reject){ let xhr = new XMLHttpRequest(); xhr.open('GET', url); xhr.onreadystatechange = handler; xhr.responseType = 'json'; xhr.setRequestHeader('Accept', 'application/json'); xhr.send(); function handler() { if (this.readyState === this.DONE) { if (this.status === 200) { resolve(this.response); } else { reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']')); } } }; }); } getJSON('/posts.json').then(function(json) { // on fulfillment }, function(reason) { // on rejection }); ``` Unlike callbacks, promises are great composable primitives. ```js Promise.all([ getJSON('/posts'), getJSON('/comments') ]).then(function(values){ values[0] // => postsJSON values[1] // => commentsJSON return values; }); ``` @class Promise @param {Function} resolver Useful for tooling. @constructor */ var Promise$1 = function () { function Promise(resolver) { this[PROMISE_ID] = nextId(); this._result = this._state = undefined; this._subscribers = []; if (noop !== resolver) { typeof resolver !== 'function' && needsResolver(); this instanceof Promise ? initializePromise(this, resolver) : needsNew(); } } /** The primary way of interacting with a promise is through its `then` method, which registers callbacks to receive either a promise's eventual value or the reason why the promise cannot be fulfilled. ```js findUser().then(function(user){ // user is available }, function(reason){ // user is unavailable, and you are given the reason why }); ``` Chaining -------- The return value of `then` is itself a promise. This second, 'downstream' promise is resolved with the return value of the first promise's fulfillment or rejection handler, or rejected if the handler throws an exception. ```js findUser().then(function (user) { return user.name; }, function (reason) { return 'default name'; }).then(function (userName) { // If `findUser` fulfilled, `userName` will be the user's name, otherwise it // will be `'default name'` }); findUser().then(function (user) { throw new Error('Found user, but still unhappy'); }, function (reason) { throw new Error('`findUser` rejected and we're unhappy'); }).then(function (value) { // never reached }, function (reason) { // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'. // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'. }); ``` If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream. ```js findUser().then(function (user) { throw new PedagogicalException('Upstream error'); }).then(function (value) { // never reached }).then(function (value) { // never reached }, function (reason) { // The `PedgagocialException` is propagated all the way down to here }); ``` Assimilation ------------ Sometimes the value you want to propagate to a downstream promise can only be retrieved asynchronously. This can be achieved by returning a promise in the fulfillment or rejection handler. The downstream promise will then be pending until the returned promise is settled. This is called *assimilation*. ```js findUser().then(function (user) { return findCommentsByAuthor(user); }).then(function (comments) { // The user's comments are now available }); ``` If the assimliated promise rejects, then the downstream promise will also reject. ```js findUser().then(function (user) { return findCommentsByAuthor(user); }).then(function (comments) { // If `findCommentsByAuthor` fulfills, we'll have the value here }, function (reason) { // If `findCommentsByAuthor` rejects, we'll have the reason here }); ``` Simple Example -------------- Synchronous Example ```javascript let result; try { result = findResult(); // success } catch(reason) { // failure } ``` Errback Example ```js findResult(function(result, err){ if (err) { // failure } else { // success } }); ``` Promise Example; ```javascript findResult().then(function(result){ // success }, function(reason){ // failure }); ``` Advanced Example -------------- Synchronous Example ```javascript let author, books; try { author = findAuthor(); books = findBooksByAuthor(author); // success } catch(reason) { // failure } ``` Errback Example ```js function foundBooks(books) { } function failure(reason) { } findAuthor(function(author, err){ if (err) { failure(err); // failure } else { try { findBoooksByAuthor(author, function(books, err) { if (err) { failure(err); } else { try { foundBooks(books); } catch(reason) { failure(reason); } } }); } catch(error) { failure(err); } // success } }); ``` Promise Example; ```javascript findAuthor(). then(findBooksByAuthor). then(function(books){ // found books }).catch(function(reason){ // something went wrong }); ``` @method then @param {Function} onFulfilled @param {Function} onRejected Useful for tooling. @return {Promise} */ /** `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same as the catch block of a try/catch statement. ```js function findAuthor(){ throw new Error('couldn't find that author'); } // synchronous try { findAuthor(); } catch(reason) { // something went wrong } // async with promises findAuthor().catch(function(reason){ // something went wrong }); ``` @method catch @param {Function} onRejection Useful for tooling. @return {Promise} */ Promise.prototype.catch = function _catch(onRejection) { return this.then(null, onRejection); }; /** `finally` will be invoked regardless of the promise's fate just as native try/catch/finally behaves Synchronous example: ```js findAuthor() { if (Math.random() > 0.5) { throw new Error(); } return new Author(); } try { return findAuthor(); // succeed or fail } catch(error) { return findOtherAuther(); } finally { // always runs // doesn't affect the return value } ``` Asynchronous example: ```js findAuthor().catch(function(reason){ return findOtherAuther(); }).finally(function(){ // author was either found, or not }); ``` @method finally @param {Function} callback @return {Promise} */ Promise.prototype.finally = function _finally(callback) { var promise = this; var constructor = promise.constructor; return promise.then(function (value) { return constructor.resolve(callback()).then(function () { return value; }); }, function (reason) { return constructor.resolve(callback()).then(function () { throw reason; }); }); }; return Promise; }(); Promise$1.prototype.then = then; Promise$1.all = all; Promise$1.race = race; Promise$1.resolve = resolve$1; Promise$1.reject = reject$1; Promise$1._setScheduler = setScheduler; Promise$1._setAsap = setAsap; Promise$1._asap = asap; /*global self*/ function polyfill() { var local = void 0; if (typeof global !== 'undefined') { local = global; } else if (typeof self !== 'undefined') { local = self; } else { try { local = Function('return this')(); } catch (e) { throw new Error('polyfill failed because global object is unavailable in this environment'); } } var P = local.Promise; if (P) { var promiseToString = null; try { promiseToString = Object.prototype.toString.call(P.resolve()); } catch (e) { // silently ignored } if (promiseToString === '[object Promise]' && !P.cast) { return; } } local.Promise = Promise$1; } // Strange compat.. Promise$1.polyfill = polyfill; Promise$1.Promise = Promise$1; return Promise$1; }))); //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/es6-promise/dist/es6-promise.map {"version":3,"sources":["config/versionTemplate.txt","lib/es6-promise/utils.js","lib/es6-promise/asap.js","lib/es6-promise/then.js","lib/es6-promise/promise/resolve.js","lib/es6-promise/-internal.js","lib/es6-promise/enumerator.js","lib/es6-promise/promise/all.js","lib/es6-promise/promise/race.js","lib/es6-promise/promise/reject.js","lib/es6-promise/promise.js","lib/es6-promise/polyfill.js","lib/es6-promise.js"],"sourcesContent":["/*!\n * @overview es6-promise - a tiny implementation of Promises/A+.\n * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n * @license Licensed under MIT license\n * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE\n * @version v4.2.4+314e4831\n */\n","export function objectOrFunction(x) {\n var type = typeof x;\n return x !== null && (type === 'object' || type === 'function');\n}\n\nexport function isFunction(x) {\n return typeof x === 'function';\n}\n\nexport function isMaybeThenable(x) {\n return x !== null && typeof x === 'object';\n}\n\nvar _isArray = void 0;\nif (Array.isArray) {\n _isArray = Array.isArray;\n} else {\n _isArray = function (x) {\n return Object.prototype.toString.call(x) === '[object Array]';\n };\n}\n\nexport var isArray = _isArray;","var len = 0;\nvar vertxNext = void 0;\nvar customSchedulerFn = void 0;\n\nexport var asap = function asap(callback, arg) {\n queue[len] = callback;\n queue[len + 1] = arg;\n len += 2;\n if (len === 2) {\n // If len is 2, that means that we need to schedule an async flush.\n // If additional callbacks are queued before the queue is flushed, they\n // will be processed by this flush that we are scheduling.\n if (customSchedulerFn) {\n customSchedulerFn(flush);\n } else {\n scheduleFlush();\n }\n }\n};\n\nexport function setScheduler(scheduleFn) {\n customSchedulerFn = scheduleFn;\n}\n\nexport function setAsap(asapFn) {\n asap = asapFn;\n}\n\nvar browserWindow = typeof window !== 'undefined' ? window : undefined;\nvar browserGlobal = browserWindow || {};\nvar BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;\nvar isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';\n\n// test for web worker but not in IE10\nvar isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';\n\n// node\nfunction useNextTick() {\n // node version 0.10.x displays a deprecation warning when nextTick is used recursively\n // see https://github.com/cujojs/when/issues/410 for details\n return function () {\n return process.nextTick(flush);\n };\n}\n\n// vertx\nfunction useVertxTimer() {\n if (typeof vertxNext !== 'undefined') {\n return function () {\n vertxNext(flush);\n };\n }\n\n return useSetTimeout();\n}\n\nfunction useMutationObserver() {\n var iterations = 0;\n var observer = new BrowserMutationObserver(flush);\n var node = document.createTextNode('');\n observer.observe(node, { characterData: true });\n\n return function () {\n node.data = iterations = ++iterations % 2;\n };\n}\n\n// web worker\nfunction useMessageChannel() {\n var channel = new MessageChannel();\n channel.port1.onmessage = flush;\n return function () {\n return channel.port2.postMessage(0);\n };\n}\n\nfunction useSetTimeout() {\n // Store setTimeout reference so es6-promise will be unaffected by\n // other code modifying setTimeout (like sinon.useFakeTimers())\n var globalSetTimeout = setTimeout;\n return function () {\n return globalSetTimeout(flush, 1);\n };\n}\n\nvar queue = new Array(1000);\nfunction flush() {\n for (var i = 0; i < len; i += 2) {\n var callback = queue[i];\n var arg = queue[i + 1];\n\n callback(arg);\n\n queue[i] = undefined;\n queue[i + 1] = undefined;\n }\n\n len = 0;\n}\n\nfunction attemptVertx() {\n try {\n var vertx = Function('return this')().require('vertx');\n vertxNext = vertx.runOnLoop || vertx.runOnContext;\n return useVertxTimer();\n } catch (e) {\n return useSetTimeout();\n }\n}\n\nvar scheduleFlush = void 0;\n// Decide what async method to use to triggering processing of queued callbacks:\nif (isNode) {\n scheduleFlush = useNextTick();\n} else if (BrowserMutationObserver) {\n scheduleFlush = useMutationObserver();\n} else if (isWorker) {\n scheduleFlush = useMessageChannel();\n} else if (browserWindow === undefined && typeof require === 'function') {\n scheduleFlush = attemptVertx();\n} else {\n scheduleFlush = useSetTimeout();\n}","import { invokeCallback, subscribe, FULFILLED, REJECTED, noop, makePromise, PROMISE_ID } from './-internal';\n\nimport { asap } from './asap';\n\nexport default function then(onFulfillment, onRejection) {\n var parent = this;\n\n var child = new this.constructor(noop);\n\n if (child[PROMISE_ID] === undefined) {\n makePromise(child);\n }\n\n var _state = parent._state;\n\n\n if (_state) {\n var callback = arguments[_state - 1];\n asap(function () {\n return invokeCallback(_state, child, callback, parent._result);\n });\n } else {\n subscribe(parent, child, onFulfillment, onRejection);\n }\n\n return child;\n}","import { noop, resolve as _resolve } from '../-internal';\n\n/**\n `Promise.resolve` returns a promise that will become resolved with the\n passed `value`. It is shorthand for the following:\n\n ```javascript\n let promise = new Promise(function(resolve, reject){\n resolve(1);\n });\n\n promise.then(function(value){\n // value === 1\n });\n ```\n\n Instead of writing the above, your code now simply becomes the following:\n\n ```javascript\n let promise = Promise.resolve(1);\n\n promise.then(function(value){\n // value === 1\n });\n ```\n\n @method resolve\n @static\n @param {Any} value value that the returned promise will be resolved with\n Useful for tooling.\n @return {Promise} a promise that will become fulfilled with the given\n `value`\n*/\nexport default function resolve(object) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (object && typeof object === 'object' && object.constructor === Constructor) {\n return object;\n }\n\n var promise = new Constructor(noop);\n _resolve(promise, object);\n return promise;\n}","import { objectOrFunction, isFunction } from './utils';\n\nimport { asap } from './asap';\n\nimport originalThen from './then';\nimport originalResolve from './promise/resolve';\n\nexport var PROMISE_ID = Math.random().toString(36).substring(2);\n\nfunction noop() {}\n\nvar PENDING = void 0;\nvar FULFILLED = 1;\nvar REJECTED = 2;\n\nvar TRY_CATCH_ERROR = { error: null };\n\nfunction selfFulfillment() {\n return new TypeError(\"You cannot resolve a promise with itself\");\n}\n\nfunction cannotReturnOwn() {\n return new TypeError('A promises callback cannot return that same promise.');\n}\n\nfunction getThen(promise) {\n try {\n return promise.then;\n } catch (error) {\n TRY_CATCH_ERROR.error = error;\n return TRY_CATCH_ERROR;\n }\n}\n\nfunction tryThen(then, value, fulfillmentHandler, rejectionHandler) {\n try {\n then.call(value, fulfillmentHandler, rejectionHandler);\n } catch (e) {\n return e;\n }\n}\n\nfunction handleForeignThenable(promise, thenable, then) {\n asap(function (promise) {\n var sealed = false;\n var error = tryThen(then, thenable, function (value) {\n if (sealed) {\n return;\n }\n sealed = true;\n if (thenable !== value) {\n resolve(promise, value);\n } else {\n fulfill(promise, value);\n }\n }, function (reason) {\n if (sealed) {\n return;\n }\n sealed = true;\n\n reject(promise, reason);\n }, 'Settle: ' + (promise._label || ' unknown promise'));\n\n if (!sealed && error) {\n sealed = true;\n reject(promise, error);\n }\n }, promise);\n}\n\nfunction handleOwnThenable(promise, thenable) {\n if (thenable._state === FULFILLED) {\n fulfill(promise, thenable._result);\n } else if (thenable._state === REJECTED) {\n reject(promise, thenable._result);\n } else {\n subscribe(thenable, undefined, function (value) {\n return resolve(promise, value);\n }, function (reason) {\n return reject(promise, reason);\n });\n }\n}\n\nfunction handleMaybeThenable(promise, maybeThenable, then) {\n if (maybeThenable.constructor === promise.constructor && then === originalThen && maybeThenable.constructor.resolve === originalResolve) {\n handleOwnThenable(promise, maybeThenable);\n } else {\n if (then === TRY_CATCH_ERROR) {\n reject(promise, TRY_CATCH_ERROR.error);\n TRY_CATCH_ERROR.error = null;\n } else if (then === undefined) {\n fulfill(promise, maybeThenable);\n } else if (isFunction(then)) {\n handleForeignThenable(promise, maybeThenable, then);\n } else {\n fulfill(promise, maybeThenable);\n }\n }\n}\n\nfunction resolve(promise, value) {\n if (promise === value) {\n reject(promise, selfFulfillment());\n } else if (objectOrFunction(value)) {\n handleMaybeThenable(promise, value, getThen(value));\n } else {\n fulfill(promise, value);\n }\n}\n\nfunction publishRejection(promise) {\n if (promise._onerror) {\n promise._onerror(promise._result);\n }\n\n publish(promise);\n}\n\nfunction fulfill(promise, value) {\n if (promise._state !== PENDING) {\n return;\n }\n\n promise._result = value;\n promise._state = FULFILLED;\n\n if (promise._subscribers.length !== 0) {\n asap(publish, promise);\n }\n}\n\nfunction reject(promise, reason) {\n if (promise._state !== PENDING) {\n return;\n }\n promise._state = REJECTED;\n promise._result = reason;\n\n asap(publishRejection, promise);\n}\n\nfunction subscribe(parent, child, onFulfillment, onRejection) {\n var _subscribers = parent._subscribers;\n var length = _subscribers.length;\n\n\n parent._onerror = null;\n\n _subscribers[length] = child;\n _subscribers[length + FULFILLED] = onFulfillment;\n _subscribers[length + REJECTED] = onRejection;\n\n if (length === 0 && parent._state) {\n asap(publish, parent);\n }\n}\n\nfunction publish(promise) {\n var subscribers = promise._subscribers;\n var settled = promise._state;\n\n if (subscribers.length === 0) {\n return;\n }\n\n var child = void 0,\n callback = void 0,\n detail = promise._result;\n\n for (var i = 0; i < subscribers.length; i += 3) {\n child = subscribers[i];\n callback = subscribers[i + settled];\n\n if (child) {\n invokeCallback(settled, child, callback, detail);\n } else {\n callback(detail);\n }\n }\n\n promise._subscribers.length = 0;\n}\n\nfunction tryCatch(callback, detail) {\n try {\n return callback(detail);\n } catch (e) {\n TRY_CATCH_ERROR.error = e;\n return TRY_CATCH_ERROR;\n }\n}\n\nfunction invokeCallback(settled, promise, callback, detail) {\n var hasCallback = isFunction(callback),\n value = void 0,\n error = void 0,\n succeeded = void 0,\n failed = void 0;\n\n if (hasCallback) {\n value = tryCatch(callback, detail);\n\n if (value === TRY_CATCH_ERROR) {\n failed = true;\n error = value.error;\n value.error = null;\n } else {\n succeeded = true;\n }\n\n if (promise === value) {\n reject(promise, cannotReturnOwn());\n return;\n }\n } else {\n value = detail;\n succeeded = true;\n }\n\n if (promise._state !== PENDING) {\n // noop\n } else if (hasCallback && succeeded) {\n resolve(promise, value);\n } else if (failed) {\n reject(promise, error);\n } else if (settled === FULFILLED) {\n fulfill(promise, value);\n } else if (settled === REJECTED) {\n reject(promise, value);\n }\n}\n\nfunction initializePromise(promise, resolver) {\n try {\n resolver(function resolvePromise(value) {\n resolve(promise, value);\n }, function rejectPromise(reason) {\n reject(promise, reason);\n });\n } catch (e) {\n reject(promise, e);\n }\n}\n\nvar id = 0;\nfunction nextId() {\n return id++;\n}\n\nfunction makePromise(promise) {\n promise[PROMISE_ID] = id++;\n promise._state = undefined;\n promise._result = undefined;\n promise._subscribers = [];\n}\n\nexport { nextId, makePromise, getThen, noop, resolve, reject, fulfill, subscribe, publish, publishRejection, initializePromise, invokeCallback, FULFILLED, REJECTED, PENDING, handleMaybeThenable };","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nimport { isArray, isMaybeThenable } from './utils';\nimport { noop, reject, fulfill, subscribe, FULFILLED, REJECTED, PENDING, getThen, handleMaybeThenable } from './-internal';\n\nimport then from './then';\nimport Promise from './promise';\nimport originalResolve from './promise/resolve';\nimport originalThen from './then';\nimport { makePromise, PROMISE_ID } from './-internal';\n\nfunction validationError() {\n return new Error('Array Methods must be provided an Array');\n};\n\nvar Enumerator = function () {\n function Enumerator(Constructor, input) {\n this._instanceConstructor = Constructor;\n this.promise = new Constructor(noop);\n\n if (!this.promise[PROMISE_ID]) {\n makePromise(this.promise);\n }\n\n if (isArray(input)) {\n this.length = input.length;\n this._remaining = input.length;\n\n this._result = new Array(this.length);\n\n if (this.length === 0) {\n fulfill(this.promise, this._result);\n } else {\n this.length = this.length || 0;\n this._enumerate(input);\n if (this._remaining === 0) {\n fulfill(this.promise, this._result);\n }\n }\n } else {\n reject(this.promise, validationError());\n }\n }\n\n Enumerator.prototype._enumerate = function _enumerate(input) {\n for (var i = 0; this._state === PENDING && i < input.length; i++) {\n this._eachEntry(input[i], i);\n }\n };\n\n Enumerator.prototype._eachEntry = function _eachEntry(entry, i) {\n var c = this._instanceConstructor;\n var resolve = c.resolve;\n\n\n if (resolve === originalResolve) {\n var _then = getThen(entry);\n\n if (_then === originalThen && entry._state !== PENDING) {\n this._settledAt(entry._state, i, entry._result);\n } else if (typeof _then !== 'function') {\n this._remaining--;\n this._result[i] = entry;\n } else if (c === Promise) {\n var promise = new c(noop);\n handleMaybeThenable(promise, entry, _then);\n this._willSettleAt(promise, i);\n } else {\n this._willSettleAt(new c(function (resolve) {\n return resolve(entry);\n }), i);\n }\n } else {\n this._willSettleAt(resolve(entry), i);\n }\n };\n\n Enumerator.prototype._settledAt = function _settledAt(state, i, value) {\n var promise = this.promise;\n\n\n if (promise._state === PENDING) {\n this._remaining--;\n\n if (state === REJECTED) {\n reject(promise, value);\n } else {\n this._result[i] = value;\n }\n }\n\n if (this._remaining === 0) {\n fulfill(promise, this._result);\n }\n };\n\n Enumerator.prototype._willSettleAt = function _willSettleAt(promise, i) {\n var enumerator = this;\n\n subscribe(promise, undefined, function (value) {\n return enumerator._settledAt(FULFILLED, i, value);\n }, function (reason) {\n return enumerator._settledAt(REJECTED, i, reason);\n });\n };\n\n return Enumerator;\n}();\n\nexport default Enumerator;\n;","import Enumerator from '../enumerator';\n\n/**\n `Promise.all` accepts an array of promises, and returns a new promise which\n is fulfilled with an array of fulfillment values for the passed promises, or\n rejected with the reason of the first passed promise to be rejected. It casts all\n elements of the passed iterable to promises as it runs this algorithm.\n\n Example:\n\n ```javascript\n let promise1 = resolve(1);\n let promise2 = resolve(2);\n let promise3 = resolve(3);\n let promises = [ promise1, promise2, promise3 ];\n\n Promise.all(promises).then(function(array){\n // The array here would be [ 1, 2, 3 ];\n });\n ```\n\n If any of the `promises` given to `all` are rejected, the first promise\n that is rejected will be given as an argument to the returned promises's\n rejection handler. For example:\n\n Example:\n\n ```javascript\n let promise1 = resolve(1);\n let promise2 = reject(new Error(\"2\"));\n let promise3 = reject(new Error(\"3\"));\n let promises = [ promise1, promise2, promise3 ];\n\n Promise.all(promises).then(function(array){\n // Code here never runs because there are rejected promises!\n }, function(error) {\n // error.message === \"2\"\n });\n ```\n\n @method all\n @static\n @param {Array} entries array of promises\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise} promise that is fulfilled when all `promises` have been\n fulfilled, or rejected if any of them become rejected.\n @static\n*/\nexport default function all(entries) {\n return new Enumerator(this, entries).promise;\n}","import { isArray } from \"../utils\";\n\n/**\n `Promise.race` returns a new promise which is settled in the same way as the\n first passed promise to settle.\n\n Example:\n\n ```javascript\n let promise1 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n });\n\n let promise2 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 2');\n }, 100);\n });\n\n Promise.race([promise1, promise2]).then(function(result){\n // result === 'promise 2' because it was resolved before promise1\n // was resolved.\n });\n ```\n\n `Promise.race` is deterministic in that only the state of the first\n settled promise matters. For example, even if other promises given to the\n `promises` array argument are resolved, but the first settled promise has\n become rejected before the other promises became fulfilled, the returned\n promise will become rejected:\n\n ```javascript\n let promise1 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n });\n\n let promise2 = new Promise(function(resolve, reject){\n setTimeout(function(){\n reject(new Error('promise 2'));\n }, 100);\n });\n\n Promise.race([promise1, promise2]).then(function(result){\n // Code here never runs\n }, function(reason){\n // reason.message === 'promise 2' because promise 2 became rejected before\n // promise 1 became fulfilled\n });\n ```\n\n An example real-world use case is implementing timeouts:\n\n ```javascript\n Promise.race([ajax('foo.json'), timeout(5000)])\n ```\n\n @method race\n @static\n @param {Array} promises array of promises to observe\n Useful for tooling.\n @return {Promise} a promise which settles in the same way as the first passed\n promise to settle.\n*/\nexport default function race(entries) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (!isArray(entries)) {\n return new Constructor(function (_, reject) {\n return reject(new TypeError('You must pass an array to race.'));\n });\n } else {\n return new Constructor(function (resolve, reject) {\n var length = entries.length;\n for (var i = 0; i < length; i++) {\n Constructor.resolve(entries[i]).then(resolve, reject);\n }\n });\n }\n}","import { noop, reject as _reject } from '../-internal';\n\n/**\n `Promise.reject` returns a promise rejected with the passed `reason`.\n It is shorthand for the following:\n\n ```javascript\n let promise = new Promise(function(resolve, reject){\n reject(new Error('WHOOPS'));\n });\n\n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n\n Instead of writing the above, your code now simply becomes the following:\n\n ```javascript\n let promise = Promise.reject(new Error('WHOOPS'));\n\n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n\n @method reject\n @static\n @param {Any} reason value that the returned promise will be rejected with.\n Useful for tooling.\n @return {Promise} a promise rejected with the given `reason`.\n*/\nexport default function reject(reason) {\n /*jshint validthis:true */\n var Constructor = this;\n var promise = new Constructor(noop);\n _reject(promise, reason);\n return promise;\n}","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nimport { isFunction } from './utils';\nimport { noop, nextId, PROMISE_ID, initializePromise } from './-internal';\nimport { asap, setAsap, setScheduler } from './asap';\n\nimport all from './promise/all';\nimport race from './promise/race';\nimport Resolve from './promise/resolve';\nimport Reject from './promise/reject';\nimport then from './then';\n\nfunction needsResolver() {\n throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');\n}\n\nfunction needsNew() {\n throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\");\n}\n\n/**\n Promise objects represent the eventual result of an asynchronous operation. The\n primary way of interacting with a promise is through its `then` method, which\n registers callbacks to receive either a promise's eventual value or the reason\n why the promise cannot be fulfilled.\n\n Terminology\n -----------\n\n - `promise` is an object or function with a `then` method whose behavior conforms to this specification.\n - `thenable` is an object or function that defines a `then` method.\n - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).\n - `exception` is a value that is thrown using the throw statement.\n - `reason` is a value that indicates why a promise was rejected.\n - `settled` the final resting state of a promise, fulfilled or rejected.\n\n A promise can be in one of three states: pending, fulfilled, or rejected.\n\n Promises that are fulfilled have a fulfillment value and are in the fulfilled\n state. Promises that are rejected have a rejection reason and are in the\n rejected state. A fulfillment value is never a thenable.\n\n Promises can also be said to *resolve* a value. If this value is also a\n promise, then the original promise's settled state will match the value's\n settled state. So a promise that *resolves* a promise that rejects will\n itself reject, and a promise that *resolves* a promise that fulfills will\n itself fulfill.\n\n\n Basic Usage:\n ------------\n\n ```js\n let promise = new Promise(function(resolve, reject) {\n // on success\n resolve(value);\n\n // on failure\n reject(reason);\n });\n\n promise.then(function(value) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Advanced Usage:\n ---------------\n\n Promises shine when abstracting away asynchronous interactions such as\n `XMLHttpRequest`s.\n\n ```js\n function getJSON(url) {\n return new Promise(function(resolve, reject){\n let xhr = new XMLHttpRequest();\n\n xhr.open('GET', url);\n xhr.onreadystatechange = handler;\n xhr.responseType = 'json';\n xhr.setRequestHeader('Accept', 'application/json');\n xhr.send();\n\n function handler() {\n if (this.readyState === this.DONE) {\n if (this.status === 200) {\n resolve(this.response);\n } else {\n reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n }\n }\n };\n });\n }\n\n getJSON('/posts.json').then(function(json) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n\n Unlike callbacks, promises are great composable primitives.\n\n ```js\n Promise.all([\n getJSON('/posts'),\n getJSON('/comments')\n ]).then(function(values){\n values[0] // => postsJSON\n values[1] // => commentsJSON\n\n return values;\n });\n ```\n\n @class Promise\n @param {Function} resolver\n Useful for tooling.\n @constructor\n*/\n\nvar Promise = function () {\n function Promise(resolver) {\n this[PROMISE_ID] = nextId();\n this._result = this._state = undefined;\n this._subscribers = [];\n\n if (noop !== resolver) {\n typeof resolver !== 'function' && needsResolver();\n this instanceof Promise ? initializePromise(this, resolver) : needsNew();\n }\n }\n\n /**\n The primary way of interacting with a promise is through its `then` method,\n which registers callbacks to receive either a promise's eventual value or the\n reason why the promise cannot be fulfilled.\n ```js\n findUser().then(function(user){\n // user is available\n }, function(reason){\n // user is unavailable, and you are given the reason why\n });\n ```\n Chaining\n --------\n The return value of `then` is itself a promise. This second, 'downstream'\n promise is resolved with the return value of the first promise's fulfillment\n or rejection handler, or rejected if the handler throws an exception.\n ```js\n findUser().then(function (user) {\n return user.name;\n }, function (reason) {\n return 'default name';\n }).then(function (userName) {\n // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n // will be `'default name'`\n });\n findUser().then(function (user) {\n throw new Error('Found user, but still unhappy');\n }, function (reason) {\n throw new Error('`findUser` rejected and we're unhappy');\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.\n });\n ```\n If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.\n ```js\n findUser().then(function (user) {\n throw new PedagogicalException('Upstream error');\n }).then(function (value) {\n // never reached\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // The `PedgagocialException` is propagated all the way down to here\n });\n ```\n Assimilation\n ------------\n Sometimes the value you want to propagate to a downstream promise can only be\n retrieved asynchronously. This can be achieved by returning a promise in the\n fulfillment or rejection handler. The downstream promise will then be pending\n until the returned promise is settled. This is called *assimilation*.\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // The user's comments are now available\n });\n ```\n If the assimliated promise rejects, then the downstream promise will also reject.\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // If `findCommentsByAuthor` fulfills, we'll have the value here\n }, function (reason) {\n // If `findCommentsByAuthor` rejects, we'll have the reason here\n });\n ```\n Simple Example\n --------------\n Synchronous Example\n ```javascript\n let result;\n try {\n result = findResult();\n // success\n } catch(reason) {\n // failure\n }\n ```\n Errback Example\n ```js\n findResult(function(result, err){\n if (err) {\n // failure\n } else {\n // success\n }\n });\n ```\n Promise Example;\n ```javascript\n findResult().then(function(result){\n // success\n }, function(reason){\n // failure\n });\n ```\n Advanced Example\n --------------\n Synchronous Example\n ```javascript\n let author, books;\n try {\n author = findAuthor();\n books = findBooksByAuthor(author);\n // success\n } catch(reason) {\n // failure\n }\n ```\n Errback Example\n ```js\n function foundBooks(books) {\n }\n function failure(reason) {\n }\n findAuthor(function(author, err){\n if (err) {\n failure(err);\n // failure\n } else {\n try {\n findBoooksByAuthor(author, function(books, err) {\n if (err) {\n failure(err);\n } else {\n try {\n foundBooks(books);\n } catch(reason) {\n failure(reason);\n }\n }\n });\n } catch(error) {\n failure(err);\n }\n // success\n }\n });\n ```\n Promise Example;\n ```javascript\n findAuthor().\n then(findBooksByAuthor).\n then(function(books){\n // found books\n }).catch(function(reason){\n // something went wrong\n });\n ```\n @method then\n @param {Function} onFulfilled\n @param {Function} onRejected\n Useful for tooling.\n @return {Promise}\n */\n\n /**\n `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same\n as the catch block of a try/catch statement.\n ```js\n function findAuthor(){\n throw new Error('couldn't find that author');\n }\n // synchronous\n try {\n findAuthor();\n } catch(reason) {\n // something went wrong\n }\n // async with promises\n findAuthor().catch(function(reason){\n // something went wrong\n });\n ```\n @method catch\n @param {Function} onRejection\n Useful for tooling.\n @return {Promise}\n */\n\n\n Promise.prototype.catch = function _catch(onRejection) {\n return this.then(null, onRejection);\n };\n\n /**\n `finally` will be invoked regardless of the promise's fate just as native\n try/catch/finally behaves\n \n Synchronous example:\n \n ```js\n findAuthor() {\n if (Math.random() > 0.5) {\n throw new Error();\n }\n return new Author();\n }\n \n try {\n return findAuthor(); // succeed or fail\n } catch(error) {\n return findOtherAuther();\n } finally {\n // always runs\n // doesn't affect the return value\n }\n ```\n \n Asynchronous example:\n \n ```js\n findAuthor().catch(function(reason){\n return findOtherAuther();\n }).finally(function(){\n // author was either found, or not\n });\n ```\n \n @method finally\n @param {Function} callback\n @return {Promise}\n */\n\n\n Promise.prototype.finally = function _finally(callback) {\n var promise = this;\n var constructor = promise.constructor;\n\n return promise.then(function (value) {\n return constructor.resolve(callback()).then(function () {\n return value;\n });\n }, function (reason) {\n return constructor.resolve(callback()).then(function () {\n throw reason;\n });\n });\n };\n\n return Promise;\n}();\n\nPromise.prototype.then = then;\nexport default Promise;\nPromise.all = all;\nPromise.race = race;\nPromise.resolve = Resolve;\nPromise.reject = Reject;\nPromise._setScheduler = setScheduler;\nPromise._setAsap = setAsap;\nPromise._asap = asap;","/*global self*/\nimport Promise from './promise';\n\nexport default function polyfill() {\n var local = void 0;\n\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n\n var P = local.Promise;\n\n if (P) {\n var promiseToString = null;\n try {\n promiseToString = Object.prototype.toString.call(P.resolve());\n } catch (e) {\n // silently ignored\n }\n\n if (promiseToString === '[object Promise]' && !P.cast) {\n return;\n }\n }\n\n local.Promise = Promise;\n}","import Promise from './es6-promise/promise';\nimport polyfill from './es6-promise/polyfill';\n\n// Strange compat..\nPromise.polyfill = polyfill;\nPromise.Promise = Promise;\nexport default Promise;"],"names":["resolve","_resolve","then","originalThen","originalResolve","Promise","reject","_reject","Resolve","Reject"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACNO,SAAS,gBAAgB,CAAC,CAAC,EAAE;EAClC,IAAI,IAAI,GAAG,OAAO,CAAC,CAAC;EACpB,OAAO,CAAC,KAAK,IAAI,KAAK,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,UAAU,CAAC,CAAC;CACjE;;AAED,AAAO,SAAS,UAAU,CAAC,CAAC,EAAE;EAC5B,OAAO,OAAO,CAAC,KAAK,UAAU,CAAC;CAChC;;AAED,AAEC;;AAED,IAAI,QAAQ,GAAG,KAAK,CAAC,CAAC;AACtB,IAAI,KAAK,CAAC,OAAO,EAAE;EACjB,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC;CAC1B,MAAM;EACL,QAAQ,GAAG,UAAU,CAAC,EAAE;IACtB,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,gBAAgB,CAAC;GAC/D,CAAC;CACH;;AAED,AAAO,IAAI,OAAO,GAAG,QAAQ;;ACtB7B,IAAI,GAAG,GAAG,CAAC,CAAC;AACZ,IAAI,SAAS,GAAG,KAAK,CAAC,CAAC;AACvB,IAAI,iBAAiB,GAAG,KAAK,CAAC,CAAC;;AAE/B,AAAO,IAAI,IAAI,GAAG,SAAS,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE;EAC7C,KAAK,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;EACtB,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;EACrB,GAAG,IAAI,CAAC,CAAC;EACT,IAAI,GAAG,KAAK,CAAC,EAAE;;;;IAIb,IAAI,iBAAiB,EAAE;MACrB,iBAAiB,CAAC,KAAK,CAAC,CAAC;KAC1B,MAAM;MACL,aAAa,EAAE,CAAC;KACjB;GACF;CACF,CAAC;;AAEF,AAAO,SAAS,YAAY,CAAC,UAAU,EAAE;EACvC,iBAAiB,GAAG,UAAU,CAAC;CAChC;;AAED,AAAO,SAAS,OAAO,CAAC,MAAM,EAAE;EAC9B,IAAI,GAAG,MAAM,CAAC;CACf;;AAED,IAAI,aAAa,GAAG,OAAO,MAAM,KAAK,WAAW,GAAG,MAAM,GAAG,SAAS,CAAC;AACvE,IAAI,aAAa,GAAG,aAAa,IAAI,EAAE,CAAC;AACxC,IAAI,uBAAuB,GAAG,aAAa,CAAC,gBAAgB,IAAI,aAAa,CAAC,sBAAsB,CAAC;AACrG,IAAI,MAAM,GAAG,OAAO,IAAI,KAAK,WAAW,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,kBAAkB,CAAC;;;AAG/H,IAAI,QAAQ,GAAG,OAAO,iBAAiB,KAAK,WAAW,IAAI,OAAO,aAAa,KAAK,WAAW,IAAI,OAAO,cAAc,KAAK,WAAW,CAAC;;;AAGzI,SAAS,WAAW,GAAG;;;EAGrB,OAAO,YAAY;IACjB,OAAO,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;GAChC,CAAC;CACH;;;AAGD,SAAS,aAAa,GAAG;EACvB,IAAI,OAAO,SAAS,KAAK,WAAW,EAAE;IACpC,OAAO,YAAY;MACjB,SAAS,CAAC,KAAK,CAAC,CAAC;KAClB,CAAC;GACH;;EAED,OAAO,aAAa,EAAE,CAAC;CACxB;;AAED,SAAS,mBAAmB,GAAG;EAC7B,IAAI,UAAU,GAAG,CAAC,CAAC;EACnB,IAAI,QAAQ,GAAG,IAAI,uBAAuB,CAAC,KAAK,CAAC,CAAC;EAClD,IAAI,IAAI,GAAG,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;EACvC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;;EAEhD,OAAO,YAAY;IACjB,IAAI,CAAC,IAAI,GAAG,UAAU,GAAG,EAAE,UAAU,GAAG,CAAC,CAAC;GAC3C,CAAC;CACH;;;AAGD,SAAS,iBAAiB,GAAG;EAC3B,IAAI,OAAO,GAAG,IAAI,cAAc,EAAE,CAAC;EACnC,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC;EAChC,OAAO,YAAY;IACjB,OAAO,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;GACrC,CAAC;CACH;;AAED,SAAS,aAAa,GAAG;;;EAGvB,IAAI,gBAAgB,GAAG,UAAU,CAAC;EAClC,OAAO,YAAY;IACjB,OAAO,gBAAgB,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;GACnC,CAAC;CACH;;AAED,IAAI,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC;AAC5B,SAAS,KAAK,GAAG;EACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE;IAC/B,IAAI,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACxB,IAAI,GAAG,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;;IAEvB,QAAQ,CAAC,GAAG,CAAC,CAAC;;IAEd,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IACrB,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC;GAC1B;;EAED,GAAG,GAAG,CAAC,CAAC;CACT;;AAED,SAAS,YAAY,GAAG;EACtB,IAAI;IACF,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACvD,SAAS,GAAG,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,YAAY,CAAC;IAClD,OAAO,aAAa,EAAE,CAAC;GACxB,CAAC,OAAO,CAAC,EAAE;IACV,OAAO,aAAa,EAAE,CAAC;GACxB;CACF;;AAED,IAAI,aAAa,GAAG,KAAK,CAAC,CAAC;;AAE3B,IAAI,MAAM,EAAE;EACV,aAAa,GAAG,WAAW,EAAE,CAAC;CAC/B,MAAM,IAAI,uBAAuB,EAAE;EAClC,aAAa,GAAG,mBAAmB,EAAE,CAAC;CACvC,MAAM,IAAI,QAAQ,EAAE;EACnB,aAAa,GAAG,iBAAiB,EAAE,CAAC;CACrC,MAAM,IAAI,aAAa,KAAK,SAAS,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;EACvE,aAAa,GAAG,YAAY,EAAE,CAAC;CAChC,MAAM;EACL,aAAa,GAAG,aAAa,EAAE,CAAC;;;CACjC,DCtHc,SAAS,IAAI,CAAC,aAAa,EAAE,WAAW,EAAE;EACvD,IAAI,MAAM,GAAG,IAAI,CAAC;;EAElB,IAAI,KAAK,GAAG,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;;EAEvC,IAAI,KAAK,CAAC,UAAU,CAAC,KAAK,SAAS,EAAE;IACnC,WAAW,CAAC,KAAK,CAAC,CAAC;GACpB;;EAED,IAAI,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;;;EAG3B,IAAI,MAAM,EAAE;IACV,IAAI,QAAQ,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACrC,IAAI,CAAC,YAAY;MACf,OAAO,cAAc,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;KAChE,CAAC,CAAC;GACJ,MAAM;IACL,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC;GACtD;;EAED,OAAO,KAAK,CAAC;;;CACd,DCxBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,AAAe,SAASA,SAAO,CAAC,MAAM,EAAE;;EAEtC,IAAI,WAAW,GAAG,IAAI,CAAC;;EAEvB,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,WAAW,KAAK,WAAW,EAAE;IAC9E,OAAO,MAAM,CAAC;GACf;;EAED,IAAI,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;EACpCC,OAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;EAC1B,OAAO,OAAO,CAAC;;;CAChB,DCrCM,IAAI,UAAU,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;;AAEhE,SAAS,IAAI,GAAG,EAAE;;AAElB,IAAI,OAAO,GAAG,KAAK,CAAC,CAAC;AACrB,IAAI,SAAS,GAAG,CAAC,CAAC;AAClB,IAAI,QAAQ,GAAG,CAAC,CAAC;;AAEjB,IAAI,eAAe,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;;AAEtC,SAAS,eAAe,GAAG;EACzB,OAAO,IAAI,SAAS,CAAC,0CAA0C,CAAC,CAAC;CAClE;;AAED,SAAS,eAAe,GAAG;EACzB,OAAO,IAAI,SAAS,CAAC,sDAAsD,CAAC,CAAC;CAC9E;;AAED,SAAS,OAAO,CAAC,OAAO,EAAE;EACxB,IAAI;IACF,OAAO,OAAO,CAAC,IAAI,CAAC;GACrB,CAAC,OAAO,KAAK,EAAE;IACd,eAAe,CAAC,KAAK,GAAG,KAAK,CAAC;IAC9B,OAAO,eAAe,CAAC;GACxB;CACF;;AAED,SAAS,OAAO,CAACC,OAAI,EAAE,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE;EAClE,IAAI;IACFA,OAAI,CAAC,IAAI,CAAC,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,CAAC,CAAC;GACxD,CAAC,OAAO,CAAC,EAAE;IACV,OAAO,CAAC,CAAC;GACV;CACF;;AAED,SAAS,qBAAqB,CAAC,OAAO,EAAE,QAAQ,EAAEA,OAAI,EAAE;EACtD,IAAI,CAAC,UAAU,OAAO,EAAE;IACtB,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,IAAI,KAAK,GAAG,OAAO,CAACA,OAAI,EAAE,QAAQ,EAAE,UAAU,KAAK,EAAE;MACnD,IAAI,MAAM,EAAE;QACV,OAAO;OACR;MACD,MAAM,GAAG,IAAI,CAAC;MACd,IAAI,QAAQ,KAAK,KAAK,EAAE;QACtB,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;OACzB,MAAM;QACL,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;OACzB;KACF,EAAE,UAAU,MAAM,EAAE;MACnB,IAAI,MAAM,EAAE;QACV,OAAO;OACR;MACD,MAAM,GAAG,IAAI,CAAC;;MAEd,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KACzB,EAAE,UAAU,IAAI,OAAO,CAAC,MAAM,IAAI,kBAAkB,CAAC,CAAC,CAAC;;IAExD,IAAI,CAAC,MAAM,IAAI,KAAK,EAAE;MACpB,MAAM,GAAG,IAAI,CAAC;MACd,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KACxB;GACF,EAAE,OAAO,CAAC,CAAC;CACb;;AAED,SAAS,iBAAiB,CAAC,OAAO,EAAE,QAAQ,EAAE;EAC5C,IAAI,QAAQ,CAAC,MAAM,KAAK,SAAS,EAAE;IACjC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;GACpC,MAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,QAAQ,EAAE;IACvC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;GACnC,MAAM;IACL,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,KAAK,EAAE;MAC9C,OAAO,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KAChC,EAAE,UAAU,MAAM,EAAE;MACnB,OAAO,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KAChC,CAAC,CAAC;GACJ;CACF;;AAED,SAAS,mBAAmB,CAAC,OAAO,EAAE,aAAa,EAAEA,OAAI,EAAE;EACzD,IAAI,aAAa,CAAC,WAAW,KAAK,OAAO,CAAC,WAAW,IAAIA,OAAI,KAAKC,IAAY,IAAI,aAAa,CAAC,WAAW,CAAC,OAAO,KAAKC,SAAe,EAAE;IACvI,iBAAiB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;GAC3C,MAAM;IACL,IAAIF,OAAI,KAAK,eAAe,EAAE;MAC5B,MAAM,CAAC,OAAO,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC;MACvC,eAAe,CAAC,KAAK,GAAG,IAAI,CAAC;KAC9B,MAAM,IAAIA,OAAI,KAAK,SAAS,EAAE;MAC7B,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;KACjC,MAAM,IAAI,UAAU,CAACA,OAAI,CAAC,EAAE;MAC3B,qBAAqB,CAAC,OAAO,EAAE,aAAa,EAAEA,OAAI,CAAC,CAAC;KACrD,MAAM;MACL,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;KACjC;GACF;CACF;;AAED,SAAS,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE;EAC/B,IAAI,OAAO,KAAK,KAAK,EAAE;IACrB,MAAM,CAAC,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;GACpC,MAAM,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;IAClC,mBAAmB,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;GACrD,MAAM;IACL,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACzB;CACF;;AAED,SAAS,gBAAgB,CAAC,OAAO,EAAE;EACjC,IAAI,OAAO,CAAC,QAAQ,EAAE;IACpB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;GACnC;;EAED,OAAO,CAAC,OAAO,CAAC,CAAC;CAClB;;AAED,SAAS,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE;EAC/B,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;IAC9B,OAAO;GACR;;EAED,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC;EACxB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;;EAE3B,IAAI,OAAO,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE;IACrC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;GACxB;CACF;;AAED,SAAS,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE;EAC/B,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;IAC9B,OAAO;GACR;EACD,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC;EAC1B,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC;;EAEzB,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;CACjC;;AAED,SAAS,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE;EAC5D,IAAI,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;EACvC,IAAI,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC;;;EAGjC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC;;EAEvB,YAAY,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;EAC7B,YAAY,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,aAAa,CAAC;EACjD,YAAY,CAAC,MAAM,GAAG,QAAQ,CAAC,GAAG,WAAW,CAAC;;EAE9C,IAAI,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE;IACjC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;GACvB;CACF;;AAED,SAAS,OAAO,CAAC,OAAO,EAAE;EACxB,IAAI,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC;EACvC,IAAI,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;;EAE7B,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;IAC5B,OAAO;GACR;;EAED,IAAI,KAAK,GAAG,KAAK,CAAC;MACd,QAAQ,GAAG,KAAK,CAAC;MACjB,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;;EAE7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;IAC9C,KAAK,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;IACvB,QAAQ,GAAG,WAAW,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC;;IAEpC,IAAI,KAAK,EAAE;MACT,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;KAClD,MAAM;MACL,QAAQ,CAAC,MAAM,CAAC,CAAC;KAClB;GACF;;EAED,OAAO,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC;CACjC;;AAED,SAAS,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE;EAClC,IAAI;IACF,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC;GACzB,CAAC,OAAO,CAAC,EAAE;IACV,eAAe,CAAC,KAAK,GAAG,CAAC,CAAC;IAC1B,OAAO,eAAe,CAAC;GACxB;CACF;;AAED,SAAS,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE;EAC1D,IAAI,WAAW,GAAG,UAAU,CAAC,QAAQ,CAAC;MAClC,KAAK,GAAG,KAAK,CAAC;MACd,KAAK,GAAG,KAAK,CAAC;MACd,SAAS,GAAG,KAAK,CAAC;MAClB,MAAM,GAAG,KAAK,CAAC,CAAC;;EAEpB,IAAI,WAAW,EAAE;IACf,KAAK,GAAG,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;;IAEnC,IAAI,KAAK,KAAK,eAAe,EAAE;MAC7B,MAAM,GAAG,IAAI,CAAC;MACd,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;MACpB,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC;KACpB,MAAM;MACL,SAAS,GAAG,IAAI,CAAC;KAClB;;IAED,IAAI,OAAO,KAAK,KAAK,EAAE;MACrB,MAAM,CAAC,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;MACnC,OAAO;KACR;GACF,MAAM;IACL,KAAK,GAAG,MAAM,CAAC;IACf,SAAS,GAAG,IAAI,CAAC;GAClB;;EAED,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;;GAE/B,MAAM,IAAI,WAAW,IAAI,SAAS,EAAE;IACnC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACzB,MAAM,IAAI,MAAM,EAAE;IACjB,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACxB,MAAM,IAAI,OAAO,KAAK,SAAS,EAAE;IAChC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACzB,MAAM,IAAI,OAAO,KAAK,QAAQ,EAAE;IAC/B,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACxB;CACF;;AAED,SAAS,iBAAiB,CAAC,OAAO,EAAE,QAAQ,EAAE;EAC5C,IAAI;IACF,QAAQ,CAAC,SAAS,cAAc,CAAC,KAAK,EAAE;MACtC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KACzB,EAAE,SAAS,aAAa,CAAC,MAAM,EAAE;MAChC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KACzB,CAAC,CAAC;GACJ,CAAC,OAAO,CAAC,EAAE;IACV,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;GACpB;CACF;;AAED,IAAI,EAAE,GAAG,CAAC,CAAC;AACX,SAAS,MAAM,GAAG;EAChB,OAAO,EAAE,EAAE,CAAC;CACb;;AAED,SAAS,WAAW,CAAC,OAAO,EAAE;EAC5B,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC;EAC3B,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;EAC3B,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;EAC5B,OAAO,CAAC,YAAY,GAAG,EAAE,CAAC;CAC3B;;ACrPD,SAAS,eAAe,GAAG;EACzB,OAAO,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;CAC7D,AAAC;;AAEF,IAAI,UAAU,GAAG,YAAY;EAC3B,SAAS,UAAU,CAAC,WAAW,EAAE,KAAK,EAAE;IACtC,IAAI,CAAC,oBAAoB,GAAG,WAAW,CAAC;IACxC,IAAI,CAAC,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;;IAErC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;MAC7B,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KAC3B;;IAED,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE;MAClB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;MAC3B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC;;MAE/B,IAAI,CAAC,OAAO,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;;MAEtC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;QACrB,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;OACrC,MAAM;QACL,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC;QAC/B,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACvB,IAAI,IAAI,CAAC,UAAU,KAAK,CAAC,EAAE;UACzB,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;SACrC;OACF;KACF,MAAM;MACL,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;KACzC;GACF;;EAED,UAAU,CAAC,SAAS,CAAC,UAAU,GAAG,SAAS,UAAU,CAAC,KAAK,EAAE;IAC3D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,MAAM,KAAK,OAAO,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;MAChE,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;KAC9B;GACF,CAAC;;EAEF,UAAU,CAAC,SAAS,CAAC,UAAU,GAAG,SAAS,UAAU,CAAC,KAAK,EAAE,CAAC,EAAE;IAC9D,IAAI,CAAC,GAAG,IAAI,CAAC,oBAAoB,CAAC;IAClC,IAAIF,UAAO,GAAG,CAAC,CAAC,OAAO,CAAC;;;IAGxB,IAAIA,UAAO,KAAKI,SAAe,EAAE;MAC/B,IAAI,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;;MAE3B,IAAI,KAAK,KAAKD,IAAY,IAAI,KAAK,CAAC,MAAM,KAAK,OAAO,EAAE;QACtD,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;OACjD,MAAM,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE;QACtC,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;OACzB,MAAM,IAAI,CAAC,KAAKE,SAAO,EAAE;QACxB,IAAI,OAAO,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;QAC1B,mBAAmB,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAC3C,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;OAChC,MAAM;QACL,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,UAAUL,UAAO,EAAE;UAC1C,OAAOA,UAAO,CAAC,KAAK,CAAC,CAAC;SACvB,CAAC,EAAE,CAAC,CAAC,CAAC;OACR;KACF,MAAM;MACL,IAAI,CAAC,aAAa,CAACA,UAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;KACvC;GACF,CAAC;;EAEF,UAAU,CAAC,SAAS,CAAC,UAAU,GAAG,SAAS,UAAU,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE;IACrE,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;;;IAG3B,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;MAC9B,IAAI,CAAC,UAAU,EAAE,CAAC;;MAElB,IAAI,KAAK,KAAK,QAAQ,EAAE;QACtB,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;OACxB,MAAM;QACL,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;OACzB;KACF;;IAED,IAAI,IAAI,CAAC,UAAU,KAAK,CAAC,EAAE;MACzB,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;KAChC;GACF,CAAC;;EAEF,UAAU,CAAC,SAAS,CAAC,aAAa,GAAG,SAAS,aAAa,CAAC,OAAO,EAAE,CAAC,EAAE;IACtE,IAAI,UAAU,GAAG,IAAI,CAAC;;IAEtB,SAAS,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,KAAK,EAAE;MAC7C,OAAO,UAAU,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;KACnD,EAAE,UAAU,MAAM,EAAE;MACnB,OAAO,UAAU,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;KACnD,CAAC,CAAC;GACJ,CAAC;;EAEF,OAAO,UAAU,CAAC;CACnB,EAAE;;ACzGH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,AAAe,SAAS,GAAG,CAAC,OAAO,EAAE;EACnC,OAAO,IAAI,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC;;;CAC9C,DCjDD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,AAAe,SAAS,IAAI,CAAC,OAAO,EAAE;;EAEpC,IAAI,WAAW,GAAG,IAAI,CAAC;;EAEvB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;IACrB,OAAO,IAAI,WAAW,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE;MAC1C,OAAO,MAAM,CAAC,IAAI,SAAS,CAAC,iCAAiC,CAAC,CAAC,CAAC;KACjE,CAAC,CAAC;GACJ,MAAM;IACL,OAAO,IAAI,WAAW,CAAC,UAAU,OAAO,EAAE,MAAM,EAAE;MAChD,IAAI,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;MAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QAC/B,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;OACvD;KACF,CAAC,CAAC;GACJ;;;CACF,DCjFD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,AAAe,SAASM,QAAM,CAAC,MAAM,EAAE;;EAErC,IAAI,WAAW,GAAG,IAAI,CAAC;EACvB,IAAI,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;EACpCC,MAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;EACzB,OAAO,OAAO,CAAC;;;CAChB,DC9BD,SAAS,aAAa,GAAG;EACvB,MAAM,IAAI,SAAS,CAAC,oFAAoF,CAAC,CAAC;CAC3G;;AAED,SAAS,QAAQ,GAAG;EAClB,MAAM,IAAI,SAAS,CAAC,uHAAuH,CAAC,CAAC;CAC9I;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0GD,IAAIF,SAAO,GAAG,YAAY;EACxB,SAAS,OAAO,CAAC,QAAQ,EAAE;IACzB,IAAI,CAAC,UAAU,CAAC,GAAG,MAAM,EAAE,CAAC;IAC5B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;IACvC,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;;IAEvB,IAAI,IAAI,KAAK,QAAQ,EAAE;MACrB,OAAO,QAAQ,KAAK,UAAU,IAAI,aAAa,EAAE,CAAC;MAClD,IAAI,YAAY,OAAO,GAAG,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,GAAG,QAAQ,EAAE,CAAC;KAC1E;GACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4LD,OAAO,CAAC,SAAS,CAAC,KAAK,GAAG,SAAS,MAAM,CAAC,WAAW,EAAE;IACrD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;GACrC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0CF,OAAO,CAAC,SAAS,CAAC,OAAO,GAAG,SAAS,QAAQ,CAAC,QAAQ,EAAE;IACtD,IAAI,OAAO,GAAG,IAAI,CAAC;IACnB,IAAI,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;;IAEtC,OAAO,OAAO,CAAC,IAAI,CAAC,UAAU,KAAK,EAAE;MACnC,OAAO,WAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY;QACtD,OAAO,KAAK,CAAC;OACd,CAAC,CAAC;KACJ,EAAE,UAAU,MAAM,EAAE;MACnB,OAAO,WAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY;QACtD,MAAM,MAAM,CAAC;OACd,CAAC,CAAC;KACJ,CAAC,CAAC;GACJ,CAAC;;EAEF,OAAO,OAAO,CAAC;CAChB,EAAE,CAAC;;AAEJA,SAAO,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC;AAC9B,AACAA,SAAO,CAAC,GAAG,GAAG,GAAG,CAAC;AAClBA,SAAO,CAAC,IAAI,GAAG,IAAI,CAAC;AACpBA,SAAO,CAAC,OAAO,GAAGG,SAAO,CAAC;AAC1BH,SAAO,CAAC,MAAM,GAAGI,QAAM,CAAC;AACxBJ,SAAO,CAAC,aAAa,GAAG,YAAY,CAAC;AACrCA,SAAO,CAAC,QAAQ,GAAG,OAAO,CAAC;AAC3BA,SAAO,CAAC,KAAK,GAAG,IAAI;;ACxYpB;AACA,AAEe,SAAS,QAAQ,GAAG;EACjC,IAAI,KAAK,GAAG,KAAK,CAAC,CAAC;;EAEnB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IACjC,KAAK,GAAG,MAAM,CAAC;GAChB,MAAM,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;IACtC,KAAK,GAAG,IAAI,CAAC;GACd,MAAM;IACL,IAAI;MACF,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;KACnC,CAAC,OAAO,CAAC,EAAE;MACV,MAAM,IAAI,KAAK,CAAC,0EAA0E,CAAC,CAAC;KAC7F;GACF;;EAED,IAAI,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC;;EAEtB,IAAI,CAAC,EAAE;IACL,IAAI,eAAe,GAAG,IAAI,CAAC;IAC3B,IAAI;MACF,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;KAC/D,CAAC,OAAO,CAAC,EAAE;;KAEX;;IAED,IAAI,eAAe,KAAK,kBAAkB,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE;MACrD,OAAO;KACR;GACF;;EAED,KAAK,CAAC,OAAO,GAAGA,SAAO,CAAC;;;CACzB,DC/BD;AACAA,SAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC5BA,SAAO,CAAC,OAAO,GAAGA,SAAO,CAAC;;;;;;;;","file":"es6-promise.js"}!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.ES6Promise=e()}(this,function(){"use strict";function t(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}function e(t){return"function"==typeof t}function n(t){B=t}function r(t){G=t}function o(){return function(){return process.nextTick(a)}}function i(){return"undefined"!=typeof z?function(){z(a)}:c()}function s(){var t=0,e=new J(a),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function u(){var t=new MessageChannel;return t.port1.onmessage=a,function(){return t.port2.postMessage(0)}}function c(){var t=setTimeout;return function(){return t(a,1)}}function a(){for(var t=0;t postsJSON\n values[1] // => commentsJSON\n\n return values;\n });\n ```\n\n @class Promise\n @param {Function} resolver\n Useful for tooling.\n @constructor\n*/\n\nvar Promise = function () {\n function Promise(resolver) {\n this[PROMISE_ID] = nextId();\n this._result = this._state = undefined;\n this._subscribers = [];\n\n if (noop !== resolver) {\n typeof resolver !== 'function' && needsResolver();\n this instanceof Promise ? initializePromise(this, resolver) : needsNew();\n }\n }\n\n /**\n The primary way of interacting with a promise is through its `then` method,\n which registers callbacks to receive either a promise's eventual value or the\n reason why the promise cannot be fulfilled.\n ```js\n findUser().then(function(user){\n // user is available\n }, function(reason){\n // user is unavailable, and you are given the reason why\n });\n ```\n Chaining\n --------\n The return value of `then` is itself a promise. This second, 'downstream'\n promise is resolved with the return value of the first promise's fulfillment\n or rejection handler, or rejected if the handler throws an exception.\n ```js\n findUser().then(function (user) {\n return user.name;\n }, function (reason) {\n return 'default name';\n }).then(function (userName) {\n // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n // will be `'default name'`\n });\n findUser().then(function (user) {\n throw new Error('Found user, but still unhappy');\n }, function (reason) {\n throw new Error('`findUser` rejected and we're unhappy');\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.\n });\n ```\n If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.\n ```js\n findUser().then(function (user) {\n throw new PedagogicalException('Upstream error');\n }).then(function (value) {\n // never reached\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // The `PedgagocialException` is propagated all the way down to here\n });\n ```\n Assimilation\n ------------\n Sometimes the value you want to propagate to a downstream promise can only be\n retrieved asynchronously. This can be achieved by returning a promise in the\n fulfillment or rejection handler. The downstream promise will then be pending\n until the returned promise is settled. This is called *assimilation*.\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // The user's comments are now available\n });\n ```\n If the assimliated promise rejects, then the downstream promise will also reject.\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // If `findCommentsByAuthor` fulfills, we'll have the value here\n }, function (reason) {\n // If `findCommentsByAuthor` rejects, we'll have the reason here\n });\n ```\n Simple Example\n --------------\n Synchronous Example\n ```javascript\n let result;\n try {\n result = findResult();\n // success\n } catch(reason) {\n // failure\n }\n ```\n Errback Example\n ```js\n findResult(function(result, err){\n if (err) {\n // failure\n } else {\n // success\n }\n });\n ```\n Promise Example;\n ```javascript\n findResult().then(function(result){\n // success\n }, function(reason){\n // failure\n });\n ```\n Advanced Example\n --------------\n Synchronous Example\n ```javascript\n let author, books;\n try {\n author = findAuthor();\n books = findBooksByAuthor(author);\n // success\n } catch(reason) {\n // failure\n }\n ```\n Errback Example\n ```js\n function foundBooks(books) {\n }\n function failure(reason) {\n }\n findAuthor(function(author, err){\n if (err) {\n failure(err);\n // failure\n } else {\n try {\n findBoooksByAuthor(author, function(books, err) {\n if (err) {\n failure(err);\n } else {\n try {\n foundBooks(books);\n } catch(reason) {\n failure(reason);\n }\n }\n });\n } catch(error) {\n failure(err);\n }\n // success\n }\n });\n ```\n Promise Example;\n ```javascript\n findAuthor().\n then(findBooksByAuthor).\n then(function(books){\n // found books\n }).catch(function(reason){\n // something went wrong\n });\n ```\n @method then\n @param {Function} onFulfilled\n @param {Function} onRejected\n Useful for tooling.\n @return {Promise}\n */\n\n /**\n `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same\n as the catch block of a try/catch statement.\n ```js\n function findAuthor(){\n throw new Error('couldn't find that author');\n }\n // synchronous\n try {\n findAuthor();\n } catch(reason) {\n // something went wrong\n }\n // async with promises\n findAuthor().catch(function(reason){\n // something went wrong\n });\n ```\n @method catch\n @param {Function} onRejection\n Useful for tooling.\n @return {Promise}\n */\n\n\n Promise.prototype.catch = function _catch(onRejection) {\n return this.then(null, onRejection);\n };\n\n /**\n `finally` will be invoked regardless of the promise's fate just as native\n try/catch/finally behaves\n \n Synchronous example:\n \n ```js\n findAuthor() {\n if (Math.random() > 0.5) {\n throw new Error();\n }\n return new Author();\n }\n \n try {\n return findAuthor(); // succeed or fail\n } catch(error) {\n return findOtherAuther();\n } finally {\n // always runs\n // doesn't affect the return value\n }\n ```\n \n Asynchronous example:\n \n ```js\n findAuthor().catch(function(reason){\n return findOtherAuther();\n }).finally(function(){\n // author was either found, or not\n });\n ```\n \n @method finally\n @param {Function} callback\n @return {Promise}\n */\n\n\n Promise.prototype.finally = function _finally(callback) {\n var promise = this;\n var constructor = promise.constructor;\n\n return promise.then(function (value) {\n return constructor.resolve(callback()).then(function () {\n return value;\n });\n }, function (reason) {\n return constructor.resolve(callback()).then(function () {\n throw reason;\n });\n });\n };\n\n return Promise;\n}();\n\nPromise.prototype.then = then;\nexport default Promise;\nPromise.all = all;\nPromise.race = race;\nPromise.resolve = Resolve;\nPromise.reject = Reject;\nPromise._setScheduler = setScheduler;\nPromise._setAsap = setAsap;\nPromise._asap = asap;","/*global self*/\nimport Promise from './promise';\n\nexport default function polyfill() {\n var local = void 0;\n\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n\n var P = local.Promise;\n\n if (P) {\n var promiseToString = null;\n try {\n promiseToString = Object.prototype.toString.call(P.resolve());\n } catch (e) {\n // silently ignored\n }\n\n if (promiseToString === '[object Promise]' && !P.cast) {\n return;\n }\n }\n\n local.Promise = Promise;\n}","import Promise from './es6-promise/promise';\nimport polyfill from './es6-promise/polyfill';\n\n// Strange compat..\nPromise.polyfill = polyfill;\nPromise.Promise = Promise;\nexport default Promise;"],"names":["resolve","_resolve","then","originalThen","originalResolve","Promise","reject","_reject","Resolve","Reject"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACNO,SAAS,gBAAgB,CAAC,CAAC,EAAE;EAClC,IAAI,IAAI,GAAG,OAAO,CAAC,CAAC;EACpB,OAAO,CAAC,KAAK,IAAI,KAAK,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,UAAU,CAAC,CAAC;CACjE;;AAED,AAAO,SAAS,UAAU,CAAC,CAAC,EAAE;EAC5B,OAAO,OAAO,CAAC,KAAK,UAAU,CAAC;CAChC;;AAED,AAEC;;AAED,IAAI,QAAQ,GAAG,KAAK,CAAC,CAAC;AACtB,IAAI,KAAK,CAAC,OAAO,EAAE;EACjB,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC;CAC1B,MAAM;EACL,QAAQ,GAAG,UAAU,CAAC,EAAE;IACtB,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,gBAAgB,CAAC;GAC/D,CAAC;CACH;;AAED,AAAO,IAAI,OAAO,GAAG,QAAQ;;ACtB7B,IAAI,GAAG,GAAG,CAAC,CAAC;AACZ,IAAI,SAAS,GAAG,KAAK,CAAC,CAAC;AACvB,IAAI,iBAAiB,GAAG,KAAK,CAAC,CAAC;;AAE/B,AAAO,IAAI,IAAI,GAAG,SAAS,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE;EAC7C,KAAK,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;EACtB,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;EACrB,GAAG,IAAI,CAAC,CAAC;EACT,IAAI,GAAG,KAAK,CAAC,EAAE;;;;IAIb,IAAI,iBAAiB,EAAE;MACrB,iBAAiB,CAAC,KAAK,CAAC,CAAC;KAC1B,MAAM;MACL,aAAa,EAAE,CAAC;KACjB;GACF;CACF,CAAC;;AAEF,AAAO,SAAS,YAAY,CAAC,UAAU,EAAE;EACvC,iBAAiB,GAAG,UAAU,CAAC;CAChC;;AAED,AAAO,SAAS,OAAO,CAAC,MAAM,EAAE;EAC9B,IAAI,GAAG,MAAM,CAAC;CACf;;AAED,IAAI,aAAa,GAAG,OAAO,MAAM,KAAK,WAAW,GAAG,MAAM,GAAG,SAAS,CAAC;AACvE,IAAI,aAAa,GAAG,aAAa,IAAI,EAAE,CAAC;AACxC,IAAI,uBAAuB,GAAG,aAAa,CAAC,gBAAgB,IAAI,aAAa,CAAC,sBAAsB,CAAC;AACrG,IAAI,MAAM,GAAG,OAAO,IAAI,KAAK,WAAW,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,kBAAkB,CAAC;;;AAG/H,IAAI,QAAQ,GAAG,OAAO,iBAAiB,KAAK,WAAW,IAAI,OAAO,aAAa,KAAK,WAAW,IAAI,OAAO,cAAc,KAAK,WAAW,CAAC;;;AAGzI,SAAS,WAAW,GAAG;;;EAGrB,OAAO,YAAY;IACjB,OAAO,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;GAChC,CAAC;CACH;;;AAGD,SAAS,aAAa,GAAG;EACvB,IAAI,OAAO,SAAS,KAAK,WAAW,EAAE;IACpC,OAAO,YAAY;MACjB,SAAS,CAAC,KAAK,CAAC,CAAC;KAClB,CAAC;GACH;;EAED,OAAO,aAAa,EAAE,CAAC;CACxB;;AAED,SAAS,mBAAmB,GAAG;EAC7B,IAAI,UAAU,GAAG,CAAC,CAAC;EACnB,IAAI,QAAQ,GAAG,IAAI,uBAAuB,CAAC,KAAK,CAAC,CAAC;EAClD,IAAI,IAAI,GAAG,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;EACvC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;;EAEhD,OAAO,YAAY;IACjB,IAAI,CAAC,IAAI,GAAG,UAAU,GAAG,EAAE,UAAU,GAAG,CAAC,CAAC;GAC3C,CAAC;CACH;;;AAGD,SAAS,iBAAiB,GAAG;EAC3B,IAAI,OAAO,GAAG,IAAI,cAAc,EAAE,CAAC;EACnC,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC;EAChC,OAAO,YAAY;IACjB,OAAO,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;GACrC,CAAC;CACH;;AAED,SAAS,aAAa,GAAG;;;EAGvB,IAAI,gBAAgB,GAAG,UAAU,CAAC;EAClC,OAAO,YAAY;IACjB,OAAO,gBAAgB,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;GACnC,CAAC;CACH;;AAED,IAAI,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC;AAC5B,SAAS,KAAK,GAAG;EACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE;IAC/B,IAAI,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACxB,IAAI,GAAG,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;;IAEvB,QAAQ,CAAC,GAAG,CAAC,CAAC;;IAEd,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IACrB,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC;GAC1B;;EAED,GAAG,GAAG,CAAC,CAAC;CACT;;AAED,SAAS,YAAY,GAAG;EACtB,IAAI;IACF,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACvD,SAAS,GAAG,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,YAAY,CAAC;IAClD,OAAO,aAAa,EAAE,CAAC;GACxB,CAAC,OAAO,CAAC,EAAE;IACV,OAAO,aAAa,EAAE,CAAC;GACxB;CACF;;AAED,IAAI,aAAa,GAAG,KAAK,CAAC,CAAC;;AAE3B,IAAI,MAAM,EAAE;EACV,aAAa,GAAG,WAAW,EAAE,CAAC;CAC/B,MAAM,IAAI,uBAAuB,EAAE;EAClC,aAAa,GAAG,mBAAmB,EAAE,CAAC;CACvC,MAAM,IAAI,QAAQ,EAAE;EACnB,aAAa,GAAG,iBAAiB,EAAE,CAAC;CACrC,MAAM,IAAI,aAAa,KAAK,SAAS,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;EACvE,aAAa,GAAG,YAAY,EAAE,CAAC;CAChC,MAAM;EACL,aAAa,GAAG,aAAa,EAAE,CAAC;;;CACjC,DCtHc,SAAS,IAAI,CAAC,aAAa,EAAE,WAAW,EAAE;EACvD,IAAI,MAAM,GAAG,IAAI,CAAC;;EAElB,IAAI,KAAK,GAAG,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;;EAEvC,IAAI,KAAK,CAAC,UAAU,CAAC,KAAK,SAAS,EAAE;IACnC,WAAW,CAAC,KAAK,CAAC,CAAC;GACpB;;EAED,IAAI,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;;;EAG3B,IAAI,MAAM,EAAE;IACV,IAAI,QAAQ,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACrC,IAAI,CAAC,YAAY;MACf,OAAO,cAAc,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;KAChE,CAAC,CAAC;GACJ,MAAM;IACL,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC;GACtD;;EAED,OAAO,KAAK,CAAC;;;CACd,DCxBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,AAAe,SAASA,SAAO,CAAC,MAAM,EAAE;;EAEtC,IAAI,WAAW,GAAG,IAAI,CAAC;;EAEvB,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,WAAW,KAAK,WAAW,EAAE;IAC9E,OAAO,MAAM,CAAC;GACf;;EAED,IAAI,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;EACpCC,OAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;EAC1B,OAAO,OAAO,CAAC;;;CAChB,DCrCM,IAAI,UAAU,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;;AAEhE,SAAS,IAAI,GAAG,EAAE;;AAElB,IAAI,OAAO,GAAG,KAAK,CAAC,CAAC;AACrB,IAAI,SAAS,GAAG,CAAC,CAAC;AAClB,IAAI,QAAQ,GAAG,CAAC,CAAC;;AAEjB,IAAI,eAAe,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;;AAEtC,SAAS,eAAe,GAAG;EACzB,OAAO,IAAI,SAAS,CAAC,0CAA0C,CAAC,CAAC;CAClE;;AAED,SAAS,eAAe,GAAG;EACzB,OAAO,IAAI,SAAS,CAAC,sDAAsD,CAAC,CAAC;CAC9E;;AAED,SAAS,OAAO,CAAC,OAAO,EAAE;EACxB,IAAI;IACF,OAAO,OAAO,CAAC,IAAI,CAAC;GACrB,CAAC,OAAO,KAAK,EAAE;IACd,eAAe,CAAC,KAAK,GAAG,KAAK,CAAC;IAC9B,OAAO,eAAe,CAAC;GACxB;CACF;;AAED,SAAS,OAAO,CAACC,OAAI,EAAE,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE;EAClE,IAAI;IACFA,OAAI,CAAC,IAAI,CAAC,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,CAAC,CAAC;GACxD,CAAC,OAAO,CAAC,EAAE;IACV,OAAO,CAAC,CAAC;GACV;CACF;;AAED,SAAS,qBAAqB,CAAC,OAAO,EAAE,QAAQ,EAAEA,OAAI,EAAE;EACtD,IAAI,CAAC,UAAU,OAAO,EAAE;IACtB,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,IAAI,KAAK,GAAG,OAAO,CAACA,OAAI,EAAE,QAAQ,EAAE,UAAU,KAAK,EAAE;MACnD,IAAI,MAAM,EAAE;QACV,OAAO;OACR;MACD,MAAM,GAAG,IAAI,CAAC;MACd,IAAI,QAAQ,KAAK,KAAK,EAAE;QACtB,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;OACzB,MAAM;QACL,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;OACzB;KACF,EAAE,UAAU,MAAM,EAAE;MACnB,IAAI,MAAM,EAAE;QACV,OAAO;OACR;MACD,MAAM,GAAG,IAAI,CAAC;;MAEd,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KACzB,EAAE,UAAU,IAAI,OAAO,CAAC,MAAM,IAAI,kBAAkB,CAAC,CAAC,CAAC;;IAExD,IAAI,CAAC,MAAM,IAAI,KAAK,EAAE;MACpB,MAAM,GAAG,IAAI,CAAC;MACd,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KACxB;GACF,EAAE,OAAO,CAAC,CAAC;CACb;;AAED,SAAS,iBAAiB,CAAC,OAAO,EAAE,QAAQ,EAAE;EAC5C,IAAI,QAAQ,CAAC,MAAM,KAAK,SAAS,EAAE;IACjC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;GACpC,MAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,QAAQ,EAAE;IACvC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;GACnC,MAAM;IACL,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,KAAK,EAAE;MAC9C,OAAO,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KAChC,EAAE,UAAU,MAAM,EAAE;MACnB,OAAO,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KAChC,CAAC,CAAC;GACJ;CACF;;AAED,SAAS,mBAAmB,CAAC,OAAO,EAAE,aAAa,EAAEA,OAAI,EAAE;EACzD,IAAI,aAAa,CAAC,WAAW,KAAK,OAAO,CAAC,WAAW,IAAIA,OAAI,KAAKC,IAAY,IAAI,aAAa,CAAC,WAAW,CAAC,OAAO,KAAKC,SAAe,EAAE;IACvI,iBAAiB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;GAC3C,MAAM;IACL,IAAIF,OAAI,KAAK,eAAe,EAAE;MAC5B,MAAM,CAAC,OAAO,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC;MACvC,eAAe,CAAC,KAAK,GAAG,IAAI,CAAC;KAC9B,MAAM,IAAIA,OAAI,KAAK,SAAS,EAAE;MAC7B,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;KACjC,MAAM,IAAI,UAAU,CAACA,OAAI,CAAC,EAAE;MAC3B,qBAAqB,CAAC,OAAO,EAAE,aAAa,EAAEA,OAAI,CAAC,CAAC;KACrD,MAAM;MACL,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;KACjC;GACF;CACF;;AAED,SAAS,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE;EAC/B,IAAI,OAAO,KAAK,KAAK,EAAE;IACrB,MAAM,CAAC,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;GACpC,MAAM,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;IAClC,mBAAmB,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;GACrD,MAAM;IACL,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACzB;CACF;;AAED,SAAS,gBAAgB,CAAC,OAAO,EAAE;EACjC,IAAI,OAAO,CAAC,QAAQ,EAAE;IACpB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;GACnC;;EAED,OAAO,CAAC,OAAO,CAAC,CAAC;CAClB;;AAED,SAAS,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE;EAC/B,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;IAC9B,OAAO;GACR;;EAED,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC;EACxB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;;EAE3B,IAAI,OAAO,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE;IACrC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;GACxB;CACF;;AAED,SAAS,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE;EAC/B,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;IAC9B,OAAO;GACR;EACD,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC;EAC1B,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC;;EAEzB,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;CACjC;;AAED,SAAS,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE;EAC5D,IAAI,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;EACvC,IAAI,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC;;;EAGjC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC;;EAEvB,YAAY,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;EAC7B,YAAY,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,aAAa,CAAC;EACjD,YAAY,CAAC,MAAM,GAAG,QAAQ,CAAC,GAAG,WAAW,CAAC;;EAE9C,IAAI,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE;IACjC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;GACvB;CACF;;AAED,SAAS,OAAO,CAAC,OAAO,EAAE;EACxB,IAAI,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC;EACvC,IAAI,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;;EAE7B,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;IAC5B,OAAO;GACR;;EAED,IAAI,KAAK,GAAG,KAAK,CAAC;MACd,QAAQ,GAAG,KAAK,CAAC;MACjB,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;;EAE7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;IAC9C,KAAK,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;IACvB,QAAQ,GAAG,WAAW,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC;;IAEpC,IAAI,KAAK,EAAE;MACT,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;KAClD,MAAM;MACL,QAAQ,CAAC,MAAM,CAAC,CAAC;KAClB;GACF;;EAED,OAAO,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC;CACjC;;AAED,SAAS,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE;EAClC,IAAI;IACF,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC;GACzB,CAAC,OAAO,CAAC,EAAE;IACV,eAAe,CAAC,KAAK,GAAG,CAAC,CAAC;IAC1B,OAAO,eAAe,CAAC;GACxB;CACF;;AAED,SAAS,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE;EAC1D,IAAI,WAAW,GAAG,UAAU,CAAC,QAAQ,CAAC;MAClC,KAAK,GAAG,KAAK,CAAC;MACd,KAAK,GAAG,KAAK,CAAC;MACd,SAAS,GAAG,KAAK,CAAC;MAClB,MAAM,GAAG,KAAK,CAAC,CAAC;;EAEpB,IAAI,WAAW,EAAE;IACf,KAAK,GAAG,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;;IAEnC,IAAI,KAAK,KAAK,eAAe,EAAE;MAC7B,MAAM,GAAG,IAAI,CAAC;MACd,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;MACpB,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC;KACpB,MAAM;MACL,SAAS,GAAG,IAAI,CAAC;KAClB;;IAED,IAAI,OAAO,KAAK,KAAK,EAAE;MACrB,MAAM,CAAC,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;MACnC,OAAO;KACR;GACF,MAAM;IACL,KAAK,GAAG,MAAM,CAAC;IACf,SAAS,GAAG,IAAI,CAAC;GAClB;;EAED,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;;GAE/B,MAAM,IAAI,WAAW,IAAI,SAAS,EAAE;IACnC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACzB,MAAM,IAAI,MAAM,EAAE;IACjB,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACxB,MAAM,IAAI,OAAO,KAAK,SAAS,EAAE;IAChC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACzB,MAAM,IAAI,OAAO,KAAK,QAAQ,EAAE;IAC/B,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;GACxB;CACF;;AAED,SAAS,iBAAiB,CAAC,OAAO,EAAE,QAAQ,EAAE;EAC5C,IAAI;IACF,QAAQ,CAAC,SAAS,cAAc,CAAC,KAAK,EAAE;MACtC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KACzB,EAAE,SAAS,aAAa,CAAC,MAAM,EAAE;MAChC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KACzB,CAAC,CAAC;GACJ,CAAC,OAAO,CAAC,EAAE;IACV,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;GACpB;CACF;;AAED,IAAI,EAAE,GAAG,CAAC,CAAC;AACX,SAAS,MAAM,GAAG;EAChB,OAAO,EAAE,EAAE,CAAC;CACb;;AAED,SAAS,WAAW,CAAC,OAAO,EAAE;EAC5B,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC;EAC3B,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;EAC3B,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;EAC5B,OAAO,CAAC,YAAY,GAAG,EAAE,CAAC;CAC3B;;ACrPD,SAAS,eAAe,GAAG;EACzB,OAAO,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;CAC7D,AAAC;;AAEF,IAAI,UAAU,GAAG,YAAY;EAC3B,SAAS,UAAU,CAAC,WAAW,EAAE,KAAK,EAAE;IACtC,IAAI,CAAC,oBAAoB,GAAG,WAAW,CAAC;IACxC,IAAI,CAAC,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;;IAErC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;MAC7B,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KAC3B;;IAED,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE;MAClB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;MAC3B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC;;MAE/B,IAAI,CAAC,OAAO,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;;MAEtC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;QACrB,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;OACrC,MAAM;QACL,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC;QAC/B,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACvB,IAAI,IAAI,CAAC,UAAU,KAAK,CAAC,EAAE;UACzB,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;SACrC;OACF;KACF,MAAM;MACL,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;KACzC;GACF;;EAED,UAAU,CAAC,SAAS,CAAC,UAAU,GAAG,SAAS,UAAU,CAAC,KAAK,EAAE;IAC3D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,MAAM,KAAK,OAAO,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;MAChE,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;KAC9B;GACF,CAAC;;EAEF,UAAU,CAAC,SAAS,CAAC,UAAU,GAAG,SAAS,UAAU,CAAC,KAAK,EAAE,CAAC,EAAE;IAC9D,IAAI,CAAC,GAAG,IAAI,CAAC,oBAAoB,CAAC;IAClC,IAAIF,UAAO,GAAG,CAAC,CAAC,OAAO,CAAC;;;IAGxB,IAAIA,UAAO,KAAKI,SAAe,EAAE;MAC/B,IAAI,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;;MAE3B,IAAI,KAAK,KAAKD,IAAY,IAAI,KAAK,CAAC,MAAM,KAAK,OAAO,EAAE;QACtD,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;OACjD,MAAM,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE;QACtC,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;OACzB,MAAM,IAAI,CAAC,KAAKE,SAAO,EAAE;QACxB,IAAI,OAAO,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;QAC1B,mBAAmB,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAC3C,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;OAChC,MAAM;QACL,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,UAAUL,UAAO,EAAE;UAC1C,OAAOA,UAAO,CAAC,KAAK,CAAC,CAAC;SACvB,CAAC,EAAE,CAAC,CAAC,CAAC;OACR;KACF,MAAM;MACL,IAAI,CAAC,aAAa,CAACA,UAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;KACvC;GACF,CAAC;;EAEF,UAAU,CAAC,SAAS,CAAC,UAAU,GAAG,SAAS,UAAU,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE;IACrE,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;;;IAG3B,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE;MAC9B,IAAI,CAAC,UAAU,EAAE,CAAC;;MAElB,IAAI,KAAK,KAAK,QAAQ,EAAE;QACtB,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;OACxB,MAAM;QACL,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;OACzB;KACF;;IAED,IAAI,IAAI,CAAC,UAAU,KAAK,CAAC,EAAE;MACzB,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;KAChC;GACF,CAAC;;EAEF,UAAU,CAAC,SAAS,CAAC,aAAa,GAAG,SAAS,aAAa,CAAC,OAAO,EAAE,CAAC,EAAE;IACtE,IAAI,UAAU,GAAG,IAAI,CAAC;;IAEtB,SAAS,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,KAAK,EAAE;MAC7C,OAAO,UAAU,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;KACnD,EAAE,UAAU,MAAM,EAAE;MACnB,OAAO,UAAU,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;KACnD,CAAC,CAAC;GACJ,CAAC;;EAEF,OAAO,UAAU,CAAC;CACnB,EAAE;;ACzGH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,AAAe,SAAS,GAAG,CAAC,OAAO,EAAE;EACnC,OAAO,IAAI,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC;;;CAC9C,DCjDD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,AAAe,SAAS,IAAI,CAAC,OAAO,EAAE;;EAEpC,IAAI,WAAW,GAAG,IAAI,CAAC;;EAEvB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;IACrB,OAAO,IAAI,WAAW,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE;MAC1C,OAAO,MAAM,CAAC,IAAI,SAAS,CAAC,iCAAiC,CAAC,CAAC,CAAC;KACjE,CAAC,CAAC;GACJ,MAAM;IACL,OAAO,IAAI,WAAW,CAAC,UAAU,OAAO,EAAE,MAAM,EAAE;MAChD,IAAI,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;MAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QAC/B,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;OACvD;KACF,CAAC,CAAC;GACJ;;;CACF,DCjFD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,AAAe,SAASM,QAAM,CAAC,MAAM,EAAE;;EAErC,IAAI,WAAW,GAAG,IAAI,CAAC;EACvB,IAAI,OAAO,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;EACpCC,MAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;EACzB,OAAO,OAAO,CAAC;;;CAChB,DC9BD,SAAS,aAAa,GAAG;EACvB,MAAM,IAAI,SAAS,CAAC,oFAAoF,CAAC,CAAC;CAC3G;;AAED,SAAS,QAAQ,GAAG;EAClB,MAAM,IAAI,SAAS,CAAC,uHAAuH,CAAC,CAAC;CAC9I;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0GD,IAAIF,SAAO,GAAG,YAAY;EACxB,SAAS,OAAO,CAAC,QAAQ,EAAE;IACzB,IAAI,CAAC,UAAU,CAAC,GAAG,MAAM,EAAE,CAAC;IAC5B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;IACvC,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;;IAEvB,IAAI,IAAI,KAAK,QAAQ,EAAE;MACrB,OAAO,QAAQ,KAAK,UAAU,IAAI,aAAa,EAAE,CAAC;MAClD,IAAI,YAAY,OAAO,GAAG,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,GAAG,QAAQ,EAAE,CAAC;KAC1E;GACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4LD,OAAO,CAAC,SAAS,CAAC,KAAK,GAAG,SAAS,MAAM,CAAC,WAAW,EAAE;IACrD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;GACrC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0CF,OAAO,CAAC,SAAS,CAAC,OAAO,GAAG,SAAS,QAAQ,CAAC,QAAQ,EAAE;IACtD,IAAI,OAAO,GAAG,IAAI,CAAC;IACnB,IAAI,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;;IAEtC,OAAO,OAAO,CAAC,IAAI,CAAC,UAAU,KAAK,EAAE;MACnC,OAAO,WAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY;QACtD,OAAO,KAAK,CAAC;OACd,CAAC,CAAC;KACJ,EAAE,UAAU,MAAM,EAAE;MACnB,OAAO,WAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY;QACtD,MAAM,MAAM,CAAC;OACd,CAAC,CAAC;KACJ,CAAC,CAAC;GACJ,CAAC;;EAEF,OAAO,OAAO,CAAC;CAChB,EAAE,CAAC;;AAEJA,SAAO,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC;AAC9B,AACAA,SAAO,CAAC,GAAG,GAAG,GAAG,CAAC;AAClBA,SAAO,CAAC,IAAI,GAAG,IAAI,CAAC;AACpBA,SAAO,CAAC,OAAO,GAAGG,SAAO,CAAC;AAC1BH,SAAO,CAAC,MAAM,GAAGI,QAAM,CAAC;AACxBJ,SAAO,CAAC,aAAa,GAAG,YAAY,CAAC;AACrCA,SAAO,CAAC,QAAQ,GAAG,OAAO,CAAC;AAC3BA,SAAO,CAAC,KAAK,GAAG,IAAI;;ACxYpB;AACA,AAEe,SAAS,QAAQ,GAAG;EACjC,IAAI,KAAK,GAAG,KAAK,CAAC,CAAC;;EAEnB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IACjC,KAAK,GAAG,MAAM,CAAC;GAChB,MAAM,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;IACtC,KAAK,GAAG,IAAI,CAAC;GACd,MAAM;IACL,IAAI;MACF,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;KACnC,CAAC,OAAO,CAAC,EAAE;MACV,MAAM,IAAI,KAAK,CAAC,0EAA0E,CAAC,CAAC;KAC7F;GACF;;EAED,IAAI,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC;;EAEtB,IAAI,CAAC,EAAE;IACL,IAAI,eAAe,GAAG,IAAI,CAAC;IAC3B,IAAI;MACF,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;KAC/D,CAAC,OAAO,CAAC,EAAE;;KAEX;;IAED,IAAI,eAAe,KAAK,kBAAkB,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE;MACrD,OAAO;KACR;GACF;;EAED,KAAK,CAAC,OAAO,GAAGA,SAAO,CAAC;;;CACzB,DC/BD;AACAA,SAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC5BA,SAAO,CAAC,OAAO,GAAGA,SAAO,CAAC;;;;;;;;","file":"es6-promise.min.js"}'use strict' const MiniPass = require('minipass') const EE = require('events').EventEmitter const fs = require('fs') let writev = fs.writev /* istanbul ignore next */ if (!writev) { // This entire block can be removed if support for earlier than Node.js // 12.9.0 is not needed. const binding = process.binding('fs') const FSReqWrap = binding.FSReqWrap || binding.FSReqCallback writev = (fd, iovec, pos, cb) => { const done = (er, bw) => cb(er, bw, iovec) const req = new FSReqWrap() req.oncomplete = done binding.writeBuffers(fd, iovec, pos, req) } } const _autoClose = Symbol('_autoClose') const _close = Symbol('_close') const _ended = Symbol('_ended') const _fd = Symbol('_fd') const _finished = Symbol('_finished') const _flags = Symbol('_flags') const _flush = Symbol('_flush') const _handleChunk = Symbol('_handleChunk') const _makeBuf = Symbol('_makeBuf') const _mode = Symbol('_mode') const _needDrain = Symbol('_needDrain') const _onerror = Symbol('_onerror') const _onopen = Symbol('_onopen') const _onread = Symbol('_onread') const _onwrite = Symbol('_onwrite') const _open = Symbol('_open') const _path = Symbol('_path') const _pos = Symbol('_pos') const _queue = Symbol('_queue') const _read = Symbol('_read') const _readSize = Symbol('_readSize') const _reading = Symbol('_reading') const _remain = Symbol('_remain') const _size = Symbol('_size') const _write = Symbol('_write') const _writing = Symbol('_writing') const _defaultFlag = Symbol('_defaultFlag') const _errored = Symbol('_errored') class ReadStream extends MiniPass { constructor (path, opt) { opt = opt || {} super(opt) this.readable = true this.writable = false if (typeof path !== 'string') throw new TypeError('path must be a string') this[_errored] = false this[_fd] = typeof opt.fd === 'number' ? opt.fd : null this[_path] = path this[_readSize] = opt.readSize || 16*1024*1024 this[_reading] = false this[_size] = typeof opt.size === 'number' ? opt.size : Infinity this[_remain] = this[_size] this[_autoClose] = typeof opt.autoClose === 'boolean' ? opt.autoClose : true if (typeof this[_fd] === 'number') this[_read]() else this[_open]() } get fd () { return this[_fd] } get path () { return this[_path] } write () { throw new TypeError('this is a readable stream') } end () { throw new TypeError('this is a readable stream') } [_open] () { fs.open(this[_path], 'r', (er, fd) => this[_onopen](er, fd)) } [_onopen] (er, fd) { if (er) this[_onerror](er) else { this[_fd] = fd this.emit('open', fd) this[_read]() } } [_makeBuf] () { return Buffer.allocUnsafe(Math.min(this[_readSize], this[_remain])) } [_read] () { if (!this[_reading]) { this[_reading] = true const buf = this[_makeBuf]() /* istanbul ignore if */ if (buf.length === 0) return process.nextTick(() => this[_onread](null, 0, buf)) fs.read(this[_fd], buf, 0, buf.length, null, (er, br, buf) => this[_onread](er, br, buf)) } } [_onread] (er, br, buf) { this[_reading] = false if (er) this[_onerror](er) else if (this[_handleChunk](br, buf)) this[_read]() } [_close] () { if (this[_autoClose] && typeof this[_fd] === 'number') { const fd = this[_fd] this[_fd] = null fs.close(fd, er => er ? this.emit('error', er) : this.emit('close')) } } [_onerror] (er) { this[_reading] = true this[_close]() this.emit('error', er) } [_handleChunk] (br, buf) { let ret = false // no effect if infinite this[_remain] -= br if (br > 0) ret = super.write(br < buf.length ? buf.slice(0, br) : buf) if (br === 0 || this[_remain] <= 0) { ret = false this[_close]() super.end() } return ret } emit (ev, data) { switch (ev) { case 'prefinish': case 'finish': break case 'drain': if (typeof this[_fd] === 'number') this[_read]() break case 'error': if (this[_errored]) return this[_errored] = true return super.emit(ev, data) default: return super.emit(ev, data) } } } class ReadStreamSync extends ReadStream { [_open] () { let threw = true try { this[_onopen](null, fs.openSync(this[_path], 'r')) threw = false } finally { if (threw) this[_close]() } } [_read] () { let threw = true try { if (!this[_reading]) { this[_reading] = true do { const buf = this[_makeBuf]() /* istanbul ignore next */ const br = buf.length === 0 ? 0 : fs.readSync(this[_fd], buf, 0, buf.length, null) if (!this[_handleChunk](br, buf)) break } while (true) this[_reading] = false } threw = false } finally { if (threw) this[_close]() } } [_close] () { if (this[_autoClose] && typeof this[_fd] === 'number') { const fd = this[_fd] this[_fd] = null fs.closeSync(fd) this.emit('close') } } } class WriteStream extends EE { constructor (path, opt) { opt = opt || {} super(opt) this.readable = false this.writable = true this[_errored] = false this[_writing] = false this[_ended] = false this[_needDrain] = false this[_queue] = [] this[_path] = path this[_fd] = typeof opt.fd === 'number' ? opt.fd : null this[_mode] = opt.mode === undefined ? 0o666 : opt.mode this[_pos] = typeof opt.start === 'number' ? opt.start : null this[_autoClose] = typeof opt.autoClose === 'boolean' ? opt.autoClose : true // truncating makes no sense when writing into the middle const defaultFlag = this[_pos] !== null ? 'r+' : 'w' this[_defaultFlag] = opt.flags === undefined this[_flags] = this[_defaultFlag] ? defaultFlag : opt.flags if (this[_fd] === null) this[_open]() } emit (ev, data) { if (ev === 'error') { if (this[_errored]) return this[_errored] = true } return super.emit(ev, data) } get fd () { return this[_fd] } get path () { return this[_path] } [_onerror] (er) { this[_close]() this[_writing] = true this.emit('error', er) } [_open] () { fs.open(this[_path], this[_flags], this[_mode], (er, fd) => this[_onopen](er, fd)) } [_onopen] (er, fd) { if (this[_defaultFlag] && this[_flags] === 'r+' && er && er.code === 'ENOENT') { this[_flags] = 'w' this[_open]() } else if (er) this[_onerror](er) else { this[_fd] = fd this.emit('open', fd) this[_flush]() } } end (buf, enc) { if (buf) this.write(buf, enc) this[_ended] = true // synthetic after-write logic, where drain/finish live if (!this[_writing] && !this[_queue].length && typeof this[_fd] === 'number') this[_onwrite](null, 0) return this } write (buf, enc) { if (typeof buf === 'string') buf = Buffer.from(buf, enc) if (this[_ended]) { this.emit('error', new Error('write() after end()')) return false } if (this[_fd] === null || this[_writing] || this[_queue].length) { this[_queue].push(buf) this[_needDrain] = true return false } this[_writing] = true this[_write](buf) return true } [_write] (buf) { fs.write(this[_fd], buf, 0, buf.length, this[_pos], (er, bw) => this[_onwrite](er, bw)) } [_onwrite] (er, bw) { if (er) this[_onerror](er) else { if (this[_pos] !== null) this[_pos] += bw if (this[_queue].length) this[_flush]() else { this[_writing] = false if (this[_ended] && !this[_finished]) { this[_finished] = true this[_close]() this.emit('finish') } else if (this[_needDrain]) { this[_needDrain] = false this.emit('drain') } } } } [_flush] () { if (this[_queue].length === 0) { if (this[_ended]) this[_onwrite](null, 0) } else if (this[_queue].length === 1) this[_write](this[_queue].pop()) else { const iovec = this[_queue] this[_queue] = [] writev(this[_fd], iovec, this[_pos], (er, bw) => this[_onwrite](er, bw)) } } [_close] () { if (this[_autoClose] && typeof this[_fd] === 'number') { const fd = this[_fd] this[_fd] = null fs.close(fd, er => er ? this.emit('error', er) : this.emit('close')) } } } class WriteStreamSync extends WriteStream { [_open] () { let fd // only wrap in a try{} block if we know we'll retry, to avoid // the rethrow obscuring the error's source frame in most cases. if (this[_defaultFlag] && this[_flags] === 'r+') { try { fd = fs.openSync(this[_path], this[_flags], this[_mode]) } catch (er) { if (er.code === 'ENOENT') { this[_flags] = 'w' return this[_open]() } else throw er } } else fd = fs.openSync(this[_path], this[_flags], this[_mode]) this[_onopen](null, fd) } [_close] () { if (this[_autoClose] && typeof this[_fd] === 'number') { const fd = this[_fd] this[_fd] = null fs.closeSync(fd) this.emit('close') } } [_write] (buf) { // throw the original, but try to close if it fails let threw = true try { this[_onwrite](null, fs.writeSync(this[_fd], buf, 0, buf.length, this[_pos])) threw = false } finally { if (threw) try { this[_close]() } catch (_) {} } } } exports.ReadStream = ReadStream exports.ReadStreamSync = ReadStreamSync exports.WriteStream = WriteStream exports.WriteStreamSync = WriteStreamSync The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "fs-minipass", "version": "2.1.0", "main": "index.js", "scripts": { "test": "tap", "preversion": "npm test", "postversion": "npm publish", "postpublish": "git push origin --follow-tags" }, "keywords": [], "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "license": "ISC", "repository": { "type": "git", "url": "git+https://github.com/npm/fs-minipass.git" }, "bugs": { "url": "https://github.com/npm/fs-minipass/issues" }, "homepage": "https://github.com/npm/fs-minipass#readme", "description": "fs read and write streams based on minipass", "dependencies": { "minipass": "^3.0.0" }, "devDependencies": { "mutate-fs": "^2.0.1", "tap": "^14.6.4" }, "files": [ "index.js" ], "tap": { "check-coverage": true }, "engines": { "node": ">= 8" } } module.exports = realpath realpath.realpath = realpath realpath.sync = realpathSync realpath.realpathSync = realpathSync realpath.monkeypatch = monkeypatch realpath.unmonkeypatch = unmonkeypatch var fs = require('fs') var origRealpath = fs.realpath var origRealpathSync = fs.realpathSync var version = process.version var ok = /^v[0-5]\./.test(version) var old = require('./old.js') function newError (er) { return er && er.syscall === 'realpath' && ( er.code === 'ELOOP' || er.code === 'ENOMEM' || er.code === 'ENAMETOOLONG' ) } function realpath (p, cache, cb) { if (ok) { return origRealpath(p, cache, cb) } if (typeof cache === 'function') { cb = cache cache = null } origRealpath(p, cache, function (er, result) { if (newError(er)) { old.realpath(p, cache, cb) } else { cb(er, result) } }) } function realpathSync (p, cache) { if (ok) { return origRealpathSync(p, cache) } try { return origRealpathSync(p, cache) } catch (er) { if (newError(er)) { return old.realpathSync(p, cache) } else { throw er } } } function monkeypatch () { fs.realpath = realpath fs.realpathSync = realpathSync } function unmonkeypatch () { fs.realpath = origRealpath fs.realpathSync = origRealpathSync } The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ---- This library bundles a version of the `fs.realpath` and `fs.realpathSync` methods from Node.js v0.10 under the terms of the Node.js MIT license. Node's license follows, also included at the header of `old.js` which contains the licensed code: Copyright Joyent, Inc. and other Node contributors. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. var pathModule = require('path'); var isWindows = process.platform === 'win32'; var fs = require('fs'); // JavaScript implementation of realpath, ported from node pre-v6 var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); function rethrow() { // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and // is fairly slow to generate. var callback; if (DEBUG) { var backtrace = new Error; callback = debugCallback; } else callback = missingCallback; return callback; function debugCallback(err) { if (err) { backtrace.message = err.message; err = backtrace; missingCallback(err); } } function missingCallback(err) { if (err) { if (process.throwDeprecation) throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs else if (!process.noDeprecation) { var msg = 'fs: missing callback ' + (err.stack || err.message); if (process.traceDeprecation) console.trace(msg); else console.error(msg); } } } } function maybeCallback(cb) { return typeof cb === 'function' ? cb : rethrow(); } var normalize = pathModule.normalize; // Regexp that finds the next partion of a (partial) path // result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] if (isWindows) { var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; } else { var nextPartRe = /(.*?)(?:[\/]+|$)/g; } // Regex to find the device root, including trailing slash. E.g. 'c:\\'. if (isWindows) { var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; } else { var splitRootRe = /^[\/]*/; } exports.realpathSync = function realpathSync(p, cache) { // make p is absolute p = pathModule.resolve(p); if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { return cache[p]; } var original = p, seenLinks = {}, knownHard = {}; // current character position in p var pos; // the partial path so far, including a trailing slash if any var current; // the partial path without a trailing slash (except when pointing at a root) var base; // the partial path scanned in the previous round, with slash var previous; start(); function start() { // Skip over roots var m = splitRootRe.exec(p); pos = m[0].length; current = m[0]; base = m[0]; previous = ''; // On windows, check that the root exists. On unix there is no need. if (isWindows && !knownHard[base]) { fs.lstatSync(base); knownHard[base] = true; } } // walk down the path, swapping out linked pathparts for their real // values // NB: p.length changes. while (pos < p.length) { // find the next part nextPartRe.lastIndex = pos; var result = nextPartRe.exec(p); previous = current; current += result[0]; base = previous + result[1]; pos = nextPartRe.lastIndex; // continue if not a symlink if (knownHard[base] || (cache && cache[base] === base)) { continue; } var resolvedLink; if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { // some known symbolic link. no need to stat again. resolvedLink = cache[base]; } else { var stat = fs.lstatSync(base); if (!stat.isSymbolicLink()) { knownHard[base] = true; if (cache) cache[base] = base; continue; } // read the link if it wasn't read before // dev/ino always return 0 on windows, so skip the check. var linkTarget = null; if (!isWindows) { var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); if (seenLinks.hasOwnProperty(id)) { linkTarget = seenLinks[id]; } } if (linkTarget === null) { fs.statSync(base); linkTarget = fs.readlinkSync(base); } resolvedLink = pathModule.resolve(previous, linkTarget); // track this, if given a cache. if (cache) cache[base] = resolvedLink; if (!isWindows) seenLinks[id] = linkTarget; } // resolve the link, then start over p = pathModule.resolve(resolvedLink, p.slice(pos)); start(); } if (cache) cache[original] = p; return p; }; exports.realpath = function realpath(p, cache, cb) { if (typeof cb !== 'function') { cb = maybeCallback(cache); cache = null; } // make p is absolute p = pathModule.resolve(p); if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { return process.nextTick(cb.bind(null, null, cache[p])); } var original = p, seenLinks = {}, knownHard = {}; // current character position in p var pos; // the partial path so far, including a trailing slash if any var current; // the partial path without a trailing slash (except when pointing at a root) var base; // the partial path scanned in the previous round, with slash var previous; start(); function start() { // Skip over roots var m = splitRootRe.exec(p); pos = m[0].length; current = m[0]; base = m[0]; previous = ''; // On windows, check that the root exists. On unix there is no need. if (isWindows && !knownHard[base]) { fs.lstat(base, function(err) { if (err) return cb(err); knownHard[base] = true; LOOP(); }); } else { process.nextTick(LOOP); } } // walk down the path, swapping out linked pathparts for their real // values function LOOP() { // stop if scanned past end of path if (pos >= p.length) { if (cache) cache[original] = p; return cb(null, p); } // find the next part nextPartRe.lastIndex = pos; var result = nextPartRe.exec(p); previous = current; current += result[0]; base = previous + result[1]; pos = nextPartRe.lastIndex; // continue if not a symlink if (knownHard[base] || (cache && cache[base] === base)) { return process.nextTick(LOOP); } if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { // known symbolic link. no need to stat again. return gotResolvedLink(cache[base]); } return fs.lstat(base, gotStat); } function gotStat(err, stat) { if (err) return cb(err); // if not a symlink, skip to the next path part if (!stat.isSymbolicLink()) { knownHard[base] = true; if (cache) cache[base] = base; return process.nextTick(LOOP); } // stat & read the link if not read before // call gotTarget as soon as the link target is known // dev/ino always return 0 on windows, so skip the check. if (!isWindows) { var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); if (seenLinks.hasOwnProperty(id)) { return gotTarget(null, seenLinks[id], base); } } fs.stat(base, function(err) { if (err) return cb(err); fs.readlink(base, function(err, target) { if (!isWindows) seenLinks[id] = target; gotTarget(err, target); }); }); } function gotTarget(err, target, base) { if (err) return cb(err); var resolvedLink = pathModule.resolve(previous, target); if (cache) cache[base] = resolvedLink; gotResolvedLink(resolvedLink); } function gotResolvedLink(resolvedLink) { // resolve the link, then start over p = pathModule.resolve(resolvedLink, p.slice(pos)); start(); } }; { "name": "fs.realpath", "version": "1.0.0", "description": "Use node's fs.realpath, but fall back to the JS implementation if the native one fails", "main": "index.js", "dependencies": {}, "devDependencies": {}, "scripts": { "test": "tap test/*.js --cov" }, "repository": { "type": "git", "url": "git+https://github.com/isaacs/fs.realpath.git" }, "keywords": [ "realpath", "fs", "polyfill" ], "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "license": "ISC", "files": [ "old.js", "index.js" ] } ISC License Copyright npm, Inc. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND NPM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NPM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "gauge", "version": "4.0.3", "description": "A terminal based horizontal gauge", "main": "lib", "scripts": { "test": "tap", "lint": "eslint '**/*.js'", "postlint": "npm-template-check", "lintfix": "npm run lint -- --fix", "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", "snap": "tap", "posttest": "npm run lint", "template-copy": "npm-template-copy --force" }, "repository": { "type": "git", "url": "https://github.com/npm/gauge" }, "keywords": [ "progressbar", "progress", "gauge" ], "author": "GitHub Inc.", "license": "ISC", "bugs": { "url": "https://github.com/npm/gauge/issues" }, "homepage": "https://github.com/npm/gauge", "dependencies": { "aproba": "^1.0.3 || ^2.0.0", "color-support": "^1.1.3", "console-control-strings": "^1.1.0", "has-unicode": "^2.0.1", "signal-exit": "^3.0.7", "string-width": "^4.2.3", "strip-ansi": "^6.0.1", "wide-align": "^1.1.5" }, "devDependencies": { "@npmcli/template-oss": "^2.9.2", "readable-stream": "^3.6.0", "tap": "^15.1.6" }, "files": [ "bin", "lib" ], "engines": { "node": "^12.13.0 || ^14.15.0 || >=16" }, "tap": { "branches": 79, "statements": 89, "functions": 92, "lines": 90 }, "templateOSS": { "version": "2.9.2" } } 'use strict' var spin = require('./spin.js') var progressBar = require('./progress-bar.js') module.exports = { activityIndicator: function (values, theme, width) { if (values.spun == null) { return } return spin(theme, values.spun) }, progressbar: function (values, theme, width) { if (values.completed == null) { return } return progressBar(theme, width, values.completed) }, } 'use strict' var util = require('util') var User = exports.User = function User (msg) { var err = new Error(msg) Error.captureStackTrace(err, User) err.code = 'EGAUGE' return err } exports.MissingTemplateValue = function MissingTemplateValue (item, values) { var err = new User(util.format('Missing template value "%s"', item.type)) Error.captureStackTrace(err, MissingTemplateValue) err.template = item err.values = values return err } exports.Internal = function Internal (msg) { var err = new Error(msg) Error.captureStackTrace(err, Internal) err.code = 'EGAUGEINTERNAL' return err } 'use strict' var colorSupport = require('color-support') module.exports = colorSupport().hasBasic 'use strict' var Plumbing = require('./plumbing.js') var hasUnicode = require('has-unicode') var hasColor = require('./has-color.js') var onExit = require('signal-exit') var defaultThemes = require('./themes') var setInterval = require('./set-interval.js') var process = require('./process.js') var setImmediate = require('./set-immediate') module.exports = Gauge function callWith (obj, method) { return function () { return method.call(obj) } } function Gauge (arg1, arg2) { var options, writeTo if (arg1 && arg1.write) { writeTo = arg1 options = arg2 || {} } else if (arg2 && arg2.write) { writeTo = arg2 options = arg1 || {} } else { writeTo = process.stderr options = arg1 || arg2 || {} } this._status = { spun: 0, section: '', subsection: '', } this._paused = false // are we paused for back pressure? this._disabled = true // are all progress bar updates disabled? this._showing = false // do we WANT the progress bar on screen this._onScreen = false // IS the progress bar on screen this._needsRedraw = false // should we print something at next tick? this._hideCursor = options.hideCursor == null ? true : options.hideCursor this._fixedFramerate = options.fixedFramerate == null ? !(/^v0\.8\./.test(process.version)) : options.fixedFramerate this._lastUpdateAt = null this._updateInterval = options.updateInterval == null ? 50 : options.updateInterval this._themes = options.themes || defaultThemes this._theme = options.theme var theme = this._computeTheme(options.theme) var template = options.template || [ { type: 'progressbar', length: 20 }, { type: 'activityIndicator', kerning: 1, length: 1 }, { type: 'section', kerning: 1, default: '' }, { type: 'subsection', kerning: 1, default: '' }, ] this.setWriteTo(writeTo, options.tty) var PlumbingClass = options.Plumbing || Plumbing this._gauge = new PlumbingClass(theme, template, this.getWidth()) this._$$doRedraw = callWith(this, this._doRedraw) this._$$handleSizeChange = callWith(this, this._handleSizeChange) this._cleanupOnExit = options.cleanupOnExit == null || options.cleanupOnExit this._removeOnExit = null if (options.enabled || (options.enabled == null && this._tty && this._tty.isTTY)) { this.enable() } else { this.disable() } } Gauge.prototype = {} Gauge.prototype.isEnabled = function () { return !this._disabled } Gauge.prototype.setTemplate = function (template) { this._gauge.setTemplate(template) if (this._showing) { this._requestRedraw() } } Gauge.prototype._computeTheme = function (theme) { if (!theme) { theme = {} } if (typeof theme === 'string') { theme = this._themes.getTheme(theme) } else if ( theme && (Object.keys(theme).length === 0 || theme.hasUnicode != null || theme.hasColor != null) ) { var useUnicode = theme.hasUnicode == null ? hasUnicode() : theme.hasUnicode var useColor = theme.hasColor == null ? hasColor : theme.hasColor theme = this._themes.getDefault({ hasUnicode: useUnicode, hasColor: useColor, platform: theme.platform, }) } return theme } Gauge.prototype.setThemeset = function (themes) { this._themes = themes this.setTheme(this._theme) } Gauge.prototype.setTheme = function (theme) { this._gauge.setTheme(this._computeTheme(theme)) if (this._showing) { this._requestRedraw() } this._theme = theme } Gauge.prototype._requestRedraw = function () { this._needsRedraw = true if (!this._fixedFramerate) { this._doRedraw() } } Gauge.prototype.getWidth = function () { return ((this._tty && this._tty.columns) || 80) - 1 } Gauge.prototype.setWriteTo = function (writeTo, tty) { var enabled = !this._disabled if (enabled) { this.disable() } this._writeTo = writeTo this._tty = tty || (writeTo === process.stderr && process.stdout.isTTY && process.stdout) || (writeTo.isTTY && writeTo) || this._tty if (this._gauge) { this._gauge.setWidth(this.getWidth()) } if (enabled) { this.enable() } } Gauge.prototype.enable = function () { if (!this._disabled) { return } this._disabled = false if (this._tty) { this._enableEvents() } if (this._showing) { this.show() } } Gauge.prototype.disable = function () { if (this._disabled) { return } if (this._showing) { this._lastUpdateAt = null this._showing = false this._doRedraw() this._showing = true } this._disabled = true if (this._tty) { this._disableEvents() } } Gauge.prototype._enableEvents = function () { if (this._cleanupOnExit) { this._removeOnExit = onExit(callWith(this, this.disable)) } this._tty.on('resize', this._$$handleSizeChange) if (this._fixedFramerate) { this.redrawTracker = setInterval(this._$$doRedraw, this._updateInterval) if (this.redrawTracker.unref) { this.redrawTracker.unref() } } } Gauge.prototype._disableEvents = function () { this._tty.removeListener('resize', this._$$handleSizeChange) if (this._fixedFramerate) { clearInterval(this.redrawTracker) } if (this._removeOnExit) { this._removeOnExit() } } Gauge.prototype.hide = function (cb) { if (this._disabled) { return cb && process.nextTick(cb) } if (!this._showing) { return cb && process.nextTick(cb) } this._showing = false this._doRedraw() cb && setImmediate(cb) } Gauge.prototype.show = function (section, completed) { this._showing = true if (typeof section === 'string') { this._status.section = section } else if (typeof section === 'object') { var sectionKeys = Object.keys(section) for (var ii = 0; ii < sectionKeys.length; ++ii) { var key = sectionKeys[ii] this._status[key] = section[key] } } if (completed != null) { this._status.completed = completed } if (this._disabled) { return } this._requestRedraw() } Gauge.prototype.pulse = function (subsection) { this._status.subsection = subsection || '' this._status.spun++ if (this._disabled) { return } if (!this._showing) { return } this._requestRedraw() } Gauge.prototype._handleSizeChange = function () { this._gauge.setWidth(this._tty.columns - 1) this._requestRedraw() } Gauge.prototype._doRedraw = function () { if (this._disabled || this._paused) { return } if (!this._fixedFramerate) { var now = Date.now() if (this._lastUpdateAt && now - this._lastUpdateAt < this._updateInterval) { return } this._lastUpdateAt = now } if (!this._showing && this._onScreen) { this._onScreen = false var result = this._gauge.hide() if (this._hideCursor) { result += this._gauge.showCursor() } return this._writeTo.write(result) } if (!this._showing && !this._onScreen) { return } if (this._showing && !this._onScreen) { this._onScreen = true this._needsRedraw = true if (this._hideCursor) { this._writeTo.write(this._gauge.hideCursor()) } } if (!this._needsRedraw) { return } if (!this._writeTo.write(this._gauge.show(this._status))) { this._paused = true this._writeTo.on('drain', callWith(this, function () { this._paused = false this._doRedraw() })) } } 'use strict' var consoleControl = require('console-control-strings') var renderTemplate = require('./render-template.js') var validate = require('aproba') var Plumbing = module.exports = function (theme, template, width) { if (!width) { width = 80 } validate('OAN', [theme, template, width]) this.showing = false this.theme = theme this.width = width this.template = template } Plumbing.prototype = {} Plumbing.prototype.setTheme = function (theme) { validate('O', [theme]) this.theme = theme } Plumbing.prototype.setTemplate = function (template) { validate('A', [template]) this.template = template } Plumbing.prototype.setWidth = function (width) { validate('N', [width]) this.width = width } Plumbing.prototype.hide = function () { return consoleControl.gotoSOL() + consoleControl.eraseLine() } Plumbing.prototype.hideCursor = consoleControl.hideCursor Plumbing.prototype.showCursor = consoleControl.showCursor Plumbing.prototype.show = function (status) { var values = Object.create(this.theme) for (var key in status) { values[key] = status[key] } return renderTemplate(this.width, this.template, values).trim() + consoleControl.color('reset') + consoleControl.eraseLine() + consoleControl.gotoSOL() } 'use strict' // this exists so we can replace it during testing module.exports = process 'use strict' var validate = require('aproba') var renderTemplate = require('./render-template.js') var wideTruncate = require('./wide-truncate') var stringWidth = require('string-width') module.exports = function (theme, width, completed) { validate('ONN', [theme, width, completed]) if (completed < 0) { completed = 0 } if (completed > 1) { completed = 1 } if (width <= 0) { return '' } var sofar = Math.round(width * completed) var rest = width - sofar var template = [ { type: 'complete', value: repeat(theme.complete, sofar), length: sofar }, { type: 'remaining', value: repeat(theme.remaining, rest), length: rest }, ] return renderTemplate(width, template, theme) } // lodash's way of repeating function repeat (string, width) { var result = '' var n = width do { if (n % 2) { result += string } n = Math.floor(n / 2) /* eslint no-self-assign: 0 */ string += string } while (n && stringWidth(result) < width) return wideTruncate(result, width) } 'use strict' var align = require('wide-align') var validate = require('aproba') var wideTruncate = require('./wide-truncate') var error = require('./error') var TemplateItem = require('./template-item') function renderValueWithValues (values) { return function (item) { return renderValue(item, values) } } var renderTemplate = module.exports = function (width, template, values) { var items = prepareItems(width, template, values) var rendered = items.map(renderValueWithValues(values)).join('') return align.left(wideTruncate(rendered, width), width) } function preType (item) { var cappedTypeName = item.type[0].toUpperCase() + item.type.slice(1) return 'pre' + cappedTypeName } function postType (item) { var cappedTypeName = item.type[0].toUpperCase() + item.type.slice(1) return 'post' + cappedTypeName } function hasPreOrPost (item, values) { if (!item.type) { return } return values[preType(item)] || values[postType(item)] } function generatePreAndPost (baseItem, parentValues) { var item = Object.assign({}, baseItem) var values = Object.create(parentValues) var template = [] var pre = preType(item) var post = postType(item) if (values[pre]) { template.push({ value: values[pre] }) values[pre] = null } item.minLength = null item.length = null item.maxLength = null template.push(item) values[item.type] = values[item.type] if (values[post]) { template.push({ value: values[post] }) values[post] = null } return function ($1, $2, length) { return renderTemplate(length, template, values) } } function prepareItems (width, template, values) { function cloneAndObjectify (item, index, arr) { var cloned = new TemplateItem(item, width) var type = cloned.type if (cloned.value == null) { if (!(type in values)) { if (cloned.default == null) { throw new error.MissingTemplateValue(cloned, values) } else { cloned.value = cloned.default } } else { cloned.value = values[type] } } if (cloned.value == null || cloned.value === '') { return null } cloned.index = index cloned.first = index === 0 cloned.last = index === arr.length - 1 if (hasPreOrPost(cloned, values)) { cloned.value = generatePreAndPost(cloned, values) } return cloned } var output = template.map(cloneAndObjectify).filter(function (item) { return item != null }) var remainingSpace = width var variableCount = output.length function consumeSpace (length) { if (length > remainingSpace) { length = remainingSpace } remainingSpace -= length } function finishSizing (item, length) { if (item.finished) { throw new error.Internal('Tried to finish template item that was already finished') } if (length === Infinity) { throw new error.Internal('Length of template item cannot be infinity') } if (length != null) { item.length = length } item.minLength = null item.maxLength = null --variableCount item.finished = true if (item.length == null) { item.length = item.getBaseLength() } if (item.length == null) { throw new error.Internal('Finished template items must have a length') } consumeSpace(item.getLength()) } output.forEach(function (item) { if (!item.kerning) { return } var prevPadRight = item.first ? 0 : output[item.index - 1].padRight if (!item.first && prevPadRight < item.kerning) { item.padLeft = item.kerning - prevPadRight } if (!item.last) { item.padRight = item.kerning } }) // Finish any that have a fixed (literal or intuited) length output.forEach(function (item) { if (item.getBaseLength() == null) { return } finishSizing(item) }) var resized = 0 var resizing var hunkSize do { resizing = false hunkSize = Math.round(remainingSpace / variableCount) output.forEach(function (item) { if (item.finished) { return } if (!item.maxLength) { return } if (item.getMaxLength() < hunkSize) { finishSizing(item, item.maxLength) resizing = true } }) } while (resizing && resized++ < output.length) if (resizing) { throw new error.Internal('Resize loop iterated too many times while determining maxLength') } resized = 0 do { resizing = false hunkSize = Math.round(remainingSpace / variableCount) output.forEach(function (item) { if (item.finished) { return } if (!item.minLength) { return } if (item.getMinLength() >= hunkSize) { finishSizing(item, item.minLength) resizing = true } }) } while (resizing && resized++ < output.length) if (resizing) { throw new error.Internal('Resize loop iterated too many times while determining minLength') } hunkSize = Math.round(remainingSpace / variableCount) output.forEach(function (item) { if (item.finished) { return } finishSizing(item, hunkSize) }) return output } function renderFunction (item, values, length) { validate('OON', arguments) if (item.type) { return item.value(values, values[item.type + 'Theme'] || {}, length) } else { return item.value(values, {}, length) } } function renderValue (item, values) { var length = item.getBaseLength() var value = typeof item.value === 'function' ? renderFunction(item, values, length) : item.value if (value == null || value === '') { return '' } var alignWith = align[item.align] || align.left var leftPadding = item.padLeft ? align.left('', item.padLeft) : '' var rightPadding = item.padRight ? align.right('', item.padRight) : '' var truncated = wideTruncate(String(value), length) var aligned = alignWith(truncated, length) return leftPadding + aligned + rightPadding } 'use strict' var process = require('./process') try { module.exports = setImmediate } catch (ex) { module.exports = process.nextTick } 'use strict' // this exists so we can replace it during testing module.exports = setInterval 'use strict' module.exports = function spin (spinstr, spun) { return spinstr[spun % spinstr.length] } 'use strict' var stringWidth = require('string-width') module.exports = TemplateItem function isPercent (num) { if (typeof num !== 'string') { return false } return num.slice(-1) === '%' } function percent (num) { return Number(num.slice(0, -1)) / 100 } function TemplateItem (values, outputLength) { this.overallOutputLength = outputLength this.finished = false this.type = null this.value = null this.length = null this.maxLength = null this.minLength = null this.kerning = null this.align = 'left' this.padLeft = 0 this.padRight = 0 this.index = null this.first = null this.last = null if (typeof values === 'string') { this.value = values } else { for (var prop in values) { this[prop] = values[prop] } } // Realize percents if (isPercent(this.length)) { this.length = Math.round(this.overallOutputLength * percent(this.length)) } if (isPercent(this.minLength)) { this.minLength = Math.round(this.overallOutputLength * percent(this.minLength)) } if (isPercent(this.maxLength)) { this.maxLength = Math.round(this.overallOutputLength * percent(this.maxLength)) } return this } TemplateItem.prototype = {} TemplateItem.prototype.getBaseLength = function () { var length = this.length if ( length == null && typeof this.value === 'string' && this.maxLength == null && this.minLength == null ) { length = stringWidth(this.value) } return length } TemplateItem.prototype.getLength = function () { var length = this.getBaseLength() if (length == null) { return null } return length + this.padLeft + this.padRight } TemplateItem.prototype.getMaxLength = function () { if (this.maxLength == null) { return null } return this.maxLength + this.padLeft + this.padRight } TemplateItem.prototype.getMinLength = function () { if (this.minLength == null) { return null } return this.minLength + this.padLeft + this.padRight } 'use strict' module.exports = function () { return ThemeSetProto.newThemeSet() } var ThemeSetProto = {} ThemeSetProto.baseTheme = require('./base-theme.js') ThemeSetProto.newTheme = function (parent, theme) { if (!theme) { theme = parent parent = this.baseTheme } return Object.assign({}, parent, theme) } ThemeSetProto.getThemeNames = function () { return Object.keys(this.themes) } ThemeSetProto.addTheme = function (name, parent, theme) { this.themes[name] = this.newTheme(parent, theme) } ThemeSetProto.addToAllThemes = function (theme) { var themes = this.themes Object.keys(themes).forEach(function (name) { Object.assign(themes[name], theme) }) Object.assign(this.baseTheme, theme) } ThemeSetProto.getTheme = function (name) { if (!this.themes[name]) { throw this.newMissingThemeError(name) } return this.themes[name] } ThemeSetProto.setDefault = function (opts, name) { if (name == null) { name = opts opts = {} } var platform = opts.platform == null ? 'fallback' : opts.platform var hasUnicode = !!opts.hasUnicode var hasColor = !!opts.hasColor if (!this.defaults[platform]) { this.defaults[platform] = { true: {}, false: {} } } this.defaults[platform][hasUnicode][hasColor] = name } ThemeSetProto.getDefault = function (opts) { if (!opts) { opts = {} } var platformName = opts.platform || process.platform var platform = this.defaults[platformName] || this.defaults.fallback var hasUnicode = !!opts.hasUnicode var hasColor = !!opts.hasColor if (!platform) { throw this.newMissingDefaultThemeError(platformName, hasUnicode, hasColor) } if (!platform[hasUnicode][hasColor]) { if (hasUnicode && hasColor && platform[!hasUnicode][hasColor]) { hasUnicode = false } else if (hasUnicode && hasColor && platform[hasUnicode][!hasColor]) { hasColor = false } else if (hasUnicode && hasColor && platform[!hasUnicode][!hasColor]) { hasUnicode = false hasColor = false } else if (hasUnicode && !hasColor && platform[!hasUnicode][hasColor]) { hasUnicode = false } else if (!hasUnicode && hasColor && platform[hasUnicode][!hasColor]) { hasColor = false } else if (platform === this.defaults.fallback) { throw this.newMissingDefaultThemeError(platformName, hasUnicode, hasColor) } } if (platform[hasUnicode][hasColor]) { return this.getTheme(platform[hasUnicode][hasColor]) } else { return this.getDefault(Object.assign({}, opts, { platform: 'fallback' })) } } ThemeSetProto.newMissingThemeError = function newMissingThemeError (name) { var err = new Error('Could not find a gauge theme named "' + name + '"') Error.captureStackTrace.call(err, newMissingThemeError) err.theme = name err.code = 'EMISSINGTHEME' return err } ThemeSetProto.newMissingDefaultThemeError = function newMissingDefaultThemeError (platformName, hasUnicode, hasColor) { var err = new Error( 'Could not find a gauge theme for your platform/unicode/color use combo:\n' + ' platform = ' + platformName + '\n' + ' hasUnicode = ' + hasUnicode + '\n' + ' hasColor = ' + hasColor) Error.captureStackTrace.call(err, newMissingDefaultThemeError) err.platform = platformName err.hasUnicode = hasUnicode err.hasColor = hasColor err.code = 'EMISSINGTHEME' return err } ThemeSetProto.newThemeSet = function () { var themeset = function (opts) { return themeset.getDefault(opts) } return Object.assign(themeset, ThemeSetProto, { themes: Object.assign({}, this.themes), baseTheme: Object.assign({}, this.baseTheme), defaults: JSON.parse(JSON.stringify(this.defaults || {})), }) } 'use strict' var color = require('console-control-strings').color var ThemeSet = require('./theme-set.js') var themes = module.exports = new ThemeSet() themes.addTheme('ASCII', { preProgressbar: '[', postProgressbar: ']', progressbarTheme: { complete: '#', remaining: '.', }, activityIndicatorTheme: '-\\|/', preSubsection: '>', }) themes.addTheme('colorASCII', themes.getTheme('ASCII'), { progressbarTheme: { preComplete: color('bgBrightWhite', 'brightWhite'), complete: '#', postComplete: color('reset'), preRemaining: color('bgBrightBlack', 'brightBlack'), remaining: '.', postRemaining: color('reset'), }, }) themes.addTheme('brailleSpinner', { preProgressbar: '(', postProgressbar: ')', progressbarTheme: { complete: '#', remaining: '⠂', }, activityIndicatorTheme: '⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏', preSubsection: '>', }) themes.addTheme('colorBrailleSpinner', themes.getTheme('brailleSpinner'), { progressbarTheme: { preComplete: color('bgBrightWhite', 'brightWhite'), complete: '#', postComplete: color('reset'), preRemaining: color('bgBrightBlack', 'brightBlack'), remaining: '⠂', postRemaining: color('reset'), }, }) themes.setDefault({}, 'ASCII') themes.setDefault({ hasColor: true }, 'colorASCII') themes.setDefault({ platform: 'darwin', hasUnicode: true }, 'brailleSpinner') themes.setDefault({ platform: 'darwin', hasUnicode: true, hasColor: true }, 'colorBrailleSpinner') themes.setDefault({ platform: 'linux', hasUnicode: true }, 'brailleSpinner') themes.setDefault({ platform: 'linux', hasUnicode: true, hasColor: true }, 'colorBrailleSpinner') 'use strict' var stringWidth = require('string-width') var stripAnsi = require('strip-ansi') module.exports = wideTruncate function wideTruncate (str, target) { if (stringWidth(str) === 0) { return str } if (target <= 0) { return '' } if (stringWidth(str) <= target) { return str } // We compute the number of bytes of ansi sequences here and add // that to our initial truncation to ensure that we don't slice one // that we want to keep in half. var noAnsi = stripAnsi(str) var ansiSize = str.length + noAnsi.length var truncated = str.slice(0, target + ansiSize) // we have to shrink the result to account for our ansi sequence buffer // (if an ansi sequence was truncated) and double width characters. while (stringWidth(truncated) > target) { truncated = truncated.slice(0, -1) } return truncated } 'use strict'; module.exports = ({onlyFirst = false} = {}) => { const pattern = [ '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' ].join('|'); return new RegExp(pattern, onlyFirst ? undefined : 'g'); }; MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "ansi-regex", "version": "5.0.1", "description": "Regular expression for matching ANSI escape codes", "license": "MIT", "repository": "chalk/ansi-regex", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=8" }, "scripts": { "test": "xo && ava && tsd", "view-supported": "node fixtures/view-codes.js" }, "files": [ "index.js", "index.d.ts" ], "keywords": [ "ansi", "styles", "color", "colour", "colors", "terminal", "console", "cli", "string", "tty", "escape", "formatting", "rgb", "256", "shell", "xterm", "command-line", "text", "regex", "regexp", "re", "match", "test", "find", "pattern" ], "devDependencies": { "ava": "^2.4.0", "tsd": "^0.9.0", "xo": "^0.25.3" } } 'use strict' module.exports = validate function isArguments (thingy) { return thingy != null && typeof thingy === 'object' && thingy.hasOwnProperty('callee') } const types = { '*': {label: 'any', check: () => true}, A: {label: 'array', check: _ => Array.isArray(_) || isArguments(_)}, S: {label: 'string', check: _ => typeof _ === 'string'}, N: {label: 'number', check: _ => typeof _ === 'number'}, F: {label: 'function', check: _ => typeof _ === 'function'}, O: {label: 'object', check: _ => typeof _ === 'object' && _ != null && !types.A.check(_) && !types.E.check(_)}, B: {label: 'boolean', check: _ => typeof _ === 'boolean'}, E: {label: 'error', check: _ => _ instanceof Error}, Z: {label: 'null', check: _ => _ == null} } function addSchema (schema, arity) { const group = arity[schema.length] = arity[schema.length] || [] if (group.indexOf(schema) === -1) group.push(schema) } function validate (rawSchemas, args) { if (arguments.length !== 2) throw wrongNumberOfArgs(['SA'], arguments.length) if (!rawSchemas) throw missingRequiredArg(0, 'rawSchemas') if (!args) throw missingRequiredArg(1, 'args') if (!types.S.check(rawSchemas)) throw invalidType(0, ['string'], rawSchemas) if (!types.A.check(args)) throw invalidType(1, ['array'], args) const schemas = rawSchemas.split('|') const arity = {} schemas.forEach(schema => { for (let ii = 0; ii < schema.length; ++ii) { const type = schema[ii] if (!types[type]) throw unknownType(ii, type) } if (/E.*E/.test(schema)) throw moreThanOneError(schema) addSchema(schema, arity) if (/E/.test(schema)) { addSchema(schema.replace(/E.*$/, 'E'), arity) addSchema(schema.replace(/E/, 'Z'), arity) if (schema.length === 1) addSchema('', arity) } }) let matching = arity[args.length] if (!matching) { throw wrongNumberOfArgs(Object.keys(arity), args.length) } for (let ii = 0; ii < args.length; ++ii) { let newMatching = matching.filter(schema => { const type = schema[ii] const typeCheck = types[type].check return typeCheck(args[ii]) }) if (!newMatching.length) { const labels = matching.map(_ => types[_[ii]].label).filter(_ => _ != null) throw invalidType(ii, labels, args[ii]) } matching = newMatching } } function missingRequiredArg (num) { return newException('EMISSINGARG', 'Missing required argument #' + (num + 1)) } function unknownType (num, type) { return newException('EUNKNOWNTYPE', 'Unknown type ' + type + ' in argument #' + (num + 1)) } function invalidType (num, expectedTypes, value) { let valueType Object.keys(types).forEach(typeCode => { if (types[typeCode].check(value)) valueType = types[typeCode].label }) return newException('EINVALIDTYPE', 'Argument #' + (num + 1) + ': Expected ' + englishList(expectedTypes) + ' but got ' + valueType) } function englishList (list) { return list.join(', ').replace(/, ([^,]+)$/, ' or $1') } function wrongNumberOfArgs (expected, got) { const english = englishList(expected) const args = expected.every(ex => ex.length === 1) ? 'argument' : 'arguments' return newException('EWRONGARGCOUNT', 'Expected ' + english + ' ' + args + ' but got ' + got) } function moreThanOneError (schema) { return newException('ETOOMANYERRORTYPES', 'Only one error type per argument signature is allowed, more than one found in "' + schema + '"') } function newException (code, msg) { const err = new Error(msg) err.code = code /* istanbul ignore else */ if (Error.captureStackTrace) Error.captureStackTrace(err, validate) return err } Copyright (c) 2015, Rebecca Turner Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "aproba", "version": "2.0.0", "description": "A ridiculously light-weight argument validator (now browser friendly)", "main": "index.js", "directories": { "test": "test" }, "dependencies": {}, "devDependencies": { "standard": "^11.0.1", "tap": "^12.0.1" }, "files": [ "index.js" ], "scripts": { "pretest": "standard", "test": "tap --100 -J test/*.js" }, "repository": { "type": "git", "url": "https://github.com/iarna/aproba" }, "keywords": [ "argument", "validate" ], "author": "Rebecca Turner ", "license": "ISC", "bugs": { "url": "https://github.com/iarna/aproba/issues" }, "homepage": "https://github.com/iarna/aproba" } // Note: since nyc uses this module to output coverage, any lines // that are in the direct sync flow of nyc's outputCoverage are // ignored, since we can never get coverage for them. // grab a reference to node's real process object right away var process = global.process const processOk = function (process) { return process && typeof process === 'object' && typeof process.removeListener === 'function' && typeof process.emit === 'function' && typeof process.reallyExit === 'function' && typeof process.listeners === 'function' && typeof process.kill === 'function' && typeof process.pid === 'number' && typeof process.on === 'function' } // some kind of non-node environment, just no-op /* istanbul ignore if */ if (!processOk(process)) { module.exports = function () { return function () {} } } else { var assert = require('assert') var signals = require('./signals.js') var isWin = /^win/i.test(process.platform) var EE = require('events') /* istanbul ignore if */ if (typeof EE !== 'function') { EE = EE.EventEmitter } var emitter if (process.__signal_exit_emitter__) { emitter = process.__signal_exit_emitter__ } else { emitter = process.__signal_exit_emitter__ = new EE() emitter.count = 0 emitter.emitted = {} } // Because this emitter is a global, we have to check to see if a // previous version of this library failed to enable infinite listeners. // I know what you're about to say. But literally everything about // signal-exit is a compromise with evil. Get used to it. if (!emitter.infinite) { emitter.setMaxListeners(Infinity) emitter.infinite = true } module.exports = function (cb, opts) { /* istanbul ignore if */ if (!processOk(global.process)) { return function () {} } assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler') if (loaded === false) { load() } var ev = 'exit' if (opts && opts.alwaysLast) { ev = 'afterexit' } var remove = function () { emitter.removeListener(ev, cb) if (emitter.listeners('exit').length === 0 && emitter.listeners('afterexit').length === 0) { unload() } } emitter.on(ev, cb) return remove } var unload = function unload () { if (!loaded || !processOk(global.process)) { return } loaded = false signals.forEach(function (sig) { try { process.removeListener(sig, sigListeners[sig]) } catch (er) {} }) process.emit = originalProcessEmit process.reallyExit = originalProcessReallyExit emitter.count -= 1 } module.exports.unload = unload var emit = function emit (event, code, signal) { /* istanbul ignore if */ if (emitter.emitted[event]) { return } emitter.emitted[event] = true emitter.emit(event, code, signal) } // { : , ... } var sigListeners = {} signals.forEach(function (sig) { sigListeners[sig] = function listener () { /* istanbul ignore if */ if (!processOk(global.process)) { return } // If there are no other listeners, an exit is coming! // Simplest way: remove us and then re-send the signal. // We know that this will kill the process, so we can // safely emit now. var listeners = process.listeners(sig) if (listeners.length === emitter.count) { unload() emit('exit', null, sig) /* istanbul ignore next */ emit('afterexit', null, sig) /* istanbul ignore next */ if (isWin && sig === 'SIGHUP') { // "SIGHUP" throws an `ENOSYS` error on Windows, // so use a supported signal instead sig = 'SIGINT' } /* istanbul ignore next */ process.kill(process.pid, sig) } } }) module.exports.signals = function () { return signals } var loaded = false var load = function load () { if (loaded || !processOk(global.process)) { return } loaded = true // This is the number of onSignalExit's that are in play. // It's important so that we can count the correct number of // listeners on signals, and don't wait for the other one to // handle it instead of us. emitter.count += 1 signals = signals.filter(function (sig) { try { process.on(sig, sigListeners[sig]) return true } catch (er) { return false } }) process.emit = processEmit process.reallyExit = processReallyExit } module.exports.load = load var originalProcessReallyExit = process.reallyExit var processReallyExit = function processReallyExit (code) { /* istanbul ignore if */ if (!processOk(global.process)) { return } process.exitCode = code || /* istanbul ignore next */ 0 emit('exit', process.exitCode, null) /* istanbul ignore next */ emit('afterexit', process.exitCode, null) /* istanbul ignore next */ originalProcessReallyExit.call(process, process.exitCode) } var originalProcessEmit = process.emit var processEmit = function processEmit (ev, arg) { if (ev === 'exit' && processOk(global.process)) { /* istanbul ignore else */ if (arg !== undefined) { process.exitCode = arg } var ret = originalProcessEmit.apply(this, arguments) /* istanbul ignore next */ emit('exit', process.exitCode, null) /* istanbul ignore next */ emit('afterexit', process.exitCode, null) /* istanbul ignore next */ return ret } else { return originalProcessEmit.apply(this, arguments) } } } The ISC License Copyright (c) 2015, Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "signal-exit", "version": "3.0.7", "description": "when you want to fire an event no matter how a process exits.", "main": "index.js", "scripts": { "test": "tap", "snap": "tap", "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags" }, "files": [ "index.js", "signals.js" ], "repository": { "type": "git", "url": "https://github.com/tapjs/signal-exit.git" }, "keywords": [ "signal", "exit" ], "author": "Ben Coe ", "license": "ISC", "bugs": { "url": "https://github.com/tapjs/signal-exit/issues" }, "homepage": "https://github.com/tapjs/signal-exit", "devDependencies": { "chai": "^3.5.0", "coveralls": "^3.1.1", "nyc": "^15.1.0", "standard-version": "^9.3.1", "tap": "^15.1.1" } } // This is not the set of all possible signals. // // It IS, however, the set of all signals that trigger // an exit on either Linux or BSD systems. Linux is a // superset of the signal names supported on BSD, and // the unknown signals just fail to register, so we can // catch that easily enough. // // Don't bother with SIGKILL. It's uncatchable, which // means that we can't fire any callbacks anyway. // // If a user does happen to register a handler on a non- // fatal signal like SIGWINCH or something, and then // exit, it'll end up firing `process.emit('exit')`, so // the handler will be fired anyway. // // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised // artificially, inherently leave the process in a // state from which it is not safe to try and enter JS // listeners. module.exports = [ 'SIGABRT', 'SIGALRM', 'SIGHUP', 'SIGINT', 'SIGTERM' ] if (process.platform !== 'win32') { module.exports.push( 'SIGVTALRM', 'SIGXCPU', 'SIGXFSZ', 'SIGUSR2', 'SIGTRAP', 'SIGSYS', 'SIGQUIT', 'SIGIOT' // should detect profiler and enable/disable accordingly. // see #21 // 'SIGPROF' ) } if (process.platform === 'linux') { module.exports.push( 'SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT', 'SIGUNUSED' ) } /* eslint-disable yoda */ 'use strict'; const isFullwidthCodePoint = codePoint => { if (Number.isNaN(codePoint)) { return false; } // Code points are derived from: // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt if ( codePoint >= 0x1100 && ( codePoint <= 0x115F || // Hangul Jamo codePoint === 0x2329 || // LEFT-POINTING ANGLE BRACKET codePoint === 0x232A || // RIGHT-POINTING ANGLE BRACKET // CJK Radicals Supplement .. Enclosed CJK Letters and Months (0x2E80 <= codePoint && codePoint <= 0x3247 && codePoint !== 0x303F) || // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A (0x3250 <= codePoint && codePoint <= 0x4DBF) || // CJK Unified Ideographs .. Yi Radicals (0x4E00 <= codePoint && codePoint <= 0xA4C6) || // Hangul Jamo Extended-A (0xA960 <= codePoint && codePoint <= 0xA97C) || // Hangul Syllables (0xAC00 <= codePoint && codePoint <= 0xD7A3) || // CJK Compatibility Ideographs (0xF900 <= codePoint && codePoint <= 0xFAFF) || // Vertical Forms (0xFE10 <= codePoint && codePoint <= 0xFE19) || // CJK Compatibility Forms .. Small Form Variants (0xFE30 <= codePoint && codePoint <= 0xFE6B) || // Halfwidth and Fullwidth Forms (0xFF01 <= codePoint && codePoint <= 0xFF60) || (0xFFE0 <= codePoint && codePoint <= 0xFFE6) || // Kana Supplement (0x1B000 <= codePoint && codePoint <= 0x1B001) || // Enclosed Ideographic Supplement (0x1F200 <= codePoint && codePoint <= 0x1F251) || // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane (0x20000 <= codePoint && codePoint <= 0x3FFFD) ) ) { return true; } return false; }; module.exports = isFullwidthCodePoint; module.exports.default = isFullwidthCodePoint; MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "is-fullwidth-code-point", "version": "3.0.0", "description": "Check if the character represented by a given Unicode code point is fullwidth", "license": "MIT", "repository": "sindresorhus/is-fullwidth-code-point", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=8" }, "scripts": { "test": "xo && ava && tsd-check" }, "files": [ "index.js", "index.d.ts" ], "keywords": [ "fullwidth", "full-width", "full", "width", "unicode", "character", "string", "codepoint", "code", "point", "is", "detect", "check" ], "devDependencies": { "ava": "^1.3.1", "tsd-check": "^0.5.0", "xo": "^0.24.0" } } 'use strict'; const stripAnsi = require('strip-ansi'); const isFullwidthCodePoint = require('is-fullwidth-code-point'); const emojiRegex = require('emoji-regex'); const stringWidth = string => { if (typeof string !== 'string' || string.length === 0) { return 0; } string = stripAnsi(string); if (string.length === 0) { return 0; } string = string.replace(emojiRegex(), ' '); let width = 0; for (let i = 0; i < string.length; i++) { const code = string.codePointAt(i); // Ignore control characters if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) { continue; } // Ignore combining characters if (code >= 0x300 && code <= 0x36F) { continue; } // Surrogates if (code > 0xFFFF) { i++; } width += isFullwidthCodePoint(code) ? 2 : 1; } return width; }; module.exports = stringWidth; // TODO: remove this in the next major version module.exports.default = stringWidth; MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "string-width", "version": "4.2.3", "description": "Get the visual width of a string - the number of columns required to display it", "license": "MIT", "repository": "sindresorhus/string-width", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=8" }, "scripts": { "test": "xo && ava && tsd" }, "files": [ "index.js", "index.d.ts" ], "keywords": [ "string", "character", "unicode", "width", "visual", "column", "columns", "fullwidth", "full-width", "full", "ansi", "escape", "codes", "cli", "command-line", "terminal", "console", "cjk", "chinese", "japanese", "korean", "fixed-width" ], "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" }, "devDependencies": { "ava": "^1.4.1", "tsd": "^0.7.1", "xo": "^0.24.0" } } 'use strict'; const ansiRegex = require('ansi-regex'); module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "strip-ansi", "version": "6.0.1", "description": "Strip ANSI escape codes from a string", "license": "MIT", "repository": "chalk/strip-ansi", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=8" }, "scripts": { "test": "xo && ava && tsd" }, "files": [ "index.js", "index.d.ts" ], "keywords": [ "strip", "trim", "remove", "ansi", "styles", "color", "colour", "colors", "terminal", "console", "string", "tty", "escape", "formatting", "rgb", "256", "shell", "xterm", "log", "logging", "command-line", "text" ], "dependencies": { "ansi-regex": "^5.0.1" }, "devDependencies": { "ava": "^2.4.0", "tsd": "^0.10.0", "xo": "^0.25.3" } } 'use strict' var stringWidth = require('string-width') exports.center = alignCenter exports.left = alignLeft exports.right = alignRight // lodash's way of generating pad characters. function createPadding (width) { var result = '' var string = ' ' var n = width do { if (n % 2) { result += string; } n = Math.floor(n / 2); string += string; } while (n); return result; } function alignLeft (str, width) { var trimmed = str.trimRight() if (trimmed.length === 0 && str.length >= width) return str var padding = '' var strWidth = stringWidth(trimmed) if (strWidth < width) { padding = createPadding(width - strWidth) } return trimmed + padding } function alignRight (str, width) { var trimmed = str.trimLeft() if (trimmed.length === 0 && str.length >= width) return str var padding = '' var strWidth = stringWidth(trimmed) if (strWidth < width) { padding = createPadding(width - strWidth) } return padding + trimmed } function alignCenter (str, width) { var trimmed = str.trim() if (trimmed.length === 0 && str.length >= width) return str var padLeft = '' var padRight = '' var strWidth = stringWidth(trimmed) if (strWidth < width) { var padLeftBy = parseInt((width - strWidth) / 2, 10) padLeft = createPadding(padLeftBy) padRight = createPadding(width - (strWidth + padLeftBy)) } return padLeft + trimmed + padRight } Copyright (c) 2015, Rebecca Turner Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "wide-align", "version": "1.1.5", "description": "A wide-character aware text alignment function for use on the console or with fixed width fonts.", "main": "align.js", "scripts": { "test": "tap --coverage test/*.js" }, "keywords": [ "wide", "double", "unicode", "cjkv", "pad", "align" ], "author": "Rebecca Turner (http://re-becca.org/)", "license": "ISC", "repository": { "type": "git", "url": "https://github.com/iarna/wide-align" }, "//": "But not version 5 of string-width, as that's ESM only", "dependencies": { "string-width": "^1.0.2 || 2 || 3 || 4" }, "devDependencies": { "tap": "*" }, "files": [ "align.js" ] } 'use strict'; // rfc7231 6.1 const statusCodeCacheableByDefault = new Set([ 200, 203, 204, 206, 300, 301, 404, 405, 410, 414, 501, ]); // This implementation does not understand partial responses (206) const understoodStatuses = new Set([ 200, 203, 204, 300, 301, 302, 303, 307, 308, 404, 405, 410, 414, 501, ]); const errorStatusCodes = new Set([ 500, 502, 503, 504, ]); const hopByHopHeaders = { date: true, // included, because we add Age update Date connection: true, 'keep-alive': true, 'proxy-authenticate': true, 'proxy-authorization': true, te: true, trailer: true, 'transfer-encoding': true, upgrade: true, }; const excludedFromRevalidationUpdate = { // Since the old body is reused, it doesn't make sense to change properties of the body 'content-length': true, 'content-encoding': true, 'transfer-encoding': true, 'content-range': true, }; function toNumberOrZero(s) { const n = parseInt(s, 10); return isFinite(n) ? n : 0; } // RFC 5861 function isErrorResponse(response) { // consider undefined response as faulty if(!response) { return true } return errorStatusCodes.has(response.status); } function parseCacheControl(header) { const cc = {}; if (!header) return cc; // TODO: When there is more than one value present for a given directive (e.g., two Expires header fields, multiple Cache-Control: max-age directives), // the directive's value is considered invalid. Caches are encouraged to consider responses that have invalid freshness information to be stale const parts = header.trim().split(/\s*,\s*/); // TODO: lame parsing for (const part of parts) { const [k, v] = part.split(/\s*=\s*/, 2); cc[k] = v === undefined ? true : v.replace(/^"|"$/g, ''); // TODO: lame unquoting } return cc; } function formatCacheControl(cc) { let parts = []; for (const k in cc) { const v = cc[k]; parts.push(v === true ? k : k + '=' + v); } if (!parts.length) { return undefined; } return parts.join(', '); } module.exports = class CachePolicy { constructor( req, res, { shared, cacheHeuristic, immutableMinTimeToLive, ignoreCargoCult, _fromObject, } = {} ) { if (_fromObject) { this._fromObject(_fromObject); return; } if (!res || !res.headers) { throw Error('Response headers missing'); } this._assertRequestHasHeaders(req); this._responseTime = this.now(); this._isShared = shared !== false; this._cacheHeuristic = undefined !== cacheHeuristic ? cacheHeuristic : 0.1; // 10% matches IE this._immutableMinTtl = undefined !== immutableMinTimeToLive ? immutableMinTimeToLive : 24 * 3600 * 1000; this._status = 'status' in res ? res.status : 200; this._resHeaders = res.headers; this._rescc = parseCacheControl(res.headers['cache-control']); this._method = 'method' in req ? req.method : 'GET'; this._url = req.url; this._host = req.headers.host; this._noAuthorization = !req.headers.authorization; this._reqHeaders = res.headers.vary ? req.headers : null; // Don't keep all request headers if they won't be used this._reqcc = parseCacheControl(req.headers['cache-control']); // Assume that if someone uses legacy, non-standard uncecessary options they don't understand caching, // so there's no point stricly adhering to the blindly copy&pasted directives. if ( ignoreCargoCult && 'pre-check' in this._rescc && 'post-check' in this._rescc ) { delete this._rescc['pre-check']; delete this._rescc['post-check']; delete this._rescc['no-cache']; delete this._rescc['no-store']; delete this._rescc['must-revalidate']; this._resHeaders = Object.assign({}, this._resHeaders, { 'cache-control': formatCacheControl(this._rescc), }); delete this._resHeaders.expires; delete this._resHeaders.pragma; } // When the Cache-Control header field is not present in a request, caches MUST consider the no-cache request pragma-directive // as having the same effect as if "Cache-Control: no-cache" were present (see Section 5.2.1). if ( res.headers['cache-control'] == null && /no-cache/.test(res.headers.pragma) ) { this._rescc['no-cache'] = true; } } now() { return Date.now(); } storable() { // The "no-store" request directive indicates that a cache MUST NOT store any part of either this request or any response to it. return !!( !this._reqcc['no-store'] && // A cache MUST NOT store a response to any request, unless: // The request method is understood by the cache and defined as being cacheable, and ('GET' === this._method || 'HEAD' === this._method || ('POST' === this._method && this._hasExplicitExpiration())) && // the response status code is understood by the cache, and understoodStatuses.has(this._status) && // the "no-store" cache directive does not appear in request or response header fields, and !this._rescc['no-store'] && // the "private" response directive does not appear in the response, if the cache is shared, and (!this._isShared || !this._rescc.private) && // the Authorization header field does not appear in the request, if the cache is shared, (!this._isShared || this._noAuthorization || this._allowsStoringAuthenticated()) && // the response either: // contains an Expires header field, or (this._resHeaders.expires || // contains a max-age response directive, or // contains a s-maxage response directive and the cache is shared, or // contains a public response directive. this._rescc['max-age'] || (this._isShared && this._rescc['s-maxage']) || this._rescc.public || // has a status code that is defined as cacheable by default statusCodeCacheableByDefault.has(this._status)) ); } _hasExplicitExpiration() { // 4.2.1 Calculating Freshness Lifetime return ( (this._isShared && this._rescc['s-maxage']) || this._rescc['max-age'] || this._resHeaders.expires ); } _assertRequestHasHeaders(req) { if (!req || !req.headers) { throw Error('Request headers missing'); } } satisfiesWithoutRevalidation(req) { this._assertRequestHasHeaders(req); // When presented with a request, a cache MUST NOT reuse a stored response, unless: // the presented request does not contain the no-cache pragma (Section 5.4), nor the no-cache cache directive, // unless the stored response is successfully validated (Section 4.3), and const requestCC = parseCacheControl(req.headers['cache-control']); if (requestCC['no-cache'] || /no-cache/.test(req.headers.pragma)) { return false; } if (requestCC['max-age'] && this.age() > requestCC['max-age']) { return false; } if ( requestCC['min-fresh'] && this.timeToLive() < 1000 * requestCC['min-fresh'] ) { return false; } // the stored response is either: // fresh, or allowed to be served stale if (this.stale()) { const allowsStale = requestCC['max-stale'] && !this._rescc['must-revalidate'] && (true === requestCC['max-stale'] || requestCC['max-stale'] > this.age() - this.maxAge()); if (!allowsStale) { return false; } } return this._requestMatches(req, false); } _requestMatches(req, allowHeadMethod) { // The presented effective request URI and that of the stored response match, and return ( (!this._url || this._url === req.url) && this._host === req.headers.host && // the request method associated with the stored response allows it to be used for the presented request, and (!req.method || this._method === req.method || (allowHeadMethod && 'HEAD' === req.method)) && // selecting header fields nominated by the stored response (if any) match those presented, and this._varyMatches(req) ); } _allowsStoringAuthenticated() { // following Cache-Control response directives (Section 5.2.2) have such an effect: must-revalidate, public, and s-maxage. return ( this._rescc['must-revalidate'] || this._rescc.public || this._rescc['s-maxage'] ); } _varyMatches(req) { if (!this._resHeaders.vary) { return true; } // A Vary header field-value of "*" always fails to match if (this._resHeaders.vary === '*') { return false; } const fields = this._resHeaders.vary .trim() .toLowerCase() .split(/\s*,\s*/); for (const name of fields) { if (req.headers[name] !== this._reqHeaders[name]) return false; } return true; } _copyWithoutHopByHopHeaders(inHeaders) { const headers = {}; for (const name in inHeaders) { if (hopByHopHeaders[name]) continue; headers[name] = inHeaders[name]; } // 9.1. Connection if (inHeaders.connection) { const tokens = inHeaders.connection.trim().split(/\s*,\s*/); for (const name of tokens) { delete headers[name]; } } if (headers.warning) { const warnings = headers.warning.split(/,/).filter(warning => { return !/^\s*1[0-9][0-9]/.test(warning); }); if (!warnings.length) { delete headers.warning; } else { headers.warning = warnings.join(',').trim(); } } return headers; } responseHeaders() { const headers = this._copyWithoutHopByHopHeaders(this._resHeaders); const age = this.age(); // A cache SHOULD generate 113 warning if it heuristically chose a freshness // lifetime greater than 24 hours and the response's age is greater than 24 hours. if ( age > 3600 * 24 && !this._hasExplicitExpiration() && this.maxAge() > 3600 * 24 ) { headers.warning = (headers.warning ? `${headers.warning}, ` : '') + '113 - "rfc7234 5.5.4"'; } headers.age = `${Math.round(age)}`; headers.date = new Date(this.now()).toUTCString(); return headers; } /** * Value of the Date response header or current time if Date was invalid * @return timestamp */ date() { const serverDate = Date.parse(this._resHeaders.date); if (isFinite(serverDate)) { return serverDate; } return this._responseTime; } /** * Value of the Age header, in seconds, updated for the current time. * May be fractional. * * @return Number */ age() { let age = this._ageValue(); const residentTime = (this.now() - this._responseTime) / 1000; return age + residentTime; } _ageValue() { return toNumberOrZero(this._resHeaders.age); } /** * Value of applicable max-age (or heuristic equivalent) in seconds. This counts since response's `Date`. * * For an up-to-date value, see `timeToLive()`. * * @return Number */ maxAge() { if (!this.storable() || this._rescc['no-cache']) { return 0; } // Shared responses with cookies are cacheable according to the RFC, but IMHO it'd be unwise to do so by default // so this implementation requires explicit opt-in via public header if ( this._isShared && (this._resHeaders['set-cookie'] && !this._rescc.public && !this._rescc.immutable) ) { return 0; } if (this._resHeaders.vary === '*') { return 0; } if (this._isShared) { if (this._rescc['proxy-revalidate']) { return 0; } // if a response includes the s-maxage directive, a shared cache recipient MUST ignore the Expires field. if (this._rescc['s-maxage']) { return toNumberOrZero(this._rescc['s-maxage']); } } // If a response includes a Cache-Control field with the max-age directive, a recipient MUST ignore the Expires field. if (this._rescc['max-age']) { return toNumberOrZero(this._rescc['max-age']); } const defaultMinTtl = this._rescc.immutable ? this._immutableMinTtl : 0; const serverDate = this.date(); if (this._resHeaders.expires) { const expires = Date.parse(this._resHeaders.expires); // A cache recipient MUST interpret invalid date formats, especially the value "0", as representing a time in the past (i.e., "already expired"). if (Number.isNaN(expires) || expires < serverDate) { return 0; } return Math.max(defaultMinTtl, (expires - serverDate) / 1000); } if (this._resHeaders['last-modified']) { const lastModified = Date.parse(this._resHeaders['last-modified']); if (isFinite(lastModified) && serverDate > lastModified) { return Math.max( defaultMinTtl, ((serverDate - lastModified) / 1000) * this._cacheHeuristic ); } } return defaultMinTtl; } timeToLive() { const age = this.maxAge() - this.age(); const staleIfErrorAge = age + toNumberOrZero(this._rescc['stale-if-error']); const staleWhileRevalidateAge = age + toNumberOrZero(this._rescc['stale-while-revalidate']); return Math.max(0, age, staleIfErrorAge, staleWhileRevalidateAge) * 1000; } stale() { return this.maxAge() <= this.age(); } _useStaleIfError() { return this.maxAge() + toNumberOrZero(this._rescc['stale-if-error']) > this.age(); } useStaleWhileRevalidate() { return this.maxAge() + toNumberOrZero(this._rescc['stale-while-revalidate']) > this.age(); } static fromObject(obj) { return new this(undefined, undefined, { _fromObject: obj }); } _fromObject(obj) { if (this._responseTime) throw Error('Reinitialized'); if (!obj || obj.v !== 1) throw Error('Invalid serialization'); this._responseTime = obj.t; this._isShared = obj.sh; this._cacheHeuristic = obj.ch; this._immutableMinTtl = obj.imm !== undefined ? obj.imm : 24 * 3600 * 1000; this._status = obj.st; this._resHeaders = obj.resh; this._rescc = obj.rescc; this._method = obj.m; this._url = obj.u; this._host = obj.h; this._noAuthorization = obj.a; this._reqHeaders = obj.reqh; this._reqcc = obj.reqcc; } toObject() { return { v: 1, t: this._responseTime, sh: this._isShared, ch: this._cacheHeuristic, imm: this._immutableMinTtl, st: this._status, resh: this._resHeaders, rescc: this._rescc, m: this._method, u: this._url, h: this._host, a: this._noAuthorization, reqh: this._reqHeaders, reqcc: this._reqcc, }; } /** * Headers for sending to the origin server to revalidate stale response. * Allows server to return 304 to allow reuse of the previous response. * * Hop by hop headers are always stripped. * Revalidation headers may be added or removed, depending on request. */ revalidationHeaders(incomingReq) { this._assertRequestHasHeaders(incomingReq); const headers = this._copyWithoutHopByHopHeaders(incomingReq.headers); // This implementation does not understand range requests delete headers['if-range']; if (!this._requestMatches(incomingReq, true) || !this.storable()) { // revalidation allowed via HEAD // not for the same resource, or wasn't allowed to be cached anyway delete headers['if-none-match']; delete headers['if-modified-since']; return headers; } /* MUST send that entity-tag in any cache validation request (using If-Match or If-None-Match) if an entity-tag has been provided by the origin server. */ if (this._resHeaders.etag) { headers['if-none-match'] = headers['if-none-match'] ? `${headers['if-none-match']}, ${this._resHeaders.etag}` : this._resHeaders.etag; } // Clients MAY issue simple (non-subrange) GET requests with either weak validators or strong validators. Clients MUST NOT use weak validators in other forms of request. const forbidsWeakValidators = headers['accept-ranges'] || headers['if-match'] || headers['if-unmodified-since'] || (this._method && this._method != 'GET'); /* SHOULD send the Last-Modified value in non-subrange cache validation requests (using If-Modified-Since) if only a Last-Modified value has been provided by the origin server. Note: This implementation does not understand partial responses (206) */ if (forbidsWeakValidators) { delete headers['if-modified-since']; if (headers['if-none-match']) { const etags = headers['if-none-match'] .split(/,/) .filter(etag => { return !/^\s*W\//.test(etag); }); if (!etags.length) { delete headers['if-none-match']; } else { headers['if-none-match'] = etags.join(',').trim(); } } } else if ( this._resHeaders['last-modified'] && !headers['if-modified-since'] ) { headers['if-modified-since'] = this._resHeaders['last-modified']; } return headers; } /** * Creates new CachePolicy with information combined from the previews response, * and the new revalidation response. * * Returns {policy, modified} where modified is a boolean indicating * whether the response body has been modified, and old cached body can't be used. * * @return {Object} {policy: CachePolicy, modified: Boolean} */ revalidatedPolicy(request, response) { this._assertRequestHasHeaders(request); if(this._useStaleIfError() && isErrorResponse(response)) { // I consider the revalidation request unsuccessful return { modified: false, matches: false, policy: this, }; } if (!response || !response.headers) { throw Error('Response headers missing'); } // These aren't going to be supported exactly, since one CachePolicy object // doesn't know about all the other cached objects. let matches = false; if (response.status !== undefined && response.status != 304) { matches = false; } else if ( response.headers.etag && !/^\s*W\//.test(response.headers.etag) ) { // "All of the stored responses with the same strong validator are selected. // If none of the stored responses contain the same strong validator, // then the cache MUST NOT use the new response to update any stored responses." matches = this._resHeaders.etag && this._resHeaders.etag.replace(/^\s*W\//, '') === response.headers.etag; } else if (this._resHeaders.etag && response.headers.etag) { // "If the new response contains a weak validator and that validator corresponds // to one of the cache's stored responses, // then the most recent of those matching stored responses is selected for update." matches = this._resHeaders.etag.replace(/^\s*W\//, '') === response.headers.etag.replace(/^\s*W\//, ''); } else if (this._resHeaders['last-modified']) { matches = this._resHeaders['last-modified'] === response.headers['last-modified']; } else { // If the new response does not include any form of validator (such as in the case where // a client generates an If-Modified-Since request from a source other than the Last-Modified // response header field), and there is only one stored response, and that stored response also // lacks a validator, then that stored response is selected for update. if ( !this._resHeaders.etag && !this._resHeaders['last-modified'] && !response.headers.etag && !response.headers['last-modified'] ) { matches = true; } } if (!matches) { return { policy: new this.constructor(request, response), // Client receiving 304 without body, even if it's invalid/mismatched has no option // but to reuse a cached body. We don't have a good way to tell clients to do // error recovery in such case. modified: response.status != 304, matches: false, }; } // use other header fields provided in the 304 (Not Modified) response to replace all instances // of the corresponding header fields in the stored response. const headers = {}; for (const k in this._resHeaders) { headers[k] = k in response.headers && !excludedFromRevalidationUpdate[k] ? response.headers[k] : this._resHeaders[k]; } const newResponse = Object.assign({}, response, { status: this._status, method: this._method, headers, }); return { policy: new this.constructor(request, newResponse, { shared: this._isShared, cacheHeuristic: this._cacheHeuristic, immutableMinTimeToLive: this._immutableMinTtl, }), modified: false, matches: true, }; } }; Copyright 2016-2018 Kornel Lesiński Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. { "name": "http-cache-semantics", "version": "4.1.0", "description": "Parses Cache-Control and other headers. Helps building correct HTTP caches and proxies", "repository": "https://github.com/kornelski/http-cache-semantics.git", "main": "index.js", "scripts": { "test": "mocha" }, "files": [ "index.js" ], "author": "Kornel Lesiński (https://kornel.ski/)", "license": "BSD-2-Clause", "devDependencies": { "eslint": "^5.13.0", "eslint-plugin-prettier": "^3.0.1", "husky": "^0.14.3", "lint-staged": "^8.1.3", "mocha": "^5.1.0", "prettier": "^1.14.3", "prettier-eslint-cli": "^4.7.1" } } var wrappy = require('wrappy') var reqs = Object.create(null) var once = require('once') module.exports = wrappy(inflight) function inflight (key, cb) { if (reqs[key]) { reqs[key].push(cb) return null } else { reqs[key] = [cb] return makeres(key) } } function makeres (key) { return once(function RES () { var cbs = reqs[key] var len = cbs.length var args = slice(arguments) // XXX It's somewhat ambiguous whether a new callback added in this // pass should be queued for later execution if something in the // list of callbacks throws, or if it should just be discarded. // However, it's such an edge case that it hardly matters, and either // choice is likely as surprising as the other. // As it happens, we do go ahead and schedule it for later execution. try { for (var i = 0; i < len; i++) { cbs[i].apply(null, args) } } finally { if (cbs.length > len) { // added more in the interim. // de-zalgo, just in case, but don't call again. cbs.splice(0, len) process.nextTick(function () { RES.apply(null, args) }) } else { delete reqs[key] } } }) } function slice (args) { var length = args.length var array = [] for (var i = 0; i < length; i++) array[i] = args[i] return array } The ISC License Copyright (c) Isaac Z. Schlueter Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "inflight", "version": "1.0.6", "description": "Add callbacks to requests in flight to avoid async duplication", "main": "inflight.js", "files": [ "inflight.js" ], "dependencies": { "once": "^1.3.0", "wrappy": "1" }, "devDependencies": { "tap": "^7.1.2" }, "scripts": { "test": "tap test.js --100" }, "repository": { "type": "git", "url": "https://github.com/npm/inflight.git" }, "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "bugs": { "url": "https://github.com/isaacs/inflight/issues" }, "homepage": "https://github.com/isaacs/inflight", "license": "ISC" } exports.parse = exports.decode = decode exports.stringify = exports.encode = encode exports.safe = safe exports.unsafe = unsafe var eol = typeof process !== 'undefined' && process.platform === 'win32' ? '\r\n' : '\n' function encode (obj, opt) { var children = [] var out = '' if (typeof opt === 'string') { opt = { section: opt, whitespace: false, } } else { opt = opt || {} opt.whitespace = opt.whitespace === true } var separator = opt.whitespace ? ' = ' : '=' Object.keys(obj).forEach(function (k, _, __) { var val = obj[k] if (val && Array.isArray(val)) { val.forEach(function (item) { out += safe(k + '[]') + separator + safe(item) + '\n' }) } else if (val && typeof val === 'object') children.push(k) else out += safe(k) + separator + safe(val) + eol }) if (opt.section && out.length) out = '[' + safe(opt.section) + ']' + eol + out children.forEach(function (k, _, __) { var nk = dotSplit(k).join('\\.') var section = (opt.section ? opt.section + '.' : '') + nk var child = encode(obj[k], { section: section, whitespace: opt.whitespace, }) if (out.length && child.length) out += eol out += child }) return out } function dotSplit (str) { return str.replace(/\1/g, '\u0002LITERAL\\1LITERAL\u0002') .replace(/\\\./g, '\u0001') .split(/\./).map(function (part) { return part.replace(/\1/g, '\\.') .replace(/\2LITERAL\\1LITERAL\2/g, '\u0001') }) } function decode (str) { var out = {} var p = out var section = null // section |key = value var re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i var lines = str.split(/[\r\n]+/g) lines.forEach(function (line, _, __) { if (!line || line.match(/^\s*[;#]/)) return var match = line.match(re) if (!match) return if (match[1] !== undefined) { section = unsafe(match[1]) if (section === '__proto__') { // not allowed // keep parsing the section, but don't attach it. p = {} return } p = out[section] = out[section] || {} return } var key = unsafe(match[2]) if (key === '__proto__') return var value = match[3] ? unsafe(match[4]) : true switch (value) { case 'true': case 'false': case 'null': value = JSON.parse(value) } // Convert keys with '[]' suffix to an array if (key.length > 2 && key.slice(-2) === '[]') { key = key.substring(0, key.length - 2) if (key === '__proto__') return if (!p[key]) p[key] = [] else if (!Array.isArray(p[key])) p[key] = [p[key]] } // safeguard against resetting a previously defined // array by accidentally forgetting the brackets if (Array.isArray(p[key])) p[key].push(value) else p[key] = value }) // {a:{y:1},"a.b":{x:2}} --> {a:{y:1,b:{x:2}}} // use a filter to return the keys that have to be deleted. Object.keys(out).filter(function (k, _, __) { if (!out[k] || typeof out[k] !== 'object' || Array.isArray(out[k])) return false // see if the parent section is also an object. // if so, add it to that, and mark this one for deletion var parts = dotSplit(k) var p = out var l = parts.pop() var nl = l.replace(/\\\./g, '.') parts.forEach(function (part, _, __) { if (part === '__proto__') return if (!p[part] || typeof p[part] !== 'object') p[part] = {} p = p[part] }) if (p === out && nl === l) return false p[nl] = out[k] return true }).forEach(function (del, _, __) { delete out[del] }) return out } function isQuoted (val) { return (val.charAt(0) === '"' && val.slice(-1) === '"') || (val.charAt(0) === "'" && val.slice(-1) === "'") } function safe (val) { return (typeof val !== 'string' || val.match(/[=\r\n]/) || val.match(/^\[/) || (val.length > 1 && isQuoted(val)) || val !== val.trim()) ? JSON.stringify(val) : val.replace(/;/g, '\\;').replace(/#/g, '\\#') } function unsafe (val, doUnesc) { val = (val || '').trim() if (isQuoted(val)) { // remove the single quotes before calling JSON.parse if (val.charAt(0) === "'") val = val.substr(1, val.length - 2) try { val = JSON.parse(val) } catch (_) {} } else { // walk the val to find the first not-escaped ; character var esc = false var unesc = '' for (var i = 0, l = val.length; i < l; i++) { var c = val.charAt(i) if (esc) { if ('\\;#'.indexOf(c) !== -1) unesc += c else unesc += '\\' + c esc = false } else if (';#'.indexOf(c) !== -1) break else if (c === '\\') esc = true else unesc += c } if (esc) unesc += '\\' return unesc.trim() } return val } The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "name": "ini", "description": "An ini encoder/decoder for node", "version": "1.3.8", "repository": { "type": "git", "url": "git://github.com/isaacs/ini.git" }, "main": "ini.js", "scripts": { "eslint": "eslint", "lint": "npm run eslint -- ini.js test/*.js", "lintfix": "npm run lint -- --fix", "test": "tap", "posttest": "npm run lint", "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags" }, "devDependencies": { "eslint": "^7.9.0", "eslint-plugin-import": "^2.22.0", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.2.1", "eslint-plugin-standard": "^4.0.1", "tap": "14" }, "license": "ISC", "files": [ "ini.js" ] } { "name": "ip", "version": "1.1.5", "author": "Fedor Indutny ", "homepage": "https://github.com/indutny/node-ip", "repository": { "type": "git", "url": "http://github.com/indutny/node-ip.git" }, "main": "lib/ip", "devDependencies": { "jscs": "^2.1.1", "jshint": "^2.8.0", "mocha": "~1.3.2" }, "scripts": { "test": "jscs lib/*.js test/*.js && jshint lib/*.js && mocha --reporter spec test/*-test.js", "fix": "jscs lib/*.js test/*.js --fix" }, "license": "MIT" } 'use strict'; var ip = exports; var Buffer = require('buffer').Buffer; var os = require('os'); ip.toBuffer = function(ip, buff, offset) { offset = ~~offset; var result; if (this.isV4Format(ip)) { result = buff || new Buffer(offset + 4); ip.split(/\./g).map(function(byte) { result[offset++] = parseInt(byte, 10) & 0xff; }); } else if (this.isV6Format(ip)) { var sections = ip.split(':', 8); var i; for (i = 0; i < sections.length; i++) { var isv4 = this.isV4Format(sections[i]); var v4Buffer; if (isv4) { v4Buffer = this.toBuffer(sections[i]); sections[i] = v4Buffer.slice(0, 2).toString('hex'); } if (v4Buffer && ++i < 8) { sections.splice(i, 0, v4Buffer.slice(2, 4).toString('hex')); } } if (sections[0] === '') { while (sections.length < 8) sections.unshift('0'); } else if (sections[sections.length - 1] === '') { while (sections.length < 8) sections.push('0'); } else if (sections.length < 8) { for (i = 0; i < sections.length && sections[i] !== ''; i++); var argv = [ i, 1 ]; for (i = 9 - sections.length; i > 0; i--) { argv.push('0'); } sections.splice.apply(sections, argv); } result = buff || new Buffer(offset + 16); for (i = 0; i < sections.length; i++) { var word = parseInt(sections[i], 16); result[offset++] = (word >> 8) & 0xff; result[offset++] = word & 0xff; } } if (!result) { throw Error('Invalid ip address: ' + ip); } return result; }; ip.toString = function(buff, offset, length) { offset = ~~offset; length = length || (buff.length - offset); var result = []; if (length === 4) { // IPv4 for (var i = 0; i < length; i++) { result.push(buff[offset + i]); } result = result.join('.'); } else if (length === 16) { // IPv6 for (var i = 0; i < length; i += 2) { result.push(buff.readUInt16BE(offset + i).toString(16)); } result = result.join(':'); result = result.replace(/(^|:)0(:0)*:0(:|$)/, '$1::$3'); result = result.replace(/:{3,4}/, '::'); } return result; }; var ipv4Regex = /^(\d{1,3}\.){3,3}\d{1,3}$/; var ipv6Regex = /^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i; ip.isV4Format = function(ip) { return ipv4Regex.test(ip); }; ip.isV6Format = function(ip) { return ipv6Regex.test(ip); }; function _normalizeFamily(family) { return family ? family.toLowerCase() : 'ipv4'; } ip.fromPrefixLen = function(prefixlen, family) { if (prefixlen > 32) { family = 'ipv6'; } else { family = _normalizeFamily(family); } var len = 4; if (family === 'ipv6') { len = 16; } var buff = new Buffer(len); for (var i = 0, n = buff.length; i < n; ++i) { var bits = 8; if (prefixlen < 8) { bits = prefixlen; } prefixlen -= bits; buff[i] = ~(0xff >> bits) & 0xff; } return ip.toString(buff); }; ip.mask = function(addr, mask) { addr = ip.toBuffer(addr); mask = ip.toBuffer(mask); var result = new Buffer(Math.max(addr.length, mask.length)); var i = 0; // Same protocol - do bitwise and if (addr.length === mask.length) { for (i = 0; i < addr.length; i++) { result[i] = addr[i] & mask[i]; } } else if (mask.length === 4) { // IPv6 address and IPv4 mask // (Mask low bits) for (i = 0; i < mask.length; i++) { result[i] = addr[addr.length - 4 + i] & mask[i]; } } else { // IPv6 mask and IPv4 addr for (var i = 0; i < result.length - 6; i++) { result[i] = 0; } // ::ffff:ipv4 result[10] = 0xff; result[11] = 0xff; for (i = 0; i < addr.length; i++) { result[i + 12] = addr[i] & mask[i + 12]; } i = i + 12; } for (; i < result.length; i++) result[i] = 0; return ip.toString(result); }; ip.cidr = function(cidrString) { var cidrParts = cidrString.split('/'); var addr = cidrParts[0]; if (cidrParts.length !== 2) throw new Error('invalid CIDR subnet: ' + addr); var mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10)); return ip.mask(addr, mask); }; ip.subnet = function(addr, mask) { var networkAddress = ip.toLong(ip.mask(addr, mask)); // Calculate the mask's length. var maskBuffer = ip.toBuffer(mask); var maskLength = 0; for (var i = 0; i < maskBuffer.length; i++) { if (maskBuffer[i] === 0xff) { maskLength += 8; } else { var octet = maskBuffer[i] & 0xff; while (octet) { octet = (octet << 1) & 0xff; maskLength++; } } } var numberOfAddresses = Math.pow(2, 32 - maskLength); return { networkAddress: ip.fromLong(networkAddress), firstAddress: numberOfAddresses <= 2 ? ip.fromLong(networkAddress) : ip.fromLong(networkAddress + 1), lastAddress: numberOfAddresses <= 2 ? ip.fromLong(networkAddress + numberOfAddresses - 1) : ip.fromLong(networkAddress + numberOfAddresses - 2), broadcastAddress: ip.fromLong(networkAddress + numberOfAddresses - 1), subnetMask: mask, subnetMaskLength: maskLength, numHosts: numberOfAddresses <= 2 ? numberOfAddresses : numberOfAddresses - 2, length: numberOfAddresses, contains: function(other) { return networkAddress === ip.toLong(ip.mask(other, mask)); } }; }; ip.cidrSubnet = function(cidrString) { var cidrParts = cidrString.split('/'); var addr = cidrParts[0]; if (cidrParts.length !== 2) throw new Error('invalid CIDR subnet: ' + addr); var mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10)); return ip.subnet(addr, mask); }; ip.not = function(addr) { var buff = ip.toBuffer(addr); for (var i = 0; i < buff.length; i++) { buff[i] = 0xff ^ buff[i]; } return ip.toString(buff); }; ip.or = function(a, b) { a = ip.toBuffer(a); b = ip.toBuffer(b); // same protocol if (a.length === b.length) { for (var i = 0; i < a.length; ++i) { a[i] |= b[i]; } return ip.toString(a); // mixed protocols } else { var buff = a; var other = b; if (b.length > a.length) { buff = b; other = a; } var offset = buff.length - other.length; for (var i = offset; i < buff.length; ++i) { buff[i] |= other[i - offset]; } return ip.toString(buff); } }; ip.isEqual = function(a, b) { a = ip.toBuffer(a); b = ip.toBuffer(b); // Same protocol if (a.length === b.length) { for (var i = 0; i < a.length; i++) { if (a[i] !== b[i]) return false; } return true; } // Swap if (b.length === 4) { var t = b; b = a; a = t; } // a - IPv4, b - IPv6 for (var i = 0; i < 10; i++) { if (b[i] !== 0) return false; } var word = b.readUInt16BE(10); if (word !== 0 && word !== 0xffff) return false; for (var i = 0; i < 4; i++) { if (a[i] !== b[i + 12]) return false; } return true; }; ip.isPrivate = function(addr) { return /^(::f{4}:)?10\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i .test(addr) || /^(::f{4}:)?192\.168\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || /^(::f{4}:)?172\.(1[6-9]|2\d|30|31)\.([0-9]{1,3})\.([0-9]{1,3})$/i .test(addr) || /^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || /^(::f{4}:)?169\.254\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || /^f[cd][0-9a-f]{2}:/i.test(addr) || /^fe80:/i.test(addr) || /^::1$/.test(addr) || /^::$/.test(addr); }; ip.isPublic = function(addr) { return !ip.isPrivate(addr); }; ip.isLoopback = function(addr) { return /^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/ .test(addr) || /^fe80::1$/.test(addr) || /^::1$/.test(addr) || /^::$/.test(addr); }; ip.loopback = function(family) { // // Default to `ipv4` // family = _normalizeFamily(family); if (family !== 'ipv4' && family !== 'ipv6') { throw new Error('family must be ipv4 or ipv6'); } return family === 'ipv4' ? '127.0.0.1' : 'fe80::1'; }; // // ### function address (name, family) // #### @name {string|'public'|'private'} **Optional** Name or security // of the network interface. // #### @family {ipv4|ipv6} **Optional** IP family of the address (defaults // to ipv4). // // Returns the address for the network interface on the current system with // the specified `name`: // * String: First `family` address of the interface. // If not found see `undefined`. // * 'public': the first public ip address of family. // * 'private': the first private ip address of family. // * undefined: First address with `ipv4` or loopback address `127.0.0.1`. // ip.address = function(name, family) { var interfaces = os.networkInterfaces(); var all; // // Default to `ipv4` // family = _normalizeFamily(family); // // If a specific network interface has been named, // return the address. // if (name && name !== 'private' && name !== 'public') { var res = interfaces[name].filter(function(details) { var itemFamily = details.family.toLowerCase(); return itemFamily === family; }); if (res.length === 0) return undefined; return res[0].address; } var all = Object.keys(interfaces).map(function (nic) { // // Note: name will only be `public` or `private` // when this is called. // var addresses = interfaces[nic].filter(function (details) { details.family = details.family.toLowerCase(); if (details.family !== family || ip.isLoopback(details.address)) { return false; } else if (!name) { return true; } return name === 'public' ? ip.isPrivate(details.address) : ip.isPublic(details.address); }); return addresses.length ? addresses[0].address : undefined; }).filter(Boolean); return !all.length ? ip.loopback(family) : all[0]; }; ip.toLong = function(ip) { var ipl = 0; ip.split('.').forEach(function(octet) { ipl <<= 8; ipl += parseInt(octet); }); return(ipl >>> 0); }; ip.fromLong = function(ipl) { return ((ipl >>> 24) + '.' + (ipl >> 16 & 255) + '.' + (ipl >> 8 & 255) + '.' + (ipl & 255) ); }; 'use strict' module.exports = !!( (process.env.LAMBDA_TASK_ROOT && process.env.AWS_EXECUTION_ENV) || false ) The MIT License (MIT) Copyright (c) 2016-2017 Thomas Watson Steen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "is-lambda", "version": "1.0.1", "description": "Detect if your code is running on an AWS Lambda server", "main": "index.js", "dependencies": {}, "devDependencies": { "clear-require": "^1.0.1", "standard": "^10.0.2" }, "scripts": { "test": "standard && node test.js" }, "repository": { "type": "git", "url": "https://github.com/watson/is-lambda.git" }, "keywords": [ "aws", "hosting", "hosted", "lambda", "detect" ], "author": "Thomas Watson Steen (https://twitter.com/wa7son)", "license": "MIT", "bugs": { "url": "https://github.com/watson/is-lambda/issues" }, "homepage": "https://github.com/watson/is-lambda", "coordinates": [ 37.3859955, -122.0838831 ] } 'use strict' var assert = require('assert') var clearRequire = require('clear-require') process.env.AWS_EXECUTION_ENV = 'AWS_Lambda_nodejs6.10' process.env.LAMBDA_TASK_ROOT = '/var/task' var isCI = require('./') assert(isCI) delete process.env.AWS_EXECUTION_ENV clearRequire('./') isCI = require('./') assert(!isCI) var fs = require('fs') var core if (process.platform === 'win32' || global.TESTING_WINDOWS) { core = require('./windows.js') } else { core = require('./mode.js') } module.exports = isexe isexe.sync = sync function isexe (path, options, cb) { if (typeof options === 'function') { cb = options options = {} } if (!cb) { if (typeof Promise !== 'function') { throw new TypeError('callback not provided') } return new Promise(function (resolve, reject) { isexe(path, options || {}, function (er, is) { if (er) { reject(er) } else { resolve(is) } }) }) } core(path, options || {}, function (er, is) { // ignore EACCES because that just means we aren't allowed to run it if (er) { if (er.code === 'EACCES' || options && options.ignoreErrors) { er = null is = false } } cb(er, is) }) } function sync (path, options) { // my kingdom for a filtered catch try { return core.sync(path, options || {}) } catch (er) { if (options && options.ignoreErrors || er.code === 'EACCES') { return false } else { throw er } } } The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. module.exports = isexe isexe.sync = sync var fs = require('fs') function isexe (path, options, cb) { fs.stat(path, function (er, stat) { cb(er, er ? false : checkStat(stat, options)) }) } function sync (path, options) { return checkStat(fs.statSync(path), options) } function checkStat (stat, options) { return stat.isFile() && checkMode(stat, options) } function checkMode (stat, options) { var mod = stat.mode var uid = stat.uid var gid = stat.gid var myUid = options.uid !== undefined ? options.uid : process.getuid && process.getuid() var myGid = options.gid !== undefined ? options.gid : process.getgid && process.getgid() var u = parseInt('100', 8) var g = parseInt('010', 8) var o = parseInt('001', 8) var ug = u | g var ret = (mod & o) || (mod & g) && gid === myGid || (mod & u) && uid === myUid || (mod & ug) && myUid === 0 return ret } { "name": "isexe", "version": "2.0.0", "description": "Minimal module to check if a file is executable.", "main": "index.js", "directories": { "test": "test" }, "devDependencies": { "mkdirp": "^0.5.1", "rimraf": "^2.5.0", "tap": "^10.3.0" }, "scripts": { "test": "tap test/*.js --100", "preversion": "npm test", "postversion": "npm publish", "postpublish": "git push origin --all; git push origin --tags" }, "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "license": "ISC", "repository": { "type": "git", "url": "git+https://github.com/isaacs/isexe.git" }, "keywords": [], "bugs": { "url": "https://github.com/isaacs/isexe/issues" }, "homepage": "https://github.com/isaacs/isexe#readme" } module.exports = isexe isexe.sync = sync var fs = require('fs') function checkPathExt (path, options) { var pathext = options.pathExt !== undefined ? options.pathExt : process.env.PATHEXT if (!pathext) { return true } pathext = pathext.split(';') if (pathext.indexOf('') !== -1) { return true } for (var i = 0; i < pathext.length; i++) { var p = pathext[i].toLowerCase() if (p && path.substr(-p.length).toLowerCase() === p) { return true } } return false } function checkStat (stat, path, options) { if (!stat.isSymbolicLink() && !stat.isFile()) { return false } return checkPathExt(path, options) } function isexe (path, options, cb) { fs.stat(path, function (er, stat) { cb(er, er ? false : checkStat(stat, path, options)) }) } function sync (path, options) { return checkStat(fs.statSync(path), path, options) } The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. module.exports = minimatch minimatch.Minimatch = Minimatch var path = { sep: '/' } try { path = require('path') } catch (er) {} var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} var expand = require('brace-expansion') var plTypes = { '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, '?': { open: '(?:', close: ')?' }, '+': { open: '(?:', close: ')+' }, '*': { open: '(?:', close: ')*' }, '@': { open: '(?:', close: ')' } } // any single thing other than / // don't need to escape / when using new RegExp() var qmark = '[^/]' // * => any number of characters var star = qmark + '*?' // ** when dots are allowed. Anything goes, except .. and . // not (^ or / followed by one or two dots followed by $ or /), // followed by anything, any number of times. var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' // not a ^ or / followed by a dot, // followed by anything, any number of times. var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' // characters that need to be escaped in RegExp. var reSpecials = charSet('().*{}+?[]^$\\!') // "abc" -> { a:true, b:true, c:true } function charSet (s) { return s.split('').reduce(function (set, c) { set[c] = true return set }, {}) } // normalizes slashes. var slashSplit = /\/+/ minimatch.filter = filter function filter (pattern, options) { options = options || {} return function (p, i, list) { return minimatch(p, pattern, options) } } function ext (a, b) { a = a || {} b = b || {} var t = {} Object.keys(b).forEach(function (k) { t[k] = b[k] }) Object.keys(a).forEach(function (k) { t[k] = a[k] }) return t } minimatch.defaults = function (def) { if (!def || !Object.keys(def).length) return minimatch var orig = minimatch var m = function minimatch (p, pattern, options) { return orig.minimatch(p, pattern, ext(def, options)) } m.Minimatch = function Minimatch (pattern, options) { return new orig.Minimatch(pattern, ext(def, options)) } return m } Minimatch.defaults = function (def) { if (!def || !Object.keys(def).length) return Minimatch return minimatch.defaults(def).Minimatch } function minimatch (p, pattern, options) { if (typeof pattern !== 'string') { throw new TypeError('glob pattern string required') } if (!options) options = {} // shortcut: comments match nothing. if (!options.nocomment && pattern.charAt(0) === '#') { return false } // "" only matches "" if (pattern.trim() === '') return p === '' return new Minimatch(pattern, options).match(p) } function Minimatch (pattern, options) { if (!(this instanceof Minimatch)) { return new Minimatch(pattern, options) } if (typeof pattern !== 'string') { throw new TypeError('glob pattern string required') } if (!options) options = {} pattern = pattern.trim() // windows support: need to use /, not \ if (path.sep !== '/') { pattern = pattern.split(path.sep).join('/') } this.options = options this.set = [] this.pattern = pattern this.regexp = null this.negate = false this.comment = false this.empty = false // make the set of regexps etc. this.make() } Minimatch.prototype.debug = function () {} Minimatch.prototype.make = make function make () { // don't do it more than once. if (this._made) return var pattern = this.pattern var options = this.options // empty patterns and comments match nothing. if (!options.nocomment && pattern.charAt(0) === '#') { this.comment = true return } if (!pattern) { this.empty = true return } // step 1: figure out negation, etc. this.parseNegate() // step 2: expand braces var set = this.globSet = this.braceExpand() if (options.debug) this.debug = console.error this.debug(this.pattern, set) // step 3: now we have a set, so turn each one into a series of path-portion // matching patterns. // These will be regexps, except in the case of "**", which is // set to the GLOBSTAR object for globstar behavior, // and will not contain any / characters set = this.globParts = set.map(function (s) { return s.split(slashSplit) }) this.debug(this.pattern, set) // glob --> regexps set = set.map(function (s, si, set) { return s.map(this.parse, this) }, this) this.debug(this.pattern, set) // filter out everything that didn't compile properly. set = set.filter(function (s) { return s.indexOf(false) === -1 }) this.debug(this.pattern, set) this.set = set } Minimatch.prototype.parseNegate = parseNegate function parseNegate () { var pattern = this.pattern var negate = false var options = this.options var negateOffset = 0 if (options.nonegate) return for (var i = 0, l = pattern.length ; i < l && pattern.charAt(i) === '!' ; i++) { negate = !negate negateOffset++ } if (negateOffset) this.pattern = pattern.substr(negateOffset) this.negate = negate } // Brace expansion: // a{b,c}d -> abd acd // a{b,}c -> abc ac // a{0..3}d -> a0d a1d a2d a3d // a{b,c{d,e}f}g -> abg acdfg acefg // a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg // // Invalid sets are not expanded. // a{2..}b -> a{2..}b // a{b}c -> a{b}c minimatch.braceExpand = function (pattern, options) { return braceExpand(pattern, options) } Minimatch.prototype.braceExpand = braceExpand function braceExpand (pattern, options) { if (!options) { if (this instanceof Minimatch) { options = this.options } else { options = {} } } pattern = typeof pattern === 'undefined' ? this.pattern : pattern if (typeof pattern === 'undefined') { throw new TypeError('undefined pattern') } if (options.nobrace || !pattern.match(/\{.*\}/)) { // shortcut. no need to expand. return [pattern] } return expand(pattern) } // parse a component of the expanded set. // At this point, no pattern may contain "/" in it // so we're going to return a 2d array, where each entry is the full // pattern, split on '/', and then turned into a regular expression. // A regexp is made at the end which joins each array with an // escaped /, and another full one which joins each regexp with |. // // Following the lead of Bash 4.1, note that "**" only has special meaning // when it is the *only* thing in a path portion. Otherwise, any series // of * is equivalent to a single *. Globstar behavior is enabled by // default, and can be disabled by setting options.noglobstar. Minimatch.prototype.parse = parse var SUBPARSE = {} function parse (pattern, isSub) { if (pattern.length > 1024 * 64) { throw new TypeError('pattern is too long') } var options = this.options // shortcuts if (!options.noglobstar && pattern === '**') return GLOBSTAR if (pattern === '') return '' var re = '' var hasMagic = !!options.nocase var escaping = false // ? => one single character var patternListStack = [] var negativeLists = [] var stateChar var inClass = false var reClassStart = -1 var classStart = -1 // . and .. never match anything that doesn't start with ., // even when options.dot is set. var patternStart = pattern.charAt(0) === '.' ? '' // anything // not (start or / followed by . or .. followed by / or end) : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' : '(?!\\.)' var self = this function clearStateChar () { if (stateChar) { // we had some state-tracking character // that wasn't consumed by this pass. switch (stateChar) { case '*': re += star hasMagic = true break case '?': re += qmark hasMagic = true break default: re += '\\' + stateChar break } self.debug('clearStateChar %j %j', stateChar, re) stateChar = false } } for (var i = 0, len = pattern.length, c ; (i < len) && (c = pattern.charAt(i)) ; i++) { this.debug('%s\t%s %s %j', pattern, i, re, c) // skip over any that are escaped. if (escaping && reSpecials[c]) { re += '\\' + c escaping = false continue } switch (c) { case '/': // completely not allowed, even escaped. // Should already be path-split by now. return false case '\\': clearStateChar() escaping = true continue // the various stateChar values // for the "extglob" stuff. case '?': case '*': case '+': case '@': case '!': this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) // all of those are literals inside a class, except that // the glob [!a] means [^a] in regexp if (inClass) { this.debug(' in class') if (c === '!' && i === classStart + 1) c = '^' re += c continue } // if we already have a stateChar, then it means // that there was something like ** or +? in there. // Handle the stateChar, then proceed with this one. self.debug('call clearStateChar %j', stateChar) clearStateChar() stateChar = c // if extglob is disabled, then +(asdf|foo) isn't a thing. // just clear the statechar *now*, rather than even diving into // the patternList stuff. if (options.noext) clearStateChar() continue case '(': if (inClass) { re += '(' continue } if (!stateChar) { re += '\\(' continue } patternListStack.push({ type: stateChar, start: i - 1, reStart: re.length, open: plTypes[stateChar].open, close: plTypes[stateChar].close }) // negation is (?:(?!js)[^/]*) re += stateChar === '!' ? '(?:(?!(?:' : '(?:' this.debug('plType %j %j', stateChar, re) stateChar = false continue case ')': if (inClass || !patternListStack.length) { re += '\\)' continue } clearStateChar() hasMagic = true var pl = patternListStack.pop() // negation is (?:(?!js)[^/]*) // The others are (?:) re += pl.close if (pl.type === '!') { negativeLists.push(pl) } pl.reEnd = re.length continue case '|': if (inClass || !patternListStack.length || escaping) { re += '\\|' escaping = false continue } clearStateChar() re += '|' continue // these are mostly the same in regexp and glob case '[': // swallow any state-tracking char before the [ clearStateChar() if (inClass) { re += '\\' + c continue } inClass = true classStart = i reClassStart = re.length re += c continue case ']': // a right bracket shall lose its special // meaning and represent itself in // a bracket expression if it occurs // first in the list. -- POSIX.2 2.8.3.2 if (i === classStart + 1 || !inClass) { re += '\\' + c escaping = false continue } // handle the case where we left a class open. // "[z-a]" is valid, equivalent to "\[z-a\]" if (inClass) { // split where the last [ was, make sure we don't have // an invalid re. if so, re-walk the contents of the // would-be class to re-translate any characters that // were passed through as-is // TODO: It would probably be faster to determine this // without a try/catch and a new RegExp, but it's tricky // to do safely. For now, this is safe and works. var cs = pattern.substring(classStart + 1, i) try { RegExp('[' + cs + ']') } catch (er) { // not a valid class! var sp = this.parse(cs, SUBPARSE) re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' hasMagic = hasMagic || sp[1] inClass = false continue } } // finish up the class. hasMagic = true inClass = false re += c continue default: // swallow any state char that wasn't consumed clearStateChar() if (escaping) { // no need escaping = false } else if (reSpecials[c] && !(c === '^' && inClass)) { re += '\\' } re += c } // switch } // for // handle the case where we left a class open. // "[abc" is valid, equivalent to "\[abc" if (inClass) { // split where the last [ was, and escape it // this is a huge pita. We now have to re-walk // the contents of the would-be class to re-translate // any characters that were passed through as-is cs = pattern.substr(classStart + 1) sp = this.parse(cs, SUBPARSE) re = re.substr(0, reClassStart) + '\\[' + sp[0] hasMagic = hasMagic || sp[1] } // handle the case where we had a +( thing at the *end* // of the pattern. // each pattern list stack adds 3 chars, and we need to go through // and escape any | chars that were passed through as-is for the regexp. // Go through and escape them, taking care not to double-escape any // | chars that were already escaped. for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { var tail = re.slice(pl.reStart + pl.open.length) this.debug('setting tail', re, pl) // maybe some even number of \, then maybe 1 \, followed by a | tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { if (!$2) { // the | isn't already escaped, so escape it. $2 = '\\' } // need to escape all those slashes *again*, without escaping the // one that we need for escaping the | character. As it works out, // escaping an even number of slashes can be done by simply repeating // it exactly after itself. That's why this trick works. // // I am sorry that you have to see this. return $1 + $1 + $2 + '|' }) this.debug('tail=%j\n %s', tail, tail, pl, re) var t = pl.type === '*' ? star : pl.type === '?' ? qmark : '\\' + pl.type hasMagic = true re = re.slice(0, pl.reStart) + t + '\\(' + tail } // handle trailing things that only matter at the very end. clearStateChar() if (escaping) { // trailing \\ re += '\\\\' } // only need to apply the nodot start if the re starts with // something that could conceivably capture a dot var addPatternStart = false switch (re.charAt(0)) { case '.': case '[': case '(': addPatternStart = true } // Hack to work around lack of negative lookbehind in JS // A pattern like: *.!(x).!(y|z) needs to ensure that a name // like 'a.xyz.yz' doesn't match. So, the first negative // lookahead, has to look ALL the way ahead, to the end of // the pattern. for (var n = negativeLists.length - 1; n > -1; n--) { var nl = negativeLists[n] var nlBefore = re.slice(0, nl.reStart) var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) var nlAfter = re.slice(nl.reEnd) nlLast += nlAfter // Handle nested stuff like *(*.js|!(*.json)), where open parens // mean that we should *not* include the ) in the bit that is considered // "after" the negated section. var openParensBefore = nlBefore.split('(').length - 1 var cleanAfter = nlAfter for (i = 0; i < openParensBefore; i++) { cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') } nlAfter = cleanAfter var dollar = '' if (nlAfter === '' && isSub !== SUBPARSE) { dollar = '$' } var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast re = newRe } // if the re is not "" at this point, then we need to make sure // it doesn't match against an empty path part. // Otherwise a/* will match a/, which it should not. if (re !== '' && hasMagic) { re = '(?=.)' + re } if (addPatternStart) { re = patternStart + re } // parsing just a piece of a larger pattern. if (isSub === SUBPARSE) { return [re, hasMagic] } // skip the regexp for non-magical patterns // unescape anything in it, though, so that it'll be // an exact match against a file etc. if (!hasMagic) { return globUnescape(pattern) } var flags = options.nocase ? 'i' : '' try { var regExp = new RegExp('^' + re + '$', flags) } catch (er) { // If it was an invalid regular expression, then it can't match // anything. This trick looks for a character after the end of // the string, which is of course impossible, except in multi-line // mode, but it's not a /m regex. return new RegExp('$.') } regExp._glob = pattern regExp._src = re return regExp } minimatch.makeRe = function (pattern, options) { return new Minimatch(pattern, options || {}).makeRe() } Minimatch.prototype.makeRe = makeRe function makeRe () { if (this.regexp || this.regexp === false) return this.regexp // at this point, this.set is a 2d array of partial // pattern strings, or "**". // // It's better to use .match(). This function shouldn't // be used, really, but it's pretty convenient sometimes, // when you just want to work with a regex. var set = this.set if (!set.length) { this.regexp = false return this.regexp } var options = this.options var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot var flags = options.nocase ? 'i' : '' var re = set.map(function (pattern) { return pattern.map(function (p) { return (p === GLOBSTAR) ? twoStar : (typeof p === 'string') ? regExpEscape(p) : p._src }).join('\\\/') }).join('|') // must match entire pattern // ending in a * or ** will make it less strict. re = '^(?:' + re + ')$' // can match anything, as long as it's not this. if (this.negate) re = '^(?!' + re + ').*$' try { this.regexp = new RegExp(re, flags) } catch (ex) { this.regexp = false } return this.regexp } minimatch.match = function (list, pattern, options) { options = options || {} var mm = new Minimatch(pattern, options) list = list.filter(function (f) { return mm.match(f) }) if (mm.options.nonull && !list.length) { list.push(pattern) } return list } Minimatch.prototype.match = match function match (f, partial) { this.debug('match', f, this.pattern) // short-circuit in the case of busted things. // comments, etc. if (this.comment) return false if (this.empty) return f === '' if (f === '/' && partial) return true var options = this.options // windows: need to use /, not \ if (path.sep !== '/') { f = f.split(path.sep).join('/') } // treat the test path as a set of pathparts. f = f.split(slashSplit) this.debug(this.pattern, 'split', f) // just ONE of the pattern sets in this.set needs to match // in order for it to be valid. If negating, then just one // match means that we have failed. // Either way, return on the first hit. var set = this.set this.debug(this.pattern, 'set', set) // Find the basename of the path by looking for the last non-empty segment var filename var i for (i = f.length - 1; i >= 0; i--) { filename = f[i] if (filename) break } for (i = 0; i < set.length; i++) { var pattern = set[i] var file = f if (options.matchBase && pattern.length === 1) { file = [filename] } var hit = this.matchOne(file, pattern, partial) if (hit) { if (options.flipNegate) return true return !this.negate } } // didn't get any hits. this is success if it's a negative // pattern, failure otherwise. if (options.flipNegate) return false return this.negate } // set partial to true to test if, for example, // "/a/b" matches the start of "/*/b/*/d" // Partial means, if you run out of file before you run // out of pattern, then that's fine, as long as all // the parts match. Minimatch.prototype.matchOne = function (file, pattern, partial) { var options = this.options this.debug('matchOne', { 'this': this, file: file, pattern: pattern }) this.debug('matchOne', file.length, pattern.length) for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length ; (fi < fl) && (pi < pl) ; fi++, pi++) { this.debug('matchOne loop') var p = pattern[pi] var f = file[fi] this.debug(pattern, p, f) // should be impossible. // some invalid regexp stuff in the set. if (p === false) return false if (p === GLOBSTAR) { this.debug('GLOBSTAR', [pattern, p, f]) // "**" // a/**/b/**/c would match the following: // a/b/x/y/z/c // a/x/y/z/b/c // a/b/x/b/x/c // a/b/c // To do this, take the rest of the pattern after // the **, and see if it would match the file remainder. // If so, return success. // If not, the ** "swallows" a segment, and try again. // This is recursively awful. // // a/**/b/**/c matching a/b/x/y/z/c // - a matches a // - doublestar // - matchOne(b/x/y/z/c, b/**/c) // - b matches b // - doublestar // - matchOne(x/y/z/c, c) -> no // - matchOne(y/z/c, c) -> no // - matchOne(z/c, c) -> no // - matchOne(c, c) yes, hit var fr = fi var pr = pi + 1 if (pr === pl) { this.debug('** at the end') // a ** at the end will just swallow the rest. // We have found a match. // however, it will not swallow /.x, unless // options.dot is set. // . and .. are *never* matched by **, for explosively // exponential reasons. for (; fi < fl; fi++) { if (file[fi] === '.' || file[fi] === '..' || (!options.dot && file[fi].charAt(0) === '.')) return false } return true } // ok, let's see if we can swallow whatever we can. while (fr < fl) { var swallowee = file[fr] this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) // XXX remove this slice. Just pass the start index. if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { this.debug('globstar found match!', fr, fl, swallowee) // found a match. return true } else { // can't swallow "." or ".." ever. // can only swallow ".foo" when explicitly asked. if (swallowee === '.' || swallowee === '..' || (!options.dot && swallowee.charAt(0) === '.')) { this.debug('dot detected!', file, fr, pattern, pr) break } // ** swallows a segment, and continue. this.debug('globstar swallow a segment, and continue') fr++ } } // no match was found. // However, in partial mode, we can't say this is necessarily over. // If there's more *pattern* left, then if (partial) { // ran out of file this.debug('\n>>> no match, partial?', file, fr, pattern, pr) if (fr === fl) return true } return false } // something other than ** // non-magic patterns just have to match exactly // patterns with magic have been turned into regexps. var hit if (typeof p === 'string') { if (options.nocase) { hit = f.toLowerCase() === p.toLowerCase() } else { hit = f === p } this.debug('string match', p, f, hit) } else { hit = f.match(p) this.debug('pattern match', p, f, hit) } if (!hit) return false } // Note: ending in / means that we'll get a final "" // at the end of the pattern. This can only match a // corresponding "" at the end of the file. // If the file ends in /, then it can only match a // a pattern that ends in /, unless the pattern just // doesn't have any more for it. But, a/b/ should *not* // match "a/b/*", even though "" matches against the // [^/]*? pattern, except in partial mode, where it might // simply not be reached yet. // However, a/b/ should still satisfy a/* // now either we fell off the end of the pattern, or we're done. if (fi === fl && pi === pl) { // ran out of pattern and filename at the same time. // an exact hit! return true } else if (fi === fl) { // ran out of file, but still had pattern left. // this is ok if we're doing the match as part of // a glob fs traversal. return partial } else if (pi === pl) { // ran out of pattern, still have file left. // this is only acceptable if we're on the very last // empty segment of a file with a trailing slash. // a/* should match a/b/ var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') return emptyFileEnd } // should be unreachable. throw new Error('wtf?') } // replace stuff like \* with * function globUnescape (s) { return s.replace(/\\(.)/g, '$1') } function regExpEscape (s) { return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') } { "author": "Isaac Z. Schlueter (http://blog.izs.me)", "name": "minimatch", "description": "a glob matcher in javascript", "version": "3.0.4", "repository": { "type": "git", "url": "git://github.com/isaacs/minimatch.git" }, "main": "minimatch.js", "scripts": { "test": "tap test/*.js --cov", "preversion": "npm test", "postversion": "npm publish", "postpublish": "git push origin --all; git push origin --tags" }, "engines": { "node": "*" }, "dependencies": { "brace-expansion": "^1.1.7" }, "devDependencies": { "tap": "^10.3.2" }, "license": "ISC", "files": [ "minimatch.js" ] } const Minipass = require('minipass') const _data = Symbol('_data') const _length = Symbol('_length') class Collect extends Minipass { constructor (options) { super(options) this[_data] = [] this[_length] = 0 } write (chunk, encoding, cb) { if (typeof encoding === 'function') cb = encoding, encoding = 'utf8' if (!encoding) encoding = 'utf8' const c = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, encoding) this[_data].push(c) this[_length] += c.length if (cb) cb() return true } end (chunk, encoding, cb) { if (typeof chunk === 'function') cb = chunk, chunk = null if (typeof encoding === 'function') cb = encoding, encoding = 'utf8' if (chunk) this.write(chunk, encoding) const result = Buffer.concat(this[_data], this[_length]) super.write(result) return super.end(cb) } } module.exports = Collect // it would be possible to DRY this a bit by doing something like // this.collector = new Collect() and listening on its data event, // but it's not much code, and we may as well save the extra obj class CollectPassThrough extends Minipass { constructor (options) { super(options) this[_data] = [] this[_length] = 0 } write (chunk, encoding, cb) { if (typeof encoding === 'function') cb = encoding, encoding = 'utf8' if (!encoding) encoding = 'utf8' const c = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, encoding) this[_data].push(c) this[_length] += c.length return super.write(chunk, encoding, cb) } end (chunk, encoding, cb) { if (typeof chunk === 'function') cb = chunk, chunk = null if (typeof encoding === 'function') cb = encoding, encoding = 'utf8' if (chunk) this.write(chunk, encoding) const result = Buffer.concat(this[_data], this[_length]) this.emit('collect', result) return super.end(cb) } } module.exports.PassThrough = CollectPassThrough The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "minipass-collect", "version": "1.0.2", "description": "A Minipass stream that collects all the data into a single chunk", "author": "Isaac Z. Schlueter (https://izs.me)", "license": "ISC", "scripts": { "test": "tap", "snap": "tap", "preversion": "npm test", "postversion": "npm publish", "postpublish": "git push origin --follow-tags" }, "tap": { "check-coverage": true }, "devDependencies": { "tap": "^14.6.9" }, "dependencies": { "minipass": "^3.0.0" }, "files": [ "index.js" ], "engines": { "node": ">= 8" } } The MIT License (MIT) Copyright (c) Isaac Z. Schlueter and Contributors Copyright (c) 2016 David Frank Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --- Note: This is a derivative work based on "node-fetch" by David Frank, modified and distributed under the terms of the MIT license above. https://github.com/bitinn/node-fetch { "name": "minipass-fetch", "version": "2.0.3", "description": "An implementation of window.fetch in Node.js using Minipass streams", "license": "MIT", "main": "lib/index.js", "scripts": { "test": "tap", "snap": "tap", "preversion": "npm test", "postversion": "npm publish", "postpublish": "git push origin --follow-tags", "lint": "eslint '**/*.js'", "postlint": "npm-template-check", "template-copy": "npm-template-copy --force", "lintfix": "npm run lint -- --fix", "prepublishOnly": "git push origin --follow-tags", "posttest": "npm run lint" }, "tap": { "coverage-map": "map.js", "check-coverage": true }, "devDependencies": { "@npmcli/template-oss": "^2.9.2", "@ungap/url-search-params": "^0.2.2", "abort-controller": "^3.0.0", "abortcontroller-polyfill": "~1.7.3", "form-data": "^4.0.0", "nock": "^13.2.4", "parted": "^0.1.1", "string-to-arraybuffer": "^1.0.2", "tap": "^15.1.6" }, "dependencies": { "minipass": "^3.1.6", "minipass-sized": "^1.0.3", "minizlib": "^2.1.2" }, "optionalDependencies": { "encoding": "^0.1.13" }, "repository": { "type": "git", "url": "git+https://github.com/npm/minipass-fetch.git" }, "keywords": [ "fetch", "minipass", "node-fetch", "window.fetch" ], "files": [ "bin", "lib" ], "engines": { "node": "^12.13.0 || ^14.15.0 || >=16" }, "author": "GitHub Inc.", "templateOSS": { "version": "2.9.2" } } 'use strict' class AbortError extends Error { constructor (message) { super(message) this.code = 'FETCH_ABORTED' this.type = 'aborted' Error.captureStackTrace(this, this.constructor) } get name () { return 'AbortError' } // don't allow name to be overridden, but don't throw either set name (s) {} } module.exports = AbortError 'use strict' const Minipass = require('minipass') const TYPE = Symbol('type') const BUFFER = Symbol('buffer') class Blob { constructor (blobParts, options) { this[TYPE] = '' const buffers = [] let size = 0 if (blobParts) { const a = blobParts const length = Number(a.length) for (let i = 0; i < length; i++) { const element = a[i] const buffer = element instanceof Buffer ? element : ArrayBuffer.isView(element) ? Buffer.from(element.buffer, element.byteOffset, element.byteLength) : element instanceof ArrayBuffer ? Buffer.from(element) : element instanceof Blob ? element[BUFFER] : typeof element === 'string' ? Buffer.from(element) : Buffer.from(String(element)) size += buffer.length buffers.push(buffer) } } this[BUFFER] = Buffer.concat(buffers, size) const type = options && options.type !== undefined && String(options.type).toLowerCase() if (type && !/[^\u0020-\u007E]/.test(type)) { this[TYPE] = type } } get size () { return this[BUFFER].length } get type () { return this[TYPE] } text () { return Promise.resolve(this[BUFFER].toString()) } arrayBuffer () { const buf = this[BUFFER] const off = buf.byteOffset const len = buf.byteLength const ab = buf.buffer.slice(off, off + len) return Promise.resolve(ab) } stream () { return new Minipass().end(this[BUFFER]) } slice (start, end, type) { const size = this.size const relativeStart = start === undefined ? 0 : start < 0 ? Math.max(size + start, 0) : Math.min(start, size) const relativeEnd = end === undefined ? size : end < 0 ? Math.max(size + end, 0) : Math.min(end, size) const span = Math.max(relativeEnd - relativeStart, 0) const buffer = this[BUFFER] const slicedBuffer = buffer.slice( relativeStart, relativeStart + span ) const blob = new Blob([], { type }) blob[BUFFER] = slicedBuffer return blob } get [Symbol.toStringTag] () { return 'Blob' } static get BUFFER () { return BUFFER } } Object.defineProperties(Blob.prototype, { size: { enumerable: true }, type: { enumerable: true }, }) module.exports = Blob 'use strict' const Minipass = require('minipass') const MinipassSized = require('minipass-sized') const Blob = require('./blob.js') const { BUFFER } = Blob const FetchError = require('./fetch-error.js') // optional dependency on 'encoding' let convert try { convert = require('encoding').convert } catch (e) {} const INTERNALS = Symbol('Body internals') const CONSUME_BODY = Symbol('consumeBody') class Body { constructor (bodyArg, options = {}) { const { size = 0, timeout = 0 } = options const body = bodyArg === undefined || bodyArg === null ? null : isURLSearchParams(bodyArg) ? Buffer.from(bodyArg.toString()) : isBlob(bodyArg) ? bodyArg : Buffer.isBuffer(bodyArg) ? bodyArg : Object.prototype.toString.call(bodyArg) === '[object ArrayBuffer]' ? Buffer.from(bodyArg) : ArrayBuffer.isView(bodyArg) ? Buffer.from(bodyArg.buffer, bodyArg.byteOffset, bodyArg.byteLength) : Minipass.isStream(bodyArg) ? bodyArg : Buffer.from(String(bodyArg)) this[INTERNALS] = { body, disturbed: false, error: null, } this.size = size this.timeout = timeout if (Minipass.isStream(body)) { body.on('error', er => { const error = er.name === 'AbortError' ? er : new FetchError(`Invalid response while trying to fetch ${ this.url}: ${er.message}`, 'system', er) this[INTERNALS].error = error }) } } get body () { return this[INTERNALS].body } get bodyUsed () { return this[INTERNALS].disturbed } arrayBuffer () { return this[CONSUME_BODY]().then(buf => buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength)) } blob () { const ct = this.headers && this.headers.get('content-type') || '' return this[CONSUME_BODY]().then(buf => Object.assign( new Blob([], { type: ct.toLowerCase() }), { [BUFFER]: buf } )) } json () { return this[CONSUME_BODY]().then(buf => { try { return JSON.parse(buf.toString()) } catch (er) { return Promise.reject(new FetchError( `invalid json response body at ${ this.url} reason: ${er.message}`, 'invalid-json')) } }) } text () { return this[CONSUME_BODY]().then(buf => buf.toString()) } buffer () { return this[CONSUME_BODY]() } textConverted () { return this[CONSUME_BODY]().then(buf => convertBody(buf, this.headers)) } [CONSUME_BODY] () { if (this[INTERNALS].disturbed) { return Promise.reject(new TypeError(`body used already for: ${ this.url}`)) } this[INTERNALS].disturbed = true if (this[INTERNALS].error) { return Promise.reject(this[INTERNALS].error) } // body is null if (this.body === null) { return Promise.resolve(Buffer.alloc(0)) } if (Buffer.isBuffer(this.body)) { return Promise.resolve(this.body) } const upstream = isBlob(this.body) ? this.body.stream() : this.body /* istanbul ignore if: should never happen */ if (!Minipass.isStream(upstream)) { return Promise.resolve(Buffer.alloc(0)) } const stream = this.size && upstream instanceof MinipassSized ? upstream : !this.size && upstream instanceof Minipass && !(upstream instanceof MinipassSized) ? upstream : this.size ? new MinipassSized({ size: this.size }) : new Minipass() // allow timeout on slow response body const resTimeout = this.timeout ? setTimeout(() => { stream.emit('error', new FetchError( `Response timeout while trying to fetch ${ this.url} (over ${this.timeout}ms)`, 'body-timeout')) }, this.timeout) : null // do not keep the process open just for this timeout, even // though we expect it'll get cleared eventually. if (resTimeout && resTimeout.unref) { resTimeout.unref() } // do the pipe in the promise, because the pipe() can send too much // data through right away and upset the MP Sized object return new Promise((resolve, reject) => { // if the stream is some other kind of stream, then pipe through a MP // so we can collect it more easily. if (stream !== upstream) { upstream.on('error', er => stream.emit('error', er)) upstream.pipe(stream) } resolve() }).then(() => stream.concat()).then(buf => { clearTimeout(resTimeout) return buf }).catch(er => { clearTimeout(resTimeout) // request was aborted, reject with this Error if (er.name === 'AbortError' || er.name === 'FetchError') { throw er } else if (er.name === 'RangeError') { throw new FetchError(`Could not create Buffer from response body for ${ this.url}: ${er.message}`, 'system', er) } else { // other errors, such as incorrect content-encoding or content-length throw new FetchError(`Invalid response body while trying to fetch ${ this.url}: ${er.message}`, 'system', er) } }) } static clone (instance) { if (instance.bodyUsed) { throw new Error('cannot clone body after it is used') } const body = instance.body // check that body is a stream and not form-data object // NB: can't clone the form-data object without having it as a dependency if (Minipass.isStream(body) && typeof body.getBoundary !== 'function') { // create a dedicated tee stream so that we don't lose data // potentially sitting in the body stream's buffer by writing it // immediately to p1 and not having it for p2. const tee = new Minipass() const p1 = new Minipass() const p2 = new Minipass() tee.on('error', er => { p1.emit('error', er) p2.emit('error', er) }) body.on('error', er => tee.emit('error', er)) tee.pipe(p1) tee.pipe(p2) body.pipe(tee) // set instance body to one fork, return the other instance[INTERNALS].body = p1 return p2 } else { return instance.body } } static extractContentType (body) { return body === null || body === undefined ? null : typeof body === 'string' ? 'text/plain;charset=UTF-8' : isURLSearchParams(body) ? 'application/x-www-form-urlencoded;charset=UTF-8' : isBlob(body) ? body.type || null : Buffer.isBuffer(body) ? null : Object.prototype.toString.call(body) === '[object ArrayBuffer]' ? null : ArrayBuffer.isView(body) ? null : typeof body.getBoundary === 'function' ? `multipart/form-data;boundary=${body.getBoundary()}` : Minipass.isStream(body) ? null : 'text/plain;charset=UTF-8' } static getTotalBytes (instance) { const { body } = instance return (body === null || body === undefined) ? 0 : isBlob(body) ? body.size : Buffer.isBuffer(body) ? body.length : body && typeof body.getLengthSync === 'function' && ( // detect form data input from form-data module body._lengthRetrievers && /* istanbul ignore next */ body._lengthRetrievers.length === 0 || // 1.x body.hasKnownLength && body.hasKnownLength()) // 2.x ? body.getLengthSync() : null } static writeToStream (dest, instance) { const { body } = instance if (body === null || body === undefined) { dest.end() } else if (Buffer.isBuffer(body) || typeof body === 'string') { dest.end(body) } else { // body is stream or blob const stream = isBlob(body) ? body.stream() : body stream.on('error', er => dest.emit('error', er)).pipe(dest) } return dest } } Object.defineProperties(Body.prototype, { body: { enumerable: true }, bodyUsed: { enumerable: true }, arrayBuffer: { enumerable: true }, blob: { enumerable: true }, json: { enumerable: true }, text: { enumerable: true }, }) const isURLSearchParams = obj => // Duck-typing as a necessary condition. (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') ? false // Brand-checking and more duck-typing as optional condition. : obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function' const isBlob = obj => typeof obj === 'object' && typeof obj.arrayBuffer === 'function' && typeof obj.type === 'string' && typeof obj.stream === 'function' && typeof obj.constructor === 'function' && typeof obj.constructor.name === 'string' && /^(Blob|File)$/.test(obj.constructor.name) && /^(Blob|File)$/.test(obj[Symbol.toStringTag]) const convertBody = (buffer, headers) => { /* istanbul ignore if */ if (typeof convert !== 'function') { throw new Error('The package `encoding` must be installed to use the textConverted() function') } const ct = headers && headers.get('content-type') let charset = 'utf-8' let res // header if (ct) { res = /charset=([^;]*)/i.exec(ct) } // no charset in content type, peek at response body for at most 1024 bytes const str = buffer.slice(0, 1024).toString() // html5 if (!res && str) { res = / this.expect ? 'max-size' : type this.message = message Error.captureStackTrace(this, this.constructor) } get name () { return 'FetchError' } // don't allow name to be overwritten set name (n) {} get [Symbol.toStringTag] () { return 'FetchError' } } module.exports = FetchError 'use strict' const invalidTokenRegex = /[^^_`a-zA-Z\-0-9!#$%&'*+.|~]/ const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/ const validateName = name => { name = `${name}` if (invalidTokenRegex.test(name) || name === '') { throw new TypeError(`${name} is not a legal HTTP header name`) } } const validateValue = value => { value = `${value}` if (invalidHeaderCharRegex.test(value)) { throw new TypeError(`${value} is not a legal HTTP header value`) } } const find = (map, name) => { name = name.toLowerCase() for (const key in map) { if (key.toLowerCase() === name) { return key } } return undefined } const MAP = Symbol('map') class Headers { constructor (init = undefined) { this[MAP] = Object.create(null) if (init instanceof Headers) { const rawHeaders = init.raw() const headerNames = Object.keys(rawHeaders) for (const headerName of headerNames) { for (const value of rawHeaders[headerName]) { this.append(headerName, value) } } return } // no-op if (init === undefined || init === null) { return } if (typeof init === 'object') { const method = init[Symbol.iterator] if (method !== null && method !== undefined) { if (typeof method !== 'function') { throw new TypeError('Header pairs must be iterable') } // sequence> // Note: per spec we have to first exhaust the lists then process them const pairs = [] for (const pair of init) { if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') { throw new TypeError('Each header pair must be iterable') } const arrPair = Array.from(pair) if (arrPair.length !== 2) { throw new TypeError('Each header pair must be a name/value tuple') } pairs.push(arrPair) } for (const pair of pairs) { this.append(pair[0], pair[1]) } } else { // record for (const key of Object.keys(init)) { this.append(key, init[key]) } } } else { throw new TypeError('Provided initializer must be an object') } } get (name) { name = `${name}` validateName(name) const key = find(this[MAP], name) if (key === undefined) { return null } return this[MAP][key].join(', ') } forEach (callback, thisArg = undefined) { let pairs = getHeaders(this) for (let i = 0; i < pairs.length; i++) { const [name, value] = pairs[i] callback.call(thisArg, value, name, this) // refresh in case the callback added more headers pairs = getHeaders(this) } } set (name, value) { name = `${name}` value = `${value}` validateName(name) validateValue(value) const key = find(this[MAP], name) this[MAP][key !== undefined ? key : name] = [value] } append (name, value) { name = `${name}` value = `${value}` validateName(name) validateValue(value) const key = find(this[MAP], name) if (key !== undefined) { this[MAP][key].push(value) } else { this[MAP][name] = [value] } } has (name) { name = `${name}` validateName(name) return find(this[MAP], name) !== undefined } delete (name) { name = `${name}` validateName(name) const key = find(this[MAP], name) if (key !== undefined) { delete this[MAP][key] } } raw () { return this[MAP] } keys () { return new HeadersIterator(this, 'key') } values () { return new HeadersIterator(this, 'value') } [Symbol.iterator] () { return new HeadersIterator(this, 'key+value') } entries () { return new HeadersIterator(this, 'key+value') } get [Symbol.toStringTag] () { return 'Headers' } static exportNodeCompatibleHeaders (headers) { const obj = Object.assign(Object.create(null), headers[MAP]) // http.request() only supports string as Host header. This hack makes // specifying custom Host header possible. const hostHeaderKey = find(headers[MAP], 'Host') if (hostHeaderKey !== undefined) { obj[hostHeaderKey] = obj[hostHeaderKey][0] } return obj } static createHeadersLenient (obj) { const headers = new Headers() for (const name of Object.keys(obj)) { if (invalidTokenRegex.test(name)) { continue } if (Array.isArray(obj[name])) { for (const val of obj[name]) { if (invalidHeaderCharRegex.test(val)) { continue } if (headers[MAP][name] === undefined) { headers[MAP][name] = [val] } else { headers[MAP][name].push(val) } } } else if (!invalidHeaderCharRegex.test(obj[name])) { headers[MAP][name] = [obj[name]] } } return headers } } Object.defineProperties(Headers.prototype, { get: { enumerable: true }, forEach: { enumerable: true }, set: { enumerable: true }, append: { enumerable: true }, has: { enumerable: true }, delete: { enumerable: true }, keys: { enumerable: true }, values: { enumerable: true }, entries: { enumerable: true }, }) const getHeaders = (headers, kind = 'key+value') => Object.keys(headers[MAP]).sort().map( kind === 'key' ? k => k.toLowerCase() : kind === 'value' ? k => headers[MAP][k].join(', ') : k => [k.toLowerCase(), headers[MAP][k].join(', ')] ) const INTERNAL = Symbol('internal') class HeadersIterator { constructor (target, kind) { this[INTERNAL] = { target, kind, index: 0, } } get [Symbol.toStringTag] () { return 'HeadersIterator' } next () { /* istanbul ignore if: should be impossible */ if (!this || Object.getPrototypeOf(this) !== HeadersIterator.prototype) { throw new TypeError('Value of `this` is not a HeadersIterator') } const { target, kind, index } = this[INTERNAL] const values = getHeaders(target, kind) const len = values.length if (index >= len) { return { value: undefined, done: true, } } this[INTERNAL].index++ return { value: values[index], done: false } } } // manually extend because 'extends' requires a ctor Object.setPrototypeOf(HeadersIterator.prototype, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))) module.exports = Headers 'use strict' const { URL } = require('url') const http = require('http') const https = require('https') const zlib = require('minizlib') const Minipass = require('minipass') const Body = require('./body.js') const { writeToStream, getTotalBytes } = Body const Response = require('./response.js') const Headers = require('./headers.js') const { createHeadersLenient } = Headers const Request = require('./request.js') const { getNodeRequestOptions } = Request const FetchError = require('./fetch-error.js') const AbortError = require('./abort-error.js') // XXX this should really be split up and unit-ized for easier testing // and better DRY implementation of data/http request aborting const fetch = async (url, opts) => { if (/^data:/.test(url)) { const request = new Request(url, opts) // delay 1 promise tick so that the consumer can abort right away return Promise.resolve().then(() => new Promise((resolve, reject) => { let type, data try { const { pathname, search } = new URL(url) const split = pathname.split(',') if (split.length < 2) { throw new Error('invalid data: URI') } const mime = split.shift() const base64 = /;base64$/.test(mime) type = base64 ? mime.slice(0, -1 * ';base64'.length) : mime const rawData = decodeURIComponent(split.join(',') + search) data = base64 ? Buffer.from(rawData, 'base64') : Buffer.from(rawData) } catch (er) { return reject(new FetchError(`[${request.method}] ${ request.url} invalid URL, ${er.message}`, 'system', er)) } const { signal } = request if (signal && signal.aborted) { return reject(new AbortError('The user aborted a request.')) } const headers = { 'Content-Length': data.length } if (type) { headers['Content-Type'] = type } return resolve(new Response(data, { headers })) })) } return new Promise((resolve, reject) => { // build request object const request = new Request(url, opts) let options try { options = getNodeRequestOptions(request) } catch (er) { return reject(er) } const send = (options.protocol === 'https:' ? https : http).request const { signal } = request let response = null const abort = () => { const error = new AbortError('The user aborted a request.') reject(error) if (Minipass.isStream(request.body) && typeof request.body.destroy === 'function') { request.body.destroy(error) } if (response && response.body) { response.body.emit('error', error) } } if (signal && signal.aborted) { return abort() } const abortAndFinalize = () => { abort() finalize() } const finalize = () => { req.abort() if (signal) { signal.removeEventListener('abort', abortAndFinalize) } clearTimeout(reqTimeout) } // send request const req = send(options) if (signal) { signal.addEventListener('abort', abortAndFinalize) } let reqTimeout = null if (request.timeout) { req.once('socket', socket => { reqTimeout = setTimeout(() => { reject(new FetchError(`network timeout at: ${ request.url}`, 'request-timeout')) finalize() }, request.timeout) }) } req.on('error', er => { // if a 'response' event is emitted before the 'error' event, then by the // time this handler is run it's too late to reject the Promise for the // response. instead, we forward the error event to the response stream // so that the error will surface to the user when they try to consume // the body. this is done as a side effect of aborting the request except // for in windows, where we must forward the event manually, otherwise // there is no longer a ref'd socket attached to the request and the // stream never ends so the event loop runs out of work and the process // exits without warning. // coverage skipped here due to the difficulty in testing // istanbul ignore next if (req.res) { req.res.emit('error', er) } reject(new FetchError(`request to ${request.url} failed, reason: ${ er.message}`, 'system', er)) finalize() }) req.on('response', res => { clearTimeout(reqTimeout) const headers = createHeadersLenient(res.headers) // HTTP fetch step 5 if (fetch.isRedirect(res.statusCode)) { // HTTP fetch step 5.2 const location = headers.get('Location') // HTTP fetch step 5.3 const locationURL = location === null ? null : (new URL(location, request.url)).toString() // HTTP fetch step 5.5 if (request.redirect === 'error') { reject(new FetchError('uri requested responds with a redirect, ' + `redirect mode is set to error: ${request.url}`, 'no-redirect')) finalize() return } else if (request.redirect === 'manual') { // node-fetch-specific step: make manual redirect a bit easier to // use by setting the Location header value to the resolved URL. if (locationURL !== null) { // handle corrupted header try { headers.set('Location', locationURL) } catch (err) { /* istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request */ reject(err) } } } else if (request.redirect === 'follow' && locationURL !== null) { // HTTP-redirect fetch step 5 if (request.counter >= request.follow) { reject(new FetchError(`maximum redirect reached at: ${ request.url}`, 'max-redirect')) finalize() return } // HTTP-redirect fetch step 9 if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) { reject(new FetchError( 'Cannot follow redirect with body being a readable stream', 'unsupported-redirect' )) finalize() return } // Update host due to redirection request.headers.set('host', (new URL(locationURL)).host) // HTTP-redirect fetch step 6 (counter increment) // Create a new Request object. const requestOpts = { headers: new Headers(request.headers), follow: request.follow, counter: request.counter + 1, agent: request.agent, compress: request.compress, method: request.method, body: request.body, signal: request.signal, timeout: request.timeout, } // if the redirect is to a new hostname, strip the authorization and cookie headers const parsedOriginal = new URL(request.url) const parsedRedirect = new URL(locationURL) if (parsedOriginal.hostname !== parsedRedirect.hostname) { requestOpts.headers.delete('authorization') requestOpts.headers.delete('cookie') } // HTTP-redirect fetch step 11 if (res.statusCode === 303 || ( (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST' )) { requestOpts.method = 'GET' requestOpts.body = undefined requestOpts.headers.delete('content-length') } // HTTP-redirect fetch step 15 resolve(fetch(new Request(locationURL, requestOpts))) finalize() return } } // end if(isRedirect) // prepare response res.once('end', () => signal && signal.removeEventListener('abort', abortAndFinalize)) const body = new Minipass() // if an error occurs, either on the response stream itself, on one of the // decoder streams, or a response length timeout from the Body class, we // forward the error through to our internal body stream. If we see an // error event on that, we call finalize to abort the request and ensure // we don't leave a socket believing a request is in flight. // this is difficult to test, so lacks specific coverage. body.on('error', finalize) // exceedingly rare that the stream would have an error, // but just in case we proxy it to the stream in use. res.on('error', /* istanbul ignore next */ er => body.emit('error', er)) res.on('data', (chunk) => body.write(chunk)) res.on('end', () => body.end()) const responseOptions = { url: request.url, status: res.statusCode, statusText: res.statusMessage, headers: headers, size: request.size, timeout: request.timeout, counter: request.counter, trailer: new Promise(resolve => res.on('end', () => resolve(createHeadersLenient(res.trailers)))), } // HTTP-network fetch step 12.1.1.3 const codings = headers.get('Content-Encoding') // HTTP-network fetch step 12.1.1.4: handle content codings // in following scenarios we ignore compression support // 1. compression support is disabled // 2. HEAD request // 3. no Content-Encoding header // 4. no content response (204) // 5. content not modified response (304) if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) { response = new Response(body, responseOptions) resolve(response) return } // Be less strict when decoding compressed responses, since sometimes // servers send slightly invalid responses that are still accepted // by common browsers. // Always using Z_SYNC_FLUSH is what cURL does. const zlibOptions = { flush: zlib.constants.Z_SYNC_FLUSH, finishFlush: zlib.constants.Z_SYNC_FLUSH, } // for gzip if (codings === 'gzip' || codings === 'x-gzip') { const unzip = new zlib.Gunzip(zlibOptions) response = new Response( // exceedingly rare that the stream would have an error, // but just in case we proxy it to the stream in use. body.on('error', /* istanbul ignore next */ er => unzip.emit('error', er)).pipe(unzip), responseOptions ) resolve(response) return } // for deflate if (codings === 'deflate' || codings === 'x-deflate') { // handle the infamous raw deflate response from old servers // a hack for old IIS and Apache servers const raw = res.pipe(new Minipass()) raw.once('data', chunk => { // see http://stackoverflow.com/questions/37519828 const decoder = (chunk[0] & 0x0F) === 0x08 ? new zlib.Inflate() : new zlib.InflateRaw() // exceedingly rare that the stream would have an error, // but just in case we proxy it to the stream in use. body.on('error', /* istanbul ignore next */ er => decoder.emit('error', er)).pipe(decoder) response = new Response(decoder, responseOptions) resolve(response) }) return } // for br if (codings === 'br') { // ignoring coverage so tests don't have to fake support (or lack of) for brotli // istanbul ignore next try { var decoder = new zlib.BrotliDecompress() } catch (err) { reject(err) finalize() return } // exceedingly rare that the stream would have an error, // but just in case we proxy it to the stream in use. body.on('error', /* istanbul ignore next */ er => decoder.emit('error', er)).pipe(decoder) response = new Response(decoder, responseOptions) resolve(response) return } // otherwise, use response as-is response = new Response(body, responseOptions) resolve(response) }) writeToStream(req, request) }) } module.exports = fetch fetch.isRedirect = code => code === 301 || code === 302 || code === 303 || code === 307 || code === 308 fetch.Headers = Headers fetch.Request = Request fetch.Response = Response fetch.FetchError = FetchError 'use strict' const { URL } = require('url') const Minipass = require('minipass') const Headers = require('./headers.js') const { exportNodeCompatibleHeaders } = Headers const Body = require('./body.js') const { clone, extractContentType, getTotalBytes } = Body const version = require('../package.json').version const defaultUserAgent = `minipass-fetch/${version} (+https://github.com/isaacs/minipass-fetch)` const INTERNALS = Symbol('Request internals') const isRequest = input => typeof input === 'object' && typeof input[INTERNALS] === 'object' const isAbortSignal = signal => { const proto = ( signal && typeof signal === 'object' && Object.getPrototypeOf(signal) ) return !!(proto && proto.constructor.name === 'AbortSignal') } class Request extends Body { constructor (input, init = {}) { const parsedURL = isRequest(input) ? new URL(input.url) : input && input.href ? new URL(input.href) : new URL(`${input}`) if (isRequest(input)) { init = { ...input[INTERNALS], ...init } } else if (!input || typeof input === 'string') { input = {} } const method = (init.method || input.method || 'GET').toUpperCase() const isGETHEAD = method === 'GET' || method === 'HEAD' if ((init.body !== null && init.body !== undefined || isRequest(input) && input.body !== null) && isGETHEAD) { throw new TypeError('Request with GET/HEAD method cannot have body') } const inputBody = init.body !== null && init.body !== undefined ? init.body : isRequest(input) && input.body !== null ? clone(input) : null super(inputBody, { timeout: init.timeout || input.timeout || 0, size: init.size || input.size || 0, }) const headers = new Headers(init.headers || input.headers || {}) if (inputBody !== null && inputBody !== undefined && !headers.has('Content-Type')) { const contentType = extractContentType(inputBody) if (contentType) { headers.append('Content-Type', contentType) } } const signal = 'signal' in init ? init.signal : null if (signal !== null && signal !== undefined && !isAbortSignal(signal)) { throw new TypeError('Expected signal must be an instanceof AbortSignal') } // TLS specific options that are handled by node const { ca, cert, ciphers, clientCertEngine, crl, dhparam, ecdhCurve, family, honorCipherOrder, key, passphrase, pfx, rejectUnauthorized = process.env.NODE_TLS_REJECT_UNAUTHORIZED !== '0', secureOptions, secureProtocol, servername, sessionIdContext, } = init this[INTERNALS] = { method, redirect: init.redirect || input.redirect || 'follow', headers, parsedURL, signal, ca, cert, ciphers, clientCertEngine, crl, dhparam, ecdhCurve, family, honorCipherOrder, key, passphrase, pfx, rejectUnauthorized, secureOptions, secureProtocol, servername, sessionIdContext, } // node-fetch-only options this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20 this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true this.counter = init.counter || input.counter || 0 this.agent = init.agent || input.agent } get method () { return this[INTERNALS].method } get url () { return this[INTERNALS].parsedURL.toString() } get headers () { return this[INTERNALS].headers } get redirect () { return this[INTERNALS].redirect } get signal () { return this[INTERNALS].signal } clone () { return new Request(this) } get [Symbol.toStringTag] () { return 'Request' } static getNodeRequestOptions (request) { const parsedURL = request[INTERNALS].parsedURL const headers = new Headers(request[INTERNALS].headers) // fetch step 1.3 if (!headers.has('Accept')) { headers.set('Accept', '*/*') } // Basic fetch if (!/^https?:$/.test(parsedURL.protocol)) { throw new TypeError('Only HTTP(S) protocols are supported') } if (request.signal && Minipass.isStream(request.body) && typeof request.body.destroy !== 'function') { throw new Error( 'Cancellation of streamed requests with AbortSignal is not supported') } // HTTP-network-or-cache fetch steps 2.4-2.7 const contentLengthValue = (request.body === null || request.body === undefined) && /^(POST|PUT)$/i.test(request.method) ? '0' : request.body !== null && request.body !== undefined ? getTotalBytes(request) : null if (contentLengthValue) { headers.set('Content-Length', contentLengthValue + '') } // HTTP-network-or-cache fetch step 2.11 if (!headers.has('User-Agent')) { headers.set('User-Agent', defaultUserAgent) } // HTTP-network-or-cache fetch step 2.15 if (request.compress && !headers.has('Accept-Encoding')) { headers.set('Accept-Encoding', 'gzip,deflate') } const agent = typeof request.agent === 'function' ? request.agent(parsedURL) : request.agent if (!headers.has('Connection') && !agent) { headers.set('Connection', 'close') } // TLS specific options that are handled by node const { ca, cert, ciphers, clientCertEngine, crl, dhparam, ecdhCurve, family, honorCipherOrder, key, passphrase, pfx, rejectUnauthorized, secureOptions, secureProtocol, servername, sessionIdContext, } = request[INTERNALS] // HTTP-network fetch step 4.2 // chunked encoding is handled by Node.js // we cannot spread parsedURL directly, so we have to read each property one-by-one // and map them to the equivalent https?.request() method options const urlProps = { auth: parsedURL.username || parsedURL.password ? `${parsedURL.username}:${parsedURL.password}` : '', host: parsedURL.host, hostname: parsedURL.hostname, path: `${parsedURL.pathname}${parsedURL.search}`, port: parsedURL.port, protocol: parsedURL.protocol, } return { ...urlProps, method: request.method, headers: exportNodeCompatibleHeaders(headers), agent, ca, cert, ciphers, clientCertEngine, crl, dhparam, ecdhCurve, family, honorCipherOrder, key, passphrase, pfx, rejectUnauthorized, secureOptions, secureProtocol, servername, sessionIdContext, } } } module.exports = Request Object.defineProperties(Request.prototype, { method: { enumerable: true }, url: { enumerable: true }, headers: { enumerable: true }, redirect: { enumerable: true }, clone: { enumerable: true }, signal: { enumerable: true }, }) 'use strict' const http = require('http') const { STATUS_CODES } = http const Headers = require('./headers.js') const Body = require('./body.js') const { clone, extractContentType } = Body const INTERNALS = Symbol('Response internals') class Response extends Body { constructor (body = null, opts = {}) { super(body, opts) const status = opts.status || 200 const headers = new Headers(opts.headers) if (body !== null && body !== undefined && !headers.has('Content-Type')) { const contentType = extractContentType(body) if (contentType) { headers.append('Content-Type', contentType) } } this[INTERNALS] = { url: opts.url, status, statusText: opts.statusText || STATUS_CODES[status], headers, counter: opts.counter, trailer: Promise.resolve(opts.trailer || new Headers()), } } get trailer () { return this[INTERNALS].trailer } get url () { return this[INTERNALS].url || '' } get status () { return this[INTERNALS].status } get ok () { return this[INTERNALS].status >= 200 && this[INTERNALS].status < 300 } get redirected () { return this[INTERNALS].counter > 0 } get statusText () { return this[INTERNALS].statusText } get headers () { return this[INTERNALS].headers } clone () { return new Response(clone(this), { url: this.url, status: this.status, statusText: this.statusText, headers: this.headers, ok: this.ok, redirected: this.redirected, trailer: this.trailer, }) } get [Symbol.toStringTag] () { return 'Response' } } module.exports = Response Object.defineProperties(Response.prototype, { url: { enumerable: true }, status: { enumerable: true }, ok: { enumerable: true }, redirected: { enumerable: true }, statusText: { enumerable: true }, headers: { enumerable: true }, clone: { enumerable: true }, }) 'use strict' const proc = typeof process === 'object' && process ? process : { stdout: null, stderr: null, } const EE = require('events') const Stream = require('stream') const Yallist = require('yallist') const SD = require('string_decoder').StringDecoder const EOF = Symbol('EOF') const MAYBE_EMIT_END = Symbol('maybeEmitEnd') const EMITTED_END = Symbol('emittedEnd') const EMITTING_END = Symbol('emittingEnd') const EMITTED_ERROR = Symbol('emittedError') const CLOSED = Symbol('closed') const READ = Symbol('read') const FLUSH = Symbol('flush') const FLUSHCHUNK = Symbol('flushChunk') const ENCODING = Symbol('encoding') const DECODER = Symbol('decoder') const FLOWING = Symbol('flowing') const PAUSED = Symbol('paused') const RESUME = Symbol('resume') const BUFFERLENGTH = Symbol('bufferLength') const BUFFERPUSH = Symbol('bufferPush') const BUFFERSHIFT = Symbol('bufferShift') const OBJECTMODE = Symbol('objectMode') const DESTROYED = Symbol('destroyed') // TODO remove when Node v8 support drops const doIter = global._MP_NO_ITERATOR_SYMBOLS_ !== '1' const ASYNCITERATOR = doIter && Symbol.asyncIterator || Symbol('asyncIterator not implemented') const ITERATOR = doIter && Symbol.iterator || Symbol('iterator not implemented') // events that mean 'the stream is over' // these are treated specially, and re-emitted // if they are listened for after emitting. const isEndish = ev => ev === 'end' || ev === 'finish' || ev === 'prefinish' const isArrayBuffer = b => b instanceof ArrayBuffer || typeof b === 'object' && b.constructor && b.constructor.name === 'ArrayBuffer' && b.byteLength >= 0 const isArrayBufferView = b => !Buffer.isBuffer(b) && ArrayBuffer.isView(b) module.exports = class Minipass extends Stream { constructor (options) { super() this[FLOWING] = false // whether we're explicitly paused this[PAUSED] = false this.pipes = new Yallist() this.buffer = new Yallist() this[OBJECTMODE] = options && options.objectMode || false if (this[OBJECTMODE]) this[ENCODING] = null else this[ENCODING] = options && options.encoding || null if (this[ENCODING] === 'buffer') this[ENCODING] = null this[DECODER] = this[ENCODING] ? new SD(this[ENCODING]) : null this[EOF] = false this[EMITTED_END] = false this[EMITTING_END] = false this[CLOSED] = false this[EMITTED_ERROR] = null this.writable = true this.readable = true this[BUFFERLENGTH] = 0 this[DESTROYED] = false } get bufferLength () { return this[BUFFERLENGTH] } get encoding () { return this[ENCODING] } set encoding (enc) { if (this[OBJECTMODE]) throw new Error('cannot set encoding in objectMode') if (this[ENCODING] && enc !== this[ENCODING] && (this[DECODER] && this[DECODER].lastNeed || this[BUFFERLENGTH])) throw new Error('cannot change encoding') if (this[ENCODING] !== enc) { this[DECODER] = enc ? new SD(enc) : null if (this.buffer.length) this.buffer = this.buffer.map(chunk => this[DECODER].write(chunk)) } this[ENCODING] = enc } setEncoding (enc) { this.encoding = enc } get objectMode () { return this[OBJECTMODE] } set objectMode (om) { this[OBJECTMODE] = this[OBJECTMODE] || !!om } write (chunk, encoding, cb) { if (this[EOF]) throw new Error('write after end') if (this[DESTROYED]) { this.emit('error', Object.assign( new Error('Cannot call write after a stream was destroyed'), { code: 'ERR_STREAM_DESTROYED' } )) return true } if (typeof encoding === 'function') cb = encoding, encoding = 'utf8' if (!encoding) encoding = 'utf8' // convert array buffers and typed array views into buffers // at some point in the future, we may want to do the opposite! // leave strings and buffers as-is // anything else switches us into object mode if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) { if (isArrayBufferView(chunk)) chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength) else if (isArrayBuffer(chunk)) chunk = Buffer.from(chunk) else if (typeof chunk !== 'string') // use the setter so we throw if we have encoding set this.objectMode = true } // this ensures at this point that the chunk is a buffer or string // don't buffer it up or send it to the decoder if (!this.objectMode && !chunk.length) { if (this[BUFFERLENGTH] !== 0) this.emit('readable') if (cb) cb() return this.flowing } // fast-path writing strings of same encoding to a stream with // an empty buffer, skipping the buffer/decoder dance if (typeof chunk === 'string' && !this[OBJECTMODE] && // unless it is a string already ready for us to use !(encoding === this[ENCODING] && !this[DECODER].lastNeed)) { chunk = Buffer.from(chunk, encoding) } if (Buffer.isBuffer(chunk) && this[ENCODING]) chunk = this[DECODER].write(chunk) if (this.flowing) { // if we somehow have something in the buffer, but we think we're // flowing, then we need to flush all that out first, or we get // chunks coming in out of order. Can't emit 'drain' here though, // because we're mid-write, so that'd be bad. if (this[BUFFERLENGTH] !== 0) this[FLUSH](true) // if we are still flowing after flushing the buffer we can emit the // chunk otherwise we have to buffer it. this.flowing ? this.emit('data', chunk) : this[BUFFERPUSH](chunk) } else this[BUFFERPUSH](chunk) if (this[BUFFERLENGTH] !== 0) this.emit('readable') if (cb) cb() return this.flowing } read (n) { if (this[DESTROYED]) return null try { if (this[BUFFERLENGTH] === 0 || n === 0 || n > this[BUFFERLENGTH]) return null if (this[OBJECTMODE]) n = null if (this.buffer.length > 1 && !this[OBJECTMODE]) { if (this.encoding) this.buffer = new Yallist([ Array.from(this.buffer).join('') ]) else this.buffer = new Yallist([ Buffer.concat(Array.from(this.buffer), this[BUFFERLENGTH]) ]) } return this[READ](n || null, this.buffer.head.value) } finally { this[MAYBE_EMIT_END]() } } [READ] (n, chunk) { if (n === chunk.length || n === null) this[BUFFERSHIFT]() else { this.buffer.head.value = chunk.slice(n) chunk = chunk.slice(0, n) this[BUFFERLENGTH] -= n } this.emit('data', chunk) if (!this.buffer.length && !this[EOF]) this.emit('drain') return chunk } end (chunk, encoding, cb) { if (typeof chunk === 'function') cb = chunk, chunk = null if (typeof encoding === 'function') cb = encoding, encoding = 'utf8' if (chunk) this.write(chunk, encoding) if (cb) this.once('end', cb) this[EOF] = true this.writable = false // if we haven't written anything, then go ahead and emit, // even if we're not reading. // we'll re-emit if a new 'end' listener is added anyway. // This makes MP more suitable to write-only use cases. if (this.flowing || !this[PAUSED]) this[MAYBE_EMIT_END]() return this } // don't let the internal resume be overwritten [RESUME] () { if (this[DESTROYED]) return this[PAUSED] = false this[FLOWING] = true this.emit('resume') if (this.buffer.length) this[FLUSH]() else if (this[EOF]) this[MAYBE_EMIT_END]() else this.emit('drain') } resume () { return this[RESUME]() } pause () { this[FLOWING] = false this[PAUSED] = true } get destroyed () { return this[DESTROYED] } get flowing () { return this[FLOWING] } get paused () { return this[PAUSED] } [BUFFERPUSH] (chunk) { if (this[OBJECTMODE]) this[BUFFERLENGTH] += 1 else this[BUFFERLENGTH] += chunk.length return this.buffer.push(chunk) } [BUFFERSHIFT] () { if (this.buffer.length) { if (this[OBJECTMODE]) this[BUFFERLENGTH] -= 1 else this[BUFFERLENGTH] -= this.buffer.head.value.length } return this.buffer.shift() } [FLUSH] (noDrain) { do {} while (this[FLUSHCHUNK](this[BUFFERSHIFT]())) if (!noDrain && !this.buffer.length && !this[EOF]) this.emit('drain') } [FLUSHCHUNK] (chunk) { return chunk ? (this.emit('data', chunk), this.flowing) : false } pipe (dest, opts) { if (this[DESTROYED]) return const ended = this[EMITTED_END] opts = opts || {} if (dest === proc.stdout || dest === proc.stderr) opts.end = false else opts.end = opts.end !== false const p = { dest: dest, opts: opts, ondrain: _ => this[RESUME]() } this.pipes.push(p) dest.on('drain', p.ondrain) this[RESUME]() // piping an ended stream ends immediately if (ended && p.opts.end) p.dest.end() return dest } addListener (ev, fn) { return this.on(ev, fn) } on (ev, fn) { try { return super.on(ev, fn) } finally { if (ev === 'data' && !this.pipes.length && !this.flowing) this[RESUME]() else if (isEndish(ev) && this[EMITTED_END]) { super.emit(ev) this.removeAllListeners(ev) } else if (ev === 'error' && this[EMITTED_ERROR]) { fn.call(this, this[EMITTED_ERROR]) } } } get emittedEnd () { return this[EMITTED_END] } [MAYBE_EMIT_END] () { if (!this[EMITTING_END] && !this[EMITTED_END] && !this[DESTROYED] && this.buffer.length === 0 && this[EOF]) { this[EMITTING_END] = true this.emit('end') this.emit('prefinish') this.emit('finish') if (this[CLOSED]) this.emit('close') this[EMITTING_END] = false } } emit (ev, data) { // error and close are only events allowed after calling destroy() if (ev !== 'error' && ev !== 'close' && ev !== DESTROYED && this[DESTROYED]) return else if (ev === 'data') { if (!data) return if (this.pipes.length) this.pipes.forEach(p => p.dest.write(data) === false && this.pause()) } else if (ev === 'end') { // only actual end gets this treatment if (this[EMITTED_END] === true) return this[EMITTED_END] = true this.readable = false if (this[DECODER]) { data = this[DECODER].end() if (data) { this.pipes.forEach(p => p.dest.write(data)) super.emit('data', data) } } this.pipes.forEach(p => { p.dest.removeListener('drain', p.ondrain) if (p.opts.end) p.dest.end() }) } else if (ev === 'close') { this[CLOSED] = true // don't emit close before 'end' and 'finish' if (!this[EMITTED_END] && !this[DESTROYED]) return } else if (ev === 'error') { this[EMITTED_ERROR] = data } // TODO: replace with a spread operator when Node v4 support drops const args = new Array(arguments.length) args[0] = ev args[1] = data if (arguments.length > 2) { for (let i = 2; i < arguments.length; i++) { args[i] = arguments[i] } } try { return super.emit.apply(this, args) } finally { if (!isEndish(ev)) this[MAYBE_EMIT_END]() else this.removeAllListeners(ev) } } // const all = await stream.collect() collect () { const buf = [] if (!this[OBJECTMODE]) buf.dataLength = 0 // set the promise first, in case an error is raised // by triggering the flow here. const p = this.promise() this.on('data', c => { buf.push(c) if (!this[OBJECTMODE]) buf.dataLength += c.length }) return p.then(() => buf) } // const data = await stream.concat() concat () { return this[OBJECTMODE] ? Promise.reject(new Error('cannot concat in objectMode')) : this.collect().then(buf => this[OBJECTMODE] ? Promise.reject(new Error('cannot concat in objectMode')) : this[ENCODING] ? buf.join('') : Buffer.concat(buf, buf.dataLength)) } // stream.promise().then(() => done, er => emitted error) promise () { return new Promise((resolve, reject) => { this.on(DESTROYED, () => reject(new Error('stream destroyed'))) this.on('error', er => reject(er)) this.on('end', () => resolve()) }) } // for await (let chunk of stream) [ASYNCITERATOR] () { const next = () => { const res = this.read() if (res !== null) return Promise.resolve({ done: false, value: res }) if (this[EOF]) return Promise.resolve({ done: true }) let resolve = null let reject = null const onerr = er => { this.removeListener('data', ondata) this.removeListener('end', onend) reject(er) } const ondata = value => { this.removeListener('error', onerr) this.removeListener('end', onend) this.pause() resolve({ value: value, done: !!this[EOF] }) } const onend = () => { this.removeListener('error', onerr) this.removeListener('data', ondata) resolve({ done: true }) } const ondestroy = () => onerr(new Error('stream destroyed')) return new Promise((res, rej) => { reject = rej resolve = res this.once(DESTROYED, ondestroy) this.once('error', onerr) this.once('end', onend) this.once('data', ondata) }) } return { next } } // for (let chunk of stream) [ITERATOR] () { const next = () => { const value = this.read() const done = value === null return { value, done } } return { next } } destroy (er) { if (this[DESTROYED]) { if (er) this.emit('error', er) else this.emit(DESTROYED) return this } this[DESTROYED] = true // throw away all buffered data, it's never coming out this.buffer = new Yallist() this[BUFFERLENGTH] = 0 if (typeof this.close === 'function' && !this[CLOSED]) this.close() if (er) this.emit('error', er) else // if no error to emit, still reject pending promises this.emit(DESTROYED) return this } static isStream (s) { return !!s && (s instanceof Minipass || s instanceof Stream || s instanceof EE && ( typeof s.pipe === 'function' || // readable (typeof s.write === 'function' && typeof s.end === 'function') // writable )) } } The ISC License Copyright (c) npm, Inc. and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "minipass", "version": "3.1.6", "description": "minimal implementation of a PassThrough stream", "main": "index.js", "dependencies": { "yallist": "^4.0.0" }, "devDependencies": { "end-of-stream": "^1.4.0", "tap": "^15.0.9", "through2": "^2.0.3" }, "scripts": { "test": "tap", "preversion": "npm test", "postversion": "npm publish --tag=next", "postpublish": "git push origin --follow-tags" }, "repository": { "type": "git", "url": "git+https://github.com/isaacs/minipass.git" }, "keywords": [ "passthrough", "stream" ], "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "license": "ISC", "files": [ "index.js" ], "tap": { "check-coverage": true }, "engines": { "node": ">=8" } } const Minipass = require('minipass') const _flush = Symbol('_flush') const _flushed = Symbol('_flushed') const _flushing = Symbol('_flushing') class Flush extends Minipass { constructor (opt = {}) { if (typeof opt === 'function') opt = { flush: opt } super(opt) // or extend this class and provide a 'flush' method in your subclass if (typeof opt.flush !== 'function' && typeof this.flush !== 'function') throw new TypeError('must provide flush function in options') this[_flush] = opt.flush || this.flush } emit (ev, ...data) { if ((ev !== 'end' && ev !== 'finish') || this[_flushed]) return super.emit(ev, ...data) if (this[_flushing]) return this[_flushing] = true const afterFlush = er => { this[_flushed] = true er ? super.emit('error', er) : super.emit('end') } const ret = this[_flush](afterFlush) if (ret && ret.then) ret.then(() => afterFlush(), er => afterFlush(er)) } } module.exports = Flush The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "minipass-flush", "version": "1.0.5", "description": "A Minipass stream that calls a flush function before emitting 'end'", "author": "Isaac Z. Schlueter (https://izs.me)", "license": "ISC", "scripts": { "test": "tap", "snap": "tap", "preversion": "npm test", "postversion": "npm publish", "postpublish": "git push origin --follow-tags" }, "tap": { "check-coverage": true }, "devDependencies": { "tap": "^14.6.9" }, "dependencies": { "minipass": "^3.0.0" }, "files": [ "index.js" ], "main": "index.js", "repository": { "type": "git", "url": "git+https://github.com/isaacs/minipass-flush.git" }, "keywords": [ "minipass", "flush", "stream" ], "engines": { "node": ">= 8" } } const Minipass = require('minipass') const EE = require('events') const isStream = s => s && s instanceof EE && ( typeof s.pipe === 'function' || // readable (typeof s.write === 'function' && typeof s.end === 'function') // writable ) const _head = Symbol('_head') const _tail = Symbol('_tail') const _linkStreams = Symbol('_linkStreams') const _setHead = Symbol('_setHead') const _setTail = Symbol('_setTail') const _onError = Symbol('_onError') const _onData = Symbol('_onData') const _onEnd = Symbol('_onEnd') const _onDrain = Symbol('_onDrain') const _streams = Symbol('_streams') class Pipeline extends Minipass { constructor (opts, ...streams) { if (isStream(opts)) { streams.unshift(opts) opts = {} } super(opts) this[_streams] = [] if (streams.length) this.push(...streams) } [_linkStreams] (streams) { // reduce takes (left,right), and we return right to make it the // new left value. return streams.reduce((src, dest) => { src.on('error', er => dest.emit('error', er)) src.pipe(dest) return dest }) } push (...streams) { this[_streams].push(...streams) if (this[_tail]) streams.unshift(this[_tail]) const linkRet = this[_linkStreams](streams) this[_setTail](linkRet) if (!this[_head]) this[_setHead](streams[0]) } unshift (...streams) { this[_streams].unshift(...streams) if (this[_head]) streams.push(this[_head]) const linkRet = this[_linkStreams](streams) this[_setHead](streams[0]) if (!this[_tail]) this[_setTail](linkRet) } destroy (er) { // set fire to the whole thing. this[_streams].forEach(s => typeof s.destroy === 'function' && s.destroy()) return super.destroy(er) } // readable interface -> tail [_setTail] (stream) { this[_tail] = stream stream.on('error', er => this[_onError](stream, er)) stream.on('data', chunk => this[_onData](stream, chunk)) stream.on('end', () => this[_onEnd](stream)) stream.on('finish', () => this[_onEnd](stream)) } // errors proxied down the pipeline // they're considered part of the "read" interface [_onError] (stream, er) { if (stream === this[_tail]) this.emit('error', er) } [_onData] (stream, chunk) { if (stream === this[_tail]) super.write(chunk) } [_onEnd] (stream) { if (stream === this[_tail]) super.end() } pause () { super.pause() return this[_tail] && this[_tail].pause && this[_tail].pause() } // NB: Minipass calls its internal private [RESUME] method during // pipe drains, to avoid hazards where stream.resume() is overridden. // Thus, we need to listen to the resume *event*, not override the // resume() method, and proxy *that* to the tail. emit (ev, ...args) { if (ev === 'resume' && this[_tail] && this[_tail].resume) this[_tail].resume() return super.emit(ev, ...args) } // writable interface -> head [_setHead] (stream) { this[_head] = stream stream.on('drain', () => this[_onDrain](stream)) } [_onDrain] (stream) { if (stream === this[_head]) this.emit('drain') } write (chunk, enc, cb) { return this[_head].write(chunk, enc, cb) && (this.flowing || this.buffer.length === 0) } end (chunk, enc, cb) { this[_head].end(chunk, enc, cb) return this } } module.exports = Pipeline The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "minipass-pipeline", "version": "1.2.4", "description": "create a pipeline of streams using Minipass", "author": "Isaac Z. Schlueter (https://izs.me)", "license": "ISC", "scripts": { "test": "tap", "snap": "tap", "preversion": "npm test", "postversion": "npm publish", "postpublish": "git push origin --follow-tags" }, "tap": { "check-coverage": true }, "devDependencies": { "tap": "^14.6.9" }, "dependencies": { "minipass": "^3.0.0" }, "files": [ "index.js" ], "engines": { "node": ">=8" } } // Update with any zlib constants that are added or changed in the future. // Node v6 didn't export this, so we just hard code the version and rely // on all the other hard-coded values from zlib v4736. When node v6 // support drops, we can just export the realZlibConstants object. const realZlibConstants = require('zlib').constants || /* istanbul ignore next */ { ZLIB_VERNUM: 4736 } module.exports = Object.freeze(Object.assign(Object.create(null), { Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, Z_SYNC_FLUSH: 2, Z_FULL_FLUSH: 3, Z_FINISH: 4, Z_BLOCK: 5, Z_OK: 0, Z_STREAM_END: 1, Z_NEED_DICT: 2, Z_ERRNO: -1, Z_STREAM_ERROR: -2, Z_DATA_ERROR: -3, Z_MEM_ERROR: -4, Z_BUF_ERROR: -5, Z_VERSION_ERROR: -6, 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, DEFLATE: 1, INFLATE: 2, GZIP: 3, GUNZIP: 4, DEFLATERAW: 5, INFLATERAW: 6, UNZIP: 7, BROTLI_DECODE: 8, BROTLI_ENCODE: 9, Z_MIN_WINDOWBITS: 8, Z_MAX_WINDOWBITS: 15, Z_DEFAULT_WINDOWBITS: 15, Z_MIN_CHUNK: 64, Z_MAX_CHUNK: Infinity, Z_DEFAULT_CHUNK: 16384, Z_MIN_MEMLEVEL: 1, Z_MAX_MEMLEVEL: 9, Z_DEFAULT_MEMLEVEL: 8, Z_MIN_LEVEL: -1, Z_MAX_LEVEL: 9, Z_DEFAULT_LEVEL: -1, BROTLI_OPERATION_PROCESS: 0, BROTLI_OPERATION_FLUSH: 1, BROTLI_OPERATION_FINISH: 2, BROTLI_OPERATION_EMIT_METADATA: 3, BROTLI_MODE_GENERIC: 0, BROTLI_MODE_TEXT: 1, BROTLI_MODE_FONT: 2, BROTLI_DEFAULT_MODE: 0, BROTLI_MIN_QUALITY: 0, BROTLI_MAX_QUALITY: 11, BROTLI_DEFAULT_QUALITY: 11, BROTLI_MIN_WINDOW_BITS: 10, BROTLI_MAX_WINDOW_BITS: 24, BROTLI_LARGE_MAX_WINDOW_BITS: 30, BROTLI_DEFAULT_WINDOW: 22, BROTLI_MIN_INPUT_BLOCK_BITS: 16, BROTLI_MAX_INPUT_BLOCK_BITS: 24, BROTLI_PARAM_MODE: 0, BROTLI_PARAM_QUALITY: 1, BROTLI_PARAM_LGWIN: 2, BROTLI_PARAM_LGBLOCK: 3, BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: 4, BROTLI_PARAM_SIZE_HINT: 5, BROTLI_PARAM_LARGE_WINDOW: 6, BROTLI_PARAM_NPOSTFIX: 7, BROTLI_PARAM_NDIRECT: 8, BROTLI_DECODER_RESULT_ERROR: 0, BROTLI_DECODER_RESULT_SUCCESS: 1, BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: 2, BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: 3, BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: 0, BROTLI_DECODER_PARAM_LARGE_WINDOW: 1, BROTLI_DECODER_NO_ERROR: 0, BROTLI_DECODER_SUCCESS: 1, BROTLI_DECODER_NEEDS_MORE_INPUT: 2, BROTLI_DECODER_NEEDS_MORE_OUTPUT: 3, BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: -1, BROTLI_DECODER_ERROR_FORMAT_RESERVED: -2, BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: -3, BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: -4, BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: -5, BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: -6, BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: -7, BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: -8, BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: -9, BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: -10, BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: -11, BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: -12, BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: -13, BROTLI_DECODER_ERROR_FORMAT_PADDING_1: -14, BROTLI_DECODER_ERROR_FORMAT_PADDING_2: -15, BROTLI_DECODER_ERROR_FORMAT_DISTANCE: -16, BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: -19, BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: -20, BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: -21, BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: -22, BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: -25, BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: -26, BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: -27, BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: -30, BROTLI_DECODER_ERROR_UNREACHABLE: -31, }, realZlibConstants)) 'use strict' const assert = require('assert') const Buffer = require('buffer').Buffer const realZlib = require('zlib') const constants = exports.constants = require('./constants.js') const Minipass = require('minipass') const OriginalBufferConcat = Buffer.concat const _superWrite = Symbol('_superWrite') class ZlibError extends Error { constructor (err) { super('zlib: ' + err.message) this.code = err.code this.errno = err.errno /* istanbul ignore if */ if (!this.code) this.code = 'ZLIB_ERROR' this.message = 'zlib: ' + err.message Error.captureStackTrace(this, this.constructor) } get name () { return 'ZlibError' } } // the Zlib class they all inherit from // This thing manages the queue of requests, and returns // true or false if there is anything in the queue when // you call the .write() method. const _opts = Symbol('opts') const _flushFlag = Symbol('flushFlag') const _finishFlushFlag = Symbol('finishFlushFlag') const _fullFlushFlag = Symbol('fullFlushFlag') const _handle = Symbol('handle') const _onError = Symbol('onError') const _sawError = Symbol('sawError') const _level = Symbol('level') const _strategy = Symbol('strategy') const _ended = Symbol('ended') const _defaultFullFlush = Symbol('_defaultFullFlush') class ZlibBase extends Minipass { constructor (opts, mode) { if (!opts || typeof opts !== 'object') throw new TypeError('invalid options for ZlibBase constructor') super(opts) this[_sawError] = false this[_ended] = false this[_opts] = opts this[_flushFlag] = opts.flush this[_finishFlushFlag] = opts.finishFlush // this will throw if any options are invalid for the class selected try { this[_handle] = new realZlib[mode](opts) } catch (er) { // make sure that all errors get decorated properly throw new ZlibError(er) } this[_onError] = (err) => { // no sense raising multiple errors, since we abort on the first one. if (this[_sawError]) return this[_sawError] = true // there is no way to cleanly recover. // continuing only obscures problems. this.close() this.emit('error', err) } this[_handle].on('error', er => this[_onError](new ZlibError(er))) this.once('end', () => this.close) } close () { if (this[_handle]) { this[_handle].close() this[_handle] = null this.emit('close') } } reset () { if (!this[_sawError]) { assert(this[_handle], 'zlib binding closed') return this[_handle].reset() } } flush (flushFlag) { if (this.ended) return if (typeof flushFlag !== 'number') flushFlag = this[_fullFlushFlag] this.write(Object.assign(Buffer.alloc(0), { [_flushFlag]: flushFlag })) } end (chunk, encoding, cb) { if (chunk) this.write(chunk, encoding) this.flush(this[_finishFlushFlag]) this[_ended] = true return super.end(null, null, cb) } get ended () { return this[_ended] } write (chunk, encoding, cb) { // process the chunk using the sync process // then super.write() all the outputted chunks if (typeof encoding === 'function') cb = encoding, encoding = 'utf8' if (typeof chunk === 'string') chunk = Buffer.from(chunk, encoding) if (this[_sawError]) return assert(this[_handle], 'zlib binding closed') // _processChunk tries to .close() the native handle after it's done, so we // intercept that by temporarily making it a no-op. const nativeHandle = this[_handle]._handle const originalNativeClose = nativeHandle.close nativeHandle.close = () => {} const originalClose = this[_handle].close this[_handle].close = () => {} // It also calls `Buffer.concat()` at the end, which may be convenient // for some, but which we are not interested in as it slows us down. Buffer.concat = (args) => args let result try { const flushFlag = typeof chunk[_flushFlag] === 'number' ? chunk[_flushFlag] : this[_flushFlag] result = this[_handle]._processChunk(chunk, flushFlag) // if we don't throw, reset it back how it was Buffer.concat = OriginalBufferConcat } catch (err) { // or if we do, put Buffer.concat() back before we emit error // Error events call into user code, which may call Buffer.concat() Buffer.concat = OriginalBufferConcat this[_onError](new ZlibError(err)) } finally { if (this[_handle]) { // Core zlib resets `_handle` to null after attempting to close the // native handle. Our no-op handler prevented actual closure, but we // need to restore the `._handle` property. this[_handle]._handle = nativeHandle nativeHandle.close = originalNativeClose this[_handle].close = originalClose // `_processChunk()` adds an 'error' listener. If we don't remove it // after each call, these handlers start piling up. this[_handle].removeAllListeners('error') // make sure OUR error listener is still attached tho } } if (this[_handle]) this[_handle].on('error', er => this[_onError](new ZlibError(er))) let writeReturn if (result) { if (Array.isArray(result) && result.length > 0) { // The first buffer is always `handle._outBuffer`, which would be // re-used for later invocations; so, we always have to copy that one. writeReturn = this[_superWrite](Buffer.from(result[0])) for (let i = 1; i < result.length; i++) { writeReturn = this[_superWrite](result[i]) } } else { writeReturn = this[_superWrite](Buffer.from(result)) } } if (cb) cb() return writeReturn } [_superWrite] (data) { return super.write(data) } } class Zlib extends ZlibBase { constructor (opts, mode) { opts = opts || {} opts.flush = opts.flush || constants.Z_NO_FLUSH opts.finishFlush = opts.finishFlush || constants.Z_FINISH super(opts, mode) this[_fullFlushFlag] = constants.Z_FULL_FLUSH this[_level] = opts.level this[_strategy] = opts.strategy } params (level, strategy) { if (this[_sawError]) return if (!this[_handle]) throw new Error('cannot switch params when binding is closed') // no way to test this without also not supporting params at all /* istanbul ignore if */ if (!this[_handle].params) throw new Error('not supported in this implementation') if (this[_level] !== level || this[_strategy] !== strategy) { this.flush(constants.Z_SYNC_FLUSH) assert(this[_handle], 'zlib binding closed') // .params() calls .flush(), but the latter is always async in the // core zlib. We override .flush() temporarily to intercept that and // flush synchronously. const origFlush = this[_handle].flush this[_handle].flush = (flushFlag, cb) => { this.flush(flushFlag) cb() } try { this[_handle].params(level, strategy) } finally { this[_handle].flush = origFlush } /* istanbul ignore else */ if (this[_handle]) { this[_level] = level this[_strategy] = strategy } } } } // minimal 2-byte header class Deflate extends Zlib { constructor (opts) { super(opts, 'Deflate') } } class Inflate extends Zlib { constructor (opts) { super(opts, 'Inflate') } } // gzip - bigger header, same deflate compression const _portable = Symbol('_portable') class Gzip extends Zlib { constructor (opts) { super(opts, 'Gzip') this[_portable] = opts && !!opts.portable } [_superWrite] (data) { if (!this[_portable]) return super[_superWrite](data) // we'll always get the header emitted in one first chunk // overwrite the OS indicator byte with 0xFF this[_portable] = false data[9] = 255 return super[_superWrite](data) } } class Gunzip extends Zlib { constructor (opts) { super(opts, 'Gunzip') } } // raw - no header class DeflateRaw extends Zlib { constructor (opts) { super(opts, 'DeflateRaw') } } class InflateRaw extends Zlib { constructor (opts) { super(opts, 'InflateRaw') } } // auto-detect header. class Unzip extends Zlib { constructor (opts) { super(opts, 'Unzip') } } class Brotli extends ZlibBase { constructor (opts, mode) { opts = opts || {} opts.flush = opts.flush || constants.BROTLI_OPERATION_PROCESS opts.finishFlush = opts.finishFlush || constants.BROTLI_OPERATION_FINISH super(opts, mode) this[_fullFlushFlag] = constants.BROTLI_OPERATION_FLUSH } } class BrotliCompress extends Brotli { constructor (opts) { super(opts, 'BrotliCompress') } } class BrotliDecompress extends Brotli { constructor (opts) { super(opts, 'BrotliDecompress') } } exports.Deflate = Deflate exports.Inflate = Inflate exports.Gzip = Gzip exports.Gunzip = Gunzip exports.DeflateRaw = DeflateRaw exports.InflateRaw = InflateRaw exports.Unzip = Unzip /* istanbul ignore else */ if (typeof realZlib.BrotliCompress === 'function') { exports.BrotliCompress = BrotliCompress exports.BrotliDecompress = BrotliDecompress } else { exports.BrotliCompress = exports.BrotliDecompress = class { constructor () { throw new Error('Brotli is not supported in this version of Node.js') } } } Minizlib was created by Isaac Z. Schlueter. It is a derivative work of the Node.js project. """ Copyright Isaac Z. Schlueter and Contributors Copyright Node.js contributors. All rights reserved. Copyright Joyent, Inc. and other Node contributors. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ { "name": "minizlib", "version": "2.1.2", "description": "A small fast zlib stream built on [minipass](http://npm.im/minipass) and Node.js's zlib binding.", "main": "index.js", "dependencies": { "minipass": "^3.0.0", "yallist": "^4.0.0" }, "scripts": { "test": "tap test/*.js --100 -J", "preversion": "npm test", "postversion": "npm publish", "postpublish": "git push origin --all; git push origin --tags" }, "repository": { "type": "git", "url": "git+https://github.com/isaacs/minizlib.git" }, "keywords": [ "zlib", "gzip", "gunzip", "deflate", "inflate", "compression", "zip", "unzip" ], "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "license": "MIT", "devDependencies": { "tap": "^14.6.9" }, "files": [ "index.js", "constants.js" ], "engines": { "node": ">= 8" } } 0.6.2 / 2019-04-29 ================== * Fix sorting charset, encoding, and language with extra parameters 0.6.1 / 2016-05-02 ================== * perf: improve `Accept` parsing speed * perf: improve `Accept-Charset` parsing speed * perf: improve `Accept-Encoding` parsing speed * perf: improve `Accept-Language` parsing speed 0.6.0 / 2015-09-29 ================== * Fix including type extensions in parameters in `Accept` parsing * Fix parsing `Accept` parameters with quoted equals * Fix parsing `Accept` parameters with quoted semicolons * Lazy-load modules from main entry point * perf: delay type concatenation until needed * perf: enable strict mode * perf: hoist regular expressions * perf: remove closures getting spec properties * perf: remove a closure from media type parsing * perf: remove property delete from media type parsing 0.5.3 / 2015-05-10 ================== * Fix media type parameter matching to be case-insensitive 0.5.2 / 2015-05-06 ================== * Fix comparing media types with quoted values * Fix splitting media types with quoted commas 0.5.1 / 2015-02-14 ================== * Fix preference sorting to be stable for long acceptable lists 0.5.0 / 2014-12-18 ================== * Fix list return order when large accepted list * Fix missing identity encoding when q=0 exists * Remove dynamic building of Negotiator class 0.4.9 / 2014-10-14 ================== * Fix error when media type has invalid parameter 0.4.8 / 2014-09-28 ================== * Fix all negotiations to be case-insensitive * Stable sort preferences of same quality according to client order * Support Node.js 0.6 0.4.7 / 2014-06-24 ================== * Handle invalid provided languages * Handle invalid provided media types 0.4.6 / 2014-06-11 ================== * Order by specificity when quality is the same 0.4.5 / 2014-05-29 ================== * Fix regression in empty header handling 0.4.4 / 2014-05-29 ================== * Fix behaviors when headers are not present 0.4.3 / 2014-04-16 ================== * Handle slashes on media params correctly 0.4.2 / 2014-02-28 ================== * Fix media type sorting * Handle media types params strictly 0.4.1 / 2014-01-16 ================== * Use most specific matches 0.4.0 / 2014-01-09 ================== * Remove preferred prefix from methods /*! * negotiator * Copyright(c) 2012 Federico Romero * Copyright(c) 2012-2014 Isaac Z. Schlueter * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ 'use strict'; /** * Cached loaded submodules. * @private */ var modules = Object.create(null); /** * Module exports. * @public */ module.exports = Negotiator; module.exports.Negotiator = Negotiator; /** * Create a Negotiator instance from a request. * @param {object} request * @public */ function Negotiator(request) { if (!(this instanceof Negotiator)) { return new Negotiator(request); } this.request = request; } Negotiator.prototype.charset = function charset(available) { var set = this.charsets(available); return set && set[0]; }; Negotiator.prototype.charsets = function charsets(available) { var preferredCharsets = loadModule('charset').preferredCharsets; return preferredCharsets(this.request.headers['accept-charset'], available); }; Negotiator.prototype.encoding = function encoding(available) { var set = this.encodings(available); return set && set[0]; }; Negotiator.prototype.encodings = function encodings(available) { var preferredEncodings = loadModule('encoding').preferredEncodings; return preferredEncodings(this.request.headers['accept-encoding'], available); }; Negotiator.prototype.language = function language(available) { var set = this.languages(available); return set && set[0]; }; Negotiator.prototype.languages = function languages(available) { var preferredLanguages = loadModule('language').preferredLanguages; return preferredLanguages(this.request.headers['accept-language'], available); }; Negotiator.prototype.mediaType = function mediaType(available) { var set = this.mediaTypes(available); return set && set[0]; }; Negotiator.prototype.mediaTypes = function mediaTypes(available) { var preferredMediaTypes = loadModule('mediaType').preferredMediaTypes; return preferredMediaTypes(this.request.headers.accept, available); }; // Backwards compatibility Negotiator.prototype.preferredCharset = Negotiator.prototype.charset; Negotiator.prototype.preferredCharsets = Negotiator.prototype.charsets; Negotiator.prototype.preferredEncoding = Negotiator.prototype.encoding; Negotiator.prototype.preferredEncodings = Negotiator.prototype.encodings; Negotiator.prototype.preferredLanguage = Negotiator.prototype.language; Negotiator.prototype.preferredLanguages = Negotiator.prototype.languages; Negotiator.prototype.preferredMediaType = Negotiator.prototype.mediaType; Negotiator.prototype.preferredMediaTypes = Negotiator.prototype.mediaTypes; /** * Load the given module. * @private */ function loadModule(moduleName) { var module = modules[moduleName]; if (module !== undefined) { return module; } // This uses a switch for static require analysis switch (moduleName) { case 'charset': module = require('./lib/charset'); break; case 'encoding': module = require('./lib/encoding'); break; case 'language': module = require('./lib/language'); break; case 'mediaType': module = require('./lib/mediaType'); break; default: throw new Error('Cannot find module \'' + moduleName + '\''); } // Store to prevent invoking require() modules[moduleName] = module; return module; } (The MIT License) Copyright (c) 2012-2014 Federico Romero Copyright (c) 2012-2014 Isaac Z. Schlueter Copyright (c) 2014-2015 Douglas Christopher Wilson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "negotiator", "description": "HTTP content negotiation", "version": "0.6.2", "contributors": [ "Douglas Christopher Wilson ", "Federico Romero ", "Isaac Z. Schlueter (http://blog.izs.me/)" ], "license": "MIT", "keywords": [ "http", "content negotiation", "accept", "accept-language", "accept-encoding", "accept-charset" ], "repository": "jshttp/negotiator", "devDependencies": { "eslint": "5.16.0", "eslint-plugin-markdown": "1.0.0", "mocha": "6.1.4", "nyc": "14.0.0" }, "files": [ "lib/", "HISTORY.md", "LICENSE", "index.js", "README.md" ], "engines": { "node": ">= 0.6" }, "scripts": { "lint": "eslint --plugin markdown --ext js,md .", "test": "mocha --reporter spec --check-leaks --bail test/", "test-cov": "nyc --reporter=html --reporter=text npm test", "test-travis": "nyc --reporter=text npm test" } } /** * negotiator * Copyright(c) 2012 Isaac Z. Schlueter * Copyright(c) 2014 Federico Romero * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ 'use strict'; /** * Module exports. * @public */ module.exports = preferredCharsets; module.exports.preferredCharsets = preferredCharsets; /** * Module variables. * @private */ var simpleCharsetRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/; /** * Parse the Accept-Charset header. * @private */ function parseAcceptCharset(accept) { var accepts = accept.split(','); for (var i = 0, j = 0; i < accepts.length; i++) { var charset = parseCharset(accepts[i].trim(), i); if (charset) { accepts[j++] = charset; } } // trim accepts accepts.length = j; return accepts; } /** * Parse a charset from the Accept-Charset header. * @private */ function parseCharset(str, i) { var match = simpleCharsetRegExp.exec(str); if (!match) return null; var charset = match[1]; var q = 1; if (match[2]) { var params = match[2].split(';') for (var j = 0; j < params.length; j++) { var p = params[j].trim().split('='); if (p[0] === 'q') { q = parseFloat(p[1]); break; } } } return { charset: charset, q: q, i: i }; } /** * Get the priority of a charset. * @private */ function getCharsetPriority(charset, accepted, index) { var priority = {o: -1, q: 0, s: 0}; for (var i = 0; i < accepted.length; i++) { var spec = specify(charset, accepted[i], index); if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { priority = spec; } } return priority; } /** * Get the specificity of the charset. * @private */ function specify(charset, spec, index) { var s = 0; if(spec.charset.toLowerCase() === charset.toLowerCase()){ s |= 1; } else if (spec.charset !== '*' ) { return null } return { i: index, o: spec.i, q: spec.q, s: s } } /** * Get the preferred charsets from an Accept-Charset header. * @public */ function preferredCharsets(accept, provided) { // RFC 2616 sec 14.2: no header = * var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || ''); if (!provided) { // sorted list of all charsets return accepts .filter(isQuality) .sort(compareSpecs) .map(getFullCharset); } var priorities = provided.map(function getPriority(type, index) { return getCharsetPriority(type, accepts, index); }); // sorted list of accepted charsets return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) { return provided[priorities.indexOf(priority)]; }); } /** * Compare two specs. * @private */ function compareSpecs(a, b) { return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; } /** * Get full charset string. * @private */ function getFullCharset(spec) { return spec.charset; } /** * Check if a spec has any quality. * @private */ function isQuality(spec) { return spec.q > 0; } /** * negotiator * Copyright(c) 2012 Isaac Z. Schlueter * Copyright(c) 2014 Federico Romero * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ 'use strict'; /** * Module exports. * @public */ module.exports = preferredEncodings; module.exports.preferredEncodings = preferredEncodings; /** * Module variables. * @private */ var simpleEncodingRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/; /** * Parse the Accept-Encoding header. * @private */ function parseAcceptEncoding(accept) { var accepts = accept.split(','); var hasIdentity = false; var minQuality = 1; for (var i = 0, j = 0; i < accepts.length; i++) { var encoding = parseEncoding(accepts[i].trim(), i); if (encoding) { accepts[j++] = encoding; hasIdentity = hasIdentity || specify('identity', encoding); minQuality = Math.min(minQuality, encoding.q || 1); } } if (!hasIdentity) { /* * If identity doesn't explicitly appear in the accept-encoding header, * it's added to the list of acceptable encoding with the lowest q */ accepts[j++] = { encoding: 'identity', q: minQuality, i: i }; } // trim accepts accepts.length = j; return accepts; } /** * Parse an encoding from the Accept-Encoding header. * @private */ function parseEncoding(str, i) { var match = simpleEncodingRegExp.exec(str); if (!match) return null; var encoding = match[1]; var q = 1; if (match[2]) { var params = match[2].split(';'); for (var j = 0; j < params.length; j++) { var p = params[j].trim().split('='); if (p[0] === 'q') { q = parseFloat(p[1]); break; } } } return { encoding: encoding, q: q, i: i }; } /** * Get the priority of an encoding. * @private */ function getEncodingPriority(encoding, accepted, index) { var priority = {o: -1, q: 0, s: 0}; for (var i = 0; i < accepted.length; i++) { var spec = specify(encoding, accepted[i], index); if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { priority = spec; } } return priority; } /** * Get the specificity of the encoding. * @private */ function specify(encoding, spec, index) { var s = 0; if(spec.encoding.toLowerCase() === encoding.toLowerCase()){ s |= 1; } else if (spec.encoding !== '*' ) { return null } return { i: index, o: spec.i, q: spec.q, s: s } }; /** * Get the preferred encodings from an Accept-Encoding header. * @public */ function preferredEncodings(accept, provided) { var accepts = parseAcceptEncoding(accept || ''); if (!provided) { // sorted list of all encodings return accepts .filter(isQuality) .sort(compareSpecs) .map(getFullEncoding); } var priorities = provided.map(function getPriority(type, index) { return getEncodingPriority(type, accepts, index); }); // sorted list of accepted encodings return priorities.filter(isQuality).sort(compareSpecs).map(function getEncoding(priority) { return provided[priorities.indexOf(priority)]; }); } /** * Compare two specs. * @private */ function compareSpecs(a, b) { return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; } /** * Get full encoding string. * @private */ function getFullEncoding(spec) { return spec.encoding; } /** * Check if a spec has any quality. * @private */ function isQuality(spec) { return spec.q > 0; } /** * negotiator * Copyright(c) 2012 Isaac Z. Schlueter * Copyright(c) 2014 Federico Romero * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ 'use strict'; /** * Module exports. * @public */ module.exports = preferredLanguages; module.exports.preferredLanguages = preferredLanguages; /** * Module variables. * @private */ var simpleLanguageRegExp = /^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/; /** * Parse the Accept-Language header. * @private */ function parseAcceptLanguage(accept) { var accepts = accept.split(','); for (var i = 0, j = 0; i < accepts.length; i++) { var language = parseLanguage(accepts[i].trim(), i); if (language) { accepts[j++] = language; } } // trim accepts accepts.length = j; return accepts; } /** * Parse a language from the Accept-Language header. * @private */ function parseLanguage(str, i) { var match = simpleLanguageRegExp.exec(str); if (!match) return null; var prefix = match[1], suffix = match[2], full = prefix; if (suffix) full += "-" + suffix; var q = 1; if (match[3]) { var params = match[3].split(';') for (var j = 0; j < params.length; j++) { var p = params[j].split('='); if (p[0] === 'q') q = parseFloat(p[1]); } } return { prefix: prefix, suffix: suffix, q: q, i: i, full: full }; } /** * Get the priority of a language. * @private */ function getLanguagePriority(language, accepted, index) { var priority = {o: -1, q: 0, s: 0}; for (var i = 0; i < accepted.length; i++) { var spec = specify(language, accepted[i], index); if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { priority = spec; } } return priority; } /** * Get the specificity of the language. * @private */ function specify(language, spec, index) { var p = parseLanguage(language) if (!p) return null; var s = 0; if(spec.full.toLowerCase() === p.full.toLowerCase()){ s |= 4; } else if (spec.prefix.toLowerCase() === p.full.toLowerCase()) { s |= 2; } else if (spec.full.toLowerCase() === p.prefix.toLowerCase()) { s |= 1; } else if (spec.full !== '*' ) { return null } return { i: index, o: spec.i, q: spec.q, s: s } }; /** * Get the preferred languages from an Accept-Language header. * @public */ function preferredLanguages(accept, provided) { // RFC 2616 sec 14.4: no header = * var accepts = parseAcceptLanguage(accept === undefined ? '*' : accept || ''); if (!provided) { // sorted list of all languages return accepts .filter(isQuality) .sort(compareSpecs) .map(getFullLanguage); } var priorities = provided.map(function getPriority(type, index) { return getLanguagePriority(type, accepts, index); }); // sorted list of accepted languages return priorities.filter(isQuality).sort(compareSpecs).map(function getLanguage(priority) { return provided[priorities.indexOf(priority)]; }); } /** * Compare two specs. * @private */ function compareSpecs(a, b) { return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; } /** * Get full language string. * @private */ function getFullLanguage(spec) { return spec.full; } /** * Check if a spec has any quality. * @private */ function isQuality(spec) { return spec.q > 0; } /** * negotiator * Copyright(c) 2012 Isaac Z. Schlueter * Copyright(c) 2014 Federico Romero * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ 'use strict'; /** * Module exports. * @public */ module.exports = preferredMediaTypes; module.exports.preferredMediaTypes = preferredMediaTypes; /** * Module variables. * @private */ var simpleMediaTypeRegExp = /^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/; /** * Parse the Accept header. * @private */ function parseAccept(accept) { var accepts = splitMediaTypes(accept); for (var i = 0, j = 0; i < accepts.length; i++) { var mediaType = parseMediaType(accepts[i].trim(), i); if (mediaType) { accepts[j++] = mediaType; } } // trim accepts accepts.length = j; return accepts; } /** * Parse a media type from the Accept header. * @private */ function parseMediaType(str, i) { var match = simpleMediaTypeRegExp.exec(str); if (!match) return null; var params = Object.create(null); var q = 1; var subtype = match[2]; var type = match[1]; if (match[3]) { var kvps = splitParameters(match[3]).map(splitKeyValuePair); for (var j = 0; j < kvps.length; j++) { var pair = kvps[j]; var key = pair[0].toLowerCase(); var val = pair[1]; // get the value, unwrapping quotes var value = val && val[0] === '"' && val[val.length - 1] === '"' ? val.substr(1, val.length - 2) : val; if (key === 'q') { q = parseFloat(value); break; } // store parameter params[key] = value; } } return { type: type, subtype: subtype, params: params, q: q, i: i }; } /** * Get the priority of a media type. * @private */ function getMediaTypePriority(type, accepted, index) { var priority = {o: -1, q: 0, s: 0}; for (var i = 0; i < accepted.length; i++) { var spec = specify(type, accepted[i], index); if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { priority = spec; } } return priority; } /** * Get the specificity of the media type. * @private */ function specify(type, spec, index) { var p = parseMediaType(type); var s = 0; if (!p) { return null; } if(spec.type.toLowerCase() == p.type.toLowerCase()) { s |= 4 } else if(spec.type != '*') { return null; } if(spec.subtype.toLowerCase() == p.subtype.toLowerCase()) { s |= 2 } else if(spec.subtype != '*') { return null; } var keys = Object.keys(spec.params); if (keys.length > 0) { if (keys.every(function (k) { return spec.params[k] == '*' || (spec.params[k] || '').toLowerCase() == (p.params[k] || '').toLowerCase(); })) { s |= 1 } else { return null } } return { i: index, o: spec.i, q: spec.q, s: s, } } /** * Get the preferred media types from an Accept header. * @public */ function preferredMediaTypes(accept, provided) { // RFC 2616 sec 14.2: no header = */* var accepts = parseAccept(accept === undefined ? '*/*' : accept || ''); if (!provided) { // sorted list of all types return accepts .filter(isQuality) .sort(compareSpecs) .map(getFullType); } var priorities = provided.map(function getPriority(type, index) { return getMediaTypePriority(type, accepts, index); }); // sorted list of accepted types return priorities.filter(isQuality).sort(compareSpecs).map(function getType(priority) { return provided[priorities.indexOf(priority)]; }); } /** * Compare two specs. * @private */ function compareSpecs(a, b) { return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; } /** * Get full type string. * @private */ function getFullType(spec) { return spec.type + '/' + spec.subtype; } /** * Check if a spec has any quality. * @private */ function isQuality(spec) { return spec.q > 0; } /** * Count the number of quotes in a string. * @private */ function quoteCount(string) { var count = 0; var index = 0; while ((index = string.indexOf('"', index)) !== -1) { count++; index++; } return count; } /** * Split a key value pair. * @private */ function splitKeyValuePair(str) { var index = str.indexOf('='); var key; var val; if (index === -1) { key = str; } else { key = str.substr(0, index); val = str.substr(index + 1); } return [key, val]; } /** * Split an Accept header into media types. * @private */ function splitMediaTypes(accept) { var accepts = accept.split(','); for (var i = 1, j = 0; i < accepts.length; i++) { if (quoteCount(accepts[j]) % 2 == 0) { accepts[++j] = accepts[i]; } else { accepts[j] += ',' + accepts[i]; } } // trim accepts accepts.length = j + 1; return accepts; } /** * Split a string of parameters. * @private */ function splitParameters(str) { var parameters = str.split(';'); for (var i = 1, j = 0; i < parameters.length; i++) { if (quoteCount(parameters[j]) % 2 == 0) { parameters[++j] = parameters[i]; } else { parameters[j] += ';' + parameters[i]; } } // trim parameters parameters.length = j + 1; for (var i = 0; i < parameters.length; i++) { parameters[i] = parameters[i].trim(); } return parameters; } The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. var wrappy = require('wrappy') module.exports = wrappy(once) module.exports.strict = wrappy(onceStrict) once.proto = once(function () { Object.defineProperty(Function.prototype, 'once', { value: function () { return once(this) }, configurable: true }) Object.defineProperty(Function.prototype, 'onceStrict', { value: function () { return onceStrict(this) }, configurable: true }) }) function once (fn) { var f = function () { if (f.called) return f.value f.called = true return f.value = fn.apply(this, arguments) } f.called = false return f } function onceStrict (fn) { var f = function () { if (f.called) throw new Error(f.onceError) f.called = true return f.value = fn.apply(this, arguments) } var name = fn.name || 'Function wrapped with `once`' f.onceError = name + " shouldn't be called more than once" f.called = false return f } { "name": "once", "version": "1.4.0", "description": "Run a function exactly one time", "main": "once.js", "directories": { "test": "test" }, "dependencies": { "wrappy": "1" }, "devDependencies": { "tap": "^7.0.1" }, "scripts": { "test": "tap test/*.js" }, "files": [ "once.js" ], "repository": { "type": "git", "url": "git://github.com/isaacs/once" }, "keywords": [ "once", "function", "one", "single" ], "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "license": "ISC" } 'use strict'; function posix(path) { return path.charAt(0) === '/'; } function win32(path) { // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; var result = splitDeviceRe.exec(path); var device = result[1] || ''; var isUnc = Boolean(device && device.charAt(1) !== ':'); // UNC paths are always absolute return Boolean(result[2] || isUnc); } module.exports = process.platform === 'win32' ? win32 : posix; module.exports.posix = posix; module.exports.win32 = win32; The MIT License (MIT) Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "path-is-absolute", "version": "1.0.1", "description": "Node.js 0.12 path.isAbsolute() ponyfill", "license": "MIT", "repository": "sindresorhus/path-is-absolute", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=0.10.0" }, "scripts": { "test": "xo && node test.js" }, "files": [ "index.js" ], "keywords": [ "path", "paths", "file", "dir", "absolute", "isabsolute", "is-absolute", "built-in", "util", "utils", "core", "ponyfill", "polyfill", "shim", "is", "detect", "check" ], "devDependencies": { "xo": "^0.16.0" } } 'use strict'; var errcode = require('err-code'); var retry = require('retry'); var hasOwn = Object.prototype.hasOwnProperty; function isRetryError(err) { return err && err.code === 'EPROMISERETRY' && hasOwn.call(err, 'retried'); } function promiseRetry(fn, options) { var temp; var operation; if (typeof fn === 'object' && typeof options === 'function') { // Swap options and fn when using alternate signature (options, fn) temp = options; options = fn; fn = temp; } operation = retry.operation(options); return new Promise(function (resolve, reject) { operation.attempt(function (number) { Promise.resolve() .then(function () { return fn(function (err) { if (isRetryError(err)) { err = err.retried; } throw errcode(new Error('Retrying'), 'EPROMISERETRY', { retried: err }); }, number); }) .then(resolve, function (err) { if (isRetryError(err)) { err = err.retried; if (operation.retry(err || new Error())) { return; } } reject(err); }); }); }); } module.exports = promiseRetry; Copyright (c) 2014 IndigoUnited Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "promise-retry", "version": "2.0.1", "description": "Retries a function that returns a promise, leveraging the power of the retry module.", "main": "index.js", "scripts": { "test": "mocha --bail -t 10000" }, "bugs": { "url": "https://github.com/IndigoUnited/node-promise-retry/issues/" }, "repository": { "type": "git", "url": "git://github.com/IndigoUnited/node-promise-retry.git" }, "keywords": [ "retry", "promise", "backoff", "repeat", "replay" ], "author": "IndigoUnited (http://indigounited.com)", "license": "MIT", "devDependencies": { "expect.js": "^0.3.1", "mocha": "^8.0.1", "sleep-promise": "^8.0.1" }, "dependencies": { "err-code": "^2.0.2", "retry": "^0.12.0" }, "engines": { "node": ">=10" } } module.exports = function (blocking) { [process.stdout, process.stderr].forEach(function (stream) { if (stream._handle && stream.isTTY && typeof stream._handle.setBlocking === 'function') { stream._handle.setBlocking(blocking) } }) } Copyright (c) 2016, Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "set-blocking", "version": "2.0.0", "description": "set blocking stdio and stderr ensuring that terminal output does not truncate", "main": "index.js", "scripts": { "pretest": "standard", "test": "nyc mocha ./test/*.js", "coverage": "nyc report --reporter=text-lcov | coveralls", "version": "standard-version" }, "repository": { "type": "git", "url": "git+https://github.com/yargs/set-blocking.git" }, "keywords": [ "flush", "terminal", "blocking", "shim", "stdio", "stderr" ], "author": "Ben Coe ", "license": "ISC", "bugs": { "url": "https://github.com/yargs/set-blocking/issues" }, "homepage": "https://github.com/yargs/set-blocking#readme", "devDependencies": { "chai": "^3.5.0", "coveralls": "^2.11.9", "mocha": "^2.4.5", "nyc": "^6.4.4", "standard": "^7.0.1", "standard-version": "^2.2.1" }, "files": [ "index.js", "LICENSE.txt" ] }/*! simple-concat. MIT License. Feross Aboukhadijeh */ module.exports = function (stream, cb) { var chunks = [] stream.on('data', function (chunk) { chunks.push(chunk) }) stream.once('end', function () { if (cb) cb(null, Buffer.concat(chunks)) cb = null }) stream.once('error', function (err) { if (cb) cb(err) cb = null }) } The MIT License (MIT) Copyright (c) Feross Aboukhadijeh Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "simple-concat", "description": "Super-minimalist version of `concat-stream`. Less than 15 lines!", "version": "1.0.1", "author": { "name": "Feross Aboukhadijeh", "email": "feross@feross.org", "url": "https://feross.org" }, "bugs": { "url": "https://github.com/feross/simple-concat/issues" }, "dependencies": {}, "devDependencies": { "standard": "*", "tape": "^5.0.1" }, "homepage": "https://github.com/feross/simple-concat", "keywords": [ "concat", "concat-stream", "concat stream" ], "license": "MIT", "main": "index.js", "repository": { "type": "git", "url": "git://github.com/feross/simple-concat.git" }, "scripts": { "test": "standard && tape test/*.js" }, "funding": [ { "type": "github", "url": "https://github.com/sponsors/feross" }, { "type": "patreon", "url": "https://www.patreon.com/feross" }, { "type": "consulting", "url": "https://feross.org/support" } ] } The MIT License (MIT) Copyright (c) 2013-2017 Josh Glazebrook Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "smart-buffer", "version": "4.1.0", "description": "smart-buffer is a Buffer wrapper that adds automatic read & write offset tracking, string operations, data insertions, and more.", "main": "build/smartbuffer.js", "homepage": "https://github.com/JoshGlazebrook/smart-buffer/", "repository": { "type": "git", "url": "https://github.com/JoshGlazebrook/smart-buffer.git" }, "bugs": { "url": "https://github.com/JoshGlazebrook/smart-buffer/issues" }, "keywords": [ "buffer", "smart", "packet", "serialize", "network", "cursor", "simple" ], "engines": { "node": ">= 6.0.0", "npm": ">= 3.0.0" }, "author": "Josh Glazebrook", "license": "MIT", "readmeFilename": "README.md", "devDependencies": { "@types/chai": "4.1.7", "@types/mocha": "5.2.7", "@types/node": "^12.0.0", "chai": "4.2.0", "coveralls": "3.0.5", "istanbul": "^0.4.5", "mocha": "6.2.0", "mocha-lcov-reporter": "^1.3.0", "nyc": "14.1.1", "source-map-support": "0.5.12", "ts-node": "8.3.0", "tslint": "5.18.0", "typescript": "^3.2.1" }, "typings": "typings/smartbuffer.d.ts", "dependencies": {}, "scripts": { "prepublish": "npm install -g typescript && npm run build", "test": "NODE_ENV=test mocha --recursive --require ts-node/register test/**/*.ts", "coverage": "NODE_ENV=test nyc npm test", "coveralls": "NODE_ENV=test nyc npm test && nyc report --reporter=text-lcov | coveralls", "lint": "tslint --type-check --project tsconfig.json 'src/**/*.ts'", "build": "tsc -p ./" }, "nyc": { "extension": [ ".ts", ".tsx" ], "include": [ "src/*.ts", "src/**/*.ts" ], "exclude": [ "**.*.d.ts", "node_modules", "typings" ], "require": [ "ts-node/register" ], "reporter": [ "json", "html" ], "all": true } } "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const utils_1 = require("./utils"); // The default Buffer size if one is not provided. const DEFAULT_SMARTBUFFER_SIZE = 4096; // The default string encoding to use for reading/writing strings. const DEFAULT_SMARTBUFFER_ENCODING = 'utf8'; class SmartBuffer { /** * Creates a new SmartBuffer instance. * * @param options { SmartBufferOptions } The SmartBufferOptions to apply to this instance. */ constructor(options) { this.length = 0; this._encoding = DEFAULT_SMARTBUFFER_ENCODING; this._writeOffset = 0; this._readOffset = 0; if (SmartBuffer.isSmartBufferOptions(options)) { // Checks for encoding if (options.encoding) { utils_1.checkEncoding(options.encoding); this._encoding = options.encoding; } // Checks for initial size length if (options.size) { if (utils_1.isFiniteInteger(options.size) && options.size > 0) { this._buff = Buffer.allocUnsafe(options.size); } else { throw new Error(utils_1.ERRORS.INVALID_SMARTBUFFER_SIZE); } // Check for initial Buffer } else if (options.buff) { if (options.buff instanceof Buffer) { this._buff = options.buff; this.length = options.buff.length; } else { throw new Error(utils_1.ERRORS.INVALID_SMARTBUFFER_BUFFER); } } else { this._buff = Buffer.allocUnsafe(DEFAULT_SMARTBUFFER_SIZE); } } else { // If something was passed but it's not a SmartBufferOptions object if (typeof options !== 'undefined') { throw new Error(utils_1.ERRORS.INVALID_SMARTBUFFER_OBJECT); } // Otherwise default to sane options this._buff = Buffer.allocUnsafe(DEFAULT_SMARTBUFFER_SIZE); } } /** * Creates a new SmartBuffer instance with the provided internal Buffer size and optional encoding. * * @param size { Number } The size of the internal Buffer. * @param encoding { String } The BufferEncoding to use for strings. * * @return { SmartBuffer } */ static fromSize(size, encoding) { return new this({ size: size, encoding: encoding }); } /** * Creates a new SmartBuffer instance with the provided Buffer and optional encoding. * * @param buffer { Buffer } The Buffer to use as the internal Buffer value. * @param encoding { String } The BufferEncoding to use for strings. * * @return { SmartBuffer } */ static fromBuffer(buff, encoding) { return new this({ buff: buff, encoding: encoding }); } /** * Creates a new SmartBuffer instance with the provided SmartBufferOptions options. * * @param options { SmartBufferOptions } The options to use when creating the SmartBuffer instance. */ static fromOptions(options) { return new this(options); } /** * Type checking function that determines if an object is a SmartBufferOptions object. */ static isSmartBufferOptions(options) { const castOptions = options; return (castOptions && (castOptions.encoding !== undefined || castOptions.size !== undefined || castOptions.buff !== undefined)); } // Signed integers /** * Reads an Int8 value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readInt8(offset) { return this._readNumberValue(Buffer.prototype.readInt8, 1, offset); } /** * Reads an Int16BE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readInt16BE(offset) { return this._readNumberValue(Buffer.prototype.readInt16BE, 2, offset); } /** * Reads an Int16LE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readInt16LE(offset) { return this._readNumberValue(Buffer.prototype.readInt16LE, 2, offset); } /** * Reads an Int32BE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readInt32BE(offset) { return this._readNumberValue(Buffer.prototype.readInt32BE, 4, offset); } /** * Reads an Int32LE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readInt32LE(offset) { return this._readNumberValue(Buffer.prototype.readInt32LE, 4, offset); } /** * Reads a BigInt64BE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { BigInt } */ readBigInt64BE(offset) { utils_1.bigIntAndBufferInt64Check('readBigInt64BE'); return this._readNumberValue(Buffer.prototype.readBigInt64BE, 8, offset); } /** * Reads a BigInt64LE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { BigInt } */ readBigInt64LE(offset) { utils_1.bigIntAndBufferInt64Check('readBigInt64LE'); return this._readNumberValue(Buffer.prototype.readBigInt64LE, 8, offset); } /** * Writes an Int8 value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeInt8(value, offset) { this._writeNumberValue(Buffer.prototype.writeInt8, 1, value, offset); return this; } /** * Inserts an Int8 value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertInt8(value, offset) { return this._insertNumberValue(Buffer.prototype.writeInt8, 1, value, offset); } /** * Writes an Int16BE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeInt16BE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeInt16BE, 2, value, offset); } /** * Inserts an Int16BE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertInt16BE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeInt16BE, 2, value, offset); } /** * Writes an Int16LE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeInt16LE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeInt16LE, 2, value, offset); } /** * Inserts an Int16LE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertInt16LE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeInt16LE, 2, value, offset); } /** * Writes an Int32BE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeInt32BE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeInt32BE, 4, value, offset); } /** * Inserts an Int32BE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertInt32BE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeInt32BE, 4, value, offset); } /** * Writes an Int32LE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeInt32LE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeInt32LE, 4, value, offset); } /** * Inserts an Int32LE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertInt32LE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeInt32LE, 4, value, offset); } /** * Writes a BigInt64BE value to the current write position (or at optional offset). * * @param value { BigInt } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeBigInt64BE(value, offset) { utils_1.bigIntAndBufferInt64Check('writeBigInt64BE'); return this._writeNumberValue(Buffer.prototype.writeBigInt64BE, 8, value, offset); } /** * Inserts a BigInt64BE value at the given offset value. * * @param value { BigInt } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertBigInt64BE(value, offset) { utils_1.bigIntAndBufferInt64Check('writeBigInt64BE'); return this._insertNumberValue(Buffer.prototype.writeBigInt64BE, 8, value, offset); } /** * Writes a BigInt64LE value to the current write position (or at optional offset). * * @param value { BigInt } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeBigInt64LE(value, offset) { utils_1.bigIntAndBufferInt64Check('writeBigInt64LE'); return this._writeNumberValue(Buffer.prototype.writeBigInt64LE, 8, value, offset); } /** * Inserts a Int64LE value at the given offset value. * * @param value { BigInt } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertBigInt64LE(value, offset) { utils_1.bigIntAndBufferInt64Check('writeBigInt64LE'); return this._insertNumberValue(Buffer.prototype.writeBigInt64LE, 8, value, offset); } // Unsigned Integers /** * Reads an UInt8 value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readUInt8(offset) { return this._readNumberValue(Buffer.prototype.readUInt8, 1, offset); } /** * Reads an UInt16BE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readUInt16BE(offset) { return this._readNumberValue(Buffer.prototype.readUInt16BE, 2, offset); } /** * Reads an UInt16LE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readUInt16LE(offset) { return this._readNumberValue(Buffer.prototype.readUInt16LE, 2, offset); } /** * Reads an UInt32BE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readUInt32BE(offset) { return this._readNumberValue(Buffer.prototype.readUInt32BE, 4, offset); } /** * Reads an UInt32LE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readUInt32LE(offset) { return this._readNumberValue(Buffer.prototype.readUInt32LE, 4, offset); } /** * Reads a BigUInt64BE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { BigInt } */ readBigUInt64BE(offset) { utils_1.bigIntAndBufferInt64Check('readBigUInt64BE'); return this._readNumberValue(Buffer.prototype.readBigUInt64BE, 8, offset); } /** * Reads a BigUInt64LE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { BigInt } */ readBigUInt64LE(offset) { utils_1.bigIntAndBufferInt64Check('readBigUInt64LE'); return this._readNumberValue(Buffer.prototype.readBigUInt64LE, 8, offset); } /** * Writes an UInt8 value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeUInt8(value, offset) { return this._writeNumberValue(Buffer.prototype.writeUInt8, 1, value, offset); } /** * Inserts an UInt8 value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertUInt8(value, offset) { return this._insertNumberValue(Buffer.prototype.writeUInt8, 1, value, offset); } /** * Writes an UInt16BE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeUInt16BE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeUInt16BE, 2, value, offset); } /** * Inserts an UInt16BE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertUInt16BE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeUInt16BE, 2, value, offset); } /** * Writes an UInt16LE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeUInt16LE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeUInt16LE, 2, value, offset); } /** * Inserts an UInt16LE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertUInt16LE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeUInt16LE, 2, value, offset); } /** * Writes an UInt32BE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeUInt32BE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeUInt32BE, 4, value, offset); } /** * Inserts an UInt32BE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertUInt32BE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeUInt32BE, 4, value, offset); } /** * Writes an UInt32LE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeUInt32LE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeUInt32LE, 4, value, offset); } /** * Inserts an UInt32LE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertUInt32LE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeUInt32LE, 4, value, offset); } /** * Writes a BigUInt64BE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeBigUInt64BE(value, offset) { utils_1.bigIntAndBufferInt64Check('writeBigUInt64BE'); return this._writeNumberValue(Buffer.prototype.writeBigUInt64BE, 8, value, offset); } /** * Inserts a BigUInt64BE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertBigUInt64BE(value, offset) { utils_1.bigIntAndBufferInt64Check('writeBigUInt64BE'); return this._insertNumberValue(Buffer.prototype.writeBigUInt64BE, 8, value, offset); } /** * Writes a BigUInt64LE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeBigUInt64LE(value, offset) { utils_1.bigIntAndBufferInt64Check('writeBigUInt64LE'); return this._writeNumberValue(Buffer.prototype.writeBigUInt64LE, 8, value, offset); } /** * Inserts a BigUInt64LE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertBigUInt64LE(value, offset) { utils_1.bigIntAndBufferInt64Check('writeBigUInt64LE'); return this._insertNumberValue(Buffer.prototype.writeBigUInt64LE, 8, value, offset); } // Floating Point /** * Reads an FloatBE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readFloatBE(offset) { return this._readNumberValue(Buffer.prototype.readFloatBE, 4, offset); } /** * Reads an FloatLE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readFloatLE(offset) { return this._readNumberValue(Buffer.prototype.readFloatLE, 4, offset); } /** * Writes a FloatBE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeFloatBE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeFloatBE, 4, value, offset); } /** * Inserts a FloatBE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertFloatBE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeFloatBE, 4, value, offset); } /** * Writes a FloatLE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeFloatLE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeFloatLE, 4, value, offset); } /** * Inserts a FloatLE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertFloatLE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeFloatLE, 4, value, offset); } // Double Floating Point /** * Reads an DoublEBE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readDoubleBE(offset) { return this._readNumberValue(Buffer.prototype.readDoubleBE, 8, offset); } /** * Reads an DoubleLE value from the current read position or an optionally provided offset. * * @param offset { Number } The offset to read data from (optional) * @return { Number } */ readDoubleLE(offset) { return this._readNumberValue(Buffer.prototype.readDoubleLE, 8, offset); } /** * Writes a DoubleBE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeDoubleBE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeDoubleBE, 8, value, offset); } /** * Inserts a DoubleBE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertDoubleBE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeDoubleBE, 8, value, offset); } /** * Writes a DoubleLE value to the current write position (or at optional offset). * * @param value { Number } The value to write. * @param offset { Number } The offset to write the value at. * * @return this */ writeDoubleLE(value, offset) { return this._writeNumberValue(Buffer.prototype.writeDoubleLE, 8, value, offset); } /** * Inserts a DoubleLE value at the given offset value. * * @param value { Number } The value to insert. * @param offset { Number } The offset to insert the value at. * * @return this */ insertDoubleLE(value, offset) { return this._insertNumberValue(Buffer.prototype.writeDoubleLE, 8, value, offset); } // Strings /** * Reads a String from the current read position. * * @param arg1 { Number | String } The number of bytes to read as a String, or the BufferEncoding to use for * the string (Defaults to instance level encoding). * @param encoding { String } The BufferEncoding to use for the string (Defaults to instance level encoding). * * @return { String } */ readString(arg1, encoding) { let lengthVal; // Length provided if (typeof arg1 === 'number') { utils_1.checkLengthValue(arg1); lengthVal = Math.min(arg1, this.length - this._readOffset); } else { encoding = arg1; lengthVal = this.length - this._readOffset; } // Check encoding if (typeof encoding !== 'undefined') { utils_1.checkEncoding(encoding); } const value = this._buff.slice(this._readOffset, this._readOffset + lengthVal).toString(encoding || this._encoding); this._readOffset += lengthVal; return value; } /** * Inserts a String * * @param value { String } The String value to insert. * @param offset { Number } The offset to insert the string at. * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). * * @return this */ insertString(value, offset, encoding) { utils_1.checkOffsetValue(offset); return this._handleString(value, true, offset, encoding); } /** * Writes a String * * @param value { String } The String value to write. * @param arg2 { Number | String } The offset to write the string at, or the BufferEncoding to use. * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). * * @return this */ writeString(value, arg2, encoding) { return this._handleString(value, false, arg2, encoding); } /** * Reads a null-terminated String from the current read position. * * @param encoding { String } The BufferEncoding to use for the string (Defaults to instance level encoding). * * @return { String } */ readStringNT(encoding) { if (typeof encoding !== 'undefined') { utils_1.checkEncoding(encoding); } // Set null character position to the end SmartBuffer instance. let nullPos = this.length; // Find next null character (if one is not found, default from above is used) for (let i = this._readOffset; i < this.length; i++) { if (this._buff[i] === 0x00) { nullPos = i; break; } } // Read string value const value = this._buff.slice(this._readOffset, nullPos); // Increment internal Buffer read offset this._readOffset = nullPos + 1; return value.toString(encoding || this._encoding); } /** * Inserts a null-terminated String. * * @param value { String } The String value to write. * @param arg2 { Number | String } The offset to write the string to, or the BufferEncoding to use. * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). * * @return this */ insertStringNT(value, offset, encoding) { utils_1.checkOffsetValue(offset); // Write Values this.insertString(value, offset, encoding); this.insertUInt8(0x00, offset + value.length); return this; } /** * Writes a null-terminated String. * * @param value { String } The String value to write. * @param arg2 { Number | String } The offset to write the string to, or the BufferEncoding to use. * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). * * @return this */ writeStringNT(value, arg2, encoding) { // Write Values this.writeString(value, arg2, encoding); this.writeUInt8(0x00, typeof arg2 === 'number' ? arg2 + value.length : this.writeOffset); return this; } // Buffers /** * Reads a Buffer from the internal read position. * * @param length { Number } The length of data to read as a Buffer. * * @return { Buffer } */ readBuffer(length) { if (typeof length !== 'undefined') { utils_1.checkLengthValue(length); } const lengthVal = typeof length === 'number' ? length : this.length; const endPoint = Math.min(this.length, this._readOffset + lengthVal); // Read buffer value const value = this._buff.slice(this._readOffset, endPoint); // Increment internal Buffer read offset this._readOffset = endPoint; return value; } /** * Writes a Buffer to the current write position. * * @param value { Buffer } The Buffer to write. * @param offset { Number } The offset to write the Buffer to. * * @return this */ insertBuffer(value, offset) { utils_1.checkOffsetValue(offset); return this._handleBuffer(value, true, offset); } /** * Writes a Buffer to the current write position. * * @param value { Buffer } The Buffer to write. * @param offset { Number } The offset to write the Buffer to. * * @return this */ writeBuffer(value, offset) { return this._handleBuffer(value, false, offset); } /** * Reads a null-terminated Buffer from the current read poisiton. * * @return { Buffer } */ readBufferNT() { // Set null character position to the end SmartBuffer instance. let nullPos = this.length; // Find next null character (if one is not found, default from above is used) for (let i = this._readOffset; i < this.length; i++) { if (this._buff[i] === 0x00) { nullPos = i; break; } } // Read value const value = this._buff.slice(this._readOffset, nullPos); // Increment internal Buffer read offset this._readOffset = nullPos + 1; return value; } /** * Inserts a null-terminated Buffer. * * @param value { Buffer } The Buffer to write. * @param offset { Number } The offset to write the Buffer to. * * @return this */ insertBufferNT(value, offset) { utils_1.checkOffsetValue(offset); // Write Values this.insertBuffer(value, offset); this.insertUInt8(0x00, offset + value.length); return this; } /** * Writes a null-terminated Buffer. * * @param value { Buffer } The Buffer to write. * @param offset { Number } The offset to write the Buffer to. * * @return this */ writeBufferNT(value, offset) { // Checks for valid numberic value; if (typeof offset !== 'undefined') { utils_1.checkOffsetValue(offset); } // Write Values this.writeBuffer(value, offset); this.writeUInt8(0x00, typeof offset === 'number' ? offset + value.length : this._writeOffset); return this; } /** * Clears the SmartBuffer instance to its original empty state. */ clear() { this._writeOffset = 0; this._readOffset = 0; this.length = 0; return this; } /** * Gets the remaining data left to be read from the SmartBuffer instance. * * @return { Number } */ remaining() { return this.length - this._readOffset; } /** * Gets the current read offset value of the SmartBuffer instance. * * @return { Number } */ get readOffset() { return this._readOffset; } /** * Sets the read offset value of the SmartBuffer instance. * * @param offset { Number } - The offset value to set. */ set readOffset(offset) { utils_1.checkOffsetValue(offset); // Check for bounds. utils_1.checkTargetOffset(offset, this); this._readOffset = offset; } /** * Gets the current write offset value of the SmartBuffer instance. * * @return { Number } */ get writeOffset() { return this._writeOffset; } /** * Sets the write offset value of the SmartBuffer instance. * * @param offset { Number } - The offset value to set. */ set writeOffset(offset) { utils_1.checkOffsetValue(offset); // Check for bounds. utils_1.checkTargetOffset(offset, this); this._writeOffset = offset; } /** * Gets the currently set string encoding of the SmartBuffer instance. * * @return { BufferEncoding } The string Buffer encoding currently set. */ get encoding() { return this._encoding; } /** * Sets the string encoding of the SmartBuffer instance. * * @param encoding { BufferEncoding } The string Buffer encoding to set. */ set encoding(encoding) { utils_1.checkEncoding(encoding); this._encoding = encoding; } /** * Gets the underlying internal Buffer. (This includes unmanaged data in the Buffer) * * @return { Buffer } The Buffer value. */ get internalBuffer() { return this._buff; } /** * Gets the value of the internal managed Buffer (Includes managed data only) * * @param { Buffer } */ toBuffer() { return this._buff.slice(0, this.length); } /** * Gets the String value of the internal managed Buffer * * @param encoding { String } The BufferEncoding to display the Buffer as (defaults to instance level encoding). */ toString(encoding) { const encodingVal = typeof encoding === 'string' ? encoding : this._encoding; // Check for invalid encoding. utils_1.checkEncoding(encodingVal); return this._buff.toString(encodingVal, 0, this.length); } /** * Destroys the SmartBuffer instance. */ destroy() { this.clear(); return this; } /** * Handles inserting and writing strings. * * @param value { String } The String value to insert. * @param isInsert { Boolean } True if inserting a string, false if writing. * @param arg2 { Number | String } The offset to insert the string at, or the BufferEncoding to use. * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). */ _handleString(value, isInsert, arg3, encoding) { let offsetVal = this._writeOffset; let encodingVal = this._encoding; // Check for offset if (typeof arg3 === 'number') { offsetVal = arg3; // Check for encoding } else if (typeof arg3 === 'string') { utils_1.checkEncoding(arg3); encodingVal = arg3; } // Check for encoding (third param) if (typeof encoding === 'string') { utils_1.checkEncoding(encoding); encodingVal = encoding; } // Calculate bytelength of string. const byteLength = Buffer.byteLength(value, encodingVal); // Ensure there is enough internal Buffer capacity. if (isInsert) { this.ensureInsertable(byteLength, offsetVal); } else { this._ensureWriteable(byteLength, offsetVal); } // Write value this._buff.write(value, offsetVal, byteLength, encodingVal); // Increment internal Buffer write offset; if (isInsert) { this._writeOffset += byteLength; } else { // If an offset was given, check to see if we wrote beyond the current writeOffset. if (typeof arg3 === 'number') { this._writeOffset = Math.max(this._writeOffset, offsetVal + byteLength); } else { // If no offset was given, we wrote to the end of the SmartBuffer so increment writeOffset. this._writeOffset += byteLength; } } return this; } /** * Handles writing or insert of a Buffer. * * @param value { Buffer } The Buffer to write. * @param offset { Number } The offset to write the Buffer to. */ _handleBuffer(value, isInsert, offset) { const offsetVal = typeof offset === 'number' ? offset : this._writeOffset; // Ensure there is enough internal Buffer capacity. if (isInsert) { this.ensureInsertable(value.length, offsetVal); } else { this._ensureWriteable(value.length, offsetVal); } // Write buffer value value.copy(this._buff, offsetVal); // Increment internal Buffer write offset; if (isInsert) { this._writeOffset += value.length; } else { // If an offset was given, check to see if we wrote beyond the current writeOffset. if (typeof offset === 'number') { this._writeOffset = Math.max(this._writeOffset, offsetVal + value.length); } else { // If no offset was given, we wrote to the end of the SmartBuffer so increment writeOffset. this._writeOffset += value.length; } } return this; } /** * Ensures that the internal Buffer is large enough to read data. * * @param length { Number } The length of the data that needs to be read. * @param offset { Number } The offset of the data that needs to be read. */ ensureReadable(length, offset) { // Offset value defaults to managed read offset. let offsetVal = this._readOffset; // If an offset was provided, use it. if (typeof offset !== 'undefined') { // Checks for valid numberic value; utils_1.checkOffsetValue(offset); // Overide with custom offset. offsetVal = offset; } // Checks if offset is below zero, or the offset+length offset is beyond the total length of the managed data. if (offsetVal < 0 || offsetVal + length > this.length) { throw new Error(utils_1.ERRORS.INVALID_READ_BEYOND_BOUNDS); } } /** * Ensures that the internal Buffer is large enough to insert data. * * @param dataLength { Number } The length of the data that needs to be written. * @param offset { Number } The offset of the data to be written. */ ensureInsertable(dataLength, offset) { // Checks for valid numberic value; utils_1.checkOffsetValue(offset); // Ensure there is enough internal Buffer capacity. this._ensureCapacity(this.length + dataLength); // If an offset was provided and its not the very end of the buffer, copy data into appropriate location in regards to the offset. if (offset < this.length) { this._buff.copy(this._buff, offset + dataLength, offset, this._buff.length); } // Adjust tracked smart buffer length if (offset + dataLength > this.length) { this.length = offset + dataLength; } else { this.length += dataLength; } } /** * Ensures that the internal Buffer is large enough to write data. * * @param dataLength { Number } The length of the data that needs to be written. * @param offset { Number } The offset of the data to be written (defaults to writeOffset). */ _ensureWriteable(dataLength, offset) { const offsetVal = typeof offset === 'number' ? offset : this._writeOffset; // Ensure enough capacity to write data. this._ensureCapacity(offsetVal + dataLength); // Adjust SmartBuffer length (if offset + length is larger than managed length, adjust length) if (offsetVal + dataLength > this.length) { this.length = offsetVal + dataLength; } } /** * Ensures that the internal Buffer is large enough to write at least the given amount of data. * * @param minLength { Number } The minimum length of the data needs to be written. */ _ensureCapacity(minLength) { const oldLength = this._buff.length; if (minLength > oldLength) { let data = this._buff; let newLength = (oldLength * 3) / 2 + 1; if (newLength < minLength) { newLength = minLength; } this._buff = Buffer.allocUnsafe(newLength); data.copy(this._buff, 0, 0, oldLength); } } /** * Reads a numeric number value using the provided function. * * @typeparam T { number | bigint } The type of the value to be read * * @param func { Function(offset: number) => number } The function to read data on the internal Buffer with. * @param byteSize { Number } The number of bytes read. * @param offset { Number } The offset to read from (optional). When this is not provided, the managed readOffset is used instead. * * @returns { T } the number value */ _readNumberValue(func, byteSize, offset) { this.ensureReadable(byteSize, offset); // Call Buffer.readXXXX(); const value = func.call(this._buff, typeof offset === 'number' ? offset : this._readOffset); // Adjust internal read offset if an optional read offset was not provided. if (typeof offset === 'undefined') { this._readOffset += byteSize; } return value; } /** * Inserts a numeric number value based on the given offset and value. * * @typeparam T { number | bigint } The type of the value to be written * * @param func { Function(offset: T, offset?) => number} The function to write data on the internal Buffer with. * @param byteSize { Number } The number of bytes written. * @param value { T } The number value to write. * @param offset { Number } the offset to write the number at (REQUIRED). * * @returns SmartBuffer this buffer */ _insertNumberValue(func, byteSize, value, offset) { // Check for invalid offset values. utils_1.checkOffsetValue(offset); // Ensure there is enough internal Buffer capacity. (raw offset is passed) this.ensureInsertable(byteSize, offset); // Call buffer.writeXXXX(); func.call(this._buff, value, offset); // Adjusts internally managed write offset. this._writeOffset += byteSize; return this; } /** * Writes a numeric number value based on the given offset and value. * * @typeparam T { number | bigint } The type of the value to be written * * @param func { Function(offset: T, offset?) => number} The function to write data on the internal Buffer with. * @param byteSize { Number } The number of bytes written. * @param value { T } The number value to write. * @param offset { Number } the offset to write the number at (REQUIRED). * * @returns SmartBuffer this buffer */ _writeNumberValue(func, byteSize, value, offset) { // If an offset was provided, validate it. if (typeof offset === 'number') { // Check if we're writing beyond the bounds of the managed data. if (offset < 0) { throw new Error(utils_1.ERRORS.INVALID_WRITE_BEYOND_BOUNDS); } utils_1.checkOffsetValue(offset); } // Default to writeOffset if no offset value was given. const offsetVal = typeof offset === 'number' ? offset : this._writeOffset; // Ensure there is enough internal Buffer capacity. (raw offset is passed) this._ensureWriteable(byteSize, offsetVal); func.call(this._buff, value, offsetVal); // If an offset was given, check to see if we wrote beyond the current writeOffset. if (typeof offset === 'number') { this._writeOffset = Math.max(this._writeOffset, offsetVal + byteSize); } else { // If no numeric offset was given, we wrote to the end of the SmartBuffer so increment writeOffset. this._writeOffset += byteSize; } return this; } } exports.SmartBuffer = SmartBuffer;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/smart-buffer/build/smartbuffer.js.map"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const buffer_1 = require("buffer"); /** * Error strings */ const ERRORS = { INVALID_ENCODING: 'Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.', INVALID_SMARTBUFFER_SIZE: 'Invalid size provided. Size must be a valid integer greater than zero.', INVALID_SMARTBUFFER_BUFFER: 'Invalid Buffer provided in SmartBufferOptions.', INVALID_SMARTBUFFER_OBJECT: 'Invalid SmartBufferOptions object supplied to SmartBuffer constructor or factory methods.', INVALID_OFFSET: 'An invalid offset value was provided.', INVALID_OFFSET_NON_NUMBER: 'An invalid offset value was provided. A numeric value is required.', INVALID_LENGTH: 'An invalid length value was provided.', INVALID_LENGTH_NON_NUMBER: 'An invalid length value was provived. A numeric value is required.', INVALID_TARGET_OFFSET: 'Target offset is beyond the bounds of the internal SmartBuffer data.', INVALID_TARGET_LENGTH: 'Specified length value moves cursor beyong the bounds of the internal SmartBuffer data.', INVALID_READ_BEYOND_BOUNDS: 'Attempted to read beyond the bounds of the managed data.', INVALID_WRITE_BEYOND_BOUNDS: 'Attempted to write beyond the bounds of the managed data.' }; exports.ERRORS = ERRORS; /** * Checks if a given encoding is a valid Buffer encoding. (Throws an exception if check fails) * * @param { String } encoding The encoding string to check. */ function checkEncoding(encoding) { if (!buffer_1.Buffer.isEncoding(encoding)) { throw new Error(ERRORS.INVALID_ENCODING); } } exports.checkEncoding = checkEncoding; /** * Checks if a given number is a finite integer. (Throws an exception if check fails) * * @param { Number } value The number value to check. */ function isFiniteInteger(value) { return typeof value === 'number' && isFinite(value) && isInteger(value); } exports.isFiniteInteger = isFiniteInteger; /** * Checks if an offset/length value is valid. (Throws an exception if check fails) * * @param value The value to check. * @param offset True if checking an offset, false if checking a length. */ function checkOffsetOrLengthValue(value, offset) { if (typeof value === 'number') { // Check for non finite/non integers if (!isFiniteInteger(value) || value < 0) { throw new Error(offset ? ERRORS.INVALID_OFFSET : ERRORS.INVALID_LENGTH); } } else { throw new Error(offset ? ERRORS.INVALID_OFFSET_NON_NUMBER : ERRORS.INVALID_LENGTH_NON_NUMBER); } } /** * Checks if a length value is valid. (Throws an exception if check fails) * * @param { Number } length The value to check. */ function checkLengthValue(length) { checkOffsetOrLengthValue(length, false); } exports.checkLengthValue = checkLengthValue; /** * Checks if a offset value is valid. (Throws an exception if check fails) * * @param { Number } offset The value to check. */ function checkOffsetValue(offset) { checkOffsetOrLengthValue(offset, true); } exports.checkOffsetValue = checkOffsetValue; /** * Checks if a target offset value is out of bounds. (Throws an exception if check fails) * * @param { Number } offset The offset value to check. * @param { SmartBuffer } buff The SmartBuffer instance to check against. */ function checkTargetOffset(offset, buff) { if (offset < 0 || offset > buff.length) { throw new Error(ERRORS.INVALID_TARGET_OFFSET); } } exports.checkTargetOffset = checkTargetOffset; /** * Determines whether a given number is a integer. * @param value The number to check. */ function isInteger(value) { return typeof value === 'number' && isFinite(value) && Math.floor(value) === value; } /** * Throws if Node.js version is too low to support bigint */ function bigIntAndBufferInt64Check(bufferMethod) { if (typeof BigInt === 'undefined') { throw new Error('Platform does not support JS BigInt type.'); } if (typeof buffer_1.Buffer.prototype[bufferMethod] === 'undefined') { throw new Error(`Platform does not support Buffer.prototype.${bufferMethod}.`); } } exports.bigIntAndBufferInt64Check = bigIntAndBufferInt64Check;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/smart-buffer/build/utils.js.map'use strict' const crypto = require('crypto') const MiniPass = require('minipass') const SPEC_ALGORITHMS = ['sha256', 'sha384', 'sha512'] // TODO: this should really be a hardcoded list of algorithms we support, // rather than [a-z0-9]. const BASE64_REGEX = /^[a-z0-9+/]+(?:=?=?)$/i const SRI_REGEX = /^([a-z0-9]+)-([^?]+)([?\S*]*)$/ const STRICT_SRI_REGEX = /^([a-z0-9]+)-([A-Za-z0-9+/=]{44,88})(\?[\x21-\x7E]*)?$/ const VCHAR_REGEX = /^[\x21-\x7E]+$/ const defaultOpts = { algorithms: ['sha512'], error: false, options: [], pickAlgorithm: getPrioritizedHash, sep: ' ', single: false, strict: false } const ssriOpts = (opts = {}) => ({ ...defaultOpts, ...opts }) const getOptString = options => !options || !options.length ? '' : `?${options.join('?')}` const _onEnd = Symbol('_onEnd') const _getOptions = Symbol('_getOptions') class IntegrityStream extends MiniPass { constructor (opts) { super() this.size = 0 this.opts = opts // may be overridden later, but set now for class consistency this[_getOptions]() // options used for calculating stream. can't be changed. const { algorithms = defaultOpts.algorithms } = opts this.algorithms = Array.from( new Set(algorithms.concat(this.algorithm ? [this.algorithm] : [])) ) this.hashes = this.algorithms.map(crypto.createHash) } [_getOptions] () { const { integrity, size, options } = { ...defaultOpts, ...this.opts } // For verification this.sri = integrity ? parse(integrity, this.opts) : null this.expectedSize = size this.goodSri = this.sri ? !!Object.keys(this.sri).length : false this.algorithm = this.goodSri ? this.sri.pickAlgorithm(this.opts) : null this.digests = this.goodSri ? this.sri[this.algorithm] : null this.optString = getOptString(options) } emit (ev, data) { if (ev === 'end') this[_onEnd]() return super.emit(ev, data) } write (data) { this.size += data.length this.hashes.forEach(h => h.update(data)) return super.write(data) } [_onEnd] () { if (!this.goodSri) { this[_getOptions]() } const newSri = parse(this.hashes.map((h, i) => { return `${this.algorithms[i]}-${h.digest('base64')}${this.optString}` }).join(' '), this.opts) // Integrity verification mode const match = this.goodSri && newSri.match(this.sri, this.opts) if (typeof this.expectedSize === 'number' && this.size !== this.expectedSize) { const err = new Error(`stream size mismatch when checking ${this.sri}.\n Wanted: ${this.expectedSize}\n Found: ${this.size}`) err.code = 'EBADSIZE' err.found = this.size err.expected = this.expectedSize err.sri = this.sri this.emit('error', err) } else if (this.sri && !match) { const err = new Error(`${this.sri} integrity checksum failed when using ${this.algorithm}: wanted ${this.digests} but got ${newSri}. (${this.size} bytes)`) err.code = 'EINTEGRITY' err.found = newSri err.expected = this.digests err.algorithm = this.algorithm err.sri = this.sri this.emit('error', err) } else { this.emit('size', this.size) this.emit('integrity', newSri) match && this.emit('verified', match) } } } class Hash { get isHash () { return true } constructor (hash, opts) { opts = ssriOpts(opts) const strict = !!opts.strict this.source = hash.trim() // set default values so that we make V8 happy to // always see a familiar object template. this.digest = '' this.algorithm = '' this.options = [] // 3.1. Integrity metadata (called "Hash" by ssri) // https://w3c.github.io/webappsec-subresource-integrity/#integrity-metadata-description const match = this.source.match( strict ? STRICT_SRI_REGEX : SRI_REGEX ) if (!match) { return } if (strict && !SPEC_ALGORITHMS.some(a => a === match[1])) { return } this.algorithm = match[1] this.digest = match[2] const rawOpts = match[3] if (rawOpts) { this.options = rawOpts.slice(1).split('?') } } hexDigest () { return this.digest && Buffer.from(this.digest, 'base64').toString('hex') } toJSON () { return this.toString() } toString (opts) { opts = ssriOpts(opts) if (opts.strict) { // Strict mode enforces the standard as close to the foot of the // letter as it can. if (!( // The spec has very restricted productions for algorithms. // https://www.w3.org/TR/CSP2/#source-list-syntax SPEC_ALGORITHMS.some(x => x === this.algorithm) && // Usually, if someone insists on using a "different" base64, we // leave it as-is, since there's multiple standards, and the // specified is not a URL-safe variant. // https://www.w3.org/TR/CSP2/#base64_value this.digest.match(BASE64_REGEX) && // Option syntax is strictly visual chars. // https://w3c.github.io/webappsec-subresource-integrity/#grammardef-option-expression // https://tools.ietf.org/html/rfc5234#appendix-B.1 this.options.every(opt => opt.match(VCHAR_REGEX)) )) { return '' } } const options = this.options && this.options.length ? `?${this.options.join('?')}` : '' return `${this.algorithm}-${this.digest}${options}` } } class Integrity { get isIntegrity () { return true } toJSON () { return this.toString() } isEmpty () { return Object.keys(this).length === 0 } toString (opts) { opts = ssriOpts(opts) let sep = opts.sep || ' ' if (opts.strict) { // Entries must be separated by whitespace, according to spec. sep = sep.replace(/\S+/g, ' ') } return Object.keys(this).map(k => { return this[k].map(hash => { return Hash.prototype.toString.call(hash, opts) }).filter(x => x.length).join(sep) }).filter(x => x.length).join(sep) } concat (integrity, opts) { opts = ssriOpts(opts) const other = typeof integrity === 'string' ? integrity : stringify(integrity, opts) return parse(`${this.toString(opts)} ${other}`, opts) } hexDigest () { return parse(this, { single: true }).hexDigest() } // add additional hashes to an integrity value, but prevent // *changing* an existing integrity hash. merge (integrity, opts) { opts = ssriOpts(opts) const other = parse(integrity, opts) for (const algo in other) { if (this[algo]) { if (!this[algo].find(hash => other[algo].find(otherhash => hash.digest === otherhash.digest))) { throw new Error('hashes do not match, cannot update integrity') } } else { this[algo] = other[algo] } } } match (integrity, opts) { opts = ssriOpts(opts) const other = parse(integrity, opts) const algo = other.pickAlgorithm(opts) return ( this[algo] && other[algo] && this[algo].find(hash => other[algo].find(otherhash => hash.digest === otherhash.digest ) ) ) || false } pickAlgorithm (opts) { opts = ssriOpts(opts) const pickAlgorithm = opts.pickAlgorithm const keys = Object.keys(this) return keys.reduce((acc, algo) => { return pickAlgorithm(acc, algo) || acc }) } } module.exports.parse = parse function parse (sri, opts) { if (!sri) return null opts = ssriOpts(opts) if (typeof sri === 'string') { return _parse(sri, opts) } else if (sri.algorithm && sri.digest) { const fullSri = new Integrity() fullSri[sri.algorithm] = [sri] return _parse(stringify(fullSri, opts), opts) } else { return _parse(stringify(sri, opts), opts) } } function _parse (integrity, opts) { // 3.4.3. Parse metadata // https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata if (opts.single) { return new Hash(integrity, opts) } const hashes = integrity.trim().split(/\s+/).reduce((acc, string) => { const hash = new Hash(string, opts) if (hash.algorithm && hash.digest) { const algo = hash.algorithm if (!acc[algo]) { acc[algo] = [] } acc[algo].push(hash) } return acc }, new Integrity()) return hashes.isEmpty() ? null : hashes } module.exports.stringify = stringify function stringify (obj, opts) { opts = ssriOpts(opts) if (obj.algorithm && obj.digest) { return Hash.prototype.toString.call(obj, opts) } else if (typeof obj === 'string') { return stringify(parse(obj, opts), opts) } else { return Integrity.prototype.toString.call(obj, opts) } } module.exports.fromHex = fromHex function fromHex (hexDigest, algorithm, opts) { opts = ssriOpts(opts) const optString = getOptString(opts.options) return parse( `${algorithm}-${ Buffer.from(hexDigest, 'hex').toString('base64') }${optString}`, opts ) } module.exports.fromData = fromData function fromData (data, opts) { opts = ssriOpts(opts) const algorithms = opts.algorithms const optString = getOptString(opts.options) return algorithms.reduce((acc, algo) => { const digest = crypto.createHash(algo).update(data).digest('base64') const hash = new Hash( `${algo}-${digest}${optString}`, opts ) /* istanbul ignore else - it would be VERY strange if the string we * just calculated with an algo did not have an algo or digest. */ if (hash.algorithm && hash.digest) { const algo = hash.algorithm if (!acc[algo]) { acc[algo] = [] } acc[algo].push(hash) } return acc }, new Integrity()) } module.exports.fromStream = fromStream function fromStream (stream, opts) { opts = ssriOpts(opts) const istream = integrityStream(opts) return new Promise((resolve, reject) => { stream.pipe(istream) stream.on('error', reject) istream.on('error', reject) let sri istream.on('integrity', s => { sri = s }) istream.on('end', () => resolve(sri)) istream.on('data', () => {}) }) } module.exports.checkData = checkData function checkData (data, sri, opts) { opts = ssriOpts(opts) sri = parse(sri, opts) if (!sri || !Object.keys(sri).length) { if (opts.error) { throw Object.assign( new Error('No valid integrity hashes to check against'), { code: 'EINTEGRITY' } ) } else { return false } } const algorithm = sri.pickAlgorithm(opts) const digest = crypto.createHash(algorithm).update(data).digest('base64') const newSri = parse({ algorithm, digest }) const match = newSri.match(sri, opts) if (match || !opts.error) { return match } else if (typeof opts.size === 'number' && (data.length !== opts.size)) { const err = new Error(`data size mismatch when checking ${sri}.\n Wanted: ${opts.size}\n Found: ${data.length}`) err.code = 'EBADSIZE' err.found = data.length err.expected = opts.size err.sri = sri throw err } else { const err = new Error(`Integrity checksum failed when using ${algorithm}: Wanted ${sri}, but got ${newSri}. (${data.length} bytes)`) err.code = 'EINTEGRITY' err.found = newSri err.expected = sri err.algorithm = algorithm err.sri = sri throw err } } module.exports.checkStream = checkStream function checkStream (stream, sri, opts) { opts = ssriOpts(opts) opts.integrity = sri sri = parse(sri, opts) if (!sri || !Object.keys(sri).length) { return Promise.reject(Object.assign( new Error('No valid integrity hashes to check against'), { code: 'EINTEGRITY' } )) } const checker = integrityStream(opts) return new Promise((resolve, reject) => { stream.pipe(checker) stream.on('error', reject) checker.on('error', reject) let sri checker.on('verified', s => { sri = s }) checker.on('end', () => resolve(sri)) checker.on('data', () => {}) }) } module.exports.integrityStream = integrityStream function integrityStream (opts = {}) { return new IntegrityStream(opts) } module.exports.create = createIntegrity function createIntegrity (opts) { opts = ssriOpts(opts) const algorithms = opts.algorithms const optString = getOptString(opts.options) const hashes = algorithms.map(crypto.createHash) return { update: function (chunk, enc) { hashes.forEach(h => h.update(chunk, enc)) return this }, digest: function (enc) { const integrity = algorithms.reduce((acc, algo) => { const digest = hashes.shift().digest('base64') const hash = new Hash( `${algo}-${digest}${optString}`, opts ) /* istanbul ignore else - it would be VERY strange if the hash we * just calculated with an algo did not have an algo or digest. */ if (hash.algorithm && hash.digest) { const algo = hash.algorithm if (!acc[algo]) { acc[algo] = [] } acc[algo].push(hash) } return acc }, new Integrity()) return integrity } } } const NODE_HASHES = new Set(crypto.getHashes()) // This is a Best Effort™ at a reasonable priority for hash algos const DEFAULT_PRIORITY = [ 'md5', 'whirlpool', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512', // TODO - it's unclear _which_ of these Node will actually use as its name // for the algorithm, so we guesswork it based on the OpenSSL names. 'sha3', 'sha3-256', 'sha3-384', 'sha3-512', 'sha3_256', 'sha3_384', 'sha3_512' ].filter(algo => NODE_HASHES.has(algo)) function getPrioritizedHash (algo1, algo2) { return DEFAULT_PRIORITY.indexOf(algo1.toLowerCase()) >= DEFAULT_PRIORITY.indexOf(algo2.toLowerCase()) ? algo1 : algo2 } ISC License Copyright (c) npm, Inc. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE COPYRIGHT HOLDER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "ssri", "version": "8.0.1", "description": "Standard Subresource Integrity library -- parses, serializes, generates, and verifies integrity metadata according to the SRI spec.", "main": "index.js", "files": [], "scripts": { "prerelease": "npm t", "postrelease": "npm publish", "prepublishOnly": "git push --follow-tags", "posttest": "npm run lint", "release": "standard-version -s", "test": "tap", "coverage": "tap", "lint": "standard" }, "tap": { "check-coverage": true }, "repository": "https://github.com/npm/ssri", "keywords": [ "w3c", "web", "security", "integrity", "checksum", "hashing", "subresource integrity", "sri", "sri hash", "sri string", "sri generator", "html" ], "author": { "name": "Kat Marchán", "email": "kzm@sykosomatic.org", "twitter": "maybekatz" }, "license": "ISC", "dependencies": { "minipass": "^3.1.1" }, "devDependencies": { "standard": "^16.0.3", "standard-version": "^9.1.0", "tap": "^14.10.6" }, "engines": { "node": ">= 8" } } 'use strict'; const singleComment = Symbol('singleComment'); const multiComment = Symbol('multiComment'); const stripWithoutWhitespace = () => ''; const stripWithWhitespace = (string, start, end) => string.slice(start, end).replace(/\S/g, ' '); const isEscaped = (jsonString, quotePosition) => { let index = quotePosition - 1; let backslashCount = 0; while (jsonString[index] === '\\') { index -= 1; backslashCount += 1; } return Boolean(backslashCount % 2); }; module.exports = (jsonString, options = {}) => { if (typeof jsonString !== 'string') { throw new TypeError(`Expected argument \`jsonString\` to be a \`string\`, got \`${typeof jsonString}\``); } const strip = options.whitespace === false ? stripWithoutWhitespace : stripWithWhitespace; let insideString = false; let insideComment = false; let offset = 0; let result = ''; for (let i = 0; i < jsonString.length; i++) { const currentCharacter = jsonString[i]; const nextCharacter = jsonString[i + 1]; if (!insideComment && currentCharacter === '"') { const escaped = isEscaped(jsonString, i); if (!escaped) { insideString = !insideString; } } if (insideString) { continue; } if (!insideComment && currentCharacter + nextCharacter === '//') { result += jsonString.slice(offset, i); offset = i; insideComment = singleComment; i++; } else if (insideComment === singleComment && currentCharacter + nextCharacter === '\r\n') { i++; insideComment = false; result += strip(jsonString, offset, i); offset = i; continue; } else if (insideComment === singleComment && currentCharacter === '\n') { insideComment = false; result += strip(jsonString, offset, i); offset = i; } else if (!insideComment && currentCharacter + nextCharacter === '/*') { result += jsonString.slice(offset, i); offset = i; insideComment = multiComment; i++; continue; } else if (insideComment === multiComment && currentCharacter + nextCharacter === '*/') { i++; insideComment = false; result += strip(jsonString, offset, i + 1); offset = i + 1; continue; } } return result + (insideComment ? strip(jsonString.slice(offset)) : jsonString.slice(offset)); }; MIT License Copyright (c) Sindre Sorhus (https://sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "strip-json-comments", "version": "3.1.1", "description": "Strip comments from JSON. Lets you use comments in your JSON files!", "license": "MIT", "repository": "sindresorhus/strip-json-comments", "funding": "https://github.com/sponsors/sindresorhus", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "https://sindresorhus.com" }, "engines": { "node": ">=8" }, "scripts": { "test": "xo && ava && tsd", "bench": "matcha benchmark.js" }, "files": [ "index.js", "index.d.ts" ], "keywords": [ "json", "strip", "comments", "remove", "delete", "trim", "multiline", "parse", "config", "configuration", "settings", "util", "env", "environment", "jsonc" ], "devDependencies": { "ava": "^1.4.1", "matcha": "^0.7.0", "tsd": "^0.7.2", "xo": "^0.24.0" } } var util = require('util') var bl = require('bl') var xtend = require('xtend') var headers = require('./headers') var Writable = require('readable-stream').Writable var PassThrough = require('readable-stream').PassThrough var noop = function () {} var overflow = function (size) { size &= 511 return size && 512 - size } var emptyStream = function (self, offset) { var s = new Source(self, offset) s.end() return s } var mixinPax = function (header, pax) { if (pax.path) header.name = pax.path if (pax.linkpath) header.linkname = pax.linkpath if (pax.size) header.size = parseInt(pax.size, 10) header.pax = pax return header } var Source = function (self, offset) { this._parent = self this.offset = offset PassThrough.call(this) } util.inherits(Source, PassThrough) Source.prototype.destroy = function (err) { this._parent.destroy(err) } var Extract = function (opts) { if (!(this instanceof Extract)) return new Extract(opts) Writable.call(this, opts) opts = opts || {} this._offset = 0 this._buffer = bl() this._missing = 0 this._partial = false this._onparse = noop this._header = null this._stream = null this._overflow = null this._cb = null this._locked = false this._destroyed = false this._pax = null this._paxGlobal = null this._gnuLongPath = null this._gnuLongLinkPath = null var self = this var b = self._buffer var oncontinue = function () { self._continue() } var onunlock = function (err) { self._locked = false if (err) return self.destroy(err) if (!self._stream) oncontinue() } var onstreamend = function () { self._stream = null var drain = overflow(self._header.size) if (drain) self._parse(drain, ondrain) else self._parse(512, onheader) if (!self._locked) oncontinue() } var ondrain = function () { self._buffer.consume(overflow(self._header.size)) self._parse(512, onheader) oncontinue() } var onpaxglobalheader = function () { var size = self._header.size self._paxGlobal = headers.decodePax(b.slice(0, size)) b.consume(size) onstreamend() } var onpaxheader = function () { var size = self._header.size self._pax = headers.decodePax(b.slice(0, size)) if (self._paxGlobal) self._pax = xtend(self._paxGlobal, self._pax) b.consume(size) onstreamend() } var ongnulongpath = function () { var size = self._header.size this._gnuLongPath = headers.decodeLongPath(b.slice(0, size), opts.filenameEncoding) b.consume(size) onstreamend() } var ongnulonglinkpath = function () { var size = self._header.size this._gnuLongLinkPath = headers.decodeLongPath(b.slice(0, size), opts.filenameEncoding) b.consume(size) onstreamend() } var onheader = function () { var offset = self._offset var header try { header = self._header = headers.decode(b.slice(0, 512), opts.filenameEncoding) } catch (err) { self.emit('error', err) } b.consume(512) if (!header) { self._parse(512, onheader) oncontinue() return } if (header.type === 'gnu-long-path') { self._parse(header.size, ongnulongpath) oncontinue() return } if (header.type === 'gnu-long-link-path') { self._parse(header.size, ongnulonglinkpath) oncontinue() return } if (header.type === 'pax-global-header') { self._parse(header.size, onpaxglobalheader) oncontinue() return } if (header.type === 'pax-header') { self._parse(header.size, onpaxheader) oncontinue() return } if (self._gnuLongPath) { header.name = self._gnuLongPath self._gnuLongPath = null } if (self._gnuLongLinkPath) { header.linkname = self._gnuLongLinkPath self._gnuLongLinkPath = null } if (self._pax) { self._header = header = mixinPax(header, self._pax) self._pax = null } self._locked = true if (!header.size || header.type === 'directory') { self._parse(512, onheader) self.emit('entry', header, emptyStream(self, offset), onunlock) return } self._stream = new Source(self, offset) self.emit('entry', header, self._stream, onunlock) self._parse(header.size, onstreamend) oncontinue() } this._onheader = onheader this._parse(512, onheader) } util.inherits(Extract, Writable) Extract.prototype.destroy = function (err) { if (this._destroyed) return this._destroyed = true if (err) this.emit('error', err) this.emit('close') if (this._stream) this._stream.emit('close') } Extract.prototype._parse = function (size, onparse) { if (this._destroyed) return this._offset += size this._missing = size if (onparse === this._onheader) this._partial = false this._onparse = onparse } Extract.prototype._continue = function () { if (this._destroyed) return var cb = this._cb this._cb = noop if (this._overflow) this._write(this._overflow, undefined, cb) else cb() } Extract.prototype._write = function (data, enc, cb) { if (this._destroyed) return var s = this._stream var b = this._buffer var missing = this._missing if (data.length) this._partial = true // we do not reach end-of-chunk now. just forward it if (data.length < missing) { this._missing -= data.length this._overflow = null if (s) return s.write(data, cb) b.append(data) return cb() } // end-of-chunk. the parser should call cb. this._cb = cb this._missing = 0 var overflow = null if (data.length > missing) { overflow = data.slice(missing) data = data.slice(0, missing) } if (s) s.end(data) else b.append(data) this._overflow = overflow this._onparse() } Extract.prototype._final = function (cb) { if (this._partial) return this.destroy(new Error('Unexpected end of data')) cb() } module.exports = Extract var toBuffer = require('to-buffer') var alloc = require('buffer-alloc') var ZEROS = '0000000000000000000' var SEVENS = '7777777777777777777' var ZERO_OFFSET = '0'.charCodeAt(0) var USTAR = 'ustar\x0000' var MASK = parseInt('7777', 8) var clamp = function (index, len, defaultValue) { if (typeof index !== 'number') return defaultValue index = ~~index // Coerce to integer. if (index >= len) return len if (index >= 0) return index index += len if (index >= 0) return index return 0 } var toType = function (flag) { switch (flag) { case 0: return 'file' case 1: return 'link' case 2: return 'symlink' case 3: return 'character-device' case 4: return 'block-device' case 5: return 'directory' case 6: return 'fifo' case 7: return 'contiguous-file' case 72: return 'pax-header' case 55: return 'pax-global-header' case 27: return 'gnu-long-link-path' case 28: case 30: return 'gnu-long-path' } return null } var toTypeflag = function (flag) { switch (flag) { case 'file': return 0 case 'link': return 1 case 'symlink': return 2 case 'character-device': return 3 case 'block-device': return 4 case 'directory': return 5 case 'fifo': return 6 case 'contiguous-file': return 7 case 'pax-header': return 72 } return 0 } var indexOf = function (block, num, offset, end) { for (; offset < end; offset++) { if (block[offset] === num) return offset } return end } var cksum = function (block) { var sum = 8 * 32 for (var i = 0; i < 148; i++) sum += block[i] for (var j = 156; j < 512; j++) sum += block[j] return sum } var encodeOct = function (val, n) { val = val.toString(8) if (val.length > n) return SEVENS.slice(0, n) + ' ' else return ZEROS.slice(0, n - val.length) + val + ' ' } /* Copied from the node-tar repo and modified to meet * tar-stream coding standard. * * Source: https://github.com/npm/node-tar/blob/51b6627a1f357d2eb433e7378e5f05e83b7aa6cd/lib/header.js#L349 */ function parse256 (buf) { // first byte MUST be either 80 or FF // 80 for positive, FF for 2's comp var positive if (buf[0] === 0x80) positive = true else if (buf[0] === 0xFF) positive = false else return null // build up a base-256 tuple from the least sig to the highest var zero = false var tuple = [] for (var i = buf.length - 1; i > 0; i--) { var byte = buf[i] if (positive) tuple.push(byte) else if (zero && byte === 0) tuple.push(0) else if (zero) { zero = false tuple.push(0x100 - byte) } else tuple.push(0xFF - byte) } var sum = 0 var l = tuple.length for (i = 0; i < l; i++) { sum += tuple[i] * Math.pow(256, i) } return positive ? sum : -1 * sum } var decodeOct = function (val, offset, length) { val = val.slice(offset, offset + length) offset = 0 // If prefixed with 0x80 then parse as a base-256 integer if (val[offset] & 0x80) { return parse256(val) } else { // Older versions of tar can prefix with spaces while (offset < val.length && val[offset] === 32) offset++ var end = clamp(indexOf(val, 32, offset, val.length), val.length, val.length) while (offset < end && val[offset] === 0) offset++ if (end === offset) return 0 return parseInt(val.slice(offset, end).toString(), 8) } } var decodeStr = function (val, offset, length, encoding) { return val.slice(offset, indexOf(val, 0, offset, offset + length)).toString(encoding) } var addLength = function (str) { var len = Buffer.byteLength(str) var digits = Math.floor(Math.log(len) / Math.log(10)) + 1 if (len + digits >= Math.pow(10, digits)) digits++ return (len + digits) + str } exports.decodeLongPath = function (buf, encoding) { return decodeStr(buf, 0, buf.length, encoding) } exports.encodePax = function (opts) { // TODO: encode more stuff in pax var result = '' if (opts.name) result += addLength(' path=' + opts.name + '\n') if (opts.linkname) result += addLength(' linkpath=' + opts.linkname + '\n') var pax = opts.pax if (pax) { for (var key in pax) { result += addLength(' ' + key + '=' + pax[key] + '\n') } } return toBuffer(result) } exports.decodePax = function (buf) { var result = {} while (buf.length) { var i = 0 while (i < buf.length && buf[i] !== 32) i++ var len = parseInt(buf.slice(0, i).toString(), 10) if (!len) return result var b = buf.slice(i + 1, len - 1).toString() var keyIndex = b.indexOf('=') if (keyIndex === -1) return result result[b.slice(0, keyIndex)] = b.slice(keyIndex + 1) buf = buf.slice(len) } return result } exports.encode = function (opts) { var buf = alloc(512) var name = opts.name var prefix = '' if (opts.typeflag === 5 && name[name.length - 1] !== '/') name += '/' if (Buffer.byteLength(name) !== name.length) return null // utf-8 while (Buffer.byteLength(name) > 100) { var i = name.indexOf('/') if (i === -1) return null prefix += prefix ? '/' + name.slice(0, i) : name.slice(0, i) name = name.slice(i + 1) } if (Buffer.byteLength(name) > 100 || Buffer.byteLength(prefix) > 155) return null if (opts.linkname && Buffer.byteLength(opts.linkname) > 100) return null buf.write(name) buf.write(encodeOct(opts.mode & MASK, 6), 100) buf.write(encodeOct(opts.uid, 6), 108) buf.write(encodeOct(opts.gid, 6), 116) buf.write(encodeOct(opts.size, 11), 124) buf.write(encodeOct((opts.mtime.getTime() / 1000) | 0, 11), 136) buf[156] = ZERO_OFFSET + toTypeflag(opts.type) if (opts.linkname) buf.write(opts.linkname, 157) buf.write(USTAR, 257) if (opts.uname) buf.write(opts.uname, 265) if (opts.gname) buf.write(opts.gname, 297) buf.write(encodeOct(opts.devmajor || 0, 6), 329) buf.write(encodeOct(opts.devminor || 0, 6), 337) if (prefix) buf.write(prefix, 345) buf.write(encodeOct(cksum(buf), 6), 148) return buf } exports.decode = function (buf, filenameEncoding) { var typeflag = buf[156] === 0 ? 0 : buf[156] - ZERO_OFFSET var name = decodeStr(buf, 0, 100, filenameEncoding) var mode = decodeOct(buf, 100, 8) var uid = decodeOct(buf, 108, 8) var gid = decodeOct(buf, 116, 8) var size = decodeOct(buf, 124, 12) var mtime = decodeOct(buf, 136, 12) var type = toType(typeflag) var linkname = buf[157] === 0 ? null : decodeStr(buf, 157, 100, filenameEncoding) var uname = decodeStr(buf, 265, 32) var gname = decodeStr(buf, 297, 32) var devmajor = decodeOct(buf, 329, 8) var devminor = decodeOct(buf, 337, 8) if (buf[345]) name = decodeStr(buf, 345, 155, filenameEncoding) + '/' + name // to support old tar versions that use trailing / to indicate dirs if (typeflag === 0 && name && name[name.length - 1] === '/') typeflag = 5 var c = cksum(buf) // checksum is still initial value if header was null. if (c === 8 * 32) return null // valid checksum if (c !== decodeOct(buf, 148, 8)) throw new Error('Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?') return { name: name, mode: mode, uid: uid, gid: gid, size: size, mtime: new Date(1000 * mtime), type: type, linkname: linkname, uname: uname, gname: gname, devmajor: devmajor, devminor: devminor } } exports.extract = require('./extract') exports.pack = require('./pack') The MIT License (MIT) Copyright (c) 2014 Mathias Buus Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.var constants = require('fs-constants') var eos = require('end-of-stream') var util = require('util') var alloc = require('buffer-alloc') var toBuffer = require('to-buffer') var Readable = require('readable-stream').Readable var Writable = require('readable-stream').Writable var StringDecoder = require('string_decoder').StringDecoder var headers = require('./headers') var DMODE = parseInt('755', 8) var FMODE = parseInt('644', 8) var END_OF_TAR = alloc(1024) var noop = function () {} var overflow = function (self, size) { size &= 511 if (size) self.push(END_OF_TAR.slice(0, 512 - size)) } function modeToType (mode) { switch (mode & constants.S_IFMT) { case constants.S_IFBLK: return 'block-device' case constants.S_IFCHR: return 'character-device' case constants.S_IFDIR: return 'directory' case constants.S_IFIFO: return 'fifo' case constants.S_IFLNK: return 'symlink' } return 'file' } var Sink = function (to) { Writable.call(this) this.written = 0 this._to = to this._destroyed = false } util.inherits(Sink, Writable) Sink.prototype._write = function (data, enc, cb) { this.written += data.length if (this._to.push(data)) return cb() this._to._drain = cb } Sink.prototype.destroy = function () { if (this._destroyed) return this._destroyed = true this.emit('close') } var LinkSink = function () { Writable.call(this) this.linkname = '' this._decoder = new StringDecoder('utf-8') this._destroyed = false } util.inherits(LinkSink, Writable) LinkSink.prototype._write = function (data, enc, cb) { this.linkname += this._decoder.write(data) cb() } LinkSink.prototype.destroy = function () { if (this._destroyed) return this._destroyed = true this.emit('close') } var Void = function () { Writable.call(this) this._destroyed = false } util.inherits(Void, Writable) Void.prototype._write = function (data, enc, cb) { cb(new Error('No body allowed for this entry')) } Void.prototype.destroy = function () { if (this._destroyed) return this._destroyed = true this.emit('close') } var Pack = function (opts) { if (!(this instanceof Pack)) return new Pack(opts) Readable.call(this, opts) this._drain = noop this._finalized = false this._finalizing = false this._destroyed = false this._stream = null } util.inherits(Pack, Readable) Pack.prototype.entry = function (header, buffer, callback) { if (this._stream) throw new Error('already piping an entry') if (this._finalized || this._destroyed) return if (typeof buffer === 'function') { callback = buffer buffer = null } if (!callback) callback = noop var self = this if (!header.size || header.type === 'symlink') header.size = 0 if (!header.type) header.type = modeToType(header.mode) if (!header.mode) header.mode = header.type === 'directory' ? DMODE : FMODE if (!header.uid) header.uid = 0 if (!header.gid) header.gid = 0 if (!header.mtime) header.mtime = new Date() if (typeof buffer === 'string') buffer = toBuffer(buffer) if (Buffer.isBuffer(buffer)) { header.size = buffer.length this._encode(header) this.push(buffer) overflow(self, header.size) process.nextTick(callback) return new Void() } if (header.type === 'symlink' && !header.linkname) { var linkSink = new LinkSink() eos(linkSink, function (err) { if (err) { // stream was closed self.destroy() return callback(err) } header.linkname = linkSink.linkname self._encode(header) callback() }) return linkSink } this._encode(header) if (header.type !== 'file' && header.type !== 'contiguous-file') { process.nextTick(callback) return new Void() } var sink = new Sink(this) this._stream = sink eos(sink, function (err) { self._stream = null if (err) { // stream was closed self.destroy() return callback(err) } if (sink.written !== header.size) { // corrupting tar self.destroy() return callback(new Error('size mismatch')) } overflow(self, header.size) if (self._finalizing) self.finalize() callback() }) return sink } Pack.prototype.finalize = function () { if (this._stream) { this._finalizing = true return } if (this._finalized) return this._finalized = true this.push(END_OF_TAR) this.push(null) } Pack.prototype.destroy = function (err) { if (this._destroyed) return this._destroyed = true if (err) this.emit('error', err) this.emit('close') if (this._stream && this._stream.destroy) this._stream.destroy() } Pack.prototype._encode = function (header) { if (!header.pax) { var buf = headers.encode(header) if (buf) { this.push(buf) return } } this._encodePax(header) } Pack.prototype._encodePax = function (header) { var paxHeader = headers.encodePax({ name: header.name, linkname: header.linkname, pax: header.pax }) var newHeader = { name: 'PaxHeader', mode: header.mode, uid: header.uid, gid: header.gid, size: paxHeader.length, mtime: header.mtime, type: 'pax-header', linkname: header.linkname && 'PaxHeader', uname: header.uname, gname: header.gname, devmajor: header.devmajor, devminor: header.devminor } this.push(headers.encode(newHeader)) this.push(paxHeader) overflow(this, paxHeader.length) newHeader.size = header.size newHeader.type = header.type this.push(headers.encode(newHeader)) } Pack.prototype._read = function (n) { var drain = this._drain this._drain = noop drain() } module.exports = Pack { "name": "tar-stream", "version": "1.6.2", "description": "tar-stream is a streaming tar parser and generator and nothing else. It is streams2 and operates purely using streams which means you can easily extract/parse tarballs without ever hitting the file system.", "author": "Mathias Buus ", "engines": { "node": ">= 0.8.0" }, "dependencies": { "bl": "^1.0.0", "buffer-alloc": "^1.2.0", "end-of-stream": "^1.0.0", "fs-constants": "^1.0.0", "readable-stream": "^2.3.0", "to-buffer": "^1.1.1", "xtend": "^4.0.0" }, "devDependencies": { "concat-stream": "^1.6.2", "standard": "^11.0.1", "tape": "^4.9.0" }, "scripts": { "test": "standard && tape test/extract.js test/pack.js", "test-all": "standard && tape test/*.js" }, "keywords": [ "tar", "tarball", "parse", "parser", "generate", "generator", "stream", "stream2", "streams", "streams2", "streaming", "pack", "extract", "modify" ], "bugs": { "url": "https://github.com/mafintosh/tar-stream/issues" }, "homepage": "https://github.com/mafintosh/tar-stream", "main": "index.js", "files": [ "*.js", "LICENSE" ], "directories": { "test": "test" }, "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/mafintosh/tar-stream.git" } } var DuplexStream = require('readable-stream/duplex') , util = require('util') , Buffer = require('safe-buffer').Buffer function BufferList (callback) { if (!(this instanceof BufferList)) return new BufferList(callback) this._bufs = [] this.length = 0 if (typeof callback == 'function') { this._callback = callback var piper = function piper (err) { if (this._callback) { this._callback(err) this._callback = null } }.bind(this) this.on('pipe', function onPipe (src) { src.on('error', piper) }) this.on('unpipe', function onUnpipe (src) { src.removeListener('error', piper) }) } else { this.append(callback) } DuplexStream.call(this) } util.inherits(BufferList, DuplexStream) BufferList.prototype._offset = function _offset (offset) { var tot = 0, i = 0, _t if (offset === 0) return [ 0, 0 ] for (; i < this._bufs.length; i++) { _t = tot + this._bufs[i].length if (offset < _t || i == this._bufs.length - 1) return [ i, offset - tot ] tot = _t } } BufferList.prototype.append = function append (buf) { var i = 0 if (Buffer.isBuffer(buf)) { this._appendBuffer(buf); } else if (Array.isArray(buf)) { for (; i < buf.length; i++) this.append(buf[i]) } else if (buf instanceof BufferList) { // unwrap argument into individual BufferLists for (; i < buf._bufs.length; i++) this.append(buf._bufs[i]) } else if (buf != null) { // coerce number arguments to strings, since Buffer(number) does // uninitialized memory allocation if (typeof buf == 'number') buf = buf.toString() this._appendBuffer(Buffer.from(buf)); } return this } BufferList.prototype._appendBuffer = function appendBuffer (buf) { this._bufs.push(buf) this.length += buf.length } BufferList.prototype._write = function _write (buf, encoding, callback) { this._appendBuffer(buf) if (typeof callback == 'function') callback() } BufferList.prototype._read = function _read (size) { if (!this.length) return this.push(null) size = Math.min(size, this.length) this.push(this.slice(0, size)) this.consume(size) } BufferList.prototype.end = function end (chunk) { DuplexStream.prototype.end.call(this, chunk) if (this._callback) { this._callback(null, this.slice()) this._callback = null } } BufferList.prototype.get = function get (index) { return this.slice(index, index + 1)[0] } BufferList.prototype.slice = function slice (start, end) { if (typeof start == 'number' && start < 0) start += this.length if (typeof end == 'number' && end < 0) end += this.length return this.copy(null, 0, start, end) } BufferList.prototype.copy = function copy (dst, dstStart, srcStart, srcEnd) { if (typeof srcStart != 'number' || srcStart < 0) srcStart = 0 if (typeof srcEnd != 'number' || srcEnd > this.length) srcEnd = this.length if (srcStart >= this.length) return dst || Buffer.alloc(0) if (srcEnd <= 0) return dst || Buffer.alloc(0) var copy = !!dst , off = this._offset(srcStart) , len = srcEnd - srcStart , bytes = len , bufoff = (copy && dstStart) || 0 , start = off[1] , l , i // copy/slice everything if (srcStart === 0 && srcEnd == this.length) { if (!copy) { // slice, but full concat if multiple buffers return this._bufs.length === 1 ? this._bufs[0] : Buffer.concat(this._bufs, this.length) } // copy, need to copy individual buffers for (i = 0; i < this._bufs.length; i++) { this._bufs[i].copy(dst, bufoff) bufoff += this._bufs[i].length } return dst } // easy, cheap case where it's a subset of one of the buffers if (bytes <= this._bufs[off[0]].length - start) { return copy ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes) : this._bufs[off[0]].slice(start, start + bytes) } if (!copy) // a slice, we need something to copy in to dst = Buffer.allocUnsafe(len) for (i = off[0]; i < this._bufs.length; i++) { l = this._bufs[i].length - start if (bytes > l) { this._bufs[i].copy(dst, bufoff, start) bufoff += l } else { this._bufs[i].copy(dst, bufoff, start, start + bytes) bufoff += l break } bytes -= l if (start) start = 0 } // safeguard so that we don't return uninitialized memory if (dst.length > bufoff) return dst.slice(0, bufoff) return dst } BufferList.prototype.shallowSlice = function shallowSlice (start, end) { start = start || 0 end = end || this.length if (start < 0) start += this.length if (end < 0) end += this.length var startOffset = this._offset(start) , endOffset = this._offset(end) , buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1) if (endOffset[1] == 0) buffers.pop() else buffers[buffers.length-1] = buffers[buffers.length-1].slice(0, endOffset[1]) if (startOffset[1] != 0) buffers[0] = buffers[0].slice(startOffset[1]) return new BufferList(buffers) } BufferList.prototype.toString = function toString (encoding, start, end) { return this.slice(start, end).toString(encoding) } BufferList.prototype.consume = function consume (bytes) { // first, normalize the argument, in accordance with how Buffer does it bytes = Math.trunc(bytes) // do nothing if not a positive number if (Number.isNaN(bytes) || bytes <= 0) return this while (this._bufs.length) { if (bytes >= this._bufs[0].length) { bytes -= this._bufs[0].length this.length -= this._bufs[0].length this._bufs.shift() } else { this._bufs[0] = this._bufs[0].slice(bytes) this.length -= bytes break } } return this } BufferList.prototype.duplicate = function duplicate () { var i = 0 , copy = new BufferList() for (; i < this._bufs.length; i++) copy.append(this._bufs[i]) return copy } BufferList.prototype.destroy = function destroy () { this._bufs.length = 0 this.length = 0 this.push(null) } ;(function () { var methods = { 'readDoubleBE' : 8 , 'readDoubleLE' : 8 , 'readFloatBE' : 4 , 'readFloatLE' : 4 , 'readInt32BE' : 4 , 'readInt32LE' : 4 , 'readUInt32BE' : 4 , 'readUInt32LE' : 4 , 'readInt16BE' : 2 , 'readInt16LE' : 2 , 'readUInt16BE' : 2 , 'readUInt16LE' : 2 , 'readInt8' : 1 , 'readUInt8' : 1 } for (var m in methods) { (function (m) { BufferList.prototype[m] = function (offset) { return this.slice(offset, offset + methods[m])[m](0) } }(m)) } }()) module.exports = BufferList The MIT License (MIT) ===================== Copyright (c) 2013-2016 bl contributors ---------------------------------- *bl contributors listed at * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "bl", "version": "1.2.3", "description": "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too!", "main": "bl.js", "scripts": { "test": "node test/test.js | faucet" }, "repository": { "type": "git", "url": "https://github.com/rvagg/bl.git" }, "homepage": "https://github.com/rvagg/bl", "authors": [ "Rod Vagg (https://github.com/rvagg)", "Matteo Collina (https://github.com/mcollina)", "Jarett Cruger (https://github.com/jcrugzz)" ], "keywords": [ "buffer", "buffers", "stream", "awesomesauce" ], "license": "MIT", "dependencies": { "readable-stream": "^2.3.5", "safe-buffer": "^5.1.1" }, "devDependencies": { "faucet": "0.0.1", "hash_file": "~0.1.1", "tape": "~4.9.0" } } ISC License Copyright npm, Inc. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND NPM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NPM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "@npmcli/fs", "version": "1.1.1", "description": "filesystem utilities for the npm cli", "main": "lib/index.js", "files": [ "bin", "lib" ], "scripts": { "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", "snap": "tap", "test": "tap", "npmclilint": "npmcli-lint", "lint": "eslint '**/*.js'", "lintfix": "npm run lint -- --fix", "posttest": "npm run lint", "postsnap": "npm run lintfix --", "postlint": "npm-template-check" }, "keywords": [ "npm", "oss" ], "author": "GitHub Inc.", "license": "ISC", "devDependencies": { "@npmcli/template-oss": "^2.3.1", "tap": "^15.0.9" }, "dependencies": { "@gar/promisify": "^1.0.1", "semver": "^7.3.5" }, "templateVersion": "2.3.1" } const fs = require('./fs.js') const getOptions = require('./common/get-options.js') const owner = require('./common/owner.js') const copyFile = async (src, dest, opts) => { const options = getOptions(opts, { copy: ['mode', 'owner'], wrap: 'mode', }) const { uid, gid } = await owner.validate(dest, options.owner) // the node core method as of 16.5.0 does not support the mode being in an // object, so we have to pass the mode value directly const result = await fs.copyFile(src, dest, options.mode) await owner.update(dest, uid, gid) return result } module.exports = copyFile 'use strict' const { inspect } = require('util') // adapted from node's internal/errors // https://github.com/nodejs/node/blob/c8a04049/lib/internal/errors.js // close copy of node's internal SystemError class. class SystemError { constructor (code, prefix, context) { // XXX context.code is undefined in all constructors used in cp/polyfill // that may be a bug copied from node, maybe the constructor should use // `code` not `errno`? nodejs/node#41104 let message = `${prefix}: ${context.syscall} returned ` + `${context.code} (${context.message})` if (context.path !== undefined) { message += ` ${context.path}` } if (context.dest !== undefined) { message += ` => ${context.dest}` } this.code = code Object.defineProperties(this, { name: { value: 'SystemError', enumerable: false, writable: true, configurable: true, }, message: { value: message, enumerable: false, writable: true, configurable: true, }, info: { value: context, enumerable: true, configurable: true, writable: false, }, errno: { get () { return context.errno }, set (value) { context.errno = value }, enumerable: true, configurable: true, }, syscall: { get () { return context.syscall }, set (value) { context.syscall = value }, enumerable: true, configurable: true, }, }) if (context.path !== undefined) { Object.defineProperty(this, 'path', { get () { return context.path }, set (value) { context.path = value }, enumerable: true, configurable: true, }) } if (context.dest !== undefined) { Object.defineProperty(this, 'dest', { get () { return context.dest }, set (value) { context.dest = value }, enumerable: true, configurable: true, }) } } toString () { return `${this.name} [${this.code}]: ${this.message}` } [Symbol.for('nodejs.util.inspect.custom')] (_recurseTimes, ctx) { return inspect(this, { ...ctx, getters: true, customInspect: false, }) } } function E (code, message) { module.exports[code] = class NodeError extends SystemError { constructor (ctx) { super(code, message, ctx) } } } E('ERR_FS_CP_DIR_TO_NON_DIR', 'Cannot overwrite directory with non-directory') E('ERR_FS_CP_EEXIST', 'Target already exists') E('ERR_FS_CP_EINVAL', 'Invalid src or dest') E('ERR_FS_CP_FIFO_PIPE', 'Cannot copy a FIFO pipe') E('ERR_FS_CP_NON_DIR_TO_DIR', 'Cannot overwrite non-directory with directory') E('ERR_FS_CP_SOCKET', 'Cannot copy a socket file') E('ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY', 'Cannot overwrite symlink in subdirectory of self') E('ERR_FS_CP_UNKNOWN', 'Cannot copy an unknown file type') E('ERR_FS_EISDIR', 'Path is a directory') module.exports.ERR_INVALID_ARG_TYPE = class ERR_INVALID_ARG_TYPE extends Error { constructor (name, expected, actual) { super() this.code = 'ERR_INVALID_ARG_TYPE' this.message = `The ${name} argument must be ${expected}. Received ${typeof actual}` } } const fs = require('fs') const promisify = require('@gar/promisify') // this module returns the core fs module wrapped in a proxy that promisifies // method calls within the getter. we keep it in a separate module so that the // overridden methods have a consistent way to get to promisified fs methods // without creating a circular dependency module.exports = promisify(fs) module.exports = { ...require('./fs.js'), copyFile: require('./copy-file.js'), cp: require('./cp/index.js'), mkdir: require('./mkdir/index.js'), mkdtemp: require('./mkdtemp.js'), rm: require('./rm/index.js'), withTempDir: require('./with-temp-dir.js'), writeFile: require('./write-file.js'), } const { dirname, sep } = require('path') const fs = require('./fs.js') const getOptions = require('./common/get-options.js') const owner = require('./common/owner.js') const mkdtemp = async (prefix, opts) => { const options = getOptions(opts, { copy: ['encoding', 'owner'], wrap: 'encoding', }) // mkdtemp relies on the trailing path separator to indicate if it should // create a directory inside of the prefix. if that's the case then the root // we infer ownership from is the prefix itself, otherwise it's the dirname // /tmp -> /tmpABCDEF, infers from / // /tmp/ -> /tmp/ABCDEF, infers from /tmp const root = prefix.endsWith(sep) ? prefix : dirname(prefix) const { uid, gid } = await owner.validate(root, options.owner) const result = await fs.mkdtemp(prefix, options) await owner.update(result, uid, gid) return result } module.exports = mkdtemp const { join, sep } = require('path') const getOptions = require('./common/get-options.js') const mkdir = require('./mkdir/index.js') const mkdtemp = require('./mkdtemp.js') const rm = require('./rm/index.js') // create a temp directory, ensure its permissions match its parent, then call // the supplied function passing it the path to the directory. clean up after // the function finishes, whether it throws or not const withTempDir = async (root, fn, opts) => { const options = getOptions(opts, { copy: ['tmpPrefix'], }) // create the directory, and fix its ownership await mkdir(root, { recursive: true, owner: 'inherit' }) const target = await mkdtemp(join(`${root}${sep}`, options.tmpPrefix || ''), { owner: 'inherit' }) let err let result try { result = await fn(target) } catch (_err) { err = _err } try { await rm(target, { force: true, recursive: true }) } catch (err) {} if (err) { throw err } return result } module.exports = withTempDir const fs = require('./fs.js') const getOptions = require('./common/get-options.js') const owner = require('./common/owner.js') const writeFile = async (file, data, opts) => { const options = getOptions(opts, { copy: ['encoding', 'mode', 'flag', 'signal', 'owner'], wrap: 'encoding', }) const { uid, gid } = await owner.validate(file, options.owner) const result = await fs.writeFile(file, data, options) await owner.update(file, uid, gid) return result } module.exports = writeFile // given an input that may or may not be an object, return an object that has // a copy of every defined property listed in 'copy'. if the input is not an // object, assign it to the property named by 'wrap' const getOptions = (input, { copy, wrap }) => { const result = {} if (input && typeof input === 'object') { for (const prop of copy) { if (input[prop] !== undefined) { result[prop] = input[prop] } } } else { result[wrap] = input } return result } module.exports = getOptions const semver = require('semver') const satisfies = (range) => { return semver.satisfies(process.version, range, { includePrerelease: true }) } module.exports = { satisfies, } const { dirname, resolve } = require('path') const fileURLToPath = require('./file-url-to-path/index.js') const fs = require('../fs.js') // given a path, find the owner of the nearest parent const find = async (path) => { // if we have no getuid, permissions are irrelevant on this platform if (!process.getuid) { return {} } // fs methods accept URL objects with a scheme of file: so we need to unwrap // those into an actual path string before we can resolve it const resolved = path != null && path.href && path.origin ? resolve(fileURLToPath(path)) : resolve(path) let stat try { stat = await fs.lstat(resolved) } finally { // if we got a stat, return its contents if (stat) { return { uid: stat.uid, gid: stat.gid } } // try the parent directory if (resolved !== dirname(resolved)) { return find(dirname(resolved)) } // no more parents, never got a stat, just return an empty object return {} } } // given a path, uid, and gid update the ownership of the path if necessary const update = async (path, uid, gid) => { // nothing to update, just exit if (uid === undefined && gid === undefined) { return } try { // see if the permissions are already the same, if they are we don't // need to do anything, so return early const stat = await fs.stat(path) if (uid === stat.uid && gid === stat.gid) { return } } catch (err) {} try { await fs.chown(path, uid, gid) } catch (err) {} } // accepts a `path` and the `owner` property of an options object and normalizes // it into an object with numerical `uid` and `gid` const validate = async (path, input) => { let uid let gid if (typeof input === 'string' || typeof input === 'number') { uid = input gid = input } else if (input && typeof input === 'object') { uid = input.uid gid = input.gid } if (uid === 'inherit' || gid === 'inherit') { const owner = await find(path) if (uid === 'inherit') { uid = owner.uid } if (gid === 'inherit') { gid = owner.gid } } return { uid, gid } } module.exports = { find, update, validate, } const fs = require('../fs.js') const getOptions = require('../common/get-options.js') const node = require('../common/node.js') const polyfill = require('./polyfill.js') // node 16.7.0 added fs.cp const useNative = node.satisfies('>=16.7.0') const cp = async (src, dest, opts) => { const options = getOptions(opts, { copy: ['dereference', 'errorOnExist', 'filter', 'force', 'preserveTimestamps', 'recursive'], }) // the polyfill is tested separately from this module, no need to hack // process.version to try to trigger it just for coverage // istanbul ignore next return useNative ? fs.cp(src, dest, options) : polyfill(src, dest, options) } module.exports = cp (The MIT License) Copyright (c) 2011-2017 JP Richardson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // this file is a modified version of the code in node 17.2.0 // which is, in turn, a modified version of the fs-extra module on npm // node core changes: // - Use of the assert module has been replaced with core's error system. // - All code related to the glob dependency has been removed. // - Bring your own custom fs module is not currently supported. // - Some basic code cleanup. // changes here: // - remove all callback related code // - drop sync support // - change assertions back to non-internal methods (see options.js) // - throws ENOTDIR when rmdir gets an ENOENT for a path that exists in Windows 'use strict' const { ERR_FS_CP_DIR_TO_NON_DIR, ERR_FS_CP_EEXIST, ERR_FS_CP_EINVAL, ERR_FS_CP_FIFO_PIPE, ERR_FS_CP_NON_DIR_TO_DIR, ERR_FS_CP_SOCKET, ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY, ERR_FS_CP_UNKNOWN, ERR_FS_EISDIR, ERR_INVALID_ARG_TYPE, } = require('../errors.js') const { constants: { errno: { EEXIST, EISDIR, EINVAL, ENOTDIR, }, }, } = require('os') const { chmod, copyFile, lstat, mkdir, readdir, readlink, stat, symlink, unlink, utimes, } = require('../fs.js') const { dirname, isAbsolute, join, parse, resolve, sep, toNamespacedPath, } = require('path') const { fileURLToPath } = require('url') const defaultOptions = { dereference: false, errorOnExist: false, filter: undefined, force: true, preserveTimestamps: false, recursive: false, } async function cp (src, dest, opts) { if (opts != null && typeof opts !== 'object') { throw new ERR_INVALID_ARG_TYPE('options', ['Object'], opts) } return cpFn( toNamespacedPath(getValidatedPath(src)), toNamespacedPath(getValidatedPath(dest)), { ...defaultOptions, ...opts }) } function getValidatedPath (fileURLOrPath) { const path = fileURLOrPath != null && fileURLOrPath.href && fileURLOrPath.origin ? fileURLToPath(fileURLOrPath) : fileURLOrPath return path } async function cpFn (src, dest, opts) { // Warn about using preserveTimestamps on 32-bit node // istanbul ignore next if (opts.preserveTimestamps && process.arch === 'ia32') { const warning = 'Using the preserveTimestamps option in 32-bit ' + 'node is not recommended' process.emitWarning(warning, 'TimestampPrecisionWarning') } const stats = await checkPaths(src, dest, opts) const { srcStat, destStat } = stats await checkParentPaths(src, srcStat, dest) if (opts.filter) { return handleFilter(checkParentDir, destStat, src, dest, opts) } return checkParentDir(destStat, src, dest, opts) } async function checkPaths (src, dest, opts) { const { 0: srcStat, 1: destStat } = await getStats(src, dest, opts) if (destStat) { if (areIdentical(srcStat, destStat)) { throw new ERR_FS_CP_EINVAL({ message: 'src and dest cannot be the same', path: dest, syscall: 'cp', errno: EINVAL, }) } if (srcStat.isDirectory() && !destStat.isDirectory()) { throw new ERR_FS_CP_DIR_TO_NON_DIR({ message: `cannot overwrite directory ${src} ` + `with non-directory ${dest}`, path: dest, syscall: 'cp', errno: EISDIR, }) } if (!srcStat.isDirectory() && destStat.isDirectory()) { throw new ERR_FS_CP_NON_DIR_TO_DIR({ message: `cannot overwrite non-directory ${src} ` + `with directory ${dest}`, path: dest, syscall: 'cp', errno: ENOTDIR, }) } } if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { throw new ERR_FS_CP_EINVAL({ message: `cannot copy ${src} to a subdirectory of self ${dest}`, path: dest, syscall: 'cp', errno: EINVAL, }) } return { srcStat, destStat } } function areIdentical (srcStat, destStat) { return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev } function getStats (src, dest, opts) { const statFunc = opts.dereference ? (file) => stat(file, { bigint: true }) : (file) => lstat(file, { bigint: true }) return Promise.all([ statFunc(src), statFunc(dest).catch((err) => { // istanbul ignore next: unsure how to cover. if (err.code === 'ENOENT') { return null } // istanbul ignore next: unsure how to cover. throw err }), ]) } async function checkParentDir (destStat, src, dest, opts) { const destParent = dirname(dest) const dirExists = await pathExists(destParent) if (dirExists) { return getStatsForCopy(destStat, src, dest, opts) } await mkdir(destParent, { recursive: true }) return getStatsForCopy(destStat, src, dest, opts) } function pathExists (dest) { return stat(dest).then( () => true, // istanbul ignore next: not sure when this would occur (err) => (err.code === 'ENOENT' ? false : Promise.reject(err))) } // Recursively check if dest parent is a subdirectory of src. // It works for all file types including symlinks since it // checks the src and dest inodes. It starts from the deepest // parent and stops once it reaches the src parent or the root path. async function checkParentPaths (src, srcStat, dest) { const srcParent = resolve(dirname(src)) const destParent = resolve(dirname(dest)) if (destParent === srcParent || destParent === parse(destParent).root) { return } let destStat try { destStat = await stat(destParent, { bigint: true }) } catch (err) { // istanbul ignore else: not sure when this would occur if (err.code === 'ENOENT') { return } // istanbul ignore next: not sure when this would occur throw err } if (areIdentical(srcStat, destStat)) { throw new ERR_FS_CP_EINVAL({ message: `cannot copy ${src} to a subdirectory of self ${dest}`, path: dest, syscall: 'cp', errno: EINVAL, }) } return checkParentPaths(src, srcStat, destParent) } const normalizePathToArray = (path) => resolve(path).split(sep).filter(Boolean) // Return true if dest is a subdir of src, otherwise false. // It only checks the path strings. function isSrcSubdir (src, dest) { const srcArr = normalizePathToArray(src) const destArr = normalizePathToArray(dest) return srcArr.every((cur, i) => destArr[i] === cur) } async function handleFilter (onInclude, destStat, src, dest, opts, cb) { const include = await opts.filter(src, dest) if (include) { return onInclude(destStat, src, dest, opts, cb) } } function startCopy (destStat, src, dest, opts) { if (opts.filter) { return handleFilter(getStatsForCopy, destStat, src, dest, opts) } return getStatsForCopy(destStat, src, dest, opts) } async function getStatsForCopy (destStat, src, dest, opts) { const statFn = opts.dereference ? stat : lstat const srcStat = await statFn(src) // istanbul ignore else: can't portably test FIFO if (srcStat.isDirectory() && opts.recursive) { return onDir(srcStat, destStat, src, dest, opts) } else if (srcStat.isDirectory()) { throw new ERR_FS_EISDIR({ message: `${src} is a directory (not copied)`, path: src, syscall: 'cp', errno: EINVAL, }) } else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) { return onFile(srcStat, destStat, src, dest, opts) } else if (srcStat.isSymbolicLink()) { return onLink(destStat, src, dest) } else if (srcStat.isSocket()) { throw new ERR_FS_CP_SOCKET({ message: `cannot copy a socket file: ${dest}`, path: dest, syscall: 'cp', errno: EINVAL, }) } else if (srcStat.isFIFO()) { throw new ERR_FS_CP_FIFO_PIPE({ message: `cannot copy a FIFO pipe: ${dest}`, path: dest, syscall: 'cp', errno: EINVAL, }) } // istanbul ignore next: should be unreachable throw new ERR_FS_CP_UNKNOWN({ message: `cannot copy an unknown file type: ${dest}`, path: dest, syscall: 'cp', errno: EINVAL, }) } function onFile (srcStat, destStat, src, dest, opts) { if (!destStat) { return _copyFile(srcStat, src, dest, opts) } return mayCopyFile(srcStat, src, dest, opts) } async function mayCopyFile (srcStat, src, dest, opts) { if (opts.force) { await unlink(dest) return _copyFile(srcStat, src, dest, opts) } else if (opts.errorOnExist) { throw new ERR_FS_CP_EEXIST({ message: `${dest} already exists`, path: dest, syscall: 'cp', errno: EEXIST, }) } } async function _copyFile (srcStat, src, dest, opts) { await copyFile(src, dest) if (opts.preserveTimestamps) { return handleTimestampsAndMode(srcStat.mode, src, dest) } return setDestMode(dest, srcStat.mode) } async function handleTimestampsAndMode (srcMode, src, dest) { // Make sure the file is writable before setting the timestamp // otherwise open fails with EPERM when invoked with 'r+' // (through utimes call) if (fileIsNotWritable(srcMode)) { await makeFileWritable(dest, srcMode) return setDestTimestampsAndMode(srcMode, src, dest) } return setDestTimestampsAndMode(srcMode, src, dest) } function fileIsNotWritable (srcMode) { return (srcMode & 0o200) === 0 } function makeFileWritable (dest, srcMode) { return setDestMode(dest, srcMode | 0o200) } async function setDestTimestampsAndMode (srcMode, src, dest) { await setDestTimestamps(src, dest) return setDestMode(dest, srcMode) } function setDestMode (dest, srcMode) { return chmod(dest, srcMode) } async function setDestTimestamps (src, dest) { // The initial srcStat.atime cannot be trusted // because it is modified by the read(2) system call // (See https://nodejs.org/api/fs.html#fs_stat_time_values) const updatedSrcStat = await stat(src) return utimes(dest, updatedSrcStat.atime, updatedSrcStat.mtime) } function onDir (srcStat, destStat, src, dest, opts) { if (!destStat) { return mkDirAndCopy(srcStat.mode, src, dest, opts) } return copyDir(src, dest, opts) } async function mkDirAndCopy (srcMode, src, dest, opts) { await mkdir(dest) await copyDir(src, dest, opts) return setDestMode(dest, srcMode) } async function copyDir (src, dest, opts) { const dir = await readdir(src) for (let i = 0; i < dir.length; i++) { const item = dir[i] const srcItem = join(src, item) const destItem = join(dest, item) const { destStat } = await checkPaths(srcItem, destItem, opts) await startCopy(destStat, srcItem, destItem, opts) } } async function onLink (destStat, src, dest) { let resolvedSrc = await readlink(src) if (!isAbsolute(resolvedSrc)) { resolvedSrc = resolve(dirname(src), resolvedSrc) } if (!destStat) { return symlink(resolvedSrc, dest) } let resolvedDest try { resolvedDest = await readlink(dest) } catch (err) { // Dest exists and is a regular file or directory, // Windows may throw UNKNOWN error. If dest already exists, // fs throws error anyway, so no need to guard against it here. // istanbul ignore next: can only test on windows if (err.code === 'EINVAL' || err.code === 'UNKNOWN') { return symlink(resolvedSrc, dest) } // istanbul ignore next: should not be possible throw err } if (!isAbsolute(resolvedDest)) { resolvedDest = resolve(dirname(dest), resolvedDest) } if (isSrcSubdir(resolvedSrc, resolvedDest)) { throw new ERR_FS_CP_EINVAL({ message: `cannot copy ${resolvedSrc} to a subdirectory of self ` + `${resolvedDest}`, path: dest, syscall: 'cp', errno: EINVAL, }) } // Do not copy if src is a subdir of dest since unlinking // dest in this case would result in removing src contents // and therefore a broken symlink would be created. const srcStat = await stat(src) if (srcStat.isDirectory() && isSrcSubdir(resolvedDest, resolvedSrc)) { throw new ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY({ message: `cannot overwrite ${resolvedDest} with ${resolvedSrc}`, path: dest, syscall: 'cp', errno: EINVAL, }) } return copyLink(resolvedSrc, dest) } async function copyLink (resolvedSrc, dest) { await unlink(dest) return symlink(resolvedSrc, dest) } module.exports = cp const fs = require('../fs.js') const getOptions = require('../common/get-options.js') const node = require('../common/node.js') const owner = require('../common/owner.js') const polyfill = require('./polyfill.js') // node 10.12.0 added the options parameter, which allows recursive and mode // properties to be passed const useNative = node.satisfies('>=10.12.0') // extends mkdir with the ability to specify an owner of the new dir const mkdir = async (path, opts) => { const options = getOptions(opts, { copy: ['mode', 'recursive', 'owner'], wrap: 'mode', }) const { uid, gid } = await owner.validate(path, options.owner) // the polyfill is tested separately from this module, no need to hack // process.version to try to trigger it just for coverage // istanbul ignore next const result = useNative ? await fs.mkdir(path, options) : await polyfill(path, options) await owner.update(path, uid, gid) return result } module.exports = mkdir const { dirname } = require('path') const fileURLToPath = require('../common/file-url-to-path/index.js') const fs = require('../fs.js') const defaultOptions = { mode: 0o777, recursive: false, } const mkdir = async (path, opts) => { const options = { ...defaultOptions, ...opts } // if we're not in recursive mode, just call the real mkdir with the path and // the mode option only if (!options.recursive) { return fs.mkdir(path, options.mode) } const makeDirectory = async (dir, mode) => { // we can't use dirname directly since these functions support URL // objects with the file: protocol as the path input, so first we get a // string path, then we can call dirname on that const parent = dir != null && dir.href && dir.origin ? dirname(fileURLToPath(dir)) : dirname(dir) // if the parent is the dir itself, try to create it. anything but EISDIR // should be rethrown if (parent === dir) { try { await fs.mkdir(dir, opts) } catch (err) { if (err.code !== 'EISDIR') { throw err } } return undefined } try { await fs.mkdir(dir, mode) return dir } catch (err) { // ENOENT means the parent wasn't there, so create that if (err.code === 'ENOENT') { const made = await makeDirectory(parent, mode) await makeDirectory(dir, mode) // return the shallowest path we created, i.e. the result of creating // the parent return made } // an EEXIST means there's already something there // an EROFS means we have a read-only filesystem and can't create a dir // any other error is fatal and we should give up now if (err.code !== 'EEXIST' && err.code !== 'EROFS') { throw err } // stat the directory, if the result is a directory, then we successfully // created this one so return its path. otherwise, we reject with the // original error by ignoring the error in the catch try { const stat = await fs.stat(dir) if (stat.isDirectory()) { // if it already existed, we didn't create anything so return // undefined return undefined } } catch (_) {} // if the thing that's there isn't a directory, then just re-throw throw err } } return makeDirectory(path, options.mode) } module.exports = mkdir const fs = require('../fs.js') const getOptions = require('../common/get-options.js') const node = require('../common/node.js') const polyfill = require('./polyfill.js') // node 14.14.0 added fs.rm, which allows both the force and recursive options const useNative = node.satisfies('>=14.14.0') const rm = async (path, opts) => { const options = getOptions(opts, { copy: ['retryDelay', 'maxRetries', 'recursive', 'force'], }) // the polyfill is tested separately from this module, no need to hack // process.version to try to trigger it just for coverage // istanbul ignore next return useNative ? fs.rm(path, options) : polyfill(path, options) } module.exports = rm // this file is a modified version of the code in node core >=14.14.0 // which is, in turn, a modified version of the rimraf module on npm // node core changes: // - Use of the assert module has been replaced with core's error system. // - All code related to the glob dependency has been removed. // - Bring your own custom fs module is not currently supported. // - Some basic code cleanup. // changes here: // - remove all callback related code // - drop sync support // - change assertions back to non-internal methods (see options.js) // - throws ENOTDIR when rmdir gets an ENOENT for a path that exists in Windows const errnos = require('os').constants.errno const { join } = require('path') const fs = require('../fs.js') // error codes that mean we need to remove contents const notEmptyCodes = new Set([ 'ENOTEMPTY', 'EEXIST', 'EPERM', ]) // error codes we can retry later const retryCodes = new Set([ 'EBUSY', 'EMFILE', 'ENFILE', 'ENOTEMPTY', 'EPERM', ]) const isWindows = process.platform === 'win32' const defaultOptions = { retryDelay: 100, maxRetries: 0, recursive: false, force: false, } // this is drastically simplified, but should be roughly equivalent to what // node core throws class ERR_FS_EISDIR extends Error { constructor (path) { super() this.info = { code: 'EISDIR', message: 'is a directory', path, syscall: 'rm', errno: errnos.EISDIR, } this.name = 'SystemError' this.code = 'ERR_FS_EISDIR' this.errno = errnos.EISDIR this.syscall = 'rm' this.path = path this.message = `Path is a directory: ${this.syscall} returned ` + `${this.info.code} (is a directory) ${path}` } toString () { return `${this.name} [${this.code}]: ${this.message}` } } class ENOTDIR extends Error { constructor (path) { super() this.name = 'Error' this.code = 'ENOTDIR' this.errno = errnos.ENOTDIR this.syscall = 'rmdir' this.path = path this.message = `not a directory, ${this.syscall} '${this.path}'` } toString () { return `${this.name}: ${this.code}: ${this.message}` } } // force is passed separately here because we respect it for the first entry // into rimraf only, any further calls that are spawned as a result (i.e. to // delete content within the target) will ignore ENOENT errors const rimraf = async (path, options, isTop = false) => { const force = isTop ? options.force : true const stat = await fs.lstat(path) .catch((err) => { // we only ignore ENOENT if we're forcing this call if (err.code === 'ENOENT' && force) { return } if (isWindows && err.code === 'EPERM') { return fixEPERM(path, options, err, isTop) } throw err }) // no stat object here means either lstat threw an ENOENT, or lstat threw // an EPERM and the fixPERM function took care of things. either way, we're // already done, so return early if (!stat) { return } if (stat.isDirectory()) { return rmdir(path, options, null, isTop) } return fs.unlink(path) .catch((err) => { if (err.code === 'ENOENT' && force) { return } if (err.code === 'EISDIR') { return rmdir(path, options, err, isTop) } if (err.code === 'EPERM') { // in windows, we handle this through fixEPERM which will also try to // delete things again. everywhere else since deleting the target as a // file didn't work we go ahead and try to delete it as a directory return isWindows ? fixEPERM(path, options, err, isTop) : rmdir(path, options, err, isTop) } throw err }) } const fixEPERM = async (path, options, originalErr, isTop) => { const force = isTop ? options.force : true const targetMissing = await fs.chmod(path, 0o666) .catch((err) => { if (err.code === 'ENOENT' && force) { return true } throw originalErr }) // got an ENOENT above, return now. no file = no problem if (targetMissing) { return } // this function does its own lstat rather than calling rimraf again to avoid // infinite recursion for a repeating EPERM const stat = await fs.lstat(path) .catch((err) => { if (err.code === 'ENOENT' && force) { return } throw originalErr }) if (!stat) { return } if (stat.isDirectory()) { return rmdir(path, options, originalErr, isTop) } return fs.unlink(path) } const rmdir = async (path, options, originalErr, isTop) => { if (!options.recursive && isTop) { throw originalErr || new ERR_FS_EISDIR(path) } const force = isTop ? options.force : true return fs.rmdir(path) .catch(async (err) => { // in Windows, calling rmdir on a file path will fail with ENOENT rather // than ENOTDIR. to determine if that's what happened, we have to do // another lstat on the path. if the path isn't actually gone, we throw // away the ENOENT and replace it with our own ENOTDIR if (isWindows && err.code === 'ENOENT') { const stillExists = await fs.lstat(path).then(() => true, () => false) if (stillExists) { err = new ENOTDIR(path) } } // not there, not a problem if (err.code === 'ENOENT' && force) { return } // we may not have originalErr if lstat tells us our target is a // directory but that changes before we actually remove it, so // only throw it here if it's set if (originalErr && err.code === 'ENOTDIR') { throw originalErr } // the directory isn't empty, remove the contents and try again if (notEmptyCodes.has(err.code)) { const files = await fs.readdir(path) await Promise.all(files.map((file) => { const target = join(path, file) return rimraf(target, options) })) return fs.rmdir(path) } throw err }) } const rm = async (path, opts) => { const options = { ...defaultOptions, ...opts } let retries = 0 const errHandler = async (err) => { if (retryCodes.has(err.code) && ++retries < options.maxRetries) { const delay = retries * options.retryDelay await promiseTimeout(delay) return rimraf(path, options, true).catch(errHandler) } throw err } return rimraf(path, options, true).catch(errHandler) } const promiseTimeout = (ms) => new Promise((r) => setTimeout(r, ms)) module.exports = rm // just pre-load all the stuff that index.js lazily exports const internalRe = require('./internal/re') module.exports = { re: internalRe.re, src: internalRe.src, tokens: internalRe.t, SEMVER_SPEC_VERSION: require('./internal/constants').SEMVER_SPEC_VERSION, SemVer: require('./classes/semver'), compareIdentifiers: require('./internal/identifiers').compareIdentifiers, rcompareIdentifiers: require('./internal/identifiers').rcompareIdentifiers, parse: require('./functions/parse'), valid: require('./functions/valid'), clean: require('./functions/clean'), inc: require('./functions/inc'), diff: require('./functions/diff'), major: require('./functions/major'), minor: require('./functions/minor'), patch: require('./functions/patch'), prerelease: require('./functions/prerelease'), compare: require('./functions/compare'), rcompare: require('./functions/rcompare'), compareLoose: require('./functions/compare-loose'), compareBuild: require('./functions/compare-build'), sort: require('./functions/sort'), rsort: require('./functions/rsort'), gt: require('./functions/gt'), lt: require('./functions/lt'), eq: require('./functions/eq'), neq: require('./functions/neq'), gte: require('./functions/gte'), lte: require('./functions/lte'), cmp: require('./functions/cmp'), coerce: require('./functions/coerce'), Comparator: require('./classes/comparator'), Range: require('./classes/range'), satisfies: require('./functions/satisfies'), toComparators: require('./ranges/to-comparators'), maxSatisfying: require('./ranges/max-satisfying'), minSatisfying: require('./ranges/min-satisfying'), minVersion: require('./ranges/min-version'), validRange: require('./ranges/valid'), outside: require('./ranges/outside'), gtr: require('./ranges/gtr'), ltr: require('./ranges/ltr'), intersects: require('./ranges/intersects'), simplifyRange: require('./ranges/simplify'), subset: require('./ranges/subset'), } The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "semver", "version": "7.3.5", "description": "The semantic version parser used by npm.", "main": "index.js", "scripts": { "test": "tap", "snap": "tap", "preversion": "npm test", "postversion": "npm publish", "postpublish": "git push origin --follow-tags" }, "devDependencies": { "tap": "^14.10.7" }, "license": "ISC", "repository": "https://github.com/npm/node-semver", "bin": { "semver": "bin/semver.js" }, "files": [ "bin/**/*.js", "range.bnf", "classes/**/*.js", "functions/**/*.js", "internal/**/*.js", "ranges/**/*.js", "index.js", "preload.js" ], "tap": { "check-coverage": true, "coverage-map": "map.js" }, "engines": { "node": ">=10" }, "dependencies": { "lru-cache": "^6.0.0" } } // XXX remove in v8 or beyond module.exports = require('./index.js') range-set ::= range ( logical-or range ) * logical-or ::= ( ' ' ) * '||' ( ' ' ) * range ::= hyphen | simple ( ' ' simple ) * | '' hyphen ::= partial ' - ' partial simple ::= primitive | partial | tilde | caret primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? xr ::= 'x' | 'X' | '*' | nr nr ::= '0' | [1-9] ( [0-9] ) * tilde ::= '~' partial caret ::= '^' partial qualifier ::= ( '-' pre )? ( '+' build )? pre ::= parts build ::= parts parts ::= part ( '.' part ) * part ::= nr | [-0-9A-Za-z]+ const url = require('url') const node = require('../node.js') const polyfill = require('./polyfill.js') const useNative = node.satisfies('>=10.12.0') const fileURLToPath = (path) => { // the polyfill is tested separately from this module, no need to hack // process.version to try to trigger it just for coverage // istanbul ignore next return useNative ? url.fileURLToPath(path) : polyfill(path) } module.exports = fileURLToPath const { URL, domainToUnicode } = require('url') const CHAR_LOWERCASE_A = 97 const CHAR_LOWERCASE_Z = 122 const isWindows = process.platform === 'win32' class ERR_INVALID_FILE_URL_HOST extends TypeError { constructor (platform) { super(`File URL host must be "localhost" or empty on ${platform}`) this.code = 'ERR_INVALID_FILE_URL_HOST' } toString () { return `${this.name} [${this.code}]: ${this.message}` } } class ERR_INVALID_FILE_URL_PATH extends TypeError { constructor (msg) { super(`File URL path ${msg}`) this.code = 'ERR_INVALID_FILE_URL_PATH' } toString () { return `${this.name} [${this.code}]: ${this.message}` } } class ERR_INVALID_ARG_TYPE extends TypeError { constructor (name, actual) { super(`The "${name}" argument must be one of type string or an instance ` + `of URL. Received type ${typeof actual} ${actual}`) this.code = 'ERR_INVALID_ARG_TYPE' } toString () { return `${this.name} [${this.code}]: ${this.message}` } } class ERR_INVALID_URL_SCHEME extends TypeError { constructor (expected) { super(`The URL must be of scheme ${expected}`) this.code = 'ERR_INVALID_URL_SCHEME' } toString () { return `${this.name} [${this.code}]: ${this.message}` } } const isURLInstance = (input) => { return input != null && input.href && input.origin } const getPathFromURLWin32 = (url) => { const hostname = url.hostname let pathname = url.pathname for (let n = 0; n < pathname.length; n++) { if (pathname[n] === '%') { const third = pathname.codePointAt(n + 2) | 0x20 if ((pathname[n + 1] === '2' && third === 102) || (pathname[n + 1] === '5' && third === 99)) { throw new ERR_INVALID_FILE_URL_PATH('must not include encoded \\ or / characters') } } } pathname = pathname.replace(/\//g, '\\') pathname = decodeURIComponent(pathname) if (hostname !== '') { return `\\\\${domainToUnicode(hostname)}${pathname}` } const letter = pathname.codePointAt(1) | 0x20 const sep = pathname[2] if (letter < CHAR_LOWERCASE_A || letter > CHAR_LOWERCASE_Z || (sep !== ':')) { throw new ERR_INVALID_FILE_URL_PATH('must be absolute') } return pathname.slice(1) } const getPathFromURLPosix = (url) => { if (url.hostname !== '') { throw new ERR_INVALID_FILE_URL_HOST(process.platform) } const pathname = url.pathname for (let n = 0; n < pathname.length; n++) { if (pathname[n] === '%') { const third = pathname.codePointAt(n + 2) | 0x20 if (pathname[n + 1] === '2' && third === 102) { throw new ERR_INVALID_FILE_URL_PATH('must not include encoded / characters') } } } return decodeURIComponent(pathname) } const fileURLToPath = (path) => { if (typeof path === 'string') { path = new URL(path) } else if (!isURLInstance(path)) { throw new ERR_INVALID_ARG_TYPE('path', ['string', 'URL'], path) } if (path.protocol !== 'file:') { throw new ERR_INVALID_URL_SCHEME('file') } return isWindows ? getPathFromURLWin32(path) : getPathFromURLPosix(path) } module.exports = fileURLToPath #!/usr/bin/env node // Standalone semver comparison program. // Exits successfully and prints matching version(s) if // any supplied version is valid and passes all tests. const argv = process.argv.slice(2) let versions = [] const range = [] let inc = null const version = require('../package.json').version let loose = false let includePrerelease = false let coerce = false let rtl = false let identifier const semver = require('../') let reverse = false const options = {} const main = () => { if (!argv.length) return help() while (argv.length) { let a = argv.shift() const indexOfEqualSign = a.indexOf('=') if (indexOfEqualSign !== -1) { a = a.slice(0, indexOfEqualSign) argv.unshift(a.slice(indexOfEqualSign + 1)) } switch (a) { case '-rv': case '-rev': case '--rev': case '--reverse': reverse = true break case '-l': case '--loose': loose = true break case '-p': case '--include-prerelease': includePrerelease = true break case '-v': case '--version': versions.push(argv.shift()) break case '-i': case '--inc': case '--increment': switch (argv[0]) { case 'major': case 'minor': case 'patch': case 'prerelease': case 'premajor': case 'preminor': case 'prepatch': inc = argv.shift() break default: inc = 'patch' break } break case '--preid': identifier = argv.shift() break case '-r': case '--range': range.push(argv.shift()) break case '-c': case '--coerce': coerce = true break case '--rtl': rtl = true break case '--ltr': rtl = false break case '-h': case '--help': case '-?': return help() default: versions.push(a) break } } const options = { loose: loose, includePrerelease: includePrerelease, rtl: rtl } versions = versions.map((v) => { return coerce ? (semver.coerce(v, options) || { version: v }).version : v }).filter((v) => { return semver.valid(v) }) if (!versions.length) return fail() if (inc && (versions.length !== 1 || range.length)) { return failInc() } for (let i = 0, l = range.length; i < l; i++) { versions = versions.filter((v) => { return semver.satisfies(v, range[i], options) }) if (!versions.length) return fail() } return success(versions) } const failInc = () => { console.error('--inc can only be used on a single version with no range') fail() } const fail = () => process.exit(1) const success = () => { const compare = reverse ? 'rcompare' : 'compare' versions.sort((a, b) => { return semver[compare](a, b, options) }).map((v) => { return semver.clean(v, options) }).map((v) => { return inc ? semver.inc(v, inc, options, identifier) : v }).forEach((v, i, _) => { console.log(v) }) } const help = () => console.log( `SemVer ${version} A JavaScript implementation of the https://semver.org/ specification Copyright Isaac Z. Schlueter Usage: semver [options] [ [...]] Prints valid versions sorted by SemVer precedence Options: -r --range Print versions that match the specified range. -i --increment [] Increment a version by the specified level. Level can be one of: major, minor, patch, premajor, preminor, prepatch, or prerelease. Default level is 'patch'. Only one version may be specified. --preid Identifier to be used to prefix premajor, preminor, prepatch or prerelease version increments. -l --loose Interpret versions and ranges loosely -p --include-prerelease Always include prerelease versions in range matching -c --coerce Coerce a string into SemVer if possible (does not imply --loose) --rtl Coerce version strings right to left --ltr Coerce version strings left to right (default) Program exits successfully if any valid version satisfies all supplied ranges, and prints all satisfying versions. If no satisfying versions are found, then exits failure. Versions are printed in ascending order, so supplying multiple versions to the utility will just sort them.`) main() const ANY = Symbol('SemVer ANY') // hoisted class for cyclic dependency class Comparator { static get ANY () { return ANY } constructor (comp, options) { options = parseOptions(options) if (comp instanceof Comparator) { if (comp.loose === !!options.loose) { return comp } else { comp = comp.value } } debug('comparator', comp, options) this.options = options this.loose = !!options.loose this.parse(comp) if (this.semver === ANY) { this.value = '' } else { this.value = this.operator + this.semver.version } debug('comp', this) } parse (comp) { const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] const m = comp.match(r) if (!m) { throw new TypeError(`Invalid comparator: ${comp}`) } this.operator = m[1] !== undefined ? m[1] : '' if (this.operator === '=') { this.operator = '' } // if it literally is just '>' or '' then allow anything. if (!m[2]) { this.semver = ANY } else { this.semver = new SemVer(m[2], this.options.loose) } } toString () { return this.value } test (version) { debug('Comparator.test', version, this.options.loose) if (this.semver === ANY || version === ANY) { return true } if (typeof version === 'string') { try { version = new SemVer(version, this.options) } catch (er) { return false } } return cmp(version, this.operator, this.semver, this.options) } intersects (comp, options) { if (!(comp instanceof Comparator)) { throw new TypeError('a Comparator is required') } if (!options || typeof options !== 'object') { options = { loose: !!options, includePrerelease: false } } if (this.operator === '') { if (this.value === '') { return true } return new Range(comp.value, options).test(this.value) } else if (comp.operator === '') { if (comp.value === '') { return true } return new Range(this.value, options).test(comp.semver) } const sameDirectionIncreasing = (this.operator === '>=' || this.operator === '>') && (comp.operator === '>=' || comp.operator === '>') const sameDirectionDecreasing = (this.operator === '<=' || this.operator === '<') && (comp.operator === '<=' || comp.operator === '<') const sameSemVer = this.semver.version === comp.semver.version const differentDirectionsInclusive = (this.operator === '>=' || this.operator === '<=') && (comp.operator === '>=' || comp.operator === '<=') const oppositeDirectionsLessThan = cmp(this.semver, '<', comp.semver, options) && (this.operator === '>=' || this.operator === '>') && (comp.operator === '<=' || comp.operator === '<') const oppositeDirectionsGreaterThan = cmp(this.semver, '>', comp.semver, options) && (this.operator === '<=' || this.operator === '<') && (comp.operator === '>=' || comp.operator === '>') return ( sameDirectionIncreasing || sameDirectionDecreasing || (sameSemVer && differentDirectionsInclusive) || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan ) } } module.exports = Comparator const parseOptions = require('../internal/parse-options') const {re, t} = require('../internal/re') const cmp = require('../functions/cmp') const debug = require('../internal/debug') const SemVer = require('./semver') const Range = require('./range') module.exports = { SemVer: require('./semver.js'), Range: require('./range.js'), Comparator: require('./comparator.js') } // hoisted class for cyclic dependency class Range { constructor (range, options) { options = parseOptions(options) if (range instanceof Range) { if ( range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease ) { return range } else { return new Range(range.raw, options) } } if (range instanceof Comparator) { // just put it in the set and return this.raw = range.value this.set = [[range]] this.format() return this } this.options = options this.loose = !!options.loose this.includePrerelease = !!options.includePrerelease // First, split based on boolean or || this.raw = range this.set = range .split(/\s*\|\|\s*/) // map the range to a 2d array of comparators .map(range => this.parseRange(range.trim())) // throw out any comparator lists that are empty // this generally means that it was not a valid range, which is allowed // in loose mode, but will still throw if the WHOLE range is invalid. .filter(c => c.length) if (!this.set.length) { throw new TypeError(`Invalid SemVer Range: ${range}`) } // if we have any that are not the null set, throw out null sets. if (this.set.length > 1) { // keep the first one, in case they're all null sets const first = this.set[0] this.set = this.set.filter(c => !isNullSet(c[0])) if (this.set.length === 0) this.set = [first] else if (this.set.length > 1) { // if we have any that are *, then the range is just * for (const c of this.set) { if (c.length === 1 && isAny(c[0])) { this.set = [c] break } } } } this.format() } format () { this.range = this.set .map((comps) => { return comps.join(' ').trim() }) .join('||') .trim() return this.range } toString () { return this.range } parseRange (range) { range = range.trim() // memoize range parsing for performance. // this is a very hot path, and fully deterministic. const memoOpts = Object.keys(this.options).join(',') const memoKey = `parseRange:${memoOpts}:${range}` const cached = cache.get(memoKey) if (cached) return cached const loose = this.options.loose // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) debug('hyphen replace', range) // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) debug('comparator trim', range, re[t.COMPARATORTRIM]) // `~ 1.2.3` => `~1.2.3` range = range.replace(re[t.TILDETRIM], tildeTrimReplace) // `^ 1.2.3` => `^1.2.3` range = range.replace(re[t.CARETTRIM], caretTrimReplace) // normalize spaces range = range.split(/\s+/).join(' ') // At this point, the range is completely trimmed and // ready to be split into comparators. const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] const rangeList = range .split(' ') .map(comp => parseComparator(comp, this.options)) .join(' ') .split(/\s+/) // >=0.0.0 is equivalent to * .map(comp => replaceGTE0(comp, this.options)) // in loose mode, throw out any that are not valid comparators .filter(this.options.loose ? comp => !!comp.match(compRe) : () => true) .map(comp => new Comparator(comp, this.options)) // if any comparators are the null set, then replace with JUST null set // if more than one comparator, remove any * comparators // also, don't include the same comparator more than once const l = rangeList.length const rangeMap = new Map() for (const comp of rangeList) { if (isNullSet(comp)) return [comp] rangeMap.set(comp.value, comp) } if (rangeMap.size > 1 && rangeMap.has('')) rangeMap.delete('') const result = [...rangeMap.values()] cache.set(memoKey, result) return result } intersects (range, options) { if (!(range instanceof Range)) { throw new TypeError('a Range is required') } return this.set.some((thisComparators) => { return ( isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => { return ( isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => { return rangeComparators.every((rangeComparator) => { return thisComparator.intersects(rangeComparator, options) }) }) ) }) ) }) } // if ANY of the sets match ALL of its comparators, then pass test (version) { if (!version) { return false } if (typeof version === 'string') { try { version = new SemVer(version, this.options) } catch (er) { return false } } for (let i = 0; i < this.set.length; i++) { if (testSet(this.set[i], version, this.options)) { return true } } return false } } module.exports = Range const LRU = require('lru-cache') const cache = new LRU({ max: 1000 }) const parseOptions = require('../internal/parse-options') const Comparator = require('./comparator') const debug = require('../internal/debug') const SemVer = require('./semver') const { re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require('../internal/re') const isNullSet = c => c.value === '<0.0.0-0' const isAny = c => c.value === '' // take a set of comparators and determine whether there // exists a version which can satisfy it const isSatisfiable = (comparators, options) => { let result = true const remainingComparators = comparators.slice() let testComparator = remainingComparators.pop() while (result && remainingComparators.length) { result = remainingComparators.every((otherComparator) => { return testComparator.intersects(otherComparator, options) }) testComparator = remainingComparators.pop() } return result } // comprised of xranges, tildes, stars, and gtlt's at this point. // already replaced the hyphen ranges // turn into a set of JUST comparators. const parseComparator = (comp, options) => { debug('comp', comp, options) comp = replaceCarets(comp, options) debug('caret', comp) comp = replaceTildes(comp, options) debug('tildes', comp) comp = replaceXRanges(comp, options) debug('xrange', comp) comp = replaceStars(comp, options) debug('stars', comp) return comp } const isX = id => !id || id.toLowerCase() === 'x' || id === '*' // ~, ~> --> * (any, kinda silly) // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 const replaceTildes = (comp, options) => comp.trim().split(/\s+/).map((comp) => { return replaceTilde(comp, options) }).join(' ') const replaceTilde = (comp, options) => { const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] return comp.replace(r, (_, M, m, p, pr) => { debug('tilde', comp, _, M, m, p, pr) let ret if (isX(M)) { ret = '' } else if (isX(m)) { ret = `>=${M}.0.0 <${+M + 1}.0.0-0` } else if (isX(p)) { // ~1.2 == >=1.2.0 <1.3.0-0 ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0` } else if (pr) { debug('replaceTilde pr', pr) ret = `>=${M}.${m}.${p}-${pr } <${M}.${+m + 1}.0-0` } else { // ~1.2.3 == >=1.2.3 <1.3.0-0 ret = `>=${M}.${m}.${p } <${M}.${+m + 1}.0-0` } debug('tilde return', ret) return ret }) } // ^ --> * (any, kinda silly) // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 // ^1.2.3 --> >=1.2.3 <2.0.0-0 // ^1.2.0 --> >=1.2.0 <2.0.0-0 const replaceCarets = (comp, options) => comp.trim().split(/\s+/).map((comp) => { return replaceCaret(comp, options) }).join(' ') const replaceCaret = (comp, options) => { debug('caret', comp, options) const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] const z = options.includePrerelease ? '-0' : '' return comp.replace(r, (_, M, m, p, pr) => { debug('caret', comp, _, M, m, p, pr) let ret if (isX(M)) { ret = '' } else if (isX(m)) { ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0` } else if (isX(p)) { if (M === '0') { ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` } else { ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0` } } else if (pr) { debug('replaceCaret pr', pr) if (M === '0') { if (m === '0') { ret = `>=${M}.${m}.${p}-${pr } <${M}.${m}.${+p + 1}-0` } else { ret = `>=${M}.${m}.${p}-${pr } <${M}.${+m + 1}.0-0` } } else { ret = `>=${M}.${m}.${p}-${pr } <${+M + 1}.0.0-0` } } else { debug('no pr') if (M === '0') { if (m === '0') { ret = `>=${M}.${m}.${p }${z} <${M}.${m}.${+p + 1}-0` } else { ret = `>=${M}.${m}.${p }${z} <${M}.${+m + 1}.0-0` } } else { ret = `>=${M}.${m}.${p } <${+M + 1}.0.0-0` } } debug('caret return', ret) return ret }) } const replaceXRanges = (comp, options) => { debug('replaceXRanges', comp, options) return comp.split(/\s+/).map((comp) => { return replaceXRange(comp, options) }).join(' ') } const replaceXRange = (comp, options) => { comp = comp.trim() const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] return comp.replace(r, (ret, gtlt, M, m, p, pr) => { debug('xRange', comp, ret, gtlt, M, m, p, pr) const xM = isX(M) const xm = xM || isX(m) const xp = xm || isX(p) const anyX = xp if (gtlt === '=' && anyX) { gtlt = '' } // if we're including prereleases in the match, then we need // to fix this to -0, the lowest possible prerelease value pr = options.includePrerelease ? '-0' : '' if (xM) { if (gtlt === '>' || gtlt === '<') { // nothing is allowed ret = '<0.0.0-0' } else { // nothing is forbidden ret = '*' } } else if (gtlt && anyX) { // we know patch is an x, because we have any x at all. // replace X with 0 if (xm) { m = 0 } p = 0 if (gtlt === '>') { // >1 => >=2.0.0 // >1.2 => >=1.3.0 gtlt = '>=' if (xm) { M = +M + 1 m = 0 p = 0 } else { m = +m + 1 p = 0 } } else if (gtlt === '<=') { // <=0.7.x is actually <0.8.0, since any 0.7.x should // pass. Similarly, <=7.x is actually <8.0.0, etc. gtlt = '<' if (xm) { M = +M + 1 } else { m = +m + 1 } } if (gtlt === '<') pr = '-0' ret = `${gtlt + M}.${m}.${p}${pr}` } else if (xm) { ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0` } else if (xp) { ret = `>=${M}.${m}.0${pr } <${M}.${+m + 1}.0-0` } debug('xRange return', ret) return ret }) } // Because * is AND-ed with everything else in the comparator, // and '' means "any version", just remove the *s entirely. const replaceStars = (comp, options) => { debug('replaceStars', comp, options) // Looseness is ignored here. star is always as loose as it gets! return comp.trim().replace(re[t.STAR], '') } const replaceGTE0 = (comp, options) => { debug('replaceGTE0', comp, options) return comp.trim() .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '') } // This function is passed to string.replace(re[t.HYPHENRANGE]) // M, m, patch, prerelease, build // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 // 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do // 1.2 - 3.4 => >=1.2.0 <3.5.0-0 const hyphenReplace = incPr => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) => { if (isX(fM)) { from = '' } else if (isX(fm)) { from = `>=${fM}.0.0${incPr ? '-0' : ''}` } else if (isX(fp)) { from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}` } else if (fpr) { from = `>=${from}` } else { from = `>=${from}${incPr ? '-0' : ''}` } if (isX(tM)) { to = '' } else if (isX(tm)) { to = `<${+tM + 1}.0.0-0` } else if (isX(tp)) { to = `<${tM}.${+tm + 1}.0-0` } else if (tpr) { to = `<=${tM}.${tm}.${tp}-${tpr}` } else if (incPr) { to = `<${tM}.${tm}.${+tp + 1}-0` } else { to = `<=${to}` } return (`${from} ${to}`).trim() } const testSet = (set, version, options) => { for (let i = 0; i < set.length; i++) { if (!set[i].test(version)) { return false } } if (version.prerelease.length && !options.includePrerelease) { // Find the set of versions that are allowed to have prereleases // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 // That should allow `1.2.3-pr.2` to pass. // However, `1.2.4-alpha.notready` should NOT be allowed, // even though it's within the range set by the comparators. for (let i = 0; i < set.length; i++) { debug(set[i].semver) if (set[i].semver === Comparator.ANY) { continue } if (set[i].semver.prerelease.length > 0) { const allowed = set[i].semver if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { return true } } } // Version has a -pre, but it's not one of the ones we like. return false } return true } const debug = require('../internal/debug') const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants') const { re, t } = require('../internal/re') const parseOptions = require('../internal/parse-options') const { compareIdentifiers } = require('../internal/identifiers') class SemVer { constructor (version, options) { options = parseOptions(options) if (version instanceof SemVer) { if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) { return version } else { version = version.version } } else if (typeof version !== 'string') { throw new TypeError(`Invalid Version: ${version}`) } if (version.length > MAX_LENGTH) { throw new TypeError( `version is longer than ${MAX_LENGTH} characters` ) } debug('SemVer', version, options) this.options = options this.loose = !!options.loose // this isn't actually relevant for versions, but keep it so that we // don't run into trouble passing this.options around. this.includePrerelease = !!options.includePrerelease const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) if (!m) { throw new TypeError(`Invalid Version: ${version}`) } this.raw = version // these are actually numbers this.major = +m[1] this.minor = +m[2] this.patch = +m[3] if (this.major > MAX_SAFE_INTEGER || this.major < 0) { throw new TypeError('Invalid major version') } if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { throw new TypeError('Invalid minor version') } if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { throw new TypeError('Invalid patch version') } // numberify any prerelease numeric ids if (!m[4]) { this.prerelease = [] } else { this.prerelease = m[4].split('.').map((id) => { if (/^[0-9]+$/.test(id)) { const num = +id if (num >= 0 && num < MAX_SAFE_INTEGER) { return num } } return id }) } this.build = m[5] ? m[5].split('.') : [] this.format() } format () { this.version = `${this.major}.${this.minor}.${this.patch}` if (this.prerelease.length) { this.version += `-${this.prerelease.join('.')}` } return this.version } toString () { return this.version } compare (other) { debug('SemVer.compare', this.version, this.options, other) if (!(other instanceof SemVer)) { if (typeof other === 'string' && other === this.version) { return 0 } other = new SemVer(other, this.options) } if (other.version === this.version) { return 0 } return this.compareMain(other) || this.comparePre(other) } compareMain (other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } return ( compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch) ) } comparePre (other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } // NOT having a prerelease is > having one if (this.prerelease.length && !other.prerelease.length) { return -1 } else if (!this.prerelease.length && other.prerelease.length) { return 1 } else if (!this.prerelease.length && !other.prerelease.length) { return 0 } let i = 0 do { const a = this.prerelease[i] const b = other.prerelease[i] debug('prerelease compare', i, a, b) if (a === undefined && b === undefined) { return 0 } else if (b === undefined) { return 1 } else if (a === undefined) { return -1 } else if (a === b) { continue } else { return compareIdentifiers(a, b) } } while (++i) } compareBuild (other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } let i = 0 do { const a = this.build[i] const b = other.build[i] debug('prerelease compare', i, a, b) if (a === undefined && b === undefined) { return 0 } else if (b === undefined) { return 1 } else if (a === undefined) { return -1 } else if (a === b) { continue } else { return compareIdentifiers(a, b) } } while (++i) } // preminor will bump the version up to the next minor release, and immediately // down to pre-release. premajor and prepatch work the same way. inc (release, identifier) { switch (release) { case 'premajor': this.prerelease.length = 0 this.patch = 0 this.minor = 0 this.major++ this.inc('pre', identifier) break case 'preminor': this.prerelease.length = 0 this.patch = 0 this.minor++ this.inc('pre', identifier) break case 'prepatch': // If this is already a prerelease, it will bump to the next version // drop any prereleases that might already exist, since they are not // relevant at this point. this.prerelease.length = 0 this.inc('patch', identifier) this.inc('pre', identifier) break // If the input is a non-prerelease version, this acts the same as // prepatch. case 'prerelease': if (this.prerelease.length === 0) { this.inc('patch', identifier) } this.inc('pre', identifier) break case 'major': // If this is a pre-major version, bump up to the same major version. // Otherwise increment major. // 1.0.0-5 bumps to 1.0.0 // 1.1.0 bumps to 2.0.0 if ( this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0 ) { this.major++ } this.minor = 0 this.patch = 0 this.prerelease = [] break case 'minor': // If this is a pre-minor version, bump up to the same minor version. // Otherwise increment minor. // 1.2.0-5 bumps to 1.2.0 // 1.2.1 bumps to 1.3.0 if (this.patch !== 0 || this.prerelease.length === 0) { this.minor++ } this.patch = 0 this.prerelease = [] break case 'patch': // If this is not a pre-release version, it will increment the patch. // If it is a pre-release it will bump up to the same patch version. // 1.2.0-5 patches to 1.2.0 // 1.2.0 patches to 1.2.1 if (this.prerelease.length === 0) { this.patch++ } this.prerelease = [] break // This probably shouldn't be used publicly. // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. case 'pre': if (this.prerelease.length === 0) { this.prerelease = [0] } else { let i = this.prerelease.length while (--i >= 0) { if (typeof this.prerelease[i] === 'number') { this.prerelease[i]++ i = -2 } } if (i === -1) { // didn't increment anything this.prerelease.push(0) } } if (identifier) { // 1.2.0-beta.1 bumps to 1.2.0-beta.2, // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 if (this.prerelease[0] === identifier) { if (isNaN(this.prerelease[1])) { this.prerelease = [identifier, 0] } } else { this.prerelease = [identifier, 0] } } break default: throw new Error(`invalid increment argument: ${release}`) } this.format() this.raw = this.version return this } } module.exports = SemVer const parse = require('./parse') const clean = (version, options) => { const s = parse(version.trim().replace(/^[=v]+/, ''), options) return s ? s.version : null } module.exports = clean const eq = require('./eq') const neq = require('./neq') const gt = require('./gt') const gte = require('./gte') const lt = require('./lt') const lte = require('./lte') const cmp = (a, op, b, loose) => { switch (op) { case '===': if (typeof a === 'object') a = a.version if (typeof b === 'object') b = b.version return a === b case '!==': if (typeof a === 'object') a = a.version if (typeof b === 'object') b = b.version return a !== b case '': case '=': case '==': return eq(a, b, loose) case '!=': return neq(a, b, loose) case '>': return gt(a, b, loose) case '>=': return gte(a, b, loose) case '<': return lt(a, b, loose) case '<=': return lte(a, b, loose) default: throw new TypeError(`Invalid operator: ${op}`) } } module.exports = cmp const SemVer = require('../classes/semver') const parse = require('./parse') const {re, t} = require('../internal/re') const coerce = (version, options) => { if (version instanceof SemVer) { return version } if (typeof version === 'number') { version = String(version) } if (typeof version !== 'string') { return null } options = options || {} let match = null if (!options.rtl) { match = version.match(re[t.COERCE]) } else { // Find the right-most coercible string that does not share // a terminus with a more left-ward coercible string. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' // // Walk through the string checking with a /g regexp // Manually set the index so as to pick up overlapping matches. // Stop when we get a match that ends at the string end, since no // coercible string can be more right-ward without the same terminus. let next while ((next = re[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length) ) { if (!match || next.index + next[0].length !== match.index + match[0].length) { match = next } re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length } // leave it in a clean state re[t.COERCERTL].lastIndex = -1 } if (match === null) return null return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options) } module.exports = coerce const SemVer = require('../classes/semver') const compareBuild = (a, b, loose) => { const versionA = new SemVer(a, loose) const versionB = new SemVer(b, loose) return versionA.compare(versionB) || versionA.compareBuild(versionB) } module.exports = compareBuild const compare = require('./compare') const compareLoose = (a, b) => compare(a, b, true) module.exports = compareLoose const SemVer = require('../classes/semver') const compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose)) module.exports = compare const parse = require('./parse') const eq = require('./eq') const diff = (version1, version2) => { if (eq(version1, version2)) { return null } else { const v1 = parse(version1) const v2 = parse(version2) const hasPre = v1.prerelease.length || v2.prerelease.length const prefix = hasPre ? 'pre' : '' const defaultResult = hasPre ? 'prerelease' : '' for (const key in v1) { if (key === 'major' || key === 'minor' || key === 'patch') { if (v1[key] !== v2[key]) { return prefix + key } } } return defaultResult // may be undefined } } module.exports = diff const compare = require('./compare') const eq = (a, b, loose) => compare(a, b, loose) === 0 module.exports = eq const compare = require('./compare') const gt = (a, b, loose) => compare(a, b, loose) > 0 module.exports = gt const compare = require('./compare') const gte = (a, b, loose) => compare(a, b, loose) >= 0 module.exports = gte const SemVer = require('../classes/semver') const inc = (version, release, options, identifier) => { if (typeof (options) === 'string') { identifier = options options = undefined } try { return new SemVer(version, options).inc(release, identifier).version } catch (er) { return null } } module.exports = inc const compare = require('./compare') const lt = (a, b, loose) => compare(a, b, loose) < 0 module.exports = lt const compare = require('./compare') const lte = (a, b, loose) => compare(a, b, loose) <= 0 module.exports = lte const SemVer = require('../classes/semver') const major = (a, loose) => new SemVer(a, loose).major module.exports = major const SemVer = require('../classes/semver') const minor = (a, loose) => new SemVer(a, loose).minor module.exports = minor const compare = require('./compare') const neq = (a, b, loose) => compare(a, b, loose) !== 0 module.exports = neq const {MAX_LENGTH} = require('../internal/constants') const { re, t } = require('../internal/re') const SemVer = require('../classes/semver') const parseOptions = require('../internal/parse-options') const parse = (version, options) => { options = parseOptions(options) if (version instanceof SemVer) { return version } if (typeof version !== 'string') { return null } if (version.length > MAX_LENGTH) { return null } const r = options.loose ? re[t.LOOSE] : re[t.FULL] if (!r.test(version)) { return null } try { return new SemVer(version, options) } catch (er) { return null } } module.exports = parse const SemVer = require('../classes/semver') const patch = (a, loose) => new SemVer(a, loose).patch module.exports = patch const parse = require('./parse') const prerelease = (version, options) => { const parsed = parse(version, options) return (parsed && parsed.prerelease.length) ? parsed.prerelease : null } module.exports = prerelease const compare = require('./compare') const rcompare = (a, b, loose) => compare(b, a, loose) module.exports = rcompare const compareBuild = require('./compare-build') const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)) module.exports = rsort const Range = require('../classes/range') const satisfies = (version, range, options) => { try { range = new Range(range, options) } catch (er) { return false } return range.test(version) } module.exports = satisfies const compareBuild = require('./compare-build') const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)) module.exports = sort const parse = require('./parse') const valid = (version, options) => { const v = parse(version, options) return v ? v.version : null } module.exports = valid // Note: this is the semver.org version of the spec that it implements // Not necessarily the package version of this code. const SEMVER_SPEC_VERSION = '2.0.0' const MAX_LENGTH = 256 const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ 9007199254740991 // Max safe segment length for coercion. const MAX_SAFE_COMPONENT_LENGTH = 16 module.exports = { SEMVER_SPEC_VERSION, MAX_LENGTH, MAX_SAFE_INTEGER, MAX_SAFE_COMPONENT_LENGTH } const debug = ( typeof process === 'object' && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ) ? (...args) => console.error('SEMVER', ...args) : () => {} module.exports = debug const numeric = /^[0-9]+$/ const compareIdentifiers = (a, b) => { const anum = numeric.test(a) const bnum = numeric.test(b) if (anum && bnum) { a = +a b = +b } return a === b ? 0 : (anum && !bnum) ? -1 : (bnum && !anum) ? 1 : a < b ? -1 : 1 } const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a) module.exports = { compareIdentifiers, rcompareIdentifiers } // parse out just the options we care about so we always get a consistent // obj with keys in a consistent order. const opts = ['includePrerelease', 'loose', 'rtl'] const parseOptions = options => !options ? {} : typeof options !== 'object' ? { loose: true } : opts.filter(k => options[k]).reduce((options, k) => { options[k] = true return options }, {}) module.exports = parseOptions const { MAX_SAFE_COMPONENT_LENGTH } = require('./constants') const debug = require('./debug') exports = module.exports = {} // The actual regexps go on exports.re const re = exports.re = [] const src = exports.src = [] const t = exports.t = {} let R = 0 const createToken = (name, value, isGlobal) => { const index = R++ debug(index, value) t[name] = index src[index] = value re[index] = new RegExp(value, isGlobal ? 'g' : undefined) } // The following Regular Expressions can be used for tokenizing, // validating, and parsing SemVer version strings. // ## Numeric Identifier // A single `0`, or a non-zero digit followed by zero or more digits. createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*') createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+') // ## Non-numeric Identifier // Zero or more digits, followed by a letter or hyphen, and then zero or // more letters, digits, or hyphens. createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*') // ## Main Version // Three dot-separated numeric identifiers. createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` + `(${src[t.NUMERICIDENTIFIER]})\\.` + `(${src[t.NUMERICIDENTIFIER]})`) createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + `(${src[t.NUMERICIDENTIFIERLOOSE]})`) // ## Pre-release Version Identifier // A numeric identifier, or a non-numeric identifier. createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER] }|${src[t.NONNUMERICIDENTIFIER]})`) createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE] }|${src[t.NONNUMERICIDENTIFIER]})`) // ## Pre-release Version // Hyphen, followed by one or more dot-separated pre-release version // identifiers. createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER] }(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`) createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE] }(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`) // ## Build Metadata Identifier // Any combination of digits, letters, or hyphens. createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+') // ## Build Metadata // Plus sign, followed by one or more period-separated build metadata // identifiers. createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER] }(?:\\.${src[t.BUILDIDENTIFIER]})*))`) // ## Full Version String // A main version, followed optionally by a pre-release version and // build metadata. // Note that the only major, minor, patch, and pre-release sections of // the version string are capturing groups. The build metadata is not a // capturing group, because it should not ever be used in version // comparison. createToken('FULLPLAIN', `v?${src[t.MAINVERSION] }${src[t.PRERELEASE]}?${ src[t.BUILD]}?`) createToken('FULL', `^${src[t.FULLPLAIN]}$`) // like full, but allows v1.2.3 and =1.2.3, which people do sometimes. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty // common in the npm registry. createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE] }${src[t.PRERELEASELOOSE]}?${ src[t.BUILD]}?`) createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`) createToken('GTLT', '((?:<|>)?=?)') // Something like "2.*" or "1.2.x". // Note that "x.x" is a valid xRange identifer, meaning "any version" // Only the first item is strictly required. createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`) createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`) createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + `(?:${src[t.PRERELEASE]})?${ src[t.BUILD]}?` + `)?)?`) createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + `(?:${src[t.PRERELEASELOOSE]})?${ src[t.BUILD]}?` + `)?)?`) createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`) createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`) // Coercion. // Extract anything that could conceivably be a part of a valid semver createToken('COERCE', `${'(^|[^\\d])' + '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + `(?:$|[^\\d])`) createToken('COERCERTL', src[t.COERCE], true) // Tilde ranges. // Meaning is "reasonably at or greater than" createToken('LONETILDE', '(?:~>?)') createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true) exports.tildeTrimReplace = '$1~' createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`) createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`) // Caret ranges. // Meaning is "at least and backwards compatible with" createToken('LONECARET', '(?:\\^)') createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true) exports.caretTrimReplace = '$1^' createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`) createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`) // A simple gt/lt/eq thing, or just "" to indicate "any version" createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`) createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`) // An expression to strip any whitespace between the gtlt and the thing // it modifies, so that `> 1.2.3` ==> `>1.2.3` createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT] }\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true) exports.comparatorTrimReplace = '$1$2$3' // Something like `1.2.3 - 1.2.4` // Note that these all use the loose form, because they'll be // checked against either the strict or loose comparator form // later. createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` + `\\s+-\\s+` + `(${src[t.XRANGEPLAIN]})` + `\\s*$`) createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + `\\s+-\\s+` + `(${src[t.XRANGEPLAINLOOSE]})` + `\\s*$`) // Star ranges basically just allow anything at all. createToken('STAR', '(<|>)?=?\\s*\\*') // >=0.0.0 is like a star createToken('GTE0', '^\\s*>=\\s*0\.0\.0\\s*$') createToken('GTE0PRE', '^\\s*>=\\s*0\.0\.0-0\\s*$') // Determine if version is greater than all the versions possible in the range. const outside = require('./outside') const gtr = (version, range, options) => outside(version, range, '>', options) module.exports = gtr const Range = require('../classes/range') const intersects = (r1, r2, options) => { r1 = new Range(r1, options) r2 = new Range(r2, options) return r1.intersects(r2) } module.exports = intersects const outside = require('./outside') // Determine if version is less than all the versions possible in the range const ltr = (version, range, options) => outside(version, range, '<', options) module.exports = ltr const SemVer = require('../classes/semver') const Range = require('../classes/range') const maxSatisfying = (versions, range, options) => { let max = null let maxSV = null let rangeObj = null try { rangeObj = new Range(range, options) } catch (er) { return null } versions.forEach((v) => { if (rangeObj.test(v)) { // satisfies(v, range, options) if (!max || maxSV.compare(v) === -1) { // compare(max, v, true) max = v maxSV = new SemVer(max, options) } } }) return max } module.exports = maxSatisfying const SemVer = require('../classes/semver') const Range = require('../classes/range') const minSatisfying = (versions, range, options) => { let min = null let minSV = null let rangeObj = null try { rangeObj = new Range(range, options) } catch (er) { return null } versions.forEach((v) => { if (rangeObj.test(v)) { // satisfies(v, range, options) if (!min || minSV.compare(v) === 1) { // compare(min, v, true) min = v minSV = new SemVer(min, options) } } }) return min } module.exports = minSatisfying const SemVer = require('../classes/semver') const Range = require('../classes/range') const gt = require('../functions/gt') const minVersion = (range, loose) => { range = new Range(range, loose) let minver = new SemVer('0.0.0') if (range.test(minver)) { return minver } minver = new SemVer('0.0.0-0') if (range.test(minver)) { return minver } minver = null for (let i = 0; i < range.set.length; ++i) { const comparators = range.set[i] let setMin = null comparators.forEach((comparator) => { // Clone to avoid manipulating the comparator's semver object. const compver = new SemVer(comparator.semver.version) switch (comparator.operator) { case '>': if (compver.prerelease.length === 0) { compver.patch++ } else { compver.prerelease.push(0) } compver.raw = compver.format() /* fallthrough */ case '': case '>=': if (!setMin || gt(compver, setMin)) { setMin = compver } break case '<': case '<=': /* Ignore maximum versions */ break /* istanbul ignore next */ default: throw new Error(`Unexpected operation: ${comparator.operator}`) } }) if (setMin && (!minver || gt(minver, setMin))) minver = setMin } if (minver && range.test(minver)) { return minver } return null } module.exports = minVersion const SemVer = require('../classes/semver') const Comparator = require('../classes/comparator') const {ANY} = Comparator const Range = require('../classes/range') const satisfies = require('../functions/satisfies') const gt = require('../functions/gt') const lt = require('../functions/lt') const lte = require('../functions/lte') const gte = require('../functions/gte') const outside = (version, range, hilo, options) => { version = new SemVer(version, options) range = new Range(range, options) let gtfn, ltefn, ltfn, comp, ecomp switch (hilo) { case '>': gtfn = gt ltefn = lte ltfn = lt comp = '>' ecomp = '>=' break case '<': gtfn = lt ltefn = gte ltfn = gt comp = '<' ecomp = '<=' break default: throw new TypeError('Must provide a hilo val of "<" or ">"') } // If it satisfies the range it is not outside if (satisfies(version, range, options)) { return false } // From now on, variable terms are as if we're in "gtr" mode. // but note that everything is flipped for the "ltr" function. for (let i = 0; i < range.set.length; ++i) { const comparators = range.set[i] let high = null let low = null comparators.forEach((comparator) => { if (comparator.semver === ANY) { comparator = new Comparator('>=0.0.0') } high = high || comparator low = low || comparator if (gtfn(comparator.semver, high.semver, options)) { high = comparator } else if (ltfn(comparator.semver, low.semver, options)) { low = comparator } }) // If the edge version comparator has a operator then our version // isn't outside it if (high.operator === comp || high.operator === ecomp) { return false } // If the lowest version comparator has an operator and our version // is less than it then it isn't higher than the range if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { return false } else if (low.operator === ecomp && ltfn(version, low.semver)) { return false } } return true } module.exports = outside // given a set of versions and a range, create a "simplified" range // that includes the same versions that the original range does // If the original range is shorter than the simplified one, return that. const satisfies = require('../functions/satisfies.js') const compare = require('../functions/compare.js') module.exports = (versions, range, options) => { const set = [] let min = null let prev = null const v = versions.sort((a, b) => compare(a, b, options)) for (const version of v) { const included = satisfies(version, range, options) if (included) { prev = version if (!min) min = version } else { if (prev) { set.push([min, prev]) } prev = null min = null } } if (min) set.push([min, null]) const ranges = [] for (const [min, max] of set) { if (min === max) ranges.push(min) else if (!max && min === v[0]) ranges.push('*') else if (!max) ranges.push(`>=${min}`) else if (min === v[0]) ranges.push(`<=${max}`) else ranges.push(`${min} - ${max}`) } const simplified = ranges.join(' || ') const original = typeof range.raw === 'string' ? range.raw : String(range) return simplified.length < original.length ? simplified : range } const Range = require('../classes/range.js') const Comparator = require('../classes/comparator.js') const { ANY } = Comparator const satisfies = require('../functions/satisfies.js') const compare = require('../functions/compare.js') // Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff: // - Every simple range `r1, r2, ...` is a null set, OR // - Every simple range `r1, r2, ...` which is not a null set is a subset of // some `R1, R2, ...` // // Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff: // - If c is only the ANY comparator // - If C is only the ANY comparator, return true // - Else if in prerelease mode, return false // - else replace c with `[>=0.0.0]` // - If C is only the ANY comparator // - if in prerelease mode, return true // - else replace C with `[>=0.0.0]` // - Let EQ be the set of = comparators in c // - If EQ is more than one, return true (null set) // - Let GT be the highest > or >= comparator in c // - Let LT be the lowest < or <= comparator in c // - If GT and LT, and GT.semver > LT.semver, return true (null set) // - If any C is a = range, and GT or LT are set, return false // - If EQ // - If GT, and EQ does not satisfy GT, return true (null set) // - If LT, and EQ does not satisfy LT, return true (null set) // - If EQ satisfies every C, return true // - Else return false // - If GT // - If GT.semver is lower than any > or >= comp in C, return false // - If GT is >=, and GT.semver does not satisfy every C, return false // - If GT.semver has a prerelease, and not in prerelease mode // - If no C has a prerelease and the GT.semver tuple, return false // - If LT // - If LT.semver is greater than any < or <= comp in C, return false // - If LT is <=, and LT.semver does not satisfy every C, return false // - If GT.semver has a prerelease, and not in prerelease mode // - If no C has a prerelease and the LT.semver tuple, return false // - Else return true const subset = (sub, dom, options = {}) => { if (sub === dom) return true sub = new Range(sub, options) dom = new Range(dom, options) let sawNonNull = false OUTER: for (const simpleSub of sub.set) { for (const simpleDom of dom.set) { const isSub = simpleSubset(simpleSub, simpleDom, options) sawNonNull = sawNonNull || isSub !== null if (isSub) continue OUTER } // the null set is a subset of everything, but null simple ranges in // a complex range should be ignored. so if we saw a non-null range, // then we know this isn't a subset, but if EVERY simple range was null, // then it is a subset. if (sawNonNull) return false } return true } const simpleSubset = (sub, dom, options) => { if (sub === dom) return true if (sub.length === 1 && sub[0].semver === ANY) { if (dom.length === 1 && dom[0].semver === ANY) return true else if (options.includePrerelease) sub = [ new Comparator('>=0.0.0-0') ] else sub = [ new Comparator('>=0.0.0') ] } if (dom.length === 1 && dom[0].semver === ANY) { if (options.includePrerelease) return true else dom = [ new Comparator('>=0.0.0') ] } const eqSet = new Set() let gt, lt for (const c of sub) { if (c.operator === '>' || c.operator === '>=') gt = higherGT(gt, c, options) else if (c.operator === '<' || c.operator === '<=') lt = lowerLT(lt, c, options) else eqSet.add(c.semver) } if (eqSet.size > 1) return null let gtltComp if (gt && lt) { gtltComp = compare(gt.semver, lt.semver, options) if (gtltComp > 0) return null else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) return null } // will iterate one or zero times for (const eq of eqSet) { if (gt && !satisfies(eq, String(gt), options)) return null if (lt && !satisfies(eq, String(lt), options)) return null for (const c of dom) { if (!satisfies(eq, String(c), options)) return false } return true } let higher, lower let hasDomLT, hasDomGT // if the subset has a prerelease, we need a comparator in the superset // with the same tuple and a prerelease, or it's not a subset let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false // exception: <1.2.3-0 is the same as <1.2.3 if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === '<' && needDomLTPre.prerelease[0] === 0) { needDomLTPre = false } for (const c of dom) { hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=' hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=' if (gt) { if (needDomGTPre) { if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) { needDomGTPre = false } } if (c.operator === '>' || c.operator === '>=') { higher = higherGT(gt, c, options) if (higher === c && higher !== gt) return false } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) return false } if (lt) { if (needDomLTPre) { if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) { needDomLTPre = false } } if (c.operator === '<' || c.operator === '<=') { lower = lowerLT(lt, c, options) if (lower === c && lower !== lt) return false } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) return false } if (!c.operator && (lt || gt) && gtltComp !== 0) return false } // if there was a < or >, and nothing in the dom, then must be false // UNLESS it was limited by another range in the other direction. // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 if (gt && hasDomLT && !lt && gtltComp !== 0) return false if (lt && hasDomGT && !gt && gtltComp !== 0) return false // we needed a prerelease range in a specific tuple, but didn't get one // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0, // because it includes prereleases in the 1.2.3 tuple if (needDomGTPre || needDomLTPre) return false return true } // >=1.2.3 is lower than >1.2.3 const higherGT = (a, b, options) => { if (!a) return b const comp = compare(a.semver, b.semver, options) return comp > 0 ? a : comp < 0 ? b : b.operator === '>' && a.operator === '>=' ? b : a } // <=1.2.3 is higher than <1.2.3 const lowerLT = (a, b, options) => { if (!a) return b const comp = compare(a.semver, b.semver, options) return comp < 0 ? a : comp > 0 ? b : b.operator === '<' && a.operator === '<=' ? b : a } module.exports = subset const Range = require('../classes/range') // Mostly just for testing and legacy API reasons const toComparators = (range, options) => new Range(range, options).set .map(comp => comp.map(c => c.value).join(' ').trim().split(' ')) module.exports = toComparators const Range = require('../classes/range') const validRange = (range, options) => { try { // Return '*' instead of '' so that truthiness works. // This will throw if it's invalid anyway return new Range(range, options).range || '*' } catch (er) { return null } } module.exports = validRange const { dirname } = require('path') const { promisify } = require('util') const { access: access_, accessSync, copyFile: copyFile_, copyFileSync, unlink: unlink_, unlinkSync, rename: rename_, renameSync, } = require('fs') const access = promisify(access_) const copyFile = promisify(copyFile_) const unlink = promisify(unlink_) const rename = promisify(rename_) const mkdirp = require('mkdirp') const pathExists = async path => { try { await access(path) return true } catch (er) { return er.code !== 'ENOENT' } } const pathExistsSync = path => { try { accessSync(path) return true } catch (er) { return er.code !== 'ENOENT' } } module.exports = async (source, destination, options = {}) => { if (!source || !destination) { throw new TypeError('`source` and `destination` file required') } options = { overwrite: true, ...options } if (!options.overwrite && await pathExists(destination)) { throw new Error(`The destination file exists: ${destination}`) } await mkdirp(dirname(destination)) try { await rename(source, destination) } catch (error) { if (error.code === 'EXDEV') { await copyFile(source, destination) await unlink(source) } else { throw error } } } module.exports.sync = (source, destination, options = {}) => { if (!source || !destination) { throw new TypeError('`source` and `destination` file required') } options = { overwrite: true, ...options } if (!options.overwrite && pathExistsSync(destination)) { throw new Error(`The destination file exists: ${destination}`) } mkdirp.sync(dirname(destination)) try { renameSync(source, destination) } catch (error) { if (error.code === 'EXDEV') { copyFileSync(source, destination) unlinkSync(source) } else { throw error } } } MIT License Copyright (c) Sindre Sorhus (https://sindresorhus.com) Copyright (c) npm, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "@npmcli/move-file", "version": "1.0.1", "files": [ "index.js" ], "description": "move a file (fork of move-file)", "dependencies": { "mkdirp": "^1.0.4" }, "devDependencies": { "require-inject": "^1.4.4", "tap": "^14.10.7" }, "scripts": { "test": "tap", "snap": "tap", "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags" }, "repository": { "type": "git", "url": "git+https://github.com/npm/move-file" }, "tap": { "check-coverage": true }, "license": "MIT", "engines": { "node": ">=10" } } 'use strict' function isArguments (thingy) { return thingy != null && typeof thingy === 'object' && thingy.hasOwnProperty('callee') } var types = { '*': {label: 'any', check: function () { return true }}, A: {label: 'array', check: function (thingy) { return Array.isArray(thingy) || isArguments(thingy) }}, S: {label: 'string', check: function (thingy) { return typeof thingy === 'string' }}, N: {label: 'number', check: function (thingy) { return typeof thingy === 'number' }}, F: {label: 'function', check: function (thingy) { return typeof thingy === 'function' }}, O: {label: 'object', check: function (thingy) { return typeof thingy === 'object' && thingy != null && !types.A.check(thingy) && !types.E.check(thingy) }}, B: {label: 'boolean', check: function (thingy) { return typeof thingy === 'boolean' }}, E: {label: 'error', check: function (thingy) { return thingy instanceof Error }}, Z: {label: 'null', check: function (thingy) { return thingy == null }} } function addSchema (schema, arity) { var group = arity[schema.length] = arity[schema.length] || [] if (group.indexOf(schema) === -1) group.push(schema) } var validate = module.exports = function (rawSchemas, args) { if (arguments.length !== 2) throw wrongNumberOfArgs(['SA'], arguments.length) if (!rawSchemas) throw missingRequiredArg(0, 'rawSchemas') if (!args) throw missingRequiredArg(1, 'args') if (!types.S.check(rawSchemas)) throw invalidType(0, ['string'], rawSchemas) if (!types.A.check(args)) throw invalidType(1, ['array'], args) var schemas = rawSchemas.split('|') var arity = {} schemas.forEach(function (schema) { for (var ii = 0; ii < schema.length; ++ii) { var type = schema[ii] if (!types[type]) throw unknownType(ii, type) } if (/E.*E/.test(schema)) throw moreThanOneError(schema) addSchema(schema, arity) if (/E/.test(schema)) { addSchema(schema.replace(/E.*$/, 'E'), arity) addSchema(schema.replace(/E/, 'Z'), arity) if (schema.length === 1) addSchema('', arity) } }) var matching = arity[args.length] if (!matching) { throw wrongNumberOfArgs(Object.keys(arity), args.length) } for (var ii = 0; ii < args.length; ++ii) { var newMatching = matching.filter(function (schema) { var type = schema[ii] var typeCheck = types[type].check return typeCheck(args[ii]) }) if (!newMatching.length) { var labels = matching.map(function (schema) { return types[schema[ii]].label }).filter(function (schema) { return schema != null }) throw invalidType(ii, labels, args[ii]) } matching = newMatching } } function missingRequiredArg (num) { return newException('EMISSINGARG', 'Missing required argument #' + (num + 1)) } function unknownType (num, type) { return newException('EUNKNOWNTYPE', 'Unknown type ' + type + ' in argument #' + (num + 1)) } function invalidType (num, expectedTypes, value) { var valueType Object.keys(types).forEach(function (typeCode) { if (types[typeCode].check(value)) valueType = types[typeCode].label }) return newException('EINVALIDTYPE', 'Argument #' + (num + 1) + ': Expected ' + englishList(expectedTypes) + ' but got ' + valueType) } function englishList (list) { return list.join(', ').replace(/, ([^,]+)$/, ' or $1') } function wrongNumberOfArgs (expected, got) { var english = englishList(expected) var args = expected.every(function (ex) { return ex.length === 1 }) ? 'argument' : 'arguments' return newException('EWRONGARGCOUNT', 'Expected ' + english + ' ' + args + ' but got ' + got) } function moreThanOneError (schema) { return newException('ETOOMANYERRORTYPES', 'Only one error type per argument signature is allowed, more than one found in "' + schema + '"') } function newException (code, msg) { var e = new Error(msg) e.code = code if (Error.captureStackTrace) Error.captureStackTrace(e, validate) return e } Copyright (c) 2015, Rebecca Turner Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "aproba", "version": "1.2.0", "description": "A ridiculously light-weight argument validator (now browser friendly)", "main": "index.js", "directories": { "test": "test" }, "dependencies": {}, "devDependencies": { "standard": "^10.0.3", "tap": "^10.0.2" }, "files": [ "index.js" ], "scripts": { "test": "standard && tap -j3 test/*.js" }, "repository": { "type": "git", "url": "https://github.com/iarna/aproba" }, "keywords": [ "argument", "validate" ], "author": "Rebecca Turner ", "license": "ISC", "bugs": { "url": "https://github.com/iarna/aproba/issues" }, "homepage": "https://github.com/iarna/aproba" } 'use strict' const DuplexStream = require('readable-stream').Duplex const inherits = require('inherits') const BufferList = require('./BufferList') function BufferListStream (callback) { if (!(this instanceof BufferListStream)) { return new BufferListStream(callback) } if (typeof callback === 'function') { this._callback = callback const piper = function piper (err) { if (this._callback) { this._callback(err) this._callback = null } }.bind(this) this.on('pipe', function onPipe (src) { src.on('error', piper) }) this.on('unpipe', function onUnpipe (src) { src.removeListener('error', piper) }) callback = null } BufferList._init.call(this, callback) DuplexStream.call(this) } inherits(BufferListStream, DuplexStream) Object.assign(BufferListStream.prototype, BufferList.prototype) BufferListStream.prototype._new = function _new (callback) { return new BufferListStream(callback) } BufferListStream.prototype._write = function _write (buf, encoding, callback) { this._appendBuffer(buf) if (typeof callback === 'function') { callback() } } BufferListStream.prototype._read = function _read (size) { if (!this.length) { return this.push(null) } size = Math.min(size, this.length) this.push(this.slice(0, size)) this.consume(size) } BufferListStream.prototype.end = function end (chunk) { DuplexStream.prototype.end.call(this, chunk) if (this._callback) { this._callback(null, this.slice()) this._callback = null } } BufferListStream.prototype._destroy = function _destroy (err, cb) { this._bufs.length = 0 this.length = 0 cb(err) } BufferListStream.prototype._isBufferList = function _isBufferList (b) { return b instanceof BufferListStream || b instanceof BufferList || BufferListStream.isBufferList(b) } BufferListStream.isBufferList = BufferList.isBufferList module.exports = BufferListStream module.exports.BufferListStream = BufferListStream module.exports.BufferList = BufferList 'use strict' const { Buffer } = require('buffer') const symbol = Symbol.for('BufferList') function BufferList (buf) { if (!(this instanceof BufferList)) { return new BufferList(buf) } BufferList._init.call(this, buf) } BufferList._init = function _init (buf) { Object.defineProperty(this, symbol, { value: true }) this._bufs = [] this.length = 0 if (buf) { this.append(buf) } } BufferList.prototype._new = function _new (buf) { return new BufferList(buf) } BufferList.prototype._offset = function _offset (offset) { if (offset === 0) { return [0, 0] } let tot = 0 for (let i = 0; i < this._bufs.length; i++) { const _t = tot + this._bufs[i].length if (offset < _t || i === this._bufs.length - 1) { return [i, offset - tot] } tot = _t } } BufferList.prototype._reverseOffset = function (blOffset) { const bufferId = blOffset[0] let offset = blOffset[1] for (let i = 0; i < bufferId; i++) { offset += this._bufs[i].length } return offset } BufferList.prototype.get = function get (index) { if (index > this.length || index < 0) { return undefined } const offset = this._offset(index) return this._bufs[offset[0]][offset[1]] } BufferList.prototype.slice = function slice (start, end) { if (typeof start === 'number' && start < 0) { start += this.length } if (typeof end === 'number' && end < 0) { end += this.length } return this.copy(null, 0, start, end) } BufferList.prototype.copy = function copy (dst, dstStart, srcStart, srcEnd) { if (typeof srcStart !== 'number' || srcStart < 0) { srcStart = 0 } if (typeof srcEnd !== 'number' || srcEnd > this.length) { srcEnd = this.length } if (srcStart >= this.length) { return dst || Buffer.alloc(0) } if (srcEnd <= 0) { return dst || Buffer.alloc(0) } const copy = !!dst const off = this._offset(srcStart) const len = srcEnd - srcStart let bytes = len let bufoff = (copy && dstStart) || 0 let start = off[1] // copy/slice everything if (srcStart === 0 && srcEnd === this.length) { if (!copy) { // slice, but full concat if multiple buffers return this._bufs.length === 1 ? this._bufs[0] : Buffer.concat(this._bufs, this.length) } // copy, need to copy individual buffers for (let i = 0; i < this._bufs.length; i++) { this._bufs[i].copy(dst, bufoff) bufoff += this._bufs[i].length } return dst } // easy, cheap case where it's a subset of one of the buffers if (bytes <= this._bufs[off[0]].length - start) { return copy ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes) : this._bufs[off[0]].slice(start, start + bytes) } if (!copy) { // a slice, we need something to copy in to dst = Buffer.allocUnsafe(len) } for (let i = off[0]; i < this._bufs.length; i++) { const l = this._bufs[i].length - start if (bytes > l) { this._bufs[i].copy(dst, bufoff, start) bufoff += l } else { this._bufs[i].copy(dst, bufoff, start, start + bytes) bufoff += l break } bytes -= l if (start) { start = 0 } } // safeguard so that we don't return uninitialized memory if (dst.length > bufoff) return dst.slice(0, bufoff) return dst } BufferList.prototype.shallowSlice = function shallowSlice (start, end) { start = start || 0 end = typeof end !== 'number' ? this.length : end if (start < 0) { start += this.length } if (end < 0) { end += this.length } if (start === end) { return this._new() } const startOffset = this._offset(start) const endOffset = this._offset(end) const buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1) if (endOffset[1] === 0) { buffers.pop() } else { buffers[buffers.length - 1] = buffers[buffers.length - 1].slice(0, endOffset[1]) } if (startOffset[1] !== 0) { buffers[0] = buffers[0].slice(startOffset[1]) } return this._new(buffers) } BufferList.prototype.toString = function toString (encoding, start, end) { return this.slice(start, end).toString(encoding) } BufferList.prototype.consume = function consume (bytes) { // first, normalize the argument, in accordance with how Buffer does it bytes = Math.trunc(bytes) // do nothing if not a positive number if (Number.isNaN(bytes) || bytes <= 0) return this while (this._bufs.length) { if (bytes >= this._bufs[0].length) { bytes -= this._bufs[0].length this.length -= this._bufs[0].length this._bufs.shift() } else { this._bufs[0] = this._bufs[0].slice(bytes) this.length -= bytes break } } return this } BufferList.prototype.duplicate = function duplicate () { const copy = this._new() for (let i = 0; i < this._bufs.length; i++) { copy.append(this._bufs[i]) } return copy } BufferList.prototype.append = function append (buf) { if (buf == null) { return this } if (buf.buffer) { // append a view of the underlying ArrayBuffer this._appendBuffer(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength)) } else if (Array.isArray(buf)) { for (let i = 0; i < buf.length; i++) { this.append(buf[i]) } } else if (this._isBufferList(buf)) { // unwrap argument into individual BufferLists for (let i = 0; i < buf._bufs.length; i++) { this.append(buf._bufs[i]) } } else { // coerce number arguments to strings, since Buffer(number) does // uninitialized memory allocation if (typeof buf === 'number') { buf = buf.toString() } this._appendBuffer(Buffer.from(buf)) } return this } BufferList.prototype._appendBuffer = function appendBuffer (buf) { this._bufs.push(buf) this.length += buf.length } BufferList.prototype.indexOf = function (search, offset, encoding) { if (encoding === undefined && typeof offset === 'string') { encoding = offset offset = undefined } if (typeof search === 'function' || Array.isArray(search)) { throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.') } else if (typeof search === 'number') { search = Buffer.from([search]) } else if (typeof search === 'string') { search = Buffer.from(search, encoding) } else if (this._isBufferList(search)) { search = search.slice() } else if (Array.isArray(search.buffer)) { search = Buffer.from(search.buffer, search.byteOffset, search.byteLength) } else if (!Buffer.isBuffer(search)) { search = Buffer.from(search) } offset = Number(offset || 0) if (isNaN(offset)) { offset = 0 } if (offset < 0) { offset = this.length + offset } if (offset < 0) { offset = 0 } if (search.length === 0) { return offset > this.length ? this.length : offset } const blOffset = this._offset(offset) let blIndex = blOffset[0] // index of which internal buffer we're working on let buffOffset = blOffset[1] // offset of the internal buffer we're working on // scan over each buffer for (; blIndex < this._bufs.length; blIndex++) { const buff = this._bufs[blIndex] while (buffOffset < buff.length) { const availableWindow = buff.length - buffOffset if (availableWindow >= search.length) { const nativeSearchResult = buff.indexOf(search, buffOffset) if (nativeSearchResult !== -1) { return this._reverseOffset([blIndex, nativeSearchResult]) } buffOffset = buff.length - search.length + 1 // end of native search window } else { const revOffset = this._reverseOffset([blIndex, buffOffset]) if (this._match(revOffset, search)) { return revOffset } buffOffset++ } } buffOffset = 0 } return -1 } BufferList.prototype._match = function (offset, search) { if (this.length - offset < search.length) { return false } for (let searchOffset = 0; searchOffset < search.length; searchOffset++) { if (this.get(offset + searchOffset) !== search[searchOffset]) { return false } } return true } ;(function () { const methods = { readDoubleBE: 8, readDoubleLE: 8, readFloatBE: 4, readFloatLE: 4, readInt32BE: 4, readInt32LE: 4, readUInt32BE: 4, readUInt32LE: 4, readInt16BE: 2, readInt16LE: 2, readUInt16BE: 2, readUInt16LE: 2, readInt8: 1, readUInt8: 1, readIntBE: null, readIntLE: null, readUIntBE: null, readUIntLE: null } for (const m in methods) { (function (m) { if (methods[m] === null) { BufferList.prototype[m] = function (offset, byteLength) { return this.slice(offset, offset + byteLength)[m](0, byteLength) } } else { BufferList.prototype[m] = function (offset = 0) { return this.slice(offset, offset + methods[m])[m](0) } } }(m)) } }()) // Used internally by the class and also as an indicator of this object being // a `BufferList`. It's not possible to use `instanceof BufferList` in a browser // environment because there could be multiple different copies of the // BufferList class and some `BufferList`s might be `BufferList`s. BufferList.prototype._isBufferList = function _isBufferList (b) { return b instanceof BufferList || BufferList.isBufferList(b) } BufferList.isBufferList = function isBufferList (b) { return b != null && b[symbol] } module.exports = BufferList The MIT License (MIT) ===================== Copyright (c) 2013-2019 bl contributors ---------------------------------- *bl contributors listed at * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "bl", "version": "4.1.0", "description": "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too!", "license": "MIT", "main": "bl.js", "scripts": { "lint": "standard *.js test/*.js", "test": "npm run lint && node test/test.js | faucet" }, "repository": { "type": "git", "url": "https://github.com/rvagg/bl.git" }, "homepage": "https://github.com/rvagg/bl", "authors": [ "Rod Vagg (https://github.com/rvagg)", "Matteo Collina (https://github.com/mcollina)", "Jarett Cruger (https://github.com/jcrugzz)" ], "keywords": [ "buffer", "buffers", "stream", "awesomesauce" ], "dependencies": { "buffer": "^5.5.0", "inherits": "^2.0.4", "readable-stream": "^3.4.0" }, "devDependencies": { "faucet": "~0.0.1", "standard": "^14.3.0", "tape": "^4.11.0" } } 'use strict'; function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } var codes = {}; function createErrorType(code, message, Base) { if (!Base) { Base = Error; } function getMessage(arg1, arg2, arg3) { if (typeof message === 'string') { return message; } else { return message(arg1, arg2, arg3); } } var NodeError = /*#__PURE__*/ function (_Base) { _inheritsLoose(NodeError, _Base); function NodeError(arg1, arg2, arg3) { return _Base.call(this, getMessage(arg1, arg2, arg3)) || this; } return NodeError; }(Base); NodeError.prototype.name = Base.name; NodeError.prototype.code = code; codes[code] = NodeError; } // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js function oneOf(expected, thing) { if (Array.isArray(expected)) { var len = expected.length; expected = expected.map(function (i) { return String(i); }); if (len > 2) { return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(', '), ", or ") + expected[len - 1]; } else if (len === 2) { return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]); } else { return "of ".concat(thing, " ").concat(expected[0]); } } else { return "of ".concat(thing, " ").concat(String(expected)); } } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith function startsWith(str, search, pos) { return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith function endsWith(str, search, this_len) { if (this_len === undefined || this_len > str.length) { this_len = str.length; } return str.substring(this_len - search.length, this_len) === search; } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes function includes(str, search, start) { if (typeof start !== 'number') { start = 0; } if (start + search.length > str.length) { return false; } else { return str.indexOf(search, start) !== -1; } } createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) { return 'The value "' + value + '" is invalid for option "' + name + '"'; }, TypeError); createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { // determiner: 'must be' or 'must not be' var determiner; if (typeof expected === 'string' && startsWith(expected, 'not ')) { determiner = 'must not be'; expected = expected.replace(/^not /, ''); } else { determiner = 'must be'; } var msg; if (endsWith(name, ' argument')) { // For cases like 'first argument' msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, 'type')); } else { var type = includes(name, '.') ? 'property' : 'argument'; msg = "The \"".concat(name, "\" ").concat(type, " ").concat(determiner, " ").concat(oneOf(expected, 'type')); } msg += ". Received type ".concat(typeof actual); return msg; }, TypeError); createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF'); createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) { return 'The ' + name + ' method is not implemented'; }); createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close'); createErrorType('ERR_STREAM_DESTROYED', function (name) { return 'Cannot call ' + name + ' after a stream was destroyed'; }); createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times'); createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable'); createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end'); createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError); createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { return 'Unknown encoding: ' + arg; }, TypeError); createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); module.exports.codes = codes; 'use strict'; const codes = {}; function createErrorType(code, message, Base) { if (!Base) { Base = Error } function getMessage (arg1, arg2, arg3) { if (typeof message === 'string') { return message } else { return message(arg1, arg2, arg3) } } class NodeError extends Base { constructor (arg1, arg2, arg3) { super(getMessage(arg1, arg2, arg3)); } } NodeError.prototype.name = Base.name; NodeError.prototype.code = code; codes[code] = NodeError; } // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js function oneOf(expected, thing) { if (Array.isArray(expected)) { const len = expected.length; expected = expected.map((i) => String(i)); if (len > 2) { return `one of ${thing} ${expected.slice(0, len - 1).join(', ')}, or ` + expected[len - 1]; } else if (len === 2) { return `one of ${thing} ${expected[0]} or ${expected[1]}`; } else { return `of ${thing} ${expected[0]}`; } } else { return `of ${thing} ${String(expected)}`; } } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith function startsWith(str, search, pos) { return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith function endsWith(str, search, this_len) { if (this_len === undefined || this_len > str.length) { this_len = str.length; } return str.substring(this_len - search.length, this_len) === search; } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes function includes(str, search, start) { if (typeof start !== 'number') { start = 0; } if (start + search.length > str.length) { return false; } else { return str.indexOf(search, start) !== -1; } } createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) { return 'The value "' + value + '" is invalid for option "' + name + '"' }, TypeError); createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { // determiner: 'must be' or 'must not be' let determiner; if (typeof expected === 'string' && startsWith(expected, 'not ')) { determiner = 'must not be'; expected = expected.replace(/^not /, ''); } else { determiner = 'must be'; } let msg; if (endsWith(name, ' argument')) { // For cases like 'first argument' msg = `The ${name} ${determiner} ${oneOf(expected, 'type')}`; } else { const type = includes(name, '.') ? 'property' : 'argument'; msg = `The "${name}" ${type} ${determiner} ${oneOf(expected, 'type')}`; } msg += `. Received type ${typeof actual}`; return msg; }, TypeError); createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF'); createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) { return 'The ' + name + ' method is not implemented' }); createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close'); createErrorType('ERR_STREAM_DESTROYED', function (name) { return 'Cannot call ' + name + ' after a stream was destroyed'; }); createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times'); createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable'); createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end'); createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError); createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { return 'Unknown encoding: ' + arg }, TypeError); createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); module.exports.codes = codes; 'use strict' var experimentalWarnings = new Set(); function emitExperimentalWarning(feature) { if (experimentalWarnings.has(feature)) return; var msg = feature + ' is an experimental feature. This feature could ' + 'change at any time'; experimentalWarnings.add(feature); process.emitWarning(msg, 'ExperimentalWarning'); } function noop() {} module.exports.emitExperimentalWarning = process.emitWarning ? emitExperimentalWarning : noop; ### Streams Working Group The Node.js Streams is jointly governed by a Working Group (WG) that is responsible for high-level guidance of the project. The WG has final authority over this project including: * Technical direction * Project governance and process (including this policy) * Contribution policy * GitHub repository hosting * Conduct guidelines * Maintaining the list of additional Collaborators For the current list of WG members, see the project [README.md](./README.md#current-project-team-members). ### Collaborators The readable-stream GitHub repository is maintained by the WG and additional Collaborators who are added by the WG on an ongoing basis. Individuals making significant and valuable contributions are made Collaborators and given commit-access to the project. These individuals are identified by the WG and their addition as Collaborators is discussed during the WG meeting. _Note:_ If you make a significant contribution and are not considered for commit-access log an issue or contact a WG member directly and it will be brought up in the next WG meeting. Modifications of the contents of the readable-stream repository are made on a collaborative basis. Anybody with a GitHub account may propose a modification via pull request and it will be considered by the project Collaborators. All pull requests must be reviewed and accepted by a Collaborator with sufficient expertise who is able to take full responsibility for the change. In the case of pull requests proposed by an existing Collaborator, an additional Collaborator is required for sign-off. Consensus should be sought if additional Collaborators participate and there is disagreement around a particular modification. See _Consensus Seeking Process_ below for further detail on the consensus model used for governance. Collaborators may opt to elevate significant or controversial modifications, or modifications that have not found consensus to the WG for discussion by assigning the ***WG-agenda*** tag to a pull request or issue. The WG should serve as the final arbiter where required. For the current list of Collaborators, see the project [README.md](./README.md#members). ### WG Membership WG seats are not time-limited. There is no fixed size of the WG. However, the expected target is between 6 and 12, to ensure adequate coverage of important areas of expertise, balanced with the ability to make decisions efficiently. There is no specific set of requirements or qualifications for WG membership beyond these rules. The WG may add additional members to the WG by unanimous consensus. A WG member may be removed from the WG by voluntary resignation, or by unanimous consensus of all other WG members. Changes to WG membership should be posted in the agenda, and may be suggested as any other agenda item (see "WG Meetings" below). If an addition or removal is proposed during a meeting, and the full WG is not in attendance to participate, then the addition or removal is added to the agenda for the subsequent meeting. This is to ensure that all members are given the opportunity to participate in all membership decisions. If a WG member is unable to attend a meeting where a planned membership decision is being made, then their consent is assumed. No more than 1/3 of the WG members may be affiliated with the same employer. If removal or resignation of a WG member, or a change of employment by a WG member, creates a situation where more than 1/3 of the WG membership shares an employer, then the situation must be immediately remedied by the resignation or removal of one or more WG members affiliated with the over-represented employer(s). ### WG Meetings The WG meets occasionally on a Google Hangout On Air. A designated moderator approved by the WG runs the meeting. Each meeting should be published to YouTube. Items are added to the WG agenda that are considered contentious or are modifications of governance, contribution policy, WG membership, or release process. The intention of the agenda is not to approve or review all patches; that should happen continuously on GitHub and be handled by the larger group of Collaborators. Any community member or contributor can ask that something be added to the next meeting's agenda by logging a GitHub Issue. Any Collaborator, WG member or the moderator can add the item to the agenda by adding the ***WG-agenda*** tag to the issue. Prior to each WG meeting the moderator will share the Agenda with members of the WG. WG members can add any items they like to the agenda at the beginning of each meeting. The moderator and the WG cannot veto or remove items. The WG may invite persons or representatives from certain projects to participate in a non-voting capacity. The moderator is responsible for summarizing the discussion of each agenda item and sends it as a pull request after the meeting. ### Consensus Seeking Process The WG follows a [Consensus Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making) decision-making model. When an agenda item has appeared to reach a consensus the moderator will ask "Does anyone object?" as a final call for dissent from the consensus. If an agenda item cannot reach a consensus a WG member can call for either a closing vote or a vote to table the issue to the next meeting. The call for a vote must be seconded by a majority of the WG or else the discussion will continue. Simple majority wins. Note that changes to WG membership require a majority consensus. See "WG Membership" above. Node.js is licensed for use as follows: """ Copyright Node.js contributors. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ This license applies to parts of Node.js originating from the https://github.com/joyent/node repository: """ Copyright Joyent, Inc. and other Node contributors. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ { "name": "readable-stream", "version": "3.6.0", "description": "Streams3, a user-land copy of the stream library from Node.js", "main": "readable.js", "engines": { "node": ">= 6" }, "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" }, "devDependencies": { "@babel/cli": "^7.2.0", "@babel/core": "^7.2.0", "@babel/polyfill": "^7.0.0", "@babel/preset-env": "^7.2.0", "airtap": "0.0.9", "assert": "^1.4.0", "bl": "^2.0.0", "deep-strict-equal": "^0.2.0", "events.once": "^2.0.2", "glob": "^7.1.2", "gunzip-maybe": "^1.4.1", "hyperquest": "^2.1.3", "lolex": "^2.6.0", "nyc": "^11.0.0", "pump": "^3.0.0", "rimraf": "^2.6.2", "tap": "^12.0.0", "tape": "^4.9.0", "tar-fs": "^1.16.2", "util-promisify": "^2.1.0" }, "scripts": { "test": "tap -J --no-esm test/parallel/*.js test/ours/*.js", "ci": "TAP=1 tap --no-esm test/parallel/*.js test/ours/*.js | tee test.tap", "test-browsers": "airtap --sauce-connect --loopback airtap.local -- test/browser.js", "test-browser-local": "airtap --open --local -- test/browser.js", "cover": "nyc npm test", "report": "nyc report --reporter=lcov", "update-browser-errors": "babel -o errors-browser.js errors.js" }, "repository": { "type": "git", "url": "git://github.com/nodejs/readable-stream" }, "keywords": [ "readable", "stream", "pipe" ], "browser": { "util": false, "worker_threads": false, "./errors": "./errors-browser.js", "./readable.js": "./readable-browser.js", "./lib/internal/streams/from.js": "./lib/internal/streams/from-browser.js", "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js" }, "nyc": { "include": [ "lib/**.js" ] }, "license": "MIT" } exports = module.exports = require('./lib/_stream_readable.js'); exports.Stream = exports; exports.Readable = exports; exports.Writable = require('./lib/_stream_writable.js'); exports.Duplex = require('./lib/_stream_duplex.js'); exports.Transform = require('./lib/_stream_transform.js'); exports.PassThrough = require('./lib/_stream_passthrough.js'); exports.finished = require('./lib/internal/streams/end-of-stream.js'); exports.pipeline = require('./lib/internal/streams/pipeline.js'); var Stream = require('stream'); if (process.env.READABLE_STREAM === 'disable' && Stream) { module.exports = Stream.Readable; Object.assign(module.exports, Stream); module.exports.Stream = Stream; } else { exports = module.exports = require('./lib/_stream_readable.js'); exports.Stream = Stream || exports; exports.Readable = exports; exports.Writable = require('./lib/_stream_writable.js'); exports.Duplex = require('./lib/_stream_duplex.js'); exports.Transform = require('./lib/_stream_transform.js'); exports.PassThrough = require('./lib/_stream_passthrough.js'); exports.finished = require('./lib/internal/streams/end-of-stream.js'); exports.pipeline = require('./lib/internal/streams/pipeline.js'); } // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // a duplex stream is just a stream that is both readable and writable. // Since JS doesn't have multiple prototypal inheritance, this class // prototypally inherits from Readable, and then parasitically from // Writable. 'use strict'; /**/ var objectKeys = Object.keys || function (obj) { var keys = []; for (var key in obj) { keys.push(key); } return keys; }; /**/ module.exports = Duplex; var Readable = require('./_stream_readable'); var Writable = require('./_stream_writable'); require('inherits')(Duplex, Readable); { // Allow the keys array to be GC'ed. var keys = objectKeys(Writable.prototype); for (var v = 0; v < keys.length; v++) { var method = keys[v]; if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; } } function Duplex(options) { if (!(this instanceof Duplex)) return new Duplex(options); Readable.call(this, options); Writable.call(this, options); this.allowHalfOpen = true; if (options) { if (options.readable === false) this.readable = false; if (options.writable === false) this.writable = false; if (options.allowHalfOpen === false) { this.allowHalfOpen = false; this.once('end', onend); } } } Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState.highWaterMark; } }); Object.defineProperty(Duplex.prototype, 'writableBuffer', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState && this._writableState.getBuffer(); } }); Object.defineProperty(Duplex.prototype, 'writableLength', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState.length; } }); // the no-half-open enforcer function onend() { // If the writable side ended, then we're ok. if (this._writableState.ended) return; // no more data can be written. // But allow more writes to happen in this tick. process.nextTick(onEndNT, this); } function onEndNT(self) { self.end(); } Object.defineProperty(Duplex.prototype, 'destroyed', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { if (this._readableState === undefined || this._writableState === undefined) { return false; } return this._readableState.destroyed && this._writableState.destroyed; }, set: function set(value) { // we ignore the value if the stream // has not been initialized yet if (this._readableState === undefined || this._writableState === undefined) { return; } // backward compatibility, the user is explicitly // managing destroyed this._readableState.destroyed = value; this._writableState.destroyed = value; } });// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // a passthrough stream. // basically just the most minimal sort of Transform stream. // Every written chunk gets output as-is. 'use strict'; module.exports = PassThrough; var Transform = require('./_stream_transform'); require('inherits')(PassThrough, Transform); function PassThrough(options) { if (!(this instanceof PassThrough)) return new PassThrough(options); Transform.call(this, options); } PassThrough.prototype._transform = function (chunk, encoding, cb) { cb(null, chunk); };// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; module.exports = Readable; /**/ var Duplex; /**/ Readable.ReadableState = ReadableState; /**/ var EE = require('events').EventEmitter; var EElistenerCount = function EElistenerCount(emitter, type) { return emitter.listeners(type).length; }; /**/ /**/ var Stream = require('./internal/streams/stream'); /**/ var Buffer = require('buffer').Buffer; var OurUint8Array = global.Uint8Array || function () {}; function _uint8ArrayToBuffer(chunk) { return Buffer.from(chunk); } function _isUint8Array(obj) { return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; } /**/ var debugUtil = require('util'); var debug; if (debugUtil && debugUtil.debuglog) { debug = debugUtil.debuglog('stream'); } else { debug = function debug() {}; } /**/ var BufferList = require('./internal/streams/buffer_list'); var destroyImpl = require('./internal/streams/destroy'); var _require = require('./internal/streams/state'), getHighWaterMark = _require.getHighWaterMark; var _require$codes = require('../errors').codes, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; // Lazy loaded to improve the startup performance. var StringDecoder; var createReadableStreamAsyncIterator; var from; require('inherits')(Readable, Stream); var errorOrDestroy = destroyImpl.errorOrDestroy; var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; function prependListener(emitter, event, fn) { // Sadly this is not cacheable as some libraries bundle their own // event emitter implementation with them. if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); // This is a hack to make sure that our error handler is attached before any // userland ones. NEVER DO THIS. This is here only because this code needs // to continue to work with older versions of Node.js that do not include // the prependListener() method. The goal is to eventually remove this hack. if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; } function ReadableState(options, stream, isDuplex) { Duplex = Duplex || require('./_stream_duplex'); options = options || {}; // Duplex streams are both readable and writable, but share // the same options object. // However, some cases require setting options to different // values for the readable and the writable sides of the duplex stream. // These options can be provided separately as readableXXX and writableXXX. if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag. Used to make read(n) ignore n and to // make all the buffer merging and length checks go away this.objectMode = !!options.objectMode; if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer // Note: 0 is a valid value, means "don't call _read preemptively ever" this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex); // A linked list is used to store data chunks instead of an array because the // linked list can remove elements from the beginning faster than // array.shift() this.buffer = new BufferList(); this.length = 0; this.pipes = null; this.pipesCount = 0; this.flowing = null; this.ended = false; this.endEmitted = false; this.reading = false; // a flag to be able to tell if the event 'readable'/'data' is emitted // immediately, or on a later tick. We set this to true at first, because // any actions that shouldn't happen until "later" should generally also // not happen before the first read call. this.sync = true; // whenever we return null, then we set a flag to say // that we're awaiting a 'readable' event emission. this.needReadable = false; this.emittedReadable = false; this.readableListening = false; this.resumeScheduled = false; this.paused = true; // Should close be emitted on destroy. Defaults to true. this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'end' (and potentially 'finish') this.autoDestroy = !!options.autoDestroy; // has it been destroyed this.destroyed = false; // Crypto is kind of old and crusty. Historically, its default string // encoding is 'binary' so we have to make this configurable. // Everything else in the universe uses 'utf8', though. this.defaultEncoding = options.defaultEncoding || 'utf8'; // the number of writers that are awaiting a drain event in .pipe()s this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled this.readingMore = false; this.decoder = null; this.encoding = null; if (options.encoding) { if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; this.decoder = new StringDecoder(options.encoding); this.encoding = options.encoding; } } function Readable(options) { Duplex = Duplex || require('./_stream_duplex'); if (!(this instanceof Readable)) return new Readable(options); // Checking for a Stream.Duplex instance is faster here instead of inside // the ReadableState constructor, at least with V8 6.5 var isDuplex = this instanceof Duplex; this._readableState = new ReadableState(options, this, isDuplex); // legacy this.readable = true; if (options) { if (typeof options.read === 'function') this._read = options.read; if (typeof options.destroy === 'function') this._destroy = options.destroy; } Stream.call(this); } Object.defineProperty(Readable.prototype, 'destroyed', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { if (this._readableState === undefined) { return false; } return this._readableState.destroyed; }, set: function set(value) { // we ignore the value if the stream // has not been initialized yet if (!this._readableState) { return; } // backward compatibility, the user is explicitly // managing destroyed this._readableState.destroyed = value; } }); Readable.prototype.destroy = destroyImpl.destroy; Readable.prototype._undestroy = destroyImpl.undestroy; Readable.prototype._destroy = function (err, cb) { cb(err); }; // Manually shove something into the read() buffer. // This returns true if the highWaterMark has not been hit yet, // similar to how Writable.write() returns true if you should // write() some more. Readable.prototype.push = function (chunk, encoding) { var state = this._readableState; var skipChunkCheck; if (!state.objectMode) { if (typeof chunk === 'string') { encoding = encoding || state.defaultEncoding; if (encoding !== state.encoding) { chunk = Buffer.from(chunk, encoding); encoding = ''; } skipChunkCheck = true; } } else { skipChunkCheck = true; } return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); }; // Unshift should *always* be something directly out of read() Readable.prototype.unshift = function (chunk) { return readableAddChunk(this, chunk, null, true, false); }; function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { debug('readableAddChunk', chunk); var state = stream._readableState; if (chunk === null) { state.reading = false; onEofChunk(stream, state); } else { var er; if (!skipChunkCheck) er = chunkInvalid(state, chunk); if (er) { errorOrDestroy(stream, er); } else if (state.objectMode || chunk && chunk.length > 0) { if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { chunk = _uint8ArrayToBuffer(chunk); } if (addToFront) { if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true); } else if (state.ended) { errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF()); } else if (state.destroyed) { return false; } else { state.reading = false; if (state.decoder && !encoding) { chunk = state.decoder.write(chunk); if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); } else { addChunk(stream, state, chunk, false); } } } else if (!addToFront) { state.reading = false; maybeReadMore(stream, state); } } // We can push more data if we are below the highWaterMark. // Also, if we have no data yet, we can stand some more bytes. // This is to work around cases where hwm=0, such as the repl. return !state.ended && (state.length < state.highWaterMark || state.length === 0); } function addChunk(stream, state, chunk, addToFront) { if (state.flowing && state.length === 0 && !state.sync) { state.awaitDrain = 0; stream.emit('data', chunk); } else { // update the buffer info. state.length += state.objectMode ? 1 : chunk.length; if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); if (state.needReadable) emitReadable(stream); } maybeReadMore(stream, state); } function chunkInvalid(state, chunk) { var er; if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk); } return er; } Readable.prototype.isPaused = function () { return this._readableState.flowing === false; }; // backwards compatibility. Readable.prototype.setEncoding = function (enc) { if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; var decoder = new StringDecoder(enc); this._readableState.decoder = decoder; // If setEncoding(null), decoder.encoding equals utf8 this._readableState.encoding = this._readableState.decoder.encoding; // Iterate over current buffer to convert already stored Buffers: var p = this._readableState.buffer.head; var content = ''; while (p !== null) { content += decoder.write(p.data); p = p.next; } this._readableState.buffer.clear(); if (content !== '') this._readableState.buffer.push(content); this._readableState.length = content.length; return this; }; // Don't raise the hwm > 1GB var MAX_HWM = 0x40000000; function computeNewHighWaterMark(n) { if (n >= MAX_HWM) { // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE. n = MAX_HWM; } else { // Get the next highest power of 2 to prevent increasing hwm excessively in // tiny amounts n--; n |= n >>> 1; n |= n >>> 2; n |= n >>> 4; n |= n >>> 8; n |= n >>> 16; n++; } return n; } // This function is designed to be inlinable, so please take care when making // changes to the function body. function howMuchToRead(n, state) { if (n <= 0 || state.length === 0 && state.ended) return 0; if (state.objectMode) return 1; if (n !== n) { // Only flow one buffer at a time if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; } // If we're asking for more than the current hwm, then raise the hwm. if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); if (n <= state.length) return n; // Don't have enough if (!state.ended) { state.needReadable = true; return 0; } return state.length; } // you can override either this method, or the async _read(n) below. Readable.prototype.read = function (n) { debug('read', n); n = parseInt(n, 10); var state = this._readableState; var nOrig = n; if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we // already have a bunch of data in the buffer, then just trigger // the 'readable' event and move on. if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { debug('read: emitReadable', state.length, state.ended); if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); return null; } n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up. if (n === 0 && state.ended) { if (state.length === 0) endReadable(this); return null; } // All the actual chunk generation logic needs to be // *below* the call to _read. The reason is that in certain // synthetic stream cases, such as passthrough streams, _read // may be a completely synchronous operation which may change // the state of the read buffer, providing enough data when // before there was *not* enough. // // So, the steps are: // 1. Figure out what the state of things will be after we do // a read from the buffer. // // 2. If that resulting state will trigger a _read, then call _read. // Note that this may be asynchronous, or synchronous. Yes, it is // deeply ugly to write APIs this way, but that still doesn't mean // that the Readable class should behave improperly, as streams are // designed to be sync/async agnostic. // Take note if the _read call is sync or async (ie, if the read call // has returned yet), so that we know whether or not it's safe to emit // 'readable' etc. // // 3. Actually pull the requested chunks out of the buffer and return. // if we need a readable event, then we need to do some reading. var doRead = state.needReadable; debug('need readable', doRead); // if we currently have less than the highWaterMark, then also read some if (state.length === 0 || state.length - n < state.highWaterMark) { doRead = true; debug('length less than watermark', doRead); } // however, if we've ended, then there's no point, and if we're already // reading, then it's unnecessary. if (state.ended || state.reading) { doRead = false; debug('reading or ended', doRead); } else if (doRead) { debug('do read'); state.reading = true; state.sync = true; // if the length is currently zero, then we *need* a readable event. if (state.length === 0) state.needReadable = true; // call internal read method this._read(state.highWaterMark); state.sync = false; // If _read pushed data synchronously, then `reading` will be false, // and we need to re-evaluate how much data we can return to the user. if (!state.reading) n = howMuchToRead(nOrig, state); } var ret; if (n > 0) ret = fromList(n, state);else ret = null; if (ret === null) { state.needReadable = state.length <= state.highWaterMark; n = 0; } else { state.length -= n; state.awaitDrain = 0; } if (state.length === 0) { // If we have nothing in the buffer, then we want to know // as soon as we *do* get something into the buffer. if (!state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick. if (nOrig !== n && state.ended) endReadable(this); } if (ret !== null) this.emit('data', ret); return ret; }; function onEofChunk(stream, state) { debug('onEofChunk'); if (state.ended) return; if (state.decoder) { var chunk = state.decoder.end(); if (chunk && chunk.length) { state.buffer.push(chunk); state.length += state.objectMode ? 1 : chunk.length; } } state.ended = true; if (state.sync) { // if we are sync, wait until next tick to emit the data. // Otherwise we risk emitting data in the flow() // the readable code triggers during a read() call emitReadable(stream); } else { // emit 'readable' now to make sure it gets picked up. state.needReadable = false; if (!state.emittedReadable) { state.emittedReadable = true; emitReadable_(stream); } } } // Don't emit readable right away in sync mode, because this can trigger // another read() call => stack overflow. This way, it might trigger // a nextTick recursion warning, but that's not so bad. function emitReadable(stream) { var state = stream._readableState; debug('emitReadable', state.needReadable, state.emittedReadable); state.needReadable = false; if (!state.emittedReadable) { debug('emitReadable', state.flowing); state.emittedReadable = true; process.nextTick(emitReadable_, stream); } } function emitReadable_(stream) { var state = stream._readableState; debug('emitReadable_', state.destroyed, state.length, state.ended); if (!state.destroyed && (state.length || state.ended)) { stream.emit('readable'); state.emittedReadable = false; } // The stream needs another readable event if // 1. It is not flowing, as the flow mechanism will take // care of it. // 2. It is not ended. // 3. It is below the highWaterMark, so we can schedule // another readable later. state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; flow(stream); } // at this point, the user has presumably seen the 'readable' event, // and called read() to consume some data. that may have triggered // in turn another _read(n) call, in which case reading = true if // it's in progress. // However, if we're not ended, or reading, and the length < hwm, // then go ahead and try to read some more preemptively. function maybeReadMore(stream, state) { if (!state.readingMore) { state.readingMore = true; process.nextTick(maybeReadMore_, stream, state); } } function maybeReadMore_(stream, state) { // Attempt to read more data if we should. // // The conditions for reading more data are (one of): // - Not enough data buffered (state.length < state.highWaterMark). The loop // is responsible for filling the buffer with enough data if such data // is available. If highWaterMark is 0 and we are not in the flowing mode // we should _not_ attempt to buffer any extra data. We'll get more data // when the stream consumer calls read() instead. // - No data in the buffer, and the stream is in flowing mode. In this mode // the loop below is responsible for ensuring read() is called. Failing to // call read here would abort the flow and there's no other mechanism for // continuing the flow if the stream consumer has just subscribed to the // 'data' event. // // In addition to the above conditions to keep reading data, the following // conditions prevent the data from being read: // - The stream has ended (state.ended). // - There is already a pending 'read' operation (state.reading). This is a // case where the the stream has called the implementation defined _read() // method, but they are processing the call asynchronously and have _not_ // called push() with new data. In this case we skip performing more // read()s. The execution ends in this method again after the _read() ends // up calling push() with more data. while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { var len = state.length; debug('maybeReadMore read 0'); stream.read(0); if (len === state.length) // didn't get any data, stop spinning. break; } state.readingMore = false; } // abstract method. to be overridden in specific implementation classes. // call cb(er, data) where data is <= n in length. // for virtual (non-string, non-buffer) streams, "length" is somewhat // arbitrary, and perhaps not very meaningful. Readable.prototype._read = function (n) { errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()')); }; Readable.prototype.pipe = function (dest, pipeOpts) { var src = this; var state = this._readableState; switch (state.pipesCount) { case 0: state.pipes = dest; break; case 1: state.pipes = [state.pipes, dest]; break; default: state.pipes.push(dest); break; } state.pipesCount += 1; debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; var endFn = doEnd ? onend : unpipe; if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn); dest.on('unpipe', onunpipe); function onunpipe(readable, unpipeInfo) { debug('onunpipe'); if (readable === src) { if (unpipeInfo && unpipeInfo.hasUnpiped === false) { unpipeInfo.hasUnpiped = true; cleanup(); } } } function onend() { debug('onend'); dest.end(); } // when the dest drains, it reduces the awaitDrain counter // on the source. This would be more elegant with a .once() // handler in flow(), but adding and removing repeatedly is // too slow. var ondrain = pipeOnDrain(src); dest.on('drain', ondrain); var cleanedUp = false; function cleanup() { debug('cleanup'); // cleanup event handlers once the pipe is broken dest.removeListener('close', onclose); dest.removeListener('finish', onfinish); dest.removeListener('drain', ondrain); dest.removeListener('error', onerror); dest.removeListener('unpipe', onunpipe); src.removeListener('end', onend); src.removeListener('end', unpipe); src.removeListener('data', ondata); cleanedUp = true; // if the reader is waiting for a drain event from this // specific writer, then it would cause it to never start // flowing again. // So, if this is awaiting a drain, then we just call it now. // If we don't know, then assume that we are waiting for one. if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); } src.on('data', ondata); function ondata(chunk) { debug('ondata'); var ret = dest.write(chunk); debug('dest.write', ret); if (ret === false) { // If the user unpiped during `dest.write()`, it is possible // to get stuck in a permanently paused state if that write // also returned false. // => Check whether `dest` is still a piping destination. if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { debug('false write response, pause', state.awaitDrain); state.awaitDrain++; } src.pause(); } } // if the dest has an error, then stop piping into it. // however, don't suppress the throwing behavior for this. function onerror(er) { debug('onerror', er); unpipe(); dest.removeListener('error', onerror); if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er); } // Make sure our error handler is attached before userland ones. prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once. function onclose() { dest.removeListener('finish', onfinish); unpipe(); } dest.once('close', onclose); function onfinish() { debug('onfinish'); dest.removeListener('close', onclose); unpipe(); } dest.once('finish', onfinish); function unpipe() { debug('unpipe'); src.unpipe(dest); } // tell the dest that it's being piped to dest.emit('pipe', src); // start the flow if it hasn't been started already. if (!state.flowing) { debug('pipe resume'); src.resume(); } return dest; }; function pipeOnDrain(src) { return function pipeOnDrainFunctionResult() { var state = src._readableState; debug('pipeOnDrain', state.awaitDrain); if (state.awaitDrain) state.awaitDrain--; if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { state.flowing = true; flow(src); } }; } Readable.prototype.unpipe = function (dest) { var state = this._readableState; var unpipeInfo = { hasUnpiped: false }; // if we're not piping anywhere, then do nothing. if (state.pipesCount === 0) return this; // just one destination. most common case. if (state.pipesCount === 1) { // passed in one, but it's not the right one. if (dest && dest !== state.pipes) return this; if (!dest) dest = state.pipes; // got a match. state.pipes = null; state.pipesCount = 0; state.flowing = false; if (dest) dest.emit('unpipe', this, unpipeInfo); return this; } // slow case. multiple pipe destinations. if (!dest) { // remove all. var dests = state.pipes; var len = state.pipesCount; state.pipes = null; state.pipesCount = 0; state.flowing = false; for (var i = 0; i < len; i++) { dests[i].emit('unpipe', this, { hasUnpiped: false }); } return this; } // try to find the right one. var index = indexOf(state.pipes, dest); if (index === -1) return this; state.pipes.splice(index, 1); state.pipesCount -= 1; if (state.pipesCount === 1) state.pipes = state.pipes[0]; dest.emit('unpipe', this, unpipeInfo); return this; }; // set up data events if they are asked for // Ensure readable listeners eventually get something Readable.prototype.on = function (ev, fn) { var res = Stream.prototype.on.call(this, ev, fn); var state = this._readableState; if (ev === 'data') { // update readableListening so that resume() may be a no-op // a few lines down. This is needed to support once('readable'). state.readableListening = this.listenerCount('readable') > 0; // Try start flowing on next tick if stream isn't explicitly paused if (state.flowing !== false) this.resume(); } else if (ev === 'readable') { if (!state.endEmitted && !state.readableListening) { state.readableListening = state.needReadable = true; state.flowing = false; state.emittedReadable = false; debug('on readable', state.length, state.reading); if (state.length) { emitReadable(this); } else if (!state.reading) { process.nextTick(nReadingNextTick, this); } } } return res; }; Readable.prototype.addListener = Readable.prototype.on; Readable.prototype.removeListener = function (ev, fn) { var res = Stream.prototype.removeListener.call(this, ev, fn); if (ev === 'readable') { // We need to check if there is someone still listening to // readable and reset the state. However this needs to happen // after readable has been emitted but before I/O (nextTick) to // support once('readable', fn) cycles. This means that calling // resume within the same tick will have no // effect. process.nextTick(updateReadableListening, this); } return res; }; Readable.prototype.removeAllListeners = function (ev) { var res = Stream.prototype.removeAllListeners.apply(this, arguments); if (ev === 'readable' || ev === undefined) { // We need to check if there is someone still listening to // readable and reset the state. However this needs to happen // after readable has been emitted but before I/O (nextTick) to // support once('readable', fn) cycles. This means that calling // resume within the same tick will have no // effect. process.nextTick(updateReadableListening, this); } return res; }; function updateReadableListening(self) { var state = self._readableState; state.readableListening = self.listenerCount('readable') > 0; if (state.resumeScheduled && !state.paused) { // flowing needs to be set to true now, otherwise // the upcoming resume will not flow. state.flowing = true; // crude way to check if we should resume } else if (self.listenerCount('data') > 0) { self.resume(); } } function nReadingNextTick(self) { debug('readable nexttick read 0'); self.read(0); } // pause() and resume() are remnants of the legacy readable stream API // If the user uses them, then switch into old mode. Readable.prototype.resume = function () { var state = this._readableState; if (!state.flowing) { debug('resume'); // we flow only if there is no one listening // for readable, but we still have to call // resume() state.flowing = !state.readableListening; resume(this, state); } state.paused = false; return this; }; function resume(stream, state) { if (!state.resumeScheduled) { state.resumeScheduled = true; process.nextTick(resume_, stream, state); } } function resume_(stream, state) { debug('resume', state.reading); if (!state.reading) { stream.read(0); } state.resumeScheduled = false; stream.emit('resume'); flow(stream); if (state.flowing && !state.reading) stream.read(0); } Readable.prototype.pause = function () { debug('call pause flowing=%j', this._readableState.flowing); if (this._readableState.flowing !== false) { debug('pause'); this._readableState.flowing = false; this.emit('pause'); } this._readableState.paused = true; return this; }; function flow(stream) { var state = stream._readableState; debug('flow', state.flowing); while (state.flowing && stream.read() !== null) { ; } } // wrap an old-style stream as the async data source. // This is *not* part of the readable stream interface. // It is an ugly unfortunate mess of history. Readable.prototype.wrap = function (stream) { var _this = this; var state = this._readableState; var paused = false; stream.on('end', function () { debug('wrapped end'); if (state.decoder && !state.ended) { var chunk = state.decoder.end(); if (chunk && chunk.length) _this.push(chunk); } _this.push(null); }); stream.on('data', function (chunk) { debug('wrapped data'); if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; var ret = _this.push(chunk); if (!ret) { paused = true; stream.pause(); } }); // proxy all the other methods. // important when wrapping filters and duplexes. for (var i in stream) { if (this[i] === undefined && typeof stream[i] === 'function') { this[i] = function methodWrap(method) { return function methodWrapReturnFunction() { return stream[method].apply(stream, arguments); }; }(i); } } // proxy certain important events. for (var n = 0; n < kProxyEvents.length; n++) { stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); } // when we try to consume some more bytes, simply unpause the // underlying stream. this._read = function (n) { debug('wrapped _read', n); if (paused) { paused = false; stream.resume(); } }; return this; }; if (typeof Symbol === 'function') { Readable.prototype[Symbol.asyncIterator] = function () { if (createReadableStreamAsyncIterator === undefined) { createReadableStreamAsyncIterator = require('./internal/streams/async_iterator'); } return createReadableStreamAsyncIterator(this); }; } Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._readableState.highWaterMark; } }); Object.defineProperty(Readable.prototype, 'readableBuffer', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._readableState && this._readableState.buffer; } }); Object.defineProperty(Readable.prototype, 'readableFlowing', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._readableState.flowing; }, set: function set(state) { if (this._readableState) { this._readableState.flowing = state; } } }); // exposed for testing purposes only. Readable._fromList = fromList; Object.defineProperty(Readable.prototype, 'readableLength', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._readableState.length; } }); // Pluck off n bytes from an array of buffers. // Length is the combined lengths of all the buffers in the list. // This function is designed to be inlinable, so please take care when making // changes to the function body. function fromList(n, state) { // nothing buffered if (state.length === 0) return null; var ret; if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { // read it all, truncate the list if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length); state.buffer.clear(); } else { // read part of list ret = state.buffer.consume(n, state.decoder); } return ret; } function endReadable(stream) { var state = stream._readableState; debug('endReadable', state.endEmitted); if (!state.endEmitted) { state.ended = true; process.nextTick(endReadableNT, state, stream); } } function endReadableNT(state, stream) { debug('endReadableNT', state.endEmitted, state.length); // Check that we didn't get one last unshift. if (!state.endEmitted && state.length === 0) { state.endEmitted = true; stream.readable = false; stream.emit('end'); if (state.autoDestroy) { // In case of duplex streams we need a way to detect // if the writable side is ready for autoDestroy as well var wState = stream._writableState; if (!wState || wState.autoDestroy && wState.finished) { stream.destroy(); } } } } if (typeof Symbol === 'function') { Readable.from = function (iterable, opts) { if (from === undefined) { from = require('./internal/streams/from'); } return from(Readable, iterable, opts); }; } function indexOf(xs, x) { for (var i = 0, l = xs.length; i < l; i++) { if (xs[i] === x) return i; } return -1; }// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // a transform stream is a readable/writable stream where you do // something with the data. Sometimes it's called a "filter", // but that's not a great name for it, since that implies a thing where // some bits pass through, and others are simply ignored. (That would // be a valid example of a transform, of course.) // // While the output is causally related to the input, it's not a // necessarily symmetric or synchronous transformation. For example, // a zlib stream might take multiple plain-text writes(), and then // emit a single compressed chunk some time in the future. // // Here's how this works: // // The Transform stream has all the aspects of the readable and writable // stream classes. When you write(chunk), that calls _write(chunk,cb) // internally, and returns false if there's a lot of pending writes // buffered up. When you call read(), that calls _read(n) until // there's enough pending readable data buffered up. // // In a transform stream, the written data is placed in a buffer. When // _read(n) is called, it transforms the queued up data, calling the // buffered _write cb's as it consumes chunks. If consuming a single // written chunk would result in multiple output chunks, then the first // outputted bit calls the readcb, and subsequent chunks just go into // the read buffer, and will cause it to emit 'readable' if necessary. // // This way, back-pressure is actually determined by the reading side, // since _read has to be called to start processing a new chunk. However, // a pathological inflate type of transform can cause excessive buffering // here. For example, imagine a stream where every byte of input is // interpreted as an integer from 0-255, and then results in that many // bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in // 1kb of data being output. In this case, you could write a very small // amount of input, and end up with a very large amount of output. In // such a pathological inflating mechanism, there'd be no way to tell // the system to stop doing the transform. A single 4MB write could // cause the system to run out of memory. // // However, even in such a pathological case, only a single written chunk // would be consumed, and then the rest would wait (un-transformed) until // the results of the previous transformed chunk were consumed. 'use strict'; module.exports = Transform; var _require$codes = require('../errors').codes, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; var Duplex = require('./_stream_duplex'); require('inherits')(Transform, Duplex); function afterTransform(er, data) { var ts = this._transformState; ts.transforming = false; var cb = ts.writecb; if (cb === null) { return this.emit('error', new ERR_MULTIPLE_CALLBACK()); } ts.writechunk = null; ts.writecb = null; if (data != null) // single equals check for both `null` and `undefined` this.push(data); cb(er); var rs = this._readableState; rs.reading = false; if (rs.needReadable || rs.length < rs.highWaterMark) { this._read(rs.highWaterMark); } } function Transform(options) { if (!(this instanceof Transform)) return new Transform(options); Duplex.call(this, options); this._transformState = { afterTransform: afterTransform.bind(this), needTransform: false, transforming: false, writecb: null, writechunk: null, writeencoding: null }; // start out asking for a readable event once data is transformed. this._readableState.needReadable = true; // we have implemented the _read method, and done the other things // that Readable wants before the first _read call, so unset the // sync guard flag. this._readableState.sync = false; if (options) { if (typeof options.transform === 'function') this._transform = options.transform; if (typeof options.flush === 'function') this._flush = options.flush; } // When the writable side finishes, then flush out anything remaining. this.on('prefinish', prefinish); } function prefinish() { var _this = this; if (typeof this._flush === 'function' && !this._readableState.destroyed) { this._flush(function (er, data) { done(_this, er, data); }); } else { done(this, null, null); } } Transform.prototype.push = function (chunk, encoding) { this._transformState.needTransform = false; return Duplex.prototype.push.call(this, chunk, encoding); }; // This is the part where you do stuff! // override this function in implementation classes. // 'chunk' is an input chunk. // // Call `push(newChunk)` to pass along transformed output // to the readable side. You may call 'push' zero or more times. // // Call `cb(err)` when you are done with this chunk. If you pass // an error, then that'll put the hurt on the whole operation. If you // never call cb(), then you'll never get another chunk. Transform.prototype._transform = function (chunk, encoding, cb) { cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()')); }; Transform.prototype._write = function (chunk, encoding, cb) { var ts = this._transformState; ts.writecb = cb; ts.writechunk = chunk; ts.writeencoding = encoding; if (!ts.transforming) { var rs = this._readableState; if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); } }; // Doesn't matter what the args are here. // _transform does all the work. // That we got here means that the readable side wants more data. Transform.prototype._read = function (n) { var ts = this._transformState; if (ts.writechunk !== null && !ts.transforming) { ts.transforming = true; this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); } else { // mark that we need a transform, so that any data that comes in // will get processed, now that we've asked for it. ts.needTransform = true; } }; Transform.prototype._destroy = function (err, cb) { Duplex.prototype._destroy.call(this, err, function (err2) { cb(err2); }); }; function done(stream, er, data) { if (er) return stream.emit('error', er); if (data != null) // single equals check for both `null` and `undefined` stream.push(data); // TODO(BridgeAR): Write a test for these two error cases // if there's nothing in the write buffer, then that means // that nothing more will ever be provided if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0(); if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); return stream.push(null); }// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // A bit simpler than readable streams. // Implement an async ._write(chunk, encoding, cb), and it'll handle all // the drain event emission and buffering. 'use strict'; module.exports = Writable; /* */ function WriteReq(chunk, encoding, cb) { this.chunk = chunk; this.encoding = encoding; this.callback = cb; this.next = null; } // It seems a linked list but it is not // there will be only 2 of these for each stream function CorkedRequest(state) { var _this = this; this.next = null; this.entry = null; this.finish = function () { onCorkedFinish(_this, state); }; } /* */ /**/ var Duplex; /**/ Writable.WritableState = WritableState; /**/ var internalUtil = { deprecate: require('util-deprecate') }; /**/ /**/ var Stream = require('./internal/streams/stream'); /**/ var Buffer = require('buffer').Buffer; var OurUint8Array = global.Uint8Array || function () {}; function _uint8ArrayToBuffer(chunk) { return Buffer.from(chunk); } function _isUint8Array(obj) { return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; } var destroyImpl = require('./internal/streams/destroy'); var _require = require('./internal/streams/state'), getHighWaterMark = _require.getHighWaterMark; var _require$codes = require('../errors').codes, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; var errorOrDestroy = destroyImpl.errorOrDestroy; require('inherits')(Writable, Stream); function nop() {} function WritableState(options, stream, isDuplex) { Duplex = Duplex || require('./_stream_duplex'); options = options || {}; // Duplex streams are both readable and writable, but share // the same options object. // However, some cases require setting options to different // values for the readable and the writable sides of the duplex stream, // e.g. options.readableObjectMode vs. options.writableObjectMode, etc. if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex; // object stream flag to indicate whether or not this stream // contains buffers or objects. this.objectMode = !!options.objectMode; if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; // the point at which write() starts returning false // Note: 0 is a valid value, means that we always return false if // the entire buffer is not flushed immediately on write() this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex); // if _final has been called this.finalCalled = false; // drain event flag. this.needDrain = false; // at the start of calling end() this.ending = false; // when end() has been called, and returned this.ended = false; // when 'finish' is emitted this.finished = false; // has it been destroyed this.destroyed = false; // should we decode strings into buffers before passing to _write? // this is here so that some node-core streams can optimize string // handling at a lower level. var noDecode = options.decodeStrings === false; this.decodeStrings = !noDecode; // Crypto is kind of old and crusty. Historically, its default string // encoding is 'binary' so we have to make this configurable. // Everything else in the universe uses 'utf8', though. this.defaultEncoding = options.defaultEncoding || 'utf8'; // not an actual buffer we keep track of, but a measurement // of how much we're waiting to get pushed to some underlying // socket or file. this.length = 0; // a flag to see when we're in the middle of a write. this.writing = false; // when true all writes will be buffered until .uncork() call this.corked = 0; // a flag to be able to tell if the onwrite cb is called immediately, // or on a later tick. We set this to true at first, because any // actions that shouldn't happen until "later" should generally also // not happen before the first write call. this.sync = true; // a flag to know if we're processing previously buffered items, which // may call the _write() callback in the same tick, so that we don't // end up in an overlapped onwrite situation. this.bufferProcessing = false; // the callback that's passed to _write(chunk,cb) this.onwrite = function (er) { onwrite(stream, er); }; // the callback that the user supplies to write(chunk,encoding,cb) this.writecb = null; // the amount that is being written when _write is called. this.writelen = 0; this.bufferedRequest = null; this.lastBufferedRequest = null; // number of pending user-supplied write callbacks // this must be 0 before 'finish' can be emitted this.pendingcb = 0; // emit prefinish if the only thing we're waiting for is _write cbs // This is relevant for synchronous Transform streams this.prefinished = false; // True if the error was already emitted and should not be thrown again this.errorEmitted = false; // Should close be emitted on destroy. Defaults to true. this.emitClose = options.emitClose !== false; // Should .destroy() be called after 'finish' (and potentially 'end') this.autoDestroy = !!options.autoDestroy; // count buffered requests this.bufferedRequestCount = 0; // allocate the first CorkedRequest, there is always // one allocated and free to use, and we maintain at most two this.corkedRequestsFree = new CorkedRequest(this); } WritableState.prototype.getBuffer = function getBuffer() { var current = this.bufferedRequest; var out = []; while (current) { out.push(current); current = current.next; } return out; }; (function () { try { Object.defineProperty(WritableState.prototype, 'buffer', { get: internalUtil.deprecate(function writableStateBufferGetter() { return this.getBuffer(); }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') }); } catch (_) {} })(); // Test _writableState for inheritance to account for Duplex streams, // whose prototype chain only points to Readable. var realHasInstance; if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { realHasInstance = Function.prototype[Symbol.hasInstance]; Object.defineProperty(Writable, Symbol.hasInstance, { value: function value(object) { if (realHasInstance.call(this, object)) return true; if (this !== Writable) return false; return object && object._writableState instanceof WritableState; } }); } else { realHasInstance = function realHasInstance(object) { return object instanceof this; }; } function Writable(options) { Duplex = Duplex || require('./_stream_duplex'); // Writable ctor is applied to Duplexes, too. // `realHasInstance` is necessary because using plain `instanceof` // would return false, as no `_writableState` property is attached. // Trying to use the custom `instanceof` for Writable here will also break the // Node.js LazyTransform implementation, which has a non-trivial getter for // `_writableState` that would lead to infinite recursion. // Checking for a Stream.Duplex instance is faster here instead of inside // the WritableState constructor, at least with V8 6.5 var isDuplex = this instanceof Duplex; if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options); this._writableState = new WritableState(options, this, isDuplex); // legacy. this.writable = true; if (options) { if (typeof options.write === 'function') this._write = options.write; if (typeof options.writev === 'function') this._writev = options.writev; if (typeof options.destroy === 'function') this._destroy = options.destroy; if (typeof options.final === 'function') this._final = options.final; } Stream.call(this); } // Otherwise people can pipe Writable streams, which is just wrong. Writable.prototype.pipe = function () { errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); }; function writeAfterEnd(stream, cb) { var er = new ERR_STREAM_WRITE_AFTER_END(); // TODO: defer error events consistently everywhere, not just the cb errorOrDestroy(stream, er); process.nextTick(cb, er); } // Checks that a user-supplied chunk is valid, especially for the particular // mode the stream is in. Currently this means that `null` is never accepted // and undefined/non-string values are only allowed in object mode. function validChunk(stream, state, chunk, cb) { var er; if (chunk === null) { er = new ERR_STREAM_NULL_VALUES(); } else if (typeof chunk !== 'string' && !state.objectMode) { er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk); } if (er) { errorOrDestroy(stream, er); process.nextTick(cb, er); return false; } return true; } Writable.prototype.write = function (chunk, encoding, cb) { var state = this._writableState; var ret = false; var isBuf = !state.objectMode && _isUint8Array(chunk); if (isBuf && !Buffer.isBuffer(chunk)) { chunk = _uint8ArrayToBuffer(chunk); } if (typeof encoding === 'function') { cb = encoding; encoding = null; } if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; if (typeof cb !== 'function') cb = nop; if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { state.pendingcb++; ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); } return ret; }; Writable.prototype.cork = function () { this._writableState.corked++; }; Writable.prototype.uncork = function () { var state = this._writableState; if (state.corked) { state.corked--; if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); } }; Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { // node::ParseEncoding() requires lower case. if (typeof encoding === 'string') encoding = encoding.toLowerCase(); if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding); this._writableState.defaultEncoding = encoding; return this; }; Object.defineProperty(Writable.prototype, 'writableBuffer', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState && this._writableState.getBuffer(); } }); function decodeChunk(state, chunk, encoding) { if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { chunk = Buffer.from(chunk, encoding); } return chunk; } Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState.highWaterMark; } }); // if we're already writing something, then just put this // in the queue, and wait our turn. Otherwise, call _write // If we return false, then we need a drain event, so set that flag. function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { if (!isBuf) { var newChunk = decodeChunk(state, chunk, encoding); if (chunk !== newChunk) { isBuf = true; encoding = 'buffer'; chunk = newChunk; } } var len = state.objectMode ? 1 : chunk.length; state.length += len; var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false. if (!ret) state.needDrain = true; if (state.writing || state.corked) { var last = state.lastBufferedRequest; state.lastBufferedRequest = { chunk: chunk, encoding: encoding, isBuf: isBuf, callback: cb, next: null }; if (last) { last.next = state.lastBufferedRequest; } else { state.bufferedRequest = state.lastBufferedRequest; } state.bufferedRequestCount += 1; } else { doWrite(stream, state, false, len, chunk, encoding, cb); } return ret; } function doWrite(stream, state, writev, len, chunk, encoding, cb) { state.writelen = len; state.writecb = cb; state.writing = true; state.sync = true; if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); state.sync = false; } function onwriteError(stream, state, sync, er, cb) { --state.pendingcb; if (sync) { // defer the callback if we are being called synchronously // to avoid piling up things on the stack process.nextTick(cb, er); // this can emit finish, and it will always happen // after error process.nextTick(finishMaybe, stream, state); stream._writableState.errorEmitted = true; errorOrDestroy(stream, er); } else { // the caller expect this to happen before if // it is async cb(er); stream._writableState.errorEmitted = true; errorOrDestroy(stream, er); // this can emit finish, but finish must // always follow error finishMaybe(stream, state); } } function onwriteStateUpdate(state) { state.writing = false; state.writecb = null; state.length -= state.writelen; state.writelen = 0; } function onwrite(stream, er) { var state = stream._writableState; var sync = state.sync; var cb = state.writecb; if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK(); onwriteStateUpdate(state); if (er) onwriteError(stream, state, sync, er, cb);else { // Check if we're actually ready to finish, but don't emit yet var finished = needFinish(state) || stream.destroyed; if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { clearBuffer(stream, state); } if (sync) { process.nextTick(afterWrite, stream, state, finished, cb); } else { afterWrite(stream, state, finished, cb); } } } function afterWrite(stream, state, finished, cb) { if (!finished) onwriteDrain(stream, state); state.pendingcb--; cb(); finishMaybe(stream, state); } // Must force callback to be called on nextTick, so that we don't // emit 'drain' before the write() consumer gets the 'false' return // value, and has a chance to attach a 'drain' listener. function onwriteDrain(stream, state) { if (state.length === 0 && state.needDrain) { state.needDrain = false; stream.emit('drain'); } } // if there's something in the buffer waiting, then process it function clearBuffer(stream, state) { state.bufferProcessing = true; var entry = state.bufferedRequest; if (stream._writev && entry && entry.next) { // Fast case, write everything using _writev() var l = state.bufferedRequestCount; var buffer = new Array(l); var holder = state.corkedRequestsFree; holder.entry = entry; var count = 0; var allBuffers = true; while (entry) { buffer[count] = entry; if (!entry.isBuf) allBuffers = false; entry = entry.next; count += 1; } buffer.allBuffers = allBuffers; doWrite(stream, state, true, state.length, buffer, '', holder.finish); // doWrite is almost always async, defer these to save a bit of time // as the hot path ends with doWrite state.pendingcb++; state.lastBufferedRequest = null; if (holder.next) { state.corkedRequestsFree = holder.next; holder.next = null; } else { state.corkedRequestsFree = new CorkedRequest(state); } state.bufferedRequestCount = 0; } else { // Slow case, write chunks one-by-one while (entry) { var chunk = entry.chunk; var encoding = entry.encoding; var cb = entry.callback; var len = state.objectMode ? 1 : chunk.length; doWrite(stream, state, false, len, chunk, encoding, cb); entry = entry.next; state.bufferedRequestCount--; // if we didn't call the onwrite immediately, then // it means that we need to wait until it does. // also, that means that the chunk and cb are currently // being processed, so move the buffer counter past them. if (state.writing) { break; } } if (entry === null) state.lastBufferedRequest = null; } state.bufferedRequest = entry; state.bufferProcessing = false; } Writable.prototype._write = function (chunk, encoding, cb) { cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()')); }; Writable.prototype._writev = null; Writable.prototype.end = function (chunk, encoding, cb) { var state = this._writableState; if (typeof chunk === 'function') { cb = chunk; chunk = null; encoding = null; } else if (typeof encoding === 'function') { cb = encoding; encoding = null; } if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); // .end() fully uncorks if (state.corked) { state.corked = 1; this.uncork(); } // ignore unnecessary end() calls. if (!state.ending) endWritable(this, state, cb); return this; }; Object.defineProperty(Writable.prototype, 'writableLength', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { return this._writableState.length; } }); function needFinish(state) { return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; } function callFinal(stream, state) { stream._final(function (err) { state.pendingcb--; if (err) { errorOrDestroy(stream, err); } state.prefinished = true; stream.emit('prefinish'); finishMaybe(stream, state); }); } function prefinish(stream, state) { if (!state.prefinished && !state.finalCalled) { if (typeof stream._final === 'function' && !state.destroyed) { state.pendingcb++; state.finalCalled = true; process.nextTick(callFinal, stream, state); } else { state.prefinished = true; stream.emit('prefinish'); } } } function finishMaybe(stream, state) { var need = needFinish(state); if (need) { prefinish(stream, state); if (state.pendingcb === 0) { state.finished = true; stream.emit('finish'); if (state.autoDestroy) { // In case of duplex streams we need a way to detect // if the readable side is ready for autoDestroy as well var rState = stream._readableState; if (!rState || rState.autoDestroy && rState.endEmitted) { stream.destroy(); } } } } return need; } function endWritable(stream, state, cb) { state.ending = true; finishMaybe(stream, state); if (cb) { if (state.finished) process.nextTick(cb);else stream.once('finish', cb); } state.ended = true; stream.writable = false; } function onCorkedFinish(corkReq, state, err) { var entry = corkReq.entry; corkReq.entry = null; while (entry) { var cb = entry.callback; state.pendingcb--; cb(err); entry = entry.next; } // reuse the free corkReq. state.corkedRequestsFree.next = corkReq; } Object.defineProperty(Writable.prototype, 'destroyed', { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: false, get: function get() { if (this._writableState === undefined) { return false; } return this._writableState.destroyed; }, set: function set(value) { // we ignore the value if the stream // has not been initialized yet if (!this._writableState) { return; } // backward compatibility, the user is explicitly // managing destroyed this._writableState.destroyed = value; } }); Writable.prototype.destroy = destroyImpl.destroy; Writable.prototype._undestroy = destroyImpl.undestroy; Writable.prototype._destroy = function (err, cb) { cb(err); };'use strict'; var _Object$setPrototypeO; function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var finished = require('./end-of-stream'); var kLastResolve = Symbol('lastResolve'); var kLastReject = Symbol('lastReject'); var kError = Symbol('error'); var kEnded = Symbol('ended'); var kLastPromise = Symbol('lastPromise'); var kHandlePromise = Symbol('handlePromise'); var kStream = Symbol('stream'); function createIterResult(value, done) { return { value: value, done: done }; } function readAndResolve(iter) { var resolve = iter[kLastResolve]; if (resolve !== null) { var data = iter[kStream].read(); // we defer if data is null // we can be expecting either 'end' or // 'error' if (data !== null) { iter[kLastPromise] = null; iter[kLastResolve] = null; iter[kLastReject] = null; resolve(createIterResult(data, false)); } } } function onReadable(iter) { // we wait for the next tick, because it might // emit an error with process.nextTick process.nextTick(readAndResolve, iter); } function wrapForNext(lastPromise, iter) { return function (resolve, reject) { lastPromise.then(function () { if (iter[kEnded]) { resolve(createIterResult(undefined, true)); return; } iter[kHandlePromise](resolve, reject); }, reject); }; } var AsyncIteratorPrototype = Object.getPrototypeOf(function () {}); var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { get stream() { return this[kStream]; }, next: function next() { var _this = this; // if we have detected an error in the meanwhile // reject straight away var error = this[kError]; if (error !== null) { return Promise.reject(error); } if (this[kEnded]) { return Promise.resolve(createIterResult(undefined, true)); } if (this[kStream].destroyed) { // We need to defer via nextTick because if .destroy(err) is // called, the error will be emitted via nextTick, and // we cannot guarantee that there is no error lingering around // waiting to be emitted. return new Promise(function (resolve, reject) { process.nextTick(function () { if (_this[kError]) { reject(_this[kError]); } else { resolve(createIterResult(undefined, true)); } }); }); } // if we have multiple next() calls // we will wait for the previous Promise to finish // this logic is optimized to support for await loops, // where next() is only called once at a time var lastPromise = this[kLastPromise]; var promise; if (lastPromise) { promise = new Promise(wrapForNext(lastPromise, this)); } else { // fast path needed to support multiple this.push() // without triggering the next() queue var data = this[kStream].read(); if (data !== null) { return Promise.resolve(createIterResult(data, false)); } promise = new Promise(this[kHandlePromise]); } this[kLastPromise] = promise; return promise; } }, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () { return this; }), _defineProperty(_Object$setPrototypeO, "return", function _return() { var _this2 = this; // destroy(err, cb) is a private API // we can guarantee we have that here, because we control the // Readable class this is attached to return new Promise(function (resolve, reject) { _this2[kStream].destroy(null, function (err) { if (err) { reject(err); return; } resolve(createIterResult(undefined, true)); }); }); }), _Object$setPrototypeO), AsyncIteratorPrototype); var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) { var _Object$create; var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { value: stream, writable: true }), _defineProperty(_Object$create, kLastResolve, { value: null, writable: true }), _defineProperty(_Object$create, kLastReject, { value: null, writable: true }), _defineProperty(_Object$create, kError, { value: null, writable: true }), _defineProperty(_Object$create, kEnded, { value: stream._readableState.endEmitted, writable: true }), _defineProperty(_Object$create, kHandlePromise, { value: function value(resolve, reject) { var data = iterator[kStream].read(); if (data) { iterator[kLastPromise] = null; iterator[kLastResolve] = null; iterator[kLastReject] = null; resolve(createIterResult(data, false)); } else { iterator[kLastResolve] = resolve; iterator[kLastReject] = reject; } }, writable: true }), _Object$create)); iterator[kLastPromise] = null; finished(stream, function (err) { if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') { var reject = iterator[kLastReject]; // reject if we are waiting for data in the Promise // returned by next() and store the error if (reject !== null) { iterator[kLastPromise] = null; iterator[kLastResolve] = null; iterator[kLastReject] = null; reject(err); } iterator[kError] = err; return; } var resolve = iterator[kLastResolve]; if (resolve !== null) { iterator[kLastPromise] = null; iterator[kLastResolve] = null; iterator[kLastReject] = null; resolve(createIterResult(undefined, true)); } iterator[kEnded] = true; }); stream.on('readable', onReadable.bind(null, iterator)); return iterator; }; module.exports = createReadableStreamAsyncIterator;'use strict'; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } var _require = require('buffer'), Buffer = _require.Buffer; var _require2 = require('util'), inspect = _require2.inspect; var custom = inspect && inspect.custom || 'inspect'; function copyBuffer(src, target, offset) { Buffer.prototype.copy.call(src, target, offset); } module.exports = /*#__PURE__*/ function () { function BufferList() { _classCallCheck(this, BufferList); this.head = null; this.tail = null; this.length = 0; } _createClass(BufferList, [{ key: "push", value: function push(v) { var entry = { data: v, next: null }; if (this.length > 0) this.tail.next = entry;else this.head = entry; this.tail = entry; ++this.length; } }, { key: "unshift", value: function unshift(v) { var entry = { data: v, next: this.head }; if (this.length === 0) this.tail = entry; this.head = entry; ++this.length; } }, { key: "shift", value: function shift() { if (this.length === 0) return; var ret = this.head.data; if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; --this.length; return ret; } }, { key: "clear", value: function clear() { this.head = this.tail = null; this.length = 0; } }, { key: "join", value: function join(s) { if (this.length === 0) return ''; var p = this.head; var ret = '' + p.data; while (p = p.next) { ret += s + p.data; } return ret; } }, { key: "concat", value: function concat(n) { if (this.length === 0) return Buffer.alloc(0); var ret = Buffer.allocUnsafe(n >>> 0); var p = this.head; var i = 0; while (p) { copyBuffer(p.data, ret, i); i += p.data.length; p = p.next; } return ret; } // Consumes a specified amount of bytes or characters from the buffered data. }, { key: "consume", value: function consume(n, hasStrings) { var ret; if (n < this.head.data.length) { // `slice` is the same for buffers and strings. ret = this.head.data.slice(0, n); this.head.data = this.head.data.slice(n); } else if (n === this.head.data.length) { // First chunk is a perfect match. ret = this.shift(); } else { // Result spans more than one buffer. ret = hasStrings ? this._getString(n) : this._getBuffer(n); } return ret; } }, { key: "first", value: function first() { return this.head.data; } // Consumes a specified amount of characters from the buffered data. }, { key: "_getString", value: function _getString(n) { var p = this.head; var c = 1; var ret = p.data; n -= ret.length; while (p = p.next) { var str = p.data; var nb = n > str.length ? str.length : n; if (nb === str.length) ret += str;else ret += str.slice(0, n); n -= nb; if (n === 0) { if (nb === str.length) { ++c; if (p.next) this.head = p.next;else this.head = this.tail = null; } else { this.head = p; p.data = str.slice(nb); } break; } ++c; } this.length -= c; return ret; } // Consumes a specified amount of bytes from the buffered data. }, { key: "_getBuffer", value: function _getBuffer(n) { var ret = Buffer.allocUnsafe(n); var p = this.head; var c = 1; p.data.copy(ret); n -= p.data.length; while (p = p.next) { var buf = p.data; var nb = n > buf.length ? buf.length : n; buf.copy(ret, ret.length - n, 0, nb); n -= nb; if (n === 0) { if (nb === buf.length) { ++c; if (p.next) this.head = p.next;else this.head = this.tail = null; } else { this.head = p; p.data = buf.slice(nb); } break; } ++c; } this.length -= c; return ret; } // Make sure the linked list only shows the minimal necessary information. }, { key: custom, value: function value(_, options) { return inspect(this, _objectSpread({}, options, { // Only inspect one level. depth: 0, // It should not recurse. customInspect: false })); } }]); return BufferList; }();'use strict'; // undocumented cb() API, needed for core, not for public API function destroy(err, cb) { var _this = this; var readableDestroyed = this._readableState && this._readableState.destroyed; var writableDestroyed = this._writableState && this._writableState.destroyed; if (readableDestroyed || writableDestroyed) { if (cb) { cb(err); } else if (err) { if (!this._writableState) { process.nextTick(emitErrorNT, this, err); } else if (!this._writableState.errorEmitted) { this._writableState.errorEmitted = true; process.nextTick(emitErrorNT, this, err); } } return this; } // we set destroyed to true before firing error callbacks in order // to make it re-entrance safe in case destroy() is called within callbacks if (this._readableState) { this._readableState.destroyed = true; } // if this is a duplex stream mark the writable part as destroyed as well if (this._writableState) { this._writableState.destroyed = true; } this._destroy(err || null, function (err) { if (!cb && err) { if (!_this._writableState) { process.nextTick(emitErrorAndCloseNT, _this, err); } else if (!_this._writableState.errorEmitted) { _this._writableState.errorEmitted = true; process.nextTick(emitErrorAndCloseNT, _this, err); } else { process.nextTick(emitCloseNT, _this); } } else if (cb) { process.nextTick(emitCloseNT, _this); cb(err); } else { process.nextTick(emitCloseNT, _this); } }); return this; } function emitErrorAndCloseNT(self, err) { emitErrorNT(self, err); emitCloseNT(self); } function emitCloseNT(self) { if (self._writableState && !self._writableState.emitClose) return; if (self._readableState && !self._readableState.emitClose) return; self.emit('close'); } function undestroy() { if (this._readableState) { this._readableState.destroyed = false; this._readableState.reading = false; this._readableState.ended = false; this._readableState.endEmitted = false; } if (this._writableState) { this._writableState.destroyed = false; this._writableState.ended = false; this._writableState.ending = false; this._writableState.finalCalled = false; this._writableState.prefinished = false; this._writableState.finished = false; this._writableState.errorEmitted = false; } } function emitErrorNT(self, err) { self.emit('error', err); } function errorOrDestroy(stream, err) { // We have tests that rely on errors being emitted // in the same tick, so changing this is semver major. // For now when you opt-in to autoDestroy we allow // the error to be emitted nextTick. In a future // semver major update we should change the default to this. var rState = stream._readableState; var wState = stream._writableState; if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err); } module.exports = { destroy: destroy, undestroy: undestroy, errorOrDestroy: errorOrDestroy };// Ported from https://github.com/mafintosh/end-of-stream with // permission from the author, Mathias Buus (@mafintosh). 'use strict'; var ERR_STREAM_PREMATURE_CLOSE = require('../../../errors').codes.ERR_STREAM_PREMATURE_CLOSE; function once(callback) { var called = false; return function () { if (called) return; called = true; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } callback.apply(this, args); }; } function noop() {} function isRequest(stream) { return stream.setHeader && typeof stream.abort === 'function'; } function eos(stream, opts, callback) { if (typeof opts === 'function') return eos(stream, null, opts); if (!opts) opts = {}; callback = once(callback || noop); var readable = opts.readable || opts.readable !== false && stream.readable; var writable = opts.writable || opts.writable !== false && stream.writable; var onlegacyfinish = function onlegacyfinish() { if (!stream.writable) onfinish(); }; var writableEnded = stream._writableState && stream._writableState.finished; var onfinish = function onfinish() { writable = false; writableEnded = true; if (!readable) callback.call(stream); }; var readableEnded = stream._readableState && stream._readableState.endEmitted; var onend = function onend() { readable = false; readableEnded = true; if (!writable) callback.call(stream); }; var onerror = function onerror(err) { callback.call(stream, err); }; var onclose = function onclose() { var err; if (readable && !readableEnded) { if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); return callback.call(stream, err); } if (writable && !writableEnded) { if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); return callback.call(stream, err); } }; var onrequest = function onrequest() { stream.req.on('finish', onfinish); }; if (isRequest(stream)) { stream.on('complete', onfinish); stream.on('abort', onclose); if (stream.req) onrequest();else stream.on('request', onrequest); } else if (writable && !stream._writableState) { // legacy streams stream.on('end', onlegacyfinish); stream.on('close', onlegacyfinish); } stream.on('end', onend); stream.on('finish', onfinish); if (opts.error !== false) stream.on('error', onerror); stream.on('close', onclose); return function () { stream.removeListener('complete', onfinish); stream.removeListener('abort', onclose); stream.removeListener('request', onrequest); if (stream.req) stream.req.removeListener('finish', onfinish); stream.removeListener('end', onlegacyfinish); stream.removeListener('close', onlegacyfinish); stream.removeListener('finish', onfinish); stream.removeListener('end', onend); stream.removeListener('error', onerror); stream.removeListener('close', onclose); }; } module.exports = eos;module.exports = function () { throw new Error('Readable.from is not available in the browser') }; 'use strict'; function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var ERR_INVALID_ARG_TYPE = require('../../../errors').codes.ERR_INVALID_ARG_TYPE; function from(Readable, iterable, opts) { var iterator; if (iterable && typeof iterable.next === 'function') { iterator = iterable; } else if (iterable && iterable[Symbol.asyncIterator]) iterator = iterable[Symbol.asyncIterator]();else if (iterable && iterable[Symbol.iterator]) iterator = iterable[Symbol.iterator]();else throw new ERR_INVALID_ARG_TYPE('iterable', ['Iterable'], iterable); var readable = new Readable(_objectSpread({ objectMode: true }, opts)); // Reading boolean to protect against _read // being called before last iteration completion. var reading = false; readable._read = function () { if (!reading) { reading = true; next(); } }; function next() { return _next2.apply(this, arguments); } function _next2() { _next2 = _asyncToGenerator(function* () { try { var _ref = yield iterator.next(), value = _ref.value, done = _ref.done; if (done) { readable.push(null); } else if (readable.push((yield value))) { next(); } else { reading = false; } } catch (err) { readable.destroy(err); } }); return _next2.apply(this, arguments); } return readable; } module.exports = from;// Ported from https://github.com/mafintosh/pump with // permission from the author, Mathias Buus (@mafintosh). 'use strict'; var eos; function once(callback) { var called = false; return function () { if (called) return; called = true; callback.apply(void 0, arguments); }; } var _require$codes = require('../../../errors').codes, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; function noop(err) { // Rethrow the error if it exists to avoid swallowing it if (err) throw err; } function isRequest(stream) { return stream.setHeader && typeof stream.abort === 'function'; } function destroyer(stream, reading, writing, callback) { callback = once(callback); var closed = false; stream.on('close', function () { closed = true; }); if (eos === undefined) eos = require('./end-of-stream'); eos(stream, { readable: reading, writable: writing }, function (err) { if (err) return callback(err); closed = true; callback(); }); var destroyed = false; return function (err) { if (closed) return; if (destroyed) return; destroyed = true; // request.destroy just do .end - .abort is what we want if (isRequest(stream)) return stream.abort(); if (typeof stream.destroy === 'function') return stream.destroy(); callback(err || new ERR_STREAM_DESTROYED('pipe')); }; } function call(fn) { fn(); } function pipe(from, to) { return from.pipe(to); } function popCallback(streams) { if (!streams.length) return noop; if (typeof streams[streams.length - 1] !== 'function') return noop; return streams.pop(); } function pipeline() { for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { streams[_key] = arguments[_key]; } var callback = popCallback(streams); if (Array.isArray(streams[0])) streams = streams[0]; if (streams.length < 2) { throw new ERR_MISSING_ARGS('streams'); } var error; var destroys = streams.map(function (stream, i) { var reading = i < streams.length - 1; var writing = i > 0; return destroyer(stream, reading, writing, function (err) { if (!error) error = err; if (err) destroys.forEach(call); if (reading) return; destroys.forEach(call); callback(error); }); }); return streams.reduce(pipe); } module.exports = pipeline;'use strict'; var ERR_INVALID_OPT_VALUE = require('../../../errors').codes.ERR_INVALID_OPT_VALUE; function highWaterMarkFrom(options, isDuplex, duplexKey) { return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; } function getHighWaterMark(state, options, duplexKey, isDuplex) { var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); if (hwm != null) { if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { var name = isDuplex ? duplexKey : 'highWaterMark'; throw new ERR_INVALID_OPT_VALUE(name, hwm); } return Math.floor(hwm); } // Default value return state.objectMode ? 16 : 16 * 1024; } module.exports = { getHighWaterMark: getHighWaterMark };module.exports = require('events').EventEmitter; module.exports = require('stream'); var concatMap = require('concat-map'); var balanced = require('balanced-match'); module.exports = expandTop; var escSlash = '\0SLASH'+Math.random()+'\0'; var escOpen = '\0OPEN'+Math.random()+'\0'; var escClose = '\0CLOSE'+Math.random()+'\0'; var escComma = '\0COMMA'+Math.random()+'\0'; var escPeriod = '\0PERIOD'+Math.random()+'\0'; function numeric(str) { return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0); } function escapeBraces(str) { return str.split('\\\\').join(escSlash) .split('\\{').join(escOpen) .split('\\}').join(escClose) .split('\\,').join(escComma) .split('\\.').join(escPeriod); } function unescapeBraces(str) { return str.split(escSlash).join('\\') .split(escOpen).join('{') .split(escClose).join('}') .split(escComma).join(',') .split(escPeriod).join('.'); } // Basically just str.split(","), but handling cases // where we have nested braced sections, which should be // treated as individual members, like {a,{b,c},d} function parseCommaParts(str) { if (!str) return ['']; var parts = []; var m = balanced('{', '}', str); if (!m) return str.split(','); var pre = m.pre; var body = m.body; var post = m.post; var p = pre.split(','); p[p.length-1] += '{' + body + '}'; var postParts = parseCommaParts(post); if (post.length) { p[p.length-1] += postParts.shift(); p.push.apply(p, postParts); } parts.push.apply(parts, p); return parts; } function expandTop(str) { if (!str) return []; // I don't know why Bash 4.3 does this, but it does. // Anything starting with {} will have the first two bytes preserved // but *only* at the top level, so {},a}b will not expand to anything, // but a{},b}c will be expanded to [a}c,abc]. // One could argue that this is a bug in Bash, but since the goal of // this module is to match Bash's rules, we escape a leading {} if (str.substr(0, 2) === '{}') { str = '\\{\\}' + str.substr(2); } return expand(escapeBraces(str), true).map(unescapeBraces); } function identity(e) { return e; } function embrace(str) { return '{' + str + '}'; } function isPadded(el) { return /^-?0\d/.test(el); } function lte(i, y) { return i <= y; } function gte(i, y) { return i >= y; } function expand(str, isTop) { var expansions = []; var m = balanced('{', '}', str); if (!m || /\$$/.test(m.pre)) return [str]; var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); var isSequence = isNumericSequence || isAlphaSequence; var isOptions = m.body.indexOf(',') >= 0; if (!isSequence && !isOptions) { // {a},b} if (m.post.match(/,.*\}/)) { str = m.pre + '{' + m.body + escClose + m.post; return expand(str); } return [str]; } var n; if (isSequence) { n = m.body.split(/\.\./); } else { n = parseCommaParts(m.body); if (n.length === 1) { // x{{a,b}}y ==> x{a}y x{b}y n = expand(n[0], false).map(embrace); if (n.length === 1) { var post = m.post.length ? expand(m.post, false) : ['']; return post.map(function(p) { return m.pre + n[0] + p; }); } } } // at this point, n is the parts, and we know it's not a comma set // with a single entry. // no need to expand pre, since it is guaranteed to be free of brace-sets var pre = m.pre; var post = m.post.length ? expand(m.post, false) : ['']; var N; if (isSequence) { var x = numeric(n[0]); var y = numeric(n[1]); var width = Math.max(n[0].length, n[1].length) var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; var test = lte; var reverse = y < x; if (reverse) { incr *= -1; test = gte; } var pad = n.some(isPadded); N = []; for (var i = x; test(i, y); i += incr) { var c; if (isAlphaSequence) { c = String.fromCharCode(i); if (c === '\\') c = ''; } else { c = String(i); if (pad) { var need = width - c.length; if (need > 0) { var z = new Array(need + 1).join('0'); if (i < 0) c = '-' + z + c.slice(1); else c = z + c; } } } N.push(c); } } else { N = concatMap(n, function(el) { return expand(el, false) }); } for (var j = 0; j < N.length; j++) { for (var k = 0; k < post.length; k++) { var expansion = pre + N[j] + post[k]; if (!isTop || isSequence || expansion) expansions.push(expansion); } } return expansions; } MIT License Copyright (c) 2013 Julian Gruber Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "brace-expansion", "description": "Brace expansion as known from sh/bash", "version": "1.1.11", "repository": { "type": "git", "url": "git://github.com/juliangruber/brace-expansion.git" }, "homepage": "https://github.com/juliangruber/brace-expansion", "main": "index.js", "scripts": { "test": "tape test/*.js", "gentest": "bash test/generate.sh", "bench": "matcha test/perf/bench.js" }, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" }, "devDependencies": { "matcha": "^0.7.0", "tape": "^4.6.0" }, "keywords": [], "author": { "name": "Julian Gruber", "email": "mail@juliangruber.com", "url": "http://juliangruber.com" }, "license": "MIT", "testling": { "files": "test/*.js", "browsers": [ "ie/8..latest", "firefox/20..latest", "firefox/nightly", "chrome/25..latest", "chrome/canary", "opera/12..latest", "opera/next", "safari/5.1..latest", "ipad/6.0..latest", "iphone/6.0..latest", "android-browser/4.2..latest" ] } } #!/usr/bin/env node var colorSupport = require('./')({alwaysReturn: true }) console.log(JSON.stringify(colorSupport, null, 2)) module.exports = colorSupport({ alwaysReturn: true }, colorSupport) function colorSupport(options, obj) { obj = obj || {} options = options || {} obj.level = 0 obj.hasBasic = false obj.has256 = false obj.has16m = false if (!options.alwaysReturn) { return false } return obj } // call it on itself so we can test the export val for basic stuff module.exports = colorSupport({ alwaysReturn: true }, colorSupport) function hasNone (obj, options) { obj.level = 0 obj.hasBasic = false obj.has256 = false obj.has16m = false if (!options.alwaysReturn) { return false } return obj } function hasBasic (obj) { obj.hasBasic = true obj.has256 = false obj.has16m = false obj.level = 1 return obj } function has256 (obj) { obj.hasBasic = true obj.has256 = true obj.has16m = false obj.level = 2 return obj } function has16m (obj) { obj.hasBasic = true obj.has256 = true obj.has16m = true obj.level = 3 return obj } function colorSupport (options, obj) { options = options || {} obj = obj || {} // if just requesting a specific level, then return that. if (typeof options.level === 'number') { switch (options.level) { case 0: return hasNone(obj, options) case 1: return hasBasic(obj) case 2: return has256(obj) case 3: return has16m(obj) } } obj.level = 0 obj.hasBasic = false obj.has256 = false obj.has16m = false if (typeof process === 'undefined' || !process || !process.stdout || !process.env || !process.platform) { return hasNone(obj, options) } var env = options.env || process.env var stream = options.stream || process.stdout var term = options.term || env.TERM || '' var platform = options.platform || process.platform if (!options.ignoreTTY && !stream.isTTY) { return hasNone(obj, options) } if (!options.ignoreDumb && term === 'dumb' && !env.COLORTERM) { return hasNone(obj, options) } if (platform === 'win32') { return hasBasic(obj) } if (env.TMUX) { return has256(obj) } if (!options.ignoreCI && (env.CI || env.TEAMCITY_VERSION)) { if (env.TRAVIS) { return has256(obj) } else { return hasNone(obj, options) } } // TODO: add more term programs switch (env.TERM_PROGRAM) { case 'iTerm.app': var ver = env.TERM_PROGRAM_VERSION || '0.' if (/^[0-2]\./.test(ver)) { return has256(obj) } else { return has16m(obj) } case 'HyperTerm': case 'Hyper': return has16m(obj) case 'MacTerm': return has16m(obj) case 'Apple_Terminal': return has256(obj) } if (/^xterm-256/.test(term)) { return has256(obj) } if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(term)) { return hasBasic(obj) } if (env.COLORTERM) { return hasBasic(obj) } return hasNone(obj, options) } The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "color-support", "version": "1.1.3", "description": "A module which will endeavor to guess your terminal's level of color support.", "main": "index.js", "browser": "browser.js", "bin": "bin.js", "devDependencies": { "tap": "^10.3.3" }, "scripts": { "test": "tap test/*.js --100 -J", "preversion": "npm test", "postversion": "npm publish", "postpublish": "git push origin --all; git push origin --tags" }, "repository": { "type": "git", "url": "git+https://github.com/isaacs/color-support.git" }, "keywords": [ "terminal", "color", "support", "xterm", "truecolor", "256" ], "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "license": "ISC", "files": [ "browser.js", "index.js", "bin.js" ] } /** * Expose `Delegator`. */ module.exports = Delegator; /** * Initialize a delegator. * * @param {Object} proto * @param {String} target * @api public */ function Delegator(proto, target) { if (!(this instanceof Delegator)) return new Delegator(proto, target); this.proto = proto; this.target = target; this.methods = []; this.getters = []; this.setters = []; this.fluents = []; } /** * Delegate method `name`. * * @param {String} name * @return {Delegator} self * @api public */ Delegator.prototype.method = function(name){ var proto = this.proto; var target = this.target; this.methods.push(name); proto[name] = function(){ return this[target][name].apply(this[target], arguments); }; return this; }; /** * Delegator accessor `name`. * * @param {String} name * @return {Delegator} self * @api public */ Delegator.prototype.access = function(name){ return this.getter(name).setter(name); }; /** * Delegator getter `name`. * * @param {String} name * @return {Delegator} self * @api public */ Delegator.prototype.getter = function(name){ var proto = this.proto; var target = this.target; this.getters.push(name); proto.__defineGetter__(name, function(){ return this[target][name]; }); return this; }; /** * Delegator setter `name`. * * @param {String} name * @return {Delegator} self * @api public */ Delegator.prototype.setter = function(name){ var proto = this.proto; var target = this.target; this.setters.push(name); proto.__defineSetter__(name, function(val){ return this[target][name] = val; }); return this; }; /** * Delegator fluent accessor * * @param {String} name * @return {Delegator} self * @api public */ Delegator.prototype.fluent = function (name) { var proto = this.proto; var target = this.target; this.fluents.push(name); proto[name] = function(val){ if ('undefined' != typeof val) { this[target][name] = val; return this; } else { return this[target][name]; } }; return this; }; Copyright (c) 2015 TJ Holowaychuk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. test: @./node_modules/.bin/mocha \ --require should \ --reporter spec \ --bail .PHONY: test{ "name": "delegates", "version": "1.0.0", "repository": "visionmedia/node-delegates", "description": "delegate methods and accessors to another property", "keywords": ["delegate", "delegation"], "dependencies": {}, "devDependencies": { "mocha": "*", "should": "*" }, "license": "MIT" } # delegates Node method and accessor delegation utilty. ## Installation ``` $ npm install delegates ``` ## Example ```js var delegate = require('delegates'); ... delegate(proto, 'request') .method('acceptsLanguages') .method('acceptsEncodings') .method('acceptsCharsets') .method('accepts') .method('is') .access('querystring') .access('idempotent') .access('socket') .access('length') .access('query') .access('search') .access('status') .access('method') .access('path') .access('body') .access('host') .access('url') .getter('subdomains') .getter('protocol') .getter('header') .getter('stale') .getter('fresh') .getter('secure') .getter('ips') .getter('ip') ``` # API ## Delegate(proto, prop) Creates a delegator instance used to configure using the `prop` on the given `proto` object. (which is usually a prototype) ## Delegate#method(name) Allows the given method `name` to be accessed on the host. ## Delegate#getter(name) Creates a "getter" for the property with the given `name` on the delegated object. ## Delegate#setter(name) Creates a "setter" for the property with the given `name` on the delegated object. ## Delegate#access(name) Creates an "accessor" (ie: both getter *and* setter) for the property with the given `name` on the delegated object. ## Delegate#fluent(name) A unique type of "accessor" that works for a "fluent" API. When called as a getter, the method returns the expected value. However, if the method is called with a value, it will return itself so it can be chained. For example: ```js delegate(proto, 'request') .fluent('query') // getter var q = request.query(); // setter (chainable) request .query({ a: 1 }) .query({ b: 2 }); ``` # License MIT /*! * depd * Copyright(c) 2014-2018 Douglas Christopher Wilson * MIT Licensed */ /** * Module dependencies. */ var relative = require('path').relative /** * Module exports. */ module.exports = depd /** * Get the path to base files on. */ var basePath = process.cwd() /** * Determine if namespace is contained in the string. */ function containsNamespace (str, namespace) { var vals = str.split(/[ ,]+/) var ns = String(namespace).toLowerCase() for (var i = 0; i < vals.length; i++) { var val = vals[i] // namespace contained if (val && (val === '*' || val.toLowerCase() === ns)) { return true } } return false } /** * Convert a data descriptor to accessor descriptor. */ function convertDataDescriptorToAccessor (obj, prop, message) { var descriptor = Object.getOwnPropertyDescriptor(obj, prop) var value = descriptor.value descriptor.get = function getter () { return value } if (descriptor.writable) { descriptor.set = function setter (val) { return (value = val) } } delete descriptor.value delete descriptor.writable Object.defineProperty(obj, prop, descriptor) return descriptor } /** * Create arguments string to keep arity. */ function createArgumentsString (arity) { var str = '' for (var i = 0; i < arity; i++) { str += ', arg' + i } return str.substr(2) } /** * Create stack string from stack. */ function createStackString (stack) { var str = this.name + ': ' + this.namespace if (this.message) { str += ' deprecated ' + this.message } for (var i = 0; i < stack.length; i++) { str += '\n at ' + stack[i].toString() } return str } /** * Create deprecate for namespace in caller. */ function depd (namespace) { if (!namespace) { throw new TypeError('argument namespace is required') } var stack = getStack() var site = callSiteLocation(stack[1]) var file = site[0] function deprecate (message) { // call to self as log log.call(deprecate, message) } deprecate._file = file deprecate._ignored = isignored(namespace) deprecate._namespace = namespace deprecate._traced = istraced(namespace) deprecate._warned = Object.create(null) deprecate.function = wrapfunction deprecate.property = wrapproperty return deprecate } /** * Determine if event emitter has listeners of a given type. * * The way to do this check is done three different ways in Node.js >= 0.8 * so this consolidates them into a minimal set using instance methods. * * @param {EventEmitter} emitter * @param {string} type * @returns {boolean} * @private */ function eehaslisteners (emitter, type) { var count = typeof emitter.listenerCount !== 'function' ? emitter.listeners(type).length : emitter.listenerCount(type) return count > 0 } /** * Determine if namespace is ignored. */ function isignored (namespace) { if (process.noDeprecation) { // --no-deprecation support return true } var str = process.env.NO_DEPRECATION || '' // namespace ignored return containsNamespace(str, namespace) } /** * Determine if namespace is traced. */ function istraced (namespace) { if (process.traceDeprecation) { // --trace-deprecation support return true } var str = process.env.TRACE_DEPRECATION || '' // namespace traced return containsNamespace(str, namespace) } /** * Display deprecation message. */ function log (message, site) { var haslisteners = eehaslisteners(process, 'deprecation') // abort early if no destination if (!haslisteners && this._ignored) { return } var caller var callFile var callSite var depSite var i = 0 var seen = false var stack = getStack() var file = this._file if (site) { // provided site depSite = site callSite = callSiteLocation(stack[1]) callSite.name = depSite.name file = callSite[0] } else { // get call site i = 2 depSite = callSiteLocation(stack[i]) callSite = depSite } // get caller of deprecated thing in relation to file for (; i < stack.length; i++) { caller = callSiteLocation(stack[i]) callFile = caller[0] if (callFile === file) { seen = true } else if (callFile === this._file) { file = this._file } else if (seen) { break } } var key = caller ? depSite.join(':') + '__' + caller.join(':') : undefined if (key !== undefined && key in this._warned) { // already warned return } this._warned[key] = true // generate automatic message from call site var msg = message if (!msg) { msg = callSite === depSite || !callSite.name ? defaultMessage(depSite) : defaultMessage(callSite) } // emit deprecation if listeners exist if (haslisteners) { var err = DeprecationError(this._namespace, msg, stack.slice(i)) process.emit('deprecation', err) return } // format and write message var format = process.stderr.isTTY ? formatColor : formatPlain var output = format.call(this, msg, caller, stack.slice(i)) process.stderr.write(output + '\n', 'utf8') } /** * Get call site location as array. */ function callSiteLocation (callSite) { var file = callSite.getFileName() || '' var line = callSite.getLineNumber() var colm = callSite.getColumnNumber() if (callSite.isEval()) { file = callSite.getEvalOrigin() + ', ' + file } var site = [file, line, colm] site.callSite = callSite site.name = callSite.getFunctionName() return site } /** * Generate a default message from the site. */ function defaultMessage (site) { var callSite = site.callSite var funcName = site.name // make useful anonymous name if (!funcName) { funcName = '' } var context = callSite.getThis() var typeName = context && callSite.getTypeName() // ignore useless type name if (typeName === 'Object') { typeName = undefined } // make useful type name if (typeName === 'Function') { typeName = context.name || typeName } return typeName && callSite.getMethodName() ? typeName + '.' + funcName : funcName } /** * Format deprecation message without color. */ function formatPlain (msg, caller, stack) { var timestamp = new Date().toUTCString() var formatted = timestamp + ' ' + this._namespace + ' deprecated ' + msg // add stack trace if (this._traced) { for (var i = 0; i < stack.length; i++) { formatted += '\n at ' + stack[i].toString() } return formatted } if (caller) { formatted += ' at ' + formatLocation(caller) } return formatted } /** * Format deprecation message with color. */ function formatColor (msg, caller, stack) { var formatted = '\x1b[36;1m' + this._namespace + '\x1b[22;39m' + // bold cyan ' \x1b[33;1mdeprecated\x1b[22;39m' + // bold yellow ' \x1b[0m' + msg + '\x1b[39m' // reset // add stack trace if (this._traced) { for (var i = 0; i < stack.length; i++) { formatted += '\n \x1b[36mat ' + stack[i].toString() + '\x1b[39m' // cyan } return formatted } if (caller) { formatted += ' \x1b[36m' + formatLocation(caller) + '\x1b[39m' // cyan } return formatted } /** * Format call site location. */ function formatLocation (callSite) { return relative(basePath, callSite[0]) + ':' + callSite[1] + ':' + callSite[2] } /** * Get the stack as array of call sites. */ function getStack () { var limit = Error.stackTraceLimit var obj = {} var prep = Error.prepareStackTrace Error.prepareStackTrace = prepareObjectStackTrace Error.stackTraceLimit = Math.max(10, limit) // capture the stack Error.captureStackTrace(obj) // slice this function off the top var stack = obj.stack.slice(1) Error.prepareStackTrace = prep Error.stackTraceLimit = limit return stack } /** * Capture call site stack from v8. */ function prepareObjectStackTrace (obj, stack) { return stack } /** * Return a wrapped function in a deprecation message. */ function wrapfunction (fn, message) { if (typeof fn !== 'function') { throw new TypeError('argument fn must be a function') } var args = createArgumentsString(fn.length) var stack = getStack() var site = callSiteLocation(stack[1]) site.name = fn.name // eslint-disable-next-line no-new-func var deprecatedfn = new Function('fn', 'log', 'deprecate', 'message', 'site', '"use strict"\n' + 'return function (' + args + ') {' + 'log.call(deprecate, message, site)\n' + 'return fn.apply(this, arguments)\n' + '}')(fn, log, this, message, site) return deprecatedfn } /** * Wrap property in a deprecation message. */ function wrapproperty (obj, prop, message) { if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { throw new TypeError('argument obj must be object') } var descriptor = Object.getOwnPropertyDescriptor(obj, prop) if (!descriptor) { throw new TypeError('must call property on owner object') } if (!descriptor.configurable) { throw new TypeError('property must be configurable') } var deprecate = this var stack = getStack() var site = callSiteLocation(stack[1]) // set site name site.name = prop // convert data descriptor if ('value' in descriptor) { descriptor = convertDataDescriptorToAccessor(obj, prop, message) } var get = descriptor.get var set = descriptor.set // wrap getter if (typeof get === 'function') { descriptor.get = function getter () { log.call(deprecate, message, site) return get.apply(this, arguments) } } // wrap setter if (typeof set === 'function') { descriptor.set = function setter () { log.call(deprecate, message, site) return set.apply(this, arguments) } } Object.defineProperty(obj, prop, descriptor) } /** * Create DeprecationError for deprecation */ function DeprecationError (namespace, message, stack) { var error = new Error() var stackString Object.defineProperty(error, 'constructor', { value: DeprecationError }) Object.defineProperty(error, 'message', { configurable: true, enumerable: false, value: message, writable: true }) Object.defineProperty(error, 'name', { enumerable: false, configurable: true, value: 'DeprecationError', writable: true }) Object.defineProperty(error, 'namespace', { configurable: true, enumerable: false, value: namespace, writable: true }) Object.defineProperty(error, 'stack', { configurable: true, enumerable: false, get: function () { if (stackString !== undefined) { return stackString } // prepare stack trace return (stackString = createStackString.call(this, stack)) }, set: function setter (val) { stackString = val } }) return error } (The MIT License) Copyright (c) 2014-2018 Douglas Christopher Wilson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "depd", "description": "Deprecate all the things", "version": "2.0.0", "author": "Douglas Christopher Wilson ", "license": "MIT", "keywords": [ "deprecate", "deprecated" ], "repository": "dougwilson/nodejs-depd", "browser": "lib/browser/index.js", "devDependencies": { "benchmark": "2.1.4", "beautify-benchmark": "0.2.4", "eslint": "5.7.0", "eslint-config-standard": "12.0.0", "eslint-plugin-import": "2.14.0", "eslint-plugin-markdown": "1.0.0-beta.7", "eslint-plugin-node": "7.0.1", "eslint-plugin-promise": "4.0.1", "eslint-plugin-standard": "4.0.0", "istanbul": "0.4.5", "mocha": "5.2.0", "safe-buffer": "5.1.2", "uid-safe": "2.1.5" }, "files": [ "lib/", "History.md", "LICENSE", "index.js", "Readme.md" ], "engines": { "node": ">= 0.8" }, "scripts": { "bench": "node benchmark/index.js", "lint": "eslint --plugin markdown --ext js,md .", "test": "mocha --reporter spec --bail test/", "test-ci": "istanbul cover --print=none node_modules/mocha/bin/_mocha -- --reporter spec test/ && istanbul report lcovonly text-summary", "test-cov": "istanbul cover --print=none node_modules/mocha/bin/_mocha -- --reporter dot test/ && istanbul report lcov text-summary" } } # depd [![NPM Version][npm-version-image]][npm-url] [![NPM Downloads][npm-downloads-image]][npm-url] [![Node.js Version][node-image]][node-url] [![Linux Build][travis-image]][travis-url] [![Windows Build][appveyor-image]][appveyor-url] [![Coverage Status][coveralls-image]][coveralls-url] Deprecate all the things > With great modules comes great responsibility; mark things deprecated! ## Install This module is installed directly using `npm`: ```sh $ npm install depd ``` This module can also be bundled with systems like [Browserify](http://browserify.org/) or [webpack](https://webpack.github.io/), though by default this module will alter it's API to no longer display or track deprecations. ## API ```js var deprecate = require('depd')('my-module') ``` This library allows you to display deprecation messages to your users. This library goes above and beyond with deprecation warnings by introspection of the call stack (but only the bits that it is interested in). Instead of just warning on the first invocation of a deprecated function and never again, this module will warn on the first invocation of a deprecated function per unique call site, making it ideal to alert users of all deprecated uses across the code base, rather than just whatever happens to execute first. The deprecation warnings from this module also include the file and line information for the call into the module that the deprecated function was in. **NOTE** this library has a similar interface to the `debug` module, and this module uses the calling file to get the boundary for the call stacks, so you should always create a new `deprecate` object in each file and not within some central file. ### depd(namespace) Create a new deprecate function that uses the given namespace name in the messages and will display the call site prior to the stack entering the file this function was called from. It is highly suggested you use the name of your module as the namespace. ### deprecate(message) Call this function from deprecated code to display a deprecation message. This message will appear once per unique caller site. Caller site is the first call site in the stack in a different file from the caller of this function. If the message is omitted, a message is generated for you based on the site of the `deprecate()` call and will display the name of the function called, similar to the name displayed in a stack trace. ### deprecate.function(fn, message) Call this function to wrap a given function in a deprecation message on any call to the function. An optional message can be supplied to provide a custom message. ### deprecate.property(obj, prop, message) Call this function to wrap a given property on object in a deprecation message on any accessing or setting of the property. An optional message can be supplied to provide a custom message. The method must be called on the object where the property belongs (not inherited from the prototype). If the property is a data descriptor, it will be converted to an accessor descriptor in order to display the deprecation message. ### process.on('deprecation', fn) This module will allow easy capturing of deprecation errors by emitting the errors as the type "deprecation" on the global `process`. If there are no listeners for this type, the errors are written to STDERR as normal, but if there are any listeners, nothing will be written to STDERR and instead only emitted. From there, you can write the errors in a different format or to a logging source. The error represents the deprecation and is emitted only once with the same rules as writing to STDERR. The error has the following properties: - `message` - This is the message given by the library - `name` - This is always `'DeprecationError'` - `namespace` - This is the namespace the deprecation came from - `stack` - This is the stack of the call to the deprecated thing Example `error.stack` output: ``` DeprecationError: my-cool-module deprecated oldfunction at Object. ([eval]-wrapper:6:22) at Module._compile (module.js:456:26) at evalScript (node.js:532:25) at startup (node.js:80:7) at node.js:902:3 ``` ### process.env.NO_DEPRECATION As a user of modules that are deprecated, the environment variable `NO_DEPRECATION` is provided as a quick solution to silencing deprecation warnings from being output. The format of this is similar to that of `DEBUG`: ```sh $ NO_DEPRECATION=my-module,othermod node app.js ``` This will suppress deprecations from being output for "my-module" and "othermod". The value is a list of comma-separated namespaces. To suppress every warning across all namespaces, use the value `*` for a namespace. Providing the argument `--no-deprecation` to the `node` executable will suppress all deprecations (only available in Node.js 0.8 or higher). **NOTE** This will not suppress the deperecations given to any "deprecation" event listeners, just the output to STDERR. ### process.env.TRACE_DEPRECATION As a user of modules that are deprecated, the environment variable `TRACE_DEPRECATION` is provided as a solution to getting more detailed location information in deprecation warnings by including the entire stack trace. The format of this is the same as `NO_DEPRECATION`: ```sh $ TRACE_DEPRECATION=my-module,othermod node app.js ``` This will include stack traces for deprecations being output for "my-module" and "othermod". The value is a list of comma-separated namespaces. To trace every warning across all namespaces, use the value `*` for a namespace. Providing the argument `--trace-deprecation` to the `node` executable will trace all deprecations (only available in Node.js 0.8 or higher). **NOTE** This will not trace the deperecations silenced by `NO_DEPRECATION`. ## Display ![message](files/message.png) When a user calls a function in your library that you mark deprecated, they will see the following written to STDERR (in the given colors, similar colors and layout to the `debug` module): ``` bright cyan bright yellow | | reset cyan | | | | ▼ ▼ ▼ ▼ my-cool-module deprecated oldfunction [eval]-wrapper:6:22 ▲ ▲ ▲ ▲ | | | | namespace | | location of mycoolmod.oldfunction() call | deprecation message the word "deprecated" ``` If the user redirects their STDERR to a file or somewhere that does not support colors, they see (similar layout to the `debug` module): ``` Sun, 15 Jun 2014 05:21:37 GMT my-cool-module deprecated oldfunction at [eval]-wrapper:6:22 ▲ ▲ ▲ ▲ ▲ | | | | | timestamp of message namespace | | location of mycoolmod.oldfunction() call | deprecation message the word "deprecated" ``` ## Examples ### Deprecating all calls to a function This will display a deprecated message about "oldfunction" being deprecated from "my-module" on STDERR. ```js var deprecate = require('depd')('my-cool-module') // message automatically derived from function name // Object.oldfunction exports.oldfunction = deprecate.function(function oldfunction () { // all calls to function are deprecated }) // specific message exports.oldfunction = deprecate.function(function () { // all calls to function are deprecated }, 'oldfunction') ``` ### Conditionally deprecating a function call This will display a deprecated message about "weirdfunction" being deprecated from "my-module" on STDERR when called with less than 2 arguments. ```js var deprecate = require('depd')('my-cool-module') exports.weirdfunction = function () { if (arguments.length < 2) { // calls with 0 or 1 args are deprecated deprecate('weirdfunction args < 2') } } ``` When calling `deprecate` as a function, the warning is counted per call site within your own module, so you can display different deprecations depending on different situations and the users will still get all the warnings: ```js var deprecate = require('depd')('my-cool-module') exports.weirdfunction = function () { if (arguments.length < 2) { // calls with 0 or 1 args are deprecated deprecate('weirdfunction args < 2') } else if (typeof arguments[0] !== 'string') { // calls with non-string first argument are deprecated deprecate('weirdfunction non-string first arg') } } ``` ### Deprecating property access This will display a deprecated message about "oldprop" being deprecated from "my-module" on STDERR when accessed. A deprecation will be displayed when setting the value and when getting the value. ```js var deprecate = require('depd')('my-cool-module') exports.oldprop = 'something' // message automatically derives from property name deprecate.property(exports, 'oldprop') // explicit message deprecate.property(exports, 'oldprop', 'oldprop >= 0.10') ``` ## License [MIT](LICENSE) [appveyor-image]: https://badgen.net/appveyor/ci/dougwilson/nodejs-depd/master?label=windows [appveyor-url]: https://ci.appveyor.com/project/dougwilson/nodejs-depd [coveralls-image]: https://badgen.net/coveralls/c/github/dougwilson/nodejs-depd/master [coveralls-url]: https://coveralls.io/r/dougwilson/nodejs-depd?branch=master [node-image]: https://badgen.net/npm/node/depd [node-url]: https://nodejs.org/en/download/ [npm-downloads-image]: https://badgen.net/npm/dm/depd [npm-url]: https://npmjs.org/package/depd [npm-version-image]: https://badgen.net/npm/v/depd [travis-image]: https://badgen.net/travis/dougwilson/nodejs-depd/master?label=linux [travis-url]: https://travis-ci.org/dougwilson/nodejs-depd /*! * depd * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ 'use strict' /** * Module exports. * @public */ module.exports = depd /** * Create deprecate for namespace in caller. */ function depd (namespace) { if (!namespace) { throw new TypeError('argument namespace is required') } function deprecate (message) { // no-op in browser } deprecate._file = undefined deprecate._ignored = true deprecate._namespace = namespace deprecate._traced = false deprecate._warned = Object.create(null) deprecate.function = wrapfunction deprecate.property = wrapproperty return deprecate } /** * Return a wrapped function in a deprecation message. * * This is a no-op version of the wrapper, which does nothing but call * validation. */ function wrapfunction (fn, message) { if (typeof fn !== 'function') { throw new TypeError('argument fn must be a function') } return fn } /** * Wrap property in a deprecation message. * * This is a no-op version of the wrapper, which does nothing but call * validation. */ function wrapproperty (obj, prop, message) { if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { throw new TypeError('argument obj must be object') } var descriptor = Object.getOwnPropertyDescriptor(obj, prop) if (!descriptor) { throw new TypeError('must call property on owner object') } if (!descriptor.configurable) { throw new TypeError('property must be configurable') } } Copyright (c) 2012-2014 Andris Reinman Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "encoding", "version": "0.1.13", "description": "Convert encodings, uses iconv-lite", "main": "lib/encoding.js", "scripts": { "test": "nodeunit test" }, "repository": "https://github.com/andris9/encoding.git", "author": "Andris Reinman", "license": "MIT", "dependencies": { "iconv-lite": "^0.6.2" }, "devDependencies": { "nodeunit": "0.11.3" } } 'use strict'; var iconvLite = require('iconv-lite'); // Expose to the world module.exports.convert = convert; /** * Convert encoding of an UTF-8 string or a buffer * * @param {String|Buffer} str String to be converted * @param {String} to Encoding to be converted to * @param {String} [from='UTF-8'] Encoding to be converted from * @return {Buffer} Encoded string */ function convert(str, to, from) { from = checkEncoding(from || 'UTF-8'); to = checkEncoding(to || 'UTF-8'); str = str || ''; var result; if (from !== 'UTF-8' && typeof str === 'string') { str = Buffer.from(str, 'binary'); } if (from === to) { if (typeof str === 'string') { result = Buffer.from(str); } else { result = str; } } else { try { result = convertIconvLite(str, to, from); } catch (E) { console.error(E); result = str; } } if (typeof result === 'string') { result = Buffer.from(result, 'utf-8'); } return result; } /** * Convert encoding of astring with iconv-lite * * @param {String|Buffer} str String to be converted * @param {String} to Encoding to be converted to * @param {String} [from='UTF-8'] Encoding to be converted from * @return {Buffer} Encoded string */ function convertIconvLite(str, to, from) { if (to === 'UTF-8') { return iconvLite.decode(str, from); } else if (from === 'UTF-8') { return iconvLite.encode(str, to); } else { return iconvLite.encode(iconvLite.decode(str, from), to); } } /** * Converts charset name if needed * * @param {String} name Character set * @return {String} Character set name */ function checkEncoding(name) { return (name || '') .toString() .trim() .replace(/^latin[\-_]?(\d+)$/i, 'ISO-8859-$1') .replace(/^win(?:dows)?[\-_]?(\d+)$/i, 'WINDOWS-$1') .replace(/^utf[\-_]?(\d+)$/i, 'UTF-$1') .replace(/^ks_c_5601\-1987$/i, 'CP949') .replace(/^us[\-_]?ascii$/i, 'ASCII') .toUpperCase(); } ## 0.6.3 / 2021-05-23 * Fix HKSCS encoding to prefer Big5 codes if both Big5 and HKSCS codes are possible (#264) ## 0.6.2 / 2020-07-08 * Support Uint8Array-s decoding without conversion to Buffers, plus fix an edge case. ## 0.6.1 / 2020-06-28 * Support Uint8Array-s directly when decoding (#246, by @gyzerok) * Unify package.json version ranges to be strictly semver-compatible (#241) * Fix minor issue in UTF-32 decoder's endianness detection code. ## 0.6.0 / 2020-06-08 * Updated 'gb18030' encoding to :2005 edition (see https://github.com/whatwg/encoding/issues/22). * Removed `iconv.extendNodeEncodings()` mechanism. It was deprecated 5 years ago and didn't work in recent Node versions. * Reworked Streaming API behavior in browser environments to fix #204. Streaming API will be excluded by default in browser packs, saving ~100Kb bundle size, unless enabled explicitly using `iconv.enableStreamingAPI(require('stream'))`. * Updates to development environment & tests: * Added ./test/webpack private package to test complex new use cases that need custom environment. It's tested as a separate job in Travis CI. * Updated generation code for the new EUC-KR index file format from Encoding Standard. * Removed Buffer() constructor in tests (#197 by @gabrielschulhof). ## 0.5.2 / 2020-06-08 * Added `iconv.getEncoder()` and `iconv.getDecoder()` methods to typescript definitions (#229). * Fixed semver version to 6.1.2 to support Node 8.x (by @tanandara). * Capped iconv version to 2.x as 3.x has dropped support for older Node versions. * Switched from instanbul to c8 for code coverage. ## 0.5.1 / 2020-01-18 * Added cp720 encoding (#221, by @kr-deps) * (minor) Changed Changelog.md formatting to use h2. ## 0.5.0 / 2019-06-26 * Added UTF-32 encoding, both little-endian and big-endian variants (UTF-32LE, UTF32-BE). If endianness is not provided for decoding, it's deduced automatically from the stream using a heuristic similar to what we use in UTF-16. (great work in #216 by @kshetline) * Several minor updates to README (#217 by @oldj, plus some more) * Added Node versions 10 and 12 to Travis test harness. ## 0.4.24 / 2018-08-22 * Added MIK encoding (#196, by @Ivan-Kalatchev) ## 0.4.23 / 2018-05-07 * Fix deprecation warning in Node v10 due to the last usage of `new Buffer` (#185, by @felixbuenemann) * Switched from NodeBuffer to Buffer in typings (#155 by @felixfbecker, #186 by @larssn) ## 0.4.22 / 2018-05-05 * Use older semver style for dependencies to be compatible with Node version 0.10 (#182, by @dougwilson) * Fix tests to accomodate fixes in Node v10 (#182, by @dougwilson) ## 0.4.21 / 2018-04-06 * Fix encoding canonicalization (#156) * Fix the paths in the "browser" field in package.json (#174 by @LMLB) * Removed "contributors" section in package.json - see Git history instead. ## 0.4.20 / 2018-04-06 * Updated `new Buffer()` usages with recommended replacements as it's being deprecated in Node v10 (#176, #178 by @ChALkeR) ## 0.4.19 / 2017-09-09 * Fixed iso8859-1 codec regression in handling untranslatable characters (#162, caused by #147) * Re-generated windows1255 codec, because it was updated in iconv project * Fixed grammar in error message when iconv-lite is loaded with encoding other than utf8 ## 0.4.18 / 2017-06-13 * Fixed CESU-8 regression in Node v8. ## 0.4.17 / 2017-04-22 * Updated typescript definition file to support Angular 2 AoT mode (#153 by @larssn) ## 0.4.16 / 2017-04-22 * Added support for React Native (#150) * Changed iso8859-1 encoding to usine internal 'binary' encoding, as it's the same thing (#147 by @mscdex) * Fixed typo in Readme (#138 by @jiangzhuo) * Fixed build for Node v6.10+ by making correct version comparison * Added a warning if iconv-lite is loaded not as utf-8 (see #142) ## 0.4.15 / 2016-11-21 * Fixed typescript type definition (#137) ## 0.4.14 / 2016-11-20 * Preparation for v1.0 * Added Node v6 and latest Node versions to Travis CI test rig * Deprecated Node v0.8 support * Typescript typings (@larssn) * Fix encoding of Euro character in GB 18030 (inspired by @lygstate) * Add ms prefix to dbcs windows encodings (@rokoroku) ## 0.4.13 / 2015-10-01 * Fix silly mistake in deprecation notice. ## 0.4.12 / 2015-09-26 * Node v4 support: * Added CESU-8 decoding (#106) * Added deprecation notice for `extendNodeEncodings` * Added Travis tests for Node v4 and io.js latest (#105 by @Mithgol) ## 0.4.11 / 2015-07-03 * Added CESU-8 encoding. ## 0.4.10 / 2015-05-26 * Changed UTF-16 endianness heuristic to take into account any ASCII chars, not just spaces. This should minimize the importance of "default" endianness. ## 0.4.9 / 2015-05-24 * Streamlined BOM handling: strip BOM by default, add BOM when encoding if addBOM: true. Added docs to Readme. * UTF16 now uses UTF16-LE by default. * Fixed minor issue with big5 encoding. * Added io.js testing on Travis; updated node-iconv version to test against. Now we just skip testing SBCS encodings that node-iconv doesn't support. * (internal refactoring) Updated codec interface to use classes. * Use strict mode in all files. ## 0.4.8 / 2015-04-14 * added alias UNICODE-1-1-UTF-7 for UTF-7 encoding (#94) ## 0.4.7 / 2015-02-05 * stop official support of Node.js v0.8. Should still work, but no guarantees. reason: Packages needed for testing are hard to get on Travis CI. * work in environment where Object.prototype is monkey patched with enumerable props (#89). ## 0.4.6 / 2015-01-12 * fix rare aliases of single-byte encodings (thanks @mscdex) * double the timeout for dbcs tests to make them less flaky on travis ## 0.4.5 / 2014-11-20 * fix windows-31j and x-sjis encoding support (@nleush) * minor fix: undefined variable reference when internal error happens ## 0.4.4 / 2014-07-16 * added encodings UTF-7 (RFC2152) and UTF-7-IMAP (RFC3501 Section 5.1.3) * fixed streaming base64 encoding ## 0.4.3 / 2014-06-14 * added encodings UTF-16BE and UTF-16 with BOM ## 0.4.2 / 2014-06-12 * don't throw exception if `extendNodeEncodings()` is called more than once ## 0.4.1 / 2014-06-11 * codepage 808 added ## 0.4.0 / 2014-06-10 * code is rewritten from scratch * all widespread encodings are supported * streaming interface added * browserify compatibility added * (optional) extend core primitive encodings to make usage even simpler * moved from vows to mocha as the testing framework Copyright (c) 2011 Alexander Shtuchkin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "iconv-lite", "description": "Convert character encodings in pure javascript.", "version": "0.6.3", "license": "MIT", "keywords": [ "iconv", "convert", "charset", "icu" ], "author": "Alexander Shtuchkin ", "main": "./lib/index.js", "typings": "./lib/index.d.ts", "homepage": "https://github.com/ashtuchkin/iconv-lite", "bugs": "https://github.com/ashtuchkin/iconv-lite/issues", "repository": { "type": "git", "url": "git://github.com/ashtuchkin/iconv-lite.git" }, "engines": { "node": ">=0.10.0" }, "scripts": { "coverage": "c8 _mocha --grep .", "test": "mocha --reporter spec --grep ." }, "browser": { "stream": false }, "devDependencies": { "async": "^3.2.0", "c8": "^7.2.0", "errto": "^0.2.1", "iconv": "^2.3.5", "mocha": "^3.5.3", "request": "^2.88.2", "semver": "^6.3.0", "unorm": "^1.6.0" }, "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" } } "use strict"; var Buffer = require("safer-buffer").Buffer; // Multibyte codec. In this scheme, a character is represented by 1 or more bytes. // Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences. // To save memory and loading time, we read table files only when requested. exports._dbcs = DBCSCodec; var UNASSIGNED = -1, GB18030_CODE = -2, SEQ_START = -10, NODE_START = -1000, UNASSIGNED_NODE = new Array(0x100), DEF_CHAR = -1; for (var i = 0; i < 0x100; i++) UNASSIGNED_NODE[i] = UNASSIGNED; // Class DBCSCodec reads and initializes mapping tables. function DBCSCodec(codecOptions, iconv) { this.encodingName = codecOptions.encodingName; if (!codecOptions) throw new Error("DBCS codec is called without the data.") if (!codecOptions.table) throw new Error("Encoding '" + this.encodingName + "' has no data."); // Load tables. var mappingTable = codecOptions.table(); // Decode tables: MBCS -> Unicode. // decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256. // Trie root is decodeTables[0]. // Values: >= 0 -> unicode character code. can be > 0xFFFF // == UNASSIGNED -> unknown/unassigned sequence. // == GB18030_CODE -> this is the end of a GB18030 4-byte sequence. // <= NODE_START -> index of the next node in our trie to process next byte. // <= SEQ_START -> index of the start of a character code sequence, in decodeTableSeq. this.decodeTables = []; this.decodeTables[0] = UNASSIGNED_NODE.slice(0); // Create root node. // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here. this.decodeTableSeq = []; // Actual mapping tables consist of chunks. Use them to fill up decode tables. for (var i = 0; i < mappingTable.length; i++) this._addDecodeChunk(mappingTable[i]); // Load & create GB18030 tables when needed. if (typeof codecOptions.gb18030 === 'function') { this.gb18030 = codecOptions.gb18030(); // Load GB18030 ranges. // Add GB18030 common decode nodes. var commonThirdByteNodeIdx = this.decodeTables.length; this.decodeTables.push(UNASSIGNED_NODE.slice(0)); var commonFourthByteNodeIdx = this.decodeTables.length; this.decodeTables.push(UNASSIGNED_NODE.slice(0)); // Fill out the tree var firstByteNode = this.decodeTables[0]; for (var i = 0x81; i <= 0xFE; i++) { var secondByteNode = this.decodeTables[NODE_START - firstByteNode[i]]; for (var j = 0x30; j <= 0x39; j++) { if (secondByteNode[j] === UNASSIGNED) { secondByteNode[j] = NODE_START - commonThirdByteNodeIdx; } else if (secondByteNode[j] > NODE_START) { throw new Error("gb18030 decode tables conflict at byte 2"); } var thirdByteNode = this.decodeTables[NODE_START - secondByteNode[j]]; for (var k = 0x81; k <= 0xFE; k++) { if (thirdByteNode[k] === UNASSIGNED) { thirdByteNode[k] = NODE_START - commonFourthByteNodeIdx; } else if (thirdByteNode[k] === NODE_START - commonFourthByteNodeIdx) { continue; } else if (thirdByteNode[k] > NODE_START) { throw new Error("gb18030 decode tables conflict at byte 3"); } var fourthByteNode = this.decodeTables[NODE_START - thirdByteNode[k]]; for (var l = 0x30; l <= 0x39; l++) { if (fourthByteNode[l] === UNASSIGNED) fourthByteNode[l] = GB18030_CODE; } } } } } this.defaultCharUnicode = iconv.defaultCharUnicode; // Encode tables: Unicode -> DBCS. // `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance. // Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null. // Values: >= 0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.). // == UNASSIGNED -> no conversion found. Output a default char. // <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence. this.encodeTable = []; // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key // means end of sequence (needed when one sequence is a strict subsequence of another). // Objects are kept separately from encodeTable to increase performance. this.encodeTableSeq = []; // Some chars can be decoded, but need not be encoded. var skipEncodeChars = {}; if (codecOptions.encodeSkipVals) for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) { var val = codecOptions.encodeSkipVals[i]; if (typeof val === 'number') skipEncodeChars[val] = true; else for (var j = val.from; j <= val.to; j++) skipEncodeChars[j] = true; } // Use decode trie to recursively fill out encode tables. this._fillEncodeTable(0, 0, skipEncodeChars); // Add more encoding pairs when needed. if (codecOptions.encodeAdd) { for (var uChar in codecOptions.encodeAdd) if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar)) this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]); } this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)]; if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]['?']; if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0); } DBCSCodec.prototype.encoder = DBCSEncoder; DBCSCodec.prototype.decoder = DBCSDecoder; // Decoder helpers DBCSCodec.prototype._getDecodeTrieNode = function(addr) { var bytes = []; for (; addr > 0; addr >>>= 8) bytes.push(addr & 0xFF); if (bytes.length == 0) bytes.push(0); var node = this.decodeTables[0]; for (var i = bytes.length-1; i > 0; i--) { // Traverse nodes deeper into the trie. var val = node[bytes[i]]; if (val == UNASSIGNED) { // Create new node. node[bytes[i]] = NODE_START - this.decodeTables.length; this.decodeTables.push(node = UNASSIGNED_NODE.slice(0)); } else if (val <= NODE_START) { // Existing node. node = this.decodeTables[NODE_START - val]; } else throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + addr.toString(16)); } return node; } DBCSCodec.prototype._addDecodeChunk = function(chunk) { // First element of chunk is the hex mbcs code where we start. var curAddr = parseInt(chunk[0], 16); // Choose the decoding node where we'll write our chars. var writeTable = this._getDecodeTrieNode(curAddr); curAddr = curAddr & 0xFF; // Write all other elements of the chunk to the table. for (var k = 1; k < chunk.length; k++) { var part = chunk[k]; if (typeof part === "string") { // String, write as-is. for (var l = 0; l < part.length;) { var code = part.charCodeAt(l++); if (0xD800 <= code && code < 0xDC00) { // Decode surrogate var codeTrail = part.charCodeAt(l++); if (0xDC00 <= codeTrail && codeTrail < 0xE000) writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00); else throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + chunk[0]); } else if (0x0FF0 < code && code <= 0x0FFF) { // Character sequence (our own encoding used) var len = 0xFFF - code + 2; var seq = []; for (var m = 0; m < len; m++) seq.push(part.charCodeAt(l++)); // Simple variation: don't support surrogates or subsequences in seq. writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length; this.decodeTableSeq.push(seq); } else writeTable[curAddr++] = code; // Basic char } } else if (typeof part === "number") { // Integer, meaning increasing sequence starting with prev character. var charCode = writeTable[curAddr - 1] + 1; for (var l = 0; l < part; l++) writeTable[curAddr++] = charCode++; } else throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]); } if (curAddr > 0xFF) throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr); } // Encoder helpers DBCSCodec.prototype._getEncodeBucket = function(uCode) { var high = uCode >> 8; // This could be > 0xFF because of astral characters. if (this.encodeTable[high] === undefined) this.encodeTable[high] = UNASSIGNED_NODE.slice(0); // Create bucket on demand. return this.encodeTable[high]; } DBCSCodec.prototype._setEncodeChar = function(uCode, dbcsCode) { var bucket = this._getEncodeBucket(uCode); var low = uCode & 0xFF; if (bucket[low] <= SEQ_START) this.encodeTableSeq[SEQ_START-bucket[low]][DEF_CHAR] = dbcsCode; // There's already a sequence, set a single-char subsequence of it. else if (bucket[low] == UNASSIGNED) bucket[low] = dbcsCode; } DBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) { // Get the root of character tree according to first character of the sequence. var uCode = seq[0]; var bucket = this._getEncodeBucket(uCode); var low = uCode & 0xFF; var node; if (bucket[low] <= SEQ_START) { // There's already a sequence with - use it. node = this.encodeTableSeq[SEQ_START-bucket[low]]; } else { // There was no sequence object - allocate a new one. node = {}; if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low]; // If a char was set before - make it a single-char subsequence. bucket[low] = SEQ_START - this.encodeTableSeq.length; this.encodeTableSeq.push(node); } // Traverse the character tree, allocating new nodes as needed. for (var j = 1; j < seq.length-1; j++) { var oldVal = node[uCode]; if (typeof oldVal === 'object') node = oldVal; else { node = node[uCode] = {} if (oldVal !== undefined) node[DEF_CHAR] = oldVal } } // Set the leaf to given dbcsCode. uCode = seq[seq.length-1]; node[uCode] = dbcsCode; } DBCSCodec.prototype._fillEncodeTable = function(nodeIdx, prefix, skipEncodeChars) { var node = this.decodeTables[nodeIdx]; var hasValues = false; var subNodeEmpty = {}; for (var i = 0; i < 0x100; i++) { var uCode = node[i]; var mbCode = prefix + i; if (skipEncodeChars[mbCode]) continue; if (uCode >= 0) { this._setEncodeChar(uCode, mbCode); hasValues = true; } else if (uCode <= NODE_START) { var subNodeIdx = NODE_START - uCode; if (!subNodeEmpty[subNodeIdx]) { // Skip empty subtrees (they are too large in gb18030). var newPrefix = (mbCode << 8) >>> 0; // NOTE: '>>> 0' keeps 32-bit num positive. if (this._fillEncodeTable(subNodeIdx, newPrefix, skipEncodeChars)) hasValues = true; else subNodeEmpty[subNodeIdx] = true; } } else if (uCode <= SEQ_START) { this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode); hasValues = true; } } return hasValues; } // == Encoder ================================================================== function DBCSEncoder(options, codec) { // Encoder state this.leadSurrogate = -1; this.seqObj = undefined; // Static data this.encodeTable = codec.encodeTable; this.encodeTableSeq = codec.encodeTableSeq; this.defaultCharSingleByte = codec.defCharSB; this.gb18030 = codec.gb18030; } DBCSEncoder.prototype.write = function(str) { var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)), leadSurrogate = this.leadSurrogate, seqObj = this.seqObj, nextChar = -1, i = 0, j = 0; while (true) { // 0. Get next character. if (nextChar === -1) { if (i == str.length) break; var uCode = str.charCodeAt(i++); } else { var uCode = nextChar; nextChar = -1; } // 1. Handle surrogates. if (0xD800 <= uCode && uCode < 0xE000) { // Char is one of surrogates. if (uCode < 0xDC00) { // We've got lead surrogate. if (leadSurrogate === -1) { leadSurrogate = uCode; continue; } else { leadSurrogate = uCode; // Double lead surrogate found. uCode = UNASSIGNED; } } else { // We've got trail surrogate. if (leadSurrogate !== -1) { uCode = 0x10000 + (leadSurrogate - 0xD800) * 0x400 + (uCode - 0xDC00); leadSurrogate = -1; } else { // Incomplete surrogate pair - only trail surrogate found. uCode = UNASSIGNED; } } } else if (leadSurrogate !== -1) { // Incomplete surrogate pair - only lead surrogate found. nextChar = uCode; uCode = UNASSIGNED; // Write an error, then current char. leadSurrogate = -1; } // 2. Convert uCode character. var dbcsCode = UNASSIGNED; if (seqObj !== undefined && uCode != UNASSIGNED) { // We are in the middle of the sequence var resCode = seqObj[uCode]; if (typeof resCode === 'object') { // Sequence continues. seqObj = resCode; continue; } else if (typeof resCode == 'number') { // Sequence finished. Write it. dbcsCode = resCode; } else if (resCode == undefined) { // Current character is not part of the sequence. // Try default character for this sequence resCode = seqObj[DEF_CHAR]; if (resCode !== undefined) { dbcsCode = resCode; // Found. Write it. nextChar = uCode; // Current character will be written too in the next iteration. } else { // TODO: What if we have no default? (resCode == undefined) // Then, we should write first char of the sequence as-is and try the rest recursively. // Didn't do it for now because no encoding has this situation yet. // Currently, just skip the sequence and write current char. } } seqObj = undefined; } else if (uCode >= 0) { // Regular character var subtable = this.encodeTable[uCode >> 8]; if (subtable !== undefined) dbcsCode = subtable[uCode & 0xFF]; if (dbcsCode <= SEQ_START) { // Sequence start seqObj = this.encodeTableSeq[SEQ_START-dbcsCode]; continue; } if (dbcsCode == UNASSIGNED && this.gb18030) { // Use GB18030 algorithm to find character(s) to write. var idx = findIdx(this.gb18030.uChars, uCode); if (idx != -1) { var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]); newBuf[j++] = 0x81 + Math.floor(dbcsCode / 12600); dbcsCode = dbcsCode % 12600; newBuf[j++] = 0x30 + Math.floor(dbcsCode / 1260); dbcsCode = dbcsCode % 1260; newBuf[j++] = 0x81 + Math.floor(dbcsCode / 10); dbcsCode = dbcsCode % 10; newBuf[j++] = 0x30 + dbcsCode; continue; } } } // 3. Write dbcsCode character. if (dbcsCode === UNASSIGNED) dbcsCode = this.defaultCharSingleByte; if (dbcsCode < 0x100) { newBuf[j++] = dbcsCode; } else if (dbcsCode < 0x10000) { newBuf[j++] = dbcsCode >> 8; // high byte newBuf[j++] = dbcsCode & 0xFF; // low byte } else if (dbcsCode < 0x1000000) { newBuf[j++] = dbcsCode >> 16; newBuf[j++] = (dbcsCode >> 8) & 0xFF; newBuf[j++] = dbcsCode & 0xFF; } else { newBuf[j++] = dbcsCode >>> 24; newBuf[j++] = (dbcsCode >>> 16) & 0xFF; newBuf[j++] = (dbcsCode >>> 8) & 0xFF; newBuf[j++] = dbcsCode & 0xFF; } } this.seqObj = seqObj; this.leadSurrogate = leadSurrogate; return newBuf.slice(0, j); } DBCSEncoder.prototype.end = function() { if (this.leadSurrogate === -1 && this.seqObj === undefined) return; // All clean. Most often case. var newBuf = Buffer.alloc(10), j = 0; if (this.seqObj) { // We're in the sequence. var dbcsCode = this.seqObj[DEF_CHAR]; if (dbcsCode !== undefined) { // Write beginning of the sequence. if (dbcsCode < 0x100) { newBuf[j++] = dbcsCode; } else { newBuf[j++] = dbcsCode >> 8; // high byte newBuf[j++] = dbcsCode & 0xFF; // low byte } } else { // See todo above. } this.seqObj = undefined; } if (this.leadSurrogate !== -1) { // Incomplete surrogate pair - only lead surrogate found. newBuf[j++] = this.defaultCharSingleByte; this.leadSurrogate = -1; } return newBuf.slice(0, j); } // Export for testing DBCSEncoder.prototype.findIdx = findIdx; // == Decoder ================================================================== function DBCSDecoder(options, codec) { // Decoder state this.nodeIdx = 0; this.prevBytes = []; // Static data this.decodeTables = codec.decodeTables; this.decodeTableSeq = codec.decodeTableSeq; this.defaultCharUnicode = codec.defaultCharUnicode; this.gb18030 = codec.gb18030; } DBCSDecoder.prototype.write = function(buf) { var newBuf = Buffer.alloc(buf.length*2), nodeIdx = this.nodeIdx, prevBytes = this.prevBytes, prevOffset = this.prevBytes.length, seqStart = -this.prevBytes.length, // idx of the start of current parsed sequence. uCode; for (var i = 0, j = 0; i < buf.length; i++) { var curByte = (i >= 0) ? buf[i] : prevBytes[i + prevOffset]; // Lookup in current trie node. var uCode = this.decodeTables[nodeIdx][curByte]; if (uCode >= 0) { // Normal character, just use it. } else if (uCode === UNASSIGNED) { // Unknown char. // TODO: Callback with seq. uCode = this.defaultCharUnicode.charCodeAt(0); i = seqStart; // Skip one byte ('i' will be incremented by the for loop) and try to parse again. } else if (uCode === GB18030_CODE) { if (i >= 3) { var ptr = (buf[i-3]-0x81)*12600 + (buf[i-2]-0x30)*1260 + (buf[i-1]-0x81)*10 + (curByte-0x30); } else { var ptr = (prevBytes[i-3+prevOffset]-0x81)*12600 + (((i-2 >= 0) ? buf[i-2] : prevBytes[i-2+prevOffset])-0x30)*1260 + (((i-1 >= 0) ? buf[i-1] : prevBytes[i-1+prevOffset])-0x81)*10 + (curByte-0x30); } var idx = findIdx(this.gb18030.gbChars, ptr); uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx]; } else if (uCode <= NODE_START) { // Go to next trie node. nodeIdx = NODE_START - uCode; continue; } else if (uCode <= SEQ_START) { // Output a sequence of chars. var seq = this.decodeTableSeq[SEQ_START - uCode]; for (var k = 0; k < seq.length - 1; k++) { uCode = seq[k]; newBuf[j++] = uCode & 0xFF; newBuf[j++] = uCode >> 8; } uCode = seq[seq.length-1]; } else throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte); // Write the character to buffer, handling higher planes using surrogate pair. if (uCode >= 0x10000) { uCode -= 0x10000; var uCodeLead = 0xD800 | (uCode >> 10); newBuf[j++] = uCodeLead & 0xFF; newBuf[j++] = uCodeLead >> 8; uCode = 0xDC00 | (uCode & 0x3FF); } newBuf[j++] = uCode & 0xFF; newBuf[j++] = uCode >> 8; // Reset trie node. nodeIdx = 0; seqStart = i+1; } this.nodeIdx = nodeIdx; this.prevBytes = (seqStart >= 0) ? Array.prototype.slice.call(buf, seqStart) : prevBytes.slice(seqStart + prevOffset).concat(Array.prototype.slice.call(buf)); return newBuf.slice(0, j).toString('ucs2'); } DBCSDecoder.prototype.end = function() { var ret = ''; // Try to parse all remaining chars. while (this.prevBytes.length > 0) { // Skip 1 character in the buffer. ret += this.defaultCharUnicode; var bytesArr = this.prevBytes.slice(1); // Parse remaining as usual. this.prevBytes = []; this.nodeIdx = 0; if (bytesArr.length > 0) ret += this.write(bytesArr); } this.prevBytes = []; this.nodeIdx = 0; return ret; } // Binary search for GB18030. Returns largest i such that table[i] <= val. function findIdx(table, val) { if (table[0] > val) return -1; var l = 0, r = table.length; while (l < r-1) { // always table[l] <= val < table[r] var mid = l + ((r-l+1) >> 1); if (table[mid] <= val) l = mid; else r = mid; } return l; } "use strict"; // Description of supported double byte encodings and aliases. // Tables are not require()-d until they are needed to speed up library load. // require()-s are direct to support Browserify. module.exports = { // == Japanese/ShiftJIS ==================================================== // All japanese encodings are based on JIS X set of standards: // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF. // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. // Has several variations in 1978, 1983, 1990 and 1997. // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead. // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233. // 2 planes, first is superset of 0208, second - revised 0212. // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx) // Byte encodings are: // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC. // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI. // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes. // 0x00-0x7F - lower part of 0201 // 0x8E, 0xA1-0xDF - upper part of 0201 // (0xA1-0xFE)x2 - 0208 plane (94x94). // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94). // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon. // Used as-is in ISO2022 family. // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, // 0201-1976 Roman, 0208-1978, 0208-1983. // * ISO2022-JP-1: Adds esc seq for 0212-1990. // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7. // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2. // * ISO2022-JP-2004: Adds 0213-2004 Plane 1. // // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes. // // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html 'shiftjis': { type: '_dbcs', table: function() { return require('./tables/shiftjis.json') }, encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, encodeSkipVals: [{from: 0xED40, to: 0xF940}], }, 'csshiftjis': 'shiftjis', 'mskanji': 'shiftjis', 'sjis': 'shiftjis', 'windows31j': 'shiftjis', 'ms31j': 'shiftjis', 'xsjis': 'shiftjis', 'windows932': 'shiftjis', 'ms932': 'shiftjis', '932': 'shiftjis', 'cp932': 'shiftjis', 'eucjp': { type: '_dbcs', table: function() { return require('./tables/eucjp.json') }, encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, }, // TODO: KDDI extension to Shift_JIS // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes. // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars. // == Chinese/GBK ========================================================== // http://en.wikipedia.org/wiki/GBK // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936 'gb2312': 'cp936', 'gb231280': 'cp936', 'gb23121980': 'cp936', 'csgb2312': 'cp936', 'csiso58gb231280': 'cp936', 'euccn': 'cp936', // Microsoft's CP936 is a subset and approximation of GBK. 'windows936': 'cp936', 'ms936': 'cp936', '936': 'cp936', 'cp936': { type: '_dbcs', table: function() { return require('./tables/cp936.json') }, }, // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other. 'gbk': { type: '_dbcs', table: function() { return require('./tables/cp936.json').concat(require('./tables/gbk-added.json')) }, }, 'xgbk': 'gbk', 'isoir58': 'gbk', // GB18030 is an algorithmic extension of GBK. // Main source: https://www.w3.org/TR/encoding/#gbk-encoder // http://icu-project.org/docs/papers/gb18030.html // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0 'gb18030': { type: '_dbcs', table: function() { return require('./tables/cp936.json').concat(require('./tables/gbk-added.json')) }, gb18030: function() { return require('./tables/gb18030-ranges.json') }, encodeSkipVals: [0x80], encodeAdd: {'€': 0xA2E3}, }, 'chinese': 'gb18030', // == Korean =============================================================== // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same. 'windows949': 'cp949', 'ms949': 'cp949', '949': 'cp949', 'cp949': { type: '_dbcs', table: function() { return require('./tables/cp949.json') }, }, 'cseuckr': 'cp949', 'csksc56011987': 'cp949', 'euckr': 'cp949', 'isoir149': 'cp949', 'korean': 'cp949', 'ksc56011987': 'cp949', 'ksc56011989': 'cp949', 'ksc5601': 'cp949', // == Big5/Taiwan/Hong Kong ================================================ // There are lots of tables for Big5 and cp950. Please see the following links for history: // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html // Variations, in roughly number of defined chars: // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/ // * Big5-2003 (Taiwan standard) almost superset of cp950. // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers. // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years. // Plus, it has 4 combining sequences. // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299 // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way. // Implementations are not consistent within browsers; sometimes labeled as just big5. // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied. // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31 // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s. // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt // // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong. 'windows950': 'cp950', 'ms950': 'cp950', '950': 'cp950', 'cp950': { type: '_dbcs', table: function() { return require('./tables/cp950.json') }, }, // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus. 'big5': 'big5hkscs', 'big5hkscs': { type: '_dbcs', table: function() { return require('./tables/cp950.json').concat(require('./tables/big5-added.json')) }, encodeSkipVals: [ // Although Encoding Standard says we should avoid encoding to HKSCS area (See Step 1 of // https://encoding.spec.whatwg.org/#index-big5-pointer), we still do it to increase compatibility with ICU. // But if a single unicode point can be encoded both as HKSCS and regular Big5, we prefer the latter. 0x8e69, 0x8e6f, 0x8e7e, 0x8eab, 0x8eb4, 0x8ecd, 0x8ed0, 0x8f57, 0x8f69, 0x8f6e, 0x8fcb, 0x8ffe, 0x906d, 0x907a, 0x90c4, 0x90dc, 0x90f1, 0x91bf, 0x92af, 0x92b0, 0x92b1, 0x92b2, 0x92d1, 0x9447, 0x94ca, 0x95d9, 0x96fc, 0x9975, 0x9b76, 0x9b78, 0x9b7b, 0x9bc6, 0x9bde, 0x9bec, 0x9bf6, 0x9c42, 0x9c53, 0x9c62, 0x9c68, 0x9c6b, 0x9c77, 0x9cbc, 0x9cbd, 0x9cd0, 0x9d57, 0x9d5a, 0x9dc4, 0x9def, 0x9dfb, 0x9ea9, 0x9eef, 0x9efd, 0x9f60, 0x9fcb, 0xa077, 0xa0dc, 0xa0df, 0x8fcc, 0x92c8, 0x9644, 0x96ed, // Step 2 of https://encoding.spec.whatwg.org/#index-big5-pointer: Use last pointer for U+2550, U+255E, U+2561, U+256A, U+5341, or U+5345 0xa2a4, 0xa2a5, 0xa2a7, 0xa2a6, 0xa2cc, 0xa2ce, ], }, 'cnbig5': 'big5hkscs', 'csbig5': 'big5hkscs', 'xxbig5': 'big5hkscs', }; "use strict"; // Update this array if you add/rename/remove files in this directory. // We support Browserify by skipping automatic module discovery and requiring modules directly. var modules = [ require("./internal"), require("./utf32"), require("./utf16"), require("./utf7"), require("./sbcs-codec"), require("./sbcs-data"), require("./sbcs-data-generated"), require("./dbcs-codec"), require("./dbcs-data"), ]; // Put all encoding/alias/codec definitions to single object and export it. for (var i = 0; i < modules.length; i++) { var module = modules[i]; for (var enc in module) if (Object.prototype.hasOwnProperty.call(module, enc)) exports[enc] = module[enc]; } "use strict"; var Buffer = require("safer-buffer").Buffer; // Export Node.js internal encodings. module.exports = { // Encodings utf8: { type: "_internal", bomAware: true}, cesu8: { type: "_internal", bomAware: true}, unicode11utf8: "utf8", ucs2: { type: "_internal", bomAware: true}, utf16le: "ucs2", binary: { type: "_internal" }, base64: { type: "_internal" }, hex: { type: "_internal" }, // Codec. _internal: InternalCodec, }; //------------------------------------------------------------------------------ function InternalCodec(codecOptions, iconv) { this.enc = codecOptions.encodingName; this.bomAware = codecOptions.bomAware; if (this.enc === "base64") this.encoder = InternalEncoderBase64; else if (this.enc === "cesu8") { this.enc = "utf8"; // Use utf8 for decoding. this.encoder = InternalEncoderCesu8; // Add decoder for versions of Node not supporting CESU-8 if (Buffer.from('eda0bdedb2a9', 'hex').toString() !== '💩') { this.decoder = InternalDecoderCesu8; this.defaultCharUnicode = iconv.defaultCharUnicode; } } } InternalCodec.prototype.encoder = InternalEncoder; InternalCodec.prototype.decoder = InternalDecoder; //------------------------------------------------------------------------------ // We use node.js internal decoder. Its signature is the same as ours. var StringDecoder = require('string_decoder').StringDecoder; if (!StringDecoder.prototype.end) // Node v0.8 doesn't have this method. StringDecoder.prototype.end = function() {}; function InternalDecoder(options, codec) { this.decoder = new StringDecoder(codec.enc); } InternalDecoder.prototype.write = function(buf) { if (!Buffer.isBuffer(buf)) { buf = Buffer.from(buf); } return this.decoder.write(buf); } InternalDecoder.prototype.end = function() { return this.decoder.end(); } //------------------------------------------------------------------------------ // Encoder is mostly trivial function InternalEncoder(options, codec) { this.enc = codec.enc; } InternalEncoder.prototype.write = function(str) { return Buffer.from(str, this.enc); } InternalEncoder.prototype.end = function() { } //------------------------------------------------------------------------------ // Except base64 encoder, which must keep its state. function InternalEncoderBase64(options, codec) { this.prevStr = ''; } InternalEncoderBase64.prototype.write = function(str) { str = this.prevStr + str; var completeQuads = str.length - (str.length % 4); this.prevStr = str.slice(completeQuads); str = str.slice(0, completeQuads); return Buffer.from(str, "base64"); } InternalEncoderBase64.prototype.end = function() { return Buffer.from(this.prevStr, "base64"); } //------------------------------------------------------------------------------ // CESU-8 encoder is also special. function InternalEncoderCesu8(options, codec) { } InternalEncoderCesu8.prototype.write = function(str) { var buf = Buffer.alloc(str.length * 3), bufIdx = 0; for (var i = 0; i < str.length; i++) { var charCode = str.charCodeAt(i); // Naive implementation, but it works because CESU-8 is especially easy // to convert from UTF-16 (which all JS strings are encoded in). if (charCode < 0x80) buf[bufIdx++] = charCode; else if (charCode < 0x800) { buf[bufIdx++] = 0xC0 + (charCode >>> 6); buf[bufIdx++] = 0x80 + (charCode & 0x3f); } else { // charCode will always be < 0x10000 in javascript. buf[bufIdx++] = 0xE0 + (charCode >>> 12); buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f); buf[bufIdx++] = 0x80 + (charCode & 0x3f); } } return buf.slice(0, bufIdx); } InternalEncoderCesu8.prototype.end = function() { } //------------------------------------------------------------------------------ // CESU-8 decoder is not implemented in Node v4.0+ function InternalDecoderCesu8(options, codec) { this.acc = 0; this.contBytes = 0; this.accBytes = 0; this.defaultCharUnicode = codec.defaultCharUnicode; } InternalDecoderCesu8.prototype.write = function(buf) { var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes, res = ''; for (var i = 0; i < buf.length; i++) { var curByte = buf[i]; if ((curByte & 0xC0) !== 0x80) { // Leading byte if (contBytes > 0) { // Previous code is invalid res += this.defaultCharUnicode; contBytes = 0; } if (curByte < 0x80) { // Single-byte code res += String.fromCharCode(curByte); } else if (curByte < 0xE0) { // Two-byte code acc = curByte & 0x1F; contBytes = 1; accBytes = 1; } else if (curByte < 0xF0) { // Three-byte code acc = curByte & 0x0F; contBytes = 2; accBytes = 1; } else { // Four or more are not supported for CESU-8. res += this.defaultCharUnicode; } } else { // Continuation byte if (contBytes > 0) { // We're waiting for it. acc = (acc << 6) | (curByte & 0x3f); contBytes--; accBytes++; if (contBytes === 0) { // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80) if (accBytes === 2 && acc < 0x80 && acc > 0) res += this.defaultCharUnicode; else if (accBytes === 3 && acc < 0x800) res += this.defaultCharUnicode; else // Actually add character. res += String.fromCharCode(acc); } } else { // Unexpected continuation byte res += this.defaultCharUnicode; } } } this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes; return res; } InternalDecoderCesu8.prototype.end = function() { var res = 0; if (this.contBytes > 0) res += this.defaultCharUnicode; return res; } "use strict"; var Buffer = require("safer-buffer").Buffer; // Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that // correspond to encoded bytes (if 128 - then lower half is ASCII). exports._sbcs = SBCSCodec; function SBCSCodec(codecOptions, iconv) { if (!codecOptions) throw new Error("SBCS codec is called without the data.") // Prepare char buffer for decoding. if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256)) throw new Error("Encoding '"+codecOptions.type+"' has incorrect 'chars' (must be of len 128 or 256)"); if (codecOptions.chars.length === 128) { var asciiString = ""; for (var i = 0; i < 128; i++) asciiString += String.fromCharCode(i); codecOptions.chars = asciiString + codecOptions.chars; } this.decodeBuf = Buffer.from(codecOptions.chars, 'ucs2'); // Encoding buffer. var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0)); for (var i = 0; i < codecOptions.chars.length; i++) encodeBuf[codecOptions.chars.charCodeAt(i)] = i; this.encodeBuf = encodeBuf; } SBCSCodec.prototype.encoder = SBCSEncoder; SBCSCodec.prototype.decoder = SBCSDecoder; function SBCSEncoder(options, codec) { this.encodeBuf = codec.encodeBuf; } SBCSEncoder.prototype.write = function(str) { var buf = Buffer.alloc(str.length); for (var i = 0; i < str.length; i++) buf[i] = this.encodeBuf[str.charCodeAt(i)]; return buf; } SBCSEncoder.prototype.end = function() { } function SBCSDecoder(options, codec) { this.decodeBuf = codec.decodeBuf; } SBCSDecoder.prototype.write = function(buf) { // Strings are immutable in JS -> we use ucs2 buffer to speed up computations. var decodeBuf = this.decodeBuf; var newBuf = Buffer.alloc(buf.length*2); var idx1 = 0, idx2 = 0; for (var i = 0; i < buf.length; i++) { idx1 = buf[i]*2; idx2 = i*2; newBuf[idx2] = decodeBuf[idx1]; newBuf[idx2+1] = decodeBuf[idx1+1]; } return newBuf.toString('ucs2'); } SBCSDecoder.prototype.end = function() { } "use strict"; // Generated data for sbcs codec. Don't edit manually. Regenerate using generation/gen-sbcs.js script. module.exports = { "437": "cp437", "737": "cp737", "775": "cp775", "850": "cp850", "852": "cp852", "855": "cp855", "856": "cp856", "857": "cp857", "858": "cp858", "860": "cp860", "861": "cp861", "862": "cp862", "863": "cp863", "864": "cp864", "865": "cp865", "866": "cp866", "869": "cp869", "874": "windows874", "922": "cp922", "1046": "cp1046", "1124": "cp1124", "1125": "cp1125", "1129": "cp1129", "1133": "cp1133", "1161": "cp1161", "1162": "cp1162", "1163": "cp1163", "1250": "windows1250", "1251": "windows1251", "1252": "windows1252", "1253": "windows1253", "1254": "windows1254", "1255": "windows1255", "1256": "windows1256", "1257": "windows1257", "1258": "windows1258", "28591": "iso88591", "28592": "iso88592", "28593": "iso88593", "28594": "iso88594", "28595": "iso88595", "28596": "iso88596", "28597": "iso88597", "28598": "iso88598", "28599": "iso88599", "28600": "iso885910", "28601": "iso885911", "28603": "iso885913", "28604": "iso885914", "28605": "iso885915", "28606": "iso885916", "windows874": { "type": "_sbcs", "chars": "€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" }, "win874": "windows874", "cp874": "windows874", "windows1250": { "type": "_sbcs", "chars": "€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" }, "win1250": "windows1250", "cp1250": "windows1250", "windows1251": { "type": "_sbcs", "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" }, "win1251": "windows1251", "cp1251": "windows1251", "windows1252": { "type": "_sbcs", "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, "win1252": "windows1252", "cp1252": "windows1252", "windows1253": { "type": "_sbcs", "chars": "€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" }, "win1253": "windows1253", "cp1253": "windows1253", "windows1254": { "type": "_sbcs", "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" }, "win1254": "windows1254", "cp1254": "windows1254", "windows1255": { "type": "_sbcs", "chars": "€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" }, "win1255": "windows1255", "cp1255": "windows1255", "windows1256": { "type": "_sbcs", "chars": "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے" }, "win1256": "windows1256", "cp1256": "windows1256", "windows1257": { "type": "_sbcs", "chars": "€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙" }, "win1257": "windows1257", "cp1257": "windows1257", "windows1258": { "type": "_sbcs", "chars": "€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" }, "win1258": "windows1258", "cp1258": "windows1258", "iso88591": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, "cp28591": "iso88591", "iso88592": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" }, "cp28592": "iso88592", "iso88593": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�ݰħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙" }, "cp28593": "iso88593", "iso88594": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤Ĩϧ¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩšēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖרŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙" }, "cp28594": "iso88594", "iso88595": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ" }, "cp28595": "iso88595", "iso88596": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������" }, "cp28596": "iso88596", "iso88597": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" }, "cp28597": "iso88597", "iso88598": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" }, "cp28598": "iso88598", "iso88599": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" }, "cp28599": "iso88599", "iso885910": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨͧĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ" }, "cp28600": "iso885910", "iso885911": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" }, "cp28601": "iso885911", "iso885913": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’" }, "cp28603": "iso885913", "iso885914": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ" }, "cp28604": "iso885914", "iso885915": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, "cp28605": "iso885915", "iso885916": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Чš©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ" }, "cp28606": "iso885916", "cp437": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm437": "cp437", "csibm437": "cp437", "cp737": { "type": "_sbcs", "chars": "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ " }, "ibm737": "cp737", "csibm737": "cp737", "cp775": { "type": "_sbcs", "chars": "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£Ø×¤ĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ " }, "ibm775": "cp775", "csibm775": "cp775", "cp850": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " }, "ibm850": "cp850", "csibm850": "cp850", "cp852": { "type": "_sbcs", "chars": "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ " }, "ibm852": "cp852", "csibm852": "cp852", "cp855": { "type": "_sbcs", "chars": "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ " }, "ibm855": "cp855", "csibm855": "cp855", "cp856": { "type": "_sbcs", "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ " }, "ibm856": "cp856", "csibm856": "cp856", "cp857": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ " }, "ibm857": "cp857", "csibm857": "cp857", "cp858": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " }, "ibm858": "cp858", "csibm858": "cp858", "cp860": { "type": "_sbcs", "chars": "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm860": "cp860", "csibm860": "cp860", "cp861": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm861": "cp861", "csibm861": "cp861", "cp862": { "type": "_sbcs", "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm862": "cp862", "csibm862": "cp862", "cp863": { "type": "_sbcs", "chars": "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm863": "cp863", "csibm863": "cp863", "cp864": { "type": "_sbcs", "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�" }, "ibm864": "cp864", "csibm864": "cp864", "cp865": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm865": "cp865", "csibm865": "cp865", "cp866": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ " }, "ibm866": "cp866", "csibm866": "cp866", "cp869": { "type": "_sbcs", "chars": "������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ " }, "ibm869": "cp869", "csibm869": "cp869", "cp922": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ" }, "ibm922": "cp922", "csibm922": "cp922", "cp1046": { "type": "_sbcs", "chars": "ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�" }, "ibm1046": "cp1046", "csibm1046": "cp1046", "cp1124": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ" }, "ibm1124": "cp1124", "csibm1124": "cp1124", "cp1125": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ " }, "ibm1125": "cp1125", "csibm1125": "cp1125", "cp1129": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" }, "ibm1129": "cp1129", "csibm1129": "cp1129", "cp1133": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�" }, "ibm1133": "cp1133", "csibm1133": "cp1133", "cp1161": { "type": "_sbcs", "chars": "��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ " }, "ibm1161": "cp1161", "csibm1161": "cp1161", "cp1162": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" }, "ibm1162": "cp1162", "csibm1162": "cp1162", "cp1163": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" }, "ibm1163": "cp1163", "csibm1163": "cp1163", "maccroatian": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ" }, "maccyrillic": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" }, "macgreek": { "type": "_sbcs", "chars": "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�" }, "maciceland": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" }, "macroman": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" }, "macromania": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" }, "macthai": { "type": "_sbcs", "chars": "«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����" }, "macturkish": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ" }, "macukraine": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" }, "koi8r": { "type": "_sbcs", "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" }, "koi8u": { "type": "_sbcs", "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" }, "koi8ru": { "type": "_sbcs", "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" }, "koi8t": { "type": "_sbcs", "chars": "қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" }, "armscii8": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�" }, "rk1048": { "type": "_sbcs", "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" }, "tcvn": { "type": "_sbcs", "chars": "\u0000ÚỤ\u0003ỪỬỮ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010ỨỰỲỶỸÝỴ\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ" }, "georgianacademy": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, "georgianps": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, "pt154": { "type": "_sbcs", "chars": "ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" }, "viscii": { "type": "_sbcs", "chars": "\u0000\u0001Ẳ\u0003\u0004ẴẪ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013Ỷ\u0015\u0016\u0017\u0018Ỹ\u001a\u001b\u001c\u001dỴ\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ" }, "iso646cn": { "type": "_sbcs", "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" }, "iso646jp": { "type": "_sbcs", "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" }, "hproman8": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�" }, "macintosh": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" }, "ascii": { "type": "_sbcs", "chars": "��������������������������������������������������������������������������������������������������������������������������������" }, "tis620": { "type": "_sbcs", "chars": "���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" } }"use strict"; // Manually added data to be used by sbcs codec in addition to generated one. module.exports = { // Not supported by iconv, not sure why. "10029": "maccenteuro", "maccenteuro": { "type": "_sbcs", "chars": "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ" }, "808": "cp808", "ibm808": "cp808", "cp808": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ " }, "mik": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "cp720": { "type": "_sbcs", "chars": "\x80\x81éâ\x84à\x86çêëèïî\x8d\x8e\x8f\x90\u0651\u0652ô¤ـûùءآأؤ£إئابةتثجحخدذرزسشص«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغفµقكلمنهوىي≡\u064b\u064c\u064d\u064e\u064f\u0650≈°∙·√ⁿ²■\u00a0" }, // Aliases of generated encodings. "ascii8bit": "ascii", "usascii": "ascii", "ansix34": "ascii", "ansix341968": "ascii", "ansix341986": "ascii", "csascii": "ascii", "cp367": "ascii", "ibm367": "ascii", "isoir6": "ascii", "iso646us": "ascii", "iso646irv": "ascii", "us": "ascii", "latin1": "iso88591", "latin2": "iso88592", "latin3": "iso88593", "latin4": "iso88594", "latin5": "iso88599", "latin6": "iso885910", "latin7": "iso885913", "latin8": "iso885914", "latin9": "iso885915", "latin10": "iso885916", "csisolatin1": "iso88591", "csisolatin2": "iso88592", "csisolatin3": "iso88593", "csisolatin4": "iso88594", "csisolatincyrillic": "iso88595", "csisolatinarabic": "iso88596", "csisolatingreek" : "iso88597", "csisolatinhebrew": "iso88598", "csisolatin5": "iso88599", "csisolatin6": "iso885910", "l1": "iso88591", "l2": "iso88592", "l3": "iso88593", "l4": "iso88594", "l5": "iso88599", "l6": "iso885910", "l7": "iso885913", "l8": "iso885914", "l9": "iso885915", "l10": "iso885916", "isoir14": "iso646jp", "isoir57": "iso646cn", "isoir100": "iso88591", "isoir101": "iso88592", "isoir109": "iso88593", "isoir110": "iso88594", "isoir144": "iso88595", "isoir127": "iso88596", "isoir126": "iso88597", "isoir138": "iso88598", "isoir148": "iso88599", "isoir157": "iso885910", "isoir166": "tis620", "isoir179": "iso885913", "isoir199": "iso885914", "isoir203": "iso885915", "isoir226": "iso885916", "cp819": "iso88591", "ibm819": "iso88591", "cyrillic": "iso88595", "arabic": "iso88596", "arabic8": "iso88596", "ecma114": "iso88596", "asmo708": "iso88596", "greek" : "iso88597", "greek8" : "iso88597", "ecma118" : "iso88597", "elot928" : "iso88597", "hebrew": "iso88598", "hebrew8": "iso88598", "turkish": "iso88599", "turkish8": "iso88599", "thai": "iso885911", "thai8": "iso885911", "celtic": "iso885914", "celtic8": "iso885914", "isoceltic": "iso885914", "tis6200": "tis620", "tis62025291": "tis620", "tis62025330": "tis620", "10000": "macroman", "10006": "macgreek", "10007": "maccyrillic", "10079": "maciceland", "10081": "macturkish", "cspc8codepage437": "cp437", "cspc775baltic": "cp775", "cspc850multilingual": "cp850", "cspcp852": "cp852", "cspc862latinhebrew": "cp862", "cpgr": "cp869", "msee": "cp1250", "mscyrl": "cp1251", "msansi": "cp1252", "msgreek": "cp1253", "msturk": "cp1254", "mshebr": "cp1255", "msarab": "cp1256", "winbaltrim": "cp1257", "cp20866": "koi8r", "20866": "koi8r", "ibm878": "koi8r", "cskoi8r": "koi8r", "cp21866": "koi8u", "21866": "koi8u", "ibm1168": "koi8u", "strk10482002": "rk1048", "tcvn5712": "tcvn", "tcvn57121": "tcvn", "gb198880": "iso646cn", "cn": "iso646cn", "csiso14jisc6220ro": "iso646jp", "jisc62201969ro": "iso646jp", "jp": "iso646jp", "cshproman8": "hproman8", "r8": "hproman8", "roman8": "hproman8", "xroman8": "hproman8", "ibm1051": "hproman8", "mac": "macintosh", "csmacintosh": "macintosh", }; "use strict"; var Buffer = require("safer-buffer").Buffer; // Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js // == UTF16-BE codec. ========================================================== exports.utf16be = Utf16BECodec; function Utf16BECodec() { } Utf16BECodec.prototype.encoder = Utf16BEEncoder; Utf16BECodec.prototype.decoder = Utf16BEDecoder; Utf16BECodec.prototype.bomAware = true; // -- Encoding function Utf16BEEncoder() { } Utf16BEEncoder.prototype.write = function(str) { var buf = Buffer.from(str, 'ucs2'); for (var i = 0; i < buf.length; i += 2) { var tmp = buf[i]; buf[i] = buf[i+1]; buf[i+1] = tmp; } return buf; } Utf16BEEncoder.prototype.end = function() { } // -- Decoding function Utf16BEDecoder() { this.overflowByte = -1; } Utf16BEDecoder.prototype.write = function(buf) { if (buf.length == 0) return ''; var buf2 = Buffer.alloc(buf.length + 1), i = 0, j = 0; if (this.overflowByte !== -1) { buf2[0] = buf[0]; buf2[1] = this.overflowByte; i = 1; j = 2; } for (; i < buf.length-1; i += 2, j+= 2) { buf2[j] = buf[i+1]; buf2[j+1] = buf[i]; } this.overflowByte = (i == buf.length-1) ? buf[buf.length-1] : -1; return buf2.slice(0, j).toString('ucs2'); } Utf16BEDecoder.prototype.end = function() { this.overflowByte = -1; } // == UTF-16 codec ============================================================= // Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic. // Defaults to UTF-16LE, as it's prevalent and default in Node. // http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le // Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'}); // Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false). exports.utf16 = Utf16Codec; function Utf16Codec(codecOptions, iconv) { this.iconv = iconv; } Utf16Codec.prototype.encoder = Utf16Encoder; Utf16Codec.prototype.decoder = Utf16Decoder; // -- Encoding (pass-through) function Utf16Encoder(options, codec) { options = options || {}; if (options.addBOM === undefined) options.addBOM = true; this.encoder = codec.iconv.getEncoder('utf-16le', options); } Utf16Encoder.prototype.write = function(str) { return this.encoder.write(str); } Utf16Encoder.prototype.end = function() { return this.encoder.end(); } // -- Decoding function Utf16Decoder(options, codec) { this.decoder = null; this.initialBufs = []; this.initialBufsLen = 0; this.options = options || {}; this.iconv = codec.iconv; } Utf16Decoder.prototype.write = function(buf) { if (!this.decoder) { // Codec is not chosen yet. Accumulate initial bytes. this.initialBufs.push(buf); this.initialBufsLen += buf.length; if (this.initialBufsLen < 16) // We need more bytes to use space heuristic (see below) return ''; // We have enough bytes -> detect endianness. var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); this.decoder = this.iconv.getDecoder(encoding, this.options); var resStr = ''; for (var i = 0; i < this.initialBufs.length; i++) resStr += this.decoder.write(this.initialBufs[i]); this.initialBufs.length = this.initialBufsLen = 0; return resStr; } return this.decoder.write(buf); } Utf16Decoder.prototype.end = function() { if (!this.decoder) { var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); this.decoder = this.iconv.getDecoder(encoding, this.options); var resStr = ''; for (var i = 0; i < this.initialBufs.length; i++) resStr += this.decoder.write(this.initialBufs[i]); var trail = this.decoder.end(); if (trail) resStr += trail; this.initialBufs.length = this.initialBufsLen = 0; return resStr; } return this.decoder.end(); } function detectEncoding(bufs, defaultEncoding) { var b = []; var charsProcessed = 0; var asciiCharsLE = 0, asciiCharsBE = 0; // Number of ASCII chars when decoded as LE or BE. outer_loop: for (var i = 0; i < bufs.length; i++) { var buf = bufs[i]; for (var j = 0; j < buf.length; j++) { b.push(buf[j]); if (b.length === 2) { if (charsProcessed === 0) { // Check BOM first. if (b[0] === 0xFF && b[1] === 0xFE) return 'utf-16le'; if (b[0] === 0xFE && b[1] === 0xFF) return 'utf-16be'; } if (b[0] === 0 && b[1] !== 0) asciiCharsBE++; if (b[0] !== 0 && b[1] === 0) asciiCharsLE++; b.length = 0; charsProcessed++; if (charsProcessed >= 100) { break outer_loop; } } } } // Make decisions. // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon. // So, we count ASCII as if it was LE or BE, and decide from that. if (asciiCharsBE > asciiCharsLE) return 'utf-16be'; if (asciiCharsBE < asciiCharsLE) return 'utf-16le'; // Couldn't decide (likely all zeros or not enough data). return defaultEncoding || 'utf-16le'; } 'use strict'; var Buffer = require('safer-buffer').Buffer; // == UTF32-LE/BE codec. ========================================================== exports._utf32 = Utf32Codec; function Utf32Codec(codecOptions, iconv) { this.iconv = iconv; this.bomAware = true; this.isLE = codecOptions.isLE; } exports.utf32le = { type: '_utf32', isLE: true }; exports.utf32be = { type: '_utf32', isLE: false }; // Aliases exports.ucs4le = 'utf32le'; exports.ucs4be = 'utf32be'; Utf32Codec.prototype.encoder = Utf32Encoder; Utf32Codec.prototype.decoder = Utf32Decoder; // -- Encoding function Utf32Encoder(options, codec) { this.isLE = codec.isLE; this.highSurrogate = 0; } Utf32Encoder.prototype.write = function(str) { var src = Buffer.from(str, 'ucs2'); var dst = Buffer.alloc(src.length * 2); var write32 = this.isLE ? dst.writeUInt32LE : dst.writeUInt32BE; var offset = 0; for (var i = 0; i < src.length; i += 2) { var code = src.readUInt16LE(i); var isHighSurrogate = (0xD800 <= code && code < 0xDC00); var isLowSurrogate = (0xDC00 <= code && code < 0xE000); if (this.highSurrogate) { if (isHighSurrogate || !isLowSurrogate) { // There shouldn't be two high surrogates in a row, nor a high surrogate which isn't followed by a low // surrogate. If this happens, keep the pending high surrogate as a stand-alone semi-invalid character // (technically wrong, but expected by some applications, like Windows file names). write32.call(dst, this.highSurrogate, offset); offset += 4; } else { // Create 32-bit value from high and low surrogates; var codepoint = (((this.highSurrogate - 0xD800) << 10) | (code - 0xDC00)) + 0x10000; write32.call(dst, codepoint, offset); offset += 4; this.highSurrogate = 0; continue; } } if (isHighSurrogate) this.highSurrogate = code; else { // Even if the current character is a low surrogate, with no previous high surrogate, we'll // encode it as a semi-invalid stand-alone character for the same reasons expressed above for // unpaired high surrogates. write32.call(dst, code, offset); offset += 4; this.highSurrogate = 0; } } if (offset < dst.length) dst = dst.slice(0, offset); return dst; }; Utf32Encoder.prototype.end = function() { // Treat any leftover high surrogate as a semi-valid independent character. if (!this.highSurrogate) return; var buf = Buffer.alloc(4); if (this.isLE) buf.writeUInt32LE(this.highSurrogate, 0); else buf.writeUInt32BE(this.highSurrogate, 0); this.highSurrogate = 0; return buf; }; // -- Decoding function Utf32Decoder(options, codec) { this.isLE = codec.isLE; this.badChar = codec.iconv.defaultCharUnicode.charCodeAt(0); this.overflow = []; } Utf32Decoder.prototype.write = function(src) { if (src.length === 0) return ''; var i = 0; var codepoint = 0; var dst = Buffer.alloc(src.length + 4); var offset = 0; var isLE = this.isLE; var overflow = this.overflow; var badChar = this.badChar; if (overflow.length > 0) { for (; i < src.length && overflow.length < 4; i++) overflow.push(src[i]); if (overflow.length === 4) { // NOTE: codepoint is a signed int32 and can be negative. // NOTE: We copied this block from below to help V8 optimize it (it works with array, not buffer). if (isLE) { codepoint = overflow[i] | (overflow[i+1] << 8) | (overflow[i+2] << 16) | (overflow[i+3] << 24); } else { codepoint = overflow[i+3] | (overflow[i+2] << 8) | (overflow[i+1] << 16) | (overflow[i] << 24); } overflow.length = 0; offset = _writeCodepoint(dst, offset, codepoint, badChar); } } // Main loop. Should be as optimized as possible. for (; i < src.length - 3; i += 4) { // NOTE: codepoint is a signed int32 and can be negative. if (isLE) { codepoint = src[i] | (src[i+1] << 8) | (src[i+2] << 16) | (src[i+3] << 24); } else { codepoint = src[i+3] | (src[i+2] << 8) | (src[i+1] << 16) | (src[i] << 24); } offset = _writeCodepoint(dst, offset, codepoint, badChar); } // Keep overflowing bytes. for (; i < src.length; i++) { overflow.push(src[i]); } return dst.slice(0, offset).toString('ucs2'); }; function _writeCodepoint(dst, offset, codepoint, badChar) { // NOTE: codepoint is signed int32 and can be negative. We keep it that way to help V8 with optimizations. if (codepoint < 0 || codepoint > 0x10FFFF) { // Not a valid Unicode codepoint codepoint = badChar; } // Ephemeral Planes: Write high surrogate. if (codepoint >= 0x10000) { codepoint -= 0x10000; var high = 0xD800 | (codepoint >> 10); dst[offset++] = high & 0xff; dst[offset++] = high >> 8; // Low surrogate is written below. var codepoint = 0xDC00 | (codepoint & 0x3FF); } // Write BMP char or low surrogate. dst[offset++] = codepoint & 0xff; dst[offset++] = codepoint >> 8; return offset; }; Utf32Decoder.prototype.end = function() { this.overflow.length = 0; }; // == UTF-32 Auto codec ============================================================= // Decoder chooses automatically from UTF-32LE and UTF-32BE using BOM and space-based heuristic. // Defaults to UTF-32LE. http://en.wikipedia.org/wiki/UTF-32 // Encoder/decoder default can be changed: iconv.decode(buf, 'utf32', {defaultEncoding: 'utf-32be'}); // Encoder prepends BOM (which can be overridden with (addBOM: false}). exports.utf32 = Utf32AutoCodec; exports.ucs4 = 'utf32'; function Utf32AutoCodec(options, iconv) { this.iconv = iconv; } Utf32AutoCodec.prototype.encoder = Utf32AutoEncoder; Utf32AutoCodec.prototype.decoder = Utf32AutoDecoder; // -- Encoding function Utf32AutoEncoder(options, codec) { options = options || {}; if (options.addBOM === undefined) options.addBOM = true; this.encoder = codec.iconv.getEncoder(options.defaultEncoding || 'utf-32le', options); } Utf32AutoEncoder.prototype.write = function(str) { return this.encoder.write(str); }; Utf32AutoEncoder.prototype.end = function() { return this.encoder.end(); }; // -- Decoding function Utf32AutoDecoder(options, codec) { this.decoder = null; this.initialBufs = []; this.initialBufsLen = 0; this.options = options || {}; this.iconv = codec.iconv; } Utf32AutoDecoder.prototype.write = function(buf) { if (!this.decoder) { // Codec is not chosen yet. Accumulate initial bytes. this.initialBufs.push(buf); this.initialBufsLen += buf.length; if (this.initialBufsLen < 32) // We need more bytes to use space heuristic (see below) return ''; // We have enough bytes -> detect endianness. var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); this.decoder = this.iconv.getDecoder(encoding, this.options); var resStr = ''; for (var i = 0; i < this.initialBufs.length; i++) resStr += this.decoder.write(this.initialBufs[i]); this.initialBufs.length = this.initialBufsLen = 0; return resStr; } return this.decoder.write(buf); }; Utf32AutoDecoder.prototype.end = function() { if (!this.decoder) { var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); this.decoder = this.iconv.getDecoder(encoding, this.options); var resStr = ''; for (var i = 0; i < this.initialBufs.length; i++) resStr += this.decoder.write(this.initialBufs[i]); var trail = this.decoder.end(); if (trail) resStr += trail; this.initialBufs.length = this.initialBufsLen = 0; return resStr; } return this.decoder.end(); }; function detectEncoding(bufs, defaultEncoding) { var b = []; var charsProcessed = 0; var invalidLE = 0, invalidBE = 0; // Number of invalid chars when decoded as LE or BE. var bmpCharsLE = 0, bmpCharsBE = 0; // Number of BMP chars when decoded as LE or BE. outer_loop: for (var i = 0; i < bufs.length; i++) { var buf = bufs[i]; for (var j = 0; j < buf.length; j++) { b.push(buf[j]); if (b.length === 4) { if (charsProcessed === 0) { // Check BOM first. if (b[0] === 0xFF && b[1] === 0xFE && b[2] === 0 && b[3] === 0) { return 'utf-32le'; } if (b[0] === 0 && b[1] === 0 && b[2] === 0xFE && b[3] === 0xFF) { return 'utf-32be'; } } if (b[0] !== 0 || b[1] > 0x10) invalidBE++; if (b[3] !== 0 || b[2] > 0x10) invalidLE++; if (b[0] === 0 && b[1] === 0 && (b[2] !== 0 || b[3] !== 0)) bmpCharsBE++; if ((b[0] !== 0 || b[1] !== 0) && b[2] === 0 && b[3] === 0) bmpCharsLE++; b.length = 0; charsProcessed++; if (charsProcessed >= 100) { break outer_loop; } } } } // Make decisions. if (bmpCharsBE - invalidBE > bmpCharsLE - invalidLE) return 'utf-32be'; if (bmpCharsBE - invalidBE < bmpCharsLE - invalidLE) return 'utf-32le'; // Couldn't decide (likely all zeros or not enough data). return defaultEncoding || 'utf-32le'; } "use strict"; var Buffer = require("safer-buffer").Buffer; // UTF-7 codec, according to https://tools.ietf.org/html/rfc2152 // See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3 exports.utf7 = Utf7Codec; exports.unicode11utf7 = 'utf7'; // Alias UNICODE-1-1-UTF-7 function Utf7Codec(codecOptions, iconv) { this.iconv = iconv; }; Utf7Codec.prototype.encoder = Utf7Encoder; Utf7Codec.prototype.decoder = Utf7Decoder; Utf7Codec.prototype.bomAware = true; // -- Encoding var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g; function Utf7Encoder(options, codec) { this.iconv = codec.iconv; } Utf7Encoder.prototype.write = function(str) { // Naive implementation. // Non-direct chars are encoded as "+-"; single "+" char is encoded as "+-". return Buffer.from(str.replace(nonDirectChars, function(chunk) { return "+" + (chunk === '+' ? '' : this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, '')) + "-"; }.bind(this))); } Utf7Encoder.prototype.end = function() { } // -- Decoding function Utf7Decoder(options, codec) { this.iconv = codec.iconv; this.inBase64 = false; this.base64Accum = ''; } var base64Regex = /[A-Za-z0-9\/+]/; var base64Chars = []; for (var i = 0; i < 256; i++) base64Chars[i] = base64Regex.test(String.fromCharCode(i)); var plusChar = '+'.charCodeAt(0), minusChar = '-'.charCodeAt(0), andChar = '&'.charCodeAt(0); Utf7Decoder.prototype.write = function(buf) { var res = "", lastI = 0, inBase64 = this.inBase64, base64Accum = this.base64Accum; // The decoder is more involved as we must handle chunks in stream. for (var i = 0; i < buf.length; i++) { if (!inBase64) { // We're in direct mode. // Write direct chars until '+' if (buf[i] == plusChar) { res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. lastI = i+1; inBase64 = true; } } else { // We decode base64. if (!base64Chars[buf[i]]) { // Base64 ended. if (i == lastI && buf[i] == minusChar) {// "+-" -> "+" res += "+"; } else { var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii"); res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); } if (buf[i] != minusChar) // Minus is absorbed after base64. i--; lastI = i+1; inBase64 = false; base64Accum = ''; } } } if (!inBase64) { res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. } else { var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii"); var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. b64str = b64str.slice(0, canBeDecoded); res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); } this.inBase64 = inBase64; this.base64Accum = base64Accum; return res; } Utf7Decoder.prototype.end = function() { var res = ""; if (this.inBase64 && this.base64Accum.length > 0) res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); this.inBase64 = false; this.base64Accum = ''; return res; } // UTF-7-IMAP codec. // RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3) // Differences: // * Base64 part is started by "&" instead of "+" // * Direct characters are 0x20-0x7E, except "&" (0x26) // * In Base64, "," is used instead of "/" // * Base64 must not be used to represent direct characters. // * No implicit shift back from Base64 (should always end with '-') // * String must end in non-shifted position. // * "-&" while in base64 is not allowed. exports.utf7imap = Utf7IMAPCodec; function Utf7IMAPCodec(codecOptions, iconv) { this.iconv = iconv; }; Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder; Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder; Utf7IMAPCodec.prototype.bomAware = true; // -- Encoding function Utf7IMAPEncoder(options, codec) { this.iconv = codec.iconv; this.inBase64 = false; this.base64Accum = Buffer.alloc(6); this.base64AccumIdx = 0; } Utf7IMAPEncoder.prototype.write = function(str) { var inBase64 = this.inBase64, base64Accum = this.base64Accum, base64AccumIdx = this.base64AccumIdx, buf = Buffer.alloc(str.length*5 + 10), bufIdx = 0; for (var i = 0; i < str.length; i++) { var uChar = str.charCodeAt(i); if (0x20 <= uChar && uChar <= 0x7E) { // Direct character or '&'. if (inBase64) { if (base64AccumIdx > 0) { bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); base64AccumIdx = 0; } buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. inBase64 = false; } if (!inBase64) { buf[bufIdx++] = uChar; // Write direct character if (uChar === andChar) // Ampersand -> '&-' buf[bufIdx++] = minusChar; } } else { // Non-direct character if (!inBase64) { buf[bufIdx++] = andChar; // Write '&', then go to base64 mode. inBase64 = true; } if (inBase64) { base64Accum[base64AccumIdx++] = uChar >> 8; base64Accum[base64AccumIdx++] = uChar & 0xFF; if (base64AccumIdx == base64Accum.length) { bufIdx += buf.write(base64Accum.toString('base64').replace(/\//g, ','), bufIdx); base64AccumIdx = 0; } } } } this.inBase64 = inBase64; this.base64AccumIdx = base64AccumIdx; return buf.slice(0, bufIdx); } Utf7IMAPEncoder.prototype.end = function() { var buf = Buffer.alloc(10), bufIdx = 0; if (this.inBase64) { if (this.base64AccumIdx > 0) { bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); this.base64AccumIdx = 0; } buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. this.inBase64 = false; } return buf.slice(0, bufIdx); } // -- Decoding function Utf7IMAPDecoder(options, codec) { this.iconv = codec.iconv; this.inBase64 = false; this.base64Accum = ''; } var base64IMAPChars = base64Chars.slice(); base64IMAPChars[','.charCodeAt(0)] = true; Utf7IMAPDecoder.prototype.write = function(buf) { var res = "", lastI = 0, inBase64 = this.inBase64, base64Accum = this.base64Accum; // The decoder is more involved as we must handle chunks in stream. // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end). for (var i = 0; i < buf.length; i++) { if (!inBase64) { // We're in direct mode. // Write direct chars until '&' if (buf[i] == andChar) { res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. lastI = i+1; inBase64 = true; } } else { // We decode base64. if (!base64IMAPChars[buf[i]]) { // Base64 ended. if (i == lastI && buf[i] == minusChar) { // "&-" -> "&" res += "&"; } else { var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii").replace(/,/g, '/'); res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); } if (buf[i] != minusChar) // Minus may be absorbed after base64. i--; lastI = i+1; inBase64 = false; base64Accum = ''; } } } if (!inBase64) { res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. } else { var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii").replace(/,/g, '/'); var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. b64str = b64str.slice(0, canBeDecoded); res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); } this.inBase64 = inBase64; this.base64Accum = base64Accum; return res; } Utf7IMAPDecoder.prototype.end = function() { var res = ""; if (this.inBase64 && this.base64Accum.length > 0) res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); this.inBase64 = false; this.base64Accum = ''; return res; } "use strict"; var BOMChar = '\uFEFF'; exports.PrependBOM = PrependBOMWrapper function PrependBOMWrapper(encoder, options) { this.encoder = encoder; this.addBOM = true; } PrependBOMWrapper.prototype.write = function(str) { if (this.addBOM) { str = BOMChar + str; this.addBOM = false; } return this.encoder.write(str); } PrependBOMWrapper.prototype.end = function() { return this.encoder.end(); } //------------------------------------------------------------------------------ exports.StripBOM = StripBOMWrapper; function StripBOMWrapper(decoder, options) { this.decoder = decoder; this.pass = false; this.options = options || {}; } StripBOMWrapper.prototype.write = function(buf) { var res = this.decoder.write(buf); if (this.pass || !res) return res; if (res[0] === BOMChar) { res = res.slice(1); if (typeof this.options.stripBOM === 'function') this.options.stripBOM(); } this.pass = true; return res; } StripBOMWrapper.prototype.end = function() { return this.decoder.end(); } "use strict"; var Buffer = require("safer-buffer").Buffer; var bomHandling = require("./bom-handling"), iconv = module.exports; // All codecs and aliases are kept here, keyed by encoding name/alias. // They are lazy loaded in `iconv.getCodec` from `encodings/index.js`. iconv.encodings = null; // Characters emitted in case of error. iconv.defaultCharUnicode = '�'; iconv.defaultCharSingleByte = '?'; // Public API. iconv.encode = function encode(str, encoding, options) { str = "" + (str || ""); // Ensure string. var encoder = iconv.getEncoder(encoding, options); var res = encoder.write(str); var trail = encoder.end(); return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res; } iconv.decode = function decode(buf, encoding, options) { if (typeof buf === 'string') { if (!iconv.skipDecodeWarning) { console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding'); iconv.skipDecodeWarning = true; } buf = Buffer.from("" + (buf || ""), "binary"); // Ensure buffer. } var decoder = iconv.getDecoder(encoding, options); var res = decoder.write(buf); var trail = decoder.end(); return trail ? (res + trail) : res; } iconv.encodingExists = function encodingExists(enc) { try { iconv.getCodec(enc); return true; } catch (e) { return false; } } // Legacy aliases to convert functions iconv.toEncoding = iconv.encode; iconv.fromEncoding = iconv.decode; // Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache. iconv._codecDataCache = {}; iconv.getCodec = function getCodec(encoding) { if (!iconv.encodings) iconv.encodings = require("../encodings"); // Lazy load all encoding definitions. // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. var enc = iconv._canonicalizeEncoding(encoding); // Traverse iconv.encodings to find actual codec. var codecOptions = {}; while (true) { var codec = iconv._codecDataCache[enc]; if (codec) return codec; var codecDef = iconv.encodings[enc]; switch (typeof codecDef) { case "string": // Direct alias to other encoding. enc = codecDef; break; case "object": // Alias with options. Can be layered. for (var key in codecDef) codecOptions[key] = codecDef[key]; if (!codecOptions.encodingName) codecOptions.encodingName = enc; enc = codecDef.type; break; case "function": // Codec itself. if (!codecOptions.encodingName) codecOptions.encodingName = enc; // The codec function must load all tables and return object with .encoder and .decoder methods. // It'll be called only once (for each different options object). codec = new codecDef(codecOptions, iconv); iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later. return codec; default: throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')"); } } } iconv._canonicalizeEncoding = function(encoding) { // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. return (''+encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, ""); } iconv.getEncoder = function getEncoder(encoding, options) { var codec = iconv.getCodec(encoding), encoder = new codec.encoder(options, codec); if (codec.bomAware && options && options.addBOM) encoder = new bomHandling.PrependBOM(encoder, options); return encoder; } iconv.getDecoder = function getDecoder(encoding, options) { var codec = iconv.getCodec(encoding), decoder = new codec.decoder(options, codec); if (codec.bomAware && !(options && options.stripBOM === false)) decoder = new bomHandling.StripBOM(decoder, options); return decoder; } // Streaming API // NOTE: Streaming API naturally depends on 'stream' module from Node.js. Unfortunately in browser environments this module can add // up to 100Kb to the output bundle. To avoid unnecessary code bloat, we don't enable Streaming API in browser by default. // If you would like to enable it explicitly, please add the following code to your app: // > iconv.enableStreamingAPI(require('stream')); iconv.enableStreamingAPI = function enableStreamingAPI(stream_module) { if (iconv.supportsStreams) return; // Dependency-inject stream module to create IconvLite stream classes. var streams = require("./streams")(stream_module); // Not public API yet, but expose the stream classes. iconv.IconvLiteEncoderStream = streams.IconvLiteEncoderStream; iconv.IconvLiteDecoderStream = streams.IconvLiteDecoderStream; // Streaming API. iconv.encodeStream = function encodeStream(encoding, options) { return new iconv.IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options); } iconv.decodeStream = function decodeStream(encoding, options) { return new iconv.IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options); } iconv.supportsStreams = true; } // Enable Streaming API automatically if 'stream' module is available and non-empty (the majority of environments). var stream_module; try { stream_module = require("stream"); } catch (e) {} if (stream_module && stream_module.Transform) { iconv.enableStreamingAPI(stream_module); } else { // In rare cases where 'stream' module is not available by default, throw a helpful exception. iconv.encodeStream = iconv.decodeStream = function() { throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it."); }; } if ("Ā" != "\u0100") { console.error("iconv-lite warning: js files use non-utf8 encoding. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info."); } "use strict"; var Buffer = require("safer-buffer").Buffer; // NOTE: Due to 'stream' module being pretty large (~100Kb, significant in browser environments), // we opt to dependency-inject it instead of creating a hard dependency. module.exports = function(stream_module) { var Transform = stream_module.Transform; // == Encoder stream ======================================================= function IconvLiteEncoderStream(conv, options) { this.conv = conv; options = options || {}; options.decodeStrings = false; // We accept only strings, so we don't need to decode them. Transform.call(this, options); } IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, { constructor: { value: IconvLiteEncoderStream } }); IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) { if (typeof chunk != 'string') return done(new Error("Iconv encoding stream needs strings as its input.")); try { var res = this.conv.write(chunk); if (res && res.length) this.push(res); done(); } catch (e) { done(e); } } IconvLiteEncoderStream.prototype._flush = function(done) { try { var res = this.conv.end(); if (res && res.length) this.push(res); done(); } catch (e) { done(e); } } IconvLiteEncoderStream.prototype.collect = function(cb) { var chunks = []; this.on('error', cb); this.on('data', function(chunk) { chunks.push(chunk); }); this.on('end', function() { cb(null, Buffer.concat(chunks)); }); return this; } // == Decoder stream ======================================================= function IconvLiteDecoderStream(conv, options) { this.conv = conv; options = options || {}; options.encoding = this.encoding = 'utf8'; // We output strings. Transform.call(this, options); } IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, { constructor: { value: IconvLiteDecoderStream } }); IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) { if (!Buffer.isBuffer(chunk) && !(chunk instanceof Uint8Array)) return done(new Error("Iconv decoding stream needs buffers as its input.")); try { var res = this.conv.write(chunk); if (res && res.length) this.push(res, this.encoding); done(); } catch (e) { done(e); } } IconvLiteDecoderStream.prototype._flush = function(done) { try { var res = this.conv.end(); if (res && res.length) this.push(res, this.encoding); done(); } catch (e) { done(e); } } IconvLiteDecoderStream.prototype.collect = function(cb) { var res = ''; this.on('error', cb); this.on('data', function(chunk) { res += chunk; }); this.on('end', function() { cb(null, res); }); return this; } return { IconvLiteEncoderStream: IconvLiteEncoderStream, IconvLiteDecoderStream: IconvLiteDecoderStream, }; }; [ ["8740","䏰䰲䘃䖦䕸𧉧䵷䖳𧲱䳢𧳅㮕䜶䝄䱇䱀𤊿𣘗𧍒𦺋𧃒䱗𪍑䝏䗚䲅𧱬䴇䪤䚡𦬣爥𥩔𡩣𣸆𣽡晍囻"], ["8767","綕夝𨮹㷴霴𧯯寛𡵞媤㘥𩺰嫑宷峼杮薓𩥅瑡璝㡵𡵓𣚞𦀡㻬"], ["87a1","𥣞㫵竼龗𤅡𨤍𣇪𠪊𣉞䌊蒄龖鐯䤰蘓墖靊鈘秐稲晠権袝瑌篅枂稬剏遆㓦珄𥶹瓆鿇垳䤯呌䄱𣚎堘穲𧭥讏䚮𦺈䆁𥶙箮𢒼鿈𢓁𢓉𢓌鿉蔄𣖻䂴鿊䓡𪷿拁灮鿋"], ["8840","㇀",4,"𠄌㇅𠃑𠃍㇆㇇𠃋𡿨㇈𠃊㇉㇊㇋㇌𠄎㇍㇎ĀÁǍÀĒÉĚÈŌÓǑÒ࿿Ê̄Ế࿿Ê̌ỀÊāáǎàɑēéěèīíǐìōóǒòūúǔùǖǘǚ"], ["88a1","ǜü࿿ê̄ế࿿ê̌ềêɡ⏚⏛"], ["8940","𪎩𡅅"], ["8943","攊"], ["8946","丽滝鵎釟"], ["894c","𧜵撑会伨侨兖兴农凤务动医华发变团声处备夲头学实実岚庆总斉柾栄桥济炼电纤纬纺织经统缆缷艺苏药视设询车轧轮"], ["89a1","琑糼緍楆竉刧"], ["89ab","醌碸酞肼"], ["89b0","贋胶𠧧"], ["89b5","肟黇䳍鷉鸌䰾𩷶𧀎鸊𪄳㗁"], ["89c1","溚舾甙"], ["89c5","䤑马骏龙禇𨑬𡷊𠗐𢫦两亁亀亇亿仫伷㑌侽㹈倃傈㑽㒓㒥円夅凛凼刅争剹劐匧㗇厩㕑厰㕓参吣㕭㕲㚁咓咣咴咹哐哯唘唣唨㖘唿㖥㖿嗗㗅"], ["8a40","𧶄唥"], ["8a43","𠱂𠴕𥄫喐𢳆㧬𠍁蹆𤶸𩓥䁓𨂾睺𢰸㨴䟕𨅝𦧲𤷪擝𠵼𠾴𠳕𡃴撍蹾𠺖𠰋𠽤𢲩𨉖𤓓"], ["8a64","𠵆𩩍𨃩䟴𤺧𢳂骲㩧𩗴㿭㔆𥋇𩟔𧣈𢵄鵮頕"], ["8a76","䏙𦂥撴哣𢵌𢯊𡁷㧻𡁯"], ["8aa1","𦛚𦜖𧦠擪𥁒𠱃蹨𢆡𨭌𠜱"], ["8aac","䠋𠆩㿺塳𢶍"], ["8ab2","𤗈𠓼𦂗𠽌𠶖啹䂻䎺"], ["8abb","䪴𢩦𡂝膪飵𠶜捹㧾𢝵跀嚡摼㹃"], ["8ac9","𪘁𠸉𢫏𢳉"], ["8ace","𡃈𣧂㦒㨆𨊛㕸𥹉𢃇噒𠼱𢲲𩜠㒼氽𤸻"], ["8adf","𧕴𢺋𢈈𪙛𨳍𠹺𠰴𦠜羓𡃏𢠃𢤹㗻𥇣𠺌𠾍𠺪㾓𠼰𠵇𡅏𠹌"], ["8af6","𠺫𠮩𠵈𡃀𡄽㿹𢚖搲𠾭"], ["8b40","𣏴𧘹𢯎𠵾𠵿𢱑𢱕㨘𠺘𡃇𠼮𪘲𦭐𨳒𨶙𨳊閪哌苄喹"], ["8b55","𩻃鰦骶𧝞𢷮煀腭胬尜𦕲脴㞗卟𨂽醶𠻺𠸏𠹷𠻻㗝𤷫㘉𠳖嚯𢞵𡃉𠸐𠹸𡁸𡅈𨈇𡑕𠹹𤹐𢶤婔𡀝𡀞𡃵𡃶垜𠸑"], ["8ba1","𧚔𨋍𠾵𠹻𥅾㜃𠾶𡆀𥋘𪊽𤧚𡠺𤅷𨉼墙剨㘚𥜽箲孨䠀䬬鼧䧧鰟鮍𥭴𣄽嗻㗲嚉丨夂𡯁屮靑𠂆乛亻㔾尣彑忄㣺扌攵歺氵氺灬爫丬犭𤣩罒礻糹罓𦉪㓁"], ["8bde","𦍋耂肀𦘒𦥑卝衤见𧢲讠贝钅镸长门𨸏韦页风飞饣𩠐鱼鸟黄歯龜丷𠂇阝户钢"], ["8c40","倻淾𩱳龦㷉袏𤅎灷峵䬠𥇍㕙𥴰愢𨨲辧釶熑朙玺𣊁𪄇㲋𡦀䬐磤琂冮𨜏䀉橣𪊺䈣蘏𠩯稪𩥇𨫪靕灍匤𢁾鏴盙𨧣龧矝亣俰傼丯众龨吴綋墒壐𡶶庒庙忂𢜒斋"], ["8ca1","𣏹椙橃𣱣泿"], ["8ca7","爀𤔅玌㻛𤨓嬕璹讃𥲤𥚕窓篬糃繬苸薗龩袐龪躹龫迏蕟駠鈡龬𨶹𡐿䁱䊢娚"], ["8cc9","顨杫䉶圽"], ["8cce","藖𤥻芿𧄍䲁𦵴嵻𦬕𦾾龭龮宖龯曧繛湗秊㶈䓃𣉖𢞖䎚䔶"], ["8ce6","峕𣬚諹屸㴒𣕑嵸龲煗䕘𤃬𡸣䱷㥸㑊𠆤𦱁諌侴𠈹妿腬顖𩣺弻"], ["8d40","𠮟"], ["8d42","𢇁𨥭䄂䚻𩁹㼇龳𪆵䃸㟖䛷𦱆䅼𨚲𧏿䕭㣔𥒚䕡䔛䶉䱻䵶䗪㿈𤬏㙡䓞䒽䇭崾嵈嵖㷼㠏嶤嶹㠠㠸幂庽弥徃㤈㤔㤿㥍惗愽峥㦉憷憹懏㦸戬抐拥挘㧸嚱"], ["8da1","㨃揢揻搇摚㩋擀崕嘡龟㪗斆㪽旿晓㫲暒㬢朖㭂枤栀㭘桊梄㭲㭱㭻椉楃牜楤榟榅㮼槖㯝橥橴橱檂㯬檙㯲檫檵櫔櫶殁毁毪汵沪㳋洂洆洦涁㳯涤涱渕渘温溆𨧀溻滢滚齿滨滩漤漴㵆𣽁澁澾㵪㵵熷岙㶊瀬㶑灐灔灯灿炉𠌥䏁㗱𠻘"], ["8e40","𣻗垾𦻓焾𥟠㙎榢𨯩孴穉𥣡𩓙穥穽𥦬窻窰竂竃燑𦒍䇊竚竝竪䇯咲𥰁笋筕笩𥌎𥳾箢筯莜𥮴𦱿篐萡箒箸𥴠㶭𥱥蒒篺簆簵𥳁籄粃𤢂粦晽𤕸糉糇糦籴糳糵糎"], ["8ea1","繧䔝𦹄絝𦻖璍綉綫焵綳緒𤁗𦀩緤㴓緵𡟹緥𨍭縝𦄡𦅚繮纒䌫鑬縧罀罁罇礶𦋐駡羗𦍑羣𡙡𠁨䕜𣝦䔃𨌺翺𦒉者耈耝耨耯𪂇𦳃耻耼聡𢜔䦉𦘦𣷣𦛨朥肧𨩈脇脚墰𢛶汿𦒘𤾸擧𡒊舘𡡞橓𤩥𤪕䑺舩𠬍𦩒𣵾俹𡓽蓢荢𦬊𤦧𣔰𡝳𣷸芪椛芳䇛"], ["8f40","蕋苐茚𠸖𡞴㛁𣅽𣕚艻苢茘𣺋𦶣𦬅𦮗𣗎㶿茝嗬莅䔋𦶥莬菁菓㑾𦻔橗蕚㒖𦹂𢻯葘𥯤葱㷓䓤檧葊𣲵祘蒨𦮖𦹷𦹃蓞萏莑䒠蒓蓤𥲑䉀𥳀䕃蔴嫲𦺙䔧蕳䔖枿蘖"], ["8fa1","𨘥𨘻藁𧂈蘂𡖂𧃍䕫䕪蘨㙈𡢢号𧎚虾蝱𪃸蟮𢰧螱蟚蠏噡虬桖䘏衅衆𧗠𣶹𧗤衞袜䙛袴袵揁装睷𧜏覇覊覦覩覧覼𨨥觧𧤤𧪽誜瞓釾誐𧩙竩𧬺𣾏䜓𧬸煼謌謟𥐰𥕥謿譌譍誩𤩺讐讛誯𡛟䘕衏貛𧵔𧶏貫㜥𧵓賖𧶘𧶽贒贃𡤐賛灜贑𤳉㻐起"], ["9040","趩𨀂𡀔𤦊㭼𨆼𧄌竧躭躶軃鋔輙輭𨍥𨐒辥錃𪊟𠩐辳䤪𨧞𨔽𣶻廸𣉢迹𪀔𨚼𨔁𢌥㦀𦻗逷𨔼𧪾遡𨕬𨘋邨𨜓郄𨛦邮都酧㫰醩釄粬𨤳𡺉鈎沟鉁鉢𥖹銹𨫆𣲛𨬌𥗛"], ["90a1","𠴱錬鍫𨫡𨯫炏嫃𨫢𨫥䥥鉄𨯬𨰹𨯿鍳鑛躼閅閦鐦閠濶䊹𢙺𨛘𡉼𣸮䧟氜陻隖䅬隣𦻕懚隶磵𨫠隽双䦡𦲸𠉴𦐐𩂯𩃥𤫑𡤕𣌊霱虂霶䨏䔽䖅𤫩灵孁霛靜𩇕靗孊𩇫靟鐥僐𣂷𣂼鞉鞟鞱鞾韀韒韠𥑬韮琜𩐳響韵𩐝𧥺䫑頴頳顋顦㬎𧅵㵑𠘰𤅜"], ["9140","𥜆飊颷飈飇䫿𦴧𡛓喰飡飦飬鍸餹𤨩䭲𩡗𩤅駵騌騻騐驘𥜥㛄𩂱𩯕髠髢𩬅髴䰎鬔鬭𨘀倴鬴𦦨㣃𣁽魐魀𩴾婅𡡣鮎𤉋鰂鯿鰌𩹨鷔𩾷𪆒𪆫𪃡𪄣𪇟鵾鶃𪄴鸎梈"], ["91a1","鷄𢅛𪆓𪈠𡤻𪈳鴹𪂹𪊴麐麕麞麢䴴麪麯𤍤黁㭠㧥㴝伲㞾𨰫鼂鼈䮖鐤𦶢鼗鼖鼹嚟嚊齅馸𩂋韲葿齢齩竜龎爖䮾𤥵𤦻煷𤧸𤍈𤩑玞𨯚𡣺禟𨥾𨸶鍩鏳𨩄鋬鎁鏋𨥬𤒹爗㻫睲穃烐𤑳𤏸煾𡟯炣𡢾𣖙㻇𡢅𥐯𡟸㜢𡛻𡠹㛡𡝴𡣑𥽋㜣𡛀坛𤨥𡏾𡊨"], ["9240","𡏆𡒶蔃𣚦蔃葕𤦔𧅥𣸱𥕜𣻻𧁒䓴𣛮𩦝𦼦柹㜳㰕㷧塬𡤢栐䁗𣜿𤃡𤂋𤄏𦰡哋嚞𦚱嚒𠿟𠮨𠸍鏆𨬓鎜仸儫㠙𤐶亼𠑥𠍿佋侊𥙑婨𠆫𠏋㦙𠌊𠐔㐵伩𠋀𨺳𠉵諚𠈌亘"], ["92a1","働儍侢伃𤨎𣺊佂倮偬傁俌俥偘僼兙兛兝兞湶𣖕𣸹𣺿浲𡢄𣺉冨凃𠗠䓝𠒣𠒒𠒑赺𨪜𠜎剙劤𠡳勡鍮䙺熌𤎌𠰠𤦬𡃤槑𠸝瑹㻞璙琔瑖玘䮎𤪼𤂍叐㖄爏𤃉喴𠍅响𠯆圝鉝雴鍦埝垍坿㘾壋媙𨩆𡛺𡝯𡜐娬妸銏婾嫏娒𥥆𡧳𡡡𤊕㛵洅瑃娡𥺃"], ["9340","媁𨯗𠐓鏠璌𡌃焅䥲鐈𨧻鎽㞠尞岞幞幈𡦖𡥼𣫮廍孏𡤃𡤄㜁𡢠㛝𡛾㛓脪𨩇𡶺𣑲𨦨弌弎𡤧𡞫婫𡜻孄蘔𧗽衠恾𢡠𢘫忛㺸𢖯𢖾𩂈𦽳懀𠀾𠁆𢘛憙憘恵𢲛𢴇𤛔𩅍"], ["93a1","摱𤙥𢭪㨩𢬢𣑐𩣪𢹸挷𪑛撶挱揑𤧣𢵧护𢲡搻敫楲㯴𣂎𣊭𤦉𣊫唍𣋠𡣙𩐿曎𣊉𣆳㫠䆐𥖄𨬢𥖏𡛼𥕛𥐥磮𣄃𡠪𣈴㑤𣈏𣆂𤋉暎𦴤晫䮓昰𧡰𡷫晣𣋒𣋡昞𥡲㣑𣠺𣞼㮙𣞢𣏾瓐㮖枏𤘪梶栞㯄檾㡣𣟕𤒇樳橒櫉欅𡤒攑梘橌㯗橺歗𣿀𣲚鎠鋲𨯪𨫋"], ["9440","銉𨀞𨧜鑧涥漋𤧬浧𣽿㶏渄𤀼娽渊塇洤硂焻𤌚𤉶烱牐犇犔𤞏𤜥兹𤪤𠗫瑺𣻸𣙟𤩊𤤗𥿡㼆㺱𤫟𨰣𣼵悧㻳瓌琼鎇琷䒟𦷪䕑疃㽣𤳙𤴆㽘畕癳𪗆㬙瑨𨫌𤦫𤦎㫻"], ["94a1","㷍𤩎㻿𤧅𤣳釺圲鍂𨫣𡡤僟𥈡𥇧睸𣈲眎眏睻𤚗𣞁㩞𤣰琸璛㺿𤪺𤫇䃈𤪖𦆮錇𥖁砞碍碈磒珐祙𧝁𥛣䄎禛蒖禥樭𣻺稺秴䅮𡛦䄲鈵秱𠵌𤦌𠊙𣶺𡝮㖗啫㕰㚪𠇔𠰍竢婙𢛵𥪯𥪜娍𠉛磰娪𥯆竾䇹籝籭䈑𥮳𥺼𥺦糍𤧹𡞰粎籼粮檲緜縇緓罎𦉡"], ["9540","𦅜𧭈綗𥺂䉪𦭵𠤖柖𠁎𣗏埄𦐒𦏸𤥢翝笧𠠬𥫩𥵃笌𥸎駦虅驣樜𣐿㧢𤧷𦖭騟𦖠蒀𧄧𦳑䓪脷䐂胆脉腂𦞴飃𦩂艢艥𦩑葓𦶧蘐𧈛媆䅿𡡀嬫𡢡嫤𡣘蚠蜨𣶏蠭𧐢娂"], ["95a1","衮佅袇袿裦襥襍𥚃襔𧞅𧞄𨯵𨯙𨮜𨧹㺭蒣䛵䛏㟲訽訜𩑈彍鈫𤊄旔焩烄𡡅鵭貟賩𧷜妚矃姰䍮㛔踪躧𤰉輰轊䋴汘澻𢌡䢛潹溋𡟚鯩㚵𤤯邻邗啱䤆醻鐄𨩋䁢𨫼鐧𨰝𨰻蓥訫閙閧閗閖𨴴瑅㻂𤣿𤩂𤏪㻧𣈥随𨻧𨹦𨹥㻌𤧭𤩸𣿮琒瑫㻼靁𩂰"], ["9640","桇䨝𩂓𥟟靝鍨𨦉𨰦𨬯𦎾銺嬑譩䤼珹𤈛鞛靱餸𠼦巁𨯅𤪲頟𩓚鋶𩗗釥䓀𨭐𤩧𨭤飜𨩅㼀鈪䤥萔餻饍𧬆㷽馛䭯馪驜𨭥𥣈檏騡嫾騯𩣱䮐𩥈馼䮽䮗鍽塲𡌂堢𤦸"], ["96a1","𡓨硄𢜟𣶸棅㵽鑘㤧慐𢞁𢥫愇鱏鱓鱻鰵鰐魿鯏𩸭鮟𪇵𪃾鴡䲮𤄄鸘䲰鴌𪆴𪃭𪃳𩤯鶥蒽𦸒𦿟𦮂藼䔳𦶤𦺄𦷰萠藮𦸀𣟗𦁤秢𣖜𣙀䤭𤧞㵢鏛銾鍈𠊿碹鉷鑍俤㑀遤𥕝砽硔碶硋𡝗𣇉𤥁㚚佲濚濙瀞瀞吔𤆵垻壳垊鴖埗焴㒯𤆬燫𦱀𤾗嬨𡞵𨩉"], ["9740","愌嫎娋䊼𤒈㜬䭻𨧼鎻鎸𡣖𠼝葲𦳀𡐓𤋺𢰦𤏁妔𣶷𦝁綨𦅛𦂤𤦹𤦋𨧺鋥珢㻩璴𨭣𡢟㻡𤪳櫘珳珻㻖𤨾𤪔𡟙𤩦𠎧𡐤𤧥瑈𤤖炥𤥶銄珦鍟𠓾錱𨫎𨨖鎆𨯧𥗕䤵𨪂煫"], ["97a1","𤥃𠳿嚤𠘚𠯫𠲸唂秄𡟺緾𡛂𤩐𡡒䔮鐁㜊𨫀𤦭妰𡢿𡢃𧒄媡㛢𣵛㚰鉟婹𨪁𡡢鍴㳍𠪴䪖㦊僴㵩㵌𡎜煵䋻𨈘渏𩃤䓫浗𧹏灧沯㳖𣿭𣸭渂漌㵯𠏵畑㚼㓈䚀㻚䡱姄鉮䤾轁𨰜𦯀堒埈㛖𡑒烾𤍢𤩱𢿣𡊰𢎽梹楧𡎘𣓥𧯴𣛟𨪃𣟖𣏺𤲟樚𣚭𦲷萾䓟䓎"], ["9840","𦴦𦵑𦲂𦿞漗𧄉茽𡜺菭𦲀𧁓𡟛妉媂𡞳婡婱𡤅𤇼㜭姯𡜼㛇熎鎐暚𤊥婮娫𤊓樫𣻹𧜶𤑛𤋊焝𤉙𨧡侰𦴨峂𤓎𧹍𤎽樌𤉖𡌄炦焳𤏩㶥泟勇𤩏繥姫崯㷳彜𤩝𡟟綤萦"], ["98a1","咅𣫺𣌀𠈔坾𠣕𠘙㿥𡾞𪊶瀃𩅛嵰玏糓𨩙𩐠俈翧狍猐𧫴猸猹𥛶獁獈㺩𧬘遬燵𤣲珡臶㻊県㻑沢国琙琞琟㻢㻰㻴㻺瓓㼎㽓畂畭畲疍㽼痈痜㿀癍㿗癴㿜発𤽜熈嘣覀塩䀝睃䀹条䁅㗛瞘䁪䁯属瞾矋売砘点砜䂨砹硇硑硦葈𥔵礳栃礲䄃"], ["9940","䄉禑禙辻稆込䅧窑䆲窼艹䇄竏竛䇏両筢筬筻簒簛䉠䉺类粜䊌粸䊔糭输烀𠳏総緔緐緽羮羴犟䎗耠耥笹耮耱联㷌垴炠肷胩䏭脌猪脎脒畠脔䐁㬹腖腙腚"], ["99a1","䐓堺腼膄䐥膓䐭膥埯臁臤艔䒏芦艶苊苘苿䒰荗险榊萅烵葤惣蒈䔄蒾蓡蓸蔐蔸蕒䔻蕯蕰藠䕷虲蚒蚲蛯际螋䘆䘗袮裿褤襇覑𧥧訩訸誔誴豑賔賲贜䞘塟跃䟭仮踺嗘坔蹱嗵躰䠷軎転軤軭軲辷迁迊迌逳駄䢭飠鈓䤞鈨鉘鉫銱銮銿"], ["9a40","鋣鋫鋳鋴鋽鍃鎄鎭䥅䥑麿鐗匁鐝鐭鐾䥪鑔鑹锭関䦧间阳䧥枠䨤靀䨵鞲韂噔䫤惨颹䬙飱塄餎餙冴餜餷饂饝饢䭰駅䮝騼鬏窃魩鮁鯝鯱鯴䱭鰠㝯𡯂鵉鰺"], ["9aa1","黾噐鶓鶽鷀鷼银辶鹻麬麱麽黆铜黢黱黸竈齄𠂔𠊷𠎠椚铃妬𠓗塀铁㞹𠗕𠘕𠙶𡚺块煳𠫂𠫍𠮿呪吆𠯋咞𠯻𠰻𠱓𠱥𠱼惧𠲍噺𠲵𠳝𠳭𠵯𠶲𠷈楕鰯螥𠸄𠸎𠻗𠾐𠼭𠹳尠𠾼帋𡁜𡁏𡁶朞𡁻𡂈𡂖㙇𡂿𡃓𡄯𡄻卤蒭𡋣𡍵𡌶讁𡕷𡘙𡟃𡟇乸炻𡠭𡥪"], ["9b40","𡨭𡩅𡰪𡱰𡲬𡻈拃𡻕𡼕熘桕𢁅槩㛈𢉼𢏗𢏺𢜪𢡱𢥏苽𢥧𢦓𢫕覥𢫨辠𢬎鞸𢬿顇骽𢱌"], ["9b62","𢲈𢲷𥯨𢴈𢴒𢶷𢶕𢹂𢽴𢿌𣀳𣁦𣌟𣏞徱晈暿𧩹𣕧𣗳爁𤦺矗𣘚𣜖纇𠍆墵朎"], ["9ba1","椘𣪧𧙗𥿢𣸑𣺹𧗾𢂚䣐䪸𤄙𨪚𤋮𤌍𤀻𤌴𤎖𤩅𠗊凒𠘑妟𡺨㮾𣳿𤐄𤓖垈𤙴㦛𤜯𨗨𩧉㝢𢇃譞𨭎駖𤠒𤣻𤨕爉𤫀𠱸奥𤺥𤾆𠝹軚𥀬劏圿煱𥊙𥐙𣽊𤪧喼𥑆𥑮𦭒釔㑳𥔿𧘲𥕞䜘𥕢𥕦𥟇𤤿𥡝偦㓻𣏌惞𥤃䝼𨥈𥪮𥮉𥰆𡶐垡煑澶𦄂𧰒遖𦆲𤾚譢𦐂𦑊"], ["9c40","嵛𦯷輶𦒄𡤜諪𤧶𦒈𣿯𦔒䯀𦖿𦚵𢜛鑥𥟡憕娧晉侻嚹𤔡𦛼乪𤤴陖涏𦲽㘘襷𦞙𦡮𦐑𦡞營𦣇筂𩃀𠨑𦤦鄄𦤹穅鷰𦧺騦𦨭㙟𦑩𠀡禃𦨴𦭛崬𣔙菏𦮝䛐𦲤画补𦶮墶"], ["9ca1","㜜𢖍𧁋𧇍㱔𧊀𧊅銁𢅺𧊋錰𧋦𤧐氹钟𧑐𠻸蠧裵𢤦𨑳𡞱溸𤨪𡠠㦤㚹尐秣䔿暶𩲭𩢤襃𧟌𧡘囖䃟𡘊㦡𣜯𨃨𡏅熭荦𧧝𩆨婧䲷𧂯𨦫𧧽𧨊𧬋𧵦𤅺筃祾𨀉澵𪋟樃𨌘厢𦸇鎿栶靝𨅯𨀣𦦵𡏭𣈯𨁈嶅𨰰𨂃圕頣𨥉嶫𤦈斾槕叒𤪥𣾁㰑朶𨂐𨃴𨄮𡾡𨅏"], ["9d40","𨆉𨆯𨈚𨌆𨌯𨎊㗊𨑨𨚪䣺揦𨥖砈鉕𨦸䏲𨧧䏟𨧨𨭆𨯔姸𨰉輋𨿅𩃬筑𩄐𩄼㷷𩅞𤫊运犏嚋𩓧𩗩𩖰𩖸𩜲𩣑𩥉𩥪𩧃𩨨𩬎𩵚𩶛纟𩻸𩼣䲤镇𪊓熢𪋿䶑递𪗋䶜𠲜达嗁"], ["9da1","辺𢒰边𤪓䔉繿潖檱仪㓤𨬬𧢝㜺躀𡟵𨀤𨭬𨮙𧨾𦚯㷫𧙕𣲷𥘵𥥖亚𥺁𦉘嚿𠹭踎孭𣺈𤲞揞拐𡟶𡡻攰嘭𥱊吚𥌑㷆𩶘䱽嘢嘞罉𥻘奵𣵀蝰东𠿪𠵉𣚺脗鵞贘瘻鱅癎瞹鍅吲腈苷嘥脲萘肽嗪祢噃吖𠺝㗎嘅嗱曱𨋢㘭甴嗰喺咗啲𠱁𠲖廐𥅈𠹶𢱢"], ["9e40","𠺢麫絚嗞𡁵抝靭咔賍燶酶揼掹揾啩𢭃鱲𢺳冚㓟𠶧冧呍唞唓癦踭𦢊疱肶蠄螆裇膶萜𡃁䓬猄𤜆宐茋𦢓噻𢛴𧴯𤆣𧵳𦻐𧊶酰𡇙鈈𣳼𪚩𠺬𠻹牦𡲢䝎𤿂𧿹𠿫䃺"], ["9ea1","鱝攟𢶠䣳𤟠𩵼𠿬𠸊恢𧖣𠿭"], ["9ead","𦁈𡆇熣纎鵐业丄㕷嬍沲卧㚬㧜卽㚥𤘘墚𤭮舭呋垪𥪕𠥹"], ["9ec5","㩒𢑥獴𩺬䴉鯭𣳾𩼰䱛𤾩𩖞𩿞葜𣶶𧊲𦞳𣜠挮紥𣻷𣸬㨪逈勌㹴㙺䗩𠒎癀嫰𠺶硺𧼮墧䂿噼鮋嵴癔𪐴麅䳡痹㟻愙𣃚𤏲"], ["9ef5","噝𡊩垧𤥣𩸆刴𧂮㖭汊鵼"], ["9f40","籖鬹埞𡝬屓擓𩓐𦌵𧅤蚭𠴨𦴢𤫢𠵱"], ["9f4f","凾𡼏嶎霃𡷑麁遌笟鬂峑箣扨挵髿篏鬪籾鬮籂粆鰕篼鬉鼗鰛𤤾齚啳寃俽麘俲剠㸆勑坧偖妷帒韈鶫轜呩鞴饀鞺匬愰"], ["9fa1","椬叚鰊鴂䰻陁榀傦畆𡝭駚剳"], ["9fae","酙隁酜"], ["9fb2","酑𨺗捿𦴣櫊嘑醎畺抅𠏼獏籰𥰡𣳽"], ["9fc1","𤤙盖鮝个𠳔莾衂"], ["9fc9","届槀僭坺刟巵从氱𠇲伹咜哚劚趂㗾弌㗳"], ["9fdb","歒酼龥鮗頮颴骺麨麄煺笔"], ["9fe7","毺蠘罸"], ["9feb","嘠𪙊蹷齓"], ["9ff0","跔蹏鸜踁抂𨍽踨蹵竓𤩷稾磘泪詧瘇"], ["a040","𨩚鼦泎蟖痃𪊲硓咢贌狢獱謭猂瓱賫𤪻蘯徺袠䒷"], ["a055","𡠻𦸅"], ["a058","詾𢔛"], ["a05b","惽癧髗鵄鍮鮏蟵"], ["a063","蠏賷猬霡鮰㗖犲䰇籑饊𦅙慙䰄麖慽"], ["a073","坟慯抦戹拎㩜懢厪𣏵捤栂㗒"], ["a0a1","嵗𨯂迚𨸹"], ["a0a6","僙𡵆礆匲阸𠼻䁥"], ["a0ae","矾"], ["a0b0","糂𥼚糚稭聦聣絍甅瓲覔舚朌聢𧒆聛瓰脃眤覉𦟌畓𦻑螩蟎臈螌詉貭譃眫瓸蓚㘵榲趦"], ["a0d4","覩瑨涹蟁𤀑瓧㷛煶悤憜㳑煢恷"], ["a0e2","罱𨬭牐惩䭾删㰘𣳇𥻗𧙖𥔱𡥄𡋾𩤃𦷜𧂭峁𦆭𨨏𣙷𠃮𦡆𤼎䕢嬟𦍌齐麦𦉫"], ["a3c0","␀",31,"␡"], ["c6a1","①",9,"⑴",9,"ⅰ",9,"丶丿亅亠冂冖冫勹匸卩厶夊宀巛⼳广廴彐彡攴无疒癶辵隶¨ˆヽヾゝゞ〃仝々〆〇ー[]✽ぁ",23], ["c740","す",58,"ァアィイ"], ["c7a1","ゥ",81,"А",5,"ЁЖ",4], ["c840","Л",26,"ёж",25,"⇧↸↹㇏𠃌乚𠂊刂䒑"], ["c8a1","龰冈龱𧘇"], ["c8cd","¬¦'"㈱№℡゛゜⺀⺄⺆⺇⺈⺊⺌⺍⺕⺜⺝⺥⺧⺪⺬⺮⺶⺼⺾⻆⻊⻌⻍⻏⻖⻗⻞⻣"], ["c8f5","ʃɐɛɔɵœøŋʊɪ"], ["f9fe","■"], ["fa40","𠕇鋛𠗟𣿅蕌䊵珯况㙉𤥂𨧤鍄𡧛苮𣳈砼杄拟𤤳𨦪𠊠𦮳𡌅侫𢓭倈𦴩𧪄𣘀𤪱𢔓倩𠍾徤𠎀𠍇滛𠐟偽儁㑺儎顬㝃萖𤦤𠒇兠𣎴兪𠯿𢃼𠋥𢔰𠖎𣈳𡦃宂蝽𠖳𣲙冲冸"], ["faa1","鴴凉减凑㳜凓𤪦决凢卂凭菍椾𣜭彻刋刦刼劵剗劔効勅簕蕂勠蘍𦬓包𨫞啉滙𣾀𠥔𣿬匳卄𠯢泋𡜦栛珕恊㺪㣌𡛨燝䒢卭却𨚫卾卿𡖖𡘓矦厓𨪛厠厫厮玧𥝲㽙玜叁叅汉义埾叙㪫𠮏叠𣿫𢶣叶𠱷吓灹唫晗浛呭𦭓𠵴啝咏咤䞦𡜍𠻝㶴𠵍"], ["fb40","𨦼𢚘啇䳭启琗喆喩嘅𡣗𤀺䕒𤐵暳𡂴嘷曍𣊊暤暭噍噏磱囱鞇叾圀囯园𨭦㘣𡉏坆𤆥汮炋坂㚱𦱾埦𡐖堃𡑔𤍣堦𤯵塜墪㕡壠壜𡈼壻寿坃𪅐𤉸鏓㖡够梦㛃湙"], ["fba1","𡘾娤啓𡚒蔅姉𠵎𦲁𦴪𡟜姙𡟻𡞲𦶦浱𡠨𡛕姹𦹅媫婣㛦𤦩婷㜈媖瑥嫓𦾡𢕔㶅𡤑㜲𡚸広勐孶斈孼𧨎䀄䡝𠈄寕慠𡨴𥧌𠖥寳宝䴐尅𡭄尓珎尔𡲥𦬨屉䣝岅峩峯嶋𡷹𡸷崐崘嵆𡺤岺巗苼㠭𤤁𢁉𢅳芇㠶㯂帮檊幵幺𤒼𠳓厦亷廐厨𡝱帉廴𨒂"], ["fc40","廹廻㢠廼栾鐛弍𠇁弢㫞䢮𡌺强𦢈𢏐彘𢑱彣鞽𦹮彲鍀𨨶徧嶶㵟𥉐𡽪𧃸𢙨釖𠊞𨨩怱暅𡡷㥣㷇㘹垐𢞴祱㹀悞悤悳𤦂𤦏𧩓璤僡媠慤萤慂慈𦻒憁凴𠙖憇宪𣾷"], ["fca1","𢡟懓𨮝𩥝懐㤲𢦀𢣁怣慜攞掋𠄘担𡝰拕𢸍捬𤧟㨗搸揸𡎎𡟼撐澊𢸶頔𤂌𥜝擡擥鑻㩦携㩗敍漖𤨨𤨣斅敭敟𣁾斵𤥀䬷旑䃘𡠩无旣忟𣐀昘𣇷𣇸晄𣆤𣆥晋𠹵晧𥇦晳晴𡸽𣈱𨗴𣇈𥌓矅𢣷馤朂𤎜𤨡㬫槺𣟂杞杧杢𤇍𩃭柗䓩栢湐鈼栁𣏦𦶠桝"], ["fd40","𣑯槡樋𨫟楳棃𣗍椁椀㴲㨁𣘼㮀枬楡𨩊䋼椶榘㮡𠏉荣傐槹𣙙𢄪橅𣜃檝㯳枱櫈𩆜㰍欝𠤣惞欵歴𢟍溵𣫛𠎵𡥘㝀吡𣭚毡𣻼毜氷𢒋𤣱𦭑汚舦汹𣶼䓅𣶽𤆤𤤌𤤀"], ["fda1","𣳉㛥㳫𠴲鮃𣇹𢒑羏样𦴥𦶡𦷫涖浜湼漄𤥿𤂅𦹲蔳𦽴凇沜渝萮𨬡港𣸯瑓𣾂秌湏媑𣁋濸㜍澝𣸰滺𡒗𤀽䕕鏰潄潜㵎潴𩅰㴻澟𤅄濓𤂑𤅕𤀹𣿰𣾴𤄿凟𤅖𤅗𤅀𦇝灋灾炧炁烌烕烖烟䄄㷨熴熖𤉷焫煅媈煊煮岜𤍥煏鍢𤋁焬𤑚𤨧𤨢熺𨯨炽爎"], ["fe40","鑂爕夑鑃爤鍁𥘅爮牀𤥴梽牕牗㹕𣁄栍漽犂猪猫𤠣𨠫䣭𨠄猨献珏玪𠰺𦨮珉瑉𤇢𡛧𤨤昣㛅𤦷𤦍𤧻珷琕椃𤨦琹𠗃㻗瑜𢢭瑠𨺲瑇珤瑶莹瑬㜰瑴鏱樬璂䥓𤪌"], ["fea1","𤅟𤩹𨮏孆𨰃𡢞瓈𡦈甎瓩甞𨻙𡩋寗𨺬鎅畍畊畧畮𤾂㼄𤴓疎瑝疞疴瘂瘬癑癏癯癶𦏵皐臯㟸𦤑𦤎皡皥皷盌𦾟葢𥂝𥅽𡸜眞眦着撯𥈠睘𣊬瞯𨥤𨥨𡛁矴砉𡍶𤨒棊碯磇磓隥礮𥗠磗礴碱𧘌辸袄𨬫𦂃𢘜禆褀椂禀𥡗禝𧬹礼禩渪𧄦㺨秆𩄍秔"] ] [ ["0","\u0000",127,"€"], ["8140","丂丄丅丆丏丒丗丟丠両丣並丩丮丯丱丳丵丷丼乀乁乂乄乆乊乑乕乗乚乛乢乣乤乥乧乨乪",5,"乲乴",9,"乿",6,"亇亊"], ["8180","亐亖亗亙亜亝亞亣亪亯亰亱亴亶亷亸亹亼亽亾仈仌仏仐仒仚仛仜仠仢仦仧仩仭仮仯仱仴仸仹仺仼仾伀伂",6,"伋伌伒",4,"伜伝伡伣伨伩伬伭伮伱伳伵伷伹伻伾",4,"佄佅佇",5,"佒佔佖佡佢佦佨佪佫佭佮佱佲併佷佸佹佺佽侀侁侂侅來侇侊侌侎侐侒侓侕侖侘侙侚侜侞侟価侢"], ["8240","侤侫侭侰",4,"侶",8,"俀俁係俆俇俈俉俋俌俍俒",4,"俙俛俠俢俤俥俧俫俬俰俲俴俵俶俷俹俻俼俽俿",11], ["8280","個倎倐們倓倕倖倗倛倝倞倠倢倣値倧倫倯",10,"倻倽倿偀偁偂偄偅偆偉偊偋偍偐",4,"偖偗偘偙偛偝",7,"偦",5,"偭",8,"偸偹偺偼偽傁傂傃傄傆傇傉傊傋傌傎",20,"傤傦傪傫傭",4,"傳",6,"傼"], ["8340","傽",17,"僐",5,"僗僘僙僛",10,"僨僩僪僫僯僰僱僲僴僶",4,"僼",9,"儈"], ["8380","儉儊儌",5,"儓",13,"儢",28,"兂兇兊兌兎兏児兒兓兗兘兙兛兝",4,"兣兤兦內兩兪兯兲兺兾兿冃冄円冇冊冋冎冏冐冑冓冔冘冚冝冞冟冡冣冦",4,"冭冮冴冸冹冺冾冿凁凂凃凅凈凊凍凎凐凒",5], ["8440","凘凙凚凜凞凟凢凣凥",5,"凬凮凱凲凴凷凾刄刅刉刋刌刏刐刓刔刕刜刞刟刡刢刣別刦刧刪刬刯刱刲刴刵刼刾剄",5,"剋剎剏剒剓剕剗剘"], ["8480","剙剚剛剝剟剠剢剣剤剦剨剫剬剭剮剰剱剳",9,"剾劀劃",4,"劉",6,"劑劒劔",6,"劜劤劥劦劧劮劯劰労",9,"勀勁勂勄勅勆勈勊勌勍勎勏勑勓勔動勗務",5,"勠勡勢勣勥",10,"勱",7,"勻勼勽匁匂匃匄匇匉匊匋匌匎"], ["8540","匑匒匓匔匘匛匜匞匟匢匤匥匧匨匩匫匬匭匯",9,"匼匽區卂卄卆卋卌卍卐協単卙卛卝卥卨卪卬卭卲卶卹卻卼卽卾厀厁厃厇厈厊厎厏"], ["8580","厐",4,"厖厗厙厛厜厞厠厡厤厧厪厫厬厭厯",6,"厷厸厹厺厼厽厾叀參",4,"収叏叐叒叓叕叚叜叝叞叡叢叧叴叺叾叿吀吂吅吇吋吔吘吙吚吜吢吤吥吪吰吳吶吷吺吽吿呁呂呄呅呇呉呌呍呎呏呑呚呝",4,"呣呥呧呩",7,"呴呹呺呾呿咁咃咅咇咈咉咊咍咑咓咗咘咜咞咟咠咡"], ["8640","咢咥咮咰咲咵咶咷咹咺咼咾哃哅哊哋哖哘哛哠",4,"哫哬哯哰哱哴",5,"哻哾唀唂唃唄唅唈唊",4,"唒唓唕",5,"唜唝唞唟唡唥唦"], ["8680","唨唩唫唭唲唴唵唶唸唹唺唻唽啀啂啅啇啈啋",4,"啑啒啓啔啗",4,"啝啞啟啠啢啣啨啩啫啯",5,"啹啺啽啿喅喆喌喍喎喐喒喓喕喖喗喚喛喞喠",6,"喨",8,"喲喴営喸喺喼喿",4,"嗆嗇嗈嗊嗋嗎嗏嗐嗕嗗",4,"嗞嗠嗢嗧嗩嗭嗮嗰嗱嗴嗶嗸",4,"嗿嘂嘃嘄嘅"], ["8740","嘆嘇嘊嘋嘍嘐",7,"嘙嘚嘜嘝嘠嘡嘢嘥嘦嘨嘩嘪嘫嘮嘯嘰嘳嘵嘷嘸嘺嘼嘽嘾噀",11,"噏",4,"噕噖噚噛噝",4], ["8780","噣噥噦噧噭噮噯噰噲噳噴噵噷噸噹噺噽",7,"嚇",6,"嚐嚑嚒嚔",14,"嚤",10,"嚰",6,"嚸嚹嚺嚻嚽",12,"囋",8,"囕囖囘囙囜団囥",5,"囬囮囯囲図囶囷囸囻囼圀圁圂圅圇國",6], ["8840","園",9,"圝圞圠圡圢圤圥圦圧圫圱圲圴",4,"圼圽圿坁坃坄坅坆坈坉坋坒",4,"坘坙坢坣坥坧坬坮坰坱坲坴坵坸坹坺坽坾坿垀"], ["8880","垁垇垈垉垊垍",4,"垔",6,"垜垝垞垟垥垨垪垬垯垰垱垳垵垶垷垹",8,"埄",6,"埌埍埐埑埓埖埗埛埜埞埡埢埣埥",7,"埮埰埱埲埳埵埶執埻埼埾埿堁堃堄堅堈堉堊堌堎堏堐堒堓堔堖堗堘堚堛堜堝堟堢堣堥",4,"堫",4,"報堲堳場堶",7], ["8940","堾",5,"塅",6,"塎塏塐塒塓塕塖塗塙",4,"塟",5,"塦",4,"塭",16,"塿墂墄墆墇墈墊墋墌"], ["8980","墍",4,"墔",4,"墛墜墝墠",7,"墪",17,"墽墾墿壀壂壃壄壆",10,"壒壓壔壖",13,"壥",5,"壭壯壱売壴壵壷壸壺",7,"夃夅夆夈",4,"夎夐夑夒夓夗夘夛夝夞夠夡夢夣夦夨夬夰夲夳夵夶夻"], ["8a40","夽夾夿奀奃奅奆奊奌奍奐奒奓奙奛",4,"奡奣奤奦",12,"奵奷奺奻奼奾奿妀妅妉妋妌妎妏妐妑妔妕妘妚妛妜妝妟妠妡妢妦"], ["8a80","妧妬妭妰妱妳",5,"妺妼妽妿",6,"姇姈姉姌姍姎姏姕姖姙姛姞",4,"姤姦姧姩姪姫姭",11,"姺姼姽姾娀娂娊娋娍娎娏娐娒娔娕娖娗娙娚娛娝娞娡娢娤娦娧娨娪",6,"娳娵娷",4,"娽娾娿婁",4,"婇婈婋",9,"婖婗婘婙婛",5], ["8b40","婡婣婤婥婦婨婩婫",8,"婸婹婻婼婽婾媀",17,"媓",6,"媜",13,"媫媬"], ["8b80","媭",4,"媴媶媷媹",4,"媿嫀嫃",5,"嫊嫋嫍",4,"嫓嫕嫗嫙嫚嫛嫝嫞嫟嫢嫤嫥嫧嫨嫪嫬",4,"嫲",22,"嬊",11,"嬘",25,"嬳嬵嬶嬸",7,"孁",6], ["8c40","孈",7,"孒孖孞孠孡孧孨孫孭孮孯孲孴孶孷學孹孻孼孾孿宂宆宊宍宎宐宑宒宔宖実宧宨宩宬宭宮宯宱宲宷宺宻宼寀寁寃寈寉寊寋寍寎寏"], ["8c80","寑寔",8,"寠寢寣實寧審",4,"寯寱",6,"寽対尀専尃尅將專尋尌對導尐尒尓尗尙尛尞尟尠尡尣尦尨尩尪尫尭尮尯尰尲尳尵尶尷屃屄屆屇屌屍屒屓屔屖屗屘屚屛屜屝屟屢層屧",6,"屰屲",6,"屻屼屽屾岀岃",4,"岉岊岋岎岏岒岓岕岝",4,"岤",4], ["8d40","岪岮岯岰岲岴岶岹岺岻岼岾峀峂峃峅",5,"峌",5,"峓",5,"峚",6,"峢峣峧峩峫峬峮峯峱",9,"峼",4], ["8d80","崁崄崅崈",5,"崏",4,"崕崗崘崙崚崜崝崟",4,"崥崨崪崫崬崯",4,"崵",7,"崿",7,"嵈嵉嵍",10,"嵙嵚嵜嵞",10,"嵪嵭嵮嵰嵱嵲嵳嵵",12,"嶃",21,"嶚嶛嶜嶞嶟嶠"], ["8e40","嶡",21,"嶸",12,"巆",6,"巎",12,"巜巟巠巣巤巪巬巭"], ["8e80","巰巵巶巸",4,"巿帀帄帇帉帊帋帍帎帒帓帗帞",7,"帨",4,"帯帰帲",4,"帹帺帾帿幀幁幃幆",5,"幍",6,"幖",4,"幜幝幟幠幣",14,"幵幷幹幾庁庂広庅庈庉庌庍庎庒庘庛庝庡庢庣庤庨",4,"庮",4,"庴庺庻庼庽庿",6], ["8f40","廆廇廈廋",5,"廔廕廗廘廙廚廜",11,"廩廫",8,"廵廸廹廻廼廽弅弆弇弉弌弍弎弐弒弔弖弙弚弜弝弞弡弢弣弤"], ["8f80","弨弫弬弮弰弲",6,"弻弽弾弿彁",14,"彑彔彙彚彛彜彞彟彠彣彥彧彨彫彮彯彲彴彵彶彸彺彽彾彿徃徆徍徎徏徑従徔徖徚徛徝從徟徠徢",5,"復徫徬徯",5,"徶徸徹徺徻徾",4,"忇忈忊忋忎忓忔忕忚忛応忞忟忢忣忥忦忨忩忬忯忰忲忳忴忶忷忹忺忼怇"], ["9040","怈怉怋怌怐怑怓怗怘怚怞怟怢怣怤怬怭怮怰",4,"怶",4,"怽怾恀恄",6,"恌恎恏恑恓恔恖恗恘恛恜恞恟恠恡恥恦恮恱恲恴恵恷恾悀"], ["9080","悁悂悅悆悇悈悊悋悎悏悐悑悓悕悗悘悙悜悞悡悢悤悥悧悩悪悮悰悳悵悶悷悹悺悽",7,"惇惈惉惌",4,"惒惓惔惖惗惙惛惞惡",4,"惪惱惲惵惷惸惻",4,"愂愃愄愅愇愊愋愌愐",4,"愖愗愘愙愛愜愝愞愡愢愥愨愩愪愬",18,"慀",6], ["9140","慇慉態慍慏慐慒慓慔慖",6,"慞慟慠慡慣慤慥慦慩",6,"慱慲慳慴慶慸",18,"憌憍憏",4,"憕"], ["9180","憖",6,"憞",8,"憪憫憭",9,"憸",5,"憿懀懁懃",4,"應懌",4,"懓懕",16,"懧",13,"懶",8,"戀",5,"戇戉戓戔戙戜戝戞戠戣戦戧戨戩戫戭戯戰戱戲戵戶戸",4,"扂扄扅扆扊"], ["9240","扏扐払扖扗扙扚扜",6,"扤扥扨扱扲扴扵扷扸扺扻扽抁抂抃抅抆抇抈抋",5,"抔抙抜抝択抣抦抧抩抪抭抮抯抰抲抳抴抶抷抸抺抾拀拁"], ["9280","拃拋拏拑拕拝拞拠拡拤拪拫拰拲拵拸拹拺拻挀挃挄挅挆挊挋挌挍挏挐挒挓挔挕挗挘挙挜挦挧挩挬挭挮挰挱挳",5,"挻挼挾挿捀捁捄捇捈捊捑捒捓捔捖",7,"捠捤捥捦捨捪捫捬捯捰捲捳捴捵捸捹捼捽捾捿掁掃掄掅掆掋掍掑掓掔掕掗掙",6,"採掤掦掫掯掱掲掵掶掹掻掽掿揀"], ["9340","揁揂揃揅揇揈揊揋揌揑揓揔揕揗",6,"揟揢揤",4,"揫揬揮揯揰揱揳揵揷揹揺揻揼揾搃搄搆",4,"損搎搑搒搕",5,"搝搟搢搣搤"], ["9380","搥搧搨搩搫搮",5,"搵",4,"搻搼搾摀摂摃摉摋",6,"摓摕摖摗摙",4,"摟",7,"摨摪摫摬摮",9,"摻",6,"撃撆撈",8,"撓撔撗撘撚撛撜撝撟",4,"撥撦撧撨撪撫撯撱撲撳撴撶撹撻撽撾撿擁擃擄擆",6,"擏擑擓擔擕擖擙據"], ["9440","擛擜擝擟擠擡擣擥擧",24,"攁",7,"攊",7,"攓",4,"攙",8], ["9480","攢攣攤攦",4,"攬攭攰攱攲攳攷攺攼攽敀",4,"敆敇敊敋敍敎敐敒敓敔敗敘敚敜敟敠敡敤敥敧敨敩敪敭敮敯敱敳敵敶數",14,"斈斉斊斍斎斏斒斔斕斖斘斚斝斞斠斢斣斦斨斪斬斮斱",7,"斺斻斾斿旀旂旇旈旉旊旍旐旑旓旔旕旘",7,"旡旣旤旪旫"], ["9540","旲旳旴旵旸旹旻",4,"昁昄昅昇昈昉昋昍昐昑昒昖昗昘昚昛昜昞昡昢昣昤昦昩昪昫昬昮昰昲昳昷",4,"昽昿晀時晄",6,"晍晎晐晑晘"], ["9580","晙晛晜晝晞晠晢晣晥晧晩",4,"晱晲晳晵晸晹晻晼晽晿暀暁暃暅暆暈暉暊暋暍暎暏暐暒暓暔暕暘",4,"暞",8,"暩",4,"暯",4,"暵暶暷暸暺暻暼暽暿",25,"曚曞",7,"曧曨曪",5,"曱曵曶書曺曻曽朁朂會"], ["9640","朄朅朆朇朌朎朏朑朒朓朖朘朙朚朜朞朠",5,"朧朩朮朰朲朳朶朷朸朹朻朼朾朿杁杄杅杇杊杋杍杒杔杕杗",4,"杝杢杣杤杦杧杫杬杮東杴杶"], ["9680","杸杹杺杻杽枀枂枃枅枆枈枊枌枍枎枏枑枒枓枔枖枙枛枟枠枡枤枦枩枬枮枱枲枴枹",7,"柂柅",9,"柕柖柗柛柟柡柣柤柦柧柨柪柫柭柮柲柵",7,"柾栁栂栃栄栆栍栐栒栔栕栘",4,"栞栟栠栢",6,"栫",6,"栴栵栶栺栻栿桇桋桍桏桒桖",5], ["9740","桜桝桞桟桪桬",7,"桵桸",8,"梂梄梇",7,"梐梑梒梔梕梖梘",9,"梣梤梥梩梪梫梬梮梱梲梴梶梷梸"], ["9780","梹",6,"棁棃",5,"棊棌棎棏棐棑棓棔棖棗棙棛",4,"棡棢棤",9,"棯棲棳棴棶棷棸棻棽棾棿椀椂椃椄椆",4,"椌椏椑椓",11,"椡椢椣椥",7,"椮椯椱椲椳椵椶椷椸椺椻椼椾楀楁楃",16,"楕楖楘楙楛楜楟"], ["9840","楡楢楤楥楧楨楩楪楬業楯楰楲",4,"楺楻楽楾楿榁榃榅榊榋榌榎",5,"榖榗榙榚榝",9,"榩榪榬榮榯榰榲榳榵榶榸榹榺榼榽"], ["9880","榾榿槀槂",7,"構槍槏槑槒槓槕",5,"槜槝槞槡",11,"槮槯槰槱槳",9,"槾樀",9,"樋",11,"標",5,"樠樢",5,"権樫樬樭樮樰樲樳樴樶",6,"樿",4,"橅橆橈",7,"橑",6,"橚"], ["9940","橜",4,"橢橣橤橦",10,"橲",6,"橺橻橽橾橿檁檂檃檅",8,"檏檒",4,"檘",7,"檡",5], ["9980","檧檨檪檭",114,"欥欦欨",6], ["9a40","欯欰欱欳欴欵欶欸欻欼欽欿歀歁歂歄歅歈歊歋歍",11,"歚",7,"歨歩歫",13,"歺歽歾歿殀殅殈"], ["9a80","殌殎殏殐殑殔殕殗殘殙殜",4,"殢",7,"殫",7,"殶殸",6,"毀毃毄毆",4,"毌毎毐毑毘毚毜",4,"毢",7,"毬毭毮毰毱毲毴毶毷毸毺毻毼毾",6,"氈",4,"氎氒気氜氝氞氠氣氥氫氬氭氱氳氶氷氹氺氻氼氾氿汃汄汅汈汋",4,"汑汒汓汖汘"], ["9b40","汙汚汢汣汥汦汧汫",4,"汱汳汵汷汸決汻汼汿沀沄沇沊沋沍沎沑沒沕沖沗沘沚沜沝沞沠沢沨沬沯沰沴沵沶沷沺泀況泂泃泆泇泈泋泍泎泏泑泒泘"], ["9b80","泙泚泜泝泟泤泦泧泩泬泭泲泴泹泿洀洂洃洅洆洈洉洊洍洏洐洑洓洔洕洖洘洜洝洟",5,"洦洨洩洬洭洯洰洴洶洷洸洺洿浀浂浄浉浌浐浕浖浗浘浛浝浟浡浢浤浥浧浨浫浬浭浰浱浲浳浵浶浹浺浻浽",4,"涃涄涆涇涊涋涍涏涐涒涖",4,"涜涢涥涬涭涰涱涳涴涶涷涹",5,"淁淂淃淈淉淊"], ["9c40","淍淎淏淐淒淓淔淕淗淚淛淜淟淢淣淥淧淨淩淪淭淯淰淲淴淵淶淸淺淽",7,"渆渇済渉渋渏渒渓渕渘渙減渜渞渟渢渦渧渨渪測渮渰渱渳渵"], ["9c80","渶渷渹渻",7,"湅",7,"湏湐湑湒湕湗湙湚湜湝湞湠",10,"湬湭湯",14,"満溁溂溄溇溈溊",4,"溑",6,"溙溚溛溝溞溠溡溣溤溦溨溩溫溬溭溮溰溳溵溸溹溼溾溿滀滃滄滅滆滈滉滊滌滍滎滐滒滖滘滙滛滜滝滣滧滪",5], ["9d40","滰滱滲滳滵滶滷滸滺",7,"漃漄漅漇漈漊",4,"漐漑漒漖",9,"漡漢漣漥漦漧漨漬漮漰漲漴漵漷",6,"漿潀潁潂"], ["9d80","潃潄潅潈潉潊潌潎",9,"潙潚潛潝潟潠潡潣潤潥潧",5,"潯潰潱潳潵潶潷潹潻潽",6,"澅澆澇澊澋澏",12,"澝澞澟澠澢",4,"澨",10,"澴澵澷澸澺",5,"濁濃",5,"濊",6,"濓",10,"濟濢濣濤濥"], ["9e40","濦",7,"濰",32,"瀒",7,"瀜",6,"瀤",6], ["9e80","瀫",9,"瀶瀷瀸瀺",17,"灍灎灐",13,"灟",11,"灮灱灲灳灴灷灹灺灻災炁炂炃炄炆炇炈炋炌炍炏炐炑炓炗炘炚炛炞",12,"炰炲炴炵炶為炾炿烄烅烆烇烉烋",12,"烚"], ["9f40","烜烝烞烠烡烢烣烥烪烮烰",6,"烸烺烻烼烾",10,"焋",4,"焑焒焔焗焛",10,"焧",7,"焲焳焴"], ["9f80","焵焷",13,"煆煇煈煉煋煍煏",12,"煝煟",4,"煥煩",4,"煯煰煱煴煵煶煷煹煻煼煾",5,"熅",4,"熋熌熍熎熐熑熒熓熕熖熗熚",4,"熡",6,"熩熪熫熭",5,"熴熶熷熸熺",8,"燄",9,"燏",4], ["a040","燖",9,"燡燢燣燤燦燨",5,"燯",9,"燺",11,"爇",19], ["a080","爛爜爞",9,"爩爫爭爮爯爲爳爴爺爼爾牀",6,"牉牊牋牎牏牐牑牓牔牕牗牘牚牜牞牠牣牤牥牨牪牫牬牭牰牱牳牴牶牷牸牻牼牽犂犃犅",4,"犌犎犐犑犓",11,"犠",11,"犮犱犲犳犵犺",6,"狅狆狇狉狊狋狌狏狑狓狔狕狖狘狚狛"], ["a1a1"," 、。·ˉˇ¨〃々—~‖…‘’“”〔〕〈",7,"〖〗【】±×÷∶∧∨∑∏∪∩∈∷√⊥∥∠⌒⊙∫∮≡≌≈∽∝≠≮≯≤≥∞∵∴♂♀°′″℃$¤¢£‰§№☆★○●◎◇◆□■△▲※→←↑↓〓"], ["a2a1","ⅰ",9], ["a2b1","⒈",19,"⑴",19,"①",9], ["a2e5","㈠",9], ["a2f1","Ⅰ",11], ["a3a1","!"#¥%",88," ̄"], ["a4a1","ぁ",82], ["a5a1","ァ",85], ["a6a1","Α",16,"Σ",6], ["a6c1","α",16,"σ",6], ["a6e0","︵︶︹︺︿﹀︽︾﹁﹂﹃﹄"], ["a6ee","︻︼︷︸︱"], ["a6f4","︳︴"], ["a7a1","А",5,"ЁЖ",25], ["a7d1","а",5,"ёж",25], ["a840","ˊˋ˙–―‥‵℅℉↖↗↘↙∕∟∣≒≦≧⊿═",35,"▁",6], ["a880","█",7,"▓▔▕▼▽◢◣◤◥☉⊕〒〝〞"], ["a8a1","āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜüêɑ"], ["a8bd","ńň"], ["a8c0","ɡ"], ["a8c5","ㄅ",36], ["a940","〡",8,"㊣㎎㎏㎜㎝㎞㎡㏄㏎㏑㏒㏕︰¬¦"], ["a959","℡㈱"], ["a95c","‐"], ["a960","ー゛゜ヽヾ〆ゝゞ﹉",9,"﹔﹕﹖﹗﹙",8], ["a980","﹢",4,"﹨﹩﹪﹫"], ["a996","〇"], ["a9a4","─",75], ["aa40","狜狝狟狢",5,"狪狫狵狶狹狽狾狿猀猂猄",5,"猋猌猍猏猐猑猒猔猘猙猚猟猠猣猤猦猧猨猭猯猰猲猳猵猶猺猻猼猽獀",8], ["aa80","獉獊獋獌獎獏獑獓獔獕獖獘",7,"獡",10,"獮獰獱"], ["ab40","獲",11,"獿",4,"玅玆玈玊玌玍玏玐玒玓玔玕玗玘玙玚玜玝玞玠玡玣",5,"玪玬玭玱玴玵玶玸玹玼玽玾玿珁珃",4], ["ab80","珋珌珎珒",6,"珚珛珜珝珟珡珢珣珤珦珨珪珫珬珮珯珰珱珳",4], ["ac40","珸",10,"琄琇琈琋琌琍琎琑",8,"琜",5,"琣琤琧琩琫琭琯琱琲琷",4,"琽琾琿瑀瑂",11], ["ac80","瑎",6,"瑖瑘瑝瑠",12,"瑮瑯瑱",4,"瑸瑹瑺"], ["ad40","瑻瑼瑽瑿璂璄璅璆璈璉璊璌璍璏璑",10,"璝璟",7,"璪",15,"璻",12], ["ad80","瓈",9,"瓓",8,"瓝瓟瓡瓥瓧",6,"瓰瓱瓲"], ["ae40","瓳瓵瓸",6,"甀甁甂甃甅",7,"甎甐甒甔甕甖甗甛甝甞甠",4,"甦甧甪甮甴甶甹甼甽甿畁畂畃畄畆畇畉畊畍畐畑畒畓畕畖畗畘"], ["ae80","畝",7,"畧畨畩畫",6,"畳畵當畷畺",4,"疀疁疂疄疅疇"], ["af40","疈疉疊疌疍疎疐疓疕疘疛疜疞疢疦",4,"疭疶疷疺疻疿痀痁痆痋痌痎痏痐痑痓痗痙痚痜痝痟痠痡痥痩痬痭痮痯痲痳痵痶痷痸痺痻痽痾瘂瘄瘆瘇"], ["af80","瘈瘉瘋瘍瘎瘏瘑瘒瘓瘔瘖瘚瘜瘝瘞瘡瘣瘧瘨瘬瘮瘯瘱瘲瘶瘷瘹瘺瘻瘽癁療癄"], ["b040","癅",6,"癎",5,"癕癗",4,"癝癟癠癡癢癤",6,"癬癭癮癰",7,"癹発發癿皀皁皃皅皉皊皌皍皏皐皒皔皕皗皘皚皛"], ["b080","皜",7,"皥",8,"皯皰皳皵",9,"盀盁盃啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥"], ["b140","盄盇盉盋盌盓盕盙盚盜盝盞盠",4,"盦",7,"盰盳盵盶盷盺盻盽盿眀眂眃眅眆眊県眎",10,"眛眜眝眞眡眣眤眥眧眪眫"], ["b180","眬眮眰",4,"眹眻眽眾眿睂睄睅睆睈",7,"睒",7,"睜薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳"], ["b240","睝睞睟睠睤睧睩睪睭",11,"睺睻睼瞁瞂瞃瞆",5,"瞏瞐瞓",11,"瞡瞣瞤瞦瞨瞫瞭瞮瞯瞱瞲瞴瞶",4], ["b280","瞼瞾矀",12,"矎",8,"矘矙矚矝",4,"矤病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖"], ["b340","矦矨矪矯矰矱矲矴矵矷矹矺矻矼砃",5,"砊砋砎砏砐砓砕砙砛砞砠砡砢砤砨砪砫砮砯砱砲砳砵砶砽砿硁硂硃硄硆硈硉硊硋硍硏硑硓硔硘硙硚"], ["b380","硛硜硞",11,"硯",7,"硸硹硺硻硽",6,"场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚"], ["b440","碄碅碆碈碊碋碏碐碒碔碕碖碙碝碞碠碢碤碦碨",7,"碵碶碷碸確碻碼碽碿磀磂磃磄磆磇磈磌磍磎磏磑磒磓磖磗磘磚",9], ["b480","磤磥磦磧磩磪磫磭",4,"磳磵磶磸磹磻",5,"礂礃礄礆",6,"础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮"], ["b540","礍",5,"礔",9,"礟",4,"礥",14,"礵",4,"礽礿祂祃祄祅祇祊",8,"祔祕祘祙祡祣"], ["b580","祤祦祩祪祫祬祮祰",6,"祹祻",4,"禂禃禆禇禈禉禋禌禍禎禐禑禒怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠"], ["b640","禓",6,"禛",11,"禨",10,"禴",4,"禼禿秂秄秅秇秈秊秌秎秏秐秓秔秖秗秙",5,"秠秡秢秥秨秪"], ["b680","秬秮秱",6,"秹秺秼秾秿稁稄稅稇稈稉稊稌稏",4,"稕稖稘稙稛稜丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二"], ["b740","稝稟稡稢稤",14,"稴稵稶稸稺稾穀",5,"穇",9,"穒",4,"穘",16], ["b780","穩",6,"穱穲穳穵穻穼穽穾窂窅窇窉窊窋窌窎窏窐窓窔窙窚窛窞窡窢贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服"], ["b840","窣窤窧窩窪窫窮",4,"窴",10,"竀",10,"竌",9,"竗竘竚竛竜竝竡竢竤竧",5,"竮竰竱竲竳"], ["b880","竴",4,"竻竼竾笀笁笂笅笇笉笌笍笎笐笒笓笖笗笘笚笜笝笟笡笢笣笧笩笭浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹"], ["b940","笯笰笲笴笵笶笷笹笻笽笿",5,"筆筈筊筍筎筓筕筗筙筜筞筟筡筣",10,"筯筰筳筴筶筸筺筼筽筿箁箂箃箄箆",6,"箎箏"], ["b980","箑箒箓箖箘箙箚箛箞箟箠箣箤箥箮箯箰箲箳箵箶箷箹",7,"篂篃範埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈"], ["ba40","篅篈築篊篋篍篎篏篐篒篔",4,"篛篜篞篟篠篢篣篤篧篨篩篫篬篭篯篰篲",4,"篸篹篺篻篽篿",7,"簈簉簊簍簎簐",5,"簗簘簙"], ["ba80","簚",4,"簠",5,"簨簩簫",12,"簹",5,"籂骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖"], ["bb40","籃",9,"籎",36,"籵",5,"籾",9], ["bb80","粈粊",6,"粓粔粖粙粚粛粠粡粣粦粧粨粩粫粬粭粯粰粴",4,"粺粻弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕"], ["bc40","粿糀糂糃糄糆糉糋糎",6,"糘糚糛糝糞糡",6,"糩",5,"糰",7,"糹糺糼",13,"紋",5], ["bc80","紑",14,"紡紣紤紥紦紨紩紪紬紭紮細",6,"肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件"], ["bd40","紷",54,"絯",7], ["bd80","絸",32,"健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸"], ["be40","継",12,"綧",6,"綯",42], ["be80","線",32,"尽劲荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵觉决诀绝均菌钧军君峻"], ["bf40","緻",62], ["bf80","縺縼",4,"繂",4,"繈",21,"俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀"], ["c040","繞",35,"纃",23,"纜纝纞"], ["c080","纮纴纻纼绖绤绬绹缊缐缞缷缹缻",6,"罃罆",9,"罒罓馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐"], ["c140","罖罙罛罜罝罞罠罣",4,"罫罬罭罯罰罳罵罶罷罸罺罻罼罽罿羀羂",7,"羋羍羏",4,"羕",4,"羛羜羠羢羣羥羦羨",6,"羱"], ["c180","羳",4,"羺羻羾翀翂翃翄翆翇翈翉翋翍翏",4,"翖翗翙",5,"翢翣痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿"], ["c240","翤翧翨翪翫翬翭翯翲翴",6,"翽翾翿耂耇耈耉耊耎耏耑耓耚耛耝耞耟耡耣耤耫",5,"耲耴耹耺耼耾聀聁聄聅聇聈聉聎聏聐聑聓聕聖聗"], ["c280","聙聛",13,"聫",5,"聲",11,"隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫"], ["c340","聾肁肂肅肈肊肍",5,"肔肕肗肙肞肣肦肧肨肬肰肳肵肶肸肹肻胅胇",4,"胏",6,"胘胟胠胢胣胦胮胵胷胹胻胾胿脀脁脃脄脅脇脈脋"], ["c380","脌脕脗脙脛脜脝脟",12,"脭脮脰脳脴脵脷脹",4,"脿谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸"], ["c440","腀",5,"腇腉腍腎腏腒腖腗腘腛",4,"腡腢腣腤腦腨腪腫腬腯腲腳腵腶腷腸膁膃",4,"膉膋膌膍膎膐膒",5,"膙膚膞",4,"膤膥"], ["c480","膧膩膫",7,"膴",5,"膼膽膾膿臄臅臇臈臉臋臍",6,"摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁"], ["c540","臔",14,"臤臥臦臨臩臫臮",4,"臵",5,"臽臿舃與",4,"舎舏舑舓舕",5,"舝舠舤舥舦舧舩舮舲舺舼舽舿"], ["c580","艀艁艂艃艅艆艈艊艌艍艎艐",7,"艙艛艜艝艞艠",7,"艩拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗"], ["c640","艪艫艬艭艱艵艶艷艸艻艼芀芁芃芅芆芇芉芌芐芓芔芕芖芚芛芞芠芢芣芧芲芵芶芺芻芼芿苀苂苃苅苆苉苐苖苙苚苝苢苧苨苩苪苬苭苮苰苲苳苵苶苸"], ["c680","苺苼",4,"茊茋茍茐茒茓茖茘茙茝",9,"茩茪茮茰茲茷茻茽啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐"], ["c740","茾茿荁荂荄荅荈荊",4,"荓荕",4,"荝荢荰",6,"荹荺荾",6,"莇莈莊莋莌莍莏莐莑莔莕莖莗莙莚莝莟莡",6,"莬莭莮"], ["c780","莯莵莻莾莿菂菃菄菆菈菉菋菍菎菐菑菒菓菕菗菙菚菛菞菢菣菤菦菧菨菫菬菭恰洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠"], ["c840","菮華菳",4,"菺菻菼菾菿萀萂萅萇萈萉萊萐萒",5,"萙萚萛萞",5,"萩",7,"萲",5,"萹萺萻萾",7,"葇葈葉"], ["c880","葊",6,"葒",4,"葘葝葞葟葠葢葤",4,"葪葮葯葰葲葴葷葹葻葼取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁"], ["c940","葽",4,"蒃蒄蒅蒆蒊蒍蒏",7,"蒘蒚蒛蒝蒞蒟蒠蒢",12,"蒰蒱蒳蒵蒶蒷蒻蒼蒾蓀蓂蓃蓅蓆蓇蓈蓋蓌蓎蓏蓒蓔蓕蓗"], ["c980","蓘",4,"蓞蓡蓢蓤蓧",4,"蓭蓮蓯蓱",10,"蓽蓾蔀蔁蔂伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳"], ["ca40","蔃",8,"蔍蔎蔏蔐蔒蔔蔕蔖蔘蔙蔛蔜蔝蔞蔠蔢",8,"蔭",9,"蔾",4,"蕄蕅蕆蕇蕋",10], ["ca80","蕗蕘蕚蕛蕜蕝蕟",4,"蕥蕦蕧蕩",8,"蕳蕵蕶蕷蕸蕼蕽蕿薀薁省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱"], ["cb40","薂薃薆薈",6,"薐",10,"薝",6,"薥薦薧薩薫薬薭薱",5,"薸薺",6,"藂",6,"藊",4,"藑藒"], ["cb80","藔藖",5,"藝",6,"藥藦藧藨藪",14,"恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔"], ["cc40","藹藺藼藽藾蘀",4,"蘆",10,"蘒蘓蘔蘕蘗",15,"蘨蘪",13,"蘹蘺蘻蘽蘾蘿虀"], ["cc80","虁",11,"虒虓處",4,"虛虜虝號虠虡虣",7,"獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃"], ["cd40","虭虯虰虲",6,"蚃",6,"蚎",4,"蚔蚖",5,"蚞",4,"蚥蚦蚫蚭蚮蚲蚳蚷蚸蚹蚻",4,"蛁蛂蛃蛅蛈蛌蛍蛒蛓蛕蛖蛗蛚蛜"], ["cd80","蛝蛠蛡蛢蛣蛥蛦蛧蛨蛪蛫蛬蛯蛵蛶蛷蛺蛻蛼蛽蛿蜁蜄蜅蜆蜋蜌蜎蜏蜐蜑蜔蜖汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威"], ["ce40","蜙蜛蜝蜟蜠蜤蜦蜧蜨蜪蜫蜬蜭蜯蜰蜲蜳蜵蜶蜸蜹蜺蜼蜽蝀",6,"蝊蝋蝍蝏蝐蝑蝒蝔蝕蝖蝘蝚",5,"蝡蝢蝦",7,"蝯蝱蝲蝳蝵"], ["ce80","蝷蝸蝹蝺蝿螀螁螄螆螇螉螊螌螎",4,"螔螕螖螘",6,"螠",4,"巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺"], ["cf40","螥螦螧螩螪螮螰螱螲螴螶螷螸螹螻螼螾螿蟁",4,"蟇蟈蟉蟌",4,"蟔",6,"蟜蟝蟞蟟蟡蟢蟣蟤蟦蟧蟨蟩蟫蟬蟭蟯",9], ["cf80","蟺蟻蟼蟽蟿蠀蠁蠂蠄",5,"蠋",7,"蠔蠗蠘蠙蠚蠜",4,"蠣稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓"], ["d040","蠤",13,"蠳",5,"蠺蠻蠽蠾蠿衁衂衃衆",5,"衎",5,"衕衖衘衚",6,"衦衧衪衭衯衱衳衴衵衶衸衹衺"], ["d080","衻衼袀袃袆袇袉袊袌袎袏袐袑袓袔袕袗",4,"袝",4,"袣袥",5,"小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄"], ["d140","袬袮袯袰袲",4,"袸袹袺袻袽袾袿裀裃裄裇裈裊裋裌裍裏裐裑裓裖裗裚",4,"裠裡裦裧裩",6,"裲裵裶裷裺裻製裿褀褁褃",5], ["d180","褉褋",4,"褑褔",4,"褜",4,"褢褣褤褦褧褨褩褬褭褮褯褱褲褳褵褷选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶"], ["d240","褸",8,"襂襃襅",24,"襠",5,"襧",19,"襼"], ["d280","襽襾覀覂覄覅覇",26,"摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐"], ["d340","覢",30,"觃觍觓觔觕觗觘觙觛觝觟觠觡觢觤觧觨觩觪觬觭觮觰觱觲觴",6], ["d380","觻",4,"訁",5,"計",21,"印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉"], ["d440","訞",31,"訿",8,"詉",21], ["d480","詟",25,"詺",6,"浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧"], ["d540","誁",7,"誋",7,"誔",46], ["d580","諃",32,"铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政"], ["d640","諤",34,"謈",27], ["d680","謤謥謧",30,"帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑"], ["d740","譆",31,"譧",4,"譭",25], ["d780","讇",24,"讬讱讻诇诐诪谉谞住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座"], ["d840","谸",8,"豂豃豄豅豈豊豋豍",7,"豖豗豘豙豛",5,"豣",6,"豬",6,"豴豵豶豷豻",6,"貃貄貆貇"], ["d880","貈貋貍",6,"貕貖貗貙",20,"亍丌兀丐廿卅丕亘丞鬲孬噩丨禺丿匕乇夭爻卮氐囟胤馗毓睾鼗丶亟鼐乜乩亓芈孛啬嘏仄厍厝厣厥厮靥赝匚叵匦匮匾赜卦卣刂刈刎刭刳刿剀剌剞剡剜蒯剽劂劁劐劓冂罔亻仃仉仂仨仡仫仞伛仳伢佤仵伥伧伉伫佞佧攸佚佝"], ["d940","貮",62], ["d980","賭",32,"佟佗伲伽佶佴侑侉侃侏佾佻侪佼侬侔俦俨俪俅俚俣俜俑俟俸倩偌俳倬倏倮倭俾倜倌倥倨偾偃偕偈偎偬偻傥傧傩傺僖儆僭僬僦僮儇儋仝氽佘佥俎龠汆籴兮巽黉馘冁夔勹匍訇匐凫夙兕亠兖亳衮袤亵脔裒禀嬴蠃羸冫冱冽冼"], ["da40","贎",14,"贠赑赒赗赟赥赨赩赪赬赮赯赱赲赸",8,"趂趃趆趇趈趉趌",4,"趒趓趕",9,"趠趡"], ["da80","趢趤",12,"趲趶趷趹趻趽跀跁跂跅跇跈跉跊跍跐跒跓跔凇冖冢冥讠讦讧讪讴讵讷诂诃诋诏诎诒诓诔诖诘诙诜诟诠诤诨诩诮诰诳诶诹诼诿谀谂谄谇谌谏谑谒谔谕谖谙谛谘谝谟谠谡谥谧谪谫谮谯谲谳谵谶卩卺阝阢阡阱阪阽阼陂陉陔陟陧陬陲陴隈隍隗隰邗邛邝邙邬邡邴邳邶邺"], ["db40","跕跘跙跜跠跡跢跥跦跧跩跭跮跰跱跲跴跶跼跾",6,"踆踇踈踋踍踎踐踑踒踓踕",7,"踠踡踤",4,"踫踭踰踲踳踴踶踷踸踻踼踾"], ["db80","踿蹃蹅蹆蹌",4,"蹓",5,"蹚",11,"蹧蹨蹪蹫蹮蹱邸邰郏郅邾郐郄郇郓郦郢郜郗郛郫郯郾鄄鄢鄞鄣鄱鄯鄹酃酆刍奂劢劬劭劾哿勐勖勰叟燮矍廴凵凼鬯厶弁畚巯坌垩垡塾墼壅壑圩圬圪圳圹圮圯坜圻坂坩垅坫垆坼坻坨坭坶坳垭垤垌垲埏垧垴垓垠埕埘埚埙埒垸埴埯埸埤埝"], ["dc40","蹳蹵蹷",4,"蹽蹾躀躂躃躄躆躈",6,"躑躒躓躕",6,"躝躟",11,"躭躮躰躱躳",6,"躻",7], ["dc80","軃",10,"軏",21,"堋堍埽埭堀堞堙塄堠塥塬墁墉墚墀馨鼙懿艹艽艿芏芊芨芄芎芑芗芙芫芸芾芰苈苊苣芘芷芮苋苌苁芩芴芡芪芟苄苎芤苡茉苷苤茏茇苜苴苒苘茌苻苓茑茚茆茔茕苠苕茜荑荛荜茈莒茼茴茱莛荞茯荏荇荃荟荀茗荠茭茺茳荦荥"], ["dd40","軥",62], ["dd80","輤",32,"荨茛荩荬荪荭荮莰荸莳莴莠莪莓莜莅荼莶莩荽莸荻莘莞莨莺莼菁萁菥菘堇萘萋菝菽菖萜萸萑萆菔菟萏萃菸菹菪菅菀萦菰菡葜葑葚葙葳蒇蒈葺蒉葸萼葆葩葶蒌蒎萱葭蓁蓍蓐蓦蒽蓓蓊蒿蒺蓠蒡蒹蒴蒗蓥蓣蔌甍蔸蓰蔹蔟蔺"], ["de40","轅",32,"轪辀辌辒辝辠辡辢辤辥辦辧辪辬辭辮辯農辳辴辵辷辸辺辻込辿迀迃迆"], ["de80","迉",4,"迏迒迖迗迚迠迡迣迧迬迯迱迲迴迵迶迺迻迼迾迿逇逈逌逎逓逕逘蕖蔻蓿蓼蕙蕈蕨蕤蕞蕺瞢蕃蕲蕻薤薨薇薏蕹薮薜薅薹薷薰藓藁藜藿蘧蘅蘩蘖蘼廾弈夼奁耷奕奚奘匏尢尥尬尴扌扪抟抻拊拚拗拮挢拶挹捋捃掭揶捱捺掎掴捭掬掊捩掮掼揲揸揠揿揄揞揎摒揆掾摅摁搋搛搠搌搦搡摞撄摭撖"], ["df40","這逜連逤逥逧",5,"逰",4,"逷逹逺逽逿遀遃遅遆遈",4,"過達違遖遙遚遜",5,"遤遦遧適遪遫遬遯",4,"遶",6,"遾邁"], ["df80","還邅邆邇邉邊邌",4,"邒邔邖邘邚邜邞邟邠邤邥邧邨邩邫邭邲邷邼邽邿郀摺撷撸撙撺擀擐擗擤擢攉攥攮弋忒甙弑卟叱叽叩叨叻吒吖吆呋呒呓呔呖呃吡呗呙吣吲咂咔呷呱呤咚咛咄呶呦咝哐咭哂咴哒咧咦哓哔呲咣哕咻咿哌哙哚哜咩咪咤哝哏哞唛哧唠哽唔哳唢唣唏唑唧唪啧喏喵啉啭啁啕唿啐唼"], ["e040","郂郃郆郈郉郋郌郍郒郔郕郖郘郙郚郞郟郠郣郤郥郩郪郬郮郰郱郲郳郵郶郷郹郺郻郼郿鄀鄁鄃鄅",19,"鄚鄛鄜"], ["e080","鄝鄟鄠鄡鄤",10,"鄰鄲",6,"鄺",8,"酄唷啖啵啶啷唳唰啜喋嗒喃喱喹喈喁喟啾嗖喑啻嗟喽喾喔喙嗪嗷嗉嘟嗑嗫嗬嗔嗦嗝嗄嗯嗥嗲嗳嗌嗍嗨嗵嗤辔嘞嘈嘌嘁嘤嘣嗾嘀嘧嘭噘嘹噗嘬噍噢噙噜噌噔嚆噤噱噫噻噼嚅嚓嚯囔囗囝囡囵囫囹囿圄圊圉圜帏帙帔帑帱帻帼"], ["e140","酅酇酈酑酓酔酕酖酘酙酛酜酟酠酦酧酨酫酭酳酺酻酼醀",4,"醆醈醊醎醏醓",6,"醜",5,"醤",5,"醫醬醰醱醲醳醶醷醸醹醻"], ["e180","醼",10,"釈釋釐釒",9,"針",8,"帷幄幔幛幞幡岌屺岍岐岖岈岘岙岑岚岜岵岢岽岬岫岱岣峁岷峄峒峤峋峥崂崃崧崦崮崤崞崆崛嵘崾崴崽嵬嵛嵯嵝嵫嵋嵊嵩嵴嶂嶙嶝豳嶷巅彳彷徂徇徉後徕徙徜徨徭徵徼衢彡犭犰犴犷犸狃狁狎狍狒狨狯狩狲狴狷猁狳猃狺"], ["e240","釦",62], ["e280","鈥",32,"狻猗猓猡猊猞猝猕猢猹猥猬猸猱獐獍獗獠獬獯獾舛夥飧夤夂饣饧",5,"饴饷饽馀馄馇馊馍馐馑馓馔馕庀庑庋庖庥庠庹庵庾庳赓廒廑廛廨廪膺忄忉忖忏怃忮怄忡忤忾怅怆忪忭忸怙怵怦怛怏怍怩怫怊怿怡恸恹恻恺恂"], ["e340","鉆",45,"鉵",16], ["e380","銆",7,"銏",24,"恪恽悖悚悭悝悃悒悌悛惬悻悱惝惘惆惚悴愠愦愕愣惴愀愎愫慊慵憬憔憧憷懔懵忝隳闩闫闱闳闵闶闼闾阃阄阆阈阊阋阌阍阏阒阕阖阗阙阚丬爿戕氵汔汜汊沣沅沐沔沌汨汩汴汶沆沩泐泔沭泷泸泱泗沲泠泖泺泫泮沱泓泯泾"], ["e440","銨",5,"銯",24,"鋉",31], ["e480","鋩",32,"洹洧洌浃浈洇洄洙洎洫浍洮洵洚浏浒浔洳涑浯涞涠浞涓涔浜浠浼浣渚淇淅淞渎涿淠渑淦淝淙渖涫渌涮渫湮湎湫溲湟溆湓湔渲渥湄滟溱溘滠漭滢溥溧溽溻溷滗溴滏溏滂溟潢潆潇漤漕滹漯漶潋潴漪漉漩澉澍澌潸潲潼潺濑"], ["e540","錊",51,"錿",10], ["e580","鍊",31,"鍫濉澧澹澶濂濡濮濞濠濯瀚瀣瀛瀹瀵灏灞宀宄宕宓宥宸甯骞搴寤寮褰寰蹇謇辶迓迕迥迮迤迩迦迳迨逅逄逋逦逑逍逖逡逵逶逭逯遄遑遒遐遨遘遢遛暹遴遽邂邈邃邋彐彗彖彘尻咫屐屙孱屣屦羼弪弩弭艴弼鬻屮妁妃妍妩妪妣"], ["e640","鍬",34,"鎐",27], ["e680","鎬",29,"鏋鏌鏍妗姊妫妞妤姒妲妯姗妾娅娆姝娈姣姘姹娌娉娲娴娑娣娓婀婧婊婕娼婢婵胬媪媛婷婺媾嫫媲嫒嫔媸嫠嫣嫱嫖嫦嫘嫜嬉嬗嬖嬲嬷孀尕尜孚孥孳孑孓孢驵驷驸驺驿驽骀骁骅骈骊骐骒骓骖骘骛骜骝骟骠骢骣骥骧纟纡纣纥纨纩"], ["e740","鏎",7,"鏗",54], ["e780","鐎",32,"纭纰纾绀绁绂绉绋绌绐绔绗绛绠绡绨绫绮绯绱绲缍绶绺绻绾缁缂缃缇缈缋缌缏缑缒缗缙缜缛缟缡",6,"缪缫缬缭缯",4,"缵幺畿巛甾邕玎玑玮玢玟珏珂珑玷玳珀珉珈珥珙顼琊珩珧珞玺珲琏琪瑛琦琥琨琰琮琬"], ["e840","鐯",14,"鐿",43,"鑬鑭鑮鑯"], ["e880","鑰",20,"钑钖钘铇铏铓铔铚铦铻锜锠琛琚瑁瑜瑗瑕瑙瑷瑭瑾璜璎璀璁璇璋璞璨璩璐璧瓒璺韪韫韬杌杓杞杈杩枥枇杪杳枘枧杵枨枞枭枋杷杼柰栉柘栊柩枰栌柙枵柚枳柝栀柃枸柢栎柁柽栲栳桠桡桎桢桄桤梃栝桕桦桁桧桀栾桊桉栩梵梏桴桷梓桫棂楮棼椟椠棹"], ["e940","锧锳锽镃镈镋镕镚镠镮镴镵長",7,"門",42], ["e980","閫",32,"椤棰椋椁楗棣椐楱椹楠楂楝榄楫榀榘楸椴槌榇榈槎榉楦楣楹榛榧榻榫榭槔榱槁槊槟榕槠榍槿樯槭樗樘橥槲橄樾檠橐橛樵檎橹樽樨橘橼檑檐檩檗檫猷獒殁殂殇殄殒殓殍殚殛殡殪轫轭轱轲轳轵轶轸轷轹轺轼轾辁辂辄辇辋"], ["ea40","闌",27,"闬闿阇阓阘阛阞阠阣",6,"阫阬阭阯阰阷阸阹阺阾陁陃陊陎陏陑陒陓陖陗"], ["ea80","陘陙陚陜陝陞陠陣陥陦陫陭",4,"陳陸",12,"隇隉隊辍辎辏辘辚軎戋戗戛戟戢戡戥戤戬臧瓯瓴瓿甏甑甓攴旮旯旰昊昙杲昃昕昀炅曷昝昴昱昶昵耆晟晔晁晏晖晡晗晷暄暌暧暝暾曛曜曦曩贲贳贶贻贽赀赅赆赈赉赇赍赕赙觇觊觋觌觎觏觐觑牮犟牝牦牯牾牿犄犋犍犏犒挈挲掰"], ["eb40","隌階隑隒隓隕隖隚際隝",9,"隨",7,"隱隲隴隵隷隸隺隻隿雂雃雈雊雋雐雑雓雔雖",9,"雡",6,"雫"], ["eb80","雬雭雮雰雱雲雴雵雸雺電雼雽雿霂霃霅霊霋霌霐霑霒霔霕霗",4,"霝霟霠搿擘耄毪毳毽毵毹氅氇氆氍氕氘氙氚氡氩氤氪氲攵敕敫牍牒牖爰虢刖肟肜肓肼朊肽肱肫肭肴肷胧胨胩胪胛胂胄胙胍胗朐胝胫胱胴胭脍脎胲胼朕脒豚脶脞脬脘脲腈腌腓腴腙腚腱腠腩腼腽腭腧塍媵膈膂膑滕膣膪臌朦臊膻"], ["ec40","霡",8,"霫霬霮霯霱霳",4,"霺霻霼霽霿",18,"靔靕靗靘靚靜靝靟靣靤靦靧靨靪",7], ["ec80","靲靵靷",4,"靽",7,"鞆",4,"鞌鞎鞏鞐鞓鞕鞖鞗鞙",4,"臁膦欤欷欹歃歆歙飑飒飓飕飙飚殳彀毂觳斐齑斓於旆旄旃旌旎旒旖炀炜炖炝炻烀炷炫炱烨烊焐焓焖焯焱煳煜煨煅煲煊煸煺熘熳熵熨熠燠燔燧燹爝爨灬焘煦熹戾戽扃扈扉礻祀祆祉祛祜祓祚祢祗祠祯祧祺禅禊禚禧禳忑忐"], ["ed40","鞞鞟鞡鞢鞤",6,"鞬鞮鞰鞱鞳鞵",46], ["ed80","韤韥韨韮",4,"韴韷",23,"怼恝恚恧恁恙恣悫愆愍慝憩憝懋懑戆肀聿沓泶淼矶矸砀砉砗砘砑斫砭砜砝砹砺砻砟砼砥砬砣砩硎硭硖硗砦硐硇硌硪碛碓碚碇碜碡碣碲碹碥磔磙磉磬磲礅磴礓礤礞礴龛黹黻黼盱眄眍盹眇眈眚眢眙眭眦眵眸睐睑睇睃睚睨"], ["ee40","頏",62], ["ee80","顎",32,"睢睥睿瞍睽瞀瞌瞑瞟瞠瞰瞵瞽町畀畎畋畈畛畲畹疃罘罡罟詈罨罴罱罹羁罾盍盥蠲钅钆钇钋钊钌钍钏钐钔钗钕钚钛钜钣钤钫钪钭钬钯钰钲钴钶",4,"钼钽钿铄铈",6,"铐铑铒铕铖铗铙铘铛铞铟铠铢铤铥铧铨铪"], ["ef40","顯",5,"颋颎颒颕颙颣風",37,"飏飐飔飖飗飛飜飝飠",4], ["ef80","飥飦飩",30,"铩铫铮铯铳铴铵铷铹铼铽铿锃锂锆锇锉锊锍锎锏锒",4,"锘锛锝锞锟锢锪锫锩锬锱锲锴锶锷锸锼锾锿镂锵镄镅镆镉镌镎镏镒镓镔镖镗镘镙镛镞镟镝镡镢镤",8,"镯镱镲镳锺矧矬雉秕秭秣秫稆嵇稃稂稞稔"], ["f040","餈",4,"餎餏餑",28,"餯",26], ["f080","饊",9,"饖",12,"饤饦饳饸饹饻饾馂馃馉稹稷穑黏馥穰皈皎皓皙皤瓞瓠甬鸠鸢鸨",4,"鸲鸱鸶鸸鸷鸹鸺鸾鹁鹂鹄鹆鹇鹈鹉鹋鹌鹎鹑鹕鹗鹚鹛鹜鹞鹣鹦",6,"鹱鹭鹳疒疔疖疠疝疬疣疳疴疸痄疱疰痃痂痖痍痣痨痦痤痫痧瘃痱痼痿瘐瘀瘅瘌瘗瘊瘥瘘瘕瘙"], ["f140","馌馎馚",10,"馦馧馩",47], ["f180","駙",32,"瘛瘼瘢瘠癀瘭瘰瘿瘵癃瘾瘳癍癞癔癜癖癫癯翊竦穸穹窀窆窈窕窦窠窬窨窭窳衤衩衲衽衿袂袢裆袷袼裉裢裎裣裥裱褚裼裨裾裰褡褙褓褛褊褴褫褶襁襦襻疋胥皲皴矜耒耔耖耜耠耢耥耦耧耩耨耱耋耵聃聆聍聒聩聱覃顸颀颃"], ["f240","駺",62], ["f280","騹",32,"颉颌颍颏颔颚颛颞颟颡颢颥颦虍虔虬虮虿虺虼虻蚨蚍蚋蚬蚝蚧蚣蚪蚓蚩蚶蛄蚵蛎蚰蚺蚱蚯蛉蛏蚴蛩蛱蛲蛭蛳蛐蜓蛞蛴蛟蛘蛑蜃蜇蛸蜈蜊蜍蜉蜣蜻蜞蜥蜮蜚蜾蝈蜴蜱蜩蜷蜿螂蜢蝽蝾蝻蝠蝰蝌蝮螋蝓蝣蝼蝤蝙蝥螓螯螨蟒"], ["f340","驚",17,"驲骃骉骍骎骔骕骙骦骩",6,"骲骳骴骵骹骻骽骾骿髃髄髆",4,"髍髎髏髐髒體髕髖髗髙髚髛髜"], ["f380","髝髞髠髢髣髤髥髧髨髩髪髬髮髰",8,"髺髼",6,"鬄鬅鬆蟆螈螅螭螗螃螫蟥螬螵螳蟋蟓螽蟑蟀蟊蟛蟪蟠蟮蠖蠓蟾蠊蠛蠡蠹蠼缶罂罄罅舐竺竽笈笃笄笕笊笫笏筇笸笪笙笮笱笠笥笤笳笾笞筘筚筅筵筌筝筠筮筻筢筲筱箐箦箧箸箬箝箨箅箪箜箢箫箴篑篁篌篝篚篥篦篪簌篾篼簏簖簋"], ["f440","鬇鬉",5,"鬐鬑鬒鬔",10,"鬠鬡鬢鬤",10,"鬰鬱鬳",7,"鬽鬾鬿魀魆魊魋魌魎魐魒魓魕",5], ["f480","魛",32,"簟簪簦簸籁籀臾舁舂舄臬衄舡舢舣舭舯舨舫舸舻舳舴舾艄艉艋艏艚艟艨衾袅袈裘裟襞羝羟羧羯羰羲籼敉粑粝粜粞粢粲粼粽糁糇糌糍糈糅糗糨艮暨羿翎翕翥翡翦翩翮翳糸絷綦綮繇纛麸麴赳趄趔趑趱赧赭豇豉酊酐酎酏酤"], ["f540","魼",62], ["f580","鮻",32,"酢酡酰酩酯酽酾酲酴酹醌醅醐醍醑醢醣醪醭醮醯醵醴醺豕鹾趸跫踅蹙蹩趵趿趼趺跄跖跗跚跞跎跏跛跆跬跷跸跣跹跻跤踉跽踔踝踟踬踮踣踯踺蹀踹踵踽踱蹉蹁蹂蹑蹒蹊蹰蹶蹼蹯蹴躅躏躔躐躜躞豸貂貊貅貘貔斛觖觞觚觜"], ["f640","鯜",62], ["f680","鰛",32,"觥觫觯訾謦靓雩雳雯霆霁霈霏霎霪霭霰霾龀龃龅",5,"龌黾鼋鼍隹隼隽雎雒瞿雠銎銮鋈錾鍪鏊鎏鐾鑫鱿鲂鲅鲆鲇鲈稣鲋鲎鲐鲑鲒鲔鲕鲚鲛鲞",5,"鲥",4,"鲫鲭鲮鲰",7,"鲺鲻鲼鲽鳄鳅鳆鳇鳊鳋"], ["f740","鰼",62], ["f780","鱻鱽鱾鲀鲃鲄鲉鲊鲌鲏鲓鲖鲗鲘鲙鲝鲪鲬鲯鲹鲾",4,"鳈鳉鳑鳒鳚鳛鳠鳡鳌",4,"鳓鳔鳕鳗鳘鳙鳜鳝鳟鳢靼鞅鞑鞒鞔鞯鞫鞣鞲鞴骱骰骷鹘骶骺骼髁髀髅髂髋髌髑魅魃魇魉魈魍魑飨餍餮饕饔髟髡髦髯髫髻髭髹鬈鬏鬓鬟鬣麽麾縻麂麇麈麋麒鏖麝麟黛黜黝黠黟黢黩黧黥黪黯鼢鼬鼯鼹鼷鼽鼾齄"], ["f840","鳣",62], ["f880","鴢",32], ["f940","鵃",62], ["f980","鶂",32], ["fa40","鶣",62], ["fa80","鷢",32], ["fb40","鸃",27,"鸤鸧鸮鸰鸴鸻鸼鹀鹍鹐鹒鹓鹔鹖鹙鹝鹟鹠鹡鹢鹥鹮鹯鹲鹴",9,"麀"], ["fb80","麁麃麄麅麆麉麊麌",5,"麔",8,"麞麠",5,"麧麨麩麪"], ["fc40","麫",8,"麵麶麷麹麺麼麿",4,"黅黆黇黈黊黋黌黐黒黓黕黖黗黙黚點黡黣黤黦黨黫黬黭黮黰",8,"黺黽黿",6], ["fc80","鼆",4,"鼌鼏鼑鼒鼔鼕鼖鼘鼚",5,"鼡鼣",8,"鼭鼮鼰鼱"], ["fd40","鼲",4,"鼸鼺鼼鼿",4,"齅",10,"齒",38], ["fd80","齹",5,"龁龂龍",11,"龜龝龞龡",4,"郎凉秊裏隣"], ["fe40","兀嗀﨎﨏﨑﨓﨔礼﨟蘒﨡﨣﨤﨧﨨﨩"] ] [ ["0","\u0000",127], ["8141","갂갃갅갆갋",4,"갘갞갟갡갢갣갥",6,"갮갲갳갴"], ["8161","갵갶갷갺갻갽갾갿걁",9,"걌걎",5,"걕"], ["8181","걖걗걙걚걛걝",18,"걲걳걵걶걹걻",4,"겂겇겈겍겎겏겑겒겓겕",6,"겞겢",5,"겫겭겮겱",6,"겺겾겿곀곂곃곅곆곇곉곊곋곍",7,"곖곘",7,"곢곣곥곦곩곫곭곮곲곴곷",4,"곾곿괁괂괃괅괇",4,"괎괐괒괓"], ["8241","괔괕괖괗괙괚괛괝괞괟괡",7,"괪괫괮",5], ["8261","괶괷괹괺괻괽",6,"굆굈굊",5,"굑굒굓굕굖굗"], ["8281","굙",7,"굢굤",7,"굮굯굱굲굷굸굹굺굾궀궃",4,"궊궋궍궎궏궑",10,"궞",5,"궥",17,"궸",7,"귂귃귅귆귇귉",6,"귒귔",7,"귝귞귟귡귢귣귥",18], ["8341","귺귻귽귾긂",5,"긊긌긎",5,"긕",7], ["8361","긝",18,"긲긳긵긶긹긻긼"], ["8381","긽긾긿깂깄깇깈깉깋깏깑깒깓깕깗",4,"깞깢깣깤깦깧깪깫깭깮깯깱",6,"깺깾",5,"꺆",5,"꺍",46,"꺿껁껂껃껅",6,"껎껒",5,"껚껛껝",8], ["8441","껦껧껩껪껬껮",5,"껵껶껷껹껺껻껽",8], ["8461","꼆꼉꼊꼋꼌꼎꼏꼑",18], ["8481","꼤",7,"꼮꼯꼱꼳꼵",6,"꼾꽀꽄꽅꽆꽇꽊",5,"꽑",10,"꽞",5,"꽦",18,"꽺",5,"꾁꾂꾃꾅꾆꾇꾉",6,"꾒꾓꾔꾖",5,"꾝",26,"꾺꾻꾽꾾"], ["8541","꾿꿁",5,"꿊꿌꿏",4,"꿕",6,"꿝",4], ["8561","꿢",5,"꿪",5,"꿲꿳꿵꿶꿷꿹",6,"뀂뀃"], ["8581","뀅",6,"뀍뀎뀏뀑뀒뀓뀕",6,"뀞",9,"뀩",26,"끆끇끉끋끍끏끐끑끒끖끘끚끛끜끞",29,"끾끿낁낂낃낅",6,"낎낐낒",5,"낛낝낞낣낤"], ["8641","낥낦낧낪낰낲낶낷낹낺낻낽",6,"냆냊",5,"냒"], ["8661","냓냕냖냗냙",6,"냡냢냣냤냦",10], ["8681","냱",22,"넊넍넎넏넑넔넕넖넗넚넞",4,"넦넧넩넪넫넭",6,"넶넺",5,"녂녃녅녆녇녉",6,"녒녓녖녗녙녚녛녝녞녟녡",22,"녺녻녽녾녿놁놃",4,"놊놌놎놏놐놑놕놖놗놙놚놛놝"], ["8741","놞",9,"놩",15], ["8761","놹",18,"뇍뇎뇏뇑뇒뇓뇕"], ["8781","뇖",5,"뇞뇠",7,"뇪뇫뇭뇮뇯뇱",7,"뇺뇼뇾",5,"눆눇눉눊눍",6,"눖눘눚",5,"눡",18,"눵",6,"눽",26,"뉙뉚뉛뉝뉞뉟뉡",6,"뉪",4], ["8841","뉯",4,"뉶",5,"뉽",6,"늆늇늈늊",4], ["8861","늏늒늓늕늖늗늛",4,"늢늤늧늨늩늫늭늮늯늱늲늳늵늶늷"], ["8881","늸",15,"닊닋닍닎닏닑닓",4,"닚닜닞닟닠닡닣닧닩닪닰닱닲닶닼닽닾댂댃댅댆댇댉",6,"댒댖",5,"댝",54,"덗덙덚덝덠덡덢덣"], ["8941","덦덨덪덬덭덯덲덳덵덶덷덹",6,"뎂뎆",5,"뎍"], ["8961","뎎뎏뎑뎒뎓뎕",10,"뎢",5,"뎩뎪뎫뎭"], ["8981","뎮",21,"돆돇돉돊돍돏돑돒돓돖돘돚돜돞돟돡돢돣돥돦돧돩",18,"돽",18,"됑",6,"됙됚됛됝됞됟됡",6,"됪됬",7,"됵",15], ["8a41","둅",10,"둒둓둕둖둗둙",6,"둢둤둦"], ["8a61","둧",4,"둭",18,"뒁뒂"], ["8a81","뒃",4,"뒉",19,"뒞",5,"뒥뒦뒧뒩뒪뒫뒭",7,"뒶뒸뒺",5,"듁듂듃듅듆듇듉",6,"듑듒듓듔듖",5,"듞듟듡듢듥듧",4,"듮듰듲",5,"듹",26,"딖딗딙딚딝"], ["8b41","딞",5,"딦딫",4,"딲딳딵딶딷딹",6,"땂땆"], ["8b61","땇땈땉땊땎땏땑땒땓땕",6,"땞땢",8], ["8b81","땫",52,"떢떣떥떦떧떩떬떭떮떯떲떶",4,"떾떿뗁뗂뗃뗅",6,"뗎뗒",5,"뗙",18,"뗭",18], ["8c41","똀",15,"똒똓똕똖똗똙",4], ["8c61","똞",6,"똦",5,"똭",6,"똵",5], ["8c81","똻",12,"뙉",26,"뙥뙦뙧뙩",50,"뚞뚟뚡뚢뚣뚥",5,"뚭뚮뚯뚰뚲",16], ["8d41","뛃",16,"뛕",8], ["8d61","뛞",17,"뛱뛲뛳뛵뛶뛷뛹뛺"], ["8d81","뛻",4,"뜂뜃뜄뜆",33,"뜪뜫뜭뜮뜱",6,"뜺뜼",7,"띅띆띇띉띊띋띍",6,"띖",9,"띡띢띣띥띦띧띩",6,"띲띴띶",5,"띾띿랁랂랃랅",6,"랎랓랔랕랚랛랝랞"], ["8e41","랟랡",6,"랪랮",5,"랶랷랹",8], ["8e61","럂",4,"럈럊",19], ["8e81","럞",13,"럮럯럱럲럳럵",6,"럾렂",4,"렊렋렍렎렏렑",6,"렚렜렞",5,"렦렧렩렪렫렭",6,"렶렺",5,"롁롂롃롅",11,"롒롔",7,"롞롟롡롢롣롥",6,"롮롰롲",5,"롹롺롻롽",7], ["8f41","뢅",7,"뢎",17], ["8f61","뢠",7,"뢩",6,"뢱뢲뢳뢵뢶뢷뢹",4], ["8f81","뢾뢿룂룄룆",5,"룍룎룏룑룒룓룕",7,"룞룠룢",5,"룪룫룭룮룯룱",6,"룺룼룾",5,"뤅",18,"뤙",6,"뤡",26,"뤾뤿륁륂륃륅",6,"륍륎륐륒",5], ["9041","륚륛륝륞륟륡",6,"륪륬륮",5,"륶륷륹륺륻륽"], ["9061","륾",5,"릆릈릋릌릏",15], ["9081","릟",12,"릮릯릱릲릳릵",6,"릾맀맂",5,"맊맋맍맓",4,"맚맜맟맠맢맦맧맩맪맫맭",6,"맶맻",4,"먂",5,"먉",11,"먖",33,"먺먻먽먾먿멁멃멄멅멆"], ["9141","멇멊멌멏멐멑멒멖멗멙멚멛멝",6,"멦멪",5], ["9161","멲멳멵멶멷멹",9,"몆몈몉몊몋몍",5], ["9181","몓",20,"몪몭몮몯몱몳",4,"몺몼몾",5,"뫅뫆뫇뫉",14,"뫚",33,"뫽뫾뫿묁묂묃묅",7,"묎묐묒",5,"묙묚묛묝묞묟묡",6], ["9241","묨묪묬",7,"묷묹묺묿",4,"뭆뭈뭊뭋뭌뭎뭑뭒"], ["9261","뭓뭕뭖뭗뭙",7,"뭢뭤",7,"뭭",4], ["9281","뭲",21,"뮉뮊뮋뮍뮎뮏뮑",18,"뮥뮦뮧뮩뮪뮫뮭",6,"뮵뮶뮸",7,"믁믂믃믅믆믇믉",6,"믑믒믔",35,"믺믻믽믾밁"], ["9341","밃",4,"밊밎밐밒밓밙밚밠밡밢밣밦밨밪밫밬밮밯밲밳밵"], ["9361","밶밷밹",6,"뱂뱆뱇뱈뱊뱋뱎뱏뱑",8], ["9381","뱚뱛뱜뱞",37,"벆벇벉벊벍벏",4,"벖벘벛",4,"벢벣벥벦벩",6,"벲벶",5,"벾벿볁볂볃볅",7,"볎볒볓볔볖볗볙볚볛볝",22,"볷볹볺볻볽"], ["9441","볾",5,"봆봈봊",5,"봑봒봓봕",8], ["9461","봞",5,"봥",6,"봭",12], ["9481","봺",5,"뵁",6,"뵊뵋뵍뵎뵏뵑",6,"뵚",9,"뵥뵦뵧뵩",22,"붂붃붅붆붋",4,"붒붔붖붗붘붛붝",6,"붥",10,"붱",6,"붹",24], ["9541","뷒뷓뷖뷗뷙뷚뷛뷝",11,"뷪",5,"뷱"], ["9561","뷲뷳뷵뷶뷷뷹",6,"븁븂븄븆",5,"븎븏븑븒븓"], ["9581","븕",6,"븞븠",35,"빆빇빉빊빋빍빏",4,"빖빘빜빝빞빟빢빣빥빦빧빩빫",4,"빲빶",4,"빾빿뺁뺂뺃뺅",6,"뺎뺒",5,"뺚",13,"뺩",14], ["9641","뺸",23,"뻒뻓"], ["9661","뻕뻖뻙",6,"뻡뻢뻦",5,"뻭",8], ["9681","뻶",10,"뼂",5,"뼊",13,"뼚뼞",33,"뽂뽃뽅뽆뽇뽉",6,"뽒뽓뽔뽖",44], ["9741","뾃",16,"뾕",8], ["9761","뾞",17,"뾱",7], ["9781","뾹",11,"뿆",5,"뿎뿏뿑뿒뿓뿕",6,"뿝뿞뿠뿢",89,"쀽쀾쀿"], ["9841","쁀",16,"쁒",5,"쁙쁚쁛"], ["9861","쁝쁞쁟쁡",6,"쁪",15], ["9881","쁺",21,"삒삓삕삖삗삙",6,"삢삤삦",5,"삮삱삲삷",4,"삾샂샃샄샆샇샊샋샍샎샏샑",6,"샚샞",5,"샦샧샩샪샫샭",6,"샶샸샺",5,"섁섂섃섅섆섇섉",6,"섑섒섓섔섖",5,"섡섢섥섨섩섪섫섮"], ["9941","섲섳섴섵섷섺섻섽섾섿셁",6,"셊셎",5,"셖셗"], ["9961","셙셚셛셝",6,"셦셪",5,"셱셲셳셵셶셷셹셺셻"], ["9981","셼",8,"솆",5,"솏솑솒솓솕솗",4,"솞솠솢솣솤솦솧솪솫솭솮솯솱",11,"솾",5,"쇅쇆쇇쇉쇊쇋쇍",6,"쇕쇖쇙",6,"쇡쇢쇣쇥쇦쇧쇩",6,"쇲쇴",7,"쇾쇿숁숂숃숅",6,"숎숐숒",5,"숚숛숝숞숡숢숣"], ["9a41","숤숥숦숧숪숬숮숰숳숵",16], ["9a61","쉆쉇쉉",6,"쉒쉓쉕쉖쉗쉙",6,"쉡쉢쉣쉤쉦"], ["9a81","쉧",4,"쉮쉯쉱쉲쉳쉵",6,"쉾슀슂",5,"슊",5,"슑",6,"슙슚슜슞",5,"슦슧슩슪슫슮",5,"슶슸슺",33,"싞싟싡싢싥",5,"싮싰싲싳싴싵싷싺싽싾싿쌁",6,"쌊쌋쌎쌏"], ["9b41","쌐쌑쌒쌖쌗쌙쌚쌛쌝",6,"쌦쌧쌪",8], ["9b61","쌳",17,"썆",7], ["9b81","썎",25,"썪썫썭썮썯썱썳",4,"썺썻썾",5,"쎅쎆쎇쎉쎊쎋쎍",50,"쏁",22,"쏚"], ["9c41","쏛쏝쏞쏡쏣",4,"쏪쏫쏬쏮",5,"쏶쏷쏹",5], ["9c61","쏿",8,"쐉",6,"쐑",9], ["9c81","쐛",8,"쐥",6,"쐭쐮쐯쐱쐲쐳쐵",6,"쐾",9,"쑉",26,"쑦쑧쑩쑪쑫쑭",6,"쑶쑷쑸쑺",5,"쒁",18,"쒕",6,"쒝",12], ["9d41","쒪",13,"쒹쒺쒻쒽",8], ["9d61","쓆",25], ["9d81","쓠",8,"쓪",5,"쓲쓳쓵쓶쓷쓹쓻쓼쓽쓾씂",9,"씍씎씏씑씒씓씕",6,"씝",10,"씪씫씭씮씯씱",6,"씺씼씾",5,"앆앇앋앏앐앑앒앖앚앛앜앟앢앣앥앦앧앩",6,"앲앶",5,"앾앿얁얂얃얅얆얈얉얊얋얎얐얒얓얔"], ["9e41","얖얙얚얛얝얞얟얡",7,"얪",9,"얶"], ["9e61","얷얺얿",4,"엋엍엏엒엓엕엖엗엙",6,"엢엤엦엧"], ["9e81","엨엩엪엫엯엱엲엳엵엸엹엺엻옂옃옄옉옊옋옍옎옏옑",6,"옚옝",6,"옦옧옩옪옫옯옱옲옶옸옺옼옽옾옿왂왃왅왆왇왉",6,"왒왖",5,"왞왟왡",10,"왭왮왰왲",5,"왺왻왽왾왿욁",6,"욊욌욎",5,"욖욗욙욚욛욝",6,"욦"], ["9f41","욨욪",5,"욲욳욵욶욷욻",4,"웂웄웆",5,"웎"], ["9f61","웏웑웒웓웕",6,"웞웟웢",5,"웪웫웭웮웯웱웲"], ["9f81","웳",4,"웺웻웼웾",5,"윆윇윉윊윋윍",6,"윖윘윚",5,"윢윣윥윦윧윩",6,"윲윴윶윸윹윺윻윾윿읁읂읃읅",4,"읋읎읐읙읚읛읝읞읟읡",6,"읩읪읬",7,"읶읷읹읺읻읿잀잁잂잆잋잌잍잏잒잓잕잙잛",4,"잢잧",4,"잮잯잱잲잳잵잶잷"], ["a041","잸잹잺잻잾쟂",5,"쟊쟋쟍쟏쟑",6,"쟙쟚쟛쟜"], ["a061","쟞",5,"쟥쟦쟧쟩쟪쟫쟭",13], ["a081","쟻",4,"젂젃젅젆젇젉젋",4,"젒젔젗",4,"젞젟젡젢젣젥",6,"젮젰젲",5,"젹젺젻젽젾젿졁",6,"졊졋졎",5,"졕",26,"졲졳졵졶졷졹졻",4,"좂좄좈좉좊좎",5,"좕",7,"좞좠좢좣좤"], ["a141","좥좦좧좩",18,"좾좿죀죁"], ["a161","죂죃죅죆죇죉죊죋죍",6,"죖죘죚",5,"죢죣죥"], ["a181","죦",14,"죶",5,"죾죿줁줂줃줇",4,"줎 、。·‥…¨〃­―∥\∼‘’“”〔〕〈",9,"±×÷≠≤≥∞∴°′″℃Å¢£¥♂♀∠⊥⌒∂∇≡≒§※☆★○●◎◇◆□■△▲▽▼→←↑↓↔〓≪≫√∽∝∵∫∬∈∋⊆⊇⊂⊃∪∩∧∨¬"], ["a241","줐줒",5,"줙",18], ["a261","줭",6,"줵",18], ["a281","쥈",7,"쥒쥓쥕쥖쥗쥙",6,"쥢쥤",7,"쥭쥮쥯⇒⇔∀∃´~ˇ˘˝˚˙¸˛¡¿ː∮∑∏¤℉‰◁◀▷▶♤♠♡♥♧♣⊙◈▣◐◑▒▤▥▨▧▦▩♨☏☎☜☞¶†‡↕↗↙↖↘♭♩♪♬㉿㈜№㏇™㏂㏘℡€®"], ["a341","쥱쥲쥳쥵",6,"쥽",10,"즊즋즍즎즏"], ["a361","즑",6,"즚즜즞",16], ["a381","즯",16,"짂짃짅짆짉짋",4,"짒짔짗짘짛!",58,"₩]",32," ̄"], ["a441","짞짟짡짣짥짦짨짩짪짫짮짲",5,"짺짻짽짾짿쨁쨂쨃쨄"], ["a461","쨅쨆쨇쨊쨎",5,"쨕쨖쨗쨙",12], ["a481","쨦쨧쨨쨪",28,"ㄱ",93], ["a541","쩇",4,"쩎쩏쩑쩒쩓쩕",6,"쩞쩢",5,"쩩쩪"], ["a561","쩫",17,"쩾",5,"쪅쪆"], ["a581","쪇",16,"쪙",14,"ⅰ",9], ["a5b0","Ⅰ",9], ["a5c1","Α",16,"Σ",6], ["a5e1","α",16,"σ",6], ["a641","쪨",19,"쪾쪿쫁쫂쫃쫅"], ["a661","쫆",5,"쫎쫐쫒쫔쫕쫖쫗쫚",5,"쫡",6], ["a681","쫨쫩쫪쫫쫭",6,"쫵",18,"쬉쬊─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂┒┑┚┙┖┕┎┍┞┟┡┢┦┧┩┪┭┮┱┲┵┶┹┺┽┾╀╁╃",7], ["a741","쬋",4,"쬑쬒쬓쬕쬖쬗쬙",6,"쬢",7], ["a761","쬪",22,"쭂쭃쭄"], ["a781","쭅쭆쭇쭊쭋쭍쭎쭏쭑",6,"쭚쭛쭜쭞",5,"쭥",7,"㎕㎖㎗ℓ㎘㏄㎣㎤㎥㎦㎙",9,"㏊㎍㎎㎏㏏㎈㎉㏈㎧㎨㎰",9,"㎀",4,"㎺",5,"㎐",4,"Ω㏀㏁㎊㎋㎌㏖㏅㎭㎮㎯㏛㎩㎪㎫㎬㏝㏐㏓㏃㏉㏜㏆"], ["a841","쭭",10,"쭺",14], ["a861","쮉",18,"쮝",6], ["a881","쮤",19,"쮹",11,"ÆÐªĦ"], ["a8a6","IJ"], ["a8a8","ĿŁØŒºÞŦŊ"], ["a8b1","㉠",27,"ⓐ",25,"①",14,"½⅓⅔¼¾⅛⅜⅝⅞"], ["a941","쯅",14,"쯕",10], ["a961","쯠쯡쯢쯣쯥쯦쯨쯪",18], ["a981","쯽",14,"찎찏찑찒찓찕",6,"찞찟찠찣찤æđðħıijĸŀłøœßþŧŋʼn㈀",27,"⒜",25,"⑴",14,"¹²³⁴ⁿ₁₂₃₄"], ["aa41","찥찦찪찫찭찯찱",6,"찺찿",4,"챆챇챉챊챋챍챎"], ["aa61","챏",4,"챖챚",5,"챡챢챣챥챧챩",6,"챱챲"], ["aa81","챳챴챶",29,"ぁ",82], ["ab41","첔첕첖첗첚첛첝첞첟첡",6,"첪첮",5,"첶첷첹"], ["ab61","첺첻첽",6,"쳆쳈쳊",5,"쳑쳒쳓쳕",5], ["ab81","쳛",8,"쳥",6,"쳭쳮쳯쳱",12,"ァ",85], ["ac41","쳾쳿촀촂",5,"촊촋촍촎촏촑",6,"촚촜촞촟촠"], ["ac61","촡촢촣촥촦촧촩촪촫촭",11,"촺",4], ["ac81","촿",28,"쵝쵞쵟А",5,"ЁЖ",25], ["acd1","а",5,"ёж",25], ["ad41","쵡쵢쵣쵥",6,"쵮쵰쵲",5,"쵹",7], ["ad61","춁",6,"춉",10,"춖춗춙춚춛춝춞춟"], ["ad81","춠춡춢춣춦춨춪",5,"춱",18,"췅"], ["ae41","췆",5,"췍췎췏췑",16], ["ae61","췢",5,"췩췪췫췭췮췯췱",6,"췺췼췾",4], ["ae81","츃츅츆츇츉츊츋츍",6,"츕츖츗츘츚",5,"츢츣츥츦츧츩츪츫"], ["af41","츬츭츮츯츲츴츶",19], ["af61","칊",13,"칚칛칝칞칢",5,"칪칬"], ["af81","칮",5,"칶칷칹칺칻칽",6,"캆캈캊",5,"캒캓캕캖캗캙"], ["b041","캚",5,"캢캦",5,"캮",12], ["b061","캻",5,"컂",19], ["b081","컖",13,"컦컧컩컪컭",6,"컶컺",5,"가각간갇갈갉갊감",7,"같",4,"갠갤갬갭갯갰갱갸갹갼걀걋걍걔걘걜거걱건걷걸걺검겁것겄겅겆겉겊겋게겐겔겜겝겟겠겡겨격겪견겯결겸겹겻겼경곁계곈곌곕곗고곡곤곧골곪곬곯곰곱곳공곶과곽관괄괆"], ["b141","켂켃켅켆켇켉",6,"켒켔켖",5,"켝켞켟켡켢켣"], ["b161","켥",6,"켮켲",5,"켹",11], ["b181","콅",14,"콖콗콙콚콛콝",6,"콦콨콪콫콬괌괍괏광괘괜괠괩괬괭괴괵괸괼굄굅굇굉교굔굘굡굣구국군굳굴굵굶굻굼굽굿궁궂궈궉권궐궜궝궤궷귀귁귄귈귐귑귓규균귤그극근귿글긁금급긋긍긔기긱긴긷길긺김깁깃깅깆깊까깍깎깐깔깖깜깝깟깠깡깥깨깩깬깰깸"], ["b241","콭콮콯콲콳콵콶콷콹",6,"쾁쾂쾃쾄쾆",5,"쾍"], ["b261","쾎",18,"쾢",5,"쾩"], ["b281","쾪",5,"쾱",18,"쿅",6,"깹깻깼깽꺄꺅꺌꺼꺽꺾껀껄껌껍껏껐껑께껙껜껨껫껭껴껸껼꼇꼈꼍꼐꼬꼭꼰꼲꼴꼼꼽꼿꽁꽂꽃꽈꽉꽐꽜꽝꽤꽥꽹꾀꾄꾈꾐꾑꾕꾜꾸꾹꾼꿀꿇꿈꿉꿋꿍꿎꿔꿜꿨꿩꿰꿱꿴꿸뀀뀁뀄뀌뀐뀔뀜뀝뀨끄끅끈끊끌끎끓끔끕끗끙"], ["b341","쿌",19,"쿢쿣쿥쿦쿧쿩"], ["b361","쿪",5,"쿲쿴쿶",5,"쿽쿾쿿퀁퀂퀃퀅",5], ["b381","퀋",5,"퀒",5,"퀙",19,"끝끼끽낀낄낌낍낏낑나낙낚난낟날낡낢남납낫",4,"낱낳내낵낸낼냄냅냇냈냉냐냑냔냘냠냥너넉넋넌널넒넓넘넙넛넜넝넣네넥넨넬넴넵넷넸넹녀녁년녈념녑녔녕녘녜녠노녹논놀놂놈놉놋농높놓놔놘놜놨뇌뇐뇔뇜뇝"], ["b441","퀮",5,"퀶퀷퀹퀺퀻퀽",6,"큆큈큊",5], ["b461","큑큒큓큕큖큗큙",6,"큡",10,"큮큯"], ["b481","큱큲큳큵",6,"큾큿킀킂",18,"뇟뇨뇩뇬뇰뇹뇻뇽누눅눈눋눌눔눕눗눙눠눴눼뉘뉜뉠뉨뉩뉴뉵뉼늄늅늉느늑는늘늙늚늠늡늣능늦늪늬늰늴니닉닌닐닒님닙닛닝닢다닥닦단닫",4,"닳담답닷",4,"닿대댁댄댈댐댑댓댔댕댜더덕덖던덛덜덞덟덤덥"], ["b541","킕",14,"킦킧킩킪킫킭",5], ["b561","킳킶킸킺",5,"탂탃탅탆탇탊",5,"탒탖",4], ["b581","탛탞탟탡탢탣탥",6,"탮탲",5,"탹",11,"덧덩덫덮데덱덴델뎀뎁뎃뎄뎅뎌뎐뎔뎠뎡뎨뎬도독돈돋돌돎돐돔돕돗동돛돝돠돤돨돼됐되된될됨됩됫됴두둑둔둘둠둡둣둥둬뒀뒈뒝뒤뒨뒬뒵뒷뒹듀듄듈듐듕드득든듣들듦듬듭듯등듸디딕딘딛딜딤딥딧딨딩딪따딱딴딸"], ["b641","턅",7,"턎",17], ["b661","턠",15,"턲턳턵턶턷턹턻턼턽턾"], ["b681","턿텂텆",5,"텎텏텑텒텓텕",6,"텞텠텢",5,"텩텪텫텭땀땁땃땄땅땋때땍땐땔땜땝땟땠땡떠떡떤떨떪떫떰떱떳떴떵떻떼떽뗀뗄뗌뗍뗏뗐뗑뗘뗬또똑똔똘똥똬똴뙈뙤뙨뚜뚝뚠뚤뚫뚬뚱뛔뛰뛴뛸뜀뜁뜅뜨뜩뜬뜯뜰뜸뜹뜻띄띈띌띔띕띠띤띨띰띱띳띵라락란랄람랍랏랐랑랒랖랗"], ["b741","텮",13,"텽",6,"톅톆톇톉톊"], ["b761","톋",20,"톢톣톥톦톧"], ["b781","톩",6,"톲톴톶톷톸톹톻톽톾톿퇁",14,"래랙랜랠램랩랫랬랭랴략랸럇량러럭런럴럼럽럿렀렁렇레렉렌렐렘렙렛렝려력련렬렴렵렷렸령례롄롑롓로록론롤롬롭롯롱롸롼뢍뢨뢰뢴뢸룀룁룃룅료룐룔룝룟룡루룩룬룰룸룹룻룽뤄뤘뤠뤼뤽륀륄륌륏륑류륙륜률륨륩"], ["b841","퇐",7,"퇙",17], ["b861","퇫",8,"퇵퇶퇷퇹",13], ["b881","툈툊",5,"툑",24,"륫륭르륵른를름릅릇릉릊릍릎리릭린릴림립릿링마막만많",4,"맘맙맛망맞맡맣매맥맨맬맴맵맷맸맹맺먀먁먈먕머먹먼멀멂멈멉멋멍멎멓메멕멘멜멤멥멧멨멩며멱면멸몃몄명몇몌모목몫몬몰몲몸몹못몽뫄뫈뫘뫙뫼"], ["b941","툪툫툮툯툱툲툳툵",6,"툾퉀퉂",5,"퉉퉊퉋퉌"], ["b961","퉍",14,"퉝",6,"퉥퉦퉧퉨"], ["b981","퉩",22,"튂튃튅튆튇튉튊튋튌묀묄묍묏묑묘묜묠묩묫무묵묶문묻물묽묾뭄뭅뭇뭉뭍뭏뭐뭔뭘뭡뭣뭬뮈뮌뮐뮤뮨뮬뮴뮷므믄믈믐믓미믹민믿밀밂밈밉밋밌밍및밑바",4,"받",4,"밤밥밧방밭배백밴밸뱀뱁뱃뱄뱅뱉뱌뱍뱐뱝버벅번벋벌벎범법벗"], ["ba41","튍튎튏튒튓튔튖",5,"튝튞튟튡튢튣튥",6,"튭"], ["ba61","튮튯튰튲",5,"튺튻튽튾틁틃",4,"틊틌",5], ["ba81","틒틓틕틖틗틙틚틛틝",6,"틦",9,"틲틳틵틶틷틹틺벙벚베벡벤벧벨벰벱벳벴벵벼벽변별볍볏볐병볕볘볜보복볶본볼봄봅봇봉봐봔봤봬뵀뵈뵉뵌뵐뵘뵙뵤뵨부북분붇불붉붊붐붑붓붕붙붚붜붤붰붸뷔뷕뷘뷜뷩뷰뷴뷸븀븃븅브븍븐블븜븝븟비빅빈빌빎빔빕빗빙빚빛빠빡빤"], ["bb41","틻",4,"팂팄팆",5,"팏팑팒팓팕팗",4,"팞팢팣"], ["bb61","팤팦팧팪팫팭팮팯팱",6,"팺팾",5,"퍆퍇퍈퍉"], ["bb81","퍊",31,"빨빪빰빱빳빴빵빻빼빽뺀뺄뺌뺍뺏뺐뺑뺘뺙뺨뻐뻑뻔뻗뻘뻠뻣뻤뻥뻬뼁뼈뼉뼘뼙뼛뼜뼝뽀뽁뽄뽈뽐뽑뽕뾔뾰뿅뿌뿍뿐뿔뿜뿟뿡쀼쁑쁘쁜쁠쁨쁩삐삑삔삘삠삡삣삥사삭삯산삳살삵삶삼삽삿샀상샅새색샌샐샘샙샛샜생샤"], ["bc41","퍪",17,"퍾퍿펁펂펃펅펆펇"], ["bc61","펈펉펊펋펎펒",5,"펚펛펝펞펟펡",6,"펪펬펮"], ["bc81","펯",4,"펵펶펷펹펺펻펽",6,"폆폇폊",5,"폑",5,"샥샨샬샴샵샷샹섀섄섈섐섕서",4,"섣설섦섧섬섭섯섰성섶세섹센셀셈셉셋셌셍셔셕션셜셤셥셧셨셩셰셴셸솅소속솎손솔솖솜솝솟송솥솨솩솬솰솽쇄쇈쇌쇔쇗쇘쇠쇤쇨쇰쇱쇳쇼쇽숀숄숌숍숏숑수숙순숟술숨숩숫숭"], ["bd41","폗폙",7,"폢폤",7,"폮폯폱폲폳폵폶폷"], ["bd61","폸폹폺폻폾퐀퐂",5,"퐉",13], ["bd81","퐗",5,"퐞",25,"숯숱숲숴쉈쉐쉑쉔쉘쉠쉥쉬쉭쉰쉴쉼쉽쉿슁슈슉슐슘슛슝스슥슨슬슭슴습슷승시식신싣실싫심십싯싱싶싸싹싻싼쌀쌈쌉쌌쌍쌓쌔쌕쌘쌜쌤쌥쌨쌩썅써썩썬썰썲썸썹썼썽쎄쎈쎌쏀쏘쏙쏜쏟쏠쏢쏨쏩쏭쏴쏵쏸쐈쐐쐤쐬쐰"], ["be41","퐸",7,"푁푂푃푅",14], ["be61","푔",7,"푝푞푟푡푢푣푥",7,"푮푰푱푲"], ["be81","푳",4,"푺푻푽푾풁풃",4,"풊풌풎",5,"풕",8,"쐴쐼쐽쑈쑤쑥쑨쑬쑴쑵쑹쒀쒔쒜쒸쒼쓩쓰쓱쓴쓸쓺쓿씀씁씌씐씔씜씨씩씬씰씸씹씻씽아악안앉않알앍앎앓암압앗았앙앝앞애액앤앨앰앱앳앴앵야약얀얄얇얌얍얏양얕얗얘얜얠얩어억언얹얻얼얽얾엄",6,"엌엎"], ["bf41","풞",10,"풪",14], ["bf61","풹",18,"퓍퓎퓏퓑퓒퓓퓕"], ["bf81","퓖",5,"퓝퓞퓠",7,"퓩퓪퓫퓭퓮퓯퓱",6,"퓹퓺퓼에엑엔엘엠엡엣엥여역엮연열엶엷염",5,"옅옆옇예옌옐옘옙옛옜오옥온올옭옮옰옳옴옵옷옹옻와왁완왈왐왑왓왔왕왜왝왠왬왯왱외왹왼욀욈욉욋욍요욕욘욜욤욥욧용우욱운울욹욺움웁웃웅워웍원월웜웝웠웡웨"], ["c041","퓾",5,"픅픆픇픉픊픋픍",6,"픖픘",5], ["c061","픞",25], ["c081","픸픹픺픻픾픿핁핂핃핅",6,"핎핐핒",5,"핚핛핝핞핟핡핢핣웩웬웰웸웹웽위윅윈윌윔윕윗윙유육윤율윰윱윳융윷으윽은을읊음읍읏응",7,"읜읠읨읫이익인일읽읾잃임입잇있잉잊잎자작잔잖잗잘잚잠잡잣잤장잦재잭잰잴잼잽잿쟀쟁쟈쟉쟌쟎쟐쟘쟝쟤쟨쟬저적전절젊"], ["c141","핤핦핧핪핬핮",5,"핶핷핹핺핻핽",6,"햆햊햋"], ["c161","햌햍햎햏햑",19,"햦햧"], ["c181","햨",31,"점접젓정젖제젝젠젤젬젭젯젱져젼졀졈졉졌졍졔조족존졸졺좀좁좃종좆좇좋좌좍좔좝좟좡좨좼좽죄죈죌죔죕죗죙죠죡죤죵주죽준줄줅줆줌줍줏중줘줬줴쥐쥑쥔쥘쥠쥡쥣쥬쥰쥴쥼즈즉즌즐즘즙즛증지직진짇질짊짐집짓"], ["c241","헊헋헍헎헏헑헓",4,"헚헜헞",5,"헦헧헩헪헫헭헮"], ["c261","헯",4,"헶헸헺",5,"혂혃혅혆혇혉",6,"혒"], ["c281","혖",5,"혝혞혟혡혢혣혥",7,"혮",9,"혺혻징짖짙짚짜짝짠짢짤짧짬짭짯짰짱째짹짼쨀쨈쨉쨋쨌쨍쨔쨘쨩쩌쩍쩐쩔쩜쩝쩟쩠쩡쩨쩽쪄쪘쪼쪽쫀쫄쫌쫍쫏쫑쫓쫘쫙쫠쫬쫴쬈쬐쬔쬘쬠쬡쭁쭈쭉쭌쭐쭘쭙쭝쭤쭸쭹쮜쮸쯔쯤쯧쯩찌찍찐찔찜찝찡찢찧차착찬찮찰참찹찻"], ["c341","혽혾혿홁홂홃홄홆홇홊홌홎홏홐홒홓홖홗홙홚홛홝",4], ["c361","홢",4,"홨홪",5,"홲홳홵",11], ["c381","횁횂횄횆",5,"횎횏횑횒횓횕",7,"횞횠횢",5,"횩횪찼창찾채책챈챌챔챕챗챘챙챠챤챦챨챰챵처척천철첨첩첫첬청체첵첸첼쳄쳅쳇쳉쳐쳔쳤쳬쳰촁초촉촌촐촘촙촛총촤촨촬촹최쵠쵤쵬쵭쵯쵱쵸춈추축춘출춤춥춧충춰췄췌췐취췬췰췸췹췻췽츄츈츌츔츙츠측츤츨츰츱츳층"], ["c441","횫횭횮횯횱",7,"횺횼",7,"훆훇훉훊훋"], ["c461","훍훎훏훐훒훓훕훖훘훚",5,"훡훢훣훥훦훧훩",4], ["c481","훮훯훱훲훳훴훶",5,"훾훿휁휂휃휅",11,"휒휓휔치칙친칟칠칡침칩칫칭카칵칸칼캄캅캇캉캐캑캔캘캠캡캣캤캥캬캭컁커컥컨컫컬컴컵컷컸컹케켁켄켈켐켑켓켕켜켠켤켬켭켯켰켱켸코콕콘콜콤콥콧콩콰콱콴콸쾀쾅쾌쾡쾨쾰쿄쿠쿡쿤쿨쿰쿱쿳쿵쿼퀀퀄퀑퀘퀭퀴퀵퀸퀼"], ["c541","휕휖휗휚휛휝휞휟휡",6,"휪휬휮",5,"휶휷휹"], ["c561","휺휻휽",6,"흅흆흈흊",5,"흒흓흕흚",4], ["c581","흟흢흤흦흧흨흪흫흭흮흯흱흲흳흵",6,"흾흿힀힂",5,"힊힋큄큅큇큉큐큔큘큠크큭큰클큼큽킁키킥킨킬킴킵킷킹타탁탄탈탉탐탑탓탔탕태택탠탤탬탭탯탰탱탸턍터턱턴털턺텀텁텃텄텅테텍텐텔템텝텟텡텨텬텼톄톈토톡톤톨톰톱톳통톺톼퇀퇘퇴퇸툇툉툐투툭툰툴툼툽툿퉁퉈퉜"], ["c641","힍힎힏힑",6,"힚힜힞",5], ["c6a1","퉤튀튁튄튈튐튑튕튜튠튤튬튱트특튼튿틀틂틈틉틋틔틘틜틤틥티틱틴틸팀팁팃팅파팍팎판팔팖팜팝팟팠팡팥패팩팬팰팸팹팻팼팽퍄퍅퍼퍽펀펄펌펍펏펐펑페펙펜펠펨펩펫펭펴편펼폄폅폈평폐폘폡폣포폭폰폴폼폽폿퐁"], ["c7a1","퐈퐝푀푄표푠푤푭푯푸푹푼푿풀풂품풉풋풍풔풩퓌퓐퓔퓜퓟퓨퓬퓰퓸퓻퓽프픈플픔픕픗피픽핀필핌핍핏핑하학한할핥함합핫항해핵핸핼햄햅햇했행햐향허헉헌헐헒험헙헛헝헤헥헨헬헴헵헷헹혀혁현혈혐협혓혔형혜혠"], ["c8a1","혤혭호혹혼홀홅홈홉홋홍홑화확환활홧황홰홱홴횃횅회획횐횔횝횟횡효횬횰횹횻후훅훈훌훑훔훗훙훠훤훨훰훵훼훽휀휄휑휘휙휜휠휨휩휫휭휴휵휸휼흄흇흉흐흑흔흖흗흘흙흠흡흣흥흩희흰흴흼흽힁히힉힌힐힘힙힛힝"], ["caa1","伽佳假價加可呵哥嘉嫁家暇架枷柯歌珂痂稼苛茄街袈訶賈跏軻迦駕刻却各恪慤殼珏脚覺角閣侃刊墾奸姦干幹懇揀杆柬桿澗癎看磵稈竿簡肝艮艱諫間乫喝曷渴碣竭葛褐蝎鞨勘坎堪嵌感憾戡敢柑橄減甘疳監瞰紺邯鑑鑒龕"], ["cba1","匣岬甲胛鉀閘剛堈姜岡崗康强彊慷江畺疆糠絳綱羌腔舡薑襁講鋼降鱇介价個凱塏愷愾慨改槪漑疥皆盖箇芥蓋豈鎧開喀客坑更粳羹醵倨去居巨拒据據擧渠炬祛距踞車遽鉅鋸乾件健巾建愆楗腱虔蹇鍵騫乞傑杰桀儉劍劒檢"], ["cca1","瞼鈐黔劫怯迲偈憩揭擊格檄激膈覡隔堅牽犬甄絹繭肩見譴遣鵑抉決潔結缺訣兼慊箝謙鉗鎌京俓倞傾儆勁勍卿坰境庚徑慶憬擎敬景暻更梗涇炅烱璟璥瓊痙硬磬竟競絅經耕耿脛莖警輕逕鏡頃頸驚鯨係啓堺契季屆悸戒桂械"], ["cda1","棨溪界癸磎稽系繫繼計誡谿階鷄古叩告呱固姑孤尻庫拷攷故敲暠枯槁沽痼皐睾稿羔考股膏苦苽菰藁蠱袴誥賈辜錮雇顧高鼓哭斛曲梏穀谷鵠困坤崑昆梱棍滾琨袞鯤汨滑骨供公共功孔工恐恭拱控攻珙空蚣貢鞏串寡戈果瓜"], ["cea1","科菓誇課跨過鍋顆廓槨藿郭串冠官寬慣棺款灌琯瓘管罐菅觀貫關館刮恝括适侊光匡壙廣曠洸炚狂珖筐胱鑛卦掛罫乖傀塊壞怪愧拐槐魁宏紘肱轟交僑咬喬嬌嶠巧攪敎校橋狡皎矯絞翹膠蕎蛟較轎郊餃驕鮫丘久九仇俱具勾"], ["cfa1","區口句咎嘔坵垢寇嶇廐懼拘救枸柩構歐毆毬求溝灸狗玖球瞿矩究絿耉臼舅舊苟衢謳購軀逑邱鉤銶駒驅鳩鷗龜國局菊鞠鞫麴君窘群裙軍郡堀屈掘窟宮弓穹窮芎躬倦券勸卷圈拳捲權淃眷厥獗蕨蹶闕机櫃潰詭軌饋句晷歸貴"], ["d0a1","鬼龜叫圭奎揆槻珪硅窺竅糾葵規赳逵閨勻均畇筠菌鈞龜橘克剋劇戟棘極隙僅劤勤懃斤根槿瑾筋芹菫覲謹近饉契今妗擒昑檎琴禁禽芩衾衿襟金錦伋及急扱汲級給亘兢矜肯企伎其冀嗜器圻基埼夔奇妓寄岐崎己幾忌技旗旣"], ["d1a1","朞期杞棋棄機欺氣汽沂淇玘琦琪璂璣畸畿碁磯祁祇祈祺箕紀綺羈耆耭肌記譏豈起錡錤飢饑騎騏驥麒緊佶吉拮桔金喫儺喇奈娜懦懶拏拿癩",5,"那樂",4,"諾酪駱亂卵暖欄煖爛蘭難鸞捏捺南嵐枏楠湳濫男藍襤拉"], ["d2a1","納臘蠟衲囊娘廊",4,"乃來內奈柰耐冷女年撚秊念恬拈捻寧寗努勞奴弩怒擄櫓爐瑙盧",5,"駑魯",10,"濃籠聾膿農惱牢磊腦賂雷尿壘",7,"嫩訥杻紐勒",5,"能菱陵尼泥匿溺多茶"], ["d3a1","丹亶但單團壇彖斷旦檀段湍短端簞緞蛋袒鄲鍛撻澾獺疸達啖坍憺擔曇淡湛潭澹痰聃膽蕁覃談譚錟沓畓答踏遝唐堂塘幢戇撞棠當糖螳黨代垈坮大對岱帶待戴擡玳臺袋貸隊黛宅德悳倒刀到圖堵塗導屠島嶋度徒悼挑掉搗桃"], ["d4a1","棹櫂淘渡滔濤燾盜睹禱稻萄覩賭跳蹈逃途道都鍍陶韜毒瀆牘犢獨督禿篤纛讀墩惇敦旽暾沌焞燉豚頓乭突仝冬凍動同憧東桐棟洞潼疼瞳童胴董銅兜斗杜枓痘竇荳讀豆逗頭屯臀芚遁遯鈍得嶝橙燈登等藤謄鄧騰喇懶拏癩羅"], ["d5a1","蘿螺裸邏樂洛烙珞絡落諾酪駱丹亂卵欄欒瀾爛蘭鸞剌辣嵐擥攬欖濫籃纜藍襤覽拉臘蠟廊朗浪狼琅瑯螂郞來崍徠萊冷掠略亮倆兩凉梁樑粮粱糧良諒輛量侶儷勵呂廬慮戾旅櫚濾礪藜蠣閭驢驪麗黎力曆歷瀝礫轢靂憐戀攣漣"], ["d6a1","煉璉練聯蓮輦連鍊冽列劣洌烈裂廉斂殮濂簾獵令伶囹寧岺嶺怜玲笭羚翎聆逞鈴零靈領齡例澧禮醴隷勞怒撈擄櫓潞瀘爐盧老蘆虜路輅露魯鷺鹵碌祿綠菉錄鹿麓論壟弄朧瀧瓏籠聾儡瀨牢磊賂賚賴雷了僚寮廖料燎療瞭聊蓼"], ["d7a1","遼鬧龍壘婁屢樓淚漏瘻累縷蔞褸鏤陋劉旒柳榴流溜瀏琉瑠留瘤硫謬類六戮陸侖倫崙淪綸輪律慄栗率隆勒肋凜凌楞稜綾菱陵俚利厘吏唎履悧李梨浬犁狸理璃異痢籬罹羸莉裏裡里釐離鯉吝潾燐璘藺躪隣鱗麟林淋琳臨霖砬"], ["d8a1","立笠粒摩瑪痲碼磨馬魔麻寞幕漠膜莫邈万卍娩巒彎慢挽晩曼滿漫灣瞞萬蔓蠻輓饅鰻唜抹末沫茉襪靺亡妄忘忙望網罔芒茫莽輞邙埋妹媒寐昧枚梅每煤罵買賣邁魅脈貊陌驀麥孟氓猛盲盟萌冪覓免冕勉棉沔眄眠綿緬面麵滅"], ["d9a1","蔑冥名命明暝椧溟皿瞑茗蓂螟酩銘鳴袂侮冒募姆帽慕摸摹暮某模母毛牟牡瑁眸矛耗芼茅謀謨貌木沐牧目睦穆鶩歿沒夢朦蒙卯墓妙廟描昴杳渺猫竗苗錨務巫憮懋戊拇撫无楙武毋無珷畝繆舞茂蕪誣貿霧鵡墨默們刎吻問文"], ["daa1","汶紊紋聞蚊門雯勿沕物味媚尾嵋彌微未梶楣渼湄眉米美薇謎迷靡黴岷悶愍憫敏旻旼民泯玟珉緡閔密蜜謐剝博拍搏撲朴樸泊珀璞箔粕縛膊舶薄迫雹駁伴半反叛拌搬攀斑槃泮潘班畔瘢盤盼磐磻礬絆般蟠返頒飯勃拔撥渤潑"], ["dba1","發跋醱鉢髮魃倣傍坊妨尨幇彷房放方旁昉枋榜滂磅紡肪膀舫芳蒡蚌訪謗邦防龐倍俳北培徘拜排杯湃焙盃背胚裴裵褙賠輩配陪伯佰帛柏栢白百魄幡樊煩燔番磻繁蕃藩飜伐筏罰閥凡帆梵氾汎泛犯範范法琺僻劈壁擘檗璧癖"], ["dca1","碧蘗闢霹便卞弁變辨辯邊別瞥鱉鼈丙倂兵屛幷昞昺柄棅炳甁病秉竝輧餠騈保堡報寶普步洑湺潽珤甫菩補褓譜輔伏僕匐卜宓復服福腹茯蔔複覆輹輻馥鰒本乶俸奉封峯峰捧棒烽熢琫縫蓬蜂逢鋒鳳不付俯傅剖副否咐埠夫婦"], ["dda1","孚孵富府復扶敷斧浮溥父符簿缶腐腑膚艀芙莩訃負賦賻赴趺部釜阜附駙鳧北分吩噴墳奔奮忿憤扮昐汾焚盆粉糞紛芬賁雰不佛弗彿拂崩朋棚硼繃鵬丕備匕匪卑妃婢庇悲憊扉批斐枇榧比毖毗毘沸泌琵痺砒碑秕秘粃緋翡肥"], ["dea1","脾臂菲蜚裨誹譬費鄙非飛鼻嚬嬪彬斌檳殯浜濱瀕牝玭貧賓頻憑氷聘騁乍事些仕伺似使俟僿史司唆嗣四士奢娑寫寺射巳師徙思捨斜斯柶査梭死沙泗渣瀉獅砂社祀祠私篩紗絲肆舍莎蓑蛇裟詐詞謝賜赦辭邪飼駟麝削數朔索"], ["dfa1","傘刪山散汕珊産疝算蒜酸霰乷撒殺煞薩三參杉森渗芟蔘衫揷澁鈒颯上傷像償商喪嘗孀尙峠常床庠廂想桑橡湘爽牀狀相祥箱翔裳觴詳象賞霜塞璽賽嗇塞穡索色牲生甥省笙墅壻嶼序庶徐恕抒捿敍暑曙書栖棲犀瑞筮絮緖署"], ["e0a1","胥舒薯西誓逝鋤黍鼠夕奭席惜昔晳析汐淅潟石碩蓆釋錫仙僊先善嬋宣扇敾旋渲煽琁瑄璇璿癬禪線繕羨腺膳船蘚蟬詵跣選銑鐥饍鮮卨屑楔泄洩渫舌薛褻設說雪齧剡暹殲纖蟾贍閃陝攝涉燮葉城姓宬性惺成星晟猩珹盛省筬"], ["e1a1","聖聲腥誠醒世勢歲洗稅笹細說貰召嘯塑宵小少巢所掃搔昭梳沼消溯瀟炤燒甦疏疎瘙笑篠簫素紹蔬蕭蘇訴逍遡邵銷韶騷俗屬束涑粟續謖贖速孫巽損蓀遜飡率宋悚松淞訟誦送頌刷殺灑碎鎖衰釗修受嗽囚垂壽嫂守岫峀帥愁"], ["e2a1","戍手授搜收數樹殊水洙漱燧狩獸琇璲瘦睡秀穗竪粹綏綬繡羞脩茱蒐蓚藪袖誰讐輸遂邃酬銖銹隋隧隨雖需須首髓鬚叔塾夙孰宿淑潚熟琡璹肅菽巡徇循恂旬栒楯橓殉洵淳珣盾瞬筍純脣舜荀蓴蕣詢諄醇錞順馴戌術述鉥崇崧"], ["e3a1","嵩瑟膝蝨濕拾習褶襲丞乘僧勝升承昇繩蠅陞侍匙嘶始媤尸屎屍市弑恃施是時枾柴猜矢示翅蒔蓍視試詩諡豕豺埴寔式息拭植殖湜熄篒蝕識軾食飾伸侁信呻娠宸愼新晨燼申神紳腎臣莘薪藎蜃訊身辛辰迅失室實悉審尋心沁"], ["e4a1","沈深瀋甚芯諶什十拾雙氏亞俄兒啞娥峨我牙芽莪蛾衙訝阿雅餓鴉鵝堊岳嶽幄惡愕握樂渥鄂鍔顎鰐齷安岸按晏案眼雁鞍顔鮟斡謁軋閼唵岩巖庵暗癌菴闇壓押狎鴨仰央怏昻殃秧鴦厓哀埃崖愛曖涯碍艾隘靄厄扼掖液縊腋額"], ["e5a1","櫻罌鶯鸚也倻冶夜惹揶椰爺耶若野弱掠略約若葯蒻藥躍亮佯兩凉壤孃恙揚攘敭暘梁楊樣洋瀁煬痒瘍禳穰糧羊良襄諒讓釀陽量養圄御於漁瘀禦語馭魚齬億憶抑檍臆偃堰彦焉言諺孼蘖俺儼嚴奄掩淹嶪業円予余勵呂女如廬"], ["e6a1","旅歟汝濾璵礖礪與艅茹輿轝閭餘驪麗黎亦力域役易曆歷疫繹譯轢逆驛嚥堧姸娟宴年延憐戀捐挻撚椽沇沿涎涓淵演漣烟然煙煉燃燕璉硏硯秊筵緣練縯聯衍軟輦蓮連鉛鍊鳶列劣咽悅涅烈熱裂說閱厭廉念捻染殮炎焰琰艶苒"], ["e7a1","簾閻髥鹽曄獵燁葉令囹塋寧嶺嶸影怜映暎楹榮永泳渶潁濚瀛瀯煐營獰玲瑛瑩瓔盈穎纓羚聆英詠迎鈴鍈零霙靈領乂倪例刈叡曳汭濊猊睿穢芮藝蘂禮裔詣譽豫醴銳隸霓預五伍俉傲午吾吳嗚塢墺奧娛寤悟惡懊敖旿晤梧汚澳"], ["e8a1","烏熬獒筽蜈誤鰲鼇屋沃獄玉鈺溫瑥瘟穩縕蘊兀壅擁瓮甕癰翁邕雍饔渦瓦窩窪臥蛙蝸訛婉完宛梡椀浣玩琓琬碗緩翫脘腕莞豌阮頑曰往旺枉汪王倭娃歪矮外嵬巍猥畏了僚僥凹堯夭妖姚寥寮尿嶢拗搖撓擾料曜樂橈燎燿瑤療"], ["e9a1","窈窯繇繞耀腰蓼蟯要謠遙遼邀饒慾欲浴縟褥辱俑傭冗勇埇墉容庸慂榕涌湧溶熔瑢用甬聳茸蓉踊鎔鏞龍于佑偶優又友右宇寓尤愚憂旴牛玗瑀盂祐禑禹紆羽芋藕虞迂遇郵釪隅雨雩勖彧旭昱栯煜稶郁頊云暈橒殞澐熉耘芸蕓"], ["eaa1","運隕雲韻蔚鬱亐熊雄元原員圓園垣媛嫄寃怨愿援沅洹湲源爰猿瑗苑袁轅遠阮院願鴛月越鉞位偉僞危圍委威尉慰暐渭爲瑋緯胃萎葦蔿蝟衛褘謂違韋魏乳侑儒兪劉唯喩孺宥幼幽庾悠惟愈愉揄攸有杻柔柚柳楡楢油洧流游溜"], ["eba1","濡猶猷琉瑜由留癒硫紐維臾萸裕誘諛諭踰蹂遊逾遺酉釉鍮類六堉戮毓肉育陸倫允奫尹崙淪潤玧胤贇輪鈗閏律慄栗率聿戎瀜絨融隆垠恩慇殷誾銀隱乙吟淫蔭陰音飮揖泣邑凝應膺鷹依倚儀宜意懿擬椅毅疑矣義艤薏蟻衣誼"], ["eca1","議醫二以伊利吏夷姨履已弛彛怡易李梨泥爾珥理異痍痢移罹而耳肄苡荑裏裡貽貳邇里離飴餌匿溺瀷益翊翌翼謚人仁刃印吝咽因姻寅引忍湮燐璘絪茵藺蚓認隣靭靷鱗麟一佚佾壹日溢逸鎰馹任壬妊姙恁林淋稔臨荏賃入卄"], ["eda1","立笠粒仍剩孕芿仔刺咨姉姿子字孜恣慈滋炙煮玆瓷疵磁紫者自茨蔗藉諮資雌作勺嚼斫昨灼炸爵綽芍酌雀鵲孱棧殘潺盞岑暫潛箴簪蠶雜丈仗匠場墻壯奬將帳庄張掌暲杖樟檣欌漿牆狀獐璋章粧腸臟臧莊葬蔣薔藏裝贓醬長"], ["eea1","障再哉在宰才材栽梓渽滓災縡裁財載齋齎爭箏諍錚佇低儲咀姐底抵杵楮樗沮渚狙猪疽箸紵苧菹著藷詛貯躇這邸雎齟勣吊嫡寂摘敵滴狄炙的積笛籍績翟荻謫賊赤跡蹟迪迹適鏑佃佺傳全典前剪塡塼奠專展廛悛戰栓殿氈澱"], ["efa1","煎琠田甸畑癲筌箋箭篆纏詮輾轉鈿銓錢鐫電顚顫餞切截折浙癤竊節絶占岾店漸点粘霑鮎點接摺蝶丁井亭停偵呈姃定幀庭廷征情挺政整旌晶晸柾楨檉正汀淀淨渟湞瀞炡玎珽町睛碇禎程穽精綎艇訂諪貞鄭酊釘鉦鋌錠霆靖"], ["f0a1","靜頂鼎制劑啼堤帝弟悌提梯濟祭第臍薺製諸蹄醍除際霽題齊俎兆凋助嘲弔彫措操早晁曺曹朝條棗槽漕潮照燥爪璪眺祖祚租稠窕粗糟組繰肇藻蚤詔調趙躁造遭釣阻雕鳥族簇足鏃存尊卒拙猝倧宗從悰慫棕淙琮種終綜縱腫"], ["f1a1","踪踵鍾鐘佐坐左座挫罪主住侏做姝胄呪周嗾奏宙州廚晝朱柱株注洲湊澍炷珠疇籌紂紬綢舟蛛註誅走躊輳週酎酒鑄駐竹粥俊儁准埈寯峻晙樽浚準濬焌畯竣蠢逡遵雋駿茁中仲衆重卽櫛楫汁葺增憎曾拯烝甑症繒蒸證贈之只"], ["f2a1","咫地址志持指摯支旨智枝枳止池沚漬知砥祉祗紙肢脂至芝芷蜘誌識贄趾遲直稙稷織職唇嗔塵振搢晉晋桭榛殄津溱珍瑨璡畛疹盡眞瞋秦縉縝臻蔯袗診賑軫辰進鎭陣陳震侄叱姪嫉帙桎瓆疾秩窒膣蛭質跌迭斟朕什執潗緝輯"], ["f3a1","鏶集徵懲澄且侘借叉嗟嵯差次此磋箚茶蹉車遮捉搾着窄錯鑿齪撰澯燦璨瓚竄簒纂粲纘讚贊鑽餐饌刹察擦札紮僭參塹慘慙懺斬站讒讖倉倡創唱娼廠彰愴敞昌昶暢槍滄漲猖瘡窓脹艙菖蒼債埰寀寨彩採砦綵菜蔡采釵冊柵策"], ["f4a1","責凄妻悽處倜刺剔尺慽戚拓擲斥滌瘠脊蹠陟隻仟千喘天川擅泉淺玔穿舛薦賤踐遷釧闡阡韆凸哲喆徹撤澈綴輟轍鐵僉尖沾添甛瞻簽籤詹諂堞妾帖捷牒疊睫諜貼輒廳晴淸聽菁請靑鯖切剃替涕滯締諦逮遞體初剿哨憔抄招梢"], ["f5a1","椒楚樵炒焦硝礁礎秒稍肖艸苕草蕉貂超酢醋醮促囑燭矗蜀觸寸忖村邨叢塚寵悤憁摠總聰蔥銃撮催崔最墜抽推椎楸樞湫皺秋芻萩諏趨追鄒酋醜錐錘鎚雛騶鰍丑畜祝竺筑築縮蓄蹙蹴軸逐春椿瑃出朮黜充忠沖蟲衝衷悴膵萃"], ["f6a1","贅取吹嘴娶就炊翠聚脆臭趣醉驟鷲側仄厠惻測層侈値嗤峙幟恥梔治淄熾痔痴癡稚穉緇緻置致蚩輜雉馳齒則勅飭親七柒漆侵寢枕沈浸琛砧針鍼蟄秤稱快他咤唾墮妥惰打拖朶楕舵陀馱駝倬卓啄坼度托拓擢晫柝濁濯琢琸託"], ["f7a1","鐸呑嘆坦彈憚歎灘炭綻誕奪脫探眈耽貪塔搭榻宕帑湯糖蕩兌台太怠態殆汰泰笞胎苔跆邰颱宅擇澤撑攄兎吐土討慟桶洞痛筒統通堆槌腿褪退頹偸套妬投透鬪慝特闖坡婆巴把播擺杷波派爬琶破罷芭跛頗判坂板版瓣販辦鈑"], ["f8a1","阪八叭捌佩唄悖敗沛浿牌狽稗覇貝彭澎烹膨愎便偏扁片篇編翩遍鞭騙貶坪平枰萍評吠嬖幣廢弊斃肺蔽閉陛佈包匍匏咆哺圃布怖抛抱捕暴泡浦疱砲胞脯苞葡蒲袍褒逋鋪飽鮑幅暴曝瀑爆輻俵剽彪慓杓標漂瓢票表豹飇飄驃"], ["f9a1","品稟楓諷豊風馮彼披疲皮被避陂匹弼必泌珌畢疋筆苾馝乏逼下何厦夏廈昰河瑕荷蝦賀遐霞鰕壑學虐謔鶴寒恨悍旱汗漢澣瀚罕翰閑閒限韓割轄函含咸啣喊檻涵緘艦銜陷鹹合哈盒蛤閤闔陜亢伉姮嫦巷恒抗杭桁沆港缸肛航"], ["faa1","行降項亥偕咳垓奚孩害懈楷海瀣蟹解該諧邂駭骸劾核倖幸杏荇行享向嚮珦鄕響餉饗香噓墟虛許憲櫶獻軒歇險驗奕爀赫革俔峴弦懸晛泫炫玄玹現眩睍絃絢縣舷衒見賢鉉顯孑穴血頁嫌俠協夾峽挾浹狹脅脇莢鋏頰亨兄刑型"], ["fba1","形泂滎瀅灐炯熒珩瑩荊螢衡逈邢鎣馨兮彗惠慧暳蕙蹊醯鞋乎互呼壕壺好岵弧戶扈昊晧毫浩淏湖滸澔濠濩灝狐琥瑚瓠皓祜糊縞胡芦葫蒿虎號蝴護豪鎬頀顥惑或酷婚昏混渾琿魂忽惚笏哄弘汞泓洪烘紅虹訌鴻化和嬅樺火畵"], ["fca1","禍禾花華話譁貨靴廓擴攫確碻穫丸喚奐宦幻患換歡晥桓渙煥環紈還驩鰥活滑猾豁闊凰幌徨恍惶愰慌晃晄榥況湟滉潢煌璜皇篁簧荒蝗遑隍黃匯回廻徊恢悔懷晦會檜淮澮灰獪繪膾茴蛔誨賄劃獲宖橫鐄哮嚆孝效斅曉梟涍淆"], ["fda1","爻肴酵驍侯候厚后吼喉嗅帿後朽煦珝逅勛勳塤壎焄熏燻薰訓暈薨喧暄煊萱卉喙毁彙徽揮暉煇諱輝麾休携烋畦虧恤譎鷸兇凶匈洶胸黑昕欣炘痕吃屹紇訖欠欽歆吸恰洽翕興僖凞喜噫囍姬嬉希憙憘戱晞曦熙熹熺犧禧稀羲詰"] ] [ ["0","\u0000",127], ["a140"," ,、。.‧;:?!︰…‥﹐﹑﹒·﹔﹕﹖﹗|–︱—︳╴︴﹏()︵︶{}︷︸〔〕︹︺【】︻︼《》︽︾〈〉︿﹀「」﹁﹂『』﹃﹄﹙﹚"], ["a1a1","﹛﹜﹝﹞‘’“”〝〞‵′#&*※§〃○●△▲◎☆★◇◆□■▽▼㊣℅¯ ̄_ˍ﹉﹊﹍﹎﹋﹌﹟﹠﹡+-×÷±√<>=≦≧≠∞≒≡﹢",4,"~∩∪⊥∠∟⊿㏒㏑∫∮∵∴♀♂⊕⊙↑↓←→↖↗↙↘∥∣/"], ["a240","\∕﹨$¥〒¢£%@℃℉﹩﹪﹫㏕㎜㎝㎞㏎㎡㎎㎏㏄°兙兛兞兝兡兣嗧瓩糎▁",7,"▏▎▍▌▋▊▉┼┴┬┤├▔─│▕┌┐└┘╭"], ["a2a1","╮╰╯═╞╪╡◢◣◥◤╱╲╳0",9,"Ⅰ",9,"〡",8,"十卄卅A",25,"a",21], ["a340","wxyzΑ",16,"Σ",6,"α",16,"σ",6,"ㄅ",10], ["a3a1","ㄐ",25,"˙ˉˊˇˋ"], ["a3e1","€"], ["a440","一乙丁七乃九了二人儿入八几刀刁力匕十卜又三下丈上丫丸凡久么也乞于亡兀刃勺千叉口土士夕大女子孑孓寸小尢尸山川工己已巳巾干廾弋弓才"], ["a4a1","丑丐不中丰丹之尹予云井互五亢仁什仃仆仇仍今介仄元允內六兮公冗凶分切刈勻勾勿化匹午升卅卞厄友及反壬天夫太夭孔少尤尺屯巴幻廿弔引心戈戶手扎支文斗斤方日曰月木欠止歹毋比毛氏水火爪父爻片牙牛犬王丙"], ["a540","世丕且丘主乍乏乎以付仔仕他仗代令仙仞充兄冉冊冬凹出凸刊加功包匆北匝仟半卉卡占卯卮去可古右召叮叩叨叼司叵叫另只史叱台句叭叻四囚外"], ["a5a1","央失奴奶孕它尼巨巧左市布平幼弁弘弗必戊打扔扒扑斥旦朮本未末札正母民氐永汁汀氾犯玄玉瓜瓦甘生用甩田由甲申疋白皮皿目矛矢石示禾穴立丞丟乒乓乩亙交亦亥仿伉伙伊伕伍伐休伏仲件任仰仳份企伋光兇兆先全"], ["a640","共再冰列刑划刎刖劣匈匡匠印危吉吏同吊吐吁吋各向名合吃后吆吒因回囝圳地在圭圬圯圩夙多夷夸妄奸妃好她如妁字存宇守宅安寺尖屹州帆并年"], ["a6a1","式弛忙忖戎戌戍成扣扛托收早旨旬旭曲曳有朽朴朱朵次此死氖汝汗汙江池汐汕污汛汍汎灰牟牝百竹米糸缶羊羽老考而耒耳聿肉肋肌臣自至臼舌舛舟艮色艾虫血行衣西阡串亨位住佇佗佞伴佛何估佐佑伽伺伸佃佔似但佣"], ["a740","作你伯低伶余佝佈佚兌克免兵冶冷別判利刪刨劫助努劬匣即卵吝吭吞吾否呎吧呆呃吳呈呂君吩告吹吻吸吮吵吶吠吼呀吱含吟听囪困囤囫坊坑址坍"], ["a7a1","均坎圾坐坏圻壯夾妝妒妨妞妣妙妖妍妤妓妊妥孝孜孚孛完宋宏尬局屁尿尾岐岑岔岌巫希序庇床廷弄弟彤形彷役忘忌志忍忱快忸忪戒我抄抗抖技扶抉扭把扼找批扳抒扯折扮投抓抑抆改攻攸旱更束李杏材村杜杖杞杉杆杠"], ["a840","杓杗步每求汞沙沁沈沉沅沛汪決沐汰沌汨沖沒汽沃汲汾汴沆汶沍沔沘沂灶灼災灸牢牡牠狄狂玖甬甫男甸皂盯矣私秀禿究系罕肖肓肝肘肛肚育良芒"], ["a8a1","芋芍見角言谷豆豕貝赤走足身車辛辰迂迆迅迄巡邑邢邪邦那酉釆里防阮阱阪阬並乖乳事些亞享京佯依侍佳使佬供例來侃佰併侈佩佻侖佾侏侑佺兔兒兕兩具其典冽函刻券刷刺到刮制剁劾劻卒協卓卑卦卷卸卹取叔受味呵"], ["a940","咖呸咕咀呻呷咄咒咆呼咐呱呶和咚呢周咋命咎固垃坷坪坩坡坦坤坼夜奉奇奈奄奔妾妻委妹妮姑姆姐姍始姓姊妯妳姒姅孟孤季宗定官宜宙宛尚屈居"], ["a9a1","屆岷岡岸岩岫岱岳帘帚帖帕帛帑幸庚店府底庖延弦弧弩往征彿彼忝忠忽念忿怏怔怯怵怖怪怕怡性怩怫怛或戕房戾所承拉拌拄抿拂抹拒招披拓拔拋拈抨抽押拐拙拇拍抵拚抱拘拖拗拆抬拎放斧於旺昔易昌昆昂明昀昏昕昊"], ["aa40","昇服朋杭枋枕東果杳杷枇枝林杯杰板枉松析杵枚枓杼杪杲欣武歧歿氓氛泣注泳沱泌泥河沽沾沼波沫法泓沸泄油況沮泗泅泱沿治泡泛泊沬泯泜泖泠"], ["aaa1","炕炎炒炊炙爬爭爸版牧物狀狎狙狗狐玩玨玟玫玥甽疝疙疚的盂盲直知矽社祀祁秉秈空穹竺糾罔羌羋者肺肥肢肱股肫肩肴肪肯臥臾舍芳芝芙芭芽芟芹花芬芥芯芸芣芰芾芷虎虱初表軋迎返近邵邸邱邶采金長門阜陀阿阻附"], ["ab40","陂隹雨青非亟亭亮信侵侯便俠俑俏保促侶俘俟俊俗侮俐俄係俚俎俞侷兗冒冑冠剎剃削前剌剋則勇勉勃勁匍南卻厚叛咬哀咨哎哉咸咦咳哇哂咽咪品"], ["aba1","哄哈咯咫咱咻咩咧咿囿垂型垠垣垢城垮垓奕契奏奎奐姜姘姿姣姨娃姥姪姚姦威姻孩宣宦室客宥封屎屏屍屋峙峒巷帝帥帟幽庠度建弈弭彥很待徊律徇後徉怒思怠急怎怨恍恰恨恢恆恃恬恫恪恤扁拜挖按拼拭持拮拽指拱拷"], ["ac40","拯括拾拴挑挂政故斫施既春昭映昧是星昨昱昤曷柿染柱柔某柬架枯柵柩柯柄柑枴柚查枸柏柞柳枰柙柢柝柒歪殃殆段毒毗氟泉洋洲洪流津洌洱洞洗"], ["aca1","活洽派洶洛泵洹洧洸洩洮洵洎洫炫為炳炬炯炭炸炮炤爰牲牯牴狩狠狡玷珊玻玲珍珀玳甚甭畏界畎畋疫疤疥疢疣癸皆皇皈盈盆盃盅省盹相眉看盾盼眇矜砂研砌砍祆祉祈祇禹禺科秒秋穿突竿竽籽紂紅紀紉紇約紆缸美羿耄"], ["ad40","耐耍耑耶胖胥胚胃胄背胡胛胎胞胤胝致舢苧范茅苣苛苦茄若茂茉苒苗英茁苜苔苑苞苓苟苯茆虐虹虻虺衍衫要觔計訂訃貞負赴赳趴軍軌述迦迢迪迥"], ["ada1","迭迫迤迨郊郎郁郃酋酊重閂限陋陌降面革韋韭音頁風飛食首香乘亳倌倍倣俯倦倥俸倩倖倆值借倚倒們俺倀倔倨俱倡個候倘俳修倭倪俾倫倉兼冤冥冢凍凌准凋剖剜剔剛剝匪卿原厝叟哨唐唁唷哼哥哲唆哺唔哩哭員唉哮哪"], ["ae40","哦唧唇哽唏圃圄埂埔埋埃堉夏套奘奚娑娘娜娟娛娓姬娠娣娩娥娌娉孫屘宰害家宴宮宵容宸射屑展屐峭峽峻峪峨峰島崁峴差席師庫庭座弱徒徑徐恙"], ["aea1","恣恥恐恕恭恩息悄悟悚悍悔悌悅悖扇拳挈拿捎挾振捕捂捆捏捉挺捐挽挪挫挨捍捌效敉料旁旅時晉晏晃晒晌晅晁書朔朕朗校核案框桓根桂桔栩梳栗桌桑栽柴桐桀格桃株桅栓栘桁殊殉殷氣氧氨氦氤泰浪涕消涇浦浸海浙涓"], ["af40","浬涉浮浚浴浩涌涊浹涅浥涔烊烘烤烙烈烏爹特狼狹狽狸狷玆班琉珮珠珪珞畔畝畜畚留疾病症疲疳疽疼疹痂疸皋皰益盍盎眩真眠眨矩砰砧砸砝破砷"], ["afa1","砥砭砠砟砲祕祐祠祟祖神祝祗祚秤秣秧租秦秩秘窄窈站笆笑粉紡紗紋紊素索純紐紕級紜納紙紛缺罟羔翅翁耆耘耕耙耗耽耿胱脂胰脅胭胴脆胸胳脈能脊胼胯臭臬舀舐航舫舨般芻茫荒荔荊茸荐草茵茴荏茲茹茶茗荀茱茨荃"], ["b040","虔蚊蚪蚓蚤蚩蚌蚣蚜衰衷袁袂衽衹記訐討訌訕訊託訓訖訏訑豈豺豹財貢起躬軒軔軏辱送逆迷退迺迴逃追逅迸邕郡郝郢酒配酌釘針釗釜釙閃院陣陡"], ["b0a1","陛陝除陘陞隻飢馬骨高鬥鬲鬼乾偺偽停假偃偌做偉健偶偎偕偵側偷偏倏偯偭兜冕凰剪副勒務勘動匐匏匙匿區匾參曼商啪啦啄啞啡啃啊唱啖問啕唯啤唸售啜唬啣唳啁啗圈國圉域堅堊堆埠埤基堂堵執培夠奢娶婁婉婦婪婀"], ["b140","娼婢婚婆婊孰寇寅寄寂宿密尉專將屠屜屝崇崆崎崛崖崢崑崩崔崙崤崧崗巢常帶帳帷康庸庶庵庾張強彗彬彩彫得徙從徘御徠徜恿患悉悠您惋悴惦悽"], ["b1a1","情悻悵惜悼惘惕惆惟悸惚惇戚戛扈掠控捲掖探接捷捧掘措捱掩掉掃掛捫推掄授掙採掬排掏掀捻捩捨捺敝敖救教敗啟敏敘敕敔斜斛斬族旋旌旎晝晚晤晨晦晞曹勗望梁梯梢梓梵桿桶梱梧梗械梃棄梭梆梅梔條梨梟梡梂欲殺"], ["b240","毫毬氫涎涼淳淙液淡淌淤添淺清淇淋涯淑涮淞淹涸混淵淅淒渚涵淚淫淘淪深淮淨淆淄涪淬涿淦烹焉焊烽烯爽牽犁猜猛猖猓猙率琅琊球理現琍瓠瓶"], ["b2a1","瓷甜產略畦畢異疏痔痕疵痊痍皎盔盒盛眷眾眼眶眸眺硫硃硎祥票祭移窒窕笠笨笛第符笙笞笮粒粗粕絆絃統紮紹紼絀細紳組累終紲紱缽羞羚翌翎習耜聊聆脯脖脣脫脩脰脤舂舵舷舶船莎莞莘荸莢莖莽莫莒莊莓莉莠荷荻荼"], ["b340","莆莧處彪蛇蛀蚶蛄蚵蛆蛋蚱蚯蛉術袞袈被袒袖袍袋覓規訪訝訣訥許設訟訛訢豉豚販責貫貨貪貧赧赦趾趺軛軟這逍通逗連速逝逐逕逞造透逢逖逛途"], ["b3a1","部郭都酗野釵釦釣釧釭釩閉陪陵陳陸陰陴陶陷陬雀雪雩章竟頂頃魚鳥鹵鹿麥麻傢傍傅備傑傀傖傘傚最凱割剴創剩勞勝勛博厥啻喀喧啼喊喝喘喂喜喪喔喇喋喃喳單喟唾喲喚喻喬喱啾喉喫喙圍堯堪場堤堰報堡堝堠壹壺奠"], ["b440","婷媚婿媒媛媧孳孱寒富寓寐尊尋就嵌嵐崴嵇巽幅帽幀幃幾廊廁廂廄弼彭復循徨惑惡悲悶惠愜愣惺愕惰惻惴慨惱愎惶愉愀愒戟扉掣掌描揀揩揉揆揍"], ["b4a1","插揣提握揖揭揮捶援揪換摒揚揹敞敦敢散斑斐斯普晰晴晶景暑智晾晷曾替期朝棺棕棠棘棗椅棟棵森棧棹棒棲棣棋棍植椒椎棉棚楮棻款欺欽殘殖殼毯氮氯氬港游湔渡渲湧湊渠渥渣減湛湘渤湖湮渭渦湯渴湍渺測湃渝渾滋"], ["b540","溉渙湎湣湄湲湩湟焙焚焦焰無然煮焜牌犄犀猶猥猴猩琺琪琳琢琥琵琶琴琯琛琦琨甥甦畫番痢痛痣痙痘痞痠登發皖皓皴盜睏短硝硬硯稍稈程稅稀窘"], ["b5a1","窗窖童竣等策筆筐筒答筍筋筏筑粟粥絞結絨絕紫絮絲絡給絢絰絳善翔翕耋聒肅腕腔腋腑腎脹腆脾腌腓腴舒舜菩萃菸萍菠菅萋菁華菱菴著萊菰萌菌菽菲菊萸萎萄菜萇菔菟虛蛟蛙蛭蛔蛛蛤蛐蛞街裁裂袱覃視註詠評詞証詁"], ["b640","詔詛詐詆訴診訶詖象貂貯貼貳貽賁費賀貴買貶貿貸越超趁跎距跋跚跑跌跛跆軻軸軼辜逮逵週逸進逶鄂郵鄉郾酣酥量鈔鈕鈣鈉鈞鈍鈐鈇鈑閔閏開閑"], ["b6a1","間閒閎隊階隋陽隅隆隍陲隄雁雅雄集雇雯雲韌項順須飧飪飯飩飲飭馮馭黃黍黑亂傭債傲傳僅傾催傷傻傯僇剿剷剽募勦勤勢勣匯嗟嗨嗓嗦嗎嗜嗇嗑嗣嗤嗯嗚嗡嗅嗆嗥嗉園圓塞塑塘塗塚塔填塌塭塊塢塒塋奧嫁嫉嫌媾媽媼"], ["b740","媳嫂媲嵩嵯幌幹廉廈弒彙徬微愚意慈感想愛惹愁愈慎慌慄慍愾愴愧愍愆愷戡戢搓搾搞搪搭搽搬搏搜搔損搶搖搗搆敬斟新暗暉暇暈暖暄暘暍會榔業"], ["b7a1","楚楷楠楔極椰概楊楨楫楞楓楹榆楝楣楛歇歲毀殿毓毽溢溯滓溶滂源溝滇滅溥溘溼溺溫滑準溜滄滔溪溧溴煎煙煩煤煉照煜煬煦煌煥煞煆煨煖爺牒猷獅猿猾瑯瑚瑕瑟瑞瑁琿瑙瑛瑜當畸瘀痰瘁痲痱痺痿痴痳盞盟睛睫睦睞督"], ["b840","睹睪睬睜睥睨睢矮碎碰碗碘碌碉硼碑碓硿祺祿禁萬禽稜稚稠稔稟稞窟窠筷節筠筮筧粱粳粵經絹綑綁綏絛置罩罪署義羨群聖聘肆肄腱腰腸腥腮腳腫"], ["b8a1","腹腺腦舅艇蒂葷落萱葵葦葫葉葬葛萼萵葡董葩葭葆虞虜號蛹蜓蜈蜇蜀蛾蛻蜂蜃蜆蜊衙裟裔裙補裘裝裡裊裕裒覜解詫該詳試詩詰誇詼詣誠話誅詭詢詮詬詹詻訾詨豢貊貉賊資賈賄貲賃賂賅跡跟跨路跳跺跪跤跦躲較載軾輊"], ["b940","辟農運遊道遂達逼違遐遇遏過遍遑逾遁鄒鄗酬酪酩釉鈷鉗鈸鈽鉀鈾鉛鉋鉤鉑鈴鉉鉍鉅鈹鈿鉚閘隘隔隕雍雋雉雊雷電雹零靖靴靶預頑頓頊頒頌飼飴"], ["b9a1","飽飾馳馱馴髡鳩麂鼎鼓鼠僧僮僥僖僭僚僕像僑僱僎僩兢凳劃劂匱厭嗾嘀嘛嘗嗽嘔嘆嘉嘍嘎嗷嘖嘟嘈嘐嗶團圖塵塾境墓墊塹墅塽壽夥夢夤奪奩嫡嫦嫩嫗嫖嫘嫣孵寞寧寡寥實寨寢寤察對屢嶄嶇幛幣幕幗幔廓廖弊彆彰徹慇"], ["ba40","愿態慷慢慣慟慚慘慵截撇摘摔撤摸摟摺摑摧搴摭摻敲斡旗旖暢暨暝榜榨榕槁榮槓構榛榷榻榫榴槐槍榭槌榦槃榣歉歌氳漳演滾漓滴漩漾漠漬漏漂漢"], ["baa1","滿滯漆漱漸漲漣漕漫漯澈漪滬漁滲滌滷熔熙煽熊熄熒爾犒犖獄獐瑤瑣瑪瑰瑭甄疑瘧瘍瘋瘉瘓盡監瞄睽睿睡磁碟碧碳碩碣禎福禍種稱窪窩竭端管箕箋筵算箝箔箏箸箇箄粹粽精綻綰綜綽綾綠緊綴網綱綺綢綿綵綸維緒緇綬"], ["bb40","罰翠翡翟聞聚肇腐膀膏膈膊腿膂臧臺與舔舞艋蓉蒿蓆蓄蒙蒞蒲蒜蓋蒸蓀蓓蒐蒼蓑蓊蜿蜜蜻蜢蜥蜴蜘蝕蜷蜩裳褂裴裹裸製裨褚裯誦誌語誣認誡誓誤"], ["bba1","說誥誨誘誑誚誧豪貍貌賓賑賒赫趙趕跼輔輒輕輓辣遠遘遜遣遙遞遢遝遛鄙鄘鄞酵酸酷酴鉸銀銅銘銖鉻銓銜銨鉼銑閡閨閩閣閥閤隙障際雌雒需靼鞅韶頗領颯颱餃餅餌餉駁骯骰髦魁魂鳴鳶鳳麼鼻齊億儀僻僵價儂儈儉儅凜"], ["bc40","劇劈劉劍劊勰厲嘮嘻嘹嘲嘿嘴嘩噓噎噗噴嘶嘯嘰墀墟增墳墜墮墩墦奭嬉嫻嬋嫵嬌嬈寮寬審寫層履嶝嶔幢幟幡廢廚廟廝廣廠彈影德徵慶慧慮慝慕憂"], ["bca1","慼慰慫慾憧憐憫憎憬憚憤憔憮戮摩摯摹撞撲撈撐撰撥撓撕撩撒撮播撫撚撬撙撢撳敵敷數暮暫暴暱樣樟槨樁樞標槽模樓樊槳樂樅槭樑歐歎殤毅毆漿潼澄潑潦潔澆潭潛潸潮澎潺潰潤澗潘滕潯潠潟熟熬熱熨牖犛獎獗瑩璋璃"], ["bd40","瑾璀畿瘠瘩瘟瘤瘦瘡瘢皚皺盤瞎瞇瞌瞑瞋磋磅確磊碾磕碼磐稿稼穀稽稷稻窯窮箭箱範箴篆篇篁箠篌糊締練緯緻緘緬緝編緣線緞緩綞緙緲緹罵罷羯"], ["bda1","翩耦膛膜膝膠膚膘蔗蔽蔚蓮蔬蔭蔓蔑蔣蔡蔔蓬蔥蓿蔆螂蝴蝶蝠蝦蝸蝨蝙蝗蝌蝓衛衝褐複褒褓褕褊誼諒談諄誕請諸課諉諂調誰論諍誶誹諛豌豎豬賠賞賦賤賬賭賢賣賜質賡赭趟趣踫踐踝踢踏踩踟踡踞躺輝輛輟輩輦輪輜輞"], ["be40","輥適遮遨遭遷鄰鄭鄧鄱醇醉醋醃鋅銻銷鋪銬鋤鋁銳銼鋒鋇鋰銲閭閱霄霆震霉靠鞍鞋鞏頡頫頜颳養餓餒餘駝駐駟駛駑駕駒駙骷髮髯鬧魅魄魷魯鴆鴉"], ["bea1","鴃麩麾黎墨齒儒儘儔儐儕冀冪凝劑劓勳噙噫噹噩噤噸噪器噥噱噯噬噢噶壁墾壇壅奮嬝嬴學寰導彊憲憑憩憊懍憶憾懊懈戰擅擁擋撻撼據擄擇擂操撿擒擔撾整曆曉暹曄曇暸樽樸樺橙橫橘樹橄橢橡橋橇樵機橈歙歷氅濂澱澡"], ["bf40","濃澤濁澧澳激澹澶澦澠澴熾燉燐燒燈燕熹燎燙燜燃燄獨璜璣璘璟璞瓢甌甍瘴瘸瘺盧盥瞠瞞瞟瞥磨磚磬磧禦積穎穆穌穋窺篙簑築篤篛篡篩篦糕糖縊"], ["bfa1","縑縈縛縣縞縝縉縐罹羲翰翱翮耨膳膩膨臻興艘艙蕊蕙蕈蕨蕩蕃蕉蕭蕪蕞螃螟螞螢融衡褪褲褥褫褡親覦諦諺諫諱謀諜諧諮諾謁謂諷諭諳諶諼豫豭貓賴蹄踱踴蹂踹踵輻輯輸輳辨辦遵遴選遲遼遺鄴醒錠錶鋸錳錯錢鋼錫錄錚"], ["c040","錐錦錡錕錮錙閻隧隨險雕霎霑霖霍霓霏靛靜靦鞘頰頸頻頷頭頹頤餐館餞餛餡餚駭駢駱骸骼髻髭鬨鮑鴕鴣鴦鴨鴒鴛默黔龍龜優償儡儲勵嚎嚀嚐嚅嚇"], ["c0a1","嚏壕壓壑壎嬰嬪嬤孺尷屨嶼嶺嶽嶸幫彌徽應懂懇懦懋戲戴擎擊擘擠擰擦擬擱擢擭斂斃曙曖檀檔檄檢檜櫛檣橾檗檐檠歜殮毚氈濘濱濟濠濛濤濫濯澀濬濡濩濕濮濰燧營燮燦燥燭燬燴燠爵牆獰獲璩環璦璨癆療癌盪瞳瞪瞰瞬"], ["c140","瞧瞭矯磷磺磴磯礁禧禪穗窿簇簍篾篷簌篠糠糜糞糢糟糙糝縮績繆縷縲繃縫總縱繅繁縴縹繈縵縿縯罄翳翼聱聲聰聯聳臆臃膺臂臀膿膽臉膾臨舉艱薪"], ["c1a1","薄蕾薜薑薔薯薛薇薨薊虧蟀蟑螳蟒蟆螫螻螺蟈蟋褻褶襄褸褽覬謎謗謙講謊謠謝謄謐豁谿豳賺賽購賸賻趨蹉蹋蹈蹊轄輾轂轅輿避遽還邁邂邀鄹醣醞醜鍍鎂錨鍵鍊鍥鍋錘鍾鍬鍛鍰鍚鍔闊闋闌闈闆隱隸雖霜霞鞠韓顆颶餵騁"], ["c240","駿鮮鮫鮪鮭鴻鴿麋黏點黜黝黛鼾齋叢嚕嚮壙壘嬸彝懣戳擴擲擾攆擺擻擷斷曜朦檳檬櫃檻檸櫂檮檯歟歸殯瀉瀋濾瀆濺瀑瀏燻燼燾燸獷獵璧璿甕癖癘"], ["c2a1","癒瞽瞿瞻瞼礎禮穡穢穠竄竅簫簧簪簞簣簡糧織繕繞繚繡繒繙罈翹翻職聶臍臏舊藏薩藍藐藉薰薺薹薦蟯蟬蟲蟠覆覲觴謨謹謬謫豐贅蹙蹣蹦蹤蹟蹕軀轉轍邇邃邈醫醬釐鎔鎊鎖鎢鎳鎮鎬鎰鎘鎚鎗闔闖闐闕離雜雙雛雞霤鞣鞦"], ["c340","鞭韹額顏題顎顓颺餾餿餽餮馥騎髁鬃鬆魏魎魍鯊鯉鯽鯈鯀鵑鵝鵠黠鼕鼬儳嚥壞壟壢寵龐廬懲懷懶懵攀攏曠曝櫥櫝櫚櫓瀛瀟瀨瀚瀝瀕瀘爆爍牘犢獸"], ["c3a1","獺璽瓊瓣疇疆癟癡矇礙禱穫穩簾簿簸簽簷籀繫繭繹繩繪羅繳羶羹羸臘藩藝藪藕藤藥藷蟻蠅蠍蟹蟾襠襟襖襞譁譜識證譚譎譏譆譙贈贊蹼蹲躇蹶蹬蹺蹴轔轎辭邊邋醱醮鏡鏑鏟鏃鏈鏜鏝鏖鏢鏍鏘鏤鏗鏨關隴難霪霧靡韜韻類"], ["c440","願顛颼饅饉騖騙鬍鯨鯧鯖鯛鶉鵡鵲鵪鵬麒麗麓麴勸嚨嚷嚶嚴嚼壤孀孃孽寶巉懸懺攘攔攙曦朧櫬瀾瀰瀲爐獻瓏癢癥礦礪礬礫竇競籌籃籍糯糰辮繽繼"], ["c4a1","纂罌耀臚艦藻藹蘑藺蘆蘋蘇蘊蠔蠕襤覺觸議譬警譯譟譫贏贍躉躁躅躂醴釋鐘鐃鏽闡霰飄饒饑馨騫騰騷騵鰓鰍鹹麵黨鼯齟齣齡儷儸囁囀囂夔屬巍懼懾攝攜斕曩櫻欄櫺殲灌爛犧瓖瓔癩矓籐纏續羼蘗蘭蘚蠣蠢蠡蠟襪襬覽譴"], ["c540","護譽贓躊躍躋轟辯醺鐮鐳鐵鐺鐸鐲鐫闢霸霹露響顧顥饗驅驃驀騾髏魔魑鰭鰥鶯鶴鷂鶸麝黯鼙齜齦齧儼儻囈囊囉孿巔巒彎懿攤權歡灑灘玀瓤疊癮癬"], ["c5a1","禳籠籟聾聽臟襲襯觼讀贖贗躑躓轡酈鑄鑑鑒霽霾韃韁顫饕驕驍髒鬚鱉鰱鰾鰻鷓鷗鼴齬齪龔囌巖戀攣攫攪曬欐瓚竊籤籣籥纓纖纔臢蘸蘿蠱變邐邏鑣鑠鑤靨顯饜驚驛驗髓體髑鱔鱗鱖鷥麟黴囑壩攬灞癱癲矗罐羈蠶蠹衢讓讒"], ["c640","讖艷贛釀鑪靂靈靄韆顰驟鬢魘鱟鷹鷺鹼鹽鼇齷齲廳欖灣籬籮蠻觀躡釁鑲鑰顱饞髖鬣黌灤矚讚鑷韉驢驥纜讜躪釅鑽鑾鑼鱷鱸黷豔鑿鸚爨驪鬱鸛鸞籲"], ["c940","乂乜凵匚厂万丌乇亍囗兀屮彳丏冇与丮亓仂仉仈冘勼卬厹圠夃夬尐巿旡殳毌气爿丱丼仨仜仩仡仝仚刌匜卌圢圣夗夯宁宄尒尻屴屳帄庀庂忉戉扐氕"], ["c9a1","氶汃氿氻犮犰玊禸肊阞伎优伬仵伔仱伀价伈伝伂伅伢伓伄仴伒冱刓刉刐劦匢匟卍厊吇囡囟圮圪圴夼妀奼妅奻奾奷奿孖尕尥屼屺屻屾巟幵庄异弚彴忕忔忏扜扞扤扡扦扢扙扠扚扥旯旮朾朹朸朻机朿朼朳氘汆汒汜汏汊汔汋"], ["ca40","汌灱牞犴犵玎甪癿穵网艸艼芀艽艿虍襾邙邗邘邛邔阢阤阠阣佖伻佢佉体佤伾佧佒佟佁佘伭伳伿佡冏冹刜刞刡劭劮匉卣卲厎厏吰吷吪呔呅吙吜吥吘"], ["caa1","吽呏呁吨吤呇囮囧囥坁坅坌坉坋坒夆奀妦妘妠妗妎妢妐妏妧妡宎宒尨尪岍岏岈岋岉岒岊岆岓岕巠帊帎庋庉庌庈庍弅弝彸彶忒忑忐忭忨忮忳忡忤忣忺忯忷忻怀忴戺抃抌抎抏抔抇扱扻扺扰抁抈扷扽扲扴攷旰旴旳旲旵杅杇"], ["cb40","杙杕杌杈杝杍杚杋毐氙氚汸汧汫沄沋沏汱汯汩沚汭沇沕沜汦汳汥汻沎灴灺牣犿犽狃狆狁犺狅玕玗玓玔玒町甹疔疕皁礽耴肕肙肐肒肜芐芏芅芎芑芓"], ["cba1","芊芃芄豸迉辿邟邡邥邞邧邠阰阨阯阭丳侘佼侅佽侀侇佶佴侉侄佷佌侗佪侚佹侁佸侐侜侔侞侒侂侕佫佮冞冼冾刵刲刳剆刱劼匊匋匼厒厔咇呿咁咑咂咈呫呺呾呥呬呴呦咍呯呡呠咘呣呧呤囷囹坯坲坭坫坱坰坶垀坵坻坳坴坢"], ["cc40","坨坽夌奅妵妺姏姎妲姌姁妶妼姃姖妱妽姀姈妴姇孢孥宓宕屄屇岮岤岠岵岯岨岬岟岣岭岢岪岧岝岥岶岰岦帗帔帙弨弢弣弤彔徂彾彽忞忥怭怦怙怲怋"], ["cca1","怴怊怗怳怚怞怬怢怍怐怮怓怑怌怉怜戔戽抭抴拑抾抪抶拊抮抳抯抻抩抰抸攽斨斻昉旼昄昒昈旻昃昋昍昅旽昑昐曶朊枅杬枎枒杶杻枘枆构杴枍枌杺枟枑枙枃杽极杸杹枔欥殀歾毞氝沓泬泫泮泙沶泔沭泧沷泐泂沺泃泆泭泲"], ["cd40","泒泝沴沊沝沀泞泀洰泍泇沰泹泏泩泑炔炘炅炓炆炄炑炖炂炚炃牪狖狋狘狉狜狒狔狚狌狑玤玡玭玦玢玠玬玝瓝瓨甿畀甾疌疘皯盳盱盰盵矸矼矹矻矺"], ["cda1","矷祂礿秅穸穻竻籵糽耵肏肮肣肸肵肭舠芠苀芫芚芘芛芵芧芮芼芞芺芴芨芡芩苂芤苃芶芢虰虯虭虮豖迒迋迓迍迖迕迗邲邴邯邳邰阹阽阼阺陃俍俅俓侲俉俋俁俔俜俙侻侳俛俇俖侺俀侹俬剄剉勀勂匽卼厗厖厙厘咺咡咭咥哏"], ["ce40","哃茍咷咮哖咶哅哆咠呰咼咢咾呲哞咰垵垞垟垤垌垗垝垛垔垘垏垙垥垚垕壴复奓姡姞姮娀姱姝姺姽姼姶姤姲姷姛姩姳姵姠姾姴姭宨屌峐峘峌峗峋峛"], ["cea1","峞峚峉峇峊峖峓峔峏峈峆峎峟峸巹帡帢帣帠帤庰庤庢庛庣庥弇弮彖徆怷怹恔恲恞恅恓恇恉恛恌恀恂恟怤恄恘恦恮扂扃拏挍挋拵挎挃拫拹挏挌拸拶挀挓挔拺挕拻拰敁敃斪斿昶昡昲昵昜昦昢昳昫昺昝昴昹昮朏朐柁柲柈枺"], ["cf40","柜枻柸柘柀枷柅柫柤柟枵柍枳柷柶柮柣柂枹柎柧柰枲柼柆柭柌枮柦柛柺柉柊柃柪柋欨殂殄殶毖毘毠氠氡洨洴洭洟洼洿洒洊泚洳洄洙洺洚洑洀洝浂"], ["cfa1","洁洘洷洃洏浀洇洠洬洈洢洉洐炷炟炾炱炰炡炴炵炩牁牉牊牬牰牳牮狊狤狨狫狟狪狦狣玅珌珂珈珅玹玶玵玴珫玿珇玾珃珆玸珋瓬瓮甮畇畈疧疪癹盄眈眃眄眅眊盷盻盺矧矨砆砑砒砅砐砏砎砉砃砓祊祌祋祅祄秕种秏秖秎窀"], ["d040","穾竑笀笁籺籸籹籿粀粁紃紈紁罘羑羍羾耇耎耏耔耷胘胇胠胑胈胂胐胅胣胙胜胊胕胉胏胗胦胍臿舡芔苙苾苹茇苨茀苕茺苫苖苴苬苡苲苵茌苻苶苰苪"], ["d0a1","苤苠苺苳苭虷虴虼虳衁衎衧衪衩觓訄訇赲迣迡迮迠郱邽邿郕郅邾郇郋郈釔釓陔陏陑陓陊陎倞倅倇倓倢倰倛俵俴倳倷倬俶俷倗倜倠倧倵倯倱倎党冔冓凊凄凅凈凎剡剚剒剞剟剕剢勍匎厞唦哢唗唒哧哳哤唚哿唄唈哫唑唅哱"], ["d140","唊哻哷哸哠唎唃唋圁圂埌堲埕埒垺埆垽垼垸垶垿埇埐垹埁夎奊娙娖娭娮娕娏娗娊娞娳孬宧宭宬尃屖屔峬峿峮峱峷崀峹帩帨庨庮庪庬弳弰彧恝恚恧"], ["d1a1","恁悢悈悀悒悁悝悃悕悛悗悇悜悎戙扆拲挐捖挬捄捅挶捃揤挹捋捊挼挩捁挴捘捔捙挭捇挳捚捑挸捗捀捈敊敆旆旃旄旂晊晟晇晑朒朓栟栚桉栲栳栻桋桏栖栱栜栵栫栭栯桎桄栴栝栒栔栦栨栮桍栺栥栠欬欯欭欱欴歭肂殈毦毤"], ["d240","毨毣毢毧氥浺浣浤浶洍浡涒浘浢浭浯涑涍淯浿涆浞浧浠涗浰浼浟涂涘洯浨涋浾涀涄洖涃浻浽浵涐烜烓烑烝烋缹烢烗烒烞烠烔烍烅烆烇烚烎烡牂牸"], ["d2a1","牷牶猀狺狴狾狶狳狻猁珓珙珥珖玼珧珣珩珜珒珛珔珝珚珗珘珨瓞瓟瓴瓵甡畛畟疰痁疻痄痀疿疶疺皊盉眝眛眐眓眒眣眑眕眙眚眢眧砣砬砢砵砯砨砮砫砡砩砳砪砱祔祛祏祜祓祒祑秫秬秠秮秭秪秜秞秝窆窉窅窋窌窊窇竘笐"], ["d340","笄笓笅笏笈笊笎笉笒粄粑粊粌粈粍粅紞紝紑紎紘紖紓紟紒紏紌罜罡罞罠罝罛羖羒翃翂翀耖耾耹胺胲胹胵脁胻脀舁舯舥茳茭荄茙荑茥荖茿荁茦茜茢"], ["d3a1","荂荎茛茪茈茼荍茖茤茠茷茯茩荇荅荌荓茞茬荋茧荈虓虒蚢蚨蚖蚍蚑蚞蚇蚗蚆蚋蚚蚅蚥蚙蚡蚧蚕蚘蚎蚝蚐蚔衃衄衭衵衶衲袀衱衿衯袃衾衴衼訒豇豗豻貤貣赶赸趵趷趶軑軓迾迵适迿迻逄迼迶郖郠郙郚郣郟郥郘郛郗郜郤酐"], ["d440","酎酏釕釢釚陜陟隼飣髟鬯乿偰偪偡偞偠偓偋偝偲偈偍偁偛偊偢倕偅偟偩偫偣偤偆偀偮偳偗偑凐剫剭剬剮勖勓匭厜啵啶唼啍啐唴唪啑啢唶唵唰啒啅"], ["d4a1","唌唲啥啎唹啈唭唻啀啋圊圇埻堔埢埶埜埴堀埭埽堈埸堋埳埏堇埮埣埲埥埬埡堎埼堐埧堁堌埱埩埰堍堄奜婠婘婕婧婞娸娵婭婐婟婥婬婓婤婗婃婝婒婄婛婈媎娾婍娹婌婰婩婇婑婖婂婜孲孮寁寀屙崞崋崝崚崠崌崨崍崦崥崏"], ["d540","崰崒崣崟崮帾帴庱庴庹庲庳弶弸徛徖徟悊悐悆悾悰悺惓惔惏惤惙惝惈悱惛悷惊悿惃惍惀挲捥掊掂捽掽掞掭掝掗掫掎捯掇掐据掯捵掜捭掮捼掤挻掟"], ["d5a1","捸掅掁掑掍捰敓旍晥晡晛晙晜晢朘桹梇梐梜桭桮梮梫楖桯梣梬梩桵桴梲梏桷梒桼桫桲梪梀桱桾梛梖梋梠梉梤桸桻梑梌梊桽欶欳欷欸殑殏殍殎殌氪淀涫涴涳湴涬淩淢涷淶淔渀淈淠淟淖涾淥淜淝淛淴淊涽淭淰涺淕淂淏淉"], ["d640","淐淲淓淽淗淍淣涻烺焍烷焗烴焌烰焄烳焐烼烿焆焓焀烸烶焋焂焎牾牻牼牿猝猗猇猑猘猊猈狿猏猞玈珶珸珵琄琁珽琇琀珺珼珿琌琋珴琈畤畣痎痒痏"], ["d6a1","痋痌痑痐皏皉盓眹眯眭眱眲眴眳眽眥眻眵硈硒硉硍硊硌砦硅硐祤祧祩祪祣祫祡离秺秸秶秷窏窔窐笵筇笴笥笰笢笤笳笘笪笝笱笫笭笯笲笸笚笣粔粘粖粣紵紽紸紶紺絅紬紩絁絇紾紿絊紻紨罣羕羜羝羛翊翋翍翐翑翇翏翉耟"], ["d740","耞耛聇聃聈脘脥脙脛脭脟脬脞脡脕脧脝脢舑舸舳舺舴舲艴莐莣莨莍荺荳莤荴莏莁莕莙荵莔莩荽莃莌莝莛莪莋荾莥莯莈莗莰荿莦莇莮荶莚虙虖蚿蚷"], ["d7a1","蛂蛁蛅蚺蚰蛈蚹蚳蚸蛌蚴蚻蚼蛃蚽蚾衒袉袕袨袢袪袚袑袡袟袘袧袙袛袗袤袬袌袓袎覂觖觙觕訰訧訬訞谹谻豜豝豽貥赽赻赹趼跂趹趿跁軘軞軝軜軗軠軡逤逋逑逜逌逡郯郪郰郴郲郳郔郫郬郩酖酘酚酓酕釬釴釱釳釸釤釹釪"], ["d840","釫釷釨釮镺閆閈陼陭陫陱陯隿靪頄飥馗傛傕傔傞傋傣傃傌傎傝偨傜傒傂傇兟凔匒匑厤厧喑喨喥喭啷噅喢喓喈喏喵喁喣喒喤啽喌喦啿喕喡喎圌堩堷"], ["d8a1","堙堞堧堣堨埵塈堥堜堛堳堿堶堮堹堸堭堬堻奡媯媔媟婺媢媞婸媦婼媥媬媕媮娷媄媊媗媃媋媩婻婽媌媜媏媓媝寪寍寋寔寑寊寎尌尰崷嵃嵫嵁嵋崿崵嵑嵎嵕崳崺嵒崽崱嵙嵂崹嵉崸崼崲崶嵀嵅幄幁彘徦徥徫惉悹惌惢惎惄愔"], ["d940","惲愊愖愅惵愓惸惼惾惁愃愘愝愐惿愄愋扊掔掱掰揎揥揨揯揃撝揳揊揠揶揕揲揵摡揟掾揝揜揄揘揓揂揇揌揋揈揰揗揙攲敧敪敤敜敨敥斌斝斞斮旐旒"], ["d9a1","晼晬晻暀晱晹晪晲朁椌棓椄棜椪棬棪棱椏棖棷棫棤棶椓椐棳棡椇棌椈楰梴椑棯棆椔棸棐棽棼棨椋椊椗棎棈棝棞棦棴棑椆棔棩椕椥棇欹欻欿欼殔殗殙殕殽毰毲毳氰淼湆湇渟湉溈渼渽湅湢渫渿湁湝湳渜渳湋湀湑渻渃渮湞"], ["da40","湨湜湡渱渨湠湱湫渹渢渰湓湥渧湸湤湷湕湹湒湦渵渶湚焠焞焯烻焮焱焣焥焢焲焟焨焺焛牋牚犈犉犆犅犋猒猋猰猢猱猳猧猲猭猦猣猵猌琮琬琰琫琖"], ["daa1","琚琡琭琱琤琣琝琩琠琲瓻甯畯畬痧痚痡痦痝痟痤痗皕皒盚睆睇睄睍睅睊睎睋睌矞矬硠硤硥硜硭硱硪确硰硩硨硞硢祴祳祲祰稂稊稃稌稄窙竦竤筊笻筄筈筌筎筀筘筅粢粞粨粡絘絯絣絓絖絧絪絏絭絜絫絒絔絩絑絟絎缾缿罥"], ["db40","罦羢羠羡翗聑聏聐胾胔腃腊腒腏腇脽腍脺臦臮臷臸臹舄舼舽舿艵茻菏菹萣菀菨萒菧菤菼菶萐菆菈菫菣莿萁菝菥菘菿菡菋菎菖菵菉萉萏菞萑萆菂菳"], ["dba1","菕菺菇菑菪萓菃菬菮菄菻菗菢萛菛菾蛘蛢蛦蛓蛣蛚蛪蛝蛫蛜蛬蛩蛗蛨蛑衈衖衕袺裗袹袸裀袾袶袼袷袽袲褁裉覕覘覗觝觚觛詎詍訹詙詀詗詘詄詅詒詈詑詊詌詏豟貁貀貺貾貰貹貵趄趀趉跘跓跍跇跖跜跏跕跙跈跗跅軯軷軺"], ["dc40","軹軦軮軥軵軧軨軶軫軱軬軴軩逭逴逯鄆鄬鄄郿郼鄈郹郻鄁鄀鄇鄅鄃酡酤酟酢酠鈁鈊鈥鈃鈚鈦鈏鈌鈀鈒釿釽鈆鈄鈧鈂鈜鈤鈙鈗鈅鈖镻閍閌閐隇陾隈"], ["dca1","隉隃隀雂雈雃雱雰靬靰靮頇颩飫鳦黹亃亄亶傽傿僆傮僄僊傴僈僂傰僁傺傱僋僉傶傸凗剺剸剻剼嗃嗛嗌嗐嗋嗊嗝嗀嗔嗄嗩喿嗒喍嗏嗕嗢嗖嗈嗲嗍嗙嗂圔塓塨塤塏塍塉塯塕塎塝塙塥塛堽塣塱壼嫇嫄嫋媺媸媱媵媰媿嫈媻嫆"], ["dd40","媷嫀嫊媴媶嫍媹媐寖寘寙尟尳嵱嵣嵊嵥嵲嵬嵞嵨嵧嵢巰幏幎幊幍幋廅廌廆廋廇彀徯徭惷慉慊愫慅愶愲愮慆愯慏愩慀戠酨戣戥戤揅揱揫搐搒搉搠搤"], ["dda1","搳摃搟搕搘搹搷搢搣搌搦搰搨摁搵搯搊搚摀搥搧搋揧搛搮搡搎敯斒旓暆暌暕暐暋暊暙暔晸朠楦楟椸楎楢楱椿楅楪椹楂楗楙楺楈楉椵楬椳椽楥棰楸椴楩楀楯楄楶楘楁楴楌椻楋椷楜楏楑椲楒椯楻椼歆歅歃歂歈歁殛嗀毻毼"], ["de40","毹毷毸溛滖滈溏滀溟溓溔溠溱溹滆滒溽滁溞滉溷溰滍溦滏溲溾滃滜滘溙溒溎溍溤溡溿溳滐滊溗溮溣煇煔煒煣煠煁煝煢煲煸煪煡煂煘煃煋煰煟煐煓"], ["dea1","煄煍煚牏犍犌犑犐犎猼獂猻猺獀獊獉瑄瑊瑋瑒瑑瑗瑀瑏瑐瑎瑂瑆瑍瑔瓡瓿瓾瓽甝畹畷榃痯瘏瘃痷痾痼痹痸瘐痻痶痭痵痽皙皵盝睕睟睠睒睖睚睩睧睔睙睭矠碇碚碔碏碄碕碅碆碡碃硹碙碀碖硻祼禂祽祹稑稘稙稒稗稕稢稓"], ["df40","稛稐窣窢窞竫筦筤筭筴筩筲筥筳筱筰筡筸筶筣粲粴粯綈綆綀綍絿綅絺綎絻綃絼綌綔綄絽綒罭罫罧罨罬羦羥羧翛翜耡腤腠腷腜腩腛腢腲朡腞腶腧腯"], ["dfa1","腄腡舝艉艄艀艂艅蓱萿葖葶葹蒏蒍葥葑葀蒆葧萰葍葽葚葙葴葳葝蔇葞萷萺萴葺葃葸萲葅萩菙葋萯葂萭葟葰萹葎葌葒葯蓅蒎萻葇萶萳葨葾葄萫葠葔葮葐蜋蜄蛷蜌蛺蛖蛵蝍蛸蜎蜉蜁蛶蜍蜅裖裋裍裎裞裛裚裌裐覅覛觟觥觤"], ["e040","觡觠觢觜触詶誆詿詡訿詷誂誄詵誃誁詴詺谼豋豊豥豤豦貆貄貅賌赨赩趑趌趎趏趍趓趔趐趒跰跠跬跱跮跐跩跣跢跧跲跫跴輆軿輁輀輅輇輈輂輋遒逿"], ["e0a1","遄遉逽鄐鄍鄏鄑鄖鄔鄋鄎酮酯鉈鉒鈰鈺鉦鈳鉥鉞銃鈮鉊鉆鉭鉬鉏鉠鉧鉯鈶鉡鉰鈱鉔鉣鉐鉲鉎鉓鉌鉖鈲閟閜閞閛隒隓隑隗雎雺雽雸雵靳靷靸靲頏頍頎颬飶飹馯馲馰馵骭骫魛鳪鳭鳧麀黽僦僔僗僨僳僛僪僝僤僓僬僰僯僣僠"], ["e140","凘劀劁勩勫匰厬嘧嘕嘌嘒嗼嘏嘜嘁嘓嘂嗺嘝嘄嗿嗹墉塼墐墘墆墁塿塴墋塺墇墑墎塶墂墈塻墔墏壾奫嫜嫮嫥嫕嫪嫚嫭嫫嫳嫢嫠嫛嫬嫞嫝嫙嫨嫟孷寠"], ["e1a1","寣屣嶂嶀嵽嶆嵺嶁嵷嶊嶉嶈嵾嵼嶍嵹嵿幘幙幓廘廑廗廎廜廕廙廒廔彄彃彯徶愬愨慁慞慱慳慒慓慲慬憀慴慔慺慛慥愻慪慡慖戩戧戫搫摍摛摝摴摶摲摳摽摵摦撦摎撂摞摜摋摓摠摐摿搿摬摫摙摥摷敳斠暡暠暟朅朄朢榱榶槉"], ["e240","榠槎榖榰榬榼榑榙榎榧榍榩榾榯榿槄榽榤槔榹槊榚槏榳榓榪榡榞槙榗榐槂榵榥槆歊歍歋殞殟殠毃毄毾滎滵滱漃漥滸漷滻漮漉潎漙漚漧漘漻漒滭漊"], ["e2a1","漶潳滹滮漭潀漰漼漵滫漇漎潃漅滽滶漹漜滼漺漟漍漞漈漡熇熐熉熀熅熂熏煻熆熁熗牄牓犗犕犓獃獍獑獌瑢瑳瑱瑵瑲瑧瑮甀甂甃畽疐瘖瘈瘌瘕瘑瘊瘔皸瞁睼瞅瞂睮瞀睯睾瞃碲碪碴碭碨硾碫碞碥碠碬碢碤禘禊禋禖禕禔禓"], ["e340","禗禈禒禐稫穊稰稯稨稦窨窫窬竮箈箜箊箑箐箖箍箌箛箎箅箘劄箙箤箂粻粿粼粺綧綷緂綣綪緁緀緅綝緎緄緆緋緌綯綹綖綼綟綦綮綩綡緉罳翢翣翥翞"], ["e3a1","耤聝聜膉膆膃膇膍膌膋舕蒗蒤蒡蒟蒺蓎蓂蒬蒮蒫蒹蒴蓁蓍蒪蒚蒱蓐蒝蒧蒻蒢蒔蓇蓌蒛蒩蒯蒨蓖蒘蒶蓏蒠蓗蓔蓒蓛蒰蒑虡蜳蜣蜨蝫蝀蜮蜞蜡蜙蜛蝃蜬蝁蜾蝆蜠蜲蜪蜭蜼蜒蜺蜱蜵蝂蜦蜧蜸蜤蜚蜰蜑裷裧裱裲裺裾裮裼裶裻"], ["e440","裰裬裫覝覡覟覞觩觫觨誫誙誋誒誏誖谽豨豩賕賏賗趖踉踂跿踍跽踊踃踇踆踅跾踀踄輐輑輎輍鄣鄜鄠鄢鄟鄝鄚鄤鄡鄛酺酲酹酳銥銤鉶銛鉺銠銔銪銍"], ["e4a1","銦銚銫鉹銗鉿銣鋮銎銂銕銢鉽銈銡銊銆銌銙銧鉾銇銩銝銋鈭隞隡雿靘靽靺靾鞃鞀鞂靻鞄鞁靿韎韍頖颭颮餂餀餇馝馜駃馹馻馺駂馽駇骱髣髧鬾鬿魠魡魟鳱鳲鳵麧僿儃儰僸儆儇僶僾儋儌僽儊劋劌勱勯噈噂噌嘵噁噊噉噆噘"], ["e540","噚噀嘳嘽嘬嘾嘸嘪嘺圚墫墝墱墠墣墯墬墥墡壿嫿嫴嫽嫷嫶嬃嫸嬂嫹嬁嬇嬅嬏屧嶙嶗嶟嶒嶢嶓嶕嶠嶜嶡嶚嶞幩幝幠幜緳廛廞廡彉徲憋憃慹憱憰憢憉"], ["e5a1","憛憓憯憭憟憒憪憡憍慦憳戭摮摰撖撠撅撗撜撏撋撊撌撣撟摨撱撘敶敺敹敻斲斳暵暰暩暲暷暪暯樀樆樗槥槸樕槱槤樠槿槬槢樛樝槾樧槲槮樔槷槧橀樈槦槻樍槼槫樉樄樘樥樏槶樦樇槴樖歑殥殣殢殦氁氀毿氂潁漦潾澇濆澒"], ["e640","澍澉澌潢潏澅潚澖潶潬澂潕潲潒潐潗澔澓潝漀潡潫潽潧澐潓澋潩潿澕潣潷潪潻熲熯熛熰熠熚熩熵熝熥熞熤熡熪熜熧熳犘犚獘獒獞獟獠獝獛獡獚獙"], ["e6a1","獢璇璉璊璆璁瑽璅璈瑼瑹甈甇畾瘥瘞瘙瘝瘜瘣瘚瘨瘛皜皝皞皛瞍瞏瞉瞈磍碻磏磌磑磎磔磈磃磄磉禚禡禠禜禢禛歶稹窲窴窳箷篋箾箬篎箯箹篊箵糅糈糌糋緷緛緪緧緗緡縃緺緦緶緱緰緮緟罶羬羰羭翭翫翪翬翦翨聤聧膣膟"], ["e740","膞膕膢膙膗舖艏艓艒艐艎艑蔤蔻蔏蔀蔩蔎蔉蔍蔟蔊蔧蔜蓻蔫蓺蔈蔌蓴蔪蓲蔕蓷蓫蓳蓼蔒蓪蓩蔖蓾蔨蔝蔮蔂蓽蔞蓶蔱蔦蓧蓨蓰蓯蓹蔘蔠蔰蔋蔙蔯虢"], ["e7a1","蝖蝣蝤蝷蟡蝳蝘蝔蝛蝒蝡蝚蝑蝞蝭蝪蝐蝎蝟蝝蝯蝬蝺蝮蝜蝥蝏蝻蝵蝢蝧蝩衚褅褌褔褋褗褘褙褆褖褑褎褉覢覤覣觭觰觬諏諆誸諓諑諔諕誻諗誾諀諅諘諃誺誽諙谾豍貏賥賟賙賨賚賝賧趠趜趡趛踠踣踥踤踮踕踛踖踑踙踦踧"], ["e840","踔踒踘踓踜踗踚輬輤輘輚輠輣輖輗遳遰遯遧遫鄯鄫鄩鄪鄲鄦鄮醅醆醊醁醂醄醀鋐鋃鋄鋀鋙銶鋏鋱鋟鋘鋩鋗鋝鋌鋯鋂鋨鋊鋈鋎鋦鋍鋕鋉鋠鋞鋧鋑鋓"], ["e8a1","銵鋡鋆銴镼閬閫閮閰隤隢雓霅霈霂靚鞊鞎鞈韐韏頞頝頦頩頨頠頛頧颲餈飺餑餔餖餗餕駜駍駏駓駔駎駉駖駘駋駗駌骳髬髫髳髲髱魆魃魧魴魱魦魶魵魰魨魤魬鳼鳺鳽鳿鳷鴇鴀鳹鳻鴈鴅鴄麃黓鼏鼐儜儓儗儚儑凞匴叡噰噠噮"], ["e940","噳噦噣噭噲噞噷圜圛壈墽壉墿墺壂墼壆嬗嬙嬛嬡嬔嬓嬐嬖嬨嬚嬠嬞寯嶬嶱嶩嶧嶵嶰嶮嶪嶨嶲嶭嶯嶴幧幨幦幯廩廧廦廨廥彋徼憝憨憖懅憴懆懁懌憺"], ["e9a1","憿憸憌擗擖擐擏擉撽撉擃擛擳擙攳敿敼斢曈暾曀曊曋曏暽暻暺曌朣樴橦橉橧樲橨樾橝橭橶橛橑樨橚樻樿橁橪橤橐橏橔橯橩橠樼橞橖橕橍橎橆歕歔歖殧殪殫毈毇氄氃氆澭濋澣濇澼濎濈潞濄澽澞濊澨瀄澥澮澺澬澪濏澿澸"], ["ea40","澢濉澫濍澯澲澰燅燂熿熸燖燀燁燋燔燊燇燏熽燘熼燆燚燛犝犞獩獦獧獬獥獫獪瑿璚璠璔璒璕璡甋疀瘯瘭瘱瘽瘳瘼瘵瘲瘰皻盦瞚瞝瞡瞜瞛瞢瞣瞕瞙"], ["eaa1","瞗磝磩磥磪磞磣磛磡磢磭磟磠禤穄穈穇窶窸窵窱窷篞篣篧篝篕篥篚篨篹篔篪篢篜篫篘篟糒糔糗糐糑縒縡縗縌縟縠縓縎縜縕縚縢縋縏縖縍縔縥縤罃罻罼罺羱翯耪耩聬膱膦膮膹膵膫膰膬膴膲膷膧臲艕艖艗蕖蕅蕫蕍蕓蕡蕘"], ["eb40","蕀蕆蕤蕁蕢蕄蕑蕇蕣蔾蕛蕱蕎蕮蕵蕕蕧蕠薌蕦蕝蕔蕥蕬虣虥虤螛螏螗螓螒螈螁螖螘蝹螇螣螅螐螑螝螄螔螜螚螉褞褦褰褭褮褧褱褢褩褣褯褬褟觱諠"], ["eba1","諢諲諴諵諝謔諤諟諰諈諞諡諨諿諯諻貑貒貐賵賮賱賰賳赬赮趥趧踳踾踸蹀蹅踶踼踽蹁踰踿躽輶輮輵輲輹輷輴遶遹遻邆郺鄳鄵鄶醓醐醑醍醏錧錞錈錟錆錏鍺錸錼錛錣錒錁鍆錭錎錍鋋錝鋺錥錓鋹鋷錴錂錤鋿錩錹錵錪錔錌"], ["ec40","錋鋾錉錀鋻錖閼闍閾閹閺閶閿閵閽隩雔霋霒霐鞙鞗鞔韰韸頵頯頲餤餟餧餩馞駮駬駥駤駰駣駪駩駧骹骿骴骻髶髺髹髷鬳鮀鮅鮇魼魾魻鮂鮓鮒鮐魺鮕"], ["eca1","魽鮈鴥鴗鴠鴞鴔鴩鴝鴘鴢鴐鴙鴟麈麆麇麮麭黕黖黺鼒鼽儦儥儢儤儠儩勴嚓嚌嚍嚆嚄嚃噾嚂噿嚁壖壔壏壒嬭嬥嬲嬣嬬嬧嬦嬯嬮孻寱寲嶷幬幪徾徻懃憵憼懧懠懥懤懨懞擯擩擣擫擤擨斁斀斶旚曒檍檖檁檥檉檟檛檡檞檇檓檎"], ["ed40","檕檃檨檤檑橿檦檚檅檌檒歛殭氉濌澩濴濔濣濜濭濧濦濞濲濝濢濨燡燱燨燲燤燰燢獳獮獯璗璲璫璐璪璭璱璥璯甐甑甒甏疄癃癈癉癇皤盩瞵瞫瞲瞷瞶"], ["eda1","瞴瞱瞨矰磳磽礂磻磼磲礅磹磾礄禫禨穜穛穖穘穔穚窾竀竁簅簏篲簀篿篻簎篴簋篳簂簉簃簁篸篽簆篰篱簐簊糨縭縼繂縳顈縸縪繉繀繇縩繌縰縻縶繄縺罅罿罾罽翴翲耬膻臄臌臊臅臇膼臩艛艚艜薃薀薏薧薕薠薋薣蕻薤薚薞"], ["ee40","蕷蕼薉薡蕺蕸蕗薎薖薆薍薙薝薁薢薂薈薅蕹蕶薘薐薟虨螾螪螭蟅螰螬螹螵螼螮蟉蟃蟂蟌螷螯蟄蟊螴螶螿螸螽蟞螲褵褳褼褾襁襒褷襂覭覯覮觲觳謞"], ["eea1","謘謖謑謅謋謢謏謒謕謇謍謈謆謜謓謚豏豰豲豱豯貕貔賹赯蹎蹍蹓蹐蹌蹇轃轀邅遾鄸醚醢醛醙醟醡醝醠鎡鎃鎯鍤鍖鍇鍼鍘鍜鍶鍉鍐鍑鍠鍭鎏鍌鍪鍹鍗鍕鍒鍏鍱鍷鍻鍡鍞鍣鍧鎀鍎鍙闇闀闉闃闅閷隮隰隬霠霟霘霝霙鞚鞡鞜"], ["ef40","鞞鞝韕韔韱顁顄顊顉顅顃餥餫餬餪餳餲餯餭餱餰馘馣馡騂駺駴駷駹駸駶駻駽駾駼騃骾髾髽鬁髼魈鮚鮨鮞鮛鮦鮡鮥鮤鮆鮢鮠鮯鴳鵁鵧鴶鴮鴯鴱鴸鴰"], ["efa1","鵅鵂鵃鴾鴷鵀鴽翵鴭麊麉麍麰黈黚黻黿鼤鼣鼢齔龠儱儭儮嚘嚜嚗嚚嚝嚙奰嬼屩屪巀幭幮懘懟懭懮懱懪懰懫懖懩擿攄擽擸攁攃擼斔旛曚曛曘櫅檹檽櫡櫆檺檶檷櫇檴檭歞毉氋瀇瀌瀍瀁瀅瀔瀎濿瀀濻瀦濼濷瀊爁燿燹爃燽獶"], ["f040","璸瓀璵瓁璾璶璻瓂甔甓癜癤癙癐癓癗癚皦皽盬矂瞺磿礌礓礔礉礐礒礑禭禬穟簜簩簙簠簟簭簝簦簨簢簥簰繜繐繖繣繘繢繟繑繠繗繓羵羳翷翸聵臑臒"], ["f0a1","臐艟艞薴藆藀藃藂薳薵薽藇藄薿藋藎藈藅薱薶藒蘤薸薷薾虩蟧蟦蟢蟛蟫蟪蟥蟟蟳蟤蟔蟜蟓蟭蟘蟣螤蟗蟙蠁蟴蟨蟝襓襋襏襌襆襐襑襉謪謧謣謳謰謵譇謯謼謾謱謥謷謦謶謮謤謻謽謺豂豵貙貘貗賾贄贂贀蹜蹢蹠蹗蹖蹞蹥蹧"], ["f140","蹛蹚蹡蹝蹩蹔轆轇轈轋鄨鄺鄻鄾醨醥醧醯醪鎵鎌鎒鎷鎛鎝鎉鎧鎎鎪鎞鎦鎕鎈鎙鎟鎍鎱鎑鎲鎤鎨鎴鎣鎥闒闓闑隳雗雚巂雟雘雝霣霢霥鞬鞮鞨鞫鞤鞪"], ["f1a1","鞢鞥韗韙韖韘韺顐顑顒颸饁餼餺騏騋騉騍騄騑騊騅騇騆髀髜鬈鬄鬅鬩鬵魊魌魋鯇鯆鯃鮿鯁鮵鮸鯓鮶鯄鮹鮽鵜鵓鵏鵊鵛鵋鵙鵖鵌鵗鵒鵔鵟鵘鵚麎麌黟鼁鼀鼖鼥鼫鼪鼩鼨齌齕儴儵劖勷厴嚫嚭嚦嚧嚪嚬壚壝壛夒嬽嬾嬿巃幰"], ["f240","徿懻攇攐攍攉攌攎斄旞旝曞櫧櫠櫌櫑櫙櫋櫟櫜櫐櫫櫏櫍櫞歠殰氌瀙瀧瀠瀖瀫瀡瀢瀣瀩瀗瀤瀜瀪爌爊爇爂爅犥犦犤犣犡瓋瓅璷瓃甖癠矉矊矄矱礝礛"], ["f2a1","礡礜礗礞禰穧穨簳簼簹簬簻糬糪繶繵繸繰繷繯繺繲繴繨罋罊羃羆羷翽翾聸臗臕艤艡艣藫藱藭藙藡藨藚藗藬藲藸藘藟藣藜藑藰藦藯藞藢蠀蟺蠃蟶蟷蠉蠌蠋蠆蟼蠈蟿蠊蠂襢襚襛襗襡襜襘襝襙覈覷覶觶譐譈譊譀譓譖譔譋譕"], ["f340","譑譂譒譗豃豷豶貚贆贇贉趬趪趭趫蹭蹸蹳蹪蹯蹻軂轒轑轏轐轓辴酀鄿醰醭鏞鏇鏏鏂鏚鏐鏹鏬鏌鏙鎩鏦鏊鏔鏮鏣鏕鏄鏎鏀鏒鏧镽闚闛雡霩霫霬霨霦"], ["f3a1","鞳鞷鞶韝韞韟顜顙顝顗颿颽颻颾饈饇饃馦馧騚騕騥騝騤騛騢騠騧騣騞騜騔髂鬋鬊鬎鬌鬷鯪鯫鯠鯞鯤鯦鯢鯰鯔鯗鯬鯜鯙鯥鯕鯡鯚鵷鶁鶊鶄鶈鵱鶀鵸鶆鶋鶌鵽鵫鵴鵵鵰鵩鶅鵳鵻鶂鵯鵹鵿鶇鵨麔麑黀黼鼭齀齁齍齖齗齘匷嚲"], ["f440","嚵嚳壣孅巆巇廮廯忀忁懹攗攖攕攓旟曨曣曤櫳櫰櫪櫨櫹櫱櫮櫯瀼瀵瀯瀷瀴瀱灂瀸瀿瀺瀹灀瀻瀳灁爓爔犨獽獼璺皫皪皾盭矌矎矏矍矲礥礣礧礨礤礩"], ["f4a1","禲穮穬穭竷籉籈籊籇籅糮繻繾纁纀羺翿聹臛臙舋艨艩蘢藿蘁藾蘛蘀藶蘄蘉蘅蘌藽蠙蠐蠑蠗蠓蠖襣襦覹觷譠譪譝譨譣譥譧譭趮躆躈躄轙轖轗轕轘轚邍酃酁醷醵醲醳鐋鐓鏻鐠鐏鐔鏾鐕鐐鐨鐙鐍鏵鐀鏷鐇鐎鐖鐒鏺鐉鏸鐊鏿"], ["f540","鏼鐌鏶鐑鐆闞闠闟霮霯鞹鞻韽韾顠顢顣顟飁飂饐饎饙饌饋饓騲騴騱騬騪騶騩騮騸騭髇髊髆鬐鬒鬑鰋鰈鯷鰅鰒鯸鱀鰇鰎鰆鰗鰔鰉鶟鶙鶤鶝鶒鶘鶐鶛"], ["f5a1","鶠鶔鶜鶪鶗鶡鶚鶢鶨鶞鶣鶿鶩鶖鶦鶧麙麛麚黥黤黧黦鼰鼮齛齠齞齝齙龑儺儹劘劗囃嚽嚾孈孇巋巏廱懽攛欂櫼欃櫸欀灃灄灊灈灉灅灆爝爚爙獾甗癪矐礭礱礯籔籓糲纊纇纈纋纆纍罍羻耰臝蘘蘪蘦蘟蘣蘜蘙蘧蘮蘡蘠蘩蘞蘥"], ["f640","蠩蠝蠛蠠蠤蠜蠫衊襭襩襮襫觺譹譸譅譺譻贐贔趯躎躌轞轛轝酆酄酅醹鐿鐻鐶鐩鐽鐼鐰鐹鐪鐷鐬鑀鐱闥闤闣霵霺鞿韡顤飉飆飀饘饖騹騽驆驄驂驁騺"], ["f6a1","騿髍鬕鬗鬘鬖鬺魒鰫鰝鰜鰬鰣鰨鰩鰤鰡鶷鶶鶼鷁鷇鷊鷏鶾鷅鷃鶻鶵鷎鶹鶺鶬鷈鶱鶭鷌鶳鷍鶲鹺麜黫黮黭鼛鼘鼚鼱齎齥齤龒亹囆囅囋奱孋孌巕巑廲攡攠攦攢欋欈欉氍灕灖灗灒爞爟犩獿瓘瓕瓙瓗癭皭礵禴穰穱籗籜籙籛籚"], ["f740","糴糱纑罏羇臞艫蘴蘵蘳蘬蘲蘶蠬蠨蠦蠪蠥襱覿覾觻譾讄讂讆讅譿贕躕躔躚躒躐躖躗轠轢酇鑌鑐鑊鑋鑏鑇鑅鑈鑉鑆霿韣顪顩飋饔饛驎驓驔驌驏驈驊"], ["f7a1","驉驒驐髐鬙鬫鬻魖魕鱆鱈鰿鱄鰹鰳鱁鰼鰷鰴鰲鰽鰶鷛鷒鷞鷚鷋鷐鷜鷑鷟鷩鷙鷘鷖鷵鷕鷝麶黰鼵鼳鼲齂齫龕龢儽劙壨壧奲孍巘蠯彏戁戃戄攩攥斖曫欑欒欏毊灛灚爢玂玁玃癰矔籧籦纕艬蘺虀蘹蘼蘱蘻蘾蠰蠲蠮蠳襶襴襳觾"], ["f840","讌讎讋讈豅贙躘轤轣醼鑢鑕鑝鑗鑞韄韅頀驖驙鬞鬟鬠鱒鱘鱐鱊鱍鱋鱕鱙鱌鱎鷻鷷鷯鷣鷫鷸鷤鷶鷡鷮鷦鷲鷰鷢鷬鷴鷳鷨鷭黂黐黲黳鼆鼜鼸鼷鼶齃齏"], ["f8a1","齱齰齮齯囓囍孎屭攭曭曮欓灟灡灝灠爣瓛瓥矕礸禷禶籪纗羉艭虃蠸蠷蠵衋讔讕躞躟躠躝醾醽釂鑫鑨鑩雥靆靃靇韇韥驞髕魙鱣鱧鱦鱢鱞鱠鸂鷾鸇鸃鸆鸅鸀鸁鸉鷿鷽鸄麠鼞齆齴齵齶囔攮斸欘欙欗欚灢爦犪矘矙礹籩籫糶纚"], ["f940","纘纛纙臠臡虆虇虈襹襺襼襻觿讘讙躥躤躣鑮鑭鑯鑱鑳靉顲饟鱨鱮鱭鸋鸍鸐鸏鸒鸑麡黵鼉齇齸齻齺齹圞灦籯蠼趲躦釃鑴鑸鑶鑵驠鱴鱳鱱鱵鸔鸓黶鼊"], ["f9a1","龤灨灥糷虪蠾蠽蠿讞貜躩軉靋顳顴飌饡馫驤驦驧鬤鸕鸗齈戇欞爧虌躨钂钀钁驩驨鬮鸙爩虋讟钃鱹麷癵驫鱺鸝灩灪麤齾齉龘碁銹裏墻恒粧嫺╔╦╗╠╬╣╚╩╝╒╤╕╞╪╡╘╧╛╓╥╖╟╫╢╙╨╜║═╭╮╰╯▓"] ] [ ["0","\u0000",127], ["8ea1","。",62], ["a1a1"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇"], ["a2a1","◆□■△▲▽▼※〒→←↑↓〓"], ["a2ba","∈∋⊆⊇⊂⊃∪∩"], ["a2ca","∧∨¬⇒⇔∀∃"], ["a2dc","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"], ["a2f2","ʼn♯♭♪†‡¶"], ["a2fe","◯"], ["a3b0","0",9], ["a3c1","A",25], ["a3e1","a",25], ["a4a1","ぁ",82], ["a5a1","ァ",85], ["a6a1","Α",16,"Σ",6], ["a6c1","α",16,"σ",6], ["a7a1","А",5,"ЁЖ",25], ["a7d1","а",5,"ёж",25], ["a8a1","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"], ["ada1","①",19,"Ⅰ",9], ["adc0","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"], ["addf","㍻〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"], ["b0a1","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"], ["b1a1","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応"], ["b2a1","押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"], ["b3a1","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱"], ["b4a1","粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"], ["b5a1","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京"], ["b6a1","供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"], ["b7a1","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲"], ["b8a1","検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"], ["b9a1","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込"], ["baa1","此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"], ["bba1","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時"], ["bca1","次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"], ["bda1","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償"], ["bea1","勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"], ["bfa1","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾"], ["c0a1","澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"], ["c1a1","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎"], ["c2a1","臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"], ["c3a1","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵"], ["c4a1","帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"], ["c5a1","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到"], ["c6a1","董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"], ["c7a1","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦"], ["c8a1","函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"], ["c9a1","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服"], ["caa1","福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"], ["cba1","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満"], ["cca1","漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"], ["cda1","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃"], ["cea1","痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"], ["cfa1","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"], ["d0a1","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"], ["d1a1","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨"], ["d2a1","辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"], ["d3a1","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉"], ["d4a1","圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"], ["d5a1","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓"], ["d6a1","屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"], ["d7a1","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚"], ["d8a1","悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"], ["d9a1","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼"], ["daa1","據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"], ["dba1","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍"], ["dca1","棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"], ["dda1","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾"], ["dea1","沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"], ["dfa1","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼"], ["e0a1","燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"], ["e1a1","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰"], ["e2a1","癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"], ["e3a1","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐"], ["e4a1","筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"], ["e5a1","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺"], ["e6a1","罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"], ["e7a1","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙"], ["e8a1","茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"], ["e9a1","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙"], ["eaa1","蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"], ["eba1","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫"], ["eca1","譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"], ["eda1","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸"], ["eea1","遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"], ["efa1","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞"], ["f0a1","陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"], ["f1a1","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷"], ["f2a1","髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"], ["f3a1","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠"], ["f4a1","堯槇遙瑤凜熙"], ["f9a1","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德"], ["faa1","忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"], ["fba1","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚"], ["fca1","釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"], ["fcf1","ⅰ",9,"¬¦'""], ["8fa2af","˘ˇ¸˙˝¯˛˚~΄΅"], ["8fa2c2","¡¦¿"], ["8fa2eb","ºª©®™¤№"], ["8fa6e1","ΆΈΉΊΪ"], ["8fa6e7","Ό"], ["8fa6e9","ΎΫ"], ["8fa6ec","Ώ"], ["8fa6f1","άέήίϊΐόςύϋΰώ"], ["8fa7c2","Ђ",10,"ЎЏ"], ["8fa7f2","ђ",10,"ўџ"], ["8fa9a1","ÆĐ"], ["8fa9a4","Ħ"], ["8fa9a6","IJ"], ["8fa9a8","ŁĿ"], ["8fa9ab","ŊØŒ"], ["8fa9af","ŦÞ"], ["8fa9c1","æđðħıijĸłŀʼnŋøœßŧþ"], ["8faaa1","ÁÀÄÂĂǍĀĄÅÃĆĈČÇĊĎÉÈËÊĚĖĒĘ"], ["8faaba","ĜĞĢĠĤÍÌÏÎǏİĪĮĨĴĶĹĽĻŃŇŅÑÓÒÖÔǑŐŌÕŔŘŖŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙǕŴÝŸŶŹŽŻ"], ["8faba1","áàäâăǎāąåãćĉčçċďéèëêěėēęǵĝğ"], ["8fabbd","ġĥíìïîǐ"], ["8fabc5","īįĩĵķĺľļńňņñóòöôǒőōõŕřŗśŝšşťţúùüûŭǔűūųůũǘǜǚǖŵýÿŷźžż"], ["8fb0a1","丂丄丅丌丒丟丣两丨丫丮丯丰丵乀乁乄乇乑乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘佟佣佪佬佮佱佷佸佹佺佽佾侁侂侄"], ["8fb1a1","侅侉侊侌侎侐侒侓侔侗侙侚侞侟侲侷侹侻侼侽侾俀俁俅俆俈俉俋俌俍俏俒俜俠俢俰俲俼俽俿倀倁倄倇倊倌倎倐倓倗倘倛倜倝倞倢倧倮倰倲倳倵偀偁偂偅偆偊偌偎偑偒偓偗偙偟偠偢偣偦偧偪偭偰偱倻傁傃傄傆傊傎傏傐"], ["8fb2a1","傒傓傔傖傛傜傞",4,"傪傯傰傹傺傽僀僃僄僇僌僎僐僓僔僘僜僝僟僢僤僦僨僩僯僱僶僺僾儃儆儇儈儋儌儍儎僲儐儗儙儛儜儝儞儣儧儨儬儭儯儱儳儴儵儸儹兂兊兏兓兕兗兘兟兤兦兾冃冄冋冎冘冝冡冣冭冸冺冼冾冿凂"], ["8fb3a1","凈减凑凒凓凕凘凞凢凥凮凲凳凴凷刁刂刅划刓刕刖刘刢刨刱刲刵刼剅剉剕剗剘剚剜剟剠剡剦剮剷剸剹劀劂劅劊劌劓劕劖劗劘劚劜劤劥劦劧劯劰劶劷劸劺劻劽勀勄勆勈勌勏勑勔勖勛勜勡勥勨勩勪勬勰勱勴勶勷匀匃匊匋"], ["8fb4a1","匌匑匓匘匛匜匞匟匥匧匨匩匫匬匭匰匲匵匼匽匾卂卌卋卙卛卡卣卥卬卭卲卹卾厃厇厈厎厓厔厙厝厡厤厪厫厯厲厴厵厷厸厺厽叀叅叏叒叓叕叚叝叞叠另叧叵吂吓吚吡吧吨吪启吱吴吵呃呄呇呍呏呞呢呤呦呧呩呫呭呮呴呿"], ["8fb5a1","咁咃咅咈咉咍咑咕咖咜咟咡咦咧咩咪咭咮咱咷咹咺咻咿哆哊响哎哠哪哬哯哶哼哾哿唀唁唅唈唉唌唍唎唕唪唫唲唵唶唻唼唽啁啇啉啊啍啐啑啘啚啛啞啠啡啤啦啿喁喂喆喈喎喏喑喒喓喔喗喣喤喭喲喿嗁嗃嗆嗉嗋嗌嗎嗑嗒"], ["8fb6a1","嗓嗗嗘嗛嗞嗢嗩嗶嗿嘅嘈嘊嘍",5,"嘙嘬嘰嘳嘵嘷嘹嘻嘼嘽嘿噀噁噃噄噆噉噋噍噏噔噞噠噡噢噣噦噩噭噯噱噲噵嚄嚅嚈嚋嚌嚕嚙嚚嚝嚞嚟嚦嚧嚨嚩嚫嚬嚭嚱嚳嚷嚾囅囉囊囋囏囐囌囍囙囜囝囟囡囤",4,"囱囫园"], ["8fb7a1","囶囷圁圂圇圊圌圑圕圚圛圝圠圢圣圤圥圩圪圬圮圯圳圴圽圾圿坅坆坌坍坒坢坥坧坨坫坭",4,"坳坴坵坷坹坺坻坼坾垁垃垌垔垗垙垚垜垝垞垟垡垕垧垨垩垬垸垽埇埈埌埏埕埝埞埤埦埧埩埭埰埵埶埸埽埾埿堃堄堈堉埡"], ["8fb8a1","堌堍堛堞堟堠堦堧堭堲堹堿塉塌塍塏塐塕塟塡塤塧塨塸塼塿墀墁墇墈墉墊墌墍墏墐墔墖墝墠墡墢墦墩墱墲壄墼壂壈壍壎壐壒壔壖壚壝壡壢壩壳夅夆夋夌夒夓夔虁夝夡夣夤夨夯夰夳夵夶夿奃奆奒奓奙奛奝奞奟奡奣奫奭"], ["8fb9a1","奯奲奵奶她奻奼妋妌妎妒妕妗妟妤妧妭妮妯妰妳妷妺妼姁姃姄姈姊姍姒姝姞姟姣姤姧姮姯姱姲姴姷娀娄娌娍娎娒娓娞娣娤娧娨娪娭娰婄婅婇婈婌婐婕婞婣婥婧婭婷婺婻婾媋媐媓媖媙媜媞媟媠媢媧媬媱媲媳媵媸媺媻媿"], ["8fbaa1","嫄嫆嫈嫏嫚嫜嫠嫥嫪嫮嫵嫶嫽嬀嬁嬈嬗嬴嬙嬛嬝嬡嬥嬭嬸孁孋孌孒孖孞孨孮孯孼孽孾孿宁宄宆宊宎宐宑宓宔宖宨宩宬宭宯宱宲宷宺宼寀寁寍寏寖",4,"寠寯寱寴寽尌尗尞尟尣尦尩尫尬尮尰尲尵尶屙屚屜屢屣屧屨屩"], ["8fbba1","屭屰屴屵屺屻屼屽岇岈岊岏岒岝岟岠岢岣岦岪岲岴岵岺峉峋峒峝峗峮峱峲峴崁崆崍崒崫崣崤崦崧崱崴崹崽崿嵂嵃嵆嵈嵕嵑嵙嵊嵟嵠嵡嵢嵤嵪嵭嵰嵹嵺嵾嵿嶁嶃嶈嶊嶒嶓嶔嶕嶙嶛嶟嶠嶧嶫嶰嶴嶸嶹巃巇巋巐巎巘巙巠巤"], ["8fbca1","巩巸巹帀帇帍帒帔帕帘帟帠帮帨帲帵帾幋幐幉幑幖幘幛幜幞幨幪",4,"幰庀庋庎庢庤庥庨庪庬庱庳庽庾庿廆廌廋廎廑廒廔廕廜廞廥廫异弆弇弈弎弙弜弝弡弢弣弤弨弫弬弮弰弴弶弻弽弿彀彄彅彇彍彐彔彘彛彠彣彤彧"], ["8fbda1","彯彲彴彵彸彺彽彾徉徍徏徖徜徝徢徧徫徤徬徯徰徱徸忄忇忈忉忋忐",4,"忞忡忢忨忩忪忬忭忮忯忲忳忶忺忼怇怊怍怓怔怗怘怚怟怤怭怳怵恀恇恈恉恌恑恔恖恗恝恡恧恱恾恿悂悆悈悊悎悑悓悕悘悝悞悢悤悥您悰悱悷"], ["8fbea1","悻悾惂惄惈惉惊惋惎惏惔惕惙惛惝惞惢惥惲惵惸惼惽愂愇愊愌愐",4,"愖愗愙愜愞愢愪愫愰愱愵愶愷愹慁慅慆慉慞慠慬慲慸慻慼慿憀憁憃憄憋憍憒憓憗憘憜憝憟憠憥憨憪憭憸憹憼懀懁懂懎懏懕懜懝懞懟懡懢懧懩懥"], ["8fbfa1","懬懭懯戁戃戄戇戓戕戜戠戢戣戧戩戫戹戽扂扃扄扆扌扐扑扒扔扖扚扜扤扭扯扳扺扽抍抎抏抐抦抨抳抶抷抺抾抿拄拎拕拖拚拪拲拴拼拽挃挄挊挋挍挐挓挖挘挩挪挭挵挶挹挼捁捂捃捄捆捊捋捎捒捓捔捘捛捥捦捬捭捱捴捵"], ["8fc0a1","捸捼捽捿掂掄掇掊掐掔掕掙掚掞掤掦掭掮掯掽揁揅揈揎揑揓揔揕揜揠揥揪揬揲揳揵揸揹搉搊搐搒搔搘搞搠搢搤搥搩搪搯搰搵搽搿摋摏摑摒摓摔摚摛摜摝摟摠摡摣摭摳摴摻摽撅撇撏撐撑撘撙撛撝撟撡撣撦撨撬撳撽撾撿"], ["8fc1a1","擄擉擊擋擌擎擐擑擕擗擤擥擩擪擭擰擵擷擻擿攁攄攈攉攊攏攓攔攖攙攛攞攟攢攦攩攮攱攺攼攽敃敇敉敐敒敔敟敠敧敫敺敽斁斅斊斒斕斘斝斠斣斦斮斲斳斴斿旂旈旉旎旐旔旖旘旟旰旲旴旵旹旾旿昀昄昈昉昍昑昒昕昖昝"], ["8fc2a1","昞昡昢昣昤昦昩昪昫昬昮昰昱昳昹昷晀晅晆晊晌晑晎晗晘晙晛晜晠晡曻晪晫晬晾晳晵晿晷晸晹晻暀晼暋暌暍暐暒暙暚暛暜暟暠暤暭暱暲暵暻暿曀曂曃曈曌曎曏曔曛曟曨曫曬曮曺朅朇朎朓朙朜朠朢朳朾杅杇杈杌杔杕杝"], ["8fc3a1","杦杬杮杴杶杻极构枎枏枑枓枖枘枙枛枰枱枲枵枻枼枽柹柀柂柃柅柈柉柒柗柙柜柡柦柰柲柶柷桒栔栙栝栟栨栧栬栭栯栰栱栳栻栿桄桅桊桌桕桗桘桛桫桮",4,"桵桹桺桻桼梂梄梆梈梖梘梚梜梡梣梥梩梪梮梲梻棅棈棌棏"], ["8fc4a1","棐棑棓棖棙棜棝棥棨棪棫棬棭棰棱棵棶棻棼棽椆椉椊椐椑椓椖椗椱椳椵椸椻楂楅楉楎楗楛楣楤楥楦楨楩楬楰楱楲楺楻楿榀榍榒榖榘榡榥榦榨榫榭榯榷榸榺榼槅槈槑槖槗槢槥槮槯槱槳槵槾樀樁樃樏樑樕樚樝樠樤樨樰樲"], ["8fc5a1","樴樷樻樾樿橅橆橉橊橎橐橑橒橕橖橛橤橧橪橱橳橾檁檃檆檇檉檋檑檛檝檞檟檥檫檯檰檱檴檽檾檿櫆櫉櫈櫌櫐櫔櫕櫖櫜櫝櫤櫧櫬櫰櫱櫲櫼櫽欂欃欆欇欉欏欐欑欗欛欞欤欨欫欬欯欵欶欻欿歆歊歍歒歖歘歝歠歧歫歮歰歵歽"], ["8fc6a1","歾殂殅殗殛殟殠殢殣殨殩殬殭殮殰殸殹殽殾毃毄毉毌毖毚毡毣毦毧毮毱毷毹毿氂氄氅氉氍氎氐氒氙氟氦氧氨氬氮氳氵氶氺氻氿汊汋汍汏汒汔汙汛汜汫汭汯汴汶汸汹汻沅沆沇沉沔沕沗沘沜沟沰沲沴泂泆泍泏泐泑泒泔泖"], ["8fc7a1","泚泜泠泧泩泫泬泮泲泴洄洇洊洎洏洑洓洚洦洧洨汧洮洯洱洹洼洿浗浞浟浡浥浧浯浰浼涂涇涑涒涔涖涗涘涪涬涴涷涹涽涿淄淈淊淎淏淖淛淝淟淠淢淥淩淯淰淴淶淼渀渄渞渢渧渲渶渹渻渼湄湅湈湉湋湏湑湒湓湔湗湜湝湞"], ["8fc8a1","湢湣湨湳湻湽溍溓溙溠溧溭溮溱溳溻溿滀滁滃滇滈滊滍滎滏滫滭滮滹滻滽漄漈漊漌漍漖漘漚漛漦漩漪漯漰漳漶漻漼漭潏潑潒潓潗潙潚潝潞潡潢潨潬潽潾澃澇澈澋澌澍澐澒澓澔澖澚澟澠澥澦澧澨澮澯澰澵澶澼濅濇濈濊"], ["8fc9a1","濚濞濨濩濰濵濹濼濽瀀瀅瀆瀇瀍瀗瀠瀣瀯瀴瀷瀹瀼灃灄灈灉灊灋灔灕灝灞灎灤灥灬灮灵灶灾炁炅炆炔",4,"炛炤炫炰炱炴炷烊烑烓烔烕烖烘烜烤烺焃",4,"焋焌焏焞焠焫焭焯焰焱焸煁煅煆煇煊煋煐煒煗煚煜煞煠"], ["8fcaa1","煨煹熀熅熇熌熒熚熛熠熢熯熰熲熳熺熿燀燁燄燋燌燓燖燙燚燜燸燾爀爇爈爉爓爗爚爝爟爤爫爯爴爸爹牁牂牃牅牎牏牐牓牕牖牚牜牞牠牣牨牫牮牯牱牷牸牻牼牿犄犉犍犎犓犛犨犭犮犱犴犾狁狇狉狌狕狖狘狟狥狳狴狺狻"], ["8fcba1","狾猂猄猅猇猋猍猒猓猘猙猞猢猤猧猨猬猱猲猵猺猻猽獃獍獐獒獖獘獝獞獟獠獦獧獩獫獬獮獯獱獷獹獼玀玁玃玅玆玎玐玓玕玗玘玜玞玟玠玢玥玦玪玫玭玵玷玹玼玽玿珅珆珉珋珌珏珒珓珖珙珝珡珣珦珧珩珴珵珷珹珺珻珽"], ["8fcca1","珿琀琁琄琇琊琑琚琛琤琦琨",9,"琹瑀瑃瑄瑆瑇瑋瑍瑑瑒瑗瑝瑢瑦瑧瑨瑫瑭瑮瑱瑲璀璁璅璆璇璉璏璐璑璒璘璙璚璜璟璠璡璣璦璨璩璪璫璮璯璱璲璵璹璻璿瓈瓉瓌瓐瓓瓘瓚瓛瓞瓟瓤瓨瓪瓫瓯瓴瓺瓻瓼瓿甆"], ["8fcda1","甒甖甗甠甡甤甧甩甪甯甶甹甽甾甿畀畃畇畈畎畐畒畗畞畟畡畯畱畹",5,"疁疅疐疒疓疕疙疜疢疤疴疺疿痀痁痄痆痌痎痏痗痜痟痠痡痤痧痬痮痯痱痹瘀瘂瘃瘄瘇瘈瘊瘌瘏瘒瘓瘕瘖瘙瘛瘜瘝瘞瘣瘥瘦瘩瘭瘲瘳瘵瘸瘹"], ["8fcea1","瘺瘼癊癀癁癃癄癅癉癋癕癙癟癤癥癭癮癯癱癴皁皅皌皍皕皛皜皝皟皠皢",6,"皪皭皽盁盅盉盋盌盎盔盙盠盦盨盬盰盱盶盹盼眀眆眊眎眒眔眕眗眙眚眜眢眨眭眮眯眴眵眶眹眽眾睂睅睆睊睍睎睏睒睖睗睜睞睟睠睢"], ["8fcfa1","睤睧睪睬睰睲睳睴睺睽瞀瞄瞌瞍瞔瞕瞖瞚瞟瞢瞧瞪瞮瞯瞱瞵瞾矃矉矑矒矕矙矞矟矠矤矦矪矬矰矱矴矸矻砅砆砉砍砎砑砝砡砢砣砭砮砰砵砷硃硄硇硈硌硎硒硜硞硠硡硣硤硨硪确硺硾碊碏碔碘碡碝碞碟碤碨碬碭碰碱碲碳"], ["8fd0a1","碻碽碿磇磈磉磌磎磒磓磕磖磤磛磟磠磡磦磪磲磳礀磶磷磺磻磿礆礌礐礚礜礞礟礠礥礧礩礭礱礴礵礻礽礿祄祅祆祊祋祏祑祔祘祛祜祧祩祫祲祹祻祼祾禋禌禑禓禔禕禖禘禛禜禡禨禩禫禯禱禴禸离秂秄秇秈秊秏秔秖秚秝秞"], ["8fd1a1","秠秢秥秪秫秭秱秸秼稂稃稇稉稊稌稑稕稛稞稡稧稫稭稯稰稴稵稸稹稺穄穅穇穈穌穕穖穙穜穝穟穠穥穧穪穭穵穸穾窀窂窅窆窊窋窐窑窔窞窠窣窬窳窵窹窻窼竆竉竌竎竑竛竨竩竫竬竱竴竻竽竾笇笔笟笣笧笩笪笫笭笮笯笰"], ["8fd2a1","笱笴笽笿筀筁筇筎筕筠筤筦筩筪筭筯筲筳筷箄箉箎箐箑箖箛箞箠箥箬箯箰箲箵箶箺箻箼箽篂篅篈篊篔篖篗篙篚篛篨篪篲篴篵篸篹篺篼篾簁簂簃簄簆簉簋簌簎簏簙簛簠簥簦簨簬簱簳簴簶簹簺籆籊籕籑籒籓籙",5], ["8fd3a1","籡籣籧籩籭籮籰籲籹籼籽粆粇粏粔粞粠粦粰粶粷粺粻粼粿糄糇糈糉糍糏糓糔糕糗糙糚糝糦糩糫糵紃紇紈紉紏紑紒紓紖紝紞紣紦紪紭紱紼紽紾絀絁絇絈絍絑絓絗絙絚絜絝絥絧絪絰絸絺絻絿綁綂綃綅綆綈綋綌綍綑綖綗綝"], ["8fd4a1","綞綦綧綪綳綶綷綹緂",4,"緌緍緎緗緙縀緢緥緦緪緫緭緱緵緶緹緺縈縐縑縕縗縜縝縠縧縨縬縭縯縳縶縿繄繅繇繎繐繒繘繟繡繢繥繫繮繯繳繸繾纁纆纇纊纍纑纕纘纚纝纞缼缻缽缾缿罃罄罇罏罒罓罛罜罝罡罣罤罥罦罭"], ["8fd5a1","罱罽罾罿羀羋羍羏羐羑羖羗羜羡羢羦羪羭羴羼羿翀翃翈翎翏翛翟翣翥翨翬翮翯翲翺翽翾翿耇耈耊耍耎耏耑耓耔耖耝耞耟耠耤耦耬耮耰耴耵耷耹耺耼耾聀聄聠聤聦聭聱聵肁肈肎肜肞肦肧肫肸肹胈胍胏胒胔胕胗胘胠胭胮"], ["8fd6a1","胰胲胳胶胹胺胾脃脋脖脗脘脜脞脠脤脧脬脰脵脺脼腅腇腊腌腒腗腠腡腧腨腩腭腯腷膁膐膄膅膆膋膎膖膘膛膞膢膮膲膴膻臋臃臅臊臎臏臕臗臛臝臞臡臤臫臬臰臱臲臵臶臸臹臽臿舀舃舏舓舔舙舚舝舡舢舨舲舴舺艃艄艅艆"], ["8fd7a1","艋艎艏艑艖艜艠艣艧艭艴艻艽艿芀芁芃芄芇芉芊芎芑芔芖芘芚芛芠芡芣芤芧芨芩芪芮芰芲芴芷芺芼芾芿苆苐苕苚苠苢苤苨苪苭苯苶苷苽苾茀茁茇茈茊茋荔茛茝茞茟茡茢茬茭茮茰茳茷茺茼茽荂荃荄荇荍荎荑荕荖荗荰荸"], ["8fd8a1","荽荿莀莂莄莆莍莒莔莕莘莙莛莜莝莦莧莩莬莾莿菀菇菉菏菐菑菔菝荓菨菪菶菸菹菼萁萆萊萏萑萕萙莭萯萹葅葇葈葊葍葏葑葒葖葘葙葚葜葠葤葥葧葪葰葳葴葶葸葼葽蒁蒅蒒蒓蒕蒞蒦蒨蒩蒪蒯蒱蒴蒺蒽蒾蓀蓂蓇蓈蓌蓏蓓"], ["8fd9a1","蓜蓧蓪蓯蓰蓱蓲蓷蔲蓺蓻蓽蔂蔃蔇蔌蔎蔐蔜蔞蔢蔣蔤蔥蔧蔪蔫蔯蔳蔴蔶蔿蕆蕏",4,"蕖蕙蕜",6,"蕤蕫蕯蕹蕺蕻蕽蕿薁薅薆薉薋薌薏薓薘薝薟薠薢薥薧薴薶薷薸薼薽薾薿藂藇藊藋藎薭藘藚藟藠藦藨藭藳藶藼"], ["8fdaa1","藿蘀蘄蘅蘍蘎蘐蘑蘒蘘蘙蘛蘞蘡蘧蘩蘶蘸蘺蘼蘽虀虂虆虒虓虖虗虘虙虝虠",4,"虩虬虯虵虶虷虺蚍蚑蚖蚘蚚蚜蚡蚦蚧蚨蚭蚱蚳蚴蚵蚷蚸蚹蚿蛀蛁蛃蛅蛑蛒蛕蛗蛚蛜蛠蛣蛥蛧蚈蛺蛼蛽蜄蜅蜇蜋蜎蜏蜐蜓蜔蜙蜞蜟蜡蜣"], ["8fdba1","蜨蜮蜯蜱蜲蜹蜺蜼蜽蜾蝀蝃蝅蝍蝘蝝蝡蝤蝥蝯蝱蝲蝻螃",6,"螋螌螐螓螕螗螘螙螞螠螣螧螬螭螮螱螵螾螿蟁蟈蟉蟊蟎蟕蟖蟙蟚蟜蟟蟢蟣蟤蟪蟫蟭蟱蟳蟸蟺蟿蠁蠃蠆蠉蠊蠋蠐蠙蠒蠓蠔蠘蠚蠛蠜蠞蠟蠨蠭蠮蠰蠲蠵"], ["8fdca1","蠺蠼衁衃衅衈衉衊衋衎衑衕衖衘衚衜衟衠衤衩衱衹衻袀袘袚袛袜袟袠袨袪袺袽袾裀裊",4,"裑裒裓裛裞裧裯裰裱裵裷褁褆褍褎褏褕褖褘褙褚褜褠褦褧褨褰褱褲褵褹褺褾襀襂襅襆襉襏襒襗襚襛襜襡襢襣襫襮襰襳襵襺"], ["8fdda1","襻襼襽覉覍覐覔覕覛覜覟覠覥覰覴覵覶覷覼觔",4,"觥觩觫觭觱觳觶觹觽觿訄訅訇訏訑訒訔訕訞訠訢訤訦訫訬訯訵訷訽訾詀詃詅詇詉詍詎詓詖詗詘詜詝詡詥詧詵詶詷詹詺詻詾詿誀誃誆誋誏誐誒誖誗誙誟誧誩誮誯誳"], ["8fdea1","誶誷誻誾諃諆諈諉諊諑諓諔諕諗諝諟諬諰諴諵諶諼諿謅謆謋謑謜謞謟謊謭謰謷謼譂",4,"譈譒譓譔譙譍譞譣譭譶譸譹譼譾讁讄讅讋讍讏讔讕讜讞讟谸谹谽谾豅豇豉豋豏豑豓豔豗豘豛豝豙豣豤豦豨豩豭豳豵豶豻豾貆"], ["8fdfa1","貇貋貐貒貓貙貛貜貤貹貺賅賆賉賋賏賖賕賙賝賡賨賬賯賰賲賵賷賸賾賿贁贃贉贒贗贛赥赩赬赮赿趂趄趈趍趐趑趕趞趟趠趦趫趬趯趲趵趷趹趻跀跅跆跇跈跊跎跑跔跕跗跙跤跥跧跬跰趼跱跲跴跽踁踄踅踆踋踑踔踖踠踡踢"], ["8fe0a1","踣踦踧踱踳踶踷踸踹踽蹀蹁蹋蹍蹎蹏蹔蹛蹜蹝蹞蹡蹢蹩蹬蹭蹯蹰蹱蹹蹺蹻躂躃躉躐躒躕躚躛躝躞躢躧躩躭躮躳躵躺躻軀軁軃軄軇軏軑軔軜軨軮軰軱軷軹軺軭輀輂輇輈輏輐輖輗輘輞輠輡輣輥輧輨輬輭輮輴輵輶輷輺轀轁"], ["8fe1a1","轃轇轏轑",4,"轘轝轞轥辝辠辡辤辥辦辵辶辸达迀迁迆迊迋迍运迒迓迕迠迣迤迨迮迱迵迶迻迾适逄逈逌逘逛逨逩逯逪逬逭逳逴逷逿遃遄遌遛遝遢遦遧遬遰遴遹邅邈邋邌邎邐邕邗邘邙邛邠邡邢邥邰邲邳邴邶邽郌邾郃"], ["8fe2a1","郄郅郇郈郕郗郘郙郜郝郟郥郒郶郫郯郰郴郾郿鄀鄄鄅鄆鄈鄍鄐鄔鄖鄗鄘鄚鄜鄞鄠鄥鄢鄣鄧鄩鄮鄯鄱鄴鄶鄷鄹鄺鄼鄽酃酇酈酏酓酗酙酚酛酡酤酧酭酴酹酺酻醁醃醅醆醊醎醑醓醔醕醘醞醡醦醨醬醭醮醰醱醲醳醶醻醼醽醿"], ["8fe3a1","釂釃釅釓釔釗釙釚釞釤釥釩釪釬",5,"釷釹釻釽鈀鈁鈄鈅鈆鈇鈉鈊鈌鈐鈒鈓鈖鈘鈜鈝鈣鈤鈥鈦鈨鈮鈯鈰鈳鈵鈶鈸鈹鈺鈼鈾鉀鉂鉃鉆鉇鉊鉍鉎鉏鉑鉘鉙鉜鉝鉠鉡鉥鉧鉨鉩鉮鉯鉰鉵",4,"鉻鉼鉽鉿銈銉銊銍銎銒銗"], ["8fe4a1","銙銟銠銤銥銧銨銫銯銲銶銸銺銻銼銽銿",4,"鋅鋆鋇鋈鋋鋌鋍鋎鋐鋓鋕鋗鋘鋙鋜鋝鋟鋠鋡鋣鋥鋧鋨鋬鋮鋰鋹鋻鋿錀錂錈錍錑錔錕錜錝錞錟錡錤錥錧錩錪錳錴錶錷鍇鍈鍉鍐鍑鍒鍕鍗鍘鍚鍞鍤鍥鍧鍩鍪鍭鍯鍰鍱鍳鍴鍶"], ["8fe5a1","鍺鍽鍿鎀鎁鎂鎈鎊鎋鎍鎏鎒鎕鎘鎛鎞鎡鎣鎤鎦鎨鎫鎴鎵鎶鎺鎩鏁鏄鏅鏆鏇鏉",4,"鏓鏙鏜鏞鏟鏢鏦鏧鏹鏷鏸鏺鏻鏽鐁鐂鐄鐈鐉鐍鐎鐏鐕鐖鐗鐟鐮鐯鐱鐲鐳鐴鐻鐿鐽鑃鑅鑈鑊鑌鑕鑙鑜鑟鑡鑣鑨鑫鑭鑮鑯鑱鑲钄钃镸镹"], ["8fe6a1","镾閄閈閌閍閎閝閞閟閡閦閩閫閬閴閶閺閽閿闆闈闉闋闐闑闒闓闙闚闝闞闟闠闤闦阝阞阢阤阥阦阬阱阳阷阸阹阺阼阽陁陒陔陖陗陘陡陮陴陻陼陾陿隁隂隃隄隉隑隖隚隝隟隤隥隦隩隮隯隳隺雊雒嶲雘雚雝雞雟雩雯雱雺霂"], ["8fe7a1","霃霅霉霚霛霝霡霢霣霨霱霳靁靃靊靎靏靕靗靘靚靛靣靧靪靮靳靶靷靸靻靽靿鞀鞉鞕鞖鞗鞙鞚鞞鞟鞢鞬鞮鞱鞲鞵鞶鞸鞹鞺鞼鞾鞿韁韄韅韇韉韊韌韍韎韐韑韔韗韘韙韝韞韠韛韡韤韯韱韴韷韸韺頇頊頙頍頎頔頖頜頞頠頣頦"], ["8fe8a1","頫頮頯頰頲頳頵頥頾顄顇顊顑顒顓顖顗顙顚顢顣顥顦顪顬颫颭颮颰颴颷颸颺颻颿飂飅飈飌飡飣飥飦飧飪飳飶餂餇餈餑餕餖餗餚餛餜餟餢餦餧餫餱",4,"餹餺餻餼饀饁饆饇饈饍饎饔饘饙饛饜饞饟饠馛馝馟馦馰馱馲馵"], ["8fe9a1","馹馺馽馿駃駉駓駔駙駚駜駞駧駪駫駬駰駴駵駹駽駾騂騃騄騋騌騐騑騖騞騠騢騣騤騧騭騮騳騵騶騸驇驁驄驊驋驌驎驑驔驖驝骪骬骮骯骲骴骵骶骹骻骾骿髁髃髆髈髎髐髒髕髖髗髛髜髠髤髥髧髩髬髲髳髵髹髺髽髿",4], ["8feaa1","鬄鬅鬈鬉鬋鬌鬍鬎鬐鬒鬖鬙鬛鬜鬠鬦鬫鬭鬳鬴鬵鬷鬹鬺鬽魈魋魌魕魖魗魛魞魡魣魥魦魨魪",4,"魳魵魷魸魹魿鮀鮄鮅鮆鮇鮉鮊鮋鮍鮏鮐鮔鮚鮝鮞鮦鮧鮩鮬鮰鮱鮲鮷鮸鮻鮼鮾鮿鯁鯇鯈鯎鯐鯗鯘鯝鯟鯥鯧鯪鯫鯯鯳鯷鯸"], ["8feba1","鯹鯺鯽鯿鰀鰂鰋鰏鰑鰖鰘鰙鰚鰜鰞鰢鰣鰦",4,"鰱鰵鰶鰷鰽鱁鱃鱄鱅鱉鱊鱎鱏鱐鱓鱔鱖鱘鱛鱝鱞鱟鱣鱩鱪鱜鱫鱨鱮鱰鱲鱵鱷鱻鳦鳲鳷鳹鴋鴂鴑鴗鴘鴜鴝鴞鴯鴰鴲鴳鴴鴺鴼鵅鴽鵂鵃鵇鵊鵓鵔鵟鵣鵢鵥鵩鵪鵫鵰鵶鵷鵻"], ["8feca1","鵼鵾鶃鶄鶆鶊鶍鶎鶒鶓鶕鶖鶗鶘鶡鶪鶬鶮鶱鶵鶹鶼鶿鷃鷇鷉鷊鷔鷕鷖鷗鷚鷞鷟鷠鷥鷧鷩鷫鷮鷰鷳鷴鷾鸊鸂鸇鸎鸐鸑鸒鸕鸖鸙鸜鸝鹺鹻鹼麀麂麃麄麅麇麎麏麖麘麛麞麤麨麬麮麯麰麳麴麵黆黈黋黕黟黤黧黬黭黮黰黱黲黵"], ["8feda1","黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃",4,"齓齕齖齗齘齚齝齞齨齩齭",4,"齳齵齺齽龏龐龑龒龔龖龗龞龡龢龣龥"] ] {"uChars":[128,165,169,178,184,216,226,235,238,244,248,251,253,258,276,284,300,325,329,334,364,463,465,467,469,471,473,475,477,506,594,610,712,716,730,930,938,962,970,1026,1104,1106,8209,8215,8218,8222,8231,8241,8244,8246,8252,8365,8452,8454,8458,8471,8482,8556,8570,8596,8602,8713,8720,8722,8726,8731,8737,8740,8742,8748,8751,8760,8766,8777,8781,8787,8802,8808,8816,8854,8858,8870,8896,8979,9322,9372,9548,9588,9616,9622,9634,9652,9662,9672,9676,9680,9702,9735,9738,9793,9795,11906,11909,11913,11917,11928,11944,11947,11951,11956,11960,11964,11979,12284,12292,12312,12319,12330,12351,12436,12447,12535,12543,12586,12842,12850,12964,13200,13215,13218,13253,13263,13267,13270,13384,13428,13727,13839,13851,14617,14703,14801,14816,14964,15183,15471,15585,16471,16736,17208,17325,17330,17374,17623,17997,18018,18212,18218,18301,18318,18760,18811,18814,18820,18823,18844,18848,18872,19576,19620,19738,19887,40870,59244,59336,59367,59413,59417,59423,59431,59437,59443,59452,59460,59478,59493,63789,63866,63894,63976,63986,64016,64018,64021,64025,64034,64037,64042,65074,65093,65107,65112,65127,65132,65375,65510,65536],"gbChars":[0,36,38,45,50,81,89,95,96,100,103,104,105,109,126,133,148,172,175,179,208,306,307,308,309,310,311,312,313,341,428,443,544,545,558,741,742,749,750,805,819,820,7922,7924,7925,7927,7934,7943,7944,7945,7950,8062,8148,8149,8152,8164,8174,8236,8240,8262,8264,8374,8380,8381,8384,8388,8390,8392,8393,8394,8396,8401,8406,8416,8419,8424,8437,8439,8445,8482,8485,8496,8521,8603,8936,8946,9046,9050,9063,9066,9076,9092,9100,9108,9111,9113,9131,9162,9164,9218,9219,11329,11331,11334,11336,11346,11361,11363,11366,11370,11372,11375,11389,11682,11686,11687,11692,11694,11714,11716,11723,11725,11730,11736,11982,11989,12102,12336,12348,12350,12384,12393,12395,12397,12510,12553,12851,12962,12973,13738,13823,13919,13933,14080,14298,14585,14698,15583,15847,16318,16434,16438,16481,16729,17102,17122,17315,17320,17402,17418,17859,17909,17911,17915,17916,17936,17939,17961,18664,18703,18814,18962,19043,33469,33470,33471,33484,33485,33490,33497,33501,33505,33513,33520,33536,33550,37845,37921,37948,38029,38038,38064,38065,38066,38069,38075,38076,38078,39108,39109,39113,39114,39115,39116,39265,39394,189000]}[ ["a140","",62], ["a180","",32], ["a240","",62], ["a280","",32], ["a2ab","",5], ["a2e3","€"], ["a2ef",""], ["a2fd",""], ["a340","",62], ["a380","",31," "], ["a440","",62], ["a480","",32], ["a4f4","",10], ["a540","",62], ["a580","",32], ["a5f7","",7], ["a640","",62], ["a680","",32], ["a6b9","",7], ["a6d9","",6], ["a6ec",""], ["a6f3",""], ["a6f6","",8], ["a740","",62], ["a780","",32], ["a7c2","",14], ["a7f2","",12], ["a896","",10], ["a8bc","ḿ"], ["a8bf","ǹ"], ["a8c1",""], ["a8ea","",20], ["a958",""], ["a95b",""], ["a95d",""], ["a989","〾⿰",11], ["a997","",12], ["a9f0","",14], ["aaa1","",93], ["aba1","",93], ["aca1","",93], ["ada1","",93], ["aea1","",93], ["afa1","",93], ["d7fa","",4], ["f8a1","",93], ["f9a1","",93], ["faa1","",93], ["fba1","",93], ["fca1","",93], ["fda1","",93], ["fe50","⺁⺄㑳㑇⺈⺋㖞㘚㘎⺌⺗㥮㤘㧏㧟㩳㧐㭎㱮㳠⺧⺪䁖䅟⺮䌷⺳⺶⺷䎱䎬⺻䏝䓖䙡䙌"], ["fe80","䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶䲣䲟䲠䲡䱷䲢䴓",6,"䶮",93], ["8135f437",""] ] [ ["0","\u0000",128], ["a1","。",62], ["8140"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×"], ["8180","÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇◆□■△▲▽▼※〒→←↑↓〓"], ["81b8","∈∋⊆⊇⊂⊃∪∩"], ["81c8","∧∨¬⇒⇔∀∃"], ["81da","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"], ["81f0","ʼn♯♭♪†‡¶"], ["81fc","◯"], ["824f","0",9], ["8260","A",25], ["8281","a",25], ["829f","ぁ",82], ["8340","ァ",62], ["8380","ム",22], ["839f","Α",16,"Σ",6], ["83bf","α",16,"σ",6], ["8440","А",5,"ЁЖ",25], ["8470","а",5,"ёж",7], ["8480","о",17], ["849f","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"], ["8740","①",19,"Ⅰ",9], ["875f","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"], ["877e","㍻"], ["8780","〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"], ["889f","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"], ["8940","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円"], ["8980","園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"], ["8a40","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫"], ["8a80","橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"], ["8b40","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救"], ["8b80","朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"], ["8c40","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨"], ["8c80","劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"], ["8d40","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降"], ["8d80","項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"], ["8e40","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止"], ["8e80","死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"], ["8f40","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳"], ["8f80","準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"], ["9040","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨"], ["9080","逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"], ["9140","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻"], ["9180","操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"], ["9240","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄"], ["9280","逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"], ["9340","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬"], ["9380","凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"], ["9440","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅"], ["9480","楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"], ["9540","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷"], ["9580","斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"], ["9640","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆"], ["9680","摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"], ["9740","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲"], ["9780","沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"], ["9840","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"], ["989f","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"], ["9940","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭"], ["9980","凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"], ["9a40","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸"], ["9a80","噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"], ["9b40","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀"], ["9b80","它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"], ["9c40","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠"], ["9c80","怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"], ["9d40","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫"], ["9d80","捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"], ["9e40","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎"], ["9e80","梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"], ["9f40","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯"], ["9f80","麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"], ["e040","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝"], ["e080","烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"], ["e140","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿"], ["e180","痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"], ["e240","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰"], ["e280","窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"], ["e340","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷"], ["e380","縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"], ["e440","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤"], ["e480","艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"], ["e540","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬"], ["e580","蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"], ["e640","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧"], ["e680","諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"], ["e740","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜"], ["e780","轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"], ["e840","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙"], ["e880","閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"], ["e940","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃"], ["e980","騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"], ["ea40","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯"], ["ea80","黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠堯槇遙瑤凜熙"], ["ed40","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏"], ["ed80","塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"], ["ee40","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙"], ["ee80","蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"], ["eeef","ⅰ",9,"¬¦'""], ["f040","",62], ["f080","",124], ["f140","",62], ["f180","",124], ["f240","",62], ["f280","",124], ["f340","",62], ["f380","",124], ["f440","",62], ["f480","",124], ["f540","",62], ["f580","",124], ["f640","",62], ["f680","",124], ["f740","",62], ["f780","",124], ["f840","",62], ["f880","",124], ["f940",""], ["fa40","ⅰ",9,"Ⅰ",9,"¬¦'"㈱№℡∵纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊"], ["fa80","兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯"], ["fb40","涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神"], ["fb80","祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙"], ["fc40","髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"] ] { "name": "err-code", "version": "1.1.1", "description": "Create new error instances with a code and additional properties", "main": "index.umd.js", "homepage": "https://github.com/IndigoUnited/js-err-code", "authors": [ "IndigoUnited (http://indigounited.com)" ], "moduleType": [ "amd", "globals", "node" ], "keywords": [ "error", "err", "code", "properties", "property" ], "license": "MIT", "ignore": [ "**/.*", "node_modules", "bower_components", "test", "tests" ] } 'use strict'; function assign(obj, props) { for (const key in props) { Object.defineProperty(obj, key, { value: props[key], enumerable: true, configurable: true, }); } return obj; } function createError(err, code, props) { if (!err || typeof err === 'string') { throw new TypeError('Please pass an Error to err-code'); } if (!props) { props = {}; } if (typeof code === 'object') { props = code; code = undefined; } if (code != null) { props.code = code; } try { return assign(err, props); } catch (_) { props.message = err.message; props.stack = err.stack; const ErrClass = function () {}; ErrClass.prototype = Object.create(Object.getPrototypeOf(err)); return assign(new ErrClass(), props); } } module.exports = createError; (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.errCode = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i index.umd.js" }, "bugs": { "url": "https://github.com/IndigoUnited/js-err-code/issues/" }, "repository": { "type": "git", "url": "git://github.com/IndigoUnited/js-err-code.git" }, "keywords": [ "error", "err", "code", "properties", "property" ], "author": "IndigoUnited (http://indigounited.com)", "license": "MIT", "devDependencies": { "@satazor/eslint-config": "^3.0.0", "browserify": "^16.5.1", "eslint": "^7.2.0", "expect.js": "^0.3.1", "mocha": "^8.0.1" } } module.exports = require('constants') module.exports = require('fs').constants || require('constants') The MIT License (MIT) Copyright (c) 2018 Mathias Buus Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "fs-constants", "version": "1.0.0", "description": "Require constants across node and the browser", "main": "index.js", "browser": "browser.js", "dependencies": {}, "devDependencies": {}, "repository": { "type": "git", "url": "https://github.com/mafintosh/fs-constants.git" }, "author": "Mathias Buus (@mafintosh)", "license": "MIT", "bugs": { "url": "https://github.com/mafintosh/fs-constants/issues" }, "homepage": "https://github.com/mafintosh/fs-constants" } "use strict" var os = require("os") var hasUnicode = module.exports = function () { // Recent Win32 platforms (>XP) CAN support unicode in the console but // don't have to, and in non-english locales often use traditional local // code pages. There's no way, short of windows system calls or execing // the chcp command line program to figure this out. As such, we default // this to false and encourage your users to override it via config if // appropriate. if (os.type() == "Windows_NT") { return false } var isUTF8 = /UTF-?8$/i var ctype = process.env.LC_ALL || process.env.LC_CTYPE || process.env.LANG return isUTF8.test(ctype) } Copyright (c) 2014, Rebecca Turner Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "has-unicode", "version": "2.0.1", "description": "Try to guess if your terminal supports unicode", "main": "index.js", "scripts": { "test": "tap test/*.js" }, "repository": { "type": "git", "url": "https://github.com/iarna/has-unicode" }, "keywords": [ "unicode", "terminal" ], "files": [ "index.js" ], "author": "Rebecca Turner ", "license": "ISC", "bugs": { "url": "https://github.com/iarna/has-unicode/issues" }, "homepage": "https://github.com/iarna/has-unicode", "devDependencies": { "require-inject": "^1.3.0", "tap": "^2.3.1" } } /*! * humanize-ms - index.js * Copyright(c) 2014 dead_horse * MIT Licensed */ 'use strict'; /** * Module dependencies. */ var util = require('util'); var ms = require('ms'); module.exports = function (t) { if (typeof t === 'number') return t; var r = ms(t); if (r === undefined) { var err = new Error(util.format('humanize-ms(%j) result undefined', t)); console.warn(err.stack); } return r; }; Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "humanize-ms", "version": "1.2.1", "description": "transform humanize time to ms", "main": "index.js", "files": [ "index.js" ], "scripts": { "test": "make test" }, "keywords": [ "humanize", "ms" ], "author": { "name": "dead-horse", "email": "dead_horse@qq.com", "url": "http://deadhorse.me" }, "repository": { "type": "git", "url": "https://github.com/node-modules/humanize-ms" }, "license": "MIT", "dependencies": { "ms": "^2.0.0" }, "devDependencies": { "autod": "*", "beautify-benchmark": "~0.2.4", "benchmark": "~1.0.0", "istanbul": "*", "mocha": "*", "should": "*" } } const cache = new Map() const fs = require('fs') const { dirname, resolve } = require('path') const lstat = path => new Promise((res, rej) => fs.lstat(path, (er, st) => er ? rej(er) : res(st))) const inferOwner = path => { path = resolve(path) if (cache.has(path)) return Promise.resolve(cache.get(path)) const statThen = st => { const { uid, gid } = st cache.set(path, { uid, gid }) return { uid, gid } } const parent = dirname(path) const parentTrap = parent === path ? null : er => { return inferOwner(parent).then((owner) => { cache.set(path, owner) return owner }) } return lstat(path).then(statThen, parentTrap) } const inferOwnerSync = path => { path = resolve(path) if (cache.has(path)) return cache.get(path) const parent = dirname(path) // avoid obscuring call site by re-throwing // "catch" the error by returning from a finally, // only if we're not at the root, and the parent call works. let threw = true try { const st = fs.lstatSync(path) threw = false const { uid, gid } = st cache.set(path, { uid, gid }) return { uid, gid } } finally { if (threw && parent !== path) { const owner = inferOwnerSync(parent) cache.set(path, owner) return owner // eslint-disable-line no-unsafe-finally } } } const inflight = new Map() module.exports = path => { path = resolve(path) if (inflight.has(path)) return Promise.resolve(inflight.get(path)) const p = inferOwner(path).then(owner => { inflight.delete(path) return owner }) inflight.set(path, p) return p } module.exports.sync = inferOwnerSync module.exports.clearCache = () => { cache.clear() inflight.clear() } The ISC License Copyright (c) npm, Inc. and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "infer-owner", "version": "1.0.4", "description": "Infer the owner of a path based on the owner of its nearest existing parent", "author": "Isaac Z. Schlueter (https://izs.me)", "license": "ISC", "scripts": { "test": "tap -J test/*.js --100", "snap": "TAP_SNAPSHOT=1 tap -J test/*.js --100", "preversion": "npm test", "postversion": "npm publish", "postpublish": "git push origin --follow-tags" }, "devDependencies": { "mutate-fs": "^2.1.1", "tap": "^12.4.2" }, "main": "index.js", "repository": "https://github.com/npm/infer-owner", "publishConfig": { "access": "public" }, "files": [ "index.js" ] } 'use strict'; // We define these manually to ensure they're always copied // even if they would move up the prototype chain // https://nodejs.org/api/http.html#http_class_http_incomingmessage const knownProps = [ 'destroy', 'setTimeout', 'socket', 'headers', 'trailers', 'rawHeaders', 'statusCode', 'httpVersion', 'httpVersionMinor', 'httpVersionMajor', 'rawTrailers', 'statusMessage' ]; module.exports = (fromStream, toStream) => { const fromProps = new Set(Object.keys(fromStream).concat(knownProps)); for (const prop of fromProps) { // Don't overwrite existing properties if (prop in toStream) { continue; } toStream[prop] = typeof fromStream[prop] === 'function' ? fromStream[prop].bind(fromStream) : fromStream[prop]; } }; MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "mimic-response", "version": "1.0.1", "description": "Mimic a Node.js HTTP response stream", "license": "MIT", "repository": "sindresorhus/mimic-response", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=4" }, "scripts": { "test": "xo && ava" }, "files": [ "index.js" ], "keywords": [ "mimic", "response", "stream", "http", "https", "request", "get", "core" ], "devDependencies": { "ava": "*", "create-test-server": "^0.1.0", "pify": "^3.0.0", "xo": "*" } } const Minipass = require('minipass') class SizeError extends Error { constructor (found, expect) { super(`Bad data size: expected ${expect} bytes, but got ${found}`) this.expect = expect this.found = found this.code = 'EBADSIZE' Error.captureStackTrace(this, this.constructor) } get name () { return 'SizeError' } } class MinipassSized extends Minipass { constructor (options = {}) { super(options) if (options.objectMode) throw new TypeError(`${ this.constructor.name } streams only work with string and buffer data`) this.found = 0 this.expect = options.size if (typeof this.expect !== 'number' || this.expect > Number.MAX_SAFE_INTEGER || isNaN(this.expect) || this.expect < 0 || !isFinite(this.expect) || this.expect !== Math.floor(this.expect)) throw new Error('invalid expected size: ' + this.expect) } write (chunk, encoding, cb) { const buffer = Buffer.isBuffer(chunk) ? chunk : typeof chunk === 'string' ? Buffer.from(chunk, typeof encoding === 'string' ? encoding : 'utf8') : chunk if (!Buffer.isBuffer(buffer)) { this.emit('error', new TypeError(`${ this.constructor.name } streams only work with string and buffer data`)) return false } this.found += buffer.length if (this.found > this.expect) this.emit('error', new SizeError(this.found, this.expect)) return super.write(chunk, encoding, cb) } emit (ev, ...data) { if (ev === 'end') { if (this.found !== this.expect) this.emit('error', new SizeError(this.found, this.expect)) } return super.emit(ev, ...data) } } MinipassSized.SizeError = SizeError module.exports = MinipassSized The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "minipass-sized", "version": "1.0.3", "description": "A Minipass stream that raises an error if you get a different number of bytes than expected", "author": "Isaac Z. Schlueter (https://izs.me)", "license": "ISC", "scripts": { "test": "tap", "snap": "tap", "preversion": "npm test", "postversion": "npm publish", "postpublish": "git push origin --follow-tags" }, "tap": { "check-coverage": true }, "devDependencies": { "tap": "^14.6.4" }, "dependencies": { "minipass": "^3.0.0" }, "main": "index.js", "keywords": [ "minipass", "size", "length" ], "directories": { "test": "test" }, "repository": { "type": "git", "url": "git+https://github.com/isaacs/minipass-sized.git" }, "engines": { "node": ">=8" } } /* object-assign (c) Sindre Sorhus @license MIT */ 'use strict'; /* eslint-disable no-unused-vars */ var getOwnPropertySymbols = Object.getOwnPropertySymbols; var hasOwnProperty = Object.prototype.hasOwnProperty; var propIsEnumerable = Object.prototype.propertyIsEnumerable; function toObject(val) { if (val === null || val === undefined) { throw new TypeError('Object.assign cannot be called with null or undefined'); } return Object(val); } function shouldUseNative() { try { if (!Object.assign) { return false; } // Detect buggy property enumeration order in older V8 versions. // https://bugs.chromium.org/p/v8/issues/detail?id=4118 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers test1[5] = 'de'; if (Object.getOwnPropertyNames(test1)[0] === '5') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test2 = {}; for (var i = 0; i < 10; i++) { test2['_' + String.fromCharCode(i)] = i; } var order2 = Object.getOwnPropertyNames(test2).map(function (n) { return test2[n]; }); if (order2.join('') !== '0123456789') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test3 = {}; 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { test3[letter] = letter; }); if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') { return false; } return true; } catch (err) { // We don't expect any of the above to throw, but better to be safe. return false; } } module.exports = shouldUseNative() ? Object.assign : function (target, source) { var from; var to = toObject(target); var symbols; for (var s = 1; s < arguments.length; s++) { from = Object(arguments[s]); for (var key in from) { if (hasOwnProperty.call(from, key)) { to[key] = from[key]; } } if (getOwnPropertySymbols) { symbols = getOwnPropertySymbols(from); for (var i = 0; i < symbols.length; i++) { if (propIsEnumerable.call(from, symbols[i])) { to[symbols[i]] = from[symbols[i]]; } } } } return to; }; The MIT License (MIT) Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "object-assign", "version": "4.1.1", "description": "ES2015 `Object.assign()` ponyfill", "license": "MIT", "repository": "sindresorhus/object-assign", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=0.10.0" }, "scripts": { "test": "xo && ava", "bench": "matcha bench.js" }, "files": [ "index.js" ], "keywords": [ "object", "assign", "extend", "properties", "es2015", "ecmascript", "harmony", "ponyfill", "prollyfill", "polyfill", "shim", "browser" ], "devDependencies": { "ava": "^0.16.0", "lodash": "^4.16.4", "matcha": "^0.7.0", "xo": "^0.16.0" } } 'use strict'; const AggregateError = require('aggregate-error'); module.exports = async ( iterable, mapper, { concurrency = Infinity, stopOnError = true } = {} ) => { return new Promise((resolve, reject) => { if (typeof mapper !== 'function') { throw new TypeError('Mapper function is required'); } if (!((Number.isSafeInteger(concurrency) || concurrency === Infinity) && concurrency >= 1)) { throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`); } const result = []; const errors = []; const iterator = iterable[Symbol.iterator](); let isRejected = false; let isIterableDone = false; let resolvingCount = 0; let currentIndex = 0; const next = () => { if (isRejected) { return; } const nextItem = iterator.next(); const index = currentIndex; currentIndex++; if (nextItem.done) { isIterableDone = true; if (resolvingCount === 0) { if (!stopOnError && errors.length !== 0) { reject(new AggregateError(errors)); } else { resolve(result); } } return; } resolvingCount++; (async () => { try { const element = await nextItem.value; result[index] = await mapper(element, index); resolvingCount--; next(); } catch (error) { if (stopOnError) { isRejected = true; reject(error); } else { errors.push(error); resolvingCount--; next(); } } })(); }; for (let i = 0; i < concurrency; i++) { next(); if (isIterableDone) { break; } } }); }; MIT License Copyright (c) Sindre Sorhus (https://sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "p-map", "version": "4.0.0", "description": "Map over promises concurrently", "license": "MIT", "repository": "sindresorhus/p-map", "funding": "https://github.com/sponsors/sindresorhus", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "https://sindresorhus.com" }, "engines": { "node": ">=10" }, "scripts": { "test": "xo && ava && tsd" }, "files": [ "index.js", "index.d.ts" ], "keywords": [ "promise", "map", "resolved", "wait", "collection", "iterable", "iterator", "race", "fulfilled", "async", "await", "promises", "concurrently", "concurrency", "parallel", "bluebird" ], "dependencies": { "aggregate-error": "^3.0.0" }, "devDependencies": { "ava": "^2.2.0", "delay": "^4.1.0", "in-range": "^2.0.0", "random-int": "^2.0.0", "time-span": "^3.1.0", "tsd": "^0.7.4", "xo": "^0.27.2" } } 'use strict' module.exports = inflight let Bluebird try { Bluebird = require('bluebird') } catch (_) { Bluebird = Promise } const active = {} inflight.active = active function inflight (unique, doFly) { return Bluebird.all([unique, doFly]).then(function (args) { const unique = args[0] const doFly = args[1] if (Array.isArray(unique)) { return Bluebird.all(unique).then(function (uniqueArr) { return _inflight(uniqueArr.join(''), doFly) }) } else { return _inflight(unique, doFly) } }) function _inflight (unique, doFly) { if (!active[unique]) { active[unique] = (new Bluebird(function (resolve) { return resolve(doFly()) })) active[unique].then(cleanup, cleanup) function cleanup() { delete active[unique] } } return active[unique] } } Copyright (c) 2017, Rebecca Turner Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "promise-inflight", "version": "1.0.1", "description": "One promise for multiple requests in flight to avoid async duplication", "main": "inflight.js", "files": [ "inflight.js" ], "license": "ISC", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], "author": "Rebecca Turner (http://re-becca.org/)", "devDependencies": {}, "repository": { "type": "git", "url": "git+https://github.com/iarna/promise-inflight.git" }, "bugs": { "url": "https://github.com/iarna/promise-inflight/issues" }, "homepage": "https://github.com/iarna/promise-inflight#readme" } GIF89a1  $ )()),)1011419899<9A@AADAJHJJLJRPRRURZYZZ]Zbabbebjijjmjsqssus{y{{}{,1pH,Ȥrl:ШtJZجxˀ(xL.gan <51zD/w< 5[:,R6C3o&H>1 - %> 8I7v24J š!Hڄ (http://debuggable.com/)", "name": "retry", "description": "Abstraction for exponential and custom retry strategies for failed operations.", "license": "MIT", "version": "0.12.0", "homepage": "https://github.com/tim-kos/node-retry", "repository": { "type": "git", "url": "git://github.com/tim-kos/node-retry.git" }, "directories": { "lib": "./lib" }, "main": "index", "engines": { "node": ">= 4" }, "dependencies": {}, "devDependencies": { "fake": "0.2.0", "istanbul": "^0.4.5", "tape": "^4.8.0" }, "scripts": { "test": "./node_modules/.bin/istanbul cover ./node_modules/tape/bin/tape ./test/integration/*.js", "release:major": "env SEMANTIC=major npm run release", "release:minor": "env SEMANTIC=minor npm run release", "release:patch": "env SEMANTIC=patch npm run release", "release": "npm version ${SEMANTIC:-patch} -m \"Release %s\" && git push && git push --tags && npm publish" } } var RetryOperation = require('./retry_operation'); exports.operation = function(options) { var timeouts = exports.timeouts(options); return new RetryOperation(timeouts, { forever: options && options.forever, unref: options && options.unref, maxRetryTime: options && options.maxRetryTime }); }; exports.timeouts = function(options) { if (options instanceof Array) { return [].concat(options); } var opts = { retries: 10, factor: 2, minTimeout: 1 * 1000, maxTimeout: Infinity, randomize: false }; for (var key in options) { opts[key] = options[key]; } if (opts.minTimeout > opts.maxTimeout) { throw new Error('minTimeout is greater than maxTimeout'); } var timeouts = []; for (var i = 0; i < opts.retries; i++) { timeouts.push(this.createTimeout(i, opts)); } if (options && options.forever && !timeouts.length) { timeouts.push(this.createTimeout(i, opts)); } // sort the array numerically ascending timeouts.sort(function(a,b) { return a - b; }); return timeouts; }; exports.createTimeout = function(attempt, opts) { var random = (opts.randomize) ? (Math.random() + 1) : 1; var timeout = Math.round(random * opts.minTimeout * Math.pow(opts.factor, attempt)); timeout = Math.min(timeout, opts.maxTimeout); return timeout; }; exports.wrap = function(obj, options, methods) { if (options instanceof Array) { methods = options; options = null; } if (!methods) { methods = []; for (var key in obj) { if (typeof obj[key] === 'function') { methods.push(key); } } } for (var i = 0; i < methods.length; i++) { var method = methods[i]; var original = obj[method]; obj[method] = function retryWrapper(original) { var op = exports.operation(options); var args = Array.prototype.slice.call(arguments, 1); var callback = args.pop(); args.push(function(err) { if (op.retry(err)) { return; } if (err) { arguments[0] = op.mainError(); } callback.apply(this, arguments); }); op.attempt(function() { original.apply(obj, args); }); }.bind(obj, original); obj[method].options = options; } }; function RetryOperation(timeouts, options) { // Compatibility for the old (timeouts, retryForever) signature if (typeof options === 'boolean') { options = { forever: options }; } this._originalTimeouts = JSON.parse(JSON.stringify(timeouts)); this._timeouts = timeouts; this._options = options || {}; this._maxRetryTime = options && options.maxRetryTime || Infinity; this._fn = null; this._errors = []; this._attempts = 1; this._operationTimeout = null; this._operationTimeoutCb = null; this._timeout = null; this._operationStart = null; if (this._options.forever) { this._cachedTimeouts = this._timeouts.slice(0); } } module.exports = RetryOperation; RetryOperation.prototype.reset = function() { this._attempts = 1; this._timeouts = this._originalTimeouts; } RetryOperation.prototype.stop = function() { if (this._timeout) { clearTimeout(this._timeout); } this._timeouts = []; this._cachedTimeouts = null; }; RetryOperation.prototype.retry = function(err) { if (this._timeout) { clearTimeout(this._timeout); } if (!err) { return false; } var currentTime = new Date().getTime(); if (err && currentTime - this._operationStart >= this._maxRetryTime) { this._errors.unshift(new Error('RetryOperation timeout occurred')); return false; } this._errors.push(err); var timeout = this._timeouts.shift(); if (timeout === undefined) { if (this._cachedTimeouts) { // retry forever, only keep last error this._errors.splice(this._errors.length - 1, this._errors.length); this._timeouts = this._cachedTimeouts.slice(0); timeout = this._timeouts.shift(); } else { return false; } } var self = this; var timer = setTimeout(function() { self._attempts++; if (self._operationTimeoutCb) { self._timeout = setTimeout(function() { self._operationTimeoutCb(self._attempts); }, self._operationTimeout); if (self._options.unref) { self._timeout.unref(); } } self._fn(self._attempts); }, timeout); if (this._options.unref) { timer.unref(); } return true; }; RetryOperation.prototype.attempt = function(fn, timeoutOps) { this._fn = fn; if (timeoutOps) { if (timeoutOps.timeout) { this._operationTimeout = timeoutOps.timeout; } if (timeoutOps.cb) { this._operationTimeoutCb = timeoutOps.cb; } } var self = this; if (this._operationTimeoutCb) { this._timeout = setTimeout(function() { self._operationTimeoutCb(); }, self._operationTimeout); } this._operationStart = new Date().getTime(); this._fn(this._attempts); }; RetryOperation.prototype.try = function(fn) { console.log('Using RetryOperation.try() is deprecated'); this.attempt(fn); }; RetryOperation.prototype.start = function(fn) { console.log('Using RetryOperation.start() is deprecated'); this.attempt(fn); }; RetryOperation.prototype.start = RetryOperation.prototype.try; RetryOperation.prototype.errors = function() { return this._errors; }; RetryOperation.prototype.attempts = function() { return this._attempts; }; RetryOperation.prototype.mainError = function() { if (this._errors.length === 0) { return null; } var counts = {}; var mainError = null; var mainErrorCount = 0; for (var i = 0; i < this._errors.length; i++) { var error = this._errors[i]; var message = error.message; var count = (counts[message] || 0) + 1; counts[message] = count; if (count >= mainErrorCount) { mainError = error; mainErrorCount = count; } } return mainError; }; // Note: since nyc uses this module to output coverage, any lines // that are in the direct sync flow of nyc's outputCoverage are // ignored, since we can never get coverage for them. var assert = require('assert') var signals = require('./signals.js') var isWin = /^win/i.test(process.platform) var EE = require('events') /* istanbul ignore if */ if (typeof EE !== 'function') { EE = EE.EventEmitter } var emitter if (process.__signal_exit_emitter__) { emitter = process.__signal_exit_emitter__ } else { emitter = process.__signal_exit_emitter__ = new EE() emitter.count = 0 emitter.emitted = {} } // Because this emitter is a global, we have to check to see if a // previous version of this library failed to enable infinite listeners. // I know what you're about to say. But literally everything about // signal-exit is a compromise with evil. Get used to it. if (!emitter.infinite) { emitter.setMaxListeners(Infinity) emitter.infinite = true } module.exports = function (cb, opts) { assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler') if (loaded === false) { load() } var ev = 'exit' if (opts && opts.alwaysLast) { ev = 'afterexit' } var remove = function () { emitter.removeListener(ev, cb) if (emitter.listeners('exit').length === 0 && emitter.listeners('afterexit').length === 0) { unload() } } emitter.on(ev, cb) return remove } module.exports.unload = unload function unload () { if (!loaded) { return } loaded = false signals.forEach(function (sig) { try { process.removeListener(sig, sigListeners[sig]) } catch (er) {} }) process.emit = originalProcessEmit process.reallyExit = originalProcessReallyExit emitter.count -= 1 } function emit (event, code, signal) { if (emitter.emitted[event]) { return } emitter.emitted[event] = true emitter.emit(event, code, signal) } // { : , ... } var sigListeners = {} signals.forEach(function (sig) { sigListeners[sig] = function listener () { // If there are no other listeners, an exit is coming! // Simplest way: remove us and then re-send the signal. // We know that this will kill the process, so we can // safely emit now. var listeners = process.listeners(sig) if (listeners.length === emitter.count) { unload() emit('exit', null, sig) /* istanbul ignore next */ emit('afterexit', null, sig) /* istanbul ignore next */ if (isWin && sig === 'SIGHUP') { // "SIGHUP" throws an `ENOSYS` error on Windows, // so use a supported signal instead sig = 'SIGINT' } process.kill(process.pid, sig) } } }) module.exports.signals = function () { return signals } module.exports.load = load var loaded = false function load () { if (loaded) { return } loaded = true // This is the number of onSignalExit's that are in play. // It's important so that we can count the correct number of // listeners on signals, and don't wait for the other one to // handle it instead of us. emitter.count += 1 signals = signals.filter(function (sig) { try { process.on(sig, sigListeners[sig]) return true } catch (er) { return false } }) process.emit = processEmit process.reallyExit = processReallyExit } var originalProcessReallyExit = process.reallyExit function processReallyExit (code) { process.exitCode = code || 0 emit('exit', process.exitCode, null) /* istanbul ignore next */ emit('afterexit', process.exitCode, null) /* istanbul ignore next */ originalProcessReallyExit.call(process, process.exitCode) } var originalProcessEmit = process.emit function processEmit (ev, arg) { if (ev === 'exit') { if (arg !== undefined) { process.exitCode = arg } var ret = originalProcessEmit.apply(this, arguments) emit('exit', process.exitCode, null) /* istanbul ignore next */ emit('afterexit', process.exitCode, null) return ret } else { return originalProcessEmit.apply(this, arguments) } } The ISC License Copyright (c) 2015, Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "signal-exit", "version": "3.0.3", "description": "when you want to fire an event no matter how a process exits.", "main": "index.js", "scripts": { "pretest": "standard", "test": "tap --timeout=240 ./test/*.js --cov", "coverage": "nyc report --reporter=text-lcov | coveralls", "release": "standard-version" }, "files": [ "index.js", "signals.js" ], "repository": { "type": "git", "url": "https://github.com/tapjs/signal-exit.git" }, "keywords": [ "signal", "exit" ], "author": "Ben Coe ", "license": "ISC", "bugs": { "url": "https://github.com/tapjs/signal-exit/issues" }, "homepage": "https://github.com/tapjs/signal-exit", "devDependencies": { "chai": "^3.5.0", "coveralls": "^2.11.10", "nyc": "^8.1.0", "standard": "^8.1.0", "standard-version": "^2.3.0", "tap": "^8.0.1" } } // This is not the set of all possible signals. // // It IS, however, the set of all signals that trigger // an exit on either Linux or BSD systems. Linux is a // superset of the signal names supported on BSD, and // the unknown signals just fail to register, so we can // catch that easily enough. // // Don't bother with SIGKILL. It's uncatchable, which // means that we can't fire any callbacks anyway. // // If a user does happen to register a handler on a non- // fatal signal like SIGWINCH or something, and then // exit, it'll end up firing `process.emit('exit')`, so // the handler will be fired anyway. // // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised // artificially, inherently leave the process in a // state from which it is not safe to try and enter JS // listeners. module.exports = [ 'SIGABRT', 'SIGALRM', 'SIGHUP', 'SIGINT', 'SIGTERM' ] if (process.platform !== 'win32') { module.exports.push( 'SIGVTALRM', 'SIGXCPU', 'SIGXFSZ', 'SIGUSR2', 'SIGTRAP', 'SIGSYS', 'SIGQUIT', 'SIGIOT' // should detect profiler and enable/disable accordingly. // see #21 // 'SIGPROF' ) } if (process.platform === 'linux') { module.exports.push( 'SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT', 'SIGUNUSED' ) } 'use strict' var path = require('path') var uniqueSlug = require('unique-slug') module.exports = function (filepath, prefix, uniq) { return path.join(filepath, (prefix ? prefix + '-' : '') + uniqueSlug(uniq)) } Copyright npm, Inc Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "unique-filename", "version": "1.1.1", "description": "Generate a unique filename for use in temporary directories or caches.", "main": "index.js", "scripts": { "test": "standard && tap test" }, "repository": { "type": "git", "url": "https://github.com/iarna/unique-filename.git" }, "keywords": [], "author": "Rebecca Turner (http://re-becca.org/)", "license": "ISC", "bugs": { "url": "https://github.com/iarna/unique-filename/issues" }, "homepage": "https://github.com/iarna/unique-filename", "devDependencies": { "standard": "^5.4.1", "tap": "^2.3.1" }, "dependencies": { "unique-slug": "^2.0.0" } } body, html { margin:0; padding: 0; } body { font-family: Helvetica Neue, Helvetica,Arial; font-size: 10pt; } div.header, div.footer { background: #eee; padding: 1em; } div.header { z-index: 100; position: fixed; top: 0; border-bottom: 1px solid #666; width: 100%; } div.footer { border-top: 1px solid #666; } div.body { margin-top: 10em; } div.meta { font-size: 90%; text-align: center; } h1, h2, h3 { font-weight: normal; } h1 { font-size: 12pt; } h2 { font-size: 10pt; } pre { font-family: Consolas, Menlo, Monaco, monospace; margin: 0; padding: 0; line-height: 1.3; font-size: 14px; -moz-tab-size: 2; -o-tab-size: 2; tab-size: 2; } div.path { font-size: 110%; } div.path a:link, div.path a:visited { color: #000; } table.coverage { border-collapse: collapse; margin:0; padding: 0 } table.coverage td { margin: 0; padding: 0; color: #111; vertical-align: top; } table.coverage td.line-count { width: 50px; text-align: right; padding-right: 5px; } table.coverage td.line-coverage { color: #777 !important; text-align: right; border-left: 1px solid #666; border-right: 1px solid #666; } table.coverage td.text { } table.coverage td span.cline-any { display: inline-block; padding: 0 5px; width: 40px; } table.coverage td span.cline-neutral { background: #eee; } table.coverage td span.cline-yes { background: #b5d592; color: #999; } table.coverage td span.cline-no { background: #fc8c84; } .cstat-yes { color: #111; } .cstat-no { background: #fc8c84; color: #111; } .fstat-no { background: #ffc520; color: #111 !important; } .cbranch-no { background: yellow !important; color: #111; } .cstat-skip { background: #ddd; color: #111; } .fstat-skip { background: #ddd; color: #111 !important; } .cbranch-skip { background: #ddd !important; color: #111; } .missing-if-branch { display: inline-block; margin-right: 10px; position: relative; padding: 0 4px; background: black; color: yellow; } .skip-if-branch { display: none; margin-right: 10px; position: relative; padding: 0 4px; background: #ccc; color: white; } .missing-if-branch .typ, .skip-if-branch .typ { color: inherit !important; } .entity, .metric { font-weight: bold; } .metric { display: inline-block; border: 1px solid #333; padding: 0.3em; background: white; } .metric small { font-size: 80%; font-weight: normal; color: #666; } div.coverage-summary table { border-collapse: collapse; margin: 3em; font-size: 110%; } div.coverage-summary td, div.coverage-summary table th { margin: 0; padding: 0.25em 1em; border-top: 1px solid #666; border-bottom: 1px solid #666; } div.coverage-summary th { text-align: left; border: 1px solid #666; background: #eee; font-weight: normal; } div.coverage-summary th.file { border-right: none !important; } div.coverage-summary th.pic { border-left: none !important; text-align: right; } div.coverage-summary th.pct { border-right: none !important; } div.coverage-summary th.abs { border-left: none !important; text-align: right; } div.coverage-summary td.pct { text-align: right; border-left: 1px solid #666; } div.coverage-summary td.abs { text-align: right; font-size: 90%; color: #444; border-right: 1px solid #666; } div.coverage-summary td.file { border-left: 1px solid #666; white-space: nowrap; } div.coverage-summary td.pic { min-width: 120px !important; } div.coverage-summary a:link { text-decoration: none; color: #000; } div.coverage-summary a:visited { text-decoration: none; color: #777; } div.coverage-summary a:hover { text-decoration: underline; } div.coverage-summary tfoot td { border-top: 1px solid #666; } div.coverage-summary .sorter { height: 10px; width: 7px; display: inline-block; margin-left: 0.5em; background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; } div.coverage-summary .sorted .sorter { background-position: 0 -20px; } div.coverage-summary .sorted-desc .sorter { background-position: 0 -10px; } .high { background: #b5d592 !important; } .medium { background: #ffe87c !important; } .low { background: #fc8c84 !important; } span.cover-fill, span.cover-empty { display:inline-block; border:1px solid #444; background: white; height: 12px; } span.cover-fill { background: #ccc; border-right: 1px solid #444; } span.cover-empty { background: white; border-left: none; } span.cover-full { border-right: none !important; } pre.prettyprint { border: none !important; padding: 0 !important; margin: 0 !important; } .com { color: #999 !important; } .ignore-none { color: #999; font-weight: normal; } Code coverage report for All files

Code coverage report for All files

Statements: 100% (4 / 4)      Branches: 100% (2 / 2)      Functions: 100% (1 / 1)      Lines: 100% (4 / 4)      Ignored: none     

File Statements Branches Functions Lines
__root__/ 100% (4 / 4) 100% (2 / 2) 100% (1 / 1) 100% (4 / 4)
.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); PNG  IHDRF3tEXtSoftwareAdobe ImageReadyqe<sIDATxڼRA De[ HfFX gf3Dd Fw-˘ ngM+OVں=""/ĥ'Y?HhV @pY8Bwc,IENDB`var addSorting = (function () { "use strict"; var cols, currentSort = { index: 0, desc: false }; // returns the summary table element function getTable() { return document.querySelector('.coverage-summary table'); } // returns the thead element of the summary table function getTableHeader() { return getTable().querySelector('thead tr'); } // returns the tbody element of the summary table function getTableBody() { return getTable().querySelector('tbody'); } // returns the th element for nth column function getNthColumn(n) { return getTableHeader().querySelectorAll('th')[n]; } // loads all columns function loadColumns() { var colNodes = getTableHeader().querySelectorAll('th'), colNode, cols = [], col, i; for (i = 0; i < colNodes.length; i += 1) { colNode = colNodes[i]; col = { key: colNode.getAttribute('data-col'), sortable: !colNode.getAttribute('data-nosort'), type: colNode.getAttribute('data-type') || 'string' }; cols.push(col); if (col.sortable) { col.defaultDescSort = col.type === 'number'; colNode.innerHTML = colNode.innerHTML + ''; } } return cols; } // attaches a data attribute to every tr element with an object // of data values keyed by column name function loadRowData(tableRow) { var tableCols = tableRow.querySelectorAll('td'), colNode, col, data = {}, i, val; for (i = 0; i < tableCols.length; i += 1) { colNode = tableCols[i]; col = cols[i]; val = colNode.getAttribute('data-value'); if (col.type === 'number') { val = Number(val); } data[col.key] = val; } return data; } // loads all row data function loadData() { var rows = getTableBody().querySelectorAll('tr'), i; for (i = 0; i < rows.length; i += 1) { rows[i].data = loadRowData(rows[i]); } } // sorts the table using the data for the ith column function sortByIndex(index, desc) { var key = cols[index].key, sorter = function (a, b) { a = a.data[key]; b = b.data[key]; return a < b ? -1 : a > b ? 1 : 0; }, finalSorter = sorter, tableBody = document.querySelector('.coverage-summary tbody'), rowNodes = tableBody.querySelectorAll('tr'), rows = [], i; if (desc) { finalSorter = function (a, b) { return -1 * sorter(a, b); }; } for (i = 0; i < rowNodes.length; i += 1) { rows.push(rowNodes[i]); tableBody.removeChild(rowNodes[i]); } rows.sort(finalSorter); for (i = 0; i < rows.length; i += 1) { tableBody.appendChild(rows[i]); } } // removes sort indicators for current column being sorted function removeSortIndicators() { var col = getNthColumn(currentSort.index), cls = col.className; cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); col.className = cls; } // adds sort indicators for current column being sorted function addSortIndicators() { getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted'; } // adds event listeners for all sorter widgets function enableUI() { var i, el, ithSorter = function ithSorter(i) { var col = cols[i]; return function () { var desc = col.defaultDescSort; if (currentSort.index === i) { desc = !currentSort.desc; } sortByIndex(i, desc); removeSortIndicators(); currentSort.index = i; currentSort.desc = desc; addSortIndicators(); }; }; for (i =0 ; i < cols.length; i += 1) { if (cols[i].sortable) { el = getNthColumn(i).querySelector('.sorter'); if (el.addEventListener) { el.addEventListener('click', ithSorter(i)); } else { el.attachEvent('onclick', ithSorter(i)); } } } } // adds sorting functionality to the UI return function () { if (!getTable()) { return; } cols = loadColumns(); loadData(cols); addSortIndicators(); enableUI(); }; })(); window.addEventListener('load', addSorting); Code coverage report for __root__/

Code coverage report for __root__/

Statements: 100% (4 / 4)      Branches: 100% (2 / 2)      Functions: 100% (1 / 1)      Lines: 100% (4 / 4)      Ignored: none     

All files » __root__/
File Statements Branches Functions Lines
index.js 100% (4 / 4) 100% (2 / 2) 100% (1 / 1) 100% (4 / 4)
Code coverage report for index.js

Code coverage report for index.js

Statements: 100% (4 / 4)      Branches: 100% (2 / 2)      Functions: 100% (1 / 1)      Lines: 100% (4 / 4)      Ignored: none     

All files » __root__/ » index.js
1 2 3 4 5 6 7 8 9  1   1   1 6    
'use strict'
var path = require('path')
 
var uniqueSlug = require('unique-slug')
 
module.exports = function (filepath, prefix, uniq) {
  return path.join(filepath, (prefix ? prefix + '-' : '') + uniqueSlug(uniq))
}
 
'use strict' var stringWidth = require('string-width') exports.center = alignCenter exports.left = alignLeft exports.right = alignRight // lodash's way of generating pad characters. function createPadding (width) { var result = '' var string = ' ' var n = width do { if (n % 2) { result += string; } n = Math.floor(n / 2); string += string; } while (n); return result; } function alignLeft (str, width) { var trimmed = str.trimRight() if (trimmed.length === 0 && str.length >= width) return str var padding = '' var strWidth = stringWidth(trimmed) if (strWidth < width) { padding = createPadding(width - strWidth) } return trimmed + padding } function alignRight (str, width) { var trimmed = str.trimLeft() if (trimmed.length === 0 && str.length >= width) return str var padding = '' var strWidth = stringWidth(trimmed) if (strWidth < width) { padding = createPadding(width - strWidth) } return padding + trimmed } function alignCenter (str, width) { var trimmed = str.trim() if (trimmed.length === 0 && str.length >= width) return str var padLeft = '' var padRight = '' var strWidth = stringWidth(trimmed) if (strWidth < width) { var padLeftBy = parseInt((width - strWidth) / 2, 10) padLeft = createPadding(padLeftBy) padRight = createPadding(width - (strWidth + padLeftBy)) } return padLeft + trimmed + padRight } Copyright (c) 2015, Rebecca Turner Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "wide-align", "version": "1.1.3", "description": "A wide-character aware text alignment function for use on the console or with fixed width fonts.", "main": "align.js", "scripts": { "test": "tap --coverage test/*.js", "version": "perl -pi -e 's/^( \"version\": $ENV{npm_config_node_version}\").*?\",/$1abc\",/' package-lock.json ; git add package-lock.json" }, "keywords": [ "wide", "double", "unicode", "cjkv", "pad", "align" ], "author": "Rebecca Turner (http://re-becca.org/)", "license": "ISC", "repository": { "type": "git", "url": "https://github.com/iarna/wide-align" }, "dependencies": { "string-width": "^1.0.2 || 2" }, "devDependencies": { "tap": "10 || 11 || 12" }, "files": [ "align.js" ] } 'use strict'; module.exports = () => { const pattern = [ '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)', '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))' ].join('|'); return new RegExp(pattern, 'g'); }; MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "ansi-regex", "version": "3.0.0", "description": "Regular expression for matching ANSI escape codes", "license": "MIT", "repository": "chalk/ansi-regex", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=4" }, "scripts": { "test": "xo && ava", "view-supported": "node fixtures/view-codes.js" }, "files": [ "index.js" ], "keywords": [ "ansi", "styles", "color", "colour", "colors", "terminal", "console", "cli", "string", "tty", "escape", "formatting", "rgb", "256", "shell", "xterm", "command-line", "text", "regex", "regexp", "re", "match", "test", "find", "pattern" ], "devDependencies": { "ava": "*", "xo": "*" } } 'use strict'; const stripAnsi = require('strip-ansi'); const isFullwidthCodePoint = require('is-fullwidth-code-point'); module.exports = str => { if (typeof str !== 'string' || str.length === 0) { return 0; } str = stripAnsi(str); let width = 0; for (let i = 0; i < str.length; i++) { const code = str.codePointAt(i); // Ignore control characters if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) { continue; } // Ignore combining characters if (code >= 0x300 && code <= 0x36F) { continue; } // Surrogates if (code > 0xFFFF) { i++; } width += isFullwidthCodePoint(code) ? 2 : 1; } return width; }; MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "string-width", "version": "2.1.1", "description": "Get the visual width of a string - the number of columns required to display it", "license": "MIT", "repository": "sindresorhus/string-width", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=4" }, "scripts": { "test": "xo && ava" }, "files": [ "index.js" ], "keywords": [ "string", "str", "character", "char", "unicode", "width", "visual", "column", "columns", "fullwidth", "full-width", "full", "ansi", "escape", "codes", "cli", "command-line", "terminal", "console", "cjk", "chinese", "japanese", "korean", "fixed-width" ], "dependencies": { "is-fullwidth-code-point": "^2.0.0", "strip-ansi": "^4.0.0" }, "devDependencies": { "ava": "*", "xo": "*" } } 'use strict'; const ansiRegex = require('ansi-regex'); module.exports = input => typeof input === 'string' ? input.replace(ansiRegex(), '') : input; MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "strip-ansi", "version": "4.0.0", "description": "Strip ANSI escape codes", "license": "MIT", "repository": "chalk/strip-ansi", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=4" }, "scripts": { "test": "xo && ava" }, "files": [ "index.js" ], "keywords": [ "strip", "trim", "remove", "ansi", "styles", "color", "colour", "colors", "terminal", "console", "string", "tty", "escape", "formatting", "rgb", "256", "shell", "xterm", "log", "logging", "command-line", "text" ], "dependencies": { "ansi-regex": "^3.0.0" }, "devDependencies": { "ava": "*", "xo": "*" } } The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "wrappy", "version": "1.0.2", "description": "Callback wrapping utility", "main": "wrappy.js", "files": [ "wrappy.js" ], "directories": { "test": "test" }, "dependencies": {}, "devDependencies": { "tap": "^2.3.1" }, "scripts": { "test": "tap --coverage test/*.js" }, "repository": { "type": "git", "url": "https://github.com/npm/wrappy" }, "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "license": "ISC", "bugs": { "url": "https://github.com/npm/wrappy/issues" }, "homepage": "https://github.com/npm/wrappy" } // Returns a wrapper function that returns a wrapped callback // The wrapper function should do some stuff, and return a // presumably different callback function. // This makes sure that own properties are retained, so that // decorations and such are not lost along the way. module.exports = wrappy function wrappy (fn, cb) { if (fn && cb) return wrappy(fn)(cb) if (typeof fn !== 'function') throw new TypeError('need wrapper function') Object.keys(fn).forEach(function (k) { wrapper[k] = fn[k] }) return wrapper function wrapper() { var args = new Array(arguments.length) for (var i = 0; i < args.length; i++) { args[i] = arguments[i] } var ret = fn.apply(this, args) var cb = args[args.length-1] if (typeof ret === 'function' && ret !== cb) { Object.keys(cb).forEach(function (k) { ret[k] = cb[k] }) } return ret } } 'use strict' const { promisify } = require('util') const handler = { get: function (target, prop, receiver) { if (typeof target[prop] !== 'function') { return target[prop] } if (target[prop][promisify.custom]) { return function () { return Reflect.get(target, prop, receiver)[promisify.custom].apply(target, arguments) } } return function () { return new Promise((resolve, reject) => { Reflect.get(target, prop, receiver).apply(target, [...arguments, function (err, result) { if (err) { return reject(err) } resolve(result) }]) }) } } } module.exports = function (thingToPromisify) { if (typeof thingToPromisify === 'function') { return promisify(thingToPromisify) } if (typeof thingToPromisify === 'object') { return new Proxy(thingToPromisify, handler) } throw new TypeError('Can only promisify functions or objects') } The MIT License (MIT) Copyright © 2020-2022 Michael Garvin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "@gar/promisify", "version": "1.1.3", "description": "Promisify an entire class or object", "main": "index.js", "repository": { "type": "git", "url": "https://github.com/wraithgar/gar-promisify.git" }, "scripts": { "lint": "standard", "lint:fix": "standard --fix", "test": "lab -a @hapi/code -t 100", "posttest": "npm run lint" }, "files": [ "index.js" ], "keywords": [ "promisify", "all", "class", "object" ], "author": "Gar ", "license": "MIT", "devDependencies": { "@hapi/code": "^8.0.1", "@hapi/lab": "^24.1.0", "standard": "^16.0.3" } } 'use strict'; const indentString = require('indent-string'); const cleanStack = require('clean-stack'); const cleanInternalStack = stack => stack.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g, ''); class AggregateError extends Error { constructor(errors) { if (!Array.isArray(errors)) { throw new TypeError(`Expected input to be an Array, got ${typeof errors}`); } errors = [...errors].map(error => { if (error instanceof Error) { return error; } if (error !== null && typeof error === 'object') { // Handle plain error objects with message property and/or possibly other metadata return Object.assign(new Error(error.message), error); } return new Error(error); }); let message = errors .map(error => { // The `stack` property is not standardized, so we can't assume it exists return typeof error.stack === 'string' ? cleanInternalStack(cleanStack(error.stack)) : String(error); }) .join('\n'); message = '\n' + indentString(message, 4); super(message); this.name = 'AggregateError'; Object.defineProperty(this, '_errors', {value: errors}); } * [Symbol.iterator]() { for (const error of this._errors) { yield error; } } } module.exports = AggregateError; MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "aggregate-error", "version": "3.1.0", "description": "Create an error from multiple errors", "license": "MIT", "repository": "sindresorhus/aggregate-error", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=8" }, "scripts": { "test": "xo && ava && tsd" }, "files": [ "index.js", "index.d.ts" ], "keywords": [ "aggregate", "error", "combine", "multiple", "many", "collection", "iterable", "iterator" ], "dependencies": { "clean-stack": "^2.0.0", "indent-string": "^4.0.0" }, "devDependencies": { "ava": "^2.4.0", "tsd": "^0.7.1", "xo": "^0.25.3" } } 'use strict'; module.exports = balanced; function balanced(a, b, str) { if (a instanceof RegExp) a = maybeMatch(a, str); if (b instanceof RegExp) b = maybeMatch(b, str); var r = range(a, b, str); return r && { start: r[0], end: r[1], pre: str.slice(0, r[0]), body: str.slice(r[0] + a.length, r[1]), post: str.slice(r[1] + b.length) }; } function maybeMatch(reg, str) { var m = str.match(reg); return m ? m[0] : null; } balanced.range = range; function range(a, b, str) { var begs, beg, left, right, result; var ai = str.indexOf(a); var bi = str.indexOf(b, ai + 1); var i = ai; if (ai >= 0 && bi > 0) { if(a===b) { return [ai, bi]; } begs = []; left = str.length; while (i >= 0 && !result) { if (i == ai) { begs.push(i); ai = str.indexOf(a, i + 1); } else if (begs.length == 1) { result = [ begs.pop(), bi ]; } else { beg = begs.pop(); if (beg < left) { left = beg; right = bi; } bi = str.indexOf(b, i + 1); } i = ai < bi && ai >= 0 ? ai : bi; } if (begs.length) { result = [ left, right ]; } } return result; } (MIT) Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "balanced-match", "description": "Match balanced character pairs, like \"{\" and \"}\"", "version": "1.0.2", "repository": { "type": "git", "url": "git://github.com/juliangruber/balanced-match.git" }, "homepage": "https://github.com/juliangruber/balanced-match", "main": "index.js", "scripts": { "test": "tape test/test.js", "bench": "matcha test/bench.js" }, "devDependencies": { "matcha": "^0.7.0", "tape": "^4.6.0" }, "keywords": [ "match", "regexp", "test", "balanced", "parse" ], "author": { "name": "Julian Gruber", "email": "mail@juliangruber.com", "url": "http://juliangruber.com" }, "license": "MIT", "testling": { "files": "test/*.js", "browsers": [ "ie/8..latest", "firefox/20..latest", "firefox/nightly", "chrome/25..latest", "chrome/canary", "opera/12..latest", "opera/next", "safari/5.1..latest", "ipad/6.0..latest", "iphone/6.0..latest", "android-browser/4.2..latest" ] } } # Authors #### Ordered by first contribution. - Romain Beauxis (toots@rastageeks.org) - Tobias Koppers (tobias.koppers@googlemail.com) - Janus (ysangkok@gmail.com) - Rainer Dreyer (rdrey1@gmail.com) - Tõnis Tiigi (tonistiigi@gmail.com) - James Halliday (mail@substack.net) - Michael Williamson (mike@zwobble.org) - elliottcable (github@elliottcable.name) - rafael (rvalle@livelens.net) - Andrew Kelley (superjoe30@gmail.com) - Andreas Madsen (amwebdk@gmail.com) - Mike Brevoort (mike.brevoort@pearson.com) - Brian White (mscdex@mscdex.net) - Feross Aboukhadijeh (feross@feross.org) - Ruben Verborgh (ruben@verborgh.org) - eliang (eliang.cs@gmail.com) - Jesse Tane (jesse.tane@gmail.com) - Alfonso Boza (alfonso@cloud.com) - Mathias Buus (mathiasbuus@gmail.com) - Devon Govett (devongovett@gmail.com) - Daniel Cousens (github@dcousens.com) - Joseph Dykstra (josephdykstra@gmail.com) - Parsha Pourkhomami (parshap+git@gmail.com) - Damjan Košir (damjan.kosir@gmail.com) - daverayment (dave.rayment@gmail.com) - kawanet (u-suke@kawa.net) - Linus Unnebäck (linus@folkdatorn.se) - Nolan Lawson (nolan.lawson@gmail.com) - Calvin Metcalf (calvin.metcalf@gmail.com) - Koki Takahashi (hakatasiloving@gmail.com) - Guy Bedford (guybedford@gmail.com) - Jan Schär (jscissr@gmail.com) - RaulTsc (tomescu.raul@gmail.com) - Matthieu Monsch (monsch@alum.mit.edu) - Dan Ehrenberg (littledan@chromium.org) - Kirill Fomichev (fanatid@ya.ru) - Yusuke Kawasaki (u-suke@kawa.net) - DC (dcposch@dcpos.ch) - John-David Dalton (john.david.dalton@gmail.com) - adventure-yunfei (adventure030@gmail.com) - Emil Bay (github@tixz.dk) - Sam Sudar (sudar.sam@gmail.com) - Volker Mische (volker.mische@gmail.com) - David Walton (support@geekstocks.com) - Сковорода Никита Андреевич (chalkerx@gmail.com) - greenkeeper[bot] (greenkeeper[bot]@users.noreply.github.com) - ukstv (sergey.ukustov@machinomy.com) - Renée Kooi (renee@kooi.me) - ranbochen (ranbochen@qq.com) - Vladimir Borovik (bobahbdb@gmail.com) - greenkeeper[bot] (23040076+greenkeeper[bot]@users.noreply.github.com) - kumavis (aaron@kumavis.me) - Sergey Ukustov (sergey.ukustov@machinomy.com) - Fei Liu (liu.feiwood@gmail.com) - Blaine Bublitz (blaine.bublitz@gmail.com) - clement (clement@seald.io) - Koushik Dutta (koushd@gmail.com) - Jordan Harband (ljharb@gmail.com) - Niklas Mischkulnig (mischnic@users.noreply.github.com) - Nikolai Vavilov (vvnicholas@gmail.com) - Fedor Nezhivoi (gyzerok@users.noreply.github.com) - Peter Newman (peternewman@users.noreply.github.com) - mathmakgakpak (44949126+mathmakgakpak@users.noreply.github.com) - jkkang (jkkang@smartauth.kr) #### Generated by bin/update-authors.sh. /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ /* eslint-disable no-proto */ 'use strict' var base64 = require('base64-js') var ieee754 = require('ieee754') var customInspectSymbol = (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation : null exports.Buffer = Buffer exports.SlowBuffer = SlowBuffer exports.INSPECT_MAX_BYTES = 50 var K_MAX_LENGTH = 0x7fffffff exports.kMaxLength = K_MAX_LENGTH /** * If `Buffer.TYPED_ARRAY_SUPPORT`: * === true Use Uint8Array implementation (fastest) * === false Print warning and recommend using `buffer` v4.x which has an Object * implementation (most compatible, even IE6) * * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, * Opera 11.6+, iOS 4.2+. * * We report that the browser does not support typed arrays if the are not subclassable * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support * for __proto__ and has a buggy typed array implementation. */ Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport() if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && typeof console.error === 'function') { 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.' ) } function typedArraySupport () { // Can typed array instances can be augmented? try { var arr = new Uint8Array(1) var proto = { foo: function () { return 42 } } Object.setPrototypeOf(proto, Uint8Array.prototype) Object.setPrototypeOf(arr, proto) return arr.foo() === 42 } catch (e) { return false } } Object.defineProperty(Buffer.prototype, 'parent', { enumerable: true, get: function () { if (!Buffer.isBuffer(this)) return undefined return this.buffer } }) Object.defineProperty(Buffer.prototype, 'offset', { enumerable: true, get: function () { if (!Buffer.isBuffer(this)) return undefined return this.byteOffset } }) function createBuffer (length) { if (length > K_MAX_LENGTH) { throw new RangeError('The value "' + length + '" is invalid for option "size"') } // Return an augmented `Uint8Array` instance var buf = new Uint8Array(length) Object.setPrototypeOf(buf, Buffer.prototype) return buf } /** * The Buffer constructor returns instances of `Uint8Array` that have their * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of * `Uint8Array`, so the returned instances will have all the node `Buffer` methods * and the `Uint8Array` methods. Square bracket notation works as expected -- it * returns a single octet. * * The `Uint8Array` prototype remains unmodified. */ function Buffer (arg, encodingOrOffset, length) { // Common case. if (typeof arg === 'number') { if (typeof encodingOrOffset === 'string') { throw new TypeError( 'The "string" argument must be of type string. Received type number' ) } return allocUnsafe(arg) } return from(arg, encodingOrOffset, length) } Buffer.poolSize = 8192 // not used by this implementation function from (value, encodingOrOffset, length) { if (typeof value === 'string') { return fromString(value, encodingOrOffset) } if (ArrayBuffer.isView(value)) { return fromArrayView(value) } if (value == null) { throw new TypeError( 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + 'or Array-like Object. Received type ' + (typeof value) ) } if (isInstance(value, ArrayBuffer) || (value && isInstance(value.buffer, ArrayBuffer))) { return fromArrayBuffer(value, encodingOrOffset, length) } if (typeof SharedArrayBuffer !== 'undefined' && (isInstance(value, SharedArrayBuffer) || (value && isInstance(value.buffer, SharedArrayBuffer)))) { return fromArrayBuffer(value, encodingOrOffset, length) } if (typeof value === 'number') { throw new TypeError( 'The "value" argument must not be of type number. Received type number' ) } var valueOf = value.valueOf && value.valueOf() if (valueOf != null && valueOf !== value) { return Buffer.from(valueOf, encodingOrOffset, length) } var b = fromObject(value) if (b) return b if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === 'function') { return Buffer.from( value[Symbol.toPrimitive]('string'), encodingOrOffset, length ) } throw new TypeError( 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + 'or Array-like Object. Received type ' + (typeof value) ) } /** * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError * if value is a number. * Buffer.from(str[, encoding]) * Buffer.from(array) * Buffer.from(buffer) * Buffer.from(arrayBuffer[, byteOffset[, length]]) **/ Buffer.from = function (value, encodingOrOffset, length) { return from(value, encodingOrOffset, length) } // Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: // https://github.com/feross/buffer/pull/148 Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype) Object.setPrototypeOf(Buffer, Uint8Array) function assertSize (size) { if (typeof size !== 'number') { throw new TypeError('"size" argument must be of type number') } else if (size < 0) { throw new RangeError('The value "' + size + '" is invalid for option "size"') } } function alloc (size, fill, encoding) { assertSize(size) if (size <= 0) { return createBuffer(size) } if (fill !== undefined) { // Only pay attention to encoding if it's a string. This // prevents accidentally sending in a number that would // be interpreted as a start offset. return typeof encoding === 'string' ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill) } return createBuffer(size) } /** * Creates a new filled Buffer instance. * alloc(size[, fill[, encoding]]) **/ Buffer.alloc = function (size, fill, encoding) { return alloc(size, fill, encoding) } function allocUnsafe (size) { assertSize(size) return createBuffer(size < 0 ? 0 : checked(size) | 0) } /** * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. * */ Buffer.allocUnsafe = function (size) { return allocUnsafe(size) } /** * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. */ Buffer.allocUnsafeSlow = function (size) { return allocUnsafe(size) } function fromString (string, encoding) { if (typeof encoding !== 'string' || encoding === '') { encoding = 'utf8' } if (!Buffer.isEncoding(encoding)) { throw new TypeError('Unknown encoding: ' + encoding) } var length = byteLength(string, encoding) | 0 var buf = createBuffer(length) var actual = buf.write(string, encoding) if (actual !== length) { // Writing a hex string, for example, that contains invalid characters will // cause everything after the first invalid character to be ignored. (e.g. // 'abxxcd' will be treated as 'ab') buf = buf.slice(0, actual) } return buf } function fromArrayLike (array) { var length = array.length < 0 ? 0 : checked(array.length) | 0 var buf = createBuffer(length) for (var i = 0; i < length; i += 1) { buf[i] = array[i] & 255 } return buf } function fromArrayView (arrayView) { if (isInstance(arrayView, Uint8Array)) { var copy = new Uint8Array(arrayView) return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength) } return fromArrayLike(arrayView) } function fromArrayBuffer (array, byteOffset, length) { if (byteOffset < 0 || array.byteLength < byteOffset) { throw new RangeError('"offset" is outside of buffer bounds') } if (array.byteLength < byteOffset + (length || 0)) { throw new RangeError('"length" is outside of buffer bounds') } var buf if (byteOffset === undefined && length === undefined) { buf = new Uint8Array(array) } else if (length === undefined) { buf = new Uint8Array(array, byteOffset) } else { buf = new Uint8Array(array, byteOffset, length) } // Return an augmented `Uint8Array` instance Object.setPrototypeOf(buf, Buffer.prototype) return buf } function fromObject (obj) { if (Buffer.isBuffer(obj)) { var len = checked(obj.length) | 0 var buf = createBuffer(len) if (buf.length === 0) { return buf } obj.copy(buf, 0, 0, len) return buf } if (obj.length !== undefined) { if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { return createBuffer(0) } return fromArrayLike(obj) } if (obj.type === 'Buffer' && Array.isArray(obj.data)) { return fromArrayLike(obj.data) } } function checked (length) { // Note: cannot use `length < K_MAX_LENGTH` here because that fails when // length is NaN (which is otherwise coerced to zero.) if (length >= K_MAX_LENGTH) { throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes') } return length | 0 } function SlowBuffer (length) { if (+length != length) { // eslint-disable-line eqeqeq length = 0 } return Buffer.alloc(+length) } Buffer.isBuffer = function isBuffer (b) { return b != null && b._isBuffer === true && b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false } Buffer.compare = function compare (a, b) { if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength) if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength) if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { throw new TypeError( 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array' ) } if (a === b) return 0 var x = a.length var y = b.length for (var i = 0, len = Math.min(x, y); i < len; ++i) { if (a[i] !== b[i]) { x = a[i] y = b[i] break } } if (x < y) return -1 if (y < x) return 1 return 0 } Buffer.isEncoding = function isEncoding (encoding) { switch (String(encoding).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 true default: return false } } Buffer.concat = function concat (list, length) { if (!Array.isArray(list)) { throw new TypeError('"list" argument must be an Array of Buffers') } if (list.length === 0) { return Buffer.alloc(0) } var i if (length === undefined) { length = 0 for (i = 0; i < list.length; ++i) { length += list[i].length } } var buffer = Buffer.allocUnsafe(length) var pos = 0 for (i = 0; i < list.length; ++i) { var buf = list[i] if (isInstance(buf, Uint8Array)) { if (pos + buf.length > buffer.length) { Buffer.from(buf).copy(buffer, pos) } else { Uint8Array.prototype.set.call( buffer, buf, pos ) } } else if (!Buffer.isBuffer(buf)) { throw new TypeError('"list" argument must be an Array of Buffers') } else { buf.copy(buffer, pos) } pos += buf.length } return buffer } function byteLength (string, encoding) { if (Buffer.isBuffer(string)) { return string.length } if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { return string.byteLength } if (typeof string !== 'string') { throw new TypeError( 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + 'Received type ' + typeof string ) } var len = string.length var mustMatch = (arguments.length > 2 && arguments[2] === true) if (!mustMatch && len === 0) return 0 // Use a for loop to avoid recursion var loweredCase = false for (;;) { switch (encoding) { case 'ascii': case 'latin1': case 'binary': return len case 'utf8': case 'utf-8': return utf8ToBytes(string).length case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return len * 2 case 'hex': return len >>> 1 case 'base64': return base64ToBytes(string).length default: if (loweredCase) { return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8 } encoding = ('' + encoding).toLowerCase() loweredCase = true } } } Buffer.byteLength = byteLength function slowToString (encoding, start, end) { var loweredCase = false // No need to verify that "this.length <= MAX_UINT32" since it's a read-only // property of a typed array. // This behaves neither like String nor Uint8Array in that we set start/end // to their upper/lower bounds if the value passed is out of range. // undefined is handled specially as per ECMA-262 6th Edition, // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. if (start === undefined || start < 0) { start = 0 } // Return early if start > this.length. Done here to prevent potential uint32 // coercion fail below. if (start > this.length) { return '' } if (end === undefined || end > this.length) { end = this.length } if (end <= 0) { return '' } // Force coercion to uint32. This will also coerce falsey/NaN values to 0. end >>>= 0 start >>>= 0 if (end <= start) { return '' } if (!encoding) encoding = 'utf8' while (true) { switch (encoding) { case 'hex': return hexSlice(this, start, end) case 'utf8': case 'utf-8': return utf8Slice(this, start, end) case 'ascii': return asciiSlice(this, start, end) case 'latin1': case 'binary': return latin1Slice(this, start, end) case 'base64': return base64Slice(this, start, end) case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return utf16leSlice(this, start, end) default: if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) encoding = (encoding + '').toLowerCase() loweredCase = true } } } // This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) // to detect a Buffer instance. It's not possible to use `instanceof Buffer` // reliably in a browserify context because there could be multiple different // copies of the 'buffer' package in use. This method works even for Buffer // instances that were created from another copy of the `buffer` package. // See: https://github.com/feross/buffer/issues/154 Buffer.prototype._isBuffer = true function swap (b, n, m) { var i = b[n] b[n] = b[m] b[m] = i } Buffer.prototype.swap16 = function swap16 () { var len = this.length if (len % 2 !== 0) { throw new RangeError('Buffer size must be a multiple of 16-bits') } for (var i = 0; i < len; i += 2) { swap(this, i, i + 1) } return this } Buffer.prototype.swap32 = function swap32 () { var len = this.length if (len % 4 !== 0) { throw new RangeError('Buffer size must be a multiple of 32-bits') } for (var i = 0; i < len; i += 4) { swap(this, i, i + 3) swap(this, i + 1, i + 2) } return this } Buffer.prototype.swap64 = function swap64 () { var len = this.length if (len % 8 !== 0) { throw new RangeError('Buffer size must be a multiple of 64-bits') } for (var i = 0; i < len; i += 8) { swap(this, i, i + 7) swap(this, i + 1, i + 6) swap(this, i + 2, i + 5) swap(this, i + 3, i + 4) } return this } Buffer.prototype.toString = function toString () { var length = this.length if (length === 0) return '' if (arguments.length === 0) return utf8Slice(this, 0, length) return slowToString.apply(this, arguments) } Buffer.prototype.toLocaleString = Buffer.prototype.toString Buffer.prototype.equals = function equals (b) { if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') if (this === b) return true return Buffer.compare(this, b) === 0 } Buffer.prototype.inspect = function inspect () { var str = '' var max = exports.INSPECT_MAX_BYTES str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim() if (this.length > max) str += ' ... ' return '' } if (customInspectSymbol) { Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect } Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { if (isInstance(target, Uint8Array)) { target = Buffer.from(target, target.offset, target.byteLength) } if (!Buffer.isBuffer(target)) { throw new TypeError( 'The "target" argument must be one of type Buffer or Uint8Array. ' + 'Received type ' + (typeof target) ) } if (start === undefined) { start = 0 } if (end === undefined) { end = target ? target.length : 0 } if (thisStart === undefined) { thisStart = 0 } if (thisEnd === undefined) { thisEnd = this.length } if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { throw new RangeError('out of range index') } if (thisStart >= thisEnd && start >= end) { return 0 } if (thisStart >= thisEnd) { return -1 } if (start >= end) { return 1 } start >>>= 0 end >>>= 0 thisStart >>>= 0 thisEnd >>>= 0 if (this === target) return 0 var x = thisEnd - thisStart var y = end - start var len = Math.min(x, y) var thisCopy = this.slice(thisStart, thisEnd) var targetCopy = target.slice(start, end) for (var i = 0; i < len; ++i) { if (thisCopy[i] !== targetCopy[i]) { x = thisCopy[i] y = targetCopy[i] break } } if (x < y) return -1 if (y < x) return 1 return 0 } // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, // OR the last index of `val` in `buffer` at offset <= `byteOffset`. // // Arguments: // - buffer - a Buffer to search // - val - a string, Buffer, or number // - byteOffset - an index into `buffer`; will be clamped to an int32 // - encoding - an optional encoding, relevant is val is a string // - dir - true for indexOf, false for lastIndexOf function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { // Empty buffer means no match if (buffer.length === 0) return -1 // Normalize byteOffset if (typeof byteOffset === 'string') { encoding = byteOffset byteOffset = 0 } else if (byteOffset > 0x7fffffff) { byteOffset = 0x7fffffff } else if (byteOffset < -0x80000000) { byteOffset = -0x80000000 } byteOffset = +byteOffset // Coerce to Number. if (numberIsNaN(byteOffset)) { // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer byteOffset = dir ? 0 : (buffer.length - 1) } // Normalize byteOffset: negative offsets start from the end of the buffer if (byteOffset < 0) byteOffset = buffer.length + byteOffset if (byteOffset >= buffer.length) { if (dir) return -1 else byteOffset = buffer.length - 1 } else if (byteOffset < 0) { if (dir) byteOffset = 0 else return -1 } // Normalize val if (typeof val === 'string') { val = Buffer.from(val, encoding) } // Finally, search either indexOf (if dir is true) or lastIndexOf if (Buffer.isBuffer(val)) { // Special case: looking for empty string/buffer always fails if (val.length === 0) { return -1 } return arrayIndexOf(buffer, val, byteOffset, encoding, dir) } else if (typeof val === 'number') { val = val & 0xFF // Search for a byte value [0-255] if (typeof Uint8Array.prototype.indexOf === 'function') { if (dir) { return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) } else { return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) } } return arrayIndexOf(buffer, [val], byteOffset, encoding, dir) } throw new TypeError('val must be string, number or Buffer') } function arrayIndexOf (arr, val, byteOffset, encoding, dir) { var indexSize = 1 var arrLength = arr.length var valLength = val.length if (encoding !== undefined) { encoding = String(encoding).toLowerCase() if (encoding === 'ucs2' || encoding === 'ucs-2' || encoding === 'utf16le' || encoding === 'utf-16le') { if (arr.length < 2 || val.length < 2) { return -1 } indexSize = 2 arrLength /= 2 valLength /= 2 byteOffset /= 2 } } function read (buf, i) { if (indexSize === 1) { return buf[i] } else { return buf.readUInt16BE(i * indexSize) } } var i if (dir) { var foundIndex = -1 for (i = byteOffset; i < arrLength; i++) { if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { if (foundIndex === -1) foundIndex = i if (i - foundIndex + 1 === valLength) return foundIndex * indexSize } else { if (foundIndex !== -1) i -= i - foundIndex foundIndex = -1 } } } else { if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength for (i = byteOffset; i >= 0; i--) { var found = true for (var j = 0; j < valLength; j++) { if (read(arr, i + j) !== read(val, j)) { found = false break } } if (found) return i } } return -1 } Buffer.prototype.includes = function includes (val, byteOffset, encoding) { return this.indexOf(val, byteOffset, encoding) !== -1 } Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { return bidirectionalIndexOf(this, val, byteOffset, encoding, true) } Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { return bidirectionalIndexOf(this, val, byteOffset, encoding, false) } function hexWrite (buf, string, offset, length) { offset = Number(offset) || 0 var remaining = buf.length - offset if (!length) { length = remaining } else { length = Number(length) if (length > remaining) { length = remaining } } var strLen = string.length if (length > strLen / 2) { length = strLen / 2 } for (var i = 0; i < length; ++i) { var parsed = parseInt(string.substr(i * 2, 2), 16) if (numberIsNaN(parsed)) return i buf[offset + i] = parsed } return i } function utf8Write (buf, string, offset, length) { return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) } function asciiWrite (buf, string, offset, length) { return blitBuffer(asciiToBytes(string), buf, offset, length) } function base64Write (buf, string, offset, length) { return blitBuffer(base64ToBytes(string), buf, offset, length) } function ucs2Write (buf, string, offset, length) { return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) } Buffer.prototype.write = function write (string, offset, length, encoding) { // Buffer#write(string) if (offset === undefined) { encoding = 'utf8' length = this.length offset = 0 // Buffer#write(string, encoding) } else if (length === undefined && typeof offset === 'string') { encoding = offset length = this.length offset = 0 // Buffer#write(string, offset[, length][, encoding]) } else if (isFinite(offset)) { offset = offset >>> 0 if (isFinite(length)) { length = length >>> 0 if (encoding === undefined) encoding = 'utf8' } else { encoding = length length = undefined } } else { throw new Error( 'Buffer.write(string, encoding, offset[, length]) is no longer supported' ) } var remaining = this.length - offset if (length === undefined || length > remaining) length = remaining if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { throw new RangeError('Attempt to write outside buffer bounds') } if (!encoding) encoding = 'utf8' var loweredCase = false for (;;) { switch (encoding) { case 'hex': return hexWrite(this, string, offset, length) case 'utf8': case 'utf-8': return utf8Write(this, string, offset, length) case 'ascii': case 'latin1': case 'binary': return asciiWrite(this, string, offset, length) case 'base64': // Warning: maxLength not taken into account in base64Write return base64Write(this, string, offset, length) case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return ucs2Write(this, string, offset, length) default: if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) encoding = ('' + encoding).toLowerCase() loweredCase = true } } } Buffer.prototype.toJSON = function toJSON () { return { type: 'Buffer', data: Array.prototype.slice.call(this._arr || this, 0) } } function base64Slice (buf, start, end) { if (start === 0 && end === buf.length) { return base64.fromByteArray(buf) } else { return base64.fromByteArray(buf.slice(start, end)) } } function utf8Slice (buf, start, end) { end = Math.min(buf.length, end) var res = [] var i = start while (i < end) { var firstByte = buf[i] var codePoint = null var bytesPerSequence = (firstByte > 0xEF) ? 4 : (firstByte > 0xDF) ? 3 : (firstByte > 0xBF) ? 2 : 1 if (i + bytesPerSequence <= end) { var secondByte, thirdByte, fourthByte, tempCodePoint switch (bytesPerSequence) { case 1: if (firstByte < 0x80) { codePoint = firstByte } break case 2: secondByte = buf[i + 1] if ((secondByte & 0xC0) === 0x80) { tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) if (tempCodePoint > 0x7F) { codePoint = tempCodePoint } } break case 3: secondByte = buf[i + 1] thirdByte = buf[i + 2] if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { codePoint = tempCodePoint } } break case 4: secondByte = buf[i + 1] thirdByte = buf[i + 2] fourthByte = buf[i + 3] if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { codePoint = tempCodePoint } } } } if (codePoint === null) { // we did not generate a valid codePoint so insert a // replacement char (U+FFFD) and advance only 1 byte codePoint = 0xFFFD bytesPerSequence = 1 } else if (codePoint > 0xFFFF) { // encode to utf16 (surrogate pair dance) codePoint -= 0x10000 res.push(codePoint >>> 10 & 0x3FF | 0xD800) codePoint = 0xDC00 | codePoint & 0x3FF } res.push(codePoint) i += bytesPerSequence } return decodeCodePointsArray(res) } // Based on http://stackoverflow.com/a/22747272/680742, the browser with // the lowest limit is Chrome, with 0x10000 args. // We go 1 magnitude less, for safety var MAX_ARGUMENTS_LENGTH = 0x1000 function decodeCodePointsArray (codePoints) { var len = codePoints.length if (len <= MAX_ARGUMENTS_LENGTH) { return String.fromCharCode.apply(String, codePoints) // avoid extra slice() } // Decode in chunks to avoid "call stack size exceeded". var res = '' var i = 0 while (i < len) { res += String.fromCharCode.apply( String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) ) } return res } function asciiSlice (buf, start, end) { var ret = '' end = Math.min(buf.length, end) for (var i = start; i < end; ++i) { ret += String.fromCharCode(buf[i] & 0x7F) } return ret } function latin1Slice (buf, start, end) { var ret = '' end = Math.min(buf.length, end) for (var i = start; i < end; ++i) { ret += String.fromCharCode(buf[i]) } return ret } function hexSlice (buf, start, end) { var len = buf.length if (!start || start < 0) start = 0 if (!end || end < 0 || end > len) end = len var out = '' for (var i = start; i < end; ++i) { out += hexSliceLookupTable[buf[i]] } return out } function utf16leSlice (buf, start, end) { var bytes = buf.slice(start, end) var res = '' // If bytes.length is odd, the last 8 bits must be ignored (same as node.js) for (var i = 0; i < bytes.length - 1; i += 2) { res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256)) } return res } Buffer.prototype.slice = function slice (start, end) { var len = this.length start = ~~start end = end === undefined ? len : ~~end if (start < 0) { start += len if (start < 0) start = 0 } else if (start > len) { start = len } if (end < 0) { end += len if (end < 0) end = 0 } else if (end > len) { end = len } if (end < start) end = start var newBuf = this.subarray(start, end) // Return an augmented `Uint8Array` instance Object.setPrototypeOf(newBuf, Buffer.prototype) return newBuf } /* * Need to make sure that buffer isn't trying to write out of bounds. */ function checkOffset (offset, ext, length) { if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') } Buffer.prototype.readUintLE = Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { offset = offset >>> 0 byteLength = byteLength >>> 0 if (!noAssert) checkOffset(offset, byteLength, this.length) var val = this[offset] var mul = 1 var i = 0 while (++i < byteLength && (mul *= 0x100)) { val += this[offset + i] * mul } return val } Buffer.prototype.readUintBE = Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { offset = offset >>> 0 byteLength = byteLength >>> 0 if (!noAssert) { checkOffset(offset, byteLength, this.length) } var val = this[offset + --byteLength] var mul = 1 while (byteLength > 0 && (mul *= 0x100)) { val += this[offset + --byteLength] * mul } return val } Buffer.prototype.readUint8 = Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 1, this.length) return this[offset] } Buffer.prototype.readUint16LE = Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 2, this.length) return this[offset] | (this[offset + 1] << 8) } Buffer.prototype.readUint16BE = Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 2, this.length) return (this[offset] << 8) | this[offset + 1] } Buffer.prototype.readUint32LE = Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 4, this.length) return ((this[offset]) | (this[offset + 1] << 8) | (this[offset + 2] << 16)) + (this[offset + 3] * 0x1000000) } Buffer.prototype.readUint32BE = Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 4, this.length) return (this[offset] * 0x1000000) + ((this[offset + 1] << 16) | (this[offset + 2] << 8) | this[offset + 3]) } Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { offset = offset >>> 0 byteLength = byteLength >>> 0 if (!noAssert) checkOffset(offset, byteLength, this.length) var val = this[offset] var mul = 1 var i = 0 while (++i < byteLength && (mul *= 0x100)) { val += this[offset + i] * mul } mul *= 0x80 if (val >= mul) val -= Math.pow(2, 8 * byteLength) return val } Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { offset = offset >>> 0 byteLength = byteLength >>> 0 if (!noAssert) checkOffset(offset, byteLength, this.length) var i = byteLength var mul = 1 var val = this[offset + --i] while (i > 0 && (mul *= 0x100)) { val += this[offset + --i] * mul } mul *= 0x80 if (val >= mul) val -= Math.pow(2, 8 * byteLength) return val } Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 1, this.length) if (!(this[offset] & 0x80)) return (this[offset]) return ((0xff - this[offset] + 1) * -1) } Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 2, this.length) var val = this[offset] | (this[offset + 1] << 8) return (val & 0x8000) ? val | 0xFFFF0000 : val } Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 2, this.length) var val = this[offset + 1] | (this[offset] << 8) return (val & 0x8000) ? val | 0xFFFF0000 : val } Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 4, this.length) return (this[offset]) | (this[offset + 1] << 8) | (this[offset + 2] << 16) | (this[offset + 3] << 24) } Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 4, this.length) return (this[offset] << 24) | (this[offset + 1] << 16) | (this[offset + 2] << 8) | (this[offset + 3]) } Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 4, this.length) return ieee754.read(this, offset, true, 23, 4) } Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 4, this.length) return ieee754.read(this, offset, false, 23, 4) } Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 8, this.length) return ieee754.read(this, offset, true, 52, 8) } Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 8, this.length) return ieee754.read(this, offset, false, 52, 8) } function checkInt (buf, value, offset, ext, max, min) { if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') if (offset + ext > buf.length) throw new RangeError('Index out of range') } Buffer.prototype.writeUintLE = Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { value = +value offset = offset >>> 0 byteLength = byteLength >>> 0 if (!noAssert) { var maxBytes = Math.pow(2, 8 * byteLength) - 1 checkInt(this, value, offset, byteLength, maxBytes, 0) } var mul = 1 var i = 0 this[offset] = value & 0xFF while (++i < byteLength && (mul *= 0x100)) { this[offset + i] = (value / mul) & 0xFF } return offset + byteLength } Buffer.prototype.writeUintBE = Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { value = +value offset = offset >>> 0 byteLength = byteLength >>> 0 if (!noAssert) { var maxBytes = Math.pow(2, 8 * byteLength) - 1 checkInt(this, value, offset, byteLength, maxBytes, 0) } var i = byteLength - 1 var mul = 1 this[offset + i] = value & 0xFF while (--i >= 0 && (mul *= 0x100)) { this[offset + i] = (value / mul) & 0xFF } return offset + byteLength } Buffer.prototype.writeUint8 = Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) this[offset] = (value & 0xff) return offset + 1 } Buffer.prototype.writeUint16LE = Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) this[offset] = (value & 0xff) this[offset + 1] = (value >>> 8) return offset + 2 } Buffer.prototype.writeUint16BE = Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) this[offset] = (value >>> 8) this[offset + 1] = (value & 0xff) return offset + 2 } Buffer.prototype.writeUint32LE = Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) this[offset + 3] = (value >>> 24) this[offset + 2] = (value >>> 16) this[offset + 1] = (value >>> 8) this[offset] = (value & 0xff) return offset + 4 } Buffer.prototype.writeUint32BE = Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) this[offset] = (value >>> 24) this[offset + 1] = (value >>> 16) this[offset + 2] = (value >>> 8) this[offset + 3] = (value & 0xff) return offset + 4 } Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) { var limit = Math.pow(2, (8 * byteLength) - 1) checkInt(this, value, offset, byteLength, limit - 1, -limit) } var i = 0 var mul = 1 var sub = 0 this[offset] = value & 0xFF while (++i < byteLength && (mul *= 0x100)) { if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { sub = 1 } this[offset + i] = ((value / mul) >> 0) - sub & 0xFF } return offset + byteLength } Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) { var limit = Math.pow(2, (8 * byteLength) - 1) checkInt(this, value, offset, byteLength, limit - 1, -limit) } var i = byteLength - 1 var mul = 1 var sub = 0 this[offset + i] = value & 0xFF while (--i >= 0 && (mul *= 0x100)) { if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { sub = 1 } this[offset + i] = ((value / mul) >> 0) - sub & 0xFF } return offset + byteLength } Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) if (value < 0) value = 0xff + value + 1 this[offset] = (value & 0xff) return offset + 1 } Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) this[offset] = (value & 0xff) this[offset + 1] = (value >>> 8) return offset + 2 } Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) this[offset] = (value >>> 8) this[offset + 1] = (value & 0xff) return offset + 2 } Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) this[offset] = (value & 0xff) this[offset + 1] = (value >>> 8) this[offset + 2] = (value >>> 16) this[offset + 3] = (value >>> 24) return offset + 4 } Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) if (value < 0) value = 0xffffffff + value + 1 this[offset] = (value >>> 24) this[offset + 1] = (value >>> 16) this[offset + 2] = (value >>> 8) this[offset + 3] = (value & 0xff) return offset + 4 } function checkIEEE754 (buf, value, offset, ext, max, min) { if (offset + ext > buf.length) throw new RangeError('Index out of range') if (offset < 0) throw new RangeError('Index out of range') } function writeFloat (buf, value, offset, littleEndian, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) { checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) } ieee754.write(buf, value, offset, littleEndian, 23, 4) return offset + 4 } Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { return writeFloat(this, value, offset, true, noAssert) } Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { return writeFloat(this, value, offset, false, noAssert) } function writeDouble (buf, value, offset, littleEndian, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) { checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) } ieee754.write(buf, value, offset, littleEndian, 52, 8) return offset + 8 } Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { return writeDouble(this, value, offset, true, noAssert) } Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { return writeDouble(this, value, offset, false, noAssert) } // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) Buffer.prototype.copy = function copy (target, targetStart, start, end) { if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer') if (!start) start = 0 if (!end && end !== 0) end = this.length if (targetStart >= target.length) targetStart = target.length if (!targetStart) targetStart = 0 if (end > 0 && end < start) end = start // Copy 0 bytes; we're done if (end === start) return 0 if (target.length === 0 || this.length === 0) return 0 // Fatal error conditions if (targetStart < 0) { throw new RangeError('targetStart out of bounds') } if (start < 0 || start >= this.length) throw new RangeError('Index out of range') if (end < 0) throw new RangeError('sourceEnd out of bounds') // Are we oob? if (end > this.length) end = this.length if (target.length - targetStart < end - start) { end = target.length - targetStart + start } var len = end - start if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') { // Use built-in when available, missing from IE11 this.copyWithin(targetStart, start, end) } else { Uint8Array.prototype.set.call( target, this.subarray(start, end), targetStart ) } return len } // Usage: // buffer.fill(number[, offset[, end]]) // buffer.fill(buffer[, offset[, end]]) // buffer.fill(string[, offset[, end]][, encoding]) Buffer.prototype.fill = function fill (val, start, end, encoding) { // Handle string cases: if (typeof val === 'string') { if (typeof start === 'string') { encoding = start start = 0 end = this.length } else if (typeof end === 'string') { encoding = end end = this.length } if (encoding !== undefined && typeof encoding !== 'string') { throw new TypeError('encoding must be a string') } if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { throw new TypeError('Unknown encoding: ' + encoding) } if (val.length === 1) { var code = val.charCodeAt(0) if ((encoding === 'utf8' && code < 128) || encoding === 'latin1') { // Fast path: If `val` fits into a single byte, use that numeric value. val = code } } } else if (typeof val === 'number') { val = val & 255 } else if (typeof val === 'boolean') { val = Number(val) } // Invalid ranges are not set to a default, so can range check early. if (start < 0 || this.length < start || this.length < end) { throw new RangeError('Out of range index') } if (end <= start) { return this } start = start >>> 0 end = end === undefined ? this.length : end >>> 0 if (!val) val = 0 var i if (typeof val === 'number') { for (i = start; i < end; ++i) { this[i] = val } } else { var bytes = Buffer.isBuffer(val) ? val : Buffer.from(val, encoding) var len = bytes.length if (len === 0) { throw new TypeError('The value "' + val + '" is invalid for argument "value"') } for (i = 0; i < end - start; ++i) { this[i + start] = bytes[i % len] } } return this } // HELPER FUNCTIONS // ================ var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g function base64clean (str) { // Node takes equal signs as end of the Base64 encoding str = str.split('=')[0] // Node strips out invalid characters like \n and \t from the string, base64-js does not str = str.trim().replace(INVALID_BASE64_RE, '') // Node converts strings with length < 2 to '' if (str.length < 2) return '' // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not while (str.length % 4 !== 0) { str = str + '=' } return str } function utf8ToBytes (string, units) { units = units || Infinity var codePoint var length = string.length var leadSurrogate = null var bytes = [] for (var i = 0; i < length; ++i) { codePoint = string.charCodeAt(i) // is surrogate component if (codePoint > 0xD7FF && codePoint < 0xE000) { // last char was a lead if (!leadSurrogate) { // no lead yet if (codePoint > 0xDBFF) { // unexpected trail if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) continue } else if (i + 1 === length) { // unpaired lead if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) continue } // valid lead leadSurrogate = codePoint continue } // 2 leads in a row if (codePoint < 0xDC00) { if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) leadSurrogate = codePoint continue } // valid surrogate pair codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 } else if (leadSurrogate) { // valid bmp char, but last char was a lead if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) } leadSurrogate = null // encode utf8 if (codePoint < 0x80) { if ((units -= 1) < 0) break bytes.push(codePoint) } else if (codePoint < 0x800) { if ((units -= 2) < 0) break bytes.push( codePoint >> 0x6 | 0xC0, codePoint & 0x3F | 0x80 ) } else if (codePoint < 0x10000) { if ((units -= 3) < 0) break bytes.push( codePoint >> 0xC | 0xE0, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80 ) } else if (codePoint < 0x110000) { if ((units -= 4) < 0) break bytes.push( codePoint >> 0x12 | 0xF0, codePoint >> 0xC & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80 ) } else { throw new Error('Invalid code point') } } return bytes } function asciiToBytes (str) { var byteArray = [] for (var i = 0; i < str.length; ++i) { // Node's code seems to be doing this and not & 0x7F.. byteArray.push(str.charCodeAt(i) & 0xFF) } return byteArray } function utf16leToBytes (str, units) { var c, hi, lo var byteArray = [] for (var i = 0; i < str.length; ++i) { if ((units -= 2) < 0) break c = str.charCodeAt(i) hi = c >> 8 lo = c % 256 byteArray.push(lo) byteArray.push(hi) } return byteArray } function base64ToBytes (str) { return base64.toByteArray(base64clean(str)) } function blitBuffer (src, dst, offset, length) { for (var i = 0; i < length; ++i) { if ((i + offset >= dst.length) || (i >= src.length)) break dst[i + offset] = src[i] } return i } // ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass // the `instanceof` check but they should be treated as of that type. // See: https://github.com/feross/buffer/issues/166 function isInstance (obj, type) { return obj instanceof type || (obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name) } function numberIsNaN (obj) { // For IE11 support return obj !== obj // eslint-disable-line no-self-compare } // Create lookup table for `toString('hex')` // See: https://github.com/feross/buffer/issues/219 var hexSliceLookupTable = (function () { var alphabet = '0123456789abcdef' var table = new Array(256) for (var i = 0; i < 16; ++i) { var i16 = i * 16 for (var j = 0; j < 16; ++j) { table[i16 + j] = alphabet[i] + alphabet[j] } } return table })() The MIT License (MIT) Copyright (c) Feross Aboukhadijeh, and other contributors. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "buffer", "description": "Node.js Buffer API, for the browser", "version": "5.7.1", "author": { "name": "Feross Aboukhadijeh", "email": "feross@feross.org", "url": "https://feross.org" }, "bugs": { "url": "https://github.com/feross/buffer/issues" }, "contributors": [ "Romain Beauxis ", "James Halliday " ], "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" }, "devDependencies": { "airtap": "^3.0.0", "benchmark": "^2.1.4", "browserify": "^17.0.0", "concat-stream": "^2.0.0", "hyperquest": "^2.1.3", "is-buffer": "^2.0.4", "is-nan": "^1.3.0", "split": "^1.0.1", "standard": "*", "tape": "^5.0.1", "through2": "^4.0.2", "uglify-js": "^3.11.3" }, "homepage": "https://github.com/feross/buffer", "jspm": { "map": { "./index.js": { "node": "@node/buffer" } } }, "keywords": [ "arraybuffer", "browser", "browserify", "buffer", "compatible", "dataview", "uint8array" ], "license": "MIT", "main": "index.js", "types": "index.d.ts", "repository": { "type": "git", "url": "git://github.com/feross/buffer.git" }, "scripts": { "perf": "browserify --debug perf/bracket-notation.js > perf/bundle.js && open perf/index.html", "perf-node": "node perf/bracket-notation.js && node perf/concat.js && node perf/copy-big.js && node perf/copy.js && node perf/new-big.js && node perf/new.js && node perf/readDoubleBE.js && node perf/readFloatBE.js && node perf/readUInt32LE.js && node perf/slice.js && node perf/writeFloatBE.js", "size": "browserify -r ./ | uglifyjs -c -m | gzip | wc -c", "test": "standard && node ./bin/test.js", "test-browser-es5": "airtap -- test/*.js", "test-browser-es5-local": "airtap --local -- test/*.js", "test-browser-es6": "airtap -- test/*.js test/node/*.js", "test-browser-es6-local": "airtap --local -- test/*.js test/node/*.js", "test-node": "tape test/*.js test/node/*.js", "update-authors": "./bin/update-authors.sh" }, "standard": { "ignore": [ "test/node/**/*.js", "test/common.js", "test/_polyfill.js", "perf/**/*.js" ], "globals": [ "SharedArrayBuffer" ] }, "funding": [ { "type": "github", "url": "https://github.com/sponsors/feross" }, { "type": "patreon", "url": "https://www.patreon.com/feross" }, { "type": "consulting", "url": "https://feross.org/support" } ] } /* eslint-disable babel/new-cap, xo/throw-new-error */ 'use strict'; module.exports = function (str, pos) { if (str === null || str === undefined) { throw TypeError(); } str = String(str); var size = str.length; var i = pos ? Number(pos) : 0; if (Number.isNaN(i)) { i = 0; } if (i < 0 || i >= size) { return undefined; } var first = str.charCodeAt(i); if (first >= 0xD800 && first <= 0xDBFF && size > i + 1) { var second = str.charCodeAt(i + 1); if (second >= 0xDC00 && second <= 0xDFFF) { return ((first - 0xD800) * 0x400) + second - 0xDC00 + 0x10000; } } return first; }; The MIT License (MIT) Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "code-point-at", "version": "1.1.0", "description": "ES2015 `String#codePointAt()` ponyfill", "license": "MIT", "repository": "sindresorhus/code-point-at", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=0.10.0" }, "scripts": { "test": "xo && ava" }, "files": [ "index.js" ], "keywords": [ "es2015", "ponyfill", "polyfill", "shim", "string", "str", "code", "point", "at", "codepoint", "unicode" ], "devDependencies": { "ava": "*", "xo": "^0.16.0" } } module.exports = function (xs, fn) { var res = []; for (var i = 0; i < xs.length; i++) { var x = fn(xs[i], i); if (isArray(x)) res.push.apply(res, x); else res.push(x); } return res; }; var isArray = Array.isArray || function (xs) { return Object.prototype.toString.call(xs) === '[object Array]'; }; This software is released under the MIT license: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name" : "concat-map", "description" : "concatenative mapdashery", "version" : "0.0.1", "repository" : { "type" : "git", "url" : "git://github.com/substack/node-concat-map.git" }, "main" : "index.js", "keywords" : [ "concat", "concatMap", "map", "functional", "higher-order" ], "directories" : { "example" : "example", "test" : "test" }, "scripts" : { "test" : "tape test/*.js" }, "devDependencies" : { "tape" : "~2.4.0" }, "license" : "MIT", "author" : { "name" : "James Halliday", "email" : "mail@substack.net", "url" : "http://substack.net" }, "testling" : { "files" : "test/*.js", "browsers" : { "ie" : [ 6, 7, 8, 9 ], "ff" : [ 3.5, 10, 15.0 ], "chrome" : [ 10, 22 ], "safari" : [ 5.1 ], "opera" : [ 12 ] } } } concat-map ========== Concatenative mapdashery. [![browser support](http://ci.testling.com/substack/node-concat-map.png)](http://ci.testling.com/substack/node-concat-map) [![build status](https://secure.travis-ci.org/substack/node-concat-map.png)](http://travis-ci.org/substack/node-concat-map) example ======= ``` js var concatMap = require('concat-map'); var xs = [ 1, 2, 3, 4, 5, 6 ]; var ys = concatMap(xs, function (x) { return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; }); console.dir(ys); ``` *** ``` [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ] ``` methods ======= ``` js var concatMap = require('concat-map') ``` concatMap(xs, fn) ----------------- Return an array of concatenated elements by calling `fn(x, i)` for each element `x` and each index `i` in the array `xs`. When `fn(x, i)` returns an array, its result will be concatenated with the result array. If `fn(x, i)` returns anything else, that value will be pushed onto the end of the result array. install ======= With [npm](http://npmjs.org) do: ``` npm install concat-map ``` license ======= MIT notes ===== This module was written while sitting high above the ground in a tree. diff --git a/lib/util.js b/lib/util.js index a03e874..9074e8e 100644 --- a/lib/util.js +++ b/lib/util.js @@ -19,430 +19,6 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -var formatRegExp = /%[sdj%]/g; -exports.format = function(f) { - if (!isString(f)) { - var objects = []; - for (var i = 0; i < arguments.length; i++) { - objects.push(inspect(arguments[i])); - } - return objects.join(' '); - } - - var i = 1; - var args = arguments; - var len = args.length; - var str = String(f).replace(formatRegExp, function(x) { - if (x === '%%') return '%'; - if (i >= len) return x; - switch (x) { - case '%s': return String(args[i++]); - case '%d': return Number(args[i++]); - case '%j': - try { - return JSON.stringify(args[i++]); - } catch (_) { - return '[Circular]'; - } - default: - return x; - } - }); - for (var x = args[i]; i < len; x = args[++i]) { - if (isNull(x) || !isObject(x)) { - str += ' ' + x; - } else { - str += ' ' + inspect(x); - } - } - return str; -}; - - -// Mark that a method should not be used. -// Returns a modified function which warns once by default. -// If --no-deprecation is set, then it is a no-op. -exports.deprecate = function(fn, msg) { - // Allow for deprecating things in the process of starting up. - if (isUndefined(global.process)) { - return function() { - return exports.deprecate(fn, msg).apply(this, arguments); - }; - } - - if (process.noDeprecation === true) { - return fn; - } - - var warned = false; - function deprecated() { - if (!warned) { - if (process.throwDeprecation) { - throw new Error(msg); - } else if (process.traceDeprecation) { - console.trace(msg); - } else { - console.error(msg); - } - warned = true; - } - return fn.apply(this, arguments); - } - - return deprecated; -}; - - -var debugs = {}; -var debugEnviron; -exports.debuglog = function(set) { - if (isUndefined(debugEnviron)) - debugEnviron = process.env.NODE_DEBUG || ''; - set = set.toUpperCase(); - if (!debugs[set]) { - if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { - var pid = process.pid; - debugs[set] = function() { - var msg = exports.format.apply(exports, arguments); - console.error('%s %d: %s', set, pid, msg); - }; - } else { - debugs[set] = function() {}; - } - } - return debugs[set]; -}; - - -/** - * Echos the value of a value. Trys to print the value out - * in the best way possible given the different types. - * - * @param {Object} obj The object to print out. - * @param {Object} opts Optional options object that alters the output. - */ -/* legacy: obj, showHidden, depth, colors*/ -function inspect(obj, opts) { - // default options - var ctx = { - seen: [], - stylize: stylizeNoColor - }; - // legacy... - if (arguments.length >= 3) ctx.depth = arguments[2]; - if (arguments.length >= 4) ctx.colors = arguments[3]; - if (isBoolean(opts)) { - // legacy... - ctx.showHidden = opts; - } else if (opts) { - // got an "options" object - exports._extend(ctx, opts); - } - // set default options - if (isUndefined(ctx.showHidden)) ctx.showHidden = false; - if (isUndefined(ctx.depth)) ctx.depth = 2; - if (isUndefined(ctx.colors)) ctx.colors = false; - if (isUndefined(ctx.customInspect)) ctx.customInspect = true; - if (ctx.colors) ctx.stylize = stylizeWithColor; - return formatValue(ctx, obj, ctx.depth); -} -exports.inspect = inspect; - - -// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics -inspect.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] -}; - -// Don't use 'blue' not visible on cmd.exe -inspect.styles = { - 'special': 'cyan', - 'number': 'yellow', - 'boolean': 'yellow', - 'undefined': 'grey', - 'null': 'bold', - 'string': 'green', - 'date': 'magenta', - // "name": intentionally not styling - 'regexp': 'red' -}; - - -function stylizeWithColor(str, styleType) { - var style = inspect.styles[styleType]; - - if (style) { - return '\u001b[' + inspect.colors[style][0] + 'm' + str + - '\u001b[' + inspect.colors[style][1] + 'm'; - } else { - return str; - } -} - - -function stylizeNoColor(str, styleType) { - return str; -} - - -function arrayToHash(array) { - var hash = {}; - - array.forEach(function(val, idx) { - hash[val] = true; - }); - - return hash; -} - - -function formatValue(ctx, value, recurseTimes) { - // Provide a hook for user-specified inspect functions. - // Check that value is an object with an inspect function on it - if (ctx.customInspect && - value && - isFunction(value.inspect) && - // Filter out the util module, it's inspect function is special - value.inspect !== exports.inspect && - // Also filter out any prototype objects using the circular check. - !(value.constructor && value.constructor.prototype === value)) { - var ret = value.inspect(recurseTimes, ctx); - if (!isString(ret)) { - ret = formatValue(ctx, ret, recurseTimes); - } - return ret; - } - - // Primitive types cannot have properties - var primitive = formatPrimitive(ctx, value); - if (primitive) { - return primitive; - } - - // Look up the keys of the object. - var keys = Object.keys(value); - var visibleKeys = arrayToHash(keys); - - if (ctx.showHidden) { - keys = Object.getOwnPropertyNames(value); - } - - // Some type of object without properties can be shortcutted. - if (keys.length === 0) { - if (isFunction(value)) { - var name = value.name ? ': ' + value.name : ''; - return ctx.stylize('[Function' + name + ']', 'special'); - } - if (isRegExp(value)) { - return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); - } - if (isDate(value)) { - return ctx.stylize(Date.prototype.toString.call(value), 'date'); - } - if (isError(value)) { - return formatError(value); - } - } - - var base = '', array = false, braces = ['{', '}']; - - // Make Array say that they are Array - if (isArray(value)) { - array = true; - braces = ['[', ']']; - } - - // Make functions say that they are functions - if (isFunction(value)) { - var n = value.name ? ': ' + value.name : ''; - base = ' [Function' + n + ']'; - } - - // Make RegExps say that they are RegExps - if (isRegExp(value)) { - base = ' ' + RegExp.prototype.toString.call(value); - } - - // Make dates with properties first say the date - if (isDate(value)) { - base = ' ' + Date.prototype.toUTCString.call(value); - } - - // Make error with message first say the error - if (isError(value)) { - base = ' ' + formatError(value); - } - - if (keys.length === 0 && (!array || value.length == 0)) { - return braces[0] + base + braces[1]; - } - - if (recurseTimes < 0) { - if (isRegExp(value)) { - return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); - } else { - return ctx.stylize('[Object]', 'special'); - } - } - - ctx.seen.push(value); - - var output; - if (array) { - output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); - } else { - output = keys.map(function(key) { - return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); - }); - } - - ctx.seen.pop(); - - return reduceToSingleString(output, base, braces); -} - - -function formatPrimitive(ctx, value) { - if (isUndefined(value)) - return ctx.stylize('undefined', 'undefined'); - if (isString(value)) { - var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') - .replace(/'/g, "\\'") - .replace(/\\"/g, '"') + '\''; - return ctx.stylize(simple, 'string'); - } - if (isNumber(value)) { - // Format -0 as '-0'. Strict equality won't distinguish 0 from -0, - // so instead we use the fact that 1 / -0 < 0 whereas 1 / 0 > 0 . - if (value === 0 && 1 / value < 0) - return ctx.stylize('-0', 'number'); - return ctx.stylize('' + value, 'number'); - } - if (isBoolean(value)) - return ctx.stylize('' + value, 'boolean'); - // For some reason typeof null is "object", so special case here. - if (isNull(value)) - return ctx.stylize('null', 'null'); -} - - -function formatError(value) { - return '[' + Error.prototype.toString.call(value) + ']'; -} - - -function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { - var output = []; - for (var i = 0, l = value.length; i < l; ++i) { - if (hasOwnProperty(value, String(i))) { - output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, - String(i), true)); - } else { - output.push(''); - } - } - keys.forEach(function(key) { - if (!key.match(/^\d+$/)) { - output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, - key, true)); - } - }); - return output; -} - - -function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { - var name, str, desc; - desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; - if (desc.get) { - if (desc.set) { - str = ctx.stylize('[Getter/Setter]', 'special'); - } else { - str = ctx.stylize('[Getter]', 'special'); - } - } else { - if (desc.set) { - str = ctx.stylize('[Setter]', 'special'); - } - } - if (!hasOwnProperty(visibleKeys, key)) { - name = '[' + key + ']'; - } - if (!str) { - if (ctx.seen.indexOf(desc.value) < 0) { - if (isNull(recurseTimes)) { - str = formatValue(ctx, desc.value, null); - } else { - str = formatValue(ctx, desc.value, recurseTimes - 1); - } - if (str.indexOf('\n') > -1) { - if (array) { - str = str.split('\n').map(function(line) { - return ' ' + line; - }).join('\n').substr(2); - } else { - str = '\n' + str.split('\n').map(function(line) { - return ' ' + line; - }).join('\n'); - } - } - } else { - str = ctx.stylize('[Circular]', 'special'); - } - } - if (isUndefined(name)) { - if (array && key.match(/^\d+$/)) { - return str; - } - name = JSON.stringify('' + key); - if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { - name = name.substr(1, name.length - 2); - name = ctx.stylize(name, 'name'); - } else { - name = name.replace(/'/g, "\\'") - .replace(/\\"/g, '"') - .replace(/(^"|"$)/g, "'"); - name = ctx.stylize(name, 'string'); - } - } - - return name + ': ' + str; -} - - -function reduceToSingleString(output, base, braces) { - var numLinesEst = 0; - var length = output.reduce(function(prev, cur) { - numLinesEst++; - if (cur.indexOf('\n') >= 0) numLinesEst++; - return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; - }, 0); - - if (length > 60) { - return braces[0] + - (base === '' ? '' : base + '\n ') + - ' ' + - output.join(',\n ') + - ' ' + - braces[1]; - } - - return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; -} - - // NOTE: These type checking functions intentionally don't use `instanceof` // because it is fragile and can be easily faked with `Object.create()`. function isArray(ar) { @@ -522,166 +98,10 @@ function isPrimitive(arg) { exports.isPrimitive = isPrimitive; function isBuffer(arg) { - return arg instanceof Buffer; + return Buffer.isBuffer(arg); } exports.isBuffer = isBuffer; function objectToString(o) { return Object.prototype.toString.call(o); -} - - -function pad(n) { - return n < 10 ? '0' + n.toString(10) : n.toString(10); -} - - -var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', - 'Oct', 'Nov', 'Dec']; - -// 26 Feb 16:19:34 -function timestamp() { - var d = new Date(); - var time = [pad(d.getHours()), - pad(d.getMinutes()), - pad(d.getSeconds())].join(':'); - return [d.getDate(), months[d.getMonth()], time].join(' '); -} - - -// log is just a thin wrapper to console.log that prepends a timestamp -exports.log = function() { - console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); -}; - - -/** - * Inherit the prototype methods from one constructor into another. - * - * The Function.prototype.inherits from lang.js rewritten as a standalone - * function (not on Function.prototype). NOTE: If this file is to be loaded - * during bootstrapping this function needs to be rewritten using some native - * functions as prototype setup using normal JavaScript does not work as - * expected during bootstrapping (see mirror.js in r114903). - * - * @param {function} ctor Constructor function which needs to inherit the - * prototype. - * @param {function} superCtor Constructor function to inherit prototype from. - */ -exports.inherits = function(ctor, superCtor) { - ctor.super_ = superCtor; - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); -}; - -exports._extend = function(origin, add) { - // Don't do anything if add isn't an object - if (!add || !isObject(add)) return origin; - - var keys = Object.keys(add); - var i = keys.length; - while (i--) { - origin[keys[i]] = add[keys[i]]; - } - return origin; -}; - -function hasOwnProperty(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); -} - - -// Deprecated old stuff. - -exports.p = exports.deprecate(function() { - for (var i = 0, len = arguments.length; i < len; ++i) { - console.error(exports.inspect(arguments[i])); - } -}, 'util.p: Use console.error() instead'); - - -exports.exec = exports.deprecate(function() { - return require('child_process').exec.apply(this, arguments); -}, 'util.exec is now called `child_process.exec`.'); - - -exports.print = exports.deprecate(function() { - for (var i = 0, len = arguments.length; i < len; ++i) { - process.stdout.write(String(arguments[i])); - } -}, 'util.print: Use console.log instead'); - - -exports.puts = exports.deprecate(function() { - for (var i = 0, len = arguments.length; i < len; ++i) { - process.stdout.write(arguments[i] + '\n'); - } -}, 'util.puts: Use console.log instead'); - - -exports.debug = exports.deprecate(function(x) { - process.stderr.write('DEBUG: ' + x + '\n'); -}, 'util.debug: Use console.error instead'); - - -exports.error = exports.deprecate(function(x) { - for (var i = 0, len = arguments.length; i < len; ++i) { - process.stderr.write(arguments[i] + '\n'); - } -}, 'util.error: Use console.error instead'); - - -exports.pump = exports.deprecate(function(readStream, writeStream, callback) { - var callbackCalled = false; - - function call(a, b, c) { - if (callback && !callbackCalled) { - callback(a, b, c); - callbackCalled = true; - } - } - - readStream.addListener('data', function(chunk) { - if (writeStream.write(chunk) === false) readStream.pause(); - }); - - writeStream.addListener('drain', function() { - readStream.resume(); - }); - - readStream.addListener('end', function() { - writeStream.end(); - }); - - readStream.addListener('close', function() { - call(); - }); - - readStream.addListener('error', function(err) { - writeStream.end(); - call(err); - }); - - writeStream.addListener('error', function(err) { - readStream.destroy(); - call(err); - }); -}, 'util.pump(): Use readableStream.pipe() instead'); - - -var uv; -exports._errnoException = function(err, syscall) { - if (isUndefined(uv)) uv = process.binding('uv'); - var errname = uv.errname(err); - var e = new Error(syscall + ' ' + errname); - e.code = errname; - e.errno = errname; - e.syscall = syscall; - return e; -}; +}Copyright Node.js contributors. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "core-util-is", "version": "1.0.2", "description": "The `util.is*` functions introduced in Node v0.12.", "main": "lib/util.js", "repository": { "type": "git", "url": "git://github.com/isaacs/core-util-is" }, "keywords": [ "util", "isBuffer", "isArray", "isNumber", "isString", "isRegExp", "isThis", "isThat", "polyfill" ], "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "license": "MIT", "bugs": { "url": "https://github.com/isaacs/core-util-is/issues" }, "scripts": { "test": "tap test.js" }, "devDependencies": { "tap": "^2.3.0" } } var assert = require('tap'); var t = require('./lib/util'); assert.equal(t.isArray([]), true); assert.equal(t.isArray({}), false); assert.equal(t.isBoolean(null), false); assert.equal(t.isBoolean(true), true); assert.equal(t.isBoolean(false), true); assert.equal(t.isNull(null), true); assert.equal(t.isNull(undefined), false); assert.equal(t.isNull(false), false); assert.equal(t.isNull(), false); assert.equal(t.isNullOrUndefined(null), true); assert.equal(t.isNullOrUndefined(undefined), true); assert.equal(t.isNullOrUndefined(false), false); assert.equal(t.isNullOrUndefined(), true); assert.equal(t.isNumber(null), false); assert.equal(t.isNumber('1'), false); assert.equal(t.isNumber(1), true); assert.equal(t.isString(null), false); assert.equal(t.isString('1'), true); assert.equal(t.isString(1), false); assert.equal(t.isSymbol(null), false); assert.equal(t.isSymbol('1'), false); assert.equal(t.isSymbol(1), false); assert.equal(t.isSymbol(Symbol()), true); assert.equal(t.isUndefined(null), false); assert.equal(t.isUndefined(undefined), true); assert.equal(t.isUndefined(false), false); assert.equal(t.isUndefined(), true); assert.equal(t.isRegExp(null), false); assert.equal(t.isRegExp('1'), false); assert.equal(t.isRegExp(new RegExp()), true); assert.equal(t.isObject({}), true); assert.equal(t.isObject([]), true); assert.equal(t.isObject(new RegExp()), true); assert.equal(t.isObject(new Date()), true); assert.equal(t.isDate(null), false); assert.equal(t.isDate('1'), false); assert.equal(t.isDate(new Date()), true); assert.equal(t.isError(null), false); assert.equal(t.isError({ err: true }), false); assert.equal(t.isError(new Error()), true); assert.equal(t.isFunction(null), false); assert.equal(t.isFunction({ }), false); assert.equal(t.isFunction(function() {}), true); assert.equal(t.isPrimitive(null), true); assert.equal(t.isPrimitive(''), true); assert.equal(t.isPrimitive(0), true); assert.equal(t.isPrimitive(new Date()), false); assert.equal(t.isBuffer(null), false); assert.equal(t.isBuffer({}), false); assert.equal(t.isBuffer(new Buffer(0)), true); // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // NOTE: These type checking functions intentionally don't use `instanceof` // because it is fragile and can be easily faked with `Object.create()`. function isArray(arg) { if (Array.isArray) { return Array.isArray(arg); } return objectToString(arg) === '[object Array]'; } exports.isArray = isArray; function isBoolean(arg) { return typeof arg === 'boolean'; } exports.isBoolean = isBoolean; function isNull(arg) { return arg === null; } exports.isNull = isNull; function isNullOrUndefined(arg) { return arg == null; } exports.isNullOrUndefined = isNullOrUndefined; function isNumber(arg) { return typeof arg === 'number'; } exports.isNumber = isNumber; function isString(arg) { return typeof arg === 'string'; } exports.isString = isString; function isSymbol(arg) { return typeof arg === 'symbol'; } exports.isSymbol = isSymbol; function isUndefined(arg) { return arg === void 0; } exports.isUndefined = isUndefined; function isRegExp(re) { return objectToString(re) === '[object RegExp]'; } exports.isRegExp = isRegExp; function isObject(arg) { return typeof arg === 'object' && arg !== null; } exports.isObject = isObject; function isDate(d) { return objectToString(d) === '[object Date]'; } exports.isDate = isDate; function isError(e) { return (objectToString(e) === '[object Error]' || e instanceof Error); } exports.isError = isError; function isFunction(arg) { return typeof arg === 'function'; } exports.isFunction = isFunction; function isPrimitive(arg) { return arg === null || typeof arg === 'boolean' || typeof arg === 'number' || typeof arg === 'string' || typeof arg === 'symbol' || // ES6 symbol typeof arg === 'undefined'; } exports.isPrimitive = isPrimitive; exports.isBuffer = Buffer.isBuffer; function objectToString(o) { return Object.prototype.toString.call(o); } # 0.4.19 / 2017-09-09 * Fixed iso8859-1 codec regression in handling untranslatable characters (#162, caused by #147) * Re-generated windows1255 codec, because it was updated in iconv project * Fixed grammar in error message when iconv-lite is loaded with encoding other than utf8 # 0.4.18 / 2017-06-13 * Fixed CESU-8 regression in Node v8. # 0.4.17 / 2017-04-22 * Updated typescript definition file to support Angular 2 AoT mode (#153 by @larssn) # 0.4.16 / 2017-04-22 * Added support for React Native (#150) * Changed iso8859-1 encoding to usine internal 'binary' encoding, as it's the same thing (#147 by @mscdex) * Fixed typo in Readme (#138 by @jiangzhuo) * Fixed build for Node v6.10+ by making correct version comparison * Added a warning if iconv-lite is loaded not as utf-8 (see #142) # 0.4.15 / 2016-11-21 * Fixed typescript type definition (#137) # 0.4.14 / 2016-11-20 * Preparation for v1.0 * Added Node v6 and latest Node versions to Travis CI test rig * Deprecated Node v0.8 support * Typescript typings (@larssn) * Fix encoding of Euro character in GB 18030 (inspired by @lygstate) * Add ms prefix to dbcs windows encodings (@rokoroku) # 0.4.13 / 2015-10-01 * Fix silly mistake in deprecation notice. # 0.4.12 / 2015-09-26 * Node v4 support: * Added CESU-8 decoding (#106) * Added deprecation notice for `extendNodeEncodings` * Added Travis tests for Node v4 and io.js latest (#105 by @Mithgol) # 0.4.11 / 2015-07-03 * Added CESU-8 encoding. # 0.4.10 / 2015-05-26 * Changed UTF-16 endianness heuristic to take into account any ASCII chars, not just spaces. This should minimize the importance of "default" endianness. # 0.4.9 / 2015-05-24 * Streamlined BOM handling: strip BOM by default, add BOM when encoding if addBOM: true. Added docs to Readme. * UTF16 now uses UTF16-LE by default. * Fixed minor issue with big5 encoding. * Added io.js testing on Travis; updated node-iconv version to test against. Now we just skip testing SBCS encodings that node-iconv doesn't support. * (internal refactoring) Updated codec interface to use classes. * Use strict mode in all files. # 0.4.8 / 2015-04-14 * added alias UNICODE-1-1-UTF-7 for UTF-7 encoding (#94) # 0.4.7 / 2015-02-05 * stop official support of Node.js v0.8. Should still work, but no guarantees. reason: Packages needed for testing are hard to get on Travis CI. * work in environment where Object.prototype is monkey patched with enumerable props (#89). # 0.4.6 / 2015-01-12 * fix rare aliases of single-byte encodings (thanks @mscdex) * double the timeout for dbcs tests to make them less flaky on travis # 0.4.5 / 2014-11-20 * fix windows-31j and x-sjis encoding support (@nleush) * minor fix: undefined variable reference when internal error happens # 0.4.4 / 2014-07-16 * added encodings UTF-7 (RFC2152) and UTF-7-IMAP (RFC3501 Section 5.1.3) * fixed streaming base64 encoding # 0.4.3 / 2014-06-14 * added encodings UTF-16BE and UTF-16 with BOM # 0.4.2 / 2014-06-12 * don't throw exception if `extendNodeEncodings()` is called more than once # 0.4.1 / 2014-06-11 * codepage 808 added # 0.4.0 / 2014-06-10 * code is rewritten from scratch * all widespread encodings are supported * streaming interface added * browserify compatibility added * (optional) extend core primitive encodings to make usage even simpler * moved from vows to mocha as the testing framework Copyright (c) 2011 Alexander Shtuchkin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "iconv-lite", "description": "Convert character encodings in pure javascript.", "version": "0.4.19", "license": "MIT", "keywords": [ "iconv", "convert", "charset", "icu" ], "author": "Alexander Shtuchkin ", "contributors": [ "Jinwu Zhan (https://github.com/jenkinv)", "Adamansky Anton (https://github.com/adamansky)", "George Stagas (https://github.com/stagas)", "Mike D Pilsbury (https://github.com/pekim)", "Niggler (https://github.com/Niggler)", "wychi (https://github.com/wychi)", "David Kuo (https://github.com/david50407)", "ChangZhuo Chen (https://github.com/czchen)", "Lee Treveil (https://github.com/leetreveil)", "Brian White (https://github.com/mscdex)", "Mithgol (https://github.com/Mithgol)", "Nazar Leush (https://github.com/nleush)" ], "main": "./lib/index.js", "typings": "./lib/index.d.ts", "homepage": "https://github.com/ashtuchkin/iconv-lite", "bugs": "https://github.com/ashtuchkin/iconv-lite/issues", "repository": { "type": "git", "url": "git://github.com/ashtuchkin/iconv-lite.git" }, "engines": { "node": ">=0.10.0" }, "scripts": { "coverage": "istanbul cover _mocha -- --grep .", "coverage-open": "open coverage/lcov-report/index.html", "test": "mocha --reporter spec --grep ." }, "browser": { "./extend-node": false, "./streams": false }, "devDependencies": { "mocha": "*", "request": "*", "unorm": "*", "errto": "*", "async": "*", "istanbul": "*", "semver": "*", "iconv": "*" } } "use strict"; var Buffer = require("buffer").Buffer; // Multibyte codec. In this scheme, a character is represented by 1 or more bytes. // Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences. // To save memory and loading time, we read table files only when requested. exports._dbcs = DBCSCodec; var UNASSIGNED = -1, GB18030_CODE = -2, SEQ_START = -10, NODE_START = -1000, UNASSIGNED_NODE = new Array(0x100), DEF_CHAR = -1; for (var i = 0; i < 0x100; i++) UNASSIGNED_NODE[i] = UNASSIGNED; // Class DBCSCodec reads and initializes mapping tables. function DBCSCodec(codecOptions, iconv) { this.encodingName = codecOptions.encodingName; if (!codecOptions) throw new Error("DBCS codec is called without the data.") if (!codecOptions.table) throw new Error("Encoding '" + this.encodingName + "' has no data."); // Load tables. var mappingTable = codecOptions.table(); // Decode tables: MBCS -> Unicode. // decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256. // Trie root is decodeTables[0]. // Values: >= 0 -> unicode character code. can be > 0xFFFF // == UNASSIGNED -> unknown/unassigned sequence. // == GB18030_CODE -> this is the end of a GB18030 4-byte sequence. // <= NODE_START -> index of the next node in our trie to process next byte. // <= SEQ_START -> index of the start of a character code sequence, in decodeTableSeq. this.decodeTables = []; this.decodeTables[0] = UNASSIGNED_NODE.slice(0); // Create root node. // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here. this.decodeTableSeq = []; // Actual mapping tables consist of chunks. Use them to fill up decode tables. for (var i = 0; i < mappingTable.length; i++) this._addDecodeChunk(mappingTable[i]); this.defaultCharUnicode = iconv.defaultCharUnicode; // Encode tables: Unicode -> DBCS. // `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance. // Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null. // Values: >= 0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.). // == UNASSIGNED -> no conversion found. Output a default char. // <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence. this.encodeTable = []; // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key // means end of sequence (needed when one sequence is a strict subsequence of another). // Objects are kept separately from encodeTable to increase performance. this.encodeTableSeq = []; // Some chars can be decoded, but need not be encoded. var skipEncodeChars = {}; if (codecOptions.encodeSkipVals) for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) { var val = codecOptions.encodeSkipVals[i]; if (typeof val === 'number') skipEncodeChars[val] = true; else for (var j = val.from; j <= val.to; j++) skipEncodeChars[j] = true; } // Use decode trie to recursively fill out encode tables. this._fillEncodeTable(0, 0, skipEncodeChars); // Add more encoding pairs when needed. if (codecOptions.encodeAdd) { for (var uChar in codecOptions.encodeAdd) if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar)) this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]); } this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)]; if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]['?']; if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0); // Load & create GB18030 tables when needed. if (typeof codecOptions.gb18030 === 'function') { this.gb18030 = codecOptions.gb18030(); // Load GB18030 ranges. // Add GB18030 decode tables. var thirdByteNodeIdx = this.decodeTables.length; var thirdByteNode = this.decodeTables[thirdByteNodeIdx] = UNASSIGNED_NODE.slice(0); var fourthByteNodeIdx = this.decodeTables.length; var fourthByteNode = this.decodeTables[fourthByteNodeIdx] = UNASSIGNED_NODE.slice(0); for (var i = 0x81; i <= 0xFE; i++) { var secondByteNodeIdx = NODE_START - this.decodeTables[0][i]; var secondByteNode = this.decodeTables[secondByteNodeIdx]; for (var j = 0x30; j <= 0x39; j++) secondByteNode[j] = NODE_START - thirdByteNodeIdx; } for (var i = 0x81; i <= 0xFE; i++) thirdByteNode[i] = NODE_START - fourthByteNodeIdx; for (var i = 0x30; i <= 0x39; i++) fourthByteNode[i] = GB18030_CODE } } DBCSCodec.prototype.encoder = DBCSEncoder; DBCSCodec.prototype.decoder = DBCSDecoder; // Decoder helpers DBCSCodec.prototype._getDecodeTrieNode = function(addr) { var bytes = []; for (; addr > 0; addr >>= 8) bytes.push(addr & 0xFF); if (bytes.length == 0) bytes.push(0); var node = this.decodeTables[0]; for (var i = bytes.length-1; i > 0; i--) { // Traverse nodes deeper into the trie. var val = node[bytes[i]]; if (val == UNASSIGNED) { // Create new node. node[bytes[i]] = NODE_START - this.decodeTables.length; this.decodeTables.push(node = UNASSIGNED_NODE.slice(0)); } else if (val <= NODE_START) { // Existing node. node = this.decodeTables[NODE_START - val]; } else throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + addr.toString(16)); } return node; } DBCSCodec.prototype._addDecodeChunk = function(chunk) { // First element of chunk is the hex mbcs code where we start. var curAddr = parseInt(chunk[0], 16); // Choose the decoding node where we'll write our chars. var writeTable = this._getDecodeTrieNode(curAddr); curAddr = curAddr & 0xFF; // Write all other elements of the chunk to the table. for (var k = 1; k < chunk.length; k++) { var part = chunk[k]; if (typeof part === "string") { // String, write as-is. for (var l = 0; l < part.length;) { var code = part.charCodeAt(l++); if (0xD800 <= code && code < 0xDC00) { // Decode surrogate var codeTrail = part.charCodeAt(l++); if (0xDC00 <= codeTrail && codeTrail < 0xE000) writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00); else throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + chunk[0]); } else if (0x0FF0 < code && code <= 0x0FFF) { // Character sequence (our own encoding used) var len = 0xFFF - code + 2; var seq = []; for (var m = 0; m < len; m++) seq.push(part.charCodeAt(l++)); // Simple variation: don't support surrogates or subsequences in seq. writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length; this.decodeTableSeq.push(seq); } else writeTable[curAddr++] = code; // Basic char } } else if (typeof part === "number") { // Integer, meaning increasing sequence starting with prev character. var charCode = writeTable[curAddr - 1] + 1; for (var l = 0; l < part; l++) writeTable[curAddr++] = charCode++; } else throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]); } if (curAddr > 0xFF) throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr); } // Encoder helpers DBCSCodec.prototype._getEncodeBucket = function(uCode) { var high = uCode >> 8; // This could be > 0xFF because of astral characters. if (this.encodeTable[high] === undefined) this.encodeTable[high] = UNASSIGNED_NODE.slice(0); // Create bucket on demand. return this.encodeTable[high]; } DBCSCodec.prototype._setEncodeChar = function(uCode, dbcsCode) { var bucket = this._getEncodeBucket(uCode); var low = uCode & 0xFF; if (bucket[low] <= SEQ_START) this.encodeTableSeq[SEQ_START-bucket[low]][DEF_CHAR] = dbcsCode; // There's already a sequence, set a single-char subsequence of it. else if (bucket[low] == UNASSIGNED) bucket[low] = dbcsCode; } DBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) { // Get the root of character tree according to first character of the sequence. var uCode = seq[0]; var bucket = this._getEncodeBucket(uCode); var low = uCode & 0xFF; var node; if (bucket[low] <= SEQ_START) { // There's already a sequence with - use it. node = this.encodeTableSeq[SEQ_START-bucket[low]]; } else { // There was no sequence object - allocate a new one. node = {}; if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low]; // If a char was set before - make it a single-char subsequence. bucket[low] = SEQ_START - this.encodeTableSeq.length; this.encodeTableSeq.push(node); } // Traverse the character tree, allocating new nodes as needed. for (var j = 1; j < seq.length-1; j++) { var oldVal = node[uCode]; if (typeof oldVal === 'object') node = oldVal; else { node = node[uCode] = {} if (oldVal !== undefined) node[DEF_CHAR] = oldVal } } // Set the leaf to given dbcsCode. uCode = seq[seq.length-1]; node[uCode] = dbcsCode; } DBCSCodec.prototype._fillEncodeTable = function(nodeIdx, prefix, skipEncodeChars) { var node = this.decodeTables[nodeIdx]; for (var i = 0; i < 0x100; i++) { var uCode = node[i]; var mbCode = prefix + i; if (skipEncodeChars[mbCode]) continue; if (uCode >= 0) this._setEncodeChar(uCode, mbCode); else if (uCode <= NODE_START) this._fillEncodeTable(NODE_START - uCode, mbCode << 8, skipEncodeChars); else if (uCode <= SEQ_START) this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode); } } // == Encoder ================================================================== function DBCSEncoder(options, codec) { // Encoder state this.leadSurrogate = -1; this.seqObj = undefined; // Static data this.encodeTable = codec.encodeTable; this.encodeTableSeq = codec.encodeTableSeq; this.defaultCharSingleByte = codec.defCharSB; this.gb18030 = codec.gb18030; } DBCSEncoder.prototype.write = function(str) { var newBuf = new Buffer(str.length * (this.gb18030 ? 4 : 3)), leadSurrogate = this.leadSurrogate, seqObj = this.seqObj, nextChar = -1, i = 0, j = 0; while (true) { // 0. Get next character. if (nextChar === -1) { if (i == str.length) break; var uCode = str.charCodeAt(i++); } else { var uCode = nextChar; nextChar = -1; } // 1. Handle surrogates. if (0xD800 <= uCode && uCode < 0xE000) { // Char is one of surrogates. if (uCode < 0xDC00) { // We've got lead surrogate. if (leadSurrogate === -1) { leadSurrogate = uCode; continue; } else { leadSurrogate = uCode; // Double lead surrogate found. uCode = UNASSIGNED; } } else { // We've got trail surrogate. if (leadSurrogate !== -1) { uCode = 0x10000 + (leadSurrogate - 0xD800) * 0x400 + (uCode - 0xDC00); leadSurrogate = -1; } else { // Incomplete surrogate pair - only trail surrogate found. uCode = UNASSIGNED; } } } else if (leadSurrogate !== -1) { // Incomplete surrogate pair - only lead surrogate found. nextChar = uCode; uCode = UNASSIGNED; // Write an error, then current char. leadSurrogate = -1; } // 2. Convert uCode character. var dbcsCode = UNASSIGNED; if (seqObj !== undefined && uCode != UNASSIGNED) { // We are in the middle of the sequence var resCode = seqObj[uCode]; if (typeof resCode === 'object') { // Sequence continues. seqObj = resCode; continue; } else if (typeof resCode == 'number') { // Sequence finished. Write it. dbcsCode = resCode; } else if (resCode == undefined) { // Current character is not part of the sequence. // Try default character for this sequence resCode = seqObj[DEF_CHAR]; if (resCode !== undefined) { dbcsCode = resCode; // Found. Write it. nextChar = uCode; // Current character will be written too in the next iteration. } else { // TODO: What if we have no default? (resCode == undefined) // Then, we should write first char of the sequence as-is and try the rest recursively. // Didn't do it for now because no encoding has this situation yet. // Currently, just skip the sequence and write current char. } } seqObj = undefined; } else if (uCode >= 0) { // Regular character var subtable = this.encodeTable[uCode >> 8]; if (subtable !== undefined) dbcsCode = subtable[uCode & 0xFF]; if (dbcsCode <= SEQ_START) { // Sequence start seqObj = this.encodeTableSeq[SEQ_START-dbcsCode]; continue; } if (dbcsCode == UNASSIGNED && this.gb18030) { // Use GB18030 algorithm to find character(s) to write. var idx = findIdx(this.gb18030.uChars, uCode); if (idx != -1) { var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]); newBuf[j++] = 0x81 + Math.floor(dbcsCode / 12600); dbcsCode = dbcsCode % 12600; newBuf[j++] = 0x30 + Math.floor(dbcsCode / 1260); dbcsCode = dbcsCode % 1260; newBuf[j++] = 0x81 + Math.floor(dbcsCode / 10); dbcsCode = dbcsCode % 10; newBuf[j++] = 0x30 + dbcsCode; continue; } } } // 3. Write dbcsCode character. if (dbcsCode === UNASSIGNED) dbcsCode = this.defaultCharSingleByte; if (dbcsCode < 0x100) { newBuf[j++] = dbcsCode; } else if (dbcsCode < 0x10000) { newBuf[j++] = dbcsCode >> 8; // high byte newBuf[j++] = dbcsCode & 0xFF; // low byte } else { newBuf[j++] = dbcsCode >> 16; newBuf[j++] = (dbcsCode >> 8) & 0xFF; newBuf[j++] = dbcsCode & 0xFF; } } this.seqObj = seqObj; this.leadSurrogate = leadSurrogate; return newBuf.slice(0, j); } DBCSEncoder.prototype.end = function() { if (this.leadSurrogate === -1 && this.seqObj === undefined) return; // All clean. Most often case. var newBuf = new Buffer(10), j = 0; if (this.seqObj) { // We're in the sequence. var dbcsCode = this.seqObj[DEF_CHAR]; if (dbcsCode !== undefined) { // Write beginning of the sequence. if (dbcsCode < 0x100) { newBuf[j++] = dbcsCode; } else { newBuf[j++] = dbcsCode >> 8; // high byte newBuf[j++] = dbcsCode & 0xFF; // low byte } } else { // See todo above. } this.seqObj = undefined; } if (this.leadSurrogate !== -1) { // Incomplete surrogate pair - only lead surrogate found. newBuf[j++] = this.defaultCharSingleByte; this.leadSurrogate = -1; } return newBuf.slice(0, j); } // Export for testing DBCSEncoder.prototype.findIdx = findIdx; // == Decoder ================================================================== function DBCSDecoder(options, codec) { // Decoder state this.nodeIdx = 0; this.prevBuf = new Buffer(0); // Static data this.decodeTables = codec.decodeTables; this.decodeTableSeq = codec.decodeTableSeq; this.defaultCharUnicode = codec.defaultCharUnicode; this.gb18030 = codec.gb18030; } DBCSDecoder.prototype.write = function(buf) { var newBuf = new Buffer(buf.length*2), nodeIdx = this.nodeIdx, prevBuf = this.prevBuf, prevBufOffset = this.prevBuf.length, seqStart = -this.prevBuf.length, // idx of the start of current parsed sequence. uCode; if (prevBufOffset > 0) // Make prev buf overlap a little to make it easier to slice later. prevBuf = Buffer.concat([prevBuf, buf.slice(0, 10)]); for (var i = 0, j = 0; i < buf.length; i++) { var curByte = (i >= 0) ? buf[i] : prevBuf[i + prevBufOffset]; // Lookup in current trie node. var uCode = this.decodeTables[nodeIdx][curByte]; if (uCode >= 0) { // Normal character, just use it. } else if (uCode === UNASSIGNED) { // Unknown char. // TODO: Callback with seq. //var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset); i = seqStart; // Try to parse again, after skipping first byte of the sequence ('i' will be incremented by 'for' cycle). uCode = this.defaultCharUnicode.charCodeAt(0); } else if (uCode === GB18030_CODE) { var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset); var ptr = (curSeq[0]-0x81)*12600 + (curSeq[1]-0x30)*1260 + (curSeq[2]-0x81)*10 + (curSeq[3]-0x30); var idx = findIdx(this.gb18030.gbChars, ptr); uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx]; } else if (uCode <= NODE_START) { // Go to next trie node. nodeIdx = NODE_START - uCode; continue; } else if (uCode <= SEQ_START) { // Output a sequence of chars. var seq = this.decodeTableSeq[SEQ_START - uCode]; for (var k = 0; k < seq.length - 1; k++) { uCode = seq[k]; newBuf[j++] = uCode & 0xFF; newBuf[j++] = uCode >> 8; } uCode = seq[seq.length-1]; } else throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte); // Write the character to buffer, handling higher planes using surrogate pair. if (uCode > 0xFFFF) { uCode -= 0x10000; var uCodeLead = 0xD800 + Math.floor(uCode / 0x400); newBuf[j++] = uCodeLead & 0xFF; newBuf[j++] = uCodeLead >> 8; uCode = 0xDC00 + uCode % 0x400; } newBuf[j++] = uCode & 0xFF; newBuf[j++] = uCode >> 8; // Reset trie node. nodeIdx = 0; seqStart = i+1; } this.nodeIdx = nodeIdx; this.prevBuf = (seqStart >= 0) ? buf.slice(seqStart) : prevBuf.slice(seqStart + prevBufOffset); return newBuf.slice(0, j).toString('ucs2'); } DBCSDecoder.prototype.end = function() { var ret = ''; // Try to parse all remaining chars. while (this.prevBuf.length > 0) { // Skip 1 character in the buffer. ret += this.defaultCharUnicode; var buf = this.prevBuf.slice(1); // Parse remaining as usual. this.prevBuf = new Buffer(0); this.nodeIdx = 0; if (buf.length > 0) ret += this.write(buf); } this.nodeIdx = 0; return ret; } // Binary search for GB18030. Returns largest i such that table[i] <= val. function findIdx(table, val) { if (table[0] > val) return -1; var l = 0, r = table.length; while (l < r-1) { // always table[l] <= val < table[r] var mid = l + Math.floor((r-l+1)/2); if (table[mid] <= val) l = mid; else r = mid; } return l; } "use strict"; // Description of supported double byte encodings and aliases. // Tables are not require()-d until they are needed to speed up library load. // require()-s are direct to support Browserify. module.exports = { // == Japanese/ShiftJIS ==================================================== // All japanese encodings are based on JIS X set of standards: // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF. // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. // Has several variations in 1978, 1983, 1990 and 1997. // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead. // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233. // 2 planes, first is superset of 0208, second - revised 0212. // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx) // Byte encodings are: // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC. // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI. // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes. // 0x00-0x7F - lower part of 0201 // 0x8E, 0xA1-0xDF - upper part of 0201 // (0xA1-0xFE)x2 - 0208 plane (94x94). // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94). // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon. // Used as-is in ISO2022 family. // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, // 0201-1976 Roman, 0208-1978, 0208-1983. // * ISO2022-JP-1: Adds esc seq for 0212-1990. // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7. // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2. // * ISO2022-JP-2004: Adds 0213-2004 Plane 1. // // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes. // // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html 'shiftjis': { type: '_dbcs', table: function() { return require('./tables/shiftjis.json') }, encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, encodeSkipVals: [{from: 0xED40, to: 0xF940}], }, 'csshiftjis': 'shiftjis', 'mskanji': 'shiftjis', 'sjis': 'shiftjis', 'windows31j': 'shiftjis', 'ms31j': 'shiftjis', 'xsjis': 'shiftjis', 'windows932': 'shiftjis', 'ms932': 'shiftjis', '932': 'shiftjis', 'cp932': 'shiftjis', 'eucjp': { type: '_dbcs', table: function() { return require('./tables/eucjp.json') }, encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, }, // TODO: KDDI extension to Shift_JIS // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes. // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars. // == Chinese/GBK ========================================================== // http://en.wikipedia.org/wiki/GBK // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936 'gb2312': 'cp936', 'gb231280': 'cp936', 'gb23121980': 'cp936', 'csgb2312': 'cp936', 'csiso58gb231280': 'cp936', 'euccn': 'cp936', // Microsoft's CP936 is a subset and approximation of GBK. 'windows936': 'cp936', 'ms936': 'cp936', '936': 'cp936', 'cp936': { type: '_dbcs', table: function() { return require('./tables/cp936.json') }, }, // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other. 'gbk': { type: '_dbcs', table: function() { return require('./tables/cp936.json').concat(require('./tables/gbk-added.json')) }, }, 'xgbk': 'gbk', 'isoir58': 'gbk', // GB18030 is an algorithmic extension of GBK. // Main source: https://www.w3.org/TR/encoding/#gbk-encoder // http://icu-project.org/docs/papers/gb18030.html // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0 'gb18030': { type: '_dbcs', table: function() { return require('./tables/cp936.json').concat(require('./tables/gbk-added.json')) }, gb18030: function() { return require('./tables/gb18030-ranges.json') }, encodeSkipVals: [0x80], encodeAdd: {'€': 0xA2E3}, }, 'chinese': 'gb18030', // == Korean =============================================================== // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same. 'windows949': 'cp949', 'ms949': 'cp949', '949': 'cp949', 'cp949': { type: '_dbcs', table: function() { return require('./tables/cp949.json') }, }, 'cseuckr': 'cp949', 'csksc56011987': 'cp949', 'euckr': 'cp949', 'isoir149': 'cp949', 'korean': 'cp949', 'ksc56011987': 'cp949', 'ksc56011989': 'cp949', 'ksc5601': 'cp949', // == Big5/Taiwan/Hong Kong ================================================ // There are lots of tables for Big5 and cp950. Please see the following links for history: // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html // Variations, in roughly number of defined chars: // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/ // * Big5-2003 (Taiwan standard) almost superset of cp950. // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers. // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years. // Plus, it has 4 combining sequences. // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299 // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way. // Implementations are not consistent within browsers; sometimes labeled as just big5. // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied. // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31 // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s. // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt // // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong. 'windows950': 'cp950', 'ms950': 'cp950', '950': 'cp950', 'cp950': { type: '_dbcs', table: function() { return require('./tables/cp950.json') }, }, // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus. 'big5': 'big5hkscs', 'big5hkscs': { type: '_dbcs', table: function() { return require('./tables/cp950.json').concat(require('./tables/big5-added.json')) }, encodeSkipVals: [0xa2cc], }, 'cnbig5': 'big5hkscs', 'csbig5': 'big5hkscs', 'xxbig5': 'big5hkscs', }; "use strict"; // Update this array if you add/rename/remove files in this directory. // We support Browserify by skipping automatic module discovery and requiring modules directly. var modules = [ require("./internal"), require("./utf16"), require("./utf7"), require("./sbcs-codec"), require("./sbcs-data"), require("./sbcs-data-generated"), require("./dbcs-codec"), require("./dbcs-data"), ]; // Put all encoding/alias/codec definitions to single object and export it. for (var i = 0; i < modules.length; i++) { var module = modules[i]; for (var enc in module) if (Object.prototype.hasOwnProperty.call(module, enc)) exports[enc] = module[enc]; } "use strict"; var Buffer = require("buffer").Buffer; // Export Node.js internal encodings. module.exports = { // Encodings utf8: { type: "_internal", bomAware: true}, cesu8: { type: "_internal", bomAware: true}, unicode11utf8: "utf8", ucs2: { type: "_internal", bomAware: true}, utf16le: "ucs2", binary: { type: "_internal" }, base64: { type: "_internal" }, hex: { type: "_internal" }, // Codec. _internal: InternalCodec, }; //------------------------------------------------------------------------------ function InternalCodec(codecOptions, iconv) { this.enc = codecOptions.encodingName; this.bomAware = codecOptions.bomAware; if (this.enc === "base64") this.encoder = InternalEncoderBase64; else if (this.enc === "cesu8") { this.enc = "utf8"; // Use utf8 for decoding. this.encoder = InternalEncoderCesu8; // Add decoder for versions of Node not supporting CESU-8 if (new Buffer('eda0bdedb2a9', 'hex').toString() !== '💩') { this.decoder = InternalDecoderCesu8; this.defaultCharUnicode = iconv.defaultCharUnicode; } } } InternalCodec.prototype.encoder = InternalEncoder; InternalCodec.prototype.decoder = InternalDecoder; //------------------------------------------------------------------------------ // We use node.js internal decoder. Its signature is the same as ours. var StringDecoder = require('string_decoder').StringDecoder; if (!StringDecoder.prototype.end) // Node v0.8 doesn't have this method. StringDecoder.prototype.end = function() {}; function InternalDecoder(options, codec) { StringDecoder.call(this, codec.enc); } InternalDecoder.prototype = StringDecoder.prototype; //------------------------------------------------------------------------------ // Encoder is mostly trivial function InternalEncoder(options, codec) { this.enc = codec.enc; } InternalEncoder.prototype.write = function(str) { return new Buffer(str, this.enc); } InternalEncoder.prototype.end = function() { } //------------------------------------------------------------------------------ // Except base64 encoder, which must keep its state. function InternalEncoderBase64(options, codec) { this.prevStr = ''; } InternalEncoderBase64.prototype.write = function(str) { str = this.prevStr + str; var completeQuads = str.length - (str.length % 4); this.prevStr = str.slice(completeQuads); str = str.slice(0, completeQuads); return new Buffer(str, "base64"); } InternalEncoderBase64.prototype.end = function() { return new Buffer(this.prevStr, "base64"); } //------------------------------------------------------------------------------ // CESU-8 encoder is also special. function InternalEncoderCesu8(options, codec) { } InternalEncoderCesu8.prototype.write = function(str) { var buf = new Buffer(str.length * 3), bufIdx = 0; for (var i = 0; i < str.length; i++) { var charCode = str.charCodeAt(i); // Naive implementation, but it works because CESU-8 is especially easy // to convert from UTF-16 (which all JS strings are encoded in). if (charCode < 0x80) buf[bufIdx++] = charCode; else if (charCode < 0x800) { buf[bufIdx++] = 0xC0 + (charCode >>> 6); buf[bufIdx++] = 0x80 + (charCode & 0x3f); } else { // charCode will always be < 0x10000 in javascript. buf[bufIdx++] = 0xE0 + (charCode >>> 12); buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f); buf[bufIdx++] = 0x80 + (charCode & 0x3f); } } return buf.slice(0, bufIdx); } InternalEncoderCesu8.prototype.end = function() { } //------------------------------------------------------------------------------ // CESU-8 decoder is not implemented in Node v4.0+ function InternalDecoderCesu8(options, codec) { this.acc = 0; this.contBytes = 0; this.accBytes = 0; this.defaultCharUnicode = codec.defaultCharUnicode; } InternalDecoderCesu8.prototype.write = function(buf) { var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes, res = ''; for (var i = 0; i < buf.length; i++) { var curByte = buf[i]; if ((curByte & 0xC0) !== 0x80) { // Leading byte if (contBytes > 0) { // Previous code is invalid res += this.defaultCharUnicode; contBytes = 0; } if (curByte < 0x80) { // Single-byte code res += String.fromCharCode(curByte); } else if (curByte < 0xE0) { // Two-byte code acc = curByte & 0x1F; contBytes = 1; accBytes = 1; } else if (curByte < 0xF0) { // Three-byte code acc = curByte & 0x0F; contBytes = 2; accBytes = 1; } else { // Four or more are not supported for CESU-8. res += this.defaultCharUnicode; } } else { // Continuation byte if (contBytes > 0) { // We're waiting for it. acc = (acc << 6) | (curByte & 0x3f); contBytes--; accBytes++; if (contBytes === 0) { // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80) if (accBytes === 2 && acc < 0x80 && acc > 0) res += this.defaultCharUnicode; else if (accBytes === 3 && acc < 0x800) res += this.defaultCharUnicode; else // Actually add character. res += String.fromCharCode(acc); } } else { // Unexpected continuation byte res += this.defaultCharUnicode; } } } this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes; return res; } InternalDecoderCesu8.prototype.end = function() { var res = 0; if (this.contBytes > 0) res += this.defaultCharUnicode; return res; } "use strict"; var Buffer = require("buffer").Buffer; // Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that // correspond to encoded bytes (if 128 - then lower half is ASCII). exports._sbcs = SBCSCodec; function SBCSCodec(codecOptions, iconv) { if (!codecOptions) throw new Error("SBCS codec is called without the data.") // Prepare char buffer for decoding. if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256)) throw new Error("Encoding '"+codecOptions.type+"' has incorrect 'chars' (must be of len 128 or 256)"); if (codecOptions.chars.length === 128) { var asciiString = ""; for (var i = 0; i < 128; i++) asciiString += String.fromCharCode(i); codecOptions.chars = asciiString + codecOptions.chars; } this.decodeBuf = new Buffer(codecOptions.chars, 'ucs2'); // Encoding buffer. var encodeBuf = new Buffer(65536); encodeBuf.fill(iconv.defaultCharSingleByte.charCodeAt(0)); for (var i = 0; i < codecOptions.chars.length; i++) encodeBuf[codecOptions.chars.charCodeAt(i)] = i; this.encodeBuf = encodeBuf; } SBCSCodec.prototype.encoder = SBCSEncoder; SBCSCodec.prototype.decoder = SBCSDecoder; function SBCSEncoder(options, codec) { this.encodeBuf = codec.encodeBuf; } SBCSEncoder.prototype.write = function(str) { var buf = new Buffer(str.length); for (var i = 0; i < str.length; i++) buf[i] = this.encodeBuf[str.charCodeAt(i)]; return buf; } SBCSEncoder.prototype.end = function() { } function SBCSDecoder(options, codec) { this.decodeBuf = codec.decodeBuf; } SBCSDecoder.prototype.write = function(buf) { // Strings are immutable in JS -> we use ucs2 buffer to speed up computations. var decodeBuf = this.decodeBuf; var newBuf = new Buffer(buf.length*2); var idx1 = 0, idx2 = 0; for (var i = 0; i < buf.length; i++) { idx1 = buf[i]*2; idx2 = i*2; newBuf[idx2] = decodeBuf[idx1]; newBuf[idx2+1] = decodeBuf[idx1+1]; } return newBuf.toString('ucs2'); } SBCSDecoder.prototype.end = function() { } "use strict"; // Generated data for sbcs codec. Don't edit manually. Regenerate using generation/gen-sbcs.js script. module.exports = { "437": "cp437", "737": "cp737", "775": "cp775", "850": "cp850", "852": "cp852", "855": "cp855", "856": "cp856", "857": "cp857", "858": "cp858", "860": "cp860", "861": "cp861", "862": "cp862", "863": "cp863", "864": "cp864", "865": "cp865", "866": "cp866", "869": "cp869", "874": "windows874", "922": "cp922", "1046": "cp1046", "1124": "cp1124", "1125": "cp1125", "1129": "cp1129", "1133": "cp1133", "1161": "cp1161", "1162": "cp1162", "1163": "cp1163", "1250": "windows1250", "1251": "windows1251", "1252": "windows1252", "1253": "windows1253", "1254": "windows1254", "1255": "windows1255", "1256": "windows1256", "1257": "windows1257", "1258": "windows1258", "28591": "iso88591", "28592": "iso88592", "28593": "iso88593", "28594": "iso88594", "28595": "iso88595", "28596": "iso88596", "28597": "iso88597", "28598": "iso88598", "28599": "iso88599", "28600": "iso885910", "28601": "iso885911", "28603": "iso885913", "28604": "iso885914", "28605": "iso885915", "28606": "iso885916", "windows874": { "type": "_sbcs", "chars": "€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" }, "win874": "windows874", "cp874": "windows874", "windows1250": { "type": "_sbcs", "chars": "€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" }, "win1250": "windows1250", "cp1250": "windows1250", "windows1251": { "type": "_sbcs", "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" }, "win1251": "windows1251", "cp1251": "windows1251", "windows1252": { "type": "_sbcs", "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, "win1252": "windows1252", "cp1252": "windows1252", "windows1253": { "type": "_sbcs", "chars": "€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" }, "win1253": "windows1253", "cp1253": "windows1253", "windows1254": { "type": "_sbcs", "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" }, "win1254": "windows1254", "cp1254": "windows1254", "windows1255": { "type": "_sbcs", "chars": "€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" }, "win1255": "windows1255", "cp1255": "windows1255", "windows1256": { "type": "_sbcs", "chars": "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے" }, "win1256": "windows1256", "cp1256": "windows1256", "windows1257": { "type": "_sbcs", "chars": "€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙" }, "win1257": "windows1257", "cp1257": "windows1257", "windows1258": { "type": "_sbcs", "chars": "€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" }, "win1258": "windows1258", "cp1258": "windows1258", "iso88591": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, "cp28591": "iso88591", "iso88592": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" }, "cp28592": "iso88592", "iso88593": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�ݰħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙" }, "cp28593": "iso88593", "iso88594": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤Ĩϧ¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩšēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖרŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙" }, "cp28594": "iso88594", "iso88595": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ" }, "cp28595": "iso88595", "iso88596": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������" }, "cp28596": "iso88596", "iso88597": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" }, "cp28597": "iso88597", "iso88598": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" }, "cp28598": "iso88598", "iso88599": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" }, "cp28599": "iso88599", "iso885910": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨͧĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ" }, "cp28600": "iso885910", "iso885911": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" }, "cp28601": "iso885911", "iso885913": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’" }, "cp28603": "iso885913", "iso885914": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ" }, "cp28604": "iso885914", "iso885915": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, "cp28605": "iso885915", "iso885916": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Чš©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ" }, "cp28606": "iso885916", "cp437": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm437": "cp437", "csibm437": "cp437", "cp737": { "type": "_sbcs", "chars": "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ " }, "ibm737": "cp737", "csibm737": "cp737", "cp775": { "type": "_sbcs", "chars": "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£Ø×¤ĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ " }, "ibm775": "cp775", "csibm775": "cp775", "cp850": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " }, "ibm850": "cp850", "csibm850": "cp850", "cp852": { "type": "_sbcs", "chars": "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ " }, "ibm852": "cp852", "csibm852": "cp852", "cp855": { "type": "_sbcs", "chars": "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ " }, "ibm855": "cp855", "csibm855": "cp855", "cp856": { "type": "_sbcs", "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ " }, "ibm856": "cp856", "csibm856": "cp856", "cp857": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ " }, "ibm857": "cp857", "csibm857": "cp857", "cp858": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " }, "ibm858": "cp858", "csibm858": "cp858", "cp860": { "type": "_sbcs", "chars": "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm860": "cp860", "csibm860": "cp860", "cp861": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm861": "cp861", "csibm861": "cp861", "cp862": { "type": "_sbcs", "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm862": "cp862", "csibm862": "cp862", "cp863": { "type": "_sbcs", "chars": "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm863": "cp863", "csibm863": "cp863", "cp864": { "type": "_sbcs", "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�" }, "ibm864": "cp864", "csibm864": "cp864", "cp865": { "type": "_sbcs", "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, "ibm865": "cp865", "csibm865": "cp865", "cp866": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ " }, "ibm866": "cp866", "csibm866": "cp866", "cp869": { "type": "_sbcs", "chars": "������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ " }, "ibm869": "cp869", "csibm869": "cp869", "cp922": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ" }, "ibm922": "cp922", "csibm922": "cp922", "cp1046": { "type": "_sbcs", "chars": "ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�" }, "ibm1046": "cp1046", "csibm1046": "cp1046", "cp1124": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ" }, "ibm1124": "cp1124", "csibm1124": "cp1124", "cp1125": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ " }, "ibm1125": "cp1125", "csibm1125": "cp1125", "cp1129": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" }, "ibm1129": "cp1129", "csibm1129": "cp1129", "cp1133": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�" }, "ibm1133": "cp1133", "csibm1133": "cp1133", "cp1161": { "type": "_sbcs", "chars": "��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ " }, "ibm1161": "cp1161", "csibm1161": "cp1161", "cp1162": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" }, "ibm1162": "cp1162", "csibm1162": "cp1162", "cp1163": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" }, "ibm1163": "cp1163", "csibm1163": "cp1163", "maccroatian": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ" }, "maccyrillic": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" }, "macgreek": { "type": "_sbcs", "chars": "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�" }, "maciceland": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" }, "macroman": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" }, "macromania": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" }, "macthai": { "type": "_sbcs", "chars": "«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����" }, "macturkish": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ" }, "macukraine": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" }, "koi8r": { "type": "_sbcs", "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" }, "koi8u": { "type": "_sbcs", "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" }, "koi8ru": { "type": "_sbcs", "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" }, "koi8t": { "type": "_sbcs", "chars": "қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" }, "armscii8": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�" }, "rk1048": { "type": "_sbcs", "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" }, "tcvn": { "type": "_sbcs", "chars": "\u0000ÚỤ\u0003ỪỬỮ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010ỨỰỲỶỸÝỴ\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ" }, "georgianacademy": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, "georgianps": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, "pt154": { "type": "_sbcs", "chars": "ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" }, "viscii": { "type": "_sbcs", "chars": "\u0000\u0001Ẳ\u0003\u0004ẴẪ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013Ỷ\u0015\u0016\u0017\u0018Ỹ\u001a\u001b\u001c\u001dỴ\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ" }, "iso646cn": { "type": "_sbcs", "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" }, "iso646jp": { "type": "_sbcs", "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" }, "hproman8": { "type": "_sbcs", "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�" }, "macintosh": { "type": "_sbcs", "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" }, "ascii": { "type": "_sbcs", "chars": "��������������������������������������������������������������������������������������������������������������������������������" }, "tis620": { "type": "_sbcs", "chars": "���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" } }"use strict"; // Manually added data to be used by sbcs codec in addition to generated one. module.exports = { // Not supported by iconv, not sure why. "10029": "maccenteuro", "maccenteuro": { "type": "_sbcs", "chars": "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ" }, "808": "cp808", "ibm808": "cp808", "cp808": { "type": "_sbcs", "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ " }, // Aliases of generated encodings. "ascii8bit": "ascii", "usascii": "ascii", "ansix34": "ascii", "ansix341968": "ascii", "ansix341986": "ascii", "csascii": "ascii", "cp367": "ascii", "ibm367": "ascii", "isoir6": "ascii", "iso646us": "ascii", "iso646irv": "ascii", "us": "ascii", "latin1": "iso88591", "latin2": "iso88592", "latin3": "iso88593", "latin4": "iso88594", "latin5": "iso88599", "latin6": "iso885910", "latin7": "iso885913", "latin8": "iso885914", "latin9": "iso885915", "latin10": "iso885916", "csisolatin1": "iso88591", "csisolatin2": "iso88592", "csisolatin3": "iso88593", "csisolatin4": "iso88594", "csisolatincyrillic": "iso88595", "csisolatinarabic": "iso88596", "csisolatingreek" : "iso88597", "csisolatinhebrew": "iso88598", "csisolatin5": "iso88599", "csisolatin6": "iso885910", "l1": "iso88591", "l2": "iso88592", "l3": "iso88593", "l4": "iso88594", "l5": "iso88599", "l6": "iso885910", "l7": "iso885913", "l8": "iso885914", "l9": "iso885915", "l10": "iso885916", "isoir14": "iso646jp", "isoir57": "iso646cn", "isoir100": "iso88591", "isoir101": "iso88592", "isoir109": "iso88593", "isoir110": "iso88594", "isoir144": "iso88595", "isoir127": "iso88596", "isoir126": "iso88597", "isoir138": "iso88598", "isoir148": "iso88599", "isoir157": "iso885910", "isoir166": "tis620", "isoir179": "iso885913", "isoir199": "iso885914", "isoir203": "iso885915", "isoir226": "iso885916", "cp819": "iso88591", "ibm819": "iso88591", "cyrillic": "iso88595", "arabic": "iso88596", "arabic8": "iso88596", "ecma114": "iso88596", "asmo708": "iso88596", "greek" : "iso88597", "greek8" : "iso88597", "ecma118" : "iso88597", "elot928" : "iso88597", "hebrew": "iso88598", "hebrew8": "iso88598", "turkish": "iso88599", "turkish8": "iso88599", "thai": "iso885911", "thai8": "iso885911", "celtic": "iso885914", "celtic8": "iso885914", "isoceltic": "iso885914", "tis6200": "tis620", "tis62025291": "tis620", "tis62025330": "tis620", "10000": "macroman", "10006": "macgreek", "10007": "maccyrillic", "10079": "maciceland", "10081": "macturkish", "cspc8codepage437": "cp437", "cspc775baltic": "cp775", "cspc850multilingual": "cp850", "cspcp852": "cp852", "cspc862latinhebrew": "cp862", "cpgr": "cp869", "msee": "cp1250", "mscyrl": "cp1251", "msansi": "cp1252", "msgreek": "cp1253", "msturk": "cp1254", "mshebr": "cp1255", "msarab": "cp1256", "winbaltrim": "cp1257", "cp20866": "koi8r", "20866": "koi8r", "ibm878": "koi8r", "cskoi8r": "koi8r", "cp21866": "koi8u", "21866": "koi8u", "ibm1168": "koi8u", "strk10482002": "rk1048", "tcvn5712": "tcvn", "tcvn57121": "tcvn", "gb198880": "iso646cn", "cn": "iso646cn", "csiso14jisc6220ro": "iso646jp", "jisc62201969ro": "iso646jp", "jp": "iso646jp", "cshproman8": "hproman8", "r8": "hproman8", "roman8": "hproman8", "xroman8": "hproman8", "ibm1051": "hproman8", "mac": "macintosh", "csmacintosh": "macintosh", }; "use strict"; var Buffer = require("buffer").Buffer; // Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js // == UTF16-BE codec. ========================================================== exports.utf16be = Utf16BECodec; function Utf16BECodec() { } Utf16BECodec.prototype.encoder = Utf16BEEncoder; Utf16BECodec.prototype.decoder = Utf16BEDecoder; Utf16BECodec.prototype.bomAware = true; // -- Encoding function Utf16BEEncoder() { } Utf16BEEncoder.prototype.write = function(str) { var buf = new Buffer(str, 'ucs2'); for (var i = 0; i < buf.length; i += 2) { var tmp = buf[i]; buf[i] = buf[i+1]; buf[i+1] = tmp; } return buf; } Utf16BEEncoder.prototype.end = function() { } // -- Decoding function Utf16BEDecoder() { this.overflowByte = -1; } Utf16BEDecoder.prototype.write = function(buf) { if (buf.length == 0) return ''; var buf2 = new Buffer(buf.length + 1), i = 0, j = 0; if (this.overflowByte !== -1) { buf2[0] = buf[0]; buf2[1] = this.overflowByte; i = 1; j = 2; } for (; i < buf.length-1; i += 2, j+= 2) { buf2[j] = buf[i+1]; buf2[j+1] = buf[i]; } this.overflowByte = (i == buf.length-1) ? buf[buf.length-1] : -1; return buf2.slice(0, j).toString('ucs2'); } Utf16BEDecoder.prototype.end = function() { } // == UTF-16 codec ============================================================= // Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic. // Defaults to UTF-16LE, as it's prevalent and default in Node. // http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le // Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'}); // Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false). exports.utf16 = Utf16Codec; function Utf16Codec(codecOptions, iconv) { this.iconv = iconv; } Utf16Codec.prototype.encoder = Utf16Encoder; Utf16Codec.prototype.decoder = Utf16Decoder; // -- Encoding (pass-through) function Utf16Encoder(options, codec) { options = options || {}; if (options.addBOM === undefined) options.addBOM = true; this.encoder = codec.iconv.getEncoder('utf-16le', options); } Utf16Encoder.prototype.write = function(str) { return this.encoder.write(str); } Utf16Encoder.prototype.end = function() { return this.encoder.end(); } // -- Decoding function Utf16Decoder(options, codec) { this.decoder = null; this.initialBytes = []; this.initialBytesLen = 0; this.options = options || {}; this.iconv = codec.iconv; } Utf16Decoder.prototype.write = function(buf) { if (!this.decoder) { // Codec is not chosen yet. Accumulate initial bytes. this.initialBytes.push(buf); this.initialBytesLen += buf.length; if (this.initialBytesLen < 16) // We need more bytes to use space heuristic (see below) return ''; // We have enough bytes -> detect endianness. var buf = Buffer.concat(this.initialBytes), encoding = detectEncoding(buf, this.options.defaultEncoding); this.decoder = this.iconv.getDecoder(encoding, this.options); this.initialBytes.length = this.initialBytesLen = 0; } return this.decoder.write(buf); } Utf16Decoder.prototype.end = function() { if (!this.decoder) { var buf = Buffer.concat(this.initialBytes), encoding = detectEncoding(buf, this.options.defaultEncoding); this.decoder = this.iconv.getDecoder(encoding, this.options); var res = this.decoder.write(buf), trail = this.decoder.end(); return trail ? (res + trail) : res; } return this.decoder.end(); } function detectEncoding(buf, defaultEncoding) { var enc = defaultEncoding || 'utf-16le'; if (buf.length >= 2) { // Check BOM. if (buf[0] == 0xFE && buf[1] == 0xFF) // UTF-16BE BOM enc = 'utf-16be'; else if (buf[0] == 0xFF && buf[1] == 0xFE) // UTF-16LE BOM enc = 'utf-16le'; else { // No BOM found. Try to deduce encoding from initial content. // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon. // So, we count ASCII as if it was LE or BE, and decide from that. var asciiCharsLE = 0, asciiCharsBE = 0, // Counts of chars in both positions _len = Math.min(buf.length - (buf.length % 2), 64); // Len is always even. for (var i = 0; i < _len; i += 2) { if (buf[i] === 0 && buf[i+1] !== 0) asciiCharsBE++; if (buf[i] !== 0 && buf[i+1] === 0) asciiCharsLE++; } if (asciiCharsBE > asciiCharsLE) enc = 'utf-16be'; else if (asciiCharsBE < asciiCharsLE) enc = 'utf-16le'; } } return enc; } "use strict"; var Buffer = require("buffer").Buffer; // UTF-7 codec, according to https://tools.ietf.org/html/rfc2152 // See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3 exports.utf7 = Utf7Codec; exports.unicode11utf7 = 'utf7'; // Alias UNICODE-1-1-UTF-7 function Utf7Codec(codecOptions, iconv) { this.iconv = iconv; }; Utf7Codec.prototype.encoder = Utf7Encoder; Utf7Codec.prototype.decoder = Utf7Decoder; Utf7Codec.prototype.bomAware = true; // -- Encoding var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g; function Utf7Encoder(options, codec) { this.iconv = codec.iconv; } Utf7Encoder.prototype.write = function(str) { // Naive implementation. // Non-direct chars are encoded as "+-"; single "+" char is encoded as "+-". return new Buffer(str.replace(nonDirectChars, function(chunk) { return "+" + (chunk === '+' ? '' : this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, '')) + "-"; }.bind(this))); } Utf7Encoder.prototype.end = function() { } // -- Decoding function Utf7Decoder(options, codec) { this.iconv = codec.iconv; this.inBase64 = false; this.base64Accum = ''; } var base64Regex = /[A-Za-z0-9\/+]/; var base64Chars = []; for (var i = 0; i < 256; i++) base64Chars[i] = base64Regex.test(String.fromCharCode(i)); var plusChar = '+'.charCodeAt(0), minusChar = '-'.charCodeAt(0), andChar = '&'.charCodeAt(0); Utf7Decoder.prototype.write = function(buf) { var res = "", lastI = 0, inBase64 = this.inBase64, base64Accum = this.base64Accum; // The decoder is more involved as we must handle chunks in stream. for (var i = 0; i < buf.length; i++) { if (!inBase64) { // We're in direct mode. // Write direct chars until '+' if (buf[i] == plusChar) { res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. lastI = i+1; inBase64 = true; } } else { // We decode base64. if (!base64Chars[buf[i]]) { // Base64 ended. if (i == lastI && buf[i] == minusChar) {// "+-" -> "+" res += "+"; } else { var b64str = base64Accum + buf.slice(lastI, i).toString(); res += this.iconv.decode(new Buffer(b64str, 'base64'), "utf16-be"); } if (buf[i] != minusChar) // Minus is absorbed after base64. i--; lastI = i+1; inBase64 = false; base64Accum = ''; } } } if (!inBase64) { res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. } else { var b64str = base64Accum + buf.slice(lastI).toString(); var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. b64str = b64str.slice(0, canBeDecoded); res += this.iconv.decode(new Buffer(b64str, 'base64'), "utf16-be"); } this.inBase64 = inBase64; this.base64Accum = base64Accum; return res; } Utf7Decoder.prototype.end = function() { var res = ""; if (this.inBase64 && this.base64Accum.length > 0) res = this.iconv.decode(new Buffer(this.base64Accum, 'base64'), "utf16-be"); this.inBase64 = false; this.base64Accum = ''; return res; } // UTF-7-IMAP codec. // RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3) // Differences: // * Base64 part is started by "&" instead of "+" // * Direct characters are 0x20-0x7E, except "&" (0x26) // * In Base64, "," is used instead of "/" // * Base64 must not be used to represent direct characters. // * No implicit shift back from Base64 (should always end with '-') // * String must end in non-shifted position. // * "-&" while in base64 is not allowed. exports.utf7imap = Utf7IMAPCodec; function Utf7IMAPCodec(codecOptions, iconv) { this.iconv = iconv; }; Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder; Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder; Utf7IMAPCodec.prototype.bomAware = true; // -- Encoding function Utf7IMAPEncoder(options, codec) { this.iconv = codec.iconv; this.inBase64 = false; this.base64Accum = new Buffer(6); this.base64AccumIdx = 0; } Utf7IMAPEncoder.prototype.write = function(str) { var inBase64 = this.inBase64, base64Accum = this.base64Accum, base64AccumIdx = this.base64AccumIdx, buf = new Buffer(str.length*5 + 10), bufIdx = 0; for (var i = 0; i < str.length; i++) { var uChar = str.charCodeAt(i); if (0x20 <= uChar && uChar <= 0x7E) { // Direct character or '&'. if (inBase64) { if (base64AccumIdx > 0) { bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); base64AccumIdx = 0; } buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. inBase64 = false; } if (!inBase64) { buf[bufIdx++] = uChar; // Write direct character if (uChar === andChar) // Ampersand -> '&-' buf[bufIdx++] = minusChar; } } else { // Non-direct character if (!inBase64) { buf[bufIdx++] = andChar; // Write '&', then go to base64 mode. inBase64 = true; } if (inBase64) { base64Accum[base64AccumIdx++] = uChar >> 8; base64Accum[base64AccumIdx++] = uChar & 0xFF; if (base64AccumIdx == base64Accum.length) { bufIdx += buf.write(base64Accum.toString('base64').replace(/\//g, ','), bufIdx); base64AccumIdx = 0; } } } } this.inBase64 = inBase64; this.base64AccumIdx = base64AccumIdx; return buf.slice(0, bufIdx); } Utf7IMAPEncoder.prototype.end = function() { var buf = new Buffer(10), bufIdx = 0; if (this.inBase64) { if (this.base64AccumIdx > 0) { bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); this.base64AccumIdx = 0; } buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. this.inBase64 = false; } return buf.slice(0, bufIdx); } // -- Decoding function Utf7IMAPDecoder(options, codec) { this.iconv = codec.iconv; this.inBase64 = false; this.base64Accum = ''; } var base64IMAPChars = base64Chars.slice(); base64IMAPChars[','.charCodeAt(0)] = true; Utf7IMAPDecoder.prototype.write = function(buf) { var res = "", lastI = 0, inBase64 = this.inBase64, base64Accum = this.base64Accum; // The decoder is more involved as we must handle chunks in stream. // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end). for (var i = 0; i < buf.length; i++) { if (!inBase64) { // We're in direct mode. // Write direct chars until '&' if (buf[i] == andChar) { res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. lastI = i+1; inBase64 = true; } } else { // We decode base64. if (!base64IMAPChars[buf[i]]) { // Base64 ended. if (i == lastI && buf[i] == minusChar) { // "&-" -> "&" res += "&"; } else { var b64str = base64Accum + buf.slice(lastI, i).toString().replace(/,/g, '/'); res += this.iconv.decode(new Buffer(b64str, 'base64'), "utf16-be"); } if (buf[i] != minusChar) // Minus may be absorbed after base64. i--; lastI = i+1; inBase64 = false; base64Accum = ''; } } } if (!inBase64) { res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. } else { var b64str = base64Accum + buf.slice(lastI).toString().replace(/,/g, '/'); var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. b64str = b64str.slice(0, canBeDecoded); res += this.iconv.decode(new Buffer(b64str, 'base64'), "utf16-be"); } this.inBase64 = inBase64; this.base64Accum = base64Accum; return res; } Utf7IMAPDecoder.prototype.end = function() { var res = ""; if (this.inBase64 && this.base64Accum.length > 0) res = this.iconv.decode(new Buffer(this.base64Accum, 'base64'), "utf16-be"); this.inBase64 = false; this.base64Accum = ''; return res; } "use strict"; var BOMChar = '\uFEFF'; exports.PrependBOM = PrependBOMWrapper function PrependBOMWrapper(encoder, options) { this.encoder = encoder; this.addBOM = true; } PrependBOMWrapper.prototype.write = function(str) { if (this.addBOM) { str = BOMChar + str; this.addBOM = false; } return this.encoder.write(str); } PrependBOMWrapper.prototype.end = function() { return this.encoder.end(); } //------------------------------------------------------------------------------ exports.StripBOM = StripBOMWrapper; function StripBOMWrapper(decoder, options) { this.decoder = decoder; this.pass = false; this.options = options || {}; } StripBOMWrapper.prototype.write = function(buf) { var res = this.decoder.write(buf); if (this.pass || !res) return res; if (res[0] === BOMChar) { res = res.slice(1); if (typeof this.options.stripBOM === 'function') this.options.stripBOM(); } this.pass = true; return res; } StripBOMWrapper.prototype.end = function() { return this.decoder.end(); } "use strict"; var Buffer = require("buffer").Buffer; // == Extend Node primitives to use iconv-lite ================================= module.exports = function (iconv) { var original = undefined; // Place to keep original methods. // Node authors rewrote Buffer internals to make it compatible with // Uint8Array and we cannot patch key functions since then. iconv.supportsNodeEncodingsExtension = !(new Buffer(0) instanceof Uint8Array); iconv.extendNodeEncodings = function extendNodeEncodings() { if (original) return; original = {}; if (!iconv.supportsNodeEncodingsExtension) { console.error("ACTION NEEDED: require('iconv-lite').extendNodeEncodings() is not supported in your version of Node"); console.error("See more info at https://github.com/ashtuchkin/iconv-lite/wiki/Node-v4-compatibility"); return; } var nodeNativeEncodings = { 'hex': true, 'utf8': true, 'utf-8': true, 'ascii': true, 'binary': true, 'base64': true, 'ucs2': true, 'ucs-2': true, 'utf16le': true, 'utf-16le': true, }; Buffer.isNativeEncoding = function(enc) { return enc && nodeNativeEncodings[enc.toLowerCase()]; } // -- SlowBuffer ----------------------------------------------------------- var SlowBuffer = require('buffer').SlowBuffer; original.SlowBufferToString = SlowBuffer.prototype.toString; SlowBuffer.prototype.toString = function(encoding, start, end) { encoding = String(encoding || 'utf8').toLowerCase(); // Use native conversion when possible if (Buffer.isNativeEncoding(encoding)) return original.SlowBufferToString.call(this, encoding, start, end); // Otherwise, use our decoding method. if (typeof start == 'undefined') start = 0; if (typeof end == 'undefined') end = this.length; return iconv.decode(this.slice(start, end), encoding); } original.SlowBufferWrite = SlowBuffer.prototype.write; SlowBuffer.prototype.write = function(string, offset, length, encoding) { // Support both (string, offset, length, encoding) // and the legacy (string, encoding, offset, length) if (isFinite(offset)) { if (!isFinite(length)) { encoding = length; length = undefined; } } else { // legacy var swap = encoding; encoding = offset; offset = length; length = swap; } offset = +offset || 0; var remaining = this.length - offset; if (!length) { length = remaining; } else { length = +length; if (length > remaining) { length = remaining; } } encoding = String(encoding || 'utf8').toLowerCase(); // Use native conversion when possible if (Buffer.isNativeEncoding(encoding)) return original.SlowBufferWrite.call(this, string, offset, length, encoding); if (string.length > 0 && (length < 0 || offset < 0)) throw new RangeError('attempt to write beyond buffer bounds'); // Otherwise, use our encoding method. var buf = iconv.encode(string, encoding); if (buf.length < length) length = buf.length; buf.copy(this, offset, 0, length); return length; } // -- Buffer --------------------------------------------------------------- original.BufferIsEncoding = Buffer.isEncoding; Buffer.isEncoding = function(encoding) { return Buffer.isNativeEncoding(encoding) || iconv.encodingExists(encoding); } original.BufferByteLength = Buffer.byteLength; Buffer.byteLength = SlowBuffer.byteLength = function(str, encoding) { encoding = String(encoding || 'utf8').toLowerCase(); // Use native conversion when possible if (Buffer.isNativeEncoding(encoding)) return original.BufferByteLength.call(this, str, encoding); // Slow, I know, but we don't have a better way yet. return iconv.encode(str, encoding).length; } original.BufferToString = Buffer.prototype.toString; Buffer.prototype.toString = function(encoding, start, end) { encoding = String(encoding || 'utf8').toLowerCase(); // Use native conversion when possible if (Buffer.isNativeEncoding(encoding)) return original.BufferToString.call(this, encoding, start, end); // Otherwise, use our decoding method. if (typeof start == 'undefined') start = 0; if (typeof end == 'undefined') end = this.length; return iconv.decode(this.slice(start, end), encoding); } original.BufferWrite = Buffer.prototype.write; Buffer.prototype.write = function(string, offset, length, encoding) { var _offset = offset, _length = length, _encoding = encoding; // Support both (string, offset, length, encoding) // and the legacy (string, encoding, offset, length) if (isFinite(offset)) { if (!isFinite(length)) { encoding = length; length = undefined; } } else { // legacy var swap = encoding; encoding = offset; offset = length; length = swap; } encoding = String(encoding || 'utf8').toLowerCase(); // Use native conversion when possible if (Buffer.isNativeEncoding(encoding)) return original.BufferWrite.call(this, string, _offset, _length, _encoding); offset = +offset || 0; var remaining = this.length - offset; if (!length) { length = remaining; } else { length = +length; if (length > remaining) { length = remaining; } } if (string.length > 0 && (length < 0 || offset < 0)) throw new RangeError('attempt to write beyond buffer bounds'); // Otherwise, use our encoding method. var buf = iconv.encode(string, encoding); if (buf.length < length) length = buf.length; buf.copy(this, offset, 0, length); return length; // TODO: Set _charsWritten. } // -- Readable ------------------------------------------------------------- if (iconv.supportsStreams) { var Readable = require('stream').Readable; original.ReadableSetEncoding = Readable.prototype.setEncoding; Readable.prototype.setEncoding = function setEncoding(enc, options) { // Use our own decoder, it has the same interface. // We cannot use original function as it doesn't handle BOM-s. this._readableState.decoder = iconv.getDecoder(enc, options); this._readableState.encoding = enc; } Readable.prototype.collect = iconv._collect; } } // Remove iconv-lite Node primitive extensions. iconv.undoExtendNodeEncodings = function undoExtendNodeEncodings() { if (!iconv.supportsNodeEncodingsExtension) return; if (!original) throw new Error("require('iconv-lite').undoExtendNodeEncodings(): Nothing to undo; extendNodeEncodings() is not called.") delete Buffer.isNativeEncoding; var SlowBuffer = require('buffer').SlowBuffer; SlowBuffer.prototype.toString = original.SlowBufferToString; SlowBuffer.prototype.write = original.SlowBufferWrite; Buffer.isEncoding = original.BufferIsEncoding; Buffer.byteLength = original.BufferByteLength; Buffer.prototype.toString = original.BufferToString; Buffer.prototype.write = original.BufferWrite; if (iconv.supportsStreams) { var Readable = require('stream').Readable; Readable.prototype.setEncoding = original.ReadableSetEncoding; delete Readable.prototype.collect; } original = undefined; } } "use strict"; // Some environments don't have global Buffer (e.g. React Native). // Solution would be installing npm modules "buffer" and "stream" explicitly. var Buffer = require("buffer").Buffer; var bomHandling = require("./bom-handling"), iconv = module.exports; // All codecs and aliases are kept here, keyed by encoding name/alias. // They are lazy loaded in `iconv.getCodec` from `encodings/index.js`. iconv.encodings = null; // Characters emitted in case of error. iconv.defaultCharUnicode = '�'; iconv.defaultCharSingleByte = '?'; // Public API. iconv.encode = function encode(str, encoding, options) { str = "" + (str || ""); // Ensure string. var encoder = iconv.getEncoder(encoding, options); var res = encoder.write(str); var trail = encoder.end(); return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res; } iconv.decode = function decode(buf, encoding, options) { if (typeof buf === 'string') { if (!iconv.skipDecodeWarning) { console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding'); iconv.skipDecodeWarning = true; } buf = new Buffer("" + (buf || ""), "binary"); // Ensure buffer. } var decoder = iconv.getDecoder(encoding, options); var res = decoder.write(buf); var trail = decoder.end(); return trail ? (res + trail) : res; } iconv.encodingExists = function encodingExists(enc) { try { iconv.getCodec(enc); return true; } catch (e) { return false; } } // Legacy aliases to convert functions iconv.toEncoding = iconv.encode; iconv.fromEncoding = iconv.decode; // Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache. iconv._codecDataCache = {}; iconv.getCodec = function getCodec(encoding) { if (!iconv.encodings) iconv.encodings = require("../encodings"); // Lazy load all encoding definitions. // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. var enc = (''+encoding).toLowerCase().replace(/[^0-9a-z]|:\d{4}$/g, ""); // Traverse iconv.encodings to find actual codec. var codecOptions = {}; while (true) { var codec = iconv._codecDataCache[enc]; if (codec) return codec; var codecDef = iconv.encodings[enc]; switch (typeof codecDef) { case "string": // Direct alias to other encoding. enc = codecDef; break; case "object": // Alias with options. Can be layered. for (var key in codecDef) codecOptions[key] = codecDef[key]; if (!codecOptions.encodingName) codecOptions.encodingName = enc; enc = codecDef.type; break; case "function": // Codec itself. if (!codecOptions.encodingName) codecOptions.encodingName = enc; // The codec function must load all tables and return object with .encoder and .decoder methods. // It'll be called only once (for each different options object). codec = new codecDef(codecOptions, iconv); iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later. return codec; default: throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')"); } } } iconv.getEncoder = function getEncoder(encoding, options) { var codec = iconv.getCodec(encoding), encoder = new codec.encoder(options, codec); if (codec.bomAware && options && options.addBOM) encoder = new bomHandling.PrependBOM(encoder, options); return encoder; } iconv.getDecoder = function getDecoder(encoding, options) { var codec = iconv.getCodec(encoding), decoder = new codec.decoder(options, codec); if (codec.bomAware && !(options && options.stripBOM === false)) decoder = new bomHandling.StripBOM(decoder, options); return decoder; } // Load extensions in Node. All of them are omitted in Browserify build via 'browser' field in package.json. var nodeVer = typeof process !== 'undefined' && process.versions && process.versions.node; if (nodeVer) { // Load streaming support in Node v0.10+ var nodeVerArr = nodeVer.split(".").map(Number); if (nodeVerArr[0] > 0 || nodeVerArr[1] >= 10) { require("./streams")(iconv); } // Load Node primitive extensions. require("./extend-node")(iconv); } if ("Ā" != "\u0100") { console.error("iconv-lite warning: javascript files use encoding different from utf-8. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info."); } "use strict"; var Buffer = require("buffer").Buffer, Transform = require("stream").Transform; // == Exports ================================================================== module.exports = function(iconv) { // Additional Public API. iconv.encodeStream = function encodeStream(encoding, options) { return new IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options); } iconv.decodeStream = function decodeStream(encoding, options) { return new IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options); } iconv.supportsStreams = true; // Not published yet. iconv.IconvLiteEncoderStream = IconvLiteEncoderStream; iconv.IconvLiteDecoderStream = IconvLiteDecoderStream; iconv._collect = IconvLiteDecoderStream.prototype.collect; }; // == Encoder stream ======================================================= function IconvLiteEncoderStream(conv, options) { this.conv = conv; options = options || {}; options.decodeStrings = false; // We accept only strings, so we don't need to decode them. Transform.call(this, options); } IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, { constructor: { value: IconvLiteEncoderStream } }); IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) { if (typeof chunk != 'string') return done(new Error("Iconv encoding stream needs strings as its input.")); try { var res = this.conv.write(chunk); if (res && res.length) this.push(res); done(); } catch (e) { done(e); } } IconvLiteEncoderStream.prototype._flush = function(done) { try { var res = this.conv.end(); if (res && res.length) this.push(res); done(); } catch (e) { done(e); } } IconvLiteEncoderStream.prototype.collect = function(cb) { var chunks = []; this.on('error', cb); this.on('data', function(chunk) { chunks.push(chunk); }); this.on('end', function() { cb(null, Buffer.concat(chunks)); }); return this; } // == Decoder stream ======================================================= function IconvLiteDecoderStream(conv, options) { this.conv = conv; options = options || {}; options.encoding = this.encoding = 'utf8'; // We output strings. Transform.call(this, options); } IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, { constructor: { value: IconvLiteDecoderStream } }); IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) { if (!Buffer.isBuffer(chunk)) return done(new Error("Iconv decoding stream needs buffers as its input.")); try { var res = this.conv.write(chunk); if (res && res.length) this.push(res, this.encoding); done(); } catch (e) { done(e); } } IconvLiteDecoderStream.prototype._flush = function(done) { try { var res = this.conv.end(); if (res && res.length) this.push(res, this.encoding); done(); } catch (e) { done(e); } } IconvLiteDecoderStream.prototype.collect = function(cb) { var res = ''; this.on('error', cb); this.on('data', function(chunk) { res += chunk; }); this.on('end', function() { cb(null, res); }); return this; } [ ["8740","䏰䰲䘃䖦䕸𧉧䵷䖳𧲱䳢𧳅㮕䜶䝄䱇䱀𤊿𣘗𧍒𦺋𧃒䱗𪍑䝏䗚䲅𧱬䴇䪤䚡𦬣爥𥩔𡩣𣸆𣽡晍囻"], ["8767","綕夝𨮹㷴霴𧯯寛𡵞媤㘥𩺰嫑宷峼杮薓𩥅瑡璝㡵𡵓𣚞𦀡㻬"], ["87a1","𥣞㫵竼龗𤅡𨤍𣇪𠪊𣉞䌊蒄龖鐯䤰蘓墖靊鈘秐稲晠権袝瑌篅枂稬剏遆㓦珄𥶹瓆鿇垳䤯呌䄱𣚎堘穲𧭥讏䚮𦺈䆁𥶙箮𢒼鿈𢓁𢓉𢓌鿉蔄𣖻䂴鿊䓡𪷿拁灮鿋"], ["8840","㇀",4,"𠄌㇅𠃑𠃍㇆㇇𠃋𡿨㇈𠃊㇉㇊㇋㇌𠄎㇍㇎ĀÁǍÀĒÉĚÈŌÓǑÒ࿿Ê̄Ế࿿Ê̌ỀÊāáǎàɑēéěèīíǐìōóǒòūúǔùǖǘǚ"], ["88a1","ǜü࿿ê̄ế࿿ê̌ềêɡ⏚⏛"], ["8940","𪎩𡅅"], ["8943","攊"], ["8946","丽滝鵎釟"], ["894c","𧜵撑会伨侨兖兴农凤务动医华发变团声处备夲头学实実岚庆总斉柾栄桥济炼电纤纬纺织经统缆缷艺苏药视设询车轧轮"], ["89a1","琑糼緍楆竉刧"], ["89ab","醌碸酞肼"], ["89b0","贋胶𠧧"], ["89b5","肟黇䳍鷉鸌䰾𩷶𧀎鸊𪄳㗁"], ["89c1","溚舾甙"], ["89c5","䤑马骏龙禇𨑬𡷊𠗐𢫦两亁亀亇亿仫伷㑌侽㹈倃傈㑽㒓㒥円夅凛凼刅争剹劐匧㗇厩㕑厰㕓参吣㕭㕲㚁咓咣咴咹哐哯唘唣唨㖘唿㖥㖿嗗㗅"], ["8a40","𧶄唥"], ["8a43","𠱂𠴕𥄫喐𢳆㧬𠍁蹆𤶸𩓥䁓𨂾睺𢰸㨴䟕𨅝𦧲𤷪擝𠵼𠾴𠳕𡃴撍蹾𠺖𠰋𠽤𢲩𨉖𤓓"], ["8a64","𠵆𩩍𨃩䟴𤺧𢳂骲㩧𩗴㿭㔆𥋇𩟔𧣈𢵄鵮頕"], ["8a76","䏙𦂥撴哣𢵌𢯊𡁷㧻𡁯"], ["8aa1","𦛚𦜖𧦠擪𥁒𠱃蹨𢆡𨭌𠜱"], ["8aac","䠋𠆩㿺塳𢶍"], ["8ab2","𤗈𠓼𦂗𠽌𠶖啹䂻䎺"], ["8abb","䪴𢩦𡂝膪飵𠶜捹㧾𢝵跀嚡摼㹃"], ["8ac9","𪘁𠸉𢫏𢳉"], ["8ace","𡃈𣧂㦒㨆𨊛㕸𥹉𢃇噒𠼱𢲲𩜠㒼氽𤸻"], ["8adf","𧕴𢺋𢈈𪙛𨳍𠹺𠰴𦠜羓𡃏𢠃𢤹㗻𥇣𠺌𠾍𠺪㾓𠼰𠵇𡅏𠹌"], ["8af6","𠺫𠮩𠵈𡃀𡄽㿹𢚖搲𠾭"], ["8b40","𣏴𧘹𢯎𠵾𠵿𢱑𢱕㨘𠺘𡃇𠼮𪘲𦭐𨳒𨶙𨳊閪哌苄喹"], ["8b55","𩻃鰦骶𧝞𢷮煀腭胬尜𦕲脴㞗卟𨂽醶𠻺𠸏𠹷𠻻㗝𤷫㘉𠳖嚯𢞵𡃉𠸐𠹸𡁸𡅈𨈇𡑕𠹹𤹐𢶤婔𡀝𡀞𡃵𡃶垜𠸑"], ["8ba1","𧚔𨋍𠾵𠹻𥅾㜃𠾶𡆀𥋘𪊽𤧚𡠺𤅷𨉼墙剨㘚𥜽箲孨䠀䬬鼧䧧鰟鮍𥭴𣄽嗻㗲嚉丨夂𡯁屮靑𠂆乛亻㔾尣彑忄㣺扌攵歺氵氺灬爫丬犭𤣩罒礻糹罓𦉪㓁"], ["8bde","𦍋耂肀𦘒𦥑卝衤见𧢲讠贝钅镸长门𨸏韦页风飞饣𩠐鱼鸟黄歯龜丷𠂇阝户钢"], ["8c40","倻淾𩱳龦㷉袏𤅎灷峵䬠𥇍㕙𥴰愢𨨲辧釶熑朙玺𣊁𪄇㲋𡦀䬐磤琂冮𨜏䀉橣𪊺䈣蘏𠩯稪𩥇𨫪靕灍匤𢁾鏴盙𨧣龧矝亣俰傼丯众龨吴綋墒壐𡶶庒庙忂𢜒斋"], ["8ca1","𣏹椙橃𣱣泿"], ["8ca7","爀𤔅玌㻛𤨓嬕璹讃𥲤𥚕窓篬糃繬苸薗龩袐龪躹龫迏蕟駠鈡龬𨶹𡐿䁱䊢娚"], ["8cc9","顨杫䉶圽"], ["8cce","藖𤥻芿𧄍䲁𦵴嵻𦬕𦾾龭龮宖龯曧繛湗秊㶈䓃𣉖𢞖䎚䔶"], ["8ce6","峕𣬚諹屸㴒𣕑嵸龲煗䕘𤃬𡸣䱷㥸㑊𠆤𦱁諌侴𠈹妿腬顖𩣺弻"], ["8d40","𠮟"], ["8d42","𢇁𨥭䄂䚻𩁹㼇龳𪆵䃸㟖䛷𦱆䅼𨚲𧏿䕭㣔𥒚䕡䔛䶉䱻䵶䗪㿈𤬏㙡䓞䒽䇭崾嵈嵖㷼㠏嶤嶹㠠㠸幂庽弥徃㤈㤔㤿㥍惗愽峥㦉憷憹懏㦸戬抐拥挘㧸嚱"], ["8da1","㨃揢揻搇摚㩋擀崕嘡龟㪗斆㪽旿晓㫲暒㬢朖㭂枤栀㭘桊梄㭲㭱㭻椉楃牜楤榟榅㮼槖㯝橥橴橱檂㯬檙㯲檫檵櫔櫶殁毁毪汵沪㳋洂洆洦涁㳯涤涱渕渘温溆𨧀溻滢滚齿滨滩漤漴㵆𣽁澁澾㵪㵵熷岙㶊瀬㶑灐灔灯灿炉𠌥䏁㗱𠻘"], ["8e40","𣻗垾𦻓焾𥟠㙎榢𨯩孴穉𥣡𩓙穥穽𥦬窻窰竂竃燑𦒍䇊竚竝竪䇯咲𥰁笋筕笩𥌎𥳾箢筯莜𥮴𦱿篐萡箒箸𥴠㶭𥱥蒒篺簆簵𥳁籄粃𤢂粦晽𤕸糉糇糦籴糳糵糎"], ["8ea1","繧䔝𦹄絝𦻖璍綉綫焵綳緒𤁗𦀩緤㴓緵𡟹緥𨍭縝𦄡𦅚繮纒䌫鑬縧罀罁罇礶𦋐駡羗𦍑羣𡙡𠁨䕜𣝦䔃𨌺翺𦒉者耈耝耨耯𪂇𦳃耻耼聡𢜔䦉𦘦𣷣𦛨朥肧𨩈脇脚墰𢛶汿𦒘𤾸擧𡒊舘𡡞橓𤩥𤪕䑺舩𠬍𦩒𣵾俹𡓽蓢荢𦬊𤦧𣔰𡝳𣷸芪椛芳䇛"], ["8f40","蕋苐茚𠸖𡞴㛁𣅽𣕚艻苢茘𣺋𦶣𦬅𦮗𣗎㶿茝嗬莅䔋𦶥莬菁菓㑾𦻔橗蕚㒖𦹂𢻯葘𥯤葱㷓䓤檧葊𣲵祘蒨𦮖𦹷𦹃蓞萏莑䒠蒓蓤𥲑䉀𥳀䕃蔴嫲𦺙䔧蕳䔖枿蘖"], ["8fa1","𨘥𨘻藁𧂈蘂𡖂𧃍䕫䕪蘨㙈𡢢号𧎚虾蝱𪃸蟮𢰧螱蟚蠏噡虬桖䘏衅衆𧗠𣶹𧗤衞袜䙛袴袵揁装睷𧜏覇覊覦覩覧覼𨨥觧𧤤𧪽誜瞓釾誐𧩙竩𧬺𣾏䜓𧬸煼謌謟𥐰𥕥謿譌譍誩𤩺讐讛誯𡛟䘕衏貛𧵔𧶏貫㜥𧵓賖𧶘𧶽贒贃𡤐賛灜贑𤳉㻐起"], ["9040","趩𨀂𡀔𤦊㭼𨆼𧄌竧躭躶軃鋔輙輭𨍥𨐒辥錃𪊟𠩐辳䤪𨧞𨔽𣶻廸𣉢迹𪀔𨚼𨔁𢌥㦀𦻗逷𨔼𧪾遡𨕬𨘋邨𨜓郄𨛦邮都酧㫰醩釄粬𨤳𡺉鈎沟鉁鉢𥖹銹𨫆𣲛𨬌𥗛"], ["90a1","𠴱錬鍫𨫡𨯫炏嫃𨫢𨫥䥥鉄𨯬𨰹𨯿鍳鑛躼閅閦鐦閠濶䊹𢙺𨛘𡉼𣸮䧟氜陻隖䅬隣𦻕懚隶磵𨫠隽双䦡𦲸𠉴𦐐𩂯𩃥𤫑𡤕𣌊霱虂霶䨏䔽䖅𤫩灵孁霛靜𩇕靗孊𩇫靟鐥僐𣂷𣂼鞉鞟鞱鞾韀韒韠𥑬韮琜𩐳響韵𩐝𧥺䫑頴頳顋顦㬎𧅵㵑𠘰𤅜"], ["9140","𥜆飊颷飈飇䫿𦴧𡛓喰飡飦飬鍸餹𤨩䭲𩡗𩤅駵騌騻騐驘𥜥㛄𩂱𩯕髠髢𩬅髴䰎鬔鬭𨘀倴鬴𦦨㣃𣁽魐魀𩴾婅𡡣鮎𤉋鰂鯿鰌𩹨鷔𩾷𪆒𪆫𪃡𪄣𪇟鵾鶃𪄴鸎梈"], ["91a1","鷄𢅛𪆓𪈠𡤻𪈳鴹𪂹𪊴麐麕麞麢䴴麪麯𤍤黁㭠㧥㴝伲㞾𨰫鼂鼈䮖鐤𦶢鼗鼖鼹嚟嚊齅馸𩂋韲葿齢齩竜龎爖䮾𤥵𤦻煷𤧸𤍈𤩑玞𨯚𡣺禟𨥾𨸶鍩鏳𨩄鋬鎁鏋𨥬𤒹爗㻫睲穃烐𤑳𤏸煾𡟯炣𡢾𣖙㻇𡢅𥐯𡟸㜢𡛻𡠹㛡𡝴𡣑𥽋㜣𡛀坛𤨥𡏾𡊨"], ["9240","𡏆𡒶蔃𣚦蔃葕𤦔𧅥𣸱𥕜𣻻𧁒䓴𣛮𩦝𦼦柹㜳㰕㷧塬𡤢栐䁗𣜿𤃡𤂋𤄏𦰡哋嚞𦚱嚒𠿟𠮨𠸍鏆𨬓鎜仸儫㠙𤐶亼𠑥𠍿佋侊𥙑婨𠆫𠏋㦙𠌊𠐔㐵伩𠋀𨺳𠉵諚𠈌亘"], ["92a1","働儍侢伃𤨎𣺊佂倮偬傁俌俥偘僼兙兛兝兞湶𣖕𣸹𣺿浲𡢄𣺉冨凃𠗠䓝𠒣𠒒𠒑赺𨪜𠜎剙劤𠡳勡鍮䙺熌𤎌𠰠𤦬𡃤槑𠸝瑹㻞璙琔瑖玘䮎𤪼𤂍叐㖄爏𤃉喴𠍅响𠯆圝鉝雴鍦埝垍坿㘾壋媙𨩆𡛺𡝯𡜐娬妸銏婾嫏娒𥥆𡧳𡡡𤊕㛵洅瑃娡𥺃"], ["9340","媁𨯗𠐓鏠璌𡌃焅䥲鐈𨧻鎽㞠尞岞幞幈𡦖𡥼𣫮廍孏𡤃𡤄㜁𡢠㛝𡛾㛓脪𨩇𡶺𣑲𨦨弌弎𡤧𡞫婫𡜻孄蘔𧗽衠恾𢡠𢘫忛㺸𢖯𢖾𩂈𦽳懀𠀾𠁆𢘛憙憘恵𢲛𢴇𤛔𩅍"], ["93a1","摱𤙥𢭪㨩𢬢𣑐𩣪𢹸挷𪑛撶挱揑𤧣𢵧护𢲡搻敫楲㯴𣂎𣊭𤦉𣊫唍𣋠𡣙𩐿曎𣊉𣆳㫠䆐𥖄𨬢𥖏𡛼𥕛𥐥磮𣄃𡠪𣈴㑤𣈏𣆂𤋉暎𦴤晫䮓昰𧡰𡷫晣𣋒𣋡昞𥡲㣑𣠺𣞼㮙𣞢𣏾瓐㮖枏𤘪梶栞㯄檾㡣𣟕𤒇樳橒櫉欅𡤒攑梘橌㯗橺歗𣿀𣲚鎠鋲𨯪𨫋"], ["9440","銉𨀞𨧜鑧涥漋𤧬浧𣽿㶏渄𤀼娽渊塇洤硂焻𤌚𤉶烱牐犇犔𤞏𤜥兹𤪤𠗫瑺𣻸𣙟𤩊𤤗𥿡㼆㺱𤫟𨰣𣼵悧㻳瓌琼鎇琷䒟𦷪䕑疃㽣𤳙𤴆㽘畕癳𪗆㬙瑨𨫌𤦫𤦎㫻"], ["94a1","㷍𤩎㻿𤧅𤣳釺圲鍂𨫣𡡤僟𥈡𥇧睸𣈲眎眏睻𤚗𣞁㩞𤣰琸璛㺿𤪺𤫇䃈𤪖𦆮錇𥖁砞碍碈磒珐祙𧝁𥛣䄎禛蒖禥樭𣻺稺秴䅮𡛦䄲鈵秱𠵌𤦌𠊙𣶺𡝮㖗啫㕰㚪𠇔𠰍竢婙𢛵𥪯𥪜娍𠉛磰娪𥯆竾䇹籝籭䈑𥮳𥺼𥺦糍𤧹𡞰粎籼粮檲緜縇緓罎𦉡"], ["9540","𦅜𧭈綗𥺂䉪𦭵𠤖柖𠁎𣗏埄𦐒𦏸𤥢翝笧𠠬𥫩𥵃笌𥸎駦虅驣樜𣐿㧢𤧷𦖭騟𦖠蒀𧄧𦳑䓪脷䐂胆脉腂𦞴飃𦩂艢艥𦩑葓𦶧蘐𧈛媆䅿𡡀嬫𡢡嫤𡣘蚠蜨𣶏蠭𧐢娂"], ["95a1","衮佅袇袿裦襥襍𥚃襔𧞅𧞄𨯵𨯙𨮜𨧹㺭蒣䛵䛏㟲訽訜𩑈彍鈫𤊄旔焩烄𡡅鵭貟賩𧷜妚矃姰䍮㛔踪躧𤰉輰轊䋴汘澻𢌡䢛潹溋𡟚鯩㚵𤤯邻邗啱䤆醻鐄𨩋䁢𨫼鐧𨰝𨰻蓥訫閙閧閗閖𨴴瑅㻂𤣿𤩂𤏪㻧𣈥随𨻧𨹦𨹥㻌𤧭𤩸𣿮琒瑫㻼靁𩂰"], ["9640","桇䨝𩂓𥟟靝鍨𨦉𨰦𨬯𦎾銺嬑譩䤼珹𤈛鞛靱餸𠼦巁𨯅𤪲頟𩓚鋶𩗗釥䓀𨭐𤩧𨭤飜𨩅㼀鈪䤥萔餻饍𧬆㷽馛䭯馪驜𨭥𥣈檏騡嫾騯𩣱䮐𩥈馼䮽䮗鍽塲𡌂堢𤦸"], ["96a1","𡓨硄𢜟𣶸棅㵽鑘㤧慐𢞁𢥫愇鱏鱓鱻鰵鰐魿鯏𩸭鮟𪇵𪃾鴡䲮𤄄鸘䲰鴌𪆴𪃭𪃳𩤯鶥蒽𦸒𦿟𦮂藼䔳𦶤𦺄𦷰萠藮𦸀𣟗𦁤秢𣖜𣙀䤭𤧞㵢鏛銾鍈𠊿碹鉷鑍俤㑀遤𥕝砽硔碶硋𡝗𣇉𤥁㚚佲濚濙瀞瀞吔𤆵垻壳垊鴖埗焴㒯𤆬燫𦱀𤾗嬨𡞵𨩉"], ["9740","愌嫎娋䊼𤒈㜬䭻𨧼鎻鎸𡣖𠼝葲𦳀𡐓𤋺𢰦𤏁妔𣶷𦝁綨𦅛𦂤𤦹𤦋𨧺鋥珢㻩璴𨭣𡢟㻡𤪳櫘珳珻㻖𤨾𤪔𡟙𤩦𠎧𡐤𤧥瑈𤤖炥𤥶銄珦鍟𠓾錱𨫎𨨖鎆𨯧𥗕䤵𨪂煫"], ["97a1","𤥃𠳿嚤𠘚𠯫𠲸唂秄𡟺緾𡛂𤩐𡡒䔮鐁㜊𨫀𤦭妰𡢿𡢃𧒄媡㛢𣵛㚰鉟婹𨪁𡡢鍴㳍𠪴䪖㦊僴㵩㵌𡎜煵䋻𨈘渏𩃤䓫浗𧹏灧沯㳖𣿭𣸭渂漌㵯𠏵畑㚼㓈䚀㻚䡱姄鉮䤾轁𨰜𦯀堒埈㛖𡑒烾𤍢𤩱𢿣𡊰𢎽梹楧𡎘𣓥𧯴𣛟𨪃𣟖𣏺𤲟樚𣚭𦲷萾䓟䓎"], ["9840","𦴦𦵑𦲂𦿞漗𧄉茽𡜺菭𦲀𧁓𡟛妉媂𡞳婡婱𡤅𤇼㜭姯𡜼㛇熎鎐暚𤊥婮娫𤊓樫𣻹𧜶𤑛𤋊焝𤉙𨧡侰𦴨峂𤓎𧹍𤎽樌𤉖𡌄炦焳𤏩㶥泟勇𤩏繥姫崯㷳彜𤩝𡟟綤萦"], ["98a1","咅𣫺𣌀𠈔坾𠣕𠘙㿥𡾞𪊶瀃𩅛嵰玏糓𨩙𩐠俈翧狍猐𧫴猸猹𥛶獁獈㺩𧬘遬燵𤣲珡臶㻊県㻑沢国琙琞琟㻢㻰㻴㻺瓓㼎㽓畂畭畲疍㽼痈痜㿀癍㿗癴㿜発𤽜熈嘣覀塩䀝睃䀹条䁅㗛瞘䁪䁯属瞾矋売砘点砜䂨砹硇硑硦葈𥔵礳栃礲䄃"], ["9940","䄉禑禙辻稆込䅧窑䆲窼艹䇄竏竛䇏両筢筬筻簒簛䉠䉺类粜䊌粸䊔糭输烀𠳏総緔緐緽羮羴犟䎗耠耥笹耮耱联㷌垴炠肷胩䏭脌猪脎脒畠脔䐁㬹腖腙腚"], ["99a1","䐓堺腼膄䐥膓䐭膥埯臁臤艔䒏芦艶苊苘苿䒰荗险榊萅烵葤惣蒈䔄蒾蓡蓸蔐蔸蕒䔻蕯蕰藠䕷虲蚒蚲蛯际螋䘆䘗袮裿褤襇覑𧥧訩訸誔誴豑賔賲贜䞘塟跃䟭仮踺嗘坔蹱嗵躰䠷軎転軤軭軲辷迁迊迌逳駄䢭飠鈓䤞鈨鉘鉫銱銮銿"], ["9a40","鋣鋫鋳鋴鋽鍃鎄鎭䥅䥑麿鐗匁鐝鐭鐾䥪鑔鑹锭関䦧间阳䧥枠䨤靀䨵鞲韂噔䫤惨颹䬙飱塄餎餙冴餜餷饂饝饢䭰駅䮝騼鬏窃魩鮁鯝鯱鯴䱭鰠㝯𡯂鵉鰺"], ["9aa1","黾噐鶓鶽鷀鷼银辶鹻麬麱麽黆铜黢黱黸竈齄𠂔𠊷𠎠椚铃妬𠓗塀铁㞹𠗕𠘕𠙶𡚺块煳𠫂𠫍𠮿呪吆𠯋咞𠯻𠰻𠱓𠱥𠱼惧𠲍噺𠲵𠳝𠳭𠵯𠶲𠷈楕鰯螥𠸄𠸎𠻗𠾐𠼭𠹳尠𠾼帋𡁜𡁏𡁶朞𡁻𡂈𡂖㙇𡂿𡃓𡄯𡄻卤蒭𡋣𡍵𡌶讁𡕷𡘙𡟃𡟇乸炻𡠭𡥪"], ["9b40","𡨭𡩅𡰪𡱰𡲬𡻈拃𡻕𡼕熘桕𢁅槩㛈𢉼𢏗𢏺𢜪𢡱𢥏苽𢥧𢦓𢫕覥𢫨辠𢬎鞸𢬿顇骽𢱌"], ["9b62","𢲈𢲷𥯨𢴈𢴒𢶷𢶕𢹂𢽴𢿌𣀳𣁦𣌟𣏞徱晈暿𧩹𣕧𣗳爁𤦺矗𣘚𣜖纇𠍆墵朎"], ["9ba1","椘𣪧𧙗𥿢𣸑𣺹𧗾𢂚䣐䪸𤄙𨪚𤋮𤌍𤀻𤌴𤎖𤩅𠗊凒𠘑妟𡺨㮾𣳿𤐄𤓖垈𤙴㦛𤜯𨗨𩧉㝢𢇃譞𨭎駖𤠒𤣻𤨕爉𤫀𠱸奥𤺥𤾆𠝹軚𥀬劏圿煱𥊙𥐙𣽊𤪧喼𥑆𥑮𦭒釔㑳𥔿𧘲𥕞䜘𥕢𥕦𥟇𤤿𥡝偦㓻𣏌惞𥤃䝼𨥈𥪮𥮉𥰆𡶐垡煑澶𦄂𧰒遖𦆲𤾚譢𦐂𦑊"], ["9c40","嵛𦯷輶𦒄𡤜諪𤧶𦒈𣿯𦔒䯀𦖿𦚵𢜛鑥𥟡憕娧晉侻嚹𤔡𦛼乪𤤴陖涏𦲽㘘襷𦞙𦡮𦐑𦡞營𦣇筂𩃀𠨑𦤦鄄𦤹穅鷰𦧺騦𦨭㙟𦑩𠀡禃𦨴𦭛崬𣔙菏𦮝䛐𦲤画补𦶮墶"], ["9ca1","㜜𢖍𧁋𧇍㱔𧊀𧊅銁𢅺𧊋錰𧋦𤧐氹钟𧑐𠻸蠧裵𢤦𨑳𡞱溸𤨪𡠠㦤㚹尐秣䔿暶𩲭𩢤襃𧟌𧡘囖䃟𡘊㦡𣜯𨃨𡏅熭荦𧧝𩆨婧䲷𧂯𨦫𧧽𧨊𧬋𧵦𤅺筃祾𨀉澵𪋟樃𨌘厢𦸇鎿栶靝𨅯𨀣𦦵𡏭𣈯𨁈嶅𨰰𨂃圕頣𨥉嶫𤦈斾槕叒𤪥𣾁㰑朶𨂐𨃴𨄮𡾡𨅏"], ["9d40","𨆉𨆯𨈚𨌆𨌯𨎊㗊𨑨𨚪䣺揦𨥖砈鉕𨦸䏲𨧧䏟𨧨𨭆𨯔姸𨰉輋𨿅𩃬筑𩄐𩄼㷷𩅞𤫊运犏嚋𩓧𩗩𩖰𩖸𩜲𩣑𩥉𩥪𩧃𩨨𩬎𩵚𩶛纟𩻸𩼣䲤镇𪊓熢𪋿䶑递𪗋䶜𠲜达嗁"], ["9da1","辺𢒰边𤪓䔉繿潖檱仪㓤𨬬𧢝㜺躀𡟵𨀤𨭬𨮙𧨾𦚯㷫𧙕𣲷𥘵𥥖亚𥺁𦉘嚿𠹭踎孭𣺈𤲞揞拐𡟶𡡻攰嘭𥱊吚𥌑㷆𩶘䱽嘢嘞罉𥻘奵𣵀蝰东𠿪𠵉𣚺脗鵞贘瘻鱅癎瞹鍅吲腈苷嘥脲萘肽嗪祢噃吖𠺝㗎嘅嗱曱𨋢㘭甴嗰喺咗啲𠱁𠲖廐𥅈𠹶𢱢"], ["9e40","𠺢麫絚嗞𡁵抝靭咔賍燶酶揼掹揾啩𢭃鱲𢺳冚㓟𠶧冧呍唞唓癦踭𦢊疱肶蠄螆裇膶萜𡃁䓬猄𤜆宐茋𦢓噻𢛴𧴯𤆣𧵳𦻐𧊶酰𡇙鈈𣳼𪚩𠺬𠻹牦𡲢䝎𤿂𧿹𠿫䃺"], ["9ea1","鱝攟𢶠䣳𤟠𩵼𠿬𠸊恢𧖣𠿭"], ["9ead","𦁈𡆇熣纎鵐业丄㕷嬍沲卧㚬㧜卽㚥𤘘墚𤭮舭呋垪𥪕𠥹"], ["9ec5","㩒𢑥獴𩺬䴉鯭𣳾𩼰䱛𤾩𩖞𩿞葜𣶶𧊲𦞳𣜠挮紥𣻷𣸬㨪逈勌㹴㙺䗩𠒎癀嫰𠺶硺𧼮墧䂿噼鮋嵴癔𪐴麅䳡痹㟻愙𣃚𤏲"], ["9ef5","噝𡊩垧𤥣𩸆刴𧂮㖭汊鵼"], ["9f40","籖鬹埞𡝬屓擓𩓐𦌵𧅤蚭𠴨𦴢𤫢𠵱"], ["9f4f","凾𡼏嶎霃𡷑麁遌笟鬂峑箣扨挵髿篏鬪籾鬮籂粆鰕篼鬉鼗鰛𤤾齚啳寃俽麘俲剠㸆勑坧偖妷帒韈鶫轜呩鞴饀鞺匬愰"], ["9fa1","椬叚鰊鴂䰻陁榀傦畆𡝭駚剳"], ["9fae","酙隁酜"], ["9fb2","酑𨺗捿𦴣櫊嘑醎畺抅𠏼獏籰𥰡𣳽"], ["9fc1","𤤙盖鮝个𠳔莾衂"], ["9fc9","届槀僭坺刟巵从氱𠇲伹咜哚劚趂㗾弌㗳"], ["9fdb","歒酼龥鮗頮颴骺麨麄煺笔"], ["9fe7","毺蠘罸"], ["9feb","嘠𪙊蹷齓"], ["9ff0","跔蹏鸜踁抂𨍽踨蹵竓𤩷稾磘泪詧瘇"], ["a040","𨩚鼦泎蟖痃𪊲硓咢贌狢獱謭猂瓱賫𤪻蘯徺袠䒷"], ["a055","𡠻𦸅"], ["a058","詾𢔛"], ["a05b","惽癧髗鵄鍮鮏蟵"], ["a063","蠏賷猬霡鮰㗖犲䰇籑饊𦅙慙䰄麖慽"], ["a073","坟慯抦戹拎㩜懢厪𣏵捤栂㗒"], ["a0a1","嵗𨯂迚𨸹"], ["a0a6","僙𡵆礆匲阸𠼻䁥"], ["a0ae","矾"], ["a0b0","糂𥼚糚稭聦聣絍甅瓲覔舚朌聢𧒆聛瓰脃眤覉𦟌畓𦻑螩蟎臈螌詉貭譃眫瓸蓚㘵榲趦"], ["a0d4","覩瑨涹蟁𤀑瓧㷛煶悤憜㳑煢恷"], ["a0e2","罱𨬭牐惩䭾删㰘𣳇𥻗𧙖𥔱𡥄𡋾𩤃𦷜𧂭峁𦆭𨨏𣙷𠃮𦡆𤼎䕢嬟𦍌齐麦𦉫"], ["a3c0","␀",31,"␡"], ["c6a1","①",9,"⑴",9,"ⅰ",9,"丶丿亅亠冂冖冫勹匸卩厶夊宀巛⼳广廴彐彡攴无疒癶辵隶¨ˆヽヾゝゞ〃仝々〆〇ー[]✽ぁ",23], ["c740","す",58,"ァアィイ"], ["c7a1","ゥ",81,"А",5,"ЁЖ",4], ["c840","Л",26,"ёж",25,"⇧↸↹㇏𠃌乚𠂊刂䒑"], ["c8a1","龰冈龱𧘇"], ["c8cd","¬¦'"㈱№℡゛゜⺀⺄⺆⺇⺈⺊⺌⺍⺕⺜⺝⺥⺧⺪⺬⺮⺶⺼⺾⻆⻊⻌⻍⻏⻖⻗⻞⻣"], ["c8f5","ʃɐɛɔɵœøŋʊɪ"], ["f9fe","■"], ["fa40","𠕇鋛𠗟𣿅蕌䊵珯况㙉𤥂𨧤鍄𡧛苮𣳈砼杄拟𤤳𨦪𠊠𦮳𡌅侫𢓭倈𦴩𧪄𣘀𤪱𢔓倩𠍾徤𠎀𠍇滛𠐟偽儁㑺儎顬㝃萖𤦤𠒇兠𣎴兪𠯿𢃼𠋥𢔰𠖎𣈳𡦃宂蝽𠖳𣲙冲冸"], ["faa1","鴴凉减凑㳜凓𤪦决凢卂凭菍椾𣜭彻刋刦刼劵剗劔効勅簕蕂勠蘍𦬓包𨫞啉滙𣾀𠥔𣿬匳卄𠯢泋𡜦栛珕恊㺪㣌𡛨燝䒢卭却𨚫卾卿𡖖𡘓矦厓𨪛厠厫厮玧𥝲㽙玜叁叅汉义埾叙㪫𠮏叠𣿫𢶣叶𠱷吓灹唫晗浛呭𦭓𠵴啝咏咤䞦𡜍𠻝㶴𠵍"], ["fb40","𨦼𢚘啇䳭启琗喆喩嘅𡣗𤀺䕒𤐵暳𡂴嘷曍𣊊暤暭噍噏磱囱鞇叾圀囯园𨭦㘣𡉏坆𤆥汮炋坂㚱𦱾埦𡐖堃𡑔𤍣堦𤯵塜墪㕡壠壜𡈼壻寿坃𪅐𤉸鏓㖡够梦㛃湙"], ["fba1","𡘾娤啓𡚒蔅姉𠵎𦲁𦴪𡟜姙𡟻𡞲𦶦浱𡠨𡛕姹𦹅媫婣㛦𤦩婷㜈媖瑥嫓𦾡𢕔㶅𡤑㜲𡚸広勐孶斈孼𧨎䀄䡝𠈄寕慠𡨴𥧌𠖥寳宝䴐尅𡭄尓珎尔𡲥𦬨屉䣝岅峩峯嶋𡷹𡸷崐崘嵆𡺤岺巗苼㠭𤤁𢁉𢅳芇㠶㯂帮檊幵幺𤒼𠳓厦亷廐厨𡝱帉廴𨒂"], ["fc40","廹廻㢠廼栾鐛弍𠇁弢㫞䢮𡌺强𦢈𢏐彘𢑱彣鞽𦹮彲鍀𨨶徧嶶㵟𥉐𡽪𧃸𢙨釖𠊞𨨩怱暅𡡷㥣㷇㘹垐𢞴祱㹀悞悤悳𤦂𤦏𧩓璤僡媠慤萤慂慈𦻒憁凴𠙖憇宪𣾷"], ["fca1","𢡟懓𨮝𩥝懐㤲𢦀𢣁怣慜攞掋𠄘担𡝰拕𢸍捬𤧟㨗搸揸𡎎𡟼撐澊𢸶頔𤂌𥜝擡擥鑻㩦携㩗敍漖𤨨𤨣斅敭敟𣁾斵𤥀䬷旑䃘𡠩无旣忟𣐀昘𣇷𣇸晄𣆤𣆥晋𠹵晧𥇦晳晴𡸽𣈱𨗴𣇈𥌓矅𢣷馤朂𤎜𤨡㬫槺𣟂杞杧杢𤇍𩃭柗䓩栢湐鈼栁𣏦𦶠桝"], ["fd40","𣑯槡樋𨫟楳棃𣗍椁椀㴲㨁𣘼㮀枬楡𨩊䋼椶榘㮡𠏉荣傐槹𣙙𢄪橅𣜃檝㯳枱櫈𩆜㰍欝𠤣惞欵歴𢟍溵𣫛𠎵𡥘㝀吡𣭚毡𣻼毜氷𢒋𤣱𦭑汚舦汹𣶼䓅𣶽𤆤𤤌𤤀"], ["fda1","𣳉㛥㳫𠴲鮃𣇹𢒑羏样𦴥𦶡𦷫涖浜湼漄𤥿𤂅𦹲蔳𦽴凇沜渝萮𨬡港𣸯瑓𣾂秌湏媑𣁋濸㜍澝𣸰滺𡒗𤀽䕕鏰潄潜㵎潴𩅰㴻澟𤅄濓𤂑𤅕𤀹𣿰𣾴𤄿凟𤅖𤅗𤅀𦇝灋灾炧炁烌烕烖烟䄄㷨熴熖𤉷焫煅媈煊煮岜𤍥煏鍢𤋁焬𤑚𤨧𤨢熺𨯨炽爎"], ["fe40","鑂爕夑鑃爤鍁𥘅爮牀𤥴梽牕牗㹕𣁄栍漽犂猪猫𤠣𨠫䣭𨠄猨献珏玪𠰺𦨮珉瑉𤇢𡛧𤨤昣㛅𤦷𤦍𤧻珷琕椃𤨦琹𠗃㻗瑜𢢭瑠𨺲瑇珤瑶莹瑬㜰瑴鏱樬璂䥓𤪌"], ["fea1","𤅟𤩹𨮏孆𨰃𡢞瓈𡦈甎瓩甞𨻙𡩋寗𨺬鎅畍畊畧畮𤾂㼄𤴓疎瑝疞疴瘂瘬癑癏癯癶𦏵皐臯㟸𦤑𦤎皡皥皷盌𦾟葢𥂝𥅽𡸜眞眦着撯𥈠睘𣊬瞯𨥤𨥨𡛁矴砉𡍶𤨒棊碯磇磓隥礮𥗠磗礴碱𧘌辸袄𨬫𦂃𢘜禆褀椂禀𥡗禝𧬹礼禩渪𧄦㺨秆𩄍秔"] ] [ ["0","\u0000",127,"€"], ["8140","丂丄丅丆丏丒丗丟丠両丣並丩丮丯丱丳丵丷丼乀乁乂乄乆乊乑乕乗乚乛乢乣乤乥乧乨乪",5,"乲乴",9,"乿",6,"亇亊"], ["8180","亐亖亗亙亜亝亞亣亪亯亰亱亴亶亷亸亹亼亽亾仈仌仏仐仒仚仛仜仠仢仦仧仩仭仮仯仱仴仸仹仺仼仾伀伂",6,"伋伌伒",4,"伜伝伡伣伨伩伬伭伮伱伳伵伷伹伻伾",4,"佄佅佇",5,"佒佔佖佡佢佦佨佪佫佭佮佱佲併佷佸佹佺佽侀侁侂侅來侇侊侌侎侐侒侓侕侖侘侙侚侜侞侟価侢"], ["8240","侤侫侭侰",4,"侶",8,"俀俁係俆俇俈俉俋俌俍俒",4,"俙俛俠俢俤俥俧俫俬俰俲俴俵俶俷俹俻俼俽俿",11], ["8280","個倎倐們倓倕倖倗倛倝倞倠倢倣値倧倫倯",10,"倻倽倿偀偁偂偄偅偆偉偊偋偍偐",4,"偖偗偘偙偛偝",7,"偦",5,"偭",8,"偸偹偺偼偽傁傂傃傄傆傇傉傊傋傌傎",20,"傤傦傪傫傭",4,"傳",6,"傼"], ["8340","傽",17,"僐",5,"僗僘僙僛",10,"僨僩僪僫僯僰僱僲僴僶",4,"僼",9,"儈"], ["8380","儉儊儌",5,"儓",13,"儢",28,"兂兇兊兌兎兏児兒兓兗兘兙兛兝",4,"兣兤兦內兩兪兯兲兺兾兿冃冄円冇冊冋冎冏冐冑冓冔冘冚冝冞冟冡冣冦",4,"冭冮冴冸冹冺冾冿凁凂凃凅凈凊凍凎凐凒",5], ["8440","凘凙凚凜凞凟凢凣凥",5,"凬凮凱凲凴凷凾刄刅刉刋刌刏刐刓刔刕刜刞刟刡刢刣別刦刧刪刬刯刱刲刴刵刼刾剄",5,"剋剎剏剒剓剕剗剘"], ["8480","剙剚剛剝剟剠剢剣剤剦剨剫剬剭剮剰剱剳",9,"剾劀劃",4,"劉",6,"劑劒劔",6,"劜劤劥劦劧劮劯劰労",9,"勀勁勂勄勅勆勈勊勌勍勎勏勑勓勔動勗務",5,"勠勡勢勣勥",10,"勱",7,"勻勼勽匁匂匃匄匇匉匊匋匌匎"], ["8540","匑匒匓匔匘匛匜匞匟匢匤匥匧匨匩匫匬匭匯",9,"匼匽區卂卄卆卋卌卍卐協単卙卛卝卥卨卪卬卭卲卶卹卻卼卽卾厀厁厃厇厈厊厎厏"], ["8580","厐",4,"厖厗厙厛厜厞厠厡厤厧厪厫厬厭厯",6,"厷厸厹厺厼厽厾叀參",4,"収叏叐叒叓叕叚叜叝叞叡叢叧叴叺叾叿吀吂吅吇吋吔吘吙吚吜吢吤吥吪吰吳吶吷吺吽吿呁呂呄呅呇呉呌呍呎呏呑呚呝",4,"呣呥呧呩",7,"呴呹呺呾呿咁咃咅咇咈咉咊咍咑咓咗咘咜咞咟咠咡"], ["8640","咢咥咮咰咲咵咶咷咹咺咼咾哃哅哊哋哖哘哛哠",4,"哫哬哯哰哱哴",5,"哻哾唀唂唃唄唅唈唊",4,"唒唓唕",5,"唜唝唞唟唡唥唦"], ["8680","唨唩唫唭唲唴唵唶唸唹唺唻唽啀啂啅啇啈啋",4,"啑啒啓啔啗",4,"啝啞啟啠啢啣啨啩啫啯",5,"啹啺啽啿喅喆喌喍喎喐喒喓喕喖喗喚喛喞喠",6,"喨",8,"喲喴営喸喺喼喿",4,"嗆嗇嗈嗊嗋嗎嗏嗐嗕嗗",4,"嗞嗠嗢嗧嗩嗭嗮嗰嗱嗴嗶嗸",4,"嗿嘂嘃嘄嘅"], ["8740","嘆嘇嘊嘋嘍嘐",7,"嘙嘚嘜嘝嘠嘡嘢嘥嘦嘨嘩嘪嘫嘮嘯嘰嘳嘵嘷嘸嘺嘼嘽嘾噀",11,"噏",4,"噕噖噚噛噝",4], ["8780","噣噥噦噧噭噮噯噰噲噳噴噵噷噸噹噺噽",7,"嚇",6,"嚐嚑嚒嚔",14,"嚤",10,"嚰",6,"嚸嚹嚺嚻嚽",12,"囋",8,"囕囖囘囙囜団囥",5,"囬囮囯囲図囶囷囸囻囼圀圁圂圅圇國",6], ["8840","園",9,"圝圞圠圡圢圤圥圦圧圫圱圲圴",4,"圼圽圿坁坃坄坅坆坈坉坋坒",4,"坘坙坢坣坥坧坬坮坰坱坲坴坵坸坹坺坽坾坿垀"], ["8880","垁垇垈垉垊垍",4,"垔",6,"垜垝垞垟垥垨垪垬垯垰垱垳垵垶垷垹",8,"埄",6,"埌埍埐埑埓埖埗埛埜埞埡埢埣埥",7,"埮埰埱埲埳埵埶執埻埼埾埿堁堃堄堅堈堉堊堌堎堏堐堒堓堔堖堗堘堚堛堜堝堟堢堣堥",4,"堫",4,"報堲堳場堶",7], ["8940","堾",5,"塅",6,"塎塏塐塒塓塕塖塗塙",4,"塟",5,"塦",4,"塭",16,"塿墂墄墆墇墈墊墋墌"], ["8980","墍",4,"墔",4,"墛墜墝墠",7,"墪",17,"墽墾墿壀壂壃壄壆",10,"壒壓壔壖",13,"壥",5,"壭壯壱売壴壵壷壸壺",7,"夃夅夆夈",4,"夎夐夑夒夓夗夘夛夝夞夠夡夢夣夦夨夬夰夲夳夵夶夻"], ["8a40","夽夾夿奀奃奅奆奊奌奍奐奒奓奙奛",4,"奡奣奤奦",12,"奵奷奺奻奼奾奿妀妅妉妋妌妎妏妐妑妔妕妘妚妛妜妝妟妠妡妢妦"], ["8a80","妧妬妭妰妱妳",5,"妺妼妽妿",6,"姇姈姉姌姍姎姏姕姖姙姛姞",4,"姤姦姧姩姪姫姭",11,"姺姼姽姾娀娂娊娋娍娎娏娐娒娔娕娖娗娙娚娛娝娞娡娢娤娦娧娨娪",6,"娳娵娷",4,"娽娾娿婁",4,"婇婈婋",9,"婖婗婘婙婛",5], ["8b40","婡婣婤婥婦婨婩婫",8,"婸婹婻婼婽婾媀",17,"媓",6,"媜",13,"媫媬"], ["8b80","媭",4,"媴媶媷媹",4,"媿嫀嫃",5,"嫊嫋嫍",4,"嫓嫕嫗嫙嫚嫛嫝嫞嫟嫢嫤嫥嫧嫨嫪嫬",4,"嫲",22,"嬊",11,"嬘",25,"嬳嬵嬶嬸",7,"孁",6], ["8c40","孈",7,"孒孖孞孠孡孧孨孫孭孮孯孲孴孶孷學孹孻孼孾孿宂宆宊宍宎宐宑宒宔宖実宧宨宩宬宭宮宯宱宲宷宺宻宼寀寁寃寈寉寊寋寍寎寏"], ["8c80","寑寔",8,"寠寢寣實寧審",4,"寯寱",6,"寽対尀専尃尅將專尋尌對導尐尒尓尗尙尛尞尟尠尡尣尦尨尩尪尫尭尮尯尰尲尳尵尶尷屃屄屆屇屌屍屒屓屔屖屗屘屚屛屜屝屟屢層屧",6,"屰屲",6,"屻屼屽屾岀岃",4,"岉岊岋岎岏岒岓岕岝",4,"岤",4], ["8d40","岪岮岯岰岲岴岶岹岺岻岼岾峀峂峃峅",5,"峌",5,"峓",5,"峚",6,"峢峣峧峩峫峬峮峯峱",9,"峼",4], ["8d80","崁崄崅崈",5,"崏",4,"崕崗崘崙崚崜崝崟",4,"崥崨崪崫崬崯",4,"崵",7,"崿",7,"嵈嵉嵍",10,"嵙嵚嵜嵞",10,"嵪嵭嵮嵰嵱嵲嵳嵵",12,"嶃",21,"嶚嶛嶜嶞嶟嶠"], ["8e40","嶡",21,"嶸",12,"巆",6,"巎",12,"巜巟巠巣巤巪巬巭"], ["8e80","巰巵巶巸",4,"巿帀帄帇帉帊帋帍帎帒帓帗帞",7,"帨",4,"帯帰帲",4,"帹帺帾帿幀幁幃幆",5,"幍",6,"幖",4,"幜幝幟幠幣",14,"幵幷幹幾庁庂広庅庈庉庌庍庎庒庘庛庝庡庢庣庤庨",4,"庮",4,"庴庺庻庼庽庿",6], ["8f40","廆廇廈廋",5,"廔廕廗廘廙廚廜",11,"廩廫",8,"廵廸廹廻廼廽弅弆弇弉弌弍弎弐弒弔弖弙弚弜弝弞弡弢弣弤"], ["8f80","弨弫弬弮弰弲",6,"弻弽弾弿彁",14,"彑彔彙彚彛彜彞彟彠彣彥彧彨彫彮彯彲彴彵彶彸彺彽彾彿徃徆徍徎徏徑従徔徖徚徛徝從徟徠徢",5,"復徫徬徯",5,"徶徸徹徺徻徾",4,"忇忈忊忋忎忓忔忕忚忛応忞忟忢忣忥忦忨忩忬忯忰忲忳忴忶忷忹忺忼怇"], ["9040","怈怉怋怌怐怑怓怗怘怚怞怟怢怣怤怬怭怮怰",4,"怶",4,"怽怾恀恄",6,"恌恎恏恑恓恔恖恗恘恛恜恞恟恠恡恥恦恮恱恲恴恵恷恾悀"], ["9080","悁悂悅悆悇悈悊悋悎悏悐悑悓悕悗悘悙悜悞悡悢悤悥悧悩悪悮悰悳悵悶悷悹悺悽",7,"惇惈惉惌",4,"惒惓惔惖惗惙惛惞惡",4,"惪惱惲惵惷惸惻",4,"愂愃愄愅愇愊愋愌愐",4,"愖愗愘愙愛愜愝愞愡愢愥愨愩愪愬",18,"慀",6], ["9140","慇慉態慍慏慐慒慓慔慖",6,"慞慟慠慡慣慤慥慦慩",6,"慱慲慳慴慶慸",18,"憌憍憏",4,"憕"], ["9180","憖",6,"憞",8,"憪憫憭",9,"憸",5,"憿懀懁懃",4,"應懌",4,"懓懕",16,"懧",13,"懶",8,"戀",5,"戇戉戓戔戙戜戝戞戠戣戦戧戨戩戫戭戯戰戱戲戵戶戸",4,"扂扄扅扆扊"], ["9240","扏扐払扖扗扙扚扜",6,"扤扥扨扱扲扴扵扷扸扺扻扽抁抂抃抅抆抇抈抋",5,"抔抙抜抝択抣抦抧抩抪抭抮抯抰抲抳抴抶抷抸抺抾拀拁"], ["9280","拃拋拏拑拕拝拞拠拡拤拪拫拰拲拵拸拹拺拻挀挃挄挅挆挊挋挌挍挏挐挒挓挔挕挗挘挙挜挦挧挩挬挭挮挰挱挳",5,"挻挼挾挿捀捁捄捇捈捊捑捒捓捔捖",7,"捠捤捥捦捨捪捫捬捯捰捲捳捴捵捸捹捼捽捾捿掁掃掄掅掆掋掍掑掓掔掕掗掙",6,"採掤掦掫掯掱掲掵掶掹掻掽掿揀"], ["9340","揁揂揃揅揇揈揊揋揌揑揓揔揕揗",6,"揟揢揤",4,"揫揬揮揯揰揱揳揵揷揹揺揻揼揾搃搄搆",4,"損搎搑搒搕",5,"搝搟搢搣搤"], ["9380","搥搧搨搩搫搮",5,"搵",4,"搻搼搾摀摂摃摉摋",6,"摓摕摖摗摙",4,"摟",7,"摨摪摫摬摮",9,"摻",6,"撃撆撈",8,"撓撔撗撘撚撛撜撝撟",4,"撥撦撧撨撪撫撯撱撲撳撴撶撹撻撽撾撿擁擃擄擆",6,"擏擑擓擔擕擖擙據"], ["9440","擛擜擝擟擠擡擣擥擧",24,"攁",7,"攊",7,"攓",4,"攙",8], ["9480","攢攣攤攦",4,"攬攭攰攱攲攳攷攺攼攽敀",4,"敆敇敊敋敍敎敐敒敓敔敗敘敚敜敟敠敡敤敥敧敨敩敪敭敮敯敱敳敵敶數",14,"斈斉斊斍斎斏斒斔斕斖斘斚斝斞斠斢斣斦斨斪斬斮斱",7,"斺斻斾斿旀旂旇旈旉旊旍旐旑旓旔旕旘",7,"旡旣旤旪旫"], ["9540","旲旳旴旵旸旹旻",4,"昁昄昅昇昈昉昋昍昐昑昒昖昗昘昚昛昜昞昡昢昣昤昦昩昪昫昬昮昰昲昳昷",4,"昽昿晀時晄",6,"晍晎晐晑晘"], ["9580","晙晛晜晝晞晠晢晣晥晧晩",4,"晱晲晳晵晸晹晻晼晽晿暀暁暃暅暆暈暉暊暋暍暎暏暐暒暓暔暕暘",4,"暞",8,"暩",4,"暯",4,"暵暶暷暸暺暻暼暽暿",25,"曚曞",7,"曧曨曪",5,"曱曵曶書曺曻曽朁朂會"], ["9640","朄朅朆朇朌朎朏朑朒朓朖朘朙朚朜朞朠",5,"朧朩朮朰朲朳朶朷朸朹朻朼朾朿杁杄杅杇杊杋杍杒杔杕杗",4,"杝杢杣杤杦杧杫杬杮東杴杶"], ["9680","杸杹杺杻杽枀枂枃枅枆枈枊枌枍枎枏枑枒枓枔枖枙枛枟枠枡枤枦枩枬枮枱枲枴枹",7,"柂柅",9,"柕柖柗柛柟柡柣柤柦柧柨柪柫柭柮柲柵",7,"柾栁栂栃栄栆栍栐栒栔栕栘",4,"栞栟栠栢",6,"栫",6,"栴栵栶栺栻栿桇桋桍桏桒桖",5], ["9740","桜桝桞桟桪桬",7,"桵桸",8,"梂梄梇",7,"梐梑梒梔梕梖梘",9,"梣梤梥梩梪梫梬梮梱梲梴梶梷梸"], ["9780","梹",6,"棁棃",5,"棊棌棎棏棐棑棓棔棖棗棙棛",4,"棡棢棤",9,"棯棲棳棴棶棷棸棻棽棾棿椀椂椃椄椆",4,"椌椏椑椓",11,"椡椢椣椥",7,"椮椯椱椲椳椵椶椷椸椺椻椼椾楀楁楃",16,"楕楖楘楙楛楜楟"], ["9840","楡楢楤楥楧楨楩楪楬業楯楰楲",4,"楺楻楽楾楿榁榃榅榊榋榌榎",5,"榖榗榙榚榝",9,"榩榪榬榮榯榰榲榳榵榶榸榹榺榼榽"], ["9880","榾榿槀槂",7,"構槍槏槑槒槓槕",5,"槜槝槞槡",11,"槮槯槰槱槳",9,"槾樀",9,"樋",11,"標",5,"樠樢",5,"権樫樬樭樮樰樲樳樴樶",6,"樿",4,"橅橆橈",7,"橑",6,"橚"], ["9940","橜",4,"橢橣橤橦",10,"橲",6,"橺橻橽橾橿檁檂檃檅",8,"檏檒",4,"檘",7,"檡",5], ["9980","檧檨檪檭",114,"欥欦欨",6], ["9a40","欯欰欱欳欴欵欶欸欻欼欽欿歀歁歂歄歅歈歊歋歍",11,"歚",7,"歨歩歫",13,"歺歽歾歿殀殅殈"], ["9a80","殌殎殏殐殑殔殕殗殘殙殜",4,"殢",7,"殫",7,"殶殸",6,"毀毃毄毆",4,"毌毎毐毑毘毚毜",4,"毢",7,"毬毭毮毰毱毲毴毶毷毸毺毻毼毾",6,"氈",4,"氎氒気氜氝氞氠氣氥氫氬氭氱氳氶氷氹氺氻氼氾氿汃汄汅汈汋",4,"汑汒汓汖汘"], ["9b40","汙汚汢汣汥汦汧汫",4,"汱汳汵汷汸決汻汼汿沀沄沇沊沋沍沎沑沒沕沖沗沘沚沜沝沞沠沢沨沬沯沰沴沵沶沷沺泀況泂泃泆泇泈泋泍泎泏泑泒泘"], ["9b80","泙泚泜泝泟泤泦泧泩泬泭泲泴泹泿洀洂洃洅洆洈洉洊洍洏洐洑洓洔洕洖洘洜洝洟",5,"洦洨洩洬洭洯洰洴洶洷洸洺洿浀浂浄浉浌浐浕浖浗浘浛浝浟浡浢浤浥浧浨浫浬浭浰浱浲浳浵浶浹浺浻浽",4,"涃涄涆涇涊涋涍涏涐涒涖",4,"涜涢涥涬涭涰涱涳涴涶涷涹",5,"淁淂淃淈淉淊"], ["9c40","淍淎淏淐淒淓淔淕淗淚淛淜淟淢淣淥淧淨淩淪淭淯淰淲淴淵淶淸淺淽",7,"渆渇済渉渋渏渒渓渕渘渙減渜渞渟渢渦渧渨渪測渮渰渱渳渵"], ["9c80","渶渷渹渻",7,"湅",7,"湏湐湑湒湕湗湙湚湜湝湞湠",10,"湬湭湯",14,"満溁溂溄溇溈溊",4,"溑",6,"溙溚溛溝溞溠溡溣溤溦溨溩溫溬溭溮溰溳溵溸溹溼溾溿滀滃滄滅滆滈滉滊滌滍滎滐滒滖滘滙滛滜滝滣滧滪",5], ["9d40","滰滱滲滳滵滶滷滸滺",7,"漃漄漅漇漈漊",4,"漐漑漒漖",9,"漡漢漣漥漦漧漨漬漮漰漲漴漵漷",6,"漿潀潁潂"], ["9d80","潃潄潅潈潉潊潌潎",9,"潙潚潛潝潟潠潡潣潤潥潧",5,"潯潰潱潳潵潶潷潹潻潽",6,"澅澆澇澊澋澏",12,"澝澞澟澠澢",4,"澨",10,"澴澵澷澸澺",5,"濁濃",5,"濊",6,"濓",10,"濟濢濣濤濥"], ["9e40","濦",7,"濰",32,"瀒",7,"瀜",6,"瀤",6], ["9e80","瀫",9,"瀶瀷瀸瀺",17,"灍灎灐",13,"灟",11,"灮灱灲灳灴灷灹灺灻災炁炂炃炄炆炇炈炋炌炍炏炐炑炓炗炘炚炛炞",12,"炰炲炴炵炶為炾炿烄烅烆烇烉烋",12,"烚"], ["9f40","烜烝烞烠烡烢烣烥烪烮烰",6,"烸烺烻烼烾",10,"焋",4,"焑焒焔焗焛",10,"焧",7,"焲焳焴"], ["9f80","焵焷",13,"煆煇煈煉煋煍煏",12,"煝煟",4,"煥煩",4,"煯煰煱煴煵煶煷煹煻煼煾",5,"熅",4,"熋熌熍熎熐熑熒熓熕熖熗熚",4,"熡",6,"熩熪熫熭",5,"熴熶熷熸熺",8,"燄",9,"燏",4], ["a040","燖",9,"燡燢燣燤燦燨",5,"燯",9,"燺",11,"爇",19], ["a080","爛爜爞",9,"爩爫爭爮爯爲爳爴爺爼爾牀",6,"牉牊牋牎牏牐牑牓牔牕牗牘牚牜牞牠牣牤牥牨牪牫牬牭牰牱牳牴牶牷牸牻牼牽犂犃犅",4,"犌犎犐犑犓",11,"犠",11,"犮犱犲犳犵犺",6,"狅狆狇狉狊狋狌狏狑狓狔狕狖狘狚狛"], ["a1a1"," 、。·ˉˇ¨〃々—~‖…‘’“”〔〕〈",7,"〖〗【】±×÷∶∧∨∑∏∪∩∈∷√⊥∥∠⌒⊙∫∮≡≌≈∽∝≠≮≯≤≥∞∵∴♂♀°′″℃$¤¢£‰§№☆★○●◎◇◆□■△▲※→←↑↓〓"], ["a2a1","ⅰ",9], ["a2b1","⒈",19,"⑴",19,"①",9], ["a2e5","㈠",9], ["a2f1","Ⅰ",11], ["a3a1","!"#¥%",88," ̄"], ["a4a1","ぁ",82], ["a5a1","ァ",85], ["a6a1","Α",16,"Σ",6], ["a6c1","α",16,"σ",6], ["a6e0","︵︶︹︺︿﹀︽︾﹁﹂﹃﹄"], ["a6ee","︻︼︷︸︱"], ["a6f4","︳︴"], ["a7a1","А",5,"ЁЖ",25], ["a7d1","а",5,"ёж",25], ["a840","ˊˋ˙–―‥‵℅℉↖↗↘↙∕∟∣≒≦≧⊿═",35,"▁",6], ["a880","█",7,"▓▔▕▼▽◢◣◤◥☉⊕〒〝〞"], ["a8a1","āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜüêɑ"], ["a8bd","ńň"], ["a8c0","ɡ"], ["a8c5","ㄅ",36], ["a940","〡",8,"㊣㎎㎏㎜㎝㎞㎡㏄㏎㏑㏒㏕︰¬¦"], ["a959","℡㈱"], ["a95c","‐"], ["a960","ー゛゜ヽヾ〆ゝゞ﹉",9,"﹔﹕﹖﹗﹙",8], ["a980","﹢",4,"﹨﹩﹪﹫"], ["a996","〇"], ["a9a4","─",75], ["aa40","狜狝狟狢",5,"狪狫狵狶狹狽狾狿猀猂猄",5,"猋猌猍猏猐猑猒猔猘猙猚猟猠猣猤猦猧猨猭猯猰猲猳猵猶猺猻猼猽獀",8], ["aa80","獉獊獋獌獎獏獑獓獔獕獖獘",7,"獡",10,"獮獰獱"], ["ab40","獲",11,"獿",4,"玅玆玈玊玌玍玏玐玒玓玔玕玗玘玙玚玜玝玞玠玡玣",5,"玪玬玭玱玴玵玶玸玹玼玽玾玿珁珃",4], ["ab80","珋珌珎珒",6,"珚珛珜珝珟珡珢珣珤珦珨珪珫珬珮珯珰珱珳",4], ["ac40","珸",10,"琄琇琈琋琌琍琎琑",8,"琜",5,"琣琤琧琩琫琭琯琱琲琷",4,"琽琾琿瑀瑂",11], ["ac80","瑎",6,"瑖瑘瑝瑠",12,"瑮瑯瑱",4,"瑸瑹瑺"], ["ad40","瑻瑼瑽瑿璂璄璅璆璈璉璊璌璍璏璑",10,"璝璟",7,"璪",15,"璻",12], ["ad80","瓈",9,"瓓",8,"瓝瓟瓡瓥瓧",6,"瓰瓱瓲"], ["ae40","瓳瓵瓸",6,"甀甁甂甃甅",7,"甎甐甒甔甕甖甗甛甝甞甠",4,"甦甧甪甮甴甶甹甼甽甿畁畂畃畄畆畇畉畊畍畐畑畒畓畕畖畗畘"], ["ae80","畝",7,"畧畨畩畫",6,"畳畵當畷畺",4,"疀疁疂疄疅疇"], ["af40","疈疉疊疌疍疎疐疓疕疘疛疜疞疢疦",4,"疭疶疷疺疻疿痀痁痆痋痌痎痏痐痑痓痗痙痚痜痝痟痠痡痥痩痬痭痮痯痲痳痵痶痷痸痺痻痽痾瘂瘄瘆瘇"], ["af80","瘈瘉瘋瘍瘎瘏瘑瘒瘓瘔瘖瘚瘜瘝瘞瘡瘣瘧瘨瘬瘮瘯瘱瘲瘶瘷瘹瘺瘻瘽癁療癄"], ["b040","癅",6,"癎",5,"癕癗",4,"癝癟癠癡癢癤",6,"癬癭癮癰",7,"癹発發癿皀皁皃皅皉皊皌皍皏皐皒皔皕皗皘皚皛"], ["b080","皜",7,"皥",8,"皯皰皳皵",9,"盀盁盃啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥"], ["b140","盄盇盉盋盌盓盕盙盚盜盝盞盠",4,"盦",7,"盰盳盵盶盷盺盻盽盿眀眂眃眅眆眊県眎",10,"眛眜眝眞眡眣眤眥眧眪眫"], ["b180","眬眮眰",4,"眹眻眽眾眿睂睄睅睆睈",7,"睒",7,"睜薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳"], ["b240","睝睞睟睠睤睧睩睪睭",11,"睺睻睼瞁瞂瞃瞆",5,"瞏瞐瞓",11,"瞡瞣瞤瞦瞨瞫瞭瞮瞯瞱瞲瞴瞶",4], ["b280","瞼瞾矀",12,"矎",8,"矘矙矚矝",4,"矤病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖"], ["b340","矦矨矪矯矰矱矲矴矵矷矹矺矻矼砃",5,"砊砋砎砏砐砓砕砙砛砞砠砡砢砤砨砪砫砮砯砱砲砳砵砶砽砿硁硂硃硄硆硈硉硊硋硍硏硑硓硔硘硙硚"], ["b380","硛硜硞",11,"硯",7,"硸硹硺硻硽",6,"场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚"], ["b440","碄碅碆碈碊碋碏碐碒碔碕碖碙碝碞碠碢碤碦碨",7,"碵碶碷碸確碻碼碽碿磀磂磃磄磆磇磈磌磍磎磏磑磒磓磖磗磘磚",9], ["b480","磤磥磦磧磩磪磫磭",4,"磳磵磶磸磹磻",5,"礂礃礄礆",6,"础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮"], ["b540","礍",5,"礔",9,"礟",4,"礥",14,"礵",4,"礽礿祂祃祄祅祇祊",8,"祔祕祘祙祡祣"], ["b580","祤祦祩祪祫祬祮祰",6,"祹祻",4,"禂禃禆禇禈禉禋禌禍禎禐禑禒怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠"], ["b640","禓",6,"禛",11,"禨",10,"禴",4,"禼禿秂秄秅秇秈秊秌秎秏秐秓秔秖秗秙",5,"秠秡秢秥秨秪"], ["b680","秬秮秱",6,"秹秺秼秾秿稁稄稅稇稈稉稊稌稏",4,"稕稖稘稙稛稜丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二"], ["b740","稝稟稡稢稤",14,"稴稵稶稸稺稾穀",5,"穇",9,"穒",4,"穘",16], ["b780","穩",6,"穱穲穳穵穻穼穽穾窂窅窇窉窊窋窌窎窏窐窓窔窙窚窛窞窡窢贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服"], ["b840","窣窤窧窩窪窫窮",4,"窴",10,"竀",10,"竌",9,"竗竘竚竛竜竝竡竢竤竧",5,"竮竰竱竲竳"], ["b880","竴",4,"竻竼竾笀笁笂笅笇笉笌笍笎笐笒笓笖笗笘笚笜笝笟笡笢笣笧笩笭浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹"], ["b940","笯笰笲笴笵笶笷笹笻笽笿",5,"筆筈筊筍筎筓筕筗筙筜筞筟筡筣",10,"筯筰筳筴筶筸筺筼筽筿箁箂箃箄箆",6,"箎箏"], ["b980","箑箒箓箖箘箙箚箛箞箟箠箣箤箥箮箯箰箲箳箵箶箷箹",7,"篂篃範埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈"], ["ba40","篅篈築篊篋篍篎篏篐篒篔",4,"篛篜篞篟篠篢篣篤篧篨篩篫篬篭篯篰篲",4,"篸篹篺篻篽篿",7,"簈簉簊簍簎簐",5,"簗簘簙"], ["ba80","簚",4,"簠",5,"簨簩簫",12,"簹",5,"籂骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖"], ["bb40","籃",9,"籎",36,"籵",5,"籾",9], ["bb80","粈粊",6,"粓粔粖粙粚粛粠粡粣粦粧粨粩粫粬粭粯粰粴",4,"粺粻弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕"], ["bc40","粿糀糂糃糄糆糉糋糎",6,"糘糚糛糝糞糡",6,"糩",5,"糰",7,"糹糺糼",13,"紋",5], ["bc80","紑",14,"紡紣紤紥紦紨紩紪紬紭紮細",6,"肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件"], ["bd40","紷",54,"絯",7], ["bd80","絸",32,"健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸"], ["be40","継",12,"綧",6,"綯",42], ["be80","線",32,"尽劲荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵觉决诀绝均菌钧军君峻"], ["bf40","緻",62], ["bf80","縺縼",4,"繂",4,"繈",21,"俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀"], ["c040","繞",35,"纃",23,"纜纝纞"], ["c080","纮纴纻纼绖绤绬绹缊缐缞缷缹缻",6,"罃罆",9,"罒罓馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐"], ["c140","罖罙罛罜罝罞罠罣",4,"罫罬罭罯罰罳罵罶罷罸罺罻罼罽罿羀羂",7,"羋羍羏",4,"羕",4,"羛羜羠羢羣羥羦羨",6,"羱"], ["c180","羳",4,"羺羻羾翀翂翃翄翆翇翈翉翋翍翏",4,"翖翗翙",5,"翢翣痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿"], ["c240","翤翧翨翪翫翬翭翯翲翴",6,"翽翾翿耂耇耈耉耊耎耏耑耓耚耛耝耞耟耡耣耤耫",5,"耲耴耹耺耼耾聀聁聄聅聇聈聉聎聏聐聑聓聕聖聗"], ["c280","聙聛",13,"聫",5,"聲",11,"隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫"], ["c340","聾肁肂肅肈肊肍",5,"肔肕肗肙肞肣肦肧肨肬肰肳肵肶肸肹肻胅胇",4,"胏",6,"胘胟胠胢胣胦胮胵胷胹胻胾胿脀脁脃脄脅脇脈脋"], ["c380","脌脕脗脙脛脜脝脟",12,"脭脮脰脳脴脵脷脹",4,"脿谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸"], ["c440","腀",5,"腇腉腍腎腏腒腖腗腘腛",4,"腡腢腣腤腦腨腪腫腬腯腲腳腵腶腷腸膁膃",4,"膉膋膌膍膎膐膒",5,"膙膚膞",4,"膤膥"], ["c480","膧膩膫",7,"膴",5,"膼膽膾膿臄臅臇臈臉臋臍",6,"摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁"], ["c540","臔",14,"臤臥臦臨臩臫臮",4,"臵",5,"臽臿舃與",4,"舎舏舑舓舕",5,"舝舠舤舥舦舧舩舮舲舺舼舽舿"], ["c580","艀艁艂艃艅艆艈艊艌艍艎艐",7,"艙艛艜艝艞艠",7,"艩拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗"], ["c640","艪艫艬艭艱艵艶艷艸艻艼芀芁芃芅芆芇芉芌芐芓芔芕芖芚芛芞芠芢芣芧芲芵芶芺芻芼芿苀苂苃苅苆苉苐苖苙苚苝苢苧苨苩苪苬苭苮苰苲苳苵苶苸"], ["c680","苺苼",4,"茊茋茍茐茒茓茖茘茙茝",9,"茩茪茮茰茲茷茻茽啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐"], ["c740","茾茿荁荂荄荅荈荊",4,"荓荕",4,"荝荢荰",6,"荹荺荾",6,"莇莈莊莋莌莍莏莐莑莔莕莖莗莙莚莝莟莡",6,"莬莭莮"], ["c780","莯莵莻莾莿菂菃菄菆菈菉菋菍菎菐菑菒菓菕菗菙菚菛菞菢菣菤菦菧菨菫菬菭恰洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠"], ["c840","菮華菳",4,"菺菻菼菾菿萀萂萅萇萈萉萊萐萒",5,"萙萚萛萞",5,"萩",7,"萲",5,"萹萺萻萾",7,"葇葈葉"], ["c880","葊",6,"葒",4,"葘葝葞葟葠葢葤",4,"葪葮葯葰葲葴葷葹葻葼取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁"], ["c940","葽",4,"蒃蒄蒅蒆蒊蒍蒏",7,"蒘蒚蒛蒝蒞蒟蒠蒢",12,"蒰蒱蒳蒵蒶蒷蒻蒼蒾蓀蓂蓃蓅蓆蓇蓈蓋蓌蓎蓏蓒蓔蓕蓗"], ["c980","蓘",4,"蓞蓡蓢蓤蓧",4,"蓭蓮蓯蓱",10,"蓽蓾蔀蔁蔂伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳"], ["ca40","蔃",8,"蔍蔎蔏蔐蔒蔔蔕蔖蔘蔙蔛蔜蔝蔞蔠蔢",8,"蔭",9,"蔾",4,"蕄蕅蕆蕇蕋",10], ["ca80","蕗蕘蕚蕛蕜蕝蕟",4,"蕥蕦蕧蕩",8,"蕳蕵蕶蕷蕸蕼蕽蕿薀薁省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱"], ["cb40","薂薃薆薈",6,"薐",10,"薝",6,"薥薦薧薩薫薬薭薱",5,"薸薺",6,"藂",6,"藊",4,"藑藒"], ["cb80","藔藖",5,"藝",6,"藥藦藧藨藪",14,"恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔"], ["cc40","藹藺藼藽藾蘀",4,"蘆",10,"蘒蘓蘔蘕蘗",15,"蘨蘪",13,"蘹蘺蘻蘽蘾蘿虀"], ["cc80","虁",11,"虒虓處",4,"虛虜虝號虠虡虣",7,"獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃"], ["cd40","虭虯虰虲",6,"蚃",6,"蚎",4,"蚔蚖",5,"蚞",4,"蚥蚦蚫蚭蚮蚲蚳蚷蚸蚹蚻",4,"蛁蛂蛃蛅蛈蛌蛍蛒蛓蛕蛖蛗蛚蛜"], ["cd80","蛝蛠蛡蛢蛣蛥蛦蛧蛨蛪蛫蛬蛯蛵蛶蛷蛺蛻蛼蛽蛿蜁蜄蜅蜆蜋蜌蜎蜏蜐蜑蜔蜖汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威"], ["ce40","蜙蜛蜝蜟蜠蜤蜦蜧蜨蜪蜫蜬蜭蜯蜰蜲蜳蜵蜶蜸蜹蜺蜼蜽蝀",6,"蝊蝋蝍蝏蝐蝑蝒蝔蝕蝖蝘蝚",5,"蝡蝢蝦",7,"蝯蝱蝲蝳蝵"], ["ce80","蝷蝸蝹蝺蝿螀螁螄螆螇螉螊螌螎",4,"螔螕螖螘",6,"螠",4,"巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺"], ["cf40","螥螦螧螩螪螮螰螱螲螴螶螷螸螹螻螼螾螿蟁",4,"蟇蟈蟉蟌",4,"蟔",6,"蟜蟝蟞蟟蟡蟢蟣蟤蟦蟧蟨蟩蟫蟬蟭蟯",9], ["cf80","蟺蟻蟼蟽蟿蠀蠁蠂蠄",5,"蠋",7,"蠔蠗蠘蠙蠚蠜",4,"蠣稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓"], ["d040","蠤",13,"蠳",5,"蠺蠻蠽蠾蠿衁衂衃衆",5,"衎",5,"衕衖衘衚",6,"衦衧衪衭衯衱衳衴衵衶衸衹衺"], ["d080","衻衼袀袃袆袇袉袊袌袎袏袐袑袓袔袕袗",4,"袝",4,"袣袥",5,"小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄"], ["d140","袬袮袯袰袲",4,"袸袹袺袻袽袾袿裀裃裄裇裈裊裋裌裍裏裐裑裓裖裗裚",4,"裠裡裦裧裩",6,"裲裵裶裷裺裻製裿褀褁褃",5], ["d180","褉褋",4,"褑褔",4,"褜",4,"褢褣褤褦褧褨褩褬褭褮褯褱褲褳褵褷选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶"], ["d240","褸",8,"襂襃襅",24,"襠",5,"襧",19,"襼"], ["d280","襽襾覀覂覄覅覇",26,"摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐"], ["d340","覢",30,"觃觍觓觔觕觗觘觙觛觝觟觠觡觢觤觧觨觩觪觬觭觮觰觱觲觴",6], ["d380","觻",4,"訁",5,"計",21,"印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉"], ["d440","訞",31,"訿",8,"詉",21], ["d480","詟",25,"詺",6,"浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧"], ["d540","誁",7,"誋",7,"誔",46], ["d580","諃",32,"铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政"], ["d640","諤",34,"謈",27], ["d680","謤謥謧",30,"帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑"], ["d740","譆",31,"譧",4,"譭",25], ["d780","讇",24,"讬讱讻诇诐诪谉谞住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座"], ["d840","谸",8,"豂豃豄豅豈豊豋豍",7,"豖豗豘豙豛",5,"豣",6,"豬",6,"豴豵豶豷豻",6,"貃貄貆貇"], ["d880","貈貋貍",6,"貕貖貗貙",20,"亍丌兀丐廿卅丕亘丞鬲孬噩丨禺丿匕乇夭爻卮氐囟胤馗毓睾鼗丶亟鼐乜乩亓芈孛啬嘏仄厍厝厣厥厮靥赝匚叵匦匮匾赜卦卣刂刈刎刭刳刿剀剌剞剡剜蒯剽劂劁劐劓冂罔亻仃仉仂仨仡仫仞伛仳伢佤仵伥伧伉伫佞佧攸佚佝"], ["d940","貮",62], ["d980","賭",32,"佟佗伲伽佶佴侑侉侃侏佾佻侪佼侬侔俦俨俪俅俚俣俜俑俟俸倩偌俳倬倏倮倭俾倜倌倥倨偾偃偕偈偎偬偻傥傧傩傺僖儆僭僬僦僮儇儋仝氽佘佥俎龠汆籴兮巽黉馘冁夔勹匍訇匐凫夙兕亠兖亳衮袤亵脔裒禀嬴蠃羸冫冱冽冼"], ["da40","贎",14,"贠赑赒赗赟赥赨赩赪赬赮赯赱赲赸",8,"趂趃趆趇趈趉趌",4,"趒趓趕",9,"趠趡"], ["da80","趢趤",12,"趲趶趷趹趻趽跀跁跂跅跇跈跉跊跍跐跒跓跔凇冖冢冥讠讦讧讪讴讵讷诂诃诋诏诎诒诓诔诖诘诙诜诟诠诤诨诩诮诰诳诶诹诼诿谀谂谄谇谌谏谑谒谔谕谖谙谛谘谝谟谠谡谥谧谪谫谮谯谲谳谵谶卩卺阝阢阡阱阪阽阼陂陉陔陟陧陬陲陴隈隍隗隰邗邛邝邙邬邡邴邳邶邺"], ["db40","跕跘跙跜跠跡跢跥跦跧跩跭跮跰跱跲跴跶跼跾",6,"踆踇踈踋踍踎踐踑踒踓踕",7,"踠踡踤",4,"踫踭踰踲踳踴踶踷踸踻踼踾"], ["db80","踿蹃蹅蹆蹌",4,"蹓",5,"蹚",11,"蹧蹨蹪蹫蹮蹱邸邰郏郅邾郐郄郇郓郦郢郜郗郛郫郯郾鄄鄢鄞鄣鄱鄯鄹酃酆刍奂劢劬劭劾哿勐勖勰叟燮矍廴凵凼鬯厶弁畚巯坌垩垡塾墼壅壑圩圬圪圳圹圮圯坜圻坂坩垅坫垆坼坻坨坭坶坳垭垤垌垲埏垧垴垓垠埕埘埚埙埒垸埴埯埸埤埝"], ["dc40","蹳蹵蹷",4,"蹽蹾躀躂躃躄躆躈",6,"躑躒躓躕",6,"躝躟",11,"躭躮躰躱躳",6,"躻",7], ["dc80","軃",10,"軏",21,"堋堍埽埭堀堞堙塄堠塥塬墁墉墚墀馨鼙懿艹艽艿芏芊芨芄芎芑芗芙芫芸芾芰苈苊苣芘芷芮苋苌苁芩芴芡芪芟苄苎芤苡茉苷苤茏茇苜苴苒苘茌苻苓茑茚茆茔茕苠苕茜荑荛荜茈莒茼茴茱莛荞茯荏荇荃荟荀茗荠茭茺茳荦荥"], ["dd40","軥",62], ["dd80","輤",32,"荨茛荩荬荪荭荮莰荸莳莴莠莪莓莜莅荼莶莩荽莸荻莘莞莨莺莼菁萁菥菘堇萘萋菝菽菖萜萸萑萆菔菟萏萃菸菹菪菅菀萦菰菡葜葑葚葙葳蒇蒈葺蒉葸萼葆葩葶蒌蒎萱葭蓁蓍蓐蓦蒽蓓蓊蒿蒺蓠蒡蒹蒴蒗蓥蓣蔌甍蔸蓰蔹蔟蔺"], ["de40","轅",32,"轪辀辌辒辝辠辡辢辤辥辦辧辪辬辭辮辯農辳辴辵辷辸辺辻込辿迀迃迆"], ["de80","迉",4,"迏迒迖迗迚迠迡迣迧迬迯迱迲迴迵迶迺迻迼迾迿逇逈逌逎逓逕逘蕖蔻蓿蓼蕙蕈蕨蕤蕞蕺瞢蕃蕲蕻薤薨薇薏蕹薮薜薅薹薷薰藓藁藜藿蘧蘅蘩蘖蘼廾弈夼奁耷奕奚奘匏尢尥尬尴扌扪抟抻拊拚拗拮挢拶挹捋捃掭揶捱捺掎掴捭掬掊捩掮掼揲揸揠揿揄揞揎摒揆掾摅摁搋搛搠搌搦搡摞撄摭撖"], ["df40","這逜連逤逥逧",5,"逰",4,"逷逹逺逽逿遀遃遅遆遈",4,"過達違遖遙遚遜",5,"遤遦遧適遪遫遬遯",4,"遶",6,"遾邁"], ["df80","還邅邆邇邉邊邌",4,"邒邔邖邘邚邜邞邟邠邤邥邧邨邩邫邭邲邷邼邽邿郀摺撷撸撙撺擀擐擗擤擢攉攥攮弋忒甙弑卟叱叽叩叨叻吒吖吆呋呒呓呔呖呃吡呗呙吣吲咂咔呷呱呤咚咛咄呶呦咝哐咭哂咴哒咧咦哓哔呲咣哕咻咿哌哙哚哜咩咪咤哝哏哞唛哧唠哽唔哳唢唣唏唑唧唪啧喏喵啉啭啁啕唿啐唼"], ["e040","郂郃郆郈郉郋郌郍郒郔郕郖郘郙郚郞郟郠郣郤郥郩郪郬郮郰郱郲郳郵郶郷郹郺郻郼郿鄀鄁鄃鄅",19,"鄚鄛鄜"], ["e080","鄝鄟鄠鄡鄤",10,"鄰鄲",6,"鄺",8,"酄唷啖啵啶啷唳唰啜喋嗒喃喱喹喈喁喟啾嗖喑啻嗟喽喾喔喙嗪嗷嗉嘟嗑嗫嗬嗔嗦嗝嗄嗯嗥嗲嗳嗌嗍嗨嗵嗤辔嘞嘈嘌嘁嘤嘣嗾嘀嘧嘭噘嘹噗嘬噍噢噙噜噌噔嚆噤噱噫噻噼嚅嚓嚯囔囗囝囡囵囫囹囿圄圊圉圜帏帙帔帑帱帻帼"], ["e140","酅酇酈酑酓酔酕酖酘酙酛酜酟酠酦酧酨酫酭酳酺酻酼醀",4,"醆醈醊醎醏醓",6,"醜",5,"醤",5,"醫醬醰醱醲醳醶醷醸醹醻"], ["e180","醼",10,"釈釋釐釒",9,"針",8,"帷幄幔幛幞幡岌屺岍岐岖岈岘岙岑岚岜岵岢岽岬岫岱岣峁岷峄峒峤峋峥崂崃崧崦崮崤崞崆崛嵘崾崴崽嵬嵛嵯嵝嵫嵋嵊嵩嵴嶂嶙嶝豳嶷巅彳彷徂徇徉後徕徙徜徨徭徵徼衢彡犭犰犴犷犸狃狁狎狍狒狨狯狩狲狴狷猁狳猃狺"], ["e240","釦",62], ["e280","鈥",32,"狻猗猓猡猊猞猝猕猢猹猥猬猸猱獐獍獗獠獬獯獾舛夥飧夤夂饣饧",5,"饴饷饽馀馄馇馊馍馐馑馓馔馕庀庑庋庖庥庠庹庵庾庳赓廒廑廛廨廪膺忄忉忖忏怃忮怄忡忤忾怅怆忪忭忸怙怵怦怛怏怍怩怫怊怿怡恸恹恻恺恂"], ["e340","鉆",45,"鉵",16], ["e380","銆",7,"銏",24,"恪恽悖悚悭悝悃悒悌悛惬悻悱惝惘惆惚悴愠愦愕愣惴愀愎愫慊慵憬憔憧憷懔懵忝隳闩闫闱闳闵闶闼闾阃阄阆阈阊阋阌阍阏阒阕阖阗阙阚丬爿戕氵汔汜汊沣沅沐沔沌汨汩汴汶沆沩泐泔沭泷泸泱泗沲泠泖泺泫泮沱泓泯泾"], ["e440","銨",5,"銯",24,"鋉",31], ["e480","鋩",32,"洹洧洌浃浈洇洄洙洎洫浍洮洵洚浏浒浔洳涑浯涞涠浞涓涔浜浠浼浣渚淇淅淞渎涿淠渑淦淝淙渖涫渌涮渫湮湎湫溲湟溆湓湔渲渥湄滟溱溘滠漭滢溥溧溽溻溷滗溴滏溏滂溟潢潆潇漤漕滹漯漶潋潴漪漉漩澉澍澌潸潲潼潺濑"], ["e540","錊",51,"錿",10], ["e580","鍊",31,"鍫濉澧澹澶濂濡濮濞濠濯瀚瀣瀛瀹瀵灏灞宀宄宕宓宥宸甯骞搴寤寮褰寰蹇謇辶迓迕迥迮迤迩迦迳迨逅逄逋逦逑逍逖逡逵逶逭逯遄遑遒遐遨遘遢遛暹遴遽邂邈邃邋彐彗彖彘尻咫屐屙孱屣屦羼弪弩弭艴弼鬻屮妁妃妍妩妪妣"], ["e640","鍬",34,"鎐",27], ["e680","鎬",29,"鏋鏌鏍妗姊妫妞妤姒妲妯姗妾娅娆姝娈姣姘姹娌娉娲娴娑娣娓婀婧婊婕娼婢婵胬媪媛婷婺媾嫫媲嫒嫔媸嫠嫣嫱嫖嫦嫘嫜嬉嬗嬖嬲嬷孀尕尜孚孥孳孑孓孢驵驷驸驺驿驽骀骁骅骈骊骐骒骓骖骘骛骜骝骟骠骢骣骥骧纟纡纣纥纨纩"], ["e740","鏎",7,"鏗",54], ["e780","鐎",32,"纭纰纾绀绁绂绉绋绌绐绔绗绛绠绡绨绫绮绯绱绲缍绶绺绻绾缁缂缃缇缈缋缌缏缑缒缗缙缜缛缟缡",6,"缪缫缬缭缯",4,"缵幺畿巛甾邕玎玑玮玢玟珏珂珑玷玳珀珉珈珥珙顼琊珩珧珞玺珲琏琪瑛琦琥琨琰琮琬"], ["e840","鐯",14,"鐿",43,"鑬鑭鑮鑯"], ["e880","鑰",20,"钑钖钘铇铏铓铔铚铦铻锜锠琛琚瑁瑜瑗瑕瑙瑷瑭瑾璜璎璀璁璇璋璞璨璩璐璧瓒璺韪韫韬杌杓杞杈杩枥枇杪杳枘枧杵枨枞枭枋杷杼柰栉柘栊柩枰栌柙枵柚枳柝栀柃枸柢栎柁柽栲栳桠桡桎桢桄桤梃栝桕桦桁桧桀栾桊桉栩梵梏桴桷梓桫棂楮棼椟椠棹"], ["e940","锧锳锽镃镈镋镕镚镠镮镴镵長",7,"門",42], ["e980","閫",32,"椤棰椋椁楗棣椐楱椹楠楂楝榄楫榀榘楸椴槌榇榈槎榉楦楣楹榛榧榻榫榭槔榱槁槊槟榕槠榍槿樯槭樗樘橥槲橄樾檠橐橛樵檎橹樽樨橘橼檑檐檩檗檫猷獒殁殂殇殄殒殓殍殚殛殡殪轫轭轱轲轳轵轶轸轷轹轺轼轾辁辂辄辇辋"], ["ea40","闌",27,"闬闿阇阓阘阛阞阠阣",6,"阫阬阭阯阰阷阸阹阺阾陁陃陊陎陏陑陒陓陖陗"], ["ea80","陘陙陚陜陝陞陠陣陥陦陫陭",4,"陳陸",12,"隇隉隊辍辎辏辘辚軎戋戗戛戟戢戡戥戤戬臧瓯瓴瓿甏甑甓攴旮旯旰昊昙杲昃昕昀炅曷昝昴昱昶昵耆晟晔晁晏晖晡晗晷暄暌暧暝暾曛曜曦曩贲贳贶贻贽赀赅赆赈赉赇赍赕赙觇觊觋觌觎觏觐觑牮犟牝牦牯牾牿犄犋犍犏犒挈挲掰"], ["eb40","隌階隑隒隓隕隖隚際隝",9,"隨",7,"隱隲隴隵隷隸隺隻隿雂雃雈雊雋雐雑雓雔雖",9,"雡",6,"雫"], ["eb80","雬雭雮雰雱雲雴雵雸雺電雼雽雿霂霃霅霊霋霌霐霑霒霔霕霗",4,"霝霟霠搿擘耄毪毳毽毵毹氅氇氆氍氕氘氙氚氡氩氤氪氲攵敕敫牍牒牖爰虢刖肟肜肓肼朊肽肱肫肭肴肷胧胨胩胪胛胂胄胙胍胗朐胝胫胱胴胭脍脎胲胼朕脒豚脶脞脬脘脲腈腌腓腴腙腚腱腠腩腼腽腭腧塍媵膈膂膑滕膣膪臌朦臊膻"], ["ec40","霡",8,"霫霬霮霯霱霳",4,"霺霻霼霽霿",18,"靔靕靗靘靚靜靝靟靣靤靦靧靨靪",7], ["ec80","靲靵靷",4,"靽",7,"鞆",4,"鞌鞎鞏鞐鞓鞕鞖鞗鞙",4,"臁膦欤欷欹歃歆歙飑飒飓飕飙飚殳彀毂觳斐齑斓於旆旄旃旌旎旒旖炀炜炖炝炻烀炷炫炱烨烊焐焓焖焯焱煳煜煨煅煲煊煸煺熘熳熵熨熠燠燔燧燹爝爨灬焘煦熹戾戽扃扈扉礻祀祆祉祛祜祓祚祢祗祠祯祧祺禅禊禚禧禳忑忐"], ["ed40","鞞鞟鞡鞢鞤",6,"鞬鞮鞰鞱鞳鞵",46], ["ed80","韤韥韨韮",4,"韴韷",23,"怼恝恚恧恁恙恣悫愆愍慝憩憝懋懑戆肀聿沓泶淼矶矸砀砉砗砘砑斫砭砜砝砹砺砻砟砼砥砬砣砩硎硭硖硗砦硐硇硌硪碛碓碚碇碜碡碣碲碹碥磔磙磉磬磲礅磴礓礤礞礴龛黹黻黼盱眄眍盹眇眈眚眢眙眭眦眵眸睐睑睇睃睚睨"], ["ee40","頏",62], ["ee80","顎",32,"睢睥睿瞍睽瞀瞌瞑瞟瞠瞰瞵瞽町畀畎畋畈畛畲畹疃罘罡罟詈罨罴罱罹羁罾盍盥蠲钅钆钇钋钊钌钍钏钐钔钗钕钚钛钜钣钤钫钪钭钬钯钰钲钴钶",4,"钼钽钿铄铈",6,"铐铑铒铕铖铗铙铘铛铞铟铠铢铤铥铧铨铪"], ["ef40","顯",5,"颋颎颒颕颙颣風",37,"飏飐飔飖飗飛飜飝飠",4], ["ef80","飥飦飩",30,"铩铫铮铯铳铴铵铷铹铼铽铿锃锂锆锇锉锊锍锎锏锒",4,"锘锛锝锞锟锢锪锫锩锬锱锲锴锶锷锸锼锾锿镂锵镄镅镆镉镌镎镏镒镓镔镖镗镘镙镛镞镟镝镡镢镤",8,"镯镱镲镳锺矧矬雉秕秭秣秫稆嵇稃稂稞稔"], ["f040","餈",4,"餎餏餑",28,"餯",26], ["f080","饊",9,"饖",12,"饤饦饳饸饹饻饾馂馃馉稹稷穑黏馥穰皈皎皓皙皤瓞瓠甬鸠鸢鸨",4,"鸲鸱鸶鸸鸷鸹鸺鸾鹁鹂鹄鹆鹇鹈鹉鹋鹌鹎鹑鹕鹗鹚鹛鹜鹞鹣鹦",6,"鹱鹭鹳疒疔疖疠疝疬疣疳疴疸痄疱疰痃痂痖痍痣痨痦痤痫痧瘃痱痼痿瘐瘀瘅瘌瘗瘊瘥瘘瘕瘙"], ["f140","馌馎馚",10,"馦馧馩",47], ["f180","駙",32,"瘛瘼瘢瘠癀瘭瘰瘿瘵癃瘾瘳癍癞癔癜癖癫癯翊竦穸穹窀窆窈窕窦窠窬窨窭窳衤衩衲衽衿袂袢裆袷袼裉裢裎裣裥裱褚裼裨裾裰褡褙褓褛褊褴褫褶襁襦襻疋胥皲皴矜耒耔耖耜耠耢耥耦耧耩耨耱耋耵聃聆聍聒聩聱覃顸颀颃"], ["f240","駺",62], ["f280","騹",32,"颉颌颍颏颔颚颛颞颟颡颢颥颦虍虔虬虮虿虺虼虻蚨蚍蚋蚬蚝蚧蚣蚪蚓蚩蚶蛄蚵蛎蚰蚺蚱蚯蛉蛏蚴蛩蛱蛲蛭蛳蛐蜓蛞蛴蛟蛘蛑蜃蜇蛸蜈蜊蜍蜉蜣蜻蜞蜥蜮蜚蜾蝈蜴蜱蜩蜷蜿螂蜢蝽蝾蝻蝠蝰蝌蝮螋蝓蝣蝼蝤蝙蝥螓螯螨蟒"], ["f340","驚",17,"驲骃骉骍骎骔骕骙骦骩",6,"骲骳骴骵骹骻骽骾骿髃髄髆",4,"髍髎髏髐髒體髕髖髗髙髚髛髜"], ["f380","髝髞髠髢髣髤髥髧髨髩髪髬髮髰",8,"髺髼",6,"鬄鬅鬆蟆螈螅螭螗螃螫蟥螬螵螳蟋蟓螽蟑蟀蟊蟛蟪蟠蟮蠖蠓蟾蠊蠛蠡蠹蠼缶罂罄罅舐竺竽笈笃笄笕笊笫笏筇笸笪笙笮笱笠笥笤笳笾笞筘筚筅筵筌筝筠筮筻筢筲筱箐箦箧箸箬箝箨箅箪箜箢箫箴篑篁篌篝篚篥篦篪簌篾篼簏簖簋"], ["f440","鬇鬉",5,"鬐鬑鬒鬔",10,"鬠鬡鬢鬤",10,"鬰鬱鬳",7,"鬽鬾鬿魀魆魊魋魌魎魐魒魓魕",5], ["f480","魛",32,"簟簪簦簸籁籀臾舁舂舄臬衄舡舢舣舭舯舨舫舸舻舳舴舾艄艉艋艏艚艟艨衾袅袈裘裟襞羝羟羧羯羰羲籼敉粑粝粜粞粢粲粼粽糁糇糌糍糈糅糗糨艮暨羿翎翕翥翡翦翩翮翳糸絷綦綮繇纛麸麴赳趄趔趑趱赧赭豇豉酊酐酎酏酤"], ["f540","魼",62], ["f580","鮻",32,"酢酡酰酩酯酽酾酲酴酹醌醅醐醍醑醢醣醪醭醮醯醵醴醺豕鹾趸跫踅蹙蹩趵趿趼趺跄跖跗跚跞跎跏跛跆跬跷跸跣跹跻跤踉跽踔踝踟踬踮踣踯踺蹀踹踵踽踱蹉蹁蹂蹑蹒蹊蹰蹶蹼蹯蹴躅躏躔躐躜躞豸貂貊貅貘貔斛觖觞觚觜"], ["f640","鯜",62], ["f680","鰛",32,"觥觫觯訾謦靓雩雳雯霆霁霈霏霎霪霭霰霾龀龃龅",5,"龌黾鼋鼍隹隼隽雎雒瞿雠銎銮鋈錾鍪鏊鎏鐾鑫鱿鲂鲅鲆鲇鲈稣鲋鲎鲐鲑鲒鲔鲕鲚鲛鲞",5,"鲥",4,"鲫鲭鲮鲰",7,"鲺鲻鲼鲽鳄鳅鳆鳇鳊鳋"], ["f740","鰼",62], ["f780","鱻鱽鱾鲀鲃鲄鲉鲊鲌鲏鲓鲖鲗鲘鲙鲝鲪鲬鲯鲹鲾",4,"鳈鳉鳑鳒鳚鳛鳠鳡鳌",4,"鳓鳔鳕鳗鳘鳙鳜鳝鳟鳢靼鞅鞑鞒鞔鞯鞫鞣鞲鞴骱骰骷鹘骶骺骼髁髀髅髂髋髌髑魅魃魇魉魈魍魑飨餍餮饕饔髟髡髦髯髫髻髭髹鬈鬏鬓鬟鬣麽麾縻麂麇麈麋麒鏖麝麟黛黜黝黠黟黢黩黧黥黪黯鼢鼬鼯鼹鼷鼽鼾齄"], ["f840","鳣",62], ["f880","鴢",32], ["f940","鵃",62], ["f980","鶂",32], ["fa40","鶣",62], ["fa80","鷢",32], ["fb40","鸃",27,"鸤鸧鸮鸰鸴鸻鸼鹀鹍鹐鹒鹓鹔鹖鹙鹝鹟鹠鹡鹢鹥鹮鹯鹲鹴",9,"麀"], ["fb80","麁麃麄麅麆麉麊麌",5,"麔",8,"麞麠",5,"麧麨麩麪"], ["fc40","麫",8,"麵麶麷麹麺麼麿",4,"黅黆黇黈黊黋黌黐黒黓黕黖黗黙黚點黡黣黤黦黨黫黬黭黮黰",8,"黺黽黿",6], ["fc80","鼆",4,"鼌鼏鼑鼒鼔鼕鼖鼘鼚",5,"鼡鼣",8,"鼭鼮鼰鼱"], ["fd40","鼲",4,"鼸鼺鼼鼿",4,"齅",10,"齒",38], ["fd80","齹",5,"龁龂龍",11,"龜龝龞龡",4,"郎凉秊裏隣"], ["fe40","兀嗀﨎﨏﨑﨓﨔礼﨟蘒﨡﨣﨤﨧﨨﨩"] ] [ ["0","\u0000",127], ["8141","갂갃갅갆갋",4,"갘갞갟갡갢갣갥",6,"갮갲갳갴"], ["8161","갵갶갷갺갻갽갾갿걁",9,"걌걎",5,"걕"], ["8181","걖걗걙걚걛걝",18,"걲걳걵걶걹걻",4,"겂겇겈겍겎겏겑겒겓겕",6,"겞겢",5,"겫겭겮겱",6,"겺겾겿곀곂곃곅곆곇곉곊곋곍",7,"곖곘",7,"곢곣곥곦곩곫곭곮곲곴곷",4,"곾곿괁괂괃괅괇",4,"괎괐괒괓"], ["8241","괔괕괖괗괙괚괛괝괞괟괡",7,"괪괫괮",5], ["8261","괶괷괹괺괻괽",6,"굆굈굊",5,"굑굒굓굕굖굗"], ["8281","굙",7,"굢굤",7,"굮굯굱굲굷굸굹굺굾궀궃",4,"궊궋궍궎궏궑",10,"궞",5,"궥",17,"궸",7,"귂귃귅귆귇귉",6,"귒귔",7,"귝귞귟귡귢귣귥",18], ["8341","귺귻귽귾긂",5,"긊긌긎",5,"긕",7], ["8361","긝",18,"긲긳긵긶긹긻긼"], ["8381","긽긾긿깂깄깇깈깉깋깏깑깒깓깕깗",4,"깞깢깣깤깦깧깪깫깭깮깯깱",6,"깺깾",5,"꺆",5,"꺍",46,"꺿껁껂껃껅",6,"껎껒",5,"껚껛껝",8], ["8441","껦껧껩껪껬껮",5,"껵껶껷껹껺껻껽",8], ["8461","꼆꼉꼊꼋꼌꼎꼏꼑",18], ["8481","꼤",7,"꼮꼯꼱꼳꼵",6,"꼾꽀꽄꽅꽆꽇꽊",5,"꽑",10,"꽞",5,"꽦",18,"꽺",5,"꾁꾂꾃꾅꾆꾇꾉",6,"꾒꾓꾔꾖",5,"꾝",26,"꾺꾻꾽꾾"], ["8541","꾿꿁",5,"꿊꿌꿏",4,"꿕",6,"꿝",4], ["8561","꿢",5,"꿪",5,"꿲꿳꿵꿶꿷꿹",6,"뀂뀃"], ["8581","뀅",6,"뀍뀎뀏뀑뀒뀓뀕",6,"뀞",9,"뀩",26,"끆끇끉끋끍끏끐끑끒끖끘끚끛끜끞",29,"끾끿낁낂낃낅",6,"낎낐낒",5,"낛낝낞낣낤"], ["8641","낥낦낧낪낰낲낶낷낹낺낻낽",6,"냆냊",5,"냒"], ["8661","냓냕냖냗냙",6,"냡냢냣냤냦",10], ["8681","냱",22,"넊넍넎넏넑넔넕넖넗넚넞",4,"넦넧넩넪넫넭",6,"넶넺",5,"녂녃녅녆녇녉",6,"녒녓녖녗녙녚녛녝녞녟녡",22,"녺녻녽녾녿놁놃",4,"놊놌놎놏놐놑놕놖놗놙놚놛놝"], ["8741","놞",9,"놩",15], ["8761","놹",18,"뇍뇎뇏뇑뇒뇓뇕"], ["8781","뇖",5,"뇞뇠",7,"뇪뇫뇭뇮뇯뇱",7,"뇺뇼뇾",5,"눆눇눉눊눍",6,"눖눘눚",5,"눡",18,"눵",6,"눽",26,"뉙뉚뉛뉝뉞뉟뉡",6,"뉪",4], ["8841","뉯",4,"뉶",5,"뉽",6,"늆늇늈늊",4], ["8861","늏늒늓늕늖늗늛",4,"늢늤늧늨늩늫늭늮늯늱늲늳늵늶늷"], ["8881","늸",15,"닊닋닍닎닏닑닓",4,"닚닜닞닟닠닡닣닧닩닪닰닱닲닶닼닽닾댂댃댅댆댇댉",6,"댒댖",5,"댝",54,"덗덙덚덝덠덡덢덣"], ["8941","덦덨덪덬덭덯덲덳덵덶덷덹",6,"뎂뎆",5,"뎍"], ["8961","뎎뎏뎑뎒뎓뎕",10,"뎢",5,"뎩뎪뎫뎭"], ["8981","뎮",21,"돆돇돉돊돍돏돑돒돓돖돘돚돜돞돟돡돢돣돥돦돧돩",18,"돽",18,"됑",6,"됙됚됛됝됞됟됡",6,"됪됬",7,"됵",15], ["8a41","둅",10,"둒둓둕둖둗둙",6,"둢둤둦"], ["8a61","둧",4,"둭",18,"뒁뒂"], ["8a81","뒃",4,"뒉",19,"뒞",5,"뒥뒦뒧뒩뒪뒫뒭",7,"뒶뒸뒺",5,"듁듂듃듅듆듇듉",6,"듑듒듓듔듖",5,"듞듟듡듢듥듧",4,"듮듰듲",5,"듹",26,"딖딗딙딚딝"], ["8b41","딞",5,"딦딫",4,"딲딳딵딶딷딹",6,"땂땆"], ["8b61","땇땈땉땊땎땏땑땒땓땕",6,"땞땢",8], ["8b81","땫",52,"떢떣떥떦떧떩떬떭떮떯떲떶",4,"떾떿뗁뗂뗃뗅",6,"뗎뗒",5,"뗙",18,"뗭",18], ["8c41","똀",15,"똒똓똕똖똗똙",4], ["8c61","똞",6,"똦",5,"똭",6,"똵",5], ["8c81","똻",12,"뙉",26,"뙥뙦뙧뙩",50,"뚞뚟뚡뚢뚣뚥",5,"뚭뚮뚯뚰뚲",16], ["8d41","뛃",16,"뛕",8], ["8d61","뛞",17,"뛱뛲뛳뛵뛶뛷뛹뛺"], ["8d81","뛻",4,"뜂뜃뜄뜆",33,"뜪뜫뜭뜮뜱",6,"뜺뜼",7,"띅띆띇띉띊띋띍",6,"띖",9,"띡띢띣띥띦띧띩",6,"띲띴띶",5,"띾띿랁랂랃랅",6,"랎랓랔랕랚랛랝랞"], ["8e41","랟랡",6,"랪랮",5,"랶랷랹",8], ["8e61","럂",4,"럈럊",19], ["8e81","럞",13,"럮럯럱럲럳럵",6,"럾렂",4,"렊렋렍렎렏렑",6,"렚렜렞",5,"렦렧렩렪렫렭",6,"렶렺",5,"롁롂롃롅",11,"롒롔",7,"롞롟롡롢롣롥",6,"롮롰롲",5,"롹롺롻롽",7], ["8f41","뢅",7,"뢎",17], ["8f61","뢠",7,"뢩",6,"뢱뢲뢳뢵뢶뢷뢹",4], ["8f81","뢾뢿룂룄룆",5,"룍룎룏룑룒룓룕",7,"룞룠룢",5,"룪룫룭룮룯룱",6,"룺룼룾",5,"뤅",18,"뤙",6,"뤡",26,"뤾뤿륁륂륃륅",6,"륍륎륐륒",5], ["9041","륚륛륝륞륟륡",6,"륪륬륮",5,"륶륷륹륺륻륽"], ["9061","륾",5,"릆릈릋릌릏",15], ["9081","릟",12,"릮릯릱릲릳릵",6,"릾맀맂",5,"맊맋맍맓",4,"맚맜맟맠맢맦맧맩맪맫맭",6,"맶맻",4,"먂",5,"먉",11,"먖",33,"먺먻먽먾먿멁멃멄멅멆"], ["9141","멇멊멌멏멐멑멒멖멗멙멚멛멝",6,"멦멪",5], ["9161","멲멳멵멶멷멹",9,"몆몈몉몊몋몍",5], ["9181","몓",20,"몪몭몮몯몱몳",4,"몺몼몾",5,"뫅뫆뫇뫉",14,"뫚",33,"뫽뫾뫿묁묂묃묅",7,"묎묐묒",5,"묙묚묛묝묞묟묡",6], ["9241","묨묪묬",7,"묷묹묺묿",4,"뭆뭈뭊뭋뭌뭎뭑뭒"], ["9261","뭓뭕뭖뭗뭙",7,"뭢뭤",7,"뭭",4], ["9281","뭲",21,"뮉뮊뮋뮍뮎뮏뮑",18,"뮥뮦뮧뮩뮪뮫뮭",6,"뮵뮶뮸",7,"믁믂믃믅믆믇믉",6,"믑믒믔",35,"믺믻믽믾밁"], ["9341","밃",4,"밊밎밐밒밓밙밚밠밡밢밣밦밨밪밫밬밮밯밲밳밵"], ["9361","밶밷밹",6,"뱂뱆뱇뱈뱊뱋뱎뱏뱑",8], ["9381","뱚뱛뱜뱞",37,"벆벇벉벊벍벏",4,"벖벘벛",4,"벢벣벥벦벩",6,"벲벶",5,"벾벿볁볂볃볅",7,"볎볒볓볔볖볗볙볚볛볝",22,"볷볹볺볻볽"], ["9441","볾",5,"봆봈봊",5,"봑봒봓봕",8], ["9461","봞",5,"봥",6,"봭",12], ["9481","봺",5,"뵁",6,"뵊뵋뵍뵎뵏뵑",6,"뵚",9,"뵥뵦뵧뵩",22,"붂붃붅붆붋",4,"붒붔붖붗붘붛붝",6,"붥",10,"붱",6,"붹",24], ["9541","뷒뷓뷖뷗뷙뷚뷛뷝",11,"뷪",5,"뷱"], ["9561","뷲뷳뷵뷶뷷뷹",6,"븁븂븄븆",5,"븎븏븑븒븓"], ["9581","븕",6,"븞븠",35,"빆빇빉빊빋빍빏",4,"빖빘빜빝빞빟빢빣빥빦빧빩빫",4,"빲빶",4,"빾빿뺁뺂뺃뺅",6,"뺎뺒",5,"뺚",13,"뺩",14], ["9641","뺸",23,"뻒뻓"], ["9661","뻕뻖뻙",6,"뻡뻢뻦",5,"뻭",8], ["9681","뻶",10,"뼂",5,"뼊",13,"뼚뼞",33,"뽂뽃뽅뽆뽇뽉",6,"뽒뽓뽔뽖",44], ["9741","뾃",16,"뾕",8], ["9761","뾞",17,"뾱",7], ["9781","뾹",11,"뿆",5,"뿎뿏뿑뿒뿓뿕",6,"뿝뿞뿠뿢",89,"쀽쀾쀿"], ["9841","쁀",16,"쁒",5,"쁙쁚쁛"], ["9861","쁝쁞쁟쁡",6,"쁪",15], ["9881","쁺",21,"삒삓삕삖삗삙",6,"삢삤삦",5,"삮삱삲삷",4,"삾샂샃샄샆샇샊샋샍샎샏샑",6,"샚샞",5,"샦샧샩샪샫샭",6,"샶샸샺",5,"섁섂섃섅섆섇섉",6,"섑섒섓섔섖",5,"섡섢섥섨섩섪섫섮"], ["9941","섲섳섴섵섷섺섻섽섾섿셁",6,"셊셎",5,"셖셗"], ["9961","셙셚셛셝",6,"셦셪",5,"셱셲셳셵셶셷셹셺셻"], ["9981","셼",8,"솆",5,"솏솑솒솓솕솗",4,"솞솠솢솣솤솦솧솪솫솭솮솯솱",11,"솾",5,"쇅쇆쇇쇉쇊쇋쇍",6,"쇕쇖쇙",6,"쇡쇢쇣쇥쇦쇧쇩",6,"쇲쇴",7,"쇾쇿숁숂숃숅",6,"숎숐숒",5,"숚숛숝숞숡숢숣"], ["9a41","숤숥숦숧숪숬숮숰숳숵",16], ["9a61","쉆쉇쉉",6,"쉒쉓쉕쉖쉗쉙",6,"쉡쉢쉣쉤쉦"], ["9a81","쉧",4,"쉮쉯쉱쉲쉳쉵",6,"쉾슀슂",5,"슊",5,"슑",6,"슙슚슜슞",5,"슦슧슩슪슫슮",5,"슶슸슺",33,"싞싟싡싢싥",5,"싮싰싲싳싴싵싷싺싽싾싿쌁",6,"쌊쌋쌎쌏"], ["9b41","쌐쌑쌒쌖쌗쌙쌚쌛쌝",6,"쌦쌧쌪",8], ["9b61","쌳",17,"썆",7], ["9b81","썎",25,"썪썫썭썮썯썱썳",4,"썺썻썾",5,"쎅쎆쎇쎉쎊쎋쎍",50,"쏁",22,"쏚"], ["9c41","쏛쏝쏞쏡쏣",4,"쏪쏫쏬쏮",5,"쏶쏷쏹",5], ["9c61","쏿",8,"쐉",6,"쐑",9], ["9c81","쐛",8,"쐥",6,"쐭쐮쐯쐱쐲쐳쐵",6,"쐾",9,"쑉",26,"쑦쑧쑩쑪쑫쑭",6,"쑶쑷쑸쑺",5,"쒁",18,"쒕",6,"쒝",12], ["9d41","쒪",13,"쒹쒺쒻쒽",8], ["9d61","쓆",25], ["9d81","쓠",8,"쓪",5,"쓲쓳쓵쓶쓷쓹쓻쓼쓽쓾씂",9,"씍씎씏씑씒씓씕",6,"씝",10,"씪씫씭씮씯씱",6,"씺씼씾",5,"앆앇앋앏앐앑앒앖앚앛앜앟앢앣앥앦앧앩",6,"앲앶",5,"앾앿얁얂얃얅얆얈얉얊얋얎얐얒얓얔"], ["9e41","얖얙얚얛얝얞얟얡",7,"얪",9,"얶"], ["9e61","얷얺얿",4,"엋엍엏엒엓엕엖엗엙",6,"엢엤엦엧"], ["9e81","엨엩엪엫엯엱엲엳엵엸엹엺엻옂옃옄옉옊옋옍옎옏옑",6,"옚옝",6,"옦옧옩옪옫옯옱옲옶옸옺옼옽옾옿왂왃왅왆왇왉",6,"왒왖",5,"왞왟왡",10,"왭왮왰왲",5,"왺왻왽왾왿욁",6,"욊욌욎",5,"욖욗욙욚욛욝",6,"욦"], ["9f41","욨욪",5,"욲욳욵욶욷욻",4,"웂웄웆",5,"웎"], ["9f61","웏웑웒웓웕",6,"웞웟웢",5,"웪웫웭웮웯웱웲"], ["9f81","웳",4,"웺웻웼웾",5,"윆윇윉윊윋윍",6,"윖윘윚",5,"윢윣윥윦윧윩",6,"윲윴윶윸윹윺윻윾윿읁읂읃읅",4,"읋읎읐읙읚읛읝읞읟읡",6,"읩읪읬",7,"읶읷읹읺읻읿잀잁잂잆잋잌잍잏잒잓잕잙잛",4,"잢잧",4,"잮잯잱잲잳잵잶잷"], ["a041","잸잹잺잻잾쟂",5,"쟊쟋쟍쟏쟑",6,"쟙쟚쟛쟜"], ["a061","쟞",5,"쟥쟦쟧쟩쟪쟫쟭",13], ["a081","쟻",4,"젂젃젅젆젇젉젋",4,"젒젔젗",4,"젞젟젡젢젣젥",6,"젮젰젲",5,"젹젺젻젽젾젿졁",6,"졊졋졎",5,"졕",26,"졲졳졵졶졷졹졻",4,"좂좄좈좉좊좎",5,"좕",7,"좞좠좢좣좤"], ["a141","좥좦좧좩",18,"좾좿죀죁"], ["a161","죂죃죅죆죇죉죊죋죍",6,"죖죘죚",5,"죢죣죥"], ["a181","죦",14,"죶",5,"죾죿줁줂줃줇",4,"줎 、。·‥…¨〃­―∥\∼‘’“”〔〕〈",9,"±×÷≠≤≥∞∴°′″℃Å¢£¥♂♀∠⊥⌒∂∇≡≒§※☆★○●◎◇◆□■△▲▽▼→←↑↓↔〓≪≫√∽∝∵∫∬∈∋⊆⊇⊂⊃∪∩∧∨¬"], ["a241","줐줒",5,"줙",18], ["a261","줭",6,"줵",18], ["a281","쥈",7,"쥒쥓쥕쥖쥗쥙",6,"쥢쥤",7,"쥭쥮쥯⇒⇔∀∃´~ˇ˘˝˚˙¸˛¡¿ː∮∑∏¤℉‰◁◀▷▶♤♠♡♥♧♣⊙◈▣◐◑▒▤▥▨▧▦▩♨☏☎☜☞¶†‡↕↗↙↖↘♭♩♪♬㉿㈜№㏇™㏂㏘℡€®"], ["a341","쥱쥲쥳쥵",6,"쥽",10,"즊즋즍즎즏"], ["a361","즑",6,"즚즜즞",16], ["a381","즯",16,"짂짃짅짆짉짋",4,"짒짔짗짘짛!",58,"₩]",32," ̄"], ["a441","짞짟짡짣짥짦짨짩짪짫짮짲",5,"짺짻짽짾짿쨁쨂쨃쨄"], ["a461","쨅쨆쨇쨊쨎",5,"쨕쨖쨗쨙",12], ["a481","쨦쨧쨨쨪",28,"ㄱ",93], ["a541","쩇",4,"쩎쩏쩑쩒쩓쩕",6,"쩞쩢",5,"쩩쩪"], ["a561","쩫",17,"쩾",5,"쪅쪆"], ["a581","쪇",16,"쪙",14,"ⅰ",9], ["a5b0","Ⅰ",9], ["a5c1","Α",16,"Σ",6], ["a5e1","α",16,"σ",6], ["a641","쪨",19,"쪾쪿쫁쫂쫃쫅"], ["a661","쫆",5,"쫎쫐쫒쫔쫕쫖쫗쫚",5,"쫡",6], ["a681","쫨쫩쫪쫫쫭",6,"쫵",18,"쬉쬊─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂┒┑┚┙┖┕┎┍┞┟┡┢┦┧┩┪┭┮┱┲┵┶┹┺┽┾╀╁╃",7], ["a741","쬋",4,"쬑쬒쬓쬕쬖쬗쬙",6,"쬢",7], ["a761","쬪",22,"쭂쭃쭄"], ["a781","쭅쭆쭇쭊쭋쭍쭎쭏쭑",6,"쭚쭛쭜쭞",5,"쭥",7,"㎕㎖㎗ℓ㎘㏄㎣㎤㎥㎦㎙",9,"㏊㎍㎎㎏㏏㎈㎉㏈㎧㎨㎰",9,"㎀",4,"㎺",5,"㎐",4,"Ω㏀㏁㎊㎋㎌㏖㏅㎭㎮㎯㏛㎩㎪㎫㎬㏝㏐㏓㏃㏉㏜㏆"], ["a841","쭭",10,"쭺",14], ["a861","쮉",18,"쮝",6], ["a881","쮤",19,"쮹",11,"ÆÐªĦ"], ["a8a6","IJ"], ["a8a8","ĿŁØŒºÞŦŊ"], ["a8b1","㉠",27,"ⓐ",25,"①",14,"½⅓⅔¼¾⅛⅜⅝⅞"], ["a941","쯅",14,"쯕",10], ["a961","쯠쯡쯢쯣쯥쯦쯨쯪",18], ["a981","쯽",14,"찎찏찑찒찓찕",6,"찞찟찠찣찤æđðħıijĸŀłøœßþŧŋʼn㈀",27,"⒜",25,"⑴",14,"¹²³⁴ⁿ₁₂₃₄"], ["aa41","찥찦찪찫찭찯찱",6,"찺찿",4,"챆챇챉챊챋챍챎"], ["aa61","챏",4,"챖챚",5,"챡챢챣챥챧챩",6,"챱챲"], ["aa81","챳챴챶",29,"ぁ",82], ["ab41","첔첕첖첗첚첛첝첞첟첡",6,"첪첮",5,"첶첷첹"], ["ab61","첺첻첽",6,"쳆쳈쳊",5,"쳑쳒쳓쳕",5], ["ab81","쳛",8,"쳥",6,"쳭쳮쳯쳱",12,"ァ",85], ["ac41","쳾쳿촀촂",5,"촊촋촍촎촏촑",6,"촚촜촞촟촠"], ["ac61","촡촢촣촥촦촧촩촪촫촭",11,"촺",4], ["ac81","촿",28,"쵝쵞쵟А",5,"ЁЖ",25], ["acd1","а",5,"ёж",25], ["ad41","쵡쵢쵣쵥",6,"쵮쵰쵲",5,"쵹",7], ["ad61","춁",6,"춉",10,"춖춗춙춚춛춝춞춟"], ["ad81","춠춡춢춣춦춨춪",5,"춱",18,"췅"], ["ae41","췆",5,"췍췎췏췑",16], ["ae61","췢",5,"췩췪췫췭췮췯췱",6,"췺췼췾",4], ["ae81","츃츅츆츇츉츊츋츍",6,"츕츖츗츘츚",5,"츢츣츥츦츧츩츪츫"], ["af41","츬츭츮츯츲츴츶",19], ["af61","칊",13,"칚칛칝칞칢",5,"칪칬"], ["af81","칮",5,"칶칷칹칺칻칽",6,"캆캈캊",5,"캒캓캕캖캗캙"], ["b041","캚",5,"캢캦",5,"캮",12], ["b061","캻",5,"컂",19], ["b081","컖",13,"컦컧컩컪컭",6,"컶컺",5,"가각간갇갈갉갊감",7,"같",4,"갠갤갬갭갯갰갱갸갹갼걀걋걍걔걘걜거걱건걷걸걺검겁것겄겅겆겉겊겋게겐겔겜겝겟겠겡겨격겪견겯결겸겹겻겼경곁계곈곌곕곗고곡곤곧골곪곬곯곰곱곳공곶과곽관괄괆"], ["b141","켂켃켅켆켇켉",6,"켒켔켖",5,"켝켞켟켡켢켣"], ["b161","켥",6,"켮켲",5,"켹",11], ["b181","콅",14,"콖콗콙콚콛콝",6,"콦콨콪콫콬괌괍괏광괘괜괠괩괬괭괴괵괸괼굄굅굇굉교굔굘굡굣구국군굳굴굵굶굻굼굽굿궁궂궈궉권궐궜궝궤궷귀귁귄귈귐귑귓규균귤그극근귿글긁금급긋긍긔기긱긴긷길긺김깁깃깅깆깊까깍깎깐깔깖깜깝깟깠깡깥깨깩깬깰깸"], ["b241","콭콮콯콲콳콵콶콷콹",6,"쾁쾂쾃쾄쾆",5,"쾍"], ["b261","쾎",18,"쾢",5,"쾩"], ["b281","쾪",5,"쾱",18,"쿅",6,"깹깻깼깽꺄꺅꺌꺼꺽꺾껀껄껌껍껏껐껑께껙껜껨껫껭껴껸껼꼇꼈꼍꼐꼬꼭꼰꼲꼴꼼꼽꼿꽁꽂꽃꽈꽉꽐꽜꽝꽤꽥꽹꾀꾄꾈꾐꾑꾕꾜꾸꾹꾼꿀꿇꿈꿉꿋꿍꿎꿔꿜꿨꿩꿰꿱꿴꿸뀀뀁뀄뀌뀐뀔뀜뀝뀨끄끅끈끊끌끎끓끔끕끗끙"], ["b341","쿌",19,"쿢쿣쿥쿦쿧쿩"], ["b361","쿪",5,"쿲쿴쿶",5,"쿽쿾쿿퀁퀂퀃퀅",5], ["b381","퀋",5,"퀒",5,"퀙",19,"끝끼끽낀낄낌낍낏낑나낙낚난낟날낡낢남납낫",4,"낱낳내낵낸낼냄냅냇냈냉냐냑냔냘냠냥너넉넋넌널넒넓넘넙넛넜넝넣네넥넨넬넴넵넷넸넹녀녁년녈념녑녔녕녘녜녠노녹논놀놂놈놉놋농높놓놔놘놜놨뇌뇐뇔뇜뇝"], ["b441","퀮",5,"퀶퀷퀹퀺퀻퀽",6,"큆큈큊",5], ["b461","큑큒큓큕큖큗큙",6,"큡",10,"큮큯"], ["b481","큱큲큳큵",6,"큾큿킀킂",18,"뇟뇨뇩뇬뇰뇹뇻뇽누눅눈눋눌눔눕눗눙눠눴눼뉘뉜뉠뉨뉩뉴뉵뉼늄늅늉느늑는늘늙늚늠늡늣능늦늪늬늰늴니닉닌닐닒님닙닛닝닢다닥닦단닫",4,"닳담답닷",4,"닿대댁댄댈댐댑댓댔댕댜더덕덖던덛덜덞덟덤덥"], ["b541","킕",14,"킦킧킩킪킫킭",5], ["b561","킳킶킸킺",5,"탂탃탅탆탇탊",5,"탒탖",4], ["b581","탛탞탟탡탢탣탥",6,"탮탲",5,"탹",11,"덧덩덫덮데덱덴델뎀뎁뎃뎄뎅뎌뎐뎔뎠뎡뎨뎬도독돈돋돌돎돐돔돕돗동돛돝돠돤돨돼됐되된될됨됩됫됴두둑둔둘둠둡둣둥둬뒀뒈뒝뒤뒨뒬뒵뒷뒹듀듄듈듐듕드득든듣들듦듬듭듯등듸디딕딘딛딜딤딥딧딨딩딪따딱딴딸"], ["b641","턅",7,"턎",17], ["b661","턠",15,"턲턳턵턶턷턹턻턼턽턾"], ["b681","턿텂텆",5,"텎텏텑텒텓텕",6,"텞텠텢",5,"텩텪텫텭땀땁땃땄땅땋때땍땐땔땜땝땟땠땡떠떡떤떨떪떫떰떱떳떴떵떻떼떽뗀뗄뗌뗍뗏뗐뗑뗘뗬또똑똔똘똥똬똴뙈뙤뙨뚜뚝뚠뚤뚫뚬뚱뛔뛰뛴뛸뜀뜁뜅뜨뜩뜬뜯뜰뜸뜹뜻띄띈띌띔띕띠띤띨띰띱띳띵라락란랄람랍랏랐랑랒랖랗"], ["b741","텮",13,"텽",6,"톅톆톇톉톊"], ["b761","톋",20,"톢톣톥톦톧"], ["b781","톩",6,"톲톴톶톷톸톹톻톽톾톿퇁",14,"래랙랜랠램랩랫랬랭랴략랸럇량러럭런럴럼럽럿렀렁렇레렉렌렐렘렙렛렝려력련렬렴렵렷렸령례롄롑롓로록론롤롬롭롯롱롸롼뢍뢨뢰뢴뢸룀룁룃룅료룐룔룝룟룡루룩룬룰룸룹룻룽뤄뤘뤠뤼뤽륀륄륌륏륑류륙륜률륨륩"], ["b841","퇐",7,"퇙",17], ["b861","퇫",8,"퇵퇶퇷퇹",13], ["b881","툈툊",5,"툑",24,"륫륭르륵른를름릅릇릉릊릍릎리릭린릴림립릿링마막만많",4,"맘맙맛망맞맡맣매맥맨맬맴맵맷맸맹맺먀먁먈먕머먹먼멀멂멈멉멋멍멎멓메멕멘멜멤멥멧멨멩며멱면멸몃몄명몇몌모목몫몬몰몲몸몹못몽뫄뫈뫘뫙뫼"], ["b941","툪툫툮툯툱툲툳툵",6,"툾퉀퉂",5,"퉉퉊퉋퉌"], ["b961","퉍",14,"퉝",6,"퉥퉦퉧퉨"], ["b981","퉩",22,"튂튃튅튆튇튉튊튋튌묀묄묍묏묑묘묜묠묩묫무묵묶문묻물묽묾뭄뭅뭇뭉뭍뭏뭐뭔뭘뭡뭣뭬뮈뮌뮐뮤뮨뮬뮴뮷므믄믈믐믓미믹민믿밀밂밈밉밋밌밍및밑바",4,"받",4,"밤밥밧방밭배백밴밸뱀뱁뱃뱄뱅뱉뱌뱍뱐뱝버벅번벋벌벎범법벗"], ["ba41","튍튎튏튒튓튔튖",5,"튝튞튟튡튢튣튥",6,"튭"], ["ba61","튮튯튰튲",5,"튺튻튽튾틁틃",4,"틊틌",5], ["ba81","틒틓틕틖틗틙틚틛틝",6,"틦",9,"틲틳틵틶틷틹틺벙벚베벡벤벧벨벰벱벳벴벵벼벽변별볍볏볐병볕볘볜보복볶본볼봄봅봇봉봐봔봤봬뵀뵈뵉뵌뵐뵘뵙뵤뵨부북분붇불붉붊붐붑붓붕붙붚붜붤붰붸뷔뷕뷘뷜뷩뷰뷴뷸븀븃븅브븍븐블븜븝븟비빅빈빌빎빔빕빗빙빚빛빠빡빤"], ["bb41","틻",4,"팂팄팆",5,"팏팑팒팓팕팗",4,"팞팢팣"], ["bb61","팤팦팧팪팫팭팮팯팱",6,"팺팾",5,"퍆퍇퍈퍉"], ["bb81","퍊",31,"빨빪빰빱빳빴빵빻빼빽뺀뺄뺌뺍뺏뺐뺑뺘뺙뺨뻐뻑뻔뻗뻘뻠뻣뻤뻥뻬뼁뼈뼉뼘뼙뼛뼜뼝뽀뽁뽄뽈뽐뽑뽕뾔뾰뿅뿌뿍뿐뿔뿜뿟뿡쀼쁑쁘쁜쁠쁨쁩삐삑삔삘삠삡삣삥사삭삯산삳살삵삶삼삽삿샀상샅새색샌샐샘샙샛샜생샤"], ["bc41","퍪",17,"퍾퍿펁펂펃펅펆펇"], ["bc61","펈펉펊펋펎펒",5,"펚펛펝펞펟펡",6,"펪펬펮"], ["bc81","펯",4,"펵펶펷펹펺펻펽",6,"폆폇폊",5,"폑",5,"샥샨샬샴샵샷샹섀섄섈섐섕서",4,"섣설섦섧섬섭섯섰성섶세섹센셀셈셉셋셌셍셔셕션셜셤셥셧셨셩셰셴셸솅소속솎손솔솖솜솝솟송솥솨솩솬솰솽쇄쇈쇌쇔쇗쇘쇠쇤쇨쇰쇱쇳쇼쇽숀숄숌숍숏숑수숙순숟술숨숩숫숭"], ["bd41","폗폙",7,"폢폤",7,"폮폯폱폲폳폵폶폷"], ["bd61","폸폹폺폻폾퐀퐂",5,"퐉",13], ["bd81","퐗",5,"퐞",25,"숯숱숲숴쉈쉐쉑쉔쉘쉠쉥쉬쉭쉰쉴쉼쉽쉿슁슈슉슐슘슛슝스슥슨슬슭슴습슷승시식신싣실싫심십싯싱싶싸싹싻싼쌀쌈쌉쌌쌍쌓쌔쌕쌘쌜쌤쌥쌨쌩썅써썩썬썰썲썸썹썼썽쎄쎈쎌쏀쏘쏙쏜쏟쏠쏢쏨쏩쏭쏴쏵쏸쐈쐐쐤쐬쐰"], ["be41","퐸",7,"푁푂푃푅",14], ["be61","푔",7,"푝푞푟푡푢푣푥",7,"푮푰푱푲"], ["be81","푳",4,"푺푻푽푾풁풃",4,"풊풌풎",5,"풕",8,"쐴쐼쐽쑈쑤쑥쑨쑬쑴쑵쑹쒀쒔쒜쒸쒼쓩쓰쓱쓴쓸쓺쓿씀씁씌씐씔씜씨씩씬씰씸씹씻씽아악안앉않알앍앎앓암압앗았앙앝앞애액앤앨앰앱앳앴앵야약얀얄얇얌얍얏양얕얗얘얜얠얩어억언얹얻얼얽얾엄",6,"엌엎"], ["bf41","풞",10,"풪",14], ["bf61","풹",18,"퓍퓎퓏퓑퓒퓓퓕"], ["bf81","퓖",5,"퓝퓞퓠",7,"퓩퓪퓫퓭퓮퓯퓱",6,"퓹퓺퓼에엑엔엘엠엡엣엥여역엮연열엶엷염",5,"옅옆옇예옌옐옘옙옛옜오옥온올옭옮옰옳옴옵옷옹옻와왁완왈왐왑왓왔왕왜왝왠왬왯왱외왹왼욀욈욉욋욍요욕욘욜욤욥욧용우욱운울욹욺움웁웃웅워웍원월웜웝웠웡웨"], ["c041","퓾",5,"픅픆픇픉픊픋픍",6,"픖픘",5], ["c061","픞",25], ["c081","픸픹픺픻픾픿핁핂핃핅",6,"핎핐핒",5,"핚핛핝핞핟핡핢핣웩웬웰웸웹웽위윅윈윌윔윕윗윙유육윤율윰윱윳융윷으윽은을읊음읍읏응",7,"읜읠읨읫이익인일읽읾잃임입잇있잉잊잎자작잔잖잗잘잚잠잡잣잤장잦재잭잰잴잼잽잿쟀쟁쟈쟉쟌쟎쟐쟘쟝쟤쟨쟬저적전절젊"], ["c141","핤핦핧핪핬핮",5,"핶핷핹핺핻핽",6,"햆햊햋"], ["c161","햌햍햎햏햑",19,"햦햧"], ["c181","햨",31,"점접젓정젖제젝젠젤젬젭젯젱져젼졀졈졉졌졍졔조족존졸졺좀좁좃종좆좇좋좌좍좔좝좟좡좨좼좽죄죈죌죔죕죗죙죠죡죤죵주죽준줄줅줆줌줍줏중줘줬줴쥐쥑쥔쥘쥠쥡쥣쥬쥰쥴쥼즈즉즌즐즘즙즛증지직진짇질짊짐집짓"], ["c241","헊헋헍헎헏헑헓",4,"헚헜헞",5,"헦헧헩헪헫헭헮"], ["c261","헯",4,"헶헸헺",5,"혂혃혅혆혇혉",6,"혒"], ["c281","혖",5,"혝혞혟혡혢혣혥",7,"혮",9,"혺혻징짖짙짚짜짝짠짢짤짧짬짭짯짰짱째짹짼쨀쨈쨉쨋쨌쨍쨔쨘쨩쩌쩍쩐쩔쩜쩝쩟쩠쩡쩨쩽쪄쪘쪼쪽쫀쫄쫌쫍쫏쫑쫓쫘쫙쫠쫬쫴쬈쬐쬔쬘쬠쬡쭁쭈쭉쭌쭐쭘쭙쭝쭤쭸쭹쮜쮸쯔쯤쯧쯩찌찍찐찔찜찝찡찢찧차착찬찮찰참찹찻"], ["c341","혽혾혿홁홂홃홄홆홇홊홌홎홏홐홒홓홖홗홙홚홛홝",4], ["c361","홢",4,"홨홪",5,"홲홳홵",11], ["c381","횁횂횄횆",5,"횎횏횑횒횓횕",7,"횞횠횢",5,"횩횪찼창찾채책챈챌챔챕챗챘챙챠챤챦챨챰챵처척천철첨첩첫첬청체첵첸첼쳄쳅쳇쳉쳐쳔쳤쳬쳰촁초촉촌촐촘촙촛총촤촨촬촹최쵠쵤쵬쵭쵯쵱쵸춈추축춘출춤춥춧충춰췄췌췐취췬췰췸췹췻췽츄츈츌츔츙츠측츤츨츰츱츳층"], ["c441","횫횭횮횯횱",7,"횺횼",7,"훆훇훉훊훋"], ["c461","훍훎훏훐훒훓훕훖훘훚",5,"훡훢훣훥훦훧훩",4], ["c481","훮훯훱훲훳훴훶",5,"훾훿휁휂휃휅",11,"휒휓휔치칙친칟칠칡침칩칫칭카칵칸칼캄캅캇캉캐캑캔캘캠캡캣캤캥캬캭컁커컥컨컫컬컴컵컷컸컹케켁켄켈켐켑켓켕켜켠켤켬켭켯켰켱켸코콕콘콜콤콥콧콩콰콱콴콸쾀쾅쾌쾡쾨쾰쿄쿠쿡쿤쿨쿰쿱쿳쿵쿼퀀퀄퀑퀘퀭퀴퀵퀸퀼"], ["c541","휕휖휗휚휛휝휞휟휡",6,"휪휬휮",5,"휶휷휹"], ["c561","휺휻휽",6,"흅흆흈흊",5,"흒흓흕흚",4], ["c581","흟흢흤흦흧흨흪흫흭흮흯흱흲흳흵",6,"흾흿힀힂",5,"힊힋큄큅큇큉큐큔큘큠크큭큰클큼큽킁키킥킨킬킴킵킷킹타탁탄탈탉탐탑탓탔탕태택탠탤탬탭탯탰탱탸턍터턱턴털턺텀텁텃텄텅테텍텐텔템텝텟텡텨텬텼톄톈토톡톤톨톰톱톳통톺톼퇀퇘퇴퇸툇툉툐투툭툰툴툼툽툿퉁퉈퉜"], ["c641","힍힎힏힑",6,"힚힜힞",5], ["c6a1","퉤튀튁튄튈튐튑튕튜튠튤튬튱트특튼튿틀틂틈틉틋틔틘틜틤틥티틱틴틸팀팁팃팅파팍팎판팔팖팜팝팟팠팡팥패팩팬팰팸팹팻팼팽퍄퍅퍼퍽펀펄펌펍펏펐펑페펙펜펠펨펩펫펭펴편펼폄폅폈평폐폘폡폣포폭폰폴폼폽폿퐁"], ["c7a1","퐈퐝푀푄표푠푤푭푯푸푹푼푿풀풂품풉풋풍풔풩퓌퓐퓔퓜퓟퓨퓬퓰퓸퓻퓽프픈플픔픕픗피픽핀필핌핍핏핑하학한할핥함합핫항해핵핸핼햄햅햇했행햐향허헉헌헐헒험헙헛헝헤헥헨헬헴헵헷헹혀혁현혈혐협혓혔형혜혠"], ["c8a1","혤혭호혹혼홀홅홈홉홋홍홑화확환활홧황홰홱홴횃횅회획횐횔횝횟횡효횬횰횹횻후훅훈훌훑훔훗훙훠훤훨훰훵훼훽휀휄휑휘휙휜휠휨휩휫휭휴휵휸휼흄흇흉흐흑흔흖흗흘흙흠흡흣흥흩희흰흴흼흽힁히힉힌힐힘힙힛힝"], ["caa1","伽佳假價加可呵哥嘉嫁家暇架枷柯歌珂痂稼苛茄街袈訶賈跏軻迦駕刻却各恪慤殼珏脚覺角閣侃刊墾奸姦干幹懇揀杆柬桿澗癎看磵稈竿簡肝艮艱諫間乫喝曷渴碣竭葛褐蝎鞨勘坎堪嵌感憾戡敢柑橄減甘疳監瞰紺邯鑑鑒龕"], ["cba1","匣岬甲胛鉀閘剛堈姜岡崗康强彊慷江畺疆糠絳綱羌腔舡薑襁講鋼降鱇介价個凱塏愷愾慨改槪漑疥皆盖箇芥蓋豈鎧開喀客坑更粳羹醵倨去居巨拒据據擧渠炬祛距踞車遽鉅鋸乾件健巾建愆楗腱虔蹇鍵騫乞傑杰桀儉劍劒檢"], ["cca1","瞼鈐黔劫怯迲偈憩揭擊格檄激膈覡隔堅牽犬甄絹繭肩見譴遣鵑抉決潔結缺訣兼慊箝謙鉗鎌京俓倞傾儆勁勍卿坰境庚徑慶憬擎敬景暻更梗涇炅烱璟璥瓊痙硬磬竟競絅經耕耿脛莖警輕逕鏡頃頸驚鯨係啓堺契季屆悸戒桂械"], ["cda1","棨溪界癸磎稽系繫繼計誡谿階鷄古叩告呱固姑孤尻庫拷攷故敲暠枯槁沽痼皐睾稿羔考股膏苦苽菰藁蠱袴誥賈辜錮雇顧高鼓哭斛曲梏穀谷鵠困坤崑昆梱棍滾琨袞鯤汨滑骨供公共功孔工恐恭拱控攻珙空蚣貢鞏串寡戈果瓜"], ["cea1","科菓誇課跨過鍋顆廓槨藿郭串冠官寬慣棺款灌琯瓘管罐菅觀貫關館刮恝括适侊光匡壙廣曠洸炚狂珖筐胱鑛卦掛罫乖傀塊壞怪愧拐槐魁宏紘肱轟交僑咬喬嬌嶠巧攪敎校橋狡皎矯絞翹膠蕎蛟較轎郊餃驕鮫丘久九仇俱具勾"], ["cfa1","區口句咎嘔坵垢寇嶇廐懼拘救枸柩構歐毆毬求溝灸狗玖球瞿矩究絿耉臼舅舊苟衢謳購軀逑邱鉤銶駒驅鳩鷗龜國局菊鞠鞫麴君窘群裙軍郡堀屈掘窟宮弓穹窮芎躬倦券勸卷圈拳捲權淃眷厥獗蕨蹶闕机櫃潰詭軌饋句晷歸貴"], ["d0a1","鬼龜叫圭奎揆槻珪硅窺竅糾葵規赳逵閨勻均畇筠菌鈞龜橘克剋劇戟棘極隙僅劤勤懃斤根槿瑾筋芹菫覲謹近饉契今妗擒昑檎琴禁禽芩衾衿襟金錦伋及急扱汲級給亘兢矜肯企伎其冀嗜器圻基埼夔奇妓寄岐崎己幾忌技旗旣"], ["d1a1","朞期杞棋棄機欺氣汽沂淇玘琦琪璂璣畸畿碁磯祁祇祈祺箕紀綺羈耆耭肌記譏豈起錡錤飢饑騎騏驥麒緊佶吉拮桔金喫儺喇奈娜懦懶拏拿癩",5,"那樂",4,"諾酪駱亂卵暖欄煖爛蘭難鸞捏捺南嵐枏楠湳濫男藍襤拉"], ["d2a1","納臘蠟衲囊娘廊",4,"乃來內奈柰耐冷女年撚秊念恬拈捻寧寗努勞奴弩怒擄櫓爐瑙盧",5,"駑魯",10,"濃籠聾膿農惱牢磊腦賂雷尿壘",7,"嫩訥杻紐勒",5,"能菱陵尼泥匿溺多茶"], ["d3a1","丹亶但單團壇彖斷旦檀段湍短端簞緞蛋袒鄲鍛撻澾獺疸達啖坍憺擔曇淡湛潭澹痰聃膽蕁覃談譚錟沓畓答踏遝唐堂塘幢戇撞棠當糖螳黨代垈坮大對岱帶待戴擡玳臺袋貸隊黛宅德悳倒刀到圖堵塗導屠島嶋度徒悼挑掉搗桃"], ["d4a1","棹櫂淘渡滔濤燾盜睹禱稻萄覩賭跳蹈逃途道都鍍陶韜毒瀆牘犢獨督禿篤纛讀墩惇敦旽暾沌焞燉豚頓乭突仝冬凍動同憧東桐棟洞潼疼瞳童胴董銅兜斗杜枓痘竇荳讀豆逗頭屯臀芚遁遯鈍得嶝橙燈登等藤謄鄧騰喇懶拏癩羅"], ["d5a1","蘿螺裸邏樂洛烙珞絡落諾酪駱丹亂卵欄欒瀾爛蘭鸞剌辣嵐擥攬欖濫籃纜藍襤覽拉臘蠟廊朗浪狼琅瑯螂郞來崍徠萊冷掠略亮倆兩凉梁樑粮粱糧良諒輛量侶儷勵呂廬慮戾旅櫚濾礪藜蠣閭驢驪麗黎力曆歷瀝礫轢靂憐戀攣漣"], ["d6a1","煉璉練聯蓮輦連鍊冽列劣洌烈裂廉斂殮濂簾獵令伶囹寧岺嶺怜玲笭羚翎聆逞鈴零靈領齡例澧禮醴隷勞怒撈擄櫓潞瀘爐盧老蘆虜路輅露魯鷺鹵碌祿綠菉錄鹿麓論壟弄朧瀧瓏籠聾儡瀨牢磊賂賚賴雷了僚寮廖料燎療瞭聊蓼"], ["d7a1","遼鬧龍壘婁屢樓淚漏瘻累縷蔞褸鏤陋劉旒柳榴流溜瀏琉瑠留瘤硫謬類六戮陸侖倫崙淪綸輪律慄栗率隆勒肋凜凌楞稜綾菱陵俚利厘吏唎履悧李梨浬犁狸理璃異痢籬罹羸莉裏裡里釐離鯉吝潾燐璘藺躪隣鱗麟林淋琳臨霖砬"], ["d8a1","立笠粒摩瑪痲碼磨馬魔麻寞幕漠膜莫邈万卍娩巒彎慢挽晩曼滿漫灣瞞萬蔓蠻輓饅鰻唜抹末沫茉襪靺亡妄忘忙望網罔芒茫莽輞邙埋妹媒寐昧枚梅每煤罵買賣邁魅脈貊陌驀麥孟氓猛盲盟萌冪覓免冕勉棉沔眄眠綿緬面麵滅"], ["d9a1","蔑冥名命明暝椧溟皿瞑茗蓂螟酩銘鳴袂侮冒募姆帽慕摸摹暮某模母毛牟牡瑁眸矛耗芼茅謀謨貌木沐牧目睦穆鶩歿沒夢朦蒙卯墓妙廟描昴杳渺猫竗苗錨務巫憮懋戊拇撫无楙武毋無珷畝繆舞茂蕪誣貿霧鵡墨默們刎吻問文"], ["daa1","汶紊紋聞蚊門雯勿沕物味媚尾嵋彌微未梶楣渼湄眉米美薇謎迷靡黴岷悶愍憫敏旻旼民泯玟珉緡閔密蜜謐剝博拍搏撲朴樸泊珀璞箔粕縛膊舶薄迫雹駁伴半反叛拌搬攀斑槃泮潘班畔瘢盤盼磐磻礬絆般蟠返頒飯勃拔撥渤潑"], ["dba1","發跋醱鉢髮魃倣傍坊妨尨幇彷房放方旁昉枋榜滂磅紡肪膀舫芳蒡蚌訪謗邦防龐倍俳北培徘拜排杯湃焙盃背胚裴裵褙賠輩配陪伯佰帛柏栢白百魄幡樊煩燔番磻繁蕃藩飜伐筏罰閥凡帆梵氾汎泛犯範范法琺僻劈壁擘檗璧癖"], ["dca1","碧蘗闢霹便卞弁變辨辯邊別瞥鱉鼈丙倂兵屛幷昞昺柄棅炳甁病秉竝輧餠騈保堡報寶普步洑湺潽珤甫菩補褓譜輔伏僕匐卜宓復服福腹茯蔔複覆輹輻馥鰒本乶俸奉封峯峰捧棒烽熢琫縫蓬蜂逢鋒鳳不付俯傅剖副否咐埠夫婦"], ["dda1","孚孵富府復扶敷斧浮溥父符簿缶腐腑膚艀芙莩訃負賦賻赴趺部釜阜附駙鳧北分吩噴墳奔奮忿憤扮昐汾焚盆粉糞紛芬賁雰不佛弗彿拂崩朋棚硼繃鵬丕備匕匪卑妃婢庇悲憊扉批斐枇榧比毖毗毘沸泌琵痺砒碑秕秘粃緋翡肥"], ["dea1","脾臂菲蜚裨誹譬費鄙非飛鼻嚬嬪彬斌檳殯浜濱瀕牝玭貧賓頻憑氷聘騁乍事些仕伺似使俟僿史司唆嗣四士奢娑寫寺射巳師徙思捨斜斯柶査梭死沙泗渣瀉獅砂社祀祠私篩紗絲肆舍莎蓑蛇裟詐詞謝賜赦辭邪飼駟麝削數朔索"], ["dfa1","傘刪山散汕珊産疝算蒜酸霰乷撒殺煞薩三參杉森渗芟蔘衫揷澁鈒颯上傷像償商喪嘗孀尙峠常床庠廂想桑橡湘爽牀狀相祥箱翔裳觴詳象賞霜塞璽賽嗇塞穡索色牲生甥省笙墅壻嶼序庶徐恕抒捿敍暑曙書栖棲犀瑞筮絮緖署"], ["e0a1","胥舒薯西誓逝鋤黍鼠夕奭席惜昔晳析汐淅潟石碩蓆釋錫仙僊先善嬋宣扇敾旋渲煽琁瑄璇璿癬禪線繕羨腺膳船蘚蟬詵跣選銑鐥饍鮮卨屑楔泄洩渫舌薛褻設說雪齧剡暹殲纖蟾贍閃陝攝涉燮葉城姓宬性惺成星晟猩珹盛省筬"], ["e1a1","聖聲腥誠醒世勢歲洗稅笹細說貰召嘯塑宵小少巢所掃搔昭梳沼消溯瀟炤燒甦疏疎瘙笑篠簫素紹蔬蕭蘇訴逍遡邵銷韶騷俗屬束涑粟續謖贖速孫巽損蓀遜飡率宋悚松淞訟誦送頌刷殺灑碎鎖衰釗修受嗽囚垂壽嫂守岫峀帥愁"], ["e2a1","戍手授搜收數樹殊水洙漱燧狩獸琇璲瘦睡秀穗竪粹綏綬繡羞脩茱蒐蓚藪袖誰讐輸遂邃酬銖銹隋隧隨雖需須首髓鬚叔塾夙孰宿淑潚熟琡璹肅菽巡徇循恂旬栒楯橓殉洵淳珣盾瞬筍純脣舜荀蓴蕣詢諄醇錞順馴戌術述鉥崇崧"], ["e3a1","嵩瑟膝蝨濕拾習褶襲丞乘僧勝升承昇繩蠅陞侍匙嘶始媤尸屎屍市弑恃施是時枾柴猜矢示翅蒔蓍視試詩諡豕豺埴寔式息拭植殖湜熄篒蝕識軾食飾伸侁信呻娠宸愼新晨燼申神紳腎臣莘薪藎蜃訊身辛辰迅失室實悉審尋心沁"], ["e4a1","沈深瀋甚芯諶什十拾雙氏亞俄兒啞娥峨我牙芽莪蛾衙訝阿雅餓鴉鵝堊岳嶽幄惡愕握樂渥鄂鍔顎鰐齷安岸按晏案眼雁鞍顔鮟斡謁軋閼唵岩巖庵暗癌菴闇壓押狎鴨仰央怏昻殃秧鴦厓哀埃崖愛曖涯碍艾隘靄厄扼掖液縊腋額"], ["e5a1","櫻罌鶯鸚也倻冶夜惹揶椰爺耶若野弱掠略約若葯蒻藥躍亮佯兩凉壤孃恙揚攘敭暘梁楊樣洋瀁煬痒瘍禳穰糧羊良襄諒讓釀陽量養圄御於漁瘀禦語馭魚齬億憶抑檍臆偃堰彦焉言諺孼蘖俺儼嚴奄掩淹嶪業円予余勵呂女如廬"], ["e6a1","旅歟汝濾璵礖礪與艅茹輿轝閭餘驪麗黎亦力域役易曆歷疫繹譯轢逆驛嚥堧姸娟宴年延憐戀捐挻撚椽沇沿涎涓淵演漣烟然煙煉燃燕璉硏硯秊筵緣練縯聯衍軟輦蓮連鉛鍊鳶列劣咽悅涅烈熱裂說閱厭廉念捻染殮炎焰琰艶苒"], ["e7a1","簾閻髥鹽曄獵燁葉令囹塋寧嶺嶸影怜映暎楹榮永泳渶潁濚瀛瀯煐營獰玲瑛瑩瓔盈穎纓羚聆英詠迎鈴鍈零霙靈領乂倪例刈叡曳汭濊猊睿穢芮藝蘂禮裔詣譽豫醴銳隸霓預五伍俉傲午吾吳嗚塢墺奧娛寤悟惡懊敖旿晤梧汚澳"], ["e8a1","烏熬獒筽蜈誤鰲鼇屋沃獄玉鈺溫瑥瘟穩縕蘊兀壅擁瓮甕癰翁邕雍饔渦瓦窩窪臥蛙蝸訛婉完宛梡椀浣玩琓琬碗緩翫脘腕莞豌阮頑曰往旺枉汪王倭娃歪矮外嵬巍猥畏了僚僥凹堯夭妖姚寥寮尿嶢拗搖撓擾料曜樂橈燎燿瑤療"], ["e9a1","窈窯繇繞耀腰蓼蟯要謠遙遼邀饒慾欲浴縟褥辱俑傭冗勇埇墉容庸慂榕涌湧溶熔瑢用甬聳茸蓉踊鎔鏞龍于佑偶優又友右宇寓尤愚憂旴牛玗瑀盂祐禑禹紆羽芋藕虞迂遇郵釪隅雨雩勖彧旭昱栯煜稶郁頊云暈橒殞澐熉耘芸蕓"], ["eaa1","運隕雲韻蔚鬱亐熊雄元原員圓園垣媛嫄寃怨愿援沅洹湲源爰猿瑗苑袁轅遠阮院願鴛月越鉞位偉僞危圍委威尉慰暐渭爲瑋緯胃萎葦蔿蝟衛褘謂違韋魏乳侑儒兪劉唯喩孺宥幼幽庾悠惟愈愉揄攸有杻柔柚柳楡楢油洧流游溜"], ["eba1","濡猶猷琉瑜由留癒硫紐維臾萸裕誘諛諭踰蹂遊逾遺酉釉鍮類六堉戮毓肉育陸倫允奫尹崙淪潤玧胤贇輪鈗閏律慄栗率聿戎瀜絨融隆垠恩慇殷誾銀隱乙吟淫蔭陰音飮揖泣邑凝應膺鷹依倚儀宜意懿擬椅毅疑矣義艤薏蟻衣誼"], ["eca1","議醫二以伊利吏夷姨履已弛彛怡易李梨泥爾珥理異痍痢移罹而耳肄苡荑裏裡貽貳邇里離飴餌匿溺瀷益翊翌翼謚人仁刃印吝咽因姻寅引忍湮燐璘絪茵藺蚓認隣靭靷鱗麟一佚佾壹日溢逸鎰馹任壬妊姙恁林淋稔臨荏賃入卄"], ["eda1","立笠粒仍剩孕芿仔刺咨姉姿子字孜恣慈滋炙煮玆瓷疵磁紫者自茨蔗藉諮資雌作勺嚼斫昨灼炸爵綽芍酌雀鵲孱棧殘潺盞岑暫潛箴簪蠶雜丈仗匠場墻壯奬將帳庄張掌暲杖樟檣欌漿牆狀獐璋章粧腸臟臧莊葬蔣薔藏裝贓醬長"], ["eea1","障再哉在宰才材栽梓渽滓災縡裁財載齋齎爭箏諍錚佇低儲咀姐底抵杵楮樗沮渚狙猪疽箸紵苧菹著藷詛貯躇這邸雎齟勣吊嫡寂摘敵滴狄炙的積笛籍績翟荻謫賊赤跡蹟迪迹適鏑佃佺傳全典前剪塡塼奠專展廛悛戰栓殿氈澱"], ["efa1","煎琠田甸畑癲筌箋箭篆纏詮輾轉鈿銓錢鐫電顚顫餞切截折浙癤竊節絶占岾店漸点粘霑鮎點接摺蝶丁井亭停偵呈姃定幀庭廷征情挺政整旌晶晸柾楨檉正汀淀淨渟湞瀞炡玎珽町睛碇禎程穽精綎艇訂諪貞鄭酊釘鉦鋌錠霆靖"], ["f0a1","靜頂鼎制劑啼堤帝弟悌提梯濟祭第臍薺製諸蹄醍除際霽題齊俎兆凋助嘲弔彫措操早晁曺曹朝條棗槽漕潮照燥爪璪眺祖祚租稠窕粗糟組繰肇藻蚤詔調趙躁造遭釣阻雕鳥族簇足鏃存尊卒拙猝倧宗從悰慫棕淙琮種終綜縱腫"], ["f1a1","踪踵鍾鐘佐坐左座挫罪主住侏做姝胄呪周嗾奏宙州廚晝朱柱株注洲湊澍炷珠疇籌紂紬綢舟蛛註誅走躊輳週酎酒鑄駐竹粥俊儁准埈寯峻晙樽浚準濬焌畯竣蠢逡遵雋駿茁中仲衆重卽櫛楫汁葺增憎曾拯烝甑症繒蒸證贈之只"], ["f2a1","咫地址志持指摯支旨智枝枳止池沚漬知砥祉祗紙肢脂至芝芷蜘誌識贄趾遲直稙稷織職唇嗔塵振搢晉晋桭榛殄津溱珍瑨璡畛疹盡眞瞋秦縉縝臻蔯袗診賑軫辰進鎭陣陳震侄叱姪嫉帙桎瓆疾秩窒膣蛭質跌迭斟朕什執潗緝輯"], ["f3a1","鏶集徵懲澄且侘借叉嗟嵯差次此磋箚茶蹉車遮捉搾着窄錯鑿齪撰澯燦璨瓚竄簒纂粲纘讚贊鑽餐饌刹察擦札紮僭參塹慘慙懺斬站讒讖倉倡創唱娼廠彰愴敞昌昶暢槍滄漲猖瘡窓脹艙菖蒼債埰寀寨彩採砦綵菜蔡采釵冊柵策"], ["f4a1","責凄妻悽處倜刺剔尺慽戚拓擲斥滌瘠脊蹠陟隻仟千喘天川擅泉淺玔穿舛薦賤踐遷釧闡阡韆凸哲喆徹撤澈綴輟轍鐵僉尖沾添甛瞻簽籤詹諂堞妾帖捷牒疊睫諜貼輒廳晴淸聽菁請靑鯖切剃替涕滯締諦逮遞體初剿哨憔抄招梢"], ["f5a1","椒楚樵炒焦硝礁礎秒稍肖艸苕草蕉貂超酢醋醮促囑燭矗蜀觸寸忖村邨叢塚寵悤憁摠總聰蔥銃撮催崔最墜抽推椎楸樞湫皺秋芻萩諏趨追鄒酋醜錐錘鎚雛騶鰍丑畜祝竺筑築縮蓄蹙蹴軸逐春椿瑃出朮黜充忠沖蟲衝衷悴膵萃"], ["f6a1","贅取吹嘴娶就炊翠聚脆臭趣醉驟鷲側仄厠惻測層侈値嗤峙幟恥梔治淄熾痔痴癡稚穉緇緻置致蚩輜雉馳齒則勅飭親七柒漆侵寢枕沈浸琛砧針鍼蟄秤稱快他咤唾墮妥惰打拖朶楕舵陀馱駝倬卓啄坼度托拓擢晫柝濁濯琢琸託"], ["f7a1","鐸呑嘆坦彈憚歎灘炭綻誕奪脫探眈耽貪塔搭榻宕帑湯糖蕩兌台太怠態殆汰泰笞胎苔跆邰颱宅擇澤撑攄兎吐土討慟桶洞痛筒統通堆槌腿褪退頹偸套妬投透鬪慝特闖坡婆巴把播擺杷波派爬琶破罷芭跛頗判坂板版瓣販辦鈑"], ["f8a1","阪八叭捌佩唄悖敗沛浿牌狽稗覇貝彭澎烹膨愎便偏扁片篇編翩遍鞭騙貶坪平枰萍評吠嬖幣廢弊斃肺蔽閉陛佈包匍匏咆哺圃布怖抛抱捕暴泡浦疱砲胞脯苞葡蒲袍褒逋鋪飽鮑幅暴曝瀑爆輻俵剽彪慓杓標漂瓢票表豹飇飄驃"], ["f9a1","品稟楓諷豊風馮彼披疲皮被避陂匹弼必泌珌畢疋筆苾馝乏逼下何厦夏廈昰河瑕荷蝦賀遐霞鰕壑學虐謔鶴寒恨悍旱汗漢澣瀚罕翰閑閒限韓割轄函含咸啣喊檻涵緘艦銜陷鹹合哈盒蛤閤闔陜亢伉姮嫦巷恒抗杭桁沆港缸肛航"], ["faa1","行降項亥偕咳垓奚孩害懈楷海瀣蟹解該諧邂駭骸劾核倖幸杏荇行享向嚮珦鄕響餉饗香噓墟虛許憲櫶獻軒歇險驗奕爀赫革俔峴弦懸晛泫炫玄玹現眩睍絃絢縣舷衒見賢鉉顯孑穴血頁嫌俠協夾峽挾浹狹脅脇莢鋏頰亨兄刑型"], ["fba1","形泂滎瀅灐炯熒珩瑩荊螢衡逈邢鎣馨兮彗惠慧暳蕙蹊醯鞋乎互呼壕壺好岵弧戶扈昊晧毫浩淏湖滸澔濠濩灝狐琥瑚瓠皓祜糊縞胡芦葫蒿虎號蝴護豪鎬頀顥惑或酷婚昏混渾琿魂忽惚笏哄弘汞泓洪烘紅虹訌鴻化和嬅樺火畵"], ["fca1","禍禾花華話譁貨靴廓擴攫確碻穫丸喚奐宦幻患換歡晥桓渙煥環紈還驩鰥活滑猾豁闊凰幌徨恍惶愰慌晃晄榥況湟滉潢煌璜皇篁簧荒蝗遑隍黃匯回廻徊恢悔懷晦會檜淮澮灰獪繪膾茴蛔誨賄劃獲宖橫鐄哮嚆孝效斅曉梟涍淆"], ["fda1","爻肴酵驍侯候厚后吼喉嗅帿後朽煦珝逅勛勳塤壎焄熏燻薰訓暈薨喧暄煊萱卉喙毁彙徽揮暉煇諱輝麾休携烋畦虧恤譎鷸兇凶匈洶胸黑昕欣炘痕吃屹紇訖欠欽歆吸恰洽翕興僖凞喜噫囍姬嬉希憙憘戱晞曦熙熹熺犧禧稀羲詰"] ] [ ["0","\u0000",127], ["a140"," ,、。.‧;:?!︰…‥﹐﹑﹒·﹔﹕﹖﹗|–︱—︳╴︴﹏()︵︶{}︷︸〔〕︹︺【】︻︼《》︽︾〈〉︿﹀「」﹁﹂『』﹃﹄﹙﹚"], ["a1a1","﹛﹜﹝﹞‘’“”〝〞‵′#&*※§〃○●△▲◎☆★◇◆□■▽▼㊣℅¯ ̄_ˍ﹉﹊﹍﹎﹋﹌﹟﹠﹡+-×÷±√<>=≦≧≠∞≒≡﹢",4,"~∩∪⊥∠∟⊿㏒㏑∫∮∵∴♀♂⊕⊙↑↓←→↖↗↙↘∥∣/"], ["a240","\∕﹨$¥〒¢£%@℃℉﹩﹪﹫㏕㎜㎝㎞㏎㎡㎎㎏㏄°兙兛兞兝兡兣嗧瓩糎▁",7,"▏▎▍▌▋▊▉┼┴┬┤├▔─│▕┌┐└┘╭"], ["a2a1","╮╰╯═╞╪╡◢◣◥◤╱╲╳0",9,"Ⅰ",9,"〡",8,"十卄卅A",25,"a",21], ["a340","wxyzΑ",16,"Σ",6,"α",16,"σ",6,"ㄅ",10], ["a3a1","ㄐ",25,"˙ˉˊˇˋ"], ["a3e1","€"], ["a440","一乙丁七乃九了二人儿入八几刀刁力匕十卜又三下丈上丫丸凡久么也乞于亡兀刃勺千叉口土士夕大女子孑孓寸小尢尸山川工己已巳巾干廾弋弓才"], ["a4a1","丑丐不中丰丹之尹予云井互五亢仁什仃仆仇仍今介仄元允內六兮公冗凶分切刈勻勾勿化匹午升卅卞厄友及反壬天夫太夭孔少尤尺屯巴幻廿弔引心戈戶手扎支文斗斤方日曰月木欠止歹毋比毛氏水火爪父爻片牙牛犬王丙"], ["a540","世丕且丘主乍乏乎以付仔仕他仗代令仙仞充兄冉冊冬凹出凸刊加功包匆北匝仟半卉卡占卯卮去可古右召叮叩叨叼司叵叫另只史叱台句叭叻四囚外"], ["a5a1","央失奴奶孕它尼巨巧左市布平幼弁弘弗必戊打扔扒扑斥旦朮本未末札正母民氐永汁汀氾犯玄玉瓜瓦甘生用甩田由甲申疋白皮皿目矛矢石示禾穴立丞丟乒乓乩亙交亦亥仿伉伙伊伕伍伐休伏仲件任仰仳份企伋光兇兆先全"], ["a640","共再冰列刑划刎刖劣匈匡匠印危吉吏同吊吐吁吋各向名合吃后吆吒因回囝圳地在圭圬圯圩夙多夷夸妄奸妃好她如妁字存宇守宅安寺尖屹州帆并年"], ["a6a1","式弛忙忖戎戌戍成扣扛托收早旨旬旭曲曳有朽朴朱朵次此死氖汝汗汙江池汐汕污汛汍汎灰牟牝百竹米糸缶羊羽老考而耒耳聿肉肋肌臣自至臼舌舛舟艮色艾虫血行衣西阡串亨位住佇佗佞伴佛何估佐佑伽伺伸佃佔似但佣"], ["a740","作你伯低伶余佝佈佚兌克免兵冶冷別判利刪刨劫助努劬匣即卵吝吭吞吾否呎吧呆呃吳呈呂君吩告吹吻吸吮吵吶吠吼呀吱含吟听囪困囤囫坊坑址坍"], ["a7a1","均坎圾坐坏圻壯夾妝妒妨妞妣妙妖妍妤妓妊妥孝孜孚孛完宋宏尬局屁尿尾岐岑岔岌巫希序庇床廷弄弟彤形彷役忘忌志忍忱快忸忪戒我抄抗抖技扶抉扭把扼找批扳抒扯折扮投抓抑抆改攻攸旱更束李杏材村杜杖杞杉杆杠"], ["a840","杓杗步每求汞沙沁沈沉沅沛汪決沐汰沌汨沖沒汽沃汲汾汴沆汶沍沔沘沂灶灼災灸牢牡牠狄狂玖甬甫男甸皂盯矣私秀禿究系罕肖肓肝肘肛肚育良芒"], ["a8a1","芋芍見角言谷豆豕貝赤走足身車辛辰迂迆迅迄巡邑邢邪邦那酉釆里防阮阱阪阬並乖乳事些亞享京佯依侍佳使佬供例來侃佰併侈佩佻侖佾侏侑佺兔兒兕兩具其典冽函刻券刷刺到刮制剁劾劻卒協卓卑卦卷卸卹取叔受味呵"], ["a940","咖呸咕咀呻呷咄咒咆呼咐呱呶和咚呢周咋命咎固垃坷坪坩坡坦坤坼夜奉奇奈奄奔妾妻委妹妮姑姆姐姍始姓姊妯妳姒姅孟孤季宗定官宜宙宛尚屈居"], ["a9a1","屆岷岡岸岩岫岱岳帘帚帖帕帛帑幸庚店府底庖延弦弧弩往征彿彼忝忠忽念忿怏怔怯怵怖怪怕怡性怩怫怛或戕房戾所承拉拌拄抿拂抹拒招披拓拔拋拈抨抽押拐拙拇拍抵拚抱拘拖拗拆抬拎放斧於旺昔易昌昆昂明昀昏昕昊"], ["aa40","昇服朋杭枋枕東果杳杷枇枝林杯杰板枉松析杵枚枓杼杪杲欣武歧歿氓氛泣注泳沱泌泥河沽沾沼波沫法泓沸泄油況沮泗泅泱沿治泡泛泊沬泯泜泖泠"], ["aaa1","炕炎炒炊炙爬爭爸版牧物狀狎狙狗狐玩玨玟玫玥甽疝疙疚的盂盲直知矽社祀祁秉秈空穹竺糾罔羌羋者肺肥肢肱股肫肩肴肪肯臥臾舍芳芝芙芭芽芟芹花芬芥芯芸芣芰芾芷虎虱初表軋迎返近邵邸邱邶采金長門阜陀阿阻附"], ["ab40","陂隹雨青非亟亭亮信侵侯便俠俑俏保促侶俘俟俊俗侮俐俄係俚俎俞侷兗冒冑冠剎剃削前剌剋則勇勉勃勁匍南卻厚叛咬哀咨哎哉咸咦咳哇哂咽咪品"], ["aba1","哄哈咯咫咱咻咩咧咿囿垂型垠垣垢城垮垓奕契奏奎奐姜姘姿姣姨娃姥姪姚姦威姻孩宣宦室客宥封屎屏屍屋峙峒巷帝帥帟幽庠度建弈弭彥很待徊律徇後徉怒思怠急怎怨恍恰恨恢恆恃恬恫恪恤扁拜挖按拼拭持拮拽指拱拷"], ["ac40","拯括拾拴挑挂政故斫施既春昭映昧是星昨昱昤曷柿染柱柔某柬架枯柵柩柯柄柑枴柚查枸柏柞柳枰柙柢柝柒歪殃殆段毒毗氟泉洋洲洪流津洌洱洞洗"], ["aca1","活洽派洶洛泵洹洧洸洩洮洵洎洫炫為炳炬炯炭炸炮炤爰牲牯牴狩狠狡玷珊玻玲珍珀玳甚甭畏界畎畋疫疤疥疢疣癸皆皇皈盈盆盃盅省盹相眉看盾盼眇矜砂研砌砍祆祉祈祇禹禺科秒秋穿突竿竽籽紂紅紀紉紇約紆缸美羿耄"], ["ad40","耐耍耑耶胖胥胚胃胄背胡胛胎胞胤胝致舢苧范茅苣苛苦茄若茂茉苒苗英茁苜苔苑苞苓苟苯茆虐虹虻虺衍衫要觔計訂訃貞負赴赳趴軍軌述迦迢迪迥"], ["ada1","迭迫迤迨郊郎郁郃酋酊重閂限陋陌降面革韋韭音頁風飛食首香乘亳倌倍倣俯倦倥俸倩倖倆值借倚倒們俺倀倔倨俱倡個候倘俳修倭倪俾倫倉兼冤冥冢凍凌准凋剖剜剔剛剝匪卿原厝叟哨唐唁唷哼哥哲唆哺唔哩哭員唉哮哪"], ["ae40","哦唧唇哽唏圃圄埂埔埋埃堉夏套奘奚娑娘娜娟娛娓姬娠娣娩娥娌娉孫屘宰害家宴宮宵容宸射屑展屐峭峽峻峪峨峰島崁峴差席師庫庭座弱徒徑徐恙"], ["aea1","恣恥恐恕恭恩息悄悟悚悍悔悌悅悖扇拳挈拿捎挾振捕捂捆捏捉挺捐挽挪挫挨捍捌效敉料旁旅時晉晏晃晒晌晅晁書朔朕朗校核案框桓根桂桔栩梳栗桌桑栽柴桐桀格桃株桅栓栘桁殊殉殷氣氧氨氦氤泰浪涕消涇浦浸海浙涓"], ["af40","浬涉浮浚浴浩涌涊浹涅浥涔烊烘烤烙烈烏爹特狼狹狽狸狷玆班琉珮珠珪珞畔畝畜畚留疾病症疲疳疽疼疹痂疸皋皰益盍盎眩真眠眨矩砰砧砸砝破砷"], ["afa1","砥砭砠砟砲祕祐祠祟祖神祝祗祚秤秣秧租秦秩秘窄窈站笆笑粉紡紗紋紊素索純紐紕級紜納紙紛缺罟羔翅翁耆耘耕耙耗耽耿胱脂胰脅胭胴脆胸胳脈能脊胼胯臭臬舀舐航舫舨般芻茫荒荔荊茸荐草茵茴荏茲茹茶茗荀茱茨荃"], ["b040","虔蚊蚪蚓蚤蚩蚌蚣蚜衰衷袁袂衽衹記訐討訌訕訊託訓訖訏訑豈豺豹財貢起躬軒軔軏辱送逆迷退迺迴逃追逅迸邕郡郝郢酒配酌釘針釗釜釙閃院陣陡"], ["b0a1","陛陝除陘陞隻飢馬骨高鬥鬲鬼乾偺偽停假偃偌做偉健偶偎偕偵側偷偏倏偯偭兜冕凰剪副勒務勘動匐匏匙匿區匾參曼商啪啦啄啞啡啃啊唱啖問啕唯啤唸售啜唬啣唳啁啗圈國圉域堅堊堆埠埤基堂堵執培夠奢娶婁婉婦婪婀"], ["b140","娼婢婚婆婊孰寇寅寄寂宿密尉專將屠屜屝崇崆崎崛崖崢崑崩崔崙崤崧崗巢常帶帳帷康庸庶庵庾張強彗彬彩彫得徙從徘御徠徜恿患悉悠您惋悴惦悽"], ["b1a1","情悻悵惜悼惘惕惆惟悸惚惇戚戛扈掠控捲掖探接捷捧掘措捱掩掉掃掛捫推掄授掙採掬排掏掀捻捩捨捺敝敖救教敗啟敏敘敕敔斜斛斬族旋旌旎晝晚晤晨晦晞曹勗望梁梯梢梓梵桿桶梱梧梗械梃棄梭梆梅梔條梨梟梡梂欲殺"], ["b240","毫毬氫涎涼淳淙液淡淌淤添淺清淇淋涯淑涮淞淹涸混淵淅淒渚涵淚淫淘淪深淮淨淆淄涪淬涿淦烹焉焊烽烯爽牽犁猜猛猖猓猙率琅琊球理現琍瓠瓶"], ["b2a1","瓷甜產略畦畢異疏痔痕疵痊痍皎盔盒盛眷眾眼眶眸眺硫硃硎祥票祭移窒窕笠笨笛第符笙笞笮粒粗粕絆絃統紮紹紼絀細紳組累終紲紱缽羞羚翌翎習耜聊聆脯脖脣脫脩脰脤舂舵舷舶船莎莞莘荸莢莖莽莫莒莊莓莉莠荷荻荼"], ["b340","莆莧處彪蛇蛀蚶蛄蚵蛆蛋蚱蚯蛉術袞袈被袒袖袍袋覓規訪訝訣訥許設訟訛訢豉豚販責貫貨貪貧赧赦趾趺軛軟這逍通逗連速逝逐逕逞造透逢逖逛途"], ["b3a1","部郭都酗野釵釦釣釧釭釩閉陪陵陳陸陰陴陶陷陬雀雪雩章竟頂頃魚鳥鹵鹿麥麻傢傍傅備傑傀傖傘傚最凱割剴創剩勞勝勛博厥啻喀喧啼喊喝喘喂喜喪喔喇喋喃喳單喟唾喲喚喻喬喱啾喉喫喙圍堯堪場堤堰報堡堝堠壹壺奠"], ["b440","婷媚婿媒媛媧孳孱寒富寓寐尊尋就嵌嵐崴嵇巽幅帽幀幃幾廊廁廂廄弼彭復循徨惑惡悲悶惠愜愣惺愕惰惻惴慨惱愎惶愉愀愒戟扉掣掌描揀揩揉揆揍"], ["b4a1","插揣提握揖揭揮捶援揪換摒揚揹敞敦敢散斑斐斯普晰晴晶景暑智晾晷曾替期朝棺棕棠棘棗椅棟棵森棧棹棒棲棣棋棍植椒椎棉棚楮棻款欺欽殘殖殼毯氮氯氬港游湔渡渲湧湊渠渥渣減湛湘渤湖湮渭渦湯渴湍渺測湃渝渾滋"], ["b540","溉渙湎湣湄湲湩湟焙焚焦焰無然煮焜牌犄犀猶猥猴猩琺琪琳琢琥琵琶琴琯琛琦琨甥甦畫番痢痛痣痙痘痞痠登發皖皓皴盜睏短硝硬硯稍稈程稅稀窘"], ["b5a1","窗窖童竣等策筆筐筒答筍筋筏筑粟粥絞結絨絕紫絮絲絡給絢絰絳善翔翕耋聒肅腕腔腋腑腎脹腆脾腌腓腴舒舜菩萃菸萍菠菅萋菁華菱菴著萊菰萌菌菽菲菊萸萎萄菜萇菔菟虛蛟蛙蛭蛔蛛蛤蛐蛞街裁裂袱覃視註詠評詞証詁"], ["b640","詔詛詐詆訴診訶詖象貂貯貼貳貽賁費賀貴買貶貿貸越超趁跎距跋跚跑跌跛跆軻軸軼辜逮逵週逸進逶鄂郵鄉郾酣酥量鈔鈕鈣鈉鈞鈍鈐鈇鈑閔閏開閑"], ["b6a1","間閒閎隊階隋陽隅隆隍陲隄雁雅雄集雇雯雲韌項順須飧飪飯飩飲飭馮馭黃黍黑亂傭債傲傳僅傾催傷傻傯僇剿剷剽募勦勤勢勣匯嗟嗨嗓嗦嗎嗜嗇嗑嗣嗤嗯嗚嗡嗅嗆嗥嗉園圓塞塑塘塗塚塔填塌塭塊塢塒塋奧嫁嫉嫌媾媽媼"], ["b740","媳嫂媲嵩嵯幌幹廉廈弒彙徬微愚意慈感想愛惹愁愈慎慌慄慍愾愴愧愍愆愷戡戢搓搾搞搪搭搽搬搏搜搔損搶搖搗搆敬斟新暗暉暇暈暖暄暘暍會榔業"], ["b7a1","楚楷楠楔極椰概楊楨楫楞楓楹榆楝楣楛歇歲毀殿毓毽溢溯滓溶滂源溝滇滅溥溘溼溺溫滑準溜滄滔溪溧溴煎煙煩煤煉照煜煬煦煌煥煞煆煨煖爺牒猷獅猿猾瑯瑚瑕瑟瑞瑁琿瑙瑛瑜當畸瘀痰瘁痲痱痺痿痴痳盞盟睛睫睦睞督"], ["b840","睹睪睬睜睥睨睢矮碎碰碗碘碌碉硼碑碓硿祺祿禁萬禽稜稚稠稔稟稞窟窠筷節筠筮筧粱粳粵經絹綑綁綏絛置罩罪署義羨群聖聘肆肄腱腰腸腥腮腳腫"], ["b8a1","腹腺腦舅艇蒂葷落萱葵葦葫葉葬葛萼萵葡董葩葭葆虞虜號蛹蜓蜈蜇蜀蛾蛻蜂蜃蜆蜊衙裟裔裙補裘裝裡裊裕裒覜解詫該詳試詩詰誇詼詣誠話誅詭詢詮詬詹詻訾詨豢貊貉賊資賈賄貲賃賂賅跡跟跨路跳跺跪跤跦躲較載軾輊"], ["b940","辟農運遊道遂達逼違遐遇遏過遍遑逾遁鄒鄗酬酪酩釉鈷鉗鈸鈽鉀鈾鉛鉋鉤鉑鈴鉉鉍鉅鈹鈿鉚閘隘隔隕雍雋雉雊雷電雹零靖靴靶預頑頓頊頒頌飼飴"], ["b9a1","飽飾馳馱馴髡鳩麂鼎鼓鼠僧僮僥僖僭僚僕像僑僱僎僩兢凳劃劂匱厭嗾嘀嘛嘗嗽嘔嘆嘉嘍嘎嗷嘖嘟嘈嘐嗶團圖塵塾境墓墊塹墅塽壽夥夢夤奪奩嫡嫦嫩嫗嫖嫘嫣孵寞寧寡寥實寨寢寤察對屢嶄嶇幛幣幕幗幔廓廖弊彆彰徹慇"], ["ba40","愿態慷慢慣慟慚慘慵截撇摘摔撤摸摟摺摑摧搴摭摻敲斡旗旖暢暨暝榜榨榕槁榮槓構榛榷榻榫榴槐槍榭槌榦槃榣歉歌氳漳演滾漓滴漩漾漠漬漏漂漢"], ["baa1","滿滯漆漱漸漲漣漕漫漯澈漪滬漁滲滌滷熔熙煽熊熄熒爾犒犖獄獐瑤瑣瑪瑰瑭甄疑瘧瘍瘋瘉瘓盡監瞄睽睿睡磁碟碧碳碩碣禎福禍種稱窪窩竭端管箕箋筵算箝箔箏箸箇箄粹粽精綻綰綜綽綾綠緊綴網綱綺綢綿綵綸維緒緇綬"], ["bb40","罰翠翡翟聞聚肇腐膀膏膈膊腿膂臧臺與舔舞艋蓉蒿蓆蓄蒙蒞蒲蒜蓋蒸蓀蓓蒐蒼蓑蓊蜿蜜蜻蜢蜥蜴蜘蝕蜷蜩裳褂裴裹裸製裨褚裯誦誌語誣認誡誓誤"], ["bba1","說誥誨誘誑誚誧豪貍貌賓賑賒赫趙趕跼輔輒輕輓辣遠遘遜遣遙遞遢遝遛鄙鄘鄞酵酸酷酴鉸銀銅銘銖鉻銓銜銨鉼銑閡閨閩閣閥閤隙障際雌雒需靼鞅韶頗領颯颱餃餅餌餉駁骯骰髦魁魂鳴鳶鳳麼鼻齊億儀僻僵價儂儈儉儅凜"], ["bc40","劇劈劉劍劊勰厲嘮嘻嘹嘲嘿嘴嘩噓噎噗噴嘶嘯嘰墀墟增墳墜墮墩墦奭嬉嫻嬋嫵嬌嬈寮寬審寫層履嶝嶔幢幟幡廢廚廟廝廣廠彈影德徵慶慧慮慝慕憂"], ["bca1","慼慰慫慾憧憐憫憎憬憚憤憔憮戮摩摯摹撞撲撈撐撰撥撓撕撩撒撮播撫撚撬撙撢撳敵敷數暮暫暴暱樣樟槨樁樞標槽模樓樊槳樂樅槭樑歐歎殤毅毆漿潼澄潑潦潔澆潭潛潸潮澎潺潰潤澗潘滕潯潠潟熟熬熱熨牖犛獎獗瑩璋璃"], ["bd40","瑾璀畿瘠瘩瘟瘤瘦瘡瘢皚皺盤瞎瞇瞌瞑瞋磋磅確磊碾磕碼磐稿稼穀稽稷稻窯窮箭箱範箴篆篇篁箠篌糊締練緯緻緘緬緝編緣線緞緩綞緙緲緹罵罷羯"], ["bda1","翩耦膛膜膝膠膚膘蔗蔽蔚蓮蔬蔭蔓蔑蔣蔡蔔蓬蔥蓿蔆螂蝴蝶蝠蝦蝸蝨蝙蝗蝌蝓衛衝褐複褒褓褕褊誼諒談諄誕請諸課諉諂調誰論諍誶誹諛豌豎豬賠賞賦賤賬賭賢賣賜質賡赭趟趣踫踐踝踢踏踩踟踡踞躺輝輛輟輩輦輪輜輞"], ["be40","輥適遮遨遭遷鄰鄭鄧鄱醇醉醋醃鋅銻銷鋪銬鋤鋁銳銼鋒鋇鋰銲閭閱霄霆震霉靠鞍鞋鞏頡頫頜颳養餓餒餘駝駐駟駛駑駕駒駙骷髮髯鬧魅魄魷魯鴆鴉"], ["bea1","鴃麩麾黎墨齒儒儘儔儐儕冀冪凝劑劓勳噙噫噹噩噤噸噪器噥噱噯噬噢噶壁墾壇壅奮嬝嬴學寰導彊憲憑憩憊懍憶憾懊懈戰擅擁擋撻撼據擄擇擂操撿擒擔撾整曆曉暹曄曇暸樽樸樺橙橫橘樹橄橢橡橋橇樵機橈歙歷氅濂澱澡"], ["bf40","濃澤濁澧澳激澹澶澦澠澴熾燉燐燒燈燕熹燎燙燜燃燄獨璜璣璘璟璞瓢甌甍瘴瘸瘺盧盥瞠瞞瞟瞥磨磚磬磧禦積穎穆穌穋窺篙簑築篤篛篡篩篦糕糖縊"], ["bfa1","縑縈縛縣縞縝縉縐罹羲翰翱翮耨膳膩膨臻興艘艙蕊蕙蕈蕨蕩蕃蕉蕭蕪蕞螃螟螞螢融衡褪褲褥褫褡親覦諦諺諫諱謀諜諧諮諾謁謂諷諭諳諶諼豫豭貓賴蹄踱踴蹂踹踵輻輯輸輳辨辦遵遴選遲遼遺鄴醒錠錶鋸錳錯錢鋼錫錄錚"], ["c040","錐錦錡錕錮錙閻隧隨險雕霎霑霖霍霓霏靛靜靦鞘頰頸頻頷頭頹頤餐館餞餛餡餚駭駢駱骸骼髻髭鬨鮑鴕鴣鴦鴨鴒鴛默黔龍龜優償儡儲勵嚎嚀嚐嚅嚇"], ["c0a1","嚏壕壓壑壎嬰嬪嬤孺尷屨嶼嶺嶽嶸幫彌徽應懂懇懦懋戲戴擎擊擘擠擰擦擬擱擢擭斂斃曙曖檀檔檄檢檜櫛檣橾檗檐檠歜殮毚氈濘濱濟濠濛濤濫濯澀濬濡濩濕濮濰燧營燮燦燥燭燬燴燠爵牆獰獲璩環璦璨癆療癌盪瞳瞪瞰瞬"], ["c140","瞧瞭矯磷磺磴磯礁禧禪穗窿簇簍篾篷簌篠糠糜糞糢糟糙糝縮績繆縷縲繃縫總縱繅繁縴縹繈縵縿縯罄翳翼聱聲聰聯聳臆臃膺臂臀膿膽臉膾臨舉艱薪"], ["c1a1","薄蕾薜薑薔薯薛薇薨薊虧蟀蟑螳蟒蟆螫螻螺蟈蟋褻褶襄褸褽覬謎謗謙講謊謠謝謄謐豁谿豳賺賽購賸賻趨蹉蹋蹈蹊轄輾轂轅輿避遽還邁邂邀鄹醣醞醜鍍鎂錨鍵鍊鍥鍋錘鍾鍬鍛鍰鍚鍔闊闋闌闈闆隱隸雖霜霞鞠韓顆颶餵騁"], ["c240","駿鮮鮫鮪鮭鴻鴿麋黏點黜黝黛鼾齋叢嚕嚮壙壘嬸彝懣戳擴擲擾攆擺擻擷斷曜朦檳檬櫃檻檸櫂檮檯歟歸殯瀉瀋濾瀆濺瀑瀏燻燼燾燸獷獵璧璿甕癖癘"], ["c2a1","癒瞽瞿瞻瞼礎禮穡穢穠竄竅簫簧簪簞簣簡糧織繕繞繚繡繒繙罈翹翻職聶臍臏舊藏薩藍藐藉薰薺薹薦蟯蟬蟲蟠覆覲觴謨謹謬謫豐贅蹙蹣蹦蹤蹟蹕軀轉轍邇邃邈醫醬釐鎔鎊鎖鎢鎳鎮鎬鎰鎘鎚鎗闔闖闐闕離雜雙雛雞霤鞣鞦"], ["c340","鞭韹額顏題顎顓颺餾餿餽餮馥騎髁鬃鬆魏魎魍鯊鯉鯽鯈鯀鵑鵝鵠黠鼕鼬儳嚥壞壟壢寵龐廬懲懷懶懵攀攏曠曝櫥櫝櫚櫓瀛瀟瀨瀚瀝瀕瀘爆爍牘犢獸"], ["c3a1","獺璽瓊瓣疇疆癟癡矇礙禱穫穩簾簿簸簽簷籀繫繭繹繩繪羅繳羶羹羸臘藩藝藪藕藤藥藷蟻蠅蠍蟹蟾襠襟襖襞譁譜識證譚譎譏譆譙贈贊蹼蹲躇蹶蹬蹺蹴轔轎辭邊邋醱醮鏡鏑鏟鏃鏈鏜鏝鏖鏢鏍鏘鏤鏗鏨關隴難霪霧靡韜韻類"], ["c440","願顛颼饅饉騖騙鬍鯨鯧鯖鯛鶉鵡鵲鵪鵬麒麗麓麴勸嚨嚷嚶嚴嚼壤孀孃孽寶巉懸懺攘攔攙曦朧櫬瀾瀰瀲爐獻瓏癢癥礦礪礬礫竇競籌籃籍糯糰辮繽繼"], ["c4a1","纂罌耀臚艦藻藹蘑藺蘆蘋蘇蘊蠔蠕襤覺觸議譬警譯譟譫贏贍躉躁躅躂醴釋鐘鐃鏽闡霰飄饒饑馨騫騰騷騵鰓鰍鹹麵黨鼯齟齣齡儷儸囁囀囂夔屬巍懼懾攝攜斕曩櫻欄櫺殲灌爛犧瓖瓔癩矓籐纏續羼蘗蘭蘚蠣蠢蠡蠟襪襬覽譴"], ["c540","護譽贓躊躍躋轟辯醺鐮鐳鐵鐺鐸鐲鐫闢霸霹露響顧顥饗驅驃驀騾髏魔魑鰭鰥鶯鶴鷂鶸麝黯鼙齜齦齧儼儻囈囊囉孿巔巒彎懿攤權歡灑灘玀瓤疊癮癬"], ["c5a1","禳籠籟聾聽臟襲襯觼讀贖贗躑躓轡酈鑄鑑鑒霽霾韃韁顫饕驕驍髒鬚鱉鰱鰾鰻鷓鷗鼴齬齪龔囌巖戀攣攫攪曬欐瓚竊籤籣籥纓纖纔臢蘸蘿蠱變邐邏鑣鑠鑤靨顯饜驚驛驗髓體髑鱔鱗鱖鷥麟黴囑壩攬灞癱癲矗罐羈蠶蠹衢讓讒"], ["c640","讖艷贛釀鑪靂靈靄韆顰驟鬢魘鱟鷹鷺鹼鹽鼇齷齲廳欖灣籬籮蠻觀躡釁鑲鑰顱饞髖鬣黌灤矚讚鑷韉驢驥纜讜躪釅鑽鑾鑼鱷鱸黷豔鑿鸚爨驪鬱鸛鸞籲"], ["c940","乂乜凵匚厂万丌乇亍囗兀屮彳丏冇与丮亓仂仉仈冘勼卬厹圠夃夬尐巿旡殳毌气爿丱丼仨仜仩仡仝仚刌匜卌圢圣夗夯宁宄尒尻屴屳帄庀庂忉戉扐氕"], ["c9a1","氶汃氿氻犮犰玊禸肊阞伎优伬仵伔仱伀价伈伝伂伅伢伓伄仴伒冱刓刉刐劦匢匟卍厊吇囡囟圮圪圴夼妀奼妅奻奾奷奿孖尕尥屼屺屻屾巟幵庄异弚彴忕忔忏扜扞扤扡扦扢扙扠扚扥旯旮朾朹朸朻机朿朼朳氘汆汒汜汏汊汔汋"], ["ca40","汌灱牞犴犵玎甪癿穵网艸艼芀艽艿虍襾邙邗邘邛邔阢阤阠阣佖伻佢佉体佤伾佧佒佟佁佘伭伳伿佡冏冹刜刞刡劭劮匉卣卲厎厏吰吷吪呔呅吙吜吥吘"], ["caa1","吽呏呁吨吤呇囮囧囥坁坅坌坉坋坒夆奀妦妘妠妗妎妢妐妏妧妡宎宒尨尪岍岏岈岋岉岒岊岆岓岕巠帊帎庋庉庌庈庍弅弝彸彶忒忑忐忭忨忮忳忡忤忣忺忯忷忻怀忴戺抃抌抎抏抔抇扱扻扺扰抁抈扷扽扲扴攷旰旴旳旲旵杅杇"], ["cb40","杙杕杌杈杝杍杚杋毐氙氚汸汧汫沄沋沏汱汯汩沚汭沇沕沜汦汳汥汻沎灴灺牣犿犽狃狆狁犺狅玕玗玓玔玒町甹疔疕皁礽耴肕肙肐肒肜芐芏芅芎芑芓"], ["cba1","芊芃芄豸迉辿邟邡邥邞邧邠阰阨阯阭丳侘佼侅佽侀侇佶佴侉侄佷佌侗佪侚佹侁佸侐侜侔侞侒侂侕佫佮冞冼冾刵刲刳剆刱劼匊匋匼厒厔咇呿咁咑咂咈呫呺呾呥呬呴呦咍呯呡呠咘呣呧呤囷囹坯坲坭坫坱坰坶垀坵坻坳坴坢"], ["cc40","坨坽夌奅妵妺姏姎妲姌姁妶妼姃姖妱妽姀姈妴姇孢孥宓宕屄屇岮岤岠岵岯岨岬岟岣岭岢岪岧岝岥岶岰岦帗帔帙弨弢弣弤彔徂彾彽忞忥怭怦怙怲怋"], ["cca1","怴怊怗怳怚怞怬怢怍怐怮怓怑怌怉怜戔戽抭抴拑抾抪抶拊抮抳抯抻抩抰抸攽斨斻昉旼昄昒昈旻昃昋昍昅旽昑昐曶朊枅杬枎枒杶杻枘枆构杴枍枌杺枟枑枙枃杽极杸杹枔欥殀歾毞氝沓泬泫泮泙沶泔沭泧沷泐泂沺泃泆泭泲"], ["cd40","泒泝沴沊沝沀泞泀洰泍泇沰泹泏泩泑炔炘炅炓炆炄炑炖炂炚炃牪狖狋狘狉狜狒狔狚狌狑玤玡玭玦玢玠玬玝瓝瓨甿畀甾疌疘皯盳盱盰盵矸矼矹矻矺"], ["cda1","矷祂礿秅穸穻竻籵糽耵肏肮肣肸肵肭舠芠苀芫芚芘芛芵芧芮芼芞芺芴芨芡芩苂芤苃芶芢虰虯虭虮豖迒迋迓迍迖迕迗邲邴邯邳邰阹阽阼阺陃俍俅俓侲俉俋俁俔俜俙侻侳俛俇俖侺俀侹俬剄剉勀勂匽卼厗厖厙厘咺咡咭咥哏"], ["ce40","哃茍咷咮哖咶哅哆咠呰咼咢咾呲哞咰垵垞垟垤垌垗垝垛垔垘垏垙垥垚垕壴复奓姡姞姮娀姱姝姺姽姼姶姤姲姷姛姩姳姵姠姾姴姭宨屌峐峘峌峗峋峛"], ["cea1","峞峚峉峇峊峖峓峔峏峈峆峎峟峸巹帡帢帣帠帤庰庤庢庛庣庥弇弮彖徆怷怹恔恲恞恅恓恇恉恛恌恀恂恟怤恄恘恦恮扂扃拏挍挋拵挎挃拫拹挏挌拸拶挀挓挔拺挕拻拰敁敃斪斿昶昡昲昵昜昦昢昳昫昺昝昴昹昮朏朐柁柲柈枺"], ["cf40","柜枻柸柘柀枷柅柫柤柟枵柍枳柷柶柮柣柂枹柎柧柰枲柼柆柭柌枮柦柛柺柉柊柃柪柋欨殂殄殶毖毘毠氠氡洨洴洭洟洼洿洒洊泚洳洄洙洺洚洑洀洝浂"], ["cfa1","洁洘洷洃洏浀洇洠洬洈洢洉洐炷炟炾炱炰炡炴炵炩牁牉牊牬牰牳牮狊狤狨狫狟狪狦狣玅珌珂珈珅玹玶玵玴珫玿珇玾珃珆玸珋瓬瓮甮畇畈疧疪癹盄眈眃眄眅眊盷盻盺矧矨砆砑砒砅砐砏砎砉砃砓祊祌祋祅祄秕种秏秖秎窀"], ["d040","穾竑笀笁籺籸籹籿粀粁紃紈紁罘羑羍羾耇耎耏耔耷胘胇胠胑胈胂胐胅胣胙胜胊胕胉胏胗胦胍臿舡芔苙苾苹茇苨茀苕茺苫苖苴苬苡苲苵茌苻苶苰苪"], ["d0a1","苤苠苺苳苭虷虴虼虳衁衎衧衪衩觓訄訇赲迣迡迮迠郱邽邿郕郅邾郇郋郈釔釓陔陏陑陓陊陎倞倅倇倓倢倰倛俵俴倳倷倬俶俷倗倜倠倧倵倯倱倎党冔冓凊凄凅凈凎剡剚剒剞剟剕剢勍匎厞唦哢唗唒哧哳哤唚哿唄唈哫唑唅哱"], ["d140","唊哻哷哸哠唎唃唋圁圂埌堲埕埒垺埆垽垼垸垶垿埇埐垹埁夎奊娙娖娭娮娕娏娗娊娞娳孬宧宭宬尃屖屔峬峿峮峱峷崀峹帩帨庨庮庪庬弳弰彧恝恚恧"], ["d1a1","恁悢悈悀悒悁悝悃悕悛悗悇悜悎戙扆拲挐捖挬捄捅挶捃揤挹捋捊挼挩捁挴捘捔捙挭捇挳捚捑挸捗捀捈敊敆旆旃旄旂晊晟晇晑朒朓栟栚桉栲栳栻桋桏栖栱栜栵栫栭栯桎桄栴栝栒栔栦栨栮桍栺栥栠欬欯欭欱欴歭肂殈毦毤"], ["d240","毨毣毢毧氥浺浣浤浶洍浡涒浘浢浭浯涑涍淯浿涆浞浧浠涗浰浼浟涂涘洯浨涋浾涀涄洖涃浻浽浵涐烜烓烑烝烋缹烢烗烒烞烠烔烍烅烆烇烚烎烡牂牸"], ["d2a1","牷牶猀狺狴狾狶狳狻猁珓珙珥珖玼珧珣珩珜珒珛珔珝珚珗珘珨瓞瓟瓴瓵甡畛畟疰痁疻痄痀疿疶疺皊盉眝眛眐眓眒眣眑眕眙眚眢眧砣砬砢砵砯砨砮砫砡砩砳砪砱祔祛祏祜祓祒祑秫秬秠秮秭秪秜秞秝窆窉窅窋窌窊窇竘笐"], ["d340","笄笓笅笏笈笊笎笉笒粄粑粊粌粈粍粅紞紝紑紎紘紖紓紟紒紏紌罜罡罞罠罝罛羖羒翃翂翀耖耾耹胺胲胹胵脁胻脀舁舯舥茳茭荄茙荑茥荖茿荁茦茜茢"], ["d3a1","荂荎茛茪茈茼荍茖茤茠茷茯茩荇荅荌荓茞茬荋茧荈虓虒蚢蚨蚖蚍蚑蚞蚇蚗蚆蚋蚚蚅蚥蚙蚡蚧蚕蚘蚎蚝蚐蚔衃衄衭衵衶衲袀衱衿衯袃衾衴衼訒豇豗豻貤貣赶赸趵趷趶軑軓迾迵适迿迻逄迼迶郖郠郙郚郣郟郥郘郛郗郜郤酐"], ["d440","酎酏釕釢釚陜陟隼飣髟鬯乿偰偪偡偞偠偓偋偝偲偈偍偁偛偊偢倕偅偟偩偫偣偤偆偀偮偳偗偑凐剫剭剬剮勖勓匭厜啵啶唼啍啐唴唪啑啢唶唵唰啒啅"], ["d4a1","唌唲啥啎唹啈唭唻啀啋圊圇埻堔埢埶埜埴堀埭埽堈埸堋埳埏堇埮埣埲埥埬埡堎埼堐埧堁堌埱埩埰堍堄奜婠婘婕婧婞娸娵婭婐婟婥婬婓婤婗婃婝婒婄婛婈媎娾婍娹婌婰婩婇婑婖婂婜孲孮寁寀屙崞崋崝崚崠崌崨崍崦崥崏"], ["d540","崰崒崣崟崮帾帴庱庴庹庲庳弶弸徛徖徟悊悐悆悾悰悺惓惔惏惤惙惝惈悱惛悷惊悿惃惍惀挲捥掊掂捽掽掞掭掝掗掫掎捯掇掐据掯捵掜捭掮捼掤挻掟"], ["d5a1","捸掅掁掑掍捰敓旍晥晡晛晙晜晢朘桹梇梐梜桭桮梮梫楖桯梣梬梩桵桴梲梏桷梒桼桫桲梪梀桱桾梛梖梋梠梉梤桸桻梑梌梊桽欶欳欷欸殑殏殍殎殌氪淀涫涴涳湴涬淩淢涷淶淔渀淈淠淟淖涾淥淜淝淛淴淊涽淭淰涺淕淂淏淉"], ["d640","淐淲淓淽淗淍淣涻烺焍烷焗烴焌烰焄烳焐烼烿焆焓焀烸烶焋焂焎牾牻牼牿猝猗猇猑猘猊猈狿猏猞玈珶珸珵琄琁珽琇琀珺珼珿琌琋珴琈畤畣痎痒痏"], ["d6a1","痋痌痑痐皏皉盓眹眯眭眱眲眴眳眽眥眻眵硈硒硉硍硊硌砦硅硐祤祧祩祪祣祫祡离秺秸秶秷窏窔窐笵筇笴笥笰笢笤笳笘笪笝笱笫笭笯笲笸笚笣粔粘粖粣紵紽紸紶紺絅紬紩絁絇紾紿絊紻紨罣羕羜羝羛翊翋翍翐翑翇翏翉耟"], ["d740","耞耛聇聃聈脘脥脙脛脭脟脬脞脡脕脧脝脢舑舸舳舺舴舲艴莐莣莨莍荺荳莤荴莏莁莕莙荵莔莩荽莃莌莝莛莪莋荾莥莯莈莗莰荿莦莇莮荶莚虙虖蚿蚷"], ["d7a1","蛂蛁蛅蚺蚰蛈蚹蚳蚸蛌蚴蚻蚼蛃蚽蚾衒袉袕袨袢袪袚袑袡袟袘袧袙袛袗袤袬袌袓袎覂觖觙觕訰訧訬訞谹谻豜豝豽貥赽赻赹趼跂趹趿跁軘軞軝軜軗軠軡逤逋逑逜逌逡郯郪郰郴郲郳郔郫郬郩酖酘酚酓酕釬釴釱釳釸釤釹釪"], ["d840","釫釷釨釮镺閆閈陼陭陫陱陯隿靪頄飥馗傛傕傔傞傋傣傃傌傎傝偨傜傒傂傇兟凔匒匑厤厧喑喨喥喭啷噅喢喓喈喏喵喁喣喒喤啽喌喦啿喕喡喎圌堩堷"], ["d8a1","堙堞堧堣堨埵塈堥堜堛堳堿堶堮堹堸堭堬堻奡媯媔媟婺媢媞婸媦婼媥媬媕媮娷媄媊媗媃媋媩婻婽媌媜媏媓媝寪寍寋寔寑寊寎尌尰崷嵃嵫嵁嵋崿崵嵑嵎嵕崳崺嵒崽崱嵙嵂崹嵉崸崼崲崶嵀嵅幄幁彘徦徥徫惉悹惌惢惎惄愔"], ["d940","惲愊愖愅惵愓惸惼惾惁愃愘愝愐惿愄愋扊掔掱掰揎揥揨揯揃撝揳揊揠揶揕揲揵摡揟掾揝揜揄揘揓揂揇揌揋揈揰揗揙攲敧敪敤敜敨敥斌斝斞斮旐旒"], ["d9a1","晼晬晻暀晱晹晪晲朁椌棓椄棜椪棬棪棱椏棖棷棫棤棶椓椐棳棡椇棌椈楰梴椑棯棆椔棸棐棽棼棨椋椊椗棎棈棝棞棦棴棑椆棔棩椕椥棇欹欻欿欼殔殗殙殕殽毰毲毳氰淼湆湇渟湉溈渼渽湅湢渫渿湁湝湳渜渳湋湀湑渻渃渮湞"], ["da40","湨湜湡渱渨湠湱湫渹渢渰湓湥渧湸湤湷湕湹湒湦渵渶湚焠焞焯烻焮焱焣焥焢焲焟焨焺焛牋牚犈犉犆犅犋猒猋猰猢猱猳猧猲猭猦猣猵猌琮琬琰琫琖"], ["daa1","琚琡琭琱琤琣琝琩琠琲瓻甯畯畬痧痚痡痦痝痟痤痗皕皒盚睆睇睄睍睅睊睎睋睌矞矬硠硤硥硜硭硱硪确硰硩硨硞硢祴祳祲祰稂稊稃稌稄窙竦竤筊笻筄筈筌筎筀筘筅粢粞粨粡絘絯絣絓絖絧絪絏絭絜絫絒絔絩絑絟絎缾缿罥"], ["db40","罦羢羠羡翗聑聏聐胾胔腃腊腒腏腇脽腍脺臦臮臷臸臹舄舼舽舿艵茻菏菹萣菀菨萒菧菤菼菶萐菆菈菫菣莿萁菝菥菘菿菡菋菎菖菵菉萉萏菞萑萆菂菳"], ["dba1","菕菺菇菑菪萓菃菬菮菄菻菗菢萛菛菾蛘蛢蛦蛓蛣蛚蛪蛝蛫蛜蛬蛩蛗蛨蛑衈衖衕袺裗袹袸裀袾袶袼袷袽袲褁裉覕覘覗觝觚觛詎詍訹詙詀詗詘詄詅詒詈詑詊詌詏豟貁貀貺貾貰貹貵趄趀趉跘跓跍跇跖跜跏跕跙跈跗跅軯軷軺"], ["dc40","軹軦軮軥軵軧軨軶軫軱軬軴軩逭逴逯鄆鄬鄄郿郼鄈郹郻鄁鄀鄇鄅鄃酡酤酟酢酠鈁鈊鈥鈃鈚鈦鈏鈌鈀鈒釿釽鈆鈄鈧鈂鈜鈤鈙鈗鈅鈖镻閍閌閐隇陾隈"], ["dca1","隉隃隀雂雈雃雱雰靬靰靮頇颩飫鳦黹亃亄亶傽傿僆傮僄僊傴僈僂傰僁傺傱僋僉傶傸凗剺剸剻剼嗃嗛嗌嗐嗋嗊嗝嗀嗔嗄嗩喿嗒喍嗏嗕嗢嗖嗈嗲嗍嗙嗂圔塓塨塤塏塍塉塯塕塎塝塙塥塛堽塣塱壼嫇嫄嫋媺媸媱媵媰媿嫈媻嫆"], ["dd40","媷嫀嫊媴媶嫍媹媐寖寘寙尟尳嵱嵣嵊嵥嵲嵬嵞嵨嵧嵢巰幏幎幊幍幋廅廌廆廋廇彀徯徭惷慉慊愫慅愶愲愮慆愯慏愩慀戠酨戣戥戤揅揱揫搐搒搉搠搤"], ["dda1","搳摃搟搕搘搹搷搢搣搌搦搰搨摁搵搯搊搚摀搥搧搋揧搛搮搡搎敯斒旓暆暌暕暐暋暊暙暔晸朠楦楟椸楎楢楱椿楅楪椹楂楗楙楺楈楉椵楬椳椽楥棰楸椴楩楀楯楄楶楘楁楴楌椻楋椷楜楏楑椲楒椯楻椼歆歅歃歂歈歁殛嗀毻毼"], ["de40","毹毷毸溛滖滈溏滀溟溓溔溠溱溹滆滒溽滁溞滉溷溰滍溦滏溲溾滃滜滘溙溒溎溍溤溡溿溳滐滊溗溮溣煇煔煒煣煠煁煝煢煲煸煪煡煂煘煃煋煰煟煐煓"], ["dea1","煄煍煚牏犍犌犑犐犎猼獂猻猺獀獊獉瑄瑊瑋瑒瑑瑗瑀瑏瑐瑎瑂瑆瑍瑔瓡瓿瓾瓽甝畹畷榃痯瘏瘃痷痾痼痹痸瘐痻痶痭痵痽皙皵盝睕睟睠睒睖睚睩睧睔睙睭矠碇碚碔碏碄碕碅碆碡碃硹碙碀碖硻祼禂祽祹稑稘稙稒稗稕稢稓"], ["df40","稛稐窣窢窞竫筦筤筭筴筩筲筥筳筱筰筡筸筶筣粲粴粯綈綆綀綍絿綅絺綎絻綃絼綌綔綄絽綒罭罫罧罨罬羦羥羧翛翜耡腤腠腷腜腩腛腢腲朡腞腶腧腯"], ["dfa1","腄腡舝艉艄艀艂艅蓱萿葖葶葹蒏蒍葥葑葀蒆葧萰葍葽葚葙葴葳葝蔇葞萷萺萴葺葃葸萲葅萩菙葋萯葂萭葟葰萹葎葌葒葯蓅蒎萻葇萶萳葨葾葄萫葠葔葮葐蜋蜄蛷蜌蛺蛖蛵蝍蛸蜎蜉蜁蛶蜍蜅裖裋裍裎裞裛裚裌裐覅覛觟觥觤"], ["e040","觡觠觢觜触詶誆詿詡訿詷誂誄詵誃誁詴詺谼豋豊豥豤豦貆貄貅賌赨赩趑趌趎趏趍趓趔趐趒跰跠跬跱跮跐跩跣跢跧跲跫跴輆軿輁輀輅輇輈輂輋遒逿"], ["e0a1","遄遉逽鄐鄍鄏鄑鄖鄔鄋鄎酮酯鉈鉒鈰鈺鉦鈳鉥鉞銃鈮鉊鉆鉭鉬鉏鉠鉧鉯鈶鉡鉰鈱鉔鉣鉐鉲鉎鉓鉌鉖鈲閟閜閞閛隒隓隑隗雎雺雽雸雵靳靷靸靲頏頍頎颬飶飹馯馲馰馵骭骫魛鳪鳭鳧麀黽僦僔僗僨僳僛僪僝僤僓僬僰僯僣僠"], ["e140","凘劀劁勩勫匰厬嘧嘕嘌嘒嗼嘏嘜嘁嘓嘂嗺嘝嘄嗿嗹墉塼墐墘墆墁塿塴墋塺墇墑墎塶墂墈塻墔墏壾奫嫜嫮嫥嫕嫪嫚嫭嫫嫳嫢嫠嫛嫬嫞嫝嫙嫨嫟孷寠"], ["e1a1","寣屣嶂嶀嵽嶆嵺嶁嵷嶊嶉嶈嵾嵼嶍嵹嵿幘幙幓廘廑廗廎廜廕廙廒廔彄彃彯徶愬愨慁慞慱慳慒慓慲慬憀慴慔慺慛慥愻慪慡慖戩戧戫搫摍摛摝摴摶摲摳摽摵摦撦摎撂摞摜摋摓摠摐摿搿摬摫摙摥摷敳斠暡暠暟朅朄朢榱榶槉"], ["e240","榠槎榖榰榬榼榑榙榎榧榍榩榾榯榿槄榽榤槔榹槊榚槏榳榓榪榡榞槙榗榐槂榵榥槆歊歍歋殞殟殠毃毄毾滎滵滱漃漥滸漷滻漮漉潎漙漚漧漘漻漒滭漊"], ["e2a1","漶潳滹滮漭潀漰漼漵滫漇漎潃漅滽滶漹漜滼漺漟漍漞漈漡熇熐熉熀熅熂熏煻熆熁熗牄牓犗犕犓獃獍獑獌瑢瑳瑱瑵瑲瑧瑮甀甂甃畽疐瘖瘈瘌瘕瘑瘊瘔皸瞁睼瞅瞂睮瞀睯睾瞃碲碪碴碭碨硾碫碞碥碠碬碢碤禘禊禋禖禕禔禓"], ["e340","禗禈禒禐稫穊稰稯稨稦窨窫窬竮箈箜箊箑箐箖箍箌箛箎箅箘劄箙箤箂粻粿粼粺綧綷緂綣綪緁緀緅綝緎緄緆緋緌綯綹綖綼綟綦綮綩綡緉罳翢翣翥翞"], ["e3a1","耤聝聜膉膆膃膇膍膌膋舕蒗蒤蒡蒟蒺蓎蓂蒬蒮蒫蒹蒴蓁蓍蒪蒚蒱蓐蒝蒧蒻蒢蒔蓇蓌蒛蒩蒯蒨蓖蒘蒶蓏蒠蓗蓔蓒蓛蒰蒑虡蜳蜣蜨蝫蝀蜮蜞蜡蜙蜛蝃蜬蝁蜾蝆蜠蜲蜪蜭蜼蜒蜺蜱蜵蝂蜦蜧蜸蜤蜚蜰蜑裷裧裱裲裺裾裮裼裶裻"], ["e440","裰裬裫覝覡覟覞觩觫觨誫誙誋誒誏誖谽豨豩賕賏賗趖踉踂跿踍跽踊踃踇踆踅跾踀踄輐輑輎輍鄣鄜鄠鄢鄟鄝鄚鄤鄡鄛酺酲酹酳銥銤鉶銛鉺銠銔銪銍"], ["e4a1","銦銚銫鉹銗鉿銣鋮銎銂銕銢鉽銈銡銊銆銌銙銧鉾銇銩銝銋鈭隞隡雿靘靽靺靾鞃鞀鞂靻鞄鞁靿韎韍頖颭颮餂餀餇馝馜駃馹馻馺駂馽駇骱髣髧鬾鬿魠魡魟鳱鳲鳵麧僿儃儰僸儆儇僶僾儋儌僽儊劋劌勱勯噈噂噌嘵噁噊噉噆噘"], ["e540","噚噀嘳嘽嘬嘾嘸嘪嘺圚墫墝墱墠墣墯墬墥墡壿嫿嫴嫽嫷嫶嬃嫸嬂嫹嬁嬇嬅嬏屧嶙嶗嶟嶒嶢嶓嶕嶠嶜嶡嶚嶞幩幝幠幜緳廛廞廡彉徲憋憃慹憱憰憢憉"], ["e5a1","憛憓憯憭憟憒憪憡憍慦憳戭摮摰撖撠撅撗撜撏撋撊撌撣撟摨撱撘敶敺敹敻斲斳暵暰暩暲暷暪暯樀樆樗槥槸樕槱槤樠槿槬槢樛樝槾樧槲槮樔槷槧橀樈槦槻樍槼槫樉樄樘樥樏槶樦樇槴樖歑殥殣殢殦氁氀毿氂潁漦潾澇濆澒"], ["e640","澍澉澌潢潏澅潚澖潶潬澂潕潲潒潐潗澔澓潝漀潡潫潽潧澐潓澋潩潿澕潣潷潪潻熲熯熛熰熠熚熩熵熝熥熞熤熡熪熜熧熳犘犚獘獒獞獟獠獝獛獡獚獙"], ["e6a1","獢璇璉璊璆璁瑽璅璈瑼瑹甈甇畾瘥瘞瘙瘝瘜瘣瘚瘨瘛皜皝皞皛瞍瞏瞉瞈磍碻磏磌磑磎磔磈磃磄磉禚禡禠禜禢禛歶稹窲窴窳箷篋箾箬篎箯箹篊箵糅糈糌糋緷緛緪緧緗緡縃緺緦緶緱緰緮緟罶羬羰羭翭翫翪翬翦翨聤聧膣膟"], ["e740","膞膕膢膙膗舖艏艓艒艐艎艑蔤蔻蔏蔀蔩蔎蔉蔍蔟蔊蔧蔜蓻蔫蓺蔈蔌蓴蔪蓲蔕蓷蓫蓳蓼蔒蓪蓩蔖蓾蔨蔝蔮蔂蓽蔞蓶蔱蔦蓧蓨蓰蓯蓹蔘蔠蔰蔋蔙蔯虢"], ["e7a1","蝖蝣蝤蝷蟡蝳蝘蝔蝛蝒蝡蝚蝑蝞蝭蝪蝐蝎蝟蝝蝯蝬蝺蝮蝜蝥蝏蝻蝵蝢蝧蝩衚褅褌褔褋褗褘褙褆褖褑褎褉覢覤覣觭觰觬諏諆誸諓諑諔諕誻諗誾諀諅諘諃誺誽諙谾豍貏賥賟賙賨賚賝賧趠趜趡趛踠踣踥踤踮踕踛踖踑踙踦踧"], ["e840","踔踒踘踓踜踗踚輬輤輘輚輠輣輖輗遳遰遯遧遫鄯鄫鄩鄪鄲鄦鄮醅醆醊醁醂醄醀鋐鋃鋄鋀鋙銶鋏鋱鋟鋘鋩鋗鋝鋌鋯鋂鋨鋊鋈鋎鋦鋍鋕鋉鋠鋞鋧鋑鋓"], ["e8a1","銵鋡鋆銴镼閬閫閮閰隤隢雓霅霈霂靚鞊鞎鞈韐韏頞頝頦頩頨頠頛頧颲餈飺餑餔餖餗餕駜駍駏駓駔駎駉駖駘駋駗駌骳髬髫髳髲髱魆魃魧魴魱魦魶魵魰魨魤魬鳼鳺鳽鳿鳷鴇鴀鳹鳻鴈鴅鴄麃黓鼏鼐儜儓儗儚儑凞匴叡噰噠噮"], ["e940","噳噦噣噭噲噞噷圜圛壈墽壉墿墺壂墼壆嬗嬙嬛嬡嬔嬓嬐嬖嬨嬚嬠嬞寯嶬嶱嶩嶧嶵嶰嶮嶪嶨嶲嶭嶯嶴幧幨幦幯廩廧廦廨廥彋徼憝憨憖懅憴懆懁懌憺"], ["e9a1","憿憸憌擗擖擐擏擉撽撉擃擛擳擙攳敿敼斢曈暾曀曊曋曏暽暻暺曌朣樴橦橉橧樲橨樾橝橭橶橛橑樨橚樻樿橁橪橤橐橏橔橯橩橠樼橞橖橕橍橎橆歕歔歖殧殪殫毈毇氄氃氆澭濋澣濇澼濎濈潞濄澽澞濊澨瀄澥澮澺澬澪濏澿澸"], ["ea40","澢濉澫濍澯澲澰燅燂熿熸燖燀燁燋燔燊燇燏熽燘熼燆燚燛犝犞獩獦獧獬獥獫獪瑿璚璠璔璒璕璡甋疀瘯瘭瘱瘽瘳瘼瘵瘲瘰皻盦瞚瞝瞡瞜瞛瞢瞣瞕瞙"], ["eaa1","瞗磝磩磥磪磞磣磛磡磢磭磟磠禤穄穈穇窶窸窵窱窷篞篣篧篝篕篥篚篨篹篔篪篢篜篫篘篟糒糔糗糐糑縒縡縗縌縟縠縓縎縜縕縚縢縋縏縖縍縔縥縤罃罻罼罺羱翯耪耩聬膱膦膮膹膵膫膰膬膴膲膷膧臲艕艖艗蕖蕅蕫蕍蕓蕡蕘"], ["eb40","蕀蕆蕤蕁蕢蕄蕑蕇蕣蔾蕛蕱蕎蕮蕵蕕蕧蕠薌蕦蕝蕔蕥蕬虣虥虤螛螏螗螓螒螈螁螖螘蝹螇螣螅螐螑螝螄螔螜螚螉褞褦褰褭褮褧褱褢褩褣褯褬褟觱諠"], ["eba1","諢諲諴諵諝謔諤諟諰諈諞諡諨諿諯諻貑貒貐賵賮賱賰賳赬赮趥趧踳踾踸蹀蹅踶踼踽蹁踰踿躽輶輮輵輲輹輷輴遶遹遻邆郺鄳鄵鄶醓醐醑醍醏錧錞錈錟錆錏鍺錸錼錛錣錒錁鍆錭錎錍鋋錝鋺錥錓鋹鋷錴錂錤鋿錩錹錵錪錔錌"], ["ec40","錋鋾錉錀鋻錖閼闍閾閹閺閶閿閵閽隩雔霋霒霐鞙鞗鞔韰韸頵頯頲餤餟餧餩馞駮駬駥駤駰駣駪駩駧骹骿骴骻髶髺髹髷鬳鮀鮅鮇魼魾魻鮂鮓鮒鮐魺鮕"], ["eca1","魽鮈鴥鴗鴠鴞鴔鴩鴝鴘鴢鴐鴙鴟麈麆麇麮麭黕黖黺鼒鼽儦儥儢儤儠儩勴嚓嚌嚍嚆嚄嚃噾嚂噿嚁壖壔壏壒嬭嬥嬲嬣嬬嬧嬦嬯嬮孻寱寲嶷幬幪徾徻懃憵憼懧懠懥懤懨懞擯擩擣擫擤擨斁斀斶旚曒檍檖檁檥檉檟檛檡檞檇檓檎"], ["ed40","檕檃檨檤檑橿檦檚檅檌檒歛殭氉濌澩濴濔濣濜濭濧濦濞濲濝濢濨燡燱燨燲燤燰燢獳獮獯璗璲璫璐璪璭璱璥璯甐甑甒甏疄癃癈癉癇皤盩瞵瞫瞲瞷瞶"], ["eda1","瞴瞱瞨矰磳磽礂磻磼磲礅磹磾礄禫禨穜穛穖穘穔穚窾竀竁簅簏篲簀篿篻簎篴簋篳簂簉簃簁篸篽簆篰篱簐簊糨縭縼繂縳顈縸縪繉繀繇縩繌縰縻縶繄縺罅罿罾罽翴翲耬膻臄臌臊臅臇膼臩艛艚艜薃薀薏薧薕薠薋薣蕻薤薚薞"], ["ee40","蕷蕼薉薡蕺蕸蕗薎薖薆薍薙薝薁薢薂薈薅蕹蕶薘薐薟虨螾螪螭蟅螰螬螹螵螼螮蟉蟃蟂蟌螷螯蟄蟊螴螶螿螸螽蟞螲褵褳褼褾襁襒褷襂覭覯覮觲觳謞"], ["eea1","謘謖謑謅謋謢謏謒謕謇謍謈謆謜謓謚豏豰豲豱豯貕貔賹赯蹎蹍蹓蹐蹌蹇轃轀邅遾鄸醚醢醛醙醟醡醝醠鎡鎃鎯鍤鍖鍇鍼鍘鍜鍶鍉鍐鍑鍠鍭鎏鍌鍪鍹鍗鍕鍒鍏鍱鍷鍻鍡鍞鍣鍧鎀鍎鍙闇闀闉闃闅閷隮隰隬霠霟霘霝霙鞚鞡鞜"], ["ef40","鞞鞝韕韔韱顁顄顊顉顅顃餥餫餬餪餳餲餯餭餱餰馘馣馡騂駺駴駷駹駸駶駻駽駾駼騃骾髾髽鬁髼魈鮚鮨鮞鮛鮦鮡鮥鮤鮆鮢鮠鮯鴳鵁鵧鴶鴮鴯鴱鴸鴰"], ["efa1","鵅鵂鵃鴾鴷鵀鴽翵鴭麊麉麍麰黈黚黻黿鼤鼣鼢齔龠儱儭儮嚘嚜嚗嚚嚝嚙奰嬼屩屪巀幭幮懘懟懭懮懱懪懰懫懖懩擿攄擽擸攁攃擼斔旛曚曛曘櫅檹檽櫡櫆檺檶檷櫇檴檭歞毉氋瀇瀌瀍瀁瀅瀔瀎濿瀀濻瀦濼濷瀊爁燿燹爃燽獶"], ["f040","璸瓀璵瓁璾璶璻瓂甔甓癜癤癙癐癓癗癚皦皽盬矂瞺磿礌礓礔礉礐礒礑禭禬穟簜簩簙簠簟簭簝簦簨簢簥簰繜繐繖繣繘繢繟繑繠繗繓羵羳翷翸聵臑臒"], ["f0a1","臐艟艞薴藆藀藃藂薳薵薽藇藄薿藋藎藈藅薱薶藒蘤薸薷薾虩蟧蟦蟢蟛蟫蟪蟥蟟蟳蟤蟔蟜蟓蟭蟘蟣螤蟗蟙蠁蟴蟨蟝襓襋襏襌襆襐襑襉謪謧謣謳謰謵譇謯謼謾謱謥謷謦謶謮謤謻謽謺豂豵貙貘貗賾贄贂贀蹜蹢蹠蹗蹖蹞蹥蹧"], ["f140","蹛蹚蹡蹝蹩蹔轆轇轈轋鄨鄺鄻鄾醨醥醧醯醪鎵鎌鎒鎷鎛鎝鎉鎧鎎鎪鎞鎦鎕鎈鎙鎟鎍鎱鎑鎲鎤鎨鎴鎣鎥闒闓闑隳雗雚巂雟雘雝霣霢霥鞬鞮鞨鞫鞤鞪"], ["f1a1","鞢鞥韗韙韖韘韺顐顑顒颸饁餼餺騏騋騉騍騄騑騊騅騇騆髀髜鬈鬄鬅鬩鬵魊魌魋鯇鯆鯃鮿鯁鮵鮸鯓鮶鯄鮹鮽鵜鵓鵏鵊鵛鵋鵙鵖鵌鵗鵒鵔鵟鵘鵚麎麌黟鼁鼀鼖鼥鼫鼪鼩鼨齌齕儴儵劖勷厴嚫嚭嚦嚧嚪嚬壚壝壛夒嬽嬾嬿巃幰"], ["f240","徿懻攇攐攍攉攌攎斄旞旝曞櫧櫠櫌櫑櫙櫋櫟櫜櫐櫫櫏櫍櫞歠殰氌瀙瀧瀠瀖瀫瀡瀢瀣瀩瀗瀤瀜瀪爌爊爇爂爅犥犦犤犣犡瓋瓅璷瓃甖癠矉矊矄矱礝礛"], ["f2a1","礡礜礗礞禰穧穨簳簼簹簬簻糬糪繶繵繸繰繷繯繺繲繴繨罋罊羃羆羷翽翾聸臗臕艤艡艣藫藱藭藙藡藨藚藗藬藲藸藘藟藣藜藑藰藦藯藞藢蠀蟺蠃蟶蟷蠉蠌蠋蠆蟼蠈蟿蠊蠂襢襚襛襗襡襜襘襝襙覈覷覶觶譐譈譊譀譓譖譔譋譕"], ["f340","譑譂譒譗豃豷豶貚贆贇贉趬趪趭趫蹭蹸蹳蹪蹯蹻軂轒轑轏轐轓辴酀鄿醰醭鏞鏇鏏鏂鏚鏐鏹鏬鏌鏙鎩鏦鏊鏔鏮鏣鏕鏄鏎鏀鏒鏧镽闚闛雡霩霫霬霨霦"], ["f3a1","鞳鞷鞶韝韞韟顜顙顝顗颿颽颻颾饈饇饃馦馧騚騕騥騝騤騛騢騠騧騣騞騜騔髂鬋鬊鬎鬌鬷鯪鯫鯠鯞鯤鯦鯢鯰鯔鯗鯬鯜鯙鯥鯕鯡鯚鵷鶁鶊鶄鶈鵱鶀鵸鶆鶋鶌鵽鵫鵴鵵鵰鵩鶅鵳鵻鶂鵯鵹鵿鶇鵨麔麑黀黼鼭齀齁齍齖齗齘匷嚲"], ["f440","嚵嚳壣孅巆巇廮廯忀忁懹攗攖攕攓旟曨曣曤櫳櫰櫪櫨櫹櫱櫮櫯瀼瀵瀯瀷瀴瀱灂瀸瀿瀺瀹灀瀻瀳灁爓爔犨獽獼璺皫皪皾盭矌矎矏矍矲礥礣礧礨礤礩"], ["f4a1","禲穮穬穭竷籉籈籊籇籅糮繻繾纁纀羺翿聹臛臙舋艨艩蘢藿蘁藾蘛蘀藶蘄蘉蘅蘌藽蠙蠐蠑蠗蠓蠖襣襦覹觷譠譪譝譨譣譥譧譭趮躆躈躄轙轖轗轕轘轚邍酃酁醷醵醲醳鐋鐓鏻鐠鐏鐔鏾鐕鐐鐨鐙鐍鏵鐀鏷鐇鐎鐖鐒鏺鐉鏸鐊鏿"], ["f540","鏼鐌鏶鐑鐆闞闠闟霮霯鞹鞻韽韾顠顢顣顟飁飂饐饎饙饌饋饓騲騴騱騬騪騶騩騮騸騭髇髊髆鬐鬒鬑鰋鰈鯷鰅鰒鯸鱀鰇鰎鰆鰗鰔鰉鶟鶙鶤鶝鶒鶘鶐鶛"], ["f5a1","鶠鶔鶜鶪鶗鶡鶚鶢鶨鶞鶣鶿鶩鶖鶦鶧麙麛麚黥黤黧黦鼰鼮齛齠齞齝齙龑儺儹劘劗囃嚽嚾孈孇巋巏廱懽攛欂櫼欃櫸欀灃灄灊灈灉灅灆爝爚爙獾甗癪矐礭礱礯籔籓糲纊纇纈纋纆纍罍羻耰臝蘘蘪蘦蘟蘣蘜蘙蘧蘮蘡蘠蘩蘞蘥"], ["f640","蠩蠝蠛蠠蠤蠜蠫衊襭襩襮襫觺譹譸譅譺譻贐贔趯躎躌轞轛轝酆酄酅醹鐿鐻鐶鐩鐽鐼鐰鐹鐪鐷鐬鑀鐱闥闤闣霵霺鞿韡顤飉飆飀饘饖騹騽驆驄驂驁騺"], ["f6a1","騿髍鬕鬗鬘鬖鬺魒鰫鰝鰜鰬鰣鰨鰩鰤鰡鶷鶶鶼鷁鷇鷊鷏鶾鷅鷃鶻鶵鷎鶹鶺鶬鷈鶱鶭鷌鶳鷍鶲鹺麜黫黮黭鼛鼘鼚鼱齎齥齤龒亹囆囅囋奱孋孌巕巑廲攡攠攦攢欋欈欉氍灕灖灗灒爞爟犩獿瓘瓕瓙瓗癭皭礵禴穰穱籗籜籙籛籚"], ["f740","糴糱纑罏羇臞艫蘴蘵蘳蘬蘲蘶蠬蠨蠦蠪蠥襱覿覾觻譾讄讂讆讅譿贕躕躔躚躒躐躖躗轠轢酇鑌鑐鑊鑋鑏鑇鑅鑈鑉鑆霿韣顪顩飋饔饛驎驓驔驌驏驈驊"], ["f7a1","驉驒驐髐鬙鬫鬻魖魕鱆鱈鰿鱄鰹鰳鱁鰼鰷鰴鰲鰽鰶鷛鷒鷞鷚鷋鷐鷜鷑鷟鷩鷙鷘鷖鷵鷕鷝麶黰鼵鼳鼲齂齫龕龢儽劙壨壧奲孍巘蠯彏戁戃戄攩攥斖曫欑欒欏毊灛灚爢玂玁玃癰矔籧籦纕艬蘺虀蘹蘼蘱蘻蘾蠰蠲蠮蠳襶襴襳觾"], ["f840","讌讎讋讈豅贙躘轤轣醼鑢鑕鑝鑗鑞韄韅頀驖驙鬞鬟鬠鱒鱘鱐鱊鱍鱋鱕鱙鱌鱎鷻鷷鷯鷣鷫鷸鷤鷶鷡鷮鷦鷲鷰鷢鷬鷴鷳鷨鷭黂黐黲黳鼆鼜鼸鼷鼶齃齏"], ["f8a1","齱齰齮齯囓囍孎屭攭曭曮欓灟灡灝灠爣瓛瓥矕礸禷禶籪纗羉艭虃蠸蠷蠵衋讔讕躞躟躠躝醾醽釂鑫鑨鑩雥靆靃靇韇韥驞髕魙鱣鱧鱦鱢鱞鱠鸂鷾鸇鸃鸆鸅鸀鸁鸉鷿鷽鸄麠鼞齆齴齵齶囔攮斸欘欙欗欚灢爦犪矘矙礹籩籫糶纚"], ["f940","纘纛纙臠臡虆虇虈襹襺襼襻觿讘讙躥躤躣鑮鑭鑯鑱鑳靉顲饟鱨鱮鱭鸋鸍鸐鸏鸒鸑麡黵鼉齇齸齻齺齹圞灦籯蠼趲躦釃鑴鑸鑶鑵驠鱴鱳鱱鱵鸔鸓黶鼊"], ["f9a1","龤灨灥糷虪蠾蠽蠿讞貜躩軉靋顳顴飌饡馫驤驦驧鬤鸕鸗齈戇欞爧虌躨钂钀钁驩驨鬮鸙爩虋讟钃鱹麷癵驫鱺鸝灩灪麤齾齉龘碁銹裏墻恒粧嫺╔╦╗╠╬╣╚╩╝╒╤╕╞╪╡╘╧╛╓╥╖╟╫╢╙╨╜║═╭╮╰╯▓"] ] [ ["0","\u0000",127], ["8ea1","。",62], ["a1a1"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇"], ["a2a1","◆□■△▲▽▼※〒→←↑↓〓"], ["a2ba","∈∋⊆⊇⊂⊃∪∩"], ["a2ca","∧∨¬⇒⇔∀∃"], ["a2dc","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"], ["a2f2","ʼn♯♭♪†‡¶"], ["a2fe","◯"], ["a3b0","0",9], ["a3c1","A",25], ["a3e1","a",25], ["a4a1","ぁ",82], ["a5a1","ァ",85], ["a6a1","Α",16,"Σ",6], ["a6c1","α",16,"σ",6], ["a7a1","А",5,"ЁЖ",25], ["a7d1","а",5,"ёж",25], ["a8a1","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"], ["ada1","①",19,"Ⅰ",9], ["adc0","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"], ["addf","㍻〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"], ["b0a1","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"], ["b1a1","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応"], ["b2a1","押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"], ["b3a1","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱"], ["b4a1","粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"], ["b5a1","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京"], ["b6a1","供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"], ["b7a1","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲"], ["b8a1","検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"], ["b9a1","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込"], ["baa1","此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"], ["bba1","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時"], ["bca1","次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"], ["bda1","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償"], ["bea1","勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"], ["bfa1","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾"], ["c0a1","澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"], ["c1a1","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎"], ["c2a1","臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"], ["c3a1","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵"], ["c4a1","帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"], ["c5a1","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到"], ["c6a1","董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"], ["c7a1","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦"], ["c8a1","函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"], ["c9a1","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服"], ["caa1","福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"], ["cba1","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満"], ["cca1","漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"], ["cda1","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃"], ["cea1","痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"], ["cfa1","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"], ["d0a1","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"], ["d1a1","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨"], ["d2a1","辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"], ["d3a1","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉"], ["d4a1","圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"], ["d5a1","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓"], ["d6a1","屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"], ["d7a1","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚"], ["d8a1","悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"], ["d9a1","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼"], ["daa1","據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"], ["dba1","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍"], ["dca1","棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"], ["dda1","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾"], ["dea1","沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"], ["dfa1","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼"], ["e0a1","燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"], ["e1a1","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰"], ["e2a1","癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"], ["e3a1","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐"], ["e4a1","筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"], ["e5a1","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺"], ["e6a1","罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"], ["e7a1","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙"], ["e8a1","茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"], ["e9a1","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙"], ["eaa1","蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"], ["eba1","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫"], ["eca1","譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"], ["eda1","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸"], ["eea1","遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"], ["efa1","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞"], ["f0a1","陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"], ["f1a1","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷"], ["f2a1","髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"], ["f3a1","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠"], ["f4a1","堯槇遙瑤凜熙"], ["f9a1","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德"], ["faa1","忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"], ["fba1","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚"], ["fca1","釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"], ["fcf1","ⅰ",9,"¬¦'""], ["8fa2af","˘ˇ¸˙˝¯˛˚~΄΅"], ["8fa2c2","¡¦¿"], ["8fa2eb","ºª©®™¤№"], ["8fa6e1","ΆΈΉΊΪ"], ["8fa6e7","Ό"], ["8fa6e9","ΎΫ"], ["8fa6ec","Ώ"], ["8fa6f1","άέήίϊΐόςύϋΰώ"], ["8fa7c2","Ђ",10,"ЎЏ"], ["8fa7f2","ђ",10,"ўџ"], ["8fa9a1","ÆĐ"], ["8fa9a4","Ħ"], ["8fa9a6","IJ"], ["8fa9a8","ŁĿ"], ["8fa9ab","ŊØŒ"], ["8fa9af","ŦÞ"], ["8fa9c1","æđðħıijĸłŀʼnŋøœßŧþ"], ["8faaa1","ÁÀÄÂĂǍĀĄÅÃĆĈČÇĊĎÉÈËÊĚĖĒĘ"], ["8faaba","ĜĞĢĠĤÍÌÏÎǏİĪĮĨĴĶĹĽĻŃŇŅÑÓÒÖÔǑŐŌÕŔŘŖŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙǕŴÝŸŶŹŽŻ"], ["8faba1","áàäâăǎāąåãćĉčçċďéèëêěėēęǵĝğ"], ["8fabbd","ġĥíìïîǐ"], ["8fabc5","īįĩĵķĺľļńňņñóòöôǒőōõŕřŗśŝšşťţúùüûŭǔűūųůũǘǜǚǖŵýÿŷźžż"], ["8fb0a1","丂丄丅丌丒丟丣两丨丫丮丯丰丵乀乁乄乇乑乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘佟佣佪佬佮佱佷佸佹佺佽佾侁侂侄"], ["8fb1a1","侅侉侊侌侎侐侒侓侔侗侙侚侞侟侲侷侹侻侼侽侾俀俁俅俆俈俉俋俌俍俏俒俜俠俢俰俲俼俽俿倀倁倄倇倊倌倎倐倓倗倘倛倜倝倞倢倧倮倰倲倳倵偀偁偂偅偆偊偌偎偑偒偓偗偙偟偠偢偣偦偧偪偭偰偱倻傁傃傄傆傊傎傏傐"], ["8fb2a1","傒傓傔傖傛傜傞",4,"傪傯傰傹傺傽僀僃僄僇僌僎僐僓僔僘僜僝僟僢僤僦僨僩僯僱僶僺僾儃儆儇儈儋儌儍儎僲儐儗儙儛儜儝儞儣儧儨儬儭儯儱儳儴儵儸儹兂兊兏兓兕兗兘兟兤兦兾冃冄冋冎冘冝冡冣冭冸冺冼冾冿凂"], ["8fb3a1","凈减凑凒凓凕凘凞凢凥凮凲凳凴凷刁刂刅划刓刕刖刘刢刨刱刲刵刼剅剉剕剗剘剚剜剟剠剡剦剮剷剸剹劀劂劅劊劌劓劕劖劗劘劚劜劤劥劦劧劯劰劶劷劸劺劻劽勀勄勆勈勌勏勑勔勖勛勜勡勥勨勩勪勬勰勱勴勶勷匀匃匊匋"], ["8fb4a1","匌匑匓匘匛匜匞匟匥匧匨匩匫匬匭匰匲匵匼匽匾卂卌卋卙卛卡卣卥卬卭卲卹卾厃厇厈厎厓厔厙厝厡厤厪厫厯厲厴厵厷厸厺厽叀叅叏叒叓叕叚叝叞叠另叧叵吂吓吚吡吧吨吪启吱吴吵呃呄呇呍呏呞呢呤呦呧呩呫呭呮呴呿"], ["8fb5a1","咁咃咅咈咉咍咑咕咖咜咟咡咦咧咩咪咭咮咱咷咹咺咻咿哆哊响哎哠哪哬哯哶哼哾哿唀唁唅唈唉唌唍唎唕唪唫唲唵唶唻唼唽啁啇啉啊啍啐啑啘啚啛啞啠啡啤啦啿喁喂喆喈喎喏喑喒喓喔喗喣喤喭喲喿嗁嗃嗆嗉嗋嗌嗎嗑嗒"], ["8fb6a1","嗓嗗嗘嗛嗞嗢嗩嗶嗿嘅嘈嘊嘍",5,"嘙嘬嘰嘳嘵嘷嘹嘻嘼嘽嘿噀噁噃噄噆噉噋噍噏噔噞噠噡噢噣噦噩噭噯噱噲噵嚄嚅嚈嚋嚌嚕嚙嚚嚝嚞嚟嚦嚧嚨嚩嚫嚬嚭嚱嚳嚷嚾囅囉囊囋囏囐囌囍囙囜囝囟囡囤",4,"囱囫园"], ["8fb7a1","囶囷圁圂圇圊圌圑圕圚圛圝圠圢圣圤圥圩圪圬圮圯圳圴圽圾圿坅坆坌坍坒坢坥坧坨坫坭",4,"坳坴坵坷坹坺坻坼坾垁垃垌垔垗垙垚垜垝垞垟垡垕垧垨垩垬垸垽埇埈埌埏埕埝埞埤埦埧埩埭埰埵埶埸埽埾埿堃堄堈堉埡"], ["8fb8a1","堌堍堛堞堟堠堦堧堭堲堹堿塉塌塍塏塐塕塟塡塤塧塨塸塼塿墀墁墇墈墉墊墌墍墏墐墔墖墝墠墡墢墦墩墱墲壄墼壂壈壍壎壐壒壔壖壚壝壡壢壩壳夅夆夋夌夒夓夔虁夝夡夣夤夨夯夰夳夵夶夿奃奆奒奓奙奛奝奞奟奡奣奫奭"], ["8fb9a1","奯奲奵奶她奻奼妋妌妎妒妕妗妟妤妧妭妮妯妰妳妷妺妼姁姃姄姈姊姍姒姝姞姟姣姤姧姮姯姱姲姴姷娀娄娌娍娎娒娓娞娣娤娧娨娪娭娰婄婅婇婈婌婐婕婞婣婥婧婭婷婺婻婾媋媐媓媖媙媜媞媟媠媢媧媬媱媲媳媵媸媺媻媿"], ["8fbaa1","嫄嫆嫈嫏嫚嫜嫠嫥嫪嫮嫵嫶嫽嬀嬁嬈嬗嬴嬙嬛嬝嬡嬥嬭嬸孁孋孌孒孖孞孨孮孯孼孽孾孿宁宄宆宊宎宐宑宓宔宖宨宩宬宭宯宱宲宷宺宼寀寁寍寏寖",4,"寠寯寱寴寽尌尗尞尟尣尦尩尫尬尮尰尲尵尶屙屚屜屢屣屧屨屩"], ["8fbba1","屭屰屴屵屺屻屼屽岇岈岊岏岒岝岟岠岢岣岦岪岲岴岵岺峉峋峒峝峗峮峱峲峴崁崆崍崒崫崣崤崦崧崱崴崹崽崿嵂嵃嵆嵈嵕嵑嵙嵊嵟嵠嵡嵢嵤嵪嵭嵰嵹嵺嵾嵿嶁嶃嶈嶊嶒嶓嶔嶕嶙嶛嶟嶠嶧嶫嶰嶴嶸嶹巃巇巋巐巎巘巙巠巤"], ["8fbca1","巩巸巹帀帇帍帒帔帕帘帟帠帮帨帲帵帾幋幐幉幑幖幘幛幜幞幨幪",4,"幰庀庋庎庢庤庥庨庪庬庱庳庽庾庿廆廌廋廎廑廒廔廕廜廞廥廫异弆弇弈弎弙弜弝弡弢弣弤弨弫弬弮弰弴弶弻弽弿彀彄彅彇彍彐彔彘彛彠彣彤彧"], ["8fbda1","彯彲彴彵彸彺彽彾徉徍徏徖徜徝徢徧徫徤徬徯徰徱徸忄忇忈忉忋忐",4,"忞忡忢忨忩忪忬忭忮忯忲忳忶忺忼怇怊怍怓怔怗怘怚怟怤怭怳怵恀恇恈恉恌恑恔恖恗恝恡恧恱恾恿悂悆悈悊悎悑悓悕悘悝悞悢悤悥您悰悱悷"], ["8fbea1","悻悾惂惄惈惉惊惋惎惏惔惕惙惛惝惞惢惥惲惵惸惼惽愂愇愊愌愐",4,"愖愗愙愜愞愢愪愫愰愱愵愶愷愹慁慅慆慉慞慠慬慲慸慻慼慿憀憁憃憄憋憍憒憓憗憘憜憝憟憠憥憨憪憭憸憹憼懀懁懂懎懏懕懜懝懞懟懡懢懧懩懥"], ["8fbfa1","懬懭懯戁戃戄戇戓戕戜戠戢戣戧戩戫戹戽扂扃扄扆扌扐扑扒扔扖扚扜扤扭扯扳扺扽抍抎抏抐抦抨抳抶抷抺抾抿拄拎拕拖拚拪拲拴拼拽挃挄挊挋挍挐挓挖挘挩挪挭挵挶挹挼捁捂捃捄捆捊捋捎捒捓捔捘捛捥捦捬捭捱捴捵"], ["8fc0a1","捸捼捽捿掂掄掇掊掐掔掕掙掚掞掤掦掭掮掯掽揁揅揈揎揑揓揔揕揜揠揥揪揬揲揳揵揸揹搉搊搐搒搔搘搞搠搢搤搥搩搪搯搰搵搽搿摋摏摑摒摓摔摚摛摜摝摟摠摡摣摭摳摴摻摽撅撇撏撐撑撘撙撛撝撟撡撣撦撨撬撳撽撾撿"], ["8fc1a1","擄擉擊擋擌擎擐擑擕擗擤擥擩擪擭擰擵擷擻擿攁攄攈攉攊攏攓攔攖攙攛攞攟攢攦攩攮攱攺攼攽敃敇敉敐敒敔敟敠敧敫敺敽斁斅斊斒斕斘斝斠斣斦斮斲斳斴斿旂旈旉旎旐旔旖旘旟旰旲旴旵旹旾旿昀昄昈昉昍昑昒昕昖昝"], ["8fc2a1","昞昡昢昣昤昦昩昪昫昬昮昰昱昳昹昷晀晅晆晊晌晑晎晗晘晙晛晜晠晡曻晪晫晬晾晳晵晿晷晸晹晻暀晼暋暌暍暐暒暙暚暛暜暟暠暤暭暱暲暵暻暿曀曂曃曈曌曎曏曔曛曟曨曫曬曮曺朅朇朎朓朙朜朠朢朳朾杅杇杈杌杔杕杝"], ["8fc3a1","杦杬杮杴杶杻极构枎枏枑枓枖枘枙枛枰枱枲枵枻枼枽柹柀柂柃柅柈柉柒柗柙柜柡柦柰柲柶柷桒栔栙栝栟栨栧栬栭栯栰栱栳栻栿桄桅桊桌桕桗桘桛桫桮",4,"桵桹桺桻桼梂梄梆梈梖梘梚梜梡梣梥梩梪梮梲梻棅棈棌棏"], ["8fc4a1","棐棑棓棖棙棜棝棥棨棪棫棬棭棰棱棵棶棻棼棽椆椉椊椐椑椓椖椗椱椳椵椸椻楂楅楉楎楗楛楣楤楥楦楨楩楬楰楱楲楺楻楿榀榍榒榖榘榡榥榦榨榫榭榯榷榸榺榼槅槈槑槖槗槢槥槮槯槱槳槵槾樀樁樃樏樑樕樚樝樠樤樨樰樲"], ["8fc5a1","樴樷樻樾樿橅橆橉橊橎橐橑橒橕橖橛橤橧橪橱橳橾檁檃檆檇檉檋檑檛檝檞檟檥檫檯檰檱檴檽檾檿櫆櫉櫈櫌櫐櫔櫕櫖櫜櫝櫤櫧櫬櫰櫱櫲櫼櫽欂欃欆欇欉欏欐欑欗欛欞欤欨欫欬欯欵欶欻欿歆歊歍歒歖歘歝歠歧歫歮歰歵歽"], ["8fc6a1","歾殂殅殗殛殟殠殢殣殨殩殬殭殮殰殸殹殽殾毃毄毉毌毖毚毡毣毦毧毮毱毷毹毿氂氄氅氉氍氎氐氒氙氟氦氧氨氬氮氳氵氶氺氻氿汊汋汍汏汒汔汙汛汜汫汭汯汴汶汸汹汻沅沆沇沉沔沕沗沘沜沟沰沲沴泂泆泍泏泐泑泒泔泖"], ["8fc7a1","泚泜泠泧泩泫泬泮泲泴洄洇洊洎洏洑洓洚洦洧洨汧洮洯洱洹洼洿浗浞浟浡浥浧浯浰浼涂涇涑涒涔涖涗涘涪涬涴涷涹涽涿淄淈淊淎淏淖淛淝淟淠淢淥淩淯淰淴淶淼渀渄渞渢渧渲渶渹渻渼湄湅湈湉湋湏湑湒湓湔湗湜湝湞"], ["8fc8a1","湢湣湨湳湻湽溍溓溙溠溧溭溮溱溳溻溿滀滁滃滇滈滊滍滎滏滫滭滮滹滻滽漄漈漊漌漍漖漘漚漛漦漩漪漯漰漳漶漻漼漭潏潑潒潓潗潙潚潝潞潡潢潨潬潽潾澃澇澈澋澌澍澐澒澓澔澖澚澟澠澥澦澧澨澮澯澰澵澶澼濅濇濈濊"], ["8fc9a1","濚濞濨濩濰濵濹濼濽瀀瀅瀆瀇瀍瀗瀠瀣瀯瀴瀷瀹瀼灃灄灈灉灊灋灔灕灝灞灎灤灥灬灮灵灶灾炁炅炆炔",4,"炛炤炫炰炱炴炷烊烑烓烔烕烖烘烜烤烺焃",4,"焋焌焏焞焠焫焭焯焰焱焸煁煅煆煇煊煋煐煒煗煚煜煞煠"], ["8fcaa1","煨煹熀熅熇熌熒熚熛熠熢熯熰熲熳熺熿燀燁燄燋燌燓燖燙燚燜燸燾爀爇爈爉爓爗爚爝爟爤爫爯爴爸爹牁牂牃牅牎牏牐牓牕牖牚牜牞牠牣牨牫牮牯牱牷牸牻牼牿犄犉犍犎犓犛犨犭犮犱犴犾狁狇狉狌狕狖狘狟狥狳狴狺狻"], ["8fcba1","狾猂猄猅猇猋猍猒猓猘猙猞猢猤猧猨猬猱猲猵猺猻猽獃獍獐獒獖獘獝獞獟獠獦獧獩獫獬獮獯獱獷獹獼玀玁玃玅玆玎玐玓玕玗玘玜玞玟玠玢玥玦玪玫玭玵玷玹玼玽玿珅珆珉珋珌珏珒珓珖珙珝珡珣珦珧珩珴珵珷珹珺珻珽"], ["8fcca1","珿琀琁琄琇琊琑琚琛琤琦琨",9,"琹瑀瑃瑄瑆瑇瑋瑍瑑瑒瑗瑝瑢瑦瑧瑨瑫瑭瑮瑱瑲璀璁璅璆璇璉璏璐璑璒璘璙璚璜璟璠璡璣璦璨璩璪璫璮璯璱璲璵璹璻璿瓈瓉瓌瓐瓓瓘瓚瓛瓞瓟瓤瓨瓪瓫瓯瓴瓺瓻瓼瓿甆"], ["8fcda1","甒甖甗甠甡甤甧甩甪甯甶甹甽甾甿畀畃畇畈畎畐畒畗畞畟畡畯畱畹",5,"疁疅疐疒疓疕疙疜疢疤疴疺疿痀痁痄痆痌痎痏痗痜痟痠痡痤痧痬痮痯痱痹瘀瘂瘃瘄瘇瘈瘊瘌瘏瘒瘓瘕瘖瘙瘛瘜瘝瘞瘣瘥瘦瘩瘭瘲瘳瘵瘸瘹"], ["8fcea1","瘺瘼癊癀癁癃癄癅癉癋癕癙癟癤癥癭癮癯癱癴皁皅皌皍皕皛皜皝皟皠皢",6,"皪皭皽盁盅盉盋盌盎盔盙盠盦盨盬盰盱盶盹盼眀眆眊眎眒眔眕眗眙眚眜眢眨眭眮眯眴眵眶眹眽眾睂睅睆睊睍睎睏睒睖睗睜睞睟睠睢"], ["8fcfa1","睤睧睪睬睰睲睳睴睺睽瞀瞄瞌瞍瞔瞕瞖瞚瞟瞢瞧瞪瞮瞯瞱瞵瞾矃矉矑矒矕矙矞矟矠矤矦矪矬矰矱矴矸矻砅砆砉砍砎砑砝砡砢砣砭砮砰砵砷硃硄硇硈硌硎硒硜硞硠硡硣硤硨硪确硺硾碊碏碔碘碡碝碞碟碤碨碬碭碰碱碲碳"], ["8fd0a1","碻碽碿磇磈磉磌磎磒磓磕磖磤磛磟磠磡磦磪磲磳礀磶磷磺磻磿礆礌礐礚礜礞礟礠礥礧礩礭礱礴礵礻礽礿祄祅祆祊祋祏祑祔祘祛祜祧祩祫祲祹祻祼祾禋禌禑禓禔禕禖禘禛禜禡禨禩禫禯禱禴禸离秂秄秇秈秊秏秔秖秚秝秞"], ["8fd1a1","秠秢秥秪秫秭秱秸秼稂稃稇稉稊稌稑稕稛稞稡稧稫稭稯稰稴稵稸稹稺穄穅穇穈穌穕穖穙穜穝穟穠穥穧穪穭穵穸穾窀窂窅窆窊窋窐窑窔窞窠窣窬窳窵窹窻窼竆竉竌竎竑竛竨竩竫竬竱竴竻竽竾笇笔笟笣笧笩笪笫笭笮笯笰"], ["8fd2a1","笱笴笽笿筀筁筇筎筕筠筤筦筩筪筭筯筲筳筷箄箉箎箐箑箖箛箞箠箥箬箯箰箲箵箶箺箻箼箽篂篅篈篊篔篖篗篙篚篛篨篪篲篴篵篸篹篺篼篾簁簂簃簄簆簉簋簌簎簏簙簛簠簥簦簨簬簱簳簴簶簹簺籆籊籕籑籒籓籙",5], ["8fd3a1","籡籣籧籩籭籮籰籲籹籼籽粆粇粏粔粞粠粦粰粶粷粺粻粼粿糄糇糈糉糍糏糓糔糕糗糙糚糝糦糩糫糵紃紇紈紉紏紑紒紓紖紝紞紣紦紪紭紱紼紽紾絀絁絇絈絍絑絓絗絙絚絜絝絥絧絪絰絸絺絻絿綁綂綃綅綆綈綋綌綍綑綖綗綝"], ["8fd4a1","綞綦綧綪綳綶綷綹緂",4,"緌緍緎緗緙縀緢緥緦緪緫緭緱緵緶緹緺縈縐縑縕縗縜縝縠縧縨縬縭縯縳縶縿繄繅繇繎繐繒繘繟繡繢繥繫繮繯繳繸繾纁纆纇纊纍纑纕纘纚纝纞缼缻缽缾缿罃罄罇罏罒罓罛罜罝罡罣罤罥罦罭"], ["8fd5a1","罱罽罾罿羀羋羍羏羐羑羖羗羜羡羢羦羪羭羴羼羿翀翃翈翎翏翛翟翣翥翨翬翮翯翲翺翽翾翿耇耈耊耍耎耏耑耓耔耖耝耞耟耠耤耦耬耮耰耴耵耷耹耺耼耾聀聄聠聤聦聭聱聵肁肈肎肜肞肦肧肫肸肹胈胍胏胒胔胕胗胘胠胭胮"], ["8fd6a1","胰胲胳胶胹胺胾脃脋脖脗脘脜脞脠脤脧脬脰脵脺脼腅腇腊腌腒腗腠腡腧腨腩腭腯腷膁膐膄膅膆膋膎膖膘膛膞膢膮膲膴膻臋臃臅臊臎臏臕臗臛臝臞臡臤臫臬臰臱臲臵臶臸臹臽臿舀舃舏舓舔舙舚舝舡舢舨舲舴舺艃艄艅艆"], ["8fd7a1","艋艎艏艑艖艜艠艣艧艭艴艻艽艿芀芁芃芄芇芉芊芎芑芔芖芘芚芛芠芡芣芤芧芨芩芪芮芰芲芴芷芺芼芾芿苆苐苕苚苠苢苤苨苪苭苯苶苷苽苾茀茁茇茈茊茋荔茛茝茞茟茡茢茬茭茮茰茳茷茺茼茽荂荃荄荇荍荎荑荕荖荗荰荸"], ["8fd8a1","荽荿莀莂莄莆莍莒莔莕莘莙莛莜莝莦莧莩莬莾莿菀菇菉菏菐菑菔菝荓菨菪菶菸菹菼萁萆萊萏萑萕萙莭萯萹葅葇葈葊葍葏葑葒葖葘葙葚葜葠葤葥葧葪葰葳葴葶葸葼葽蒁蒅蒒蒓蒕蒞蒦蒨蒩蒪蒯蒱蒴蒺蒽蒾蓀蓂蓇蓈蓌蓏蓓"], ["8fd9a1","蓜蓧蓪蓯蓰蓱蓲蓷蔲蓺蓻蓽蔂蔃蔇蔌蔎蔐蔜蔞蔢蔣蔤蔥蔧蔪蔫蔯蔳蔴蔶蔿蕆蕏",4,"蕖蕙蕜",6,"蕤蕫蕯蕹蕺蕻蕽蕿薁薅薆薉薋薌薏薓薘薝薟薠薢薥薧薴薶薷薸薼薽薾薿藂藇藊藋藎薭藘藚藟藠藦藨藭藳藶藼"], ["8fdaa1","藿蘀蘄蘅蘍蘎蘐蘑蘒蘘蘙蘛蘞蘡蘧蘩蘶蘸蘺蘼蘽虀虂虆虒虓虖虗虘虙虝虠",4,"虩虬虯虵虶虷虺蚍蚑蚖蚘蚚蚜蚡蚦蚧蚨蚭蚱蚳蚴蚵蚷蚸蚹蚿蛀蛁蛃蛅蛑蛒蛕蛗蛚蛜蛠蛣蛥蛧蚈蛺蛼蛽蜄蜅蜇蜋蜎蜏蜐蜓蜔蜙蜞蜟蜡蜣"], ["8fdba1","蜨蜮蜯蜱蜲蜹蜺蜼蜽蜾蝀蝃蝅蝍蝘蝝蝡蝤蝥蝯蝱蝲蝻螃",6,"螋螌螐螓螕螗螘螙螞螠螣螧螬螭螮螱螵螾螿蟁蟈蟉蟊蟎蟕蟖蟙蟚蟜蟟蟢蟣蟤蟪蟫蟭蟱蟳蟸蟺蟿蠁蠃蠆蠉蠊蠋蠐蠙蠒蠓蠔蠘蠚蠛蠜蠞蠟蠨蠭蠮蠰蠲蠵"], ["8fdca1","蠺蠼衁衃衅衈衉衊衋衎衑衕衖衘衚衜衟衠衤衩衱衹衻袀袘袚袛袜袟袠袨袪袺袽袾裀裊",4,"裑裒裓裛裞裧裯裰裱裵裷褁褆褍褎褏褕褖褘褙褚褜褠褦褧褨褰褱褲褵褹褺褾襀襂襅襆襉襏襒襗襚襛襜襡襢襣襫襮襰襳襵襺"], ["8fdda1","襻襼襽覉覍覐覔覕覛覜覟覠覥覰覴覵覶覷覼觔",4,"觥觩觫觭觱觳觶觹觽觿訄訅訇訏訑訒訔訕訞訠訢訤訦訫訬訯訵訷訽訾詀詃詅詇詉詍詎詓詖詗詘詜詝詡詥詧詵詶詷詹詺詻詾詿誀誃誆誋誏誐誒誖誗誙誟誧誩誮誯誳"], ["8fdea1","誶誷誻誾諃諆諈諉諊諑諓諔諕諗諝諟諬諰諴諵諶諼諿謅謆謋謑謜謞謟謊謭謰謷謼譂",4,"譈譒譓譔譙譍譞譣譭譶譸譹譼譾讁讄讅讋讍讏讔讕讜讞讟谸谹谽谾豅豇豉豋豏豑豓豔豗豘豛豝豙豣豤豦豨豩豭豳豵豶豻豾貆"], ["8fdfa1","貇貋貐貒貓貙貛貜貤貹貺賅賆賉賋賏賖賕賙賝賡賨賬賯賰賲賵賷賸賾賿贁贃贉贒贗贛赥赩赬赮赿趂趄趈趍趐趑趕趞趟趠趦趫趬趯趲趵趷趹趻跀跅跆跇跈跊跎跑跔跕跗跙跤跥跧跬跰趼跱跲跴跽踁踄踅踆踋踑踔踖踠踡踢"], ["8fe0a1","踣踦踧踱踳踶踷踸踹踽蹀蹁蹋蹍蹎蹏蹔蹛蹜蹝蹞蹡蹢蹩蹬蹭蹯蹰蹱蹹蹺蹻躂躃躉躐躒躕躚躛躝躞躢躧躩躭躮躳躵躺躻軀軁軃軄軇軏軑軔軜軨軮軰軱軷軹軺軭輀輂輇輈輏輐輖輗輘輞輠輡輣輥輧輨輬輭輮輴輵輶輷輺轀轁"], ["8fe1a1","轃轇轏轑",4,"轘轝轞轥辝辠辡辤辥辦辵辶辸达迀迁迆迊迋迍运迒迓迕迠迣迤迨迮迱迵迶迻迾适逄逈逌逘逛逨逩逯逪逬逭逳逴逷逿遃遄遌遛遝遢遦遧遬遰遴遹邅邈邋邌邎邐邕邗邘邙邛邠邡邢邥邰邲邳邴邶邽郌邾郃"], ["8fe2a1","郄郅郇郈郕郗郘郙郜郝郟郥郒郶郫郯郰郴郾郿鄀鄄鄅鄆鄈鄍鄐鄔鄖鄗鄘鄚鄜鄞鄠鄥鄢鄣鄧鄩鄮鄯鄱鄴鄶鄷鄹鄺鄼鄽酃酇酈酏酓酗酙酚酛酡酤酧酭酴酹酺酻醁醃醅醆醊醎醑醓醔醕醘醞醡醦醨醬醭醮醰醱醲醳醶醻醼醽醿"], ["8fe3a1","釂釃釅釓釔釗釙釚釞釤釥釩釪釬",5,"釷釹釻釽鈀鈁鈄鈅鈆鈇鈉鈊鈌鈐鈒鈓鈖鈘鈜鈝鈣鈤鈥鈦鈨鈮鈯鈰鈳鈵鈶鈸鈹鈺鈼鈾鉀鉂鉃鉆鉇鉊鉍鉎鉏鉑鉘鉙鉜鉝鉠鉡鉥鉧鉨鉩鉮鉯鉰鉵",4,"鉻鉼鉽鉿銈銉銊銍銎銒銗"], ["8fe4a1","銙銟銠銤銥銧銨銫銯銲銶銸銺銻銼銽銿",4,"鋅鋆鋇鋈鋋鋌鋍鋎鋐鋓鋕鋗鋘鋙鋜鋝鋟鋠鋡鋣鋥鋧鋨鋬鋮鋰鋹鋻鋿錀錂錈錍錑錔錕錜錝錞錟錡錤錥錧錩錪錳錴錶錷鍇鍈鍉鍐鍑鍒鍕鍗鍘鍚鍞鍤鍥鍧鍩鍪鍭鍯鍰鍱鍳鍴鍶"], ["8fe5a1","鍺鍽鍿鎀鎁鎂鎈鎊鎋鎍鎏鎒鎕鎘鎛鎞鎡鎣鎤鎦鎨鎫鎴鎵鎶鎺鎩鏁鏄鏅鏆鏇鏉",4,"鏓鏙鏜鏞鏟鏢鏦鏧鏹鏷鏸鏺鏻鏽鐁鐂鐄鐈鐉鐍鐎鐏鐕鐖鐗鐟鐮鐯鐱鐲鐳鐴鐻鐿鐽鑃鑅鑈鑊鑌鑕鑙鑜鑟鑡鑣鑨鑫鑭鑮鑯鑱鑲钄钃镸镹"], ["8fe6a1","镾閄閈閌閍閎閝閞閟閡閦閩閫閬閴閶閺閽閿闆闈闉闋闐闑闒闓闙闚闝闞闟闠闤闦阝阞阢阤阥阦阬阱阳阷阸阹阺阼阽陁陒陔陖陗陘陡陮陴陻陼陾陿隁隂隃隄隉隑隖隚隝隟隤隥隦隩隮隯隳隺雊雒嶲雘雚雝雞雟雩雯雱雺霂"], ["8fe7a1","霃霅霉霚霛霝霡霢霣霨霱霳靁靃靊靎靏靕靗靘靚靛靣靧靪靮靳靶靷靸靻靽靿鞀鞉鞕鞖鞗鞙鞚鞞鞟鞢鞬鞮鞱鞲鞵鞶鞸鞹鞺鞼鞾鞿韁韄韅韇韉韊韌韍韎韐韑韔韗韘韙韝韞韠韛韡韤韯韱韴韷韸韺頇頊頙頍頎頔頖頜頞頠頣頦"], ["8fe8a1","頫頮頯頰頲頳頵頥頾顄顇顊顑顒顓顖顗顙顚顢顣顥顦顪顬颫颭颮颰颴颷颸颺颻颿飂飅飈飌飡飣飥飦飧飪飳飶餂餇餈餑餕餖餗餚餛餜餟餢餦餧餫餱",4,"餹餺餻餼饀饁饆饇饈饍饎饔饘饙饛饜饞饟饠馛馝馟馦馰馱馲馵"], ["8fe9a1","馹馺馽馿駃駉駓駔駙駚駜駞駧駪駫駬駰駴駵駹駽駾騂騃騄騋騌騐騑騖騞騠騢騣騤騧騭騮騳騵騶騸驇驁驄驊驋驌驎驑驔驖驝骪骬骮骯骲骴骵骶骹骻骾骿髁髃髆髈髎髐髒髕髖髗髛髜髠髤髥髧髩髬髲髳髵髹髺髽髿",4], ["8feaa1","鬄鬅鬈鬉鬋鬌鬍鬎鬐鬒鬖鬙鬛鬜鬠鬦鬫鬭鬳鬴鬵鬷鬹鬺鬽魈魋魌魕魖魗魛魞魡魣魥魦魨魪",4,"魳魵魷魸魹魿鮀鮄鮅鮆鮇鮉鮊鮋鮍鮏鮐鮔鮚鮝鮞鮦鮧鮩鮬鮰鮱鮲鮷鮸鮻鮼鮾鮿鯁鯇鯈鯎鯐鯗鯘鯝鯟鯥鯧鯪鯫鯯鯳鯷鯸"], ["8feba1","鯹鯺鯽鯿鰀鰂鰋鰏鰑鰖鰘鰙鰚鰜鰞鰢鰣鰦",4,"鰱鰵鰶鰷鰽鱁鱃鱄鱅鱉鱊鱎鱏鱐鱓鱔鱖鱘鱛鱝鱞鱟鱣鱩鱪鱜鱫鱨鱮鱰鱲鱵鱷鱻鳦鳲鳷鳹鴋鴂鴑鴗鴘鴜鴝鴞鴯鴰鴲鴳鴴鴺鴼鵅鴽鵂鵃鵇鵊鵓鵔鵟鵣鵢鵥鵩鵪鵫鵰鵶鵷鵻"], ["8feca1","鵼鵾鶃鶄鶆鶊鶍鶎鶒鶓鶕鶖鶗鶘鶡鶪鶬鶮鶱鶵鶹鶼鶿鷃鷇鷉鷊鷔鷕鷖鷗鷚鷞鷟鷠鷥鷧鷩鷫鷮鷰鷳鷴鷾鸊鸂鸇鸎鸐鸑鸒鸕鸖鸙鸜鸝鹺鹻鹼麀麂麃麄麅麇麎麏麖麘麛麞麤麨麬麮麯麰麳麴麵黆黈黋黕黟黤黧黬黭黮黰黱黲黵"], ["8feda1","黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃",4,"齓齕齖齗齘齚齝齞齨齩齭",4,"齳齵齺齽龏龐龑龒龔龖龗龞龡龢龣龥"] ] {"uChars":[128,165,169,178,184,216,226,235,238,244,248,251,253,258,276,284,300,325,329,334,364,463,465,467,469,471,473,475,477,506,594,610,712,716,730,930,938,962,970,1026,1104,1106,8209,8215,8218,8222,8231,8241,8244,8246,8252,8365,8452,8454,8458,8471,8482,8556,8570,8596,8602,8713,8720,8722,8726,8731,8737,8740,8742,8748,8751,8760,8766,8777,8781,8787,8802,8808,8816,8854,8858,8870,8896,8979,9322,9372,9548,9588,9616,9622,9634,9652,9662,9672,9676,9680,9702,9735,9738,9793,9795,11906,11909,11913,11917,11928,11944,11947,11951,11956,11960,11964,11979,12284,12292,12312,12319,12330,12351,12436,12447,12535,12543,12586,12842,12850,12964,13200,13215,13218,13253,13263,13267,13270,13384,13428,13727,13839,13851,14617,14703,14801,14816,14964,15183,15471,15585,16471,16736,17208,17325,17330,17374,17623,17997,18018,18212,18218,18301,18318,18760,18811,18814,18820,18823,18844,18848,18872,19576,19620,19738,19887,40870,59244,59336,59367,59413,59417,59423,59431,59437,59443,59452,59460,59478,59493,63789,63866,63894,63976,63986,64016,64018,64021,64025,64034,64037,64042,65074,65093,65107,65112,65127,65132,65375,65510,65536],"gbChars":[0,36,38,45,50,81,89,95,96,100,103,104,105,109,126,133,148,172,175,179,208,306,307,308,309,310,311,312,313,341,428,443,544,545,558,741,742,749,750,805,819,820,7922,7924,7925,7927,7934,7943,7944,7945,7950,8062,8148,8149,8152,8164,8174,8236,8240,8262,8264,8374,8380,8381,8384,8388,8390,8392,8393,8394,8396,8401,8406,8416,8419,8424,8437,8439,8445,8482,8485,8496,8521,8603,8936,8946,9046,9050,9063,9066,9076,9092,9100,9108,9111,9113,9131,9162,9164,9218,9219,11329,11331,11334,11336,11346,11361,11363,11366,11370,11372,11375,11389,11682,11686,11687,11692,11694,11714,11716,11723,11725,11730,11736,11982,11989,12102,12336,12348,12350,12384,12393,12395,12397,12510,12553,12851,12962,12973,13738,13823,13919,13933,14080,14298,14585,14698,15583,15847,16318,16434,16438,16481,16729,17102,17122,17315,17320,17402,17418,17859,17909,17911,17915,17916,17936,17939,17961,18664,18703,18814,18962,19043,33469,33470,33471,33484,33485,33490,33497,33501,33505,33513,33520,33536,33550,37845,37921,37948,38029,38038,38064,38065,38066,38069,38075,38076,38078,39108,39109,39113,39114,39115,39116,39265,39394,189000]}[ ["a140","",62], ["a180","",32], ["a240","",62], ["a280","",32], ["a2ab","",5], ["a2e3","€"], ["a2ef",""], ["a2fd",""], ["a340","",62], ["a380","",31," "], ["a440","",62], ["a480","",32], ["a4f4","",10], ["a540","",62], ["a580","",32], ["a5f7","",7], ["a640","",62], ["a680","",32], ["a6b9","",7], ["a6d9","",6], ["a6ec",""], ["a6f3",""], ["a6f6","",8], ["a740","",62], ["a780","",32], ["a7c2","",14], ["a7f2","",12], ["a896","",10], ["a8bc",""], ["a8bf","ǹ"], ["a8c1",""], ["a8ea","",20], ["a958",""], ["a95b",""], ["a95d",""], ["a989","〾⿰",11], ["a997","",12], ["a9f0","",14], ["aaa1","",93], ["aba1","",93], ["aca1","",93], ["ada1","",93], ["aea1","",93], ["afa1","",93], ["d7fa","",4], ["f8a1","",93], ["f9a1","",93], ["faa1","",93], ["fba1","",93], ["fca1","",93], ["fda1","",93], ["fe50","⺁⺄㑳㑇⺈⺋㖞㘚㘎⺌⺗㥮㤘㧏㧟㩳㧐㭎㱮㳠⺧⺪䁖䅟⺮䌷⺳⺶⺷䎱䎬⺻䏝䓖䙡䙌"], ["fe80","䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶䲣䲟䲠䲡䱷䲢䴓",6,"䶮",93] ] [ ["0","\u0000",128], ["a1","。",62], ["8140"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×"], ["8180","÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇◆□■△▲▽▼※〒→←↑↓〓"], ["81b8","∈∋⊆⊇⊂⊃∪∩"], ["81c8","∧∨¬⇒⇔∀∃"], ["81da","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"], ["81f0","ʼn♯♭♪†‡¶"], ["81fc","◯"], ["824f","0",9], ["8260","A",25], ["8281","a",25], ["829f","ぁ",82], ["8340","ァ",62], ["8380","ム",22], ["839f","Α",16,"Σ",6], ["83bf","α",16,"σ",6], ["8440","А",5,"ЁЖ",25], ["8470","а",5,"ёж",7], ["8480","о",17], ["849f","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"], ["8740","①",19,"Ⅰ",9], ["875f","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"], ["877e","㍻"], ["8780","〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"], ["889f","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"], ["8940","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円"], ["8980","園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"], ["8a40","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫"], ["8a80","橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"], ["8b40","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救"], ["8b80","朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"], ["8c40","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨"], ["8c80","劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"], ["8d40","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降"], ["8d80","項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"], ["8e40","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止"], ["8e80","死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"], ["8f40","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳"], ["8f80","準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"], ["9040","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨"], ["9080","逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"], ["9140","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻"], ["9180","操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"], ["9240","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄"], ["9280","逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"], ["9340","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬"], ["9380","凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"], ["9440","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅"], ["9480","楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"], ["9540","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷"], ["9580","斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"], ["9640","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆"], ["9680","摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"], ["9740","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲"], ["9780","沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"], ["9840","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"], ["989f","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"], ["9940","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭"], ["9980","凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"], ["9a40","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸"], ["9a80","噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"], ["9b40","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀"], ["9b80","它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"], ["9c40","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠"], ["9c80","怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"], ["9d40","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫"], ["9d80","捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"], ["9e40","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎"], ["9e80","梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"], ["9f40","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯"], ["9f80","麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"], ["e040","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝"], ["e080","烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"], ["e140","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿"], ["e180","痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"], ["e240","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰"], ["e280","窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"], ["e340","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷"], ["e380","縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"], ["e440","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤"], ["e480","艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"], ["e540","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬"], ["e580","蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"], ["e640","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧"], ["e680","諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"], ["e740","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜"], ["e780","轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"], ["e840","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙"], ["e880","閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"], ["e940","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃"], ["e980","騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"], ["ea40","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯"], ["ea80","黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠堯槇遙瑤凜熙"], ["ed40","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏"], ["ed80","塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"], ["ee40","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙"], ["ee80","蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"], ["eeef","ⅰ",9,"¬¦'""], ["f040","",62], ["f080","",124], ["f140","",62], ["f180","",124], ["f240","",62], ["f280","",124], ["f340","",62], ["f380","",124], ["f440","",62], ["f480","",124], ["f540","",62], ["f580","",124], ["f640","",62], ["f680","",124], ["f740","",62], ["f780","",124], ["f840","",62], ["f880","",124], ["f940",""], ["fa40","ⅰ",9,"Ⅰ",9,"¬¦'"㈱№℡∵纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊"], ["fa80","兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯"], ["fb40","涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神"], ["fb80","祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙"], ["fc40","髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"] ] { "name" : "isarray", "description" : "Array#isArray for older browsers", "version" : "0.0.1", "repository" : "juliangruber/isarray", "homepage": "https://github.com/juliangruber/isarray", "main" : "index.js", "scripts" : [ "index.js" ], "dependencies" : {}, "keywords": ["browser","isarray","array"], "author": { "name": "Julian Gruber", "email": "mail@juliangruber.com", "url": "http://juliangruber.com" }, "license": "MIT" } var toString = {}.toString; module.exports = Array.isArray || function (arr) { return toString.call(arr) == '[object Array]'; }; test: @node_modules/.bin/tape test.js .PHONY: test { "name": "isarray", "description": "Array#isArray for older browsers", "version": "1.0.0", "repository": { "type": "git", "url": "git://github.com/juliangruber/isarray.git" }, "homepage": "https://github.com/juliangruber/isarray", "main": "index.js", "dependencies": {}, "devDependencies": { "tape": "~2.13.4" }, "keywords": [ "browser", "isarray", "array" ], "author": { "name": "Julian Gruber", "email": "mail@juliangruber.com", "url": "http://juliangruber.com" }, "license": "MIT", "testling": { "files": "test.js", "browsers": [ "ie/8..latest", "firefox/17..latest", "firefox/nightly", "chrome/22..latest", "chrome/canary", "opera/12..latest", "opera/next", "safari/5.1..latest", "ipad/6.0..latest", "iphone/6.0..latest", "android-browser/4.2..latest" ] }, "scripts": { "test": "tape test.js" } } var isArray = require('./'); var test = require('tape'); test('is array', function(t){ t.ok(isArray([])); t.notOk(isArray({})); t.notOk(isArray(null)); t.notOk(isArray(false)); var obj = {}; obj[0] = true; t.notOk(isArray(obj)); var arr = []; arr.foo = 'bar'; t.ok(isArray(arr)); t.end(); }); 'use strict'; if (typeof process === 'undefined' || !process.version || process.version.indexOf('v0.') === 0 || process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { module.exports = { nextTick: nextTick }; } else { module.exports = process } function nextTick(fn, arg1, arg2, arg3) { if (typeof fn !== 'function') { throw new TypeError('"callback" argument must be a function'); } var len = arguments.length; var args, i; switch (len) { case 0: case 1: return process.nextTick(fn); case 2: return process.nextTick(function afterTickOne() { fn.call(null, arg1); }); case 3: return process.nextTick(function afterTickTwo() { fn.call(null, arg1, arg2); }); case 4: return process.nextTick(function afterTickThree() { fn.call(null, arg1, arg2, arg3); }); default: args = new Array(len - 1); i = 0; while (i < args.length) { args[i++] = arguments[i]; } return process.nextTick(function afterTick() { fn.apply(null, args); }); } } # Copyright (c) 2015 Calvin Metcalf Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. **THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.** { "name": "process-nextick-args", "version": "2.0.1", "description": "process.nextTick but always with args", "main": "index.js", "files": [ "index.js" ], "scripts": { "test": "node test.js" }, "repository": { "type": "git", "url": "https://github.com/calvinmetcalf/process-nextick-args.git" }, "author": "", "license": "MIT", "bugs": { "url": "https://github.com/calvinmetcalf/process-nextick-args/issues" }, "homepage": "https://github.com/calvinmetcalf/process-nextick-args", "devDependencies": { "tap": "~0.2.6" } } 'use strict' var MurmurHash3 = require('imurmurhash') module.exports = function (uniq) { if (uniq) { var hash = new MurmurHash3(uniq) return ('00000000' + hash.result().toString(16)).substr(-8) } else { return (Math.random().toString(16) + '0000000').substr(2, 8) } } The ISC License Copyright npm, Inc Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. { "name": "unique-slug", "version": "2.0.2", "description": "Generate a unique character string suitible for use in files and URLs.", "main": "index.js", "scripts": { "test": "standard && tap --coverage test" }, "keywords": [], "author": "Rebecca Turner (http://re-becca.org)", "license": "ISC", "devDependencies": { "standard": "^12.0.1", "tap": "^12.7.0" }, "repository": { "type": "git", "url": "git://github.com/iarna/unique-slug.git" }, "dependencies": { "imurmurhash": "^0.1.4" } } (function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?this:self:global:window,b.base64js=a()}})(function(){return function(){function b(d,e,g){function a(j,i){if(!e[j]){if(!d[j]){var f="function"==typeof require&&require;if(!i&&f)return f(j,!0);if(h)return h(j,!0);var c=new Error("Cannot find module '"+j+"'");throw c.code="MODULE_NOT_FOUND",c}var k=e[j]={exports:{}};d[j][0].call(k.exports,function(b){var c=d[j][1][b];return a(c||b)},k,k.exports,b,d,e,g)}return e[j].exports}for(var h="function"==typeof require&&require,c=0;c>16,j[k++]=255&b>>8,j[k++]=255&b;return 2===h&&(b=l[a.charCodeAt(c)]<<2|l[a.charCodeAt(c+1)]>>4,j[k++]=255&b),1===h&&(b=l[a.charCodeAt(c)]<<10|l[a.charCodeAt(c+1)]<<4|l[a.charCodeAt(c+2)]>>2,j[k++]=255&b>>8,j[k++]=255&b),j}function g(a){return k[63&a>>18]+k[63&a>>12]+k[63&a>>6]+k[63&a]}function h(a,b,c){for(var d,e=[],f=b;fj?j:g+f));return 1===d?(b=a[c-1],e.push(k[b>>2]+k[63&b<<4]+"==")):2===d&&(b=(a[c-2]<<8)+a[c-1],e.push(k[b>>10]+k[63&b>>4]+k[63&b<<2]+"=")),e.join("")}c.byteLength=function(a){var b=d(a),c=b[0],e=b[1];return 3*(c+e)/4-e},c.toByteArray=f,c.fromByteArray=j;for(var k=[],l=[],m="undefined"==typeof Uint8Array?Array:Uint8Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,p=n.length;o 0) { throw new Error('Invalid string. Length must be a multiple of 4') } // Trim off extra bytes after placeholder bytes are found // See: https://github.com/beatgammit/base64-js/issues/42 var validLen = b64.indexOf('=') if (validLen === -1) validLen = len var placeHoldersLen = validLen === len ? 0 : 4 - (validLen % 4) return [validLen, placeHoldersLen] } // base64 is 4/3 + up to two characters of the original data function byteLength (b64) { var lens = getLens(b64) var validLen = lens[0] var placeHoldersLen = lens[1] return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen } function _byteLength (b64, validLen, placeHoldersLen) { return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen } function toByteArray (b64) { var tmp var lens = getLens(b64) var validLen = lens[0] var placeHoldersLen = lens[1] var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)) var curByte = 0 // if there are placeholders, only get up to the last complete 4 chars var len = placeHoldersLen > 0 ? validLen - 4 : validLen var i for (i = 0; i < len; i += 4) { tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)] arr[curByte++] = (tmp >> 16) & 0xFF arr[curByte++] = (tmp >> 8) & 0xFF arr[curByte++] = tmp & 0xFF } if (placeHoldersLen === 2) { tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4) arr[curByte++] = tmp & 0xFF } if (placeHoldersLen === 1) { tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2) arr[curByte++] = (tmp >> 8) & 0xFF arr[curByte++] = tmp & 0xFF } return arr } function tripletToBase64 (num) { return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F] } function encodeChunk (uint8, start, end) { var tmp var output = [] for (var i = start; i < end; i += 3) { tmp = ((uint8[i] << 16) & 0xFF0000) + ((uint8[i + 1] << 8) & 0xFF00) + (uint8[i + 2] & 0xFF) output.push(tripletToBase64(tmp)) } return output.join('') } function fromByteArray (uint8) { var tmp var len = uint8.length var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes var parts = [] var maxChunkLength = 16383 // must be multiple of 3 // go through the array every three bytes, we'll deal with trailing stuff later for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))) } // pad the end with zeros, but make sure to not forget the extra bytes if (extraBytes === 1) { tmp = uint8[len - 1] parts.push( lookup[tmp >> 2] + lookup[(tmp << 4) & 0x3F] + '==' ) } else if (extraBytes === 2) { tmp = (uint8[len - 2] << 8) + uint8[len - 1] parts.push( lookup[tmp >> 10] + lookup[(tmp >> 4) & 0x3F] + lookup[(tmp << 2) & 0x3F] + '=' ) } return parts.join('') } The MIT License (MIT) Copyright (c) 2014 Jameson Little Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "base64-js", "description": "Base64 encoding/decoding in pure JS", "version": "1.5.1", "author": "T. Jameson Little ", "typings": "index.d.ts", "bugs": { "url": "https://github.com/beatgammit/base64-js/issues" }, "devDependencies": { "babel-minify": "^0.5.1", "benchmark": "^2.1.4", "browserify": "^16.3.0", "standard": "*", "tape": "4.x" }, "homepage": "https://github.com/beatgammit/base64-js", "keywords": [ "base64" ], "license": "MIT", "main": "index.js", "repository": { "type": "git", "url": "git://github.com/beatgammit/base64-js.git" }, "scripts": { "build": "browserify -s base64js -r ./ | minify > base64js.min.js", "lint": "standard", "test": "npm run lint && npm run unit", "unit": "tape test/*.js" }, "funding": [ { "type": "github", "url": "https://github.com/sponsors/feross" }, { "type": "patreon", "url": "https://www.patreon.com/feross" }, { "type": "consulting", "url": "https://feross.org/support" } ] } 'use strict'; const os = require('os'); const extractPathRegex = /\s+at.*(?:\(|\s)(.*)\)?/; const pathRegex = /^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/; const homeDir = typeof os.homedir === 'undefined' ? '' : os.homedir(); module.exports = (stack, options) => { options = Object.assign({pretty: false}, options); return stack.replace(/\\/g, '/') .split('\n') .filter(line => { const pathMatches = line.match(extractPathRegex); if (pathMatches === null || !pathMatches[1]) { return true; } const match = pathMatches[1]; // Electron if ( match.includes('.app/Contents/Resources/electron.asar') || match.includes('.app/Contents/Resources/default_app.asar') ) { return false; } return !pathRegex.test(match); }) .filter(line => line.trim() !== '') .map(line => { if (options.pretty) { return line.replace(extractPathRegex, (m, p1) => m.replace(p1, p1.replace(homeDir, '~'))); } return line; }) .join('\n'); }; MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "clean-stack", "version": "2.2.0", "description": "Clean up error stack traces", "license": "MIT", "repository": "sindresorhus/clean-stack", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=6" }, "scripts": { "test": "xo && ava && tsd" }, "files": [ "index.js", "index.d.ts" ], "keywords": [ "clean", "stack", "trace", "traces", "error", "err", "electron" ], "devDependencies": { "ava": "^1.4.1", "tsd": "^0.7.2", "xo": "^0.24.0" }, "browser": { "os": false } } /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m var eLen = (nBytes * 8) - mLen - 1 var eMax = (1 << eLen) - 1 var eBias = eMax >> 1 var nBits = -7 var i = isLE ? (nBytes - 1) : 0 var d = isLE ? -1 : 1 var s = buffer[offset + i] i += d e = s & ((1 << (-nBits)) - 1) s >>= (-nBits) nBits += eLen for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} m = e & ((1 << (-nBits)) - 1) e >>= (-nBits) nBits += mLen for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} if (e === 0) { e = 1 - eBias } else if (e === eMax) { return m ? NaN : ((s ? -1 : 1) * Infinity) } else { m = m + Math.pow(2, mLen) e = e - eBias } return (s ? -1 : 1) * m * Math.pow(2, e - mLen) } exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { var e, m, c var eLen = (nBytes * 8) - mLen - 1 var eMax = (1 << eLen) - 1 var eBias = eMax >> 1 var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) var i = isLE ? 0 : (nBytes - 1) var d = isLE ? 1 : -1 var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 value = Math.abs(value) if (isNaN(value) || value === Infinity) { m = isNaN(value) ? 1 : 0 e = eMax } else { e = Math.floor(Math.log(value) / Math.LN2) if (value * (c = Math.pow(2, -e)) < 1) { e-- c *= 2 } if (e + eBias >= 1) { value += rt / c } else { value += rt * Math.pow(2, 1 - eBias) } if (value * c >= 2) { e++ c /= 2 } if (e + eBias >= eMax) { m = 0 e = eMax } else if (e + eBias >= 1) { m = ((value * c) - 1) * Math.pow(2, mLen) e = e + eBias } else { m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) e = 0 } } for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} e = (e << mLen) | m eLen += mLen for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} buffer[offset + i - d] |= s * 128 } Copyright 2008 Fair Oaks Labs, Inc. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. { "name": "ieee754", "description": "Read/write IEEE754 floating point numbers from/to a Buffer or array-like object", "version": "1.2.1", "author": { "name": "Feross Aboukhadijeh", "email": "feross@feross.org", "url": "https://feross.org" }, "contributors": [ "Romain Beauxis " ], "devDependencies": { "airtap": "^3.0.0", "standard": "*", "tape": "^5.0.1" }, "keywords": [ "IEEE 754", "buffer", "convert", "floating point", "ieee754" ], "license": "BSD-3-Clause", "main": "index.js", "types": "index.d.ts", "repository": { "type": "git", "url": "git://github.com/feross/ieee754.git" }, "scripts": { "test": "standard && npm run test-node && npm run test-browser", "test-browser": "airtap -- test/*.js", "test-browser-local": "airtap --local -- test/*.js", "test-node": "tape test/*.js" }, "funding": [ { "type": "github", "url": "https://github.com/sponsors/feross" }, { "type": "patreon", "url": "https://www.patreon.com/feross" }, { "type": "consulting", "url": "https://feross.org/support" } ] } /** * @preserve * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013) * * @author Jens Taylor * @see http://github.com/homebrewing/brauhaus-diff * @author Gary Court * @see http://github.com/garycourt/murmurhash-js * @author Austin Appleby * @see http://sites.google.com/site/murmurhash/ */ (function(){ var cache; // Call this function without `new` to use the cached object (good for // single-threaded environments), or with `new` to create a new object. // // @param {string} key A UTF-16 or ASCII string // @param {number} seed An optional positive integer // @return {object} A MurmurHash3 object for incremental hashing function MurmurHash3(key, seed) { var m = this instanceof MurmurHash3 ? this : cache; m.reset(seed) if (typeof key === 'string' && key.length > 0) { m.hash(key); } if (m !== this) { return m; } }; // Incrementally add a string to this hash // // @param {string} key A UTF-16 or ASCII string // @return {object} this MurmurHash3.prototype.hash = function(key) { var h1, k1, i, top, len; len = key.length; this.len += len; k1 = this.k1; i = 0; switch (this.rem) { case 0: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) : 0; case 1: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 8 : 0; case 2: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 16 : 0; case 3: k1 ^= len > i ? (key.charCodeAt(i) & 0xff) << 24 : 0; k1 ^= len > i ? (key.charCodeAt(i++) & 0xff00) >> 8 : 0; } this.rem = (len + this.rem) & 3; // & 3 is same as % 4 len -= this.rem; if (len > 0) { h1 = this.h1; while (1) { k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff; k1 = (k1 << 15) | (k1 >>> 17); k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff; h1 ^= k1; h1 = (h1 << 13) | (h1 >>> 19); h1 = (h1 * 5 + 0xe6546b64) & 0xffffffff; if (i >= len) { break; } k1 = ((key.charCodeAt(i++) & 0xffff)) ^ ((key.charCodeAt(i++) & 0xffff) << 8) ^ ((key.charCodeAt(i++) & 0xffff) << 16); top = key.charCodeAt(i++); k1 ^= ((top & 0xff) << 24) ^ ((top & 0xff00) >> 8); } k1 = 0; switch (this.rem) { case 3: k1 ^= (key.charCodeAt(i + 2) & 0xffff) << 16; case 2: k1 ^= (key.charCodeAt(i + 1) & 0xffff) << 8; case 1: k1 ^= (key.charCodeAt(i) & 0xffff); } this.h1 = h1; } this.k1 = k1; return this; }; // Get the result of this hash // // @return {number} The 32-bit hash MurmurHash3.prototype.result = function() { var k1, h1; k1 = this.k1; h1 = this.h1; if (k1 > 0) { k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff; k1 = (k1 << 15) | (k1 >>> 17); k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff; h1 ^= k1; } h1 ^= this.len; h1 ^= h1 >>> 16; h1 = (h1 * 0xca6b + (h1 & 0xffff) * 0x85eb0000) & 0xffffffff; h1 ^= h1 >>> 13; h1 = (h1 * 0xae35 + (h1 & 0xffff) * 0xc2b20000) & 0xffffffff; h1 ^= h1 >>> 16; return h1 >>> 0; }; // Reset the hash object for reuse // // @param {number} seed An optional positive integer MurmurHash3.prototype.reset = function(seed) { this.h1 = typeof seed === 'number' ? seed : 0; this.rem = this.k1 = this.len = 0; return this; }; // A cached object to use. This can be safely used if you're in a single- // threaded environment, otherwise you need to create new hashes to use. cache = new MurmurHash3(); if (typeof(module) != 'undefined') { module.exports = MurmurHash3; } else { this.MurmurHash3 = MurmurHash3; } }()); /** * @preserve * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013) * * @author Jens Taylor * @see http://github.com/homebrewing/brauhaus-diff * @author Gary Court * @see http://github.com/garycourt/murmurhash-js * @author Austin Appleby * @see http://sites.google.com/site/murmurhash/ */ !function(){function t(h,r){var s=this instanceof t?this:e;return s.reset(r),"string"==typeof h&&h.length>0&&s.hash(h),s!==this?s:void 0}var e;t.prototype.hash=function(t){var e,h,r,s,i;switch(i=t.length,this.len+=i,h=this.k1,r=0,this.rem){case 0:h^=i>r?65535&t.charCodeAt(r++):0;case 1:h^=i>r?(65535&t.charCodeAt(r++))<<8:0;case 2:h^=i>r?(65535&t.charCodeAt(r++))<<16:0;case 3:h^=i>r?(255&t.charCodeAt(r))<<24:0,h^=i>r?(65280&t.charCodeAt(r++))>>8:0}if(this.rem=3&i+this.rem,i-=this.rem,i>0){for(e=this.h1;;){if(h=4294967295&11601*h+3432906752*(65535&h),h=h<<15|h>>>17,h=4294967295&13715*h+461832192*(65535&h),e^=h,e=e<<13|e>>>19,e=4294967295&5*e+3864292196,r>=i)break;h=65535&t.charCodeAt(r++)^(65535&t.charCodeAt(r++))<<8^(65535&t.charCodeAt(r++))<<16,s=t.charCodeAt(r++),h^=(255&s)<<24^(65280&s)>>8}switch(h=0,this.rem){case 3:h^=(65535&t.charCodeAt(r+2))<<16;case 2:h^=(65535&t.charCodeAt(r+1))<<8;case 1:h^=65535&t.charCodeAt(r)}this.h1=e}return this.k1=h,this},t.prototype.result=function(){var t,e;return t=this.k1,e=this.h1,t>0&&(t=4294967295&11601*t+3432906752*(65535&t),t=t<<15|t>>>17,t=4294967295&13715*t+461832192*(65535&t),e^=t),e^=this.len,e^=e>>>16,e=4294967295&51819*e+2246770688*(65535&e),e^=e>>>13,e=4294967295&44597*e+3266445312*(65535&e),e^=e>>>16,e>>>0},t.prototype.reset=function(t){return this.h1="number"==typeof t?t:0,this.rem=this.k1=this.len=0,this},e=new t,"undefined"!=typeof module?module.exports=t:this.MurmurHash3=t}();{ "name": "imurmurhash", "version": "0.1.4", "description": "An incremental implementation of MurmurHash3", "homepage": "https://github.com/jensyt/imurmurhash-js", "main": "imurmurhash.js", "files": [ "imurmurhash.js", "imurmurhash.min.js", "package.json", "README.md" ], "repository": { "type": "git", "url": "https://github.com/jensyt/imurmurhash-js" }, "bugs": { "url": "https://github.com/jensyt/imurmurhash-js/issues" }, "keywords": [ "murmur", "murmurhash", "murmurhash3", "hash", "incremental" ], "author": { "name": "Jens Taylor", "email": "jensyt@gmail.com", "url": "https://github.com/homebrewing" }, "license": "MIT", "dependencies": { }, "devDependencies": { }, "engines": { "node": ">=0.8.19" } } 'use strict'; module.exports = (string, count = 1, options) => { options = { indent: ' ', includeEmptyLines: false, ...options }; if (typeof string !== 'string') { throw new TypeError( `Expected \`input\` to be a \`string\`, got \`${typeof string}\`` ); } if (typeof count !== 'number') { throw new TypeError( `Expected \`count\` to be a \`number\`, got \`${typeof count}\`` ); } if (typeof options.indent !== 'string') { throw new TypeError( `Expected \`options.indent\` to be a \`string\`, got \`${typeof options.indent}\`` ); } if (count === 0) { return string; } const regex = options.includeEmptyLines ? /^/gm : /^(?!\s*$)/gm; return string.replace(regex, options.indent.repeat(count)); }; MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "indent-string", "version": "4.0.0", "description": "Indent each line in a string", "license": "MIT", "repository": "sindresorhus/indent-string", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=8" }, "scripts": { "test": "xo && ava && tsd" }, "files": [ "index.js", "index.d.ts" ], "keywords": [ "indent", "string", "pad", "align", "line", "text", "each", "every" ], "devDependencies": { "ava": "^1.4.1", "tsd": "^0.7.2", "xo": "^0.24.0" } } 'use strict'; module.exports = Number.isNaN || function (x) { return x !== x; }; The MIT License (MIT) Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "number-is-nan", "version": "1.0.1", "description": "ES2015 Number.isNaN() ponyfill", "license": "MIT", "repository": "sindresorhus/number-is-nan", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=0.10.0" }, "scripts": { "test": "ava" }, "files": [ "index.js" ], "keywords": [ "es2015", "ecmascript", "ponyfill", "polyfill", "shim", "number", "is", "nan", "not" ], "devDependencies": { "ava": "*" } } /* eslint-disable node/no-deprecated-api */ 'use strict' var buffer = require('buffer') var Buffer = buffer.Buffer var safer = require('./safer.js') var Safer = safer.Buffer var dangerous = {} var key for (key in safer) { if (!safer.hasOwnProperty(key)) continue dangerous[key] = safer[key] } var Dangereous = dangerous.Buffer = {} // Copy Safer API for (key in Safer) { if (!Safer.hasOwnProperty(key)) continue Dangereous[key] = Safer[key] } // Copy those missing unsafe methods, if they are present for (key in Buffer) { if (!Buffer.hasOwnProperty(key)) continue if (Dangereous.hasOwnProperty(key)) continue Dangereous[key] = Buffer[key] } if (!Dangereous.allocUnsafe) { Dangereous.allocUnsafe = function (size) { if (typeof size !== 'number') { throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) } if (size < 0 || size >= 2 * (1 << 30)) { throw new RangeError('The value "' + size + '" is invalid for option "size"') } return Buffer(size) } } if (!Dangereous.allocUnsafeSlow) { Dangereous.allocUnsafeSlow = function (size) { if (typeof size !== 'number') { throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) } if (size < 0 || size >= 2 * (1 << 30)) { throw new RangeError('The value "' + size + '" is invalid for option "size"') } return buffer.SlowBuffer(size) } } module.exports = dangerous MIT License Copyright (c) 2018 Nikita Skovoroda Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "safer-buffer", "version": "2.1.2", "description": "Modern Buffer API polyfill without footguns", "main": "safer.js", "scripts": { "browserify-test": "browserify --external tape tests.js > browserify-tests.js && tape browserify-tests.js", "test": "standard && tape tests.js" }, "author": { "name": "Nikita Skovoroda", "email": "chalkerx@gmail.com", "url": "https://github.com/ChALkeR" }, "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/ChALkeR/safer-buffer.git" }, "bugs": { "url": "https://github.com/ChALkeR/safer-buffer/issues" }, "devDependencies": { "standard": "^11.0.1", "tape": "^4.9.0" }, "files": [ "Porting-Buffer.md", "Readme.md", "tests.js", "dangerous.js", "safer.js" ] } # Porting to the Buffer.from/Buffer.alloc API ## Overview - [Variant 1: Drop support for Node.js ≤ 4.4.x and 5.0.0 — 5.9.x.](#variant-1) (*recommended*) - [Variant 2: Use a polyfill](#variant-2) - [Variant 3: manual detection, with safeguards](#variant-3) ### Finding problematic bits of code using grep Just run `grep -nrE '[^a-zA-Z](Slow)?Buffer\s*\(' --exclude-dir node_modules`. It will find all the potentially unsafe places in your own code (with some considerably unlikely exceptions). ### Finding problematic bits of code using Node.js 8 If you’re using Node.js ≥ 8.0.0 (which is recommended), Node.js exposes multiple options that help with finding the relevant pieces of code: - `--trace-warnings` will make Node.js show a stack trace for this warning and other warnings that are printed by Node.js. - `--trace-deprecation` does the same thing, but only for deprecation warnings. - `--pending-deprecation` will show more types of deprecation warnings. In particular, it will show the `Buffer()` deprecation warning, even on Node.js 8. You can set these flags using an environment variable: ```console $ export NODE_OPTIONS='--trace-warnings --pending-deprecation' $ cat example.js 'use strict'; const foo = new Buffer('foo'); $ node example.js (node:7147) [DEP0005] DeprecationWarning: The Buffer() and new Buffer() constructors are not recommended for use due to security and usability concerns. Please use the new Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() construction methods instead. at showFlaggedDeprecation (buffer.js:127:13) at new Buffer (buffer.js:148:3) at Object. (/path/to/example.js:2:13) [... more stack trace lines ...] ``` ### Finding problematic bits of code using linters Eslint rules [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor) or [node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md) also find calls to deprecated `Buffer()` API. Those rules are included in some pre-sets. There is a drawback, though, that it doesn't always [work correctly](https://github.com/chalker/safer-buffer#why-not-safe-buffer) when `Buffer` is overriden e.g. with a polyfill, so recommended is a combination of this and some other method described above. ## Variant 1: Drop support for Node.js ≤ 4.4.x and 5.0.0 — 5.9.x. This is the recommended solution nowadays that would imply only minimal overhead. The Node.js 5.x release line has been unsupported since July 2016, and the Node.js 4.x release line reaches its End of Life in April 2018 (→ [Schedule](https://github.com/nodejs/Release#release-schedule)). This means that these versions of Node.js will *not* receive any updates, even in case of security issues, so using these release lines should be avoided, if at all possible. What you would do in this case is to convert all `new Buffer()` or `Buffer()` calls to use `Buffer.alloc()` or `Buffer.from()`, in the following way: - For `new Buffer(number)`, replace it with `Buffer.alloc(number)`. - For `new Buffer(string)` (or `new Buffer(string, encoding)`), replace it with `Buffer.from(string)` (or `Buffer.from(string, encoding)`). - For all other combinations of arguments (these are much rarer), also replace `new Buffer(...arguments)` with `Buffer.from(...arguments)`. Note that `Buffer.alloc()` is also _faster_ on the current Node.js versions than `new Buffer(size).fill(0)`, which is what you would otherwise need to ensure zero-filling. Enabling eslint rule [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor) or [node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md) is recommended to avoid accidential unsafe Buffer API usage. There is also a [JSCodeshift codemod](https://github.com/joyeecheung/node-dep-codemod#dep005) for automatically migrating Buffer constructors to `Buffer.alloc()` or `Buffer.from()`. Note that it currently only works with cases where the arguments are literals or where the constructor is invoked with two arguments. _If you currently support those older Node.js versions and dropping them would be a semver-major change for you, or if you support older branches of your packages, consider using [Variant 2](#variant-2) or [Variant 3](#variant-3) on older branches, so people using those older branches will also receive the fix. That way, you will eradicate potential issues caused by unguarded Buffer API usage and your users will not observe a runtime deprecation warning when running your code on Node.js 10._ ## Variant 2: Use a polyfill Utilize [safer-buffer](https://www.npmjs.com/package/safer-buffer) as a polyfill to support older Node.js versions. You would take exacly the same steps as in [Variant 1](#variant-1), but with a polyfill `const Buffer = require('safer-buffer').Buffer` in all files where you use the new `Buffer` api. Make sure that you do not use old `new Buffer` API — in any files where the line above is added, using old `new Buffer()` API will _throw_. It will be easy to notice that in CI, though. Alternatively, you could use [buffer-from](https://www.npmjs.com/package/buffer-from) and/or [buffer-alloc](https://www.npmjs.com/package/buffer-alloc) [ponyfills](https://ponyfill.com/) — those are great, the only downsides being 4 deps in the tree and slightly more code changes to migrate off them (as you would be using e.g. `Buffer.from` under a different name). If you need only `Buffer.from` polyfilled — `buffer-from` alone which comes with no extra dependencies. _Alternatively, you could use [safe-buffer](https://www.npmjs.com/package/safe-buffer) — it also provides a polyfill, but takes a different approach which has [it's drawbacks](https://github.com/chalker/safer-buffer#why-not-safe-buffer). It will allow you to also use the older `new Buffer()` API in your code, though — but that's arguably a benefit, as it is problematic, can cause issues in your code, and will start emitting runtime deprecation warnings starting with Node.js 10._ Note that in either case, it is important that you also remove all calls to the old Buffer API manually — just throwing in `safe-buffer` doesn't fix the problem by itself, it just provides a polyfill for the new API. I have seen people doing that mistake. Enabling eslint rule [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor) or [node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md) is recommended. _Don't forget to drop the polyfill usage once you drop support for Node.js < 4.5.0._ ## Variant 3 — manual detection, with safeguards This is useful if you create Buffer instances in only a few places (e.g. one), or you have your own wrapper around them. ### Buffer(0) This special case for creating empty buffers can be safely replaced with `Buffer.concat([])`, which returns the same result all the way down to Node.js 0.8.x. ### Buffer(notNumber) Before: ```js var buf = new Buffer(notNumber, encoding); ``` After: ```js var buf; if (Buffer.from && Buffer.from !== Uint8Array.from) { buf = Buffer.from(notNumber, encoding); } else { if (typeof notNumber === 'number') throw new Error('The "size" argument must be of type number.'); buf = new Buffer(notNumber, encoding); } ``` `encoding` is optional. Note that the `typeof notNumber` before `new Buffer` is required (for cases when `notNumber` argument is not hard-coded) and _is not caused by the deprecation of Buffer constructor_ — it's exactly _why_ the Buffer constructor is deprecated. Ecosystem packages lacking this type-check caused numereous security issues — situations when unsanitized user input could end up in the `Buffer(arg)` create problems ranging from DoS to leaking sensitive information to the attacker from the process memory. When `notNumber` argument is hardcoded (e.g. literal `"abc"` or `[0,1,2]`), the `typeof` check can be omitted. Also note that using TypeScript does not fix this problem for you — when libs written in `TypeScript` are used from JS, or when user input ends up there — it behaves exactly as pure JS, as all type checks are translation-time only and are not present in the actual JS code which TS compiles to. ### Buffer(number) For Node.js 0.10.x (and below) support: ```js var buf; if (Buffer.alloc) { buf = Buffer.alloc(number); } else { buf = new Buffer(number); buf.fill(0); } ``` Otherwise (Node.js ≥ 0.12.x): ```js const buf = Buffer.alloc ? Buffer.alloc(number) : new Buffer(number).fill(0); ``` ## Regarding Buffer.allocUnsafe Be extra cautious when using `Buffer.allocUnsafe`: * Don't use it if you don't have a good reason to * e.g. you probably won't ever see a performance difference for small buffers, in fact, those might be even faster with `Buffer.alloc()`, * if your code is not in the hot code path — you also probably won't notice a difference, * keep in mind that zero-filling minimizes the potential risks. * If you use it, make sure that you never return the buffer in a partially-filled state, * if you are writing to it sequentially — always truncate it to the actuall written length Errors in handling buffers allocated with `Buffer.allocUnsafe` could result in various issues, ranged from undefined behaviour of your code to sensitive data (user input, passwords, certs) leaking to the remote attacker. _Note that the same applies to `new Buffer` usage without zero-filling, depending on the Node.js version (and lacking type checks also adds DoS to the list of potential problems)._ ## FAQ ### What is wrong with the `Buffer` constructor? The `Buffer` constructor could be used to create a buffer in many different ways: - `new Buffer(42)` creates a `Buffer` of 42 bytes. Before Node.js 8, this buffer contained *arbitrary memory* for performance reasons, which could include anything ranging from program source code to passwords and encryption keys. - `new Buffer('abc')` creates a `Buffer` that contains the UTF-8-encoded version of the string `'abc'`. A second argument could specify another encoding: For example, `new Buffer(string, 'base64')` could be used to convert a Base64 string into the original sequence of bytes that it represents. - There are several other combinations of arguments. This meant that, in code like `var buffer = new Buffer(foo);`, *it is not possible to tell what exactly the contents of the generated buffer are* without knowing the type of `foo`. Sometimes, the value of `foo` comes from an external source. For example, this function could be exposed as a service on a web server, converting a UTF-8 string into its Base64 form: ``` function stringToBase64(req, res) { // The request body should have the format of `{ string: 'foobar' }` const rawBytes = new Buffer(req.body.string) const encoded = rawBytes.toString('base64') res.end({ encoded: encoded }) } ``` Note that this code does *not* validate the type of `req.body.string`: - `req.body.string` is expected to be a string. If this is the case, all goes well. - `req.body.string` is controlled by the client that sends the request. - If `req.body.string` is the *number* `50`, the `rawBytes` would be 50 bytes: - Before Node.js 8, the content would be uninitialized - After Node.js 8, the content would be `50` bytes with the value `0` Because of the missing type check, an attacker could intentionally send a number as part of the request. Using this, they can either: - Read uninitialized memory. This **will** leak passwords, encryption keys and other kinds of sensitive information. (Information leak) - Force the program to allocate a large amount of memory. For example, when specifying `500000000` as the input value, each request will allocate 500MB of memory. This can be used to either exhaust the memory available of a program completely and make it crash, or slow it down significantly. (Denial of Service) Both of these scenarios are considered serious security issues in a real-world web server context. when using `Buffer.from(req.body.string)` instead, passing a number will always throw an exception instead, giving a controlled behaviour that can always be handled by the program. ### The `Buffer()` constructor has been deprecated for a while. Is this really an issue? Surveys of code in the `npm` ecosystem have shown that the `Buffer()` constructor is still widely used. This includes new code, and overall usage of such code has actually been *increasing*. # safer-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![javascript style guide][standard-image]][standard-url] [![Security Responsible Disclosure][secuirty-image]][secuirty-url] [travis-image]: https://travis-ci.org/ChALkeR/safer-buffer.svg?branch=master [travis-url]: https://travis-ci.org/ChALkeR/safer-buffer [npm-image]: https://img.shields.io/npm/v/safer-buffer.svg [npm-url]: https://npmjs.org/package/safer-buffer [standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg [standard-url]: https://standardjs.com [secuirty-image]: https://img.shields.io/badge/Security-Responsible%20Disclosure-green.svg [secuirty-url]: https://github.com/nodejs/security-wg/blob/master/processes/responsible_disclosure_template.md Modern Buffer API polyfill without footguns, working on Node.js from 0.8 to current. ## How to use? First, port all `Buffer()` and `new Buffer()` calls to `Buffer.alloc()` and `Buffer.from()` API. Then, to achieve compatibility with outdated Node.js versions (`<4.5.0` and 5.x `<5.9.0`), use `const Buffer = require('safer-buffer').Buffer` in all files where you make calls to the new Buffer API. _Use `var` instead of `const` if you need that for your Node.js version range support._ Also, see the [porting Buffer](https://github.com/ChALkeR/safer-buffer/blob/master/Porting-Buffer.md) guide. ## Do I need it? Hopefully, not — dropping support for outdated Node.js versions should be fine nowdays, and that is the recommended path forward. You _do_ need to port to the `Buffer.alloc()` and `Buffer.from()` though. See the [porting guide](https://github.com/ChALkeR/safer-buffer/blob/master/Porting-Buffer.md) for a better description. ## Why not [safe-buffer](https://npmjs.com/safe-buffer)? _In short: while `safe-buffer` serves as a polyfill for the new API, it allows old API usage and itself contains footguns._ `safe-buffer` could be used safely to get the new API while still keeping support for older Node.js versions (like this module), but while analyzing ecosystem usage of the old Buffer API I found out that `safe-buffer` is itself causing problems in some cases. For example, consider the following snippet: ```console $ cat example.unsafe.js console.log(Buffer(20)) $ ./node-v6.13.0-linux-x64/bin/node example.unsafe.js $ standard example.unsafe.js standard: Use JavaScript Standard Style (https://standardjs.com) /home/chalker/repo/safer-buffer/example.unsafe.js:2:13: 'Buffer()' was deprecated since v6. Use 'Buffer.alloc()' or 'Buffer.from()' (use 'https://www.npmjs.com/package/safe-buffer' for '<4.5.0') instead. ``` This is allocates and writes to console an uninitialized chunk of memory. [standard](https://www.npmjs.com/package/standard) linter (among others) catch that and warn people to avoid using unsafe API. Let's now throw in `safe-buffer`! ```console $ cat example.safe-buffer.js const Buffer = require('safe-buffer').Buffer console.log(Buffer(20)) $ standard example.safe-buffer.js $ ./node-v6.13.0-linux-x64/bin/node example.safe-buffer.js ``` See the problem? Adding in `safe-buffer` _magically removes the lint warning_, but the behavior remains identiсal to what we had before, and when launched on Node.js 6.x LTS — this dumps out chunks of uninitialized memory. _And this code will still emit runtime warnings on Node.js 10.x and above._ That was done by design. I first considered changing `safe-buffer`, prohibiting old API usage or emitting warnings on it, but that significantly diverges from `safe-buffer` design. After some discussion, it was decided to move my approach into a separate package, and _this is that separate package_. This footgun is not imaginary — I observed top-downloaded packages doing that kind of thing, «fixing» the lint warning by blindly including `safe-buffer` without any actual changes. Also in some cases, even if the API _was_ migrated to use of safe Buffer API — a random pull request can bring unsafe Buffer API usage back to the codebase by adding new calls — and that could go unnoticed even if you have a linter prohibiting that (becase of the reason stated above), and even pass CI. _I also observed that being done in popular packages._ Some examples: * [webdriverio](https://github.com/webdriverio/webdriverio/commit/05cbd3167c12e4930f09ef7cf93b127ba4effae4#diff-124380949022817b90b622871837d56cR31) (a module with 548 759 downloads/month), * [websocket-stream](https://github.com/maxogden/websocket-stream/commit/c9312bd24d08271687d76da0fe3c83493871cf61) (218 288 d/m, fix in [maxogden/websocket-stream#142](https://github.com/maxogden/websocket-stream/pull/142)), * [node-serialport](https://github.com/node-serialport/node-serialport/commit/e8d9d2b16c664224920ce1c895199b1ce2def48c) (113 138 d/m, fix in [node-serialport/node-serialport#1510](https://github.com/node-serialport/node-serialport/pull/1510)), * [karma](https://github.com/karma-runner/karma/commit/3d94b8cf18c695104ca195334dc75ff054c74eec) (3 973 193 d/m, fix in [karma-runner/karma#2947](https://github.com/karma-runner/karma/pull/2947)), * [spdy-transport](https://github.com/spdy-http2/spdy-transport/commit/5375ac33f4a62a4f65bcfc2827447d42a5dbe8b1) (5 970 727 d/m, fix in [spdy-http2/spdy-transport#53](https://github.com/spdy-http2/spdy-transport/pull/53)). * And there are a lot more over the ecosystem. I filed a PR at [mysticatea/eslint-plugin-node#110](https://github.com/mysticatea/eslint-plugin-node/pull/110) to partially fix that (for cases when that lint rule is used), but it is a semver-major change for linter rules and presets, so it would take significant time for that to reach actual setups. _It also hasn't been released yet (2018-03-20)._ Also, `safer-buffer` discourages the usage of `.allocUnsafe()`, which is often done by a mistake. It still supports it with an explicit concern barier, by placing it under `require('safer-buffer/dangereous')`. ## But isn't throwing bad? Not really. It's an error that could be noticed and fixed early, instead of causing havoc later like unguarded `new Buffer()` calls that end up receiving user input can do. This package affects only the files where `var Buffer = require('safer-buffer').Buffer` was done, so it is really simple to keep track of things and make sure that you don't mix old API usage with that. Also, CI should hint anything that you might have missed. New commits, if tested, won't land new usage of unsafe Buffer API this way. _Node.js 10.x also deals with that by printing a runtime depecation warning._ ### Would it affect third-party modules? No, unless you explicitly do an awful thing like monkey-patching or overriding the built-in `Buffer`. Don't do that. ### But I don't want throwing… That is also fine! Also, it could be better in some cases when you don't comprehensive enough test coverage. In that case — just don't override `Buffer` and use `var SaferBuffer = require('safer-buffer').Buffer` instead. That way, everything using `Buffer` natively would still work, but there would be two drawbacks: * `Buffer.from`/`Buffer.alloc` won't be polyfilled — use `SaferBuffer.from` and `SaferBuffer.alloc` instead. * You are still open to accidentally using the insecure deprecated API — use a linter to catch that. Note that using a linter to catch accidential `Buffer` constructor usage in this case is strongly recommended. `Buffer` is not overriden in this usecase, so linters won't get confused. ## «Without footguns»? Well, it is still possible to do _some_ things with `Buffer` API, e.g. accessing `.buffer` property on older versions and duping things from there. You shouldn't do that in your code, probabably. The intention is to remove the most significant footguns that affect lots of packages in the ecosystem, and to do it in the proper way. Also, this package doesn't protect against security issues affecting some Node.js versions, so for usage in your own production code, it is still recommended to update to a Node.js version [supported by upstream](https://github.com/nodejs/release#release-schedule). /* eslint-disable node/no-deprecated-api */ 'use strict' var buffer = require('buffer') var Buffer = buffer.Buffer var safer = {} var key for (key in buffer) { if (!buffer.hasOwnProperty(key)) continue if (key === 'SlowBuffer' || key === 'Buffer') continue safer[key] = buffer[key] } var Safer = safer.Buffer = {} for (key in Buffer) { if (!Buffer.hasOwnProperty(key)) continue if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue Safer[key] = Buffer[key] } safer.Buffer.prototype = Buffer.prototype if (!Safer.from || Safer.from === Uint8Array.from) { Safer.from = function (value, encodingOrOffset, length) { if (typeof value === 'number') { throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value) } if (value && typeof value.length === 'undefined') { throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value) } return Buffer(value, encodingOrOffset, length) } } if (!Safer.alloc) { Safer.alloc = function (size, fill, encoding) { if (typeof size !== 'number') { throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) } if (size < 0 || size >= 2 * (1 << 30)) { throw new RangeError('The value "' + size + '" is invalid for option "size"') } var buf = Buffer(size) if (!fill || fill.length === 0) { buf.fill(0) } else if (typeof encoding === 'string') { buf.fill(fill, encoding) } else { buf.fill(fill) } return buf } } if (!safer.kStringMaxLength) { try { safer.kStringMaxLength = process.binding('buffer').kStringMaxLength } catch (e) { // we can't determine kStringMaxLength in environments where process.binding // is unsupported, so let's not set it } } if (!safer.constants) { safer.constants = { MAX_LENGTH: safer.kMaxLength } if (safer.kStringMaxLength) { safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength } } module.exports = safer /* eslint-disable node/no-deprecated-api */ 'use strict' var test = require('tape') var buffer = require('buffer') var index = require('./') var safer = require('./safer') var dangerous = require('./dangerous') /* Inheritance tests */ test('Default is Safer', function (t) { t.equal(index, safer) t.notEqual(safer, dangerous) t.notEqual(index, dangerous) t.end() }) test('Is not a function', function (t) { [index, safer, dangerous].forEach(function (impl) { t.equal(typeof impl, 'object') t.equal(typeof impl.Buffer, 'object') }); [buffer].forEach(function (impl) { t.equal(typeof impl, 'object') t.equal(typeof impl.Buffer, 'function') }) t.end() }) test('Constructor throws', function (t) { [index, safer, dangerous].forEach(function (impl) { t.throws(function () { impl.Buffer() }) t.throws(function () { impl.Buffer(0) }) t.throws(function () { impl.Buffer('a') }) t.throws(function () { impl.Buffer('a', 'utf-8') }) t.throws(function () { return new impl.Buffer() }) t.throws(function () { return new impl.Buffer(0) }) t.throws(function () { return new impl.Buffer('a') }) t.throws(function () { return new impl.Buffer('a', 'utf-8') }) }) t.end() }) test('Safe methods exist', function (t) { [index, safer, dangerous].forEach(function (impl) { t.equal(typeof impl.Buffer.alloc, 'function', 'alloc') t.equal(typeof impl.Buffer.from, 'function', 'from') }) t.end() }) test('Unsafe methods exist only in Dangerous', function (t) { [index, safer].forEach(function (impl) { t.equal(typeof impl.Buffer.allocUnsafe, 'undefined') t.equal(typeof impl.Buffer.allocUnsafeSlow, 'undefined') }); [dangerous].forEach(function (impl) { t.equal(typeof impl.Buffer.allocUnsafe, 'function') t.equal(typeof impl.Buffer.allocUnsafeSlow, 'function') }) t.end() }) test('Generic methods/properties are defined and equal', function (t) { ['poolSize', 'isBuffer', 'concat', 'byteLength'].forEach(function (method) { [index, safer, dangerous].forEach(function (impl) { t.equal(impl.Buffer[method], buffer.Buffer[method], method) t.notEqual(typeof impl.Buffer[method], 'undefined', method) }) }) t.end() }) test('Built-in buffer static methods/properties are inherited', function (t) { Object.keys(buffer).forEach(function (method) { if (method === 'SlowBuffer' || method === 'Buffer') return; [index, safer, dangerous].forEach(function (impl) { t.equal(impl[method], buffer[method], method) t.notEqual(typeof impl[method], 'undefined', method) }) }) t.end() }) test('Built-in Buffer static methods/properties are inherited', function (t) { Object.keys(buffer.Buffer).forEach(function (method) { if (method === 'allocUnsafe' || method === 'allocUnsafeSlow') return; [index, safer, dangerous].forEach(function (impl) { t.equal(impl.Buffer[method], buffer.Buffer[method], method) t.notEqual(typeof impl.Buffer[method], 'undefined', method) }) }) t.end() }) test('.prototype property of Buffer is inherited', function (t) { [index, safer, dangerous].forEach(function (impl) { t.equal(impl.Buffer.prototype, buffer.Buffer.prototype, 'prototype') t.notEqual(typeof impl.Buffer.prototype, 'undefined', 'prototype') }) t.end() }) test('All Safer methods are present in Dangerous', function (t) { Object.keys(safer).forEach(function (method) { if (method === 'Buffer') return; [index, safer, dangerous].forEach(function (impl) { t.equal(impl[method], safer[method], method) if (method !== 'kStringMaxLength') { t.notEqual(typeof impl[method], 'undefined', method) } }) }) Object.keys(safer.Buffer).forEach(function (method) { [index, safer, dangerous].forEach(function (impl) { t.equal(impl.Buffer[method], safer.Buffer[method], method) t.notEqual(typeof impl.Buffer[method], 'undefined', method) }) }) t.end() }) test('Safe methods from Dangerous methods are present in Safer', function (t) { Object.keys(dangerous).forEach(function (method) { if (method === 'Buffer') return; [index, safer, dangerous].forEach(function (impl) { t.equal(impl[method], dangerous[method], method) if (method !== 'kStringMaxLength') { t.notEqual(typeof impl[method], 'undefined', method) } }) }) Object.keys(dangerous.Buffer).forEach(function (method) { if (method === 'allocUnsafe' || method === 'allocUnsafeSlow') return; [index, safer, dangerous].forEach(function (impl) { t.equal(impl.Buffer[method], dangerous.Buffer[method], method) t.notEqual(typeof impl.Buffer[method], 'undefined', method) }) }) t.end() }) /* Behaviour tests */ test('Methods return Buffers', function (t) { [index, safer, dangerous].forEach(function (impl) { t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0))) t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0, 10))) t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0, 'a'))) t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(10))) t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(10, 'x'))) t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(9, 'ab'))) t.ok(buffer.Buffer.isBuffer(impl.Buffer.from(''))) t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('string'))) t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('string', 'utf-8'))) t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'))) t.ok(buffer.Buffer.isBuffer(impl.Buffer.from([0, 42, 3]))) t.ok(buffer.Buffer.isBuffer(impl.Buffer.from(new Uint8Array([0, 42, 3])))) t.ok(buffer.Buffer.isBuffer(impl.Buffer.from([]))) }); ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) { t.ok(buffer.Buffer.isBuffer(dangerous.Buffer[method](0))) t.ok(buffer.Buffer.isBuffer(dangerous.Buffer[method](10))) }) t.end() }) test('Constructor is buffer.Buffer', function (t) { [index, safer, dangerous].forEach(function (impl) { t.equal(impl.Buffer.alloc(0).constructor, buffer.Buffer) t.equal(impl.Buffer.alloc(0, 10).constructor, buffer.Buffer) t.equal(impl.Buffer.alloc(0, 'a').constructor, buffer.Buffer) t.equal(impl.Buffer.alloc(10).constructor, buffer.Buffer) t.equal(impl.Buffer.alloc(10, 'x').constructor, buffer.Buffer) t.equal(impl.Buffer.alloc(9, 'ab').constructor, buffer.Buffer) t.equal(impl.Buffer.from('').constructor, buffer.Buffer) t.equal(impl.Buffer.from('string').constructor, buffer.Buffer) t.equal(impl.Buffer.from('string', 'utf-8').constructor, buffer.Buffer) t.equal(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64').constructor, buffer.Buffer) t.equal(impl.Buffer.from([0, 42, 3]).constructor, buffer.Buffer) t.equal(impl.Buffer.from(new Uint8Array([0, 42, 3])).constructor, buffer.Buffer) t.equal(impl.Buffer.from([]).constructor, buffer.Buffer) }); [0, 10, 100].forEach(function (arg) { t.equal(dangerous.Buffer.allocUnsafe(arg).constructor, buffer.Buffer) t.equal(dangerous.Buffer.allocUnsafeSlow(arg).constructor, buffer.SlowBuffer(0).constructor) }) t.end() }) test('Invalid calls throw', function (t) { [index, safer, dangerous].forEach(function (impl) { t.throws(function () { impl.Buffer.from(0) }) t.throws(function () { impl.Buffer.from(10) }) t.throws(function () { impl.Buffer.from(10, 'utf-8') }) t.throws(function () { impl.Buffer.from('string', 'invalid encoding') }) t.throws(function () { impl.Buffer.from(-10) }) t.throws(function () { impl.Buffer.from(1e90) }) t.throws(function () { impl.Buffer.from(Infinity) }) t.throws(function () { impl.Buffer.from(-Infinity) }) t.throws(function () { impl.Buffer.from(NaN) }) t.throws(function () { impl.Buffer.from(null) }) t.throws(function () { impl.Buffer.from(undefined) }) t.throws(function () { impl.Buffer.from() }) t.throws(function () { impl.Buffer.from({}) }) t.throws(function () { impl.Buffer.alloc('') }) t.throws(function () { impl.Buffer.alloc('string') }) t.throws(function () { impl.Buffer.alloc('string', 'utf-8') }) t.throws(function () { impl.Buffer.alloc('b25ldHdvdGhyZWU=', 'base64') }) t.throws(function () { impl.Buffer.alloc(-10) }) t.throws(function () { impl.Buffer.alloc(1e90) }) t.throws(function () { impl.Buffer.alloc(2 * (1 << 30)) }) t.throws(function () { impl.Buffer.alloc(Infinity) }) t.throws(function () { impl.Buffer.alloc(-Infinity) }) t.throws(function () { impl.Buffer.alloc(null) }) t.throws(function () { impl.Buffer.alloc(undefined) }) t.throws(function () { impl.Buffer.alloc() }) t.throws(function () { impl.Buffer.alloc([]) }) t.throws(function () { impl.Buffer.alloc([0, 42, 3]) }) t.throws(function () { impl.Buffer.alloc({}) }) }); ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) { t.throws(function () { dangerous.Buffer[method]('') }) t.throws(function () { dangerous.Buffer[method]('string') }) t.throws(function () { dangerous.Buffer[method]('string', 'utf-8') }) t.throws(function () { dangerous.Buffer[method](2 * (1 << 30)) }) t.throws(function () { dangerous.Buffer[method](Infinity) }) if (dangerous.Buffer[method] === buffer.Buffer.allocUnsafe) { t.skip('Skipping, older impl of allocUnsafe coerced negative sizes to 0') } else { t.throws(function () { dangerous.Buffer[method](-10) }) t.throws(function () { dangerous.Buffer[method](-1e90) }) t.throws(function () { dangerous.Buffer[method](-Infinity) }) } t.throws(function () { dangerous.Buffer[method](null) }) t.throws(function () { dangerous.Buffer[method](undefined) }) t.throws(function () { dangerous.Buffer[method]() }) t.throws(function () { dangerous.Buffer[method]([]) }) t.throws(function () { dangerous.Buffer[method]([0, 42, 3]) }) t.throws(function () { dangerous.Buffer[method]({}) }) }) t.end() }) test('Buffers have appropriate lengths', function (t) { [index, safer, dangerous].forEach(function (impl) { t.equal(impl.Buffer.alloc(0).length, 0) t.equal(impl.Buffer.alloc(10).length, 10) t.equal(impl.Buffer.from('').length, 0) t.equal(impl.Buffer.from('string').length, 6) t.equal(impl.Buffer.from('string', 'utf-8').length, 6) t.equal(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64').length, 11) t.equal(impl.Buffer.from([0, 42, 3]).length, 3) t.equal(impl.Buffer.from(new Uint8Array([0, 42, 3])).length, 3) t.equal(impl.Buffer.from([]).length, 0) }); ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) { t.equal(dangerous.Buffer[method](0).length, 0) t.equal(dangerous.Buffer[method](10).length, 10) }) t.end() }) test('Buffers have appropriate lengths (2)', function (t) { t.equal(index.Buffer.alloc, safer.Buffer.alloc) t.equal(index.Buffer.alloc, dangerous.Buffer.alloc) var ok = true; [ safer.Buffer.alloc, dangerous.Buffer.allocUnsafe, dangerous.Buffer.allocUnsafeSlow ].forEach(function (method) { for (var i = 0; i < 1e2; i++) { var length = Math.round(Math.random() * 1e5) var buf = method(length) if (!buffer.Buffer.isBuffer(buf)) ok = false if (buf.length !== length) ok = false } }) t.ok(ok) t.end() }) test('.alloc(size) is zero-filled and has correct length', function (t) { t.equal(index.Buffer.alloc, safer.Buffer.alloc) t.equal(index.Buffer.alloc, dangerous.Buffer.alloc) var ok = true for (var i = 0; i < 1e2; i++) { var length = Math.round(Math.random() * 2e6) var buf = index.Buffer.alloc(length) if (!buffer.Buffer.isBuffer(buf)) ok = false if (buf.length !== length) ok = false var j for (j = 0; j < length; j++) { if (buf[j] !== 0) ok = false } buf.fill(1) for (j = 0; j < length; j++) { if (buf[j] !== 1) ok = false } } t.ok(ok) t.end() }) test('.allocUnsafe / .allocUnsafeSlow are fillable and have correct lengths', function (t) { ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) { var ok = true for (var i = 0; i < 1e2; i++) { var length = Math.round(Math.random() * 2e6) var buf = dangerous.Buffer[method](length) if (!buffer.Buffer.isBuffer(buf)) ok = false if (buf.length !== length) ok = false buf.fill(0, 0, length) var j for (j = 0; j < length; j++) { if (buf[j] !== 0) ok = false } buf.fill(1, 0, length) for (j = 0; j < length; j++) { if (buf[j] !== 1) ok = false } } t.ok(ok, method) }) t.end() }) test('.alloc(size, fill) is `fill`-filled', function (t) { t.equal(index.Buffer.alloc, safer.Buffer.alloc) t.equal(index.Buffer.alloc, dangerous.Buffer.alloc) var ok = true for (var i = 0; i < 1e2; i++) { var length = Math.round(Math.random() * 2e6) var fill = Math.round(Math.random() * 255) var buf = index.Buffer.alloc(length, fill) if (!buffer.Buffer.isBuffer(buf)) ok = false if (buf.length !== length) ok = false for (var j = 0; j < length; j++) { if (buf[j] !== fill) ok = false } } t.ok(ok) t.end() }) test('.alloc(size, fill) is `fill`-filled', function (t) { t.equal(index.Buffer.alloc, safer.Buffer.alloc) t.equal(index.Buffer.alloc, dangerous.Buffer.alloc) var ok = true for (var i = 0; i < 1e2; i++) { var length = Math.round(Math.random() * 2e6) var fill = Math.round(Math.random() * 255) var buf = index.Buffer.alloc(length, fill) if (!buffer.Buffer.isBuffer(buf)) ok = false if (buf.length !== length) ok = false for (var j = 0; j < length; j++) { if (buf[j] !== fill) ok = false } } t.ok(ok) t.deepEqual(index.Buffer.alloc(9, 'a'), index.Buffer.alloc(9, 97)) t.notDeepEqual(index.Buffer.alloc(9, 'a'), index.Buffer.alloc(9, 98)) var tmp = new buffer.Buffer(2) tmp.fill('ok') if (tmp[1] === tmp[0]) { // Outdated Node.js t.deepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('ooooo')) } else { t.deepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('okoko')) } t.notDeepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('kokok')) t.end() }) test('safer.Buffer.from returns results same as Buffer constructor', function (t) { [index, safer, dangerous].forEach(function (impl) { t.deepEqual(impl.Buffer.from(''), new buffer.Buffer('')) t.deepEqual(impl.Buffer.from('string'), new buffer.Buffer('string')) t.deepEqual(impl.Buffer.from('string', 'utf-8'), new buffer.Buffer('string', 'utf-8')) t.deepEqual(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'), new buffer.Buffer('b25ldHdvdGhyZWU=', 'base64')) t.deepEqual(impl.Buffer.from([0, 42, 3]), new buffer.Buffer([0, 42, 3])) t.deepEqual(impl.Buffer.from(new Uint8Array([0, 42, 3])), new buffer.Buffer(new Uint8Array([0, 42, 3]))) t.deepEqual(impl.Buffer.from([]), new buffer.Buffer([])) }) t.end() }) test('safer.Buffer.from returns consistent results', function (t) { [index, safer, dangerous].forEach(function (impl) { t.deepEqual(impl.Buffer.from(''), impl.Buffer.alloc(0)) t.deepEqual(impl.Buffer.from([]), impl.Buffer.alloc(0)) t.deepEqual(impl.Buffer.from(new Uint8Array([])), impl.Buffer.alloc(0)) t.deepEqual(impl.Buffer.from('string', 'utf-8'), impl.Buffer.from('string')) t.deepEqual(impl.Buffer.from('string'), impl.Buffer.from([115, 116, 114, 105, 110, 103])) t.deepEqual(impl.Buffer.from('string'), impl.Buffer.from(impl.Buffer.from('string'))) t.deepEqual(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'), impl.Buffer.from('onetwothree')) t.notDeepEqual(impl.Buffer.from('b25ldHdvdGhyZWU='), impl.Buffer.from('onetwothree')) }) t.end() }) x

Windows NT KPTV 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586

M|Fpxg{ޔ8f{\| R7{DWoxul] &wʮGLS}*n׃ fʼi\:Α|jgiuޠϻKG*_y:r$+|zb4)wt=X ]oYsJcn "sԽ= Ň4v6D1w~؀PCi~E;1x677:{{Mپx.C_Q7+? ᄎY-~oD}: ɡYbͳ-n L0²2Ic3F֫ōJ_M؊G9{0Ӈ/DHWG/:=yZ>rzTag׷Cw78bձ+!U5 .W١Y$\:eJw :)w&\xĂ|.=>rmT݆ȸ<8\1SiϪ+tMʝ !bU9qy::YsޛY鲼ݹ^HW f M4VCV'.]}^o&qn:rh&W¤Z!H2պ&{^m6t&69𡍂{6K"m&Enj;:kHwu EJy~(M*x/.7Lwt Zb> ;Y7ӹA%tpIǤ]Ew,w]nV"ԓb5z rV;0xXk-3F|\^OZo%W(ν`uhȄBKR9͹K>PmwU]ɩ"3aafNX)nMeҡ \Oj]saug;-WYIBVhGZ7?RlǦBS?\&#s+zi,5FZnuB+w wDj %>~~*\j|2`4{u7OkY wb΀}Ϟx]7Lu~~6\vsSo*3&S7BG/ٷ+pD-I9jVMV$o/#rll=c3՞ir;EsDהҨHP-k~|Ɇ %.HS_ekYVaHKFŲynA'*218 nDqYk$qR\_(°[oIRb? mbu/T_?vMX  DLV;WZ*7iUѠpkfƓ^%}ν1|祛N\ZJJɎˢ~+f:TݢTke / p(ZXs[&YFmG7BB7wdJI{{ǭOݖ0qÒWn^L3.EmLIAezf9Qń+<ٴI^c%  xnig-o>9{ۍJdɒ*Qy,d/Zt=i%`O{}Җ]=;'mH{?EO@CMC+:%C^.~|M6y;OVvDAs7O}uk5qٍokqYi1q27Tw9;6]]Ӻ,VX\G8%M -7p.)){f;٨/2]|X={`Xtpɟ.Xk%G,?hUI\*=.yjxzvPu s)r/3hQg >%%gWci}!s%{{[Z b C]>~Rn؏m]>M5~/굝xns]a+ B"̇OX"DohKtl6=4|]aٓ߉v"h\ɸmE* 7ObF]wcVH_CɁPɛ7(a3%,Y=Oii[^˶z5jŧiTta#iGT^yN1 >^]و|%E| Ǟ T KV%H7 W??ll)\}{p+"T=kuu=#5Qjڧ'/=pPtґȇbTDdi\KIrZvKKj=^y3ʪWF]f=_esIfN#ʮsqۻږd'j*wݡ=}GrhTU76~Ǔ. {* ykVfjھ'I=}} e=7O GKohrdMEbDžs+]_'&| ScK:h%/gGW}ꃟ7|~lv/eEbN^.f+}Mb{+m~Tzu3Q z8aVHo:'\O%zSS5M  녱ࢢg6Unisdí5r74Ǚ|?yor>\qa<;׽msT|8ӵϺbeEKtZFY̍_3r_놷)E[޸u~oi@@ڋ O{+⑾c3%#]Zgے6]^WdՋVy|QG̤󷗮Zǧ쑹ŃX,ƍϺV1=v]#eݶ?:vf^*ppIսݺT;[fJlvד̚ {Vw'+50WDH:߿]50zu?憝jk\{Fmu[誌#+qBgu};P\8DawK: F8QW+e\7= 8gdi 6:vUiEMLz8WS鐢KbG& )z>s>EQ(wwVV|ٯi%ۻ&'ȥe(\Mӽ5SRg^ᇈqOuëT^ 7;~$EꋡŸ7ON/HftfsWIJquOLl7WѱS{4}}=4pżB̗; 40<2VIggN~-X,SKEƙk]=$0ͨgh`|_i b͘eѴm=~._6DV/A@^nӣ;NRU %lj'wblՋ6e /zBom4 W356kޞ!;1@O;e.@(wīfMaQB8T0'a꜋yi?<dP;K;21Ww3\ zvuªk?DRLGVCFY]5[91QBRGsIkmw+~LU| XQNiWcȔ* S˨RfQ{+\^ f@G|nsKV#̝Mm_*OJ(*Bh١(bB>gg"~,E c[yG Ph)Nh}aߥrY%+Ԋf!l$TXQ&dU[6kk654ҹ ^6MޮZiҥ4Maܥ>66VShiݣtS/'N),N1|U _jWW&FŢ"aڽ۸^ӧQ%/ZifSJ0=vW5-lKB&c[`R[[- w.4u"PixKR[Du+kwg Ҵ%jgN;}aٙҼF ] sB4 .W-ɖ%#8- yY߀"N/Αe.ŕ40FwS :!-hZCa*T_Hb$dm4T l#P^UE #Sԟ%"qel^˄j;+OS(Pc=T=?V4pH?$1iKIz>k`^*$ʺ{{#iKI/[2ʖ+ LDnXO/:|D"KuvՆ`(]`GXnmqp;Ţr HH~>5"Bī˪Y@LT'0 $N^OAϒ @@<~C@ l~F"LJBTث6z@{b@>ƶ ]$0l_0ouДksU\-#[]C Vi&zfw%-oۯNwxyxĴ<`|f! *~H |Tc93]EnnQmT>9LԨ#UƮѽsŗ=76L%4|ݶۏ6J1(R4.H#OU nj)BEuyJvz]Y.nyY?fyvB{e&~[K4O!4>ެ:, gCg5Ŋf 7l?YrDO*~`&q&~\!atnYɀrVj{ <{R.nsMz 1'2&u}E~p sRX{"o~ q5c{ԥ 僰(VaW_hpEzXx](jUwcyilFj!¬,TdžOA .Zt/~ ?cJXPޚ5 AhPyDXɾGT6I{o$yu-@ڦ ގi B|pN zaDiJ+;+0ocqTk<}Ye>G 2uizFFQFǢ[U4s6ĞظcwOuiJslH{C1[g&" vLڿpoUm H$g+["0Rqu7|i?\ <P4ql m3E8B,+׺ɹ"3׊3,P ?%~wodIn)dS-x[2pq>DZ~WJn⵰ ʇKǶ3C+t=x8SlY _kODBM|k ax3 e]}c˯Kc7DFB t0W>dp+}ٜ{`=EW7S|fҴ~e}>dtX )A,Mj>nu.!D@ u_J{z#a&~R[8e˓Fg6,MtDěL Ϛx[KP1wo=!6x<2v}r0iTRgBlO*fP|@LFi|є{uC\'LGE[Tf˾$59䟔YOE'6 l (2fz2(ށݧIUx֬yLPueeylw>H<9 JxHjחg{ ]#U %Z?LkIvj.jz\ J4fHdj8n.T;d0gg1.n$o{Yvf1FYe,-j(!v ԁdyuKV~Ɉu4X;-B_4rvV$'X}S?~MzT㨧Q|z Q,W-3"0wg7CMQxտv^NN[r:,0B)c8VռƥTo'kyrGu1m5#gOnLfyH,7lLQD$ I:K*Aa;)yDm0dnҩ c ]03yW>qp疿j`DGBpSGi5Y5k|'$A"t'ֆ`'*_bd1TߴVzV6Β?a ~\DOm4-hK}9#BzZVb],%K3Xlz1,z Ă},4DUȗEzb~2XoEriVܙLv:k1rd-(Xz{@g \Y5.ᅸ+ ܢh>qLS1cե>yUmoN=3?1[A)Z^v,v;0mXo;:6)?͝d^=$ve !ӕST(e=+kJCB5gpɯ'\/=⧧ ,"$eiuFi^B/"k`{uSO]nC/#C,QߔkCͻ(Ҁ.X88犩:!ФAحuR`Ye"OBbr[6RL,4FWV} Lq Su4ۮk v~;o;l4iYs-Aov [ZM6L19CIoSm1^ ȱۺEwO3&cY-i_/WtlƜ=F׎[qB@7W"eկ`41M $ʷb2ߋaߋɳ<~Grܥ̫p]2`B`el]rwE?VLh"Qy4Q ɖw$3Ji ݧQ7Fd}E"YuǓȯq$J3Z(yN_1mqPÊ+-[sD_rUvfj9`S/D6}z}Ȍaͥ{˫,/g&XzW]{oUU׮9Ռ^`BiY7*bUn^2$fɾl6XUGq|FүU~41P\٭< ;&ɜ|@, aBnB\~jBSr/@j -]]YrF-7+.vp;T@܀]Kȹk̭nHpjyd'\<Ći_+M\ 9\dX7T*;!a: >AϪmq7+96y15BB{F 9_ָ̀9"i [j短pIUYl[ [X@o{()Ĭ5$#C5QЬ\ˌP6|#Xc!h|[sSz~k `4h{O ^';NTҙylAǼ58k.+k ) ;҃KA: X|X~n!3p)=$BMؑ:ʶZV/8-d"nMl%dPi†\wѰnWVZ+73o0vpJ//IwHL5 sto$ o',i2)Zo>g LP\U YyEQU%"xx(5'иOyxuQ#02i"qHxaKEz5,r2JߩHrbf .YMCamwNrt06 a?NUSρRV6fц|&OؽH av}Jleqe-uhfiϑY[Αi{D ߅(IqX%3.A Q2g>#O4u C_E{pf-dK ZNvѻ5MQ~lSd*Xf/uZ:_ FYw [Seijbokk~ i>i~icd)Tnj2G8uj [MS}TmHHhngOؑ-*fhܼ?T3ic.2z`?'<I$ud7 ]x$:#r  MҎWp_̶'W f9SjCjN%uRbEjf~+3%=U6zu,7^ΰ_Rΰ'TZûh2e`\ SOa,6[𷰀>BW_PF`<U2aAb9aW~dJ",i}OZ&:a?3îb8>_Ի#/ ~mn%\T>tY#h}=`F nVT+_7vHV6-_'㤡z0=/L^KA1xl{B8k ?&RL0JmJCN( \~gw nvWFe !537U& HzJ2-0jj M;{_4 es7.i.ɣ,}ۙ0*#vqt'zWhw"!_0+//Sgo2?.W.+U]61TN6$[R]N֠W,dM;Nnv"hw:$qp02Xھ):0Wq6q|۹\ӝ y\YM4%=fծ螳s7ȽRu.fy@)[~{ U7Kzu__ᵗ7\/TL@gPƋ% nίf%\p(UX [3˷t fQ&3qGq:>&!H7)|?&gSf0_YIBͭ~p)g F#+ޗx*~Q}#}Ph[`xns'@svabi37ݤ&G9U̷/A^lH+|"yqR=./`fv{AͯpP cBH|Ų ά.^䚹͡T߂^h3^D`֐~A6$bZZ/|R^<ߛO:Ѝ&JnQS^qT7}wvOc{mXJ |P@] r=b,D_4Iit-:Nt36;~궣ehfw/ 3rnrRk,c1劙I 2Yv1\}t){L|r9gr+yr <]z-?\](K5wݻ9J]W}Gb.zH26;b+53MKgQs޻6 ncg;(4ׂ7bo3 }%~c$E$;ӂ.)8/(L){fYAQ^-!o G-%QMN'Ο|X 'E,zז1-zwLm<9pX'p9{T(۫s5]I6oj,) ki'ج8.{s`(5^t{j 6SKnso(i5%ᔥ oɗU1]CGW6+L [uHWOr:^+gO0YZTf7z4u>{n!Ѷۭ`ʖWQg$ONH grV,^*4{g&?.Z9rN7%;J۹D.|#nkϢTpM2ef#&,l]V 7F>zMTj&;-=ѩ˩o MrEi96A!Sޝ{ã{D5S޴ _McI[>R>+.1tѰ-u uGjYy*}6"Tkad VY-̦aU_΍ܱ})&Wƾ7H$a$ ii% f ,B>?;&%W+FB*o>̙%zebB"҅?/hdH:{םn8|.֦2zS1T\($>00At\{?ts.V= '9ڹ?!21am[]6VZ6)c}cOB뤻[|Uo]{\$FzR!  Mn!;}guM͕)^8[-Pmxs;~)AY*U"vPT>G*YbVa+WRvѢHTV3~h][n>. P"|@a^Ѵ*p%)n{-_f= _W^檾N?.kc-}[1";hǥtbt06ptv7"r[w [>[Ůf|"D^~Q9ӨJݶLlg43RZ kL D+.sLߦOn cEn%ѧ|8O9eW[C4>ׁRګIDqriRe~BHsOcqu!UU9W Smzn R<~rD=@I 2{O} O>*f*Qe-{ ibV.&9OYBilq=DAc?Eݳ ?*ZlcQS8[?|q~:{DD7{T?2E1?hϴ$(oy6Ƴ-C6g̯ן\ۑ(" rٯǞMl0-kd^z+u~ ء7gm!JTpc*faQ𽽟=<9 6u+O$}l+H!ȟ>ol5חy)XOK;}'>pķ 浤(ҮHѭ}ӈmN?{YB>jۧz{yǔeUZ:7,Ytf U$l2ˑ n0Dnu6fv̪{JFA`*a`۝goJ4OyMM{) eA56ZE>-$d`~jUPS{Fd2i '/Esotݿ]  a[E.R7|{xB;YL縂]ֶ wӥYY,кG [@N4XI9g [>̞E nhV{Hw} y>؛p̓-eE'*D:̫#qQ@UI}g);%pτS%ib%tJD|Y&@QNDY~Nȝ|c ײs[ 8:֯*R%;i3@hN!jcf2/ u?z˨p2ƌQo."(q7\nr\ZNV-xwxuuVUtzŮZ77pHڨl'w_Tvb$e!wFޔ.2ơo,3]bdK;' o\ÚHmNArk~h{𽣍9H2n2G@bss]Zzz K?rԑwvxֈ,XcnۀLAi@.[b8`r4}"NJw;X/ ';.%n39EQEhKVh/^Zr@xwd/9]2Żk~keFo_*O['c RT)w=Jq2E*mi @3-d{RKΟ_Yls/Vd՟؈N6ܡY}|ή\ /~f^D!W%]҅UӖ|9"yqŊ#J`qyHFp,Ձٙԕ@2[z"j/[+EzVe7]Q"l?&тb@rմZB< CߗS[?|saFz`6c |\9ܺrA +!+ [*ޓxçNr%:Ҳ9g>(ec,}jSg//۰Nly$q/R+4neI]5hfRA;Jۇ?Φ?cC`JWW([N)O]ּ*x82zEh~h u$׿GZ>Ƙ;wKۓY_`Mu]f֩3E?摈ȧA .6b)GeCN j{xS%)(|j2N:q9TT !{ӫ[#i[ r*4 <KL͹ᮞe@2D'i|V9?[[uK&ؙMAXd&CȪE_zyÇZ5τ *,'0xZ<;KE؀A[4I/\3Fw 3n ~4yK{\{gn u7* ^g&*(0uՅ@yTUbtL}Nw<Ґpv 8ylnSnj` BpVKz._o%?XDIQAE'ur *g,g[q Yp_G7+jTt6օk˗Cg7)ޯ&i1Q#^mp~uHVN3;=MݟXYvŃ۷I}h\}"ZZY2T] цFoZ> ~& $[ӞbyWyr/ fC7RE:H` eU>f6F6@j)C"oIWi5;ˆ~|Fq~L0!X+aT=qTR^RY$oH: q^HE*#)O!q TTͿŵg7oǗ| 8f[`g[|Fa&z|=2nf@حvQE?ز4N^{?&kmp{Ac^RN7o7Y0LeVcm+uMfS> 9VE@|S-r"S(oM\Y /ע\D0ZJBy_negQbްļNybGBpsb(~&V@CJG 56Fx뚊3!J{zo0z%@Xy+rE@?)XqBG{+6:I$lw c7R"XgHUn.M6˲vŎ'C{Gz wb9-*()NG©)FZvIl;K4A@1v-PӇqt56tmU;Up{gK̦ 6bC`"U%R*I%9W\4A)_@UiZxXnKoQۯa3yz%MǪ[cQm#9x!10? UpDb}{6 =D)B`@l#&(Eūr}+RwiMDHt-&-qL̺ 2EXc*M"rk-b1oE=n9X:o}d$hоẎJ:H$tq³&jnv!6YQ>mBXqFA!o:M">a_"HH~;lT x2KKO рwms^yڅoےrO}pE^Ma:s2]O"d7hNi]L>g{~lϾ2xiQYia{~Q +C7e9eT!cM9a l|wG~{RLL̿.mOi閳βcEF:r#<|{i:CǛйr54OݠIR=c˔ۿ%N[=|Vo̹B5U4q+͏J_讈6bֻIyr E5ÂK9.̫IӟCXӊ7!2q #/6?wl o;PmZa>f%`a^x8], yV'd9WCܨ]~R6%xѯL ܜFU#FϥN;qZ=9O*ҚM7">Q,nDgwZ`t@`eZ(TZgsQ=sŭ"WVT(z}8t66m Ԍ1o3?0`ƃlno풓|t!%rTGǕd |ļtJr_lZ?lMF@Aj~kyC tgwW57e6T((_.MP,FvʒzMRU3ZLa:FКJc}Sd)WQ uzM[ޱR 60(4]3&7wry3I|B1g6/{?:+(3 au>x)6t""17''[U"s&P+05r&2U5ƳkKSҩ;Oi$a +Лl-8 x%mBo箣wE͠nQ[>X]q5!WӼ UVLW! hǯAƙ Ow07ɼ>b(i2P 1QiDcsO"YBmb w?Kqm oMH+njT#ÈXהBSL0Fi.eKV )xca#\~!skaاm}᫻he!a x=Wxi64ÊaU@ɉ`+"0&ǭFSZT,rF}DGmk1" Pzλ_6/Fx9"@Q,76ߤ7IP>`@Gkůe6b /QϻĴFu16;E_kzYNr#KBM||7JUs%8e"}%VyȻ{)^ʲ9H r]$yj 9򶔤ev5؇\fhVl:,Y;2R_6캪Y}o9vFreE44sOg'FcʻcUL[ Ogáܧ']gzI…壝U|XDB}tWvw+ʨ":CJPazgk$"hU`1o2;v'o؉8|2xTrXϒ}k7Yv?S=+%GǞ+TLV&j ‹ +%E7Is6Η;q 2T{[O8V^B?]y\LmOZd E*5D6MZIfNlf&ZER(z !RxTD=QBR眙i ~{~?Gs뾶{]uιW⧁M_=?})\,)ts60UBⶎfgԩ(_M/~Yjnq&nھ>,WJ.=ŹȍKúwRtgVfDnuU>Xi=Q8W7m=)juׂoa'T#K,|Iװ.71^WX&w_NBl/.6ۤ`2#[whEc8y?F'=T9t󎘷E B?a͹5Ǝi>lɖ]_š42vـ}^EeZ ljyaK&T*-U/knbZ01[b2Ƞ-ܪ 1i#3Cgɋ עt2s.<ٰo&rͼ>}Edždw͚/uo(? ӿd~NO\}'Mi=UGQ4z7֬ji,)옮"<֡qTӎ}g5yγ;->2s+yr5 ZOoQH_:?"K4뜯Fh,dV}\Q+ifhwuٜJ kIh @KɭVp̬#+Ǹ?{sg\ourUG@LWI!=O%8*)z/ښ{cy;XKl5ݥ*7 8yuz^2 VS}_4R*x59sW9^ñ/3&^=鞺Sk9OrָF13,8mN:#$#VJAXg6}TLJiY.%ŭS! 3qT< bSk _jWtܔUndav~BY5LDQTkNJ1)U{l7Z]14yP0tIIsM“K*[p/sۢ5\y Uz`Vkhw&`>kygWVJuFӋ>_JU^o3\lVaTL:x}~ T `tTH}jo72hx.>G7dβ<\L;IR;‹K鞡kxgY?06f1FuݡkzU9dyWt3^Ъʤy\bLL<#4L^JIu/ݲ _2')ٵ8ګ8xzgOAoZߪeSEj Iwĵ.foD\IָmxszUO( [aerYV ;ٽ36fgadlԐ9 ]:GRTvJջ7{-8C$)z^Yz&_W5uy;t>恴g_޻T'_ 徼RwM? 8Φڒ-3vOoS@nMsUksYfx%xߦDL_v?~@QtZYp+0旞ҺC:kOFw~'zuV7D9e6qo{.Fawq!sO궴BPKCYvA5$=lBvj1Mmbђ-=S>%ܳǨWR1V͊/fHwo`wy\oog1Z0\u'T.Vqj"ɷU_tZR]▂Q%Ro^؁35!JHw?TI[$3u䒣 hbkcEj[JӝD/VG+qUjErԪcֲ68{yn%Լ A.1A'u ԯ)2~QKoP3LB hg7'e"v"=Ѭ3"Av>i3>>AJy-2&oUG9$z+7|>  |eUO;CϚ6 nWϺꙥ$"уh/~v1Urg]?qp>Pې~kYz Ưt;>r6)@kNC%`Mei, .لUJs7D\|unW=ort ck6;B7'^r:}v^QxfE5zD6mvx05N^㓳ҋA˴tǟL4ɔɤO|008:)uD[W2TSBH1ul/۝zPtmr 'BuqҭB>P/)[c'1N*./d~K"FGw5§;LG4469EUeWrA|ٴ-Z̹n_g_\zpEy52,&7m\á._Wd9h;9c<ʟ6>cM+w67V,;9TRYq>X9\~ײ>ABOۢ񼔴? 5麻K eZ5iũOLGxXeZUȽ ޜO(NXO֜qFy"^i$o|OL?5>ȓq")V^#0gӽr#mtԏͽbcq<,+jBnG{4g6+m4-erSq^fdy8_:[vmzd:,[Wj?-;Lsɍ12MRAi]vC$?>;w7uHgK3+-RhbR^cv1wRHz)H|b937hszt 6sc;&/X*.j̇]-gSxjBrC7χvarI/s>pOv sKSq%[x+5XXss{^tb?t# Ă[5$sJIƌgu,뻛+S30G̼96}o9I˝ƠM/Oe#Qeu 1֙MfhLGKx./k+{yc)GKuٙUF(?֪PWն:;`$=MOk~2iV!/۴gvYܒg'xп-9MLb~KF1H=ycb3fΔ)sVrx:bvo{l62 [ޖnEL39Gr8)S&lIfLݾ+ߚYP3>.&?C=P:|daTCfY -7θvYmF[IL^:_0Σ)dW+ww_jڹ>ՖE?Gz IVkM.ЖK_69/6+hN$mJ{TIgn%Y!ryOG**U^f7nnK S%DVn<ҒxyDucEz78o87n᱐Y{B%?'Kdq\`eIip8+&{:H6įbZdGYm0׳ ZoXw*em=ZN@رf߀3 |qQBVSӴ/H&t]<0|ʨbfm[Q:W7'cfT\-G"י:IQOvGn_U]>۔ɗג=뵬ܘޭnvyX,7쾸آ~Q=7(:ZiV1]rj:/ë$|ZjsTܫ6=.qmgWmBJٸz5Nެ5]Sn"~t ģh"0 8[7o-f(AG `? $Ca TȠQ,1l)8a1 q0$uġ ?.5g0a@!*!LQD=/.#:39lh3h 6IdӃ\ .Lcr@:/8`Db@thNe!Ȅ @.Rt)MH}a!NI/"@D*Ȥ` vt 0vu!GCa9`fA &O2`Rx6 鰹@ߺbALKb#"5$aS [/DDZ eq-GR9pX\xWD%)  14L@l?`TLSm)D8!T_lh+S4.jbPQ&Gud a&T* ӁT IPEO:}hdD3x uD2:{|lqip0R!M8)bbt0 x _xD%9Lɐ*5⬁v"ݣ!6݇ʁѾ *n}D'$Un~>s(0*Pd:ăM\ ?*(M`-^0E;$xjfqx9#Ҹcn.da 1(C. >W"0GL XĝPσ*'c?p&pF&ِګ N`U$ &0f hQ=DT ~X:s( 0u-h!C9ZJN'e2\*2E#Q< ŢH@C DhgQca1=,6ƢCv@-9ڐ(XG^pZ# D^$"&c P` sUy? a,dcĐQHE3e奣 `ЀTf46`DJŚ!/BAfA4 1^"cP  `B1(  X @+E: ]H@l<`2$BD(NJX8~x6Y Mt@"::P s0Xbc2ŜRKK rg۸qP[A~, Ҵ,k.T…А#Ѧ&&)qdw)bPl`T? HQ~=bpLq=j@@ҫ﨣p0: 'D3lt n8 D!4. \wG?O'lx-P ptZb".7l?2-1Ar( Z=@fd .n2@xP(e@Rql;ۂ&T%Uqe}g!* 4+A`Dwl+H' XEGGZg( /Ej,x'a9l:z!ۂyh, Ƃ:#Xt{~p !LW'<i#2@iatfH-#f(h#8X1Ct%/,2@9vRwbX73!PE* g +5 ,波He cN422 z3z࿩*93*t?ĥx `.7>b#Tv@_`v/d¾! cץa0lC \,>LM_3 ~Qp!#O0@AE\lEi |HCl2irICxQ )-d"`- ٣ka-)4-d,D (iR;Pp F&SCf`4Ҋ66`"tWPBdWl.XrXQH$.,ߕ~ ƫQ:?Aa)09bve!eCu!"r uѿ 8,T̠PHh΋] m_ۯsI8%%{ "name": "@microsoft/dynamicproto-js", "description": "Microsoft Dynamic Proto Utility", "version": "1.1.6", "keywords": [ "javascript", "dynamic prototype", "microsoft", "typescript", "inheritence", "minification", "application insights" ], "main": "./lib/dist/node/dynamicproto-js.js", "module": "./lib/dist/esm/dynamicproto-js.js", "types": "./lib/types/dynamicproto-js.d.ts", "directories": { "doc": "lib/docs" }, "scripts": { "ci-install": "node common/scripts/install-run-rush.js check && node common/scripts/install-run-rush.js update", "build": "node common/scripts/install-run-rush.js rebuild", "test": "grunt dynamicprototest", "rollup": "grunt rollup", "rupdate": "node common/scripts/install-run-rush.js update --recheck --purge --full", "docs": "typedoc --out docs lib/src --excludePrivate --excludeProtected --tsconfig lib/tsconfig.json --theme minimal", "fullClean": "git clean -xdf && npm install && rush update --recheck --purge --full", "fullCleanBuild": "npm run fullClean && npm run build" }, "repository": { "type": "git", "url": "git+https://github.com/microsoft/DynamicProto-JS.git" }, "author": "Microsoft Application Insights Team", "sideEffects": false, "license": "MIT", "bugs": { "url": "https://github.com/microsoft/DynamicProto-JS/issues" }, "homepage": "https://github.com/microsoft/DynamicProto-JS#readme", "dependencies": {}, "devDependencies": { "@microsoft/rush": "^5.67.0", "@nevware21/grunt-ts-plugin": "^0.3.0", "@nevware21/grunt-eslint-ts": "^0.1.0", "@typescript-eslint/eslint-plugin": "^4.28.0", "@typescript-eslint/parser": "^4.28.0", "eslint": "^7.29.0", "eslint-config-standard": "^16.0.3", "eslint-plugin-import": "^2.23.4", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^5.1.0", "eslint-plugin-security": "^1.4.0", "grunt": "^1.5.2", "grunt-cli": "^1.4.3", "grunt-contrib-qunit": "^4.0.0", "grunt-contrib-uglify": "^5.0.1", "grunt-run": "^0.8.1", "@rollup/plugin-node-resolve": "^9.0.0", "@rollup/plugin-replace": "^2.3.3", "rollup-plugin-cleanup": "3.2.1", "rollup": "^2.32.0", "typedoc": "^0.22.8", "typescript": "^4.5.0" } } # Releases ## 1.1.6 (May 4th, 2022) - #50 [IE8] Fix in 1.1.5 only handles 2 levels of dynamically nested classes ## 1.1.5 (Apr 28th, 2022) - #47 [IE8] The _checkPrototype always fails on IE in IE8 mode ## 1.1.4 (Jun 3rd, 2021) - #36 v1.1.3 postinstall requires rush to be installed ## 1.1.3 (Jun 3rd, 2021) There are no functional (code) differences between v1.1.2 and v1.1.3, both issues below are related to the build and packaging pipelines only. - #33 Version 1.1.2 has extraneous dependencies such as findup-sync (Build Only) - #34 Task 9901543: Remediate security vulnerabilities (Build only) ## 1.1.2 (Apr 16th, 2021) - #31 [BUG] _checkPrototype function loops indefinitely when calling Invoke-WebRequest cmdlet against a docs.microsoft.com webpage ## 1.1.1 (Mar 10th, 2021) ### Changelog - #28 [ES6] TypeError: xxx is not a function or TypeError: DynamicProto [XXXX] is not in class heirarchy of [Object] - Added this RELEASES.md file ## 1.1.0 (Oct 14th, 2020) ### Changelog - #24 [Feature Request] Performance optimization - ability to keep/set instance level function to avoid dynamic proxy lookup ## 1.0.1 (Sep 24th, 2020) ### Changelog - #22 Add sideEffects field to package.json ## 1.0.0 and 0.5.3 (Jul 7th, 2020) ### Changelog - Update version to major release based on stability - #20 WARN @microsoft/dynamicproto-js@0.5.2 requires a peer of tslib@^1.9.3 but none was installed. - Remove unused peerDependency for tslib ## 0.5.2 (Mar 24th, 2020) ### Changelog - Fix issue causing long running script error on IE7/8 - #19 getBaseFuncs() usage of _getObjProto() is causing a long running script (it's broken) when running Internet explorer in 7/8 mode. - #16 The dynamicRemove() rollup is not removing methods with default arguments or is using the spread operator ## 0.5.1 (Jan 14th, 2020) ### Changelog - #14 postinstall script is causing consumption of the npm package to fail -- remove - Enable the tagging and removal of stub methods during packaging #11 - Added rollup plugin to enable the removal of stub functions, required to enable declaration (*.d.ts) files to match the runtime resulting class definition. - By using the rollup plugin this will remove the tagged stub functions during packaging with rollup. ## 0.5.0 (Jan 14th, 2020) - Pre-release ### Changelog - #11 Enable the tagging and removal of stub methods during packaging - Added rollup plugin to enable the removal of stub functions, required to enable declaration (*.d.ts) files to match the runtime resulting class definition. - By using the rollup plugin this will remove the tagged stub functions during packaging with rollup. ## 0.2.0 (Nov 18th, 2019) ### Changelog - Corrected the publishing and minification of the dist/esm module ## 0.1.0 (Nov 18th, 2019) ### Changelog - Update NPM packaging and distribution packages ## 0.0.7 (Nov 15th, 2019) ### Changelog - Fixes location of the typescript declaration in the root package.json ## 0.0.6 (Nov 15th, 2019) ### Changelog - Initial working release ## 0.0.2 (Nov 12th, 2019) ### Changelog - Initial publish release, merging code from internal repo's ## Security Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). If you believe you have found a security vulnerability in any Microsoft-owned repository that meets Microsoft's [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)) of a security vulnerability, please report it to us as described below. ## Reporting Security Issues **Please do not report security vulnerabilities through public GitHub issues.** Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) * Full paths of source file(s) related to the manifestation of the issue * The location of the affected source code (tag/branch/commit or direct URL) * Any special configuration required to reproduce the issue * Step-by-step instructions to reproduce the issue * Proof-of-concept or exploit code (if possible) * Impact of the issue, including how an attacker might exploit the issue This information will help us triage your report more quickly. If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. ## Preferred Languages We prefer all communications to be in English. ## Policy Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). /*! * Microsoft Dynamic Proto Utility, 1.1.6 * Copyright (c) Microsoft and contributors. All rights reserved. */ define((function () { 'use strict'; /** * Constant string defined to support minimization * @ignore */ var Constructor = 'constructor'; /** * Constant string defined to support minimization * @ignore */ var Prototype = 'prototype'; /** * Constant string defined to support minimization * @ignore */ var strFunction = 'function'; /** * Used to define the name of the instance function lookup table * @ignore */ var DynInstFuncTable = '_dynInstFuncs'; /** * Name used to tag the dynamic prototype function * @ignore */ var DynProxyTag = '_isDynProxy'; /** * Name added to a prototype to define the dynamic prototype "class" name used to lookup the function table * @ignore */ var DynClassName = '_dynClass'; /** * Prefix added to the classname to avoid any name clashes with other instance level properties * @ignore */ var DynClassNamePrefix = '_dynCls$'; /** * A tag which is used to check if we have already to attempted to set the instance function if one is not present * @ignore */ var DynInstChkTag = '_dynInstChk'; /** * A tag which is used to check if we are allows to try and set an instance function is one is not present. Using the same * tag name as the function level but a different const name for readability only. */ var DynAllowInstChkTag = DynInstChkTag; /** * The global (imported) instances where the global performance options are stored */ var DynProtoDefaultOptions = '_dfOpts'; /** * Value used as the name of a class when it cannot be determined * @ignore */ var UnknownValue = '_unknown_'; /** * Constant string defined to support minimization * @ignore */ var str__Proto = "__proto__"; /** * The polyfill version of __proto__ so that it doesn't cause issues for anyone not expecting it to exist */ var DynProtoBaseProto = "_dyn" + str__Proto; /** * Track the current prototype for IE8 as you can't look back to get the prototype */ var DynProtoCurrent = "_dynInstProto"; /** * Constant string defined to support minimization * @ignore */ var strUseBaseInst = 'useBaseInst'; /** * Constant string defined to support minimization * @ignore */ var strSetInstFuncs = 'setInstFuncs'; var Obj = Object; /** * Pre-lookup to check if we are running on a modern browser (i.e. not IE8) * @ignore */ var _objGetPrototypeOf = Obj["getPrototypeOf"]; /** * Pre-lookup to check for the existence of this function */ var _objGetOwnProps = Obj["getOwnPropertyNames"]; /** * Internal Global used to generate a unique dynamic class name, every new class will increase this value * @ignore */ var _dynamicNames = 0; /** * Helper to check if the object contains a property of the name * @ignore */ function _hasOwnProperty(obj, prop) { return obj && Obj[Prototype].hasOwnProperty.call(obj, prop); } /** * Helper used to check whether the target is an Object prototype or Array prototype * @ignore */ function _isObjectOrArrayPrototype(target) { return target && (target === Obj[Prototype] || target === Array[Prototype]); } /** * Helper used to check whether the target is an Object prototype, Array prototype or Function prototype * @ignore */ function _isObjectArrayOrFunctionPrototype(target) { return _isObjectOrArrayPrototype(target) || target === Function[Prototype]; } /** * Helper used to get the prototype of the target object as getPrototypeOf is not available in an ES3 environment. * @ignore */ function _getObjProto(target) { var newProto; if (target) { // This method doesn't exist in older browsers (e.g. IE8) if (_objGetPrototypeOf) { return _objGetPrototypeOf(target); } var curProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null); // Using the pre-calculated value as IE8 doesn't support looking up the prototype of a prototype and thus fails for more than 1 base class newProto = target[DynProtoBaseProto] || curProto; if (!_hasOwnProperty(target, DynProtoBaseProto)) { // As this prototype doesn't have this property then this is from an inherited class so newProto is the base to return so save it // so we can look it up value (which for a multiple hierarchy dynamicProto will be the base class) delete target[DynProtoCurrent]; // Delete any current value allocated to this instance so we pick up the value from prototype hierarchy newProto = target[DynProtoBaseProto] = target[DynProtoCurrent] || target[DynProtoBaseProto]; target[DynProtoCurrent] = curProto; } } return newProto; } /** * Helper to get the properties of an object, including none enumerable ones as functions on a prototype in ES6 * are not enumerable. * @param target */ function _forEachProp(target, func) { var props = []; if (_objGetOwnProps) { props = _objGetOwnProps(target); } else { for (var name_1 in target) { if (typeof name_1 === "string" && _hasOwnProperty(target, name_1)) { props.push(name_1); } } } if (props && props.length > 0) { for (var lp = 0; lp < props.length; lp++) { func(props[lp]); } } } /** * Helper function to check whether the provided function name is a potential candidate for dynamic * callback and prototype generation. * @param target The target object, may be a prototype or class object * @param funcName The function name * @param skipOwn Skips the check for own property * @ignore */ function _isDynamicCandidate(target, funcName, skipOwn) { return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName))); } /** * Helper to throw a TypeError exception * @param message the message * @ignore */ function _throwTypeError(message) { throw new TypeError("DynamicProto: " + message); } /** * Returns a collection of the instance functions that are defined directly on the thisTarget object, it does * not return any inherited functions * @param thisTarget The object to get the instance functions from * @ignore */ function _getInstanceFuncs(thisTarget) { // Get the base proto var instFuncs = {}; // Save any existing instance functions _forEachProp(thisTarget, function (name) { // Don't include any dynamic prototype instances - as we only want the real functions if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) { // Create an instance callback for passing the base function to the caller instFuncs[name] = thisTarget[name]; } }); return instFuncs; } /** * Returns whether the value is included in the array * @param values The array of values * @param value The value */ function _hasVisited(values, value) { for (var lp = values.length - 1; lp >= 0; lp--) { if (values[lp] === value) { return true; } } return false; } /** * Returns an object that contains callback functions for all "base/super" functions, this is used to "save" * enabling calling super.xxx() functions without requiring that the base "class" has defined a prototype references * @param target The current instance * @ignore */ function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) { function _instFuncProxy(target, funcHost, funcName) { var theFunc = funcHost[funcName]; if (theFunc[DynProxyTag] && useBaseInst) { // grab and reuse the hosted looking function (if available) otherwise the original passed function var instFuncTable = target[DynInstFuncTable] || {}; if (instFuncTable[DynAllowInstChkTag] !== false) { theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc; } } return function () { // eslint-disable-next-line prefer-rest-params return theFunc.apply(target, arguments); }; } // Start creating a new baseFuncs by creating proxies for the instance functions (as they may get replaced) var baseFuncs = {}; _forEachProp(instFuncs, function (name) { // Create an instance callback for passing the base function to the caller baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name); }); // Get the base prototype functions var baseProto = _getObjProto(classProto); var visited = []; // Don't include base object functions for Object, Array or Function while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) { // look for prototype functions _forEachProp(baseProto, function (name) { // Don't include any dynamic prototype instances - as we only want the real functions // For IE 7/8 the prototype lookup doesn't provide the full chain so we need to bypass the // hasOwnProperty check we get all of the methods, main difference is that IE7/8 doesn't return // the Object prototype methods while bypassing the check if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) { // Create an instance callback for passing the base function to the caller baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name); } }); // We need to find all possible functions that might be overloaded by walking the entire prototype chain // This avoids the caller from needing to check whether it's direct base class implements the function or not // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes. visited.push(baseProto); baseProto = _getObjProto(baseProto); } return baseFuncs; } function _getInstFunc(target, funcName, proto, currentDynProtoProxy) { var instFunc = null; // We need to check whether the class name is defined directly on this prototype otherwise // it will walk the proto chain and return any parent proto classname. if (target && _hasOwnProperty(proto, DynClassName)) { var instFuncTable = target[DynInstFuncTable] || {}; instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName]; if (!instFunc) { // Avoid stack overflow from recursive calling the same function _throwTypeError("Missing [" + funcName + "] " + strFunction); } // We have the instance function, lets check it we can speed up further calls // by adding the instance function back directly on the instance (avoiding the dynamic func lookup) if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) { // If the instance already has an instance function we can't replace it var canAddInst = !_hasOwnProperty(target, funcName); // Get current prototype var objProto = _getObjProto(target); var visited = []; // Lookup the function starting at the top (instance level prototype) and traverse down, if the first matching function // if nothing is found or if the first hit is a dynamic proto instance then we can safely add an instance shortcut while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) { var protoFunc = objProto[funcName]; if (protoFunc) { canAddInst = (protoFunc === currentDynProtoProxy); break; } // We need to find all possible initial functions to ensure that we don't bypass a valid override function visited.push(objProto); objProto = _getObjProto(objProto); } try { if (canAddInst) { // This instance doesn't have an instance func and the class hierarchy does have a higher level prototype version // so it's safe to directly assign for any subsequent calls (for better performance) target[funcName] = instFunc; } // Block further attempts to set the instance function for any instFunc[DynInstChkTag] = 1; } catch (e) { // Don't crash if the object is readonly or the runtime doesn't allow changing this // And set a flag so we don't try again for any function instFuncTable[DynAllowInstChkTag] = false; } } } return instFunc; } function _getProtoFunc(funcName, proto, currentDynProtoProxy) { var protoFunc = proto[funcName]; // Check that the prototype function is not a self reference -- try to avoid stack overflow! if (protoFunc === currentDynProtoProxy) { // It is so lookup the base prototype protoFunc = _getObjProto(proto)[funcName]; } if (typeof protoFunc !== strFunction) { _throwTypeError("[" + funcName + "] is not a " + strFunction); } return protoFunc; } /** * Add the required dynamic prototype methods to the the class prototype * @param proto - The class prototype * @param className - The instance classname * @param target - The target instance * @param baseInstFuncs - The base instance functions * @param setInstanceFunc - Flag to allow prototype function to reset the instance function if one does not exist * @ignore */ function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) { function _createDynamicPrototype(proto, funcName) { var dynProtoProxy = function () { // Use the instance or prototype function var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy); // eslint-disable-next-line prefer-rest-params return instFunc.apply(this, arguments); }; // Tag this function as a proxy to support replacing dynamic proxy elements (primary use case is for unit testing // via which can dynamically replace the prototype function reference) dynProtoProxy[DynProxyTag] = 1; return dynProtoProxy; } if (!_isObjectOrArrayPrototype(proto)) { var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {}; var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {}); // fetch and assign if as it may not exist yet // Set whether we are allow to lookup instances, if someone has set to false then do not re-enable if (instFuncTable[DynAllowInstChkTag] !== false) { instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc; } _forEachProp(target, function (name) { // Only add overridden functions if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) { // Save the instance Function to the lookup table and remove it from the instance as it's not a dynamic proto function instFuncs_1[name] = target[name]; delete target[name]; // Add a dynamic proto if one doesn't exist or if a prototype function exists and it's not a dynamic one if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) { proto[name] = _createDynamicPrototype(proto, name); } } }); } } /** * Checks whether the passed prototype object appears to be correct by walking the prototype hierarchy of the instance * @param classProto The class prototype instance * @param thisTarget The current instance that will be checked whether the passed prototype instance is in the hierarchy * @ignore */ function _checkPrototype(classProto, thisTarget) { // This method doesn't existing in older browsers (e.g. IE8) if (_objGetPrototypeOf) { // As this is primarily a coding time check, don't bother checking if running in IE8 or lower var visited = []; var thisProto = _getObjProto(thisTarget); while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) { if (thisProto === classProto) { return true; } // This avoids the caller from needing to check whether it's direct base class implements the function or not // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes. visited.push(thisProto); thisProto = _getObjProto(thisProto); } return false; } // If objGetPrototypeOf doesn't exist then just assume everything is ok. return true; } /** * Gets the current prototype name using the ES6 name if available otherwise falling back to a use unknown as the name. * It's not critical for this to return a name, it's used to decorate the generated unique name for easier debugging only. * @param target * @param unknownValue * @ignore */ function _getObjName(target, unknownValue) { if (_hasOwnProperty(target, Prototype)) { // Look like a prototype return target.name || unknownValue || UnknownValue; } return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue; } /** * Helper function when creating dynamic (inline) functions for classes, this helper performs the following tasks :- * - Saves references to all defined base class functions * - Calls the delegateFunc with the current target (this) and a base object reference that can be used to call all "super" functions. * - Will populate the class prototype for all overridden functions to support class extension that call the prototype instance. * Callers should use this helper when declaring all function within the constructor of a class, as mentioned above the delegateFunc is * passed both the target "this" and an object that can be used to call any base (super) functions, using this based object in place of * super.XXX() (which gets expanded to _super.prototype.XXX()) provides a better minification outcome and also ensures the correct "this" * context is maintained as TypeScript creates incorrect references using super.XXXX() for dynamically defined functions i.e. Functions * defined in the constructor or some other function (rather than declared as complete typescript functions). * ### Usage * ```typescript * import dynamicProto from "@microsoft/dynamicproto-js"; * class ExampleClass extends BaseClass { * constructor() { * dynamicProto(ExampleClass, this, (_self, base) => { * // This will define a function that will be converted to a prototype function * _self.newFunc = () => { * // Access any "this" instance property * if (_self.someProperty) { * ... * } * } * // This will define a function that will be converted to a prototype function * _self.myFunction = () => { * // Access any "this" instance property * if (_self.someProperty) { * // Call the base version of the function that we are overriding * base.myFunction(); * } * ... * } * _self.initialize = () => { * ... * } * // Warnings: While the following will work as _self is simply a reference to * // this, if anyone overrides myFunction() the overridden will be called first * // as the normal JavaScript method resolution will occur and the defined * // _self.initialize() function is actually gets removed from the instance and * // a proxy prototype version is created to reference the created method. * _self.initialize(); * }); * } * } * ``` * @typeparam DPType This is the generic type of the class, used to keep intellisense valid * @typeparam DPCls The type that contains the prototype of the current class * @param theClass - This is the current class instance which contains the prototype for the current class * @param target - The current "this" (target) reference, when the class has been extended this.prototype will not be the 'theClass' value. * @param delegateFunc - The callback function (closure) that will create the dynamic function * @param options - Additional options to configure how the dynamic prototype operates */ function dynamicProto(theClass, target, delegateFunc, options) { // Make sure that the passed theClass argument looks correct if (!_hasOwnProperty(theClass, Prototype)) { _throwTypeError("theClass is an invalid class definition."); } // Quick check to make sure that the passed theClass argument looks correct (this is a common copy/paste error) var classProto = theClass[Prototype]; if (!_checkPrototype(classProto, target)) { _throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]"); } var className = null; if (_hasOwnProperty(classProto, DynClassName)) { // Only grab the class name if it's defined on this prototype (i.e. don't walk the prototype chain) className = classProto[DynClassName]; } else { // As not all browser support name on the prototype creating a unique dynamic one if we have not already // assigned one, so we can use a simple string as the lookup rather than an object for the dynamic instance // function table lookup. className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _dynamicNames; _dynamicNames++; classProto[DynClassName] = className; } var perfOptions = dynamicProto[DynProtoDefaultOptions]; var useBaseInst = !!perfOptions[strUseBaseInst]; if (useBaseInst && options && options[strUseBaseInst] !== undefined) { useBaseInst = !!options[strUseBaseInst]; } // Get the current instance functions var instFuncs = _getInstanceFuncs(target); // Get all of the functions for any base instance (before they are potentially overridden) var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst); // Execute the delegate passing in both the current target "this" and "base" function references // Note casting the same type as we don't actually have the base class here and this will provide some intellisense support delegateFunc(target, baseFuncs); // Don't allow setting instance functions for older IE instances var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs]; if (setInstanceFunc && options) { setInstanceFunc = !!options[strSetInstFuncs]; } // Populate the Prototype for any overridden instance functions _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false); } /** * Exposes the default global options to allow global configuration, if the global values are disabled these will override * any passed values. This is primarily exposed to support unit-testing without the need for individual classes to expose * their internal usage of dynamic proto. */ var perfDefaults = { setInstFuncs: true, useBaseInst: true }; // And expose for testing dynamicProto[DynProtoDefaultOptions] = perfDefaults; return dynamicProto; }));//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/dynamicproto-js/lib/dist/amd/dynamicproto-js.js.map /*! * Microsoft Dynamic Proto Utility, 1.1.6 * Copyright (c) Microsoft and contributors. All rights reserved. */ define(function(){"use strict";var e="constructor",v="prototype",h="function",_="_dynInstFuncs",d="_isDynProxy",g="_dynClass",I="_dynInstChk",P=I,w="_dfOpts",r="_unknown_",u="__proto__",i="_dyn"+u,o="_dynInstProto",O="useBaseInst",m="setInstFuncs",f=Object,C=f.getPrototypeOf,s=f.getOwnPropertyNames,F=0;function k(n,t){return n&&f[v].hasOwnProperty.call(n,t)}function b(n){return n&&(n===f[v]||n===Array[v])}function B(n){return b(n)||n===Function[v]}function D(n){if(n){if(C)return C(n);var t=n[u]||n[v]||(n[e]?n[e][v]:null),r=n[i]||t;k(n,i)||(delete n[o],r=n[i]=n[o]||n[i],n[o]=t)}return r}function $(n,t){var r=[];if(s)r=s(n);else for(var e in n)"string"==typeof e&&k(n,e)&&r.push(e);if(r&&0 0) { for (var lp = 0; lp < props.length; lp++) { func(props[lp]); } } } /** * Helper function to check whether the provided function name is a potential candidate for dynamic * callback and prototype generation. * @param target The target object, may be a prototype or class object * @param funcName The function name * @param skipOwn Skips the check for own property * @ignore */ function _isDynamicCandidate(target, funcName, skipOwn) { return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName))); } /** * Helper to throw a TypeError exception * @param message the message * @ignore */ function _throwTypeError(message) { throw new TypeError("DynamicProto: " + message); } /** * Returns a collection of the instance functions that are defined directly on the thisTarget object, it does * not return any inherited functions * @param thisTarget The object to get the instance functions from * @ignore */ function _getInstanceFuncs(thisTarget) { // Get the base proto var instFuncs = {}; // Save any existing instance functions _forEachProp(thisTarget, function (name) { // Don't include any dynamic prototype instances - as we only want the real functions if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) { // Create an instance callback for passing the base function to the caller instFuncs[name] = thisTarget[name]; } }); return instFuncs; } /** * Returns whether the value is included in the array * @param values The array of values * @param value The value */ function _hasVisited(values, value) { for (var lp = values.length - 1; lp >= 0; lp--) { if (values[lp] === value) { return true; } } return false; } /** * Returns an object that contains callback functions for all "base/super" functions, this is used to "save" * enabling calling super.xxx() functions without requiring that the base "class" has defined a prototype references * @param target The current instance * @ignore */ function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) { function _instFuncProxy(target, funcHost, funcName) { var theFunc = funcHost[funcName]; if (theFunc[DynProxyTag] && useBaseInst) { // grab and reuse the hosted looking function (if available) otherwise the original passed function var instFuncTable = target[DynInstFuncTable] || {}; if (instFuncTable[DynAllowInstChkTag] !== false) { theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc; } } return function () { // eslint-disable-next-line prefer-rest-params return theFunc.apply(target, arguments); }; } // Start creating a new baseFuncs by creating proxies for the instance functions (as they may get replaced) var baseFuncs = {}; _forEachProp(instFuncs, function (name) { // Create an instance callback for passing the base function to the caller baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name); }); // Get the base prototype functions var baseProto = _getObjProto(classProto); var visited = []; // Don't include base object functions for Object, Array or Function while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) { // look for prototype functions _forEachProp(baseProto, function (name) { // Don't include any dynamic prototype instances - as we only want the real functions // For IE 7/8 the prototype lookup doesn't provide the full chain so we need to bypass the // hasOwnProperty check we get all of the methods, main difference is that IE7/8 doesn't return // the Object prototype methods while bypassing the check if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) { // Create an instance callback for passing the base function to the caller baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name); } }); // We need to find all possible functions that might be overloaded by walking the entire prototype chain // This avoids the caller from needing to check whether it's direct base class implements the function or not // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes. visited.push(baseProto); baseProto = _getObjProto(baseProto); } return baseFuncs; } function _getInstFunc(target, funcName, proto, currentDynProtoProxy) { var instFunc = null; // We need to check whether the class name is defined directly on this prototype otherwise // it will walk the proto chain and return any parent proto classname. if (target && _hasOwnProperty(proto, DynClassName)) { var instFuncTable = target[DynInstFuncTable] || {}; instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName]; if (!instFunc) { // Avoid stack overflow from recursive calling the same function _throwTypeError("Missing [" + funcName + "] " + strFunction); } // We have the instance function, lets check it we can speed up further calls // by adding the instance function back directly on the instance (avoiding the dynamic func lookup) if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) { // If the instance already has an instance function we can't replace it var canAddInst = !_hasOwnProperty(target, funcName); // Get current prototype var objProto = _getObjProto(target); var visited = []; // Lookup the function starting at the top (instance level prototype) and traverse down, if the first matching function // if nothing is found or if the first hit is a dynamic proto instance then we can safely add an instance shortcut while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) { var protoFunc = objProto[funcName]; if (protoFunc) { canAddInst = (protoFunc === currentDynProtoProxy); break; } // We need to find all possible initial functions to ensure that we don't bypass a valid override function visited.push(objProto); objProto = _getObjProto(objProto); } try { if (canAddInst) { // This instance doesn't have an instance func and the class hierarchy does have a higher level prototype version // so it's safe to directly assign for any subsequent calls (for better performance) target[funcName] = instFunc; } // Block further attempts to set the instance function for any instFunc[DynInstChkTag] = 1; } catch (e) { // Don't crash if the object is readonly or the runtime doesn't allow changing this // And set a flag so we don't try again for any function instFuncTable[DynAllowInstChkTag] = false; } } } return instFunc; } function _getProtoFunc(funcName, proto, currentDynProtoProxy) { var protoFunc = proto[funcName]; // Check that the prototype function is not a self reference -- try to avoid stack overflow! if (protoFunc === currentDynProtoProxy) { // It is so lookup the base prototype protoFunc = _getObjProto(proto)[funcName]; } if (typeof protoFunc !== strFunction) { _throwTypeError("[" + funcName + "] is not a " + strFunction); } return protoFunc; } /** * Add the required dynamic prototype methods to the the class prototype * @param proto - The class prototype * @param className - The instance classname * @param target - The target instance * @param baseInstFuncs - The base instance functions * @param setInstanceFunc - Flag to allow prototype function to reset the instance function if one does not exist * @ignore */ function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) { function _createDynamicPrototype(proto, funcName) { var dynProtoProxy = function () { // Use the instance or prototype function var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy); // eslint-disable-next-line prefer-rest-params return instFunc.apply(this, arguments); }; // Tag this function as a proxy to support replacing dynamic proxy elements (primary use case is for unit testing // via which can dynamically replace the prototype function reference) dynProtoProxy[DynProxyTag] = 1; return dynProtoProxy; } if (!_isObjectOrArrayPrototype(proto)) { var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {}; var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {}); // fetch and assign if as it may not exist yet // Set whether we are allow to lookup instances, if someone has set to false then do not re-enable if (instFuncTable[DynAllowInstChkTag] !== false) { instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc; } _forEachProp(target, function (name) { // Only add overridden functions if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) { // Save the instance Function to the lookup table and remove it from the instance as it's not a dynamic proto function instFuncs_1[name] = target[name]; delete target[name]; // Add a dynamic proto if one doesn't exist or if a prototype function exists and it's not a dynamic one if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) { proto[name] = _createDynamicPrototype(proto, name); } } }); } } /** * Checks whether the passed prototype object appears to be correct by walking the prototype hierarchy of the instance * @param classProto The class prototype instance * @param thisTarget The current instance that will be checked whether the passed prototype instance is in the hierarchy * @ignore */ function _checkPrototype(classProto, thisTarget) { // This method doesn't existing in older browsers (e.g. IE8) if (_objGetPrototypeOf) { // As this is primarily a coding time check, don't bother checking if running in IE8 or lower var visited = []; var thisProto = _getObjProto(thisTarget); while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) { if (thisProto === classProto) { return true; } // This avoids the caller from needing to check whether it's direct base class implements the function or not // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes. visited.push(thisProto); thisProto = _getObjProto(thisProto); } return false; } // If objGetPrototypeOf doesn't exist then just assume everything is ok. return true; } /** * Gets the current prototype name using the ES6 name if available otherwise falling back to a use unknown as the name. * It's not critical for this to return a name, it's used to decorate the generated unique name for easier debugging only. * @param target * @param unknownValue * @ignore */ function _getObjName(target, unknownValue) { if (_hasOwnProperty(target, Prototype)) { // Look like a prototype return target.name || unknownValue || UnknownValue; } return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue; } /** * Helper function when creating dynamic (inline) functions for classes, this helper performs the following tasks :- * - Saves references to all defined base class functions * - Calls the delegateFunc with the current target (this) and a base object reference that can be used to call all "super" functions. * - Will populate the class prototype for all overridden functions to support class extension that call the prototype instance. * Callers should use this helper when declaring all function within the constructor of a class, as mentioned above the delegateFunc is * passed both the target "this" and an object that can be used to call any base (super) functions, using this based object in place of * super.XXX() (which gets expanded to _super.prototype.XXX()) provides a better minification outcome and also ensures the correct "this" * context is maintained as TypeScript creates incorrect references using super.XXXX() for dynamically defined functions i.e. Functions * defined in the constructor or some other function (rather than declared as complete typescript functions). * ### Usage * ```typescript * import dynamicProto from "@microsoft/dynamicproto-js"; * class ExampleClass extends BaseClass { * constructor() { * dynamicProto(ExampleClass, this, (_self, base) => { * // This will define a function that will be converted to a prototype function * _self.newFunc = () => { * // Access any "this" instance property * if (_self.someProperty) { * ... * } * } * // This will define a function that will be converted to a prototype function * _self.myFunction = () => { * // Access any "this" instance property * if (_self.someProperty) { * // Call the base version of the function that we are overriding * base.myFunction(); * } * ... * } * _self.initialize = () => { * ... * } * // Warnings: While the following will work as _self is simply a reference to * // this, if anyone overrides myFunction() the overridden will be called first * // as the normal JavaScript method resolution will occur and the defined * // _self.initialize() function is actually gets removed from the instance and * // a proxy prototype version is created to reference the created method. * _self.initialize(); * }); * } * } * ``` * @typeparam DPType This is the generic type of the class, used to keep intellisense valid * @typeparam DPCls The type that contains the prototype of the current class * @param theClass - This is the current class instance which contains the prototype for the current class * @param target - The current "this" (target) reference, when the class has been extended this.prototype will not be the 'theClass' value. * @param delegateFunc - The callback function (closure) that will create the dynamic function * @param options - Additional options to configure how the dynamic prototype operates */ function dynamicProto(theClass, target, delegateFunc, options) { // Make sure that the passed theClass argument looks correct if (!_hasOwnProperty(theClass, Prototype)) { _throwTypeError("theClass is an invalid class definition."); } // Quick check to make sure that the passed theClass argument looks correct (this is a common copy/paste error) var classProto = theClass[Prototype]; if (!_checkPrototype(classProto, target)) { _throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]"); } var className = null; if (_hasOwnProperty(classProto, DynClassName)) { // Only grab the class name if it's defined on this prototype (i.e. don't walk the prototype chain) className = classProto[DynClassName]; } else { // As not all browser support name on the prototype creating a unique dynamic one if we have not already // assigned one, so we can use a simple string as the lookup rather than an object for the dynamic instance // function table lookup. className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _dynamicNames; _dynamicNames++; classProto[DynClassName] = className; } var perfOptions = dynamicProto[DynProtoDefaultOptions]; var useBaseInst = !!perfOptions[strUseBaseInst]; if (useBaseInst && options && options[strUseBaseInst] !== undefined) { useBaseInst = !!options[strUseBaseInst]; } // Get the current instance functions var instFuncs = _getInstanceFuncs(target); // Get all of the functions for any base instance (before they are potentially overridden) var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst); // Execute the delegate passing in both the current target "this" and "base" function references // Note casting the same type as we don't actually have the base class here and this will provide some intellisense support delegateFunc(target, baseFuncs); // Don't allow setting instance functions for older IE instances var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs]; if (setInstanceFunc && options) { setInstanceFunc = !!options[strSetInstFuncs]; } // Populate the Prototype for any overridden instance functions _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false); } /** * Exposes the default global options to allow global configuration, if the global values are disabled these will override * any passed values. This is primarily exposed to support unit-testing without the need for individual classes to expose * their internal usage of dynamic proto. */ var perfDefaults = { setInstFuncs: true, useBaseInst: true }; // And expose for testing dynamicProto[DynProtoDefaultOptions] = perfDefaults; export { dynamicProto as default };//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/dynamicproto-js/lib/dist/esm/dynamicproto-js.js.map /*! * Microsoft Dynamic Proto Utility, 1.1.6 * Copyright (c) Microsoft and contributors. All rights reserved. */ /** * Constant string defined to support minimization * @ignore */ var Constructor = 'constructor'; /** * Constant string defined to support minimization * @ignore */ var Prototype = 'prototype'; /** * Constant string defined to support minimization * @ignore */ var strFunction = 'function'; /** * Used to define the name of the instance function lookup table * @ignore */ var DynInstFuncTable = '_dynInstFuncs'; /** * Name used to tag the dynamic prototype function * @ignore */ var DynProxyTag = '_isDynProxy'; /** * Name added to a prototype to define the dynamic prototype "class" name used to lookup the function table * @ignore */ var DynClassName = '_dynClass'; /** * Prefix added to the classname to avoid any name clashes with other instance level properties * @ignore */ var DynClassNamePrefix = '_dynCls$'; /** * A tag which is used to check if we have already to attempted to set the instance function if one is not present * @ignore */ var DynInstChkTag = '_dynInstChk'; /** * A tag which is used to check if we are allows to try and set an instance function is one is not present. Using the same * tag name as the function level but a different const name for readability only. */ var DynAllowInstChkTag = DynInstChkTag; /** * The global (imported) instances where the global performance options are stored */ var DynProtoDefaultOptions = '_dfOpts'; /** * Value used as the name of a class when it cannot be determined * @ignore */ var UnknownValue = '_unknown_'; /** * Constant string defined to support minimization * @ignore */ var str__Proto = "__proto__"; /** * The polyfill version of __proto__ so that it doesn't cause issues for anyone not expecting it to exist */ var DynProtoBaseProto = "_dyn" + str__Proto; /** * Track the current prototype for IE8 as you can't look back to get the prototype */ var DynProtoCurrent = "_dynInstProto"; /** * Constant string defined to support minimization * @ignore */ var strUseBaseInst = 'useBaseInst'; /** * Constant string defined to support minimization * @ignore */ var strSetInstFuncs = 'setInstFuncs'; var Obj = Object; /** * Pre-lookup to check if we are running on a modern browser (i.e. not IE8) * @ignore */ var _objGetPrototypeOf = Obj["getPrototypeOf"]; /** * Pre-lookup to check for the existence of this function */ var _objGetOwnProps = Obj["getOwnPropertyNames"]; /** * Internal Global used to generate a unique dynamic class name, every new class will increase this value * @ignore */ var _dynamicNames = 0; /** * Helper to check if the object contains a property of the name * @ignore */ function _hasOwnProperty(obj, prop) { return obj && Obj[Prototype].hasOwnProperty.call(obj, prop); } /** * Helper used to check whether the target is an Object prototype or Array prototype * @ignore */ function _isObjectOrArrayPrototype(target) { return target && (target === Obj[Prototype] || target === Array[Prototype]); } /** * Helper used to check whether the target is an Object prototype, Array prototype or Function prototype * @ignore */ function _isObjectArrayOrFunctionPrototype(target) { return _isObjectOrArrayPrototype(target) || target === Function[Prototype]; } /** * Helper used to get the prototype of the target object as getPrototypeOf is not available in an ES3 environment. * @ignore */ function _getObjProto(target) { var newProto; if (target) { // This method doesn't exist in older browsers (e.g. IE8) if (_objGetPrototypeOf) { return _objGetPrototypeOf(target); } var curProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null); // Using the pre-calculated value as IE8 doesn't support looking up the prototype of a prototype and thus fails for more than 1 base class newProto = target[DynProtoBaseProto] || curProto; if (!_hasOwnProperty(target, DynProtoBaseProto)) { // As this prototype doesn't have this property then this is from an inherited class so newProto is the base to return so save it // so we can look it up value (which for a multiple hierarchy dynamicProto will be the base class) delete target[DynProtoCurrent]; // Delete any current value allocated to this instance so we pick up the value from prototype hierarchy newProto = target[DynProtoBaseProto] = target[DynProtoCurrent] || target[DynProtoBaseProto]; target[DynProtoCurrent] = curProto; } } return newProto; } /** * Helper to get the properties of an object, including none enumerable ones as functions on a prototype in ES6 * are not enumerable. * @param target */ function _forEachProp(target, func) { var props = []; if (_objGetOwnProps) { props = _objGetOwnProps(target); } else { for (var name_1 in target) { if (typeof name_1 === "string" && _hasOwnProperty(target, name_1)) { props.push(name_1); } } } if (props && props.length > 0) { for (var lp = 0; lp < props.length; lp++) { func(props[lp]); } } } /** * Helper function to check whether the provided function name is a potential candidate for dynamic * callback and prototype generation. * @param target The target object, may be a prototype or class object * @param funcName The function name * @param skipOwn Skips the check for own property * @ignore */ function _isDynamicCandidate(target, funcName, skipOwn) { return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName))); } /** * Helper to throw a TypeError exception * @param message the message * @ignore */ function _throwTypeError(message) { throw new TypeError("DynamicProto: " + message); } /** * Returns a collection of the instance functions that are defined directly on the thisTarget object, it does * not return any inherited functions * @param thisTarget The object to get the instance functions from * @ignore */ function _getInstanceFuncs(thisTarget) { // Get the base proto var instFuncs = {}; // Save any existing instance functions _forEachProp(thisTarget, function (name) { // Don't include any dynamic prototype instances - as we only want the real functions if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) { // Create an instance callback for passing the base function to the caller instFuncs[name] = thisTarget[name]; } }); return instFuncs; } /** * Returns whether the value is included in the array * @param values The array of values * @param value The value */ function _hasVisited(values, value) { for (var lp = values.length - 1; lp >= 0; lp--) { if (values[lp] === value) { return true; } } return false; } /** * Returns an object that contains callback functions for all "base/super" functions, this is used to "save" * enabling calling super.xxx() functions without requiring that the base "class" has defined a prototype references * @param target The current instance * @ignore */ function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) { function _instFuncProxy(target, funcHost, funcName) { var theFunc = funcHost[funcName]; if (theFunc[DynProxyTag] && useBaseInst) { // grab and reuse the hosted looking function (if available) otherwise the original passed function var instFuncTable = target[DynInstFuncTable] || {}; if (instFuncTable[DynAllowInstChkTag] !== false) { theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc; } } return function () { // eslint-disable-next-line prefer-rest-params return theFunc.apply(target, arguments); }; } // Start creating a new baseFuncs by creating proxies for the instance functions (as they may get replaced) var baseFuncs = {}; _forEachProp(instFuncs, function (name) { // Create an instance callback for passing the base function to the caller baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name); }); // Get the base prototype functions var baseProto = _getObjProto(classProto); var visited = []; // Don't include base object functions for Object, Array or Function while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) { // look for prototype functions _forEachProp(baseProto, function (name) { // Don't include any dynamic prototype instances - as we only want the real functions // For IE 7/8 the prototype lookup doesn't provide the full chain so we need to bypass the // hasOwnProperty check we get all of the methods, main difference is that IE7/8 doesn't return // the Object prototype methods while bypassing the check if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) { // Create an instance callback for passing the base function to the caller baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name); } }); // We need to find all possible functions that might be overloaded by walking the entire prototype chain // This avoids the caller from needing to check whether it's direct base class implements the function or not // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes. visited.push(baseProto); baseProto = _getObjProto(baseProto); } return baseFuncs; } function _getInstFunc(target, funcName, proto, currentDynProtoProxy) { var instFunc = null; // We need to check whether the class name is defined directly on this prototype otherwise // it will walk the proto chain and return any parent proto classname. if (target && _hasOwnProperty(proto, DynClassName)) { var instFuncTable = target[DynInstFuncTable] || {}; instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName]; if (!instFunc) { // Avoid stack overflow from recursive calling the same function _throwTypeError("Missing [" + funcName + "] " + strFunction); } // We have the instance function, lets check it we can speed up further calls // by adding the instance function back directly on the instance (avoiding the dynamic func lookup) if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) { // If the instance already has an instance function we can't replace it var canAddInst = !_hasOwnProperty(target, funcName); // Get current prototype var objProto = _getObjProto(target); var visited = []; // Lookup the function starting at the top (instance level prototype) and traverse down, if the first matching function // if nothing is found or if the first hit is a dynamic proto instance then we can safely add an instance shortcut while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) { var protoFunc = objProto[funcName]; if (protoFunc) { canAddInst = (protoFunc === currentDynProtoProxy); break; } // We need to find all possible initial functions to ensure that we don't bypass a valid override function visited.push(objProto); objProto = _getObjProto(objProto); } try { if (canAddInst) { // This instance doesn't have an instance func and the class hierarchy does have a higher level prototype version // so it's safe to directly assign for any subsequent calls (for better performance) target[funcName] = instFunc; } // Block further attempts to set the instance function for any instFunc[DynInstChkTag] = 1; } catch (e) { // Don't crash if the object is readonly or the runtime doesn't allow changing this // And set a flag so we don't try again for any function instFuncTable[DynAllowInstChkTag] = false; } } } return instFunc; } function _getProtoFunc(funcName, proto, currentDynProtoProxy) { var protoFunc = proto[funcName]; // Check that the prototype function is not a self reference -- try to avoid stack overflow! if (protoFunc === currentDynProtoProxy) { // It is so lookup the base prototype protoFunc = _getObjProto(proto)[funcName]; } if (typeof protoFunc !== strFunction) { _throwTypeError("[" + funcName + "] is not a " + strFunction); } return protoFunc; } /** * Add the required dynamic prototype methods to the the class prototype * @param proto - The class prototype * @param className - The instance classname * @param target - The target instance * @param baseInstFuncs - The base instance functions * @param setInstanceFunc - Flag to allow prototype function to reset the instance function if one does not exist * @ignore */ function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) { function _createDynamicPrototype(proto, funcName) { var dynProtoProxy = function () { // Use the instance or prototype function var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy); // eslint-disable-next-line prefer-rest-params return instFunc.apply(this, arguments); }; // Tag this function as a proxy to support replacing dynamic proxy elements (primary use case is for unit testing // via which can dynamically replace the prototype function reference) dynProtoProxy[DynProxyTag] = 1; return dynProtoProxy; } if (!_isObjectOrArrayPrototype(proto)) { var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {}; var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {}); // fetch and assign if as it may not exist yet // Set whether we are allow to lookup instances, if someone has set to false then do not re-enable if (instFuncTable[DynAllowInstChkTag] !== false) { instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc; } _forEachProp(target, function (name) { // Only add overridden functions if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) { // Save the instance Function to the lookup table and remove it from the instance as it's not a dynamic proto function instFuncs_1[name] = target[name]; delete target[name]; // Add a dynamic proto if one doesn't exist or if a prototype function exists and it's not a dynamic one if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) { proto[name] = _createDynamicPrototype(proto, name); } } }); } } /** * Checks whether the passed prototype object appears to be correct by walking the prototype hierarchy of the instance * @param classProto The class prototype instance * @param thisTarget The current instance that will be checked whether the passed prototype instance is in the hierarchy * @ignore */ function _checkPrototype(classProto, thisTarget) { // This method doesn't existing in older browsers (e.g. IE8) if (_objGetPrototypeOf) { // As this is primarily a coding time check, don't bother checking if running in IE8 or lower var visited = []; var thisProto = _getObjProto(thisTarget); while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) { if (thisProto === classProto) { return true; } // This avoids the caller from needing to check whether it's direct base class implements the function or not // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes. visited.push(thisProto); thisProto = _getObjProto(thisProto); } return false; } // If objGetPrototypeOf doesn't exist then just assume everything is ok. return true; } /** * Gets the current prototype name using the ES6 name if available otherwise falling back to a use unknown as the name. * It's not critical for this to return a name, it's used to decorate the generated unique name for easier debugging only. * @param target * @param unknownValue * @ignore */ function _getObjName(target, unknownValue) { if (_hasOwnProperty(target, Prototype)) { // Look like a prototype return target.name || unknownValue || UnknownValue; } return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue; } /** * Helper function when creating dynamic (inline) functions for classes, this helper performs the following tasks :- * - Saves references to all defined base class functions * - Calls the delegateFunc with the current target (this) and a base object reference that can be used to call all "super" functions. * - Will populate the class prototype for all overridden functions to support class extension that call the prototype instance. * Callers should use this helper when declaring all function within the constructor of a class, as mentioned above the delegateFunc is * passed both the target "this" and an object that can be used to call any base (super) functions, using this based object in place of * super.XXX() (which gets expanded to _super.prototype.XXX()) provides a better minification outcome and also ensures the correct "this" * context is maintained as TypeScript creates incorrect references using super.XXXX() for dynamically defined functions i.e. Functions * defined in the constructor or some other function (rather than declared as complete typescript functions). * ### Usage * ```typescript * import dynamicProto from "@microsoft/dynamicproto-js"; * class ExampleClass extends BaseClass { * constructor() { * dynamicProto(ExampleClass, this, (_self, base) => { * // This will define a function that will be converted to a prototype function * _self.newFunc = () => { * // Access any "this" instance property * if (_self.someProperty) { * ... * } * } * // This will define a function that will be converted to a prototype function * _self.myFunction = () => { * // Access any "this" instance property * if (_self.someProperty) { * // Call the base version of the function that we are overriding * base.myFunction(); * } * ... * } * _self.initialize = () => { * ... * } * // Warnings: While the following will work as _self is simply a reference to * // this, if anyone overrides myFunction() the overridden will be called first * // as the normal JavaScript method resolution will occur and the defined * // _self.initialize() function is actually gets removed from the instance and * // a proxy prototype version is created to reference the created method. * _self.initialize(); * }); * } * } * ``` * @typeparam DPType This is the generic type of the class, used to keep intellisense valid * @typeparam DPCls The type that contains the prototype of the current class * @param theClass - This is the current class instance which contains the prototype for the current class * @param target - The current "this" (target) reference, when the class has been extended this.prototype will not be the 'theClass' value. * @param delegateFunc - The callback function (closure) that will create the dynamic function * @param options - Additional options to configure how the dynamic prototype operates */ function dynamicProto(theClass, target, delegateFunc, options) { // Make sure that the passed theClass argument looks correct if (!_hasOwnProperty(theClass, Prototype)) { _throwTypeError("theClass is an invalid class definition."); } // Quick check to make sure that the passed theClass argument looks correct (this is a common copy/paste error) var classProto = theClass[Prototype]; if (!_checkPrototype(classProto, target)) { _throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]"); } var className = null; if (_hasOwnProperty(classProto, DynClassName)) { // Only grab the class name if it's defined on this prototype (i.e. don't walk the prototype chain) className = classProto[DynClassName]; } else { // As not all browser support name on the prototype creating a unique dynamic one if we have not already // assigned one, so we can use a simple string as the lookup rather than an object for the dynamic instance // function table lookup. className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _dynamicNames; _dynamicNames++; classProto[DynClassName] = className; } var perfOptions = dynamicProto[DynProtoDefaultOptions]; var useBaseInst = !!perfOptions[strUseBaseInst]; if (useBaseInst && options && options[strUseBaseInst] !== undefined) { useBaseInst = !!options[strUseBaseInst]; } // Get the current instance functions var instFuncs = _getInstanceFuncs(target); // Get all of the functions for any base instance (before they are potentially overridden) var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst); // Execute the delegate passing in both the current target "this" and "base" function references // Note casting the same type as we don't actually have the base class here and this will provide some intellisense support delegateFunc(target, baseFuncs); // Don't allow setting instance functions for older IE instances var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs]; if (setInstanceFunc && options) { setInstanceFunc = !!options[strSetInstFuncs]; } // Populate the Prototype for any overridden instance functions _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false); } /** * Exposes the default global options to allow global configuration, if the global values are disabled these will override * any passed values. This is primarily exposed to support unit-testing without the need for individual classes to expose * their internal usage of dynamic proto. */ var perfDefaults = { setInstFuncs: true, useBaseInst: true }; // And expose for testing dynamicProto[DynProtoDefaultOptions] = perfDefaults; export { dynamicProto as default };//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/dynamicproto-js/lib/dist/esm/dynamicproto-js.min.js.map /*! * Microsoft Dynamic Proto Utility, 1.1.6 * Copyright (c) Microsoft and contributors. All rights reserved. */ this.Microsoft = this.Microsoft || {}; this.Microsoft["DynamicProto-JS"] = (function () { 'use strict'; /** * Constant string defined to support minimization * @ignore */ var Constructor = 'constructor'; /** * Constant string defined to support minimization * @ignore */ var Prototype = 'prototype'; /** * Constant string defined to support minimization * @ignore */ var strFunction = 'function'; /** * Used to define the name of the instance function lookup table * @ignore */ var DynInstFuncTable = '_dynInstFuncs'; /** * Name used to tag the dynamic prototype function * @ignore */ var DynProxyTag = '_isDynProxy'; /** * Name added to a prototype to define the dynamic prototype "class" name used to lookup the function table * @ignore */ var DynClassName = '_dynClass'; /** * Prefix added to the classname to avoid any name clashes with other instance level properties * @ignore */ var DynClassNamePrefix = '_dynCls$'; /** * A tag which is used to check if we have already to attempted to set the instance function if one is not present * @ignore */ var DynInstChkTag = '_dynInstChk'; /** * A tag which is used to check if we are allows to try and set an instance function is one is not present. Using the same * tag name as the function level but a different const name for readability only. */ var DynAllowInstChkTag = DynInstChkTag; /** * The global (imported) instances where the global performance options are stored */ var DynProtoDefaultOptions = '_dfOpts'; /** * Value used as the name of a class when it cannot be determined * @ignore */ var UnknownValue = '_unknown_'; /** * Constant string defined to support minimization * @ignore */ var str__Proto = "__proto__"; /** * The polyfill version of __proto__ so that it doesn't cause issues for anyone not expecting it to exist */ var DynProtoBaseProto = "_dyn" + str__Proto; /** * Track the current prototype for IE8 as you can't look back to get the prototype */ var DynProtoCurrent = "_dynInstProto"; /** * Constant string defined to support minimization * @ignore */ var strUseBaseInst = 'useBaseInst'; /** * Constant string defined to support minimization * @ignore */ var strSetInstFuncs = 'setInstFuncs'; var Obj = Object; /** * Pre-lookup to check if we are running on a modern browser (i.e. not IE8) * @ignore */ var _objGetPrototypeOf = Obj["getPrototypeOf"]; /** * Pre-lookup to check for the existence of this function */ var _objGetOwnProps = Obj["getOwnPropertyNames"]; /** * Internal Global used to generate a unique dynamic class name, every new class will increase this value * @ignore */ var _dynamicNames = 0; /** * Helper to check if the object contains a property of the name * @ignore */ function _hasOwnProperty(obj, prop) { return obj && Obj[Prototype].hasOwnProperty.call(obj, prop); } /** * Helper used to check whether the target is an Object prototype or Array prototype * @ignore */ function _isObjectOrArrayPrototype(target) { return target && (target === Obj[Prototype] || target === Array[Prototype]); } /** * Helper used to check whether the target is an Object prototype, Array prototype or Function prototype * @ignore */ function _isObjectArrayOrFunctionPrototype(target) { return _isObjectOrArrayPrototype(target) || target === Function[Prototype]; } /** * Helper used to get the prototype of the target object as getPrototypeOf is not available in an ES3 environment. * @ignore */ function _getObjProto(target) { var newProto; if (target) { // This method doesn't exist in older browsers (e.g. IE8) if (_objGetPrototypeOf) { return _objGetPrototypeOf(target); } var curProto = target[str__Proto] || target[Prototype] || (target[Constructor] ? target[Constructor][Prototype] : null); // Using the pre-calculated value as IE8 doesn't support looking up the prototype of a prototype and thus fails for more than 1 base class newProto = target[DynProtoBaseProto] || curProto; if (!_hasOwnProperty(target, DynProtoBaseProto)) { // As this prototype doesn't have this property then this is from an inherited class so newProto is the base to return so save it // so we can look it up value (which for a multiple hierarchy dynamicProto will be the base class) delete target[DynProtoCurrent]; // Delete any current value allocated to this instance so we pick up the value from prototype hierarchy newProto = target[DynProtoBaseProto] = target[DynProtoCurrent] || target[DynProtoBaseProto]; target[DynProtoCurrent] = curProto; } } return newProto; } /** * Helper to get the properties of an object, including none enumerable ones as functions on a prototype in ES6 * are not enumerable. * @param target */ function _forEachProp(target, func) { var props = []; if (_objGetOwnProps) { props = _objGetOwnProps(target); } else { for (var name_1 in target) { if (typeof name_1 === "string" && _hasOwnProperty(target, name_1)) { props.push(name_1); } } } if (props && props.length > 0) { for (var lp = 0; lp < props.length; lp++) { func(props[lp]); } } } /** * Helper function to check whether the provided function name is a potential candidate for dynamic * callback and prototype generation. * @param target The target object, may be a prototype or class object * @param funcName The function name * @param skipOwn Skips the check for own property * @ignore */ function _isDynamicCandidate(target, funcName, skipOwn) { return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName))); } /** * Helper to throw a TypeError exception * @param message the message * @ignore */ function _throwTypeError(message) { throw new TypeError("DynamicProto: " + message); } /** * Returns a collection of the instance functions that are defined directly on the thisTarget object, it does * not return any inherited functions * @param thisTarget The object to get the instance functions from * @ignore */ function _getInstanceFuncs(thisTarget) { // Get the base proto var instFuncs = {}; // Save any existing instance functions _forEachProp(thisTarget, function (name) { // Don't include any dynamic prototype instances - as we only want the real functions if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) { // Create an instance callback for passing the base function to the caller instFuncs[name] = thisTarget[name]; } }); return instFuncs; } /** * Returns whether the value is included in the array * @param values The array of values * @param value The value */ function _hasVisited(values, value) { for (var lp = values.length - 1; lp >= 0; lp--) { if (values[lp] === value) { return true; } } return false; } /** * Returns an object that contains callback functions for all "base/super" functions, this is used to "save" * enabling calling super.xxx() functions without requiring that the base "class" has defined a prototype references * @param target The current instance * @ignore */ function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) { function _instFuncProxy(target, funcHost, funcName) { var theFunc = funcHost[funcName]; if (theFunc[DynProxyTag] && useBaseInst) { // grab and reuse the hosted looking function (if available) otherwise the original passed function var instFuncTable = target[DynInstFuncTable] || {}; if (instFuncTable[DynAllowInstChkTag] !== false) { theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc; } } return function () { // eslint-disable-next-line prefer-rest-params return theFunc.apply(target, arguments); }; } // Start creating a new baseFuncs by creating proxies for the instance functions (as they may get replaced) var baseFuncs = {}; _forEachProp(instFuncs, function (name) { // Create an instance callback for passing the base function to the caller baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name); }); // Get the base prototype functions var baseProto = _getObjProto(classProto); var visited = []; // Don't include base object functions for Object, Array or Function while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) { // look for prototype functions _forEachProp(baseProto, function (name) { // Don't include any dynamic prototype instances - as we only want the real functions // For IE 7/8 the prototype lookup doesn't provide the full chain so we need to bypass the // hasOwnProperty check we get all of the methods, main difference is that IE7/8 doesn't return // the Object prototype methods while bypassing the check if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) { // Create an instance callback for passing the base function to the caller baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name); } }); // We need to find all possible functions that might be overloaded by walking the entire prototype chain // This avoids the caller from needing to check whether it's direct base class implements the function or not // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes. visited.push(baseProto); baseProto = _getObjProto(baseProto); } return baseFuncs; } function _getInstFunc(target, funcName, proto, currentDynProtoProxy) { var instFunc = null; // We need to check whether the class name is defined directly on this prototype otherwise // it will walk the proto chain and return any parent proto classname. if (target && _hasOwnProperty(proto, DynClassName)) { var instFuncTable = target[DynInstFuncTable] || {}; instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName]; if (!instFunc) { // Avoid stack overflow from recursive calling the same function _throwTypeError("Missing [" + funcName + "] " + strFunction); } // We have the instance function, lets check it we can speed up further calls // by adding the instance function back directly on the instance (avoiding the dynamic func lookup) if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) { // If the instance already has an instance function we can't replace it var canAddInst = !_hasOwnProperty(target, funcName); // Get current prototype var objProto = _getObjProto(target); var visited = []; // Lookup the function starting at the top (instance level prototype) and traverse down, if the first matching function // if nothing is found or if the first hit is a dynamic proto instance then we can safely add an instance shortcut while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) { var protoFunc = objProto[funcName]; if (protoFunc) { canAddInst = (protoFunc === currentDynProtoProxy); break; } // We need to find all possible initial functions to ensure that we don't bypass a valid override function visited.push(objProto); objProto = _getObjProto(objProto); } try { if (canAddInst) { // This instance doesn't have an instance func and the class hierarchy does have a higher level prototype version // so it's safe to directly assign for any subsequent calls (for better performance) target[funcName] = instFunc; } // Block further attempts to set the instance function for any instFunc[DynInstChkTag] = 1; } catch (e) { // Don't crash if the object is readonly or the runtime doesn't allow changing this // And set a flag so we don't try again for any function instFuncTable[DynAllowInstChkTag] = false; } } } return instFunc; } function _getProtoFunc(funcName, proto, currentDynProtoProxy) { var protoFunc = proto[funcName]; // Check that the prototype function is not a self reference -- try to avoid stack overflow! if (protoFunc === currentDynProtoProxy) { // It is so lookup the base prototype protoFunc = _getObjProto(proto)[funcName]; } if (typeof protoFunc !== strFunction) { _throwTypeError("[" + funcName + "] is not a " + strFunction); } return protoFunc; } /** * Add the required dynamic prototype methods to the the class prototype * @param proto - The class prototype * @param className - The instance classname * @param target - The target instance * @param baseInstFuncs - The base instance functions * @param setInstanceFunc - Flag to allow prototype function to reset the instance function if one does not exist * @ignore */ function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) { function _createDynamicPrototype(proto, funcName) { var dynProtoProxy = function () { // Use the instance or prototype function var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy); // eslint-disable-next-line prefer-rest-params return instFunc.apply(this, arguments); }; // Tag this function as a proxy to support replacing dynamic proxy elements (primary use case is for unit testing // via which can dynamically replace the prototype function reference) dynProtoProxy[DynProxyTag] = 1; return dynProtoProxy; } if (!_isObjectOrArrayPrototype(proto)) { var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {}; var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {}); // fetch and assign if as it may not exist yet // Set whether we are allow to lookup instances, if someone has set to false then do not re-enable if (instFuncTable[DynAllowInstChkTag] !== false) { instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc; } _forEachProp(target, function (name) { // Only add overridden functions if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) { // Save the instance Function to the lookup table and remove it from the instance as it's not a dynamic proto function instFuncs_1[name] = target[name]; delete target[name]; // Add a dynamic proto if one doesn't exist or if a prototype function exists and it's not a dynamic one if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) { proto[name] = _createDynamicPrototype(proto, name); } } }); } } /** * Checks whether the passed prototype object appears to be correct by walking the prototype hierarchy of the instance * @param classProto The class prototype instance * @param thisTarget The current instance that will be checked whether the passed prototype instance is in the hierarchy * @ignore */ function _checkPrototype(classProto, thisTarget) { // This method doesn't existing in older browsers (e.g. IE8) if (_objGetPrototypeOf) { // As this is primarily a coding time check, don't bother checking if running in IE8 or lower var visited = []; var thisProto = _getObjProto(thisTarget); while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) { if (thisProto === classProto) { return true; } // This avoids the caller from needing to check whether it's direct base class implements the function or not // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes. visited.push(thisProto); thisProto = _getObjProto(thisProto); } return false; } // If objGetPrototypeOf doesn't exist then just assume everything is ok. return true; } /** * Gets the current prototype name using the ES6 name if available otherwise falling back to a use unknown as the name. * It's not critical for this to return a name, it's used to decorate the generated unique name for easier debugging only. * @param target * @param unknownValue * @ignore */ function _getObjName(target, unknownValue) { if (_hasOwnProperty(target, Prototype)) { // Look like a prototype return target.name || unknownValue || UnknownValue; } return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue; } /** * Helper function when creating dynamic (inline) functions for classes, this helper performs the following tasks :- * - Saves references to all defined base class functions * - Calls the delegateFunc with the current target (this) and a base object reference that can be used to call all "super" functions. * - Will populate the class prototype for all overridden functions to support class extension that call the prototype instance. * Callers should use this helper when declaring all function within the constructor of a class, as mentioned above the delegateFunc is * passed both the target "this" and an object that can be used to call any base (super) functions, using this based object in place of * super.XXX() (which gets expanded to _super.prototype.XXX()) provides a better minification outcome and also ensures the correct "this" * context is maintained as TypeScript creates incorrect references using super.XXXX() for dynamically defined functions i.e. Functions * defined in the constructor or some other function (rather than declared as complete typescript functions). * ### Usage * ```typescript * import dynamicProto from "@microsoft/dynamicproto-js"; * class ExampleClass extends BaseClass { * constructor() { * dynamicProto(ExampleClass, this, (_self, base) => { * // This will define a function that will be converted to a prototype function * _self.newFunc = () => { * // Access any "this" instance property * if (_self.someProperty) { * ... * } * } * // This will define a function that will be converted to a prototype function * _self.myFunction = () => { * // Access any "this" instance property * if (_self.someProperty) { * // Call the base version of the function that we are overriding * base.myFunction(); * } * ... * } * _self.initialize = () => { * ... * } * // Warnings: While the following will work as _self is simply a reference to * // this, if anyone overrides myFunction() the overridden will be called first * // as the normal JavaScript method resolution will occur and the defined * // _self.initialize() function is actually gets removed from the instance and * // a proxy prototype version is created to reference the created method. * _self.initialize(); * }); * } * } * ``` * @typeparam DPType This is the generic type of the class, used to keep intellisense valid * @typeparam DPCls The type that contains the prototype of the current class * @param theClass - This is the current class instance which contains the prototype for the current class * @param target - The current "this" (target) reference, when the class has been extended this.prototype will not be the 'theClass' value. * @param delegateFunc - The callback function (closure) that will create the dynamic function * @param options - Additional options to configure how the dynamic prototype operates */ function dynamicProto(theClass, target, delegateFunc, options) { // Make sure that the passed theClass argument looks correct if (!_hasOwnProperty(theClass, Prototype)) { _throwTypeError("theClass is an invalid class definition."); } // Quick check to make sure that the passed theClass argument looks correct (this is a common copy/paste error) var classProto = theClass[Prototype]; if (!_checkPrototype(classProto, target)) { _throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]"); } var className = null; if (_hasOwnProperty(classProto, DynClassName)) { // Only grab the class name if it's defined on this prototype (i.e. don't walk the prototype chain) className = classProto[DynClassName]; } else { // As not all browser support name on the prototype creating a unique dynamic one if we have not already // assigned one, so we can use a simple string as the lookup rather than an object for the dynamic instance // function table lookup. className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _dynamicNames; _dynamicNames++; classProto[DynClassName] = className; } var perfOptions = dynamicProto[DynProtoDefaultOptions]; var useBaseInst = !!perfOptions[strUseBaseInst]; if (useBaseInst && options && options[strUseBaseInst] !== undefined) { useBaseInst = !!options[strUseBaseInst]; } // Get the current instance functions var instFuncs = _getInstanceFuncs(target); // Get all of the functions for any base instance (before they are potentially overridden) var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst); // Execute the delegate passing in both the current target "this" and "base" function references // Note casting the same type as we don't actually have the base class here and this will provide some intellisense support delegateFunc(target, baseFuncs); // Don't allow setting instance functions for older IE instances var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs]; if (setInstanceFunc && options) { setInstanceFunc = !!options[strSetInstFuncs]; } // Populate the Prototype for any overridden instance functions _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false); } /** * Exposes the default global options to allow global configuration, if the global values are disabled these will override * any passed values. This is primarily exposed to support unit-testing without the need for individual classes to expose * their internal usage of dynamic proto. */ var perfDefaults = { setInstFuncs: true, useBaseInst: true }; // And expose for testing dynamicProto[DynProtoDefaultOptions] = perfDefaults; return dynamicProto; })();//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/dynamicproto-js/lib/dist/iife/dynamicproto-js.js.map /*! * Microsoft Dynamic Proto Utility, 1.1.6 * Copyright (c) Microsoft and contributors. All rights reserved. */ this.Microsoft=this.Microsoft||{},this.Microsoft["DynamicProto-JS"]=function(){"use strict";var o="constructor",p="prototype",v="function",_="_dynInstFuncs",d="_isDynProxy",g="_dynClass",I="_dynInstChk",P=I,m="_dfOpts",r="_unknown_",i="__proto__",e="_dyn"+i,u="_dynInstProto",w="useBaseInst",O="setInstFuncs",s=Object,C=s.getPrototypeOf,f=s.getOwnPropertyNames,F=0;function M(n,t){return n&&s[p].hasOwnProperty.call(n,t)}function k(n){return n&&(n===s[p]||n===Array[p])}function D(n){return k(n)||n===Function[p]}function b(n){if(n){if(C)return C(n);var t=n[i]||n[p]||(n[o]?n[o][p]:null),r=n[e]||t;M(n,e)||(delete n[u],r=n[e]=n[u]||n[e],n[u]=t)}return r}function B(n,t){var r=[];if(f)r=f(n);else for(var o in n)"string"==typeof o&&M(n,o)&&r.push(o);if(r&&0 0) { for (var lp = 0; lp < props.length; lp++) { func(props[lp]); } } } /** * Helper function to check whether the provided function name is a potential candidate for dynamic * callback and prototype generation. * @param target The target object, may be a prototype or class object * @param funcName The function name * @param skipOwn Skips the check for own property * @ignore */ function _isDynamicCandidate(target, funcName, skipOwn) { return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName))); } /** * Helper to throw a TypeError exception * @param message the message * @ignore */ function _throwTypeError(message) { throw new TypeError("DynamicProto: " + message); } /** * Returns a collection of the instance functions that are defined directly on the thisTarget object, it does * not return any inherited functions * @param thisTarget The object to get the instance functions from * @ignore */ function _getInstanceFuncs(thisTarget) { // Get the base proto var instFuncs = {}; // Save any existing instance functions _forEachProp(thisTarget, function (name) { // Don't include any dynamic prototype instances - as we only want the real functions if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) { // Create an instance callback for passing the base function to the caller instFuncs[name] = thisTarget[name]; } }); return instFuncs; } /** * Returns whether the value is included in the array * @param values The array of values * @param value The value */ function _hasVisited(values, value) { for (var lp = values.length - 1; lp >= 0; lp--) { if (values[lp] === value) { return true; } } return false; } /** * Returns an object that contains callback functions for all "base/super" functions, this is used to "save" * enabling calling super.xxx() functions without requiring that the base "class" has defined a prototype references * @param target The current instance * @ignore */ function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) { function _instFuncProxy(target, funcHost, funcName) { var theFunc = funcHost[funcName]; if (theFunc[DynProxyTag] && useBaseInst) { // grab and reuse the hosted looking function (if available) otherwise the original passed function var instFuncTable = target[DynInstFuncTable] || {}; if (instFuncTable[DynAllowInstChkTag] !== false) { theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc; } } return function () { // eslint-disable-next-line prefer-rest-params return theFunc.apply(target, arguments); }; } // Start creating a new baseFuncs by creating proxies for the instance functions (as they may get replaced) var baseFuncs = {}; _forEachProp(instFuncs, function (name) { // Create an instance callback for passing the base function to the caller baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name); }); // Get the base prototype functions var baseProto = _getObjProto(classProto); var visited = []; // Don't include base object functions for Object, Array or Function while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) { // look for prototype functions _forEachProp(baseProto, function (name) { // Don't include any dynamic prototype instances - as we only want the real functions // For IE 7/8 the prototype lookup doesn't provide the full chain so we need to bypass the // hasOwnProperty check we get all of the methods, main difference is that IE7/8 doesn't return // the Object prototype methods while bypassing the check if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) { // Create an instance callback for passing the base function to the caller baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name); } }); // We need to find all possible functions that might be overloaded by walking the entire prototype chain // This avoids the caller from needing to check whether it's direct base class implements the function or not // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes. visited.push(baseProto); baseProto = _getObjProto(baseProto); } return baseFuncs; } function _getInstFunc(target, funcName, proto, currentDynProtoProxy) { var instFunc = null; // We need to check whether the class name is defined directly on this prototype otherwise // it will walk the proto chain and return any parent proto classname. if (target && _hasOwnProperty(proto, DynClassName)) { var instFuncTable = target[DynInstFuncTable] || {}; instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName]; if (!instFunc) { // Avoid stack overflow from recursive calling the same function _throwTypeError("Missing [" + funcName + "] " + strFunction); } // We have the instance function, lets check it we can speed up further calls // by adding the instance function back directly on the instance (avoiding the dynamic func lookup) if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) { // If the instance already has an instance function we can't replace it var canAddInst = !_hasOwnProperty(target, funcName); // Get current prototype var objProto = _getObjProto(target); var visited = []; // Lookup the function starting at the top (instance level prototype) and traverse down, if the first matching function // if nothing is found or if the first hit is a dynamic proto instance then we can safely add an instance shortcut while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) { var protoFunc = objProto[funcName]; if (protoFunc) { canAddInst = (protoFunc === currentDynProtoProxy); break; } // We need to find all possible initial functions to ensure that we don't bypass a valid override function visited.push(objProto); objProto = _getObjProto(objProto); } try { if (canAddInst) { // This instance doesn't have an instance func and the class hierarchy does have a higher level prototype version // so it's safe to directly assign for any subsequent calls (for better performance) target[funcName] = instFunc; } // Block further attempts to set the instance function for any instFunc[DynInstChkTag] = 1; } catch (e) { // Don't crash if the object is readonly or the runtime doesn't allow changing this // And set a flag so we don't try again for any function instFuncTable[DynAllowInstChkTag] = false; } } } return instFunc; } function _getProtoFunc(funcName, proto, currentDynProtoProxy) { var protoFunc = proto[funcName]; // Check that the prototype function is not a self reference -- try to avoid stack overflow! if (protoFunc === currentDynProtoProxy) { // It is so lookup the base prototype protoFunc = _getObjProto(proto)[funcName]; } if (typeof protoFunc !== strFunction) { _throwTypeError("[" + funcName + "] is not a " + strFunction); } return protoFunc; } /** * Add the required dynamic prototype methods to the the class prototype * @param proto - The class prototype * @param className - The instance classname * @param target - The target instance * @param baseInstFuncs - The base instance functions * @param setInstanceFunc - Flag to allow prototype function to reset the instance function if one does not exist * @ignore */ function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) { function _createDynamicPrototype(proto, funcName) { var dynProtoProxy = function () { // Use the instance or prototype function var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy); // eslint-disable-next-line prefer-rest-params return instFunc.apply(this, arguments); }; // Tag this function as a proxy to support replacing dynamic proxy elements (primary use case is for unit testing // via which can dynamically replace the prototype function reference) dynProtoProxy[DynProxyTag] = 1; return dynProtoProxy; } if (!_isObjectOrArrayPrototype(proto)) { var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {}; var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {}); // fetch and assign if as it may not exist yet // Set whether we are allow to lookup instances, if someone has set to false then do not re-enable if (instFuncTable[DynAllowInstChkTag] !== false) { instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc; } _forEachProp(target, function (name) { // Only add overridden functions if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) { // Save the instance Function to the lookup table and remove it from the instance as it's not a dynamic proto function instFuncs_1[name] = target[name]; delete target[name]; // Add a dynamic proto if one doesn't exist or if a prototype function exists and it's not a dynamic one if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) { proto[name] = _createDynamicPrototype(proto, name); } } }); } } /** * Checks whether the passed prototype object appears to be correct by walking the prototype hierarchy of the instance * @param classProto The class prototype instance * @param thisTarget The current instance that will be checked whether the passed prototype instance is in the hierarchy * @ignore */ function _checkPrototype(classProto, thisTarget) { // This method doesn't existing in older browsers (e.g. IE8) if (_objGetPrototypeOf) { // As this is primarily a coding time check, don't bother checking if running in IE8 or lower var visited = []; var thisProto = _getObjProto(thisTarget); while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) { if (thisProto === classProto) { return true; } // This avoids the caller from needing to check whether it's direct base class implements the function or not // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes. visited.push(thisProto); thisProto = _getObjProto(thisProto); } return false; } // If objGetPrototypeOf doesn't exist then just assume everything is ok. return true; } /** * Gets the current prototype name using the ES6 name if available otherwise falling back to a use unknown as the name. * It's not critical for this to return a name, it's used to decorate the generated unique name for easier debugging only. * @param target * @param unknownValue * @ignore */ function _getObjName(target, unknownValue) { if (_hasOwnProperty(target, Prototype)) { // Look like a prototype return target.name || unknownValue || UnknownValue; } return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue; } /** * Helper function when creating dynamic (inline) functions for classes, this helper performs the following tasks :- * - Saves references to all defined base class functions * - Calls the delegateFunc with the current target (this) and a base object reference that can be used to call all "super" functions. * - Will populate the class prototype for all overridden functions to support class extension that call the prototype instance. * Callers should use this helper when declaring all function within the constructor of a class, as mentioned above the delegateFunc is * passed both the target "this" and an object that can be used to call any base (super) functions, using this based object in place of * super.XXX() (which gets expanded to _super.prototype.XXX()) provides a better minification outcome and also ensures the correct "this" * context is maintained as TypeScript creates incorrect references using super.XXXX() for dynamically defined functions i.e. Functions * defined in the constructor or some other function (rather than declared as complete typescript functions). * ### Usage * ```typescript * import dynamicProto from "@microsoft/dynamicproto-js"; * class ExampleClass extends BaseClass { * constructor() { * dynamicProto(ExampleClass, this, (_self, base) => { * // This will define a function that will be converted to a prototype function * _self.newFunc = () => { * // Access any "this" instance property * if (_self.someProperty) { * ... * } * } * // This will define a function that will be converted to a prototype function * _self.myFunction = () => { * // Access any "this" instance property * if (_self.someProperty) { * // Call the base version of the function that we are overriding * base.myFunction(); * } * ... * } * _self.initialize = () => { * ... * } * // Warnings: While the following will work as _self is simply a reference to * // this, if anyone overrides myFunction() the overridden will be called first * // as the normal JavaScript method resolution will occur and the defined * // _self.initialize() function is actually gets removed from the instance and * // a proxy prototype version is created to reference the created method. * _self.initialize(); * }); * } * } * ``` * @typeparam DPType This is the generic type of the class, used to keep intellisense valid * @typeparam DPCls The type that contains the prototype of the current class * @param theClass - This is the current class instance which contains the prototype for the current class * @param target - The current "this" (target) reference, when the class has been extended this.prototype will not be the 'theClass' value. * @param delegateFunc - The callback function (closure) that will create the dynamic function * @param options - Additional options to configure how the dynamic prototype operates */ function dynamicProto(theClass, target, delegateFunc, options) { // Make sure that the passed theClass argument looks correct if (!_hasOwnProperty(theClass, Prototype)) { _throwTypeError("theClass is an invalid class definition."); } // Quick check to make sure that the passed theClass argument looks correct (this is a common copy/paste error) var classProto = theClass[Prototype]; if (!_checkPrototype(classProto, target)) { _throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]"); } var className = null; if (_hasOwnProperty(classProto, DynClassName)) { // Only grab the class name if it's defined on this prototype (i.e. don't walk the prototype chain) className = classProto[DynClassName]; } else { // As not all browser support name on the prototype creating a unique dynamic one if we have not already // assigned one, so we can use a simple string as the lookup rather than an object for the dynamic instance // function table lookup. className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _dynamicNames; _dynamicNames++; classProto[DynClassName] = className; } var perfOptions = dynamicProto[DynProtoDefaultOptions]; var useBaseInst = !!perfOptions[strUseBaseInst]; if (useBaseInst && options && options[strUseBaseInst] !== undefined) { useBaseInst = !!options[strUseBaseInst]; } // Get the current instance functions var instFuncs = _getInstanceFuncs(target); // Get all of the functions for any base instance (before they are potentially overridden) var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst); // Execute the delegate passing in both the current target "this" and "base" function references // Note casting the same type as we don't actually have the base class here and this will provide some intellisense support delegateFunc(target, baseFuncs); // Don't allow setting instance functions for older IE instances var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs]; if (setInstanceFunc && options) { setInstanceFunc = !!options[strSetInstFuncs]; } // Populate the Prototype for any overridden instance functions _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false); } /** * Exposes the default global options to allow global configuration, if the global values are disabled these will override * any passed values. This is primarily exposed to support unit-testing without the need for individual classes to expose * their internal usage of dynamic proto. */ var perfDefaults = { setInstFuncs: true, useBaseInst: true }; // And expose for testing dynamicProto[DynProtoDefaultOptions] = perfDefaults; module.exports = dynamicProto;//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/dynamicproto-js/lib/dist/cjs/dynamicproto-js.js.map /*! * Microsoft Dynamic Proto Utility, 1.1.6 * Copyright (c) Microsoft and contributors. All rights reserved. */ "use strict";var e="constructor",v="prototype",h="function",_="_dynInstFuncs",d="_isDynProxy",g="_dynClass",I="_dynInstChk",P=I,m="_dfOpts",r="_unknown_",o="__proto__",u="_dyn"+o,i="_dynInstProto",w="useBaseInst",O="setInstFuncs",s=Object,C=s.getPrototypeOf,f=s.getOwnPropertyNames,F=0;function k(n,t){return n&&s[v].hasOwnProperty.call(n,t)}function b(n){return n&&(n===s[v]||n===Array[v])}function x(n){return b(n)||n===Function[v]}function B(n){if(n){if(C)return C(n);var t=n[o]||n[v]||(n[e]?n[e][v]:null),r=n[u]||t;k(n,u)||(delete n[i],r=n[u]=n[i]||n[u],n[i]=t)}return r}function D(n,t){var r=[];if(f)r=f(n);else for(var e in n)"string"==typeof e&&k(n,e)&&r.push(e);if(r&&0 0) { for (var lp = 0; lp < props.length; lp++) { func(props[lp]); } } } /** * Helper function to check whether the provided function name is a potential candidate for dynamic * callback and prototype generation. * @param target The target object, may be a prototype or class object * @param funcName The function name * @param skipOwn Skips the check for own property * @ignore */ function _isDynamicCandidate(target, funcName, skipOwn) { return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName))); } /** * Helper to throw a TypeError exception * @param message the message * @ignore */ function _throwTypeError(message) { throw new TypeError("DynamicProto: " + message); } /** * Returns a collection of the instance functions that are defined directly on the thisTarget object, it does * not return any inherited functions * @param thisTarget The object to get the instance functions from * @ignore */ function _getInstanceFuncs(thisTarget) { // Get the base proto var instFuncs = {}; // Save any existing instance functions _forEachProp(thisTarget, function (name) { // Don't include any dynamic prototype instances - as we only want the real functions if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) { // Create an instance callback for passing the base function to the caller instFuncs[name] = thisTarget[name]; } }); return instFuncs; } /** * Returns whether the value is included in the array * @param values The array of values * @param value The value */ function _hasVisited(values, value) { for (var lp = values.length - 1; lp >= 0; lp--) { if (values[lp] === value) { return true; } } return false; } /** * Returns an object that contains callback functions for all "base/super" functions, this is used to "save" * enabling calling super.xxx() functions without requiring that the base "class" has defined a prototype references * @param target The current instance * @ignore */ function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) { function _instFuncProxy(target, funcHost, funcName) { var theFunc = funcHost[funcName]; if (theFunc[DynProxyTag] && useBaseInst) { // grab and reuse the hosted looking function (if available) otherwise the original passed function var instFuncTable = target[DynInstFuncTable] || {}; if (instFuncTable[DynAllowInstChkTag] !== false) { theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc; } } return function () { // eslint-disable-next-line prefer-rest-params return theFunc.apply(target, arguments); }; } // Start creating a new baseFuncs by creating proxies for the instance functions (as they may get replaced) var baseFuncs = {}; _forEachProp(instFuncs, function (name) { // Create an instance callback for passing the base function to the caller baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name); }); // Get the base prototype functions var baseProto = _getObjProto(classProto); var visited = []; // Don't include base object functions for Object, Array or Function while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) { // look for prototype functions _forEachProp(baseProto, function (name) { // Don't include any dynamic prototype instances - as we only want the real functions // For IE 7/8 the prototype lookup doesn't provide the full chain so we need to bypass the // hasOwnProperty check we get all of the methods, main difference is that IE7/8 doesn't return // the Object prototype methods while bypassing the check if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) { // Create an instance callback for passing the base function to the caller baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name); } }); // We need to find all possible functions that might be overloaded by walking the entire prototype chain // This avoids the caller from needing to check whether it's direct base class implements the function or not // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes. visited.push(baseProto); baseProto = _getObjProto(baseProto); } return baseFuncs; } function _getInstFunc(target, funcName, proto, currentDynProtoProxy) { var instFunc = null; // We need to check whether the class name is defined directly on this prototype otherwise // it will walk the proto chain and return any parent proto classname. if (target && _hasOwnProperty(proto, DynClassName)) { var instFuncTable = target[DynInstFuncTable] || {}; instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName]; if (!instFunc) { // Avoid stack overflow from recursive calling the same function _throwTypeError("Missing [" + funcName + "] " + strFunction); } // We have the instance function, lets check it we can speed up further calls // by adding the instance function back directly on the instance (avoiding the dynamic func lookup) if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) { // If the instance already has an instance function we can't replace it var canAddInst = !_hasOwnProperty(target, funcName); // Get current prototype var objProto = _getObjProto(target); var visited = []; // Lookup the function starting at the top (instance level prototype) and traverse down, if the first matching function // if nothing is found or if the first hit is a dynamic proto instance then we can safely add an instance shortcut while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) { var protoFunc = objProto[funcName]; if (protoFunc) { canAddInst = (protoFunc === currentDynProtoProxy); break; } // We need to find all possible initial functions to ensure that we don't bypass a valid override function visited.push(objProto); objProto = _getObjProto(objProto); } try { if (canAddInst) { // This instance doesn't have an instance func and the class hierarchy does have a higher level prototype version // so it's safe to directly assign for any subsequent calls (for better performance) target[funcName] = instFunc; } // Block further attempts to set the instance function for any instFunc[DynInstChkTag] = 1; } catch (e) { // Don't crash if the object is readonly or the runtime doesn't allow changing this // And set a flag so we don't try again for any function instFuncTable[DynAllowInstChkTag] = false; } } } return instFunc; } function _getProtoFunc(funcName, proto, currentDynProtoProxy) { var protoFunc = proto[funcName]; // Check that the prototype function is not a self reference -- try to avoid stack overflow! if (protoFunc === currentDynProtoProxy) { // It is so lookup the base prototype protoFunc = _getObjProto(proto)[funcName]; } if (typeof protoFunc !== strFunction) { _throwTypeError("[" + funcName + "] is not a " + strFunction); } return protoFunc; } /** * Add the required dynamic prototype methods to the the class prototype * @param proto - The class prototype * @param className - The instance classname * @param target - The target instance * @param baseInstFuncs - The base instance functions * @param setInstanceFunc - Flag to allow prototype function to reset the instance function if one does not exist * @ignore */ function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) { function _createDynamicPrototype(proto, funcName) { var dynProtoProxy = function () { // Use the instance or prototype function var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy); // eslint-disable-next-line prefer-rest-params return instFunc.apply(this, arguments); }; // Tag this function as a proxy to support replacing dynamic proxy elements (primary use case is for unit testing // via which can dynamically replace the prototype function reference) dynProtoProxy[DynProxyTag] = 1; return dynProtoProxy; } if (!_isObjectOrArrayPrototype(proto)) { var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {}; var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {}); // fetch and assign if as it may not exist yet // Set whether we are allow to lookup instances, if someone has set to false then do not re-enable if (instFuncTable[DynAllowInstChkTag] !== false) { instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc; } _forEachProp(target, function (name) { // Only add overridden functions if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) { // Save the instance Function to the lookup table and remove it from the instance as it's not a dynamic proto function instFuncs_1[name] = target[name]; delete target[name]; // Add a dynamic proto if one doesn't exist or if a prototype function exists and it's not a dynamic one if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) { proto[name] = _createDynamicPrototype(proto, name); } } }); } } /** * Checks whether the passed prototype object appears to be correct by walking the prototype hierarchy of the instance * @param classProto The class prototype instance * @param thisTarget The current instance that will be checked whether the passed prototype instance is in the hierarchy * @ignore */ function _checkPrototype(classProto, thisTarget) { // This method doesn't existing in older browsers (e.g. IE8) if (_objGetPrototypeOf) { // As this is primarily a coding time check, don't bother checking if running in IE8 or lower var visited = []; var thisProto = _getObjProto(thisTarget); while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) { if (thisProto === classProto) { return true; } // This avoids the caller from needing to check whether it's direct base class implements the function or not // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes. visited.push(thisProto); thisProto = _getObjProto(thisProto); } return false; } // If objGetPrototypeOf doesn't exist then just assume everything is ok. return true; } /** * Gets the current prototype name using the ES6 name if available otherwise falling back to a use unknown as the name. * It's not critical for this to return a name, it's used to decorate the generated unique name for easier debugging only. * @param target * @param unknownValue * @ignore */ function _getObjName(target, unknownValue) { if (_hasOwnProperty(target, Prototype)) { // Look like a prototype return target.name || unknownValue || UnknownValue; } return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue; } /** * Helper function when creating dynamic (inline) functions for classes, this helper performs the following tasks :- * - Saves references to all defined base class functions * - Calls the delegateFunc with the current target (this) and a base object reference that can be used to call all "super" functions. * - Will populate the class prototype for all overridden functions to support class extension that call the prototype instance. * Callers should use this helper when declaring all function within the constructor of a class, as mentioned above the delegateFunc is * passed both the target "this" and an object that can be used to call any base (super) functions, using this based object in place of * super.XXX() (which gets expanded to _super.prototype.XXX()) provides a better minification outcome and also ensures the correct "this" * context is maintained as TypeScript creates incorrect references using super.XXXX() for dynamically defined functions i.e. Functions * defined in the constructor or some other function (rather than declared as complete typescript functions). * ### Usage * ```typescript * import dynamicProto from "@microsoft/dynamicproto-js"; * class ExampleClass extends BaseClass { * constructor() { * dynamicProto(ExampleClass, this, (_self, base) => { * // This will define a function that will be converted to a prototype function * _self.newFunc = () => { * // Access any "this" instance property * if (_self.someProperty) { * ... * } * } * // This will define a function that will be converted to a prototype function * _self.myFunction = () => { * // Access any "this" instance property * if (_self.someProperty) { * // Call the base version of the function that we are overriding * base.myFunction(); * } * ... * } * _self.initialize = () => { * ... * } * // Warnings: While the following will work as _self is simply a reference to * // this, if anyone overrides myFunction() the overridden will be called first * // as the normal JavaScript method resolution will occur and the defined * // _self.initialize() function is actually gets removed from the instance and * // a proxy prototype version is created to reference the created method. * _self.initialize(); * }); * } * } * ``` * @typeparam DPType This is the generic type of the class, used to keep intellisense valid * @typeparam DPCls The type that contains the prototype of the current class * @param theClass - This is the current class instance which contains the prototype for the current class * @param target - The current "this" (target) reference, when the class has been extended this.prototype will not be the 'theClass' value. * @param delegateFunc - The callback function (closure) that will create the dynamic function * @param options - Additional options to configure how the dynamic prototype operates */ function dynamicProto(theClass, target, delegateFunc, options) { // Make sure that the passed theClass argument looks correct if (!_hasOwnProperty(theClass, Prototype)) { _throwTypeError("theClass is an invalid class definition."); } // Quick check to make sure that the passed theClass argument looks correct (this is a common copy/paste error) var classProto = theClass[Prototype]; if (!_checkPrototype(classProto, target)) { _throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]"); } var className = null; if (_hasOwnProperty(classProto, DynClassName)) { // Only grab the class name if it's defined on this prototype (i.e. don't walk the prototype chain) className = classProto[DynClassName]; } else { // As not all browser support name on the prototype creating a unique dynamic one if we have not already // assigned one, so we can use a simple string as the lookup rather than an object for the dynamic instance // function table lookup. className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _dynamicNames; _dynamicNames++; classProto[DynClassName] = className; } var perfOptions = dynamicProto[DynProtoDefaultOptions]; var useBaseInst = !!perfOptions[strUseBaseInst]; if (useBaseInst && options && options[strUseBaseInst] !== undefined) { useBaseInst = !!options[strUseBaseInst]; } // Get the current instance functions var instFuncs = _getInstanceFuncs(target); // Get all of the functions for any base instance (before they are potentially overridden) var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst); // Execute the delegate passing in both the current target "this" and "base" function references // Note casting the same type as we don't actually have the base class here and this will provide some intellisense support delegateFunc(target, baseFuncs); // Don't allow setting instance functions for older IE instances var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs]; if (setInstanceFunc && options) { setInstanceFunc = !!options[strSetInstFuncs]; } // Populate the Prototype for any overridden instance functions _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false); } /** * Exposes the default global options to allow global configuration, if the global values are disabled these will override * any passed values. This is primarily exposed to support unit-testing without the need for individual classes to expose * their internal usage of dynamic proto. */ var perfDefaults = { setInstFuncs: true, useBaseInst: true }; // And expose for testing dynamicProto[DynProtoDefaultOptions] = perfDefaults; return dynamicProto; }));//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/dynamicproto-js/lib/dist/node/dynamicproto-js.js.map /*! * Microsoft Dynamic Proto Utility, 1.1.6 * Copyright (c) Microsoft and contributors. All rights reserved. */ var n=this,t=function(){"use strict";var e="constructor",d="prototype",h="function",v="_dynInstFuncs",_="_isDynProxy",g="_dynClass",m="_dynInstChk",I=m,P="_dfOpts",r="_unknown_",o="__proto__",i="_dyn"+o,f="_dynInstProto",b="useBaseInst",w="setInstFuncs",u=Object,O=u.getPrototypeOf,s=u.getOwnPropertyNames,C=0;function F(n,t){return n&&u[d].hasOwnProperty.call(n,t)}function M(n){return n&&(n===u[d]||n===Array[d])}function k(n){return M(n)||n===Function[d]}function x(n){if(n){if(O)return O(n);var t=n[o]||n[d]||(n[e]?n[e][d]:null),r=n[i]||t;F(n,i)||(delete n[f],r=n[i]=n[f]||n[i],n[f]=t)}return r}function D(n,t){var r=[];if(s)r=s(n);else for(var e in n)"string"==typeof e&&F(n,e)&&r.push(e);if(r&&0 0) { for (var lp = 0; lp < props.length; lp++) { func(props[lp]); } } } /** * Helper function to check whether the provided function name is a potential candidate for dynamic * callback and prototype generation. * @param target The target object, may be a prototype or class object * @param funcName The function name * @param skipOwn Skips the check for own property * @ignore */ function _isDynamicCandidate(target, funcName, skipOwn) { return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName))); } /** * Helper to throw a TypeError exception * @param message the message * @ignore */ function _throwTypeError(message) { throw new TypeError("DynamicProto: " + message); } /** * Returns a collection of the instance functions that are defined directly on the thisTarget object, it does * not return any inherited functions * @param thisTarget The object to get the instance functions from * @ignore */ function _getInstanceFuncs(thisTarget) { // Get the base proto var instFuncs = {}; // Save any existing instance functions _forEachProp(thisTarget, function (name) { // Don't include any dynamic prototype instances - as we only want the real functions if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) { // Create an instance callback for passing the base function to the caller instFuncs[name] = thisTarget[name]; } }); return instFuncs; } /** * Returns whether the value is included in the array * @param values The array of values * @param value The value */ function _hasVisited(values, value) { for (var lp = values.length - 1; lp >= 0; lp--) { if (values[lp] === value) { return true; } } return false; } /** * Returns an object that contains callback functions for all "base/super" functions, this is used to "save" * enabling calling super.xxx() functions without requiring that the base "class" has defined a prototype references * @param target The current instance * @ignore */ function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) { function _instFuncProxy(target, funcHost, funcName) { var theFunc = funcHost[funcName]; if (theFunc[DynProxyTag] && useBaseInst) { // grab and reuse the hosted looking function (if available) otherwise the original passed function var instFuncTable = target[DynInstFuncTable] || {}; if (instFuncTable[DynAllowInstChkTag] !== false) { theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc; } } return function () { // eslint-disable-next-line prefer-rest-params return theFunc.apply(target, arguments); }; } // Start creating a new baseFuncs by creating proxies for the instance functions (as they may get replaced) var baseFuncs = {}; _forEachProp(instFuncs, function (name) { // Create an instance callback for passing the base function to the caller baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name); }); // Get the base prototype functions var baseProto = _getObjProto(classProto); var visited = []; // Don't include base object functions for Object, Array or Function while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) { // look for prototype functions _forEachProp(baseProto, function (name) { // Don't include any dynamic prototype instances - as we only want the real functions // For IE 7/8 the prototype lookup doesn't provide the full chain so we need to bypass the // hasOwnProperty check we get all of the methods, main difference is that IE7/8 doesn't return // the Object prototype methods while bypassing the check if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) { // Create an instance callback for passing the base function to the caller baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name); } }); // We need to find all possible functions that might be overloaded by walking the entire prototype chain // This avoids the caller from needing to check whether it's direct base class implements the function or not // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes. visited.push(baseProto); baseProto = _getObjProto(baseProto); } return baseFuncs; } function _getInstFunc(target, funcName, proto, currentDynProtoProxy) { var instFunc = null; // We need to check whether the class name is defined directly on this prototype otherwise // it will walk the proto chain and return any parent proto classname. if (target && _hasOwnProperty(proto, DynClassName)) { var instFuncTable = target[DynInstFuncTable] || {}; instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName]; if (!instFunc) { // Avoid stack overflow from recursive calling the same function _throwTypeError("Missing [" + funcName + "] " + strFunction); } // We have the instance function, lets check it we can speed up further calls // by adding the instance function back directly on the instance (avoiding the dynamic func lookup) if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) { // If the instance already has an instance function we can't replace it var canAddInst = !_hasOwnProperty(target, funcName); // Get current prototype var objProto = _getObjProto(target); var visited = []; // Lookup the function starting at the top (instance level prototype) and traverse down, if the first matching function // if nothing is found or if the first hit is a dynamic proto instance then we can safely add an instance shortcut while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) { var protoFunc = objProto[funcName]; if (protoFunc) { canAddInst = (protoFunc === currentDynProtoProxy); break; } // We need to find all possible initial functions to ensure that we don't bypass a valid override function visited.push(objProto); objProto = _getObjProto(objProto); } try { if (canAddInst) { // This instance doesn't have an instance func and the class hierarchy does have a higher level prototype version // so it's safe to directly assign for any subsequent calls (for better performance) target[funcName] = instFunc; } // Block further attempts to set the instance function for any instFunc[DynInstChkTag] = 1; } catch (e) { // Don't crash if the object is readonly or the runtime doesn't allow changing this // And set a flag so we don't try again for any function instFuncTable[DynAllowInstChkTag] = false; } } } return instFunc; } function _getProtoFunc(funcName, proto, currentDynProtoProxy) { var protoFunc = proto[funcName]; // Check that the prototype function is not a self reference -- try to avoid stack overflow! if (protoFunc === currentDynProtoProxy) { // It is so lookup the base prototype protoFunc = _getObjProto(proto)[funcName]; } if (typeof protoFunc !== strFunction) { _throwTypeError("[" + funcName + "] is not a " + strFunction); } return protoFunc; } /** * Add the required dynamic prototype methods to the the class prototype * @param proto - The class prototype * @param className - The instance classname * @param target - The target instance * @param baseInstFuncs - The base instance functions * @param setInstanceFunc - Flag to allow prototype function to reset the instance function if one does not exist * @ignore */ function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) { function _createDynamicPrototype(proto, funcName) { var dynProtoProxy = function () { // Use the instance or prototype function var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy); // eslint-disable-next-line prefer-rest-params return instFunc.apply(this, arguments); }; // Tag this function as a proxy to support replacing dynamic proxy elements (primary use case is for unit testing // via which can dynamically replace the prototype function reference) dynProtoProxy[DynProxyTag] = 1; return dynProtoProxy; } if (!_isObjectOrArrayPrototype(proto)) { var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {}; var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {}); // fetch and assign if as it may not exist yet // Set whether we are allow to lookup instances, if someone has set to false then do not re-enable if (instFuncTable[DynAllowInstChkTag] !== false) { instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc; } _forEachProp(target, function (name) { // Only add overridden functions if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) { // Save the instance Function to the lookup table and remove it from the instance as it's not a dynamic proto function instFuncs_1[name] = target[name]; delete target[name]; // Add a dynamic proto if one doesn't exist or if a prototype function exists and it's not a dynamic one if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) { proto[name] = _createDynamicPrototype(proto, name); } } }); } } /** * Checks whether the passed prototype object appears to be correct by walking the prototype hierarchy of the instance * @param classProto The class prototype instance * @param thisTarget The current instance that will be checked whether the passed prototype instance is in the hierarchy * @ignore */ function _checkPrototype(classProto, thisTarget) { // This method doesn't existing in older browsers (e.g. IE8) if (_objGetPrototypeOf) { // As this is primarily a coding time check, don't bother checking if running in IE8 or lower var visited = []; var thisProto = _getObjProto(thisTarget); while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) { if (thisProto === classProto) { return true; } // This avoids the caller from needing to check whether it's direct base class implements the function or not // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes. visited.push(thisProto); thisProto = _getObjProto(thisProto); } return false; } // If objGetPrototypeOf doesn't exist then just assume everything is ok. return true; } /** * Gets the current prototype name using the ES6 name if available otherwise falling back to a use unknown as the name. * It's not critical for this to return a name, it's used to decorate the generated unique name for easier debugging only. * @param target * @param unknownValue * @ignore */ function _getObjName(target, unknownValue) { if (_hasOwnProperty(target, Prototype)) { // Look like a prototype return target.name || unknownValue || UnknownValue; } return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue; } /** * Helper function when creating dynamic (inline) functions for classes, this helper performs the following tasks :- * - Saves references to all defined base class functions * - Calls the delegateFunc with the current target (this) and a base object reference that can be used to call all "super" functions. * - Will populate the class prototype for all overridden functions to support class extension that call the prototype instance. * Callers should use this helper when declaring all function within the constructor of a class, as mentioned above the delegateFunc is * passed both the target "this" and an object that can be used to call any base (super) functions, using this based object in place of * super.XXX() (which gets expanded to _super.prototype.XXX()) provides a better minification outcome and also ensures the correct "this" * context is maintained as TypeScript creates incorrect references using super.XXXX() for dynamically defined functions i.e. Functions * defined in the constructor or some other function (rather than declared as complete typescript functions). * ### Usage * ```typescript * import dynamicProto from "@microsoft/dynamicproto-js"; * class ExampleClass extends BaseClass { * constructor() { * dynamicProto(ExampleClass, this, (_self, base) => { * // This will define a function that will be converted to a prototype function * _self.newFunc = () => { * // Access any "this" instance property * if (_self.someProperty) { * ... * } * } * // This will define a function that will be converted to a prototype function * _self.myFunction = () => { * // Access any "this" instance property * if (_self.someProperty) { * // Call the base version of the function that we are overriding * base.myFunction(); * } * ... * } * _self.initialize = () => { * ... * } * // Warnings: While the following will work as _self is simply a reference to * // this, if anyone overrides myFunction() the overridden will be called first * // as the normal JavaScript method resolution will occur and the defined * // _self.initialize() function is actually gets removed from the instance and * // a proxy prototype version is created to reference the created method. * _self.initialize(); * }); * } * } * ``` * @typeparam DPType This is the generic type of the class, used to keep intellisense valid * @typeparam DPCls The type that contains the prototype of the current class * @param theClass - This is the current class instance which contains the prototype for the current class * @param target - The current "this" (target) reference, when the class has been extended this.prototype will not be the 'theClass' value. * @param delegateFunc - The callback function (closure) that will create the dynamic function * @param options - Additional options to configure how the dynamic prototype operates */ function dynamicProto(theClass, target, delegateFunc, options) { // Make sure that the passed theClass argument looks correct if (!_hasOwnProperty(theClass, Prototype)) { _throwTypeError("theClass is an invalid class definition."); } // Quick check to make sure that the passed theClass argument looks correct (this is a common copy/paste error) var classProto = theClass[Prototype]; if (!_checkPrototype(classProto, target)) { _throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]"); } var className = null; if (_hasOwnProperty(classProto, DynClassName)) { // Only grab the class name if it's defined on this prototype (i.e. don't walk the prototype chain) className = classProto[DynClassName]; } else { // As not all browser support name on the prototype creating a unique dynamic one if we have not already // assigned one, so we can use a simple string as the lookup rather than an object for the dynamic instance // function table lookup. className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _dynamicNames; _dynamicNames++; classProto[DynClassName] = className; } var perfOptions = dynamicProto[DynProtoDefaultOptions]; var useBaseInst = !!perfOptions[strUseBaseInst]; if (useBaseInst && options && options[strUseBaseInst] !== undefined) { useBaseInst = !!options[strUseBaseInst]; } // Get the current instance functions var instFuncs = _getInstanceFuncs(target); // Get all of the functions for any base instance (before they are potentially overridden) var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst); // Execute the delegate passing in both the current target "this" and "base" function references // Note casting the same type as we don't actually have the base class here and this will provide some intellisense support delegateFunc(target, baseFuncs); // Don't allow setting instance functions for older IE instances var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs]; if (setInstanceFunc && options) { setInstanceFunc = !!options[strSetInstFuncs]; } // Populate the Prototype for any overridden instance functions _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false); } /** * Exposes the default global options to allow global configuration, if the global values are disabled these will override * any passed values. This is primarily exposed to support unit-testing without the need for individual classes to expose * their internal usage of dynamic proto. */ var perfDefaults = { setInstFuncs: true, useBaseInst: true }; // And expose for testing dynamicProto[DynProtoDefaultOptions] = perfDefaults; }) }; }));//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/dynamicproto-js/lib/dist/system/dynamicproto-js.js.map /*! * Microsoft Dynamic Proto Utility, 1.1.6 * Copyright (c) Microsoft and contributors. All rights reserved. */ System.register("Microsoft.DynamicProto-JS",[],function(n){"use strict";return{execute:function(){n("default",E);var e="constructor",v="prototype",h="function",_="_dynInstFuncs",d="_isDynProxy",g="_dynClass",I="_dynCls$",P="_dynInstChk",m=P,w="_dfOpts",r="_unknown_",o="__proto__",u="_dyn"+o,i="_dynInstProto",O="useBaseInst",C="setInstFuncs",f=Object,F=f.getPrototypeOf,s=f.getOwnPropertyNames,k=0;function D(n,t){return n&&f[v].hasOwnProperty.call(n,t)}function b(n){return n&&(n===f[v]||n===Array[v])}function x(n){return b(n)||n===Function[v]}function B(n){if(n){if(F)return F(n);var t=n[o]||n[v]||(n[e]?n[e][v]:null),r=n[u]||t;D(n,u)||(delete n[i],r=n[u]=n[i]||n[u],n[i]=t)}return r}function M(n,t){var r=[];if(s)r=s(n);else for(var e in n)"string"==typeof e&&D(n,e)&&r.push(e);if(r&&0 0) { for (var lp = 0; lp < props.length; lp++) { func(props[lp]); } } } /** * Helper function to check whether the provided function name is a potential candidate for dynamic * callback and prototype generation. * @param target The target object, may be a prototype or class object * @param funcName The function name * @param skipOwn Skips the check for own property * @ignore */ function _isDynamicCandidate(target, funcName, skipOwn) { return (funcName !== Constructor && typeof target[funcName] === strFunction && (skipOwn || _hasOwnProperty(target, funcName))); } /** * Helper to throw a TypeError exception * @param message the message * @ignore */ function _throwTypeError(message) { throw new TypeError("DynamicProto: " + message); } /** * Returns a collection of the instance functions that are defined directly on the thisTarget object, it does * not return any inherited functions * @param thisTarget The object to get the instance functions from * @ignore */ function _getInstanceFuncs(thisTarget) { // Get the base proto var instFuncs = {}; // Save any existing instance functions _forEachProp(thisTarget, function (name) { // Don't include any dynamic prototype instances - as we only want the real functions if (!instFuncs[name] && _isDynamicCandidate(thisTarget, name, false)) { // Create an instance callback for passing the base function to the caller instFuncs[name] = thisTarget[name]; } }); return instFuncs; } /** * Returns whether the value is included in the array * @param values The array of values * @param value The value */ function _hasVisited(values, value) { for (var lp = values.length - 1; lp >= 0; lp--) { if (values[lp] === value) { return true; } } return false; } /** * Returns an object that contains callback functions for all "base/super" functions, this is used to "save" * enabling calling super.xxx() functions without requiring that the base "class" has defined a prototype references * @param target The current instance * @ignore */ function _getBaseFuncs(classProto, thisTarget, instFuncs, useBaseInst) { function _instFuncProxy(target, funcHost, funcName) { var theFunc = funcHost[funcName]; if (theFunc[DynProxyTag] && useBaseInst) { // grab and reuse the hosted looking function (if available) otherwise the original passed function var instFuncTable = target[DynInstFuncTable] || {}; if (instFuncTable[DynAllowInstChkTag] !== false) { theFunc = (instFuncTable[funcHost[DynClassName]] || {})[funcName] || theFunc; } } return function () { // eslint-disable-next-line prefer-rest-params return theFunc.apply(target, arguments); }; } // Start creating a new baseFuncs by creating proxies for the instance functions (as they may get replaced) var baseFuncs = {}; _forEachProp(instFuncs, function (name) { // Create an instance callback for passing the base function to the caller baseFuncs[name] = _instFuncProxy(thisTarget, instFuncs, name); }); // Get the base prototype functions var baseProto = _getObjProto(classProto); var visited = []; // Don't include base object functions for Object, Array or Function while (baseProto && !_isObjectArrayOrFunctionPrototype(baseProto) && !_hasVisited(visited, baseProto)) { // look for prototype functions _forEachProp(baseProto, function (name) { // Don't include any dynamic prototype instances - as we only want the real functions // For IE 7/8 the prototype lookup doesn't provide the full chain so we need to bypass the // hasOwnProperty check we get all of the methods, main difference is that IE7/8 doesn't return // the Object prototype methods while bypassing the check if (!baseFuncs[name] && _isDynamicCandidate(baseProto, name, !_objGetPrototypeOf)) { // Create an instance callback for passing the base function to the caller baseFuncs[name] = _instFuncProxy(thisTarget, baseProto, name); } }); // We need to find all possible functions that might be overloaded by walking the entire prototype chain // This avoids the caller from needing to check whether it's direct base class implements the function or not // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes. visited.push(baseProto); baseProto = _getObjProto(baseProto); } return baseFuncs; } function _getInstFunc(target, funcName, proto, currentDynProtoProxy) { var instFunc = null; // We need to check whether the class name is defined directly on this prototype otherwise // it will walk the proto chain and return any parent proto classname. if (target && _hasOwnProperty(proto, DynClassName)) { var instFuncTable = target[DynInstFuncTable] || {}; instFunc = (instFuncTable[proto[DynClassName]] || {})[funcName]; if (!instFunc) { // Avoid stack overflow from recursive calling the same function _throwTypeError("Missing [" + funcName + "] " + strFunction); } // We have the instance function, lets check it we can speed up further calls // by adding the instance function back directly on the instance (avoiding the dynamic func lookup) if (!instFunc[DynInstChkTag] && instFuncTable[DynAllowInstChkTag] !== false) { // If the instance already has an instance function we can't replace it var canAddInst = !_hasOwnProperty(target, funcName); // Get current prototype var objProto = _getObjProto(target); var visited = []; // Lookup the function starting at the top (instance level prototype) and traverse down, if the first matching function // if nothing is found or if the first hit is a dynamic proto instance then we can safely add an instance shortcut while (canAddInst && objProto && !_isObjectArrayOrFunctionPrototype(objProto) && !_hasVisited(visited, objProto)) { var protoFunc = objProto[funcName]; if (protoFunc) { canAddInst = (protoFunc === currentDynProtoProxy); break; } // We need to find all possible initial functions to ensure that we don't bypass a valid override function visited.push(objProto); objProto = _getObjProto(objProto); } try { if (canAddInst) { // This instance doesn't have an instance func and the class hierarchy does have a higher level prototype version // so it's safe to directly assign for any subsequent calls (for better performance) target[funcName] = instFunc; } // Block further attempts to set the instance function for any instFunc[DynInstChkTag] = 1; } catch (e) { // Don't crash if the object is readonly or the runtime doesn't allow changing this // And set a flag so we don't try again for any function instFuncTable[DynAllowInstChkTag] = false; } } } return instFunc; } function _getProtoFunc(funcName, proto, currentDynProtoProxy) { var protoFunc = proto[funcName]; // Check that the prototype function is not a self reference -- try to avoid stack overflow! if (protoFunc === currentDynProtoProxy) { // It is so lookup the base prototype protoFunc = _getObjProto(proto)[funcName]; } if (typeof protoFunc !== strFunction) { _throwTypeError("[" + funcName + "] is not a " + strFunction); } return protoFunc; } /** * Add the required dynamic prototype methods to the the class prototype * @param proto - The class prototype * @param className - The instance classname * @param target - The target instance * @param baseInstFuncs - The base instance functions * @param setInstanceFunc - Flag to allow prototype function to reset the instance function if one does not exist * @ignore */ function _populatePrototype(proto, className, target, baseInstFuncs, setInstanceFunc) { function _createDynamicPrototype(proto, funcName) { var dynProtoProxy = function () { // Use the instance or prototype function var instFunc = _getInstFunc(this, funcName, proto, dynProtoProxy) || _getProtoFunc(funcName, proto, dynProtoProxy); // eslint-disable-next-line prefer-rest-params return instFunc.apply(this, arguments); }; // Tag this function as a proxy to support replacing dynamic proxy elements (primary use case is for unit testing // via which can dynamically replace the prototype function reference) dynProtoProxy[DynProxyTag] = 1; return dynProtoProxy; } if (!_isObjectOrArrayPrototype(proto)) { var instFuncTable = target[DynInstFuncTable] = target[DynInstFuncTable] || {}; var instFuncs_1 = instFuncTable[className] = (instFuncTable[className] || {}); // fetch and assign if as it may not exist yet // Set whether we are allow to lookup instances, if someone has set to false then do not re-enable if (instFuncTable[DynAllowInstChkTag] !== false) { instFuncTable[DynAllowInstChkTag] = !!setInstanceFunc; } _forEachProp(target, function (name) { // Only add overridden functions if (_isDynamicCandidate(target, name, false) && target[name] !== baseInstFuncs[name]) { // Save the instance Function to the lookup table and remove it from the instance as it's not a dynamic proto function instFuncs_1[name] = target[name]; delete target[name]; // Add a dynamic proto if one doesn't exist or if a prototype function exists and it's not a dynamic one if (!_hasOwnProperty(proto, name) || (proto[name] && !proto[name][DynProxyTag])) { proto[name] = _createDynamicPrototype(proto, name); } } }); } } /** * Checks whether the passed prototype object appears to be correct by walking the prototype hierarchy of the instance * @param classProto The class prototype instance * @param thisTarget The current instance that will be checked whether the passed prototype instance is in the hierarchy * @ignore */ function _checkPrototype(classProto, thisTarget) { // This method doesn't existing in older browsers (e.g. IE8) if (_objGetPrototypeOf) { // As this is primarily a coding time check, don't bother checking if running in IE8 or lower var visited = []; var thisProto = _getObjProto(thisTarget); while (thisProto && !_isObjectArrayOrFunctionPrototype(thisProto) && !_hasVisited(visited, thisProto)) { if (thisProto === classProto) { return true; } // This avoids the caller from needing to check whether it's direct base class implements the function or not // by walking the entire chain it simplifies the usage and issues from upgrading any of the base classes. visited.push(thisProto); thisProto = _getObjProto(thisProto); } return false; } // If objGetPrototypeOf doesn't exist then just assume everything is ok. return true; } /** * Gets the current prototype name using the ES6 name if available otherwise falling back to a use unknown as the name. * It's not critical for this to return a name, it's used to decorate the generated unique name for easier debugging only. * @param target * @param unknownValue * @ignore */ function _getObjName(target, unknownValue) { if (_hasOwnProperty(target, Prototype)) { // Look like a prototype return target.name || unknownValue || UnknownValue; } return (((target || {})[Constructor]) || {}).name || unknownValue || UnknownValue; } /** * Helper function when creating dynamic (inline) functions for classes, this helper performs the following tasks :- * - Saves references to all defined base class functions * - Calls the delegateFunc with the current target (this) and a base object reference that can be used to call all "super" functions. * - Will populate the class prototype for all overridden functions to support class extension that call the prototype instance. * Callers should use this helper when declaring all function within the constructor of a class, as mentioned above the delegateFunc is * passed both the target "this" and an object that can be used to call any base (super) functions, using this based object in place of * super.XXX() (which gets expanded to _super.prototype.XXX()) provides a better minification outcome and also ensures the correct "this" * context is maintained as TypeScript creates incorrect references using super.XXXX() for dynamically defined functions i.e. Functions * defined in the constructor or some other function (rather than declared as complete typescript functions). * ### Usage * ```typescript * import dynamicProto from "@microsoft/dynamicproto-js"; * class ExampleClass extends BaseClass { * constructor() { * dynamicProto(ExampleClass, this, (_self, base) => { * // This will define a function that will be converted to a prototype function * _self.newFunc = () => { * // Access any "this" instance property * if (_self.someProperty) { * ... * } * } * // This will define a function that will be converted to a prototype function * _self.myFunction = () => { * // Access any "this" instance property * if (_self.someProperty) { * // Call the base version of the function that we are overriding * base.myFunction(); * } * ... * } * _self.initialize = () => { * ... * } * // Warnings: While the following will work as _self is simply a reference to * // this, if anyone overrides myFunction() the overridden will be called first * // as the normal JavaScript method resolution will occur and the defined * // _self.initialize() function is actually gets removed from the instance and * // a proxy prototype version is created to reference the created method. * _self.initialize(); * }); * } * } * ``` * @typeparam DPType This is the generic type of the class, used to keep intellisense valid * @typeparam DPCls The type that contains the prototype of the current class * @param theClass - This is the current class instance which contains the prototype for the current class * @param target - The current "this" (target) reference, when the class has been extended this.prototype will not be the 'theClass' value. * @param delegateFunc - The callback function (closure) that will create the dynamic function * @param options - Additional options to configure how the dynamic prototype operates */ function dynamicProto(theClass, target, delegateFunc, options) { // Make sure that the passed theClass argument looks correct if (!_hasOwnProperty(theClass, Prototype)) { _throwTypeError("theClass is an invalid class definition."); } // Quick check to make sure that the passed theClass argument looks correct (this is a common copy/paste error) var classProto = theClass[Prototype]; if (!_checkPrototype(classProto, target)) { _throwTypeError("[" + _getObjName(theClass) + "] is not in class hierarchy of [" + _getObjName(target) + "]"); } var className = null; if (_hasOwnProperty(classProto, DynClassName)) { // Only grab the class name if it's defined on this prototype (i.e. don't walk the prototype chain) className = classProto[DynClassName]; } else { // As not all browser support name on the prototype creating a unique dynamic one if we have not already // assigned one, so we can use a simple string as the lookup rather than an object for the dynamic instance // function table lookup. className = DynClassNamePrefix + _getObjName(theClass, "_") + "$" + _dynamicNames; _dynamicNames++; classProto[DynClassName] = className; } var perfOptions = dynamicProto[DynProtoDefaultOptions]; var useBaseInst = !!perfOptions[strUseBaseInst]; if (useBaseInst && options && options[strUseBaseInst] !== undefined) { useBaseInst = !!options[strUseBaseInst]; } // Get the current instance functions var instFuncs = _getInstanceFuncs(target); // Get all of the functions for any base instance (before they are potentially overridden) var baseFuncs = _getBaseFuncs(classProto, target, instFuncs, useBaseInst); // Execute the delegate passing in both the current target "this" and "base" function references // Note casting the same type as we don't actually have the base class here and this will provide some intellisense support delegateFunc(target, baseFuncs); // Don't allow setting instance functions for older IE instances var setInstanceFunc = !!_objGetPrototypeOf && !!perfOptions[strSetInstFuncs]; if (setInstanceFunc && options) { setInstanceFunc = !!options[strSetInstFuncs]; } // Populate the Prototype for any overridden instance functions _populatePrototype(classProto, className, target, instFuncs, setInstanceFunc !== false); } /** * Exposes the default global options to allow global configuration, if the global values are disabled these will override * any passed values. This is primarily exposed to support unit-testing without the need for individual classes to expose * their internal usage of dynamic proto. */ var perfDefaults = { setInstFuncs: true, useBaseInst: true }; // And expose for testing dynamicProto[DynProtoDefaultOptions] = perfDefaults; return dynamicProto; }));//# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6261075646f055b99068d3688932416f2346dd3b/node_modules/@microsoft/dynamicproto-js/lib/dist/umd/dynamicproto-js.js.map /*! * Microsoft Dynamic Proto Utility, 1.1.6 * Copyright (c) Microsoft and contributors. All rights reserved. */ var n=this,t=function(){"use strict";var e="constructor",d="prototype",h="function",v="_dynInstFuncs",_="_isDynProxy",g="_dynClass",m="_dynInstChk",I=m,P="_dfOpts",r="_unknown_",o="__proto__",i="_dyn"+o,f="_dynInstProto",b="useBaseInst",w="setInstFuncs",u=Object,O=u.getPrototypeOf,s=u.getOwnPropertyNames,C=0;function F(n,t){return n&&u[d].hasOwnProperty.call(n,t)}function M(n){return n&&(n===u[d]||n===Array[d])}function k(n){return M(n)||n===Function[d]}function x(n){if(n){if(O)return O(n);var t=n[o]||n[d]||(n[e]?n[e][d]:null),r=n[i]||t;F(n,i)||(delete n[f],r=n[i]=n[f]||n[i],n[f]=t)}return r}function D(n,t){var r=[];if(s)r=s(n);else for(var e in n)"string"==typeof e&&F(n,e)&&r.push(e);if(r&&0 0) mappings += ';'; if (line.length === 0) continue; var generatedCodeColumn = 0; // first field var lineMappings = []; for (var _i = 0, line_1 = line; _i < line_1.length; _i++) { var segment = line_1[_i]; var segmentMappings = encodeInteger(segment[0] - generatedCodeColumn); generatedCodeColumn = segment[0]; if (segment.length > 1) { segmentMappings += encodeInteger(segment[1] - sourceFileIndex) + encodeInteger(segment[2] - sourceCodeLine) + encodeInteger(segment[3] - sourceCodeColumn); sourceFileIndex = segment[1]; sourceCodeLine = segment[2]; sourceCodeColumn = segment[3]; } if (segment.length === 5) { segmentMappings += encodeInteger(segment[4] - nameIndex); nameIndex = segment[4]; } lineMappings.push(segmentMappings); } mappings += lineMappings.join(','); } return mappings; } function encodeInteger(num) { var result = ''; num = num < 0 ? (-num << 1) | 1 : num << 1; do { var clamped = num & 31; num >>>= 5; if (num > 0) { clamped |= 32; } result += chars[clamped]; } while (num > 0); return result; } var BitSet = function BitSet(arg) { this.bits = arg instanceof BitSet ? arg.bits.slice() : []; }; BitSet.prototype.add = function add (n) { this.bits[n >> 5] |= 1 << (n & 31); }; BitSet.prototype.has = function has (n) { return !!(this.bits[n >> 5] & (1 << (n & 31))); }; var Chunk = function Chunk(start, end, content) { this.start = start; this.end = end; this.original = content; this.intro = ''; this.outro = ''; this.content = content; this.storeName = false; this.edited = false; // we make these non-enumerable, for sanity while debugging Object.defineProperties(this, { previous: { writable: true, value: null }, next: { writable: true, value: null }, }); }; Chunk.prototype.appendLeft = function appendLeft (content) { this.outro += content; }; Chunk.prototype.appendRight = function appendRight (content) { this.intro = this.intro + content; }; Chunk.prototype.clone = function clone () { var chunk = new Chunk(this.start, this.end, this.original); chunk.intro = this.intro; chunk.outro = this.outro; chunk.content = this.content; chunk.storeName = this.storeName; chunk.edited = this.edited; return chunk; }; Chunk.prototype.contains = function contains (index) { return this.start < index && index < this.end; }; Chunk.prototype.eachNext = function eachNext (fn) { var chunk = this; while (chunk) { fn(chunk); chunk = chunk.next; } }; Chunk.prototype.eachPrevious = function eachPrevious (fn) { var chunk = this; while (chunk) { fn(chunk); chunk = chunk.previous; } }; Chunk.prototype.edit = function edit (content, storeName, contentOnly) { this.content = content; if (!contentOnly) { this.intro = ''; this.outro = ''; } this.storeName = storeName; this.edited = true; return this; }; Chunk.prototype.prependLeft = function prependLeft (content) { this.outro = content + this.outro; }; Chunk.prototype.prependRight = function prependRight (content) { this.intro = content + this.intro; }; Chunk.prototype.split = function split (index) { var sliceIndex = index - this.start; var originalBefore = this.original.slice(0, sliceIndex); var originalAfter = this.original.slice(sliceIndex); this.original = originalBefore; var newChunk = new Chunk(index, this.end, originalAfter); newChunk.outro = this.outro; this.outro = ''; this.end = index; if (this.edited) { // TODO is this block necessary?... newChunk.edit('', false); this.content = ''; } else { this.content = originalBefore; } newChunk.next = this.next; if (newChunk.next) { newChunk.next.previous = newChunk; } newChunk.previous = this; this.next = newChunk; return newChunk; }; Chunk.prototype.toString = function toString () { return this.intro + this.content + this.outro; }; Chunk.prototype.trimEnd = function trimEnd (rx) { this.outro = this.outro.replace(rx, ''); if (this.outro.length) { return true; } var trimmed = this.content.replace(rx, ''); if (trimmed.length) { if (trimmed !== this.content) { this.split(this.start + trimmed.length).edit('', undefined, true); } return true; } else { this.edit('', undefined, true); this.intro = this.intro.replace(rx, ''); if (this.intro.length) { return true; } } }; Chunk.prototype.trimStart = function trimStart (rx) { this.intro = this.intro.replace(rx, ''); if (this.intro.length) { return true; } var trimmed = this.content.replace(rx, ''); if (trimmed.length) { if (trimmed !== this.content) { this.split(this.end - trimmed.length); this.edit('', undefined, true); } return true; } else { this.edit('', undefined, true); this.outro = this.outro.replace(rx, ''); if (this.outro.length) { return true; } } }; var btoa = function () { throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.'); }; if (typeof window !== 'undefined' && typeof window.btoa === 'function') { btoa = function (str) { return window.btoa(unescape(encodeURIComponent(str))); }; } else if (typeof Buffer === 'function') { btoa = function (str) { return Buffer.from(str, 'utf-8').toString('base64'); }; } var SourceMap = function SourceMap(properties) { this.version = 3; this.file = properties.file; this.sources = properties.sources; this.sourcesContent = properties.sourcesContent; this.names = properties.names; this.mappings = encode(properties.mappings); }; SourceMap.prototype.toString = function toString () { return JSON.stringify(this); }; SourceMap.prototype.toUrl = function toUrl () { return 'data:application/json;charset=utf-8;base64,' + btoa(this.toString()); }; function guessIndent(code) { var lines = code.split('\n'); var tabbed = lines.filter(function (line) { return /^\t+/.test(line); }); var spaced = lines.filter(function (line) { return /^ {2,}/.test(line); }); if (tabbed.length === 0 && spaced.length === 0) { return null; } // More lines tabbed than spaced? Assume tabs, and // default to tabs in the case of a tie (or nothing // to go on) if (tabbed.length >= spaced.length) { return '\t'; } // Otherwise, we need to guess the multiple var min = spaced.reduce(function (previous, current) { var numSpaces = /^ +/.exec(current)[0].length; return Math.min(numSpaces, previous); }, Infinity); return new Array(min + 1).join(' '); } function getRelativePath(from, to) { var fromParts = from.split(/[/\\]/); var toParts = to.split(/[/\\]/); fromParts.pop(); // get dirname while (fromParts[0] === toParts[0]) { fromParts.shift(); toParts.shift(); } if (fromParts.length) { var i = fromParts.length; while (i--) { fromParts[i] = '..'; } } return fromParts.concat(toParts).join('/'); } var toString = Object.prototype.toString; function isObject(thing) { return toString.call(thing) === '[object Object]'; } function getLocator(source) { var originalLines = source.split('\n'); var lineOffsets = []; for (var i = 0, pos = 0; i < originalLines.length; i++) { lineOffsets.push(pos); pos += originalLines[i].length + 1; } return function locate(index) { var i = 0; var j = lineOffsets.length; while (i < j) { var m = (i + j) >> 1; if (index < lineOffsets[m]) { j = m; } else { i = m + 1; } } var line = i - 1; var column = index - lineOffsets[line]; return { line: line, column: column }; }; } var Mappings = function Mappings(hires) { this.hires = hires; this.generatedCodeLine = 0; this.generatedCodeColumn = 0; this.raw = []; this.rawSegments = this.raw[this.generatedCodeLine] = []; this.pending = null; }; Mappings.prototype.addEdit = function addEdit (sourceIndex, content, loc, nameIndex) { if (content.length) { var segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; if (nameIndex >= 0) { segment.push(nameIndex); } this.rawSegments.push(segment); } else if (this.pending) { this.rawSegments.push(this.pending); } this.advance(content); this.pending = null; }; Mappings.prototype.addUneditedChunk = function addUneditedChunk (sourceIndex, chunk, original, loc, sourcemapLocations) { var originalCharIndex = chunk.start; var first = true; while (originalCharIndex < chunk.end) { if (this.hires || first || sourcemapLocations.has(originalCharIndex)) { this.rawSegments.push([this.generatedCodeColumn, sourceIndex, loc.line, loc.column]); } if (original[originalCharIndex] === '\n') { loc.line += 1; loc.column = 0; this.generatedCodeLine += 1; this.raw[this.generatedCodeLine] = this.rawSegments = []; this.generatedCodeColumn = 0; first = true; } else { loc.column += 1; this.generatedCodeColumn += 1; first = false; } originalCharIndex += 1; } this.pending = null; }; Mappings.prototype.advance = function advance (str) { if (!str) { return; } var lines = str.split('\n'); if (lines.length > 1) { for (var i = 0; i < lines.length - 1; i++) { this.generatedCodeLine++; this.raw[this.generatedCodeLine] = this.rawSegments = []; } this.generatedCodeColumn = 0; } this.generatedCodeColumn += lines[lines.length - 1].length; }; var n = '\n'; var warned = { insertLeft: false, insertRight: false, storeName: false, }; var MagicString = function MagicString(string, options) { if ( options === void 0 ) options = {}; var chunk = new Chunk(0, string.length, string); Object.defineProperties(this, { original: { writable: true, value: string }, outro: { writable: true, value: '' }, intro: { writable: true, value: '' }, firstChunk: { writable: true, value: chunk }, lastChunk: { writable: true, value: chunk }, lastSearchedChunk: { writable: true, value: chunk }, byStart: { writable: true, value: {} }, byEnd: { writable: true, value: {} }, filename: { writable: true, value: options.filename }, indentExclusionRanges: { writable: true, value: options.indentExclusionRanges }, sourcemapLocations: { writable: true, value: new BitSet() }, storedNames: { writable: true, value: {} }, indentStr: { writable: true, value: guessIndent(string) }, }); this.byStart[0] = chunk; this.byEnd[string.length] = chunk; }; MagicString.prototype.addSourcemapLocation = function addSourcemapLocation (char) { this.sourcemapLocations.add(char); }; MagicString.prototype.append = function append (content) { if (typeof content !== 'string') { throw new TypeError('outro content must be a string'); } this.outro += content; return this; }; MagicString.prototype.appendLeft = function appendLeft (index, content) { if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); } this._split(index); var chunk = this.byEnd[index]; if (chunk) { chunk.appendLeft(content); } else { this.intro += content; } return this; }; MagicString.prototype.appendRight = function appendRight (index, content) { if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); } this._split(index); var chunk = this.byStart[index]; if (chunk) { chunk.appendRight(content); } else { this.outro += content; } return this; }; MagicString.prototype.clone = function clone () { var cloned = new MagicString(this.original, { filename: this.filename }); var originalChunk = this.firstChunk; var clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone()); while (originalChunk) { cloned.byStart[clonedChunk.start] = clonedChunk; cloned.byEnd[clonedChunk.end] = clonedChunk; var nextOriginalChunk = originalChunk.next; var nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone(); if (nextClonedChunk) { clonedChunk.next = nextClonedChunk; nextClonedChunk.previous = clonedChunk; clonedChunk = nextClonedChunk; } originalChunk = nextOriginalChunk; } cloned.lastChunk = clonedChunk; if (this.indentExclusionRanges) { cloned.indentExclusionRanges = this.indentExclusionRanges.slice(); } cloned.sourcemapLocations = new BitSet(this.sourcemapLocations); cloned.intro = this.intro; cloned.outro = this.outro; return cloned; }; MagicString.prototype.generateDecodedMap = function generateDecodedMap (options) { var this$1$1 = this; options = options || {}; var sourceIndex = 0; var names = Object.keys(this.storedNames); var mappings = new Mappings(options.hires); var locate = getLocator(this.original); if (this.intro) { mappings.advance(this.intro); } this.firstChunk.eachNext(function (chunk) { var loc = locate(chunk.start); if (chunk.intro.length) { mappings.advance(chunk.intro); } if (chunk.edited) { mappings.addEdit( sourceIndex, chunk.content, loc, chunk.storeName ? names.indexOf(chunk.original) : -1 ); } else { mappings.addUneditedChunk(sourceIndex, chunk, this$1$1.original, loc, this$1$1.sourcemapLocations); } if (chunk.outro.length) { mappings.advance(chunk.outro); } }); return { file: options.file ? options.file.split(/[/\\]/).pop() : null, sources: [options.source ? getRelativePath(options.file || '', options.source) : null], sourcesContent: options.includeContent ? [this.original] : [null], names: names, mappings: mappings.raw, }; }; MagicString.prototype.generateMap = function generateMap (options) { return new SourceMap(this.generateDecodedMap(options)); }; MagicString.prototype.getIndentString = function getIndentString () { return this.indentStr === null ? '\t' : this.indentStr; }; MagicString.prototype.indent = function indent (indentStr, options) { var pattern = /^[^\r\n]/gm; if (isObject(indentStr)) { options = indentStr; indentStr = undefined; } indentStr = indentStr !== undefined ? indentStr : this.indentStr || '\t'; if (indentStr === '') { return this; } // noop options = options || {}; // Process exclusion ranges var isExcluded = {}; if (options.exclude) { var exclusions = typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude; exclusions.forEach(function (exclusion) { for (var i = exclusion[0]; i < exclusion[1]; i += 1) { isExcluded[i] = true; } }); } var shouldIndentNextCharacter = options.indentStart !== false; var replacer = function (match) { if (shouldIndentNextCharacter) { return ("" + indentStr + match); } shouldIndentNextCharacter = true; return match; }; this.intro = this.intro.replace(pattern, replacer); var charIndex = 0; var chunk = this.firstChunk; while (chunk) { var end = chunk.end; if (chunk.edited) { if (!isExcluded[charIndex]) { chunk.content = chunk.content.replace(pattern, replacer); if (chunk.content.length) { shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\n'; } } } else { charIndex = chunk.start; while (charIndex < end) { if (!isExcluded[charIndex]) { var char = this.original[charIndex]; if (char === '\n') { shouldIndentNextCharacter = true; } else if (char !== '\r' && shouldIndentNextCharacter) { shouldIndentNextCharacter = false; if (charIndex === chunk.start) { chunk.prependRight(indentStr); } else { this._splitChunk(chunk, charIndex); chunk = chunk.next; chunk.prependRight(indentStr); } } } charIndex += 1; } } charIndex = chunk.end; chunk = chunk.next; } this.outro = this.outro.replace(pattern, replacer); return this; }; MagicString.prototype.insert = function insert () { throw new Error( 'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)' ); }; MagicString.prototype.insertLeft = function insertLeft (index, content) { if (!warned.insertLeft) { console.warn( 'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead' ); // eslint-disable-line no-console warned.insertLeft = true; } return this.appendLeft(index, content); }; MagicString.prototype.insertRight = function insertRight (index, content) { if (!warned.insertRight) { console.warn( 'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead' ); // eslint-disable-line no-console warned.insertRight = true; } return this.prependRight(index, content); }; MagicString.prototype.move = function move (start, end, index) { if (index >= start && index <= end) { throw new Error('Cannot move a selection inside itself'); } this._split(start); this._split(end); this._split(index); var first = this.byStart[start]; var last = this.byEnd[end]; var oldLeft = first.previous; var oldRight = last.next; var newRight = this.byStart[index]; if (!newRight && last === this.lastChunk) { return this; } var newLeft = newRight ? newRight.previous : this.lastChunk; if (oldLeft) { oldLeft.next = oldRight; } if (oldRight) { oldRight.previous = oldLeft; } if (newLeft) { newLeft.next = first; } if (newRight) { newRight.previous = last; } if (!first.previous) { this.firstChunk = last.next; } if (!last.next) { this.lastChunk = first.previous; this.lastChunk.next = null; } first.previous = newLeft; last.next = newRight || null; if (!newLeft) { this.firstChunk = first; } if (!newRight) { this.lastChunk = last; } return this; }; MagicString.prototype.overwrite = function overwrite (start, end, content, options) { if (typeof content !== 'string') { throw new TypeError('replacement content must be a string'); } while (start < 0) { start += this.original.length; } while (end < 0) { end += this.original.length; } if (end > this.original.length) { throw new Error('end is out of bounds'); } if (start === end) { throw new Error( 'Cannot overwrite a zero-length range – use appendLeft or prependRight instead' ); } this._split(start); this._split(end); if (options === true) { if (!warned.storeName) { console.warn( 'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string' ); // eslint-disable-line no-console warned.storeName = true; } options = { storeName: true }; } var storeName = options !== undefined ? options.storeName : false; var contentOnly = options !== undefined ? options.contentOnly : false; if (storeName) { var original = this.original.slice(start, end); Object.defineProperty(this.storedNames, original, { writable: true, value: true, enumerable: true }); } var first = this.byStart[start]; var last = this.byEnd[end]; if (first) { var chunk = first; while (chunk !== last) { if (chunk.next !== this.byStart[chunk.end]) { throw new Error('Cannot overwrite across a split point'); } chunk = chunk.next; chunk.edit('', false); } first.edit(content, storeName, contentOnly); } else { // must be inserting at the end var newChunk = new Chunk(start, end, '').edit(content, storeName); // TODO last chunk in the array may not be the last chunk, if it's moved... last.next = newChunk; newChunk.previous = last; } return this; }; MagicString.prototype.prepend = function prepend (content) { if (typeof content !== 'string') { throw new TypeError('outro content must be a string'); } this.intro = content + this.intro; return this; }; MagicString.prototype.prependLeft = function prependLeft (index, content) { if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); } this._split(index); var chunk = this.byEnd[index]; if (chunk) { chunk.prependLeft(content); } else { this.intro = content + this.intro; } return this; }; MagicString.prototype.prependRight = function prependRight (index, content) { if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); } this._split(index); var chunk = this.byStart[index]; if (chunk) { chunk.prependRight(content); } else { this.outro = content + this.outro; } return this; }; MagicString.prototype.remove = function remove (start, end) { while (start < 0) { start += this.original.length; } while (end < 0) { end += this.original.length; } if (start === end) { return this; } if (start < 0 || end > this.original.length) { throw new Error('Character is out of bounds'); } if (start > end) { throw new Error('end must be greater than start'); } this._split(start); this._split(end); var chunk = this.byStart[start]; while (chunk) { chunk.intro = ''; chunk.outro = ''; chunk.edit(''); chunk = end > chunk.end ? this.byStart[chunk.end] : null; } return this; }; MagicString.prototype.lastChar = function lastChar () { if (this.outro.length) { return this.outro[this.outro.length - 1]; } var chunk = this.lastChunk; do { if (chunk.outro.length) { return chunk.outro[chunk.outro.length - 1]; } if (chunk.content.length) { return chunk.content[chunk.content.length - 1]; } if (chunk.intro.length) { return chunk.intro[chunk.intro.length - 1]; } } while ((chunk = chunk.previous)); if (this.intro.length) { return this.intro[this.intro.length - 1]; } return ''; }; MagicString.prototype.lastLine = function lastLine () { var lineIndex = this.outro.lastIndexOf(n); if (lineIndex !== -1) { return this.outro.substr(lineIndex + 1); } var lineStr = this.outro; var chunk = this.lastChunk; do { if (chunk.outro.length > 0) { lineIndex = chunk.outro.lastIndexOf(n); if (lineIndex !== -1) { return chunk.outro.substr(lineIndex + 1) + lineStr; } lineStr = chunk.outro + lineStr; } if (chunk.content.length > 0) { lineIndex = chunk.content.lastIndexOf(n); if (lineIndex !== -1) { return chunk.content.substr(lineIndex + 1) + lineStr; } lineStr = chunk.content + lineStr; } if (chunk.intro.length > 0) { lineIndex = chunk.intro.lastIndexOf(n); if (lineIndex !== -1) { return chunk.intro.substr(lineIndex + 1) + lineStr; } lineStr = chunk.intro + lineStr; } } while ((chunk = chunk.previous)); lineIndex = this.intro.lastIndexOf(n); if (lineIndex !== -1) { return this.intro.substr(lineIndex + 1) + lineStr; } return this.intro + lineStr; }; MagicString.prototype.slice = function slice (start, end) { if ( start === void 0 ) start = 0; if ( end === void 0 ) end = this.original.length; while (start < 0) { start += this.original.length; } while (end < 0) { end += this.original.length; } var result = ''; // find start chunk var chunk = this.firstChunk; while (chunk && (chunk.start > start || chunk.end <= start)) { // found end chunk before start if (chunk.start < end && chunk.end >= end) { return result; } chunk = chunk.next; } if (chunk && chunk.edited && chunk.start !== start) { throw new Error(("Cannot use replaced character " + start + " as slice start anchor.")); } var startChunk = chunk; while (chunk) { if (chunk.intro && (startChunk !== chunk || chunk.start === start)) { result += chunk.intro; } var containsEnd = chunk.start < end && chunk.end >= end; if (containsEnd && chunk.edited && chunk.end !== end) { throw new Error(("Cannot use replaced character " + end + " as slice end anchor.")); } var sliceStart = startChunk === chunk ? start - chunk.start : 0; var sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length; result += chunk.content.slice(sliceStart, sliceEnd); if (chunk.outro && (!containsEnd || chunk.end === end)) { result += chunk.outro; } if (containsEnd) { break; } chunk = chunk.next; } return result; }; // TODO deprecate this? not really very useful MagicString.prototype.snip = function snip (start, end) { var clone = this.clone(); clone.remove(0, start); clone.remove(end, clone.original.length); return clone; }; MagicString.prototype._split = function _split (index) { if (this.byStart[index] || this.byEnd[index]) { return; } var chunk = this.lastSearchedChunk; var searchForward = index > chunk.end; while (chunk) { if (chunk.contains(index)) { return this._splitChunk(chunk, index); } chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start]; } }; MagicString.prototype._splitChunk = function _splitChunk (chunk, index) { if (chunk.edited && chunk.content.length) { // zero-length edited chunks are a special case (overlapping replacements) var loc = getLocator(this.original)(index); throw new Error( ("Cannot split a chunk that has already been edited (" + (loc.line) + ":" + (loc.column) + " – \"" + (chunk.original) + "\")") ); } var newChunk = chunk.split(index); this.byEnd[index] = chunk; this.byStart[index] = newChunk; this.byEnd[newChunk.end] = newChunk; if (chunk === this.lastChunk) { this.lastChunk = newChunk; } this.lastSearchedChunk = chunk; return true; }; MagicString.prototype.toString = function toString () { var str = this.intro; var chunk = this.firstChunk; while (chunk) { str += chunk.toString(); chunk = chunk.next; } return str + this.outro; }; MagicString.prototype.isEmpty = function isEmpty () { var chunk = this.firstChunk; do { if ( (chunk.intro.length && chunk.intro.trim()) || (chunk.content.length && chunk.content.trim()) || (chunk.outro.length && chunk.outro.trim()) ) { return false; } } while ((chunk = chunk.next)); return true; }; MagicString.prototype.length = function length () { var chunk = this.firstChunk; var length = 0; do { length += chunk.intro.length + chunk.content.length + chunk.outro.length; } while ((chunk = chunk.next)); return length; }; MagicString.prototype.trimLines = function trimLines () { return this.trim('[\\r\\n]'); }; MagicString.prototype.trim = function trim (charType) { return this.trimStart(charType).trimEnd(charType); }; MagicString.prototype.trimEndAborted = function trimEndAborted (charType) { var rx = new RegExp((charType || '\\s') + '+$'); this.outro = this.outro.replace(rx, ''); if (this.outro.length) { return true; } var chunk = this.lastChunk; do { var end = chunk.end; var aborted = chunk.trimEnd(rx); // if chunk was trimmed, we have a new lastChunk if (chunk.end !== end) { if (this.lastChunk === chunk) { this.lastChunk = chunk.next; } this.byEnd[chunk.end] = chunk; this.byStart[chunk.next.start] = chunk.next; this.byEnd[chunk.next.end] = chunk.next; } if (aborted) { return true; } chunk = chunk.previous; } while (chunk); return false; }; MagicString.prototype.trimEnd = function trimEnd (charType) { this.trimEndAborted(charType); return this; }; MagicString.prototype.trimStartAborted = function trimStartAborted (charType) { var rx = new RegExp('^' + (charType || '\\s') + '+'); this.intro = this.intro.replace(rx, ''); if (this.intro.length) { return true; } var chunk = this.firstChunk; do { var end = chunk.end; var aborted = chunk.trimStart(rx); if (chunk.end !== end) { // special case... if (chunk === this.lastChunk) { this.lastChunk = chunk.next; } this.byEnd[chunk.end] = chunk; this.byStart[chunk.next.start] = chunk.next; this.byEnd[chunk.next.end] = chunk.next; } if (aborted) { return true; } chunk = chunk.next; } while (chunk); return false; }; MagicString.prototype.trimStart = function trimStart (charType) { this.trimStartAborted(charType); return this; }; function escape(str) { return str.replace(/[-[\]/{}()*+?.\\^$|]/g, '\\$&'); } function isSourceMapEnabled(options) { if (options) { return options.sourceMap !== false && options.sourcemap !== false; } return false; } // Need to mock this rather than rely on JavaScript String.prototype.padEnd() as it doesn't always // exists in the build / test infrastructure function padEnd(input, len, fill) { var value = input || ""; while (value.length < len) { value += fill; } if (value.length > len) { value = value.substring(0, len); } return value; } function isNullOrWhitespace(value) { if (value) { return value.replace(/\s/g, "").length < 1; } return true; } /** * Simple Rush plugin to remove code that is wrapped between specific comments, this is used to * remove the boilerplate code require by typescript to define methods as prototype level while * using @ms-dynamicProto project to support minification. This can also be used to remove "debug" * functions from the production code. */ function dynamicRemove(options) { if (options === void 0) { options = {}; } var token = (options || {}).tagname || "@DynamicProtoStub"; var replaceValue = (options || {}).comment || "// Removed Stub for %function%."; var tokenGroups = [4, 10, 13]; var funcNameGroup = 6; // Because of the test infrastructure (PhamtonJS) the RegEx can't use the "s" flag (gis vs gi) or named groups var pattern = new RegExp("([\\t ]*\\/\\*\\*((?!\\*\\/)(.|\\r|\\n))*\\*\\/[\\s]*)*(\\/\\/[\\t ]*" + escape(token) + "[^\\r\\n]*(\\r\\n|\\n\\r|\\r|\\n))*[\\t ]*([\\w]*\\.prototype(\\.|\\[\\\"|\\[\\')[\\w]*(\\\"\\]|\\'\\])?)[\\t ]*=[\\t ]*function[\\t ]*\\([^\\{]*\\{[^\\/\\}\\{]*(\\{[^\\}]*\\}[^\\/\\}\\{]*)*(\\/[\\*\\/][\\t ]*" + escape(token) + "[^\\*\\r\\n]*(\\*\\/)?(\\r\\n|\\n\\r|\\r|\\n))*[^\\}]*\\};([\\t ]*\\/\\/[\\t ]*" + escape(token) + "[^\\r\\n]*)*", 'gi'); function formatError(token, code, pos, id) { var lines = code.split(/(?:\r\n|\n\r|\r|\n)/); var lineNumber = 0; var count = pos; while (count > 0) { lineNumber++; count = code.lastIndexOf("\n", count - 1); } var column = 0; var lineStart = code.lastIndexOf("\n", pos); if (lineStart != -1) { column = (pos - lineStart); } else { column = pos + 1; } var message = "Invalid (Unremoved) token [" + token + "] found on line [" + lineNumber + "], column [" + column + "], position [" + pos + "] - " + (id || "") + "\n"; var marker = padEnd("", token.length, "^"); var line = lineNumber - 6; if (line > 0) { message += " ...\n"; } count = 0; while (count < 10 && line < lines.length - 1) { count++; if (line >= 0) { var number = padEnd("" + (line + 1), 4, " "); message += number + ":" + lines[line] + "\n"; if (line == lineNumber - 1) { message += padEnd("", column + 4, " ") + marker + "\n"; } } line++; } if (line < lines.length - 1) { message += " ...\n"; } var match; var matchCount = 0; while ((match = pattern.exec(code))) { var funcName = match[funcNameGroup]; if (!isNullOrWhitespace(funcName)) { if (matchCount == 0) { message += "\nMatch checks\n"; } matchCount++; if (match[0].length > 0) { message += "Match " + matchCount + " tag Groups for " + (funcName || "") + "\n"; message += "--=( Complete Matched Content )=--\n"; message += match[0]; message += "\n--------------------------------\n"; for (var lp = 1; lp < match.length; lp++) { if (match[lp]) { message += "" + lp + ": " + (match[lp] || "").replace(/\n/g, "\\n").replace(/\r/g, "\\r"); if ((match[lp] || "").indexOf(token) != -1) { message += " <- Contains tag"; } message += "\n"; } } message += "\n"; } } } return message; } function replaceToken(code, theString) { var result = false; var match; while ((match = pattern.exec(code))) { var funcName = match[funcNameGroup]; if (!isNullOrWhitespace(funcName)) { // Only remove matches that contain a tag and function var hasToken = false; for (var lp = 0; lp < tokenGroups.length; lp++) { if ((match[tokenGroups[lp]] || "").indexOf(token) != -1) { hasToken = true; break; } } if (hasToken) { result = true; var start = match.index; var newValue = replaceValue.replace("%function%", funcName); theString.overwrite(start, start + match[0].length, newValue); } } } return result; } function checkResult(result, id) { if (result) { var pos = result.indexOf(token); if (pos != -1) { throw new Error(formatError(token, result, pos, id)); } } } function doTransform(code, id) { var theString = new MagicString(code); if (!replaceToken(code, theString)) { return null; } var result = { code: theString.toString() }; if (isSourceMapEnabled(options)) { result.map = theString.generateMap({ hires: true }); } return result; } function doTransformAndCheck(code, id) { var result = doTransform(code); if (result) { // Do a final check of the string checkResult(result.code, id); } else { // Check that the raw input doesn't include the tag checkResult(code, id); } return result; } return { name: 'dynamicRemove', renderChunk: function (code, chunk) { return doTransformAndCheck(code, chunk.filename); }, transform: doTransformAndCheck }; } export { dynamicRemove as default }; /*! * Microsoft Dynamic Proto Rollup Utility, 1.0.0 * Copyright (c) Microsoft and contributors. All rights reserved. */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.Microsoft = global.Microsoft || {}, global.Microsoft["DynamicProto-Rollup"] = factory())); })(this, (function () { 'use strict'; var charToInteger = {}; var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; for (var i = 0; i < chars.length; i++) { charToInteger[chars.charCodeAt(i)] = i; } function encode(decoded) { var sourceFileIndex = 0; // second field var sourceCodeLine = 0; // third field var sourceCodeColumn = 0; // fourth field var nameIndex = 0; // fifth field var mappings = ''; for (var i = 0; i < decoded.length; i++) { var line = decoded[i]; if (i > 0) mappings += ';'; if (line.length === 0) continue; var generatedCodeColumn = 0; // first field var lineMappings = []; for (var _i = 0, line_1 = line; _i < line_1.length; _i++) { var segment = line_1[_i]; var segmentMappings = encodeInteger(segment[0] - generatedCodeColumn); generatedCodeColumn = segment[0]; if (segment.length > 1) { segmentMappings += encodeInteger(segment[1] - sourceFileIndex) + encodeInteger(segment[2] - sourceCodeLine) + encodeInteger(segment[3] - sourceCodeColumn); sourceFileIndex = segment[1]; sourceCodeLine = segment[2]; sourceCodeColumn = segment[3]; } if (segment.length === 5) { segmentMappings += encodeInteger(segment[4] - nameIndex); nameIndex = segment[4]; } lineMappings.push(segmentMappings); } mappings += lineMappings.join(','); } return mappings; } function encodeInteger(num) { var result = ''; num = num < 0 ? (-num << 1) | 1 : num << 1; do { var clamped = num & 31; num >>>= 5; if (num > 0) { clamped |= 32; } result += chars[clamped]; } while (num > 0); return result; } var BitSet = function BitSet(arg) { this.bits = arg instanceof BitSet ? arg.bits.slice() : []; }; BitSet.prototype.add = function add (n) { this.bits[n >> 5] |= 1 << (n & 31); }; BitSet.prototype.has = function has (n) { return !!(this.bits[n >> 5] & (1 << (n & 31))); }; var Chunk = function Chunk(start, end, content) { this.start = start; this.end = end; this.original = content; this.intro = ''; this.outro = ''; this.content = content; this.storeName = false; this.edited = false; // we make these non-enumerable, for sanity while debugging Object.defineProperties(this, { previous: { writable: true, value: null }, next: { writable: true, value: null }, }); }; Chunk.prototype.appendLeft = function appendLeft (content) { this.outro += content; }; Chunk.prototype.appendRight = function appendRight (content) { this.intro = this.intro + content; }; Chunk.prototype.clone = function clone () { var chunk = new Chunk(this.start, this.end, this.original); chunk.intro = this.intro; chunk.outro = this.outro; chunk.content = this.content; chunk.storeName = this.storeName; chunk.edited = this.edited; return chunk; }; Chunk.prototype.contains = function contains (index) { return this.start < index && index < this.end; }; Chunk.prototype.eachNext = function eachNext (fn) { var chunk = this; while (chunk) { fn(chunk); chunk = chunk.next; } }; Chunk.prototype.eachPrevious = function eachPrevious (fn) { var chunk = this; while (chunk) { fn(chunk); chunk = chunk.previous; } }; Chunk.prototype.edit = function edit (content, storeName, contentOnly) { this.content = content; if (!contentOnly) { this.intro = ''; this.outro = ''; } this.storeName = storeName; this.edited = true; return this; }; Chunk.prototype.prependLeft = function prependLeft (content) { this.outro = content + this.outro; }; Chunk.prototype.prependRight = function prependRight (content) { this.intro = content + this.intro; }; Chunk.prototype.split = function split (index) { var sliceIndex = index - this.start; var originalBefore = this.original.slice(0, sliceIndex); var originalAfter = this.original.slice(sliceIndex); this.original = originalBefore; var newChunk = new Chunk(index, this.end, originalAfter); newChunk.outro = this.outro; this.outro = ''; this.end = index; if (this.edited) { // TODO is this block necessary?... newChunk.edit('', false); this.content = ''; } else { this.content = originalBefore; } newChunk.next = this.next; if (newChunk.next) { newChunk.next.previous = newChunk; } newChunk.previous = this; this.next = newChunk; return newChunk; }; Chunk.prototype.toString = function toString () { return this.intro + this.content + this.outro; }; Chunk.prototype.trimEnd = function trimEnd (rx) { this.outro = this.outro.replace(rx, ''); if (this.outro.length) { return true; } var trimmed = this.content.replace(rx, ''); if (trimmed.length) { if (trimmed !== this.content) { this.split(this.start + trimmed.length).edit('', undefined, true); } return true; } else { this.edit('', undefined, true); this.intro = this.intro.replace(rx, ''); if (this.intro.length) { return true; } } }; Chunk.prototype.trimStart = function trimStart (rx) { this.intro = this.intro.replace(rx, ''); if (this.intro.length) { return true; } var trimmed = this.content.replace(rx, ''); if (trimmed.length) { if (trimmed !== this.content) { this.split(this.end - trimmed.length); this.edit('', undefined, true); } return true; } else { this.edit('', undefined, true); this.outro = this.outro.replace(rx, ''); if (this.outro.length) { return true; } } }; var btoa = function () { throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.'); }; if (typeof window !== 'undefined' && typeof window.btoa === 'function') { btoa = function (str) { return window.btoa(unescape(encodeURIComponent(str))); }; } else if (typeof Buffer === 'function') { btoa = function (str) { return Buffer.from(str, 'utf-8').toString('base64'); }; } var SourceMap = function SourceMap(properties) { this.version = 3; this.file = properties.file; this.sources = properties.sources; this.sourcesContent = properties.sourcesContent; this.names = properties.names; this.mappings = encode(properties.mappings); }; SourceMap.prototype.toString = function toString () { return JSON.stringify(this); }; SourceMap.prototype.toUrl = function toUrl () { return 'data:application/json;charset=utf-8;base64,' + btoa(this.toString()); }; function guessIndent(code) { var lines = code.split('\n'); var tabbed = lines.filter(function (line) { return /^\t+/.test(line); }); var spaced = lines.filter(function (line) { return /^ {2,}/.test(line); }); if (tabbed.length === 0 && spaced.length === 0) { return null; } // More lines tabbed than spaced? Assume tabs, and // default to tabs in the case of a tie (or nothing // to go on) if (tabbed.length >= spaced.length) { return '\t'; } // Otherwise, we need to guess the multiple var min = spaced.reduce(function (previous, current) { var numSpaces = /^ +/.exec(current)[0].length; return Math.min(numSpaces, previous); }, Infinity); return new Array(min + 1).join(' '); } function getRelativePath(from, to) { var fromParts = from.split(/[/\\]/); var toParts = to.split(/[/\\]/); fromParts.pop(); // get dirname while (fromParts[0] === toParts[0]) { fromParts.shift(); toParts.shift(); } if (fromParts.length) { var i = fromParts.length; while (i--) { fromParts[i] = '..'; } } return fromParts.concat(toParts).join('/'); } var toString = Object.prototype.toString; function isObject(thing) { return toString.call(thing) === '[object Object]'; } function getLocator(source) { var originalLines = source.split('\n'); var lineOffsets = []; for (var i = 0, pos = 0; i < originalLines.length; i++) { lineOffsets.push(pos); pos += originalLines[i].length + 1; } return function locate(index) { var i = 0; var j = lineOffsets.length; while (i < j) { var m = (i + j) >> 1; if (index < lineOffsets[m]) { j = m; } else { i = m + 1; } } var line = i - 1; var column = index - lineOffsets[line]; return { line: line, column: column }; }; } var Mappings = function Mappings(hires) { this.hires = hires; this.generatedCodeLine = 0; this.generatedCodeColumn = 0; this.raw = []; this.rawSegments = this.raw[this.generatedCodeLine] = []; this.pending = null; }; Mappings.prototype.addEdit = function addEdit (sourceIndex, content, loc, nameIndex) { if (content.length) { var segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; if (nameIndex >= 0) { segment.push(nameIndex); } this.rawSegments.push(segment); } else if (this.pending) { this.rawSegments.push(this.pending); } this.advance(content); this.pending = null; }; Mappings.prototype.addUneditedChunk = function addUneditedChunk (sourceIndex, chunk, original, loc, sourcemapLocations) { var originalCharIndex = chunk.start; var first = true; while (originalCharIndex < chunk.end) { if (this.hires || first || sourcemapLocations.has(originalCharIndex)) { this.rawSegments.push([this.generatedCodeColumn, sourceIndex, loc.line, loc.column]); } if (original[originalCharIndex] === '\n') { loc.line += 1; loc.column = 0; this.generatedCodeLine += 1; this.raw[this.generatedCodeLine] = this.rawSegments = []; this.generatedCodeColumn = 0; first = true; } else { loc.column += 1; this.generatedCodeColumn += 1; first = false; } originalCharIndex += 1; } this.pending = null; }; Mappings.prototype.advance = function advance (str) { if (!str) { return; } var lines = str.split('\n'); if (lines.length > 1) { for (var i = 0; i < lines.length - 1; i++) { this.generatedCodeLine++; this.raw[this.generatedCodeLine] = this.rawSegments = []; } this.generatedCodeColumn = 0; } this.generatedCodeColumn += lines[lines.length - 1].length; }; var n = '\n'; var warned = { insertLeft: false, insertRight: false, storeName: false, }; var MagicString = function MagicString(string, options) { if ( options === void 0 ) options = {}; var chunk = new Chunk(0, string.length, string); Object.defineProperties(this, { original: { writable: true, value: string }, outro: { writable: true, value: '' }, intro: { writable: true, value: '' }, firstChunk: { writable: true, value: chunk }, lastChunk: { writable: true, value: chunk }, lastSearchedChunk: { writable: true, value: chunk }, byStart: { writable: true, value: {} }, byEnd: { writable: true, value: {} }, filename: { writable: true, value: options.filename }, indentExclusionRanges: { writable: true, value: options.indentExclusionRanges }, sourcemapLocations: { writable: true, value: new BitSet() }, storedNames: { writable: true, value: {} }, indentStr: { writable: true, value: guessIndent(string) }, }); this.byStart[0] = chunk; this.byEnd[string.length] = chunk; }; MagicString.prototype.addSourcemapLocation = function addSourcemapLocation (char) { this.sourcemapLocations.add(char); }; MagicString.prototype.append = function append (content) { if (typeof content !== 'string') { throw new TypeError('outro content must be a string'); } this.outro += content; return this; }; MagicString.prototype.appendLeft = function appendLeft (index, content) { if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); } this._split(index); var chunk = this.byEnd[index]; if (chunk) { chunk.appendLeft(content); } else { this.intro += content; } return this; }; MagicString.prototype.appendRight = function appendRight (index, content) { if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); } this._split(index); var chunk = this.byStart[index]; if (chunk) { chunk.appendRight(content); } else { this.outro += content; } return this; }; MagicString.prototype.clone = function clone () { var cloned = new MagicString(this.original, { filename: this.filename }); var originalChunk = this.firstChunk; var clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone()); while (originalChunk) { cloned.byStart[clonedChunk.start] = clonedChunk; cloned.byEnd[clonedChunk.end] = clonedChunk; var nextOriginalChunk = originalChunk.next; var nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone(); if (nextClonedChunk) { clonedChunk.next = nextClonedChunk; nextClonedChunk.previous = clonedChunk; clonedChunk = nextClonedChunk; } originalChunk = nextOriginalChunk; } cloned.lastChunk = clonedChunk; if (this.indentExclusionRanges) { cloned.indentExclusionRanges = this.indentExclusionRanges.slice(); } cloned.sourcemapLocations = new BitSet(this.sourcemapLocations); cloned.intro = this.intro; cloned.outro = this.outro; return cloned; }; MagicString.prototype.generateDecodedMap = function generateDecodedMap (options) { var this$1$1 = this; options = options || {}; var sourceIndex = 0; var names = Object.keys(this.storedNames); var mappings = new Mappings(options.hires); var locate = getLocator(this.original); if (this.intro) { mappings.advance(this.intro); } this.firstChunk.eachNext(function (chunk) { var loc = locate(chunk.start); if (chunk.intro.length) { mappings.advance(chunk.intro); } if (chunk.edited) { mappings.addEdit( sourceIndex, chunk.content, loc, chunk.storeName ? names.indexOf(chunk.original) : -1 ); } else { mappings.addUneditedChunk(sourceIndex, chunk, this$1$1.original, loc, this$1$1.sourcemapLocations); } if (chunk.outro.length) { mappings.advance(chunk.outro); } }); return { file: options.file ? options.file.split(/[/\\]/).pop() : null, sources: [options.source ? getRelativePath(options.file || '', options.source) : null], sourcesContent: options.includeContent ? [this.original] : [null], names: names, mappings: mappings.raw, }; }; MagicString.prototype.generateMap = function generateMap (options) { return new SourceMap(this.generateDecodedMap(options)); }; MagicString.prototype.getIndentString = function getIndentString () { return this.indentStr === null ? '\t' : this.indentStr; }; MagicString.prototype.indent = function indent (indentStr, options) { var pattern = /^[^\r\n]/gm; if (isObject(indentStr)) { options = indentStr; indentStr = undefined; } indentStr = indentStr !== undefined ? indentStr : this.indentStr || '\t'; if (indentStr === '') { return this; } // noop options = options || {}; // Process exclusion ranges var isExcluded = {}; if (options.exclude) { var exclusions = typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude; exclusions.forEach(function (exclusion) { for (var i = exclusion[0]; i < exclusion[1]; i += 1) { isExcluded[i] = true; } }); } var shouldIndentNextCharacter = options.indentStart !== false; var replacer = function (match) { if (shouldIndentNextCharacter) { return ("" + indentStr + match); } shouldIndentNextCharacter = true; return match; }; this.intro = this.intro.replace(pattern, replacer); var charIndex = 0; var chunk = this.firstChunk; while (chunk) { var end = chunk.end; if (chunk.edited) { if (!isExcluded[charIndex]) { chunk.content = chunk.content.replace(pattern, replacer); if (chunk.content.length) { shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\n'; } } } else { charIndex = chunk.start; while (charIndex < end) { if (!isExcluded[charIndex]) { var char = this.original[charIndex]; if (char === '\n') { shouldIndentNextCharacter = true; } else if (char !== '\r' && shouldIndentNextCharacter) { shouldIndentNextCharacter = false; if (charIndex === chunk.start) { chunk.prependRight(indentStr); } else { this._splitChunk(chunk, charIndex); chunk = chunk.next; chunk.prependRight(indentStr); } } } charIndex += 1; } } charIndex = chunk.end; chunk = chunk.next; } this.outro = this.outro.replace(pattern, replacer); return this; }; MagicString.prototype.insert = function insert () { throw new Error( 'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)' ); }; MagicString.prototype.insertLeft = function insertLeft (index, content) { if (!warned.insertLeft) { console.warn( 'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead' ); // eslint-disable-line no-console warned.insertLeft = true; } return this.appendLeft(index, content); }; MagicString.prototype.insertRight = function insertRight (index, content) { if (!warned.insertRight) { console.warn( 'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead' ); // eslint-disable-line no-console warned.insertRight = true; } return this.prependRight(index, content); }; MagicString.prototype.move = function move (start, end, index) { if (index >= start && index <= end) { throw new Error('Cannot move a selection inside itself'); } this._split(start); this._split(end); this._split(index); var first = this.byStart[start]; var last = this.byEnd[end]; var oldLeft = first.previous; var oldRight = last.next; var newRight = this.byStart[index]; if (!newRight && last === this.lastChunk) { return this; } var newLeft = newRight ? newRight.previous : this.lastChunk; if (oldLeft) { oldLeft.next = oldRight; } if (oldRight) { oldRight.previous = oldLeft; } if (newLeft) { newLeft.next = first; } if (newRight) { newRight.previous = last; } if (!first.previous) { this.firstChunk = last.next; } if (!last.next) { this.lastChunk = first.previous; this.lastChunk.next = null; } first.previous = newLeft; last.next = newRight || null; if (!newLeft) { this.firstChunk = first; } if (!newRight) { this.lastChunk = last; } return this; }; MagicString.prototype.overwrite = function overwrite (start, end, content, options) { if (typeof content !== 'string') { throw new TypeError('replacement content must be a string'); } while (start < 0) { start += this.original.length; } while (end < 0) { end += this.original.length; } if (end > this.original.length) { throw new Error('end is out of bounds'); } if (start === end) { throw new Error( 'Cannot overwrite a zero-length range – use appendLeft or prependRight instead' ); } this._split(start); this._split(end); if (options === true) { if (!warned.storeName) { console.warn( 'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string' ); // eslint-disable-line no-console warned.storeName = true; } options = { storeName: true }; } var storeName = options !== undefined ? options.storeName : false; var contentOnly = options !== undefined ? options.contentOnly : false; if (storeName) { var original = this.original.slice(start, end); Object.defineProperty(this.storedNames, original, { writable: true, value: true, enumerable: true }); } var first = this.byStart[start]; var last = this.byEnd[end]; if (first) { var chunk = first; while (chunk !== last) { if (chunk.next !== this.byStart[chunk.end]) { throw new Error('Cannot overwrite across a split point'); } chunk = chunk.next; chunk.edit('', false); } first.edit(content, storeName, contentOnly); } else { // must be inserting at the end var newChunk = new Chunk(start, end, '').edit(content, storeName); // TODO last chunk in the array may not be the last chunk, if it's moved... last.next = newChunk; newChunk.previous = last; } return this; }; MagicString.prototype.prepend = function prepend (content) { if (typeof content !== 'string') { throw new TypeError('outro content must be a string'); } this.intro = content + this.intro; return this; }; MagicString.prototype.prependLeft = function prependLeft (index, content) { if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); } this._split(index); var chunk = this.byEnd[index]; if (chunk) { chunk.prependLeft(content); } else { this.intro = content + this.intro; } return this; }; MagicString.prototype.prependRight = function prependRight (index, content) { if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); } this._split(index); var chunk = this.byStart[index]; if (chunk) { chunk.prependRight(content); } else { this.outro = content + this.outro; } return this; }; MagicString.prototype.remove = function remove (start, end) { while (start < 0) { start += this.original.length; } while (end < 0) { end += this.original.length; } if (start === end) { return this; } if (start < 0 || end > this.original.length) { throw new Error('Character is out of bounds'); } if (start > end) { throw new Error('end must be greater than start'); } this._split(start); this._split(end); var chunk = this.byStart[start]; while (chunk) { chunk.intro = ''; chunk.outro = ''; chunk.edit(''); chunk = end > chunk.end ? this.byStart[chunk.end] : null; } return this; }; MagicString.prototype.lastChar = function lastChar () { if (this.outro.length) { return this.outro[this.outro.length - 1]; } var chunk = this.lastChunk; do { if (chunk.outro.length) { return chunk.outro[chunk.outro.length - 1]; } if (chunk.content.length) { return chunk.content[chunk.content.length - 1]; } if (chunk.intro.length) { return chunk.intro[chunk.intro.length - 1]; } } while ((chunk = chunk.previous)); if (this.intro.length) { return this.intro[this.intro.length - 1]; } return ''; }; MagicString.prototype.lastLine = function lastLine () { var lineIndex = this.outro.lastIndexOf(n); if (lineIndex !== -1) { return this.outro.substr(lineIndex + 1); } var lineStr = this.outro; var chunk = this.lastChunk; do { if (chunk.outro.length > 0) { lineIndex = chunk.outro.lastIndexOf(n); if (lineIndex !== -1) { return chunk.outro.substr(lineIndex + 1) + lineStr; } lineStr = chunk.outro + lineStr; } if (chunk.content.length > 0) { lineIndex = chunk.content.lastIndexOf(n); if (lineIndex !== -1) { return chunk.content.substr(lineIndex + 1) + lineStr; } lineStr = chunk.content + lineStr; } if (chunk.intro.length > 0) { lineIndex = chunk.intro.lastIndexOf(n); if (lineIndex !== -1) { return chunk.intro.substr(lineIndex + 1) + lineStr; } lineStr = chunk.intro + lineStr; } } while ((chunk = chunk.previous)); lineIndex = this.intro.lastIndexOf(n); if (lineIndex !== -1) { return this.intro.substr(lineIndex + 1) + lineStr; } return this.intro + lineStr; }; MagicString.prototype.slice = function slice (start, end) { if ( start === void 0 ) start = 0; if ( end === void 0 ) end = this.original.length; while (start < 0) { start += this.original.length; } while (end < 0) { end += this.original.length; } var result = ''; // find start chunk var chunk = this.firstChunk; while (chunk && (chunk.start > start || chunk.end <= start)) { // found end chunk before start if (chunk.start < end && chunk.end >= end) { return result; } chunk = chunk.next; } if (chunk && chunk.edited && chunk.start !== start) { throw new Error(("Cannot use replaced character " + start + " as slice start anchor.")); } var startChunk = chunk; while (chunk) { if (chunk.intro && (startChunk !== chunk || chunk.start === start)) { result += chunk.intro; } var containsEnd = chunk.start < end && chunk.end >= end; if (containsEnd && chunk.edited && chunk.end !== end) { throw new Error(("Cannot use replaced character " + end + " as slice end anchor.")); } var sliceStart = startChunk === chunk ? start - chunk.start : 0; var sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length; result += chunk.content.slice(sliceStart, sliceEnd); if (chunk.outro && (!containsEnd || chunk.end === end)) { result += chunk.outro; } if (containsEnd) { break; } chunk = chunk.next; } return result; }; // TODO deprecate this? not really very useful MagicString.prototype.snip = function snip (start, end) { var clone = this.clone(); clone.remove(0, start); clone.remove(end, clone.original.length); return clone; }; MagicString.prototype._split = function _split (index) { if (this.byStart[index] || this.byEnd[index]) { return; } var chunk = this.lastSearchedChunk; var searchForward = index > chunk.end; while (chunk) { if (chunk.contains(index)) { return this._splitChunk(chunk, index); } chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start]; } }; MagicString.prototype._splitChunk = function _splitChunk (chunk, index) { if (chunk.edited && chunk.content.length) { // zero-length edited chunks are a special case (overlapping replacements) var loc = getLocator(this.original)(index); throw new Error( ("Cannot split a chunk that has already been edited (" + (loc.line) + ":" + (loc.column) + " – \"" + (chunk.original) + "\")") ); } var newChunk = chunk.split(index); this.byEnd[index] = chunk; this.byStart[index] = newChunk; this.byEnd[newChunk.end] = newChunk; if (chunk === this.lastChunk) { this.lastChunk = newChunk; } this.lastSearchedChunk = chunk; return true; }; MagicString.prototype.toString = function toString () { var str = this.intro; var chunk = this.firstChunk; while (chunk) { str += chunk.toString(); chunk = chunk.next; } return str + this.outro; }; MagicString.prototype.isEmpty = function isEmpty () { var chunk = this.firstChunk; do { if ( (chunk.intro.length && chunk.intro.trim()) || (chunk.content.length && chunk.content.trim()) || (chunk.outro.length && chunk.outro.trim()) ) { return false; } } while ((chunk = chunk.next)); return true; }; MagicString.prototype.length = function length () { var chunk = this.firstChunk; var length = 0; do { length += chunk.intro.length + chunk.content.length + chunk.outro.length; } while ((chunk = chunk.next)); return length; }; MagicString.prototype.trimLines = function trimLines () { return this.trim('[\\r\\n]'); }; MagicString.prototype.trim = function trim (charType) { return this.trimStart(charType).trimEnd(charType); }; MagicString.prototype.trimEndAborted = function trimEndAborted (charType) { var rx = new RegExp((charType || '\\s') + '+$'); this.outro = this.outro.replace(rx, ''); if (this.outro.length) { return true; } var chunk = this.lastChunk; do { var end = chunk.end; var aborted = chunk.trimEnd(rx); // if chunk was trimmed, we have a new lastChunk if (chunk.end !== end) { if (this.lastChunk === chunk) { this.lastChunk = chunk.next; } this.byEnd[chunk.end] = chunk; this.byStart[chunk.next.start] = chunk.next; this.byEnd[chunk.next.end] = chunk.next; } if (aborted) { return true; } chunk = chunk.previous; } while (chunk); return false; }; MagicString.prototype.trimEnd = function trimEnd (charType) { this.trimEndAborted(charType); return this; }; MagicString.prototype.trimStartAborted = function trimStartAborted (charType) { var rx = new RegExp('^' + (charType || '\\s') + '+'); this.intro = this.intro.replace(rx, ''); if (this.intro.length) { return true; } var chunk = this.firstChunk; do { var end = chunk.end; var aborted = chunk.trimStart(rx); if (chunk.end !== end) { // special case... if (chunk === this.lastChunk) { this.lastChunk = chunk.next; } this.byEnd[chunk.end] = chunk; this.byStart[chunk.next.start] = chunk.next; this.byEnd[chunk.next.end] = chunk.next; } if (aborted) { return true; } chunk = chunk.next; } while (chunk); return false; }; MagicString.prototype.trimStart = function trimStart (charType) { this.trimStartAborted(charType); return this; }; function escape(str) { return str.replace(/[-[\]/{}()*+?.\\^$|]/g, '\\$&'); } function isSourceMapEnabled(options) { if (options) { return options.sourceMap !== false && options.sourcemap !== false; } return false; } // Need to mock this rather than rely on JavaScript String.prototype.padEnd() as it doesn't always // exists in the build / test infrastructure function padEnd(input, len, fill) { var value = input || ""; while (value.length < len) { value += fill; } if (value.length > len) { value = value.substring(0, len); } return value; } function isNullOrWhitespace(value) { if (value) { return value.replace(/\s/g, "").length < 1; } return true; } /** * Simple Rush plugin to remove code that is wrapped between specific comments, this is used to * remove the boilerplate code require by typescript to define methods as prototype level while * using @ms-dynamicProto project to support minification. This can also be used to remove "debug" * functions from the production code. */ function dynamicRemove(options) { if (options === void 0) { options = {}; } var token = (options || {}).tagname || "@DynamicProtoStub"; var replaceValue = (options || {}).comment || "// Removed Stub for %function%."; var tokenGroups = [4, 10, 13]; var funcNameGroup = 6; // Because of the test infrastructure (PhamtonJS) the RegEx can't use the "s" flag (gis vs gi) or named groups var pattern = new RegExp("([\\t ]*\\/\\*\\*((?!\\*\\/)(.|\\r|\\n))*\\*\\/[\\s]*)*(\\/\\/[\\t ]*" + escape(token) + "[^\\r\\n]*(\\r\\n|\\n\\r|\\r|\\n))*[\\t ]*([\\w]*\\.prototype(\\.|\\[\\\"|\\[\\')[\\w]*(\\\"\\]|\\'\\])?)[\\t ]*=[\\t ]*function[\\t ]*\\([^\\{]*\\{[^\\/\\}\\{]*(\\{[^\\}]*\\}[^\\/\\}\\{]*)*(\\/[\\*\\/][\\t ]*" + escape(token) + "[^\\*\\r\\n]*(\\*\\/)?(\\r\\n|\\n\\r|\\r|\\n))*[^\\}]*\\};([\\t ]*\\/\\/[\\t ]*" + escape(token) + "[^\\r\\n]*)*", 'gi'); function formatError(token, code, pos, id) { var lines = code.split(/(?:\r\n|\n\r|\r|\n)/); var lineNumber = 0; var count = pos; while (count > 0) { lineNumber++; count = code.lastIndexOf("\n", count - 1); } var column = 0; var lineStart = code.lastIndexOf("\n", pos); if (lineStart != -1) { column = (pos - lineStart); } else { column = pos + 1; } var message = "Invalid (Unremoved) token [" + token + "] found on line [" + lineNumber + "], column [" + column + "], position [" + pos + "] - " + (id || "") + "\n"; var marker = padEnd("", token.length, "^"); var line = lineNumber - 6; if (line > 0) { message += " ...\n"; } count = 0; while (count < 10 && line < lines.length - 1) { count++; if (line >= 0) { var number = padEnd("" + (line + 1), 4, " "); message += number + ":" + lines[line] + "\n"; if (line == lineNumber - 1) { message += padEnd("", column + 4, " ") + marker + "\n"; } } line++; } if (line < lines.length - 1) { message += " ...\n"; } var match; var matchCount = 0; while ((match = pattern.exec(code))) { var funcName = match[funcNameGroup]; if (!isNullOrWhitespace(funcName)) { if (matchCount == 0) { message += "\nMatch checks\n"; } matchCount++; if (match[0].length > 0) { message += "Match " + matchCount + " tag Groups for " + (funcName || "") + "\n"; message += "--=( Complete Matched Content )=--\n"; message += match[0]; message += "\n--------------------------------\n"; for (var lp = 1; lp < match.length; lp++) { if (match[lp]) { message += "" + lp + ": " + (match[lp] || "").replace(/\n/g, "\\n").replace(/\r/g, "\\r"); if ((match[lp] || "").indexOf(token) != -1) { message += " <- Contains tag"; } message += "\n"; } } message += "\n"; } } } return message; } function replaceToken(code, theString) { var result = false; var match; while ((match = pattern.exec(code))) { var funcName = match[funcNameGroup]; if (!isNullOrWhitespace(funcName)) { // Only remove matches that contain a tag and function var hasToken = false; for (var lp = 0; lp < tokenGroups.length; lp++) { if ((match[tokenGroups[lp]] || "").indexOf(token) != -1) { hasToken = true; break; } } if (hasToken) { result = true; var start = match.index; var newValue = replaceValue.replace("%function%", funcName); theString.overwrite(start, start + match[0].length, newValue); } } } return result; } function checkResult(result, id) { if (result) { var pos = result.indexOf(token); if (pos != -1) { throw new Error(formatError(token, result, pos, id)); } } } function doTransform(code, id) { var theString = new MagicString(code); if (!replaceToken(code, theString)) { return null; } var result = { code: theString.toString() }; if (isSourceMapEnabled(options)) { result.map = theString.generateMap({ hires: true }); } return result; } function doTransformAndCheck(code, id) { var result = doTransform(code); if (result) { // Do a final check of the string checkResult(result.code, id); } else { // Check that the raw input doesn't include the tag checkResult(code, id); } return result; } return { name: 'dynamicRemove', renderChunk: function (code, chunk) { return doTransformAndCheck(code, chunk.filename); }, transform: doTransformAndCheck }; } return dynamicRemove; })); 'use strict'; module.exports = function () { return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g; }; The MIT License (MIT) Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "name": "ansi-regex", "version": "2.1.1", "description": "Regular expression for matching ANSI escape codes", "license": "MIT", "repository": "chalk/ansi-regex", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "maintainers": [ "Sindre Sorhus (sindresorhus.com)", "Joshua Appelman (jbnicolai.com)", "JD Ballard (github.com/qix-)" ], "engines": { "node": ">=0.10.0" }, "scripts": { "test": "xo && ava --verbose", "view-supported": "node fixtures/view-codes.js" }, "files": [ "index.js" ], "keywords": [ "ansi", "styles", "color", "colour", "colors", "terminal", "console", "cli", "string", "tty", "escape", "formatting", "rgb", "256", "shell", "xterm", "command-line", "text", "regex", "regexp", "re", "match", "test", "find", "pattern" ], "devDependencies": { "ava": "0.17.0", "xo": "0.16.0" }, "xo": { "rules": { "guard-for-in": 0, "no-loop-func": 0 } } } var Buffer = require('buffer').Buffer; var CRC_TABLE = [ 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d ]; if (typeof Int32Array !== 'undefined') { CRC_TABLE = new Int32Array(CRC_TABLE); } function ensureBuffer(input) { if (Buffer.isBuffer(input)) { return input; } var hasNewBufferAPI = typeof Buffer.alloc === "function" && typeof Buffer.from === "function"; if (typeof input === "number") { return hasNewBufferAPI ? Buffer.alloc(input) : new Buffer(input); } else if (typeof input === "string") { return hasNewBufferAPI ? Buffer.from(input) : new Buffer(input); } else { throw new Error("input must be buffer, number, or string, received " + typeof input); } } function bufferizeInt(num) { var tmp = ensureBuffer(4); tmp.writeInt32BE(num, 0); return tmp; } function _crc32(buf, previous) { buf = ensureBuffer(buf); if (Buffer.isBuffer(previous)) { previous = previous.readUInt32BE(0); } var crc = ~~previous ^ -1; for (var n = 0; n < buf.length; n++) { crc = CRC_TABLE[(crc ^ buf[n]) & 0xff] ^ (crc >>> 8); } return (crc ^ -1); } function crc32() { return bufferizeInt(_crc32.apply(null, arguments)); } crc32.signed = function () { return _crc32.apply(null, arguments); }; crc32.unsigned = function () { return _crc32.apply(null, arguments) >>> 0; }; module.exports = crc32; The MIT License Copyright (c) 2013 Brian J. Brennan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. { "author": "Brian J. Brennan ", "name": "buffer-crc32", "description": "A pure javascript CRC32 algorithm that plays nice with binary data", "version": "0.2.13", "licenses": [ { "type": "MIT", "url": "https://github.com/brianloveswords/buffer-crc32/raw/master/LICENSE" } ], "contributors": [ { "name": "Vladimir Kuznetsov", "github": "mistakster" } ], "homepage": "https://github.com/brianloveswords/buffer-crc32", "repository": { "type": "git", "url": "git://github.com/brianloveswords/buffer-crc32.git" }, "main": "index.js", "scripts": { "test": "./node_modules/.bin/tap tests/*.test.js" }, "dependencies": {}, "devDependencies": { "tap": "~0.2.5" }, "optionalDependencies": {}, "engines": { "node": "*" }, "license": "MIT", "files": [ "index.js" ] } module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=152)}([function(e,t,n){var r=n(2),i=n(19),o=n(12),a=n(13),s=n(20),c=function(e,t,n){var p,d,u,l,m=e&c.F,f=e&c.G,h=e&c.S,g=e&c.P,y=e&c.B,b=f?r:h?r[t]||(r[t]={}):(r[t]||{}).prototype,v=f?i:i[t]||(i[t]={}),w=v.prototype||(v.prototype={});for(p in f&&(n=t),n)u=((d=!m&&b&&void 0!==b[p])?b:n)[p],l=y&&d?s(u,r):g&&"function"==typeof u?s(Function.call,u):u,b&&a(b,p,u,e&c.U),v[p]!=u&&o(v,p,l),g&&w[p]!=u&&(w[p]=u)};r.core=i,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},function(e,t,n){var r=n(4);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(51)("wks"),i=n(35),o=n(2).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},function(e,t,n){var r=n(22),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t,n){e.exports=!n(3)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(e,t,n){var r=n(1),i=n(103),o=n(24),a=Object.defineProperty;t.f=n(7)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(25);e.exports=function(e){return Object(r(e))}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(8),i=n(34);e.exports=n(7)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(2),i=n(12),o=n(15),a=n(35)("src"),s=n(156),c=(""+s).split("toString");n(19).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var p="function"==typeof n;p&&(o(n,"name")||i(n,"name",t)),e[t]!==n&&(p&&(o(n,a)||i(n,a,e[t]?""+e[t]:c.join(String(t)))),e===r?e[t]=n:s?e[t]?e[t]=n:i(e,t,n):(delete e[t],i(e,t,n)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[a]||s.call(this)}))},function(e,t,n){var r=n(0),i=n(3),o=n(25),a=/"/g,s=function(e,t,n,r){var i=String(o(e)),s="<"+t;return""!==n&&(s+=" "+n+'="'+String(r).replace(a,""")+'"'),s+">"+i+""};e.exports=function(e,t){var n={};n[e]=t(s),r(r.P+r.F*i((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3})),"String",n)}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(52),i=n(25);e.exports=function(e){return r(i(e))}},function(e,t,n){var r=n(53),i=n(34),o=n(16),a=n(24),s=n(15),c=n(103),p=Object.getOwnPropertyDescriptor;t.f=n(7)?p:function(e,t){if(e=o(e),t=a(t,!0),c)try{return p(e,t)}catch(e){}if(s(e,t))return i(!r.f.call(e,t),e[t])}},function(e,t,n){var r=n(15),i=n(9),o=n(78)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t){var n=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=n)},function(e,t,n){var r=n(10);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){"use strict";var r=n(3);e.exports=function(e,t){return!!e&&r((function(){t?e.call(null,(function(){}),1):e.call(null)}))}},function(e,t,n){var r=n(4);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(0),i=n(19),o=n(3);e.exports=function(e,t){var n=(i.Object||{})[e]||Object[e],a={};a[e]=t(n),r(r.S+r.F*o((function(){n(1)})),"Object",a)}},function(e,t,n){var r=n(20),i=n(52),o=n(9),a=n(6),s=n(94);e.exports=function(e,t){var n=1==e,c=2==e,p=3==e,d=4==e,u=6==e,l=5==e||u,m=t||s;return function(t,s,f){for(var h,g,y=o(t),b=i(y),v=r(s,f,3),w=a(b.length),S=0,x=n?m(t,w):c?m(t,0):void 0;w>S;S++)if((l||S in b)&&(g=v(h=b[S],S,y),e))if(n)x[S]=g;else if(g)switch(e){case 3:return!0;case 5:return h;case 6:return S;case 2:x.push(h)}else if(d)return!1;return u?-1:p||d?d:x}}},function(e,t,n){"use strict";if(n(7)){var r=n(31),i=n(2),o=n(3),a=n(0),s=n(69),c=n(102),p=n(20),d=n(41),u=n(34),l=n(12),m=n(43),f=n(22),h=n(6),g=n(131),y=n(37),b=n(24),v=n(15),w=n(47),S=n(4),x=n(9),I=n(91),T=n(38),R=n(18),k=n(39).f,C=n(93),O=n(35),$=n(5),E=n(27),D=n(59),j=n(55),P=n(96),A=n(49),M=n(64),N=n(40),_=n(95),L=n(120),q=n(8),F=n(17),U=q.f,B=F.f,W=i.RangeError,H=i.TypeError,z=i.Uint8Array,V=Array.prototype,G=c.ArrayBuffer,J=c.DataView,X=E(0),Y=E(2),K=E(3),Q=E(4),Z=E(5),ee=E(6),te=D(!0),ne=D(!1),re=P.values,ie=P.keys,oe=P.entries,ae=V.lastIndexOf,se=V.reduce,ce=V.reduceRight,pe=V.join,de=V.sort,ue=V.slice,le=V.toString,me=V.toLocaleString,fe=$("iterator"),he=$("toStringTag"),ge=O("typed_constructor"),ye=O("def_constructor"),be=s.CONSTR,ve=s.TYPED,we=s.VIEW,Se=E(1,(function(e,t){return ke(j(e,e[ye]),t)})),xe=o((function(){return 1===new z(new Uint16Array([1]).buffer)[0]})),Ie=!!z&&!!z.prototype.set&&o((function(){new z(1).set({})})),Te=function(e,t){var n=f(e);if(n<0||n%t)throw W("Wrong offset!");return n},Re=function(e){if(S(e)&&ve in e)return e;throw H(e+" is not a typed array!")},ke=function(e,t){if(!S(e)||!(ge in e))throw H("It is not a typed array constructor!");return new e(t)},Ce=function(e,t){return Oe(j(e,e[ye]),t)},Oe=function(e,t){for(var n=0,r=t.length,i=ke(e,r);r>n;)i[n]=t[n++];return i},$e=function(e,t,n){U(e,t,{get:function(){return this._d[n]}})},Ee=function(e){var t,n,r,i,o,a,s=x(e),c=arguments.length,d=c>1?arguments[1]:void 0,u=void 0!==d,l=C(s);if(null!=l&&!I(l)){for(a=l.call(s),r=[],t=0;!(o=a.next()).done;t++)r.push(o.value);s=r}for(u&&c>2&&(d=p(d,arguments[2],2)),t=0,n=h(s.length),i=ke(this,n);n>t;t++)i[t]=u?d(s[t],t):s[t];return i},De=function(){for(var e=0,t=arguments.length,n=ke(this,t);t>e;)n[e]=arguments[e++];return n},je=!!z&&o((function(){me.call(new z(1))})),Pe=function(){return me.apply(je?ue.call(Re(this)):Re(this),arguments)},Ae={copyWithin:function(e,t){return L.call(Re(this),e,t,arguments.length>2?arguments[2]:void 0)},every:function(e){return Q(Re(this),e,arguments.length>1?arguments[1]:void 0)},fill:function(e){return _.apply(Re(this),arguments)},filter:function(e){return Ce(this,Y(Re(this),e,arguments.length>1?arguments[1]:void 0))},find:function(e){return Z(Re(this),e,arguments.length>1?arguments[1]:void 0)},findIndex:function(e){return ee(Re(this),e,arguments.length>1?arguments[1]:void 0)},forEach:function(e){X(Re(this),e,arguments.length>1?arguments[1]:void 0)},indexOf:function(e){return ne(Re(this),e,arguments.length>1?arguments[1]:void 0)},includes:function(e){return te(Re(this),e,arguments.length>1?arguments[1]:void 0)},join:function(e){return pe.apply(Re(this),arguments)},lastIndexOf:function(e){return ae.apply(Re(this),arguments)},map:function(e){return Se(Re(this),e,arguments.length>1?arguments[1]:void 0)},reduce:function(e){return se.apply(Re(this),arguments)},reduceRight:function(e){return ce.apply(Re(this),arguments)},reverse:function(){for(var e,t=Re(this).length,n=Math.floor(t/2),r=0;r1?arguments[1]:void 0)},sort:function(e){return de.call(Re(this),e)},subarray:function(e,t){var n=Re(this),r=n.length,i=y(e,r);return new(j(n,n[ye]))(n.buffer,n.byteOffset+i*n.BYTES_PER_ELEMENT,h((void 0===t?r:y(t,r))-i))}},Me=function(e,t){return Ce(this,ue.call(Re(this),e,t))},Ne=function(e){Re(this);var t=Te(arguments[1],1),n=this.length,r=x(e),i=h(r.length),o=0;if(i+t>n)throw W("Wrong length!");for(;o255?255:255&r),i.v[m](n*t+i.o,r,xe)}(this,n,e)},enumerable:!0})};v?(f=n((function(e,n,r,i){d(e,f,p,"_d");var o,a,s,c,u=0,m=0;if(S(n)){if(!(n instanceof G||"ArrayBuffer"==(c=w(n))||"SharedArrayBuffer"==c))return ve in n?Oe(f,n):Ee.call(f,n);o=n,m=Te(r,t);var y=n.byteLength;if(void 0===i){if(y%t)throw W("Wrong length!");if((a=y-m)<0)throw W("Wrong length!")}else if((a=h(i)*t)+m>y)throw W("Wrong length!");s=a/t}else s=g(n),o=new G(a=s*t);for(l(e,"_d",{b:o,o:m,l:a,e:s,v:new J(o)});u1)for(var n=1;ndocument.F=Object<\/script>"),e.close(),c=e.F;r--;)delete c.prototype[o[r]];return c()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[a]=e):n=c(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(105),i=n(79).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},function(e,t,n){"use strict";var r=n(2),i=n(8),o=n(7),a=n(5)("species");e.exports=function(e){var t=r[e];o&&t&&!t[a]&&i.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var r=n(20),i=n(118),o=n(91),a=n(1),s=n(6),c=n(93),p={},d={};(t=e.exports=function(e,t,n,u,l){var m,f,h,g,y=l?function(){return e}:c(e),b=r(n,u,t?2:1),v=0;if("function"!=typeof y)throw TypeError(e+" is not iterable!");if(o(y)){for(m=s(e.length);m>v;v++)if((g=t?b(a(f=e[v])[0],f[1]):b(e[v]))===p||g===d)return g}else for(h=y.call(e);!(f=h.next()).done;)if((g=i(h,b,f.value,t))===p||g===d)return g}).BREAK=p,t.RETURN=d},function(e,t,n){var r=n(13);e.exports=function(e,t,n){for(var i in t)r(e,i,t[i],n);return e}},function(e,t,n){var r=n(4);e.exports=function(e,t){if(!r(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},function(e,t,n){var r=n(8).f,i=n(15),o=n(5)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t,n){var r=n(21),i=n(5)("toStringTag"),o="Arguments"==r(function(){return arguments}());e.exports=function(e){var t,n,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?n:o?r(t):"Object"==(a=r(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t,n){var r=n(0),i=n(25),o=n(3),a=n(82),s="["+a+"]",c=RegExp("^"+s+s+"*"),p=RegExp(s+s+"*$"),d=function(e,t,n){var i={},s=o((function(){return!!a[e]()||"​…"!="​…"[e]()})),c=i[e]=s?t(u):a[e];n&&(i[n]=c),r(r.P+r.F*s,"String",i)},u=d.trim=function(e,t){return e=String(i(e)),1&t&&(e=e.replace(c,"")),2&t&&(e=e.replace(p,"")),e};e.exports=d},function(e,t){e.exports={}},function(e,t,n){"use strict";var r=n(73),i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=u;var o=Object.create(n(58));o.inherits=n(45);var a=n(145),s=n(148);o.inherits(u,a);for(var c=i(s.prototype),p=0;p0&&a.length>i&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,s=c,console&&console.warn&&console.warn(s)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function m(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=l.bind(r);return i.listener=n,r.wrapFn=i,i}function f(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var c=i[e];if(void 0===c)return!1;if("function"==typeof c)o(c,this,t);else{var p=c.length,d=g(c,p);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return f(this,e,!0)},s.prototype.rawListeners=function(e){return f(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){"use strict";(function(e){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ var r=n(357),i=n(358),o=n(141);function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function f(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return F(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return U(e).length;default:if(r)return F(e).length;t=(""+t).toLowerCase(),r=!0}}function h(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return $(this,t,n);case"utf8":case"utf-8":return k(this,t,n);case"ascii":return C(this,t,n);case"latin1":case"binary":return O(this,t,n);case"base64":return R(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:b(e,t,n,r,i);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,r,i){var o,a=1,s=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,n/=2}function p(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var d=-1;for(o=n;os&&(n=s-c),o=n;o>=0;o--){for(var u=!0,l=0;li&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function R(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function k(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:p>223?3:p>191?2:1;if(i+u<=n)switch(u){case 1:p<128&&(d=p);break;case 2:128==(192&(o=e[i+1]))&&(c=(31&p)<<6|63&o)>127&&(d=c);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(c=(15&p)<<12|(63&o)<<6|63&a)>2047&&(c<55296||c>57343)&&(d=c);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(c=(15&p)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&c<1114112&&(d=c)}null===d?(d=65533,u=1):d>65535&&(d-=65536,r.push(d>>>10&1023|55296),d=56320|1023&d),r.push(d),i+=u}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},c.prototype.compare=function(e,t,n,r,i){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),p=this.slice(r,i),d=e.slice(t,n),u=0;ui)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return v(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return S(this,e,t,n);case"latin1":case"binary":return x(this,e,t,n);case"base64":return I(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function C(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function j(e,t,n,r,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function P(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function A(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function M(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function N(e,t,n,r,o){return o||M(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function _(e,t,n,r,o){return o||M(e,0,n,8),i.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)r+=this[e+--t]*i;return r},c.prototype.readUInt8=function(e,t){return t||D(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||D(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||D(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||D(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||D(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return t||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||D(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){t||D(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||D(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||D(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||D(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||D(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||j(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+n},c.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):A(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):A(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);j(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},c.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);j(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):A(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):A(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,n){return N(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return N(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return _(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return _(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(o<1e3||!c.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function U(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function B(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(11))},function(e,t,n){(function(e){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,n(57).Buffer)},function(e,t,n){var r=n(16),i=n(6),o=n(37);e.exports=function(e){return function(t,n,a){var s,c=r(t),p=i(c.length),d=o(a,p);if(e&&n!=n){for(;p>d;)if((s=c[d++])!=s)return!0}else for(;p>d;d++)if((e||d in c)&&c[d]===n)return e||d||0;return!e&&-1}}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,n){var r=n(21);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t,n){var r=n(22),i=n(25);e.exports=function(e){return function(t,n){var o,a,s=String(i(t)),c=r(n),p=s.length;return c<0||c>=p?e?"":void 0:(o=s.charCodeAt(c))<55296||o>56319||c+1===p||(a=s.charCodeAt(c+1))<56320||a>57343?e?s.charAt(c):o:e?s.slice(c,c+2):a-56320+(o-55296<<10)+65536}}},function(e,t,n){var r=n(4),i=n(21),o=n(5)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==i(e))}},function(e,t,n){var r=n(5)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var o=[7],a=o[r]();a.next=function(){return{done:n=!0}},o[r]=function(){return a},e(o)}catch(e){}return n}},function(e,t,n){"use strict";var r=n(47),i=RegExp.prototype.exec;e.exports=function(e,t){var n=e.exec;if("function"==typeof n){var o=n.call(e,t);if("object"!=typeof o)throw new TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==r(e))throw new TypeError("RegExp#exec called on incompatible receiver");return i.call(e,t)}},function(e,t,n){"use strict";n(122);var r=n(13),i=n(12),o=n(3),a=n(25),s=n(5),c=n(97),p=s("species"),d=!o((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")})),u=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();e.exports=function(e,t,n){var l=s(e),m=!o((function(){var t={};return t[l]=function(){return 7},7!=""[e](t)})),f=m?!o((function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===e&&(n.constructor={},n.constructor[p]=function(){return n}),n[l](""),!t})):void 0;if(!m||!f||"replace"===e&&!d||"split"===e&&!u){var h=/./[l],g=n(a,l,""[e],(function(e,t,n,r,i){return t.exec===c?m&&!i?{done:!0,value:h.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}})),y=g[0],b=g[1];r(String.prototype,e,y),i(RegExp.prototype,l,2==t?function(e,t){return b.call(e,this,t)}:function(e){return b.call(e,this)})}}},function(e,t,n){var r=n(2).navigator;e.exports=r&&r.userAgent||""},function(e,t,n){"use strict";var r=n(2),i=n(0),o=n(13),a=n(43),s=n(32),c=n(42),p=n(41),d=n(4),u=n(3),l=n(64),m=n(46),f=n(83);e.exports=function(e,t,n,h,g,y){var b=r[e],v=b,w=g?"set":"add",S=v&&v.prototype,x={},I=function(e){var t=S[e];o(S,e,"delete"==e||"has"==e?function(e){return!(y&&!d(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return y&&!d(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,n){return t.call(this,0===e?0:e,n),this})};if("function"==typeof v&&(y||S.forEach&&!u((function(){(new v).entries().next()})))){var T=new v,R=T[w](y?{}:-0,1)!=T,k=u((function(){T.has(1)})),C=l((function(e){new v(e)})),O=!y&&u((function(){for(var e=new v,t=5;t--;)e[w](t,t);return!e.has(-0)}));C||((v=t((function(t,n){p(t,v,e);var r=f(new b,t,v);return null!=n&&c(n,g,r[w],r),r}))).prototype=S,S.constructor=v),(k||O)&&(I("delete"),I("has"),g&&I("get")),(O||R)&&I(w),y&&S.clear&&delete S.clear}else v=h.getConstructor(t,e,g,w),a(v.prototype,n),s.NEED=!0;return m(v,e),x[e]=v,i(i.G+i.W+i.F*(v!=b),x),y||h.setStrong(v,e,g),v}},function(e,t,n){for(var r,i=n(2),o=n(12),a=n(35),s=a("typed_array"),c=a("view"),p=!(!i.ArrayBuffer||!i.DataView),d=p,u=0,l="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");u<9;)(r=i[l[u++]])?(o(r.prototype,s,!0),o(r.prototype,c,!0)):d=!1;e.exports={ABV:p,CONSTR:d,TYPED:s,VIEW:c}},function(e,t,n){"use strict";e.exports=n(31)||!n(3)((function(){var e=Math.random();__defineSetter__.call(null,e,(function(){})),delete n(2)[e]}))},function(e,t,n){"use strict";var r=n(0);e.exports=function(e){r(r.S,e,{of:function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];return new this(t)}})}},function(e,t,n){"use strict";var r=n(0),i=n(10),o=n(20),a=n(42);e.exports=function(e){r(r.S,e,{from:function(e){var t,n,r,s,c=arguments[1];return i(this),(t=void 0!==c)&&i(c),null==e?new this:(n=[],t?(r=0,s=o(c,arguments[2],2),a(e,!1,(function(e){n.push(s(e,r++))}))):a(e,!1,n.push,n),new this(n))}})}},function(e,t,n){"use strict";(function(t){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,n,r,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,n)}));case 3:return t.nextTick((function(){e.call(null,n,r)}));case 4:return t.nextTick((function(){e.call(null,n,r,i)}));default:for(o=new Array(s-1),a=0;a",'"',"`"," ","\r","\n","\t"]),d=["'"].concat(p),u=["%","/","?",";","#"].concat(d),l=["/","?","#"],m=/^[+a-z0-9A-Z_-]{0,63}$/,f=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,h={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=n(372);function v(e,t,n){if(e&&i.isObject(e)&&e instanceof o)return e;var r=new o;return r.parse(e,t,n),r}o.prototype.parse=function(e,t,n){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),s=-1!==o&&o127?P+="x":P+=j[A];if(!P.match(m)){var N=E.slice(0,C),_=E.slice(C+1),L=j.match(f);L&&(N.push(L[1]),_.unshift(L[2])),_.length&&(v="/"+_.join(".")+v),this.hostname=N.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),$||(this.hostname=r.toASCII(this.hostname));var q=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+q,this.href+=this.host,$&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==v[0]&&(v="/"+v))}if(!h[x])for(C=0,D=d.length;C0)&&n.host.split("@"))&&(n.auth=$.shift(),n.host=n.hostname=$.shift());return n.search=e.search,n.query=e.query,i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!I.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var R=I.slice(-1)[0],k=(n.host||e.host||I.length>1)&&("."===R||".."===R)||""===R,C=0,O=I.length;O>=0;O--)"."===(R=I[O])?I.splice(O,1):".."===R?(I.splice(O,1),C++):C&&(I.splice(O,1),C--);if(!S&&!x)for(;C--;C)I.unshift("..");!S||""===I[0]||I[0]&&"/"===I[0].charAt(0)||I.unshift(""),k&&"/"!==I.join("/").substr(-1)&&I.push("");var $,E=""===I[0]||I[0]&&"/"===I[0].charAt(0);T&&(n.hostname=n.host=E?"":I.length?I.shift():"",($=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=$.shift(),n.host=n.hostname=$.shift()));return(S=S||n.host&&I.length)&&!E&&I.unshift(""),I.length?n.pathname=I.join("/"):(n.pathname=null,n.path=null),i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},o.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){var r=n(4),i=n(2).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t,n){var r=n(2),i=n(19),o=n(31),a=n(104),s=n(8).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:a.f(e)})}},function(e,t,n){var r=n(51)("keys"),i=n(35);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(2).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(4),i=n(1),o=function(e,t){if(i(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,r){try{(r=n(20)(Function.call,n(17).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return o(e,n),t?e.__proto__=n:r(e,n),e}}({},!1):void 0),check:o}},function(e,t){e.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},function(e,t,n){var r=n(4),i=n(81).set;e.exports=function(e,t,n){var o,a=t.constructor;return a!==n&&"function"==typeof a&&(o=a.prototype)!==n.prototype&&r(o)&&i&&i(e,o),e}},function(e,t,n){"use strict";var r=n(22),i=n(25);e.exports=function(e){var t=String(i(this)),n="",o=r(e);if(o<0||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(t+=t))1&o&&(n+=t);return n}},function(e,t){e.exports=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1}},function(e,t){var n=Math.expm1;e.exports=!n||n(10)>22025.465794806718||n(10)<22025.465794806718||-2e-17!=n(-2e-17)?function(e){return 0==(e=+e)?e:e>-1e-6&&e<1e-6?e+e*e/2:Math.exp(e)-1}:n},function(e,t,n){"use strict";var r=n(31),i=n(0),o=n(13),a=n(12),s=n(49),c=n(88),p=n(46),d=n(18),u=n(5)("iterator"),l=!([].keys&&"next"in[].keys()),m=function(){return this};e.exports=function(e,t,n,f,h,g,y){c(n,t,f);var b,v,w,S=function(e){if(!l&&e in R)return R[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},x=t+" Iterator",I="values"==h,T=!1,R=e.prototype,k=R[u]||R["@@iterator"]||h&&R[h],C=k||S(h),O=h?I?S("entries"):C:void 0,$="Array"==t&&R.entries||k;if($&&(w=d($.call(new e)))!==Object.prototype&&w.next&&(p(w,x,!0),r||"function"==typeof w[u]||a(w,u,m)),I&&k&&"values"!==k.name&&(T=!0,C=function(){return k.call(this)}),r&&!y||!l&&!T&&R[u]||a(R,u,C),s[t]=C,s[x]=m,h)if(b={values:I?C:S("values"),keys:g?C:S("keys"),entries:O},y)for(v in b)v in R||o(R,v,b[v]);else i(i.P+i.F*(l||T),t,b);return b}},function(e,t,n){"use strict";var r=n(38),i=n(34),o=n(46),a={};n(12)(a,n(5)("iterator"),(function(){return this})),e.exports=function(e,t,n){e.prototype=r(a,{next:i(1,n)}),o(e,t+" Iterator")}},function(e,t,n){var r=n(63),i=n(25);e.exports=function(e,t,n){if(r(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(e))}},function(e,t,n){var r=n(5)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,!"/./"[e](t)}catch(e){}}return!0}},function(e,t,n){var r=n(49),i=n(5)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||o[i]===e)}},function(e,t,n){"use strict";var r=n(8),i=n(34);e.exports=function(e,t,n){t in e?r.f(e,t,i(0,n)):e[t]=n}},function(e,t,n){var r=n(47),i=n(5)("iterator"),o=n(49);e.exports=n(19).getIteratorMethod=function(e){if(null!=e)return e[i]||e["@@iterator"]||o[r(e)]}},function(e,t,n){var r=n(245);e.exports=function(e,t){return new(r(e))(t)}},function(e,t,n){"use strict";var r=n(9),i=n(37),o=n(6);e.exports=function(e){for(var t=r(this),n=o(t.length),a=arguments.length,s=i(a>1?arguments[1]:void 0,n),c=a>2?arguments[2]:void 0,p=void 0===c?n:i(c,n);p>s;)t[s++]=e;return t}},function(e,t,n){"use strict";var r=n(33),i=n(121),o=n(49),a=n(16);e.exports=n(87)(Array,"Array",(function(e,t){this._t=a(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):i(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(e,t,n){"use strict";var r,i,o=n(54),a=RegExp.prototype.exec,s=String.prototype.replace,c=a,p=(r=/a/,i=/b*/g,a.call(r,"a"),a.call(i,"a"),0!==r.lastIndex||0!==i.lastIndex),d=void 0!==/()??/.exec("")[1];(p||d)&&(c=function(e){var t,n,r,i,c=this;return d&&(n=new RegExp("^"+c.source+"$(?!\\s)",o.call(c))),p&&(t=c.lastIndex),r=a.call(c,e),p&&r&&(c.lastIndex=c.global?r.index+r[0].length:t),d&&r&&r.length>1&&s.call(r[0],n,(function(){for(i=1;in;)t.push(arguments[n++]);return y[++g]=function(){s("function"==typeof e?e:Function(e),t)},r(g),g},m=function(e){delete y[e]},"process"==n(21)(u)?r=function(e){u.nextTick(a(b,e,1))}:h&&h.now?r=function(e){h.now(a(b,e,1))}:f?(o=(i=new f).port2,i.port1.onmessage=v,r=a(o.postMessage,o,1)):d.addEventListener&&"function"==typeof postMessage&&!d.importScripts?(r=function(e){d.postMessage(e+"","*")},d.addEventListener("message",v,!1)):r="onreadystatechange"in p("script")?function(e){c.appendChild(p("script")).onreadystatechange=function(){c.removeChild(this),b.call(e)}}:function(e){setTimeout(a(b,e,1),0)}),e.exports={set:l,clear:m}},function(e,t,n){var r=n(2),i=n(99).set,o=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,c="process"==n(21)(a);e.exports=function(){var e,t,n,p=function(){var r,i;for(c&&(r=a.domain)&&r.exit();e;){i=e.fn,e=e.next;try{i()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(c)n=function(){a.nextTick(p)};else if(!o||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var d=s.resolve(void 0);n=function(){d.then(p)}}else n=function(){i.call(r,p)};else{var u=!0,l=document.createTextNode("");new o(p).observe(l,{characterData:!0}),n=function(){l.data=u=!u}}return function(r){var i={fn:r,next:void 0};t&&(t.next=i),e||(e=i,n()),t=i}}},function(e,t,n){"use strict";var r=n(10);function i(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)}e.exports.f=function(e){return new i(e)}},function(e,t,n){"use strict";var r=n(2),i=n(7),o=n(31),a=n(69),s=n(12),c=n(43),p=n(3),d=n(41),u=n(22),l=n(6),m=n(131),f=n(39).f,h=n(8).f,g=n(95),y=n(46),b=r.ArrayBuffer,v=r.DataView,w=r.Math,S=r.RangeError,x=r.Infinity,I=b,T=w.abs,R=w.pow,k=w.floor,C=w.log,O=w.LN2,$=i?"_b":"buffer",E=i?"_l":"byteLength",D=i?"_o":"byteOffset";function j(e,t,n){var r,i,o,a=new Array(n),s=8*n-t-1,c=(1<>1,d=23===t?R(2,-24)-R(2,-77):0,u=0,l=e<0||0===e&&1/e<0?1:0;for((e=T(e))!=e||e===x?(i=e!=e?1:0,r=c):(r=k(C(e)/O),e*(o=R(2,-r))<1&&(r--,o*=2),(e+=r+p>=1?d/o:d*R(2,1-p))*o>=2&&(r++,o/=2),r+p>=c?(i=0,r=c):r+p>=1?(i=(e*o-1)*R(2,t),r+=p):(i=e*R(2,p-1)*R(2,t),r=0));t>=8;a[u++]=255&i,i/=256,t-=8);for(r=r<0;a[u++]=255&r,r/=256,s-=8);return a[--u]|=128*l,a}function P(e,t,n){var r,i=8*n-t-1,o=(1<>1,s=i-7,c=n-1,p=e[c--],d=127&p;for(p>>=7;s>0;d=256*d+e[c],c--,s-=8);for(r=d&(1<<-s)-1,d>>=-s,s+=t;s>0;r=256*r+e[c],c--,s-=8);if(0===d)d=1-a;else{if(d===o)return r?NaN:p?-x:x;r+=R(2,t),d-=a}return(p?-1:1)*r*R(2,d-t)}function A(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function M(e){return[255&e]}function N(e){return[255&e,e>>8&255]}function _(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function L(e){return j(e,52,8)}function q(e){return j(e,23,4)}function F(e,t,n){h(e.prototype,t,{get:function(){return this[n]}})}function U(e,t,n,r){var i=m(+n);if(i+t>e[E])throw S("Wrong index!");var o=e[$]._b,a=i+e[D],s=o.slice(a,a+t);return r?s:s.reverse()}function B(e,t,n,r,i,o){var a=m(+n);if(a+t>e[E])throw S("Wrong index!");for(var s=e[$]._b,c=a+e[D],p=r(+i),d=0;dV;)(W=z[V++])in b||s(b,W,I[W]);o||(H.constructor=b)}var G=new v(new b(2)),J=v.prototype.setInt8;G.setInt8(0,2147483648),G.setInt8(1,2147483649),!G.getInt8(0)&&G.getInt8(1)||c(v.prototype,{setInt8:function(e,t){J.call(this,e,t<<24>>24)},setUint8:function(e,t){J.call(this,e,t<<24>>24)}},!0)}else b=function(e){d(this,b,"ArrayBuffer");var t=m(e);this._b=g.call(new Array(t),0),this[E]=t},v=function(e,t,n){d(this,v,"DataView"),d(e,b,"DataView");var r=e[E],i=u(t);if(i<0||i>r)throw S("Wrong offset!");if(i+(n=void 0===n?r-i:l(n))>r)throw S("Wrong length!");this[$]=e,this[D]=i,this[E]=n},i&&(F(b,"byteLength","_l"),F(v,"buffer","_b"),F(v,"byteLength","_l"),F(v,"byteOffset","_o")),c(v.prototype,{getInt8:function(e){return U(this,1,e)[0]<<24>>24},getUint8:function(e){return U(this,1,e)[0]},getInt16:function(e){var t=U(this,2,e,arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=U(this,2,e,arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return A(U(this,4,e,arguments[1]))},getUint32:function(e){return A(U(this,4,e,arguments[1]))>>>0},getFloat32:function(e){return P(U(this,4,e,arguments[1]),23,4)},getFloat64:function(e){return P(U(this,8,e,arguments[1]),52,8)},setInt8:function(e,t){B(this,1,e,M,t)},setUint8:function(e,t){B(this,1,e,M,t)},setInt16:function(e,t){B(this,2,e,N,t,arguments[2])},setUint16:function(e,t){B(this,2,e,N,t,arguments[2])},setInt32:function(e,t){B(this,4,e,_,t,arguments[2])},setUint32:function(e,t){B(this,4,e,_,t,arguments[2])},setFloat32:function(e,t){B(this,4,e,q,t,arguments[2])},setFloat64:function(e,t){B(this,8,e,L,t,arguments[2])}});y(b,"ArrayBuffer"),y(v,"DataView"),s(v.prototype,a.VIEW,!0),t.ArrayBuffer=b,t.DataView=v},function(e,t,n){e.exports=!n(7)&&!n(3)((function(){return 7!=Object.defineProperty(n(76)("div"),"a",{get:function(){return 7}}).a}))},function(e,t,n){t.f=n(5)},function(e,t,n){var r=n(15),i=n(16),o=n(59)(!1),a=n(78)("IE_PROTO");e.exports=function(e,t){var n,s=i(e),c=0,p=[];for(n in s)n!=a&&r(s,n)&&p.push(n);for(;t.length>c;)r(s,n=t[c++])&&(~o(p,n)||p.push(n));return p}},function(e,t,n){var r=n(8),i=n(1),o=n(36);e.exports=n(7)?Object.defineProperties:function(e,t){i(e);for(var n,a=o(t),s=a.length,c=0;s>c;)r.f(e,n=a[c++],t[n]);return e}},function(e,t,n){var r=n(16),i=n(39).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"==o.call(e)?function(e){try{return i(e)}catch(e){return a.slice()}}(e):i(r(e))}},function(e,t,n){"use strict";var r=n(7),i=n(36),o=n(60),a=n(53),s=n(9),c=n(52),p=Object.assign;e.exports=!p||n(3)((function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=p({},e)[n]||Object.keys(p({},t)).join("")!=r}))?function(e,t){for(var n=s(e),p=arguments.length,d=1,u=o.f,l=a.f;p>d;)for(var m,f=c(arguments[d++]),h=u?i(f).concat(u(f)):i(f),g=h.length,y=0;g>y;)m=h[y++],r&&!l.call(f,m)||(n[m]=f[m]);return n}:p},function(e,t){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},function(e,t,n){"use strict";var r=n(10),i=n(4),o=n(111),a=[].slice,s={},c=function(e,t,n){if(!(t in s)){for(var r=[],i=0;i>>0||(a.test(n)?16:10))}:r},function(e,t,n){var r=n(2).parseFloat,i=n(48).trim;e.exports=1/r(n(82)+"-0")!=-1/0?function(e){var t=i(String(e),3),n=r(t);return 0===n&&"-"==t.charAt(0)?-0:n}:r},function(e,t,n){var r=n(21);e.exports=function(e,t){if("number"!=typeof e&&"Number"!=r(e))throw TypeError(t);return+e}},function(e,t,n){var r=n(4),i=Math.floor;e.exports=function(e){return!r(e)&&isFinite(e)&&i(e)===e}},function(e,t){e.exports=Math.log1p||function(e){return(e=+e)>-1e-8&&e<1e-8?e-e*e/2:Math.log(1+e)}},function(e,t,n){var r=n(85),i=Math.pow,o=i(2,-52),a=i(2,-23),s=i(2,127)*(2-a),c=i(2,-126);e.exports=Math.fround||function(e){var t,n,i=Math.abs(e),p=r(e);return is||n!=n?p*(1/0):p*n}},function(e,t,n){var r=n(1);e.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var o=e.return;throw void 0!==o&&r(o.call(e)),t}}},function(e,t,n){var r=n(10),i=n(9),o=n(52),a=n(6);e.exports=function(e,t,n,s,c){r(t);var p=i(e),d=o(p),u=a(p.length),l=c?u-1:0,m=c?-1:1;if(n<2)for(;;){if(l in d){s=d[l],l+=m;break}if(l+=m,c?l<0:u<=l)throw TypeError("Reduce of empty array with no initial value")}for(;c?l>=0:u>l;l+=m)l in d&&(s=t(s,d[l],l,p));return s}},function(e,t,n){"use strict";var r=n(9),i=n(37),o=n(6);e.exports=[].copyWithin||function(e,t){var n=r(this),a=o(n.length),s=i(e,a),c=i(t,a),p=arguments.length>2?arguments[2]:void 0,d=Math.min((void 0===p?a:i(p,a))-c,a-s),u=1;for(c0;)c in n?n[s]=n[c]:delete n[s],s+=u,c+=u;return n}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){"use strict";var r=n(97);n(0)({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},function(e,t,n){n(7)&&"g"!=/./g.flags&&n(8).f(RegExp.prototype,"flags",{configurable:!0,get:n(54)})},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){var r=n(1),i=n(4),o=n(101);e.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=o.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){"use strict";var r=n(127),i=n(44);e.exports=n(68)("Map",(function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}}),{get:function(e){var t=r.getEntry(i(this,"Map"),e);return t&&t.v},set:function(e,t){return r.def(i(this,"Map"),0===e?0:e,t)}},r,!0)},function(e,t,n){"use strict";var r=n(8).f,i=n(38),o=n(43),a=n(20),s=n(41),c=n(42),p=n(87),d=n(121),u=n(40),l=n(7),m=n(32).fastKey,f=n(44),h=l?"_s":"size",g=function(e,t){var n,r=m(t);if("F"!==r)return e._i[r];for(n=e._f;n;n=n.n)if(n.k==t)return n};e.exports={getConstructor:function(e,t,n,p){var d=e((function(e,r){s(e,d,t,"_i"),e._t=t,e._i=i(null),e._f=void 0,e._l=void 0,e[h]=0,null!=r&&c(r,n,e[p],e)}));return o(d.prototype,{clear:function(){for(var e=f(this,t),n=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];e._f=e._l=void 0,e[h]=0},delete:function(e){var n=f(this,t),r=g(n,e);if(r){var i=r.n,o=r.p;delete n._i[r.i],r.r=!0,o&&(o.n=i),i&&(i.p=o),n._f==r&&(n._f=i),n._l==r&&(n._l=o),n[h]--}return!!r},forEach:function(e){f(this,t);for(var n,r=a(e,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(e){return!!g(f(this,t),e)}}),l&&r(d.prototype,"size",{get:function(){return f(this,t)[h]}}),d},def:function(e,t,n){var r,i,o=g(e,t);return o?o.v=n:(e._l=o={i:i=m(t,!0),k:t,v:n,p:r=e._l,n:void 0,r:!1},e._f||(e._f=o),r&&(r.n=o),e[h]++,"F"!==i&&(e._i[i]=o)),e},getEntry:g,setStrong:function(e,t,n){p(e,t,(function(e,n){this._t=f(e,t),this._k=n,this._l=void 0}),(function(){for(var e=this._k,t=this._l;t&&t.r;)t=t.p;return this._t&&(this._l=t=t?t.n:this._t._f)?d(0,"keys"==e?t.k:"values"==e?t.v:[t.k,t.v]):(this._t=void 0,d(1))}),n?"entries":"values",!n,!0),u(t)}}},function(e,t,n){"use strict";var r=n(127),i=n(44);e.exports=n(68)("Set",(function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(e){return r.def(i(this,"Set"),e=0===e?0:e,e)}},r)},function(e,t,n){"use strict";var r,i=n(2),o=n(27)(0),a=n(13),s=n(32),c=n(108),p=n(130),d=n(4),u=n(44),l=n(44),m=!i.ActiveXObject&&"ActiveXObject"in i,f=s.getWeak,h=Object.isExtensible,g=p.ufstore,y=function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},b={get:function(e){if(d(e)){var t=f(e);return!0===t?g(u(this,"WeakMap")).get(e):t?t[this._i]:void 0}},set:function(e,t){return p.def(u(this,"WeakMap"),e,t)}},v=e.exports=n(68)("WeakMap",y,b,p,!0,!0);l&&m&&(c((r=p.getConstructor(y,"WeakMap")).prototype,b),s.NEED=!0,o(["delete","has","get","set"],(function(e){var t=v.prototype,n=t[e];a(t,e,(function(t,i){if(d(t)&&!h(t)){this._f||(this._f=new r);var o=this._f[e](t,i);return"set"==e?this:o}return n.call(this,t,i)}))})))},function(e,t,n){"use strict";var r=n(43),i=n(32).getWeak,o=n(1),a=n(4),s=n(41),c=n(42),p=n(27),d=n(15),u=n(44),l=p(5),m=p(6),f=0,h=function(e){return e._l||(e._l=new g)},g=function(){this.a=[]},y=function(e,t){return l(e.a,(function(e){return e[0]===t}))};g.prototype={get:function(e){var t=y(this,e);if(t)return t[1]},has:function(e){return!!y(this,e)},set:function(e,t){var n=y(this,e);n?n[1]=t:this.a.push([e,t])},delete:function(e){var t=m(this.a,(function(t){return t[0]===e}));return~t&&this.a.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,n,o){var p=e((function(e,r){s(e,p,t,"_i"),e._t=t,e._i=f++,e._l=void 0,null!=r&&c(r,n,e[o],e)}));return r(p.prototype,{delete:function(e){if(!a(e))return!1;var n=i(e);return!0===n?h(u(this,t)).delete(e):n&&d(n,this._i)&&delete n[this._i]},has:function(e){if(!a(e))return!1;var n=i(e);return!0===n?h(u(this,t)).has(e):n&&d(n,this._i)}}),p},def:function(e,t,n){var r=i(o(t),!0);return!0===r?h(e).set(t,n):r[e._i]=n,e},ufstore:h}},function(e,t,n){var r=n(22),i=n(6);e.exports=function(e){if(void 0===e)return 0;var t=r(e),n=i(t);if(t!==n)throw RangeError("Wrong length!");return n}},function(e,t,n){var r=n(39),i=n(60),o=n(1),a=n(2).Reflect;e.exports=a&&a.ownKeys||function(e){var t=r.f(o(e)),n=i.f;return n?t.concat(n(e)):t}},function(e,t,n){"use strict";var r=n(61),i=n(4),o=n(6),a=n(20),s=n(5)("isConcatSpreadable");e.exports=function e(t,n,c,p,d,u,l,m){for(var f,h,g=d,y=0,b=!!l&&a(l,m,3);y0)g=e(t,n,f,o(f.length),g,u-1)-1;else{if(g>=9007199254740991)throw TypeError();t[g]=f}g++}y++}return g}},function(e,t,n){var r=n(6),i=n(84),o=n(25);e.exports=function(e,t,n,a){var s=String(o(e)),c=s.length,p=void 0===n?" ":String(n),d=r(t);if(d<=c||""==p)return s;var u=d-c,l=i.call(p,Math.ceil(u/p.length));return l.length>u&&(l=l.slice(0,u)),a?l+s:s+l}},function(e,t,n){var r=n(7),i=n(36),o=n(16),a=n(53).f;e.exports=function(e){return function(t){for(var n,s=o(t),c=i(s),p=c.length,d=0,u=[];p>d;)n=c[d++],r&&!a.call(s,n)||u.push(e?[n,s[n]]:s[n]);return u}}},function(e,t,n){var r=n(47),i=n(137);e.exports=function(e){return function(){if(r(this)!=e)throw TypeError(e+"#toJSON isn't generic");return i(this)}}},function(e,t,n){var r=n(42);e.exports=function(e,t){var n=[];return r(e,!1,n.push,n,t),n}},function(e,t){e.exports=Math.scale||function(e,t,n,r,i){return 0===arguments.length||e!=e||t!=t||n!=n||r!=r||i!=i?NaN:e===1/0||e===-1/0?e:(e-t)*(i-r)/(n-t)+r}},function(e,t,n){"use strict";const r=n(140),i=n(375),o=n(151),a=n(376);function s(e,t){e.host=e.host||o.HOST,e.port=e.port||o.PORT,e.secure=!!e.secure,e.useHostName=!!e.useHostName,e.alterPath=e.alterPath||(e=>e);const n={...e};n.path=e.alterPath(e.path),a(e.secure?i:r,n,t)}function c(e){return(t,n)=>("function"==typeof t&&(n=t,t=void 0),t=t||{},"function"==typeof n?void e(t,n):new Promise((n,r)=>{e(t,(e,t)=>{e?r(e):n(t)})}))}e.exports.Protocol=c((function(e,t){if(e.local){const e=n(377);t(null,e)}else e.path="/json/protocol",s(e,(e,n)=>{e?t(e):t(null,JSON.parse(n))})})),e.exports.List=c((function(e,t){e.path="/json/list",s(e,(e,n)=>{e?t(e):t(null,JSON.parse(n))})})),e.exports.New=c((function(e,t){e.path="/json/new",Object.prototype.hasOwnProperty.call(e,"url")&&(e.path+=`?${e.url}`),s(e,(e,n)=>{e?t(e):t(null,JSON.parse(n))})})),e.exports.Activate=c((function(e,t){e.path="/json/activate/"+e.id,s(e,e=>{t(e||null)})})),e.exports.Close=c((function(e,t){e.path="/json/close/"+e.id,s(e,e=>{t(e||null)})})),e.exports.Version=c((function(e,t){e.path="/json/version",s(e,(e,n)=>{e?t(e):t(null,JSON.parse(n))})}))},function(e,t,n){(function(e){var r=n(356),i=n(143),o=n(367),a=n(368),s=n(75),c=t;c.request=function(t,n){t="string"==typeof t?s.parse(t):o(t);var i=-1===e.location.protocol.search(/^https?:$/)?"http:":"",a=t.protocol||i,c=t.hostname||t.host,p=t.port,d=t.path||"/";c&&-1!==c.indexOf(":")&&(c="["+c+"]"),t.url=(c?a+"//"+c:"")+(p?":"+p:"")+d,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{};var u=new r(t);return n&&u.on("response",n),u},c.get=function(e,t){var n=c.request(e,t);return n.end(),n},c.ClientRequest=r,c.IncomingMessage=i.IncomingMessage,c.Agent=function(){},c.Agent.defaultMaxSockets=4,c.globalAgent=new c.Agent,c.STATUS_CODES=a,c.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,n(11))},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){(function(e){t.fetch=s(e.fetch)&&s(e.ReadableStream),t.writableStream=s(e.WritableStream),t.abortController=s(e.AbortController),t.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),t.blobConstructor=!0}catch(e){}var n;function r(){if(void 0!==n)return n;if(e.XMLHttpRequest){n=new e.XMLHttpRequest;try{n.open("GET",e.XDomainRequest?"/":"https://example.com")}catch(e){n=null}}else n=null;return n}function i(e){var t=r();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(e){}return!1}var o=void 0!==e.ArrayBuffer,a=o&&s(e.ArrayBuffer.prototype.slice);function s(e){return"function"==typeof e}t.arraybuffer=t.fetch||o&&i("arraybuffer"),t.msstream=!t.fetch&&a&&i("ms-stream"),t.mozchunkedarraybuffer=!t.fetch&&o&&i("moz-chunked-arraybuffer"),t.overrideMimeType=t.fetch||!!r()&&s(r().overrideMimeType),t.vbArray=s(e.VBArray),n=null}).call(this,n(11))},function(e,t,n){(function(e,r,i){var o=n(142),a=n(45),s=n(144),c=t.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},p=t.IncomingMessage=function(t,n,a,c){var p=this;if(s.Readable.call(p),p._mode=a,p.headers={},p.rawHeaders=[],p.trailers={},p.rawTrailers=[],p.on("end",(function(){e.nextTick((function(){p.emit("close")}))})),"fetch"===a){if(p._fetchResponse=n,p.url=n.url,p.statusCode=n.status,p.statusMessage=n.statusText,n.headers.forEach((function(e,t){p.headers[t.toLowerCase()]=e,p.rawHeaders.push(t,e)})),o.writableStream){var d=new WritableStream({write:function(e){return new Promise((function(t,n){p._destroyed?n():p.push(new r(e))?t():p._resumeFetch=t}))},close:function(){i.clearTimeout(c),p._destroyed||p.push(null)},abort:function(e){p._destroyed||p.emit("error",e)}});try{return void n.body.pipeTo(d).catch((function(e){i.clearTimeout(c),p._destroyed||p.emit("error",e)}))}catch(e){}}var u=n.body.getReader();!function e(){u.read().then((function(t){if(!p._destroyed){if(t.done)return i.clearTimeout(c),void p.push(null);p.push(new r(t.value)),e()}})).catch((function(e){i.clearTimeout(c),p._destroyed||p.emit("error",e)}))}()}else{if(p._xhr=t,p._pos=0,p.url=t.responseURL,p.statusCode=t.status,p.statusMessage=t.statusText,t.getAllResponseHeaders().split(/\r?\n/).forEach((function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var n=t[1].toLowerCase();"set-cookie"===n?(void 0===p.headers[n]&&(p.headers[n]=[]),p.headers[n].push(t[2])):void 0!==p.headers[n]?p.headers[n]+=", "+t[2]:p.headers[n]=t[2],p.rawHeaders.push(t[1],t[2])}})),p._charset="x-user-defined",!o.overrideMimeType){var l=p.rawHeaders["mime-type"];if(l){var m=l.match(/;\s*charset=([^;])(;|$)/);m&&(p._charset=m[1].toLowerCase())}p._charset||(p._charset="utf-8")}}};a(p,s.Readable),p.prototype._read=function(){var e=this._resumeFetch;e&&(this._resumeFetch=null,e())},p.prototype._onXHRProgress=function(){var e=this,t=e._xhr,n=null;switch(e._mode){case"text:vbarray":if(t.readyState!==c.DONE)break;try{n=new i.VBArray(t.responseBody).toArray()}catch(e){}if(null!==n){e.push(new r(n));break}case"text":try{n=t.responseText}catch(t){e._mode="text:vbarray";break}if(n.length>e._pos){var o=n.substr(e._pos);if("x-user-defined"===e._charset){for(var a=new r(o.length),s=0;se._pos&&(e.push(new r(new Uint8Array(p.result.slice(e._pos)))),e._pos=p.result.byteLength)},p.onload=function(){e.push(null)},p.readAsArrayBuffer(n)}e._xhr.readyState===c.DONE&&"ms-stream"!==e._mode&&e.push(null)}}).call(this,n(30),n(57).Buffer,n(11))},function(e,t,n){(t=e.exports=n(145)).Stream=t,t.Readable=t,t.Writable=n(148),t.Duplex=n(50),t.Transform=n(150),t.PassThrough=n(365)},function(e,t,n){"use strict";(function(t,r){var i=n(73);e.exports=v;var o,a=n(141);v.ReadableState=b;n(56).EventEmitter;var s=function(e,t){return e.listeners(t).length},c=n(146),p=n(74).Buffer,d=t.Uint8Array||function(){};var u=Object.create(n(58));u.inherits=n(45);var l=n(359),m=void 0;m=l&&l.debuglog?l.debuglog("stream"):function(){};var f,h=n(360),g=n(147);u.inherits(v,c);var y=["error","close","destroy","pause","resume"];function b(e,t){e=e||{};var r=t instanceof(o=o||n(50));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,a=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new h,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&&(f||(f=n(149).StringDecoder),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function v(e){if(o=o||n(50),!(this instanceof v))return new v(e);this._readableState=new b(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),c.call(this)}function w(e,t,n,r,i){var o,a=e._readableState;null===t?(a.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,I(e)}(e,a)):(i||(o=function(e,t){var n;r=t,p.isBuffer(r)||r instanceof d||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(a,t)),o?e.emit("error",o):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===p.prototype||(t=function(e){return p.from(e)}(t)),r?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):S(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?S(e,a,t,!1):R(e,a)):S(e,a,t,!1))):r||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function I(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(m("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(T,e):T(e))}function T(e){m("emit readable"),e.emit("readable"),$(e)}function R(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(k,e,t))}function k(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;eo.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++r}return t.length-=r,i}(e,t):function(e,t){var n=p.allocUnsafe(e),r=t.head,i=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(o.copy(n,n.length-e,0,a),0===(e-=a)){a===o.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++i}return t.length-=i,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function D(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(j,t,e))}function j(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function P(e,t){for(var n=0,r=e.length;n=t.highWaterMark||t.ended))return m("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?D(this):I(this),null;if(0===(e=x(e,t))&&t.ended)return 0===t.length&&D(this),null;var r,i=t.needReadable;return m("need readable",i),(0===t.length||t.length-e0?E(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&D(this)),null!==r&&this.emit("data",r),r},v.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},v.prototype.pipe=function(e,t){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,m("pipe count=%d opts=%j",o.pipesCount,t);var c=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?d:v;function p(t,r){m("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,m("cleanup"),e.removeListener("close",y),e.removeListener("finish",b),e.removeListener("drain",u),e.removeListener("error",g),e.removeListener("unpipe",p),n.removeListener("end",d),n.removeListener("end",v),n.removeListener("data",h),l=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}function d(){m("onend"),e.end()}o.endEmitted?i.nextTick(c):n.once("end",c),e.on("unpipe",p);var u=function(e){return function(){var t=e._readableState;m("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,$(e))}}(n);e.on("drain",u);var l=!1;var f=!1;function h(t){m("ondata"),f=!1,!1!==e.write(t)||f||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==P(o.pipes,e))&&!l&&(m("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,f=!0),n.pause())}function g(t){m("onerror",t),v(),e.removeListener("error",g),0===s(e,"error")&&e.emit("error",t)}function y(){e.removeListener("finish",b),v()}function b(){m("onfinish"),e.removeListener("close",y),v()}function v(){m("unpipe"),n.unpipe(e)}return n.on("data",h),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",g),e.once("close",y),e.once("finish",b),e.emit("pipe",n),o.flowing||(m("pipe resume"),n.resume()),e},v.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o-1?r:o.nextTick;b.WritableState=y;var p=Object.create(n(58));p.inherits=n(45);var d={deprecate:n(364)},u=n(146),l=n(74).Buffer,m=i.Uint8Array||function(){};var f,h=n(147);function g(){}function y(e,t){s=s||n(50),e=e||{};var r=t instanceof s;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,p=e.writableHighWaterMark,d=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(p||0===p)?p:d,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 u=!1===e.decodeStrings;this.decodeStrings=!u,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(o.nextTick(i,r),o.nextTick(T,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(i(r),e._writableState.errorEmitted=!0,e.emit("error",r),T(e,t))}(e,n,r,t,i);else{var a=x(n);a||n.corked||n.bufferProcessing||!n.bufferedRequest||S(e,n),r?c(w,e,n,a,i):w(e,n,a,i)}}(t,e)},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 a(this)}function b(e){if(s=s||n(50),!(f.call(b,this)||this instanceof s))return new b(e);this._writableState=new y(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)),u.call(this)}function v(e,t,n,r,i,o,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function w(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),T(e,t)}function S(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),o=t.corkedRequestsFree;o.entry=n;for(var s=0,c=!0;n;)i[s]=n,n.isBuf||(c=!1),n=n.next,s+=1;i.allBuffers=c,v(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;n;){var p=n.chunk,d=n.encoding,u=n.callback;if(v(e,t,!1,t.objectMode?1:p.length,p,d,u),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function x(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function I(e,t){e._final((function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),T(e,t)}))}function T(e,t){var n=x(t);return n&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(I,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}p.inherits(b,u),y.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(y.prototype,"buffer",{get:d.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(b,Symbol.hasInstance,{value:function(e){return!!f.call(this,e)||this===b&&(e&&e._writableState instanceof y)}})):f=function(e){return e instanceof this},b.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},b.prototype.write=function(e,t,n){var r,i=this._writableState,a=!1,s=!i.objectMode&&(r=e,l.isBuffer(r)||r instanceof m);return s&&!l.isBuffer(e)&&(e=function(e){return l.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=g),i.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),o.nextTick(t,n)}(this,n):(s||function(e,t,n,r){var i=!0,a=!1;return null===n?a=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),o.nextTick(r,a),i=!1),i}(this,i,e,n))&&(i.pendingcb++,a=function(e,t,n,r,i,o){if(!n){var a=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=l.from(t,n));return t}(t,r,i);r!==a&&(n=!0,i="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var c=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(b.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),b.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},b.prototype._writev=null,b.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,T(e,t),n&&(t.finished?o.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),b.prototype.destroy=h.destroy,b.prototype._undestroy=h.undestroy,b.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n(30),n(362).setImmediate,n(11))},function(e,t,n){"use strict";var r=n(74).Buffer,i=r.isEncoding||function(e){switch((e=""+e)&&e.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 o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){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 e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=p,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=d,this.end=u,t=3;break;default:return this.write=l,void(this.end=m)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function p(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function d(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function u(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function l(e){return e.toString(this.encoding)}function m(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0)return i>0&&(e.lastNeed=i-1),i;if(--r=0)return i>0&&(e.lastNeed=i-2),i;if(--r=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,n){"use strict";e.exports=a;var r=n(50),i=Object.create(n(58));function o(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.lengthi;)X(e,n=r[i++],t[n]);return e},K=function(e){var t=L.call(this,e=x(e,!0));return!(this===B&&i(F,e)&&!i(U,e))&&(!(t||!i(this,e)||!i(F,e)||i(this,N)&&this[N][e])||t)},Q=function(e,t){if(e=S(e),t=x(t,!0),e!==B||!i(F,t)||i(U,t)){var n=E(e,t);return!n||!i(F,t)||i(e,N)&&e[N][t]||(n.enumerable=!0),n}},Z=function(e){for(var t,n=j(S(e)),r=[],o=0;n.length>o;)i(F,t=n[o++])||t==N||t==c||r.push(t);return r},ee=function(e){for(var t,n=e===B,r=j(n?U:S(e)),o=[],a=0;r.length>a;)!i(F,t=r[a++])||n&&!i(B,t)||o.push(F[t]);return o};W||(s((P=function(){if(this instanceof P)throw TypeError("Symbol is not a constructor!");var e=l(arguments.length>0?arguments[0]:void 0),t=function(n){this===B&&t.call(U,n),i(this,N)&&i(this[N],e)&&(this[N][e]=!1),V(this,e,I(1,n))};return o&&z&&V(B,e,{configurable:!0,set:t}),G(e)}).prototype,"toString",(function(){return this._k})),k.f=Q,O.f=X,n(39).f=R.f=Z,n(53).f=K,C.f=ee,o&&!n(31)&&s(B,"propertyIsEnumerable",K,!0),f.f=function(e){return G(m(e))}),a(a.G+a.W+a.F*!W,{Symbol:P});for(var te="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ne=0;te.length>ne;)m(te[ne++]);for(var re=$(m.store),ie=0;re.length>ie;)h(re[ie++]);a(a.S+a.F*!W,"Symbol",{for:function(e){return i(q,e+="")?q[e]:q[e]=P(e)},keyFor:function(e){if(!J(e))throw TypeError(e+" is not a symbol!");for(var t in q)if(q[t]===e)return t},useSetter:function(){z=!0},useSimple:function(){z=!1}}),a(a.S+a.F*!W,"Object",{create:function(e,t){return void 0===t?T(e):Y(T(e),t)},defineProperty:X,defineProperties:Y,getOwnPropertyDescriptor:Q,getOwnPropertyNames:Z,getOwnPropertySymbols:ee});var oe=p((function(){C.f(1)}));a(a.S+a.F*oe,"Object",{getOwnPropertySymbols:function(e){return C.f(w(e))}}),A&&a(a.S+a.F*(!W||p((function(){var e=P();return"[null]"!=M([e])||"{}"!=M({a:e})||"{}"!=M(Object(e))}))),"JSON",{stringify:function(e){for(var t,n,r=[e],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=t=r[1],(v(t)||void 0!==e)&&!J(e))return y(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!J(t))return t}),r[1]=t,M.apply(A,r)}}),P.prototype[_]||n(12)(P.prototype,_,P.prototype.valueOf),u(P,"Symbol"),u(Math,"Math",!0),u(r.JSON,"JSON",!0)},function(e,t,n){e.exports=n(51)("native-function-to-string",Function.toString)},function(e,t,n){var r=n(36),i=n(60),o=n(53);e.exports=function(e){var t=r(e),n=i.f;if(n)for(var a,s=n(e),c=o.f,p=0;s.length>p;)c.call(e,a=s[p++])&&t.push(a);return t}},function(e,t,n){var r=n(0);r(r.S,"Object",{create:n(38)})},function(e,t,n){var r=n(0);r(r.S+r.F*!n(7),"Object",{defineProperty:n(8).f})},function(e,t,n){var r=n(0);r(r.S+r.F*!n(7),"Object",{defineProperties:n(106)})},function(e,t,n){var r=n(16),i=n(17).f;n(26)("getOwnPropertyDescriptor",(function(){return function(e,t){return i(r(e),t)}}))},function(e,t,n){var r=n(9),i=n(18);n(26)("getPrototypeOf",(function(){return function(e){return i(r(e))}}))},function(e,t,n){var r=n(9),i=n(36);n(26)("keys",(function(){return function(e){return i(r(e))}}))},function(e,t,n){n(26)("getOwnPropertyNames",(function(){return n(107).f}))},function(e,t,n){var r=n(4),i=n(32).onFreeze;n(26)("freeze",(function(e){return function(t){return e&&r(t)?e(i(t)):t}}))},function(e,t,n){var r=n(4),i=n(32).onFreeze;n(26)("seal",(function(e){return function(t){return e&&r(t)?e(i(t)):t}}))},function(e,t,n){var r=n(4),i=n(32).onFreeze;n(26)("preventExtensions",(function(e){return function(t){return e&&r(t)?e(i(t)):t}}))},function(e,t,n){var r=n(4);n(26)("isFrozen",(function(e){return function(t){return!r(t)||!!e&&e(t)}}))},function(e,t,n){var r=n(4);n(26)("isSealed",(function(e){return function(t){return!r(t)||!!e&&e(t)}}))},function(e,t,n){var r=n(4);n(26)("isExtensible",(function(e){return function(t){return!!r(t)&&(!e||e(t))}}))},function(e,t,n){var r=n(0);r(r.S+r.F,"Object",{assign:n(108)})},function(e,t,n){var r=n(0);r(r.S,"Object",{is:n(109)})},function(e,t,n){var r=n(0);r(r.S,"Object",{setPrototypeOf:n(81).set})},function(e,t,n){"use strict";var r=n(47),i={};i[n(5)("toStringTag")]="z",i+""!="[object z]"&&n(13)(Object.prototype,"toString",(function(){return"[object "+r(this)+"]"}),!0)},function(e,t,n){var r=n(0);r(r.P,"Function",{bind:n(110)})},function(e,t,n){var r=n(8).f,i=Function.prototype,o=/^\s*function ([^ (]*)/;"name"in i||n(7)&&r(i,"name",{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(e){return""}}})},function(e,t,n){"use strict";var r=n(4),i=n(18),o=n(5)("hasInstance"),a=Function.prototype;o in a||n(8).f(a,o,{value:function(e){if("function"!=typeof this||!r(e))return!1;if(!r(this.prototype))return e instanceof this;for(;e=i(e);)if(this.prototype===e)return!0;return!1}})},function(e,t,n){var r=n(0),i=n(112);r(r.G+r.F*(parseInt!=i),{parseInt:i})},function(e,t,n){var r=n(0),i=n(113);r(r.G+r.F*(parseFloat!=i),{parseFloat:i})},function(e,t,n){"use strict";var r=n(2),i=n(15),o=n(21),a=n(83),s=n(24),c=n(3),p=n(39).f,d=n(17).f,u=n(8).f,l=n(48).trim,m=r.Number,f=m,h=m.prototype,g="Number"==o(n(38)(h)),y="trim"in String.prototype,b=function(e){var t=s(e,!1);if("string"==typeof t&&t.length>2){var n,r,i,o=(t=y?t.trim():l(t,3)).charCodeAt(0);if(43===o||45===o){if(88===(n=t.charCodeAt(2))||120===n)return NaN}else if(48===o){switch(t.charCodeAt(1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+t}for(var a,c=t.slice(2),p=0,d=c.length;pi)return NaN;return parseInt(c,r)}}return+t};if(!m(" 0o1")||!m("0b1")||m("+0x1")){m=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof m&&(g?c((function(){h.valueOf.call(n)})):"Number"!=o(n))?a(new f(b(t)),n,m):b(t)};for(var v,w=n(7)?p(f):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),S=0;w.length>S;S++)i(f,v=w[S])&&!i(m,v)&&u(m,v,d(f,v));m.prototype=h,h.constructor=m,n(13)(r,"Number",m)}},function(e,t,n){"use strict";var r=n(0),i=n(22),o=n(114),a=n(84),s=1..toFixed,c=Math.floor,p=[0,0,0,0,0,0],d="Number.toFixed: incorrect invocation!",u=function(e,t){for(var n=-1,r=t;++n<6;)r+=e*p[n],p[n]=r%1e7,r=c(r/1e7)},l=function(e){for(var t=6,n=0;--t>=0;)n+=p[t],p[t]=c(n/e),n=n%e*1e7},m=function(){for(var e=6,t="";--e>=0;)if(""!==t||0===e||0!==p[e]){var n=String(p[e]);t=""===t?n:t+a.call("0",7-n.length)+n}return t},f=function(e,t,n){return 0===t?n:t%2==1?f(e,t-1,n*e):f(e*e,t/2,n)};r(r.P+r.F*(!!s&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!n(3)((function(){s.call({})}))),"Number",{toFixed:function(e){var t,n,r,s,c=o(this,d),p=i(e),h="",g="0";if(p<0||p>20)throw RangeError(d);if(c!=c)return"NaN";if(c<=-1e21||c>=1e21)return String(c);if(c<0&&(h="-",c=-c),c>1e-21)if(n=(t=function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t}(c*f(2,69,1))-69)<0?c*f(2,-t,1):c/f(2,t,1),n*=4503599627370496,(t=52-t)>0){for(u(0,n),r=p;r>=7;)u(1e7,0),r-=7;for(u(f(10,r,1),0),r=t-1;r>=23;)l(1<<23),r-=23;l(1<0?h+((s=g.length)<=p?"0."+a.call("0",p-s)+g:g.slice(0,s-p)+"."+g.slice(s-p)):h+g}})},function(e,t,n){"use strict";var r=n(0),i=n(3),o=n(114),a=1..toPrecision;r(r.P+r.F*(i((function(){return"1"!==a.call(1,void 0)}))||!i((function(){a.call({})}))),"Number",{toPrecision:function(e){var t=o(this,"Number#toPrecision: incorrect invocation!");return void 0===e?a.call(t):a.call(t,e)}})},function(e,t,n){var r=n(0);r(r.S,"Number",{EPSILON:Math.pow(2,-52)})},function(e,t,n){var r=n(0),i=n(2).isFinite;r(r.S,"Number",{isFinite:function(e){return"number"==typeof e&&i(e)}})},function(e,t,n){var r=n(0);r(r.S,"Number",{isInteger:n(115)})},function(e,t,n){var r=n(0);r(r.S,"Number",{isNaN:function(e){return e!=e}})},function(e,t,n){var r=n(0),i=n(115),o=Math.abs;r(r.S,"Number",{isSafeInteger:function(e){return i(e)&&o(e)<=9007199254740991}})},function(e,t,n){var r=n(0);r(r.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(e,t,n){var r=n(0);r(r.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},function(e,t,n){var r=n(0),i=n(113);r(r.S+r.F*(Number.parseFloat!=i),"Number",{parseFloat:i})},function(e,t,n){var r=n(0),i=n(112);r(r.S+r.F*(Number.parseInt!=i),"Number",{parseInt:i})},function(e,t,n){var r=n(0),i=n(116),o=Math.sqrt,a=Math.acosh;r(r.S+r.F*!(a&&710==Math.floor(a(Number.MAX_VALUE))&&a(1/0)==1/0),"Math",{acosh:function(e){return(e=+e)<1?NaN:e>94906265.62425156?Math.log(e)+Math.LN2:i(e-1+o(e-1)*o(e+1))}})},function(e,t,n){var r=n(0),i=Math.asinh;r(r.S+r.F*!(i&&1/i(0)>0),"Math",{asinh:function e(t){return isFinite(t=+t)&&0!=t?t<0?-e(-t):Math.log(t+Math.sqrt(t*t+1)):t}})},function(e,t,n){var r=n(0),i=Math.atanh;r(r.S+r.F*!(i&&1/i(-0)<0),"Math",{atanh:function(e){return 0==(e=+e)?e:Math.log((1+e)/(1-e))/2}})},function(e,t,n){var r=n(0),i=n(85);r(r.S,"Math",{cbrt:function(e){return i(e=+e)*Math.pow(Math.abs(e),1/3)}})},function(e,t,n){var r=n(0);r(r.S,"Math",{clz32:function(e){return(e>>>=0)?31-Math.floor(Math.log(e+.5)*Math.LOG2E):32}})},function(e,t,n){var r=n(0),i=Math.exp;r(r.S,"Math",{cosh:function(e){return(i(e=+e)+i(-e))/2}})},function(e,t,n){var r=n(0),i=n(86);r(r.S+r.F*(i!=Math.expm1),"Math",{expm1:i})},function(e,t,n){var r=n(0);r(r.S,"Math",{fround:n(117)})},function(e,t,n){var r=n(0),i=Math.abs;r(r.S,"Math",{hypot:function(e,t){for(var n,r,o=0,a=0,s=arguments.length,c=0;a0?(r=n/c)*r:n;return c===1/0?1/0:c*Math.sqrt(o)}})},function(e,t,n){var r=n(0),i=Math.imul;r(r.S+r.F*n(3)((function(){return-5!=i(4294967295,5)||2!=i.length})),"Math",{imul:function(e,t){var n=+e,r=+t,i=65535&n,o=65535&r;return 0|i*o+((65535&n>>>16)*o+i*(65535&r>>>16)<<16>>>0)}})},function(e,t,n){var r=n(0);r(r.S,"Math",{log10:function(e){return Math.log(e)*Math.LOG10E}})},function(e,t,n){var r=n(0);r(r.S,"Math",{log1p:n(116)})},function(e,t,n){var r=n(0);r(r.S,"Math",{log2:function(e){return Math.log(e)/Math.LN2}})},function(e,t,n){var r=n(0);r(r.S,"Math",{sign:n(85)})},function(e,t,n){var r=n(0),i=n(86),o=Math.exp;r(r.S+r.F*n(3)((function(){return-2e-17!=!Math.sinh(-2e-17)})),"Math",{sinh:function(e){return Math.abs(e=+e)<1?(i(e)-i(-e))/2:(o(e-1)-o(-e-1))*(Math.E/2)}})},function(e,t,n){var r=n(0),i=n(86),o=Math.exp;r(r.S,"Math",{tanh:function(e){var t=i(e=+e),n=i(-e);return t==1/0?1:n==1/0?-1:(t-n)/(o(e)+o(-e))}})},function(e,t,n){var r=n(0);r(r.S,"Math",{trunc:function(e){return(e>0?Math.floor:Math.ceil)(e)}})},function(e,t,n){var r=n(0),i=n(37),o=String.fromCharCode,a=String.fromCodePoint;r(r.S+r.F*(!!a&&1!=a.length),"String",{fromCodePoint:function(e){for(var t,n=[],r=arguments.length,a=0;r>a;){if(t=+arguments[a++],i(t,1114111)!==t)throw RangeError(t+" is not a valid code point");n.push(t<65536?o(t):o(55296+((t-=65536)>>10),t%1024+56320))}return n.join("")}})},function(e,t,n){var r=n(0),i=n(16),o=n(6);r(r.S,"String",{raw:function(e){for(var t=i(e.raw),n=o(t.length),r=arguments.length,a=[],s=0;n>s;)a.push(String(t[s++])),s=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})}))},function(e,t,n){"use strict";var r=n(0),i=n(62)(!1);r(r.P,"String",{codePointAt:function(e){return i(this,e)}})},function(e,t,n){"use strict";var r=n(0),i=n(6),o=n(89),a="".endsWith;r(r.P+r.F*n(90)("endsWith"),"String",{endsWith:function(e){var t=o(this,e,"endsWith"),n=arguments.length>1?arguments[1]:void 0,r=i(t.length),s=void 0===n?r:Math.min(i(n),r),c=String(e);return a?a.call(t,c,s):t.slice(s-c.length,s)===c}})},function(e,t,n){"use strict";var r=n(0),i=n(89);r(r.P+r.F*n(90)("includes"),"String",{includes:function(e){return!!~i(this,e,"includes").indexOf(e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,n){var r=n(0);r(r.P,"String",{repeat:n(84)})},function(e,t,n){"use strict";var r=n(0),i=n(6),o=n(89),a="".startsWith;r(r.P+r.F*n(90)("startsWith"),"String",{startsWith:function(e){var t=o(this,e,"startsWith"),n=i(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return a?a.call(t,r,n):t.slice(n,n+r.length)===r}})},function(e,t,n){"use strict";n(14)("anchor",(function(e){return function(t){return e(this,"a","name",t)}}))},function(e,t,n){"use strict";n(14)("big",(function(e){return function(){return e(this,"big","","")}}))},function(e,t,n){"use strict";n(14)("blink",(function(e){return function(){return e(this,"blink","","")}}))},function(e,t,n){"use strict";n(14)("bold",(function(e){return function(){return e(this,"b","","")}}))},function(e,t,n){"use strict";n(14)("fixed",(function(e){return function(){return e(this,"tt","","")}}))},function(e,t,n){"use strict";n(14)("fontcolor",(function(e){return function(t){return e(this,"font","color",t)}}))},function(e,t,n){"use strict";n(14)("fontsize",(function(e){return function(t){return e(this,"font","size",t)}}))},function(e,t,n){"use strict";n(14)("italics",(function(e){return function(){return e(this,"i","","")}}))},function(e,t,n){"use strict";n(14)("link",(function(e){return function(t){return e(this,"a","href",t)}}))},function(e,t,n){"use strict";n(14)("small",(function(e){return function(){return e(this,"small","","")}}))},function(e,t,n){"use strict";n(14)("strike",(function(e){return function(){return e(this,"strike","","")}}))},function(e,t,n){"use strict";n(14)("sub",(function(e){return function(){return e(this,"sub","","")}}))},function(e,t,n){"use strict";n(14)("sup",(function(e){return function(){return e(this,"sup","","")}}))},function(e,t,n){var r=n(0);r(r.S,"Date",{now:function(){return(new Date).getTime()}})},function(e,t,n){"use strict";var r=n(0),i=n(9),o=n(24);r(r.P+r.F*n(3)((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})})),"Date",{toJSON:function(e){var t=i(this),n=o(t);return"number"!=typeof n||isFinite(n)?t.toISOString():null}})},function(e,t,n){var r=n(0),i=n(234);r(r.P+r.F*(Date.prototype.toISOString!==i),"Date",{toISOString:i})},function(e,t,n){"use strict";var r=n(3),i=Date.prototype.getTime,o=Date.prototype.toISOString,a=function(e){return e>9?e:"0"+e};e.exports=r((function(){return"0385-07-25T07:06:39.999Z"!=o.call(new Date(-50000000000001))}))||!r((function(){o.call(new Date(NaN))}))?function(){if(!isFinite(i.call(this)))throw RangeError("Invalid time value");var e=this,t=e.getUTCFullYear(),n=e.getUTCMilliseconds(),r=t<0?"-":t>9999?"+":"";return r+("00000"+Math.abs(t)).slice(r?-6:-4)+"-"+a(e.getUTCMonth()+1)+"-"+a(e.getUTCDate())+"T"+a(e.getUTCHours())+":"+a(e.getUTCMinutes())+":"+a(e.getUTCSeconds())+"."+(n>99?n:"0"+a(n))+"Z"}:o},function(e,t,n){var r=Date.prototype,i=r.toString,o=r.getTime;new Date(NaN)+""!="Invalid Date"&&n(13)(r,"toString",(function(){var e=o.call(this);return e==e?i.call(this):"Invalid Date"}))},function(e,t,n){var r=n(5)("toPrimitive"),i=Date.prototype;r in i||n(12)(i,r,n(237))},function(e,t,n){"use strict";var r=n(1),i=n(24);e.exports=function(e){if("string"!==e&&"number"!==e&&"default"!==e)throw TypeError("Incorrect hint");return i(r(this),"number"!=e)}},function(e,t,n){var r=n(0);r(r.S,"Array",{isArray:n(61)})},function(e,t,n){"use strict";var r=n(20),i=n(0),o=n(9),a=n(118),s=n(91),c=n(6),p=n(92),d=n(93);i(i.S+i.F*!n(64)((function(e){Array.from(e)})),"Array",{from:function(e){var t,n,i,u,l=o(e),m="function"==typeof this?this:Array,f=arguments.length,h=f>1?arguments[1]:void 0,g=void 0!==h,y=0,b=d(l);if(g&&(h=r(h,f>2?arguments[2]:void 0,2)),null==b||m==Array&&s(b))for(n=new m(t=c(l.length));t>y;y++)p(n,y,g?h(l[y],y):l[y]);else for(u=b.call(l),n=new m;!(i=u.next()).done;y++)p(n,y,g?a(u,h,[i.value,y],!0):i.value);return n.length=y,n}})},function(e,t,n){"use strict";var r=n(0),i=n(92);r(r.S+r.F*n(3)((function(){function e(){}return!(Array.of.call(e)instanceof e)})),"Array",{of:function(){for(var e=0,t=arguments.length,n=new("function"==typeof this?this:Array)(t);t>e;)i(n,e,arguments[e++]);return n.length=t,n}})},function(e,t,n){"use strict";var r=n(0),i=n(16),o=[].join;r(r.P+r.F*(n(52)!=Object||!n(23)(o)),"Array",{join:function(e){return o.call(i(this),void 0===e?",":e)}})},function(e,t,n){"use strict";var r=n(0),i=n(80),o=n(21),a=n(37),s=n(6),c=[].slice;r(r.P+r.F*n(3)((function(){i&&c.call(i)})),"Array",{slice:function(e,t){var n=s(this.length),r=o(this);if(t=void 0===t?n:t,"Array"==r)return c.call(this,e,t);for(var i=a(e,n),p=a(t,n),d=s(p-i),u=new Array(d),l=0;l1&&(r=Math.min(r,o(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in t&&t[r]===e)return r||0;return-1}})},function(e,t,n){var r=n(0);r(r.P,"Array",{copyWithin:n(120)}),n(33)("copyWithin")},function(e,t,n){var r=n(0);r(r.P,"Array",{fill:n(95)}),n(33)("fill")},function(e,t,n){"use strict";var r=n(0),i=n(27)(5),o=!0;"find"in[]&&Array(1).find((function(){o=!1})),r(r.P+r.F*o,"Array",{find:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),n(33)("find")},function(e,t,n){"use strict";var r=n(0),i=n(27)(6),o="findIndex",a=!0;o in[]&&Array(1)[o]((function(){a=!1})),r(r.P+r.F*a,"Array",{findIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),n(33)(o)},function(e,t,n){n(40)("Array")},function(e,t,n){var r=n(2),i=n(83),o=n(8).f,a=n(39).f,s=n(63),c=n(54),p=r.RegExp,d=p,u=p.prototype,l=/a/g,m=/a/g,f=new p(l)!==l;if(n(7)&&(!f||n(3)((function(){return m[n(5)("match")]=!1,p(l)!=l||p(m)==m||"/a/i"!=p(l,"i")})))){p=function(e,t){var n=this instanceof p,r=s(e),o=void 0===t;return!n&&r&&e.constructor===p&&o?e:i(f?new d(r&&!o?e.source:e,t):d((r=e instanceof p)?e.source:e,r&&o?c.call(e):t),n?this:u,p)};for(var h=function(e){e in p||o(p,e,{configurable:!0,get:function(){return d[e]},set:function(t){d[e]=t}})},g=a(d),y=0;g.length>y;)h(g[y++]);u.constructor=p,p.prototype=u,n(13)(r,"RegExp",p)}n(40)("RegExp")},function(e,t,n){"use strict";n(123);var r=n(1),i=n(54),o=n(7),a=/./.toString,s=function(e){n(13)(RegExp.prototype,"toString",e,!0)};n(3)((function(){return"/a/b"!=a.call({source:"a",flags:"b"})}))?s((function(){var e=r(this);return"/".concat(e.source,"/","flags"in e?e.flags:!o&&e instanceof RegExp?i.call(e):void 0)})):"toString"!=a.name&&s((function(){return a.call(this)}))},function(e,t,n){"use strict";var r=n(1),i=n(6),o=n(98),a=n(65);n(66)("match",1,(function(e,t,n,s){return[function(n){var r=e(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,r):new RegExp(n)[t](String(r))},function(e){var t=s(n,e,this);if(t.done)return t.value;var c=r(e),p=String(this);if(!c.global)return a(c,p);var d=c.unicode;c.lastIndex=0;for(var u,l=[],m=0;null!==(u=a(c,p));){var f=String(u[0]);l[m]=f,""===f&&(c.lastIndex=o(p,i(c.lastIndex),d)),m++}return 0===m?null:l}]}))},function(e,t,n){"use strict";var r=n(1),i=n(9),o=n(6),a=n(22),s=n(98),c=n(65),p=Math.max,d=Math.min,u=Math.floor,l=/\$([$&`']|\d\d?|<[^>]*>)/g,m=/\$([$&`']|\d\d?)/g;n(66)("replace",2,(function(e,t,n,f){return[function(r,i){var o=e(this),a=null==r?void 0:r[t];return void 0!==a?a.call(r,o,i):n.call(String(o),r,i)},function(e,t){var i=f(n,e,this,t);if(i.done)return i.value;var u=r(e),l=String(this),m="function"==typeof t;m||(t=String(t));var g=u.global;if(g){var y=u.unicode;u.lastIndex=0}for(var b=[];;){var v=c(u,l);if(null===v)break;if(b.push(v),!g)break;""===String(v[0])&&(u.lastIndex=s(l,o(u.lastIndex),y))}for(var w,S="",x=0,I=0;I=x&&(S+=l.slice(x,R)+E,x=R+T.length)}return S+l.slice(x)}];function h(e,t,r,o,a,s){var c=r+e.length,p=o.length,d=m;return void 0!==a&&(a=i(a),d=l),n.call(s,d,(function(n,i){var s;switch(i.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,r);case"'":return t.slice(c);case"<":s=a[i.slice(1,-1)];break;default:var d=+i;if(0===d)return n;if(d>p){var l=u(d/10);return 0===l?n:l<=p?void 0===o[l-1]?i.charAt(1):o[l-1]+i.charAt(1):n}s=o[d-1]}return void 0===s?"":s}))}}))},function(e,t,n){"use strict";var r=n(1),i=n(109),o=n(65);n(66)("search",1,(function(e,t,n,a){return[function(n){var r=e(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,r):new RegExp(n)[t](String(r))},function(e){var t=a(n,e,this);if(t.done)return t.value;var s=r(e),c=String(this),p=s.lastIndex;i(p,0)||(s.lastIndex=0);var d=o(s,c);return i(s.lastIndex,p)||(s.lastIndex=p),null===d?-1:d.index}]}))},function(e,t,n){"use strict";var r=n(63),i=n(1),o=n(55),a=n(98),s=n(6),c=n(65),p=n(97),d=n(3),u=Math.min,l=[].push,m="length",f=!d((function(){RegExp(4294967295,"y")}));n(66)("split",2,(function(e,t,n,d){var h;return h="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1)[m]||2!="ab".split(/(?:ab)*/)[m]||4!=".".split(/(.?)(.?)/)[m]||".".split(/()()/)[m]>1||"".split(/.?/)[m]?function(e,t){var i=String(this);if(void 0===e&&0===t)return[];if(!r(e))return n.call(i,e,t);for(var o,a,s,c=[],d=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),u=0,f=void 0===t?4294967295:t>>>0,h=new RegExp(e.source,d+"g");(o=p.call(h,i))&&!((a=h.lastIndex)>u&&(c.push(i.slice(u,o.index)),o[m]>1&&o.index=f));)h.lastIndex===o.index&&h.lastIndex++;return u===i[m]?!s&&h.test("")||c.push(""):c.push(i.slice(u)),c[m]>f?c.slice(0,f):c}:"0".split(void 0,0)[m]?function(e,t){return void 0===e&&0===t?[]:n.call(this,e,t)}:n,[function(n,r){var i=e(this),o=null==n?void 0:n[t];return void 0!==o?o.call(n,i,r):h.call(String(i),n,r)},function(e,t){var r=d(h,e,this,t,h!==n);if(r.done)return r.value;var p=i(e),l=String(this),m=o(p,RegExp),g=p.unicode,y=(p.ignoreCase?"i":"")+(p.multiline?"m":"")+(p.unicode?"u":"")+(f?"y":"g"),b=new m(f?p:"^(?:"+p.source+")",y),v=void 0===t?4294967295:t>>>0;if(0===v)return[];if(0===l.length)return null===c(b,l)?[l]:[];for(var w=0,S=0,x=[];So;)a(n[o++]);e._c=[],e._n=!1,t&&!e._h&&A(e)}))}},A=function(e){y.call(c,(function(){var t,n,r,i=e._v,o=M(e);if(o&&(t=w((function(){O?T.emit("unhandledRejection",i,e):(n=c.onunhandledrejection)?n({promise:e,reason:i}):(r=c.console)&&r.error&&r.error("Unhandled promise rejection",i)})),e._h=O||M(e)?2:1),e._a=void 0,o&&t.e)throw t.v}))},M=function(e){return 1!==e._h&&0===(e._a||e._c).length},N=function(e){y.call(c,(function(){var t;O?T.emit("rejectionHandled",e):(t=c.onrejectionhandled)&&t({promise:e,reason:e._v})}))},_=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),P(t,!0))},L=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw I("Promise can't be resolved itself");(t=j(e))?b((function(){var r={_w:n,_d:!1};try{t.call(e,p(L,r,1),p(_,r,1))}catch(e){_.call(r,e)}})):(n._v=e,n._s=1,P(n,!1))}catch(e){_.call({_w:n,_d:!1},e)}}};D||(C=function(e){f(this,C,"Promise","_h"),m(e),r.call(this);try{e(p(L,this,1),p(_,this,1))}catch(e){_.call(this,e)}},(r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(43)(C.prototype,{then:function(e,t){var n=E(g(this,C));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=O?T.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&P(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new r;this.promise=e,this.resolve=p(L,e,1),this.reject=p(_,e,1)},v.f=E=function(e){return e===C||e===a?new o(e):i(e)}),u(u.G+u.W+u.F*!D,{Promise:C}),n(46)(C,"Promise"),n(40)("Promise"),a=n(19).Promise,u(u.S+u.F*!D,"Promise",{reject:function(e){var t=E(this);return(0,t.reject)(e),t.promise}}),u(u.S+u.F*(s||!D),"Promise",{resolve:function(e){return x(s&&this===a?C:this,e)}}),u(u.S+u.F*!(D&&n(64)((function(e){C.all(e).catch($)}))),"Promise",{all:function(e){var t=this,n=E(t),r=n.resolve,i=n.reject,o=w((function(){var n=[],o=0,a=1;h(e,!1,(function(e){var s=o++,c=!1;n.push(void 0),a++,t.resolve(e).then((function(e){c||(c=!0,n[s]=e,--a||r(n))}),i)})),--a||r(n)}));return o.e&&i(o.v),n.promise},race:function(e){var t=this,n=E(t),r=n.reject,i=w((function(){h(e,!1,(function(e){t.resolve(e).then(n.resolve,r)}))}));return i.e&&r(i.v),n.promise}})},function(e,t,n){"use strict";var r=n(130),i=n(44);n(68)("WeakSet",(function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(e){return r.def(i(this,"WeakSet"),e,!0)}},r,!1,!0)},function(e,t,n){"use strict";var r=n(0),i=n(69),o=n(102),a=n(1),s=n(37),c=n(6),p=n(4),d=n(2).ArrayBuffer,u=n(55),l=o.ArrayBuffer,m=o.DataView,f=i.ABV&&d.isView,h=l.prototype.slice,g=i.VIEW;r(r.G+r.W+r.F*(d!==l),{ArrayBuffer:l}),r(r.S+r.F*!i.CONSTR,"ArrayBuffer",{isView:function(e){return f&&f(e)||p(e)&&g in e}}),r(r.P+r.U+r.F*n(3)((function(){return!new l(2).slice(1,void 0).byteLength})),"ArrayBuffer",{slice:function(e,t){if(void 0!==h&&void 0===t)return h.call(a(this),e);for(var n=a(this).byteLength,r=s(e,n),i=s(void 0===t?n:t,n),o=new(u(this,l))(c(i-r)),p=new m(this),d=new m(o),f=0;r=t.length)return{value:void 0,done:!0}}while(!((e=t[this._i++])in this._t));return{value:e,done:!1}})),r(r.S,"Reflect",{enumerate:function(e){return new o(e)}})},function(e,t,n){var r=n(17),i=n(18),o=n(15),a=n(0),s=n(4),c=n(1);a(a.S,"Reflect",{get:function e(t,n){var a,p,d=arguments.length<3?t:arguments[2];return c(t)===d?t[n]:(a=r.f(t,n))?o(a,"value")?a.value:void 0!==a.get?a.get.call(d):void 0:s(p=i(t))?e(p,n,d):void 0}})},function(e,t,n){var r=n(17),i=n(0),o=n(1);i(i.S,"Reflect",{getOwnPropertyDescriptor:function(e,t){return r.f(o(e),t)}})},function(e,t,n){var r=n(0),i=n(18),o=n(1);r(r.S,"Reflect",{getPrototypeOf:function(e){return i(o(e))}})},function(e,t,n){var r=n(0);r(r.S,"Reflect",{has:function(e,t){return t in e}})},function(e,t,n){var r=n(0),i=n(1),o=Object.isExtensible;r(r.S,"Reflect",{isExtensible:function(e){return i(e),!o||o(e)}})},function(e,t,n){var r=n(0);r(r.S,"Reflect",{ownKeys:n(132)})},function(e,t,n){var r=n(0),i=n(1),o=Object.preventExtensions;r(r.S,"Reflect",{preventExtensions:function(e){i(e);try{return o&&o(e),!0}catch(e){return!1}}})},function(e,t,n){var r=n(8),i=n(17),o=n(18),a=n(15),s=n(0),c=n(34),p=n(1),d=n(4);s(s.S,"Reflect",{set:function e(t,n,s){var u,l,m=arguments.length<4?t:arguments[3],f=i.f(p(t),n);if(!f){if(d(l=o(t)))return e(l,n,s,m);f=c(0)}if(a(f,"value")){if(!1===f.writable||!d(m))return!1;if(u=i.f(m,n)){if(u.get||u.set||!1===u.writable)return!1;u.value=s,r.f(m,n,u)}else r.f(m,n,c(0,s));return!0}return void 0!==f.set&&(f.set.call(m,s),!0)}})},function(e,t,n){var r=n(0),i=n(81);i&&r(r.S,"Reflect",{setPrototypeOf:function(e,t){i.check(e,t);try{return i.set(e,t),!0}catch(e){return!1}}})},function(e,t,n){"use strict";var r=n(0),i=n(59)(!0);r(r.P,"Array",{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),n(33)("includes")},function(e,t,n){"use strict";var r=n(0),i=n(133),o=n(9),a=n(6),s=n(10),c=n(94);r(r.P,"Array",{flatMap:function(e){var t,n,r=o(this);return s(e),t=a(r.length),n=c(r,0),i(n,r,r,t,0,1,e,arguments[1]),n}}),n(33)("flatMap")},function(e,t,n){"use strict";var r=n(0),i=n(133),o=n(9),a=n(6),s=n(22),c=n(94);r(r.P,"Array",{flatten:function(){var e=arguments[0],t=o(this),n=a(t.length),r=c(t,0);return i(r,t,t,n,0,void 0===e?1:s(e)),r}}),n(33)("flatten")},function(e,t,n){"use strict";var r=n(0),i=n(62)(!0);r(r.P,"String",{at:function(e){return i(this,e)}})},function(e,t,n){"use strict";var r=n(0),i=n(134),o=n(67),a=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(o);r(r.P+r.F*a,"String",{padStart:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0,!0)}})},function(e,t,n){"use strict";var r=n(0),i=n(134),o=n(67),a=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(o);r(r.P+r.F*a,"String",{padEnd:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0,!1)}})},function(e,t,n){"use strict";n(48)("trimLeft",(function(e){return function(){return e(this,1)}}),"trimStart")},function(e,t,n){"use strict";n(48)("trimRight",(function(e){return function(){return e(this,2)}}),"trimEnd")},function(e,t,n){"use strict";var r=n(0),i=n(25),o=n(6),a=n(63),s=n(54),c=RegExp.prototype,p=function(e,t){this._r=e,this._s=t};n(88)(p,"RegExp String",(function(){var e=this._r.exec(this._s);return{value:e,done:null===e}})),r(r.P,"String",{matchAll:function(e){if(i(this),!a(e))throw TypeError(e+" is not a regexp!");var t=String(this),n="flags"in c?String(e.flags):s.call(e),r=new RegExp(e.source,~n.indexOf("g")?n:"g"+n);return r.lastIndex=o(e.lastIndex),new p(r,t)}})},function(e,t,n){n(77)("asyncIterator")},function(e,t,n){n(77)("observable")},function(e,t,n){var r=n(0),i=n(132),o=n(16),a=n(17),s=n(92);r(r.S,"Object",{getOwnPropertyDescriptors:function(e){for(var t,n,r=o(e),c=a.f,p=i(r),d={},u=0;p.length>u;)void 0!==(n=c(r,t=p[u++]))&&s(d,t,n);return d}})},function(e,t,n){var r=n(0),i=n(135)(!1);r(r.S,"Object",{values:function(e){return i(e)}})},function(e,t,n){var r=n(0),i=n(135)(!0);r(r.S,"Object",{entries:function(e){return i(e)}})},function(e,t,n){"use strict";var r=n(0),i=n(9),o=n(10),a=n(8);n(7)&&r(r.P+n(70),"Object",{__defineGetter__:function(e,t){a.f(i(this),e,{get:o(t),enumerable:!0,configurable:!0})}})},function(e,t,n){"use strict";var r=n(0),i=n(9),o=n(10),a=n(8);n(7)&&r(r.P+n(70),"Object",{__defineSetter__:function(e,t){a.f(i(this),e,{set:o(t),enumerable:!0,configurable:!0})}})},function(e,t,n){"use strict";var r=n(0),i=n(9),o=n(24),a=n(18),s=n(17).f;n(7)&&r(r.P+n(70),"Object",{__lookupGetter__:function(e){var t,n=i(this),r=o(e,!0);do{if(t=s(n,r))return t.get}while(n=a(n))}})},function(e,t,n){"use strict";var r=n(0),i=n(9),o=n(24),a=n(18),s=n(17).f;n(7)&&r(r.P+n(70),"Object",{__lookupSetter__:function(e){var t,n=i(this),r=o(e,!0);do{if(t=s(n,r))return t.set}while(n=a(n))}})},function(e,t,n){var r=n(0);r(r.P+r.R,"Map",{toJSON:n(136)("Map")})},function(e,t,n){var r=n(0);r(r.P+r.R,"Set",{toJSON:n(136)("Set")})},function(e,t,n){n(71)("Map")},function(e,t,n){n(71)("Set")},function(e,t,n){n(71)("WeakMap")},function(e,t,n){n(71)("WeakSet")},function(e,t,n){n(72)("Map")},function(e,t,n){n(72)("Set")},function(e,t,n){n(72)("WeakMap")},function(e,t,n){n(72)("WeakSet")},function(e,t,n){var r=n(0);r(r.G,{global:n(2)})},function(e,t,n){var r=n(0);r(r.S,"System",{global:n(2)})},function(e,t,n){var r=n(0),i=n(21);r(r.S,"Error",{isError:function(e){return"Error"===i(e)}})},function(e,t,n){var r=n(0);r(r.S,"Math",{clamp:function(e,t,n){return Math.min(n,Math.max(t,e))}})},function(e,t,n){var r=n(0);r(r.S,"Math",{DEG_PER_RAD:Math.PI/180})},function(e,t,n){var r=n(0),i=180/Math.PI;r(r.S,"Math",{degrees:function(e){return e*i}})},function(e,t,n){var r=n(0),i=n(138),o=n(117);r(r.S,"Math",{fscale:function(e,t,n,r,a){return o(i(e,t,n,r,a))}})},function(e,t,n){var r=n(0);r(r.S,"Math",{iaddh:function(e,t,n,r){var i=e>>>0,o=n>>>0;return(t>>>0)+(r>>>0)+((i&o|(i|o)&~(i+o>>>0))>>>31)|0}})},function(e,t,n){var r=n(0);r(r.S,"Math",{isubh:function(e,t,n,r){var i=e>>>0,o=n>>>0;return(t>>>0)-(r>>>0)-((~i&o|~(i^o)&i-o>>>0)>>>31)|0}})},function(e,t,n){var r=n(0);r(r.S,"Math",{imulh:function(e,t){var n=+e,r=+t,i=65535&n,o=65535&r,a=n>>16,s=r>>16,c=(a*o>>>0)+(i*o>>>16);return a*s+(c>>16)+((i*s>>>0)+(65535&c)>>16)}})},function(e,t,n){var r=n(0);r(r.S,"Math",{RAD_PER_DEG:180/Math.PI})},function(e,t,n){var r=n(0),i=Math.PI/180;r(r.S,"Math",{radians:function(e){return e*i}})},function(e,t,n){var r=n(0);r(r.S,"Math",{scale:n(138)})},function(e,t,n){var r=n(0);r(r.S,"Math",{umulh:function(e,t){var n=+e,r=+t,i=65535&n,o=65535&r,a=n>>>16,s=r>>>16,c=(a*o>>>0)+(i*o>>>16);return a*s+(c>>>16)+((i*s>>>0)+(65535&c)>>>16)}})},function(e,t,n){var r=n(0);r(r.S,"Math",{signbit:function(e){return(e=+e)!=e?e:0==e?1/e==1/0:e>0}})},function(e,t,n){"use strict";var r=n(0),i=n(19),o=n(2),a=n(55),s=n(125);r(r.P+r.R,"Promise",{finally:function(e){var t=a(this,i.Promise||o.Promise),n="function"==typeof e;return this.then(n?function(n){return s(t,e()).then((function(){return n}))}:e,n?function(n){return s(t,e()).then((function(){throw n}))}:e)}})},function(e,t,n){"use strict";var r=n(0),i=n(101),o=n(124);r(r.S,"Promise",{try:function(e){var t=i.f(this),n=o(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}})},function(e,t,n){var r=n(29),i=n(1),o=r.key,a=r.set;r.exp({defineMetadata:function(e,t,n,r){a(e,t,i(n),o(r))}})},function(e,t,n){var r=n(29),i=n(1),o=r.key,a=r.map,s=r.store;r.exp({deleteMetadata:function(e,t){var n=arguments.length<3?void 0:o(arguments[2]),r=a(i(t),n,!1);if(void 0===r||!r.delete(e))return!1;if(r.size)return!0;var c=s.get(t);return c.delete(n),!!c.size||s.delete(t)}})},function(e,t,n){var r=n(29),i=n(1),o=n(18),a=r.has,s=r.get,c=r.key,p=function(e,t,n){if(a(e,t,n))return s(e,t,n);var r=o(t);return null!==r?p(e,r,n):void 0};r.exp({getMetadata:function(e,t){return p(e,i(t),arguments.length<3?void 0:c(arguments[2]))}})},function(e,t,n){var r=n(128),i=n(137),o=n(29),a=n(1),s=n(18),c=o.keys,p=o.key,d=function(e,t){var n=c(e,t),o=s(e);if(null===o)return n;var a=d(o,t);return a.length?n.length?i(new r(n.concat(a))):a:n};o.exp({getMetadataKeys:function(e){return d(a(e),arguments.length<2?void 0:p(arguments[1]))}})},function(e,t,n){var r=n(29),i=n(1),o=r.get,a=r.key;r.exp({getOwnMetadata:function(e,t){return o(e,i(t),arguments.length<3?void 0:a(arguments[2]))}})},function(e,t,n){var r=n(29),i=n(1),o=r.keys,a=r.key;r.exp({getOwnMetadataKeys:function(e){return o(i(e),arguments.length<2?void 0:a(arguments[1]))}})},function(e,t,n){var r=n(29),i=n(1),o=n(18),a=r.has,s=r.key,c=function(e,t,n){if(a(e,t,n))return!0;var r=o(t);return null!==r&&c(e,r,n)};r.exp({hasMetadata:function(e,t){return c(e,i(t),arguments.length<3?void 0:s(arguments[2]))}})},function(e,t,n){var r=n(29),i=n(1),o=r.has,a=r.key;r.exp({hasOwnMetadata:function(e,t){return o(e,i(t),arguments.length<3?void 0:a(arguments[2]))}})},function(e,t,n){var r=n(29),i=n(1),o=n(10),a=r.key,s=r.set;r.exp({metadata:function(e,t){return function(n,r){s(e,t,(void 0!==r?i:o)(n),a(r))}}})},function(e,t,n){var r=n(0),i=n(100)(),o=n(2).process,a="process"==n(21)(o);r(r.G,{asap:function(e){var t=a&&o.domain;i(t?t.bind(e):e)}})},function(e,t,n){"use strict";var r=n(0),i=n(2),o=n(19),a=n(100)(),s=n(5)("observable"),c=n(10),p=n(1),d=n(41),u=n(43),l=n(12),m=n(42),f=m.RETURN,h=function(e){return null==e?void 0:c(e)},g=function(e){var t=e._c;t&&(e._c=void 0,t())},y=function(e){return void 0===e._o},b=function(e){y(e)||(e._o=void 0,g(e))},v=function(e,t){p(e),this._c=void 0,this._o=e,e=new w(this);try{var n=t(e),r=n;null!=n&&("function"==typeof n.unsubscribe?n=function(){r.unsubscribe()}:c(n),this._c=n)}catch(t){return void e.error(t)}y(this)&&g(this)};v.prototype=u({},{unsubscribe:function(){b(this)}});var w=function(e){this._s=e};w.prototype=u({},{next:function(e){var t=this._s;if(!y(t)){var n=t._o;try{var r=h(n.next);if(r)return r.call(n,e)}catch(e){try{b(t)}finally{throw e}}}},error:function(e){var t=this._s;if(y(t))throw e;var n=t._o;t._o=void 0;try{var r=h(n.error);if(!r)throw e;e=r.call(n,e)}catch(e){try{g(t)}finally{throw e}}return g(t),e},complete:function(e){var t=this._s;if(!y(t)){var n=t._o;t._o=void 0;try{var r=h(n.complete);e=r?r.call(n,e):void 0}catch(e){try{g(t)}finally{throw e}}return g(t),e}}});var S=function(e){d(this,S,"Observable","_f")._f=c(e)};u(S.prototype,{subscribe:function(e){return new v(e,this._f)},forEach:function(e){var t=this;return new(o.Promise||i.Promise)((function(n,r){c(e);var i=t.subscribe({next:function(t){try{return e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:n})}))}}),u(S,{from:function(e){var t="function"==typeof this?this:S,n=h(p(e)[s]);if(n){var r=p(n.call(e));return r.constructor===t?r:new t((function(e){return r.subscribe(e)}))}return new t((function(t){var n=!1;return a((function(){if(!n){try{if(m(e,!1,(function(e){if(t.next(e),n)return f}))===f)return}catch(e){if(n)throw e;return void t.error(e)}t.complete()}})),function(){n=!0}}))},of:function(){for(var e=0,t=arguments.length,n=new Array(t);e2,i=!!r&&a.call(arguments,2);return e(r?function(){("function"==typeof t?t:Function(t)).apply(this,i)}:t,n)}};i(i.G+i.B+i.F*s,{setTimeout:c(r.setTimeout),setInterval:c(r.setInterval)})},function(e,t,n){var r=n(0),i=n(99);r(r.G+r.B,{setImmediate:i.set,clearImmediate:i.clear})},function(e,t,n){for(var r=n(96),i=n(36),o=n(13),a=n(2),s=n(12),c=n(49),p=n(5),d=p("iterator"),u=p("toStringTag"),l=c.Array,m={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},f=i(m),h=0;h=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:k(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}}}function h(e,t,n,r){var i=t&&t.prototype instanceof y?t:y,o=Object.create(i.prototype),a=new R(r||[]);return o._invoke=function(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return C()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=x(a,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=g(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===d)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(e,n,a),o}function g(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function y(){}function b(){}function v(){}function w(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function S(e){function n(t,i,o,a){var s=g(e[t],e,i);if("throw"!==s.type){var c=s.arg,p=c.value;return p&&"object"==typeof p&&r.call(p,"__await")?Promise.resolve(p.__await).then((function(e){n("next",e,o,a)}),(function(e){n("throw",e,o,a)})):Promise.resolve(p).then((function(e){c.value=e,o(c)}),a)}a(s.arg)}var i;"object"==typeof t.process&&t.process.domain&&(n=t.process.domain.bind(n)),this._invoke=function(e,t){function r(){return new Promise((function(r,i){n(e,t,r,i)}))}return i=i?i.then(r,r):r()}}function x(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method))return d;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var r=g(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,d;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function I(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(I,this),this.reset(!0)}function k(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n{new o(e,i)}),i.once("connect",n)):new Promise((t,n)=>{i.once("connect",t),i.once("error",n),new o(e,i)})},e.exports.Protocol=i.Protocol,e.exports.List=i.List,e.exports.New=i.New,e.exports.Activate=i.Activate,e.exports.Close=i.Close,e.exports.Version=i.Version}).call(this,n(30))},function(e,t,n){(function(t,r,i){var o=n(142),a=n(45),s=n(143),c=n(144),p=n(366),d=s.IncomingMessage,u=s.readyStates;var l=e.exports=function(e){var n,r=this;c.Writable.call(r),r._opts=e,r._body=[],r._headers={},e.auth&&r.setHeader("Authorization","Basic "+new t(e.auth).toString("base64")),Object.keys(e.headers).forEach((function(t){r.setHeader(t,e.headers[t])}));var i=!0;if("disable-fetch"===e.mode||"requestTimeout"in e&&!o.abortController)i=!1,n=!0;else if("prefer-streaming"===e.mode)n=!1;else if("allow-wrong-content-type"===e.mode)n=!o.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");n=!0}r._mode=function(e,t){return o.fetch&&t?"fetch":o.mozchunkedarraybuffer?"moz-chunked-arraybuffer":o.msstream?"ms-stream":o.arraybuffer&&e?"arraybuffer":o.vbArray&&e?"text:vbarray":"text"}(n,i),r._fetchTimer=null,r.on("finish",(function(){r._onFinish()}))};a(l,c.Writable),l.prototype.setHeader=function(e,t){var n=e.toLowerCase();-1===m.indexOf(n)&&(this._headers[n]={name:e,value:t})},l.prototype.getHeader=function(e){var t=this._headers[e.toLowerCase()];return t?t.value:null},l.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},l.prototype._onFinish=function(){var e=this;if(!e._destroyed){var n=e._opts,a=e._headers,s=null;"GET"!==n.method&&"HEAD"!==n.method&&(s=o.arraybuffer?p(t.concat(e._body)):o.blobConstructor?new r.Blob(e._body.map((function(e){return p(e)})),{type:(a["content-type"]||{}).value||""}):t.concat(e._body).toString());var c=[];if(Object.keys(a).forEach((function(e){var t=a[e].name,n=a[e].value;Array.isArray(n)?n.forEach((function(e){c.push([t,e])})):c.push([t,n])})),"fetch"===e._mode){var d=null;if(o.abortController){var l=new AbortController;d=l.signal,e._fetchAbortController=l,"requestTimeout"in n&&0!==n.requestTimeout&&(e._fetchTimer=r.setTimeout((function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()}),n.requestTimeout))}r.fetch(e._opts.url,{method:e._opts.method,headers:c,body:s||void 0,mode:"cors",credentials:n.withCredentials?"include":"same-origin",signal:d}).then((function(t){e._fetchResponse=t,e._connect()}),(function(t){r.clearTimeout(e._fetchTimer),e._destroyed||e.emit("error",t)}))}else{var m=e._xhr=new r.XMLHttpRequest;try{m.open(e._opts.method,e._opts.url,!0)}catch(t){return void i.nextTick((function(){e.emit("error",t)}))}"responseType"in m&&(m.responseType=e._mode.split(":")[0]),"withCredentials"in m&&(m.withCredentials=!!n.withCredentials),"text"===e._mode&&"overrideMimeType"in m&&m.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in n&&(m.timeout=n.requestTimeout,m.ontimeout=function(){e.emit("requestTimeout")}),c.forEach((function(e){m.setRequestHeader(e[0],e[1])})),e._response=null,m.onreadystatechange=function(){switch(m.readyState){case u.LOADING:case u.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(m.onprogress=function(){e._onXHRProgress()}),m.onerror=function(){e._destroyed||e.emit("error",new Error("XHR error"))};try{m.send(s)}catch(t){return void i.nextTick((function(){e.emit("error",t)}))}}}},l.prototype._onXHRProgress=function(){(function(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}})(this._xhr)&&!this._destroyed&&(this._response||this._connect(),this._response._onXHRProgress())},l.prototype._connect=function(){var e=this;e._destroyed||(e._response=new d(e._xhr,e._fetchResponse,e._mode,e._fetchTimer),e._response.on("error",(function(t){e.emit("error",t)})),e.emit("response",e._response))},l.prototype._write=function(e,t,n){this._body.push(e),n()},l.prototype.abort=l.prototype.destroy=function(){this._destroyed=!0,r.clearTimeout(this._fetchTimer),this._response&&(this._response._destroyed=!0),this._xhr?this._xhr.abort():this._fetchAbortController&&this._fetchAbortController.abort()},l.prototype.end=function(e,t,n){"function"==typeof e&&(n=e,e=void 0),c.Writable.prototype.end.call(this,e,t,n)},l.prototype.flushHeaders=function(){},l.prototype.setTimeout=function(){},l.prototype.setNoDelay=function(){},l.prototype.setSocketKeepAlive=function(){};var m=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}).call(this,n(57).Buffer,n(11),n(30))},function(e,t,n){"use strict";t.byteLength=function(e){var t=p(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=p(e),a=r[0],s=r[1],c=new o(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),d=0,u=s>0?a-4:a;for(n=0;n>16&255,c[d++]=t>>8&255,c[d++]=255&t;2===s&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,c[d++]=255&t);1===s&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,c[d++]=t>>8&255,c[d++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=0,s=n-i;as?s:a+16383));1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,c=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function d(e,t,n){for(var i,o,a=[],s=t;s>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,c=(1<>1,d=-7,u=n?i-1:0,l=n?-1:1,m=e[t+u];for(u+=l,o=m&(1<<-d)-1,m>>=-d,d+=s;d>0;o=256*o+e[t+u],u+=l,d-=8);for(a=o&(1<<-d)-1,o>>=-d,d+=r;d>0;a=256*a+e[t+u],u+=l,d-=8);if(0===o)o=1-p;else{if(o===c)return a?NaN:1/0*(m?-1:1);a+=Math.pow(2,r),o-=p}return(m?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,c,p=8*o-i-1,d=(1<>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:o-1,f=r?1:-1,h=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=d):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+u>=1?l/c:l*Math.pow(2,1-u))*c>=2&&(a++,c/=2),a+u>=d?(s=0,a=d):a+u>=1?(s=(t*c-1)*Math.pow(2,i),a+=u):(s=t*Math.pow(2,u-1)*Math.pow(2,i),a=0));i>=8;e[n+m]=255&s,m+=f,s/=256,i-=8);for(a=a<0;e[n+m]=255&a,m+=f,a/=256,p-=8);e[n+m-f]|=128*h}},function(e,t){},function(e,t,n){"use strict";var r=n(74).Buffer,i=n(361);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t,n,i,o=r.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,n=o,i=s,t.copy(n,i),s+=a.data.length,a=a.next;return o},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(i.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(363),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(11))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,i,o,a,s,c=1,p={},d=!1,u=e.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(e);l=l&&l.setTimeout?l:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){f(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){f(e.data)},r=function(e){o.port2.postMessage(e)}):u&&"onreadystatechange"in u.createElement("script")?(i=u.documentElement,r=function(e){var t=u.createElement("script");t.onreadystatechange=function(){f(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(f,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&f(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}),l.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,f=String.fromCharCode;function h(e){throw new RangeError(l[e])}function g(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function y(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+g((e=e.replace(u,".")).split("."),t).join(".")}function b(e){for(var t,n,r=[],i=0,o=e.length;i=55296&&t<=56319&&i65535&&(t+=f((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=f(e)})).join("")}function w(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function S(e,t,n){var r=0;for(e=n?m(e/700):e>>1,e+=m(e/t);e>455;r+=36)e=m(e/35);return m(r+36*e/(e+38))}function x(e){var t,n,r,i,o,a,s,p,d,u,l,f=[],g=e.length,y=0,b=128,w=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r=128&&h("not-basic"),f.push(e.charCodeAt(r));for(i=n>0?n+1:0;i=g&&h("invalid-input"),((p=(l=e.charCodeAt(i++))-48<10?l-22:l-65<26?l-65:l-97<26?l-97:36)>=36||p>m((c-y)/a))&&h("overflow"),y+=p*a,!(p<(d=s<=w?1:s>=w+26?26:s-w));s+=36)a>m(c/(u=36-d))&&h("overflow"),a*=u;w=S(y-o,t=f.length+1,0==o),m(y/t)>c-b&&h("overflow"),b+=m(y/t),y%=t,f.splice(y++,0,b)}return v(f)}function I(e){var t,n,r,i,o,a,s,p,d,u,l,g,y,v,x,I=[];for(g=(e=b(e)).length,t=128,n=0,o=72,a=0;a=t&&lm((c-n)/(y=r+1))&&h("overflow"),n+=(s-t)*y,t=s,a=0;ac&&h("overflow"),l==t){for(p=n,d=36;!(p<(u=d<=o?1:d>=o+26?26:d-o));d+=36)x=p-u,v=36-u,I.push(f(w(u+x%v,0))),p=m(x/v);I.push(f(w(p,0))),o=S(n,y,r==i),n=0,++r}++n,++t}return I.join("")}s={version:"1.4.1",ucs2:{decode:b,encode:v},decode:x,encode:I,toASCII:function(e){return y(e,(function(e){return d.test(e)?"xn--"+I(e):e}))},toUnicode:function(e){return y(e,(function(e){return p.test(e)?x(e.slice(4).toLowerCase()):e}))}},void 0===(i=function(){return s}.call(t,n,t,e))||(e.exports=i)}()}).call(this,n(370)(e),n(11))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,n){"use strict";t.decode=t.parse=n(373),t.encode=t.stringify=n(374)},function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,o){t=t||"&",n=n||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var c=1e3;o&&"number"==typeof o.maxKeys&&(c=o.maxKeys);var p=e.length;c>0&&p>c&&(p=c);for(var d=0;d=0?(u=h.substr(0,g),l=h.substr(g+1)):(u=h,l=""),m=decodeURIComponent(u),f=decodeURIComponent(l),r(a,m)?i(a[m])?a[m].push(f):a[m]=[a[m],f]:a[m]=f}return a};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,s){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?o(a(e),(function(a){var s=encodeURIComponent(r(a))+n;return i(e[a])?o(e[a],(function(e){return s+encodeURIComponent(r(e))})).join(t):s+encodeURIComponent(r(e[a]))})).join(t):s?encodeURIComponent(r(s))+n+encodeURIComponent(r(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function o(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r element.","optional":true,"$ref":"AXValueNativeSourceType"},{"name":"nativeSourceValue","description":"The value, such as a node or node list, of the native source.","optional":true,"$ref":"AXValue"},{"name":"invalid","description":"Whether the value for this property is invalid.","optional":true,"type":"boolean"},{"name":"invalidReason","description":"Reason for the value being invalid, if it is.","optional":true,"type":"string"}]},{"id":"AXRelatedNode","type":"object","properties":[{"name":"backendDOMNodeId","description":"The BackendNodeId of the related DOM node.","$ref":"DOM.BackendNodeId"},{"name":"idref","description":"The IDRef value provided, if any.","optional":true,"type":"string"},{"name":"text","description":"The text alternative of this node in the current context.","optional":true,"type":"string"}]},{"id":"AXProperty","type":"object","properties":[{"name":"name","description":"The name of this property.","$ref":"AXPropertyName"},{"name":"value","description":"The value of this property.","$ref":"AXValue"}]},{"id":"AXValue","description":"A single computed AX property.","type":"object","properties":[{"name":"type","description":"The type of this value.","$ref":"AXValueType"},{"name":"value","description":"The computed value of this property.","optional":true,"type":"any"},{"name":"relatedNodes","description":"One or more related nodes, if applicable.","optional":true,"type":"array","items":{"$ref":"AXRelatedNode"}},{"name":"sources","description":"The sources which contributed to the computation of this property.","optional":true,"type":"array","items":{"$ref":"AXValueSource"}}]},{"id":"AXPropertyName","description":"Values of AXProperty name:\\n- from \'busy\' to \'roledescription\': states which apply to every AX node\\n- from \'live\' to \'root\': attributes which apply to nodes in live regions\\n- from \'autocomplete\' to \'valuetext\': attributes which apply to widgets\\n- from \'checked\' to \'selected\': states which apply to widgets\\n- from \'activedescendant\' to \'owns\' - relationships between elements other than parent/child/sibling.","type":"string","enum":["busy","disabled","editable","focusable","focused","hidden","hiddenRoot","invalid","keyshortcuts","settable","roledescription","live","atomic","relevant","root","autocomplete","hasPopup","level","multiselectable","orientation","multiline","readonly","required","valuemin","valuemax","valuetext","checked","expanded","modal","pressed","selected","activedescendant","controls","describedby","details","errormessage","flowto","labelledby","owns"]},{"id":"AXNode","description":"A node in the accessibility tree.","type":"object","properties":[{"name":"nodeId","description":"Unique identifier for this node.","$ref":"AXNodeId"},{"name":"ignored","description":"Whether this node is ignored for accessibility","type":"boolean"},{"name":"ignoredReasons","description":"Collection of reasons why this node is hidden.","optional":true,"type":"array","items":{"$ref":"AXProperty"}},{"name":"role","description":"This `Node`\'s role, whether explicit or implicit.","optional":true,"$ref":"AXValue"},{"name":"name","description":"The accessible name for this `Node`.","optional":true,"$ref":"AXValue"},{"name":"description","description":"The accessible description for this `Node`.","optional":true,"$ref":"AXValue"},{"name":"value","description":"The value for this `Node`.","optional":true,"$ref":"AXValue"},{"name":"properties","description":"All other properties","optional":true,"type":"array","items":{"$ref":"AXProperty"}},{"name":"childIds","description":"IDs for each of this node\'s child nodes.","optional":true,"type":"array","items":{"$ref":"AXNodeId"}},{"name":"backendDOMNodeId","description":"The backend ID for the associated DOM node, if any.","optional":true,"$ref":"DOM.BackendNodeId"}]}],"commands":[{"name":"disable","description":"Disables the accessibility domain."},{"name":"enable","description":"Enables the accessibility domain which causes `AXNodeId`s to remain consistent between method calls.\\nThis turns on accessibility for the page, which can impact performance until accessibility is disabled."},{"name":"getPartialAXTree","description":"Fetches the accessibility node and partial accessibility tree for this DOM node, if it exists.","experimental":true,"parameters":[{"name":"nodeId","description":"Identifier of the node to get the partial accessibility tree for.","optional":true,"$ref":"DOM.NodeId"},{"name":"backendNodeId","description":"Identifier of the backend node to get the partial accessibility tree for.","optional":true,"$ref":"DOM.BackendNodeId"},{"name":"objectId","description":"JavaScript object id of the node wrapper to get the partial accessibility tree for.","optional":true,"$ref":"Runtime.RemoteObjectId"},{"name":"fetchRelatives","description":"Whether to fetch this nodes ancestors, siblings and children. Defaults to true.","optional":true,"type":"boolean"}],"returns":[{"name":"nodes","description":"The `Accessibility.AXNode` for this DOM node, if it exists, plus its ancestors, siblings and\\nchildren, if requested.","type":"array","items":{"$ref":"AXNode"}}]},{"name":"getFullAXTree","description":"Fetches the entire accessibility tree","experimental":true,"returns":[{"name":"nodes","type":"array","items":{"$ref":"AXNode"}}]}]},{"domain":"Animation","experimental":true,"dependencies":["Runtime","DOM"],"types":[{"id":"Animation","description":"Animation instance.","type":"object","properties":[{"name":"id","description":"`Animation`\'s id.","type":"string"},{"name":"name","description":"`Animation`\'s name.","type":"string"},{"name":"pausedState","description":"`Animation`\'s internal paused state.","type":"boolean"},{"name":"playState","description":"`Animation`\'s play state.","type":"string"},{"name":"playbackRate","description":"`Animation`\'s playback rate.","type":"number"},{"name":"startTime","description":"`Animation`\'s start time.","type":"number"},{"name":"currentTime","description":"`Animation`\'s current time.","type":"number"},{"name":"type","description":"Animation type of `Animation`.","type":"string","enum":["CSSTransition","CSSAnimation","WebAnimation"]},{"name":"source","description":"`Animation`\'s source animation node.","optional":true,"$ref":"AnimationEffect"},{"name":"cssId","description":"A unique ID for `Animation` representing the sources that triggered this CSS\\nanimation/transition.","optional":true,"type":"string"}]},{"id":"AnimationEffect","description":"AnimationEffect instance","type":"object","properties":[{"name":"delay","description":"`AnimationEffect`\'s delay.","type":"number"},{"name":"endDelay","description":"`AnimationEffect`\'s end delay.","type":"number"},{"name":"iterationStart","description":"`AnimationEffect`\'s iteration start.","type":"number"},{"name":"iterations","description":"`AnimationEffect`\'s iterations.","type":"number"},{"name":"duration","description":"`AnimationEffect`\'s iteration duration.","type":"number"},{"name":"direction","description":"`AnimationEffect`\'s playback direction.","type":"string"},{"name":"fill","description":"`AnimationEffect`\'s fill mode.","type":"string"},{"name":"backendNodeId","description":"`AnimationEffect`\'s target node.","optional":true,"$ref":"DOM.BackendNodeId"},{"name":"keyframesRule","description":"`AnimationEffect`\'s keyframes.","optional":true,"$ref":"KeyframesRule"},{"name":"easing","description":"`AnimationEffect`\'s timing function.","type":"string"}]},{"id":"KeyframesRule","description":"Keyframes Rule","type":"object","properties":[{"name":"name","description":"CSS keyframed animation\'s name.","optional":true,"type":"string"},{"name":"keyframes","description":"List of animation keyframes.","type":"array","items":{"$ref":"KeyframeStyle"}}]},{"id":"KeyframeStyle","description":"Keyframe Style","type":"object","properties":[{"name":"offset","description":"Keyframe\'s time offset.","type":"string"},{"name":"easing","description":"`AnimationEffect`\'s timing function.","type":"string"}]}],"commands":[{"name":"disable","description":"Disables animation domain notifications."},{"name":"enable","description":"Enables animation domain notifications."},{"name":"getCurrentTime","description":"Returns the current time of the an animation.","parameters":[{"name":"id","description":"Id of animation.","type":"string"}],"returns":[{"name":"currentTime","description":"Current time of the page.","type":"number"}]},{"name":"getPlaybackRate","description":"Gets the playback rate of the document timeline.","returns":[{"name":"playbackRate","description":"Playback rate for animations on page.","type":"number"}]},{"name":"releaseAnimations","description":"Releases a set of animations to no longer be manipulated.","parameters":[{"name":"animations","description":"List of animation ids to seek.","type":"array","items":{"type":"string"}}]},{"name":"resolveAnimation","description":"Gets the remote object of the Animation.","parameters":[{"name":"animationId","description":"Animation id.","type":"string"}],"returns":[{"name":"remoteObject","description":"Corresponding remote object.","$ref":"Runtime.RemoteObject"}]},{"name":"seekAnimations","description":"Seek a set of animations to a particular time within each animation.","parameters":[{"name":"animations","description":"List of animation ids to seek.","type":"array","items":{"type":"string"}},{"name":"currentTime","description":"Set the current time of each animation.","type":"number"}]},{"name":"setPaused","description":"Sets the paused state of a set of animations.","parameters":[{"name":"animations","description":"Animations to set the pause state of.","type":"array","items":{"type":"string"}},{"name":"paused","description":"Paused state to set to.","type":"boolean"}]},{"name":"setPlaybackRate","description":"Sets the playback rate of the document timeline.","parameters":[{"name":"playbackRate","description":"Playback rate for animations on page","type":"number"}]},{"name":"setTiming","description":"Sets the timing of an animation node.","parameters":[{"name":"animationId","description":"Animation id.","type":"string"},{"name":"duration","description":"Duration of the animation.","type":"number"},{"name":"delay","description":"Delay of the animation.","type":"number"}]}],"events":[{"name":"animationCanceled","description":"Event for when an animation has been cancelled.","parameters":[{"name":"id","description":"Id of the animation that was cancelled.","type":"string"}]},{"name":"animationCreated","description":"Event for each animation that has been created.","parameters":[{"name":"id","description":"Id of the animation that was created.","type":"string"}]},{"name":"animationStarted","description":"Event for animation that has been started.","parameters":[{"name":"animation","description":"Animation that was started.","$ref":"Animation"}]}]},{"domain":"ApplicationCache","experimental":true,"types":[{"id":"ApplicationCacheResource","description":"Detailed application cache resource information.","type":"object","properties":[{"name":"url","description":"Resource url.","type":"string"},{"name":"size","description":"Resource size.","type":"integer"},{"name":"type","description":"Resource type.","type":"string"}]},{"id":"ApplicationCache","description":"Detailed application cache information.","type":"object","properties":[{"name":"manifestURL","description":"Manifest URL.","type":"string"},{"name":"size","description":"Application cache size.","type":"number"},{"name":"creationTime","description":"Application cache creation time.","type":"number"},{"name":"updateTime","description":"Application cache update time.","type":"number"},{"name":"resources","description":"Application cache resources.","type":"array","items":{"$ref":"ApplicationCacheResource"}}]},{"id":"FrameWithManifest","description":"Frame identifier - manifest URL pair.","type":"object","properties":[{"name":"frameId","description":"Frame identifier.","$ref":"Page.FrameId"},{"name":"manifestURL","description":"Manifest URL.","type":"string"},{"name":"status","description":"Application cache status.","type":"integer"}]}],"commands":[{"name":"enable","description":"Enables application cache domain notifications."},{"name":"getApplicationCacheForFrame","description":"Returns relevant application cache data for the document in given frame.","parameters":[{"name":"frameId","description":"Identifier of the frame containing document whose application cache is retrieved.","$ref":"Page.FrameId"}],"returns":[{"name":"applicationCache","description":"Relevant application cache data for the document in given frame.","$ref":"ApplicationCache"}]},{"name":"getFramesWithManifests","description":"Returns array of frame identifiers with manifest urls for each frame containing a document\\nassociated with some application cache.","returns":[{"name":"frameIds","description":"Array of frame identifiers with manifest urls for each frame containing a document\\nassociated with some application cache.","type":"array","items":{"$ref":"FrameWithManifest"}}]},{"name":"getManifestForFrame","description":"Returns manifest URL for document in the given frame.","parameters":[{"name":"frameId","description":"Identifier of the frame containing document whose manifest is retrieved.","$ref":"Page.FrameId"}],"returns":[{"name":"manifestURL","description":"Manifest URL for document in the given frame.","type":"string"}]}],"events":[{"name":"applicationCacheStatusUpdated","parameters":[{"name":"frameId","description":"Identifier of the frame containing document whose application cache updated status.","$ref":"Page.FrameId"},{"name":"manifestURL","description":"Manifest URL.","type":"string"},{"name":"status","description":"Updated application cache status.","type":"integer"}]},{"name":"networkStateUpdated","parameters":[{"name":"isNowOnline","type":"boolean"}]}]},{"domain":"Audits","description":"Audits domain allows investigation of page violations and possible improvements.","experimental":true,"dependencies":["Network"],"commands":[{"name":"getEncodedResponse","description":"Returns the response body and size if it were re-encoded with the specified settings. Only\\napplies to images.","parameters":[{"name":"requestId","description":"Identifier of the network request to get content for.","$ref":"Network.RequestId"},{"name":"encoding","description":"The encoding to use.","type":"string","enum":["webp","jpeg","png"]},{"name":"quality","description":"The quality of the encoding (0-1). (defaults to 1)","optional":true,"type":"number"},{"name":"sizeOnly","description":"Whether to only return the size information (defaults to false).","optional":true,"type":"boolean"}],"returns":[{"name":"body","description":"The encoded body as a base64 string. Omitted if sizeOnly is true.","optional":true,"type":"string"},{"name":"originalSize","description":"Size before re-encoding.","type":"integer"},{"name":"encodedSize","description":"Size after re-encoding.","type":"integer"}]}]},{"domain":"BackgroundService","description":"Defines events for background web platform features.","experimental":true,"types":[{"id":"ServiceName","description":"The Background Service that will be associated with the commands/events.\\nEvery Background Service operates independently, but they share the same\\nAPI.","type":"string","enum":["backgroundFetch","backgroundSync","pushMessaging","notifications","paymentHandler"]},{"id":"EventMetadata","description":"A key-value pair for additional event information to pass along.","type":"object","properties":[{"name":"key","type":"string"},{"name":"value","type":"string"}]},{"id":"BackgroundServiceEvent","type":"object","properties":[{"name":"timestamp","description":"Timestamp of the event (in seconds).","$ref":"Network.TimeSinceEpoch"},{"name":"origin","description":"The origin this event belongs to.","type":"string"},{"name":"serviceWorkerRegistrationId","description":"The Service Worker ID that initiated the event.","$ref":"ServiceWorker.RegistrationID"},{"name":"service","description":"The Background Service this event belongs to.","$ref":"ServiceName"},{"name":"eventName","description":"A description of the event.","type":"string"},{"name":"instanceId","description":"An identifier that groups related events together.","type":"string"},{"name":"eventMetadata","description":"A list of event-specific information.","type":"array","items":{"$ref":"EventMetadata"}}]}],"commands":[{"name":"startObserving","description":"Enables event updates for the service.","parameters":[{"name":"service","$ref":"ServiceName"}]},{"name":"stopObserving","description":"Disables event updates for the service.","parameters":[{"name":"service","$ref":"ServiceName"}]},{"name":"setRecording","description":"Set the recording state for the service.","parameters":[{"name":"shouldRecord","type":"boolean"},{"name":"service","$ref":"ServiceName"}]},{"name":"clearEvents","description":"Clears all stored data for the service.","parameters":[{"name":"service","$ref":"ServiceName"}]}],"events":[{"name":"recordingStateChanged","description":"Called when the recording state for the service has been updated.","parameters":[{"name":"isRecording","type":"boolean"},{"name":"service","$ref":"ServiceName"}]},{"name":"backgroundServiceEventReceived","description":"Called with all existing backgroundServiceEvents when enabled, and all new\\nevents afterwards if enabled and recording.","parameters":[{"name":"backgroundServiceEvent","$ref":"BackgroundServiceEvent"}]}]},{"domain":"Browser","description":"The Browser domain defines methods and events for browser managing.","types":[{"id":"WindowID","experimental":true,"type":"integer"},{"id":"WindowState","description":"The state of the browser window.","experimental":true,"type":"string","enum":["normal","minimized","maximized","fullscreen"]},{"id":"Bounds","description":"Browser window bounds information","experimental":true,"type":"object","properties":[{"name":"left","description":"The offset from the left edge of the screen to the window in pixels.","optional":true,"type":"integer"},{"name":"top","description":"The offset from the top edge of the screen to the window in pixels.","optional":true,"type":"integer"},{"name":"width","description":"The window width in pixels.","optional":true,"type":"integer"},{"name":"height","description":"The window height in pixels.","optional":true,"type":"integer"},{"name":"windowState","description":"The window state. Default to normal.","optional":true,"$ref":"WindowState"}]},{"id":"PermissionType","experimental":true,"type":"string","enum":["accessibilityEvents","audioCapture","backgroundSync","backgroundFetch","clipboardRead","clipboardWrite","durableStorage","flash","geolocation","midi","midiSysex","notifications","paymentHandler","periodicBackgroundSync","protectedMediaIdentifier","sensors","videoCapture","idleDetection","wakeLockScreen","wakeLockSystem"]},{"id":"Bucket","description":"Chrome histogram bucket.","experimental":true,"type":"object","properties":[{"name":"low","description":"Minimum value (inclusive).","type":"integer"},{"name":"high","description":"Maximum value (exclusive).","type":"integer"},{"name":"count","description":"Number of samples.","type":"integer"}]},{"id":"Histogram","description":"Chrome histogram.","experimental":true,"type":"object","properties":[{"name":"name","description":"Name.","type":"string"},{"name":"sum","description":"Sum of sample values.","type":"integer"},{"name":"count","description":"Total number of samples.","type":"integer"},{"name":"buckets","description":"Buckets.","type":"array","items":{"$ref":"Bucket"}}]}],"commands":[{"name":"grantPermissions","description":"Grant specific permissions to the given origin and reject all others.","experimental":true,"parameters":[{"name":"origin","type":"string"},{"name":"permissions","type":"array","items":{"$ref":"PermissionType"}},{"name":"browserContextId","description":"BrowserContext to override permissions. When omitted, default browser context is used.","optional":true,"$ref":"Target.BrowserContextID"}]},{"name":"resetPermissions","description":"Reset all permission management for all origins.","experimental":true,"parameters":[{"name":"browserContextId","description":"BrowserContext to reset permissions. When omitted, default browser context is used.","optional":true,"$ref":"Target.BrowserContextID"}]},{"name":"close","description":"Close browser gracefully."},{"name":"crash","description":"Crashes browser on the main thread.","experimental":true},{"name":"crashGpuProcess","description":"Crashes GPU process.","experimental":true},{"name":"getVersion","description":"Returns version information.","returns":[{"name":"protocolVersion","description":"Protocol version.","type":"string"},{"name":"product","description":"Product name.","type":"string"},{"name":"revision","description":"Product revision.","type":"string"},{"name":"userAgent","description":"User-Agent.","type":"string"},{"name":"jsVersion","description":"V8 version.","type":"string"}]},{"name":"getBrowserCommandLine","description":"Returns the command line switches for the browser process if, and only if\\n--enable-automation is on the commandline.","experimental":true,"returns":[{"name":"arguments","description":"Commandline parameters","type":"array","items":{"type":"string"}}]},{"name":"getHistograms","description":"Get Chrome histograms.","experimental":true,"parameters":[{"name":"query","description":"Requested substring in name. Only histograms which have query as a\\nsubstring in their name are extracted. An empty or absent query returns\\nall histograms.","optional":true,"type":"string"},{"name":"delta","description":"If true, retrieve delta since last call.","optional":true,"type":"boolean"}],"returns":[{"name":"histograms","description":"Histograms.","type":"array","items":{"$ref":"Histogram"}}]},{"name":"getHistogram","description":"Get a Chrome histogram by name.","experimental":true,"parameters":[{"name":"name","description":"Requested histogram name.","type":"string"},{"name":"delta","description":"If true, retrieve delta since last call.","optional":true,"type":"boolean"}],"returns":[{"name":"histogram","description":"Histogram.","$ref":"Histogram"}]},{"name":"getWindowBounds","description":"Get position and size of the browser window.","experimental":true,"parameters":[{"name":"windowId","description":"Browser window id.","$ref":"WindowID"}],"returns":[{"name":"bounds","description":"Bounds information of the window. When window state is \'minimized\', the restored window\\nposition and size are returned.","$ref":"Bounds"}]},{"name":"getWindowForTarget","description":"Get the browser window that contains the devtools target.","experimental":true,"parameters":[{"name":"targetId","description":"Devtools agent host id. If called as a part of the session, associated targetId is used.","optional":true,"$ref":"Target.TargetID"}],"returns":[{"name":"windowId","description":"Browser window id.","$ref":"WindowID"},{"name":"bounds","description":"Bounds information of the window. When window state is \'minimized\', the restored window\\nposition and size are returned.","$ref":"Bounds"}]},{"name":"setWindowBounds","description":"Set position and/or size of the browser window.","experimental":true,"parameters":[{"name":"windowId","description":"Browser window id.","$ref":"WindowID"},{"name":"bounds","description":"New window bounds. The \'minimized\', \'maximized\' and \'fullscreen\' states cannot be combined\\nwith \'left\', \'top\', \'width\' or \'height\'. Leaves unspecified fields unchanged.","$ref":"Bounds"}]},{"name":"setDockTile","description":"Set dock tile details, platform-specific.","experimental":true,"parameters":[{"name":"badgeLabel","optional":true,"type":"string"},{"name":"image","description":"Png encoded image.","optional":true,"type":"string"}]}]},{"domain":"CSS","description":"This domain exposes CSS read/write operations. All CSS objects (stylesheets, rules, and styles)\\nhave an associated `id` used in subsequent operations on the related object. Each object type has\\na specific `id` structure, and those are not interchangeable between objects of different kinds.\\nCSS objects can be loaded using the `get*ForNode()` calls (which accept a DOM node id). A client\\ncan also keep track of stylesheets via the `styleSheetAdded`/`styleSheetRemoved` events and\\nsubsequently load the required stylesheet contents using the `getStyleSheet[Text]()` methods.","experimental":true,"dependencies":["DOM"],"types":[{"id":"StyleSheetId","type":"string"},{"id":"StyleSheetOrigin","description":"Stylesheet type: \\"injected\\" for stylesheets injected via extension, \\"user-agent\\" for user-agent\\nstylesheets, \\"inspector\\" for stylesheets created by the inspector (i.e. those holding the \\"via\\ninspector\\" rules), \\"regular\\" for regular stylesheets.","type":"string","enum":["injected","user-agent","inspector","regular"]},{"id":"PseudoElementMatches","description":"CSS rule collection for a single pseudo style.","type":"object","properties":[{"name":"pseudoType","description":"Pseudo element type.","$ref":"DOM.PseudoType"},{"name":"matches","description":"Matches of CSS rules applicable to the pseudo style.","type":"array","items":{"$ref":"RuleMatch"}}]},{"id":"InheritedStyleEntry","description":"Inherited CSS rule collection from ancestor node.","type":"object","properties":[{"name":"inlineStyle","description":"The ancestor node\'s inline style, if any, in the style inheritance chain.","optional":true,"$ref":"CSSStyle"},{"name":"matchedCSSRules","description":"Matches of CSS rules matching the ancestor node in the style inheritance chain.","type":"array","items":{"$ref":"RuleMatch"}}]},{"id":"RuleMatch","description":"Match data for a CSS rule.","type":"object","properties":[{"name":"rule","description":"CSS rule in the match.","$ref":"CSSRule"},{"name":"matchingSelectors","description":"Matching selector indices in the rule\'s selectorList selectors (0-based).","type":"array","items":{"type":"integer"}}]},{"id":"Value","description":"Data for a simple selector (these are delimited by commas in a selector list).","type":"object","properties":[{"name":"text","description":"Value text.","type":"string"},{"name":"range","description":"Value range in the underlying resource (if available).","optional":true,"$ref":"SourceRange"}]},{"id":"SelectorList","description":"Selector list data.","type":"object","properties":[{"name":"selectors","description":"Selectors in the list.","type":"array","items":{"$ref":"Value"}},{"name":"text","description":"Rule selector text.","type":"string"}]},{"id":"CSSStyleSheetHeader","description":"CSS stylesheet metainformation.","type":"object","properties":[{"name":"styleSheetId","description":"The stylesheet identifier.","$ref":"StyleSheetId"},{"name":"frameId","description":"Owner frame identifier.","$ref":"Page.FrameId"},{"name":"sourceURL","description":"Stylesheet resource URL.","type":"string"},{"name":"sourceMapURL","description":"URL of source map associated with the stylesheet (if any).","optional":true,"type":"string"},{"name":"origin","description":"Stylesheet origin.","$ref":"StyleSheetOrigin"},{"name":"title","description":"Stylesheet title.","type":"string"},{"name":"ownerNode","description":"The backend id for the owner node of the stylesheet.","optional":true,"$ref":"DOM.BackendNodeId"},{"name":"disabled","description":"Denotes whether the stylesheet is disabled.","type":"boolean"},{"name":"hasSourceURL","description":"Whether the sourceURL field value comes from the sourceURL comment.","optional":true,"type":"boolean"},{"name":"isInline","description":"Whether this stylesheet is created for STYLE tag by parser. This flag is not set for\\ndocument.written STYLE tags.","type":"boolean"},{"name":"startLine","description":"Line offset of the stylesheet within the resource (zero based).","type":"number"},{"name":"startColumn","description":"Column offset of the stylesheet within the resource (zero based).","type":"number"},{"name":"length","description":"Size of the content (in characters).","type":"number"}]},{"id":"CSSRule","description":"CSS rule representation.","type":"object","properties":[{"name":"styleSheetId","description":"The css style sheet identifier (absent for user agent stylesheet and user-specified\\nstylesheet rules) this rule came from.","optional":true,"$ref":"StyleSheetId"},{"name":"selectorList","description":"Rule selector data.","$ref":"SelectorList"},{"name":"origin","description":"Parent stylesheet\'s origin.","$ref":"StyleSheetOrigin"},{"name":"style","description":"Associated style declaration.","$ref":"CSSStyle"},{"name":"media","description":"Media list array (for rules involving media queries). The array enumerates media queries\\nstarting with the innermost one, going outwards.","optional":true,"type":"array","items":{"$ref":"CSSMedia"}}]},{"id":"RuleUsage","description":"CSS coverage information.","type":"object","properties":[{"name":"styleSheetId","description":"The css style sheet identifier (absent for user agent stylesheet and user-specified\\nstylesheet rules) this rule came from.","$ref":"StyleSheetId"},{"name":"startOffset","description":"Offset of the start of the rule (including selector) from the beginning of the stylesheet.","type":"number"},{"name":"endOffset","description":"Offset of the end of the rule body from the beginning of the stylesheet.","type":"number"},{"name":"used","description":"Indicates whether the rule was actually used by some element in the page.","type":"boolean"}]},{"id":"SourceRange","description":"Text range within a resource. All numbers are zero-based.","type":"object","properties":[{"name":"startLine","description":"Start line of range.","type":"integer"},{"name":"startColumn","description":"Start column of range (inclusive).","type":"integer"},{"name":"endLine","description":"End line of range","type":"integer"},{"name":"endColumn","description":"End column of range (exclusive).","type":"integer"}]},{"id":"ShorthandEntry","type":"object","properties":[{"name":"name","description":"Shorthand name.","type":"string"},{"name":"value","description":"Shorthand value.","type":"string"},{"name":"important","description":"Whether the property has \\"!important\\" annotation (implies `false` if absent).","optional":true,"type":"boolean"}]},{"id":"CSSComputedStyleProperty","type":"object","properties":[{"name":"name","description":"Computed style property name.","type":"string"},{"name":"value","description":"Computed style property value.","type":"string"}]},{"id":"CSSStyle","description":"CSS style representation.","type":"object","properties":[{"name":"styleSheetId","description":"The css style sheet identifier (absent for user agent stylesheet and user-specified\\nstylesheet rules) this rule came from.","optional":true,"$ref":"StyleSheetId"},{"name":"cssProperties","description":"CSS properties in the style.","type":"array","items":{"$ref":"CSSProperty"}},{"name":"shorthandEntries","description":"Computed values for all shorthands found in the style.","type":"array","items":{"$ref":"ShorthandEntry"}},{"name":"cssText","description":"Style declaration text (if available).","optional":true,"type":"string"},{"name":"range","description":"Style declaration range in the enclosing stylesheet (if available).","optional":true,"$ref":"SourceRange"}]},{"id":"CSSProperty","description":"CSS property declaration data.","type":"object","properties":[{"name":"name","description":"The property name.","type":"string"},{"name":"value","description":"The property value.","type":"string"},{"name":"important","description":"Whether the property has \\"!important\\" annotation (implies `false` if absent).","optional":true,"type":"boolean"},{"name":"implicit","description":"Whether the property is implicit (implies `false` if absent).","optional":true,"type":"boolean"},{"name":"text","description":"The full property text as specified in the style.","optional":true,"type":"string"},{"name":"parsedOk","description":"Whether the property is understood by the browser (implies `true` if absent).","optional":true,"type":"boolean"},{"name":"disabled","description":"Whether the property is disabled by the user (present for source-based properties only).","optional":true,"type":"boolean"},{"name":"range","description":"The entire property range in the enclosing style declaration (if available).","optional":true,"$ref":"SourceRange"}]},{"id":"CSSMedia","description":"CSS media rule descriptor.","type":"object","properties":[{"name":"text","description":"Media query text.","type":"string"},{"name":"source","description":"Source of the media query: \\"mediaRule\\" if specified by a @media rule, \\"importRule\\" if\\nspecified by an @import rule, \\"linkedSheet\\" if specified by a \\"media\\" attribute in a linked\\nstylesheet\'s LINK tag, \\"inlineSheet\\" if specified by a \\"media\\" attribute in an inline\\nstylesheet\'s STYLE tag.","type":"string","enum":["mediaRule","importRule","linkedSheet","inlineSheet"]},{"name":"sourceURL","description":"URL of the document containing the media query description.","optional":true,"type":"string"},{"name":"range","description":"The associated rule (@media or @import) header range in the enclosing stylesheet (if\\navailable).","optional":true,"$ref":"SourceRange"},{"name":"styleSheetId","description":"Identifier of the stylesheet containing this object (if exists).","optional":true,"$ref":"StyleSheetId"},{"name":"mediaList","description":"Array of media queries.","optional":true,"type":"array","items":{"$ref":"MediaQuery"}}]},{"id":"MediaQuery","description":"Media query descriptor.","type":"object","properties":[{"name":"expressions","description":"Array of media query expressions.","type":"array","items":{"$ref":"MediaQueryExpression"}},{"name":"active","description":"Whether the media query condition is satisfied.","type":"boolean"}]},{"id":"MediaQueryExpression","description":"Media query expression descriptor.","type":"object","properties":[{"name":"value","description":"Media query expression value.","type":"number"},{"name":"unit","description":"Media query expression units.","type":"string"},{"name":"feature","description":"Media query expression feature.","type":"string"},{"name":"valueRange","description":"The associated range of the value text in the enclosing stylesheet (if available).","optional":true,"$ref":"SourceRange"},{"name":"computedLength","description":"Computed length of media query expression (if applicable).","optional":true,"type":"number"}]},{"id":"PlatformFontUsage","description":"Information about amount of glyphs that were rendered with given font.","type":"object","properties":[{"name":"familyName","description":"Font\'s family name reported by platform.","type":"string"},{"name":"isCustomFont","description":"Indicates if the font was downloaded or resolved locally.","type":"boolean"},{"name":"glyphCount","description":"Amount of glyphs that were rendered with this font.","type":"number"}]},{"id":"FontFace","description":"Properties of a web font: https://www.w3.org/TR/2008/REC-CSS2-20080411/fonts.html#font-descriptions","type":"object","properties":[{"name":"fontFamily","description":"The font-family.","type":"string"},{"name":"fontStyle","description":"The font-style.","type":"string"},{"name":"fontVariant","description":"The font-variant.","type":"string"},{"name":"fontWeight","description":"The font-weight.","type":"string"},{"name":"fontStretch","description":"The font-stretch.","type":"string"},{"name":"unicodeRange","description":"The unicode-range.","type":"string"},{"name":"src","description":"The src.","type":"string"},{"name":"platformFontFamily","description":"The resolved platform font family","type":"string"}]},{"id":"CSSKeyframesRule","description":"CSS keyframes rule representation.","type":"object","properties":[{"name":"animationName","description":"Animation name.","$ref":"Value"},{"name":"keyframes","description":"List of keyframes.","type":"array","items":{"$ref":"CSSKeyframeRule"}}]},{"id":"CSSKeyframeRule","description":"CSS keyframe rule representation.","type":"object","properties":[{"name":"styleSheetId","description":"The css style sheet identifier (absent for user agent stylesheet and user-specified\\nstylesheet rules) this rule came from.","optional":true,"$ref":"StyleSheetId"},{"name":"origin","description":"Parent stylesheet\'s origin.","$ref":"StyleSheetOrigin"},{"name":"keyText","description":"Associated key text.","$ref":"Value"},{"name":"style","description":"Associated style declaration.","$ref":"CSSStyle"}]},{"id":"StyleDeclarationEdit","description":"A descriptor of operation to mutate style declaration text.","type":"object","properties":[{"name":"styleSheetId","description":"The css style sheet identifier.","$ref":"StyleSheetId"},{"name":"range","description":"The range of the style text in the enclosing stylesheet.","$ref":"SourceRange"},{"name":"text","description":"New style text.","type":"string"}]}],"commands":[{"name":"addRule","description":"Inserts a new rule with the given `ruleText` in a stylesheet with given `styleSheetId`, at the\\nposition specified by `location`.","parameters":[{"name":"styleSheetId","description":"The css style sheet identifier where a new rule should be inserted.","$ref":"StyleSheetId"},{"name":"ruleText","description":"The text of a new rule.","type":"string"},{"name":"location","description":"Text position of a new rule in the target style sheet.","$ref":"SourceRange"}],"returns":[{"name":"rule","description":"The newly created rule.","$ref":"CSSRule"}]},{"name":"collectClassNames","description":"Returns all class names from specified stylesheet.","parameters":[{"name":"styleSheetId","$ref":"StyleSheetId"}],"returns":[{"name":"classNames","description":"Class name list.","type":"array","items":{"type":"string"}}]},{"name":"createStyleSheet","description":"Creates a new special \\"via-inspector\\" stylesheet in the frame with given `frameId`.","parameters":[{"name":"frameId","description":"Identifier of the frame where \\"via-inspector\\" stylesheet should be created.","$ref":"Page.FrameId"}],"returns":[{"name":"styleSheetId","description":"Identifier of the created \\"via-inspector\\" stylesheet.","$ref":"StyleSheetId"}]},{"name":"disable","description":"Disables the CSS agent for the given page."},{"name":"enable","description":"Enables the CSS agent for the given page. Clients should not assume that the CSS agent has been\\nenabled until the result of this command is received."},{"name":"forcePseudoState","description":"Ensures that the given node will have specified pseudo-classes whenever its style is computed by\\nthe browser.","parameters":[{"name":"nodeId","description":"The element id for which to force the pseudo state.","$ref":"DOM.NodeId"},{"name":"forcedPseudoClasses","description":"Element pseudo classes to force when computing the element\'s style.","type":"array","items":{"type":"string"}}]},{"name":"getBackgroundColors","parameters":[{"name":"nodeId","description":"Id of the node to get background colors for.","$ref":"DOM.NodeId"}],"returns":[{"name":"backgroundColors","description":"The range of background colors behind this element, if it contains any visible text. If no\\nvisible text is present, this will be undefined. In the case of a flat background color,\\nthis will consist of simply that color. In the case of a gradient, this will consist of each\\nof the color stops. For anything more complicated, this will be an empty array. Images will\\nbe ignored (as if the image had failed to load).","optional":true,"type":"array","items":{"type":"string"}},{"name":"computedFontSize","description":"The computed font size for this node, as a CSS computed value string (e.g. \'12px\').","optional":true,"type":"string"},{"name":"computedFontWeight","description":"The computed font weight for this node, as a CSS computed value string (e.g. \'normal\' or\\n\'100\').","optional":true,"type":"string"}]},{"name":"getComputedStyleForNode","description":"Returns the computed style for a DOM node identified by `nodeId`.","parameters":[{"name":"nodeId","$ref":"DOM.NodeId"}],"returns":[{"name":"computedStyle","description":"Computed style for the specified DOM node.","type":"array","items":{"$ref":"CSSComputedStyleProperty"}}]},{"name":"getInlineStylesForNode","description":"Returns the styles defined inline (explicitly in the \\"style\\" attribute and implicitly, using DOM\\nattributes) for a DOM node identified by `nodeId`.","parameters":[{"name":"nodeId","$ref":"DOM.NodeId"}],"returns":[{"name":"inlineStyle","description":"Inline style for the specified DOM node.","optional":true,"$ref":"CSSStyle"},{"name":"attributesStyle","description":"Attribute-defined element style (e.g. resulting from \\"width=20 height=100%\\").","optional":true,"$ref":"CSSStyle"}]},{"name":"getMatchedStylesForNode","description":"Returns requested styles for a DOM node identified by `nodeId`.","parameters":[{"name":"nodeId","$ref":"DOM.NodeId"}],"returns":[{"name":"inlineStyle","description":"Inline style for the specified DOM node.","optional":true,"$ref":"CSSStyle"},{"name":"attributesStyle","description":"Attribute-defined element style (e.g. resulting from \\"width=20 height=100%\\").","optional":true,"$ref":"CSSStyle"},{"name":"matchedCSSRules","description":"CSS rules matching this node, from all applicable stylesheets.","optional":true,"type":"array","items":{"$ref":"RuleMatch"}},{"name":"pseudoElements","description":"Pseudo style matches for this node.","optional":true,"type":"array","items":{"$ref":"PseudoElementMatches"}},{"name":"inherited","description":"A chain of inherited styles (from the immediate node parent up to the DOM tree root).","optional":true,"type":"array","items":{"$ref":"InheritedStyleEntry"}},{"name":"cssKeyframesRules","description":"A list of CSS keyframed animations matching this node.","optional":true,"type":"array","items":{"$ref":"CSSKeyframesRule"}}]},{"name":"getMediaQueries","description":"Returns all media queries parsed by the rendering engine.","returns":[{"name":"medias","type":"array","items":{"$ref":"CSSMedia"}}]},{"name":"getPlatformFontsForNode","description":"Requests information about platform fonts which we used to render child TextNodes in the given\\nnode.","parameters":[{"name":"nodeId","$ref":"DOM.NodeId"}],"returns":[{"name":"fonts","description":"Usage statistics for every employed platform font.","type":"array","items":{"$ref":"PlatformFontUsage"}}]},{"name":"getStyleSheetText","description":"Returns the current textual content for a stylesheet.","parameters":[{"name":"styleSheetId","$ref":"StyleSheetId"}],"returns":[{"name":"text","description":"The stylesheet text.","type":"string"}]},{"name":"setEffectivePropertyValueForNode","description":"Find a rule with the given active property for the given node and set the new value for this\\nproperty","parameters":[{"name":"nodeId","description":"The element id for which to set property.","$ref":"DOM.NodeId"},{"name":"propertyName","type":"string"},{"name":"value","type":"string"}]},{"name":"setKeyframeKey","description":"Modifies the keyframe rule key text.","parameters":[{"name":"styleSheetId","$ref":"StyleSheetId"},{"name":"range","$ref":"SourceRange"},{"name":"keyText","type":"string"}],"returns":[{"name":"keyText","description":"The resulting key text after modification.","$ref":"Value"}]},{"name":"setMediaText","description":"Modifies the rule selector.","parameters":[{"name":"styleSheetId","$ref":"StyleSheetId"},{"name":"range","$ref":"SourceRange"},{"name":"text","type":"string"}],"returns":[{"name":"media","description":"The resulting CSS media rule after modification.","$ref":"CSSMedia"}]},{"name":"setRuleSelector","description":"Modifies the rule selector.","parameters":[{"name":"styleSheetId","$ref":"StyleSheetId"},{"name":"range","$ref":"SourceRange"},{"name":"selector","type":"string"}],"returns":[{"name":"selectorList","description":"The resulting selector list after modification.","$ref":"SelectorList"}]},{"name":"setStyleSheetText","description":"Sets the new stylesheet text.","parameters":[{"name":"styleSheetId","$ref":"StyleSheetId"},{"name":"text","type":"string"}],"returns":[{"name":"sourceMapURL","description":"URL of source map associated with script (if any).","optional":true,"type":"string"}]},{"name":"setStyleTexts","description":"Applies specified style edits one after another in the given order.","parameters":[{"name":"edits","type":"array","items":{"$ref":"StyleDeclarationEdit"}}],"returns":[{"name":"styles","description":"The resulting styles after modification.","type":"array","items":{"$ref":"CSSStyle"}}]},{"name":"startRuleUsageTracking","description":"Enables the selector recording."},{"name":"stopRuleUsageTracking","description":"Stop tracking rule usage and return the list of rules that were used since last call to\\n`takeCoverageDelta` (or since start of coverage instrumentation)","returns":[{"name":"ruleUsage","type":"array","items":{"$ref":"RuleUsage"}}]},{"name":"takeCoverageDelta","description":"Obtain list of rules that became used since last call to this method (or since start of coverage\\ninstrumentation)","returns":[{"name":"coverage","type":"array","items":{"$ref":"RuleUsage"}}]}],"events":[{"name":"fontsUpdated","description":"Fires whenever a web font is updated. A non-empty font parameter indicates a successfully loaded\\nweb font","parameters":[{"name":"font","description":"The web font that has loaded.","optional":true,"$ref":"FontFace"}]},{"name":"mediaQueryResultChanged","description":"Fires whenever a MediaQuery result changes (for example, after a browser window has been\\nresized.) The current implementation considers only viewport-dependent media features."},{"name":"styleSheetAdded","description":"Fired whenever an active document stylesheet is added.","parameters":[{"name":"header","description":"Added stylesheet metainfo.","$ref":"CSSStyleSheetHeader"}]},{"name":"styleSheetChanged","description":"Fired whenever a stylesheet is changed as a result of the client operation.","parameters":[{"name":"styleSheetId","$ref":"StyleSheetId"}]},{"name":"styleSheetRemoved","description":"Fired whenever an active document stylesheet is removed.","parameters":[{"name":"styleSheetId","description":"Identifier of the removed stylesheet.","$ref":"StyleSheetId"}]}]},{"domain":"CacheStorage","experimental":true,"types":[{"id":"CacheId","description":"Unique identifier of the Cache object.","type":"string"},{"id":"CachedResponseType","description":"type of HTTP response cached","type":"string","enum":["basic","cors","default","error","opaqueResponse","opaqueRedirect"]},{"id":"DataEntry","description":"Data entry.","type":"object","properties":[{"name":"requestURL","description":"Request URL.","type":"string"},{"name":"requestMethod","description":"Request method.","type":"string"},{"name":"requestHeaders","description":"Request headers","type":"array","items":{"$ref":"Header"}},{"name":"responseTime","description":"Number of seconds since epoch.","type":"number"},{"name":"responseStatus","description":"HTTP response status code.","type":"integer"},{"name":"responseStatusText","description":"HTTP response status text.","type":"string"},{"name":"responseType","description":"HTTP response type","$ref":"CachedResponseType"},{"name":"responseHeaders","description":"Response headers","type":"array","items":{"$ref":"Header"}}]},{"id":"Cache","description":"Cache identifier.","type":"object","properties":[{"name":"cacheId","description":"An opaque unique id of the cache.","$ref":"CacheId"},{"name":"securityOrigin","description":"Security origin of the cache.","type":"string"},{"name":"cacheName","description":"The name of the cache.","type":"string"}]},{"id":"Header","type":"object","properties":[{"name":"name","type":"string"},{"name":"value","type":"string"}]},{"id":"CachedResponse","description":"Cached response","type":"object","properties":[{"name":"body","description":"Entry content, base64-encoded.","type":"string"}]}],"commands":[{"name":"deleteCache","description":"Deletes a cache.","parameters":[{"name":"cacheId","description":"Id of cache for deletion.","$ref":"CacheId"}]},{"name":"deleteEntry","description":"Deletes a cache entry.","parameters":[{"name":"cacheId","description":"Id of cache where the entry will be deleted.","$ref":"CacheId"},{"name":"request","description":"URL spec of the request.","type":"string"}]},{"name":"requestCacheNames","description":"Requests cache names.","parameters":[{"name":"securityOrigin","description":"Security origin.","type":"string"}],"returns":[{"name":"caches","description":"Caches for the security origin.","type":"array","items":{"$ref":"Cache"}}]},{"name":"requestCachedResponse","description":"Fetches cache entry.","parameters":[{"name":"cacheId","description":"Id of cache that contains the entry.","$ref":"CacheId"},{"name":"requestURL","description":"URL spec of the request.","type":"string"},{"name":"requestHeaders","description":"headers of the request.","type":"array","items":{"$ref":"Header"}}],"returns":[{"name":"response","description":"Response read from the cache.","$ref":"CachedResponse"}]},{"name":"requestEntries","description":"Requests data from cache.","parameters":[{"name":"cacheId","description":"ID of cache to get entries from.","$ref":"CacheId"},{"name":"skipCount","description":"Number of records to skip.","type":"integer"},{"name":"pageSize","description":"Number of records to fetch.","type":"integer"},{"name":"pathFilter","description":"If present, only return the entries containing this substring in the path","optional":true,"type":"string"}],"returns":[{"name":"cacheDataEntries","description":"Array of object store data entries.","type":"array","items":{"$ref":"DataEntry"}},{"name":"returnCount","description":"Count of returned entries from this storage. If pathFilter is empty, it\\nis the count of all entries from this storage.","type":"number"}]}]},{"domain":"Cast","description":"A domain for interacting with Cast, Presentation API, and Remote Playback API\\nfunctionalities.","experimental":true,"types":[{"id":"Sink","type":"object","properties":[{"name":"name","type":"string"},{"name":"id","type":"string"},{"name":"session","description":"Text describing the current session. Present only if there is an active\\nsession on the sink.","optional":true,"type":"string"}]}],"commands":[{"name":"enable","description":"Starts observing for sinks that can be used for tab mirroring, and if set,\\nsinks compatible with |presentationUrl| as well. When sinks are found, a\\n|sinksUpdated| event is fired.\\nAlso starts observing for issue messages. When an issue is added or removed,\\nan |issueUpdated| event is fired.","parameters":[{"name":"presentationUrl","optional":true,"type":"string"}]},{"name":"disable","description":"Stops observing for sinks and issues."},{"name":"setSinkToUse","description":"Sets a sink to be used when the web page requests the browser to choose a\\nsink via Presentation API, Remote Playback API, or Cast SDK.","parameters":[{"name":"sinkName","type":"string"}]},{"name":"startTabMirroring","description":"Starts mirroring the tab to the sink.","parameters":[{"name":"sinkName","type":"string"}]},{"name":"stopCasting","description":"Stops the active Cast session on the sink.","parameters":[{"name":"sinkName","type":"string"}]}],"events":[{"name":"sinksUpdated","description":"This is fired whenever the list of available sinks changes. A sink is a\\ndevice or a software surface that you can cast to.","parameters":[{"name":"sinks","type":"array","items":{"$ref":"Sink"}}]},{"name":"issueUpdated","description":"This is fired whenever the outstanding issue/error message changes.\\n|issueMessage| is empty if there is no issue.","parameters":[{"name":"issueMessage","type":"string"}]}]},{"domain":"DOM","description":"This domain exposes DOM read/write operations. Each DOM Node is represented with its mirror object\\nthat has an `id`. This `id` can be used to get additional information on the Node, resolve it into\\nthe JavaScript object wrapper, etc. It is important that client receives DOM events only for the\\nnodes that are known to the client. Backend keeps track of the nodes that were sent to the client\\nand never sends the same node twice. It is client\'s responsibility to collect information about\\nthe nodes that were sent to the client.